@alfadocs/ui-kit 1.40.0 → 1.41.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (101) hide show
  1. package/dist/_chunks/arrow-left-BfaGqVam.js +15 -0
  2. package/dist/_chunks/{calendar-workspace-SN23GsXX.js → calendar-workspace-UllCER2k.js} +18 -17
  3. package/dist/_chunks/{contact-profile-card-Zt6WNg1u.js → contact-profile-card-C0WpwpVV.js} +38 -33
  4. package/dist/_chunks/editor-overlay-DwNKaI22.js +93 -0
  5. package/dist/_chunks/format-price-DAbh61Lz.js +51 -0
  6. package/dist/_chunks/help-me-write-templates-GB70jnV9.js +764 -0
  7. package/dist/_chunks/{marketplace-app-shell-d2EtcUbe.js → marketplace-app-shell-D_g9BaDI.js} +2 -2
  8. package/dist/_chunks/{money-BY-HmKhZ.js → money-BXLBIRVO.js} +2 -2
  9. package/dist/_chunks/{notes-panel-CmTqIWlS.js → notes-panel-_diLt8Cj.js} +2 -2
  10. package/dist/_chunks/{panel-subview-Cc2Wtt7D.js → panel-subview-PMBRPFOa.js} +49 -59
  11. package/dist/_chunks/{practice-results-D_jjzwgf.js → practice-results-D11Zpt27.js} +50 -45
  12. package/dist/_chunks/rich-text-editor-D7AKKAQ2.js +3119 -0
  13. package/dist/_chunks/{sidebar-C-Gr2LL-.js → sidebar-ClTY9lLI.js} +160 -169
  14. package/dist/_chunks/{treatment-receipt-dUm99mdn.js → treatment-receipt-DU0OewqH.js} +2 -2
  15. package/dist/_chunks/trending-up-C_luYBzS.js +15 -0
  16. package/dist/_chunks/wand-sparkles-DAjKyhz7.js +27 -0
  17. package/dist/agent-catalog.json +87 -1
  18. package/dist/agent-i18n/en.json +7 -0
  19. package/dist/components/_shared/format-price.d.ts +6 -0
  20. package/dist/components/_shared/index.d.ts +1 -1
  21. package/dist/components/contact-profile-card/contact-profile-card.d.ts +2 -2
  22. package/dist/components/contact-profile-card/index.js +1 -1
  23. package/dist/components/editor-overlay/index.js +1 -1
  24. package/dist/components/index.d.ts +1 -0
  25. package/dist/components/money/index.js +1 -1
  26. package/dist/components/notes-panel/index.js +1 -1
  27. package/dist/components/panel-subview/index.js +1 -1
  28. package/dist/components/practice-results/index.js +1 -1
  29. package/dist/components/practice-results/practice-results.d.ts +2 -1
  30. package/dist/components/rich-text-editor/editor-toolbar.d.ts +6 -1
  31. package/dist/components/rich-text-editor/index.d.ts +1 -1
  32. package/dist/components/rich-text-editor/index.js +1 -1
  33. package/dist/components/rich-text-editor/rich-text-editor.d.ts +74 -0
  34. package/dist/components/sidebar/index.js +1 -1
  35. package/dist/components/treatment-receipt/index.js +1 -1
  36. package/dist/host-compat.css +13 -1
  37. package/dist/i18n/locales/ar.d.ts +79 -0
  38. package/dist/i18n/locales/ar.js +80 -1
  39. package/dist/i18n/locales/de.d.ts +79 -0
  40. package/dist/i18n/locales/de.js +80 -1
  41. package/dist/i18n/locales/el.d.ts +79 -0
  42. package/dist/i18n/locales/el.js +80 -1
  43. package/dist/i18n/locales/en.d.ts +79 -0
  44. package/dist/i18n/locales/en.js +80 -1
  45. package/dist/i18n/locales/es.d.ts +79 -0
  46. package/dist/i18n/locales/es.js +80 -1
  47. package/dist/i18n/locales/fr.d.ts +79 -0
  48. package/dist/i18n/locales/fr.js +80 -1
  49. package/dist/i18n/locales/hi.d.ts +79 -0
  50. package/dist/i18n/locales/hi.js +80 -1
  51. package/dist/i18n/locales/it.d.ts +79 -0
  52. package/dist/i18n/locales/it.js +80 -1
  53. package/dist/i18n/locales/ja.d.ts +79 -0
  54. package/dist/i18n/locales/ja.js +80 -1
  55. package/dist/i18n/locales/nl.d.ts +79 -0
  56. package/dist/i18n/locales/nl.js +80 -1
  57. package/dist/i18n/locales/pl.d.ts +79 -0
  58. package/dist/i18n/locales/pl.js +80 -1
  59. package/dist/i18n/locales/pt.d.ts +79 -0
  60. package/dist/i18n/locales/pt.js +80 -1
  61. package/dist/i18n/locales/ro.d.ts +79 -0
  62. package/dist/i18n/locales/ro.js +80 -1
  63. package/dist/i18n/locales/ru.d.ts +79 -0
  64. package/dist/i18n/locales/ru.js +80 -1
  65. package/dist/i18n/locales/sq.d.ts +79 -0
  66. package/dist/i18n/locales/sq.js +80 -1
  67. package/dist/i18n/locales/sv.d.ts +79 -0
  68. package/dist/i18n/locales/sv.js +80 -1
  69. package/dist/i18n/locales/tr.d.ts +79 -0
  70. package/dist/i18n/locales/tr.js +80 -1
  71. package/dist/i18n/locales/zh.d.ts +79 -0
  72. package/dist/i18n/locales/zh.js +80 -1
  73. package/dist/index.js +141 -134
  74. package/dist/locales/ar.json +80 -1
  75. package/dist/locales/de.json +80 -1
  76. package/dist/locales/el.json +80 -1
  77. package/dist/locales/en.json +80 -1
  78. package/dist/locales/es.json +80 -1
  79. package/dist/locales/fr.json +80 -1
  80. package/dist/locales/hi.json +80 -1
  81. package/dist/locales/it.json +80 -1
  82. package/dist/locales/ja.json +80 -1
  83. package/dist/locales/nl.json +80 -1
  84. package/dist/locales/pl.json +80 -1
  85. package/dist/locales/pt.json +80 -1
  86. package/dist/locales/ro.json +80 -1
  87. package/dist/locales/ru.json +80 -1
  88. package/dist/locales/sq.json +80 -1
  89. package/dist/locales/sv.json +80 -1
  90. package/dist/locales/tr.json +80 -1
  91. package/dist/locales/zh.json +80 -1
  92. package/dist/patterns/calendar/index.js +1 -1
  93. package/dist/patterns/help-me-write-templates/help-me-write-templates.d.ts +164 -0
  94. package/dist/patterns/help-me-write-templates/index.d.ts +3 -0
  95. package/dist/patterns/help-me-write-templates/index.js +10 -0
  96. package/dist/patterns/marketplace-app-shell/index.js +1 -1
  97. package/dist/tokens.css +51 -42
  98. package/package.json +5 -1
  99. package/dist/_chunks/editor-overlay-9tcPXNWt.js +0 -89
  100. package/dist/_chunks/format-price-BkMEbeW3.js +0 -47
  101. package/dist/_chunks/rich-text-editor-BJ1-Lkao.js +0 -2719
