Skip to content

Commit

Permalink
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Deploy to GitHub pages
Browse files Browse the repository at this point in the history
github-actions[bot] authored Mar 2, 2024
0 parents commit 2b889d2
Showing 293 changed files with 122,712 additions and 0 deletions.
Empty file added .nojekyll
Empty file.
41 changes: 41 additions & 0 deletions 404.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>Single Page Apps for GitHub Pages</title>
<script type="text/javascript">
// Single Page Apps for GitHub Pages
// https://github.com/rafrex/spa-github-pages
// Copyright (c) 2016 Rafael Pedicini, licensed under the MIT License
// ----------------------------------------------------------------------
// This script takes the current url and converts the path and query
// string into just a query string, and then redirects the browser
// to the new url with only a query string and hash fragment,
// e.g. http://www.foo.tld/one/two?a=b&c=d#qwe, becomes
// http://www.foo.tld/?p=/one/two&q=a=b~and~c=d#qwe
// Note: this 404.html file must be at least 512 bytes for it to work
// with Internet Explorer (it is currently > 512 bytes)

// If you're creating a Project Pages site and NOT using a custom domain,
// then set segmentCount to 1 (enterprise users may need to set it to > 1).
// This way the code will only replace the route part of the path, and not
// the real directory in which the app resides, for example:
// https://username.github.io/repo-name/one/two?a=b&c=d#qwe becomes
// https://username.github.io/repo-name/?p=/one/two&q=a=b~and~c=d#qwe
// Otherwise, leave segmentCount as 0.
var segmentCount = 1;

var l = window.location;
l.replace(
l.protocol + '//' + l.hostname + (l.port ? ':' + l.port : '') +
l.pathname.split('/').slice(0, 1 + segmentCount).join('/') + '/?p=/' +
l.pathname.slice(1).split('/').slice(segmentCount).join('/').replace(/&/g, '~and~') +
(l.search ? '&q=' + l.search.slice(1).replace(/&/g, '~and~') : '') +
l.hash
);

</script>
</head>
<body>
</body>
</html>
162 changes: 162 additions & 0 deletions Blazor.Client.HelloWorld.styles.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,162 @@
/* /Layout/MainLayout.razor.rz.scp.css */
.page[b-4dm5u4kboc] {
position: relative;
display: flex;
flex-direction: column;
}

main[b-4dm5u4kboc] {
flex: 1;
}

