@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,178 @@
1
+ import { AnyItemExpressionDefinition, ItemCoreConstructor, ItemTypeRegistry, RawSurveyItem, SurveyItemCore, RenderedSurveyItem, SurveyItemTranslations } from '@case-framework/survey-core';
2
+ import { Target } from '@case-framework/survey-core/editor';
3
+ import { default as React } from 'react';
4
+ import { SurveyPlayerLocalizations } from '../../../../modules/survey-player/localization/types';
5
+ import { ItemSearchAdapter } from './search-adapter';
6
+ export type ItemCategory = string;
7
+ export type ItemLocaleMap = Record<string, string>;
8
+ export type ItemIconComponent = React.ComponentType<{
9
+ className?: string;
10
+ }>;
11
+ export interface ItemEditorComponentProps<TItem extends SurveyItemCore = SurveyItemCore> {
12
+ item: TItem;
13
+ }
14
+ export interface ItemRendererComponentProps {
15
+ renderedItem: RenderedSurveyItem;
16
+ }
17
+ export type ItemPreviewMode = "interactive" | "static";
18
+ export interface ItemPreviewComponentProps<TItem extends SurveyItemCore = SurveyItemCore> {
19
+ item: TItem;
20
+ itemConfig: TItem["config"];
21
+ itemContent?: SurveyItemTranslations;
22
+ locale: string;
23
+ mode?: ItemPreviewMode;
24
+ }
25
+ export interface ItemEditorCapabilities {
26
+ usesValidationPanel?: boolean;
27
+ usesTranslationPanel?: boolean;
28
+ usesConditionsPanel?: boolean;
29
+ }
30
+ export interface ItemInitialData {
31
+ rawItem: RawSurveyItem;
32
+ translations?: SurveyItemTranslations;
33
+ children?: ItemInitialData[];
34
+ }
35
+ export interface ItemInfos {
36
+ icon: ItemIconComponent;
37
+ labelByLocale: ItemLocaleMap;
38
+ descriptionByLocale: ItemLocaleMap;
39
+ defaultItemClassName?: string;
40
+ categories: ItemCategory[];
41
+ }
42
+ export interface CreateItemContext {
43
+ editor: {
44
+ addItem: (target: Target, item: SurveyItemCore, content?: SurveyItemTranslations) => void;
45
+ };
46
+ targetParentId: string;
47
+ constructor: ItemCoreConstructor;
48
+ }
49
+ export interface EditorItemDefinition {
50
+ itemType: string;
51
+ infos: ItemInfos;
52
+ editorComponent?: React.ComponentType<ItemEditorComponentProps>;
53
+ renderComponent?: React.ComponentType<ItemRendererComponentProps>;
54
+ previewComponent?: React.ComponentType<ItemPreviewComponentProps>;
55
+ capabilities?: ItemEditorCapabilities;
56
+ expressions?: AnyItemExpressionDefinition[];
57
+ isRootOnly?: boolean;
58
+ getInitialItem?: () => ItemInitialData;
59
+ createItem?: (ctx: CreateItemContext) => string;
60
+ searchAdapters?: ItemSearchAdapter[];
61
+ includeDefaultSearchAdapter?: boolean;
62
+ }
63
+ export type EditorItemDefinitionRegistry = Record<string, EditorItemDefinition>;
64
+ export interface ComposedEditorItemRegistry {
65
+ coreRegistry: ItemTypeRegistry;
66
+ definitions: EditorItemDefinitionRegistry;
67
+ playerLocalizations: SurveyPlayerLocalizations;
68
+ /**
69
+ * Localized headings for category ids referenced in `ItemInfos.categories`.
70
+ * Built by `entriesToComposedEditorRegistry` (merged with {@link DEFAULT_CATEGORY_LABELS}).
71
+ */
72
+ categoryLabels: Record<ItemCategory, ItemLocaleMap>;
73
+ }
74
+ /**
75
+ * Unified registry entry type, reusable across contexts:
76
+ *
77
+ * - Participant app: needs only `constructor` + `renderComponent`
78
+ * - Editor: needs constructor, infos, `previewComponent`, editorComponent, searchAdapters, etc.
79
+ *
80
+ * Use the mapper helpers to derive ItemTypeRegistry, participant registry, or editor registry.
81
+ */
82
+ export interface ItemRegistryEntry {
83
+ itemType: string;
84
+ /** Item core constructor. Omit for built-in types (group, pageBreak) — they use survey-core's built-in registry. Omit for virtual "root" — it maps to Group with isRoot. */
85
+ constructor?: ItemCoreConstructor;
86
+ /** Participant renderer. Required for participant app. */
87
+ renderComponent?: React.ComponentType<ItemRendererComponentProps>;
88
+ /** Participant/player localization messages contributed by this entry. */
89
+ playerLocalizations?: SurveyPlayerLocalizations;
90
+ /** Editor-only: item preview renderer */
91
+ previewComponent?: React.ComponentType<ItemPreviewComponentProps>;
92
+ /** Editor-only: display metadata */
93
+ infos?: ItemInfos;
94
+ /** Editor-only: card/editor UI */
95
+ editorComponent?: React.ComponentType<ItemEditorComponentProps>;
96
+ /** Shared: higher-level expression templates available for this item type. */
97
+ expressions?: AnyItemExpressionDefinition[];
98
+ /** Editor-only: search integration */
99
+ searchAdapters?: ItemSearchAdapter[];
100
+ /** Editor-only: include built-in key/label/itemType search adapter in addition to custom adapters. Defaults to true. */
101
+ includeDefaultSearchAdapter?: boolean;
102
+ /** Editor-only */
103
+ capabilities?: ItemEditorCapabilities;
104
+ /** Editor-only: default raw item when creating new */
105
+ getInitialItem?: () => ItemInitialData;
106
+ /** Editor-only: custom creation flow (advanced) */
107
+ createItem?: (ctx: CreateItemContext) => string;
108
+ /** Editor-only: hide from add-item options in non-root context */
109
+ isRootOnly?: boolean;
110
+ }
111
+ export type ItemRegistry = Record<string, ItemRegistryEntry>;
112
+ /** Participant registry: core + renderer per item type. Lightweight for survey player. */
113
+ export interface SurveyPlayerItemRegistry {
114
+ coreRegistry: ItemTypeRegistry;
115
+ getRenderer: (itemType: string) => React.ComponentType<ItemRendererComponentProps> | undefined;
116
+ localizations: SurveyPlayerLocalizations;
117
+ }
118
+ export interface EntriesToParticipantRegistryOptions {
119
+ /** Throw when an entry in the provided list does not define a renderComponent. */
120
+ requireRenderer?: boolean;
121
+ }
122
+ export interface EntriesToComposedEditorRegistryOptions {
123
+ /** Require built-in editor definitions for group/pageBreak. Defaults to true. */
124
+ requireBuiltInTypes?: boolean;
125
+ /**
126
+ * Extra or overriding labels for category ids (e.g. `question`, `form`).
127
+ * Merged on top of {@link DEFAULT_CATEGORY_LABELS}.
128
+ */
129
+ categoryLabels?: Partial<Record<ItemCategory, ItemLocaleMap>>;
130
+ }
131
+ export type RegistryValidationMode = "editor" | "player";
132
+ export interface RegistryValidationOptions {
133
+ mode: RegistryValidationMode;
134
+ requireBuiltInTypes?: boolean;
135
+ requireRenderer?: boolean;
136
+ }
137
+ export interface RegistryValidationIssue {
138
+ code: string;
139
+ message: string;
140
+ itemType?: string;
141
+ }
142
+ export interface RegistryValidationResult {
143
+ errors: RegistryValidationIssue[];
144
+ warnings: RegistryValidationIssue[];
145
+ }
146
+ /**
147
+ * Example: unified entry for participant + editor
148
+ *
149
+ * const myEntries: ItemRegistryEntry[] = [
150
+ * {
151
+ * itemType: "choiceItem",
152
+ * constructor: ChoiceItemCore,
153
+ * renderComponent: ChoiceItemRenderer,
154
+ * previewComponent: ChoiceItemPreview,
155
+ * infos: { icon: ListChecks, labelByLocale: { en: "Choice" }, ... },
156
+ * editorComponent: EditorCardForChoice,
157
+ * searchAdapters: [myCustomSearchAdapter],
158
+ * },
159
+ * // ...
160
+ * ];
161
+ *
162
+ * // Participant app:
163
+ * const participantReg = entriesToParticipantRegistry(myEntries);
164
+ * Survey.fromJson(json, participantReg.coreRegistry);
165
+ * const Renderer = participantReg.getRenderer("choiceItem");
166
+ *
167
+ * // Editor:
168
+ * const editorReg = entriesToComposedEditorRegistry(myEntries);
169
+ * // ... use editorReg.coreRegistry + editorReg.definitions
170
+ */
171
+ export declare const DEFAULT_LOCALE = "en";
172
+ /** Default English headings for common category ids; hosts may override via `entriesToComposedEditorRegistry`. */
173
+ export declare const DEFAULT_CATEGORY_LABELS: Record<string, ItemLocaleMap>;
174
+ export declare function resolveLocalizedText(map: ItemLocaleMap, locale?: string): string;
175
+ /**
176
+ * Heading for a category id using the composed registry’s `categoryLabels` and the active locale.
177
+ */
178
+ export declare function resolveCategoryLabel(category: string, categoryLabels: Record<string, ItemLocaleMap>, locale?: string): string;
@@ -0,0 +1,2 @@
1
+ declare const EditorFooter: React.FC;
2
+ export default EditorFooter;
@@ -0,0 +1,2 @@
1
+ declare const HistoryStack: React.FC;
2
+ export default HistoryStack;
@@ -0,0 +1,2 @@
1
+ declare const EditorMain: React.FC;
2
+ export default EditorMain;
@@ -0,0 +1,2 @@
1
+ declare const AssetManager: () => import("react/jsx-runtime").JSX.Element;
2
+ export default AssetManager;
@@ -0,0 +1,5 @@
1
+ interface EditorProps {
2
+ onSaveRequested?: () => void;
3
+ }
4
+ declare const Editor: React.FC<EditorProps>;
5
+ export default Editor;
@@ -0,0 +1,2 @@
1
+ declare const BreadcrumbsNav: React.FC;
2
+ export default BreadcrumbsNav;
@@ -0,0 +1,2 @@
1
+ declare const ItemEditorToolbar: React.FC;
2
+ export default ItemEditorToolbar;
@@ -0,0 +1,2 @@
1
+ declare const LanguagePicker: () => import("react/jsx-runtime").JSX.Element;
2
+ export default LanguagePicker;
@@ -0,0 +1,3 @@
1
+ import { default as React } from 'react';
2
+ declare const SearchTrigger: React.FC;
3
+ export default SearchTrigger;
@@ -0,0 +1,7 @@
1
+ import { default as React } from 'react';
2
+ interface SurveySearchProps {
3
+ isOpen: boolean;
4
+ onOpenChange: (open: boolean) => void;
5
+ }
6
+ declare const SurveySearch: React.FC<SurveySearchProps>;
7
+ export default SurveySearch;
@@ -0,0 +1,2 @@
1
+ declare const ItemEditor: () => import("react/jsx-runtime").JSX.Element;
2
+ export default ItemEditor;
@@ -0,0 +1,2 @@
1
+ declare const TranslationMode: () => import("react/jsx-runtime").JSX.Element;
2
+ export default TranslationMode;
@@ -0,0 +1,13 @@
1
+ import { Survey, ItemTypeRegistry } from '@case-framework/survey-core';
2
+ import { SerializedSurveyEditor } from '@case-framework/survey-core/editor';
3
+ export type ParsedSurveySessionFormat = 'raw-survey' | 'serialized-editor';
4
+ export interface ParsedSurveySession {
5
+ format: ParsedSurveySessionFormat;
6
+ state: SerializedSurveyEditor;
7
+ sessionId: string;
8
+ }
9
+ export declare function createBlankEditorState(pluginRegistry?: ItemTypeRegistry, surveyKey?: string): SerializedSurveyEditor;
10
+ export declare function createEditorStateFromRawSurvey(rawSurvey: Parameters<typeof Survey.fromJson>[0], pluginRegistry?: ItemTypeRegistry): SerializedSurveyEditor;
11
+ export declare function parseEditorStateFromJsonText(jsonText: string, pluginRegistry?: ItemTypeRegistry): ParsedSurveySession;
12
+ export declare function serializeSurveyStateForFile(state: SerializedSurveyEditor): string;
13
+ export declare function buildSurveyFileName(state: SerializedSurveyEditor, fallback?: string): string;
@@ -0,0 +1,10 @@
1
+ import { StoreApi } from 'zustand';
2
+ import { EditorStore } from './editor-store';
3
+ /**
4
+ * Context is split from the provider to avoid React Fast Refresh (HMR) issues.
5
+ * When the provider file is hot-reloaded, re-executing createContext would create
6
+ * a new context instance, causing "must be used within EditorStoreProvider" errors
7
+ * during the brief reconciliation window. Keeping the context in a separate module
8
+ * preserves its identity across HMR updates.
9
+ */
10
+ export declare const EditorStoreContext: import('react').Context<StoreApi<EditorStore> | null>;
@@ -0,0 +1,7 @@
1
+ import { PropsWithChildren } from 'react';
2
+ /**
3
+ * Provider only. Hooks live in use-editor-store.ts so that .tsx files
4
+ * export only components — avoiding Fast Refresh invalidation that
5
+ * causes context loss during HMR.
6
+ */
7
+ export declare const EditorStoreProvider: React.FC<PropsWithChildren>;
@@ -0,0 +1,102 @@
1
+ import { StoreApi } from 'zustand';
2
+ import { SurveyEditor, Target, SurveyItemClipboardData, CommitMeta, UndoRedoConfig } from '@case-framework/survey-core/editor';
3
+ import { SurveyItemCore, SurveyItemTranslations, RawSurveyItem, TemplateValueDefinition, GroupItemCore, RawSurveyAsset, SurveyCardContent, NavigationContent, Content } from '@case-framework/survey-core';
4
+ import { ComposedEditorItemRegistry, ItemCategory, ItemLocaleMap, ItemRegistryEntry } from '../registry';
5
+ interface StartNewSessionOptions {
6
+ surveyKey?: string;
7
+ /** Unified registry entries (recommended, matches SurveyEditor) */
8
+ itemRegistryEntries?: ItemRegistryEntry[];
9
+ /** Merged into default category labels when `itemRegistryEntries` is set. */
10
+ categoryLabels?: Partial<Record<ItemCategory, ItemLocaleMap>>;
11
+ }
12
+ export interface EditorStore {
13
+ /** Current survey/session id when editor is loaded */
14
+ sessionId: string | null;
15
+ /** The SurveyEditor instance - null when no editor is loaded */
16
+ editor: SurveyEditor | null;
17
+ /** Incremented on every mutation; select this to force re-renders when editor changes */
18
+ changeTick: number;
19
+ /** Composed item registry used by editor UI features. */
20
+ editorItemRegistry: ComposedEditorItemRegistry;
21
+ selectedLocale: string;
22
+ /** Set the active editor (call when opening a session) */
23
+ setEditor: (surveyId: string | null, editor: SurveyEditor | null) => void;
24
+ /** Clear the active editor (call when closing/unmounting to avoid stale state on next mount) */
25
+ clearEditor: () => void;
26
+ /** Create and set a new blank survey editor (starts a new session) */
27
+ startNewSession: (options: StartNewSessionOptions) => void;
28
+ setEditorItemRegistry: (registry: ComposedEditorItemRegistry) => void;
29
+ setSelectedLocale: (locale: string) => void;
30
+ undo: () => boolean;
31
+ redo: () => boolean;
32
+ canUndo: () => boolean;
33
+ canRedo: () => boolean;
34
+ commit: (meta: CommitMeta) => void;
35
+ commitByUser: (meta: Omit<CommitMeta, "source">) => void;
36
+ commitIfNeeded: () => void;
37
+ jumpToIndexInHistory: (targetIndex: number) => boolean;
38
+ getUndoMeta: () => CommitMeta | null;
39
+ getRedoMeta: () => CommitMeta | null;
40
+ getUndoRedoHistory: () => Array<{
41
+ index: number;
42
+ meta: CommitMeta;
43
+ timestamp: number;
44
+ memorySize: number;
45
+ isCurrent: boolean;
46
+ }>;
47
+ addItem: (target: Target | null, item: SurveyItemCore, content?: SurveyItemTranslations) => void;
48
+ removeItem: (itemId: string, nested?: boolean) => boolean;
49
+ moveItem: (itemId: string, newTarget: Target) => boolean;
50
+ updateItemTranslations: (itemId: string, updatedContent?: SurveyItemTranslations) => boolean;
51
+ copyItem: (itemId: string) => SurveyItemClipboardData;
52
+ pasteItem: (clipboardData: SurveyItemClipboardData, target: Target) => string;
53
+ getRootItem: () => GroupItemCore | undefined;
54
+ getItemDataCopy: (itemId: string) => RawSurveyItem;
55
+ updateItem: (itemId: string, rawItemData: RawSurveyItem | Partial<RawSurveyItem>) => void;
56
+ updateSurveyTranslations: (updates: {
57
+ surveyCard?: {
58
+ locale: string;
59
+ content?: SurveyCardContent;
60
+ };
61
+ navigation?: {
62
+ locale: string;
63
+ content?: NavigationContent;
64
+ };
65
+ validationMessages?: {
66
+ locale: string;
67
+ content?: {
68
+ invalidResponse?: Content;
69
+ };
70
+ };
71
+ }) => void;
72
+ getMaxItemsPerPage: () => {
73
+ large: number;
74
+ small: number;
75
+ } | undefined;
76
+ updateMaxItemsPerPage: (value: {
77
+ large: number;
78
+ small: number;
79
+ } | undefined) => void;
80
+ getMetadata: () => {
81
+ [key: string]: string;
82
+ } | undefined;
83
+ updateMetadata: (metadata: {
84
+ [key: string]: string;
85
+ } | undefined) => void;
86
+ getTemplateValue: (key: string) => TemplateValueDefinition | undefined;
87
+ getTemplateValues: () => Map<string, TemplateValueDefinition>;
88
+ setTemplateValue: (key: string, templateValue: TemplateValueDefinition) => void;
89
+ removeTemplateValue: (key: string) => void;
90
+ getAsset: (assetId: string) => RawSurveyAsset | undefined;
91
+ getAssets: () => Map<string, RawSurveyAsset>;
92
+ setAsset: (assetId: string, asset: RawSurveyAsset) => void;
93
+ removeAsset: (assetId: string) => void;
94
+ getMemoryUsage: () => {
95
+ totalMB: number;
96
+ entries: number;
97
+ };
98
+ getUndoRedoConfig: () => UndoRedoConfig;
99
+ }
100
+ export type EditorStoreApi = StoreApi<EditorStore>;
101
+ export declare function createEditorStore(): EditorStoreApi;
102
+ export {};
@@ -0,0 +1,4 @@
1
+ import { StoreApi } from 'zustand';
2
+ import { EditorStore } from './editor-store';
3
+ export declare function useEditorStore<T>(selector: (state: EditorStore) => T): T;
4
+ export declare function useEditorStoreApi(): StoreApi<EditorStore>;
@@ -0,0 +1,7 @@
1
+ /**
2
+ * Custom hook for managing survey item navigation via state
3
+ */
4
+ export declare const useItemNavigation: () => {
5
+ selectedItemId: string | undefined;
6
+ navigateToItem: (newItemId?: string) => void;
7
+ };
@@ -0,0 +1,29 @@
1
+ import { ReactNode } from 'react';
2
+ import { Locale } from 'date-fns/locale';
3
+ import { SurveyEditorAIProvider } from './ai/types';
4
+ import { EditorTranslate, SurveyEditorDateLocales, EditorTranslationValues, SurveyEditorLocalizations } from './localization';
5
+ interface SurveyEditorConfigType {
6
+ helpLink: string;
7
+ aiProvider: SurveyEditorAIProvider | null;
8
+ fallbackLocale: string;
9
+ language: string;
10
+ localizations: SurveyEditorLocalizations;
11
+ dateLocales: SurveyEditorDateLocales;
12
+ dateLocale: Locale;
13
+ translate: EditorTranslate;
14
+ }
15
+ interface SurveyEditorConfigProviderProps {
16
+ children: ReactNode;
17
+ helpLink: string;
18
+ aiProvider?: SurveyEditorAIProvider | null;
19
+ fallbackLocale?: string;
20
+ language?: string;
21
+ localizations?: SurveyEditorLocalizations;
22
+ dateLocales?: SurveyEditorDateLocales;
23
+ }
24
+ export declare const SurveyEditorConfigProvider: React.FC<SurveyEditorConfigProviderProps>;
25
+ export declare const useSurveyEditorConfig: () => SurveyEditorConfigType;
26
+ export declare const useSurveyEditorAIProvider: () => SurveyEditorAIProvider | null;
27
+ export declare const useEditorTranslation: (namespace?: string) => ((key: string, values?: EditorTranslationValues) => string);
28
+ export declare const useEditorDateLocale: () => Locale;
29
+ export {};
@@ -0,0 +1,26 @@
1
+ import { SerializedSurveyEditor } from '@case-framework/survey-core/editor';
2
+ import { EditorStateChangePayload } from './hooks/useEditorStateChange';
3
+ import { SurveyEditorNavigationAdapter } from './navigation/types';
4
+ import { ItemCategory, ItemLocaleMap, ItemRegistryEntry } from './registry';
5
+ import { SurveyEditorAIProvider } from './ai/types';
6
+ import { SurveyEditorDateLocales, SurveyEditorLocalizations } from './localization';
7
+ export type SurveyEditorStateChange = EditorStateChangePayload;
8
+ export interface SurveyEditorProps {
9
+ initialEditorState?: SerializedSurveyEditor;
10
+ initialSessionId?: string;
11
+ fallbackLocale?: string;
12
+ language?: string;
13
+ localizations?: SurveyEditorLocalizations;
14
+ dateLocales?: SurveyEditorDateLocales;
15
+ itemRegistryEntries?: ItemRegistryEntry[];
16
+ /** Override or extend default add-item category headings (merged with built-in defaults). */
17
+ categoryLabels?: Partial<Record<ItemCategory, ItemLocaleMap>>;
18
+ onEditorStateChange?: (change: SurveyEditorStateChange) => void;
19
+ persistDebounceMs?: number;
20
+ helpLink?: string;
21
+ navigationAdapter?: SurveyEditorNavigationAdapter | null;
22
+ aiProvider?: SurveyEditorAIProvider | null;
23
+ onSaveRequested?: () => void;
24
+ }
25
+ declare const SurveyEditor: React.FC<SurveyEditorProps>;
26
+ export { SurveyEditor };
@@ -0,0 +1,23 @@
1
+ import { SurveyItemCore } from '@case-framework/survey-core';
2
+ import { ComposedEditorItemRegistry, ItemIconComponent } from '../registry';
3
+ export declare const builtInItemColors: string[];
4
+ export declare const getItemColorFromID: (id: string) => string;
5
+ export declare const getItemColor: (surveyItem: SurveyItemCore) => string | undefined;
6
+ /** Returns the registry key for an item ("root" for root groups, otherwise item.type). */
7
+ export declare const getItemTypeKey: (item: SurveyItemCore) => string;
8
+ export interface ItemTypeInfos {
9
+ key: string;
10
+ label: string;
11
+ description: string;
12
+ defaultItemClassName?: string;
13
+ icon: ItemIconComponent;
14
+ }
15
+ export declare const getItemTypeInfos: (item: SurveyItemCore, registry?: ComposedEditorItemRegistry) => ItemTypeInfos;
16
+ export declare const getItemTypeInfosByType: (itemType: string | undefined, registry?: ComposedEditorItemRegistry) => ItemTypeInfos | undefined;
17
+ /**
18
+ * Hook to access item type infos for a specific item type.
19
+ * Pass an item type string (e.g. "choiceItem", "root") or undefined.
20
+ * Returns undefined when itemType is undefined.
21
+ * Must be used within EditorStoreProvider.
22
+ */
23
+ export declare function useItemTypeInfos(itemType: string | undefined): ItemTypeInfos | undefined;
@@ -0,0 +1,5 @@
1
+ export { SurveyPlayer } from './survey-player';
2
+ export { SurveyContextProvider, useSurveyCtx, useSurveyTranslation, type SurveyContextProviderProps, } from './survey-context';
3
+ export { SurveyItemRenderer, type SurveyItemRendererProps, } from './survey-item/survey-item';
4
+ export type { SurveyPlayerProps } from './survey-player';
5
+ export type { SurveyPlayerLocalizationMessages, SurveyPlayerLocalizations, SurveyPlayerTranslate, SurveyPlayerTranslationValue, SurveyPlayerTranslationValues, } from './localization/types';
@@ -0,0 +1,3 @@
1
+ import { SurveyPlayerLocalizations } from './types';
2
+ export declare const DEFAULT_SURVEY_PLAYER_LANGUAGE = "en";
3
+ export declare const defaultSurveyPlayerLocalizations: SurveyPlayerLocalizations;
@@ -0,0 +1,4 @@
1
+ import { SurveyPlayerLocalizations, SurveyPlayerTranslate } from './types';
2
+ export declare const mergeSurveyPlayerLocalizations: (...sources: Array<SurveyPlayerLocalizations | undefined>) => SurveyPlayerLocalizations;
3
+ export declare const createSurveyTranslator: (language: string, localizations: SurveyPlayerLocalizations) => SurveyPlayerTranslate;
4
+ export declare const createNamespacedSurveyTranslator: (translate: SurveyPlayerTranslate, namespace?: string) => SurveyPlayerTranslate;
@@ -0,0 +1,7 @@
1
+ export type SurveyPlayerTranslationValue = string | number | boolean | null | undefined;
2
+ export type SurveyPlayerTranslationValues = Record<string, SurveyPlayerTranslationValue>;
3
+ export interface SurveyPlayerLocalizationMessages {
4
+ [key: string]: string | SurveyPlayerLocalizationMessages;
5
+ }
6
+ export type SurveyPlayerLocalizations = Record<string, SurveyPlayerLocalizationMessages>;
7
+ export type SurveyPlayerTranslate = (key: string, values?: SurveyPlayerTranslationValues) => string;
@@ -0,0 +1,32 @@
1
+ import { default as React } from 'react';
2
+ import { Survey, SurveyEngineCore } from '@case-framework/survey-core';
3
+ import { SurveyPlayerItemRegistry } from '../../../modules/survey-editor/registry';
4
+ import { SurveyPlayerLocalizations, SurveyPlayerTranslate } from './localization/types';
5
+ export type HandlerFuncArgType = string | number | boolean | null | undefined;
6
+ export type HandlerFunction = (handlerId: string, args?: HandlerFuncArgType[]) => Promise<{
7
+ error?: string;
8
+ result?: HandlerFuncArgType;
9
+ }>;
10
+ interface SurveyContextValue {
11
+ survey: Survey;
12
+ locale: string;
13
+ surveyEngine: SurveyEngineCore;
14
+ surveyPlayerRegistry?: SurveyPlayerItemRegistry;
15
+ runExternalHandler?: HandlerFunction;
16
+ onResponseChanged?: () => void;
17
+ translate: SurveyPlayerTranslate;
18
+ }
19
+ export interface SurveyContextProviderProps {
20
+ survey: Survey;
21
+ locale: string;
22
+ surveyEngine: SurveyEngineCore;
23
+ surveyPlayerRegistry?: SurveyPlayerItemRegistry;
24
+ localizations?: SurveyPlayerLocalizations;
25
+ children: React.ReactNode;
26
+ onRunExternalHandler?: HandlerFunction;
27
+ onResponseChanged?: () => void;
28
+ }
29
+ export declare const SurveyContextProvider: React.FC<SurveyContextProviderProps>;
30
+ export declare const useSurveyCtx: () => SurveyContextValue;
31
+ export declare const useSurveyTranslation: (namespace?: string) => SurveyPlayerTranslate;
32
+ export {};
@@ -0,0 +1,27 @@
1
+ import { RenderedSurveyItem, ResponseItem, SurveyItemCore, SurveyItemTranslations } from '@case-framework/survey-core';
2
+ interface SurveyItemStaticContextValue {
3
+ item: SurveyItemCore;
4
+ renderedItemInfos: RenderedSurveyItem;
5
+ itemTranslations?: SurveyItemTranslations;
6
+ headerId: string;
7
+ }
8
+ interface SurveyItemResponseContextValue {
9
+ currentResponse?: ResponseItem;
10
+ setResponse(response?: ResponseItem): void;
11
+ }
12
+ interface SurveyItemContextProviderProps {
13
+ children: React.ReactNode;
14
+ renderedItemInfos: RenderedSurveyItem;
15
+ }
16
+ export declare const SurveyItemContextProvider: React.FC<SurveyItemContextProviderProps>;
17
+ export declare const useSurveyItemStaticCtx: () => SurveyItemStaticContextValue;
18
+ export declare const useSurveyItemResponseCtx: () => SurveyItemResponseContextValue;
19
+ export declare const useSurveyItemCtx: () => {
20
+ currentResponse?: ResponseItem;
21
+ setResponse(response?: ResponseItem): void;
22
+ item: SurveyItemCore;
23
+ renderedItemInfos: RenderedSurveyItem;
24
+ itemTranslations?: SurveyItemTranslations;
25
+ headerId: string;
26
+ };
27
+ export {};
@@ -0,0 +1,4 @@
1
+ import { ItemRendererComponentProps } from '../../../../../modules/survey-editor/registry';
2
+ export declare function InfoItemRenderer(props: ItemRendererComponentProps): import("react/jsx-runtime").JSX.Element;
3
+ export declare function FormItemRenderer(props: ItemRendererComponentProps): import("react/jsx-runtime").JSX.Element;
4
+ export declare function ChoiceItemRenderer(props: ItemRendererComponentProps): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,5 @@
1
+ interface QuestionWrapperProps {
2
+ children: React.ReactNode;
3
+ }
4
+ declare const QuestionWrapper: React.FC<QuestionWrapperProps>;
5
+ export default QuestionWrapper;
@@ -0,0 +1,7 @@
1
+ import { default as React } from 'react';
2
+ import { RenderedSurveyItem } from '@case-framework/survey-core';
3
+ export interface SurveyItemRendererProps {
4
+ item: RenderedSurveyItem;
5
+ }
6
+ export declare const SurveyItemRenderer: React.FC<SurveyItemRendererProps>;
7
+ export default SurveyItemRenderer;
@@ -0,0 +1,14 @@
1
+ import { Survey, SurveyEngineCore, ScreenSize, SurveyItemResponse } from '@case-framework/survey-core';
2
+ import { SurveyPlayerItemRegistry } from '../../../modules/survey-editor/registry';
3
+ import { SurveyPlayerLocalizations } from './localization/types';
4
+ export interface SurveyPlayerProps {
5
+ survey: Survey;
6
+ locale?: string;
7
+ size?: ScreenSize;
8
+ surveyEngine?: SurveyEngineCore;
9
+ surveyPlayerRegistry?: SurveyPlayerItemRegistry;
10
+ localizations?: SurveyPlayerLocalizations;
11
+ onSubmit?: (responses: SurveyItemResponse[], surveyEngine: SurveyEngineCore) => void;
12
+ className?: string;
13
+ }
14
+ export declare const SurveyPlayer: React.FC<SurveyPlayerProps>;
@@ -1,9 +1,15 @@
1
1
  .survey-editor {
2
- --main-bg-color: oklch(98.5% 0 0);
3
- --main-bg-dot-color: oklch(85% 0 0);
4
- --main-bg-dot-grid-size: calc(var(--spacing, 0.25rem) * 5);
2
+ /* Editor card / preview canvas — neutral near-white */
3
+ --surface-bg-color: oklch(99.1% 0 0);
5
4
 
6
- --footer-bg-color: oklch(37.3% 0.034 259.733);
7
- --footer-text-color: oklch(98.5% 0 0);
8
- --footer-height: calc(var(--spacing, 0.25rem) * 6);
9
- }
5
+ /*
6
+ * Rich text emphasis (Lexical + preview). Chosen for strong contrast on
7
+ * --surface-bg-color and clearly distinct hues so “primary” vs “accent” reads
8
+ * in the UI (not tied to global --primary / --accent, which are tuned for chrome).
9
+ *
10
+ * Primary — cool / structural: main wording emphasis (question tone, lead-in).
11
+ * Accent — warm / focal: secondary highlight (callouts, supplementary emphasis).
12
+ */
13
+ --rich-text-editor-primary-color: oklch(0.36 0.12 264);
14
+ --rich-text-editor-accent-color: oklch(0.44 0.15 48);
15
+ }