@case-framework/survey-ui 0.3.0 → 0.3.2

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 (209) hide show
  1. package/dist/src/components/c-ui/alert-provider.d.ts +18 -0
  2. package/dist/src/components/c-ui/confirm-dialog.d.ts +19 -0
  3. package/dist/src/components/c-ui/confirm-provider.d.ts +15 -0
  4. package/dist/src/components/c-ui/dot-background.d.ts +72 -0
  5. package/dist/src/components/c-ui/filepicker-dropzone.d.ts +38 -0
  6. package/dist/src/components/c-ui/loading-button.d.ts +9 -0
  7. package/dist/src/components/common/content-editable-plain.d.ts +17 -0
  8. package/dist/src/components/hooks/use-button-shortcut.d.ts +18 -0
  9. package/dist/src/components/hooks/use-document-keydown.d.ts +7 -0
  10. package/dist/src/components/rich-text/content-policy.d.ts +19 -0
  11. package/dist/src/components/rich-text/index.d.ts +6 -0
  12. package/dist/src/components/rich-text/nodes/rich-text-image-node.d.ts +40 -0
  13. package/dist/src/components/rich-text/nodes/rich-text-info-box-node.d.ts +45 -0
  14. package/dist/src/components/rich-text/nodes/survey-rich-text-heading-node.d.ts +27 -0
  15. package/dist/src/components/rich-text/rich-text-block-editor.d.ts +8 -0
  16. package/dist/src/components/rich-text/rich-text-content-view.d.ts +11 -0
  17. package/dist/src/components/rich-text/rich-text-editor-context.d.ts +23 -0
  18. package/dist/src/components/rich-text/rich-text-link-utils.d.ts +2 -0
  19. package/dist/src/components/rich-text/rich-text-survey-content.d.ts +7 -0
  20. package/dist/src/components/rich-text/types.d.ts +6 -0
  21. package/dist/src/components/rich-text-editor/index.d.ts +3 -0
  22. package/dist/src/components/rich-text-editor/plugins/command-handler-plugin.d.ts +5 -0
  23. package/dist/src/components/rich-text-editor/plugins/editable-mode-plugin.d.ts +3 -0
  24. package/dist/src/components/rich-text-editor/plugins/floating-toolbar-plugin.d.ts +11 -0
  25. package/dist/src/components/rich-text-editor/plugins/image-dialog-plugin.d.ts +4 -0
  26. package/dist/src/components/rich-text-editor/plugins/info-box-popover-plugin.d.ts +6 -0
  27. package/dist/src/components/rich-text-editor/plugins/link-popover-plugin.d.ts +6 -0
  28. package/dist/src/components/rich-text-editor/plugins/rich-text-image-asset-deletion-plugin.d.ts +1 -0
  29. package/dist/src/components/rich-text-editor/plugins/slash-command-menu-plugin.d.ts +15 -0
  30. package/dist/src/components/rich-text-editor/plugins/sync-editor-value-plugin.d.ts +4 -0
  31. package/dist/src/components/rich-text-editor/rich-text-editor-utils.d.ts +205 -0
  32. package/dist/src/components/rich-text-editor/rich-text-editor.d.ts +43 -0
  33. package/dist/src/components/rich-text-editor/rich-text-image-editor-commands.d.ts +12 -0
  34. package/dist/src/components/rich-text-editor/rich-text-info-box-commands.d.ts +20 -0
  35. package/dist/src/components/rich-text-editor/style-control-icon.d.ts +5 -0
  36. package/dist/src/components/ui/alert-dialog.d.ts +18 -0
  37. package/dist/src/components/ui/alert.d.ts +10 -0
  38. package/dist/src/components/ui/badge.d.ts +9 -0
  39. package/dist/src/components/ui/breadcrumb.d.ts +11 -0
  40. package/dist/src/components/ui/button.d.ts +10 -0
  41. package/dist/src/components/ui/calendar.d.ts +10 -0
  42. package/dist/src/components/ui/card.d.ts +11 -0
  43. package/dist/src/components/ui/checkbox.d.ts +4 -0
  44. package/dist/src/components/ui/collapsible.d.ts +5 -0
  45. package/dist/src/components/ui/command.d.ts +18 -0
  46. package/dist/src/components/ui/context-menu.d.ts +31 -0
  47. package/dist/src/components/ui/dialog.d.ts +19 -0
  48. package/dist/src/components/ui/dropdown-menu.d.ts +29 -0
  49. package/dist/src/components/ui/field.d.ts +24 -0
  50. package/dist/src/components/ui/input-group.d.ts +16 -0
  51. package/dist/src/components/ui/input.d.ts +3 -0
  52. package/dist/src/components/ui/kbd.d.ts +3 -0
  53. package/dist/src/components/ui/label.d.ts +4 -0
  54. package/dist/src/components/ui/popover.d.ts +10 -0
  55. package/dist/src/components/ui/progress.d.ts +4 -0
  56. package/dist/src/components/ui/radio-group.d.ts +5 -0
  57. package/dist/src/components/ui/scroll-area.d.ts +5 -0
  58. package/dist/src/components/ui/select.d.ts +15 -0
  59. package/dist/src/components/ui/separator.d.ts +4 -0
  60. package/dist/src/components/ui/skeleton.d.ts +2 -0
  61. package/dist/src/components/ui/slider.d.ts +4 -0
  62. package/dist/src/components/ui/sonner.d.ts +3 -0
  63. package/dist/src/components/ui/switch.d.ts +6 -0
  64. package/dist/src/components/ui/tabs.d.ts +11 -0
  65. package/dist/src/components/ui/textarea.d.ts +3 -0
  66. package/dist/src/components/ui/toggle-group.d.ts +10 -0
  67. package/dist/src/components/ui/toggle.d.ts +9 -0
  68. package/dist/src/components/ui/tooltip.d.ts +7 -0
  69. package/dist/src/dev/_components/nav-input.d.ts +35 -0
  70. package/dist/src/dev/app.d.ts +2 -0
  71. package/dist/src/dev/localizations/de.d.ts +2 -0
  72. package/dist/src/dev/main.d.ts +0 -0
  73. package/dist/src/index.d.ts +10 -0
  74. package/dist/src/lib/utils.d.ts +2 -0
  75. package/dist/src/modules/default-item-registry/default-item-cores.d.ts +24 -0
  76. package/dist/src/modules/default-item-registry/default-registry-entries.d.ts +2 -0
  77. package/dist/src/modules/default-item-registry/index.d.ts +19 -0
  78. package/dist/src/modules/default-item-registry/items/choice/display-order.d.ts +1 -0
  79. package/dist/src/modules/default-item-registry/items/choice/editor/card.d.ts +3 -0
  80. package/dist/src/modules/default-item-registry/items/choice/editor/option-create.d.ts +11 -0
  81. package/dist/src/modules/default-item-registry/items/choice/editor/option-edit-dialog.d.ts +14 -0
  82. package/dist/src/modules/default-item-registry/items/choice/editor/option-editor-fields.d.ts +17 -0
  83. package/dist/src/modules/default-item-registry/items/choice/editor/option-embedded-form-dialog.d.ts +15 -0
  84. package/dist/src/modules/default-item-registry/items/choice/editor/response-options-list.d.ts +20 -0
  85. package/dist/src/modules/default-item-registry/items/choice/expression-registry.d.ts +3 -0
  86. package/dist/src/modules/default-item-registry/items/choice/model.d.ts +28 -0
  87. package/dist/src/modules/default-item-registry/items/choice/player/question.d.ts +32 -0
  88. package/dist/src/modules/default-item-registry/items/choice/preview/item.d.ts +2 -0
  89. package/dist/src/modules/default-item-registry/items/choice/search-adapter.d.ts +2 -0
  90. package/dist/src/modules/default-item-registry/items/form/editor/card.d.ts +3 -0
  91. package/dist/src/modules/default-item-registry/items/form/editor/config-editor.d.ts +12 -0
  92. package/dist/src/modules/default-item-registry/items/form/editor/field-edit-dialog.d.ts +10 -0
  93. package/dist/src/modules/default-item-registry/items/form/editor/field-group-header-dialog.d.ts +12 -0
  94. package/dist/src/modules/default-item-registry/items/form/editor/field-group-layout-dialog.d.ts +9 -0
  95. package/dist/src/modules/default-item-registry/items/form/editor/field-item-preview.d.ts +15 -0
  96. package/dist/src/modules/default-item-registry/items/form/editor/field-key-dialog.d.ts +10 -0
  97. package/dist/src/modules/default-item-registry/items/form/editor/field-sort-dialog.d.ts +11 -0
  98. package/dist/src/modules/default-item-registry/items/form/editor/field-type-shared.d.ts +12 -0
  99. package/dist/src/modules/default-item-registry/items/form/editor/response-field-groups-list.d.ts +16 -0
  100. package/dist/src/modules/default-item-registry/items/form/model.d.ts +158 -0
  101. package/dist/src/modules/default-item-registry/items/form/player/field.d.ts +28 -0
  102. package/dist/src/modules/default-item-registry/items/form/preview/item.d.ts +2 -0
  103. package/dist/src/modules/default-item-registry/items/info/editor-card.d.ts +3 -0
  104. package/dist/src/modules/default-item-registry/items/info/player/card-field.d.ts +14 -0
  105. package/dist/src/modules/default-item-registry/items/info/preview/item.d.ts +2 -0
  106. package/dist/src/modules/default-item-registry/items/info/search-adapter.d.ts +2 -0
  107. package/dist/src/modules/default-item-registry/items/structure/group/editor-card.d.ts +3 -0
  108. package/dist/src/modules/default-item-registry/items/structure/page-break/editor-card.d.ts +3 -0
  109. package/dist/src/modules/default-item-registry/items/structure/preview-renderers.d.ts +3 -0
  110. package/dist/src/modules/default-item-registry/items/structure/root/editor-card.d.ts +3 -0
  111. package/dist/src/modules/default-item-registry/shared/player/question-card-shell.d.ts +13 -0
  112. package/dist/src/modules/default-item-registry/shared/preview/question-header.d.ts +6 -0
  113. package/dist/src/modules/default-item-registry/shared/preview/utils.d.ts +3 -0
  114. package/dist/src/modules/default-item-registry/shared/question-editor/deferred-localized-rich-text-field.d.ts +26 -0
  115. package/dist/src/modules/default-item-registry/shared/question-editor/header-editor.d.ts +6 -0
  116. package/dist/src/modules/default-item-registry/shared/question-editor/layout.d.ts +8 -0
  117. package/dist/src/modules/default-item-registry/shared/question-editor/rich-text-editors.d.ts +23 -0
  118. package/dist/src/modules/default-item-registry/shared/question-editor/rich-text-policies.d.ts +8 -0
  119. package/dist/src/modules/default-item-registry/shared/question-editor/toolbar.d.ts +10 -0
  120. package/dist/src/modules/survey-editor/ai/types.d.ts +88 -0
  121. package/dist/src/modules/survey-editor/assets/index.d.ts +4 -0
  122. package/dist/src/modules/survey-editor/assets/survey-image-asset-manager.d.ts +4 -0
  123. package/dist/src/modules/survey-editor/assets/use-survey-assets.d.ts +4 -0
  124. package/dist/src/modules/survey-editor/assets/utils.d.ts +5 -0
  125. package/dist/src/modules/survey-editor/editor-card/add-items/constants.d.ts +3 -0
  126. package/dist/src/modules/survey-editor/editor-card/add-items/hooks/use-add-item-actions.d.ts +25 -0
  127. package/dist/src/modules/survey-editor/editor-card/add-items/hooks/use-add-item-target.d.ts +9 -0
  128. package/dist/src/modules/survey-editor/editor-card/add-items/hooks/use-option-group-navigation.d.ts +19 -0
  129. package/dist/src/modules/survey-editor/editor-card/add-items/types.d.ts +21 -0
  130. package/dist/src/modules/survey-editor/editor-card/add-items/views/ai-item-view.d.ts +10 -0
  131. package/dist/src/modules/survey-editor/editor-card/add-items/views/back-button.d.ts +5 -0
  132. package/dist/src/modules/survey-editor/editor-card/add-items/views/blank-item-view.d.ts +13 -0
  133. package/dist/src/modules/survey-editor/editor-card/add-items/views/entry-view.d.ts +15 -0
  134. package/dist/src/modules/survey-editor/editor-card/add-items/views/structure-view.d.ts +16 -0
  135. package/dist/src/modules/survey-editor/editor-card/add-items.d.ts +1 -0
  136. package/dist/src/modules/survey-editor/editor-card/copy-item-dropdown-menu.d.ts +5 -0
  137. package/dist/src/modules/survey-editor/editor-card/delete-item-context-menu.d.ts +5 -0
  138. package/dist/src/modules/survey-editor/editor-card/delete-item-dropdown-menu.d.ts +5 -0
  139. package/dist/src/modules/survey-editor/editor-card/editor-card-tab-trigger.d.ts +15 -0
  140. package/dist/src/modules/survey-editor/editor-card/group-items.d.ts +2 -0
  141. package/dist/src/modules/survey-editor/editor-card/hooks/use-armed-shortcut-sequence.d.ts +11 -0
  142. package/dist/src/modules/survey-editor/editor-card/hooks/use-group-list-keyboard.d.ts +30 -0
  143. package/dist/src/modules/survey-editor/editor-card/index.d.ts +2 -0
  144. package/dist/src/modules/survey-editor/editor-card/item-color-menu.d.ts +6 -0
  145. package/dist/src/modules/survey-editor/editor-card/item-color-selector.d.ts +5 -0
  146. package/dist/src/modules/survey-editor/editor-card/item-editor-card-skeleton.d.ts +2 -0
  147. package/dist/src/modules/survey-editor/editor-card/item-editor-card.d.ts +39 -0
  148. package/dist/src/modules/survey-editor/editor-card/item-editor-context.d.ts +20 -0
  149. package/dist/src/modules/survey-editor/editor-card/item-key-editor.d.ts +9 -0
  150. package/dist/src/modules/survey-editor/editor-card/item-label-preview-and-editor.d.ts +10 -0
  151. package/dist/src/modules/survey-editor/editor-card/item-preview.d.ts +8 -0
  152. package/dist/src/modules/survey-editor/editor-card/item-sibling-navigation.d.ts +5 -0
  153. package/dist/src/modules/survey-editor/editor-card/item-type-icon-with-tooltip.d.ts +8 -0
  154. package/dist/src/modules/survey-editor/editor-card/survey-player-item-preview.d.ts +6 -0
  155. package/dist/src/modules/survey-editor/editor-instance-provider.d.ts +7 -0
  156. package/dist/src/modules/survey-editor/hooks/useClipboardValue.d.ts +2 -0
  157. package/dist/src/modules/survey-editor/hooks/useDeleteItem.d.ts +9 -0
  158. package/dist/src/modules/survey-editor/hooks/useEditor.d.ts +12 -0
  159. package/dist/src/modules/survey-editor/hooks/useEditorStateChange.d.ts +17 -0
  160. package/dist/src/modules/survey-editor/hooks/useKeyboardShortcuts.d.ts +7 -0
  161. package/dist/src/modules/survey-editor/index.d.ts +17 -0
  162. package/dist/src/modules/survey-editor/localization/date-fns.d.ts +5 -0
  163. package/dist/src/modules/survey-editor/localization/default-en.d.ts +4 -0
  164. package/dist/src/modules/survey-editor/localization/index.d.ts +5 -0
  165. package/dist/src/modules/survey-editor/localization/runtime.d.ts +4 -0
  166. package/dist/src/modules/survey-editor/localization/types.d.ts +7 -0
  167. package/dist/src/modules/survey-editor/navigation/navigation-provider.d.ts +11 -0
  168. package/dist/src/modules/survey-editor/navigation/navigation.d.ts +13 -0
  169. package/dist/src/modules/survey-editor/navigation/types.d.ts +18 -0
  170. package/dist/src/modules/survey-editor/primitives/input-with-ai-popover.d.ts +35 -0
  171. package/dist/src/modules/survey-editor/registry/index.d.ts +7 -0
  172. package/dist/src/modules/survey-editor/registry/registry-mappers.d.ts +25 -0
  173. package/dist/src/modules/survey-editor/registry/search-adapter.d.ts +19 -0
  174. package/dist/src/modules/survey-editor/registry/types.d.ts +178 -0
  175. package/dist/src/modules/survey-editor/routes/editor/_components/footer.d.ts +2 -0
  176. package/dist/src/modules/survey-editor/routes/editor/_components/history-stack.d.ts +2 -0
  177. package/dist/src/modules/survey-editor/routes/editor/_components/main.d.ts +2 -0
  178. package/dist/src/modules/survey-editor/routes/editor/asset-manager/index.d.ts +2 -0
  179. package/dist/src/modules/survey-editor/routes/editor/index.d.ts +5 -0
  180. package/dist/src/modules/survey-editor/routes/editor/item-editor/_components/item-editor-toolbar/breadcrumbs-nav.d.ts +2 -0
  181. package/dist/src/modules/survey-editor/routes/editor/item-editor/_components/item-editor-toolbar/item-editor-toolbar.d.ts +2 -0
  182. package/dist/src/modules/survey-editor/routes/editor/item-editor/_components/item-editor-toolbar/language-picker.d.ts +2 -0
  183. package/dist/src/modules/survey-editor/routes/editor/item-editor/_components/item-editor-toolbar/search-trigger.d.ts +3 -0
  184. package/dist/src/modules/survey-editor/routes/editor/item-editor/_components/item-editor-toolbar/survey-search.d.ts +7 -0
  185. package/dist/src/modules/survey-editor/routes/editor/item-editor/index.d.ts +2 -0
  186. package/dist/src/modules/survey-editor/routes/editor/translation-mode/index.d.ts +2 -0
  187. package/dist/src/modules/survey-editor/session-file.d.ts +13 -0
  188. package/dist/src/modules/survey-editor/store/editor-store-context.d.ts +10 -0
  189. package/dist/src/modules/survey-editor/store/editor-store-provider.d.ts +7 -0
  190. package/dist/src/modules/survey-editor/store/editor-store.d.ts +102 -0
  191. package/dist/src/modules/survey-editor/store/use-editor-store.d.ts +4 -0
  192. package/dist/src/modules/survey-editor/store/useItemNavigation.d.ts +7 -0
  193. package/dist/src/modules/survey-editor/survey-editor-config.d.ts +29 -0
  194. package/dist/src/modules/survey-editor/survey-editor.d.ts +26 -0
  195. package/dist/src/modules/survey-editor/utils/item-type-infos.d.ts +23 -0
  196. package/dist/src/modules/survey-player/index.d.ts +5 -0
  197. package/dist/src/modules/survey-player/localization/default-en.d.ts +3 -0
  198. package/dist/src/modules/survey-player/localization/runtime.d.ts +4 -0
  199. package/dist/src/modules/survey-player/localization/types.d.ts +7 -0
  200. package/dist/src/modules/survey-player/survey-context.d.ts +32 -0
  201. package/dist/src/modules/survey-player/survey-item/survey-item-context.d.ts +27 -0
  202. package/dist/src/modules/survey-player/survey-item/survey-item-types/placeholder-item-renderers.d.ts +4 -0
  203. package/dist/src/modules/survey-player/survey-item/survey-item-types/question-wrapper.d.ts +5 -0
  204. package/dist/src/modules/survey-player/survey-item/survey-item.d.ts +7 -0
  205. package/dist/src/modules/survey-player/survey-player.d.ts +14 -0
  206. package/dist/survey-editor-defaults.css.d.ts +2 -0
  207. package/dist/survey-ui.css.d.ts +2 -0
  208. package/package.json +15 -6
  209. package/dist/index.d.ts +0 -1
