@case-framework/survey-editor-ui 0.2.0 → 0.3.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,6 @@
1
+ /**
2
+ * Adds editor-only room below non-empty content. Clicking it selects an existing
3
+ * trailing paragraph or creates one, without persisting a placeholder paragraph
4
+ * merely because the editor was opened.
5
+ */
6
+ export declare function EndOfContentEditingAreaPlugin(): import("react/jsx-runtime").JSX.Element | null;
@@ -19,6 +19,8 @@ export interface RichTextEditorProps {
19
19
  wrapperClassName?: string;
20
20
  surfaceClassName?: string;
21
21
  contentClassName?: string;
22
+ /** Add generous editor-only space below non-empty content that continues in a new paragraph. */
23
+ endOfContentEditingArea?: boolean;
22
24
  placeholderClassName?: string;
23
25
  toolbarClassName?: string;
24
26
  commandMenuClassName?: string;
@@ -40,4 +42,4 @@ export interface RichTextEditorProps {
40
42
  onKeyDown?: KeyboardEventHandler<HTMLDivElement>;
41
43
  onKeyDownCapture?: KeyboardEventHandler<HTMLDivElement>;
42
44
  }
43
- export declare function RichTextEditor({ id, value, placeholder, autoFocus, editable, wrapperClassName, surfaceClassName, contentClassName, placeholderClassName, toolbarClassName, commandMenuClassName, styleControls, templateVariables, editorVariant, contentPolicy, resolveImageAssetUrl, imageAssets, registerImageAsset, imageAssetDeletion, linksEnabled, "aria-label": ariaLabel, onChange, onFocus, onBlur, onKeyDown, onKeyDownCapture, }: RichTextEditorProps): import("react/jsx-runtime").JSX.Element;
45
+ export declare function RichTextEditor({ id, value, placeholder, autoFocus, editable, wrapperClassName, surfaceClassName, contentClassName, endOfContentEditingArea, placeholderClassName, toolbarClassName, commandMenuClassName, styleControls, templateVariables, editorVariant, contentPolicy, resolveImageAssetUrl, imageAssets, registerImageAsset, imageAssetDeletion, linksEnabled, "aria-label": ariaLabel, onChange, onFocus, onBlur, onKeyDown, onKeyDownCapture, }: RichTextEditorProps): import("react/jsx-runtime").JSX.Element;
@@ -6,6 +6,6 @@ export { SortableTree } from './components/common/sortable-tree';
6
6
  export type { SortableTreeDropEvent, SortableTreeDropPosition, SortableTreeEmptyGroupProps, SortableTreeMoveEvent, SortableTreePosition, SortableTreeProps, SortableTreeRenderItemProps, } from './components/common/sortable-tree';
7
7
  export { cloneRegistryEntries, createComposedEditorRegistry, createRegistryEntries, createSurveyPlayerRegistry, getDefaultComposedEditorRegistry, getDefaultRegistryEntries, getDefaultSurveyPlayerRegistry, } from './modules/default-item-registry';
8
8
  export type { CreateComposedEditorRegistryOptions, CreateRegistryEntriesOptions, CreateSurveyPlayerRegistryOptions, RegistryConflictStrategy, } from './modules/default-item-registry';
9
- 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';
9
+ export type { SurveyEditorProps, SurveyEditorStateChange, SurveyEditorWorkspace, SurveyEditorWorkspacePanelOptions, SurveyEditorAssistantController, SurveyAssistantSnapshotOptions, CreateSnapshotSurveyEditorAIProviderOptions, UseSurveyEditorAssistantIntegrationOptions, SurveyEditorAITaskCacheOptions, SurveyEditorAITaskExecution, SurveyEditorAITaskExecutor, SurveyEditorLocation, EditorItemDefinition, EditorItemDefinitionRegistry, ItemInitialDataContext, 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';
10
10
  export type { SurveyEditorDateLocales } from './modules/survey-editor/localization/date-fns';
11
11
  export type { FilepickerDropzoneLabels, FilepickerDropzoneProps, } from './components/c-ui/filepicker-dropzone';
@@ -13,6 +13,7 @@ export interface DeferredLocalizedRichTextFieldProps {
13
13
  wrapperClassName?: string;
14
14
  surfaceClassName?: string;
15
15
  contentClassName?: string;
16
+ endOfContentEditingArea?: boolean;
16
17
  placeholderClassName?: string;
17
18
  styleControls?: RichTextStyleControl[];
18
19
  templateVariables?: RichTextTemplateVariable[];
@@ -1,2 +1,6 @@
1
- declare const ItemEditorCard: React.FC;
1
+ interface ItemEditorCardProps {
2
+ itemId?: string;
3
+ presentation?: "workspace" | "inline" | "fullscreen";
4
+ }
5
+ declare const ItemEditorCard: React.FC<ItemEditorCardProps>;
2
6
  export default ItemEditorCard;
@@ -4,9 +4,10 @@ interface ItemAuthoringStatePreviewProps {
4
4
  state: ItemAuthoringState;
5
5
  itemTypeLabel: string;
6
6
  onEdit?: () => void;
7
+ description?: string;
7
8
  className?: string;
8
9
  }
9
- export declare function ItemAuthoringStatePreview({ state, itemTypeLabel, onEdit, className, }: ItemAuthoringStatePreviewProps): import("react/jsx-runtime").JSX.Element;
10
+ export declare function ItemAuthoringStatePreview({ state, itemTypeLabel, onEdit, description, className, }: ItemAuthoringStatePreviewProps): import("react/jsx-runtime").JSX.Element;
10
11
  interface IncompleteItemPreviewFrameProps {
11
12
  children: ReactNode;
12
13
  onEdit?: () => void;
@@ -0,0 +1,10 @@
1
+ interface RecommendedItemTypesProps {
2
+ targetParentId: string;
3
+ targetIndex?: number;
4
+ title: string;
5
+ browseLabel: string;
6
+ className?: string;
7
+ headingId?: string;
8
+ }
9
+ export declare const RecommendedItemTypes: ({ targetParentId, targetIndex, title, browseLabel, className, headingId, }: RecommendedItemTypesProps) => import("react/jsx-runtime").JSX.Element;
10
+ export {};
@@ -9,6 +9,8 @@ export interface TranslationModeLocation {
9
9
  export interface PreviewModeLocation {
10
10
  view: "preview-mode";
11
11
  itemId?: string;
12
+ editingItemId?: string;
13
+ presentation?: "inline" | "fullscreen";
12
14
  }
13
15
  export interface AssetManagerLocation {
14
16
  view: "asset-manager";
@@ -87,11 +87,16 @@ export interface EditorItemDefinition {
87
87
  capabilities?: ItemEditorCapabilities;
88
88
  expressions?: AnyItemExpressionDefinition[];
89
89
  isRootOnly?: boolean;
90
- getInitialItem?: () => ItemInitialData;
90
+ getInitialItem?: (context?: ItemInitialDataContext) => ItemInitialData;
91
91
  createItem?: (ctx: CreateItemContext) => string;
92
92
  searchAdapters?: ItemSearchAdapter[];
93
93
  includeDefaultSearchAdapter?: boolean;
94
94
  }
95
+ /** Context available when the editor creates an item from a registry entry. */
96
+ export interface ItemInitialDataContext {
97
+ /** The language currently selected in the editor. */
98
+ locale: string;
99
+ }
95
100
  export type EditorItemDefinitionRegistry = Record<string, EditorItemDefinition>;
96
101
  export interface ComposedEditorItemRegistry {
97
102
  coreRegistry: ItemTypeRegistry;
@@ -142,7 +147,7 @@ export interface ItemRegistryEntry {
142
147
  /** Editor-only */
143
148
  capabilities?: ItemEditorCapabilities;
144
149
  /** Editor-only: default raw item when creating new */
145
- getInitialItem?: () => ItemInitialData;
150
+ getInitialItem?: (context?: ItemInitialDataContext) => ItemInitialData;
146
151
  /** Editor-only: custom creation flow (advanced) */
147
152
  createItem?: (ctx: CreateItemContext) => string;
148
153
  /** Editor-only: hide from add-item options in non-root context */
@@ -5,6 +5,7 @@ interface SurveyPreviewCanvasProps {
5
5
  surveyEngine: SurveyEngineCore;
6
6
  preferences: PreviewPreferences;
7
7
  focusedItemId?: string;
8
+ editingItemId?: string;
8
9
  locateRequestKey: number;
9
10
  initialLocateReady: boolean;
10
11
  currentPageIndex: number;
@@ -12,5 +13,5 @@ interface SurveyPreviewCanvasProps {
12
13
  onResponseChanged: () => void;
13
14
  className?: string;
14
15
  }
15
- export declare const SurveyPreviewCanvas: ({ survey, surveyEngine, preferences, focusedItemId, locateRequestKey, initialLocateReady, currentPageIndex, onCurrentPageIndexChange, onResponseChanged, className, }: SurveyPreviewCanvasProps) => import("react/jsx-runtime").JSX.Element;
16
+ export declare const SurveyPreviewCanvas: ({ survey, surveyEngine, preferences, focusedItemId, editingItemId, locateRequestKey, initialLocateReady, currentPageIndex, onCurrentPageIndexChange, onResponseChanged, className, }: SurveyPreviewCanvasProps) => import("react/jsx-runtime").JSX.Element;
16
17
  export {};
@@ -74,6 +74,8 @@ export interface EditorStore {
74
74
  };
75
75
  };
76
76
  }) => void;
77
+ addLocale: (locale: string) => boolean;
78
+ removeLocale: (locale: string) => boolean;
77
79
  getMaxItemsPerPage: () => {
78
80
  large: number;
79
81
  small: number;
@@ -0,0 +1,2 @@
1
+ import { SurveyEditorLocation } from '../navigation/types';
2
+ export declare const getFocusedItemLocation: (location: SurveyEditorLocation, itemId?: string, itemType?: string, isRootItem?: boolean) => SurveyEditorLocation;
@@ -55,6 +55,24 @@
55
55
  will-change: transform, opacity;
56
56
  }
57
57
 
58
+ .survey-editor-opening-inline-item {
59
+ animation: survey-editor-open-inline-item 180ms cubic-bezier(0.215, 0.61, 0.355, 1);
60
+ transform-origin: top center;
61
+ will-change: transform, opacity;
62
+ }
63
+
64
+ @keyframes survey-editor-open-inline-item {
65
+ from {
66
+ opacity: 0;
67
+ transform: translateY(8px) scale(0.99);
68
+ }
69
+
70
+ to {
71
+ opacity: 1;
72
+ transform: translateY(0) scale(1);
73
+ }
74
+ }
75
+
58
76
  @keyframes survey-editor-open-item {
59
77
  from {
60
78
  opacity: 0;
@@ -80,7 +98,8 @@
80
98
  @media (prefers-reduced-motion: reduce) {
81
99
  .survey-editor-opening-item,
82
100
  .survey-editor-opening-item > *,
83
- .survey-editor-opening-preview {
101
+ .survey-editor-opening-preview,
102
+ .survey-editor-opening-inline-item {
84
103
  animation: none;
85
104
  will-change: auto;
86
105
  }