@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
|
@@ -1,80 +0,0 @@
|
|
|
1
|
-
import { N as o, n as c, m as p } from "./vendor-tiptap-core-8RGSOCZs.js";
|
|
2
|
-
var g = /(?:^|\s)(!\[(.+|:?)]\((\S+)(?:(?:\s+)["'](\S+)["'])?\))$/, f = o.create({
|
|
3
|
-
name: "image",
|
|
4
|
-
addOptions() {
|
|
5
|
-
return {
|
|
6
|
-
inline: !1,
|
|
7
|
-
allowBase64: !1,
|
|
8
|
-
HTMLAttributes: {}
|
|
9
|
-
};
|
|
10
|
-
},
|
|
11
|
-
inline() {
|
|
12
|
-
return this.options.inline;
|
|
13
|
-
},
|
|
14
|
-
group() {
|
|
15
|
-
return this.options.inline ? "inline" : "block";
|
|
16
|
-
},
|
|
17
|
-
draggable: !0,
|
|
18
|
-
addAttributes() {
|
|
19
|
-
return {
|
|
20
|
-
src: {
|
|
21
|
-
default: null
|
|
22
|
-
},
|
|
23
|
-
alt: {
|
|
24
|
-
default: null
|
|
25
|
-
},
|
|
26
|
-
title: {
|
|
27
|
-
default: null
|
|
28
|
-
},
|
|
29
|
-
width: {
|
|
30
|
-
default: null
|
|
31
|
-
},
|
|
32
|
-
height: {
|
|
33
|
-
default: null
|
|
34
|
-
}
|
|
35
|
-
};
|
|
36
|
-
},
|
|
37
|
-
parseHTML() {
|
|
38
|
-
return [
|
|
39
|
-
{
|
|
40
|
-
tag: this.options.allowBase64 ? "img[src]" : 'img[src]:not([src^="data:"])'
|
|
41
|
-
}
|
|
42
|
-
];
|
|
43
|
-
},
|
|
44
|
-
renderHTML({ HTMLAttributes: t }) {
|
|
45
|
-
return ["img", p(this.options.HTMLAttributes, t)];
|
|
46
|
-
},
|
|
47
|
-
parseMarkdown: (t, e) => e.createNode("image", {
|
|
48
|
-
src: t.href,
|
|
49
|
-
title: t.title,
|
|
50
|
-
alt: t.text
|
|
51
|
-
}),
|
|
52
|
-
renderMarkdown: (t) => {
|
|
53
|
-
var e, r, n, l, a, s;
|
|
54
|
-
const i = (r = (e = t.attrs) == null ? void 0 : e.src) != null ? r : "", u = (l = (n = t.attrs) == null ? void 0 : n.alt) != null ? l : "", d = (s = (a = t.attrs) == null ? void 0 : a.title) != null ? s : "";
|
|
55
|
-
return d ? `` : ``;
|
|
56
|
-
},
|
|
57
|
-
addCommands() {
|
|
58
|
-
return {
|
|
59
|
-
setImage: (t) => ({ commands: e }) => e.insertContent({
|
|
60
|
-
type: this.name,
|
|
61
|
-
attrs: t
|
|
62
|
-
})
|
|
63
|
-
};
|
|
64
|
-
},
|
|
65
|
-
addInputRules() {
|
|
66
|
-
return [
|
|
67
|
-
c({
|
|
68
|
-
find: g,
|
|
69
|
-
type: this.type,
|
|
70
|
-
getAttributes: (t) => {
|
|
71
|
-
const [, , e, r, n] = t;
|
|
72
|
-
return { src: r, alt: e, title: n };
|
|
73
|
-
}
|
|
74
|
-
})
|
|
75
|
-
];
|
|
76
|
-
}
|
|
77
|
-
});
|
|
78
|
-
export {
|
|
79
|
-
f as I
|
|
80
|
-
};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import "./vendor-tiptap-extensions-C8rF1qdq.js";
|
|
@@ -1,368 +0,0 @@
|
|
|
1
|
-
import { N as y, u as $, v as _, m as M, x as k, E as O } from "./vendor-tiptap-core-8RGSOCZs.js";
|
|
2
|
-
import { T as I } from "./vendor-prosemirror-state-DHaVEu5h.js";
|
|
3
|
-
import { c as P, t as j, C as S, f as z, g as H, s as D, m as R, a as v, b as V, d as W, e as B, h as K, i as F, j as q, k as G, l as U, n as J } from "./vendor-prosemirror-tables-mYok4vGT.js";
|
|
4
|
-
var Q = y.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, r;
|
|
24
|
-
const l = e.getAttribute("colwidth"), d = l ? l.split(",").map((n) => parseInt(n, 10)) : null;
|
|
25
|
-
if (!d) {
|
|
26
|
-
const n = (t = e.closest("table")) == null ? void 0 : t.querySelectorAll("colgroup > col"), u = Array.from(((r = e.parentElement) == null ? void 0 : r.children) || []).indexOf(e);
|
|
27
|
-
if (u && u > -1 && n && n[u]) {
|
|
28
|
-
const s = n[u].getAttribute("width");
|
|
29
|
-
return s ? [parseInt(s, 10)] : null;
|
|
30
|
-
}
|
|
31
|
-
}
|
|
32
|
-
return d;
|
|
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 = y.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 = y.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 x(e, t) {
|
|
95
|
-
return t ? ["width", `${Math.max(t, e)}px`] : ["min-width", `${e}px`];
|
|
96
|
-
}
|
|
97
|
-
function E(e, t, r, l, d, n) {
|
|
98
|
-
var u;
|
|
99
|
-
let s = 0, f = !0, i = t.firstChild;
|
|
100
|
-
const b = e.firstChild;
|
|
101
|
-
if (b !== null)
|
|
102
|
-
for (let p = 0, C = 0; p < b.childCount; p += 1) {
|
|
103
|
-
const { colspan: w, colwidth: a } = b.child(p).attrs;
|
|
104
|
-
for (let c = 0; c < w; c += 1, C += 1) {
|
|
105
|
-
const o = d === C ? n : a && a[c], m = o ? `${o}px` : "";
|
|
106
|
-
if (s += o || l, o || (f = !1), i) {
|
|
107
|
-
if (i.style.width !== m) {
|
|
108
|
-
const [h, g] = x(l, o);
|
|
109
|
-
i.style.setProperty(h, g);
|
|
110
|
-
}
|
|
111
|
-
i = i.nextSibling;
|
|
112
|
-
} else {
|
|
113
|
-
const h = document.createElement("col"), [g, A] = x(l, o);
|
|
114
|
-
h.style.setProperty(g, A), t.appendChild(h);
|
|
115
|
-
}
|
|
116
|
-
}
|
|
117
|
-
}
|
|
118
|
-
for (; i; ) {
|
|
119
|
-
const p = i.nextSibling;
|
|
120
|
-
(u = i.parentNode) == null || u.removeChild(i), i = p;
|
|
121
|
-
}
|
|
122
|
-
f ? (r.style.width = `${s}px`, r.style.minWidth = "") : (r.style.width = "", r.style.minWidth = `${s}px`);
|
|
123
|
-
}
|
|
124
|
-
var Z = class {
|
|
125
|
-
constructor(e, t) {
|
|
126
|
-
this.node = e, this.cellMinWidth = t, this.dom = document.createElement("div"), this.dom.className = "tableWrapper", this.table = this.dom.appendChild(document.createElement("table")), this.colgroup = this.table.appendChild(document.createElement("colgroup")), E(e, this.colgroup, this.table, t), this.contentDOM = this.table.appendChild(document.createElement("tbody"));
|
|
127
|
-
}
|
|
128
|
-
update(e) {
|
|
129
|
-
return e.type !== this.node.type ? !1 : (this.node = e, E(e, this.colgroup, this.table, this.cellMinWidth), !0);
|
|
130
|
-
}
|
|
131
|
-
ignoreMutation(e) {
|
|
132
|
-
const t = e.target, r = this.dom.contains(t), l = this.contentDOM.contains(t);
|
|
133
|
-
return !!(r && !l && (e.type === "attributes" || e.type === "childList" || e.type === "characterData"));
|
|
134
|
-
}
|
|
135
|
-
};
|
|
136
|
-
function ee(e, t, r, l) {
|
|
137
|
-
let d = 0, n = !0;
|
|
138
|
-
const u = [], s = e.firstChild;
|
|
139
|
-
if (!s)
|
|
140
|
-
return {};
|
|
141
|
-
for (let p = 0, C = 0; p < s.childCount; p += 1) {
|
|
142
|
-
const { colspan: w, colwidth: a } = s.child(p).attrs;
|
|
143
|
-
for (let c = 0; c < w; c += 1, C += 1) {
|
|
144
|
-
const o = r === C ? l : a && a[c];
|
|
145
|
-
d += o || t, o || (n = !1);
|
|
146
|
-
const [m, h] = x(t, o);
|
|
147
|
-
u.push(["col", { style: `${m}: ${h}` }]);
|
|
148
|
-
}
|
|
149
|
-
}
|
|
150
|
-
const f = n ? `${d}px` : "", i = n ? "" : `${d}px`;
|
|
151
|
-
return { colgroup: ["colgroup", {}, ...u], tableWidth: f, tableMinWidth: i };
|
|
152
|
-
}
|
|
153
|
-
function L(e, t) {
|
|
154
|
-
return e.createAndFill();
|
|
155
|
-
}
|
|
156
|
-
function te(e) {
|
|
157
|
-
if (e.cached.tableNodeTypes)
|
|
158
|
-
return e.cached.tableNodeTypes;
|
|
159
|
-
const t = {};
|
|
160
|
-
return Object.keys(e.nodes).forEach((r) => {
|
|
161
|
-
const l = e.nodes[r];
|
|
162
|
-
l.spec.tableRole && (t[l.spec.tableRole] = l);
|
|
163
|
-
}), e.cached.tableNodeTypes = t, t;
|
|
164
|
-
}
|
|
165
|
-
function le(e, t, r, l, d) {
|
|
166
|
-
const n = te(e), u = [], s = [];
|
|
167
|
-
for (let i = 0; i < r; i += 1) {
|
|
168
|
-
const b = L(n.cell);
|
|
169
|
-
if (b && s.push(b), l) {
|
|
170
|
-
const p = L(n.header_cell);
|
|
171
|
-
p && u.push(p);
|
|
172
|
-
}
|
|
173
|
-
}
|
|
174
|
-
const f = [];
|
|
175
|
-
for (let i = 0; i < t; i += 1)
|
|
176
|
-
f.push(n.row.createChecked(null, l && i === 0 ? u : s));
|
|
177
|
-
return n.table.createChecked(null, f);
|
|
178
|
-
}
|
|
179
|
-
function re(e) {
|
|
180
|
-
return e instanceof S;
|
|
181
|
-
}
|
|
182
|
-
var T = ({ editor: e }) => {
|
|
183
|
-
const { selection: t } = e.state;
|
|
184
|
-
if (!re(t))
|
|
185
|
-
return !1;
|
|
186
|
-
let r = 0;
|
|
187
|
-
const l = k(t.ranges[0].$from, (n) => n.type.name === "table");
|
|
188
|
-
return l?.node.descendants((n) => {
|
|
189
|
-
if (n.type.name === "table")
|
|
190
|
-
return !1;
|
|
191
|
-
["tableCell", "tableHeader"].includes(n.type.name) && (r += 1);
|
|
192
|
-
}), r === t.ranges.length ? (e.commands.deleteTable(), !0) : !1;
|
|
193
|
-
}, ne = "";
|
|
194
|
-
function oe(e) {
|
|
195
|
-
return (e || "").replace(/\s+/g, " ").trim();
|
|
196
|
-
}
|
|
197
|
-
function ae(e, t, r = {}) {
|
|
198
|
-
var l;
|
|
199
|
-
const d = (l = r.cellLineSeparator) != null ? l : ne;
|
|
200
|
-
if (!e || !e.content || e.content.length === 0)
|
|
201
|
-
return "";
|
|
202
|
-
const n = [];
|
|
203
|
-
e.content.forEach((a) => {
|
|
204
|
-
const c = [];
|
|
205
|
-
a.content && a.content.forEach((o) => {
|
|
206
|
-
let m = "";
|
|
207
|
-
o.content && Array.isArray(o.content) && o.content.length > 1 ? m = o.content.map((N) => t.renderChildren(N)).join(d) : m = o.content ? t.renderChildren(o.content) : "";
|
|
208
|
-
const h = oe(m), g = o.type === "tableHeader";
|
|
209
|
-
c.push({ text: h, isHeader: g });
|
|
210
|
-
}), n.push(c);
|
|
211
|
-
});
|
|
212
|
-
const u = n.reduce((a, c) => Math.max(a, c.length), 0);
|
|
213
|
-
if (u === 0)
|
|
214
|
-
return "";
|
|
215
|
-
const s = new Array(u).fill(0);
|
|
216
|
-
n.forEach((a) => {
|
|
217
|
-
var c;
|
|
218
|
-
for (let o = 0; o < u; o += 1) {
|
|
219
|
-
const h = (((c = a[o]) == null ? void 0 : c.text) || "").length;
|
|
220
|
-
h > s[o] && (s[o] = h), s[o] < 3 && (s[o] = 3);
|
|
221
|
-
}
|
|
222
|
-
});
|
|
223
|
-
const f = (a, c) => a + " ".repeat(Math.max(0, c - a.length)), i = n[0], b = i.some((a) => a.isHeader);
|
|
224
|
-
let p = `
|
|
225
|
-
`;
|
|
226
|
-
const C = new Array(u).fill(0).map((a, c) => b && i[c] && i[c].text || "");
|
|
227
|
-
return p += `| ${C.map((a, c) => f(a, s[c])).join(" | ")} |
|
|
228
|
-
`, p += `| ${s.map((a) => "-".repeat(Math.max(3, a))).join(" | ")} |
|
|
229
|
-
`, (b ? n.slice(1) : n).forEach((a) => {
|
|
230
|
-
p += `| ${new Array(u).fill(0).map((c, o) => f(a[o] && a[o].text || "", s[o])).join(" | ")} |
|
|
231
|
-
`;
|
|
232
|
-
}), p;
|
|
233
|
-
}
|
|
234
|
-
var se = ae, ie = y.create({
|
|
235
|
-
name: "table",
|
|
236
|
-
// @ts-ignore
|
|
237
|
-
addOptions() {
|
|
238
|
-
return {
|
|
239
|
-
HTMLAttributes: {},
|
|
240
|
-
resizable: !1,
|
|
241
|
-
handleWidth: 5,
|
|
242
|
-
cellMinWidth: 25,
|
|
243
|
-
// TODO: fix
|
|
244
|
-
View: Z,
|
|
245
|
-
lastColumnResizable: !0,
|
|
246
|
-
allowTableNodeSelection: !1
|
|
247
|
-
};
|
|
248
|
-
},
|
|
249
|
-
content: "tableRow+",
|
|
250
|
-
tableRole: "table",
|
|
251
|
-
isolating: !0,
|
|
252
|
-
group: "block",
|
|
253
|
-
parseHTML() {
|
|
254
|
-
return [{ tag: "table" }];
|
|
255
|
-
},
|
|
256
|
-
renderHTML({ node: e, HTMLAttributes: t }) {
|
|
257
|
-
const { colgroup: r, tableWidth: l, tableMinWidth: d } = ee(e, this.options.cellMinWidth);
|
|
258
|
-
return [
|
|
259
|
-
"table",
|
|
260
|
-
M(this.options.HTMLAttributes, t, {
|
|
261
|
-
style: l ? `width: ${l}` : `min-width: ${d}`
|
|
262
|
-
}),
|
|
263
|
-
r,
|
|
264
|
-
["tbody", 0]
|
|
265
|
-
];
|
|
266
|
-
},
|
|
267
|
-
parseMarkdown: (e, t) => {
|
|
268
|
-
const r = [];
|
|
269
|
-
if (e.header) {
|
|
270
|
-
const l = [];
|
|
271
|
-
e.header.forEach((d) => {
|
|
272
|
-
l.push(t.createNode("tableHeader", {}, [{ type: "paragraph", content: t.parseInline(d.tokens) }]));
|
|
273
|
-
}), r.push(t.createNode("tableRow", {}, l));
|
|
274
|
-
}
|
|
275
|
-
return e.rows && e.rows.forEach((l) => {
|
|
276
|
-
const d = [];
|
|
277
|
-
l.forEach((n) => {
|
|
278
|
-
d.push(t.createNode("tableCell", {}, [{ type: "paragraph", content: t.parseInline(n.tokens) }]));
|
|
279
|
-
}), r.push(t.createNode("tableRow", {}, d));
|
|
280
|
-
}), t.createNode("table", void 0, r);
|
|
281
|
-
},
|
|
282
|
-
renderMarkdown: (e, t) => se(e, t),
|
|
283
|
-
addCommands() {
|
|
284
|
-
return {
|
|
285
|
-
insertTable: ({ rows: e = 3, cols: t = 3, withHeaderRow: r = !0 } = {}) => ({ tr: l, dispatch: d, editor: n }) => {
|
|
286
|
-
const u = le(n.schema, e, t, r);
|
|
287
|
-
if (d) {
|
|
288
|
-
const s = l.selection.from + 1;
|
|
289
|
-
l.replaceSelectionWith(u).scrollIntoView().setSelection(I.near(l.doc.resolve(s)));
|
|
290
|
-
}
|
|
291
|
-
return !0;
|
|
292
|
-
},
|
|
293
|
-
addColumnBefore: () => ({ state: e, dispatch: t }) => J(e, t),
|
|
294
|
-
addColumnAfter: () => ({ state: e, dispatch: t }) => U(e, t),
|
|
295
|
-
deleteColumn: () => ({ state: e, dispatch: t }) => G(e, t),
|
|
296
|
-
addRowBefore: () => ({ state: e, dispatch: t }) => q(e, t),
|
|
297
|
-
addRowAfter: () => ({ state: e, dispatch: t }) => F(e, t),
|
|
298
|
-
deleteRow: () => ({ state: e, dispatch: t }) => K(e, t),
|
|
299
|
-
deleteTable: () => ({ state: e, dispatch: t }) => B(e, t),
|
|
300
|
-
mergeCells: () => ({ state: e, dispatch: t }) => R(e, t),
|
|
301
|
-
splitCell: () => ({ state: e, dispatch: t }) => v(e, t),
|
|
302
|
-
toggleHeaderColumn: () => ({ state: e, dispatch: t }) => W("column")(e, t),
|
|
303
|
-
toggleHeaderRow: () => ({ state: e, dispatch: t }) => W("row")(e, t),
|
|
304
|
-
toggleHeaderCell: () => ({ state: e, dispatch: t }) => V(e, t),
|
|
305
|
-
mergeOrSplit: () => ({ state: e, dispatch: t }) => R(e, t) ? !0 : v(e, t),
|
|
306
|
-
setCellAttribute: (e, t) => ({ state: r, dispatch: l }) => D(e, t)(r, l),
|
|
307
|
-
goToNextCell: () => ({ state: e, dispatch: t }) => H(1)(e, t),
|
|
308
|
-
goToPreviousCell: () => ({ state: e, dispatch: t }) => H(-1)(e, t),
|
|
309
|
-
fixTables: () => ({ state: e, dispatch: t }) => (t && z(e), !0),
|
|
310
|
-
setCellSelection: (e) => ({ tr: t, dispatch: r }) => {
|
|
311
|
-
if (r) {
|
|
312
|
-
const l = S.create(t.doc, e.anchorCell, e.headCell);
|
|
313
|
-
t.setSelection(l);
|
|
314
|
-
}
|
|
315
|
-
return !0;
|
|
316
|
-
}
|
|
317
|
-
};
|
|
318
|
-
},
|
|
319
|
-
addKeyboardShortcuts() {
|
|
320
|
-
return {
|
|
321
|
-
Tab: () => this.editor.commands.goToNextCell() ? !0 : this.editor.can().addRowAfter() ? this.editor.chain().addRowAfter().goToNextCell().run() : !1,
|
|
322
|
-
"Shift-Tab": () => this.editor.commands.goToPreviousCell(),
|
|
323
|
-
Backspace: T,
|
|
324
|
-
"Mod-Backspace": T,
|
|
325
|
-
Delete: T,
|
|
326
|
-
"Mod-Delete": T
|
|
327
|
-
};
|
|
328
|
-
},
|
|
329
|
-
addProseMirrorPlugins() {
|
|
330
|
-
return [
|
|
331
|
-
...this.options.resizable && this.editor.isEditable ? [
|
|
332
|
-
P({
|
|
333
|
-
handleWidth: this.options.handleWidth,
|
|
334
|
-
cellMinWidth: this.options.cellMinWidth,
|
|
335
|
-
defaultCellMinWidth: this.options.cellMinWidth,
|
|
336
|
-
View: this.options.View,
|
|
337
|
-
lastColumnResizable: this.options.lastColumnResizable
|
|
338
|
-
})
|
|
339
|
-
] : [],
|
|
340
|
-
j({
|
|
341
|
-
allowTableNodeSelection: this.options.allowTableNodeSelection
|
|
342
|
-
})
|
|
343
|
-
];
|
|
344
|
-
},
|
|
345
|
-
extendNodeSchema(e) {
|
|
346
|
-
const t = {
|
|
347
|
-
name: e.name,
|
|
348
|
-
options: e.options,
|
|
349
|
-
storage: e.storage
|
|
350
|
-
};
|
|
351
|
-
return {
|
|
352
|
-
tableRole: $(_(e, "tableRole", t))
|
|
353
|
-
};
|
|
354
|
-
}
|
|
355
|
-
});
|
|
356
|
-
O.create({
|
|
357
|
-
name: "tableKit",
|
|
358
|
-
addExtensions() {
|
|
359
|
-
const e = [];
|
|
360
|
-
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;
|
|
361
|
-
}
|
|
362
|
-
});
|
|
363
|
-
export {
|
|
364
|
-
ie as T,
|
|
365
|
-
Y as a,
|
|
366
|
-
X as b,
|
|
367
|
-
Q as c
|
|
368
|
-
};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import "./vendor-tiptap-extension-table-D8RFr_6X.js";
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import "./vendor-tiptap-extension-table-D8RFr_6X.js";
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import "./vendor-tiptap-extension-table-D8RFr_6X.js";
|