@wix/editor 1.287.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 ADDED
@@ -0,0 +1,34 @@
1
+ ## Editor Platform SDK
2
+
3
+ This package contains the Editor Platform SDK, which is a set of API shapes that allow you to build custom editor apps.
4
+
5
+ ### Installation
6
+
7
+ ```bash
8
+ yarn add @wix/editor
9
+ ```
10
+
11
+ ### Usage with `@wix/sdk`
12
+
13
+ ```js
14
+ import { editor, info, widget } from '@wix/editor';
15
+ import { createClient } from '@wix/sdk';
16
+
17
+ const client = createClient({
18
+ host: editor.host(),
19
+ modules: {
20
+ info,
21
+ widget,
22
+ },
23
+ });
24
+
25
+ // --
26
+ await client.widget.setProp('test', 1)
27
+ console.log(await client.widget.getProp('test'));
28
+
29
+ // --
30
+ console.log({
31
+ languageCode: await client.info.getLanguageCode(),
32
+ viewMode: await client.info.getViewMode(),
33
+ });
34
+ ```
@@ -0,0 +1,508 @@
1
+ 'use strict';
2
+
3
+ var publicEditorPlatformErrors = require('@wix/public-editor-platform-errors');
4
+ var publicEditorPlatformEvents = require('@wix/public-editor-platform-events');
5
+ var editorPlatformTransport = require('@wix/editor-platform-transport');
6
+ var platformFrameApi = require('@wix/editor-application/platform-frame-api');
7
+ var platformWorkerApi = require('@wix/editor-application/platform-worker-api');
8
+
9
+ var EditorPlatformApplicationContextErrorCode = /* @__PURE__ */ ((EditorPlatformApplicationContextErrorCode2) => {
10
+ EditorPlatformApplicationContextErrorCode2["IncorrectEnvironment"] = "IncorrectEnvironment";
11
+ return EditorPlatformApplicationContextErrorCode2;
12
+ })(EditorPlatformApplicationContextErrorCode || {});
13
+ class EditorPlatformApplicationContextError extends publicEditorPlatformErrors.BaseError {
14
+ state = {};
15
+ constructor(message, code) {
16
+ super(message, code, "Editor Platform Application Context Error");
17
+ }
18
+ withUrl(url) {
19
+ this.state = { ...this.state, url };
20
+ return this;
21
+ }
22
+ withAppDefinitionId(appDefinitionId) {
23
+ this.state = { ...this.state, appDefinitionId };
24
+ return this;
25
+ }
26
+ }
27
+ const createEditorPlatformApplicationContextError = publicEditorPlatformErrors.createErrorBuilder(EditorPlatformApplicationContextError);
28
+ async function transformEventPayload(eventPayload, privateAPI) {
29
+ if (!eventPayload?.type) {
30
+ return eventPayload;
31
+ }
32
+ switch (eventPayload.type) {
33
+ case "componentSelectionChanged":
34
+ const componentRefs = eventPayload.componentRefs || [];
35
+ const components = await Promise.all(
36
+ componentRefs.map((ref) => {
37
+ return privateAPI.components.getComponent(ref);
38
+ })
39
+ );
40
+ return {
41
+ type: eventPayload.type,
42
+ components
43
+ };
44
+ default:
45
+ return eventPayload;
46
+ }
47
+ }
48
+ class ApplicationBoundEvents {
49
+ constructor(appDefinitionId, events, privateAPI) {
50
+ this.appDefinitionId = appDefinitionId;
51
+ this.privateAPI = privateAPI;
52
+ this.events = events;
53
+ this.subscribe = events.subscribe.bind(events);
54
+ this.commit = events.commit.bind(events);
55
+ this.startTransaction = events.startTransaction.bind(events);
56
+ this.silent = events.silent.bind(events);
57
+ }
58
+ events;
59
+ subscribe;
60
+ commit;
61
+ startTransaction;
62
+ silent;
63
+ notify(event) {
64
+ this.events.notify({
65
+ type: event.type,
66
+ payload: event.payload,
67
+ meta: {
68
+ appDefinitionId: this.appDefinitionId
69
+ }
70
+ });
71
+ }
72
+ notifyCustomEvent(type, payload) {
73
+ this.notify({
74
+ type: publicEditorPlatformEvents.PlatformAppEvent.CustomEvent,
75
+ payload: {
76
+ ...payload,
77
+ type
78
+ }
79
+ });
80
+ }
81
+ /**
82
+ * TODO: we should use same interface for all events
83
+ * (subscribe vs addEventListener)
84
+ */
85
+ addEventListener(eventType, fn) {
86
+ return this.events.subscribe(async (event) => {
87
+ const isAppMatch = event.meta?.appDefinitionId === this.appDefinitionId || event.meta?.appDefinitionId === null;
88
+ const transformPayload = () => transformEventPayload(event.payload, this.privateAPI);
89
+ if (eventType === "*") {
90
+ fn(await transformPayload());
91
+ } else if (event.type === publicEditorPlatformEvents.PlatformAppEvent.CustomEvent) {
92
+ if (eventType === event.payload?.type && !isAppMatch) {
93
+ fn(await transformPayload());
94
+ }
95
+ } else if (event.type === publicEditorPlatformEvents.PlatformAppEvent.HostEvent) {
96
+ if (eventType === event.payload?.type && isAppMatch) {
97
+ fn(await transformPayload());
98
+ }
99
+ }
100
+ });
101
+ }
102
+ }
103
+ const WAIT_INJECTED_TIMEOUT = 200;
104
+ const WAIT_INJECTED_RETRY_COUNT = 50;
105
+ class ContextInjectionStatus {
106
+ _resolveContextInjected = () => {
107
+ };
108
+ _isInjected = false;
109
+ key;
110
+ constructor(uuid) {
111
+ this.key = `__${uuid}_CONTEXT_INJECTION_STATUS_KEY`;
112
+ if (!globalThis[this.key]) {
113
+ globalThis[this.key] = new Promise((resolve) => {
114
+ this._resolveContextInjected = () => {
115
+ this._isInjected = true;
116
+ resolve();
117
+ };
118
+ });
119
+ }
120
+ }
121
+ isInjected() {
122
+ return !!this._isInjected;
123
+ }
124
+ resolveInjected() {
125
+ this._resolveContextInjected?.();
126
+ }
127
+ waitInjected() {
128
+ return new Promise((resolve, reject) => {
129
+ let injected = false;
130
+ let timeoutId;
131
+ let retryCount = 0;
132
+ const timeout = () => {
133
+ if (injected) {
134
+ return;
135
+ }
136
+ timeoutId = setTimeout(() => {
137
+ retryCount++;
138
+ if (retryCount < WAIT_INJECTED_RETRY_COUNT) {
139
+ if (retryCount % 10 === 0) {
140
+ console.log(
141
+ createEditorPlatformApplicationContextError(
142
+ EditorPlatformApplicationContextErrorCode.IncorrectEnvironment,
143
+ "contexts are not resolved, still re-trying"
144
+ ).withMessage(`try number ${retryCount}`).message
145
+ );
146
+ }
147
+ timeout();
148
+ return;
149
+ }
150
+ if (!injected) {
151
+ const error = createEditorPlatformApplicationContextError(
152
+ EditorPlatformApplicationContextErrorCode.IncorrectEnvironment,
153
+ "contexts are not resolved, threw by timeout"
154
+ );
155
+ reject(error);
156
+ }
157
+ }, WAIT_INJECTED_TIMEOUT);
158
+ };
159
+ timeout();
160
+ const _waitContextInjectedPromise = globalThis[this.key];
161
+ _waitContextInjectedPromise.then(() => {
162
+ injected = true;
163
+ clearTimeout(timeoutId);
164
+ resolve();
165
+ });
166
+ });
167
+ }
168
+ }
169
+ const ENVIRONMENT_CONTEXT_KEY = "__ENVIRONMENT_CONTEXT_KEY";
170
+ var PlatformEnvironment = /* @__PURE__ */ ((PlatformEnvironment2) => {
171
+ PlatformEnvironment2["Worker"] = "Worker";
172
+ PlatformEnvironment2["Frame"] = "Frame";
173
+ return PlatformEnvironment2;
174
+ })(PlatformEnvironment || {});
175
+ class EnvironmentContext {
176
+ constructor(environmentContext) {
177
+ this.environmentContext = environmentContext;
178
+ }
179
+ static status = new ContextInjectionStatus("environment");
180
+ static async inject(context) {
181
+ if (globalThis[ENVIRONMENT_CONTEXT_KEY]) {
182
+ throw createEditorPlatformApplicationContextError(
183
+ EditorPlatformApplicationContextErrorCode.IncorrectEnvironment,
184
+ "Environment context already exists and should not be overridden"
185
+ );
186
+ }
187
+ globalThis[ENVIRONMENT_CONTEXT_KEY] = new EnvironmentContext(context);
188
+ this.status.resolveInjected();
189
+ }
190
+ static async getInstance() {
191
+ await this.status.waitInjected();
192
+ return globalThis[ENVIRONMENT_CONTEXT_KEY];
193
+ }
194
+ getPrivateAPI() {
195
+ return this.environmentContext.privateApi;
196
+ }
197
+ getEvents() {
198
+ return this.environmentContext.events;
199
+ }
200
+ getApplicationAPIs() {
201
+ return this.environmentContext.applicationAPIs ?? {};
202
+ }
203
+ getEnvironment() {
204
+ return this.environmentContext.environment;
205
+ }
206
+ }
207
+ const APPLICATION_CONTEXT_KEY = "__APPLICATION_CONTEXT_KEY";
208
+ class ApplicationContext {
209
+ constructor(applicationContext, environment) {
210
+ this.applicationContext = applicationContext;
211
+ this.environment = environment;
212
+ this.events = new ApplicationBoundEvents(
213
+ this.applicationContext.appDefinitionId,
214
+ this.environment.getEvents(),
215
+ this.environment.getPrivateAPI()
216
+ );
217
+ }
218
+ static status = new ContextInjectionStatus("application");
219
+ /**
220
+ * TODO: use generics for context type
221
+ * - application
222
+ * - editor
223
+ */
224
+ static async inject(context) {
225
+ const environment = await EnvironmentContext.getInstance();
226
+ if (environment.getEnvironment() !== PlatformEnvironment.Frame) {
227
+ throw createEditorPlatformApplicationContextError(
228
+ EditorPlatformApplicationContextErrorCode.IncorrectEnvironment,
229
+ "Application context can be injected only in frame environment"
230
+ );
231
+ }
232
+ if (globalThis[APPLICATION_CONTEXT_KEY]) {
233
+ throw createEditorPlatformApplicationContextError(
234
+ EditorPlatformApplicationContextErrorCode.IncorrectEnvironment,
235
+ "Application context already exists and should not be overridden"
236
+ );
237
+ }
238
+ globalThis[APPLICATION_CONTEXT_KEY] = new ApplicationContext(
239
+ context,
240
+ await EnvironmentContext.getInstance()
241
+ );
242
+ this.status.resolveInjected();
243
+ }
244
+ static async getInstance() {
245
+ const environment = await EnvironmentContext.getInstance();
246
+ if (environment.getEnvironment() === PlatformEnvironment.Frame) {
247
+ await this.status.waitInjected();
248
+ return globalThis[APPLICATION_CONTEXT_KEY];
249
+ } else {
250
+ return __APPLICATION_CONTEXT_KEY;
251
+ }
252
+ }
253
+ events;
254
+ getAppDefinitionId() {
255
+ return this.applicationContext.appDefinitionId;
256
+ }
257
+ getBindings() {
258
+ return this.applicationContext;
259
+ }
260
+ getEvents() {
261
+ return this.events;
262
+ }
263
+ getPrivateAPI() {
264
+ return this.environment.getPrivateAPI();
265
+ }
266
+ getPrivateApplicationAPI() {
267
+ const appDefinitionId = this.getAppDefinitionId();
268
+ if (!appDefinitionId) {
269
+ throw createEditorPlatformApplicationContextError(
270
+ EditorPlatformApplicationContextErrorCode.IncorrectEnvironment,
271
+ "appDefinitionId is not available"
272
+ );
273
+ }
274
+ return this.environment.getApplicationAPIs()[appDefinitionId];
275
+ }
276
+ }
277
+
278
+ class EditorPlatformSDKAuthError extends publicEditorPlatformErrors.BaseError {
279
+ state = {};
280
+ constructor(message, code) {
281
+ super(message, code, "Auth Strategy Error");
282
+ }
283
+ withAppDefinitionId(appDefinitionId) {
284
+ this.state = { ...this.state, appDefinitionId };
285
+ return this;
286
+ }
287
+ }
288
+ const createAuthStrategyShapeError = publicEditorPlatformErrors.createErrorBuilder(EditorPlatformSDKAuthError);
289
+ const auth = () => {
290
+ return {
291
+ getAuthHeaders: async () => {
292
+ const context = await ApplicationContext.getInstance();
293
+ const privateAPI = context.getPrivateAPI();
294
+ const bindings = context.getBindings();
295
+ if (!bindings.appDefinitionId) {
296
+ throw createAuthStrategyShapeError(
297
+ "EmptyAppDefinitionId" /* EmptyAppDefinitionId */
298
+ );
299
+ }
300
+ const authInstance = await privateAPI.info.getAppInstance(
301
+ bindings.appDefinitionId
302
+ );
303
+ if (authInstance === void 0) {
304
+ throw createAuthStrategyShapeError(
305
+ "EmptyAppAuthInstance" /* EmptyAppAuthInstance */
306
+ ).withAppDefinitionId(bindings.appDefinitionId);
307
+ }
308
+ return {
309
+ headers: {
310
+ Authorization: authInstance
311
+ }
312
+ };
313
+ }
314
+ };
315
+ };
316
+
317
+ class PlatformSDKShape {
318
+ constructor(namespace, shape) {
319
+ this.namespace = namespace;
320
+ this.shape = shape;
321
+ }
322
+ static create(namespace, shape) {
323
+ return new PlatformSDKShape(namespace, shape);
324
+ }
325
+ build() {
326
+ return {
327
+ __type: "host",
328
+ create: () => {
329
+ return this.shape;
330
+ }
331
+ };
332
+ }
333
+ }
334
+
335
+ const application = {
336
+ getPrivateAPI: async () => {
337
+ const context = await ApplicationContext.getInstance();
338
+ return context.getPrivateApplicationAPI();
339
+ },
340
+ getPublicAPI: async (appDefinitionId) => {
341
+ const context = await ApplicationContext.getInstance();
342
+ const privateAPI = context.getPrivateAPI();
343
+ return privateAPI.applicationManager.getPublicApplicationAPI(
344
+ appDefinitionId
345
+ );
346
+ },
347
+ getAppInstance: async () => {
348
+ const context = await ApplicationContext.getInstance();
349
+ const privateAPI = context.getPrivateAPI();
350
+ const bindings = context.getBindings();
351
+ return privateAPI.info.getAppInstance(bindings.appDefinitionId);
352
+ }
353
+ };
354
+ var index$5 = PlatformSDKShape.create("application", application).build();
355
+
356
+ const components = {
357
+ async getSelectedComponents() {
358
+ const context = await ApplicationContext.getInstance();
359
+ const privateAPI = context.getPrivateAPI();
360
+ const refs = await privateAPI.components.getSelectedComponents();
361
+ return Promise.all(
362
+ refs.map((ref) => privateAPI.components.getComponent(ref))
363
+ );
364
+ }
365
+ };
366
+ var index$4 = PlatformSDKShape.create("components", components).build();
367
+
368
+ const events = {
369
+ addEventListener: async (name, cb) => {
370
+ const context = await ApplicationContext.getInstance();
371
+ return context.getEvents().addEventListener(name, cb);
372
+ }
373
+ };
374
+ var index$3 = PlatformSDKShape.create("events", events).build();
375
+
376
+ const info = {
377
+ async getViewMode() {
378
+ const context = await ApplicationContext.getInstance();
379
+ const privateAPI = context.getPrivateAPI();
380
+ return privateAPI.info.getViewMode();
381
+ },
382
+ async getLanguageCode() {
383
+ const context = await ApplicationContext.getInstance();
384
+ const privateAPI = context.getPrivateAPI();
385
+ return privateAPI.info.getLanguageCode();
386
+ }
387
+ };
388
+ var index$2 = PlatformSDKShape.create("info", info).build();
389
+
390
+ var WidgetShapeErrorCode = /* @__PURE__ */ ((WidgetShapeErrorCode2) => {
391
+ WidgetShapeErrorCode2["UndefinedCompRef"] = "UndefinedCompRef";
392
+ return WidgetShapeErrorCode2;
393
+ })(WidgetShapeErrorCode || {});
394
+ class WidgetShapeError extends publicEditorPlatformErrors.BaseError {
395
+ constructor(message, code) {
396
+ super(message, code, "Widget Error");
397
+ }
398
+ }
399
+ const createWidgetShapeError = publicEditorPlatformErrors.createErrorBuilder(WidgetShapeError);
400
+
401
+ const getSelectedComponentRef = async () => {
402
+ const selected = await components.getSelectedComponents();
403
+ const compRef = selected[0]?.compRef;
404
+ if (!compRef) {
405
+ throw createWidgetShapeError(WidgetShapeErrorCode.UndefinedCompRef);
406
+ }
407
+ return compRef;
408
+ };
409
+ const widget = {
410
+ // async getAttributes(): Promise<Record<string, string>> {
411
+ // const context = await ApplicationContext.getInstance();
412
+ // const privateAPI = context.getPrivateAPI();
413
+ // const compRef = await getSelectedComponentRef();
414
+ //
415
+ // return privateAPI.customElement.getAttributes(compRef);
416
+ // },
417
+ async getProp(propName) {
418
+ const context = await ApplicationContext.getInstance();
419
+ const privateAPI = context.getPrivateAPI();
420
+ const compRef = await getSelectedComponentRef();
421
+ return privateAPI.customElement.getAttribute(compRef, propName);
422
+ },
423
+ async setProp(propName, value) {
424
+ const context = await ApplicationContext.getInstance();
425
+ const privateAPI = context.getPrivateAPI();
426
+ const compRef = await getSelectedComponentRef();
427
+ await privateAPI.customElement.setAttribute(compRef, propName, value);
428
+ }
429
+ };
430
+ var index$1 = PlatformSDKShape.create("widget", widget).build();
431
+
432
+ const inputs = {
433
+ // TODO: duplicated types
434
+ async selectMedia(options) {
435
+ const context = await ApplicationContext.getInstance();
436
+ const privateAPI = context.getPrivateAPI();
437
+ return privateAPI.inputs.openMediaPanel(options);
438
+ },
439
+ // TODO: duplicated types
440
+ async selectLink(options) {
441
+ const context = await ApplicationContext.getInstance();
442
+ const privateAPI = context.getPrivateAPI();
443
+ return await privateAPI.inputs.openLinkPanel(
444
+ options
445
+ );
446
+ },
447
+ // TODO: duplicated types
448
+ async selectColor(options, onColorChange) {
449
+ const context = await ApplicationContext.getInstance();
450
+ const privateAPI = context.getPrivateAPI();
451
+ void privateAPI.inputs.openColorPicker(options, onColorChange);
452
+ },
453
+ // TODO: duplicated types
454
+ async selectFont(options, onFontChange) {
455
+ const context = await ApplicationContext.getInstance();
456
+ const privateAPI = context.getPrivateAPI();
457
+ void privateAPI.inputs.openFontPicker(options, onFontChange);
458
+ }
459
+ };
460
+ var index = PlatformSDKShape.create("inputs", inputs).build();
461
+
462
+ const editorPlatformFrameHost = () => {
463
+ const channel = new editorPlatformTransport.IFrameConsumerChannel();
464
+ channel.expose(new platformFrameApi.PlatformFrameAPI());
465
+ return {
466
+ environment: {},
467
+ channel: {
468
+ observeState: async () => {
469
+ return { disconnect() {
470
+ } };
471
+ }
472
+ }
473
+ };
474
+ };
475
+
476
+ const editorPlatformWorkerHost = () => {
477
+ const channel = new editorPlatformTransport.WorkerConsumerChannel();
478
+ channel.expose(new platformWorkerApi.PlatformWorkerAPI());
479
+ return {
480
+ environment: {},
481
+ channel: {
482
+ observeState: async () => {
483
+ return { disconnect() {
484
+ } };
485
+ }
486
+ }
487
+ };
488
+ };
489
+
490
+ const editor = {
491
+ host: () => {
492
+ const isWorker = typeof importScripts === "function";
493
+ if (isWorker) {
494
+ return editorPlatformWorkerHost();
495
+ }
496
+ return editorPlatformFrameHost();
497
+ },
498
+ auth
499
+ };
500
+
501
+ exports.application = index$5;
502
+ exports.components = index$4;
503
+ exports.editor = editor;
504
+ exports.events = index$3;
505
+ exports.info = index$2;
506
+ exports.inputs = index;
507
+ exports.widget = index$1;
508
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sources":["../../../editor-platform-application-context/dist/esm/index.js","../../src/auth.ts","../../src/PlatformSDKShape.ts","../../src/application/index.ts","../../src/components/index.ts","../../src/events/index.ts","../../src/info/index.ts","../../src/widget/errors.ts","../../src/widget/index.ts","../../src/inputs/index.ts","../../src/editorPlatformFrameHost.ts","../../src/editorPlatformWorkerHost.ts","../../src/index.ts"],"sourcesContent":["import { createErrorBuilder, BaseError } from '@wix/public-editor-platform-errors';\nimport { PlatformAppEvent } from '@wix/public-editor-platform-events';\n\nvar EditorPlatformApplicationContextErrorCode = /* @__PURE__ */ ((EditorPlatformApplicationContextErrorCode2) => {\n EditorPlatformApplicationContextErrorCode2[\"IncorrectEnvironment\"] = \"IncorrectEnvironment\";\n return EditorPlatformApplicationContextErrorCode2;\n})(EditorPlatformApplicationContextErrorCode || {});\nclass EditorPlatformApplicationContextError extends BaseError {\n state = {};\n constructor(message, code) {\n super(message, code, \"Editor Platform Application Context Error\");\n }\n withUrl(url) {\n this.state = { ...this.state, url };\n return this;\n }\n withAppDefinitionId(appDefinitionId) {\n this.state = { ...this.state, appDefinitionId };\n return this;\n }\n}\nconst createEditorPlatformApplicationContextError = createErrorBuilder(EditorPlatformApplicationContextError);\n\nasync function transformEventPayload(eventPayload, privateAPI) {\n if (!eventPayload?.type) {\n return eventPayload;\n }\n switch (eventPayload.type) {\n case \"componentSelectionChanged\":\n const componentRefs = eventPayload.componentRefs || [];\n const components = await Promise.all(\n componentRefs.map((ref) => {\n return privateAPI.components.getComponent(ref);\n })\n );\n return {\n type: eventPayload.type,\n components\n };\n default:\n return eventPayload;\n }\n}\n\nclass ApplicationBoundEvents {\n constructor(appDefinitionId, events, privateAPI) {\n this.appDefinitionId = appDefinitionId;\n this.privateAPI = privateAPI;\n this.events = events;\n this.subscribe = events.subscribe.bind(events);\n this.commit = events.commit.bind(events);\n this.startTransaction = events.startTransaction.bind(events);\n this.silent = events.silent.bind(events);\n }\n events;\n subscribe;\n commit;\n startTransaction;\n silent;\n notify(event) {\n this.events.notify({\n type: event.type,\n payload: event.payload,\n meta: {\n appDefinitionId: this.appDefinitionId\n }\n });\n }\n notifyCustomEvent(type, payload) {\n this.notify({\n type: PlatformAppEvent.CustomEvent,\n payload: {\n ...payload,\n type\n }\n });\n }\n /**\n * TODO: we should use same interface for all events\n * (subscribe vs addEventListener)\n */\n addEventListener(eventType, fn) {\n return this.events.subscribe(async (event) => {\n const isAppMatch = event.meta?.appDefinitionId === this.appDefinitionId || event.meta?.appDefinitionId === null;\n const transformPayload = () => transformEventPayload(event.payload, this.privateAPI);\n if (eventType === \"*\") {\n fn(await transformPayload());\n } else if (event.type === PlatformAppEvent.CustomEvent) {\n if (eventType === event.payload?.type && !isAppMatch) {\n fn(await transformPayload());\n }\n } else if (event.type === PlatformAppEvent.HostEvent) {\n if (eventType === event.payload?.type && isAppMatch) {\n fn(await transformPayload());\n }\n }\n });\n }\n}\n\nconst WAIT_INJECTED_TIMEOUT = 200;\nconst WAIT_INJECTED_RETRY_COUNT = 50;\nclass ContextInjectionStatus {\n _resolveContextInjected = () => {\n };\n _isInjected = false;\n key;\n constructor(uuid) {\n this.key = `__${uuid}_CONTEXT_INJECTION_STATUS_KEY`;\n if (!globalThis[this.key]) {\n globalThis[this.key] = new Promise((resolve) => {\n this._resolveContextInjected = () => {\n this._isInjected = true;\n resolve();\n };\n });\n }\n }\n isInjected() {\n return !!this._isInjected;\n }\n resolveInjected() {\n this._resolveContextInjected?.();\n }\n waitInjected() {\n return new Promise((resolve, reject) => {\n let injected = false;\n let timeoutId;\n let retryCount = 0;\n const timeout = () => {\n if (injected) {\n return;\n }\n timeoutId = setTimeout(() => {\n retryCount++;\n if (retryCount < WAIT_INJECTED_RETRY_COUNT) {\n if (retryCount % 10 === 0) {\n console.log(\n createEditorPlatformApplicationContextError(\n EditorPlatformApplicationContextErrorCode.IncorrectEnvironment,\n \"contexts are not resolved, still re-trying\"\n ).withMessage(`try number ${retryCount}`).message\n );\n }\n timeout();\n return;\n }\n if (!injected) {\n const error = createEditorPlatformApplicationContextError(\n EditorPlatformApplicationContextErrorCode.IncorrectEnvironment,\n \"contexts are not resolved, threw by timeout\"\n );\n reject(error);\n }\n }, WAIT_INJECTED_TIMEOUT);\n };\n timeout();\n const _waitContextInjectedPromise = globalThis[this.key];\n _waitContextInjectedPromise.then(() => {\n injected = true;\n clearTimeout(timeoutId);\n resolve();\n });\n });\n }\n}\n\nconst ENVIRONMENT_CONTEXT_KEY = \"__ENVIRONMENT_CONTEXT_KEY\";\nvar PlatformEnvironment = /* @__PURE__ */ ((PlatformEnvironment2) => {\n PlatformEnvironment2[\"Worker\"] = \"Worker\";\n PlatformEnvironment2[\"Frame\"] = \"Frame\";\n return PlatformEnvironment2;\n})(PlatformEnvironment || {});\nclass EnvironmentContext {\n constructor(environmentContext) {\n this.environmentContext = environmentContext;\n }\n static status = new ContextInjectionStatus(\"environment\");\n static async inject(context) {\n if (globalThis[ENVIRONMENT_CONTEXT_KEY]) {\n throw createEditorPlatformApplicationContextError(\n EditorPlatformApplicationContextErrorCode.IncorrectEnvironment,\n \"Environment context already exists and should not be overridden\"\n );\n }\n globalThis[ENVIRONMENT_CONTEXT_KEY] = new EnvironmentContext(context);\n this.status.resolveInjected();\n }\n static async getInstance() {\n await this.status.waitInjected();\n return globalThis[ENVIRONMENT_CONTEXT_KEY];\n }\n getPrivateAPI() {\n return this.environmentContext.privateApi;\n }\n getEvents() {\n return this.environmentContext.events;\n }\n getApplicationAPIs() {\n return this.environmentContext.applicationAPIs ?? {};\n }\n getEnvironment() {\n return this.environmentContext.environment;\n }\n}\n\nconst APPLICATION_CONTEXT_KEY = \"__APPLICATION_CONTEXT_KEY\";\nclass ApplicationContext {\n constructor(applicationContext, environment) {\n this.applicationContext = applicationContext;\n this.environment = environment;\n this.events = new ApplicationBoundEvents(\n this.applicationContext.appDefinitionId,\n this.environment.getEvents(),\n this.environment.getPrivateAPI()\n );\n }\n static status = new ContextInjectionStatus(\"application\");\n /**\n * TODO: use generics for context type\n * - application\n * - editor\n */\n static async inject(context) {\n const environment = await EnvironmentContext.getInstance();\n if (environment.getEnvironment() !== PlatformEnvironment.Frame) {\n throw createEditorPlatformApplicationContextError(\n EditorPlatformApplicationContextErrorCode.IncorrectEnvironment,\n \"Application context can be injected only in frame environment\"\n );\n }\n if (globalThis[APPLICATION_CONTEXT_KEY]) {\n throw createEditorPlatformApplicationContextError(\n EditorPlatformApplicationContextErrorCode.IncorrectEnvironment,\n \"Application context already exists and should not be overridden\"\n );\n }\n globalThis[APPLICATION_CONTEXT_KEY] = new ApplicationContext(\n context,\n await EnvironmentContext.getInstance()\n );\n this.status.resolveInjected();\n }\n static async getInstance() {\n const environment = await EnvironmentContext.getInstance();\n if (environment.getEnvironment() === PlatformEnvironment.Frame) {\n await this.status.waitInjected();\n return globalThis[APPLICATION_CONTEXT_KEY];\n } else {\n return __APPLICATION_CONTEXT_KEY;\n }\n }\n events;\n getAppDefinitionId() {\n return this.applicationContext.appDefinitionId;\n }\n getBindings() {\n return this.applicationContext;\n }\n getEvents() {\n return this.events;\n }\n getPrivateAPI() {\n return this.environment.getPrivateAPI();\n }\n getPrivateApplicationAPI() {\n const appDefinitionId = this.getAppDefinitionId();\n if (!appDefinitionId) {\n throw createEditorPlatformApplicationContextError(\n EditorPlatformApplicationContextErrorCode.IncorrectEnvironment,\n \"appDefinitionId is not available\"\n );\n }\n return this.environment.getApplicationAPIs()[appDefinitionId];\n }\n}\n\nexport { APPLICATION_CONTEXT_KEY, ApplicationBoundEvents, ApplicationContext, ENVIRONMENT_CONTEXT_KEY, EnvironmentContext, PlatformEnvironment };\n//# sourceMappingURL=index.js.map\n","import { ApplicationContext } from '@wix/editor-application-context';\nimport {\n BaseError,\n createErrorBuilder,\n} from '@wix/public-editor-platform-errors';\n\nexport enum EditorPlatformSDKAuthErrorCode {\n EmptyAppAuthInstance = 'EmptyAppAuthInstance',\n EmptyAppDefinitionId = 'EmptyAppDefinitionId',\n}\n\nclass EditorPlatformSDKAuthError extends BaseError<EditorPlatformSDKAuthErrorCode> {\n state: Partial<{\n appDefinitionId: string;\n }> = {};\n\n constructor(message: string, code: EditorPlatformSDKAuthErrorCode) {\n super(message, code, 'Auth Strategy Error');\n }\n\n withAppDefinitionId(appDefinitionId: string) {\n this.state = { ...this.state, appDefinitionId };\n return this;\n }\n}\n\nexport const createAuthStrategyShapeError = createErrorBuilder<\n EditorPlatformSDKAuthErrorCode,\n EditorPlatformSDKAuthError\n>(EditorPlatformSDKAuthError);\n\nexport const auth = () => {\n return {\n getAuthHeaders: async () => {\n const context = await ApplicationContext.getInstance();\n const privateAPI = context.getPrivateAPI();\n const bindings = context.getBindings();\n\n if (!bindings.appDefinitionId) {\n throw createAuthStrategyShapeError(\n EditorPlatformSDKAuthErrorCode.EmptyAppDefinitionId,\n );\n }\n\n const authInstance = await privateAPI.info.getAppInstance(\n bindings.appDefinitionId,\n );\n\n if (authInstance === undefined) {\n throw createAuthStrategyShapeError(\n EditorPlatformSDKAuthErrorCode.EmptyAppAuthInstance,\n ).withAppDefinitionId(bindings.appDefinitionId);\n }\n\n return {\n headers: {\n Authorization: authInstance,\n },\n };\n },\n };\n};\n","export class PlatformSDKShape<TShape extends Record<string, any>> {\n static create<TShape extends Record<string, any>>(\n namespace: string,\n shape: TShape,\n ) {\n return new PlatformSDKShape<TShape>(namespace, shape);\n }\n\n constructor(\n public namespace: string,\n private shape: TShape,\n ) {\n // Object.assign(this.shape, {\n // [Symbol(`platform-sdk-shape-namespace`)]: this.namespace,\n // });\n }\n\n build() {\n return {\n __type: 'host' as const,\n create: () => {\n return this.shape;\n },\n };\n }\n}\n","import { ApplicationContext } from '@wix/editor-application-context';\nimport { PlatformSDKShape } from '../PlatformSDKShape';\n\nexport const application = {\n getPrivateAPI: async <TApplicationPrivateAPI = any>() => {\n const context = await ApplicationContext.getInstance();\n return context.getPrivateApplicationAPI() as TApplicationPrivateAPI;\n },\n getPublicAPI: async <TApplicationPrivateAPI = any>(\n appDefinitionId: string,\n ) => {\n const context = await ApplicationContext.getInstance();\n const privateAPI = context.getPrivateAPI();\n\n return privateAPI.applicationManager.getPublicApplicationAPI(\n appDefinitionId,\n ) as TApplicationPrivateAPI;\n },\n getAppInstance: async () => {\n const context = await ApplicationContext.getInstance();\n const privateAPI = context.getPrivateAPI();\n const bindings = context.getBindings();\n\n return privateAPI.info.getAppInstance(bindings.appDefinitionId);\n },\n};\n\nexport default PlatformSDKShape.create('application', application).build();\n","import {\n ApplicationContext,\n IComponent,\n} from '@wix/editor-application-context';\nimport { PlatformSDKShape } from '../PlatformSDKShape';\n\nexport const components = {\n async getSelectedComponents(): Promise<IComponent[]> {\n const context = await ApplicationContext.getInstance();\n const privateAPI = context.getPrivateAPI();\n const refs = await privateAPI.components.getSelectedComponents();\n\n return Promise.all(\n refs.map((ref: any) => privateAPI.components.getComponent(ref)),\n );\n },\n};\n\nexport default PlatformSDKShape.create('components', components).build();\n","import {\n ApplicationContext,\n AppEventPayload,\n AllowedEvents,\n} from '@wix/editor-application-context';\nimport { PlatformSDKShape } from '../PlatformSDKShape';\n\nexport const events = {\n addEventListener: async (\n name: any,\n // TODO: fix types\n cb: (payload: AppEventPayload<AllowedEvents>) => void,\n ) => {\n const context = await ApplicationContext.getInstance();\n return context.getEvents().addEventListener(name, cb);\n },\n};\n\nexport default PlatformSDKShape.create('events', events).build();\n","import { ApplicationContext } from '@wix/editor-application-context';\nimport { PlatformSDKShape } from '../PlatformSDKShape';\n\nexport const info = {\n async getViewMode() {\n const context = await ApplicationContext.getInstance();\n const privateAPI = context.getPrivateAPI();\n return privateAPI.info.getViewMode();\n },\n\n async getLanguageCode() {\n const context = await ApplicationContext.getInstance();\n const privateAPI = context.getPrivateAPI();\n return privateAPI.info.getLanguageCode();\n },\n};\n\nexport default PlatformSDKShape.create('info', info).build();\n","import {\n BaseError,\n createErrorBuilder,\n} from '@wix/public-editor-platform-errors';\n\nexport enum WidgetShapeErrorCode {\n UndefinedCompRef = 'UndefinedCompRef',\n}\n\nclass WidgetShapeError extends BaseError<WidgetShapeErrorCode> {\n constructor(message: string, code: WidgetShapeErrorCode) {\n super(message, code, 'Widget Error');\n }\n}\n\nexport const createWidgetShapeError = createErrorBuilder<\n WidgetShapeErrorCode,\n WidgetShapeError\n>(WidgetShapeError);\n","import { ApplicationContext } from '@wix/editor-application-context';\nimport { components } from '../components';\nimport { createWidgetShapeError, WidgetShapeErrorCode } from './errors';\nimport { PlatformSDKShape } from '../PlatformSDKShape';\n\nconst getSelectedComponentRef = async () => {\n const selected = await components.getSelectedComponents();\n const compRef = selected[0]?.compRef;\n\n if (!compRef) {\n throw createWidgetShapeError(WidgetShapeErrorCode.UndefinedCompRef);\n }\n\n return compRef;\n};\n\nexport const widget = {\n // async getAttributes(): Promise<Record<string, string>> {\n // const context = await ApplicationContext.getInstance();\n // const privateAPI = context.getPrivateAPI();\n // const compRef = await getSelectedComponentRef();\n //\n // return privateAPI.customElement.getAttributes(compRef);\n // },\n async getProp(propName: string): Promise<string> {\n const context = await ApplicationContext.getInstance();\n const privateAPI = context.getPrivateAPI();\n const compRef = await getSelectedComponentRef();\n\n return privateAPI.customElement.getAttribute(compRef, propName);\n },\n async setProp(propName: string, value: string): Promise<void> {\n const context = await ApplicationContext.getInstance();\n const privateAPI = context.getPrivateAPI();\n const compRef = await getSelectedComponentRef();\n\n await privateAPI.customElement.setAttribute(compRef, propName, value);\n },\n};\n\nexport default PlatformSDKShape.create('widget', widget).build();\n","import { ApplicationContext } from '@wix/editor-application-context';\nimport { PlatformSDKShape } from '../PlatformSDKShape';\n\nexport const inputs = {\n // TODO: duplicated types\n async selectMedia(options: {\n mediaType: 'IMAGE' | 'VIDEO' | 'DOCUMENT';\n isMultiSelect?: boolean;\n }): Promise<any> {\n const context = await ApplicationContext.getInstance();\n const privateAPI = context.getPrivateAPI() as any;\n\n return privateAPI.inputs.openMediaPanel(options);\n },\n // TODO: duplicated types\n async selectLink<TResponse = object>(options: {\n value?: object;\n showLinkTargetSection?: boolean;\n }): Promise<TResponse> {\n const context = await ApplicationContext.getInstance();\n const privateAPI = context.getPrivateAPI() as any;\n\n return (await privateAPI.inputs.openLinkPanel(\n options,\n )) as Promise<TResponse>;\n },\n // TODO: duplicated types\n async selectColor(\n options: {\n color?: string;\n position?: {\n x: number;\n y: number;\n };\n },\n onColorChange: (value: {\n color: string;\n theme: string;\n isHover: boolean;\n }) => void,\n ) {\n const context = await ApplicationContext.getInstance();\n const privateAPI = context.getPrivateAPI() as any;\n\n void privateAPI.inputs.openColorPicker(options, onColorChange);\n },\n // TODO: duplicated types\n async selectFont(\n options: {\n position?: {\n x: number;\n y: number;\n };\n title?: string;\n panelSectionsDefinition?: Partial<{\n theme: 'hidden' | 'enabled';\n font: 'hidden' | 'enabled';\n size: 'hidden' | 'enabled';\n style: 'hidden' | 'enabled';\n htmlTag: 'hidden' | 'enabled';\n }>;\n fontMaxSize?: number;\n fontMinSize?: number;\n componentStyle?: {\n family: string;\n style: {\n bold: boolean;\n italic: boolean;\n underline: boolean;\n };\n size: number;\n preset: string;\n editorKey: string;\n\n htmlTag?: string;\n };\n },\n onFontChange: (\n value: [string, string | number | boolean, string] | [string, string],\n ) => void,\n ) {\n const context = await ApplicationContext.getInstance();\n const privateAPI = context.getPrivateAPI() as any;\n\n void privateAPI.inputs.openFontPicker(options, onFontChange);\n },\n};\n\nexport default PlatformSDKShape.create('inputs', inputs).build();\n","import { IFrameConsumerChannel } from '@wix/editor-platform-transport';\nimport { PlatformFrameAPI } from '@wix/editor-application/platform-frame-api';\nimport type { WixSDKTypes } from '@wix/public-editor-platform-interfaces';\n\n/**\n * TODO: expose channel from the host so all platform related modules\n * might get rid from the global Application and Environment contexts\n */\nexport const editorPlatformFrameHost = (): WixSDKTypes.Host => {\n const channel = new IFrameConsumerChannel();\n channel.expose(new PlatformFrameAPI());\n\n return {\n environment: {},\n channel: {\n observeState: async () => {\n return { disconnect() {} };\n },\n },\n };\n};\n","import { WorkerConsumerChannel } from '@wix/editor-platform-transport';\nimport { PlatformWorkerAPI } from '@wix/editor-application/platform-worker-api';\nimport type { WixSDKTypes } from '@wix/public-editor-platform-interfaces';\n\n/**\n * TODO: expose channel from the host so all platform related modules\n * might get rid from the global Application and Environment contexts\n */\nexport const editorPlatformWorkerHost = (): WixSDKTypes.Host => {\n const channel = new WorkerConsumerChannel();\n channel.expose(new PlatformWorkerAPI());\n\n return {\n environment: {},\n channel: {\n observeState: async () => {\n return { disconnect() {} };\n },\n },\n };\n};\n","import { auth } from './auth';\n\nexport { default as application } from './application';\nexport { default as components } from './components';\nexport { default as events } from './events';\nexport { default as info } from './info';\nexport { default as widget } from './widget';\nexport { default as inputs } from './inputs';\n\nimport { editorPlatformFrameHost } from './editorPlatformFrameHost';\nimport { editorPlatformWorkerHost } from './editorPlatformWorkerHost';\n\nexport const editor = {\n host: () => {\n const isWorker = typeof importScripts === 'function';\n\n if (isWorker) {\n return editorPlatformWorkerHost();\n }\n\n return editorPlatformFrameHost();\n },\n auth,\n};\n"],"names":["BaseError","createErrorBuilder","PlatformAppEvent","WidgetShapeErr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