@case-framework/survey-editor-ui 0.5.0 → 0.6.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +5 -0
- package/dist/src/components/c-ui/confirm-dialog.d.ts +2 -0
- package/dist/src/components/c-ui/confirm-provider.d.ts +1 -0
- package/dist/src/components/rich-text-editor/plugins/docked-toolbar-plugin.d.ts +3 -1
- package/dist/src/components/rich-text-editor/plugins/slash-command-menu-plugin.d.ts +2 -1
- package/dist/src/components/rich-text-editor/rich-text-editor.d.ts +3 -1
- package/dist/src/components/rich-text-editor/rich-text-menu-styles.d.ts +6 -0
- package/dist/src/components/ui/badge.d.ts +1 -1
- package/dist/src/components/ui/button.d.ts +1 -1
- package/dist/src/modules/default-item-registry/items/form/model.d.ts +1 -0
- package/dist/src/modules/default-item-registry/shared/question-editor/deferred-localized-rich-text-field.d.ts +1 -0
- package/dist/src/modules/survey-editor/editor-card/index.d.ts +1 -0
- package/dist/src/modules/survey-editor/editor-card/item-authoring-state-preview.d.ts +7 -10
- package/dist/src/modules/survey-editor/editor-card/item-color-menu.d.ts +2 -1
- package/dist/src/modules/survey-editor/editor-card/item-editing-header.d.ts +17 -0
- package/dist/src/modules/survey-editor/editor-card/item-editing-panels.d.ts +16 -0
- package/dist/src/modules/survey-editor/editor-card/item-editing-surface-context.d.ts +8 -0
- package/dist/src/modules/survey-editor/editor-card/item-editing-surface.d.ts +10 -0
- package/dist/src/modules/survey-editor/editor-card/item-editor-apply-context.d.ts +19 -0
- package/dist/src/modules/survey-editor/editor-card/item-editor-card.d.ts +8 -0
- package/dist/src/modules/survey-editor/editor-card/item-editor-header-styles.d.ts +1 -0
- package/dist/src/modules/survey-editor/editor-card/item-preview.d.ts +2 -1
- package/dist/src/modules/survey-editor/expression-integrity.d.ts +6 -0
- package/dist/src/modules/survey-editor/preview-draft/preview-draft-context.d.ts +20 -0
- package/dist/src/modules/survey-editor/routes/editor/_components/expression-diagnostics-status.d.ts +1 -0
- package/dist/src/modules/survey-editor/routes/editor/item-editor/_components/item-drag-drop.d.ts +11 -0
- package/dist/src/modules/survey-editor/routes/editor/preview-mode/index.d.ts +3 -2
- package/dist/src/modules/survey-editor/routes/editor/preview-mode/preview-controls.d.ts +1 -4
- package/dist/src/modules/survey-editor/store/editor-store.d.ts +3 -0
- package/dist/src/modules/survey-editor/survey-editor-config.d.ts +2 -2
- package/dist/src/modules/survey-editor/survey-editor.d.ts +2 -1
- package/dist/survey-editor-ui.cjs.js +64 -62
- package/dist/survey-editor-ui.cjs.js.map +1 -1
- package/dist/survey-editor-ui.css +1 -1
- package/dist/survey-editor-ui.es.js +20265 -19216
- package/dist/survey-editor-ui.es.js.map +1 -1
- package/package.json +9 -6
package/README.md
CHANGED
|
@@ -12,6 +12,11 @@ For repository development and custom item registration, see
|
|
|
12
12
|
Save or Back. The host owns persistence, routing, and its header; the editor
|
|
13
13
|
owns survey mutations and undo/redo history.
|
|
14
14
|
|
|
15
|
+
The main editor export includes the assistant launcher UI. Host applications
|
|
16
|
+
must provide versions of `ai` and `@ai-sdk/react` compatible with the peer
|
|
17
|
+
ranges in `package.json`. The assistant's Mastra peers remain optional because
|
|
18
|
+
they are only needed by server integrations.
|
|
19
|
+
|
|
15
20
|
Use `controllerRef` for host-triggered commands and `onHostStateChange` to keep
|
|
16
21
|
host controls in sync with the editor:
|
|
17
22
|
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { ReactNode } from 'react';
|
|
1
2
|
export interface RequireConfirmationInput {
|
|
2
3
|
confirmTerm: string;
|
|
3
4
|
/** Custom label with {{confirmTerm}} placeholder for the required term (bold). Default: "Type {{confirmTerm}} to confirm" */
|
|
@@ -14,6 +15,7 @@ interface ConfirmDialogProps {
|
|
|
14
15
|
variant: "default" | "destructive";
|
|
15
16
|
isOpen: boolean;
|
|
16
17
|
requireConfirmationInput?: RequireConfirmationInput;
|
|
18
|
+
children?: ReactNode;
|
|
17
19
|
}
|
|
18
20
|
declare const ConfirmDialog: (props: ConfirmDialogProps) => import("react").JSX.Element;
|
|
19
21
|
export default ConfirmDialog;
|
|
@@ -8,6 +8,7 @@ interface ConfirmOptions {
|
|
|
8
8
|
cancelButtonText?: string;
|
|
9
9
|
variant?: "default" | "destructive";
|
|
10
10
|
requireConfirmationInput?: RequireConfirmationInput;
|
|
11
|
+
children?: ReactNode | ((cancel: () => void) => ReactNode);
|
|
11
12
|
}
|
|
12
13
|
export declare const ConfirmDialogProvider: ({ children }: {
|
|
13
14
|
children: ReactNode;
|
|
@@ -1,10 +1,12 @@
|
|
|
1
1
|
import { RefObject } from 'react';
|
|
2
2
|
import { RichTextStyleControl, RichTextTemplateVariable } from '../rich-text-editor-utils';
|
|
3
3
|
/** A stable, in-flow toolbar for longer block editors. */
|
|
4
|
-
export declare function DockedToolbarPlugin({ editable, visibility, position, linksEnabled, blockAlignmentEnabled, surfaceRef, toolbarClassName, styleControls, templateVariables, bulletListsEnabled, headingsEnabled, infoBoxesEnabled, imagesEnabled, separatorsEnabled, }: {
|
|
4
|
+
export declare function DockedToolbarPlugin({ editable, visibility, position, editorOwnerId, sticky, linksEnabled, blockAlignmentEnabled, surfaceRef, toolbarClassName, styleControls, templateVariables, bulletListsEnabled, headingsEnabled, infoBoxesEnabled, imagesEnabled, separatorsEnabled, }: {
|
|
5
5
|
editable: boolean;
|
|
6
6
|
visibility: "active" | "always";
|
|
7
7
|
position: "flow" | "above";
|
|
8
|
+
editorOwnerId: string;
|
|
9
|
+
sticky: boolean;
|
|
8
10
|
linksEnabled: boolean;
|
|
9
11
|
blockAlignmentEnabled: boolean;
|
|
10
12
|
surfaceRef: RefObject<HTMLDivElement | null>;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { RefObject } from 'react';
|
|
2
2
|
import { RichTextStyleControl, RichTextTemplateVariable } from '../rich-text-editor-utils';
|
|
3
|
-
export declare function SlashCommandMenuPlugin({ editable, linksEnabled, bulletListsEnabled, headingsEnabled, infoBoxesEnabled, imagesEnabled, separatorsEnabled, surfaceRef, styleControls, templateVariables, commandMenuClassName, }: {
|
|
3
|
+
export declare function SlashCommandMenuPlugin({ editable, linksEnabled, bulletListsEnabled, headingsEnabled, infoBoxesEnabled, imagesEnabled, separatorsEnabled, editorOwnerId, surfaceRef, styleControls, templateVariables, commandMenuClassName, }: {
|
|
4
4
|
editable: boolean;
|
|
5
5
|
linksEnabled: boolean;
|
|
6
6
|
bulletListsEnabled?: boolean;
|
|
@@ -8,6 +8,7 @@ export declare function SlashCommandMenuPlugin({ editable, linksEnabled, bulletL
|
|
|
8
8
|
infoBoxesEnabled?: boolean;
|
|
9
9
|
imagesEnabled?: boolean;
|
|
10
10
|
separatorsEnabled?: boolean;
|
|
11
|
+
editorOwnerId: string;
|
|
11
12
|
surfaceRef: RefObject<HTMLDivElement | null>;
|
|
12
13
|
styleControls: RichTextStyleControl[];
|
|
13
14
|
templateVariables: RichTextTemplateVariable[];
|
|
@@ -30,6 +30,8 @@ export interface RichTextEditorProps {
|
|
|
30
30
|
dockedToolbarVisibility?: "active" | "always";
|
|
31
31
|
/** Whether a docked toolbar participates in flow or sits immediately above its editor surface. */
|
|
32
32
|
dockedToolbarPosition?: "flow" | "above";
|
|
33
|
+
/** Keeps an in-flow docked toolbar visible while its block editor scrolls. */
|
|
34
|
+
dockedToolbarSticky?: boolean;
|
|
33
35
|
commandMenuClassName?: string;
|
|
34
36
|
styleControls?: RichTextStyleControl[];
|
|
35
37
|
templateVariables?: RichTextTemplateVariable[];
|
|
@@ -49,4 +51,4 @@ export interface RichTextEditorProps {
|
|
|
49
51
|
onKeyDown?: KeyboardEventHandler<HTMLDivElement>;
|
|
50
52
|
onKeyDownCapture?: KeyboardEventHandler<HTMLDivElement>;
|
|
51
53
|
}
|
|
52
|
-
export declare function RichTextEditor({ id, value, placeholder, autoFocus, autoFocusSelection, editable, wrapperClassName, surfaceClassName, contentClassName, endOfContentEditingArea, placeholderClassName, toolbarClassName, toolbarMode, dockedToolbarVisibility, dockedToolbarPosition, commandMenuClassName, styleControls, templateVariables, editorVariant, contentPolicy, resolveImageAssetUrl, imageAssets, registerImageAsset, imageAssetDeletion, linksEnabled, "aria-label": ariaLabel, onChange, onFocus, onBlur, onKeyDown, onKeyDownCapture, }: RichTextEditorProps): import("react").JSX.Element;
|
|
54
|
+
export declare function RichTextEditor({ id, value, placeholder, autoFocus, autoFocusSelection, editable, wrapperClassName, surfaceClassName, contentClassName, endOfContentEditingArea, placeholderClassName, toolbarClassName, toolbarMode, dockedToolbarVisibility, dockedToolbarPosition, dockedToolbarSticky, commandMenuClassName, styleControls, templateVariables, editorVariant, contentPolicy, resolveImageAssetUrl, imageAssets, registerImageAsset, imageAssetDeletion, linksEnabled, "aria-label": ariaLabel, onChange, onFocus, onBlur, onKeyDown, onKeyDownCapture, }: RichTextEditorProps): import("react").JSX.Element;
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { CSSProperties } from 'react';
|
|
2
|
+
export declare const RICH_TEXT_MENU_SURFACE_CLASS = "rounded-lg bg-popover p-1 text-popover-foreground shadow-md ring-1 ring-foreground/10";
|
|
3
|
+
export declare const RICH_TEXT_MENU_ITEM_CLASS = "min-h-8 gap-2 px-2 py-1.5 text-xs";
|
|
4
|
+
export declare const RICH_TEXT_MENU_LABEL_CLASS = "px-2 py-1 text-[0.7rem] font-medium uppercase tracking-wide text-muted-foreground";
|
|
5
|
+
/** Copies editor-scoped theme tokens onto menu portals, which otherwise inherit from `body`. */
|
|
6
|
+
export declare function getRichTextPortalThemeStyle(source: Element | null): CSSProperties | undefined;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { VariantProps } from 'class-variance-authority';
|
|
2
2
|
import * as React from "react";
|
|
3
3
|
declare const badgeVariants: (props?: ({
|
|
4
|
-
variant?: "link" | "default" | "
|
|
4
|
+
variant?: "link" | "default" | "outline" | "secondary" | "ghost" | "destructive" | null | undefined;
|
|
5
5
|
} & import('class-variance-authority/types').ClassProp) | undefined) => string;
|
|
6
6
|
declare function Badge({ className, variant, asChild, ...props }: React.ComponentProps<"span"> & VariantProps<typeof badgeVariants> & {
|
|
7
7
|
asChild?: boolean;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { VariantProps } from 'class-variance-authority';
|
|
2
2
|
import * as React from "react";
|
|
3
3
|
declare const buttonVariants: (props?: ({
|
|
4
|
-
variant?: "link" | "default" | "
|
|
4
|
+
variant?: "link" | "default" | "outline" | "secondary" | "ghost" | "destructive" | null | undefined;
|
|
5
5
|
size?: "sm" | "default" | "xs" | "lg" | "icon" | "icon-xs" | "icon-sm" | "icon-lg" | null | undefined;
|
|
6
6
|
} & import('class-variance-authority/types').ClassProp) | undefined) => string;
|
|
7
7
|
declare function Button({ className, variant, size, asChild, ...props }: React.ComponentProps<"button"> & VariantProps<typeof buttonVariants> & {
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { SurveyItemTranslations } from '@case-framework/survey-core';
|
|
2
2
|
export type FormFieldType = "input" | "textarea" | "number" | "datepicker" | "switch" | "select" | "slider";
|
|
3
3
|
export declare const FORM_DATEPICKER_FIELD_MODES: readonly ["year", "year-month", "year-month-day"];
|
|
4
|
+
export declare const FORM_BROWSER_AUTOCOMPLETE_OPTIONS: readonly ["name", "given-name", "family-name", "nickname", "email", "username", "organization", "organization-title", "street-address", "address-line1", "address-line2", "address-level2", "address-level1", "postal-code", "country-name", "tel", "url", "one-time-code"];
|
|
4
5
|
export type FormDatepickerFieldMode = (typeof FORM_DATEPICKER_FIELD_MODES)[number];
|
|
5
6
|
export interface FormFieldRendererSlotDefinition {
|
|
6
7
|
id: "field" | "label" | "description" | "error";
|
|
@@ -19,6 +19,7 @@ export interface DeferredLocalizedRichTextFieldProps {
|
|
|
19
19
|
contentClassName?: string;
|
|
20
20
|
endOfContentEditingArea?: boolean;
|
|
21
21
|
placeholderClassName?: string;
|
|
22
|
+
toolbarClassName?: string;
|
|
22
23
|
styleControls?: RichTextStyleControl[];
|
|
23
24
|
templateVariables?: RichTextTemplateVariable[];
|
|
24
25
|
toolbarMode?: "floating" | "docked" | "none";
|
|
@@ -1,17 +1,14 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { ItemAuthoringState } from '../../../../modules/survey-editor/registry';
|
|
1
|
+
import { ComponentType } from 'react';
|
|
3
2
|
interface ItemAuthoringStatePreviewProps {
|
|
4
|
-
state: ItemAuthoringState;
|
|
5
3
|
itemTypeLabel: string;
|
|
4
|
+
icon: ComponentType<{
|
|
5
|
+
className?: string;
|
|
6
|
+
"aria-hidden"?: boolean;
|
|
7
|
+
}>;
|
|
8
|
+
color?: string;
|
|
6
9
|
onEdit?: () => void;
|
|
7
10
|
description?: string;
|
|
8
11
|
className?: string;
|
|
9
12
|
}
|
|
10
|
-
export declare function ItemAuthoringStatePreview({
|
|
11
|
-
interface IncompleteItemPreviewFrameProps {
|
|
12
|
-
children: ReactNode;
|
|
13
|
-
onEdit?: () => void;
|
|
14
|
-
className?: string;
|
|
15
|
-
}
|
|
16
|
-
export declare function IncompleteItemPreviewFrame({ children, onEdit, className, }: IncompleteItemPreviewFrameProps): import("react").JSX.Element;
|
|
13
|
+
export declare function ItemAuthoringStatePreview({ itemTypeLabel, icon: Icon, color, onEdit, description, className, }: ItemAuthoringStatePreviewProps): import("react").JSX.Element;
|
|
17
14
|
export {};
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
interface ItemColorMenuProps {
|
|
2
2
|
itemId: string;
|
|
3
|
+
disabled?: boolean;
|
|
3
4
|
}
|
|
4
|
-
export declare const DropdownItemColorMenu: ({ itemId }: ItemColorMenuProps) => import("react").JSX.Element;
|
|
5
|
+
export declare const DropdownItemColorMenu: ({ itemId, disabled }: ItemColorMenuProps) => import("react").JSX.Element;
|
|
5
6
|
export declare const ContextItemColorMenu: ({ itemId }: ItemColorMenuProps) => import("react").JSX.Element;
|
|
6
7
|
export {};
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { SurveyItemCore } from '@case-framework/survey-core';
|
|
2
|
+
export type ItemEditingPresentation = "inline" | "fullscreen";
|
|
3
|
+
export type EditorSide = "left" | "right";
|
|
4
|
+
interface ItemEditingHeaderProps {
|
|
5
|
+
item: SurveyItemCore;
|
|
6
|
+
presentation: ItemEditingPresentation;
|
|
7
|
+
color: string;
|
|
8
|
+
previewVisible: boolean;
|
|
9
|
+
editorSide: EditorSide;
|
|
10
|
+
afterDeleteItemId?: string | null;
|
|
11
|
+
onPreviewVisibilityChange: () => void;
|
|
12
|
+
onEditorSideChange: (side: EditorSide) => void;
|
|
13
|
+
onFullscreenToggle: () => void;
|
|
14
|
+
onClose: () => void;
|
|
15
|
+
}
|
|
16
|
+
export declare const ItemEditingHeader: ({ item, presentation, color, previewVisible, editorSide, afterDeleteItemId, onPreviewVisibilityChange, onEditorSideChange, onFullscreenToggle, onClose, }: ItemEditingHeaderProps) => import("react").JSX.Element;
|
|
17
|
+
export {};
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { ReactNode } from 'react';
|
|
2
|
+
import { Layout } from 'react-resizable-panels';
|
|
3
|
+
import { EditorSide } from './item-editing-header';
|
|
4
|
+
interface ItemEditingPanelsProps {
|
|
5
|
+
fillHeight: boolean;
|
|
6
|
+
horizontal: boolean;
|
|
7
|
+
editorSide: EditorSide;
|
|
8
|
+
previewVisible: boolean;
|
|
9
|
+
initialLayout?: Layout;
|
|
10
|
+
editor: ReactNode;
|
|
11
|
+
preview: ReactNode;
|
|
12
|
+
resizeLabel: string;
|
|
13
|
+
onLayoutChanged: (layout: Layout) => void;
|
|
14
|
+
}
|
|
15
|
+
export declare const ItemEditingPanels: ({ fillHeight, horizontal, editorSide, previewVisible, initialLayout, editor, preview, resizeLabel, onLayoutChanged, }: ItemEditingPanelsProps) => import("react").JSX.Element;
|
|
16
|
+
export {};
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { ItemEditingPresentation } from './item-editing-header';
|
|
2
|
+
interface ItemEditingSurfaceContextValue {
|
|
3
|
+
presentation: ItemEditingPresentation;
|
|
4
|
+
}
|
|
5
|
+
export declare const ItemEditingSurfaceProvider: import('react').Provider<ItemEditingSurfaceContextValue | null>;
|
|
6
|
+
export declare const useItemEditingSurface: () => ItemEditingSurfaceContextValue | null;
|
|
7
|
+
export declare const useIsInsideItemEditingSurface: () => boolean;
|
|
8
|
+
export {};
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { SurveyItemCore } from '@case-framework/survey-core';
|
|
2
|
+
import { ItemEditingPresentation } from './item-editing-header';
|
|
3
|
+
interface ItemEditingSurfaceProps {
|
|
4
|
+
item: SurveyItemCore;
|
|
5
|
+
presentation: ItemEditingPresentation;
|
|
6
|
+
afterDeleteItemId?: string | null;
|
|
7
|
+
className?: string;
|
|
8
|
+
}
|
|
9
|
+
export declare const ItemEditingSurface: (props: ItemEditingSurfaceProps) => import("react").JSX.Element;
|
|
10
|
+
export {};
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { ReactNode } from 'react';
|
|
2
|
+
interface ItemEditorApplyContextValue {
|
|
3
|
+
hasPendingChanges: boolean;
|
|
4
|
+
applyPendingChanges: () => void;
|
|
5
|
+
registerPendingChange: (id: string, apply: () => void) => () => void;
|
|
6
|
+
setPendingChange: (id: string, isPending: boolean) => void;
|
|
7
|
+
}
|
|
8
|
+
export declare const ItemEditorApplyProvider: ({ children }: {
|
|
9
|
+
children: ReactNode;
|
|
10
|
+
}) => import("react").JSX.Element;
|
|
11
|
+
interface UseItemEditorApplyActionOptions {
|
|
12
|
+
id: string;
|
|
13
|
+
isPending: boolean;
|
|
14
|
+
apply: () => void;
|
|
15
|
+
}
|
|
16
|
+
/** Lets an editor-owned draft opt into the card-level Apply action. */
|
|
17
|
+
export declare const useItemEditorApplyAction: ({ id, isPending, apply, }: UseItemEditorApplyActionOptions) => void;
|
|
18
|
+
export declare const useItemEditorApply: () => ItemEditorApplyContextValue;
|
|
19
|
+
export {};
|
|
@@ -26,5 +26,13 @@ interface ItemEditorCardProps {
|
|
|
26
26
|
conditionsPopover?: ConditionsPopoverConfig;
|
|
27
27
|
children: ReactNode;
|
|
28
28
|
}
|
|
29
|
+
interface ConditionsIndicatorProps {
|
|
30
|
+
item: SurveyItemCore;
|
|
31
|
+
title: string;
|
|
32
|
+
description?: string;
|
|
33
|
+
accent: string;
|
|
34
|
+
}
|
|
35
|
+
/** A compact, always-visible summary of an item's branching and validation rules. */
|
|
36
|
+
export declare const ConditionsIndicator: React.FC<ConditionsIndicatorProps>;
|
|
29
37
|
declare const ItemEditorCard: React.FC<ItemEditorCardProps>;
|
|
30
38
|
export default ItemEditorCard;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const ITEM_EDITOR_HEADER_ROW_CLASS_NAME = "flex min-h-9 w-full shrink-0 flex-wrap items-center gap-1.5 px-4 py-0.5";
|
|
@@ -3,6 +3,7 @@ import { ItemPreviewMode } from '../../../../modules/survey-editor/registry';
|
|
|
3
3
|
interface ItemPreviewProps {
|
|
4
4
|
item: SurveyItemCore | undefined;
|
|
5
5
|
mode?: ItemPreviewMode;
|
|
6
|
+
previewOnly?: boolean;
|
|
6
7
|
}
|
|
7
|
-
declare const ItemPreview: ({ item, mode }: ItemPreviewProps) => import("react").JSX.Element;
|
|
8
|
+
declare const ItemPreview: ({ item, mode, previewOnly }: ItemPreviewProps) => import("react").JSX.Element;
|
|
8
9
|
export default ItemPreview;
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { Survey, SurveyExpressionReferenceDiagnostic, SurveyExpressionResponseSlot, ReferenceUsage } from '@case-framework/survey-core';
|
|
2
|
+
export declare const getEditorSurveyExpressionResponseSlots: (survey: Survey) => SurveyExpressionResponseSlot[];
|
|
3
|
+
export declare const analyzeEditorSurveyExpressionReferences: (survey: Survey) => SurveyExpressionReferenceDiagnostic[];
|
|
4
|
+
export declare const getItemAndDescendantIds: (survey: Survey, itemId: string) => Set<string>;
|
|
5
|
+
/** Returns only valid references outside the subtree that deletion would break. */
|
|
6
|
+
export declare const getExternalReferencesToRemovedItems: (survey: Survey, itemId: string) => ReferenceUsage[];
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { Content, Survey } from '@case-framework/survey-core';
|
|
2
|
+
import { ReactNode } from 'react';
|
|
3
|
+
interface PreviewDraftContextValue {
|
|
4
|
+
/** Publish an uncommitted translation change for the participant-facing previews. */
|
|
5
|
+
setTranslationDraft: (itemId: string, locale: string, contentKey: string, content?: Content) => void;
|
|
6
|
+
clearDraft: (itemId: string) => void;
|
|
7
|
+
}
|
|
8
|
+
/**
|
|
9
|
+
* Holds transient authoring values used only by previews. It deliberately never
|
|
10
|
+
* mutates SurveyEditor, so drafts cannot create history entries or be persisted.
|
|
11
|
+
*/
|
|
12
|
+
export declare const PreviewDraftProvider: ({ survey, activeItemId, children, }: {
|
|
13
|
+
survey: Survey | null;
|
|
14
|
+
activeItemId?: string;
|
|
15
|
+
children: ReactNode;
|
|
16
|
+
}) => import("react").JSX.Element;
|
|
17
|
+
export declare const usePreviewDraft: () => PreviewDraftContextValue;
|
|
18
|
+
/** The single derived survey shared by inline and fullscreen previews. */
|
|
19
|
+
export declare const usePreviewSurvey: (committedSurvey: Survey | null) => Survey | null;
|
|
20
|
+
export {};
|
package/dist/src/modules/survey-editor/routes/editor/_components/expression-diagnostics-status.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const ExpressionDiagnosticsStatus: () => import("react").JSX.Element | null;
|
package/dist/src/modules/survey-editor/routes/editor/item-editor/_components/item-drag-drop.d.ts
CHANGED
|
@@ -5,8 +5,19 @@ export interface ItemPresetDragData {
|
|
|
5
5
|
kind: "item-preset";
|
|
6
6
|
presetId: string;
|
|
7
7
|
}
|
|
8
|
+
export interface ExistingItemDragData {
|
|
9
|
+
kind: "existing-item";
|
|
10
|
+
itemId: string;
|
|
11
|
+
}
|
|
8
12
|
export declare const isItemPresetDragData: (data: unknown) => data is ItemPresetDragData;
|
|
13
|
+
export declare const isExistingItemDragData: (data: unknown) => data is ExistingItemDragData;
|
|
9
14
|
export declare const useItemPresetDragActive: () => boolean;
|
|
15
|
+
export declare const useExistingItemDragActive: () => boolean;
|
|
16
|
+
export declare function ExistingItemDragHandle({ itemId, label, disabled }: {
|
|
17
|
+
itemId: string;
|
|
18
|
+
label: string;
|
|
19
|
+
disabled?: boolean;
|
|
20
|
+
}): import("react").JSX.Element;
|
|
10
21
|
export declare function SurveyItemDragDropProvider({ children }: {
|
|
11
22
|
children: ReactNode;
|
|
12
23
|
}): import("react").JSX.Element;
|
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
interface PreviewModeProps {
|
|
1
|
+
export interface PreviewModeProps {
|
|
2
2
|
onSimulatorRequested?: () => void;
|
|
3
|
+
onWorkspaceInertChange?: (inert: boolean) => void;
|
|
3
4
|
}
|
|
4
|
-
declare const PreviewMode: (
|
|
5
|
+
declare const PreviewMode: (props: PreviewModeProps) => import("react").JSX.Element;
|
|
5
6
|
export default PreviewMode;
|
|
@@ -7,9 +7,6 @@ interface PreviewControlsProps {
|
|
|
7
7
|
canReset: boolean;
|
|
8
8
|
onReset: () => void;
|
|
9
9
|
onSimulatorRequested?: () => void;
|
|
10
|
-
fullscreen: boolean;
|
|
11
|
-
onFullscreenChange: (fullscreen: boolean) => void;
|
|
12
|
-
expanded?: boolean;
|
|
13
10
|
}
|
|
14
|
-
export declare const PreviewControls: ({ preferences, onPreferencesChange, canLocate, onLocate, canReset, onReset, onSimulatorRequested,
|
|
11
|
+
export declare const PreviewControls: ({ preferences, onPreferencesChange, canLocate, onLocate, canReset, onReset, onSimulatorRequested, }: PreviewControlsProps) => import("react").JSX.Element;
|
|
15
12
|
export {};
|
|
@@ -51,13 +51,16 @@ export interface EditorStore {
|
|
|
51
51
|
getCommitsSinceInitial: () => SurveyEditorHistoryCommit[];
|
|
52
52
|
addItem: (target: Target | null, item: SurveyItemCore, content?: SurveyItemTranslations) => void;
|
|
53
53
|
removeItem: (itemId: string, nested?: boolean) => boolean;
|
|
54
|
+
removeItems: (itemIds: readonly string[]) => boolean;
|
|
54
55
|
moveItem: (itemId: string, newTarget: Target) => boolean;
|
|
56
|
+
moveItems: (itemIds: readonly string[], newTarget: Target) => boolean;
|
|
55
57
|
updateItemTranslations: (itemId: string, updatedContent?: SurveyItemTranslations) => boolean;
|
|
56
58
|
copyItem: (itemId: string) => SurveyItemClipboardData;
|
|
57
59
|
pasteItem: (clipboardData: SurveyItemClipboardData, target: Target) => string | null;
|
|
58
60
|
getRootItem: () => GroupItemCore | undefined;
|
|
59
61
|
getItemDataCopy: (itemId: string) => RawSurveyItem;
|
|
60
62
|
updateItem: (itemId: string, rawItemData: RawSurveyItem | Partial<RawSurveyItem>) => void;
|
|
63
|
+
rewriteResponseReferences: (replacements: Readonly<Record<string, string>>) => number;
|
|
61
64
|
updateSurveyTranslations: (updates: {
|
|
62
65
|
surveyCard?: {
|
|
63
66
|
locale: string;
|
|
@@ -5,7 +5,7 @@ import { LocalizationCatalog, LocalizationTranslate, LocalizationValues } from '
|
|
|
5
5
|
import { SurveyEditorDateLocales } from './localization/date-fns';
|
|
6
6
|
import { SurveyEditorWorkspace } from './workspace';
|
|
7
7
|
interface SurveyEditorConfigType {
|
|
8
|
-
helpLink: string;
|
|
8
|
+
helpLink: string | null;
|
|
9
9
|
aiProvider: SurveyEditorAIProvider | null;
|
|
10
10
|
fallbackLocale: string;
|
|
11
11
|
language: string;
|
|
@@ -17,7 +17,7 @@ interface SurveyEditorConfigType {
|
|
|
17
17
|
}
|
|
18
18
|
interface SurveyEditorConfigProviderProps {
|
|
19
19
|
children: ReactNode;
|
|
20
|
-
helpLink: string;
|
|
20
|
+
helpLink: string | null;
|
|
21
21
|
aiProvider?: SurveyEditorAIProvider | null;
|
|
22
22
|
fallbackLocale?: string;
|
|
23
23
|
language?: string;
|
|
@@ -49,7 +49,8 @@ export interface SurveyEditorProps {
|
|
|
49
49
|
/** Allows editor surfaces to create a new assistant thread and submit its first prompt. */
|
|
50
50
|
assistantThreadLauncher?: SurveyAssistantThreadLauncher;
|
|
51
51
|
persistDebounceMs?: number;
|
|
52
|
-
|
|
52
|
+
/** Help documentation URL. Pass null to hide the editor's Help button. */
|
|
53
|
+
helpLink?: string | null;
|
|
53
54
|
navigationAdapter?: SurveyEditorNavigationAdapter | null;
|
|
54
55
|
/** Configure the initial main panel and workspace panels. */
|
|
55
56
|
workspace?: SurveyEditorWorkspace;
|