@tryghost/koenig-lexical 0.0.2 → 0.0.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +14 -1
- package/dist/assets/index.a692573a.css +1 -0
- package/dist/koenig-lexical.js +68 -68
- package/dist/koenig-lexical.js.map +1 -1
- package/dist/koenig-lexical.umd.js +12 -12
- package/dist/koenig-lexical.umd.js.map +1 -1
- package/package.json +2 -2
- package/dist/assets/index.50185c20.css +0 -1
package/README.md
CHANGED
|
@@ -4,7 +4,20 @@ Early stage re-write of Ghost's editor, using Lexical as the editor framework in
|
|
|
4
4
|
|
|
5
5
|
## Development
|
|
6
6
|
|
|
7
|
-
Run `yarn dev` to start the development server. This will generate a demo site from the `index.html` file which renders the demo app in `demo/demo.jsx` and makes it available on http://localhost:5173
|
|
7
|
+
Run `yarn dev` to start the development server to test/develop the editor standalone. This will generate a demo site from the `index.html` file which renders the demo app in `demo/demo.jsx` and makes it available on http://localhost:5173
|
|
8
|
+
|
|
9
|
+
To test/develop inside of Admin you can run `yarn preview` then in Ghost set your `editor.url` value in `config.local.json` to `http://127.0.0.1:4173/koenig-lexical.umd.js` and load Admin as usual.
|
|
10
|
+
|
|
11
|
+
```json
|
|
12
|
+
{
|
|
13
|
+
...
|
|
14
|
+
"editor": {
|
|
15
|
+
"url": "http://127.0.0.1:4173/koenig-lexical.umd.js"
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
```
|
|
19
|
+
|
|
20
|
+
`yarn preview` by itself only serves the library files, it's possible ro run `yarn built --watch` in a separate terminal tab to have auto-rebuild whilst developing.
|
|
8
21
|
|
|
9
22
|
### Project structure
|
|
10
23
|
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
.koenig-lexical *,.koenig-lexical :before,.koenig-lexical :after{box-sizing:border-box;max-width:revert;max-height:revert;min-width:revert;min-height:revert;border-width:0;border-style:solid;border-color:currentColor}.koenig-lexical :before,.koenig-lexical :after{--tw-content: ""}.koenig-lexical html{line-height:1.5;-webkit-text-size-adjust:100%;-moz-tab-size:4;-o-tab-size:4;tab-size:4;font-family:ui-sans-serif,system-ui,-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Helvetica Neue,Arial,Noto Sans,sans-serif,"Apple Color Emoji","Segoe UI Emoji",Segoe UI Symbol,"Noto Color Emoji"}.koenig-lexical body{margin:0;line-height:inherit}.koenig-lexical hr{height:0;color:inherit;border-top-width:1px}.koenig-lexical abbr:where([title]){-webkit-text-decoration:underline dotted;text-decoration:underline dotted}.koenig-lexical h1,.koenig-lexical h2,.koenig-lexical h3,.koenig-lexical h4,.koenig-lexical h5,.koenig-lexical h6{font-size:inherit;font-weight:inherit}.koenig-lexical a{color:inherit;text-decoration:inherit}.koenig-lexical b,.koenig-lexical strong{font-weight:bolder}.koenig-lexical code,.koenig-lexical kbd,.koenig-lexical samp,.koenig-lexical pre{font-family:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,Liberation Mono,Courier New,monospace;font-size:1em}.koenig-lexical small{font-size:80%}.koenig-lexical sub,.koenig-lexical sup{font-size:75%;line-height:0;position:relative;vertical-align:baseline}.koenig-lexical sub{bottom:-.25em}.koenig-lexical sup{top:-.5em}.koenig-lexical table{text-indent:0;border-color:inherit;border-collapse:collapse}.koenig-lexical button,.koenig-lexical input,.koenig-lexical optgroup,.koenig-lexical select,.koenig-lexical textarea{font-family:inherit;font-size:100%;font-weight:inherit;line-height:inherit;color:inherit;margin:0;padding:0}.koenig-lexical button,.koenig-lexical select{text-transform:none}.koenig-lexical button,.koenig-lexical [type=button],.koenig-lexical [type=reset],.koenig-lexical [type=submit]{-webkit-appearance:button;background-color:transparent;background-image:none}.koenig-lexical :-moz-focusring{outline:none}.koenig-lexical :-moz-ui-invalid{box-shadow:none}.koenig-lexical progress{vertical-align:baseline}.koenig-lexical ::-webkit-inner-spin-button,.koenig-lexical ::-webkit-outer-spin-button{height:auto}.koenig-lexical [type=search]{-webkit-appearance:textfield;outline-offset:-2px}.koenig-lexical ::-webkit-search-decoration{-webkit-appearance:none}.koenig-lexical ::-webkit-file-upload-button{-webkit-appearance:button;font:inherit}.koenig-lexical summary{display:list-item}.koenig-lexical blockquote,.koenig-lexical dl,.koenig-lexical dd,.koenig-lexical h1,.koenig-lexical h2,.koenig-lexical h3,.koenig-lexical h4,.koenig-lexical h5,.koenig-lexical h6,.koenig-lexical hr,.koenig-lexical figure,.koenig-lexical p,.koenig-lexical pre{margin:0}.koenig-lexical fieldset{margin:0;padding:0}.koenig-lexical legend{padding:0}.koenig-lexical ol,.koenig-lexical ul,.koenig-lexical menu{list-style:none;margin:0;padding:0}.koenig-lexical textarea{resize:vertical}.koenig-lexical input::-moz-placeholder,.koenig-lexical textarea::-moz-placeholder{opacity:1;color:#dde1e5}.koenig-lexical input::placeholder,.koenig-lexical textarea::placeholder{opacity:1;color:#dde1e5}.koenig-lexical img,.koenig-lexical svg,.koenig-lexical video,.koenig-lexical canvas,.koenig-lexical audio,.koenig-lexical iframe,.koenig-lexical embed,.koenig-lexical object{display:block;vertical-align:middle}.koenig-lexical img,.koenig-lexical video{max-width:100%;height:auto}*,:before,:after{--tw-border-spacing-x: 0;--tw-border-spacing-y: 0;--tw-translate-x: 0;--tw-translate-y: 0;--tw-rotate: 0;--tw-skew-x: 0;--tw-skew-y: 0;--tw-scale-x: 1;--tw-scale-y: 1;--tw-pan-x: ;--tw-pan-y: ;--tw-pinch-zoom: ;--tw-scroll-snap-strictness: proximity;--tw-ordinal: ;--tw-slashed-zero: ;--tw-numeric-figure: ;--tw-numeric-spacing: ;--tw-numeric-fraction: ;--tw-ring-inset: ;--tw-ring-offset-width: 0px;--tw-ring-offset-color: #fff;--tw-ring-color: rgb(20 184 255 / .5);--tw-ring-offset-shadow: 0 0 #0000;--tw-ring-shadow: 0 0 #0000;--tw-shadow: 0 0 #0000;--tw-shadow-colored: 0 0 #0000;--tw-blur: ;--tw-brightness: ;--tw-contrast: ;--tw-grayscale: ;--tw-hue-rotate: ;--tw-invert: ;--tw-saturate: ;--tw-sepia: ;--tw-drop-shadow: ;--tw-backdrop-blur: ;--tw-backdrop-brightness: ;--tw-backdrop-contrast: ;--tw-backdrop-grayscale: ;--tw-backdrop-hue-rotate: ;--tw-backdrop-invert: ;--tw-backdrop-opacity: ;--tw-backdrop-saturate: ;--tw-backdrop-sepia: }::-webkit-backdrop{--tw-border-spacing-x: 0;--tw-border-spacing-y: 0;--tw-translate-x: 0;--tw-translate-y: 0;--tw-rotate: 0;--tw-skew-x: 0;--tw-skew-y: 0;--tw-scale-x: 1;--tw-scale-y: 1;--tw-pan-x: ;--tw-pan-y: ;--tw-pinch-zoom: ;--tw-scroll-snap-strictness: proximity;--tw-ordinal: ;--tw-slashed-zero: ;--tw-numeric-figure: ;--tw-numeric-spacing: ;--tw-numeric-fraction: ;--tw-ring-inset: ;--tw-ring-offset-width: 0px;--tw-ring-offset-color: #fff;--tw-ring-color: rgb(20 184 255 / .5);--tw-ring-offset-shadow: 0 0 #0000;--tw-ring-shadow: 0 0 #0000;--tw-shadow: 0 0 #0000;--tw-shadow-colored: 0 0 #0000;--tw-blur: ;--tw-brightness: ;--tw-contrast: ;--tw-grayscale: ;--tw-hue-rotate: ;--tw-invert: ;--tw-saturate: ;--tw-sepia: ;--tw-drop-shadow: ;--tw-backdrop-blur: ;--tw-backdrop-brightness: ;--tw-backdrop-contrast: ;--tw-backdrop-grayscale: ;--tw-backdrop-hue-rotate: ;--tw-backdrop-invert: ;--tw-backdrop-opacity: ;--tw-backdrop-saturate: ;--tw-backdrop-sepia: }::backdrop{--tw-border-spacing-x: 0;--tw-border-spacing-y: 0;--tw-translate-x: 0;--tw-translate-y: 0;--tw-rotate: 0;--tw-skew-x: 0;--tw-skew-y: 0;--tw-scale-x: 1;--tw-scale-y: 1;--tw-pan-x: ;--tw-pan-y: ;--tw-pinch-zoom: ;--tw-scroll-snap-strictness: proximity;--tw-ordinal: ;--tw-slashed-zero: ;--tw-numeric-figure: ;--tw-numeric-spacing: ;--tw-numeric-fraction: ;--tw-ring-inset: ;--tw-ring-offset-width: 0px;--tw-ring-offset-color: #fff;--tw-ring-color: rgb(20 184 255 / .5);--tw-ring-offset-shadow: 0 0 #0000;--tw-ring-shadow: 0 0 #0000;--tw-shadow: 0 0 #0000;--tw-shadow-colored: 0 0 #0000;--tw-blur: ;--tw-brightness: ;--tw-contrast: ;--tw-grayscale: ;--tw-hue-rotate: ;--tw-invert: ;--tw-saturate: ;--tw-sepia: ;--tw-drop-shadow: ;--tw-backdrop-blur: ;--tw-backdrop-brightness: ;--tw-backdrop-contrast: ;--tw-backdrop-grayscale: ;--tw-backdrop-hue-rotate: ;--tw-backdrop-invert: ;--tw-backdrop-opacity: ;--tw-backdrop-saturate: ;--tw-backdrop-sepia: }.koenig-lexical{position:relative}.koenig-lexical *{font-size:1.7rem;font-weight:300;letter-spacing:.1px;color:var(--grey-900);text-rendering:optimizeLegibility;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;-moz-font-feature-settings:"liga" on}.koenig-lexical [contenteditable]{outline:none}.koenig-lexical ::-moz-selection{background:var(--grey-200)}.koenig-lexical ::selection{background:var(--grey-200)}.koenig-lexical .kg-prose :where(p,h1,h2,h3,h4,h5,h6,blockquote,aside):not(:where([class~="not-kg-prose"] *)){margin:1.6rem 0 0;min-width:100%;max-width:100%}.koenig-lexical .kg-prose :where(h1,h2,h3,h4,h5,h6):not(:where([class~="not-kg-prose"] *)){font-family:Inter,-apple-system,BlinkMacSystemFont,avenir next,avenir,helvetica neue,helvetica,ubuntu,roboto,noto,segoe ui,arial,sans-serif;font-weight:700;color:var(--black)}.koenig-lexical .kg-prose h1 strong,.koenig-lexical .kg-prose h2 strong,.koenig-lexical .kg-prose h3 strong,.koenig-lexical .kg-prose h4 strong,.koenig-lexical .kg-prose h5 strong,.koenig-lexical .kg-prose h6 strong{font-weight:800}.koenig-lexical .kg-prose :where(h1):not(:where([class~="not-kg-prose"] *)){font-size:4.4rem;line-height:1.15em;letter-spacing:-.015em}.koenig-lexical .kg-prose :where(h2):not(:where([class~="not-kg-prose"] *)){font-size:3.2rem;line-height:1.2em;letter-spacing:-.014em}.koenig-lexical .kg-prose :where(h3):not(:where([class~="not-kg-prose"] *)){font-size:2.5rem;line-height:1.3em;letter-spacing:-.013em}.koenig-lexical .kg-prose :where(h4):not(:where([class~="not-kg-prose"] *)){font-size:2.2rem;line-height:1.35em;letter-spacing:-.011em}.koenig-lexical .kg-prose :where(h5):not(:where([class~="not-kg-prose"] *)){font-size:2rem;line-height:1.35em;font-weight:700;letter-spacing:-.011em}.koenig-lexical .kg-prose :where(h6):not(:where([class~="not-kg-prose"] *)){font-size:1.85rem;line-height:1.4em;font-weight:700;letter-spacing:-.008em}.koenig-lexical .kg-prose p+h1,.koenig-lexical .kg-prose p+h2,.koenig-lexical .kg-prose p+h3,.koenig-lexical .kg-prose p+h4,.koenig-lexical .kg-prose p+h5,.koenig-lexical .kg-prose p+h6,.koenig-lexical .kg-prose blockquote+h1,.koenig-lexical .kg-prose blockquote+h2,.koenig-lexical .kg-prose blockquote+h3,.koenig-lexical .kg-prose blockquote+h4,.koenig-lexical .kg-prose blockquote+h5,.koenig-lexical .kg-prose blockquote+h6,.koenig-lexical .kg-prose aside+h1,.koenig-lexical .kg-prose aside+h2,.koenig-lexical .kg-prose aside+h3,.koenig-lexical .kg-prose aside+h4,.koenig-lexical .kg-prose aside+h5,.koenig-lexical .kg-prose aside+h6,.koenig-lexical .kg-prose ul+h1,.koenig-lexical .kg-prose ul+h2,.koenig-lexical .kg-prose ul+h3,.koenig-lexical .kg-prose ul+h4,.koenig-lexical .kg-prose ul+h5,.koenig-lexical .kg-prose ul+h6,.koenig-lexical .kg-prose ol+h1,.koenig-lexical .kg-prose ol+h2,.koenig-lexical .kg-prose ol+h3,.koenig-lexical .kg-prose ol+h4,.koenig-lexical .kg-prose ol+h5,.koenig-lexical .kg-prose ol+h6{margin:4.8rem 0 0}.koenig-lexical .kg-prose h1+h1{margin:1.4rem 0 0}.koenig-lexical .kg-prose h2+h1,.koenig-lexical .kg-prose h3+h1{margin:1rem 0 0}.koenig-lexical .kg-prose h4+h1,.koenig-lexical .kg-prose h5+h1{margin:.8rem 0 0}.koenig-lexical .kg-prose h6+h1{margin:.6rem 0 0}.koenig-lexical .kg-prose div+h1{margin:4.8rem 0 0}.koenig-lexical .kg-prose h1+h2{margin:1.6rem 0 0}.koenig-lexical .kg-prose h2+h2,.koenig-lexical .kg-prose h3+h2,.koenig-lexical .kg-prose h4+h2,.koenig-lexical .kg-prose .koenig-react__editor h5+h2{margin:.8rem 0 0}.koenig-lexical .kg-prose h6+h2{margin:.4rem 0 0}.koenig-lexical .kg-prose div+h2{margin:4.8rem 0 0}.koenig-lexical .kg-prose h1+h3,.koenig-lexical .kg-prose h2+h3,.koenig-lexical .kg-prose h1+h4,.koenig-lexical .kg-prose h2+h4,.koenig-lexical .kg-prose h1+h5,.koenig-lexical .kg-prose h2+h5,.koenig-lexical .kg-prose h1+h6,.koenig-lexical .kg-prose h2+h6{margin:1.2rem 0 0}.koenig-lexical .kg-prose h3+h4{margin:.8rem 0 0}.koenig-lexical .kg-prose h3+h3,.koenig-lexical .kg-prose h4+h3,.koenig-lexical .kg-prose h5+h3,.koenig-lexical .kg-prose h4+h4,.koenig-lexical .kg-prose h5+h4,.koenig-lexical .kg-prose h3+h5,.koenig-lexical .kg-prose h4+h5,.koenig-lexical .kg-prose h5+h5,.koenig-lexical .kg-prose h3+h6,.koenig-lexical .kg-prose h4+h6{margin:.8rem 0 0}.koenig-lexical .kg-prose h5+h6{margin:.4rem 0 0}.koenig-lexical .kg-prose h6+h3,.koenig-lexical .kg-prose h6+h4,.koenig-lexical .kg-prose h6+h5,.koenig-lexical .kg-prose h6+h6{margin:.4rem 0 0}.koenig-lexical .kg-prose div+h3,.koenig-lexical .kg-prose div+h4,.koenig-lexical .kg-prose div+h5,.koenig-lexical .kg-prose div+h6{margin:4.8rem 0 0}.koenig-lexical .kg-prose h1:first-child,.koenig-lexical .kg-prose h2:first-child,.koenig-lexical .kg-prose h3:first-child,.koenig-lexical .kg-prose h4:first-child,.koenig-lexical .kg-prose .koenig-react__editor h5:first-child,.koenig-lexical .kg-prose h6:first-child{margin-top:0rem}@media (max-width: 500px){.koenig-lexical .kg-prose :where(h1):not(:where([class~="not-kg-prose"] *)){font-size:3.2rem}.koenig-lexical .kg-prose :where(h2):not(:where([class~="not-kg-prose"] *)){font-size:2.8rem}.koenig-lexical .kg-prose :where(h3):not(:where([class~="not-kg-prose"] *)){font-size:2.4rem}.koenig-lexical .kg-prose :where(h4):not(:where([class~="not-kg-prose"] *)){font-size:2.3rem}.koenig-lexical .kg-prose :where(h5):not(:where([class~="not-kg-prose"] *)){font-size:2rem}.koenig-lexical .kg-prose :where(h6):not(:where([class~="not-kg-prose"] *)){font-size:1.9rem}}.koenig-lexical .kg-prose :where(p,blockquote,aside,ul,ol):not(:where([class~="not-kg-prose"] *)){font-family:georgia,serif;font-weight:400;line-height:1.6em;font-size:2rem}.koenig-lexical .kg-prose p strong,.koenig-lexical .kg-prose blockquote strong,.koenig-lexical .kg-prose aside strong,.koenig-lexical .kg-prose ul strong,.koenig-lexical .kg-prose ol strong{font-weight:700}.koenig-lexical .kg-prose h1+p{margin:1rem 0 0}.koenig-lexical .kg-prose h2+p{margin:.8rem 0 0}.koenig-lexical .kg-prose h3+p,.koenig-lexical .kg-prose h4+p,.koenig-lexical .kg-prose h5+p,.koenig-lexical .kg-prose h6+p{margin:.8rem 0 0}.koenig-lexical .kg-prose p+p,.koenig-lexical .kg-prose blockquote+p,.koenig-lexical .kg-prose aside+p,.koenig-lexical .kg-prose ul+p,.koenig-lexical .kg-prose ol+p{margin:3.2rem 0 0}.koenig-lexical .kg-prose div+p{margin:2.8rem 0 0}.koenig-lexical .kg-prose div+figure{margin:2.8rem 0 0}.koenig-lexical .kg-prose p:first-child{margin-top:0rem}@media (max-width: 500px){.koenig-lexical .kg-prose :where(p,blockquote,aside,ul,ol):not(:where([class~="not-kg-prose"] *)){font-size:1.8rem}}.koenig-lexical .kg-prose ul,.koenig-lexical .kg-prose ol{margin:1.6rem 0 0;padding:0;min-width:100%;max-width:100%}.koenig-lexical .kg-prose ul li{display:list-item;list-style-type:disc;margin:1rem 0 0 2.4rem;padding:0 0 0 .6rem;line-height:3.2rem}.koenig-lexical .kg-prose ul li:first-child{margin:0 0 0 2.4rem}.koenig-lexical .kg-prose ol li{display:list-item;list-style-type:decimal;margin:1rem 0 0 2.2rem;padding:0 0 0 .8rem;line-height:3.2rem}.koenig-lexical .kg-prose ol li:first-child{margin:0 0 0 2.2rem}.koenig-lexical .kg-prose p+ul,.koenig-lexical .kg-prose p+ol{margin:3rem 0 0}.koenig-lexical .kg-prose ul+ul,.koenig-lexical .kg-prose ul+ol,.koenig-lexical .kg-prose ol+ul,.koenig-lexical .kg-prose ol+ol,.koenig-lexical .kg-prose blockquote+ul,.koenig-lexical .kg-prose blockquote+ol,.koenig-lexical .kg-prose aside+ul,.koenig-lexical .kg-prose aside+ol{margin:3rem 0 0}.koenig-lexical .kg-prose h1+ul,.koenig-lexical .kg-prose h1+ol,.koenig-lexical .kg-prose h2+ul,.koenig-lexical .kg-prose h2+ol{margin:.8rem 0 0}.koenig-lexical .kg-prose h3+ul,.koenig-lexical .kg-prose h3+ol,.koenig-lexical .kg-prose h4+ul,.koenig-lexical .kg-prose h4+ol,.koenig-lexical .kg-prose h5+ul,.koenig-lexical .kg-prose h5+ol,.koenig-lexical .kg-prose h6+ul,.koenig-lexical .kg-prose h6+ol{margin:1.2rem 0 0}.koenig-lexical .kg-prose div+ul,.koenig-lexical .kg-prose div+ol{margin:2.8rem 0 0}.koenig-lexical .kg-prose ul ul,.koenig-lexical .kg-prose ul ol,.koenig-lexical .kg-prose ol ul,.koenig-lexical .kg-prose ol ol{margin:1rem 0 2rem}.koenig-lexical .kg-prose ul:first-child,.koenig-lexical .kg-prose ol:first-child{margin-top:0rem}.koenig-lexical .kg-prose a{color:var(--kg-accent-color, #ff0095);text-decoration:underline}.koenig-lexical .kg-prose blockquote p{margin:0}.koenig-lexical .kg-prose blockquote{border-left:.25rem solid var(--kg-accent-color, #ff0095);padding-left:2rem;font-style:italic}.koenig-lexical .kg-prose h1+blockquote,.koenig-lexical .kg-prose h2+blockquote{margin:.8rem 0 0}.koenig-lexical .kg-prose h3+blockquote,.koenig-lexical .kg-prose h4+blockquote,.koenig-lexical .kg-prose .koenig-react__editor h5+blockquote,.koenig-lexical .kg-prose h6+blockquote{margin:.4rem 0 0}.koenig-lexical .kg-prose p+blockquote,.koenig-lexical .kg-prose blockquote+blockquote{margin:3.2rem 0 0}.koenig-lexical .kg-prose div+blockquote{margin:2.8rem 0 0}.koenig-lexical .kg-prose aside p{margin:0}.koenig-lexical .kg-prose aside{margin:3.2rem 0 0;padding:1rem 6rem 1.25rem;font-style:italic;text-align:center;font-size:2.4rem;color:var(--midgrey-l1)}.koenig-lexical .kg-prose h1+aside,.koenig-lexical .kg-prose h2+aside{margin:.8rem 0 0}.koenig-lexical .kg-prose h3+aside,.koenig-lexical .kg-prose h4+aside,.koenig-lexical .kg-prose h5+aside,.koenig-lexical .kg-prose h6+aside{margin:.4rem 0 0}.koenig-lexical .kg-prose p+aside,.koenig-lexical .kg-prose blockquote+aside{margin:3.2rem 0 0}@media (max-width: 800px){.koenig-lexical .kg-prose aside{padding-left:6rem;padding-right:6rem}}@media (max-width: 500px){.koenig-lexical .kg-prose aside{font-size:2.2rem}}.koenig-lexical .kg-prose div+aside{margin:2.8rem 0 0}.koenig-lexical .pointer-events-none{pointer-events:none}.koenig-lexical .absolute{position:absolute}.koenig-lexical .top-0{top:0px}.koenig-lexical .left-0{left:0px}.koenig-lexical .min-w-full{min-width:100%}.koenig-lexical .cursor-text{cursor:text}.koenig-lexical .italic{font-style:italic}.koenig-lexical .underline{-webkit-text-decoration-line:underline;text-decoration-line:underline}:root{--grey-200: #EBEEF0;--grey-500: #AEB7C1;--grey-900: #394047;--black: #15171A}@font-face{font-family:Inter,sans-serif;src:url(./assets/fonts/Inter.ttf) format("truetype-variations");font-weight:100 900}
|
package/dist/koenig-lexical.js
CHANGED
|
@@ -17,7 +17,7 @@ un.useLexicalComposerContext = function() {
|
|
|
17
17
|
};
|
|
18
18
|
const rl = un;
|
|
19
19
|
var Ze = rl, _ = {};
|
|
20
|
-
let pi = {}, mi = {}, xt = {}, _t = {}, Rn = {}, Ge = {}, qn = {}, wn = {}, Ct = {}, Tt = {},
|
|
20
|
+
let pi = {}, mi = {}, xt = {}, _t = {}, Rn = {}, Ge = {}, qn = {}, wn = {}, Ct = {}, Tt = {}, ve = {}, bn = {}, er = {}, yi = {}, vi = {}, Ni = {}, xi = {}, Ci = {}, Ti = {}, qt = {}, Si = {}, Ei = {}, Oi = {}, $i = {}, Mi = {}, Di = {}, Ai = {}, Ri = {}, wi = {}, tr = {}, nr = {}, Li = {}, ki = {}, Pi = {};
|
|
21
21
|
function v(n) {
|
|
22
22
|
throw Error(`Minified Lexical error #${n}; visit https://lexical.dev/docs/error?code=${n} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`);
|
|
23
23
|
}
|
|
@@ -134,9 +134,9 @@ function Ki(n) {
|
|
|
134
134
|
return null;
|
|
135
135
|
}
|
|
136
136
|
function kn(n) {
|
|
137
|
-
return
|
|
137
|
+
return Ne(n) || n.isSegmented();
|
|
138
138
|
}
|
|
139
|
-
function
|
|
139
|
+
function Ne(n) {
|
|
140
140
|
return n.isToken() || n.isInert();
|
|
141
141
|
}
|
|
142
142
|
function bt(n) {
|
|
@@ -287,7 +287,7 @@ function or(n, e, t, r, i) {
|
|
|
287
287
|
}, 20);
|
|
288
288
|
}
|
|
289
289
|
else
|
|
290
|
-
i = o.getParent(), e = Pt(),
|
|
290
|
+
i = o.getParent(), e = Pt(), Ne(o) || A()._compositionKey !== null && !l || i !== null && E(e) && !i.canInsertTextBefore() && e.anchor.offset === 0 ? o.markDirty() : (l = L(), E(l) && t !== null && r !== null && (l.setTextNodeRange(o, t, o, r), o.isSegmented() && (t = o.getTextContent(), t = j(t), o.replace(t), o = t)), o.setTextContent(n));
|
|
291
291
|
}
|
|
292
292
|
}
|
|
293
293
|
function Vi(n, e) {
|
|
@@ -591,7 +591,7 @@ function Cl(n, e) {
|
|
|
591
591
|
e.getTargetRanges && (e = e.getTargetRanges()[0]) && n.applyDOMRange(e);
|
|
592
592
|
}
|
|
593
593
|
function Tl(n, e) {
|
|
594
|
-
return n !== e || m(n) || m(e) || !
|
|
594
|
+
return n !== e || m(n) || m(e) || !Ne(n) || !Ne(e);
|
|
595
595
|
}
|
|
596
596
|
function Sl(n, e) {
|
|
597
597
|
let t = n.inputType;
|
|
@@ -675,16 +675,16 @@ function Sl(n, e) {
|
|
|
675
675
|
y(e, Tt, !1);
|
|
676
676
|
break;
|
|
677
677
|
case "formatStrikeThrough":
|
|
678
|
-
y(e,
|
|
678
|
+
y(e, ve, "strikethrough");
|
|
679
679
|
break;
|
|
680
680
|
case "formatBold":
|
|
681
|
-
y(e,
|
|
681
|
+
y(e, ve, "bold");
|
|
682
682
|
break;
|
|
683
683
|
case "formatItalic":
|
|
684
|
-
y(e,
|
|
684
|
+
y(e, ve, "italic");
|
|
685
685
|
break;
|
|
686
686
|
case "formatUnderline":
|
|
687
|
-
y(e,
|
|
687
|
+
y(e, ve, "underline");
|
|
688
688
|
break;
|
|
689
689
|
case "historyUndo":
|
|
690
690
|
y(e, bn, void 0);
|
|
@@ -747,7 +747,7 @@ function Ml(n, e) {
|
|
|
747
747
|
n.preventDefault(), mt = !0, y(e, _t, !0);
|
|
748
748
|
else if (t !== 13 || r) {
|
|
749
749
|
var s = Z ? l || o ? !1 : t === 8 || t === 72 && i : i || l || o ? !1 : t === 8;
|
|
750
|
-
s ? t === 8 ? y(e, Ei, n) : (n.preventDefault(), y(e, xt, !0)) : t === 27 ? y(e, Oi, n) : (s = Z ? r || l || o ? !1 : t === 46 || t === 68 && i : i || l || o ? !1 : t === 46, s ? t === 46 ? y(e, $i, n) : (n.preventDefault(), y(e, xt, !1)) : t === 8 && (Z ? l : i) ? (n.preventDefault(), y(e, Ct, !0)) : t === 46 && (Z ? l : i) ? (n.preventDefault(), y(e, Ct, !1)) : Z && o && t === 8 ? (n.preventDefault(), y(e, Tt, !0)) : Z && o && t === 46 ? (n.preventDefault(), y(e, Tt, !1)) : t === 66 && !l && (Z ? o : i) ? (n.preventDefault(), y(e,
|
|
750
|
+
s ? t === 8 ? y(e, Ei, n) : (n.preventDefault(), y(e, xt, !0)) : t === 27 ? y(e, Oi, n) : (s = Z ? r || l || o ? !1 : t === 46 || t === 68 && i : i || l || o ? !1 : t === 46, s ? t === 46 ? y(e, $i, n) : (n.preventDefault(), y(e, xt, !1)) : t === 8 && (Z ? l : i) ? (n.preventDefault(), y(e, Ct, !0)) : t === 46 && (Z ? l : i) ? (n.preventDefault(), y(e, Ct, !1)) : Z && o && t === 8 ? (n.preventDefault(), y(e, Tt, !0)) : Z && o && t === 46 ? (n.preventDefault(), y(e, Tt, !1)) : t === 66 && !l && (Z ? o : i) ? (n.preventDefault(), y(e, ve, "bold")) : t === 85 && !l && (Z ? o : i) ? (n.preventDefault(), y(e, ve, "underline")) : t === 73 && !l && (Z ? o : i) ? (n.preventDefault(), y(e, ve, "italic")) : t !== 9 || l || i || o ? t === 90 && !r && (Z ? o : i) ? (n.preventDefault(), y(e, bn, void 0)) : (s = Z ? t === 90 && o && r : t === 89 && i || t === 90 && i && r, s ? (n.preventDefault(), y(e, er, void 0)) : kt(e._editorState._selection) && (s = r ? !1 : t === 67 ? Z ? o : i : !1, s ? (n.preventDefault(), y(e, tr, n)) : (s = r ? !1 : t === 88 ? Z ? o : i : !1, s && (n.preventDefault(), y(e, nr, n))))) : y(e, Mi, n));
|
|
751
751
|
} else
|
|
752
752
|
mt = !1, y(e, qt, n);
|
|
753
753
|
else
|
|
@@ -869,7 +869,7 @@ function Pr(n, e, t) {
|
|
|
869
869
|
let r = n.getNode(), i = r.getChildAtIndex(n.offset), o = j(), l = V(r) ? Qe().append(o) : o;
|
|
870
870
|
o.setFormat(t), i === null ? r.append(l) : i.insertBefore(l), n.is(e) && e.set(o.__key, 0, "text"), n.set(o.__key, 0, "text");
|
|
871
871
|
}
|
|
872
|
-
function
|
|
872
|
+
function ye(n, e, t, r) {
|
|
873
873
|
n.key = e, n.offset = t, n.type = r;
|
|
874
874
|
}
|
|
875
875
|
class pn {
|
|
@@ -1018,7 +1018,7 @@ class et {
|
|
|
1018
1018
|
return m(e) && (t = e.getDescendantByIndex(t.offset), e = t != null ? t : e), m(i) && (r = i.getDescendantByIndex(r.offset), i = r != null ? r : i), e = e.is(i) ? m(e) && (0 < e.getChildrenSize() || e.excludeFromCopy()) ? [] : [e] : e.getNodesBetween(i), W || (this._cachedNodes = e), e;
|
|
1019
1019
|
}
|
|
1020
1020
|
setTextNodeRange(e, t, r, i) {
|
|
1021
|
-
|
|
1021
|
+
ye(this.anchor, e.__key, t, "text"), ye(this.focus, r.__key, i, "text"), this._cachedNodes = null, this.dirty = !0;
|
|
1022
1022
|
}
|
|
1023
1023
|
getTextContent() {
|
|
1024
1024
|
let e = this.getNodes();
|
|
@@ -1042,7 +1042,7 @@ class et {
|
|
|
1042
1042
|
let t = A(), r = t.getEditorState()._selection;
|
|
1043
1043
|
if (e = ao(e.startContainer, e.startOffset, e.endContainer, e.endOffset, t, r), e !== null) {
|
|
1044
1044
|
var [i, o] = e;
|
|
1045
|
-
|
|
1045
|
+
ye(this.anchor, i.key, i.offset, i.type), ye(
|
|
1046
1046
|
this.focus,
|
|
1047
1047
|
o.key,
|
|
1048
1048
|
o.offset,
|
|
@@ -1100,7 +1100,7 @@ class et {
|
|
|
1100
1100
|
return;
|
|
1101
1101
|
}
|
|
1102
1102
|
if (s === 1)
|
|
1103
|
-
if (
|
|
1103
|
+
if (Ne(t))
|
|
1104
1104
|
e = j(e), e.select(), t.replace(e);
|
|
1105
1105
|
else {
|
|
1106
1106
|
if (l = t.getFormat(), r === u && l !== o)
|
|
@@ -1119,7 +1119,7 @@ class et {
|
|
|
1119
1119
|
do
|
|
1120
1120
|
f = a, a = a.getParentOrThrow();
|
|
1121
1121
|
while (a.isInline());
|
|
1122
|
-
d.type === "text" && (u !== 0 || c.getTextContent() === "") || d.type === "element" && c.getIndexWithinParent() < u ? N(c) && !
|
|
1122
|
+
d.type === "text" && (u !== 0 || c.getTextContent() === "") || d.type === "element" && c.getIndexWithinParent() < u ? N(c) && !Ne(c) && u !== c.getTextContentSize() ? (c.isSegmented() && (d = j(c.getTextContent()), c.replace(d), c = d), c = c.spliceText(0, u, ""), o.add(c.__key)) : (d = c.getParentOrThrow(), d.canBeEmpty() || d.getChildrenSize() !== 1 ? c.remove() : d.remove()) : o.add(c.__key), d = a.getChildren(), u = new Set(l), c = h.is(a), h = h.isInline() && t.getNextSibling() === null ? h : t;
|
|
1123
1123
|
for (let p = d.length - 1; 0 <= p; p--) {
|
|
1124
1124
|
let x = d[p];
|
|
1125
1125
|
if (x.is(t) || m(x) && x.isParentOf(t))
|
|
@@ -1129,7 +1129,7 @@ class et {
|
|
|
1129
1129
|
if (!c)
|
|
1130
1130
|
for (d = a, u = null; d !== null; )
|
|
1131
1131
|
c = d.getChildren(), a = c.length, (a === 0 || c[a - 1].is(u)) && (o.delete(d.__key), u = d), d = d.getParent();
|
|
1132
|
-
for (
|
|
1132
|
+
for (Ne(t) ? r === i ? t.select() : (e = j(e), e.select(), t.replace(e)) : (t = t.spliceText(r, i - r, e, !0), t.getTextContent() === "" ? t.remove() : t.isComposing() && this.anchor.type === "text" && (this.anchor.offset -= e.length)), e = 1; e < s; e++)
|
|
1133
1133
|
t = l[e], o.has(t.__key) || t.remove();
|
|
1134
1134
|
}
|
|
1135
1135
|
}
|
|
@@ -1183,7 +1183,7 @@ class et {
|
|
|
1183
1183
|
else if (i === l)
|
|
1184
1184
|
l = o;
|
|
1185
1185
|
else {
|
|
1186
|
-
if (
|
|
1186
|
+
if (Ne(o))
|
|
1187
1187
|
return !1;
|
|
1188
1188
|
[l, o] = o.splitText(i), r.push(o);
|
|
1189
1189
|
}
|
|
@@ -1275,7 +1275,7 @@ class et {
|
|
|
1275
1275
|
}
|
|
1276
1276
|
modify(e, t, r) {
|
|
1277
1277
|
var i = this.focus, o = this.anchor, l = e === "move", s = ji(i, t);
|
|
1278
|
-
I(s) && !s.isIsolated() ? l ? (l = fo(), l.add(s.__key), be(l)) : (e = t ? s.getPreviousSibling() : s.getNextSibling(), N(e) ? (s = e.__key, t = t ? e.getTextContent().length : 0, i.set(s, t, "text"), l && o.set(s, t, "text")) : (r = s.getParentOrThrow(), m(e) ? (r = e.__key, s = t ? e.getChildrenSize() : 0) : (s = s.getIndexWithinParent(), r = r.__key, t || s++), i.set(r, s, "element"), l && o.set(r, s, "element"))) : (i = window.getSelection()) && (i.modify(e, t ? "backward" : "forward", r), 0 < i.rangeCount && (t = i.getRangeAt(0), this.applyDOMRange(t), this.dirty = !0, l || i.anchorNode === t.startContainer && i.anchorOffset === t.startOffset || (l = this.focus, t = this.anchor, i = t.key, o = t.offset, s = t.type,
|
|
1278
|
+
I(s) && !s.isIsolated() ? l ? (l = fo(), l.add(s.__key), be(l)) : (e = t ? s.getPreviousSibling() : s.getNextSibling(), N(e) ? (s = e.__key, t = t ? e.getTextContent().length : 0, i.set(s, t, "text"), l && o.set(s, t, "text")) : (r = s.getParentOrThrow(), m(e) ? (r = e.__key, s = t ? e.getChildrenSize() : 0) : (s = s.getIndexWithinParent(), r = r.__key, t || s++), i.set(r, s, "element"), l && o.set(r, s, "element"))) : (i = window.getSelection()) && (i.modify(e, t ? "backward" : "forward", r), 0 < i.rangeCount && (t = i.getRangeAt(0), this.applyDOMRange(t), this.dirty = !0, l || i.anchorNode === t.startContainer && i.anchorOffset === t.startOffset || (l = this.focus, t = this.anchor, i = t.key, o = t.offset, s = t.type, ye(t, l.key, l.offset, l.type), ye(l, i, o, s), this._cachedNodes = null)));
|
|
1279
1279
|
}
|
|
1280
1280
|
deleteCharacter(e) {
|
|
1281
1281
|
if (this.isCollapsed()) {
|
|
@@ -1363,7 +1363,7 @@ function uo(n, e, t) {
|
|
|
1363
1363
|
if (n.type === "text" && e.type === "text") {
|
|
1364
1364
|
var r = n.isBefore(e);
|
|
1365
1365
|
let i = n.is(e);
|
|
1366
|
-
Kr(n, r, i), Kr(e, !r, i), i && (e.key = n.key, e.offset = n.offset, e.type = n.type), r = A(), r.isComposing() && r._compositionKey !== n.key && E(t) && (r = t.anchor, t = t.focus,
|
|
1366
|
+
Kr(n, r, i), Kr(e, !r, i), i && (e.key = n.key, e.offset = n.offset, e.type = n.type), r = A(), r.isComposing() && r._compositionKey !== n.key && E(t) && (r = t.anchor, t = t.focus, ye(n, r.key, r.offset, r.type), ye(e, t.key, t.offset, t.type));
|
|
1367
1367
|
}
|
|
1368
1368
|
}
|
|
1369
1369
|
function ao(n, e, t, r, i, o) {
|
|
@@ -1558,19 +1558,19 @@ function Me(n) {
|
|
|
1558
1558
|
if (r.setBaseAndExtent(s, xn, me, Cr), l.isCollapsed() && t !== null && t === Yt) {
|
|
1559
1559
|
let ut = F.getNode();
|
|
1560
1560
|
if (m(ut)) {
|
|
1561
|
-
let
|
|
1562
|
-
|
|
1561
|
+
let Se = ut.getDescendantByIndex(F.offset);
|
|
1562
|
+
Se !== null && (ut = Se);
|
|
1563
1563
|
}
|
|
1564
1564
|
let Be = n.getElementByKey(ut.__key);
|
|
1565
1565
|
if (Be !== null) {
|
|
1566
|
-
let
|
|
1567
|
-
if (
|
|
1566
|
+
let Se = Be.getBoundingClientRect();
|
|
1567
|
+
if (Se.bottom > hn(n).innerHeight)
|
|
1568
1568
|
Be.scrollIntoView(!1);
|
|
1569
|
-
else if (0 >
|
|
1569
|
+
else if (0 > Se.top)
|
|
1570
1570
|
Be.scrollIntoView();
|
|
1571
1571
|
else {
|
|
1572
1572
|
let Sr = t.getBoundingClientRect();
|
|
1573
|
-
Math.floor(
|
|
1573
|
+
Math.floor(Se.bottom) > Math.floor(Sr.bottom) ? Be.scrollIntoView(!1) : Math.floor(Se.top) < Math.floor(Sr.top) && Be.scrollIntoView();
|
|
1574
1574
|
}
|
|
1575
1575
|
p.add("scroll-into-view");
|
|
1576
1576
|
}
|
|
@@ -2902,7 +2902,7 @@ _.DecoratorNode = _o;
|
|
|
2902
2902
|
_.ElementNode = ke;
|
|
2903
2903
|
_.FOCUS_COMMAND = Li;
|
|
2904
2904
|
_.FORMAT_ELEMENT_COMMAND = {};
|
|
2905
|
-
_.FORMAT_TEXT_COMMAND =
|
|
2905
|
+
_.FORMAT_TEXT_COMMAND = ve;
|
|
2906
2906
|
_.GridCellNode = yo;
|
|
2907
2907
|
_.GridNode = No;
|
|
2908
2908
|
_.GridRowNode = Co;
|
|
@@ -3626,7 +3626,7 @@ H.removeList = function(n) {
|
|
|
3626
3626
|
});
|
|
3627
3627
|
};
|
|
3628
3628
|
const rs = H;
|
|
3629
|
-
var on = rs,
|
|
3629
|
+
var on = rs, Te = {}, Bt = {}, cr = {}, z = {}, C = re;
|
|
3630
3630
|
let fr = /* @__PURE__ */ new Map();
|
|
3631
3631
|
function ln(n) {
|
|
3632
3632
|
n = n.getLatest();
|
|
@@ -4266,17 +4266,17 @@ function di(n, e) {
|
|
|
4266
4266
|
function We(n) {
|
|
4267
4267
|
return n = g.$getNearestNodeFromDOMNode(n), g.$isDecoratorNode(n);
|
|
4268
4268
|
}
|
|
4269
|
-
|
|
4270
|
-
|
|
4271
|
-
|
|
4269
|
+
Te.$createHeadingNode = dn;
|
|
4270
|
+
Te.$createQuoteNode = _r;
|
|
4271
|
+
Te.$isHeadingNode = function(n) {
|
|
4272
4272
|
return n instanceof Wt;
|
|
4273
4273
|
};
|
|
4274
|
-
|
|
4274
|
+
Te.$isQuoteNode = function(n) {
|
|
4275
4275
|
return n instanceof Kt;
|
|
4276
4276
|
};
|
|
4277
|
-
|
|
4278
|
-
|
|
4279
|
-
|
|
4277
|
+
Te.HeadingNode = Wt;
|
|
4278
|
+
Te.QuoteNode = Kt;
|
|
4279
|
+
Te.registerRichText = function(n, e) {
|
|
4280
4280
|
let t = Ve.mergeRegister(
|
|
4281
4281
|
n.registerCommand(g.CLICK_COMMAND, () => {
|
|
4282
4282
|
const r = g.$getSelection();
|
|
@@ -4433,9 +4433,9 @@ Se.registerRichText = function(n, e) {
|
|
|
4433
4433
|
);
|
|
4434
4434
|
return ys(n, e), t;
|
|
4435
4435
|
};
|
|
4436
|
-
const xs =
|
|
4437
|
-
var Xn = xs, pe = {}, Cs = Pe,
|
|
4438
|
-
class lt extends
|
|
4436
|
+
const xs = Te;
|
|
4437
|
+
var Xn = xs, pe = {}, Cs = Pe, xe = re;
|
|
4438
|
+
class lt extends xe.ElementNode {
|
|
4439
4439
|
static getType() {
|
|
4440
4440
|
return "link";
|
|
4441
4441
|
}
|
|
@@ -4484,7 +4484,7 @@ class lt extends Ce.ElementNode {
|
|
|
4484
4484
|
this.getWritable().__rel = e;
|
|
4485
4485
|
}
|
|
4486
4486
|
insertNewAfter(e) {
|
|
4487
|
-
if (e = this.getParentOrThrow().insertNewAfter(e),
|
|
4487
|
+
if (e = this.getParentOrThrow().insertNewAfter(e), xe.$isElementNode(e)) {
|
|
4488
4488
|
let t = wt(this.__url, { rel: this.__rel, target: this.__target });
|
|
4489
4489
|
return e.append(t), t;
|
|
4490
4490
|
}
|
|
@@ -4503,7 +4503,7 @@ class lt extends Ce.ElementNode {
|
|
|
4503
4503
|
return !0;
|
|
4504
4504
|
}
|
|
4505
4505
|
extractWithChild(e, t) {
|
|
4506
|
-
if (!
|
|
4506
|
+
if (!xe.$isRangeSelection(t))
|
|
4507
4507
|
return !1;
|
|
4508
4508
|
e = t.anchor.getNode();
|
|
4509
4509
|
let r = t.focus.getNode();
|
|
@@ -4538,7 +4538,7 @@ class zt extends lt {
|
|
|
4538
4538
|
return { ...super.exportJSON(), type: "autolink", version: 1 };
|
|
4539
4539
|
}
|
|
4540
4540
|
insertNewAfter(e) {
|
|
4541
|
-
if (e = this.getParentOrThrow().insertNewAfter(e),
|
|
4541
|
+
if (e = this.getParentOrThrow().insertNewAfter(e), xe.$isElementNode(e)) {
|
|
4542
4542
|
let t = Qn(this.__url, { rel: this._rel, target: this.__target });
|
|
4543
4543
|
return e.append(t), t;
|
|
4544
4544
|
}
|
|
@@ -4548,7 +4548,7 @@ class zt extends lt {
|
|
|
4548
4548
|
function Qn(n, e) {
|
|
4549
4549
|
return new zt(n, e);
|
|
4550
4550
|
}
|
|
4551
|
-
let Ss =
|
|
4551
|
+
let Ss = xe.createCommand();
|
|
4552
4552
|
function Es(n) {
|
|
4553
4553
|
return Os(n, (e) => Oe(e));
|
|
4554
4554
|
}
|
|
@@ -4568,7 +4568,7 @@ pe.LinkNode = lt;
|
|
|
4568
4568
|
pe.TOGGLE_LINK_COMMAND = Ss;
|
|
4569
4569
|
pe.toggleLink = function(n, e = {}) {
|
|
4570
4570
|
let { target: t, rel: r } = e;
|
|
4571
|
-
if (e =
|
|
4571
|
+
if (e = xe.$getSelection(), xe.$isRangeSelection(e))
|
|
4572
4572
|
if (e = e.extract(), n === null)
|
|
4573
4573
|
e.forEach((o) => {
|
|
4574
4574
|
if (o = o.getParent(), Oe(o)) {
|
|
@@ -4589,7 +4589,7 @@ pe.toggleLink = function(n, e = {}) {
|
|
|
4589
4589
|
let o = null, l = null;
|
|
4590
4590
|
e.forEach((s) => {
|
|
4591
4591
|
var d = s.getParent();
|
|
4592
|
-
if (d !== l && d !== null && (!
|
|
4592
|
+
if (d !== l && d !== null && (!xe.$isElementNode(s) || s.isInline()))
|
|
4593
4593
|
if (Oe(d))
|
|
4594
4594
|
l = d, d.setURL(n), t !== void 0 && d.setTarget(t), r !== void 0 && d.setRel(r);
|
|
4595
4595
|
else if (d.is(o) || (o = d, l = wt(n, { rel: r, target: t }), Oe(d) ? s.getPreviousSibling() === null ? d.insertBefore(l) : d.insertAfter(l) : s.insertBefore(l)), Oe(s)) {
|
|
@@ -4668,7 +4668,7 @@ Nn.jsxs = Ho;
|
|
|
4668
4668
|
(function(n) {
|
|
4669
4669
|
n.exports = Nn;
|
|
4670
4670
|
})(pr);
|
|
4671
|
-
const
|
|
4671
|
+
const Ee = pr.exports.jsx, Is = pr.exports.jsxs, Fs = [Xn.HeadingNode, on.ListNode, on.ListItemNode, Xn.QuoteNode, Ms.LinkNode];
|
|
4672
4672
|
function Bs(n) {
|
|
4673
4673
|
console.error(n);
|
|
4674
4674
|
}
|
|
@@ -4676,17 +4676,19 @@ const Ks = {
|
|
|
4676
4676
|
namespace: "KoenigEditor",
|
|
4677
4677
|
theme: Ds
|
|
4678
4678
|
}, Td = ({
|
|
4679
|
-
|
|
4680
|
-
|
|
4681
|
-
|
|
4679
|
+
initialEditorState: n,
|
|
4680
|
+
nodes: e = [...Fs],
|
|
4681
|
+
onError: t = Bs,
|
|
4682
|
+
children: r
|
|
4682
4683
|
}) => {
|
|
4683
|
-
const
|
|
4684
|
-
nodes:
|
|
4685
|
-
|
|
4686
|
-
|
|
4687
|
-
|
|
4688
|
-
|
|
4689
|
-
|
|
4684
|
+
const i = ae.useMemo(() => Object.assign({}, Ks, {
|
|
4685
|
+
nodes: e,
|
|
4686
|
+
editorState: n,
|
|
4687
|
+
onError: t
|
|
4688
|
+
}), [n, e, t]);
|
|
4689
|
+
return /* @__PURE__ */ Ee(Vl.LexicalComposer, {
|
|
4690
|
+
initialConfig: i,
|
|
4691
|
+
children: r
|
|
4690
4692
|
});
|
|
4691
4693
|
};
|
|
4692
4694
|
var Go = {}, ce = {}, G = re;
|
|
@@ -4862,12 +4864,12 @@ Vo.registerDragonSupport = function(n) {
|
|
|
4862
4864
|
};
|
|
4863
4865
|
};
|
|
4864
4866
|
const Ys = Vo;
|
|
4865
|
-
var Hs = Ys, Gs = Ze,
|
|
4867
|
+
var Hs = Ys, Gs = Ze, Ce = ae, Us = zs, jo = Pe, ui = nl, Js = Hs, Vs = Xn, yr = typeof window < "u" && typeof window.document < "u" && typeof window.document.createElement < "u" ? Ce.useLayoutEffect : Ce.useEffect;
|
|
4866
4868
|
function ai(n) {
|
|
4867
4869
|
return n.getEditorState().read(Us.$canShowPlaceholderCurry(n.isComposing(), n.isEditable()));
|
|
4868
4870
|
}
|
|
4869
4871
|
function js(n) {
|
|
4870
|
-
let [e, t] =
|
|
4872
|
+
let [e, t] = Ce.useState(() => ai(n));
|
|
4871
4873
|
return yr(() => {
|
|
4872
4874
|
function r() {
|
|
4873
4875
|
let i = ai(n);
|
|
@@ -4881,14 +4883,14 @@ function js(n) {
|
|
|
4881
4883
|
}, [n]), e;
|
|
4882
4884
|
}
|
|
4883
4885
|
function Xs(n) {
|
|
4884
|
-
let [e, t] =
|
|
4886
|
+
let [e, t] = Ce.useState(() => n.getDecorators());
|
|
4885
4887
|
return yr(() => n.registerDecoratorListener((r) => {
|
|
4886
4888
|
ui.flushSync(() => {
|
|
4887
4889
|
t(r);
|
|
4888
4890
|
});
|
|
4889
|
-
}), [n]),
|
|
4891
|
+
}), [n]), Ce.useEffect(() => {
|
|
4890
4892
|
t(n.getDecorators());
|
|
4891
|
-
}, [n]),
|
|
4893
|
+
}, [n]), Ce.useMemo(() => {
|
|
4892
4894
|
let r = [], i = Object.keys(e);
|
|
4893
4895
|
for (let l = 0; l < i.length; l++) {
|
|
4894
4896
|
var o = i[l];
|
|
@@ -4903,7 +4905,7 @@ function Qs(n, e) {
|
|
|
4903
4905
|
}
|
|
4904
4906
|
Go.RichTextPlugin = function({ contentEditable: n, placeholder: e, initialEditorState: t }) {
|
|
4905
4907
|
let [r] = Gs.useLexicalComposerContext(), i = js(r), o = Xs(r);
|
|
4906
|
-
return Qs(r, t),
|
|
4908
|
+
return Qs(r, t), Ce.createElement(Ce.Fragment, null, n, i && e, o);
|
|
4907
4909
|
};
|
|
4908
4910
|
const Zs = Go;
|
|
4909
4911
|
var qs = Zs, Xo = {}, bs = Ze, Nt = ae, ed = typeof window < "u" && typeof window.document < "u" && typeof window.document.createElement < "u" ? Nt.useLayoutEffect : Nt.useEffect;
|
|
@@ -5042,19 +5044,17 @@ const Sd = ({
|
|
|
5042
5044
|
}, [n]);
|
|
5043
5045
|
return /* @__PURE__ */ Is("div", {
|
|
5044
5046
|
className: "koenig-lexical",
|
|
5045
|
-
children: [/* @__PURE__ */
|
|
5046
|
-
contentEditable: /* @__PURE__ */
|
|
5047
|
-
|
|
5048
|
-
className: "kg-prose"
|
|
5049
|
-
})
|
|
5047
|
+
children: [/* @__PURE__ */ Ee(qs.RichTextPlugin, {
|
|
5048
|
+
contentEditable: /* @__PURE__ */ Ee(nd.ContentEditable, {
|
|
5049
|
+
className: "kg-prose"
|
|
5050
5050
|
}),
|
|
5051
|
-
placeholder: /* @__PURE__ */
|
|
5051
|
+
placeholder: /* @__PURE__ */ Ee("div", {
|
|
5052
5052
|
className: "pointer-events-none absolute top-0 left-0 min-w-full cursor-text",
|
|
5053
5053
|
children: "Enter some text..."
|
|
5054
5054
|
})
|
|
5055
|
-
}), /* @__PURE__ */
|
|
5055
|
+
}), /* @__PURE__ */ Ee(_d.OnChangePlugin, {
|
|
5056
5056
|
onChange: e
|
|
5057
|
-
}), /* @__PURE__ */
|
|
5057
|
+
}), /* @__PURE__ */ Ee(cd.HistoryPlugin, {}), " ", /* @__PURE__ */ Ee(Nd.ListPlugin, {}), " "]
|
|
5058
5058
|
});
|
|
5059
5059
|
};
|
|
5060
5060
|
export {
|