@wakastellar/ui 3.3.3 → 3.5.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 (140) hide show
  1. package/dist/badge-BbwO7QeZ.js +1 -0
  2. package/dist/badge-BfiocODp.mjs +23 -0
  3. package/dist/charts.cjs.js +1 -1
  4. package/dist/charts.es.js +1 -1
  5. package/dist/chunk-14q5BKub.js +1 -0
  6. package/dist/{chunk-BH6uBOac.mjs → chunk-Cr9pTUWm.mjs} +5 -5
  7. package/dist/cn-DEtaFQsA.js +1 -0
  8. package/dist/cn-DUn6aSIQ.mjs +24 -0
  9. package/dist/doc.cjs.js +2 -2
  10. package/dist/doc.es.js +19 -19
  11. package/dist/editor.cjs.js +48 -0
  12. package/dist/editor.d.ts +1 -0
  13. package/dist/editor.es.js +6551 -0
  14. package/dist/{exceljs.min-DG9M8IZ1.mjs → exceljs.min-DL1XYDll.mjs} +1 -1
  15. package/dist/{exceljs.min-BuefmDRS.js → exceljs.min-qeIfSCbF.js} +1 -1
  16. package/dist/export.cjs.js +1 -1
  17. package/dist/export.es.js +1 -1
  18. package/dist/index.cjs.js +150 -150
  19. package/dist/index.es.js +26782 -27591
  20. package/dist/input-BfaSAGVw.js +1 -0
  21. package/dist/input-DVr_Qkl8.mjs +14 -0
  22. package/dist/rich-text.cjs.js +1 -1
  23. package/dist/rich-text.es.js +1 -1
  24. package/dist/security-CyBpuklN.mjs +122 -0
  25. package/dist/security-bFWwDrlg.js +1 -0
  26. package/dist/separator-NrkltulH.js +1 -0
  27. package/dist/separator-ibN2mycs.mjs +51 -0
  28. package/dist/src/components/editor/blocks/index.d.ts +51 -0
  29. package/dist/src/components/editor/blocks/waka-acceptance-criteria-block.d.ts +60 -0
  30. package/dist/src/components/editor/blocks/waka-ai-assist-block.d.ts +58 -0
  31. package/dist/src/components/editor/blocks/waka-api-endpoint-block.d.ts +63 -0
  32. package/dist/src/components/editor/blocks/waka-code-playground-block.d.ts +61 -0
  33. package/dist/src/components/editor/blocks/waka-comment-thread-block.d.ts +85 -0
  34. package/dist/src/components/editor/blocks/waka-diagram-block.d.ts +52 -0
  35. package/dist/src/components/editor/blocks/waka-embed-block.d.ts +58 -0
  36. package/dist/src/components/editor/blocks/waka-slash-menu-block.d.ts +67 -0
  37. package/dist/src/components/editor/blocks/waka-user-story-block.d.ts +79 -0
  38. package/dist/src/components/editor/blocks/waka-version-diff-block.d.ts +73 -0
  39. package/dist/src/components/editor/index.d.ts +66 -0
  40. package/dist/src/components/editor/waka-ai-writer.d.ts +80 -0
  41. package/dist/src/components/editor/waka-collaborative-editor.d.ts +93 -0
  42. package/dist/src/components/editor/waka-diff-viewer.d.ts +71 -0
  43. package/dist/src/components/editor/waka-dnd-editor.d.ts +64 -0
  44. package/dist/src/components/editor/waka-document-editor.d.ts +92 -0
  45. package/dist/src/components/editor/waka-editor-elements.d.ts +79 -0
  46. package/dist/src/components/editor/waka-editor-leaves.d.ts +39 -0
  47. package/dist/src/components/editor/waka-editor-plugins.d.ts +41 -0
  48. package/dist/src/components/editor/waka-editor-toolbar.d.ts +20 -0
  49. package/dist/src/components/editor/waka-editor.d.ts +59 -0
  50. package/dist/src/components/editor/waka-floating-toolbar.d.ts +47 -0
  51. package/dist/src/components/editor/waka-markdown-editor.d.ts +60 -0
  52. package/dist/src/components/editor/waka-mention-editor.d.ts +125 -0
  53. package/dist/src/components/editor/waka-slash-menu.d.ts +70 -0
  54. package/dist/src/components/editor/waka-spec-editor.d.ts +88 -0
  55. package/dist/src/components/index.d.ts +1 -15
  56. package/dist/src/editor.d.ts +26 -0
  57. package/dist/textarea-CdQWggYG.js +1 -0
  58. package/dist/textarea-DJDXJ3nd.mjs +23 -0
  59. package/dist/types-C2St0wOW.js +1 -0
  60. package/dist/{types-B6GVaSIP.mjs → types-JnqoLyuv.mjs} +214 -211
  61. package/dist/{useDataTableImport-BPvfo--2.mjs → useDataTableImport-BWUFesPi.mjs} +3 -3
  62. package/dist/{useDataTableImport-Cm_pCKnO.js → useDataTableImport-T7ddpN5k.js} +3 -3
  63. package/dist/waka-doc-renderer-CTxC7Trf.js +3 -0
  64. package/dist/{waka-doc-renderer-BkIvas3z.mjs → waka-doc-renderer-Cw-Xnyen.mjs} +264 -281
  65. package/dist/waka-editor-plugins-DR6tpsUC.mjs +135 -0
  66. package/dist/waka-editor-plugins-sGSh9hn2.js +1 -0
  67. package/dist/waka-rich-text-editor-BlIdtknG.js +1 -0
  68. package/dist/waka-rich-text-editor-D1uA3zbB.js +1 -0
  69. package/dist/waka-rich-text-editor-DgSWiXMW.mjs +342 -0
  70. package/dist/waka-rich-text-editor-DndVJuDw.mjs +2 -0
  71. package/package.json +87 -2
  72. package/src/blocks/footer/index.tsx +1 -6
  73. package/src/blocks/login/index.tsx +1 -7
  74. package/src/blocks/profile/index.tsx +3 -5
  75. package/src/components/editor/blocks/index.ts +182 -0
  76. package/src/components/editor/blocks/waka-acceptance-criteria-block.tsx +326 -0
  77. package/src/components/editor/blocks/waka-ai-assist-block.tsx +284 -0
  78. package/src/components/editor/blocks/waka-api-endpoint-block.tsx +382 -0
  79. package/src/components/editor/blocks/waka-code-playground-block.tsx +331 -0
  80. package/src/components/editor/blocks/waka-comment-thread-block.tsx +448 -0
  81. package/src/components/editor/blocks/waka-diagram-block.tsx +293 -0
  82. package/src/components/editor/blocks/waka-embed-block.tsx +416 -0
  83. package/src/components/editor/blocks/waka-slash-menu-block.tsx +432 -0
  84. package/src/components/editor/blocks/waka-user-story-block.tsx +295 -0
  85. package/src/components/editor/blocks/waka-version-diff-block.tsx +426 -0
  86. package/src/components/editor/index.ts +279 -0
  87. package/src/components/editor/waka-ai-writer.tsx +434 -0
  88. package/src/components/editor/waka-collaborative-editor.tsx +426 -0
  89. package/src/components/editor/waka-diff-viewer.tsx +352 -0
  90. package/src/components/editor/waka-dnd-editor.tsx +284 -0
  91. package/src/components/editor/waka-document-editor.tsx +502 -0
  92. package/src/components/editor/waka-editor-elements.tsx +312 -0
  93. package/src/components/editor/waka-editor-leaves.tsx +101 -0
  94. package/src/components/editor/waka-editor-plugins.ts +207 -0
  95. package/src/components/editor/waka-editor-toolbar.tsx +358 -0
  96. package/src/components/editor/waka-editor.tsx +431 -0
  97. package/src/components/editor/waka-floating-toolbar.tsx +268 -0
  98. package/src/components/editor/waka-markdown-editor.tsx +395 -0
  99. package/src/components/editor/waka-mention-editor.tsx +459 -0
  100. package/src/components/editor/waka-slash-menu.tsx +392 -0
  101. package/src/components/editor/waka-spec-editor.tsx +657 -0
  102. package/src/components/index.ts +1 -18
  103. package/dist/chunk-BDDJmn7V.js +0 -1
  104. package/dist/cn-DnPbmOCy.js +0 -1
  105. package/dist/cn-DpLcAzrf.mjs +0 -22
  106. package/dist/separator-BDReXBvI.mjs +0 -59
  107. package/dist/separator-BKjNl9sI.js +0 -1
  108. package/dist/src/components/waka-actor-badge/index.d.ts +0 -8
  109. package/dist/src/components/waka-actors-list/index.d.ts +0 -18
  110. package/dist/src/components/waka-ai-assistant-button/index.d.ts +0 -8
  111. package/dist/src/components/waka-document-flyover/index.d.ts +0 -10
  112. package/dist/src/components/waka-document-preview-popup/index.d.ts +0 -26
  113. package/dist/src/components/waka-hour-balance-badge/index.d.ts +0 -8
  114. package/dist/src/components/waka-hour-consumption-table/index.d.ts +0 -15
  115. package/dist/src/components/waka-hour-pack-dialog/index.d.ts +0 -8
  116. package/dist/src/components/waka-project-stats-header/index.d.ts +0 -15
  117. package/dist/src/components/waka-step-comment-bubble/index.d.ts +0 -13
  118. package/dist/src/components/waka-step-comment-panel/index.d.ts +0 -20
  119. package/dist/src/components/waka-step-permission-matrix/index.d.ts +0 -12
  120. package/dist/src/components/waka-time-entry-dialog/index.d.ts +0 -16
  121. package/dist/src/components/waka-time-tracking-flyover/index.d.ts +0 -11
  122. package/dist/types-BH9cQRqZ.js +0 -1
  123. package/dist/waka-doc-renderer-BZ2-SqyT.js +0 -3
  124. package/dist/waka-rich-text-editor-BJGlQgpq.js +0 -1
  125. package/dist/waka-rich-text-editor-BJzzxeP1.mjs +0 -361
  126. package/dist/waka-rich-text-editor-wnXLwvUo.js +0 -1
  127. package/src/components/waka-actor-badge/index.tsx +0 -34
  128. package/src/components/waka-actors-list/index.tsx +0 -125
  129. package/src/components/waka-ai-assistant-button/index.tsx +0 -31
  130. package/src/components/waka-document-flyover/index.tsx +0 -36
  131. package/src/components/waka-document-preview-popup/index.tsx +0 -103
  132. package/src/components/waka-hour-balance-badge/index.tsx +0 -43
  133. package/src/components/waka-hour-consumption-table/index.tsx +0 -72
  134. package/src/components/waka-hour-pack-dialog/index.tsx +0 -72
  135. package/src/components/waka-project-stats-header/index.tsx +0 -69
  136. package/src/components/waka-step-comment-bubble/index.tsx +0 -71
  137. package/src/components/waka-step-comment-panel/index.tsx +0 -106
  138. package/src/components/waka-step-permission-matrix/index.tsx +0 -65
  139. package/src/components/waka-time-entry-dialog/index.tsx +0 -131
  140. package/src/components/waka-time-tracking-flyover/index.tsx +0 -41
