@case-framework/survey-ui 0.5.1 → 0.6.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 (94) hide show
  1. package/dist/default-item-cores-C6VK2LFe.js +10 -0
  2. package/dist/default-item-cores-C6VK2LFe.js.map +1 -0
  3. package/dist/default-item-cores-gdu37TFX.mjs +3988 -0
  4. package/dist/default-item-cores-gdu37TFX.mjs.map +1 -0
  5. package/dist/item-core-registry.cjs.js +2 -0
  6. package/dist/item-core-registry.cjs.js.map +1 -0
  7. package/dist/item-core-registry.es.js +11 -0
  8. package/dist/item-core-registry.es.js.map +1 -0
  9. package/dist/src/components/common/sortable-tree.d.ts +59 -0
  10. package/dist/src/components/rich-text/rich-text-content-view.d.ts +6 -2
  11. package/dist/src/components/ui/dialog.d.ts +2 -1
  12. package/dist/src/components/ui/resizable.d.ts +7 -0
  13. package/dist/src/components/ui/toggle.d.ts +1 -1
  14. package/dist/src/dev/localizations/de.d.ts +2 -2
  15. package/dist/src/index.d.ts +7 -4
  16. package/dist/src/item-core-registry.d.ts +4 -0
  17. package/dist/src/modules/default-item-registry/item-authoring-state.d.ts +15 -0
  18. package/dist/src/modules/default-item-registry/items/choice/editor/option-edit-dialog.d.ts +10 -3
  19. package/dist/src/modules/default-item-registry/items/form/model.d.ts +4 -1
  20. package/dist/src/modules/survey-editor/ai/create-provider.d.ts +22 -0
  21. package/dist/src/modules/survey-editor/ai/types.d.ts +6 -83
  22. package/dist/src/modules/survey-editor/ai/use-survey-assistant-integration.d.ts +16 -0
  23. package/dist/src/modules/survey-editor/assistant/apply.d.ts +24 -0
  24. package/dist/src/modules/survey-editor/assistant/index.d.ts +2 -0
  25. package/dist/src/modules/survey-editor/assistant/snapshot.d.ts +39 -0
  26. package/dist/src/modules/survey-editor/editor-card/add-items/constants.d.ts +2 -0
  27. package/dist/src/modules/survey-editor/editor-card/add-items/hooks/use-add-item-actions.d.ts +4 -5
  28. package/dist/src/modules/survey-editor/editor-card/add-items/hooks/use-option-group-navigation.d.ts +2 -1
  29. package/dist/src/modules/survey-editor/editor-card/add-items/types.d.ts +1 -1
  30. package/dist/src/modules/survey-editor/editor-card/add-items/views/item-type-grid-view.d.ts +30 -0
  31. package/dist/src/modules/survey-editor/editor-card/delete-item-dropdown-menu.d.ts +3 -1
  32. package/dist/src/modules/survey-editor/editor-card/expression-pseudo-code.d.ts +8 -0
  33. package/dist/src/modules/survey-editor/editor-card/hooks/use-group-list-keyboard.d.ts +1 -1
  34. package/dist/src/modules/survey-editor/editor-card/item-authoring-state-preview.d.ts +16 -0
  35. package/dist/src/modules/survey-editor/editor-card/item-editor-card.d.ts +1 -6
  36. package/dist/src/modules/survey-editor/editor-card/item-editor-context.d.ts +5 -2
  37. package/dist/src/modules/survey-editor/editor-card/item-expression-overview.d.ts +33 -0
  38. package/dist/src/modules/survey-editor/editor-instance-provider.d.ts +2 -0
  39. package/dist/src/modules/survey-editor/hooks/useDeleteItem.d.ts +2 -0
  40. package/dist/src/modules/survey-editor/index.d.ts +5 -2
  41. package/dist/src/modules/survey-editor/localization/date-fns.d.ts +1 -1
  42. package/dist/src/modules/survey-editor/localization/default-all.d.ts +2 -2
  43. package/dist/src/modules/survey-editor/localization/default-en.d.ts +2 -2
  44. package/dist/src/modules/survey-editor/localization/default-nl.d.ts +2 -2
  45. package/dist/src/modules/survey-editor/localization/index.d.ts +0 -2
  46. package/dist/src/modules/survey-editor/localization/runtime.d.ts +4 -4
  47. package/dist/src/modules/survey-editor/navigation/location.d.ts +6 -0
  48. package/dist/src/modules/survey-editor/navigation/navigation-provider.d.ts +2 -1
  49. package/dist/src/modules/survey-editor/navigation/navigation.d.ts +10 -1
  50. package/dist/src/modules/survey-editor/navigation/types.d.ts +6 -1
  51. package/dist/src/modules/survey-editor/primitives/input-with-ai-popover.d.ts +2 -2
  52. package/dist/src/modules/survey-editor/registry/authoring-state.d.ts +17 -0
  53. package/dist/src/modules/survey-editor/registry/index.d.ts +1 -0
  54. package/dist/src/modules/survey-editor/registry/registry-mappers.d.ts +3 -3
  55. package/dist/src/modules/survey-editor/registry/types.d.ts +40 -4
  56. package/dist/src/modules/survey-editor/routes/editor/_components/assistant-authoring-lock.d.ts +7 -0
  57. package/dist/src/modules/survey-editor/routes/editor/_components/editor-assistant-slot-context.d.ts +6 -0
  58. package/dist/src/modules/survey-editor/routes/editor/_components/editor-assistant-slot.d.ts +8 -0
  59. package/dist/src/modules/survey-editor/routes/editor/_components/editor-mode-switch.d.ts +7 -0
  60. package/dist/src/modules/survey-editor/routes/editor/_components/editor-workspace.d.ts +30 -0
  61. package/dist/src/modules/survey-editor/routes/editor/_components/footer.d.ts +1 -1
  62. package/dist/src/modules/survey-editor/routes/editor/_components/main.d.ts +1 -1
  63. package/dist/src/modules/survey-editor/routes/editor/_components/workspace-presets.d.ts +75 -0
  64. package/dist/src/modules/survey-editor/routes/editor/index.d.ts +1 -1
  65. package/dist/src/modules/survey-editor/routes/editor/item-editor/_components/item-editor-toolbar/item-editor-toolbar.d.ts +0 -1
  66. package/dist/src/modules/survey-editor/routes/editor/item-editor/_components/survey-outline.d.ts +3 -0
  67. package/dist/src/modules/survey-editor/routes/editor/item-editor/_components/survey-workspace.d.ts +12 -0
  68. package/dist/src/modules/survey-editor/routes/editor/item-editor/index.d.ts +0 -1
  69. package/dist/src/modules/survey-editor/routes/editor/preview-mode/index.d.ts +7 -0
  70. package/dist/src/modules/survey-editor/routes/editor/preview-mode/page-break-divider.d.ts +6 -0
  71. package/dist/src/modules/survey-editor/routes/editor/preview-mode/preview-controls.d.ts +15 -0
  72. package/dist/src/modules/survey-editor/routes/editor/preview-mode/preview-tree.d.ts +26 -0
  73. package/dist/src/modules/survey-editor/routes/editor/preview-mode/survey-preview-canvas.d.ts +16 -0
  74. package/dist/src/modules/survey-editor/routes/editor/preview-mode/survey-preview-item.d.ts +13 -0
  75. package/dist/src/modules/survey-editor/routes/editor/preview-mode/use-preview-preferences.d.ts +14 -0
  76. package/dist/src/modules/survey-editor/store/editor-store.d.ts +7 -1
  77. package/dist/src/modules/survey-editor/survey-editor-config.d.ts +14 -5
  78. package/dist/src/modules/survey-editor/survey-editor.d.ts +14 -2
  79. package/dist/src/modules/survey-editor/workspace.d.ts +17 -0
  80. package/dist/src/modules/survey-player/index.d.ts +0 -1
  81. package/dist/src/modules/survey-player/localization/default-en.d.ts +2 -2
  82. package/dist/src/modules/survey-player/localization/runtime.d.ts +5 -4
  83. package/dist/src/modules/survey-player/survey-context.d.ts +9 -4
  84. package/dist/src/modules/survey-player/survey-player.d.ts +2 -2
  85. package/dist/survey-ui.cjs.js +101 -76
  86. package/dist/survey-ui.cjs.js.map +1 -1
  87. package/dist/survey-ui.css +2 -2
  88. package/dist/survey-ui.es.js +29059 -23481
  89. package/dist/survey-ui.es.js.map +1 -1
  90. package/package.json +26 -17
  91. package/dist/src/modules/default-item-registry/items/choice/editor/option-embedded-form-dialog.d.ts +0 -15
  92. package/dist/src/modules/survey-editor/editor-card/add-items/views/ai-item-view.d.ts +0 -10
  93. package/dist/src/modules/survey-editor/localization/types.d.ts +0 -7
  94. package/dist/src/modules/survey-player/localization/types.d.ts +0 -7
