@case-framework/survey-ui 0.2.2 → 0.2.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.d.ts +478 -9
- package/dist/survey-ui.cjs.js.map +1 -1
- package/dist/survey-ui.css +3 -0
- package/dist/survey-ui.es.js.map +1 -1
- package/package.json +2 -2
- package/dist/components/c-ui/alert-provider.d.ts +0 -18
- package/dist/components/c-ui/confirm-dialog.d.ts +0 -19
- package/dist/components/c-ui/confirm-provider.d.ts +0 -15
- package/dist/components/c-ui/filepicker-dropzone.d.ts +0 -38
- package/dist/components/c-ui/loading-button.d.ts +0 -9
- package/dist/components/inputs/Filepicker.d.ts +0 -14
- package/dist/components/ui/alert-dialog.d.ts +0 -18
- package/dist/components/ui/alert.d.ts +0 -9
- package/dist/components/ui/badge.d.ts +0 -9
- package/dist/components/ui/breadcrumb.d.ts +0 -11
- package/dist/components/ui/button.d.ts +0 -10
- package/dist/components/ui/card.d.ts +0 -9
- package/dist/components/ui/checkbox.d.ts +0 -4
- package/dist/components/ui/command.d.ts +0 -20
- package/dist/components/ui/context-menu.d.ts +0 -25
- package/dist/components/ui/dialog.d.ts +0 -19
- package/dist/components/ui/dropdown-menu.d.ts +0 -25
- package/dist/components/ui/field.d.ts +0 -24
- package/dist/components/ui/input.d.ts +0 -3
- package/dist/components/ui/kbd.d.ts +0 -3
- package/dist/components/ui/label.d.ts +0 -4
- package/dist/components/ui/popover.d.ts +0 -7
- package/dist/components/ui/radio-group.d.ts +0 -5
- package/dist/components/ui/scroll-area.d.ts +0 -5
- package/dist/components/ui/separator.d.ts +0 -4
- package/dist/components/ui/skeleton.d.ts +0 -2
- package/dist/components/ui/sonner.d.ts +0 -3
- package/dist/components/ui/tabs.d.ts +0 -7
- package/dist/components/ui/tooltip.d.ts +0 -7
- package/dist/dev/_components/nav-input.d.ts +0 -35
- package/dist/dev/app.d.ts +0 -2
- package/dist/dev/main.d.ts +0 -0
- package/dist/lib/utils.d.ts +0 -2
- package/dist/modules/default-item-registry/built-in-preview-renderers.d.ts +0 -3
- package/dist/modules/default-item-registry/default-item-cores.d.ts +0 -33
- package/dist/modules/default-item-registry/default-registry-entries.d.ts +0 -2
- package/dist/modules/default-item-registry/editors/editor-card-for-group.d.ts +0 -3
- package/dist/modules/default-item-registry/editors/editor-card-for-root.d.ts +0 -3
- package/dist/modules/default-item-registry/editors/editor-card-for-scg-mcg.d.ts +0 -3
- package/dist/modules/default-item-registry/index.d.ts +0 -19
- package/dist/modules/survey-editor/_components/sortable/sortable-item.d.ts +0 -5
- package/dist/modules/survey-editor/_components/sortable/sortable-wrapper.d.ts +0 -21
- package/dist/modules/survey-editor/ai/types.d.ts +0 -88
- package/dist/modules/survey-editor/editor-card/add-items/constants.d.ts +0 -5
- package/dist/modules/survey-editor/editor-card/add-items/hooks/use-add-item-actions.d.ts +0 -25
- package/dist/modules/survey-editor/editor-card/add-items/hooks/use-add-item-target.d.ts +0 -9
- package/dist/modules/survey-editor/editor-card/add-items/hooks/use-option-group-navigation.d.ts +0 -19
- package/dist/modules/survey-editor/editor-card/add-items/types.d.ts +0 -21
- package/dist/modules/survey-editor/editor-card/add-items/views/ai-item-view.d.ts +0 -10
- package/dist/modules/survey-editor/editor-card/add-items/views/back-button.d.ts +0 -5
- package/dist/modules/survey-editor/editor-card/add-items/views/blank-item-view.d.ts +0 -13
- package/dist/modules/survey-editor/editor-card/add-items/views/entry-view.d.ts +0 -15
- package/dist/modules/survey-editor/editor-card/add-items/views/structure-view.d.ts +0 -16
- package/dist/modules/survey-editor/editor-card/add-items.d.ts +0 -1
- package/dist/modules/survey-editor/editor-card/copy-item-dropdown-menu.d.ts +0 -5
- package/dist/modules/survey-editor/editor-card/delete-item-context-menu.d.ts +0 -5
- package/dist/modules/survey-editor/editor-card/delete-item-dropdown-menu.d.ts +0 -5
- package/dist/modules/survey-editor/editor-card/group-items.d.ts +0 -2
- package/dist/modules/survey-editor/editor-card/hooks/use-group-list-keyboard.d.ts +0 -35
- package/dist/modules/survey-editor/editor-card/index.d.ts +0 -2
- package/dist/modules/survey-editor/editor-card/item-color-menu.d.ts +0 -6
- package/dist/modules/survey-editor/editor-card/item-color-selector.d.ts +0 -5
- package/dist/modules/survey-editor/editor-card/item-editor-card-skeleton.d.ts +0 -2
- package/dist/modules/survey-editor/editor-card/item-editor-card.d.ts +0 -21
- package/dist/modules/survey-editor/editor-card/item-editor-context.d.ts +0 -20
- package/dist/modules/survey-editor/editor-card/item-key-editor.d.ts +0 -9
- package/dist/modules/survey-editor/editor-card/item-label-preview-and-editor.d.ts +0 -9
- package/dist/modules/survey-editor/editor-card/item-preview.d.ts +0 -8
- package/dist/modules/survey-editor/editor-card/item-type-icon-with-tooltip.d.ts +0 -8
- package/dist/modules/survey-editor/editor-instance-provider.d.ts +0 -7
- package/dist/modules/survey-editor/hooks/useClipboardValue.d.ts +0 -2
- package/dist/modules/survey-editor/hooks/useDeleteItem.d.ts +0 -9
- package/dist/modules/survey-editor/hooks/useEditor.d.ts +0 -12
- package/dist/modules/survey-editor/hooks/useEditorStateChange.d.ts +0 -17
- package/dist/modules/survey-editor/hooks/useKeyboardShortcuts.d.ts +0 -7
- package/dist/modules/survey-editor/index.d.ts +0 -7
- package/dist/modules/survey-editor/navigation/navigation-provider.d.ts +0 -11
- package/dist/modules/survey-editor/navigation/navigation.d.ts +0 -13
- package/dist/modules/survey-editor/navigation/types.d.ts +0 -18
- package/dist/modules/survey-editor/primitives/input-with-ai-popover.d.ts +0 -35
- package/dist/modules/survey-editor/registry/index.d.ts +0 -7
- package/dist/modules/survey-editor/registry/registry-mappers.d.ts +0 -19
- package/dist/modules/survey-editor/registry/search-adapter.d.ts +0 -19
- package/dist/modules/survey-editor/registry/types.d.ts +0 -154
- package/dist/modules/survey-editor/routes/editor/_components/footer.d.ts +0 -2
- package/dist/modules/survey-editor/routes/editor/_components/history-stack.d.ts +0 -2
- package/dist/modules/survey-editor/routes/editor/_components/main.d.ts +0 -2
- package/dist/modules/survey-editor/routes/editor/_components/sidebar.d.ts +0 -7
- package/dist/modules/survey-editor/routes/editor/index.d.ts +0 -5
- package/dist/modules/survey-editor/routes/editor/item-editor/_components/item-editor-toolbar/breadcrumbs-nav.d.ts +0 -2
- package/dist/modules/survey-editor/routes/editor/item-editor/_components/item-editor-toolbar/item-editor-toolbar.d.ts +0 -2
- package/dist/modules/survey-editor/routes/editor/item-editor/_components/item-editor-toolbar/language-picker.d.ts +0 -2
- package/dist/modules/survey-editor/routes/editor/item-editor/_components/item-editor-toolbar/search-trigger.d.ts +0 -3
- package/dist/modules/survey-editor/routes/editor/item-editor/_components/item-editor-toolbar/survey-search.d.ts +0 -7
- package/dist/modules/survey-editor/routes/editor/item-editor/index.d.ts +0 -2
- package/dist/modules/survey-editor/routes/editor/simulator/index.d.ts +0 -2
- package/dist/modules/survey-editor/routes/editor/translation-mode/index.d.ts +0 -2
- package/dist/modules/survey-editor/session-file.d.ts +0 -13
- package/dist/modules/survey-editor/store/editor-store-context.d.ts +0 -10
- package/dist/modules/survey-editor/store/editor-store-provider.d.ts +0 -7
- package/dist/modules/survey-editor/store/editor-store.d.ts +0 -96
- package/dist/modules/survey-editor/store/use-editor-store.d.ts +0 -4
- package/dist/modules/survey-editor/store/useItemNavigation.d.ts +0 -7
- package/dist/modules/survey-editor/survey-editor-config.d.ts +0 -17
- package/dist/modules/survey-editor/survey-editor.d.ts +0 -20
- package/dist/modules/survey-editor/utils/item-type-infos.d.ts +0 -23
- package/dist/modules/survey-player/index.d.ts +0 -1
- package/dist/modules/survey-player/survey-context.d.ts +0 -23
- package/dist/modules/survey-player/survey-item/survey-item-context.d.ts +0 -17
- package/dist/modules/survey-player/survey-item/survey-item-types/question-wrapper.d.ts +0 -5
- package/dist/modules/survey-player/survey-item/survey-item-types/single-choice-question-renderer.d.ts +0 -7
- package/dist/modules/survey-player/survey-item/survey-item.d.ts +0 -7
- package/dist/modules/survey-player/survey-player.d.ts +0 -2
- package/dist/styles.cjs.js +0 -0
- package/dist/styles.css +0 -2
- package/dist/styles.d.ts +0 -0
- package/dist/styles.es.js +0 -0
|
@@ -1,88 +0,0 @@
|
|
|
1
|
-
import { SurveyAIContextPack, SurveyAIContextPurpose, SurveyAIContextScope } from '@case-framework/survey-core/editor';
|
|
2
|
-
export type { SurveyAIContextPurpose, SurveyAIContextScope };
|
|
3
|
-
export type SurveyAIInvocationMode = "user" | "background";
|
|
4
|
-
export interface SurveyAIRequestOptions {
|
|
5
|
-
signal?: AbortSignal;
|
|
6
|
-
mode?: SurveyAIInvocationMode;
|
|
7
|
-
}
|
|
8
|
-
export interface AISuggestedText {
|
|
9
|
-
text: string;
|
|
10
|
-
}
|
|
11
|
-
export interface SuggestItemKeySuggestion extends AISuggestedText {
|
|
12
|
-
rationale?: string;
|
|
13
|
-
}
|
|
14
|
-
export interface SuggestItemLabelSuggestion extends AISuggestedText {
|
|
15
|
-
tone?: string;
|
|
16
|
-
}
|
|
17
|
-
export interface SuggestItemKeyRequest {
|
|
18
|
-
draftKey: string;
|
|
19
|
-
currentKey: string;
|
|
20
|
-
siblingKeys: string[];
|
|
21
|
-
childContentHints?: string[];
|
|
22
|
-
maxSuggestions?: number;
|
|
23
|
-
context: SurveyAIContextPack;
|
|
24
|
-
}
|
|
25
|
-
export interface SuggestItemKeyResult {
|
|
26
|
-
suggestions: SuggestItemKeySuggestion[];
|
|
27
|
-
}
|
|
28
|
-
export interface SuggestItemLabelRequest {
|
|
29
|
-
draftLabel: string;
|
|
30
|
-
itemType: string;
|
|
31
|
-
locale?: string;
|
|
32
|
-
maxSuggestions?: number;
|
|
33
|
-
context: SurveyAIContextPack;
|
|
34
|
-
}
|
|
35
|
-
export interface SuggestItemLabelResult {
|
|
36
|
-
suggestions: SuggestItemLabelSuggestion[];
|
|
37
|
-
}
|
|
38
|
-
export interface GeneratedItemIntentSuggestion {
|
|
39
|
-
tempId: string;
|
|
40
|
-
parentTempId?: string;
|
|
41
|
-
itemType: string;
|
|
42
|
-
key: string;
|
|
43
|
-
itemLabel?: string;
|
|
44
|
-
confidence?: number;
|
|
45
|
-
}
|
|
46
|
-
export interface GenerateItemFromIntentRequest {
|
|
47
|
-
intent: string;
|
|
48
|
-
targetParentId: string;
|
|
49
|
-
allowedItemTypes: string[];
|
|
50
|
-
maxItems?: number;
|
|
51
|
-
locale?: string;
|
|
52
|
-
context: SurveyAIContextPack;
|
|
53
|
-
}
|
|
54
|
-
export interface GenerateItemFromIntentResult {
|
|
55
|
-
items: GeneratedItemIntentSuggestion[];
|
|
56
|
-
}
|
|
57
|
-
export interface TranslateContentEntry {
|
|
58
|
-
id: string;
|
|
59
|
-
text: string;
|
|
60
|
-
kind: string;
|
|
61
|
-
}
|
|
62
|
-
export interface TranslateContentRequest {
|
|
63
|
-
sourceLocale: string;
|
|
64
|
-
targetLocales: string[];
|
|
65
|
-
entries: TranslateContentEntry[];
|
|
66
|
-
context: SurveyAIContextPack;
|
|
67
|
-
}
|
|
68
|
-
export interface TranslateContentResult {
|
|
69
|
-
translations: Record<string, Record<string, string>>;
|
|
70
|
-
}
|
|
71
|
-
export interface SurveyEditorAIProvider {
|
|
72
|
-
suggestItemKey?: (request: SuggestItemKeyRequest, options?: SurveyAIRequestOptions) => Promise<SuggestItemKeyResult>;
|
|
73
|
-
suggestItemLabel?: (request: SuggestItemLabelRequest, options?: SurveyAIRequestOptions) => Promise<SuggestItemLabelResult>;
|
|
74
|
-
generateItemFromIntent?: (request: GenerateItemFromIntentRequest, options?: SurveyAIRequestOptions) => Promise<GenerateItemFromIntentResult>;
|
|
75
|
-
translateContent?: (request: TranslateContentRequest, options?: SurveyAIRequestOptions) => Promise<TranslateContentResult>;
|
|
76
|
-
}
|
|
77
|
-
export interface BuildSurveyAIContextOptions {
|
|
78
|
-
purpose?: SurveyAIContextPurpose;
|
|
79
|
-
scope?: SurveyAIContextScope;
|
|
80
|
-
focusItemId?: string;
|
|
81
|
-
includeRawSurvey?: boolean;
|
|
82
|
-
outlineLimit?: number;
|
|
83
|
-
includeIndexes?: boolean;
|
|
84
|
-
includeFocusItemTree?: boolean;
|
|
85
|
-
focusItemTreeLimit?: number;
|
|
86
|
-
translationSnippetsPerItemLimit?: number;
|
|
87
|
-
translationSnippetTextLimit?: number;
|
|
88
|
-
}
|
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
import { AddDialogView } from './types';
|
|
2
|
-
export declare const LAST_USED_ITEM_TYPE_KEY = "case.survey-editor.last-used-item-type";
|
|
3
|
-
export declare const DEFAULT_TOP_ITEM_TYPES: readonly ["display", "singleChoiceQuestion"];
|
|
4
|
-
export declare const STRUCTURE_ITEM_TYPES: Set<string>;
|
|
5
|
-
export declare const FOOTER_HINTS: Record<AddDialogView, string>;
|
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
import { SurveyItemTranslations, SurveyItemCore } from '@case-framework/survey-core';
|
|
2
|
-
import { SurveyItemClipboardData, Target } from '@case-framework/survey-core/editor';
|
|
3
|
-
import { ComposedEditorItemRegistry } from '../../../registry';
|
|
4
|
-
import { ItemTypeOption } from '../types';
|
|
5
|
-
import { GeneratedItemIntentSuggestion } from '../../../ai/types';
|
|
6
|
-
interface UseAddItemActionsParams {
|
|
7
|
-
editorItemRegistry: ComposedEditorItemRegistry;
|
|
8
|
-
addItem: (target: Target | null, item: SurveyItemCore, content?: SurveyItemTranslations) => void;
|
|
9
|
-
pasteItem: (clipboardData: SurveyItemClipboardData, target: Target) => string;
|
|
10
|
-
commitByUser: (meta: {
|
|
11
|
-
label: string;
|
|
12
|
-
}) => void;
|
|
13
|
-
setPreferredPreviewItemId: (itemId: string | null) => void;
|
|
14
|
-
closeDialog: () => void;
|
|
15
|
-
targetGroupId?: string;
|
|
16
|
-
rootItemId?: string;
|
|
17
|
-
clipboardValue: string | null;
|
|
18
|
-
setLastUsedItemType: (itemType: string) => void;
|
|
19
|
-
}
|
|
20
|
-
export declare function useAddItemActions({ editorItemRegistry, addItem, pasteItem, commitByUser, setPreferredPreviewItemId, closeDialog, targetGroupId, rootItemId, clipboardValue, setLastUsedItemType, }: UseAddItemActionsParams): {
|
|
21
|
-
handleSelectOption: (option: ItemTypeOption) => void;
|
|
22
|
-
pasteFromClipboard: () => void;
|
|
23
|
-
createItemsFromIntent: (items: GeneratedItemIntentSuggestion[]) => void;
|
|
24
|
-
};
|
|
25
|
-
export {};
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import { SurveyEditor } from '@case-framework/survey-core/editor';
|
|
2
|
-
import { TargetGroupInfo } from '../types';
|
|
3
|
-
interface UseAddItemTargetParams {
|
|
4
|
-
editor: SurveyEditor | null;
|
|
5
|
-
selectedItemId: string | null;
|
|
6
|
-
targetParentId?: string;
|
|
7
|
-
}
|
|
8
|
-
export declare function useAddItemTarget({ editor, selectedItemId, targetParentId, }: UseAddItemTargetParams): TargetGroupInfo | null;
|
|
9
|
-
export {};
|
package/dist/modules/survey-editor/editor-card/add-items/hooks/use-option-group-navigation.d.ts
DELETED
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
import { FocusEvent as ReactFocusEvent, KeyboardEvent as ReactKeyboardEvent, RefObject } from 'react';
|
|
2
|
-
interface UseOptionGroupNavigationParams<TOption> {
|
|
3
|
-
options: TOption[];
|
|
4
|
-
onSelect: (option: TOption) => void;
|
|
5
|
-
rowSize?: number;
|
|
6
|
-
}
|
|
7
|
-
export interface OptionGroupNavigation {
|
|
8
|
-
groupRef: RefObject<HTMLDivElement | null>;
|
|
9
|
-
activeIndex: number;
|
|
10
|
-
isFocused: boolean;
|
|
11
|
-
setActiveIndex: (index: number) => void;
|
|
12
|
-
focusGroup: () => void;
|
|
13
|
-
reset: (index?: number) => void;
|
|
14
|
-
handleGroupFocus: () => void;
|
|
15
|
-
handleGroupBlur: (event: ReactFocusEvent<HTMLDivElement>) => void;
|
|
16
|
-
handleGroupKeyDown: (event: ReactKeyboardEvent<HTMLDivElement>) => void;
|
|
17
|
-
}
|
|
18
|
-
export declare function useOptionGroupNavigation<TOption>({ options, onSelect, rowSize, }: UseOptionGroupNavigationParams<TOption>): OptionGroupNavigation;
|
|
19
|
-
export {};
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
import { LucideIcon } from 'lucide-react';
|
|
2
|
-
import { ItemTypeInfos } from '../../utils/item-type-infos';
|
|
3
|
-
export type AddDialogView = 'entry' | 'blank-item' | 'structure' | 'ai' | 'catalogue';
|
|
4
|
-
export interface ItemTypeOption extends ItemTypeInfos {
|
|
5
|
-
itemType: string;
|
|
6
|
-
categories: string[];
|
|
7
|
-
}
|
|
8
|
-
export interface EntryOption {
|
|
9
|
-
id: AddDialogView;
|
|
10
|
-
title: string;
|
|
11
|
-
description: string;
|
|
12
|
-
icon: LucideIcon;
|
|
13
|
-
enabled: boolean;
|
|
14
|
-
}
|
|
15
|
-
export interface TargetGroupInfo {
|
|
16
|
-
id: string;
|
|
17
|
-
itemKey?: string;
|
|
18
|
-
itemLabel?: string;
|
|
19
|
-
isRoot: boolean;
|
|
20
|
-
itemCount: number;
|
|
21
|
-
}
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
interface AIItemViewProps {
|
|
2
|
-
intent: string;
|
|
3
|
-
onIntentChange: (value: string) => void;
|
|
4
|
-
onGenerate: () => void;
|
|
5
|
-
onBack: () => void;
|
|
6
|
-
isGenerating: boolean;
|
|
7
|
-
isEnabled: boolean;
|
|
8
|
-
}
|
|
9
|
-
export declare function AIItemView({ intent, onIntentChange, onGenerate, onBack, isGenerating, isEnabled, }: AIItemViewProps): import("react/jsx-runtime").JSX.Element;
|
|
10
|
-
export {};
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import { ItemTypeOption } from '../types';
|
|
2
|
-
interface BlankItemViewProps {
|
|
3
|
-
search: string;
|
|
4
|
-
onSearchChange: (value: string) => void;
|
|
5
|
-
hasValidClipboardItem: boolean;
|
|
6
|
-
onPasteFromClipboard: () => void;
|
|
7
|
-
groupedOptions: Array<[string, ItemTypeOption[]]>;
|
|
8
|
-
getCategoryLabel: (category: string) => string;
|
|
9
|
-
onSelectOption: (option: ItemTypeOption) => void;
|
|
10
|
-
onBack: () => void;
|
|
11
|
-
}
|
|
12
|
-
export declare function BlankItemView({ search, onSearchChange, hasValidClipboardItem, onPasteFromClipboard, groupedOptions, getCategoryLabel, onSelectOption, onBack, }: BlankItemViewProps): import("react/jsx-runtime").JSX.Element;
|
|
13
|
-
export {};
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
import { FocusEvent as ReactFocusEvent, KeyboardEvent as ReactKeyboardEvent, RefObject } from 'react';
|
|
2
|
-
import { EntryOption } from '../types';
|
|
3
|
-
interface EntryViewProps {
|
|
4
|
-
options: EntryOption[];
|
|
5
|
-
optionGroupRef: RefObject<HTMLDivElement | null>;
|
|
6
|
-
activeIndex: number;
|
|
7
|
-
isFocused: boolean;
|
|
8
|
-
setActiveIndex: (index: number) => void;
|
|
9
|
-
onGroupFocus: () => void;
|
|
10
|
-
onGroupBlur: (event: ReactFocusEvent<HTMLDivElement>) => void;
|
|
11
|
-
onGroupKeyDown: (event: ReactKeyboardEvent<HTMLDivElement>) => void;
|
|
12
|
-
onSelectOption: (option: EntryOption) => void;
|
|
13
|
-
}
|
|
14
|
-
export declare function EntryView({ options, optionGroupRef, activeIndex, isFocused, setActiveIndex, onGroupFocus, onGroupBlur, onGroupKeyDown, onSelectOption, }: EntryViewProps): import("react/jsx-runtime").JSX.Element;
|
|
15
|
-
export {};
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
import { FocusEvent as ReactFocusEvent, KeyboardEvent as ReactKeyboardEvent, RefObject } from 'react';
|
|
2
|
-
import { ItemTypeOption } from '../types';
|
|
3
|
-
interface StructureViewProps {
|
|
4
|
-
options: ItemTypeOption[];
|
|
5
|
-
optionGroupRef: RefObject<HTMLDivElement | null>;
|
|
6
|
-
activeIndex: number;
|
|
7
|
-
isFocused: boolean;
|
|
8
|
-
setActiveIndex: (index: number) => void;
|
|
9
|
-
onGroupFocus: () => void;
|
|
10
|
-
onGroupBlur: (event: ReactFocusEvent<HTMLDivElement>) => void;
|
|
11
|
-
onGroupKeyDown: (event: ReactKeyboardEvent<HTMLDivElement>) => void;
|
|
12
|
-
onSelectOption: (option: ItemTypeOption) => void;
|
|
13
|
-
onBack: () => void;
|
|
14
|
-
}
|
|
15
|
-
export declare function StructureView({ options, optionGroupRef, activeIndex, isFocused, setActiveIndex, onGroupFocus, onGroupBlur, onGroupKeyDown, onSelectOption, onBack, }: StructureViewProps): import("react/jsx-runtime").JSX.Element;
|
|
16
|
-
export {};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export declare const AddItemDialog: React.FC;
|
|
@@ -1,35 +0,0 @@
|
|
|
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
|
-
hasParentGroup: boolean;
|
|
9
|
-
clipboardValue: string | null;
|
|
10
|
-
previewItemId: string | null;
|
|
11
|
-
openAddDialogForCurrentGroup: () => void;
|
|
12
|
-
openFocusedItem: (itemId: string) => void;
|
|
13
|
-
openParentGroup: () => void;
|
|
14
|
-
selectPreviewItem: (itemId: string) => void;
|
|
15
|
-
moveItemByOffset: (itemId: string, offset: -1 | 1) => boolean;
|
|
16
|
-
parseSurveyItemClipboard: (value: string | null) => SurveyItemClipboardData | null;
|
|
17
|
-
pasteItemFromClipboardData: (clipboardData: SurveyItemClipboardData, parentId: string) => string;
|
|
18
|
-
onPasteCommitted: (newItemId: string) => void;
|
|
19
|
-
copyItemToClipboard: (itemId: string) => void;
|
|
20
|
-
}
|
|
21
|
-
export declare const useGroupListKeyboard: ({ addItemDialogOpen, containerRef, groupId, itemIds, hasParentGroup, clipboardValue, previewItemId, openAddDialogForCurrentGroup, openFocusedItem, openParentGroup, selectPreviewItem, moveItemByOffset, parseSurveyItemClipboard, pasteItemFromClipboardData, onPasteCommitted, copyItemToClipboard, }: UseGroupListKeyboardParams) => {
|
|
22
|
-
getItemButtonProps: (itemId: string) => {
|
|
23
|
-
"data-group-list-target": string;
|
|
24
|
-
"data-group-list-item-id": string;
|
|
25
|
-
onFocus: () => void;
|
|
26
|
-
};
|
|
27
|
-
getBackButtonProps: () => {
|
|
28
|
-
"data-group-list-target": string;
|
|
29
|
-
};
|
|
30
|
-
getAddButtonProps: () => {
|
|
31
|
-
"data-group-list-target": string;
|
|
32
|
-
};
|
|
33
|
-
onListKeyDown: (event: ReactKeyboardEvent<HTMLElement>) => void;
|
|
34
|
-
};
|
|
35
|
-
export {};
|
|
@@ -1,6 +0,0 @@
|
|
|
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 {};
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
import { LucideIcon } from 'lucide-react';
|
|
2
|
-
import { SurveyItemCore } from '@case-framework/survey-core';
|
|
3
|
-
export interface CommonItemEditorCardProps {
|
|
4
|
-
item: SurveyItemCore;
|
|
5
|
-
}
|
|
6
|
-
interface NavItem {
|
|
7
|
-
id: string;
|
|
8
|
-
label: string;
|
|
9
|
-
icon: LucideIcon;
|
|
10
|
-
}
|
|
11
|
-
interface ItemEditorCardProps {
|
|
12
|
-
surveyItem: SurveyItemCore;
|
|
13
|
-
menu: {
|
|
14
|
-
items: React.ReactNode[];
|
|
15
|
-
hideDeleteItem?: boolean;
|
|
16
|
-
};
|
|
17
|
-
navItems: NavItem[];
|
|
18
|
-
children: React.ReactNode;
|
|
19
|
-
}
|
|
20
|
-
declare const ItemEditorCard: React.FC<ItemEditorCardProps>;
|
|
21
|
-
export default ItemEditorCard;
|
|
@@ -1,20 +0,0 @@
|
|
|
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 {};
|
|
@@ -1,9 +0,0 @@
|
|
|
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;
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
interface ItemLabelPreviewAndEditorProps {
|
|
2
|
-
itemId: string;
|
|
3
|
-
itemType: string;
|
|
4
|
-
itemLabel: string;
|
|
5
|
-
maxSuggestions?: number;
|
|
6
|
-
onChangeItemLabel: (newLabel: string) => void;
|
|
7
|
-
}
|
|
8
|
-
declare const ItemLabelPreviewAndEditor: React.FC<ItemLabelPreviewAndEditorProps>;
|
|
9
|
-
export default ItemLabelPreviewAndEditor;
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import { SurveyItemCore } from '@case-framework/survey-core';
|
|
2
|
-
import { ItemPreviewMode } from '../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;
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import { ItemTypeInfos } from '../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;
|
|
@@ -1,7 +0,0 @@
|
|
|
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 {};
|
|
@@ -1,12 +0,0 @@
|
|
|
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;
|
|
@@ -1,17 +0,0 @@
|
|
|
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 {};
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
export { SurveyEditor } from './survey-editor';
|
|
2
|
-
export type { SurveyEditorProps, SurveyEditorStateChange } from './survey-editor';
|
|
3
|
-
export { EditorInstanceProvider } from './editor-instance-provider';
|
|
4
|
-
export type { SurveyEditorNavigationAdapter, SurveyEditorLocation } from './navigation/types';
|
|
5
|
-
export type { AISuggestedText, BuildSurveyAIContextOptions, GenerateItemFromIntentRequest, GenerateItemFromIntentResult, GeneratedItemIntentSuggestion, SuggestItemKeyRequest, SuggestItemKeyResult, SuggestItemKeySuggestion, SuggestItemLabelRequest, SuggestItemLabelResult, SuggestItemLabelSuggestion, SurveyEditorAIProvider, SurveyAIContextPurpose, SurveyAIContextScope, SurveyAIInvocationMode, SurveyAIRequestOptions, TranslateContentEntry, TranslateContentRequest, TranslateContentResult, } from './ai/types';
|
|
6
|
-
export * from './registry';
|
|
7
|
-
export { buildSurveyFileName, createBlankEditorState, createEditorStateFromRawSurvey, parseEditorStateFromJsonText, serializeSurveyStateForFile, type ParsedSurveySession, type ParsedSurveySessionFormat, } from './session-file';
|
|
@@ -1,11 +0,0 @@
|
|
|
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 {};
|
|
@@ -1,13 +0,0 @@
|
|
|
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;
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
export interface ItemEditorLocation {
|
|
2
|
-
view: 'item-editor';
|
|
3
|
-
itemId?: string;
|
|
4
|
-
}
|
|
5
|
-
export interface TranslationModeLocation {
|
|
6
|
-
view: 'translation-mode';
|
|
7
|
-
}
|
|
8
|
-
export interface SimulatorLocation {
|
|
9
|
-
view: 'simulator';
|
|
10
|
-
}
|
|
11
|
-
export type SurveyEditorLocation = ItemEditorLocation | TranslationModeLocation | SimulatorLocation;
|
|
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
|
-
}
|
|
@@ -1,35 +0,0 @@
|
|
|
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;
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
import { ItemTypeRegistry, SurveyItemCore } from '@case-framework/survey-core';
|
|
2
|
-
import { ComposedEditorItemRegistry, EditorItemDefinition, EntriesToComposedEditorRegistryOptions, EntriesToParticipantRegistryOptions, ItemRegistryEntry, RegistryValidationOptions, RegistryValidationResult, SurveyPlayerItemRegistry } from './types';
|
|
3
|
-
export declare function validateRegistryEntries(entries: ItemRegistryEntry[], options: RegistryValidationOptions): RegistryValidationResult;
|
|
4
|
-
/**
|
|
5
|
-
* Derive ItemTypeRegistry from unified entries for Survey / SurveyEditor.
|
|
6
|
-
* Uses built-in registry for group/pageBreak; plugin entries supply constructors for custom types.
|
|
7
|
-
*/
|
|
8
|
-
export declare function entriesToItemTypeRegistry(entries: ItemRegistryEntry[]): ItemTypeRegistry;
|
|
9
|
-
/**
|
|
10
|
-
* Derive participant registry from unified entries.
|
|
11
|
-
* Lightweight: core + renderer only. Use this for survey player / participant app.
|
|
12
|
-
*/
|
|
13
|
-
export declare function entriesToParticipantRegistry(entries: ItemRegistryEntry[], options?: EntriesToParticipantRegistryOptions): SurveyPlayerItemRegistry;
|
|
14
|
-
/**
|
|
15
|
-
* Derive ComposedEditorItemRegistry from unified entries for the editor.
|
|
16
|
-
* Ensures Group and PageBreak have definitions; uses coreRegistry from entries.
|
|
17
|
-
*/
|
|
18
|
-
export declare function entriesToComposedEditorRegistry(entries: ItemRegistryEntry[], options?: EntriesToComposedEditorRegistryOptions): ComposedEditorItemRegistry;
|
|
19
|
-
export declare function getRegistryEntryForItem(registry: ComposedEditorItemRegistry, item: SurveyItemCore): EditorItemDefinition | undefined;
|
|
@@ -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;
|