@aswin.dev/editor 0.6.3 → 0.7.0
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/AccessibilityPanel-CvQGLdu6.js +108 -0
- package/dist/AiChatSidebar-B3SJIKG_.js +229 -0
- package/dist/AiFeatureMenu-BLLKoOos.js +63 -0
- package/dist/BlockA11yBadge-CXDLqkcJ.js +34 -0
- package/dist/CloudEditor-BCz1ZTYC.js +1172 -0
- package/dist/CollaboratorBar-DuPYW5iF.js +95 -0
- package/dist/CommentsSidebar-B1pvJdqF.js +441 -0
- package/dist/CountdownBlock-BNSj1jvJ.js +92 -0
- package/dist/CountdownToolbar-ClJr2GzL.js +210 -0
- package/dist/DesignReferenceSidebar-B8V_F2yF.js +276 -0
- package/dist/LoadingTrack-B0CWFHXQ.js +10 -0
- package/dist/ModuleBrowserModal-DrUFMTDx.js +206 -0
- package/dist/ModulePreviewCanvas-CHdOwV_4.js +106 -0
- package/dist/NumberWithSuffix-DkXUez9t.js +422 -0
- package/dist/ParagraphEditor-D75wl3BX.js +695 -0
- package/dist/RichTextEditorContent-DYkIauIk.js +137 -0
- package/dist/SaveModuleDialog-FZ9lxY7_.js +123 -0
- package/dist/SnapshotHistory-BR3eV120.js +127 -0
- package/dist/TemplateScoringPanel-4GTNHej5.js +256 -0
- package/dist/TestEmailModal--ue5w9fT.js +94 -0
- package/dist/TitleEditor-fStSADI-.js +172 -0
- package/dist/TplModal-BwSfxIHf.js +44 -0
- package/dist/_plugin-vue_export-helper-B0hnzhyu.js +8 -0
- package/dist/accessibility-e8JYu_zd.js +27 -0
- package/dist/blockTypeIcons-BcTrDjmH.js +126 -0
- package/dist/bundle-stats.json +10 -0
- package/dist/cdn/chunks/AccessibilityPanel-B6DOjojm.js +97 -0
- package/dist/cdn/chunks/AccessibilityPanel-B6DOjojm.js.map +1 -0
- package/dist/cdn/chunks/AiFeatureMenu-qEdB2fZJ.js +59 -0
- package/dist/cdn/chunks/AiFeatureMenu-qEdB2fZJ.js.map +1 -0
- package/dist/cdn/chunks/BlockA11yBadge-DcEZftf6.js +33 -0
- package/dist/cdn/chunks/BlockA11yBadge-DcEZftf6.js.map +1 -0
- package/dist/cdn/chunks/CloudEditor-D2GsEC_n.js +1143 -0
- package/dist/cdn/chunks/CloudEditor-D2GsEC_n.js.map +1 -0
- package/dist/cdn/chunks/CollaboratorBar--nO7TX6b.js +51 -0
- package/dist/cdn/chunks/CollaboratorBar--nO7TX6b.js.map +1 -0
- package/dist/cdn/chunks/CountdownBlock-5YdT1uUu.js +93 -0
- package/dist/cdn/chunks/CountdownBlock-5YdT1uUu.js.map +1 -0
- package/dist/cdn/chunks/CountdownToolbar-DXPXrbAA.js +212 -0
- package/dist/cdn/chunks/CountdownToolbar-DXPXrbAA.js.map +1 -0
- package/dist/cdn/chunks/ModuleBrowserModal-DxoPp81s.js +195 -0
- package/dist/cdn/chunks/ModuleBrowserModal-DxoPp81s.js.map +1 -0
- package/dist/cdn/chunks/ModulePreviewCanvas-CoLdb4ar.js +107 -0
- package/dist/cdn/chunks/ModulePreviewCanvas-CoLdb4ar.js.map +1 -0
- package/dist/cdn/chunks/NumberWithSuffix-CE3NrZhH.js +423 -0
- package/dist/cdn/chunks/NumberWithSuffix-CE3NrZhH.js.map +1 -0
- package/dist/cdn/chunks/ParagraphEditor-B6Ygu-Mq.js +544 -0
- package/dist/cdn/chunks/ParagraphEditor-B6Ygu-Mq.js.map +1 -0
- package/dist/cdn/chunks/RichTextEditorContent-DL_y2SrR.js +106 -0
- package/dist/cdn/chunks/RichTextEditorContent-DL_y2SrR.js.map +1 -0
- package/dist/cdn/chunks/SaveModuleDialog-B0TnO_o9.js +119 -0
- package/dist/cdn/chunks/SaveModuleDialog-B0TnO_o9.js.map +1 -0
- package/dist/cdn/chunks/TitleEditor-BHpfxvwy.js +171 -0
- package/dist/cdn/chunks/TitleEditor-BHpfxvwy.js.map +1 -0
- package/dist/cdn/chunks/blockTypeIcons-BzzY9_kA.js +22 -0
- package/dist/cdn/chunks/blockTypeIcons-BzzY9_kA.js.map +1 -0
- package/dist/cdn/chunks/de-Ce-LbJ2J.js +89 -0
- package/dist/cdn/chunks/de-Ce-LbJ2J.js.map +1 -0
- package/dist/cdn/chunks/de-D8CnZxV9.js +523 -0
- package/dist/cdn/chunks/de-D8CnZxV9.js.map +1 -0
- package/dist/cdn/chunks/de-RQrZR56a.js +209 -0
- package/dist/cdn/chunks/de-RQrZR56a.js.map +1 -0
- package/dist/cdn/chunks/draggable-Bcb86AsV.js +11572 -0
- package/dist/cdn/chunks/draggable-Bcb86AsV.js.map +1 -0
- package/dist/cdn/chunks/emojiData-EMFlj6FJ.js +19 -0
- package/dist/cdn/chunks/emojiData-EMFlj6FJ.js.map +1 -0
- package/dist/cdn/chunks/en-8FHaQv4V.js +523 -0
- package/dist/cdn/chunks/en-8FHaQv4V.js.map +1 -0
- package/dist/cdn/chunks/en-Bl1ecfRF.js +209 -0
- package/dist/cdn/chunks/en-Bl1ecfRF.js.map +1 -0
- package/dist/cdn/chunks/en-DiCWK5fG.js +89 -0
- package/dist/cdn/chunks/en-DiCWK5fG.js.map +1 -0
- package/dist/cdn/chunks/extensions-DIxF31tA.js +598 -0
- package/dist/cdn/chunks/extensions-DIxF31tA.js.map +1 -0
- package/dist/cdn/chunks/features-DEMb13KS.js +6814 -0
- package/dist/cdn/chunks/features-DEMb13KS.js.map +1 -0
- package/dist/cdn/chunks/icons-CsLTcirh.js +700 -0
- package/dist/cdn/chunks/icons-CsLTcirh.js.map +1 -0
- package/dist/cdn/chunks/liquid.browser-lQbkge2E.js +3279 -0
- package/dist/cdn/chunks/liquid.browser-lQbkge2E.js.map +1 -0
- package/dist/cdn/chunks/media-library-CVaNvhpM.js +6014 -0
- package/dist/cdn/chunks/media-library-CVaNvhpM.js.map +1 -0
- package/dist/cdn/chunks/pusher-CDbNlZBE.js +2508 -0
- package/dist/cdn/chunks/pusher-CDbNlZBE.js.map +1 -0
- package/dist/cdn/chunks/quality-BaBfc54_.js +1456 -0
- package/dist/cdn/chunks/quality-BaBfc54_.js.map +1 -0
- package/dist/cdn/chunks/readableTextColor-DhoK4XiZ.js +32 -0
- package/dist/cdn/chunks/readableTextColor-DhoK4XiZ.js.map +1 -0
- package/dist/cdn/chunks/renderer-CUxvx7ro.js +548 -0
- package/dist/cdn/chunks/renderer-CUxvx7ro.js.map +1 -0
- package/dist/cdn/chunks/rolldown-runtime-BNuo_Jkg.js +20 -0
- package/dist/cdn/chunks/src-CRaqN-p8.js +497 -0
- package/dist/cdn/chunks/src-CRaqN-p8.js.map +1 -0
- package/dist/cdn/chunks/styleConstants-DP1VOca8.js +57 -0
- package/dist/cdn/chunks/styleConstants-DP1VOca8.js.map +1 -0
- package/dist/cdn/chunks/styles-BHJULjNR.js +2947 -0
- package/dist/cdn/chunks/styles-BHJULjNR.js.map +1 -0
- package/dist/cdn/chunks/tiptap-ZhwKyFp7.js +14654 -0
- package/dist/cdn/chunks/tiptap-ZhwKyFp7.js.map +1 -0
- package/dist/cdn/editor.css +2 -0
- package/dist/cdn/editor.js +250 -0
- package/dist/cdn/editor.js.map +1 -0
- package/dist/check-Da05j8yl.js +7 -0
- package/dist/chevron-down-R2uY34iD.js +7 -0
- package/dist/circle-alert-DZuGWPX-.js +25 -0
- package/dist/clock-CRp2sIub.js +12 -0
- package/dist/cloud-DEk_b4CR.js +1733 -0
- package/dist/createLucideIcon-C3pa2siy.js +43 -0
- package/dist/de-Brqvgr43.js +521 -0
- package/dist/de-DCaaCE5s.js +207 -0
- package/dist/dist-B1IR0bpH.js +326 -0
- package/dist/dist-BFawx6IS.js +519 -0
- package/dist/dist-BaQIYPsn.js +35 -0
- package/dist/dist-Cp0zXPAD.js +189 -0
- package/dist/dist-D6uC2xhi.js +5 -0
- package/dist/dist-D90y8dvT.js +2082 -0
- package/dist/dist-DDJIWTRY.js +776 -0
- package/dist/dist-DJmnUmW9.js +362 -0
- package/dist/dist-DjviJBCi.js +74 -0
- package/dist/dist-KoBJjK1G.js +61 -0
- package/dist/dist-aRzjfSRN.js +35 -0
- package/dist/dist-iLBdeBDR.js +10658 -0
- package/dist/dist-us-RpCWN.js +47 -0
- package/dist/dist-wzMIGj-D.js +5 -0
- package/dist/emojiData-PQyVa4bU.js +17 -0
- package/dist/en-DXCyK4-X.js +207 -0
- package/dist/en-WDVp87TE.js +521 -0
- package/dist/extensions-CUcl9Ok4.js +799 -0
- package/dist/formatRelativeTime-BOEf47hq.js +12 -0
- package/dist/image-up-MBZKKg9p.js +23 -0
- package/dist/index.d.ts +275 -0
- package/dist/info-CJEC7piy.js +19 -0
- package/dist/keys-ciNfSSGj.js +10 -0
- package/dist/liquid.browser-CdMv1BTn.js +3277 -0
- package/dist/loader-circle-DsY5Yg33.js +7 -0
- package/dist/message-circle-yElBbR2C.js +7 -0
- package/dist/readableTextColor-CY3SiRnt.js +30 -0
- package/dist/refresh-cw-CE_AGtn8.js +29 -0
- package/dist/rolldown-runtime-BZGGJVDF.js +20 -0
- package/dist/scan-line-D0vcUekt.js +25 -0
- package/dist/send-DH4oDQqC.js +10 -0
- package/dist/shield-check-CfJgs2Hd.js +10 -0
- package/dist/sparkles-CvRXGqFs.js +23 -0
- package/dist/style.css +2 -0
- package/dist/styleConstants-fWzlIIwN.js +55 -0
- package/dist/styles-DEXEkBvg.js +3176 -0
- package/dist/templatical-editor.js +249 -0
- package/dist/text-align-start-BT9VUDxK.js +43 -0
- package/dist/timeouts-BSGxjuUF.js +4 -0
- package/dist/trash-2-DbP2Y6t2.js +25 -0
- package/dist/triangle-alert-aOXceTSe.js +17 -0
- package/dist/useCloudI18n-BuIwR6OE.js +23 -0
- package/dist/useEditorCore-C6ost42Q.js +9342 -0
- package/dist/useI18n-lb2DHDiu.js +17 -0
- package/dist/useMergeTag-CBwKnnNB.js +34 -0
- package/dist/vue.runtime.esm-bundler-DpvJL-nX.js +5775 -0
- package/dist/x-u2oVmjN_.js +10 -0
- package/package.json +1 -1
|
@@ -0,0 +1,519 @@
|
|
|
1
|
+
import { r as e } from "./rolldown-runtime-BZGGJVDF.js";
|
|
2
|
+
import { A as t, B as n, C as r, J as i, N as a, O as o, Q as s, S as c, W as ee, X as te, et as ne, i as l, it as re, k as u, tt as d, w as f } from "./vue.runtime.esm-bundler-DpvJL-nX.js";
|
|
3
|
+
import { $ as ie, $t as ae, A as oe, At as se, B as ce, Bt as le, C as ue, Ct as de, D as fe, Dt as p, E as m, Et as h, F as g, Ft as _, G as v, Gt as y, H as b, Ht as x, I as S, It as C, J as w, Jt as T, K as E, Kt as D, L as O, Lt as k, M as A, Mt as j, N as M, Nt as N, O as P, Ot as F, P as I, Pt as L, Q as R, Qt as z, R as B, Rt as V, S as pe, St as me, T as he, Tt as ge, U as _e, Ut as ve, V as ye, Vt as be, W as xe, Wt as Se, X as Ce, Xt as we, Y as Te, Yt as Ee, Z as De, Zt as Oe, _ as ke, _t as H, a as Ae, an as je, at as Me, b as Ne, bt as Pe, c as Fe, cn as Ie, ct as Le, d as Re, dn as ze, dt as Be, en as Ve, et as He, f as U, fn as Ue, ft as We, g as Ge, gt as W, h as Ke, hn as qe, ht as Je, i as Ye, in as Xe, it as Ze, j as Qe, jt as $e, k as et, kt as tt, l as G, ln as nt, lt as rt, m as it, mn as at, mt as ot, n as st, nn as ct, nt as lt, o as ut, on as K, ot as dt, p as ft, pn as pt, pt as mt, q as ht, qt as gt, r as _t, rn as vt, rt as yt, s as bt, sn as xt, st as St, t as Ct, tn as wt, tt as Tt, u as Et, un as Dt, ut as Ot, v as kt, vt as At, w as jt, wt as Mt, x as Nt, xt as Pt, y as q, yt as Ft, z as It, zt as Lt } from "./dist-iLBdeBDR.js";
|
|
4
|
+
//#region ../../node_modules/.pnpm/@tiptap+vue-3@3.22.5_@floating-ui+dom@1.7.6_@tiptap+core@3.22.5_@tiptap+pm@3.22.5__@tip_7097ea972d8e6e4e31801879e2c3d1b4/node_modules/@tiptap/vue-3/dist/index.js
|
|
5
|
+
var Rt = /* @__PURE__ */ e({
|
|
6
|
+
CommandManager: () => Ct,
|
|
7
|
+
Editor: () => Y,
|
|
8
|
+
EditorContent: () => zt,
|
|
9
|
+
Extendable: () => _t,
|
|
10
|
+
Extension: () => Ye,
|
|
11
|
+
Fragment: () => Ae,
|
|
12
|
+
InputRule: () => ut,
|
|
13
|
+
MappablePosition: () => bt,
|
|
14
|
+
Mark: () => Fe,
|
|
15
|
+
MarkView: () => G,
|
|
16
|
+
MarkViewContent: () => Ut,
|
|
17
|
+
Node: () => Et,
|
|
18
|
+
NodePos: () => Re,
|
|
19
|
+
NodeView: () => U,
|
|
20
|
+
NodeViewContent: () => Bt,
|
|
21
|
+
NodeViewWrapper: () => X,
|
|
22
|
+
PasteRule: () => ft,
|
|
23
|
+
ResizableNodeView: () => it,
|
|
24
|
+
ResizableNodeview: () => Ke,
|
|
25
|
+
Tracker: () => Ge,
|
|
26
|
+
VueMarkView: () => Q,
|
|
27
|
+
VueMarkViewRenderer: () => Wt,
|
|
28
|
+
VueNodeViewRenderer: () => $,
|
|
29
|
+
VueRenderer: () => Z,
|
|
30
|
+
callOrReturn: () => ke,
|
|
31
|
+
canInsertNode: () => kt,
|
|
32
|
+
cancelPositionCheck: () => q,
|
|
33
|
+
combineTransactionSteps: () => Ne,
|
|
34
|
+
commands: () => Nt,
|
|
35
|
+
createAtomBlockMarkdownSpec: () => pe,
|
|
36
|
+
createBlockMarkdownSpec: () => ue,
|
|
37
|
+
createChainableState: () => jt,
|
|
38
|
+
createDocument: () => he,
|
|
39
|
+
createElement: () => H,
|
|
40
|
+
createInlineMarkdownSpec: () => m,
|
|
41
|
+
createMappablePosition: () => fe,
|
|
42
|
+
createNodeFromContent: () => P,
|
|
43
|
+
createStyleTag: () => et,
|
|
44
|
+
decodeHtmlEntities: () => oe,
|
|
45
|
+
defaultBlockAt: () => Qe,
|
|
46
|
+
deleteProps: () => A,
|
|
47
|
+
elementFromString: () => M,
|
|
48
|
+
encodeHtmlEntities: () => I,
|
|
49
|
+
escapeForRegEx: () => g,
|
|
50
|
+
extensions: () => S,
|
|
51
|
+
findChildren: () => O,
|
|
52
|
+
findChildrenInRange: () => B,
|
|
53
|
+
findDuplicates: () => It,
|
|
54
|
+
findParentNode: () => ce,
|
|
55
|
+
findParentNodeClosestToPos: () => ye,
|
|
56
|
+
flattenExtensions: () => b,
|
|
57
|
+
fromString: () => _e,
|
|
58
|
+
generateHTML: () => xe,
|
|
59
|
+
generateJSON: () => v,
|
|
60
|
+
generateText: () => E,
|
|
61
|
+
getAttributes: () => ht,
|
|
62
|
+
getAttributesFromExtensions: () => w,
|
|
63
|
+
getChangedRanges: () => Te,
|
|
64
|
+
getDebugJSON: () => Ce,
|
|
65
|
+
getExtensionField: () => De,
|
|
66
|
+
getHTMLFromFragment: () => R,
|
|
67
|
+
getMarkAttributes: () => ie,
|
|
68
|
+
getMarkRange: () => He,
|
|
69
|
+
getMarkType: () => Tt,
|
|
70
|
+
getMarksBetween: () => lt,
|
|
71
|
+
getNodeAtPosition: () => yt,
|
|
72
|
+
getNodeAttributes: () => Ze,
|
|
73
|
+
getNodeType: () => Me,
|
|
74
|
+
getRenderedAttributes: () => dt,
|
|
75
|
+
getSchema: () => St,
|
|
76
|
+
getSchemaByResolvedExtensions: () => Le,
|
|
77
|
+
getSchemaTypeByName: () => rt,
|
|
78
|
+
getSchemaTypeNameByName: () => Ot,
|
|
79
|
+
getSplittedAttributes: () => Be,
|
|
80
|
+
getText: () => We,
|
|
81
|
+
getTextBetween: () => mt,
|
|
82
|
+
getTextContentFromNodes: () => ot,
|
|
83
|
+
getTextSerializersFromSchema: () => Je,
|
|
84
|
+
getUpdatedPosition: () => W,
|
|
85
|
+
h: () => H,
|
|
86
|
+
injectExtensionAttributesToParseRule: () => At,
|
|
87
|
+
inputRulesPlugin: () => Ft,
|
|
88
|
+
isActive: () => Pe,
|
|
89
|
+
isAndroid: () => Pt,
|
|
90
|
+
isAtEndOfNode: () => me,
|
|
91
|
+
isAtStartOfNode: () => de,
|
|
92
|
+
isEmptyObject: () => Mt,
|
|
93
|
+
isExtensionRulesEnabled: () => ge,
|
|
94
|
+
isFirefox: () => h,
|
|
95
|
+
isFunction: () => p,
|
|
96
|
+
isList: () => F,
|
|
97
|
+
isMacOS: () => tt,
|
|
98
|
+
isMarkActive: () => se,
|
|
99
|
+
isNodeActive: () => $e,
|
|
100
|
+
isNodeEmpty: () => j,
|
|
101
|
+
isNodeSelection: () => N,
|
|
102
|
+
isNodeViewSelected: () => L,
|
|
103
|
+
isNumber: () => _,
|
|
104
|
+
isPlainObject: () => C,
|
|
105
|
+
isRegExp: () => k,
|
|
106
|
+
isSafari: () => V,
|
|
107
|
+
isString: () => Lt,
|
|
108
|
+
isTextSelection: () => le,
|
|
109
|
+
isiOS: () => be,
|
|
110
|
+
markInputRule: () => x,
|
|
111
|
+
markPasteRule: () => ve,
|
|
112
|
+
markViewProps: () => Ht,
|
|
113
|
+
markdown: () => Se,
|
|
114
|
+
mergeAttributes: () => y,
|
|
115
|
+
mergeDeep: () => D,
|
|
116
|
+
minMax: () => gt,
|
|
117
|
+
nodeInputRule: () => T,
|
|
118
|
+
nodePasteRule: () => Ee,
|
|
119
|
+
nodeViewProps: () => Gt,
|
|
120
|
+
objectIncludes: () => we,
|
|
121
|
+
parseAttributes: () => Oe,
|
|
122
|
+
parseIndentedBlocks: () => z,
|
|
123
|
+
pasteRulesPlugin: () => ae,
|
|
124
|
+
posToDOMRect: () => Ve,
|
|
125
|
+
removeDuplicates: () => wt,
|
|
126
|
+
renderNestedMarkdownContent: () => ct,
|
|
127
|
+
resolveExtensions: () => vt,
|
|
128
|
+
resolveFocusPosition: () => Xe,
|
|
129
|
+
rewriteUnknownContent: () => je,
|
|
130
|
+
schedulePositionCheck: () => K,
|
|
131
|
+
selectionToInsertionEnd: () => xt,
|
|
132
|
+
serializeAttributes: () => Ie,
|
|
133
|
+
sortExtensions: () => nt,
|
|
134
|
+
splitExtensions: () => Dt,
|
|
135
|
+
textInputRule: () => ze,
|
|
136
|
+
textPasteRule: () => Ue,
|
|
137
|
+
textblockTypeInputRule: () => pt,
|
|
138
|
+
updateMarkViewAttributes: () => at,
|
|
139
|
+
useEditor: () => Vt,
|
|
140
|
+
wrappingInputRule: () => qe
|
|
141
|
+
});
|
|
142
|
+
function J(e) {
|
|
143
|
+
return ee((t, n) => ({
|
|
144
|
+
get() {
|
|
145
|
+
return t(), e;
|
|
146
|
+
},
|
|
147
|
+
set(t) {
|
|
148
|
+
e = t, requestAnimationFrame(() => {
|
|
149
|
+
requestAnimationFrame(() => {
|
|
150
|
+
n();
|
|
151
|
+
});
|
|
152
|
+
});
|
|
153
|
+
}
|
|
154
|
+
}));
|
|
155
|
+
}
|
|
156
|
+
var Y = class extends st {
|
|
157
|
+
constructor(e = {}) {
|
|
158
|
+
return super(e), this.contentComponent = null, this.appContext = null, this.reactiveState = J(this.view.state), this.reactiveExtensionStorage = J(this.extensionStorage), this.on("beforeTransaction", ({ nextState: e }) => {
|
|
159
|
+
this.reactiveState.value = e, this.reactiveExtensionStorage.value = this.extensionStorage;
|
|
160
|
+
}), i(this);
|
|
161
|
+
}
|
|
162
|
+
get state() {
|
|
163
|
+
return this.reactiveState ? this.reactiveState.value : this.view.state;
|
|
164
|
+
}
|
|
165
|
+
get storage() {
|
|
166
|
+
return this.reactiveExtensionStorage ? this.reactiveExtensionStorage.value : super.storage;
|
|
167
|
+
}
|
|
168
|
+
registerPlugin(e, t) {
|
|
169
|
+
let n = super.registerPlugin(e, t);
|
|
170
|
+
return this.reactiveState && (this.reactiveState.value = n), n;
|
|
171
|
+
}
|
|
172
|
+
unregisterPlugin(e) {
|
|
173
|
+
let t = super.unregisterPlugin(e);
|
|
174
|
+
return this.reactiveState && t && (this.reactiveState.value = t), t;
|
|
175
|
+
}
|
|
176
|
+
}, zt = c({
|
|
177
|
+
name: "EditorContent",
|
|
178
|
+
props: { editor: {
|
|
179
|
+
default: null,
|
|
180
|
+
type: Object
|
|
181
|
+
} },
|
|
182
|
+
setup(e) {
|
|
183
|
+
let t = s(), i = r();
|
|
184
|
+
return n(() => {
|
|
185
|
+
let n = e.editor;
|
|
186
|
+
n && n.options.element && t.value && o(() => {
|
|
187
|
+
if (!t.value || !n.view.dom?.parentNode) return;
|
|
188
|
+
let e = re(t.value);
|
|
189
|
+
t.value.append(...n.view.dom.parentNode.childNodes), n.contentComponent = i.ctx._, i && (n.appContext = {
|
|
190
|
+
...i.appContext,
|
|
191
|
+
provides: i.provides
|
|
192
|
+
}), n.setOptions({ element: e }), n.createNodeViews();
|
|
193
|
+
});
|
|
194
|
+
}), u(() => {
|
|
195
|
+
let t = e.editor;
|
|
196
|
+
t && (t.contentComponent = null, t.appContext = null);
|
|
197
|
+
}), { rootEl: t };
|
|
198
|
+
},
|
|
199
|
+
render() {
|
|
200
|
+
return f("div", { ref: (e) => {
|
|
201
|
+
this.rootEl = e;
|
|
202
|
+
} });
|
|
203
|
+
}
|
|
204
|
+
}), Bt = c({
|
|
205
|
+
name: "NodeViewContent",
|
|
206
|
+
props: { as: {
|
|
207
|
+
type: String,
|
|
208
|
+
default: "div"
|
|
209
|
+
} },
|
|
210
|
+
render() {
|
|
211
|
+
return f(this.as, {
|
|
212
|
+
style: { whiteSpace: "pre-wrap" },
|
|
213
|
+
"data-node-view-content": ""
|
|
214
|
+
});
|
|
215
|
+
}
|
|
216
|
+
}), X = c({
|
|
217
|
+
name: "NodeViewWrapper",
|
|
218
|
+
props: { as: {
|
|
219
|
+
type: String,
|
|
220
|
+
default: "div"
|
|
221
|
+
} },
|
|
222
|
+
inject: ["onDragStart", "decorationClasses"],
|
|
223
|
+
render() {
|
|
224
|
+
var e;
|
|
225
|
+
return f(this.as, {
|
|
226
|
+
class: this.decorationClasses,
|
|
227
|
+
style: { whiteSpace: "normal" },
|
|
228
|
+
"data-node-view-wrapper": "",
|
|
229
|
+
onDragstart: this.onDragStart
|
|
230
|
+
}, (e = this.$slots).default?.call(e));
|
|
231
|
+
}
|
|
232
|
+
}), Vt = (e = {}) => {
|
|
233
|
+
let n = ne();
|
|
234
|
+
return t(() => {
|
|
235
|
+
n.value = new Y(e);
|
|
236
|
+
}), u(() => {
|
|
237
|
+
var e, t;
|
|
238
|
+
let r = n.value?.view.dom?.parentNode, i = r?.cloneNode(!0);
|
|
239
|
+
(e = r?.parentNode) == null || e.replaceChild(i, r), (t = n.value) == null || t.destroy();
|
|
240
|
+
}), n;
|
|
241
|
+
}, Z = class {
|
|
242
|
+
constructor(e, { props: t = {}, editor: n }) {
|
|
243
|
+
this.destroyed = !1, this.editor = n, this.component = i(e), this.el = document.createElement("div"), this.props = te(t), this.renderedComponent = this.renderComponent();
|
|
244
|
+
}
|
|
245
|
+
get element() {
|
|
246
|
+
return this.renderedComponent.el;
|
|
247
|
+
}
|
|
248
|
+
get ref() {
|
|
249
|
+
return this.renderedComponent.vNode?.component?.exposed ? this.renderedComponent.vNode.component.exposed : this.renderedComponent.vNode?.component?.proxy;
|
|
250
|
+
}
|
|
251
|
+
renderComponent() {
|
|
252
|
+
if (this.destroyed) return this.renderedComponent;
|
|
253
|
+
let e = f(this.component, this.props);
|
|
254
|
+
return this.editor.appContext && (e.appContext = this.editor.appContext), typeof document < "u" && this.el && l(e, this.el), {
|
|
255
|
+
vNode: e,
|
|
256
|
+
destroy: () => {
|
|
257
|
+
this.el && l(null, this.el), this.el = null, e = null;
|
|
258
|
+
},
|
|
259
|
+
el: this.el ? this.el.firstElementChild : null
|
|
260
|
+
};
|
|
261
|
+
}
|
|
262
|
+
updateProps(e = {}) {
|
|
263
|
+
this.destroyed || (Object.entries(e).forEach(([e, t]) => {
|
|
264
|
+
this.props[e] = t;
|
|
265
|
+
}), this.renderComponent());
|
|
266
|
+
}
|
|
267
|
+
destroy() {
|
|
268
|
+
this.destroyed || (this.destroyed = !0, this.renderedComponent.destroy());
|
|
269
|
+
}
|
|
270
|
+
}, Ht = {
|
|
271
|
+
editor: {
|
|
272
|
+
type: Object,
|
|
273
|
+
required: !0
|
|
274
|
+
},
|
|
275
|
+
mark: {
|
|
276
|
+
type: Object,
|
|
277
|
+
required: !0
|
|
278
|
+
},
|
|
279
|
+
extension: {
|
|
280
|
+
type: Object,
|
|
281
|
+
required: !0
|
|
282
|
+
},
|
|
283
|
+
inline: {
|
|
284
|
+
type: Boolean,
|
|
285
|
+
required: !0
|
|
286
|
+
},
|
|
287
|
+
view: {
|
|
288
|
+
type: Object,
|
|
289
|
+
required: !0
|
|
290
|
+
},
|
|
291
|
+
updateAttributes: {
|
|
292
|
+
type: Function,
|
|
293
|
+
required: !0
|
|
294
|
+
},
|
|
295
|
+
HTMLAttributes: {
|
|
296
|
+
type: Object,
|
|
297
|
+
required: !0
|
|
298
|
+
}
|
|
299
|
+
}, Ut = c({
|
|
300
|
+
name: "MarkViewContent",
|
|
301
|
+
props: { as: {
|
|
302
|
+
type: String,
|
|
303
|
+
default: "span"
|
|
304
|
+
} },
|
|
305
|
+
render() {
|
|
306
|
+
return f(this.as, {
|
|
307
|
+
style: { whiteSpace: "inherit" },
|
|
308
|
+
"data-mark-view-content": ""
|
|
309
|
+
});
|
|
310
|
+
}
|
|
311
|
+
}), Q = class extends G {
|
|
312
|
+
constructor(e, t, n) {
|
|
313
|
+
super(e, t, n);
|
|
314
|
+
let r = {
|
|
315
|
+
...t,
|
|
316
|
+
updateAttributes: this.updateAttributes.bind(this)
|
|
317
|
+
}, i = c({
|
|
318
|
+
extends: { ...e },
|
|
319
|
+
props: Object.keys(r),
|
|
320
|
+
template: this.component.template,
|
|
321
|
+
setup: (t) => e.setup?.call(e, t, { expose: () => void 0 }),
|
|
322
|
+
__scopeId: e.__scopeId,
|
|
323
|
+
__cssModules: e.__cssModules,
|
|
324
|
+
__name: e.__name,
|
|
325
|
+
__file: e.__file
|
|
326
|
+
});
|
|
327
|
+
this.renderer = new Z(i, {
|
|
328
|
+
editor: this.editor,
|
|
329
|
+
props: r
|
|
330
|
+
});
|
|
331
|
+
}
|
|
332
|
+
get dom() {
|
|
333
|
+
return this.renderer.element;
|
|
334
|
+
}
|
|
335
|
+
get contentDOM() {
|
|
336
|
+
return this.dom.querySelector("[data-mark-view-content]");
|
|
337
|
+
}
|
|
338
|
+
updateAttributes(e) {
|
|
339
|
+
let t = d(this.mark);
|
|
340
|
+
super.updateAttributes(e, t);
|
|
341
|
+
}
|
|
342
|
+
destroy() {
|
|
343
|
+
this.renderer.destroy();
|
|
344
|
+
}
|
|
345
|
+
};
|
|
346
|
+
function Wt(e, t = {}) {
|
|
347
|
+
return (n) => n.editor.contentComponent ? new Q(e, n, t) : {};
|
|
348
|
+
}
|
|
349
|
+
var Gt = {
|
|
350
|
+
editor: {
|
|
351
|
+
type: Object,
|
|
352
|
+
required: !0
|
|
353
|
+
},
|
|
354
|
+
node: {
|
|
355
|
+
type: Object,
|
|
356
|
+
required: !0
|
|
357
|
+
},
|
|
358
|
+
decorations: {
|
|
359
|
+
type: Object,
|
|
360
|
+
required: !0
|
|
361
|
+
},
|
|
362
|
+
selected: {
|
|
363
|
+
type: Boolean,
|
|
364
|
+
required: !0
|
|
365
|
+
},
|
|
366
|
+
extension: {
|
|
367
|
+
type: Object,
|
|
368
|
+
required: !0
|
|
369
|
+
},
|
|
370
|
+
getPos: {
|
|
371
|
+
type: Function,
|
|
372
|
+
required: !0
|
|
373
|
+
},
|
|
374
|
+
updateAttributes: {
|
|
375
|
+
type: Function,
|
|
376
|
+
required: !0
|
|
377
|
+
},
|
|
378
|
+
deleteNode: {
|
|
379
|
+
type: Function,
|
|
380
|
+
required: !0
|
|
381
|
+
},
|
|
382
|
+
view: {
|
|
383
|
+
type: Object,
|
|
384
|
+
required: !0
|
|
385
|
+
},
|
|
386
|
+
innerDecorations: {
|
|
387
|
+
type: Object,
|
|
388
|
+
required: !0
|
|
389
|
+
},
|
|
390
|
+
HTMLAttributes: {
|
|
391
|
+
type: Object,
|
|
392
|
+
required: !0
|
|
393
|
+
}
|
|
394
|
+
}, Kt = class extends U {
|
|
395
|
+
constructor() {
|
|
396
|
+
super(...arguments), this.positionCheckCallback = null, this.cachedExtensionWithSyncedStorage = null;
|
|
397
|
+
}
|
|
398
|
+
get extensionWithSyncedStorage() {
|
|
399
|
+
if (!this.cachedExtensionWithSyncedStorage) {
|
|
400
|
+
let e = this.editor, t = this.extension;
|
|
401
|
+
this.cachedExtensionWithSyncedStorage = new Proxy(t, { get(n, r, i) {
|
|
402
|
+
return r === "storage" ? e.storage[t.name] ?? {} : Reflect.get(n, r, i);
|
|
403
|
+
} });
|
|
404
|
+
}
|
|
405
|
+
return this.cachedExtensionWithSyncedStorage;
|
|
406
|
+
}
|
|
407
|
+
mount() {
|
|
408
|
+
let e = {
|
|
409
|
+
editor: this.editor,
|
|
410
|
+
node: this.node,
|
|
411
|
+
decorations: this.decorations,
|
|
412
|
+
innerDecorations: this.innerDecorations,
|
|
413
|
+
view: this.view,
|
|
414
|
+
selected: !1,
|
|
415
|
+
extension: this.extensionWithSyncedStorage,
|
|
416
|
+
HTMLAttributes: this.HTMLAttributes,
|
|
417
|
+
getPos: () => this.getPos(),
|
|
418
|
+
updateAttributes: (e = {}) => this.updateAttributes(e),
|
|
419
|
+
deleteNode: () => this.deleteNode()
|
|
420
|
+
}, t = this.onDragStart.bind(this);
|
|
421
|
+
this.decorationClasses = s(this.getDecorationClasses());
|
|
422
|
+
let n = c({
|
|
423
|
+
extends: { ...this.component },
|
|
424
|
+
props: Object.keys(e),
|
|
425
|
+
template: this.component.template,
|
|
426
|
+
setup: (e) => {
|
|
427
|
+
var n;
|
|
428
|
+
return a("onDragStart", t), a("decorationClasses", this.decorationClasses), (n = this.component).setup?.call(n, e, { expose: () => void 0 });
|
|
429
|
+
},
|
|
430
|
+
__scopeId: this.component.__scopeId,
|
|
431
|
+
__cssModules: this.component.__cssModules,
|
|
432
|
+
__name: this.component.__name,
|
|
433
|
+
__file: this.component.__file
|
|
434
|
+
});
|
|
435
|
+
this.handleSelectionUpdate = this.handleSelectionUpdate.bind(this), this.editor.on("selectionUpdate", this.handleSelectionUpdate), this.currentPos = this.getPos(), this.positionCheckCallback = () => {
|
|
436
|
+
if (!this.renderer) return;
|
|
437
|
+
let e = this.getPos();
|
|
438
|
+
typeof e != "number" || e === this.currentPos || (this.currentPos = e, this.renderer.updateProps({ getPos: () => this.getPos() }));
|
|
439
|
+
}, K(this.editor, this.positionCheckCallback), this.renderer = new Z(n, {
|
|
440
|
+
editor: this.editor,
|
|
441
|
+
props: e
|
|
442
|
+
});
|
|
443
|
+
}
|
|
444
|
+
get dom() {
|
|
445
|
+
if (!this.renderer.element || !this.renderer.element.hasAttribute("data-node-view-wrapper")) throw Error("Please use the NodeViewWrapper component for your node view.");
|
|
446
|
+
return this.renderer.element;
|
|
447
|
+
}
|
|
448
|
+
get contentDOM() {
|
|
449
|
+
return this.node.isLeaf ? null : this.dom.querySelector("[data-node-view-content]");
|
|
450
|
+
}
|
|
451
|
+
handleSelectionUpdate() {
|
|
452
|
+
let e = this.getPos();
|
|
453
|
+
if (typeof e == "number") if (L({
|
|
454
|
+
selection: this.editor.state.selection,
|
|
455
|
+
pos: e,
|
|
456
|
+
nodeSize: this.node.nodeSize,
|
|
457
|
+
selectedOnTextSelection: this.options.selectedOnTextSelection
|
|
458
|
+
})) {
|
|
459
|
+
if (this.renderer.props.selected) return;
|
|
460
|
+
this.selectNode();
|
|
461
|
+
} else {
|
|
462
|
+
if (!this.renderer.props.selected) return;
|
|
463
|
+
this.deselectNode();
|
|
464
|
+
}
|
|
465
|
+
}
|
|
466
|
+
update(e, t, n) {
|
|
467
|
+
let r = (e) => {
|
|
468
|
+
this.decorationClasses.value = this.getDecorationClasses(), this.renderer.updateProps(e);
|
|
469
|
+
};
|
|
470
|
+
if (typeof this.options.update == "function") {
|
|
471
|
+
let i = this.node, a = this.decorations, o = this.innerDecorations;
|
|
472
|
+
return this.node = e, this.decorations = t, this.innerDecorations = n, this.currentPos = this.getPos(), this.options.update({
|
|
473
|
+
oldNode: i,
|
|
474
|
+
oldDecorations: a,
|
|
475
|
+
newNode: e,
|
|
476
|
+
newDecorations: t,
|
|
477
|
+
oldInnerDecorations: o,
|
|
478
|
+
innerDecorations: n,
|
|
479
|
+
updateProps: () => r({
|
|
480
|
+
node: e,
|
|
481
|
+
decorations: t,
|
|
482
|
+
innerDecorations: n,
|
|
483
|
+
extension: this.extensionWithSyncedStorage
|
|
484
|
+
})
|
|
485
|
+
});
|
|
486
|
+
}
|
|
487
|
+
if (e.type !== this.node.type) return !1;
|
|
488
|
+
let i = this.getPos();
|
|
489
|
+
return e === this.node && this.decorations === t && this.innerDecorations === n ? i === this.currentPos ? !0 : (this.currentPos = i, r({
|
|
490
|
+
node: e,
|
|
491
|
+
decorations: t,
|
|
492
|
+
innerDecorations: n,
|
|
493
|
+
extension: this.extensionWithSyncedStorage,
|
|
494
|
+
getPos: () => this.getPos()
|
|
495
|
+
}), !0) : (this.node = e, this.decorations = t, this.innerDecorations = n, this.currentPos = i, r({
|
|
496
|
+
node: e,
|
|
497
|
+
decorations: t,
|
|
498
|
+
innerDecorations: n,
|
|
499
|
+
extension: this.extensionWithSyncedStorage
|
|
500
|
+
}), !0);
|
|
501
|
+
}
|
|
502
|
+
selectNode() {
|
|
503
|
+
this.renderer.updateProps({ selected: !0 }), this.renderer.element && this.renderer.element.classList.add("ProseMirror-selectednode");
|
|
504
|
+
}
|
|
505
|
+
deselectNode() {
|
|
506
|
+
this.renderer.updateProps({ selected: !1 }), this.renderer.element && this.renderer.element.classList.remove("ProseMirror-selectednode");
|
|
507
|
+
}
|
|
508
|
+
getDecorationClasses() {
|
|
509
|
+
return this.decorations.flatMap((e) => e.type.attrs.class).join(" ");
|
|
510
|
+
}
|
|
511
|
+
destroy() {
|
|
512
|
+
this.renderer.destroy(), this.editor.off("selectionUpdate", this.handleSelectionUpdate), this.positionCheckCallback &&= (q(this.editor, this.positionCheckCallback), null);
|
|
513
|
+
}
|
|
514
|
+
};
|
|
515
|
+
function $(e, t) {
|
|
516
|
+
return (n) => n.editor.contentComponent ? new Kt(typeof e == "function" && "__vccOpts" in e ? e.__vccOpts : e, n, t) : {};
|
|
517
|
+
}
|
|
518
|
+
//#endregion
|
|
519
|
+
export { $ as n, Rt as r, X as t };
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import { Gt as e, c as t } from "./dist-iLBdeBDR.js";
|
|
2
|
+
//#region ../../node_modules/.pnpm/@tiptap+extension-subscript@3.22.5_@tiptap+core@3.22.5_@tiptap+pm@3.22.5__@tiptap+pm@3.22.5/node_modules/@tiptap/extension-subscript/dist/index.js
|
|
3
|
+
var n = t.create({
|
|
4
|
+
name: "subscript",
|
|
5
|
+
addOptions() {
|
|
6
|
+
return { HTMLAttributes: {} };
|
|
7
|
+
},
|
|
8
|
+
parseHTML() {
|
|
9
|
+
return [{ tag: "sub" }, {
|
|
10
|
+
style: "vertical-align",
|
|
11
|
+
getAttrs(e) {
|
|
12
|
+
return e === "sub" ? null : !1;
|
|
13
|
+
}
|
|
14
|
+
}];
|
|
15
|
+
},
|
|
16
|
+
renderHTML({ HTMLAttributes: t }) {
|
|
17
|
+
return [
|
|
18
|
+
"sub",
|
|
19
|
+
e(this.options.HTMLAttributes, t),
|
|
20
|
+
0
|
|
21
|
+
];
|
|
22
|
+
},
|
|
23
|
+
addCommands() {
|
|
24
|
+
return {
|
|
25
|
+
setSubscript: () => ({ commands: e }) => e.setMark(this.name),
|
|
26
|
+
toggleSubscript: () => ({ commands: e }) => e.toggleMark(this.name),
|
|
27
|
+
unsetSubscript: () => ({ commands: e }) => e.unsetMark(this.name)
|
|
28
|
+
};
|
|
29
|
+
},
|
|
30
|
+
addKeyboardShortcuts() {
|
|
31
|
+
return { "Mod-,": () => this.editor.commands.toggleSubscript() };
|
|
32
|
+
}
|
|
33
|
+
}), r = n;
|
|
34
|
+
//#endregion
|
|
35
|
+
export { n as Subscript, r as default };
|