@maildeno/editor 0.1.1 → 0.1.2

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/dist/init.js CHANGED
@@ -1,5 +1,5 @@
1
- import { D as h, at as ref, i as createApp, rt as reactive } from "./vue.runtime.esm-bundler-DwQEK7WO.js";
2
- import { a as setEditorTheme, c as createLocalStorageAdapter, d as getRegisteredMergeTagIds, f as registerMergeTags, h as registerBlock, i as palette, l as getRegisteredCustomESPs, m as getBlock, n as registerMaildenoEditorElement, p as getAllBlocks, r as EmailEditor_default, s as buildShadowStyles, u as registerESPSyntax } from "./element-DN22fZmQ.js";
1
+ import { D as h, at as ref, i as createApp, rt as reactive } from "./vue.runtime.esm-bundler-CfYyFhW6.js";
2
+ import { a as setEditorTheme, c as createLocalStorageAdapter, d as getRegisteredMergeTagIds, f as registerMergeTags, h as registerBlock, i as palette, l as getRegisteredCustomESPs, m as getBlock, n as registerMaildenoEditorElement, p as getAllBlocks, r as EmailEditor_default, s as buildShadowStyles, u as registerESPSyntax } from "./element-DLJCEP_z.js";
3
3
  //#region src/lightDom.ts
4
4
  var stylesInjected = false;
5
5
  /**
package/dist/theme.d.ts CHANGED
@@ -70,6 +70,29 @@ export interface ThemeTokens {
70
70
  toolbarBg?: string;
71
71
  toolbarText?: string;
72
72
  toolbarBorder?: string;
73
+ /** Canvas component-selection accent. Drives hover/selected outlines on
74
+ * canvas components, the floating action bar's ring, and drag/drop
75
+ * indicators. Kept independent of `primary` so the brand button and the
76
+ * canvas's own interaction colour can differ — as they do by default
77
+ * (a dark brand button, a green canvas accent). */
78
+ selection?: string;
79
+ /** Pale fill for `selection` — hover backgrounds on the same controls. */
80
+ selectionBg?: string;
81
+ /** Readable text/icon tone for `selection` when placed on `selectionBg`. */
82
+ selectionFg?: string;
83
+ /** Same role as `selection`, one level up: row outlines, the row's
84
+ * floating toolbar, and "this is a row" indicators in the Layout tab
85
+ * and Layers panel. Separate token so components and rows can be told
86
+ * apart at a glance, as they are by default (green vs purple). */
87
+ rowSelection?: string;
88
+ rowSelectionBg?: string;
89
+ rowSelectionFg?: string;
90
+ /** Small dark tooltips on icon buttons throughout the canvas and
91
+ * toolbars. Kept distinct from `overlay` because tooltips are
92
+ * conventionally dark even in an otherwise light theme; set both if you
93
+ * want them to follow the rest of the theme instead. */
94
+ tooltipBg?: string;
95
+ tooltipText?: string;
73
96
  /** The Save / Update button — the most commonly branded control. */
74
97
  buttonPrimaryBg?: string;
75
98
  buttonPrimaryText?: string;
@@ -8845,7 +8845,6 @@ function uf(e, t, a = 0, s, f, h, b) {
8845
8845
  default:
8846
8846
  let Rt = l, fn = O(0);
8847
8847
  oe(l) === 45 && (l++, O(fn), l === Rt + 1 && G(E.Subpattern_flags_must_be_present_when_there_is_a_minus_sign, Rt, l - Rt)), pn(58), le = !0;
8848
- break;
8849
8848
  }
8850
8849
  else Ye++, le = !0;
8851
8850
  un(!0), pn(41);
@@ -9105,9 +9104,7 @@ function uf(e, t, a = 0, s, f, h, b) {
9105
9104
  case 124:
9106
9105
  Y !== 1 && (he = !0), l++, h = l, Y = 0;
9107
9106
  break;
9108
- default:
9109
- Et(), Y++;
9110
- break;
9107
+ default: Et(), Y++;
9111
9108
  }
9112
9109
  }
