@case-framework/survey-ui 0.6.2 → 0.8.0
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.
- package/README.md +40 -34
- package/dist/src/index.d.ts +7 -13
- package/dist/src/lib/survey-assets.d.ts +2 -0
- package/dist/src/modules/survey-player/index.d.ts +2 -0
- package/dist/src/modules/survey-player/registry.d.ts +23 -0
- package/dist/src/modules/survey-player/survey-context.d.ts +1 -1
- package/dist/src/modules/survey-player/survey-item/survey-item-types/placeholder-item-renderers.d.ts +1 -1
- package/dist/src/modules/survey-player/survey-player.d.ts +1 -1
- package/dist/survey-ui.cjs +47 -0
- package/dist/survey-ui.cjs.map +1 -0
- package/dist/survey-ui.css +1 -1
- package/dist/survey-ui.js +14136 -0
- package/dist/survey-ui.js.map +1 -0
- package/package.json +25 -64
- package/dist/default-item-cores-C6VK2LFe.js +0 -10
- package/dist/default-item-cores-C6VK2LFe.js.map +0 -1
- package/dist/default-item-cores-gdu37TFX.mjs +0 -3988
- package/dist/default-item-cores-gdu37TFX.mjs.map +0 -1
- package/dist/item-core-registry.cjs.js +0 -2
- package/dist/item-core-registry.cjs.js.map +0 -1
- package/dist/item-core-registry.es.js +0 -11
- package/dist/item-core-registry.es.js.map +0 -1
- package/dist/src/components/c-ui/alert-provider.d.ts +0 -18
- package/dist/src/components/c-ui/dot-background.d.ts +0 -72
- package/dist/src/components/c-ui/filepicker-dropzone.d.ts +0 -38
- package/dist/src/components/c-ui/loading-button.d.ts +0 -9
- package/dist/src/components/common/content-editable-plain.d.ts +0 -17
- package/dist/src/components/common/sortable-tree.d.ts +0 -59
- package/dist/src/components/hooks/use-button-shortcut.d.ts +0 -18
- package/dist/src/components/hooks/use-document-keydown.d.ts +0 -7
- package/dist/src/components/rich-text/content-policy.d.ts +0 -19
- package/dist/src/components/rich-text/index.d.ts +0 -6
- package/dist/src/components/rich-text/nodes/rich-text-image-node.d.ts +0 -40
- package/dist/src/components/rich-text/nodes/rich-text-info-box-node.d.ts +0 -45
- package/dist/src/components/rich-text/nodes/survey-rich-text-heading-node.d.ts +0 -27
- package/dist/src/components/rich-text/rich-text-block-editor.d.ts +0 -8
- package/dist/src/components/rich-text/rich-text-editor-context.d.ts +0 -23
- package/dist/src/components/rich-text/rich-text-survey-content.d.ts +0 -7
- package/dist/src/components/rich-text/types.d.ts +0 -6
- package/dist/src/components/rich-text-editor/index.d.ts +0 -3
- package/dist/src/components/rich-text-editor/plugins/command-handler-plugin.d.ts +0 -5
- package/dist/src/components/rich-text-editor/plugins/editable-mode-plugin.d.ts +0 -3
- package/dist/src/components/rich-text-editor/plugins/floating-toolbar-plugin.d.ts +0 -11
- package/dist/src/components/rich-text-editor/plugins/image-dialog-plugin.d.ts +0 -4
- package/dist/src/components/rich-text-editor/plugins/info-box-popover-plugin.d.ts +0 -6
- package/dist/src/components/rich-text-editor/plugins/link-popover-plugin.d.ts +0 -6
- package/dist/src/components/rich-text-editor/plugins/rich-text-image-asset-deletion-plugin.d.ts +0 -1
- package/dist/src/components/rich-text-editor/plugins/slash-command-menu-plugin.d.ts +0 -15
- package/dist/src/components/rich-text-editor/plugins/sync-editor-value-plugin.d.ts +0 -4
- package/dist/src/components/rich-text-editor/rich-text-editor-utils.d.ts +0 -205
- package/dist/src/components/rich-text-editor/rich-text-editor.d.ts +0 -43
- package/dist/src/components/rich-text-editor/rich-text-image-editor-commands.d.ts +0 -12
- package/dist/src/components/rich-text-editor/rich-text-info-box-commands.d.ts +0 -20
- package/dist/src/components/rich-text-editor/style-control-icon.d.ts +0 -5
- package/dist/src/components/ui/alert.d.ts +0 -10
- package/dist/src/components/ui/badge.d.ts +0 -9
- package/dist/src/components/ui/breadcrumb.d.ts +0 -11
- package/dist/src/components/ui/card.d.ts +0 -11
- package/dist/src/components/ui/command.d.ts +0 -18
- package/dist/src/components/ui/context-menu.d.ts +0 -31
- package/dist/src/components/ui/dialog.d.ts +0 -20
- package/dist/src/components/ui/dropdown-menu.d.ts +0 -29
- package/dist/src/components/ui/kbd.d.ts +0 -3
- package/dist/src/components/ui/resizable.d.ts +0 -7
- package/dist/src/components/ui/scroll-area.d.ts +0 -5
- package/dist/src/components/ui/skeleton.d.ts +0 -2
- package/dist/src/components/ui/sonner.d.ts +0 -3
- package/dist/src/components/ui/tabs.d.ts +0 -11
- package/dist/src/components/ui/toggle-group.d.ts +0 -10
- package/dist/src/components/ui/toggle.d.ts +0 -9
- package/dist/src/components/ui/tooltip.d.ts +0 -7
- package/dist/src/dev/_components/nav-input.d.ts +0 -35
- package/dist/src/dev/app.d.ts +0 -2
- package/dist/src/dev/localizations/de.d.ts +0 -2
- package/dist/src/dev/main.d.ts +0 -0
- package/dist/src/item-core-registry.d.ts +0 -4
- package/dist/src/modules/default-item-registry/default-registry-entries.d.ts +0 -2
- package/dist/src/modules/default-item-registry/index.d.ts +0 -19
- package/dist/src/modules/default-item-registry/item-authoring-state.d.ts +0 -15
- package/dist/src/modules/default-item-registry/items/choice/editor/card.d.ts +0 -3
- package/dist/src/modules/default-item-registry/items/choice/editor/option-create.d.ts +0 -11
- package/dist/src/modules/default-item-registry/items/choice/editor/option-edit-dialog.d.ts +0 -21
- package/dist/src/modules/default-item-registry/items/choice/editor/option-editor-fields.d.ts +0 -17
- package/dist/src/modules/default-item-registry/items/choice/editor/response-options-list.d.ts +0 -20
- package/dist/src/modules/default-item-registry/items/choice/expression-registry.d.ts +0 -3
- package/dist/src/modules/default-item-registry/items/choice/preview/item.d.ts +0 -2
- package/dist/src/modules/default-item-registry/items/choice/search-adapter.d.ts +0 -2
- package/dist/src/modules/default-item-registry/items/form/editor/card.d.ts +0 -3
- package/dist/src/modules/default-item-registry/items/form/editor/config-editor.d.ts +0 -12
- package/dist/src/modules/default-item-registry/items/form/editor/field-edit-dialog.d.ts +0 -10
- package/dist/src/modules/default-item-registry/items/form/editor/field-group-header-dialog.d.ts +0 -12
- package/dist/src/modules/default-item-registry/items/form/editor/field-group-layout-dialog.d.ts +0 -9
- package/dist/src/modules/default-item-registry/items/form/editor/field-item-preview.d.ts +0 -15
- package/dist/src/modules/default-item-registry/items/form/editor/field-key-dialog.d.ts +0 -10
- package/dist/src/modules/default-item-registry/items/form/editor/field-sort-dialog.d.ts +0 -11
- package/dist/src/modules/default-item-registry/items/form/editor/field-type-shared.d.ts +0 -12
- package/dist/src/modules/default-item-registry/items/form/editor/response-field-groups-list.d.ts +0 -16
- package/dist/src/modules/default-item-registry/items/form/preview/item.d.ts +0 -2
- package/dist/src/modules/default-item-registry/items/form/search-adapter.d.ts +0 -2
- package/dist/src/modules/default-item-registry/items/info/editor-card.d.ts +0 -3
- package/dist/src/modules/default-item-registry/items/info/preview/item.d.ts +0 -2
- package/dist/src/modules/default-item-registry/items/info/search-adapter.d.ts +0 -2
- package/dist/src/modules/default-item-registry/items/structure/group/editor-card.d.ts +0 -3
- package/dist/src/modules/default-item-registry/items/structure/page-break/editor-card.d.ts +0 -3
- package/dist/src/modules/default-item-registry/items/structure/preview-renderers.d.ts +0 -3
- package/dist/src/modules/default-item-registry/items/structure/root/editor-card.d.ts +0 -3
- package/dist/src/modules/default-item-registry/shared/preview/question-header.d.ts +0 -6
- package/dist/src/modules/default-item-registry/shared/preview/utils.d.ts +0 -3
- package/dist/src/modules/default-item-registry/shared/question-editor/deferred-localized-rich-text-field.d.ts +0 -26
- package/dist/src/modules/default-item-registry/shared/question-editor/header-editor.d.ts +0 -6
- package/dist/src/modules/default-item-registry/shared/question-editor/layout.d.ts +0 -8
- package/dist/src/modules/default-item-registry/shared/question-editor/rich-text-editors.d.ts +0 -23
- package/dist/src/modules/default-item-registry/shared/question-editor/rich-text-policies.d.ts +0 -8
- package/dist/src/modules/default-item-registry/shared/question-editor/toolbar.d.ts +0 -10
- package/dist/src/modules/survey-editor/ai/create-provider.d.ts +0 -22
- package/dist/src/modules/survey-editor/ai/types.d.ts +0 -11
- package/dist/src/modules/survey-editor/ai/use-survey-assistant-integration.d.ts +0 -16
- package/dist/src/modules/survey-editor/assets/index.d.ts +0 -4
- package/dist/src/modules/survey-editor/assets/survey-image-asset-manager.d.ts +0 -4
- package/dist/src/modules/survey-editor/assets/use-survey-assets.d.ts +0 -4
- package/dist/src/modules/survey-editor/assets/utils.d.ts +0 -5
- package/dist/src/modules/survey-editor/assistant/apply.d.ts +0 -24
- package/dist/src/modules/survey-editor/assistant/index.d.ts +0 -2
- package/dist/src/modules/survey-editor/assistant/snapshot.d.ts +0 -39
- package/dist/src/modules/survey-editor/editor-card/add-items/constants.d.ts +0 -5
- package/dist/src/modules/survey-editor/editor-card/add-items/hooks/use-add-item-actions.d.ts +0 -24
- package/dist/src/modules/survey-editor/editor-card/add-items/hooks/use-add-item-target.d.ts +0 -9
- package/dist/src/modules/survey-editor/editor-card/add-items/hooks/use-option-group-navigation.d.ts +0 -20
- package/dist/src/modules/survey-editor/editor-card/add-items/types.d.ts +0 -21
- package/dist/src/modules/survey-editor/editor-card/add-items/views/back-button.d.ts +0 -5
- package/dist/src/modules/survey-editor/editor-card/add-items/views/blank-item-view.d.ts +0 -13
- package/dist/src/modules/survey-editor/editor-card/add-items/views/entry-view.d.ts +0 -15
- package/dist/src/modules/survey-editor/editor-card/add-items/views/item-type-grid-view.d.ts +0 -30
- package/dist/src/modules/survey-editor/editor-card/add-items/views/structure-view.d.ts +0 -16
- package/dist/src/modules/survey-editor/editor-card/add-items.d.ts +0 -1
- package/dist/src/modules/survey-editor/editor-card/copy-item-dropdown-menu.d.ts +0 -5
- package/dist/src/modules/survey-editor/editor-card/delete-item-context-menu.d.ts +0 -5
- package/dist/src/modules/survey-editor/editor-card/delete-item-dropdown-menu.d.ts +0 -7
- package/dist/src/modules/survey-editor/editor-card/editor-card-tab-trigger.d.ts +0 -15
- package/dist/src/modules/survey-editor/editor-card/expression-pseudo-code.d.ts +0 -8
- package/dist/src/modules/survey-editor/editor-card/group-items.d.ts +0 -2
- package/dist/src/modules/survey-editor/editor-card/hooks/use-armed-shortcut-sequence.d.ts +0 -11
- package/dist/src/modules/survey-editor/editor-card/hooks/use-group-list-keyboard.d.ts +0 -30
- package/dist/src/modules/survey-editor/editor-card/index.d.ts +0 -2
- package/dist/src/modules/survey-editor/editor-card/item-authoring-state-preview.d.ts +0 -16
- package/dist/src/modules/survey-editor/editor-card/item-color-menu.d.ts +0 -6
- package/dist/src/modules/survey-editor/editor-card/item-color-selector.d.ts +0 -5
- package/dist/src/modules/survey-editor/editor-card/item-editor-card-skeleton.d.ts +0 -2
- package/dist/src/modules/survey-editor/editor-card/item-editor-card.d.ts +0 -34
- package/dist/src/modules/survey-editor/editor-card/item-editor-context.d.ts +0 -23
- package/dist/src/modules/survey-editor/editor-card/item-expression-overview.d.ts +0 -33
- package/dist/src/modules/survey-editor/editor-card/item-key-editor.d.ts +0 -9
- package/dist/src/modules/survey-editor/editor-card/item-label-preview-and-editor.d.ts +0 -10
- package/dist/src/modules/survey-editor/editor-card/item-preview.d.ts +0 -8
- package/dist/src/modules/survey-editor/editor-card/item-sibling-navigation.d.ts +0 -5
- package/dist/src/modules/survey-editor/editor-card/item-type-icon-with-tooltip.d.ts +0 -8
- package/dist/src/modules/survey-editor/editor-card/survey-player-item-preview.d.ts +0 -6
- package/dist/src/modules/survey-editor/editor-instance-provider.d.ts +0 -9
- package/dist/src/modules/survey-editor/hooks/useClipboardValue.d.ts +0 -2
- package/dist/src/modules/survey-editor/hooks/useDeleteItem.d.ts +0 -11
- package/dist/src/modules/survey-editor/hooks/useEditor.d.ts +0 -12
- package/dist/src/modules/survey-editor/hooks/useEditorStateChange.d.ts +0 -18
- package/dist/src/modules/survey-editor/hooks/useKeyboardShortcuts.d.ts +0 -7
- package/dist/src/modules/survey-editor/index.d.ts +0 -20
- package/dist/src/modules/survey-editor/localization/date-fns.d.ts +0 -5
- package/dist/src/modules/survey-editor/localization/default-all.d.ts +0 -2
- package/dist/src/modules/survey-editor/localization/default-en.d.ts +0 -3
- package/dist/src/modules/survey-editor/localization/default-nl.d.ts +0 -2
- package/dist/src/modules/survey-editor/localization/index.d.ts +0 -5
- package/dist/src/modules/survey-editor/localization/runtime.d.ts +0 -4
- package/dist/src/modules/survey-editor/navigation/location.d.ts +0 -6
- package/dist/src/modules/survey-editor/navigation/navigation-provider.d.ts +0 -12
- package/dist/src/modules/survey-editor/navigation/navigation.d.ts +0 -22
- package/dist/src/modules/survey-editor/navigation/types.d.ts +0 -23
- package/dist/src/modules/survey-editor/primitives/input-with-ai-popover.d.ts +0 -35
- package/dist/src/modules/survey-editor/registry/authoring-state.d.ts +0 -17
- package/dist/src/modules/survey-editor/registry/index.d.ts +0 -8
- package/dist/src/modules/survey-editor/registry/registry-mappers.d.ts +0 -25
- package/dist/src/modules/survey-editor/registry/search-adapter.d.ts +0 -19
- package/dist/src/modules/survey-editor/registry/types.d.ts +0 -218
- package/dist/src/modules/survey-editor/routes/editor/_components/assistant-authoring-lock.d.ts +0 -7
- package/dist/src/modules/survey-editor/routes/editor/_components/editor-assistant-slot-context.d.ts +0 -6
- package/dist/src/modules/survey-editor/routes/editor/_components/editor-assistant-slot.d.ts +0 -8
- package/dist/src/modules/survey-editor/routes/editor/_components/editor-mode-switch.d.ts +0 -7
- package/dist/src/modules/survey-editor/routes/editor/_components/editor-workspace.d.ts +0 -30
- package/dist/src/modules/survey-editor/routes/editor/_components/footer.d.ts +0 -2
- package/dist/src/modules/survey-editor/routes/editor/_components/history-stack.d.ts +0 -2
- package/dist/src/modules/survey-editor/routes/editor/_components/main.d.ts +0 -7
- package/dist/src/modules/survey-editor/routes/editor/_components/workspace-presets.d.ts +0 -75
- package/dist/src/modules/survey-editor/routes/editor/asset-manager/index.d.ts +0 -2
- package/dist/src/modules/survey-editor/routes/editor/index.d.ts +0 -7
- package/dist/src/modules/survey-editor/routes/editor/item-editor/_components/item-editor-toolbar/breadcrumbs-nav.d.ts +0 -2
- package/dist/src/modules/survey-editor/routes/editor/item-editor/_components/item-editor-toolbar/item-editor-toolbar.d.ts +0 -6
- package/dist/src/modules/survey-editor/routes/editor/item-editor/_components/item-editor-toolbar/language-picker.d.ts +0 -2
- package/dist/src/modules/survey-editor/routes/editor/item-editor/_components/item-editor-toolbar/search-trigger.d.ts +0 -3
- package/dist/src/modules/survey-editor/routes/editor/item-editor/_components/item-editor-toolbar/survey-search.d.ts +0 -7
- package/dist/src/modules/survey-editor/routes/editor/item-editor/_components/survey-outline.d.ts +0 -3
- package/dist/src/modules/survey-editor/routes/editor/item-editor/_components/survey-workspace.d.ts +0 -12
- package/dist/src/modules/survey-editor/routes/editor/item-editor/index.d.ts +0 -6
- package/dist/src/modules/survey-editor/routes/editor/preview-mode/index.d.ts +0 -7
- package/dist/src/modules/survey-editor/routes/editor/preview-mode/page-break-divider.d.ts +0 -6
- package/dist/src/modules/survey-editor/routes/editor/preview-mode/preview-controls.d.ts +0 -15
- package/dist/src/modules/survey-editor/routes/editor/preview-mode/preview-tree.d.ts +0 -26
- package/dist/src/modules/survey-editor/routes/editor/preview-mode/survey-preview-canvas.d.ts +0 -16
- package/dist/src/modules/survey-editor/routes/editor/preview-mode/survey-preview-item.d.ts +0 -13
- package/dist/src/modules/survey-editor/routes/editor/preview-mode/use-preview-preferences.d.ts +0 -14
- package/dist/src/modules/survey-editor/routes/editor/translation-mode/index.d.ts +0 -2
- package/dist/src/modules/survey-editor/session-file.d.ts +0 -13
- package/dist/src/modules/survey-editor/store/editor-store-context.d.ts +0 -10
- package/dist/src/modules/survey-editor/store/editor-store-provider.d.ts +0 -7
- package/dist/src/modules/survey-editor/store/editor-store.d.ts +0 -109
- package/dist/src/modules/survey-editor/store/use-editor-store.d.ts +0 -4
- package/dist/src/modules/survey-editor/store/useItemNavigation.d.ts +0 -7
- package/dist/src/modules/survey-editor/survey-editor-config.d.ts +0 -38
- package/dist/src/modules/survey-editor/survey-editor.d.ts +0 -40
- package/dist/src/modules/survey-editor/utils/item-type-infos.d.ts +0 -23
- package/dist/src/modules/survey-editor/workspace.d.ts +0 -17
- package/dist/src/modules/survey-player/survey-item/survey-item-types/question-wrapper.d.ts +0 -5
- package/dist/survey-editor-animations.css +0 -87
- package/dist/survey-editor-animations.css.d.ts +0 -2
- package/dist/survey-editor-defaults.css +0 -15
- package/dist/survey-editor-defaults.css.d.ts +0 -2
- package/dist/survey-ui.cjs.js +0 -199
- package/dist/survey-ui.cjs.js.map +0 -1
- package/dist/survey-ui.es.js +0 -57954
- package/dist/survey-ui.es.js.map +0 -1
- package/dist/vite.svg +0 -1
- /package/dist/src/{components/rich-text/rich-text-link-utils.d.ts → lib/rich-text-link-url.d.ts} +0 -0
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
import { AnyItemExpressionDefinition, ItemTypeRegistry, SurveyItemCore } from '@case-framework/survey-core';
|
|
2
|
-
import { ComposedEditorItemRegistry, EditorItemDefinition, EntriesToComposedEditorRegistryOptions, EntriesToParticipantRegistryOptions, ItemCategory, ItemLocaleMap, ItemRegistryEntry, RegistryValidationOptions, RegistryValidationResult, SurveyPlayerItemRegistry } from './types';
|
|
3
|
-
import { LocalizationCatalog } from '@case-framework/ui-localization';
|
|
4
|
-
export declare function mergeCategoryLabelOverrides(base?: Partial<Record<ItemCategory, ItemLocaleMap>>, overrides?: Partial<Record<ItemCategory, ItemLocaleMap>>): Partial<Record<ItemCategory, ItemLocaleMap>> | undefined;
|
|
5
|
-
export declare function validateRegistryEntries(entries: ItemRegistryEntry[], options: RegistryValidationOptions): RegistryValidationResult;
|
|
6
|
-
/**
|
|
7
|
-
* Derive ItemTypeRegistry from unified entries for Survey / SurveyEditor.
|
|
8
|
-
* Uses built-in registry for group/pageBreak; plugin entries supply constructors for custom types.
|
|
9
|
-
*/
|
|
10
|
-
export declare function entriesToItemTypeRegistry(entries: ItemRegistryEntry[]): ItemTypeRegistry;
|
|
11
|
-
/**
|
|
12
|
-
* Derive participant registry from unified entries.
|
|
13
|
-
* Lightweight: core + renderer only. Use this for survey player / participant app.
|
|
14
|
-
*/
|
|
15
|
-
export declare function entriesToParticipantRegistry(entries: ItemRegistryEntry[], options?: EntriesToParticipantRegistryOptions): SurveyPlayerItemRegistry;
|
|
16
|
-
export declare function localizeRegistryEntries(entries: ItemRegistryEntry[], localizations?: LocalizationCatalog): ItemRegistryEntry[];
|
|
17
|
-
export declare function getCategoryLabelsFromLocalizations(localizations?: LocalizationCatalog): Partial<Record<ItemCategory, ItemLocaleMap>> | undefined;
|
|
18
|
-
/**
|
|
19
|
-
* Derive ComposedEditorItemRegistry from unified entries for the editor.
|
|
20
|
-
* Ensures Group and PageBreak have definitions; uses coreRegistry from entries.
|
|
21
|
-
*/
|
|
22
|
-
export declare function entriesToComposedEditorRegistry(entries: ItemRegistryEntry[], options?: EntriesToComposedEditorRegistryOptions): ComposedEditorItemRegistry;
|
|
23
|
-
export declare function getRegistryEntryForItem(registry: ComposedEditorItemRegistry, item: SurveyItemCore): EditorItemDefinition | undefined;
|
|
24
|
-
export declare function getItemExpressionDefinitionsForType(registry: ComposedEditorItemRegistry, itemType: string): AnyItemExpressionDefinition[];
|
|
25
|
-
export declare function getItemExpressionDefinitionsForItem(registry: ComposedEditorItemRegistry, item: SurveyItemCore): AnyItemExpressionDefinition[];
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
import { Survey } from '@case-framework/survey-core';
|
|
2
|
-
export declare const SearchMatchType: {
|
|
3
|
-
readonly Content: "content";
|
|
4
|
-
readonly Label: "label";
|
|
5
|
-
readonly Key: "key";
|
|
6
|
-
readonly ItemType: "itemType";
|
|
7
|
-
};
|
|
8
|
-
export type SearchMatchType = (typeof SearchMatchType)[keyof typeof SearchMatchType];
|
|
9
|
-
export interface EditorItemSearchResult {
|
|
10
|
-
matchType: SearchMatchType;
|
|
11
|
-
matchText: string;
|
|
12
|
-
}
|
|
13
|
-
export interface ItemSearchAdapterContext {
|
|
14
|
-
itemId: string;
|
|
15
|
-
survey: Survey;
|
|
16
|
-
searchTerm: string;
|
|
17
|
-
}
|
|
18
|
-
export type ItemSearchAdapter = (ctx: ItemSearchAdapterContext) => EditorItemSearchResult[] | undefined;
|
|
19
|
-
export declare const defaultSearchAdapter: ItemSearchAdapter;
|
|
@@ -1,218 +0,0 @@
|
|
|
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 { AssistantItemCapabilityAdapter, SurveyAssistantCapabilitySet } from '@case-framework/survey-assistant/engine';
|
|
5
|
-
import { LocalizationCatalog } from '@case-framework/ui-localization';
|
|
6
|
-
import { ItemSearchAdapter } from './search-adapter';
|
|
7
|
-
export type ItemCategory = string;
|
|
8
|
-
export type ItemLocaleMap = Record<string, string>;
|
|
9
|
-
export type ItemIconComponent = React.ComponentType<{
|
|
10
|
-
className?: string;
|
|
11
|
-
}>;
|
|
12
|
-
export interface ItemEditorComponentProps<TItem extends SurveyItemCore = SurveyItemCore> {
|
|
13
|
-
item: TItem;
|
|
14
|
-
}
|
|
15
|
-
export interface ItemRendererComponentProps {
|
|
16
|
-
renderedItem: RenderedSurveyItem;
|
|
17
|
-
}
|
|
18
|
-
export type ItemPreviewMode = "interactive" | "static";
|
|
19
|
-
export declare const ItemAuthoringStates: {
|
|
20
|
-
readonly blank: "blank";
|
|
21
|
-
readonly incomplete: "incomplete";
|
|
22
|
-
readonly ready: "ready";
|
|
23
|
-
};
|
|
24
|
-
export type ItemAuthoringState = (typeof ItemAuthoringStates)[keyof typeof ItemAuthoringStates];
|
|
25
|
-
export interface ItemPreviewComponentProps<TItem extends SurveyItemCore = SurveyItemCore> {
|
|
26
|
-
item: TItem;
|
|
27
|
-
itemConfig: TItem["config"];
|
|
28
|
-
itemContent?: SurveyItemTranslations;
|
|
29
|
-
locale: string;
|
|
30
|
-
mode?: ItemPreviewMode;
|
|
31
|
-
}
|
|
32
|
-
export interface ItemAuthoringStateContext<TItem extends SurveyItemCore = SurveyItemCore> {
|
|
33
|
-
item: TItem;
|
|
34
|
-
itemContent?: SurveyItemTranslations;
|
|
35
|
-
/** All locales available to the survey, used for locale-independent readiness checks. */
|
|
36
|
-
locales: string[];
|
|
37
|
-
locale: string;
|
|
38
|
-
}
|
|
39
|
-
export interface ItemEditorCapabilities {
|
|
40
|
-
usesValidationPanel?: boolean;
|
|
41
|
-
usesTranslationPanel?: boolean;
|
|
42
|
-
usesConditionsPanel?: boolean;
|
|
43
|
-
}
|
|
44
|
-
export interface ItemInitialData {
|
|
45
|
-
rawItem: RawSurveyItem;
|
|
46
|
-
translations?: SurveyItemTranslations;
|
|
47
|
-
children?: ItemInitialData[];
|
|
48
|
-
}
|
|
49
|
-
export interface ItemInfos {
|
|
50
|
-
icon: ItemIconComponent;
|
|
51
|
-
labelByLocale: ItemLocaleMap;
|
|
52
|
-
descriptionByLocale: ItemLocaleMap;
|
|
53
|
-
/**
|
|
54
|
-
* Optional recommendation shown when an author opens an empty survey preview.
|
|
55
|
-
* Entries are ordered by rank, allowing host registries to curate a simple first-step menu.
|
|
56
|
-
*/
|
|
57
|
-
gettingStarted?: {
|
|
58
|
-
rank: number;
|
|
59
|
-
descriptionByLocale?: ItemLocaleMap;
|
|
60
|
-
};
|
|
61
|
-
defaultItemClassName?: string;
|
|
62
|
-
categories: ItemCategory[];
|
|
63
|
-
}
|
|
64
|
-
export interface CreateItemContext {
|
|
65
|
-
editor: {
|
|
66
|
-
addItem: (target: Target, item: SurveyItemCore, content?: SurveyItemTranslations) => void;
|
|
67
|
-
};
|
|
68
|
-
targetParentId: string;
|
|
69
|
-
targetIndex?: number;
|
|
70
|
-
defaultItemKey: string;
|
|
71
|
-
constructor: ItemCoreConstructor;
|
|
72
|
-
}
|
|
73
|
-
export interface EditorItemDefinition {
|
|
74
|
-
itemType: string;
|
|
75
|
-
infos: ItemInfos;
|
|
76
|
-
/** Optional assistant support for this item type. */
|
|
77
|
-
assistantCapability?: AssistantItemCapabilityAdapter;
|
|
78
|
-
defaultItemKeyPrefix?: string;
|
|
79
|
-
editorComponent?: React.ComponentType<ItemEditorComponentProps>;
|
|
80
|
-
renderComponent?: React.ComponentType<ItemRendererComponentProps>;
|
|
81
|
-
previewComponent?: React.ComponentType<ItemPreviewComponentProps>;
|
|
82
|
-
/**
|
|
83
|
-
* Returns the editor-only content-readiness state used instead of a participant preview.
|
|
84
|
-
* Omit it to use the metadata-based fallback.
|
|
85
|
-
*/
|
|
86
|
-
getAuthoringState?: (context: ItemAuthoringStateContext) => ItemAuthoringState;
|
|
87
|
-
capabilities?: ItemEditorCapabilities;
|
|
88
|
-
expressions?: AnyItemExpressionDefinition[];
|
|
89
|
-
isRootOnly?: boolean;
|
|
90
|
-
getInitialItem?: () => ItemInitialData;
|
|
91
|
-
createItem?: (ctx: CreateItemContext) => string;
|
|
92
|
-
searchAdapters?: ItemSearchAdapter[];
|
|
93
|
-
includeDefaultSearchAdapter?: boolean;
|
|
94
|
-
}
|
|
95
|
-
export type EditorItemDefinitionRegistry = Record<string, EditorItemDefinition>;
|
|
96
|
-
export interface ComposedEditorItemRegistry {
|
|
97
|
-
coreRegistry: ItemTypeRegistry;
|
|
98
|
-
definitions: EditorItemDefinitionRegistry;
|
|
99
|
-
/** Validated assistant capabilities, composed once with the registry. */
|
|
100
|
-
assistantCapabilities: SurveyAssistantCapabilitySet;
|
|
101
|
-
playerLocalizations: LocalizationCatalog;
|
|
102
|
-
/**
|
|
103
|
-
* Localized headings for category ids referenced in `ItemInfos.categories`.
|
|
104
|
-
* Built by `entriesToComposedEditorRegistry` (merged with {@link DEFAULT_CATEGORY_LABELS}).
|
|
105
|
-
*/
|
|
106
|
-
categoryLabels: Record<ItemCategory, ItemLocaleMap>;
|
|
107
|
-
}
|
|
108
|
-
/**
|
|
109
|
-
* Unified registry entry type, reusable across contexts:
|
|
110
|
-
*
|
|
111
|
-
* - Participant app: needs only `constructor` + `renderComponent`
|
|
112
|
-
* - Editor: needs constructor, infos, `previewComponent`, editorComponent, searchAdapters, etc.
|
|
113
|
-
*
|
|
114
|
-
* Use the mapper helpers to derive ItemTypeRegistry, participant registry, or editor registry.
|
|
115
|
-
*/
|
|
116
|
-
export interface ItemRegistryEntry {
|
|
117
|
-
itemType: string;
|
|
118
|
-
/** Optional assistant support, colocated with the item definition. */
|
|
119
|
-
assistantCapability?: AssistantItemCapabilityAdapter;
|
|
120
|
-
/** 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. */
|
|
121
|
-
constructor?: ItemCoreConstructor;
|
|
122
|
-
/** Participant renderer. Required for participant app. */
|
|
123
|
-
renderComponent?: React.ComponentType<ItemRendererComponentProps>;
|
|
124
|
-
/** Participant/player localization messages contributed by this entry. */
|
|
125
|
-
playerLocalizations?: LocalizationCatalog;
|
|
126
|
-
/** Editor-only: item preview renderer */
|
|
127
|
-
previewComponent?: React.ComponentType<ItemPreviewComponentProps>;
|
|
128
|
-
/** Editor-only: determines whether this item is ready for a participant-facing preview. */
|
|
129
|
-
getAuthoringState?: (context: ItemAuthoringStateContext) => ItemAuthoringState;
|
|
130
|
-
/** Editor-only: display metadata */
|
|
131
|
-
infos?: ItemInfos;
|
|
132
|
-
/** Editor-only: default prefix for auto-generated data names in a parent group. */
|
|
133
|
-
defaultItemKeyPrefix?: string;
|
|
134
|
-
/** Editor-only: card/editor UI */
|
|
135
|
-
editorComponent?: React.ComponentType<ItemEditorComponentProps>;
|
|
136
|
-
/** Shared: higher-level expression templates available for this item type. */
|
|
137
|
-
expressions?: AnyItemExpressionDefinition[];
|
|
138
|
-
/** Editor-only: search integration */
|
|
139
|
-
searchAdapters?: ItemSearchAdapter[];
|
|
140
|
-
/** Editor-only: include built-in key/label/itemType search adapter in addition to custom adapters. Defaults to true. */
|
|
141
|
-
includeDefaultSearchAdapter?: boolean;
|
|
142
|
-
/** Editor-only */
|
|
143
|
-
capabilities?: ItemEditorCapabilities;
|
|
144
|
-
/** Editor-only: default raw item when creating new */
|
|
145
|
-
getInitialItem?: () => ItemInitialData;
|
|
146
|
-
/** Editor-only: custom creation flow (advanced) */
|
|
147
|
-
createItem?: (ctx: CreateItemContext) => string;
|
|
148
|
-
/** Editor-only: hide from add-item options in non-root context */
|
|
149
|
-
isRootOnly?: boolean;
|
|
150
|
-
}
|
|
151
|
-
export type ItemRegistry = Record<string, ItemRegistryEntry>;
|
|
152
|
-
/** Participant registry: core + renderer per item type. Lightweight for survey player. */
|
|
153
|
-
export interface SurveyPlayerItemRegistry {
|
|
154
|
-
coreRegistry: ItemTypeRegistry;
|
|
155
|
-
getRenderer: (itemType: string) => React.ComponentType<ItemRendererComponentProps> | undefined;
|
|
156
|
-
localizations: LocalizationCatalog;
|
|
157
|
-
}
|
|
158
|
-
export interface EntriesToParticipantRegistryOptions {
|
|
159
|
-
/** Throw when an entry in the provided list does not define a renderComponent. */
|
|
160
|
-
requireRenderer?: boolean;
|
|
161
|
-
}
|
|
162
|
-
export interface EntriesToComposedEditorRegistryOptions {
|
|
163
|
-
/** Require built-in editor definitions for group/pageBreak. Defaults to true. */
|
|
164
|
-
requireBuiltInTypes?: boolean;
|
|
165
|
-
/**
|
|
166
|
-
* Extra or overriding labels for category ids (e.g. `question`, `form`).
|
|
167
|
-
* Merged on top of {@link DEFAULT_CATEGORY_LABELS}.
|
|
168
|
-
*/
|
|
169
|
-
categoryLabels?: Partial<Record<ItemCategory, ItemLocaleMap>>;
|
|
170
|
-
}
|
|
171
|
-
export type RegistryValidationMode = "editor" | "player";
|
|
172
|
-
export interface RegistryValidationOptions {
|
|
173
|
-
mode: RegistryValidationMode;
|
|
174
|
-
requireBuiltInTypes?: boolean;
|
|
175
|
-
requireRenderer?: boolean;
|
|
176
|
-
}
|
|
177
|
-
export interface RegistryValidationIssue {
|
|
178
|
-
code: string;
|
|
179
|
-
message: string;
|
|
180
|
-
itemType?: string;
|
|
181
|
-
}
|
|
182
|
-
export interface RegistryValidationResult {
|
|
183
|
-
errors: RegistryValidationIssue[];
|
|
184
|
-
warnings: RegistryValidationIssue[];
|
|
185
|
-
}
|
|
186
|
-
/**
|
|
187
|
-
* Example: unified entry for participant + editor
|
|
188
|
-
*
|
|
189
|
-
* const myEntries: ItemRegistryEntry[] = [
|
|
190
|
-
* {
|
|
191
|
-
* itemType: "choiceItem",
|
|
192
|
-
* constructor: ChoiceItemCore,
|
|
193
|
-
* renderComponent: ChoiceItemRenderer,
|
|
194
|
-
* previewComponent: ChoiceItemPreview,
|
|
195
|
-
* infos: { icon: ListChecks, labelByLocale: { en: "Choice" }, ... },
|
|
196
|
-
* editorComponent: EditorCardForChoice,
|
|
197
|
-
* searchAdapters: [myCustomSearchAdapter],
|
|
198
|
-
* },
|
|
199
|
-
* // ...
|
|
200
|
-
* ];
|
|
201
|
-
*
|
|
202
|
-
* // Participant app:
|
|
203
|
-
* const participantReg = entriesToParticipantRegistry(myEntries);
|
|
204
|
-
* Survey.fromJson(json, participantReg.coreRegistry);
|
|
205
|
-
* const Renderer = participantReg.getRenderer("choiceItem");
|
|
206
|
-
*
|
|
207
|
-
* // Editor:
|
|
208
|
-
* const editorReg = entriesToComposedEditorRegistry(myEntries);
|
|
209
|
-
* // ... use editorReg.coreRegistry + editorReg.definitions
|
|
210
|
-
*/
|
|
211
|
-
export declare const DEFAULT_LOCALE = "en";
|
|
212
|
-
/** Default English headings for common category ids; hosts may override via `entriesToComposedEditorRegistry`. */
|
|
213
|
-
export declare const DEFAULT_CATEGORY_LABELS: Record<string, ItemLocaleMap>;
|
|
214
|
-
export declare function resolveLocalizedText(map: ItemLocaleMap, locale?: string): string;
|
|
215
|
-
/**
|
|
216
|
-
* Heading for a category id using the composed registry’s `categoryLabels` and the active locale.
|
|
217
|
-
*/
|
|
218
|
-
export declare function resolveCategoryLabel(category: string, categoryLabels: Record<string, ItemLocaleMap>, locale?: string): string;
|
package/dist/src/modules/survey-editor/routes/editor/_components/assistant-authoring-lock.d.ts
DELETED
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import { PropsWithChildren } from 'react';
|
|
2
|
-
export declare const AssistantAuthoringLockStatus: () => import("react/jsx-runtime").JSX.Element | null;
|
|
3
|
-
interface UserMutationBoundaryProps extends PropsWithChildren {
|
|
4
|
-
className?: string;
|
|
5
|
-
}
|
|
6
|
-
export declare const UserMutationBoundary: ({ children, className }: UserMutationBoundaryProps) => import("react/jsx-runtime").JSX.Element;
|
|
7
|
-
export {};
|
package/dist/src/modules/survey-editor/routes/editor/_components/editor-assistant-slot-context.d.ts
DELETED
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
export interface EditorAssistantSlotContextValue {
|
|
2
|
-
available: boolean;
|
|
3
|
-
setTarget: (target: HTMLDivElement | null) => void;
|
|
4
|
-
}
|
|
5
|
-
export declare const EditorAssistantSlotContext: import('react').Context<EditorAssistantSlotContextValue>;
|
|
6
|
-
export declare const useEditorAssistantPanelAvailable: () => boolean;
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import { ReactNode } from 'react';
|
|
2
|
-
interface EditorAssistantPanelProviderProps {
|
|
3
|
-
children: ReactNode;
|
|
4
|
-
panel?: ReactNode;
|
|
5
|
-
}
|
|
6
|
-
export declare const EditorAssistantPanelProvider: ({ children, panel, }: EditorAssistantPanelProviderProps) => import("react/jsx-runtime").JSX.Element;
|
|
7
|
-
export declare const EditorAssistantPanelSlot: () => import("react/jsx-runtime").JSX.Element;
|
|
8
|
-
export {};
|
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
import { ReactNode } from 'react';
|
|
2
|
-
export interface EditorWorkspacePanelDefinition {
|
|
3
|
-
id: string;
|
|
4
|
-
label: string;
|
|
5
|
-
content: ReactNode | ((controller: EditorWorkspacePanelController) => ReactNode);
|
|
6
|
-
defaultOpen?: boolean;
|
|
7
|
-
defaultOpenAtViewportWidth?: number;
|
|
8
|
-
defaultSize: number;
|
|
9
|
-
minSize: number;
|
|
10
|
-
maxSize?: number;
|
|
11
|
-
onOpenChange?: (open: boolean) => void;
|
|
12
|
-
allowContentOverflow?: boolean;
|
|
13
|
-
}
|
|
14
|
-
export interface EditorWorkspacePanelController {
|
|
15
|
-
isOpen: boolean;
|
|
16
|
-
open: () => void;
|
|
17
|
-
close: () => void;
|
|
18
|
-
toggle: () => void;
|
|
19
|
-
}
|
|
20
|
-
interface EditorWorkspaceProps {
|
|
21
|
-
id: string;
|
|
22
|
-
toolbar: ReactNode;
|
|
23
|
-
main: ReactNode;
|
|
24
|
-
mainLabel: string;
|
|
25
|
-
primaryMinSize?: number;
|
|
26
|
-
left?: EditorWorkspacePanelDefinition;
|
|
27
|
-
right?: EditorWorkspacePanelDefinition;
|
|
28
|
-
}
|
|
29
|
-
export declare const EditorWorkspace: ({ id, toolbar, main, mainLabel, primaryMinSize, left, right, }: EditorWorkspaceProps) => import("react/jsx-runtime").JSX.Element;
|
|
30
|
-
export {};
|
|
@@ -1,75 +0,0 @@
|
|
|
1
|
-
export declare const editorWorkspacePresets: {
|
|
2
|
-
readonly editing: {
|
|
3
|
-
readonly id: "editing";
|
|
4
|
-
readonly primaryMinSize: 480;
|
|
5
|
-
readonly left: {
|
|
6
|
-
readonly id: "outline";
|
|
7
|
-
readonly defaultOpen: true;
|
|
8
|
-
readonly defaultSize: 240;
|
|
9
|
-
readonly minSize: 160;
|
|
10
|
-
readonly maxSize: 720;
|
|
11
|
-
};
|
|
12
|
-
readonly right: {
|
|
13
|
-
readonly id: "assistant";
|
|
14
|
-
readonly defaultOpen: false;
|
|
15
|
-
readonly defaultOpenAtViewportWidth: 1280;
|
|
16
|
-
readonly defaultSize: 360;
|
|
17
|
-
readonly minSize: 280;
|
|
18
|
-
readonly maxSize: 520;
|
|
19
|
-
readonly allowContentOverflow: true;
|
|
20
|
-
};
|
|
21
|
-
};
|
|
22
|
-
readonly preview: {
|
|
23
|
-
readonly id: "editing";
|
|
24
|
-
readonly primaryMinSize: 480;
|
|
25
|
-
readonly left: {
|
|
26
|
-
readonly id: "outline";
|
|
27
|
-
readonly defaultOpen: true;
|
|
28
|
-
readonly defaultSize: 240;
|
|
29
|
-
readonly minSize: 160;
|
|
30
|
-
readonly maxSize: 720;
|
|
31
|
-
};
|
|
32
|
-
readonly right: {
|
|
33
|
-
readonly id: "assistant";
|
|
34
|
-
readonly defaultOpen: false;
|
|
35
|
-
readonly defaultOpenAtViewportWidth: 1280;
|
|
36
|
-
readonly defaultSize: 360;
|
|
37
|
-
readonly minSize: 280;
|
|
38
|
-
readonly maxSize: 520;
|
|
39
|
-
readonly allowContentOverflow: true;
|
|
40
|
-
};
|
|
41
|
-
};
|
|
42
|
-
readonly translation: {
|
|
43
|
-
readonly id: "translation";
|
|
44
|
-
readonly primaryMinSize: 480;
|
|
45
|
-
readonly left: {
|
|
46
|
-
readonly id: "outline";
|
|
47
|
-
readonly defaultOpen: true;
|
|
48
|
-
readonly defaultSize: 240;
|
|
49
|
-
readonly minSize: 160;
|
|
50
|
-
readonly maxSize: 720;
|
|
51
|
-
};
|
|
52
|
-
readonly right: {
|
|
53
|
-
readonly id: "assistant";
|
|
54
|
-
readonly defaultOpen: false;
|
|
55
|
-
readonly defaultOpenAtViewportWidth: 1280;
|
|
56
|
-
readonly defaultSize: 360;
|
|
57
|
-
readonly minSize: 280;
|
|
58
|
-
readonly maxSize: 520;
|
|
59
|
-
readonly allowContentOverflow: true;
|
|
60
|
-
};
|
|
61
|
-
};
|
|
62
|
-
readonly assets: {
|
|
63
|
-
readonly id: "assets";
|
|
64
|
-
readonly primaryMinSize: 320;
|
|
65
|
-
readonly right: {
|
|
66
|
-
readonly id: "assistant";
|
|
67
|
-
readonly defaultOpen: false;
|
|
68
|
-
readonly defaultOpenAtViewportWidth: 1280;
|
|
69
|
-
readonly defaultSize: 360;
|
|
70
|
-
readonly minSize: 280;
|
|
71
|
-
readonly maxSize: 520;
|
|
72
|
-
readonly allowContentOverflow: true;
|
|
73
|
-
};
|
|
74
|
-
};
|
|
75
|
-
};
|
package/dist/src/modules/survey-editor/routes/editor/item-editor/_components/survey-workspace.d.ts
DELETED
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import { ReactNode } from 'react';
|
|
2
|
-
export type SurveyWorkspaceMode = "editing" | "preview";
|
|
3
|
-
interface SurveyWorkspaceProps {
|
|
4
|
-
mode: SurveyWorkspaceMode;
|
|
5
|
-
main: ReactNode;
|
|
6
|
-
overlay?: ReactNode;
|
|
7
|
-
mainLabel: string;
|
|
8
|
-
onBackRequested?: () => void;
|
|
9
|
-
onSaveRequested: () => void;
|
|
10
|
-
}
|
|
11
|
-
export declare const SurveyWorkspace: ({ mode, main, overlay, mainLabel, onBackRequested, onSaveRequested, }: SurveyWorkspaceProps) => import("react/jsx-runtime").JSX.Element;
|
|
12
|
-
export {};
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
interface PreviewModeProps {
|
|
2
|
-
onBackRequested?: () => void;
|
|
3
|
-
onSaveRequested: () => void;
|
|
4
|
-
onSimulatorRequested?: () => void;
|
|
5
|
-
}
|
|
6
|
-
declare const PreviewMode: ({ onBackRequested, onSaveRequested, onSimulatorRequested, }: PreviewModeProps) => import("react/jsx-runtime").JSX.Element;
|
|
7
|
-
export default PreviewMode;
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
import { PreviewPreferences } from './use-preview-preferences';
|
|
2
|
-
interface PreviewControlsProps {
|
|
3
|
-
preferences: PreviewPreferences;
|
|
4
|
-
onPreferencesChange: (updates: Partial<PreviewPreferences>) => void;
|
|
5
|
-
canLocate: boolean;
|
|
6
|
-
onLocate: () => void;
|
|
7
|
-
canReset: boolean;
|
|
8
|
-
onReset: () => void;
|
|
9
|
-
onSimulatorRequested?: () => void;
|
|
10
|
-
fullscreen: boolean;
|
|
11
|
-
onFullscreenChange: (fullscreen: boolean) => void;
|
|
12
|
-
expanded?: boolean;
|
|
13
|
-
}
|
|
14
|
-
export declare const PreviewControls: ({ preferences, onPreferencesChange, canLocate, onLocate, canReset, onReset, onSimulatorRequested, fullscreen, onFullscreenChange, expanded, }: PreviewControlsProps) => import("react/jsx-runtime").JSX.Element;
|
|
15
|
-
export {};
|
|
@@ -1,26 +0,0 @@
|
|
|
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;
|
package/dist/src/modules/survey-editor/routes/editor/preview-mode/survey-preview-canvas.d.ts
DELETED
|
@@ -1,16 +0,0 @@
|
|
|
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 {};
|
|
@@ -1,13 +0,0 @@
|
|
|
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 {};
|
package/dist/src/modules/survey-editor/routes/editor/preview-mode/use-preview-preferences.d.ts
DELETED
|
@@ -1,14 +0,0 @@
|
|
|
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
|
-
};
|
|
@@ -1,13 +0,0 @@
|
|
|
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;
|
|
@@ -1,10 +0,0 @@
|
|
|
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>;
|