@case-framework/survey-ui 0.2.2 → 0.2.3

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 (122) hide show
  1. package/dist/index.d.ts +478 -9
  2. package/dist/survey-ui.cjs.js.map +1 -1
  3. package/dist/survey-ui.css +3 -0
  4. package/dist/survey-ui.es.js.map +1 -1
  5. package/package.json +2 -2
  6. package/dist/components/c-ui/alert-provider.d.ts +0 -18
  7. package/dist/components/c-ui/confirm-dialog.d.ts +0 -19
  8. package/dist/components/c-ui/confirm-provider.d.ts +0 -15
  9. package/dist/components/c-ui/filepicker-dropzone.d.ts +0 -38
  10. package/dist/components/c-ui/loading-button.d.ts +0 -9
  11. package/dist/components/inputs/Filepicker.d.ts +0 -14
  12. package/dist/components/ui/alert-dialog.d.ts +0 -18
  13. package/dist/components/ui/alert.d.ts +0 -9
  14. package/dist/components/ui/badge.d.ts +0 -9
  15. package/dist/components/ui/breadcrumb.d.ts +0 -11
  16. package/dist/components/ui/button.d.ts +0 -10
  17. package/dist/components/ui/card.d.ts +0 -9
  18. package/dist/components/ui/checkbox.d.ts +0 -4
  19. package/dist/components/ui/command.d.ts +0 -20
  20. package/dist/components/ui/context-menu.d.ts +0 -25
  21. package/dist/components/ui/dialog.d.ts +0 -19
  22. package/dist/components/ui/dropdown-menu.d.ts +0 -25
  23. package/dist/components/ui/field.d.ts +0 -24
  24. package/dist/components/ui/input.d.ts +0 -3
  25. package/dist/components/ui/kbd.d.ts +0 -3
  26. package/dist/components/ui/label.d.ts +0 -4
  27. package/dist/components/ui/popover.d.ts +0 -7
  28. package/dist/components/ui/radio-group.d.ts +0 -5
  29. package/dist/components/ui/scroll-area.d.ts +0 -5
  30. package/dist/components/ui/separator.d.ts +0 -4
  31. package/dist/components/ui/skeleton.d.ts +0 -2
  32. package/dist/components/ui/sonner.d.ts +0 -3
  33. package/dist/components/ui/tabs.d.ts +0 -7
  34. package/dist/components/ui/tooltip.d.ts +0 -7
  35. package/dist/dev/_components/nav-input.d.ts +0 -35
  36. package/dist/dev/app.d.ts +0 -2
  37. package/dist/dev/main.d.ts +0 -0
  38. package/dist/lib/utils.d.ts +0 -2
  39. package/dist/modules/default-item-registry/built-in-preview-renderers.d.ts +0 -3
  40. package/dist/modules/default-item-registry/default-item-cores.d.ts +0 -33
  41. package/dist/modules/default-item-registry/default-registry-entries.d.ts +0 -2
  42. package/dist/modules/default-item-registry/editors/editor-card-for-group.d.ts +0 -3
  43. package/dist/modules/default-item-registry/editors/editor-card-for-root.d.ts +0 -3
  44. package/dist/modules/default-item-registry/editors/editor-card-for-scg-mcg.d.ts +0 -3
  45. package/dist/modules/default-item-registry/index.d.ts +0 -19
  46. package/dist/modules/survey-editor/_components/sortable/sortable-item.d.ts +0 -5
  47. package/dist/modules/survey-editor/_components/sortable/sortable-wrapper.d.ts +0 -21
  48. package/dist/modules/survey-editor/ai/types.d.ts +0 -88
  49. package/dist/modules/survey-editor/editor-card/add-items/constants.d.ts +0 -5
  50. package/dist/modules/survey-editor/editor-card/add-items/hooks/use-add-item-actions.d.ts +0 -25
  51. package/dist/modules/survey-editor/editor-card/add-items/hooks/use-add-item-target.d.ts +0 -9
  52. package/dist/modules/survey-editor/editor-card/add-items/hooks/use-option-group-navigation.d.ts +0 -19
  53. package/dist/modules/survey-editor/editor-card/add-items/types.d.ts +0 -21
  54. package/dist/modules/survey-editor/editor-card/add-items/views/ai-item-view.d.ts +0 -10
  55. package/dist/modules/survey-editor/editor-card/add-items/views/back-button.d.ts +0 -5
  56. package/dist/modules/survey-editor/editor-card/add-items/views/blank-item-view.d.ts +0 -13
  57. package/dist/modules/survey-editor/editor-card/add-items/views/entry-view.d.ts +0 -15
  58. package/dist/modules/survey-editor/editor-card/add-items/views/structure-view.d.ts +0 -16
  59. package/dist/modules/survey-editor/editor-card/add-items.d.ts +0 -1
  60. package/dist/modules/survey-editor/editor-card/copy-item-dropdown-menu.d.ts +0 -5
  61. package/dist/modules/survey-editor/editor-card/delete-item-context-menu.d.ts +0 -5
  62. package/dist/modules/survey-editor/editor-card/delete-item-dropdown-menu.d.ts +0 -5
  63. package/dist/modules/survey-editor/editor-card/group-items.d.ts +0 -2
  64. package/dist/modules/survey-editor/editor-card/hooks/use-group-list-keyboard.d.ts +0 -35
  65. package/dist/modules/survey-editor/editor-card/index.d.ts +0 -2
  66. package/dist/modules/survey-editor/editor-card/item-color-menu.d.ts +0 -6
  67. package/dist/modules/survey-editor/editor-card/item-color-selector.d.ts +0 -5
  68. package/dist/modules/survey-editor/editor-card/item-editor-card-skeleton.d.ts +0 -2
  69. package/dist/modules/survey-editor/editor-card/item-editor-card.d.ts +0 -21
  70. package/dist/modules/survey-editor/editor-card/item-editor-context.d.ts +0 -20
  71. package/dist/modules/survey-editor/editor-card/item-key-editor.d.ts +0 -9
  72. package/dist/modules/survey-editor/editor-card/item-label-preview-and-editor.d.ts +0 -9
  73. package/dist/modules/survey-editor/editor-card/item-preview.d.ts +0 -8
  74. package/dist/modules/survey-editor/editor-card/item-type-icon-with-tooltip.d.ts +0 -8
  75. package/dist/modules/survey-editor/editor-instance-provider.d.ts +0 -7
  76. package/dist/modules/survey-editor/hooks/useClipboardValue.d.ts +0 -2
  77. package/dist/modules/survey-editor/hooks/useDeleteItem.d.ts +0 -9
  78. package/dist/modules/survey-editor/hooks/useEditor.d.ts +0 -12
  79. package/dist/modules/survey-editor/hooks/useEditorStateChange.d.ts +0 -17
  80. package/dist/modules/survey-editor/hooks/useKeyboardShortcuts.d.ts +0 -7
  81. package/dist/modules/survey-editor/index.d.ts +0 -7
  82. package/dist/modules/survey-editor/navigation/navigation-provider.d.ts +0 -11
  83. package/dist/modules/survey-editor/navigation/navigation.d.ts +0 -13
  84. package/dist/modules/survey-editor/navigation/types.d.ts +0 -18
  85. package/dist/modules/survey-editor/primitives/input-with-ai-popover.d.ts +0 -35
  86. package/dist/modules/survey-editor/registry/index.d.ts +0 -7
  87. package/dist/modules/survey-editor/registry/registry-mappers.d.ts +0 -19
  88. package/dist/modules/survey-editor/registry/search-adapter.d.ts +0 -19
  89. package/dist/modules/survey-editor/registry/types.d.ts +0 -154
  90. package/dist/modules/survey-editor/routes/editor/_components/footer.d.ts +0 -2
  91. package/dist/modules/survey-editor/routes/editor/_components/history-stack.d.ts +0 -2
  92. package/dist/modules/survey-editor/routes/editor/_components/main.d.ts +0 -2
  93. package/dist/modules/survey-editor/routes/editor/_components/sidebar.d.ts +0 -7
  94. package/dist/modules/survey-editor/routes/editor/index.d.ts +0 -5
  95. package/dist/modules/survey-editor/routes/editor/item-editor/_components/item-editor-toolbar/breadcrumbs-nav.d.ts +0 -2
  96. package/dist/modules/survey-editor/routes/editor/item-editor/_components/item-editor-toolbar/item-editor-toolbar.d.ts +0 -2
  97. package/dist/modules/survey-editor/routes/editor/item-editor/_components/item-editor-toolbar/language-picker.d.ts +0 -2
  98. package/dist/modules/survey-editor/routes/editor/item-editor/_components/item-editor-toolbar/search-trigger.d.ts +0 -3
  99. package/dist/modules/survey-editor/routes/editor/item-editor/_components/item-editor-toolbar/survey-search.d.ts +0 -7
  100. package/dist/modules/survey-editor/routes/editor/item-editor/index.d.ts +0 -2
  101. package/dist/modules/survey-editor/routes/editor/simulator/index.d.ts +0 -2
  102. package/dist/modules/survey-editor/routes/editor/translation-mode/index.d.ts +0 -2
  103. package/dist/modules/survey-editor/session-file.d.ts +0 -13
  104. package/dist/modules/survey-editor/store/editor-store-context.d.ts +0 -10
  105. package/dist/modules/survey-editor/store/editor-store-provider.d.ts +0 -7
  106. package/dist/modules/survey-editor/store/editor-store.d.ts +0 -96
  107. package/dist/modules/survey-editor/store/use-editor-store.d.ts +0 -4
  108. package/dist/modules/survey-editor/store/useItemNavigation.d.ts +0 -7
  109. package/dist/modules/survey-editor/survey-editor-config.d.ts +0 -17
  110. package/dist/modules/survey-editor/survey-editor.d.ts +0 -20
  111. package/dist/modules/survey-editor/utils/item-type-infos.d.ts +0 -23
  112. package/dist/modules/survey-player/index.d.ts +0 -1
  113. package/dist/modules/survey-player/survey-context.d.ts +0 -23
  114. package/dist/modules/survey-player/survey-item/survey-item-context.d.ts +0 -17
  115. package/dist/modules/survey-player/survey-item/survey-item-types/question-wrapper.d.ts +0 -5
  116. package/dist/modules/survey-player/survey-item/survey-item-types/single-choice-question-renderer.d.ts +0 -7
  117. package/dist/modules/survey-player/survey-item/survey-item.d.ts +0 -7
  118. package/dist/modules/survey-player/survey-player.d.ts +0 -2
  119. package/dist/styles.cjs.js +0 -0
  120. package/dist/styles.css +0 -2
  121. package/dist/styles.d.ts +0 -0
  122. package/dist/styles.es.js +0 -0
