@emailmaker/extensions-react 1.0.111-dev.5 → 1.0.111-dev.7

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 CHANGED
@@ -192,8 +192,8 @@ module.exports = {
192
192
 
193
193
  Нужна только для продвинутой интеграции или собственного бандлерного пайплайна. Основной сценарий для внешнего плагина — отдельный пакет с `PluginDev`.
194
194
 
195
- - `resolve.alias`: `react` → `@emailmaker/emailmaker/runtime/react` (и т.д.) для `esm` / dev; локальные shared internals идут через compat facades runtime
196
- - `externals`: `@emailmaker/emailmaker/runtime/core`, runtime npm-модули и `@emailmaker/ui-kit`
195
+ - `resolve.alias`: `react` → `@emailmaker/emailmaker/runtime/react` (и т.д.) для `esm` / dev; локальные shared internals идут через compat facades runtime; UI-kit (`@emailmaker/ui-kit`) → **`@emailmaker/emailmaker/ui-kit`** (singleton bytes на main, не `runtime/@scope/ui-kit`)
196
+ - `externals`: `@emailmaker/emailmaker/runtime/core`, runtime npm-модули; ui-kit external → **`@emailmaker/emailmaker/ui-kit`** (глобальный ключ `UiKit` в `runtimeExports`, см. манифест)
197
197
  - Список модулей: `@emailmaker/emailmaker/runtime/plugin-dev-manifest.json` → `runtimeModules`
198
198
 
199
199
  Если release bundle неожиданно стал толстым или target `встраиваемый bundle` не загружается, начните с раздела `Troubleshooting`.
@@ -504,6 +504,21 @@ panel.showSettingsPanel({
504
504
  });
505
505
  ```
506
506
 
507
+ #### `instanceKey` (идентификатор экземпляра панели)
508
+
509
+ По умолчанию **каждый** вызов `showSettingsPanel` получает новый `instanceKey`, и хост **перемонтирует** React-компонент панели. Это нужно при переключении между несколькими экземплярами одного блока в письме (две карточки товара с одним `ComponentId`).
510
+
511
+ Передайте стабильный `instanceKey` только если нужно **обновлять props без remount** и сохранять внутреннее состояние панели (скролл, фокус, черновик формы):
512
+
513
+ ```ts
514
+ panel.showSettingsPanel({
515
+ instanceKey: blockUuid,
516
+ content: { type: 'SettingsPanelId', props: { blockUuid, settings } },
517
+ });
518
+ ```
519
+
520
+ Не вызывайте `closeSettingsPanel` перед `showSettingsPanel` при переключении между экземплярами — достаточно одного `showSettingsPanel` с новыми `props`.
521
+
507
522
  Примерная последовательность процесса взаимодействия sandbox и app:
508
523
  1. Обработчик клика в sandbox
509
524
  2. Отправка события в app через MessageService
@@ -725,6 +740,10 @@ settingsPanel.showSettingsPanel({
725
740
 
726
741
  ## 🎨 UI Kit
727
742
 
743
+ ### ColorPicker — минимальный пример
744
+
745
+ Растягивается на ширину родителя (Form.Item, колонку и т.д.) — дополнительный inline-style для ширины не нужен.
746
+
728
747
  ```tsx
729
748
  import { EmIcons, ColorPicker } from "@emailmaker/ui-kit";
730
749
 
@@ -734,6 +753,18 @@ import { EmIcons, ColorPicker } from "@emailmaker/ui-kit";
734
753
  />
735
754
  ```
736
755
 
756
+ ### FormColorField — рекомендуется для settings panel
757
+
758
+ Микролейбл + `Form.Item` + color picker — тот же паттерн, что в панелях редактора. Используйте внутри `Form` с полем `name`.
759
+
760
+ ```tsx
761
+ import { Form, FormColorField } from "@emailmaker/ui-kit";
762
+
763
+ <Form layout="vertical">
764
+ <FormColorField name="bgColor" label="Цвет фона" />
765
+ </Form>
766
+ ```
767
+
737
768
 
738
769
  ---
739
770
 
package/externals.json CHANGED
@@ -39,10 +39,6 @@
39
39
  "promise __emailmaker__.modules",
40
40
  "AntDesignCssinjs"
41
41
  ],
42
- "@ant-design/pro-layout": [
43
- "promise __emailmaker__.modules",
44
- "AntDesignProLayout"
45
- ],
46
42
  "classnames": [
47
43
  "promise __emailmaker__.modules",
48
44
  "Classnames"
@@ -55,6 +51,10 @@
55
51
  "promise __emailmaker__.modules",
56
52
  "Uuid"
57
53
  ],
54
+ "@emailmaker/ui-kit": [
55
+ "promise __emailmaker__.modules",
56
+ "UiKit"
57
+ ],
58
58
  "@emailmaker/emailmaker/runtime/core": [
59
59
  "promise __emailmaker__.modules",
60
60
  "Core"
@@ -78,21 +78,5 @@
78
78
  "@emailmaker/emailmaker/runtime-core": [
79
79
  "promise __emailmaker__.modules",
80
80
  "Core"
81
- ],
82
- "di": [
83
- "promise __emailmaker__.modules",
84
- "Core"
85
- ],
86
- "disposable": [
87
- "promise __emailmaker__.modules",
88
- "Core"
89
- ],
90
- "guid": [
91
- "promise __emailmaker__.modules",
92
- "Core"
93
- ],
94
- "errors-runtime": [
95
- "promise __emailmaker__.modules",
96
- "Core"
97
81
  ]
98
82
  }
package/index.js CHANGED
@@ -1,25 +1,382 @@
1
1
  import { Component as e, Fragment as t, createElement as n, createRef as r, isValidElement as i } from "react";
2
- import { createComponentIdentifier as a } from "@emailmaker/extensions-app";
3
- //#region \0rolldown/runtime.js
4
- var o = Object.defineProperty, s = Object.getOwnPropertyDescriptor, c = Object.getOwnPropertyNames, l = Object.prototype.hasOwnProperty, u = (e, t) => {
5
- let n = {};
6
- for (var r in e) o(n, r, {
7
- get: e[r],
8
- enumerable: !0
9
- });
10
- return t || o(n, Symbol.toStringTag, { value: "Module" }), n;
11
- }, d = (e, t, n, r) => {
12
- if (t && typeof t == "object" || typeof t == "function") for (var i = c(t), a = 0, u = i.length, d; a < u; a++) d = i[a], !l.call(e, d) && d !== n && o(e, d, {
13
- get: ((e) => t[e]).bind(null, d),
14
- enumerable: !(r = s(t, d)) || r.enumerable
2
+ //#region packages/runtime-core/disposable/index.ts
3
+ var a = class e {
4
+ _isDisposed = !1;
5
+ constructor(e = []) {
6
+ this._inner = e;
7
+ }
8
+ addDisposable(t) {
9
+ return this._inner.push(t), t instanceof e && t.addDispose(() => {
10
+ this.removeDisposable(t);
11
+ }), t;
12
+ }
13
+ addDispose(e) {
14
+ this.addDisposable({ dispose: e });
15
+ }
16
+ removeDisposable(e) {
17
+ let t = this._inner.indexOf(e);
18
+ t >= 0 && this._inner.splice(t, 1);
19
+ }
20
+ isDisposed() {
21
+ return this._isDisposed;
22
+ }
23
+ dispose() {
24
+ if (!this._isDisposed) {
25
+ this._isDisposed = !0;
26
+ for (let e of [...this._inner]) e.dispose();
27
+ }
28
+ }
29
+ };
30
+ //#endregion
31
+ //#region packages/runtime-core/di/container.ts
32
+ function o(e) {
33
+ return `service_container_${e}`;
34
+ }
35
+ var s = class e extends a {
36
+ _injectCallbacks = [];
37
+ _injections = Object.create(null);
38
+ _runCallbacks(e) {
39
+ this._injectCallbacks.forEach((t) => t(e));
40
+ }
41
+ constructor(e = null) {
42
+ super(), this._parent = e, e && this.addDisposable(e.onInject((e) => this._runCallbacks(e)));
43
+ }
44
+ onInject = (e) => (this._injectCallbacks.push(e), { dispose: () => {
45
+ let t = this._injectCallbacks.indexOf(e);
46
+ t >= 0 && this._injectCallbacks.splice(t, 1);
47
+ } });
48
+ inject(e, t) {
49
+ this._injections[e] = () => t, this._runCallbacks(e);
50
+ }
51
+ injectFactory(e, t, n) {
52
+ let r = this._injections[e], i = typeof r == "function" ? r() : r, a = this._injections[e] = () => (i = t(this, i), i);
53
+ n && a(), this._runCallbacks(e);
54
+ }
55
+ _find(e, t = !0) {
56
+ return this._injections[e] || t && this._parent?._find(e);
57
+ }
58
+ _onInject(e, t, n = new a()) {
59
+ return n.addDisposable(this.onInject((r) => {
60
+ e === r && (n.dispose(), t(this.getInstance(r)));
61
+ })), this._parent && n.addDisposable(this._parent._onInject(e, t, n)), this.addDisposable(n), n;
62
+ }
63
+ getInstance(e, t = !0) {
64
+ let n = this._find(e, t);
65
+ if (typeof n == "function") return n();
66
+ }
67
+ getOrCreateInstance(e, t) {
68
+ let n = this._find(e);
69
+ if (typeof n == "function") return n();
70
+ let r = t(this);
71
+ return this.inject(e, r), r;
72
+ }
73
+ getInstanceAsync(e) {
74
+ let t = this._find(e);
75
+ return typeof t == "function" ? Promise.resolve(t()) : new Promise((t) => this._onInject(e, () => t(this.getInstance(e))));
76
+ }
77
+ addService(e, t) {
78
+ let n = o(e);
79
+ this.injectFactory(n, (e, n = []) => n.indexOf(t) < 0 ? [...n, t] : n);
80
+ let r = new a();
81
+ return r.addDispose(() => {
82
+ this.injectFactory(n, (e, n = []) => n.filter((e) => e !== t));
83
+ }), r;
84
+ }
85
+ addServiceFactory(e, t, n) {
86
+ let r = o(e), i;
87
+ this.injectFactory(r, (e, n = []) => (i = t(e, i), i === void 0 ? n : n.indexOf(i) < 0 ? [...n, i] : n), n);
88
+ let s = new a();
89
+ return s.addDispose(() => {
90
+ this.injectFactory(r, (e, t = []) => i === void 0 ? t : t.filter((e) => e !== i));
91
+ }), s;
92
+ }
93
+ getServices(e) {
94
+ let t = o(e);
95
+ return [...this.getInstance(t, !1) || [], ...this._parent?.getServices(e) || []];
96
+ }
97
+ createChild() {
98
+ return new e(this);
99
+ }
100
+ getOrCreateIsolatedContainer(t) {
101
+ return this.getOrCreateInstance(t, () => {
102
+ let n = this._parent?.getOrCreateIsolatedContainer(t);
103
+ return new e(n);
104
+ });
105
+ }
106
+ dispose() {
107
+ this._injections = Object.create(null);
108
+ }
109
+ };
110
+ //#endregion
111
+ //#region packages/runtime-core/di/namespace.ts
112
+ function c(e) {
113
+ return e.startsWith("__") ? e : `__${e}__`;
114
+ }
115
+ function l(e) {
116
+ if (typeof globalThis > "u") throw Error("[di] globalThis is required for namespace container access.");
117
+ let t = c(e), n = globalThis;
118
+ return n[t] ??= {};
119
+ }
120
+ //#endregion
121
+ //#region packages/runtime-core/di/ensureContainer.ts
122
+ function u(e) {
123
+ return typeof e == "object" && !!e && typeof e.inject == "function" && typeof e.getInstance == "function";
124
+ }
125
+ function d(e) {
126
+ return c(e || "emailmaker");
127
+ }
128
+ function f(e) {
129
+ let t = l(d(e));
130
+ if (u(t.container)) return t.container;
131
+ let n = new s(null);
132
+ return t.container = n, n;
133
+ }
134
+ function p(e) {
135
+ return f(e);
136
+ }
137
+ //#endregion
138
+ //#region packages/runtime-core/guid/index.ts
139
+ function m() {
140
+ let e = (/* @__PURE__ */ new Date()).getTime(), t = typeof performance < "u" && performance.now && performance.now() * 1e3 || 0;
141
+ return "xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g, function(n) {
142
+ let r = Math.random() * 16;
143
+ return e > 0 ? (r = (e + r) % 16 | 0, e = Math.floor(e / 16)) : (r = (t + r) % 16 | 0, t = Math.floor(t / 16)), (n === "x" ? r : r & 3 | 8).toString(16);
15
144
  });
145
+ }
146
+ //#endregion
147
+ //#region packages/runtime-core/di/identifier.ts
148
+ function h(e = m()) {
16
149
  return e;
17
- }, f = (e, t, n) => (d(e, t, "default"), n && d(n, t, "default")), p = /* @__PURE__ */ u({});
18
- import * as m from "@emailmaker/emailmaker/runtime-core";
19
- f(p, m);
150
+ }
20
151
  //#endregion
21
- //#region packages/extensions-core/components/DomComponentRegistry.ts
22
- var h = class {
152
+ //#region packages/runtime-core/di/index.ts
153
+ function g() {
154
+ return "app";
155
+ }
156
+ function _(e) {
157
+ if (typeof globalThis > "u") return;
158
+ let t = g(), n = globalThis[e] ?? {};
159
+ globalThis[e] = n;
160
+ let r = n.__diagnostics ??= {}, i = r.diModuleEval ??= {
161
+ evalCount: 0,
162
+ records: [],
163
+ duplicateWarned: !1
164
+ };
165
+ if (i.records.push({
166
+ buildSource: t,
167
+ timestamp: Date.now(),
168
+ stack: (/* @__PURE__ */ Error()).stack
169
+ }), i.evalCount += 1, i.evalCount <= 1 || i.duplicateWarned) return;
170
+ i.duplicateWarned = !0;
171
+ let a = {
172
+ message: "[di] runtime-core/di evaluated more than once (duplicate bundle / duplicate graph)",
173
+ evalCount: i.evalCount,
174
+ buildSource: t,
175
+ records: i.records
176
+ };
177
+ typeof console < "u" && typeof console.warn == "function" && console.warn(a.message, a);
178
+ }
179
+ function v() {
180
+ return "__emailmaker__";
181
+ }
182
+ function y(e, t) {
183
+ if (_(t), typeof globalThis > "u") return e;
184
+ let n = g(), r = globalThis, i = r[t] = r[t] || {}, a = i.__diagnostics = i.__diagnostics || {}, o = a.dependencyResolver = a.dependencyResolver || {
185
+ entries: [],
186
+ warnings: []
187
+ }, s = {
188
+ container: e,
189
+ source: "packages/runtime-core/di/index.ts",
190
+ buildSource: n,
191
+ timestamp: Date.now(),
192
+ stack: (/* @__PURE__ */ Error()).stack
193
+ };
194
+ if (o.entries.push(s), o.entries.length > 1) {
195
+ let e = o.entries[0];
196
+ if (o.entries.some((t) => t.container !== e.container) && !o.duplicateWarningShown) {
197
+ o.duplicateWarningShown = !0;
198
+ let e = {
199
+ message: "[di] Multiple DependencyResolver instances detected on namespace",
200
+ namespaceKey: t,
201
+ buildSource: n,
202
+ entries: o.entries
203
+ };
204
+ o.warnings.push(e), typeof console < "u" && typeof console.warn == "function" && console.warn(e.message, e);
205
+ }
206
+ }
207
+ return e;
208
+ }
209
+ var b;
210
+ function x() {
211
+ if (b) return b;
212
+ let e = v();
213
+ return b = y(f(e), e), b;
214
+ }
215
+ var S = new Proxy({}, { get(e, t, n) {
216
+ let r = x(), i = Reflect.get(r, t, n);
217
+ return typeof i == "function" ? i.bind(r) : i;
218
+ } }), C = class {
219
+ _plugins = /* @__PURE__ */ new Map();
220
+ _listeners = /* @__PURE__ */ new Map();
221
+ _getOrCreateEntry(e) {
222
+ let t = this._plugins.get(e);
223
+ return t || (t = { overrides: [] }, this._plugins.set(e, t)), t;
224
+ }
225
+ _applyOverrides(e, t) {
226
+ let n = this._plugins.get(e);
227
+ if (n?.overrides) for (let e of n.overrides) t = e(t) || t;
228
+ return t;
229
+ }
230
+ _notifyListeners(e, t) {
231
+ let n = this._listeners.get(e);
232
+ if (!n || n.length === 0) return;
233
+ for (let r of n) try {
234
+ r.callback(t);
235
+ } catch (t) {
236
+ console.warn(`Plugin registration listener threw an error for "${String(e)}":`, t);
237
+ }
238
+ let r = n.filter((e) => !e.once);
239
+ r.length > 0 ? this._listeners.set(e, r) : this._listeners.delete(e);
240
+ }
241
+ get(e) {
242
+ let t = this._plugins.get(e);
243
+ if (t?.ctor) return this._applyOverrides(e, t.ctor);
244
+ }
245
+ async getAsync(e) {
246
+ let t = this._plugins.get(e);
247
+ if (t?.ctor) return this._applyOverrides(e, t.ctor);
248
+ if (t?.loading) {
249
+ let n = await t.loading;
250
+ return this._applyOverrides(e, n);
251
+ }
252
+ if (t?.factory) {
253
+ let n = Promise.resolve(t.factory()).then((n) => (t.ctor = n, t.loading = void 0, this._notifyListeners(e, n), n));
254
+ t.loading = n;
255
+ let r = await n;
256
+ return this._applyOverrides(e, r);
257
+ }
258
+ return new Promise((t) => {
259
+ this.on(e, (n) => t(this._applyOverrides(e, n)));
260
+ });
261
+ }
262
+ add(e, t) {
263
+ let n = this._getOrCreateEntry(e);
264
+ n.ctor = t, this._notifyListeners(e, t);
265
+ }
266
+ addAll(e) {
267
+ for (let t of Object.keys(e)) {
268
+ let n = e[t];
269
+ n !== void 0 && this.add(t, n);
270
+ }
271
+ }
272
+ addAsync(e, t) {
273
+ let n = this._getOrCreateEntry(e);
274
+ return n.factory = t, { dispose: () => {
275
+ n.ctor || (n.factory = void 0);
276
+ } };
277
+ }
278
+ has(e) {
279
+ let t = this._plugins.get(e);
280
+ return !!(t?.ctor || t?.factory);
281
+ }
282
+ isLoaded(e) {
283
+ return !!this._plugins.get(e)?.ctor;
284
+ }
285
+ override(e, t) {
286
+ let n = this._getOrCreateEntry(e);
287
+ return n.overrides.push(t), { dispose: () => {
288
+ let e = n.overrides.indexOf(t);
289
+ e >= 0 && n.overrides.splice(e, 1);
290
+ } };
291
+ }
292
+ on(e, t) {
293
+ let n = this.get(e);
294
+ n && t(n);
295
+ let r = this._listeners.get(e);
296
+ r || (r = [], this._listeners.set(e, r));
297
+ let i = {
298
+ callback: t,
299
+ once: !1
300
+ };
301
+ return r.push(i), { dispose: () => this._removeListener(e, t) };
302
+ }
303
+ once(e, t) {
304
+ let n = this.get(e);
305
+ if (n) return t(n), { dispose: () => {} };
306
+ let r = this._listeners.get(e);
307
+ r || (r = [], this._listeners.set(e, r));
308
+ let i = {
309
+ callback: t,
310
+ once: !0
311
+ };
312
+ return r.push(i), { dispose: () => this._removeListener(e, t) };
313
+ }
314
+ off(e, t) {
315
+ this._removeListener(e, t);
316
+ }
317
+ _removeListener(e, t) {
318
+ let n = this._listeners.get(e);
319
+ if (n) {
320
+ let r = n.findIndex((e) => e.callback === t);
321
+ r >= 0 && n.splice(r, 1), n.length === 0 && this._listeners.delete(e);
322
+ }
323
+ }
324
+ keys() {
325
+ return Array.from(this._plugins.keys());
326
+ }
327
+ forContext() {
328
+ let e = this;
329
+ return { add(t, n) {
330
+ e.add(t, n);
331
+ } };
332
+ }
333
+ }, w = class {
334
+ constructor(e) {
335
+ this.resolveRegistry = e;
336
+ }
337
+ target() {
338
+ return this.resolveRegistry();
339
+ }
340
+ get(e) {
341
+ return this.target().get(e);
342
+ }
343
+ getAsync(e) {
344
+ return this.target().getAsync(e);
345
+ }
346
+ add(e, t) {
347
+ return this.target().add(e, t);
348
+ }
349
+ addAll(e) {
350
+ return this.target().addAll(e);
351
+ }
352
+ addAsync(e, t) {
353
+ return this.target().addAsync(e, t);
354
+ }
355
+ has(e) {
356
+ return this.target().has(e);
357
+ }
358
+ isLoaded(e) {
359
+ return this.target().isLoaded(e);
360
+ }
361
+ override(e, t) {
362
+ return this.target().override(e, t);
363
+ }
364
+ on(e, t) {
365
+ return this.target().on(e, t);
366
+ }
367
+ once(e, t) {
368
+ return this.target().once(e, t);
369
+ }
370
+ off(e, t) {
371
+ return this.target().off(e, t);
372
+ }
373
+ keys() {
374
+ return this.target().keys();
375
+ }
376
+ forContext() {
377
+ return this.target().forContext();
378
+ }
379
+ }, T = class {
23
380
  _factories = /* @__PURE__ */ new Map();
24
381
  add(e, t) {
25
382
  let n = e;
@@ -30,28 +387,28 @@ var h = class {
30
387
  get(e) {
31
388
  return this._factories.get(e);
32
389
  }
33
- }, g = (0, p.createIdentifier)("DomComponentRegistry");
34
- function _(e, t = g) {
35
- return p.DependencyResolver.getOrCreateInstance(t, () => new h());
390
+ }, E = h("DomComponentRegistry");
391
+ function D(e, t = E) {
392
+ return S.getOrCreateInstance(t, () => new T());
36
393
  }
37
394
  //#endregion
38
395
  //#region packages/extensions-core/components/ComponentRegistry.ts
39
- function v(e) {
396
+ function O(e) {
40
397
  return typeof e == "function";
41
398
  }
42
- function y(e) {
399
+ function k(e) {
43
400
  return i(e);
44
401
  }
45
- function b(e) {
46
- return typeof e == "function" || y(e);
402
+ function A(e) {
403
+ return typeof e == "function" || k(e);
47
404
  }
48
- function x(e) {
49
- return typeof e == "object" && !!e && "type" in e && "props" in e && !y(e);
405
+ function j(e) {
406
+ return typeof e == "object" && !!e && "type" in e && "props" in e && !k(e);
50
407
  }
51
- function S(e, t) {
408
+ function M(e, t) {
52
409
  return n(e, t);
53
410
  }
54
- function C(t) {
411
+ function N(t) {
55
412
  return class extends e {
56
413
  _ref = r();
57
414
  _instance;
@@ -69,7 +426,7 @@ function C(t) {
69
426
  }
70
427
  };
71
428
  }
72
- var w = class {
429
+ var P = class {
73
430
  _components = /* @__PURE__ */ new Map();
74
431
  _domAdapters = /* @__PURE__ */ new Map();
75
432
  constructor(e) {
@@ -102,26 +459,26 @@ var w = class {
102
459
  t.component = t.replacers.reduce((e, { replacer: t }) => t(e), void 0);
103
460
  }
104
461
  get(e) {
105
- if (b(e)) return e;
462
+ if (A(e)) return e;
106
463
  let t = e, n = this._components.get(t);
107
464
  if (n?.component) return n.component;
108
465
  let r = this._domComponentRegistry.get(e);
109
466
  if (r) {
110
467
  let e = this._domAdapters.get(t);
111
- return e || (e = C(r), this._domAdapters.set(t, e)), e;
468
+ return e || (e = N(r), this._domAdapters.set(t, e)), e;
112
469
  }
113
470
  }
114
471
  _resolveComponentInput(e) {
115
472
  if (e == null) return null;
116
- if (typeof e == "number" || typeof e == "boolean" || y(e)) return e;
473
+ if (typeof e == "number" || typeof e == "boolean" || k(e)) return e;
117
474
  if (typeof e == "string") {
118
475
  let t = this.get(e);
119
- return y(t) ? t : t ? S(t) : e;
476
+ return k(t) ? t : t ? M(t) : e;
120
477
  }
121
- if (v(e)) return S(e);
122
- if (x(e)) {
478
+ if (O(e)) return M(e);
479
+ if (j(e)) {
123
480
  let t = this.get(e.type);
124
- return y(t) ? t : t ? S(t, e.props) : null;
481
+ return k(t) ? t : t ? M(t, e.props) : null;
125
482
  }
126
483
  return null;
127
484
  }
@@ -130,15 +487,32 @@ var w = class {
130
487
  }
131
488
  getReactElement(e) {
132
489
  let r = this._resolveComponentInput(e);
133
- return y(r) ? r : typeof r == "string" || r == null || typeof r == "boolean" || typeof r == "number" ? n(t, null, r) : n(t, null);
490
+ return k(r) ? r : typeof r == "string" || r == null || typeof r == "boolean" || typeof r == "number" ? n(t, null, r) : n(t, null);
134
491
  }
135
- }, T = (0, p.createIdentifier)("ComponentRegistry");
136
- function E(e, t = T) {
137
- return p.DependencyResolver.getOrCreateInstance(t, () => new w(_(p.DependencyResolver, g)));
492
+ }, F = h("ComponentRegistry");
493
+ function I(e, t = F) {
494
+ return S.getOrCreateInstance(t, () => new P(D(S, E)));
495
+ }
496
+ //#endregion
497
+ //#region src/plugin/registryId.ts
498
+ var L = "PluginRegistry";
499
+ //#endregion
500
+ //#region src/plugin/pluginRegistry.ts
501
+ function R(e = p()) {
502
+ return e.getOrCreateInstance(L, () => new C());
503
+ }
504
+ new w(() => R());
505
+ //#endregion
506
+ //#region src/extensions/api/src/index.ts
507
+ function z() {
508
+ return typeof globalThis.crypto?.randomUUID == "function" ? globalThis.crypto.randomUUID() : `component-${Date.now().toString(36)}-${Math.random().toString(36).slice(2, 10)}`;
509
+ }
510
+ function B(e = z()) {
511
+ return e;
138
512
  }
139
513
  //#endregion
140
514
  //#region src/extensions/react/src/index.ts
141
- (function(e) {
515
+ D(S), (function(e) {
142
516
  if (!(!e || typeof e != "object")) {
143
517
  var t = e.__emailmaker__ ||= {}, n = t.__compat ||= {};
144
518
  n.host = n.host || null, n.packages = n.packages || {}, n.warned = n.warned || {}, n.normalizeVersion ||= function(e) {
@@ -193,7 +567,7 @@ function E(e, t = T) {
193
567
  n.packages[e.id] = e, n.validateAll();
194
568
  }, t.__compat.registerPackage({
195
569
  id: "extensions-react",
196
- version: "1.0.111-dev.5",
570
+ version: "1.0.111-dev.7",
197
571
  requires: {
198
572
  host: "^1.0.105",
199
573
  "extensions-api": "^0.9.0"
@@ -201,6 +575,6 @@ function E(e, t = T) {
201
575
  });
202
576
  }
203
577
  })(typeof window < "u" ? window : typeof globalThis < "u" ? globalThis : void 0);
204
- var D = E(p.DependencyResolver);
578
+ var V = I(S);
205
579
  //#endregion
206
- export { D as ComponentRegistry, a as createComponentIdentifier };
580
+ export { V as ComponentRegistry, B as createComponentIdentifier };
package/package.json CHANGED
@@ -5,14 +5,14 @@
5
5
  "main": "index.js",
6
6
  "types": "types.d.ts",
7
7
  "dependencies": {
8
- "antd": "^5.11.0",
8
+ "antd": "^5.22.0",
9
9
  "react": "^18.2.0",
10
10
  "react-dom": "^18.2.0",
11
11
  "@types/react": "^18.2.70",
12
12
  "@types/react-dom": "^18.2.0",
13
- "@emailmaker/emailmaker": "1.0.111-dev.5",
14
- "@emailmaker/extensions-app": "1.0.111-dev.5"
13
+ "@emailmaker/emailmaker": "1.0.111-dev.7",
14
+ "@emailmaker/extensions-app": "1.0.111-dev.7"
15
15
  },
16
16
  "name": "@emailmaker/extensions-react",
17
- "version": "1.0.111-dev.5"
17
+ "version": "1.0.111-dev.7"
18
18
  }
package/types.d.ts CHANGED
@@ -1,7 +1,565 @@
1
1
  import * as React from "react";
2
- import { ComponentId, ComponentType, IDisposable, createComponentIdentifier } from '@emailmaker/extensions-app';
2
+ import { IPluginConstructor, Instance } from '@emailmaker/emailmaker';
3
3
 
4
- declare module '@emailmaker/extensions-app' {
4
+ interface IDisposable$1 {
5
+ dispose(): void;
6
+ }
7
+ /**
8
+ * Unique identifier for a UI component.
9
+ * @template P The type of the component's props
10
+ */
11
+ type ComponentId$1<P = void> = string & {
12
+ propsType?: P;
13
+ };
14
+ /**
15
+ * Represents a component type with its props.
16
+ */
17
+ type ComponentType$1<Props> = {
18
+ type: ComponentId$1<Props>;
19
+ props: Props;
20
+ };
21
+ /**
22
+ * Extensible registry of component inputs accepted by core extension APIs.
23
+ * React-specific variants are added by the React adapter package.
24
+ */
25
+ interface ComponentInputRegistry<Props = unknown> {
26
+ componentType: ComponentType$1<Props>;
27
+ componentId: ComponentId$1<Props>;
28
+ }
29
+ /**
30
+ * Supported component input accepted by core extension APIs.
31
+ * Registered React component values live in the React adapter package.
32
+ */
33
+ type ComponentInput<Props = unknown> = ComponentInputRegistry<Props>[keyof ComponentInputRegistry<Props>];
34
+ /**
35
+ * UI element that can be a primitive or a registered component descriptor.
36
+ */
37
+ type UIElement = string | number | boolean | null | undefined | ComponentInput<any>;
38
+ /**
39
+ * Identifier type for message service.
40
+ */
41
+ type Identifier<Type0 = any, Type1 = any, Type2 = any> = {
42
+ type0?: Type0;
43
+ type1: Type1;
44
+ type2: Type2;
45
+ } & string;
46
+ /**
47
+ * Type that can be a Promise or a value.
48
+ */
49
+ type MayBePromise<Value> = Promise<Value> | Value;
50
+ interface IDisposable {
51
+ dispose(): void;
52
+ }
53
+ /**
54
+ * Payload for `BlocksApi.handleInject` when a block/structure was inserted in the sandbox
55
+ * (mirrors `application_block_inserted` message data).
56
+ */
57
+ interface BlockInjectInfo {
58
+ type?: string;
59
+ name?: string;
60
+ blockId?: string;
61
+ project?: string;
62
+ }
63
+ /**
64
+ * Context passed to ElementsApi.handleBeforeInject before element (atom) HTML is sent to the iframe.
65
+ * Listeners may mutate fields in place and/or return a partial object to merge (SaveEmitter-style).
66
+ */
67
+ interface ElementInsertContext extends Record<string, unknown> {
68
+ name: string;
69
+ className: string;
70
+ html: string;
71
+ }
72
+ /**
73
+ * Context passed to BlocksApi.handleBeforeInject before block HTML is sent to the iframe.
74
+ * `insertFrom` is the editor catalog route (e.g. project / template / common), not REST Block.type taxonomy.
75
+ */
76
+ interface BlockInsertContext extends Record<string, unknown> {
77
+ html: string;
78
+ insertFrom?: string;
79
+ fragmentRole?: 'block' | 'structure';
80
+ /** REST / catalog taxonomy (e.g. block type from API), not the same as `insertFrom`. */
81
+ type?: string;
82
+ name?: string;
83
+ /** Current app project id (route / Redux), not necessarily `Block.project` from REST. */
84
+ project?: string | number;
85
+ id?: string;
86
+ title?: string | null;
87
+ tags?: string[];
88
+ slug?: string;
89
+ description?: string;
90
+ subject?: string;
91
+ blocktags?: number[];
92
+ modified?: string | null;
93
+ author?: string;
94
+ lock?: boolean;
95
+ excerpt?: string | null;
96
+ status?: string;
97
+ is_template?: boolean;
98
+ link?: string;
99
+ renderGuid?: string;
100
+ date?: string | null;
101
+ date_gmt?: string | null;
102
+ modified_gmt?: string | null;
103
+ comment_status?: string;
104
+ ping_status?: string;
105
+ template?: string;
106
+ related_email?: string;
107
+ project_title?: string;
108
+ project_author?: string;
109
+ isAmp?: boolean;
110
+ /** Remaining catalog/API fields not mapped above (shallow copy). */
111
+ catalogExtra?: Record<string, unknown>;
112
+ }
113
+ /**
114
+ * API for block insert lifecycle in the editor (before HTML is sent to the iframe, and after sandbox insert).
115
+ */
116
+ interface IBlocksApi {
117
+ /**
118
+ * Runs before block HTML is posted to the iframe. Listeners receive a mutable context; they may
119
+ * mutate `html` and related fields or return a partial object to merge (SaveEmitter-style).
120
+ */
121
+ handleBeforeInject(listener: (ctx: BlockInsertContext) => MayBePromise<Partial<BlockInsertContext> | void>, priority?: number, thisArg?: unknown): IDisposable;
122
+ /**
123
+ * Fires after a block or structure was inserted in the sandbox (same channel as `application_block_inserted`).
124
+ * Does not allow changing markup; use {@link handleBeforeInject} to transform HTML before postMessage.
125
+ */
126
+ handleInject(listener: (info: BlockInjectInfo) => void, priority?: number, thisArg?: unknown): IDisposable;
127
+ }
128
+ /**
129
+ * Information about an element.
130
+ */
131
+ interface ElementInfo {
132
+ html: string;
133
+ name: string;
134
+ }
135
+ /**
136
+ * Represents an element that can be used for building UI.
137
+ */
138
+ interface Element {
139
+ title?: UIElement;
140
+ fallbackTooltip?: UIElement;
141
+ icon?: UIElement;
142
+ html: string;
143
+ className?: string;
144
+ name: string;
145
+ }
146
+ /**
147
+ * API for managing elements in the editor.
148
+ */
149
+ interface IElementsApi {
150
+ /**
151
+ * Retrieves a list of all elements.
152
+ */
153
+ getNames(): Promise<ElementInfo[]>;
154
+ /**
155
+ * Updates an existing element.
156
+ */
157
+ update(name: string, element: Element): IDisposable;
158
+ /**
159
+ * Deletes an element by its name.
160
+ */
161
+ delete(name: string): void;
162
+ /**
163
+ * Inserts a new element at a specified position.
164
+ */
165
+ insert(element: Element, position?: number): IDisposable;
166
+ /**
167
+ * Runs before atom HTML is posted to the iframe. Listeners receive a mutable context; they may
168
+ * mutate `html` / `name` / `className` or return a partial object to merge (SaveEmitter-style).
169
+ */
170
+ handleBeforeInject(listener: (ctx: ElementInsertContext) => MayBePromise<Partial<ElementInsertContext> | void>, priority?: number, thisArg?: unknown): IDisposable;
171
+ /**
172
+ * Fires after an atom is injected into the email HTML in the sandbox. Does not allow changing inserted markup.
173
+ * For transforming HTML before postMessage, use {@link handleBeforeInject}.
174
+ */
175
+ handleInject(listener: (elementInfo: {
176
+ name: string;
177
+ className: string;
178
+ html: string;
179
+ }) => void, priority?: number, thisArg?: unknown): IDisposable;
180
+ }
181
+ /**
182
+ * API for interacting with the MessageService.
183
+ * Provides methods to send and receive messages, as well as manage event listeners.
184
+ */
185
+ interface IMessageServiceApi {
186
+ /**
187
+ * Sends a message through MessageService.
188
+ */
189
+ send<Type>(messageTypeId: Identifier<Type>, data: Type, queued?: boolean): void;
190
+ send(data: any, queued?: boolean): void;
191
+ /**
192
+ * Sends an asynchronous message and waits for a response.
193
+ */
194
+ sendAsync<Type, Result>(messageTypeId: Identifier<Type, Result>, data: Type, queued?: boolean): Promise<Result | void>;
195
+ /**
196
+ * Adds a global event listener for message events.
197
+ */
198
+ addListener(listener: (e: MessageEvent) => void): IDisposable;
199
+ /**
200
+ * Adds a listener for a specific message type.
201
+ */
202
+ addListener<Type = any>(messageTypeId: Identifier<Type>, listener: (value: Type) => void, priority?: number): IDisposable;
203
+ /**
204
+ * Adds an asynchronous listener for a specific message type.
205
+ */
206
+ addListenerAsync<Type = any, Result = any>(messageTypeId: Identifier<Type, Result>, listener: (value: Type) => MayBePromise<Result>, priority?: number): IDisposable;
207
+ /**
208
+ * Adds a listener for the initialization event.
209
+ */
210
+ onInit(listener: (target: Window) => void, immediately?: boolean, priority?: number): IDisposable;
211
+ /**
212
+ * Checks whether initialization has been completed.
213
+ */
214
+ isInited(): boolean;
215
+ }
216
+ /**
217
+ * Mouse position type.
218
+ */
219
+ type MousePosition = {
220
+ x: number;
221
+ y: number;
222
+ } | null;
223
+ /**
224
+ * Modal props interface.
225
+ */
226
+ interface ModalProps {
227
+ open?: boolean;
228
+ confirmLoading?: boolean;
229
+ closable?: boolean;
230
+ onOk?: (e: MouseEvent) => void;
231
+ onCancel?: (e: MouseEvent) => void;
232
+ afterClose?: () => void;
233
+ afterOpenChange?: (open: boolean) => void;
234
+ centered?: boolean;
235
+ width?: string | number;
236
+ footer?: UIElement;
237
+ okText?: UIElement;
238
+ okType?: 'default' | 'primary' | 'dashed' | 'link' | 'text' | 'danger';
239
+ cancelText?: UIElement;
240
+ maskClosable?: boolean;
241
+ forceRender?: boolean;
242
+ destroyOnClose?: boolean;
243
+ style?: any;
244
+ wrapClassName?: string;
245
+ maskTransitionName?: string;
246
+ transitionName?: string;
247
+ className?: string;
248
+ rootClassName?: string;
249
+ getContainer?: string | HTMLElement | (() => HTMLElement) | false;
250
+ zIndex?: number;
251
+ mask?: boolean;
252
+ keyboard?: boolean;
253
+ wrapProps?: any;
254
+ prefixCls?: string;
255
+ closeIcon?: UIElement;
256
+ focusTriggerAfterClose?: boolean;
257
+ mousePosition?: MousePosition;
258
+ }
259
+ /**
260
+ * Configuration interface for modal windows.
261
+ */
262
+ interface ModalConfig<Props = unknown> {
263
+ type?: 'confirm' | 'info' | 'success' | 'error' | 'warning';
264
+ title?: UIElement;
265
+ content: ComponentInput<Props>;
266
+ width?: number | string;
267
+ closable?: boolean;
268
+ onOk?: () => void | Promise<void>;
269
+ onClose?: () => void;
270
+ modalProps?: ModalProps;
271
+ }
272
+ /**
273
+ * ModalApi interface for managing modal windows in plugins.
274
+ */
275
+ interface IModalApi {
276
+ /**
277
+ * Opens a modal window.
278
+ * @returns A unique identifier for the modal window.
279
+ */
280
+ show<P>(config: ModalConfig<P>): string;
281
+ /**
282
+ * Closes a modal window by its identifier.
283
+ */
284
+ close(id: string): void;
285
+ /**
286
+ * Closes all open modal windows.
287
+ */
288
+ closeAll(): void;
289
+ /**
290
+ * Updates the parameters of an already open modal window.
291
+ */
292
+ update<P>(id: string, config: Partial<ModalConfig<P>>): void;
293
+ }
294
+ /**
295
+ * API for managing styles and scripts in a sandboxed environment (e.g., an iframe).
296
+ */
297
+ interface ISandboxScriptHandle extends IDisposable {
298
+ /**
299
+ * Resolves when the corresponding sandbox `<script>` tag is loaded in iframe.
300
+ * Rejects if script loading fails or registration is disposed before load completes.
301
+ */
302
+ readonly loaded: Promise<void>;
303
+ /**
304
+ * Resolves when sandbox script is ready to receive messages.
305
+ * If script did not synchronously create sandbox plugins during evaluation,
306
+ * `ready` resolves together with `loaded`.
307
+ * If it did, `ready` waits until those synchronously created plugins finish
308
+ * lifecycle initialization (`afterInit`).
309
+ */
310
+ readonly ready: Promise<void>;
311
+ }
312
+ interface ISandboxScriptApi {
313
+ /**
314
+ * Registers an external CSS file inside the sandboxed environment.
315
+ */
316
+ registerSandboxCSS(url: string): IDisposable;
317
+ /**
318
+ * Registers a block of CSS code inside the sandboxed environment.
319
+ */
320
+ registerSandboxCSSCode(key: string, code: string): IDisposable;
321
+ /**
322
+ * Registers an external JavaScript file inside the sandboxed environment.
323
+ */
324
+ registerSandboxScript(url: string): ISandboxScriptHandle;
325
+ /**
326
+ * Registers a block of JavaScript code inside the sandboxed environment.
327
+ */
328
+ registerSandboxScriptCode(key: string, code: string): ISandboxScriptHandle;
329
+ }
330
+ /**
331
+ * Options for adding extra tabs in the interface.
332
+ */
333
+ interface ExtraTabOptions<Props = unknown> {
334
+ content: ComponentInput<Props>;
335
+ label?: string;
336
+ key: string;
337
+ className?: string;
338
+ }
339
+ /**
340
+ * Options for the settings panel.
341
+ */
342
+ interface SettingsPanelOptions<Props = unknown> {
343
+ content: ComponentInput<Props>;
344
+ caption?: string;
345
+ deletable?: boolean;
346
+ parent?: boolean;
347
+ advancedTabs?: ExtraTabOptions[];
348
+ /**
349
+ * Stable logical instance (block uuid, atom id, etc.).
350
+ * When omitted, each {@link ISettingsPanelApi.showSettingsPanel} call gets a fresh key and the host remounts the panel.
351
+ * Pass a stable value only to update props in-place and preserve internal UI state (scroll, focus, drafts).
352
+ */
353
+ instanceKey?: string;
354
+ }
355
+ /**
356
+ * API for managing the settings panel.
357
+ */
358
+ interface ISettingsPanelApi {
359
+ /**
360
+ * Opens the settings panel and displays the provided component.
361
+ */
362
+ showSettingsPanel<Props = unknown>(options: SettingsPanelOptions<Props>): void;
363
+ /**
364
+ * Closes the settings panel.
365
+ */
366
+ closeSettingsPanel(): void;
367
+ }
368
+ /**
369
+ * Unique identifier for a UI component.
370
+ * @template P The component's props type.
371
+ */
372
+ type ComponentId<P = void> = string & {
373
+ propsType?: P;
374
+ };
375
+ /**
376
+ * Represents a component type with its props.
377
+ */
378
+ type ComponentType<Props> = {
379
+ type: ComponentId<Props>;
380
+ props: Props;
381
+ };
382
+ /**
383
+ * Creates a unique identifier for a UI component.
384
+ * @template Props The component's props type.
385
+ * @param {string} [name] Optional identifier name.
386
+ * @returns {ComponentId<Props>} A unique component identifier.
387
+ */
388
+ declare function createComponentIdentifier<Props>(name?: string): ComponentId<Props>;
389
+ // ============================================
390
+ // EmailSettingsApi
391
+ // ============================================
392
+ interface EmailSettingsApi {
393
+ getEmailLayoutSettings(): Promise<EmailLayoutSettings>;
394
+ setEmailLayoutSettings(settings: Partial<EmailLayoutSettings>): Promise<void>;
395
+ getEmailContentStyles(): Promise<EmailContentStyles>;
396
+ setEmailContentStyles(contentStyles: Partial<EmailContentStyles>): Promise<void>;
397
+ /** Fired after email layout settings change. */
398
+ onChangeEmailLayoutSettings(listener: (settings: EmailLayoutSettings) => void): IDisposable$1;
399
+ /** Fired after email content styles change. */
400
+ onChangeEmailContentStyles(listener: (contentStyles: EmailContentStyles) => void): IDisposable$1;
401
+ }
402
+ /**
403
+ * Email layout settings.
404
+ */
405
+ interface EmailLayoutSettings {
406
+ backgroundColor: string;
407
+ backgroundImage: Array<{
408
+ type: 'url';
409
+ value: string;
410
+ }>;
411
+ backgroundPositionX: string;
412
+ backgroundPositionY: string;
413
+ backgroundRepeat: string;
414
+ backgroundSize?: string;
415
+ backgroundColorContent?: string;
416
+ textStrong: boolean;
417
+ textItalic: boolean;
418
+ textUnderline: boolean;
419
+ width?: {
420
+ value?: number;
421
+ dim?: string;
422
+ };
423
+ responsive?: {
424
+ shutdown?: boolean;
425
+ styles?: boolean;
426
+ };
427
+ }
428
+ /**
429
+ * Email content styles.
430
+ */
431
+ interface EmailContentStyles {
432
+ text?: {
433
+ fontFamily?: string[] | string;
434
+ fontSize?: number;
435
+ fontSizeDim?: string;
436
+ lineHeight?: number;
437
+ lineHeightDim?: string;
438
+ color?: string;
439
+ contrastColor?: string;
440
+ textAlign?: string;
441
+ paddingBottom?: number;
442
+ paddingBottomDim?: string;
443
+ };
444
+ headings?: {
445
+ fontFamily?: string[] | string;
446
+ fontSize?: number;
447
+ fontSizeDim?: string;
448
+ lineHeight?: number;
449
+ lineHeightDim?: string;
450
+ color?: string;
451
+ contrastColor?: string;
452
+ textAlign?: string;
453
+ paddingTop?: number;
454
+ paddingTopDim?: string;
455
+ paddingBottom?: number;
456
+ paddingBottomDim?: string;
457
+ letterSpacing?: number;
458
+ letterSpacingDim?: string;
459
+ bold?: boolean;
460
+ italic?: boolean;
461
+ };
462
+ links?: {
463
+ color?: string;
464
+ contrastColor?: string;
465
+ underline?: boolean;
466
+ };
467
+ buttons?: {
468
+ fontFamily?: string[] | string;
469
+ fontSize?: number;
470
+ fontSizeDim?: string;
471
+ letterSpacing?: number;
472
+ letterSpacingDim?: string;
473
+ color?: string;
474
+ contrastColor?: string;
475
+ bold?: boolean;
476
+ italic?: boolean;
477
+ backgroundColor?: string;
478
+ contrastBackgroundColor?: string;
479
+ marginTop?: number;
480
+ marginTopDim?: string;
481
+ marginBottom?: number;
482
+ marginBottomDim?: string;
483
+ border?: {
484
+ all?: number | null;
485
+ top?: number | null;
486
+ right?: number | null;
487
+ bottom?: number | null;
488
+ left?: number | null;
489
+ };
490
+ borderRadius?: {
491
+ all?: number | null;
492
+ topLeft?: number | null;
493
+ topRight?: number | null;
494
+ bottomRight?: number | null;
495
+ bottomLeft?: number | null;
496
+ };
497
+ textAlign?: string;
498
+ padding?: {
499
+ all?: number | null;
500
+ top?: number | null;
501
+ right?: number | null;
502
+ bottom?: number | null;
503
+ left?: number | null;
504
+ };
505
+ };
506
+ block?: {
507
+ backgroundColor?: string;
508
+ contrastBackgroundColor?: string;
509
+ padding?: {
510
+ all?: number | null;
511
+ top?: number | null;
512
+ right?: number | null;
513
+ bottom?: number | null;
514
+ left?: number | null;
515
+ };
516
+ };
517
+ cards?: {
518
+ contrastBackgroundColor?: string;
519
+ contrastTextColor?: string;
520
+ baseBackgroundColor?: string;
521
+ baseTextColor?: string;
522
+ border?: {
523
+ all?: number | null;
524
+ top?: number | null;
525
+ right?: number | null;
526
+ bottom?: number | null;
527
+ left?: number | null;
528
+ };
529
+ borderRadius?: {
530
+ all?: number | null;
531
+ topLeft?: number | null;
532
+ topRight?: number | null;
533
+ bottomRight?: number | null;
534
+ bottomLeft?: number | null;
535
+ };
536
+ };
537
+ }
538
+ /**
539
+ * @deprecated Use `editor.use('EmailSettingsApi')` to access built-in platform APIs.
540
+ * This compatibility facade will be removed in a future plugin-system package release.
541
+ */
542
+ declare class EmailSettingsApi {
543
+ constructor(editor: Instance);
544
+ }
545
+ declare module '@emailmaker/emailmaker' {
546
+ interface PluginTypeMap {
547
+ SandboxScriptApi: IPluginConstructor<ISandboxScriptApi>;
548
+ ElementsApi: IPluginConstructor<IElementsApi>;
549
+ BlocksApi: IPluginConstructor<IBlocksApi>;
550
+ MessageService: IPluginConstructor<IMessageServiceApi>;
551
+ SettingsPanelApi: IPluginConstructor<ISettingsPanelApi>;
552
+ ModalApi: IPluginConstructor<IModalApi>;
553
+ EmailSettingsApi: IPluginConstructor<EmailSettingsApi>;
554
+ }
555
+ }
556
+ declare module '@emailmaker/extensions-api' {
557
+ interface ComponentInputRegistry<Props = unknown> {
558
+ reactComponent: React.ComponentClass<Props> | React.FunctionComponent<Props>;
559
+ reactElement: React.ReactElement;
560
+ }
561
+ }
562
+ declare module 'extensions-core/api/interfaces' {
5
563
  interface ComponentInputRegistry<Props = unknown> {
6
564
  reactComponent: React.ComponentClass<Props> | React.FunctionComponent<Props>;
7
565
  reactElement: React.ReactElement;
@@ -30,7 +588,7 @@ interface IComponentRegistry {
30
588
  * @param {ReactNode<P>} component - The component instance.
31
589
  * @returns {Disposable} A disposable instance to remove the component.
32
590
  */
33
- add<P>(id: ComponentId<P>, component: ReactNode<P>): IDisposable;
591
+ add<P>(id: ComponentId<P>, component: ReactNode<P>): IDisposable$1;
34
592
  /**
35
593
  * Overrides an existing component with a new replacer function.
36
594
  * @template P The type of the component's props.
@@ -38,7 +596,7 @@ interface IComponentRegistry {
38
596
  * @param {ComponentReplacer<P>} replacer - The replacer function.
39
597
  * @returns {Disposable} A disposable instance for cleanup.
40
598
  */
41
- override<P>(id: ComponentId<P>, replacer: ComponentReplacer<P>): IDisposable;
599
+ override<P>(id: ComponentId<P>, replacer: ComponentReplacer<P>): IDisposable$1;
42
600
  /**
43
601
  * Retrieves a registered component by its identifier.
44
602
  * @template P The type of the component's props.