@bygga.dev/editor 0.1.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.
package/element.d.ts CHANGED
@@ -1,3 +1,9 @@
1
+ type BrandFont = 'arial' | 'tahoma' | 'trebuchet' | 'verdana' | 'georgia' | 'times' | 'courier';
2
+ type Brand = {
3
+ colors?: string[];
4
+ fonts?: BrandFont[];
5
+ };
6
+
1
7
  declare const brand: unique symbol;
2
8
  type Document = {
3
9
  readonly [brand]: 'Document';
@@ -7,7 +13,7 @@ declare function createEmptyDocument(): Document;
7
13
 
8
14
  type EditorConfig = {
9
15
  uploadImage(image: Blob): Promise<string>;
10
- saveDocument?(document: Document): Promise<void>;
16
+ saveDocument?(document: Document, compiled: string | null): Promise<void>;
11
17
  onImageError?(error: unknown): void;
12
18
  };
13
19
 
@@ -34,6 +40,7 @@ type ByggaEditorEventMap = {
34
40
  interface ByggaEditorElement extends HTMLElement {
35
41
  addEventListener<K extends keyof ByggaEditorEventMap>(type: K, listener: (this: ByggaEditorElement, event: ByggaEditorEventMap[K]) => void, options?: boolean | AddEventListenerOptions): void;
36
42
  addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;
43
+ brand?: Brand;
37
44
  config: EditorConfig;
38
45
  document?: Document | null;
39
46
  getDocument(): Document;
@@ -53,4 +60,4 @@ declare global {
53
60
  }
54
61
 
55
62
  export { ByggaEditor, DEFAULT_LOCALE, EDITOR_TAG, SUPPORTED_LOCALES, createEmptyDocument, parseDocument };
56
- export type { ByggaEditorElement, ByggaEditorEventMap, Document, EditorConfig, LicenseError, LicenseErrorReason, Locale, MergeTagLabels, MergeTags };
63
+ export type { Brand, BrandFont, ByggaEditorElement, ByggaEditorEventMap, Document, EditorConfig, LicenseError, LicenseErrorReason, Locale, MergeTagLabels, MergeTags };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@bygga.dev/editor",
3
- "version": "0.1.0",
3
+ "version": "0.3.1",
4
4
  "description": "Visual content builder shipped as the <bygga-editor> custom element",
5
5
  "license": "UNLICENSED",
6
6
  "type": "module",
@@ -11,4 +11,4 @@
11
11
  "default": "./bygga-editor.js"
12
12
  }
13
13
  }
14
- }
14
+ }