@bygga.dev/editor 1.4.0 → 1.6.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 +576 -56
- package/{TextEditor-BfX5P-be.js → TextEditor-G1pjeq9o.js} +638 -488
- package/bygga-editor.js +1294 -1267
- package/element.d.ts +13 -1
- package/package.json +1 -1
- package/{urls-T0CnP_ys.js → urls-Ckq4mual.js} +3585 -3547
package/element.d.ts
CHANGED
|
@@ -3,6 +3,7 @@ type BrandCustomFont = {
|
|
|
3
3
|
name: string;
|
|
4
4
|
href: string;
|
|
5
5
|
fontFamily?: string;
|
|
6
|
+
type?: 'file' | 'stylesheet';
|
|
6
7
|
};
|
|
7
8
|
type Brand = {
|
|
8
9
|
colors?: string[];
|
|
@@ -58,6 +59,16 @@ type SavedBlock = {
|
|
|
58
59
|
};
|
|
59
60
|
declare function parseSavedBlock(json: unknown): SavedBlock;
|
|
60
61
|
|
|
62
|
+
type AiAction = 'proofread' | 'rewrite' | 'shorten' | 'expand';
|
|
63
|
+
type AiRequest = {
|
|
64
|
+
action: AiAction;
|
|
65
|
+
text: string;
|
|
66
|
+
locale: string;
|
|
67
|
+
};
|
|
68
|
+
type AiAssistant = {
|
|
69
|
+
actions: readonly AiAction[];
|
|
70
|
+
run(request: AiRequest): Promise<string>;
|
|
71
|
+
};
|
|
61
72
|
type EditorConfig = {
|
|
62
73
|
uploadImage(image: Blob): Promise<string>;
|
|
63
74
|
saveDocument?(document: Document, compiled: string | null): Promise<void>;
|
|
@@ -65,6 +76,7 @@ type EditorConfig = {
|
|
|
65
76
|
saveBlock?(saved: SavedBlock): Promise<void>;
|
|
66
77
|
deleteSavedBlock?(id: string): Promise<void>;
|
|
67
78
|
plugins?: readonly BlockPlugin[];
|
|
79
|
+
ai?: AiAssistant;
|
|
68
80
|
};
|
|
69
81
|
|
|
70
82
|
declare const SUPPORTED_LOCALES: readonly ["en", "sv"];
|
|
@@ -119,4 +131,4 @@ declare global {
|
|
|
119
131
|
}
|
|
120
132
|
|
|
121
133
|
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 };
|
|
134
|
+
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 };
|