package/dist/index.d.ts CHANGED
@@ -1,9 +1,478 @@
1
- export { SurveyPlayer } from './modules/survey-player';
2
- export { SurveyEditor } from './modules/survey-editor';
3
- export { buildSurveyFileName, createBlankEditorState, createEditorStateFromRawSurvey, entriesToComposedEditorRegistry, entriesToParticipantRegistry, entriesToItemTypeRegistry, parseEditorStateFromJsonText, serializeSurveyStateForFile, validateRegistryEntries, } from './modules/survey-editor';
4
- export { FilepickerDropzone } from './components/c-ui/filepicker-dropzone';
5
- export { cloneRegistryEntries, createComposedEditorRegistry, createRegistryEntries, createSurveyPlayerRegistry, getDefaultComposedEditorRegistry, getDefaultRegistryEntries, getDefaultSurveyPlayerRegistry, } from './modules/default-item-registry';
6
- export type { CreateComposedEditorRegistryOptions, CreateRegistryEntriesOptions, CreateSurveyPlayerRegistryOptions, RegistryConflictStrategy, } from './modules/default-item-registry';
7
- export type { SurveyEditorProps, SurveyEditorStateChange, EditorItemDefinition, EditorItemDefinitionRegistry, ComposedEditorItemRegistry, EntriesToComposedEditorRegistryOptions, EntriesToParticipantRegistryOptions, ItemEditorComponentProps, ItemIconComponent, ItemPreviewComponentProps, ItemPreviewMode, ItemRegistryEntry, ItemRendererComponentProps, ItemSearchAdapter, RegistryValidationIssue, RegistryValidationMode, RegistryValidationOptions, RegistryValidationResult, AISuggestedText, BuildSurveyAIContextOptions, GenerateItemFromIntentRequest, GenerateItemFromIntentResult, GeneratedItemIntentSuggestion, SuggestItemKeyRequest, SuggestItemKeyResult, SuggestItemKeySuggestion, SuggestItemLabelRequest, SuggestItemLabelResult, SuggestItemLabelSuggestion, SurveyEditorAIProvider, SurveyAIContextScope, SurveyAIInvocationMode, SurveyAIRequestOptions, TranslateContentEntry, TranslateContentRequest, TranslateContentResult, ParsedSurveySession, ParsedSurveySessionFormat, } from './modules/survey-editor';
8
- export type { FilepickerDropzoneLabels, FilepickerDropzoneProps, } from './components/c-ui/filepicker-dropzone';
9
- export type { BuildSurveyAIContextPackOptions, SurveyAIContextIndexes, SurveyAIContextPack, SurveyAIContextPurpose, SurveyAIItemContextNode, SurveyAIKeyIndexEntry, SurveyAIFocus, SurveyAIOutlineNode, SurveyAITranslationSnippet, } from '@case-framework/survey-core/editor';
1
+ import { Accept } from 'react-dropzone';
2
+ import { BuildSurveyAIContextPackOptions } from '@case-framework/survey-core/editor';
3
+ import { ClassProp } from 'class-variance-authority/types';
4
+ import { default as default_2 } from 'react';
5
+ import { FileRejection } from 'react-dropzone';
6
+ import { FileWithPath } from 'react-dropzone';
7
+ import { ItemCoreConstructor } from '@case-framework/survey-core';
8
+ import { ItemTypeRegistry } from '@case-framework/survey-core';
9
+ import { JSX } from 'react/jsx-runtime';
10
+ import { RawSurveyItem } from '@case-framework/survey-core';
11
+ import { RenderedSurveyItem } from '@case-framework/survey-core';
12
+ import { SerializedSurveyEditor } from '@case-framework/survey-core/editor';
13
+ import { Survey } from '@case-framework/survey-core';
14
+ import { SurveyAIContextIndexes } from '@case-framework/survey-core/editor';
15
+ import { SurveyAIContextPack } from '@case-framework/survey-core/editor';
16
+ import { SurveyAIContextPurpose } from '@case-framework/survey-core/editor';
17
+ import { SurveyAIContextScope } from '@case-framework/survey-core/editor';
18
+ import { SurveyAIFocus } from '@case-framework/survey-core/editor';
19
+ import { SurveyAIItemContextNode } from '@case-framework/survey-core/editor';
20
+ import { SurveyAIKeyIndexEntry } from '@case-framework/survey-core/editor';
21
+ import { SurveyAIOutlineNode } from '@case-framework/survey-core/editor';
22
+ import { SurveyAITranslationSnippet } from '@case-framework/survey-core/editor';
23
+ import { SurveyItemCore } from '@case-framework/survey-core';
24
+ import { SurveyItemTranslations } from '@case-framework/survey-core';
25
+ import { Target } from '@case-framework/survey-core/editor';
26
+ import { VariantProps } from 'class-variance-authority';
27
+
28
+ export declare interface AISuggestedText {
29
+ text: string;
30
+ }
31
+
32
+ export declare interface BuildSurveyAIContextOptions {
33
+ purpose?: SurveyAIContextPurpose;
34
+ scope?: SurveyAIContextScope;
35
+ focusItemId?: string;
36
+ includeRawSurvey?: boolean;
37
+ outlineLimit?: number;
38
+ includeIndexes?: boolean;
39
+ includeFocusItemTree?: boolean;
40
+ focusItemTreeLimit?: number;
41
+ translationSnippetsPerItemLimit?: number;
42
+ translationSnippetTextLimit?: number;
43
+ }
44
+
45
+ export { BuildSurveyAIContextPackOptions }
46
+
47
+ export declare function buildSurveyFileName(state: SerializedSurveyEditor, fallback?: string): string;
48
+
49
+ export declare function cloneRegistryEntries(entries: readonly ItemRegistryEntry[]): ItemRegistryEntry[];
50
+
51
+ export declare interface ComposedEditorItemRegistry {
52
+ coreRegistry: ItemTypeRegistry;
53
+ definitions: EditorItemDefinitionRegistry;
54
+ }
55
+
56
+ export declare function createBlankEditorState(pluginRegistry?: ItemTypeRegistry, surveyKey?: string): SerializedSurveyEditor;
57
+
58
+ export declare function createComposedEditorRegistry(options?: CreateComposedEditorRegistryOptions): ComposedEditorItemRegistry;
59
+
60
+ export declare type CreateComposedEditorRegistryOptions = CreateRegistryEntriesOptions & EntriesToComposedEditorRegistryOptions;
61
+
62
+ export declare function createEditorStateFromRawSurvey(rawSurvey: Parameters<typeof Survey.fromJson>[0], pluginRegistry?: ItemTypeRegistry): SerializedSurveyEditor;
63
+
64
+ declare interface CreateItemContext {
65
+ editor: {
66
+ addItem: (target: Target, item: SurveyItemCore, content?: SurveyItemTranslations) => void;
67
+ };
68
+ targetParentId: string;
69
+ constructor: ItemCoreConstructor;
70
+ }
71
+
72
+ export declare function createRegistryEntries(options?: CreateRegistryEntriesOptions): ItemRegistryEntry[];
73
+
74
+ export declare interface CreateRegistryEntriesOptions {
75
+ /** Include default built-in entries first. Defaults to true. */
76
+ includeDefaultEntries?: boolean;
77
+ /** Custom entries to add/override. */
78
+ entries?: ItemRegistryEntry[];
79
+ /** How to handle duplicate itemType values. Defaults to override. */
80
+ conflictStrategy?: RegistryConflictStrategy;
81
+ }
82
+
83
+ export declare function createSurveyPlayerRegistry(options?: CreateSurveyPlayerRegistryOptions): SurveyPlayerItemRegistry;
84
+
85
+ export declare type CreateSurveyPlayerRegistryOptions = CreateRegistryEntriesOptions & EntriesToParticipantRegistryOptions;
86
+
87
+ export declare interface EditorItemDefinition {
88
+ itemType: string;
89
+ infos: ItemInfos;
90
+ editorComponent?: default_2.ComponentType<ItemEditorComponentProps>;
91
+ renderComponent?: default_2.ComponentType<ItemRendererComponentProps>;
92
+ previewComponent?: default_2.ComponentType<ItemPreviewComponentProps>;
93
+ capabilities?: ItemEditorCapabilities;
94
+ isRootOnly?: boolean;
95
+ getInitialItem?: () => ItemInitialData;
96
+ createItem?: (ctx: CreateItemContext) => string;
97
+ searchAdapters?: ItemSearchAdapter[];
98
+ includeDefaultSearchAdapter?: boolean;
99
+ }
100
+
101
+ export declare type EditorItemDefinitionRegistry = Record<string, EditorItemDefinition>;
102
+
103
+ declare interface EditorItemSearchResult {
104
+ matchType: SearchMatchType;
105
+ matchText: string;
106
+ }
107
+
108
+ declare interface EditorStateChangePayload {
109
+ sessionId: string | null;
110
+ state: SerializedSurveyEditor;
111
+ revision: number;
112
+ hasUncommittedChanges: boolean;
113
+ at: number;
114
+ }
115
+
116
+ /**
117
+ * Derive ComposedEditorItemRegistry from unified entries for the editor.
118
+ * Ensures Group and PageBreak have definitions; uses coreRegistry from entries.
119
+ */
120
+ export declare function entriesToComposedEditorRegistry(entries: ItemRegistryEntry[], options?: EntriesToComposedEditorRegistryOptions): ComposedEditorItemRegistry;
121
+
122
+ export declare interface EntriesToComposedEditorRegistryOptions {
123
+ /** Require built-in editor definitions for group/pageBreak. Defaults to true. */
124
+ requireBuiltInTypes?: boolean;
125
+ }
126
+
127
+ /**
128
+ * Derive ItemTypeRegistry from unified entries for Survey / SurveyEditor.
129
+ * Uses built-in registry for group/pageBreak; plugin entries supply constructors for custom types.
130
+ */
131
+ export declare function entriesToItemTypeRegistry(entries: ItemRegistryEntry[]): ItemTypeRegistry;
132
+
133
+ /**
134
+ * Derive participant registry from unified entries.
135
+ * Lightweight: core + renderer only. Use this for survey player / participant app.
136
+ */
137
+ export declare function entriesToParticipantRegistry(entries: ItemRegistryEntry[], options?: EntriesToParticipantRegistryOptions): SurveyPlayerItemRegistry;
138
+
139
+ export declare interface EntriesToParticipantRegistryOptions {
140
+ /** Throw when an entry in the provided list does not define a renderComponent. */
141
+ requireRenderer?: boolean;
142
+ }
143
+
144
+ declare function Field({ className, orientation, ...props }: React.ComponentProps<"div"> & VariantProps<typeof fieldVariants>): JSX.Element;
145
+
146
+ declare const fieldVariants: (props?: ({
147
+ orientation?: "horizontal" | "vertical" | "responsive" | null | undefined;
148
+ } & ClassProp) | undefined) => string;
149
+
150
+ export 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): JSX.Element;
151
+
152
+ export declare interface FilepickerDropzoneLabels {
153
+ upload: string;
154
+ drag: string;
155
+ active: string;
156
+ reject: string;
157
+ rejectInvalidType: string;
158
+ rejectTooLarge: string;
159
+ rejectTooSmall: string;
160
+ rejectTooMany: string;
161
+ selectedCount: string;
162
+ }
163
+
164
+ export declare interface FilepickerDropzoneProps extends Omit<React.ComponentProps<typeof Field>, "children" | "onChange"> {
165
+ id: string;
166
+ name?: string;
167
+ label?: React.ReactNode;
168
+ description?: React.ReactNode;
169
+ error?: React.ReactNode;
170
+ accept?: Accept;
171
+ multiple?: boolean;
172
+ disabled?: boolean;
173
+ required?: boolean;
174
+ maxFiles?: number;
175
+ maxSize?: number;
176
+ minSize?: number;
177
+ icon?: React.ReactNode;
178
+ labelClassName?: string;
179
+ contentClassName?: string;
180
+ descriptionClassName?: string;
181
+ errorClassName?: string;
182
+ dropzoneClassName?: string;
183
+ labels?: Partial<FilepickerDropzoneLabels>;
184
+ onChange?: (files: readonly FileWithPath[]) => void;
185
+ onDropRejected?: (fileRejections: FileRejection[]) => void;
186
+ }
187
+
188
+ export declare interface GeneratedItemIntentSuggestion {
189
+ tempId: string;
190
+ parentTempId?: string;
191
+ itemType: string;
192
+ key: string;
193
+ itemLabel?: string;
194
+ confidence?: number;
195
+ }
196
+
197
+ export declare interface GenerateItemFromIntentRequest {
198
+ intent: string;
199
+ targetParentId: string;
200
+ allowedItemTypes: string[];
201
+ maxItems?: number;
202
+ locale?: string;
203
+ context: SurveyAIContextPack;
204
+ }
205
+
206
+ export declare interface GenerateItemFromIntentResult {
207
+ items: GeneratedItemIntentSuggestion[];
208
+ }
209
+
210
+ export declare function getDefaultComposedEditorRegistry(): ComposedEditorItemRegistry;
211
+
212
+ export declare function getDefaultRegistryEntries(): ItemRegistryEntry[];
213
+
214
+ export declare function getDefaultSurveyPlayerRegistry(): SurveyPlayerItemRegistry;
215
+
216
+ declare type ItemCategory = string;
217
+
218
+ declare interface ItemEditorCapabilities {
219
+ usesValidationPanel?: boolean;
220
+ usesTranslationPanel?: boolean;
221
+ usesConditionsPanel?: boolean;
222
+ }
223
+
224
+ export declare interface ItemEditorComponentProps<TItem extends SurveyItemCore = SurveyItemCore> {
225
+ item: TItem;
226
+ }
227
+
228
+ declare interface ItemEditorLocation {
229
+ view: 'item-editor';
230
+ itemId?: string;
231
+ }
232
+
233
+ export declare type ItemIconComponent = default_2.ComponentType<{
234
+ className?: string;
235
+ }>;
236
+
237
+ declare interface ItemInfos {
238
+ icon: ItemIconComponent;
239
+ labelByLocale: ItemLocaleMap;
240
+ descriptionByLocale: ItemLocaleMap;
241
+ defaultItemClassName?: string;
242
+ categories: ItemCategory[];
243
+ }
244
+
245
+ declare interface ItemInitialData {
246
+ rawItem: RawSurveyItem;
247
+ translations?: SurveyItemTranslations;
248
+ children?: ItemInitialData[];
249
+ }
250
+
251
+ declare type ItemLocaleMap = Record<string, string>;
252
+
253
+ export declare interface ItemPreviewComponentProps<TItem extends SurveyItemCore = SurveyItemCore> {
254
+ item: TItem;
255
+ itemConfig: TItem["config"];
256
+ itemContent?: SurveyItemTranslations;
257
+ locale: string;
258
+ mode?: ItemPreviewMode;
259
+ }
260
+
261
+ export declare type ItemPreviewMode = "interactive" | "static";
262
+
263
+ /**
264
+ * Unified registry entry type, reusable across contexts:
265
+ *
266
+ * - Participant app: needs only `constructor` + `renderComponent`
267
+ * - Editor: needs constructor, infos, `previewComponent`, editorComponent, searchAdapters, etc.
268
+ *
269
+ * Use the mapper helpers to derive ItemTypeRegistry, participant registry, or editor registry.
270
+ */
271
+ export declare interface ItemRegistryEntry {
272
+ itemType: string;
273
+ /** 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. */
274
+ constructor?: ItemCoreConstructor;
275
+ /** Participant renderer. Required for participant app. */
276
+ renderComponent?: default_2.ComponentType<ItemRendererComponentProps>;
277
+ /** Editor-only: item preview renderer */
278
+ previewComponent?: default_2.ComponentType<ItemPreviewComponentProps>;
279
+ /** Editor-only: display metadata */
280
+ infos?: ItemInfos;
281
+ /** Editor-only: card/editor UI */
282
+ editorComponent?: default_2.ComponentType<ItemEditorComponentProps>;
283
+ /** Editor-only: search integration */
284
+ searchAdapters?: ItemSearchAdapter[];
285
+ /** Editor-only: include built-in key/label/itemType search adapter in addition to custom adapters. Defaults to true. */
286
+ includeDefaultSearchAdapter?: boolean;
287
+ /** Editor-only */
288
+ capabilities?: ItemEditorCapabilities;
289
+ /** Editor-only: default raw item when creating new */
290
+ getInitialItem?: () => ItemInitialData;
291
+ /** Editor-only: custom creation flow (advanced) */
292
+ createItem?: (ctx: CreateItemContext) => string;
293
+ /** Editor-only: hide from add-item options in non-root context */
294
+ isRootOnly?: boolean;
295
+ }
296
+
297
+ export declare interface ItemRendererComponentProps {
298
+ renderedItem: RenderedSurveyItem;
299
+ }
300
+
301
+ export declare type ItemSearchAdapter = (ctx: ItemSearchAdapterContext) => EditorItemSearchResult[] | undefined;
302
+
303
+ declare interface ItemSearchAdapterContext {
304
+ itemId: string;
305
+ survey: Survey;
306
+ searchTerm: string;
307
+ }
308
+
309
+ export declare interface ParsedSurveySession {
310
+ format: ParsedSurveySessionFormat;
311
+ state: SerializedSurveyEditor;
312
+ sessionId: string;
313
+ }
314
+
315
+ export declare type ParsedSurveySessionFormat = 'raw-survey' | 'serialized-editor';
316
+
317
+ export declare function parseEditorStateFromJsonText(jsonText: string, pluginRegistry?: ItemTypeRegistry): ParsedSurveySession;
318
+
319
+ export declare type RegistryConflictStrategy = "error" | "override";
320
+
321
+ export declare interface RegistryValidationIssue {
322
+ code: string;
323
+ message: string;
324
+ itemType?: string;
325
+ }
326
+
327
+ export declare type RegistryValidationMode = "editor" | "player";
328
+
329
+ export declare interface RegistryValidationOptions {
330
+ mode: RegistryValidationMode;
331
+ requireBuiltInTypes?: boolean;
332
+ requireRenderer?: boolean;
333
+ }
334
+
335
+ export declare interface RegistryValidationResult {
336
+ errors: RegistryValidationIssue[];
337
+ warnings: RegistryValidationIssue[];
338
+ }
339
+
340
+ declare const SearchMatchType: {
341
+ readonly Content: "content";
342
+ readonly Label: "label";
343
+ readonly Key: "key";
344
+ readonly ItemType: "itemType";
345
+ };
346
+
347
+ declare type SearchMatchType = (typeof SearchMatchType)[keyof typeof SearchMatchType];
348
+
349
+ export declare function serializeSurveyStateForFile(state: SerializedSurveyEditor): string;
350
+
351
+ declare interface SimulatorLocation {
352
+ view: 'simulator';
353
+ }
354
+
355
+ export declare interface SuggestItemKeyRequest {
356
+ draftKey: string;
357
+ currentKey: string;
358
+ siblingKeys: string[];
359
+ childContentHints?: string[];
360
+ maxSuggestions?: number;
361
+ context: SurveyAIContextPack;
362
+ }
363
+
364
+ export declare interface SuggestItemKeyResult {
365
+ suggestions: SuggestItemKeySuggestion[];
366
+ }
367
+
368
+ export declare interface SuggestItemKeySuggestion extends AISuggestedText {
369
+ rationale?: string;
370
+ }
371
+
372
+ export declare interface SuggestItemLabelRequest {
373
+ draftLabel: string;
374
+ itemType: string;
375
+ locale?: string;
376
+ maxSuggestions?: number;
377
+ context: SurveyAIContextPack;
378
+ }
379
+
380
+ export declare interface SuggestItemLabelResult {
381
+ suggestions: SuggestItemLabelSuggestion[];
382
+ }
383
+
384
+ export declare interface SuggestItemLabelSuggestion extends AISuggestedText {
385
+ tone?: string;
386
+ }
387
+
388
+ export { SurveyAIContextIndexes }
389
+
390
+ export { SurveyAIContextPack }
391
+
392
+ export { SurveyAIContextPurpose }
393
+
394
+ export { SurveyAIContextScope }
395
+
396
+ export { SurveyAIFocus }
397
+
398
+ export declare type SurveyAIInvocationMode = "user" | "background";
399
+
400
+ export { SurveyAIItemContextNode }
401
+
402
+ export { SurveyAIKeyIndexEntry }
403
+
404
+ export { SurveyAIOutlineNode }
405
+
406
+ export declare interface SurveyAIRequestOptions {
407
+ signal?: AbortSignal;
408
+ mode?: SurveyAIInvocationMode;
409
+ }
410
+
411
+ export { SurveyAITranslationSnippet }
412
+
413
+ export declare const SurveyEditor: React.FC<SurveyEditorProps>;
414
+
415
+ export declare interface SurveyEditorAIProvider {
416
+ suggestItemKey?: (request: SuggestItemKeyRequest, options?: SurveyAIRequestOptions) => Promise<SuggestItemKeyResult>;
417
+ suggestItemLabel?: (request: SuggestItemLabelRequest, options?: SurveyAIRequestOptions) => Promise<SuggestItemLabelResult>;
418
+ generateItemFromIntent?: (request: GenerateItemFromIntentRequest, options?: SurveyAIRequestOptions) => Promise<GenerateItemFromIntentResult>;
419
+ translateContent?: (request: TranslateContentRequest, options?: SurveyAIRequestOptions) => Promise<TranslateContentResult>;
420
+ }
421
+
422
+ declare type SurveyEditorLocation = ItemEditorLocation | TranslationModeLocation | SimulatorLocation;
423
+
424
+ declare interface SurveyEditorNavigationAdapter {
425
+ getLocation: () => SurveyEditorLocation;
426
+ navigateTo: (location: SurveyEditorLocation, options?: {
427
+ replace?: boolean;
428
+ }) => void;
429
+ subscribe(listener: (location: SurveyEditorLocation) => void): () => void;
430
+ }
431
+
432
+ export declare interface SurveyEditorProps {
433
+ initialEditorState?: SerializedSurveyEditor;
434
+ initialSessionId?: string;
435
+ fallbackLocale?: string;
436
+ itemRegistryEntries?: ItemRegistryEntry[];
437
+ onEditorStateChange?: (change: SurveyEditorStateChange) => void;
438
+ persistDebounceMs?: number;
439
+ helpLink?: string;
440
+ navigationAdapter?: SurveyEditorNavigationAdapter | null;
441
+ aiProvider?: SurveyEditorAIProvider | null;
442
+ onSaveRequested?: () => void;
443
+ }
444
+
445
+ export declare type SurveyEditorStateChange = EditorStateChangePayload;
446
+
447
+ export declare const SurveyPlayer: default_2.FC;
448
+
449
+ /** Participant registry: core + renderer per item type. Lightweight for survey player. */
450
+ declare interface SurveyPlayerItemRegistry {
451
+ coreRegistry: ItemTypeRegistry;
452
+ getRenderer: (itemType: string) => default_2.ComponentType<ItemRendererComponentProps> | undefined;
453
+ }
454
+
455
+ export declare interface TranslateContentEntry {
456
+ id: string;
457
+ text: string;
458
+ kind: string;
459
+ }
460
+
461
+ export declare interface TranslateContentRequest {
462
+ sourceLocale: string;
463
+ targetLocales: string[];
464
+ entries: TranslateContentEntry[];
465
+ context: SurveyAIContextPack;
466
+ }
467
+
468
+ export declare interface TranslateContentResult {
469
+ translations: Record<string, Record<string, string>>;
470
+ }
471
+
472
+ declare interface TranslationModeLocation {
473
+ view: 'translation-mode';
474
+ }
475
+
476
+ export declare function validateRegistryEntries(entries: ItemRegistryEntry[], options: RegistryValidationOptions): RegistryValidationResult;
477
+
478
+ export { }