@bygga.dev/editor 1.7.4 → 1.8.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/element.d.ts CHANGED
@@ -69,6 +69,25 @@ type AiAssistant = {
69
69
  actions: readonly AiAction[];
70
70
  run(request: AiRequest): Promise<string>;
71
71
  };
72
+ type ImageSearchQuery = {
73
+ query: string;
74
+ page: number;
75
+ perPage: number;
76
+ };
77
+ type LibraryImage = {
78
+ id: string;
79
+ insertUrl: string;
80
+ thumbnailUrl?: string;
81
+ alt?: string;
82
+ width?: number;
83
+ height?: number;
84
+ photographer?: string;
85
+ };
86
+ type LibraryPage = {
87
+ images: LibraryImage[];
88
+ hasMore: boolean;
89
+ attribution?: string;
90
+ };
72
91
  type EditorConfig = {
73
92
  uploadImage(image: Blob): Promise<string>;
74
93
  saveDocument?(document: Document, compiled: string | null): Promise<void>;
@@ -77,6 +96,7 @@ type EditorConfig = {
77
96
  deleteSavedBlock?(id: string): Promise<void>;
78
97
  plugins?: readonly BlockPlugin[];
79
98
  ai?: AiAssistant;
99
+ searchImages?(query: ImageSearchQuery, signal?: AbortSignal): Promise<LibraryPage>;
80
100
  };
81
101
 
82
102
  declare const SUPPORTED_LOCALES: readonly ["en", "sv"];
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@bygga.dev/editor",
3
- "version": "1.7.4",
3
+ "version": "1.8.0",
4
4
  "description": "Visual content builder shipped as the <bygga-editor> custom element",
5
5
  "license": "UNLICENSED",
6
6
  "type": "module",