@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.
- package/dist/badge-BbwO7QeZ.js +1 -0
- package/dist/badge-BfiocODp.mjs +23 -0
- package/dist/charts.cjs.js +1 -1
- package/dist/charts.es.js +1 -1
- package/dist/chunk-14q5BKub.js +1 -0
- package/dist/{chunk-BH6uBOac.mjs → chunk-Cr9pTUWm.mjs} +5 -5
- package/dist/cn-DEtaFQsA.js +1 -0
- package/dist/cn-DUn6aSIQ.mjs +24 -0
- package/dist/doc.cjs.js +2 -2
- package/dist/doc.es.js +19 -19
- package/dist/editor.cjs.js +48 -0
- package/dist/editor.d.ts +1 -0
- package/dist/editor.es.js +6551 -0
- package/dist/{exceljs.min-DG9M8IZ1.mjs → exceljs.min-DL1XYDll.mjs} +1 -1
- package/dist/{exceljs.min-BuefmDRS.js → exceljs.min-qeIfSCbF.js} +1 -1
- package/dist/export.cjs.js +1 -1
- package/dist/export.es.js +1 -1
- package/dist/index.cjs.js +150 -150
- package/dist/index.es.js +26782 -27591
- package/dist/input-BfaSAGVw.js +1 -0
- package/dist/input-DVr_Qkl8.mjs +14 -0
- package/dist/rich-text.cjs.js +1 -1
- package/dist/rich-text.es.js +1 -1
- package/dist/security-CyBpuklN.mjs +122 -0
- package/dist/security-bFWwDrlg.js +1 -0
- package/dist/separator-NrkltulH.js +1 -0
- package/dist/separator-ibN2mycs.mjs +51 -0
- package/dist/src/components/editor/blocks/index.d.ts +51 -0
- package/dist/src/components/editor/blocks/waka-acceptance-criteria-block.d.ts +60 -0
- package/dist/src/components/editor/blocks/waka-ai-assist-block.d.ts +58 -0
- package/dist/src/components/editor/blocks/waka-api-endpoint-block.d.ts +63 -0
- package/dist/src/components/editor/blocks/waka-code-playground-block.d.ts +61 -0
- package/dist/src/components/editor/blocks/waka-comment-thread-block.d.ts +85 -0
- package/dist/src/components/editor/blocks/waka-diagram-block.d.ts +52 -0
- package/dist/src/components/editor/blocks/waka-embed-block.d.ts +58 -0
- package/dist/src/components/editor/blocks/waka-slash-menu-block.d.ts +67 -0
- package/dist/src/components/editor/blocks/waka-user-story-block.d.ts +79 -0
- package/dist/src/components/editor/blocks/waka-version-diff-block.d.ts +73 -0
- package/dist/src/components/editor/index.d.ts +66 -0
- package/dist/src/components/editor/waka-ai-writer.d.ts +80 -0
- package/dist/src/components/editor/waka-collaborative-editor.d.ts +93 -0
- package/dist/src/components/editor/waka-diff-viewer.d.ts +71 -0
- package/dist/src/components/editor/waka-dnd-editor.d.ts +64 -0
- package/dist/src/components/editor/waka-document-editor.d.ts +92 -0
- package/dist/src/components/editor/waka-editor-elements.d.ts +79 -0
- package/dist/src/components/editor/waka-editor-leaves.d.ts +39 -0
- package/dist/src/components/editor/waka-editor-plugins.d.ts +41 -0
- package/dist/src/components/editor/waka-editor-toolbar.d.ts +20 -0
- package/dist/src/components/editor/waka-editor.d.ts +59 -0
- package/dist/src/components/editor/waka-floating-toolbar.d.ts +47 -0
- package/dist/src/components/editor/waka-markdown-editor.d.ts +60 -0
- package/dist/src/components/editor/waka-mention-editor.d.ts +125 -0
- package/dist/src/components/editor/waka-slash-menu.d.ts +70 -0
- package/dist/src/components/editor/waka-spec-editor.d.ts +88 -0
- package/dist/src/components/index.d.ts +1 -15
- package/dist/src/editor.d.ts +26 -0
- package/dist/textarea-CdQWggYG.js +1 -0
- package/dist/textarea-DJDXJ3nd.mjs +23 -0
- package/dist/types-C2St0wOW.js +1 -0
- package/dist/{types-B6GVaSIP.mjs → types-JnqoLyuv.mjs} +214 -211
- package/dist/{useDataTableImport-BPvfo--2.mjs → useDataTableImport-BWUFesPi.mjs} +3 -3
- package/dist/{useDataTableImport-Cm_pCKnO.js → useDataTableImport-T7ddpN5k.js} +3 -3
- package/dist/waka-doc-renderer-CTxC7Trf.js +3 -0
- package/dist/{waka-doc-renderer-BkIvas3z.mjs → waka-doc-renderer-Cw-Xnyen.mjs} +264 -281
- package/dist/waka-editor-plugins-DR6tpsUC.mjs +135 -0
- package/dist/waka-editor-plugins-sGSh9hn2.js +1 -0
- package/dist/waka-rich-text-editor-BlIdtknG.js +1 -0
- package/dist/waka-rich-text-editor-D1uA3zbB.js +1 -0
- package/dist/waka-rich-text-editor-DgSWiXMW.mjs +342 -0
- package/dist/waka-rich-text-editor-DndVJuDw.mjs +2 -0
- package/package.json +87 -2
- package/src/blocks/footer/index.tsx +1 -6
- package/src/blocks/login/index.tsx +1 -7
- package/src/blocks/profile/index.tsx +3 -5
- package/src/components/editor/blocks/index.ts +182 -0
- package/src/components/editor/blocks/waka-acceptance-criteria-block.tsx +326 -0
- package/src/components/editor/blocks/waka-ai-assist-block.tsx +284 -0
- package/src/components/editor/blocks/waka-api-endpoint-block.tsx +382 -0
- package/src/components/editor/blocks/waka-code-playground-block.tsx +331 -0
- package/src/components/editor/blocks/waka-comment-thread-block.tsx +448 -0
- package/src/components/editor/blocks/waka-diagram-block.tsx +293 -0
- package/src/components/editor/blocks/waka-embed-block.tsx +416 -0
- package/src/components/editor/blocks/waka-slash-menu-block.tsx +432 -0
- package/src/components/editor/blocks/waka-user-story-block.tsx +295 -0
- package/src/components/editor/blocks/waka-version-diff-block.tsx +426 -0
- package/src/components/editor/index.ts +279 -0
- package/src/components/editor/waka-ai-writer.tsx +434 -0
- package/src/components/editor/waka-collaborative-editor.tsx +426 -0
- package/src/components/editor/waka-diff-viewer.tsx +352 -0
- package/src/components/editor/waka-dnd-editor.tsx +284 -0
- package/src/components/editor/waka-document-editor.tsx +502 -0
- package/src/components/editor/waka-editor-elements.tsx +312 -0
- package/src/components/editor/waka-editor-leaves.tsx +101 -0
- package/src/components/editor/waka-editor-plugins.ts +207 -0
- package/src/components/editor/waka-editor-toolbar.tsx +358 -0
- package/src/components/editor/waka-editor.tsx +431 -0
- package/src/components/editor/waka-floating-toolbar.tsx +268 -0
- package/src/components/editor/waka-markdown-editor.tsx +395 -0
- package/src/components/editor/waka-mention-editor.tsx +459 -0
- package/src/components/editor/waka-slash-menu.tsx +392 -0
- package/src/components/editor/waka-spec-editor.tsx +657 -0
- package/src/components/index.ts +1 -18
- package/dist/chunk-BDDJmn7V.js +0 -1
- package/dist/cn-DnPbmOCy.js +0 -1
- package/dist/cn-DpLcAzrf.mjs +0 -22
- package/dist/separator-BDReXBvI.mjs +0 -59
- package/dist/separator-BKjNl9sI.js +0 -1
- package/dist/src/components/waka-actor-badge/index.d.ts +0 -8
- package/dist/src/components/waka-actors-list/index.d.ts +0 -18
- package/dist/src/components/waka-ai-assistant-button/index.d.ts +0 -8
- package/dist/src/components/waka-document-flyover/index.d.ts +0 -10
- package/dist/src/components/waka-document-preview-popup/index.d.ts +0 -26
- package/dist/src/components/waka-hour-balance-badge/index.d.ts +0 -8
- package/dist/src/components/waka-hour-consumption-table/index.d.ts +0 -15
- package/dist/src/components/waka-hour-pack-dialog/index.d.ts +0 -8
- package/dist/src/components/waka-project-stats-header/index.d.ts +0 -15
- package/dist/src/components/waka-step-comment-bubble/index.d.ts +0 -13
- package/dist/src/components/waka-step-comment-panel/index.d.ts +0 -20
- package/dist/src/components/waka-step-permission-matrix/index.d.ts +0 -12
- package/dist/src/components/waka-time-entry-dialog/index.d.ts +0 -16
- package/dist/src/components/waka-time-tracking-flyover/index.d.ts +0 -11
- package/dist/types-BH9cQRqZ.js +0 -1
- package/dist/waka-doc-renderer-BZ2-SqyT.js +0 -3
- package/dist/waka-rich-text-editor-BJGlQgpq.js +0 -1
- package/dist/waka-rich-text-editor-BJzzxeP1.mjs +0 -361
- package/dist/waka-rich-text-editor-wnXLwvUo.js +0 -1
- package/src/components/waka-actor-badge/index.tsx +0 -34
- package/src/components/waka-actors-list/index.tsx +0 -125
- package/src/components/waka-ai-assistant-button/index.tsx +0 -31
- package/src/components/waka-document-flyover/index.tsx +0 -36
- package/src/components/waka-document-preview-popup/index.tsx +0 -103
- package/src/components/waka-hour-balance-badge/index.tsx +0 -43
- package/src/components/waka-hour-consumption-table/index.tsx +0 -72
- package/src/components/waka-hour-pack-dialog/index.tsx +0 -72
- package/src/components/waka-project-stats-header/index.tsx +0 -69
- package/src/components/waka-step-comment-bubble/index.tsx +0 -71
- package/src/components/waka-step-comment-panel/index.tsx +0 -106
- package/src/components/waka-step-permission-matrix/index.tsx +0 -65
- package/src/components/waka-time-entry-dialog/index.tsx +0 -131
- package/src/components/waka-time-tracking-flyover/index.tsx +0 -41
|
@@ -1,361 +0,0 @@
|
|
|
1
|
-
import { n as e } from "./chunk-BH6uBOac.mjs";
|
|
2
|
-
import { t } from "./cn-DpLcAzrf.mjs";
|
|
3
|
-
import { n, r, t as i } from "./separator-BDReXBvI.mjs";
|
|
4
|
-
import * as a from "react";
|
|
5
|
-
import { AlignCenter as o, AlignLeft as s, AlignRight as c, Bold as l, Code as u, Heading1 as d, Heading2 as f, Heading3 as p, Italic as m, Link as h, List as g, ListOrdered as _, Quote as v, Redo as y, Strikethrough as b, Underline as x, Undo as S } from "lucide-react";
|
|
6
|
-
import { cva as C } from "class-variance-authority";
|
|
7
|
-
import { jsx as w, jsxs as T } from "react/jsx-runtime";
|
|
8
|
-
import * as E from "@radix-ui/react-label";
|
|
9
|
-
import * as D from "@radix-ui/react-popover";
|
|
10
|
-
//#region src/components/label/index.tsx
|
|
11
|
-
var O = C("text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70"), k = a.forwardRef(({ className: e, ...n }, r) => /* @__PURE__ */ w(E.Root, {
|
|
12
|
-
ref: r,
|
|
13
|
-
className: t(O(), e),
|
|
14
|
-
...n
|
|
15
|
-
}));
|
|
16
|
-
k.displayName = E.Root.displayName;
|
|
17
|
-
//#endregion
|
|
18
|
-
//#region src/components/popover/index.tsx
|
|
19
|
-
var A = D.Root, j = D.Trigger, M = a.forwardRef(({ className: e, align: n = "center", sideOffset: r = 4, ...i }, a) => /* @__PURE__ */ w(D.Portal, { children: /* @__PURE__ */ w(D.Content, {
|
|
20
|
-
ref: a,
|
|
21
|
-
align: n,
|
|
22
|
-
sideOffset: r,
|
|
23
|
-
className: t("z-50 w-72 rounded-md border bg-popover p-4 text-popover-foreground shadow-md outline-none data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-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),
|
|
24
|
-
...i
|
|
25
|
-
}) }));
|
|
26
|
-
M.displayName = D.Content.displayName;
|
|
27
|
-
//#endregion
|
|
28
|
-
//#region src/components/textarea/index.tsx
|
|
29
|
-
var N = a.forwardRef(({ className: e, ...n }, r) => /* @__PURE__ */ w("textarea", {
|
|
30
|
-
className: t("flex min-h-[80px] w-full rounded-md border border-input bg-background px-3 py-2 text-sm ring-offset-background placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50", e),
|
|
31
|
-
ref: r,
|
|
32
|
-
...n
|
|
33
|
-
}));
|
|
34
|
-
N.displayName = "Textarea";
|
|
35
|
-
//#endregion
|
|
36
|
-
//#region src/components/waka-rich-text-editor/index.tsx
|
|
37
|
-
var P = /* @__PURE__ */ e({
|
|
38
|
-
WakaRichTextEditor: () => I,
|
|
39
|
-
default: () => I
|
|
40
|
-
}), F = [
|
|
41
|
-
[
|
|
42
|
-
"bold",
|
|
43
|
-
"italic",
|
|
44
|
-
"underline",
|
|
45
|
-
"strike"
|
|
46
|
-
],
|
|
47
|
-
[
|
|
48
|
-
"h1",
|
|
49
|
-
"h2",
|
|
50
|
-
"h3"
|
|
51
|
-
],
|
|
52
|
-
[
|
|
53
|
-
"bulletList",
|
|
54
|
-
"orderedList",
|
|
55
|
-
"blockquote"
|
|
56
|
-
],
|
|
57
|
-
["link", "code"],
|
|
58
|
-
["undo", "redo"]
|
|
59
|
-
], I = a.forwardRef(({ value: e = "", onChange: t, toolbar: n = F, placeholder: r = "Écrivez ici...", maxLength: i, showCharacterCount: o = !1, minHeight: s = 200, disabled: c = !1, error: l, className: u, label: d, description: f, editable: p = !0 }, m) => {
|
|
60
|
-
let [h, g] = a.useState(null), [_, v] = a.useState(null), [y, b] = a.useState(null), [x, S] = a.useState("");
|
|
61
|
-
return a.useEffect(() => {
|
|
62
|
-
(async () => {
|
|
63
|
-
try {
|
|
64
|
-
let [{ useEditor: e, EditorContent: t }, { default: n }, { default: r }, { default: i }, { default: a }] = await Promise.all([
|
|
65
|
-
import("@tiptap/react"),
|
|
66
|
-
import("@tiptap/starter-kit"),
|
|
67
|
-
import("@tiptap/extension-underline"),
|
|
68
|
-
import("@tiptap/extension-link"),
|
|
69
|
-
import("@tiptap/extension-text-align")
|
|
70
|
-
]);
|
|
71
|
-
v({
|
|
72
|
-
useEditor: e,
|
|
73
|
-
EditorContent: t,
|
|
74
|
-
StarterKit: n,
|
|
75
|
-
Underline: r,
|
|
76
|
-
Link: i,
|
|
77
|
-
TextAlign: a
|
|
78
|
-
}), g(!0);
|
|
79
|
-
} catch {
|
|
80
|
-
g(!1);
|
|
81
|
-
}
|
|
82
|
-
})();
|
|
83
|
-
}, []), h && _ ? /* @__PURE__ */ w(L, {
|
|
84
|
-
ref: m,
|
|
85
|
-
components: _,
|
|
86
|
-
value: e,
|
|
87
|
-
onChange: t,
|
|
88
|
-
toolbar: n,
|
|
89
|
-
placeholder: r,
|
|
90
|
-
maxLength: i,
|
|
91
|
-
showCharacterCount: o,
|
|
92
|
-
minHeight: s,
|
|
93
|
-
disabled: c,
|
|
94
|
-
error: l,
|
|
95
|
-
className: u,
|
|
96
|
-
label: d,
|
|
97
|
-
description: f,
|
|
98
|
-
editable: p,
|
|
99
|
-
linkUrl: x,
|
|
100
|
-
setLinkUrl: S,
|
|
101
|
-
editor: y,
|
|
102
|
-
setEditor: b
|
|
103
|
-
}) : /* @__PURE__ */ w(z, {
|
|
104
|
-
ref: m,
|
|
105
|
-
value: e,
|
|
106
|
-
onChange: t,
|
|
107
|
-
placeholder: r,
|
|
108
|
-
maxLength: i,
|
|
109
|
-
showCharacterCount: o,
|
|
110
|
-
minHeight: s,
|
|
111
|
-
disabled: c,
|
|
112
|
-
error: l,
|
|
113
|
-
className: u,
|
|
114
|
-
label: d,
|
|
115
|
-
description: f,
|
|
116
|
-
loading: h === null
|
|
117
|
-
});
|
|
118
|
-
});
|
|
119
|
-
I.displayName = "WakaRichTextEditor";
|
|
120
|
-
var L = a.forwardRef(({ components: e, value: n, onChange: r, toolbar: o, placeholder: s, maxLength: c, showCharacterCount: l, minHeight: u, disabled: d, error: f, className: p, label: m, description: h, editable: g, linkUrl: _, setLinkUrl: v, setEditor: y }, b) => {
|
|
121
|
-
let { useEditor: x, EditorContent: S, StarterKit: C, Underline: E, Link: D, TextAlign: O } = e, A = x({
|
|
122
|
-
extensions: [
|
|
123
|
-
C.configure({ heading: { levels: [
|
|
124
|
-
1,
|
|
125
|
-
2,
|
|
126
|
-
3
|
|
127
|
-
] } }),
|
|
128
|
-
E,
|
|
129
|
-
D.configure({ openOnClick: !1 }),
|
|
130
|
-
O.configure({ types: ["heading", "paragraph"] })
|
|
131
|
-
],
|
|
132
|
-
content: n,
|
|
133
|
-
editable: g && !d,
|
|
134
|
-
onUpdate: ({ editor: e }) => {
|
|
135
|
-
let t = e.getHTML();
|
|
136
|
-
(!c || t.length <= c) && r?.(t);
|
|
137
|
-
}
|
|
138
|
-
});
|
|
139
|
-
a.useEffect(() => {
|
|
140
|
-
y(A);
|
|
141
|
-
}, [A, y]), a.useEffect(() => {
|
|
142
|
-
A && n !== A.getHTML() && A.commands?.setContent?.(n || "", !1);
|
|
143
|
-
}, [n, A]);
|
|
144
|
-
let j = () => {
|
|
145
|
-
A && (_ ? A.chain().focus().setLink({ href: _ }).run() : A.chain().focus().unsetLink().run(), v(""));
|
|
146
|
-
}, M = A?.storage?.characterCount?.characters?.() ?? n?.replace(/<[^>]*>/g, "").length ?? 0;
|
|
147
|
-
return /* @__PURE__ */ T("div", {
|
|
148
|
-
ref: b,
|
|
149
|
-
className: t("space-y-1.5", p),
|
|
150
|
-
children: [
|
|
151
|
-
m && /* @__PURE__ */ w(k, { children: m }),
|
|
152
|
-
h && /* @__PURE__ */ w("p", {
|
|
153
|
-
className: "text-sm text-muted-foreground",
|
|
154
|
-
children: h
|
|
155
|
-
}),
|
|
156
|
-
/* @__PURE__ */ T("div", {
|
|
157
|
-
className: t("border rounded-lg overflow-hidden", f && "border-destructive"),
|
|
158
|
-
children: [
|
|
159
|
-
A && o && /* @__PURE__ */ w("div", {
|
|
160
|
-
className: "flex flex-wrap items-center gap-0.5 p-1 border-b bg-muted/30",
|
|
161
|
-
children: o.map((e, t) => /* @__PURE__ */ T(a.Fragment, { children: [t > 0 && /* @__PURE__ */ w(i, {
|
|
162
|
-
orientation: "vertical",
|
|
163
|
-
className: "mx-1 h-6"
|
|
164
|
-
}), e.map((e) => /* @__PURE__ */ w(R, {
|
|
165
|
-
button: e,
|
|
166
|
-
editor: A,
|
|
167
|
-
linkUrl: _,
|
|
168
|
-
setLinkUrl: v,
|
|
169
|
-
handleSetLink: j
|
|
170
|
-
}, e))] }, t))
|
|
171
|
-
}),
|
|
172
|
-
/* @__PURE__ */ w("div", {
|
|
173
|
-
style: { minHeight: u },
|
|
174
|
-
children: /* @__PURE__ */ w(S, {
|
|
175
|
-
editor: A,
|
|
176
|
-
className: t("prose prose-sm max-w-none p-3 focus-within:outline-none h-full", "[&_.ProseMirror]:outline-none [&_.ProseMirror]:min-h-[inherit]")
|
|
177
|
-
})
|
|
178
|
-
}),
|
|
179
|
-
l && /* @__PURE__ */ T("div", {
|
|
180
|
-
className: "flex justify-end p-1.5 border-t bg-muted/30 text-xs text-muted-foreground",
|
|
181
|
-
children: [
|
|
182
|
-
M,
|
|
183
|
-
c && ` / ${c}`,
|
|
184
|
-
" caractères"
|
|
185
|
-
]
|
|
186
|
-
})
|
|
187
|
-
]
|
|
188
|
-
}),
|
|
189
|
-
f && /* @__PURE__ */ w("p", {
|
|
190
|
-
className: "text-sm text-destructive",
|
|
191
|
-
children: f
|
|
192
|
-
})
|
|
193
|
-
]
|
|
194
|
-
});
|
|
195
|
-
});
|
|
196
|
-
L.displayName = "TiptapEditorComponent";
|
|
197
|
-
function R({ button: e, editor: t, linkUrl: i, setLinkUrl: a, handleSetLink: C }) {
|
|
198
|
-
let { icon: E, action: D, isActive: O } = {
|
|
199
|
-
bold: {
|
|
200
|
-
icon: /* @__PURE__ */ w(l, { className: "h-4 w-4" }),
|
|
201
|
-
action: () => t.chain().focus().toggleBold().run(),
|
|
202
|
-
isActive: () => t.isActive("bold")
|
|
203
|
-
},
|
|
204
|
-
italic: {
|
|
205
|
-
icon: /* @__PURE__ */ w(m, { className: "h-4 w-4" }),
|
|
206
|
-
action: () => t.chain().focus().toggleItalic().run(),
|
|
207
|
-
isActive: () => t.isActive("italic")
|
|
208
|
-
},
|
|
209
|
-
underline: {
|
|
210
|
-
icon: /* @__PURE__ */ w(x, { className: "h-4 w-4" }),
|
|
211
|
-
action: () => t.chain().focus().toggleUnderline().run(),
|
|
212
|
-
isActive: () => t.isActive("underline")
|
|
213
|
-
},
|
|
214
|
-
strike: {
|
|
215
|
-
icon: /* @__PURE__ */ w(b, { className: "h-4 w-4" }),
|
|
216
|
-
action: () => t.chain().focus().toggleStrike().run(),
|
|
217
|
-
isActive: () => t.isActive("strike")
|
|
218
|
-
},
|
|
219
|
-
h1: {
|
|
220
|
-
icon: /* @__PURE__ */ w(d, { className: "h-4 w-4" }),
|
|
221
|
-
action: () => t.chain().focus().toggleHeading({ level: 1 }).run(),
|
|
222
|
-
isActive: () => t.isActive("heading", { level: 1 })
|
|
223
|
-
},
|
|
224
|
-
h2: {
|
|
225
|
-
icon: /* @__PURE__ */ w(f, { className: "h-4 w-4" }),
|
|
226
|
-
action: () => t.chain().focus().toggleHeading({ level: 2 }).run(),
|
|
227
|
-
isActive: () => t.isActive("heading", { level: 2 })
|
|
228
|
-
},
|
|
229
|
-
h3: {
|
|
230
|
-
icon: /* @__PURE__ */ w(p, { className: "h-4 w-4" }),
|
|
231
|
-
action: () => t.chain().focus().toggleHeading({ level: 3 }).run(),
|
|
232
|
-
isActive: () => t.isActive("heading", { level: 3 })
|
|
233
|
-
},
|
|
234
|
-
bulletList: {
|
|
235
|
-
icon: /* @__PURE__ */ w(g, { className: "h-4 w-4" }),
|
|
236
|
-
action: () => t.chain().focus().toggleBulletList().run(),
|
|
237
|
-
isActive: () => t.isActive("bulletList")
|
|
238
|
-
},
|
|
239
|
-
orderedList: {
|
|
240
|
-
icon: /* @__PURE__ */ w(_, { className: "h-4 w-4" }),
|
|
241
|
-
action: () => t.chain().focus().toggleOrderedList().run(),
|
|
242
|
-
isActive: () => t.isActive("orderedList")
|
|
243
|
-
},
|
|
244
|
-
blockquote: {
|
|
245
|
-
icon: /* @__PURE__ */ w(v, { className: "h-4 w-4" }),
|
|
246
|
-
action: () => t.chain().focus().toggleBlockquote().run(),
|
|
247
|
-
isActive: () => t.isActive("blockquote")
|
|
248
|
-
},
|
|
249
|
-
code: {
|
|
250
|
-
icon: /* @__PURE__ */ w(u, { className: "h-4 w-4" }),
|
|
251
|
-
action: () => t.chain().focus().toggleCodeBlock().run(),
|
|
252
|
-
isActive: () => t.isActive("codeBlock")
|
|
253
|
-
},
|
|
254
|
-
link: {
|
|
255
|
-
icon: /* @__PURE__ */ w(h, { className: "h-4 w-4" }),
|
|
256
|
-
action: () => {},
|
|
257
|
-
isActive: () => t.isActive("link")
|
|
258
|
-
},
|
|
259
|
-
alignLeft: {
|
|
260
|
-
icon: /* @__PURE__ */ w(s, { className: "h-4 w-4" }),
|
|
261
|
-
action: () => t.chain().focus().setTextAlign("left").run(),
|
|
262
|
-
isActive: () => t.isActive({ textAlign: "left" })
|
|
263
|
-
},
|
|
264
|
-
alignCenter: {
|
|
265
|
-
icon: /* @__PURE__ */ w(o, { className: "h-4 w-4" }),
|
|
266
|
-
action: () => t.chain().focus().setTextAlign("center").run(),
|
|
267
|
-
isActive: () => t.isActive({ textAlign: "center" })
|
|
268
|
-
},
|
|
269
|
-
alignRight: {
|
|
270
|
-
icon: /* @__PURE__ */ w(c, { className: "h-4 w-4" }),
|
|
271
|
-
action: () => t.chain().focus().setTextAlign("right").run(),
|
|
272
|
-
isActive: () => t.isActive({ textAlign: "right" })
|
|
273
|
-
},
|
|
274
|
-
undo: {
|
|
275
|
-
icon: /* @__PURE__ */ w(S, { className: "h-4 w-4" }),
|
|
276
|
-
action: () => t.chain().focus().undo().run()
|
|
277
|
-
},
|
|
278
|
-
redo: {
|
|
279
|
-
icon: /* @__PURE__ */ w(y, { className: "h-4 w-4" }),
|
|
280
|
-
action: () => t.chain().focus().redo().run()
|
|
281
|
-
}
|
|
282
|
-
}[e];
|
|
283
|
-
return e === "link" ? /* @__PURE__ */ T(A, { children: [/* @__PURE__ */ w(j, {
|
|
284
|
-
asChild: !0,
|
|
285
|
-
children: /* @__PURE__ */ w(r, {
|
|
286
|
-
type: "button",
|
|
287
|
-
variant: O?.() ? "secondary" : "ghost",
|
|
288
|
-
size: "icon",
|
|
289
|
-
className: "h-7 w-7",
|
|
290
|
-
children: E
|
|
291
|
-
})
|
|
292
|
-
}), /* @__PURE__ */ w(M, {
|
|
293
|
-
className: "w-64 p-2",
|
|
294
|
-
children: /* @__PURE__ */ T("div", {
|
|
295
|
-
className: "flex gap-2",
|
|
296
|
-
children: [/* @__PURE__ */ w(n, {
|
|
297
|
-
value: i,
|
|
298
|
-
onChange: (e) => a(e.target.value),
|
|
299
|
-
placeholder: "https://...",
|
|
300
|
-
className: "h-8"
|
|
301
|
-
}), /* @__PURE__ */ w(r, {
|
|
302
|
-
size: "sm",
|
|
303
|
-
onClick: C,
|
|
304
|
-
children: "OK"
|
|
305
|
-
})]
|
|
306
|
-
})
|
|
307
|
-
})] }) : /* @__PURE__ */ w(r, {
|
|
308
|
-
type: "button",
|
|
309
|
-
variant: O?.() ? "secondary" : "ghost",
|
|
310
|
-
size: "icon",
|
|
311
|
-
className: "h-7 w-7",
|
|
312
|
-
onClick: D,
|
|
313
|
-
children: E
|
|
314
|
-
});
|
|
315
|
-
}
|
|
316
|
-
var z = a.forwardRef(({ value: e, onChange: n, placeholder: r, maxLength: i, showCharacterCount: a, minHeight: o, disabled: s, error: c, className: l, label: u, description: d, loading: f }, p) => /* @__PURE__ */ T("div", {
|
|
317
|
-
ref: p,
|
|
318
|
-
className: t("space-y-1.5", l),
|
|
319
|
-
children: [
|
|
320
|
-
u && /* @__PURE__ */ w(k, { children: u }),
|
|
321
|
-
d && /* @__PURE__ */ w("p", {
|
|
322
|
-
className: "text-sm text-muted-foreground",
|
|
323
|
-
children: d
|
|
324
|
-
}),
|
|
325
|
-
/* @__PURE__ */ T("div", {
|
|
326
|
-
className: "relative",
|
|
327
|
-
children: [/* @__PURE__ */ w(N, {
|
|
328
|
-
value: e,
|
|
329
|
-
onChange: (e) => n?.(e.target.value),
|
|
330
|
-
placeholder: r,
|
|
331
|
-
maxLength: i,
|
|
332
|
-
disabled: s || f,
|
|
333
|
-
style: { minHeight: o },
|
|
334
|
-
className: t(c && "border-destructive")
|
|
335
|
-
}), f && /* @__PURE__ */ w("div", {
|
|
336
|
-
className: "absolute inset-0 flex items-center justify-center bg-background/50",
|
|
337
|
-
children: /* @__PURE__ */ w("span", {
|
|
338
|
-
className: "text-sm text-muted-foreground",
|
|
339
|
-
children: "Chargement..."
|
|
340
|
-
})
|
|
341
|
-
})]
|
|
342
|
-
}),
|
|
343
|
-
/* @__PURE__ */ T("div", {
|
|
344
|
-
className: "flex items-center justify-between",
|
|
345
|
-
children: [c && /* @__PURE__ */ w("p", {
|
|
346
|
-
className: "text-sm text-destructive",
|
|
347
|
-
children: c
|
|
348
|
-
}), a && /* @__PURE__ */ T("p", {
|
|
349
|
-
className: "text-xs text-muted-foreground ml-auto",
|
|
350
|
-
children: [
|
|
351
|
-
e?.length || 0,
|
|
352
|
-
i && ` / ${i}`,
|
|
353
|
-
" caractères"
|
|
354
|
-
]
|
|
355
|
-
})]
|
|
356
|
-
})
|
|
357
|
-
]
|
|
358
|
-
}));
|
|
359
|
-
z.displayName = "FallbackEditor";
|
|
360
|
-
//#endregion
|
|
361
|
-
export { M as a, A as i, P as n, j as o, N as r, k as s, I as t };
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
const e=require(`./waka-rich-text-editor-BJGlQgpq.js`);exports.WakaRichTextEditor=e.t,exports.default=e.t;
|
|
@@ -1,34 +0,0 @@
|
|
|
1
|
-
"use client"
|
|
2
|
-
|
|
3
|
-
import * as React from "react"
|
|
4
|
-
import { cn } from "../../utils/cn"
|
|
5
|
-
|
|
6
|
-
const WAKA_ROLES = ["CW", "SW", "IW", "LW", "DW", "TW", "AW", "BW", "FW", "EW"]
|
|
7
|
-
|
|
8
|
-
export interface ActorBadgeProps {
|
|
9
|
-
role: string
|
|
10
|
-
name?: string
|
|
11
|
-
isPrimary?: boolean
|
|
12
|
-
className?: string
|
|
13
|
-
}
|
|
14
|
-
|
|
15
|
-
function ActorBadge({ role, name, isPrimary, className }: ActorBadgeProps) {
|
|
16
|
-
const isWaka = WAKA_ROLES.includes(role)
|
|
17
|
-
return (
|
|
18
|
-
<span
|
|
19
|
-
className={cn(
|
|
20
|
-
"inline-flex items-center gap-1.5 rounded-full px-2.5 py-0.5 text-xs font-medium",
|
|
21
|
-
isWaka
|
|
22
|
-
? "bg-blue-100 text-blue-700 dark:bg-blue-900/30 dark:text-blue-300"
|
|
23
|
-
: "bg-emerald-100 text-emerald-700 dark:bg-emerald-900/30 dark:text-emerald-300",
|
|
24
|
-
className,
|
|
25
|
-
)}
|
|
26
|
-
>
|
|
27
|
-
<span className="font-bold">{role}</span>
|
|
28
|
-
{name && <span className="font-normal truncate max-w-[120px]">{name}</span>}
|
|
29
|
-
{isPrimary && <span className="text-amber-500" aria-label="Principal">★</span>}
|
|
30
|
-
</span>
|
|
31
|
-
)
|
|
32
|
-
}
|
|
33
|
-
|
|
34
|
-
export { ActorBadge }
|
|
@@ -1,125 +0,0 @@
|
|
|
1
|
-
"use client"
|
|
2
|
-
|
|
3
|
-
import * as React from "react"
|
|
4
|
-
import { cn } from "../../utils/cn"
|
|
5
|
-
import { ActorBadge } from "../waka-actor-badge"
|
|
6
|
-
|
|
7
|
-
export interface Actor {
|
|
8
|
-
id: string
|
|
9
|
-
userId: string
|
|
10
|
-
userName: string
|
|
11
|
-
role: string
|
|
12
|
-
isPrimary: boolean
|
|
13
|
-
}
|
|
14
|
-
|
|
15
|
-
export interface ActorsListProps {
|
|
16
|
-
wakaActors: Actor[]
|
|
17
|
-
ppActors: Actor[]
|
|
18
|
-
requiredWakaRoles: string[]
|
|
19
|
-
requiredPpRoles: string[]
|
|
20
|
-
onAdd: (side: "waka" | "pp") => void
|
|
21
|
-
onRemove: (actorId: string) => void
|
|
22
|
-
onTogglePrimary: (actorId: string) => void
|
|
23
|
-
}
|
|
24
|
-
|
|
25
|
-
function ActorPanel({
|
|
26
|
-
title,
|
|
27
|
-
actors,
|
|
28
|
-
requiredRoles,
|
|
29
|
-
bgClass,
|
|
30
|
-
side,
|
|
31
|
-
onAdd,
|
|
32
|
-
onRemove,
|
|
33
|
-
onTogglePrimary,
|
|
34
|
-
}: {
|
|
35
|
-
title: string
|
|
36
|
-
actors: Actor[]
|
|
37
|
-
requiredRoles: string[]
|
|
38
|
-
bgClass: string
|
|
39
|
-
side: "waka" | "pp"
|
|
40
|
-
onAdd: (side: "waka" | "pp") => void
|
|
41
|
-
onRemove: (actorId: string) => void
|
|
42
|
-
onTogglePrimary: (actorId: string) => void
|
|
43
|
-
}) {
|
|
44
|
-
const filledRoles = new Set(actors.map((a) => a.role))
|
|
45
|
-
const missingRequired = requiredRoles.filter((r) => !filledRoles.has(r))
|
|
46
|
-
|
|
47
|
-
return (
|
|
48
|
-
<div className={cn("flex-1 rounded-lg border p-3 space-y-2", bgClass)}>
|
|
49
|
-
<div className="flex items-center justify-between">
|
|
50
|
-
<h4 className="text-sm font-semibold">{title}</h4>
|
|
51
|
-
<button
|
|
52
|
-
onClick={() => onAdd(side)}
|
|
53
|
-
className="rounded-md bg-background border px-2 py-1 text-xs hover:bg-accent"
|
|
54
|
-
aria-label={`Ajouter un acteur ${title}`}
|
|
55
|
-
>
|
|
56
|
-
+ Ajouter
|
|
57
|
-
</button>
|
|
58
|
-
</div>
|
|
59
|
-
|
|
60
|
-
{missingRequired.length > 0 && (
|
|
61
|
-
<div className="text-xs text-red-600 border border-red-200 rounded p-1.5 bg-red-50 dark:bg-red-900/10">
|
|
62
|
-
Roles obligatoires manquants : {missingRequired.join(", ")}
|
|
63
|
-
</div>
|
|
64
|
-
)}
|
|
65
|
-
|
|
66
|
-
<div className="space-y-1.5">
|
|
67
|
-
{actors.map((a) => (
|
|
68
|
-
<div key={a.id} className="flex items-center justify-between rounded-md bg-background/80 px-2 py-1.5">
|
|
69
|
-
<ActorBadge role={a.role} name={a.userName} isPrimary={a.isPrimary} />
|
|
70
|
-
<div className="flex items-center gap-1">
|
|
71
|
-
<button
|
|
72
|
-
onClick={() => onTogglePrimary(a.id)}
|
|
73
|
-
className="text-xs text-muted-foreground hover:text-foreground"
|
|
74
|
-
title={a.isPrimary ? "Retirer principal" : "Marquer principal"}
|
|
75
|
-
>
|
|
76
|
-
{a.isPrimary ? "★" : "☆"}
|
|
77
|
-
</button>
|
|
78
|
-
<button
|
|
79
|
-
onClick={() => onRemove(a.id)}
|
|
80
|
-
className="text-xs text-red-500 hover:text-red-700 ml-1"
|
|
81
|
-
aria-label={`Retirer ${a.userName}`}
|
|
82
|
-
>
|
|
83
|
-
×
|
|
84
|
-
</button>
|
|
85
|
-
</div>
|
|
86
|
-
</div>
|
|
87
|
-
))}
|
|
88
|
-
{actors.length === 0 && (
|
|
89
|
-
<p className="text-xs text-muted-foreground text-center py-2">Aucun acteur</p>
|
|
90
|
-
)}
|
|
91
|
-
</div>
|
|
92
|
-
</div>
|
|
93
|
-
)
|
|
94
|
-
}
|
|
95
|
-
|
|
96
|
-
function ActorsList({
|
|
97
|
-
wakaActors, ppActors, requiredWakaRoles, requiredPpRoles, onAdd, onRemove, onTogglePrimary,
|
|
98
|
-
}: ActorsListProps) {
|
|
99
|
-
return (
|
|
100
|
-
<div className="flex gap-3">
|
|
101
|
-
<ActorPanel
|
|
102
|
-
title="Acteurs Waka"
|
|
103
|
-
actors={wakaActors}
|
|
104
|
-
requiredRoles={requiredWakaRoles}
|
|
105
|
-
bgClass="bg-blue-50/50 dark:bg-blue-950/10"
|
|
106
|
-
side="waka"
|
|
107
|
-
onAdd={onAdd}
|
|
108
|
-
onRemove={onRemove}
|
|
109
|
-
onTogglePrimary={onTogglePrimary}
|
|
110
|
-
/>
|
|
111
|
-
<ActorPanel
|
|
112
|
-
title="Acteurs PP"
|
|
113
|
-
actors={ppActors}
|
|
114
|
-
requiredRoles={requiredPpRoles}
|
|
115
|
-
bgClass="bg-emerald-50/50 dark:bg-emerald-950/10"
|
|
116
|
-
side="pp"
|
|
117
|
-
onAdd={onAdd}
|
|
118
|
-
onRemove={onRemove}
|
|
119
|
-
onTogglePrimary={onTogglePrimary}
|
|
120
|
-
/>
|
|
121
|
-
</div>
|
|
122
|
-
)
|
|
123
|
-
}
|
|
124
|
-
|
|
125
|
-
export { ActorsList }
|
|
@@ -1,31 +0,0 @@
|
|
|
1
|
-
"use client"
|
|
2
|
-
|
|
3
|
-
import * as React from "react"
|
|
4
|
-
import { cn } from "../../utils/cn"
|
|
5
|
-
|
|
6
|
-
export interface AiAssistantButtonProps {
|
|
7
|
-
onClick: () => void
|
|
8
|
-
hasExistingDoc?: boolean
|
|
9
|
-
disabled?: boolean
|
|
10
|
-
className?: string
|
|
11
|
-
}
|
|
12
|
-
|
|
13
|
-
function AiAssistantButton({ onClick, hasExistingDoc, disabled, className }: AiAssistantButtonProps) {
|
|
14
|
-
return (
|
|
15
|
-
<button
|
|
16
|
-
onClick={onClick}
|
|
17
|
-
disabled={disabled}
|
|
18
|
-
className={cn(
|
|
19
|
-
"inline-flex items-center gap-2 rounded-md px-3 py-2 text-sm font-medium transition-colors",
|
|
20
|
-
"bg-violet-600 text-white hover:bg-violet-700 disabled:opacity-50",
|
|
21
|
-
className,
|
|
22
|
-
)}
|
|
23
|
-
aria-label={hasExistingDoc ? "Ouvrir document IA" : "Assistant IA"}
|
|
24
|
-
>
|
|
25
|
-
<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" strokeWidth="2" strokeLinecap="round" strokeLinejoin="round"><path d="m12 3-1.912 5.813a2 2 0 0 1-1.275 1.275L3 12l5.813 1.912a2 2 0 0 1 1.275 1.275L12 21l1.912-5.813a2 2 0 0 1 1.275-1.275L21 12l-5.813-1.912a2 2 0 0 1-1.275-1.275L12 3Z"/><path d="M5 3v4"/><path d="M19 17v4"/><path d="M3 5h4"/><path d="M17 19h4"/></svg>
|
|
26
|
-
{hasExistingDoc ? "Ouvrir document IA" : "Assistant IA"}
|
|
27
|
-
</button>
|
|
28
|
-
)
|
|
29
|
-
}
|
|
30
|
-
|
|
31
|
-
export { AiAssistantButton }
|
|
@@ -1,36 +0,0 @@
|
|
|
1
|
-
"use client"
|
|
2
|
-
|
|
3
|
-
import * as React from "react"
|
|
4
|
-
import { HoverCard, HoverCardContent, HoverCardTrigger } from "../hover-card"
|
|
5
|
-
|
|
6
|
-
export interface DocumentFlyoverProps {
|
|
7
|
-
name: string
|
|
8
|
-
extension: string
|
|
9
|
-
sizeKb: number
|
|
10
|
-
lastModified: string
|
|
11
|
-
author: string
|
|
12
|
-
onClick: () => void
|
|
13
|
-
}
|
|
14
|
-
|
|
15
|
-
function DocumentFlyover({ name, extension, sizeKb, lastModified, author, onClick }: DocumentFlyoverProps) {
|
|
16
|
-
return (
|
|
17
|
-
<HoverCard openDelay={200}>
|
|
18
|
-
<HoverCardTrigger asChild>
|
|
19
|
-
<button
|
|
20
|
-
onClick={onClick}
|
|
21
|
-
className="inline-flex items-center justify-center h-7 w-7 rounded-md bg-muted hover:bg-accent transition-colors"
|
|
22
|
-
aria-label={`Document: ${name}`}
|
|
23
|
-
>
|
|
24
|
-
<svg xmlns="http://www.w3.org/2000/svg" width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" strokeWidth="2" strokeLinecap="round" strokeLinejoin="round"><path d="M14 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8z"/><polyline points="14 2 14 8 20 8"/></svg>
|
|
25
|
-
</button>
|
|
26
|
-
</HoverCardTrigger>
|
|
27
|
-
<HoverCardContent className="w-56 p-3 text-xs" side="top">
|
|
28
|
-
<p className="font-medium truncate">{name}.{extension}</p>
|
|
29
|
-
<p className="text-muted-foreground">{sizeKb} Ko — {lastModified}</p>
|
|
30
|
-
<p className="text-muted-foreground">par {author}</p>
|
|
31
|
-
</HoverCardContent>
|
|
32
|
-
</HoverCard>
|
|
33
|
-
)
|
|
34
|
-
}
|
|
35
|
-
|
|
36
|
-
export { DocumentFlyover }
|