.sidebar[b-4dm5u4kboc] {
background-image: linear-gradient(180deg, rgb(5, 39, 103) 0%, #3a0647 70%);
}

.top-row[b-4dm5u4kboc] {
background-color: #f7f7f7;
border-bottom: 1px solid #d6d5d5;
justify-content: flex-end;
height: 3.5rem;
display: flex;
align-items: center;
}

.top-row[b-4dm5u4kboc] a, .top-row[b-4dm5u4kboc] .btn-link {
white-space: nowrap;
margin-left: 1.5rem;
text-decoration: none;
}

.top-row[b-4dm5u4kboc] a:hover, .top-row[b-4dm5u4kboc] .btn-link:hover {
text-decoration: underline;
}

.top-row[b-4dm5u4kboc] a:first-child {
overflow: hidden;
text-overflow: ellipsis;
}

@media (max-width: 640.98px) {
.top-row[b-4dm5u4kboc] {
justify-content: space-between;
}

.top-row[b-4dm5u4kboc] a, .top-row[b-4dm5u4kboc] .btn-link {
margin-left: 0;
}
}

@media (min-width: 641px) {
.page[b-4dm5u4kboc] {
flex-direction: row;
}

.sidebar[b-4dm5u4kboc] {
width: 250px;
height: 100vh;
position: sticky;
top: 0;
}

.top-row[b-4dm5u4kboc] {
position: sticky;
top: 0;
z-index: 1;
}

.top-row.auth[b-4dm5u4kboc] a:first-child {
flex: 1;
text-align: right;
width: 0;
}

.top-row[b-4dm5u4kboc], article[b-4dm5u4kboc] {
padding-left: 2rem !important;
padding-right: 1.5rem !important;
}
}
/* /Layout/NavMenu.razor.rz.scp.css */
.navbar-toggler[b-60nqjbcpxt] {
background-color: rgba(255, 255, 255, 0.1);
}

.top-row[b-60nqjbcpxt] {
height: 3.5rem;
background-color: rgba(0,0,0,0.4);
}

.navbar-brand[b-60nqjbcpxt] {
font-size: 1.1rem;
}

.bi[b-60nqjbcpxt] {
display: inline-block;
position: relative;
width: 1.25rem;
height: 1.25rem;
margin-right: 0.75rem;
top: -1px;
background-size: cover;
}

.bi-house-door-fill-nav-menu[b-60nqjbcpxt] {
background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='white' class='bi bi-house-door-fill' viewBox='0 0 16 16'%3E%3Cpath d='M6.5 14.5v-3.505c0-.245.25-.495.5-.495h2c.25 0 .5.25.5.5v3.5a.5.5 0 0 0 .5.5h4a.5.5 0 0 0 .5-.5v-7a.5.5 0 0 0-.146-.354L13 5.793V2.5a.5.5 0 0 0-.5-.5h-1a.5.5 0 0 0-.5.5v1.293L8.354 1.146a.5.5 0 0 0-.708 0l-6 6A.5.5 0 0 0 1.5 7.5v7a.5.5 0 0 0 .5.5h4a.5.5 0 0 0 .5-.5Z'/%3E%3C/svg%3E");
}

.bi-plus-square-fill-nav-menu[b-60nqjbcpxt] {
background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='white' class='bi bi-plus-square-fill' viewBox='0 0 16 16'%3E%3Cpath d='M2 0a2 2 0 0 0-2 2v12a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V2a2 2 0 0 0-2-2H2zm6.5 4.5v3h3a.5.5 0 0 1 0 1h-3v3a.5.5 0 0 1-1 0v-3h-3a.5.5 0 0 1 0-1h3v-3a.5.5 0 0 1 1 0z'/%3E%3C/svg%3E");
}

.bi-list-nested-nav-menu[b-60nqjbcpxt] {
background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='white' class='bi bi-list-nested' viewBox='0 0 16 16'%3E%3Cpath fill-rule='evenodd' d='M4.5 11.5A.5.5 0 0 1 5 11h10a.5.5 0 0 1 0 1H5a.5.5 0 0 1-.5-.5zm-2-4A.5.5 0 0 1 3 7h10a.5.5 0 0 1 0 1H3a.5.5 0 0 1-.5-.5zm-2-4A.5.5 0 0 1 1 3h10a.5.5 0 0 1 0 1H1a.5.5 0 0 1-.5-.5z'/%3E%3C/svg%3E");
}

.nav-item[b-60nqjbcpxt] {
font-size: 0.9rem;
padding-bottom: 0.5rem;
}

.nav-item:first-of-type[b-60nqjbcpxt] {
padding-top: 1rem;
}

.nav-item:last-of-type[b-60nqjbcpxt] {
padding-bottom: 1rem;
}

.nav-item[b-60nqjbcpxt] a {
color: #d7d7d7;
border-radius: 4px;
height: 3rem;
display: flex;
align-items: center;
line-height: 3rem;
}

.nav-item[b-60nqjbcpxt] a.active {
background-color: rgba(255,255,255,0.37);
color: white;
}

.nav-item[b-60nqjbcpxt] a:hover {
background-color: rgba(255,255,255,0.1);
color: white;
}

@media (min-width: 641px) {
.navbar-toggler[b-60nqjbcpxt] {
display: none;
}

.collapse[b-60nqjbcpxt] {
/* Never collapse the sidebar for wide screens */
display: block;
}

.nav-scrollable[b-60nqjbcpxt] {
/* Allow sidebar to scroll for tall menus */
height: calc(100vh - 3.5rem);
overflow-y: auto;
}
}
Binary file added _framework/Blazor.Client.HelloWorld.pdb.gz
Binary file not shown.
Binary file added _framework/Blazor.Client.HelloWorld.wasm
Binary file not shown.
Binary file added _framework/Blazor.Client.HelloWorld.wasm.br
Binary file not shown.
Binary file added _framework/Blazor.Client.HelloWorld.wasm.gz
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file added _framework/Microsoft.AspNetCore.Components.wasm
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file added _framework/Microsoft.Extensions.Logging.wasm
Binary file not shown.
Binary file added _framework/Microsoft.Extensions.Logging.wasm.br
Binary file not shown.
Binary file added _framework/Microsoft.Extensions.Logging.wasm.gz
Binary file not shown.
Binary file added _framework/Microsoft.Extensions.Options.wasm
Binary file not shown.
Binary file added _framework/Microsoft.Extensions.Options.wasm.br
Binary file not shown.
Binary file added _framework/Microsoft.Extensions.Options.wasm.gz
Binary file not shown.
Binary file added _framework/Microsoft.Extensions.Primitives.wasm
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file added _framework/Microsoft.JSInterop.WebAssembly.wasm
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file added _framework/Microsoft.JSInterop.wasm
Binary file not shown.
Binary file added _framework/Microsoft.JSInterop.wasm.br
Binary file not shown.
Binary file added _framework/Microsoft.JSInterop.wasm.gz
Binary file not shown.
Binary file added _framework/System.Collections.Concurrent.wasm
Binary file not shown.
Binary file added _framework/System.Collections.Concurrent.wasm.br
Binary file not shown.
Binary file added _framework/System.Collections.Concurrent.wasm.gz
Binary file not shown.
Binary file added _framework/System.Collections.wasm
Binary file not shown.
Binary file added _framework/System.Collections.wasm.br
Binary file not shown.
Binary file added _framework/System.Collections.wasm.gz
Binary file not shown.
Binary file added _framework/System.ComponentModel.wasm
Binary file not shown.
Binary file added _framework/System.ComponentModel.wasm.br
Binary file not shown.
Binary file added _framework/System.ComponentModel.wasm.gz
Binary file not shown.
Binary file added _framework/System.Console.wasm
Binary file not shown.
Binary file added _framework/System.Console.wasm.br
Binary file not shown.
Binary file added _framework/System.Console.wasm.gz
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file added _framework/System.Linq.wasm
Binary file not shown.
Binary file added _framework/System.Linq.wasm.br
Binary file not shown.
Binary file added _framework/System.Linq.wasm.gz
Binary file not shown.
Binary file added _framework/System.Memory.wasm
Binary file not shown.
Binary file added _framework/System.Memory.wasm.br
Binary file not shown.
Binary file added _framework/System.Memory.wasm.gz
Binary file not shown.
Binary file added _framework/System.Net.Http.Json.wasm
Binary file not shown.
Binary file added _framework/System.Net.Http.Json.wasm.br
Binary file not shown.
Binary file added _framework/System.Net.Http.Json.wasm.gz
Binary file not shown.
Binary file added _framework/System.Net.Http.wasm
Binary file not shown.
Binary file added _framework/System.Net.Http.wasm.br
Binary file not shown.
Binary file added _framework/System.Net.Http.wasm.gz
Binary file not shown.
Binary file added _framework/System.Net.Primitives.wasm
Binary file not shown.
Binary file added _framework/System.Net.Primitives.wasm.br
Binary file not shown.
Binary file added _framework/System.Net.Primitives.wasm.gz
Binary file not shown.
Binary file added _framework/System.Private.CoreLib.wasm
Binary file not shown.
Binary file added _framework/System.Private.CoreLib.wasm.br
Binary file not shown.
Binary file added _framework/System.Private.CoreLib.wasm.gz
Binary file not shown.
Binary file added _framework/System.Private.Uri.wasm
Binary file not shown.
Binary file added _framework/System.Private.Uri.wasm.br
Binary file not shown.
Binary file added _framework/System.Private.Uri.wasm.gz
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file added _framework/System.Runtime.wasm
Binary file not shown.
Binary file added _framework/System.Runtime.wasm.br
Binary file not shown.
Binary file added _framework/System.Runtime.wasm.gz
Binary file not shown.
Binary file added _framework/System.Text.Encodings.Web.wasm
Binary file not shown.
Binary file added _framework/System.Text.Encodings.Web.wasm.br
Binary file not shown.
Binary file added _framework/System.Text.Encodings.Web.wasm.gz
Binary file not shown.
Binary file added _framework/System.Text.Json.wasm
Binary file not shown.
Binary file added _framework/System.Text.Json.wasm.br
Binary file not shown.
Binary file added _framework/System.Text.Json.wasm.gz
Binary file not shown.
Binary file added _framework/System.Text.RegularExpressions.wasm
Binary file not shown.
Binary file added _framework/System.Text.RegularExpressions.wasm.br
Binary file not shown.
Binary file added _framework/System.Text.RegularExpressions.wasm.gz
Binary file not shown.
61 changes: 61 additions & 0 deletions _framework/blazor.boot.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
{
"mainAssemblyName": "Blazor.Client.HelloWorld",
"resources": {
"hash": "sha256-2M4kMte0/NsHSkHHvCuyP2HNcAmkHteyJlj64pJClTk=",
"jsModuleNative": {
"dotnet.native.8.0.2.jgt5nhn140.js": "sha256-gPMK16QWoJSTxorlZJqcVtbBRTniIQWlLsJN2O4cJHg="
},
"jsModuleRuntime": {
"dotnet.runtime.8.0.2.8djt6nqnbz.js": "sha256-54KSaoOArNfygQbV+r4B5y3ys53v2tnvFIyZcZiUmi0="
},
"wasmNative": {
"dotnet.native.wasm": "sha256-C2P+OTYZAJlmqo6rc4heqwvIVVsXIF8MAxC6WRe96Eg="
},
"icu": {
"icudt_CJK.dat": "sha256-SZLtQnRc0JkwqHab0VUVP7T3uBPSeYzxzDnpxPpUnHk=",
"icudt_EFIGS.dat": "sha256-8fItetYY8kQ0ww6oxwTLiT3oXlBwHKumbeP2pRF4yTc=",
"icudt_no_CJK.dat": "sha256-L7sV7NEYP37/Qr2FPCePo5cJqRgTXRwGHuwF5Q+0Nfs="
},
"assembly": {
"Blazor.Client.HelloWorld.wasm": "sha256-igEHZHjoZtBoL31YMsrw2ZXYG+PuyYaxdQ+AcKH5Ysw=",
"Microsoft.AspNetCore.Components.wasm": "sha256-VS0AiSyRt/aiOantX+eu1XIT896oY37PcKt0QzpEb1A=",
"Microsoft.AspNetCore.Components.Web.wasm": "sha256-ivj7kxN8rrhTm1UV0H7dhsOewu6rhATFU2ZAG/YKLvA=",
"Microsoft.AspNetCore.Components.WebAssembly.wasm": "sha256-Ws5szf6fWPAXna+XyWsAhavx+WDFcA/91DQ7iPRPCMs=",
"Microsoft.Extensions.Configuration.Abstractions.wasm": "sha256-87sn2TYqgdZ95sXmavjKEzoEfMgHnYQ9LOvnMX+aZcI=",
"Microsoft.Extensions.Configuration.Json.wasm": "sha256-Sxmy2ZS134URxbHEvdbS6NcQ3zXS7UWx/5ZPpwiW7FA=",
"Microsoft.Extensions.Configuration.wasm": "sha256-jYqHUZ07UYWc8POk7xhas6xQYH7t1qoTcylqoDqncJk=",
"Microsoft.Extensions.DependencyInjection.Abstractions.wasm": "sha256-qFPcWaRT3TLje0Ka8NtmslI37vhqDxIH0UFb3lOPxVs=",
"Microsoft.Extensions.DependencyInjection.wasm": "sha256-gg8xZqJsBBrrNEyUGzYqhL3sqkuZ4AHAvdTdL9nZ0S0=",
"Microsoft.Extensions.Logging.Abstractions.wasm": "sha256-+Fgk2a7GOZ76M3YfJ+0IDUowOMx8/LBnDwuIKQr+/IA=",
"Microsoft.Extensions.Logging.wasm": "sha256-8BH+kQfjYuZWxprOICXJ4+tU0OdJOYDKN7G0S3zYYHI=",
"Microsoft.Extensions.Options.wasm": "sha256-6DN1malfyp0G0uOYwQY0nIN60XdXpVXUXXw0X2c8V8E=",
"Microsoft.Extensions.Primitives.wasm": "sha256-6187ynEahDlSLMBvD4vAmiLpZ3clRb5xu6rM7O8AxNo=",
"Microsoft.JSInterop.wasm": "sha256-lXwhdv0Is9FMH/j0+WH3zoNWAGLbVaONtGucJ/4URQ0=",
"Microsoft.JSInterop.WebAssembly.wasm": "sha256-CQVLCKiSxLN5ghyJZG3mhnMGRROdqrbNUjtAXB0nWb8=",
"System.Collections.Concurrent.wasm": "sha256-DEZ59fGbj2NqpZbDf9KV0hzXZkN0+vJaLNPPONQTjLo=",
"System.Collections.wasm": "sha256-jUkLWbuwcRraLhJrOmVuUMwWWWzkZxlSJwxLHOExyNQ=",
"System.ComponentModel.wasm": "sha256-qwurUoDSjnjNxAivtUxZqGvkOgARzX9ETuhBPrMx5Xo=",
"System.Console.wasm": "sha256-hcaSe3dddvUYzyPNpqoGVuiON/PLZocvLhbJ0wtpre8=",
"System.Diagnostics.DiagnosticSource.wasm": "sha256-9iJ2pIM3CtyKQa9OvLWruP22men2s3j2esJ4VtKP2mY=",
"System.Linq.wasm": "sha256-uOn2NQpv/BE0J7ag0lhIKWsUcxg3U4uEeZeXx+eIKrk=",
"System.Memory.wasm": "sha256-is0fLYQZE9huTBti4rGQQebqsfCdCmdu0IQTpRGE5VQ=",
"System.Net.Http.Json.wasm": "sha256-OokrkDWO1QqPoDdNYATXqmg/QjcZlvX4mFUl2nQsEus=",
"System.Net.Http.wasm": "sha256-Y1j94Tjt1bpOz4jRl8s4omRsXVNGymGqq5muEbVG4+I=",
"System.Net.Primitives.wasm": "sha256-vrxcafwRdBO97DDgX/hMZoKmutr7B8vL8NSYBIeBIvE=",
"System.Private.CoreLib.wasm": "sha256-QEaJaU/13Nt+/UWXjnhzQ4CLr29gc26bXzy6Ic0n99o=",
"System.Private.Uri.wasm": "sha256-L8m30jOMe5Z6BnjjKmf++wHOTRyhAoemWxbOHPAp/fM=",
"System.Runtime.InteropServices.JavaScript.wasm": "sha256-ycxtr4GQ01jpMX2HNlyDi/PdRSz1RFbrAfBdFnU1ad8=",
"System.Runtime.wasm": "sha256-fHpn8iPi58+dKMQGJfTqVOfoV3vdG1Ql/nFRL4R6J6M=",
"System.Text.Encodings.Web.wasm": "sha256-NnePSWCgIId8nOPCgziTKhDyG6uCBs+3W6fazrWLoUA=",
"System.Text.Json.wasm": "sha256-Parnf2p7TaYhLJUZobM4X2HMf1l5723i/E1q+7ElduI=",
"System.Text.RegularExpressions.wasm": "sha256-W20q/uEUAv0A+F6irUkY0pCZJo76wNuWpz3XgcLFB2M="
}
},
"cacheBootResources": true,
"debugLevel": 0,
"linkerEnabled": true,
"globalizationMode": "sharded",
"extensions": {
"blazor": {}
}
}
Binary file added _framework/blazor.boot.json.br
Binary file not shown.
Binary file added _framework/blazor.boot.json.gz
Binary file not shown.
1 change: 1 addition & 0 deletions _framework/blazor.webassembly.js

Large diffs are not rendered by default.

Binary file added _framework/blazor.webassembly.js.br
Binary file not shown.
Binary file added _framework/blazor.webassembly.js.gz
Binary file not shown.
4 changes: 4 additions & 0 deletions _framework/dotnet.js

Large diffs are not rendered by default.

Binary file added _framework/dotnet.js.br
Binary file not shown.
Binary file added _framework/dotnet.js.gz
Binary file not shown.
17 changes: 17 additions & 0 deletions _framework/dotnet.native.8.0.2.jgt5nhn140.js

Large diffs are not rendered by default.

Binary file added _framework/dotnet.native.8.0.2.jgt5nhn140.js.br
Binary file not shown.
Binary file added _framework/dotnet.native.8.0.2.jgt5nhn140.js.gz
Binary file not shown.
Binary file added _framework/dotnet.native.wasm
Binary file not shown.
Binary file added _framework/dotnet.native.wasm.br
Binary file not shown.
Binary file added _framework/dotnet.native.wasm.gz
Binary file not shown.
4 changes: 4 additions & 0 deletions _framework/dotnet.runtime.8.0.2.8djt6nqnbz.js

Large diffs are not rendered by default.

Binary file not shown.
Binary file not shown.
Binary file added _framework/icudt_CJK.dat
Binary file not shown.
Binary file added _framework/icudt_CJK.dat.br
Binary file not shown.
Binary file added _framework/icudt_CJK.dat.gz
Binary file not shown.
Binary file added _framework/icudt_EFIGS.dat
Binary file not shown.
Binary file added _framework/icudt_EFIGS.dat.br
Binary file not shown.
Binary file added _framework/icudt_EFIGS.dat.gz
Binary file not shown.
Binary file added _framework/icudt_no_CJK.dat
Binary file not shown.
Binary file added _framework/icudt_no_CJK.dat.br
Binary file not shown.
Binary file added _framework/icudt_no_CJK.dat.gz
Binary file not shown.
103 changes: 103 additions & 0 deletions css/app.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,103 @@
html, body {
font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;
}

h1:focus {
outline: none;
}

a, .btn-link {
color: #0071c1;
}

.btn-primary {
color: #fff;
background-color: #1b6ec2;
border-color: #1861ac;
}

.btn:focus, .btn:active:focus, .btn-link.nav-link:focus, .form-control:focus, .form-check-input:focus {
box-shadow: 0 0 0 0.1rem white, 0 0 0 0.25rem #258cfb;
}

.content {
padding-top: 1.1rem;
}

.valid.modified:not([type=checkbox]) {
outline: 1px solid #26b050;
}

.invalid {
outline: 1px solid red;
}

.validation-message {
color: red;
}

#blazor-error-ui {
background: lightyellow;
bottom: 0;
box-shadow: 0 -1px 2px rgba(0, 0, 0, 0.2);
display: none;
left: 0;
padding: 0.6rem 1.25rem 0.7rem 1.25rem;
position: fixed;
width: 100%;
z-index: 1000;
}

