@alfadocs/ui-kit 1.45.0 → 1.47.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/{actions-cell-renderer-BXBy9c0f.js → actions-cell-renderer-B5m9lwgC.js} +2 -2
- package/dist/_chunks/ai-credits-notice-xszqOZTC.js +90 -0
- package/dist/_chunks/ai-credits-notice.agent-C9L7orrP.js +17 -0
- package/dist/_chunks/{ai-consent-banner-D7I2U-cz.js → ai-permission-notice-D7I2U-cz.js} +1 -1
- package/dist/_chunks/ai-sparkle-D23NT8Z_.js +45 -0
- package/dist/_chunks/{anamnesis-summary-rows-DQUqwWc1.js → anamnesis-summary-rows-DI-UX5r6.js} +2 -2
- package/dist/_chunks/{appointment-card-TgR_2GKS.js → appointment-card-DluZy8Iv.js} +2 -2
- package/dist/_chunks/{appointment-peek-abiR0T9e.js → appointment-peek-BsfCpiJs.js} +3 -3
- package/dist/_chunks/{appointment-timeline-CCnyUYKz.js → appointment-timeline-Cs5f9viN.js} +3 -3
- package/dist/_chunks/{appointment-tray-N0yEI8UF.js → appointment-tray-CLrGGnKR.js} +2 -2
- package/dist/_chunks/baby-Dku-Xvg9.js +23 -0
- package/dist/_chunks/{balance-badge-cell-o6LldMUA.js → balance-badge-cell-YGrYdrvR.js} +3 -3
- package/dist/_chunks/booking-C4MwImkS.js +3362 -0
- package/dist/_chunks/button-group-CA1tmu39.js +325 -0
- package/dist/_chunks/{calendar-U6N0F99w.js → calendar-OzSeTb4V.js} +2 -2
- package/dist/_chunks/{calendar-event-card-DKUnT9Be.js → calendar-event-card-B6N5h1dO.js} +57 -48
- package/dist/_chunks/calendar-workspace-DDnQmiIL.js +12427 -0
- package/dist/_chunks/{chart-PF2krCZC.js → chart-D8ucl8hH.js} +2 -2
- package/dist/_chunks/{data-table-CcAx_I1w.js → data-table-DnKOmEVw.js} +2 -2
- package/dist/_chunks/{editable-currency-cell-renderer-Psb6XKHR.js → editable-currency-cell-renderer-OUkUv7U4.js} +2 -2
- package/dist/_chunks/{face-scheme-Bm6pe7R8.js → face-scheme-mIhwrQXt.js} +3 -3
- package/dist/_chunks/{file-manager-BfLQxF5t.js → file-manager-DOcJGIx2.js} +4 -4
- package/dist/_chunks/{freemium-paywall-Cz-O9lQD.js → freemium-paywall-BaW5ODc9.js} +2 -2
- package/dist/_chunks/{header-settings-CTe45iDy.js → header-settings-BEfx_-TF.js} +2 -2
- package/dist/_chunks/{help-me-write-templates-GUeEn3Ff.js → help-me-write-templates-DHIwa4xR.js} +205 -199
- package/dist/_chunks/{hover-card-BMJBVqIf.js → hover-card-nUae8NPJ.js} +67 -62
- package/dist/_chunks/{icon-button-group-DkkdIygu.js → icon-button-group-DZKC6KGf.js} +181 -168
- package/dist/_chunks/kit-extensions-DuoFF1R3.js +94 -0
- package/dist/_chunks/{marketplace-app-shell-DdwPj03y.js → marketplace-app-shell-PB89Dkk_.js} +2 -2
- package/dist/_chunks/{notes-panel-Dkk9QPPX.js → notes-panel-CHbDDMx8.js} +83 -73
- package/dist/_chunks/{patient-details-C8ImUrVg.js → patient-details-yrgkSeEY.js} +2 -2
- package/dist/_chunks/{patient-field-row-BRSOKvme.js → patient-field-row-DCMkFGqI.js} +3 -3
- package/dist/_chunks/{patient-summary-card-BhmKB2KR.js → patient-summary-card-CmEFflGS.js} +59 -45
- package/dist/_chunks/payment-form-DqJFiplX.js +881 -0
- package/dist/_chunks/{phone-input-BsZIoE36.js → phone-input-IWrGOCwm.js} +40 -39
- package/dist/_chunks/rich-text-editor-BwDV2XkZ.js +4153 -0
- package/dist/_chunks/{stepper-accordion-DmVykr5F.js → stepper-accordion-jMR8NaOB.js} +2 -1
- package/dist/_chunks/{tasks-panel-CpcikOeY.js → tasks-panel-DncuBPIZ.js} +2 -2
- package/dist/_chunks/{theme-toggle-bI0pgDDv.js → theme-toggle-BP0XRGMM.js} +2 -2
- package/dist/_chunks/use-ai-sparkle-Cf4yVTLB.js +76 -0
- package/dist/_chunks/{workflow-status-xeaJTzD3.js → workflow-status-CuJAOuKL.js} +43 -42
- package/dist/agent-catalog.json +36 -7
- package/dist/agent-i18n/en.json +3 -3
- package/dist/components/ai-credits-notice/ai-credits-notice.agent.d.ts +3 -0
- package/dist/components/ai-credits-notice/ai-credits-notice.d.ts +48 -0
- package/dist/components/ai-credits-notice/index.d.ts +4 -0
- package/dist/components/ai-credits-notice/index.js +7 -0
- package/dist/components/{ai-consent-banner/ai-consent-banner.agent.d.ts → ai-permission-notice/ai-permission-notice.agent.d.ts} +2 -2
- package/dist/components/{ai-consent-banner/ai-consent-banner.d.ts → ai-permission-notice/ai-permission-notice.d.ts} +1 -1
- package/dist/components/ai-permission-notice/index.d.ts +4 -0
- package/dist/components/{ai-consent-banner → ai-permission-notice}/index.js +1 -1
- package/dist/components/ai-sparkle/ai-sparkle.d.ts +3 -3
- package/dist/components/ai-sparkle/index.js +1 -1
- package/dist/components/appointment-card/index.js +2 -2
- package/dist/components/appointment-peek/index.js +1 -1
- package/dist/components/appointment-timeline/index.js +1 -1
- package/dist/components/booking/booking-types.d.ts +60 -1
- package/dist/components/booking/booking.d.ts +1 -1
- package/dist/components/booking/details-form.d.ts +5 -1
- package/dist/components/booking/index.d.ts +1 -1
- package/dist/components/booking/index.js +1 -1
- package/dist/components/booking/payment.d.ts +9 -0
- package/dist/components/booking/use-booking-payment.d.ts +14 -0
- package/dist/components/button-group/index.js +1 -1
- package/dist/components/calendar/index.js +1 -1
- package/dist/components/calendar-event-card/index.js +1 -1
- package/dist/components/chart/index.js +1 -1
- package/dist/components/data-table/index.js +3 -3
- package/dist/components/face-scheme/index.js +1 -1
- package/dist/components/file-manager/index.js +1 -1
- package/dist/components/freemium-paywall/index.js +1 -1
- package/dist/components/header-settings/index.js +1 -1
- package/dist/components/hover-card/hover-card.d.ts +4 -0
- package/dist/components/hover-card/index.d.ts +1 -1
- package/dist/components/hover-card/index.js +3 -2
- package/dist/components/icon-button-group/index.js +1 -1
- package/dist/components/index.d.ts +2 -1
- package/dist/components/notes-panel/index.js +1 -1
- package/dist/components/notes-panel/notes-panel.d.ts +10 -0
- package/dist/components/patient-details/index.js +1 -1
- package/dist/components/patient-summary-card/index.js +1 -1
- package/dist/components/patient-table/index.js +1 -1
- package/dist/components/payment-form/index.d.ts +1 -1
- package/dist/components/payment-form/index.js +1 -1
- package/dist/components/payment-form/payment-form.d.ts +35 -3
- package/dist/components/phone-input/index.js +1 -1
- package/dist/components/rich-text-editor/editor-extensions.d.ts +54 -0
- package/dist/components/rich-text-editor/editor-toolbar.d.ts +2 -1
- package/dist/components/rich-text-editor/help-me-write-overlay.d.ts +4 -0
- package/dist/components/rich-text-editor/index.d.ts +2 -0
- package/dist/components/rich-text-editor/index.js +6 -4
- package/dist/components/rich-text-editor/kit-extensions.d.ts +4 -0
- package/dist/components/rich-text-editor/rich-text-editor.d.ts +18 -2
- package/dist/components/stepper-accordion/index.js +1 -1
- package/dist/components/tasks-panel/index.js +1 -1
- package/dist/components/theme-toggle/index.js +1 -1
- package/dist/components/workflow-status/index.js +1 -1
- package/dist/hooks/index.d.ts +1 -1
- package/dist/hooks/index.js +51 -53
- package/dist/hooks/use-ai-sparkle.d.ts +7 -25
- package/dist/host-compat.css +2 -2
- package/dist/i18n/locales/ar.d.ts +67 -1
- package/dist/i18n/locales/ar.js +69 -3
- package/dist/i18n/locales/de.d.ts +67 -1
- package/dist/i18n/locales/de.js +69 -3
- package/dist/i18n/locales/el.d.ts +67 -1
- package/dist/i18n/locales/el.js +69 -3
- package/dist/i18n/locales/en.d.ts +67 -1
- package/dist/i18n/locales/en.js +69 -3
- package/dist/i18n/locales/es.d.ts +67 -1
- package/dist/i18n/locales/es.js +69 -3
- package/dist/i18n/locales/fr.d.ts +67 -1
- package/dist/i18n/locales/fr.js +69 -3
- package/dist/i18n/locales/hi.d.ts +67 -1
- package/dist/i18n/locales/hi.js +69 -3
- package/dist/i18n/locales/it.d.ts +67 -1
- package/dist/i18n/locales/it.js +69 -3
- package/dist/i18n/locales/ja.d.ts +67 -1
- package/dist/i18n/locales/ja.js +69 -3
- package/dist/i18n/locales/nl.d.ts +67 -1
- package/dist/i18n/locales/nl.js +69 -3
- package/dist/i18n/locales/pl.d.ts +67 -1
- package/dist/i18n/locales/pl.js +69 -3
- package/dist/i18n/locales/pt.d.ts +67 -1
- package/dist/i18n/locales/pt.js +69 -3
- package/dist/i18n/locales/ro.d.ts +67 -1
- package/dist/i18n/locales/ro.js +69 -3
- package/dist/i18n/locales/ru.d.ts +67 -1
- package/dist/i18n/locales/ru.js +69 -3
- package/dist/i18n/locales/sq.d.ts +67 -1
- package/dist/i18n/locales/sq.js +69 -3
- package/dist/i18n/locales/sv.d.ts +67 -1
- package/dist/i18n/locales/sv.js +69 -3
- package/dist/i18n/locales/tr.d.ts +67 -1
- package/dist/i18n/locales/tr.js +69 -3
- package/dist/i18n/locales/zh.d.ts +67 -1
- package/dist/i18n/locales/zh.js +69 -3
- package/dist/index.js +648 -641
- package/dist/locales/ar.json +69 -3
- package/dist/locales/de.json +69 -3
- package/dist/locales/el.json +69 -3
- package/dist/locales/en.json +69 -3
- package/dist/locales/es.json +69 -3
- package/dist/locales/fr.json +69 -3
- package/dist/locales/hi.json +69 -3
- package/dist/locales/it.json +69 -3
- package/dist/locales/ja.json +69 -3
- package/dist/locales/nl.json +69 -3
- package/dist/locales/pl.json +69 -3
- package/dist/locales/pt.json +69 -3
- package/dist/locales/ro.json +69 -3
- package/dist/locales/ru.json +69 -3
- package/dist/locales/sq.json +69 -3
- package/dist/locales/sv.json +69 -3
- package/dist/locales/tr.json +69 -3
- package/dist/locales/zh.json +69 -3
- package/dist/patterns/anamnesis/index.js +1 -1
- package/dist/patterns/calendar/calendar-editor-fields.d.ts +33 -0
- package/dist/patterns/calendar/calendar-sticky-offset.d.ts +20 -0
- package/dist/patterns/calendar/calendar-workspace.d.ts +6 -4
- package/dist/patterns/calendar/calendar.data.d.ts +26 -0
- package/dist/patterns/calendar/calendar.journey.d.ts +1 -1
- package/dist/patterns/calendar/calendar.sheets.d.ts +16 -5
- package/dist/patterns/calendar/calendar.types.d.ts +25 -9
- package/dist/patterns/calendar/index.js +1 -1
- package/dist/patterns/help-me-write-templates/help-me-write-templates.d.ts +11 -2
- package/dist/patterns/help-me-write-templates/index.js +1 -1
- package/dist/patterns/marketplace-app-shell/index.js +1 -1
- package/dist/tokens.css +1 -1
- package/package.json +14 -4
- package/dist/_chunks/ai-sparkle-DXeP_6a0.js +0 -52
- package/dist/_chunks/booking-D43ASl8y.js +0 -3034
- package/dist/_chunks/button-group-R32U7SyV.js +0 -307
- package/dist/_chunks/calendar-workspace-B7KvZ1_D.js +0 -12161
- package/dist/_chunks/payment-form-BHMDqW9C.js +0 -767
- package/dist/_chunks/rich-text-editor-BrAvNajV.js +0 -3779
- package/dist/_chunks/use-ai-sparkle-CyQSRTCe.js +0 -103
- package/dist/components/ai-consent-banner/index.d.ts +0 -4
package/dist/_chunks/{help-me-write-templates-GUeEn3Ff.js → help-me-write-templates-DHIwa4xR.js}
RENAMED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { jsxs as m, jsx as r, Fragment as _ } from "react/jsx-runtime";
|
|
2
|
-
import { useState as b, useEffect as U, useId as ee, useRef as V, useCallback as
|
|
2
|
+
import { useState as b, useEffect as U, useId as ee, useRef as V, useCallback as L, useMemo as Y } from "react";
|
|
3
3
|
import { useTranslation as $ } from "react-i18next";
|
|
4
4
|
import { c as ce } from "./index-D2ZczOXr.js";
|
|
5
|
-
import { A as
|
|
6
|
-
import { B as
|
|
7
|
-
import { I as
|
|
8
|
-
import { D as
|
|
5
|
+
import { A as O } from "./alert-CiQ5Pa3Q.js";
|
|
6
|
+
import { B as N } from "./button-CaUe1uyd.js";
|
|
7
|
+
import { I as B } from "./icon-button-CehAeZoP.js";
|
|
8
|
+
import { D as x } from "./dialog-BJiLqhx6.js";
|
|
9
9
|
import { E as de } from "./editor-overlay-DwNKaI22.js";
|
|
10
10
|
import { E as me } from "./empty-state-BUN_UAWf.js";
|
|
11
11
|
import { F as Z } from "./form-field-CahJzTxp.js";
|
|
@@ -51,7 +51,7 @@ function Ie({
|
|
|
51
51
|
credits: e,
|
|
52
52
|
onBack: o
|
|
53
53
|
}) {
|
|
54
|
-
const { t: l, i18n:
|
|
54
|
+
const { t: l, i18n: h } = $(), f = e == null ? void 0 : e.limit, T = (e == null ? void 0 : e.remaining) ?? 0, a = f !== void 0 ? l("helpMeWriteTemplates.credits.remaining", { remaining: T, limit: f }) : void 0, t = e != null && e.resetsOn ? new Intl.DateTimeFormat(h.language, {
|
|
55
55
|
day: "numeric",
|
|
56
56
|
month: "long"
|
|
57
57
|
}).format(e.resetsOn) : void 0;
|
|
@@ -61,9 +61,9 @@ function Ie({
|
|
|
61
61
|
className: "ds:flex ds:flex-col ds:gap-[var(--spacing-sm)]",
|
|
62
62
|
"data-component": "ai-credits-exhausted-notice",
|
|
63
63
|
children: [
|
|
64
|
-
/* @__PURE__ */ m(
|
|
65
|
-
/* @__PURE__ */ r(
|
|
66
|
-
/* @__PURE__ */ r(
|
|
64
|
+
/* @__PURE__ */ m(O, { variant: "promo", icon: /* @__PURE__ */ r(fe, { "aria-hidden": "true" }), children: [
|
|
65
|
+
/* @__PURE__ */ r(O.Title, { as: "h2", children: l("helpMeWriteTemplates.credits.title") }),
|
|
66
|
+
/* @__PURE__ */ r(O.Description, { children: e != null && e.onBuyCredits ? t ? l("helpMeWriteTemplates.credits.bodyResets", { date: t }) : l("helpMeWriteTemplates.credits.body") : t ? l("helpMeWriteTemplates.credits.bodyWaitResets", {
|
|
67
67
|
date: t
|
|
68
68
|
}) : l("helpMeWriteTemplates.credits.bodyWait") }),
|
|
69
69
|
f !== void 0 && a ? /* @__PURE__ */ m("div", { className: "ds:flex ds:flex-col ds:gap-[var(--spacing-2xs)] ds:[margin-block-start:var(--spacing-sm)]", children: [
|
|
@@ -82,9 +82,9 @@ function Ie({
|
|
|
82
82
|
}
|
|
83
83
|
)
|
|
84
84
|
] }) : null,
|
|
85
|
-
e != null && e.onBuyCredits || e != null && e.onSeeCosts ? /* @__PURE__ */ m(
|
|
85
|
+
e != null && e.onBuyCredits || e != null && e.onSeeCosts ? /* @__PURE__ */ m(O.Action, { children: [
|
|
86
86
|
e.onBuyCredits ? /* @__PURE__ */ r(
|
|
87
|
-
|
|
87
|
+
N,
|
|
88
88
|
{
|
|
89
89
|
intent: "tonal",
|
|
90
90
|
size: "sm",
|
|
@@ -93,11 +93,11 @@ function Ie({
|
|
|
93
93
|
children: l("helpMeWriteTemplates.credits.cta")
|
|
94
94
|
}
|
|
95
95
|
) : null,
|
|
96
|
-
e.onSeeCosts ? /* @__PURE__ */ r(
|
|
96
|
+
e.onSeeCosts ? /* @__PURE__ */ r(N, { intent: "link", size: "sm", onClick: e.onSeeCosts, children: l("helpMeWriteTemplates.credits.secondary") }) : null
|
|
97
97
|
] }) : null
|
|
98
98
|
] }),
|
|
99
99
|
/* @__PURE__ */ m("div", { className: "ds:flex ds:flex-wrap ds:items-center ds:gap-[var(--spacing-sm)]", children: [
|
|
100
|
-
o ? /* @__PURE__ */ r(
|
|
100
|
+
o ? /* @__PURE__ */ r(N, { intent: "ghost", startIcon: /* @__PURE__ */ r(ve, {}), onClick: o, children: l("helpMeWriteTemplates.credits.back") }) : null,
|
|
101
101
|
/* @__PURE__ */ r("p", { className: K, children: l("helpMeWriteTemplates.credits.kept") })
|
|
102
102
|
] })
|
|
103
103
|
]
|
|
@@ -108,65 +108,65 @@ function Re({
|
|
|
108
108
|
context: e,
|
|
109
109
|
onGenerate: o,
|
|
110
110
|
onApplied: l,
|
|
111
|
-
credits:
|
|
111
|
+
credits: h,
|
|
112
112
|
enableDictation: f = !0,
|
|
113
113
|
suspendClose: T = !1
|
|
114
114
|
}) {
|
|
115
|
-
const { t: a } = $(), { open: t } = e,
|
|
115
|
+
const { t: a } = $(), { open: t } = e, k = ee(), s = ee(), [u, D] = b(""), [w, E] = b(!1), [z, i] = b(!1), [g, c] = b(!1), [C, I] = b(null), d = V(null), v = f ? e.onDictate : void 0, [W, A] = b(!1), [S, P] = b(""), [X, n] = b(""), y = V(null), R = L(() => {
|
|
116
116
|
var p;
|
|
117
|
-
return (p =
|
|
118
|
-
}, []), ie =
|
|
119
|
-
if (
|
|
117
|
+
return (p = y.current) == null ? void 0 : p.abort();
|
|
118
|
+
}, []), ie = L(() => {
|
|
119
|
+
if (W) {
|
|
120
120
|
R();
|
|
121
121
|
return;
|
|
122
122
|
}
|
|
123
|
-
if (!
|
|
123
|
+
if (!v) return;
|
|
124
124
|
const p = new AbortController();
|
|
125
|
-
|
|
125
|
+
y.current = p, A(!0), n(a("helpMeWriteTemplates.bar.listening")), v({
|
|
126
126
|
signal: p.signal,
|
|
127
127
|
onPartialTranscript: (M) => {
|
|
128
|
-
p.signal.aborted ||
|
|
128
|
+
p.signal.aborted || P(M);
|
|
129
129
|
},
|
|
130
130
|
onFinalTranscript: (M) => {
|
|
131
131
|
if (p.signal.aborted) return;
|
|
132
|
-
|
|
133
|
-
const
|
|
134
|
-
|
|
132
|
+
P("");
|
|
133
|
+
const H = M.trim();
|
|
134
|
+
H && (D((F) => ne(F, H)), n(H));
|
|
135
135
|
}
|
|
136
136
|
}).catch((M) => {
|
|
137
|
-
M instanceof ae &&
|
|
137
|
+
M instanceof ae && c(!0);
|
|
138
138
|
}).finally(() => {
|
|
139
|
-
|
|
139
|
+
P(""), y.current === p && (y.current = null, A(!1), n(""));
|
|
140
140
|
});
|
|
141
|
-
}, [
|
|
141
|
+
}, [W, v, R, a]);
|
|
142
142
|
U(() => {
|
|
143
143
|
var p, M;
|
|
144
|
-
t ? (
|
|
144
|
+
t ? (D(""), E(!1), i(!1), c(e.creditsExhausted), I(null)) : ((p = d.current) == null || p.abort(), (M = y.current) == null || M.abort());
|
|
145
145
|
}, [t]), U(
|
|
146
146
|
() => () => {
|
|
147
147
|
var p, M;
|
|
148
|
-
(p =
|
|
148
|
+
(p = d.current) == null || p.abort(), (M = y.current) == null || M.abort();
|
|
149
149
|
},
|
|
150
150
|
[]
|
|
151
151
|
);
|
|
152
|
-
const Q =
|
|
153
|
-
var
|
|
154
|
-
if (w || !
|
|
155
|
-
R(), (
|
|
152
|
+
const Q = L(() => {
|
|
153
|
+
var H;
|
|
154
|
+
if (w || !u.trim()) return;
|
|
155
|
+
R(), (H = d.current) == null || H.abort();
|
|
156
156
|
const p = new AbortController();
|
|
157
|
-
|
|
157
|
+
d.current = p, i(!1), E(!0);
|
|
158
158
|
const M = e.scope === "selection";
|
|
159
159
|
o({
|
|
160
|
-
prompt:
|
|
160
|
+
prompt: u.trim(),
|
|
161
161
|
sourceText: M ? e.selectionText : e.getText(),
|
|
162
162
|
scope: M ? "selection" : "document",
|
|
163
163
|
signal: p.signal
|
|
164
|
-
}).then((
|
|
165
|
-
p.signal.aborted || (
|
|
166
|
-
}).catch((
|
|
167
|
-
p.signal.aborted || ze(
|
|
164
|
+
}).then((F) => {
|
|
165
|
+
p.signal.aborted || (I(F), E(!1));
|
|
166
|
+
}).catch((F) => {
|
|
167
|
+
p.signal.aborted || ze(F) || (F instanceof ae ? c(!0) : i(!0), E(!1));
|
|
168
168
|
});
|
|
169
|
-
}, [w,
|
|
169
|
+
}, [w, u, o, R]), { onClose: G } = e, le = L(() => {
|
|
170
170
|
T || G();
|
|
171
171
|
}, [T, G]), oe = () => {
|
|
172
172
|
if (C === null) return;
|
|
@@ -180,12 +180,12 @@ function Re({
|
|
|
180
180
|
});
|
|
181
181
|
};
|
|
182
182
|
let j;
|
|
183
|
-
if (
|
|
183
|
+
if (g)
|
|
184
184
|
j = /* @__PURE__ */ r(
|
|
185
185
|
Ie,
|
|
186
186
|
{
|
|
187
|
-
credits:
|
|
188
|
-
onBack: () =>
|
|
187
|
+
credits: h,
|
|
188
|
+
onBack: () => c(!1)
|
|
189
189
|
}
|
|
190
190
|
);
|
|
191
191
|
else if (C !== null)
|
|
@@ -193,10 +193,10 @@ function Re({
|
|
|
193
193
|
/* @__PURE__ */ m(
|
|
194
194
|
"section",
|
|
195
195
|
{
|
|
196
|
-
"aria-labelledby":
|
|
196
|
+
"aria-labelledby": k,
|
|
197
197
|
className: "ds:flex ds:min-w-0 ds:flex-col ds:gap-[var(--spacing-2xs)]",
|
|
198
198
|
children: [
|
|
199
|
-
/* @__PURE__ */ r("h2", { id:
|
|
199
|
+
/* @__PURE__ */ r("h2", { id: k, className: De, children: a("helpMeWriteTemplates.bar.after") }),
|
|
200
200
|
/* @__PURE__ */ r(
|
|
201
201
|
he,
|
|
202
202
|
{
|
|
@@ -210,28 +210,28 @@ function Re({
|
|
|
210
210
|
}
|
|
211
211
|
),
|
|
212
212
|
/* @__PURE__ */ m("div", { className: "ds:flex ds:flex-wrap ds:items-center ds:gap-[var(--spacing-sm)]", children: [
|
|
213
|
-
/* @__PURE__ */ r(
|
|
213
|
+
/* @__PURE__ */ r(N, { intent: "ghost", startIcon: /* @__PURE__ */ r(te, {}), onClick: e.onClose, children: a("helpMeWriteTemplates.bar.discard") }),
|
|
214
214
|
/* @__PURE__ */ r(
|
|
215
|
-
|
|
215
|
+
N,
|
|
216
216
|
{
|
|
217
217
|
intent: "ghost",
|
|
218
218
|
startIcon: /* @__PURE__ */ r(Ce, {}),
|
|
219
219
|
onClick: () => {
|
|
220
|
-
|
|
220
|
+
I(null), Q();
|
|
221
221
|
},
|
|
222
222
|
children: a("helpMeWriteTemplates.bar.retry")
|
|
223
223
|
}
|
|
224
224
|
),
|
|
225
225
|
/* @__PURE__ */ r("span", { className: "ds:flex-1", "aria-hidden": "true" }),
|
|
226
|
-
/* @__PURE__ */ r(
|
|
226
|
+
/* @__PURE__ */ r(N, { intent: "primary", onClick: oe, children: e.scope === "selection" ? a("helpMeWriteTemplates.bar.replace") : a("helpMeWriteTemplates.bar.insert") })
|
|
227
227
|
] })
|
|
228
228
|
] });
|
|
229
229
|
else {
|
|
230
|
-
const p =
|
|
230
|
+
const p = W ? ne(u, S) : u;
|
|
231
231
|
j = /* @__PURE__ */ m(_, { children: [
|
|
232
232
|
/* @__PURE__ */ m("div", { className: "ds:flex ds:items-center ds:gap-[var(--spacing-sm)]", children: [
|
|
233
233
|
/* @__PURE__ */ r(
|
|
234
|
-
|
|
234
|
+
B,
|
|
235
235
|
{
|
|
236
236
|
size: "md",
|
|
237
237
|
intent: "outline",
|
|
@@ -246,45 +246,45 @@ function Re({
|
|
|
246
246
|
{
|
|
247
247
|
size: "md",
|
|
248
248
|
value: p,
|
|
249
|
-
onChange: (M) =>
|
|
249
|
+
onChange: (M) => D(M.target.value),
|
|
250
250
|
placeholder: a("editor.ai.promptPlaceholder"),
|
|
251
251
|
"aria-label": a("editor.ai.promptLabel"),
|
|
252
252
|
autoResize: !0,
|
|
253
253
|
minRows: 1,
|
|
254
254
|
maxRows: 3,
|
|
255
|
-
readOnly: w ||
|
|
255
|
+
readOnly: w || W,
|
|
256
256
|
tone: z ? "error" : "default",
|
|
257
257
|
"aria-describedby": z ? s : void 0
|
|
258
258
|
}
|
|
259
259
|
) }),
|
|
260
|
-
|
|
261
|
-
|
|
260
|
+
v ? /* @__PURE__ */ r(
|
|
261
|
+
B,
|
|
262
262
|
{
|
|
263
263
|
size: "md",
|
|
264
264
|
intent: "outline",
|
|
265
|
-
className:
|
|
266
|
-
icon:
|
|
267
|
-
"aria-pressed":
|
|
268
|
-
"aria-label": a(
|
|
265
|
+
className: W ? `${q} ${ke}` : q,
|
|
266
|
+
icon: W ? /* @__PURE__ */ r(We, { className: "ds:fill-current" }) : /* @__PURE__ */ r(ye, {}),
|
|
267
|
+
"aria-pressed": W,
|
|
268
|
+
"aria-label": a(W ? "helpMeWriteTemplates.bar.dictateStop" : "helpMeWriteTemplates.bar.dictateStart"),
|
|
269
269
|
disabled: w,
|
|
270
270
|
onClick: ie
|
|
271
271
|
}
|
|
272
272
|
) : null,
|
|
273
273
|
/* @__PURE__ */ r(
|
|
274
|
-
|
|
274
|
+
B,
|
|
275
275
|
{
|
|
276
276
|
size: "md",
|
|
277
277
|
intent: "primary",
|
|
278
278
|
className: Ne,
|
|
279
279
|
icon: w ? /* @__PURE__ */ r(ue, { size: "sm", variant: "pulse" }) : /* @__PURE__ */ r(xe, {}),
|
|
280
|
-
disabled: w || !
|
|
280
|
+
disabled: w || !u.trim(),
|
|
281
281
|
"aria-busy": w || void 0,
|
|
282
282
|
"aria-label": a("helpMeWriteTemplates.bar.write"),
|
|
283
283
|
onClick: Q
|
|
284
284
|
}
|
|
285
285
|
)
|
|
286
286
|
] }),
|
|
287
|
-
|
|
287
|
+
v ? /* @__PURE__ */ r("p", { className: "ds:sr-only", role: "status", "aria-live": "polite", children: X }) : null,
|
|
288
288
|
z ? /* @__PURE__ */ r("p", { id: s, role: "alert", className: K, children: a("helpMeWriteTemplates.bar.error") }) : null,
|
|
289
289
|
/* @__PURE__ */ m("p", { className: K, children: [
|
|
290
290
|
e.scope === "selection" ? a("helpMeWriteTemplates.bar.contextSelection") : a("helpMeWriteTemplates.bar.contextDocument"),
|
|
@@ -314,52 +314,52 @@ const Ae = ce("", {
|
|
|
314
314
|
defaultVariants: { dragging: !1, dropTarget: !1 }
|
|
315
315
|
});
|
|
316
316
|
function Se(e, o) {
|
|
317
|
-
const { t: l } = $(), [
|
|
318
|
-
const
|
|
319
|
-
if (!o ||
|
|
320
|
-
const C = e.map((
|
|
321
|
-
C.splice(
|
|
322
|
-
const
|
|
317
|
+
const { t: l } = $(), [h, f] = b(null), [T, a] = b(null), [t, k] = b(""), s = V(!1), u = (i, g) => {
|
|
318
|
+
const c = Math.max(0, Math.min(e.length - 1, g));
|
|
319
|
+
if (!o || c === i) return;
|
|
320
|
+
const C = e.map((v) => v.id), [I] = C.splice(i, 1);
|
|
321
|
+
C.splice(c, 0, I), o(C), s.current = !s.current;
|
|
322
|
+
const d = l("helpMeWriteTemplates.manager.reorderAnnounce", {
|
|
323
323
|
label: e[i].name,
|
|
324
|
-
to:
|
|
324
|
+
to: c + 1,
|
|
325
325
|
total: e.length
|
|
326
326
|
});
|
|
327
|
-
|
|
327
|
+
k(s.current ? d : `${d}`);
|
|
328
328
|
};
|
|
329
329
|
return { rowProps: (i) => o ? {
|
|
330
330
|
draggable: !0,
|
|
331
|
-
onDragStart: (
|
|
332
|
-
f(i),
|
|
331
|
+
onDragStart: (g) => {
|
|
332
|
+
f(i), g.dataTransfer.effectAllowed = "move", g.dataTransfer.setData("text/plain", String(i));
|
|
333
333
|
},
|
|
334
334
|
onDragEnd: () => {
|
|
335
335
|
f(null), a(null);
|
|
336
336
|
},
|
|
337
|
-
onDragOver: (
|
|
338
|
-
|
|
337
|
+
onDragOver: (g) => {
|
|
338
|
+
h !== null && (g.preventDefault(), g.dataTransfer.dropEffect = "move", a(i));
|
|
339
339
|
},
|
|
340
340
|
onDragLeave: () => a(null),
|
|
341
|
-
onDrop: (
|
|
342
|
-
|
|
343
|
-
const
|
|
344
|
-
f(null), a(null),
|
|
341
|
+
onDrop: (g) => {
|
|
342
|
+
g.preventDefault();
|
|
343
|
+
const c = h;
|
|
344
|
+
f(null), a(null), c !== null && u(c, i);
|
|
345
345
|
}
|
|
346
346
|
} : {}, rowClass: (i) => Ae({
|
|
347
|
-
dragging:
|
|
348
|
-
dropTarget: T === i &&
|
|
349
|
-
}), handle: (i,
|
|
350
|
-
|
|
347
|
+
dragging: h === i,
|
|
348
|
+
dropTarget: T === i && h !== i
|
|
349
|
+
}), handle: (i, g) => /* @__PURE__ */ r(
|
|
350
|
+
B,
|
|
351
351
|
{
|
|
352
352
|
size: "sm",
|
|
353
353
|
intent: "ghost",
|
|
354
354
|
icon: /* @__PURE__ */ r(we, { "aria-hidden": "true" }),
|
|
355
355
|
"aria-label": l("helpMeWriteTemplates.manager.reorderHandle", {
|
|
356
|
-
label:
|
|
356
|
+
label: g
|
|
357
357
|
}),
|
|
358
358
|
className: "ds:cursor-grab ds:active:cursor-grabbing",
|
|
359
|
-
onKeyDown: (
|
|
360
|
-
if (!
|
|
361
|
-
const C =
|
|
362
|
-
C !== null && (
|
|
359
|
+
onKeyDown: (c) => {
|
|
360
|
+
if (!c.altKey) return;
|
|
361
|
+
const C = c.key === "ArrowUp" ? i - 1 : c.key === "ArrowDown" ? i + 1 : c.key === "Home" ? 0 : c.key === "End" ? e.length - 1 : null;
|
|
362
|
+
C !== null && (c.preventDefault(), u(i, C));
|
|
363
363
|
}
|
|
364
364
|
}
|
|
365
365
|
), liveRegion: /* @__PURE__ */ r("span", { role: "status", "aria-live": "polite", className: "ds:sr-only", children: t }) };
|
|
@@ -374,46 +374,46 @@ function Pe({
|
|
|
374
374
|
open: e,
|
|
375
375
|
onOpenChange: o,
|
|
376
376
|
initialMode: l = "list",
|
|
377
|
-
templates:
|
|
377
|
+
templates: h,
|
|
378
378
|
onSaveTemplate: f,
|
|
379
379
|
onDeleteTemplate: T,
|
|
380
380
|
onReorderTemplates: a
|
|
381
381
|
}) {
|
|
382
|
-
const { t } = $(),
|
|
383
|
-
if (!(!i ||
|
|
384
|
-
C(!0),
|
|
382
|
+
const { t } = $(), k = Se(h, a), [s, u] = b(null), [D, w] = b(!1), [E, z] = b(!1), [i, g] = b(null), [c, C] = b(!1), [I, d] = b(!1), v = async () => {
|
|
383
|
+
if (!(!i || c)) {
|
|
384
|
+
C(!0), d(!1);
|
|
385
385
|
try {
|
|
386
|
-
await (T == null ? void 0 : T(i.id)),
|
|
386
|
+
await (T == null ? void 0 : T(i.id)), g(null);
|
|
387
387
|
} catch {
|
|
388
|
-
|
|
388
|
+
d(!0);
|
|
389
389
|
} finally {
|
|
390
390
|
C(!1);
|
|
391
391
|
}
|
|
392
392
|
}
|
|
393
393
|
};
|
|
394
394
|
U(() => {
|
|
395
|
-
e && (z(!1),
|
|
395
|
+
e && (z(!1), u(l === "create" ? { ...J } : null));
|
|
396
396
|
}, [e]);
|
|
397
|
-
const
|
|
398
|
-
(R) => R.id !==
|
|
397
|
+
const W = (n, y) => h.some(
|
|
398
|
+
(R) => R.id !== y && R.name.toLowerCase() === n.toLowerCase()
|
|
399
399
|
), A = (() => {
|
|
400
400
|
if (!(s != null && s.submitted)) return;
|
|
401
401
|
const n = s.name.trim();
|
|
402
|
-
return n ?
|
|
403
|
-
})(),
|
|
404
|
-
if (!s ||
|
|
402
|
+
return n ? W(n, s.id) ? t("helpMeWriteTemplates.manager.nameTaken") : void 0 : t("helpMeWriteTemplates.manager.nameRequired");
|
|
403
|
+
})(), S = s != null && s.submitted && !s.prompt.trim() ? t("helpMeWriteTemplates.manager.promptRequired") : void 0, P = async () => {
|
|
404
|
+
if (!s || D) return;
|
|
405
405
|
const n = { ...s, submitted: !0 };
|
|
406
|
-
|
|
407
|
-
const
|
|
408
|
-
if (!(!
|
|
406
|
+
u(n);
|
|
407
|
+
const y = n.name.trim(), R = n.prompt.trim();
|
|
408
|
+
if (!(!y || !R || W(y, n.id))) {
|
|
409
409
|
w(!0), z(!1);
|
|
410
410
|
try {
|
|
411
411
|
await f({
|
|
412
412
|
id: n.id,
|
|
413
|
-
name:
|
|
413
|
+
name: y,
|
|
414
414
|
description: n.description.trim() || void 0,
|
|
415
415
|
prompt: R
|
|
416
|
-
}),
|
|
416
|
+
}), u(null);
|
|
417
417
|
} catch {
|
|
418
418
|
z(!0);
|
|
419
419
|
} finally {
|
|
@@ -422,14 +422,14 @@ function Pe({
|
|
|
422
422
|
}
|
|
423
423
|
}, X = s ? s.id ? t("helpMeWriteTemplates.manager.formEdit") : t("helpMeWriteTemplates.manager.formNew") : t("helpMeWriteTemplates.manager.title");
|
|
424
424
|
return /* @__PURE__ */ m(_, { children: [
|
|
425
|
-
/* @__PURE__ */ r(
|
|
426
|
-
/* @__PURE__ */ m(
|
|
427
|
-
/* @__PURE__ */ r(
|
|
428
|
-
/* @__PURE__ */ r(
|
|
425
|
+
/* @__PURE__ */ r(x, { open: e, onOpenChange: o, children: /* @__PURE__ */ r(x.Content, { size: "lg", children: /* @__PURE__ */ m("div", { className: "ds:contents", "data-component": "ai-template-manager", children: [
|
|
426
|
+
/* @__PURE__ */ m(x.Header, { children: [
|
|
427
|
+
/* @__PURE__ */ r(x.Title, { children: X }),
|
|
428
|
+
/* @__PURE__ */ r(x.Description, { children: t("helpMeWriteTemplates.manager.description") })
|
|
429
429
|
] }),
|
|
430
|
-
/* @__PURE__ */ m(
|
|
430
|
+
/* @__PURE__ */ m(x.Body, { children: [
|
|
431
431
|
s ? /* @__PURE__ */ m("div", { className: "ds:flex ds:flex-col ds:gap-[var(--spacing-md)]", children: [
|
|
432
|
-
|
|
432
|
+
E ? /* @__PURE__ */ r(O, { variant: "error", children: t("helpMeWriteTemplates.manager.saveError") }) : null,
|
|
433
433
|
/* @__PURE__ */ r(
|
|
434
434
|
Z,
|
|
435
435
|
{
|
|
@@ -444,7 +444,7 @@ function Pe({
|
|
|
444
444
|
placeholder: t(
|
|
445
445
|
"helpMeWriteTemplates.manager.namePlaceholder"
|
|
446
446
|
),
|
|
447
|
-
onChange: (n) =>
|
|
447
|
+
onChange: (n) => u({ ...s, name: n.target.value })
|
|
448
448
|
}
|
|
449
449
|
)
|
|
450
450
|
}
|
|
@@ -460,7 +460,7 @@ function Pe({
|
|
|
460
460
|
{
|
|
461
461
|
value: s.description,
|
|
462
462
|
maxLength: 120,
|
|
463
|
-
onChange: (n) =>
|
|
463
|
+
onChange: (n) => u({ ...s, description: n.target.value })
|
|
464
464
|
}
|
|
465
465
|
)
|
|
466
466
|
}
|
|
@@ -472,7 +472,7 @@ function Pe({
|
|
|
472
472
|
description: t(
|
|
473
473
|
"helpMeWriteTemplates.manager.promptDescription"
|
|
474
474
|
),
|
|
475
|
-
error:
|
|
475
|
+
error: S,
|
|
476
476
|
required: !0,
|
|
477
477
|
children: /* @__PURE__ */ r(
|
|
478
478
|
se,
|
|
@@ -482,12 +482,12 @@ function Pe({
|
|
|
482
482
|
autoResize: !0,
|
|
483
483
|
minRows: 4,
|
|
484
484
|
maxRows: 10,
|
|
485
|
-
onChange: (n) =>
|
|
485
|
+
onChange: (n) => u({ ...s, prompt: n.target.value })
|
|
486
486
|
}
|
|
487
487
|
)
|
|
488
488
|
}
|
|
489
489
|
)
|
|
490
|
-
] }) :
|
|
490
|
+
] }) : h.length === 0 ? /* @__PURE__ */ r(
|
|
491
491
|
me,
|
|
492
492
|
{
|
|
493
493
|
variant: "first-use",
|
|
@@ -498,7 +498,7 @@ function Pe({
|
|
|
498
498
|
),
|
|
499
499
|
primaryAction: {
|
|
500
500
|
label: t("helpMeWriteTemplates.manager.new"),
|
|
501
|
-
onClick: () =>
|
|
501
|
+
onClick: () => u({ ...J })
|
|
502
502
|
}
|
|
503
503
|
}
|
|
504
504
|
) : /* @__PURE__ */ r(
|
|
@@ -506,19 +506,19 @@ function Pe({
|
|
|
506
506
|
{
|
|
507
507
|
"aria-label": t("helpMeWriteTemplates.manager.listLabel"),
|
|
508
508
|
className: "ds:m-0 ds:flex ds:list-none ds:flex-col ds:gap-[var(--spacing-sm)] ds:p-0",
|
|
509
|
-
children:
|
|
509
|
+
children: h.map((n, y) => /* @__PURE__ */ m(
|
|
510
510
|
"li",
|
|
511
511
|
{
|
|
512
|
-
...
|
|
513
|
-
className: `ds:flex ds:items-start ds:gap-[var(--spacing-sm)] ds:rounded-[var(--radius-md)] ds:border ds:border-[color:var(--border)] ds:p-[var(--spacing-sm)] ${
|
|
512
|
+
...k.rowProps(y),
|
|
513
|
+
className: `ds:flex ds:items-start ds:gap-[var(--spacing-sm)] ds:rounded-[var(--radius-md)] ds:border ds:border-[color:var(--border)] ds:p-[var(--spacing-sm)] ${k.rowClass(y)}`,
|
|
514
514
|
children: [
|
|
515
|
-
a ?
|
|
515
|
+
a ? k.handle(y, n.name) : null,
|
|
516
516
|
/* @__PURE__ */ m("div", { className: "ds:flex ds:min-w-0 ds:flex-1 ds:flex-col ds:gap-[var(--spacing-2xs)]", children: [
|
|
517
517
|
/* @__PURE__ */ r("div", { className: "ds:flex ds:flex-wrap ds:items-center ds:gap-[var(--spacing-xs)]", children: /* @__PURE__ */ r("span", { className: "type-title-item ds:text-[color:var(--foreground)]", children: n.name }) }),
|
|
518
518
|
/* @__PURE__ */ r("p", { className: `${K} ds:line-clamp-2`, children: n.description || n.prompt })
|
|
519
519
|
] }),
|
|
520
520
|
/* @__PURE__ */ r(
|
|
521
|
-
|
|
521
|
+
B,
|
|
522
522
|
{
|
|
523
523
|
size: "sm",
|
|
524
524
|
intent: "ghost",
|
|
@@ -526,7 +526,7 @@ function Pe({
|
|
|
526
526
|
"aria-label": t("helpMeWriteTemplates.manager.edit", {
|
|
527
527
|
name: n.name
|
|
528
528
|
}),
|
|
529
|
-
onClick: () =>
|
|
529
|
+
onClick: () => u({
|
|
530
530
|
id: n.id,
|
|
531
531
|
name: n.name,
|
|
532
532
|
description: n.description ?? "",
|
|
@@ -536,7 +536,7 @@ function Pe({
|
|
|
536
536
|
}
|
|
537
537
|
),
|
|
538
538
|
T ? /* @__PURE__ */ r(
|
|
539
|
-
|
|
539
|
+
B,
|
|
540
540
|
{
|
|
541
541
|
size: "sm",
|
|
542
542
|
intent: "ghost",
|
|
@@ -544,7 +544,7 @@ function Pe({
|
|
|
544
544
|
"aria-label": t("helpMeWriteTemplates.manager.delete", {
|
|
545
545
|
name: n.name
|
|
546
546
|
}),
|
|
547
|
-
onClick: () =>
|
|
547
|
+
onClick: () => g(n)
|
|
548
548
|
}
|
|
549
549
|
) : null
|
|
550
550
|
]
|
|
@@ -553,55 +553,55 @@ function Pe({
|
|
|
553
553
|
))
|
|
554
554
|
}
|
|
555
555
|
),
|
|
556
|
-
|
|
556
|
+
k.liveRegion
|
|
557
557
|
] }),
|
|
558
|
-
/* @__PURE__ */ r(
|
|
559
|
-
/* @__PURE__ */ r(
|
|
558
|
+
/* @__PURE__ */ r(x.Footer, { children: s ? /* @__PURE__ */ m(_, { children: [
|
|
559
|
+
/* @__PURE__ */ r(N, { intent: "secondary", onClick: () => u(null), children: t("helpMeWriteTemplates.manager.cancel") }),
|
|
560
560
|
/* @__PURE__ */ r(
|
|
561
|
-
|
|
561
|
+
N,
|
|
562
562
|
{
|
|
563
563
|
intent: "primary",
|
|
564
|
-
loading:
|
|
565
|
-
onClick: () => void
|
|
564
|
+
loading: D,
|
|
565
|
+
onClick: () => void P(),
|
|
566
566
|
children: t("helpMeWriteTemplates.manager.save")
|
|
567
567
|
}
|
|
568
568
|
)
|
|
569
569
|
] }) : /* @__PURE__ */ m(_, { children: [
|
|
570
|
-
|
|
571
|
-
|
|
570
|
+
h.length > 0 ? /* @__PURE__ */ r(
|
|
571
|
+
N,
|
|
572
572
|
{
|
|
573
573
|
intent: "outline",
|
|
574
574
|
startIcon: /* @__PURE__ */ r(Me, {}),
|
|
575
|
-
onClick: () =>
|
|
575
|
+
onClick: () => u({ ...J }),
|
|
576
576
|
children: t("helpMeWriteTemplates.manager.new")
|
|
577
577
|
}
|
|
578
578
|
) : null,
|
|
579
|
-
/* @__PURE__ */ r(
|
|
579
|
+
/* @__PURE__ */ r(x.Close, { asChild: !0, children: /* @__PURE__ */ r(N, { intent: "primary", children: t("helpMeWriteTemplates.manager.done") }) })
|
|
580
580
|
] }) })
|
|
581
581
|
] }) }) }),
|
|
582
582
|
/* @__PURE__ */ r(
|
|
583
|
-
|
|
583
|
+
x,
|
|
584
584
|
{
|
|
585
585
|
open: i != null,
|
|
586
586
|
onOpenChange: (n) => {
|
|
587
|
-
!n && !
|
|
587
|
+
!n && !c && (g(null), d(!1));
|
|
588
588
|
},
|
|
589
|
-
children: /* @__PURE__ */ m(
|
|
590
|
-
/* @__PURE__ */ m(
|
|
591
|
-
/* @__PURE__ */ r(
|
|
589
|
+
children: /* @__PURE__ */ m(x.Content, { size: "sm", variant: "alert", children: [
|
|
590
|
+
/* @__PURE__ */ m(x.Header, { children: [
|
|
591
|
+
/* @__PURE__ */ r(x.Title, { children: t("helpMeWriteTemplates.manager.deleteTitle", {
|
|
592
592
|
name: (i == null ? void 0 : i.name) ?? ""
|
|
593
593
|
}) }),
|
|
594
|
-
/* @__PURE__ */ r(
|
|
594
|
+
/* @__PURE__ */ r(x.Description, { children: t("helpMeWriteTemplates.manager.deleteDescription") })
|
|
595
595
|
] }),
|
|
596
|
-
|
|
597
|
-
/* @__PURE__ */ m(
|
|
598
|
-
/* @__PURE__ */ r(
|
|
596
|
+
I ? /* @__PURE__ */ r(x.Body, { children: /* @__PURE__ */ r(O, { variant: "error", children: t("helpMeWriteTemplates.manager.deleteError") }) }) : null,
|
|
597
|
+
/* @__PURE__ */ m(x.Footer, { children: [
|
|
598
|
+
/* @__PURE__ */ r(x.Close, { asChild: !0, children: /* @__PURE__ */ r(N, { intent: "secondary", disabled: c, children: t("helpMeWriteTemplates.manager.cancel") }) }),
|
|
599
599
|
/* @__PURE__ */ r(
|
|
600
|
-
|
|
600
|
+
N,
|
|
601
601
|
{
|
|
602
602
|
intent: "destructive",
|
|
603
|
-
loading:
|
|
604
|
-
onClick: () => void
|
|
603
|
+
loading: c,
|
|
604
|
+
onClick: () => void v(),
|
|
605
605
|
children: t("helpMeWriteTemplates.manager.deleteConfirm")
|
|
606
606
|
}
|
|
607
607
|
)
|
|
@@ -616,14 +616,14 @@ function Le({
|
|
|
616
616
|
onUndo: o,
|
|
617
617
|
onDismiss: l
|
|
618
618
|
}) {
|
|
619
|
-
const { t:
|
|
619
|
+
const { t: h } = $(), f = V(null);
|
|
620
620
|
if (U(() => {
|
|
621
621
|
var a;
|
|
622
622
|
e && ((a = f.current) == null || a.focus());
|
|
623
623
|
}, [e]), !(e != null && e.template)) return null;
|
|
624
624
|
const T = e.template.name;
|
|
625
625
|
return /* @__PURE__ */ r(
|
|
626
|
-
|
|
626
|
+
O,
|
|
627
627
|
{
|
|
628
628
|
variant: "success",
|
|
629
629
|
dismissible: !0,
|
|
@@ -632,8 +632,8 @@ function Le({
|
|
|
632
632
|
},
|
|
633
633
|
"data-component": "help-me-write-undo-notice",
|
|
634
634
|
children: /* @__PURE__ */ m("div", { className: "ds:flex ds:flex-wrap ds:items-center ds:gap-[var(--spacing-sm)]", children: [
|
|
635
|
-
/* @__PURE__ */ r("span", { children: e.mode === "below" ?
|
|
636
|
-
/* @__PURE__ */ r(
|
|
635
|
+
/* @__PURE__ */ r("span", { children: e.mode === "below" ? h("helpMeWriteTemplates.undo.addedBelow", { name: T }) : h("helpMeWriteTemplates.undo.replaced", { name: T }) }),
|
|
636
|
+
/* @__PURE__ */ r(N, { ref: f, intent: "outline", size: "sm", onClick: o, children: h("helpMeWriteTemplates.undo.undo") })
|
|
637
637
|
] })
|
|
638
638
|
}
|
|
639
639
|
);
|
|
@@ -642,92 +642,98 @@ function mr({
|
|
|
642
642
|
templates: e,
|
|
643
643
|
onGenerate: o,
|
|
644
644
|
onSaveTemplate: l,
|
|
645
|
-
onDeleteTemplate:
|
|
645
|
+
onDeleteTemplate: h,
|
|
646
646
|
onReorderTemplates: f,
|
|
647
647
|
credits: T,
|
|
648
648
|
enableDictation: a,
|
|
649
|
-
onApplied: t
|
|
649
|
+
onApplied: t,
|
|
650
|
+
creditsNotice: k
|
|
650
651
|
}) {
|
|
651
|
-
const [
|
|
652
|
-
(
|
|
652
|
+
const [s, u] = b({ open: !1, mode: "list" }), [D, w] = b(null), E = L(
|
|
653
|
+
(d = "list") => u({ open: !0, mode: d }),
|
|
653
654
|
[]
|
|
654
|
-
),
|
|
655
|
-
(
|
|
655
|
+
), z = L(
|
|
656
|
+
(d) => /* @__PURE__ */ r(
|
|
656
657
|
Re,
|
|
657
658
|
{
|
|
658
|
-
context:
|
|
659
|
+
context: d,
|
|
659
660
|
onGenerate: o,
|
|
660
661
|
credits: T,
|
|
661
662
|
enableDictation: a,
|
|
662
|
-
suspendClose:
|
|
663
|
+
suspendClose: s.open,
|
|
663
664
|
onApplied: t
|
|
664
665
|
}
|
|
665
666
|
),
|
|
666
|
-
[o, T, a,
|
|
667
|
-
),
|
|
668
|
-
const
|
|
667
|
+
[o, T, a, s.open, t]
|
|
668
|
+
), i = Y(() => {
|
|
669
|
+
const d = new Map(e.map((v) => [v.id, v]));
|
|
669
670
|
return {
|
|
670
671
|
templates: e,
|
|
671
|
-
onRun: ({ template:
|
|
672
|
-
const
|
|
673
|
-
return
|
|
674
|
-
template:
|
|
672
|
+
onRun: ({ template: v, text: W, scope: A, signal: S }) => {
|
|
673
|
+
const P = d.get(v.id);
|
|
674
|
+
return P ? o({
|
|
675
|
+
template: P,
|
|
675
676
|
prompt: "",
|
|
676
|
-
sourceText:
|
|
677
|
-
scope:
|
|
678
|
-
signal:
|
|
677
|
+
sourceText: W,
|
|
678
|
+
scope: A,
|
|
679
|
+
signal: S
|
|
679
680
|
}) : Promise.reject(new Error("Unknown template"));
|
|
680
681
|
},
|
|
681
|
-
onManage: l ?
|
|
682
|
+
onManage: l ? E : void 0
|
|
682
683
|
};
|
|
683
|
-
}, [e, o, l,
|
|
684
|
-
(
|
|
685
|
-
if (
|
|
686
|
-
const
|
|
687
|
-
var
|
|
688
|
-
return
|
|
689
|
-
}),
|
|
684
|
+
}, [e, o, l, E]), g = L(
|
|
685
|
+
(d) => {
|
|
686
|
+
if (d.action !== "template" || !d.template) return;
|
|
687
|
+
const v = e.find((A) => {
|
|
688
|
+
var S;
|
|
689
|
+
return A.id === ((S = d.template) == null ? void 0 : S.id);
|
|
690
|
+
}), W = {
|
|
690
691
|
mode: "replace",
|
|
691
|
-
template:
|
|
692
|
-
previousHtml:
|
|
693
|
-
undo:
|
|
692
|
+
template: v,
|
|
693
|
+
previousHtml: d.previousHtml,
|
|
694
|
+
undo: d.undo
|
|
694
695
|
};
|
|
695
|
-
|
|
696
|
+
w(v ? W : null), t == null || t(W);
|
|
696
697
|
},
|
|
697
698
|
[e, t]
|
|
698
|
-
),
|
|
699
|
+
), c = Y(
|
|
699
700
|
() => l ? /* @__PURE__ */ r(
|
|
700
701
|
Pe,
|
|
701
702
|
{
|
|
702
|
-
open:
|
|
703
|
-
initialMode:
|
|
704
|
-
onOpenChange: (
|
|
703
|
+
open: s.open,
|
|
704
|
+
initialMode: s.mode,
|
|
705
|
+
onOpenChange: (d) => u((v) => ({ ...v, open: d })),
|
|
705
706
|
templates: e,
|
|
706
707
|
onSaveTemplate: l,
|
|
707
|
-
onDeleteTemplate:
|
|
708
|
+
onDeleteTemplate: h,
|
|
708
709
|
onReorderTemplates: f
|
|
709
710
|
}
|
|
710
711
|
) : null,
|
|
711
|
-
[
|
|
712
|
-
),
|
|
712
|
+
[s, e, l, h, f]
|
|
713
|
+
), C = /* @__PURE__ */ r(
|
|
713
714
|
Le,
|
|
714
715
|
{
|
|
715
|
-
applied:
|
|
716
|
+
applied: D,
|
|
716
717
|
onUndo: () => {
|
|
717
|
-
|
|
718
|
+
D == null || D.undo(), w(null);
|
|
718
719
|
},
|
|
719
|
-
onDismiss: () =>
|
|
720
|
+
onDismiss: () => w(null)
|
|
720
721
|
}
|
|
721
|
-
),
|
|
722
|
-
() => ({
|
|
723
|
-
|
|
722
|
+
), I = Y(
|
|
723
|
+
() => ({
|
|
724
|
+
renderHelpMeWrite: z,
|
|
725
|
+
aiTemplates: i,
|
|
726
|
+
onAiApplied: g,
|
|
727
|
+
aiCreditsNotice: k
|
|
728
|
+
}),
|
|
729
|
+
[z, i, g, k]
|
|
724
730
|
);
|
|
725
731
|
return {
|
|
726
|
-
...
|
|
727
|
-
editorProps:
|
|
728
|
-
manager:
|
|
729
|
-
undoNotice:
|
|
730
|
-
openManager:
|
|
732
|
+
...I,
|
|
733
|
+
editorProps: I,
|
|
734
|
+
manager: c,
|
|
735
|
+
undoNotice: C,
|
|
736
|
+
openManager: E
|
|
731
737
|
};
|
|
732
738
|
}
|
|
733
739
|
export {
|
|
@@ -738,4 +744,4 @@ export {
|
|
|
738
744
|
Le as c,
|
|
739
745
|
mr as u
|
|
740
746
|
};
|
|
741
|
-
//# sourceMappingURL=help-me-write-templates-
|
|
747
|
+
//# sourceMappingURL=help-me-write-templates-DHIwa4xR.js.map
|