@case-framework/survey-ui 0.2.4 → 0.3.1

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 (214) hide show
  1. package/README.md +2 -13
  2. package/dist/src/components/c-ui/alert-provider.d.ts +18 -0
  3. package/dist/src/components/c-ui/confirm-dialog.d.ts +19 -0
  4. package/dist/src/components/c-ui/confirm-provider.d.ts +15 -0
  5. package/dist/src/components/c-ui/dot-background.d.ts +72 -0
  6. package/dist/src/components/c-ui/filepicker-dropzone.d.ts +38 -0
  7. package/dist/src/components/c-ui/loading-button.d.ts +9 -0
  8. package/dist/src/components/common/content-editable-plain.d.ts +17 -0
  9. package/dist/src/components/hooks/use-button-shortcut.d.ts +18 -0
  10. package/dist/src/components/hooks/use-document-keydown.d.ts +7 -0
  11. package/dist/src/components/rich-text/content-policy.d.ts +19 -0
  12. package/dist/src/components/rich-text/index.d.ts +6 -0
  13. package/dist/src/components/rich-text/nodes/rich-text-image-node.d.ts +40 -0
  14. package/dist/src/components/rich-text/nodes/rich-text-info-box-node.d.ts +45 -0
  15. package/dist/src/components/rich-text/nodes/survey-rich-text-heading-node.d.ts +27 -0
  16. package/dist/src/components/rich-text/rich-text-block-editor.d.ts +8 -0
  17. package/dist/src/components/rich-text/rich-text-content-view.d.ts +11 -0
  18. package/dist/src/components/rich-text/rich-text-editor-context.d.ts +23 -0
  19. package/dist/src/components/rich-text/rich-text-link-utils.d.ts +2 -0
  20. package/dist/src/components/rich-text/rich-text-survey-content.d.ts +7 -0
  21. package/dist/src/components/rich-text/types.d.ts +6 -0
  22. package/dist/src/components/rich-text-editor/index.d.ts +3 -0
  23. package/dist/src/components/rich-text-editor/plugins/command-handler-plugin.d.ts +5 -0
  24. package/dist/src/components/rich-text-editor/plugins/editable-mode-plugin.d.ts +3 -0
  25. package/dist/src/components/rich-text-editor/plugins/floating-toolbar-plugin.d.ts +11 -0
  26. package/dist/src/components/rich-text-editor/plugins/image-dialog-plugin.d.ts +4 -0
  27. package/dist/src/components/rich-text-editor/plugins/info-box-popover-plugin.d.ts +6 -0
  28. package/dist/src/components/rich-text-editor/plugins/link-popover-plugin.d.ts +6 -0
  29. package/dist/src/components/rich-text-editor/plugins/rich-text-image-asset-deletion-plugin.d.ts +1 -0
  30. package/dist/src/components/rich-text-editor/plugins/slash-command-menu-plugin.d.ts +15 -0
  31. package/dist/src/components/rich-text-editor/plugins/sync-editor-value-plugin.d.ts +4 -0
  32. package/dist/src/components/rich-text-editor/rich-text-editor-utils.d.ts +205 -0
  33. package/dist/src/components/rich-text-editor/rich-text-editor.d.ts +43 -0
  34. package/dist/src/components/rich-text-editor/rich-text-image-editor-commands.d.ts +12 -0
  35. package/dist/src/components/rich-text-editor/rich-text-info-box-commands.d.ts +20 -0
  36. package/dist/src/components/rich-text-editor/style-control-icon.d.ts +5 -0
  37. package/dist/src/components/ui/alert-dialog.d.ts +18 -0
  38. package/dist/src/components/ui/alert.d.ts +10 -0
  39. package/dist/src/components/ui/badge.d.ts +9 -0
  40. package/dist/src/components/ui/breadcrumb.d.ts +11 -0
  41. package/dist/src/components/ui/button.d.ts +10 -0
  42. package/dist/src/components/ui/calendar.d.ts +10 -0
  43. package/dist/src/components/ui/card.d.ts +11 -0
  44. package/dist/src/components/ui/checkbox.d.ts +4 -0
  45. package/dist/src/components/ui/collapsible.d.ts +5 -0
  46. package/dist/src/components/ui/command.d.ts +18 -0
  47. package/dist/src/components/ui/context-menu.d.ts +31 -0
  48. package/dist/src/components/ui/dialog.d.ts +19 -0
  49. package/dist/src/components/ui/dropdown-menu.d.ts +29 -0
  50. package/dist/src/components/ui/field.d.ts +24 -0
  51. package/dist/src/components/ui/input-group.d.ts +16 -0
  52. package/dist/src/components/ui/input.d.ts +3 -0
  53. package/dist/src/components/ui/kbd.d.ts +3 -0
  54. package/dist/src/components/ui/label.d.ts +4 -0
  55. package/dist/src/components/ui/popover.d.ts +10 -0
  56. package/dist/src/components/ui/progress.d.ts +4 -0
  57. package/dist/src/components/ui/radio-group.d.ts +5 -0
  58. package/dist/src/components/ui/scroll-area.d.ts +5 -0
  59. package/dist/src/components/ui/select.d.ts +15 -0
  60. package/dist/src/components/ui/separator.d.ts +4 -0
  61. package/dist/src/components/ui/skeleton.d.ts +2 -0
  62. package/dist/src/components/ui/slider.d.ts +4 -0
  63. package/dist/src/components/ui/sonner.d.ts +3 -0
  64. package/dist/src/components/ui/switch.d.ts +6 -0
  65. package/dist/src/components/ui/tabs.d.ts +11 -0
  66. package/dist/src/components/ui/textarea.d.ts +3 -0
  67. package/dist/src/components/ui/toggle-group.d.ts +10 -0
  68. package/dist/src/components/ui/toggle.d.ts +9 -0
  69. package/dist/src/components/ui/tooltip.d.ts +7 -0
  70. package/dist/src/dev/_components/nav-input.d.ts +35 -0
  71. package/dist/src/dev/app.d.ts +2 -0
  72. package/dist/src/dev/localizations/de.d.ts +2 -0
  73. package/dist/src/dev/main.d.ts +0 -0
  74. package/dist/src/index.d.ts +10 -0
  75. package/dist/src/lib/utils.d.ts +2 -0
  76. package/dist/src/modules/default-item-registry/default-item-cores.d.ts +24 -0
  77. package/dist/src/modules/default-item-registry/default-registry-entries.d.ts +2 -0
  78. package/dist/src/modules/default-item-registry/index.d.ts +19 -0
  79. package/dist/src/modules/default-item-registry/items/choice/display-order.d.ts +1 -0
  80. package/dist/src/modules/default-item-registry/items/choice/editor/card.d.ts +3 -0
  81. package/dist/src/modules/default-item-registry/items/choice/editor/option-create.d.ts +11 -0
  82. package/dist/src/modules/default-item-registry/items/choice/editor/option-edit-dialog.d.ts +14 -0
  83. package/dist/src/modules/default-item-registry/items/choice/editor/option-editor-fields.d.ts +17 -0
  84. package/dist/src/modules/default-item-registry/items/choice/editor/option-embedded-form-dialog.d.ts +15 -0
  85. package/dist/src/modules/default-item-registry/items/choice/editor/response-options-list.d.ts +20 -0
  86. package/dist/src/modules/default-item-registry/items/choice/expression-registry.d.ts +3 -0
  87. package/dist/src/modules/default-item-registry/items/choice/model.d.ts +28 -0
  88. package/dist/src/modules/default-item-registry/items/choice/player/question.d.ts +32 -0
  89. package/dist/src/modules/default-item-registry/items/choice/preview/item.d.ts +2 -0
  90. package/dist/src/modules/default-item-registry/items/choice/search-adapter.d.ts +2 -0
  91. package/dist/src/modules/default-item-registry/items/form/editor/card.d.ts +3 -0
  92. package/dist/src/modules/default-item-registry/items/form/editor/config-editor.d.ts +12 -0
  93. package/dist/src/modules/default-item-registry/items/form/editor/field-edit-dialog.d.ts +10 -0
  94. package/dist/src/modules/default-item-registry/items/form/editor/field-group-header-dialog.d.ts +12 -0
  95. package/dist/src/modules/default-item-registry/items/form/editor/field-group-layout-dialog.d.ts +9 -0
  96. package/dist/src/modules/default-item-registry/items/form/editor/field-item-preview.d.ts +15 -0
  97. package/dist/src/modules/default-item-registry/items/form/editor/field-key-dialog.d.ts +10 -0
  98. package/dist/src/modules/default-item-registry/items/form/editor/field-sort-dialog.d.ts +11 -0
  99. package/dist/src/modules/default-item-registry/items/form/editor/field-type-shared.d.ts +12 -0
  100. package/dist/src/modules/default-item-registry/items/form/editor/response-field-groups-list.d.ts +16 -0
  101. package/dist/src/modules/default-item-registry/items/form/model.d.ts +158 -0
  102. package/dist/src/modules/default-item-registry/items/form/player/field.d.ts +28 -0
  103. package/dist/src/modules/default-item-registry/items/form/preview/item.d.ts +2 -0
  104. package/dist/src/modules/default-item-registry/items/info/editor-card.d.ts +3 -0
  105. package/dist/src/modules/default-item-registry/items/info/player/card-field.d.ts +14 -0
  106. package/dist/src/modules/default-item-registry/items/info/preview/item.d.ts +2 -0
  107. package/dist/src/modules/default-item-registry/items/info/search-adapter.d.ts +2 -0
  108. package/dist/src/modules/default-item-registry/items/structure/group/editor-card.d.ts +3 -0
  109. package/dist/src/modules/default-item-registry/items/structure/page-break/editor-card.d.ts +3 -0
  110. package/dist/src/modules/default-item-registry/items/structure/preview-renderers.d.ts +3 -0
  111. package/dist/src/modules/default-item-registry/items/structure/root/editor-card.d.ts +3 -0
  112. package/dist/src/modules/default-item-registry/shared/player/question-card-shell.d.ts +13 -0
  113. package/dist/src/modules/default-item-registry/shared/preview/question-header.d.ts +6 -0
  114. package/dist/src/modules/default-item-registry/shared/preview/utils.d.ts +3 -0
  115. package/dist/src/modules/default-item-registry/shared/question-editor/deferred-localized-rich-text-field.d.ts +26 -0
  116. package/dist/src/modules/default-item-registry/shared/question-editor/header-editor.d.ts +6 -0
  117. package/dist/src/modules/default-item-registry/shared/question-editor/layout.d.ts +8 -0
  118. package/dist/src/modules/default-item-registry/shared/question-editor/rich-text-editors.d.ts +23 -0
  119. package/dist/src/modules/default-item-registry/shared/question-editor/rich-text-policies.d.ts +8 -0
  120. package/dist/src/modules/default-item-registry/shared/question-editor/toolbar.d.ts +10 -0
  121. package/dist/src/modules/survey-editor/ai/types.d.ts +88 -0
  122. package/dist/src/modules/survey-editor/assets/index.d.ts +4 -0
  123. package/dist/src/modules/survey-editor/assets/survey-image-asset-manager.d.ts +4 -0
  124. package/dist/src/modules/survey-editor/assets/use-survey-assets.d.ts +4 -0
  125. package/dist/src/modules/survey-editor/assets/utils.d.ts +5 -0
  126. package/dist/src/modules/survey-editor/editor-card/add-items/constants.d.ts +3 -0
  127. package/dist/src/modules/survey-editor/editor-card/add-items/hooks/use-add-item-actions.d.ts +25 -0
  128. package/dist/src/modules/survey-editor/editor-card/add-items/hooks/use-add-item-target.d.ts +9 -0
  129. package/dist/src/modules/survey-editor/editor-card/add-items/hooks/use-option-group-navigation.d.ts +19 -0
  130. package/dist/src/modules/survey-editor/editor-card/add-items/types.d.ts +21 -0
  131. package/dist/src/modules/survey-editor/editor-card/add-items/views/ai-item-view.d.ts +10 -0
  132. package/dist/src/modules/survey-editor/editor-card/add-items/views/back-button.d.ts +5 -0
  133. package/dist/src/modules/survey-editor/editor-card/add-items/views/blank-item-view.d.ts +13 -0
  134. package/dist/src/modules/survey-editor/editor-card/add-items/views/entry-view.d.ts +15 -0
  135. package/dist/src/modules/survey-editor/editor-card/add-items/views/structure-view.d.ts +16 -0
  136. package/dist/src/modules/survey-editor/editor-card/add-items.d.ts +1 -0
  137. package/dist/src/modules/survey-editor/editor-card/copy-item-dropdown-menu.d.ts +5 -0
  138. package/dist/src/modules/survey-editor/editor-card/delete-item-context-menu.d.ts +5 -0
  139. package/dist/src/modules/survey-editor/editor-card/delete-item-dropdown-menu.d.ts +5 -0
  140. package/dist/src/modules/survey-editor/editor-card/editor-card-tab-trigger.d.ts +15 -0
  141. package/dist/src/modules/survey-editor/editor-card/group-items.d.ts +2 -0
  142. package/dist/src/modules/survey-editor/editor-card/hooks/use-armed-shortcut-sequence.d.ts +11 -0
  143. package/dist/src/modules/survey-editor/editor-card/hooks/use-group-list-keyboard.d.ts +30 -0
  144. package/dist/src/modules/survey-editor/editor-card/index.d.ts +2 -0
  145. package/dist/src/modules/survey-editor/editor-card/item-color-menu.d.ts +6 -0
  146. package/dist/src/modules/survey-editor/editor-card/item-color-selector.d.ts +5 -0
  147. package/dist/src/modules/survey-editor/editor-card/item-editor-card-skeleton.d.ts +2 -0
  148. package/dist/src/modules/survey-editor/editor-card/item-editor-card.d.ts +39 -0
  149. package/dist/src/modules/survey-editor/editor-card/item-editor-context.d.ts +20 -0
  150. package/dist/src/modules/survey-editor/editor-card/item-key-editor.d.ts +9 -0
  151. package/dist/src/modules/survey-editor/editor-card/item-label-preview-and-editor.d.ts +10 -0
  152. package/dist/src/modules/survey-editor/editor-card/item-preview.d.ts +8 -0
  153. package/dist/src/modules/survey-editor/editor-card/item-sibling-navigation.d.ts +5 -0
  154. package/dist/src/modules/survey-editor/editor-card/item-type-icon-with-tooltip.d.ts +8 -0
  155. package/dist/src/modules/survey-editor/editor-card/survey-player-item-preview.d.ts +6 -0
  156. package/dist/src/modules/survey-editor/editor-instance-provider.d.ts +7 -0
  157. package/dist/src/modules/survey-editor/hooks/useClipboardValue.d.ts +2 -0
  158. package/dist/src/modules/survey-editor/hooks/useDeleteItem.d.ts +9 -0
  159. package/dist/src/modules/survey-editor/hooks/useEditor.d.ts +12 -0
  160. package/dist/src/modules/survey-editor/hooks/useEditorStateChange.d.ts +17 -0
  161. package/dist/src/modules/survey-editor/hooks/useKeyboardShortcuts.d.ts +7 -0
  162. package/dist/src/modules/survey-editor/index.d.ts +17 -0
  163. package/dist/src/modules/survey-editor/localization/date-fns.d.ts +5 -0
  164. package/dist/src/modules/survey-editor/localization/default-en.d.ts +4 -0
  165. package/dist/src/modules/survey-editor/localization/index.d.ts +5 -0
  166. package/dist/src/modules/survey-editor/localization/runtime.d.ts +4 -0
  167. package/dist/src/modules/survey-editor/localization/types.d.ts +7 -0
  168. package/dist/src/modules/survey-editor/navigation/navigation-provider.d.ts +11 -0
  169. package/dist/src/modules/survey-editor/navigation/navigation.d.ts +13 -0
  170. package/dist/src/modules/survey-editor/navigation/types.d.ts +18 -0
  171. package/dist/src/modules/survey-editor/primitives/input-with-ai-popover.d.ts +35 -0
  172. package/dist/src/modules/survey-editor/registry/index.d.ts +7 -0
  173. package/dist/src/modules/survey-editor/registry/registry-mappers.d.ts +25 -0
  174. package/dist/src/modules/survey-editor/registry/search-adapter.d.ts +19 -0
  175. package/dist/src/modules/survey-editor/registry/types.d.ts +178 -0
  176. package/dist/src/modules/survey-editor/routes/editor/_components/footer.d.ts +2 -0
  177. package/dist/src/modules/survey-editor/routes/editor/_components/history-stack.d.ts +2 -0
  178. package/dist/src/modules/survey-editor/routes/editor/_components/main.d.ts +2 -0
  179. package/dist/src/modules/survey-editor/routes/editor/asset-manager/index.d.ts +2 -0
  180. package/dist/src/modules/survey-editor/routes/editor/index.d.ts +5 -0
  181. package/dist/src/modules/survey-editor/routes/editor/item-editor/_components/item-editor-toolbar/breadcrumbs-nav.d.ts +2 -0
  182. package/dist/src/modules/survey-editor/routes/editor/item-editor/_components/item-editor-toolbar/item-editor-toolbar.d.ts +2 -0
  183. package/dist/src/modules/survey-editor/routes/editor/item-editor/_components/item-editor-toolbar/language-picker.d.ts +2 -0
  184. package/dist/src/modules/survey-editor/routes/editor/item-editor/_components/item-editor-toolbar/search-trigger.d.ts +3 -0
  185. package/dist/src/modules/survey-editor/routes/editor/item-editor/_components/item-editor-toolbar/survey-search.d.ts +7 -0
  186. package/dist/src/modules/survey-editor/routes/editor/item-editor/index.d.ts +2 -0
  187. package/dist/src/modules/survey-editor/routes/editor/translation-mode/index.d.ts +2 -0
  188. package/dist/src/modules/survey-editor/session-file.d.ts +13 -0
  189. package/dist/src/modules/survey-editor/store/editor-store-context.d.ts +10 -0
  190. package/dist/src/modules/survey-editor/store/editor-store-provider.d.ts +7 -0
  191. package/dist/src/modules/survey-editor/store/editor-store.d.ts +102 -0
  192. package/dist/src/modules/survey-editor/store/use-editor-store.d.ts +4 -0
  193. package/dist/src/modules/survey-editor/store/useItemNavigation.d.ts +7 -0
  194. package/dist/src/modules/survey-editor/survey-editor-config.d.ts +29 -0
  195. package/dist/src/modules/survey-editor/survey-editor.d.ts +26 -0
  196. package/dist/src/modules/survey-editor/utils/item-type-infos.d.ts +23 -0
  197. package/dist/src/modules/survey-player/index.d.ts +5 -0
  198. package/dist/src/modules/survey-player/localization/default-en.d.ts +3 -0
  199. package/dist/src/modules/survey-player/localization/runtime.d.ts +4 -0
  200. package/dist/src/modules/survey-player/localization/types.d.ts +7 -0
  201. package/dist/src/modules/survey-player/survey-context.d.ts +32 -0
  202. package/dist/src/modules/survey-player/survey-item/survey-item-context.d.ts +27 -0
  203. package/dist/src/modules/survey-player/survey-item/survey-item-types/placeholder-item-renderers.d.ts +4 -0
  204. package/dist/src/modules/survey-player/survey-item/survey-item-types/question-wrapper.d.ts +5 -0
  205. package/dist/src/modules/survey-player/survey-item/survey-item.d.ts +7 -0
  206. package/dist/src/modules/survey-player/survey-player.d.ts +14 -0
  207. package/dist/survey-editor-defaults.css +13 -7
  208. package/dist/survey-ui.cjs.js +148 -28
  209. package/dist/survey-ui.cjs.js.map +1 -1
  210. package/dist/survey-ui.css +2 -2
  211. package/dist/survey-ui.es.js +47547 -17776
  212. package/dist/survey-ui.es.js.map +1 -1
  213. package/package.json +28 -20
  214. package/dist/index.d.ts +0 -478