@@ -0,0 +1,26 @@
1
+ import { Survey, SurveyItemCore } from '@case-framework/survey-core';
2
+ export type PreviewLayout = "single" | "paginated";
3
+ export type PreviewViewport = "mobile" | "tablet" | "desktop" | "wide";
4
+ export declare const PREVIEW_VIEWPORT_WIDTHS: Record<PreviewViewport, number>;
5
+ /** Returns every non-group item in authored tree order, including page breaks. */
6
+ export declare const flattenPreviewItems: (survey: Survey) => SurveyItemCore[];
7
+ /**
8
+ * Maps each item to the authored position immediately following it.
9
+ * Group items are intentionally not rendered in preview mode, so this keeps the
10
+ * insertion targets in each item's direct containing group rather than guessing
11
+ * from the flattened visual order.
12
+ */
13
+ export declare const getPreviewInsertionTargets: (survey: Survey) => Map<string, {
14
+ parentId: string;
15
+ index: number;
16
+ }>;
17
+ /**
18
+ * Splits authored items into non-empty pages. Page breaks never render as page content.
19
+ * Leading, trailing, and consecutive breaks therefore do not create empty pages.
20
+ */
21
+ export declare const paginatePreviewItems: (items: readonly SurveyItemCore[], maxItemsPerPage?: number) => SurveyItemCore[][];
22
+ export declare const getPreviewMaxItemsPerPage: (survey: Survey, viewport: PreviewViewport) => number | undefined;
23
+ export declare const getPreviewPageIndex: (pages: readonly (readonly SurveyItemCore[])[], itemId: string) => number;
24
+ export declare const getPaginatedPreviewFocusTarget: (items: readonly SurveyItemCore[], requestedItemId: string) => string | undefined;
25
+ export declare const resolvePreviewFocusItemId: (survey: Survey, requestedItemId: string | undefined, flattenedItems: readonly SurveyItemCore[]) => string | undefined;
26
+ export declare const itemHasConditions: (item: SurveyItemCore) => boolean;
@@ -0,0 +1,16 @@
1
+ import { Survey, SurveyEngineCore } from '@case-framework/survey-core';
2
+ import { PreviewPreferences } from './use-preview-preferences';
3
+ interface SurveyPreviewCanvasProps {
4
+ survey: Survey;
5
+ surveyEngine: SurveyEngineCore;
6
+ preferences: PreviewPreferences;
7
+ focusedItemId?: string;
8
+ locateRequestKey: number;
9
+ initialLocateReady: boolean;
10
+ currentPageIndex: number;
11
+ onCurrentPageIndexChange: (pageIndex: number) => void;
12
+ onResponseChanged: () => void;
13
+ className?: string;
14
+ }
15
+ export declare const SurveyPreviewCanvas: ({ survey, surveyEngine, preferences, focusedItemId, locateRequestKey, initialLocateReady, currentPageIndex, onCurrentPageIndexChange, onResponseChanged, className, }: SurveyPreviewCanvasProps) => import("react/jsx-runtime").JSX.Element;
16
+ export {};
@@ -0,0 +1,13 @@
1
+ import { RenderedSurveyItem, SurveyItemCore } from '@case-framework/survey-core';
2
+ import { PreviewPreferences } from './use-preview-preferences';
3
+ interface SurveyPreviewItemProps {
4
+ item: SurveyItemCore;
5
+ renderedItem?: RenderedSurveyItem;
6
+ preferences: PreviewPreferences;
7
+ focused: boolean;
8
+ highlighted: boolean;
9
+ onFocus: () => void;
10
+ afterDeleteItemId: string | null;
11
+ }
12
+ export declare const SurveyPreviewItem: ({ item, renderedItem, preferences, focused, highlighted, onFocus, afterDeleteItemId, }: SurveyPreviewItemProps) => import("react/jsx-runtime").JSX.Element;
13
+ export {};
@@ -0,0 +1,14 @@
1
+ import { PreviewLayout, PreviewViewport } from './preview-tree';
2
+ export interface PreviewPreferences {
3
+ layout: PreviewLayout;
4
+ viewport: PreviewViewport;
5
+ showKeys: boolean;
6
+ showFullKeys: boolean;
7
+ showMetadata: boolean;
8
+ showConditions: boolean;
9
+ showPageIndicator: boolean;
10
+ }
11
+ export declare const usePreviewPreferences: () => {
12
+ preferences: PreviewPreferences;
13
+ updatePreferences: (updates: Partial<PreviewPreferences>) => void;
14
+ };
@@ -2,6 +2,7 @@ import { StoreApi } from 'zustand';
2
2
  import { SurveyEditor, Target, SurveyItemClipboardData, CommitMeta, SurveyEditorHistoryCommit, UndoRedoConfig } from '@case-framework/survey-core/editor';
