@aswin.dev/editor 0.6.3 → 0.7.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +3 -3
- package/dist/AccessibilityPanel-COL6Wm7p.js +108 -0
- package/dist/AiChatSidebar-DWGPVtvC.js +229 -0
- package/dist/AiFeatureMenu-duUFSfDf.js +63 -0
- package/dist/BlockA11yBadge-Qs6HtXid.js +34 -0
- package/dist/CloudEditor-CFldoCOb.js +1207 -0
- package/dist/CollaboratorBar-Bw-lbt61.js +95 -0
- package/dist/CommentsSidebar-BaD5F53-.js +436 -0
- package/dist/CountdownBlock-DaYGxKqo.js +92 -0
- package/dist/CountdownToolbar-Dg4F8MTk.js +210 -0
- package/dist/DesignReferenceSidebar-BSH7uNP_.js +276 -0
- package/dist/LoadingTrack-Ba2pfF57.js +10 -0
- package/dist/ModuleBrowserModal-6phxZSKI.js +206 -0
- package/dist/ModulePreviewCanvas-BW8L3eQX.js +108 -0
- package/dist/NumberWithSuffix-BpUzQOJt.js +422 -0
- package/dist/ParagraphEditor-DNSzAB-I.js +695 -0
- package/dist/RichTextEditorContent-CrqPQdnk.js +137 -0
- package/dist/SaveModuleDialog-zMQTpez7.js +123 -0
- package/dist/SnapshotHistory-Do-A5rYU.js +122 -0
- package/dist/TemplateScoringPanel-CS7o62zS.js +256 -0
- package/dist/TestEmailModal-DGj_9V1u.js +94 -0
- package/dist/TitleEditor-C7IDnAoS.js +172 -0
- package/dist/TplModal-BAsVzcTb.js +44 -0
- package/dist/_plugin-vue_export-helper-BVAJ4lgT.js +8 -0
- package/dist/accessibility-BU09xZrQ.js +27 -0
- package/dist/blockTypeIcons-C6LDKvmd.js +140 -0
- package/dist/bundle-stats.json +10 -0
- package/dist/check-DJrpDKO_.js +7 -0
- package/dist/chevron-down-C5oBUhT8.js +7 -0
- package/dist/chevron-right-BqCptpdp.js +10 -0
- package/dist/circle-alert-ZQQc98HC.js +25 -0
- package/dist/clock-ik2pRJKG.js +12 -0
- package/dist/cloud-6ZmAvF0j.js +1791 -0
- package/dist/createLucideIcon-ClREiSx3.js +43 -0
- package/dist/de-DWcgp-7T.js +729 -0
- package/dist/de-GOtR9DwW.js +207 -0
- package/dist/dist-BUzw1buG.js +35 -0
- package/dist/dist-BZyY-SS4.js +74 -0
- package/dist/dist-BadNx4qo.js +5 -0
- package/dist/dist-BesOh2mk.js +35 -0
- package/dist/dist-Bz3M4RXG.js +2082 -0
- package/dist/dist-C04s_fLA.js +563 -0
- package/dist/dist-C3T2AKtB.js +776 -0
- package/dist/dist-C9ckKEZL.js +519 -0
- package/dist/dist-CBItRG-Z.js +47 -0
- package/dist/dist-COSzWQUs.js +5 -0
- package/dist/dist-CivF9P8b.js +382 -0
- package/dist/dist-DXa1uAMh.js +10658 -0
- package/dist/dist-DtiDUrX-.js +189 -0
- package/dist/dist-Dzt5foyL.js +61 -0
- package/dist/emojiData-DrBuvEoP.js +17 -0
- package/dist/en-Cxd4fhNm.js +729 -0
- package/dist/en-dFFQVzNn.js +207 -0
- package/dist/extensions-D__hOlV1.js +799 -0
- package/dist/formatRelativeTime-BhhO8yCl.js +12 -0
- package/dist/image-up-DT7gcJLN.js +23 -0
- package/dist/index.d.ts +352 -0
- package/dist/info-BSPGcsSM.js +19 -0
- package/dist/keys-CvX8D-8C.js +10 -0
- package/dist/liquid.browser-BvCyLQII.js +3277 -0
- package/dist/loader-circle-Balo8p3d.js +7 -0
- package/dist/message-circle-B39qAHxs.js +7 -0
- package/dist/pencil-BZJPNYWR.js +10 -0
- package/dist/readableTextColor-DVuzNX1y.js +30 -0
- package/dist/refresh-cw-DwDqGUM0.js +29 -0
- package/dist/rolldown-runtime-BZGGJVDF.js +20 -0
- package/dist/scan-line-CzfFJO1o.js +25 -0
- package/dist/send-D2eSo4GH.js +10 -0
- package/dist/shield-check-jkpgcC0-.js +10 -0
- package/dist/sparkles-Chm5CZfb.js +23 -0
- package/dist/style.css +2 -0
- package/dist/styleConstants-34eUKPOZ.js +55 -0
- package/dist/styles-B4tjX5SP.js +5224 -0
- package/dist/templatical-editor.js +312 -0
- package/dist/text-align-start-CzBnJsW8.js +43 -0
- package/dist/timeouts-BSGxjuUF.js +4 -0
- package/dist/trash-2-CtK2apEH.js +25 -0
- package/dist/triangle-alert-KpDVNbpn.js +17 -0
- package/dist/useCloudI18n-DOKSZql1.js +23 -0
- package/dist/useEditorCore-wslttMH-.js +9517 -0
- package/dist/useI18n-C2xQZ6K9.js +17 -0
- package/dist/useMergeTag-DX0XG5V9.js +34 -0
- package/dist/vue.runtime.esm-bundler-CjauPXjj.js +5775 -0
- package/dist/x-BkaOMosX.js +10 -0
- package/package.json +10 -10
|
@@ -0,0 +1,519 @@
|
|
|
1
|
+
import { r as e } from "./rolldown-runtime-BZGGJVDF.js";
|
|
2
|
+
import { A as t, C as n, H as r, K as i, P as a, Q as o, T as s, X as c, et as l, i as u, j as d, k as ee, nt as te, rt as ne, st as re, w as ie } from "./vue.runtime.esm-bundler-CjauPXjj.js";
|
|
3
|
+
import { $ as ae, $t as oe, A as se, At as ce, B as le, Bt as ue, C as de, Ct as fe, D as f, 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 W, gt as Ge, 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-DXa1uAMh.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: () => W,
|
|
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: () => de,
|
|
37
|
+
createChainableState: () => jt,
|
|
38
|
+
createDocument: () => he,
|
|
39
|
+
createElement: () => H,
|
|
40
|
+
createInlineMarkdownSpec: () => m,
|
|
41
|
+
createMappablePosition: () => f,
|
|
42
|
+
createNodeFromContent: () => P,
|
|
43
|
+
createStyleTag: () => et,
|
|
44
|
+
decodeHtmlEntities: () => se,
|
|
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: () => le,
|
|
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: () => ae,
|
|
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: () => Ge,
|
|
85
|
+
h: () => H,
|
|
86
|
+
injectExtensionAttributesToParseRule: () => At,
|
|
87
|
+
inputRulesPlugin: () => Ft,
|
|
88
|
+
isActive: () => Pe,
|
|
89
|
+
isAndroid: () => Pt,
|
|
90
|
+
isAtEndOfNode: () => me,
|
|
91
|
+
isAtStartOfNode: () => fe,
|
|
92
|
+
isEmptyObject: () => Mt,
|
|
93
|
+
isExtensionRulesEnabled: () => ge,
|
|
94
|
+
isFirefox: () => h,
|
|
95
|
+
isFunction: () => p,
|
|
96
|
+
isList: () => F,
|
|
97
|
+
isMacOS: () => tt,
|
|
98
|
+
isMarkActive: () => ce,
|
|
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: () => ue,
|
|
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: () => oe,
|
|
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 i((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
|
+
}), c(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 = n({
|
|
177
|
+
name: "EditorContent",
|
|
178
|
+
props: { editor: {
|
|
179
|
+
default: null,
|
|
180
|
+
type: Object
|
|
181
|
+
} },
|
|
182
|
+
setup(e) {
|
|
183
|
+
let n = l(), i = ie();
|
|
184
|
+
return r(() => {
|
|
185
|
+
let t = e.editor;
|
|
186
|
+
t && t.options.element && n.value && ee(() => {
|
|
187
|
+
if (!n.value || !t.view.dom?.parentNode) return;
|
|
188
|
+
let e = re(n.value);
|
|
189
|
+
n.value.append(...t.view.dom.parentNode.childNodes), t.contentComponent = i.ctx._, i && (t.appContext = {
|
|
190
|
+
...i.appContext,
|
|
191
|
+
provides: i.provides
|
|
192
|
+
}), t.setOptions({ element: e }), t.createNodeViews();
|
|
193
|
+
});
|
|
194
|
+
}), t(() => {
|
|
195
|
+
let t = e.editor;
|
|
196
|
+
t && (t.contentComponent = null, t.appContext = null);
|
|
197
|
+
}), { rootEl: n };
|
|
198
|
+
},
|
|
199
|
+
render() {
|
|
200
|
+
return s("div", { ref: (e) => {
|
|
201
|
+
this.rootEl = e;
|
|
202
|
+
} });
|
|
203
|
+
}
|
|
204
|
+
}), Bt = n({
|
|
205
|
+
name: "NodeViewContent",
|
|
206
|
+
props: { as: {
|
|
207
|
+
type: String,
|
|
208
|
+
default: "div"
|
|
209
|
+
} },
|
|
210
|
+
render() {
|
|
211
|
+
return s(this.as, {
|
|
212
|
+
style: { whiteSpace: "pre-wrap" },
|
|
213
|
+
"data-node-view-content": ""
|
|
214
|
+
});
|
|
215
|
+
}
|
|
216
|
+
}), X = n({
|
|
217
|
+
name: "NodeViewWrapper",
|
|
218
|
+
props: { as: {
|
|
219
|
+
type: String,
|
|
220
|
+
default: "div"
|
|
221
|
+
} },
|
|
222
|
+
inject: ["onDragStart", "decorationClasses"],
|
|
223
|
+
render() {
|
|
224
|
+
var e;
|
|
225
|
+
return s(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 = te();
|
|
234
|
+
return d(() => {
|
|
235
|
+
n.value = new Y(e);
|
|
236
|
+
}), t(() => {
|
|
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 = c(e), this.el = document.createElement("div"), this.props = o(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 = s(this.component, this.props);
|
|
254
|
+
return this.editor.appContext && (e.appContext = this.editor.appContext), typeof document < "u" && this.el && u(e, this.el), {
|
|
255
|
+
vNode: e,
|
|
256
|
+
destroy: () => {
|
|
257
|
+
this.el && u(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 = n({
|
|
300
|
+
name: "MarkViewContent",
|
|
301
|
+
props: { as: {
|
|
302
|
+
type: String,
|
|
303
|
+
default: "span"
|
|
304
|
+
} },
|
|
305
|
+
render() {
|
|
306
|
+
return s(this.as, {
|
|
307
|
+
style: { whiteSpace: "inherit" },
|
|
308
|
+
"data-mark-view-content": ""
|
|
309
|
+
});
|
|
310
|
+
}
|
|
311
|
+
}), Q = class extends G {
|
|
312
|
+
constructor(e, t, r) {
|
|
313
|
+
super(e, t, r);
|
|
314
|
+
let i = {
|
|
315
|
+
...t,
|
|
316
|
+
updateAttributes: this.updateAttributes.bind(this)
|
|
317
|
+
}, a = n({
|
|
318
|
+
extends: { ...e },
|
|
319
|
+
props: Object.keys(i),
|
|
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(a, {
|
|
328
|
+
editor: this.editor,
|
|
329
|
+
props: i
|
|
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 = ne(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 = l(this.getDecorationClasses());
|
|
422
|
+
let r = n({
|
|
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(r, {
|
|
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,47 @@
|
|
|
1
|
+
import { i as e } from "./dist-DXa1uAMh.js";
|
|
2
|
+
//#region ../../node_modules/.pnpm/@tiptap+extension-text-align@3.22.5_@tiptap+core@3.22.5_@tiptap+pm@3.22.5_/node_modules/@tiptap/extension-text-align/dist/index.js
|
|
3
|
+
var t = e.create({
|
|
4
|
+
name: "textAlign",
|
|
5
|
+
addOptions() {
|
|
6
|
+
return {
|
|
7
|
+
types: [],
|
|
8
|
+
alignments: [
|
|
9
|
+
"left",
|
|
10
|
+
"center",
|
|
11
|
+
"right",
|
|
12
|
+
"justify"
|
|
13
|
+
],
|
|
14
|
+
defaultAlignment: null
|
|
15
|
+
};
|
|
16
|
+
},
|
|
17
|
+
addGlobalAttributes() {
|
|
18
|
+
return [{
|
|
19
|
+
types: this.options.types,
|
|
20
|
+
attributes: { textAlign: {
|
|
21
|
+
default: this.options.defaultAlignment,
|
|
22
|
+
parseHTML: (e) => {
|
|
23
|
+
let t = e.style.textAlign;
|
|
24
|
+
return this.options.alignments.includes(t) ? t : this.options.defaultAlignment;
|
|
25
|
+
},
|
|
26
|
+
renderHTML: (e) => e.textAlign ? { style: `text-align: ${e.textAlign}` } : {}
|
|
27
|
+
} }
|
|
28
|
+
}];
|
|
29
|
+
},
|
|
30
|
+
addCommands() {
|
|
31
|
+
return {
|
|
32
|
+
setTextAlign: (e) => ({ commands: t }) => this.options.alignments.includes(e) ? this.options.types.map((n) => t.updateAttributes(n, { textAlign: e })).some((e) => e) : !1,
|
|
33
|
+
unsetTextAlign: () => ({ commands: e }) => this.options.types.map((t) => e.resetAttributes(t, "textAlign")).some((e) => e),
|
|
34
|
+
toggleTextAlign: (e) => ({ editor: t, commands: n }) => this.options.alignments.includes(e) ? t.isActive({ textAlign: e }) ? n.unsetTextAlign() : n.setTextAlign(e) : !1
|
|
35
|
+
};
|
|
36
|
+
},
|
|
37
|
+
addKeyboardShortcuts() {
|
|
38
|
+
return {
|
|
39
|
+
"Mod-Shift-l": () => this.editor.commands.setTextAlign("left"),
|
|
40
|
+
"Mod-Shift-e": () => this.editor.commands.setTextAlign("center"),
|
|
41
|
+
"Mod-Shift-r": () => this.editor.commands.setTextAlign("right"),
|
|
42
|
+
"Mod-Shift-j": () => this.editor.commands.setTextAlign("justify")
|
|
43
|
+
};
|
|
44
|
+
}
|
|
45
|
+
}), n = t;
|
|
46
|
+
//#endregion
|
|
47
|
+
export { t as TextAlign, n as default };
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { FontFamily as e } from "./dist-DtiDUrX-.js";
|
|
2
|
+
//#region ../../node_modules/.pnpm/@tiptap+extension-font-family@3.22.5_@tiptap+extension-text-style@3.22.5_@tiptap+core@3.22.5_@tiptap+pm@3.22.5__/node_modules/@tiptap/extension-font-family/dist/index.js
|
|
3
|
+
var t = e;
|
|
4
|
+
//#endregion
|
|
5
|
+
export { e as FontFamily, t as default };
|