@@ -3,7 +3,7 @@ import { forwardRef as R, useRef as j } from "react";
3
3
  import { c as g } from "./index-D2ZczOXr.js";
4
4
  import { useTranslation as L } from "react-i18next";
5
5
  import { B as f } from "./badge-BudgzTe_.js";
6
- import { M as u } from "./money-BY-HmKhZ.js";
6
+ import { M as u } from "./money-BXLBIRVO.js";
7
7
  import { C as z, S as h } from "./skeleton-B1KTdJ4N.js";
8
8
  import { T as S } from "./tag-Ci3xJPcH.js";
9
9
  const v = "type-label ds:text-[color:var(--muted-foreground)]", x = g(
@@ -157,4 +157,4 @@ E.displayName = "TreatmentReceipt";
157
157
  export {
158
158
  E as T
159
159
  };
160
- //# sourceMappingURL=treatment-receipt-dUm99mdn.js.map
160
+ //# sourceMappingURL=treatment-receipt-DU0OewqH.js.map
@@ -0,0 +1,15 @@
1
+ import { c as e } 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: "M16 7h6v6", key: "box55l" }],
10
+ ["path", { d: "m22 7-8.5 8.5-5-5L2 17", key: "1t1m79" }]
11
+ ], n = e("trending-up", o);
12
+ export {
13
+ n as T
14
+ };
15
+ //# sourceMappingURL=trending-up-C_luYBzS.js.map
@@ -0,0 +1,27 @@
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 e = [
9
+ [
10
+ "path",
11
+ {
12
+ d: "m21.64 3.64-1.28-1.28a1.21 1.21 0 0 0-1.72 0L2.36 18.64a1.21 1.21 0 0 0 0 1.72l1.28 1.28a1.2 1.2 0 0 0 1.72 0L21.64 5.36a1.2 1.2 0 0 0 0-1.72",
13
+ key: "ul74o6"
14
+ }
15
+ ],
16
+ ["path", { d: "m14 7 3 3", key: "1r5n42" }],
17
+ ["path", { d: "M5 6v4", key: "ilb8ba" }],
18
+ ["path", { d: "M19 14v4", key: "blhpug" }],
19
+ ["path", { d: "M10 2v2", key: "7u0qdc" }],
20
+ ["path", { d: "M7 8H3", key: "zfb6yr" }],
21
+ ["path", { d: "M21 16h-4", key: "1cnmox" }],
22
+ ["path", { d: "M11 3H9", key: "1obp7u" }]
23
+ ], d = a("wand-sparkles", e);
24
+ export {
25
+ d as W
26
+ };
27
+ //# sourceMappingURL=wand-sparkles-DAjKyhz7.js.map
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "schemaVersion": 1,
3
- "packageVersion": "1.40.0",
3
+ "packageVersion": "1.41.0",
4
4
  "components": [
5
5
  {
6
6
  "kind": "component",
@@ -18564,6 +18564,92 @@
18564
18564
  }
18565
18565
  ]
