@useinsider/guido 3.2.0-beta.8b0bc0c → 3.2.0-beta.8e8f902
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 +25 -1
- package/dist/@types/config/schemas.js +38 -36
- package/dist/@types/config/validator.js +34 -27
- package/dist/components/Guido.vue.js +4 -4
- package/dist/components/Guido.vue2.js +88 -82
- package/dist/components/organisms/AutoSaveController.vue.js +17 -0
- package/dist/components/organisms/AutoSaveController.vue2.js +13 -0
- package/dist/components/organisms/base/Toaster.vue2.js +11 -10
- 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 +15 -9
- package/dist/components/organisms/extensions/recommendation/FilterItem.vue2.js +40 -31
- package/dist/components/organisms/extensions/recommendation/FilterSelectionDrawer.vue2.js +20 -19
- package/dist/components/organisms/extensions/recommendation/Filters.vue2.js +14 -11
- package/dist/components/organisms/header/AutoSaveToggle.vue.js +22 -0
- package/dist/components/organisms/header/AutoSaveToggle.vue2.js +19 -0
- package/dist/components/organisms/header/EditorActions.vue.js +12 -11
- package/dist/components/organisms/header/EditorActions.vue2.js +22 -18
- package/dist/components/organisms/header/HeaderWrapper.vue2.js +15 -12
- package/dist/components/organisms/header/LeftSlot.vue2.js +19 -16
- package/dist/components/organisms/header/MiddleSlot.vue2.js +11 -14
- package/dist/components/organisms/header/RightSlot.vue.js +8 -8
- package/dist/components/organisms/header/RightSlot.vue2.js +17 -13
- package/dist/components/organisms/onboarding/AMPOnboarding.vue.js +12 -11
- package/dist/components/organisms/onboarding/AMPOnboarding.vue2.js +51 -29
- package/dist/components/organisms/onboarding/GenericOnboarding.vue.js +13 -12
- package/dist/components/organisms/onboarding/GenericOnboarding.vue2.js +44 -40
- package/dist/components/organisms/onboarding/ItemsOnboarding.vue.js +13 -12
- package/dist/components/organisms/onboarding/ItemsOnboarding.vue2.js +50 -47
- package/dist/components/organisms/onboarding/NewVersionPopup.vue2.js +21 -18
- package/dist/components/organisms/onboarding/OnboardingWrapper.vue2.js +31 -27
- package/dist/components/organisms/onboarding/TextBlockOnboarding.vue.js +13 -12
- package/dist/components/organisms/onboarding/TextBlockOnboarding.vue2.js +35 -44
- package/dist/components/organisms/onboarding/VersionHistoryOnboarding.vue.js +12 -11
- package/dist/components/organisms/onboarding/VersionHistoryOnboarding.vue2.js +23 -20
- package/dist/components/organisms/save-as-template/SaveAsTemplateDrawer.vue2.js +9 -8
- package/dist/components/organisms/unsubscribe/UnsubscribeWrapper.vue.js +10 -9
- package/dist/composables/useActionsApi.js +38 -37
- package/dist/composables/useAutoSave.js +71 -0
- package/dist/composables/useBlocksConfig.js +26 -26
- package/dist/composables/useFullStoryBridge.js +9 -8
- package/dist/composables/useHtmlCompiler.js +26 -34
- package/dist/composables/useHtmlValidator.js +109 -101
- package/dist/composables/useHttp.js +30 -30
- package/dist/composables/usePartner.js +1 -1
- package/dist/composables/useRecommendation.js +15 -14
- package/dist/composables/useRibbonOffset.js +21 -0
- package/dist/composables/useSave.js +22 -21
- package/dist/composables/useStripo.js +50 -53
- package/dist/composables/useSyncModuleExtractor.js +29 -31
- package/dist/composables/useTimerClone.js +25 -24
- package/dist/composables/useTranslations.js +16 -23
- package/dist/composables/useValidation.js +8 -7
- package/dist/composables/validators/useLiquidValidator.js +13 -13
- package/dist/config/compiler/unsubscribeCompilerRules.js +41 -37
- package/dist/config/compiler/utils/recommendationCompilerUtils.js +11 -10
- package/dist/config/migrator/checkboxMigrator.js +21 -20
- package/dist/config/migrator/couponBlockMigrator.js +19 -18
- package/dist/config/migrator/itemsBlockMigrator.js +89 -87
- package/dist/config/migrator/radioButtonMigrator.js +13 -12
- package/dist/config/migrator/recommendationMigrator.js +109 -106
- package/dist/config/migrator/unsubscribeMigrator.js +11 -10
- package/dist/enums/onboarding.js +7 -2
- package/dist/enums/unsubscribe.js +34 -27
- 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 +97 -89
- package/dist/extensions/Blocks/Items/controls/image/link.js +14 -14
- package/dist/extensions/Blocks/Items/controls/name/trimming.js +24 -23
- package/dist/extensions/Blocks/Items/controls/price/currencyLocation.js +14 -13
- package/dist/extensions/Blocks/Items/controls/price/currencySymbol.js +47 -44
- 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 +40 -38
- package/dist/extensions/Blocks/Items/controls/price/singlePrice.js +35 -35
- package/dist/extensions/Blocks/Items/controls/settingsControl.js +162 -155
- package/dist/extensions/Blocks/Items/enums/productEnums.js +14 -9
- package/dist/extensions/Blocks/Items/template.js +210 -210
- package/dist/extensions/Blocks/Recommendation/controls/button/index.js +36 -36
- package/dist/extensions/Blocks/Recommendation/controls/cardComposition/index.js +133 -128
- 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 +18 -17
- package/dist/extensions/Blocks/Recommendation/controls/main/filters.js +6 -4
- package/dist/extensions/Blocks/Recommendation/controls/main/index.js +90 -82
- 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 +36 -35
- package/dist/extensions/Blocks/Recommendation/controls/main/utils.js +135 -134
- 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 +20 -18
- package/dist/extensions/Blocks/Recommendation/extension.js +32 -31
- package/dist/extensions/Blocks/Recommendation/settingsPanel.js +16 -8
- package/dist/extensions/Blocks/Recommendation/store/recommendation.js +56 -55
- package/dist/extensions/Blocks/Recommendation/templates/grid/elementRenderer.js +23 -22
- 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 +25 -24
- package/dist/extensions/Blocks/Recommendation/templates/list/template.js +1 -1
- package/dist/extensions/Blocks/Recommendation/templates/utils.js +47 -45
- package/dist/extensions/Blocks/Recommendation/validation/filterSchema.js +16 -13
- package/dist/extensions/Blocks/Unsubscribe/control.js +13 -11
- package/dist/extensions/Blocks/Unsubscribe/elements/preview.js +18 -16
- package/dist/extensions/Blocks/common-control.js +26 -25
- package/dist/extensions/DynamicContent/dynamic-content.js +58 -53
- package/dist/guido.css +1 -1
- package/dist/library.js +12 -11
- package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/esm/index.js +286 -262
- package/dist/node_modules/lodash-es/_DataView.js +6 -0
- package/dist/node_modules/lodash-es/_Hash.js +20 -0
- package/dist/node_modules/lodash-es/_ListCache.js +20 -0
- package/dist/node_modules/lodash-es/_Map.js +6 -0
- package/dist/node_modules/lodash-es/_MapCache.js +20 -0
- package/dist/node_modules/lodash-es/_Promise.js +6 -0
- package/dist/node_modules/lodash-es/_Set.js +6 -0
- package/dist/node_modules/lodash-es/_SetCache.js +13 -0
- package/dist/node_modules/lodash-es/_Stack.js +18 -0
- package/dist/node_modules/lodash-es/_Symbol.js +5 -0
- package/dist/node_modules/lodash-es/_Uint8Array.js +5 -0
- package/dist/node_modules/lodash-es/_WeakMap.js +6 -0
- package/dist/node_modules/lodash-es/_arrayFilter.js +10 -0
- package/dist/node_modules/lodash-es/_arrayLikeKeys.js +20 -0
- package/dist/node_modules/lodash-es/_arrayMap.js +8 -0
- package/dist/node_modules/lodash-es/_arrayPush.js +8 -0
- package/dist/node_modules/lodash-es/_arraySome.js +9 -0
- package/dist/node_modules/lodash-es/_assocIndexOf.js +10 -0
- package/dist/node_modules/lodash-es/_baseEach.js +6 -0
- package/dist/node_modules/lodash-es/_baseFlatten.js +13 -0
- package/dist/node_modules/lodash-es/_baseFor.js +5 -0
- package/dist/node_modules/lodash-es/_baseForOwn.js +8 -0
- package/dist/node_modules/lodash-es/_baseGet.js +11 -0
- package/dist/node_modules/lodash-es/_baseGetAllKeys.js +9 -0
- package/dist/node_modules/lodash-es/_baseGetTag.js +10 -0
- package/dist/node_modules/lodash-es/_baseHasIn.js +6 -0
- package/dist/node_modules/lodash-es/_baseIsArguments.js +9 -0
- package/dist/node_modules/lodash-es/_baseIsEqual.js +8 -0
- package/dist/node_modules/lodash-es/_baseIsEqualDeep.js +32 -0
- package/dist/node_modules/lodash-es/_baseIsMatch.js +29 -0
- package/dist/node_modules/lodash-es/_baseIsNative.js +16 -0
- package/dist/node_modules/lodash-es/_baseIsTypedArray.js +12 -0
- package/dist/node_modules/lodash-es/_baseIteratee.js +11 -0
- package/dist/node_modules/lodash-es/_baseKeys.js +14 -0
- package/dist/node_modules/lodash-es/_baseMap.js +11 -0
- package/dist/node_modules/lodash-es/_baseMatches.js +12 -0
- package/dist/node_modules/lodash-es/_baseMatchesProperty.js +17 -0
- package/dist/node_modules/lodash-es/_baseProperty.js +8 -0
- package/dist/node_modules/lodash-es/_basePropertyDeep.js +9 -0
- package/dist/node_modules/lodash-es/_baseRange.js +9 -0
- package/dist/node_modules/lodash-es/_baseTimes.js +8 -0
- package/dist/node_modules/lodash-es/_baseToString.js +18 -0
- package/dist/node_modules/lodash-es/_baseTrim.js +8 -0
- package/dist/node_modules/lodash-es/_baseUnary.js +8 -0
- package/dist/node_modules/lodash-es/_cacheHas.js +6 -0
- package/dist/node_modules/lodash-es/_castPath.js +10 -0
- package/dist/node_modules/lodash-es/_coreJsData.js +5 -0
- package/dist/node_modules/lodash-es/_createBaseEach.js +15 -0
- package/dist/node_modules/lodash-es/_createBaseFor.js +13 -0
- package/dist/node_modules/lodash-es/_createRange.js +11 -0
- package/dist/node_modules/lodash-es/_equalArrays.js +40 -0
- package/dist/node_modules/lodash-es/_equalByTag.js +45 -0
- package/dist/node_modules/lodash-es/_equalObjects.js +36 -0
- package/dist/node_modules/lodash-es/_freeGlobal.js +4 -0
- package/dist/node_modules/lodash-es/_getAllKeys.js +9 -0
- package/dist/node_modules/lodash-es/_getMapData.js +8 -0
- package/dist/node_modules/lodash-es/_getMatchData.js +12 -0
- package/dist/node_modules/lodash-es/_getNative.js +9 -0
- package/dist/node_modules/lodash-es/_getRawTag.js +15 -0
- package/dist/node_modules/lodash-es/_getSymbols.js +10 -0
- package/dist/node_modules/lodash-es/_getTag.js +28 -0
- package/dist/node_modules/lodash-es/_getValue.js +6 -0
- package/dist/node_modules/lodash-es/_hasPath.js +19 -0
- package/dist/node_modules/lodash-es/_hashClear.js +7 -0
- package/dist/node_modules/lodash-es/_hashDelete.js +7 -0
- package/dist/node_modules/lodash-es/_hashGet.js +13 -0
- package/dist/node_modules/lodash-es/_hashHas.js +9 -0
- package/dist/node_modules/lodash-es/_hashSet.js +9 -0
- package/dist/node_modules/lodash-es/_isFlattenable.js +10 -0
- package/dist/node_modules/lodash-es/_isIndex.js +8 -0
- package/dist/node_modules/lodash-es/_isIterateeCall.js +13 -0
- package/dist/node_modules/lodash-es/_isKey.js +12 -0
- package/dist/node_modules/lodash-es/_isKeyable.js +7 -0
- package/dist/node_modules/lodash-es/_isMasked.js +11 -0
- package/dist/node_modules/lodash-es/_isPrototype.js +8 -0
- package/dist/node_modules/lodash-es/_isStrictComparable.js +7 -0
- package/dist/node_modules/lodash-es/_listCacheClear.js +6 -0
- package/dist/node_modules/lodash-es/_listCacheDelete.js +12 -0
- package/dist/node_modules/lodash-es/_listCacheGet.js +8 -0
- package/dist/node_modules/lodash-es/_listCacheHas.js +7 -0
- package/dist/node_modules/lodash-es/_listCacheSet.js +8 -0
- package/dist/node_modules/lodash-es/_mapCacheClear.js +13 -0
- package/dist/node_modules/lodash-es/_mapCacheDelete.js +8 -0
- package/dist/node_modules/lodash-es/_mapCacheGet.js +7 -0
- package/dist/node_modules/lodash-es/_mapCacheHas.js +7 -0
- package/dist/node_modules/lodash-es/_mapCacheSet.js +8 -0
- package/dist/node_modules/lodash-es/_mapToArray.js +9 -0
- package/dist/node_modules/lodash-es/_matchesStrictComparable.js +8 -0
- package/dist/node_modules/lodash-es/_memoizeCapped.js +11 -0
- package/dist/node_modules/lodash-es/_nativeCreate.js +5 -0
- package/dist/node_modules/lodash-es/_nativeKeys.js +5 -0
- package/dist/node_modules/lodash-es/_nodeUtil.js +11 -0
- package/dist/node_modules/lodash-es/_objectToString.js +7 -0
- package/dist/node_modules/lodash-es/_overArg.js +8 -0
- package/dist/node_modules/lodash-es/_root.js +5 -0
- package/dist/node_modules/lodash-es/_setCacheAdd.js +7 -0
- package/dist/node_modules/lodash-es/_setCacheHas.js +6 -0
- package/dist/node_modules/lodash-es/_setToArray.js +9 -0
- package/dist/node_modules/lodash-es/_stackClear.js +7 -0
- package/dist/node_modules/lodash-es/_stackDelete.js +7 -0
- package/dist/node_modules/lodash-es/_stackGet.js +6 -0
- package/dist/node_modules/lodash-es/_stackHas.js +6 -0
- package/dist/node_modules/lodash-es/_stackSet.js +17 -0
- package/dist/node_modules/lodash-es/_stringToPath.js +10 -0
- package/dist/node_modules/lodash-es/_toKey.js +10 -0
- package/dist/node_modules/lodash-es/_toSource.js +17 -0
- package/dist/node_modules/lodash-es/_trimmedEndIndex.js +9 -0
- package/dist/node_modules/lodash-es/eq.js +6 -0
- package/dist/node_modules/lodash-es/flatMap.js +8 -0
- package/dist/node_modules/lodash-es/get.js +8 -0
- package/dist/node_modules/lodash-es/hasIn.js +8 -0
- package/dist/node_modules/lodash-es/identity.js +6 -0
- package/dist/node_modules/lodash-es/isArguments.js +10 -0
- package/dist/node_modules/lodash-es/isArray.js +4 -0
- package/dist/node_modules/lodash-es/isArrayLike.js +8 -0
- package/dist/node_modules/lodash-es/isBuffer.js +6 -0
- package/dist/node_modules/lodash-es/isFunction.js +12 -0
- package/dist/node_modules/lodash-es/isLength.js +7 -0
- package/dist/node_modules/lodash-es/isObject.js +7 -0
- package/dist/node_modules/lodash-es/isObjectLike.js +6 -0
- package/dist/node_modules/lodash-es/isSymbol.js +9 -0
- package/dist/node_modules/lodash-es/isTypedArray.js +7 -0
- package/dist/node_modules/lodash-es/keys.js +9 -0
- package/dist/node_modules/lodash-es/map.js +11 -0
- package/dist/node_modules/lodash-es/memoize.js +18 -0
- package/dist/node_modules/lodash-es/property.js +10 -0
- package/dist/node_modules/lodash-es/range.js +5 -0
- package/dist/node_modules/lodash-es/stubArray.js +6 -0
- package/dist/node_modules/lodash-es/stubFalse.js +6 -0
- package/dist/node_modules/lodash-es/toFinite.js +14 -0
- package/dist/node_modules/lodash-es/toNumber.js +22 -0
- package/dist/node_modules/lodash-es/toString.js +7 -0
- package/dist/node_modules/valibot/dist/index.js +126 -122
- package/dist/package.json.js +1 -1
- package/dist/services/recommendationApi.js +17 -14
- package/dist/services/templateLibraryApi.js +40 -38
- package/dist/src/@types/config/schemas.d.ts +4 -0
- package/dist/src/components/Guido.vue.d.ts +1 -1
- package/dist/src/components/organisms/AutoSaveController.vue.d.ts +2 -0
- package/dist/src/components/organisms/header/AutoSaveToggle.vue.d.ts +2 -0
- package/dist/src/components/organisms/header/EditorActions.vue.d.ts +1 -1
- package/dist/src/components/organisms/header/HeaderWrapper.vue.d.ts +1 -1
- package/dist/src/components/organisms/header/RightSlot.vue.d.ts +1 -1
- package/dist/src/components/wrappers/WpModal.vue.d.ts +1 -1
- package/dist/src/composables/useAutoSave.d.ts +3 -0
- package/dist/src/composables/useConfig.d.ts +2 -0
- package/dist/src/composables/useHtmlCompiler.d.ts +2 -1
- package/dist/src/composables/useRibbonOffset.d.ts +4 -0
- package/dist/src/composables/useSave.d.ts +1 -1
- package/dist/src/composables/useTranslations.d.ts +1 -1
- package/dist/src/enums/onboarding.d.ts +6 -0
- package/dist/src/enums/unsubscribe.d.ts +5 -0
- package/dist/src/stores/autosave.d.ts +12 -0
- package/dist/src/stores/config.d.ts +18 -0
- package/dist/src/stores/dynamic-content.d.ts +3 -3
- package/dist/src/stores/editor.d.ts +23 -0
- package/dist/src/stores/onboarding.d.ts +4 -0
- package/dist/src/utils/timeUtil.d.ts +8 -0
- package/dist/stores/autosave.js +17 -0
- package/dist/stores/config.js +81 -25
- package/dist/stores/dynamic-content.js +11 -6
- package/dist/stores/editor.js +3 -1
- package/dist/stores/onboarding.js +9 -5
- package/dist/stores/preview.js +9 -6
- package/dist/stores/unsubscribe.js +4 -1
- package/dist/utils/dateUtil.js +10 -7
- package/dist/utils/genericUtil.js +13 -10
- package/dist/utils/pairProductVariables.js +89 -87
- package/dist/utils/timeUtil.js +19 -0
- package/package.json +5 -8
|
@@ -1,42 +1,46 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import
|
|
3
|
-
import
|
|
1
|
+
import { defineComponent as b, computed as e, onMounted as O, watch as t } from "vue";
|
|
2
|
+
import u from "./AMPOnboarding.vue.js";
|
|
3
|
+
import v from "./GenericOnboarding.vue.js";
|
|
4
|
+
import l from "./ItemsOnboarding.vue.js";
|
|
5
|
+
import y from "./NewVersionPopup.vue.js";
|
|
6
|
+
import S from "./TextBlockOnboarding.vue.js";
|
|
7
|
+
import h from "./VersionHistoryOnboarding.vue.js";
|
|
8
|
+
import { usePartner as w } from "../../../composables/usePartner.js";
|
|
9
|
+
import { useEditorStore as P } from "../../../stores/editor.js";
|
|
4
10
|
import { useOnboardingStore as _ } from "../../../stores/onboarding.js";
|
|
5
|
-
import { usePreviewStore as
|
|
6
|
-
const
|
|
11
|
+
import { usePreviewStore as A } from "../../../stores/preview.js";
|
|
12
|
+
const G = /* @__PURE__ */ b({
|
|
7
13
|
__name: "OnboardingWrapper",
|
|
8
14
|
emits: ["onboarding-finished"],
|
|
9
|
-
setup(
|
|
10
|
-
const
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
{ type: "
|
|
14
|
-
{ type: "
|
|
15
|
-
{ type: "
|
|
16
|
-
{ type: "
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
], l = (n) => u.value || !f.value ? !1 : n === "newVersionPopup" ? o.shouldShowOnboarding(n) : o.isActive(n), S = e(() => v.filter((n) => l(n.type)));
|
|
20
|
-
return w(async () => {
|
|
15
|
+
setup(H, { emit: f }) {
|
|
16
|
+
const o = _(), r = P(), s = A(), { isTestPartner: a } = w(), p = e(() => r.isStripoInitialized), d = e(() => a()), m = [
|
|
17
|
+
{ type: "newVersionPopup", component: y },
|
|
18
|
+
{ type: "genericOnboarding", component: v },
|
|
19
|
+
{ type: "textBlockOnboarding", component: S },
|
|
20
|
+
{ type: "versionHistoryOnboarding", component: h },
|
|
21
|
+
{ type: "ampOnboarding", component: u },
|
|
22
|
+
{ type: "itemsOnboarding", component: l }
|
|
23
|
+
], c = (n) => d.value || !p.value ? !1 : n === "newVersionPopup" ? o.shouldShowOnboarding(n) : o.isActive(n), g = e(() => m.filter((n) => c(n.type)));
|
|
24
|
+
return O(async () => {
|
|
21
25
|
await o.fetchUserModalState();
|
|
22
|
-
}),
|
|
26
|
+
}), t(
|
|
23
27
|
() => r.isVersionHistoryOpen,
|
|
24
|
-
(n,
|
|
25
|
-
n && !
|
|
28
|
+
(n, i) => {
|
|
29
|
+
n && !i && o.shouldShowOnboarding("versionHistoryOnboarding") && o.start("versionHistoryOnboarding"), !n && i && o.isActive("versionHistoryOnboarding") && o.close("versionHistoryOnboarding");
|
|
26
30
|
}
|
|
27
|
-
),
|
|
28
|
-
() =>
|
|
29
|
-
(n,
|
|
30
|
-
|
|
31
|
+
), t(
|
|
32
|
+
() => s.emailFormat,
|
|
33
|
+
(n, i) => {
|
|
34
|
+
i !== "AMP" && n === "AMP" && o.shouldShowOnboarding("ampOnboarding") && o.start("ampOnboarding");
|
|
31
35
|
}
|
|
32
|
-
),
|
|
36
|
+
), t(
|
|
33
37
|
() => r.isPreviewModeOpen,
|
|
34
38
|
(n) => {
|
|
35
39
|
!n && o.isActive("ampOnboarding") && o.close("ampOnboarding");
|
|
36
40
|
}
|
|
37
|
-
), { __sfc: !0,
|
|
41
|
+
), { __sfc: !0, emit: f, onboardingStore: o, editorStore: r, previewStore: s, isTestPartner: a, isStripoReady: p, isTestPartnerActive: d, onboardingConfigs: m, shouldShow: c, visibleOnboardings: g };
|
|
38
42
|
}
|
|
39
43
|
});
|
|
40
44
|
export {
|
|
41
|
-
|
|
45
|
+
G as default
|
|
42
46
|
};
|
|
@@ -1,20 +1,21 @@
|
|
|
1
|
-
import
|
|
1
|
+
import l from "./TextBlockOnboarding.vue2.js";
|
|
2
2
|
/* empty css */
|
|
3
|
-
import
|
|
4
|
-
var
|
|
5
|
-
var
|
|
6
|
-
|
|
3
|
+
import d from "../../../_virtual/_plugin-vue2_normalizer.js";
|
|
4
|
+
var g = function() {
|
|
5
|
+
var e, n, r, i, a, s;
|
|
6
|
+
var t = this, c = t._self._c, o = t._self._setupProxy;
|
|
7
|
+
return o.isVisible ? c(o.InOnboard, { key: "guido__text-block-onboard", staticClass: "w-21-s p-a z-11", class: (e = o.onboardingStore.getTextBlockCurrentCard) == null ? void 0 : e.classes, attrs: { id: "guido__text-block-onboard", "is-multiple-page": "", visible: "", "image-source": "", title: "", "bottom-position": (n = o.onboardingStore.getTextBlockCurrentCard) == null ? void 0 : n.bottom, "left-position": (r = o.onboardingStore.getTextBlockCurrentCard) == null ? void 0 : r.left, "pages-config": o.onboardingStore.onboardings.textBlockOnboarding.config, "pointer-position": (i = o.onboardingStore.getTextBlockCurrentCard) == null ? void 0 : i.position, "right-position": (a = o.onboardingStore.getTextBlockCurrentCard) == null ? void 0 : a.right, "top-position": (s = o.onboardingStore.getTextBlockCurrentCard) == null ? void 0 : s.top }, on: { backButtonClick: o.handleBack, close: function(u) {
|
|
7
8
|
return o.onboardingStore.close("textBlockOnboarding");
|
|
8
9
|
}, nextButtonClick: o.handleNext } }) : t._e();
|
|
9
|
-
},
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
10
|
+
}, b = [], p = /* @__PURE__ */ d(
|
|
11
|
+
l,
|
|
12
|
+
g,
|
|
13
|
+
b,
|
|
13
14
|
!1,
|
|
14
15
|
null,
|
|
15
|
-
"
|
|
16
|
+
"cadfc82d"
|
|
16
17
|
);
|
|
17
|
-
const
|
|
18
|
+
const C = p.exports;
|
|
18
19
|
export {
|
|
19
|
-
|
|
20
|
+
C as default
|
|
20
21
|
};
|
|
@@ -1,72 +1,63 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
|
|
1
|
+
import { defineComponent as l, computed as c, watch as g } from "vue";
|
|
2
|
+
import { useRibbonOffset as b } from "../../../composables/useRibbonOffset.js";
|
|
3
|
+
import { useTranslations as x } from "../../../composables/useTranslations.js";
|
|
4
|
+
import { useOnboardingStore as u } from "../../../stores/onboarding.js";
|
|
5
|
+
import { InOnboard as p } from "@useinsider/design-system-vue";
|
|
6
|
+
const O = /* @__PURE__ */ l({
|
|
6
7
|
__name: "TextBlockOnboarding",
|
|
7
|
-
setup(
|
|
8
|
-
const o =
|
|
9
|
-
const i = window.innerHeight - 128, r = Math.max(90, i * 0.15), s = Math.max(490, i * 0.71), d = 200, g = 40;
|
|
10
|
-
return {
|
|
11
|
-
settings: {
|
|
12
|
-
top: `${r}px`,
|
|
13
|
-
position: r + d + g > i ? "Right Bottom" : "Right Top"
|
|
14
|
-
},
|
|
15
|
-
dynamic: {
|
|
16
|
-
top: `${s}px`,
|
|
17
|
-
position: s + d + g > i ? "Right Bottom" : "Right Top"
|
|
18
|
-
}
|
|
19
|
-
};
|
|
20
|
-
}), a = e(() => [
|
|
8
|
+
setup(k) {
|
|
9
|
+
const n = x(), o = u(), { getTopPosition: i } = b(), r = c(() => [
|
|
21
10
|
{
|
|
22
11
|
classes: "guido-text-block-onboarding-settings",
|
|
23
12
|
right: "426px",
|
|
24
|
-
top:
|
|
25
|
-
position:
|
|
26
|
-
title:
|
|
27
|
-
description:
|
|
13
|
+
top: i(90),
|
|
14
|
+
position: "Right Top",
|
|
15
|
+
title: n("email-editor.onboarding-text-block-title"),
|
|
16
|
+
description: n("email-editor.onboarding-text-block-description"),
|
|
28
17
|
imageSource: "",
|
|
29
18
|
backButtonClick: () => {
|
|
30
19
|
},
|
|
31
20
|
nextButtonType: "text",
|
|
32
|
-
nextButtonText:
|
|
21
|
+
nextButtonText: n("products.next"),
|
|
33
22
|
nextButtonClick: () => {
|
|
34
|
-
|
|
23
|
+
o.next("textBlockOnboarding");
|
|
35
24
|
}
|
|
36
25
|
},
|
|
37
26
|
{
|
|
38
27
|
classes: "guido-text-block-onboarding-dynamic",
|
|
39
|
-
right: "
|
|
40
|
-
top:
|
|
41
|
-
position:
|
|
42
|
-
title:
|
|
43
|
-
description:
|
|
28
|
+
right: "409px",
|
|
29
|
+
top: i(607),
|
|
30
|
+
position: "Right Top",
|
|
31
|
+
title: n("email-editor.onboarding-dynamic-content-title"),
|
|
32
|
+
description: n("email-editor.onboarding-dynamic-content-description"),
|
|
44
33
|
imageSource: "",
|
|
45
34
|
backButtonType: "text",
|
|
46
|
-
backButtonText:
|
|
35
|
+
backButtonText: n("ds-steps.back"),
|
|
47
36
|
backButtonClick: () => {
|
|
48
|
-
|
|
37
|
+
o.previous("textBlockOnboarding");
|
|
49
38
|
},
|
|
50
39
|
nextButtonType: "text",
|
|
51
|
-
nextButtonText:
|
|
40
|
+
nextButtonText: n("action-builder.ok"),
|
|
52
41
|
nextButtonClick: () => {
|
|
53
|
-
|
|
42
|
+
o.close("textBlockOnboarding");
|
|
54
43
|
}
|
|
55
44
|
}
|
|
56
|
-
]),
|
|
57
|
-
t
|
|
58
|
-
|
|
59
|
-
|
|
45
|
+
]), a = c(() => o.onboardings.textBlockOnboarding.config.length > 0 && o.onboardings.textBlockOnboarding.isActive), s = () => {
|
|
46
|
+
var t, e;
|
|
47
|
+
(e = (t = o.getTextBlockCurrentCard) == null ? void 0 : t.nextButtonClick) == null || e.call(t);
|
|
48
|
+
}, d = () => {
|
|
49
|
+
var t, e;
|
|
50
|
+
(e = (t = o.getTextBlockCurrentCard) == null ? void 0 : t.backButtonClick) == null || e.call(t);
|
|
60
51
|
};
|
|
61
|
-
return
|
|
62
|
-
() =>
|
|
63
|
-
(
|
|
64
|
-
|
|
52
|
+
return g(
|
|
53
|
+
() => o.isActive("textBlockOnboarding"),
|
|
54
|
+
(t) => {
|
|
55
|
+
t && o.setConfig("textBlockOnboarding", r.value);
|
|
65
56
|
},
|
|
66
57
|
{ immediate: !0 }
|
|
67
|
-
), { __sfc: !0, trans:
|
|
58
|
+
), { __sfc: !0, trans: n, onboardingStore: o, getTopPosition: i, onboardingCardsConfig: r, isVisible: a, handleNext: s, handleBack: d, InOnboard: p };
|
|
68
59
|
}
|
|
69
60
|
});
|
|
70
61
|
export {
|
|
71
|
-
|
|
62
|
+
O as default
|
|
72
63
|
};
|
|
@@ -1,19 +1,20 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
var
|
|
4
|
-
var
|
|
5
|
-
|
|
1
|
+
import g from "./VersionHistoryOnboarding.vue2.js";
|
|
2
|
+
import l from "../../../_virtual/_plugin-vue2_normalizer.js";
|
|
3
|
+
var c = function() {
|
|
4
|
+
var n, t, i, e, s, a;
|
|
5
|
+
var r = this, d = r._self._c, o = r._self._setupProxy;
|
|
6
|
+
return o.isVisible ? d(o.InOnboard, { key: "guido__version-history-onboard", staticClass: "w-21-s p-a z-11", class: (n = o.onboardingStore.getVersionHistoryCurrentCard) == null ? void 0 : n.classes, attrs: { id: "guido__version-history-onboard", "is-multiple-page": "", visible: "", "image-source": "", title: "", "bottom-position": (t = o.onboardingStore.getVersionHistoryCurrentCard) == null ? void 0 : t.bottom, "left-position": (i = o.onboardingStore.getVersionHistoryCurrentCard) == null ? void 0 : i.left, "pages-config": o.onboardingStore.onboardings.versionHistoryOnboarding.config, "pointer-position": (e = o.onboardingStore.getVersionHistoryCurrentCard) == null ? void 0 : e.position, "right-position": (s = o.onboardingStore.getVersionHistoryCurrentCard) == null ? void 0 : s.right, "top-position": (a = o.onboardingStore.getVersionHistoryCurrentCard) == null ? void 0 : a.top }, on: { backButtonClick: o.handleBack, close: function(b) {
|
|
6
7
|
return o.onboardingStore.close("versionHistoryOnboarding");
|
|
7
8
|
}, nextButtonClick: o.handleNext } }) : r._e();
|
|
8
|
-
},
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
9
|
+
}, _ = [], p = /* @__PURE__ */ l(
|
|
10
|
+
g,
|
|
11
|
+
c,
|
|
12
|
+
_,
|
|
12
13
|
!1,
|
|
13
14
|
null,
|
|
14
15
|
null
|
|
15
16
|
);
|
|
16
|
-
const
|
|
17
|
+
const m = p.exports;
|
|
17
18
|
export {
|
|
18
|
-
|
|
19
|
+
m as default
|
|
19
20
|
};
|
|
@@ -1,35 +1,38 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
|
|
1
|
+
import { defineComponent as g, computed as s, watch as b } from "vue";
|
|
2
|
+
import { useRibbonOffset as u } from "../../../composables/useRibbonOffset.js";
|
|
3
|
+
import { useTranslations as l } from "../../../composables/useTranslations.js";
|
|
4
|
+
import { useOnboardingStore as m } from "../../../stores/onboarding.js";
|
|
5
|
+
import { InOnboard as p } from "@useinsider/design-system-vue";
|
|
6
|
+
const k = /* @__PURE__ */ g({
|
|
6
7
|
__name: "VersionHistoryOnboarding",
|
|
7
|
-
setup(
|
|
8
|
-
const n =
|
|
8
|
+
setup(f) {
|
|
9
|
+
const t = l(), n = m(), { getTopPosition: r } = u(), e = s(() => [
|
|
9
10
|
{
|
|
10
11
|
classes: "guido-version-history-onboarding",
|
|
11
12
|
left: "409px",
|
|
12
|
-
top:
|
|
13
|
+
top: r(192),
|
|
13
14
|
position: "Left Top",
|
|
14
|
-
title:
|
|
15
|
-
description:
|
|
15
|
+
title: t("email-editor.onboarding-version-history-title"),
|
|
16
|
+
description: t("email-editor.onboarding-version-history-description"),
|
|
16
17
|
imageSource: "",
|
|
17
18
|
backButtonClick: () => {
|
|
18
19
|
},
|
|
19
20
|
nextButtonType: "text",
|
|
20
|
-
nextButtonText:
|
|
21
|
-
nextButtonClick: () => void
|
|
21
|
+
nextButtonText: t("action-builder.ok"),
|
|
22
|
+
nextButtonClick: () => void n.close("versionHistoryOnboarding")
|
|
22
23
|
}
|
|
23
|
-
]),
|
|
24
|
-
o
|
|
25
|
-
|
|
26
|
-
|
|
24
|
+
]), a = s(() => n.onboardings.versionHistoryOnboarding.config.length > 0 && n.onboardings.versionHistoryOnboarding.isActive), d = () => {
|
|
25
|
+
var o, i;
|
|
26
|
+
(i = (o = n.getVersionHistoryCurrentCard) == null ? void 0 : o.nextButtonClick) == null || i.call(o);
|
|
27
|
+
}, c = () => {
|
|
28
|
+
var o, i;
|
|
29
|
+
(i = (o = n.getVersionHistoryCurrentCard) == null ? void 0 : o.backButtonClick) == null || i.call(o);
|
|
27
30
|
};
|
|
28
|
-
return
|
|
29
|
-
|
|
30
|
-
}, { immediate: !0 }), { __sfc: !0, trans:
|
|
31
|
+
return b(() => n.onboardings.versionHistoryOnboarding.isActive, (o) => {
|
|
32
|
+
o && n.setConfig("versionHistoryOnboarding", e.value);
|
|
33
|
+
}, { immediate: !0 }), { __sfc: !0, trans: t, onboardingStore: n, getTopPosition: r, onboardingCardsConfig: e, isVisible: a, handleNext: d, handleBack: c, InOnboard: p };
|
|
31
34
|
}
|
|
32
35
|
});
|
|
33
36
|
export {
|
|
34
|
-
|
|
37
|
+
k as default
|
|
35
38
|
};
|
|
@@ -10,7 +10,7 @@ import { useDebounceFn as V } from "../../../node_modules/@vueuse/shared/index.j
|
|
|
10
10
|
const H = /* @__PURE__ */ A({
|
|
11
11
|
__name: "SaveAsTemplateDrawer",
|
|
12
12
|
setup(E) {
|
|
13
|
-
const o = O(), n = D(), t = k(), { createTemplate:
|
|
13
|
+
const o = O(), n = D(), t = k(), { createTemplate: m } = B(), a = c(!1), r = c(!1), l = c(""), f = b(() => ({
|
|
14
14
|
primaryButton: {
|
|
15
15
|
styling: "solid",
|
|
16
16
|
type: "primary",
|
|
@@ -24,7 +24,7 @@ const H = /* @__PURE__ */ A({
|
|
|
24
24
|
labelText: o("products.cancel"),
|
|
25
25
|
disabledStatus: a.value
|
|
26
26
|
}
|
|
27
|
-
})),
|
|
27
|
+
})), u = () => {
|
|
28
28
|
l.value = "", n.isSaveAsTemplateDrawerOpen = !1;
|
|
29
29
|
}, i = async () => {
|
|
30
30
|
const e = h(t, "templateName"), { success: s, errorMessage: _ } = await x(e).validate();
|
|
@@ -44,18 +44,19 @@ const H = /* @__PURE__ */ A({
|
|
|
44
44
|
a.value = !1;
|
|
45
45
|
return;
|
|
46
46
|
}
|
|
47
|
-
const s = await
|
|
48
|
-
a.value = !1, s &&
|
|
49
|
-
},
|
|
47
|
+
const s = await m();
|
|
48
|
+
a.value = !1, s && u();
|
|
49
|
+
}, p = () => {
|
|
50
50
|
C(() => {
|
|
51
|
-
document.querySelector("input#guido__template-name-input")
|
|
51
|
+
const e = document.querySelector("input#guido__template-name-input");
|
|
52
|
+
e == null || e.focus();
|
|
52
53
|
});
|
|
53
54
|
}, d = async () => {
|
|
54
|
-
t.$reset(), await t.fetchCategories(), t.skeletonStatus = !1,
|
|
55
|
+
t.$reset(), await t.fetchCategories(), t.skeletonStatus = !1, p();
|
|
55
56
|
};
|
|
56
57
|
return n.$subscribe((e, { isSaveAsTemplateDrawerOpen: s }) => {
|
|
57
58
|
s && d();
|
|
58
|
-
}), { __sfc: !0, trans: o, editorStore: n, saveAsTemplateStore: t, createTemplate:
|
|
59
|
+
}), { __sfc: !0, trans: o, editorStore: n, saveAsTemplateStore: t, createTemplate: m, isSaving: a, isAddingOption: r, templateNameError: l, footerButtonGroupOptions: f, closeModal: u, validateTemplateName: i, handleTemplateName: v, handleAddOption: g, handleCategoryChange: y, handleSelectAllOptions: S, handleResetAllOptions: T, saveTemplate: w, focusToInput: p, initializeDrawer: d, WpDrawer: N, InBasicTextInput: M, InMultiSelect: I };
|
|
59
60
|
}
|
|
60
61
|
});
|
|
61
62
|
export {
|
|
@@ -1,17 +1,18 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
var
|
|
1
|
+
import _ from "./UnsubscribeWrapper.vue2.js";
|
|
2
|
+
import o from "../../../_virtual/_plugin-vue2_normalizer.js";
|
|
3
|
+
var c = function() {
|
|
4
|
+
var s, t;
|
|
4
5
|
var e = this, r = e._self._c, n = e._self._setupProxy;
|
|
5
|
-
return n.config
|
|
6
|
-
},
|
|
7
|
-
s,
|
|
6
|
+
return (t = (s = n.config) == null ? void 0 : s.features) != null && t.unsubscribe ? r("div", [r(n.UnsubscribeTypeSelection), r(n.UnsubscribePageSelection)], 1) : e._e();
|
|
7
|
+
}, i = [], a = /* @__PURE__ */ o(
|
|
8
8
|
_,
|
|
9
|
-
|
|
9
|
+
c,
|
|
10
|
+
i,
|
|
10
11
|
!1,
|
|
11
12
|
null,
|
|
12
13
|
null
|
|
13
14
|
);
|
|
14
|
-
const
|
|
15
|
+
const p = a.exports;
|
|
15
16
|
export {
|
|
16
|
-
|
|
17
|
+
p as default
|
|
17
18
|
};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { useToaster as w } from "./useToaster.js";
|
|
2
2
|
const v = () => {
|
|
3
|
-
const { handleError:
|
|
4
|
-
const
|
|
3
|
+
const { handleError: n } = w(), m = (t = {}) => new Promise((e, a) => {
|
|
4
|
+
const o = { ...{
|
|
5
5
|
minimize: !0,
|
|
6
6
|
utmEntity: {
|
|
7
7
|
utmSource: "",
|
|
@@ -20,51 +20,51 @@ const v = () => {
|
|
|
20
20
|
forceAmp: !1,
|
|
21
21
|
resetDataSavedFlag: !1,
|
|
22
22
|
disableLineHeightsReplace: !0
|
|
23
|
-
}, ...
|
|
23
|
+
}, ...t }, s = {
|
|
24
24
|
callback: (l, r, d, c, u) => {
|
|
25
|
-
l ?
|
|
25
|
+
l ? a(l) : e({
|
|
26
26
|
html: r,
|
|
27
27
|
ampHtml: d,
|
|
28
28
|
ampErrors: c,
|
|
29
29
|
displayConditions: u
|
|
30
30
|
});
|
|
31
31
|
},
|
|
32
|
-
...
|
|
32
|
+
...o
|
|
33
33
|
};
|
|
34
34
|
window.StripoEditorApi.actionsApi.compileEmail(s);
|
|
35
35
|
});
|
|
36
36
|
return {
|
|
37
37
|
getCompiledEmail: m,
|
|
38
|
-
getTemplateData: () => new Promise((
|
|
39
|
-
const
|
|
40
|
-
html:
|
|
41
|
-
css:
|
|
42
|
-
width:
|
|
38
|
+
getTemplateData: () => new Promise((t) => {
|
|
39
|
+
const e = ({ html: a, css: i, width: o, height: p, utmParams: s, syncModulesIds: l }) => t({
|
|
40
|
+
html: a,
|
|
41
|
+
css: i,
|
|
42
|
+
width: o,
|
|
43
43
|
height: p,
|
|
44
44
|
utmParams: s,
|
|
45
45
|
syncModulesIds: l
|
|
46
46
|
});
|
|
47
|
-
window.StripoEditorApi.actionsApi.getTemplateData(
|
|
47
|
+
window.StripoEditorApi.actionsApi.getTemplateData(e);
|
|
48
48
|
}),
|
|
49
|
-
activateCustomViewStyles: (
|
|
50
|
-
window.StripoEditorApi.actionsApi.activateCustomViewStyles(
|
|
49
|
+
activateCustomViewStyles: (t = !0) => {
|
|
50
|
+
window.StripoEditorApi.actionsApi.activateCustomViewStyles(t);
|
|
51
51
|
},
|
|
52
|
-
getPreviewData: async (
|
|
52
|
+
getPreviewData: async (t) => {
|
|
53
53
|
try {
|
|
54
54
|
const {
|
|
55
|
-
html:
|
|
56
|
-
displayConditions:
|
|
57
|
-
ampHtml:
|
|
58
|
-
ampErrors:
|
|
59
|
-
} = await m({ minimize: !1, resetDataSavedFlag: !1, ...
|
|
55
|
+
html: e,
|
|
56
|
+
displayConditions: a,
|
|
57
|
+
ampHtml: i = "",
|
|
58
|
+
ampErrors: o = []
|
|
59
|
+
} = await m({ minimize: !1, resetDataSavedFlag: !1, ...t });
|
|
60
60
|
return {
|
|
61
|
-
html:
|
|
62
|
-
ampHtml:
|
|
63
|
-
ampErrors:
|
|
64
|
-
displayConditions:
|
|
61
|
+
html: e,
|
|
62
|
+
ampHtml: i,
|
|
63
|
+
ampErrors: o,
|
|
64
|
+
displayConditions: a
|
|
65
65
|
};
|
|
66
|
-
} catch (
|
|
67
|
-
return
|
|
66
|
+
} catch (e) {
|
|
67
|
+
return n(e, "Error loading preview"), {
|
|
68
68
|
html: "",
|
|
69
69
|
ampHtml: "",
|
|
70
70
|
ampErrors: [],
|
|
@@ -72,25 +72,26 @@ const v = () => {
|
|
|
72
72
|
};
|
|
73
73
|
}
|
|
74
74
|
},
|
|
75
|
-
updateTimerInClonedTemplate: () => new Promise((
|
|
76
|
-
|
|
77
|
-
|
|
75
|
+
updateTimerInClonedTemplate: () => new Promise((t) => {
|
|
76
|
+
var e, a;
|
|
77
|
+
if (typeof ((a = (e = window.StripoEditorApi) == null ? void 0 : e.actionsApi) == null ? void 0 : a.updateTimerInClonedTemplate) != "function") {
|
|
78
|
+
t(null);
|
|
78
79
|
return;
|
|
79
80
|
}
|
|
80
81
|
try {
|
|
81
|
-
window.StripoEditorApi.actionsApi.updateTimerInClonedTemplate((
|
|
82
|
-
|
|
82
|
+
window.StripoEditorApi.actionsApi.updateTimerInClonedTemplate((i, o) => {
|
|
83
|
+
i ? (n(i, "Failed to update timer in cloned template"), t(null)) : t(o || null);
|
|
83
84
|
});
|
|
84
|
-
} catch (
|
|
85
|
-
|
|
85
|
+
} catch (i) {
|
|
86
|
+
n(i, "Failed to call updateTimerInClonedTemplate"), t(null);
|
|
86
87
|
}
|
|
87
88
|
}),
|
|
88
|
-
updateHtmlAndCss: (
|
|
89
|
-
window.StripoEditorApi.actionsApi.updateHtmlAndCss(
|
|
89
|
+
updateHtmlAndCss: (t, e) => {
|
|
90
|
+
window.StripoEditorApi.actionsApi.updateHtmlAndCss(t, e);
|
|
90
91
|
},
|
|
91
|
-
editorSave: () => new Promise((
|
|
92
|
-
window.StripoEditorApi.actionsApi.save((
|
|
93
|
-
|
|
92
|
+
editorSave: () => new Promise((t) => {
|
|
93
|
+
window.StripoEditorApi.actionsApi.save((e) => {
|
|
94
|
+
e && n(e, "Failed to save template"), t();
|
|
94
95
|
});
|
|
95
96
|
})
|
|
96
97
|
};
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
import { useConfig as m } from "./useConfig.js";
|
|
2
|
+
import { useAutosaveStore as A, AUTOSAVE_STATUS as s } from "../stores/autosave.js";
|
|
3
|
+
import { useEditorStore as E } from "../stores/editor.js";
|
|
4
|
+
import { computed as f, watch as p, onUnmounted as y } from "vue";
|
|
5
|
+
const I = 18e4, r = 6e4, T = (b) => {
|
|
6
|
+
const { isFeatureEnabled: S } = m(), a = E(), t = A();
|
|
7
|
+
let i = null, c = 0;
|
|
8
|
+
const u = f(
|
|
9
|
+
() => S("autosave") && t.isOn
|
|
10
|
+
), g = () => a.hasChanges && a.isInSaveableState, h = () => ({
|
|
11
|
+
hasChanges: a.hasChanges,
|
|
12
|
+
isInSaveableState: a.isInSaveableState
|
|
13
|
+
}), l = async (e) => {
|
|
14
|
+
if (!u.value) {
|
|
15
|
+
console.debug("guido:autosave:skipped", { trigger: e, reason: "not-active" });
|
|
16
|
+
return;
|
|
17
|
+
}
|
|
18
|
+
if (!g()) {
|
|
19
|
+
console.debug("guido:autosave:skipped", { trigger: e, reason: "gates-blocked", gates: h() });
|
|
20
|
+
return;
|
|
21
|
+
}
|
|
22
|
+
if (t.status === s.SAVING) {
|
|
23
|
+
console.debug("guido:autosave:skipped", { trigger: e, reason: "already-saving" });
|
|
24
|
+
return;
|
|
25
|
+
}
|
|
26
|
+
console.debug("guido:autosave:save-start", { trigger: e }), t.status = s.SAVING;
|
|
27
|
+
try {
|
|
28
|
+
if (await b() === void 0) {
|
|
29
|
+
console.debug("guido:autosave:blocked", { trigger: e, reason: "save-returned-undefined" }), t.status = s.ERROR;
|
|
30
|
+
return;
|
|
31
|
+
}
|
|
32
|
+
a.hasChanges = !1, t.status = s.SAVED, t.lastSavedAt = /* @__PURE__ */ new Date(), console.debug("guido:autosave:save-complete", { trigger: e, at: t.lastSavedAt });
|
|
33
|
+
} catch (o) {
|
|
34
|
+
console.debug("guido:autosave:error", { trigger: e, error: o }), t.status = s.ERROR;
|
|
35
|
+
}
|
|
36
|
+
}, n = () => {
|
|
37
|
+
const { visibilityState: e } = document;
|
|
38
|
+
if (console.debug("guido:autosave:visibility-change", {
|
|
39
|
+
visibilityState: e,
|
|
40
|
+
isActive: u.value
|
|
41
|
+
}), e !== "hidden")
|
|
42
|
+
return;
|
|
43
|
+
const o = Date.now() - c;
|
|
44
|
+
if (o < r) {
|
|
45
|
+
console.debug("guido:autosave:visibility-debounced", {
|
|
46
|
+
sinceLastMs: o,
|
|
47
|
+
debounceMs: r
|
|
48
|
+
});
|
|
49
|
+
return;
|
|
50
|
+
}
|
|
51
|
+
c = Date.now(), l("visibility");
|
|
52
|
+
}, d = () => {
|
|
53
|
+
i && (clearInterval(i), i = null);
|
|
54
|
+
}, v = () => {
|
|
55
|
+
document.removeEventListener("visibilitychange", n), window.removeEventListener("pagehide", n);
|
|
56
|
+
};
|
|
57
|
+
p(
|
|
58
|
+
u,
|
|
59
|
+
(e) => {
|
|
60
|
+
console.debug("guido:autosave:active-changed", { active: e }), e ? (d(), i = setInterval(() => {
|
|
61
|
+
console.debug("guido:autosave:interval-tick"), l("interval");
|
|
62
|
+
}, I), document.addEventListener("visibilitychange", n), window.addEventListener("pagehide", n)) : (d(), v(), t.status = s.IDLE);
|
|
63
|
+
},
|
|
64
|
+
{ immediate: !0 }
|
|
65
|
+
), y(() => {
|
|
66
|
+
d(), v(), t.status = s.IDLE, t.lastSavedAt = null;
|
|
67
|
+
});
|
|
68
|
+
};
|
|
69
|
+
export {
|
|
70
|
+
T as useAutoSave
|
|
71
|
+
};
|