#blazor-error-ui .dismiss {
cursor: pointer;
position: absolute;
right: 0.75rem;
top: 0.5rem;
}

.blazor-error-boundary {
background: url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iNTYiIGhlaWdodD0iNDkiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgeG1sbnM6eGxpbms9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkveGxpbmsiIG92ZXJmbG93PSJoaWRkZW4iPjxkZWZzPjxjbGlwUGF0aCBpZD0iY2xpcDAiPjxyZWN0IHg9IjIzNSIgeT0iNTEiIHdpZHRoPSI1NiIgaGVpZ2h0PSI0OSIvPjwvY2xpcFBhdGg+PC9kZWZzPjxnIGNsaXAtcGF0aD0idXJsKCNjbGlwMCkiIHRyYW5zZm9ybT0idHJhbnNsYXRlKC0yMzUgLTUxKSI+PHBhdGggZD0iTTI2My41MDYgNTFDMjY0LjcxNyA1MSAyNjUuODEzIDUxLjQ4MzcgMjY2LjYwNiA1Mi4yNjU4TDI2Ny4wNTIgNTIuNzk4NyAyNjcuNTM5IDUzLjYyODMgMjkwLjE4NSA5Mi4xODMxIDI5MC41NDUgOTIuNzk1IDI5MC42NTYgOTIuOTk2QzI5MC44NzcgOTMuNTEzIDI5MSA5NC4wODE1IDI5MSA5NC42NzgyIDI5MSA5Ny4wNjUxIDI4OS4wMzggOTkgMjg2LjYxNyA5OUwyNDAuMzgzIDk5QzIzNy45NjMgOTkgMjM2IDk3LjA2NTEgMjM2IDk0LjY3ODIgMjM2IDk0LjM3OTkgMjM2LjAzMSA5NC4wODg2IDIzNi4wODkgOTMuODA3MkwyMzYuMzM4IDkzLjAxNjIgMjM2Ljg1OCA5Mi4xMzE0IDI1OS40NzMgNTMuNjI5NCAyNTkuOTYxIDUyLjc5ODUgMjYwLjQwNyA1Mi4yNjU4QzI2MS4yIDUxLjQ4MzcgMjYyLjI5NiA1MSAyNjMuNTA2IDUxWk0yNjMuNTg2IDY2LjAxODNDMjYwLjczNyA2Ni4wMTgzIDI1OS4zMTMgNjcuMTI0NSAyNTkuMzEzIDY5LjMzNyAyNTkuMzEzIDY5LjYxMDIgMjU5LjMzMiA2OS44NjA4IDI1OS4zNzEgNzAuMDg4N0wyNjEuNzk1IDg0LjAxNjEgMjY1LjM4IDg0LjAxNjEgMjY3LjgyMSA2OS43NDc1QzI2Ny44NiA2OS43MzA5IDI2Ny44NzkgNjkuNTg3NyAyNjcuODc5IDY5LjMxNzkgMjY3Ljg3OSA2Ny4xMTgyIDI2Ni40NDggNjYuMDE4MyAyNjMuNTg2IDY2LjAxODNaTTI2My41NzYgODYuMDU0N0MyNjEuMDQ5IDg2LjA1NDcgMjU5Ljc4NiA4Ny4zMDA1IDI1OS43ODYgODkuNzkyMSAyNTkuNzg2IDkyLjI4MzcgMjYxLjA0OSA5My41Mjk1IDI2My41NzYgOTMuNTI5NSAyNjYuMTE2IDkzLjUyOTUgMjY3LjM4NyA5Mi4yODM3IDI2Ny4zODcgODkuNzkyMSAyNjcuMzg3IDg3LjMwMDUgMjY2LjExNiA4Ni4wNTQ3IDI2My41NzYgODYuMDU0N1oiIGZpbGw9IiNGRkU1MDAiIGZpbGwtcnVsZT0iZXZlbm9kZCIvPjwvZz48L3N2Zz4=) no-repeat 1rem/1.8rem, #b32121;
padding: 1rem 1rem 1rem 3.7rem;
color: white;
}

.blazor-error-boundary::after {
content: "An error has occurred."
}

.loading-progress {
position: relative;
display: block;
width: 8rem;
height: 8rem;
margin: 20vh auto 1rem auto;
}

.loading-progress circle {
fill: none;
stroke: #e0e0e0;
stroke-width: 0.6rem;
transform-origin: 50% 50%;
transform: rotate(-90deg);
}

.loading-progress circle:last-child {
stroke: #1b6ec2;
stroke-dasharray: calc(3.141 * var(--blazor-load-percentage, 0%) * 0.8), 500%;
transition: stroke-dasharray 0.05s ease-in-out;
}

.loading-progress-text {
position: absolute;
text-align: center;
font-weight: bold;
inset: calc(20vh + 3.25rem) 0 auto 0.2rem;
}

.loading-progress-text:after {
content: var(--blazor-load-percentage-text, "Loading");
}

code {
color: #c02d76;
}
7 changes: 7 additions & 0 deletions css/bootstrap/bootstrap.min.css

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions css/bootstrap/bootstrap.min.css.map

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions decode.js

Large diffs are not rendered by default.

Binary file added favicon.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added icon-192.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
86 changes: 86 additions & 0 deletions index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,86 @@
<!DOCTYPE html>
<html lang="en">

<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Blazor.Client.HelloWorld</title>
<base href="/github-sample/" />
<link rel="stylesheet" href="css/bootstrap/bootstrap.min.css" />
<link rel="stylesheet" href="css/app.css" />
<link rel="icon" type="image/png" href="favicon.png" />
<link href="Blazor.Client.HelloWorld.styles.css" rel="stylesheet" />

<!-- Start Single Page Apps for GitHub Pages -->
<script type="text/javascript">
// Single Page Apps for GitHub Pages
// https://github.com/rafrex/spa-github-pages
// Copyright (c) 2016 Rafael Pedicini, licensed under the MIT License
// ----------------------------------------------------------------------
// This script checks to see if a redirect is present in the query string
// and converts it back into the correct url and adds it to the
// browser's history using window.history.replaceState(...),
// which won't cause the browser to attempt to load the new url.
// When the single page app is loaded further down in this file,
// the correct url will be waiting in the browser's history for
// the single page app to route accordingly.
(function (l) {
if (l.search) {
var q = {};
l.search.slice(1).split('&').forEach(function (v) {
var a = v.split('=');
q[a[0]] = a.slice(1).join('=').replace(/~and~/g, '&');
});
if (q.p !== undefined) {
window.history.replaceState(null, null,
l.pathname.slice(0, -1) + (q.p || '') +
(q.q ? ('?' + q.q) : '') +
l.hash
);
}
}
}(window.location))
</script>
<!-- End Single Page Apps for GitHub Pages -->

</head>

<body>
<div id="app">
<svg class="loading-progress">
<circle r="40%" cx="50%" cy="50%" />
<circle r="40%" cx="50%" cy="50%" />
</svg>
<div class="loading-progress-text"></div>
</div>

<div id="blazor-error-ui">
An unhandled error has occurred.
<a href="" class="reload">Reload</a>
<a class="dismiss">🗙</a>
</div>
<script src="_framework/blazor.webassembly.js"></script>
<script>
Blazor.start({
loadBootResource: function (type, name, defaultUri, integrity) {
// For framework resources, use the precompressed .br files for faster downloads
// This is needed only because GitHub pages doesn't natively support Brotli (or even gzip for .dll files)
if (type !== 'dotnetjs' && location.hostname !== 'localhost') {
return (async function () {
const response = await fetch(defaultUri + '.br', { cache: 'no-cache' });
if (!response.ok) {
throw new Error(response.statusText);
}
const originalResponseBuffer = await response.arrayBuffer();
const originalResponseArray = new Int8Array(originalResponseBuffer);
const decompressedResponseArray = BrotliDecode(originalResponseArray);
const contentType = type === 'dotnetwasm' ? 'application/wasm' : 'application/octet-stream';
return new Response(decompressedResponseArray, { headers: { 'content-type': contentType } });
})();
}
}
});
</script>
</body>

