@useinsider/guido 3.2.0-beta.ec6228c → 3.2.0-beta.f15b321
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 +13 -24
- package/dist/@types/config/schemas.js +36 -38
- package/dist/components/Guido.vue.js +4 -4
- package/dist/components/Guido.vue2.js +34 -35
- package/dist/components/organisms/header/RightSlot.vue.js +8 -8
- package/dist/components/organisms/header/RightSlot.vue2.js +8 -9
- package/dist/components/organisms/onboarding/AMPOnboarding.vue2.js +51 -31
- package/dist/components/organisms/onboarding/GenericOnboarding.vue.js +1 -1
- package/dist/components/organisms/onboarding/GenericOnboarding.vue2.js +23 -22
- package/dist/components/organisms/onboarding/ItemsOnboarding.vue.js +1 -1
- package/dist/components/organisms/onboarding/ItemsOnboarding.vue2.js +37 -39
- package/dist/components/organisms/onboarding/TextBlockOnboarding.vue.js +3 -3
- package/dist/components/organisms/onboarding/TextBlockOnboarding.vue2.js +30 -41
- package/dist/components/organisms/onboarding/VersionHistoryOnboarding.vue2.js +15 -14
- package/dist/composables/useRibbonOffset.js +21 -0
- package/dist/config/compiler/unsubscribeCompilerRules.js +40 -37
- package/dist/enums/onboarding.js +7 -2
- package/dist/enums/unsubscribe.js +34 -27
- package/dist/guido.css +1 -1
- package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/esm/index.js +258 -235
- package/dist/package.json.js +1 -1
- package/dist/src/@types/config/schemas.d.ts +0 -4
- package/dist/src/composables/useConfig.d.ts +0 -2
- package/dist/src/composables/useRibbonOffset.d.ts +4 -0
- package/dist/src/enums/onboarding.d.ts +6 -0
- package/dist/src/enums/unsubscribe.d.ts +5 -0
- package/dist/src/stores/config.d.ts +0 -18
- package/dist/src/stores/onboarding.d.ts +4 -0
- package/dist/stores/onboarding.js +4 -0
- package/package.json +3 -3
- package/dist/components/organisms/AutoSaveController.vue.js +0 -17
- package/dist/components/organisms/AutoSaveController.vue2.js +0 -13
- package/dist/components/organisms/header/AutoSaveToggle.vue.js +0 -22
- package/dist/components/organisms/header/AutoSaveToggle.vue2.js +0 -19
- package/dist/composables/useAutoSave.js +0 -68
- package/dist/src/components/organisms/AutoSaveController.vue.d.ts +0 -2
- package/dist/src/components/organisms/header/AutoSaveToggle.vue.d.ts +0 -2
- package/dist/src/composables/useAutoSave.d.ts +0 -3
- package/dist/src/stores/autosave.d.ts +0 -6
- package/dist/src/utils/timeUtil.d.ts +0 -8
- package/dist/stores/autosave.js +0 -11
- package/dist/utils/timeUtil.js +0 -19
package/dist/package.json.js
CHANGED
|
@@ -178,8 +178,6 @@ export declare const FeaturesSchema: v.ObjectSchema<{
|
|
|
178
178
|
readonly modulesDisabled: v.OptionalSchema<v.BooleanSchema<undefined>, false>;
|
|
179
179
|
/** Enable Liquid template syntax */
|
|
180
180
|
readonly liquidSyntax: v.OptionalSchema<v.BooleanSchema<undefined>, false>;
|
|
181
|
-
/** Enable autosave (2-min interval + tab-hide). User toggles on/off from the header. */
|
|
182
|
-
readonly autosave: v.OptionalSchema<v.BooleanSchema<undefined>, false>;
|
|
183
181
|
}, undefined>;
|
|
184
182
|
/**
|
|
185
183
|
* Default block types available in Stripo
|
|
@@ -503,8 +501,6 @@ export declare const GuidoConfigSchema: v.ObjectSchema<{
|
|
|
503
501
|
readonly modulesDisabled: v.OptionalSchema<v.BooleanSchema<undefined>, false>;
|
|
504
502
|
/** Enable Liquid template syntax */
|
|
505
503
|
readonly liquidSyntax: v.OptionalSchema<v.BooleanSchema<undefined>, false>;
|
|
506
|
-
/** Enable autosave (2-min interval + tab-hide). User toggles on/off from the header. */
|
|
507
|
-
readonly autosave: v.OptionalSchema<v.BooleanSchema<undefined>, false>;
|
|
508
504
|
}, undefined>, {}>;
|
|
509
505
|
/** Block configuration */
|
|
510
506
|
readonly blocks: v.OptionalSchema<v.ObjectSchema<{
|
|
@@ -62,7 +62,6 @@ export declare const useConfig: () => {
|
|
|
62
62
|
unsubscribe: boolean;
|
|
63
63
|
modulesDisabled: boolean;
|
|
64
64
|
liquidSyntax: boolean;
|
|
65
|
-
autosave: boolean;
|
|
66
65
|
};
|
|
67
66
|
blocks: {
|
|
68
67
|
excludeDefaults: ("amp-accordion" | "amp-carousel" | "amp-form-controls" | "banner-block" | "button-block" | "html-block" | "image-block" | "menu-block" | "social-block" | "spacer-block" | "text-block" | "timer-block" | "video-block")[];
|
|
@@ -160,7 +159,6 @@ export declare const useConfig: () => {
|
|
|
160
159
|
unsubscribe: boolean;
|
|
161
160
|
modulesDisabled: boolean;
|
|
162
161
|
liquidSyntax: boolean;
|
|
163
|
-
autosave: boolean;
|
|
164
162
|
} | null>;
|
|
165
163
|
blocks: import("vue").ComputedRef<{
|
|
166
164
|
excludeDefaults: ("amp-accordion" | "amp-carousel" | "amp-form-controls" | "banner-block" | "button-block" | "html-block" | "image-block" | "menu-block" | "social-block" | "spacer-block" | "text-block" | "timer-block" | "video-block")[];
|
|
@@ -3,3 +3,9 @@ export declare const UI_EDITOR_SELECTOR = "ui-editor";
|
|
|
3
3
|
export declare const CARD_COMPOSITION_TAB_SELECTOR = "button[role=\"tab\"][aria-label=\"Card Composition\"]";
|
|
4
4
|
export declare const SETTINGS_TAB_SELECTOR = "button[role=\"tab\"][aria-label=\"Settings\"]";
|
|
5
5
|
export declare const RIBBON_SELECTOR = ".in-ribbons-wrapper";
|
|
6
|
+
export declare const DYNAMIC_CONTENT_BUTTON_SELECTOR = "#guido__btn-add-dynamic-content";
|
|
7
|
+
export declare const AMP_TOGGLE_BUTTON_SELECTOR = ".guido__amp-toggle-html";
|
|
8
|
+
export declare const AMP_TOGGLE_WRAPPER_SELECTOR = ".in-segments-wrapper";
|
|
9
|
+
export declare const HEADER_SELECTOR = "[data-testid=\"guido-header\"]";
|
|
10
|
+
export declare const POPOVER_LEFT_OFFSET = 158;
|
|
11
|
+
export declare const POPOVER_TOP_GAP = 10;
|
|
@@ -12,6 +12,11 @@ export declare const URLS: {
|
|
|
12
12
|
UNSUBSCRIBE_URL: string;
|
|
13
13
|
PREFERENCES_URL: string;
|
|
14
14
|
};
|
|
15
|
+
export declare const PRODUCT_TYPE_URL_SEGMENTS: {
|
|
16
|
+
readonly 60: "email";
|
|
17
|
+
readonly 49: "journey";
|
|
18
|
+
readonly 97: "email";
|
|
19
|
+
};
|
|
15
20
|
export declare const INSIDER_ID = "iid";
|
|
16
21
|
export declare const DEFAULT_UNSUBSCRIBE_GROUP: {
|
|
17
22
|
readonly name: "Global Unsubscribe";
|
|
@@ -67,7 +67,6 @@ export declare const useConfigStore: import("pinia").StoreDefinition<"guido-conf
|
|
|
67
67
|
unsubscribe: boolean;
|
|
68
68
|
modulesDisabled: boolean;
|
|
69
69
|
liquidSyntax: boolean;
|
|
70
|
-
autosave: boolean;
|
|
71
70
|
};
|
|
72
71
|
blocks: {
|
|
73
72
|
excludeDefaults: ("amp-accordion" | "amp-carousel" | "amp-form-controls" | "banner-block" | "button-block" | "html-block" | "image-block" | "menu-block" | "social-block" | "spacer-block" | "text-block" | "timer-block" | "video-block")[];
|
|
@@ -171,7 +170,6 @@ export declare const useConfigStore: import("pinia").StoreDefinition<"guido-conf
|
|
|
171
170
|
unsubscribe: boolean;
|
|
172
171
|
modulesDisabled: boolean;
|
|
173
172
|
liquidSyntax: boolean;
|
|
174
|
-
autosave: boolean;
|
|
175
173
|
};
|
|
176
174
|
blocks: {
|
|
177
175
|
excludeDefaults: ("amp-accordion" | "amp-carousel" | "amp-form-controls" | "banner-block" | "button-block" | "html-block" | "image-block" | "menu-block" | "social-block" | "spacer-block" | "text-block" | "timer-block" | "video-block")[];
|
|
@@ -275,7 +273,6 @@ export declare const useConfigStore: import("pinia").StoreDefinition<"guido-conf
|
|
|
275
273
|
unsubscribe: boolean;
|
|
276
274
|
modulesDisabled: boolean;
|
|
277
275
|
liquidSyntax: boolean;
|
|
278
|
-
autosave: boolean;
|
|
279
276
|
};
|
|
280
277
|
blocks: {
|
|
281
278
|
excludeDefaults: ("amp-accordion" | "amp-carousel" | "amp-form-controls" | "banner-block" | "button-block" | "html-block" | "image-block" | "menu-block" | "social-block" | "spacer-block" | "text-block" | "timer-block" | "video-block")[];
|
|
@@ -379,7 +376,6 @@ export declare const useConfigStore: import("pinia").StoreDefinition<"guido-conf
|
|
|
379
376
|
unsubscribe: boolean;
|
|
380
377
|
modulesDisabled: boolean;
|
|
381
378
|
liquidSyntax: boolean;
|
|
382
|
-
autosave: boolean;
|
|
383
379
|
};
|
|
384
380
|
blocks: {
|
|
385
381
|
excludeDefaults: ("amp-accordion" | "amp-carousel" | "amp-form-controls" | "banner-block" | "button-block" | "html-block" | "image-block" | "menu-block" | "social-block" | "spacer-block" | "text-block" | "timer-block" | "video-block")[];
|
|
@@ -483,7 +479,6 @@ export declare const useConfigStore: import("pinia").StoreDefinition<"guido-conf
|
|
|
483
479
|
unsubscribe: boolean;
|
|
484
480
|
modulesDisabled: boolean;
|
|
485
481
|
liquidSyntax: boolean;
|
|
486
|
-
autosave: boolean;
|
|
487
482
|
};
|
|
488
483
|
blocks: {
|
|
489
484
|
excludeDefaults: ("amp-accordion" | "amp-carousel" | "amp-form-controls" | "banner-block" | "button-block" | "html-block" | "image-block" | "menu-block" | "social-block" | "spacer-block" | "text-block" | "timer-block" | "video-block")[];
|
|
@@ -587,7 +582,6 @@ export declare const useConfigStore: import("pinia").StoreDefinition<"guido-conf
|
|
|
587
582
|
unsubscribe: boolean;
|
|
588
583
|
modulesDisabled: boolean;
|
|
589
584
|
liquidSyntax: boolean;
|
|
590
|
-
autosave: boolean;
|
|
591
585
|
};
|
|
592
586
|
blocks: {
|
|
593
587
|
excludeDefaults: ("amp-accordion" | "amp-carousel" | "amp-form-controls" | "banner-block" | "button-block" | "html-block" | "image-block" | "menu-block" | "social-block" | "spacer-block" | "text-block" | "timer-block" | "video-block")[];
|
|
@@ -691,7 +685,6 @@ export declare const useConfigStore: import("pinia").StoreDefinition<"guido-conf
|
|
|
691
685
|
unsubscribe: boolean;
|
|
692
686
|
modulesDisabled: boolean;
|
|
693
687
|
liquidSyntax: boolean;
|
|
694
|
-
autosave: boolean;
|
|
695
688
|
};
|
|
696
689
|
blocks: {
|
|
697
690
|
excludeDefaults: ("amp-accordion" | "amp-carousel" | "amp-form-controls" | "banner-block" | "button-block" | "html-block" | "image-block" | "menu-block" | "social-block" | "spacer-block" | "text-block" | "timer-block" | "video-block")[];
|
|
@@ -795,7 +788,6 @@ export declare const useConfigStore: import("pinia").StoreDefinition<"guido-conf
|
|
|
795
788
|
unsubscribe: boolean;
|
|
796
789
|
modulesDisabled: boolean;
|
|
797
790
|
liquidSyntax: boolean;
|
|
798
|
-
autosave: boolean;
|
|
799
791
|
};
|
|
800
792
|
blocks: {
|
|
801
793
|
excludeDefaults: ("amp-accordion" | "amp-carousel" | "amp-form-controls" | "banner-block" | "button-block" | "html-block" | "image-block" | "menu-block" | "social-block" | "spacer-block" | "text-block" | "timer-block" | "video-block")[];
|
|
@@ -899,7 +891,6 @@ export declare const useConfigStore: import("pinia").StoreDefinition<"guido-conf
|
|
|
899
891
|
unsubscribe: boolean;
|
|
900
892
|
modulesDisabled: boolean;
|
|
901
893
|
liquidSyntax: boolean;
|
|
902
|
-
autosave: boolean;
|
|
903
894
|
};
|
|
904
895
|
blocks: {
|
|
905
896
|
excludeDefaults: ("amp-accordion" | "amp-carousel" | "amp-form-controls" | "banner-block" | "button-block" | "html-block" | "image-block" | "menu-block" | "social-block" | "spacer-block" | "text-block" | "timer-block" | "video-block")[];
|
|
@@ -1003,7 +994,6 @@ export declare const useConfigStore: import("pinia").StoreDefinition<"guido-conf
|
|
|
1003
994
|
unsubscribe: boolean;
|
|
1004
995
|
modulesDisabled: boolean;
|
|
1005
996
|
liquidSyntax: boolean;
|
|
1006
|
-
autosave: boolean;
|
|
1007
997
|
};
|
|
1008
998
|
blocks: {
|
|
1009
999
|
excludeDefaults: ("amp-accordion" | "amp-carousel" | "amp-form-controls" | "banner-block" | "button-block" | "html-block" | "image-block" | "menu-block" | "social-block" | "spacer-block" | "text-block" | "timer-block" | "video-block")[];
|
|
@@ -1107,7 +1097,6 @@ export declare const useConfigStore: import("pinia").StoreDefinition<"guido-conf
|
|
|
1107
1097
|
unsubscribe: boolean;
|
|
1108
1098
|
modulesDisabled: boolean;
|
|
1109
1099
|
liquidSyntax: boolean;
|
|
1110
|
-
autosave: boolean;
|
|
1111
1100
|
};
|
|
1112
1101
|
blocks: {
|
|
1113
1102
|
excludeDefaults: ("amp-accordion" | "amp-carousel" | "amp-form-controls" | "banner-block" | "button-block" | "html-block" | "image-block" | "menu-block" | "social-block" | "spacer-block" | "text-block" | "timer-block" | "video-block")[];
|
|
@@ -1211,7 +1200,6 @@ export declare const useConfigStore: import("pinia").StoreDefinition<"guido-conf
|
|
|
1211
1200
|
unsubscribe: boolean;
|
|
1212
1201
|
modulesDisabled: boolean;
|
|
1213
1202
|
liquidSyntax: boolean;
|
|
1214
|
-
autosave: boolean;
|
|
1215
1203
|
};
|
|
1216
1204
|
blocks: {
|
|
1217
1205
|
excludeDefaults: ("amp-accordion" | "amp-carousel" | "amp-form-controls" | "banner-block" | "button-block" | "html-block" | "image-block" | "menu-block" | "social-block" | "spacer-block" | "text-block" | "timer-block" | "video-block")[];
|
|
@@ -1315,7 +1303,6 @@ export declare const useConfigStore: import("pinia").StoreDefinition<"guido-conf
|
|
|
1315
1303
|
unsubscribe: boolean;
|
|
1316
1304
|
modulesDisabled: boolean;
|
|
1317
1305
|
liquidSyntax: boolean;
|
|
1318
|
-
autosave: boolean;
|
|
1319
1306
|
};
|
|
1320
1307
|
blocks: {
|
|
1321
1308
|
excludeDefaults: ("amp-accordion" | "amp-carousel" | "amp-form-controls" | "banner-block" | "button-block" | "html-block" | "image-block" | "menu-block" | "social-block" | "spacer-block" | "text-block" | "timer-block" | "video-block")[];
|
|
@@ -1419,7 +1406,6 @@ export declare const useConfigStore: import("pinia").StoreDefinition<"guido-conf
|
|
|
1419
1406
|
unsubscribe: boolean;
|
|
1420
1407
|
modulesDisabled: boolean;
|
|
1421
1408
|
liquidSyntax: boolean;
|
|
1422
|
-
autosave: boolean;
|
|
1423
1409
|
};
|
|
1424
1410
|
blocks: {
|
|
1425
1411
|
excludeDefaults: ("amp-accordion" | "amp-carousel" | "amp-form-controls" | "banner-block" | "button-block" | "html-block" | "image-block" | "menu-block" | "social-block" | "spacer-block" | "text-block" | "timer-block" | "video-block")[];
|
|
@@ -1523,7 +1509,6 @@ export declare const useConfigStore: import("pinia").StoreDefinition<"guido-conf
|
|
|
1523
1509
|
unsubscribe: boolean;
|
|
1524
1510
|
modulesDisabled: boolean;
|
|
1525
1511
|
liquidSyntax: boolean;
|
|
1526
|
-
autosave: boolean;
|
|
1527
1512
|
};
|
|
1528
1513
|
blocks: {
|
|
1529
1514
|
excludeDefaults: ("amp-accordion" | "amp-carousel" | "amp-form-controls" | "banner-block" | "button-block" | "html-block" | "image-block" | "menu-block" | "social-block" | "spacer-block" | "text-block" | "timer-block" | "video-block")[];
|
|
@@ -1627,7 +1612,6 @@ export declare const useConfigStore: import("pinia").StoreDefinition<"guido-conf
|
|
|
1627
1612
|
unsubscribe: boolean;
|
|
1628
1613
|
modulesDisabled: boolean;
|
|
1629
1614
|
liquidSyntax: boolean;
|
|
1630
|
-
autosave: boolean;
|
|
1631
1615
|
};
|
|
1632
1616
|
blocks: {
|
|
1633
1617
|
excludeDefaults: ("amp-accordion" | "amp-carousel" | "amp-form-controls" | "banner-block" | "button-block" | "html-block" | "image-block" | "menu-block" | "social-block" | "spacer-block" | "text-block" | "timer-block" | "video-block")[];
|
|
@@ -1731,7 +1715,6 @@ export declare const useConfigStore: import("pinia").StoreDefinition<"guido-conf
|
|
|
1731
1715
|
unsubscribe: boolean;
|
|
1732
1716
|
modulesDisabled: boolean;
|
|
1733
1717
|
liquidSyntax: boolean;
|
|
1734
|
-
autosave: boolean;
|
|
1735
1718
|
};
|
|
1736
1719
|
blocks: {
|
|
1737
1720
|
excludeDefaults: ("amp-accordion" | "amp-carousel" | "amp-form-controls" | "banner-block" | "button-block" | "html-block" | "image-block" | "menu-block" | "social-block" | "spacer-block" | "text-block" | "timer-block" | "video-block")[];
|
|
@@ -1835,7 +1818,6 @@ export declare const useConfigStore: import("pinia").StoreDefinition<"guido-conf
|
|
|
1835
1818
|
unsubscribe: boolean;
|
|
1836
1819
|
modulesDisabled: boolean;
|
|
1837
1820
|
liquidSyntax: boolean;
|
|
1838
|
-
autosave: boolean;
|
|
1839
1821
|
};
|
|
1840
1822
|
blocks: {
|
|
1841
1823
|
excludeDefaults: ("amp-accordion" | "amp-carousel" | "amp-form-controls" | "banner-block" | "button-block" | "html-block" | "image-block" | "menu-block" | "social-block" | "spacer-block" | "text-block" | "timer-block" | "video-block")[];
|
|
@@ -1392,6 +1392,10 @@ export declare const useOnboardingStore: import("pinia").StoreDefinition<"guidoO
|
|
|
1392
1392
|
close(type: OnboardingType): Promise<void>;
|
|
1393
1393
|
next(type: OnboardingType): void;
|
|
1394
1394
|
previous(type: OnboardingType): void;
|
|
1395
|
+
updateCardPosition(type: OnboardingType, cardIndex: number, position: {
|
|
1396
|
+
top: string;
|
|
1397
|
+
position: string;
|
|
1398
|
+
}): void;
|
|
1395
1399
|
setConfig(type: OnboardingType, config: OnboardingCardConfig[]): void;
|
|
1396
1400
|
onDiscoverNowClicked(): Promise<void>;
|
|
1397
1401
|
onRemindMeLater(): void;
|
|
@@ -71,6 +71,10 @@ const t = () => ({
|
|
|
71
71
|
previous(n) {
|
|
72
72
|
this.onboardings[n].cardIndex > 0 && this.onboardings[n].cardIndex--;
|
|
73
73
|
},
|
|
74
|
+
updateCardPosition(n, i, o) {
|
|
75
|
+
const s = this.onboardings[n].config[i];
|
|
76
|
+
s && (s.top = o.top, s.position = o.position);
|
|
77
|
+
},
|
|
74
78
|
setConfig(n, i) {
|
|
75
79
|
this.onboardings[n].config = i ?? [], this.onboardings[n].cardIndex >= this.onboardings[n].config.length && (this.onboardings[n].cardIndex = 0);
|
|
76
80
|
},
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@useinsider/guido",
|
|
3
|
-
"version": "3.2.0-beta.
|
|
3
|
+
"version": "3.2.0-beta.f15b321",
|
|
4
4
|
"description": "Guido is a Vue + TypeScript wrapper for Email Plugin. Easily embed the email editor in your Vue applications.",
|
|
5
5
|
"main": "./dist/guido.umd.cjs",
|
|
6
6
|
"module": "./dist/library.js",
|
|
@@ -32,7 +32,7 @@
|
|
|
32
32
|
"author": "",
|
|
33
33
|
"license": "ISC",
|
|
34
34
|
"dependencies": {
|
|
35
|
-
"@stripoinc/ui-editor-extensions": "3.
|
|
35
|
+
"@stripoinc/ui-editor-extensions": "3.8.0",
|
|
36
36
|
"@useinsider/design-system-vue": "1.1.0-beta.73ec2fa",
|
|
37
37
|
"@vueuse/core": "11.3.0",
|
|
38
38
|
"lodash-es": "4.17.21",
|
|
@@ -86,7 +86,7 @@
|
|
|
86
86
|
},
|
|
87
87
|
"guido": {
|
|
88
88
|
"stripo": {
|
|
89
|
-
"version": "2.
|
|
89
|
+
"version": "2.62.0"
|
|
90
90
|
}
|
|
91
91
|
}
|
|
92
92
|
}
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
import n from "./AutoSaveController.vue2.js";
|
|
2
|
-
import t from "../../_virtual/_plugin-vue2_normalizer.js";
|
|
3
|
-
var o = function() {
|
|
4
|
-
var r = this, e = r._self._c;
|
|
5
|
-
return r._self._setupProxy, e("div", { staticClass: "d-n" });
|
|
6
|
-
}, s = [], _ = /* @__PURE__ */ t(
|
|
7
|
-
n,
|
|
8
|
-
o,
|
|
9
|
-
s,
|
|
10
|
-
!1,
|
|
11
|
-
null,
|
|
12
|
-
null
|
|
13
|
-
);
|
|
14
|
-
const f = _.exports;
|
|
15
|
-
export {
|
|
16
|
-
f as default
|
|
17
|
-
};
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import { defineComponent as t } from "vue";
|
|
2
|
-
import { useAutoSave as r } from "../../composables/useAutoSave.js";
|
|
3
|
-
import { useSave as s } from "../../composables/useSave.js";
|
|
4
|
-
const f = /* @__PURE__ */ t({
|
|
5
|
-
__name: "AutoSaveController",
|
|
6
|
-
setup(a) {
|
|
7
|
-
const { save: e } = s(), o = () => e(!1);
|
|
8
|
-
return r(o), { __sfc: !0, save: e, backgroundSave: o };
|
|
9
|
-
}
|
|
10
|
-
});
|
|
11
|
-
export {
|
|
12
|
-
f as default
|
|
13
|
-
};
|
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
import o from "./AutoSaveToggle.vue2.js";
|
|
2
|
-
/* empty css */
|
|
3
|
-
import i from "../../../_virtual/_plugin-vue2_normalizer.js";
|
|
4
|
-
var n = function() {
|
|
5
|
-
var e = this, a = e._self._c, t = e._self._setupProxy;
|
|
6
|
-
return t.isFeatureEnabled("autosave") ? a("div", { staticClass: "d-f a-i-c mr-3 auto-save-toggle", on: { mouseenter: function(s) {
|
|
7
|
-
t.isHovered = !0;
|
|
8
|
-
}, mouseleave: function(s) {
|
|
9
|
-
t.isHovered = !1;
|
|
10
|
-
} } }, [a(t.InToggle, { attrs: { id: "guido__autosave-toggle", name: "guido-autosave-toggle", checked: t.autosaveStore.isOn, disable: t.editorStore.loadingStatus }, on: { click: t.toggle } }), a("span", { staticClass: "ml-2 auto-save-toggle__label t-c-55" }, [e._v(" " + e._s(t.trans("email-editor.auto-save")) + " ")]), t.autosaveStore.status === "saving" ? a("span", { staticClass: "ml-2 d-f a-i-c f-s-1" }, [a(t.InLoading, { attrs: { "color-class": "i-c-53", size: "16" } }), a("span", { staticClass: "ml-1 t-c-53" }, [e._v(" " + e._s(t.trans("newsletter.saving")) + " ")])], 1) : t.lastSavedLabel ? a("span", { staticClass: "ml-2 f-s-1 t-c-53" }, [e._v(" " + e._s(t.lastSavedLabel) + " ")]) : e._e(), t.isHovered ? a(t.InInfoBox, { staticClass: "auto-save-toggle__info-box", attrs: { id: "guido__autosave-info-box", size: "small", variant: "information", "description-text": t.trans("email-editor.auto-save-description"), "title-text": t.trans("email-editor.auto-save-title") } }) : e._e()], 1) : e._e();
|
|
11
|
-
}, l = [], r = /* @__PURE__ */ i(
|
|
12
|
-
o,
|
|
13
|
-
n,
|
|
14
|
-
l,
|
|
15
|
-
!1,
|
|
16
|
-
null,
|
|
17
|
-
"4cbf0abd"
|
|
18
|
-
);
|
|
19
|
-
const d = r.exports;
|
|
20
|
-
export {
|
|
21
|
-
d as default
|
|
22
|
-
};
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
import { defineComponent as m, ref as i, computed as f } from "vue";
|
|
2
|
-
import { useConfig as u } from "../../../composables/useConfig.js";
|
|
3
|
-
import { useTranslations as l } from "../../../composables/useTranslations.js";
|
|
4
|
-
import { useAutosaveStore as p } from "../../../stores/autosave.js";
|
|
5
|
-
import { useEditorStore as c } from "../../../stores/editor.js";
|
|
6
|
-
import { formatLocalTime as d } from "../../../utils/timeUtil.js";
|
|
7
|
-
import { InToggle as g, InLoading as v, InInfoBox as S } from "@useinsider/design-system-vue";
|
|
8
|
-
const B = /* @__PURE__ */ m({
|
|
9
|
-
__name: "AutoSaveToggle",
|
|
10
|
-
setup(_) {
|
|
11
|
-
const { isFeatureEnabled: t } = u(), e = c(), o = p(), r = l(), s = i(!1), n = f(() => o.status !== "saved" || !o.lastSavedAt ? "" : d(o.lastSavedAt));
|
|
12
|
-
return { __sfc: !0, isFeatureEnabled: t, editorStore: e, autosaveStore: o, trans: r, isHovered: s, lastSavedLabel: n, toggle: (a) => {
|
|
13
|
-
o.isOn = a;
|
|
14
|
-
}, InInfoBox: S, InLoading: v, InToggle: g };
|
|
15
|
-
}
|
|
16
|
-
});
|
|
17
|
-
export {
|
|
18
|
-
B as default
|
|
19
|
-
};
|
|
@@ -1,68 +0,0 @@
|
|
|
1
|
-
import { useConfig as m } from "./useConfig.js";
|
|
2
|
-
import { useAutosaveStore as p } from "../stores/autosave.js";
|
|
3
|
-
import { useEditorStore as S } from "../stores/editor.js";
|
|
4
|
-
import { computed as E, watch as f, onUnmounted as y } from "vue";
|
|
5
|
-
const A = 18e4, c = 6e4, O = (l) => {
|
|
6
|
-
const { isFeatureEnabled: b } = m(), s = S(), t = p();
|
|
7
|
-
let o = null, u = 0;
|
|
8
|
-
const n = E(
|
|
9
|
-
() => b("autosave") && t.isOn
|
|
10
|
-
), g = () => s.hasChanges && !s.isSaveButtonDisabled && !s.isCodeEditorOpen, h = () => ({
|
|
11
|
-
hasChanges: s.hasChanges,
|
|
12
|
-
isSaveButtonDisabled: s.isSaveButtonDisabled,
|
|
13
|
-
isCodeEditorOpen: s.isCodeEditorOpen
|
|
14
|
-
}), r = async (e) => {
|
|
15
|
-
if (!n.value) {
|
|
16
|
-
console.debug("guido:autosave:skipped", { trigger: e, reason: "not-active" });
|
|
17
|
-
return;
|
|
18
|
-
}
|
|
19
|
-
if (!g()) {
|
|
20
|
-
console.debug("guido:autosave:skipped", { trigger: e, reason: "gates-blocked", gates: h() });
|
|
21
|
-
return;
|
|
22
|
-
}
|
|
23
|
-
if (t.status === "saving") {
|
|
24
|
-
console.debug("guido:autosave:skipped", { trigger: e, reason: "already-saving" });
|
|
25
|
-
return;
|
|
26
|
-
}
|
|
27
|
-
console.debug("guido:autosave:save-start", { trigger: e }), t.status = "saving";
|
|
28
|
-
try {
|
|
29
|
-
await l(), s.hasChanges = !1, t.status = "saved", t.lastSavedAt = /* @__PURE__ */ new Date(), console.debug("guido:autosave:save-complete", { trigger: e, at: t.lastSavedAt });
|
|
30
|
-
} catch (i) {
|
|
31
|
-
console.debug("guido:autosave:error", { trigger: e, error: i }), t.status = "error";
|
|
32
|
-
}
|
|
33
|
-
}, a = () => {
|
|
34
|
-
const { visibilityState: e } = document;
|
|
35
|
-
if (console.debug("guido:autosave:visibility-change", {
|
|
36
|
-
visibilityState: e,
|
|
37
|
-
isActive: n.value
|
|
38
|
-
}), e !== "hidden")
|
|
39
|
-
return;
|
|
40
|
-
const i = Date.now() - u;
|
|
41
|
-
if (i < c) {
|
|
42
|
-
console.debug("guido:autosave:visibility-debounced", {
|
|
43
|
-
sinceLastMs: i,
|
|
44
|
-
debounceMs: c
|
|
45
|
-
});
|
|
46
|
-
return;
|
|
47
|
-
}
|
|
48
|
-
u = Date.now(), r("visibility");
|
|
49
|
-
}, d = () => {
|
|
50
|
-
o && (clearInterval(o), o = null);
|
|
51
|
-
}, v = () => {
|
|
52
|
-
document.removeEventListener("visibilitychange", a), window.removeEventListener("pagehide", a);
|
|
53
|
-
};
|
|
54
|
-
f(
|
|
55
|
-
n,
|
|
56
|
-
(e) => {
|
|
57
|
-
console.debug("guido:autosave:active-changed", { active: e }), e ? (d(), o = setInterval(() => {
|
|
58
|
-
console.debug("guido:autosave:interval-tick"), r("interval");
|
|
59
|
-
}, A), document.addEventListener("visibilitychange", a), window.addEventListener("pagehide", a)) : (d(), v(), t.status = "idle");
|
|
60
|
-
},
|
|
61
|
-
{ immediate: !0 }
|
|
62
|
-
), y(() => {
|
|
63
|
-
d(), v();
|
|
64
|
-
});
|
|
65
|
-
};
|
|
66
|
-
export {
|
|
67
|
-
O as useAutoSave
|
|
68
|
-
};
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
declare const _default: import("vue").DefineComponent<{}, {}, {}, {}, {}, import("vue/types/v3-component-options.js").ComponentOptionsMixin, import("vue/types/v3-component-options.js").ComponentOptionsMixin, {}, string, Readonly<import("vue").ExtractPropTypes<{}>>, {}>;
|
|
2
|
-
export default _default;
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
declare const _default: import("vue").DefineComponent<{}, {}, {}, {}, {}, import("vue/types/v3-component-options.js").ComponentOptionsMixin, import("vue/types/v3-component-options.js").ComponentOptionsMixin, {}, string, Readonly<import("vue").ExtractPropTypes<{}>>, {}>;
|
|
2
|
-
export default _default;
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Formats a Date as local time in 24-hour format.
|
|
3
|
-
* Pass `useTimezone = true` to append the UTC offset and city name — useful when the
|
|
4
|
-
* timestamp must clearly communicate the client's timezone.
|
|
5
|
-
* @example formatLocalTime(date) -> 12:20:02
|
|
6
|
-
* @example formatLocalTime(date, true) -> 12:20:02 (UTC+3 Istanbul)
|
|
7
|
-
*/
|
|
8
|
-
export declare const formatLocalTime: (date: Date, useTimezone?: boolean) => string;
|
package/dist/stores/autosave.js
DELETED
package/dist/utils/timeUtil.js
DELETED
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
const r = (t) => {
|
|
2
|
-
const e = -t.getTimezoneOffset(), o = e >= 0 ? "+" : "-", n = Math.abs(e), s = Math.floor(n / 60), i = n % 60;
|
|
3
|
-
return i === 0 ? `UTC${o}${s}` : `UTC${o}${s}:${String(i).padStart(2, "0")}`;
|
|
4
|
-
}, a = () => {
|
|
5
|
-
var e;
|
|
6
|
-
const { timeZone: t } = new Intl.DateTimeFormat().resolvedOptions();
|
|
7
|
-
return ((e = t.split("/").pop()) == null ? void 0 : e.replace(/_/g, " ")) ?? t;
|
|
8
|
-
}, c = (t, e = !1) => {
|
|
9
|
-
const o = t.toLocaleTimeString([], {
|
|
10
|
-
hour: "2-digit",
|
|
11
|
-
hour12: !1,
|
|
12
|
-
minute: "2-digit",
|
|
13
|
-
second: "2-digit"
|
|
14
|
-
});
|
|
15
|
-
return e ? `${o} (${r(t)} ${a()})` : o;
|
|
16
|
-
};
|
|
17
|
-
export {
|
|
18
|
-
c as formatLocalTime
|
|
19
|
-
};
|