@notectl/core 1.7.1 → 1.7.2
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/dist/chunks/{AttrRegistry-Ci0qAvtS.mjs → AttrRegistry-D9Jx_RVb.mjs} +2 -2
- package/dist/chunks/{AttrRegistry-Ci0qAvtS.mjs.map → AttrRegistry-D9Jx_RVb.mjs.map} +1 -1
- package/dist/chunks/AttributedMarkCommands-BtLea72z.mjs +80 -0
- package/dist/chunks/AttributedMarkCommands-BtLea72z.mjs.map +1 -0
- package/dist/chunks/{CaretNavigation-qLfeL0So.mjs → CaretNavigation-7JYpIKbs.mjs} +3 -3
- package/dist/chunks/{CaretNavigation-qLfeL0So.mjs.map → CaretNavigation-7JYpIKbs.mjs.map} +1 -1
- package/dist/chunks/{ColorGrid-BBkN0AOb.mjs → ColorGrid-Dneqb8if.mjs} +56 -55
- package/dist/chunks/ColorGrid-Dneqb8if.mjs.map +1 -0
- package/dist/chunks/{ColorPickerPopup-D3ysvOH-.mjs → ColorPickerPopup-CiCLBbe9.mjs} +11 -11
- package/dist/chunks/{ColorPickerPopup-D3ysvOH-.mjs.map → ColorPickerPopup-CiCLBbe9.mjs.map} +1 -1
- package/dist/chunks/{Document-DfZ1NOjs.mjs → Document-Brtw2jL1.mjs} +6 -6
- package/dist/chunks/{Document-DfZ1NOjs.mjs.map → Document-Brtw2jL1.mjs.map} +1 -1
- package/dist/chunks/{MarkCommands-uybmkw9l.mjs → MarkCommands-6RUJ4L3r.mjs} +3 -3
- package/dist/chunks/{MarkCommands-uybmkw9l.mjs.map → MarkCommands-6RUJ4L3r.mjs.map} +1 -1
- package/dist/chunks/{NodeResolver-CzLmmrph.mjs → NodeResolver-C2XYkeOi.mjs} +2 -2
- package/dist/chunks/{NodeResolver-CzLmmrph.mjs.map → NodeResolver-C2XYkeOi.mjs.map} +1 -1
- package/dist/chunks/PopupPositioning-BTT-_pQ3.mjs +32 -0
- package/dist/chunks/PopupPositioning-BTT-_pQ3.mjs.map +1 -0
- package/dist/chunks/RangeIterator-Bh4Vl_6D.mjs +16 -0
- package/dist/chunks/{RangeIterator-Bye0UtbY.mjs.map → RangeIterator-Bh4Vl_6D.mjs.map} +1 -1
- package/dist/chunks/StyleRuntime-ChRjVQwL.mjs +239 -0
- package/dist/chunks/StyleRuntime-ChRjVQwL.mjs.map +1 -0
- package/dist/chunks/{ToolbarPlugin-B7oJRzpl.mjs → ToolbarPlugin-DpLVJ71w.mjs} +48 -47
- package/dist/chunks/ToolbarPlugin-DpLVJ71w.mjs.map +1 -0
- package/dist/chunks/{index-DoCvDkfj.mjs → index--n1RGpq-.mjs} +39 -38
- package/dist/chunks/index--n1RGpq-.mjs.map +1 -0
- package/dist/chunks/{index-DayTn6Re.mjs → index-4or5UzNO.mjs} +43 -41
- package/dist/chunks/index-4or5UzNO.mjs.map +1 -0
- package/dist/chunks/{index-CFJFD4lF.mjs → index-ABlTDvEX.mjs} +19 -18
- package/dist/chunks/index-ABlTDvEX.mjs.map +1 -0
- package/dist/chunks/{index-DmuuFS5D.mjs → index-BAke7kNL.mjs} +43 -43
- package/dist/chunks/{index-DmuuFS5D.mjs.map → index-BAke7kNL.mjs.map} +1 -1
- package/dist/chunks/{index-DGKQhSAl.mjs → index-BXtw5PNN.mjs} +2 -2
- package/dist/chunks/{index-DGKQhSAl.mjs.map → index-BXtw5PNN.mjs.map} +1 -1
- package/dist/chunks/{index-CH1r7DL-.mjs → index-BhDXjueu.mjs} +204 -203
- package/dist/chunks/index-BhDXjueu.mjs.map +1 -0
- package/dist/chunks/{index-CfyS_pgH.mjs → index-BqNUfq-y.mjs} +32 -31
- package/dist/chunks/index-BqNUfq-y.mjs.map +1 -0
- package/dist/chunks/{index-Ckzqtn5D.mjs → index-BvqkuEY1.mjs} +15 -14
- package/dist/chunks/index-BvqkuEY1.mjs.map +1 -0
- package/dist/chunks/{index-CrKz_IEn.mjs → index-C1opJocO.mjs} +2 -2
- package/dist/chunks/{index-CrKz_IEn.mjs.map → index-C1opJocO.mjs.map} +1 -1
- package/dist/chunks/{index-Deag_lVi.mjs → index-CWltg1wK.mjs} +24 -21
- package/dist/chunks/index-CWltg1wK.mjs.map +1 -0
- package/dist/chunks/{index-E7OgN7hM.mjs → index-Cd3uJLP3.mjs} +2 -2
- package/dist/chunks/{index-E7OgN7hM.mjs.map → index-Cd3uJLP3.mjs.map} +1 -1
- package/dist/chunks/{index-CFPP456m.mjs → index-CluzpB2b.mjs} +2 -2
- package/dist/chunks/{index-CFPP456m.mjs.map → index-CluzpB2b.mjs.map} +1 -1
- package/dist/chunks/{index-DIvHQtE2.mjs → index-D3NlpmT1.mjs} +15 -14
- package/dist/chunks/index-D3NlpmT1.mjs.map +1 -0
- package/dist/chunks/{index-Bt_d4IqB.mjs → index-D515iymW.mjs} +71 -70
- package/dist/chunks/{index-Bt_d4IqB.mjs.map → index-D515iymW.mjs.map} +1 -1
- package/dist/chunks/{index-Dum8yE_t.mjs → index-Dk49P9N4.mjs} +11 -11
- package/dist/chunks/{index-Dum8yE_t.mjs.map → index-Dk49P9N4.mjs.map} +1 -1
- package/dist/chunks/{index-yhz2qeeh.mjs → index-DyzigvbZ.mjs} +128 -124
- package/dist/chunks/index-DyzigvbZ.mjs.map +1 -0
- package/dist/chunks/{index-DuRNETFv.mjs → index-ErZ5_a1o.mjs} +3 -3
- package/dist/chunks/{index-DuRNETFv.mjs.map → index-ErZ5_a1o.mjs.map} +1 -1
- package/dist/chunks/{index-Dy6SllXW.mjs → index-fsVJLutn.mjs} +3 -3
- package/dist/chunks/{index-Dy6SllXW.mjs.map → index-fsVJLutn.mjs.map} +1 -1
- package/dist/commands/AttributedMarkCommands.d.ts.map +1 -1
- package/dist/editor/EditorThemeController.d.ts +3 -0
- package/dist/editor/EditorThemeController.d.ts.map +1 -1
- package/dist/editor/NotectlEditor.d.ts +13 -0
- package/dist/editor/NotectlEditor.d.ts.map +1 -1
- package/dist/editor/PaperLayoutController.d.ts.map +1 -1
- package/dist/index.d.ts +1 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/input/LegacyHTMLNormalizer.d.ts.map +1 -1
- package/dist/notectl-core.mjs +452 -440
- package/dist/notectl-core.mjs.map +1 -1
- package/dist/notectl-core.umd.js +1325 -1068
- package/dist/notectl-core.umd.js.map +1 -1
- package/dist/plugins/alignment/AlignmentPlugin.d.ts.map +1 -1
- package/dist/plugins/alignment.mjs +1 -1
- package/dist/plugins/blockquote.mjs +1 -1
- package/dist/plugins/caret-navigation.mjs +1 -1
- package/dist/plugins/code-block/CodeBlockNodeView.d.ts.map +1 -1
- package/dist/plugins/code-block.mjs +1 -1
- package/dist/plugins/font/FontPlugin.d.ts.map +1 -1
- package/dist/plugins/font-size/FontSizePlugin.d.ts.map +1 -1
- package/dist/plugins/font-size.mjs +1 -1
- package/dist/plugins/font.mjs +1 -1
- package/dist/plugins/gap-cursor.mjs +6 -6
- package/dist/plugins/hard-break.mjs +1 -1
- package/dist/plugins/heading/HeadingBlockTypePicker.d.ts.map +1 -1
- package/dist/plugins/heading.mjs +1 -1
- package/dist/plugins/highlight/HighlightPlugin.d.ts.map +1 -1
- package/dist/plugins/highlight.mjs +1 -1
- package/dist/plugins/horizontal-rule.mjs +1 -1
- package/dist/plugins/image/ImageNodeView.d.ts.map +1 -1
- package/dist/plugins/image/ImagePlugin.d.ts.map +1 -1
- package/dist/plugins/image.mjs +1 -1
- package/dist/plugins/link.mjs +1 -1
- package/dist/plugins/list/ListPlugin.d.ts.map +1 -1
- package/dist/plugins/list.mjs +1 -1
- package/dist/plugins/print/PrintContentPreparer.d.ts.map +1 -1
- package/dist/plugins/shared/ColorGrid.d.ts.map +1 -1
- package/dist/plugins/shared/PopupPositioning.d.ts.map +1 -1
- package/dist/plugins/strikethrough.mjs +1 -1
- package/dist/plugins/super-sub.mjs +1 -1
- package/dist/plugins/table/TableContextMenu.d.ts.map +1 -1
- package/dist/plugins/table/TableControls.d.ts.map +1 -1
- package/dist/plugins/table/TableControlsDOM.d.ts.map +1 -1
- package/dist/plugins/table/TableControlsLayout.d.ts.map +1 -1
- package/dist/plugins/table/TableNodeViews.d.ts.map +1 -1
- package/dist/plugins/table.mjs +1 -1
- package/dist/plugins/text-color/TextColorPlugin.d.ts.map +1 -1
- package/dist/plugins/text-color.mjs +1 -1
- package/dist/plugins/text-formatting.mjs +1 -1
- package/dist/plugins/toolbar/ToolbarOverflowController.d.ts.map +1 -1
- package/dist/plugins/toolbar/ToolbarPopupController.d.ts.map +1 -1
- package/dist/plugins/toolbar/ToolbarRenderers.d.ts.map +1 -1
- package/dist/plugins/toolbar/ToolbarTooltip.d.ts.map +1 -1
- package/dist/plugins/toolbar.mjs +1 -1
- package/dist/style/StyleRuntime.d.ts +38 -0
- package/dist/style/StyleRuntime.d.ts.map +1 -0
- package/dist/view/Reconciler.d.ts.map +1 -1
- package/package.json +1 -1
- package/dist/chunks/AttributedMarkCommands-BETuHXj8.mjs +0 -58
- package/dist/chunks/AttributedMarkCommands-BETuHXj8.mjs.map +0 -1
- package/dist/chunks/ColorGrid-BBkN0AOb.mjs.map +0 -1
- package/dist/chunks/PopupPositioning-Cn6L_mO2.mjs +0 -30
- package/dist/chunks/PopupPositioning-Cn6L_mO2.mjs.map +0 -1
- package/dist/chunks/RangeIterator-Bye0UtbY.mjs +0 -16
- package/dist/chunks/ToolbarPlugin-B7oJRzpl.mjs.map +0 -1
- package/dist/chunks/index-CFJFD4lF.mjs.map +0 -1
- package/dist/chunks/index-CH1r7DL-.mjs.map +0 -1
- package/dist/chunks/index-CfyS_pgH.mjs.map +0 -1
- package/dist/chunks/index-Ckzqtn5D.mjs.map +0 -1
- package/dist/chunks/index-DIvHQtE2.mjs.map +0 -1
- package/dist/chunks/index-DayTn6Re.mjs.map +0 -1
- package/dist/chunks/index-Deag_lVi.mjs.map +0 -1
- package/dist/chunks/index-DoCvDkfj.mjs.map +0 -1
- package/dist/chunks/index-yhz2qeeh.mjs.map +0 -1
package/dist/notectl-core.mjs
CHANGED
|
@@ -1,70 +1,71 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { v, w, h } from "./chunks/Document-
|
|
3
|
-
import { f as Z, a as ee, C as te, b as ne } from "./chunks/index-
|
|
4
|
-
import { e, c, d, g, h as h2, i, j, k, l, m, n, o, p, q, r, s, t, u, v as v2, w as w2, x, y, z, A, B, D, E, F, G } from "./chunks/index-
|
|
1
|
+
import { d as S, b as C, f as T, i as R, j as L, r as M, a as I, n as N, c as O, k as _, l as H, m as $, g as K, e as U, o as W, p as V, q as J, s as Q, t as X, u as Y } from "./chunks/Document-Brtw2jL1.mjs";
|
|
2
|
+
import { v, w, h } from "./chunks/Document-Brtw2jL1.mjs";
|
|
3
|
+
import { f as Z, a as ee, C as te, b as ne } from "./chunks/index-BAke7kNL.mjs";
|
|
4
|
+
import { e, c, d, g, h as h2, i, j, k, l, m, n, o, p, q, r, s, t, u, v as v2, w as w2, x, y, z, A, B, D, E, F, G } from "./chunks/index-BAke7kNL.mjs";
|
|
5
5
|
import { e as se, d as re, i as ie, a as oe, c as ae, f as ce, b as le, g as he, h as de, s as ue } from "./chunks/Selection-BRTab5hO.mjs";
|
|
6
6
|
import { j as j2, k as k2 } from "./chunks/Selection-BRTab5hO.mjs";
|
|
7
|
-
import { d as pe, i as fe, a as ge, s as me } from "./chunks/MarkCommands-
|
|
8
|
-
import { b, t as t2, c as c2, e as e2, f } from "./chunks/MarkCommands-
|
|
7
|
+
import { d as pe, i as fe, a as ge, s as me } from "./chunks/MarkCommands-6RUJ4L3r.mjs";
|
|
8
|
+
import { b, t as t2, c as c2, e as e2, f } from "./chunks/MarkCommands-6RUJ4L3r.mjs";
|
|
9
9
|
import { b as ye, n as ke, i as ve, m as be } from "./chunks/TypeBrands-C09nE2qO.mjs";
|
|
10
10
|
import { c as c3, p as p2 } from "./chunks/TypeBrands-C09nE2qO.mjs";
|
|
11
|
-
import { a as
|
|
12
|
-
import { b as b2, i as i2 } from "./chunks/AttrRegistry-
|
|
13
|
-
import { c as
|
|
11
|
+
import { a as Se } from "./chunks/AttrRegistry-D9Jx_RVb.mjs";
|
|
12
|
+
import { b as b2, i as i2 } from "./chunks/AttrRegistry-D9Jx_RVb.mjs";
|
|
13
|
+
import { c as we } from "./chunks/NodeSpec-NZVvcCuH.mjs";
|
|
14
14
|
import { e as Ee, f as xe } from "./chunks/HTMLUtils-DTqQzcKR.mjs";
|
|
15
|
-
import { a as Ce, r as Te, f as Ae } from "./chunks/NodeResolver-
|
|
16
|
-
import { b as b3, c as c4, w as w3 } from "./chunks/NodeResolver-
|
|
17
|
-
import { n as Re, g as Le, s as Me, r as Ie, d as Ne, a as Be, b as Oe, e as Pe, c as _e, f as De, h as He } from "./chunks/CaretNavigation-
|
|
18
|
-
import { i as i3, m as m2, j as j3 } from "./chunks/CaretNavigation-
|
|
19
|
-
import { d as ze, a as je, m as $e, b as Ke, s as Fe, n as Ue, c as We, e as Ve, f as Ge, i as qe, g as Je, h as Qe, r as Xe, H as Ye } from "./chunks/index-
|
|
15
|
+
import { a as Ce, r as Te, f as Ae } from "./chunks/NodeResolver-C2XYkeOi.mjs";
|
|
16
|
+
import { b as b3, c as c4, w as w3 } from "./chunks/NodeResolver-C2XYkeOi.mjs";
|
|
17
|
+
import { n as Re, g as Le, s as Me, r as Ie, d as Ne, a as Be, b as Oe, e as Pe, c as _e, f as De, h as He } from "./chunks/CaretNavigation-7JYpIKbs.mjs";
|
|
18
|
+
import { i as i3, m as m2, j as j3 } from "./chunks/CaretNavigation-7JYpIKbs.mjs";
|
|
19
|
+
import { d as ze, a as je, m as $e, b as Ke, s as Fe, n as Ue, c as We, e as Ve, f as Ge, i as qe, g as Je, h as Qe, r as Xe, H as Ye } from "./chunks/index-ErZ5_a1o.mjs";
|
|
20
20
|
import { g as Ze } from "./chunks/Platform-S_xqIqcM.mjs";
|
|
21
21
|
import { a, i as i4, b as b4 } from "./chunks/Platform-S_xqIqcM.mjs";
|
|
22
22
|
import { E as et, S as tt, r as nt, L as st, a as rt } from "./chunks/resolvePluginLocale-B4w1OkPy.mjs";
|
|
23
|
-
import { T as it } from "./chunks/ToolbarPlugin-
|
|
24
|
-
import { P, b as b5, c as c5, d as d2, e as e3, a as a2 } from "./chunks/ToolbarPlugin-
|
|
23
|
+
import { T as it } from "./chunks/ToolbarPlugin-DpLVJ71w.mjs";
|
|
24
|
+
import { P, b as b5, c as c5, d as d2, e as e3, a as a2 } from "./chunks/ToolbarPlugin-DpLVJ71w.mjs";
|
|
25
25
|
import { n as ot, a as at, f as ct } from "./chunks/ToolbarKeyboardNav-DhpL8zNV.mjs";
|
|
26
|
-
import { a as a3, p as p3 } from "./chunks/PopupPositioning-
|
|
27
|
-
import { r as r2 } from "./chunks/ColorGrid-
|
|
28
|
-
import { D as lt, d as ht, C as dt } from "./chunks/index-
|
|
29
|
-
import { a as a4, b as b6, c as c6, i as i5, n as n2, w as w4 } from "./chunks/index-
|
|
26
|
+
import { a as a3, p as p3 } from "./chunks/PopupPositioning-BTT-_pQ3.mjs";
|
|
27
|
+
import { r as r2 } from "./chunks/ColorGrid-Dneqb8if.mjs";
|
|
28
|
+
import { D as lt, d as ht, C as dt } from "./chunks/index-D515iymW.mjs";
|
|
29
|
+
import { a as a4, b as b6, c as c6, i as i5, n as n2, w as w4 } from "./chunks/index-D515iymW.mjs";
|
|
30
30
|
import { f as ut } from "./chunks/ToolbarItem-BpZggUGo.mjs";
|
|
31
|
-
import { T as pt } from "./chunks/index-
|
|
32
|
-
import { a as a5, b as b7 } from "./chunks/index-
|
|
33
|
-
import { H as ft } from "./chunks/index
|
|
34
|
-
import { a as a6, b as b8 } from "./chunks/index
|
|
35
|
-
import { L as gt } from "./chunks/index-
|
|
36
|
-
import { a as a7, b as b9 } from "./chunks/index-
|
|
37
|
-
import { L as mt } from "./chunks/index-
|
|
38
|
-
import { a as a8, b as b10 } from "./chunks/index-
|
|
39
|
-
import { B as yt } from "./chunks/index-
|
|
40
|
-
import { a as a9, b as b11 } from "./chunks/index-
|
|
41
|
-
import { S as kt } from "./chunks/index-
|
|
42
|
-
import { a as a10, b as b12 } from "./chunks/index-
|
|
43
|
-
import { T as vt } from "./chunks/index-
|
|
44
|
-
import { a as a11, b as b13 } from "./chunks/index-
|
|
45
|
-
import { H as bt } from "./chunks/index-
|
|
46
|
-
import { a as a12, b as b14 } from "./chunks/index-
|
|
47
|
-
import { A as
|
|
48
|
-
import { a as a13, b as b15, c as c7, d as d3 } from "./chunks/index-
|
|
49
|
-
import { F as
|
|
50
|
-
import { a as a14, b as b16 } from "./chunks/index-
|
|
51
|
-
import { F as Et } from "./chunks/index-
|
|
52
|
-
import { a as a15, b as b17 } from "./chunks/index-
|
|
53
|
-
import { T as xt } from "./chunks/index-
|
|
54
|
-
import { a as a16, b as b18, c as c8, d as d4, e as e4, f as f2, g as g2, h as h3, i as i6, j as j4, k as k3, l as l2 } from "./chunks/index-
|
|
55
|
-
import { H as Ct } from "./chunks/index-
|
|
56
|
-
import { a as a17, b as b19 } from "./chunks/index-
|
|
57
|
-
import { S as Tt } from "./chunks/index-
|
|
58
|
-
import { a as a18, b as b20 } from "./chunks/index-
|
|
59
|
-
import { I as At } from "./chunks/index-
|
|
60
|
-
import { D as D2, a as a19, b as b21, c as c9 } from "./chunks/index-
|
|
31
|
+
import { T as pt } from "./chunks/index-Cd3uJLP3.mjs";
|
|
32
|
+
import { a as a5, b as b7 } from "./chunks/index-Cd3uJLP3.mjs";
|
|
33
|
+
import { H as ft } from "./chunks/index--n1RGpq-.mjs";
|
|
34
|
+
import { a as a6, b as b8 } from "./chunks/index--n1RGpq-.mjs";
|
|
35
|
+
import { L as gt } from "./chunks/index-fsVJLutn.mjs";
|
|
36
|
+
import { a as a7, b as b9 } from "./chunks/index-fsVJLutn.mjs";
|
|
37
|
+
import { L as mt } from "./chunks/index-BqNUfq-y.mjs";
|
|
38
|
+
import { a as a8, b as b10 } from "./chunks/index-BqNUfq-y.mjs";
|
|
39
|
+
import { B as yt } from "./chunks/index-Dk49P9N4.mjs";
|
|
40
|
+
import { a as a9, b as b11 } from "./chunks/index-Dk49P9N4.mjs";
|
|
41
|
+
import { S as kt } from "./chunks/index-BXtw5PNN.mjs";
|
|
42
|
+
import { a as a10, b as b12 } from "./chunks/index-BXtw5PNN.mjs";
|
|
43
|
+
import { T as vt } from "./chunks/index-BvqkuEY1.mjs";
|
|
44
|
+
import { a as a11, b as b13 } from "./chunks/index-BvqkuEY1.mjs";
|
|
45
|
+
import { H as bt } from "./chunks/index-CluzpB2b.mjs";
|
|
46
|
+
import { a as a12, b as b14 } from "./chunks/index-CluzpB2b.mjs";
|
|
47
|
+
import { A as St } from "./chunks/index-ABlTDvEX.mjs";
|
|
48
|
+
import { a as a13, b as b15, c as c7, d as d3 } from "./chunks/index-ABlTDvEX.mjs";
|
|
49
|
+
import { F as wt } from "./chunks/index-CWltg1wK.mjs";
|
|
50
|
+
import { a as a14, b as b16 } from "./chunks/index-CWltg1wK.mjs";
|
|
51
|
+
import { F as Et } from "./chunks/index-4or5UzNO.mjs";
|
|
52
|
+
import { a as a15, b as b17 } from "./chunks/index-4or5UzNO.mjs";
|
|
53
|
+
import { T as xt } from "./chunks/index-BhDXjueu.mjs";
|
|
54
|
+
import { a as a16, b as b18, c as c8, d as d4, e as e4, f as f2, g as g2, h as h3, i as i6, j as j4, k as k3, l as l2 } from "./chunks/index-BhDXjueu.mjs";
|
|
55
|
+
import { H as Ct } from "./chunks/index-D3NlpmT1.mjs";
|
|
56
|
+
import { a as a17, b as b19 } from "./chunks/index-D3NlpmT1.mjs";
|
|
57
|
+
import { S as Tt } from "./chunks/index-C1opJocO.mjs";
|
|
58
|
+
import { a as a18, b as b20 } from "./chunks/index-C1opJocO.mjs";
|
|
59
|
+
import { I as At } from "./chunks/index-DyzigvbZ.mjs";
|
|
60
|
+
import { D as D2, a as a19, b as b21, c as c9 } from "./chunks/index-DyzigvbZ.mjs";
|
|
61
61
|
import { GapCursorPlugin as Rt } from "./plugins/gap-cursor.mjs";
|
|
62
|
-
import Lt from "
|
|
63
|
-
import
|
|
64
|
-
import {
|
|
62
|
+
import { s as Lt, b as Mt, c as It, d as Nt, a as Bt, u as Ot, e as Pt, r as _t } from "./chunks/StyleRuntime-ChRjVQwL.mjs";
|
|
63
|
+
import Dt from "dompurify";
|
|
64
|
+
import { STARTER_FONTS as Ht } from "./fonts.mjs";
|
|
65
|
+
import { a as a20, g as g3, i as i7, r as r3 } from "./chunks/AttributedMarkCommands-BtLea72z.mjs";
|
|
65
66
|
import { c as c10, a as a21, b as b22, i as i8, s as s2 } from "./chunks/NavigationUtils-Cspt2ZrK.mjs";
|
|
66
|
-
import { f as f3 } from "./chunks/RangeIterator-
|
|
67
|
-
class
|
|
67
|
+
import { f as f3 } from "./chunks/RangeIterator-Bh4Vl_6D.mjs";
|
|
68
|
+
class zt {
|
|
68
69
|
_nodeSpecs = /* @__PURE__ */ new Map();
|
|
69
70
|
_markSpecs = /* @__PURE__ */ new Map();
|
|
70
71
|
_inlineNodeSpecs = /* @__PURE__ */ new Map();
|
|
@@ -140,7 +141,7 @@ class It {
|
|
|
140
141
|
this._nodeSpecs.clear(), this._markSpecs.clear(), this._inlineNodeSpecs.clear();
|
|
141
142
|
}
|
|
142
143
|
}
|
|
143
|
-
function
|
|
144
|
+
function jt(e5, t3, n3) {
|
|
144
145
|
const s3 = e5.getNodeSpec(t3);
|
|
145
146
|
if (!s3?.content) return true;
|
|
146
147
|
const r4 = e5.getNodeSpec(n3), i9 = r4?.group;
|
|
@@ -150,50 +151,50 @@ function Nt(e5, t3, n3) {
|
|
|
150
151
|
}
|
|
151
152
|
return false;
|
|
152
153
|
}
|
|
153
|
-
function
|
|
154
|
+
function $t(e5, t3, n3) {
|
|
154
155
|
const s3 = e5.getNodeSpec(t3);
|
|
155
156
|
if (!s3?.content) return true;
|
|
156
157
|
const { min: r4 = 0, max: i9 = Number.POSITIVE_INFINITY } = s3.content, o2 = n3.filter((e6) => "text" !== e6);
|
|
157
158
|
if (o2.length < r4 || o2.length > i9) return false;
|
|
158
|
-
for (const n4 of o2) if (!
|
|
159
|
+
for (const n4 of o2) if (!jt(e5, t3, n4)) return false;
|
|
159
160
|
return true;
|
|
160
161
|
}
|
|
161
|
-
function
|
|
162
|
-
e5.registerNodeSpec({ type: "paragraph", group: "block", content: { allow: ["text"] }, toDOM: (e6) =>
|
|
162
|
+
function Kt(e5) {
|
|
163
|
+
e5.registerNodeSpec({ type: "paragraph", group: "block", content: { allow: ["text"] }, toDOM: (e6) => we("p", e6.id), toHTML: (e6, t3) => `<p>${t3 || "<br>"}</p>`, parseHTML: [{ tag: "p" }, { tag: "div", priority: 10 }], sanitize: { tags: ["p"] } });
|
|
163
164
|
}
|
|
164
|
-
function
|
|
165
|
-
return { children:
|
|
165
|
+
function Ft(e5, t3, n3) {
|
|
166
|
+
return { children: Ut(e5.children, t3, n3) };
|
|
166
167
|
}
|
|
167
|
-
function
|
|
168
|
+
function Ut(e5, t3, n3) {
|
|
168
169
|
return e5.map((e6) => {
|
|
169
170
|
if (!S(e6)) return e6;
|
|
170
171
|
if (e6.id === t3) return n3(e6);
|
|
171
|
-
const s3 =
|
|
172
|
+
const s3 = Ut(e6.children, t3, n3);
|
|
172
173
|
return s3 === e6.children ? e6 : { ...e6, children: s3 };
|
|
173
174
|
});
|
|
174
175
|
}
|
|
175
|
-
function
|
|
176
|
+
function Wt(e5, t3, n3) {
|
|
176
177
|
if (0 === t3.length) return e5;
|
|
177
178
|
const s3 = t3[0];
|
|
178
|
-
return s3 ? { children: e5.children.map((e6) => S(e6) && e6.id === s3 ? 1 === t3.length ? n3(e6) :
|
|
179
|
+
return s3 ? { children: e5.children.map((e6) => S(e6) && e6.id === s3 ? 1 === t3.length ? n3(e6) : Vt(e6, t3, 1, n3) : e6) } : e5;
|
|
179
180
|
}
|
|
180
|
-
function
|
|
181
|
+
function Vt(e5, t3, n3, s3) {
|
|
181
182
|
const r4 = t3[n3];
|
|
182
183
|
if (!r4) return e5;
|
|
183
|
-
const i9 = e5.children.map((e6) => S(e6) && e6.id === r4 ? n3 === t3.length - 1 ? s3(e6) :
|
|
184
|
+
const i9 = e5.children.map((e6) => S(e6) && e6.id === r4 ? n3 === t3.length - 1 ? s3(e6) : Vt(e6, t3, n3 + 1, s3) : e6);
|
|
184
185
|
return { ...e5, children: i9 };
|
|
185
186
|
}
|
|
186
|
-
function
|
|
187
|
+
function Gt(e5, t3, n3) {
|
|
187
188
|
if (t3(e5)) return n3(e5);
|
|
188
189
|
let s3 = false;
|
|
189
190
|
const r4 = e5.map((e6) => {
|
|
190
191
|
if (!S(e6)) return e6;
|
|
191
|
-
const r5 =
|
|
192
|
+
const r5 = Gt(e6.children, t3, n3);
|
|
192
193
|
return r5 ? (s3 = true, { ...e6, children: r5 }) : e6;
|
|
193
194
|
});
|
|
194
195
|
return s3 ? r4 : null;
|
|
195
196
|
}
|
|
196
|
-
function
|
|
197
|
+
function qt(e5, t3, n3) {
|
|
197
198
|
const s3 = [];
|
|
198
199
|
let r4 = 0;
|
|
199
200
|
for (const i9 of e5) {
|
|
@@ -212,7 +213,7 @@ function jt(e5, t3, n3) {
|
|
|
212
213
|
}
|
|
213
214
|
return 0 === s3.length && s3.push(T("")), s3;
|
|
214
215
|
}
|
|
215
|
-
function
|
|
216
|
+
function Jt(e5, t3, n3, s3, r4) {
|
|
216
217
|
const i9 = [];
|
|
217
218
|
let o2 = 0;
|
|
218
219
|
for (const a22 of e5) {
|
|
@@ -237,16 +238,16 @@ function $t(e5, t3, n3, s3, r4) {
|
|
|
237
238
|
}
|
|
238
239
|
return i9;
|
|
239
240
|
}
|
|
240
|
-
function
|
|
241
|
+
function Qt(e5, t3) {
|
|
241
242
|
if (e5.every((e6) => R(e6) || C(e6))) return t3;
|
|
242
243
|
const n3 = e5.filter((e6) => !R(e6) && !C(e6));
|
|
243
244
|
return [...t3, ...n3];
|
|
244
245
|
}
|
|
245
|
-
function
|
|
246
|
+
function Xt(e5, t3) {
|
|
246
247
|
switch (t3.type) {
|
|
247
248
|
case "insertText":
|
|
248
249
|
return (function(e6, t4) {
|
|
249
|
-
return
|
|
250
|
+
return Ft(e6, t4.blockId, (e7) => {
|
|
250
251
|
const n3 = I(e7), s3 = t4.segments ? (function(e8, t5, n4) {
|
|
251
252
|
const s4 = [];
|
|
252
253
|
let r4 = 0, i9 = false;
|
|
@@ -287,12 +288,12 @@ function Ft(e5, t3) {
|
|
|
287
288
|
}
|
|
288
289
|
return o2 || r4.push(T(n4, s4)), r4;
|
|
289
290
|
})(n3, t4.offset, t4.text, t4.marks);
|
|
290
|
-
return { ...e7, children:
|
|
291
|
+
return { ...e7, children: Qt(e7.children, N(s3)) };
|
|
291
292
|
});
|
|
292
293
|
})(e5, t3);
|
|
293
294
|
case "deleteText":
|
|
294
295
|
return (function(e6, t4) {
|
|
295
|
-
return
|
|
296
|
+
return Ft(e6, t4.blockId, (e7) => {
|
|
296
297
|
const n3 = (function(e8, t5, n4) {
|
|
297
298
|
const s3 = [];
|
|
298
299
|
let r4 = 0;
|
|
@@ -312,22 +313,22 @@ function Ft(e5, t3) {
|
|
|
312
313
|
}
|
|
313
314
|
return s3;
|
|
314
315
|
})(I(e7), t4.from, t4.to);
|
|
315
|
-
return { ...e7, children:
|
|
316
|
+
return { ...e7, children: Qt(e7.children, N(n3)) };
|
|
316
317
|
});
|
|
317
318
|
})(e5, t3);
|
|
318
319
|
case "splitBlock":
|
|
319
320
|
return (function(e6, t4) {
|
|
320
|
-
const n3 =
|
|
321
|
+
const n3 = Gt(e6.children, (e7) => e7.some((e8) => S(e8) && e8.id === t4.blockId), (e7) => {
|
|
321
322
|
const n4 = e7.findIndex((e8) => S(e8) && e8.id === t4.blockId);
|
|
322
323
|
if (-1 === n4) return e7;
|
|
323
|
-
const s3 = e7[n4], r4 = I(s3), i9 = O(s3), o2 =
|
|
324
|
+
const s3 = e7[n4], r4 = I(s3), i9 = O(s3), o2 = qt(r4, 0, t4.offset), a22 = qt(r4, t4.offset, i9), c11 = { ...s3, children: N(o2) }, l3 = _(s3.type, N(a22), t4.newBlockId, s3.attrs), h4 = [...e7];
|
|
324
325
|
return h4.splice(n4, 1, c11, l3), h4;
|
|
325
326
|
});
|
|
326
327
|
return n3 ? { children: n3 } : e6;
|
|
327
328
|
})(e5, t3);
|
|
328
329
|
case "mergeBlocks":
|
|
329
330
|
return (function(e6, t4) {
|
|
330
|
-
const n3 =
|
|
331
|
+
const n3 = Gt(e6.children, (e7) => e7.some((e8) => S(e8) && e8.id === t4.targetBlockId) && e7.some((e8) => S(e8) && e8.id === t4.sourceBlockId), (e7) => {
|
|
331
332
|
const n4 = e7.findIndex((e8) => S(e8) && e8.id === t4.targetBlockId), s3 = e7.findIndex((e8) => S(e8) && e8.id === t4.sourceBlockId);
|
|
332
333
|
if (-1 === n4 || -1 === s3) return e7;
|
|
333
334
|
const r4 = e7[n4], i9 = e7[s3], o2 = I(r4), a22 = I(i9), c11 = N([...o2, ...a22]), l3 = { ...r4, children: c11 };
|
|
@@ -337,23 +338,23 @@ function Ft(e5, t3) {
|
|
|
337
338
|
})(e5, t3);
|
|
338
339
|
case "addMark":
|
|
339
340
|
return (function(e6, t4) {
|
|
340
|
-
return
|
|
341
|
-
const n3 =
|
|
342
|
-
return { ...e7, children:
|
|
341
|
+
return Ft(e6, t4.blockId, (e7) => {
|
|
342
|
+
const n3 = Jt(I(e7), t4.from, t4.to, t4.mark, true);
|
|
343
|
+
return { ...e7, children: Qt(e7.children, N(n3)) };
|
|
343
344
|
});
|
|
344
345
|
})(e5, t3);
|
|
345
346
|
case "removeMark":
|
|
346
347
|
return (function(e6, t4) {
|
|
347
|
-
return
|
|
348
|
-
const n3 =
|
|
349
|
-
return { ...e7, children:
|
|
348
|
+
return Ft(e6, t4.blockId, (e7) => {
|
|
349
|
+
const n3 = Jt(I(e7), t4.from, t4.to, t4.mark, false);
|
|
350
|
+
return { ...e7, children: Qt(e7.children, N(n3)) };
|
|
350
351
|
});
|
|
351
352
|
})(e5, t3);
|
|
352
353
|
case "setStoredMarks":
|
|
353
354
|
return e5;
|
|
354
355
|
case "setBlockType":
|
|
355
356
|
return (function(e6, t4) {
|
|
356
|
-
return
|
|
357
|
+
return Ft(e6, t4.blockId, (e7) => ({ ...e7, type: t4.nodeType, ...t4.attrs ? { attrs: t4.attrs } : { attrs: void 0 } }));
|
|
357
358
|
})(e5, t3);
|
|
358
359
|
case "insertNode":
|
|
359
360
|
return (function(e6, t4) {
|
|
@@ -361,7 +362,7 @@ function Ft(e5, t3) {
|
|
|
361
362
|
const n3 = [...e6.children];
|
|
362
363
|
return n3.splice(t4.index, 0, t4.node), { children: n3 };
|
|
363
364
|
}
|
|
364
|
-
return
|
|
365
|
+
return Wt(e6, t4.parentPath, (e7) => {
|
|
365
366
|
const n3 = [...e7.children];
|
|
366
367
|
return n3.splice(t4.index, 0, t4.node), { ...e7, children: n3 };
|
|
367
368
|
});
|
|
@@ -372,7 +373,7 @@ function Ft(e5, t3) {
|
|
|
372
373
|
const n3 = [...e6.children];
|
|
373
374
|
return n3.splice(t4.index, 1), { children: n3 };
|
|
374
375
|
}
|
|
375
|
-
return
|
|
376
|
+
return Wt(e6, t4.parentPath, (e7) => {
|
|
376
377
|
const n3 = [...e7.children];
|
|
377
378
|
return n3.splice(t4.index, 1), { ...e7, children: n3 };
|
|
378
379
|
});
|
|
@@ -380,11 +381,11 @@ function Ft(e5, t3) {
|
|
|
380
381
|
case "setNodeAttr":
|
|
381
382
|
return (function(e6, t4) {
|
|
382
383
|
const n3 = t4.path[t4.path.length - 1];
|
|
383
|
-
return n3 ?
|
|
384
|
+
return n3 ? Ft(e6, n3, (e7) => ({ ...e7, attrs: t4.attrs })) : e6;
|
|
384
385
|
})(e5, t3);
|
|
385
386
|
case "insertInlineNode":
|
|
386
387
|
return (function(e6, t4) {
|
|
387
|
-
return
|
|
388
|
+
return Ft(e6, t4.blockId, (e7) => {
|
|
388
389
|
const n3 = (function(e8, t5, n4) {
|
|
389
390
|
const s3 = [];
|
|
390
391
|
let r4 = 0, i9 = false;
|
|
@@ -402,36 +403,36 @@ function Ft(e5, t3) {
|
|
|
402
403
|
}
|
|
403
404
|
return i9 || s3.push(n4), s3;
|
|
404
405
|
})(I(e7), t4.offset, t4.node);
|
|
405
|
-
return { ...e7, children:
|
|
406
|
+
return { ...e7, children: Qt(e7.children, N(n3)) };
|
|
406
407
|
});
|
|
407
408
|
})(e5, t3);
|
|
408
409
|
case "removeInlineNode":
|
|
409
410
|
return (function(e6, t4) {
|
|
410
|
-
return
|
|
411
|
+
return Ft(e6, t4.blockId, (e7) => {
|
|
411
412
|
const n3 = (function(e8, t5) {
|
|
412
413
|
const n4 = [];
|
|
413
414
|
let s3 = 0;
|
|
414
415
|
for (const r4 of e8) C(r4) ? (s3 !== t5 && n4.push(r4), s3 += 1) : (n4.push(r4), s3 += r4.text.length);
|
|
415
416
|
return n4;
|
|
416
417
|
})(I(e7), t4.offset);
|
|
417
|
-
return { ...e7, children:
|
|
418
|
+
return { ...e7, children: Qt(e7.children, N(n3)) };
|
|
418
419
|
});
|
|
419
420
|
})(e5, t3);
|
|
420
421
|
case "setInlineNodeAttr":
|
|
421
422
|
return (function(e6, t4) {
|
|
422
|
-
return
|
|
423
|
+
return Ft(e6, t4.blockId, (e7) => {
|
|
423
424
|
const n3 = (function(e8, t5, n4) {
|
|
424
425
|
const s3 = [];
|
|
425
426
|
let r4 = 0;
|
|
426
427
|
for (const i9 of e8) C(i9) ? (r4 === t5 ? s3.push({ ...i9, attrs: n4 }) : s3.push(i9), r4 += 1) : (s3.push(i9), r4 += i9.text.length);
|
|
427
428
|
return s3;
|
|
428
429
|
})(I(e7), t4.offset, t4.attrs);
|
|
429
|
-
return { ...e7, children:
|
|
430
|
+
return { ...e7, children: Qt(e7.children, n3) };
|
|
430
431
|
});
|
|
431
432
|
})(e5, t3);
|
|
432
433
|
}
|
|
433
434
|
}
|
|
434
|
-
function
|
|
435
|
+
function Yt(e5) {
|
|
435
436
|
switch (e5.type) {
|
|
436
437
|
case "insertText":
|
|
437
438
|
return { type: "deleteText", blockId: e5.blockId, from: e5.offset, to: e5.offset + e5.text.length, deletedText: e5.text, deletedMarks: e5.marks, deletedSegments: e5.segments ?? [{ text: e5.text, marks: [...e5.marks] }], ...e5.path ? { path: e5.path } : {} };
|
|
@@ -463,10 +464,10 @@ function Ut(e5) {
|
|
|
463
464
|
return { type: "setInlineNodeAttr", blockId: e5.blockId, offset: e5.offset, attrs: e5.previousAttrs, previousAttrs: e5.attrs, ...e5.path ? { path: e5.path } : {} };
|
|
464
465
|
}
|
|
465
466
|
}
|
|
466
|
-
function
|
|
467
|
-
return { steps: e5.steps.map(
|
|
467
|
+
function Zt(e5) {
|
|
468
|
+
return { steps: e5.steps.map(Yt).reverse(), selectionBefore: e5.selectionAfter, selectionAfter: e5.selectionBefore, storedMarksAfter: null, metadata: { origin: "history", timestamp: Date.now() } };
|
|
468
469
|
}
|
|
469
|
-
class
|
|
470
|
+
class en {
|
|
470
471
|
steps = [];
|
|
471
472
|
selection;
|
|
472
473
|
storedMarks;
|
|
@@ -606,10 +607,10 @@ class Vt {
|
|
|
606
607
|
return { steps: [...this.steps], selectionBefore: this.selectionBefore, selectionAfter: this.selection, storedMarksAfter: this.storedMarks, metadata: { origin: this.origin, timestamp: Date.now(), ...this._readonlyAllowed ? { readonlyAllowed: true } : {} } };
|
|
607
608
|
}
|
|
608
609
|
advanceDoc(e5) {
|
|
609
|
-
this.workingDoc && (this.workingDoc =
|
|
610
|
+
this.workingDoc && (this.workingDoc = Xt(this.workingDoc, e5));
|
|
610
611
|
}
|
|
611
612
|
}
|
|
612
|
-
class
|
|
613
|
+
class tn {
|
|
613
614
|
doc;
|
|
614
615
|
selection;
|
|
615
616
|
storedMarks;
|
|
@@ -621,21 +622,21 @@ class Gt {
|
|
|
621
622
|
}
|
|
622
623
|
static create(e5) {
|
|
623
624
|
const t3 = e5?.schema ?? pe(), n3 = e5?.doc ?? W(), s3 = n3.children[0], r4 = e5?.selection ?? re(s3 ? s3.id : ye(""), 0);
|
|
624
|
-
return new
|
|
625
|
+
return new tn(n3, r4, null, t3);
|
|
625
626
|
}
|
|
626
627
|
transaction(e5 = "api") {
|
|
627
|
-
return new
|
|
628
|
+
return new en(this.selection, this.storedMarks, e5, this.doc);
|
|
628
629
|
}
|
|
629
630
|
apply(e5) {
|
|
630
631
|
let t3 = this.doc;
|
|
631
|
-
for (const n4 of e5.steps) t3 =
|
|
632
|
+
for (const n4 of e5.steps) t3 = Xt(t3, n4);
|
|
632
633
|
const n3 = (function(e6, t4) {
|
|
633
|
-
if (ie(t4)) return Ce(e6, t4.nodeId) ? t4 :
|
|
634
|
-
if (oe(t4)) return Ce(e6, t4.blockId) ? t4 :
|
|
635
|
-
const n4 =
|
|
634
|
+
if (ie(t4)) return Ce(e6, t4.nodeId) ? t4 : sn(e6, t4);
|
|
635
|
+
if (oe(t4)) return Ce(e6, t4.blockId) ? t4 : sn(e6, t4);
|
|
636
|
+
const n4 = nn(e6, t4.anchor), s3 = nn(e6, t4.head);
|
|
636
637
|
return n4 === t4.anchor && s3 === t4.head ? t4 : ae(n4, s3);
|
|
637
638
|
})(t3, e5.selectionAfter);
|
|
638
|
-
return new
|
|
639
|
+
return new tn(t3, n3, e5.storedMarksAfter, this.schema);
|
|
639
640
|
}
|
|
640
641
|
getBlock(e5) {
|
|
641
642
|
return this._blockMap ??= (function(e6) {
|
|
@@ -666,10 +667,10 @@ class Gt {
|
|
|
666
667
|
return { doc: this.doc, selection: this.selection };
|
|
667
668
|
}
|
|
668
669
|
static fromJSON(e5, t3) {
|
|
669
|
-
return new
|
|
670
|
+
return new tn(e5.doc, e5.selection, null, t3 ?? pe());
|
|
670
671
|
}
|
|
671
672
|
}
|
|
672
|
-
function
|
|
673
|
+
function nn(e5, t3) {
|
|
673
674
|
const n3 = Ce(e5, t3.blockId);
|
|
674
675
|
if (n3) {
|
|
675
676
|
const e6 = O(n3);
|
|
@@ -678,27 +679,27 @@ function qt(e5, t3) {
|
|
|
678
679
|
const s3 = e5.children[0];
|
|
679
680
|
return s3 ? ce(s3.id, 0) : t3;
|
|
680
681
|
}
|
|
681
|
-
function
|
|
682
|
-
const n3 =
|
|
682
|
+
function sn(e5, t3) {
|
|
683
|
+
const n3 = rn(e5.children);
|
|
683
684
|
return n3 ? re(n3.id, 0) : t3;
|
|
684
685
|
}
|
|
685
|
-
function
|
|
686
|
+
function rn(e5) {
|
|
686
687
|
for (const t3 of e5) {
|
|
687
688
|
if (!S(t3)) continue;
|
|
688
689
|
if (V(t3)) return t3;
|
|
689
|
-
const e6 =
|
|
690
|
+
const e6 = rn(t3.children);
|
|
690
691
|
if (e6) return e6;
|
|
691
692
|
}
|
|
692
693
|
return null;
|
|
693
694
|
}
|
|
694
|
-
function
|
|
695
|
+
function on(e5) {
|
|
695
696
|
for (const t3 of e5.steps) if ("setStoredMarks" !== t3.type) return false;
|
|
696
697
|
return true;
|
|
697
698
|
}
|
|
698
|
-
function
|
|
699
|
-
return !!e5.metadata.readonlyAllowed ||
|
|
699
|
+
function an(e5) {
|
|
700
|
+
return !!e5.metadata.readonlyAllowed || on(e5);
|
|
700
701
|
}
|
|
701
|
-
class
|
|
702
|
+
class cn {
|
|
702
703
|
undoStack = [];
|
|
703
704
|
redoStack = [];
|
|
704
705
|
groupTimeoutMs;
|
|
@@ -721,7 +722,7 @@ class Zt {
|
|
|
721
722
|
for (let e6 = t3.transactions.length - 1; e6 >= 0; e6--) {
|
|
722
723
|
const r4 = t3.transactions[e6];
|
|
723
724
|
if (!r4) continue;
|
|
724
|
-
const i9 =
|
|
725
|
+
const i9 = Zt(r4);
|
|
725
726
|
n3 = n3.apply(i9), s3.push(...i9.steps);
|
|
726
727
|
}
|
|
727
728
|
return this.redoStack.push({ transactions: t3.transactions, timestamp: Date.now() }), this.lastOrigin = null, { state: n3, transaction: { steps: s3, selectionBefore: e5.selection, selectionAfter: n3.selection, storedMarksAfter: n3.storedMarks, metadata: { origin: "history", timestamp: Date.now(), historyDirection: "undo" } } };
|
|
@@ -750,7 +751,7 @@ class Zt {
|
|
|
750
751
|
return s3 === r4;
|
|
751
752
|
}
|
|
752
753
|
}
|
|
753
|
-
function
|
|
754
|
+
function ln(e5, t3) {
|
|
754
755
|
const n3 = e5.selection;
|
|
755
756
|
if (ie(n3)) return ze(e5, n3);
|
|
756
757
|
if (oe(n3)) return null;
|
|
@@ -762,13 +763,13 @@ function en(e5, t3) {
|
|
|
762
763
|
const [i9, o2] = r4;
|
|
763
764
|
return e5.transaction("input").deleteTextAt(s3.id, i9, o2).setSelection(re(s3.id, i9)).build();
|
|
764
765
|
}
|
|
765
|
-
function
|
|
766
|
-
return
|
|
766
|
+
function hn(e5) {
|
|
767
|
+
return ln(e5, { merge: Ke, range: (e6, t3) => t3 > 0 ? [t3 - 1, t3] : null });
|
|
767
768
|
}
|
|
768
|
-
function
|
|
769
|
-
return
|
|
769
|
+
function dn(e5) {
|
|
770
|
+
return ln(e5, { merge: $e, range: (e6, t3) => t3 < O(e6) ? [t3, t3 + 1] : null });
|
|
770
771
|
}
|
|
771
|
-
class
|
|
772
|
+
class un {
|
|
772
773
|
constructor(e5, t3) {
|
|
773
774
|
this.element = e5, this.getState = t3.getState, this.dispatch = t3.dispatch, this.undo = t3.undo, this.redo = t3.redo, this.keymapRegistry = t3.keymapRegistry, this.isReadOnly = t3.isReadOnly ?? (() => false), this.compositionTracker = t3.compositionTracker, this.handleKeydown = this.onKeydown.bind(this), e5.addEventListener("keydown", this.handleKeydown);
|
|
774
775
|
}
|
|
@@ -786,7 +787,7 @@ class sn {
|
|
|
786
787
|
if (this.handleGapCursorKeys(e5)) return;
|
|
787
788
|
if (this.isReadOnly()) {
|
|
788
789
|
if (this.keymapRegistry) {
|
|
789
|
-
const t4 =
|
|
790
|
+
const t4 = pn(e5), n4 = this.keymapRegistry.getKeymapsByPriority().navigation;
|
|
790
791
|
for (let s4 = n4.length - 1; s4 >= 0; s4--) {
|
|
791
792
|
const r4 = n4[s4]?.[t4];
|
|
792
793
|
if (r4?.()) return void e5.preventDefault();
|
|
@@ -795,7 +796,7 @@ class sn {
|
|
|
795
796
|
return void this.handleEscape(e5);
|
|
796
797
|
}
|
|
797
798
|
if (this.keymapRegistry) {
|
|
798
|
-
const t4 =
|
|
799
|
+
const t4 = pn(e5), n4 = this.keymapRegistry.getKeymapsByPriority();
|
|
799
800
|
for (const s4 of [n4.context, n4.navigation, n4.default]) for (let n5 = s4.length - 1; n5 >= 0; n5--) {
|
|
800
801
|
const r4 = s4[n5]?.[t4];
|
|
801
802
|
if (r4?.()) return void e5.preventDefault();
|
|
@@ -891,13 +892,13 @@ class sn {
|
|
|
891
892
|
this.element.removeEventListener("keydown", this.handleKeydown);
|
|
892
893
|
}
|
|
893
894
|
}
|
|
894
|
-
function
|
|
895
|
+
function pn(e5) {
|
|
895
896
|
const t3 = [];
|
|
896
897
|
(e5.metaKey || e5.ctrlKey) && t3.push("Mod"), e5.shiftKey && t3.push("Shift"), e5.altKey && t3.push("Alt");
|
|
897
898
|
let n3 = e5.key;
|
|
898
899
|
return " " === n3 ? n3 = "Space" : 1 === n3.length && (n3 = n3.toUpperCase()), t3.push(n3), t3.join("-");
|
|
899
900
|
}
|
|
900
|
-
function
|
|
901
|
+
function fn(e5) {
|
|
901
902
|
const t3 = e5.getMarkTypes(), n3 = /* @__PURE__ */ new Map();
|
|
902
903
|
for (const s3 of t3) {
|
|
903
904
|
const t4 = e5.getMarkSpec(s3);
|
|
@@ -905,11 +906,11 @@ function on(e5) {
|
|
|
905
906
|
}
|
|
906
907
|
return n3;
|
|
907
908
|
}
|
|
908
|
-
function
|
|
909
|
+
function gn(e5, t3, n3, s3) {
|
|
909
910
|
if ("" === e5) return "";
|
|
910
911
|
let r4 = Ee(e5);
|
|
911
912
|
if (0 === t3.length) return r4;
|
|
912
|
-
const i9 = s3 ??
|
|
913
|
+
const i9 = s3 ?? fn(n3), o2 = [...t3].sort((e6, t4) => (i9.get(e6.type) ?? 99) - (i9.get(t4.type) ?? 99)), a22 = [], c11 = [];
|
|
913
914
|
for (const e6 of o2) {
|
|
914
915
|
const t4 = n3.getMarkSpec(e6.type);
|
|
915
916
|
if (t4?.toHTMLStyle) {
|
|
@@ -924,8 +925,8 @@ function an(e5, t3, n3, s3) {
|
|
|
924
925
|
}
|
|
925
926
|
return r4;
|
|
926
927
|
}
|
|
927
|
-
let
|
|
928
|
-
class
|
|
928
|
+
let mn;
|
|
929
|
+
class yn {
|
|
929
930
|
constructor(e5, t3) {
|
|
930
931
|
this.element = e5, this.getState = t3.getState, this.dispatch = t3.dispatch, this.schemaRegistry = t3.schemaRegistry, this.syncSelection = t3.syncSelection, this.isReadOnly = t3.isReadOnly ?? (() => false), this.handleCopy = this.onCopy.bind(this), this.handleCut = this.onCut.bind(this), e5.addEventListener("copy", this.handleCopy), e5.addEventListener("cut", this.handleCut);
|
|
931
932
|
}
|
|
@@ -991,7 +992,7 @@ class ln {
|
|
|
991
992
|
}
|
|
992
993
|
const l3 = a22.join("\n");
|
|
993
994
|
if (e5.setData("text/plain", l3), this.schemaRegistry) {
|
|
994
|
-
const n4 =
|
|
995
|
+
const n4 = fn(this.schemaRegistry), a23 = [];
|
|
995
996
|
for (let e6 = i9; e6 <= o2; e6++) {
|
|
996
997
|
const c12 = s3[e6];
|
|
997
998
|
if (!c12) continue;
|
|
@@ -1003,7 +1004,7 @@ class ln {
|
|
|
1003
1004
|
e5.setData("text/html", a23.join(""));
|
|
1004
1005
|
}
|
|
1005
1006
|
!(function(e6, t4) {
|
|
1006
|
-
|
|
1007
|
+
mn = { plainText: e6, blocks: t4 };
|
|
1007
1008
|
})(l3, c11);
|
|
1008
1009
|
}
|
|
1009
1010
|
serializeBlockRangeToHTML(e5, t3, n3, s3) {
|
|
@@ -1015,7 +1016,7 @@ class ln {
|
|
|
1015
1016
|
else {
|
|
1016
1017
|
if (R(e6)) {
|
|
1017
1018
|
const r6 = Math.max(0, t3 - o2), a22 = Math.min(e6.text.length, n3 - o2), c11 = e6.text.slice(r6, a22);
|
|
1018
|
-
c11.length > 0 && this.schemaRegistry && i9.push(
|
|
1019
|
+
c11.length > 0 && this.schemaRegistry && i9.push(gn(c11, e6.marks, this.schemaRegistry, s3));
|
|
1019
1020
|
} else if (C(e6)) {
|
|
1020
1021
|
const t4 = this.schemaRegistry?.getInlineNodeSpec(e6.inlineType);
|
|
1021
1022
|
t4?.toHTMLString && i9.push(t4.toHTMLString(e6));
|
|
@@ -1029,7 +1030,7 @@ class ln {
|
|
|
1029
1030
|
this.element.removeEventListener("copy", this.handleCopy), this.element.removeEventListener("cut", this.handleCut);
|
|
1030
1031
|
}
|
|
1031
1032
|
}
|
|
1032
|
-
class
|
|
1033
|
+
class kn {
|
|
1033
1034
|
_composing = false;
|
|
1034
1035
|
_activeBlockId = null;
|
|
1035
1036
|
get isComposing() {
|
|
@@ -1045,7 +1046,7 @@ class hn {
|
|
|
1045
1046
|
this._composing = false, this._activeBlockId = null;
|
|
1046
1047
|
}
|
|
1047
1048
|
}
|
|
1048
|
-
class
|
|
1049
|
+
class vn {
|
|
1049
1050
|
_contextKeymaps = [];
|
|
1050
1051
|
_navigationKeymaps = [];
|
|
1051
1052
|
_defaultKeymaps = [];
|
|
@@ -1083,7 +1084,7 @@ class dn {
|
|
|
1083
1084
|
}
|
|
1084
1085
|
}
|
|
1085
1086
|
}
|
|
1086
|
-
class
|
|
1087
|
+
class bn {
|
|
1087
1088
|
_inputRules = [];
|
|
1088
1089
|
registerInputRule(e5) {
|
|
1089
1090
|
this._inputRules.push(e5);
|
|
@@ -1099,7 +1100,7 @@ class un {
|
|
|
1099
1100
|
this._inputRules.length = 0;
|
|
1100
1101
|
}
|
|
1101
1102
|
}
|
|
1102
|
-
class
|
|
1103
|
+
class Sn {
|
|
1103
1104
|
_fileHandlers = [];
|
|
1104
1105
|
registerFileHandler(e5, t3) {
|
|
1105
1106
|
this._fileHandlers.push({ pattern: e5, handler: t3 });
|
|
@@ -1109,7 +1110,7 @@ class pn {
|
|
|
1109
1110
|
}
|
|
1110
1111
|
matchFileHandlers(e5) {
|
|
1111
1112
|
const t3 = [];
|
|
1112
|
-
for (const n3 of this._fileHandlers)
|
|
1113
|
+
for (const n3 of this._fileHandlers) wn(n3.pattern, e5) && t3.push(n3.handler);
|
|
1113
1114
|
return t3;
|
|
1114
1115
|
}
|
|
1115
1116
|
removeFileHandler(e5) {
|
|
@@ -1120,7 +1121,7 @@ class pn {
|
|
|
1120
1121
|
this._fileHandlers.length = 0;
|
|
1121
1122
|
}
|
|
1122
1123
|
}
|
|
1123
|
-
function
|
|
1124
|
+
function wn(e5, t3) {
|
|
1124
1125
|
if ("*" === e5 || "*/*" === e5) return true;
|
|
1125
1126
|
if (e5 === t3) return true;
|
|
1126
1127
|
if (e5.endsWith("/*")) {
|
|
@@ -1129,7 +1130,7 @@ function fn(e5, t3) {
|
|
|
1129
1130
|
}
|
|
1130
1131
|
return false;
|
|
1131
1132
|
}
|
|
1132
|
-
class
|
|
1133
|
+
class En {
|
|
1133
1134
|
_nodeViews = /* @__PURE__ */ new Map();
|
|
1134
1135
|
registerNodeView(e5, t3) {
|
|
1135
1136
|
if (this._nodeViews.has(e5)) throw new Error(`NodeView for type "${e5}" is already registered.`);
|
|
@@ -1145,7 +1146,7 @@ class gn {
|
|
|
1145
1146
|
this._nodeViews.clear();
|
|
1146
1147
|
}
|
|
1147
1148
|
}
|
|
1148
|
-
class
|
|
1149
|
+
class xn {
|
|
1149
1150
|
_toolbarItems = /* @__PURE__ */ new Map();
|
|
1150
1151
|
_toolbarItemPluginMap = /* @__PURE__ */ new Map();
|
|
1151
1152
|
registerToolbarItem(e5, t3) {
|
|
@@ -1183,7 +1184,7 @@ class mn {
|
|
|
1183
1184
|
this._toolbarItems.clear(), this._toolbarItemPluginMap.clear();
|
|
1184
1185
|
}
|
|
1185
1186
|
}
|
|
1186
|
-
class
|
|
1187
|
+
class Cn {
|
|
1187
1188
|
_entries = /* @__PURE__ */ new Map();
|
|
1188
1189
|
registerBlockTypePickerEntry(e5) {
|
|
1189
1190
|
if (this._entries.has(e5.id)) throw new Error(`BlockTypePickerEntry with id "${e5.id}" is already registered.`);
|
|
@@ -1199,7 +1200,7 @@ class yn {
|
|
|
1199
1200
|
this._entries.clear();
|
|
1200
1201
|
}
|
|
1201
1202
|
}
|
|
1202
|
-
function
|
|
1203
|
+
function Tn(e5, t3) {
|
|
1203
1204
|
if (t3) {
|
|
1204
1205
|
const n3 = t3.getMarkSpec(e5.type);
|
|
1205
1206
|
if (n3) return n3.rank ?? 100;
|
|
@@ -1215,7 +1216,7 @@ function kn(e5, t3) {
|
|
|
1215
1216
|
return 100;
|
|
1216
1217
|
}
|
|
1217
1218
|
}
|
|
1218
|
-
function
|
|
1219
|
+
function An(e5, t3) {
|
|
1219
1220
|
if (t3) {
|
|
1220
1221
|
const n3 = t3.getMarkSpec(e5.type);
|
|
1221
1222
|
if (n3) return n3.toDOM(e5);
|
|
@@ -1231,7 +1232,7 @@ function vn(e5, t3) {
|
|
|
1231
1232
|
return document.createElement("span");
|
|
1232
1233
|
}
|
|
1233
1234
|
}
|
|
1234
|
-
class
|
|
1235
|
+
class Rn {
|
|
1235
1236
|
wrapperElement = null;
|
|
1236
1237
|
container;
|
|
1237
1238
|
registry;
|
|
@@ -1252,11 +1253,11 @@ class bn {
|
|
|
1252
1253
|
s3.setAttribute("data-cursor-wrapper", "");
|
|
1253
1254
|
const r4 = document.createTextNode("");
|
|
1254
1255
|
let i9 = r4;
|
|
1255
|
-
const o2 = [...t3].sort((e6, t4) =>
|
|
1256
|
+
const o2 = [...t3].sort((e6, t4) => Tn(e6, this.registry) - Tn(t4, this.registry));
|
|
1256
1257
|
for (let e6 = o2.length - 1; e6 >= 0; e6--) {
|
|
1257
1258
|
const t4 = o2[e6];
|
|
1258
1259
|
if (!t4) continue;
|
|
1259
|
-
const n4 =
|
|
1260
|
+
const n4 = An(t4, this.registry);
|
|
1260
1261
|
n4.appendChild(i9), i9 = n4;
|
|
1261
1262
|
}
|
|
1262
1263
|
s3.appendChild(i9);
|
|
@@ -1274,8 +1275,8 @@ class bn {
|
|
|
1274
1275
|
this.wrapperElement && (this.wrapperElement.remove(), this.wrapperElement = null);
|
|
1275
1276
|
}
|
|
1276
1277
|
}
|
|
1277
|
-
const
|
|
1278
|
-
function
|
|
1278
|
+
const Ln = /* @__PURE__ */ new Set(["ArrowUp", "ArrowDown", "ArrowLeft", "ArrowRight"]);
|
|
1279
|
+
function Mn(e5) {
|
|
1279
1280
|
let t3 = 0;
|
|
1280
1281
|
const n3 = (n4) => {
|
|
1281
1282
|
n4.stopPropagation();
|
|
@@ -1301,7 +1302,7 @@ function Sn(e5) {
|
|
|
1301
1302
|
};
|
|
1302
1303
|
return e5.container.addEventListener("keydown", n3), () => e5.container.removeEventListener("keydown", n3);
|
|
1303
1304
|
}
|
|
1304
|
-
function
|
|
1305
|
+
function In(e5) {
|
|
1305
1306
|
let t3 = 0;
|
|
1306
1307
|
const n3 = (n4) => {
|
|
1307
1308
|
const s3 = Array.from(e5.container.querySelectorAll(e5.itemSelector));
|
|
@@ -1322,7 +1323,7 @@ function En(e5) {
|
|
|
1322
1323
|
};
|
|
1323
1324
|
return e5.container.addEventListener("keydown", n3), () => e5.container.removeEventListener("keydown", n3);
|
|
1324
1325
|
}
|
|
1325
|
-
function
|
|
1326
|
+
function Nn(e5) {
|
|
1326
1327
|
let t3 = 0;
|
|
1327
1328
|
const n3 = e5.columns, s3 = e5.totalCells, r4 = Math.ceil(s3 / n3), i9 = (i10) => {
|
|
1328
1329
|
const o2 = Array.from(e5.container.querySelectorAll(e5.cellSelector));
|
|
@@ -1333,7 +1334,7 @@ function xn(e5) {
|
|
|
1333
1334
|
const n4 = o2[t3];
|
|
1334
1335
|
return void (n4 && e5.onSelect(n4));
|
|
1335
1336
|
}
|
|
1336
|
-
if (
|
|
1337
|
+
if (Ln.has(i10.key)) {
|
|
1337
1338
|
i10.preventDefault();
|
|
1338
1339
|
const a22 = Math.floor(t3 / n3) + 1, c11 = t3 % n3 + 1, [l3, h4] = ot(a22, c11, r4, n3, i10.key);
|
|
1339
1340
|
let d5 = (l3 - 1) * n3 + (h4 - 1);
|
|
@@ -1348,7 +1349,7 @@ function xn(e5) {
|
|
|
1348
1349
|
};
|
|
1349
1350
|
return e5.container.addEventListener("keydown", i9), () => e5.container.removeEventListener("keydown", i9);
|
|
1350
1351
|
}
|
|
1351
|
-
class
|
|
1352
|
+
class Bn {
|
|
1352
1353
|
listeners = /* @__PURE__ */ new Map();
|
|
1353
1354
|
emit(e5, t3) {
|
|
1354
1355
|
const n3 = this.listeners.get(e5.id);
|
|
@@ -1374,21 +1375,21 @@ class Cn {
|
|
|
1374
1375
|
this.listeners.clear();
|
|
1375
1376
|
}
|
|
1376
1377
|
}
|
|
1377
|
-
class
|
|
1378
|
+
class On {
|
|
1378
1379
|
plugins = /* @__PURE__ */ new Map();
|
|
1379
1380
|
commands = /* @__PURE__ */ new Map();
|
|
1380
1381
|
services = /* @__PURE__ */ new Map();
|
|
1381
1382
|
middlewares = [];
|
|
1382
1383
|
registrations = /* @__PURE__ */ new Map();
|
|
1383
|
-
eventBus = new
|
|
1384
|
+
eventBus = new Bn();
|
|
1384
1385
|
pluginStyleSheets = [];
|
|
1385
|
-
schemaRegistry = new
|
|
1386
|
-
keymapRegistry = new
|
|
1387
|
-
inputRuleRegistry = new
|
|
1388
|
-
fileHandlerRegistry = new
|
|
1389
|
-
nodeViewRegistry = new
|
|
1390
|
-
toolbarRegistry = new
|
|
1391
|
-
blockTypePickerRegistry = new
|
|
1386
|
+
schemaRegistry = new zt();
|
|
1387
|
+
keymapRegistry = new vn();
|
|
1388
|
+
inputRuleRegistry = new bn();
|
|
1389
|
+
fileHandlerRegistry = new Sn();
|
|
1390
|
+
nodeViewRegistry = new En();
|
|
1391
|
+
toolbarRegistry = new xn();
|
|
1392
|
+
blockTypePickerRegistry = new Cn();
|
|
1392
1393
|
middlewareSorted = null;
|
|
1393
1394
|
initOrder = [];
|
|
1394
1395
|
initialized = false;
|
|
@@ -1670,32 +1671,32 @@ class Tn {
|
|
|
1670
1671
|
return r4;
|
|
1671
1672
|
}
|
|
1672
1673
|
}
|
|
1673
|
-
const
|
|
1674
|
-
function
|
|
1674
|
+
const Pn = { label: "Print", tooltip: (e5) => `Print (${e5})`, printingAnnouncement: "Printing" }, _n = { en: Pn, de: { label: "Drucken", tooltip: (e5) => `Drucken (${e5})`, printingAnnouncement: "Druckvorgang" }, es: { label: "Imprimir", tooltip: (e5) => `Imprimir (${e5})`, printingAnnouncement: "Imprimiendo" }, fr: { label: "Imprimer", tooltip: (e5) => `Imprimer (${e5})`, printingAnnouncement: "Impression" }, zh: { label: "打印", tooltip: (e5) => `打印 (${e5})`, printingAnnouncement: "正在打印" }, ru: { label: "Печать", tooltip: (e5) => `Печать (${e5})`, printingAnnouncement: "Печать" }, ar: { label: "طباعة", tooltip: (e5) => `طباعة (${e5})`, printingAnnouncement: "جارٍ الطباعة" }, hi: { label: "प्रिंट", tooltip: (e5) => `प्रिंट (${e5})`, printingAnnouncement: "प्रिंट हो रहा है" } };
|
|
1675
|
+
function Dn(e5) {
|
|
1675
1676
|
return "function" == typeof e5 ? e5() : e5;
|
|
1676
1677
|
}
|
|
1677
|
-
const
|
|
1678
|
-
function
|
|
1679
|
-
return Math.round(e5 *
|
|
1678
|
+
const Hn = 96 / 25.4, zn = { DINA4: "din-a4", DINA5: "din-a5", USLetter: "us-letter", USLegal: "us-legal" };
|
|
1679
|
+
function jn(e5) {
|
|
1680
|
+
return Math.round(e5 * Hn);
|
|
1680
1681
|
}
|
|
1681
|
-
const
|
|
1682
|
-
function
|
|
1683
|
-
const t3 =
|
|
1682
|
+
const $n = /* @__PURE__ */ new Map([[zn.DINA4, { widthMm: 210, heightMm: 297, widthPx: jn(210), heightPx: jn(297) }], [zn.DINA5, { widthMm: 148, heightMm: 210, widthPx: jn(148), heightPx: jn(210) }], [zn.USLetter, { widthMm: 215.9, heightMm: 279.4, widthPx: jn(215.9), heightPx: jn(279.4) }], [zn.USLegal, { widthMm: 215.9, heightMm: 355.6, widthPx: jn(215.9), heightPx: jn(355.6) }]]), Kn = /* @__PURE__ */ new Map([[zn.DINA4, "A4"], [zn.DINA5, "A5"], [zn.USLetter, "letter"], [zn.USLegal, "legal"]]);
|
|
1683
|
+
function Fn(e5) {
|
|
1684
|
+
const t3 = $n.get(e5);
|
|
1684
1685
|
if (!t3) throw new Error(`Unknown paper size: ${e5}`);
|
|
1685
1686
|
return t3;
|
|
1686
1687
|
}
|
|
1687
|
-
const
|
|
1688
|
-
function
|
|
1689
|
-
return Object.values(
|
|
1688
|
+
const Un = 48, Wn = 56, Vn = 24;
|
|
1689
|
+
function Gn(e5) {
|
|
1690
|
+
return Object.values(zn).includes(e5);
|
|
1690
1691
|
}
|
|
1691
|
-
function
|
|
1692
|
-
const t3 =
|
|
1692
|
+
function qn(e5) {
|
|
1693
|
+
const t3 = Kn.get(e5);
|
|
1693
1694
|
if (!t3) throw new Error(`Unknown paper size: ${e5}`);
|
|
1694
1695
|
return t3;
|
|
1695
1696
|
}
|
|
1696
|
-
const
|
|
1697
|
+
const Jn = new tt("print"), Qn = new et("print:before"), Xn = new et("print:after"), Yn = { print() {
|
|
1697
1698
|
}, toHTML: () => "" };
|
|
1698
|
-
class
|
|
1699
|
+
class Zn {
|
|
1699
1700
|
id = "print";
|
|
1700
1701
|
name = "Print";
|
|
1701
1702
|
config;
|
|
@@ -1705,7 +1706,7 @@ class Wn {
|
|
|
1705
1706
|
this.config = e5 ?? {};
|
|
1706
1707
|
}
|
|
1707
1708
|
init(e5) {
|
|
1708
|
-
this.locale = nt(
|
|
1709
|
+
this.locale = nt(_n, e5, this.config.locale);
|
|
1709
1710
|
const t3 = e5.getContainer(), n3 = t3.getRootNode();
|
|
1710
1711
|
if (n3 instanceof ShadowRoot) {
|
|
1711
1712
|
const s4 = n3.host, r5 = e5.getEventBus();
|
|
@@ -1715,7 +1716,7 @@ class Wn {
|
|
|
1715
1716
|
}
|
|
1716
1717
|
function i10(r7) {
|
|
1717
1718
|
const i11 = { options: r7, cancelled: false };
|
|
1718
|
-
if (s5.emit(
|
|
1719
|
+
if (s5.emit(Qn, i11), i11.cancelled) return null;
|
|
1719
1720
|
const o3 = i11.options, a22 = (function(e7, t5, n5, s6 = "en") {
|
|
1720
1721
|
return ["<!DOCTYPE html>", `<html lang="${s6}">`, "<head>", '<meta charset="utf-8">', `<title>${n5.replace(/&/g, "&").replace(/</g, "<").replace(/>/g, ">")}</title>`, `<style>${e7}</style>`, "</head>", `<body>${t5}</body>`, "</html>"].join("\n");
|
|
1721
1722
|
})((function(e7, t5, n5) {
|
|
@@ -1751,7 +1752,7 @@ ${s7.join("\n")}
|
|
|
1751
1752
|
const o4 = (function(e8) {
|
|
1752
1753
|
const t6 = [], n6 = [];
|
|
1753
1754
|
if (e8.margin ? n6.push(` margin: ${e8.margin};`) : e8.paperSize && n6.push(" margin: 0;"), e8.paperSize || e8.orientation) {
|
|
1754
|
-
const t7 = [e8.paperSize ?
|
|
1755
|
+
const t7 = [e8.paperSize ? qn(e8.paperSize) : "A4"];
|
|
1755
1756
|
e8.orientation && t7.push(e8.orientation), n6.push(` size: ${t7.join(" ")};`);
|
|
1756
1757
|
}
|
|
1757
1758
|
n6.length > 0 && t6.push(`@page {
|
|
@@ -1782,20 +1783,20 @@ ${n6.join("\n")}
|
|
|
1782
1783
|
}
|
|
1783
1784
|
if (t6.pageBreakBefore) for (const n6 of t6.pageBreakBefore) {
|
|
1784
1785
|
const t7 = e8.querySelectorAll(`[data-block-type="${n6}"]`);
|
|
1785
|
-
for (const e9 of t7) e9
|
|
1786
|
+
for (const e9 of t7) Lt(e9, { breakBefore: "page", pageBreakBefore: "always" });
|
|
1786
1787
|
}
|
|
1787
1788
|
})(n5, t5), (function(e8, t6) {
|
|
1788
1789
|
if (t6.header) {
|
|
1789
1790
|
const n6 = document.createElement("div");
|
|
1790
|
-
n6.className = "notectl-print-header", n6.innerHTML =
|
|
1791
|
+
n6.className = "notectl-print-header", n6.innerHTML = Dn(t6.header), e8.insertBefore(n6, e8.firstChild);
|
|
1791
1792
|
}
|
|
1792
1793
|
if (t6.footer) {
|
|
1793
1794
|
const n6 = document.createElement("div");
|
|
1794
|
-
n6.className = "notectl-print-footer", n6.innerHTML =
|
|
1795
|
+
n6.className = "notectl-print-footer", n6.innerHTML = Dn(t6.footer), e8.appendChild(n6);
|
|
1795
1796
|
}
|
|
1796
1797
|
})(n5, t5), n5;
|
|
1797
1798
|
})(n4, o3).outerHTML, o3.title ?? "", t4.closest("[lang]")?.getAttribute("lang") ?? (document.documentElement.lang || "en")), c11 = { html: a22 };
|
|
1798
|
-
return s5.emit(
|
|
1799
|
+
return s5.emit(Xn, c11), a22;
|
|
1799
1800
|
}
|
|
1800
1801
|
return { print(e7) {
|
|
1801
1802
|
const t5 = i10(r6(e7));
|
|
@@ -1811,8 +1812,8 @@ ${n6.join("\n")}
|
|
|
1811
1812
|
n5.contentWindow ? (n5.contentWindow.addEventListener("afterprint", o3, { once: true }), n5.contentWindow.print()) : o3();
|
|
1812
1813
|
}, toHTML: (e7) => i10(r6(e7)) ?? "" };
|
|
1813
1814
|
})(n3, s4, t3, r5);
|
|
1814
|
-
} else this.service =
|
|
1815
|
-
e5.registerService(
|
|
1815
|
+
} else this.service = Yn;
|
|
1816
|
+
e5.registerService(Jn, this.service);
|
|
1816
1817
|
const s3 = this.config.defaults ?? {}, r4 = this.service, i9 = this.locale;
|
|
1817
1818
|
e5.registerCommand("print", () => (e5.announce(i9.printingAnnouncement), r4.print(s3), true));
|
|
1818
1819
|
const o2 = this.config.keyBinding ?? "Mod-P";
|
|
@@ -1825,23 +1826,23 @@ ${n6.join("\n")}
|
|
|
1825
1826
|
this.service = null;
|
|
1826
1827
|
}
|
|
1827
1828
|
}
|
|
1828
|
-
const
|
|
1829
|
-
function
|
|
1829
|
+
const es = { Light: "light", Dark: "dark", System: "system" }, ts = { name: "light", primitives: { background: "#ffffff", foreground: "#1a1a1a", mutedForeground: "#666666", border: "#d0d0d0", borderFocus: "#4a90d9", primary: "#4a90d9", primaryForeground: "#1a5fa0", primaryMuted: "#d0e0f0", surfaceRaised: "#f8f8f8", surfaceOverlay: "#ffffff", hoverBackground: "#e8e8e8", activeBackground: "#d0e0f0", danger: "#dc2626", dangerMuted: "#fee2e2", success: "#1a8c1a", shadow: "rgba(0, 0, 0, 0.15)", focusRing: "rgba(74, 144, 217, 0.2)" }, codeBlock: { background: "#f8fafc", foreground: "#334155", headerBackground: "#f1f5f9", headerForeground: "#64748b", headerBorder: "#e2e8f0" }, tooltip: { background: "#1a1a1a", foreground: "#ffffff" } }, ns = { name: "dark", primitives: { background: "#1e1e2e", foreground: "#cdd6f4", mutedForeground: "#7f849c", border: "#45475a", borderFocus: "#89b4fa", primary: "#89b4fa", primaryForeground: "#89b4fa", primaryMuted: "rgba(137, 180, 250, 0.15)", surfaceRaised: "#313244", surfaceOverlay: "#313244", hoverBackground: "#45475a", activeBackground: "rgba(137, 180, 250, 0.15)", danger: "#f38ba8", dangerMuted: "rgba(243, 139, 168, 0.15)", success: "#a6e3a1", shadow: "rgba(0, 0, 0, 0.4)", focusRing: "rgba(137, 180, 250, 0.25)" }, codeBlock: { background: "#11111b", foreground: "#cdd6f4", headerBackground: "#181825", headerForeground: "#7f849c", headerBorder: "rgba(205, 214, 244, 0.08)" }, tooltip: { background: "#585b70", foreground: "#cdd6f4" } };
|
|
1830
|
+
function ss(e5, t3) {
|
|
1830
1831
|
return { name: t3.name, primitives: { ...e5.primitives, ...t3.primitives }, toolbar: t3.toolbar ? { ...e5.toolbar, ...t3.toolbar } : e5.toolbar, codeBlock: t3.codeBlock ? { ...e5.codeBlock, ...t3.codeBlock } : e5.codeBlock, tooltip: t3.tooltip ? { ...e5.tooltip, ...t3.tooltip } : e5.tooltip };
|
|
1831
1832
|
}
|
|
1832
|
-
function
|
|
1833
|
+
function rs(e5) {
|
|
1833
1834
|
if ("object" == typeof e5) return e5;
|
|
1834
1835
|
switch (e5) {
|
|
1835
|
-
case
|
|
1836
|
-
return
|
|
1837
|
-
case
|
|
1838
|
-
return
|
|
1836
|
+
case es.Light:
|
|
1837
|
+
return ts;
|
|
1838
|
+
case es.Dark:
|
|
1839
|
+
return ns;
|
|
1839
1840
|
default:
|
|
1840
|
-
return
|
|
1841
|
+
return ts;
|
|
1841
1842
|
}
|
|
1842
1843
|
}
|
|
1843
|
-
const
|
|
1844
|
-
function
|
|
1844
|
+
const is = [["primitives.background", "--notectl-bg"], ["primitives.foreground", "--notectl-fg"], ["primitives.mutedForeground", "--notectl-fg-muted"], ["primitives.border", "--notectl-border"], ["primitives.borderFocus", "--notectl-border-focus"], ["primitives.primary", "--notectl-primary"], ["primitives.primaryForeground", "--notectl-primary-fg"], ["primitives.primaryMuted", "--notectl-primary-muted"], ["primitives.surfaceRaised", "--notectl-surface-raised"], ["primitives.surfaceOverlay", "--notectl-surface-overlay"], ["primitives.hoverBackground", "--notectl-hover-bg"], ["primitives.activeBackground", "--notectl-active-bg"], ["primitives.danger", "--notectl-danger"], ["primitives.dangerMuted", "--notectl-danger-muted"], ["primitives.success", "--notectl-success"], ["primitives.shadow", "--notectl-shadow"], ["primitives.focusRing", "--notectl-focus-ring"], ["toolbar.background", "--notectl-toolbar-bg"], ["toolbar.borderColor", "--notectl-toolbar-border"], ["codeBlock.background", "--notectl-code-block-bg"], ["codeBlock.foreground", "--notectl-code-block-color"], ["codeBlock.headerBackground", "--notectl-code-block-header-bg"], ["codeBlock.headerForeground", "--notectl-code-block-header-color"], ["codeBlock.headerBorder", "--notectl-code-block-header-border"], ["tooltip.background", "--notectl-tooltip-bg"], ["tooltip.foreground", "--notectl-tooltip-fg"]], os = /* @__PURE__ */ new Map([["--notectl-toolbar-bg", "var(--notectl-surface-raised)"], ["--notectl-toolbar-border", "var(--notectl-border)"], ["--notectl-code-block-bg", "var(--notectl-surface-raised)"], ["--notectl-code-block-color", "var(--notectl-fg)"], ["--notectl-code-block-header-bg", "var(--notectl-surface-raised)"], ["--notectl-code-block-header-color", "var(--notectl-fg-muted)"], ["--notectl-code-block-header-border", "var(--notectl-border)"], ["--notectl-tooltip-bg", "var(--notectl-fg)"], ["--notectl-tooltip-fg", "var(--notectl-bg)"]]);
|
|
1845
|
+
function as(e5, t3) {
|
|
1845
1846
|
const n3 = t3.split(".");
|
|
1846
1847
|
let s3 = e5;
|
|
1847
1848
|
for (const e6 of n3) {
|
|
@@ -1851,46 +1852,46 @@ function Zn(e5, t3) {
|
|
|
1851
1852
|
}
|
|
1852
1853
|
return "string" == typeof s3 ? s3 : void 0;
|
|
1853
1854
|
}
|
|
1854
|
-
function
|
|
1855
|
+
function cs(e5) {
|
|
1855
1856
|
const t3 = [":host {"];
|
|
1856
|
-
for (const [n3, s3] of
|
|
1857
|
-
const r4 =
|
|
1857
|
+
for (const [n3, s3] of is) {
|
|
1858
|
+
const r4 = as(e5, n3);
|
|
1858
1859
|
if (void 0 !== r4) t3.push(` ${s3}: ${r4};`);
|
|
1859
1860
|
else {
|
|
1860
|
-
const e6 =
|
|
1861
|
+
const e6 = os.get(s3);
|
|
1861
1862
|
e6 && t3.push(` ${s3}: ${e6};`);
|
|
1862
1863
|
}
|
|
1863
1864
|
}
|
|
1864
1865
|
return t3.push("}"), t3.join("\n");
|
|
1865
1866
|
}
|
|
1866
|
-
function
|
|
1867
|
+
function ls(e5) {
|
|
1867
1868
|
const t3 = new CSSStyleSheet();
|
|
1868
|
-
return t3.replaceSync(
|
|
1869
|
+
return t3.replaceSync(cs(e5)), t3;
|
|
1869
1870
|
}
|
|
1870
|
-
const
|
|
1871
|
-
function
|
|
1872
|
-
const n3 =
|
|
1873
|
-
return
|
|
1871
|
+
const hs = { EN: "en", DE: "de", ES: "es", FR: "fr", ZH: "zh", RU: "ru", AR: "ar", HI: "hi", BROWSER: "browser" }, ds = /* @__PURE__ */ new Set(["left", "center", "right", "justify"]);
|
|
1872
|
+
function us(e5, t3) {
|
|
1873
|
+
const n3 = ps(e5.children, t3), s3 = t3 ? t3.getAllowedTags() : ["p", "br", "div", "span"], r4 = t3 ? t3.getAllowedAttrs() : ["style"];
|
|
1874
|
+
return Dt.sanitize(n3, { ALLOWED_TAGS: s3, ALLOWED_ATTR: r4 });
|
|
1874
1875
|
}
|
|
1875
|
-
function
|
|
1876
|
+
function ps(e5, t3) {
|
|
1876
1877
|
const n3 = [];
|
|
1877
1878
|
let s3 = 0;
|
|
1878
1879
|
for (; s3 < e5.length; ) {
|
|
1879
1880
|
const r4 = e5[s3];
|
|
1880
|
-
if (r4) if (
|
|
1881
|
+
if (r4) if (Se(r4, "list_item")) {
|
|
1881
1882
|
const r5 = [];
|
|
1882
1883
|
for (; s3 < e5.length; ) {
|
|
1883
1884
|
const t4 = e5[s3];
|
|
1884
|
-
if (!t4 || !
|
|
1885
|
+
if (!t4 || !Se(t4, "list_item")) break;
|
|
1885
1886
|
r5.push(t4), s3++;
|
|
1886
1887
|
}
|
|
1887
|
-
n3.push(
|
|
1888
|
-
} else n3.push(
|
|
1888
|
+
n3.push(fs(r5, t3));
|
|
1889
|
+
} else n3.push(ms(r4, t3)), s3++;
|
|
1889
1890
|
else s3++;
|
|
1890
1891
|
}
|
|
1891
1892
|
return n3.join("");
|
|
1892
1893
|
}
|
|
1893
|
-
function
|
|
1894
|
+
function fs(e5, t3) {
|
|
1894
1895
|
const n3 = [], s3 = [];
|
|
1895
1896
|
for (let r4 = 0; r4 < e5.length; r4++) {
|
|
1896
1897
|
const i9 = e5[r4];
|
|
@@ -1910,8 +1911,8 @@ function os(e5, t3) {
|
|
|
1910
1911
|
const e6 = s3[s3.length - 1];
|
|
1911
1912
|
e6 && a22 > e6.indent && (n3.push(`<${c11}>`), s3.push({ tag: c11, indent: a22 }));
|
|
1912
1913
|
}
|
|
1913
|
-
const l3 =
|
|
1914
|
-
void 0 !== d5 && d5 > a22 ? n3.push(
|
|
1914
|
+
const l3 = ms(i9, t3), h4 = e5[r4 + 1], d5 = h4 ? h4.attrs?.indent ?? 0 : void 0;
|
|
1915
|
+
void 0 !== d5 && d5 > a22 ? n3.push(gs(l3)) : n3.push(l3);
|
|
1915
1916
|
}
|
|
1916
1917
|
for (; s3.length > 0; ) {
|
|
1917
1918
|
const e6 = s3.pop();
|
|
@@ -1920,10 +1921,10 @@ function os(e5, t3) {
|
|
|
1920
1921
|
}
|
|
1921
1922
|
return n3.join("");
|
|
1922
1923
|
}
|
|
1923
|
-
function
|
|
1924
|
+
function gs(e5) {
|
|
1924
1925
|
return e5.endsWith("</li>") ? e5.slice(0, -5) : e5;
|
|
1925
1926
|
}
|
|
1926
|
-
function
|
|
1927
|
+
function ms(e5, t3) {
|
|
1927
1928
|
const n3 = V(e5) ? (function(e6, t4) {
|
|
1928
1929
|
const n4 = (function(e7) {
|
|
1929
1930
|
if (e7.length <= 1) return e7;
|
|
@@ -1937,57 +1938,57 @@ function cs(e5, t3) {
|
|
|
1937
1938
|
e8 && R(e8) && Q(e8.marks, n5.marks) ? t5[t5.length - 1] = { type: "text", text: e8.text + n5.text, marks: e8.marks } : t5.push(n5);
|
|
1938
1939
|
}
|
|
1939
1940
|
return t5;
|
|
1940
|
-
})(I(e6)), s4 = [], r5 = t4 ?
|
|
1941
|
+
})(I(e6)), s4 = [], r5 = t4 ? fn(t4) : void 0;
|
|
1941
1942
|
for (const e7 of n4) if (C(e7)) {
|
|
1942
1943
|
const n5 = t4?.getInlineNodeSpec(e7.inlineType);
|
|
1943
1944
|
n5?.toHTMLString && s4.push(n5.toHTMLString(e7));
|
|
1944
|
-
} else t4 ? s4.push(
|
|
1945
|
+
} else t4 ? s4.push(gn(e7.text, e7.marks, t4, r5)) : "" !== e7.text && s4.push(Ee(e7.text));
|
|
1945
1946
|
return s4.join("");
|
|
1946
|
-
})(e5, t3) :
|
|
1947
|
+
})(e5, t3) : ps(J(e5), t3), s3 = t3?.getNodeSpec(e5.type);
|
|
1947
1948
|
let r4;
|
|
1948
1949
|
r4 = s3?.toHTML ? s3.toHTML(e5, n3) : `<p>${n3 || "<br>"}</p>`;
|
|
1949
1950
|
const i9 = e5.attrs?.align, o2 = /style="[^"]*text-align:/.test(r4);
|
|
1950
|
-
return i9 && "left" !== i9 &&
|
|
1951
|
+
return i9 && "left" !== i9 && ds.has(i9) && !o2 && (r4 = r4.replace(/>/, ` style="text-align: ${i9}">`)), r4;
|
|
1951
1952
|
}
|
|
1952
|
-
function
|
|
1953
|
+
function ys(e5, t3) {
|
|
1953
1954
|
const n3 = t3 ? t3.getAllowedTags() : ["p", "br", "div", "span"], s3 = t3 ? t3.getAllowedAttrs() : ["style"], r4 = document.createElement("template");
|
|
1954
|
-
r4.innerHTML =
|
|
1955
|
+
r4.innerHTML = Dt.sanitize(e5, { ALLOWED_TAGS: n3, ALLOWED_ATTR: s3 });
|
|
1955
1956
|
const i9 = r4.content, o2 = t3?.getBlockParseRules() ?? [], a22 = [];
|
|
1956
1957
|
for (const e6 of Array.from(i9.childNodes)) if (e6.nodeType === Node.ELEMENT_NODE) {
|
|
1957
1958
|
const n4 = e6, s4 = n4.tagName.toLowerCase();
|
|
1958
1959
|
if ("ul" === s4 || "ol" === s4) {
|
|
1959
|
-
|
|
1960
|
+
ks(n4, "ol" === s4 ? "ordered" : "bullet", 0, a22, t3);
|
|
1960
1961
|
continue;
|
|
1961
1962
|
}
|
|
1962
|
-
const r5 =
|
|
1963
|
+
const r5 = ws(n4, o2);
|
|
1963
1964
|
if (r5) {
|
|
1964
|
-
const e7 =
|
|
1965
|
-
|
|
1965
|
+
const e7 = vs(n4, t3), s5 = { ...r5.attrs };
|
|
1966
|
+
Ss(n4, s5), a22.push(_(ke(r5.type), e7, void 0, Object.keys(s5).length > 0 ? s5 : void 0));
|
|
1966
1967
|
continue;
|
|
1967
1968
|
}
|
|
1968
|
-
const i10 =
|
|
1969
|
-
|
|
1969
|
+
const i10 = vs(n4, t3), c11 = {};
|
|
1970
|
+
Ss(n4, c11), a22.push(_(ke("paragraph"), i10, void 0, Object.keys(c11).length > 0 ? c11 : void 0));
|
|
1970
1971
|
} else e6.nodeType === Node.TEXT_NODE && e6.textContent?.trim() && a22.push(_(ke("paragraph"), [T(e6.textContent.trim())]));
|
|
1971
1972
|
return 0 === a22.length ? W() : W(a22);
|
|
1972
1973
|
}
|
|
1973
|
-
function
|
|
1974
|
+
function ks(e5, t3, n3, s3, r4) {
|
|
1974
1975
|
for (const i9 of Array.from(e5.children)) {
|
|
1975
1976
|
const e6 = i9.tagName.toLowerCase();
|
|
1976
1977
|
if ("li" === e6) {
|
|
1977
|
-
const e7 = i9, o2 = e7.querySelector(':scope > input[type="checkbox"]'), a22 = null !== o2, c11 = o2?.hasAttribute("checked") ?? false, l3 = a22 ? "checklist" : t3, h4 =
|
|
1978
|
+
const e7 = i9, o2 = e7.querySelector(':scope > input[type="checkbox"]'), a22 = null !== o2, c11 = o2?.hasAttribute("checked") ?? false, l3 = a22 ? "checklist" : t3, h4 = vs(e7, r4, true), d5 = { listType: l3, indent: n3, checked: c11 };
|
|
1978
1979
|
s3.push(_(ke("list_item"), h4, void 0, d5));
|
|
1979
1980
|
for (const t4 of Array.from(e7.children)) {
|
|
1980
1981
|
const e8 = t4.tagName.toLowerCase();
|
|
1981
|
-
"ul" !== e8 && "ol" !== e8 ||
|
|
1982
|
+
"ul" !== e8 && "ol" !== e8 || ks(t4, "ol" === e8 ? "ordered" : "bullet", n3 + 1, s3, r4);
|
|
1982
1983
|
}
|
|
1983
|
-
} else "ul" !== e6 && "ol" !== e6 ||
|
|
1984
|
+
} else "ul" !== e6 && "ol" !== e6 || ks(i9, "ol" === e6 ? "ordered" : "bullet", n3 + 1, s3, r4);
|
|
1984
1985
|
}
|
|
1985
1986
|
}
|
|
1986
|
-
function
|
|
1987
|
+
function vs(e5, t3, n3) {
|
|
1987
1988
|
const s3 = [];
|
|
1988
|
-
return
|
|
1989
|
+
return bs(e5, [], s3, t3?.getMarkParseRules() ?? [], t3?.getInlineParseRules() ?? [], n3), s3.length > 0 ? s3 : [T("")];
|
|
1989
1990
|
}
|
|
1990
|
-
function
|
|
1991
|
+
function bs(e5, t3, n3, s3, r4, i9) {
|
|
1991
1992
|
if (e5.nodeType === Node.TEXT_NODE) {
|
|
1992
1993
|
const s4 = e5.textContent ?? "";
|
|
1993
1994
|
return void (s4 && n3.push(T(s4, [...t3])));
|
|
@@ -2010,13 +2011,13 @@ function us(e5, t3, n3, s3, r4, i9) {
|
|
|
2010
2011
|
if (false === t4) continue;
|
|
2011
2012
|
c11.some((t5) => t5.type === e6.type) || (c11.push({ type: be(e6.type), ...Object.keys(t4).length > 0 ? { attrs: t4 } : {} }), l3.add(e6.type));
|
|
2012
2013
|
} else c11.some((t4) => t4.type === e6.type) || (c11.push({ type: be(e6.type) }), l3.add(e6.type));
|
|
2013
|
-
for (const e6 of Array.from(o2.childNodes))
|
|
2014
|
+
for (const e6 of Array.from(o2.childNodes)) bs(e6, c11, n3, s3, r4, i9);
|
|
2014
2015
|
}
|
|
2015
|
-
function
|
|
2016
|
+
function Ss(e5, t3) {
|
|
2016
2017
|
const n3 = e5.style?.textAlign ?? "";
|
|
2017
|
-
n3 &&
|
|
2018
|
+
n3 && ds.has(n3) && (t3.align = n3);
|
|
2018
2019
|
}
|
|
2019
|
-
function
|
|
2020
|
+
function ws(e5, t3) {
|
|
2020
2021
|
const n3 = e5.tagName.toLowerCase();
|
|
2021
2022
|
for (const s3 of t3) if (s3.rule.tag === n3) {
|
|
2022
2023
|
if (s3.rule.getAttrs) {
|
|
@@ -2028,9 +2029,9 @@ function fs(e5, t3) {
|
|
|
2028
2029
|
}
|
|
2029
2030
|
return null;
|
|
2030
2031
|
}
|
|
2031
|
-
class
|
|
2032
|
+
class Es {
|
|
2032
2033
|
constructor(e5, t3) {
|
|
2033
|
-
this.element = e5, this.getState = t3.getState, this.dispatch = t3.dispatch, this.syncSelection = t3.syncSelection, this.inputRuleRegistry = t3.inputRuleRegistry, this.isReadOnly = t3.isReadOnly ?? (() => false), this.compositionTracker = t3.compositionTracker ?? new
|
|
2034
|
+
this.element = e5, this.getState = t3.getState, this.dispatch = t3.dispatch, this.syncSelection = t3.syncSelection, this.inputRuleRegistry = t3.inputRuleRegistry, this.isReadOnly = t3.isReadOnly ?? (() => false), this.compositionTracker = t3.compositionTracker ?? new kn(), this.handleBeforeInput = this.onBeforeInput.bind(this), this.handleCompositionStart = this.onCompositionStart.bind(this), this.handleCompositionEnd = this.onCompositionEnd.bind(this), e5.addEventListener("beforeinput", this.handleBeforeInput), e5.addEventListener("compositionstart", this.handleCompositionStart), e5.addEventListener("compositionend", this.handleCompositionEnd);
|
|
2034
2035
|
}
|
|
2035
2036
|
getState;
|
|
2036
2037
|
dispatch;
|
|
@@ -2059,29 +2060,29 @@ class gs {
|
|
|
2059
2060
|
break;
|
|
2060
2061
|
case "deleteContentBackward":
|
|
2061
2062
|
case "deleteByCut":
|
|
2062
|
-
n3 =
|
|
2063
|
+
n3 = hn(t3);
|
|
2063
2064
|
break;
|
|
2064
2065
|
case "deleteContentForward":
|
|
2065
|
-
n3 =
|
|
2066
|
+
n3 = dn(t3);
|
|
2066
2067
|
break;
|
|
2067
2068
|
case "deleteWordBackward":
|
|
2068
2069
|
n3 = (function(e6) {
|
|
2069
|
-
return
|
|
2070
|
+
return ln(e6, { merge: Ke, range: (e7, t4) => t4 > 0 ? [ee(e7, t4), t4] : null });
|
|
2070
2071
|
})(t3);
|
|
2071
2072
|
break;
|
|
2072
2073
|
case "deleteWordForward":
|
|
2073
2074
|
n3 = (function(e6) {
|
|
2074
|
-
return
|
|
2075
|
+
return ln(e6, { merge: $e, range: (e7, t4) => t4 < O(e7) ? [t4, Z(e7, t4)] : null });
|
|
2075
2076
|
})(t3);
|
|
2076
2077
|
break;
|
|
2077
2078
|
case "deleteSoftLineBackward":
|
|
2078
2079
|
n3 = (function(e6) {
|
|
2079
|
-
return
|
|
2080
|
+
return ln(e6, { merge: Ke, range: (e7, t4) => t4 > 0 ? [0, t4] : null });
|
|
2080
2081
|
})(t3);
|
|
2081
2082
|
break;
|
|
2082
2083
|
case "deleteSoftLineForward":
|
|
2083
2084
|
n3 = (function(e6) {
|
|
2084
|
-
return
|
|
2085
|
+
return ln(e6, { merge: $e, range: (e7, t4) => {
|
|
2085
2086
|
const n4 = O(e7);
|
|
2086
2087
|
return t4 < n4 ? [t4, n4] : null;
|
|
2087
2088
|
} });
|
|
@@ -2121,13 +2122,13 @@ class gs {
|
|
|
2121
2122
|
this.element.removeEventListener("beforeinput", this.handleBeforeInput), this.element.removeEventListener("compositionstart", this.handleCompositionStart), this.element.removeEventListener("compositionend", this.handleCompositionEnd);
|
|
2122
2123
|
}
|
|
2123
2124
|
}
|
|
2124
|
-
function
|
|
2125
|
+
function xs(e5) {
|
|
2125
2126
|
return e5.reduce((e6, t3) => e6 + t3.text, "");
|
|
2126
2127
|
}
|
|
2127
|
-
function
|
|
2128
|
+
function Cs(e5) {
|
|
2128
2129
|
return e5.reduce((e6, t3) => e6 + t3.text.length, 0);
|
|
2129
2130
|
}
|
|
2130
|
-
function
|
|
2131
|
+
function Ts(e5, t3) {
|
|
2131
2132
|
const n3 = Ae(e5.doc, t3.blockId);
|
|
2132
2133
|
if (!n3) return null;
|
|
2133
2134
|
const s3 = n3.length > 1 ? n3.slice(0, -1) : [], r4 = (0 === s3.length ? e5.doc.children : (() => {
|
|
@@ -2138,19 +2139,19 @@ function ks(e5, t3) {
|
|
|
2138
2139
|
const i9 = "before" === t3.side ? r4 : r4 + 1;
|
|
2139
2140
|
return { parentPath: s3, insertIndex: i9 };
|
|
2140
2141
|
}
|
|
2141
|
-
function
|
|
2142
|
-
const s3 =
|
|
2142
|
+
function As(e5, t3, n3) {
|
|
2143
|
+
const s3 = Ts(e5, t3);
|
|
2143
2144
|
if (!s3) return e5.transaction("paste").setSelection(t3).build();
|
|
2144
2145
|
const r4 = e5.transaction("paste");
|
|
2145
2146
|
let i9, o2 = s3.insertIndex, a22 = 0;
|
|
2146
2147
|
for (const e6 of n3) {
|
|
2147
|
-
const t4 = Y(), n4 =
|
|
2148
|
+
const t4 = Y(), n4 = xs(e6.segments), c11 = e6.segments.map((e7) => T(e7.text, [...e7.marks])), l3 = _(e6.type, c11.length > 0 ? c11 : [T("")], t4, e6.attrs);
|
|
2148
2149
|
r4.insertNode(s3.parentPath, o2, l3), o2++, i9 = t4, a22 = n4.length;
|
|
2149
2150
|
}
|
|
2150
2151
|
return i9 && r4.setSelection(re(i9, a22)), r4.build();
|
|
2151
2152
|
}
|
|
2152
|
-
const
|
|
2153
|
-
class
|
|
2153
|
+
const Rs = /* @__PURE__ */ new Set(["P", "DIV", "H1", "H2", "H3", "H4", "H5", "H6", "BLOCKQUOTE", "UL", "OL", "LI", "HR", "PRE", "TABLE", "THEAD", "TBODY", "TR"]), Ls = /* @__PURE__ */ new Set(["STRONG", "B", "EM", "I", "U", "S", "STRIKE", "DEL", "A", "SPAN", "BR", "SUB", "SUP", "CODE"]);
|
|
2154
|
+
class Ms {
|
|
2154
2155
|
schema;
|
|
2155
2156
|
blockParseRules;
|
|
2156
2157
|
markParseRules;
|
|
@@ -2247,7 +2248,7 @@ class Ss {
|
|
|
2247
2248
|
if (e5.nodeType !== Node.ELEMENT_NODE) return [];
|
|
2248
2249
|
const n3 = e5, s3 = n3.tagName;
|
|
2249
2250
|
if ("BR" === s3) return [{ text: "\n", marks: this.resolveMarks(t3) }];
|
|
2250
|
-
if (this.isBlockElement(n3) && !
|
|
2251
|
+
if (this.isBlockElement(n3) && !Ls.has(s3)) return this.parseInlineChildren(n3, t3);
|
|
2251
2252
|
const r4 = this.mergeMarks(t3, this.marksFromElement(n3));
|
|
2252
2253
|
return this.parseInlineChildren(n3, r4);
|
|
2253
2254
|
}
|
|
@@ -2321,7 +2322,7 @@ class Ss {
|
|
|
2321
2322
|
return null;
|
|
2322
2323
|
}
|
|
2323
2324
|
isBlockElement(e5) {
|
|
2324
|
-
if (
|
|
2325
|
+
if (Rs.has(e5.tagName)) return true;
|
|
2325
2326
|
const t3 = e5.tagName.toLowerCase();
|
|
2326
2327
|
return this.blockParseRules.some((e6) => e6.rule.tag === t3);
|
|
2327
2328
|
}
|
|
@@ -2366,21 +2367,21 @@ class Ss {
|
|
|
2366
2367
|
0 !== n3.length && (n3.every((e6) => "" === e6.text.trim()) || e5.push({ type: this.resolveBlockType(ke("paragraph")), segments: n3 }));
|
|
2367
2368
|
}
|
|
2368
2369
|
}
|
|
2369
|
-
const
|
|
2370
|
-
function
|
|
2370
|
+
const Is = { 1: "x-small", 2: "small", 3: "medium", 4: "large", 5: "x-large", 6: "xx-large", 7: "xxx-large" };
|
|
2371
|
+
function Ns(e5) {
|
|
2371
2372
|
return e5.toLowerCase().includes("font-size");
|
|
2372
2373
|
}
|
|
2373
|
-
function
|
|
2374
|
+
function Bs(e5, t3) {
|
|
2374
2375
|
for (; e5.firstChild; ) t3.appendChild(e5.firstChild);
|
|
2375
2376
|
}
|
|
2376
|
-
function
|
|
2377
|
+
function Os(e5) {
|
|
2377
2378
|
const t3 = e5.parentNode;
|
|
2378
2379
|
if (t3) {
|
|
2379
2380
|
for (; e5.firstChild; ) t3.insertBefore(e5.firstChild, e5);
|
|
2380
2381
|
t3.removeChild(e5);
|
|
2381
2382
|
}
|
|
2382
2383
|
}
|
|
2383
|
-
function
|
|
2384
|
+
function Ps(e5, t3) {
|
|
2384
2385
|
if (!t3) return;
|
|
2385
2386
|
const n3 = {};
|
|
2386
2387
|
let s3 = false;
|
|
@@ -2390,7 +2391,7 @@ function As(e5, t3) {
|
|
|
2390
2391
|
}
|
|
2391
2392
|
return s3 ? n3 : void 0;
|
|
2392
2393
|
}
|
|
2393
|
-
class
|
|
2394
|
+
class _s {
|
|
2394
2395
|
constructor(e5, t3) {
|
|
2395
2396
|
this.element = e5, this.getState = t3.getState, this.dispatch = t3.dispatch, this.schemaRegistry = t3.schemaRegistry, this.fileHandlerRegistry = t3.fileHandlerRegistry, this.isReadOnly = t3.isReadOnly ?? (() => false), this.handlePaste = this.onPaste.bind(this), e5.addEventListener("paste", this.handlePaste);
|
|
2396
2397
|
}
|
|
@@ -2410,7 +2411,7 @@ class Rs {
|
|
|
2410
2411
|
const s3 = t3.getData("text/plain");
|
|
2411
2412
|
if (s3) {
|
|
2412
2413
|
const e6 = (function(e7) {
|
|
2413
|
-
if (
|
|
2414
|
+
if (mn && mn.plainText === e7) return mn.blocks;
|
|
2414
2415
|
})(s3);
|
|
2415
2416
|
if (e6 && this.handleRichPaste(e6)) return;
|
|
2416
2417
|
}
|
|
@@ -2424,20 +2425,20 @@ class Rs {
|
|
|
2424
2425
|
for (const e8 of t5) {
|
|
2425
2426
|
const t6 = e8.getAttribute("color"), n5 = e8.getAttribute("face"), s5 = e8.getAttribute("size"), r5 = e8.getAttribute("style") ?? "";
|
|
2426
2427
|
if (!(null !== t6 || null !== n5 || null !== s5 || r5.length > 0)) {
|
|
2427
|
-
|
|
2428
|
+
Os(e8);
|
|
2428
2429
|
continue;
|
|
2429
2430
|
}
|
|
2430
2431
|
const i10 = document.createElement("span"), o3 = [];
|
|
2431
|
-
if (r5 && o3.push(r5.endsWith(";") ? r5 : `${r5};`), t6 && o3.push(`color: ${t6};`), n5 && o3.push(`font-family: ${n5};`), s5 && !
|
|
2432
|
-
const e9 =
|
|
2432
|
+
if (r5 && o3.push(r5.endsWith(";") ? r5 : `${r5};`), t6 && o3.push(`color: ${t6};`), n5 && o3.push(`font-family: ${n5};`), s5 && !Ns(r5)) {
|
|
2433
|
+
const e9 = Is[s5];
|
|
2433
2434
|
e9 && o3.push(`font-size: ${e9};`);
|
|
2434
2435
|
}
|
|
2435
|
-
i10
|
|
2436
|
+
Mt(i10, o3.join(" ")), Bs(e8, i10), e8.parentNode?.replaceChild(i10, e8);
|
|
2436
2437
|
}
|
|
2437
2438
|
})(t4.content);
|
|
2438
|
-
const n4 = t4.innerHTML, s4 = this.schemaRegistry ? this.schemaRegistry.getAllowedTags() : ["strong", "em", "u", "b", "i", "p", "br", "div", "span"], o2 = this.schemaRegistry ? this.schemaRegistry.getAllowedAttrs() : [], a22 =
|
|
2439
|
+
const n4 = t4.innerHTML, s4 = this.schemaRegistry ? this.schemaRegistry.getAllowedTags() : ["strong", "em", "u", "b", "i", "p", "br", "div", "span"], o2 = this.schemaRegistry ? this.schemaRegistry.getAllowedAttrs() : [], a22 = Dt.sanitize(n4, { ALLOWED_TAGS: s4, ALLOWED_ATTR: o2 });
|
|
2439
2440
|
if (this.schemaRegistry) {
|
|
2440
|
-
const e7 = me(this.schemaRegistry), t5 = new
|
|
2441
|
+
const e7 = me(this.schemaRegistry), t5 = new Ms({ schema: e7, schemaRegistry: this.schemaRegistry }), n5 = document.createElement("template");
|
|
2441
2442
|
n5.innerHTML = a22;
|
|
2442
2443
|
const s5 = (function(e8, t6) {
|
|
2443
2444
|
if (0 === t6.blocks.length) return e8.transaction("paste").setSelection(e8.selection).build();
|
|
@@ -2446,33 +2447,33 @@ class Rs {
|
|
|
2446
2447
|
const n7 = e9.selection;
|
|
2447
2448
|
if (ie(n7)) return e9.transaction("paste").setSelection(n7).build();
|
|
2448
2449
|
if (oe(n7)) return (function(e10, t8, n8) {
|
|
2449
|
-
const s7 =
|
|
2450
|
+
const s7 = Ts(e10, t8);
|
|
2450
2451
|
if (!s7) return e10.transaction("paste").setSelection(t8).build();
|
|
2451
|
-
const r6 = Y(), i11 =
|
|
2452
|
+
const r6 = Y(), i11 = xs(n8), o4 = Cs(n8), a24 = e10.transaction("paste");
|
|
2452
2453
|
return a24.insertNode(s7.parentPath, s7.insertIndex, _(ke("paragraph"), [T("")], r6)), i11.length > 0 && a24.insertText(r6, 0, i11, [], n8), a24.setSelection(re(r6, o4)), a24.build();
|
|
2453
2454
|
})(e9, n7, t7);
|
|
2454
2455
|
const s6 = e9.transaction("paste");
|
|
2455
2456
|
le(n7) || Qe(e9, s6);
|
|
2456
|
-
const { blockId: r5, offset: i10 } = Xe(n7, e9.getBlockOrder()), o3 =
|
|
2457
|
+
const { blockId: r5, offset: i10 } = Xe(n7, e9.getBlockOrder()), o3 = Cs(t7), a23 = xs(t7);
|
|
2457
2458
|
return s6.insertText(r5, i10, a23, [], t7), s6.setSelection(re(r5, i10 + o3)), s6.build();
|
|
2458
2459
|
})(e8, n6.segments) : 1 === t6.blocks.length ? (function(e9, t7) {
|
|
2459
2460
|
const n7 = e9.selection;
|
|
2460
2461
|
if (ie(n7)) return e9.transaction("paste").setSelection(n7).build();
|
|
2461
|
-
if (oe(n7)) return
|
|
2462
|
+
if (oe(n7)) return As(e9, n7, [t7]);
|
|
2462
2463
|
const s6 = e9.transaction("paste");
|
|
2463
2464
|
le(n7) || Qe(e9, s6);
|
|
2464
|
-
const { blockId: r5, offset: i10 } = Xe(n7, e9.getBlockOrder()), o3 =
|
|
2465
|
+
const { blockId: r5, offset: i10 } = Xe(n7, e9.getBlockOrder()), o3 = Cs(t7.segments), a23 = xs(t7.segments);
|
|
2465
2466
|
return s6.setBlockType(r5, t7.type, t7.attrs), s6.insertText(r5, i10, a23, [], t7.segments), s6.setSelection(re(r5, i10 + o3)), s6.build();
|
|
2466
2467
|
})(e8, n6) : (function(e9, t7) {
|
|
2467
2468
|
const n7 = e9.selection;
|
|
2468
2469
|
if (ie(n7)) return e9.transaction("paste").setSelection(n7).build();
|
|
2469
|
-
if (oe(n7)) return
|
|
2470
|
+
if (oe(n7)) return As(e9, n7, t7.blocks);
|
|
2470
2471
|
const s6 = e9.transaction("paste");
|
|
2471
2472
|
le(n7) || Qe(e9, s6);
|
|
2472
2473
|
const r5 = e9.getBlockOrder(), { blockId: i10, offset: o3 } = Xe(n7, r5), a23 = r5.indexOf(i10), c11 = t7.blocks[0], l3 = t7.blocks[t7.blocks.length - 1];
|
|
2473
2474
|
if (!c11 || !l3) return s6.build();
|
|
2474
|
-
const h4 = t7.blocks.slice(1, -1), d5 =
|
|
2475
|
-
c11.segments.length > 0 && d5 > 0 && s6.insertText(i10, o3,
|
|
2475
|
+
const h4 = t7.blocks.slice(1, -1), d5 = Cs(c11.segments);
|
|
2476
|
+
c11.segments.length > 0 && d5 > 0 && s6.insertText(i10, o3, xs(c11.segments), [], c11.segments), c11.type !== ke("paragraph") && s6.setBlockType(i10, c11.type, c11.attrs);
|
|
2476
2477
|
const u2 = o3 + d5, p4 = Y();
|
|
2477
2478
|
s6.splitBlock(i10, u2, p4);
|
|
2478
2479
|
let f4 = a23 + 1;
|
|
@@ -2480,8 +2481,8 @@ class Rs {
|
|
|
2480
2481
|
const t8 = e10.segments.map((e11) => T(e11.text, [...e11.marks])), n8 = _(e10.type, t8.length > 0 ? t8 : void 0, Y(), e10.attrs);
|
|
2481
2482
|
s6.insertNode([], f4, n8), f4++;
|
|
2482
2483
|
}
|
|
2483
|
-
const g4 =
|
|
2484
|
-
return l3.segments.length > 0 && g4 > 0 && s6.insertText(p4, 0,
|
|
2484
|
+
const g4 = Cs(l3.segments);
|
|
2485
|
+
return l3.segments.length > 0 && g4 > 0 && s6.insertText(p4, 0, xs(l3.segments), [], l3.segments), l3.type !== ke("paragraph") && s6.setBlockType(p4, l3.type, l3.attrs), s6.setSelection(re(p4, g4)), s6.build();
|
|
2485
2486
|
})(e8, t6) : e8.transaction("paste").setSelection(e8.selection).build();
|
|
2486
2487
|
})(r4, t5.parse(n5.content));
|
|
2487
2488
|
this.dispatch(s5);
|
|
@@ -2510,7 +2511,7 @@ class Rs {
|
|
|
2510
2511
|
if (!n3) return;
|
|
2511
2512
|
const s3 = this.schemaRegistry?.getNodeSpec(n3);
|
|
2512
2513
|
if (this.schemaRegistry && !s3) return;
|
|
2513
|
-
const r4 = this.getState(), i9 = r4.selection, o2 = ie(i9) ? i9.nodeId : oe(i9) ? i9.blockId : i9.anchor.blockId, a22 = Y(), c11 =
|
|
2514
|
+
const r4 = this.getState(), i9 = r4.selection, o2 = ie(i9) ? i9.nodeId : oe(i9) ? i9.blockId : i9.anchor.blockId, a22 = Y(), c11 = Ps(t3.attrs, s3?.attrs), l3 = _(ke(n3), [], a22, c11), h4 = this.findTableCellAncestor(r4, o2);
|
|
2514
2515
|
if (h4) {
|
|
2515
2516
|
const e6 = Ae(r4.doc, h4);
|
|
2516
2517
|
if (!e6) return;
|
|
@@ -2582,7 +2583,7 @@ class Rs {
|
|
|
2582
2583
|
if (!this.schemaRegistry) return e5;
|
|
2583
2584
|
const t3 = this.schemaRegistry.getNodeSpec(e5.type);
|
|
2584
2585
|
if (!t3) return;
|
|
2585
|
-
const n3 =
|
|
2586
|
+
const n3 = Ps(e5.attrs, t3.attrs);
|
|
2586
2587
|
return { ...e5, attrs: n3 };
|
|
2587
2588
|
}
|
|
2588
2589
|
findTableCellAncestor(e5, t3) {
|
|
@@ -2632,7 +2633,7 @@ class Rs {
|
|
|
2632
2633
|
this.element.removeEventListener("paste", this.handlePaste);
|
|
2633
2634
|
}
|
|
2634
2635
|
}
|
|
2635
|
-
function
|
|
2636
|
+
function Ds(e5, t3, n3, s3) {
|
|
2636
2637
|
const r4 = t3?.doc.children ?? [], i9 = n3.doc.children, o2 = s3?.registry, a22 = s3?.nodeViews, c11 = null != s3?.compositionBlockId;
|
|
2637
2638
|
c11 || (function(e6) {
|
|
2638
2639
|
const t4 = Array.from(e6.querySelectorAll(":scope > [data-block-wrapper]"));
|
|
@@ -2655,7 +2656,7 @@ function Ls(e5, t3, n3, s3) {
|
|
|
2655
2656
|
}
|
|
2656
2657
|
const h4 = new Set(i9.map((e6) => e6.id));
|
|
2657
2658
|
for (const [e6, t4] of l3) if (!h4.has(e6)) {
|
|
2658
|
-
|
|
2659
|
+
qs(t4), l3.delete(e6);
|
|
2659
2660
|
const n4 = a22?.get(e6);
|
|
2660
2661
|
n4 && (n4.destroy?.(), a22?.delete(e6));
|
|
2661
2662
|
}
|
|
@@ -2670,7 +2671,7 @@ function Ls(e5, t3, n3, s3) {
|
|
|
2670
2671
|
continue;
|
|
2671
2672
|
}
|
|
2672
2673
|
const i10 = s3?.oldDecorations?.find(t4.id), c12 = s3?.decorations?.find(t4.id);
|
|
2673
|
-
if (n4 && r5 && !
|
|
2674
|
+
if (n4 && r5 && !Hs(r5, t4, i10, c12)) u2 = n4;
|
|
2674
2675
|
else if (n4) {
|
|
2675
2676
|
const r6 = a22?.get(t4.id);
|
|
2676
2677
|
if (r6) {
|
|
@@ -2678,18 +2679,18 @@ function Ls(e5, t3, n3, s3) {
|
|
|
2678
2679
|
if (V(t4) && r6.contentDOM) {
|
|
2679
2680
|
r6.contentDOM.textContent = "";
|
|
2680
2681
|
const e6 = s3?.decorations?.findInline(t4.id);
|
|
2681
|
-
|
|
2682
|
+
js(r6.contentDOM, t4, o2, e6);
|
|
2682
2683
|
}
|
|
2683
2684
|
u2 = r6.dom;
|
|
2684
2685
|
continue;
|
|
2685
2686
|
}
|
|
2686
2687
|
r6.destroy?.(), a22?.delete(t4.id);
|
|
2687
2688
|
}
|
|
2688
|
-
const i11 =
|
|
2689
|
-
|
|
2689
|
+
const i11 = zs(t4, o2, a22, s3);
|
|
2690
|
+
Js(n4, i11, e5), u2 = i11;
|
|
2690
2691
|
} else {
|
|
2691
|
-
const n5 =
|
|
2692
|
-
|
|
2692
|
+
const n5 = zs(t4, o2, a22, s3);
|
|
2693
|
+
Qs(e5, u2, n5), u2 = n5;
|
|
2693
2694
|
}
|
|
2694
2695
|
if (p4 === t4.id) {
|
|
2695
2696
|
const e6 = a22?.get(t4.id);
|
|
@@ -2715,9 +2716,9 @@ function Ls(e5, t3, n3, s3) {
|
|
|
2715
2716
|
const e6 = a22?.get(p4);
|
|
2716
2717
|
e6 && e6.selectNode?.();
|
|
2717
2718
|
}
|
|
2718
|
-
c11 ||
|
|
2719
|
+
c11 || Gs(e5, i9, o2);
|
|
2719
2720
|
}
|
|
2720
|
-
function
|
|
2721
|
+
function Hs(e5, t3, n3, s3) {
|
|
2721
2722
|
if (e5.type !== t3.type) return true;
|
|
2722
2723
|
if (e5.children.length !== t3.children.length) return true;
|
|
2723
2724
|
const r4 = e5.attrs, i9 = t3.attrs;
|
|
@@ -2735,16 +2736,16 @@ function Ms(e5, t3, n3, s3) {
|
|
|
2735
2736
|
if (!Q(s4.marks, r5.marks)) return true;
|
|
2736
2737
|
} else if (C(s4) && C(r5)) {
|
|
2737
2738
|
if (s4.inlineType !== r5.inlineType) return true;
|
|
2738
|
-
if (!
|
|
2739
|
+
if (!Us(s4.attrs, r5.attrs)) return true;
|
|
2739
2740
|
} else {
|
|
2740
2741
|
if (R(s4) || R(r5) || C(s4) || C(r5)) return true;
|
|
2741
|
-
if (
|
|
2742
|
+
if (Hs(s4, r5)) return true;
|
|
2742
2743
|
}
|
|
2743
2744
|
}
|
|
2744
2745
|
const o2 = n3 ?? [], a22 = s3 ?? [];
|
|
2745
2746
|
return o2 !== a22 && !ht(o2, a22);
|
|
2746
2747
|
}
|
|
2747
|
-
function
|
|
2748
|
+
function zs(e5, t3, n3, s3) {
|
|
2748
2749
|
const r4 = s3?.decorations?.findInline(e5.id), i9 = s3?.nodeViewRegistry;
|
|
2749
2750
|
if (i9 && t3 && n3 && s3?.getState && s3?.dispatch) {
|
|
2750
2751
|
const o2 = i9.getNodeViewFactory(e5.type);
|
|
@@ -2752,45 +2753,45 @@ function Is(e5, t3, n3, s3) {
|
|
|
2752
2753
|
const i10 = o2(e5, s3.getState, s3.dispatch);
|
|
2753
2754
|
n3.set(e5.id, i10);
|
|
2754
2755
|
const a22 = t3.getNodeSpec(e5.type);
|
|
2755
|
-
if (a22?.isVoid && i10.dom.setAttribute("data-void", "true"), a22?.selectable && i10.dom.setAttribute("data-selectable", "true"), i10.contentDOM && i10.contentDOM !== i10.dom && i10.contentDOM.setAttribute("data-content-dom", "true"), V(e5) && i10.contentDOM)
|
|
2756
|
+
if (a22?.isVoid && i10.dom.setAttribute("data-void", "true"), a22?.selectable && i10.dom.setAttribute("data-selectable", "true"), i10.contentDOM && i10.contentDOM !== i10.dom && i10.contentDOM.setAttribute("data-content-dom", "true"), V(e5) && i10.contentDOM) js(i10.contentDOM, e5, t3, r4);
|
|
2756
2757
|
else {
|
|
2757
2758
|
const r5 = J(e5), o3 = /* @__PURE__ */ new Map();
|
|
2758
2759
|
for (const e6 of r5) {
|
|
2759
2760
|
const r6 = i10.getContentDOM?.(e6.id) ?? i10.contentDOM;
|
|
2760
2761
|
if (r6) {
|
|
2761
|
-
const i11 =
|
|
2762
|
+
const i11 = zs(e6, t3, n3, s3);
|
|
2762
2763
|
r6.appendChild(i11);
|
|
2763
2764
|
let a23 = o3.get(r6);
|
|
2764
2765
|
a23 || (a23 = [], o3.set(r6, a23)), a23.push(e6);
|
|
2765
2766
|
}
|
|
2766
2767
|
}
|
|
2767
|
-
for (const [e6, n4] of o3)
|
|
2768
|
+
for (const [e6, n4] of o3) Gs(e6, n4, t3);
|
|
2768
2769
|
}
|
|
2769
|
-
return i10.dom.setAttribute("data-block-type", e5.type),
|
|
2770
|
+
return i10.dom.setAttribute("data-block-type", e5.type), Vs(i10.dom, e5.id, s3), i10.dom;
|
|
2770
2771
|
}
|
|
2771
2772
|
}
|
|
2772
2773
|
if (t3) {
|
|
2773
2774
|
const i10 = t3.getNodeSpec(e5.type);
|
|
2774
2775
|
if (i10) {
|
|
2775
2776
|
const o2 = i10.toDOM(e5);
|
|
2776
|
-
if (i10.isVoid && o2.setAttribute("data-void", "true"), i10.selectable && o2.setAttribute("data-selectable", "true"), !i10.isVoid) if (V(e5))
|
|
2777
|
+
if (i10.isVoid && o2.setAttribute("data-void", "true"), i10.selectable && o2.setAttribute("data-selectable", "true"), !i10.isVoid) if (V(e5)) js(o2, e5, t3, r4);
|
|
2777
2778
|
else {
|
|
2778
2779
|
const r5 = J(e5);
|
|
2779
2780
|
for (const e6 of r5) {
|
|
2780
|
-
const r6 =
|
|
2781
|
+
const r6 = zs(e6, t3, n3, s3);
|
|
2781
2782
|
o2.appendChild(r6);
|
|
2782
2783
|
}
|
|
2783
|
-
|
|
2784
|
+
Gs(o2, r5, t3);
|
|
2784
2785
|
}
|
|
2785
|
-
return o2.setAttribute("data-block-type", e5.type),
|
|
2786
|
+
return o2.setAttribute("data-block-type", e5.type), Vs(o2, e5.id, s3), o2;
|
|
2786
2787
|
}
|
|
2787
2788
|
}
|
|
2788
2789
|
return (function(e6, t4, n4) {
|
|
2789
|
-
const s4 =
|
|
2790
|
-
return s4.setAttribute("data-block-type", e6.type),
|
|
2790
|
+
const s4 = we("p", e6.id);
|
|
2791
|
+
return s4.setAttribute("data-block-type", e6.type), js(s4, e6, t4, n4), s4;
|
|
2791
2792
|
})(e5, t3, r4);
|
|
2792
2793
|
}
|
|
2793
|
-
function
|
|
2794
|
+
function js(e5, t3, n3, s3) {
|
|
2794
2795
|
for (const t4 of e5.querySelectorAll("[data-cursor-wrapper]")) t4.remove();
|
|
2795
2796
|
const r4 = I(t3);
|
|
2796
2797
|
if (1 === r4.length && R(r4[0]) && "" === r4[0].text) return void e5.appendChild(document.createElement("br"));
|
|
@@ -2798,7 +2799,7 @@ function Ns(e5, t3, n3, s3) {
|
|
|
2798
2799
|
let r5 = 0;
|
|
2799
2800
|
for (const i10 of t4) {
|
|
2800
2801
|
if (C(i10)) {
|
|
2801
|
-
e6.appendChild(
|
|
2802
|
+
e6.appendChild(Fs(i10, s4)), r5 += 1;
|
|
2802
2803
|
continue;
|
|
2803
2804
|
}
|
|
2804
2805
|
const t5 = r5, o2 = r5 + i10.text.length;
|
|
@@ -2818,18 +2819,18 @@ function Ns(e5, t3, n3, s3) {
|
|
|
2818
2819
|
if (void 0 === o3 || void 0 === a23 || o3 >= a23) continue;
|
|
2819
2820
|
const l3 = o3 - t5, h4 = a23 - t5, d5 = i10.text.slice(l3, h4), u2 = [];
|
|
2820
2821
|
for (const e7 of n4) e7.from <= o3 && e7.to >= a23 && u2.push(e7);
|
|
2821
|
-
let p4 = document.createTextNode(
|
|
2822
|
+
let p4 = document.createTextNode($s(d5));
|
|
2822
2823
|
if (i10.marks.length > 0) {
|
|
2823
|
-
const e7 = [...i10.marks].sort((e8, t6) =>
|
|
2824
|
+
const e7 = [...i10.marks].sort((e8, t6) => Tn(e8, s4) - Tn(t6, s4));
|
|
2824
2825
|
for (let t6 = e7.length - 1; t6 >= 0; t6--) {
|
|
2825
2826
|
const n5 = e7[t6];
|
|
2826
2827
|
if (!n5) continue;
|
|
2827
|
-
const r7 =
|
|
2828
|
+
const r7 = An(n5, s4);
|
|
2828
2829
|
r7.appendChild(p4), p4 = r7;
|
|
2829
2830
|
}
|
|
2830
2831
|
}
|
|
2831
2832
|
for (const e7 of u2) {
|
|
2832
|
-
const t6 =
|
|
2833
|
+
const t6 = Ws(e7.attrs);
|
|
2833
2834
|
t6.appendChild(p4), p4 = t6;
|
|
2834
2835
|
}
|
|
2835
2836
|
e6.appendChild(p4);
|
|
@@ -2837,29 +2838,29 @@ function Ns(e5, t3, n3, s3) {
|
|
|
2837
2838
|
r5 = o2;
|
|
2838
2839
|
}
|
|
2839
2840
|
})(e5, r4, s3, n3);
|
|
2840
|
-
else for (const t4 of r4) R(t4) ? e5.appendChild(
|
|
2841
|
+
else for (const t4 of r4) R(t4) ? e5.appendChild(Ks(t4, n3)) : e5.appendChild(Fs(t4, n3));
|
|
2841
2842
|
const i9 = r4[r4.length - 1];
|
|
2842
2843
|
i9 && C(i9) && "hard_break" === i9.inlineType && e5.appendChild(document.createElement("br"));
|
|
2843
2844
|
}
|
|
2844
|
-
function
|
|
2845
|
+
function $s(e5) {
|
|
2845
2846
|
let t3 = e5.replace(/ {2}/g, " ");
|
|
2846
2847
|
return t3.endsWith(" ") && (t3 = `${t3.slice(0, -1)} `), t3.startsWith(" ") && (t3 = ` ${t3.slice(1)}`), t3;
|
|
2847
2848
|
}
|
|
2848
|
-
function
|
|
2849
|
+
function Ks(e5, t3) {
|
|
2849
2850
|
if ("" === e5.text) return document.createTextNode("");
|
|
2850
|
-
const n3 = document.createTextNode(
|
|
2851
|
+
const n3 = document.createTextNode($s(e5.text));
|
|
2851
2852
|
if (0 === e5.marks.length) return n3;
|
|
2852
|
-
const s3 = [...e5.marks].sort((e6, n4) =>
|
|
2853
|
+
const s3 = [...e5.marks].sort((e6, n4) => Tn(e6, t3) - Tn(n4, t3));
|
|
2853
2854
|
let r4 = n3;
|
|
2854
2855
|
for (let e6 = s3.length - 1; e6 >= 0; e6--) {
|
|
2855
2856
|
const n4 = s3[e6];
|
|
2856
2857
|
if (!n4) continue;
|
|
2857
|
-
const i9 =
|
|
2858
|
+
const i9 = An(n4, t3);
|
|
2858
2859
|
i9.appendChild(r4), r4 = i9;
|
|
2859
2860
|
}
|
|
2860
2861
|
return r4;
|
|
2861
2862
|
}
|
|
2862
|
-
function
|
|
2863
|
+
function Fs(e5, t3) {
|
|
2863
2864
|
if (t3) {
|
|
2864
2865
|
const n4 = t3.getInlineNodeSpec(e5.inlineType);
|
|
2865
2866
|
if (n4) {
|
|
@@ -2870,30 +2871,27 @@ function Ps(e5, t3) {
|
|
|
2870
2871
|
const n3 = document.createElement("span");
|
|
2871
2872
|
return n3.setAttribute("data-inline-type", e5.inlineType), n3.setAttribute("contenteditable", "false"), n3;
|
|
2872
2873
|
}
|
|
2873
|
-
function
|
|
2874
|
+
function Us(e5, t3) {
|
|
2874
2875
|
const n3 = Object.keys(e5), s3 = Object.keys(t3);
|
|
2875
2876
|
if (n3.length !== s3.length) return false;
|
|
2876
2877
|
for (const s4 of n3) if (e5[s4] !== t3[s4]) return false;
|
|
2877
2878
|
return true;
|
|
2878
2879
|
}
|
|
2879
|
-
function
|
|
2880
|
+
function Ws(e5) {
|
|
2880
2881
|
const t3 = e5.nodeName ?? "span", n3 = document.createElement(t3);
|
|
2881
2882
|
if (n3.setAttribute("data-decoration", "true"), e5.class) for (const t4 of e5.class.split(" ")) t4 && n3.classList.add(t4);
|
|
2882
|
-
e5.style && (n3
|
|
2883
|
+
e5.style && Nt(n3, e5.style);
|
|
2883
2884
|
for (const [t4, s3] of Object.entries(e5)) "class" !== t4 && "style" !== t4 && "nodeName" !== t4 && void 0 !== s3 && n3.setAttribute(t4, s3);
|
|
2884
2885
|
return n3;
|
|
2885
2886
|
}
|
|
2886
|
-
function
|
|
2887
|
+
function Vs(e5, t3, n3) {
|
|
2887
2888
|
const s3 = n3?.decorations?.findNode(t3);
|
|
2888
2889
|
if (s3 && 0 !== s3.length) for (const t4 of s3) {
|
|
2889
2890
|
if (t4.attrs.class) for (const n4 of t4.attrs.class.split(" ")) n4 && e5.classList.add(n4);
|
|
2890
|
-
|
|
2891
|
-
const n4 = e5.style.cssText;
|
|
2892
|
-
e5.style.cssText = n4 ? `${n4}; ${t4.attrs.style}` : t4.attrs.style;
|
|
2893
|
-
}
|
|
2891
|
+
t4.attrs.style && It(e5, t4.attrs.style);
|
|
2894
2892
|
}
|
|
2895
2893
|
}
|
|
2896
|
-
function
|
|
2894
|
+
function Gs(e5, t3, n3) {
|
|
2897
2895
|
if (!n3) return;
|
|
2898
2896
|
const s3 = [];
|
|
2899
2897
|
let r4 = null, i9 = [];
|
|
@@ -2914,21 +2912,21 @@ function zs(e5, t3, n3) {
|
|
|
2914
2912
|
}
|
|
2915
2913
|
}
|
|
2916
2914
|
}
|
|
2917
|
-
function
|
|
2915
|
+
function qs(e5) {
|
|
2918
2916
|
e5.parentElement?.removeChild(e5);
|
|
2919
2917
|
}
|
|
2920
|
-
function
|
|
2918
|
+
function Js(e5, t3, n3) {
|
|
2921
2919
|
const s3 = e5.parentElement;
|
|
2922
2920
|
s3 ? s3.replaceChild(t3, e5) : n3.replaceChild(t3, e5);
|
|
2923
2921
|
}
|
|
2924
|
-
function
|
|
2922
|
+
function Qs(e5, t3, n3) {
|
|
2925
2923
|
if (t3?.parentElement) {
|
|
2926
2924
|
const e6 = t3.parentElement;
|
|
2927
2925
|
return void (t3.nextSibling ? e6.insertBefore(n3, t3.nextSibling) : e6.appendChild(n3));
|
|
2928
2926
|
}
|
|
2929
2927
|
e5.firstChild ? e5.insertBefore(n3, e5.firstChild) : e5.appendChild(n3);
|
|
2930
2928
|
}
|
|
2931
|
-
class
|
|
2929
|
+
class Xs {
|
|
2932
2930
|
state;
|
|
2933
2931
|
contentElement;
|
|
2934
2932
|
inputHandler;
|
|
@@ -2955,16 +2953,16 @@ class Fs {
|
|
|
2955
2953
|
getDecorations;
|
|
2956
2954
|
isReadOnly;
|
|
2957
2955
|
navigationKeymap = null;
|
|
2958
|
-
compositionTracker = new
|
|
2956
|
+
compositionTracker = new kn();
|
|
2959
2957
|
cursorWrapper;
|
|
2960
2958
|
goalColumn = null;
|
|
2961
2959
|
preserveGoalColumn = false;
|
|
2962
2960
|
constructor(e5, t3) {
|
|
2963
|
-
this.state = t3.state, this.contentElement = e5, this.schemaRegistry = t3.schemaRegistry, this.keymapRegistry = t3.keymapRegistry, this.fileHandlerRegistry = t3.fileHandlerRegistry, this.nodeViewRegistry = t3.nodeViewRegistry, this.getDecorations = t3.getDecorations, this.isReadOnly = t3.isReadOnly ?? (() => false), this.history = new
|
|
2961
|
+
this.state = t3.state, this.contentElement = e5, this.schemaRegistry = t3.schemaRegistry, this.keymapRegistry = t3.keymapRegistry, this.fileHandlerRegistry = t3.fileHandlerRegistry, this.nodeViewRegistry = t3.nodeViewRegistry, this.getDecorations = t3.getDecorations, this.isReadOnly = t3.isReadOnly ?? (() => false), this.history = new cn({ maxDepth: t3.maxHistoryDepth ?? 100 }), t3.onStateChange && this.stateChangeCallbacks.push(t3.onStateChange), this.inputHandler = new Es(e5, { getState: () => this.state, dispatch: (e6) => this.dispatch(e6), syncSelection: () => this.syncSelectionFromDOM(), inputRuleRegistry: t3.inputRuleRegistry, isReadOnly: this.isReadOnly, compositionTracker: this.compositionTracker }), this.keyboardHandler = new un(e5, { getState: () => this.state, dispatch: (e6) => this.dispatch(e6), undo: () => this.undo(), redo: () => this.redo(), keymapRegistry: this.keymapRegistry, isReadOnly: this.isReadOnly, compositionTracker: this.compositionTracker }), this.pasteHandler = new _s(e5, { getState: () => this.state, dispatch: (e6) => this.dispatch(e6), schemaRegistry: this.schemaRegistry, fileHandlerRegistry: this.fileHandlerRegistry, isReadOnly: this.isReadOnly }), this.clipboardHandler = new yn(e5, { getState: () => this.state, dispatch: (e6) => this.dispatch(e6), schemaRegistry: this.schemaRegistry, syncSelection: () => this.syncSelectionFromDOM(), isReadOnly: this.isReadOnly }), this.cursorWrapper = new Rn(e5, this.schemaRegistry), this.handleCompositionStartForWrapper = () => {
|
|
2964
2962
|
this.cursorWrapper.onCompositionStart(this.state);
|
|
2965
2963
|
}, this.handleCompositionEndForWrapper = () => {
|
|
2966
2964
|
this.cursorWrapper.cleanup();
|
|
2967
|
-
}, e5.addEventListener("compositionstart", this.handleCompositionStartForWrapper), e5.addEventListener("compositionend", this.handleCompositionEndForWrapper), this.handleSelectionChange = this.onSelectionChange.bind(this), document.addEventListener("selectionchange", this.handleSelectionChange), this.handleMousedown = this.onMousedown.bind(this), e5.addEventListener("mousedown", this.handleMousedown), this.handleDragover = this.onDragover.bind(this), e5.addEventListener("dragover", this.handleDragover), this.handleDrop = this.onDrop.bind(this), e5.addEventListener("drop", this.handleDrop), this.decorations = this.getDecorations?.(this.state) ?? lt.empty,
|
|
2965
|
+
}, e5.addEventListener("compositionstart", this.handleCompositionStartForWrapper), e5.addEventListener("compositionend", this.handleCompositionEndForWrapper), this.handleSelectionChange = this.onSelectionChange.bind(this), document.addEventListener("selectionchange", this.handleSelectionChange), this.handleMousedown = this.onMousedown.bind(this), e5.addEventListener("mousedown", this.handleMousedown), this.handleDragover = this.onDragover.bind(this), e5.addEventListener("dragover", this.handleDragover), this.handleDrop = this.onDrop.bind(this), e5.addEventListener("drop", this.handleDrop), this.decorations = this.getDecorations?.(this.state) ?? lt.empty, Ds(e5, null, this.state, { ...this.reconcileOptions(), decorations: this.decorations }), Me(e5, this.state.selection), this.registerNavigationKeymaps();
|
|
2968
2966
|
}
|
|
2969
2967
|
getState() {
|
|
2970
2968
|
return this.state;
|
|
@@ -2976,7 +2974,7 @@ class Fs {
|
|
|
2976
2974
|
const s3 = this.state;
|
|
2977
2975
|
this.state = e5, this.cursorWrapper.isActive && !e5.storedMarks?.length && this.cursorWrapper.cleanup(), n3?.pushHistory && "history" !== t3.metadata.origin && this.history.push(t3);
|
|
2978
2976
|
const r4 = this.decorations, i9 = this.getDecorations?.(e5, t3) ?? lt.empty;
|
|
2979
|
-
this.decorations = i9,
|
|
2977
|
+
this.decorations = i9, Ds(this.contentElement, s3, e5, { ...this.reconcileOptions(s3.selection), decorations: i9, oldDecorations: r4, compositionBlockId: this.compositionTracker.isComposing ? this.compositionTracker.activeBlockId ?? void 0 : void 0 }), this.compositionTracker.isComposing || Me(this.contentElement, e5.selection);
|
|
2980
2978
|
for (const n4 of this.stateChangeCallbacks) n4(s3, e5, t3);
|
|
2981
2979
|
this.preserveGoalColumn || (this.goalColumn = null);
|
|
2982
2980
|
} finally {
|
|
@@ -3011,7 +3009,7 @@ class Fs {
|
|
|
3011
3009
|
const t3 = this.state;
|
|
3012
3010
|
this.state = e5, this.history.clear();
|
|
3013
3011
|
const n3 = this.decorations, s3 = this.getDecorations?.(e5) ?? lt.empty;
|
|
3014
|
-
this.decorations = s3,
|
|
3012
|
+
this.decorations = s3, Ds(this.contentElement, t3, e5, { ...this.reconcileOptions(t3.selection), decorations: s3, oldDecorations: n3, compositionBlockId: this.compositionTracker.isComposing ? this.compositionTracker.activeBlockId ?? void 0 : void 0 }), this.compositionTracker.isComposing || Me(this.contentElement, e5.selection);
|
|
3015
3013
|
} finally {
|
|
3016
3014
|
this.isUpdating = false;
|
|
3017
3015
|
}
|
|
@@ -3141,39 +3139,43 @@ class Fs {
|
|
|
3141
3139
|
this.nodeViews.clear();
|
|
3142
3140
|
}
|
|
3143
3141
|
}
|
|
3144
|
-
const
|
|
3145
|
-
let
|
|
3146
|
-
class
|
|
3142
|
+
const Ys = ["\n:host {\n display: block;\n font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;\n font-size: 16px;\n line-height: 1.6;\n color: var(--notectl-fg);\n}\n\n.notectl-editor {\n display: flex;\n flex-direction: column;\n border: 1px solid var(--notectl-border);\n border-radius: 6px;\n overflow: hidden;\n background: var(--notectl-bg);\n}\n\n.notectl-editor:focus-within {\n border-color: var(--notectl-border-focus);\n box-shadow: 0 0 0 2px var(--notectl-focus-ring);\n}\n\n/* Content Area */\n.notectl-content {\n flex: 1;\n padding: 12px 16px;\n outline: none;\n min-height: var(--notectl-content-min-height, 400px);\n cursor: text;\n position: relative;\n white-space: pre-wrap;\n word-wrap: break-word;\n -moz-tab-size: 4;\n tab-size: 4;\n}\n\n.notectl-content p {\n margin: 0;\n padding: 2px 0;\n min-height: 1.6em;\n}\n\n.notectl-content p + p {\n margin-top: 0;\n}\n\n/* Horizontal Rule */\n.notectl-content hr {\n border: none;\n border-top: 1px solid var(--notectl-border);\n margin: 8px 0;\n padding: 0;\n cursor: default;\n user-select: none;\n}\n\n/* Placeholder */\n.notectl-content.notectl-content--empty::before {\n content: attr(data-placeholder);\n color: var(--notectl-fg-muted);\n pointer-events: none;\n position: absolute;\n top: 12px;\n left: 16px;\n}\n\n/* Plugin container bottom */\n.notectl-plugin-container--bottom {\n border-top: 1px solid var(--notectl-border);\n}\n\n/* Screen reader announcements */\n.notectl-sr-only {\n position: absolute;\n width: 1px;\n height: 1px;\n margin: -1px;\n padding: 0;\n overflow: hidden;\n clip: rect(0, 0, 0, 0);\n white-space: nowrap;\n border: 0;\n}\n\n/* Node selection */\n.notectl-node-selected {\n outline: 2px solid var(--notectl-primary);\n outline-offset: 2px;\n}\n", "\n@media (prefers-reduced-motion: reduce) {\n .notectl-toolbar-btn,\n .notectl-image__resize-handle,\n .notectl-image__size-indicator,\n .notectl-color-picker__swatch,\n .notectl-font-picker__item,\n .notectl-heading-picker__item,\n .notectl-font-size-picker__item,\n .ntbl-handle,\n .ntbl-handle-delete,\n .ntbl-insert-line,\n .ntbl-insert-btn,\n .ntbl-add-zone,\n .ntbl-add-icon,\n .ntbl-col-bar,\n .ntbl-row-bar,\n .ntbl-delete-table-btn,\n .notectl-code-block__copy {\n transition: none !important;\n }\n}\n", '\n/* Paper viewport: scroll container with centered gray background */\n.notectl-paper-viewport {\n flex: 1;\n overflow-y: auto;\n overflow-x: hidden;\n background: var(--notectl-paper-viewport-bg, #e8e8e8);\n padding: 24px 0;\n}\n\n/* Paper surface: white page with shadow, centered */\n.notectl-paper-surface {\n margin: 0 auto;\n background: var(--notectl-bg);\n border-radius: 2px;\n box-shadow: 0 2px 8px var(--notectl-shadow, rgba(0, 0, 0, 0.15));\n transform-origin: top center;\n transition: transform 0.15s ease-out;\n}\n\n/* Content overrides in paper mode: wider document margins */\n.notectl-editor[data-paper-mode] .notectl-content {\n flex: none;\n padding: 48px 56px;\n min-height: auto;\n}\n\n/* Placeholder position override for paper mode */\n.notectl-editor[data-paper-mode] .notectl-content.notectl-content--empty::before {\n top: 48px;\n left: 56px;\n}\n\n/* Dark mode: darker viewport background */\n:host([theme="dark"]) .notectl-paper-viewport {\n --notectl-paper-viewport-bg: #181825;\n}\n\n@media (prefers-reduced-motion: reduce) {\n .notectl-paper-surface {\n transition: none !important;\n }\n}\n'].join("\n");
|
|
3143
|
+
let Zs = null;
|
|
3144
|
+
class er {
|
|
3147
3145
|
themeStyleSheet = new CSSStyleSheet();
|
|
3148
3146
|
systemThemeQuery = null;
|
|
3149
3147
|
systemThemeHandler = null;
|
|
3150
3148
|
pluginSheets = [];
|
|
3149
|
+
runtimeSheets = [];
|
|
3151
3150
|
shadow;
|
|
3152
3151
|
constructor(e5) {
|
|
3153
3152
|
this.shadow = e5;
|
|
3154
3153
|
}
|
|
3155
3154
|
apply(e5) {
|
|
3156
|
-
if (this.cleanupSystemThemeListener(), e5 ===
|
|
3155
|
+
if (this.cleanupSystemThemeListener(), e5 === es.System) {
|
|
3157
3156
|
this.setupSystemThemeListener();
|
|
3158
|
-
const e6 =
|
|
3157
|
+
const e6 = rs(this.getSystemTheme());
|
|
3159
3158
|
this.setThemeStyleSheet(e6);
|
|
3160
|
-
} else this.setThemeStyleSheet(
|
|
3159
|
+
} else this.setThemeStyleSheet(rs(e5));
|
|
3161
3160
|
}
|
|
3162
3161
|
setPluginStyleSheets(e5) {
|
|
3163
3162
|
this.pluginSheets = e5, this.refreshAdoptedStyleSheets();
|
|
3164
3163
|
}
|
|
3164
|
+
setRuntimeStyleSheets(e5) {
|
|
3165
|
+
this.runtimeSheets = e5, this.refreshAdoptedStyleSheets();
|
|
3166
|
+
}
|
|
3165
3167
|
destroy() {
|
|
3166
3168
|
this.cleanupSystemThemeListener();
|
|
3167
3169
|
}
|
|
3168
3170
|
setThemeStyleSheet(e5) {
|
|
3169
|
-
this.themeStyleSheet.replaceSync(
|
|
3171
|
+
this.themeStyleSheet.replaceSync(cs(e5)), this.refreshAdoptedStyleSheets();
|
|
3170
3172
|
}
|
|
3171
3173
|
refreshAdoptedStyleSheets() {
|
|
3172
|
-
this.shadow.adoptedStyleSheets = [this.themeStyleSheet, (
|
|
3174
|
+
this.shadow.adoptedStyleSheets = [this.themeStyleSheet, (Zs || (Zs = new CSSStyleSheet(), Zs.replaceSync(Ys)), Zs), ...this.pluginSheets, ...this.runtimeSheets];
|
|
3173
3175
|
}
|
|
3174
3176
|
setupSystemThemeListener() {
|
|
3175
3177
|
this.systemThemeQuery = window.matchMedia("(prefers-color-scheme: dark)"), this.systemThemeHandler = (e5) => {
|
|
3176
|
-
const t3 =
|
|
3178
|
+
const t3 = rs(this.getSystemTheme());
|
|
3177
3179
|
this.setThemeStyleSheet(t3);
|
|
3178
3180
|
}, this.systemThemeQuery.addEventListener("change", this.systemThemeHandler);
|
|
3179
3181
|
}
|
|
@@ -3181,10 +3183,10 @@ class Vs {
|
|
|
3181
3183
|
this.systemThemeQuery && this.systemThemeHandler && this.systemThemeQuery.removeEventListener("change", this.systemThemeHandler), this.systemThemeQuery = null, this.systemThemeHandler = null;
|
|
3182
3184
|
}
|
|
3183
3185
|
getSystemTheme() {
|
|
3184
|
-
return window.matchMedia("(prefers-color-scheme: dark)").matches ?
|
|
3186
|
+
return window.matchMedia("(prefers-color-scheme: dark)").matches ? es.Dark : es.Light;
|
|
3185
3187
|
}
|
|
3186
3188
|
}
|
|
3187
|
-
class
|
|
3189
|
+
class tr {
|
|
3188
3190
|
wrapper;
|
|
3189
3191
|
content;
|
|
3190
3192
|
viewport = null;
|
|
@@ -3201,7 +3203,7 @@ class Gs {
|
|
|
3201
3203
|
}
|
|
3202
3204
|
apply(e5) {
|
|
3203
3205
|
if (null === e5) return void this.disable();
|
|
3204
|
-
const t3 =
|
|
3206
|
+
const t3 = Fn(e5);
|
|
3205
3207
|
this.currentPaperWidthPx = t3.widthPx, this.currentPaperHeightPx = t3.heightPx, this.currentSize = e5, this.viewport || this.enable(), this.updateSurfaceDimensions(), this.wrapper.setAttribute("data-paper-mode", e5);
|
|
3206
3208
|
}
|
|
3207
3209
|
destroy() {
|
|
@@ -3228,12 +3230,12 @@ class Gs {
|
|
|
3228
3230
|
this.viewport = null, this.surface = null, this.currentSize = null, this.currentPaperWidthPx = 0, this.currentPaperHeightPx = 0, this.currentScale = 1, this.wrapper.removeAttribute("data-paper-mode");
|
|
3229
3231
|
}
|
|
3230
3232
|
updateSurfaceDimensions() {
|
|
3231
|
-
this.surface && (this.surface
|
|
3233
|
+
this.surface && (Bt(this.surface, "width", `${this.currentPaperWidthPx}px`), Bt(this.surface, "minHeight", `${this.currentPaperHeightPx}px`));
|
|
3232
3234
|
}
|
|
3233
3235
|
onViewportResize(e5) {
|
|
3234
3236
|
if (!this.surface || 0 === this.currentPaperWidthPx) return;
|
|
3235
3237
|
const t3 = e5 - 48, n3 = Math.min(1, t3 / this.currentPaperWidthPx);
|
|
3236
|
-
this.currentScale = n3, this.surface
|
|
3238
|
+
this.currentScale = n3, Bt(this.surface, "transform", n3 < 1 ? `scale(${n3})` : ""), this.scheduleHeightCompensation(n3);
|
|
3237
3239
|
}
|
|
3238
3240
|
onSurfaceResize(e5) {
|
|
3239
3241
|
this.surface && this.viewport && this.scheduleHeightCompensation(this.currentScale);
|
|
@@ -3245,12 +3247,12 @@ class Gs {
|
|
|
3245
3247
|
}
|
|
3246
3248
|
updateHeightCompensation(e5) {
|
|
3247
3249
|
if (!this.surface) return;
|
|
3248
|
-
if (e5 >= 1) return void (this.surface
|
|
3250
|
+
if (e5 >= 1) return void Bt(this.surface, "marginBottom", "");
|
|
3249
3251
|
const t3 = this.surface.scrollHeight, n3 = t3 * e5 - t3;
|
|
3250
|
-
this.surface
|
|
3252
|
+
Bt(this.surface, "marginBottom", `${n3}px`);
|
|
3251
3253
|
}
|
|
3252
3254
|
}
|
|
3253
|
-
class
|
|
3255
|
+
class nr extends HTMLElement {
|
|
3254
3256
|
view = null;
|
|
3255
3257
|
pluginManager = null;
|
|
3256
3258
|
contentElement = null;
|
|
@@ -3266,6 +3268,7 @@ class qs extends HTMLElement {
|
|
|
3266
3268
|
preInitPlugins = [];
|
|
3267
3269
|
themeController = null;
|
|
3268
3270
|
paperLayout = null;
|
|
3271
|
+
runtimeStyleSheet = null;
|
|
3269
3272
|
constructor() {
|
|
3270
3273
|
super(), this.readyPromise = new Promise((e5) => {
|
|
3271
3274
|
this.readyPromiseResolve = e5;
|
|
@@ -3287,7 +3290,7 @@ class qs extends HTMLElement {
|
|
|
3287
3290
|
const e6 = null !== n3;
|
|
3288
3291
|
this.contentElement.contentEditable = e6 ? "false" : "true", e6 ? this.contentElement.setAttribute("aria-readonly", "true") : this.contentElement.removeAttribute("aria-readonly"), this.config = { ...this.config, readonly: e6 }, this.pluginManager?.setReadOnly(e6);
|
|
3289
3292
|
}
|
|
3290
|
-
"theme" === e5 && this.themeController && this.themeController.apply(n3 ??
|
|
3293
|
+
"theme" === e5 && this.themeController && this.themeController.apply(n3 ?? es.Light), "paper-size" === e5 && (null === n3 ? this.configure({ paperSize: void 0 }) : Gn(n3) && this.configure({ paperSize: n3 }));
|
|
3291
3294
|
}
|
|
3292
3295
|
registerPlugin(e5) {
|
|
3293
3296
|
if (this.initialized) throw new Error("Cannot register plugins after initialization. Register before calling init() or adding to DOM.");
|
|
@@ -3298,7 +3301,7 @@ class qs extends HTMLElement {
|
|
|
3298
3301
|
this.initialized = true, e5 && (this.config = e5);
|
|
3299
3302
|
const t3 = this.shadowRoot;
|
|
3300
3303
|
if (!t3) return;
|
|
3301
|
-
this.themeController = new
|
|
3304
|
+
this.themeController = new er(t3), this.setupStyleRuntime(t3), this.themeController.apply(this.config.theme ?? es.Light);
|
|
3302
3305
|
const n3 = (function(e6) {
|
|
3303
3306
|
const t4 = document.createElement("div");
|
|
3304
3307
|
t4.className = "notectl-editor";
|
|
@@ -3311,9 +3314,9 @@ class qs extends HTMLElement {
|
|
|
3311
3314
|
const i10 = document.createElement("div");
|
|
3312
3315
|
return i10.className = "notectl-sr-only", i10.setAttribute("data-notectl-no-print", ""), i10.setAttribute("aria-live", "polite"), i10.setAttribute("aria-atomic", "true"), t4.appendChild(n4), t4.appendChild(s4), t4.appendChild(r5), t4.appendChild(i10), { wrapper: t4, content: s4, topPluginContainer: n4, bottomPluginContainer: r5, announcer: i10 };
|
|
3313
3316
|
})({ readonly: this.config.readonly, placeholder: this.config.placeholder });
|
|
3314
|
-
this.editorWrapper = n3.wrapper, this.contentElement = n3.content, this.topPluginContainer = n3.topPluginContainer, this.bottomPluginContainer = n3.bottomPluginContainer, this.announcer = n3.announcer, t3.appendChild(this.editorWrapper), this.config.paperSize && (this.paperLayout = new
|
|
3317
|
+
this.editorWrapper = n3.wrapper, this.contentElement = n3.content, this.topPluginContainer = n3.topPluginContainer, this.bottomPluginContainer = n3.bottomPluginContainer, this.announcer = n3.announcer, t3.appendChild(this.editorWrapper), this.config.paperSize && (this.paperLayout = new tr(this.editorWrapper, this.contentElement), this.paperLayout.apply(this.config.paperSize)), this.pluginManager = new On();
|
|
3315
3318
|
const s3 = new st(this.config.locale ?? "browser");
|
|
3316
|
-
this.pluginManager.registerService(rt, s3),
|
|
3319
|
+
this.pluginManager.registerService(rt, s3), Kt(this.pluginManager.schemaRegistry), this.processToolbarConfig();
|
|
3317
3320
|
for (const e6 of this.config.plugins ?? []) this.pluginManager.register(e6);
|
|
3318
3321
|
for (const e6 of this.preInitPlugins) this.pluginManager.register(e6);
|
|
3319
3322
|
this.preInitPlugins = [], this.ensureTextFormattingPlugin(), this.ensureCaretNavigationPlugin(), this.ensureGapCursorPlugin(), this.contentElement.addEventListener("focus", () => this.emit("focus", void 0)), this.contentElement.addEventListener("blur", () => this.emit("blur", void 0));
|
|
@@ -3326,13 +3329,13 @@ class qs extends HTMLElement {
|
|
|
3326
3329
|
}, dispatch: (e6) => this.dispatch(e6), getContainer: () => r4, getPluginContainer: (e6) => "top" === e6 ? o2 : a22, announce: (e6) => {
|
|
3327
3330
|
c11 && (c11.textContent = e6);
|
|
3328
3331
|
}, hasAnnouncement: () => !!c11?.textContent, onBeforeReady: () => {
|
|
3329
|
-
const e6 = me(i9.schemaRegistry), t4 =
|
|
3330
|
-
this.view = new
|
|
3332
|
+
const e6 = me(i9.schemaRegistry), t4 = tn.create({ schema: e6 });
|
|
3333
|
+
this.view = new Xs(r4, { state: t4, schemaRegistry: i9.schemaRegistry, keymapRegistry: i9.keymapRegistry, inputRuleRegistry: i9.inputRuleRegistry, fileHandlerRegistry: i9.fileHandlerRegistry, nodeViewRegistry: i9.nodeViewRegistry, maxHistoryDepth: this.config.maxHistoryDepth, getDecorations: (e7, t5) => this.pluginManager?.collectDecorations(e7, t5) ?? lt.empty, onStateChange: (e7, t5, n5) => {
|
|
3331
3334
|
this.onStateChange(e7, t5, n5);
|
|
3332
3335
|
}, isReadOnly: () => this.config.readonly ?? false }), this.updateEmptyState();
|
|
3333
3336
|
const n4 = i9.getPluginStyleSheets();
|
|
3334
3337
|
n4.length > 0 && this.themeController?.setPluginStyleSheets(n4);
|
|
3335
|
-
} }), this.pluginManager && (this.config.readonly && this.pluginManager.setReadOnly(true), this.pluginManager.onEvent(
|
|
3338
|
+
} }), this.pluginManager && (this.config.readonly && this.pluginManager.setReadOnly(true), this.pluginManager.onEvent(Qn, (e6) => {
|
|
3336
3339
|
!e6.options.paperSize && this.config.paperSize && (e6.options = { ...e6.options, paperSize: this.config.paperSize });
|
|
3337
3340
|
}), this.config.autofocus && requestAnimationFrame(() => this.contentElement?.focus()), this.readyPromiseResolve?.(), this.emit("ready", void 0));
|
|
3338
3341
|
}
|
|
@@ -3344,16 +3347,16 @@ class qs extends HTMLElement {
|
|
|
3344
3347
|
return this.view.getState().doc;
|
|
3345
3348
|
}
|
|
3346
3349
|
setJSON(e5) {
|
|
3347
|
-
const t3 = this.pluginManager ? me(this.pluginManager.schemaRegistry) : void 0, n3 =
|
|
3350
|
+
const t3 = this.pluginManager ? me(this.pluginManager.schemaRegistry) : void 0, n3 = tn.create({ doc: e5, schema: t3, selection: re(e5.children[0]?.id ?? ye(""), 0) });
|
|
3348
3351
|
this.replaceState(n3);
|
|
3349
3352
|
}
|
|
3350
3353
|
getContentHTML(e5) {
|
|
3351
3354
|
if (!this.view) throw new Error("Editor not initialized");
|
|
3352
|
-
const t3 =
|
|
3355
|
+
const t3 = us(this.view.getState().doc, this.pluginManager?.schemaRegistry);
|
|
3353
3356
|
return e5?.pretty ? xe(t3) : t3;
|
|
3354
3357
|
}
|
|
3355
3358
|
setContentHTML(e5) {
|
|
3356
|
-
const t3 =
|
|
3359
|
+
const t3 = ys(e5, this.pluginManager?.schemaRegistry);
|
|
3357
3360
|
this.setJSON(t3);
|
|
3358
3361
|
}
|
|
3359
3362
|
getText() {
|
|
@@ -3402,7 +3405,7 @@ class qs extends HTMLElement {
|
|
|
3402
3405
|
return this.view.getState();
|
|
3403
3406
|
}
|
|
3404
3407
|
dispatch(e5) {
|
|
3405
|
-
this.view && this.pluginManager && (!this.config.readonly ||
|
|
3408
|
+
this.view && this.pluginManager && (!this.config.readonly || an(e5) || this.pluginManager.isReadonlyBypassed()) && this.pluginManager.dispatchWithMiddleware(e5, this.view.getState(), (e6) => this.view?.dispatch(e6));
|
|
3406
3409
|
}
|
|
3407
3410
|
on(e5, t3) {
|
|
3408
3411
|
this.eventListeners.has(e5) || this.eventListeners.set(e5, /* @__PURE__ */ new Set()), this.eventListeners.get(e5)?.add(t3);
|
|
@@ -3420,13 +3423,13 @@ class qs extends HTMLElement {
|
|
|
3420
3423
|
this.config = { ...this.config, theme: e5 }, this.themeController?.apply(e5);
|
|
3421
3424
|
}
|
|
3422
3425
|
getTheme() {
|
|
3423
|
-
return this.config.theme ??
|
|
3426
|
+
return this.config.theme ?? es.Light;
|
|
3424
3427
|
}
|
|
3425
3428
|
getPaperSize() {
|
|
3426
3429
|
return this.config.paperSize;
|
|
3427
3430
|
}
|
|
3428
3431
|
destroy() {
|
|
3429
|
-
this.paperLayout?.destroy(), this.paperLayout = null, this.themeController?.destroy(), this.themeController = null, this.view?.destroy();
|
|
3432
|
+
this.paperLayout?.destroy(), this.paperLayout = null, this.teardownStyleRuntime(), this.themeController?.destroy(), this.themeController = null, this.view?.destroy();
|
|
3430
3433
|
const e5 = this.pluginManager?.destroy() ?? Promise.resolve();
|
|
3431
3434
|
return this.view = null, this.pluginManager = null, this.initialized = false, this.editorWrapper?.remove(), this.editorWrapper = null, this.contentElement = null, this.topPluginContainer = null, this.bottomPluginContainer = null, this.announcer = null, e5;
|
|
3432
3435
|
}
|
|
@@ -3454,7 +3457,16 @@ class qs extends HTMLElement {
|
|
|
3454
3457
|
this.pluginManager && void 0 === this.pluginManager.get("gap-cursor") && this.pluginManager.register(new Rt());
|
|
3455
3458
|
}
|
|
3456
3459
|
applyPaperSize(e5) {
|
|
3457
|
-
this.editorWrapper && this.contentElement && (e5 ? (this.paperLayout || (this.paperLayout = new
|
|
3460
|
+
this.editorWrapper && this.contentElement && (e5 ? (this.paperLayout || (this.paperLayout = new tr(this.editorWrapper, this.contentElement)), this.paperLayout.apply(e5)) : this.paperLayout?.apply(null));
|
|
3461
|
+
}
|
|
3462
|
+
setupStyleRuntime(e5) {
|
|
3463
|
+
Ot(e5), this.runtimeStyleSheet = null;
|
|
3464
|
+
const t3 = this.config.styleMode ?? "strict";
|
|
3465
|
+
"strict" === t3 && (this.runtimeStyleSheet = Pt()), this.themeController?.setRuntimeStyleSheets(this.runtimeStyleSheet ? [this.runtimeStyleSheet] : []), _t(e5, { mode: t3, nonce: this.config.styleNonce, sheet: this.runtimeStyleSheet });
|
|
3466
|
+
}
|
|
3467
|
+
teardownStyleRuntime() {
|
|
3468
|
+
const e5 = this.shadowRoot;
|
|
3469
|
+
e5 && Ot(e5), this.runtimeStyleSheet = null, this.themeController?.setRuntimeStyleSheets([]);
|
|
3458
3470
|
}
|
|
3459
3471
|
emit(e5, t3) {
|
|
3460
3472
|
const n3 = this.eventListeners.get(e5);
|
|
@@ -3473,49 +3485,49 @@ class qs extends HTMLElement {
|
|
|
3473
3485
|
this.view && (this.view.replaceState(e5), this.updateEmptyState());
|
|
3474
3486
|
}
|
|
3475
3487
|
}
|
|
3476
|
-
async function
|
|
3488
|
+
async function sr(e5) {
|
|
3477
3489
|
const t3 = document.createElement("notectl-editor");
|
|
3478
3490
|
return await t3.init(e5), t3;
|
|
3479
3491
|
}
|
|
3480
|
-
function
|
|
3481
|
-
return { toolbar: [[new
|
|
3492
|
+
function rr(e5) {
|
|
3493
|
+
return { toolbar: [[new wt({ fonts: Ht, ...e5?.font })]], plugins: [] };
|
|
3482
3494
|
}
|
|
3483
|
-
function
|
|
3484
|
-
return { toolbar: [[new
|
|
3495
|
+
function ir(e5) {
|
|
3496
|
+
return { toolbar: [[new wt({ fonts: Ht, ...e5?.font }), new Et(e5?.fontSize)], [new pt(e5?.textFormatting), new kt(e5?.strikethrough), new Tt(e5?.superSub)], [new vt(e5?.textColor), new Ct(e5?.highlight)], [new ft(e5?.heading), new yt(e5?.blockquote), new dt(e5?.codeBlock)], [new St(e5?.alignment)], [new mt(e5?.list)], [new gt(e5?.link), new xt(e5?.table), new bt(e5?.horizontalRule), new At(e5?.image)], [new Zn(e5?.print)]], plugins: [new Ye()] };
|
|
3485
3497
|
}
|
|
3486
|
-
"undefined" == typeof customElements || customElements.get("notectl-editor") || customElements.define("notectl-editor",
|
|
3498
|
+
"undefined" == typeof customElements || customElements.get("notectl-editor") || customElements.define("notectl-editor", nr);
|
|
3487
3499
|
export {
|
|
3488
|
-
|
|
3500
|
+
Xn as AFTER_PRINT,
|
|
3489
3501
|
a13 as ALIGNMENT_ICONS,
|
|
3490
3502
|
b15 as ALIGNMENT_LOCALES,
|
|
3491
3503
|
c7 as ALIGNMENT_LOCALE_DE,
|
|
3492
3504
|
d3 as ALIGNMENT_LOCALE_EN,
|
|
3493
|
-
|
|
3494
|
-
|
|
3505
|
+
St as AlignmentPlugin,
|
|
3506
|
+
Qn as BEFORE_PRINT,
|
|
3495
3507
|
a9 as BLOCKQUOTE_LOCALES,
|
|
3496
3508
|
b11 as BLOCKQUOTE_LOCALE_EN,
|
|
3497
|
-
|
|
3509
|
+
Cn as BlockTypePickerRegistry,
|
|
3498
3510
|
yt as BlockquotePlugin,
|
|
3499
3511
|
a4 as CODE_BLOCK_LOCALES,
|
|
3500
3512
|
b6 as CODE_BLOCK_LOCALE_EN,
|
|
3501
3513
|
c6 as CODE_BLOCK_SERVICE_KEY,
|
|
3502
3514
|
te as CaretNavigationPlugin,
|
|
3503
|
-
|
|
3515
|
+
yn as ClipboardHandler,
|
|
3504
3516
|
dt as CodeBlockPlugin,
|
|
3505
|
-
|
|
3506
|
-
|
|
3507
|
-
|
|
3517
|
+
kn as CompositionTracker,
|
|
3518
|
+
Rn as CursorWrapper,
|
|
3519
|
+
ns as DARK_THEME,
|
|
3508
3520
|
D2 as DEFAULT_IMAGE_KEYMAP,
|
|
3509
3521
|
lt as DecorationSet,
|
|
3510
|
-
|
|
3511
|
-
|
|
3522
|
+
tn as EditorState,
|
|
3523
|
+
Bn as EventBus,
|
|
3512
3524
|
et as EventKey,
|
|
3513
3525
|
a14 as FONT_LOCALES,
|
|
3514
3526
|
b16 as FONT_LOCALE_EN,
|
|
3515
3527
|
a15 as FONT_SIZE_LOCALES,
|
|
3516
3528
|
b17 as FONT_SIZE_LOCALE_EN,
|
|
3517
|
-
|
|
3518
|
-
|
|
3529
|
+
Sn as FileHandlerRegistry,
|
|
3530
|
+
wt as FontPlugin,
|
|
3519
3531
|
Et as FontSizePlugin,
|
|
3520
3532
|
Rt as GapCursorPlugin,
|
|
3521
3533
|
a6 as HEADING_LOCALES,
|
|
@@ -3527,42 +3539,42 @@ export {
|
|
|
3527
3539
|
Ye as HardBreakPlugin,
|
|
3528
3540
|
ft as HeadingPlugin,
|
|
3529
3541
|
Ct as HighlightPlugin,
|
|
3530
|
-
|
|
3542
|
+
cn as HistoryManager,
|
|
3531
3543
|
bt as HorizontalRulePlugin,
|
|
3532
3544
|
a19 as IMAGE_LOCALES,
|
|
3533
3545
|
b21 as IMAGE_LOCALE_EN,
|
|
3534
3546
|
c9 as IMAGE_UPLOAD_SERVICE,
|
|
3535
3547
|
At as ImagePlugin,
|
|
3536
|
-
|
|
3537
|
-
|
|
3538
|
-
|
|
3548
|
+
bn as InputRuleRegistry,
|
|
3549
|
+
vn as KeymapRegistry,
|
|
3550
|
+
ts as LIGHT_THEME,
|
|
3539
3551
|
a7 as LINK_LOCALES,
|
|
3540
3552
|
b9 as LINK_LOCALE_EN,
|
|
3541
3553
|
a8 as LIST_LOCALES,
|
|
3542
3554
|
b10 as LIST_LOCALE_EN,
|
|
3543
3555
|
gt as LinkPlugin,
|
|
3544
3556
|
mt as ListPlugin,
|
|
3545
|
-
|
|
3557
|
+
hs as Locale,
|
|
3546
3558
|
st as LocaleService,
|
|
3547
3559
|
rt as LocaleServiceKey,
|
|
3548
|
-
|
|
3549
|
-
|
|
3550
|
-
|
|
3551
|
-
|
|
3552
|
-
|
|
3553
|
-
|
|
3554
|
-
|
|
3555
|
-
|
|
3556
|
-
|
|
3557
|
-
|
|
3560
|
+
En as NodeViewRegistry,
|
|
3561
|
+
nr as NotectlEditor,
|
|
3562
|
+
Wn as PAPER_MARGIN_HORIZONTAL_PX,
|
|
3563
|
+
Un as PAPER_MARGIN_TOP_PX,
|
|
3564
|
+
Vn as PAPER_VIEWPORT_PADDING_PX,
|
|
3565
|
+
_n as PRINT_LOCALES,
|
|
3566
|
+
Pn as PRINT_LOCALE_EN,
|
|
3567
|
+
Jn as PRINT_SERVICE_KEY,
|
|
3568
|
+
zn as PaperSize,
|
|
3569
|
+
On as PluginManager,
|
|
3558
3570
|
P as PopupManager,
|
|
3559
3571
|
b5 as PopupServiceKey,
|
|
3560
|
-
|
|
3572
|
+
Zn as PrintPlugin,
|
|
3561
3573
|
a10 as STRIKETHROUGH_LOCALES,
|
|
3562
3574
|
b12 as STRIKETHROUGH_LOCALE_EN,
|
|
3563
3575
|
a18 as SUPER_SUB_LOCALES,
|
|
3564
3576
|
b20 as SUPER_SUB_LOCALE_EN,
|
|
3565
|
-
|
|
3577
|
+
zt as SchemaRegistry,
|
|
3566
3578
|
tt as ServiceKey,
|
|
3567
3579
|
kt as StrikethroughPlugin,
|
|
3568
3580
|
Tt as SuperSubPlugin,
|
|
@@ -3583,46 +3595,46 @@ export {
|
|
|
3583
3595
|
d2 as TOOLBAR_LOCALE_EN,
|
|
3584
3596
|
xt as TablePlugin,
|
|
3585
3597
|
j4 as TableSelectionServiceKey,
|
|
3586
|
-
|
|
3598
|
+
St as TextAlignmentPlugin,
|
|
3587
3599
|
vt as TextColorPlugin,
|
|
3588
3600
|
pt as TextFormattingPlugin,
|
|
3589
|
-
|
|
3601
|
+
es as ThemePreset,
|
|
3590
3602
|
e3 as ToolbarOverflowBehavior,
|
|
3591
3603
|
it as ToolbarPlugin,
|
|
3592
|
-
|
|
3604
|
+
xn as ToolbarRegistry,
|
|
3593
3605
|
a2 as ToolbarServiceKey,
|
|
3594
|
-
|
|
3595
|
-
|
|
3606
|
+
en as TransactionBuilder,
|
|
3607
|
+
ds as VALID_ALIGNMENTS,
|
|
3596
3608
|
a3 as appendToRoot,
|
|
3597
3609
|
a20 as applyAttributedMark,
|
|
3598
|
-
|
|
3599
|
-
|
|
3600
|
-
|
|
3601
|
-
|
|
3610
|
+
Xt as applyStep,
|
|
3611
|
+
Nn as attachGridKeyboard,
|
|
3612
|
+
In as attachListboxKeyboard,
|
|
3613
|
+
Mn as attachMenuKeyboard,
|
|
3602
3614
|
ye as blockId,
|
|
3603
3615
|
v as blockOffsetToTextOffset,
|
|
3604
|
-
|
|
3616
|
+
jt as canContain,
|
|
3605
3617
|
c10 as canCrossBlockBoundary,
|
|
3606
3618
|
c3 as commandName,
|
|
3607
|
-
|
|
3619
|
+
we as createBlockElement,
|
|
3608
3620
|
_ as createBlockNode,
|
|
3609
3621
|
re as createCollapsedSelection,
|
|
3610
3622
|
W as createDocument,
|
|
3611
|
-
|
|
3612
|
-
|
|
3623
|
+
sr as createEditor,
|
|
3624
|
+
ir as createFullPreset,
|
|
3613
3625
|
j2 as createGapCursor,
|
|
3614
3626
|
X as createInlineNode,
|
|
3615
|
-
|
|
3627
|
+
rr as createMinimalPreset,
|
|
3616
3628
|
se as createNodeSelection,
|
|
3617
3629
|
ce as createPosition,
|
|
3618
3630
|
ae as createSelection,
|
|
3619
3631
|
T as createTextNode,
|
|
3620
|
-
|
|
3621
|
-
|
|
3632
|
+
ss as createTheme,
|
|
3633
|
+
ls as createThemeStyleSheet,
|
|
3622
3634
|
pe as defaultSchema,
|
|
3623
|
-
|
|
3635
|
+
hn as deleteBackward,
|
|
3624
3636
|
Ve as deleteBackwardAtGap,
|
|
3625
|
-
|
|
3637
|
+
dn as deleteForward,
|
|
3626
3638
|
Ge as deleteForwardAtGap,
|
|
3627
3639
|
ze as deleteNodeSelection,
|
|
3628
3640
|
je as deleteSelectionCommand,
|
|
@@ -3650,7 +3662,7 @@ export {
|
|
|
3650
3662
|
f3 as forEachBlockInRange,
|
|
3651
3663
|
xe as formatHTML,
|
|
3652
3664
|
ut as formatShortcut,
|
|
3653
|
-
|
|
3665
|
+
cs as generateThemeCSS,
|
|
3654
3666
|
J as getBlockChildren,
|
|
3655
3667
|
O as getBlockLength,
|
|
3656
3668
|
K as getBlockMarksAtOffset,
|
|
@@ -3660,8 +3672,8 @@ export {
|
|
|
3660
3672
|
U as getContentAtOffset,
|
|
3661
3673
|
I as getInlineChildren,
|
|
3662
3674
|
g3 as getMarkAttrAtSelection,
|
|
3663
|
-
|
|
3664
|
-
|
|
3675
|
+
qn as getPaperCSSSize,
|
|
3676
|
+
Fn as getPaperDimensions,
|
|
3665
3677
|
w as getTextChildren,
|
|
3666
3678
|
Ze as getTextDirection,
|
|
3667
3679
|
h as hasMark,
|
|
@@ -3669,9 +3681,9 @@ export {
|
|
|
3669
3681
|
ve as inlineType,
|
|
3670
3682
|
Je as insertHardBreakCommand,
|
|
3671
3683
|
qe as insertTextCommand,
|
|
3672
|
-
|
|
3673
|
-
|
|
3674
|
-
|
|
3684
|
+
Yt as invertStep,
|
|
3685
|
+
Zt as invertTransaction,
|
|
3686
|
+
an as isAllowedInReadonly,
|
|
3675
3687
|
i7 as isAttributedMarkActive,
|
|
3676
3688
|
S as isBlockNode,
|
|
3677
3689
|
le as isCollapsed,
|
|
@@ -3688,12 +3700,12 @@ export {
|
|
|
3688
3700
|
b as isMarkActive,
|
|
3689
3701
|
fe as isMarkAllowed,
|
|
3690
3702
|
i2 as isMarkOfType,
|
|
3691
|
-
|
|
3703
|
+
Se as isNodeOfType,
|
|
3692
3704
|
ie as isNodeSelection,
|
|
3693
|
-
|
|
3705
|
+
on as isSelectionOnlyTransaction,
|
|
3694
3706
|
R as isTextNode,
|
|
3695
3707
|
de as isTextSelection,
|
|
3696
|
-
|
|
3708
|
+
Gn as isValidPaperSize,
|
|
3697
3709
|
i8 as isVoidBlock,
|
|
3698
3710
|
b4 as isWebKit,
|
|
3699
3711
|
Q as markSetsEqual,
|
|
@@ -3720,23 +3732,23 @@ export {
|
|
|
3720
3732
|
n2 as nodeDecoration,
|
|
3721
3733
|
j3 as nodeSelTx,
|
|
3722
3734
|
ke as nodeType,
|
|
3723
|
-
|
|
3724
|
-
|
|
3735
|
+
pn as normalizeKeyDescriptor,
|
|
3736
|
+
ys as parseHTMLToDocument,
|
|
3725
3737
|
p2 as pluginId,
|
|
3726
3738
|
p3 as positionPopup,
|
|
3727
3739
|
E as prevGraphemeSize,
|
|
3728
|
-
|
|
3740
|
+
Kt as registerBuiltinSpecs,
|
|
3729
3741
|
r3 as removeAttributedMark,
|
|
3730
3742
|
r2 as renderColorGrid,
|
|
3731
3743
|
Te as resolveNodeByPath,
|
|
3732
3744
|
c4 as resolveParentByPath,
|
|
3733
3745
|
nt as resolvePluginLocale,
|
|
3734
|
-
|
|
3746
|
+
rs as resolveTheme,
|
|
3735
3747
|
me as schemaFromRegistry,
|
|
3736
3748
|
Fe as selectAll,
|
|
3737
3749
|
ue as selectionRange,
|
|
3738
3750
|
he as selectionsEqual,
|
|
3739
|
-
|
|
3751
|
+
us as serializeDocumentToHTML,
|
|
3740
3752
|
s2 as sharesParent,
|
|
3741
3753
|
Oe as skipInlineNode,
|
|
3742
3754
|
We as splitBlockCommand,
|
|
@@ -3744,7 +3756,7 @@ export {
|
|
|
3744
3756
|
c2 as toggleItalic,
|
|
3745
3757
|
e2 as toggleMark,
|
|
3746
3758
|
f as toggleUnderline,
|
|
3747
|
-
|
|
3759
|
+
$t as validateContent,
|
|
3748
3760
|
F as viewExtend,
|
|
3749
3761
|
G as viewMove,
|
|
3750
3762
|
w3 as walkNodes,
|