</html>
194 changes: 194 additions & 0 deletions lib/tinymce/icons/default/icons.js

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions lib/tinymce/icons/default/icons.min.js

Large diffs are not rendered by default.

3 changes: 3 additions & 0 deletions lib/tinymce/langs/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
This is where language files should be placed.

Please DO NOT translate these directly, use this service instead: https://crowdin.com/project/tinymce
21 changes: 21 additions & 0 deletions lib/tinymce/license.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
MIT License

Copyright (c) 2022 Ephox Corporation DBA Tiny Technologies, Inc.

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
8,040 changes: 8,040 additions & 0 deletions lib/tinymce/models/dom/model.js

Large diffs are not rendered by default.

4 changes: 4 additions & 0 deletions lib/tinymce/models/dom/model.min.js

Large diffs are not rendered by default.

1,033 changes: 1,033 additions & 0 deletions lib/tinymce/plugins/accordion/plugin.js

Large diffs are not rendered by default.

4 changes: 4 additions & 0 deletions lib/tinymce/plugins/accordion/plugin.min.js
259 changes: 259 additions & 0 deletions lib/tinymce/plugins/advlist/plugin.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,259 @@
/**
* TinyMCE version 6.7.0 (2023-08-30)
*/

(function () {
'use strict';

var global$1 = tinymce.util.Tools.resolve('tinymce.PluginManager');

const applyListFormat = (editor, listName, styleValue) => {
const cmd = listName === 'UL' ? 'InsertUnorderedList' : 'InsertOrderedList';
editor.execCommand(cmd, false, styleValue === false ? null : { 'list-style-type': styleValue });
};

const register$2 = editor => {
editor.addCommand('ApplyUnorderedListStyle', (ui, value) => {
applyListFormat(editor, 'UL', value['list-style-type']);
});
editor.addCommand('ApplyOrderedListStyle', (ui, value) => {
applyListFormat(editor, 'OL', value['list-style-type']);
});
};

const option = name => editor => editor.options.get(name);
const register$1 = editor => {
const registerOption = editor.options.register;
registerOption('advlist_number_styles', {
processor: 'string[]',
default: 'default,lower-alpha,lower-greek,lower-roman,upper-alpha,upper-roman'.split(',')
});
registerOption('advlist_bullet_styles', {
processor: 'string[]',
default: 'default,circle,square'.split(',')
});
};
const getNumberStyles = option('advlist_number_styles');
const getBulletStyles = option('advlist_bullet_styles');

const isNullable = a => a === null || a === undefined;
const isNonNullable = a => !isNullable(a);

var global = tinymce.util.Tools.resolve('tinymce.util.Tools');

class Optional {
constructor(tag, value) {
this.tag = tag;
this.value = value;
}
static some(value) {
return new Optional(true, value);
}
static none() {
return Optional.singletonNone;
}
fold(onNone, onSome) {
if (this.tag) {
return onSome(this.value);
} else {
return onNone();
}
}
isSome() {
return this.tag;
}
isNone() {
return !this.tag;
}
map(mapper) {
if (this.tag) {
return Optional.some(mapper(this.value));
} else {
return Optional.none();
}
}
bind(binder) {
if (this.tag) {
return binder(this.value);
} else {
return Optional.none();
}
}
exists(predicate) {
return this.tag && predicate(this.value);
}
forall(predicate) {
return !this.tag || predicate(this.value);
}
filter(predicate) {
if (!this.tag || predicate(this.value)) {
return this;
} else {
return Optional.none();
}
}
getOr(replacement) {
return this.tag ? this.value : replacement;
}
or(replacement) {
return this.tag ? this : replacement;
}
getOrThunk(thunk) {
return this.tag ? this.value : thunk();
}
orThunk(thunk) {
return this.tag ? this : thunk();
}
getOrDie(message) {
if (!this.tag) {
throw new Error(message !== null && message !== void 0 ? message : 'Called getOrDie on None');
} else {
return this.value;
}
}
static from(value) {
return isNonNullable(value) ? Optional.some(value) : Optional.none();
}
getOrNull() {
return this.tag ? this.value : null;
}
getOrUndefined() {
return this.value;
}
each(worker) {
if (this.tag) {
worker(this.value);
}
}
toArray() {
return this.tag ? [this.value] : [];
}
toString() {
return this.tag ? `some(${ this.value })` : 'none()';
}
}
Optional.singletonNone = new Optional(false);

const findUntil = (xs, pred, until) => {
for (let i = 0, len = xs.length; i < len; i++) {
const x = xs[i];
if (pred(x, i)) {
return Optional.some(x);
} else if (until(x, i)) {
break;
}
}
return Optional.none();
};

const isCustomList = list => /\btox\-/.test(list.className);
const isChildOfBody = (editor, elm) => {
return editor.dom.isChildOf(elm, editor.getBody());
};
const matchNodeNames = regex => node => isNonNullable(node) && regex.test(node.nodeName);
const isListNode = matchNodeNames(/^(OL|UL|DL)$/);
const isTableCellNode = matchNodeNames(/^(TH|TD)$/);
const inList = (editor, parents, nodeName) => findUntil(parents, parent => isListNode(parent) && !isCustomList(parent), isTableCellNode).exists(list => list.nodeName === nodeName && isChildOfBody(editor, list));
const getSelectedStyleType = editor => {
const listElm = editor.dom.getParent(editor.selection.getNode(), 'ol,ul');
const style = editor.dom.getStyle(listElm, 'listStyleType');
return Optional.from(style);
};
const isWithinNonEditable = (editor, element) => element !== null && !editor.dom.isEditable(element);
const isWithinNonEditableList = (editor, element) => {
const parentList = editor.dom.getParent(element, 'ol,ul,dl');
return isWithinNonEditable(editor, parentList) && editor.selection.isEditable();
};
const setNodeChangeHandler = (editor, nodeChangeHandler) => {
const initialNode = editor.selection.getNode();
nodeChangeHandler({
parents: editor.dom.getParents(initialNode),
element: initialNode
});
editor.on('NodeChange', nodeChangeHandler);
return () => editor.off('NodeChange', nodeChangeHandler);
};

const styleValueToText = styleValue => {
return styleValue.replace(/\-/g, ' ').replace(/\b\w/g, chr => {
return chr.toUpperCase();
});
};
const normalizeStyleValue = styleValue => isNullable(styleValue) || styleValue === 'default' ? '' : styleValue;
const makeSetupHandler = (editor, nodeName) => api => {
const updateButtonState = (editor, parents) => {
const element = editor.selection.getStart(true);
api.setActive(inList(editor, parents, nodeName));
api.setEnabled(!isWithinNonEditableList(editor, element) && editor.selection.isEditable());
};
const nodeChangeHandler = e => updateButtonState(editor, e.parents);
return setNodeChangeHandler(editor, nodeChangeHandler);
};
const addSplitButton = (editor, id, tooltip, cmd, nodeName, styles) => {
editor.ui.registry.addSplitButton(id, {
tooltip,
icon: nodeName === 'OL' ? 'ordered-list' : 'unordered-list',
presets: 'listpreview',
columns: 3,
fetch: callback => {
const items = global.map(styles, styleValue => {
const iconStyle = nodeName === 'OL' ? 'num' : 'bull';
const iconName = styleValue === 'disc' || styleValue === 'decimal' ? 'default' : styleValue;
const itemValue = normalizeStyleValue(styleValue);
const displayText = styleValueToText(styleValue);
return {
type: 'choiceitem',
value: itemValue,
icon: 'list-' + iconStyle + '-' + iconName,
text: displayText
};
});
callback(items);
},
onAction: () => editor.execCommand(cmd),
onItemAction: (_splitButtonApi, value) => {
applyListFormat(editor, nodeName, value);
},
select: value => {
const listStyleType = getSelectedStyleType(editor);
return listStyleType.map(listStyle => value === listStyle).getOr(false);
},
onSetup: makeSetupHandler(editor, nodeName)
});
};
const addButton = (editor, id, tooltip, cmd, nodeName, styleValue) => {
editor.ui.registry.addToggleButton(id, {
active: false,
tooltip,
icon: nodeName === 'OL' ? 'ordered-list' : 'unordered-list',
onSetup: makeSetupHandler(editor, nodeName),
onAction: () => editor.queryCommandState(cmd) || styleValue === '' ? editor.execCommand(cmd) : applyListFormat(editor, nodeName, styleValue)
});
};
const addControl = (editor, id, tooltip, cmd, nodeName, styles) => {
if (styles.length > 1) {
addSplitButton(editor, id, tooltip, cmd, nodeName, styles);
} else {
addButton(editor, id, tooltip, cmd, nodeName, normalizeStyleValue(styles[0]));
}
};
const register = editor => {
addControl(editor, 'numlist', 'Numbered list', 'InsertOrderedList', 'OL', getNumberStyles(editor));
addControl(editor, 'bullist', 'Bullet list', 'InsertUnorderedList', 'UL', getBulletStyles(editor));
};

var Plugin = () => {
global$1.add('advlist', editor => {
if (editor.hasPlugin('lists')) {
register$1(editor);
register(editor);
register$2(editor);
} else {
console.error('Please use the Lists plugin together with the Advanced List plugin.');
}
});
};

Plugin();

})();
4 changes: 4 additions & 0 deletions lib/tinymce/plugins/advlist/plugin.min.js
214 changes: 214 additions & 0 deletions lib/tinymce/plugins/anchor/plugin.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,214 @@
/**
* TinyMCE version 6.7.0 (2023-08-30)
*/

