ablok-components 0.3.33 → 0.3.34
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/ablok-components.css +1 -1
- package/dist/ablok-components.es.js +1 -1
- package/dist/ablok-components.umd.js +83 -81
- package/dist/components/atoms/input-file/input-file.vue.d.ts +9 -9
- package/dist/components/atoms/input-passcode/input-passcode.vue.d.ts +1 -1
- package/dist/components/molecules/image-crop-resize/image-crop-resize.vue.d.ts +210 -2
- package/dist/components/molecules/image-resize/image-resize.vue.d.ts +420 -4
- package/dist/components/molecules/image-upload/image-upload.vue.d.ts +1 -1
- package/dist/components/molecules/upload-group/upload-group.vue.d.ts +1 -1
- package/dist/components/organisms/asset-uploader/asset-uploader.vue.d.ts +1 -1
- package/dist/components/templates/modal-dialog/modal-dialog.vue.d.ts +1 -1
- package/dist/index-4swvWhBV.mjs +85 -0
- package/dist/index-B4qukPmD.mjs +47 -0
- package/dist/index-Bk6yOA7Y.mjs +94 -0
- package/dist/index-BzE6-pPu.mjs +580 -0
- package/dist/index-C9XBp_Jh.mjs +2333 -0
- package/dist/index-DbvQcSeJ.mjs +1006 -0
- package/dist/index-Dgq1pUHO.mjs +22992 -0
- package/dist/index-Ki1Egcx9.mjs +13815 -0
- package/dist/{leaflet-src-DoUq7Xt2.mjs → leaflet-src-mwV2C14q.mjs} +1 -1
- package/dist/vue-datepicker-DjJc0tSE.mjs +9171 -0
- package/dist/{vue-leaflet.es-B9Fv25XF.mjs → vue-leaflet.es-Cn1a0sf0.mjs} +1 -1
- package/package.json +1 -1
- package/dist/index-E0TpJEQx.mjs +0 -48832
|
@@ -0,0 +1,94 @@
|
|
|
1
|
+
import { d as g, aC as r, aB as n, aE as _ } from "./index-Ki1Egcx9.mjs";
|
|
2
|
+
var s = (e, t) => {
|
|
3
|
+
if (e === "slot")
|
|
4
|
+
return 0;
|
|
5
|
+
if (e instanceof Function)
|
|
6
|
+
return e(t);
|
|
7
|
+
const { children: u, ...p } = t ?? {};
|
|
8
|
+
if (e === "svg")
|
|
9
|
+
throw new Error("SVG elements are not supported in the JSX syntax, use the array syntax instead");
|
|
10
|
+
return [e, p, u];
|
|
11
|
+
}, a = /(?:^|\s)(\*\*(?!\s+\*\*)((?:[^*]+))\*\*(?!\s+\*\*))$/, o = /(?:^|\s)(\*\*(?!\s+\*\*)((?:[^*]+))\*\*(?!\s+\*\*))/g, d = /(?:^|\s)(__(?!\s+__)((?:[^_]+))__(?!\s+__))$/, l = /(?:^|\s)(__(?!\s+__)((?:[^_]+))__(?!\s+__))/g, i = g.create({
|
|
12
|
+
name: "bold",
|
|
13
|
+
addOptions() {
|
|
14
|
+
return {
|
|
15
|
+
HTMLAttributes: {}
|
|
16
|
+
};
|
|
17
|
+
},
|
|
18
|
+
parseHTML() {
|
|
19
|
+
return [
|
|
20
|
+
{
|
|
21
|
+
tag: "strong"
|
|
22
|
+
},
|
|
23
|
+
{
|
|
24
|
+
tag: "b",
|
|
25
|
+
getAttrs: (e) => e.style.fontWeight !== "normal" && null
|
|
26
|
+
},
|
|
27
|
+
{
|
|
28
|
+
style: "font-weight=400",
|
|
29
|
+
clearMark: (e) => e.type.name === this.name
|
|
30
|
+
},
|
|
31
|
+
{
|
|
32
|
+
style: "font-weight",
|
|
33
|
+
getAttrs: (e) => /^(bold(er)?|[5-9]\d{2,})$/.test(e) && null
|
|
34
|
+
}
|
|
35
|
+
];
|
|
36
|
+
},
|
|
37
|
+
renderHTML({ HTMLAttributes: e }) {
|
|
38
|
+
return /* @__PURE__ */ s("strong", { ..._(this.options.HTMLAttributes, e), children: /* @__PURE__ */ s("slot", {}) });
|
|
39
|
+
},
|
|
40
|
+
markdownTokenName: "strong",
|
|
41
|
+
parseMarkdown: (e, t) => t.applyMark("bold", t.parseInline(e.tokens || [])),
|
|
42
|
+
renderMarkdown: (e, t) => `**${t.renderChildren(e)}**`,
|
|
43
|
+
addCommands() {
|
|
44
|
+
return {
|
|
45
|
+
setBold: () => ({ commands: e }) => e.setMark(this.name),
|
|
46
|
+
toggleBold: () => ({ commands: e }) => e.toggleMark(this.name),
|
|
47
|
+
unsetBold: () => ({ commands: e }) => e.unsetMark(this.name)
|
|
48
|
+
};
|
|
49
|
+
},
|
|
50
|
+
addKeyboardShortcuts() {
|
|
51
|
+
return {
|
|
52
|
+
"Mod-b": () => this.editor.commands.toggleBold(),
|
|
53
|
+
"Mod-B": () => this.editor.commands.toggleBold()
|
|
54
|
+
};
|
|
55
|
+
},
|
|
56
|
+
addInputRules() {
|
|
57
|
+
return [
|
|
58
|
+
n({
|
|
59
|
+
find: a,
|
|
60
|
+
type: this.type
|
|
61
|
+
}),
|
|
62
|
+
n({
|
|
63
|
+
find: d,
|
|
64
|
+
type: this.type
|
|
65
|
+
})
|
|
66
|
+
];
|
|
67
|
+
},
|
|
68
|
+
addPasteRules() {
|
|
69
|
+
return [
|
|
70
|
+
r({
|
|
71
|
+
find: o,
|
|
72
|
+
type: this.type
|
|
73
|
+
}),
|
|
74
|
+
r({
|
|
75
|
+
find: l,
|
|
76
|
+
type: this.type
|
|
77
|
+
})
|
|
78
|
+
];
|
|
79
|
+
}
|
|
80
|
+
}), m = i;
|
|
81
|
+
const y = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
82
|
+
__proto__: null,
|
|
83
|
+
Bold: i,
|
|
84
|
+
default: m,
|
|
85
|
+
starInputRegex: a,
|
|
86
|
+
starPasteRegex: o,
|
|
87
|
+
underscoreInputRegex: d,
|
|
88
|
+
underscorePasteRegex: l
|
|
89
|
+
}, Symbol.toStringTag, { value: "Module" }));
|
|
90
|
+
export {
|
|
91
|
+
i as B,
|
|
92
|
+
s as h,
|
|
93
|
+
y as i
|
|
94
|
+
};
|
|
@@ -0,0 +1,580 @@
|
|
|
1
|
+
import { E as f, M as S, N as x } from "./index-Ki1Egcx9.mjs";
|
|
2
|
+
import { C as H, a as J, b as $, F as G, I as K, c as Q, d as X, e as Y, f as Z, P as ee, R as te, g as se, T as re, h as ne, i as ae, j as ie, k as oe, l as de, m as ue, n as le, o as ce, p as pe, q as he, r as me, s as ge, t as ve, u as fe, v as Se, w as xe, x as ye, y as we, z as be, A as Ce, B as Ne, D as _e, G as Ee, H as Me, J as Pe, K as ke, L as Ae, O as Re, Q as Oe, S as Te, U as De, V as Ve, W as je, X as qe, Y as Fe, Z as Ie, _ as Be, $ as We, a0 as Le, a1 as Ue, a2 as ze, a3 as He, a4 as Je, a5 as $e, a6 as Ge, a7 as Ke, a8 as Qe, a9 as Xe, aa as Ye, ab as Ze, ac as et, ad as tt, p as st, ae as rt, af as nt, ag as at, ah as it, ai as ot, aj as dt, ak as ut, al as lt, am as ct, an as pt, ao as ht, ap as mt, aq as gt, ar as vt, as as ft, at as St, au as xt, av as yt, aw as wt, ax as bt, ay as Ct, az as Nt, aA as _t, aB as Et, aC as Mt, aD as Pt, aE as kt, aF as At, aG as Rt, aH as Ot, aI as Tt, aJ as Dt, aK as Vt, aL as jt, aM as qt, aN as Ft, aO as It, aP as Bt, aQ as Wt, aR as Lt, aS as Ut, aT as zt, aU as Ht, aV as Jt, aW as $t, aX as Gt, aY as Kt, aZ as Qt, a_ as Xt, a$ as Yt } from "./index-Ki1Egcx9.mjs";
|
|
3
|
+
import { defineComponent as o, markRaw as p, h as d, ref as h, getCurrentInstance as y, watchEffect as w, nextTick as b, unref as C, onBeforeUnmount as m, toRaw as N, reactive as _, render as u, shallowRef as E, onMounted as M, customRef as P, provide as l } from "vue";
|
|
4
|
+
function c(e) {
|
|
5
|
+
return P((t, s) => ({
|
|
6
|
+
get() {
|
|
7
|
+
return t(), e;
|
|
8
|
+
},
|
|
9
|
+
set(r) {
|
|
10
|
+
e = r, requestAnimationFrame(() => {
|
|
11
|
+
requestAnimationFrame(() => {
|
|
12
|
+
s();
|
|
13
|
+
});
|
|
14
|
+
});
|
|
15
|
+
}
|
|
16
|
+
}));
|
|
17
|
+
}
|
|
18
|
+
var k = class extends f {
|
|
19
|
+
constructor(e = {}) {
|
|
20
|
+
return super(e), this.contentComponent = null, this.appContext = null, this.reactiveState = c(this.view.state), this.reactiveExtensionStorage = c(this.extensionStorage), this.on("beforeTransaction", ({ nextState: t }) => {
|
|
21
|
+
this.reactiveState.value = t, this.reactiveExtensionStorage.value = this.extensionStorage;
|
|
22
|
+
}), p(this);
|
|
23
|
+
}
|
|
24
|
+
get state() {
|
|
25
|
+
return this.reactiveState ? this.reactiveState.value : this.view.state;
|
|
26
|
+
}
|
|
27
|
+
get storage() {
|
|
28
|
+
return this.reactiveExtensionStorage ? this.reactiveExtensionStorage.value : super.storage;
|
|
29
|
+
}
|
|
30
|
+
/**
|
|
31
|
+
* Register a ProseMirror plugin.
|
|
32
|
+
*/
|
|
33
|
+
registerPlugin(e, t) {
|
|
34
|
+
const s = super.registerPlugin(e, t);
|
|
35
|
+
return this.reactiveState && (this.reactiveState.value = s), s;
|
|
36
|
+
}
|
|
37
|
+
/**
|
|
38
|
+
* Unregister a ProseMirror plugin.
|
|
39
|
+
*/
|
|
40
|
+
unregisterPlugin(e) {
|
|
41
|
+
const t = super.unregisterPlugin(e);
|
|
42
|
+
return this.reactiveState && t && (this.reactiveState.value = t), t;
|
|
43
|
+
}
|
|
44
|
+
}, D = o({
|
|
45
|
+
name: "EditorContent",
|
|
46
|
+
props: {
|
|
47
|
+
editor: {
|
|
48
|
+
default: null,
|
|
49
|
+
type: Object
|
|
50
|
+
}
|
|
51
|
+
},
|
|
52
|
+
setup(e) {
|
|
53
|
+
const t = h(), s = y();
|
|
54
|
+
return w(() => {
|
|
55
|
+
const r = e.editor;
|
|
56
|
+
r && r.options.element && t.value && b(() => {
|
|
57
|
+
var n;
|
|
58
|
+
if (!t.value || !((n = r.view.dom) != null && n.parentNode))
|
|
59
|
+
return;
|
|
60
|
+
const a = C(t.value);
|
|
61
|
+
t.value.append(...r.view.dom.parentNode.childNodes), r.contentComponent = s.ctx._, s && (r.appContext = {
|
|
62
|
+
...s.appContext,
|
|
63
|
+
// Vue internally uses prototype chain to forward/shadow injects across the entire component chain
|
|
64
|
+
// so don't use object spread operator or 'Object.assign' and just set `provides` as is on editor's appContext
|
|
65
|
+
// @ts-expect-error forward instance's 'provides' into appContext
|
|
66
|
+
provides: s.provides
|
|
67
|
+
}), r.setOptions({
|
|
68
|
+
element: a
|
|
69
|
+
}), r.createNodeViews();
|
|
70
|
+
});
|
|
71
|
+
}), m(() => {
|
|
72
|
+
const r = e.editor;
|
|
73
|
+
r && (r.contentComponent = null, r.appContext = null);
|
|
74
|
+
}), { rootEl: t };
|
|
75
|
+
},
|
|
76
|
+
render() {
|
|
77
|
+
return d("div", {
|
|
78
|
+
ref: (e) => {
|
|
79
|
+
this.rootEl = e;
|
|
80
|
+
}
|
|
81
|
+
});
|
|
82
|
+
}
|
|
83
|
+
}), V = o({
|
|
84
|
+
name: "NodeViewContent",
|
|
85
|
+
props: {
|
|
86
|
+
as: {
|
|
87
|
+
type: String,
|
|
88
|
+
default: "div"
|
|
89
|
+
}
|
|
90
|
+
},
|
|
91
|
+
render() {
|
|
92
|
+
return d(this.as, {
|
|
93
|
+
style: {
|
|
94
|
+
whiteSpace: "pre-wrap"
|
|
95
|
+
},
|
|
96
|
+
"data-node-view-content": ""
|
|
97
|
+
});
|
|
98
|
+
}
|
|
99
|
+
}), j = o({
|
|
100
|
+
name: "NodeViewWrapper",
|
|
101
|
+
props: {
|
|
102
|
+
as: {
|
|
103
|
+
type: String,
|
|
104
|
+
default: "div"
|
|
105
|
+
}
|
|
106
|
+
},
|
|
107
|
+
inject: ["onDragStart", "decorationClasses"],
|
|
108
|
+
render() {
|
|
109
|
+
var e, t;
|
|
110
|
+
return d(
|
|
111
|
+
this.as,
|
|
112
|
+
{
|
|
113
|
+
// @ts-ignore
|
|
114
|
+
class: this.decorationClasses,
|
|
115
|
+
style: {
|
|
116
|
+
whiteSpace: "normal"
|
|
117
|
+
},
|
|
118
|
+
"data-node-view-wrapper": "",
|
|
119
|
+
// @ts-ignore (https://github.com/vuejs/vue-next/issues/3031)
|
|
120
|
+
onDragstart: this.onDragStart
|
|
121
|
+
},
|
|
122
|
+
(t = (e = this.$slots).default) == null ? void 0 : t.call(e)
|
|
123
|
+
);
|
|
124
|
+
}
|
|
125
|
+
}), q = (e = {}) => {
|
|
126
|
+
const t = E();
|
|
127
|
+
return M(() => {
|
|
128
|
+
t.value = new k(e);
|
|
129
|
+
}), m(() => {
|
|
130
|
+
var s, r, n, a;
|
|
131
|
+
const i = (r = (s = t.value) == null ? void 0 : s.view.dom) == null ? void 0 : r.parentNode, v = i?.cloneNode(!0);
|
|
132
|
+
(n = i?.parentNode) == null || n.replaceChild(v, i), (a = t.value) == null || a.destroy();
|
|
133
|
+
}), t;
|
|
134
|
+
}, g = class {
|
|
135
|
+
constructor(e, { props: t = {}, editor: s }) {
|
|
136
|
+
this.destroyed = !1, this.editor = s, this.component = p(e), this.el = document.createElement("div"), this.props = _(t), this.renderedComponent = this.renderComponent();
|
|
137
|
+
}
|
|
138
|
+
get element() {
|
|
139
|
+
return this.renderedComponent.el;
|
|
140
|
+
}
|
|
141
|
+
get ref() {
|
|
142
|
+
var e, t, s, r;
|
|
143
|
+
return (t = (e = this.renderedComponent.vNode) == null ? void 0 : e.component) != null && t.exposed ? this.renderedComponent.vNode.component.exposed : (r = (s = this.renderedComponent.vNode) == null ? void 0 : s.component) == null ? void 0 : r.proxy;
|
|
144
|
+
}
|
|
145
|
+
renderComponent() {
|
|
146
|
+
if (this.destroyed)
|
|
147
|
+
return this.renderedComponent;
|
|
148
|
+
let e = d(this.component, this.props);
|
|
149
|
+
return this.editor.appContext && (e.appContext = this.editor.appContext), typeof document < "u" && this.el && u(e, this.el), { vNode: e, destroy: () => {
|
|
150
|
+
this.el && u(null, this.el), this.el = null, e = null;
|
|
151
|
+
}, el: this.el ? this.el.firstElementChild : null };
|
|
152
|
+
}
|
|
153
|
+
updateProps(e = {}) {
|
|
154
|
+
this.destroyed || (Object.entries(e).forEach(([t, s]) => {
|
|
155
|
+
this.props[t] = s;
|
|
156
|
+
}), this.renderComponent());
|
|
157
|
+
}
|
|
158
|
+
destroy() {
|
|
159
|
+
this.destroyed || (this.destroyed = !0, this.renderedComponent.destroy());
|
|
160
|
+
}
|
|
161
|
+
}, F = {
|
|
162
|
+
editor: {
|
|
163
|
+
type: Object,
|
|
164
|
+
required: !0
|
|
165
|
+
},
|
|
166
|
+
mark: {
|
|
167
|
+
type: Object,
|
|
168
|
+
required: !0
|
|
169
|
+
},
|
|
170
|
+
extension: {
|
|
171
|
+
type: Object,
|
|
172
|
+
required: !0
|
|
173
|
+
},
|
|
174
|
+
inline: {
|
|
175
|
+
type: Boolean,
|
|
176
|
+
required: !0
|
|
177
|
+
},
|
|
178
|
+
view: {
|
|
179
|
+
type: Object,
|
|
180
|
+
required: !0
|
|
181
|
+
},
|
|
182
|
+
updateAttributes: {
|
|
183
|
+
type: Function,
|
|
184
|
+
required: !0
|
|
185
|
+
},
|
|
186
|
+
HTMLAttributes: {
|
|
187
|
+
type: Object,
|
|
188
|
+
required: !0
|
|
189
|
+
}
|
|
190
|
+
}, I = o({
|
|
191
|
+
name: "MarkViewContent",
|
|
192
|
+
props: {
|
|
193
|
+
as: {
|
|
194
|
+
type: String,
|
|
195
|
+
default: "span"
|
|
196
|
+
}
|
|
197
|
+
},
|
|
198
|
+
render() {
|
|
199
|
+
return d(this.as, {
|
|
200
|
+
style: {
|
|
201
|
+
whiteSpace: "inherit"
|
|
202
|
+
},
|
|
203
|
+
"data-mark-view-content": ""
|
|
204
|
+
});
|
|
205
|
+
}
|
|
206
|
+
}), A = class extends S {
|
|
207
|
+
constructor(e, t, s) {
|
|
208
|
+
super(e, t, s);
|
|
209
|
+
const r = { ...t, updateAttributes: this.updateAttributes.bind(this) }, n = o({
|
|
210
|
+
extends: { ...e },
|
|
211
|
+
props: Object.keys(r),
|
|
212
|
+
template: this.component.template,
|
|
213
|
+
setup: (a) => {
|
|
214
|
+
var i;
|
|
215
|
+
return (i = e.setup) == null ? void 0 : i.call(e, a, {
|
|
216
|
+
expose: () => {
|
|
217
|
+
}
|
|
218
|
+
});
|
|
219
|
+
},
|
|
220
|
+
// Add support for scoped styles
|
|
221
|
+
__scopeId: e.__scopeId,
|
|
222
|
+
__cssModules: e.__cssModules,
|
|
223
|
+
__name: e.__name,
|
|
224
|
+
__file: e.__file
|
|
225
|
+
});
|
|
226
|
+
this.renderer = new g(n, {
|
|
227
|
+
editor: this.editor,
|
|
228
|
+
props: r
|
|
229
|
+
});
|
|
230
|
+
}
|
|
231
|
+
get dom() {
|
|
232
|
+
return this.renderer.element;
|
|
233
|
+
}
|
|
234
|
+
get contentDOM() {
|
|
235
|
+
return this.dom.querySelector("[data-mark-view-content]");
|
|
236
|
+
}
|
|
237
|
+
updateAttributes(e) {
|
|
238
|
+
const t = N(this.mark);
|
|
239
|
+
super.updateAttributes(e, t);
|
|
240
|
+
}
|
|
241
|
+
destroy() {
|
|
242
|
+
this.renderer.destroy();
|
|
243
|
+
}
|
|
244
|
+
};
|
|
245
|
+
function B(e, t = {}) {
|
|
246
|
+
return (s) => s.editor.contentComponent ? new A(e, s, t) : {};
|
|
247
|
+
}
|
|
248
|
+
var W = {
|
|
249
|
+
editor: {
|
|
250
|
+
type: Object,
|
|
251
|
+
required: !0
|
|
252
|
+
},
|
|
253
|
+
node: {
|
|
254
|
+
type: Object,
|
|
255
|
+
required: !0
|
|
256
|
+
},
|
|
257
|
+
decorations: {
|
|
258
|
+
type: Object,
|
|
259
|
+
required: !0
|
|
260
|
+
},
|
|
261
|
+
selected: {
|
|
262
|
+
type: Boolean,
|
|
263
|
+
required: !0
|
|
264
|
+
},
|
|
265
|
+
extension: {
|
|
266
|
+
type: Object,
|
|
267
|
+
required: !0
|
|
268
|
+
},
|
|
269
|
+
getPos: {
|
|
270
|
+
type: Function,
|
|
271
|
+
required: !0
|
|
272
|
+
},
|
|
273
|
+
updateAttributes: {
|
|
274
|
+
type: Function,
|
|
275
|
+
required: !0
|
|
276
|
+
},
|
|
277
|
+
deleteNode: {
|
|
278
|
+
type: Function,
|
|
279
|
+
required: !0
|
|
280
|
+
},
|
|
281
|
+
view: {
|
|
282
|
+
type: Object,
|
|
283
|
+
required: !0
|
|
284
|
+
},
|
|
285
|
+
innerDecorations: {
|
|
286
|
+
type: Object,
|
|
287
|
+
required: !0
|
|
288
|
+
},
|
|
289
|
+
HTMLAttributes: {
|
|
290
|
+
type: Object,
|
|
291
|
+
required: !0
|
|
292
|
+
}
|
|
293
|
+
}, R = class extends x {
|
|
294
|
+
constructor() {
|
|
295
|
+
super(...arguments), this.cachedExtensionWithSyncedStorage = null;
|
|
296
|
+
}
|
|
297
|
+
/**
|
|
298
|
+
* Returns a proxy of the extension that redirects storage access to the editor's mutable storage.
|
|
299
|
+
* This preserves the original prototype chain (instanceof checks, methods like configure/extend work).
|
|
300
|
+
* Cached to avoid proxy creation on every update.
|
|
301
|
+
*/
|
|
302
|
+
get extensionWithSyncedStorage() {
|
|
303
|
+
if (!this.cachedExtensionWithSyncedStorage) {
|
|
304
|
+
const e = this.editor, t = this.extension;
|
|
305
|
+
this.cachedExtensionWithSyncedStorage = new Proxy(t, {
|
|
306
|
+
get(s, r, n) {
|
|
307
|
+
var a;
|
|
308
|
+
return r === "storage" ? (a = e.storage[t.name]) != null ? a : {} : Reflect.get(s, r, n);
|
|
309
|
+
}
|
|
310
|
+
});
|
|
311
|
+
}
|
|
312
|
+
return this.cachedExtensionWithSyncedStorage;
|
|
313
|
+
}
|
|
314
|
+
mount() {
|
|
315
|
+
const e = {
|
|
316
|
+
editor: this.editor,
|
|
317
|
+
node: this.node,
|
|
318
|
+
decorations: this.decorations,
|
|
319
|
+
innerDecorations: this.innerDecorations,
|
|
320
|
+
view: this.view,
|
|
321
|
+
selected: !1,
|
|
322
|
+
extension: this.extensionWithSyncedStorage,
|
|
323
|
+
HTMLAttributes: this.HTMLAttributes,
|
|
324
|
+
getPos: () => this.getPos(),
|
|
325
|
+
updateAttributes: (r = {}) => this.updateAttributes(r),
|
|
326
|
+
deleteNode: () => this.deleteNode()
|
|
327
|
+
}, t = this.onDragStart.bind(this);
|
|
328
|
+
this.decorationClasses = h(this.getDecorationClasses());
|
|
329
|
+
const s = o({
|
|
330
|
+
extends: { ...this.component },
|
|
331
|
+
props: Object.keys(e),
|
|
332
|
+
template: this.component.template,
|
|
333
|
+
setup: (r) => {
|
|
334
|
+
var n, a;
|
|
335
|
+
return l("onDragStart", t), l("decorationClasses", this.decorationClasses), (a = (n = this.component).setup) == null ? void 0 : a.call(n, r, {
|
|
336
|
+
expose: () => {
|
|
337
|
+
}
|
|
338
|
+
});
|
|
339
|
+
},
|
|
340
|
+
// add support for scoped styles
|
|
341
|
+
// @ts-ignore
|
|
342
|
+
// eslint-disable-next-line
|
|
343
|
+
__scopeId: this.component.__scopeId,
|
|
344
|
+
// add support for CSS Modules
|
|
345
|
+
// @ts-ignore
|
|
346
|
+
// eslint-disable-next-line
|
|
347
|
+
__cssModules: this.component.__cssModules,
|
|
348
|
+
// add support for vue devtools
|
|
349
|
+
// @ts-ignore
|
|
350
|
+
// eslint-disable-next-line
|
|
351
|
+
__name: this.component.__name,
|
|
352
|
+
// @ts-ignore
|
|
353
|
+
// eslint-disable-next-line
|
|
354
|
+
__file: this.component.__file
|
|
355
|
+
});
|
|
356
|
+
this.handleSelectionUpdate = this.handleSelectionUpdate.bind(this), this.editor.on("selectionUpdate", this.handleSelectionUpdate), this.renderer = new g(s, {
|
|
357
|
+
editor: this.editor,
|
|
358
|
+
props: e
|
|
359
|
+
});
|
|
360
|
+
}
|
|
361
|
+
/**
|
|
362
|
+
* Return the DOM element.
|
|
363
|
+
* This is the element that will be used to display the node view.
|
|
364
|
+
*/
|
|
365
|
+
get dom() {
|
|
366
|
+
if (!this.renderer.element || !this.renderer.element.hasAttribute("data-node-view-wrapper"))
|
|
367
|
+
throw Error("Please use the NodeViewWrapper component for your node view.");
|
|
368
|
+
return this.renderer.element;
|
|
369
|
+
}
|
|
370
|
+
/**
|
|
371
|
+
* Return the content DOM element.
|
|
372
|
+
* This is the element that will be used to display the rich-text content of the node.
|
|
373
|
+
*/
|
|
374
|
+
get contentDOM() {
|
|
375
|
+
return this.node.isLeaf ? null : this.dom.querySelector("[data-node-view-content]");
|
|
376
|
+
}
|
|
377
|
+
/**
|
|
378
|
+
* On editor selection update, check if the node is selected.
|
|
379
|
+
* If it is, call `selectNode`, otherwise call `deselectNode`.
|
|
380
|
+
*/
|
|
381
|
+
handleSelectionUpdate() {
|
|
382
|
+
const { from: e, to: t } = this.editor.state.selection, s = this.getPos();
|
|
383
|
+
if (typeof s == "number")
|
|
384
|
+
if (e <= s && t >= s + this.node.nodeSize) {
|
|
385
|
+
if (this.renderer.props.selected)
|
|
386
|
+
return;
|
|
387
|
+
this.selectNode();
|
|
388
|
+
} else {
|
|
389
|
+
if (!this.renderer.props.selected)
|
|
390
|
+
return;
|
|
391
|
+
this.deselectNode();
|
|
392
|
+
}
|
|
393
|
+
}
|
|
394
|
+
/**
|
|
395
|
+
* On update, update the React component.
|
|
396
|
+
* To prevent unnecessary updates, the `update` option can be used.
|
|
397
|
+
*/
|
|
398
|
+
update(e, t, s) {
|
|
399
|
+
const r = (n) => {
|
|
400
|
+
this.decorationClasses.value = this.getDecorationClasses(), this.renderer.updateProps(n);
|
|
401
|
+
};
|
|
402
|
+
if (typeof this.options.update == "function") {
|
|
403
|
+
const n = this.node, a = this.decorations, i = this.innerDecorations;
|
|
404
|
+
return this.node = e, this.decorations = t, this.innerDecorations = s, this.options.update({
|
|
405
|
+
oldNode: n,
|
|
406
|
+
oldDecorations: a,
|
|
407
|
+
newNode: e,
|
|
408
|
+
newDecorations: t,
|
|
409
|
+
oldInnerDecorations: i,
|
|
410
|
+
innerDecorations: s,
|
|
411
|
+
updateProps: () => r({ node: e, decorations: t, innerDecorations: s, extension: this.extensionWithSyncedStorage })
|
|
412
|
+
});
|
|
413
|
+
}
|
|
414
|
+
return e.type !== this.node.type ? !1 : (e === this.node && this.decorations === t && this.innerDecorations === s || (this.node = e, this.decorations = t, this.innerDecorations = s, r({ node: e, decorations: t, innerDecorations: s, extension: this.extensionWithSyncedStorage })), !0);
|
|
415
|
+
}
|
|
416
|
+
/**
|
|
417
|
+
* Select the node.
|
|
418
|
+
* Add the `selected` prop and the `ProseMirror-selectednode` class.
|
|
419
|
+
*/
|
|
420
|
+
selectNode() {
|
|
421
|
+
this.renderer.updateProps({
|
|
422
|
+
selected: !0
|
|
423
|
+
}), this.renderer.element && this.renderer.element.classList.add("ProseMirror-selectednode");
|
|
424
|
+
}
|
|
425
|
+
/**
|
|
426
|
+
* Deselect the node.
|
|
427
|
+
* Remove the `selected` prop and the `ProseMirror-selectednode` class.
|
|
428
|
+
*/
|
|
429
|
+
deselectNode() {
|
|
430
|
+
this.renderer.updateProps({
|
|
431
|
+
selected: !1
|
|
432
|
+
}), this.renderer.element && this.renderer.element.classList.remove("ProseMirror-selectednode");
|
|
433
|
+
}
|
|
434
|
+
getDecorationClasses() {
|
|
435
|
+
return this.decorations.flatMap((e) => e.type.attrs.class).join(" ");
|
|
436
|
+
}
|
|
437
|
+
destroy() {
|
|
438
|
+
this.renderer.destroy(), this.editor.off("selectionUpdate", this.handleSelectionUpdate);
|
|
439
|
+
}
|
|
440
|
+
};
|
|
441
|
+
function L(e, t) {
|
|
442
|
+
return (s) => {
|
|
443
|
+
if (!s.editor.contentComponent)
|
|
444
|
+
return {};
|
|
445
|
+
const r = typeof e == "function" && "__vccOpts" in e ? e.__vccOpts : e;
|
|
446
|
+
return new R(r, s, t);
|
|
447
|
+
};
|
|
448
|
+
}
|
|
449
|
+
export {
|
|
450
|
+
H as CommandManager,
|
|
451
|
+
k as Editor,
|
|
452
|
+
D as EditorContent,
|
|
453
|
+
J as Extendable,
|
|
454
|
+
$ as Extension,
|
|
455
|
+
G as Fragment,
|
|
456
|
+
K as InputRule,
|
|
457
|
+
Q as MappablePosition,
|
|
458
|
+
X as Mark,
|
|
459
|
+
S as MarkView,
|
|
460
|
+
I as MarkViewContent,
|
|
461
|
+
Y as Node,
|
|
462
|
+
Z as NodePos,
|
|
463
|
+
x as NodeView,
|
|
464
|
+
V as NodeViewContent,
|
|
465
|
+
j as NodeViewWrapper,
|
|
466
|
+
ee as PasteRule,
|
|
467
|
+
te as ResizableNodeView,
|
|
468
|
+
se as ResizableNodeview,
|
|
469
|
+
re as Tracker,
|
|
470
|
+
A as VueMarkView,
|
|
471
|
+
B as VueMarkViewRenderer,
|
|
472
|
+
L as VueNodeViewRenderer,
|
|
473
|
+
g as VueRenderer,
|
|
474
|
+
ne as callOrReturn,
|
|
475
|
+
ae as canInsertNode,
|
|
476
|
+
ie as combineTransactionSteps,
|
|
477
|
+
oe as commands,
|
|
478
|
+
de as createAtomBlockMarkdownSpec,
|
|
479
|
+
ue as createBlockMarkdownSpec,
|
|
480
|
+
le as createChainableState,
|
|
481
|
+
ce as createDocument,
|
|
482
|
+
pe as createElement,
|
|
483
|
+
he as createInlineMarkdownSpec,
|
|
484
|
+
me as createMappablePosition,
|
|
485
|
+
ge as createNodeFromContent,
|
|
486
|
+
ve as createStyleTag,
|
|
487
|
+
fe as defaultBlockAt,
|
|
488
|
+
Se as deleteProps,
|
|
489
|
+
xe as elementFromString,
|
|
490
|
+
ye as escapeForRegEx,
|
|
491
|
+
we as extensions,
|
|
492
|
+
be as findChildren,
|
|
493
|
+
Ce as findChildrenInRange,
|
|
494
|
+
Ne as findDuplicates,
|
|
495
|
+
_e as findParentNode,
|
|
496
|
+
Ee as findParentNodeClosestToPos,
|
|
497
|
+
Me as flattenExtensions,
|
|
498
|
+
Pe as fromString,
|
|
499
|
+
ke as generateHTML,
|
|
500
|
+
Ae as generateJSON,
|
|
501
|
+
Re as generateText,
|
|
502
|
+
Oe as getAttributes,
|
|
503
|
+
Te as getAttributesFromExtensions,
|
|
504
|
+
De as getChangedRanges,
|
|
505
|
+
Ve as getDebugJSON,
|
|
506
|
+
je as getExtensionField,
|
|
507
|
+
qe as getHTMLFromFragment,
|
|
508
|
+
Fe as getMarkAttributes,
|
|
509
|
+
Ie as getMarkRange,
|
|
510
|
+
Be as getMarkType,
|
|
511
|
+
We as getMarksBetween,
|
|
512
|
+
Le as getNodeAtPosition,
|
|
513
|
+
Ue as getNodeAttributes,
|
|
514
|
+
ze as getNodeType,
|
|
515
|
+
He as getRenderedAttributes,
|
|
516
|
+
Je as getSchema,
|
|
517
|
+
$e as getSchemaByResolvedExtensions,
|
|
518
|
+
Ge as getSchemaTypeByName,
|
|
519
|
+
Ke as getSchemaTypeNameByName,
|
|
520
|
+
Qe as getSplittedAttributes,
|
|
521
|
+
Xe as getText,
|
|
522
|
+
Ye as getTextBetween,
|
|
523
|
+
Ze as getTextContentFromNodes,
|
|
524
|
+
et as getTextSerializersFromSchema,
|
|
525
|
+
tt as getUpdatedPosition,
|
|
526
|
+
st as h,
|
|
527
|
+
rt as injectExtensionAttributesToParseRule,
|
|
528
|
+
nt as inputRulesPlugin,
|
|
529
|
+
at as isActive,
|
|
530
|
+
it as isAndroid,
|
|
531
|
+
ot as isAtEndOfNode,
|
|
532
|
+
dt as isAtStartOfNode,
|
|
533
|
+
ut as isEmptyObject,
|
|
534
|
+
lt as isExtensionRulesEnabled,
|
|
535
|
+
ct as isFirefox,
|
|
536
|
+
pt as isFunction,
|
|
537
|
+
ht as isList,
|
|
538
|
+
mt as isMacOS,
|
|
539
|
+
gt as isMarkActive,
|
|
540
|
+
vt as isNodeActive,
|
|
541
|
+
ft as isNodeEmpty,
|
|
542
|
+
St as isNodeSelection,
|
|
543
|
+
xt as isNumber,
|
|
544
|
+
yt as isPlainObject,
|
|
545
|
+
wt as isRegExp,
|
|
546
|
+
bt as isSafari,
|
|
547
|
+
Ct as isString,
|
|
548
|
+
Nt as isTextSelection,
|
|
549
|
+
_t as isiOS,
|
|
550
|
+
Et as markInputRule,
|
|
551
|
+
Mt as markPasteRule,
|
|
552
|
+
F as markViewProps,
|
|
553
|
+
Pt as markdown,
|
|
554
|
+
kt as mergeAttributes,
|
|
555
|
+
At as mergeDeep,
|
|
556
|
+
Rt as minMax,
|
|
557
|
+
Ot as nodeInputRule,
|
|
558
|
+
Tt as nodePasteRule,
|
|
559
|
+
W as nodeViewProps,
|
|
560
|
+
Dt as objectIncludes,
|
|
561
|
+
Vt as parseAttributes,
|
|
562
|
+
jt as parseIndentedBlocks,
|
|
563
|
+
qt as pasteRulesPlugin,
|
|
564
|
+
Ft as posToDOMRect,
|
|
565
|
+
It as removeDuplicates,
|
|
566
|
+
Bt as renderNestedMarkdownContent,
|
|
567
|
+
Wt as resolveExtensions,
|
|
568
|
+
Lt as resolveFocusPosition,
|
|
569
|
+
Ut as rewriteUnknownContent,
|
|
570
|
+
zt as selectionToInsertionEnd,
|
|
571
|
+
Ht as serializeAttributes,
|
|
572
|
+
Jt as sortExtensions,
|
|
573
|
+
$t as splitExtensions,
|
|
574
|
+
Gt as textInputRule,
|
|
575
|
+
Kt as textPasteRule,
|
|
576
|
+
Qt as textblockTypeInputRule,
|
|
577
|
+
Xt as updateMarkViewAttributes,
|
|
578
|
+
q as useEditor,
|
|
579
|
+
Yt as wrappingInputRule
|
|
580
|
+
};
|