@bygga.dev/editor 1.4.0 → 1.5.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/README.md +557 -56
- package/{TextEditor-BfX5P-be.js → TextEditor-CIqROgaO.js} +638 -488
- package/bygga-editor.js +1292 -1266
- package/element.d.ts +12 -1
- package/package.json +1 -1
- package/{urls-T0CnP_ys.js → urls-DoSoJydy.js} +3582 -3550
package/element.d.ts
CHANGED
|
@@ -58,6 +58,16 @@ type SavedBlock = {
|
|
|
58
58
|
};
|
|
59
59
|
declare function parseSavedBlock(json: unknown): SavedBlock;
|
|
60
60
|
|
|
61
|
+
type AiAction = 'proofread' | 'rewrite' | 'shorten' | 'expand';
|
|
62
|
+
type AiRequest = {
|
|
63
|
+
action: AiAction;
|
|
64
|
+
text: string;
|
|
65
|
+
locale: string;
|
|
66
|
+
};
|
|
67
|
+
type AiAssistant = {
|
|
68
|
+
actions: readonly AiAction[];
|
|
69
|
+
run(request: AiRequest): Promise<string>;
|
|
70
|
+
};
|
|
61
71
|
type EditorConfig = {
|
|
62
72
|
uploadImage(image: Blob): Promise<string>;
|
|
63
73
|
saveDocument?(document: Document, compiled: string | null): Promise<void>;
|
|
@@ -65,6 +75,7 @@ type EditorConfig = {
|
|
|
65
75
|
saveBlock?(saved: SavedBlock): Promise<void>;
|
|
66
76
|
deleteSavedBlock?(id: string): Promise<void>;
|
|
67
77
|
plugins?: readonly BlockPlugin[];
|
|
78
|
+
ai?: AiAssistant;
|
|
68
79
|
};
|
|
69
80
|
|
|
70
81
|
declare const SUPPORTED_LOCALES: readonly ["en", "sv"];
|
|
@@ -119,4 +130,4 @@ declare global {
|
|
|
119
130
|
}
|
|
120
131
|
|
|
121
132
|
export { ByggaEditor, DEFAULT_LOCALE, EDITOR_TAG, SUPPORTED_LOCALES, createEmptyDocument, parseDocument, parseSavedBlock };
|
|
122
|
-
export type { BlockPlugin, BlockPluginGlobalSettings, BlockPluginGlobalsContext, BlockPluginSettingsContext, Brand, BrandCustomFont, BrandFont, ByggaEditorElement, ByggaEditorEventMap, Document, EditorConfig, LicenseError, LicenseErrorReason, Locale, MergeTagEntry, MergeTagLabels, MergeTagOption, MergeTags, SavedBlock, SavedBlockContent };
|
|
133
|
+
export type { AiAction, AiAssistant, AiRequest, BlockPlugin, BlockPluginGlobalSettings, BlockPluginGlobalsContext, BlockPluginSettingsContext, Brand, BrandCustomFont, BrandFont, ByggaEditorElement, ByggaEditorEventMap, Document, EditorConfig, LicenseError, LicenseErrorReason, Locale, MergeTagEntry, MergeTagLabels, MergeTagOption, MergeTags, SavedBlock, SavedBlockContent };
|