@@ -0,0 +1,5 @@
1
+ interface DeleteItemContextMenuItemProps {
2
+ itemId: string;
3
+ }
4
+ export declare const DeleteItemContextMenuItem: React.FC<DeleteItemContextMenuItemProps>;
5
+ export {};
@@ -0,0 +1,5 @@
1
+ interface DeleteItemDropdownMenuItemProps {
2
+ overrideItemId?: string;
3
+ }
4
+ export declare const DeleteItemDropdownMenuItem: ({ overrideItemId }: DeleteItemDropdownMenuItemProps) => import("react/jsx-runtime").JSX.Element | null;
5
+ export {};
@@ -0,0 +1,15 @@
1
+ import { LucideIcon } from 'lucide-react';
2
+ interface EditorCardTabTriggerProps {
3
+ value: string;
4
+ label: string;
5
+ icon: LucideIcon;
6
+ isActive: boolean;
7
+ colorAccent: string;
8
+ colorBorder: string;
9
+ showShortcutNumber: boolean;
10
+ shortcutNumber: number;
11
+ hasIndicator?: boolean;
12
+ indicatorCount?: number;
13
+ }
14
+ declare const EditorCardTabTrigger: React.FC<EditorCardTabTriggerProps>;
15
+ export default EditorCardTabTrigger;
@@ -0,0 +1,2 @@
1
+ declare const GroupItems: () => import("react/jsx-runtime").JSX.Element;
2
+ export default GroupItems;
@@ -0,0 +1,11 @@
1
+ interface ArmedShortcutSequenceOptions {
2
+ armKey: string;
3
+ enabled?: boolean;
4
+ maxIndex?: number;
5
+ timeoutMs?: number;
6
+ onSelectIndex: (index: number) => void;
7
+ }
8
+ export declare const useArmedShortcutSequence: ({ armKey, enabled, maxIndex, timeoutMs, onSelectIndex, }: ArmedShortcutSequenceOptions) => {
9
+ isArmed: boolean;
10
+ };
11
+ export {};
@@ -0,0 +1,30 @@
1
+ import { RefObject, KeyboardEvent as ReactKeyboardEvent } from 'react';
2
+ import { SurveyItemClipboardData } from '@case-framework/survey-core/editor';
3
+ interface UseGroupListKeyboardParams {
4
+ addItemDialogOpen: boolean;
5
+ containerRef: RefObject<HTMLElement | null>;
6
+ groupId: string | null | undefined;
7
+ itemIds: string[];
8
+ clipboardValue: string | null;
9
+ previewItemId: string | null;
10
+ openAddDialogForCurrentGroup: () => void;
11
+ openFocusedItem: (itemId: string) => void;
12
+ selectPreviewItem: (itemId: string) => void;
13
+ moveItemByOffset: (itemId: string, offset: -1 | 1) => boolean;
14
+ parseSurveyItemClipboard: (value: string | null) => SurveyItemClipboardData | null;
15
+ pasteItemFromClipboardData: (clipboardData: SurveyItemClipboardData, parentId: string) => string;
16
+ onPasteCommitted: (newItemId: string) => void;
17
+ copyItemToClipboard: (itemId: string) => void;
18
+ }
19
+ export declare const useGroupListKeyboard: ({ addItemDialogOpen, containerRef, groupId, itemIds, clipboardValue, previewItemId, openAddDialogForCurrentGroup, openFocusedItem, selectPreviewItem, moveItemByOffset, parseSurveyItemClipboard, pasteItemFromClipboardData, onPasteCommitted, copyItemToClipboard, }: UseGroupListKeyboardParams) => {
20
+ getItemButtonProps: (itemId: string) => {
21
+ "data-group-list-target": string;
22
+ "data-group-list-item-id": string;
23
+ onFocus: () => void;
24
+ };
25
+ getAddButtonProps: () => {
26
+ "data-group-list-target": string;
27
+ };
28
+ onListKeyDown: (event: ReactKeyboardEvent<HTMLElement>) => void;
29
+ };
30
+ export {};
@@ -0,0 +1,2 @@
1
+ declare const ItemEditorCard: React.FC;
2
+ export default ItemEditorCard;
@@ -0,0 +1,6 @@
1
+ interface ItemColorMenuProps {
2
+ itemId: string;
3
+ }
4
+ export declare const DropdownItemColorMenu: ({ itemId }: ItemColorMenuProps) => import("react/jsx-runtime").JSX.Element;
5
+ export declare const ContextItemColorMenu: ({ itemId }: ItemColorMenuProps) => import("react/jsx-runtime").JSX.Element;
6
+ export {};
@@ -0,0 +1,5 @@
1
+ declare const ItemColorSelector: React.FC<{
2
+ currentColor: string;
3
+ onColorChange: (color: string) => void;
4
+ }>;
5
+ export default ItemColorSelector;
@@ -0,0 +1,2 @@
1
+ declare const ItemEditorCardSkeleton: React.FC;
2
+ export default ItemEditorCardSkeleton;
@@ -0,0 +1,39 @@
1
+ import { ReactNode } from 'react';
2
+ import { SurveyItemCore } from '@case-framework/survey-core';
3
+ import { LucideIcon } from 'lucide-react';
4
+ export interface CommonItemEditorCardProps {
5
+ item: SurveyItemCore;
6
+ }
7
+ interface NavItem {
8
+ id: string;
9
+ label: string;
10
+ icon: LucideIcon;
11
+ hasIndicator?: boolean;
12
+ indicatorCount?: number;
13
+ }
14
+ interface SidePanelCard {
15
+ id: string;
16
+ title: string;
17
+ description?: string;
18
+ icon: LucideIcon;
19
+ content?: ReactNode;
20
+ }
21
+ interface PreviewDialogConfig {
22
+ content: ReactNode;
23
+ title?: string;
24
+ description?: string;
25
+ }
26
+ interface ItemEditorCardProps {
27
+ surveyItem: SurveyItemCore;
28
+ menu: {
29
+ items: ReactNode[];
30
+ hideDeleteItem?: boolean;
31
+ };
32
+ navItems?: NavItem[];
33
+ layoutVariant?: "tabs" | "stacked";
34
+ sidePanelCards?: SidePanelCard[];
35
+ previewDialog?: PreviewDialogConfig;
36
+ children: ReactNode;
37
+ }
38
+ declare const ItemEditorCard: React.FC<ItemEditorCardProps>;
39
+ export default ItemEditorCard;
@@ -0,0 +1,20 @@
1
+ import { ReactNode } from 'react';
2
+ interface ItemEditorContextType {
3
+ addItemDialogOpen: boolean;
4
+ setAddItemDialogOpen: (open: boolean) => void;
5
+ openAddItemDialog: (targetParentId?: string) => void;
6
+ closeAddItemDialog: () => void;
7
+ targetParentId: string | undefined;
8
+ preferredPreviewItemId: string | null;
9
+ setPreferredPreviewItemId: (itemId: string | null) => void;
10
+ }
11
+ interface ItemEditorProviderProps {
12
+ children: ReactNode;
13
+ }
14
+ export declare const ItemEditorProvider: React.FC<ItemEditorProviderProps>;
15
+ export declare const useItemEditor: () => ItemEditorContextType;
16
+ export declare const useAddItemDialog: () => {
17
+ openAddItemDialog: (targetParentId?: string) => void;
18
+ closeAddItemDialog: () => void;
19
+ };
20
+ export {};
@@ -0,0 +1,9 @@
1
+ import { SurveyItemKey } from '@case-framework/survey-core';
2
+ interface ItemKeyEditorProps {
3
+ itemId: string;
4
+ currentItemKey?: SurveyItemKey;
5
+ siblingKeys: string[];
6
+ onChangeItemKey: (newKey: string) => void;
7
+ }
8
+ declare const ItemKeyEditor: (props: ItemKeyEditorProps) => import("react/jsx-runtime").JSX.Element;
9
+ export default ItemKeyEditor;
@@ -0,0 +1,10 @@
1
+ interface ItemLabelPreviewAndEditorProps {
2
+ itemId: string;
3
+ itemType: string;
4
+ itemLabel: string;
5
+ maxSuggestions?: number;
6
+ className?: string;
7
+ onChangeItemLabel: (newLabel: string) => void;
8
+ }
9
+ declare const ItemLabelPreviewAndEditor: React.FC<ItemLabelPreviewAndEditorProps>;
10
+ export default ItemLabelPreviewAndEditor;
@@ -0,0 +1,8 @@
1
+ import { SurveyItemCore } from '@case-framework/survey-core';
2
+ import { ItemPreviewMode } from '../../../../modules/survey-editor/registry';
3
+ interface ItemPreviewProps {
4
+ item: SurveyItemCore | undefined;
5
+ mode?: ItemPreviewMode;
6
+ }
7
+ declare const ItemPreview: ({ item, mode }: ItemPreviewProps) => import("react/jsx-runtime").JSX.Element;
8
+ export default ItemPreview;
@@ -0,0 +1,5 @@
1
+ interface ItemSiblingNavigationProps {
2
+ itemId: string;
3
+ }
4
+ declare const ItemSiblingNavigation: React.FC<ItemSiblingNavigationProps>;
5
+ export default ItemSiblingNavigation;
@@ -0,0 +1,8 @@
1
+ import { ItemTypeInfos } from '../../../../modules/survey-editor/utils/item-type-infos';
2
+ interface ItemTypeIconWithTooltipProps {
3
+ typeInfos: ItemTypeInfos;
4
+ color?: string;
5
+ iconClassName?: string;
6
+ }
7
+ declare const ItemTypeIconWithTooltip: ({ typeInfos, color, iconClassName }: ItemTypeIconWithTooltipProps) => import("react/jsx-runtime").JSX.Element;
8
+ export default ItemTypeIconWithTooltip;
@@ -0,0 +1,6 @@
1
+ import { SurveyItemCore } from '@case-framework/survey-core';
2
+ interface SurveyPlayerItemPreviewProps {
3
+ item: SurveyItemCore;
4
+ }
5
+ export declare const SurveyPlayerItemPreview: React.FC<SurveyPlayerItemPreviewProps>;
6
+ export {};
@@ -0,0 +1,7 @@
1
+ import { PropsWithChildren } from 'react';
2
+ import { SurveyEditorNavigationAdapter } from './navigation/types';
3
+ interface EditorInstanceProviderProps extends PropsWithChildren {
4
+ navigationAdapter?: SurveyEditorNavigationAdapter | null;
5
+ }
6
+ export declare const EditorInstanceProvider: React.FC<EditorInstanceProviderProps>;
7
+ export {};
@@ -0,0 +1,2 @@
1
+ export declare const notifyClipboardValueChanged: () => void;
2
+ export declare const useClipboardValue: () => [string | null, () => void, Date | null];
@@ -0,0 +1,9 @@
1
+ interface UseDeleteItemOptions {
2
+ itemId?: string;
3
+ }
4
+ export declare function useDeleteItem(options?: UseDeleteItemOptions): {
5
+ itemId: string | undefined;
6
+ canDelete: boolean;
7
+ deleteItem: () => Promise<void>;
8
+ };
9
+ export {};
@@ -0,0 +1,12 @@
1
+ import { SurveyEditor } from '@case-framework/survey-core/editor';
2
+ import { Survey } from '@case-framework/survey-core';
3
+ /**
4
+ * Returns the current SurveyEditor instance. Use when you need the full editor API.
5
+ */
6
+ export declare function useEditor(): SurveyEditor | null;
7
+ /**
8
+ * Returns the current Survey from the editor. Use when you only need survey data (items, translations, etc.).
9
+ * Uses changeTick + useMemo to avoid infinite loops: SurveyEditor.survey getter returns a new instance
10
+ * on every access, which would otherwise make getSnapshot return a new ref each time.
11
+ */
12
+ export declare function useEditorSurvey(): Survey | null;
@@ -0,0 +1,17 @@
1
+ import { SerializedSurveyEditor, SurveyEditor as SurveyEditorCore } from '@case-framework/survey-core/editor';
2
+ export interface EditorStateChangePayload {
3
+ sessionId: string | null;
4
+ state: SerializedSurveyEditor;
5
+ revision: number;
6
+ hasUncommittedChanges: boolean;
7
+ at: number;
8
+ }
9
+ interface UseEditorStateChangeOptions {
10
+ sessionId: string | null;
11
+ editor: SurveyEditorCore | null;
12
+ changeTick: number;
13
+ persistDebounceMs: number;
14
+ onEditorStateChange?: (change: EditorStateChangePayload) => void;
15
+ }
16
+ export declare function useEditorStateChange({ sessionId, editor, changeTick, persistDebounceMs, onEditorStateChange, }: UseEditorStateChangeOptions): void;
17
+ export {};
@@ -0,0 +1,7 @@
1
+ export interface KeyboardShortcutHandlers {
2
+ onSave?: () => void;
3
+ onUndo?: () => void;
4
+ onRedo?: () => void;
5
+ onSearch?: () => void;
6
+ }
7
+ export declare const useKeyboardShortcuts: (handlers: KeyboardShortcutHandlers) => void;
@@ -0,0 +1,17 @@
1
+ export { SurveyEditor } from './survey-editor';
2
+ export type { SurveyEditorProps, SurveyEditorStateChange } from './survey-editor';
3
+ export { EditorInstanceProvider } from './editor-instance-provider';
4
+ export { useEditorDateLocale, useEditorTranslation } from './survey-editor-config';
5
+ export type { SurveyEditorNavigationAdapter, SurveyEditorLocation } from './navigation/types';
6
+ export { DEFAULT_EDITOR_LANGUAGE, DEFAULT_DATE_FNS_LOCALES, defaultSurveyEditorLocalizations, getDateFnsLocale, mergeDateFnsLocales, surveyEditorEnMessages, } from './localization';
7
+ export type { EditorLocalizationMessages, EditorTranslationValues, SurveyEditorDateLocales, SurveyEditorLocalizations, } from './localization';
8
+ export type { AISuggestedText, BuildSurveyAIContextOptions, GenerateItemFromIntentRequest, GenerateItemFromIntentResult, GeneratedItemIntentSuggestion, SuggestItemKeyRequest, SuggestItemKeyResult, SuggestItemKeySuggestion, SuggestItemLabelRequest, SuggestItemLabelResult, SuggestItemLabelSuggestion, SurveyEditorAIProvider, SurveyAIContextPurpose, SurveyAIContextScope, SurveyAIInvocationMode, SurveyAIRequestOptions, TranslateContentEntry, TranslateContentRequest, TranslateContentResult, } from './ai/types';
9
+ export * from './registry';
10
+ export { buildSurveyFileName, createBlankEditorState, createEditorStateFromRawSurvey, parseEditorStateFromJsonText, serializeSurveyStateForFile, type ParsedSurveySession, type ParsedSurveySessionFormat, } from './session-file';
11
+ export { DEFAULT_BLOCK_CONTENT_POLICY, DEFAULT_COMPACT_CONTENT_POLICY, RichTextBlockEditor, RichTextContentView, createRichTextEditorValueFromContent, createRichTextEditorValueFromText, getRichTextContentFromEditorState, isBlockContentPolicyVariant, mergeRichTextContentPolicy, sanitizeContentForPolicy, } from '../../../components/rich-text';
12
+ export { RichTextEditor, createRichTextEditorValueFromPlainText, } from '../../../components/rich-text-editor';
13
+ export { APPLY_RICH_TEXT_STYLE_COMMAND, CONVERT_RICH_TEXT_LINK_TO_TEXT_COMMAND, INSERT_RICH_TEXT_LINK_COMMAND, INSERT_RICH_TEXT_TEMPLATE_VARIABLE_COMMAND, OPEN_RICH_TEXT_LINK_EDITOR_COMMAND, TemplateVariableNode, UPDATE_RICH_TEXT_LINK_COMMAND, } from '../../../components/rich-text-editor';
14
+ export { SurveyImageAssetManager, useSurveyAssets, useSurveyImageAssets, useUnusedSurveyAssetCount, } from './assets';
15
+ export type { RichTextBlockEditorChange, RichTextBlockEditorProps, RichTextContentPolicy, RichTextContentViewProps, RichTextEditorVariant, RichTextStyleAttribute, RichTextSupportedBlockType, } from '../../../components/rich-text';
16
+ export type { RichTextEditorChange, RichTextEditorProps, RichTextLinkPayload, SerializedRichTextLinkNode, RichTextStyleControl, RichTextTemplateVariable, SerializedTemplateVariableNode, } from '../../../components/rich-text-editor';
17
+ export type { SurveyImageAssetManagerProps, } from './assets';
@@ -0,0 +1,5 @@
1
+ import { Locale } from 'date-fns/locale';
2
+ export type SurveyEditorDateLocales = Record<string, Locale>;
3
+ export declare const DEFAULT_DATE_FNS_LOCALES: SurveyEditorDateLocales;
4
+ export declare const mergeDateFnsLocales: (dateLocales?: SurveyEditorDateLocales) => SurveyEditorDateLocales;
5
+ export declare const getDateFnsLocale: (language: string, dateLocales?: SurveyEditorDateLocales) => Locale;
@@ -0,0 +1,4 @@
1
+ import { EditorLocalizationMessages, SurveyEditorLocalizations } from './types';
2
+ export declare const DEFAULT_EDITOR_LANGUAGE = "en";
3
+ export declare const surveyEditorEnMessages: EditorLocalizationMessages;
4
+ export declare const defaultSurveyEditorLocalizations: SurveyEditorLocalizations;
@@ -0,0 +1,5 @@
1
+ export { DEFAULT_EDITOR_LANGUAGE, defaultSurveyEditorLocalizations, surveyEditorEnMessages, } from './default-en';
2
+ export { createEditorTranslator, createNamespacedEditorTranslator, mergeEditorLocalizations, } from './runtime';
3
+ export { DEFAULT_DATE_FNS_LOCALES, getDateFnsLocale, mergeDateFnsLocales, } from './date-fns';
4
+ export type { EditorLocalizationMessages, EditorTranslate, EditorTranslationValues, SurveyEditorLocalizations, } from './types';
5
+ export type { SurveyEditorDateLocales } from './date-fns';
@@ -0,0 +1,4 @@
1
+ import { EditorTranslate, SurveyEditorLocalizations } from './types';
2
+ export declare const mergeEditorLocalizations: (localizations?: SurveyEditorLocalizations) => SurveyEditorLocalizations;
3
+ export declare const createEditorTranslator: (language: string, localizations: SurveyEditorLocalizations) => EditorTranslate;
4
+ export declare const createNamespacedEditorTranslator: (translate: EditorTranslate, namespace?: string) => EditorTranslate;
@@ -0,0 +1,7 @@
1
+ export type EditorTranslationPrimitive = string | number | boolean | null | undefined;
2
+ export type EditorTranslationValues = Record<string, EditorTranslationPrimitive>;
3
+ export type EditorLocalizationMessages = {
4
+ [key: string]: string | EditorLocalizationMessages;
5
+ };
6
+ export type SurveyEditorLocalizations = Record<string, EditorLocalizationMessages>;
7
+ export type EditorTranslate = (key: string, values?: EditorTranslationValues) => string;
@@ -0,0 +1,11 @@
1
+ import { PropsWithChildren } from 'react';
2
+ import { StoreApi } from 'zustand';
3
+ import { SurveyEditorNavigationStore } from './navigation';
4
+ import { SurveyEditorNavigationAdapter } from './types';
5
+ interface SurveyEditorNavigationStoreProviderProps extends PropsWithChildren {
6
+ adapter?: SurveyEditorNavigationAdapter | null;
7
+ }
8
+ export declare const SurveyEditorNavigationStoreProvider: React.FC<SurveyEditorNavigationStoreProviderProps>;
9
+ export declare function useSurveyEditorNavigationStore<T>(selector: (state: SurveyEditorNavigationStore) => T): T;
10
+ export declare function useSurveyEditorNavigationStoreApi(): StoreApi<SurveyEditorNavigationStore>;
11
+ export {};
@@ -0,0 +1,13 @@
1
+ import { SurveyEditorLocation, SurveyEditorNavigationAdapter } from './types';
2
+ import { StoreApi } from 'zustand';
3
+ export interface SurveyEditorNavigationStore {
4
+ location: SurveyEditorLocation;
5
+ history: SurveyEditorLocation[];
6
+ adapter: SurveyEditorNavigationAdapter | null;
7
+ _adapterUnsubscribe?: () => void;
8
+ setAdapter: (adapter: SurveyEditorNavigationAdapter) => void;
9
+ clearAdapter: () => void;
10
+ navigate: (location: SurveyEditorLocation, replace?: boolean) => void;
11
+ }
12
+ export type SurveyEditorNavigationStoreApi = StoreApi<SurveyEditorNavigationStore>;
13
+ export declare function createSurveyEditorNavigationStore(): SurveyEditorNavigationStoreApi;
@@ -0,0 +1,18 @@
1
+ export interface ItemEditorLocation {
2
+ view: 'item-editor';
3
+ itemId?: string;
4
+ }
5
+ export interface TranslationModeLocation {
6
+ view: 'translation-mode';
7
+ }
8
+ export interface AssetManagerLocation {
9
+ view: 'asset-manager';
10
+ }
11
+ export type SurveyEditorLocation = ItemEditorLocation | TranslationModeLocation | AssetManagerLocation;
12
+ export interface SurveyEditorNavigationAdapter {
13
+ getLocation: () => SurveyEditorLocation;
14
+ navigateTo: (location: SurveyEditorLocation, options?: {
15
+ replace?: boolean;
16
+ }) => void;
17
+ subscribe(listener: (location: SurveyEditorLocation) => void): () => void;
18
+ }
@@ -0,0 +1,35 @@
1
+ import { FocusEvent, KeyboardEvent } from 'react';
2
+ import { SurveyAIInvocationMode } from '../ai/types';
3
+ export interface InputWithAISuggestion {
4
+ id: string;
5
+ text: string;
6
+ label?: string;
7
+ }
8
+ export interface InputWithAISuggestionsAdapter {
9
+ minChars?: number;
10
+ debounceMs?: number;
11
+ maxSuggestions?: number;
12
+ onSuggest: (input: string, trigger: "typing" | "manual", options?: {
13
+ signal?: AbortSignal;
14
+ mode?: SurveyAIInvocationMode;
15
+ }) => Promise<InputWithAISuggestion[]>;
16
+ }
17
+ interface InputWithAIPopoverProps {
18
+ value: string;
19
+ placeholder: string;
20
+ className?: string;
21
+ containerClassName?: string;
22
+ aiButtonClassName?: string;
23
+ popoverContentClassName?: string;
24
+ id?: string;
25
+ disabled?: boolean;
26
+ autoFocus?: boolean;
27
+ autoComplete?: string;
28
+ maxSuggestions?: number;
29
+ suggestionsAdapter?: InputWithAISuggestionsAdapter | null;
30
+ onChange: (value: string) => void;
31
+ onBlur?: (event: FocusEvent<HTMLInputElement>) => void;
32
+ onKeyDown?: (event: KeyboardEvent<HTMLInputElement>) => void;
33
+ }
34
+ declare const InputWithAIPopover: (props: InputWithAIPopoverProps) => import("react/jsx-runtime").JSX.Element;
35
+ export default InputWithAIPopover;
@@ -0,0 +1,7 @@
1
+ /**
2
+ * Registry extension documentation:
3
+ * ./README.md
4
+ */
5
+ export * from './types';
6
+ export * from './registry-mappers';
7
+ export * from './search-adapter';
@@ -0,0 +1,25 @@
1
+ import { AnyItemExpressionDefinition, ItemTypeRegistry, SurveyItemCore } from '@case-framework/survey-core';
2
+ import { ComposedEditorItemRegistry, EditorItemDefinition, EntriesToComposedEditorRegistryOptions, EntriesToParticipantRegistryOptions, ItemCategory, ItemLocaleMap, ItemRegistryEntry, RegistryValidationOptions, RegistryValidationResult, SurveyPlayerItemRegistry } from './types';
3
+ import { SurveyEditorLocalizations } from '../localization';
4
+ export declare function mergeCategoryLabelOverrides(base?: Partial<Record<ItemCategory, ItemLocaleMap>>, overrides?: Partial<Record<ItemCategory, ItemLocaleMap>>): Partial<Record<ItemCategory, ItemLocaleMap>> | undefined;
5
+ export declare function validateRegistryEntries(entries: ItemRegistryEntry[], options: RegistryValidationOptions): RegistryValidationResult;
6
+ /**
7
+ * Derive ItemTypeRegistry from unified entries for Survey / SurveyEditor.
8
+ * Uses built-in registry for group/pageBreak; plugin entries supply constructors for custom types.
9
+ */
10
+ export declare function entriesToItemTypeRegistry(entries: ItemRegistryEntry[]): ItemTypeRegistry;
11
+ /**
12
+ * Derive participant registry from unified entries.
13
+ * Lightweight: core + renderer only. Use this for survey player / participant app.
14
+ */
15
+ export declare function entriesToParticipantRegistry(entries: ItemRegistryEntry[], options?: EntriesToParticipantRegistryOptions): SurveyPlayerItemRegistry;
16
+ export declare function localizeRegistryEntries(entries: ItemRegistryEntry[], localizations?: SurveyEditorLocalizations): ItemRegistryEntry[];
17
+ export declare function getCategoryLabelsFromLocalizations(localizations?: SurveyEditorLocalizations): Partial<Record<ItemCategory, ItemLocaleMap>> | undefined;
18
+ /**
19
+ * Derive ComposedEditorItemRegistry from unified entries for the editor.
20
+ * Ensures Group and PageBreak have definitions; uses coreRegistry from entries.
21
+ */
22
+ export declare function entriesToComposedEditorRegistry(entries: ItemRegistryEntry[], options?: EntriesToComposedEditorRegistryOptions): ComposedEditorItemRegistry;
23
+ export declare function getRegistryEntryForItem(registry: ComposedEditorItemRegistry, item: SurveyItemCore): EditorItemDefinition | undefined;
24
+ export declare function getItemExpressionDefinitionsForType(registry: ComposedEditorItemRegistry, itemType: string): AnyItemExpressionDefinition[];
25
+ export declare function getItemExpressionDefinitionsForItem(registry: ComposedEditorItemRegistry, item: SurveyItemCore): AnyItemExpressionDefinition[];
@@ -0,0 +1,19 @@
1
+ import { Survey } from '@case-framework/survey-core';
2
+ export declare const SearchMatchType: {
3
+ readonly Content: "content";
4
+ readonly Label: "label";
5
+ readonly Key: "key";
6
+ readonly ItemType: "itemType";
7
+ };
8
+ export type SearchMatchType = (typeof SearchMatchType)[keyof typeof SearchMatchType];
9
+ export interface EditorItemSearchResult {
10
+ matchType: SearchMatchType;
11
+ matchText: string;
12
+ }
13
+ export interface ItemSearchAdapterContext {
14
+ itemId: string;
15
+ survey: Survey;
16
+ searchTerm: string;
17
+ }
18
+ export type ItemSearchAdapter = (ctx: ItemSearchAdapterContext) => EditorItemSearchResult[] | undefined;
19
+ export declare const defaultSearchAdapter: ItemSearchAdapter;