@alfadocs/ui-kit 1.44.0 → 1.46.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-D43ASl8y.js → booking-B7gA9gFB.js} +279 -296
- 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-DBYAtdyd.js → calendar-workspace-BB-BZT7W.js} +3002 -2912
- 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/{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-CY4KmDo-.js → notes-panel-CHbDDMx8.js} +83 -73
- package/dist/_chunks/{patient-details-C8ImUrVg.js → patient-details-DUj1htsH.js} +2 -2
- package/dist/_chunks/{patient-field-row-BRSOKvme.js → patient-field-row-CO0WR7yA.js} +2 -2
- package/dist/_chunks/{patient-summary-card-BhmKB2KR.js → patient-summary-card-DNzdYjxE.js} +59 -45
- package/dist/_chunks/rich-text-editor-BwDV2XkZ.js +4153 -0
- 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 +32 -4
- package/dist/agent-i18n/en.json +1 -1
- 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 +24 -0
- package/dist/components/ai-sparkle/index.d.ts +3 -0
- package/dist/components/ai-sparkle/index.js +5 -0
- 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/index.js +1 -1
- 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/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 +5 -3
- 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/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/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 -0
- package/dist/hooks/index.js +54 -48
- package/dist/hooks/use-ai-sparkle.d.ts +91 -0
- package/dist/host-compat.css +2 -2
- package/dist/i18n/locales/ar.d.ts +31 -0
- package/dist/i18n/locales/ar.js +33 -2
- package/dist/i18n/locales/de.d.ts +31 -0
- package/dist/i18n/locales/de.js +33 -2
- package/dist/i18n/locales/el.d.ts +31 -0
- package/dist/i18n/locales/el.js +33 -2
- package/dist/i18n/locales/en.d.ts +31 -0
- package/dist/i18n/locales/en.js +33 -2
- package/dist/i18n/locales/es.d.ts +31 -0
- package/dist/i18n/locales/es.js +33 -2
- package/dist/i18n/locales/fr.d.ts +31 -0
- package/dist/i18n/locales/fr.js +33 -2
- package/dist/i18n/locales/hi.d.ts +31 -0
- package/dist/i18n/locales/hi.js +33 -2
- package/dist/i18n/locales/it.d.ts +31 -0
- package/dist/i18n/locales/it.js +33 -2
- package/dist/i18n/locales/ja.d.ts +31 -0
- package/dist/i18n/locales/ja.js +33 -2
- package/dist/i18n/locales/nl.d.ts +31 -0
- package/dist/i18n/locales/nl.js +33 -2
- package/dist/i18n/locales/pl.d.ts +31 -0
- package/dist/i18n/locales/pl.js +33 -2
- package/dist/i18n/locales/pt.d.ts +31 -0
- package/dist/i18n/locales/pt.js +33 -2
- package/dist/i18n/locales/ro.d.ts +31 -0
- package/dist/i18n/locales/ro.js +33 -2
- package/dist/i18n/locales/ru.d.ts +31 -0
- package/dist/i18n/locales/ru.js +33 -2
- package/dist/i18n/locales/sq.d.ts +31 -0
- package/dist/i18n/locales/sq.js +33 -2
- package/dist/i18n/locales/sv.d.ts +31 -0
- package/dist/i18n/locales/sv.js +33 -2
- package/dist/i18n/locales/tr.d.ts +31 -0
- package/dist/i18n/locales/tr.js +33 -2
- package/dist/i18n/locales/zh.d.ts +31 -0
- package/dist/i18n/locales/zh.js +33 -2
- package/dist/index.js +1113 -1102
- package/dist/locales/ar.json +33 -2
- package/dist/locales/de.json +33 -2
- package/dist/locales/el.json +33 -2
- package/dist/locales/en.json +33 -2
- package/dist/locales/es.json +33 -2
- package/dist/locales/fr.json +33 -2
- package/dist/locales/hi.json +33 -2
- package/dist/locales/it.json +33 -2
- package/dist/locales/ja.json +33 -2
- package/dist/locales/nl.json +33 -2
- package/dist/locales/pl.json +33 -2
- package/dist/locales/pt.json +33 -2
- package/dist/locales/ro.json +33 -2
- package/dist/locales/ru.json +33 -2
- package/dist/locales/sq.json +33 -2
- package/dist/locales/sv.json +33 -2
- package/dist/locales/tr.json +33 -2
- package/dist/locales/zh.json +33 -2
- package/dist/patterns/anamnesis/index.js +1 -1
- package/dist/patterns/calendar/calendar-workspace.d.ts +6 -4
- package/dist/patterns/calendar/calendar.data.d.ts +9 -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 +3 -1
- 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/button-group-R32U7SyV.js +0 -307
- package/dist/_chunks/rich-text-editor-BYE6kK4u.js +0 -3839
- package/dist/components/ai-consent-banner/index.d.ts +0 -4
|
@@ -65,6 +65,10 @@ export interface HoverCardContentProps extends Omit<ComponentPropsWithoutRef<typ
|
|
|
65
65
|
export interface HoverCardHeadingProps extends HTMLAttributes<HTMLHeadingElement> {
|
|
66
66
|
as?: 'h2' | 'h3' | 'h4' | 'h5' | 'h6';
|
|
67
67
|
}
|
|
68
|
+
export declare function useHoverCardTiming(): {
|
|
69
|
+
cancelClose: () => void;
|
|
70
|
+
closeWithDelay: () => void;
|
|
71
|
+
};
|
|
68
72
|
export declare const HoverCard: typeof HoverCardRoot & {
|
|
69
73
|
Root: typeof HoverCardRoot;
|
|
70
74
|
Trigger: import("react").ForwardRefExoticComponent<Omit<RadixPopover.PopoverTriggerProps & import("react").RefAttributes<HTMLButtonElement>, "ref"> & import("react").RefAttributes<HTMLButtonElement>>;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export { HoverCard } from './hover-card';
|
|
1
|
+
export { HoverCard, useHoverCardTiming } from './hover-card';
|
|
2
2
|
export type { HoverCardProps, HoverCardContentProps, HoverCardHeadingProps, HoverCardTriggerProps, HoverCardAnchorProps, HoverCardHandle, HoverCardSide, } from './hover-card';
|
|
3
3
|
export { hoverCardAgent } from './hover-card.agent';
|
|
4
4
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1,6 +1,7 @@
|
|
|
1
|
-
import { H as e, h as o } from "../../_chunks/hover-card-
|
|
1
|
+
import { H as e, h as o, u as s } from "../../_chunks/hover-card-nUae8NPJ.js";
|
|
2
2
|
export {
|
|
3
3
|
e as HoverCard,
|
|
4
|
-
o as hoverCardAgent
|
|
4
|
+
o as hoverCardAgent,
|
|
5
|
+
s as useHoverCardTiming
|
|
5
6
|
};
|
|
6
7
|
//# sourceMappingURL=index.js.map
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
export { usePrefersReducedMotion, useMediaQuery, useScrollToFirstError, useLocale, useTheme, resolveTheme, themeClassList, THEME_CLASS, THEME_STORAGE_KEY, ACCESSIBILITY_STORAGE_KEY, useSigningSession, useZoomDrilldown, ZOOM_DRILLDOWN_TRANSITION_CLASS, } from '../hooks';
|
|
2
|
-
export type { LocaleDir, UseLocaleReturn, UseScrollToFirstErrorOptions, ThemePreference, AccessibilityPreference, ResolvedTheme, UseThemeReturn, SigningField, SigningFieldBase, UseSigningSessionReturn, UseZoomDrilldownOptions, UseZoomDrilldownReturn, } from '../hooks';
|
|
1
|
+
export { usePrefersReducedMotion, useMediaQuery, useScrollToFirstError, useLocale, useTheme, resolveTheme, themeClassList, THEME_CLASS, THEME_STORAGE_KEY, ACCESSIBILITY_STORAGE_KEY, useSigningSession, useZoomDrilldown, ZOOM_DRILLDOWN_TRANSITION_CLASS, useAiSparkle, } from '../hooks';
|
|
2
|
+
export type { LocaleDir, UseLocaleReturn, UseScrollToFirstErrorOptions, ThemePreference, AccessibilityPreference, ResolvedTheme, UseThemeReturn, SigningField, SigningFieldBase, UseSigningSessionReturn, UseZoomDrilldownOptions, UseZoomDrilldownReturn, AiSparkleState, UseAiSparkleOptions, UseAiSparkleReturn, } from '../hooks';
|
|
3
3
|
export * from './button';
|
|
4
4
|
export * from './button-group';
|
|
5
5
|
export * from './floating-action-button';
|
|
@@ -117,7 +117,8 @@ export * from './tabs';
|
|
|
117
117
|
export * from './theme-toggle';
|
|
118
118
|
export * from './agenda-card';
|
|
119
119
|
export * from './agenda-tray';
|
|
120
|
-
export * from './ai-
|
|
120
|
+
export * from './ai-permission-notice';
|
|
121
|
+
export * from './ai-credits-notice';
|
|
121
122
|
export * from './alert';
|
|
122
123
|
export * from './appointment-card';
|
|
123
124
|
export * from './appointment-peek';
|
|
@@ -161,6 +162,7 @@ export * from './unit-converter';
|
|
|
161
162
|
export * from './visually-hidden';
|
|
162
163
|
export * from './chart';
|
|
163
164
|
export * from './ai-prompt-input';
|
|
165
|
+
export * from './ai-sparkle';
|
|
164
166
|
export * from './audio-recorder';
|
|
165
167
|
export * from './audio-visualiser';
|
|
166
168
|
export * from './chat-container';
|
|
@@ -169,6 +169,16 @@ export interface NotesPanelProps extends Omit<HTMLAttributes<HTMLElement>, 'titl
|
|
|
169
169
|
onUploadImage?: RichTextEditorProps['onUploadImage'];
|
|
170
170
|
/** An AI call ran out of credits. See `RichTextEditor`. */
|
|
171
171
|
onAiCreditsExhausted?: RichTextEditorProps['onAiCreditsExhausted'];
|
|
172
|
+
/** Show the editor extensions affordance. See `RichTextEditor`. */
|
|
173
|
+
showExtensions?: RichTextEditorProps['showExtensions'];
|
|
174
|
+
extensions?: RichTextEditorProps['extensions'];
|
|
175
|
+
extensionContext?: RichTextEditorProps['extensionContext'];
|
|
176
|
+
onExtensionRun?: RichTextEditorProps['onExtensionRun'];
|
|
177
|
+
/**
|
|
178
|
+
* Shows the AI-credits/bundles hover card on every AI action trigger in
|
|
179
|
+
* the composer. See `RichTextEditor`.
|
|
180
|
+
*/
|
|
181
|
+
aiCreditsNotice?: RichTextEditorProps['aiCreditsNotice'];
|
|
172
182
|
/**
|
|
173
183
|
* Rendered just above the composer — e.g. the Help-me-write templates
|
|
174
184
|
* pattern's `undoNotice`. Renders in both add and edit mode, whenever the
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { B as s, C as l, N as n, P as t, a as C, T as i, b as o, g as T, u as p } from "../../_chunks/balance-badge-cell-
|
|
1
|
+
import { B as s, C as l, N as n, P as t, a as C, T as i, b as o, g as T, u as p } from "../../_chunks/balance-badge-cell-YGrYdrvR.js";
|
|
2
2
|
export {
|
|
3
3
|
s as BalanceBadgeCell,
|
|
4
4
|
l as CarePlanStatusCell,
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
import type { ReactNode } from 'react';
|
|
2
|
+
import type { TFunction } from 'i18next';
|
|
3
|
+
import type { InsertPayload } from '../_shared/insert-result';
|
|
4
|
+
import type { HelpMeWriteRenderContext } from './rich-text-editor';
|
|
5
|
+
export type EditorExtensionContext = 'note' | 'diagnosis' | 'document' | string;
|
|
6
|
+
export interface EditorExtensionRenderContext {
|
|
7
|
+
html: string;
|
|
8
|
+
text: string;
|
|
9
|
+
selectionText: HelpMeWriteRenderContext['selectionText'];
|
|
10
|
+
scope: HelpMeWriteRenderContext['scope'];
|
|
11
|
+
/** Inserts at the captured selection, then closes. Image modes require an upload seam. */
|
|
12
|
+
insert: (payload: InsertPayload) => Promise<void>;
|
|
13
|
+
close: () => void;
|
|
14
|
+
signal: AbortSignal;
|
|
15
|
+
}
|
|
16
|
+
export type EditorExtensionRunContext = EditorExtensionRenderContext;
|
|
17
|
+
/** Outcomes contain no editor content or host error messages. */
|
|
18
|
+
export type EditorExtensionRunResult = {
|
|
19
|
+
status: 'success';
|
|
20
|
+
} | {
|
|
21
|
+
status: 'error';
|
|
22
|
+
} | {
|
|
23
|
+
status: 'aborted';
|
|
24
|
+
};
|
|
25
|
+
export interface EditorExtension {
|
|
26
|
+
id: string;
|
|
27
|
+
/** Translated host label, or a kit translation key. */
|
|
28
|
+
label: string;
|
|
29
|
+
description?: string;
|
|
30
|
+
icon?: ReactNode;
|
|
31
|
+
/** Absent means everywhere. Restricted entries require a matching editor context. */
|
|
32
|
+
contexts?: EditorExtensionContext[];
|
|
33
|
+
source?: {
|
|
34
|
+
kind: 'kit' | 'marketplace';
|
|
35
|
+
appName?: string;
|
|
36
|
+
appIconUrl?: string;
|
|
37
|
+
};
|
|
38
|
+
kind: 'panel' | 'action';
|
|
39
|
+
render?: (ctx: EditorExtensionRenderContext) => ReactNode;
|
|
40
|
+
run?: (ctx: EditorExtensionRunContext) => Promise<InsertPayload | null>;
|
|
41
|
+
}
|
|
42
|
+
/**
|
|
43
|
+
* Resolve an extension's `label` for display.
|
|
44
|
+
*
|
|
45
|
+
* `label` is either a kit translation key or a string the host has already
|
|
46
|
+
* translated, so it has to survive the round trip untouched when it is the
|
|
47
|
+
* latter. i18next reads `:` as its namespace separator and splits any key on
|
|
48
|
+
* it unless the key also carries a space, comma, `?`, `!` or `;` — so a host
|
|
49
|
+
* label like `ICD-10:lookup` came back as `lookup`, the prefix silently eaten
|
|
50
|
+
* (caught in review on #183). `nsSeparator: false` turns that parse off, and
|
|
51
|
+
* `defaultValue` returns the label verbatim when there is no key to look up.
|
|
52
|
+
*/
|
|
53
|
+
export declare function resolveExtensionLabel(t: TFunction, label: string): string;
|
|
54
|
+
//# sourceMappingURL=editor-extensions.d.ts.map
|
|
@@ -31,6 +31,7 @@ export interface EditorToolbarProps {
|
|
|
31
31
|
* wired to a menu.
|
|
32
32
|
*/
|
|
33
33
|
showExtensions?: boolean;
|
|
34
|
+
extensionControl?: ReactNode;
|
|
34
35
|
/** Template variables for the "Insert variable" menu (hidden when empty). */
|
|
35
36
|
variables?: RichTextEditorVariable[];
|
|
36
37
|
/** Most-recently-used tokens, most recent first — rendered as the menu's
|
|
@@ -100,5 +101,5 @@ export interface SelectionFloatingToolbarProps {
|
|
|
100
101
|
children?: ReactNode;
|
|
101
102
|
}
|
|
102
103
|
export declare function SelectionFloatingToolbar({ active, run, areaRef, getEditorRoot, suppressed, holdOpen, children, }: SelectionFloatingToolbarProps): React.JSX.Element | null;
|
|
103
|
-
export declare function EditorToolbar({ run, active, preset, insertHtml, insertTable, saveSelection, restoreSelection, getSelectedText, uploadImage, enableColor, enableImage, enableTable, showExtensions, variables, recentVariableTokens, insertVariable, }: EditorToolbarProps): React.JSX.Element;
|
|
104
|
+
export declare function EditorToolbar({ run, active, preset, insertHtml, insertTable, saveSelection, restoreSelection, getSelectedText, uploadImage, enableColor, enableImage, enableTable, showExtensions, extensionControl, variables, recentVariableTokens, insertVariable, }: EditorToolbarProps): React.JSX.Element;
|
|
104
105
|
//# sourceMappingURL=editor-toolbar.d.ts.map
|
|
@@ -21,5 +21,9 @@ export interface HelpMeWriteOverlayProps {
|
|
|
21
21
|
onFinalTranscript: (text: string) => void;
|
|
22
22
|
}) => Promise<void>;
|
|
23
23
|
}
|
|
24
|
+
/** Shared safe failure surface for requests made from the editor dock. */
|
|
25
|
+
export declare function EditorRequestError({ id }: {
|
|
26
|
+
id?: string;
|
|
27
|
+
}): React.JSX.Element;
|
|
24
28
|
export declare function HelpMeWriteOverlay({ open, onClose, onRequestAiDraft, onInsert, previewAsHtml, privacyNotice, onDictate, }: HelpMeWriteOverlayProps): React.JSX.Element;
|
|
25
29
|
//# sourceMappingURL=help-me-write-overlay.d.ts.map
|
|
@@ -1,4 +1,6 @@
|
|
|
1
1
|
export { RichTextEditor, wrapperVariants } from './rich-text-editor';
|
|
2
2
|
export type { RichTextEditorHandle, RichTextEditorProps, RichTextEditorToolbar, RedactorFactory, AiConsentGate, RichTextEditorVariable, HelpMeWriteRenderContext, RichTextEditorAiTemplate, RichTextEditorAiTemplates, RichTextEditorAiActionRequest, RichTextEditorAiApplied, } from './rich-text-editor';
|
|
3
3
|
export { richTextEditorAgent } from './rich-text-editor.agent';
|
|
4
|
+
export type { EditorExtension, EditorExtensionContext, EditorExtensionRenderContext, EditorExtensionRunContext, EditorExtensionRunResult, } from './editor-extensions';
|
|
5
|
+
export { kitEditorExtensions } from './kit-extensions';
|
|
4
6
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1,7 +1,9 @@
|
|
|
1
|
-
import { R as
|
|
1
|
+
import { R as i, r as o, w as a } from "../../_chunks/rich-text-editor-BwDV2XkZ.js";
|
|
2
|
+
import { k as s } from "../../_chunks/kit-extensions-DuoFF1R3.js";
|
|
2
3
|
export {
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
4
|
+
i as RichTextEditor,
|
|
5
|
+
s as kitEditorExtensions,
|
|
6
|
+
o as richTextEditorAgent,
|
|
7
|
+
a as wrapperVariants
|
|
6
8
|
};
|
|
7
9
|
//# sourceMappingURL=index.js.map
|
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
import { type ReactNode } from 'react';
|
|
2
2
|
import '../../tokens/themes/bridges/redactor-theme.css';
|
|
3
|
-
import { type AiConsentBannerHeadingLevel } from '../ai-
|
|
3
|
+
import { type AiConsentBannerHeadingLevel } from '../ai-permission-notice';
|
|
4
|
+
import type { EditorExtension, EditorExtensionContext, EditorExtensionRunResult } from './editor-extensions';
|
|
5
|
+
import { type AiCreditsNoticeProps } from '../ai-credits-notice';
|
|
4
6
|
export type RedactorFactory = (selector: string | HTMLElement, command?: unknown, ...args: unknown[]) => unknown;
|
|
5
7
|
export type RichTextEditorToolbar = 'minimal' | 'standard' | 'full';
|
|
6
8
|
/**
|
|
@@ -149,8 +151,11 @@ export interface RichTextEditorProps {
|
|
|
149
151
|
ariaLabel?: string;
|
|
150
152
|
/** Size variant for the minimum block-size of the editing region. */
|
|
151
153
|
minHeight?: 'sm' | 'md' | 'lg' | 'fill';
|
|
152
|
-
/**
|
|
154
|
+
/** @deprecated Pass extensions instead. Forces the disabled placeholder for one release. */
|
|
153
155
|
showExtensions?: boolean;
|
|
156
|
+
extensions?: EditorExtension[];
|
|
157
|
+
extensionContext?: EditorExtensionContext;
|
|
158
|
+
onExtensionRun?: (id: string, result: EditorExtensionRunResult) => void;
|
|
154
159
|
/** Extra class names on the wrapper. */
|
|
155
160
|
className?: string;
|
|
156
161
|
/** Inject the Redactor factory explicitly; else `window.$R` / `window.Redactor`. */
|
|
@@ -285,6 +290,17 @@ export interface RichTextEditorProps {
|
|
|
285
290
|
* error line shows.
|
|
286
291
|
*/
|
|
287
292
|
onAiCreditsExhausted?: () => void;
|
|
293
|
+
/**
|
|
294
|
+
* Shows an `AiCreditsNotice` hover card on every AI action trigger — the
|
|
295
|
+
* pill's segments (dictation, templates, proofread, auto-format,
|
|
296
|
+
* Help me write), the selection bubble's AI buttons, and both mics. Omit
|
|
297
|
+
* it for today's ungated behaviour: no card, no change. Present, it
|
|
298
|
+
* replaces any tooltip a wrapped trigger would otherwise show (one
|
|
299
|
+
* floating layer per trigger, never two) and never interferes with the
|
|
300
|
+
* consent gate — the button's own click still runs the action, or opens
|
|
301
|
+
* the gate, exactly as it does without this prop.
|
|
302
|
+
*/
|
|
303
|
+
aiCreditsNotice?: AiCreditsNoticeProps;
|
|
288
304
|
}
|
|
289
305
|
/** Block/inline formats the editor can toggle via `applyFormat`. */
|
|
290
306
|
export type EditorFormat = 'bold' | 'italic' | 'strikethrough' | 'bulletedList' | 'numberedList' | 'heading' | 'quote' | 'paragraph';
|
package/dist/hooks/index.d.ts
CHANGED
|
@@ -30,4 +30,5 @@ export { usePresenceTransition, type PresencePhase, type UsePresenceTransitionOp
|
|
|
30
30
|
export { useListReflow, REFLOW_ROW_CLASS, type UseListReflowOptions, type UseListReflowReturn, } from './use-list-reflow';
|
|
31
31
|
export { useClampOverflow } from './use-clamp-overflow';
|
|
32
32
|
export { useScrollOverflow, type UseScrollOverflowReturn, } from './use-scroll-overflow';
|
|
33
|
+
export { useAiSparkle, SHIMMER_CLASS as AI_SPARKLE_SHIMMER_CLASS, COMET_CLASS as AI_SPARKLE_COMET_CLASS, COMET_TAIL as AI_SPARKLE_COMET_TAIL, COMET_WRAPPER_CLASS as AI_SPARKLE_COMET_WRAPPER_CLASS, type AiSparkleState, type UseAiSparkleOptions, type UseAiSparkleProps, type UseAiSparkleReturn, } from './use-ai-sparkle';
|
|
33
34
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/hooks/index.js
CHANGED
|
@@ -1,40 +1,41 @@
|
|
|
1
|
-
import { u as
|
|
2
|
-
import { u as
|
|
3
|
-
import { Z as
|
|
4
|
-
import { u as
|
|
5
|
-
import { u as
|
|
6
|
-
import { A as
|
|
1
|
+
import { u as O } from "../_chunks/use-prefers-reduced-motion-BMwIQRjB.js";
|
|
2
|
+
import { u as h } from "../_chunks/use-media-query-CcAx5SMM.js";
|
|
3
|
+
import { Z as y, u as I, a as w, b as D } from "../_chunks/use-zoom-drilldown-qCX34w9I.js";
|
|
4
|
+
import { u as F } from "../_chunks/use-count-up-BLLetaZ8.js";
|
|
5
|
+
import { u as K } from "../_chunks/use-locale-BkCIHujH.js";
|
|
6
|
+
import { A as k, T as W, a as H, r as V, t as N, u as Y } from "../_chunks/use-theme-CAuo6EYT.js";
|
|
7
7
|
import { u as q } from "../_chunks/use-controllable-state-BiY4xTzM.js";
|
|
8
8
|
import { u as G } from "../_chunks/use-copy-to-clipboard-Cyfc_dlv.js";
|
|
9
9
|
import { u as j } from "../_chunks/use-debounced-callback-BisrB-Fq.js";
|
|
10
|
-
import { useState as
|
|
10
|
+
import { useState as x, useRef as E, useEffect as S } from "react";
|
|
11
11
|
import { u as Q, a as J } from "../_chunks/use-direction-Dp8h70PP.js";
|
|
12
12
|
import { u as $ } from "../_chunks/use-persistent-state-nZwZAnE9.js";
|
|
13
13
|
import { u as te } from "../_chunks/use-isomorphic-layout-effect-BGfaCOP1.js";
|
|
14
|
-
import { u as oe, a as
|
|
14
|
+
import { u as oe, a as se } from "../_chunks/use-scroll-overflow-UbLrUfBo.js";
|
|
15
15
|
import { c as ne, u as ae } from "../_chunks/use-priority-overflow-c9SjxZkZ.js";
|
|
16
16
|
import { u as ce } from "../_chunks/use-web-otp-D_utzp6S.js";
|
|
17
17
|
import { u as fe } from "../_chunks/use-visual-viewport-pin-ChurOsHM.js";
|
|
18
18
|
import { u as de } from "../_chunks/use-edge-resize-BHesP0kg.js";
|
|
19
|
-
import { u as
|
|
20
|
-
import { u as
|
|
21
|
-
import { R as
|
|
22
|
-
import { u as
|
|
23
|
-
import { u as
|
|
19
|
+
import { u as Ee } from "../_chunks/use-countdown-Yd6ts0_a.js";
|
|
20
|
+
import { u as xe } from "../_chunks/use-check-animation--I3cS00X.js";
|
|
21
|
+
import { R as be, u as Ce, a as Le } from "../_chunks/use-list-reflow-Cw43nxw5.js";
|
|
22
|
+
import { u as _e } from "../_chunks/use-presence-transition-cDwWUXV-.js";
|
|
23
|
+
import { u as Re } from "../_chunks/use-clamp-overflow-DQE2kwZ9.js";
|
|
24
|
+
import { b as ve, C as ye, a as Ie, S as we, u as De } from "../_chunks/use-ai-sparkle-Cf4yVTLB.js";
|
|
24
25
|
function C(e, o) {
|
|
25
|
-
const [t, i] =
|
|
26
|
-
return
|
|
26
|
+
const [t, i] = x(e), s = E(null);
|
|
27
|
+
return S(() => {
|
|
27
28
|
if (o <= 0) {
|
|
28
|
-
|
|
29
|
+
s.current !== null && (clearTimeout(s.current), s.current = null), i(e);
|
|
29
30
|
return;
|
|
30
31
|
}
|
|
31
32
|
const n = setTimeout(() => {
|
|
32
|
-
i(e),
|
|
33
|
+
i(e), s.current = null;
|
|
33
34
|
}, o);
|
|
34
|
-
return
|
|
35
|
+
return s.current = n, () => clearTimeout(n);
|
|
35
36
|
}, [e, o]), t;
|
|
36
37
|
}
|
|
37
|
-
const
|
|
38
|
+
const A = [
|
|
38
39
|
"a[href]",
|
|
39
40
|
"button:not([disabled])",
|
|
40
41
|
'input:not([disabled]):not([type="hidden"])',
|
|
@@ -47,7 +48,7 @@ const S = [
|
|
|
47
48
|
].join(",");
|
|
48
49
|
function p(e) {
|
|
49
50
|
return Array.from(
|
|
50
|
-
e.querySelectorAll(
|
|
51
|
+
e.querySelectorAll(A)
|
|
51
52
|
).filter((o) => {
|
|
52
53
|
if (o.hidden) return !1;
|
|
53
54
|
let t = o;
|
|
@@ -59,52 +60,57 @@ function p(e) {
|
|
|
59
60
|
});
|
|
60
61
|
}
|
|
61
62
|
function L(e, o = {}) {
|
|
62
|
-
const { enabled: t = !0, autoFocus: i = !0, restoreFocus:
|
|
63
|
-
|
|
63
|
+
const { enabled: t = !0, autoFocus: i = !0, restoreFocus: s = !0 } = o, n = E(null);
|
|
64
|
+
S(() => {
|
|
64
65
|
if (!t) return;
|
|
65
66
|
const a = e.current;
|
|
66
67
|
if (!a) return;
|
|
67
68
|
if (n.current = typeof document < "u" && document.activeElement instanceof HTMLElement ? document.activeElement : null, i) {
|
|
68
|
-
const
|
|
69
|
-
|
|
69
|
+
const u = p(a)[0] ?? (a.tabIndex >= -1 ? a : null);
|
|
70
|
+
u == null || u.focus();
|
|
70
71
|
}
|
|
71
72
|
function f(r) {
|
|
72
73
|
if (r.key !== "Tab") return;
|
|
73
|
-
const
|
|
74
|
-
if (!
|
|
75
|
-
const c = p(
|
|
74
|
+
const u = e.current;
|
|
75
|
+
if (!u) return;
|
|
76
|
+
const c = p(u);
|
|
76
77
|
if (c.length === 0) {
|
|
77
78
|
r.preventDefault();
|
|
78
79
|
return;
|
|
79
80
|
}
|
|
80
81
|
const m = c[0], d = c[c.length - 1], l = document.activeElement;
|
|
81
|
-
r.shiftKey ? (l === m || !
|
|
82
|
+
r.shiftKey ? (l === m || !u.contains(l)) && (r.preventDefault(), d.focus()) : (l === d || !u.contains(l)) && (r.preventDefault(), m.focus());
|
|
82
83
|
}
|
|
83
84
|
return a.addEventListener("keydown", f), () => {
|
|
84
|
-
if (a.removeEventListener("keydown", f),
|
|
85
|
+
if (a.removeEventListener("keydown", f), s && n.current) {
|
|
85
86
|
const r = n.current;
|
|
86
87
|
requestAnimationFrame(() => {
|
|
87
88
|
r.isConnected && r.focus();
|
|
88
89
|
});
|
|
89
90
|
}
|
|
90
91
|
};
|
|
91
|
-
}, [t, i,
|
|
92
|
+
}, [t, i, s, e]);
|
|
92
93
|
}
|
|
93
94
|
export {
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
95
|
+
k as ACCESSIBILITY_STORAGE_KEY,
|
|
96
|
+
ve as AI_SPARKLE_COMET_CLASS,
|
|
97
|
+
ye as AI_SPARKLE_COMET_TAIL,
|
|
98
|
+
Ie as AI_SPARKLE_COMET_WRAPPER_CLASS,
|
|
99
|
+
we as AI_SPARKLE_SHIMMER_CLASS,
|
|
100
|
+
be as REFLOW_ROW_CLASS,
|
|
101
|
+
W as THEME_CLASS,
|
|
102
|
+
H as THEME_STORAGE_KEY,
|
|
103
|
+
y as ZOOM_DRILLDOWN_TRANSITION_CLASS,
|
|
99
104
|
ne as computePriorityLayout,
|
|
100
|
-
|
|
105
|
+
V as resolveTheme,
|
|
101
106
|
N as themeClassList,
|
|
102
|
-
|
|
103
|
-
|
|
107
|
+
De as useAiSparkle,
|
|
108
|
+
xe as useCheckAnimation,
|
|
109
|
+
Re as useClampOverflow,
|
|
104
110
|
q as useControllableState,
|
|
105
111
|
G as useCopyToClipboard,
|
|
106
|
-
|
|
107
|
-
|
|
112
|
+
F as useCountUp,
|
|
113
|
+
Ee as useCountdown,
|
|
108
114
|
j as useDebouncedCallback,
|
|
109
115
|
C as useDebouncedValue,
|
|
110
116
|
Q as useDirection,
|
|
@@ -114,19 +120,19 @@ export {
|
|
|
114
120
|
L as useFocusTrap,
|
|
115
121
|
te as useIsomorphicLayoutEffect,
|
|
116
122
|
Le as useListReflow,
|
|
117
|
-
|
|
118
|
-
|
|
123
|
+
K as useLocale,
|
|
124
|
+
h as useMediaQuery,
|
|
119
125
|
oe as useOverflowCollapse,
|
|
120
126
|
$ as usePersistentState,
|
|
121
|
-
|
|
122
|
-
|
|
127
|
+
O as usePrefersReducedMotion,
|
|
128
|
+
_e as usePresenceTransition,
|
|
123
129
|
ae as usePriorityOverflow,
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
130
|
+
se as useScrollOverflow,
|
|
131
|
+
I as useScrollToFirstError,
|
|
132
|
+
w as useSigningSession,
|
|
127
133
|
Y as useTheme,
|
|
128
134
|
fe as useVisualViewportPin,
|
|
129
135
|
ce as useWebOtp,
|
|
130
|
-
|
|
136
|
+
D as useZoomDrilldown
|
|
131
137
|
};
|
|
132
138
|
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1,91 @@
|
|
|
1
|
+
/** Where the sparkle is: on first show, while an action runs, as it lands. */
|
|
2
|
+
export type AiSparkleState = 'intro' | 'working' | 'landed';
|
|
3
|
+
export declare const SHIMMER_CLASS: Record<AiSparkleState, string>;
|
|
4
|
+
export declare const COMET_CLASS: Record<AiSparkleState, string>;
|
|
5
|
+
export declare const COMET_WRAPPER_CLASS = "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]";
|
|
6
|
+
export declare const COMET_TAIL: readonly [{
|
|
7
|
+
readonly key: 1;
|
|
8
|
+
readonly lag: "ds:[animation-delay:calc(var(--animation-duration)*0.2)]";
|
|
9
|
+
readonly dot: "ds:size-2.5 ds:opacity-[var(--opacity-90)]";
|
|
10
|
+
}, {
|
|
11
|
+
readonly key: 2;
|
|
12
|
+
readonly lag: "ds:[animation-delay:calc(var(--animation-duration)*0.4)]";
|
|
13
|
+
readonly dot: "ds:size-2 ds:opacity-[var(--opacity-70)]";
|
|
14
|
+
}, {
|
|
15
|
+
readonly key: 3;
|
|
16
|
+
readonly lag: "ds:[animation-delay:calc(var(--animation-duration)*0.6)]";
|
|
17
|
+
readonly dot: "ds:size-2 ds:opacity-[var(--opacity-50)]";
|
|
18
|
+
}, {
|
|
19
|
+
readonly key: 4;
|
|
20
|
+
readonly lag: "ds:[animation-delay:calc(var(--animation-duration)*0.8)]";
|
|
21
|
+
readonly dot: "ds:size-1.5 ds:opacity-[var(--opacity-30)]";
|
|
22
|
+
}, {
|
|
23
|
+
readonly key: 5;
|
|
24
|
+
readonly lag: "ds:[animation-delay:calc(var(--animation-duration)*1)]";
|
|
25
|
+
readonly dot: "ds:size-1.5 ds:opacity-[var(--opacity-20)]";
|
|
26
|
+
}, {
|
|
27
|
+
readonly key: 6;
|
|
28
|
+
readonly lag: "ds:[animation-delay:calc(var(--animation-duration)*1.2)]";
|
|
29
|
+
readonly dot: "ds:size-1 ds:opacity-[var(--opacity-10)]";
|
|
30
|
+
}];
|
|
31
|
+
export interface UseAiSparkleOptions {
|
|
32
|
+
/**
|
|
33
|
+
* Whether the sparkle is available at all. Read once, at mount, to seed
|
|
34
|
+
* the initial `'intro'` phase — matches how the RichTextEditor's
|
|
35
|
+
* `aiSparkle` prop only ever gated the very first render. Default `true`.
|
|
36
|
+
*/
|
|
37
|
+
enabled?: boolean;
|
|
38
|
+
/**
|
|
39
|
+
* `'auto'` (default) reads `prefers-reduced-motion` via
|
|
40
|
+
* `usePrefersReducedMotion`. `'off'` forces full motion regardless of the
|
|
41
|
+
* OS preference — useful for a story that wants to show the animated
|
|
42
|
+
* states side by side with a reduced one.
|
|
43
|
+
*/
|
|
44
|
+
reducedMotion?: 'auto' | 'off';
|
|
45
|
+
}
|
|
46
|
+
export interface UseAiSparkleProps {
|
|
47
|
+
/** Spread (or picked) onto the host element as a pure styling hook. */
|
|
48
|
+
'data-ai-sparkle': AiSparkleState | undefined;
|
|
49
|
+
/**
|
|
50
|
+
* The shimmer animation class for the current state — empty when at rest.
|
|
51
|
+
* Layer it over the host's own base positioning classes; the comet layer
|
|
52
|
+
* needs real DOM and lives in the `AiSparkle` component instead.
|
|
53
|
+
*/
|
|
54
|
+
className: string;
|
|
55
|
+
}
|
|
56
|
+
export interface UseAiSparkleReturn {
|
|
57
|
+
/** `null` at rest — nothing to render for the comet layer either. */
|
|
58
|
+
state: AiSparkleState | null;
|
|
59
|
+
props: UseAiSparkleProps;
|
|
60
|
+
/** An AI action started: swap to the looping `'working'` phase. */
|
|
61
|
+
start: () => void;
|
|
62
|
+
/** An action's result landed: swap to the one-off `'landed'` phase. */
|
|
63
|
+
land: () => void;
|
|
64
|
+
/**
|
|
65
|
+
* Settle after an action ends. Clears back to rest only when still
|
|
66
|
+
* `'working'` (the action errored or was cancelled before `land()`);
|
|
67
|
+
* leaves `'landed'` alone so the one-off animation gets to play out.
|
|
68
|
+
*/
|
|
69
|
+
reset: () => void;
|
|
70
|
+
}
|
|
71
|
+
/**
|
|
72
|
+
* Drives the AI-pill sparkle: lit on first show, looping while an action
|
|
73
|
+
* runs, and a one-off flourish as the result lands.
|
|
74
|
+
*
|
|
75
|
+
* The hook owns the state machine and the timing only — it paints nothing.
|
|
76
|
+
* `props['data-ai-sparkle']` is a plain styling hook for the host element;
|
|
77
|
+
* `props.className` carries the shimmer layer's animation class from the
|
|
78
|
+
* same lookup table the RichTextEditor's pill originally inlined. The
|
|
79
|
+
* comet layer needs actual DOM (a head and a tail of dots), so it lives in
|
|
80
|
+
* the sibling `AiSparkle` component, keyed off the same `state`.
|
|
81
|
+
*
|
|
82
|
+
* Both `intro` and `landed` are one-off: this hook clears them back to
|
|
83
|
+
* `null` on a timer sized to the comet's lap plus a small buffer, at the
|
|
84
|
+
* default 200ms `--animation-duration`. Under reduced
|
|
85
|
+
* motion (`prefers-reduced-motion` or `reducedMotion: 'auto'`'s system
|
|
86
|
+
* read) the CSS animations already collapse to 0ms, so the clear fires at
|
|
87
|
+
* the next tick instead of waiting out the full lap — the pill still gets
|
|
88
|
+
* its `data-ai-sparkle` attribute for a moment, but nothing visibly moves.
|
|
89
|
+
*/
|
|
90
|
+
export declare function useAiSparkle(options?: UseAiSparkleOptions): UseAiSparkleReturn;
|
|
91
|
+
//# sourceMappingURL=use-ai-sparkle.d.ts.map
|
package/dist/host-compat.css
CHANGED
|
@@ -87,8 +87,8 @@
|
|
|
87
87
|
.ds\:\[--carousel-item-inline-size\:28rem\] {
|
|
88
88
|
--carousel-item-inline-size:448px;
|
|
89
89
|
}
|
|
90
|
-
.ds\:\[--inc1-nav-block-size\:
|
|
91
|
-
--inc1-nav-block-size:
|
|
90
|
+
.ds\:\[--inc1-nav-block-size\:2\.5rem\] {
|
|
91
|
+
--inc1-nav-block-size:40px;
|
|
92
92
|
}
|
|
93
93
|
.ds\:\[--map-block-size\:14rem\] {
|
|
94
94
|
--map-block-size:224px;
|