email-builder-online 4.1.13 → 4.1.14

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/index.cjs CHANGED
@@ -1 +1 @@
1
- "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});require("react/jsx-runtime");const e=require("./index-BORDx2NL.cjs");require("react");exports.BLOCK_TYPES=e.BLOCK_TYPES;exports.ButtonPropsSchema=e.ButtonPropsSchema;exports.COLOR_SCHEMA=e.COLOR_SCHEMA;exports.ColumnsContainerPropsSchema=e.ColumnsContainerPropsSchema;exports.ContainerPropsSchema=e.ContainerPropsSchema;exports.DividerPropsSchema=e.DividerPropsSchema;exports.EditorBlockSchema=e.EditorBlockSchema;exports.EditorConfigurationSchema=e.EditorConfigurationSchema;exports.EmailBuilder=e.EmailBuilder;exports.EmailLayoutPropsSchema=e.EmailLayoutPropsSchema;exports.FONT_FAMILY_NAMES=e.FONT_FAMILY_NAMES;exports.FONT_FAMILY_SCHEMA=e.FONT_FAMILY_SCHEMA;exports.ImagePropsSchema=e.ImagePropsSchema;exports.NotionTextPropsSchema=e.NotionTextPropsSchema;exports.PADDING_SCHEMA=e.PADDING_SCHEMA;exports.SHAPE_SCHEMA=e.SHAPE_SCHEMA;exports.SocialMediaPropsSchema=e.SocialMediaPropsSchema;exports.SpacerPropsSchema=e.SpacerPropsSchema;exports.default=e.EmailBuilder;exports.registerEmailBuilder=e.registerEmailBuilder;exports.validateDocument=e.validateDocument;
1
+ "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});require("react/jsx-runtime");const e=require("./index-4qATIPiQ.cjs");require("react");exports.BLOCK_TYPES=e.BLOCK_TYPES;exports.ButtonPropsSchema=e.ButtonPropsSchema;exports.COLOR_SCHEMA=e.COLOR_SCHEMA;exports.ColumnsContainerPropsSchema=e.ColumnsContainerPropsSchema;exports.ContainerPropsSchema=e.ContainerPropsSchema;exports.DividerPropsSchema=e.DividerPropsSchema;exports.EditorBlockSchema=e.EditorBlockSchema;exports.EditorConfigurationSchema=e.EditorConfigurationSchema;exports.EmailBuilder=e.EmailBuilder;exports.EmailLayoutPropsSchema=e.EmailLayoutPropsSchema;exports.FONT_FAMILY_NAMES=e.FONT_FAMILY_NAMES;exports.FONT_FAMILY_SCHEMA=e.FONT_FAMILY_SCHEMA;exports.ImagePropsSchema=e.ImagePropsSchema;exports.NotionTextPropsSchema=e.NotionTextPropsSchema;exports.PADDING_SCHEMA=e.PADDING_SCHEMA;exports.SHAPE_SCHEMA=e.SHAPE_SCHEMA;exports.SocialMediaPropsSchema=e.SocialMediaPropsSchema;exports.SpacerPropsSchema=e.SpacerPropsSchema;exports.default=e.EmailBuilder;exports.registerEmailBuilder=e.registerEmailBuilder;exports.validateDocument=e.validateDocument;
package/dist/index.mjs CHANGED
@@ -1,5 +1,5 @@
1
1
  import "react/jsx-runtime";
2
- import { n as r, B as i, C as m, e as S, f as t, D as c, l as E, m as p, E as P, i as h, d as l, F as n, I as C, N as d, P as A, S as u, j as M, k as _, E as B, r as N, v as D } from "./index-BGFPP7q7.js";
2
+ import { n as r, B as i, C as m, e as S, f as t, D as c, l as E, m as p, E as P, i as h, d as l, F as n, I as C, N as d, P as A, S as u, j as M, k as _, E as B, r as N, v as D } from "./index-BbHkacvu.js";
3
3
  import "react";
