@alfadocs/ui-kit-debug 1.43.0 → 1.45.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/_chunks/ai-sparkle-DXeP_6a0.js +52 -0
- package/dist/_chunks/ai-sparkle-DXeP_6a0.js.map +1 -0
- package/dist/_chunks/{calendar-ChJQzRw-.js → calendar-U6N0F99w.js} +383 -359
- package/dist/_chunks/calendar-U6N0F99w.js.map +1 -0
- package/dist/_chunks/calendar-workspace-B7KvZ1_D.js +12161 -0
- package/dist/_chunks/calendar-workspace-B7KvZ1_D.js.map +1 -0
- package/dist/_chunks/{face-scheme-Dg6ZyLKb.js → face-scheme-Bm6pe7R8.js} +265 -275
- package/dist/_chunks/face-scheme-Bm6pe7R8.js.map +1 -0
- package/dist/_chunks/help-me-write-templates-GUeEn3Ff.js +741 -0
- package/dist/_chunks/help-me-write-templates-GUeEn3Ff.js.map +1 -0
- package/dist/_chunks/{notes-panel-CRAovkjx.js → notes-panel-Dkk9QPPX.js} +159 -152
- package/dist/_chunks/notes-panel-Dkk9QPPX.js.map +1 -0
- package/dist/_chunks/{panel-subview-PMBRPFOa.js → panel-subview-CYnuX-KR.js} +61 -40
- package/dist/_chunks/panel-subview-CYnuX-KR.js.map +1 -0
- package/dist/_chunks/rich-text-editor-BrAvNajV.js +3779 -0
- package/dist/_chunks/rich-text-editor-BrAvNajV.js.map +1 -0
- package/dist/_chunks/undo-2-CYNAzclj.js +26 -0
- package/dist/_chunks/undo-2-CYNAzclj.js.map +1 -0
- package/dist/_chunks/use-ai-sparkle-CyQSRTCe.js +103 -0
- package/dist/_chunks/use-ai-sparkle-CyQSRTCe.js.map +1 -0
- package/dist/_chunks/variables-menu-vXUaSBj4.js +401 -0
- package/dist/_chunks/variables-menu-vXUaSBj4.js.map +1 -0
- package/dist/agent-catalog.json +84 -3
- package/dist/agent-i18n/en.json +14 -3
- package/dist/components/ai-sparkle/ai-sparkle.d.ts +24 -0
- package/dist/components/ai-sparkle/ai-sparkle.d.ts.map +1 -0
- package/dist/components/ai-sparkle/index.d.ts +3 -0
- package/dist/components/ai-sparkle/index.d.ts.map +1 -0
- package/dist/components/ai-sparkle/index.js +5 -0
- package/dist/components/ai-sparkle/index.js.map +1 -0
- package/dist/components/calendar/calendar.d.ts +6 -0
- package/dist/components/calendar/calendar.d.ts.map +1 -1
- package/dist/components/calendar/index.js +1 -1
- package/dist/components/face-scheme/index.js +1 -1
- package/dist/components/index.d.ts +4 -2
- package/dist/components/index.d.ts.map +1 -1
- package/dist/components/notes-panel/index.js +1 -1
- package/dist/components/notes-panel/notes-panel.d.ts +4 -0
- package/dist/components/notes-panel/notes-panel.d.ts.map +1 -1
- package/dist/components/panel-subview/index.js +1 -1
- package/dist/components/panel-subview/panel-subview.d.ts +6 -0
- package/dist/components/panel-subview/panel-subview.d.ts.map +1 -1
- package/dist/components/rich-text-editor/editor-toolbar.d.ts +35 -3
- package/dist/components/rich-text-editor/editor-toolbar.d.ts.map +1 -1
- package/dist/components/rich-text-editor/index.d.ts +1 -1
- package/dist/components/rich-text-editor/index.d.ts.map +1 -1
- package/dist/components/rich-text-editor/index.js +1 -1
- package/dist/components/rich-text-editor/rich-text-editor.agent.d.ts.map +1 -1
- package/dist/components/rich-text-editor/rich-text-editor.d.ts +98 -15
- package/dist/components/rich-text-editor/rich-text-editor.d.ts.map +1 -1
- package/dist/components/variables-menu/index.d.ts +4 -0
- package/dist/components/variables-menu/index.d.ts.map +1 -0
- package/dist/components/variables-menu/index.js +6 -0
- package/dist/components/variables-menu/index.js.map +1 -0
- package/dist/components/variables-menu/variables-menu.agent.d.ts +10 -0
- package/dist/components/variables-menu/variables-menu.agent.d.ts.map +1 -0
- package/dist/components/variables-menu/variables-menu.d.ts +53 -0
- package/dist/components/variables-menu/variables-menu.d.ts.map +1 -0
- package/dist/hooks/index.d.ts +1 -0
- package/dist/hooks/index.d.ts.map +1 -1
- package/dist/hooks/index.js +64 -56
- package/dist/hooks/index.js.map +1 -1
- package/dist/hooks/use-ai-sparkle.d.ts +109 -0
- package/dist/hooks/use-ai-sparkle.d.ts.map +1 -0
- package/dist/host-compat.css +5 -5
- package/dist/i18n/locales/ar.d.ts +77 -6
- package/dist/i18n/locales/ar.d.ts.map +1 -1
- package/dist/i18n/locales/ar.js +78 -7
- package/dist/i18n/locales/ar.js.map +1 -1
- package/dist/i18n/locales/de.d.ts +77 -6
- package/dist/i18n/locales/de.d.ts.map +1 -1
- package/dist/i18n/locales/de.js +78 -7
- package/dist/i18n/locales/de.js.map +1 -1
- package/dist/i18n/locales/el.d.ts +77 -6
- package/dist/i18n/locales/el.d.ts.map +1 -1
- package/dist/i18n/locales/el.js +78 -7
- package/dist/i18n/locales/el.js.map +1 -1
- package/dist/i18n/locales/en.d.ts +77 -6
- package/dist/i18n/locales/en.d.ts.map +1 -1
- package/dist/i18n/locales/en.js +85 -7
- package/dist/i18n/locales/en.js.map +1 -1
- package/dist/i18n/locales/es.d.ts +77 -6
- package/dist/i18n/locales/es.d.ts.map +1 -1
- package/dist/i18n/locales/es.js +78 -7
- package/dist/i18n/locales/es.js.map +1 -1
- package/dist/i18n/locales/fr.d.ts +77 -6
- package/dist/i18n/locales/fr.d.ts.map +1 -1
- package/dist/i18n/locales/fr.js +78 -7
- package/dist/i18n/locales/fr.js.map +1 -1
- package/dist/i18n/locales/hi.d.ts +77 -6
- package/dist/i18n/locales/hi.d.ts.map +1 -1
- package/dist/i18n/locales/hi.js +78 -7
- package/dist/i18n/locales/hi.js.map +1 -1
- package/dist/i18n/locales/it.d.ts +77 -6
- package/dist/i18n/locales/it.d.ts.map +1 -1
- package/dist/i18n/locales/it.js +78 -7
- package/dist/i18n/locales/it.js.map +1 -1
- package/dist/i18n/locales/ja.d.ts +77 -6
- package/dist/i18n/locales/ja.d.ts.map +1 -1
- package/dist/i18n/locales/ja.js +78 -7
- package/dist/i18n/locales/ja.js.map +1 -1
- package/dist/i18n/locales/nl.d.ts +77 -6
- package/dist/i18n/locales/nl.d.ts.map +1 -1
- package/dist/i18n/locales/nl.js +78 -7
- package/dist/i18n/locales/nl.js.map +1 -1
- package/dist/i18n/locales/pl.d.ts +77 -6
- package/dist/i18n/locales/pl.d.ts.map +1 -1
- package/dist/i18n/locales/pl.js +78 -7
- package/dist/i18n/locales/pl.js.map +1 -1
- package/dist/i18n/locales/pt.d.ts +77 -6
- package/dist/i18n/locales/pt.d.ts.map +1 -1
- package/dist/i18n/locales/pt.js +78 -7
- package/dist/i18n/locales/pt.js.map +1 -1
- package/dist/i18n/locales/ro.d.ts +77 -6
- package/dist/i18n/locales/ro.d.ts.map +1 -1
- package/dist/i18n/locales/ro.js +78 -7
- package/dist/i18n/locales/ro.js.map +1 -1
- package/dist/i18n/locales/ru.d.ts +77 -6
- package/dist/i18n/locales/ru.d.ts.map +1 -1
- package/dist/i18n/locales/ru.js +78 -7
- package/dist/i18n/locales/ru.js.map +1 -1
- package/dist/i18n/locales/sq.d.ts +77 -6
- package/dist/i18n/locales/sq.d.ts.map +1 -1
- package/dist/i18n/locales/sq.js +78 -7
- package/dist/i18n/locales/sq.js.map +1 -1
- package/dist/i18n/locales/sv.d.ts +77 -6
- package/dist/i18n/locales/sv.d.ts.map +1 -1
- package/dist/i18n/locales/sv.js +78 -7
- package/dist/i18n/locales/sv.js.map +1 -1
- package/dist/i18n/locales/tr.d.ts +77 -6
- package/dist/i18n/locales/tr.d.ts.map +1 -1
- package/dist/i18n/locales/tr.js +78 -7
- package/dist/i18n/locales/tr.js.map +1 -1
- package/dist/i18n/locales/zh.d.ts +77 -6
- package/dist/i18n/locales/zh.d.ts.map +1 -1
- package/dist/i18n/locales/zh.js +78 -7
- package/dist/i18n/locales/zh.js.map +1 -1
- package/dist/index.js +1106 -1099
- package/dist/index.js.map +1 -1
- package/dist/locales/ar.json +78 -7
- package/dist/locales/de.json +78 -7
- package/dist/locales/el.json +78 -7
- package/dist/locales/en.json +78 -7
- package/dist/locales/es.json +78 -7
- package/dist/locales/fr.json +78 -7
- package/dist/locales/hi.json +78 -7
- package/dist/locales/it.json +78 -7
- package/dist/locales/ja.json +78 -7
- package/dist/locales/nl.json +78 -7
- package/dist/locales/pl.json +78 -7
- package/dist/locales/pt.json +78 -7
- package/dist/locales/ro.json +78 -7
- package/dist/locales/ru.json +78 -7
- package/dist/locales/sq.json +78 -7
- package/dist/locales/sv.json +78 -7
- package/dist/locales/tr.json +78 -7
- package/dist/locales/zh.json +78 -7
- package/dist/patterns/calendar/calendar-bookings-panel.d.ts +8 -3
- package/dist/patterns/calendar/calendar-bookings-panel.d.ts.map +1 -1
- package/dist/patterns/calendar/calendar-care-rules.d.ts +49 -0
- package/dist/patterns/calendar/calendar-care-rules.d.ts.map +1 -0
- package/dist/patterns/calendar/calendar-task-editor.d.ts +31 -0
- package/dist/patterns/calendar/calendar-task-editor.d.ts.map +1 -0
- package/dist/patterns/calendar/calendar-waiting-list-panel.d.ts.map +1 -1
- package/dist/patterns/calendar/calendar-workspace.d.ts +8 -1
- package/dist/patterns/calendar/calendar-workspace.d.ts.map +1 -1
- package/dist/patterns/calendar/calendar-workspace.model.d.ts +39 -12
- package/dist/patterns/calendar/calendar-workspace.model.d.ts.map +1 -1
- package/dist/patterns/calendar/calendar.data.d.ts +9 -0
- package/dist/patterns/calendar/calendar.data.d.ts.map +1 -1
- package/dist/patterns/calendar/calendar.journey.d.ts +35 -3
- package/dist/patterns/calendar/calendar.journey.d.ts.map +1 -1
- package/dist/patterns/calendar/calendar.model.d.ts +23 -1
- package/dist/patterns/calendar/calendar.model.d.ts.map +1 -1
- package/dist/patterns/calendar/calendar.sheets.d.ts +21 -3
- package/dist/patterns/calendar/calendar.sheets.d.ts.map +1 -1
- package/dist/patterns/calendar/calendar.surface.d.ts +6 -1
- package/dist/patterns/calendar/calendar.surface.d.ts.map +1 -1
- package/dist/patterns/calendar/calendar.types.d.ts +32 -1
- package/dist/patterns/calendar/calendar.types.d.ts.map +1 -1
- package/dist/patterns/calendar/index.js +1 -1
- package/dist/patterns/help-me-write-templates/help-me-write-templates.d.ts +58 -26
- package/dist/patterns/help-me-write-templates/help-me-write-templates.d.ts.map +1 -1
- package/dist/patterns/help-me-write-templates/index.d.ts +1 -1
- package/dist/patterns/help-me-write-templates/index.d.ts.map +1 -1
- package/dist/patterns/help-me-write-templates/index.js +1 -1
- package/dist/tokens.css +6 -6
- package/package.json +5 -1
- package/dist/_chunks/calendar-ChJQzRw-.js.map +0 -1
- package/dist/_chunks/calendar-workspace-DhXqqu-D.js +0 -11392
- package/dist/_chunks/calendar-workspace-DhXqqu-D.js.map +0 -1
- package/dist/_chunks/face-scheme-Dg6ZyLKb.js.map +0 -1
- package/dist/_chunks/help-me-write-templates-B-m7zgJa.js +0 -775
- package/dist/_chunks/help-me-write-templates-B-m7zgJa.js.map +0 -1
- package/dist/_chunks/highlighter-DSkckT2Q.js +0 -15
- package/dist/_chunks/highlighter-DSkckT2Q.js.map +0 -1
- package/dist/_chunks/notes-panel-CRAovkjx.js.map +0 -1
- package/dist/_chunks/panel-subview-PMBRPFOa.js.map +0 -1
- package/dist/_chunks/rich-text-editor-DUMeifwc.js +0 -3176
- package/dist/_chunks/rich-text-editor-DUMeifwc.js.map +0 -1
- package/dist/_chunks/wand-sparkles-DAjKyhz7.js +0 -27
- package/dist/_chunks/wand-sparkles-DAjKyhz7.js.map +0 -1
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { c as a } from "./createLucideIcon-DhHxpK9K.js";
|
|
2
|
+
/**
|
|
3
|
+
* @license lucide-react v1.22.0 - ISC
|
|
4
|
+
*
|
|
5
|
+
* This source code is licensed under the ISC license.
|
|
6
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
7
|
+
*/
|
|
8
|
+
const o = [
|
|
9
|
+
["path", { d: "m9 11-6 6v3h9l3-3", key: "1a3l36" }],
|
|
10
|
+
["path", { d: "m22 12-4.6 4.6a2 2 0 0 1-2.8 0l-5.2-5.2a2 2 0 0 1 0-2.8L14 4", key: "14a9rk" }]
|
|
11
|
+
], h = a("highlighter", o);
|
|
12
|
+
/**
|
|
13
|
+
* @license lucide-react v1.22.0 - ISC
|
|
14
|
+
*
|
|
15
|
+
* This source code is licensed under the ISC license.
|
|
16
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
17
|
+
*/
|
|
18
|
+
const t = [
|
|
19
|
+
["path", { d: "M9 14 4 9l5-5", key: "102s5s" }],
|
|
20
|
+
["path", { d: "M4 9h10.5a5.5 5.5 0 0 1 5.5 5.5a5.5 5.5 0 0 1-5.5 5.5H11", key: "f3b9sd" }]
|
|
21
|
+
], c = a("undo-2", t);
|
|
22
|
+
export {
|
|
23
|
+
h as H,
|
|
24
|
+
c as U
|
|
25
|
+
};
|
|
26
|
+
//# sourceMappingURL=undo-2-CYNAzclj.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"undo-2-CYNAzclj.js","sources":["../../node_modules/lucide-react/dist/esm/icons/highlighter.mjs","../../node_modules/lucide-react/dist/esm/icons/undo-2.mjs"],"sourcesContent":["/**\n * @license lucide-react v1.22.0 - ISC\n *\n * This source code is licensed under the ISC license.\n * See the LICENSE file in the root directory of this source tree.\n */\n\nimport createLucideIcon from '../createLucideIcon.mjs';\n\nconst __iconNode = [\n [\"path\", { d: \"m9 11-6 6v3h9l3-3\", key: \"1a3l36\" }],\n [\"path\", { d: \"m22 12-4.6 4.6a2 2 0 0 1-2.8 0l-5.2-5.2a2 2 0 0 1 0-2.8L14 4\", key: \"14a9rk\" }]\n];\nconst Highlighter = createLucideIcon(\"highlighter\", __iconNode);\n\nexport { __iconNode, Highlighter as default };\n//# sourceMappingURL=highlighter.mjs.map\n","/**\n * @license lucide-react v1.22.0 - ISC\n *\n * This source code is licensed under the ISC license.\n * See the LICENSE file in the root directory of this source tree.\n */\n\nimport createLucideIcon from '../createLucideIcon.mjs';\n\nconst __iconNode = [\n [\"path\", { d: \"M9 14 4 9l5-5\", key: \"102s5s\" }],\n [\"path\", { d: \"M4 9h10.5a5.5 5.5 0 0 1 5.5 5.5a5.5 5.5 0 0 1-5.5 5.5H11\", key: \"f3b9sd\" }]\n];\nconst Undo2 = createLucideIcon(\"undo-2\", __iconNode);\n\nexport { __iconNode, Undo2 as default };\n//# sourceMappingURL=undo-2.mjs.map\n"],"names":["__iconNode","Highlighter","createLucideIcon","Undo2"],"mappings":";AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AASA,MAAMA,IAAa;AAAA,EACjB,CAAC,QAAQ,EAAE,GAAG,qBAAqB,KAAK,SAAQ,CAAE;AAAA,EAClD,CAAC,QAAQ,EAAE,GAAG,gEAAgE,KAAK,SAAQ,CAAE;AAC/F,GACMC,IAAcC,EAAiB,eAAeF,CAAU;ACb9D;AAAA;AAAA;AAAA;AAAA;AAAA;AASA,MAAMA,IAAa;AAAA,EACjB,CAAC,QAAQ,EAAE,GAAG,iBAAiB,KAAK,SAAQ,CAAE;AAAA,EAC9C,CAAC,QAAQ,EAAE,GAAG,4DAA4D,KAAK,SAAQ,CAAE;AAC3F,GACMG,IAAQD,EAAiB,UAAUF,CAAU;","x_google_ignoreList":[0,1]}
|
|
@@ -0,0 +1,103 @@
|
|
|
1
|
+
import { useState as v, useEffect as _, useCallback as e } from "react";
|
|
2
|
+
import { u as k } from "./use-prefers-reduced-motion-BMwIQRjB.js";
|
|
3
|
+
const y = {
|
|
4
|
+
intro: 3200,
|
|
5
|
+
landed: 2800
|
|
6
|
+
}, g = {
|
|
7
|
+
intro: "ds:animate-[ai-pill-shimmer_calc(var(--animation-duration)*6)_var(--ease-in-out)_1]",
|
|
8
|
+
working: "ds:animate-[ai-pill-shimmer_calc(var(--animation-duration)*6)_var(--ease-in-out)_infinite]",
|
|
9
|
+
landed: "ds:animate-[ai-pill-shimmer_calc(var(--animation-duration)*4)_var(--ease-out)_1]"
|
|
10
|
+
}, S = {
|
|
11
|
+
intro: "ds:animate-[ai-comet-orbit_calc(var(--animation-duration)*7)_var(--ease-in-out)_1_both]",
|
|
12
|
+
working: "ds:animate-[ai-comet-orbit_calc(var(--animation-duration)*8)_linear_infinite]",
|
|
13
|
+
landed: "ds:animate-[ai-comet-orbit_calc(var(--animation-duration)*5)_var(--ease-out)_1_both]"
|
|
14
|
+
}, w = {
|
|
15
|
+
intro: "ds:[--sparkle-base:8] ds:animate-[ai-sparkle-burst_calc(var(--animation-duration)*5)_var(--ease-in-out)_1_both]",
|
|
16
|
+
working: "ds:[--sparkle-base:0] ds:animate-[ai-sparkle-twinkle_calc(var(--animation-duration)*8)_var(--ease-in-out)_infinite]",
|
|
17
|
+
landed: "ds:[--sparkle-base:6] ds:animate-[ai-sparkle-burst_calc(var(--animation-duration)*5)_var(--ease-in-out)_1_both]"
|
|
18
|
+
}, s = "ds:absolute ds:opacity-0 ds:text-[color:var(--ai-sparkle)] ds:fill-current ds:drop-shadow-[0_0_var(--spacing-2xs)_var(--ai-sparkle)] ds:[animation-delay:calc(var(--animation-duration)*(var(--sparkle-base)+var(--sparkle-stagger)))]", z = [
|
|
19
|
+
{
|
|
20
|
+
key: "start",
|
|
21
|
+
className: `${s} ds:[--sparkle-stagger:0] ds:size-3 ds:[inset-block-start:calc(var(--spacing-xs)*-1)] ds:[inset-inline-start:calc(var(--spacing-2xs)*-1)]`
|
|
22
|
+
},
|
|
23
|
+
{
|
|
24
|
+
key: "top",
|
|
25
|
+
className: `${s} ds:[--sparkle-stagger:0.5] ds:size-4 ds:[inset-block-start:calc(var(--spacing-sm)*-1)] ds:[inset-inline-start:40%]`
|
|
26
|
+
},
|
|
27
|
+
{
|
|
28
|
+
key: "end",
|
|
29
|
+
className: `${s} ds:[--sparkle-stagger:1] ds:size-3 ds:[inset-block-start:calc(var(--spacing-xs)*-1)] ds:[inset-inline-end:var(--spacing-md)]`
|
|
30
|
+
},
|
|
31
|
+
{
|
|
32
|
+
key: "side",
|
|
33
|
+
className: `${s} ds:[--sparkle-stagger:1.5] ds:size-2 ds:[inset-block-start:40%] ds:[inset-inline-end:calc(var(--spacing-sm)*-1)]`
|
|
34
|
+
},
|
|
35
|
+
{
|
|
36
|
+
key: "below",
|
|
37
|
+
className: `${s} ds:[--sparkle-stagger:2] ds:size-3 ds:[inset-block-end:calc(var(--spacing-xs)*-1)] ds:[inset-inline-start:25%]`
|
|
38
|
+
}
|
|
39
|
+
], h = "ds:pointer-events-none ds:absolute ds:[inset-block-start:0] ds:[inset-inline-start:0] ds:opacity-0 ds:[offset-path:inset(0_round_var(--radius-full))] ds:[offset-rotate:0deg]", C = [
|
|
40
|
+
{
|
|
41
|
+
key: 1,
|
|
42
|
+
lag: "ds:[animation-delay:calc(var(--animation-duration)*0.2)]",
|
|
43
|
+
dot: "ds:size-2.5 ds:opacity-[var(--opacity-90)]"
|
|
44
|
+
},
|
|
45
|
+
{
|
|
46
|
+
key: 2,
|
|
47
|
+
lag: "ds:[animation-delay:calc(var(--animation-duration)*0.4)]",
|
|
48
|
+
dot: "ds:size-2 ds:opacity-[var(--opacity-70)]"
|
|
49
|
+
},
|
|
50
|
+
{
|
|
51
|
+
key: 3,
|
|
52
|
+
lag: "ds:[animation-delay:calc(var(--animation-duration)*0.6)]",
|
|
53
|
+
dot: "ds:size-2 ds:opacity-[var(--opacity-50)]"
|
|
54
|
+
},
|
|
55
|
+
{
|
|
56
|
+
key: 4,
|
|
57
|
+
lag: "ds:[animation-delay:calc(var(--animation-duration)*0.8)]",
|
|
58
|
+
dot: "ds:size-1.5 ds:opacity-[var(--opacity-30)]"
|
|
59
|
+
},
|
|
60
|
+
{
|
|
61
|
+
key: 5,
|
|
62
|
+
lag: "ds:[animation-delay:calc(var(--animation-duration)*1)]",
|
|
63
|
+
dot: "ds:size-1.5 ds:opacity-[var(--opacity-20)]"
|
|
64
|
+
},
|
|
65
|
+
{
|
|
66
|
+
key: 6,
|
|
67
|
+
lag: "ds:[animation-delay:calc(var(--animation-duration)*1.2)]",
|
|
68
|
+
dot: "ds:size-1 ds:opacity-[var(--opacity-10)]"
|
|
69
|
+
}
|
|
70
|
+
];
|
|
71
|
+
function A(o = {}) {
|
|
72
|
+
const { enabled: r = !0, reducedMotion: d = "auto" } = o, c = k(), n = d === "off" ? !1 : c, [a, i] = v(
|
|
73
|
+
r ? "intro" : null
|
|
74
|
+
);
|
|
75
|
+
_(() => {
|
|
76
|
+
if (a !== "intro" && a !== "landed") return;
|
|
77
|
+
const t = n ? 0 : y[a], p = window.setTimeout(() => i(null), t);
|
|
78
|
+
return () => window.clearTimeout(p);
|
|
79
|
+
}, [a, n]);
|
|
80
|
+
const l = e(() => i("working"), []), m = e(() => i("landed"), []), u = e(() => {
|
|
81
|
+
i((t) => t === "working" ? null : t);
|
|
82
|
+
}, []);
|
|
83
|
+
return {
|
|
84
|
+
state: a,
|
|
85
|
+
props: {
|
|
86
|
+
"data-ai-sparkle": a ?? void 0,
|
|
87
|
+
className: a ? g[a] : ""
|
|
88
|
+
},
|
|
89
|
+
start: l,
|
|
90
|
+
land: m,
|
|
91
|
+
reset: u
|
|
92
|
+
};
|
|
93
|
+
}
|
|
94
|
+
export {
|
|
95
|
+
w as B,
|
|
96
|
+
C,
|
|
97
|
+
z as S,
|
|
98
|
+
h as a,
|
|
99
|
+
S as b,
|
|
100
|
+
g as c,
|
|
101
|
+
A as u
|
|
102
|
+
};
|
|
103
|
+
//# sourceMappingURL=use-ai-sparkle-CyQSRTCe.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"use-ai-sparkle-CyQSRTCe.js","sources":["../../src/hooks/use-ai-sparkle.ts"],"sourcesContent":["import { useCallback, useEffect, useState } from 'react';\nimport { usePrefersReducedMotion } from './use-prefers-reduced-motion';\n\n/* -------------------------------------------------------------------- */\n/* Shared class tables — read by the hook (shimmer) and by the */\n/* `AiSparkle` presentational component (comet + burst layers), so both */\n/* sides key off the same three states. */\n/* -------------------------------------------------------------------- */\n\n/** Where the sparkle is: on first show, while an action runs, as it lands. */\nexport type AiSparkleState = 'intro' | 'working' | 'landed';\n\n// How long the one-off sparkles stay lit at the default 200ms\n// `--animation-duration` — the comet's lap, then the burst and its stagger.\n// Scaled to 0 under reduced motion (see `useAiSparkle` below).\nconst SPARKLE_ONCE_MS: Record<'intro' | 'landed', number> = {\n intro: 3200,\n landed: 2800,\n};\n\n// Pill sparkle: a light sweep across the surface. Durations derive from\n// `--animation-duration`, so they drop to 0 (no motion) under\n// prefers-reduced-motion and in the accessible themes.\nexport const SHIMMER_CLASS: Record<AiSparkleState, string> = {\n intro:\n 'ds:animate-[ai-pill-shimmer_calc(var(--animation-duration)*6)_var(--ease-in-out)_1]',\n working:\n 'ds:animate-[ai-pill-shimmer_calc(var(--animation-duration)*6)_var(--ease-in-out)_infinite]',\n landed:\n 'ds:animate-[ai-pill-shimmer_calc(var(--animation-duration)*4)_var(--ease-out)_1]',\n};\n\n// The comet laps the pill: once on intro, faster on landing, looping while\n// an action runs. `offset-path` traces the pill's rounded outline; where it\n// is unsupported the comet simply never shows (it rests at opacity 0).\nexport const COMET_CLASS: Record<AiSparkleState, string> = {\n intro:\n 'ds:animate-[ai-comet-orbit_calc(var(--animation-duration)*7)_var(--ease-in-out)_1_both]',\n working:\n 'ds:animate-[ai-comet-orbit_calc(var(--animation-duration)*8)_linear_infinite]',\n landed:\n 'ds:animate-[ai-comet-orbit_calc(var(--animation-duration)*5)_var(--ease-out)_1_both]',\n};\n\n// After the comet's lap the stars burst (intro, landed); while an action\n// runs they swell in and out. `--sparkle-base` is when the burst starts,\n// in units of --animation-duration.\nexport const BURST_CLASS: Record<AiSparkleState, string> = {\n intro:\n 'ds:[--sparkle-base:8] ds:animate-[ai-sparkle-burst_calc(var(--animation-duration)*5)_var(--ease-in-out)_1_both]',\n working:\n 'ds:[--sparkle-base:0] ds:animate-[ai-sparkle-twinkle_calc(var(--animation-duration)*8)_var(--ease-in-out)_infinite]',\n landed:\n 'ds:[--sparkle-base:6] ds:animate-[ai-sparkle-burst_calc(var(--animation-duration)*5)_var(--ease-in-out)_1_both]',\n};\n\n// Five stars around the host, staggered. Hidden at rest (opacity 0), so they\n// only show while a keyframe runs.\nconst glyphBase =\n 'ds:absolute ds:opacity-0 ds:text-[color:var(--ai-sparkle)] ds:fill-current ds:drop-shadow-[0_0_var(--spacing-2xs)_var(--ai-sparkle)] ds:[animation-delay:calc(var(--animation-duration)*(var(--sparkle-base)+var(--sparkle-stagger)))]';\nexport const SPARKLE_GLYPHS = [\n {\n key: 'start',\n className: `${glyphBase} ds:[--sparkle-stagger:0] ds:size-3 ds:[inset-block-start:calc(var(--spacing-xs)*-1)] ds:[inset-inline-start:calc(var(--spacing-2xs)*-1)]`,\n },\n {\n key: 'top',\n className: `${glyphBase} ds:[--sparkle-stagger:0.5] ds:size-4 ds:[inset-block-start:calc(var(--spacing-sm)*-1)] ds:[inset-inline-start:40%]`,\n },\n {\n key: 'end',\n className: `${glyphBase} ds:[--sparkle-stagger:1] ds:size-3 ds:[inset-block-start:calc(var(--spacing-xs)*-1)] ds:[inset-inline-end:var(--spacing-md)]`,\n },\n {\n key: 'side',\n className: `${glyphBase} ds:[--sparkle-stagger:1.5] ds:size-2 ds:[inset-block-start:40%] ds:[inset-inline-end:calc(var(--spacing-sm)*-1)]`,\n },\n {\n key: 'below',\n className: `${glyphBase} ds:[--sparkle-stagger:2] ds:size-3 ds:[inset-block-end:calc(var(--spacing-xs)*-1)] ds:[inset-inline-start:25%]`,\n },\n] as const;\n\n// The comet rides the host's rounded outline. Its tail is a row of dots on\n// the same path, each a step behind the head, so the tail bends with the\n// curve. Every piece rests at opacity 0 and shows only while it runs.\nexport const COMET_WRAPPER_CLASS =\n 'ds:pointer-events-none ds:absolute ds:[inset-block-start:0] ds:[inset-inline-start:0] ds:opacity-0 ds:[offset-path:inset(0_round_var(--radius-full))] ds:[offset-rotate:0deg]';\nexport const COMET_TAIL = [\n {\n key: 1,\n lag: 'ds:[animation-delay:calc(var(--animation-duration)*0.2)]',\n dot: 'ds:size-2.5 ds:opacity-[var(--opacity-90)]',\n },\n {\n key: 2,\n lag: 'ds:[animation-delay:calc(var(--animation-duration)*0.4)]',\n dot: 'ds:size-2 ds:opacity-[var(--opacity-70)]',\n },\n {\n key: 3,\n lag: 'ds:[animation-delay:calc(var(--animation-duration)*0.6)]',\n dot: 'ds:size-2 ds:opacity-[var(--opacity-50)]',\n },\n {\n key: 4,\n lag: 'ds:[animation-delay:calc(var(--animation-duration)*0.8)]',\n dot: 'ds:size-1.5 ds:opacity-[var(--opacity-30)]',\n },\n {\n key: 5,\n lag: 'ds:[animation-delay:calc(var(--animation-duration)*1)]',\n dot: 'ds:size-1.5 ds:opacity-[var(--opacity-20)]',\n },\n {\n key: 6,\n lag: 'ds:[animation-delay:calc(var(--animation-duration)*1.2)]',\n dot: 'ds:size-1 ds:opacity-[var(--opacity-10)]',\n },\n] as const;\n\n/* -------------------------------------------------------------------- */\n/* Types */\n/* -------------------------------------------------------------------- */\n\nexport interface UseAiSparkleOptions {\n /**\n * Whether the sparkle is available at all. Read once, at mount, to seed\n * the initial `'intro'` phase — matches how the RichTextEditor's\n * `aiSparkle` prop only ever gated the very first render. Default `true`.\n */\n enabled?: boolean;\n /**\n * `'auto'` (default) reads `prefers-reduced-motion` via\n * `usePrefersReducedMotion`. `'off'` forces full motion regardless of the\n * OS preference — useful for a story that wants to show the animated\n * states side by side with a reduced one.\n */\n reducedMotion?: 'auto' | 'off';\n}\n\nexport interface UseAiSparkleProps {\n /** Spread (or picked) onto the host element as a pure styling hook. */\n 'data-ai-sparkle': AiSparkleState | undefined;\n /**\n * The shimmer animation class for the current state — empty when at rest.\n * Layer it over the host's own base positioning classes; the comet and\n * burst layers need real DOM and live in the `AiSparkle` component instead.\n */\n className: string;\n}\n\nexport interface UseAiSparkleReturn {\n /** `null` at rest — nothing to render for the comet/burst layers either. */\n state: AiSparkleState | null;\n props: UseAiSparkleProps;\n /** An AI action started: swap to the looping `'working'` phase. */\n start: () => void;\n /** An action's result landed: swap to the one-off `'landed'` phase. */\n land: () => void;\n /**\n * Settle after an action ends. Clears back to rest only when still\n * `'working'` (the action errored or was cancelled before `land()`);\n * leaves `'landed'` alone so the one-off animation gets to play out.\n */\n reset: () => void;\n}\n\n/* -------------------------------------------------------------------- */\n/* Hook */\n/* -------------------------------------------------------------------- */\n\n/**\n * Drives the AI-pill sparkle: lit on first show, looping while an action\n * runs, and a one-off flourish as the result lands.\n *\n * The hook owns the state machine and the timing only — it paints nothing.\n * `props['data-ai-sparkle']` is a plain styling hook for the host element;\n * `props.className` carries the shimmer layer's animation class from the\n * same lookup table the RichTextEditor's pill originally inlined. The\n * comet and burst layers need actual DOM (a tail of dots, five staggered\n * glyphs), so they live in the sibling `AiSparkle` component, keyed off the\n * same `state`.\n *\n * Both `intro` and `landed` are one-off: this hook clears them back to\n * `null` on a timer sized to the comet's lap plus the burst and its\n * stagger, at the default 200ms `--animation-duration`. Under reduced\n * motion (`prefers-reduced-motion` or `reducedMotion: 'auto'`'s system\n * read) the CSS animations already collapse to 0ms, so the clear fires at\n * the next tick instead of waiting out the full lap — the pill still gets\n * its `data-ai-sparkle` attribute for a moment, but nothing visibly moves.\n */\nexport function useAiSparkle(\n options: UseAiSparkleOptions = {},\n): UseAiSparkleReturn {\n const { enabled = true, reducedMotion = 'auto' } = options;\n const systemReduced = usePrefersReducedMotion();\n const reduced = reducedMotion === 'off' ? false : systemReduced;\n\n const [state, setState] = useState<AiSparkleState | null>(\n enabled ? 'intro' : null,\n );\n\n useEffect(() => {\n if (state !== 'intro' && state !== 'landed') return undefined;\n const ms = reduced ? 0 : SPARKLE_ONCE_MS[state];\n const timer = window.setTimeout(() => setState(null), ms);\n return () => window.clearTimeout(timer);\n }, [state, reduced]);\n\n const start = useCallback(() => setState('working'), []);\n const land = useCallback(() => setState('landed'), []);\n const reset = useCallback(() => {\n setState((s) => (s === 'working' ? null : s));\n }, []);\n\n return {\n state,\n props: {\n 'data-ai-sparkle': state ?? undefined,\n className: state ? SHIMMER_CLASS[state] : '',\n },\n start,\n land,\n reset,\n };\n}\n"],"names":["SPARKLE_ONCE_MS","SHIMMER_CLASS","COMET_CLASS","BURST_CLASS","glyphBase","SPARKLE_GLYPHS","COMET_WRAPPER_CLASS","COMET_TAIL","useAiSparkle","options","enabled","reducedMotion","systemReduced","usePrefersReducedMotion","reduced","state","setState","useState","useEffect","ms","timer","start","useCallback","land","reset","s"],"mappings":";;AAeA,MAAMA,IAAsD;AAAA,EAC1D,OAAO;AAAA,EACP,QAAQ;AACV,GAKaC,IAAgD;AAAA,EAC3D,OACE;AAAA,EACF,SACE;AAAA,EACF,QACE;AACJ,GAKaC,IAA8C;AAAA,EACzD,OACE;AAAA,EACF,SACE;AAAA,EACF,QACE;AACJ,GAKaC,IAA8C;AAAA,EACzD,OACE;AAAA,EACF,SACE;AAAA,EACF,QACE;AACJ,GAIMC,IACJ,0OACWC,IAAiB;AAAA,EAC5B;AAAA,IACE,KAAK;AAAA,IACL,WAAW,GAAGD,CAAS;AAAA,EAAA;AAAA,EAEzB;AAAA,IACE,KAAK;AAAA,IACL,WAAW,GAAGA,CAAS;AAAA,EAAA;AAAA,EAEzB;AAAA,IACE,KAAK;AAAA,IACL,WAAW,GAAGA,CAAS;AAAA,EAAA;AAAA,EAEzB;AAAA,IACE,KAAK;AAAA,IACL,WAAW,GAAGA,CAAS;AAAA,EAAA;AAAA,EAEzB;AAAA,IACE,KAAK;AAAA,IACL,WAAW,GAAGA,CAAS;AAAA,EAAA;AAE3B,GAKaE,IACX,iLACWC,IAAa;AAAA,EACxB;AAAA,IACE,KAAK;AAAA,IACL,KAAK;AAAA,IACL,KAAK;AAAA,EAAA;AAAA,EAEP;AAAA,IACE,KAAK;AAAA,IACL,KAAK;AAAA,IACL,KAAK;AAAA,EAAA;AAAA,EAEP;AAAA,IACE,KAAK;AAAA,IACL,KAAK;AAAA,IACL,KAAK;AAAA,EAAA;AAAA,EAEP;AAAA,IACE,KAAK;AAAA,IACL,KAAK;AAAA,IACL,KAAK;AAAA,EAAA;AAAA,EAEP;AAAA,IACE,KAAK;AAAA,IACL,KAAK;AAAA,IACL,KAAK;AAAA,EAAA;AAAA,EAEP;AAAA,IACE,KAAK;AAAA,IACL,KAAK;AAAA,IACL,KAAK;AAAA,EAAA;AAET;AAyEO,SAASC,EACdC,IAA+B,IACX;AACpB,QAAM,EAAE,SAAAC,IAAU,IAAM,eAAAC,IAAgB,WAAWF,GAC7CG,IAAgBC,EAAA,GAChBC,IAAUH,MAAkB,QAAQ,KAAQC,GAE5C,CAACG,GAAOC,CAAQ,IAAIC;AAAA,IACxBP,IAAU,UAAU;AAAA,EAAA;AAGtB,EAAAQ,EAAU,MAAM;AACd,QAAIH,MAAU,WAAWA,MAAU,SAAU;AAC7C,UAAMI,IAAKL,IAAU,IAAId,EAAgBe,CAAK,GACxCK,IAAQ,OAAO,WAAW,MAAMJ,EAAS,IAAI,GAAGG,CAAE;AACxD,WAAO,MAAM,OAAO,aAAaC,CAAK;AAAA,EACxC,GAAG,CAACL,GAAOD,CAAO,CAAC;AAEnB,QAAMO,IAAQC,EAAY,MAAMN,EAAS,SAAS,GAAG,CAAA,CAAE,GACjDO,IAAOD,EAAY,MAAMN,EAAS,QAAQ,GAAG,CAAA,CAAE,GAC/CQ,IAAQF,EAAY,MAAM;AAC9B,IAAAN,EAAS,CAACS,MAAOA,MAAM,YAAY,OAAOA,CAAE;AAAA,EAC9C,GAAG,CAAA,CAAE;AAEL,SAAO;AAAA,IACL,OAAAV;AAAA,IACA,OAAO;AAAA,MACL,mBAAmBA,KAAS;AAAA,MAC5B,WAAWA,IAAQd,EAAcc,CAAK,IAAI;AAAA,IAAA;AAAA,IAE5C,OAAAM;AAAA,IACA,MAAAE;AAAA,IACA,OAAAC;AAAA,EAAA;AAEJ;"}
|
|
@@ -0,0 +1,401 @@
|
|
|
1
|
+
import { jsxs as d, jsx as a } from "react/jsx-runtime";
|
|
2
|
+
import { forwardRef as Q, useRef as _, useId as q, useMemo as h, useState as Y, useImperativeHandle as J, useEffect as W } from "react";
|
|
3
|
+
import { useTranslation as X } from "react-i18next";
|
|
4
|
+
import { n as z } from "./normalize-diacritics-BNGbFNlJ.js";
|
|
5
|
+
import { u as Z } from "./registry-DvAUVLHh.js";
|
|
6
|
+
import { S as ee } from "./search-QbWPlY5f.js";
|
|
7
|
+
import { F as O } from "./file-text-5yv6r2ls.js";
|
|
8
|
+
import { U as te } from "./user-cog-BTn98Arm.js";
|
|
9
|
+
import { B as se } from "./building-2-D33bLCWL.js";
|
|
10
|
+
import { C as ae } from "./calendar-days-BGWklvE-.js";
|
|
11
|
+
import { U as re } from "./user-B12p7bVF.js";
|
|
12
|
+
import { c as oe } from "./createLucideIcon-DhHxpK9K.js";
|
|
13
|
+
/**
|
|
14
|
+
* @license lucide-react v1.22.0 - ISC
|
|
15
|
+
*
|
|
16
|
+
* This source code is licensed under the ISC license.
|
|
17
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
18
|
+
*/
|
|
19
|
+
const ne = [
|
|
20
|
+
["path", { d: "M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8", key: "1357e3" }],
|
|
21
|
+
["path", { d: "M3 3v5h5", key: "1xhq8a" }],
|
|
22
|
+
["path", { d: "M12 7v5l4 2", key: "1fdv2h" }]
|
|
23
|
+
], ie = oe("history", ne), de = {
|
|
24
|
+
id: "variables-menu",
|
|
25
|
+
// Ephemeral filter (read) plus a persisted insert (write, not reversible by
|
|
26
|
+
// the same UI — undo lives in the editor, not here) and a close (read).
|
|
27
|
+
capabilities: ["filter", "select_single", "close"],
|
|
28
|
+
state: {
|
|
29
|
+
query: {
|
|
30
|
+
type: "string",
|
|
31
|
+
descriptionKey: "ui.agent.variablesMenu.state.query",
|
|
32
|
+
description: "Current filter text.",
|
|
33
|
+
read: (n) => n.getQuery()
|
|
34
|
+
},
|
|
35
|
+
visibleTokens: {
|
|
36
|
+
type: "string[]",
|
|
37
|
+
descriptionKey: "ui.agent.variablesMenu.state.visibleTokens",
|
|
38
|
+
description: "Tokens of the variables currently visible, in row order.",
|
|
39
|
+
read: (n) => n.getVisibleTokens()
|
|
40
|
+
}
|
|
41
|
+
},
|
|
42
|
+
actions: {
|
|
43
|
+
select_token: {
|
|
44
|
+
// Inserts a `[[TOKEN]]` chip into the host document.
|
|
45
|
+
safety: "write",
|
|
46
|
+
argsType: "{ token: string }",
|
|
47
|
+
argsSchema: {
|
|
48
|
+
type: "object",
|
|
49
|
+
properties: {
|
|
50
|
+
token: {
|
|
51
|
+
type: "string",
|
|
52
|
+
description: "Token of the variable to insert, without brackets."
|
|
53
|
+
}
|
|
54
|
+
},
|
|
55
|
+
required: ["token"]
|
|
56
|
+
},
|
|
57
|
+
idempotent: !1,
|
|
58
|
+
descriptionKey: "ui.agent.variablesMenu.actions.selectToken",
|
|
59
|
+
description: "Insert the given variable token at the anchor.",
|
|
60
|
+
examples: [
|
|
61
|
+
{
|
|
62
|
+
args: { token: "NOME" },
|
|
63
|
+
note: "Insert [[NOME]] and close the menu."
|
|
64
|
+
}
|
|
65
|
+
],
|
|
66
|
+
invoke: (n, c) => {
|
|
67
|
+
n.selectToken(c.token);
|
|
68
|
+
}
|
|
69
|
+
},
|
|
70
|
+
close: {
|
|
71
|
+
safety: "read",
|
|
72
|
+
idempotent: !0,
|
|
73
|
+
descriptionKey: "ui.agent.variablesMenu.actions.close",
|
|
74
|
+
description: "Dismiss the menu without inserting anything.",
|
|
75
|
+
invoke: (n) => {
|
|
76
|
+
n.close();
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
},
|
|
80
|
+
domHooks: {
|
|
81
|
+
root: { attr: "data-component", value: "variables-menu" },
|
|
82
|
+
instanceId: {
|
|
83
|
+
attr: "data-component-id",
|
|
84
|
+
sourceProp: "id",
|
|
85
|
+
description: "Sourced from the id prop."
|
|
86
|
+
},
|
|
87
|
+
item: {
|
|
88
|
+
attr: "data-variable-token",
|
|
89
|
+
description: "Each visible row emits its token as data-variable-token."
|
|
90
|
+
}
|
|
91
|
+
}
|
|
92
|
+
}, C = [
|
|
93
|
+
"patient",
|
|
94
|
+
"appointment",
|
|
95
|
+
"practice",
|
|
96
|
+
"operator",
|
|
97
|
+
"document"
|
|
98
|
+
], ce = {
|
|
99
|
+
recent: /* @__PURE__ */ a(ie, { "aria-hidden": "true", className: "ds:size-3" }),
|
|
100
|
+
patient: /* @__PURE__ */ a(re, { "aria-hidden": "true", className: "ds:size-3" }),
|
|
101
|
+
appointment: /* @__PURE__ */ a(ae, { "aria-hidden": "true", className: "ds:size-3" }),
|
|
102
|
+
practice: /* @__PURE__ */ a(se, { "aria-hidden": "true", className: "ds:size-3" }),
|
|
103
|
+
operator: /* @__PURE__ */ a(te, { "aria-hidden": "true", className: "ds:size-3" }),
|
|
104
|
+
document: /* @__PURE__ */ a(O, { "aria-hidden": "true", className: "ds:size-3" }),
|
|
105
|
+
other: /* @__PURE__ */ a(O, { "aria-hidden": "true", className: "ds:size-3" })
|
|
106
|
+
};
|
|
107
|
+
function U(n, c) {
|
|
108
|
+
const x = c.trim();
|
|
109
|
+
if (!x) return !0;
|
|
110
|
+
const l = z(x), u = l.replace(/\s+/g, "_"), i = z(n.token);
|
|
111
|
+
return z(n.label).includes(l) || i.includes(l) || i.includes(u);
|
|
112
|
+
}
|
|
113
|
+
const le = {
|
|
114
|
+
patient: "editor.variables.groups.patient",
|
|
115
|
+
appointment: "editor.variables.groups.appointment",
|
|
116
|
+
practice: "editor.variables.groups.practice",
|
|
117
|
+
operator: "editor.variables.groups.operator",
|
|
118
|
+
document: "editor.variables.groups.document",
|
|
119
|
+
other: "editor.variables.groups.other"
|
|
120
|
+
}, pe = {
|
|
121
|
+
patient: "Patient",
|
|
122
|
+
appointment: "Appointment",
|
|
123
|
+
practice: "Practice",
|
|
124
|
+
operator: "Operator",
|
|
125
|
+
document: "Document",
|
|
126
|
+
other: "Other"
|
|
127
|
+
}, ue = [
|
|
128
|
+
"ds:flex ds:flex-col",
|
|
129
|
+
"ds:w-[20rem] ds:overflow-hidden",
|
|
130
|
+
"ds:rounded-[var(--radius-md)] ds:border ds:border-[color:var(--border)]",
|
|
131
|
+
"ds:bg-[var(--popover)] ds:text-[color:var(--popover-foreground)]",
|
|
132
|
+
"ds:shadow-[var(--shadow-lg)]"
|
|
133
|
+
].join(" "), me = [
|
|
134
|
+
"ds:flex ds:items-center ds:gap-[var(--spacing-sm)]",
|
|
135
|
+
"ds:px-[var(--spacing-md)] ds:py-[var(--spacing-sm)]",
|
|
136
|
+
"ds:border-b ds:border-[color:var(--border)]"
|
|
137
|
+
].join(" "), ve = [
|
|
138
|
+
"ds:w-full ds:bg-transparent ds:border-0 ds:outline-none",
|
|
139
|
+
"ds:text-[length:var(--font-size-sm)] ds:text-[color:var(--foreground)]",
|
|
140
|
+
"ds:placeholder:text-[color:var(--muted-foreground)]"
|
|
141
|
+
].join(" "), fe = [
|
|
142
|
+
"ds:flex ds:flex-col ds:overflow-y-auto",
|
|
143
|
+
"ds:[max-block-size:16.5rem] ds:p-[var(--spacing-2xs)]"
|
|
144
|
+
].join(" "), ge = [
|
|
145
|
+
"ds:flex ds:items-center ds:gap-[var(--spacing-2xs)]",
|
|
146
|
+
"ds:px-[var(--spacing-sm)] ds:pt-[var(--spacing-sm)] ds:pb-[var(--spacing-2xs)]",
|
|
147
|
+
"ds:text-[length:var(--font-size-2xs)] ds:font-[var(--font-weight-bold)]",
|
|
148
|
+
"ds:tracking-[0.07em] ds:uppercase",
|
|
149
|
+
"ds:text-[color:var(--muted-foreground)]"
|
|
150
|
+
].join(" "), be = [
|
|
151
|
+
"ds:group ds:flex ds:flex-col ds:justify-center ds:cursor-pointer",
|
|
152
|
+
"ds:gap-0 ds:rounded-[var(--radius-sm)]",
|
|
153
|
+
"ds:px-[var(--spacing-sm)] ds:py-[var(--spacing-xs)]",
|
|
154
|
+
"ds:min-h-8",
|
|
155
|
+
"ds:data-[active=true]:bg-[var(--violet-50)]",
|
|
156
|
+
"ds:[.theme-dark_&]:data-[active=true]:bg-[color-mix(in_oklab,var(--violet-700)_35%,transparent)]"
|
|
157
|
+
].join(" "), he = "ds:flex ds:items-center ds:gap-[var(--spacing-sm)]", xe = "ds:flex-1 ds:truncate ds:text-[length:var(--font-size-sm)] ds:font-[var(--font-weight-medium)]", ke = [
|
|
158
|
+
"ds:font-[family-name:var(--font-mono)] ds:text-[length:var(--font-size-2xs)]",
|
|
159
|
+
"ds:text-[color:var(--muted-foreground)]",
|
|
160
|
+
"ds:bg-[var(--muted)] ds:rounded-[var(--radius-sm)]",
|
|
161
|
+
"ds:px-[var(--spacing-2xs)] ds:py-[0.0625rem]",
|
|
162
|
+
"ds:whitespace-nowrap",
|
|
163
|
+
"ds:group-data-[active=true]:bg-[var(--violet-100)]",
|
|
164
|
+
"ds:group-data-[active=true]:text-[color:var(--violet-700)]",
|
|
165
|
+
"ds:[.theme-dark_&]:group-data-[active=true]:bg-[color-mix(in_oklab,var(--violet-800)_55%,transparent)]",
|
|
166
|
+
"ds:[.theme-dark_&]:group-data-[active=true]:text-[color:var(--violet-100)]"
|
|
167
|
+
].join(" "), ye = [
|
|
168
|
+
"ds:px-[var(--spacing-md)] ds:py-[var(--spacing-lg)] ds:text-center",
|
|
169
|
+
"ds:text-[length:var(--font-size-sm)] ds:text-[color:var(--muted-foreground)]"
|
|
170
|
+
].join(" "), we = [
|
|
171
|
+
"ds:flex ds:flex-wrap ds:items-center ds:gap-[var(--spacing-md)]",
|
|
172
|
+
"ds:px-[var(--spacing-md)] ds:py-[var(--spacing-xs)]",
|
|
173
|
+
"ds:border-t ds:border-[color:var(--border)]",
|
|
174
|
+
"ds:bg-[var(--muted)]/40",
|
|
175
|
+
"ds:text-[length:var(--font-size-2xs)] ds:text-[color:var(--muted-foreground)]"
|
|
176
|
+
].join(" "), j = [
|
|
177
|
+
"ds:font-[family-name:var(--font-mono)] ds:text-[length:var(--font-size-2xs)]",
|
|
178
|
+
"ds:border ds:border-[color:var(--border)] ds:border-b-2",
|
|
179
|
+
"ds:rounded-[var(--radius-sm)] ds:px-[var(--spacing-2xs)]",
|
|
180
|
+
"ds:bg-[var(--background)]"
|
|
181
|
+
].join(" "), Ne = Q(function({
|
|
182
|
+
id: c,
|
|
183
|
+
className: x,
|
|
184
|
+
variables: l,
|
|
185
|
+
recentTokens: u,
|
|
186
|
+
query: i,
|
|
187
|
+
onQueryChange: V,
|
|
188
|
+
onSelect: k,
|
|
189
|
+
onClose: m,
|
|
190
|
+
searchFocusable: A = !0,
|
|
191
|
+
"aria-label": E,
|
|
192
|
+
onActiveDescendantChange: y
|
|
193
|
+
}, H) {
|
|
194
|
+
const { t: p } = X(), R = _(null), P = q().replace(/:/g, ""), v = `${c ?? `variables-menu-${P}`}-list`, T = h(() => {
|
|
195
|
+
const e = /* @__PURE__ */ new Map();
|
|
196
|
+
return l.forEach((r) => e.set(r.token, r)), e;
|
|
197
|
+
}, [l]), w = h(() => {
|
|
198
|
+
const e = [];
|
|
199
|
+
if (u && u.length > 0) {
|
|
200
|
+
const t = u.slice(0, 3).map((s) => T.get(s)).filter((s) => !!s).filter((s) => U(s, i)).map((s) => ({
|
|
201
|
+
key: `recent-${s.token}`,
|
|
202
|
+
group: "recent",
|
|
203
|
+
variable: s
|
|
204
|
+
}));
|
|
205
|
+
t.length > 0 && e.push({
|
|
206
|
+
key: "recent",
|
|
207
|
+
labelKey: "editor.variables.recent",
|
|
208
|
+
defaultLabel: "Recent",
|
|
209
|
+
items: t
|
|
210
|
+
});
|
|
211
|
+
}
|
|
212
|
+
const r = /* @__PURE__ */ new Map();
|
|
213
|
+
return l.forEach((t) => {
|
|
214
|
+
if (!U(t, i)) return;
|
|
215
|
+
const s = t.group && C.includes(t.group) ? t.group : "other", b = r.get(s) ?? [];
|
|
216
|
+
b.push({ key: `${s}-${t.token}`, group: s, variable: t }), r.set(s, b);
|
|
217
|
+
}), [...C, "other"].forEach((t) => {
|
|
218
|
+
const s = r.get(t);
|
|
219
|
+
s && s.length > 0 && e.push({
|
|
220
|
+
key: t,
|
|
221
|
+
labelKey: le[t],
|
|
222
|
+
defaultLabel: pe[t],
|
|
223
|
+
items: s
|
|
224
|
+
});
|
|
225
|
+
}), e;
|
|
226
|
+
}, [l, u, i, T]), o = h(() => w.flatMap((e) => e.items), [w]), [N, S] = Y(null), f = h(() => {
|
|
227
|
+
if (N !== null) {
|
|
228
|
+
const e = o.findIndex(
|
|
229
|
+
(r) => r.variable.token === N
|
|
230
|
+
);
|
|
231
|
+
if (e !== -1) return e;
|
|
232
|
+
}
|
|
233
|
+
return 0;
|
|
234
|
+
}, [N, o]), g = (e) => {
|
|
235
|
+
var r;
|
|
236
|
+
S(((r = o[e]) == null ? void 0 : r.variable.token) ?? null);
|
|
237
|
+
}, D = (e) => {
|
|
238
|
+
o.length !== 0 && g((f + e + o.length) % o.length);
|
|
239
|
+
}, B = () => {
|
|
240
|
+
const e = o[f];
|
|
241
|
+
return e ? (k(e.variable), m("select"), !0) : !1;
|
|
242
|
+
}, K = (e) => {
|
|
243
|
+
switch (e.key) {
|
|
244
|
+
case "ArrowDown":
|
|
245
|
+
return e.preventDefault(), D(1), !0;
|
|
246
|
+
case "ArrowUp":
|
|
247
|
+
return e.preventDefault(), D(-1), !0;
|
|
248
|
+
case "Home":
|
|
249
|
+
return e.preventDefault(), g(0), !0;
|
|
250
|
+
case "End":
|
|
251
|
+
return e.preventDefault(), g(Math.max(0, o.length - 1)), !0;
|
|
252
|
+
case "Enter":
|
|
253
|
+
return e.preventDefault(), B();
|
|
254
|
+
case "Escape":
|
|
255
|
+
return e.preventDefault(), m("escape"), !0;
|
|
256
|
+
default:
|
|
257
|
+
return !1;
|
|
258
|
+
}
|
|
259
|
+
};
|
|
260
|
+
J(H, () => ({
|
|
261
|
+
handleKeyDown: K,
|
|
262
|
+
focusSearch: () => {
|
|
263
|
+
var e;
|
|
264
|
+
return (e = R.current) == null ? void 0 : e.focus();
|
|
265
|
+
}
|
|
266
|
+
}));
|
|
267
|
+
const L = _(i);
|
|
268
|
+
L.current = i;
|
|
269
|
+
const M = _(o);
|
|
270
|
+
M.current = o;
|
|
271
|
+
const G = h(
|
|
272
|
+
() => ({
|
|
273
|
+
getQuery: () => L.current,
|
|
274
|
+
getVisibleTokens: () => M.current.map((e) => e.variable.token),
|
|
275
|
+
selectToken: (e) => {
|
|
276
|
+
const r = M.current.find(
|
|
277
|
+
(t) => t.variable.token === e
|
|
278
|
+
);
|
|
279
|
+
r && (k(r.variable), m("select"));
|
|
280
|
+
},
|
|
281
|
+
close: () => m("escape")
|
|
282
|
+
}),
|
|
283
|
+
[k, m]
|
|
284
|
+
);
|
|
285
|
+
Z(de, G, c);
|
|
286
|
+
const $ = o[f], I = $ ? `${v}-${$.key}` : void 0;
|
|
287
|
+
return W(() => {
|
|
288
|
+
y == null || y(I);
|
|
289
|
+
}, [I]), /* @__PURE__ */ d(
|
|
290
|
+
"div",
|
|
291
|
+
{
|
|
292
|
+
id: c,
|
|
293
|
+
"data-component": "variables-menu",
|
|
294
|
+
"data-component-id": c,
|
|
295
|
+
className: [ue, x].filter(Boolean).join(" "),
|
|
296
|
+
children: [
|
|
297
|
+
A ? /* @__PURE__ */ d("div", { className: me, children: [
|
|
298
|
+
/* @__PURE__ */ a(
|
|
299
|
+
ee,
|
|
300
|
+
{
|
|
301
|
+
"aria-hidden": "true",
|
|
302
|
+
className: "ds:size-3.5 ds:shrink-0 ds:text-[color:var(--muted-foreground)]"
|
|
303
|
+
}
|
|
304
|
+
),
|
|
305
|
+
/* @__PURE__ */ a(
|
|
306
|
+
"input",
|
|
307
|
+
{
|
|
308
|
+
ref: R,
|
|
309
|
+
role: "combobox",
|
|
310
|
+
"aria-expanded": "true",
|
|
311
|
+
"aria-controls": v,
|
|
312
|
+
"aria-activedescendant": I,
|
|
313
|
+
"aria-autocomplete": "list",
|
|
314
|
+
"aria-label": E ?? p("editor.variables.menuLabel", "Variables"),
|
|
315
|
+
placeholder: p("editor.variables.search", "Search variables…"),
|
|
316
|
+
value: i,
|
|
317
|
+
onChange: (e) => V(e.target.value),
|
|
318
|
+
onKeyDown: K,
|
|
319
|
+
autoComplete: "off",
|
|
320
|
+
className: ve
|
|
321
|
+
}
|
|
322
|
+
)
|
|
323
|
+
] }) : null,
|
|
324
|
+
/* @__PURE__ */ a(
|
|
325
|
+
"div",
|
|
326
|
+
{
|
|
327
|
+
id: v,
|
|
328
|
+
role: "listbox",
|
|
329
|
+
"aria-label": E ?? p("editor.variables.menuLabel", "Variables"),
|
|
330
|
+
className: fe,
|
|
331
|
+
children: o.length === 0 ? /* @__PURE__ */ a("div", { className: ye, children: p("editor.variables.empty", {
|
|
332
|
+
query: i,
|
|
333
|
+
defaultValue: 'No variables match "{{query}}"'
|
|
334
|
+
}) }) : w.map((e) => {
|
|
335
|
+
const r = `${v}-${e.key}-heading`;
|
|
336
|
+
return /* @__PURE__ */ d("div", { role: "group", "aria-labelledby": r, children: [
|
|
337
|
+
/* @__PURE__ */ d("div", { id: r, className: ge, children: [
|
|
338
|
+
ce[e.key],
|
|
339
|
+
/* @__PURE__ */ a("span", { children: p(e.labelKey, e.defaultLabel) })
|
|
340
|
+
] }),
|
|
341
|
+
e.items.map((t) => {
|
|
342
|
+
const s = o.indexOf(t), b = s === f;
|
|
343
|
+
return /* @__PURE__ */ a(
|
|
344
|
+
"div",
|
|
345
|
+
{
|
|
346
|
+
id: `${v}-${t.key}`,
|
|
347
|
+
role: "option",
|
|
348
|
+
"aria-selected": b,
|
|
349
|
+
tabIndex: -1,
|
|
350
|
+
"data-active": b,
|
|
351
|
+
"data-variable-token": t.variable.token,
|
|
352
|
+
className: be,
|
|
353
|
+
onMouseDown: (F) => {
|
|
354
|
+
F.preventDefault(), g(s), k(t.variable), m("select");
|
|
355
|
+
},
|
|
356
|
+
onMouseMove: () => {
|
|
357
|
+
f !== s && g(s);
|
|
358
|
+
},
|
|
359
|
+
children: /* @__PURE__ */ d("div", { className: he, children: [
|
|
360
|
+
/* @__PURE__ */ a("span", { className: xe, children: t.variable.label }),
|
|
361
|
+
/* @__PURE__ */ a(
|
|
362
|
+
"span",
|
|
363
|
+
{
|
|
364
|
+
className: ke,
|
|
365
|
+
children: `[[${t.variable.token}]]`
|
|
366
|
+
}
|
|
367
|
+
)
|
|
368
|
+
] })
|
|
369
|
+
},
|
|
370
|
+
t.key
|
|
371
|
+
);
|
|
372
|
+
})
|
|
373
|
+
] }, e.key);
|
|
374
|
+
})
|
|
375
|
+
}
|
|
376
|
+
),
|
|
377
|
+
/* @__PURE__ */ d("div", { className: we, children: [
|
|
378
|
+
/* @__PURE__ */ d("span", { className: "ds:inline-flex ds:items-center ds:gap-[var(--spacing-2xs)]", children: [
|
|
379
|
+
/* @__PURE__ */ a("kbd", { className: j, children: "↑↓" }),
|
|
380
|
+
p("editor.variables.footer.navigate", "navigate")
|
|
381
|
+
] }),
|
|
382
|
+
/* @__PURE__ */ d("span", { className: "ds:inline-flex ds:items-center ds:gap-[var(--spacing-2xs)]", children: [
|
|
383
|
+
/* @__PURE__ */ a("kbd", { className: j, children: "↵" }),
|
|
384
|
+
p("editor.variables.footer.insert", "insert")
|
|
385
|
+
] }),
|
|
386
|
+
/* @__PURE__ */ d("span", { className: "ds:inline-flex ds:items-center ds:gap-[var(--spacing-2xs)]", children: [
|
|
387
|
+
/* @__PURE__ */ a("kbd", { className: j, children: "esc" }),
|
|
388
|
+
p("editor.variables.footer.close", "close")
|
|
389
|
+
] })
|
|
390
|
+
] })
|
|
391
|
+
]
|
|
392
|
+
}
|
|
393
|
+
);
|
|
394
|
+
});
|
|
395
|
+
Ne.displayName = "VariablesMenu";
|
|
396
|
+
export {
|
|
397
|
+
ie as H,
|
|
398
|
+
Ne as V,
|
|
399
|
+
de as v
|
|
400
|
+
};
|
|
401
|
+
//# sourceMappingURL=variables-menu-vXUaSBj4.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"variables-menu-vXUaSBj4.js","sources":["../../node_modules/lucide-react/dist/esm/icons/history.mjs","../../src/components/variables-menu/variables-menu.agent.ts","../../src/components/variables-menu/variables-menu.tsx"],"sourcesContent":["/**\n * @license lucide-react v1.22.0 - ISC\n *\n * This source code is licensed under the ISC license.\n * See the LICENSE file in the root directory of this source tree.\n */\n\nimport createLucideIcon from '../createLucideIcon.mjs';\n\nconst __iconNode = [\n [\"path\", { d: \"M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8\", key: \"1357e3\" }],\n [\"path\", { d: \"M3 3v5h5\", key: \"1xhq8a\" }],\n [\"path\", { d: \"M12 7v5l4 2\", key: \"1fdv2h\" }]\n];\nconst History = createLucideIcon(\"history\", __iconNode);\n\nexport { __iconNode, History as default };\n//# sourceMappingURL=history.mjs.map\n","import type { AgentAdapter } from '../../agent/types';\n\ninterface VariablesMenuAgentHandle {\n getQuery: () => string;\n getVisibleTokens: () => string[];\n selectToken: (token: string) => void;\n close: () => void;\n}\n\nexport const variablesMenuAgent: AgentAdapter<VariablesMenuAgentHandle> = {\n id: 'variables-menu',\n // Ephemeral filter (read) plus a persisted insert (write, not reversible by\n // the same UI — undo lives in the editor, not here) and a close (read).\n capabilities: ['filter', 'select_single', 'close'],\n state: {\n query: {\n type: 'string',\n descriptionKey: 'ui.agent.variablesMenu.state.query',\n description: 'Current filter text.',\n read: (handle) => handle.getQuery(),\n },\n visibleTokens: {\n type: 'string[]',\n descriptionKey: 'ui.agent.variablesMenu.state.visibleTokens',\n description: 'Tokens of the variables currently visible, in row order.',\n read: (handle) => handle.getVisibleTokens(),\n },\n },\n actions: {\n select_token: {\n // Inserts a `[[TOKEN]]` chip into the host document.\n safety: 'write',\n argsType: '{ token: string }',\n argsSchema: {\n type: 'object',\n properties: {\n token: {\n type: 'string',\n description: 'Token of the variable to insert, without brackets.',\n },\n },\n required: ['token'],\n },\n idempotent: false,\n descriptionKey: 'ui.agent.variablesMenu.actions.selectToken',\n description: 'Insert the given variable token at the anchor.',\n examples: [\n {\n args: { token: 'NOME' },\n note: 'Insert [[NOME]] and close the menu.',\n },\n ],\n invoke: (handle, args: { token: string }) => {\n handle.selectToken(args.token);\n },\n },\n close: {\n safety: 'read',\n idempotent: true,\n descriptionKey: 'ui.agent.variablesMenu.actions.close',\n description: 'Dismiss the menu without inserting anything.',\n invoke: (handle) => {\n handle.close();\n },\n },\n },\n domHooks: {\n root: { attr: 'data-component', value: 'variables-menu' },\n instanceId: {\n attr: 'data-component-id',\n sourceProp: 'id',\n description: 'Sourced from the id prop.',\n },\n item: {\n attr: 'data-variable-token',\n description: 'Each visible row emits its token as data-variable-token.',\n },\n },\n};\n","import {\n forwardRef,\n useEffect,\n useId,\n useImperativeHandle,\n useMemo,\n useRef,\n useState,\n type KeyboardEvent as ReactKeyboardEvent,\n type ReactNode,\n} from 'react';\nimport { useTranslation } from 'react-i18next';\nimport {\n Building2,\n CalendarDays,\n FileText,\n History,\n Search,\n User,\n UserCog,\n} from 'lucide-react';\nimport { normalizeDiacritics } from '../_shared/normalize-diacritics';\nimport { useAgentRegistration } from '../../agent';\nimport { variablesMenuAgent } from './variables-menu.agent';\n\n/* ------------------------------------------------------------------ */\n/* Types */\n/* ------------------------------------------------------------------ */\n\nexport type VariablesMenuGroup =\n | 'patient'\n | 'appointment'\n | 'practice'\n | 'operator'\n | 'document';\n\n/** A single merge variable the menu can insert. */\nexport interface VariablesMenuVariable {\n /** Inserted as `[[token]]`. Letters, digits and underscores only. */\n token: string;\n /** Localised label shown at the start of the row. */\n label: string;\n /** Optional second line (reserved for a future resolved-value preview). */\n description?: string;\n /** One of the fixed catalogue groups. Ungrouped variables land in \"Other\". */\n group?: VariablesMenuGroup | string;\n}\n\nexport type VariablesMenuCloseReason =\n | 'escape'\n | 'select'\n | 'outside'\n | 'backspace';\n\n/** Imperative surface for a host that owns its own keydown handling (the\n * caret anchor forwards key events from the editor's contenteditable region,\n * which sits outside this component's own DOM subtree). */\nexport interface VariablesMenuHandle {\n /** Forward a keydown from the host. Returns true when the menu consumed\n * it — the host should then call `preventDefault`/`stopPropagation`. */\n handleKeyDown: (event: ReactKeyboardEvent | KeyboardEvent) => boolean;\n /** Focus the search field (button anchor only — the caret anchor keeps\n * focus in the editor and never calls this). */\n focusSearch: () => void;\n}\n\nexport interface VariablesMenuProps {\n /** Stable id for agent registration / DOM addressing. */\n id?: string;\n className?: string;\n /** The full catalogue on offer. */\n variables: VariablesMenuVariable[];\n /** Most-recently-used tokens, most recent first. Only the first 3 render. */\n recentTokens?: string[];\n /** Current filter text. Always controlled — the caret anchor mirrors the\n * text the reader is typing into the document; the button anchor mirrors\n * its own search field. */\n query: string;\n onQueryChange: (query: string) => void;\n onSelect: (variable: VariablesMenuVariable) => void;\n onClose: (reason: VariablesMenuCloseReason) => void;\n /** False for the caret anchor: no search field at all — the text typed\n * after `[[` in the document is the filter, the host's contenteditable\n * keeps focus and forwards keys via the imperative handle. Default true. */\n searchFocusable?: boolean;\n 'aria-label'?: string;\n /** Fires whenever the active row's DOM id changes (including to\n * `undefined` when the list is empty). The caret anchor mirrors this onto\n * the editor's own `aria-activedescendant`, since focus — and so the\n * combobox role — lives on the contenteditable, not in this component. */\n onActiveDescendantChange?: (id: string | undefined) => void;\n}\n\n/* ------------------------------------------------------------------ */\n/* Grouping */\n/* ------------------------------------------------------------------ */\n\nconst GROUP_ORDER: VariablesMenuGroup[] = [\n 'patient',\n 'appointment',\n 'practice',\n 'operator',\n 'document',\n];\n\nconst GROUP_ICONS: Record<VariablesMenuGroup | 'other' | 'recent', ReactNode> =\n {\n recent: <History aria-hidden=\"true\" className=\"ds:size-3\" />,\n patient: <User aria-hidden=\"true\" className=\"ds:size-3\" />,\n appointment: <CalendarDays aria-hidden=\"true\" className=\"ds:size-3\" />,\n practice: <Building2 aria-hidden=\"true\" className=\"ds:size-3\" />,\n operator: <UserCog aria-hidden=\"true\" className=\"ds:size-3\" />,\n document: <FileText aria-hidden=\"true\" className=\"ds:size-3\" />,\n other: <FileText aria-hidden=\"true\" className=\"ds:size-3\" />,\n };\n\ninterface FlatItem {\n key: string;\n group: VariablesMenuGroup | 'other' | 'recent';\n variable: VariablesMenuVariable;\n}\n\ninterface RenderGroup {\n key: VariablesMenuGroup | 'other' | 'recent';\n labelKey: string;\n defaultLabel: string;\n items: FlatItem[];\n}\n\nfunction matches(variable: VariablesMenuVariable, query: string): boolean {\n const trimmed = query.trim();\n if (!trimmed) return true;\n const q = normalizeDiacritics(trimmed);\n // Tokens are `SNAKE_CASE`; a reader typing a space where the token has an\n // underscore (\"PRENOTA APP\" for `PRENOTA_APPUNTAMENTO`) should still hit,\n // matching the old caret typeahead's behaviour.\n const qAsToken = q.replace(/\\s+/g, '_');\n const token = normalizeDiacritics(variable.token);\n return (\n normalizeDiacritics(variable.label).includes(q) ||\n token.includes(q) ||\n token.includes(qAsToken)\n );\n}\n\nconst GROUP_LABEL_KEYS: Record<VariablesMenuGroup | 'other', string> = {\n patient: 'editor.variables.groups.patient',\n appointment: 'editor.variables.groups.appointment',\n practice: 'editor.variables.groups.practice',\n operator: 'editor.variables.groups.operator',\n document: 'editor.variables.groups.document',\n other: 'editor.variables.groups.other',\n};\n\nconst GROUP_LABEL_DEFAULTS: Record<VariablesMenuGroup | 'other', string> = {\n patient: 'Patient',\n appointment: 'Appointment',\n practice: 'Practice',\n operator: 'Operator',\n document: 'Document',\n other: 'Other',\n};\n\n/* ------------------------------------------------------------------ */\n/* Styles */\n/* ------------------------------------------------------------------ */\n\nconst rootClass = [\n 'ds:flex ds:flex-col',\n 'ds:w-[20rem] ds:overflow-hidden',\n 'ds:rounded-[var(--radius-md)] ds:border ds:border-[color:var(--border)]',\n 'ds:bg-[var(--popover)] ds:text-[color:var(--popover-foreground)]',\n 'ds:shadow-[var(--shadow-lg)]',\n].join(' ');\n\nconst searchRowClass = [\n 'ds:flex ds:items-center ds:gap-[var(--spacing-sm)]',\n 'ds:px-[var(--spacing-md)] ds:py-[var(--spacing-sm)]',\n 'ds:border-b ds:border-[color:var(--border)]',\n].join(' ');\n\nconst searchInputClass = [\n 'ds:w-full ds:bg-transparent ds:border-0 ds:outline-none',\n 'ds:text-[length:var(--font-size-sm)] ds:text-[color:var(--foreground)]',\n 'ds:placeholder:text-[color:var(--muted-foreground)]',\n].join(' ');\n\nconst listClass = [\n 'ds:flex ds:flex-col ds:overflow-y-auto',\n 'ds:[max-block-size:16.5rem] ds:p-[var(--spacing-2xs)]',\n].join(' ');\n\nconst groupHeadingClass = [\n 'ds:flex ds:items-center ds:gap-[var(--spacing-2xs)]',\n 'ds:px-[var(--spacing-sm)] ds:pt-[var(--spacing-sm)] ds:pb-[var(--spacing-2xs)]',\n 'ds:text-[length:var(--font-size-2xs)] ds:font-[var(--font-weight-bold)]',\n 'ds:tracking-[0.07em] ds:uppercase',\n 'ds:text-[color:var(--muted-foreground)]',\n].join(' ');\n\nconst rowClass = [\n 'ds:group ds:flex ds:flex-col ds:justify-center ds:cursor-pointer',\n 'ds:gap-0 ds:rounded-[var(--radius-sm)]',\n 'ds:px-[var(--spacing-sm)] ds:py-[var(--spacing-xs)]',\n 'ds:min-h-8',\n 'ds:data-[active=true]:bg-[var(--violet-50)]',\n 'ds:[.theme-dark_&]:data-[active=true]:bg-[color-mix(in_oklab,var(--violet-700)_35%,transparent)]',\n].join(' ');\n\nconst rowMainClass = 'ds:flex ds:items-center ds:gap-[var(--spacing-sm)]';\n\nconst rowLabelClass =\n 'ds:flex-1 ds:truncate ds:text-[length:var(--font-size-sm)] ds:font-[var(--font-weight-medium)]';\n\nconst rowKeyClass = [\n 'ds:font-[family-name:var(--font-mono)] ds:text-[length:var(--font-size-2xs)]',\n 'ds:text-[color:var(--muted-foreground)]',\n 'ds:bg-[var(--muted)] ds:rounded-[var(--radius-sm)]',\n 'ds:px-[var(--spacing-2xs)] ds:py-[0.0625rem]',\n 'ds:whitespace-nowrap',\n 'ds:group-data-[active=true]:bg-[var(--violet-100)]',\n 'ds:group-data-[active=true]:text-[color:var(--violet-700)]',\n 'ds:[.theme-dark_&]:group-data-[active=true]:bg-[color-mix(in_oklab,var(--violet-800)_55%,transparent)]',\n 'ds:[.theme-dark_&]:group-data-[active=true]:text-[color:var(--violet-100)]',\n].join(' ');\n\nconst emptyClass = [\n 'ds:px-[var(--spacing-md)] ds:py-[var(--spacing-lg)] ds:text-center',\n 'ds:text-[length:var(--font-size-sm)] ds:text-[color:var(--muted-foreground)]',\n].join(' ');\n\nconst footerClass = [\n 'ds:flex ds:flex-wrap ds:items-center ds:gap-[var(--spacing-md)]',\n 'ds:px-[var(--spacing-md)] ds:py-[var(--spacing-xs)]',\n 'ds:border-t ds:border-[color:var(--border)]',\n 'ds:bg-[var(--muted)]/40',\n 'ds:text-[length:var(--font-size-2xs)] ds:text-[color:var(--muted-foreground)]',\n].join(' ');\n\nconst kbdClass = [\n 'ds:font-[family-name:var(--font-mono)] ds:text-[length:var(--font-size-2xs)]',\n 'ds:border ds:border-[color:var(--border)] ds:border-b-2',\n 'ds:rounded-[var(--radius-sm)] ds:px-[var(--spacing-2xs)]',\n 'ds:bg-[var(--background)]',\n].join(' ');\n\n/* ------------------------------------------------------------------ */\n/* Component */\n/* ------------------------------------------------------------------ */\n\nexport const VariablesMenu = forwardRef<\n VariablesMenuHandle,\n VariablesMenuProps\n>(function VariablesMenu(\n {\n id,\n className,\n variables,\n recentTokens,\n query,\n onQueryChange,\n onSelect,\n onClose,\n searchFocusable = true,\n 'aria-label': ariaLabel,\n onActiveDescendantChange,\n },\n ref,\n) {\n const { t } = useTranslation();\n const inputRef = useRef<HTMLInputElement>(null);\n // A per-instance fallback so two unlabelled menus (the toolbar mounts one\n // inline and one in its responsive overflow) never share list/option ids —\n // `aria-activedescendant` would otherwise target an ambiguous element.\n // useId()'s colons are valid in an HTML id but awkward to eyeball in the\n // DOM inspector, so they're stripped for a cleaner generated id; the\n // explicit `id` prop always wins when supplied.\n const generatedId = useId().replace(/:/g, '');\n const listId = `${id ?? `variables-menu-${generatedId}`}-list`;\n\n const byToken = useMemo(() => {\n const map = new Map<string, VariablesMenuVariable>();\n variables.forEach((v) => map.set(v.token, v));\n return map;\n }, [variables]);\n\n const groups = useMemo<RenderGroup[]>(() => {\n const out: RenderGroup[] = [];\n\n if (recentTokens && recentTokens.length > 0) {\n const recentItems: FlatItem[] = recentTokens\n .slice(0, 3)\n .map((token) => byToken.get(token))\n .filter((v): v is VariablesMenuVariable => Boolean(v))\n .filter((v) => matches(v, query))\n .map((v) => ({\n key: `recent-${v.token}`,\n group: 'recent',\n variable: v,\n }));\n if (recentItems.length > 0) {\n out.push({\n key: 'recent',\n labelKey: 'editor.variables.recent',\n defaultLabel: 'Recent',\n items: recentItems,\n });\n }\n }\n\n const byGroupKey = new Map<VariablesMenuGroup | 'other', FlatItem[]>();\n variables.forEach((variable) => {\n if (!matches(variable, query)) return;\n const key =\n variable.group &&\n GROUP_ORDER.includes(variable.group as VariablesMenuGroup)\n ? (variable.group as VariablesMenuGroup)\n : 'other';\n const list = byGroupKey.get(key) ?? [];\n list.push({ key: `${key}-${variable.token}`, group: key, variable });\n byGroupKey.set(key, list);\n });\n\n [...GROUP_ORDER, 'other' as const].forEach((key) => {\n const items = byGroupKey.get(key);\n if (items && items.length > 0) {\n out.push({\n key,\n labelKey: GROUP_LABEL_KEYS[key],\n defaultLabel: GROUP_LABEL_DEFAULTS[key],\n items,\n });\n }\n });\n\n return out;\n }, [variables, recentTokens, query, byToken]);\n\n const flat = useMemo(() => groups.flatMap((g) => g.items), [groups]);\n\n // The active row's TOKEN is the source of truth, not its index — a\n // filtered/re-grouped `flat` reshuffles positions on every keystroke, so a\n // stored index would silently point at an unrelated row (see the query-\n // change behaviour below). The index is derived fresh on every render:\n // if the previously active token is still visible, it stays active at its\n // new position; otherwise the first visible result becomes active, same\n // as the mock and every other combobox in the kit.\n const [activeToken, setActiveToken] = useState<string | null>(null);\n const activeIndex = useMemo(() => {\n if (activeToken !== null) {\n const preserved = flat.findIndex(\n (item) => item.variable.token === activeToken,\n );\n if (preserved !== -1) return preserved;\n }\n return 0;\n }, [activeToken, flat]);\n\n const setActiveIndex = (index: number): void => {\n setActiveToken(flat[index]?.variable.token ?? null);\n };\n\n const move = (delta: number): void => {\n if (flat.length === 0) return;\n setActiveIndex((activeIndex + delta + flat.length) % flat.length);\n };\n\n const selectActive = (): boolean => {\n const active = flat[activeIndex];\n if (!active) return false;\n onSelect(active.variable);\n onClose('select');\n return true;\n };\n\n const handleKeyDown = (\n event: ReactKeyboardEvent | KeyboardEvent,\n ): boolean => {\n switch (event.key) {\n case 'ArrowDown':\n event.preventDefault();\n move(1);\n return true;\n case 'ArrowUp':\n event.preventDefault();\n move(-1);\n return true;\n case 'Home':\n event.preventDefault();\n setActiveIndex(0);\n return true;\n case 'End':\n event.preventDefault();\n setActiveIndex(Math.max(0, flat.length - 1));\n return true;\n case 'Enter':\n event.preventDefault();\n return selectActive();\n case 'Escape':\n event.preventDefault();\n onClose('escape');\n return true;\n default:\n return false;\n }\n };\n\n // No deps array: handleKeyDown closes over flat/activeIndex/onSelect/onClose,\n // which change often, and the handle object itself is cheap to recreate.\n useImperativeHandle(ref, () => ({\n handleKeyDown,\n focusSearch: () => inputRef.current?.focus(),\n }));\n\n // Agent handle — refs mirror state for fresh reads from the memoized handle.\n const agentQueryRef = useRef(query);\n agentQueryRef.current = query;\n const agentFlatRef = useRef(flat);\n agentFlatRef.current = flat;\n const agentHandle = useMemo(\n () => ({\n getQuery: () => agentQueryRef.current,\n getVisibleTokens: () => agentFlatRef.current.map((i) => i.variable.token),\n selectToken: (token: string) => {\n const item = agentFlatRef.current.find(\n (i) => i.variable.token === token,\n );\n if (item) {\n onSelect(item.variable);\n onClose('select');\n }\n },\n close: () => onClose('escape'),\n }),\n [onSelect, onClose],\n );\n useAgentRegistration(variablesMenuAgent, agentHandle, id);\n\n const activeItem = flat[activeIndex];\n const activeId = activeItem ? `${listId}-${activeItem.key}` : undefined;\n\n useEffect(() => {\n onActiveDescendantChange?.(activeId);\n // Only the id itself matters to the host; the callback identity is\n // intentionally excluded so an inline arrow function doesn't retrigger.\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, [activeId]);\n\n return (\n <div\n id={id}\n data-component=\"variables-menu\"\n data-component-id={id}\n className={[rootClass, className].filter(Boolean).join(' ')}\n >\n {searchFocusable ? (\n <div className={searchRowClass}>\n <Search\n aria-hidden=\"true\"\n className=\"ds:size-3.5 ds:shrink-0 ds:text-[color:var(--muted-foreground)]\"\n />\n <input\n ref={inputRef}\n role=\"combobox\"\n aria-expanded=\"true\"\n aria-controls={listId}\n aria-activedescendant={activeId}\n aria-autocomplete=\"list\"\n aria-label={\n ariaLabel ?? t('editor.variables.menuLabel', 'Variables')\n }\n placeholder={t('editor.variables.search', 'Search variables…')}\n value={query}\n onChange={(event) => onQueryChange(event.target.value)}\n onKeyDown={handleKeyDown}\n autoComplete=\"off\"\n className={searchInputClass}\n />\n </div>\n ) : null}\n <div\n id={listId}\n role=\"listbox\"\n aria-label={ariaLabel ?? t('editor.variables.menuLabel', 'Variables')}\n className={listClass}\n >\n {flat.length === 0 ? (\n <div className={emptyClass}>\n {t('editor.variables.empty', {\n query,\n defaultValue: 'No variables match \"{{query}}\"',\n })}\n </div>\n ) : (\n groups.map((group) => {\n const headingId = `${listId}-${group.key}-heading`;\n return (\n <div key={group.key} role=\"group\" aria-labelledby={headingId}>\n <div id={headingId} className={groupHeadingClass}>\n {GROUP_ICONS[group.key]}\n <span>{t(group.labelKey, group.defaultLabel)}</span>\n </div>\n {group.items.map((item) => {\n const index = flat.indexOf(item);\n const active = index === activeIndex;\n return (\n <div\n key={item.key}\n id={`${listId}-${item.key}`}\n role=\"option\"\n aria-selected={active}\n tabIndex={-1}\n data-active={active}\n data-variable-token={item.variable.token}\n className={rowClass}\n onMouseDown={(event) => {\n // Keep focus wherever it already is (the search\n // input in button mode, the editor in caret mode).\n event.preventDefault();\n setActiveIndex(index);\n onSelect(item.variable);\n onClose('select');\n }}\n onMouseMove={() => {\n if (activeIndex !== index) setActiveIndex(index);\n }}\n >\n <div className={rowMainClass}>\n <span className={rowLabelClass}>\n {item.variable.label}\n </span>\n <span\n className={rowKeyClass}\n >{`[[${item.variable.token}]]`}</span>\n </div>\n </div>\n );\n })}\n </div>\n );\n })\n )}\n </div>\n <div className={footerClass}>\n <span className=\"ds:inline-flex ds:items-center ds:gap-[var(--spacing-2xs)]\">\n <kbd className={kbdClass}>↑↓</kbd>\n {t('editor.variables.footer.navigate', 'navigate')}\n </span>\n <span className=\"ds:inline-flex ds:items-center ds:gap-[var(--spacing-2xs)]\">\n <kbd className={kbdClass}>↵</kbd>\n {t('editor.variables.footer.insert', 'insert')}\n </span>\n <span className=\"ds:inline-flex ds:items-center ds:gap-[var(--spacing-2xs)]\">\n <kbd className={kbdClass}>esc</kbd>\n {t('editor.variables.footer.close', 'close')}\n </span>\n </div>\n </div>\n );\n});\nVariablesMenu.displayName = 'VariablesMenu';\n"],"names":["__iconNode","History","createLucideIcon","variablesMenuAgent","handle","args","GROUP_ORDER","GROUP_ICONS","jsx","User","CalendarDays","Building2","UserCog","FileText","matches","variable","query","trimmed","q","normalizeDiacritics","qAsToken","token","GROUP_LABEL_KEYS","GROUP_LABEL_DEFAULTS","rootClass","searchRowClass","searchInputClass","listClass","groupHeadingClass","rowClass","rowMainClass","rowLabelClass","rowKeyClass","emptyClass","footerClass","kbdClass","VariablesMenu","forwardRef","id","className","variables","recentTokens","onQueryChange","onSelect","onClose","searchFocusable","ariaLabel","onActiveDescendantChange","ref","t","useTranslation","inputRef","useRef","generatedId","useId","listId","byToken","useMemo","map","v","groups","out","recentItems","byGroupKey","key","list","items","flat","g","activeToken","setActiveToken","useState","activeIndex","preserved","item","setActiveIndex","index","_a","move","delta","selectActive","active","handleKeyDown","event","useImperativeHandle","agentQueryRef","agentFlatRef","agentHandle","i","useAgentRegistration","activeItem","activeId","useEffect","jsxs","Search","group","headingId"],"mappings":";;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AASA,MAAMA,KAAa;AAAA,EACjB,CAAC,QAAQ,EAAE,GAAG,qDAAqD,KAAK,SAAQ,CAAE;AAAA,EAClF,CAAC,QAAQ,EAAE,GAAG,YAAY,KAAK,SAAQ,CAAE;AAAA,EACzC,CAAC,QAAQ,EAAE,GAAG,eAAe,KAAK,SAAQ,CAAE;AAC9C,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