@case-framework/survey-ui 0.2.4 → 0.3.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +2 -13
- package/dist/src/components/c-ui/alert-provider.d.ts +18 -0
- package/dist/src/components/c-ui/confirm-dialog.d.ts +19 -0
- package/dist/src/components/c-ui/confirm-provider.d.ts +15 -0
- package/dist/src/components/c-ui/dot-background.d.ts +72 -0
- package/dist/src/components/c-ui/filepicker-dropzone.d.ts +38 -0
- package/dist/src/components/c-ui/loading-button.d.ts +9 -0
- package/dist/src/components/common/content-editable-plain.d.ts +17 -0
- package/dist/src/components/hooks/use-button-shortcut.d.ts +18 -0
- package/dist/src/components/hooks/use-document-keydown.d.ts +7 -0
- package/dist/src/components/rich-text/content-policy.d.ts +19 -0
- package/dist/src/components/rich-text/index.d.ts +6 -0
- package/dist/src/components/rich-text/nodes/rich-text-image-node.d.ts +40 -0
- package/dist/src/components/rich-text/nodes/rich-text-info-box-node.d.ts +45 -0
- package/dist/src/components/rich-text/nodes/survey-rich-text-heading-node.d.ts +27 -0
- package/dist/src/components/rich-text/rich-text-block-editor.d.ts +8 -0
- package/dist/src/components/rich-text/rich-text-content-view.d.ts +11 -0
- package/dist/src/components/rich-text/rich-text-editor-context.d.ts +23 -0
- package/dist/src/components/rich-text/rich-text-link-utils.d.ts +2 -0
- package/dist/src/components/rich-text/rich-text-survey-content.d.ts +7 -0
- package/dist/src/components/rich-text/types.d.ts +6 -0
- package/dist/src/components/rich-text-editor/index.d.ts +3 -0
- package/dist/src/components/rich-text-editor/plugins/command-handler-plugin.d.ts +5 -0
- package/dist/src/components/rich-text-editor/plugins/editable-mode-plugin.d.ts +3 -0
- package/dist/src/components/rich-text-editor/plugins/floating-toolbar-plugin.d.ts +11 -0
- package/dist/src/components/rich-text-editor/plugins/image-dialog-plugin.d.ts +4 -0
- package/dist/src/components/rich-text-editor/plugins/info-box-popover-plugin.d.ts +6 -0
- package/dist/src/components/rich-text-editor/plugins/link-popover-plugin.d.ts +6 -0
- package/dist/src/components/rich-text-editor/plugins/rich-text-image-asset-deletion-plugin.d.ts +1 -0
- package/dist/src/components/rich-text-editor/plugins/slash-command-menu-plugin.d.ts +15 -0
- package/dist/src/components/rich-text-editor/plugins/sync-editor-value-plugin.d.ts +4 -0
- package/dist/src/components/rich-text-editor/rich-text-editor-utils.d.ts +205 -0
- package/dist/src/components/rich-text-editor/rich-text-editor.d.ts +43 -0
- package/dist/src/components/rich-text-editor/rich-text-image-editor-commands.d.ts +12 -0
- package/dist/src/components/rich-text-editor/rich-text-info-box-commands.d.ts +20 -0
- package/dist/src/components/rich-text-editor/style-control-icon.d.ts +5 -0
- package/dist/src/components/ui/alert-dialog.d.ts +18 -0
- package/dist/src/components/ui/alert.d.ts +10 -0
- package/dist/src/components/ui/badge.d.ts +9 -0
- package/dist/src/components/ui/breadcrumb.d.ts +11 -0
- package/dist/src/components/ui/button.d.ts +10 -0
- package/dist/src/components/ui/calendar.d.ts +10 -0
- package/dist/src/components/ui/card.d.ts +11 -0
- package/dist/src/components/ui/checkbox.d.ts +4 -0
- package/dist/src/components/ui/collapsible.d.ts +5 -0
- package/dist/src/components/ui/command.d.ts +18 -0
- package/dist/src/components/ui/context-menu.d.ts +31 -0
- package/dist/src/components/ui/dialog.d.ts +19 -0
- package/dist/src/components/ui/dropdown-menu.d.ts +29 -0
- package/dist/src/components/ui/field.d.ts +24 -0
- package/dist/src/components/ui/input-group.d.ts +16 -0
- package/dist/src/components/ui/input.d.ts +3 -0
- package/dist/src/components/ui/kbd.d.ts +3 -0
- package/dist/src/components/ui/label.d.ts +4 -0
- package/dist/src/components/ui/popover.d.ts +10 -0
- package/dist/src/components/ui/progress.d.ts +4 -0
- package/dist/src/components/ui/radio-group.d.ts +5 -0
- package/dist/src/components/ui/scroll-area.d.ts +5 -0
- package/dist/src/components/ui/select.d.ts +15 -0
- package/dist/src/components/ui/separator.d.ts +4 -0
- package/dist/src/components/ui/skeleton.d.ts +2 -0
- package/dist/src/components/ui/slider.d.ts +4 -0
- package/dist/src/components/ui/sonner.d.ts +3 -0
- package/dist/src/components/ui/switch.d.ts +6 -0
- package/dist/src/components/ui/tabs.d.ts +11 -0
- package/dist/src/components/ui/textarea.d.ts +3 -0
- package/dist/src/components/ui/toggle-group.d.ts +10 -0
- package/dist/src/components/ui/toggle.d.ts +9 -0
- package/dist/src/components/ui/tooltip.d.ts +7 -0
- package/dist/src/dev/_components/nav-input.d.ts +35 -0
- package/dist/src/dev/app.d.ts +2 -0
- package/dist/src/dev/localizations/de.d.ts +2 -0
- package/dist/src/dev/main.d.ts +0 -0
- package/dist/src/index.d.ts +10 -0
- package/dist/src/lib/utils.d.ts +2 -0
- package/dist/src/modules/default-item-registry/default-item-cores.d.ts +24 -0
- package/dist/src/modules/default-item-registry/default-registry-entries.d.ts +2 -0
- package/dist/src/modules/default-item-registry/index.d.ts +19 -0
- package/dist/src/modules/default-item-registry/items/choice/display-order.d.ts +1 -0
- package/dist/src/modules/default-item-registry/items/choice/editor/card.d.ts +3 -0
- package/dist/src/modules/default-item-registry/items/choice/editor/option-create.d.ts +11 -0
- package/dist/src/modules/default-item-registry/items/choice/editor/option-edit-dialog.d.ts +14 -0
- package/dist/src/modules/default-item-registry/items/choice/editor/option-editor-fields.d.ts +17 -0
- package/dist/src/modules/default-item-registry/items/choice/editor/option-embedded-form-dialog.d.ts +15 -0
- package/dist/src/modules/default-item-registry/items/choice/editor/response-options-list.d.ts +20 -0
- package/dist/src/modules/default-item-registry/items/choice/expression-registry.d.ts +3 -0
- package/dist/src/modules/default-item-registry/items/choice/model.d.ts +28 -0
- package/dist/src/modules/default-item-registry/items/choice/player/question.d.ts +32 -0
- package/dist/src/modules/default-item-registry/items/choice/preview/item.d.ts +2 -0
- package/dist/src/modules/default-item-registry/items/choice/search-adapter.d.ts +2 -0
- package/dist/src/modules/default-item-registry/items/form/editor/card.d.ts +3 -0
- package/dist/src/modules/default-item-registry/items/form/editor/config-editor.d.ts +12 -0
- package/dist/src/modules/default-item-registry/items/form/editor/field-edit-dialog.d.ts +10 -0
- package/dist/src/modules/default-item-registry/items/form/editor/field-group-header-dialog.d.ts +12 -0
- package/dist/src/modules/default-item-registry/items/form/editor/field-group-layout-dialog.d.ts +9 -0
- package/dist/src/modules/default-item-registry/items/form/editor/field-item-preview.d.ts +15 -0
- package/dist/src/modules/default-item-registry/items/form/editor/field-key-dialog.d.ts +10 -0
- package/dist/src/modules/default-item-registry/items/form/editor/field-sort-dialog.d.ts +11 -0
- package/dist/src/modules/default-item-registry/items/form/editor/field-type-shared.d.ts +12 -0
- package/dist/src/modules/default-item-registry/items/form/editor/response-field-groups-list.d.ts +16 -0
- package/dist/src/modules/default-item-registry/items/form/model.d.ts +158 -0
- package/dist/src/modules/default-item-registry/items/form/player/field.d.ts +28 -0
- package/dist/src/modules/default-item-registry/items/form/preview/item.d.ts +2 -0
- package/dist/src/modules/default-item-registry/items/info/editor-card.d.ts +3 -0
- package/dist/src/modules/default-item-registry/items/info/player/card-field.d.ts +14 -0
- package/dist/src/modules/default-item-registry/items/info/preview/item.d.ts +2 -0
- package/dist/src/modules/default-item-registry/items/info/search-adapter.d.ts +2 -0
- package/dist/src/modules/default-item-registry/items/structure/group/editor-card.d.ts +3 -0
- package/dist/src/modules/default-item-registry/items/structure/page-break/editor-card.d.ts +3 -0
- package/dist/src/modules/default-item-registry/items/structure/preview-renderers.d.ts +3 -0
- package/dist/src/modules/default-item-registry/items/structure/root/editor-card.d.ts +3 -0
- package/dist/src/modules/default-item-registry/shared/player/question-card-shell.d.ts +13 -0
- package/dist/src/modules/default-item-registry/shared/preview/question-header.d.ts +6 -0
- package/dist/src/modules/default-item-registry/shared/preview/utils.d.ts +3 -0
- package/dist/src/modules/default-item-registry/shared/question-editor/deferred-localized-rich-text-field.d.ts +26 -0
- package/dist/src/modules/default-item-registry/shared/question-editor/header-editor.d.ts +6 -0
- package/dist/src/modules/default-item-registry/shared/question-editor/layout.d.ts +8 -0
- package/dist/src/modules/default-item-registry/shared/question-editor/rich-text-editors.d.ts +23 -0
- package/dist/src/modules/default-item-registry/shared/question-editor/rich-text-policies.d.ts +8 -0
- package/dist/src/modules/default-item-registry/shared/question-editor/toolbar.d.ts +10 -0
- package/dist/src/modules/survey-editor/ai/types.d.ts +88 -0
- package/dist/src/modules/survey-editor/assets/index.d.ts +4 -0
- package/dist/src/modules/survey-editor/assets/survey-image-asset-manager.d.ts +4 -0
- package/dist/src/modules/survey-editor/assets/use-survey-assets.d.ts +4 -0
- package/dist/src/modules/survey-editor/assets/utils.d.ts +5 -0
- package/dist/src/modules/survey-editor/editor-card/add-items/constants.d.ts +3 -0
- package/dist/src/modules/survey-editor/editor-card/add-items/hooks/use-add-item-actions.d.ts +25 -0
- package/dist/src/modules/survey-editor/editor-card/add-items/hooks/use-add-item-target.d.ts +9 -0
- package/dist/src/modules/survey-editor/editor-card/add-items/hooks/use-option-group-navigation.d.ts +19 -0
- package/dist/src/modules/survey-editor/editor-card/add-items/types.d.ts +21 -0
- package/dist/src/modules/survey-editor/editor-card/add-items/views/ai-item-view.d.ts +10 -0
- package/dist/src/modules/survey-editor/editor-card/add-items/views/back-button.d.ts +5 -0
- package/dist/src/modules/survey-editor/editor-card/add-items/views/blank-item-view.d.ts +13 -0
- package/dist/src/modules/survey-editor/editor-card/add-items/views/entry-view.d.ts +15 -0
- package/dist/src/modules/survey-editor/editor-card/add-items/views/structure-view.d.ts +16 -0
- package/dist/src/modules/survey-editor/editor-card/add-items.d.ts +1 -0
- package/dist/src/modules/survey-editor/editor-card/copy-item-dropdown-menu.d.ts +5 -0
- package/dist/src/modules/survey-editor/editor-card/delete-item-context-menu.d.ts +5 -0
- package/dist/src/modules/survey-editor/editor-card/delete-item-dropdown-menu.d.ts +5 -0
- package/dist/src/modules/survey-editor/editor-card/editor-card-tab-trigger.d.ts +15 -0
- package/dist/src/modules/survey-editor/editor-card/group-items.d.ts +2 -0
- package/dist/src/modules/survey-editor/editor-card/hooks/use-armed-shortcut-sequence.d.ts +11 -0
- package/dist/src/modules/survey-editor/editor-card/hooks/use-group-list-keyboard.d.ts +30 -0
- package/dist/src/modules/survey-editor/editor-card/index.d.ts +2 -0
- package/dist/src/modules/survey-editor/editor-card/item-color-menu.d.ts +6 -0
- package/dist/src/modules/survey-editor/editor-card/item-color-selector.d.ts +5 -0
- package/dist/src/modules/survey-editor/editor-card/item-editor-card-skeleton.d.ts +2 -0
- package/dist/src/modules/survey-editor/editor-card/item-editor-card.d.ts +39 -0
- package/dist/src/modules/survey-editor/editor-card/item-editor-context.d.ts +20 -0
- package/dist/src/modules/survey-editor/editor-card/item-key-editor.d.ts +9 -0
- package/dist/src/modules/survey-editor/editor-card/item-label-preview-and-editor.d.ts +10 -0
- package/dist/src/modules/survey-editor/editor-card/item-preview.d.ts +8 -0
- package/dist/src/modules/survey-editor/editor-card/item-sibling-navigation.d.ts +5 -0
- package/dist/src/modules/survey-editor/editor-card/item-type-icon-with-tooltip.d.ts +8 -0
- package/dist/src/modules/survey-editor/editor-card/survey-player-item-preview.d.ts +6 -0
- package/dist/src/modules/survey-editor/editor-instance-provider.d.ts +7 -0
- package/dist/src/modules/survey-editor/hooks/useClipboardValue.d.ts +2 -0
- package/dist/src/modules/survey-editor/hooks/useDeleteItem.d.ts +9 -0
- package/dist/src/modules/survey-editor/hooks/useEditor.d.ts +12 -0
- package/dist/src/modules/survey-editor/hooks/useEditorStateChange.d.ts +17 -0
- package/dist/src/modules/survey-editor/hooks/useKeyboardShortcuts.d.ts +7 -0
- package/dist/src/modules/survey-editor/index.d.ts +17 -0
- package/dist/src/modules/survey-editor/localization/date-fns.d.ts +5 -0
- package/dist/src/modules/survey-editor/localization/default-en.d.ts +4 -0
- package/dist/src/modules/survey-editor/localization/index.d.ts +5 -0
- package/dist/src/modules/survey-editor/localization/runtime.d.ts +4 -0
- package/dist/src/modules/survey-editor/localization/types.d.ts +7 -0
- package/dist/src/modules/survey-editor/navigation/navigation-provider.d.ts +11 -0
- package/dist/src/modules/survey-editor/navigation/navigation.d.ts +13 -0
- package/dist/src/modules/survey-editor/navigation/types.d.ts +18 -0
- package/dist/src/modules/survey-editor/primitives/input-with-ai-popover.d.ts +35 -0
- package/dist/src/modules/survey-editor/registry/index.d.ts +7 -0
- package/dist/src/modules/survey-editor/registry/registry-mappers.d.ts +25 -0
- package/dist/src/modules/survey-editor/registry/search-adapter.d.ts +19 -0
- package/dist/src/modules/survey-editor/registry/types.d.ts +178 -0
- package/dist/src/modules/survey-editor/routes/editor/_components/footer.d.ts +2 -0
- package/dist/src/modules/survey-editor/routes/editor/_components/history-stack.d.ts +2 -0
- package/dist/src/modules/survey-editor/routes/editor/_components/main.d.ts +2 -0
- package/dist/src/modules/survey-editor/routes/editor/asset-manager/index.d.ts +2 -0
- package/dist/src/modules/survey-editor/routes/editor/index.d.ts +5 -0
- package/dist/src/modules/survey-editor/routes/editor/item-editor/_components/item-editor-toolbar/breadcrumbs-nav.d.ts +2 -0
- package/dist/src/modules/survey-editor/routes/editor/item-editor/_components/item-editor-toolbar/item-editor-toolbar.d.ts +2 -0
- package/dist/src/modules/survey-editor/routes/editor/item-editor/_components/item-editor-toolbar/language-picker.d.ts +2 -0
- package/dist/src/modules/survey-editor/routes/editor/item-editor/_components/item-editor-toolbar/search-trigger.d.ts +3 -0
- package/dist/src/modules/survey-editor/routes/editor/item-editor/_components/item-editor-toolbar/survey-search.d.ts +7 -0
- package/dist/src/modules/survey-editor/routes/editor/item-editor/index.d.ts +2 -0
- package/dist/src/modules/survey-editor/routes/editor/translation-mode/index.d.ts +2 -0
- package/dist/src/modules/survey-editor/session-file.d.ts +13 -0
- package/dist/src/modules/survey-editor/store/editor-store-context.d.ts +10 -0
- package/dist/src/modules/survey-editor/store/editor-store-provider.d.ts +7 -0
- package/dist/src/modules/survey-editor/store/editor-store.d.ts +102 -0
- package/dist/src/modules/survey-editor/store/use-editor-store.d.ts +4 -0
- package/dist/src/modules/survey-editor/store/useItemNavigation.d.ts +7 -0
- package/dist/src/modules/survey-editor/survey-editor-config.d.ts +29 -0
- package/dist/src/modules/survey-editor/survey-editor.d.ts +26 -0
- package/dist/src/modules/survey-editor/utils/item-type-infos.d.ts +23 -0
- package/dist/src/modules/survey-player/index.d.ts +5 -0
- package/dist/src/modules/survey-player/localization/default-en.d.ts +3 -0
- package/dist/src/modules/survey-player/localization/runtime.d.ts +4 -0
- package/dist/src/modules/survey-player/localization/types.d.ts +7 -0
- package/dist/src/modules/survey-player/survey-context.d.ts +32 -0
- package/dist/src/modules/survey-player/survey-item/survey-item-context.d.ts +27 -0
- package/dist/src/modules/survey-player/survey-item/survey-item-types/placeholder-item-renderers.d.ts +4 -0
- package/dist/src/modules/survey-player/survey-item/survey-item-types/question-wrapper.d.ts +5 -0
- package/dist/src/modules/survey-player/survey-item/survey-item.d.ts +7 -0
- package/dist/src/modules/survey-player/survey-player.d.ts +14 -0
- package/dist/survey-editor-defaults.css +13 -7
- package/dist/survey-ui.cjs.js +148 -28
- package/dist/survey-ui.cjs.js.map +1 -1
- package/dist/survey-ui.css +2 -2
- package/dist/survey-ui.es.js +47547 -17776
- package/dist/survey-ui.es.js.map +1 -1
- package/package.json +28 -20
- package/dist/index.d.ts +0 -478
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { LucideIcon } from 'lucide-react';
|
|
2
|
+
interface EditorCardTabTriggerProps {
|
|
3
|
+
value: string;
|
|
4
|
+
label: string;
|
|
5
|
+
icon: LucideIcon;
|
|
6
|
+
isActive: boolean;
|
|
7
|
+
colorAccent: string;
|
|
8
|
+
colorBorder: string;
|
|
9
|
+
showShortcutNumber: boolean;
|
|
10
|
+
shortcutNumber: number;
|
|
11
|
+
hasIndicator?: boolean;
|
|
12
|
+
indicatorCount?: number;
|
|
13
|
+
}
|
|
14
|
+
declare const EditorCardTabTrigger: React.FC<EditorCardTabTriggerProps>;
|
|
15
|
+
export default EditorCardTabTrigger;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
interface ArmedShortcutSequenceOptions {
|
|
2
|
+
armKey: string;
|
|
3
|
+
enabled?: boolean;
|
|
4
|
+
maxIndex?: number;
|
|
5
|
+
timeoutMs?: number;
|
|
6
|
+
onSelectIndex: (index: number) => void;
|
|
7
|
+
}
|
|
8
|
+
export declare const useArmedShortcutSequence: ({ armKey, enabled, maxIndex, timeoutMs, onSelectIndex, }: ArmedShortcutSequenceOptions) => {
|
|
9
|
+
isArmed: boolean;
|
|
10
|
+
};
|
|
11
|
+
export {};
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { RefObject, KeyboardEvent as ReactKeyboardEvent } from 'react';
|
|
2
|
+
import { SurveyItemClipboardData } from '@case-framework/survey-core/editor';
|
|
3
|
+
interface UseGroupListKeyboardParams {
|
|
4
|
+
addItemDialogOpen: boolean;
|
|
5
|
+
containerRef: RefObject<HTMLElement | null>;
|
|
6
|
+
groupId: string | null | undefined;
|
|
7
|
+
itemIds: string[];
|
|
8
|
+
clipboardValue: string | null;
|
|
9
|
+
previewItemId: string | null;
|
|
10
|
+
openAddDialogForCurrentGroup: () => void;
|
|
11
|
+
openFocusedItem: (itemId: string) => void;
|
|
12
|
+
selectPreviewItem: (itemId: string) => void;
|
|
13
|
+
moveItemByOffset: (itemId: string, offset: -1 | 1) => boolean;
|
|
14
|
+
parseSurveyItemClipboard: (value: string | null) => SurveyItemClipboardData | null;
|
|
15
|
+
pasteItemFromClipboardData: (clipboardData: SurveyItemClipboardData, parentId: string) => string;
|
|
16
|
+
onPasteCommitted: (newItemId: string) => void;
|
|
17
|
+
copyItemToClipboard: (itemId: string) => void;
|
|
18
|
+
}
|
|
19
|
+
export declare const useGroupListKeyboard: ({ addItemDialogOpen, containerRef, groupId, itemIds, clipboardValue, previewItemId, openAddDialogForCurrentGroup, openFocusedItem, selectPreviewItem, moveItemByOffset, parseSurveyItemClipboard, pasteItemFromClipboardData, onPasteCommitted, copyItemToClipboard, }: UseGroupListKeyboardParams) => {
|
|
20
|
+
getItemButtonProps: (itemId: string) => {
|
|
21
|
+
"data-group-list-target": string;
|
|
22
|
+
"data-group-list-item-id": string;
|
|
23
|
+
onFocus: () => void;
|
|
24
|
+
};
|
|
25
|
+
getAddButtonProps: () => {
|
|
26
|
+
"data-group-list-target": string;
|
|
27
|
+
};
|
|
28
|
+
onListKeyDown: (event: ReactKeyboardEvent<HTMLElement>) => void;
|
|
29
|
+
};
|
|
30
|
+
export {};
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
interface ItemColorMenuProps {
|
|
2
|
+
itemId: string;
|
|
3
|
+
}
|
|
4
|
+
export declare const DropdownItemColorMenu: ({ itemId }: ItemColorMenuProps) => import("react/jsx-runtime").JSX.Element;
|
|
5
|
+
export declare const ContextItemColorMenu: ({ itemId }: ItemColorMenuProps) => import("react/jsx-runtime").JSX.Element;
|
|
6
|
+
export {};
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import { ReactNode } from 'react';
|
|
2
|
+
import { SurveyItemCore } from '@case-framework/survey-core';
|
|
3
|
+
import { LucideIcon } from 'lucide-react';
|
|
4
|
+
export interface CommonItemEditorCardProps {
|
|
5
|
+
item: SurveyItemCore;
|
|
6
|
+
}
|
|
7
|
+
interface NavItem {
|
|
8
|
+
id: string;
|
|
9
|
+
label: string;
|
|
10
|
+
icon: LucideIcon;
|
|
11
|
+
hasIndicator?: boolean;
|
|
12
|
+
indicatorCount?: number;
|
|
13
|
+
}
|
|
14
|
+
interface SidePanelCard {
|
|
15
|
+
id: string;
|
|
16
|
+
title: string;
|
|
17
|
+
description?: string;
|
|
18
|
+
icon: LucideIcon;
|
|
19
|
+
content?: ReactNode;
|
|
20
|
+
}
|
|
21
|
+
interface PreviewDialogConfig {
|
|
22
|
+
content: ReactNode;
|
|
23
|
+
title?: string;
|
|
24
|
+
description?: string;
|
|
25
|
+
}
|
|
26
|
+
interface ItemEditorCardProps {
|
|
27
|
+
surveyItem: SurveyItemCore;
|
|
28
|
+
menu: {
|
|
29
|
+
items: ReactNode[];
|
|
30
|
+
hideDeleteItem?: boolean;
|
|
31
|
+
};
|
|
32
|
+
navItems?: NavItem[];
|
|
33
|
+
layoutVariant?: "tabs" | "stacked";
|
|
34
|
+
sidePanelCards?: SidePanelCard[];
|
|
35
|
+
previewDialog?: PreviewDialogConfig;
|
|
36
|
+
children: ReactNode;
|
|
37
|
+
}
|
|
38
|
+
declare const ItemEditorCard: React.FC<ItemEditorCardProps>;
|
|
39
|
+
export default ItemEditorCard;
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { ReactNode } from 'react';
|
|
2
|
+
interface ItemEditorContextType {
|
|
3
|
+
addItemDialogOpen: boolean;
|
|
4
|
+
setAddItemDialogOpen: (open: boolean) => void;
|
|
5
|
+
openAddItemDialog: (targetParentId?: string) => void;
|
|
6
|
+
closeAddItemDialog: () => void;
|
|
7
|
+
targetParentId: string | undefined;
|
|
8
|
+
preferredPreviewItemId: string | null;
|
|
9
|
+
setPreferredPreviewItemId: (itemId: string | null) => void;
|
|
10
|
+
}
|
|
11
|
+
interface ItemEditorProviderProps {
|
|
12
|
+
children: ReactNode;
|
|
13
|
+
}
|
|
14
|
+
export declare const ItemEditorProvider: React.FC<ItemEditorProviderProps>;
|
|
15
|
+
export declare const useItemEditor: () => ItemEditorContextType;
|
|
16
|
+
export declare const useAddItemDialog: () => {
|
|
17
|
+
openAddItemDialog: (targetParentId?: string) => void;
|
|
18
|
+
closeAddItemDialog: () => void;
|
|
19
|
+
};
|
|
20
|
+
export {};
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { SurveyItemKey } from '@case-framework/survey-core';
|
|
2
|
+
interface ItemKeyEditorProps {
|
|
3
|
+
itemId: string;
|
|
4
|
+
currentItemKey?: SurveyItemKey;
|
|
5
|
+
siblingKeys: string[];
|
|
6
|
+
onChangeItemKey: (newKey: string) => void;
|
|
7
|
+
}
|
|
8
|
+
declare const ItemKeyEditor: (props: ItemKeyEditorProps) => import("react/jsx-runtime").JSX.Element;
|
|
9
|
+
export default ItemKeyEditor;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
interface ItemLabelPreviewAndEditorProps {
|
|
2
|
+
itemId: string;
|
|
3
|
+
itemType: string;
|
|
4
|
+
itemLabel: string;
|
|
5
|
+
maxSuggestions?: number;
|
|
6
|
+
className?: string;
|
|
7
|
+
onChangeItemLabel: (newLabel: string) => void;
|
|
8
|
+
}
|
|
9
|
+
declare const ItemLabelPreviewAndEditor: React.FC<ItemLabelPreviewAndEditorProps>;
|
|
10
|
+
export default ItemLabelPreviewAndEditor;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { SurveyItemCore } from '@case-framework/survey-core';
|
|
2
|
+
import { ItemPreviewMode } from '../../../../modules/survey-editor/registry';
|
|
3
|
+
interface ItemPreviewProps {
|
|
4
|
+
item: SurveyItemCore | undefined;
|
|
5
|
+
mode?: ItemPreviewMode;
|
|
6
|
+
}
|
|
7
|
+
declare const ItemPreview: ({ item, mode }: ItemPreviewProps) => import("react/jsx-runtime").JSX.Element;
|
|
8
|
+
export default ItemPreview;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { ItemTypeInfos } from '../../../../modules/survey-editor/utils/item-type-infos';
|
|
2
|
+
interface ItemTypeIconWithTooltipProps {
|
|
3
|
+
typeInfos: ItemTypeInfos;
|
|
4
|
+
color?: string;
|
|
5
|
+
iconClassName?: string;
|
|
6
|
+
}
|
|
7
|
+
declare const ItemTypeIconWithTooltip: ({ typeInfos, color, iconClassName }: ItemTypeIconWithTooltipProps) => import("react/jsx-runtime").JSX.Element;
|
|
8
|
+
export default ItemTypeIconWithTooltip;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { PropsWithChildren } from 'react';
|
|
2
|
+
import { SurveyEditorNavigationAdapter } from './navigation/types';
|
|
3
|
+
interface EditorInstanceProviderProps extends PropsWithChildren {
|
|
4
|
+
navigationAdapter?: SurveyEditorNavigationAdapter | null;
|
|
5
|
+
}
|
|
6
|
+
export declare const EditorInstanceProvider: React.FC<EditorInstanceProviderProps>;
|
|
7
|
+
export {};
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { SurveyEditor } from '@case-framework/survey-core/editor';
|
|
2
|
+
import { Survey } from '@case-framework/survey-core';
|
|
3
|
+
/**
|
|
4
|
+
* Returns the current SurveyEditor instance. Use when you need the full editor API.
|
|
5
|
+
*/
|
|
6
|
+
export declare function useEditor(): SurveyEditor | null;
|
|
7
|
+
/**
|
|
8
|
+
* Returns the current Survey from the editor. Use when you only need survey data (items, translations, etc.).
|
|
9
|
+
* Uses changeTick + useMemo to avoid infinite loops: SurveyEditor.survey getter returns a new instance
|
|
10
|
+
* on every access, which would otherwise make getSnapshot return a new ref each time.
|
|
11
|
+
*/
|
|
12
|
+
export declare function useEditorSurvey(): Survey | null;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { SerializedSurveyEditor, SurveyEditor as SurveyEditorCore } from '@case-framework/survey-core/editor';
|
|
2
|
+
export interface EditorStateChangePayload {
|
|
3
|
+
sessionId: string | null;
|
|
4
|
+
state: SerializedSurveyEditor;
|
|
5
|
+
revision: number;
|
|
6
|
+
hasUncommittedChanges: boolean;
|
|
7
|
+
at: number;
|
|
8
|
+
}
|
|
9
|
+
interface UseEditorStateChangeOptions {
|
|
10
|
+
sessionId: string | null;
|
|
11
|
+
editor: SurveyEditorCore | null;
|
|
12
|
+
changeTick: number;
|
|
13
|
+
persistDebounceMs: number;
|
|
14
|
+
onEditorStateChange?: (change: EditorStateChangePayload) => void;
|
|
15
|
+
}
|
|
16
|
+
export declare function useEditorStateChange({ sessionId, editor, changeTick, persistDebounceMs, onEditorStateChange, }: UseEditorStateChangeOptions): void;
|
|
17
|
+
export {};
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
export { SurveyEditor } from './survey-editor';
|
|
2
|
+
export type { SurveyEditorProps, SurveyEditorStateChange } from './survey-editor';
|
|
3
|
+
export { EditorInstanceProvider } from './editor-instance-provider';
|
|
4
|
+
export { useEditorDateLocale, useEditorTranslation } from './survey-editor-config';
|
|
5
|
+
export type { SurveyEditorNavigationAdapter, SurveyEditorLocation } from './navigation/types';
|
|
6
|
+
export { DEFAULT_EDITOR_LANGUAGE, DEFAULT_DATE_FNS_LOCALES, defaultSurveyEditorLocalizations, getDateFnsLocale, mergeDateFnsLocales, surveyEditorEnMessages, } from './localization';
|
|
7
|
+
export type { EditorLocalizationMessages, EditorTranslationValues, SurveyEditorDateLocales, SurveyEditorLocalizations, } from './localization';
|
|
8
|
+
export type { AISuggestedText, BuildSurveyAIContextOptions, GenerateItemFromIntentRequest, GenerateItemFromIntentResult, GeneratedItemIntentSuggestion, SuggestItemKeyRequest, SuggestItemKeyResult, SuggestItemKeySuggestion, SuggestItemLabelRequest, SuggestItemLabelResult, SuggestItemLabelSuggestion, SurveyEditorAIProvider, SurveyAIContextPurpose, SurveyAIContextScope, SurveyAIInvocationMode, SurveyAIRequestOptions, TranslateContentEntry, TranslateContentRequest, TranslateContentResult, } from './ai/types';
|
|
9
|
+
export * from './registry';
|
|
10
|
+
export { buildSurveyFileName, createBlankEditorState, createEditorStateFromRawSurvey, parseEditorStateFromJsonText, serializeSurveyStateForFile, type ParsedSurveySession, type ParsedSurveySessionFormat, } from './session-file';
|
|
11
|
+
export { DEFAULT_BLOCK_CONTENT_POLICY, DEFAULT_COMPACT_CONTENT_POLICY, RichTextBlockEditor, RichTextContentView, createRichTextEditorValueFromContent, createRichTextEditorValueFromText, getRichTextContentFromEditorState, isBlockContentPolicyVariant, mergeRichTextContentPolicy, sanitizeContentForPolicy, } from '../../../components/rich-text';
|
|
12
|
+
export { RichTextEditor, createRichTextEditorValueFromPlainText, } from '../../../components/rich-text-editor';
|
|
13
|
+
export { APPLY_RICH_TEXT_STYLE_COMMAND, CONVERT_RICH_TEXT_LINK_TO_TEXT_COMMAND, INSERT_RICH_TEXT_LINK_COMMAND, INSERT_RICH_TEXT_TEMPLATE_VARIABLE_COMMAND, OPEN_RICH_TEXT_LINK_EDITOR_COMMAND, TemplateVariableNode, UPDATE_RICH_TEXT_LINK_COMMAND, } from '../../../components/rich-text-editor';
|
|
14
|
+
export { SurveyImageAssetManager, useSurveyAssets, useSurveyImageAssets, useUnusedSurveyAssetCount, } from './assets';
|
|
15
|
+
export type { RichTextBlockEditorChange, RichTextBlockEditorProps, RichTextContentPolicy, RichTextContentViewProps, RichTextEditorVariant, RichTextStyleAttribute, RichTextSupportedBlockType, } from '../../../components/rich-text';
|
|
16
|
+
export type { RichTextEditorChange, RichTextEditorProps, RichTextLinkPayload, SerializedRichTextLinkNode, RichTextStyleControl, RichTextTemplateVariable, SerializedTemplateVariableNode, } from '../../../components/rich-text-editor';
|
|
17
|
+
export type { SurveyImageAssetManagerProps, } from './assets';
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { Locale } from 'date-fns/locale';
|
|
2
|
+
export type SurveyEditorDateLocales = Record<string, Locale>;
|
|
3
|
+
export declare const DEFAULT_DATE_FNS_LOCALES: SurveyEditorDateLocales;
|
|
4
|
+
export declare const mergeDateFnsLocales: (dateLocales?: SurveyEditorDateLocales) => SurveyEditorDateLocales;
|
|
5
|
+
export declare const getDateFnsLocale: (language: string, dateLocales?: SurveyEditorDateLocales) => Locale;
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import { EditorLocalizationMessages, SurveyEditorLocalizations } from './types';
|
|
2
|
+
export declare const DEFAULT_EDITOR_LANGUAGE = "en";
|
|
3
|
+
export declare const surveyEditorEnMessages: EditorLocalizationMessages;
|
|
4
|
+
export declare const defaultSurveyEditorLocalizations: SurveyEditorLocalizations;
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
export { DEFAULT_EDITOR_LANGUAGE, defaultSurveyEditorLocalizations, surveyEditorEnMessages, } from './default-en';
|
|
2
|
+
export { createEditorTranslator, createNamespacedEditorTranslator, mergeEditorLocalizations, } from './runtime';
|
|
3
|
+
export { DEFAULT_DATE_FNS_LOCALES, getDateFnsLocale, mergeDateFnsLocales, } from './date-fns';
|
|
4
|
+
export type { EditorLocalizationMessages, EditorTranslate, EditorTranslationValues, SurveyEditorLocalizations, } from './types';
|
|
5
|
+
export type { SurveyEditorDateLocales } from './date-fns';
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import { EditorTranslate, SurveyEditorLocalizations } from './types';
|
|
2
|
+
export declare const mergeEditorLocalizations: (localizations?: SurveyEditorLocalizations) => SurveyEditorLocalizations;
|
|
3
|
+
export declare const createEditorTranslator: (language: string, localizations: SurveyEditorLocalizations) => EditorTranslate;
|
|
4
|
+
export declare const createNamespacedEditorTranslator: (translate: EditorTranslate, namespace?: string) => EditorTranslate;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
export type EditorTranslationPrimitive = string | number | boolean | null | undefined;
|
|
2
|
+
export type EditorTranslationValues = Record<string, EditorTranslationPrimitive>;
|
|
3
|
+
export type EditorLocalizationMessages = {
|
|
4
|
+
[key: string]: string | EditorLocalizationMessages;
|
|
5
|
+
};
|
|
6
|
+
export type SurveyEditorLocalizations = Record<string, EditorLocalizationMessages>;
|
|
7
|
+
export type EditorTranslate = (key: string, values?: EditorTranslationValues) => string;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { PropsWithChildren } from 'react';
|
|
2
|
+
import { StoreApi } from 'zustand';
|
|
3
|
+
import { SurveyEditorNavigationStore } from './navigation';
|
|
4
|
+
import { SurveyEditorNavigationAdapter } from './types';
|
|
5
|
+
interface SurveyEditorNavigationStoreProviderProps extends PropsWithChildren {
|
|
6
|
+
adapter?: SurveyEditorNavigationAdapter | null;
|
|
7
|
+
}
|
|
8
|
+
export declare const SurveyEditorNavigationStoreProvider: React.FC<SurveyEditorNavigationStoreProviderProps>;
|
|
9
|
+
export declare function useSurveyEditorNavigationStore<T>(selector: (state: SurveyEditorNavigationStore) => T): T;
|
|
10
|
+
export declare function useSurveyEditorNavigationStoreApi(): StoreApi<SurveyEditorNavigationStore>;
|
|
11
|
+
export {};
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { SurveyEditorLocation, SurveyEditorNavigationAdapter } from './types';
|
|
2
|
+
import { StoreApi } from 'zustand';
|
|
3
|
+
export interface SurveyEditorNavigationStore {
|
|
4
|
+
location: SurveyEditorLocation;
|
|
5
|
+
history: SurveyEditorLocation[];
|
|
6
|
+
adapter: SurveyEditorNavigationAdapter | null;
|
|
7
|
+
_adapterUnsubscribe?: () => void;
|
|
8
|
+
setAdapter: (adapter: SurveyEditorNavigationAdapter) => void;
|
|
9
|
+
clearAdapter: () => void;
|
|
10
|
+
navigate: (location: SurveyEditorLocation, replace?: boolean) => void;
|
|
11
|
+
}
|
|
12
|
+
export type SurveyEditorNavigationStoreApi = StoreApi<SurveyEditorNavigationStore>;
|
|
13
|
+
export declare function createSurveyEditorNavigationStore(): SurveyEditorNavigationStoreApi;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
export interface ItemEditorLocation {
|
|
2
|
+
view: 'item-editor';
|
|
3
|
+
itemId?: string;
|
|
4
|
+
}
|
|
5
|
+
export interface TranslationModeLocation {
|
|
6
|
+
view: 'translation-mode';
|
|
7
|
+
}
|
|
8
|
+
export interface AssetManagerLocation {
|
|
9
|
+
view: 'asset-manager';
|
|
10
|
+
}
|
|
11
|
+
export type SurveyEditorLocation = ItemEditorLocation | TranslationModeLocation | AssetManagerLocation;
|
|
12
|
+
export interface SurveyEditorNavigationAdapter {
|
|
13
|
+
getLocation: () => SurveyEditorLocation;
|
|
14
|
+
navigateTo: (location: SurveyEditorLocation, options?: {
|
|
15
|
+
replace?: boolean;
|
|
16
|
+
}) => void;
|
|
17
|
+
subscribe(listener: (location: SurveyEditorLocation) => void): () => void;
|
|
18
|
+
}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import { FocusEvent, KeyboardEvent } from 'react';
|
|
2
|
+
import { SurveyAIInvocationMode } from '../ai/types';
|
|
3
|
+
export interface InputWithAISuggestion {
|
|
4
|
+
id: string;
|
|
5
|
+
text: string;
|
|
6
|
+
label?: string;
|
|
7
|
+
}
|
|
8
|
+
export interface InputWithAISuggestionsAdapter {
|
|
9
|
+
minChars?: number;
|
|
10
|
+
debounceMs?: number;
|
|
11
|
+
maxSuggestions?: number;
|
|
12
|
+
onSuggest: (input: string, trigger: "typing" | "manual", options?: {
|
|
13
|
+
signal?: AbortSignal;
|
|
14
|
+
mode?: SurveyAIInvocationMode;
|
|
15
|
+
}) => Promise<InputWithAISuggestion[]>;
|
|
16
|
+
}
|
|
17
|
+
interface InputWithAIPopoverProps {
|
|
18
|
+
value: string;
|
|
19
|
+
placeholder: string;
|
|
20
|
+
className?: string;
|
|
21
|
+
containerClassName?: string;
|
|
22
|
+
aiButtonClassName?: string;
|
|
23
|
+
popoverContentClassName?: string;
|
|
24
|
+
id?: string;
|
|
25
|
+
disabled?: boolean;
|
|
26
|
+
autoFocus?: boolean;
|
|
27
|
+
autoComplete?: string;
|
|
28
|
+
maxSuggestions?: number;
|
|
29
|
+
suggestionsAdapter?: InputWithAISuggestionsAdapter | null;
|
|
30
|
+
onChange: (value: string) => void;
|
|
31
|
+
onBlur?: (event: FocusEvent<HTMLInputElement>) => void;
|
|
32
|
+
onKeyDown?: (event: KeyboardEvent<HTMLInputElement>) => void;
|
|
33
|
+
}
|
|
34
|
+
declare const InputWithAIPopover: (props: InputWithAIPopoverProps) => import("react/jsx-runtime").JSX.Element;
|
|
35
|
+
export default InputWithAIPopover;
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { AnyItemExpressionDefinition, ItemTypeRegistry, SurveyItemCore } from '@case-framework/survey-core';
|
|
2
|
+
import { ComposedEditorItemRegistry, EditorItemDefinition, EntriesToComposedEditorRegistryOptions, EntriesToParticipantRegistryOptions, ItemCategory, ItemLocaleMap, ItemRegistryEntry, RegistryValidationOptions, RegistryValidationResult, SurveyPlayerItemRegistry } from './types';
|
|
3
|
+
import { SurveyEditorLocalizations } from '../localization';
|
|
4
|
+
export declare function mergeCategoryLabelOverrides(base?: Partial<Record<ItemCategory, ItemLocaleMap>>, overrides?: Partial<Record<ItemCategory, ItemLocaleMap>>): Partial<Record<ItemCategory, ItemLocaleMap>> | undefined;
|
|
5
|
+
export declare function validateRegistryEntries(entries: ItemRegistryEntry[], options: RegistryValidationOptions): RegistryValidationResult;
|
|
6
|
+
/**
|
|
7
|
+
* Derive ItemTypeRegistry from unified entries for Survey / SurveyEditor.
|
|
8
|
+
* Uses built-in registry for group/pageBreak; plugin entries supply constructors for custom types.
|
|
9
|
+
*/
|
|
10
|
+
export declare function entriesToItemTypeRegistry(entries: ItemRegistryEntry[]): ItemTypeRegistry;
|
|
11
|
+
/**
|
|
12
|
+
* Derive participant registry from unified entries.
|
|
13
|
+
* Lightweight: core + renderer only. Use this for survey player / participant app.
|
|
14
|
+
*/
|
|
15
|
+
export declare function entriesToParticipantRegistry(entries: ItemRegistryEntry[], options?: EntriesToParticipantRegistryOptions): SurveyPlayerItemRegistry;
|
|
16
|
+
export declare function localizeRegistryEntries(entries: ItemRegistryEntry[], localizations?: SurveyEditorLocalizations): ItemRegistryEntry[];
|
|
17
|
+
export declare function getCategoryLabelsFromLocalizations(localizations?: SurveyEditorLocalizations): Partial<Record<ItemCategory, ItemLocaleMap>> | undefined;
|
|
18
|
+
/**
|
|
19
|
+
* Derive ComposedEditorItemRegistry from unified entries for the editor.
|
|
20
|
+
* Ensures Group and PageBreak have definitions; uses coreRegistry from entries.
|
|
21
|
+
*/
|
|
22
|
+
export declare function entriesToComposedEditorRegistry(entries: ItemRegistryEntry[], options?: EntriesToComposedEditorRegistryOptions): ComposedEditorItemRegistry;
|
|
23
|
+
export declare function getRegistryEntryForItem(registry: ComposedEditorItemRegistry, item: SurveyItemCore): EditorItemDefinition | undefined;
|
|
24
|
+
export declare function getItemExpressionDefinitionsForType(registry: ComposedEditorItemRegistry, itemType: string): AnyItemExpressionDefinition[];
|
|
25
|
+
export declare function getItemExpressionDefinitionsForItem(registry: ComposedEditorItemRegistry, item: SurveyItemCore): AnyItemExpressionDefinition[];
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { Survey } from '@case-framework/survey-core';
|
|
2
|
+
export declare const SearchMatchType: {
|
|
3
|
+
readonly Content: "content";
|
|
4
|
+
readonly Label: "label";
|
|
5
|
+
readonly Key: "key";
|
|
6
|
+
readonly ItemType: "itemType";
|
|
7
|
+
};
|
|
8
|
+
export type SearchMatchType = (typeof SearchMatchType)[keyof typeof SearchMatchType];
|
|
9
|
+
export interface EditorItemSearchResult {
|
|
10
|
+
matchType: SearchMatchType;
|
|
11
|
+
matchText: string;
|
|
12
|
+
}
|
|
13
|
+
export interface ItemSearchAdapterContext {
|
|
14
|
+
itemId: string;
|
|
15
|
+
survey: Survey;
|
|
16
|
+
searchTerm: string;
|
|
17
|
+
}
|
|
18
|
+
export type ItemSearchAdapter = (ctx: ItemSearchAdapterContext) => EditorItemSearchResult[] | undefined;
|
|
19
|
+
export declare const defaultSearchAdapter: ItemSearchAdapter;
|