@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,29 +1,14 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import
|
|
4
|
-
import {
|
|
5
|
-
import
|
|
6
|
-
import {
|
|
7
|
-
import A from "
|
|
8
|
-
import
|
|
9
|
-
|
|
10
|
-
var M = E("inline-flex items-center rounded-md border px-2.5 py-0.5 text-xs font-semibold transition-colors focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2", {
|
|
11
|
-
variants: { variant: {
|
|
12
|
-
default: "border-transparent bg-primary text-primary-foreground shadow hover:bg-primary/80",
|
|
13
|
-
secondary: "border-transparent bg-secondary text-secondary-foreground hover:bg-secondary/80",
|
|
14
|
-
destructive: "border-transparent bg-destructive text-destructive-foreground shadow hover:bg-destructive/80",
|
|
15
|
-
outline: "text-foreground"
|
|
16
|
-
} },
|
|
17
|
-
defaultVariants: { variant: "default" }
|
|
18
|
-
});
|
|
19
|
-
function N({ className: t, variant: n, ...r }) {
|
|
20
|
-
return /* @__PURE__ */ O("div", {
|
|
21
|
-
className: e(M({ variant: n }), t),
|
|
22
|
-
...r
|
|
23
|
-
});
|
|
24
|
-
}
|
|
1
|
+
import { n as e, t } from "./cn-DUn6aSIQ.mjs";
|
|
2
|
+
import { t as n } from "./badge-BfiocODp.mjs";
|
|
3
|
+
import { n as r, t as i } from "./separator-ibN2mycs.mjs";
|
|
4
|
+
import { t as a } from "./input-DVr_Qkl8.mjs";
|
|
5
|
+
import * as o from "react";
|
|
6
|
+
import { AlertCircle as s, AlertTriangle as c, BookOpen as l, Check as u, CheckCircle2 as d, ChevronDown as f, ChevronRight as p, ChevronUp as m, Copy as h, Download as g, Eye as _, FileCode as v, FileText as y, Folder as b, FolderOpen as x, Info as S, Lightbulb as C, Loader2 as w, Pencil as T, Search as E, Tag as ee, XCircle as D } from "lucide-react";
|
|
7
|
+
import { Fragment as O, jsx as k, jsxs as A } from "react/jsx-runtime";
|
|
8
|
+
import j from "prismjs";
|
|
9
|
+
import * as M from "@radix-ui/react-select";
|
|
25
10
|
//#endregion
|
|
26
|
-
//#region
|
|
11
|
+
//#region src/components/select/index.tsx
|
|
27
12
|
(function(e) {
|
|
28
13
|
e.languages.typescript = e.languages.extend("javascript", {
|
|
29
14
|
"class-name": {
|
|
@@ -1028,114 +1013,112 @@ function N({ className: t, variant: n, ...r }) {
|
|
|
1028
1013
|
},
|
|
1029
1014
|
comment: o
|
|
1030
1015
|
}, e.languages.dockerfile = e.languages.docker;
|
|
1031
|
-
})(Prism);
|
|
1032
|
-
|
|
1033
|
-
//#region src/components/select/index.tsx
|
|
1034
|
-
var P = j.Root, F = j.Group, I = j.Value, L = i.forwardRef(({ className: t, children: n, ...r }, i) => /* @__PURE__ */ k(j.Trigger, {
|
|
1016
|
+
})(Prism), e();
|
|
1017
|
+
var N = M.Root, P = M.Group, F = M.Value, I = o.forwardRef(({ className: e, children: n, ...r }, i) => /* @__PURE__ */ A(M.Trigger, {
|
|
1035
1018
|
ref: i,
|
|
1036
|
-
className:
|
|
1019
|
+
className: t("flex h-10 w-full items-center justify-between rounded-md border border-input bg-background px-3 py-2 text-sm ring-offset-background placeholder:text-muted-foreground focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50 [&>span]:line-clamp-1", e),
|
|
1037
1020
|
...r,
|
|
1038
|
-
children: [n, /* @__PURE__ */
|
|
1021
|
+
children: [n, /* @__PURE__ */ k(M.Icon, {
|
|
1039
1022
|
asChild: !0,
|
|
1040
|
-
children: /* @__PURE__ */
|
|
1023
|
+
children: /* @__PURE__ */ k(f, { className: "h-4 w-4 opacity-50" })
|
|
1041
1024
|
})]
|
|
1042
1025
|
}));
|
|
1043
|
-
|
|
1044
|
-
var
|
|
1026
|
+
I.displayName = M.Trigger.displayName;
|
|
1027
|
+
var L = o.forwardRef(({ className: e, ...n }, r) => /* @__PURE__ */ k(M.ScrollUpButton, {
|
|
1045
1028
|
ref: r,
|
|
1046
|
-
className:
|
|
1029
|
+
className: t("flex cursor-default items-center justify-center py-1", e),
|
|
1047
1030
|
...n,
|
|
1048
|
-
children: /* @__PURE__ */
|
|
1031
|
+
children: /* @__PURE__ */ k(m, { className: "h-4 w-4" })
|
|
1049
1032
|
}));
|
|
1050
|
-
|
|
1051
|
-
var
|
|
1033
|
+
L.displayName = M.ScrollUpButton.displayName;
|
|
1034
|
+
var R = o.forwardRef(({ className: e, ...n }, r) => /* @__PURE__ */ k(M.ScrollDownButton, {
|
|
1052
1035
|
ref: r,
|
|
1053
|
-
className:
|
|
1036
|
+
className: t("flex cursor-default items-center justify-center py-1", e),
|
|
1054
1037
|
...n,
|
|
1055
|
-
children: /* @__PURE__ */
|
|
1038
|
+
children: /* @__PURE__ */ k(f, { className: "h-4 w-4" })
|
|
1056
1039
|
}));
|
|
1057
|
-
|
|
1058
|
-
var
|
|
1040
|
+
R.displayName = M.ScrollDownButton.displayName;
|
|
1041
|
+
var z = o.forwardRef(({ className: e, children: n, position: r = "popper", ...i }, a) => /* @__PURE__ */ k(M.Portal, { children: /* @__PURE__ */ A(M.Content, {
|
|
1059
1042
|
ref: a,
|
|
1060
|
-
className:
|
|
1043
|
+
className: t("relative z-50 max-h-96 min-w-[8rem] overflow-hidden rounded-md border bg-popover text-popover-foreground shadow-md 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", r === "popper" && "data-[side=bottom]:translate-y-1 data-[side=left]:-translate-x-1 data-[side=right]:translate-x-1 data-[side=top]:-translate-y-1", e),
|
|
1061
1044
|
position: r,
|
|
1062
1045
|
...i,
|
|
1063
1046
|
children: [
|
|
1064
|
-
/* @__PURE__ */
|
|
1065
|
-
/* @__PURE__ */
|
|
1066
|
-
className:
|
|
1047
|
+
/* @__PURE__ */ k(L, {}),
|
|
1048
|
+
/* @__PURE__ */ k(M.Viewport, {
|
|
1049
|
+
className: t("p-1", r === "popper" && "h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)]"),
|
|
1067
1050
|
children: n
|
|
1068
1051
|
}),
|
|
1069
|
-
/* @__PURE__ */
|
|
1052
|
+
/* @__PURE__ */ k(R, {})
|
|
1070
1053
|
]
|
|
1071
1054
|
}) }));
|
|
1072
|
-
|
|
1073
|
-
var
|
|
1055
|
+
z.displayName = M.Content.displayName;
|
|
1056
|
+
var B = o.forwardRef(({ className: e, ...n }, r) => /* @__PURE__ */ k(M.Label, {
|
|
1074
1057
|
ref: r,
|
|
1075
|
-
className:
|
|
1058
|
+
className: t("py-1.5 pl-8 pr-2 text-sm font-semibold", e),
|
|
1076
1059
|
...n
|
|
1077
1060
|
}));
|
|
1078
|
-
|
|
1079
|
-
var
|
|
1061
|
+
B.displayName = M.Label.displayName;
|
|
1062
|
+
var V = o.forwardRef(({ className: e, children: n, ...r }, i) => /* @__PURE__ */ A(M.Item, {
|
|
1080
1063
|
ref: i,
|
|
1081
|
-
className:
|
|
1064
|
+
className: t("relative flex w-full cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50", e),
|
|
1082
1065
|
...r,
|
|
1083
|
-
children: [/* @__PURE__ */
|
|
1066
|
+
children: [/* @__PURE__ */ k("span", {
|
|
1084
1067
|
className: "absolute left-2 flex h-3.5 w-3.5 items-center justify-center",
|
|
1085
|
-
children: /* @__PURE__ */
|
|
1086
|
-
}), /* @__PURE__ */
|
|
1068
|
+
children: /* @__PURE__ */ k(M.ItemIndicator, { children: /* @__PURE__ */ k(u, { className: "h-4 w-4" }) })
|
|
1069
|
+
}), /* @__PURE__ */ k(M.ItemText, { children: n })]
|
|
1087
1070
|
}));
|
|
1088
|
-
|
|
1089
|
-
var
|
|
1071
|
+
V.displayName = M.Item.displayName;
|
|
1072
|
+
var H = o.forwardRef(({ className: e, ...n }, r) => /* @__PURE__ */ k(M.Separator, {
|
|
1090
1073
|
ref: r,
|
|
1091
|
-
className:
|
|
1074
|
+
className: t("-mx-1 my-1 h-px bg-muted", e),
|
|
1092
1075
|
...n
|
|
1093
1076
|
}));
|
|
1094
|
-
|
|
1077
|
+
H.displayName = M.Separator.displayName;
|
|
1095
1078
|
//#endregion
|
|
1096
1079
|
//#region src/components/waka-doc-callout/index.tsx
|
|
1097
|
-
var
|
|
1080
|
+
var U = {
|
|
1098
1081
|
info: {
|
|
1099
|
-
icon:
|
|
1082
|
+
icon: S,
|
|
1100
1083
|
borderColor: "border-l-blue-500",
|
|
1101
1084
|
bgColor: "bg-blue-500/5",
|
|
1102
1085
|
iconColor: "text-blue-500",
|
|
1103
1086
|
titleColor: "text-blue-700 dark:text-blue-400"
|
|
1104
1087
|
},
|
|
1105
1088
|
warning: {
|
|
1106
|
-
icon:
|
|
1089
|
+
icon: c,
|
|
1107
1090
|
borderColor: "border-l-amber-500",
|
|
1108
1091
|
bgColor: "bg-amber-500/5",
|
|
1109
1092
|
iconColor: "text-amber-500",
|
|
1110
1093
|
titleColor: "text-amber-700 dark:text-amber-400"
|
|
1111
1094
|
},
|
|
1112
1095
|
danger: {
|
|
1113
|
-
icon:
|
|
1096
|
+
icon: D,
|
|
1114
1097
|
borderColor: "border-l-red-500",
|
|
1115
1098
|
bgColor: "bg-red-500/5",
|
|
1116
1099
|
iconColor: "text-red-500",
|
|
1117
1100
|
titleColor: "text-red-700 dark:text-red-400"
|
|
1118
1101
|
},
|
|
1119
1102
|
tip: {
|
|
1120
|
-
icon:
|
|
1103
|
+
icon: C,
|
|
1121
1104
|
borderColor: "border-l-emerald-500",
|
|
1122
1105
|
bgColor: "bg-emerald-500/5",
|
|
1123
1106
|
iconColor: "text-emerald-500",
|
|
1124
1107
|
titleColor: "text-emerald-700 dark:text-emerald-400"
|
|
1125
1108
|
}
|
|
1126
1109
|
};
|
|
1127
|
-
function
|
|
1128
|
-
let a =
|
|
1129
|
-
return /* @__PURE__ */
|
|
1130
|
-
className:
|
|
1131
|
-
children: /* @__PURE__ */
|
|
1110
|
+
function W({ type: e = "info", title: n, children: r, className: i }) {
|
|
1111
|
+
let a = U[e], o = a.icon;
|
|
1112
|
+
return /* @__PURE__ */ k("div", {
|
|
1113
|
+
className: t("my-4 rounded-r-lg border-l-4 p-4 backdrop-blur-sm", a.borderColor, a.bgColor, i),
|
|
1114
|
+
children: /* @__PURE__ */ A("div", {
|
|
1132
1115
|
className: "flex gap-3",
|
|
1133
|
-
children: [/* @__PURE__ */
|
|
1116
|
+
children: [/* @__PURE__ */ k(o, { className: t("mt-0.5 h-5 w-5 shrink-0", a.iconColor) }), /* @__PURE__ */ A("div", {
|
|
1134
1117
|
className: "min-w-0 flex-1",
|
|
1135
|
-
children: [n && /* @__PURE__ */
|
|
1136
|
-
className:
|
|
1118
|
+
children: [n && /* @__PURE__ */ k("p", {
|
|
1119
|
+
className: t("mb-1 font-semibold", a.titleColor),
|
|
1137
1120
|
children: n
|
|
1138
|
-
}), /* @__PURE__ */
|
|
1121
|
+
}), /* @__PURE__ */ k("div", {
|
|
1139
1122
|
className: "text-sm text-foreground/80 [&>p]:mb-2 [&>p:last-child]:mb-0",
|
|
1140
1123
|
children: r
|
|
1141
1124
|
})]
|
|
@@ -1145,45 +1128,45 @@ function G({ type: t = "info", title: n, children: r, className: i }) {
|
|
|
1145
1128
|
}
|
|
1146
1129
|
//#endregion
|
|
1147
1130
|
//#region src/components/waka-doc-code-block/index.tsx
|
|
1148
|
-
function
|
|
1149
|
-
let [
|
|
1150
|
-
return /* @__PURE__ */
|
|
1151
|
-
className:
|
|
1152
|
-
children: [/* @__PURE__ */
|
|
1131
|
+
function G({ code: e, language: n, filename: i, showLineNumbers: a = !1, highlightLines: s = [], className: c }) {
|
|
1132
|
+
let [l, d] = o.useState(!1), f = e.split("\n");
|
|
1133
|
+
return /* @__PURE__ */ A("div", {
|
|
1134
|
+
className: t("group relative my-4 overflow-hidden rounded-lg", "border border-border/50", "bg-muted/30 backdrop-blur-sm", c),
|
|
1135
|
+
children: [/* @__PURE__ */ A("div", {
|
|
1153
1136
|
className: "flex items-center justify-between border-b border-border/50 bg-muted/50 px-4 py-2",
|
|
1154
|
-
children: [/* @__PURE__ */
|
|
1137
|
+
children: [/* @__PURE__ */ A("div", {
|
|
1155
1138
|
className: "flex items-center gap-2 text-xs text-muted-foreground",
|
|
1156
|
-
children: [/* @__PURE__ */
|
|
1139
|
+
children: [/* @__PURE__ */ k(v, { className: "h-3.5 w-3.5" }), /* @__PURE__ */ k("span", {
|
|
1157
1140
|
className: "font-medium",
|
|
1158
|
-
children:
|
|
1141
|
+
children: i || n?.toUpperCase() || "CODE"
|
|
1159
1142
|
})]
|
|
1160
|
-
}), /* @__PURE__ */
|
|
1143
|
+
}), /* @__PURE__ */ k(r, {
|
|
1161
1144
|
variant: "ghost",
|
|
1162
1145
|
size: "icon",
|
|
1163
1146
|
className: "h-7 w-7 opacity-0 transition-opacity group-hover:opacity-100",
|
|
1164
1147
|
onClick: async () => {
|
|
1165
1148
|
try {
|
|
1166
|
-
await navigator.clipboard.writeText(
|
|
1149
|
+
await navigator.clipboard.writeText(e), d(!0), setTimeout(() => d(!1), 2e3);
|
|
1167
1150
|
} catch {}
|
|
1168
1151
|
},
|
|
1169
|
-
children:
|
|
1152
|
+
children: l ? /* @__PURE__ */ k(u, { className: "h-3.5 w-3.5 text-emerald-500" }) : /* @__PURE__ */ k(h, { className: "h-3.5 w-3.5" })
|
|
1170
1153
|
})]
|
|
1171
|
-
}), /* @__PURE__ */
|
|
1154
|
+
}), /* @__PURE__ */ k("div", {
|
|
1172
1155
|
className: "overflow-x-auto",
|
|
1173
|
-
children: /* @__PURE__ */
|
|
1156
|
+
children: /* @__PURE__ */ k("pre", {
|
|
1174
1157
|
className: "p-4 text-sm leading-relaxed",
|
|
1175
|
-
children: /* @__PURE__ */
|
|
1176
|
-
let i =
|
|
1158
|
+
children: /* @__PURE__ */ k("code", { children: f.map((e, r) => {
|
|
1159
|
+
let i = e;
|
|
1177
1160
|
try {
|
|
1178
|
-
|
|
1161
|
+
n && j.languages[n] && (i = j.highlight(e, j.languages[n], n));
|
|
1179
1162
|
} catch {}
|
|
1180
|
-
return /* @__PURE__ */
|
|
1181
|
-
className:
|
|
1182
|
-
children: [
|
|
1163
|
+
return /* @__PURE__ */ A("div", {
|
|
1164
|
+
className: t("flex", s.includes(r + 1) && "bg-primary/10 -mx-4 px-4 border-l-2 border-primary"),
|
|
1165
|
+
children: [a && /* @__PURE__ */ k("span", {
|
|
1183
1166
|
className: "mr-4 inline-block w-8 select-none text-right text-muted-foreground/50",
|
|
1184
|
-
children:
|
|
1185
|
-
}), /* @__PURE__ */
|
|
1186
|
-
},
|
|
1167
|
+
children: r + 1
|
|
1168
|
+
}), /* @__PURE__ */ k("span", { dangerouslySetInnerHTML: { __html: i } })]
|
|
1169
|
+
}, r);
|
|
1187
1170
|
}) })
|
|
1188
1171
|
})
|
|
1189
1172
|
})]
|
|
@@ -1191,53 +1174,53 @@ function K({ code: t, language: r, filename: a, showLineNumbers: o = !1, highlig
|
|
|
1191
1174
|
}
|
|
1192
1175
|
//#endregion
|
|
1193
1176
|
//#region src/components/waka-doc-toc/index.tsx
|
|
1194
|
-
function
|
|
1195
|
-
let [
|
|
1196
|
-
|
|
1177
|
+
function K({ items: e, activeId: n, className: r }) {
|
|
1178
|
+
let [i, a] = o.useState(n || "");
|
|
1179
|
+
o.useEffect(() => {
|
|
1197
1180
|
if (n !== void 0) return;
|
|
1198
|
-
let
|
|
1181
|
+
let t = new IntersectionObserver((e) => {
|
|
1199
1182
|
for (let t of e) if (t.isIntersecting) {
|
|
1200
|
-
|
|
1183
|
+
a(t.target.id);
|
|
1201
1184
|
break;
|
|
1202
1185
|
}
|
|
1203
1186
|
}, {
|
|
1204
1187
|
rootMargin: "-80px 0px -80% 0px",
|
|
1205
1188
|
threshold: 0
|
|
1206
1189
|
});
|
|
1207
|
-
for (let n of
|
|
1208
|
-
let
|
|
1209
|
-
|
|
1190
|
+
for (let n of e) {
|
|
1191
|
+
let e = document.getElementById(n.id);
|
|
1192
|
+
e && t.observe(e);
|
|
1210
1193
|
}
|
|
1211
|
-
return () =>
|
|
1212
|
-
}, [
|
|
1213
|
-
let s = n ??
|
|
1214
|
-
return
|
|
1215
|
-
className:
|
|
1216
|
-
children: [/* @__PURE__ */
|
|
1194
|
+
return () => t.disconnect();
|
|
1195
|
+
}, [e, n]);
|
|
1196
|
+
let s = n ?? i;
|
|
1197
|
+
return e.length === 0 ? null : /* @__PURE__ */ A("nav", {
|
|
1198
|
+
className: t("sticky top-24 max-h-[calc(100vh-8rem)] overflow-y-auto", r),
|
|
1199
|
+
children: [/* @__PURE__ */ k("p", {
|
|
1217
1200
|
className: "mb-3 text-xs font-semibold uppercase tracking-wider text-muted-foreground",
|
|
1218
1201
|
children: "Sur cette page"
|
|
1219
|
-
}), /* @__PURE__ */
|
|
1202
|
+
}), /* @__PURE__ */ k("ul", {
|
|
1220
1203
|
className: "relative space-y-1 border-l border-border/50",
|
|
1221
|
-
children:
|
|
1222
|
-
let n = s ===
|
|
1223
|
-
return /* @__PURE__ */
|
|
1224
|
-
href: `#${
|
|
1225
|
-
onClick: (
|
|
1226
|
-
|
|
1204
|
+
children: e.map((e) => {
|
|
1205
|
+
let n = s === e.id;
|
|
1206
|
+
return /* @__PURE__ */ k("li", { children: /* @__PURE__ */ A("a", {
|
|
1207
|
+
href: `#${e.id}`,
|
|
1208
|
+
onClick: (t) => {
|
|
1209
|
+
t.preventDefault(), document.getElementById(e.id)?.scrollIntoView({ behavior: "smooth" }), a(e.id);
|
|
1227
1210
|
},
|
|
1228
|
-
className:
|
|
1229
|
-
children: [n && /* @__PURE__ */
|
|
1230
|
-
}) },
|
|
1211
|
+
className: t("relative block py-1 text-sm transition-all duration-200", e.level === 2 && "pl-4", e.level === 3 && "pl-7", e.level === 4 && "pl-10", n ? "font-medium text-primary" : "text-muted-foreground hover:text-foreground"),
|
|
1212
|
+
children: [n && /* @__PURE__ */ k("span", { className: "absolute -left-px top-1/2 h-5 w-0.5 -translate-y-1/2 rounded-full bg-primary shadow-[0_0_8px_var(--color-primary)]" }), e.text]
|
|
1213
|
+
}) }, e.id);
|
|
1231
1214
|
})
|
|
1232
1215
|
})]
|
|
1233
1216
|
});
|
|
1234
1217
|
}
|
|
1235
1218
|
//#endregion
|
|
1236
1219
|
//#region src/components/waka-doc-nav/index.tsx
|
|
1237
|
-
function
|
|
1238
|
-
return /* @__PURE__ */
|
|
1239
|
-
className:
|
|
1240
|
-
children:
|
|
1220
|
+
function q({ items: e, activeId: n, onItemClick: r, className: i }) {
|
|
1221
|
+
return /* @__PURE__ */ k("nav", {
|
|
1222
|
+
className: t("space-y-1", i),
|
|
1223
|
+
children: e.map((e) => /* @__PURE__ */ k(J, {
|
|
1241
1224
|
item: e,
|
|
1242
1225
|
activeId: n,
|
|
1243
1226
|
onItemClick: r,
|
|
@@ -1245,82 +1228,82 @@ function J({ items: t, activeId: n, onItemClick: r, className: i }) {
|
|
|
1245
1228
|
}, e.id))
|
|
1246
1229
|
});
|
|
1247
1230
|
}
|
|
1248
|
-
function
|
|
1249
|
-
let
|
|
1250
|
-
|
|
1231
|
+
function J({ item: e, activeId: n, onItemClick: r, depth: i }) {
|
|
1232
|
+
let a = e.children && e.children.length > 0, s = n === e.id, c = a && Y(e.children, n), [l, u] = o.useState(c);
|
|
1233
|
+
o.useEffect(() => {
|
|
1251
1234
|
c && u(!0);
|
|
1252
1235
|
}, [c]);
|
|
1253
|
-
let
|
|
1254
|
-
|
|
1255
|
-
},
|
|
1256
|
-
return /* @__PURE__ */
|
|
1257
|
-
onClick:
|
|
1258
|
-
className:
|
|
1259
|
-
style: { paddingLeft: `${
|
|
1236
|
+
let d = () => {
|
|
1237
|
+
a && u((e) => !e), r?.(e);
|
|
1238
|
+
}, f = a ? l ? x : b : y;
|
|
1239
|
+
return /* @__PURE__ */ A("div", { children: [/* @__PURE__ */ A("button", {
|
|
1240
|
+
onClick: d,
|
|
1241
|
+
className: t("group flex w-full items-center gap-2 rounded-lg px-3 py-2 text-sm transition-all duration-200", s ? "bg-primary/10 font-medium text-primary" : "text-muted-foreground hover:bg-muted/50 hover:text-foreground"),
|
|
1242
|
+
style: { paddingLeft: `${i * 12 + 12}px` },
|
|
1260
1243
|
children: [
|
|
1261
|
-
|
|
1262
|
-
/* @__PURE__ */
|
|
1244
|
+
a && /* @__PURE__ */ k(p, { className: t("h-3.5 w-3.5 shrink-0 transition-transform duration-200", l && "rotate-90") }),
|
|
1245
|
+
/* @__PURE__ */ k("span", {
|
|
1263
1246
|
className: "shrink-0",
|
|
1264
|
-
children:
|
|
1247
|
+
children: e.icon || /* @__PURE__ */ k(f, { className: "h-4 w-4" })
|
|
1265
1248
|
}),
|
|
1266
|
-
/* @__PURE__ */
|
|
1249
|
+
/* @__PURE__ */ k("span", {
|
|
1267
1250
|
className: "truncate",
|
|
1268
|
-
children:
|
|
1251
|
+
children: e.label
|
|
1269
1252
|
}),
|
|
1270
|
-
|
|
1253
|
+
e.badge && /* @__PURE__ */ k("span", {
|
|
1271
1254
|
className: "ml-auto shrink-0 rounded-full bg-primary/10 px-2 py-0.5 text-xs font-medium text-primary",
|
|
1272
|
-
children:
|
|
1255
|
+
children: e.badge
|
|
1273
1256
|
})
|
|
1274
1257
|
]
|
|
1275
|
-
}),
|
|
1258
|
+
}), a && l && /* @__PURE__ */ k("div", {
|
|
1276
1259
|
className: "mt-0.5 space-y-0.5",
|
|
1277
|
-
children:
|
|
1260
|
+
children: e.children.map((e) => /* @__PURE__ */ k(J, {
|
|
1278
1261
|
item: e,
|
|
1279
1262
|
activeId: n,
|
|
1280
1263
|
onItemClick: r,
|
|
1281
|
-
depth:
|
|
1264
|
+
depth: i + 1
|
|
1282
1265
|
}, e.id))
|
|
1283
1266
|
})] });
|
|
1284
1267
|
}
|
|
1285
|
-
function
|
|
1268
|
+
function Y(e, t) {
|
|
1286
1269
|
if (!t) return !1;
|
|
1287
|
-
for (let n of e) if (n.id === t || n.children &&
|
|
1270
|
+
for (let n of e) if (n.id === t || n.children && Y(n.children, t)) return !0;
|
|
1288
1271
|
return !1;
|
|
1289
1272
|
}
|
|
1290
1273
|
//#endregion
|
|
1291
1274
|
//#region src/components/waka-doc-search/index.tsx
|
|
1292
|
-
function
|
|
1293
|
-
let [s, c] =
|
|
1294
|
-
return
|
|
1275
|
+
function X({ pages: e, onSelect: n, placeholder: r = "Rechercher dans la documentation...", className: i }) {
|
|
1276
|
+
let [s, c] = o.useState(""), [l, u] = o.useState([]), [d, f] = o.useState(!1), [p, m] = o.useState(0), h = o.useRef(null);
|
|
1277
|
+
return o.useEffect(() => {
|
|
1295
1278
|
let e = (e) => {
|
|
1296
1279
|
(e.metaKey || e.ctrlKey) && e.key === "k" && (e.preventDefault(), h.current?.focus(), f(!0)), e.key === "Escape" && (f(!1), c(""));
|
|
1297
1280
|
};
|
|
1298
1281
|
return document.addEventListener("keydown", e), () => document.removeEventListener("keydown", e);
|
|
1299
|
-
}, []),
|
|
1282
|
+
}, []), o.useEffect(() => {
|
|
1300
1283
|
if (!s.trim()) {
|
|
1301
1284
|
u([]);
|
|
1302
1285
|
return;
|
|
1303
1286
|
}
|
|
1304
|
-
let
|
|
1305
|
-
for (let r of
|
|
1306
|
-
let
|
|
1307
|
-
if (
|
|
1308
|
-
let e = Math.max(0, i - 40),
|
|
1309
|
-
|
|
1287
|
+
let t = s.toLowerCase(), n = [];
|
|
1288
|
+
for (let r of e) {
|
|
1289
|
+
let e = r.title.toLowerCase().includes(t), i = r.content.toLowerCase().indexOf(t);
|
|
1290
|
+
if (e || i !== -1) {
|
|
1291
|
+
let e = Math.max(0, i - 40), t = Math.min(r.content.length, i + s.length + 40), a = i === -1 ? r.content.slice(0, 80) + "..." : (e > 0 ? "..." : "") + r.content.slice(e, t) + (t < r.content.length ? "..." : "");
|
|
1292
|
+
n.push({
|
|
1310
1293
|
page: r,
|
|
1311
1294
|
snippet: a
|
|
1312
1295
|
});
|
|
1313
1296
|
}
|
|
1314
1297
|
}
|
|
1315
|
-
u(
|
|
1316
|
-
}, [s,
|
|
1317
|
-
className:
|
|
1298
|
+
u(n.slice(0, 8)), m(0);
|
|
1299
|
+
}, [s, e]), /* @__PURE__ */ A("div", {
|
|
1300
|
+
className: t("relative", i),
|
|
1318
1301
|
children: [
|
|
1319
|
-
/* @__PURE__ */
|
|
1302
|
+
/* @__PURE__ */ A("div", {
|
|
1320
1303
|
className: "relative",
|
|
1321
1304
|
children: [
|
|
1322
|
-
/* @__PURE__ */
|
|
1323
|
-
/* @__PURE__ */
|
|
1305
|
+
/* @__PURE__ */ k(E, { className: "absolute left-3 top-1/2 h-4 w-4 -translate-y-1/2 text-muted-foreground" }),
|
|
1306
|
+
/* @__PURE__ */ k(a, {
|
|
1324
1307
|
ref: h,
|
|
1325
1308
|
value: s,
|
|
1326
1309
|
onChange: (e) => {
|
|
@@ -1329,41 +1312,41 @@ function Z({ pages: n, onSelect: r, placeholder: a = "Rechercher dans la documen
|
|
|
1329
1312
|
onFocus: () => s && f(!0),
|
|
1330
1313
|
onBlur: () => setTimeout(() => f(!1), 200),
|
|
1331
1314
|
onKeyDown: (e) => {
|
|
1332
|
-
e.key === "ArrowDown" ? (e.preventDefault(), m((e) => Math.min(e + 1, l.length - 1))) : e.key === "ArrowUp" ? (e.preventDefault(), m((e) => Math.max(e - 1, 0))) : e.key === "Enter" && l[p] && (
|
|
1315
|
+
e.key === "ArrowDown" ? (e.preventDefault(), m((e) => Math.min(e + 1, l.length - 1))) : e.key === "ArrowUp" ? (e.preventDefault(), m((e) => Math.max(e - 1, 0))) : e.key === "Enter" && l[p] && (n?.(l[p].page), f(!1), c(""));
|
|
1333
1316
|
},
|
|
1334
|
-
placeholder:
|
|
1317
|
+
placeholder: r,
|
|
1335
1318
|
className: "pl-9 pr-16"
|
|
1336
1319
|
}),
|
|
1337
|
-
/* @__PURE__ */
|
|
1320
|
+
/* @__PURE__ */ k("kbd", {
|
|
1338
1321
|
className: "pointer-events-none absolute right-3 top-1/2 -translate-y-1/2 rounded border border-border/50 bg-muted/50 px-1.5 py-0.5 text-[10px] font-medium text-muted-foreground",
|
|
1339
1322
|
children: "Ctrl K"
|
|
1340
1323
|
})
|
|
1341
1324
|
]
|
|
1342
1325
|
}),
|
|
1343
|
-
d && l.length > 0 && /* @__PURE__ */
|
|
1326
|
+
d && l.length > 0 && /* @__PURE__ */ k("div", {
|
|
1344
1327
|
className: "absolute top-full z-50 mt-2 w-full overflow-hidden rounded-lg border border-border/50 bg-background/95 shadow-lg backdrop-blur-md",
|
|
1345
|
-
children: l.map((
|
|
1328
|
+
children: l.map((e, r) => /* @__PURE__ */ A("button", {
|
|
1346
1329
|
onMouseDown: () => {
|
|
1347
|
-
|
|
1330
|
+
n?.(e.page), f(!1), c("");
|
|
1348
1331
|
},
|
|
1349
|
-
className:
|
|
1332
|
+
className: t("flex w-full flex-col gap-1 px-4 py-3 text-left transition-colors", r === p ? "bg-primary/10" : "hover:bg-muted/50", r > 0 && "border-t border-border/30"),
|
|
1350
1333
|
children: [
|
|
1351
|
-
/* @__PURE__ */
|
|
1334
|
+
/* @__PURE__ */ k("span", {
|
|
1352
1335
|
className: "text-sm font-medium",
|
|
1353
|
-
children:
|
|
1336
|
+
children: e.page.title
|
|
1354
1337
|
}),
|
|
1355
|
-
|
|
1338
|
+
e.page.category && /* @__PURE__ */ k("span", {
|
|
1356
1339
|
className: "text-xs text-muted-foreground",
|
|
1357
|
-
children:
|
|
1340
|
+
children: e.page.category
|
|
1358
1341
|
}),
|
|
1359
|
-
/* @__PURE__ */
|
|
1342
|
+
/* @__PURE__ */ k("span", {
|
|
1360
1343
|
className: "line-clamp-1 text-xs text-muted-foreground/70",
|
|
1361
|
-
children:
|
|
1344
|
+
children: e.snippet
|
|
1362
1345
|
})
|
|
1363
1346
|
]
|
|
1364
|
-
},
|
|
1347
|
+
}, e.page.id))
|
|
1365
1348
|
}),
|
|
1366
|
-
d && s && l.length === 0 && /* @__PURE__ */
|
|
1349
|
+
d && s && l.length === 0 && /* @__PURE__ */ A("div", {
|
|
1367
1350
|
className: "absolute top-full z-50 mt-2 w-full rounded-lg border border-border/50 bg-background/95 p-4 text-center text-sm text-muted-foreground shadow-lg backdrop-blur-md",
|
|
1368
1351
|
children: [
|
|
1369
1352
|
"Aucun résultat pour \"",
|
|
@@ -1376,7 +1359,7 @@ function Z({ pages: n, onSelect: r, placeholder: a = "Rechercher dans la documen
|
|
|
1376
1359
|
}
|
|
1377
1360
|
//#endregion
|
|
1378
1361
|
//#region src/components/waka-doc-version/index.tsx
|
|
1379
|
-
var
|
|
1362
|
+
var Z = {
|
|
1380
1363
|
latest: {
|
|
1381
1364
|
label: "Latest",
|
|
1382
1365
|
variant: "default"
|
|
@@ -1398,23 +1381,23 @@ var Q = {
|
|
|
1398
1381
|
variant: "destructive"
|
|
1399
1382
|
}
|
|
1400
1383
|
};
|
|
1401
|
-
function
|
|
1402
|
-
return /* @__PURE__ */
|
|
1403
|
-
className:
|
|
1404
|
-
children: [/* @__PURE__ */
|
|
1405
|
-
value:
|
|
1406
|
-
onValueChange:
|
|
1407
|
-
children: [/* @__PURE__ */
|
|
1384
|
+
function Q({ versions: e, current: r, onVersionChange: i, className: a }) {
|
|
1385
|
+
return /* @__PURE__ */ A("div", {
|
|
1386
|
+
className: t("flex items-center gap-2", a),
|
|
1387
|
+
children: [/* @__PURE__ */ k(ee, { className: "h-4 w-4 text-muted-foreground" }), /* @__PURE__ */ A(N, {
|
|
1388
|
+
value: r,
|
|
1389
|
+
onValueChange: i,
|
|
1390
|
+
children: [/* @__PURE__ */ k(I, {
|
|
1408
1391
|
className: "h-8 w-auto min-w-[120px] text-xs",
|
|
1409
|
-
children: /* @__PURE__ */
|
|
1410
|
-
}), /* @__PURE__ */
|
|
1392
|
+
children: /* @__PURE__ */ k(F, {})
|
|
1393
|
+
}), /* @__PURE__ */ k(z, { children: e.map((e) => /* @__PURE__ */ k(V, {
|
|
1411
1394
|
value: e.id,
|
|
1412
|
-
children: /* @__PURE__ */
|
|
1395
|
+
children: /* @__PURE__ */ A("span", {
|
|
1413
1396
|
className: "flex items-center gap-2",
|
|
1414
|
-
children: [e.label, e.status && /* @__PURE__ */
|
|
1415
|
-
variant:
|
|
1397
|
+
children: [e.label, e.status && /* @__PURE__ */ k(n, {
|
|
1398
|
+
variant: Z[e.status].variant,
|
|
1416
1399
|
className: "text-[10px] px-1.5 py-0",
|
|
1417
|
-
children:
|
|
1400
|
+
children: Z[e.status].label
|
|
1418
1401
|
})]
|
|
1419
1402
|
})
|
|
1420
1403
|
}, e.id)) })]
|
|
@@ -1423,71 +1406,71 @@ function te({ versions: t, current: n, onVersionChange: r, className: i }) {
|
|
|
1423
1406
|
}
|
|
1424
1407
|
//#endregion
|
|
1425
1408
|
//#region src/components/waka-doc-toolbar/index.tsx
|
|
1426
|
-
function
|
|
1427
|
-
let [
|
|
1428
|
-
return /* @__PURE__ */
|
|
1429
|
-
className:
|
|
1409
|
+
function te({ content: e, mode: n = "view", canEdit: a = !1, onModeChange: c, saveStatus: l = "idle", className: f }) {
|
|
1410
|
+
let [p, m] = o.useState(!1);
|
|
1411
|
+
return /* @__PURE__ */ A("div", {
|
|
1412
|
+
className: t("flex items-center gap-1 rounded-lg border border-border/50 bg-background/80 px-2 py-1 backdrop-blur-sm", f),
|
|
1430
1413
|
children: [
|
|
1431
|
-
/* @__PURE__ */
|
|
1414
|
+
/* @__PURE__ */ A(r, {
|
|
1432
1415
|
variant: "ghost",
|
|
1433
1416
|
size: "sm",
|
|
1434
1417
|
className: "h-7 gap-1.5 text-xs",
|
|
1435
1418
|
onClick: async () => {
|
|
1436
1419
|
try {
|
|
1437
|
-
await navigator.clipboard.writeText(
|
|
1420
|
+
await navigator.clipboard.writeText(e), m(!0), setTimeout(() => m(!1), 2e3);
|
|
1438
1421
|
} catch {}
|
|
1439
1422
|
},
|
|
1440
|
-
children: [
|
|
1423
|
+
children: [p ? /* @__PURE__ */ k(u, { className: "h-3.5 w-3.5 text-emerald-500" }) : /* @__PURE__ */ k(h, { className: "h-3.5 w-3.5" }), p ? "Copié" : "Copier"]
|
|
1441
1424
|
}),
|
|
1442
|
-
/* @__PURE__ */
|
|
1425
|
+
/* @__PURE__ */ k(i, {
|
|
1443
1426
|
orientation: "vertical",
|
|
1444
1427
|
className: "mx-1 h-5"
|
|
1445
1428
|
}),
|
|
1446
|
-
/* @__PURE__ */
|
|
1429
|
+
/* @__PURE__ */ A(r, {
|
|
1447
1430
|
variant: "ghost",
|
|
1448
1431
|
size: "sm",
|
|
1449
1432
|
className: "h-7 gap-1.5 text-xs",
|
|
1450
1433
|
onClick: () => {
|
|
1451
|
-
let
|
|
1434
|
+
let t = new Blob([e], { type: "text/markdown" }), n = URL.createObjectURL(t), r = document.createElement("a");
|
|
1452
1435
|
r.href = n, r.download = "document.md", r.click(), URL.revokeObjectURL(n);
|
|
1453
1436
|
},
|
|
1454
|
-
children: [/* @__PURE__ */
|
|
1437
|
+
children: [/* @__PURE__ */ k(g, { className: "h-3.5 w-3.5" }), ".md"]
|
|
1455
1438
|
}),
|
|
1456
|
-
/* @__PURE__ */
|
|
1439
|
+
/* @__PURE__ */ A(r, {
|
|
1457
1440
|
variant: "ghost",
|
|
1458
1441
|
size: "sm",
|
|
1459
1442
|
className: "h-7 gap-1.5 text-xs",
|
|
1460
1443
|
onClick: async () => {
|
|
1461
1444
|
try {
|
|
1462
|
-
let { default:
|
|
1445
|
+
let { default: t } = await import("jspdf"), n = new t(), r = n.splitTextToSize(e, 180);
|
|
1463
1446
|
n.setFontSize(10), n.text(r, 15, 15), n.save("document.pdf");
|
|
1464
1447
|
} catch {
|
|
1465
1448
|
window.print();
|
|
1466
1449
|
}
|
|
1467
1450
|
},
|
|
1468
|
-
children: [/* @__PURE__ */
|
|
1451
|
+
children: [/* @__PURE__ */ k(y, { className: "h-3.5 w-3.5" }), ".pdf"]
|
|
1469
1452
|
}),
|
|
1470
|
-
|
|
1471
|
-
/* @__PURE__ */
|
|
1453
|
+
a && /* @__PURE__ */ A(O, { children: [
|
|
1454
|
+
/* @__PURE__ */ k(i, {
|
|
1472
1455
|
orientation: "vertical",
|
|
1473
1456
|
className: "mx-1 h-5"
|
|
1474
1457
|
}),
|
|
1475
|
-
/* @__PURE__ */
|
|
1476
|
-
variant:
|
|
1458
|
+
/* @__PURE__ */ k(r, {
|
|
1459
|
+
variant: n === "edit" ? "secondary" : "ghost",
|
|
1477
1460
|
size: "sm",
|
|
1478
1461
|
className: "h-7 gap-1.5 text-xs",
|
|
1479
|
-
onClick: () =>
|
|
1480
|
-
children:
|
|
1462
|
+
onClick: () => c?.(n === "edit" ? "view" : "edit"),
|
|
1463
|
+
children: n === "edit" ? /* @__PURE__ */ A(O, { children: [/* @__PURE__ */ k(_, { className: "h-3.5 w-3.5" }), "Visualiser"] }) : /* @__PURE__ */ A(O, { children: [/* @__PURE__ */ k(T, { className: "h-3.5 w-3.5" }), "Modifier"] })
|
|
1481
1464
|
}),
|
|
1482
|
-
|
|
1465
|
+
n === "edit" && l !== "idle" && /* @__PURE__ */ A(O, { children: [/* @__PURE__ */ k(i, {
|
|
1483
1466
|
orientation: "vertical",
|
|
1484
1467
|
className: "mx-1 h-5"
|
|
1485
|
-
}), /* @__PURE__ */
|
|
1468
|
+
}), /* @__PURE__ */ A("span", {
|
|
1486
1469
|
className: "flex items-center gap-1 text-xs text-muted-foreground",
|
|
1487
1470
|
children: [
|
|
1488
|
-
|
|
1489
|
-
|
|
1490
|
-
|
|
1471
|
+
l === "saving" && /* @__PURE__ */ A(O, { children: [/* @__PURE__ */ k(w, { className: "h-3 w-3 animate-spin" }), "Sauvegarde..."] }),
|
|
1472
|
+
l === "saved" && /* @__PURE__ */ A(O, { children: [/* @__PURE__ */ k(d, { className: "h-3 w-3 text-emerald-500" }), "Sauvegardé"] }),
|
|
1473
|
+
l === "error" && /* @__PURE__ */ A(O, { children: [/* @__PURE__ */ k(s, { className: "h-3 w-3 text-destructive" }), "Erreur"] })
|
|
1491
1474
|
]
|
|
1492
1475
|
})] })
|
|
1493
1476
|
] })
|
|
@@ -1496,35 +1479,35 @@ function ne({ content: t, mode: o = "view", canEdit: s = !1, onModeChange: u, sa
|
|
|
1496
1479
|
}
|
|
1497
1480
|
//#endregion
|
|
1498
1481
|
//#region src/components/waka-doc-breadcrumb/index.tsx
|
|
1499
|
-
function
|
|
1500
|
-
return
|
|
1501
|
-
className:
|
|
1502
|
-
children: [/* @__PURE__ */
|
|
1482
|
+
function ne({ items: e, onItemClick: n, className: r }) {
|
|
1483
|
+
return e.length === 0 ? null : /* @__PURE__ */ A("nav", {
|
|
1484
|
+
className: t("flex items-center gap-1 text-sm", r),
|
|
1485
|
+
children: [/* @__PURE__ */ k(l, { className: "h-4 w-4 text-muted-foreground" }), e.map((t, r) => /* @__PURE__ */ A(o.Fragment, { children: [r > 0 && /* @__PURE__ */ k(p, { className: "h-3 w-3 text-muted-foreground/50" }), r === e.length - 1 ? /* @__PURE__ */ k("span", {
|
|
1503
1486
|
className: "font-medium text-foreground",
|
|
1504
|
-
children:
|
|
1505
|
-
}) : /* @__PURE__ */
|
|
1506
|
-
onClick: () => n?.(
|
|
1487
|
+
children: t.label
|
|
1488
|
+
}) : /* @__PURE__ */ k("button", {
|
|
1489
|
+
onClick: () => n?.(t),
|
|
1507
1490
|
className: "text-muted-foreground transition-colors hover:text-foreground",
|
|
1508
|
-
children:
|
|
1509
|
-
})] },
|
|
1491
|
+
children: t.label
|
|
1492
|
+
})] }, t.id))]
|
|
1510
1493
|
});
|
|
1511
1494
|
}
|
|
1512
1495
|
//#endregion
|
|
1513
1496
|
//#region src/components/waka-doc-table/index.tsx
|
|
1514
|
-
function
|
|
1515
|
-
return /* @__PURE__ */
|
|
1516
|
-
className:
|
|
1517
|
-
children: /* @__PURE__ */
|
|
1518
|
-
className:
|
|
1519
|
-
children:
|
|
1497
|
+
function re({ children: e, stickyHeader: n = !1, striped: r = !0, className: i }) {
|
|
1498
|
+
return /* @__PURE__ */ k("div", {
|
|
1499
|
+
className: t("my-4 overflow-x-auto rounded-lg border border-border/50", i),
|
|
1500
|
+
children: /* @__PURE__ */ k("table", {
|
|
1501
|
+
className: t("w-full text-sm", r && "[&_tbody_tr:nth-child(even)]:bg-muted/30", n && "[&_thead]:sticky [&_thead]:top-0 [&_thead]:z-10", "[&_thead]:bg-muted/50 [&_thead]:backdrop-blur-sm", "[&_th]:px-4 [&_th]:py-3 [&_th]:text-left [&_th]:font-semibold [&_th]:text-foreground/80", "[&_td]:px-4 [&_td]:py-3 [&_td]:text-foreground/70", "[&_tr]:border-b [&_tr]:border-border/30 [&_tbody_tr:last-child]:border-0", "[&_tbody_tr]:transition-colors [&_tbody_tr:hover]:bg-muted/50"),
|
|
1502
|
+
children: e
|
|
1520
1503
|
})
|
|
1521
1504
|
});
|
|
1522
1505
|
}
|
|
1523
1506
|
//#endregion
|
|
1524
1507
|
//#region src/components/waka-doc-renderer/index.tsx
|
|
1525
|
-
function
|
|
1526
|
-
let [
|
|
1527
|
-
if (
|
|
1508
|
+
function ie({ content: e, onHeadingsExtracted: n, className: r }) {
|
|
1509
|
+
let [i, a] = o.useState(null), [s, c] = o.useState(!1);
|
|
1510
|
+
if (o.useEffect(() => {
|
|
1528
1511
|
(async () => {
|
|
1529
1512
|
try {
|
|
1530
1513
|
let [e, t, n, r] = await Promise.all([
|
|
@@ -1533,7 +1516,7 @@ function ae({ content: t, onHeadingsExtracted: n, className: r }) {
|
|
|
1533
1516
|
import("rehype-slug"),
|
|
1534
1517
|
import("rehype-raw")
|
|
1535
1518
|
]);
|
|
1536
|
-
|
|
1519
|
+
a({
|
|
1537
1520
|
ReactMarkdown: e.default,
|
|
1538
1521
|
remarkGfm: t.default || t,
|
|
1539
1522
|
rehypeSlug: n.default || n,
|
|
@@ -1543,66 +1526,66 @@ function ae({ content: t, onHeadingsExtracted: n, className: r }) {
|
|
|
1543
1526
|
c(!0);
|
|
1544
1527
|
}
|
|
1545
1528
|
})();
|
|
1546
|
-
}, []),
|
|
1529
|
+
}, []), o.useEffect(() => {
|
|
1547
1530
|
if (!n) return;
|
|
1548
|
-
let
|
|
1549
|
-
for (let
|
|
1550
|
-
let n =
|
|
1531
|
+
let t = [], r = e.split("\n");
|
|
1532
|
+
for (let e of r) {
|
|
1533
|
+
let n = e.match(/^(#{2,4})\s+(.+)$/);
|
|
1551
1534
|
if (n) {
|
|
1552
|
-
let
|
|
1553
|
-
|
|
1535
|
+
let e = n[1].length, r = n[2].replace(/[`*_~]/g, ""), i = r.toLowerCase().replace(/[^\w\s-]/g, "").replace(/\s+/g, "-");
|
|
1536
|
+
t.push({
|
|
1554
1537
|
id: i,
|
|
1555
1538
|
text: r,
|
|
1556
|
-
level:
|
|
1539
|
+
level: e
|
|
1557
1540
|
});
|
|
1558
1541
|
}
|
|
1559
1542
|
}
|
|
1560
|
-
n(
|
|
1561
|
-
}, [
|
|
1562
|
-
className:
|
|
1563
|
-
children:
|
|
1543
|
+
n(t);
|
|
1544
|
+
}, [e, n]), s) return /* @__PURE__ */ k("div", {
|
|
1545
|
+
className: t("whitespace-pre-wrap font-mono text-sm", r),
|
|
1546
|
+
children: e
|
|
1564
1547
|
});
|
|
1565
|
-
if (!
|
|
1566
|
-
className:
|
|
1548
|
+
if (!i) return /* @__PURE__ */ A("div", {
|
|
1549
|
+
className: t("animate-pulse space-y-4", r),
|
|
1567
1550
|
children: [
|
|
1568
|
-
/* @__PURE__ */
|
|
1569
|
-
/* @__PURE__ */
|
|
1570
|
-
/* @__PURE__ */
|
|
1571
|
-
/* @__PURE__ */
|
|
1551
|
+
/* @__PURE__ */ k("div", { className: "h-8 w-3/4 rounded bg-muted" }),
|
|
1552
|
+
/* @__PURE__ */ k("div", { className: "h-4 w-full rounded bg-muted" }),
|
|
1553
|
+
/* @__PURE__ */ k("div", { className: "h-4 w-5/6 rounded bg-muted" }),
|
|
1554
|
+
/* @__PURE__ */ k("div", { className: "h-4 w-4/5 rounded bg-muted" })
|
|
1572
1555
|
]
|
|
1573
1556
|
});
|
|
1574
|
-
let { ReactMarkdown: l, remarkGfm: u, rehypeSlug: d, rehypeRaw: f } =
|
|
1575
|
-
return /* @__PURE__ */
|
|
1576
|
-
className:
|
|
1577
|
-
children: /* @__PURE__ */
|
|
1557
|
+
let { ReactMarkdown: l, remarkGfm: u, rehypeSlug: d, rehypeRaw: f } = i;
|
|
1558
|
+
return /* @__PURE__ */ k("div", {
|
|
1559
|
+
className: t("waka-doc-renderer", r),
|
|
1560
|
+
children: /* @__PURE__ */ k(l, {
|
|
1578
1561
|
remarkPlugins: [u],
|
|
1579
1562
|
rehypePlugins: [d, f],
|
|
1580
1563
|
components: {
|
|
1581
|
-
h1: ({ children: e, ...t }) => /* @__PURE__ */
|
|
1564
|
+
h1: ({ children: e, ...t }) => /* @__PURE__ */ k("h1", {
|
|
1582
1565
|
className: "mb-4 mt-8 scroll-mt-24 text-3xl font-bold tracking-tight first:mt-0",
|
|
1583
1566
|
...t,
|
|
1584
1567
|
children: e
|
|
1585
1568
|
}),
|
|
1586
|
-
h2: ({ children: e, ...t }) => /* @__PURE__ */
|
|
1569
|
+
h2: ({ children: e, ...t }) => /* @__PURE__ */ k("h2", {
|
|
1587
1570
|
className: "mb-3 mt-8 scroll-mt-24 border-b border-border/30 pb-2 text-2xl font-semibold tracking-tight first:mt-0",
|
|
1588
1571
|
...t,
|
|
1589
1572
|
children: e
|
|
1590
1573
|
}),
|
|
1591
|
-
h3: ({ children: e, ...t }) => /* @__PURE__ */
|
|
1574
|
+
h3: ({ children: e, ...t }) => /* @__PURE__ */ k("h3", {
|
|
1592
1575
|
className: "mb-2 mt-6 scroll-mt-24 text-xl font-semibold tracking-tight",
|
|
1593
1576
|
...t,
|
|
1594
1577
|
children: e
|
|
1595
1578
|
}),
|
|
1596
|
-
h4: ({ children: e, ...t }) => /* @__PURE__ */
|
|
1579
|
+
h4: ({ children: e, ...t }) => /* @__PURE__ */ k("h4", {
|
|
1597
1580
|
className: "mb-2 mt-4 scroll-mt-24 text-lg font-medium",
|
|
1598
1581
|
...t,
|
|
1599
1582
|
children: e
|
|
1600
1583
|
}),
|
|
1601
|
-
p: ({ children: e }) => /* @__PURE__ */
|
|
1584
|
+
p: ({ children: e }) => /* @__PURE__ */ k("p", {
|
|
1602
1585
|
className: "mb-4 leading-7 text-foreground/80",
|
|
1603
1586
|
children: e
|
|
1604
1587
|
}),
|
|
1605
|
-
a: ({ href: e, children: t }) => /* @__PURE__ */
|
|
1588
|
+
a: ({ href: e, children: t }) => /* @__PURE__ */ k("a", {
|
|
1606
1589
|
href: e,
|
|
1607
1590
|
target: e?.startsWith("http") ? "_blank" : void 0,
|
|
1608
1591
|
rel: e?.startsWith("http") ? "noopener noreferrer" : void 0,
|
|
@@ -1613,18 +1596,18 @@ function ae({ content: t, onHeadingsExtracted: n, className: r }) {
|
|
|
1613
1596
|
let t = e;
|
|
1614
1597
|
if (t?.props) {
|
|
1615
1598
|
let e = t.props.className?.replace("language-", "") || "";
|
|
1616
|
-
return /* @__PURE__ */
|
|
1599
|
+
return /* @__PURE__ */ k(G, {
|
|
1617
1600
|
code: typeof t.props.children == "string" ? t.props.children.replace(/\n$/, "") : "",
|
|
1618
1601
|
language: e,
|
|
1619
1602
|
showLineNumbers: !0
|
|
1620
1603
|
});
|
|
1621
1604
|
}
|
|
1622
|
-
return /* @__PURE__ */
|
|
1605
|
+
return /* @__PURE__ */ k("pre", { children: e });
|
|
1623
1606
|
},
|
|
1624
|
-
code: ({ children: e, className: t }) => t ? /* @__PURE__ */
|
|
1607
|
+
code: ({ children: e, className: t }) => t ? /* @__PURE__ */ k("code", {
|
|
1625
1608
|
className: t,
|
|
1626
1609
|
children: e
|
|
1627
|
-
}) : /* @__PURE__ */
|
|
1610
|
+
}) : /* @__PURE__ */ k("code", {
|
|
1628
1611
|
className: "rounded bg-muted px-1.5 py-0.5 text-sm font-mono text-primary",
|
|
1629
1612
|
children: e
|
|
1630
1613
|
}),
|
|
@@ -1632,48 +1615,48 @@ function ae({ content: t, onHeadingsExtracted: n, className: r }) {
|
|
|
1632
1615
|
let t = $(e).match(/^\[!(info|warning|danger|tip)\]\s*\n?(.*)$/s);
|
|
1633
1616
|
if (t) {
|
|
1634
1617
|
let e = t[1], n = t[2];
|
|
1635
|
-
return /* @__PURE__ */
|
|
1618
|
+
return /* @__PURE__ */ k(W, {
|
|
1636
1619
|
type: e,
|
|
1637
|
-
children: /* @__PURE__ */
|
|
1620
|
+
children: /* @__PURE__ */ k("p", { children: n })
|
|
1638
1621
|
});
|
|
1639
1622
|
}
|
|
1640
|
-
return /* @__PURE__ */
|
|
1623
|
+
return /* @__PURE__ */ k("blockquote", {
|
|
1641
1624
|
className: "my-4 border-l-4 border-primary/30 bg-muted/20 py-1 pl-4 italic text-foreground/70",
|
|
1642
1625
|
children: e
|
|
1643
1626
|
});
|
|
1644
1627
|
},
|
|
1645
|
-
table: ({ children:
|
|
1628
|
+
table: ({ children: e }) => /* @__PURE__ */ k("div", {
|
|
1646
1629
|
className: "my-4 overflow-x-auto rounded-lg border border-border/50",
|
|
1647
|
-
children: /* @__PURE__ */
|
|
1648
|
-
className:
|
|
1649
|
-
children:
|
|
1630
|
+
children: /* @__PURE__ */ k("table", {
|
|
1631
|
+
className: t("w-full text-sm", "[&_thead]:bg-muted/50 [&_thead]:backdrop-blur-sm", "[&_th]:px-4 [&_th]:py-3 [&_th]:text-left [&_th]:font-semibold [&_th]:text-foreground/80", "[&_td]:px-4 [&_td]:py-3 [&_td]:text-foreground/70", "[&_tr]:border-b [&_tr]:border-border/30 [&_tbody_tr:last-child]:border-0", "[&_tbody_tr:nth-child(even)]:bg-muted/30", "[&_tbody_tr]:transition-colors [&_tbody_tr:hover]:bg-muted/50"),
|
|
1632
|
+
children: e
|
|
1650
1633
|
})
|
|
1651
1634
|
}),
|
|
1652
|
-
ul: ({ children: e }) => /* @__PURE__ */
|
|
1635
|
+
ul: ({ children: e }) => /* @__PURE__ */ k("ul", {
|
|
1653
1636
|
className: "my-4 ml-6 list-disc space-y-2 text-foreground/80 marker:text-primary/50",
|
|
1654
1637
|
children: e
|
|
1655
1638
|
}),
|
|
1656
|
-
ol: ({ children: e }) => /* @__PURE__ */
|
|
1639
|
+
ol: ({ children: e }) => /* @__PURE__ */ k("ol", {
|
|
1657
1640
|
className: "my-4 ml-6 list-decimal space-y-2 text-foreground/80 marker:text-primary/50",
|
|
1658
1641
|
children: e
|
|
1659
1642
|
}),
|
|
1660
|
-
li: ({ children: e }) => /* @__PURE__ */
|
|
1643
|
+
li: ({ children: e }) => /* @__PURE__ */ k("li", {
|
|
1661
1644
|
className: "leading-7",
|
|
1662
1645
|
children: e
|
|
1663
1646
|
}),
|
|
1664
|
-
hr: () => /* @__PURE__ */
|
|
1665
|
-
img: ({ src: e, alt: t }) => /* @__PURE__ */
|
|
1647
|
+
hr: () => /* @__PURE__ */ k("hr", { className: "my-8 border-border/50" }),
|
|
1648
|
+
img: ({ src: e, alt: t }) => /* @__PURE__ */ k("img", {
|
|
1666
1649
|
src: e,
|
|
1667
1650
|
alt: t || "",
|
|
1668
1651
|
className: "my-4 rounded-lg border border-border/50 shadow-sm"
|
|
1669
1652
|
})
|
|
1670
1653
|
},
|
|
1671
|
-
children:
|
|
1654
|
+
children: e
|
|
1672
1655
|
})
|
|
1673
1656
|
});
|
|
1674
1657
|
}
|
|
1675
1658
|
function $(e) {
|
|
1676
|
-
return typeof e == "string" ? e : Array.isArray(e) ? e.map($).join("") :
|
|
1659
|
+
return typeof e == "string" ? e : Array.isArray(e) ? e.map($).join("") : o.isValidElement(e) && e.props ? $(e.props.children) : "";
|
|
1677
1660
|
}
|
|
1678
1661
|
//#endregion
|
|
1679
|
-
export {
|
|
1662
|
+
export { L as _, Q as a, F as b, K as c, N as d, z as f, R as g, B as h, te as i, G as l, V as m, re as n, X as o, P as p, ne as r, q as s, ie as t, W as u, H as v, I as y };
|