@vc-shell/framework 1.1.98-rc.4 → 1.1.99-alpha.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (96) hide show
  1. package/core/api/platform.ts +9883 -9883
  2. package/core/composables/useNotifications/index.ts +32 -1
  3. package/core/composables/useSettings/index.ts +8 -3
  4. package/core/composables/useUser/index.ts +74 -171
  5. package/core/composables/useUserManagement/index.ts +67 -25
  6. package/core/interceptors/index.ts +19 -56
  7. package/core/plugins/signalR/index.ts +27 -1
  8. package/core/providers/README.md +176 -0
  9. package/core/providers/auth-provider-manager.ts +74 -0
  10. package/core/providers/auth-provider-utils.ts +26 -0
  11. package/core/providers/example-custom-auth-provider.ts +162 -0
  12. package/core/providers/index.ts +3 -0
  13. package/core/providers/platform-auth-provider.ts +207 -0
  14. package/core/types/auth-provider.ts +40 -0
  15. package/core/types/index.ts +2 -0
  16. package/dist/core/api/platform.d.ts +1 -1
  17. package/dist/core/api/platform.d.ts.map +1 -1
  18. package/dist/core/composables/useNotifications/index.d.ts.map +1 -1
  19. package/dist/core/composables/useSettings/index.d.ts.map +1 -1
  20. package/dist/core/composables/useUser/index.d.ts +18 -9
  21. package/dist/core/composables/useUser/index.d.ts.map +1 -1
  22. package/dist/core/composables/useUserManagement/index.d.ts +7 -7
  23. package/dist/core/composables/useUserManagement/index.d.ts.map +1 -1
  24. package/dist/core/interceptors/index.d.ts +2 -1
  25. package/dist/core/interceptors/index.d.ts.map +1 -1
  26. package/dist/core/plugins/signalR/index.d.ts +2 -0
  27. package/dist/core/plugins/signalR/index.d.ts.map +1 -1
  28. package/dist/core/providers/auth-provider-manager.d.ts +34 -0
  29. package/dist/core/providers/auth-provider-manager.d.ts.map +1 -0
  30. package/dist/core/providers/auth-provider-utils.d.ts +17 -0
  31. package/dist/core/providers/auth-provider-utils.d.ts.map +1 -0
  32. package/dist/core/providers/example-custom-auth-provider.d.ts +45 -0
  33. package/dist/core/providers/example-custom-auth-provider.d.ts.map +1 -0
  34. package/dist/core/providers/index.d.ts +3 -0
  35. package/dist/core/providers/index.d.ts.map +1 -0
  36. package/dist/core/providers/platform-auth-provider.d.ts +34 -0
  37. package/dist/core/providers/platform-auth-provider.d.ts.map +1 -0
  38. package/dist/core/types/auth-provider.d.ts +27 -0
  39. package/dist/core/types/auth-provider.d.ts.map +1 -0
  40. package/dist/core/types/index.d.ts +1 -1
  41. package/dist/core/types/index.d.ts.map +1 -1
  42. package/dist/framework.js +6348 -6198
  43. package/dist/index.css +1 -1
  44. package/dist/index.d.ts +8 -0
  45. package/dist/index.d.ts.map +1 -1
  46. package/dist/injection-keys.d.ts +2 -1
  47. package/dist/injection-keys.d.ts.map +1 -1
  48. package/dist/shared/components/app-switcher/composables/useAppSwitcher/index.d.ts.map +1 -1
  49. package/dist/shared/components/sign-in/useExternalProvider.d.ts +1 -1
  50. package/dist/shared/components/sign-in/useExternalProvider.d.ts.map +1 -1
  51. package/dist/shared/modules/dynamic/helpers/nodeBuilder.d.ts.map +1 -1
  52. package/dist/tsconfig.tsbuildinfo +1 -1
  53. package/dist/ui/components/organisms/vc-app/vc-app.vue.d.ts.map +1 -1
  54. package/dist/vendor-tiptap-core-ClsTgaMv.js +3699 -0
  55. package/dist/{vendor-tiptap-extension-blockquote-BVmAuV7o.js → vendor-tiptap-extension-blockquote-r1MBx4hD.js} +1 -1
  56. package/dist/{vendor-tiptap-extension-bold-BOh8AIRZ.js → vendor-tiptap-extension-bold-BjLI4i8b.js} +1 -1
  57. package/dist/{vendor-tiptap-extension-code-R4pc2wFE.js → vendor-tiptap-extension-code-D5-kDnMW.js} +1 -1
  58. package/dist/{vendor-tiptap-extension-code-block-DibKlZFG.js → vendor-tiptap-extension-code-block-RjEb0zPA.js} +1 -1
  59. package/dist/{vendor-tiptap-extension-document-BwORJR1k.js → vendor-tiptap-extension-document--PLOxIdq.js} +1 -1
  60. package/dist/{vendor-tiptap-extension-hard-break-DH36OfVk.js → vendor-tiptap-extension-hard-break-9cxC2YOS.js} +13 -9
  61. package/dist/{vendor-tiptap-extension-heading-oMLORiPI.js → vendor-tiptap-extension-heading-2w0TutHn.js} +1 -1
  62. package/dist/{vendor-tiptap-extension-horizontal-rule-BMHSoB_Y.js → vendor-tiptap-extension-horizontal-rule-CFowa_lc.js} +1 -1
  63. package/dist/vendor-tiptap-extension-image-aWn-na6j.js +127 -0
  64. package/dist/{vendor-tiptap-extension-italic-BzqrUuB0.js → vendor-tiptap-extension-italic-Bn-6saY0.js} +1 -1
  65. package/dist/{vendor-tiptap-extension-link-hMFZ0hfl.js → vendor-tiptap-extension-link-BmcG1_k-.js} +1 -1
  66. package/dist/{vendor-tiptap-extension-list-Bj5AK6Pq.js → vendor-tiptap-extension-list-BrNBJ45n.js} +1 -1
  67. package/dist/{vendor-tiptap-extension-paragraph-Bs1wl42E.js → vendor-tiptap-extension-paragraph-DAiYhwUB.js} +1 -1
  68. package/dist/vendor-tiptap-extension-placeholder-9tURDKy-.js +1 -0
  69. package/dist/{vendor-tiptap-extension-strike-C4YpGyzc.js → vendor-tiptap-extension-strike-DqbXPfos.js} +1 -1
  70. package/dist/vendor-tiptap-extension-table-DQwPaR7v.js +374 -0
  71. package/dist/vendor-tiptap-extension-table-cell-C0tEP_0i.js +1 -0
  72. package/dist/vendor-tiptap-extension-table-header-C0tEP_0i.js +1 -0
  73. package/dist/vendor-tiptap-extension-table-row-C0tEP_0i.js +1 -0
  74. package/dist/{vendor-tiptap-extension-text-C4dQW13r.js → vendor-tiptap-extension-text-BFnfj70b.js} +1 -1
  75. package/dist/{vendor-tiptap-extension-text-style-a_NYjXT6.js → vendor-tiptap-extension-text-style-Darua3qr.js} +1 -1
  76. package/dist/{vendor-tiptap-extension-underline-DthCaPX3.js → vendor-tiptap-extension-underline-QyVnBqQZ.js} +1 -1
  77. package/dist/{vendor-tiptap-extensions-C8rF1qdq.js → vendor-tiptap-extensions-CU-D7bfm.js} +1 -1
  78. package/dist/{vendor-tiptap-markdown-DRc3qhBU.js → vendor-tiptap-markdown-BwATYN5A.js} +1 -1
  79. package/dist/{vendor-tiptap-starter-kit-BfUUblkP.js → vendor-tiptap-starter-kit-5luf7zzS.js} +17 -17
  80. package/dist/{vendor-tiptap-vue-3-DYxT2sf6.js → vendor-tiptap-vue-3-CFBErZGb.js} +1 -1
  81. package/dist/{vendor-vueuse-components-B0zqjNRW.js → vendor-vueuse-components-sgKpNzof.js} +1 -1
  82. package/dist/{vendor-vueuse-core-CYgwn-B2.js → vendor-vueuse-core-D0cN7FqY.js} +10 -10
  83. package/dist/{vendor-vueuse-shared-B_uDJJ6V.js → vendor-vueuse-shared-Pt0UEStA.js} +19 -19
  84. package/package.json +7 -5
  85. package/shared/components/app-switcher/components/vc-app-switcher/vc-app-switcher.vue +2 -2
  86. package/shared/components/app-switcher/composables/useAppSwitcher/index.ts +15 -1
  87. package/shared/components/sign-in/useExternalProvider.ts +11 -1
  88. package/shared/modules/dynamic/helpers/nodeBuilder.ts +11 -3
  89. package/ui/components/organisms/vc-app/vc-app.vue +20 -2
  90. package/dist/vendor-tiptap-core-8RGSOCZs.js +0 -3442
  91. package/dist/vendor-tiptap-extension-image-DF1ZJ94q.js +0 -80
  92. package/dist/vendor-tiptap-extension-placeholder-CupUGaI_.js +0 -1
  93. package/dist/vendor-tiptap-extension-table-D8RFr_6X.js +0 -368
  94. package/dist/vendor-tiptap-extension-table-cell-k9uLwyL6.js +0 -1
  95. package/dist/vendor-tiptap-extension-table-header-k9uLwyL6.js +0 -1
  96. package/dist/vendor-tiptap-extension-table-row-k9uLwyL6.js +0 -1
