@case-framework/survey-editor-ui 0.4.1 → 0.4.2
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/src/components/rich-text-editor/plugins/block-shortcut-plugin.d.ts +7 -0
- package/dist/src/components/rich-text-editor/rich-text-editor-utils.d.ts +22 -0
- package/dist/src/modules/default-item-registry/shared/question-editor/deferred-localized-rich-text-field.d.ts +4 -0
- package/dist/survey-editor-ui.cjs.js +62 -62
- package/dist/survey-editor-ui.cjs.js.map +1 -1
- package/dist/survey-editor-ui.es.js +11218 -11056
- package/dist/survey-editor-ui.es.js.map +1 -1
- package/package.json +4 -4
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
export interface BlockShortcutPluginProps {
|
|
2
|
+
bulletListsEnabled: boolean;
|
|
3
|
+
headingsEnabled: boolean;
|
|
4
|
+
}
|
|
5
|
+
/** Converts an exact marker-only root paragraph while the space key is being handled. */
|
|
6
|
+
export declare function $convertBlockShortcut(bulletListsEnabled: boolean, headingsEnabled: boolean): boolean;
|
|
7
|
+
export declare function BlockShortcutPlugin({ bulletListsEnabled, headingsEnabled, }: BlockShortcutPluginProps): null;
|
|
@@ -42,6 +42,11 @@ export type SerializedRichTextLinkNode = Spread<{
|
|
|
42
42
|
}, SerializedTextNode>;
|
|
43
43
|
/** Semantic buckets for slash menu grouping (visual sections in the picker). */
|
|
44
44
|
export type SlashCommandGroupId = "formatting" | "blocks" | "insert";
|
|
45
|
+
/**
|
|
46
|
+
* Block styles exposed by the rich-text toolbar.
|
|
47
|
+
*/
|
|
48
|
+
export type RichTextBlockStyle = "bullet-list" | "heading-1" | "heading-2" | "paragraph";
|
|
49
|
+
export type RichTextBlockSelectionStyle = RichTextBlockStyle | "mixed";
|
|
45
50
|
export declare const SLASH_COMMAND_GROUP_ORDER: Record<SlashCommandGroupId, number>;
|
|
46
51
|
export type SlashCommandItem = {
|
|
47
52
|
key: string;
|
|
@@ -76,6 +81,12 @@ export type SlashCommandItem = {
|
|
|
76
81
|
group: SlashCommandGroupId;
|
|
77
82
|
kind: "heading";
|
|
78
83
|
level: RichTextHeadingBlock["level"];
|
|
84
|
+
} | {
|
|
85
|
+
key: "paragraph";
|
|
86
|
+
label: string;
|
|
87
|
+
keywords: string[];
|
|
88
|
+
group: SlashCommandGroupId;
|
|
89
|
+
kind: "paragraph";
|
|
79
90
|
} | {
|
|
80
91
|
key: string;
|
|
81
92
|
label: string;
|
|
@@ -106,6 +117,17 @@ export declare function resolveStyleControl(control: RichTextStyleControl): {
|
|
|
106
117
|
};
|
|
107
118
|
export declare function getSlashCommandItems(styleControls: RichTextStyleControl[], templateVariables: RichTextTemplateVariable[], linksEnabled?: boolean, bulletListsEnabled?: boolean, headingsEnabled?: boolean, infoBoxesEnabled?: boolean, imagesEnabled?: boolean, separatorsEnabled?: boolean): SlashCommandItem[];
|
|
108
119
|
export declare function $insertSurveyRichTextHeading(level: RichTextHeadingBlock["level"]): boolean;
|
|
120
|
+
export declare function $insertSurveyRichTextParagraph(): boolean;
|
|
121
|
+
/** Returns a shared style, "mixed" for supported mixed blocks, or null if unsupported. */
|
|
122
|
+
export declare function $getCurrentRichTextBlockStyle(): RichTextBlockSelectionStyle | null;
|
|
123
|
+
/** Changes a supported selection through Lexical's normal block/list transforms. */
|
|
124
|
+
export declare function $setCurrentRichTextBlockStyle(style: RichTextBlockStyle): boolean;
|
|
125
|
+
/**
|
|
126
|
+
* Reuses an empty root paragraph, otherwise creates one immediately after the
|
|
127
|
+
* current root block. Insert commands use this staging block so existing
|
|
128
|
+
* content is never converted or replaced.
|
|
129
|
+
*/
|
|
130
|
+
export declare function $insertRichTextBlockAfterCurrentBlock(): boolean;
|
|
109
131
|
/** Nearest paragraph or survey heading that supports Lexical element format (block text-align). */
|
|
110
132
|
export declare function $getRichTextBlockForAlignment(selection: RangeSelection): ParagraphNode | SurveyRichTextHeadingNode | null;
|
|
111
133
|
/** Direct children of the editor root that contain any part of the range (paragraph, list, image, etc.). */
|
|
@@ -9,6 +9,10 @@ export interface DeferredLocalizedRichTextFieldProps {
|
|
|
9
9
|
description?: string;
|
|
10
10
|
/** Omit Field chrome; use for inline question title/subtitle. */
|
|
11
11
|
bare?: boolean;
|
|
12
|
+
/** Focus the editor as soon as it is mounted. */
|
|
13
|
+
autoFocus?: boolean;
|
|
14
|
+
/** Where to place the selection when the editor receives autofocus. */
|
|
15
|
+
autoFocusSelection?: "rootStart" | "rootEnd";
|
|
12
16
|
contentPolicy?: RichTextContentPolicy;
|
|
13
17
|
wrapperClassName?: string;
|
|
14
18
|
surfaceClassName?: string;
|