3
3
  import { SurveyItemCore, SurveyItemTranslations, RawSurveyItem, TemplateValueDefinition, GroupItemCore, RawSurveyAsset, SurveyCardContent, NavigationContent, Content } from '@case-framework/survey-core';
4
4
  import { ComposedEditorItemRegistry, ItemCategory, ItemLocaleMap, ItemRegistryEntry } from '../registry';
5
+ import { SurveyApplyResult, SurveyBatchApplyResult, SurveyChangeSet, SurveyDocumentVersion } from '@case-framework/survey-assistant/protocol';
5
6
  interface StartNewSessionOptions {
6
7
  surveyKey?: string;
7
8
  /** Unified registry entries (recommended, matches SurveyEditor) */
@@ -19,6 +20,8 @@ export interface EditorStore {
19
20
  /** Composed item registry used by editor UI features. */
20
21
  editorItemRegistry: ComposedEditorItemRegistry;
21
22
  selectedLocale: string;
23
+ /** True while user-authored survey mutations are temporarily paused. */
24
+ userMutationsLocked: boolean;
22
25
  /** Set the active editor (call when opening a session) */
23
26
  setEditor: (surveyId: string | null, editor: SurveyEditor | null) => void;
24
27
  /** Clear the active editor (call when closing/unmounting to avoid stale state on next mount) */
@@ -27,6 +30,7 @@ export interface EditorStore {
27
30
  startNewSession: (options: StartNewSessionOptions) => void;
28
31
  setEditorItemRegistry: (registry: ComposedEditorItemRegistry) => void;
29
32
  setSelectedLocale: (locale: string) => void;
33
+ setUserMutationsLocked: (locked: boolean) => void;
30
34
  undo: () => boolean;
31
35
  redo: () => boolean;
32
36
  canUndo: () => boolean;
@@ -50,7 +54,7 @@ export interface EditorStore {
50
54
  moveItem: (itemId: string, newTarget: Target) => boolean;
51
55
  updateItemTranslations: (itemId: string, updatedContent?: SurveyItemTranslations) => boolean;
52
56
  copyItem: (itemId: string) => SurveyItemClipboardData;
53
- pasteItem: (clipboardData: SurveyItemClipboardData, target: Target) => string;
57
+ pasteItem: (clipboardData: SurveyItemClipboardData, target: Target) => string | null;
54
58
  getRootItem: () => GroupItemCore | undefined;
55
59
  getItemDataCopy: (itemId: string) => RawSurveyItem;
56
60
  updateItem: (itemId: string, rawItemData: RawSurveyItem | Partial<RawSurveyItem>) => void;
@@ -84,6 +88,8 @@ export interface EditorStore {
84
88
  updateMetadata: (metadata: {
85
89
  [key: string]: string;
86
90
  } | undefined) => void;
91
+ applyAssistantChange: (change: SurveyChangeSet, currentPrecondition: SurveyDocumentVersion) => SurveyApplyResult;
92
+ applyAssistantChanges: (changes: SurveyChangeSet[], currentPrecondition: SurveyDocumentVersion) => SurveyBatchApplyResult;
87
93
  getTemplateValue: (key: string) => TemplateValueDefinition | undefined;
88
94
  getTemplateValues: () => Map<string, TemplateValueDefinition>;
89
95
  setTemplateValue: (key: string, templateValue: TemplateValueDefinition) => void;
@@ -1,16 +1,19 @@
1
1
  import { ReactNode } from 'react';
2
2
  import { Locale } from 'date-fns/locale';
3
3
  import { SurveyEditorAIProvider } from './ai/types';
4
- import { EditorTranslate, SurveyEditorDateLocales, EditorTranslationValues, SurveyEditorLocalizations } from './localization';
4
+ import { LocalizationCatalog, LocalizationTranslate, LocalizationValues } from '@case-framework/ui-localization';
5
+ import { SurveyEditorDateLocales } from './localization/date-fns';
6
+ import { SurveyEditorWorkspace } from './workspace';
5
7
  interface SurveyEditorConfigType {
6
8
  helpLink: string;
7
9
  aiProvider: SurveyEditorAIProvider | null;
8
10
  fallbackLocale: string;
9
11
  language: string;
10
- localizations: SurveyEditorLocalizations;
12
+ localizations: LocalizationCatalog;
11
13
  dateLocales: SurveyEditorDateLocales;
12
14
  dateLocale: Locale;
13
- translate: EditorTranslate;
15
+ translate: LocalizationTranslate;
16
+ workspace?: SurveyEditorWorkspace;
14
17
  }
15
18
  interface SurveyEditorConfigProviderProps {
16
19
  children: ReactNode;
@@ -18,12 +21,18 @@ interface SurveyEditorConfigProviderProps {
18
21
  aiProvider?: SurveyEditorAIProvider | null;
19
22
  fallbackLocale?: string;
20
23
  language?: string;
21
- localizations?: SurveyEditorLocalizations;
24
+ localizations?: LocalizationCatalog;
22
25
  dateLocales?: SurveyEditorDateLocales;
26
+ workspace?: SurveyEditorWorkspace;
23
27
  }
28
+ interface ResolvedSurveyEditorConfigProviderProps extends Omit<SurveyEditorConfigProviderProps, "dateLocales" | "localizations"> {
29
+ dateLocales: SurveyEditorDateLocales;
30
+ localizations: LocalizationCatalog;
31
+ }
32
+ export declare const ResolvedSurveyEditorConfigProvider: React.FC<ResolvedSurveyEditorConfigProviderProps>;
24
33
  export declare const SurveyEditorConfigProvider: React.FC<SurveyEditorConfigProviderProps>;
25
34
  export declare const useSurveyEditorConfig: () => SurveyEditorConfigType;
26
35
  export declare const useSurveyEditorAIProvider: () => SurveyEditorAIProvider | null;
27
- export declare const useEditorTranslation: (namespace?: string) => ((key: string, values?: EditorTranslationValues) => string);
36
+ export declare const useEditorTranslation: (namespace?: string) => ((key: string, values?: LocalizationValues) => string);
28
37
  export declare const useEditorDateLocale: () => Locale;
29
38
  export {};
@@ -1,24 +1,36 @@
1
+ import { ReactNode } from 'react';
1
2
  import { SerializedSurveyEditor } from '@case-framework/survey-core/editor';
2
3
  import { EditorStateChangePayload } from './hooks/useEditorStateChange';
3
4
  import { SurveyEditorNavigationAdapter } from './navigation/types';
5
+ import { SurveyEditorAssistantController } from './assistant';
4
6
  import { ItemCategory, ItemLocaleMap, ItemRegistryEntry } from './registry';
5
7
  import { SurveyEditorAIProvider } from './ai/types';
6
- import { SurveyEditorDateLocales, SurveyEditorLocalizations } from './localization';
8
+ import { LocalizationCatalog } from '@case-framework/ui-localization';
9
+ import { SurveyEditorDateLocales } from './localization/date-fns';
10
+ import { SurveyEditorWorkspace } from './workspace';
7
11
  export type SurveyEditorStateChange = EditorStateChangePayload;
8
12
  export interface SurveyEditorProps {
9
13
  initialEditorState?: SerializedSurveyEditor;
10
14
  initialSessionId?: string;
11
15
  fallbackLocale?: string;
12
16
  language?: string;
13
- localizations?: SurveyEditorLocalizations;
17
+ localizations?: LocalizationCatalog;
14
18
  dateLocales?: SurveyEditorDateLocales;
15
19
  itemRegistryEntries?: ItemRegistryEntry[];
16
20
  /** Override or extend default add-item category headings (merged with built-in defaults). */
17
21
  categoryLabels?: Partial<Record<ItemCategory, ItemLocaleMap>>;
18
22
  onEditorStateChange?: (change: SurveyEditorStateChange) => void;
23
+ /** Prevent user-authored survey mutations while preserving preview and navigation. */
24
+ readOnly?: boolean;
25
+ /** Optional imperative bridge for a survey assistant host. */
26
+ assistantControllerRef?: React.Ref<SurveyEditorAssistantController | null>;
27
+ /** Optional host-rendered assistant UI shown in the editor workspace. */
28
+ assistantPanel?: ReactNode;
19
29
  persistDebounceMs?: number;
20
30
  helpLink?: string;
21
31
  navigationAdapter?: SurveyEditorNavigationAdapter | null;
32
+ /** Configure the initial main panel and workspace panels. */
33
+ workspace?: SurveyEditorWorkspace;
22
34
  aiProvider?: SurveyEditorAIProvider | null;
23
35
  onBackRequested?: () => void;
24
36
  onSimulatorRequested?: () => void;
@@ -0,0 +1,17 @@
1
+ import { SurveyEditorLocation } from './navigation/types';
2
+ export interface SurveyEditorWorkspacePanelOptions {
3
+ /** Whether the panel is visible when this editor is first opened. */
4
+ defaultOpen?: boolean;
5
+ }
6
+ /** Initial layout for a SurveyEditor instance. */
7
+ export interface SurveyEditorWorkspace {
8
+ /**
9
+ * The main panel shown when no navigation adapter is supplied.
10
+ * Defaults to the survey preview.
11
+ */
12
+ initialLocation?: SurveyEditorLocation;
13
+ panels?: {
14
+ outline?: SurveyEditorWorkspacePanelOptions;
15
+ assistant?: SurveyEditorWorkspacePanelOptions;
16
+ };
17
+ }
@@ -2,4 +2,3 @@ export { SurveyPlayer } from './survey-player';
2
2
  export { SurveyContextProvider, useSurveyCtx, useSurveyTranslation, type SurveyContextProviderProps, } from './survey-context';
3
3
  export { SurveyItemRenderer, type SurveyItemRendererProps } from './survey-item/survey-item';
4
4
  export type { SurveyPlayerProps } from './survey-player';
5
- export type { SurveyPlayerLocalizationMessages, SurveyPlayerLocalizations, SurveyPlayerTranslate, SurveyPlayerTranslationValue, SurveyPlayerTranslationValues, } from './localization/types';
@@ -1,3 +1,3 @@
1
- import { SurveyPlayerLocalizations } from './types';
1
+ import { LocalizationCatalog } from '@case-framework/ui-localization';
2
2
  export declare const DEFAULT_SURVEY_PLAYER_LANGUAGE = "en";
3
- export declare const defaultSurveyPlayerLocalizations: SurveyPlayerLocalizations;
3
+ export declare const defaultSurveyPlayerLocalizations: LocalizationCatalog;
@@ -1,4 +1,5 @@
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;
1
+ import { LocalizationCatalog, LocalizationTranslate } from '@case-framework/ui-localization';
2
+ export declare const mergeSurveyPlayerLocalizations: (...sources: Array<LocalizationCatalog | undefined>) => LocalizationCatalog;
3
+ export declare const mergeSurveyPlayerLocalizationSources: (...sources: Array<LocalizationCatalog | undefined>) => LocalizationCatalog;
4
+ export declare const createSurveyTranslator: (language: string, localizations: LocalizationCatalog) => LocalizationTranslate;
5
+ export declare const createNamespacedSurveyTranslator: (translate: LocalizationTranslate, namespace?: string) => LocalizationTranslate;
@@ -1,7 +1,7 @@
1
1
  import { default as React } from 'react';
2
2
  import { Survey, SurveyEngineCore } from '@case-framework/survey-core';
3
3
  import { SurveyPlayerItemRegistry } from '../../../modules/survey-editor/registry';
4
- import { SurveyPlayerLocalizations, SurveyPlayerTranslate } from './localization/types';
4
+ import { LocalizationCatalog, LocalizationTranslate } from '@case-framework/ui-localization';
5
5
  export type HandlerFuncArgType = string | number | boolean | null | undefined;
6
6
  export type HandlerFunction = (handlerId: string, args?: HandlerFuncArgType[]) => Promise<{
7
7
  error?: string;
@@ -14,19 +14,24 @@ interface SurveyContextValue {
14
14
  surveyPlayerRegistry?: SurveyPlayerItemRegistry;
15
15
  runExternalHandler?: HandlerFunction;
16
16
  onResponseChanged?: () => void;
17
- translate: SurveyPlayerTranslate;
17
+ translate: LocalizationTranslate;
18
18
  }
19
+ interface ResolvedSurveyContextProviderProps extends Omit<SurveyContextProviderProps, "localizations" | "surveyPlayerRegistry"> {
20
+ surveyPlayerRegistry?: SurveyPlayerItemRegistry;
21
+ translate: LocalizationTranslate;
22
+ }
23
+ export declare const ResolvedSurveyContextProvider: React.FC<ResolvedSurveyContextProviderProps>;
19
24
  export interface SurveyContextProviderProps {
20
25
  survey: Survey;
21
26
  locale: string;
22
27
  surveyEngine: SurveyEngineCore;
23
28
  surveyPlayerRegistry?: SurveyPlayerItemRegistry;
24
- localizations?: SurveyPlayerLocalizations;
29
+ localizations?: LocalizationCatalog;
25
30
  children: React.ReactNode;
26
31
  onRunExternalHandler?: HandlerFunction;
27
32
  onResponseChanged?: () => void;
28
33
  }
29
34
  export declare const SurveyContextProvider: React.FC<SurveyContextProviderProps>;
30
35
  export declare const useSurveyCtx: () => SurveyContextValue;
31
- export declare const useSurveyTranslation: (namespace?: string) => SurveyPlayerTranslate;
36
+ export declare const useSurveyTranslation: (namespace?: string) => LocalizationTranslate;
32
37
  export {};
@@ -1,13 +1,13 @@
1
1
  import { Survey, SurveyEngineCore, ScreenSize, SurveyItemResponse } from '@case-framework/survey-core';
2
2
  import { SurveyPlayerItemRegistry } from '../../../modules/survey-editor/registry';
3
- import { SurveyPlayerLocalizations } from './localization/types';
3
+ import { LocalizationCatalog } from '@case-framework/ui-localization';
4
4
  export interface SurveyPlayerProps {
5
5
  survey: Survey;
6
6
  locale?: string;
7
7
  size?: ScreenSize;
8
8
  surveyEngine?: SurveyEngineCore;
9
9
  surveyPlayerRegistry?: SurveyPlayerItemRegistry;
10
- localizations?: SurveyPlayerLocalizations;
10
+ localizations?: LocalizationCatalog;
11
11
  onSubmit?: (responses: SurveyItemResponse[], surveyEngine: SurveyEngineCore) => void;
12
12
  className?: string;
13
13
  }