4
4
  export {
5
5
  r as BLOCK_TYPES,
@@ -0,0 +1 @@
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const r=require("./index-4qATIPiQ.cjs"),d=200,g=6e3;let i=!1,y=!1;function T(e){return new Promise((t,a)=>{const o=new FileReader;o.onload=()=>t(o.result),o.onerror=a,o.readAsDataURL(e)})}function u(e){return new Promise(t=>setTimeout(t,e))}function p(e){try{const t=localStorage.getItem(e),a=t?JSON.parse(t):[];return Array.isArray(a)?a:[]}catch{return[]}}async function h(){if(i||r.getComponentsStorageMode()!=="local")return;i=!0;let e=0;try{const t=[{storageKey:"eb:lib:sections",isTemplate:!1},{storageKey:"eb:lib:layouts",isTemplate:!1},{storageKey:"eb:lib:templates",isTemplate:!0}];for(const{storageKey:a,isTemplate:o}of t){const b=p(a);for(const n of b)if(!(r.hasLocalThumbnail(n.id)||!n.blocks?.length)){for(;y;)await u(500);try{const l={};for(const s of n.blocks)l[s.id]=s.block;const m=o?"root":n.blocks[0].id,f=r.buildSubtreeHtml(l,m),c=await r.captureSubtreeThumbnail(f,{timeoutMs:g});if(c){const s=await T(c);r.setLocalThumbnail(n.id,s),e++}}catch{}await u(d)}}}finally{i=!1,e>0&&r.bumpComponentsLibraryRefresh()}}exports.generateMissingThumbnails=h;
@@ -0,0 +1,55 @@
1
+ import { g as f, h as d, a as y, c as T, s as g, b as p } from "./standalone-Dal2ieNb.js";
2
+ const h = 200, w = 6e3;
3
+ let n = !1, M = !1;
4
+ function S(e) {
5
+ return new Promise((t, a) => {
6
+ const o = new FileReader();
7
+ o.onload = () => t(o.result), o.onerror = a, o.readAsDataURL(e);
8
+ });
9
+ }
10
+ function c(e) {
11
+ return new Promise((t) => setTimeout(t, e));
12
+ }
13
+ function A(e) {
14
+ try {
15
+ const t = localStorage.getItem(e), a = t ? JSON.parse(t) : [];
16
+ return Array.isArray(a) ? a : [];
17
+ } catch {
18
+ return [];
19
+ }
20
+ }
21
+ async function R() {
22
+ if (n || f() !== "local") return;
23
+ n = !0;
24
+ let e = 0;
25
+ try {
26
+ const t = [
27
+ { storageKey: "eb:lib:sections", isTemplate: !1 },
28
+ { storageKey: "eb:lib:layouts", isTemplate: !1 },
29
+ { storageKey: "eb:lib:templates", isTemplate: !0 }
30
+ ];
31
+ for (const { storageKey: a, isTemplate: o } of t) {
32
+ const u = A(a);
33
+ for (const s of u)
34
+ if (!(d(s.id) || !s.blocks?.length)) {
35
+ for (; M; ) await c(500);
36
+ try {
37
+ const l = {};
38
+ for (const r of s.blocks) l[r.id] = r.block;
39
+ const b = o ? "root" : s.blocks[0].id, m = y(l, b), i = await T(m, { timeoutMs: w });
40
+ if (i) {
41
+ const r = await S(i);
42
+ g(s.id, r), e++;
43
+ }
44
+ } catch {
45
+ }
46
+ await c(h);
47
+ }
48
+ }
49
+ } finally {
50
+ n = !1, e > 0 && p();
51
+ }
52
+ }
53
+ export {
54
+ R as generateMissingThumbnails
55
+ };
@@ -0,0 +1,55 @@
1
+ import { g as f, h as d, a as y, c as T, s as g, b as p } from "./index-BbHkacvu.js";
2
+ const h = 200, w = 6e3;
3
+ let n = !1, M = !1;
4
+ function S(e) {
5
+ return new Promise((t, a) => {
6
+ const o = new FileReader();
7
+ o.onload = () => t(o.result), o.onerror = a, o.readAsDataURL(e);
8
+ });
9
+ }
10
+ function c(e) {
11
+ return new Promise((t) => setTimeout(t, e));
12
+ }
13
+ function A(e) {
14
+ try {
15
+ const t = localStorage.getItem(e), a = t ? JSON.parse(t) : [];
16
+ return Array.isArray(a) ? a : [];
17
+ } catch {
18
+ return [];
19
+ }
20
+ }
21
+ async function R() {
22
+ if (n || f() !== "local") return;
23
+ n = !0;
24
+ let e = 0;
25
+ try {
26
+ const t = [
27
+ { storageKey: "eb:lib:sections", isTemplate: !1 },
28
+ { storageKey: "eb:lib:layouts", isTemplate: !1 },
29
+ { storageKey: "eb:lib:templates", isTemplate: !0 }
30
+ ];
31
+ for (const { storageKey: a, isTemplate: o } of t) {
32
+ const u = A(a);
33
+ for (const s of u)
34
+ if (!(d(s.id) || !s.blocks?.length)) {
35
+ for (; M; ) await c(500);
36
+ try {
37
+ const l = {};
38
+ for (const r of s.blocks) l[r.id] = r.block;
39
+ const b = o ? "root" : s.blocks[0].id, m = y(l, b), i = await T(m, { timeoutMs: w });
40
+ if (i) {
41
+ const r = await S(i);
42
+ g(s.id, r), e++;
43
+ }
44
+ } catch {
45
+ }
46
+ await c(h);
47
+ }
48
+ }
49
+ } finally {
50
+ n = !1, e > 0 && p();
51
+ }
52
+ }
53
+ export {
54
+ R as generateMissingThumbnails
55
+ };