@case-framework/survey-ui 0.5.0 → 0.6.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/dist/default-item-cores-C6VK2LFe.js +10 -0
- package/dist/default-item-cores-C6VK2LFe.js.map +1 -0
- package/dist/default-item-cores-gdu37TFX.mjs +3988 -0
- package/dist/default-item-cores-gdu37TFX.mjs.map +1 -0
- package/dist/item-core-registry.cjs.js +2 -0
- package/dist/item-core-registry.cjs.js.map +1 -0
- package/dist/item-core-registry.es.js +11 -0
- package/dist/item-core-registry.es.js.map +1 -0
- package/dist/src/components/common/sortable-tree.d.ts +59 -0
- package/dist/src/components/rich-text/rich-text-content-view.d.ts +6 -2
- package/dist/src/components/ui/dialog.d.ts +2 -1
- package/dist/src/components/ui/resizable.d.ts +7 -0
- package/dist/src/components/ui/toggle.d.ts +1 -1
- package/dist/src/dev/localizations/de.d.ts +2 -2
- package/dist/src/index.d.ts +7 -4
- package/dist/src/item-core-registry.d.ts +4 -0
- package/dist/src/modules/default-item-registry/item-authoring-state.d.ts +15 -0
- package/dist/src/modules/default-item-registry/items/choice/editor/option-edit-dialog.d.ts +10 -3
- package/dist/src/modules/default-item-registry/items/form/model.d.ts +4 -1
- package/dist/src/modules/survey-editor/ai/create-provider.d.ts +22 -0
- package/dist/src/modules/survey-editor/ai/types.d.ts +6 -83
- package/dist/src/modules/survey-editor/ai/use-survey-assistant-integration.d.ts +16 -0
- package/dist/src/modules/survey-editor/assistant/apply.d.ts +24 -0
- package/dist/src/modules/survey-editor/assistant/index.d.ts +2 -0
- package/dist/src/modules/survey-editor/assistant/snapshot.d.ts +39 -0
- package/dist/src/modules/survey-editor/editor-card/add-items/constants.d.ts +2 -0
- package/dist/src/modules/survey-editor/editor-card/add-items/hooks/use-add-item-actions.d.ts +4 -5
- package/dist/src/modules/survey-editor/editor-card/add-items/hooks/use-option-group-navigation.d.ts +2 -1
- package/dist/src/modules/survey-editor/editor-card/add-items/types.d.ts +1 -1
- package/dist/src/modules/survey-editor/editor-card/add-items/views/item-type-grid-view.d.ts +30 -0
- package/dist/src/modules/survey-editor/editor-card/delete-item-dropdown-menu.d.ts +3 -1
- package/dist/src/modules/survey-editor/editor-card/expression-pseudo-code.d.ts +8 -0
- package/dist/src/modules/survey-editor/editor-card/hooks/use-group-list-keyboard.d.ts +1 -1
- package/dist/src/modules/survey-editor/editor-card/item-authoring-state-preview.d.ts +16 -0
- package/dist/src/modules/survey-editor/editor-card/item-editor-card.d.ts +1 -6
- package/dist/src/modules/survey-editor/editor-card/item-editor-context.d.ts +5 -2
- package/dist/src/modules/survey-editor/editor-card/item-expression-overview.d.ts +33 -0
- package/dist/src/modules/survey-editor/editor-instance-provider.d.ts +2 -0
- package/dist/src/modules/survey-editor/hooks/useDeleteItem.d.ts +2 -0
- package/dist/src/modules/survey-editor/index.d.ts +5 -2
- package/dist/src/modules/survey-editor/localization/date-fns.d.ts +1 -1
- package/dist/src/modules/survey-editor/localization/default-all.d.ts +2 -2
- package/dist/src/modules/survey-editor/localization/default-en.d.ts +2 -2
- package/dist/src/modules/survey-editor/localization/default-nl.d.ts +2 -2
- package/dist/src/modules/survey-editor/localization/index.d.ts +0 -2
- package/dist/src/modules/survey-editor/localization/runtime.d.ts +4 -4
- package/dist/src/modules/survey-editor/navigation/location.d.ts +6 -0
- package/dist/src/modules/survey-editor/navigation/navigation-provider.d.ts +2 -1
- package/dist/src/modules/survey-editor/navigation/navigation.d.ts +10 -1
- package/dist/src/modules/survey-editor/navigation/types.d.ts +6 -1
- package/dist/src/modules/survey-editor/primitives/input-with-ai-popover.d.ts +2 -2
- package/dist/src/modules/survey-editor/registry/authoring-state.d.ts +17 -0
- package/dist/src/modules/survey-editor/registry/index.d.ts +1 -0
- package/dist/src/modules/survey-editor/registry/registry-mappers.d.ts +3 -3
- package/dist/src/modules/survey-editor/registry/types.d.ts +44 -4
- package/dist/src/modules/survey-editor/routes/editor/_components/assistant-authoring-lock.d.ts +7 -0
- package/dist/src/modules/survey-editor/routes/editor/_components/editor-assistant-slot-context.d.ts +6 -0
- package/dist/src/modules/survey-editor/routes/editor/_components/editor-assistant-slot.d.ts +8 -0
- package/dist/src/modules/survey-editor/routes/editor/_components/editor-mode-switch.d.ts +7 -0
- package/dist/src/modules/survey-editor/routes/editor/_components/editor-workspace.d.ts +30 -0
- package/dist/src/modules/survey-editor/routes/editor/_components/footer.d.ts +1 -1
- package/dist/src/modules/survey-editor/routes/editor/_components/main.d.ts +1 -1
- package/dist/src/modules/survey-editor/routes/editor/_components/workspace-presets.d.ts +75 -0
- package/dist/src/modules/survey-editor/routes/editor/index.d.ts +1 -1
- package/dist/src/modules/survey-editor/routes/editor/item-editor/_components/item-editor-toolbar/item-editor-toolbar.d.ts +0 -1
- package/dist/src/modules/survey-editor/routes/editor/item-editor/_components/survey-outline.d.ts +3 -0
- package/dist/src/modules/survey-editor/routes/editor/item-editor/_components/survey-workspace.d.ts +12 -0
- package/dist/src/modules/survey-editor/routes/editor/item-editor/index.d.ts +0 -1
- package/dist/src/modules/survey-editor/routes/editor/preview-mode/index.d.ts +7 -0
- package/dist/src/modules/survey-editor/routes/editor/preview-mode/page-break-divider.d.ts +6 -0
- package/dist/src/modules/survey-editor/routes/editor/preview-mode/preview-controls.d.ts +15 -0
- package/dist/src/modules/survey-editor/routes/editor/preview-mode/preview-tree.d.ts +26 -0
- package/dist/src/modules/survey-editor/routes/editor/preview-mode/survey-preview-canvas.d.ts +16 -0
- package/dist/src/modules/survey-editor/routes/editor/preview-mode/survey-preview-item.d.ts +13 -0
- package/dist/src/modules/survey-editor/routes/editor/preview-mode/use-preview-preferences.d.ts +14 -0
- package/dist/src/modules/survey-editor/store/editor-store.d.ts +7 -1
- package/dist/src/modules/survey-editor/survey-editor-config.d.ts +14 -5
- package/dist/src/modules/survey-editor/survey-editor.d.ts +14 -2
- package/dist/src/modules/survey-editor/workspace.d.ts +17 -0
- package/dist/src/modules/survey-player/index.d.ts +0 -1
- package/dist/src/modules/survey-player/localization/default-en.d.ts +2 -2
- package/dist/src/modules/survey-player/localization/runtime.d.ts +5 -4
- package/dist/src/modules/survey-player/survey-context.d.ts +9 -4
- package/dist/src/modules/survey-player/survey-player.d.ts +2 -2
- package/dist/survey-ui.cjs.js +101 -76
- package/dist/survey-ui.cjs.js.map +1 -1
- package/dist/survey-ui.css +2 -2
- package/dist/survey-ui.es.js +31869 -26677
- package/dist/survey-ui.es.js.map +1 -1
- package/package.json +26 -12
- package/dist/src/modules/default-item-registry/items/choice/editor/option-embedded-form-dialog.d.ts +0 -15
- package/dist/src/modules/survey-editor/editor-card/add-items/views/ai-item-view.d.ts +0 -10
- package/dist/src/modules/survey-editor/localization/types.d.ts +0 -7
- package/dist/src/modules/survey-player/localization/types.d.ts +0 -7
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require(`./default-item-cores-C6VK2LFe.js`);var t={choiceItem:e.t,formItem:e.n,infoItem:e.r};exports.ChoiceItemCore=e.t,exports.FormItemCore=e.n,exports.InfoItemCore=e.r,exports.defaultItemCoreRegistry=t;
|
|
2
|
+
//# sourceMappingURL=item-core-registry.cjs.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"item-core-registry.cjs.js","names":[],"sources":["../src/item-core-registry.ts"],"sourcesContent":["import type { ItemTypeRegistry } from \"@case-framework/survey-core\";\nimport {\n ChoiceItemCore,\n FormItemCore,\n InfoItemCore,\n} from \"./modules/default-item-registry/default-item-cores\";\n\nexport const defaultItemCoreRegistry: ItemTypeRegistry = {\n choiceItem: ChoiceItemCore,\n formItem: FormItemCore,\n infoItem: InfoItemCore,\n};\n\nexport { ChoiceItemCore, FormItemCore, InfoItemCore };\n"],"mappings":"uHAOA,IAAa,EAA4C,CACvD,WAAY,EAAA,EACZ,SAAU,EAAA,EACV,SAAU,EAAA,EACX"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { n as e, r as t, t as n } from "./default-item-cores-gdu37TFX.mjs";
|
|
2
|
+
//#region src/item-core-registry.ts
|
|
3
|
+
var r = {
|
|
4
|
+
choiceItem: n,
|
|
5
|
+
formItem: e,
|
|
6
|
+
infoItem: t
|
|
7
|
+
};
|
|
8
|
+
//#endregion
|
|
9
|
+
export { n as ChoiceItemCore, e as FormItemCore, t as InfoItemCore, r as defaultItemCoreRegistry };
|
|
10
|
+
|
|
11
|
+
//# sourceMappingURL=item-core-registry.es.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"item-core-registry.es.js","names":[],"sources":["../src/item-core-registry.ts"],"sourcesContent":["import type { ItemTypeRegistry } from \"@case-framework/survey-core\";\nimport {\n ChoiceItemCore,\n FormItemCore,\n InfoItemCore,\n} from \"./modules/default-item-registry/default-item-cores\";\n\nexport const defaultItemCoreRegistry: ItemTypeRegistry = {\n choiceItem: ChoiceItemCore,\n formItem: FormItemCore,\n infoItem: InfoItemCore,\n};\n\nexport { ChoiceItemCore, FormItemCore, InfoItemCore };\n"],"mappings":";;AAOA,IAAa,IAA4C;CACvD,YAAY;CACZ,UAAU;CACV,UAAU;CACX"}
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
import { ReactNode } from 'react';
|
|
2
|
+
export interface SortableTreePosition {
|
|
3
|
+
parentId: string;
|
|
4
|
+
index: number;
|
|
5
|
+
}
|
|
6
|
+
export interface SortableTreeMoveEvent<T> {
|
|
7
|
+
id: string;
|
|
8
|
+
item: T;
|
|
9
|
+
from: SortableTreePosition;
|
|
10
|
+
to: SortableTreePosition;
|
|
11
|
+
}
|
|
12
|
+
export interface SortableTreeDropEvent<T> extends SortableTreeMoveEvent<T> {
|
|
13
|
+
parent: T | null;
|
|
14
|
+
}
|
|
15
|
+
export type SortableTreeDropPosition = "before" | "inside" | "after";
|
|
16
|
+
export interface SortableTreeRenderItemProps<T> {
|
|
17
|
+
item: T;
|
|
18
|
+
id: string;
|
|
19
|
+
parentId: string;
|
|
20
|
+
index: number;
|
|
21
|
+
depth: number;
|
|
22
|
+
indent: number;
|
|
23
|
+
isBranch: boolean;
|
|
24
|
+
isExpanded: boolean;
|
|
25
|
+
isDragging: boolean;
|
|
26
|
+
isDropTarget: boolean;
|
|
27
|
+
isDropParent: boolean;
|
|
28
|
+
dropPosition: SortableTreeDropPosition | null;
|
|
29
|
+
dropDepth: number | null;
|
|
30
|
+
isOverlay: boolean;
|
|
31
|
+
dragHandleRef: (element: Element | null) => void;
|
|
32
|
+
toggleExpanded: () => void;
|
|
33
|
+
}
|
|
34
|
+
export interface SortableTreeEmptyGroupProps<T> {
|
|
35
|
+
parent: T | null;
|
|
36
|
+
parentId: string;
|
|
37
|
+
depth: number;
|
|
38
|
+
indent: number;
|
|
39
|
+
}
|
|
40
|
+
export interface SortableTreeProps<T> {
|
|
41
|
+
items: readonly T[];
|
|
42
|
+
rootId: string;
|
|
43
|
+
getId: (item: T) => string;
|
|
44
|
+
getChildren: (item: T) => readonly T[];
|
|
45
|
+
renderItem: (props: SortableTreeRenderItemProps<T>) => ReactNode;
|
|
46
|
+
onMove: (event: SortableTreeMoveEvent<T>) => void;
|
|
47
|
+
isBranch?: (item: T) => boolean;
|
|
48
|
+
canDrag?: (item: T) => boolean;
|
|
49
|
+
canDrop?: (event: SortableTreeDropEvent<T>) => boolean;
|
|
50
|
+
expandedIds?: ReadonlySet<string>;
|
|
51
|
+
defaultExpandedIds?: Iterable<string>;
|
|
52
|
+
onExpandedChange?: (id: string, expanded: boolean) => void;
|
|
53
|
+
renderEmptyGroup?: (props: SortableTreeEmptyGroupProps<T>) => ReactNode;
|
|
54
|
+
ariaLabel?: string;
|
|
55
|
+
indent?: number;
|
|
56
|
+
className?: string;
|
|
57
|
+
levelClassName?: string;
|
|
58
|
+
}
|
|
59
|
+
export declare function SortableTree<T>({ items, rootId, getId, getChildren, renderItem, onMove, isBranch, canDrag, canDrop, expandedIds, defaultExpandedIds, onExpandedChange, renderEmptyGroup, ariaLabel, indent, className, levelClassName, }: SortableTreeProps<T>): import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Content } from '@case-framework/survey-core';
|
|
1
|
+
import { Content, RichTextHeadingBlock } from '@case-framework/survey-core';
|
|
2
2
|
export interface RichTextContentViewProps {
|
|
3
3
|
content?: Content;
|
|
4
4
|
className?: string;
|
|
@@ -7,5 +7,9 @@ export interface RichTextContentViewProps {
|
|
|
7
7
|
singleLine?: boolean;
|
|
8
8
|
/** Rendered at each line break when `singleLine` is true. */
|
|
9
9
|
singleLineNewlineIndicator?: string;
|
|
10
|
+
/** Minimum semantic heading level to render. Use this to avoid nested rich text creating page-level h1s. */
|
|
11
|
+
minHeadingLevel?: RichTextHeadingBlock["level"];
|
|
12
|
+
/** Semantic level offset applied before clamping. For example, 1 renders stored h1/h2 as h2/h3. */
|
|
13
|
+
headingLevelOffset?: number;
|
|
10
14
|
}
|
|
11
|
-
export declare function RichTextContentView({ content, className, paragraphClassName, resolveImageAssetUrl, singleLine, singleLineNewlineIndicator, }: RichTextContentViewProps): import("react/jsx-runtime").JSX.Element | null;
|
|
15
|
+
export declare function RichTextContentView({ content, className, paragraphClassName, resolveImageAssetUrl, singleLine, singleLineNewlineIndicator, minHeadingLevel, headingLevelOffset, }: RichTextContentViewProps): import("react/jsx-runtime").JSX.Element | null;
|
|
@@ -5,9 +5,10 @@ declare function DialogTrigger({ ...props }: React.ComponentProps<typeof DialogP
|
|
|
5
5
|
declare function DialogPortal({ ...props }: React.ComponentProps<typeof DialogPrimitive.Portal>): import("react/jsx-runtime").JSX.Element;
|
|
6
6
|
declare function DialogClose({ ...props }: React.ComponentProps<typeof DialogPrimitive.Close>): import("react/jsx-runtime").JSX.Element;
|
|
7
7
|
declare function DialogOverlay({ className, ...props }: React.ComponentProps<typeof DialogPrimitive.Overlay>): import("react/jsx-runtime").JSX.Element;
|
|
8
|
-
declare function DialogContent({ className, children, showCloseButton, closeLabel, ...props }: React.ComponentProps<typeof DialogPrimitive.Content> & {
|
|
8
|
+
declare function DialogContent({ className, children, showCloseButton, closeLabel, dismissOnInteractOutside, onInteractOutside, ...props }: React.ComponentProps<typeof DialogPrimitive.Content> & {
|
|
9
9
|
showCloseButton?: boolean;
|
|
10
10
|
closeLabel?: string;
|
|
11
|
+
dismissOnInteractOutside?: boolean;
|
|
11
12
|
}): import("react/jsx-runtime").JSX.Element;
|
|
12
13
|
declare function DialogHeader({ className, ...props }: React.ComponentProps<"div">): import("react/jsx-runtime").JSX.Element;
|
|
13
14
|
declare function DialogFooter({ className, showCloseButton, closeLabel, children, ...props }: React.ComponentProps<"div"> & {
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import * as ResizablePrimitive from "react-resizable-panels";
|
|
2
|
+
declare function ResizablePanelGroup({ className, ...props }: ResizablePrimitive.GroupProps): import("react/jsx-runtime").JSX.Element;
|
|
3
|
+
declare function ResizablePanel({ ...props }: ResizablePrimitive.PanelProps): import("react/jsx-runtime").JSX.Element;
|
|
4
|
+
declare function ResizableHandle({ withHandle, className, ...props }: ResizablePrimitive.SeparatorProps & {
|
|
5
|
+
withHandle?: boolean;
|
|
6
|
+
}): import("react/jsx-runtime").JSX.Element;
|
|
7
|
+
export { ResizableHandle, ResizablePanel, ResizablePanelGroup };
|
|
@@ -3,7 +3,7 @@ import { Toggle as TogglePrimitive } from 'radix-ui';
|
|
|
3
3
|
import * as React from "react";
|
|
4
4
|
declare const toggleVariants: (props?: ({
|
|
5
5
|
variant?: "default" | "outline" | null | undefined;
|
|
6
|
-
size?: "default" | "sm" | "lg" | null | undefined;
|
|
6
|
+
size?: "default" | "sm" | "lg" | "icon-sm" | null | undefined;
|
|
7
7
|
} & import('class-variance-authority/types').ClassProp) | undefined) => string;
|
|
8
8
|
declare function Toggle({ className, variant, size, ...props }: React.ComponentProps<typeof TogglePrimitive.Root> & VariantProps<typeof toggleVariants>): import("react/jsx-runtime").JSX.Element;
|
|
9
9
|
export { Toggle, toggleVariants };
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import {
|
|
2
|
-
export declare const surveyEditorDevDeMessages:
|
|
1
|
+
import { LocalizationMessages } from '@case-framework/ui-localization';
|
|
2
|
+
export declare const surveyEditorDevDeMessages: LocalizationMessages;
|
package/dist/src/index.d.ts
CHANGED
|
@@ -1,10 +1,13 @@
|
|
|
1
1
|
export { SurveyPlayer, SurveyContextProvider, SurveyItemRenderer, useSurveyCtx, useSurveyTranslation, } from './modules/survey-player';
|
|
2
2
|
export { SurveyEditor } from './modules/survey-editor';
|
|
3
|
-
export {
|
|
3
|
+
export { Dialog, DialogClose, DialogContent, DialogDescription, DialogFooter, DialogHeader, DialogOverlay, DialogPortal, DialogTitle, DialogTrigger, } from './components/ui/dialog';
|
|
4
|
+
export { APPLY_RICH_TEXT_STYLE_COMMAND, buildSurveyFileName, buildSurveyAssistantItemRegistryManifest, buildSurveyAssistantSnapshot, createSnapshotSurveyEditorAIProvider, useSurveyEditorAssistantIntegration, createBlankEditorState, createEditorStateFromRawSurvey, createRichTextEditorValueFromContent, createRichTextEditorValueFromPlainText, createRichTextEditorValueFromText, DEFAULT_EDITOR_LANGUAGE, DEFAULT_DATE_FNS_LOCALES, DEFAULT_CATEGORY_LABELS, DEFAULT_BLOCK_CONTENT_POLICY, DEFAULT_COMPACT_CONTENT_POLICY, defaultSurveyEditorLocalizations, RichTextEditor, RichTextBlockEditor, CONVERT_RICH_TEXT_LINK_TO_TEXT_COMMAND, INSERT_RICH_TEXT_LINK_COMMAND, INSERT_RICH_TEXT_TEMPLATE_VARIABLE_COMMAND, getDateFnsLocale, isBlockContentPolicyVariant, mergeDateFnsLocales, mergeEditorLocalizations, mergeRichTextContentPolicy, OPEN_RICH_TEXT_LINK_EDITOR_COMMAND, RichTextContentView, sanitizeContentForPolicy, SurveyImageAssetManager, surveyEditorEnMessages, surveyEditorNlMessages, UPDATE_RICH_TEXT_LINK_COMMAND, entriesToComposedEditorRegistry, entriesToParticipantRegistry, entriesToItemTypeRegistry, getRichTextContentFromEditorState, parseEditorStateFromJsonText, resolveCategoryLabel, serializeSurveyStateForFile, useSurveyAssets, useSurveyImageAssets, useUnusedSurveyAssetCount, validateRegistryEntries, } from './modules/survey-editor';
|
|
4
5
|
export { FilepickerDropzone } from './components/c-ui/filepicker-dropzone';
|
|
6
|
+
export { SortableTree } from './components/common/sortable-tree';
|
|
7
|
+
export type { SortableTreeDropEvent, SortableTreeDropPosition, SortableTreeEmptyGroupProps, SortableTreeMoveEvent, SortableTreePosition, SortableTreeProps, SortableTreeRenderItemProps, } from './components/common/sortable-tree';
|
|
5
8
|
export { cloneRegistryEntries, createComposedEditorRegistry, createRegistryEntries, createSurveyPlayerRegistry, getDefaultComposedEditorRegistry, getDefaultRegistryEntries, getDefaultSurveyPlayerRegistry, } from './modules/default-item-registry';
|
|
6
9
|
export type { CreateComposedEditorRegistryOptions, CreateRegistryEntriesOptions, CreateSurveyPlayerRegistryOptions, RegistryConflictStrategy, } from './modules/default-item-registry';
|
|
7
|
-
export type { SurveyEditorProps, SurveyEditorStateChange,
|
|
8
|
-
export type { SurveyPlayerProps, SurveyContextProviderProps, SurveyItemRendererProps,
|
|
10
|
+
export type { SurveyEditorProps, SurveyEditorStateChange, SurveyEditorWorkspace, SurveyEditorWorkspacePanelOptions, SurveyEditorAssistantController, SurveyAssistantSnapshotOptions, CreateSnapshotSurveyEditorAIProviderOptions, UseSurveyEditorAssistantIntegrationOptions, SurveyEditorAITaskCacheOptions, SurveyEditorAITaskExecution, SurveyEditorAITaskExecutor, SurveyEditorLocation, EditorItemDefinition, EditorItemDefinitionRegistry, ComposedEditorItemRegistry, EntriesToComposedEditorRegistryOptions, EntriesToParticipantRegistryOptions, ItemEditorComponentProps, ItemIconComponent, ItemPreviewComponentProps, ItemPreviewMode, ItemRegistryEntry, ItemRendererComponentProps, ItemSearchAdapter, RegistryValidationIssue, RegistryValidationMode, RegistryValidationOptions, RegistryValidationResult, SurveyPlayerItemRegistry, SurveyEditorAIProvider, SurveyAIRequestOptions, RichTextEditorChange, RichTextEditorProps, RichTextBlockEditorChange, RichTextBlockEditorProps, RichTextContentPolicy, RichTextLinkPayload, RichTextStyleControl, RichTextTemplateVariable, RichTextContentViewProps, RichTextEditorVariant, RichTextStyleAttribute, RichTextSupportedBlockType, SerializedRichTextLinkNode, SerializedTemplateVariableNode, SurveyImageAssetManagerProps, ParsedSurveySession, ParsedSurveySessionFormat, } from './modules/survey-editor';
|
|
11
|
+
export type { SurveyPlayerProps, SurveyContextProviderProps, SurveyItemRendererProps, } from './modules/survey-player';
|
|
12
|
+
export type { SurveyEditorDateLocales } from './modules/survey-editor/localization/date-fns';
|
|
9
13
|
export type { FilepickerDropzoneLabels, FilepickerDropzoneProps, } from './components/c-ui/filepicker-dropzone';
|
|
10
|
-
export type { BuildSurveyAIContextPackOptions, SurveyAIContextIndexes, SurveyAIContextPack, SurveyAIContextPurpose, SurveyAIItemContextNode, SurveyAIKeyIndexEntry, SurveyAIFocus, SurveyAIOutlineNode, SurveyAITranslationSnippet, } from '@case-framework/survey-core/editor';
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import { ItemTypeRegistry } from '@case-framework/survey-core';
|
|
2
|
+
import { ChoiceItemCore, FormItemCore, InfoItemCore } from './modules/default-item-registry/default-item-cores';
|
|
3
|
+
export declare const defaultItemCoreRegistry: ItemTypeRegistry;
|
|
4
|
+
export { ChoiceItemCore, FormItemCore, InfoItemCore };
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { SurveyItemCore, SurveyItemTranslations } from '@case-framework/survey-core';
|
|
2
|
+
import { ItemAuthoringState } from '../survey-editor/registry';
|
|
3
|
+
interface ItemContentContext {
|
|
4
|
+
itemContent?: SurveyItemTranslations;
|
|
5
|
+
locales: string[];
|
|
6
|
+
locale: string;
|
|
7
|
+
}
|
|
8
|
+
export declare function getInfoItemAuthoringState(context: ItemContentContext): ItemAuthoringState;
|
|
9
|
+
export declare function getFormItemAuthoringState({ item, ...context }: ItemContentContext & {
|
|
10
|
+
item: SurveyItemCore;
|
|
11
|
+
}): ItemAuthoringState;
|
|
12
|
+
export declare function getChoiceItemAuthoringState({ item, ...context }: ItemContentContext & {
|
|
13
|
+
item: SurveyItemCore;
|
|
14
|
+
}): ItemAuthoringState;
|
|
15
|
+
export {};
|
|
@@ -1,14 +1,21 @@
|
|
|
1
|
-
import { Content } from '@case-framework/survey-core';
|
|
1
|
+
import { Content, SurveyItemTranslations } from '@case-framework/survey-core';
|
|
2
|
+
import { FormItemConfig } from '../../form/model';
|
|
2
3
|
import { ChoiceOptionConfig } from '../model';
|
|
3
|
-
type ChoiceOptionEditorFocusField = "label" | "key";
|
|
4
|
+
type ChoiceOptionEditorFocusField = "label" | "key" | "advanced";
|
|
4
5
|
interface ChoiceOptionEditDialogProps {
|
|
5
6
|
open: boolean;
|
|
6
7
|
option: ChoiceOptionConfig | null;
|
|
7
8
|
existingOptions: ChoiceOptionConfig[];
|
|
8
9
|
initialLabelContent?: Content;
|
|
9
10
|
initialFocusField?: ChoiceOptionEditorFocusField;
|
|
10
|
-
|
|
11
|
+
initialAdvancedOpen?: boolean;
|
|
12
|
+
itemId: string;
|
|
13
|
+
embeddedFormConfig: FormItemConfig;
|
|
14
|
+
embeddedFormEditingConfig: FormItemConfig;
|
|
15
|
+
selectedLocale: string;
|
|
16
|
+
translationNamespace: string;
|
|
11
17
|
onSave: (option: ChoiceOptionConfig, labelContent?: Content) => void;
|
|
18
|
+
onPersistEmbeddedForm: (applyChanges: (nextConfig: FormItemConfig, nextTranslations: SurveyItemTranslations) => void | boolean) => boolean;
|
|
12
19
|
}
|
|
13
20
|
export declare const ChoiceOptionEditDialog: React.FC<ChoiceOptionEditDialogProps>;
|
|
14
21
|
export {};
|
|
@@ -145,7 +145,10 @@ export declare function getFormFieldTranslationKeys(field: Pick<FormFieldConfig,
|
|
|
145
145
|
export declare function getFormFieldGroupTranslationKeys(group: Pick<FormFieldGroupConfig, "id">, translationNamespace?: string): string[];
|
|
146
146
|
export declare function writeFormFieldGroupTranslations(itemTranslations: SurveyItemTranslations, locale: string, group: Pick<FormFieldGroupConfig, "id" | "title" | "description">, translationNamespace?: string): void;
|
|
147
147
|
export declare function writeFormFieldTranslations(itemTranslations: SurveyItemTranslations, locale: string, field: Pick<FormFieldConfig, "id" | "type" | "label" | "description" | "errorMessage" | "controller" | "validations">, translationNamespace?: string): void;
|
|
148
|
-
export declare function withFormItemTranslatedContent(config: FormItemConfig, itemTranslations: SurveyItemTranslations | undefined, locale: string,
|
|
148
|
+
export declare function withFormItemTranslatedContent(config: FormItemConfig, itemTranslations: SurveyItemTranslations | undefined, locale: string, options?: {
|
|
149
|
+
fallbackLocale?: string;
|
|
150
|
+
translationNamespace?: string;
|
|
151
|
+
}): FormItemConfig;
|
|
149
152
|
export declare function withoutFormItemTranslatedContent(config: FormItemConfig): FormItemConfig;
|
|
150
153
|
/** CSS custom properties for `.form-field-group-layout-scope` + `.form-field-group-grid`. */
|
|
151
154
|
export declare function formFieldGroupLayoutCssVars(layout: FormFieldGroupLayoutConfig): Record<string, string>;
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { buildSurveyAssistantTaskContext } from '@case-framework/survey-assistant/engine';
|
|
2
|
+
import { SurveyAssistantSuggestItemKeyInput, SurveyAssistantSuggestItemKeyResult, SurveyAssistantSuggestItemLabelInput, SurveyAssistantSuggestItemLabelResult, SurveyAssistantTranslateContentInput, SurveyAssistantTranslateContentResult, SurveyDocumentSnapshot } from '@case-framework/survey-assistant/protocol';
|
|
3
|
+
import { SurveyAIRequestOptions, SurveyEditorAIProvider } from './types';
|
|
4
|
+
export interface SurveyEditorAITaskExecution {
|
|
5
|
+
cacheScope?: string;
|
|
6
|
+
}
|
|
7
|
+
export interface SurveyEditorAITaskExecutor {
|
|
8
|
+
suggestItemKey: (request: SurveyAssistantSuggestItemKeyInput, context: ReturnType<typeof buildSurveyAssistantTaskContext>, options?: SurveyAIRequestOptions, execution?: SurveyEditorAITaskExecution) => Promise<SurveyAssistantSuggestItemKeyResult>;
|
|
9
|
+
suggestItemLabel: (request: SurveyAssistantSuggestItemLabelInput, context: ReturnType<typeof buildSurveyAssistantTaskContext>, options?: SurveyAIRequestOptions, execution?: SurveyEditorAITaskExecution) => Promise<SurveyAssistantSuggestItemLabelResult>;
|
|
10
|
+
translateContent: (request: SurveyAssistantTranslateContentInput, context: ReturnType<typeof buildSurveyAssistantTaskContext>, options?: SurveyAIRequestOptions, execution?: SurveyEditorAITaskExecution) => Promise<SurveyAssistantTranslateContentResult>;
|
|
11
|
+
}
|
|
12
|
+
export interface SurveyEditorAITaskCacheOptions {
|
|
13
|
+
ttlMs?: number;
|
|
14
|
+
maxEntries?: number;
|
|
15
|
+
getScope?: () => string | undefined;
|
|
16
|
+
}
|
|
17
|
+
export interface CreateSnapshotSurveyEditorAIProviderOptions {
|
|
18
|
+
getSnapshot: () => SurveyDocumentSnapshot | null;
|
|
19
|
+
tasks: SurveyEditorAITaskExecutor;
|
|
20
|
+
cache?: false | SurveyEditorAITaskCacheOptions;
|
|
21
|
+
}
|
|
22
|
+
export declare const createSnapshotSurveyEditorAIProvider: ({ getSnapshot, tasks, cache: cacheOptions, }: CreateSnapshotSurveyEditorAIProviderOptions) => SurveyEditorAIProvider;
|
|
@@ -1,88 +1,11 @@
|
|
|
1
|
-
import {
|
|
2
|
-
export type { SurveyAIContextPurpose, SurveyAIContextScope };
|
|
3
|
-
export type SurveyAIInvocationMode = "user" | "background";
|
|
1
|
+
import { SurveyAssistantSuggestItemKeyInput, SurveyAssistantSuggestItemKeyResult, SurveyAssistantSuggestItemLabelInput, SurveyAssistantSuggestItemLabelResult, SurveyAssistantTaskInvocationMode, SurveyAssistantTranslateContentInput, SurveyAssistantTranslateContentResult } from '@case-framework/survey-assistant/protocol';
|
|
4
2
|
export interface SurveyAIRequestOptions {
|
|
5
3
|
signal?: AbortSignal;
|
|
6
|
-
mode?:
|
|
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>>;
|
|
4
|
+
mode?: SurveyAssistantTaskInvocationMode;
|
|
5
|
+
cache?: "default" | "refresh";
|
|
70
6
|
}
|
|
71
7
|
export interface SurveyEditorAIProvider {
|
|
72
|
-
suggestItemKey?: (request:
|
|
73
|
-
suggestItemLabel?: (request:
|
|
74
|
-
|
|
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;
|
|
8
|
+
suggestItemKey?: (request: SurveyAssistantSuggestItemKeyInput, options?: SurveyAIRequestOptions) => Promise<SurveyAssistantSuggestItemKeyResult>;
|
|
9
|
+
suggestItemLabel?: (request: SurveyAssistantSuggestItemLabelInput, options?: SurveyAIRequestOptions) => Promise<SurveyAssistantSuggestItemLabelResult>;
|
|
10
|
+
translateContent?: (request: SurveyAssistantTranslateContentInput, options?: SurveyAIRequestOptions) => Promise<SurveyAssistantTranslateContentResult>;
|
|
88
11
|
}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { SurveyAssistantController } from '@case-framework/survey-assistant/react/integration';
|
|
2
|
+
import { SurveyEditorAIProvider } from './types';
|
|
3
|
+
import { SurveyEditorAssistantController } from '../assistant';
|
|
4
|
+
export interface UseSurveyEditorAssistantIntegrationOptions {
|
|
5
|
+
initialModelId?: string;
|
|
6
|
+
onModelChange?(modelId: string): void;
|
|
7
|
+
taskApi?: string;
|
|
8
|
+
}
|
|
9
|
+
export interface SurveyEditorAssistantIntegration {
|
|
10
|
+
aiProvider: SurveyEditorAIProvider;
|
|
11
|
+
controller: SurveyAssistantController;
|
|
12
|
+
controllerRef(controller: SurveyEditorAssistantController | null): void;
|
|
13
|
+
modelId: string | undefined;
|
|
14
|
+
selectModel(modelId: string): void;
|
|
15
|
+
}
|
|
16
|
+
export declare const useSurveyEditorAssistantIntegration: ({ initialModelId, onModelChange, taskApi, }?: UseSurveyEditorAssistantIntegrationOptions) => SurveyEditorAssistantIntegration;
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { SurveyEditor as SurveyEditorCore } from '@case-framework/survey-core/editor';
|
|
2
|
+
import { ComposedEditorItemRegistry } from '../registry';
|
|
3
|
+
import { SurveyApplyResult, SurveyBatchApplyResult, SurveyChangeSet, SurveyDocumentVersion } from '@case-framework/survey-assistant/protocol';
|
|
4
|
+
export interface SurveyAssistantEditorApplyResult extends SurveyApplyResult {
|
|
5
|
+
editor?: SurveyEditorCore;
|
|
6
|
+
}
|
|
7
|
+
export interface SurveyAssistantEditorBatchApplyResult extends SurveyBatchApplyResult {
|
|
8
|
+
editor?: SurveyEditorCore;
|
|
9
|
+
}
|
|
10
|
+
interface ApplySurveyAssistantChangeInput {
|
|
11
|
+
change: SurveyChangeSet;
|
|
12
|
+
currentPrecondition: SurveyDocumentVersion;
|
|
13
|
+
editor: SurveyEditorCore;
|
|
14
|
+
itemRegistry: ComposedEditorItemRegistry;
|
|
15
|
+
}
|
|
16
|
+
interface ApplySurveyAssistantChangesInput {
|
|
17
|
+
changes: SurveyChangeSet[];
|
|
18
|
+
currentPrecondition: SurveyDocumentVersion;
|
|
19
|
+
editor: SurveyEditorCore;
|
|
20
|
+
itemRegistry: ComposedEditorItemRegistry;
|
|
21
|
+
}
|
|
22
|
+
export declare const applySurveyAssistantChangesToEditor: ({ changes, currentPrecondition, editor, itemRegistry, }: ApplySurveyAssistantChangesInput) => SurveyAssistantEditorBatchApplyResult;
|
|
23
|
+
export declare const applySurveyAssistantChangeToEditor: ({ change, currentPrecondition, editor, itemRegistry, }: ApplySurveyAssistantChangeInput) => SurveyAssistantEditorApplyResult;
|
|
24
|
+
export {};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
export { applySurveyAssistantChangeToEditor, applySurveyAssistantChangesToEditor, type SurveyAssistantEditorApplyResult, type SurveyAssistantEditorBatchApplyResult, } from './apply';
|
|
2
|
+
export { buildSurveyAssistantItemRegistryManifest, buildSurveyAssistantSnapshot, type SurveyAssistantSnapshotOptions, type SurveyEditorAssistantController, } from './snapshot';
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import { SurveyEditor } from '@case-framework/survey-core/editor';
|
|
2
|
+
import { SurveyEditorLocation } from '../navigation/types';
|
|
3
|
+
import { SurveyApplyResult, SurveyAssistantItemRegistryManifest, SurveyAssistantSnapshot, SurveyBatchApplyResult, SurveyChangeSet } from '@case-framework/survey-assistant/protocol';
|
|
4
|
+
import { ComposedEditorItemRegistry } from '../registry';
|
|
5
|
+
export interface SurveyAssistantSnapshotOptions {
|
|
6
|
+
createdAt?: string;
|
|
7
|
+
uiContext?: {
|
|
8
|
+
activeSurface?: string;
|
|
9
|
+
openPanels?: string[];
|
|
10
|
+
highlights?: Array<{
|
|
11
|
+
kind: string;
|
|
12
|
+
itemId?: string;
|
|
13
|
+
componentId?: string;
|
|
14
|
+
label?: string;
|
|
15
|
+
details?: string;
|
|
16
|
+
}>;
|
|
17
|
+
};
|
|
18
|
+
}
|
|
19
|
+
export interface SurveyEditorAssistantController {
|
|
20
|
+
getSnapshot(options?: SurveyAssistantSnapshotOptions): SurveyAssistantSnapshot;
|
|
21
|
+
applyAssistantChange(change: SurveyChangeSet): SurveyApplyResult;
|
|
22
|
+
applyAssistantChanges(changes: SurveyChangeSet[]): SurveyBatchApplyResult;
|
|
23
|
+
}
|
|
24
|
+
interface BuildSurveyAssistantSnapshotInput {
|
|
25
|
+
sessionId: string | null;
|
|
26
|
+
revision: number;
|
|
27
|
+
editor: SurveyEditor;
|
|
28
|
+
location: SurveyEditorLocation;
|
|
29
|
+
navigationHistory: SurveyEditorLocation[];
|
|
30
|
+
selectedLocale: string;
|
|
31
|
+
itemRegistry: ComposedEditorItemRegistry;
|
|
32
|
+
historyIndex: number;
|
|
33
|
+
options?: SurveyAssistantSnapshotOptions;
|
|
34
|
+
}
|
|
35
|
+
export declare const buildSurveyAssistantItemRegistryManifest: ({ itemRegistry, }: {
|
|
36
|
+
itemRegistry: ComposedEditorItemRegistry;
|
|
37
|
+
}) => SurveyAssistantItemRegistryManifest;
|
|
38
|
+
export declare const buildSurveyAssistantSnapshot: ({ sessionId, revision, editor, location, navigationHistory, selectedLocale, itemRegistry, historyIndex, options, }: BuildSurveyAssistantSnapshotInput) => SurveyAssistantSnapshot;
|
|
39
|
+
export {};
|
|
@@ -1,3 +1,5 @@
|
|
|
1
1
|
export declare const LAST_USED_ITEM_TYPE_KEY = "case.survey-editor.last-used-item-type";
|
|
2
|
+
export declare const RECENT_ITEM_TYPES_KEY = "case.survey-editor.recent-item-types";
|
|
3
|
+
export declare const MAX_RECENT_ITEM_TYPES = 5;
|
|
2
4
|
export declare const DEFAULT_TOP_ITEM_TYPES: readonly ["infoItem", "formItem"];
|
|
3
5
|
export declare const STRUCTURE_ITEM_TYPES: Set<string>;
|
package/dist/src/modules/survey-editor/editor-card/add-items/hooks/use-add-item-actions.d.ts
CHANGED
|
@@ -2,24 +2,23 @@ import { SurveyItemTranslations, SurveyItemCore } from '@case-framework/survey-c
|
|
|
2
2
|
import { SurveyItemClipboardData, Target } from '@case-framework/survey-core/editor';
|
|
3
3
|
import { ComposedEditorItemRegistry } from '../../../../../../modules/survey-editor/registry';
|
|
4
4
|
import { ItemTypeOption } from '../types';
|
|
5
|
-
import { GeneratedItemIntentSuggestion } from '../../../../../../modules/survey-editor/ai/types';
|
|
6
5
|
interface UseAddItemActionsParams {
|
|
7
6
|
editorItemRegistry: ComposedEditorItemRegistry;
|
|
8
7
|
addItem: (target: Target | null, item: SurveyItemCore, content?: SurveyItemTranslations) => void;
|
|
9
|
-
pasteItem: (clipboardData: SurveyItemClipboardData, target: Target) => string;
|
|
8
|
+
pasteItem: (clipboardData: SurveyItemClipboardData, target: Target) => string | null;
|
|
10
9
|
commitByUser: (meta: {
|
|
11
10
|
label: string;
|
|
12
11
|
}) => void;
|
|
13
12
|
setPreferredPreviewItemId: (itemId: string | null) => void;
|
|
14
13
|
closeDialog: () => void;
|
|
15
14
|
targetGroupId?: string;
|
|
15
|
+
targetIndex?: number;
|
|
16
16
|
rootItemId?: string;
|
|
17
17
|
clipboardValue: string | null;
|
|
18
|
-
|
|
18
|
+
recordRecentItemType: (itemType: string) => void;
|
|
19
19
|
}
|
|
20
|
-
export declare function useAddItemActions({ editorItemRegistry, addItem, pasteItem, commitByUser, setPreferredPreviewItemId, closeDialog, targetGroupId, rootItemId, clipboardValue,
|
|
20
|
+
export declare function useAddItemActions({ editorItemRegistry, addItem, pasteItem, commitByUser, setPreferredPreviewItemId, closeDialog, targetGroupId, targetIndex, rootItemId, clipboardValue, recordRecentItemType, }: UseAddItemActionsParams): {
|
|
21
21
|
handleSelectOption: (option: ItemTypeOption) => void;
|
|
22
22
|
pasteFromClipboard: () => void;
|
|
23
|
-
createItemsFromIntent: (items: GeneratedItemIntentSuggestion[]) => void;
|
|
24
23
|
};
|
|
25
24
|
export {};
|
package/dist/src/modules/survey-editor/editor-card/add-items/hooks/use-option-group-navigation.d.ts
CHANGED
|
@@ -3,6 +3,7 @@ interface UseOptionGroupNavigationParams<TOption> {
|
|
|
3
3
|
options: TOption[];
|
|
4
4
|
onSelect: (option: TOption) => void;
|
|
5
5
|
rowSize?: number;
|
|
6
|
+
enableTabNavigation?: boolean;
|
|
6
7
|
}
|
|
7
8
|
export interface OptionGroupNavigation {
|
|
8
9
|
groupRef: RefObject<HTMLDivElement | null>;
|
|
@@ -15,5 +16,5 @@ export interface OptionGroupNavigation {
|
|
|
15
16
|
handleGroupBlur: (event: ReactFocusEvent<HTMLDivElement>) => void;
|
|
16
17
|
handleGroupKeyDown: (event: ReactKeyboardEvent<HTMLDivElement>) => void;
|
|
17
18
|
}
|
|
18
|
-
export declare function useOptionGroupNavigation<TOption>({ options, onSelect, rowSize, }: UseOptionGroupNavigationParams<TOption>): OptionGroupNavigation;
|
|
19
|
+
export declare function useOptionGroupNavigation<TOption>({ options, onSelect, rowSize, enableTabNavigation, }: UseOptionGroupNavigationParams<TOption>): OptionGroupNavigation;
|
|
19
20
|
export {};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { LucideIcon } from 'lucide-react';
|
|
2
2
|
import { ItemTypeInfos } from '../../../../../modules/survey-editor/utils/item-type-infos';
|
|
3
|
-
export type AddDialogView = "entry" | "blank-item" | "structure" | "
|
|
3
|
+
export type AddDialogView = "entry" | "blank-item" | "structure" | "catalogue";
|
|
4
4
|
export interface ItemTypeOption extends ItemTypeInfos {
|
|
5
5
|
itemType: string;
|
|
6
6
|
categories: string[];
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { FocusEvent as ReactFocusEvent, KeyboardEvent as ReactKeyboardEvent, RefObject } from 'react';
|
|
2
|
+
import { ItemTypeOption } from '../types';
|
|
3
|
+
export interface ItemTypeGridSection {
|
|
4
|
+
id: string;
|
|
5
|
+
label: string;
|
|
6
|
+
options: ItemTypeOption[];
|
|
7
|
+
}
|
|
8
|
+
interface ItemTypeGridViewProps {
|
|
9
|
+
search: string;
|
|
10
|
+
searchInputRef: RefObject<HTMLInputElement | null>;
|
|
11
|
+
searchPlaceholder: string;
|
|
12
|
+
recentLabel: string;
|
|
13
|
+
recentOptions: ItemTypeOption[];
|
|
14
|
+
sections: ItemTypeGridSection[];
|
|
15
|
+
optionGroupRef: RefObject<HTMLDivElement | null>;
|
|
16
|
+
activeIndex: number;
|
|
17
|
+
isFocused: boolean;
|
|
18
|
+
setActiveIndex: (index: number) => void;
|
|
19
|
+
onSearchChange: (search: string) => void;
|
|
20
|
+
onMoveFocusToGrid: () => void;
|
|
21
|
+
onGroupFocus: () => void;
|
|
22
|
+
onGroupBlur: (event: ReactFocusEvent<HTMLDivElement>) => void;
|
|
23
|
+
onGroupKeyDown: (event: ReactKeyboardEvent<HTMLDivElement>) => void;
|
|
24
|
+
onSelectOption: (option: ItemTypeOption) => void;
|
|
25
|
+
emptyMessage: string;
|
|
26
|
+
gridLabel: string;
|
|
27
|
+
fullScreen: boolean;
|
|
28
|
+
}
|
|
29
|
+
export declare function ItemTypeGridView({ search, searchInputRef, searchPlaceholder, recentLabel, recentOptions, sections, optionGroupRef, activeIndex, isFocused, setActiveIndex, onSearchChange, onMoveFocusToGrid, onGroupFocus, onGroupBlur, onGroupKeyDown, onSelectOption, emptyMessage, gridLabel, fullScreen, }: ItemTypeGridViewProps): import("react/jsx-runtime").JSX.Element;
|
|
30
|
+
export {};
|
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
interface DeleteItemDropdownMenuItemProps {
|
|
2
2
|
overrideItemId?: string;
|
|
3
|
+
afterDeleteItemId?: string | null;
|
|
4
|
+
disabled?: boolean;
|
|
3
5
|
}
|
|
4
|
-
export declare const DeleteItemDropdownMenuItem: ({ overrideItemId }: DeleteItemDropdownMenuItemProps) => import("react/jsx-runtime").JSX.Element | null;
|
|
6
|
+
export declare const DeleteItemDropdownMenuItem: ({ overrideItemId, afterDeleteItemId, disabled, }: DeleteItemDropdownMenuItemProps) => import("react/jsx-runtime").JSX.Element | null;
|
|
5
7
|
export {};
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { Expression } from '@case-framework/survey-core';
|
|
2
|
+
export interface ExpressionPseudoCodeOptions {
|
|
3
|
+
maxInlineLength?: number;
|
|
4
|
+
resolveItemKey?: (itemId: string) => string | undefined;
|
|
5
|
+
resolveReferenceValue?: (referenceId: string) => string | undefined;
|
|
6
|
+
}
|
|
7
|
+
/** Converts every supported CASE expression tree into stable, read-only pseudo-code. */
|
|
8
|
+
export declare function formatExpressionPseudoCode(expression: Expression, options?: ExpressionPseudoCodeOptions): string;
|
|
@@ -12,7 +12,7 @@ interface UseGroupListKeyboardParams {
|
|
|
12
12
|
selectPreviewItem: (itemId: string) => void;
|
|
13
13
|
moveItemByOffset: (itemId: string, offset: -1 | 1) => boolean;
|
|
14
14
|
parseSurveyItemClipboard: (value: string | null) => SurveyItemClipboardData | null;
|
|
15
|
-
pasteItemFromClipboardData: (clipboardData: SurveyItemClipboardData, parentId: string) => string;
|
|
15
|
+
pasteItemFromClipboardData: (clipboardData: SurveyItemClipboardData, parentId: string) => string | null;
|
|
16
16
|
onPasteCommitted: (newItemId: string) => void;
|
|
17
17
|
copyItemToClipboard: (itemId: string) => void;
|
|
18
18
|
}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { ReactNode } from 'react';
|
|
2
|
+
import { ItemAuthoringState } from '../../../../modules/survey-editor/registry';
|
|
3
|
+
interface ItemAuthoringStatePreviewProps {
|
|
4
|
+
state: ItemAuthoringState;
|
|
5
|
+
itemTypeLabel: string;
|
|
6
|
+
onEdit?: () => void;
|
|
7
|
+
className?: string;
|
|
8
|
+
}
|
|
9
|
+
export declare function ItemAuthoringStatePreview({ state, itemTypeLabel, onEdit, className, }: ItemAuthoringStatePreviewProps): import("react/jsx-runtime").JSX.Element;
|
|
10
|
+
interface IncompleteItemPreviewFrameProps {
|
|
11
|
+
children: ReactNode;
|
|
12
|
+
onEdit?: () => void;
|
|
13
|
+
className?: string;
|
|
14
|
+
}
|
|
15
|
+
export declare function IncompleteItemPreviewFrame({ children, onEdit, className, }: IncompleteItemPreviewFrameProps): import("react/jsx-runtime").JSX.Element;
|
|
16
|
+
export {};
|
|
@@ -17,11 +17,7 @@ interface SidePanelCard {
|
|
|
17
17
|
description?: string;
|
|
18
18
|
icon: LucideIcon;
|
|
19
19
|
content?: ReactNode;
|
|
20
|
-
|
|
21
|
-
interface PreviewDialogConfig {
|
|
22
|
-
content: ReactNode;
|
|
23
|
-
title?: string;
|
|
24
|
-
description?: string;
|
|
20
|
+
headerAction?: ReactNode;
|
|
25
21
|
}
|
|
26
22
|
interface ItemEditorCardProps {
|
|
27
23
|
surveyItem: SurveyItemCore;
|
|
@@ -32,7 +28,6 @@ interface ItemEditorCardProps {
|
|
|
32
28
|
navItems?: NavItem[];
|
|
33
29
|
layoutVariant?: "tabs" | "stacked";
|
|
34
30
|
sidePanelCards?: SidePanelCard[];
|
|
35
|
-
previewDialog?: PreviewDialogConfig;
|
|
36
31
|
children: ReactNode;
|
|
37
32
|
}
|
|
38
33
|
declare const ItemEditorCard: React.FC<ItemEditorCardProps>;
|