@@ -0,0 +1,18 @@
1
+ import { ComponentProps, ReactNode } from 'react';
2
+ import { AlertDialogCancel } from '../../../components/ui/alert-dialog';
3
+ export interface AlertOptions {
4
+ title?: string;
5
+ description?: string;
6
+ buttonLabel?: string;
7
+ dismissButtonClassName?: string;
8
+ dismissButtonVariant?: ComponentProps<typeof AlertDialogCancel>["variant"];
9
+ children?: ReactNode;
10
+ }
11
+ export interface AlertApi {
12
+ (options: AlertOptions): Promise<void>;
13
+ dismiss: () => void;
14
+ }
15
+ export declare const AlertDialogProvider: ({ children }: {
16
+ children: ReactNode;
17
+ }) => import("react/jsx-runtime").JSX.Element;
18
+ export declare const useAlert: () => AlertApi;
@@ -0,0 +1,19 @@
1
+ export interface RequireConfirmationInput {
2
+ confirmTerm: string;
3
+ /** Custom label with {{confirmTerm}} placeholder for the required term (bold). Default: "Type {{confirmTerm}} to confirm" */
4
+ label?: string;
5
+ hint?: string;
6
+ }
7
+ interface ConfirmDialogProps {
8
+ title: string;
9
+ description: string;
10
+ confirmButtonText: string;
11
+ cancelButtonText: string;
12
+ onConfirm: () => void;
13
+ onCancel: () => void;
14
+ variant: "default" | "destructive";
15
+ isOpen: boolean;
16
+ requireConfirmationInput?: RequireConfirmationInput;
17
+ }
18
+ declare const ConfirmDialog: (props: ConfirmDialogProps) => import("react/jsx-runtime").JSX.Element;
19
+ export default ConfirmDialog;
@@ -0,0 +1,15 @@
1
+ import { ReactNode } from 'react';
2
+ import { RequireConfirmationInput } from './confirm-dialog';
3
+ export type { RequireConfirmationInput };
4
+ interface ConfirmOptions {
5
+ title?: string;
6
+ description?: string;
7
+ confirmButtonText?: string;
8
+ cancelButtonText?: string;
9
+ variant?: "default" | "destructive";
10
+ requireConfirmationInput?: RequireConfirmationInput;
11
+ }
12
+ export declare const ConfirmDialogProvider: ({ children }: {
13
+ children: ReactNode;
14
+ }) => import("react/jsx-runtime").JSX.Element;
15
+ export declare const useConfirm: () => (options: ConfirmOptions) => Promise<boolean>;
@@ -0,0 +1,72 @@
1
+ import * as React from "react";
2
+ declare const dotBackgroundColorVariants: {
3
+ readonly default: {
4
+ readonly backgroundColor: "var(--background)";
5
+ readonly dotColor: "var(--border)";
6
+ };
7
+ readonly muted: {
8
+ readonly backgroundColor: "var(--muted)";
9
+ readonly dotColor: "color-mix(in oklab, var(--muted-foreground) 24%, transparent)";
10
+ };
11
+ readonly card: {
12
+ readonly backgroundColor: "var(--card)";
13
+ readonly dotColor: "color-mix(in oklab, var(--border) 90%, transparent)";
14
+ };
15
+ readonly accent: {
16
+ readonly backgroundColor: "var(--accent)";
17
+ readonly dotColor: "color-mix(in oklab, var(--accent-foreground) 18%, transparent)";
18
+ };
19
+ readonly secondary: {
20
+ readonly backgroundColor: "var(--secondary)";
21
+ readonly dotColor: "color-mix(in oklab, var(--secondary-foreground) 16%, transparent)";
22
+ };
23
+ readonly custom: {
24
+ readonly backgroundColor: "var(--background)";
25
+ readonly dotColor: "var(--border)";
26
+ };
27
+ };
28
+ declare const dotBackgroundSpacingVariants: {
29
+ readonly dense: {
30
+ readonly spacing: "0.875rem";
31
+ };
32
+ readonly default: {
33
+ readonly spacing: "1.25rem";
34
+ };
35
+ readonly relaxed: {
36
+ readonly spacing: "1.75rem";
37
+ };
38
+ readonly loose: {
39
+ readonly spacing: "2.25rem";
40
+ };
41
+ readonly custom: {
42
+ readonly spacing: "1.25rem";
43
+ };
44
+ };
45
+ type DotBackgroundVariant = keyof typeof dotBackgroundColorVariants;
46
+ type DotBackgroundSpacingVariant = keyof typeof dotBackgroundSpacingVariants;
47
+ declare const dotBackgroundVariants: (props?: ({
48
+ variant?: "default" | "secondary" | "accent" | "muted" | "card" | "custom" | null | undefined;
49
+ spacing?: "default" | "dense" | "loose" | "custom" | "relaxed" | null | undefined;
50
+ } & import('class-variance-authority/types').ClassProp) | undefined) => string;
51
+ type DotBackgroundStyle = React.CSSProperties & {
52
+ "--dot-background-color"?: string;
53
+ "--dot-background-dot-color"?: string;
54
+ "--dot-background-spacing"?: string;
55
+ "--dot-background-dot-size"?: string;
56
+ };
57
+ type DotBackgroundVars = {
58
+ backgroundColor?: string;
59
+ dotColor?: string;
60
+ spacing?: number | string;
61
+ dotSize?: number | string;
62
+ };
63
+ type DotBackgroundProps = Omit<React.ComponentProps<"div">, "style"> & {
64
+ asChild?: boolean;
65
+ variant?: DotBackgroundVariant;
66
+ spacing?: DotBackgroundSpacingVariant;
67
+ vars?: DotBackgroundVars;
68
+ style?: DotBackgroundStyle;
69
+ };
70
+ declare function DotBackground({ asChild, variant, spacing, vars, className, style, ...props }: DotBackgroundProps): import("react/jsx-runtime").JSX.Element;
71
+ export { DotBackground, dotBackgroundColorVariants, dotBackgroundSpacingVariants, dotBackgroundVariants, };
72
+ export type { DotBackgroundProps, DotBackgroundSpacingVariant, DotBackgroundStyle, DotBackgroundVariant, DotBackgroundVars, };
@@ -0,0 +1,38 @@
1
+ import { Accept, FileRejection, FileWithPath } from 'react-dropzone';
2
+ import { Field } from '../../../components/ui/field';
3
+ export interface FilepickerDropzoneLabels {
4
+ upload: string;
5
+ drag: string;
6
+ active: string;
7
+ reject: string;
8
+ rejectInvalidType: string;
9
+ rejectTooLarge: string;
10
+ rejectTooSmall: string;
11
+ rejectTooMany: string;
12
+ selectedCount: string;
13
+ }
14
+ export interface FilepickerDropzoneProps extends Omit<React.ComponentProps<typeof Field>, "children" | "onChange"> {
15
+ id: string;
16
+ name?: string;
17
+ label?: React.ReactNode;
18
+ description?: React.ReactNode;
19
+ error?: React.ReactNode;
20
+ accept?: Accept;
21
+ multiple?: boolean;
22
+ disabled?: boolean;
23
+ required?: boolean;
24
+ maxFiles?: number;
25
+ maxSize?: number;
26
+ minSize?: number;
27
+ icon?: React.ReactNode;
28
+ labelClassName?: string;
29
+ contentClassName?: string;
30
+ descriptionClassName?: string;
31
+ errorClassName?: string;
32
+ dropzoneClassName?: string;
33
+ labels?: Partial<FilepickerDropzoneLabels>;
34
+ onChange?: (files: readonly FileWithPath[]) => void;
35
+ onDropRejected?: (fileRejections: FileRejection[]) => void;
36
+ }
37
+ declare function FilepickerDropzone({ id, name, label, description, error, accept, multiple, disabled, required, maxFiles, maxSize, minSize, icon, className, labelClassName, contentClassName, descriptionClassName, errorClassName, dropzoneClassName, labels, onChange, onDropRejected, ...props }: FilepickerDropzoneProps): import("react/jsx-runtime").JSX.Element;
38
+ export { FilepickerDropzone };
@@ -0,0 +1,9 @@
1
+ import { buttonVariants } from '../../../components/ui/button';
2
+ import { VariantProps } from 'class-variance-authority';
3
+ import * as React from "react";
4
+ type LoadingButtonProps = React.ComponentProps<"button"> & VariantProps<typeof buttonVariants> & {
5
+ asChild?: boolean;
6
+ isLoading?: boolean;
7
+ };
8
+ declare const LoadingButton: React.ForwardRefExoticComponent<Omit<LoadingButtonProps, "ref"> & React.RefAttributes<HTMLButtonElement>>;
9
+ export { LoadingButton };
@@ -0,0 +1,17 @@
1
+ import { KeyboardEvent } from 'react';
2
+ export interface ContentEditablePlainProps {
3
+ id: string;
4
+ value: string;
5
+ placeholder?: string;
6
+ className?: string;
7
+ "aria-label"?: string;
8
+ onChange: (next: string) => void;
9
+ onFocus?: () => void;
10
+ onBlur?: () => void;
11
+ onKeyDown?: (event: KeyboardEvent<HTMLDivElement>) => void;
12
+ }
13
+ /**
14
+ * Plain-text contenteditable: line breaks allowed, paste stripped to text only.
15
+ * Syncs `value` from props only while unfocused to avoid clobbering the caret.
16
+ */
17
+ export declare function ContentEditablePlain({ id, value, placeholder, className, "aria-label": ariaLabel, onChange, onFocus, onBlur, onKeyDown, }: ContentEditablePlainProps): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,18 @@
1
+ export interface ButtonShortcutDefinition {
2
+ key: string;
3
+ modKey?: boolean;
4
+ metaKey?: boolean;
5
+ ctrlKey?: boolean;
6
+ shiftKey?: boolean;
7
+ altKey?: boolean;
8
+ }
9
+ interface UseButtonShortcutOptions {
10
+ enabled?: boolean;
11
+ activeDurationMs?: number;
12
+ preventDefault?: boolean;
13
+ ignoreEditableTargets?: boolean;
14
+ }
15
+ export declare const useButtonShortcut: (ref: React.RefObject<HTMLButtonElement | null>, shortcut: ButtonShortcutDefinition, { enabled, activeDurationMs, preventDefault, ignoreEditableTargets, }?: UseButtonShortcutOptions) => {
16
+ isShortcutActive: boolean;
17
+ };
18
+ export {};
@@ -0,0 +1,7 @@
1
+ export declare const isEditableKeyboardTarget: (target: EventTarget | null) => boolean;
2
+ interface UseDocumentKeydownOptions {
3
+ enabled?: boolean;
4
+ ignoreEditableTargets?: boolean;
5
+ }
6
+ export declare const useDocumentKeydown: (onKeyDown: (event: KeyboardEvent) => void, { enabled, ignoreEditableTargets, }?: UseDocumentKeydownOptions) => void;
7
+ export {};
@@ -0,0 +1,19 @@
1
+ import { Content, RichTextStyle } from '@case-framework/survey-core';
2
+ export type RichTextEditorVariant = "compact" | "block";
3
+ export type RichTextSupportedBlockType = "paragraph" | "bulletList" | "image" | "separator" | "heading" | "infoBox";
4
+ export type RichTextStyleAttribute = keyof RichTextStyle;
5
+ export interface RichTextContentPolicy {
6
+ variant?: RichTextEditorVariant;
7
+ allowedBlockTypes?: Partial<Record<RichTextSupportedBlockType, boolean>>;
8
+ allowedStyleAttributes?: Partial<Record<RichTextStyleAttribute, boolean>>;
9
+ allowLinks?: boolean;
10
+ allowTemplateVariables?: boolean;
11
+ allowLineBreaks?: boolean;
12
+ /** When true, paragraph/heading/list-paragraph alignment may be edited and persisted. */
13
+ allowBlockAlignment?: boolean;
14
+ }
15
+ export declare const DEFAULT_COMPACT_CONTENT_POLICY: RichTextContentPolicy;
16
+ export declare const DEFAULT_BLOCK_CONTENT_POLICY: RichTextContentPolicy;
17
+ export declare function mergeRichTextContentPolicy(base: RichTextContentPolicy, override?: RichTextContentPolicy): RichTextContentPolicy;
18
+ export declare function sanitizeContentForPolicy(content: Content | undefined, policy?: RichTextContentPolicy): Content | undefined;
19
+ export declare function isBlockContentPolicyVariant(policy?: RichTextContentPolicy): boolean;
@@ -0,0 +1,6 @@
1
+ export { RichTextBlockEditor, type RichTextBlockEditorChange, type RichTextBlockEditorProps, } from './rich-text-block-editor';
2
+ export { RichTextContentView, type RichTextContentViewProps, } from './rich-text-content-view';
3
+ export { createRichTextEditorValueFromContent, createRichTextEditorValueFromText, getRichTextContentFromEditorState, writeContentToEditor, } from './rich-text-survey-content';
4
+ export type { RichTextImageAssetOption } from './types';
5
+ export { DEFAULT_BLOCK_CONTENT_POLICY, DEFAULT_COMPACT_CONTENT_POLICY, isBlockContentPolicyVariant, mergeRichTextContentPolicy, sanitizeContentForPolicy, } from './content-policy';
6
+ export type { RichTextContentPolicy, RichTextEditorVariant, RichTextStyleAttribute, RichTextSupportedBlockType, } from './content-policy';
@@ -0,0 +1,40 @@
1
+ import { RichTextImageSize, SurveyContentImageSource } from '@case-framework/survey-core';
2
+ import { DecoratorBlockNode, SerializedDecoratorBlockNode } from '@lexical/react/LexicalDecoratorBlockNode';
3
+ import { ElementFormatType, LexicalNode, LexicalUpdateJSON, NodeKey, Spread } from 'lexical';
4
+ import { JSX } from 'react';
5
+ export type SerializedRichTextImageNode = Spread<{
6
+ source: SurveyContentImageSource;
7
+ alt?: string;
8
+ caption?: string;
9
+ size?: RichTextImageSize;
10
+ }, SerializedDecoratorBlockNode>;
11
+ export declare class RichTextImageNode extends DecoratorBlockNode {
12
+ __source: SurveyContentImageSource;
13
+ __alt?: string;
14
+ __caption: string;
15
+ __size?: RichTextImageSize;
16
+ static getType(): string;
17
+ static clone(node: RichTextImageNode): RichTextImageNode;
18
+ static importJSON(serializedNode: SerializedRichTextImageNode): RichTextImageNode;
19
+ constructor(source: SurveyContentImageSource, alt?: string, size?: RichTextImageSize, caption?: string, format?: SerializedDecoratorBlockNode["format"], key?: NodeKey);
20
+ updateFromJSON(serializedNode: LexicalUpdateJSON<SerializedRichTextImageNode>): this;
21
+ exportJSON(): SerializedRichTextImageNode;
22
+ getSource(): SurveyContentImageSource;
23
+ getAlt(): string | undefined;
24
+ getCaption(): string;
25
+ getSize(): RichTextImageSize | undefined;
26
+ setSource(source: SurveyContentImageSource): this;
27
+ setAlt(alt: string | undefined): this;
28
+ setCaption(caption: string): this;
29
+ setSize(size: RichTextImageSize | undefined): this;
30
+ decorate(): JSX.Element;
31
+ }
32
+ export declare function $createRichTextImageNode({ source, alt, size, caption, format, key, }: {
33
+ source: SurveyContentImageSource;
34
+ alt?: string;
35
+ size?: RichTextImageSize;
36
+ caption?: string;
37
+ format?: ElementFormatType;
38
+ key?: NodeKey;
39
+ }): RichTextImageNode;
40
+ export declare function $isRichTextImageNode(node: LexicalNode | null | undefined): node is RichTextImageNode;
@@ -0,0 +1,45 @@
1
+ import { RichTextInfoBoxBlock } from '@case-framework/survey-core';
2
+ import { DecoratorBlockNode, SerializedDecoratorBlockNode } from '@lexical/react/LexicalDecoratorBlockNode';
3
+ import { LexicalNode, LexicalUpdateJSON, NodeKey, Spread } from 'lexical';
4
+ import { JSX } from 'react';
5
+ export type RichTextInfoBoxTone = NonNullable<RichTextInfoBoxBlock["tone"]>;
6
+ export type SerializedRichTextInfoBoxNode = Spread<{
7
+ tone: RichTextInfoBoxTone;
8
+ title: string;
9
+ content: string;
10
+ collapsible: boolean;
11
+ defaultOpen: boolean;
12
+ }, SerializedDecoratorBlockNode>;
13
+ export declare class RichTextInfoBoxNode extends DecoratorBlockNode {
14
+ __tone: RichTextInfoBoxTone;
15
+ __title: string;
16
+ __content: string;
17
+ __collapsible: boolean;
18
+ __defaultOpen: boolean;
19
+ static getType(): string;
20
+ static clone(node: RichTextInfoBoxNode): RichTextInfoBoxNode;
21
+ static importJSON(serializedNode: SerializedRichTextInfoBoxNode): RichTextInfoBoxNode;
22
+ constructor(tone: RichTextInfoBoxTone, title: string, content: string, collapsible: boolean, defaultOpen: boolean, key?: NodeKey);
23
+ updateFromJSON(serializedNode: LexicalUpdateJSON<SerializedRichTextInfoBoxNode>): this;
24
+ exportJSON(): SerializedRichTextInfoBoxNode;
25
+ getTone(): RichTextInfoBoxTone;
26
+ setTone(tone: RichTextInfoBoxTone): void;
27
+ getTitle(): string;
28
+ setTitle(title: string): void;
29
+ getContent(): string;
30
+ setContent(content: string): void;
31
+ getCollapsible(): boolean;
32
+ setCollapsible(collapsible: boolean): void;
33
+ getDefaultOpen(): boolean;
34
+ setDefaultOpen(defaultOpen: boolean): void;
35
+ decorate(): JSX.Element;
36
+ }
37
+ export declare function $createRichTextInfoBoxNode({ tone, title, content, collapsible, defaultOpen, key, }: {
38
+ tone?: RichTextInfoBoxTone;
39
+ title?: string;
40
+ content?: string;
41
+ collapsible?: boolean;
42
+ defaultOpen?: boolean;
43
+ key?: NodeKey;
44
+ }): RichTextInfoBoxNode;
45
+ export declare function $isRichTextInfoBoxNode(node: LexicalNode | null | undefined): node is RichTextInfoBoxNode;
@@ -0,0 +1,27 @@
1
+ import { RichTextHeadingBlock } from '@case-framework/survey-core';
2
+ import { ParagraphNode, DOMConversionMap, EditorConfig, LexicalEditor, LexicalNode, RangeSelection, SerializedParagraphNode, Spread } from 'lexical';
3
+ export type SerializedSurveyRichTextHeadingNode = Spread<{
4
+ level: RichTextHeadingBlock["level"];
5
+ }, SerializedParagraphNode>;
6
+ /** Block editor node for survey rich-text headings; serializes to core `heading` blocks. */
7
+ export declare class SurveyRichTextHeadingNode extends ParagraphNode {
8
+ /** @internal */
9
+ __level: RichTextHeadingBlock["level"];
10
+ static getType(): string;
11
+ static clone(node: SurveyRichTextHeadingNode): SurveyRichTextHeadingNode;
12
+ constructor(level?: RichTextHeadingBlock["level"], key?: string);
13
+ getHeadingLevel(): RichTextHeadingBlock["level"];
14
+ createDOM(config: EditorConfig): HTMLElement;
15
+ updateDOM(prevNode: SurveyRichTextHeadingNode): boolean;
16
+ static importDOM(): DOMConversionMap | null;
17
+ exportDOM(editor: LexicalEditor): {
18
+ element: HTMLElement;
19
+ };
20
+ static importJSON(serializedNode: SerializedSurveyRichTextHeadingNode): SurveyRichTextHeadingNode;
21
+ exportJSON(): SerializedSurveyRichTextHeadingNode;
22
+ /** Backspace at block start: replace heading with a paragraph (same children and block styles). */
23
+ collapseAtStart(): boolean;
24
+ insertNewAfter(rangeSelection: RangeSelection, restoreSelection?: boolean): ParagraphNode;
25
+ }
26
+ export declare function $createSurveyRichTextHeadingNode(level?: RichTextHeadingBlock["level"]): SurveyRichTextHeadingNode;
27
+ export declare function $isSurveyRichTextHeadingNode(node: LexicalNode | null | undefined): node is SurveyRichTextHeadingNode;
@@ -0,0 +1,8 @@
1
+ import { RichTextEditorChange, RichTextEditorProps } from '../rich-text-editor/rich-text-editor';
2
+ import { RichTextImageAssetOption } from './types';
3
+ export type RichTextBlockEditorChange = RichTextEditorChange;
4
+ export interface RichTextBlockEditorProps extends RichTextEditorProps {
5
+ resolveImageAssetUrl?: (assetId: string) => string | undefined;
6
+ imageAssets?: RichTextImageAssetOption[];
7
+ }
8
+ export declare function RichTextBlockEditor({ wrapperClassName, surfaceClassName, contentClassName, placeholderClassName, ...props }: RichTextBlockEditorProps): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,11 @@
1
+ import { Content } from '@case-framework/survey-core';
2
+ export interface RichTextContentViewProps {
3
+ content?: Content;
4
+ className?: string;
5
+ paragraphClassName?: string;
6
+ resolveImageAssetUrl?: (assetId: string) => string | undefined;
7
+ singleLine?: boolean;
8
+ /** Rendered at each line break when `singleLine` is true. */
9
+ singleLineNewlineIndicator?: string;
10
+ }
11
+ export declare function RichTextContentView({ content, className, paragraphClassName, resolveImageAssetUrl, singleLine, singleLineNewlineIndicator, }: RichTextContentViewProps): import("react/jsx-runtime").JSX.Element | null;
@@ -0,0 +1,23 @@
1
+ import { RichTextContentPolicy } from './content-policy';
2
+ import { RichTextImageAssetOption } from './types';
3
+ export interface RichTextImageAssetDeletionHandlers {
4
+ /** Total references to this asset across the survey (from committed content), per `Survey.getAssetUsages`. */
5
+ getUsageCount(assetId: string): number;
6
+ removeAsset(assetId: string): void;
7
+ }
8
+ interface RichTextEditorContextValue {
9
+ editorVariant: "compact" | "block";
10
+ contentPolicy?: RichTextContentPolicy;
11
+ editable: boolean;
12
+ resolveImageAssetUrl?: (assetId: string) => string | undefined;
13
+ imageAssets?: RichTextImageAssetOption[];
14
+ registerImageAsset?: (file: File) => Promise<string>;
15
+ /** When set, removing a local image with a single survey-wide reference can prompt to delete the embedded asset. */
16
+ imageAssetDeletion?: RichTextImageAssetDeletionHandlers;
17
+ }
18
+ export declare function RichTextEditorContextProvider({ value, children, }: {
19
+ value: RichTextEditorContextValue;
20
+ children: React.ReactNode;
21
+ }): import("react/jsx-runtime").JSX.Element;
22
+ export declare function useRichTextEditorContext(): RichTextEditorContextValue;
23
+ export {};
@@ -0,0 +1,2 @@
1
+ export declare const DEFAULT_RICH_TEXT_LINK_URL = "https://";
2
+ export declare function sanitizeRichTextLinkUrl(url: string): string;
@@ -0,0 +1,7 @@
1
+ import { Content, RichTextContent } from '@case-framework/survey-core';
2
+ import { EditorState, SerializedEditorState } from 'lexical';
3
+ import { RichTextContentPolicy } from './content-policy';
4
+ export declare function writeContentToEditor(content?: Content, policy?: RichTextContentPolicy): void;
5
+ export declare function getRichTextContentFromEditorState(editorState: EditorState, policy?: RichTextContentPolicy): RichTextContent;
6
+ export declare function createRichTextEditorValueFromContent(content?: Content, policy?: RichTextContentPolicy): SerializedEditorState;
7
+ export declare function createRichTextEditorValueFromText(text?: string, policy?: RichTextContentPolicy): SerializedEditorState;
@@ -0,0 +1,6 @@
1
+ export interface RichTextImageAssetOption {
2
+ assetId: string;
3
+ label: string;
4
+ alt?: string;
5
+ previewUrl?: string;
6
+ }
@@ -0,0 +1,3 @@
1
+ export { RichTextEditor, type RichTextEditorChange, type RichTextEditorProps, } from './rich-text-editor';
2
+ export { APPLY_RICH_TEXT_STYLE_COMMAND, CONVERT_RICH_TEXT_LINK_TO_TEXT_COMMAND, INSERT_RICH_TEXT_LINK_COMMAND, INSERT_RICH_TEXT_TEMPLATE_VARIABLE_COMMAND, RichTextLinkNode, OPEN_RICH_TEXT_LINK_EDITOR_COMMAND, TemplateVariableNode, UPDATE_RICH_TEXT_LINK_COMMAND, createRichTextEditorValueFromPlainText, } from './rich-text-editor-utils';
3
+ export type { RichTextLinkPayload, RichTextStyleControl, RichTextTemplateVariable, SerializedRichTextLinkNode, SerializedTemplateVariableNode, } from './rich-text-editor-utils';
@@ -0,0 +1,5 @@
1
+ export interface CommandHandlerPluginProps {
2
+ /** When true, registers Lexical's horizontal rule insert command (block editor only). */
3
+ horizontalRuleCommandEnabled?: boolean;
4
+ }
5
+ export declare function CommandHandlerPlugin({ horizontalRuleCommandEnabled }: CommandHandlerPluginProps): null;
@@ -0,0 +1,3 @@
1
+ export declare function EditableModePlugin({ editable }: {
2
+ editable: boolean;
3
+ }): null;
@@ -0,0 +1,11 @@
1
+ import { RefObject } from 'react';
2
+ import { RichTextStyleControl, RichTextTemplateVariable } from '../rich-text-editor-utils';
3
+ export declare function FloatingToolbarPlugin({ editable, linksEnabled, blockAlignmentEnabled, surfaceRef, toolbarClassName, styleControls, templateVariables, }: {
4
+ editable: boolean;
5
+ linksEnabled: boolean;
6
+ blockAlignmentEnabled: boolean;
7
+ surfaceRef: RefObject<HTMLDivElement | null>;
8
+ toolbarClassName?: string;
9
+ styleControls: RichTextStyleControl[];
10
+ templateVariables: RichTextTemplateVariable[];
11
+ }): import("react/jsx-runtime").JSX.Element | null;
@@ -0,0 +1,4 @@
1
+ export declare function ImageDialogPlugin({ editable, enabled, }: {
2
+ editable: boolean;
3
+ enabled: boolean;
4
+ }): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,6 @@
1
+ import { RefObject } from 'react';
2
+ export declare function InfoBoxPopoverPlugin({ editable, enabled, surfaceRef, }: {
3
+ editable: boolean;
4
+ enabled: boolean;
5
+ surfaceRef: RefObject<HTMLDivElement | null>;
6
+ }): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,6 @@
1
+ import { RefObject } from 'react';
2
+ export declare function LinkPopoverPlugin({ editable, enabled, surfaceRef, }: {
3
+ editable: boolean;
4
+ enabled: boolean;
5
+ surfaceRef: RefObject<HTMLDivElement | null>;
6
+ }): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1 @@
1
+ export declare function RichTextImageAssetDeletionPlugin(): null;
@@ -0,0 +1,15 @@
1
+ import { RefObject } from 'react';
2
+ import { RichTextStyleControl, RichTextTemplateVariable } from '../rich-text-editor-utils';
3
+ export declare function SlashCommandMenuPlugin({ editable, linksEnabled, bulletListsEnabled, headingsEnabled, infoBoxesEnabled, imagesEnabled, separatorsEnabled, surfaceRef, styleControls, templateVariables, commandMenuClassName, }: {
4
+ editable: boolean;
5
+ linksEnabled: boolean;
6
+ bulletListsEnabled?: boolean;
7
+ headingsEnabled?: boolean;
8
+ infoBoxesEnabled?: boolean;
9
+ imagesEnabled?: boolean;
10
+ separatorsEnabled?: boolean;
11
+ surfaceRef: RefObject<HTMLDivElement | null>;
12
+ styleControls: RichTextStyleControl[];
13
+ templateVariables: RichTextTemplateVariable[];
14
+ commandMenuClassName?: string;
15
+ }): import("react/jsx-runtime").JSX.Element | null;
@@ -0,0 +1,4 @@
1
+ import { SerializedEditorState } from 'lexical';
2
+ export declare function SyncEditorValuePlugin({ value, }: {
3
+ value?: SerializedEditorState | null;
4
+ }): null;