@vc-shell/framework 1.1.98-rc.5 → 1.1.99-alpha.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/core/api/platform.ts +9883 -9883
- package/core/composables/useNotifications/index.ts +32 -1
- package/core/composables/useSettings/index.ts +8 -3
- package/core/composables/useUser/index.ts +74 -171
- package/core/composables/useUserManagement/index.ts +67 -25
- package/core/interceptors/index.ts +19 -56
- package/core/plugins/signalR/index.ts +27 -1
- package/core/providers/README.md +176 -0
- package/core/providers/auth-provider-manager.ts +74 -0
- package/core/providers/auth-provider-utils.ts +26 -0
- package/core/providers/example-custom-auth-provider.ts +162 -0
- package/core/providers/index.ts +3 -0
- package/core/providers/platform-auth-provider.ts +207 -0
- package/core/types/auth-provider.ts +40 -0
- package/core/types/index.ts +2 -0
- package/dist/core/api/platform.d.ts +1 -1
- package/dist/core/api/platform.d.ts.map +1 -1
- package/dist/core/composables/useNotifications/index.d.ts.map +1 -1
- package/dist/core/composables/useSettings/index.d.ts.map +1 -1
- package/dist/core/composables/useUser/index.d.ts +18 -9
- package/dist/core/composables/useUser/index.d.ts.map +1 -1
- package/dist/core/composables/useUserManagement/index.d.ts +7 -7
- package/dist/core/composables/useUserManagement/index.d.ts.map +1 -1
- package/dist/core/interceptors/index.d.ts +2 -1
- package/dist/core/interceptors/index.d.ts.map +1 -1
- package/dist/core/plugins/signalR/index.d.ts +2 -0
- package/dist/core/plugins/signalR/index.d.ts.map +1 -1
- package/dist/core/providers/auth-provider-manager.d.ts +34 -0
- package/dist/core/providers/auth-provider-manager.d.ts.map +1 -0
- package/dist/core/providers/auth-provider-utils.d.ts +17 -0
- package/dist/core/providers/auth-provider-utils.d.ts.map +1 -0
- package/dist/core/providers/example-custom-auth-provider.d.ts +45 -0
- package/dist/core/providers/example-custom-auth-provider.d.ts.map +1 -0
- package/dist/core/providers/index.d.ts +3 -0
- package/dist/core/providers/index.d.ts.map +1 -0
- package/dist/core/providers/platform-auth-provider.d.ts +34 -0
- package/dist/core/providers/platform-auth-provider.d.ts.map +1 -0
- package/dist/core/types/auth-provider.d.ts +27 -0
- package/dist/core/types/auth-provider.d.ts.map +1 -0
- package/dist/core/types/index.d.ts +1 -1
- package/dist/core/types/index.d.ts.map +1 -1
- package/dist/framework.js +6348 -6198
- package/dist/index.css +1 -1
- package/dist/index.d.ts +8 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/injection-keys.d.ts +2 -1
- package/dist/injection-keys.d.ts.map +1 -1
- package/dist/shared/components/app-switcher/composables/useAppSwitcher/index.d.ts.map +1 -1
- package/dist/shared/components/sign-in/useExternalProvider.d.ts +1 -1
- package/dist/shared/components/sign-in/useExternalProvider.d.ts.map +1 -1
- package/dist/shared/modules/dynamic/helpers/nodeBuilder.d.ts.map +1 -1
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/dist/ui/components/organisms/vc-app/vc-app.vue.d.ts.map +1 -1
- package/dist/vendor-tiptap-core-ClsTgaMv.js +3699 -0
- package/dist/{vendor-tiptap-extension-blockquote-BVmAuV7o.js → vendor-tiptap-extension-blockquote-r1MBx4hD.js} +1 -1
- package/dist/{vendor-tiptap-extension-bold-BOh8AIRZ.js → vendor-tiptap-extension-bold-BjLI4i8b.js} +1 -1
- package/dist/{vendor-tiptap-extension-code-R4pc2wFE.js → vendor-tiptap-extension-code-D5-kDnMW.js} +1 -1
- package/dist/{vendor-tiptap-extension-code-block-DibKlZFG.js → vendor-tiptap-extension-code-block-RjEb0zPA.js} +1 -1
- package/dist/{vendor-tiptap-extension-document-BwORJR1k.js → vendor-tiptap-extension-document--PLOxIdq.js} +1 -1
- package/dist/{vendor-tiptap-extension-hard-break-DH36OfVk.js → vendor-tiptap-extension-hard-break-9cxC2YOS.js} +13 -9
- package/dist/{vendor-tiptap-extension-heading-oMLORiPI.js → vendor-tiptap-extension-heading-2w0TutHn.js} +1 -1
- package/dist/{vendor-tiptap-extension-horizontal-rule-BMHSoB_Y.js → vendor-tiptap-extension-horizontal-rule-CFowa_lc.js} +1 -1
- package/dist/vendor-tiptap-extension-image-aWn-na6j.js +127 -0
- package/dist/{vendor-tiptap-extension-italic-BzqrUuB0.js → vendor-tiptap-extension-italic-Bn-6saY0.js} +1 -1
- package/dist/{vendor-tiptap-extension-link-hMFZ0hfl.js → vendor-tiptap-extension-link-BmcG1_k-.js} +1 -1
- package/dist/{vendor-tiptap-extension-list-Bj5AK6Pq.js → vendor-tiptap-extension-list-BrNBJ45n.js} +1 -1
- package/dist/{vendor-tiptap-extension-paragraph-Bs1wl42E.js → vendor-tiptap-extension-paragraph-DAiYhwUB.js} +1 -1
- package/dist/vendor-tiptap-extension-placeholder-9tURDKy-.js +1 -0
- package/dist/{vendor-tiptap-extension-strike-C4YpGyzc.js → vendor-tiptap-extension-strike-DqbXPfos.js} +1 -1
- package/dist/vendor-tiptap-extension-table-DQwPaR7v.js +374 -0
- package/dist/vendor-tiptap-extension-table-cell-C0tEP_0i.js +1 -0
- package/dist/vendor-tiptap-extension-table-header-C0tEP_0i.js +1 -0
- package/dist/vendor-tiptap-extension-table-row-C0tEP_0i.js +1 -0
- package/dist/{vendor-tiptap-extension-text-C4dQW13r.js → vendor-tiptap-extension-text-BFnfj70b.js} +1 -1
- package/dist/{vendor-tiptap-extension-text-style-a_NYjXT6.js → vendor-tiptap-extension-text-style-Darua3qr.js} +1 -1
- package/dist/{vendor-tiptap-extension-underline-DthCaPX3.js → vendor-tiptap-extension-underline-QyVnBqQZ.js} +1 -1
- package/dist/{vendor-tiptap-extensions-C8rF1qdq.js → vendor-tiptap-extensions-CU-D7bfm.js} +1 -1
- package/dist/{vendor-tiptap-markdown-DRc3qhBU.js → vendor-tiptap-markdown-BwATYN5A.js} +1 -1
- package/dist/{vendor-tiptap-starter-kit-BfUUblkP.js → vendor-tiptap-starter-kit-5luf7zzS.js} +17 -17
- package/dist/{vendor-tiptap-vue-3-DYxT2sf6.js → vendor-tiptap-vue-3-CFBErZGb.js} +1 -1
- package/dist/{vendor-vueuse-components-B0zqjNRW.js → vendor-vueuse-components-sgKpNzof.js} +1 -1
- package/dist/{vendor-vueuse-core-CYgwn-B2.js → vendor-vueuse-core-D0cN7FqY.js} +10 -10
- package/dist/{vendor-vueuse-shared-B_uDJJ6V.js → vendor-vueuse-shared-Pt0UEStA.js} +19 -19
- package/package.json +7 -5
- package/shared/components/app-switcher/components/vc-app-switcher/vc-app-switcher.vue +2 -2
- package/shared/components/app-switcher/composables/useAppSwitcher/index.ts +15 -1
- package/shared/components/sign-in/useExternalProvider.ts +11 -1
- package/shared/modules/dynamic/helpers/nodeBuilder.ts +11 -3
- package/ui/components/organisms/vc-app/vc-app.vue +20 -2
- package/dist/vendor-tiptap-core-8RGSOCZs.js +0 -3442
- package/dist/vendor-tiptap-extension-image-DF1ZJ94q.js +0 -80
- package/dist/vendor-tiptap-extension-placeholder-CupUGaI_.js +0 -1
- package/dist/vendor-tiptap-extension-table-D8RFr_6X.js +0 -368
- package/dist/vendor-tiptap-extension-table-cell-k9uLwyL6.js +0 -1
- package/dist/vendor-tiptap-extension-table-header-k9uLwyL6.js +0 -1
- package/dist/vendor-tiptap-extension-table-row-k9uLwyL6.js +0 -1
package/dist/{vendor-tiptap-extension-bold-BOh8AIRZ.js → vendor-tiptap-extension-bold-BjLI4i8b.js}
RENAMED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { M as a, a as r, b as s, h as n, m as o } from "./vendor-tiptap-core-
|
|
1
|
+
import { M as a, a as r, b as s, h as n, m as o } from "./vendor-tiptap-core-ClsTgaMv.js";
|
|
2
2
|
var d = /(?:^|\s)(\*\*(?!\s+\*\*)((?:[^*]+))\*\*(?!\s+\*\*))$/, l = /(?:^|\s)(\*\*(?!\s+\*\*)((?:[^*]+))\*\*(?!\s+\*\*))/g, u = /(?:^|\s)(__(?!\s+__)((?:[^_]+))__(?!\s+__))$/, i = /(?:^|\s)(__(?!\s+__)((?:[^_]+))__(?!\s+__))/g, m = a.create({
|
|
3
3
|
name: "bold",
|
|
4
4
|
addOptions() {
|
package/dist/{vendor-tiptap-extension-code-R4pc2wFE.js → vendor-tiptap-extension-code-D5-kDnMW.js}
RENAMED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { M as r, a, b as n, m as d } from "./vendor-tiptap-core-
|
|
1
|
+
import { M as r, a, b as n, m as d } from "./vendor-tiptap-core-ClsTgaMv.js";
|
|
2
2
|
var s = /(^|[^`])`([^`]+)`(?!`)$/, o = /(^|[^`])`([^`]+)`(?!`)/g, i = r.create({
|
|
3
3
|
name: "code",
|
|
4
4
|
addOptions() {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { N as C, t as S, m as k } from "./vendor-tiptap-core-
|
|
1
|
+
import { N as C, t as S, m as k } from "./vendor-tiptap-core-ClsTgaMv.js";
|
|
2
2
|
import { P as w, a as B, T, S as L } from "./vendor-prosemirror-state-DHaVEu5h.js";
|
|
3
3
|
var y = 4, M = /^```([a-z]+)?[\s\n]$/, N = /^~~~([a-z]+)?[\s\n]$/, $ = C.create({
|
|
4
4
|
name: "codeBlock",
|
|
@@ -1,6 +1,7 @@
|
|
|
1
|
-
import { N as l, m as c } from "./vendor-tiptap-core-
|
|
2
|
-
var
|
|
1
|
+
import { N as l, m as c } from "./vendor-tiptap-core-ClsTgaMv.js";
|
|
2
|
+
var f = l.create({
|
|
3
3
|
name: "hardBreak",
|
|
4
|
+
markdownTokenName: "br",
|
|
4
5
|
addOptions() {
|
|
5
6
|
return {
|
|
6
7
|
keepMarks: !0,
|
|
@@ -23,19 +24,22 @@ var M = l.create({
|
|
|
23
24
|
},
|
|
24
25
|
renderMarkdown: (e, r) => r.indent(`
|
|
25
26
|
`),
|
|
27
|
+
parseMarkdown: () => ({
|
|
28
|
+
type: "hardBreak"
|
|
29
|
+
}),
|
|
26
30
|
addCommands() {
|
|
27
31
|
return {
|
|
28
32
|
setHardBreak: () => ({ commands: e, chain: r, state: a, editor: s }) => e.first([
|
|
29
33
|
() => e.exitCode(),
|
|
30
34
|
() => e.command(() => {
|
|
31
|
-
const { selection: t, storedMarks:
|
|
35
|
+
const { selection: t, storedMarks: o } = a;
|
|
32
36
|
if (t.$from.parent.type.spec.isolating)
|
|
33
37
|
return !1;
|
|
34
|
-
const { keepMarks:
|
|
35
|
-
return r().insertContent({ type: this.name }).command(({ tr: u, dispatch:
|
|
36
|
-
if (
|
|
37
|
-
const
|
|
38
|
-
u.ensureMarks(
|
|
38
|
+
const { keepMarks: i } = this.options, { splittableMarks: d } = s.extensionManager, n = o || t.$to.parentOffset && t.$from.marks();
|
|
39
|
+
return r().insertContent({ type: this.name }).command(({ tr: u, dispatch: k }) => {
|
|
40
|
+
if (k && n && i) {
|
|
41
|
+
const m = n.filter((p) => d.includes(p.type.name));
|
|
42
|
+
u.ensureMarks(m);
|
|
39
43
|
}
|
|
40
44
|
return !0;
|
|
41
45
|
}).run();
|
|
@@ -51,5 +55,5 @@ var M = l.create({
|
|
|
51
55
|
}
|
|
52
56
|
});
|
|
53
57
|
export {
|
|
54
|
-
|
|
58
|
+
f as H
|
|
55
59
|
};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { N as m, n as f, c as h, i as T, m as N } from "./vendor-tiptap-core-
|
|
1
|
+
import { N as m, n as f, c as h, i as T, m as N } from "./vendor-tiptap-core-ClsTgaMv.js";
|
|
2
2
|
import { T as s, N as y } from "./vendor-prosemirror-state-DHaVEu5h.js";
|
|
3
3
|
var H = m.create({
|
|
4
4
|
name: "horizontalRule",
|
|
@@ -0,0 +1,127 @@
|
|
|
1
|
+
import { N as h, n as m, R as f, m as g } from "./vendor-tiptap-core-ClsTgaMv.js";
|
|
2
|
+
var b = /(?:^|\s)(!\[(.+|:?)]\((\S+)(?:(?:\s+)["'](\S+)["'])?\))$/, y = h.create({
|
|
3
|
+
name: "image",
|
|
4
|
+
addOptions() {
|
|
5
|
+
return {
|
|
6
|
+
inline: !1,
|
|
7
|
+
allowBase64: !1,
|
|
8
|
+
HTMLAttributes: {},
|
|
9
|
+
resize: !1
|
|
10
|
+
};
|
|
11
|
+
},
|
|
12
|
+
inline() {
|
|
13
|
+
return this.options.inline;
|
|
14
|
+
},
|
|
15
|
+
group() {
|
|
16
|
+
return this.options.inline ? "inline" : "block";
|
|
17
|
+
},
|
|
18
|
+
draggable: !0,
|
|
19
|
+
addAttributes() {
|
|
20
|
+
return {
|
|
21
|
+
src: {
|
|
22
|
+
default: null
|
|
23
|
+
},
|
|
24
|
+
alt: {
|
|
25
|
+
default: null
|
|
26
|
+
},
|
|
27
|
+
title: {
|
|
28
|
+
default: null
|
|
29
|
+
},
|
|
30
|
+
width: {
|
|
31
|
+
default: null
|
|
32
|
+
},
|
|
33
|
+
height: {
|
|
34
|
+
default: null
|
|
35
|
+
}
|
|
36
|
+
};
|
|
37
|
+
},
|
|
38
|
+
parseHTML() {
|
|
39
|
+
return [
|
|
40
|
+
{
|
|
41
|
+
tag: this.options.allowBase64 ? "img[src]" : 'img[src]:not([src^="data:"])'
|
|
42
|
+
}
|
|
43
|
+
];
|
|
44
|
+
},
|
|
45
|
+
renderHTML({ HTMLAttributes: t }) {
|
|
46
|
+
return ["img", g(this.options.HTMLAttributes, t)];
|
|
47
|
+
},
|
|
48
|
+
parseMarkdown: (t, e) => e.createNode("image", {
|
|
49
|
+
src: t.href,
|
|
50
|
+
title: t.title,
|
|
51
|
+
alt: t.text
|
|
52
|
+
}),
|
|
53
|
+
renderMarkdown: (t) => {
|
|
54
|
+
var e, l, a, o, u, d;
|
|
55
|
+
const i = (l = (e = t.attrs) == null ? void 0 : e.src) != null ? l : "", c = (o = (a = t.attrs) == null ? void 0 : a.alt) != null ? o : "", r = (d = (u = t.attrs) == null ? void 0 : u.title) != null ? d : "";
|
|
56
|
+
return r ? `` : ``;
|
|
57
|
+
},
|
|
58
|
+
addNodeView() {
|
|
59
|
+
if (!this.options.resize || !this.options.resize.enabled || typeof document > "u" || !this.editor.isEditable)
|
|
60
|
+
return null;
|
|
61
|
+
const { directions: t, minWidth: e, minHeight: l, alwaysPreserveAspectRatio: a } = this.options.resize;
|
|
62
|
+
return ({ node: o, getPos: u, HTMLAttributes: d }) => {
|
|
63
|
+
const i = document.createElement("img");
|
|
64
|
+
Object.entries(d).forEach(([n, s]) => {
|
|
65
|
+
if (s != null)
|
|
66
|
+
switch (n) {
|
|
67
|
+
case "width":
|
|
68
|
+
case "height":
|
|
69
|
+
break;
|
|
70
|
+
default:
|
|
71
|
+
i.setAttribute(n, s);
|
|
72
|
+
break;
|
|
73
|
+
}
|
|
74
|
+
}), i.src = d.src;
|
|
75
|
+
const c = new f({
|
|
76
|
+
element: i,
|
|
77
|
+
node: o,
|
|
78
|
+
getPos: u,
|
|
79
|
+
onResize: (n, s) => {
|
|
80
|
+
i.style.width = `${n}px`, i.style.height = `${s}px`;
|
|
81
|
+
},
|
|
82
|
+
onCommit: (n, s) => {
|
|
83
|
+
const p = u();
|
|
84
|
+
p !== void 0 && this.editor.chain().setNodeSelection(p).updateAttributes(this.name, {
|
|
85
|
+
width: n,
|
|
86
|
+
height: s
|
|
87
|
+
}).run();
|
|
88
|
+
},
|
|
89
|
+
onUpdate: (n, s, p) => n.type === o.type,
|
|
90
|
+
options: {
|
|
91
|
+
directions: t,
|
|
92
|
+
min: {
|
|
93
|
+
width: e,
|
|
94
|
+
height: l
|
|
95
|
+
},
|
|
96
|
+
preserveAspectRatio: a === !0
|
|
97
|
+
}
|
|
98
|
+
}), r = c.dom;
|
|
99
|
+
return r.style.visibility = "hidden", r.style.pointerEvents = "none", i.onload = () => {
|
|
100
|
+
r.style.visibility = "", r.style.pointerEvents = "";
|
|
101
|
+
}, c;
|
|
102
|
+
};
|
|
103
|
+
},
|
|
104
|
+
addCommands() {
|
|
105
|
+
return {
|
|
106
|
+
setImage: (t) => ({ commands: e }) => e.insertContent({
|
|
107
|
+
type: this.name,
|
|
108
|
+
attrs: t
|
|
109
|
+
})
|
|
110
|
+
};
|
|
111
|
+
},
|
|
112
|
+
addInputRules() {
|
|
113
|
+
return [
|
|
114
|
+
m({
|
|
115
|
+
find: b,
|
|
116
|
+
type: this.type,
|
|
117
|
+
getAttributes: (t) => {
|
|
118
|
+
const [, , e, l, a] = t;
|
|
119
|
+
return { src: l, alt: e, title: a };
|
|
120
|
+
}
|
|
121
|
+
})
|
|
122
|
+
];
|
|
123
|
+
}
|
|
124
|
+
});
|
|
125
|
+
export {
|
|
126
|
+
y as I
|
|
127
|
+
};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { M as s, a as r, b as a, m as n } from "./vendor-tiptap-core-
|
|
1
|
+
import { M as s, a as r, b as a, m as n } from "./vendor-tiptap-core-ClsTgaMv.js";
|
|
2
2
|
var i = /(?:^|\s)(\*(?!\s+\*)((?:[^*]+))\*(?!\s+\*))$/, d = /(?:^|\s)(\*(?!\s+\*)((?:[^*]+))\*(?!\s+\*))/g, o = /(?:^|\s)(_(?!\s+_)((?:[^_]+))_(?!\s+_))$/, l = /(?:^|\s)(_(?!\s+_)((?:[^_]+))_(?!\s+_))/g, m = s.create({
|
|
3
3
|
name: "italic",
|
|
4
4
|
addOptions() {
|
package/dist/{vendor-tiptap-extension-link-hMFZ0hfl.js → vendor-tiptap-extension-link-BmcG1_k-.js}
RENAMED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { M as x, a as b, m as v, d as T, g as w, f as _, e as H, j as O } from "./vendor-tiptap-core-
|
|
1
|
+
import { M as x, a as b, m as v, d as T, g as w, f as _, e as H, j as O } from "./vendor-tiptap-core-ClsTgaMv.js";
|
|
2
2
|
import { r as M, t as R, f as C, a as I } from "./vendor-linkifyjs-dCH9UYes.js";
|
|
3
3
|
import { P as m, a as A } from "./vendor-prosemirror-state-DHaVEu5h.js";
|
|
4
4
|
var P = "[\0- -\u2029 ]", B = new RegExp(P), U = new RegExp(`${P}$`), N = new RegExp(P, "g");
|
package/dist/{vendor-tiptap-extension-list-Bj5AK6Pq.js → vendor-tiptap-extension-list-BrNBJ45n.js}
RENAMED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { N as L, E, w as k, m, r as H, k as g, l as B, o as j, p as $, q as K, s as M } from "./vendor-tiptap-core-
|
|
1
|
+
import { N as L, E, w as k, m, r as H, k as g, l as B, o as j, p as $, q as K, s as M } from "./vendor-tiptap-core-ClsTgaMv.js";
|
|
2
2
|
var V = Object.defineProperty, X = (t, e) => {
|
|
3
3
|
for (var s in e)
|
|
4
4
|
V(t, s, { get: e[s], enumerable: !0 });
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import "./vendor-tiptap-extensions-CU-D7bfm.js";
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { M as r, a as s, b as a, m as n } from "./vendor-tiptap-core-
|
|
1
|
+
import { M as r, a as s, b as a, m as n } from "./vendor-tiptap-core-ClsTgaMv.js";
|
|
2
2
|
var i = /(?:^|\s)(~~(?!\s+~~)((?:[^~]+))~~(?!\s+~~))$/, d = /(?:^|\s)(~~(?!\s+~~)((?:[^~]+))~~(?!\s+~~))/g, o = r.create({
|
|
3
3
|
name: "strike",
|
|
4
4
|
addOptions() {
|
|
@@ -0,0 +1,374 @@
|
|
|
1
|
+
import { N as x, u as $, v as _, m as M, x as k, E as O } from "./vendor-tiptap-core-ClsTgaMv.js";
|
|
2
|
+
import { T as I } from "./vendor-prosemirror-state-DHaVEu5h.js";
|
|
3
|
+
import { c as P, t as j, C as N, f as z, g as H, s as D, m as W, a as v, b as V, d as S, e as B, h as K, i as F, j as U, k as q, l as G, n as J } from "./vendor-prosemirror-tables-mYok4vGT.js";
|
|
4
|
+
var Q = x.create({
|
|
5
|
+
name: "tableCell",
|
|
6
|
+
addOptions() {
|
|
7
|
+
return {
|
|
8
|
+
HTMLAttributes: {}
|
|
9
|
+
};
|
|
10
|
+
},
|
|
11
|
+
content: "block+",
|
|
12
|
+
addAttributes() {
|
|
13
|
+
return {
|
|
14
|
+
colspan: {
|
|
15
|
+
default: 1
|
|
16
|
+
},
|
|
17
|
+
rowspan: {
|
|
18
|
+
default: 1
|
|
19
|
+
},
|
|
20
|
+
colwidth: {
|
|
21
|
+
default: null,
|
|
22
|
+
parseHTML: (e) => {
|
|
23
|
+
var t, n;
|
|
24
|
+
const l = e.getAttribute("colwidth"), u = l ? l.split(",").map((r) => parseInt(r, 10)) : null;
|
|
25
|
+
if (!u) {
|
|
26
|
+
const r = (t = e.closest("table")) == null ? void 0 : t.querySelectorAll("colgroup > col"), i = Array.from(((n = e.parentElement) == null ? void 0 : n.children) || []).indexOf(e);
|
|
27
|
+
if (i && i > -1 && r && r[i]) {
|
|
28
|
+
const a = r[i].getAttribute("width");
|
|
29
|
+
return a ? [parseInt(a, 10)] : null;
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
return u;
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
};
|
|
36
|
+
},
|
|
37
|
+
tableRole: "cell",
|
|
38
|
+
isolating: !0,
|
|
39
|
+
parseHTML() {
|
|
40
|
+
return [{ tag: "td" }];
|
|
41
|
+
},
|
|
42
|
+
renderHTML({ HTMLAttributes: e }) {
|
|
43
|
+
return ["td", M(this.options.HTMLAttributes, e), 0];
|
|
44
|
+
}
|
|
45
|
+
}), X = x.create({
|
|
46
|
+
name: "tableHeader",
|
|
47
|
+
addOptions() {
|
|
48
|
+
return {
|
|
49
|
+
HTMLAttributes: {}
|
|
50
|
+
};
|
|
51
|
+
},
|
|
52
|
+
content: "block+",
|
|
53
|
+
addAttributes() {
|
|
54
|
+
return {
|
|
55
|
+
colspan: {
|
|
56
|
+
default: 1
|
|
57
|
+
},
|
|
58
|
+
rowspan: {
|
|
59
|
+
default: 1
|
|
60
|
+
},
|
|
61
|
+
colwidth: {
|
|
62
|
+
default: null,
|
|
63
|
+
parseHTML: (e) => {
|
|
64
|
+
const t = e.getAttribute("colwidth");
|
|
65
|
+
return t ? t.split(",").map((l) => parseInt(l, 10)) : null;
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
};
|
|
69
|
+
},
|
|
70
|
+
tableRole: "header_cell",
|
|
71
|
+
isolating: !0,
|
|
72
|
+
parseHTML() {
|
|
73
|
+
return [{ tag: "th" }];
|
|
74
|
+
},
|
|
75
|
+
renderHTML({ HTMLAttributes: e }) {
|
|
76
|
+
return ["th", M(this.options.HTMLAttributes, e), 0];
|
|
77
|
+
}
|
|
78
|
+
}), Y = x.create({
|
|
79
|
+
name: "tableRow",
|
|
80
|
+
addOptions() {
|
|
81
|
+
return {
|
|
82
|
+
HTMLAttributes: {}
|
|
83
|
+
};
|
|
84
|
+
},
|
|
85
|
+
content: "(tableCell | tableHeader)*",
|
|
86
|
+
tableRole: "row",
|
|
87
|
+
parseHTML() {
|
|
88
|
+
return [{ tag: "tr" }];
|
|
89
|
+
},
|
|
90
|
+
renderHTML({ HTMLAttributes: e }) {
|
|
91
|
+
return ["tr", M(this.options.HTMLAttributes, e), 0];
|
|
92
|
+
}
|
|
93
|
+
});
|
|
94
|
+
function R(e, t) {
|
|
95
|
+
return t ? ["width", `${Math.max(t, e)}px`] : ["min-width", `${e}px`];
|
|
96
|
+
}
|
|
97
|
+
function E(e, t, n, l, u, r) {
|
|
98
|
+
var i;
|
|
99
|
+
let a = 0, f = !0, c = t.firstChild;
|
|
100
|
+
const b = e.firstChild;
|
|
101
|
+
if (b !== null)
|
|
102
|
+
for (let m = 0, y = 0; m < b.childCount; m += 1) {
|
|
103
|
+
const { colspan: s, colwidth: d } = b.child(m).attrs;
|
|
104
|
+
for (let o = 0; o < s; o += 1, y += 1) {
|
|
105
|
+
const h = u === y ? r : d && d[o], C = h ? `${h}px` : "";
|
|
106
|
+
if (a += h || l, h || (f = !1), c) {
|
|
107
|
+
if (c.style.width !== C) {
|
|
108
|
+
const [g, w] = R(l, h);
|
|
109
|
+
c.style.setProperty(g, w);
|
|
110
|
+
}
|
|
111
|
+
c = c.nextSibling;
|
|
112
|
+
} else {
|
|
113
|
+
const g = document.createElement("col"), [w, A] = R(l, h);
|
|
114
|
+
g.style.setProperty(w, A), t.appendChild(g);
|
|
115
|
+
}
|
|
116
|
+
}
|
|
117
|
+
}
|
|
118
|
+
for (; c; ) {
|
|
119
|
+
const m = c.nextSibling;
|
|
120
|
+
(i = c.parentNode) == null || i.removeChild(c), c = m;
|
|
121
|
+
}
|
|
122
|
+
const p = e.attrs.style && typeof e.attrs.style == "string" && /\bwidth\s*:/i.test(e.attrs.style);
|
|
123
|
+
f && !p ? (n.style.width = `${a}px`, n.style.minWidth = "") : (n.style.width = "", n.style.minWidth = `${a}px`);
|
|
124
|
+
}
|
|
125
|
+
var Z = class {
|
|
126
|
+
constructor(e, t) {
|
|
127
|
+
this.node = e, this.cellMinWidth = t, this.dom = document.createElement("div"), this.dom.className = "tableWrapper", this.table = this.dom.appendChild(document.createElement("table")), e.attrs.style && (this.table.style.cssText = e.attrs.style), this.colgroup = this.table.appendChild(document.createElement("colgroup")), E(e, this.colgroup, this.table, t), this.contentDOM = this.table.appendChild(document.createElement("tbody"));
|
|
128
|
+
}
|
|
129
|
+
update(e) {
|
|
130
|
+
return e.type !== this.node.type ? !1 : (this.node = e, E(e, this.colgroup, this.table, this.cellMinWidth), !0);
|
|
131
|
+
}
|
|
132
|
+
ignoreMutation(e) {
|
|
133
|
+
const t = e.target, n = this.dom.contains(t), l = this.contentDOM.contains(t);
|
|
134
|
+
return !!(n && !l && (e.type === "attributes" || e.type === "childList" || e.type === "characterData"));
|
|
135
|
+
}
|
|
136
|
+
};
|
|
137
|
+
function ee(e, t, n, l) {
|
|
138
|
+
let u = 0, r = !0;
|
|
139
|
+
const i = [], a = e.firstChild;
|
|
140
|
+
if (!a)
|
|
141
|
+
return {};
|
|
142
|
+
for (let p = 0, m = 0; p < a.childCount; p += 1) {
|
|
143
|
+
const { colspan: y, colwidth: s } = a.child(p).attrs;
|
|
144
|
+
for (let d = 0; d < y; d += 1, m += 1) {
|
|
145
|
+
const o = n === m ? l : s && s[d];
|
|
146
|
+
u += o || t, o || (r = !1);
|
|
147
|
+
const [h, C] = R(t, o);
|
|
148
|
+
i.push(["col", { style: `${h}: ${C}` }]);
|
|
149
|
+
}
|
|
150
|
+
}
|
|
151
|
+
const f = r ? `${u}px` : "", c = r ? "" : `${u}px`;
|
|
152
|
+
return { colgroup: ["colgroup", {}, ...i], tableWidth: f, tableMinWidth: c };
|
|
153
|
+
}
|
|
154
|
+
function L(e, t) {
|
|
155
|
+
return e.createAndFill();
|
|
156
|
+
}
|
|
157
|
+
function te(e) {
|
|
158
|
+
if (e.cached.tableNodeTypes)
|
|
159
|
+
return e.cached.tableNodeTypes;
|
|
160
|
+
const t = {};
|
|
161
|
+
return Object.keys(e.nodes).forEach((n) => {
|
|
162
|
+
const l = e.nodes[n];
|
|
163
|
+
l.spec.tableRole && (t[l.spec.tableRole] = l);
|
|
164
|
+
}), e.cached.tableNodeTypes = t, t;
|
|
165
|
+
}
|
|
166
|
+
function le(e, t, n, l, u) {
|
|
167
|
+
const r = te(e), i = [], a = [];
|
|
168
|
+
for (let c = 0; c < n; c += 1) {
|
|
169
|
+
const b = L(r.cell);
|
|
170
|
+
if (b && a.push(b), l) {
|
|
171
|
+
const p = L(r.header_cell);
|
|
172
|
+
p && i.push(p);
|
|
173
|
+
}
|
|
174
|
+
}
|
|
175
|
+
const f = [];
|
|
176
|
+
for (let c = 0; c < t; c += 1)
|
|
177
|
+
f.push(r.row.createChecked(null, l && c === 0 ? i : a));
|
|
178
|
+
return r.table.createChecked(null, f);
|
|
179
|
+
}
|
|
180
|
+
function re(e) {
|
|
181
|
+
return e instanceof N;
|
|
182
|
+
}
|
|
183
|
+
var T = ({ editor: e }) => {
|
|
184
|
+
const { selection: t } = e.state;
|
|
185
|
+
if (!re(t))
|
|
186
|
+
return !1;
|
|
187
|
+
let n = 0;
|
|
188
|
+
const l = k(t.ranges[0].$from, (r) => r.type.name === "table");
|
|
189
|
+
return l?.node.descendants((r) => {
|
|
190
|
+
if (r.type.name === "table")
|
|
191
|
+
return !1;
|
|
192
|
+
["tableCell", "tableHeader"].includes(r.type.name) && (n += 1);
|
|
193
|
+
}), n === t.ranges.length ? (e.commands.deleteTable(), !0) : !1;
|
|
194
|
+
}, ne = "";
|
|
195
|
+
function oe(e) {
|
|
196
|
+
return (e || "").replace(/\s+/g, " ").trim();
|
|
197
|
+
}
|
|
198
|
+
function ae(e, t, n = {}) {
|
|
199
|
+
var l;
|
|
200
|
+
const u = (l = n.cellLineSeparator) != null ? l : ne;
|
|
201
|
+
if (!e || !e.content || e.content.length === 0)
|
|
202
|
+
return "";
|
|
203
|
+
const r = [];
|
|
204
|
+
e.content.forEach((s) => {
|
|
205
|
+
const d = [];
|
|
206
|
+
s.content && s.content.forEach((o) => {
|
|
207
|
+
let h = "";
|
|
208
|
+
o.content && Array.isArray(o.content) && o.content.length > 1 ? h = o.content.map((A) => t.renderChildren(A)).join(u) : h = o.content ? t.renderChildren(o.content) : "";
|
|
209
|
+
const C = oe(h), g = o.type === "tableHeader";
|
|
210
|
+
d.push({ text: C, isHeader: g });
|
|
211
|
+
}), r.push(d);
|
|
212
|
+
});
|
|
213
|
+
const i = r.reduce((s, d) => Math.max(s, d.length), 0);
|
|
214
|
+
if (i === 0)
|
|
215
|
+
return "";
|
|
216
|
+
const a = new Array(i).fill(0);
|
|
217
|
+
r.forEach((s) => {
|
|
218
|
+
var d;
|
|
219
|
+
for (let o = 0; o < i; o += 1) {
|
|
220
|
+
const C = (((d = s[o]) == null ? void 0 : d.text) || "").length;
|
|
221
|
+
C > a[o] && (a[o] = C), a[o] < 3 && (a[o] = 3);
|
|
222
|
+
}
|
|
223
|
+
});
|
|
224
|
+
const f = (s, d) => s + " ".repeat(Math.max(0, d - s.length)), c = r[0], b = c.some((s) => s.isHeader);
|
|
225
|
+
let p = `
|
|
226
|
+
`;
|
|
227
|
+
const m = new Array(i).fill(0).map((s, d) => b && c[d] && c[d].text || "");
|
|
228
|
+
return p += `| ${m.map((s, d) => f(s, a[d])).join(" | ")} |
|
|
229
|
+
`, p += `| ${a.map((s) => "-".repeat(Math.max(3, s))).join(" | ")} |
|
|
230
|
+
`, (b ? r.slice(1) : r).forEach((s) => {
|
|
231
|
+
p += `| ${new Array(i).fill(0).map((d, o) => f(s[o] && s[o].text || "", a[o])).join(" | ")} |
|
|
232
|
+
`;
|
|
233
|
+
}), p;
|
|
234
|
+
}
|
|
235
|
+
var se = ae, ie = x.create({
|
|
236
|
+
name: "table",
|
|
237
|
+
// @ts-ignore
|
|
238
|
+
addOptions() {
|
|
239
|
+
return {
|
|
240
|
+
HTMLAttributes: {},
|
|
241
|
+
resizable: !1,
|
|
242
|
+
renderWrapper: !1,
|
|
243
|
+
handleWidth: 5,
|
|
244
|
+
cellMinWidth: 25,
|
|
245
|
+
// TODO: fix
|
|
246
|
+
View: Z,
|
|
247
|
+
lastColumnResizable: !0,
|
|
248
|
+
allowTableNodeSelection: !1
|
|
249
|
+
};
|
|
250
|
+
},
|
|
251
|
+
content: "tableRow+",
|
|
252
|
+
tableRole: "table",
|
|
253
|
+
isolating: !0,
|
|
254
|
+
group: "block",
|
|
255
|
+
parseHTML() {
|
|
256
|
+
return [{ tag: "table" }];
|
|
257
|
+
},
|
|
258
|
+
renderHTML({ node: e, HTMLAttributes: t }) {
|
|
259
|
+
const { colgroup: n, tableWidth: l, tableMinWidth: u } = ee(e, this.options.cellMinWidth), r = t.style;
|
|
260
|
+
function i() {
|
|
261
|
+
return r || (l ? `width: ${l}` : `min-width: ${u}`);
|
|
262
|
+
}
|
|
263
|
+
const a = [
|
|
264
|
+
"table",
|
|
265
|
+
M(this.options.HTMLAttributes, t, {
|
|
266
|
+
style: i()
|
|
267
|
+
}),
|
|
268
|
+
n,
|
|
269
|
+
["tbody", 0]
|
|
270
|
+
];
|
|
271
|
+
return this.options.renderWrapper ? ["div", { class: "tableWrapper" }, a] : a;
|
|
272
|
+
},
|
|
273
|
+
parseMarkdown: (e, t) => {
|
|
274
|
+
const n = [];
|
|
275
|
+
if (e.header) {
|
|
276
|
+
const l = [];
|
|
277
|
+
e.header.forEach((u) => {
|
|
278
|
+
l.push(t.createNode("tableHeader", {}, [{ type: "paragraph", content: t.parseInline(u.tokens) }]));
|
|
279
|
+
}), n.push(t.createNode("tableRow", {}, l));
|
|
280
|
+
}
|
|
281
|
+
return e.rows && e.rows.forEach((l) => {
|
|
282
|
+
const u = [];
|
|
283
|
+
l.forEach((r) => {
|
|
284
|
+
u.push(t.createNode("tableCell", {}, [{ type: "paragraph", content: t.parseInline(r.tokens) }]));
|
|
285
|
+
}), n.push(t.createNode("tableRow", {}, u));
|
|
286
|
+
}), t.createNode("table", void 0, n);
|
|
287
|
+
},
|
|
288
|
+
renderMarkdown: (e, t) => se(e, t),
|
|
289
|
+
addCommands() {
|
|
290
|
+
return {
|
|
291
|
+
insertTable: ({ rows: e = 3, cols: t = 3, withHeaderRow: n = !0 } = {}) => ({ tr: l, dispatch: u, editor: r }) => {
|
|
292
|
+
const i = le(r.schema, e, t, n);
|
|
293
|
+
if (u) {
|
|
294
|
+
const a = l.selection.from + 1;
|
|
295
|
+
l.replaceSelectionWith(i).scrollIntoView().setSelection(I.near(l.doc.resolve(a)));
|
|
296
|
+
}
|
|
297
|
+
return !0;
|
|
298
|
+
},
|
|
299
|
+
addColumnBefore: () => ({ state: e, dispatch: t }) => J(e, t),
|
|
300
|
+
addColumnAfter: () => ({ state: e, dispatch: t }) => G(e, t),
|
|
301
|
+
deleteColumn: () => ({ state: e, dispatch: t }) => q(e, t),
|
|
302
|
+
addRowBefore: () => ({ state: e, dispatch: t }) => U(e, t),
|
|
303
|
+
addRowAfter: () => ({ state: e, dispatch: t }) => F(e, t),
|
|
304
|
+
deleteRow: () => ({ state: e, dispatch: t }) => K(e, t),
|
|
305
|
+
deleteTable: () => ({ state: e, dispatch: t }) => B(e, t),
|
|
306
|
+
mergeCells: () => ({ state: e, dispatch: t }) => W(e, t),
|
|
307
|
+
splitCell: () => ({ state: e, dispatch: t }) => v(e, t),
|
|
308
|
+
toggleHeaderColumn: () => ({ state: e, dispatch: t }) => S("column")(e, t),
|
|
309
|
+
toggleHeaderRow: () => ({ state: e, dispatch: t }) => S("row")(e, t),
|
|
310
|
+
toggleHeaderCell: () => ({ state: e, dispatch: t }) => V(e, t),
|
|
311
|
+
mergeOrSplit: () => ({ state: e, dispatch: t }) => W(e, t) ? !0 : v(e, t),
|
|
312
|
+
setCellAttribute: (e, t) => ({ state: n, dispatch: l }) => D(e, t)(n, l),
|
|
313
|
+
goToNextCell: () => ({ state: e, dispatch: t }) => H(1)(e, t),
|
|
314
|
+
goToPreviousCell: () => ({ state: e, dispatch: t }) => H(-1)(e, t),
|
|
315
|
+
fixTables: () => ({ state: e, dispatch: t }) => (t && z(e), !0),
|
|
316
|
+
setCellSelection: (e) => ({ tr: t, dispatch: n }) => {
|
|
317
|
+
if (n) {
|
|
318
|
+
const l = N.create(t.doc, e.anchorCell, e.headCell);
|
|
319
|
+
t.setSelection(l);
|
|
320
|
+
}
|
|
321
|
+
return !0;
|
|
322
|
+
}
|
|
323
|
+
};
|
|
324
|
+
},
|
|
325
|
+
addKeyboardShortcuts() {
|
|
326
|
+
return {
|
|
327
|
+
Tab: () => this.editor.commands.goToNextCell() ? !0 : this.editor.can().addRowAfter() ? this.editor.chain().addRowAfter().goToNextCell().run() : !1,
|
|
328
|
+
"Shift-Tab": () => this.editor.commands.goToPreviousCell(),
|
|
329
|
+
Backspace: T,
|
|
330
|
+
"Mod-Backspace": T,
|
|
331
|
+
Delete: T,
|
|
332
|
+
"Mod-Delete": T
|
|
333
|
+
};
|
|
334
|
+
},
|
|
335
|
+
addProseMirrorPlugins() {
|
|
336
|
+
return [
|
|
337
|
+
...this.options.resizable && this.editor.isEditable ? [
|
|
338
|
+
P({
|
|
339
|
+
handleWidth: this.options.handleWidth,
|
|
340
|
+
cellMinWidth: this.options.cellMinWidth,
|
|
341
|
+
defaultCellMinWidth: this.options.cellMinWidth,
|
|
342
|
+
View: this.options.View,
|
|
343
|
+
lastColumnResizable: this.options.lastColumnResizable
|
|
344
|
+
})
|
|
345
|
+
] : [],
|
|
346
|
+
j({
|
|
347
|
+
allowTableNodeSelection: this.options.allowTableNodeSelection
|
|
348
|
+
})
|
|
349
|
+
];
|
|
350
|
+
},
|
|
351
|
+
extendNodeSchema(e) {
|
|
352
|
+
const t = {
|
|
353
|
+
name: e.name,
|
|
354
|
+
options: e.options,
|
|
355
|
+
storage: e.storage
|
|
356
|
+
};
|
|
357
|
+
return {
|
|
358
|
+
tableRole: $(_(e, "tableRole", t))
|
|
359
|
+
};
|
|
360
|
+
}
|
|
361
|
+
});
|
|
362
|
+
O.create({
|
|
363
|
+
name: "tableKit",
|
|
364
|
+
addExtensions() {
|
|
365
|
+
const e = [];
|
|
366
|
+
return this.options.table !== !1 && e.push(ie.configure(this.options.table)), this.options.tableCell !== !1 && e.push(Q.configure(this.options.tableCell)), this.options.tableHeader !== !1 && e.push(X.configure(this.options.tableHeader)), this.options.tableRow !== !1 && e.push(Y.configure(this.options.tableRow)), e;
|
|
367
|
+
}
|
|
368
|
+
});
|
|
369
|
+
export {
|
|
370
|
+
ie as T,
|
|
371
|
+
Y as a,
|
|
372
|
+
X as b,
|
|
373
|
+
Q as c
|
|
374
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import "./vendor-tiptap-extension-table-DQwPaR7v.js";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import "./vendor-tiptap-extension-table-DQwPaR7v.js";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import "./vendor-tiptap-extension-table-DQwPaR7v.js";
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { M as y, m as p, E as l } from "./vendor-tiptap-core-
|
|
1
|
+
import { M as y, m as p, E as l } from "./vendor-tiptap-core-ClsTgaMv.js";
|
|
2
2
|
var d = 20, u = (t, e = 0) => {
|
|
3
3
|
const r = [];
|
|
4
4
|
return !t.children.length || e > d || Array.from(t.children).forEach((o) => {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { E as u, y as w, u as v, v as P, i as S } from "./vendor-tiptap-core-
|
|
1
|
+
import { E as u, y as w, u as v, v as P, i as S } from "./vendor-tiptap-core-ClsTgaMv.js";
|
|
2
2
|
import { P as p, a as m } from "./vendor-prosemirror-state-DHaVEu5h.js";
|
|
3
3
|
import { d as z } from "./vendor-prosemirror-dropcursor-BuGmFgFS.js";
|
|
4
4
|
import { a as g, D as f } from "./vendor-prosemirror-view-CspJa44O.js";
|