9113
9110
  function Et() {
@@ -19876,7 +19873,6 @@ function ki(e) {
19876
19873
  case ye.PublicKeyword: return "public";
19877
19874
  case ye.ProtectedKeyword: return "protected";
19878
19875
  case ye.PrivateKeyword: return "private";
19879
- default: break;
19880
19876
  }
19881
19877
  }
19882
19878
  function rr(e, t, a) {
@@ -21113,9 +21109,7 @@ var Fl = class {
21113
21109
  case w.NamespaceImport:
21114
21110
  s.specifiers.push(this.convertChild(t.importClause.namedBindings));
21115
21111
  break;
21116
- case w.NamedImports:
21117
- s.specifiers.push(...this.convertChildren(t.importClause.namedBindings.elements));
21118
- break;
21112
+ case w.NamedImports: s.specifiers.push(...this.convertChildren(t.importClause.namedBindings.elements));
21119
21113
  }
21120
21114
  return s;
21121
21115
  }
@@ -12,7 +12,7 @@ var __exportAll = (all, no_symbols) => {
12
12
  //#endregion
13
13
  //#region ../../node_modules/@vue/shared/dist/shared.esm-bundler.js
14
14
  /**
15
- * @vue/shared v3.5.41
15
+ * @vue/shared v3.5.42
16
16
  * (c) 2018-present Yuxi (Evan) You and Vue contributors
17
17
  * @license MIT
18
18
  **/
@@ -184,6 +184,21 @@ function looseCompareArrays(a, b) {
184
184
  for (let i = 0; equal && i < a.length; i++) equal = looseEqual(a[i], b[i]);
185
185
  return equal;
186
186
  }
187
+ function looseCompareCollections(a, b) {
188
+ if (a.size !== b.size) return false;
189
+ const candidates = Array.from(b);
190
+ const matched = new Uint8Array(candidates.length);
191
+ for (const item of a) {
192
+ let index = -1;
193
+ for (let i = 0; i < candidates.length; i++) if (!matched[i] && looseEqual(item, candidates[i])) {
194
+ index = i;
195
+ break;
196
+ }
197
+ if (index < 0) return false;
198
+ matched[index] = 1;
199
+ }
200
+ return true;
201
+ }
187
202
  function looseEqual(a, b) {
188
203
  if (a === b) return true;
189
204
  let aValidType = isDate(a);
@@ -199,6 +214,12 @@ function looseEqual(a, b) {
199
214
  bValidType = isObject(b);
200
215
  if (aValidType || bValidType) {
201
216
  if (!aValidType || !bValidType) return false;
217
+ aValidType = isMap(a);
218
+ bValidType = isMap(b);
219
+ if (aValidType || bValidType) return aValidType && bValidType ? looseCompareCollections(a, b) : false;
220
+ aValidType = isSet(a);
221
+ bValidType = isSet(b);
222
+ if (aValidType || bValidType) return aValidType && bValidType ? looseCompareCollections(a, b) : false;
202
223
  if (Object.keys(a).length !== Object.keys(b).length) return false;
203
224
  for (const key in a) {
204
225
  const aHasKey = a.hasOwnProperty(key);
@@ -243,7 +264,7 @@ function normalizeCssVarValue(value) {
243
264
  //#endregion
244
265
  //#region ../../node_modules/@vue/reactivity/dist/reactivity.esm-bundler.js
245
266
  /**
246
- * @vue/reactivity v3.5.41
267
+ * @vue/reactivity v3.5.42
247
268
  * (c) 2018-present Yuxi (Evan) You and Vue contributors
248
269
  * @license MIT
249
270
  **/
@@ -1758,7 +1779,7 @@ function traverse(value, depth = Infinity, seen) {
1758
1779
  //#endregion
1759
1780
  //#region ../../node_modules/@vue/runtime-core/dist/runtime-core.esm-bundler.js
1760
1781
  /**
1761
- * @vue/runtime-core v3.5.41
1782
+ * @vue/runtime-core v3.5.42
1762
1783
  * (c) 2018-present Yuxi (Evan) You and Vue contributors
1763
1784
  * @license MIT
1764
1785
  **/
@@ -3174,10 +3195,10 @@ function createHydrationFunctions(rendererInternals) {
3174
3195
  else if (isComment(node) && node.data === "teleport start") nextNode = locateClosingAnchor(node, node.data, "teleport end");
3175
3196
  else nextNode = nextSibling(node);
3176
3197
  mountComponent(vnode, container, null, parentComponent, parentSuspense, getContainerType(container), optimized);
3177
- if (isAsyncWrapper(vnode) && !vnode.type.__asyncResolved) {
3198
+ if (isAsyncWrapper(vnode) && !vnode.component.subTree) {
3178
3199
  let subTree;
3179
3200
  if (isFragmentStart) {
3180
- subTree = createVNode(Fragment);
3201
+ subTree = createVNode(Static);
3181
3202
  subTree.anchor = nextNode ? nextNode.previousSibling : container.lastChild;
3182
3203
  } else subTree = node.nodeType === 3 ? createTextVNode("") : createVNode("div");
3183
3204
  subTree.el = node;
@@ -3782,7 +3803,8 @@ var KeepAlive = {
3782
3803
  const cacheSubtree = () => {
3783
3804
  if (pendingCacheKey != null) {
3784
3805
  if (isSuspense(instance.subTree.type)) queuePostRenderEffect(() => {
3785
- cache.set(pendingCacheKey, getInnerChild(instance.subTree));
3806
+ const vnode = getInnerChild(instance.subTree);
3807
+ if (vnode.component) cache.set(pendingCacheKey, vnode);
3786
3808
  }, instance.subTree.suspense);
3787
3809
  else cache.set(pendingCacheKey, getInnerChild(instance.subTree));
3788
3810
  }
@@ -4064,9 +4086,36 @@ var getPublicInstance = (i) => {
4064
4086
  if (isStatefulComponent(i)) return getComponentPublicInstance(i);
4065
4087
  return getPublicInstance(i.parent);
4066
4088
  };
4089
+ var resolveDevRootEl = (vnode) => {
4090
+ let found = false;
4091
+ while (true) {
4092
+ if (vnode.patchFlag > 0 && vnode.patchFlag & 2048) {
4093
+ const root = filterSingleRoot(vnode.children);
4094
+ if (!root) return;
4095
+ vnode = root;
4096
+ found = true;
4097
+ continue;
4098
+ }
4099
+ const component = vnode.component;
4100
+ if (component && component.subTree) {
4101
+ vnode = component.subTree;
4102
+ continue;
4103
+ }
4104
+ const suspense = vnode.suspense;
4105
+ if (suspense && suspense.activeBranch) {
4106
+ vnode = suspense.activeBranch;
4107
+ continue;
4108
+ }
4109
+ return found ? vnode.el : void 0;
4110
+ }
4111
+ };
4112
+ var getDevRootFragmentEl = (i) => {
4113
+ const el = i.subTree && resolveDevRootEl(i.subTree);
4114
+ return el === void 0 ? i.vnode.el : el;
4115
+ };
4067
4116
  var publicPropertiesMap = /* @__PURE__ */ extend(/* @__PURE__ */ Object.create(null), {
4068
4117
  $: (i) => i,
4069
- $el: (i) => i.vnode.el,
4118
+ $el: (i) => !!(process.env.NODE_ENV !== "production") ? getDevRootFragmentEl(i) : i.vnode.el,
4070
4119
  $data: (i) => i.data,
4071
4120
  $props: (i) => !!(process.env.NODE_ENV !== "production") ? /* @__PURE__ */ shallowReadonly(i.props) : i.props,
4072
4121
  $attrs: (i) => !!(process.env.NODE_ENV !== "production") ? /* @__PURE__ */ shallowReadonly(i.attrs) : i.attrs,
@@ -4784,7 +4833,7 @@ function emit(instance, event, ...rawArgs) {
4784
4833
  const modifiers = isModelListener && getModelModifiers(props, event.slice(7));
4785
4834
  if (modifiers) {
4786
4835
  if (modifiers.trim) args = rawArgs.map((a) => isString(a) ? a.trim() : a);
4787
- if (modifiers.number) args = rawArgs.map(looseToNumber);
4836
+ if (modifiers.number) args = args.map(looseToNumber);
4788
4837
  }
4789
4838
  if (!!(process.env.NODE_ENV !== "production") || false) devtoolsComponentEmit(instance, event, args);
4790
4839
  if (!!(process.env.NODE_ENV !== "production")) {
@@ -6253,7 +6302,7 @@ function patchSuspense(n1, n2, container, anchor, parentComponent, namespace, sl
6253
6302
  patch(pendingBranch, newBranch, suspense.hiddenContainer, null, parentComponent, suspense, namespace, slotScopeIds, optimized);
6254
6303
  if (suspense.deps <= 0) suspense.resolve();
6255
6304
  else if (isInFallback) {
6256
- if (!isHydrating) {
6305
+ if (!isHydrating && !suspense.isFallbackMountPending) {
6257
6306
  patch(activeBranch, newFallback, container, anchor, parentComponent, null, namespace, slotScopeIds, optimized);
6258
6307
  setActiveBranch(suspense, newFallback);
6259
6308
  }
@@ -6270,7 +6319,7 @@ function patchSuspense(n1, n2, container, anchor, parentComponent, namespace, sl
6270
6319
  if (isInFallback) {
6271
6320
  patch(null, newBranch, suspense.hiddenContainer, null, parentComponent, suspense, namespace, slotScopeIds, optimized);
6272
6321
  if (suspense.deps <= 0) suspense.resolve();
6273
- else {
6322
+ else if (!suspense.isFallbackMountPending) {
6274
6323
  patch(activeBranch, newFallback, container, anchor, parentComponent, null, namespace, slotScopeIds, optimized);
6275
6324
  setActiveBranch(suspense, newFallback);
6276
6325
  }
@@ -6396,8 +6445,9 @@ function createSuspenseBoundary(vnode, parentSuspense, parentComponent, containe
6396
6445
  const mountFallback = () => {
6397
6446
  suspense.isFallbackMountPending = false;
6398
6447
  if (!suspense.isInFallback) return;
6399
- patch(null, fallbackVNode, container2, anchor2, parentComponent2, null, namespace2, slotScopeIds, optimized);
6400
- setActiveBranch(suspense, fallbackVNode);
6448
+ const latestFallback = suspense.vnode.ssFallback;
6449
+ patch(null, latestFallback, container2, anchor2, parentComponent2, null, namespace2, slotScopeIds, optimized);
6450
+ setActiveBranch(suspense, latestFallback);
6401
6451
  };
6402
6452
  const delayEnter = fallbackVNode.transition && fallbackVNode.transition.mode === "out-in";
6403
6453
  if (delayEnter) {
@@ -7306,7 +7356,7 @@ function isMemoSame(cached, memo) {
7306
7356
  if (isBlockTreeEnabled > 0 && currentBlock) currentBlock.push(cached);
7307
7357
  return true;
7308
7358
  }
7309
- var version = "3.5.41";
7359
+ var version = "3.5.42";
7310
7360
  var warn = !!(process.env.NODE_ENV !== "production") ? warn$1 : NOOP;
7311
7361
  var ErrorTypeStrings = ErrorTypeStrings$1;
7312
7362
  var devtools = (process.env.NODE_ENV, devtools$1);
@@ -7326,7 +7376,7 @@ var ssrUtils = {
7326
7376
  //#endregion
7327
7377
  //#region ../../node_modules/@vue/runtime-dom/dist/runtime-dom.esm-bundler.js
7328
7378
  /**
7329
- * @vue/runtime-dom v3.5.41
7379
+ * @vue/runtime-dom v3.5.42
7330
7380
  * (c) 2018-present Yuxi (Evan) You and Vue contributors
7331
7381
  * @license MIT
7332
7382
  **/
@@ -7754,8 +7804,10 @@ function setStyle(style, name, val) {
7754
7804
  if (!!(process.env.NODE_ENV !== "production")) {
7755
7805
  if (semicolonRE.test(val)) warn(`Unexpected semicolon at the end of '${name}' style value: '${val}'`);
7756
7806
  }
7757
- if (name.startsWith("--")) style.setProperty(name, val);
7758
- else {
7807
+ if (name.startsWith("--")) {
7808
+ if (importantRE.test(val)) style.setProperty(name, val.replace(importantRE, ""), "important");
7809
+ else style.setProperty(name, val);
7810
+ } else {
7759
7811
  const prefixed = autoPrefix(style, name);
7760
7812
  if (importantRE.test(val)) style.setProperty(hyphenate(prefixed), val.replace(importantRE, ""), "important");
7761
7813
  else style[prefixed] = val;
@@ -8586,11 +8638,16 @@ var vModelSelect = {
8586
8638
  el._modelValue = value;
8587
8639
  addEventListener(el, "change", () => {
8588
8640
  const selectedVal = Array.prototype.filter.call(el.options, (o) => o.selected).map((o) => number ? looseToNumber(getValue(o)) : getValue(o));
8589
- el[assignKey](el.multiple ? isSet(el._modelValue) ? new Set(selectedVal) : selectedVal : selectedVal[0]);
8590
- el._assigning = true;
8591
- nextTick(() => {
8592
- el._assigning = false;
8593
- });
8641
+ const multiple = el.multiple;
8642
+ const assignedValue = multiple ? isSet(el._modelValue) ? new Set(selectedVal) : selectedVal : selectedVal[0];
8643
+ const pending = el._pendingValue = [multiple, multiple ? isArray(assignedValue) ? selectedVal.slice() : selectedVal : assignedValue];
8644
+ try {
8645
+ el[assignKey](assignedValue);
8646
+ } finally {
8647
+ nextTick(() => {
8648
+ if (el._pendingValue === pending) el._pendingValue = void 0;
8649
+ });
8650
+ }
8594
8651
  });
8595
8652
  el[assignKey] = getModelAssigner(vnode);
8596
8653
  },
@@ -8602,9 +8659,21 @@ var vModelSelect = {
8602
8659
  el[assignKey] = getModelAssigner(vnode);
8603
8660
  },
8604
8661
  updated(el, { value }) {
8605
- if (!el._assigning) setSelected(el, value);
8662
+ const pending = el._pendingValue;
8663
+ el._pendingValue = void 0;
8664
+ if (!pending || pending[0] !== el.multiple || !isSameSelectValue(value, pending[1], pending[0])) setSelected(el, value);
8606
8665
  }
8607
8666
  };
8667
+ function isSameSelectValue(value, assignedValue, multiple) {
8668
+ if (!multiple) return looseEqual(value, assignedValue);
8669
+ if (isArray(value)) return looseEqual(value, assignedValue);
8670
+ if (isSet(value)) {
8671
+ if (value.size !== assignedValue.length) return false;
8672
+ for (const item of assignedValue) if (!value.has(item)) return false;
8673
+ return true;
8674
+ }
8675
+ return false;
8676
+ }
8608
8677
  function setSelected(el, value) {
8609
8678
  const isMultiple = el.multiple;
8610
8679
  const isArrayValue = isArray(value);
@@ -8840,7 +8909,7 @@ var initDirectivesForSSR = () => {
8840
8909
  //#endregion
8841
8910
  //#region ../../node_modules/vue/dist/vue.runtime.esm-bundler.js
8842
8911
  /**
8843
- * vue v3.5.41
8912
+ * vue v3.5.42
8844
8913
  * (c) 2018-present Yuxi (Evan) You and Vue contributors
8845
8914
  * @license MIT
8846
8915
  **/
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@maildeno/editor",
3
- "version": "0.1.1",
3
+ "version": "0.1.2",
4
4
  "description": "An open-source, framework-agnostic email template editor. Drag-and-drop block editing, HTML/MJML/React Email/JSON export, and a pluggable ESP-conditional-logic engine with zero required backend.",
5
5
  "type": "module",
6
6
  "types": "./dist/index.d.ts",