@useinsider/guido 3.2.0-beta.78d83bd → 3.2.0-beta.7e0c6bd
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/@types/config/schemas.js +1 -1
- package/dist/@types/config/validator.js +27 -34
- package/dist/components/Guido.vue.js +1 -1
- package/dist/components/Guido.vue2.js +76 -81
- package/dist/components/organisms/base/Toaster.vue2.js +10 -11
- package/dist/components/organisms/email-preview/desktop-preview/DesktopPreview.vue2.js +12 -12
- package/dist/components/organisms/email-preview/mobile-preview/ContentView.vue2.js +6 -6
- package/dist/components/organisms/email-preview/mobile-preview/InboxView.vue2.js +9 -15
- package/dist/components/organisms/extensions/recommendation/FilterItem.vue2.js +31 -40
- package/dist/components/organisms/extensions/recommendation/FilterSelectionDrawer.vue2.js +19 -20
- package/dist/components/organisms/extensions/recommendation/Filters.vue2.js +11 -14
- package/dist/components/organisms/header/EditorActions.vue.js +11 -12
- package/dist/components/organisms/header/EditorActions.vue2.js +18 -22
- package/dist/components/organisms/header/HeaderWrapper.vue2.js +12 -15
- package/dist/components/organisms/header/LeftSlot.vue2.js +16 -19
- package/dist/components/organisms/header/MiddleSlot.vue2.js +14 -11
- package/dist/components/organisms/header/RightSlot.vue2.js +14 -17
- package/dist/components/organisms/onboarding/AMPOnboarding.vue.js +11 -12
- package/dist/components/organisms/onboarding/AMPOnboarding.vue2.js +49 -31
- package/dist/components/organisms/onboarding/GenericOnboarding.vue.js +12 -13
- package/dist/components/organisms/onboarding/GenericOnboarding.vue2.js +36 -38
- package/dist/components/organisms/onboarding/ItemsOnboarding.vue.js +12 -13
- package/dist/components/organisms/onboarding/ItemsOnboarding.vue2.js +47 -51
- package/dist/components/organisms/onboarding/NewVersionPopup.vue2.js +18 -21
- package/dist/components/organisms/onboarding/OnboardingWrapper.vue2.js +27 -31
- package/dist/components/organisms/onboarding/TextBlockOnboarding.vue.js +12 -13
- package/dist/components/organisms/onboarding/TextBlockOnboarding.vue2.js +33 -46
- package/dist/components/organisms/onboarding/VersionHistoryOnboarding.vue.js +11 -12
- package/dist/components/organisms/onboarding/VersionHistoryOnboarding.vue2.js +20 -21
- package/dist/components/organisms/save-as-template/SaveAsTemplateDrawer.vue2.js +8 -9
- package/dist/components/organisms/unsubscribe/UnsubscribeWrapper.vue.js +9 -10
- package/dist/composables/useActionsApi.js +37 -38
- package/dist/composables/useBlocksConfig.js +26 -26
- package/dist/composables/useFullStoryBridge.js +8 -9
- package/dist/composables/useHtmlCompiler.js +34 -26
- package/dist/composables/useHtmlValidator.js +101 -109
- package/dist/composables/useHttp.js +30 -30
- package/dist/composables/usePartner.js +1 -1
- package/dist/composables/useRecommendation.js +14 -15
- package/dist/composables/useRibbonOffset.js +21 -0
- package/dist/composables/useSave.js +21 -22
- package/dist/composables/useStripo.js +53 -50
- package/dist/composables/useSyncModuleExtractor.js +31 -29
- package/dist/composables/useTimerClone.js +24 -25
- package/dist/composables/useTranslations.js +23 -16
- package/dist/composables/useValidation.js +7 -8
- package/dist/composables/validators/useLiquidValidator.js +13 -13
- package/dist/config/compiler/unsubscribeCompilerRules.js +17 -19
- package/dist/config/compiler/utils/recommendationCompilerUtils.js +10 -11
- package/dist/config/migrator/checkboxMigrator.js +20 -21
- package/dist/config/migrator/couponBlockMigrator.js +18 -19
- package/dist/config/migrator/itemsBlockMigrator.js +87 -89
- package/dist/config/migrator/radioButtonMigrator.js +12 -13
- package/dist/config/migrator/recommendationMigrator.js +106 -109
- package/dist/config/migrator/unsubscribeMigrator.js +10 -11
- package/dist/enums/onboarding.js +7 -2
- package/dist/enums/unsubscribe.js +18 -19
- package/dist/extensions/Blocks/Items/block.js +9 -9
- package/dist/extensions/Blocks/Items/controls/button/link.js +14 -14
- package/dist/extensions/Blocks/Items/controls/cardComposition.js +89 -97
- package/dist/extensions/Blocks/Items/controls/image/link.js +14 -14
- package/dist/extensions/Blocks/Items/controls/name/trimming.js +23 -24
- package/dist/extensions/Blocks/Items/controls/price/currencyLocation.js +13 -14
- package/dist/extensions/Blocks/Items/controls/price/currencySymbol.js +44 -47
- package/dist/extensions/Blocks/Items/controls/price/formattedPrice.js +38 -38
- package/dist/extensions/Blocks/Items/controls/price/hideDiscount.js +11 -11
- package/dist/extensions/Blocks/Items/controls/price/priceOrientation.js +38 -40
- package/dist/extensions/Blocks/Items/controls/price/singlePrice.js +35 -35
- package/dist/extensions/Blocks/Items/controls/settingsControl.js +155 -162
- package/dist/extensions/Blocks/Items/enums/productEnums.js +9 -14
- package/dist/extensions/Blocks/Items/template.js +218 -216
- package/dist/extensions/Blocks/Recommendation/controls/button/index.js +36 -36
- package/dist/extensions/Blocks/Recommendation/controls/cardComposition/index.js +128 -133
- package/dist/extensions/Blocks/Recommendation/controls/customAttribute/index.js +9 -9
- package/dist/extensions/Blocks/Recommendation/controls/customAttribute/textTrim.js +10 -10
- package/dist/extensions/Blocks/Recommendation/controls/image/index.js +9 -9
- package/dist/extensions/Blocks/Recommendation/controls/main/algorithm.js +17 -18
- package/dist/extensions/Blocks/Recommendation/controls/main/filters.js +4 -6
- package/dist/extensions/Blocks/Recommendation/controls/main/index.js +82 -90
- package/dist/extensions/Blocks/Recommendation/controls/main/layoutOrientation.js +18 -18
- package/dist/extensions/Blocks/Recommendation/controls/main/productCount.js +4 -4
- package/dist/extensions/Blocks/Recommendation/controls/main/productLayout.js +35 -36
- package/dist/extensions/Blocks/Recommendation/controls/main/utils.js +134 -135
- package/dist/extensions/Blocks/Recommendation/controls/name/index.js +24 -24
- package/dist/extensions/Blocks/Recommendation/controls/name/textTrim.js +10 -10
- package/dist/extensions/Blocks/Recommendation/controls/oldPrice/index.js +24 -24
- package/dist/extensions/Blocks/Recommendation/controls/omnibusDiscount/index.js +24 -24
- package/dist/extensions/Blocks/Recommendation/controls/omnibusDiscount/textAfter.js +4 -4
- package/dist/extensions/Blocks/Recommendation/controls/omnibusDiscount/textBefore.js +4 -4
- package/dist/extensions/Blocks/Recommendation/controls/omnibusPrice/index.js +24 -24
- package/dist/extensions/Blocks/Recommendation/controls/omnibusPrice/textAfter.js +4 -4
- package/dist/extensions/Blocks/Recommendation/controls/omnibusPrice/textBefore.js +4 -4
- package/dist/extensions/Blocks/Recommendation/controls/price/index.js +24 -24
- package/dist/extensions/Blocks/Recommendation/controls/spacing/index.js +32 -32
- package/dist/extensions/Blocks/Recommendation/controls/syncInfoMessage.js +18 -20
- package/dist/extensions/Blocks/Recommendation/extension.js +31 -32
- package/dist/extensions/Blocks/Recommendation/settingsPanel.js +8 -16
- package/dist/extensions/Blocks/Recommendation/store/recommendation.js +55 -56
- package/dist/extensions/Blocks/Recommendation/templates/grid/elementRenderer.js +22 -23
- package/dist/extensions/Blocks/Recommendation/templates/grid/migration.js +10 -10
- package/dist/extensions/Blocks/Recommendation/templates/grid/template.js +10 -10
- package/dist/extensions/Blocks/Recommendation/templates/index.js +6 -6
- package/dist/extensions/Blocks/Recommendation/templates/list/elementRenderer.js +24 -25
- package/dist/extensions/Blocks/Recommendation/templates/list/template.js +1 -1
- package/dist/extensions/Blocks/Recommendation/templates/utils.js +45 -47
- package/dist/extensions/Blocks/Recommendation/validation/filterSchema.js +13 -16
- package/dist/extensions/Blocks/Unsubscribe/control.js +11 -13
- package/dist/extensions/Blocks/Unsubscribe/elements/preview.js +16 -18
- package/dist/extensions/Blocks/common-control.js +25 -26
- package/dist/extensions/DynamicContent/dynamic-content.js +53 -58
- package/dist/guido.css +1 -1
- package/dist/library.js +11 -12
- package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/esm/index.js +233 -210
- package/dist/node_modules/valibot/dist/index.js +122 -126
- package/dist/package.json.js +1 -1
- package/dist/services/recommendationApi.js +14 -17
- package/dist/services/templateLibraryApi.js +37 -38
- package/dist/src/components/wrappers/WpModal.vue.d.ts +1 -1
- package/dist/src/composables/useHtmlCompiler.d.ts +1 -2
- package/dist/src/composables/useRibbonOffset.d.ts +4 -0
- package/dist/src/composables/useTranslations.d.ts +1 -1
- package/dist/src/enums/onboarding.d.ts +6 -0
- package/dist/src/stores/dynamic-content.d.ts +3 -3
- package/dist/src/stores/onboarding.d.ts +4 -0
- package/dist/stores/config.js +25 -81
- package/dist/stores/dynamic-content.js +6 -11
- package/dist/stores/onboarding.js +5 -1
- package/dist/stores/preview.js +6 -9
- package/dist/stores/unsubscribe.js +1 -4
- package/dist/utils/dateUtil.js +7 -10
- package/dist/utils/genericUtil.js +10 -13
- package/dist/utils/pairProductVariables.js +13 -14
- package/package.json +8 -5
- package/dist/node_modules/lodash-es/_DataView.js +0 -6
- package/dist/node_modules/lodash-es/_Hash.js +0 -20
- package/dist/node_modules/lodash-es/_ListCache.js +0 -20
- package/dist/node_modules/lodash-es/_Map.js +0 -6
- package/dist/node_modules/lodash-es/_MapCache.js +0 -20
- package/dist/node_modules/lodash-es/_Promise.js +0 -6
- package/dist/node_modules/lodash-es/_Set.js +0 -6
- package/dist/node_modules/lodash-es/_SetCache.js +0 -13
- package/dist/node_modules/lodash-es/_Stack.js +0 -18
- package/dist/node_modules/lodash-es/_Symbol.js +0 -5
- package/dist/node_modules/lodash-es/_Uint8Array.js +0 -5
- package/dist/node_modules/lodash-es/_WeakMap.js +0 -6
- package/dist/node_modules/lodash-es/_arrayFilter.js +0 -10
- package/dist/node_modules/lodash-es/_arrayLikeKeys.js +0 -20
- package/dist/node_modules/lodash-es/_arrayMap.js +0 -8
- package/dist/node_modules/lodash-es/_arrayPush.js +0 -8
- package/dist/node_modules/lodash-es/_arraySome.js +0 -9
- package/dist/node_modules/lodash-es/_assocIndexOf.js +0 -10
- package/dist/node_modules/lodash-es/_baseEach.js +0 -6
- package/dist/node_modules/lodash-es/_baseFlatten.js +0 -13
- package/dist/node_modules/lodash-es/_baseFor.js +0 -5
- package/dist/node_modules/lodash-es/_baseForOwn.js +0 -8
- package/dist/node_modules/lodash-es/_baseGet.js +0 -11
- package/dist/node_modules/lodash-es/_baseGetAllKeys.js +0 -9
- package/dist/node_modules/lodash-es/_baseGetTag.js +0 -10
- package/dist/node_modules/lodash-es/_baseHasIn.js +0 -6
- package/dist/node_modules/lodash-es/_baseIsArguments.js +0 -9
- package/dist/node_modules/lodash-es/_baseIsEqual.js +0 -8
- package/dist/node_modules/lodash-es/_baseIsEqualDeep.js +0 -32
- package/dist/node_modules/lodash-es/_baseIsMatch.js +0 -29
- package/dist/node_modules/lodash-es/_baseIsNative.js +0 -16
- package/dist/node_modules/lodash-es/_baseIsTypedArray.js +0 -12
- package/dist/node_modules/lodash-es/_baseIteratee.js +0 -11
- package/dist/node_modules/lodash-es/_baseKeys.js +0 -14
- package/dist/node_modules/lodash-es/_baseMap.js +0 -11
- package/dist/node_modules/lodash-es/_baseMatches.js +0 -12
- package/dist/node_modules/lodash-es/_baseMatchesProperty.js +0 -17
- package/dist/node_modules/lodash-es/_baseProperty.js +0 -8
- package/dist/node_modules/lodash-es/_basePropertyDeep.js +0 -9
- package/dist/node_modules/lodash-es/_baseRange.js +0 -9
- package/dist/node_modules/lodash-es/_baseTimes.js +0 -8
- package/dist/node_modules/lodash-es/_baseToString.js +0 -18
- package/dist/node_modules/lodash-es/_baseTrim.js +0 -8
- package/dist/node_modules/lodash-es/_baseUnary.js +0 -8
- package/dist/node_modules/lodash-es/_cacheHas.js +0 -6
- package/dist/node_modules/lodash-es/_castPath.js +0 -10
- package/dist/node_modules/lodash-es/_coreJsData.js +0 -5
- package/dist/node_modules/lodash-es/_createBaseEach.js +0 -15
- package/dist/node_modules/lodash-es/_createBaseFor.js +0 -13
- package/dist/node_modules/lodash-es/_createRange.js +0 -11
- package/dist/node_modules/lodash-es/_equalArrays.js +0 -40
- package/dist/node_modules/lodash-es/_equalByTag.js +0 -45
- package/dist/node_modules/lodash-es/_equalObjects.js +0 -36
- package/dist/node_modules/lodash-es/_freeGlobal.js +0 -4
- package/dist/node_modules/lodash-es/_getAllKeys.js +0 -9
- package/dist/node_modules/lodash-es/_getMapData.js +0 -8
- package/dist/node_modules/lodash-es/_getMatchData.js +0 -12
- package/dist/node_modules/lodash-es/_getNative.js +0 -9
- package/dist/node_modules/lodash-es/_getRawTag.js +0 -15
- package/dist/node_modules/lodash-es/_getSymbols.js +0 -10
- package/dist/node_modules/lodash-es/_getTag.js +0 -28
- package/dist/node_modules/lodash-es/_getValue.js +0 -6
- package/dist/node_modules/lodash-es/_hasPath.js +0 -19
- package/dist/node_modules/lodash-es/_hashClear.js +0 -7
- package/dist/node_modules/lodash-es/_hashDelete.js +0 -7
- package/dist/node_modules/lodash-es/_hashGet.js +0 -13
- package/dist/node_modules/lodash-es/_hashHas.js +0 -9
- package/dist/node_modules/lodash-es/_hashSet.js +0 -9
- package/dist/node_modules/lodash-es/_isFlattenable.js +0 -10
- package/dist/node_modules/lodash-es/_isIndex.js +0 -8
- package/dist/node_modules/lodash-es/_isIterateeCall.js +0 -13
- package/dist/node_modules/lodash-es/_isKey.js +0 -12
- package/dist/node_modules/lodash-es/_isKeyable.js +0 -7
- package/dist/node_modules/lodash-es/_isMasked.js +0 -11
- package/dist/node_modules/lodash-es/_isPrototype.js +0 -8
- package/dist/node_modules/lodash-es/_isStrictComparable.js +0 -7
- package/dist/node_modules/lodash-es/_listCacheClear.js +0 -6
- package/dist/node_modules/lodash-es/_listCacheDelete.js +0 -12
- package/dist/node_modules/lodash-es/_listCacheGet.js +0 -8
- package/dist/node_modules/lodash-es/_listCacheHas.js +0 -7
- package/dist/node_modules/lodash-es/_listCacheSet.js +0 -8
- package/dist/node_modules/lodash-es/_mapCacheClear.js +0 -13
- package/dist/node_modules/lodash-es/_mapCacheDelete.js +0 -8
- package/dist/node_modules/lodash-es/_mapCacheGet.js +0 -7
- package/dist/node_modules/lodash-es/_mapCacheHas.js +0 -7
- package/dist/node_modules/lodash-es/_mapCacheSet.js +0 -8
- package/dist/node_modules/lodash-es/_mapToArray.js +0 -9
- package/dist/node_modules/lodash-es/_matchesStrictComparable.js +0 -8
- package/dist/node_modules/lodash-es/_memoizeCapped.js +0 -11
- package/dist/node_modules/lodash-es/_nativeCreate.js +0 -5
- package/dist/node_modules/lodash-es/_nativeKeys.js +0 -5
- package/dist/node_modules/lodash-es/_nodeUtil.js +0 -11
- package/dist/node_modules/lodash-es/_objectToString.js +0 -7
- package/dist/node_modules/lodash-es/_overArg.js +0 -8
- package/dist/node_modules/lodash-es/_root.js +0 -5
- package/dist/node_modules/lodash-es/_setCacheAdd.js +0 -7
- package/dist/node_modules/lodash-es/_setCacheHas.js +0 -6
- package/dist/node_modules/lodash-es/_setToArray.js +0 -9
- package/dist/node_modules/lodash-es/_stackClear.js +0 -7
- package/dist/node_modules/lodash-es/_stackDelete.js +0 -7
- package/dist/node_modules/lodash-es/_stackGet.js +0 -6
- package/dist/node_modules/lodash-es/_stackHas.js +0 -6
- package/dist/node_modules/lodash-es/_stackSet.js +0 -17
- package/dist/node_modules/lodash-es/_stringToPath.js +0 -10
- package/dist/node_modules/lodash-es/_toKey.js +0 -10
- package/dist/node_modules/lodash-es/_toSource.js +0 -17
- package/dist/node_modules/lodash-es/_trimmedEndIndex.js +0 -9
- package/dist/node_modules/lodash-es/eq.js +0 -6
- package/dist/node_modules/lodash-es/flatMap.js +0 -8
- package/dist/node_modules/lodash-es/get.js +0 -8
- package/dist/node_modules/lodash-es/hasIn.js +0 -8
- package/dist/node_modules/lodash-es/identity.js +0 -6
- package/dist/node_modules/lodash-es/isArguments.js +0 -10
- package/dist/node_modules/lodash-es/isArray.js +0 -4
- package/dist/node_modules/lodash-es/isArrayLike.js +0 -8
- package/dist/node_modules/lodash-es/isBuffer.js +0 -6
- package/dist/node_modules/lodash-es/isFunction.js +0 -12
- package/dist/node_modules/lodash-es/isLength.js +0 -7
- package/dist/node_modules/lodash-es/isObject.js +0 -7
- package/dist/node_modules/lodash-es/isObjectLike.js +0 -6
- package/dist/node_modules/lodash-es/isSymbol.js +0 -9
- package/dist/node_modules/lodash-es/isTypedArray.js +0 -7
- package/dist/node_modules/lodash-es/keys.js +0 -9
- package/dist/node_modules/lodash-es/map.js +0 -11
- package/dist/node_modules/lodash-es/memoize.js +0 -18
- package/dist/node_modules/lodash-es/property.js +0 -10
- package/dist/node_modules/lodash-es/range.js +0 -5
- package/dist/node_modules/lodash-es/stubArray.js +0 -6
- package/dist/node_modules/lodash-es/stubFalse.js +0 -6
- package/dist/node_modules/lodash-es/toFinite.js +0 -14
- package/dist/node_modules/lodash-es/toNumber.js +0 -22
- package/dist/node_modules/lodash-es/toString.js +0 -7
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { getCsrfToken as H } from "../utils/genericUtil.js";
|
|
2
|
-
import { ref as
|
|
3
|
-
const k = (
|
|
4
|
-
const
|
|
2
|
+
import { ref as T, computed as h } from "vue";
|
|
3
|
+
const k = (E = {}) => {
|
|
4
|
+
const d = T(!1), n = T(null), l = T(null), b = h(() => d.value), g = h(() => n.value !== null), m = {
|
|
5
5
|
baseURL: "",
|
|
6
6
|
timeout: 1e4,
|
|
7
7
|
retry: 0,
|
|
@@ -10,11 +10,11 @@ const k = (b = {}) => {
|
|
|
10
10
|
"Content-Type": "application/json",
|
|
11
11
|
"X-CSRF-TOKEN": H()
|
|
12
12
|
},
|
|
13
|
-
...
|
|
13
|
+
...E
|
|
14
14
|
}, w = (e, s) => {
|
|
15
15
|
if (e.startsWith("http://") || e.startsWith("https://"))
|
|
16
16
|
return e;
|
|
17
|
-
const t = s ||
|
|
17
|
+
const t = s || m.baseURL || "";
|
|
18
18
|
return t.endsWith("/") && e.startsWith("/") ? `${t}${e.slice(1)}` : t.endsWith("/") || e.startsWith("/") ? `${t}${e}` : `${t}/${e}`;
|
|
19
19
|
}, P = (e) => new Promise((s, t) => {
|
|
20
20
|
setTimeout(() => {
|
|
@@ -23,53 +23,53 @@ const k = (b = {}) => {
|
|
|
23
23
|
}), x = (e) => new Promise((s) => {
|
|
24
24
|
setTimeout(s, e);
|
|
25
25
|
}), i = async (e, s, t, D = {}) => {
|
|
26
|
-
|
|
27
|
-
const
|
|
26
|
+
n.value = null, d.value = !0, l.value = new AbortController();
|
|
27
|
+
const a = { ...m, ...D }, L = w(s, a.baseURL), u = {
|
|
28
28
|
method: e,
|
|
29
|
-
headers: { ...
|
|
30
|
-
signal:
|
|
31
|
-
...
|
|
29
|
+
headers: { ...a.headers },
|
|
30
|
+
signal: l.value.signal,
|
|
31
|
+
...a
|
|
32
32
|
};
|
|
33
|
-
t && ["POST", "PUT", "PATCH"].includes(e) && (t instanceof FormData ? (delete
|
|
34
|
-
const
|
|
33
|
+
t && ["POST", "PUT", "PATCH"].includes(e) && (t instanceof FormData ? (delete u.headers["Content-Type"], u.body = t) : u.body = JSON.stringify(t));
|
|
34
|
+
const y = async (p = 0) => {
|
|
35
35
|
try {
|
|
36
|
-
const o = [fetch(L,
|
|
37
|
-
|
|
36
|
+
const o = [fetch(L, u)];
|
|
37
|
+
a.timeout && o.push(P(a.timeout));
|
|
38
38
|
const r = await Promise.race(o);
|
|
39
39
|
if (!r.ok) {
|
|
40
|
-
const O = `HTTP Error: ${r.status} ${r.statusText}`,
|
|
41
|
-
throw
|
|
40
|
+
const O = `HTTP Error: ${r.status} ${r.statusText}`, f = new Error(O);
|
|
41
|
+
throw f.status = r.status, f.statusText = r.statusText, f.response = r, f;
|
|
42
42
|
}
|
|
43
|
-
let
|
|
44
|
-
const
|
|
45
|
-
return
|
|
46
|
-
data:
|
|
43
|
+
let c;
|
|
44
|
+
const v = r.headers.get("content-type");
|
|
45
|
+
return v?.includes("application/json") ? c = await r.json() : v?.includes("text/") ? c = await r.text() : c = await r.blob(), {
|
|
46
|
+
data: c,
|
|
47
47
|
status: r.status,
|
|
48
48
|
statusText: r.statusText,
|
|
49
49
|
headers: r.headers
|
|
50
50
|
};
|
|
51
51
|
} catch (o) {
|
|
52
52
|
const r = o instanceof Error && o.name === "AbortError";
|
|
53
|
-
if (
|
|
54
|
-
return await x(
|
|
55
|
-
throw o instanceof Error ? o.name === "AbortError" ?
|
|
53
|
+
if (p < (a.retry || 0) && !r)
|
|
54
|
+
return await x(a.retryDelay || 1e3), y(p + 1);
|
|
55
|
+
throw o instanceof Error ? o.name === "AbortError" ? n.value = { message: "Request was cancelled" } : n.value = { message: o.message } : n.value = o, o;
|
|
56
56
|
}
|
|
57
57
|
};
|
|
58
58
|
try {
|
|
59
|
-
return await
|
|
59
|
+
return await y();
|
|
60
60
|
} finally {
|
|
61
|
-
|
|
61
|
+
d.value = !1, l.value = null;
|
|
62
62
|
}
|
|
63
63
|
}, C = (e, s) => i("GET", e, void 0, s), $ = (e, s, t) => i("POST", e, s, t), R = (e, s, t) => i("PUT", e, s, t), U = (e, s, t) => i("PATCH", e, s, t), A = (e, s) => i("DELETE", e, void 0, s), W = (e) => {
|
|
64
|
-
|
|
64
|
+
l.value && l.value.abort(e);
|
|
65
65
|
}, q = () => {
|
|
66
|
-
|
|
66
|
+
n.value = null;
|
|
67
67
|
};
|
|
68
68
|
return {
|
|
69
69
|
// State
|
|
70
|
-
loading:
|
|
71
|
-
error:
|
|
72
|
-
hasError:
|
|
70
|
+
loading: b,
|
|
71
|
+
error: h(() => n.value),
|
|
72
|
+
hasError: g,
|
|
73
73
|
// Methods
|
|
74
74
|
request: i,
|
|
75
75
|
get: C,
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { useConfigStore as i } from "../stores/config.js";
|
|
2
|
-
import { ProductType as t } from "../@types/config/schemas.js";
|
|
3
2
|
import { isTestPartner as o } from "../@types/config/defaults.js";
|
|
3
|
+
import { ProductType as t } from "../@types/config/schemas.js";
|
|
4
4
|
const T = () => {
|
|
5
5
|
const e = i(), n = () => e.initialized && e.partnerName ? e.partnerName : window.location.hostname.split(".")[0] || "";
|
|
6
6
|
return {
|
|
@@ -1,20 +1,20 @@
|
|
|
1
|
-
import { RecommendationFeedSourceMaps as
|
|
2
|
-
import { MinDeviceViewport as
|
|
3
|
-
import { useRecommendationExtensionStore as
|
|
4
|
-
import { generateCompleteFilterQuery as
|
|
5
|
-
import { useConfigStore as
|
|
6
|
-
const
|
|
1
|
+
import { RecommendationFeedSourceMaps as f, URLS as g } from "../enums/extensions/recommendationBlock.js";
|
|
2
|
+
import { MinDeviceViewport as p, DefaultPadding as R } from "../enums/recommendation.js";
|
|
3
|
+
import { useRecommendationExtensionStore as m } from "../extensions/Blocks/Recommendation/store/recommendation.js";
|
|
4
|
+
import { generateCompleteFilterQuery as b } from "../extensions/Blocks/Recommendation/utils/filterUtil.js";
|
|
5
|
+
import { useConfigStore as x } from "../stores/config.js";
|
|
6
|
+
const P = () => ({
|
|
7
7
|
calculateCardWidth: ({
|
|
8
8
|
mobileLeftPadding: i,
|
|
9
9
|
mobileRightPadding: n,
|
|
10
10
|
cardsInRow: o,
|
|
11
11
|
unresponsive: a
|
|
12
12
|
}) => {
|
|
13
|
-
const r = a ? o : 1, e = i + n + (r - 1) *
|
|
14
|
-
return (
|
|
13
|
+
const r = a ? o : 1, e = i + n + (r - 1) * R;
|
|
14
|
+
return (p - e) / r;
|
|
15
15
|
},
|
|
16
16
|
getRecommendationCampaignData: (i) => {
|
|
17
|
-
const n =
|
|
17
|
+
const n = m(), o = Number(i), a = n.blockStates[o];
|
|
18
18
|
if (!a)
|
|
19
19
|
return {
|
|
20
20
|
textTrimming: !1,
|
|
@@ -43,18 +43,17 @@ const N = () => ({
|
|
|
43
43
|
};
|
|
44
44
|
},
|
|
45
45
|
buildCampaignUrl: (i) => {
|
|
46
|
-
|
|
47
|
-
const n = u(), o = I(), a = Number(i), r = n.blockStates[a];
|
|
46
|
+
const n = m(), o = x(), a = Number(i), r = n.blockStates[a];
|
|
48
47
|
if (!r)
|
|
49
48
|
return "";
|
|
50
|
-
const { recommendationConfigs: e } = r,
|
|
49
|
+
const { recommendationConfigs: e } = r, u = f.find((s) => s.key === e.strategy)?.path || "", t = new URLSearchParams();
|
|
51
50
|
t.set("locale", e.language), t.set("currency", e.currencySettings.value), t.set("partnerName", o.partnerName), t.set("size", e.size), t.set("details", "true"), t.set("campaignId", o.variationId), e.strategy === "manualMerchandising" ? t.set("productId", e.productIds.join(",")) : e.strategy === "similarViewed" && t.set("productId", "{itemId}"), e.strategy === "userBased" && t.set("userId", "{user_id}");
|
|
52
|
-
const
|
|
51
|
+
const l = e.filters.filter((s) => s.isValid), c = b(l);
|
|
53
52
|
c && t.set("filter", c), e.shuffleProducts && t.set("shuffle", "true");
|
|
54
|
-
const d = `${
|
|
53
|
+
const d = `${g.RECOMMENDATION_API_URL}/v2/${u}?${t.toString()}`;
|
|
55
54
|
return n.recommendationCampaignUrls[i] = d, d;
|
|
56
55
|
}
|
|
57
56
|
});
|
|
58
57
|
export {
|
|
59
|
-
|
|
58
|
+
P as useRecommendation
|
|
60
59
|
};
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { RIBBON_SELECTOR as u } from "../enums/onboarding.js";
|
|
2
|
+
import { ref as i, onMounted as b, onBeforeUnmount as f } from "vue";
|
|
3
|
+
const d = () => {
|
|
4
|
+
const e = i(0);
|
|
5
|
+
let o = null;
|
|
6
|
+
const t = () => {
|
|
7
|
+
const r = document.querySelector(u)?.offsetHeight ?? 0;
|
|
8
|
+
e.value !== r && (e.value = r);
|
|
9
|
+
}, s = (n) => `${n + e.value}px`;
|
|
10
|
+
return b(() => {
|
|
11
|
+
t(), o = new MutationObserver(t), o.observe(document.body, {
|
|
12
|
+
childList: !0,
|
|
13
|
+
subtree: !0
|
|
14
|
+
});
|
|
15
|
+
}), f(() => {
|
|
16
|
+
o?.disconnect();
|
|
17
|
+
}), { ribbonOffset: e, getTopPosition: s };
|
|
18
|
+
};
|
|
19
|
+
export {
|
|
20
|
+
d as useRibbonOffset
|
|
21
|
+
};
|
|
@@ -1,29 +1,28 @@
|
|
|
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 { useLiquidValidator as
|
|
9
|
-
const
|
|
10
|
-
const
|
|
11
|
-
return { save: async (
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
if (!await n(t.compiledHtml))
|
|
1
|
+
import { useActionsApi as v } from "./useActionsApi.js";
|
|
2
|
+
import { useConfig as S } from "./useConfig.js";
|
|
3
|
+
import { useSaveStart as V, useSaveComplete as x } from "./useGuidoActions.js";
|
|
4
|
+
import { useSyncModuleExtractor as y } from "./useSyncModuleExtractor.js";
|
|
5
|
+
import { useStripoApi as w } from "../services/stripoApi.js";
|
|
6
|
+
import { useTemplatePreparation as b } from "../utils/templatePreparation.js";
|
|
7
|
+
import { useHtmlValidator as q } from "./useHtmlValidator.js";
|
|
8
|
+
import { useLiquidValidator as H } from "./validators/useLiquidValidator.js";
|
|
9
|
+
const k = () => {
|
|
10
|
+
const e = V(), o = x(), { validateHtml: s } = q(), { validateLiquidSyntax: r } = H(), { callbacks: a, isFeatureEnabled: n } = S(), { extractSyncModuleData: l } = y(), { setSyncModuleUnsubscriptionPages: d } = w(), { editorSave: u } = v();
|
|
11
|
+
return { save: async (c = !1) => {
|
|
12
|
+
e();
|
|
13
|
+
const { prepareTemplateDetails: m } = b(), t = await m();
|
|
14
|
+
if (n("liquidSyntax")) {
|
|
15
|
+
if (!await r(t.compiledHtml))
|
|
17
16
|
return;
|
|
18
|
-
} else if (!await
|
|
17
|
+
} else if (!await s(t.compiledHtml, t.dynamicContentList, !0))
|
|
19
18
|
return;
|
|
20
|
-
if (
|
|
19
|
+
if (a.value?.externalValidation && !await a.value.externalValidation(t))
|
|
21
20
|
return;
|
|
22
|
-
await
|
|
23
|
-
const { unsubscribePayload:
|
|
24
|
-
return await
|
|
21
|
+
await u();
|
|
22
|
+
const { unsubscribePayload: p, stripoModules: f } = l(t.rawHtml);
|
|
23
|
+
return await d(p), t.modules = f, c || o(t), t;
|
|
25
24
|
} };
|
|
26
25
|
};
|
|
27
26
|
export {
|
|
28
|
-
|
|
27
|
+
k as useSave
|
|
29
28
|
};
|
|
@@ -1,28 +1,27 @@
|
|
|
1
|
-
import { useActionsApi as
|
|
2
|
-
import { useBlocksConfig as
|
|
3
|
-
import { useConfig as
|
|
4
|
-
import { useCustomInterfaceAppearance as
|
|
5
|
-
import { useFullStoryBridge as
|
|
6
|
-
import { useStripoEventHandler as
|
|
7
|
-
import { useToaster as
|
|
8
|
-
import { localePatch as
|
|
9
|
-
import { displayConditions as
|
|
10
|
-
import { useStripoApi as
|
|
11
|
-
import
|
|
12
|
-
import { useEditorStore as
|
|
13
|
-
import { dynamicContentToMergeTags as
|
|
14
|
-
import
|
|
15
|
-
const
|
|
16
|
-
const { features:
|
|
17
|
-
|
|
18
|
-
const e = C(), { html: p, css: a } = i, { baseBlocks: o, extensions: d } = await T(), f = ((g = c.value) == null ? void 0 : g.displayConditions) ?? !0, F = ((S = c.value) == null ? void 0 : S.modulesDisabled) ?? !1, v = ((y = h.value) == null ? void 0 : y.forceRecreate) ?? !1;
|
|
1
|
+
import { useActionsApi as v } from "./useActionsApi.js";
|
|
2
|
+
import { useBlocksConfig as M } from "./useBlocksConfig.js";
|
|
3
|
+
import { useConfig as A } from "./useConfig.js";
|
|
4
|
+
import { useCustomInterfaceAppearance as D } from "./useCustomInterfaceAppearance.js";
|
|
5
|
+
import { useFullStoryBridge as I } from "./useFullStoryBridge.js";
|
|
6
|
+
import { useStripoEventHandler as P } from "./useStripoEventHandler.js";
|
|
7
|
+
import { useToaster as U } from "./useToaster.js";
|
|
8
|
+
import { localePatch as q } from "../config/i18n/index.js";
|
|
9
|
+
import { displayConditions as R } from "../enums/displayConditions.js";
|
|
10
|
+
import { useStripoApi as x } from "../services/stripoApi.js";
|
|
11
|
+
import H from "../static/styles/customEditorStyle.css.js";
|
|
12
|
+
import { useEditorStore as g } from "../stores/editor.js";
|
|
13
|
+
import { dynamicContentToMergeTags as O } from "../utils/genericUtil.js";
|
|
14
|
+
import j from "../package.json.js";
|
|
15
|
+
const ne = (S, c) => {
|
|
16
|
+
const { features: l, template: y, isFeatureEnabled: u } = A(), { handleError: m } = U(), { getToken: C, getCustomFonts: h, getSyncModulesStatus: E } = x(), { handleEvent: w } = P(), { getStripoBlocksConfig: b } = M(), k = async (i, n = [], r = !1) => {
|
|
17
|
+
const e = g(), { html: p, css: d } = i, { baseBlocks: o, extensions: s } = await b(), f = l.value?.displayConditions ?? !0, T = l.value?.modulesDisabled ?? !1, V = y.value?.forceRecreate ?? !1;
|
|
19
18
|
window.UIEditor.initEditor(
|
|
20
19
|
document.querySelector("#guido-editor"),
|
|
21
20
|
{
|
|
22
|
-
metadata:
|
|
21
|
+
metadata: S,
|
|
23
22
|
html: p,
|
|
24
|
-
css:
|
|
25
|
-
forceRecreate:
|
|
23
|
+
css: d,
|
|
24
|
+
forceRecreate: V,
|
|
26
25
|
locale: "en",
|
|
27
26
|
undoButtonSelector: "#guido__undo-button",
|
|
28
27
|
redoButtonSelector: "#guido__redo-button",
|
|
@@ -32,13 +31,13 @@ const ae = (E, l) => {
|
|
|
32
31
|
customAppearanceMergetags: !u("liquidSyntax"),
|
|
33
32
|
customAppearanceMergetagsBorderColor: "#f1f3fe",
|
|
34
33
|
customAppearanceMergetagsBackgroundColor: "#f1f3fe",
|
|
35
|
-
customViewStyles:
|
|
34
|
+
customViewStyles: H,
|
|
36
35
|
conditionsEnabled: f,
|
|
37
36
|
customConditionsEnabled: f,
|
|
38
|
-
conditionCategories:
|
|
37
|
+
conditionCategories: R,
|
|
39
38
|
enableXSSSecurity: !0,
|
|
40
|
-
modulesDisabled:
|
|
41
|
-
syncModulesEnabled:
|
|
39
|
+
modulesDisabled: T,
|
|
40
|
+
syncModulesEnabled: r,
|
|
42
41
|
messageSettingsEnabled: !0,
|
|
43
42
|
displayGmailAnnotations: !0,
|
|
44
43
|
displayHiddenPreheader: !1,
|
|
@@ -50,28 +49,28 @@ const ae = (E, l) => {
|
|
|
50
49
|
editorFonts: {
|
|
51
50
|
showDefaultStandardFonts: !0,
|
|
52
51
|
showDefaultNotStandardFonts: !0,
|
|
53
|
-
customFonts:
|
|
52
|
+
customFonts: n
|
|
54
53
|
},
|
|
55
54
|
mergeTags: [
|
|
56
55
|
{
|
|
57
|
-
entries:
|
|
58
|
-
|
|
56
|
+
entries: O(
|
|
57
|
+
c.preselectedDynamicContentList,
|
|
59
58
|
u("liquidSyntax")
|
|
60
59
|
)
|
|
61
60
|
}
|
|
62
61
|
],
|
|
63
62
|
async onTokenRefreshRequest(t) {
|
|
64
63
|
try {
|
|
65
|
-
const
|
|
66
|
-
t(
|
|
67
|
-
} catch (
|
|
68
|
-
m(
|
|
64
|
+
const a = await C();
|
|
65
|
+
t(a);
|
|
66
|
+
} catch (a) {
|
|
67
|
+
m(a, "Failed to refresh token");
|
|
69
68
|
}
|
|
70
69
|
},
|
|
71
70
|
onTemplateLoaded() {
|
|
72
71
|
try {
|
|
73
|
-
const { importCss: t } =
|
|
74
|
-
t(),
|
|
72
|
+
const { importCss: t } = D(), { activateCustomViewStyles: a, updateTimerInClonedTemplate: _ } = v(), { injectFullStory: F } = I();
|
|
73
|
+
t(), a(), F(), _(), c.onReady(), e.isStripoInitialized = !0, e.loadingStatus = !1, setTimeout(() => {
|
|
75
74
|
e.hasChanges = !1;
|
|
76
75
|
}, 1e3);
|
|
77
76
|
} catch (t) {
|
|
@@ -90,39 +89,43 @@ const ae = (E, l) => {
|
|
|
90
89
|
onDataChanged() {
|
|
91
90
|
e.hasChanges = !0;
|
|
92
91
|
},
|
|
93
|
-
onEvent:
|
|
92
|
+
onEvent: w,
|
|
94
93
|
ignoreClickOutsideSelectors: [
|
|
95
94
|
"#guido-dynamic-content-modal",
|
|
96
95
|
".in-on-board-wrapper",
|
|
97
96
|
".in-drawer__container"
|
|
98
97
|
],
|
|
99
|
-
extensions:
|
|
100
|
-
localePatch:
|
|
98
|
+
extensions: s,
|
|
99
|
+
localePatch: q
|
|
101
100
|
}
|
|
102
101
|
);
|
|
103
|
-
},
|
|
104
|
-
var d;
|
|
102
|
+
}, B = (i) => new Promise((n, r) => {
|
|
105
103
|
if (document.getElementById("UiEditorScript")) {
|
|
106
|
-
i(),
|
|
104
|
+
i(), n();
|
|
107
105
|
return;
|
|
108
106
|
}
|
|
109
|
-
const
|
|
110
|
-
|
|
111
|
-
|
|
107
|
+
const d = `https://email-static.useinsider.com/guido/${j.guido?.stripo?.version}/UIEditor.js`;
|
|
108
|
+
if (!document.querySelector('link[href="https://email-static.useinsider.com"]')) {
|
|
109
|
+
const s = document.createElement("link");
|
|
110
|
+
s.rel = "preconnect", s.href = "https://email-static.useinsider.com", document.head.appendChild(s);
|
|
111
|
+
}
|
|
112
|
+
const o = document.createElement("script");
|
|
113
|
+
o.id = "UiEditorScript", o.type = "module", o.src = d, o.onload = () => {
|
|
114
|
+
i(), n();
|
|
112
115
|
}, o.onerror = () => {
|
|
113
|
-
|
|
116
|
+
r(new Error(`Failed to load Stripo UIEditor script from S3: ${d}`));
|
|
114
117
|
}, document.body.appendChild(o);
|
|
115
118
|
});
|
|
116
119
|
return { initPlugin: async (i) => {
|
|
117
|
-
await
|
|
118
|
-
const
|
|
119
|
-
|
|
120
|
-
|
|
120
|
+
await B(async () => {
|
|
121
|
+
const n = g(), [r, e] = await Promise.all([
|
|
122
|
+
h(),
|
|
123
|
+
E()
|
|
121
124
|
]);
|
|
122
|
-
|
|
125
|
+
n.syncModulesEnabled = e, await k(i, r, e);
|
|
123
126
|
});
|
|
124
127
|
} };
|
|
125
128
|
};
|
|
126
129
|
export {
|
|
127
|
-
|
|
130
|
+
ne as useStripo
|
|
128
131
|
};
|
|
@@ -1,45 +1,47 @@
|
|
|
1
|
-
import { UNSUBSCRIBE_SYNC_MODULE_TYPES as
|
|
2
|
-
import { DATA_ATTRIBUTES as
|
|
3
|
-
import { useEditorStore as
|
|
4
|
-
const
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
1
|
+
import { UNSUBSCRIBE_SYNC_MODULE_TYPES as A } from "../enums/unsubscribe.js";
|
|
2
|
+
import { DATA_ATTRIBUTES as E } from "../extensions/Blocks/Unsubscribe/utils/constants.js";
|
|
3
|
+
import { useEditorStore as _ } from "../stores/editor.js";
|
|
4
|
+
const M = ".esd-synchronizable-module", g = '[esd-extension-block-id="unsubscribe-block"]', D = "esd-custom-block-id";
|
|
5
|
+
let S = "", e = null;
|
|
6
|
+
const I = (t) => (t === S && e || (e = new DOMParser().parseFromString(t, "text/html"), S = t), e), L = () => {
|
|
7
|
+
const t = _();
|
|
8
|
+
return { extractSyncModuleData: (m) => {
|
|
9
|
+
const f = {
|
|
8
10
|
unsubscribePayload: [],
|
|
9
11
|
stripoModules: []
|
|
10
12
|
};
|
|
11
|
-
if (!
|
|
12
|
-
return
|
|
13
|
-
const
|
|
14
|
-
return
|
|
15
|
-
const
|
|
16
|
-
if (!
|
|
13
|
+
if (!t.syncModulesEnabled)
|
|
14
|
+
return f;
|
|
15
|
+
const T = I(m).querySelectorAll(M), o = [], n = [];
|
|
16
|
+
return T.forEach((c) => {
|
|
17
|
+
const r = c.getAttribute(D);
|
|
18
|
+
if (!r)
|
|
17
19
|
return;
|
|
18
|
-
const
|
|
19
|
-
if (
|
|
20
|
-
|
|
20
|
+
const u = c.querySelectorAll(g);
|
|
21
|
+
if (u.length === 0) {
|
|
22
|
+
n.push(Number(r));
|
|
21
23
|
return;
|
|
22
24
|
}
|
|
23
|
-
|
|
24
|
-
const
|
|
25
|
-
if (!
|
|
25
|
+
u.forEach((i) => {
|
|
26
|
+
const l = i.getAttribute(E.PAGE_LIST), a = i.getAttribute(E.PAGE_TYPE);
|
|
27
|
+
if (!l || !a)
|
|
26
28
|
return;
|
|
27
|
-
const
|
|
28
|
-
if (!
|
|
29
|
+
const y = parseInt(a), p = A[y];
|
|
30
|
+
if (!p)
|
|
29
31
|
return;
|
|
30
|
-
const
|
|
31
|
-
|
|
32
|
-
stripoModuleId:
|
|
33
|
-
unsubscriptionPreferencePages:
|
|
34
|
-
type:
|
|
32
|
+
const d = l.split(",").map((s) => parseInt(s.trim())).filter((s) => !Number.isNaN(s));
|
|
33
|
+
d.length !== 0 && o.push({
|
|
34
|
+
stripoModuleId: r,
|
|
35
|
+
unsubscriptionPreferencePages: d,
|
|
36
|
+
type: p
|
|
35
37
|
});
|
|
36
38
|
});
|
|
37
39
|
}), {
|
|
38
|
-
unsubscribePayload:
|
|
39
|
-
stripoModules:
|
|
40
|
+
unsubscribePayload: o,
|
|
41
|
+
stripoModules: n
|
|
40
42
|
};
|
|
41
43
|
} };
|
|
42
44
|
};
|
|
43
45
|
export {
|
|
44
|
-
|
|
46
|
+
L as useSyncModuleExtractor
|
|
45
47
|
};
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import { useActionsApi as
|
|
2
|
-
import { useHttp as
|
|
3
|
-
import { useToaster as
|
|
4
|
-
import { useStripoApi as
|
|
5
|
-
const
|
|
6
|
-
const { handleError:
|
|
1
|
+
import { useActionsApi as d } from "./useActionsApi.js";
|
|
2
|
+
import { useHttp as l } from "./useHttp.js";
|
|
3
|
+
import { useToaster as T } from "./useToaster.js";
|
|
4
|
+
import { useStripoApi as f } from "../services/stripoApi.js";
|
|
5
|
+
const C = () => {
|
|
6
|
+
const { handleError: i } = T(), { getToken: c } = f(), { post: m } = l(), { updateHtmlAndCss: p } = d(), n = (t) => /esd-timer-id="(\d+)"/.test(t), o = async (t, e) => {
|
|
7
7
|
try {
|
|
8
|
-
return (await
|
|
8
|
+
return (await m(
|
|
9
9
|
"https://plugins.stripo.email/api/v1/timers/clone",
|
|
10
10
|
{ html: t },
|
|
11
11
|
{
|
|
@@ -16,38 +16,37 @@ const O = () => {
|
|
|
16
16
|
}
|
|
17
17
|
)).data.html;
|
|
18
18
|
} catch (r) {
|
|
19
|
-
return
|
|
19
|
+
return i(r, "Failed to clone timer IDs"), null;
|
|
20
20
|
}
|
|
21
21
|
};
|
|
22
22
|
return {
|
|
23
|
-
hasTimerBlocks:
|
|
24
|
-
cloneTimersInHtml:
|
|
23
|
+
hasTimerBlocks: n,
|
|
24
|
+
cloneTimersInHtml: o,
|
|
25
25
|
cloneTimersOnSave: async (t) => {
|
|
26
|
-
if (!
|
|
26
|
+
if (!n(t))
|
|
27
27
|
return t;
|
|
28
|
-
const e = await
|
|
29
|
-
return e && await
|
|
28
|
+
const e = await c();
|
|
29
|
+
return e && await o(t, e) || t;
|
|
30
30
|
},
|
|
31
31
|
updateTimersOnLoad: async (t) => {
|
|
32
|
-
var e, r, o, m;
|
|
33
32
|
try {
|
|
34
|
-
const
|
|
35
|
-
if (!
|
|
33
|
+
const e = window.UIEditor?.getHtml?.();
|
|
34
|
+
if (!e || !n(e))
|
|
36
35
|
return;
|
|
37
|
-
const
|
|
38
|
-
if (!
|
|
36
|
+
const a = await t();
|
|
37
|
+
if (!a)
|
|
39
38
|
return;
|
|
40
|
-
const
|
|
41
|
-
if (!
|
|
39
|
+
const s = await o(e, a);
|
|
40
|
+
if (!s || s === e)
|
|
42
41
|
return;
|
|
43
|
-
const
|
|
44
|
-
|
|
45
|
-
} catch (
|
|
46
|
-
|
|
42
|
+
const u = window.UIEditor?.getCss?.() || "";
|
|
43
|
+
p(s, u);
|
|
44
|
+
} catch (e) {
|
|
45
|
+
i(e, "Failed to update timer blocks");
|
|
47
46
|
}
|
|
48
47
|
}
|
|
49
48
|
};
|
|
50
49
|
};
|
|
51
50
|
export {
|
|
52
|
-
|
|
51
|
+
C as useTimerClone
|
|
53
52
|
};
|
|
@@ -1,20 +1,27 @@
|
|
|
1
|
-
import
|
|
2
|
-
import {
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
1
|
+
import { ref as g } from "vue";
|
|
2
|
+
import { useConfig as h } from "./useConfig.js";
|
|
3
|
+
const v = (r) => r.split(".").filter((t) => t !== "window").reduce(
|
|
4
|
+
(t, l) => {
|
|
5
|
+
if (t !== void 0)
|
|
6
|
+
return t[l];
|
|
7
|
+
},
|
|
8
|
+
window
|
|
9
|
+
) || {}, T = () => {
|
|
10
|
+
const { config: r } = h(), c = r.value?.editor?.translationsPath || "window.trans.en", a = g(v(c)), t = /* @__PURE__ */ new Map();
|
|
11
|
+
return (n, e) => {
|
|
12
|
+
const o = e && Object.keys(e).length > 0 ? JSON.stringify({ key: n, params: e }) : n, u = t.get(o);
|
|
13
|
+
if (u !== void 0)
|
|
14
|
+
return u;
|
|
15
|
+
const s = a.value[n];
|
|
16
|
+
if (!s)
|
|
17
|
+
return console.warn(`Translation key not found: ${n}`), t.set(o, n), n;
|
|
18
|
+
let i = s;
|
|
19
|
+
return e && (i = Object.entries(e).reduce(
|
|
20
|
+
(f, [d, w]) => f.replace(new RegExp(`{${d}}`, "g"), String(w)),
|
|
21
|
+
s
|
|
22
|
+
)), t.set(o, i), i;
|
|
12
23
|
};
|
|
13
|
-
return memoize(
|
|
14
|
-
trans,
|
|
15
|
-
(n, t) => !t || Object.keys(t).length === 0 ? n : JSON.stringify({ key: n, params: t })
|
|
16
|
-
);
|
|
17
24
|
};
|
|
18
25
|
export {
|
|
19
|
-
useTranslations
|
|
26
|
+
T as useTranslations
|
|
20
27
|
};
|
|
@@ -1,19 +1,18 @@
|
|
|
1
|
-
import { safeParseAsync as
|
|
2
|
-
import { unref as
|
|
3
|
-
function
|
|
1
|
+
import { safeParseAsync as t } from "../node_modules/valibot/dist/index.js";
|
|
2
|
+
import { unref as a } from "vue";
|
|
3
|
+
function n(s, e) {
|
|
4
4
|
return {
|
|
5
5
|
schema: e,
|
|
6
6
|
validate: async () => {
|
|
7
|
-
|
|
8
|
-
const r = await i(e, n(o), { abortPipeEarly: !0 });
|
|
7
|
+
const r = await t(e, a(s), { abortPipeEarly: !0 });
|
|
9
8
|
return {
|
|
10
9
|
...r,
|
|
11
|
-
error:
|
|
12
|
-
errorMessage:
|
|
10
|
+
error: r.issues?.[0],
|
|
11
|
+
errorMessage: r.issues?.[0]?.message || ""
|
|
13
12
|
};
|
|
14
13
|
}
|
|
15
14
|
};
|
|
16
15
|
}
|
|
17
16
|
export {
|
|
18
|
-
|
|
17
|
+
n as useAsyncValidation
|
|
19
18
|
};
|