@useinsider/guido 3.26.0 → 3.27.0-beta.13ad95b
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 +1 -0
- package/dist/@types/config/schemas.js +91 -89
- package/dist/@types/display-condition.js +25 -0
- package/dist/components/Guido.vue.js +5 -5
- package/dist/components/Guido.vue2.js +104 -98
- package/dist/components/organisms/display-conditions/CodeEditorField.vue.js +17 -0
- package/dist/components/organisms/display-conditions/CodeEditorField.vue2.js +41 -0
- package/dist/components/organisms/display-conditions/DisplayConditionCreateDrawer.vue.js +30 -0
- package/dist/components/organisms/display-conditions/DisplayConditionCreateDrawer.vue2.js +81 -0
- package/dist/components/organisms/display-conditions/DisplayConditionListState.vue.js +17 -0
- package/dist/components/organisms/display-conditions/DisplayConditionListState.vue2.js +45 -0
- package/dist/components/organisms/display-conditions/DisplayConditionSelectDrawer.vue.js +36 -0
- package/dist/components/organisms/display-conditions/DisplayConditionSelectDrawer.vue2.js +63 -0
- package/dist/components/organisms/display-conditions/DisplayConditionsHost.vue.js +17 -0
- package/dist/components/organisms/display-conditions/DisplayConditionsHost.vue2.js +22 -0
- package/dist/components/organisms/extensions/recommendation/AssignStrategyDrawer.vue.js +9 -10
- package/dist/components/organisms/extensions/recommendation/AssignStrategyDrawer.vue2.js +42 -41
- package/dist/components/organisms/onboarding/GenericOnboarding.vue.js +5 -5
- package/dist/components/organisms/onboarding/GenericOnboarding.vue2.js +15 -15
- package/dist/components/organisms/onboarding/ItemsOnboarding.vue.js +6 -6
- package/dist/components/organisms/onboarding/ItemsOnboarding.vue2.js +28 -27
- package/dist/components/organisms/onboarding/RecommendationLegacyStrategyOnboarding.vue.js +3 -3
- package/dist/components/organisms/onboarding/RecommendationLegacyStrategyOnboarding.vue2.js +42 -27
- package/dist/composables/useBlocksConfig.js +29 -20
- package/dist/composables/useCustomInterfaceAppearance.js +50 -50
- package/dist/composables/useDisplayConditions.js +116 -0
- package/dist/composables/useFullStoryBridge.js +10 -9
- package/dist/composables/useTranslations.js +2 -1
- package/dist/config/compiler/utils/itemsCompilerUtils.js +43 -42
- package/dist/config/compiler/utils/recommendationCompilerUtils.js +67 -64
- package/dist/enums/academy.js +1 -0
- package/dist/enums/display-condition.js +12 -0
- package/dist/extensions/Blocks/Recommendation/controls/main/filters.js +14 -14
- package/dist/extensions/Blocks/Recommendation/controls/main/strategy.js +52 -40
- package/dist/extensions/Blocks/Recommendation/controls/syncInfoMessage.js +15 -15
- package/dist/extensions/Blocks/Recommendation/utils/priceFormatter.js +17 -15
- package/dist/extensions/Blocks/common-control.js +25 -25
- package/dist/extensions/DisplayConditions/bridge.js +25 -0
- package/dist/extensions/DisplayConditions/constants.js +26 -0
- package/dist/extensions/DisplayConditions/control.js +215 -0
- package/dist/extensions/DisplayConditions/display-conditions.css.js +226 -0
- package/dist/extensions/DisplayConditions/extension.js +28 -0
- package/dist/extensions/DisplayConditions/iconsRegistry.js +20 -0
- package/dist/extensions/DisplayConditions/library.js +30 -0
- package/dist/extensions/DisplayConditions/settingsPanel.js +17 -0
- package/dist/extensions/DynamicContent/dynamic-content.js +15 -17
- package/dist/guido.css +1 -1
- package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/esm/index.js +93 -92
- package/dist/node_modules/valibot/dist/index.js +297 -261
- package/dist/package.json.js +2 -2
- package/dist/services/displayConditionApi.js +39 -0
- package/dist/src/@types/config/schemas.d.ts +4 -0
- package/dist/src/@types/display-condition.d.ts +61 -0
- package/dist/src/components/organisms/display-conditions/CodeEditorField.vue.d.ts +43 -0
- package/dist/src/components/organisms/display-conditions/DisplayConditionCreateDrawer.vue.d.ts +2 -0
- package/dist/src/components/organisms/display-conditions/DisplayConditionListState.vue.d.ts +18 -0
- package/dist/src/components/organisms/display-conditions/DisplayConditionSelectDrawer.vue.d.ts +2 -0
- package/dist/src/components/organisms/display-conditions/DisplayConditionsHost.vue.d.ts +2 -0
- package/dist/src/composables/useConfig.d.ts +2 -0
- package/dist/src/composables/useDisplayConditions.d.ts +18 -0
- package/dist/src/enums/academy.d.ts +1 -0
- package/dist/src/enums/display-condition.d.ts +15 -0
- package/dist/src/extensions/Blocks/Recommendation/controls/main/strategy.d.ts +2 -0
- package/dist/src/extensions/Blocks/common-control.d.ts +1 -1
- package/dist/src/extensions/DisplayConditions/bridge.d.ts +7 -0
- package/dist/src/extensions/DisplayConditions/constants.d.ts +23 -0
- package/dist/src/extensions/DisplayConditions/control.d.ts +25 -0
- package/dist/src/extensions/{Blocks/_Boilerplate → DisplayConditions}/iconsRegistry.d.ts +1 -1
- package/dist/src/extensions/DisplayConditions/library.d.ts +8 -0
- package/dist/src/extensions/DisplayConditions/settingsPanel.d.ts +5 -0
- package/dist/src/mock/api/display-conditions.d.ts +2 -0
- package/dist/src/services/displayConditionApi.d.ts +8 -0
- package/dist/src/stores/config.d.ts +170 -0
- package/dist/src/stores/display-condition.d.ts +86 -0
- package/dist/src/stores/onboarding.d.ts +1 -0
- package/dist/src/utils/displayCondition.d.ts +11 -0
- package/dist/src/utils/editorShadowRoot.d.ts +1 -0
- package/dist/src/utils/protectTableText.d.ts +2 -0
- package/dist/static/styles/variables.css.js +1 -0
- package/dist/stores/config.js +13 -6
- package/dist/stores/display-condition.js +29 -0
- package/dist/stores/onboarding.js +4 -1
- package/dist/utils/displayCondition.js +29 -0
- package/dist/utils/editorShadowRoot.js +8 -0
- package/dist/utils/pairProductVariables.js +29 -28
- package/dist/utils/protectTableText.js +22 -0
- package/package.json +11 -3
- package/dist/src/extensions/Blocks/_Boilerplate/block.d.ts +0 -11
- package/dist/src/extensions/Blocks/_Boilerplate/constants/controlIds.d.ts +0 -7
- package/dist/src/extensions/Blocks/_Boilerplate/constants/index.d.ts +0 -10
- package/dist/src/extensions/Blocks/_Boilerplate/constants/selectors.d.ts +0 -16
- package/dist/src/extensions/Blocks/_Boilerplate/control.d.ts +0 -17
- package/dist/src/extensions/Blocks/_Boilerplate/controls/blockBackground/index.d.ts +0 -15
- package/dist/src/extensions/Blocks/_Boilerplate/settingsPanel.d.ts +0 -4
- package/dist/src/extensions/Blocks/_Boilerplate/template.d.ts +0 -6
- /package/dist/src/extensions/{Blocks/_Boilerplate → DisplayConditions}/extension.d.ts +0 -0
|
@@ -2,26 +2,27 @@ import { isNewPriceFormatRoot as G, ITEMS_PRICE_FORMAT_ATTR as N, currencyPositi
|
|
|
2
2
|
import { productPairs as k } from "../extensions/Blocks/Items/enums/productEnums.js";
|
|
3
3
|
import { escapeReplacement as v } from "../extensions/Blocks/Items/utils/nodeConfigUtils.js";
|
|
4
4
|
import { preserveTextStyles as w } from "./preserveTextStyles.js";
|
|
5
|
-
import {
|
|
5
|
+
import { protectTableText as X, restoreTableText as j } from "./protectTableText.js";
|
|
6
|
+
import { unwrapProductNameLinks as Q } from "./unwrapProductNameLink.js";
|
|
6
7
|
const q = {
|
|
7
8
|
CART_ITEMS: "ins_apr",
|
|
8
9
|
BROWSED_ITEMS: "browsed_item",
|
|
9
10
|
PURCHASED_ITEMS: "purchased_item"
|
|
10
11
|
}, W = (r) => r.replaceAll("{%", "<!--{%").replaceAll("%}", "%}-->");
|
|
11
|
-
function
|
|
12
|
+
function z(r, h, p) {
|
|
12
13
|
let u = h;
|
|
13
14
|
for (; u > 0 && /\s/.test(r[u - 1]); )
|
|
14
15
|
u -= 1;
|
|
15
16
|
return p.some((A) => r.endsWith(A, u));
|
|
16
17
|
}
|
|
17
|
-
const
|
|
18
|
-
function
|
|
18
|
+
const J = /(\s)href=(["'])(?:[^"']*#!|#)?\2/gi;
|
|
19
|
+
function K(r, h) {
|
|
19
20
|
var u;
|
|
20
21
|
const p = r.ownerDocument.createTreeWalker(r, NodeFilter.SHOW_COMMENT);
|
|
21
22
|
for (let A = p.nextNode(); A; A = p.nextNode())
|
|
22
|
-
(u = A.nodeValue) != null && u.includes("[if mso]") && (A.nodeValue = A.nodeValue.replace(
|
|
23
|
+
(u = A.nodeValue) != null && u.includes("[if mso]") && (A.nodeValue = A.nodeValue.replace(J, (L, P) => `${P}href="${h}"`));
|
|
23
24
|
}
|
|
24
|
-
function
|
|
25
|
+
function Z(r) {
|
|
25
26
|
return {
|
|
26
27
|
isFormatted: r.getAttribute("data-formated") === "true",
|
|
27
28
|
isSinglePrice: r.getAttribute("data-single_price") === "true",
|
|
@@ -29,7 +30,7 @@ function J(r) {
|
|
|
29
30
|
configuredSymbol: (r.getAttribute(U.SYMBOL) || "").trim()
|
|
30
31
|
};
|
|
31
32
|
}
|
|
32
|
-
function
|
|
33
|
+
function tt(r) {
|
|
33
34
|
return {
|
|
34
35
|
isFormatted: !1,
|
|
35
36
|
isSinglePrice: r.getAttribute(N.SINGLE_PRICE) === "true",
|
|
@@ -39,7 +40,7 @@ function K(r) {
|
|
|
39
40
|
configuredSymbol: (r.getAttribute(N.SYMBOL) || "").trim()
|
|
40
41
|
};
|
|
41
42
|
}
|
|
42
|
-
function
|
|
43
|
+
function et(r, h, p) {
|
|
43
44
|
const { isFormatted: u, isSinglePrice: A, currencyPosition: L, configuredSymbol: P } = p;
|
|
44
45
|
let y;
|
|
45
46
|
A ? y = u ? r.SINGLE_PRICE_FORMATTED : r.SINGLE_PRICE : y = u ? r.PRICE_FORMATTED : r.PRICE;
|
|
@@ -47,15 +48,15 @@ function Z(r, h, p) {
|
|
|
47
48
|
let F = `{{${y}_${h}}}`, R = "";
|
|
48
49
|
return B(P) ? R = P : E && (R = `{{${E}_${h}}}`), R && (F = L === "after" ? `${F} ${R}` : `${R} ${F}`), F;
|
|
49
50
|
}
|
|
50
|
-
function
|
|
51
|
-
const h = W(r), p = new DOMParser().parseFromString(h, "text/html");
|
|
52
|
-
|
|
51
|
+
function at(r) {
|
|
52
|
+
const h = W(X(r)), p = new DOMParser().parseFromString(h, "text/html");
|
|
53
|
+
Q(p);
|
|
53
54
|
const u = k.PAIRS_FOR_EXTENSION;
|
|
54
55
|
Object.entries(u).forEach(([o, T]) => {
|
|
55
56
|
p.querySelectorAll(".ins-product-td").forEach((n) => {
|
|
56
57
|
const S = n.getAttribute("data-number") || "1", I = n.getAttribute("data-type") || "CART_ITEMS";
|
|
57
58
|
n.querySelectorAll(`[product-attr="${o}"]`).forEach((t) => {
|
|
58
|
-
var
|
|
59
|
+
var g, M, x, D;
|
|
59
60
|
const m = t.getAttribute("data-type") || I, c = t.getAttribute("data-number") || S, f = T[m];
|
|
60
61
|
if (f)
|
|
61
62
|
switch (o) {
|
|
@@ -71,9 +72,9 @@ function ct(r) {
|
|
|
71
72
|
return l.includes(C) || l.includes($) || V === $;
|
|
72
73
|
}) && (e.src = `{{${a}_${c}}}`);
|
|
73
74
|
}
|
|
74
|
-
const s = (M = (
|
|
75
|
+
const s = (M = (g = u.name) == null ? void 0 : g[m]) == null ? void 0 : M.ATTR;
|
|
75
76
|
if (s && e.setAttribute("alt", `{{${s}_${c}}}`), i) {
|
|
76
|
-
const l = (
|
|
77
|
+
const l = (x = u.itemLink) == null ? void 0 : x[m];
|
|
77
78
|
if (l) {
|
|
78
79
|
const H = l.HREF, C = l.DEFAULT_HREF || "#!", $ = i.href;
|
|
79
80
|
($ === "#" || $ === "" || $.endsWith("#!") || $.endsWith(C) || $ === `${window.location.href}${C}` || !$ || $ === window.location.href) && (i.href = `{{${H}_${c}}}`);
|
|
@@ -93,12 +94,12 @@ function ct(r) {
|
|
|
93
94
|
}
|
|
94
95
|
case "price":
|
|
95
96
|
case "originalPrice": {
|
|
96
|
-
const e = f, i = G(n) ?
|
|
97
|
-
t.innerHTML = w(t,
|
|
97
|
+
const e = f, i = G(n) ? tt(n) : Z(t);
|
|
98
|
+
t.innerHTML = w(t, et(e, c, i));
|
|
98
99
|
break;
|
|
99
100
|
}
|
|
100
101
|
case "quantity": {
|
|
101
|
-
const e = f, i = e.ATTR, d = [e.DEFAULT, ...e.LEGACY_DEFAULTS], a = (
|
|
102
|
+
const e = f, i = e.ATTR, d = [e.DEFAULT, ...e.LEGACY_DEFAULTS], a = (D = t.textContent) == null ? void 0 : D.trim();
|
|
102
103
|
a && d.includes(a) && (t.innerHTML = w(t, `{{${i}_${c}}}`));
|
|
103
104
|
break;
|
|
104
105
|
}
|
|
@@ -108,7 +109,7 @@ function ct(r) {
|
|
|
108
109
|
const s = a.href || "", l = `${window.location.href}${d}`;
|
|
109
110
|
(s === "" || s === "#" || s === l || s.endsWith(d) || s.endsWith("#!") || s === window.location.href) && (a.href = `{{${i}_${c}}}`);
|
|
110
111
|
}
|
|
111
|
-
|
|
112
|
+
K(t, `{{${i}_${c}}}`);
|
|
112
113
|
break;
|
|
113
114
|
}
|
|
114
115
|
case "itemLink": {
|
|
@@ -145,7 +146,7 @@ function ct(r) {
|
|
|
145
146
|
y.reverse().forEach(({ outerHtml: o, type: T, number: _ }) => {
|
|
146
147
|
const n = q[T], S = n ? `${n}_total_product_kind` : "";
|
|
147
148
|
if (S) {
|
|
148
|
-
const
|
|
149
|
+
const b = parseInt(_) - 1, c = `${`{% if ${S} > ${b} %}`}${o}{% endif %}`;
|
|
149
150
|
E = E.replace(o, v(c));
|
|
150
151
|
}
|
|
151
152
|
});
|
|
@@ -159,20 +160,20 @@ function ct(r) {
|
|
|
159
160
|
if (!n || O.has(n))
|
|
160
161
|
return;
|
|
161
162
|
O.add(n);
|
|
162
|
-
const S = n.outerHTML, I = (t = o.closest(".ins-product-td")) == null ? void 0 : t.getAttribute("data-nodup"),
|
|
163
|
-
|
|
163
|
+
const S = n.outerHTML, I = (t = o.closest(".ins-product-td")) == null ? void 0 : t.getAttribute("data-nodup"), b = R.get(S) ?? { number: T, type: _, wrap: [] };
|
|
164
|
+
b.wrap.push(I !== "false"), R.set(S, b);
|
|
164
165
|
}), R.forEach(({ number: o, type: T, wrap: _ }, n) => {
|
|
165
166
|
if (n.includes("{% if") || !_.some(Boolean))
|
|
166
167
|
return;
|
|
167
|
-
const S = k.PAIRS_FOR_EXTENSION.price[T].PRICE, I = k.PAIRS_FOR_EXTENSION.originalPrice[T].PRICE,
|
|
168
|
-
let m = "", c = 0, f = 0,
|
|
169
|
-
for (;
|
|
170
|
-
const M = _[f] === !0 && !
|
|
171
|
-
m += E.slice(c,
|
|
168
|
+
const S = k.PAIRS_FOR_EXTENSION.price[T].PRICE, I = k.PAIRS_FOR_EXTENSION.originalPrice[T].PRICE, b = `{% if ${S}_${o} != ${I}_${o} %}`, t = [b, W(b)];
|
|
169
|
+
let m = "", c = 0, f = 0, g = E.indexOf(n);
|
|
170
|
+
for (; g !== -1; ) {
|
|
171
|
+
const M = _[f] === !0 && !z(E, g, t);
|
|
172
|
+
m += E.slice(c, g) + (M ? `${b}${n}{% endif %}` : n), c = g + n.length, f += 1, g = E.indexOf(n, c);
|
|
172
173
|
}
|
|
173
174
|
E = m + E.slice(c);
|
|
174
|
-
}), E.replaceAll("<!--{%", "{%").replaceAll("%}-->", "%}").replaceAll("<!--{%", "{%").replaceAll("%}-->", "%}");
|
|
175
|
+
}), j(E.replaceAll("<!--{%", "{%").replaceAll("%}-->", "%}").replaceAll("<!--{%", "{%").replaceAll("%}-->", "%}"));
|
|
175
176
|
}
|
|
176
177
|
export {
|
|
177
|
-
|
|
178
|
+
at as pairProductVariables
|
|
178
179
|
};
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
const n = "guido-table-text:", i = new RegExp(`<!--${n}([A-Za-z0-9+/=]*)-->`, "g"), T = /<!--[\s\S]*?-->|\{%[\s\S]*?%\}|<[a-zA-Z/!?](?:[^>"']|"[^"]*"|'[^']*')*>|[^<{]+|[<{]/g, o = /* @__PURE__ */ new Set(["table", "tbody", "thead", "tfoot", "tr", "colgroup"]), r = /* @__PURE__ */ new Set(["col"]), f = /* @__PURE__ */ new Set([...o, ...r, "td", "th", "caption"]), p = (s) => btoa(unescape(encodeURIComponent(s))), u = (s) => decodeURIComponent(escape(atob(s))), d = (s) => {
|
|
2
|
+
const e = /^<(\/?)([a-zA-Z][\w-]*)/.exec(s);
|
|
3
|
+
return { name: e ? e[2].toLowerCase() : "", closing: e ? e[1] === "/" : !1 };
|
|
4
|
+
};
|
|
5
|
+
function E(s) {
|
|
6
|
+
const e = [];
|
|
7
|
+
let a = !1;
|
|
8
|
+
return s.replace(T, (t) => {
|
|
9
|
+
if (t.startsWith("<!--") || t.startsWith("{%"))
|
|
10
|
+
return t;
|
|
11
|
+
if (t.length > 1 && t.startsWith("<")) {
|
|
12
|
+
const { name: c, closing: l } = d(t);
|
|
13
|
+
return a = f.has(c), !a || r.has(c) || (l ? e.includes(c) && e.splice(e.lastIndexOf(c)) : e.push(c)), t;
|
|
14
|
+
}
|
|
15
|
+
return a && o.has(e[e.length - 1] ?? "") && t.trim() ? `<!--${n}${p(t)}-->` : t;
|
|
16
|
+
});
|
|
17
|
+
}
|
|
18
|
+
const g = (s) => s.replace(i, (e, a) => u(a));
|
|
19
|
+
export {
|
|
20
|
+
E as protectTableText,
|
|
21
|
+
g as restoreTableText
|
|
22
|
+
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@useinsider/guido",
|
|
3
|
-
"version": "3.
|
|
3
|
+
"version": "3.27.0-beta.13ad95b",
|
|
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",
|
|
@@ -46,9 +46,11 @@
|
|
|
46
46
|
"test:watch": "vitest",
|
|
47
47
|
"test:visual-update": "npx playwright test --update-snapshots --reporter html",
|
|
48
48
|
"test:e2e:coverage": "E2E_COVERAGE=true playwright test",
|
|
49
|
+
"coverage:e2e:seed": "node scripts/e2e-coverage/seed-unloaded-coverage.mjs",
|
|
49
50
|
"coverage:e2e:report": "nyc report --reporter=lcov --reporter=text-summary --report-dir=coverage/e2e",
|
|
51
|
+
"coverage:e2e:verify": "node scripts/e2e-coverage/verify-lcov-inventory.mjs",
|
|
50
52
|
"test:mutation": "stryker run",
|
|
51
|
-
"test:mutation:since": "CHANGED=$(git diff --name-only --diff-filter=AMR origin/develop...HEAD -- 'src/**/*.ts' ':(glob)src/components/organisms/onboarding/**/*.vue' ':(glob)src/components/organisms/header/**/*.vue' ':(glob)src/components/organisms/unsubscribe/**/*.vue' ':(glob)src/components/organisms/save-as-template/**/*.vue' ':(glob)src/components/organisms/email-preview/**/*.vue' ':(glob)src/components/wrappers/**/*.vue' 'src/components/Guido.vue' ':(exclude)src/**/*.test.ts' ':(exclude)src/**/index.ts' ':(exclude)src/@types/**' ':(exclude)src/enums/**' ':(exclude)src/mock/**'
|
|
53
|
+
"test:mutation:since": "CHANGED=$(git diff --name-only --diff-filter=AMR origin/develop...HEAD -- 'src/**/*.ts' ':(glob)src/components/organisms/onboarding/**/*.vue' ':(glob)src/components/organisms/header/**/*.vue' ':(glob)src/components/organisms/unsubscribe/**/*.vue' ':(glob)src/components/organisms/save-as-template/**/*.vue' ':(glob)src/components/organisms/email-preview/**/*.vue' ':(glob)src/components/wrappers/**/*.vue' 'src/components/Guido.vue' ':(exclude)src/**/*.test.ts' ':(exclude)src/**/index.ts' ':(exclude)src/@types/**' ':(exclude)src/enums/**' ':(exclude)src/mock/**' | paste -sd, -); if [ -n \"$CHANGED\" ]; then stryker run --incremental --mutate \"$CHANGED\"; else echo \"No changed mutatable src files vs origin/develop\"; fi",
|
|
52
54
|
"stripo:manifest": "node scripts/stripo-runtime-manifest.mjs",
|
|
53
55
|
"prepare": "husky",
|
|
54
56
|
"preinstall": "rm -rf ./node_modules/.vite"
|
|
@@ -58,7 +60,7 @@
|
|
|
58
60
|
"license": "ISC",
|
|
59
61
|
"dependencies": {
|
|
60
62
|
"@stripoinc/ui-editor-extensions": "3.11.0",
|
|
61
|
-
"@useinsider/design-system-organisms": "0.0
|
|
63
|
+
"@useinsider/design-system-organisms": "0.4.0",
|
|
62
64
|
"@useinsider/design-system-vue": "2.5.0",
|
|
63
65
|
"@vueuse/core": "11.3.0",
|
|
64
66
|
"lodash-es": "4.17.21",
|
|
@@ -99,9 +101,11 @@
|
|
|
99
101
|
"globals": "16.0.0",
|
|
100
102
|
"happy-dom": "15.11.7",
|
|
101
103
|
"husky": "9.1.7",
|
|
104
|
+
"istanbul-lib-instrument": "6.0.3",
|
|
102
105
|
"msw": "2.10.3",
|
|
103
106
|
"nyc": "18.0.0",
|
|
104
107
|
"sass": "1.69.7",
|
|
108
|
+
"test-exclude": "7.0.2",
|
|
105
109
|
"typescript": "5.5.4",
|
|
106
110
|
"typescript-eslint": "8.26.0",
|
|
107
111
|
"vite-plugin-dts": "4.5.4",
|
|
@@ -124,6 +128,10 @@
|
|
|
124
128
|
"lcov",
|
|
125
129
|
"text-summary"
|
|
126
130
|
],
|
|
131
|
+
"extension": [
|
|
132
|
+
".ts",
|
|
133
|
+
".vue"
|
|
134
|
+
],
|
|
127
135
|
"all": false
|
|
128
136
|
},
|
|
129
137
|
"guido": {
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import { Block, BlockCompositionType } from '@stripoinc/ui-editor-extensions';
|
|
2
|
-
export declare const BLOCK_ID = "{{your-block}}";
|
|
3
|
-
export declare class CustomBlock extends Block {
|
|
4
|
-
constructor();
|
|
5
|
-
getId(): string;
|
|
6
|
-
getIcon(): string;
|
|
7
|
-
getBlockCompositionType(): BlockCompositionType;
|
|
8
|
-
getName(): string;
|
|
9
|
-
getDescription(): string;
|
|
10
|
-
getTemplate(): string;
|
|
11
|
-
}
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Extension Constants
|
|
3
|
-
*
|
|
4
|
-
* This module re-exports all constants for the extension.
|
|
5
|
-
* Import from this file for cleaner imports.
|
|
6
|
-
* @example
|
|
7
|
-
* import { BlockControlId, BLOCK_ROOT_SELECTOR } from './constants';
|
|
8
|
-
*/
|
|
9
|
-
export { BlockControlId } from './controlIds';
|
|
10
|
-
export { BLOCK_ROOT_SELECTOR, CSS_CLASS_BLOCK, CSS_CLASS_BLOCK_V2, } from './selectors';
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* CSS selectors and class names used across the extension
|
|
3
|
-
*
|
|
4
|
-
* Declare them ONCE here and import everywhere (template, migrator, save validator,
|
|
5
|
-
* controls). The same literal re-typed across those files is how a rename half-lands.
|
|
6
|
-
*/
|
|
7
|
-
/** Stable contract class, if the backend selects this block by name. Renaming breaks it. */
|
|
8
|
-
export declare const CSS_CLASS_BLOCK = "{{your-block}}";
|
|
9
|
-
/** Current block class — what the template emits and the migrator upgrades legacy blocks to. */
|
|
10
|
-
export declare const CSS_CLASS_BLOCK_V2 = "{{your-block}}-v2";
|
|
11
|
-
/**
|
|
12
|
-
* Block root selector — the block `<td>` itself.
|
|
13
|
-
* Used across block-level controls so edits apply to the whole block, not the title cell.
|
|
14
|
-
* Derived from the class so a rename cannot half-land.
|
|
15
|
-
*/
|
|
16
|
-
export declare const BLOCK_ROOT_SELECTOR = ".{{your-block}}-v2";
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
import { Control, ImmutableHtmlNode } from '@stripoinc/ui-editor-extensions';
|
|
2
|
-
export declare const CONTROL_BLOCK_ID = "ui-elements-{{your-control-block}}";
|
|
3
|
-
export declare class CustomControl extends Control {
|
|
4
|
-
private currentNode?;
|
|
5
|
-
private selectedUnsubGroup?;
|
|
6
|
-
private unsubList;
|
|
7
|
-
getId(): string;
|
|
8
|
-
_setFormValues(): void;
|
|
9
|
-
_getLabel(text: string, name?: string): string;
|
|
10
|
-
_getSelectItem(text: string, value: string): string;
|
|
11
|
-
_getSelect(): string;
|
|
12
|
-
getTemplate(): string;
|
|
13
|
-
_onSelectChange(value: string | number): void;
|
|
14
|
-
_listenToFormUpdates(): void;
|
|
15
|
-
onTemplateNodeUpdated(node: ImmutableHtmlNode): void;
|
|
16
|
-
onRender(): Promise<void>;
|
|
17
|
-
}
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
export declare const BlockBackgroundControl: {
|
|
2
|
-
new (): {
|
|
3
|
-
getId(): string;
|
|
4
|
-
getLabels(): {
|
|
5
|
-
title: string;
|
|
6
|
-
};
|
|
7
|
-
getTargetNodes(root: import("@stripoinc/ui-editor-extensions").ImmutableHtmlNode): import("@stripoinc/ui-editor-extensions").ImmutableHtmlNode[];
|
|
8
|
-
getAdditionalModifications(root: import("@stripoinc/ui-editor-extensions").ImmutableHtmlNode): import("@stripoinc/ui-editor-extensions").TemplateModifier<import("@stripoinc/ui-editor-extensions").HtmlNodeModifier, import("@stripoinc/ui-editor-extensions").CssNodeModifier> | undefined;
|
|
9
|
-
getParentControlId(): string;
|
|
10
|
-
api: import("@stripoinc/ui-editor-extensions").ControlApi;
|
|
11
|
-
getModificationDescription(): import("@stripoinc/ui-editor-extensions").ModificationDescription | undefined;
|
|
12
|
-
isVisible(_node: import("@stripoinc/ui-editor-extensions").ImmutableHtmlNode): boolean;
|
|
13
|
-
getElementLockCategory(): import("@stripoinc/ui-editor-extensions").ElementLockCategory | undefined;
|
|
14
|
-
};
|
|
15
|
-
};
|
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
declare const migrationTemplate = "\n <td \n align=\"left\" \n esd-extension-block-id=\"checkbox-block\" \n class=\"checkbox-block-v2 esd-block-checkbox esd-checkbox-block esd-extension-block es-p20\"\n >\n <table cellpadding=\"0\" cellspacing=\"0\" role=\"presentation\" width=\"100%\">\n <tbody>\n <tr>\n <td align=\"left\" width=\"39\" style=\"vertical-align: top\">\n <input type=\"checkbox\">\n </td>\n <td align=\"left\" width=\"816\" style=\"vertical-align: top\">\n <table cellpadding=\"0\" cellspacing=\"0\" role=\"presentation\" width=\"100%\">\n <tbody>\n <tr>{-{-TITLE-}-}</tr>\n <tr>{-{-DESCRIPTION-}-}</tr>\n </tbody>\n </table>\n </td>\n </tr>\n </tbody>\n </table>\n </td>\n";
|
|
2
|
-
/**
|
|
3
|
-
* @returns The template for the default checkbox block
|
|
4
|
-
*/
|
|
5
|
-
export declare function getDefaultTemplate(): string;
|
|
6
|
-
export default migrationTemplate;
|
|
File without changes
|