@@ -1,4 +1,4 @@
1
- import { N as a, w as u, h as o, m as l } from "./vendor-tiptap-core-8RGSOCZs.js";
1
+ import { N as a, w as u, h as o, m as l } from "./vendor-tiptap-core-ClsTgaMv.js";
2
2
  var c = /^\s*>\s$/, k = a.create({
3
3
  name: "blockquote",
4
4
  addOptions() {
@@ -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-8RGSOCZs.js";
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() {
@@ -1,4 +1,4 @@
1
- import { M as r, a, b as n, m as d } from "./vendor-tiptap-core-8RGSOCZs.js";
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-8RGSOCZs.js";
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,4 +1,4 @@
1
- import { N as n } from "./vendor-tiptap-core-8RGSOCZs.js";
1
+ import { N as n } from "./vendor-tiptap-core-ClsTgaMv.js";
2
2
  var o = n.create({
3
3
  name: "doc",
4
4
  topNode: !0,
@@ -1,6 +1,7 @@
1
- import { N as l, m as c } from "./vendor-tiptap-core-8RGSOCZs.js";
2
- var M = l.create({
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: i } = a;
35
+ const { selection: t, storedMarks: o } = a;
32
36
  if (t.$from.parent.type.spec.isolating)
33
37
  return !1;
34
- const { keepMarks: o } = this.options, { splittableMarks: d } = s.extensionManager, n = i || t.$to.parentOffset && t.$from.marks();
35
- return r().insertContent({ type: this.name }).command(({ tr: u, dispatch: m }) => {
36
- if (m && n && o) {
37
- const k = n.filter((p) => d.includes(p.type.name));
38
- u.ensureMarks(k);
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
- M as H
58
+ f as H
55
59
  };
@@ -1,4 +1,4 @@
1
- import { N as l, t as a, m as i } from "./vendor-tiptap-core-8RGSOCZs.js";
1
+ import { N as l, t as a, m as i } from "./vendor-tiptap-core-ClsTgaMv.js";
2
2
  var d = l.create({
3
3
  name: "heading",
4
4
  addOptions() {
@@ -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-8RGSOCZs.js";
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 ? `![${c}](${i} "${r}")` : `![${c}](${i})`;
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-8RGSOCZs.js";
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() {
@@ -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-8RGSOCZs.js";
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");
@@ -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-8RGSOCZs.js";
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 });
@@ -1,4 +1,4 @@
1
- import { N as a, m as n } from "./vendor-tiptap-core-8RGSOCZs.js";
1
+ import { N as a, m as n } from "./vendor-tiptap-core-ClsTgaMv.js";
2
2
  var s = a.create({
3
3
  name: "paragraph",
4
4
  priority: 1e3,
@@ -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-8RGSOCZs.js";
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 { N as t } from "./vendor-tiptap-core-8RGSOCZs.js";
1
+ import { N as t } from "./vendor-tiptap-core-ClsTgaMv.js";
2
2
  var a = t.create({
3
3
  name: "text",
4
4
  group: "inline",
@@ -1,4 +1,4 @@
1
- import { M as y, m as p, E as l } from "./vendor-tiptap-core-8RGSOCZs.js";
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 { M as s, m as a } from "./vendor-tiptap-core-8RGSOCZs.js";
1
+ import { M as s, m as a } from "./vendor-tiptap-core-ClsTgaMv.js";
2
2
  var u = s.create({
3
3
  name: "underline",
4
4
  addOptions() {
@@ -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-8RGSOCZs.js";
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";