(function () {
'use strict';

var global$2 = tinymce.util.Tools.resolve('tinymce.PluginManager');

var global$1 = tinymce.util.Tools.resolve('tinymce.dom.RangeUtils');

var global = tinymce.util.Tools.resolve('tinymce.util.Tools');

const option = name => editor => editor.options.get(name);
const register$2 = editor => {
const registerOption = editor.options.register;
registerOption('allow_html_in_named_anchor', {
processor: 'boolean',
default: false
});
};
const allowHtmlInNamedAnchor = option('allow_html_in_named_anchor');

const namedAnchorSelector = 'a:not([href])';
const isEmptyString = str => !str;
const getIdFromAnchor = elm => {
const id = elm.getAttribute('id') || elm.getAttribute('name');
return id || '';
};
const isAnchor = elm => elm.nodeName.toLowerCase() === 'a';
const isNamedAnchor = elm => isAnchor(elm) && !elm.getAttribute('href') && getIdFromAnchor(elm) !== '';
const isEmptyNamedAnchor = elm => isNamedAnchor(elm) && !elm.firstChild;

const removeEmptyNamedAnchorsInSelection = editor => {
const dom = editor.dom;
global$1(dom).walk(editor.selection.getRng(), nodes => {
global.each(nodes, node => {
if (isEmptyNamedAnchor(node)) {
dom.remove(node, false);
}
});
});
};
const isValidId = id => /^[A-Za-z][A-Za-z0-9\-:._]*$/.test(id);
const getNamedAnchor = editor => editor.dom.getParent(editor.selection.getStart(), namedAnchorSelector);
const getId = editor => {
const anchor = getNamedAnchor(editor);
if (anchor) {
return getIdFromAnchor(anchor);
} else {
return '';
}
};
const createAnchor = (editor, id) => {
editor.undoManager.transact(() => {
if (!allowHtmlInNamedAnchor(editor)) {
editor.selection.collapse(true);
}
if (editor.selection.isCollapsed()) {
editor.insertContent(editor.dom.createHTML('a', { id }));
} else {
removeEmptyNamedAnchorsInSelection(editor);
editor.formatter.remove('namedAnchor', undefined, undefined, true);
editor.formatter.apply('namedAnchor', { value: id });
editor.addVisual();
}
});
};
const updateAnchor = (editor, id, anchorElement) => {
anchorElement.removeAttribute('name');
anchorElement.id = id;
editor.addVisual();
editor.undoManager.add();
};
const insert = (editor, id) => {
const anchor = getNamedAnchor(editor);
if (anchor) {
updateAnchor(editor, id, anchor);
} else {
createAnchor(editor, id);
}
editor.focus();
};

const insertAnchor = (editor, newId) => {
if (!isValidId(newId)) {
editor.windowManager.alert('ID should start with a letter, followed only by letters, numbers, dashes, dots, colons or underscores.');
return false;
} else {
insert(editor, newId);
return true;
}
};
const open = editor => {
const currentId = getId(editor);
editor.windowManager.open({
title: 'Anchor',
size: 'normal',
body: {
type: 'panel',
items: [{
name: 'id',
type: 'input',
label: 'ID',
placeholder: 'example'
}]
},
buttons: [
{
type: 'cancel',
name: 'cancel',
text: 'Cancel'
},
{
type: 'submit',
name: 'save',
text: 'Save',
primary: true
}
],
initialData: { id: currentId },
onSubmit: api => {
if (insertAnchor(editor, api.getData().id)) {
api.close();
}
}
});
};

const register$1 = editor => {
editor.addCommand('mceAnchor', () => {
open(editor);
});
};

const isNamedAnchorNode = node => isEmptyString(node.attr('href')) && !isEmptyString(node.attr('id') || node.attr('name'));
const isEmptyNamedAnchorNode = node => isNamedAnchorNode(node) && !node.firstChild;
const setContentEditable = state => nodes => {
for (let i = 0; i < nodes.length; i++) {
const node = nodes[i];
if (isEmptyNamedAnchorNode(node)) {
node.attr('contenteditable', state);
}
}
};
const setup = editor => {
editor.on('PreInit', () => {
editor.parser.addNodeFilter('a', setContentEditable('false'));
editor.serializer.addNodeFilter('a', setContentEditable(null));
});
};

const registerFormats = editor => {
editor.formatter.register('namedAnchor', {
inline: 'a',
selector: namedAnchorSelector,
remove: 'all',
split: true,
deep: true,
attributes: { id: '%value' },
onmatch: (node, _fmt, _itemName) => {
return isNamedAnchor(node);
}
});
};

const onSetupEditable = editor => api => {
const nodeChanged = () => {
api.setEnabled(editor.selection.isEditable());
};
editor.on('NodeChange', nodeChanged);
nodeChanged();
return () => {
editor.off('NodeChange', nodeChanged);
};
};
const register = editor => {
const onAction = () => editor.execCommand('mceAnchor');
editor.ui.registry.addToggleButton('anchor', {
icon: 'bookmark',
tooltip: 'Anchor',
onAction,
onSetup: buttonApi => {
const unbindSelectorChanged = editor.selection.selectorChangedWithUnbind('a:not([href])', buttonApi.setActive).unbind;
const unbindEditableChanged = onSetupEditable(editor)(buttonApi);
return () => {
unbindSelectorChanged();
unbindEditableChanged();
};
}
});
editor.ui.registry.addMenuItem('anchor', {
icon: 'bookmark',
text: 'Anchor...',
onAction,
onSetup: onSetupEditable(editor)
});
};

var Plugin = () => {
global$2.add('anchor', editor => {
register$2(editor);
setup(editor);
register$1(editor);
register(editor);
editor.on('PreInit', () => {
registerFormats(editor);
});
});
};

Plugin();

})();
4 changes: 4 additions & 0 deletions lib/tinymce/plugins/anchor/plugin.min.js
228 changes: 228 additions & 0 deletions lib/tinymce/plugins/autolink/plugin.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,228 @@
/**
* TinyMCE version 6.7.0 (2023-08-30)
*/