@@ -0,0 +1 @@
1
+ const e=require(`./chunk-14q5BKub.js`),t=require(`./cn-DEtaFQsA.js`);let n=require(`react`);n=e.a(n);let r=require(`react/jsx-runtime`);t.n();var i=n.forwardRef(({className:e,type:n,...i},a)=>(0,r.jsx)(`input`,{type:n,className:t.t(`flex h-9 w-full rounded-md border border-input bg-transparent px-3 py-1 text-base shadow-sm transition-colors file:border-0 file:bg-transparent file:text-sm file:font-medium file:text-foreground placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:cursor-not-allowed disabled:opacity-50 md:text-sm`,e),ref:a,...i}));i.displayName=`Input`,Object.defineProperty(exports,`t`,{enumerable:!0,get:function(){return i}});
@@ -0,0 +1,14 @@
1
+ import { n as e, t } from "./cn-DUn6aSIQ.mjs";
2
+ import * as n from "react";
3
+ import { jsx as r } from "react/jsx-runtime";
4
+ //#region src/components/input/index.tsx
5
+ e();
6
+ var i = n.forwardRef(({ className: e, type: n, ...i }, a) => /* @__PURE__ */ r("input", {
7
+ type: n,
8
+ className: t("flex h-9 w-full rounded-md border border-input bg-transparent px-3 py-1 text-base shadow-sm transition-colors file:border-0 file:bg-transparent file:text-sm file:font-medium file:text-foreground placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:cursor-not-allowed disabled:opacity-50 md:text-sm", e),
9
+ ref: a,
10
+ ...i
11
+ }));
12
+ i.displayName = "Input";
13
+ //#endregion
14
+ export { i as t };
@@ -1 +1 @@
1
- Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require(`./waka-rich-text-editor-BJGlQgpq.js`);exports.WakaRichTextEditor=e.t;
1
+ Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`}),require(`./chunk-14q5BKub.js`);const e=require(`./waka-rich-text-editor-D1uA3zbB.js`);exports.WakaRichTextEditor=e.t;
@@ -1,2 +1,2 @@
1
- import { t as e } from "./waka-rich-text-editor-BJzzxeP1.mjs";
1
+ import { t as e } from "./waka-rich-text-editor-DgSWiXMW.mjs";
2
2
  export { e as WakaRichTextEditor };
@@ -0,0 +1,122 @@
1
+ import { n as e } from "./chunk-Cr9pTUWm.mjs";
2
+ import { n as t, t as n } from "./cn-DUn6aSIQ.mjs";
3
+ import * as r from "react";
4
+ import { jsx as i, jsxs as a } from "react/jsx-runtime";
5
+ import * as o from "@radix-ui/react-avatar";
6
+ import * as s from "@radix-ui/react-scroll-area";
7
+ import * as c from "@radix-ui/react-tooltip";
8
+ //#region src/components/avatar/index.tsx
9
+ t();
10
+ var l = r.forwardRef(({ className: e, ...t }, r) => /* @__PURE__ */ i(o.Root, {
11
+ ref: r,
12
+ className: n("relative flex h-10 w-10 shrink-0 overflow-hidden rounded-full", e),
13
+ ...t
14
+ }));
15
+ l.displayName = o.Root.displayName;
16
+ var u = r.forwardRef(({ className: e, ...t }, r) => /* @__PURE__ */ i(o.Image, {
17
+ ref: r,
18
+ className: n("aspect-square h-full w-full", e),
19
+ ...t
20
+ }));
21
+ u.displayName = o.Image.displayName;
22
+ var d = r.forwardRef(({ className: e, ...t }, r) => /* @__PURE__ */ i(o.Fallback, {
23
+ ref: r,
24
+ className: n("flex h-full w-full items-center justify-center rounded-full bg-muted", e),
25
+ ...t
26
+ }));
27
+ //#endregion
28
+ //#region src/components/scroll-area/index.tsx
29
+ d.displayName = o.Fallback.displayName, t();
30
+ var f = r.forwardRef(({ className: e, children: t, ...r }, o) => /* @__PURE__ */ a(s.Root, {
31
+ ref: o,
32
+ className: n("relative overflow-hidden", e),
33
+ ...r,
34
+ children: [
35
+ /* @__PURE__ */ i(s.Viewport, {
36
+ className: "h-full w-full rounded-[inherit]",
37
+ children: t
38
+ }),
39
+ /* @__PURE__ */ i(p, {}),
40
+ /* @__PURE__ */ i(s.Corner, {})
41
+ ]
42
+ }));
43
+ f.displayName = s.Root.displayName;
44
+ var p = r.forwardRef(({ className: e, orientation: t = "vertical", ...r }, a) => /* @__PURE__ */ i(s.ScrollAreaScrollbar, {
45
+ ref: a,
46
+ orientation: t,
47
+ className: n("flex touch-none select-none transition-colors", t === "vertical" && "h-full w-2.5 border-l border-l-transparent p-[1px]", t === "horizontal" && "h-2.5 flex-col border-t border-t-transparent p-[1px]", e),
48
+ ...r,
49
+ children: /* @__PURE__ */ i(s.ScrollAreaThumb, { className: "relative flex-1 rounded-full bg-border" })
50
+ }));
51
+ //#endregion
52
+ //#region src/components/tooltip/index.tsx
53
+ p.displayName = s.ScrollAreaScrollbar.displayName, t();
54
+ var m = c.Provider, h = c.Root, g = c.Trigger, _ = r.forwardRef(({ className: e, sideOffset: t = 4, ...r }, a) => /* @__PURE__ */ i(c.Content, {
55
+ ref: a,
56
+ sideOffset: t,
57
+ className: n("z-50 overflow-hidden rounded-md border bg-popover px-3 py-1.5 text-sm text-popover-foreground shadow-md animate-in fade-in-0 zoom-in-95 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2", e),
58
+ ...r
59
+ }));
60
+ _.displayName = c.Content.displayName;
61
+ //#endregion
62
+ //#region src/utils/security.ts
63
+ function v(e) {
64
+ if (!e || typeof e != "string") return;
65
+ let t = e.trim(), n;
66
+ try {
67
+ n = decodeURIComponent(t);
68
+ } catch {
69
+ n = t;
70
+ }
71
+ let r = n.toLowerCase().replace(/\s/g, "");
72
+ for (let t of [
73
+ "javascript:",
74
+ "vbscript:",
75
+ "data:text",
76
+ "data:application"
77
+ ]) if (r.startsWith(t)) {
78
+ console.warn(`[Security] Blocked potentially malicious URL: ${e.substring(0, 50)}...`);
79
+ return;
80
+ }
81
+ if (!([
82
+ "http://",
83
+ "https://",
84
+ "mailto:",
85
+ "tel:",
86
+ "/",
87
+ "#",
88
+ "data:image"
89
+ ].some((e) => r.startsWith(e)) || !r.includes(":") || r.indexOf(":") > r.indexOf("/"))) {
90
+ console.warn(`[Security] Blocked URL with unknown protocol: ${e.substring(0, 50)}...`);
91
+ return;
92
+ }
93
+ return t;
94
+ }
95
+ function y(e) {
96
+ let t = v(e);
97
+ return t && typeof window < "u" ? (window.location.href = t, !0) : !1;
98
+ }
99
+ function b(e) {
100
+ return typeof e == "string" ? e.replace(/[.*+?^${}()|[\]\\]/g, "\\$&") : "";
101
+ }
102
+ function x(e, t) {
103
+ return new RegExp(b(e), t);
104
+ }
105
+ function S(e) {
106
+ return RegExp(!e || typeof e != "string" ? "(?!)" : `(${b(e)})`, "gi");
107
+ }
108
+ function C(e) {
109
+ if (typeof e != "string") return "";
110
+ let t = {
111
+ "&": "&amp;",
112
+ "<": "&lt;",
113
+ ">": "&gt;",
114
+ "\"": "&quot;",
115
+ "'": "&#x27;",
116
+ "/": "&#x2F;"
117
+ };
118
+ return e.replace(/[&<>"'/]/g, (e) => t[e]);
119
+ }
120
+ var w = e((() => {}));
121
+ //#endregion
122
+ export { w as a, h as c, g as d, f, u as g, d as h, b as i, _ as l, l as m, x as n, y as o, p, C as r, v as s, S as t, m as u };
@@ -0,0 +1 @@
1
+ const e=require(`./chunk-14q5BKub.js`),t=require(`./cn-DEtaFQsA.js`);let n=require(`react`);n=e.a(n);let r=require(`react/jsx-runtime`),i=require(`@radix-ui/react-avatar`);i=e.a(i);let a=require(`@radix-ui/react-scroll-area`);a=e.a(a);let o=require(`@radix-ui/react-tooltip`);o=e.a(o),t.n();var s=n.forwardRef(({className:e,...n},a)=>(0,r.jsx)(i.Root,{ref:a,className:t.t(`relative flex h-10 w-10 shrink-0 overflow-hidden rounded-full`,e),...n}));s.displayName=i.Root.displayName;var c=n.forwardRef(({className:e,...n},a)=>(0,r.jsx)(i.Image,{ref:a,className:t.t(`aspect-square h-full w-full`,e),...n}));c.displayName=i.Image.displayName;var l=n.forwardRef(({className:e,...n},a)=>(0,r.jsx)(i.Fallback,{ref:a,className:t.t(`flex h-full w-full items-center justify-center rounded-full bg-muted`,e),...n}));l.displayName=i.Fallback.displayName,t.n();var u=n.forwardRef(({className:e,children:n,...i},o)=>(0,r.jsxs)(a.Root,{ref:o,className:t.t(`relative overflow-hidden`,e),...i,children:[(0,r.jsx)(a.Viewport,{className:`h-full w-full rounded-[inherit]`,children:n}),(0,r.jsx)(d,{}),(0,r.jsx)(a.Corner,{})]}));u.displayName=a.Root.displayName;var d=n.forwardRef(({className:e,orientation:n=`vertical`,...i},o)=>(0,r.jsx)(a.ScrollAreaScrollbar,{ref:o,orientation:n,className:t.t(`flex touch-none select-none transition-colors`,n===`vertical`&&`h-full w-2.5 border-l border-l-transparent p-[1px]`,n===`horizontal`&&`h-2.5 flex-col border-t border-t-transparent p-[1px]`,e),...i,children:(0,r.jsx)(a.ScrollAreaThumb,{className:`relative flex-1 rounded-full bg-border`})}));d.displayName=a.ScrollAreaScrollbar.displayName,t.n();var f=o.Provider,p=o.Root,m=o.Trigger,h=n.forwardRef(({className:e,sideOffset:n=4,...i},a)=>(0,r.jsx)(o.Content,{ref:a,sideOffset:n,className:t.t(`z-50 overflow-hidden rounded-md border bg-popover px-3 py-1.5 text-sm text-popover-foreground shadow-md animate-in fade-in-0 zoom-in-95 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2`,e),...i}));h.displayName=o.Content.displayName;function g(e){if(!e||typeof e!=`string`)return;let t=e.trim(),n;try{n=decodeURIComponent(t)}catch{n=t}let r=n.toLowerCase().replace(/\s/g,``);for(let t of[`javascript:`,`vbscript:`,`data:text`,`data:application`])if(r.startsWith(t)){console.warn(`[Security] Blocked potentially malicious URL: ${e.substring(0,50)}...`);return}if(!([`http://`,`https://`,`mailto:`,`tel:`,`/`,`#`,`data:image`].some(e=>r.startsWith(e))||!r.includes(`:`)||r.indexOf(`:`)>r.indexOf(`/`))){console.warn(`[Security] Blocked URL with unknown protocol: ${e.substring(0,50)}...`);return}return t}function _(e){let t=g(e);return t&&typeof window<`u`?(window.location.href=t,!0):!1}function v(e){return typeof e==`string`?e.replace(/[.*+?^${}()|[\]\\]/g,`\\$&`):``}function y(e,t){return new RegExp(v(e),t)}function b(e){return RegExp(!e||typeof e!=`string`?`(?!)`:`(${v(e)})`,`gi`)}function x(e){if(typeof e!=`string`)return``;let t={"&":`&amp;`,"<":`&lt;`,">":`&gt;`,'"':`&quot;`,"'":`&#x27;`,"/":`&#x2F;`};return e.replace(/[&<>"'/]/g,e=>t[e])}var S=e.n((()=>{}));Object.defineProperty(exports,`a`,{enumerable:!0,get:function(){return S}}),Object.defineProperty(exports,`c`,{enumerable:!0,get:function(){return p}}),Object.defineProperty(exports,`d`,{enumerable:!0,get:function(){return m}}),Object.defineProperty(exports,`f`,{enumerable:!0,get:function(){return u}}),Object.defineProperty(exports,`g`,{enumerable:!0,get:function(){return c}}),Object.defineProperty(exports,`h`,{enumerable:!0,get:function(){return l}}),Object.defineProperty(exports,`i`,{enumerable:!0,get:function(){return v}}),Object.defineProperty(exports,`l`,{enumerable:!0,get:function(){return h}}),Object.defineProperty(exports,`m`,{enumerable:!0,get:function(){return s}}),Object.defineProperty(exports,`n`,{enumerable:!0,get:function(){return y}}),Object.defineProperty(exports,`o`,{enumerable:!0,get:function(){return _}}),Object.defineProperty(exports,`p`,{enumerable:!0,get:function(){return d}}),Object.defineProperty(exports,`r`,{enumerable:!0,get:function(){return x}}),Object.defineProperty(exports,`s`,{enumerable:!0,get:function(){return g}}),Object.defineProperty(exports,`t`,{enumerable:!0,get:function(){return b}}),Object.defineProperty(exports,`u`,{enumerable:!0,get:function(){return f}});
@@ -0,0 +1 @@
1
+ const e=require(`./chunk-14q5BKub.js`),t=require(`./cn-DEtaFQsA.js`);let n=require(`react`);n=e.a(n);let r=require(`class-variance-authority`),i=require(`react/jsx-runtime`),a=require(`@radix-ui/react-slot`),o=require(`@radix-ui/react-separator`);o=e.a(o),t.n();var s=(0,r.cva)(`inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium transition-colors focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:h-4 [&_svg]:w-4 [&_svg]:shrink-0`,{variants:{variant:{default:`bg-primary text-primary-foreground shadow hover:bg-primary/90`,destructive:`bg-destructive text-destructive-foreground shadow-sm hover:bg-destructive/90`,outline:`border border-input bg-background shadow-sm hover:bg-accent hover:text-accent-foreground`,secondary:`bg-secondary text-secondary-foreground shadow-sm hover:bg-secondary/80`,ghost:`hover:bg-accent hover:text-accent-foreground`,link:`text-primary underline-offset-4 hover:underline`},size:{default:`h-9 px-4 py-2`,sm:`h-8 rounded-md px-3 text-xs`,lg:`h-10 rounded-md px-8`,icon:`h-9 w-9`}},defaultVariants:{variant:`default`,size:`default`}}),c=n.forwardRef(({className:e,variant:n,size:r,asChild:o=!1,...c},l)=>(0,i.jsx)(o?a.Slot:`button`,{className:t.t(s({variant:n,size:r,className:e})),ref:l,...c}));c.displayName=`Button`,t.n();var l=n.forwardRef(({className:e,orientation:n=`horizontal`,decorative:r=!0,...a},s)=>(0,i.jsx)(o.Root,{ref:s,decorative:r,orientation:n,className:t.t(`shrink-0 bg-border`,n===`horizontal`?`h-[1px] w-full`:`h-full w-[1px]`,e),...a}));l.displayName=o.Root.displayName,Object.defineProperty(exports,`n`,{enumerable:!0,get:function(){return c}}),Object.defineProperty(exports,`t`,{enumerable:!0,get:function(){return l}});
@@ -0,0 +1,51 @@
1
+ import { n as e, t } from "./cn-DUn6aSIQ.mjs";
2
+ import * as n from "react";
3
+ import { cva as r } from "class-variance-authority";
4
+ import { jsx as i } from "react/jsx-runtime";
5
+ import { Slot as a } from "@radix-ui/react-slot";
6
+ import * as o from "@radix-ui/react-separator";
7
+ //#region src/components/button/index.tsx
8
+ e();
9
+ var s = r("inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium transition-colors focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:h-4 [&_svg]:w-4 [&_svg]:shrink-0", {
10
+ variants: {
11
+ variant: {
12
+ default: "bg-primary text-primary-foreground shadow hover:bg-primary/90",
13
+ destructive: "bg-destructive text-destructive-foreground shadow-sm hover:bg-destructive/90",
14
+ outline: "border border-input bg-background shadow-sm hover:bg-accent hover:text-accent-foreground",
15
+ secondary: "bg-secondary text-secondary-foreground shadow-sm hover:bg-secondary/80",
16
+ ghost: "hover:bg-accent hover:text-accent-foreground",
17
+ link: "text-primary underline-offset-4 hover:underline"
18
+ },
19
+ size: {
20
+ default: "h-9 px-4 py-2",
21
+ sm: "h-8 rounded-md px-3 text-xs",
22
+ lg: "h-10 rounded-md px-8",
23
+ icon: "h-9 w-9"
24
+ }
25
+ },
26
+ defaultVariants: {
27
+ variant: "default",
28
+ size: "default"
29
+ }
30
+ }), c = n.forwardRef(({ className: e, variant: n, size: r, asChild: o = !1, ...c }, l) => /* @__PURE__ */ i(o ? a : "button", {
31
+ className: t(s({
32
+ variant: n,
33
+ size: r,
34
+ className: e
35
+ })),
36
+ ref: l,
37
+ ...c
38
+ }));
39
+ //#endregion
40
+ //#region src/components/separator/index.tsx
41
+ c.displayName = "Button", e();
42
+ var l = n.forwardRef(({ className: e, orientation: n = "horizontal", decorative: r = !0, ...a }, s) => /* @__PURE__ */ i(o.Root, {
43
+ ref: s,
44
+ decorative: r,
45
+ orientation: n,
46
+ className: t("shrink-0 bg-border", n === "horizontal" ? "h-[1px] w-full" : "h-full w-[1px]", e),
47
+ ...a
48
+ }));
49
+ l.displayName = o.Root.displayName;
50
+ //#endregion
51
+ export { c as n, l as t };
@@ -0,0 +1,51 @@
1
+ /**
2
+ * WakaStart Editor Blocks — Custom Plate.js block elements for the WakaStart ecosystem.
3
+ *
4
+ * These blocks extend the standard Plate editor with domain-specific elements
5
+ * designed for PaaS project management, specification writing, and technical documentation.
6
+ *
7
+ * Usage:
8
+ * ```ts
9
+ * import { WakaUserStoryBlock, createUserStoryPlugin } from "@wakastellar/ui/editor"
10
+ * ```
11
+ *
12
+ * Each block provides:
13
+ * - A React component for rendering in the Plate editor
14
+ * - A node factory function for creating Slate nodes
15
+ * - A plugin factory for registering with the Plate editor
16
+ * - Full TypeScript types for the Slate element shape
17
+ */
18
+ export { WakaUserStoryBlock, createUserStoryNodes, createUserStoryPlugin, USER_STORY_BLOCK_TYPE, type UserStoryElement, type WakaUserStoryBlockProps, } from './waka-user-story-block';
19
+ export { WakaAcceptanceCriteriaBlock, createAcceptanceCriteriaNodes, createAcceptanceCriteriaPlugin, ACCEPTANCE_CRITERIA_BLOCK_TYPE, type AcceptanceCriterion, type AcceptanceCriteriaElement, type WakaAcceptanceCriteriaBlockProps, } from './waka-acceptance-criteria-block';
20
+ export { WakaApiEndpointBlock, createApiEndpointNodes, createApiEndpointPlugin, API_ENDPOINT_BLOCK_TYPE, type HttpMethod, type ApiParam, type ApiResponse, type ApiEndpointElement, type WakaApiEndpointBlockProps, } from './waka-api-endpoint-block';
21
+ export { WakaDiagramBlock, createDiagramNodes, createDiagramPlugin, DIAGRAM_BLOCK_TYPE, type DiagramSyntax, type DiagramElement, type WakaDiagramBlockProps, } from './waka-diagram-block';
22
+ export { WakaAiAssistBlock, createAiAssistNodes, createAiAssistPlugin, AI_ASSIST_BLOCK_TYPE, type AiAssistStatus, type AiAssistElement, type WakaAiAssistBlockProps, } from './waka-ai-assist-block';
23
+ export { WakaVersionDiffBlock, createVersionDiffNodes, createVersionDiffPlugin, VERSION_DIFF_BLOCK_TYPE, type DiffLine, type DiffHunk, type VersionDiffElement, type WakaVersionDiffBlockProps, } from './waka-version-diff-block';
24
+ export { WakaEmbedBlock, createEmbedNodes, createEmbedPlugin, detectEmbedProvider, resolveEmbedUrl, EMBED_BLOCK_TYPE, type EmbedProvider, type EmbedElement, type WakaEmbedBlockProps, } from './waka-embed-block';
25
+ export { WakaCodePlaygroundBlock, createCodePlaygroundNodes, createCodePlaygroundPlugin, CODE_PLAYGROUND_BLOCK_TYPE, type PlaygroundLanguage, type ExecutionStatus, type CodePlaygroundElement, type WakaCodePlaygroundBlockProps, } from './waka-code-playground-block';
26
+ export { WakaCommentThreadBlock, createCommentThreadNodes, createCommentThreadPlugin, COMMENT_THREAD_BLOCK_TYPE, type ThreadComment, type ThreadStatus, type CommentThreadElement, type WakaCommentThreadBlockProps, } from './waka-comment-thread-block';
27
+ export { WakaSlashMenuBlock, getAllWakaSlashCommands, createWakaSlashPlugins, WAKA_BLOCK_COMMANDS, type WakaSlashBlockCommand, type WakaSlashMenuBlockProps, } from './waka-slash-menu-block';
28
+ /**
29
+ * Loads all WakaStart block plugins at once.
30
+ * Returns an array of Plate plugins to spread into your editor configuration.
31
+ *
32
+ * @example
33
+ * ```ts
34
+ * const blockPlugins = await loadAllWakaBlockPlugins()
35
+ * const editor = usePlateEditor({
36
+ * plugins: [...corePlugins, ...blockPlugins],
37
+ * })
38
+ * ```
39
+ */
40
+ export declare function loadAllWakaBlockPlugins(options?: {
41
+ /** Mermaid/diagram render function */
42
+ diagramRenderer?: (source: string, syntax: string) => Promise<string>;
43
+ /** AI generation function */
44
+ aiGenerator?: (prompt: string) => Promise<string>;
45
+ /** Code execution function */
46
+ codeExecutor?: (code: string, language: string) => Promise<string>;
47
+ /** Current user ID for comments */
48
+ currentUserId?: string;
49
+ /** Comment reply handler */
50
+ onCommentReply?: (threadId: string, content: string) => void;
51
+ }): Promise<unknown[]>;
@@ -0,0 +1,60 @@
1
+ import { PlateElementProps } from '../waka-editor-elements';
2
+ export declare const ACCEPTANCE_CRITERIA_BLOCK_TYPE: "acceptance_criteria";
3
+ /** A single acceptance criterion in Gherkin format */
4
+ export interface AcceptanceCriterion {
5
+ /** Unique ID (e.g. "AC-01") */
6
+ id: string;
7
+ /** Scenario name */
8
+ scenario: string;
9
+ /** Given (context / precondition) */
10
+ given: string;
11
+ /** When (action / trigger) */
12
+ when: string;
13
+ /** Then (expected result) */
14
+ then: string;
15
+ /** Whether this criterion has been validated */
16
+ validated: boolean;
17
+ }
18
+ /** Slate node for acceptance criteria block */
19
+ export interface AcceptanceCriteriaElement {
20
+ type: typeof ACCEPTANCE_CRITERIA_BLOCK_TYPE;
21
+ /** Block title */
22
+ title: string;
23
+ /** List of criteria */
24
+ criteria: AcceptanceCriterion[];
25
+ children: Array<{
26
+ text: string;
27
+ }>;
28
+ }
29
+ export interface WakaAcceptanceCriteriaBlockProps extends PlateElementProps {
30
+ element?: AcceptanceCriteriaElement & Record<string, unknown>;
31
+ /** Whether the block is read-only */
32
+ readOnly?: boolean;
33
+ }
34
+ /**
35
+ * WakaAcceptanceCriteriaBlock - A Plate.js block for acceptance criteria in
36
+ * Gherkin format (Given/When/Then). Each criterion has a checkbox for
37
+ * validation tracking.
38
+ *
39
+ * Register in Plate editor:
40
+ * ```ts
41
+ * components: {
42
+ * [ACCEPTANCE_CRITERIA_BLOCK_TYPE]: WakaAcceptanceCriteriaBlock,
43
+ * }
44
+ * ```
45
+ */
46
+ export declare function WakaAcceptanceCriteriaBlock({ attributes, children, element, className, }: WakaAcceptanceCriteriaBlockProps): import("react/jsx-runtime").JSX.Element;
47
+ export declare namespace WakaAcceptanceCriteriaBlock {
48
+ var displayName: string;
49
+ }
50
+ /**
51
+ * Creates Slate nodes for an acceptance criteria block.
52
+ */
53
+ export declare function createAcceptanceCriteriaNodes(options?: {
54
+ title?: string;
55
+ criteria?: AcceptanceCriterion[];
56
+ }): AcceptanceCriteriaElement[];
57
+ /**
58
+ * Creates a Plate plugin for acceptance criteria blocks.
59
+ */
60
+ export declare function createAcceptanceCriteriaPlugin(): Promise<any>;
@@ -0,0 +1,58 @@
1
+ import { PlateElementProps } from '../waka-editor-elements';
2
+ export declare const AI_ASSIST_BLOCK_TYPE: "ai_assist";
3
+ /** Status of the AI request */
4
+ export type AiAssistStatus = "idle" | "loading" | "streaming" | "complete" | "error";
5
+ /** Slate node for AI assist blocks */
6
+ export interface AiAssistElement {
7
+ type: typeof AI_ASSIST_BLOCK_TYPE;
8
+ /** The user's prompt/question */
9
+ prompt: string;
10
+ /** The AI-generated response */
11
+ response: string;
12
+ /** Current status */
13
+ status: AiAssistStatus;
14
+ /** Model used for generation */
15
+ model?: string;
16
+ /** Timestamp of generation */
17
+ generatedAt?: string;
18
+ /** Error message if status is "error" */
19
+ errorMessage?: string;
20
+ /** Token count */
21
+ tokenCount?: number;
22
+ children: Array<{
23
+ text: string;
24
+ }>;
25
+ }
26
+ export interface WakaAiAssistBlockProps extends PlateElementProps {
27
+ element?: AiAssistElement & Record<string, unknown>;
28
+ /** Callback to trigger AI generation. Receives the prompt, returns a response or streams it. */
29
+ onGenerate?: (prompt: string) => Promise<string>;
30
+ /** Callback when the user accepts the response and wants it inserted into the document */
31
+ onAccept?: (response: string) => void;
32
+ /** Callback when the user discards the response */
33
+ onDiscard?: () => void;
34
+ }
35
+ /**
36
+ * WakaAiAssistBlock - A Plate.js block where the user poses a question or prompt,
37
+ * and the AI response is inserted directly into the document. Supports streaming
38
+ * responses, accept/discard actions, and model attribution.
39
+ *
40
+ * Designed to work with `@platejs/ai` AIChatPlugin, or standalone with a custom
41
+ * `onGenerate` callback.
42
+ *
43
+ * Register in Plate editor:
44
+ * ```ts
45
+ * components: {
46
+ * [AI_ASSIST_BLOCK_TYPE]: (props) => <WakaAiAssistBlock {...props} onGenerate={myHandler} />,
47
+ * }
48
+ * ```
49
+ */
50
+ export declare function WakaAiAssistBlock({ attributes, children, element, className, onGenerate, onAccept, onDiscard, }: WakaAiAssistBlockProps): import("react/jsx-runtime").JSX.Element;
51
+ export declare namespace WakaAiAssistBlock {
52
+ var displayName: string;
53
+ }
54
+ export declare function createAiAssistNodes(options?: {
55
+ prompt?: string;
56
+ model?: string;
57
+ }): AiAssistElement[];
58
+ export declare function createAiAssistPlugin(onGenerate?: (prompt: string) => Promise<string>, onAccept?: (response: string) => void): Promise<any>;
@@ -0,0 +1,63 @@
1
+ import { PlateElementProps } from '../waka-editor-elements';
2
+ export declare const API_ENDPOINT_BLOCK_TYPE: "api_endpoint";
3
+ /** HTTP method type */
4
+ export type HttpMethod = "GET" | "POST" | "PUT" | "PATCH" | "DELETE" | "HEAD" | "OPTIONS";
5
+ /** A single parameter/header definition */
6
+ export interface ApiParam {
7
+ name: string;
8
+ type: string;
9
+ required: boolean;
10
+ description: string;
11
+ }
12
+ /** A response definition */
13
+ export interface ApiResponse {
14
+ status: number;
15
+ description: string;
16
+ body?: string;
17
+ }
18
+ /** Slate node for API endpoint block */
19
+ export interface ApiEndpointElement {
20
+ type: typeof API_ENDPOINT_BLOCK_TYPE;
21
+ /** HTTP method */
22
+ method: HttpMethod;
23
+ /** Route path (e.g. "/api/v1/projects/:id") */
24
+ route: string;
25
+ /** Endpoint description */
26
+ description: string;
27
+ /** Authentication requirement */
28
+ auth: string;
29
+ /** Required permissions/roles */
30
+ permissions: string[];
31
+ /** Rate limit description */
32
+ rateLimit?: string;
33
+ /** Path/query parameters */
34
+ params?: ApiParam[];
35
+ /** Request body (JSON string) */
36
+ requestBody?: string;
37
+ /** Response definitions */
38
+ responses: ApiResponse[];
39
+ children: Array<{
40
+ text: string;
41
+ }>;
42
+ }
43
+ export interface WakaApiEndpointBlockProps extends PlateElementProps {
44
+ element?: ApiEndpointElement & Record<string, unknown>;
45
+ }
46
+ /**
47
+ * WakaApiEndpointBlock - A Plate.js block for documenting REST API endpoints.
48
+ * Displays method, route, parameters, request body, and responses with
49
+ * syntax-colored JSON previews.
50
+ *
51
+ * Register in Plate editor:
52
+ * ```ts
53
+ * components: {
54
+ * [API_ENDPOINT_BLOCK_TYPE]: WakaApiEndpointBlock,
55
+ * }
56
+ * ```
57
+ */
58
+ export declare function WakaApiEndpointBlock({ attributes, children, element, className, }: WakaApiEndpointBlockProps): import("react/jsx-runtime").JSX.Element;
59
+ export declare namespace WakaApiEndpointBlock {
60
+ var displayName: string;
61
+ }
62
+ export declare function createApiEndpointNodes(options?: Partial<Omit<ApiEndpointElement, "type" | "children">>): ApiEndpointElement[];
63
+ export declare function createApiEndpointPlugin(): Promise<any>;
@@ -0,0 +1,61 @@
1
+ import { PlateElementProps } from '../waka-editor-elements';
2
+ export declare const CODE_PLAYGROUND_BLOCK_TYPE: "code_playground";
3
+ /** Supported programming languages */
4
+ export type PlaygroundLanguage = "javascript" | "typescript" | "python" | "html" | "css" | "json" | "sql" | "bash" | "go" | "rust";
5
+ /** Execution status */
6
+ export type ExecutionStatus = "idle" | "running" | "success" | "error";
7
+ /** Slate node for code playground blocks */
8
+ export interface CodePlaygroundElement {
9
+ type: typeof CODE_PLAYGROUND_BLOCK_TYPE;
10
+ /** Source code */
11
+ code: string;
12
+ /** Programming language */
13
+ language: PlaygroundLanguage;
14
+ /** Title / filename */
15
+ title?: string;
16
+ /** Last execution output */
17
+ output?: string;
18
+ /** Last execution error */
19
+ errorOutput?: string;
20
+ /** Execution status */
21
+ executionStatus: ExecutionStatus;
22
+ /** Whether to show line numbers */
23
+ showLineNumbers: boolean;
24
+ /** Whether the code is read-only */
25
+ readOnly: boolean;
26
+ children: Array<{
27
+ text: string;
28
+ }>;
29
+ }
30
+ export interface WakaCodePlaygroundBlockProps extends PlateElementProps {
31
+ element?: CodePlaygroundElement & Record<string, unknown>;
32
+ /** Callback to execute code. Returns stdout output or throws with stderr. */
33
+ onExecute?: (code: string, language: PlaygroundLanguage) => Promise<string>;
34
+ }
35
+ /**
36
+ * WakaCodePlaygroundBlock - A Plate.js block with an inline code editor and
37
+ * sandboxed execution. Users write code and can run it, seeing output in
38
+ * an integrated console panel.
39
+ *
40
+ * Execution is sandboxed via the `onExecute` callback provided by the
41
+ * consuming application (e.g. using Web Workers, iframes, or server-side eval).
42
+ *
43
+ * Register in Plate editor:
44
+ * ```ts
45
+ * components: {
46
+ * [CODE_PLAYGROUND_BLOCK_TYPE]: (props) => (
47
+ * <WakaCodePlaygroundBlock {...props} onExecute={myExecutor} />
48
+ * ),
49
+ * }
50
+ * ```
51
+ */
52
+ export declare function WakaCodePlaygroundBlock({ attributes, children, element, className, onExecute, }: WakaCodePlaygroundBlockProps): import("react/jsx-runtime").JSX.Element;
53
+ export declare namespace WakaCodePlaygroundBlock {
54
+ var displayName: string;
55
+ }
56
+ export declare function createCodePlaygroundNodes(options?: {
57
+ code?: string;
58
+ language?: PlaygroundLanguage;
59
+ title?: string;
60
+ }): CodePlaygroundElement[];
61
+ export declare function createCodePlaygroundPlugin(onExecute?: (code: string, language: PlaygroundLanguage) => Promise<string>): Promise<any>;
@@ -0,0 +1,85 @@
1
+ import { PlateElementProps } from '../waka-editor-elements';
2
+ export declare const COMMENT_THREAD_BLOCK_TYPE: "comment_thread";
3
+ /** A single comment in a thread */
4
+ export interface ThreadComment {
5
+ /** Unique comment ID */
6
+ id: string;
7
+ /** Author information */
8
+ author: {
9
+ id: string;
10
+ name: string;
11
+ avatar?: string;
12
+ };
13
+ /** Comment text content */
14
+ content: string;
15
+ /** ISO timestamp */
16
+ createdAt: string;
17
+ /** Whether this comment has been edited */
18
+ edited?: boolean;
19
+ /** Reactions on this comment */
20
+ reactions?: Array<{
21
+ emoji: string;
22
+ count: number;
23
+ reacted: boolean;
24
+ }>;
25
+ }
26
+ /** Thread status */
27
+ export type ThreadStatus = "open" | "resolved" | "archived";
28
+ /** Slate node for comment thread blocks */
29
+ export interface CommentThreadElement {
30
+ type: typeof COMMENT_THREAD_BLOCK_TYPE;
31
+ /** Thread ID */
32
+ threadId: string;
33
+ /** The original highlighted text that was commented on */
34
+ quotedText: string;
35
+ /** Thread status */
36
+ status: ThreadStatus;
37
+ /** Comments in the thread */
38
+ comments: ThreadComment[];
39
+ /** Total number of comments (may differ from comments.length if paginated) */
40
+ totalComments?: number;
41
+ children: Array<{
42
+ text: string;
43
+ }>;
44
+ }
45
+ export interface WakaCommentThreadBlockProps extends PlateElementProps {
46
+ element?: CommentThreadElement & Record<string, unknown>;
47
+ /** Current user ID (for highlighting own comments) */
48
+ currentUserId?: string;
49
+ /** Callback when a reply is submitted */
50
+ onReply?: (threadId: string, content: string) => void;
51
+ /** Callback when thread is resolved */
52
+ onResolve?: (threadId: string) => void;
53
+ /** Callback when thread is reopened */
54
+ onReopen?: (threadId: string) => void;
55
+ }
56
+ /**
57
+ * WakaCommentThreadBlock - A Plate.js block for inline threaded comments,
58
+ * similar to Google Docs commenting. Shows the quoted text that was commented on,
59
+ * a thread of replies, and allows adding new replies.
60
+ *
61
+ * Designed to integrate with `@platejs/comments` or work standalone.
62
+ *
63
+ * Register in Plate editor:
64
+ * ```ts
65
+ * components: {
66
+ * [COMMENT_THREAD_BLOCK_TYPE]: (props) => (
67
+ * <WakaCommentThreadBlock {...props} currentUserId="user-123" onReply={handleReply} />
68
+ * ),
69
+ * }
70
+ * ```
71
+ */
72
+ export declare function WakaCommentThreadBlock({ attributes, children, element, className, currentUserId, onReply, onResolve, onReopen, }: WakaCommentThreadBlockProps): import("react/jsx-runtime").JSX.Element;
73
+ export declare namespace WakaCommentThreadBlock {
74
+ var displayName: string;
75
+ }
76
+ export declare function createCommentThreadNodes(options?: {
77
+ threadId?: string;
78
+ quotedText?: string;
79
+ initialComment?: {
80
+ authorId: string;
81
+ authorName: string;
82
+ content: string;
83
+ };
84
+ }): CommentThreadElement[];
85
+ export declare function createCommentThreadPlugin(currentUserId?: string, onReply?: (threadId: string, content: string) => void, onResolve?: (threadId: string) => void): Promise<any>;
@@ -0,0 +1,52 @@
1
+ import { PlateElementProps } from '../waka-editor-elements';
2
+ export declare const DIAGRAM_BLOCK_TYPE: "diagram";
3
+ /** Supported diagram syntax types */
4
+ export type DiagramSyntax = "mermaid" | "plantuml" | "excalidraw";
5
+ /** Slate node for diagram blocks */
6
+ export interface DiagramElement {
7
+ type: typeof DIAGRAM_BLOCK_TYPE;
8
+ /** Diagram syntax type */
9
+ syntax: DiagramSyntax;
10
+ /** Raw source code of the diagram */
11
+ source: string;
12
+ /** Optional title/caption */
13
+ caption?: string;
14
+ children: Array<{
15
+ text: string;
16
+ }>;
17
+ }
18
+ export interface WakaDiagramBlockProps extends PlateElementProps {
19
+ element?: DiagramElement & Record<string, unknown>;
20
+ /**
21
+ * External render function: takes diagram source and syntax,
22
+ * returns sanitized SVG string or HTML.
23
+ *
24
+ * IMPORTANT: The consuming application is responsible for sanitizing
25
+ * the returned HTML (e.g. using DOMPurify) before it is rendered.
26
+ */
27
+ onRender?: (source: string, syntax: DiagramSyntax) => Promise<string>;
28
+ }
29
+ /**
30
+ * WakaDiagramBlock - A Plate.js block that embeds a diagram editor (Mermaid/PlantUML/Excalidraw)
31
+ * inline in the document. The user writes diagram source code and sees the rendered
32
+ * output below.
33
+ *
34
+ * The rendering is delegated to an external `onRender` callback, allowing the consuming
35
+ * app to use mermaid.js, kroki.io, or any other renderer. The consuming app MUST sanitize
36
+ * the rendered output (e.g. using DOMPurify) before returning it.
37
+ *
38
+ * If no `onRender` is provided, only the source code is displayed.
39
+ *
40
+ * Register in Plate editor:
41
+ * ```ts
42
+ * components: {
43
+ * [DIAGRAM_BLOCK_TYPE]: (props) => <WakaDiagramBlock {...props} onRender={myRenderer} />,
44
+ * }
45
+ * ```
46
+ */
47
+ export declare function WakaDiagramBlock({ attributes, children, element, className, onRender, }: WakaDiagramBlockProps): import("react/jsx-runtime").JSX.Element;
48
+ export declare namespace WakaDiagramBlock {
49
+ var displayName: string;
50
+ }
51
+ export declare function createDiagramNodes(options?: Partial<Omit<DiagramElement, "type" | "children">>): DiagramElement[];
52
+ export declare function createDiagramPlugin(onRender?: (source: string, syntax: DiagramSyntax) => Promise<string>): Promise<any>;