@case-framework/survey-ui 0.3.3 → 0.4.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.
@@ -1,10 +1,10 @@
1
1
  export { SurveyPlayer, SurveyContextProvider, SurveyItemRenderer, useSurveyCtx, useSurveyTranslation, } from './modules/survey-player';
2
2
  export { SurveyEditor } from './modules/survey-editor';
3
- export { APPLY_RICH_TEXT_STYLE_COMMAND, buildSurveyFileName, createBlankEditorState, createEditorStateFromRawSurvey, createRichTextEditorValueFromContent, createRichTextEditorValueFromPlainText, createRichTextEditorValueFromText, DEFAULT_CATEGORY_LABELS, DEFAULT_BLOCK_CONTENT_POLICY, DEFAULT_COMPACT_CONTENT_POLICY, RichTextEditor, RichTextBlockEditor, CONVERT_RICH_TEXT_LINK_TO_TEXT_COMMAND, INSERT_RICH_TEXT_LINK_COMMAND, INSERT_RICH_TEXT_TEMPLATE_VARIABLE_COMMAND, isBlockContentPolicyVariant, mergeRichTextContentPolicy, OPEN_RICH_TEXT_LINK_EDITOR_COMMAND, RichTextContentView, sanitizeContentForPolicy, SurveyImageAssetManager, UPDATE_RICH_TEXT_LINK_COMMAND, entriesToComposedEditorRegistry, entriesToParticipantRegistry, entriesToItemTypeRegistry, getRichTextContentFromEditorState, parseEditorStateFromJsonText, resolveCategoryLabel, serializeSurveyStateForFile, useSurveyAssets, useSurveyImageAssets, useUnusedSurveyAssetCount, validateRegistryEntries, } from './modules/survey-editor';
3
+ export { APPLY_RICH_TEXT_STYLE_COMMAND, buildSurveyFileName, 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
4
  export { FilepickerDropzone } from './components/c-ui/filepicker-dropzone';
5
5
  export { cloneRegistryEntries, createComposedEditorRegistry, createRegistryEntries, createSurveyPlayerRegistry, getDefaultComposedEditorRegistry, getDefaultRegistryEntries, getDefaultSurveyPlayerRegistry, } from './modules/default-item-registry';
6
6
  export type { CreateComposedEditorRegistryOptions, CreateRegistryEntriesOptions, CreateSurveyPlayerRegistryOptions, RegistryConflictStrategy, } from './modules/default-item-registry';
7
- export type { SurveyEditorProps, SurveyEditorStateChange, EditorItemDefinition, EditorItemDefinitionRegistry, ComposedEditorItemRegistry, EntriesToComposedEditorRegistryOptions, EntriesToParticipantRegistryOptions, ItemEditorComponentProps, ItemIconComponent, ItemPreviewComponentProps, ItemPreviewMode, ItemRegistryEntry, ItemRendererComponentProps, ItemSearchAdapter, RegistryValidationIssue, RegistryValidationMode, RegistryValidationOptions, RegistryValidationResult, SurveyPlayerItemRegistry, AISuggestedText, BuildSurveyAIContextOptions, GenerateItemFromIntentRequest, GenerateItemFromIntentResult, GeneratedItemIntentSuggestion, SuggestItemKeyRequest, SuggestItemKeyResult, SuggestItemKeySuggestion, SuggestItemLabelRequest, SuggestItemLabelResult, SuggestItemLabelSuggestion, SurveyEditorAIProvider, SurveyAIContextScope, SurveyAIInvocationMode, SurveyAIRequestOptions, RichTextEditorChange, RichTextEditorProps, RichTextBlockEditorChange, RichTextBlockEditorProps, RichTextContentPolicy, RichTextLinkPayload, RichTextStyleControl, RichTextTemplateVariable, RichTextContentViewProps, RichTextEditorVariant, RichTextStyleAttribute, RichTextSupportedBlockType, SerializedRichTextLinkNode, SerializedTemplateVariableNode, SurveyImageAssetManagerProps, TranslateContentEntry, TranslateContentRequest, TranslateContentResult, ParsedSurveySession, ParsedSurveySessionFormat, } from './modules/survey-editor';
7
+ export type { SurveyEditorProps, SurveyEditorStateChange, EditorLocalizationMessages, EditorItemDefinition, EditorItemDefinitionRegistry, ComposedEditorItemRegistry, EntriesToComposedEditorRegistryOptions, EntriesToParticipantRegistryOptions, ItemEditorComponentProps, ItemIconComponent, ItemPreviewComponentProps, ItemPreviewMode, ItemRegistryEntry, ItemRendererComponentProps, ItemSearchAdapter, RegistryValidationIssue, RegistryValidationMode, RegistryValidationOptions, RegistryValidationResult, SurveyPlayerItemRegistry, AISuggestedText, BuildSurveyAIContextOptions, GenerateItemFromIntentRequest, GenerateItemFromIntentResult, GeneratedItemIntentSuggestion, SuggestItemKeyRequest, SuggestItemKeyResult, SuggestItemKeySuggestion, SuggestItemLabelRequest, SuggestItemLabelResult, SuggestItemLabelSuggestion, SurveyEditorAIProvider, SurveyAIContextScope, SurveyAIInvocationMode, SurveyAIRequestOptions, RichTextEditorChange, RichTextEditorProps, RichTextBlockEditorChange, RichTextBlockEditorProps, RichTextContentPolicy, RichTextLinkPayload, RichTextStyleControl, RichTextTemplateVariable, RichTextContentViewProps, RichTextEditorVariant, RichTextStyleAttribute, RichTextSupportedBlockType, SerializedRichTextLinkNode, SerializedTemplateVariableNode, SurveyImageAssetManagerProps, SurveyEditorDateLocales, SurveyEditorLocalizations, TranslateContentEntry, TranslateContentRequest, TranslateContentResult, ParsedSurveySession, ParsedSurveySessionFormat, } from './modules/survey-editor';
8
8
  export type { SurveyPlayerProps, SurveyContextProviderProps, SurveyItemRendererProps, SurveyPlayerLocalizationMessages, SurveyPlayerLocalizations, SurveyPlayerTranslate, SurveyPlayerTranslationValue, SurveyPlayerTranslationValues, } from './modules/survey-player';
9
9
  export type { FilepickerDropzoneLabels, FilepickerDropzoneProps, } from './components/c-ui/filepicker-dropzone';
10
10
  export type { BuildSurveyAIContextPackOptions, SurveyAIContextIndexes, SurveyAIContextPack, SurveyAIContextPurpose, SurveyAIItemContextNode, SurveyAIKeyIndexEntry, SurveyAIFocus, SurveyAIOutlineNode, SurveyAITranslationSnippet, } from '@case-framework/survey-core/editor';
@@ -1,9 +1,10 @@
1
- import { SerializedSurveyEditor, SurveyEditor as SurveyEditorCore } from '@case-framework/survey-core/editor';
1
+ import { SerializedSurveyEditor, SurveyEditorHistoryCommit, SurveyEditor as SurveyEditorCore } from '@case-framework/survey-core/editor';
2
2
  export interface EditorStateChangePayload {
3
3
  sessionId: string | null;
4
4
  state: SerializedSurveyEditor;
5
5
  revision: number;
6
6
  hasUncommittedChanges: boolean;
7
+ commitsSinceInitial: SurveyEditorHistoryCommit[];
7
8
  at: number;
8
9
  }
9
10
  interface UseEditorStateChangeOptions {
@@ -3,7 +3,7 @@ export type { SurveyEditorProps, SurveyEditorStateChange } from './survey-editor
3
3
  export { EditorInstanceProvider } from './editor-instance-provider';
4
4
  export { useEditorDateLocale, useEditorTranslation } from './survey-editor-config';
5
5
  export type { SurveyEditorNavigationAdapter, SurveyEditorLocation } from './navigation/types';
6
- export { DEFAULT_EDITOR_LANGUAGE, DEFAULT_DATE_FNS_LOCALES, defaultSurveyEditorLocalizations, getDateFnsLocale, mergeDateFnsLocales, surveyEditorEnMessages, } from './localization';
6
+ export { DEFAULT_EDITOR_LANGUAGE, DEFAULT_DATE_FNS_LOCALES, defaultSurveyEditorLocalizations, getDateFnsLocale, mergeDateFnsLocales, mergeEditorLocalizations, surveyEditorEnMessages, surveyEditorNlMessages, } from './localization';
7
7
  export type { EditorLocalizationMessages, EditorTranslationValues, SurveyEditorDateLocales, SurveyEditorLocalizations, } from './localization';
8
8
  export type { AISuggestedText, BuildSurveyAIContextOptions, GenerateItemFromIntentRequest, GenerateItemFromIntentResult, GeneratedItemIntentSuggestion, SuggestItemKeyRequest, SuggestItemKeyResult, SuggestItemKeySuggestion, SuggestItemLabelRequest, SuggestItemLabelResult, SuggestItemLabelSuggestion, SurveyEditorAIProvider, SurveyAIContextPurpose, SurveyAIContextScope, SurveyAIInvocationMode, SurveyAIRequestOptions, TranslateContentEntry, TranslateContentRequest, TranslateContentResult, } from './ai/types';
9
9
  export * from './registry';
@@ -1,5 +1,5 @@
1
1
  import { StoreApi } from 'zustand';
2
- import { SurveyEditor, Target, SurveyItemClipboardData, CommitMeta, UndoRedoConfig } from '@case-framework/survey-core/editor';
2
+ import { SurveyEditor, Target, SurveyItemClipboardData, CommitMeta, SurveyEditorHistoryCommit, UndoRedoConfig } from '@case-framework/survey-core/editor';
3
3
  import { SurveyItemCore, SurveyItemTranslations, RawSurveyItem, TemplateValueDefinition, GroupItemCore, RawSurveyAsset, SurveyCardContent, NavigationContent, Content } from '@case-framework/survey-core';
4
4
  import { ComposedEditorItemRegistry, ItemCategory, ItemLocaleMap, ItemRegistryEntry } from '../registry';
5
5
  interface StartNewSessionOptions {
@@ -44,6 +44,7 @@ export interface EditorStore {
44
44
  memorySize: number;
45
45
  isCurrent: boolean;
46
46
  }>;
47
+ getCommitsSinceInitial: () => SurveyEditorHistoryCommit[];
47
48
  addItem: (target: Target | null, item: SurveyItemCore, content?: SurveyItemTranslations) => void;
48
49
  removeItem: (itemId: string, nested?: boolean) => boolean;
49
50
  moveItem: (itemId: string, newTarget: Target) => boolean;