(function () {
'use strict';

var global$1 = tinymce.util.Tools.resolve('tinymce.PluginManager');

const link = () => /(?:[A-Za-z][A-Za-z\d.+-]{0,14}:\/\/(?:[-.~*+=!&;:'%@?^${}(),\w]+@)?|www\.|[-;:&=+$,.\w]+@)[A-Za-z\d-]+(?:\.[A-Za-z\d-]+)*(?::\d+)?(?:\/(?:[-.~*+=!;:'%@$(),\/\w]*[-~*+=%@$()\/\w])?)?(?:\?(?:[-.~*+=!&;:'%@?^${}(),\/\w]+))?(?:#(?:[-.~*+=!&;:'%@?^${}(),\/\w]+))?/g;

const option = name => editor => editor.options.get(name);
const register = editor => {
const registerOption = editor.options.register;
registerOption('autolink_pattern', {
processor: 'regexp',
default: new RegExp('^' + link().source + '$', 'i')
});
registerOption('link_default_target', { processor: 'string' });
registerOption('link_default_protocol', {
processor: 'string',
default: 'https'
});
};
const getAutoLinkPattern = option('autolink_pattern');
const getDefaultLinkTarget = option('link_default_target');
const getDefaultLinkProtocol = option('link_default_protocol');
const allowUnsafeLinkTarget = option('allow_unsafe_link_target');

const hasProto = (v, constructor, predicate) => {
var _a;
if (predicate(v, constructor.prototype)) {
return true;
} else {
return ((_a = v.constructor) === null || _a === void 0 ? void 0 : _a.name) === constructor.name;
}
};
const typeOf = x => {
const t = typeof x;
if (x === null) {
return 'null';
} else if (t === 'object' && Array.isArray(x)) {
return 'array';
} else if (t === 'object' && hasProto(x, String, (o, proto) => proto.isPrototypeOf(o))) {
return 'string';
} else {
return t;
}
};
const isType = type => value => typeOf(value) === type;
const eq = t => a => t === a;
const isString = isType('string');
const isUndefined = eq(undefined);
const isNullable = a => a === null || a === undefined;
const isNonNullable = a => !isNullable(a);

const not = f => t => !f(t);

const hasOwnProperty = Object.hasOwnProperty;
const has = (obj, key) => hasOwnProperty.call(obj, key);

const checkRange = (str, substr, start) => substr === '' || str.length >= substr.length && str.substr(start, start + substr.length) === substr;
const contains = (str, substr, start = 0, end) => {
const idx = str.indexOf(substr, start);
if (idx !== -1) {
return isUndefined(end) ? true : idx + substr.length <= end;
} else {
return false;
}
};
const startsWith = (str, prefix) => {
return checkRange(str, prefix, 0);
};

const zeroWidth = '\uFEFF';
const isZwsp = char => char === zeroWidth;
const removeZwsp = s => s.replace(/\uFEFF/g, '');

var global = tinymce.util.Tools.resolve('tinymce.dom.TextSeeker');

const isTextNode = node => node.nodeType === 3;
const isElement = node => node.nodeType === 1;
const isBracketOrSpace = char => /^[(\[{ \u00a0]$/.test(char);
const hasProtocol = url => /^([A-Za-z][A-Za-z\d.+-]*:\/\/)|mailto:/.test(url);
const isPunctuation = char => /[?!,.;:]/.test(char);
const findChar = (text, index, predicate) => {
for (let i = index - 1; i >= 0; i--) {
const char = text.charAt(i);
if (!isZwsp(char) && predicate(char)) {
return i;
}
}
return -1;
};
const freefallRtl = (container, offset) => {
let tempNode = container;
let tempOffset = offset;
while (isElement(tempNode) && tempNode.childNodes[tempOffset]) {
tempNode = tempNode.childNodes[tempOffset];
tempOffset = isTextNode(tempNode) ? tempNode.data.length : tempNode.childNodes.length;
}
return {
container: tempNode,
offset: tempOffset
};
};

const parseCurrentLine = (editor, offset) => {
var _a;
const voidElements = editor.schema.getVoidElements();
const autoLinkPattern = getAutoLinkPattern(editor);
const {dom, selection} = editor;
if (dom.getParent(selection.getNode(), 'a[href]') !== null) {
return null;
}
const rng = selection.getRng();
const textSeeker = global(dom, node => {
return dom.isBlock(node) || has(voidElements, node.nodeName.toLowerCase()) || dom.getContentEditable(node) === 'false';
});
const {
container: endContainer,
offset: endOffset
} = freefallRtl(rng.endContainer, rng.endOffset);
const root = (_a = dom.getParent(endContainer, dom.isBlock)) !== null && _a !== void 0 ? _a : dom.getRoot();
const endSpot = textSeeker.backwards(endContainer, endOffset + offset, (node, offset) => {
const text = node.data;
const idx = findChar(text, offset, not(isBracketOrSpace));
return idx === -1 || isPunctuation(text[idx]) ? idx : idx + 1;
}, root);
if (!endSpot) {
return null;
}
let lastTextNode = endSpot.container;
const startSpot = textSeeker.backwards(endSpot.container, endSpot.offset, (node, offset) => {
lastTextNode = node;
const idx = findChar(node.data, offset, isBracketOrSpace);
return idx === -1 ? idx : idx + 1;
}, root);
const newRng = dom.createRng();
if (!startSpot) {
newRng.setStart(lastTextNode, 0);
} else {
newRng.setStart(startSpot.container, startSpot.offset);
}
newRng.setEnd(endSpot.container, endSpot.offset);
const rngText = removeZwsp(newRng.toString());
const matches = rngText.match(autoLinkPattern);
if (matches) {
let url = matches[0];
if (startsWith(url, 'www.')) {
const protocol = getDefaultLinkProtocol(editor);
url = protocol + '://' + url;
} else if (contains(url, '@') && !hasProtocol(url)) {
url = 'mailto:' + url;
}
return {
rng: newRng,
url
};
} else {
return null;
}
};
const convertToLink = (editor, result) => {
const {dom, selection} = editor;
const {rng, url} = result;
const bookmark = selection.getBookmark();
selection.setRng(rng);
const command = 'createlink';
const args = {
command,
ui: false,
value: url
};
const beforeExecEvent = editor.dispatch('BeforeExecCommand', args);
if (!beforeExecEvent.isDefaultPrevented()) {
editor.getDoc().execCommand(command, false, url);
editor.dispatch('ExecCommand', args);
const defaultLinkTarget = getDefaultLinkTarget(editor);
if (isString(defaultLinkTarget)) {
const anchor = selection.getNode();
dom.setAttrib(anchor, 'target', defaultLinkTarget);
if (defaultLinkTarget === '_blank' && !allowUnsafeLinkTarget(editor)) {
dom.setAttrib(anchor, 'rel', 'noopener');
}
}
}
selection.moveToBookmark(bookmark);
editor.nodeChanged();
};
const handleSpacebar = editor => {
const result = parseCurrentLine(editor, -1);
if (isNonNullable(result)) {
convertToLink(editor, result);
}
};
const handleBracket = handleSpacebar;
const handleEnter = editor => {
const result = parseCurrentLine(editor, 0);
if (isNonNullable(result)) {
convertToLink(editor, result);
}
};
const setup = editor => {
editor.on('keydown', e => {
if (e.keyCode === 13 && !e.isDefaultPrevented()) {
handleEnter(editor);
}
});
editor.on('keyup', e => {
if (e.keyCode === 32) {
handleSpacebar(editor);
} else if (e.keyCode === 48 && e.shiftKey || e.keyCode === 221) {
handleBracket(editor);
}
});
};

var Plugin = () => {
global$1.add('autolink', editor => {
register(editor);
setup(editor);
});
};

Plugin();

})();
4 changes: 4 additions & 0 deletions lib/tinymce/plugins/autolink/plugin.min.js
192 changes: 192 additions & 0 deletions lib/tinymce/plugins/autoresize/plugin.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,192 @@
/**
* TinyMCE version 6.7.0 (2023-08-30)
*/

(function () {
'use strict';

const Cell = initial => {
let value = initial;
const get = () => {
return value;
};
const set = v => {
value = v;
};
return {
get,
set
};
};

var global$1 = tinymce.util.Tools.resolve('tinymce.PluginManager');

const constant = value => {
return () => {
return value;
};
};

var global = tinymce.util.Tools.resolve('tinymce.Env');

const fireResizeEditor = editor => editor.dispatch('ResizeEditor');

const option = name => editor => editor.options.get(name);
const register$1 = editor => {
const registerOption = editor.options.register;
registerOption('autoresize_overflow_padding', {
processor: 'number',
default: 1
});
registerOption('autoresize_bottom_margin', {
processor: 'number',
default: 50
});
};
const getMinHeight = option('min_height');
const getMaxHeight = option('max_height');
const getAutoResizeOverflowPadding = option('autoresize_overflow_padding');
const getAutoResizeBottomMargin = option('autoresize_bottom_margin');

const isFullscreen = editor => editor.plugins.fullscreen && editor.plugins.fullscreen.isFullscreen();
const toggleScrolling = (editor, state) => {
const body = editor.getBody();
if (body) {
body.style.overflowY = state ? '' : 'hidden';
if (!state) {
body.scrollTop = 0;
}
}
};
const parseCssValueToInt = (dom, elm, name, computed) => {
var _a;
const value = parseInt((_a = dom.getStyle(elm, name, computed)) !== null && _a !== void 0 ? _a : '', 10);
return isNaN(value) ? 0 : value;
};
const shouldScrollIntoView = trigger => {
if ((trigger === null || trigger === void 0 ? void 0 : trigger.type.toLowerCase()) === 'setcontent') {
const setContentEvent = trigger;
return setContentEvent.selection === true || setContentEvent.paste === true;
} else {
return false;
}
};
const resize = (editor, oldSize, trigger, getExtraMarginBottom) => {
var _a;
const dom = editor.dom;
const doc = editor.getDoc();
if (!doc) {
return;
}
if (isFullscreen(editor)) {
toggleScrolling(editor, true);
return;
}
const docEle = doc.documentElement;
const resizeBottomMargin = getExtraMarginBottom ? getExtraMarginBottom() : getAutoResizeOverflowPadding(editor);
const minHeight = (_a = getMinHeight(editor)) !== null && _a !== void 0 ? _a : editor.getElement().offsetHeight;
let resizeHeight = minHeight;
const marginTop = parseCssValueToInt(dom, docEle, 'margin-top', true);
const marginBottom = parseCssValueToInt(dom, docEle, 'margin-bottom', true);
let contentHeight = docEle.offsetHeight + marginTop + marginBottom + resizeBottomMargin;
if (contentHeight < 0) {
contentHeight = 0;
}
const containerHeight = editor.getContainer().offsetHeight;
const contentAreaHeight = editor.getContentAreaContainer().offsetHeight;
const chromeHeight = containerHeight - contentAreaHeight;
if (contentHeight + chromeHeight > minHeight) {
resizeHeight = contentHeight + chromeHeight;
}
const maxHeight = getMaxHeight(editor);
if (maxHeight && resizeHeight > maxHeight) {
resizeHeight = maxHeight;
toggleScrolling(editor, true);
} else {
toggleScrolling(editor, false);
}
if (resizeHeight !== oldSize.get()) {
const deltaSize = resizeHeight - oldSize.get();
dom.setStyle(editor.getContainer(), 'height', resizeHeight + 'px');
oldSize.set(resizeHeight);
fireResizeEditor(editor);
if (global.browser.isSafari() && (global.os.isMacOS() || global.os.isiOS())) {
const win = editor.getWin();
win.scrollTo(win.pageXOffset, win.pageYOffset);
}
if (editor.hasFocus() && shouldScrollIntoView(trigger)) {
editor.selection.scrollIntoView();
}
if ((global.browser.isSafari() || global.browser.isChromium()) && deltaSize < 0) {
resize(editor, oldSize, trigger, getExtraMarginBottom);
}
}
};
const setup = (editor, oldSize) => {
let getExtraMarginBottom = () => getAutoResizeBottomMargin(editor);
let resizeCounter;
let sizeAfterFirstResize;
editor.on('init', e => {
resizeCounter = 0;
const overflowPadding = getAutoResizeOverflowPadding(editor);
const dom = editor.dom;
dom.setStyles(editor.getDoc().documentElement, { height: 'auto' });
if (global.browser.isEdge() || global.browser.isIE()) {
dom.setStyles(editor.getBody(), {
'paddingLeft': overflowPadding,
'paddingRight': overflowPadding,
'min-height': 0
});
} else {
dom.setStyles(editor.getBody(), {
paddingLeft: overflowPadding,
paddingRight: overflowPadding
});
}
resize(editor, oldSize, e, getExtraMarginBottom);
resizeCounter += 1;
});
editor.on('NodeChange SetContent keyup FullscreenStateChanged ResizeContent', e => {
if (resizeCounter === 1) {
sizeAfterFirstResize = editor.getContainer().offsetHeight;
resize(editor, oldSize, e, getExtraMarginBottom);
resizeCounter += 1;
} else if (resizeCounter === 2) {
const isLooping = sizeAfterFirstResize < editor.getContainer().offsetHeight;
if (isLooping) {
const dom = editor.dom;
const doc = editor.getDoc();
dom.setStyles(doc.documentElement, { 'min-height': 0 });
dom.setStyles(editor.getBody(), { 'min-height': 'inherit' });
}
getExtraMarginBottom = isLooping ? constant(0) : getExtraMarginBottom;
resizeCounter += 1;
} else {
resize(editor, oldSize, e, getExtraMarginBottom);
}
});
};

const register = (editor, oldSize) => {
editor.addCommand('mceAutoResize', () => {
resize(editor, oldSize);
});
};

var Plugin = () => {
global$1.add('autoresize', editor => {
register$1(editor);
if (!editor.options.isSet('resize')) {
editor.options.set('resize', false);
}
if (!editor.inline) {
const oldSize = Cell(0);
register(editor, oldSize);
setup(editor, oldSize);
}
});
};

Plugin();

})();
4 changes: 4 additions & 0 deletions lib/tinymce/plugins/autoresize/plugin.min.js
233 changes: 233 additions & 0 deletions lib/tinymce/plugins/autosave/plugin.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,233 @@
/**
* TinyMCE version 6.7.0 (2023-08-30)
*/

(function () {
'use strict';

var global$4 = tinymce.util.Tools.resolve('tinymce.PluginManager');

const hasProto = (v, constructor, predicate) => {
var _a;
if (predicate(v, constructor.prototype)) {
return true;
} else {
return ((_a = v.constructor) === null || _a === void 0 ? void 0 : _a.name) === constructor.name;
}
};
const typeOf = x => {
const t = typeof x;
if (x === null) {
return 'null';
} else if (t === 'object' && Array.isArray(x)) {
return 'array';
} else if (t === 'object' && hasProto(x, String, (o, proto) => proto.isPrototypeOf(o))) {
return 'string';
} else {
return t;
}
};
const isType = type => value => typeOf(value) === type;
const eq = t => a => t === a;
const isString = isType('string');
const isUndefined = eq(undefined);

var global$3 = tinymce.util.Tools.resolve('tinymce.util.Delay');

var global$2 = tinymce.util.Tools.resolve('tinymce.util.LocalStorage');

var global$1 = tinymce.util.Tools.resolve('tinymce.util.Tools');

const fireRestoreDraft = editor => editor.dispatch('RestoreDraft');
const fireStoreDraft = editor => editor.dispatch('StoreDraft');
const fireRemoveDraft = editor => editor.dispatch('RemoveDraft');

const parse = timeString => {
const multiples = {
s: 1000,
m: 60000
};
const parsedTime = /^(\d+)([ms]?)$/.exec(timeString);
return (parsedTime && parsedTime[2] ? multiples[parsedTime[2]] : 1) * parseInt(timeString, 10);
};

const option = name => editor => editor.options.get(name);
const register$1 = editor => {
const registerOption = editor.options.register;
const timeProcessor = value => {
const valid = isString(value);
if (valid) {
return {
value: parse(value),
valid
};
} else {
return {
valid: false,
message: 'Must be a string.'
};
}
};
registerOption('autosave_ask_before_unload', {
processor: 'boolean',
default: true
});
registerOption('autosave_prefix', {
processor: 'string',
default: 'tinymce-autosave-{path}{query}{hash}-{id}-'
});
registerOption('autosave_restore_when_empty', {
processor: 'boolean',
default: false
});
registerOption('autosave_interval', {
processor: timeProcessor,
default: '30s'
});
registerOption('autosave_retention', {
processor: timeProcessor,
default: '20m'
});
};
const shouldAskBeforeUnload = option('autosave_ask_before_unload');
const shouldRestoreWhenEmpty = option('autosave_restore_when_empty');
const getAutoSaveInterval = option('autosave_interval');
const getAutoSaveRetention = option('autosave_retention');
const getAutoSavePrefix = editor => {
const location = document.location;
return editor.options.get('autosave_prefix').replace(/{path}/g, location.pathname).replace(/{query}/g, location.search).replace(/{hash}/g, location.hash).replace(/{id}/g, editor.id);
};

const isEmpty = (editor, html) => {
if (isUndefined(html)) {
return editor.dom.isEmpty(editor.getBody());
} else {
const trimmedHtml = global$1.trim(html);
if (trimmedHtml === '') {
return true;
} else {
const fragment = new DOMParser().parseFromString(trimmedHtml, 'text/html');
return editor.dom.isEmpty(fragment);
}
}
};
const hasDraft = editor => {
var _a;
const time = parseInt((_a = global$2.getItem(getAutoSavePrefix(editor) + 'time')) !== null && _a !== void 0 ? _a : '0', 10) || 0;
if (new Date().getTime() - time > getAutoSaveRetention(editor)) {
removeDraft(editor, false);
return false;
}
return true;
};
const removeDraft = (editor, fire) => {
const prefix = getAutoSavePrefix(editor);
global$2.removeItem(prefix + 'draft');
global$2.removeItem(prefix + 'time');
if (fire !== false) {
fireRemoveDraft(editor);
}
};
const storeDraft = editor => {
const prefix = getAutoSavePrefix(editor);
if (!isEmpty(editor) && editor.isDirty()) {
global$2.setItem(prefix + 'draft', editor.getContent({
format: 'raw',
no_events: true
}));
global$2.setItem(prefix + 'time', new Date().getTime().toString());
fireStoreDraft(editor);
}
};
const restoreDraft = editor => {
var _a;
const prefix = getAutoSavePrefix(editor);
if (hasDraft(editor)) {
editor.setContent((_a = global$2.getItem(prefix + 'draft')) !== null && _a !== void 0 ? _a : '', { format: 'raw' });
fireRestoreDraft(editor);
}
};
const startStoreDraft = editor => {
const interval = getAutoSaveInterval(editor);
global$3.setEditorInterval(editor, () => {
storeDraft(editor);
}, interval);
};
const restoreLastDraft = editor => {
editor.undoManager.transact(() => {
restoreDraft(editor);
removeDraft(editor);
});
editor.focus();
};

const get = editor => ({
hasDraft: () => hasDraft(editor),
storeDraft: () => storeDraft(editor),
restoreDraft: () => restoreDraft(editor),
removeDraft: fire => removeDraft(editor, fire),
isEmpty: html => isEmpty(editor, html)
});

var global = tinymce.util.Tools.resolve('tinymce.EditorManager');

const setup = editor => {
editor.editorManager.on('BeforeUnload', e => {
let msg;
global$1.each(global.get(), editor => {
if (editor.plugins.autosave) {
editor.plugins.autosave.storeDraft();
}
if (!msg && editor.isDirty() && shouldAskBeforeUnload(editor)) {
msg = editor.translate('You have unsaved changes are you sure you want to navigate away?');
}
});
if (msg) {
e.preventDefault();
e.returnValue = msg;
}
});
};

const makeSetupHandler = editor => api => {
api.setEnabled(hasDraft(editor));
const editorEventCallback = () => api.setEnabled(hasDraft(editor));
editor.on('StoreDraft RestoreDraft RemoveDraft', editorEventCallback);
return () => editor.off('StoreDraft RestoreDraft RemoveDraft', editorEventCallback);
};
const register = editor => {
startStoreDraft(editor);
const onAction = () => {
restoreLastDraft(editor);
};
editor.ui.registry.addButton('restoredraft', {
tooltip: 'Restore last draft',
icon: 'restore-draft',
onAction,
onSetup: makeSetupHandler(editor)
});
editor.ui.registry.addMenuItem('restoredraft', {
text: 'Restore last draft',
icon: 'restore-draft',
onAction,
onSetup: makeSetupHandler(editor)
});
};

var Plugin = () => {
global$4.add('autosave', editor => {
register$1(editor);
setup(editor);
register(editor);
editor.on('init', () => {
if (shouldRestoreWhenEmpty(editor) && editor.dom.isEmpty(editor.getBody())) {
restoreDraft(editor);
}
});
return get(editor);
});
};

Plugin();

})();
4 changes: 4 additions & 0 deletions lib/tinymce/plugins/autosave/plugin.min.js
1,658 changes: 1,658 additions & 0 deletions lib/tinymce/plugins/charmap/plugin.js

Large diffs are not rendered by default.

4 changes: 4 additions & 0 deletions lib/tinymce/plugins/charmap/plugin.min.js
85 changes: 85 additions & 0 deletions lib/tinymce/plugins/code/plugin.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,85 @@
/**
* TinyMCE version 6.7.0 (2023-08-30)
*/

(function () {
'use strict';

var global = tinymce.util.Tools.resolve('tinymce.PluginManager');

const setContent = (editor, html) => {
editor.focus();
editor.undoManager.transact(() => {
editor.setContent(html);
});
editor.selection.setCursorLocation();
editor.nodeChanged();
};
const getContent = editor => {
return editor.getContent({ source_view: true });
};

const open = editor => {
const editorContent = getContent(editor);
editor.windowManager.open({
title: 'Source Code',
size: 'large',
body: {
type: 'panel',
items: [{
type: 'textarea',
name: 'code'
}]
},
buttons: [
{
type: 'cancel',
name: 'cancel',
text: 'Cancel'
},
{
type: 'submit',
name: 'save',
text: 'Save',
primary: true
}
],
initialData: { code: editorContent },
onSubmit: api => {
setContent(editor, api.getData().code);
api.close();
}
});
};

const register$1 = editor => {
editor.addCommand('mceCodeEditor', () => {
open(editor);
});
};

const register = editor => {
const onAction = () => editor.execCommand('mceCodeEditor');
editor.ui.registry.addButton('code', {
icon: 'sourcecode',
tooltip: 'Source code',
onAction
});
editor.ui.registry.addMenuItem('code', {
icon: 'sourcecode',
text: 'Source code',
onAction
});
};

var Plugin = () => {
global.add('code', editor => {
register$1(editor);
register(editor);
return {};
});
};

Plugin();

})();
4 changes: 4 additions & 0 deletions lib/tinymce/plugins/code/plugin.min.js
2,463 changes: 2,463 additions & 0 deletions lib/tinymce/plugins/codesample/plugin.js

Large diffs are not rendered by default.

4 changes: 4 additions & 0 deletions lib/tinymce/plugins/codesample/plugin.min.js

Large diffs are not rendered by default.

395 changes: 395 additions & 0 deletions lib/tinymce/plugins/directionality/plugin.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,395 @@
/**
* TinyMCE version 6.7.0 (2023-08-30)
*/

(function () {
'use strict';

var global = tinymce.util.Tools.resolve('tinymce.PluginManager');

const hasProto = (v, constructor, predicate) => {
var _a;
if (predicate(v, constructor.prototype)) {
return true;
} else {
return ((_a = v.constructor) === null || _a === void 0 ? void 0 : _a.name) === constructor.name;
}
};
const typeOf = x => {
const t = typeof x;
if (x === null) {
return 'null';
} else if (t === 'object' && Array.isArray(x)) {
return 'array';
} else if (t === 'object' && hasProto(x, String, (o, proto) => proto.isPrototypeOf(o))) {
return 'string';
} else {
return t;
}
};
const isType$1 = type => value => typeOf(value) === type;
const isSimpleType = type => value => typeof value === type;
const isString = isType$1('string');
const isBoolean = isSimpleType('boolean');
const isNullable = a => a === null || a === undefined;
const isNonNullable = a => !isNullable(a);
const isFunction = isSimpleType('function');
const isNumber = isSimpleType('number');

const compose1 = (fbc, fab) => a => fbc(fab(a));
const constant = value => {
return () => {
return value;
};
};
const never = constant(false);

class Optional {
constructor(tag, value) {
this.tag = tag;
this.value = value;
}
static some(value) {
return new Optional(true, value);
}
static none() {
return Optional.singletonNone;
}
fold(onNone, onSome) {
if (this.tag) {
return onSome(this.value);
} else {
return onNone();
}
}
isSome() {
return this.tag;
}
isNone() {
return !this.tag;
}
map(mapper) {
if (this.tag) {
return Optional.some(mapper(this.value));
} else {
return Optional.none();
}
}
bind(binder) {
if (this.tag) {
return binder(this.value);
} else {
return Optional.none();
}
}
exists(predicate) {
return this.tag && predicate(this.value);
}
forall(predicate) {
return !this.tag || predicate(this.value);
}
filter(predicate) {
if (!this.tag || predicate(this.value)) {
return this;
} else {
return Optional.none();
}
}
getOr(replacement) {
return this.tag ? this.value : replacement;
}
or(replacement) {
return this.tag ? this : replacement;
}
getOrThunk(thunk) {
return this.tag ? this.value : thunk();
}
orThunk(thunk) {
return this.tag ? this : thunk();
}
getOrDie(message) {
if (!this.tag) {
throw new Error(message !== null && message !== void 0 ? message : 'Called getOrDie on None');
} else {
return this.value;
}
}
static from(value) {
return isNonNullable(value) ? Optional.some(value) : Optional.none();
}
getOrNull() {
return this.tag ? this.value : null;
}
getOrUndefined() {
return this.value;
}
each(worker) {
if (this.tag) {
worker(this.value);
}
}
toArray() {
return this.tag ? [this.value] : [];
}
toString() {
return this.tag ? `some(${ this.value })` : 'none()';
}
}
Optional.singletonNone = new Optional(false);

const map = (xs, f) => {
const len = xs.length;
const r = new Array(len);
for (let i = 0; i < len; i++) {
const x = xs[i];
r[i] = f(x, i);
}
return r;
};
const each = (xs, f) => {
for (let i = 0, len = xs.length; i < len; i++) {
const x = xs[i];
f(x, i);
}
};
const filter = (xs, pred) => {
const r = [];
for (let i = 0, len = xs.length; i < len; i++) {
const x = xs[i];
if (pred(x, i)) {
r.push(x);
}
}
return r;
};

const DOCUMENT = 9;
const DOCUMENT_FRAGMENT = 11;
const ELEMENT = 1;
const TEXT = 3;

const fromHtml = (html, scope) => {
const doc = scope || document;
const div = doc.createElement('div');
div.innerHTML = html;
if (!div.hasChildNodes() || div.childNodes.length > 1) {
const message = 'HTML does not have a single root node';
console.error(message, html);
throw new Error(message);
}
return fromDom(div.childNodes[0]);
};
const fromTag = (tag, scope) => {
const doc = scope || document;
const node = doc.createElement(tag);
return fromDom(node);
};
const fromText = (text, scope) => {
const doc = scope || document;
const node = doc.createTextNode(text);
return fromDom(node);
};
const fromDom = node => {
if (node === null || node === undefined) {
throw new Error('Node cannot be null or undefined');
}
return { dom: node };
};
const fromPoint = (docElm, x, y) => Optional.from(docElm.dom.elementFromPoint(x, y)).map(fromDom);
const SugarElement = {
fromHtml,
fromTag,
fromText,
fromDom,
fromPoint
};

const is = (element, selector) => {
const dom = element.dom;
if (dom.nodeType !== ELEMENT) {
return false;
} else {
const elem = dom;
if (elem.matches !== undefined) {
return elem.matches(selector);
} else if (elem.msMatchesSelector !== undefined) {
return elem.msMatchesSelector(selector);
} else if (elem.webkitMatchesSelector !== undefined) {
return elem.webkitMatchesSelector(selector);
} else if (elem.mozMatchesSelector !== undefined) {
return elem.mozMatchesSelector(selector);
} else {
throw new Error('Browser lacks native selectors');
}
}
};

typeof window !== 'undefined' ? window : Function('return this;')();

const name = element => {
const r = element.dom.nodeName;
return r.toLowerCase();
};
const type = element => element.dom.nodeType;
const isType = t => element => type(element) === t;
const isElement = isType(ELEMENT);
const isText = isType(TEXT);
const isDocument = isType(DOCUMENT);
const isDocumentFragment = isType(DOCUMENT_FRAGMENT);
const isTag = tag => e => isElement(e) && name(e) === tag;

const owner = element => SugarElement.fromDom(element.dom.ownerDocument);
const documentOrOwner = dos => isDocument(dos) ? dos : owner(dos);
const parent = element => Optional.from(element.dom.parentNode).map(SugarElement.fromDom);
const children$2 = element => map(element.dom.childNodes, SugarElement.fromDom);

const rawSet = (dom, key, value) => {
if (isString(value) || isBoolean(value) || isNumber(value)) {
dom.setAttribute(key, value + '');
} else {
console.error('Invalid call to Attribute.set. Key ', key, ':: Value ', value, ':: Element ', dom);
throw new Error('Attribute value was not simple');
}
};
const set = (element, key, value) => {
rawSet(element.dom, key, value);
};
const remove = (element, key) => {
element.dom.removeAttribute(key);
};

const isShadowRoot = dos => isDocumentFragment(dos) && isNonNullable(dos.dom.host);
const supported = isFunction(Element.prototype.attachShadow) && isFunction(Node.prototype.getRootNode);
const getRootNode = supported ? e => SugarElement.fromDom(e.dom.getRootNode()) : documentOrOwner;
const getShadowRoot = e => {
const r = getRootNode(e);
return isShadowRoot(r) ? Optional.some(r) : Optional.none();
};
const getShadowHost = e => SugarElement.fromDom(e.dom.host);

const inBody = element => {
const dom = isText(element) ? element.dom.parentNode : element.dom;
if (dom === undefined || dom === null || dom.ownerDocument === null) {
return false;
}
const doc = dom.ownerDocument;
return getShadowRoot(SugarElement.fromDom(dom)).fold(() => doc.body.contains(dom), compose1(inBody, getShadowHost));
};

const ancestor$1 = (scope, predicate, isRoot) => {
let element = scope.dom;
const stop = isFunction(isRoot) ? isRoot : never;
while (element.parentNode) {
element = element.parentNode;
const el = SugarElement.fromDom(element);
if (predicate(el)) {
return Optional.some(el);
} else if (stop(el)) {
break;
}
}
return Optional.none();
};

const ancestor = (scope, selector, isRoot) => ancestor$1(scope, e => is(e, selector), isRoot);

const isSupported = dom => dom.style !== undefined && isFunction(dom.style.getPropertyValue);

const get = (element, property) => {
const dom = element.dom;
const styles = window.getComputedStyle(dom);
const r = styles.getPropertyValue(property);
return r === '' && !inBody(element) ? getUnsafeProperty(dom, property) : r;
};
const getUnsafeProperty = (dom, property) => isSupported(dom) ? dom.style.getPropertyValue(property) : '';

const getDirection = element => get(element, 'direction') === 'rtl' ? 'rtl' : 'ltr';

const children$1 = (scope, predicate) => filter(children$2(scope), predicate);

const children = (scope, selector) => children$1(scope, e => is(e, selector));

const getParentElement = element => parent(element).filter(isElement);
const getNormalizedBlock = (element, isListItem) => {
const normalizedElement = isListItem ? ancestor(element, 'ol,ul') : Optional.some(element);
return normalizedElement.getOr(element);
};
const isListItem = isTag('li');
const setDirOnElements = (dom, blocks, dir) => {
each(blocks, block => {
const blockElement = SugarElement.fromDom(block);
const isBlockElementListItem = isListItem(blockElement);
const normalizedBlock = getNormalizedBlock(blockElement, isBlockElementListItem);
const normalizedBlockParent = getParentElement(normalizedBlock);
normalizedBlockParent.each(parent => {
dom.setStyle(normalizedBlock.dom, 'direction', null);
const parentDirection = getDirection(parent);
if (parentDirection === dir) {
remove(normalizedBlock, 'dir');
} else {
set(normalizedBlock, 'dir', dir);
}
if (getDirection(normalizedBlock) !== dir) {
dom.setStyle(normalizedBlock.dom, 'direction', dir);
}
if (isBlockElementListItem) {
const listItems = children(normalizedBlock, 'li[dir],li[style]');
each(listItems, listItem => {
remove(listItem, 'dir');
dom.setStyle(listItem.dom, 'direction', null);
});
}
});
});
};
const setDir = (editor, dir) => {
if (editor.selection.isEditable()) {
setDirOnElements(editor.dom, editor.selection.getSelectedBlocks(), dir);
editor.nodeChanged();
}
};

const register$1 = editor => {
editor.addCommand('mceDirectionLTR', () => {
setDir(editor, 'ltr');
});
editor.addCommand('mceDirectionRTL', () => {
setDir(editor, 'rtl');
});
};

const getNodeChangeHandler = (editor, dir) => api => {
const nodeChangeHandler = e => {
const element = SugarElement.fromDom(e.element);
api.setActive(getDirection(element) === dir);
api.setEnabled(editor.selection.isEditable());
};
editor.on('NodeChange', nodeChangeHandler);
api.setEnabled(editor.selection.isEditable());
return () => editor.off('NodeChange', nodeChangeHandler);
};
const register = editor => {
editor.ui.registry.addToggleButton('ltr', {
tooltip: 'Left to right',
icon: 'ltr',
onAction: () => editor.execCommand('mceDirectionLTR'),
onSetup: getNodeChangeHandler(editor, 'ltr')
});
editor.ui.registry.addToggleButton('rtl', {
tooltip: 'Right to left',
icon: 'rtl',
onAction: () => editor.execCommand('mceDirectionRTL'),
onSetup: getNodeChangeHandler(editor, 'rtl')
});
};

var Plugin = () => {
global.add('directionality', editor => {
register$1(editor);
register(editor);
});
};

Plugin();

})();
Loading

0 comments on commit 2b889d2

Please sign in to comment.