@useinsider/guido 3.2.0-beta.40feab8 → 3.2.0-beta.44889a0
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/composables/useSave.js +18 -21
- package/dist/config/compiler/recommendationCompilerRules.js +27 -27
- package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/esm/index.js +258 -235
- package/dist/package.json.js +1 -1
- package/package.json +3 -3
- package/dist/composables/validators/useCouponBlockValidator.js +0 -24
- package/dist/src/composables/validators/useCouponBlockValidator.d.ts +0 -3
|
@@ -1,32 +1,29 @@
|
|
|
1
|
-
import { useActionsApi as
|
|
2
|
-
import { useConfig as
|
|
3
|
-
import { useSaveStart as
|
|
4
|
-
import { useSyncModuleExtractor as
|
|
5
|
-
import { useStripoApi as
|
|
6
|
-
import { useTemplatePreparation as
|
|
7
|
-
import { useHtmlValidator as
|
|
8
|
-
import {
|
|
9
|
-
|
|
10
|
-
const
|
|
11
|
-
|
|
12
|
-
return { save: async (p = !1) => {
|
|
1
|
+
import { useActionsApi as S } from "./useActionsApi.js";
|
|
2
|
+
import { useConfig as V } from "./useConfig.js";
|
|
3
|
+
import { useSaveStart as x, useSaveComplete as y } from "./useGuidoActions.js";
|
|
4
|
+
import { useSyncModuleExtractor as w } from "./useSyncModuleExtractor.js";
|
|
5
|
+
import { useStripoApi as b } from "../services/stripoApi.js";
|
|
6
|
+
import { useTemplatePreparation as q } from "../utils/templatePreparation.js";
|
|
7
|
+
import { useHtmlValidator as H } from "./useHtmlValidator.js";
|
|
8
|
+
import { useLiquidValidator as L } from "./validators/useLiquidValidator.js";
|
|
9
|
+
const F = () => {
|
|
10
|
+
const o = x(), s = y(), { validateHtml: r } = H(), { validateLiquidSyntax: n } = L(), { callbacks: a, isFeatureEnabled: l } = V(), { extractSyncModuleData: d } = w(), { setSyncModuleUnsubscriptionPages: u } = b(), { editorSave: c } = S();
|
|
11
|
+
return { save: async (m = !1) => {
|
|
13
12
|
var i;
|
|
14
13
|
o();
|
|
15
|
-
const { prepareTemplateDetails:
|
|
16
|
-
if (
|
|
17
|
-
|
|
18
|
-
if (d("liquidSyntax")) {
|
|
19
|
-
if (!await l(t.compiledHtml))
|
|
14
|
+
const { prepareTemplateDetails: p } = q(), t = await p();
|
|
15
|
+
if (l("liquidSyntax")) {
|
|
16
|
+
if (!await n(t.compiledHtml))
|
|
20
17
|
return;
|
|
21
18
|
} else if (!await r(t.compiledHtml, t.dynamicContentList, !0))
|
|
22
19
|
return;
|
|
23
20
|
if ((i = a.value) != null && i.externalValidation && !await a.value.externalValidation(t))
|
|
24
21
|
return;
|
|
25
|
-
await
|
|
26
|
-
const { unsubscribePayload:
|
|
27
|
-
return await
|
|
22
|
+
await c();
|
|
23
|
+
const { unsubscribePayload: f, stripoModules: v } = d(t.rawHtml);
|
|
24
|
+
return await u(f), t.modules = v, m || s(t), t;
|
|
28
25
|
} };
|
|
29
26
|
};
|
|
30
27
|
export {
|
|
31
|
-
|
|
28
|
+
F as useSave
|
|
32
29
|
};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { useRecommendation as
|
|
2
|
-
import { DUMMY_IMAGE_MAPPINGS as
|
|
1
|
+
import { useRecommendation as N } from "../../composables/useRecommendation.js";
|
|
2
|
+
import { DUMMY_IMAGE_MAPPINGS as y, REGEX as T, VerticalOrientation as M, CSS as E, ATTRIBUTES as A, CONDITIONS as g, HTML as h } from "../../enums/recommendation.js";
|
|
3
3
|
import { prepareRecommendationBlocks as x } from "./utils/recommendationCompilerUtils.js";
|
|
4
4
|
const w = [
|
|
5
5
|
{
|
|
@@ -8,7 +8,7 @@ const w = [
|
|
|
8
8
|
type: "custom",
|
|
9
9
|
processor: (c) => {
|
|
10
10
|
let e = c;
|
|
11
|
-
return Object.entries(
|
|
11
|
+
return Object.entries(y).forEach(([, l]) => {
|
|
12
12
|
Object.entries(l).forEach(([n, s]) => {
|
|
13
13
|
e = e.replaceAll(s, `{{${n}}}`);
|
|
14
14
|
});
|
|
@@ -30,13 +30,13 @@ const w = [
|
|
|
30
30
|
description: "Adding recommendation unresponsive css",
|
|
31
31
|
type: "custom",
|
|
32
32
|
processor: (c) => {
|
|
33
|
-
const { calculateCardWidth: e, getRecommendationCampaignData: l } =
|
|
33
|
+
const { calculateCardWidth: e, getRecommendationCampaignData: l } = N();
|
|
34
34
|
let n = c;
|
|
35
35
|
const s = n.match(T.ID);
|
|
36
36
|
if (s) {
|
|
37
37
|
const a = [];
|
|
38
38
|
if (s.forEach((i) => {
|
|
39
|
-
const
|
|
39
|
+
const u = /recommendation-id="(.*?)"/i.exec(i), _ = u ? u[1].trim() : "", R = l(_);
|
|
40
40
|
R.textTrimming && R.orientation === M && a.push(e(R));
|
|
41
41
|
}), a.length) {
|
|
42
42
|
const i = `width:${Math.min(...a)}px!important;`;
|
|
@@ -60,25 +60,25 @@ const w = [
|
|
|
60
60
|
type: "custom",
|
|
61
61
|
processor: (c) => {
|
|
62
62
|
let e = c;
|
|
63
|
-
const l = e.match(T.ATTRIBUTE_PARAGRAPH), { getRecommendationCampaignData: n } =
|
|
63
|
+
const l = e.match(T.ATTRIBUTE_PARAGRAPH), { getRecommendationCampaignData: n } = N();
|
|
64
64
|
return l !== null && l.forEach((s) => {
|
|
65
65
|
const a = s.match(T.CUSTOM_FIELD);
|
|
66
66
|
if (!a)
|
|
67
67
|
return;
|
|
68
|
-
const [i] = a,
|
|
69
|
-
if (!
|
|
68
|
+
const [i] = a, u = i.match(T.CUSTOM_FIELD_INDEXES_PART), _ = i.match(T.CUSTOM_FIELD_NAME_PART), R = s.match(T.ATTRIBUTE_PARAGRAPH_START_TAG);
|
|
69
|
+
if (!u || !_ || !R)
|
|
70
70
|
return;
|
|
71
|
-
const [S] =
|
|
71
|
+
const [S] = u, [b] = _, [d] = R, o = b.substring(1, b.length - 2), r = d.match(T.COMPOSITION) !== null;
|
|
72
72
|
let t = i;
|
|
73
73
|
if (r) {
|
|
74
|
-
const I = S.substring(2, S.length - 3),
|
|
75
|
-
o === A.OMNIBUS_PRICE && (
|
|
74
|
+
const I = S.substring(2, S.length - 3), m = n(I);
|
|
75
|
+
o === A.OMNIBUS_PRICE && (m.priceBeforeTextValue && (t = `${m.priceBeforeTextValue}${t}`), m.priceAfterTextValue && (t = `${t}${m.priceAfterTextValue}`)), o === A.OMNIBUS_DISCOUNT && (m.discountBeforeTextValue && (t = `${m.discountBeforeTextValue}${t}`), m.discountAfterTextValue && (t = `${t}${m.discountAfterTextValue}`));
|
|
76
76
|
}
|
|
77
|
-
const
|
|
77
|
+
const p = S.substring(2);
|
|
78
78
|
let f = "";
|
|
79
|
-
o in g.IF && (f = g.IF[o].replaceAll(`{${A.DISCOUNT}}`, `${
|
|
80
|
-
const $ = `${
|
|
81
|
-
e = e.replace(s,
|
|
79
|
+
o in g.IF && (f = g.IF[o].replaceAll(`{${A.DISCOUNT}}`, `${p}${A.DISCOUNT}`).replaceAll(`{${A.OMNIBUS_DISCOUNT}}`, `${p}${A.OMNIBUS_DISCOUNT}`).replaceAll(`{${A.OMNIBUS_PRICE}}`, `${p}${A.OMNIBUS_PRICE}`));
|
|
80
|
+
const $ = `${d}${t}${h.PARAGRAPH_END_TAG}`, C = `${f}${r ? $ : s}${g.ELSE}${d}${h.PARAGRAPH_END_TAG}${g.END_IF}`;
|
|
81
|
+
e = e.replace(s, C);
|
|
82
82
|
}), e;
|
|
83
83
|
},
|
|
84
84
|
priority: 53
|
|
@@ -136,7 +136,7 @@ const w = [
|
|
|
136
136
|
/@media[^{]*max-width\s*:\s*480px[^{]*\{((?:[^{}]*\{[^{}]*\})*[^{}]*)\}/g,
|
|
137
137
|
(l, n) => {
|
|
138
138
|
const s = n.match(/[^{}]+\{[^{}]*\}/g) || [], a = /ins-recommendation|product-image-cell|button-cell|product-info-cell/;
|
|
139
|
-
return s.every((
|
|
139
|
+
return s.every((u) => a.test(u)) ? "" : l;
|
|
140
140
|
}
|
|
141
141
|
)), e;
|
|
142
142
|
},
|
|
@@ -151,7 +151,7 @@ const w = [
|
|
|
151
151
|
/<a\b[^>]*\bes-button\b[^>]*>/g,
|
|
152
152
|
(o) => o.replace(
|
|
153
153
|
/([;"]color:)([^;"]+)/g,
|
|
154
|
-
(r, t,
|
|
154
|
+
(r, t, p) => p.includes("!important") ? r : `${t}${p} !important`
|
|
155
155
|
)
|
|
156
156
|
), l = /<!--REC_START-->([\s\S]*?)<!--REC_END-->/g, n = / style="([^"]*)"/g, s = /* @__PURE__ */ new Map();
|
|
157
157
|
let a = l.exec(e);
|
|
@@ -163,12 +163,12 @@ const w = [
|
|
|
163
163
|
}
|
|
164
164
|
n.lastIndex = 0, a = l.exec(e);
|
|
165
165
|
}
|
|
166
|
-
const i = /* @__PURE__ */ new Map(),
|
|
166
|
+
const i = /* @__PURE__ */ new Map(), u = [];
|
|
167
167
|
let _ = 0;
|
|
168
168
|
if (s.forEach((o, r) => {
|
|
169
169
|
if (o >= 6) {
|
|
170
|
-
const t = `rc${_++}
|
|
171
|
-
i.set(r, t),
|
|
170
|
+
const t = `rc${_++}`, p = r.endsWith(";") ? r : `${r};`;
|
|
171
|
+
i.set(r, t), u.push(`.${t}{${p}}`);
|
|
172
172
|
}
|
|
173
173
|
}), i.size === 0) {
|
|
174
174
|
let o = e;
|
|
@@ -182,23 +182,23 @@ const w = [
|
|
|
182
182
|
caseB: new RegExp(` style="${t}"((?:[^>]*?))(class="[^"]*")`, "g")
|
|
183
183
|
});
|
|
184
184
|
});
|
|
185
|
-
let
|
|
186
|
-
return
|
|
185
|
+
let d = e.replace("</style>", `${u.join("")}</style>`);
|
|
186
|
+
return d = d.replace(
|
|
187
187
|
/<!--REC_START-->([\s\S]*?)<!--REC_END-->/g,
|
|
188
188
|
(o, r) => {
|
|
189
189
|
let t = r;
|
|
190
|
-
return i.forEach((
|
|
190
|
+
return i.forEach((p, f) => {
|
|
191
191
|
const $ = b.get(f);
|
|
192
192
|
t = t.replace(
|
|
193
193
|
$.caseA,
|
|
194
|
-
(
|
|
194
|
+
(C, I, m) => S(I, p) + m
|
|
195
195
|
), t = t.replace(
|
|
196
196
|
$.caseB,
|
|
197
|
-
(
|
|
198
|
-
), t = t.replaceAll(` style="${f}"`, ` class="${
|
|
197
|
+
(C, I, m) => I + S(m, p)
|
|
198
|
+
), t = t.replaceAll(` style="${f}"`, ` class="${p}"`);
|
|
199
199
|
}), t;
|
|
200
200
|
}
|
|
201
|
-
),
|
|
201
|
+
), d = d.replaceAll("<!--REC_START-->", ""), d = d.replaceAll("<!--REC_END-->", ""), d;
|
|
202
202
|
},
|
|
203
203
|
priority: 58
|
|
204
204
|
}
|
|
@@ -1,17 +1,17 @@
|
|
|
1
|
-
var
|
|
1
|
+
var x = class d {
|
|
2
2
|
/**
|
|
3
3
|
* Validates that all required methods are properly implemented in the subclass.
|
|
4
4
|
* @param requiredMethods - Array of method names that must be implemented
|
|
5
5
|
* @param classRef - Reference to the class constructor for validation caching
|
|
6
6
|
*/
|
|
7
|
-
constructor(t,
|
|
8
|
-
if (
|
|
9
|
-
d.validatedClasses.has(
|
|
10
|
-
const
|
|
11
|
-
if (
|
|
7
|
+
constructor(t, r) {
|
|
8
|
+
if (r !== d) {
|
|
9
|
+
d.validatedClasses.has(r) || this.validateImplementation(t, r);
|
|
10
|
+
const s = d.validationErrors.get(r);
|
|
11
|
+
if (s && s.length > 0)
|
|
12
12
|
throw new Error(
|
|
13
|
-
`${
|
|
14
|
-
${
|
|
13
|
+
`${r.name} has validation errors:
|
|
14
|
+
${s.map((o) => ` - ${o}`).join(`
|
|
15
15
|
`)}`
|
|
16
16
|
);
|
|
17
17
|
}
|
|
@@ -20,16 +20,16 @@ ${i.map((o) => ` - ${o}`).join(`
|
|
|
20
20
|
* Validates that all required methods are properly implemented in the subclass.
|
|
21
21
|
* This validation runs only once per class type and results are cached.
|
|
22
22
|
*/
|
|
23
|
-
validateImplementation(t,
|
|
24
|
-
var
|
|
25
|
-
const
|
|
23
|
+
validateImplementation(t, r) {
|
|
24
|
+
var y;
|
|
25
|
+
const s = [], o = r.name, W = Object.getPrototypeOf(this);
|
|
26
26
|
t.forEach((u) => {
|
|
27
27
|
if (typeof this[u] != "function") {
|
|
28
|
-
|
|
28
|
+
s.push(`Method ${u}() is not defined`);
|
|
29
29
|
return;
|
|
30
30
|
}
|
|
31
|
-
|
|
32
|
-
}), d.validatedClasses.add(
|
|
31
|
+
W[u] === r.prototype[u] && s.push(`Method ${u}() must be implemented (currently using base class error-throwing implementation)`);
|
|
32
|
+
}), d.validatedClasses.add(r), s.length > 0 ? (d.validationErrors.set(r, s), console.error(`[${o} Validation] ${o} validation failed:`, s)) : typeof process < "u" && ((y = process.env) == null ? void 0 : y.NODE_ENV) === "development" && console.log(`[${o} Validation] ✅ ${o} validated successfully`);
|
|
33
33
|
}
|
|
34
34
|
/**
|
|
35
35
|
* Lifecycle method for cleaning up resources (e.g., removing DOM artifacts from document.body).
|
|
@@ -39,9 +39,9 @@ ${i.map((o) => ` - ${o}`).join(`
|
|
|
39
39
|
destroy() {
|
|
40
40
|
}
|
|
41
41
|
};
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
var
|
|
42
|
+
x.validatedClasses = /* @__PURE__ */ new Set();
|
|
43
|
+
x.validationErrors = /* @__PURE__ */ new Map();
|
|
44
|
+
var i = x, z = /* @__PURE__ */ ((e) => (e.BLOCK = "BLOCK", e.CONTAINER = "CONTAINER", e.STRUCTURE = "STRUCTURE", e.STRIPE = "STRIPE", e))(z || {}), P = class T extends i {
|
|
45
45
|
constructor() {
|
|
46
46
|
super(T.REQUIRED_METHODS, T);
|
|
47
47
|
}
|
|
@@ -160,6 +160,9 @@ var s = B, W = /* @__PURE__ */ ((e) => (e.BLOCK = "BLOCK", e.CONTAINER = "CONTAI
|
|
|
160
160
|
allowInnerBlocksDND() {
|
|
161
161
|
return !0;
|
|
162
162
|
}
|
|
163
|
+
allowInteractWithAMPWhenSelected() {
|
|
164
|
+
return !0;
|
|
165
|
+
}
|
|
163
166
|
/**
|
|
164
167
|
* Gets the unique identifier for this block type.
|
|
165
168
|
* This ID is used for registration and referencing the block.
|
|
@@ -218,15 +221,14 @@ var s = B, W = /* @__PURE__ */ ((e) => (e.BLOCK = "BLOCK", e.CONTAINER = "CONTAI
|
|
|
218
221
|
throw new Error("Method getDescription() must be implemented by the subclass");
|
|
219
222
|
}
|
|
220
223
|
};
|
|
221
|
-
|
|
222
|
-
var
|
|
224
|
+
P.REQUIRED_METHODS = ["getId", "getTemplate", "getIcon", "getName", "getDescription"];
|
|
225
|
+
var Ze = P, Z = class I extends i {
|
|
223
226
|
constructor() {
|
|
224
227
|
super(I.REQUIRED_METHODS, I);
|
|
225
228
|
}
|
|
226
229
|
/**
|
|
227
230
|
* @deprecated - use {@link getPreviewInnerHtml} instead
|
|
228
231
|
*/
|
|
229
|
-
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
230
232
|
getPreviewHtml(t) {
|
|
231
233
|
}
|
|
232
234
|
/**
|
|
@@ -236,8 +238,8 @@ var $e = y, z = class I extends s {
|
|
|
236
238
|
throw new Error("Method getPreviewInnerHtml() must be implemented by the subclass");
|
|
237
239
|
}
|
|
238
240
|
};
|
|
239
|
-
|
|
240
|
-
var
|
|
241
|
+
Z.REQUIRED_METHODS = ["getPreviewInnerHtml"];
|
|
242
|
+
var qe = class {
|
|
241
243
|
/**
|
|
242
244
|
* Generates HTML representation for a block item
|
|
243
245
|
* @param block - The block item to generate HTML for
|
|
@@ -311,7 +313,7 @@ var We = class {
|
|
|
311
313
|
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
312
314
|
getModulesTabIconName(e) {
|
|
313
315
|
}
|
|
314
|
-
},
|
|
316
|
+
}, q = class b extends i {
|
|
315
317
|
constructor() {
|
|
316
318
|
super(b.REQUIRED_METHODS, b);
|
|
317
319
|
}
|
|
@@ -328,86 +330,86 @@ var We = class {
|
|
|
328
330
|
throw new Error("Method onClick() must be implemented by the subclass");
|
|
329
331
|
}
|
|
330
332
|
};
|
|
331
|
-
|
|
333
|
+
q.REQUIRED_METHODS = ["getId", "getIcon", "getLabel", "onClick"];
|
|
332
334
|
var j = {
|
|
333
335
|
src: "src",
|
|
334
336
|
alt: "alt",
|
|
335
337
|
href: "href",
|
|
336
338
|
width: "width",
|
|
337
339
|
height: "height"
|
|
338
|
-
},
|
|
340
|
+
}, je = {
|
|
339
341
|
BLOCK_IMAGE: j
|
|
340
|
-
},
|
|
341
|
-
BLOCK_BUTTON:
|
|
342
|
-
BLOCK_TEXT:
|
|
343
|
-
BLOCK_IMAGE:
|
|
344
|
-
GENERAL:
|
|
345
|
-
},
|
|
342
|
+
}, U = "esd-block-button", w = "esd-block-text", K = "esd-block-image", J = "esd-structure", ee = "esd-block-video", te = "esd-block-social", re = "esd-block-banner", ae = "esd-block-timer", ne = "esd-block-menu", se = "esd-block-html", ie = "esd-block-spacer", le = "esd-container-frame", Ee = "esd-stripe", oe = "esd-amp-form", c = ((e) => (e.BUTTON = `.${U}`, e.TEXT = `.${w}`, e.IMAGE = `.${K}`, e.STRUCTURE = `.${J}`, e.VIDEO = `.${ee}`, e.SOCIAL = `.${te}`, e.BANNER = `.${re}`, e.TIMER = `.${ae}`, e.MENU = `.${ne}`, e.HTML = `.${se}`, e.SPACER = `.${ie}`, e.CONTAINER = `.${le}`, e.STRIPE = `.${Ee}`, e.FORM = `.${oe}`, e))(c || {}), de = /* @__PURE__ */ ((e) => (e.BLOCK_IMAGE = "BLOCK_IMAGE", e.BLOCK_TEXT = "BLOCK_TEXT", e.BLOCK_BUTTON = "BLOCK_BUTTON", e.BLOCK_SPACER = "BLOCK_SPACER", e.BLOCK_VIDEO = "BLOCK_VIDEO", e.BLOCK_SOCIAL = "BLOCK_SOCIAL", e.BLOCK_BANNER = "BLOCK_BANNER", e.BLOCK_TIMER = "BLOCK_TIMER", e.BLOCK_MENU = "BLOCK_MENU", e.BLOCK_MENU_ITEM = "BLOCK_MENU_ITEM", e.BLOCK_HTML = "BLOCK_HTML", e.BLOCK_AMP_CAROUSEL = "BLOCK_AMP_CAROUSEL", e.BLOCK_AMP_ACCORDION = "BLOCK_AMP_ACCORDION", e.BLOCK_AMP_FORM = "BLOCK_AMP_FORM", e.CONTAINER = "CONTAINER", e.FORM_CONTAINER = "FORM_CONTAINER", e.STRUCTURE = "STRUCTURE", e.STRIPE = "STRIPE", e.EMPTY_CONTAINER = "EMPTY_CONTAINER", e.CUSTOM_BLOCK_LINK = "CUSTOM_BLOCK_LINK", e.CUSTOM_BLOCK_IMAGE = "CUSTOM_BLOCK_IMAGE", e.CUSTOM_BLOCK_TEXT = "CUSTOM_BLOCK_TEXT", e))(de || {}), F = /* @__PURE__ */ ((e) => (e.ANCHOR_LINK_CONTAINER = "anchorLinkFormContainer", e.APPLY_CONDITION = "applyCondition", e.APPLY_CONDITION_SWITCHER = "applyConditionSwitcher", e.BACKGROUND_COLOR = "backgroundColor", e.BACKGROUND_IMAGE = "generalImageContainer", e.TEXT_COLOR = "textColor", e.TEXT_STYLE = "textStyle", e.TEXT_SIZE = "textSize", e.TEXT_LINE_SPACING = "textLineSpacing", e.TEXT_ALIGN = "textAlign", e.FIXED_HEIGHT_SWITCHER = "fixedHeightSwitcherForm", e.HIDDEN_NODE = "hiddenNode", e.SMART_BLOCK = "smartBlock", e.SYNCHRONIZED_MODULE = "synchronizedModuleForm", e.FONT_FAMILY = "generalFontFamilyForm", e.BLOCK_INTERNAL_INDENTS = "generalBlockInternalIndents", e.STRUCTURE_INTERNAL_INDENTS = "generalStructureInternalIndents", e))(F || {}), H = /* @__PURE__ */ ((e) => (e.ADJUST_TO_WIDTH = "adjustToWidth", e.ALIGNMENT = "buttonAlignment", e.BORDER = "buttonBorder", e.BORDER_RADIUS = "buttonBorderRadius", e.COLOR = "buttonColor", e.BUTTON_BLOCK_BACKGROUND_COLOR = "buttonBlockBackgroundColor", e.EXTERNAL_INDENTS = "buttonExternalIndents", e.FIXED_HEIGHT = "buttonFixedHeightForm", e.FONT_COLOR = "buttonFontColor", e.FONT_FAMILY = "buttonFontFamily", e.FONT_SIZE = "buttonFontSize", e.ICON = "buttonIconContainer", e.ICON_ALIGN = "buttonIconAlign", e.ICON_INDENT = "buttonIconIndent", e.ICON_WIDTH = "buttonIconWidth", e.IMAGE = "buttonImageForm", e.INTERNAL_INDENTS = "buttonInternalIndents", e.LINK = "buttonLink", e.MIME_TYPE = "buttonMimeTypeForm", e.SWITCHER_HOVERED_STYLES = "buttonSwitcherHoveredStylesForm", e.TEXT = "buttonText", e.TEXT_STYLE_AND_COLOR = "buttonTextStyleAndColorForm", e.HOVERED_BORDER_COLOR = "hoveredStyleBorderButtonForm", e.HOVERED_COLOR = "hoveredButtonColorForm", e.HOVERED_TEXT_COLOR = "hoveredButtonTextColorForm", e))(H || {}), k = /* @__PURE__ */ ((e) => (e.HIDDEN_NODE = "hiddenNodeText", e.PARAGRAPH_STYLE = "paragraphStyleForm", e.ALIGN = "textAlignmentForm", e.ANCHOR_CONTAINER = "textAnchorForm", e.FONT_BACKGROUND_COLOR = "textBlockFontBackgroundColor", e.TEXT_BLOCK_BACKGROUND_COLOR = "textBlockBackgroundColor", e.FONT_COLOR = "textBlockFontColor", e.TEXT_BLOCK_FONT_FAMILY = "textBlockFontFamily", e.FONT_FAMILY = "textFontFamily", e.FONT_SIZE = "textBlockFontSize", e.FONT_WEIGHT = "textBlockFontWeight", e.DIRECTION = "textBlockDirectionForm", e.INSERT_FORM = "textBlockInsertForm", e.LINK_DATA = "textBlockLinkDataForm", e.FORMAT = "textBlockTextFormatForm", e.FIXED_HEIGHT = "textFixedHeightForm", e.INTERNAL_INDENTS = "textInternalIndents", e.LINE_HEIGHT = "textLineHeightForm", e.MIME_TYPE = "textMimeTypeForm", e.NO_LINE_WRAPS = "textNoLineWrapsForm", e))(k || {}), p = /* @__PURE__ */ ((e) => (e.ALT_TEXT = "altText", e.LINK = "blockLink", e.ALIGNMENT = "imageAlignment", e.ANCHOR_LINK_CONTAINER = "imageAnchorLinkContainerForm", e.BORDER_RADIUS = "imageBorderRadiusForm", e.IMAGE = "imageImageForm", e.EXTERNAL_INDENTS = "imageExternalIndents", e.MIME_TYPE = "imageMimeTypeForm", e.RESPONSIVE = "imageResponsive", e.ROLLOVER_IMAGE = "imageRolloverImageForm", e.ROLLOVER_SWITCHER = "imageRolloverSwitcherForm", e.SIZE = "imageSizeContainer", e))(p || {}), ue = /* @__PURE__ */ ((e) => (e.BACKGROUND_COLOR = "containerBackgroundColorForm", e.BORDER_FORM = "containerBorderForm", e.BORDER_RADIUS = "containerBorderRadiusForm", e.EXTERNAL_INDENTS = "containerExternalIndentsForm", e.IMAGE_CONTAINER = "containerImageContainerForm", e.MIME_TYPE = "containerMimeTypeForm", e.DISPLAY_CONDITIONS = "displayConditions", e.HIDDEN_NODE = "containerHiddenNodeForm", e))(ue || {}), n = {
|
|
343
|
+
BLOCK_BUTTON: H,
|
|
344
|
+
BLOCK_TEXT: k,
|
|
345
|
+
BLOCK_IMAGE: p,
|
|
346
|
+
GENERAL: F
|
|
347
|
+
}, ce = /* @__PURE__ */ ((e) => (e.previewDeviceMode = "previewDeviceMode", e.panelPosition = "panelPosition", e.themeMode = "themeMode", e))(ce || {}), Te = /* @__PURE__ */ ((e) => (e.DESKTOP = "DESKTOP", e.MOBILE = "MOBILE", e))(Te || {}), Ie = /* @__PURE__ */ ((e) => (e.SETTINGS = "settings", e.STYLES = "styles", e.DATA = "data", e))(Ie || {}), a = {
|
|
346
348
|
name: "name",
|
|
347
349
|
disabled: "disabled"
|
|
348
|
-
},
|
|
349
|
-
...
|
|
350
|
+
}, be = {
|
|
351
|
+
...a,
|
|
350
352
|
caption: "caption",
|
|
351
353
|
icon: "icon"
|
|
352
|
-
}, be = {
|
|
353
|
-
...r,
|
|
354
|
-
caption: "caption"
|
|
355
354
|
}, he = {
|
|
356
|
-
...
|
|
355
|
+
...a,
|
|
356
|
+
caption: "caption"
|
|
357
|
+
}, me = {
|
|
358
|
+
...a,
|
|
357
359
|
minValue: "min-value",
|
|
358
360
|
maxValue: "max-value",
|
|
359
361
|
step: "step"
|
|
360
|
-
},
|
|
361
|
-
...
|
|
362
|
+
}, ge = {
|
|
363
|
+
...a,
|
|
362
364
|
placeholder: "placeholder",
|
|
363
365
|
minDate: "min-date"
|
|
364
|
-
},
|
|
365
|
-
...
|
|
366
|
+
}, Oe = {
|
|
367
|
+
...a,
|
|
366
368
|
text: "text",
|
|
367
369
|
hint: "hint"
|
|
368
|
-
}, Oe = {
|
|
369
|
-
...r,
|
|
370
|
-
type: "type"
|
|
371
370
|
}, Re = {
|
|
372
|
-
...
|
|
371
|
+
...a,
|
|
372
|
+
type: "type"
|
|
373
|
+
}, Le = {
|
|
374
|
+
...a,
|
|
373
375
|
buttons: "buttons"
|
|
374
|
-
},
|
|
375
|
-
...
|
|
376
|
+
}, X = {
|
|
377
|
+
...a,
|
|
376
378
|
searchable: "searchable",
|
|
377
379
|
multiSelect: "multi-select",
|
|
378
380
|
placeholder: "placeholder",
|
|
379
381
|
items: "items"
|
|
380
|
-
}, Le = {
|
|
381
|
-
...p,
|
|
382
|
-
addCustomFontOption: "add-custom-font-option"
|
|
383
382
|
}, _e = {
|
|
384
|
-
...
|
|
383
|
+
...X,
|
|
384
|
+
addCustomFontOption: "add-custom-font-option"
|
|
385
|
+
}, Ce = {
|
|
386
|
+
...a,
|
|
385
387
|
text: "text",
|
|
386
388
|
value: "value"
|
|
387
|
-
},
|
|
388
|
-
...
|
|
389
|
+
}, Ae = {
|
|
390
|
+
...a,
|
|
389
391
|
text: "text",
|
|
390
392
|
hint: "hint",
|
|
391
393
|
icon: "icon",
|
|
392
394
|
value: "value"
|
|
393
|
-
}, Ae = {
|
|
394
|
-
...r,
|
|
395
|
-
buttons: "buttons"
|
|
396
395
|
}, Ne = {
|
|
397
|
-
...
|
|
396
|
+
...a,
|
|
397
|
+
buttons: "buttons"
|
|
398
|
+
}, De = {
|
|
399
|
+
...a,
|
|
398
400
|
text: "text",
|
|
399
401
|
hint: "hint",
|
|
400
402
|
icon: "icon",
|
|
401
403
|
value: "value"
|
|
402
|
-
}, De = {
|
|
403
|
-
...r,
|
|
404
|
-
placeholder: "placeholder"
|
|
405
404
|
}, Se = {
|
|
406
|
-
...
|
|
407
|
-
resizable: "resizable",
|
|
405
|
+
...a,
|
|
408
406
|
placeholder: "placeholder"
|
|
409
407
|
}, Me = {
|
|
410
|
-
...
|
|
408
|
+
...a,
|
|
409
|
+
resizable: "resizable",
|
|
410
|
+
placeholder: "placeholder"
|
|
411
|
+
}, Be = {
|
|
412
|
+
...a,
|
|
411
413
|
img: "img",
|
|
412
414
|
src: "src",
|
|
413
415
|
title: "title",
|
|
@@ -417,54 +419,61 @@ var j = {
|
|
|
417
419
|
isActive: "is-active",
|
|
418
420
|
visibility: "visibility",
|
|
419
421
|
transform: "transform"
|
|
420
|
-
}, Be = {
|
|
421
|
-
...r,
|
|
422
|
-
controlId: "control-id"
|
|
423
422
|
}, xe = {
|
|
424
|
-
...
|
|
425
|
-
|
|
423
|
+
...a,
|
|
424
|
+
controlId: "control-id"
|
|
426
425
|
}, ve = {
|
|
427
|
-
...
|
|
426
|
+
...a,
|
|
427
|
+
expanded: "expanded"
|
|
428
|
+
}, ye = {
|
|
429
|
+
...a,
|
|
428
430
|
icon: "icon",
|
|
429
431
|
position: "position"
|
|
430
|
-
}, ye = {
|
|
431
|
-
...r
|
|
432
432
|
}, Pe = {
|
|
433
|
-
...
|
|
434
|
-
icon: "icon"
|
|
433
|
+
...a
|
|
435
434
|
}, Ue = {
|
|
436
|
-
...
|
|
435
|
+
...a,
|
|
436
|
+
icon: "icon"
|
|
437
437
|
}, we = {
|
|
438
|
-
...
|
|
438
|
+
...a
|
|
439
|
+
}, Ke = {
|
|
440
|
+
...a,
|
|
439
441
|
blockId: "block-id"
|
|
440
|
-
},
|
|
441
|
-
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
|
|
445
|
-
|
|
446
|
-
|
|
447
|
-
|
|
448
|
-
|
|
449
|
-
|
|
450
|
-
|
|
451
|
-
|
|
452
|
-
|
|
453
|
-
|
|
454
|
-
|
|
455
|
-
|
|
456
|
-
|
|
457
|
-
|
|
458
|
-
|
|
459
|
-
|
|
460
|
-
|
|
461
|
-
|
|
462
|
-
|
|
463
|
-
|
|
464
|
-
|
|
465
|
-
|
|
466
|
-
|
|
467
|
-
|
|
442
|
+
}, Fe = {
|
|
443
|
+
...a
|
|
444
|
+
}, He = {
|
|
445
|
+
...a,
|
|
446
|
+
placeholder: "placeholder"
|
|
447
|
+
}, Je = {
|
|
448
|
+
DEFAULT: a,
|
|
449
|
+
BUTTON: be,
|
|
450
|
+
CHECKBOX: he,
|
|
451
|
+
CHECK_BUTTONS: Ne,
|
|
452
|
+
COLOR: a,
|
|
453
|
+
COUNTER: me,
|
|
454
|
+
DATEPICKER: ge,
|
|
455
|
+
LABEL: Oe,
|
|
456
|
+
MESSAGE: Re,
|
|
457
|
+
RADIO_BUTTONS: Le,
|
|
458
|
+
SELECTPICKER: X,
|
|
459
|
+
FONT_FAMILY_SELECT: _e,
|
|
460
|
+
SWITCHER: a,
|
|
461
|
+
TEXT: Se,
|
|
462
|
+
TEXTAREA: Me,
|
|
463
|
+
ICON: Be,
|
|
464
|
+
CHECK_ITEM: Ae,
|
|
465
|
+
SELECT_ITEM: Ce,
|
|
466
|
+
RADIO_ITEM: De,
|
|
467
|
+
NESTED_CONTROL: xe,
|
|
468
|
+
EXPANDABLE: ve,
|
|
469
|
+
ORDERABLE: ye,
|
|
470
|
+
ORDERABLE_ITEM: Pe,
|
|
471
|
+
ORDERABLE_ICON: Ue,
|
|
472
|
+
REPEATABLE: we,
|
|
473
|
+
DRAGGABLE_BLOCK: Ke,
|
|
474
|
+
AMP_FORM_SERVICE_PICKER: Fe,
|
|
475
|
+
MULTIPLE_SELECT: He
|
|
476
|
+
}, ke = /* @__PURE__ */ ((e) => (e.BUTTON = "UE-BUTTON", e.CHECKBOX = "UE-CHECKBOX", e.CHECK_BUTTONS = "UE-CHECK-BUTTONS", e.COLOR = "UE-COLOR", e.COUNTER = "UE-COUNTER", e.DATEPICKER = "UE-DATEPICKER", e.LABEL = "UE-LABEL", e.MESSAGE = "UE-MESSAGE", e.RADIO_BUTTONS = "UE-RADIO-BUTTONS", e.SELECTPICKER = "UE-SELECT", e.SWITCHER = "UE-SWITCHER", e.TEXT = "UE-TEXT", e.TEXTAREA = "UE-TEXTAREA", e.CHECK_ITEM = "UE-CHECK-ITEM", e.RADIO_ITEM = "UE-RADIO-ITEM", e.SELECT_ITEM = "UE-SELECT-ITEM", e.ICON = "UE-ICON", e.MERGETAGS = "UE-MERGETAGS", e.FONT_FAMILY_SELECT = "UE-FONT-FAMILY-SELECT", e.NESTED_CONTROL = "UE-NESTED-CONTROL", e.EXPANDABLE = "UE-EXPANDABLE", e.EXPANDABLE_HEADER = "UE-EXPANDABLE_HEADER", e.EXPANDABLE_CONTENT = "UE-EXPANDABLE_CONTENT", e.ORDERABLE = "UE-ORDERABLE", e.ORDERABLE_ITEM = "UE-ORDERABLE-ITEM", e.ORDERABLE_ICON = "UE-ORDERABLE-ICON", e.REPEATABLE = "UE-REPEATABLE", e.DRAGGABLE_BLOCK = "UE-DRAGGABLE-BLOCK", e.AMP_FORM_SERVICE_PICKER = "UE-AMP-FORM-SERVICE-PICKER", e.MULTIPLE_SELECT = "UE-MULTIPLE_SELECT", e.SCROLLABLE = "UE-SCROLLABLE-CONTAINER", e))(ke || {}), v = class {
|
|
468
477
|
/**
|
|
469
478
|
* @description returns map of nodes parent control operates on
|
|
470
479
|
*/
|
|
@@ -495,66 +504,66 @@ var j = {
|
|
|
495
504
|
isVisible(e) {
|
|
496
505
|
return !0;
|
|
497
506
|
}
|
|
498
|
-
}, l = class extends
|
|
507
|
+
}, l = class extends v {
|
|
499
508
|
getTargetNodes(e) {
|
|
500
|
-
const t = e.querySelectorAll(c.BUTTON),
|
|
501
|
-
return t.length ? t :
|
|
509
|
+
const t = e.querySelectorAll(c.BUTTON), r = e.asElement().hasClass(U) ? [e] : [];
|
|
510
|
+
return t.length ? t : r;
|
|
502
511
|
}
|
|
503
|
-
},
|
|
512
|
+
}, et = class extends l {
|
|
504
513
|
getParentControlId() {
|
|
505
514
|
return n.BLOCK_BUTTON.BORDER_RADIUS;
|
|
506
515
|
}
|
|
507
516
|
getLabels() {
|
|
508
517
|
}
|
|
509
|
-
},
|
|
518
|
+
}, tt = class extends l {
|
|
510
519
|
getParentControlId() {
|
|
511
520
|
return n.BLOCK_BUTTON.ALIGNMENT;
|
|
512
521
|
}
|
|
513
|
-
},
|
|
522
|
+
}, rt = class extends l {
|
|
514
523
|
getParentControlId() {
|
|
515
524
|
return n.GENERAL.BACKGROUND_COLOR;
|
|
516
525
|
}
|
|
517
|
-
},
|
|
526
|
+
}, at = class extends l {
|
|
518
527
|
getParentControlId() {
|
|
519
528
|
return n.BLOCK_BUTTON.BORDER;
|
|
520
529
|
}
|
|
521
530
|
getLabels() {
|
|
522
531
|
}
|
|
523
|
-
},
|
|
532
|
+
}, nt = class extends l {
|
|
524
533
|
getParentControlId() {
|
|
525
534
|
return n.BLOCK_BUTTON.COLOR;
|
|
526
535
|
}
|
|
527
|
-
},
|
|
536
|
+
}, st = class extends l {
|
|
528
537
|
getParentControlId() {
|
|
529
538
|
return n.BLOCK_BUTTON.ADJUST_TO_WIDTH;
|
|
530
539
|
}
|
|
531
|
-
},
|
|
540
|
+
}, it = class extends l {
|
|
532
541
|
getParentControlId() {
|
|
533
542
|
return n.BLOCK_BUTTON.FONT_FAMILY;
|
|
534
543
|
}
|
|
535
|
-
},
|
|
544
|
+
}, lt = class extends l {
|
|
536
545
|
getParentControlId() {
|
|
537
546
|
return n.BLOCK_BUTTON.EXTERNAL_INDENTS;
|
|
538
547
|
}
|
|
539
|
-
},
|
|
548
|
+
}, Et = class extends l {
|
|
540
549
|
getParentControlId() {
|
|
541
550
|
return n.BLOCK_BUTTON.INTERNAL_INDENTS;
|
|
542
551
|
}
|
|
543
|
-
},
|
|
552
|
+
}, ot = class extends l {
|
|
544
553
|
getParentControlId() {
|
|
545
554
|
return n.BLOCK_BUTTON.TEXT;
|
|
546
555
|
}
|
|
547
|
-
},
|
|
556
|
+
}, dt = class extends l {
|
|
548
557
|
getParentControlId() {
|
|
549
558
|
return n.BLOCK_BUTTON.FONT_SIZE;
|
|
550
559
|
}
|
|
551
|
-
},
|
|
560
|
+
}, ut = class extends l {
|
|
552
561
|
getParentControlId() {
|
|
553
562
|
return n.BLOCK_BUTTON.TEXT_STYLE_AND_COLOR;
|
|
554
563
|
}
|
|
555
564
|
getLabels() {
|
|
556
565
|
}
|
|
557
|
-
},
|
|
566
|
+
}, G = class h extends i {
|
|
558
567
|
constructor() {
|
|
559
568
|
super(h.REQUIRED_METHODS, h);
|
|
560
569
|
}
|
|
@@ -609,8 +618,8 @@ var j = {
|
|
|
609
618
|
onDocumentChanged(t) {
|
|
610
619
|
}
|
|
611
620
|
};
|
|
612
|
-
|
|
613
|
-
var
|
|
621
|
+
G.REQUIRED_METHODS = ["getId", "getTemplate"];
|
|
622
|
+
var ct = G, pe = class m extends i {
|
|
614
623
|
constructor() {
|
|
615
624
|
super(m.REQUIRED_METHODS, m);
|
|
616
625
|
}
|
|
@@ -679,21 +688,21 @@ var ot = X, Fe = class m extends s {
|
|
|
679
688
|
onDestroy() {
|
|
680
689
|
}
|
|
681
690
|
};
|
|
682
|
-
|
|
683
|
-
var
|
|
691
|
+
pe.REQUIRED_METHODS = ["getId", "getIcon", "getName", "getTemplate", "getTabIndex"];
|
|
692
|
+
var V = class extends v {
|
|
684
693
|
getTargetNodes(e) {
|
|
685
|
-
const t = e.querySelectorAll(c.IMAGE),
|
|
686
|
-
return t.length ? t :
|
|
694
|
+
const t = e.querySelectorAll(c.IMAGE), r = e.asElement().hasClass(K) ? [e] : [];
|
|
695
|
+
return t.length ? t : r;
|
|
687
696
|
}
|
|
688
|
-
},
|
|
697
|
+
}, Tt = class extends V {
|
|
689
698
|
getParentControlId() {
|
|
690
699
|
return n.BLOCK_IMAGE.EXTERNAL_INDENTS;
|
|
691
700
|
}
|
|
692
|
-
},
|
|
701
|
+
}, It = class extends V {
|
|
693
702
|
getParentControlId() {
|
|
694
703
|
return n.BLOCK_IMAGE.SIZE;
|
|
695
704
|
}
|
|
696
|
-
},
|
|
705
|
+
}, Xe = class g extends i {
|
|
697
706
|
constructor() {
|
|
698
707
|
super(g.REQUIRED_METHODS, g);
|
|
699
708
|
}
|
|
@@ -757,8 +766,8 @@ var G = class extends x {
|
|
|
757
766
|
onDocumentChanged() {
|
|
758
767
|
}
|
|
759
768
|
};
|
|
760
|
-
|
|
761
|
-
var
|
|
769
|
+
Xe.REQUIRED_METHODS = ["getId", "getIcon", "getName", "getTemplate", "getTabIndex"];
|
|
770
|
+
var f = class O extends i {
|
|
762
771
|
constructor() {
|
|
763
772
|
super(O.REQUIRED_METHODS, O);
|
|
764
773
|
}
|
|
@@ -766,10 +775,10 @@ var V = class O extends s {
|
|
|
766
775
|
throw new Error("Method registerBlockControls() must be implemented by the subclass");
|
|
767
776
|
}
|
|
768
777
|
};
|
|
769
|
-
|
|
770
|
-
var
|
|
771
|
-
constructor(
|
|
772
|
-
this.tabId =
|
|
778
|
+
f.REQUIRED_METHODS = ["registerBlockControls"];
|
|
779
|
+
var bt = f, ht = class R {
|
|
780
|
+
constructor(t, r) {
|
|
781
|
+
this.tabId = t, this.controls = r.map(R.normalizeControl);
|
|
773
782
|
}
|
|
774
783
|
getTabId() {
|
|
775
784
|
return this.tabId;
|
|
@@ -778,52 +787,66 @@ var ct = V, Tt = class {
|
|
|
778
787
|
return this.label;
|
|
779
788
|
}
|
|
780
789
|
getControlsIds() {
|
|
781
|
-
return this.
|
|
790
|
+
return this.controls.map((t) => t.id);
|
|
791
|
+
}
|
|
792
|
+
getControls() {
|
|
793
|
+
return this.controls;
|
|
782
794
|
}
|
|
783
|
-
withLabel(
|
|
784
|
-
return this.label =
|
|
795
|
+
withLabel(t) {
|
|
796
|
+
return this.label = t, this;
|
|
785
797
|
}
|
|
786
|
-
addControl(
|
|
787
|
-
|
|
798
|
+
addControl(t, r) {
|
|
799
|
+
const s = R.normalizeControl(t);
|
|
800
|
+
return r < 0 ? this.controls.unshift(s) : r > this.controls.length ? this.controls.push(s) : this.controls.splice(r, 0, s), this;
|
|
788
801
|
}
|
|
789
|
-
deleteControl(
|
|
790
|
-
const
|
|
791
|
-
|
|
802
|
+
deleteControl(t) {
|
|
803
|
+
const r = this.controls.findIndex((s) => s.id === t);
|
|
804
|
+
r !== -1 && this.controls.splice(r, 1);
|
|
792
805
|
}
|
|
793
|
-
|
|
806
|
+
static normalizeControl(t) {
|
|
807
|
+
if (typeof t == "string")
|
|
808
|
+
return { id: t };
|
|
809
|
+
if (!t.id)
|
|
810
|
+
throw new Error("SettingsPanelTabControlConfig.id is required");
|
|
811
|
+
return {
|
|
812
|
+
...t,
|
|
813
|
+
id: t.id
|
|
814
|
+
};
|
|
815
|
+
}
|
|
816
|
+
}, E = class extends v {
|
|
794
817
|
getTargetNodes(e) {
|
|
795
|
-
const t = e.querySelectorAll(c.TEXT),
|
|
796
|
-
return t.length ? t :
|
|
818
|
+
const t = e.querySelectorAll(c.TEXT), r = e.asElement().hasClass(w) ? [e] : [];
|
|
819
|
+
return t.length ? t : r;
|
|
797
820
|
}
|
|
798
|
-
},
|
|
821
|
+
}, mt = class extends E {
|
|
799
822
|
getParentControlId() {
|
|
800
823
|
return n.GENERAL.TEXT_ALIGN;
|
|
801
824
|
}
|
|
802
|
-
},
|
|
825
|
+
}, gt = class extends E {
|
|
803
826
|
getParentControlId() {
|
|
804
827
|
return n.GENERAL.TEXT_COLOR;
|
|
805
828
|
}
|
|
806
|
-
},
|
|
829
|
+
}, Ot = class extends E {
|
|
807
830
|
getParentControlId() {
|
|
808
831
|
return n.BLOCK_TEXT.FONT_FAMILY;
|
|
809
832
|
}
|
|
810
|
-
},
|
|
833
|
+
}, Rt = class extends E {
|
|
811
834
|
getParentControlId() {
|
|
812
835
|
return n.GENERAL.TEXT_LINE_SPACING;
|
|
813
836
|
}
|
|
814
|
-
},
|
|
837
|
+
}, Lt = class extends E {
|
|
815
838
|
getParentControlId() {
|
|
816
839
|
return n.BLOCK_TEXT.INTERNAL_INDENTS;
|
|
817
840
|
}
|
|
818
|
-
},
|
|
841
|
+
}, _t = class extends E {
|
|
819
842
|
getParentControlId() {
|
|
820
843
|
return n.GENERAL.TEXT_SIZE;
|
|
821
844
|
}
|
|
822
|
-
},
|
|
845
|
+
}, Ct = class extends E {
|
|
823
846
|
getParentControlId() {
|
|
824
847
|
return n.GENERAL.TEXT_STYLE;
|
|
825
848
|
}
|
|
826
|
-
},
|
|
849
|
+
}, Ge = class {
|
|
827
850
|
constructor(e) {
|
|
828
851
|
this.uiElements = [], this.controls = [], this.contextActions = [], this.blocks = [], this.generalPanelTabs = [], this.modulesPanelTabs = [], this.i18n = e == null ? void 0 : e.i18n, this.styles = e == null ? void 0 : e.styles, this.previewStyles = e == null ? void 0 : e.previewStyles, this.uiElements = (e == null ? void 0 : e.uiElements) ?? [], this.uiElementTagRegistry = e == null ? void 0 : e.uiElementTagRegistry, this.controls = (e == null ? void 0 : e.controls) ?? [], this.settingsPanelRegistry = e == null ? void 0 : e.settingsPanelRegistry, this.contextActions = (e == null ? void 0 : e.contextActions) ?? [], this.blocks = (e == null ? void 0 : e.blocks) ?? [], this.generalPanelTabs = (e == null ? void 0 : e.generalPanelTabs) ?? [], this.modulesPanelTabs = (e == null ? void 0 : e.modulesPanelTabs) ?? [], this.externalSmartElementsLibrary = e == null ? void 0 : e.externalSmartElementsLibrary, this.externalImageLibrary = e == null ? void 0 : e.externalImageLibrary, this.externalImageLibraryTab = e == null ? void 0 : e.externalImageLibraryTab, this.externalAiAssistant = e == null ? void 0 : e.externalAiAssistant, this.externalDisplayConditionsLibrary = e == null ? void 0 : e.externalDisplayConditionsLibrary, this.externalVideoLibrary = e == null ? void 0 : e.externalVideoLibrary, this.blocksPanel = e == null ? void 0 : e.blocksPanel, this.iconsRegistry = e == null ? void 0 : e.iconsRegistry, this.id = Math.random().toString(36).substring(2);
|
|
829
852
|
}
|
|
@@ -887,7 +910,7 @@ var ct = V, Tt = class {
|
|
|
887
910
|
getModulesPanelTabs() {
|
|
888
911
|
return this.modulesPanelTabs;
|
|
889
912
|
}
|
|
890
|
-
},
|
|
913
|
+
}, At = class {
|
|
891
914
|
constructor() {
|
|
892
915
|
this.styles = [], this.uiElements = [], this.controls = [], this.contextActions = [], this.blocks = [], this.generalPanelTabs = [], this.modulesPanelTabs = [];
|
|
893
916
|
}
|
|
@@ -958,7 +981,7 @@ var ct = V, Tt = class {
|
|
|
958
981
|
return this.modulesPanelTabs.push(e), this;
|
|
959
982
|
}
|
|
960
983
|
build() {
|
|
961
|
-
return new
|
|
984
|
+
return new Ge({
|
|
962
985
|
i18n: this.i18n,
|
|
963
986
|
styles: this.styles.map((e) => e.trim()).join(`
|
|
964
987
|
`),
|
|
@@ -981,18 +1004,18 @@ var ct = V, Tt = class {
|
|
|
981
1004
|
modulesPanelTabs: this.modulesPanelTabs
|
|
982
1005
|
});
|
|
983
1006
|
}
|
|
984
|
-
},
|
|
1007
|
+
}, Ve = class L extends i {
|
|
985
1008
|
constructor() {
|
|
986
|
-
super(
|
|
1009
|
+
super(L.REQUIRED_METHODS, L);
|
|
987
1010
|
}
|
|
988
1011
|
openAiAssistant(t) {
|
|
989
1012
|
throw new Error("Method openAiAssistant() must be implemented by the subclass");
|
|
990
1013
|
}
|
|
991
1014
|
};
|
|
992
|
-
|
|
993
|
-
var
|
|
1015
|
+
Ve.REQUIRED_METHODS = ["openAiAssistant"];
|
|
1016
|
+
var fe = class _ extends i {
|
|
994
1017
|
constructor() {
|
|
995
|
-
super(
|
|
1018
|
+
super(_.REQUIRED_METHODS, _);
|
|
996
1019
|
}
|
|
997
1020
|
/**
|
|
998
1021
|
* Retrieves the name of the category.
|
|
@@ -1009,7 +1032,7 @@ var Xe = class L extends s {
|
|
|
1009
1032
|
* @param {ExternalDisplayConditionSelectedCB} _successCallback - Callback executed with the updated or newly created condition upon success.
|
|
1010
1033
|
* @param {() => void} _cancelCallback - Callback executed when the dialog is closed without making changes.
|
|
1011
1034
|
*/
|
|
1012
|
-
openExternalDisplayConditionsDialog(t,
|
|
1035
|
+
openExternalDisplayConditionsDialog(t, r, s) {
|
|
1013
1036
|
throw new Error("Method openExternalDisplayConditionsDialog() must be implemented by the subclass");
|
|
1014
1037
|
}
|
|
1015
1038
|
/**
|
|
@@ -1030,19 +1053,19 @@ var Xe = class L extends s {
|
|
|
1030
1053
|
throw new Error("Method getContextActionIndex() must be implemented by the subclass");
|
|
1031
1054
|
}
|
|
1032
1055
|
};
|
|
1033
|
-
|
|
1034
|
-
var
|
|
1056
|
+
fe.REQUIRED_METHODS = ["getCategoryName", "openExternalDisplayConditionsDialog"];
|
|
1057
|
+
var Qe = class C extends i {
|
|
1035
1058
|
constructor() {
|
|
1036
|
-
super(
|
|
1059
|
+
super(C.REQUIRED_METHODS, C);
|
|
1037
1060
|
}
|
|
1038
|
-
openImageLibrary(t,
|
|
1061
|
+
openImageLibrary(t, r, s) {
|
|
1039
1062
|
throw new Error("Method openImageLibrary() must be implemented by the subclass");
|
|
1040
1063
|
}
|
|
1041
1064
|
};
|
|
1042
|
-
|
|
1043
|
-
var
|
|
1065
|
+
Qe.REQUIRED_METHODS = ["openImageLibrary"];
|
|
1066
|
+
var Ye = class A extends i {
|
|
1044
1067
|
constructor() {
|
|
1045
|
-
super(
|
|
1068
|
+
super(A.REQUIRED_METHODS, A);
|
|
1046
1069
|
}
|
|
1047
1070
|
/**
|
|
1048
1071
|
* @description Returns the translated name/label for the tab
|
|
@@ -1057,39 +1080,39 @@ var Ve = class C extends s {
|
|
|
1057
1080
|
* @param _onImageSelectCallback - Callback to invoke when an image is selected
|
|
1058
1081
|
* @param _selectedNode - (Optional) Selected node for which the gallery is being opened
|
|
1059
1082
|
*/
|
|
1060
|
-
openImageLibraryTab(t,
|
|
1083
|
+
openImageLibraryTab(t, r, s) {
|
|
1061
1084
|
throw new Error("Method openImageLibraryTab() must be implemented by the subclass");
|
|
1062
1085
|
}
|
|
1063
1086
|
};
|
|
1064
|
-
|
|
1065
|
-
var
|
|
1087
|
+
Ye.REQUIRED_METHODS = ["getName", "openImageLibraryTab"];
|
|
1088
|
+
var $e = class N extends i {
|
|
1066
1089
|
constructor() {
|
|
1067
|
-
super(
|
|
1090
|
+
super(N.REQUIRED_METHODS, N);
|
|
1068
1091
|
}
|
|
1069
|
-
openSmartElementsLibrary(t,
|
|
1092
|
+
openSmartElementsLibrary(t, r) {
|
|
1070
1093
|
throw new Error("Method openSmartElementsLibrary() must be implemented by the subclass");
|
|
1071
1094
|
}
|
|
1072
1095
|
};
|
|
1073
|
-
|
|
1074
|
-
var
|
|
1096
|
+
$e.REQUIRED_METHODS = ["openSmartElementsLibrary"];
|
|
1097
|
+
var We = class D extends i {
|
|
1075
1098
|
constructor() {
|
|
1076
|
-
super(
|
|
1099
|
+
super(D.REQUIRED_METHODS, D);
|
|
1077
1100
|
}
|
|
1078
|
-
openExternalVideosLibraryDialog(t,
|
|
1101
|
+
openExternalVideosLibraryDialog(t, r, s) {
|
|
1079
1102
|
throw new Error("Method openExternalVideosLibraryDialog() must be implemented by the subclass");
|
|
1080
1103
|
}
|
|
1081
1104
|
};
|
|
1082
|
-
|
|
1083
|
-
var Q = class
|
|
1105
|
+
We.REQUIRED_METHODS = ["openExternalVideosLibraryDialog"];
|
|
1106
|
+
var Q = class S extends i {
|
|
1084
1107
|
constructor() {
|
|
1085
|
-
super(
|
|
1108
|
+
super(S.REQUIRED_METHODS, S);
|
|
1086
1109
|
}
|
|
1087
1110
|
registerIconsSvg(t) {
|
|
1088
1111
|
throw new Error("Method registerIconsSvg() must be implemented by the subclass");
|
|
1089
1112
|
}
|
|
1090
1113
|
};
|
|
1091
1114
|
Q.REQUIRED_METHODS = ["registerIconsSvg"];
|
|
1092
|
-
var
|
|
1115
|
+
var Nt = Q, Dt = class {
|
|
1093
1116
|
constructor(e) {
|
|
1094
1117
|
this.key = e;
|
|
1095
1118
|
}
|
|
@@ -1102,9 +1125,9 @@ var _t = Q, Ct = class {
|
|
|
1102
1125
|
params: this.params
|
|
1103
1126
|
};
|
|
1104
1127
|
}
|
|
1105
|
-
},
|
|
1128
|
+
}, Y = class M extends i {
|
|
1106
1129
|
constructor() {
|
|
1107
|
-
super(
|
|
1130
|
+
super(M.REQUIRED_METHODS, M);
|
|
1108
1131
|
}
|
|
1109
1132
|
/**
|
|
1110
1133
|
* Called when the UI element should render its content into the provided container.
|
|
@@ -1139,7 +1162,7 @@ var _t = Q, Ct = class {
|
|
|
1139
1162
|
* @param name - The name of the attribute that was updated.
|
|
1140
1163
|
* @param value - The new value of the attribute.
|
|
1141
1164
|
*/
|
|
1142
|
-
onAttributeUpdated(t,
|
|
1165
|
+
onAttributeUpdated(t, r) {
|
|
1143
1166
|
}
|
|
1144
1167
|
/**
|
|
1145
1168
|
* Gets the unique identifier for this UI element type.
|
|
@@ -1157,64 +1180,64 @@ var _t = Q, Ct = class {
|
|
|
1157
1180
|
throw new Error("Method getTemplate() must be implemented by the subclass");
|
|
1158
1181
|
}
|
|
1159
1182
|
};
|
|
1160
|
-
|
|
1161
|
-
var
|
|
1183
|
+
Y.REQUIRED_METHODS = ["onRender", "getId", "getTemplate"];
|
|
1184
|
+
var St = Y, $ = class B extends i {
|
|
1162
1185
|
constructor() {
|
|
1163
|
-
super(
|
|
1186
|
+
super(B.REQUIRED_METHODS, B);
|
|
1164
1187
|
}
|
|
1165
1188
|
registerUiElements(t) {
|
|
1166
1189
|
throw new Error("Method registerUiElements() must be implemented by the subclass");
|
|
1167
1190
|
}
|
|
1168
1191
|
};
|
|
1169
|
-
|
|
1170
|
-
var
|
|
1192
|
+
$.REQUIRED_METHODS = ["registerUiElements"];
|
|
1193
|
+
var Mt = $;
|
|
1171
1194
|
export {
|
|
1172
|
-
|
|
1173
|
-
|
|
1174
|
-
|
|
1195
|
+
Ze as Block,
|
|
1196
|
+
je as BlockAttr,
|
|
1197
|
+
z as BlockCompositionType,
|
|
1175
1198
|
c as BlockSelector,
|
|
1176
|
-
|
|
1177
|
-
|
|
1178
|
-
|
|
1199
|
+
de as BlockType,
|
|
1200
|
+
qe as BlocksPanel,
|
|
1201
|
+
v as BuiltInControl,
|
|
1179
1202
|
n as BuiltInControlTypes,
|
|
1180
|
-
|
|
1181
|
-
|
|
1182
|
-
|
|
1183
|
-
|
|
1184
|
-
|
|
1185
|
-
|
|
1186
|
-
|
|
1187
|
-
|
|
1188
|
-
|
|
1189
|
-
|
|
1190
|
-
|
|
1191
|
-
|
|
1192
|
-
|
|
1193
|
-
|
|
1194
|
-
|
|
1195
|
-
|
|
1196
|
-
|
|
1197
|
-
|
|
1198
|
-
|
|
1199
|
-
|
|
1200
|
-
|
|
1201
|
-
|
|
1202
|
-
|
|
1203
|
-
|
|
1204
|
-
|
|
1205
|
-
|
|
1206
|
-
|
|
1207
|
-
|
|
1208
|
-
|
|
1209
|
-
|
|
1210
|
-
|
|
1211
|
-
|
|
1212
|
-
|
|
1213
|
-
|
|
1214
|
-
|
|
1215
|
-
|
|
1216
|
-
|
|
1217
|
-
|
|
1218
|
-
|
|
1219
|
-
|
|
1203
|
+
tt as ButtonAlignBuiltInControl,
|
|
1204
|
+
rt as ButtonBackgroundColorBuiltInControl,
|
|
1205
|
+
at as ButtonBorderBuiltInControl,
|
|
1206
|
+
et as ButtonBorderRadiusBuiltInControl,
|
|
1207
|
+
nt as ButtonColorBuiltInControl,
|
|
1208
|
+
H as ButtonControls,
|
|
1209
|
+
st as ButtonFitToContainerBuiltInControl,
|
|
1210
|
+
it as ButtonFontFamilyBuiltInControl,
|
|
1211
|
+
lt as ButtonMarginsBuiltInControl,
|
|
1212
|
+
Et as ButtonPaddingsBuiltInControl,
|
|
1213
|
+
ot as ButtonTextBuiltInControl,
|
|
1214
|
+
dt as ButtonTextSizeBuiltInControl,
|
|
1215
|
+
ut as ButtonTextStyleAndFontColorBuiltInControl,
|
|
1216
|
+
ue as ContainerControls,
|
|
1217
|
+
ct as Control,
|
|
1218
|
+
ce as EditorStatePropertyType,
|
|
1219
|
+
Ge as Extension,
|
|
1220
|
+
At as ExtensionBuilder,
|
|
1221
|
+
F as GeneralControls,
|
|
1222
|
+
Nt as IconsRegistry,
|
|
1223
|
+
p as ImageControls,
|
|
1224
|
+
Tt as ImageMarginsBuiltInControl,
|
|
1225
|
+
It as ImageSizeBuiltInControl,
|
|
1226
|
+
Dt as ModificationDescription,
|
|
1227
|
+
Te as PreviewDeviceMode,
|
|
1228
|
+
bt as SettingsPanelRegistry,
|
|
1229
|
+
ht as SettingsPanelTab,
|
|
1230
|
+
Ie as SettingsTab,
|
|
1231
|
+
mt as TextAlignBuiltInControl,
|
|
1232
|
+
gt as TextColorBuiltInControl,
|
|
1233
|
+
k as TextControls,
|
|
1234
|
+
Ot as TextFontFamilyBuiltInControl,
|
|
1235
|
+
Rt as TextLineSpacingBuiltInControl,
|
|
1236
|
+
Lt as TextPaddingsBuiltInControl,
|
|
1237
|
+
_t as TextSizeBuiltInControl,
|
|
1238
|
+
Ct as TextStyleBuiltInControl,
|
|
1239
|
+
Je as UEAttr,
|
|
1240
|
+
St as UIElement,
|
|
1241
|
+
Mt as UIElementTagRegistry,
|
|
1242
|
+
ke as UIElementType
|
|
1220
1243
|
};
|
package/dist/package.json.js
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@useinsider/guido",
|
|
3
|
-
"version": "3.2.0-beta.
|
|
3
|
+
"version": "3.2.0-beta.44889a0",
|
|
4
4
|
"description": "Guido is a Vue + TypeScript wrapper for Email Plugin. Easily embed the email editor in your Vue applications.",
|
|
5
5
|
"main": "./dist/guido.umd.cjs",
|
|
6
6
|
"module": "./dist/library.js",
|
|
@@ -32,7 +32,7 @@
|
|
|
32
32
|
"author": "",
|
|
33
33
|
"license": "ISC",
|
|
34
34
|
"dependencies": {
|
|
35
|
-
"@stripoinc/ui-editor-extensions": "3.
|
|
35
|
+
"@stripoinc/ui-editor-extensions": "3.8.0",
|
|
36
36
|
"@useinsider/design-system-vue": "1.1.0-beta.73ec2fa",
|
|
37
37
|
"@vueuse/core": "11.3.0",
|
|
38
38
|
"lodash-es": "4.17.21",
|
|
@@ -86,7 +86,7 @@
|
|
|
86
86
|
},
|
|
87
87
|
"guido": {
|
|
88
88
|
"stripo": {
|
|
89
|
-
"version": "2.
|
|
89
|
+
"version": "2.62.0"
|
|
90
90
|
}
|
|
91
91
|
}
|
|
92
92
|
}
|
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
import { ToasterTypeOptions as c } from "../../enums/toaster.js";
|
|
2
|
-
import { COUPON_PLACEHOLDER_DEFAULT as i, COUPON_PLACEHOLDER_LIQUID as l } from "../../extensions/Blocks/CouponBlock/template.js";
|
|
3
|
-
import { useToaster as m } from "../useToaster.js";
|
|
4
|
-
import { useTranslations as p } from "../useTranslations.js";
|
|
5
|
-
const u = /* @__PURE__ */ new Set([
|
|
6
|
-
i,
|
|
7
|
-
l
|
|
8
|
-
]), A = () => {
|
|
9
|
-
const { showToaster: t } = m(), r = p();
|
|
10
|
-
return { validateCouponBlockTags: (e) => {
|
|
11
|
-
const n = new DOMParser().parseFromString(e, "text/html");
|
|
12
|
-
return Array.from(n.querySelectorAll(".coupon-block")).find((s) => {
|
|
13
|
-
var o;
|
|
14
|
-
const a = ((o = s.textContent) == null ? void 0 : o.trim()) ?? "";
|
|
15
|
-
return !u.has(a);
|
|
16
|
-
}) ? (t({
|
|
17
|
-
type: c.Warning,
|
|
18
|
-
message: r("newsletter.coupon-tag-modified")
|
|
19
|
-
}), !1) : !0;
|
|
20
|
-
} };
|
|
21
|
-
};
|
|
22
|
-
export {
|
|
23
|
-
A as useCouponBlockValidator
|
|
24
|
-
};
|