18566
18566
  },
18567
+ {
18568
+ "kind": "pattern",
18569
+ "id": "help-me-write-templates",
18570
+ "composes": [
18571
+ {
18572
+ "component": "rich-text-editor",
18573
+ "as": "editor"
18574
+ },
18575
+ {
18576
+ "component": "editor-overlay",
18577
+ "as": "assistantBar"
18578
+ },
18579
+ {
18580
+ "component": "text-area",
18581
+ "as": "prompt"
18582
+ },
18583
+ {
18584
+ "component": "dropdown-menu",
18585
+ "as": "templatesMenu",
18586
+ "entity": "template"
18587
+ },
18588
+ {
18589
+ "component": "dialog",
18590
+ "as": "templateManager",
18591
+ "entity": "template"
18592
+ },
18593
+ {
18594
+ "component": "dialog",
18595
+ "as": "deleteConfirmation",
18596
+ "entity": "template"
18597
+ },
18598
+ {
18599
+ "component": "alert",
18600
+ "as": "creditsExhausted"
18601
+ },
18602
+ {
18603
+ "component": "alert",
18604
+ "as": "undoNotice"
18605
+ }
18606
+ ],
18607
+ "workflows": [
18608
+ {
18609
+ "name": "run_template",
18610
+ "safety": "phi",
18611
+ "description": "Open the Alia Writing Assistant from the editor's AI pill, open the Templates menu (default template first) and pick a template. It rewrites the selected text, or the whole note when nothing is selected; the draft shows beside the note. Replace swaps the source for the draft, Insert below keeps it and adds the draft after it; the notice that follows offers Undo. Any text typed in the prompt first goes along as extra instructions. Out of AI credits shows a notice instead of a draft.",
18612
+ "descriptionKey": "ui.agent.helpMeWriteTemplates.workflows.runTemplate",
18613
+ "uiActions": [
18614
+ "dropdown-menu.open",
18615
+ "dropdown-menu.close"
18616
+ ],
18617
+ "stateReads": [
18618
+ "dropdown-menu.isOpen"
18619
+ ],
18620
+ "apiActions": [
18621
+ "aiTemplate.generate"
18622
+ ]
18623
+ },
18624
+ {
18625
+ "name": "free_prompt",
18626
+ "safety": "phi",
18627
+ "description": "Type (or dictate with the bar mic) what to write and press Write; the draft is inserted at the caret on Insert.",
18628
+ "descriptionKey": "ui.agent.helpMeWriteTemplates.workflows.freePrompt",
18629
+ "uiActions": [],
18630
+ "apiActions": [
18631
+ "aiTemplate.generate"
18632
+ ]
18633
+ },
18634
+ {
18635
+ "name": "manage_templates",
18636
+ "safety": "write",
18637
+ "description": "Open Manage templates from the Templates menu: list the practice's templates, create or edit one (name, optional short description, instructions for the AI, use as default; names are unique) and delete one after a confirmation. Shown only when the host allows managing.",
18638
+ "descriptionKey": "ui.agent.helpMeWriteTemplates.workflows.manageTemplates",
18639
+ "uiActions": [
18640
+ "dialog.close",
18641
+ "dialog.dismiss"
18642
+ ],
18643
+ "stateReads": [
18644
+ "dialog.isOpen"
18645
+ ],
18646
+ "apiActions": [
18647
+ "aiTemplate.save",
18648
+ "aiTemplate.delete"
18649
+ ]
18650
+ }
18651
+ ]
18652
+ },
18567
18653
  {
18568
18654
  "kind": "pattern",
18569
18655
  "id": "invoices",
@@ -1741,6 +1741,13 @@
1741
1741
  "reviewEfficiency": "Read the Studio efficiency gauge and open the settings checklist to complete the remaining configuration steps."
1742
1742
  }
1743
1743
  },
