@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
|
@@ -0,0 +1,135 @@
|
|
|
1
|
+
import { r as e } from "./chunk-Cr9pTUWm.mjs";
|
|
2
|
+
//#region src/components/editor/waka-editor-plugins.ts
|
|
3
|
+
var t = /* @__PURE__ */ e({
|
|
4
|
+
getPresetLoaders: () => g,
|
|
5
|
+
loadAIPlugins: () => d,
|
|
6
|
+
loadComboboxPlugins: () => h,
|
|
7
|
+
loadCorePlugins: () => n,
|
|
8
|
+
loadDiffPlugin: () => m,
|
|
9
|
+
loadDndPlugin: () => o,
|
|
10
|
+
loadEmojiPlugin: () => f,
|
|
11
|
+
loadFloatingPlugin: () => p,
|
|
12
|
+
loadIndentPlugin: () => c,
|
|
13
|
+
loadLinkPlugin: () => r,
|
|
14
|
+
loadMarkdownPlugin: () => l,
|
|
15
|
+
loadMediaPlugins: () => i,
|
|
16
|
+
loadMentionPlugins: () => a,
|
|
17
|
+
loadSelectionPlugin: () => u,
|
|
18
|
+
loadTocPlugin: () => s
|
|
19
|
+
});
|
|
20
|
+
async function n() {
|
|
21
|
+
let [e, t, n, r] = await Promise.all([
|
|
22
|
+
import("@platejs/basic-nodes/react"),
|
|
23
|
+
import("@platejs/table/react"),
|
|
24
|
+
import("@platejs/layout/react"),
|
|
25
|
+
import("@platejs/callout/react")
|
|
26
|
+
]);
|
|
27
|
+
return [
|
|
28
|
+
e.BoldPlugin,
|
|
29
|
+
e.ItalicPlugin,
|
|
30
|
+
e.UnderlinePlugin,
|
|
31
|
+
e.StrikethroughPlugin,
|
|
32
|
+
e.CodePlugin,
|
|
33
|
+
e.HighlightPlugin,
|
|
34
|
+
e.SuperscriptPlugin,
|
|
35
|
+
e.SubscriptPlugin,
|
|
36
|
+
e.H1Plugin,
|
|
37
|
+
e.H2Plugin,
|
|
38
|
+
e.H3Plugin,
|
|
39
|
+
e.H4Plugin,
|
|
40
|
+
e.H5Plugin,
|
|
41
|
+
e.H6Plugin,
|
|
42
|
+
e.BlockquotePlugin,
|
|
43
|
+
t.TablePlugin,
|
|
44
|
+
t.TableRowPlugin,
|
|
45
|
+
t.TableCellPlugin,
|
|
46
|
+
t.TableCellHeaderPlugin,
|
|
47
|
+
n.ColumnPlugin,
|
|
48
|
+
n.ColumnItemPlugin,
|
|
49
|
+
r.CalloutPlugin
|
|
50
|
+
];
|
|
51
|
+
}
|
|
52
|
+
async function r() {
|
|
53
|
+
let { LinkPlugin: e } = await import("@platejs/link/react");
|
|
54
|
+
return [e.configure({ options: { allowedSchemes: [
|
|
55
|
+
"http",
|
|
56
|
+
"https",
|
|
57
|
+
"mailto",
|
|
58
|
+
"tel"
|
|
59
|
+
] } })];
|
|
60
|
+
}
|
|
61
|
+
async function i() {
|
|
62
|
+
let { ImagePlugin: e, MediaEmbedPlugin: t } = await import("@platejs/media/react");
|
|
63
|
+
return [e, t];
|
|
64
|
+
}
|
|
65
|
+
async function a() {
|
|
66
|
+
let { MentionPlugin: e, MentionInputPlugin: t } = await import("@platejs/mention/react");
|
|
67
|
+
return [e.configure({ options: {
|
|
68
|
+
trigger: "@",
|
|
69
|
+
triggerPreviousCharPattern: /^$|^[\s"']$/,
|
|
70
|
+
insertSpaceAfterMention: !0
|
|
71
|
+
} }), t];
|
|
72
|
+
}
|
|
73
|
+
async function o() {
|
|
74
|
+
let { DndPlugin: e } = await import("@platejs/dnd/react");
|
|
75
|
+
return [e];
|
|
76
|
+
}
|
|
77
|
+
async function s() {
|
|
78
|
+
let { TocPlugin: e } = await import("@platejs/toc/react");
|
|
79
|
+
return [e];
|
|
80
|
+
}
|
|
81
|
+
async function c() {
|
|
82
|
+
let { IndentPlugin: e } = await import("@platejs/indent/react");
|
|
83
|
+
return [e];
|
|
84
|
+
}
|
|
85
|
+
async function l() {
|
|
86
|
+
let { MarkdownPlugin: e } = await import("@platejs/markdown");
|
|
87
|
+
return [e];
|
|
88
|
+
}
|
|
89
|
+
async function u() {
|
|
90
|
+
let { BlockSelectionPlugin: e } = await import("@platejs/selection/react");
|
|
91
|
+
return [e];
|
|
92
|
+
}
|
|
93
|
+
async function d(e) {
|
|
94
|
+
let { AIPlugin: t, AIChatPlugin: n } = await import("@platejs/ai/react"), r = [t];
|
|
95
|
+
return e?.endpoint ? r.push(n.configure({ options: { chat: {
|
|
96
|
+
api: e.endpoint,
|
|
97
|
+
body: { system: e.systemPrompt ?? "You are a helpful writing assistant." },
|
|
98
|
+
headers: e.headers
|
|
99
|
+
} } })) : r.push(n), r;
|
|
100
|
+
}
|
|
101
|
+
async function f() {
|
|
102
|
+
let { EmojiPlugin: e } = await import("@platejs/emoji/react");
|
|
103
|
+
return [e];
|
|
104
|
+
}
|
|
105
|
+
async function p() {
|
|
106
|
+
return [];
|
|
107
|
+
}
|
|
108
|
+
async function m() {
|
|
109
|
+
return [];
|
|
110
|
+
}
|
|
111
|
+
async function h() {
|
|
112
|
+
let { SlashPlugin: e, SlashInputPlugin: t } = await import("@platejs/combobox/react");
|
|
113
|
+
return [e.configure({ options: {
|
|
114
|
+
trigger: "/",
|
|
115
|
+
triggerPreviousCharPattern: /^$|^[\s"']$/
|
|
116
|
+
} }), t];
|
|
117
|
+
}
|
|
118
|
+
function g(e) {
|
|
119
|
+
switch (e) {
|
|
120
|
+
case "minimal": return [];
|
|
121
|
+
case "standard": return [r, c];
|
|
122
|
+
case "full": return [
|
|
123
|
+
r,
|
|
124
|
+
i,
|
|
125
|
+
a,
|
|
126
|
+
o,
|
|
127
|
+
s,
|
|
128
|
+
c,
|
|
129
|
+
l,
|
|
130
|
+
u
|
|
131
|
+
];
|
|
132
|
+
}
|
|
133
|
+
}
|
|
134
|
+
//#endregion
|
|
135
|
+
export { m as a, p as c, l as d, i as f, t as g, s as h, n as i, c as l, u as m, d as n, o, a as p, h as r, f as s, g as t, r as u };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
var e=require(`./chunk-14q5BKub.js`).r({getPresetLoaders:()=>h,loadAIPlugins:()=>u,loadComboboxPlugins:()=>m,loadCorePlugins:()=>t,loadDiffPlugin:()=>p,loadDndPlugin:()=>a,loadEmojiPlugin:()=>d,loadFloatingPlugin:()=>f,loadIndentPlugin:()=>s,loadLinkPlugin:()=>n,loadMarkdownPlugin:()=>c,loadMediaPlugins:()=>r,loadMentionPlugins:()=>i,loadSelectionPlugin:()=>l,loadTocPlugin:()=>o});async function t(){let[e,t,n,r]=await Promise.all([import(`@platejs/basic-nodes/react`),import(`@platejs/table/react`),import(`@platejs/layout/react`),import(`@platejs/callout/react`)]);return[e.BoldPlugin,e.ItalicPlugin,e.UnderlinePlugin,e.StrikethroughPlugin,e.CodePlugin,e.HighlightPlugin,e.SuperscriptPlugin,e.SubscriptPlugin,e.H1Plugin,e.H2Plugin,e.H3Plugin,e.H4Plugin,e.H5Plugin,e.H6Plugin,e.BlockquotePlugin,t.TablePlugin,t.TableRowPlugin,t.TableCellPlugin,t.TableCellHeaderPlugin,n.ColumnPlugin,n.ColumnItemPlugin,r.CalloutPlugin]}async function n(){let{LinkPlugin:e}=await import(`@platejs/link/react`);return[e.configure({options:{allowedSchemes:[`http`,`https`,`mailto`,`tel`]}})]}async function r(){let{ImagePlugin:e,MediaEmbedPlugin:t}=await import(`@platejs/media/react`);return[e,t]}async function i(){let{MentionPlugin:e,MentionInputPlugin:t}=await import(`@platejs/mention/react`);return[e.configure({options:{trigger:`@`,triggerPreviousCharPattern:/^$|^[\s"']$/,insertSpaceAfterMention:!0}}),t]}async function a(){let{DndPlugin:e}=await import(`@platejs/dnd/react`);return[e]}async function o(){let{TocPlugin:e}=await import(`@platejs/toc/react`);return[e]}async function s(){let{IndentPlugin:e}=await import(`@platejs/indent/react`);return[e]}async function c(){let{MarkdownPlugin:e}=await import(`@platejs/markdown`);return[e]}async function l(){let{BlockSelectionPlugin:e}=await import(`@platejs/selection/react`);return[e]}async function u(e){let{AIPlugin:t,AIChatPlugin:n}=await import(`@platejs/ai/react`),r=[t];return e?.endpoint?r.push(n.configure({options:{chat:{api:e.endpoint,body:{system:e.systemPrompt??`You are a helpful writing assistant.`},headers:e.headers}}})):r.push(n),r}async function d(){let{EmojiPlugin:e}=await import(`@platejs/emoji/react`);return[e]}async function f(){return[]}async function p(){return[]}async function m(){let{SlashPlugin:e,SlashInputPlugin:t}=await import(`@platejs/combobox/react`);return[e.configure({options:{trigger:`/`,triggerPreviousCharPattern:/^$|^[\s"']$/}}),t]}function h(e){switch(e){case`minimal`:return[];case`standard`:return[n,s];case`full`:return[n,r,i,a,o,s,c,l]}}Object.defineProperty(exports,`a`,{enumerable:!0,get:function(){return p}}),Object.defineProperty(exports,`c`,{enumerable:!0,get:function(){return f}}),Object.defineProperty(exports,`d`,{enumerable:!0,get:function(){return c}}),Object.defineProperty(exports,`f`,{enumerable:!0,get:function(){return r}}),Object.defineProperty(exports,`g`,{enumerable:!0,get:function(){return e}}),Object.defineProperty(exports,`h`,{enumerable:!0,get:function(){return o}}),Object.defineProperty(exports,`i`,{enumerable:!0,get:function(){return t}}),Object.defineProperty(exports,`l`,{enumerable:!0,get:function(){return s}}),Object.defineProperty(exports,`m`,{enumerable:!0,get:function(){return l}}),Object.defineProperty(exports,`n`,{enumerable:!0,get:function(){return u}}),Object.defineProperty(exports,`o`,{enumerable:!0,get:function(){return a}}),Object.defineProperty(exports,`p`,{enumerable:!0,get:function(){return i}}),Object.defineProperty(exports,`r`,{enumerable:!0,get:function(){return m}}),Object.defineProperty(exports,`s`,{enumerable:!0,get:function(){return d}}),Object.defineProperty(exports,`t`,{enumerable:!0,get:function(){return h}}),Object.defineProperty(exports,`u`,{enumerable:!0,get:function(){return n}});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
require(`./chunk-14q5BKub.js`);const e=require(`./waka-rich-text-editor-D1uA3zbB.js`);exports.WakaRichTextEditor=e.t,exports.default=e.t;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
const e=require(`./chunk-14q5BKub.js`),t=require(`./cn-DEtaFQsA.js`),n=require(`./separator-NrkltulH.js`),r=require(`./textarea-CdQWggYG.js`),i=require(`./input-BfaSAGVw.js`);let a=require(`react`);a=e.a(a);let o=require(`lucide-react`),s=require(`react/jsx-runtime`),c=require(`@radix-ui/react-popover`);c=e.a(c),t.n();var l=c.Root,u=c.Trigger,d=a.forwardRef(({className:e,align:n=`center`,sideOffset:r=4,...i},a)=>(0,s.jsx)(c.Portal,{children:(0,s.jsx)(c.Content,{ref:a,align:n,sideOffset:r,className:t.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),...i})}));d.displayName=c.Content.displayName,t.n();var f=[[`bold`,`italic`,`underline`,`strike`],[`h1`,`h2`,`h3`],[`bulletList`,`orderedList`,`blockquote`],[`link`,`code`],[`undo`,`redo`]],p=a.forwardRef(({value:e=``,onChange:t,toolbar:n=f,placeholder:r=`Écrivez ici...`,maxLength:i,showCharacterCount:o=!1,minHeight:c=200,disabled:l=!1,error:u,className:d,label:p,description:h,editable:_=!0},v)=>{let[y,b]=a.useState(null),[x,S]=a.useState(null),[C,w]=a.useState(null),[T,E]=a.useState(``);return a.useEffect(()=>{(async()=>{try{let[{useEditor:e,EditorContent:t},{default:n},{default:r},{default:i},{default:a}]=await Promise.all([import(`@tiptap/react`),import(`@tiptap/starter-kit`),import(`@tiptap/extension-underline`),import(`@tiptap/extension-link`),import(`@tiptap/extension-text-align`)]);S({useEditor:e,EditorContent:t,StarterKit:n,Underline:r,Link:i,TextAlign:a}),b(!0)}catch{b(!1)}})()},[]),y&&x?(0,s.jsx)(m,{ref:v,components:x,value:e,onChange:t,toolbar:n,placeholder:r,maxLength:i,showCharacterCount:o,minHeight:c,disabled:l,error:u,className:d,label:p,description:h,editable:_,linkUrl:T,setLinkUrl:E,editor:C,setEditor:w}):(0,s.jsx)(g,{ref:v,value:e,onChange:t,placeholder:r,maxLength:i,showCharacterCount:o,minHeight:c,disabled:l,error:u,className:d,label:p,description:h,loading:y===null})});p.displayName=`WakaRichTextEditor`;var m=a.forwardRef(({components:e,value:i,onChange:o,toolbar:c,placeholder:l,maxLength:u,showCharacterCount:d,minHeight:f,disabled:p,error:m,className:g,label:_,description:v,editable:y,linkUrl:b,setLinkUrl:x,setEditor:S},C)=>{let{useEditor:w,EditorContent:T,StarterKit:E,Underline:D,Link:O,TextAlign:k}=e,A=w({extensions:[E.configure({heading:{levels:[1,2,3]}}),D,O.configure({openOnClick:!1}),k.configure({types:[`heading`,`paragraph`]})],content:i,editable:y&&!p,onUpdate:({editor:e})=>{let t=e.getHTML();(!u||t.length<=u)&&o?.(t)}});a.useEffect(()=>{S(A)},[A,S]),a.useEffect(()=>{A&&i!==A.getHTML()&&A.commands?.setContent?.(i||``,!1)},[i,A]);let j=()=>{A&&(b?A.chain().focus().setLink({href:b}).run():A.chain().focus().unsetLink().run(),x(``))},M=A?.storage?.characterCount?.characters?.()??i?.replace(/<[^>]*>/g,``).length??0;return(0,s.jsxs)(`div`,{ref:C,className:t.t(`space-y-1.5`,g),children:[_&&(0,s.jsx)(r.n,{children:_}),v&&(0,s.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:v}),(0,s.jsxs)(`div`,{className:t.t(`border rounded-lg overflow-hidden`,m&&`border-destructive`),children:[A&&c&&(0,s.jsx)(`div`,{className:`flex flex-wrap items-center gap-0.5 p-1 border-b bg-muted/30`,children:c.map((e,t)=>(0,s.jsxs)(a.Fragment,{children:[t>0&&(0,s.jsx)(n.t,{orientation:`vertical`,className:`mx-1 h-6`}),e.map(e=>(0,s.jsx)(h,{button:e,editor:A,linkUrl:b,setLinkUrl:x,handleSetLink:j},e))]},t))}),(0,s.jsx)(`div`,{style:{minHeight:f},children:(0,s.jsx)(T,{editor:A,className:t.t(`prose prose-sm max-w-none p-3 focus-within:outline-none h-full`,`[&_.ProseMirror]:outline-none [&_.ProseMirror]:min-h-[inherit]`)})}),d&&(0,s.jsxs)(`div`,{className:`flex justify-end p-1.5 border-t bg-muted/30 text-xs text-muted-foreground`,children:[M,u&&` / ${u}`,` caractères`]})]}),m&&(0,s.jsx)(`p`,{className:`text-sm text-destructive`,children:m})]})});m.displayName=`TiptapEditorComponent`;function h({button:e,editor:t,linkUrl:r,setLinkUrl:a,handleSetLink:c}){let{icon:f,action:p,isActive:m}={bold:{icon:(0,s.jsx)(o.Bold,{className:`h-4 w-4`}),action:()=>t.chain().focus().toggleBold().run(),isActive:()=>t.isActive(`bold`)},italic:{icon:(0,s.jsx)(o.Italic,{className:`h-4 w-4`}),action:()=>t.chain().focus().toggleItalic().run(),isActive:()=>t.isActive(`italic`)},underline:{icon:(0,s.jsx)(o.Underline,{className:`h-4 w-4`}),action:()=>t.chain().focus().toggleUnderline().run(),isActive:()=>t.isActive(`underline`)},strike:{icon:(0,s.jsx)(o.Strikethrough,{className:`h-4 w-4`}),action:()=>t.chain().focus().toggleStrike().run(),isActive:()=>t.isActive(`strike`)},h1:{icon:(0,s.jsx)(o.Heading1,{className:`h-4 w-4`}),action:()=>t.chain().focus().toggleHeading({level:1}).run(),isActive:()=>t.isActive(`heading`,{level:1})},h2:{icon:(0,s.jsx)(o.Heading2,{className:`h-4 w-4`}),action:()=>t.chain().focus().toggleHeading({level:2}).run(),isActive:()=>t.isActive(`heading`,{level:2})},h3:{icon:(0,s.jsx)(o.Heading3,{className:`h-4 w-4`}),action:()=>t.chain().focus().toggleHeading({level:3}).run(),isActive:()=>t.isActive(`heading`,{level:3})},bulletList:{icon:(0,s.jsx)(o.List,{className:`h-4 w-4`}),action:()=>t.chain().focus().toggleBulletList().run(),isActive:()=>t.isActive(`bulletList`)},orderedList:{icon:(0,s.jsx)(o.ListOrdered,{className:`h-4 w-4`}),action:()=>t.chain().focus().toggleOrderedList().run(),isActive:()=>t.isActive(`orderedList`)},blockquote:{icon:(0,s.jsx)(o.Quote,{className:`h-4 w-4`}),action:()=>t.chain().focus().toggleBlockquote().run(),isActive:()=>t.isActive(`blockquote`)},code:{icon:(0,s.jsx)(o.Code,{className:`h-4 w-4`}),action:()=>t.chain().focus().toggleCodeBlock().run(),isActive:()=>t.isActive(`codeBlock`)},link:{icon:(0,s.jsx)(o.Link,{className:`h-4 w-4`}),action:()=>{},isActive:()=>t.isActive(`link`)},alignLeft:{icon:(0,s.jsx)(o.AlignLeft,{className:`h-4 w-4`}),action:()=>t.chain().focus().setTextAlign(`left`).run(),isActive:()=>t.isActive({textAlign:`left`})},alignCenter:{icon:(0,s.jsx)(o.AlignCenter,{className:`h-4 w-4`}),action:()=>t.chain().focus().setTextAlign(`center`).run(),isActive:()=>t.isActive({textAlign:`center`})},alignRight:{icon:(0,s.jsx)(o.AlignRight,{className:`h-4 w-4`}),action:()=>t.chain().focus().setTextAlign(`right`).run(),isActive:()=>t.isActive({textAlign:`right`})},undo:{icon:(0,s.jsx)(o.Undo,{className:`h-4 w-4`}),action:()=>t.chain().focus().undo().run()},redo:{icon:(0,s.jsx)(o.Redo,{className:`h-4 w-4`}),action:()=>t.chain().focus().redo().run()}}[e];return e===`link`?(0,s.jsxs)(l,{children:[(0,s.jsx)(u,{asChild:!0,children:(0,s.jsx)(n.n,{type:`button`,variant:m?.()?`secondary`:`ghost`,size:`icon`,className:`h-7 w-7`,children:f})}),(0,s.jsx)(d,{className:`w-64 p-2`,children:(0,s.jsxs)(`div`,{className:`flex gap-2`,children:[(0,s.jsx)(i.t,{value:r,onChange:e=>a(e.target.value),placeholder:`https://...`,className:`h-8`}),(0,s.jsx)(n.n,{size:`sm`,onClick:c,children:`OK`})]})})]}):(0,s.jsx)(n.n,{type:`button`,variant:m?.()?`secondary`:`ghost`,size:`icon`,className:`h-7 w-7`,onClick:p,children:f})}var g=a.forwardRef(({value:e,onChange:n,placeholder:i,maxLength:a,showCharacterCount:o,minHeight:c,disabled:l,error:u,className:d,label:f,description:p,loading:m},h)=>(0,s.jsxs)(`div`,{ref:h,className:t.t(`space-y-1.5`,d),children:[f&&(0,s.jsx)(r.n,{children:f}),p&&(0,s.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:p}),(0,s.jsxs)(`div`,{className:`relative`,children:[(0,s.jsx)(r.t,{value:e,onChange:e=>n?.(e.target.value),placeholder:i,maxLength:a,disabled:l||m,style:{minHeight:c},className:t.t(u&&`border-destructive`)}),m&&(0,s.jsx)(`div`,{className:`absolute inset-0 flex items-center justify-center bg-background/50`,children:(0,s.jsx)(`span`,{className:`text-sm text-muted-foreground`,children:`Chargement...`})})]}),(0,s.jsxs)(`div`,{className:`flex items-center justify-between`,children:[u&&(0,s.jsx)(`p`,{className:`text-sm text-destructive`,children:u}),o&&(0,s.jsxs)(`p`,{className:`text-xs text-muted-foreground ml-auto`,children:[e?.length||0,a&&` / ${a}`,` caractères`]})]})]}));g.displayName=`FallbackEditor`,Object.defineProperty(exports,`i`,{enumerable:!0,get:function(){return u}}),Object.defineProperty(exports,`n`,{enumerable:!0,get:function(){return l}}),Object.defineProperty(exports,`r`,{enumerable:!0,get:function(){return d}}),Object.defineProperty(exports,`t`,{enumerable:!0,get:function(){return p}});
|
|
@@ -0,0 +1,342 @@
|
|
|
1
|
+
import { n as e, t } from "./cn-DUn6aSIQ.mjs";
|
|
2
|
+
import { n, t as r } from "./separator-ibN2mycs.mjs";
|
|
3
|
+
import { n as i, t as a } from "./textarea-DJDXJ3nd.mjs";
|
|
4
|
+
import { t as o } from "./input-DVr_Qkl8.mjs";
|
|
5
|
+
import * as s from "react";
|
|
6
|
+
import { AlignCenter as c, AlignLeft as l, AlignRight as u, Bold as d, Code as f, Heading1 as p, Heading2 as m, Heading3 as h, Italic as g, Link as _, List as v, ListOrdered as y, Quote as b, Redo as x, Strikethrough as S, Underline as C, Undo as w } from "lucide-react";
|
|
7
|
+
import { jsx as T, jsxs as E } from "react/jsx-runtime";
|
|
8
|
+
import * as D from "@radix-ui/react-popover";
|
|
9
|
+
//#region src/components/popover/index.tsx
|
|
10
|
+
e();
|
|
11
|
+
var O = D.Root, k = D.Trigger, A = s.forwardRef(({ className: e, align: n = "center", sideOffset: r = 4, ...i }, a) => /* @__PURE__ */ T(D.Portal, { children: /* @__PURE__ */ T(D.Content, {
|
|
12
|
+
ref: a,
|
|
13
|
+
align: n,
|
|
14
|
+
sideOffset: r,
|
|
15
|
+
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),
|
|
16
|
+
...i
|
|
17
|
+
}) }));
|
|
18
|
+
//#endregion
|
|
19
|
+
//#region src/components/waka-rich-text-editor/index.tsx
|
|
20
|
+
A.displayName = D.Content.displayName, e();
|
|
21
|
+
var j = [
|
|
22
|
+
[
|
|
23
|
+
"bold",
|
|
24
|
+
"italic",
|
|
25
|
+
"underline",
|
|
26
|
+
"strike"
|
|
27
|
+
],
|
|
28
|
+
[
|
|
29
|
+
"h1",
|
|
30
|
+
"h2",
|
|
31
|
+
"h3"
|
|
32
|
+
],
|
|
33
|
+
[
|
|
34
|
+
"bulletList",
|
|
35
|
+
"orderedList",
|
|
36
|
+
"blockquote"
|
|
37
|
+
],
|
|
38
|
+
["link", "code"],
|
|
39
|
+
["undo", "redo"]
|
|
40
|
+
], M = s.forwardRef(({ value: e = "", onChange: t, toolbar: n = j, placeholder: r = "Écrivez ici...", maxLength: i, showCharacterCount: a = !1, minHeight: o = 200, disabled: c = !1, error: l, className: u, label: d, description: f, editable: p = !0 }, m) => {
|
|
41
|
+
let [h, g] = s.useState(null), [_, v] = s.useState(null), [y, b] = s.useState(null), [x, S] = s.useState("");
|
|
42
|
+
return s.useEffect(() => {
|
|
43
|
+
(async () => {
|
|
44
|
+
try {
|
|
45
|
+
let [{ useEditor: e, EditorContent: t }, { default: n }, { default: r }, { default: i }, { default: a }] = await Promise.all([
|
|
46
|
+
import("@tiptap/react"),
|
|
47
|
+
import("@tiptap/starter-kit"),
|
|
48
|
+
import("@tiptap/extension-underline"),
|
|
49
|
+
import("@tiptap/extension-link"),
|
|
50
|
+
import("@tiptap/extension-text-align")
|
|
51
|
+
]);
|
|
52
|
+
v({
|
|
53
|
+
useEditor: e,
|
|
54
|
+
EditorContent: t,
|
|
55
|
+
StarterKit: n,
|
|
56
|
+
Underline: r,
|
|
57
|
+
Link: i,
|
|
58
|
+
TextAlign: a
|
|
59
|
+
}), g(!0);
|
|
60
|
+
} catch {
|
|
61
|
+
g(!1);
|
|
62
|
+
}
|
|
63
|
+
})();
|
|
64
|
+
}, []), h && _ ? /* @__PURE__ */ T(N, {
|
|
65
|
+
ref: m,
|
|
66
|
+
components: _,
|
|
67
|
+
value: e,
|
|
68
|
+
onChange: t,
|
|
69
|
+
toolbar: n,
|
|
70
|
+
placeholder: r,
|
|
71
|
+
maxLength: i,
|
|
72
|
+
showCharacterCount: a,
|
|
73
|
+
minHeight: o,
|
|
74
|
+
disabled: c,
|
|
75
|
+
error: l,
|
|
76
|
+
className: u,
|
|
77
|
+
label: d,
|
|
78
|
+
description: f,
|
|
79
|
+
editable: p,
|
|
80
|
+
linkUrl: x,
|
|
81
|
+
setLinkUrl: S,
|
|
82
|
+
editor: y,
|
|
83
|
+
setEditor: b
|
|
84
|
+
}) : /* @__PURE__ */ T(F, {
|
|
85
|
+
ref: m,
|
|
86
|
+
value: e,
|
|
87
|
+
onChange: t,
|
|
88
|
+
placeholder: r,
|
|
89
|
+
maxLength: i,
|
|
90
|
+
showCharacterCount: a,
|
|
91
|
+
minHeight: o,
|
|
92
|
+
disabled: c,
|
|
93
|
+
error: l,
|
|
94
|
+
className: u,
|
|
95
|
+
label: d,
|
|
96
|
+
description: f,
|
|
97
|
+
loading: h === null
|
|
98
|
+
});
|
|
99
|
+
});
|
|
100
|
+
M.displayName = "WakaRichTextEditor";
|
|
101
|
+
var N = s.forwardRef(({ components: e, value: n, onChange: a, toolbar: o, placeholder: c, maxLength: l, showCharacterCount: u, minHeight: d, disabled: f, error: p, className: m, label: h, description: g, editable: _, linkUrl: v, setLinkUrl: y, setEditor: b }, x) => {
|
|
102
|
+
let { useEditor: S, EditorContent: C, StarterKit: w, Underline: D, Link: O, TextAlign: k } = e, A = S({
|
|
103
|
+
extensions: [
|
|
104
|
+
w.configure({ heading: { levels: [
|
|
105
|
+
1,
|
|
106
|
+
2,
|
|
107
|
+
3
|
|
108
|
+
] } }),
|
|
109
|
+
D,
|
|
110
|
+
O.configure({ openOnClick: !1 }),
|
|
111
|
+
k.configure({ types: ["heading", "paragraph"] })
|
|
112
|
+
],
|
|
113
|
+
content: n,
|
|
114
|
+
editable: _ && !f,
|
|
115
|
+
onUpdate: ({ editor: e }) => {
|
|
116
|
+
let t = e.getHTML();
|
|
117
|
+
(!l || t.length <= l) && a?.(t);
|
|
118
|
+
}
|
|
119
|
+
});
|
|
120
|
+
s.useEffect(() => {
|
|
121
|
+
b(A);
|
|
122
|
+
}, [A, b]), s.useEffect(() => {
|
|
123
|
+
A && n !== A.getHTML() && A.commands?.setContent?.(n || "", !1);
|
|
124
|
+
}, [n, A]);
|
|
125
|
+
let j = () => {
|
|
126
|
+
A && (v ? A.chain().focus().setLink({ href: v }).run() : A.chain().focus().unsetLink().run(), y(""));
|
|
127
|
+
}, M = A?.storage?.characterCount?.characters?.() ?? n?.replace(/<[^>]*>/g, "").length ?? 0;
|
|
128
|
+
return /* @__PURE__ */ E("div", {
|
|
129
|
+
ref: x,
|
|
130
|
+
className: t("space-y-1.5", m),
|
|
131
|
+
children: [
|
|
132
|
+
h && /* @__PURE__ */ T(i, { children: h }),
|
|
133
|
+
g && /* @__PURE__ */ T("p", {
|
|
134
|
+
className: "text-sm text-muted-foreground",
|
|
135
|
+
children: g
|
|
136
|
+
}),
|
|
137
|
+
/* @__PURE__ */ E("div", {
|
|
138
|
+
className: t("border rounded-lg overflow-hidden", p && "border-destructive"),
|
|
139
|
+
children: [
|
|
140
|
+
A && o && /* @__PURE__ */ T("div", {
|
|
141
|
+
className: "flex flex-wrap items-center gap-0.5 p-1 border-b bg-muted/30",
|
|
142
|
+
children: o.map((e, t) => /* @__PURE__ */ E(s.Fragment, { children: [t > 0 && /* @__PURE__ */ T(r, {
|
|
143
|
+
orientation: "vertical",
|
|
144
|
+
className: "mx-1 h-6"
|
|
145
|
+
}), e.map((e) => /* @__PURE__ */ T(P, {
|
|
146
|
+
button: e,
|
|
147
|
+
editor: A,
|
|
148
|
+
linkUrl: v,
|
|
149
|
+
setLinkUrl: y,
|
|
150
|
+
handleSetLink: j
|
|
151
|
+
}, e))] }, t))
|
|
152
|
+
}),
|
|
153
|
+
/* @__PURE__ */ T("div", {
|
|
154
|
+
style: { minHeight: d },
|
|
155
|
+
children: /* @__PURE__ */ T(C, {
|
|
156
|
+
editor: A,
|
|
157
|
+
className: t("prose prose-sm max-w-none p-3 focus-within:outline-none h-full", "[&_.ProseMirror]:outline-none [&_.ProseMirror]:min-h-[inherit]")
|
|
158
|
+
})
|
|
159
|
+
}),
|
|
160
|
+
u && /* @__PURE__ */ E("div", {
|
|
161
|
+
className: "flex justify-end p-1.5 border-t bg-muted/30 text-xs text-muted-foreground",
|
|
162
|
+
children: [
|
|
163
|
+
M,
|
|
164
|
+
l && ` / ${l}`,
|
|
165
|
+
" caractères"
|
|
166
|
+
]
|
|
167
|
+
})
|
|
168
|
+
]
|
|
169
|
+
}),
|
|
170
|
+
p && /* @__PURE__ */ T("p", {
|
|
171
|
+
className: "text-sm text-destructive",
|
|
172
|
+
children: p
|
|
173
|
+
})
|
|
174
|
+
]
|
|
175
|
+
});
|
|
176
|
+
});
|
|
177
|
+
N.displayName = "TiptapEditorComponent";
|
|
178
|
+
function P({ button: e, editor: t, linkUrl: r, setLinkUrl: i, handleSetLink: a }) {
|
|
179
|
+
let { icon: s, action: D, isActive: j } = {
|
|
180
|
+
bold: {
|
|
181
|
+
icon: /* @__PURE__ */ T(d, { className: "h-4 w-4" }),
|
|
182
|
+
action: () => t.chain().focus().toggleBold().run(),
|
|
183
|
+
isActive: () => t.isActive("bold")
|
|
184
|
+
},
|
|
185
|
+
italic: {
|
|
186
|
+
icon: /* @__PURE__ */ T(g, { className: "h-4 w-4" }),
|
|
187
|
+
action: () => t.chain().focus().toggleItalic().run(),
|
|
188
|
+
isActive: () => t.isActive("italic")
|
|
189
|
+
},
|
|
190
|
+
underline: {
|
|
191
|
+
icon: /* @__PURE__ */ T(C, { className: "h-4 w-4" }),
|
|
192
|
+
action: () => t.chain().focus().toggleUnderline().run(),
|
|
193
|
+
isActive: () => t.isActive("underline")
|
|
194
|
+
},
|
|
195
|
+
strike: {
|
|
196
|
+
icon: /* @__PURE__ */ T(S, { className: "h-4 w-4" }),
|
|
197
|
+
action: () => t.chain().focus().toggleStrike().run(),
|
|
198
|
+
isActive: () => t.isActive("strike")
|
|
199
|
+
},
|
|
200
|
+
h1: {
|
|
201
|
+
icon: /* @__PURE__ */ T(p, { className: "h-4 w-4" }),
|
|
202
|
+
action: () => t.chain().focus().toggleHeading({ level: 1 }).run(),
|
|
203
|
+
isActive: () => t.isActive("heading", { level: 1 })
|
|
204
|
+
},
|
|
205
|
+
h2: {
|
|
206
|
+
icon: /* @__PURE__ */ T(m, { className: "h-4 w-4" }),
|
|
207
|
+
action: () => t.chain().focus().toggleHeading({ level: 2 }).run(),
|
|
208
|
+
isActive: () => t.isActive("heading", { level: 2 })
|
|
209
|
+
},
|
|
210
|
+
h3: {
|
|
211
|
+
icon: /* @__PURE__ */ T(h, { className: "h-4 w-4" }),
|
|
212
|
+
action: () => t.chain().focus().toggleHeading({ level: 3 }).run(),
|
|
213
|
+
isActive: () => t.isActive("heading", { level: 3 })
|
|
214
|
+
},
|
|
215
|
+
bulletList: {
|
|
216
|
+
icon: /* @__PURE__ */ T(v, { className: "h-4 w-4" }),
|
|
217
|
+
action: () => t.chain().focus().toggleBulletList().run(),
|
|
218
|
+
isActive: () => t.isActive("bulletList")
|
|
219
|
+
},
|
|
220
|
+
orderedList: {
|
|
221
|
+
icon: /* @__PURE__ */ T(y, { className: "h-4 w-4" }),
|
|
222
|
+
action: () => t.chain().focus().toggleOrderedList().run(),
|
|
223
|
+
isActive: () => t.isActive("orderedList")
|
|
224
|
+
},
|
|
225
|
+
blockquote: {
|
|
226
|
+
icon: /* @__PURE__ */ T(b, { className: "h-4 w-4" }),
|
|
227
|
+
action: () => t.chain().focus().toggleBlockquote().run(),
|
|
228
|
+
isActive: () => t.isActive("blockquote")
|
|
229
|
+
},
|
|
230
|
+
code: {
|
|
231
|
+
icon: /* @__PURE__ */ T(f, { className: "h-4 w-4" }),
|
|
232
|
+
action: () => t.chain().focus().toggleCodeBlock().run(),
|
|
233
|
+
isActive: () => t.isActive("codeBlock")
|
|
234
|
+
},
|
|
235
|
+
link: {
|
|
236
|
+
icon: /* @__PURE__ */ T(_, { className: "h-4 w-4" }),
|
|
237
|
+
action: () => {},
|
|
238
|
+
isActive: () => t.isActive("link")
|
|
239
|
+
},
|
|
240
|
+
alignLeft: {
|
|
241
|
+
icon: /* @__PURE__ */ T(l, { className: "h-4 w-4" }),
|
|
242
|
+
action: () => t.chain().focus().setTextAlign("left").run(),
|
|
243
|
+
isActive: () => t.isActive({ textAlign: "left" })
|
|
244
|
+
},
|
|
245
|
+
alignCenter: {
|
|
246
|
+
icon: /* @__PURE__ */ T(c, { className: "h-4 w-4" }),
|
|
247
|
+
action: () => t.chain().focus().setTextAlign("center").run(),
|
|
248
|
+
isActive: () => t.isActive({ textAlign: "center" })
|
|
249
|
+
},
|
|
250
|
+
alignRight: {
|
|
251
|
+
icon: /* @__PURE__ */ T(u, { className: "h-4 w-4" }),
|
|
252
|
+
action: () => t.chain().focus().setTextAlign("right").run(),
|
|
253
|
+
isActive: () => t.isActive({ textAlign: "right" })
|
|
254
|
+
},
|
|
255
|
+
undo: {
|
|
256
|
+
icon: /* @__PURE__ */ T(w, { className: "h-4 w-4" }),
|
|
257
|
+
action: () => t.chain().focus().undo().run()
|
|
258
|
+
},
|
|
259
|
+
redo: {
|
|
260
|
+
icon: /* @__PURE__ */ T(x, { className: "h-4 w-4" }),
|
|
261
|
+
action: () => t.chain().focus().redo().run()
|
|
262
|
+
}
|
|
263
|
+
}[e];
|
|
264
|
+
return e === "link" ? /* @__PURE__ */ E(O, { children: [/* @__PURE__ */ T(k, {
|
|
265
|
+
asChild: !0,
|
|
266
|
+
children: /* @__PURE__ */ T(n, {
|
|
267
|
+
type: "button",
|
|
268
|
+
variant: j?.() ? "secondary" : "ghost",
|
|
269
|
+
size: "icon",
|
|
270
|
+
className: "h-7 w-7",
|
|
271
|
+
children: s
|
|
272
|
+
})
|
|
273
|
+
}), /* @__PURE__ */ T(A, {
|
|
274
|
+
className: "w-64 p-2",
|
|
275
|
+
children: /* @__PURE__ */ E("div", {
|
|
276
|
+
className: "flex gap-2",
|
|
277
|
+
children: [/* @__PURE__ */ T(o, {
|
|
278
|
+
value: r,
|
|
279
|
+
onChange: (e) => i(e.target.value),
|
|
280
|
+
placeholder: "https://...",
|
|
281
|
+
className: "h-8"
|
|
282
|
+
}), /* @__PURE__ */ T(n, {
|
|
283
|
+
size: "sm",
|
|
284
|
+
onClick: a,
|
|
285
|
+
children: "OK"
|
|
286
|
+
})]
|
|
287
|
+
})
|
|
288
|
+
})] }) : /* @__PURE__ */ T(n, {
|
|
289
|
+
type: "button",
|
|
290
|
+
variant: j?.() ? "secondary" : "ghost",
|
|
291
|
+
size: "icon",
|
|
292
|
+
className: "h-7 w-7",
|
|
293
|
+
onClick: D,
|
|
294
|
+
children: s
|
|
295
|
+
});
|
|
296
|
+
}
|
|
297
|
+
var F = s.forwardRef(({ value: e, onChange: n, placeholder: r, maxLength: o, showCharacterCount: s, minHeight: c, disabled: l, error: u, className: d, label: f, description: p, loading: m }, h) => /* @__PURE__ */ E("div", {
|
|
298
|
+
ref: h,
|
|
299
|
+
className: t("space-y-1.5", d),
|
|
300
|
+
children: [
|
|
301
|
+
f && /* @__PURE__ */ T(i, { children: f }),
|
|
302
|
+
p && /* @__PURE__ */ T("p", {
|
|
303
|
+
className: "text-sm text-muted-foreground",
|
|
304
|
+
children: p
|
|
305
|
+
}),
|
|
306
|
+
/* @__PURE__ */ E("div", {
|
|
307
|
+
className: "relative",
|
|
308
|
+
children: [/* @__PURE__ */ T(a, {
|
|
309
|
+
value: e,
|
|
310
|
+
onChange: (e) => n?.(e.target.value),
|
|
311
|
+
placeholder: r,
|
|
312
|
+
maxLength: o,
|
|
313
|
+
disabled: l || m,
|
|
314
|
+
style: { minHeight: c },
|
|
315
|
+
className: t(u && "border-destructive")
|
|
316
|
+
}), m && /* @__PURE__ */ T("div", {
|
|
317
|
+
className: "absolute inset-0 flex items-center justify-center bg-background/50",
|
|
318
|
+
children: /* @__PURE__ */ T("span", {
|
|
319
|
+
className: "text-sm text-muted-foreground",
|
|
320
|
+
children: "Chargement..."
|
|
321
|
+
})
|
|
322
|
+
})]
|
|
323
|
+
}),
|
|
324
|
+
/* @__PURE__ */ E("div", {
|
|
325
|
+
className: "flex items-center justify-between",
|
|
326
|
+
children: [u && /* @__PURE__ */ T("p", {
|
|
327
|
+
className: "text-sm text-destructive",
|
|
328
|
+
children: u
|
|
329
|
+
}), s && /* @__PURE__ */ E("p", {
|
|
330
|
+
className: "text-xs text-muted-foreground ml-auto",
|
|
331
|
+
children: [
|
|
332
|
+
e?.length || 0,
|
|
333
|
+
o && ` / ${o}`,
|
|
334
|
+
" caractères"
|
|
335
|
+
]
|
|
336
|
+
})]
|
|
337
|
+
})
|
|
338
|
+
]
|
|
339
|
+
}));
|
|
340
|
+
F.displayName = "FallbackEditor";
|
|
341
|
+
//#endregion
|
|
342
|
+
export { k as i, O as n, A as r, M as t };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@wakastellar/ui",
|
|
3
|
-
"version": "3.
|
|
3
|
+
"version": "3.5.0",
|
|
4
4
|
"description": "Zero-config UI Library for Next.js with TweakCN theming and i18n support",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"ui",
|
|
@@ -47,6 +47,11 @@
|
|
|
47
47
|
"import": "./dist/doc.es.js",
|
|
48
48
|
"require": "./dist/doc.cjs.js"
|
|
49
49
|
},
|
|
50
|
+
"./editor": {
|
|
51
|
+
"types": "./dist/editor.d.ts",
|
|
52
|
+
"import": "./dist/editor.es.js",
|
|
53
|
+
"require": "./dist/editor.cjs.js"
|
|
54
|
+
},
|
|
50
55
|
"./styles": "./src/styles/globals.css",
|
|
51
56
|
"./styles/v3": "./src/styles/globals-v3.css",
|
|
52
57
|
"./styles/v4": "./src/styles/globals.css",
|
|
@@ -125,7 +130,27 @@
|
|
|
125
130
|
"rehype-slug": ">=6.0.0",
|
|
126
131
|
"remark-gfm": ">=4.0.0",
|
|
127
132
|
"tailwindcss": ">=3.4.0 || >=4.0.0",
|
|
128
|
-
"tiptap-markdown": ">=0.8.0"
|
|
133
|
+
"tiptap-markdown": ">=0.8.0",
|
|
134
|
+
"platejs": ">=52.0.0",
|
|
135
|
+
"@platejs/basic-nodes": ">=52.0.0",
|
|
136
|
+
"@platejs/table": ">=52.0.0",
|
|
137
|
+
"@platejs/layout": ">=52.0.0",
|
|
138
|
+
"@platejs/callout": ">=52.0.0",
|
|
139
|
+
"@platejs/link": ">=52.0.0",
|
|
140
|
+
"@platejs/media": ">=52.0.0",
|
|
141
|
+
"@platejs/mention": ">=52.0.0",
|
|
142
|
+
"@platejs/dnd": ">=52.0.0",
|
|
143
|
+
"@platejs/toc": ">=52.0.0",
|
|
144
|
+
"@platejs/indent": ">=52.0.0",
|
|
145
|
+
"@platejs/markdown": ">=52.0.0",
|
|
146
|
+
"@platejs/selection": ">=52.0.0",
|
|
147
|
+
"@platejs/ai": ">=52.0.0",
|
|
148
|
+
"@platejs/combobox": ">=52.0.0",
|
|
149
|
+
"@platejs/floating": ">=52.0.0",
|
|
150
|
+
"@platejs/diff": ">=52.0.0",
|
|
151
|
+
"@platejs/emoji": ">=52.0.0",
|
|
152
|
+
"@platejs/resizable": ">=52.0.0",
|
|
153
|
+
"@platejs/yjs": ">=52.0.0"
|
|
129
154
|
},
|
|
130
155
|
"peerDependenciesMeta": {
|
|
131
156
|
"react-hook-form": {
|
|
@@ -172,6 +197,66 @@
|
|
|
172
197
|
},
|
|
173
198
|
"rehype-raw": {
|
|
174
199
|
"optional": true
|
|
200
|
+
},
|
|
201
|
+
"platejs": {
|
|
202
|
+
"optional": true
|
|
203
|
+
},
|
|
204
|
+
"@platejs/basic-nodes": {
|
|
205
|
+
"optional": true
|
|
206
|
+
},
|
|
207
|
+
"@platejs/table": {
|
|
208
|
+
"optional": true
|
|
209
|
+
},
|
|
210
|
+
"@platejs/layout": {
|
|
211
|
+
"optional": true
|
|
212
|
+
},
|
|
213
|
+
"@platejs/callout": {
|
|
214
|
+
"optional": true
|
|
215
|
+
},
|
|
216
|
+
"@platejs/link": {
|
|
217
|
+
"optional": true
|
|
218
|
+
},
|
|
219
|
+
"@platejs/media": {
|
|
220
|
+
"optional": true
|
|
221
|
+
},
|
|
222
|
+
"@platejs/mention": {
|
|
223
|
+
"optional": true
|
|
224
|
+
},
|
|
225
|
+
"@platejs/dnd": {
|
|
226
|
+
"optional": true
|
|
227
|
+
},
|
|
228
|
+
"@platejs/toc": {
|
|
229
|
+
"optional": true
|
|
230
|
+
},
|
|
231
|
+
"@platejs/indent": {
|
|
232
|
+
"optional": true
|
|
233
|
+
},
|
|
234
|
+
"@platejs/markdown": {
|
|
235
|
+
"optional": true
|
|
236
|
+
},
|
|
237
|
+
"@platejs/selection": {
|
|
238
|
+
"optional": true
|
|
239
|
+
},
|
|
240
|
+
"@platejs/ai": {
|
|
241
|
+
"optional": true
|
|
242
|
+
},
|
|
243
|
+
"@platejs/combobox": {
|
|
244
|
+
"optional": true
|
|
245
|
+
},
|
|
246
|
+
"@platejs/floating": {
|
|
247
|
+
"optional": true
|
|
248
|
+
},
|
|
249
|
+
"@platejs/diff": {
|
|
250
|
+
"optional": true
|
|
251
|
+
},
|
|
252
|
+
"@platejs/emoji": {
|
|
253
|
+
"optional": true
|
|
254
|
+
},
|
|
255
|
+
"@platejs/resizable": {
|
|
256
|
+
"optional": true
|
|
257
|
+
},
|
|
258
|
+
"@platejs/yjs": {
|
|
259
|
+
"optional": true
|
|
175
260
|
}
|
|
176
261
|
},
|
|
177
262
|
"devDependencies": {
|
|
@@ -4,12 +4,7 @@ import * as React from "react"
|
|
|
4
4
|
import { cn } from "../../utils"
|
|
5
5
|
import { Button } from "../../components/button"
|
|
6
6
|
import { Separator } from "../../components/separator"
|
|
7
|
-
import { Mail } from "lucide-react"
|
|
8
|
-
|
|
9
|
-
// Inline SVG for renamed/removed lucide icons
|
|
10
|
-
const Github = (props: any) => <svg {...props} xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" strokeWidth="2" strokeLinecap="round" strokeLinejoin="round"><path d="M15 22v-4a4.8 4.8 0 0 0-1-3.5c3 0 6-2 6-5.5.08-1.25-.27-2.48-1-3.5.28-1.15.28-2.35 0-3.5 0 0-1 0-3 1.5-2.64-.5-5.36-.5-8 0C6 2 5 2 5 2c-.3 1.15-.3 2.35 0 3.5A5.403 5.403 0 0 0 4 9c0 3.5 3 5.5 6 5.5-.39.49-.68 1.05-.85 1.65-.17.6-.22 1.23-.15 1.85v4"/><path d="M9 18c-4.51 2-5-2-7-2"/></svg>
|
|
11
|
-
const Twitter = (props: any) => <svg {...props} xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" strokeWidth="2" strokeLinecap="round" strokeLinejoin="round"><path d="M22 4s-.7 2.1-2 3.4c1.6 10-9.4 17.3-18 11.6 2.2.1 4.4-.6 6-2C3 15.5.5 9.6 3 5c2.2 2.6 5.6 4.1 9 4-.9-4.2 4-6.6 7-3.8 1.1 0 3-1.2 3-1.2z"/></svg>
|
|
12
|
-
const Linkedin = (props: any) => <svg {...props} xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" strokeWidth="2" strokeLinecap="round" strokeLinejoin="round"><path d="M16 8a6 6 0 0 1 6 6v7h-4v-7a2 2 0 0 0-2-2 2 2 0 0 0-2 2v7h-4v-7a6 6 0 0 1 6-6z"/><rect width="4" height="12" x="2" y="9"/><circle cx="4" cy="4" r="2"/></svg>
|
|
7
|
+
import { Github, Twitter, Linkedin, Mail } from "lucide-react"
|
|
13
8
|
|
|
14
9
|
export interface FooterLink {
|
|
15
10
|
label: string
|
|
@@ -7,13 +7,7 @@ import { Input } from "../../components/input"
|
|
|
7
7
|
import { Label } from "../../components/label"
|
|
8
8
|
import { Card, CardContent, CardDescription, CardHeader, CardTitle } from "../../components/card"
|
|
9
9
|
import { Separator } from "../../components/separator"
|
|
10
|
-
import { Mail, Apple } from "lucide-react"
|
|
11
|
-
|
|
12
|
-
// Inline SVG for renamed/removed lucide icons
|
|
13
|
-
const Github = (props: any) => <svg {...props} xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" strokeWidth="2" strokeLinecap="round" strokeLinejoin="round"><path d="M15 22v-4a4.8 4.8 0 0 0-1-3.5c3 0 6-2 6-5.5.08-1.25-.27-2.48-1-3.5.28-1.15.28-2.35 0-3.5 0 0-1 0-3 1.5-2.64-.5-5.36-.5-8 0C6 2 5 2 5 2c-.3 1.15-.3 2.35 0 3.5A5.403 5.403 0 0 0 4 9c0 3.5 3 5.5 6 5.5-.39.49-.68 1.05-.85 1.65-.17.6-.22 1.23-.15 1.85v4"/><path d="M9 18c-4.51 2-5-2-7-2"/></svg>
|
|
14
|
-
const Linkedin = (props: any) => <svg {...props} xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" strokeWidth="2" strokeLinecap="round" strokeLinejoin="round"><path d="M16 8a6 6 0 0 1 6 6v7h-4v-7a2 2 0 0 0-2-2 2 2 0 0 0-2 2v7h-4v-7a6 6 0 0 1 6-6z"/><rect width="4" height="12" x="2" y="9"/><circle cx="4" cy="4" r="2"/></svg>
|
|
15
|
-
const Facebook = (props: any) => <svg {...props} xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" strokeWidth="2" strokeLinecap="round" strokeLinejoin="round"><path d="M18 2h-3a5 5 0 0 0-5 5v3H7v4h3v8h4v-8h3l1-4h-4V7a1 1 0 0 1 1-1h3z"/></svg>
|
|
16
|
-
const Instagram = (props: any) => <svg {...props} xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" strokeWidth="2" strokeLinecap="round" strokeLinejoin="round"><rect width="20" height="20" x="2" y="2" rx="5" ry="5"/><path d="M16 11.37A4 4 0 1 1 12.63 8 4 4 0 0 1 16 11.37z"/><line x1="17.5" x2="17.51" y1="6.5" y2="6.5"/></svg>
|
|
10
|
+
import { Github, Mail, Apple, Linkedin, Facebook, Instagram } from "lucide-react"
|
|
17
11
|
import { useTheme } from "../../context/theme-provider"
|
|
18
12
|
import type { LoginConfig } from "./types"
|
|
19
13
|
|