1744
+ "helpMeWriteTemplates": {
1745
+ "workflows": {
1746
+ "runTemplate": "Open the Alia Writing Assistant from the editor's AI pill, open the Templates menu (default template first) and pick a template. It rewrites the selected text, or the whole note when nothing is selected; the draft shows beside the note. Replace swaps the source for the draft, Insert below keeps it and adds the draft after it; the notice that follows offers Undo. Any text typed in the prompt first goes along as extra instructions. Out of AI credits shows a notice instead of a draft.",
1747
+ "freePrompt": "Type (or dictate with the bar mic) what to write and press Write; the draft is inserted at the caret on Insert.",
1748
+ "manageTemplates": "Open Manage templates from the Templates menu: list the practice's templates, create or edit one (name, optional short description, instructions for the AI, use as default; names are unique) and delete one after a confirmation. Shown only when the host allows managing."
1749
+ }
1750
+ },
1744
1751
  "invoices": {
1745
1752
  "workflows": {
1746
1753
  "filterInvoices": "Narrow the ledger by number, relation, status, date range or amount using the per-column filters.",
@@ -18,6 +18,12 @@
18
18
  * behaviour differs.
19
19
  */
20
20
  export declare function formatPrice(minorUnits: number, currency: string, locale: string): string;
21
+ /**
22
+ * A first-visit price caption: `0` means the visit is free, so it reads as
23
+ * the caller's translated word ("Free" / "Gratuito"), never as "€0.00".
24
+ * Any other amount goes through {@link formatPrice} unchanged.
25
+ */
26
+ export declare function formatPriceOrFree(minorUnits: number, currency: string, locale: string, freeLabel: string): string;
21
27
  /**
22
28
  * The same amount as {@link formatPrice}, but broken into its typed parts so
23
29
  * a renderer can treat the fraction differently from the rest.
@@ -8,7 +8,7 @@ export { computeDueDate, trimesterForWeeks, gestationalMilestones, trimesterHigh
8
8
  export { computeAntenatalSchedule, type AntenatalEvent, type ResolvedAntenatalEvent, type AntenatalScheduleOptions, type AntenatalCategory, type AntenatalStatus, type AntenatalCondition, type ScheduleLocale, type GdmRisk, } from './antenatal-schedule';
9
9
  export { AntenatalScheduleTimeline, type AntenatalScheduleTimelineProps, } from './antenatal-schedule-timeline';
10
10
  export { InsertButton, buildResultText, buildResultHtml, buildResultCardSvg, svgCardToPngDataUri, svgCardToPng, type InsertButtonProps, type InsertVariant, type InsertPayload, type InsertPngResult, type InsertMode, type InsertCardData, type InsertCardField, type InsertCardGauge, type SvgCardToPngOptions, } from './insert-result';
11
- export { formatPrice } from './format-price';
11
+ export { formatPrice, formatPriceOrFree } from './format-price';
12
12
  export { normalizeDiacritics } from './normalize-diacritics';
13
13
  export { useDebouncedCallback } from './use-debounced-callback';
14
14
  export { useFocusTrap, type UseFocusTrapOptions } from './use-focus-trap';
@@ -93,8 +93,8 @@ export interface ContactProfileCardProps extends Omit<ComponentPropsWithoutRef<'
93
93
  insurances?: string[];
94
94
  /**
95
95
  * First-visit price in the smallest currency unit (cents / centesimi).
96
- * Formatted via `Intl.NumberFormat`. Omit when the consumer doesn't
97
- * want to show the price.
96
+ * Formatted via `Intl.NumberFormat`; `0` renders the translated word
97
+ * "Free". Omit when the consumer doesn't want to show the price.
98
98
  */
99
99
  firstVisitPriceCents?: number;
100
100
  /** ISO-4217 currency code for the price formatter. Defaults to `EUR`. */
@@ -1,4 +1,4 @@
1
- import { C as _, a as O, b as o, c as r } from "../../_chunks/contact-profile-card-Zt6WNg1u.js";
1
+ import { C as _, a as O, b as o, c as r } from "../../_chunks/contact-profile-card-C0WpwpVV.js";
2
2
  export {
3
3
  _ as CONTACT_PROFILE_CARD_ROW_ICONS,
4
4
  O as CONTACT_PROFILE_CARD_ROW_KEYS,
@@ -1,4 +1,4 @@
1
- import { E as a } from "../../_chunks/editor-overlay-9tcPXNWt.js";
1
+ import { E as a } from "../../_chunks/editor-overlay-DwNKaI22.js";
2
2
  export {
3
3
  a as EditorOverlay
4
4
  };
@@ -215,6 +215,7 @@ export * from './workflow';
215
215
  export * from '../patterns/alia-assistant';
216
216
  export * from '../patterns/anamnesis';
217
217
  export * from '../patterns/calendar';
218
+ export * from '../patterns/help-me-write-templates';
218
219
  export * from '../patterns/marketplace-app-shell';
219
220
  export * from '../patterns/payment-automation-upsell';
220
221
  export * from '../patterns/signature-request';
@@ -1,4 +1,4 @@
1
- import { M as m } from "../../_chunks/money-BY-HmKhZ.js";
1
+ import { M as m } from "../../_chunks/money-BXLBIRVO.js";
2
2
  import { m as n } from "../../_chunks/money.agent-BjJ6gOkx.js";
3
3
  export {
4
4
  m as Money,
@@ -1,4 +1,4 @@
1
- import { N as a } from "../../_chunks/notes-panel-CmTqIWlS.js";
1
+ import { N as a } from "../../_chunks/notes-panel-_diLt8Cj.js";
2
2
  export {
3
3
  a as NotesPanel
4
4
  };
@@ -1,4 +1,4 @@
1
- import { P as o } from "../../_chunks/panel-subview-Cc2Wtt7D.js";
1
+ import { P as o } from "../../_chunks/panel-subview-PMBRPFOa.js";
2
2
  import { p as r } from "../../_chunks/panel-subview.agent-BIBvE-IW.js";
3
3
  export {
4
4
  o as PanelSubview,
@@ -1,4 +1,4 @@
1
- import { P as t, p as a } from "../../_chunks/practice-results-D_jjzwgf.js";
1
+ import { P as t, p as a } from "../../_chunks/practice-results-D11Zpt27.js";
2
2
  export {
3
3
  t as PracticeResults,
4
4
  a as practiceResultsAgent
@@ -85,7 +85,8 @@ export interface PracticeResult {
85
85
  * `ContactProfileCard.firstVisitPriceCents` — the KIT formats, the
86
86
  * consumer never hands over a pre-rendered string.
87
87
  *
88
- * `0` is a real value meaning "free" and renders as such. Omit the
88
+ * `0` is a real value meaning "free" and renders the translated word
89
+ * "Free" (`common.freeOfCharge`), never a zero amount. Omit the
89
90
  * field (or pass `undefined`) when the practice has not set a price —
90
91
  * the row then disappears completely. Added for HTP-6136.
91
92
  */
@@ -1,4 +1,5 @@
1
1
  import { type RefObject } from 'react';
2
+ import type { RichTextEditorVariable } from './rich-text-editor';
2
3
  export type EditorToolbarPreset = 'minimal' | 'standard' | 'full';
3
4
  export interface EditorToolbarProps {
4
5
  /** Dispatch a Redactor command (and refresh active state). */
@@ -30,6 +31,10 @@ export interface EditorToolbarProps {
30
31
  * wired to a menu.
31
32
  */
32
33
  showExtensions?: boolean;
34
+ /** Template variables for the "Insert variable" menu (hidden when empty). */
35
+ variables?: RichTextEditorVariable[];
36
+ /** Insert a variable chip at the saved caret. */
37
+ insertVariable?: (token: string) => void;
33
38
  }
34
39
  export interface TableFloatingToolbarProps {
35
40
  active: ReadonlySet<string>;
@@ -63,5 +68,5 @@ export interface ImageFloatingToolbarProps {
63
68
  setImageWidth: (pct: number) => void;
64
69
  }
65
70
  export declare function ImageFloatingToolbar({ areaRef, activeImageEl: img, applyImageClass, setImageWidth, }: ImageFloatingToolbarProps): React.JSX.Element | null;
66
- export declare function EditorToolbar({ run, active, preset, insertHtml, insertTable, saveSelection, restoreSelection, getSelectedText, uploadImage, enableColor, enableImage, enableTable, showExtensions, }: EditorToolbarProps): React.JSX.Element;
71
+ export declare function EditorToolbar({ run, active, preset, insertHtml, insertTable, saveSelection, restoreSelection, getSelectedText, uploadImage, enableColor, enableImage, enableTable, showExtensions, variables, insertVariable, }: EditorToolbarProps): React.JSX.Element;
67
72
  //# sourceMappingURL=editor-toolbar.d.ts.map
@@ -1,4 +1,4 @@
1
1
  export { RichTextEditor, wrapperVariants } from './rich-text-editor';
2
- export type { RichTextEditorHandle, RichTextEditorProps, RichTextEditorToolbar, RedactorFactory, AiConsentGate, } from './rich-text-editor';
2
+ export type { RichTextEditorHandle, RichTextEditorProps, RichTextEditorToolbar, RedactorFactory, AiConsentGate, RichTextEditorVariable, HelpMeWriteRenderContext, } from './rich-text-editor';
3
3
  export { richTextEditorAgent } from './rich-text-editor.agent';
4
4
  //# sourceMappingURL=index.d.ts.map
@@ -1,4 +1,4 @@
1
- import { R as a, r as e, w as i } from "../../_chunks/rich-text-editor-BJ1-Lkao.js";
1
+ import { R as a, r as e, w as i } from "../../_chunks/rich-text-editor-D7AKKAQ2.js";
2
2
  export {
3
3
  a as RichTextEditor,
4
4
  e as richTextEditorAgent,
@@ -36,6 +36,41 @@ export interface AiConsentGate {
36
36
  */
37
37
  onGrant?: () => void | Promise<void>;
38
38
  }
39
+ /** A template variable the toolbar's "Insert variable" menu offers. */
40
+ export interface RichTextEditorVariable {
41
+ /** Inserted as `[[token]]`. Letters, digits and underscores only. */
42
+ token: string;
43
+ /** Human label shown in the menu (translated by the host). */
44
+ label: string;
45
+ /** Optional second line in the menu. */
46
+ description?: string;
47
+ }
48
+ /** What a host's own Help-me-write surface gets from `renderHelpMeWrite`. */
49
+ export interface HelpMeWriteRenderContext {
50
+ /** Whether the surface should show (consent is already granted). */
51
+ open: boolean;
52
+ onClose: () => void;
53
+ /** Text of the selection when the reader opened it; '' for a caret. */
54
+ selectionText: string;
55
+ getHTML: () => string;
56
+ getText: () => string;
57
+ /** Insert at the saved caret, replacing the saved selection if any. */
58
+ insertAtSelection: (html: string) => void;
59
+ /** Insert just after the saved selection (or at the saved caret). */
60
+ insertAfterSelection: (html: string) => void;
61
+ /** Replace the whole document. */
62
+ setContent: (html: string) => void;
63
+ /** The editor's own dictation seam, for a mic inside the surface. */
64
+ onDictate?: RichTextEditorProps['onDictate'];
65
+ /** The kit's privacy notice, including the consent-recorded line. */
66
+ privacyNotice: ReactNode;
67
+ /**
68
+ * Opened because dictation ran out of AI credits (its `onDictate` rejected
69
+ * with an error named `AiCreditsExhaustedError`): show the out-of-credits
70
+ * state rather than the prompt.
71
+ */
72
+ creditsExhausted: boolean;
73
+ }
39
74
  export interface RichTextEditorProps {
40
75
  /** Opaque instance id — emitted as `data-component-id` for the agent registry. */
41
76
  id?: string;
@@ -72,6 +107,12 @@ export interface RichTextEditorProps {
72
107
  lang?: string;
73
108
  /** Consumer image-upload endpoint → Redactor `imageUpload`. Omitted if absent. */
74
109
  imageUploadUrl?: string;
110
+ /**
111
+ * Upload an image yourself (your own API client, auth or storage) and
112
+ * resolve its URL. Wins over `imageUploadUrl` for the toolbar's image
113
+ * dialog; either one shows the insert-image control.
114
+ */
115
+ onUploadImage?: (file: File, signal?: AbortSignal) => Promise<string>;
75
116
  /** App keyboard-shortcut seam (e.g. Ctrl/Cmd+Enter to save). */
76
117
  onKeyDown?: (event: KeyboardEvent) => void;
77
118
  /**
@@ -130,6 +171,39 @@ export interface RichTextEditorProps {
130
171
  html: string;
131
172
  signal: AbortSignal;
132
173
  }) => Promise<string>;
174
+ /**
175
+ * Template variables. When provided, the toolbar gains an "Insert variable"
176
+ * menu that inserts `[[TOKEN]]` as a chip (Redactor's native `variable`
177
+ * component, the same markup as platform's plugin). Bare `[[TOKEN]]` text
178
+ * for these tokens in inbound content renders as a chip too.
179
+ */
180
+ variables?: RichTextEditorVariable[];
181
+ /**
182
+ * Decide whether a `[[TOKEN]]` is valid. Default: it is one of `variables`
183
+ * (any letter case). Invalid tokens render as error chips with a message
184
+ * under the editor, and are reported through `onVariableValidityChange`.
185
+ */
186
+ validateVariable?: (token: string) => boolean;
187
+ /**
188
+ * The invalid `[[TOKEN]]`s in the document, each once, whenever that set
189
+ * changes (`[]` when all are valid). Use it to block saving.
190
+ */
191
+ onVariableValidityChange?: (invalidTokens: string[]) => void;
192
+ /**
193
+ * Bring your own Help-me-write surface (e.g. with practice templates). The
194
+ * kit keeps the FAB segment, the consent gate and resume-after-grant, and
195
+ * calls this instead of rendering its own overlay. Render an
196
+ * `EditorOverlay` from it to dock in the same slot. Wins over the built-in
197
+ * overlay when both this and `onRequestAiDraft` are set.
198
+ */
199
+ renderHelpMeWrite?: (ctx: HelpMeWriteRenderContext) => ReactNode;
200
+ /**
201
+ * An AI call ran out of credits: `onDictate` rejected with an error named
202
+ * `AiCreditsExhaustedError`. With `renderHelpMeWrite` the kit also opens
203
+ * that surface on its out-of-credits state; without it, the dictation
204
+ * error line shows.
205
+ */
206
+ onAiCreditsExhausted?: () => void;
133
207
  }
134
208
  /** Block/inline formats the editor can toggle via `applyFormat`. */
135
209
  export type EditorFormat = 'bold' | 'italic' | 'strikethrough' | 'bulletedList' | 'numberedList' | 'heading' | 'quote' | 'paragraph';
@@ -1,4 +1,4 @@
1
- import { S as r, a as i, b as s, c as d, d as S, e as b, f as t, g as o, h as m, i as n, j as p, k as l, l as c, m as g, n as u, o as I, p as P, q as f, s as h, u as B } from "../../_chunks/sidebar-C-Gr2LL-.js";
1
+ import { S as r, a as i, b as s, c as d, d as S, e as b, f as t, g as o, h as m, i as n, j as p, k as l, l as c, m as g, n as u, o as I, p as P, q as f, s as h, u as B } from "../../_chunks/sidebar-ClTY9lLI.js";
2
2
  import { u as k } from "../../_chunks/use-persistent-state-nZwZAnE9.js";
3
3
  export {
4
4
  r as Sidebar,
@@ -1,4 +1,4 @@
1
- import { T as r } from "../../_chunks/treatment-receipt-dUm99mdn.js";
1
+ import { T as r } from "../../_chunks/treatment-receipt-DU0OewqH.js";
2
2
  import { t as m } from "../../_chunks/treatment-receipt.agent-bpFm2RPH.js";
3
3
  export {
4
4
  r as TreatmentReceipt,
@@ -205,7 +205,7 @@
205
205
 
206
206
  /* ───────────────────────────────────────────────────────────────────────
207
207
  SECTION B — non-token declarations. ORIGINAL LAYER PRESERVED.
208
- 139 declarations across 135 rules.
208
+ 143 declarations across 139 rules.
209
209
 
210
210
  Kit-authored arbitrary-value utilities (`ds:w-[20rem]`) and the
211
211
  vendored AG Grid rules. These set real properties on real elements,
@@ -523,6 +523,9 @@
523
523
  .ds\:text-\[7rem\] {
524
524
  font-size:112px;
525
525
  }
526
+ .ds\:\[block-size\:14rem\] {
527
+ block-size:224px;
528
+ }
526
529
  .ds\:\[block-size\:44rem\] {
527
530
  block-size:704px;
528
531
  }
@@ -556,6 +559,12 @@
556
559
  .ds\:\[max-block-size\:12rem\] {
557
560
  max-block-size:192px;
558
561
  }
562
+ .ds\:\[max-block-size\:14rem\] {
563
+ max-block-size:224px;
564
+ }
565
+ .ds\:\[max-block-size\:16rem\] {
566
+ max-block-size:256px;
567
+ }
559
568
  .ds\:\[max-inline-size\:6\.5rem\] {
560
569
  max-inline-size:104px;
561
570
  }
@@ -580,6 +589,9 @@
580
589
  .ds\:\[max-inline-size\:48rem\] {
581
590
  max-inline-size:768px;
582
591
  }
592
+ .ds\:\[max-inline-size\:64rem\] {
593
+ max-inline-size:1024px;
594
+ }
583
595
  .ds\:\[min-block-size\:18rem\] {
584
596
  min-block-size:288px;
585
597
  }
@@ -446,6 +446,7 @@ export declare const arUi: {
446
446
  readonly required: "مطلوب";
447
447
  readonly optional: "اختياري";
448
448
  readonly progress_label: "{{percent}} مكتمل";
449
+ readonly freeOfCharge: "مجاني";
449
450
  };
450
451
  readonly buttonGroup: {
451
452
  readonly label: "مجموعة أزرار";
@@ -2794,6 +2795,10 @@ export declare const arUi: {
2794
2795
  };
2795
2796
  readonly heading: "عنوان";
2796
2797
  readonly extensions: "إضافات المحرر";
2798
+ readonly insertVariable: "إدراج متغير";
2799
+ readonly variables: "المتغيرات";
2800
+ readonly variableInvalid: "متغير غير صالح: {{tokens}}. اختر متغيرًا من إدراج متغير.";
2801
+ readonly variableNoMatch: "لا يوجد متغير يطابق «{{query}}»";
2797
2802
  readonly more: "المزيد من الخيارات";
2798
2803
  readonly link: {
2799
2804
  readonly url: "URL";
@@ -3137,6 +3142,80 @@ export declare const arUi: {
3137
3142
  readonly fullscreen: "تبديل وضع ملء الشاشة";
3138
3143
  };
3139
3144
  };
3145
+ readonly helpMeWriteTemplates: {
3146
+ readonly bar: {
3147
+ readonly templatesMenu: "القوالب";
3148
+ readonly templatesGroup: "قوالب العيادة";
3149
+ readonly createFirst: "أنشئ قالبك الأول";
3150
+ readonly manage: "إدارة القوالب";
3151
+ readonly defaultBadge: "افتراضي";
3152
+ readonly prompt: "صف ما تريد كتابته، أو أضف تفاصيل قبل اختيار قالب";
3153
+ readonly write: "اكتب";
3154
+ readonly dictateStart: "أملِ التعليمات";
3155
+ readonly dictateStop: "أوقف الإملاء";
3156
+ readonly listening: "جارٍ الاستماع…";
3157
+ readonly sourceSelection: "تعيد القوالب كتابة النص المحدد.";
3158
+ readonly sourceDocument: "تعيد القوالب كتابة الملاحظة كاملة.";
3159
+ readonly sourceEmpty: "الملاحظة فارغة. أملِ أو اكتب أولًا لاستخدام قالب.";
3160
+ readonly error: "حدث خطأ ما. حاول مرة أخرى.";
3161
+ readonly beforeDocument: "ملاحظتك";
3162
+ readonly beforeSelection: "النص المحدد";
3163
+ readonly after: "المسودة";
3164
+ readonly discard: "تجاهل";
3165
+ readonly retry: "حاول مرة أخرى";
3166
+ readonly replace: "استبدل";
3167
+ readonly insertBelow: "أدرج في الأسفل";
3168
+ readonly insert: "أدرج";
3169
+ readonly close: "إغلاق";
3170
+ };
3171
+ readonly undo: {
3172
+ readonly replaced: "أعيدت كتابة الملاحظة باستخدام «{{name}}».";
3173
+ readonly addedBelow: "أضيفت مسودة «{{name}}» في الأسفل.";
3174
+ readonly undo: "تراجع";
3175
+ };
3176
+ readonly credits: {
3177
+ readonly title: "نفدت أرصدة الذكاء الاصطناعي";
3178
+ readonly body: "أضف أرصدة للمتابعة اليوم.";
3179
+ readonly bodyResets: "يعود رصيدك المجاني في {{date}}. أضف أرصدة للمتابعة اليوم.";
3180
+ readonly bodyWait: "تتوفر مساعدة الذكاء الاصطناعي من جديد عند تجديد رصيدك الشهري.";
3181
+ readonly bodyWaitResets: "تتوفر مساعدة الذكاء الاصطناعي من جديد في {{date}}، عند تجديد رصيدك الشهري.";
3182
+ readonly meterLabel: "أرصدة الذكاء الاصطناعي هذا الشهر";
3183
+ readonly remaining: "تبقّى {{remaining}} من {{limit}}";
3184
+ readonly cta: "اشترِ أرصدة الذكاء الاصطناعي";
3185
+ readonly secondary: "اطّلع على تكلفة كل إجراء";
3186
+ readonly back: "رجوع";
3187
+ readonly kept: "ملاحظتك وتعليماتك محفوظة.";
3188
+ };
3189
+ readonly manager: {
3190
+ readonly title: "قوالب الذكاء الاصطناعي";
3191
+ readonly description: "مشتركة مع جميع أعضاء العيادة. يظهر القالب الافتراضي أولًا.";
3192
+ readonly new: "قالب جديد";
3193
+ readonly done: "تم";
3194
+ readonly listLabel: "القوالب";
3195
+ readonly edit: "تعديل {{name}}";
3196
+ readonly delete: "حذف {{name}}";
3197
+ readonly emptyTitle: "لا توجد قوالب بعد";
3198
+ readonly emptyDescription: "يحوّل القالب الإملاء إلى ملاحظة منظمة بنقرة واحدة.";
3199
+ readonly formNew: "قالب جديد";
3200
+ readonly formEdit: "تعديل القالب";
3201
+ readonly name: "الاسم";
3202
+ readonly namePlaceholder: "مثال: ملاحظة SOAP";
3203
+ readonly descLabel: "وصف قصير";
3204
+ readonly descHint: "يظهر أسفل الاسم في قائمة القوالب.";
3205
+ readonly prompt: "تعليمات للذكاء الاصطناعي";
3206
+ readonly promptDescription: "صف البنية والأقسام والأسلوب الذي تريده. يُضاف نص الملاحظة تلقائيًا.";
3207
+ readonly isDefault: "استخدمه كافتراضي";
3208
+ readonly save: "احفظ القالب";
3209
+ readonly cancel: "إلغاء";
3210
+ readonly saveError: "تعذّر حفظ القالب. حاول مرة أخرى.";
3211
+ readonly nameRequired: "أدخل اسمًا.";
3212
+ readonly nameTaken: "يوجد قالب بهذا الاسم بالفعل.";
3213
+ readonly promptRequired: "أدخل التعليمات.";
3214
+ readonly deleteTitle: "حذف «{{name}}»؟";
3215
+ readonly deleteDescription: "سيفقد جميع أعضاء العيادة هذا القالب. لا تتغير الملاحظات المكتوبة سابقًا.";
3216
+ readonly deleteConfirm: "احذف القالب";
3217
+ };
3218
+ };
3140
3219
  readonly signatureRequest: {
3141
3220
  readonly title: "المستندات الموقّعة";
3142
3221
  readonly noSignedVersions: "لا توجد نسخ موقّعة من هذا المستند";