@designcrowd/library.brand-page 5.17.25-undo-21 → 5.17.25
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/lib/src/{CreatedOnBrandCrowd-de-de-Bze5WUip.js → CreatedOnBrandCrowd-de-de-9YvB5ocm.js} +1 -1
- package/lib/src/{CreatedOnBrandCrowd-en-us-Dw5uSnX8.js → CreatedOnBrandCrowd-en-us-B8OpZpMP.js} +1 -1
- package/lib/src/{CreatedOnBrandCrowd-es-es-Cz-oPdjt.js → CreatedOnBrandCrowd-es-es-D_d6SwvE.js} +1 -1
- package/lib/src/{CreatedOnBrandCrowd-fr-fr-zldLXw3G.js → CreatedOnBrandCrowd-fr-ca-CPqNeevd.js} +1 -1
- package/lib/src/{CreatedOnBrandCrowd-fr-ca-zldLXw3G.js → CreatedOnBrandCrowd-fr-fr-CPqNeevd.js} +1 -1
- package/lib/src/{CreatedOnBrandCrowd-pt-pt-64QJpEaD.js → CreatedOnBrandCrowd-pt-br-D0DpxtjY.js} +1 -1
- package/lib/src/{CreatedOnBrandCrowd-pt-br-64QJpEaD.js → CreatedOnBrandCrowd-pt-pt-D0DpxtjY.js} +1 -1
- package/lib/src/{CreatedOnDcom-de-de-8SXOvjEH.js → CreatedOnDcom-de-de-BLKiD1pl.js} +1 -1
- package/lib/src/{CreatedOnDcom-en-us-ClZBYY_t.js → CreatedOnDcom-en-us-DGNjFV5B.js} +1 -1
- package/lib/src/{CreatedOnDcom-es-es-xg4ZwvEb.js → CreatedOnDcom-es-es-C2IDMZZe.js} +1 -1
- package/lib/src/{CreatedOnDcom-fr-ca-4zo2gxc1.js → CreatedOnDcom-fr-ca-ZRxz3QKj.js} +1 -1
- package/lib/src/{CreatedOnDcom-fr-fr-Dw9Fuy7U.js → CreatedOnDcom-fr-fr-5bE7oSdF.js} +1 -1
- package/lib/src/{CreatedOnDcom-pt-br-Dbl0EWcU.js → CreatedOnDcom-pt-br-WCumEx63.js} +1 -1
- package/lib/src/{CreatedOnDcom-pt-pt-Bps73oQE.js → CreatedOnDcom-pt-pt-C8Hinnmg.js} +1 -1
- package/lib/src/brand-page-maker/components/action-bar/ActionBar.mixin.d.ts +2 -7
- package/lib/src/brand-page-maker/components/brand-page-maker/BrandPageMaker.mixin.d.ts +2 -7
- package/lib/src/brand-page-maker/components/brand-page-maker/BrandPageMaker.mixin.js +0 -10
- package/lib/src/brand-page-maker/components/brand-page-maker/BrandPageMakerTemplateSettings.mixin.d.ts +2 -7
- package/lib/src/brand-page-maker/components/brand-page-maker/__fixtures__/brand-page-examples.js +0 -1
- package/lib/src/brand-page-maker/components/brandpage-maker-page/BrandPageMakerPage.mixin.d.ts +2 -23
- package/lib/src/brand-page-maker/components/brandpage-settings/ReplaceImageSettingsForBrandPageSettings.mixin.d.ts +2 -7
- package/lib/src/brand-page-maker/components/quick-link-bar/QuickLinkBar.mixin.d.ts +0 -3
- package/lib/src/brand-page-maker/components/quick-link-bar/QuickLinkBar.mixin.js +0 -11
- package/lib/src/brand-page-maker/components/seo-settings/SeoPageSettings.mixin.d.ts +2 -7
- package/lib/src/brand-page-maker/components/seo-settings/UrlSettings.mixin.d.ts +2 -7
- package/lib/src/brand-page-maker/components/social-share/SocialShare.mixin.d.ts +2 -7
- package/lib/src/brand-page-maker/components/template-preview/TemplatePreview.mixin.d.ts +2 -7
- package/lib/src/brand-page-maker/composables/ai-chat/useAiWebsiteBuilderChat.js +0 -9
- package/lib/src/brand-page-maker/composables/rich-text-editor/useRichTextEditor.js +1 -17
- package/lib/src/brand-page-maker/composables/useEventTracker.d.ts +0 -20
- package/lib/src/brand-page-maker/composables/useEventTracker.js +0 -17
- package/lib/src/brand-page-maker/stores/ai-thread/ai-website-builder-thread-store.d.ts +1 -1
- package/lib/src/brand-page-maker/stores/brandpage-maker/brandpage-maker-store.d.ts +2 -41
- package/lib/src/brand-page-maker/stores/brandpage-maker/brandpage-maker-store.js +5 -247
- package/lib/src/brand-page-maker/stores/logo-store/logo-store.d.ts +0 -1
- package/lib/src/brand-page-maker/stores/user/user-store.js +0 -1
- package/lib/src/bundled-translations-Bu_5FO26.js +173 -0
- package/lib/src/bundles/bundled-translations.json +1 -3
- package/lib/src/constants/ui.d.ts +0 -1
- package/lib/src/css/library.brand-page-brandCrowd.min.css +17 -22
- package/lib/src/css/library.brand-page-brandPage.min.css +18 -22
- package/lib/src/css/library.brand-page-designCom.min.css +17 -22
- package/lib/src/css/library.brand-page-preview.min.css +17 -22
- package/lib/src/index.mjs +1 -1
- package/lib/src/{lib-BgvZxeSl.js → lib-BF9ONIgx.js} +23292 -23913
- package/lib/src/shared/content-settings/components/GenericTextInput.mixin.d.ts +1 -1
- package/lib/src/shared/content-settings/components/content-settings/ContentSettings.mixin.d.ts +2 -23
- package/lib/src/shared/content-settings/components/content-settings/ContentSettings.stories.js +0 -1
- package/lib/src/shared/content-settings/components/content-settings/ReplaceImageSettingsForContent.mixin.d.ts +2 -23
- package/lib/src/shared/content-settings/components/content-settings-item/ContentSettingsItem.mixin.d.ts +0 -16
- package/lib/src/shared/content-settings/components/content-settings-item/ContentSettingsItemField.mixin.d.ts +2 -7
- package/lib/src/shared/content-settings/components/draggable-item-list/DraggableItemList.mixin.d.ts +0 -3
- package/lib/src/shared/content-settings/components/draggable-item-list/DraggableItemList.mixin.js +2 -19
- package/lib/src/shared/content-settings/components/email-field/EmailField.mixin.d.ts +1 -1
- package/lib/src/shared/content-settings/components/form-fields-field/FormFieldsField.mixin.js +8 -18
- package/lib/src/shared/content-settings/components/radio-field/RadioField.mixin.d.ts +1 -1
- package/lib/src/shared/content-settings/components/tel-field/TelField.mixin.d.ts +1 -1
- package/lib/src/shared/content-settings/components/text-field/TextField.mixin.d.ts +1 -1
- package/lib/src/shared/content-settings/components/textarea-field/TextareaField.mixin.d.ts +1 -1
- package/lib/src/shared/content-settings/components/url-field/UrlField.mixin.d.ts +1 -1
- package/lib/src/shared/content-settings/components/youtube-video-field/YoutubeVideoField.mixin.d.ts +1 -1
- package/lib/src/shared/logo-settings/components/EditLogoSettings.mixin.d.ts +0 -18
- package/lib/src/shared/logo-settings/components/EditLogoSettings.mixin.js +0 -11
- package/lib/src/shared/logo-settings/components/LogoSettings.mixin.d.ts +2 -9
- package/lib/src/shared/logo-settings/store/editable-logo-store.d.ts +1 -9
- package/lib/src/shared/logo-settings/store/editable-logo-store.js +0 -33
- package/lib/src/shared/page-settings/components/page-settings/PageSettings.mixin.d.ts +2 -24
- package/lib/src/shared/page-settings/components/page-settings-section-styles/PageSettingsSectionStyles.mixin.d.ts +2 -9
- package/lib/src/shared/publish-brand-page-with-state/PublishBrandPageModalWithState.mixin.d.ts +2 -23
- package/lib/src/shared/side-bar/components/SideBarTabButton.mixin.d.ts +0 -16
- package/lib/src/shared/style-settings/components/StyleSettings.mixin.d.ts +2 -23
- package/lib/src/shared/template-settings/components/TemplatesSettings.mixin.d.ts +0 -16
- package/package.json +1 -1
- package/src/brand-page/components/video/Video.vue +0 -2
- package/src/brand-page-maker/components/brand-page-maker/BrandPageMaker.mixin.ts +0 -11
- package/src/brand-page-maker/components/brand-page-maker/BrandPageMaker.vue +3 -2
- package/src/brand-page-maker/components/brand-page-maker/__fixtures__/brand-page-examples.ts +0 -1
- package/src/brand-page-maker/components/cookie-collection/CookieSettings.vue +17 -18
- package/src/brand-page-maker/components/quick-link-bar/QuickLinkBar.mixin.ts +0 -13
- package/src/brand-page-maker/components/quick-link-bar/QuickLinkBar.vue +4 -14
- package/src/brand-page-maker/components/quick-link-bar/i18n/quick-link-bar.json +1 -3
- package/src/brand-page-maker/components/save-contact/SaveContact.vue +19 -12
- package/src/brand-page-maker/composables/ai-chat/useAiWebsiteBuilderChat.ts +0 -10
- package/src/brand-page-maker/composables/rich-text-editor/useRichTextEditor.ts +1 -20
- package/src/brand-page-maker/composables/useEventTracker.ts +0 -29
- package/src/brand-page-maker/stores/brandpage-maker/brandpage-maker-store.test.ts +0 -166
- package/src/brand-page-maker/stores/brandpage-maker/brandpage-maker-store.ts +4 -287
- package/src/brand-page-maker/stores/logo-store/logo-store.ts +0 -5
- package/src/brand-page-maker/stores/user/user-store.ts +0 -1
- package/src/bundles/bundled-translations.json +1 -3
- package/src/constants/ui.ts +0 -1
- package/src/shared/content-settings/components/content-settings/ContentSettings.stories.ts +0 -1
- package/src/shared/content-settings/components/draggable-item-list/DraggableItemList.mixin.ts +2 -19
- package/src/shared/content-settings/components/draggable-item-list/DraggableItemList.vue +1 -1
- package/src/shared/content-settings/components/form-fields-field/FormFieldsField.mixin.ts +10 -26
- package/src/shared/content-settings/components/logo-selection-field/LogoSelection.vue +48 -63
- package/src/shared/content-settings/components/text-field/TextField.vue +0 -1
- package/src/shared/content-settings/components/text-image-field/TextImageField.vue +4 -33
- package/src/shared/logo-settings/components/EditLogoSettings.mixin.ts +0 -11
- package/src/shared/logo-settings/store/editable-logo-store.ts +1 -45
- package/lib/src/brand-page-maker/composables/useUndoRedoFlag.d.ts +0 -16
- package/lib/src/brand-page-maker/composables/useUndoRedoFlag.js +0 -22
- package/lib/src/brand-page-maker/stores/history/history-store.d.ts +0 -104
- package/lib/src/brand-page-maker/stores/history/history-store.js +0 -836
- package/lib/src/bundled-translations-CWHKs3in.js +0 -173
- package/lib/src/metadata-builder/builders/reorder-pages-builder.d.ts +0 -13
- package/lib/src/metadata-builder/builders/reorder-pages-builder.js +0 -49
- package/src/brand-page-maker/components/quick-link-bar/RedoButton.test.ts +0 -166
- package/src/brand-page-maker/components/quick-link-bar/RedoButton.vue +0 -66
- package/src/brand-page-maker/components/quick-link-bar/UndoButton.test.ts +0 -166
- package/src/brand-page-maker/components/quick-link-bar/UndoButton.vue +0 -66
- package/src/brand-page-maker/composables/useUndoRedoFlag.ts +0 -26
- package/src/brand-page-maker/stores/history/history-store.test.ts +0 -1246
- package/src/brand-page-maker/stores/history/history-store.ts +0 -1041
- package/src/metadata-builder/builders/reorder-pages-builder.ts +0 -80
|
@@ -59,7 +59,7 @@
|
|
|
59
59
|
</template>
|
|
60
60
|
</ButtonGroup>
|
|
61
61
|
<div
|
|
62
|
-
v-if="selectedOption === 1 && !containerStore.isPrePurchase"
|
|
62
|
+
v-if="data.selectedOption === 1 && !containerStore.isPrePurchase"
|
|
63
63
|
class="tw-mb-4"
|
|
64
64
|
>
|
|
65
65
|
<div class="tw-flex tw-items-center">
|
|
@@ -90,7 +90,7 @@
|
|
|
90
90
|
</div>
|
|
91
91
|
</div>
|
|
92
92
|
<div
|
|
93
|
-
v-if="selectedOption === 1 && containerStore.isPrePurchase"
|
|
93
|
+
v-if="data.selectedOption === 1 && containerStore.isPrePurchase"
|
|
94
94
|
class="tw-mb-4"
|
|
95
95
|
>
|
|
96
96
|
<LogoVariations
|
|
@@ -99,7 +99,7 @@
|
|
|
99
99
|
@logo-variation-selected="onEditableLogoVariationSelected"
|
|
100
100
|
/>
|
|
101
101
|
</div>
|
|
102
|
-
<div v-if="selectedOption === 2" class="tw-mb-4">
|
|
102
|
+
<div v-if="data.selectedOption === 2" class="tw-mb-4">
|
|
103
103
|
<UploadLogoModal>
|
|
104
104
|
<template #main="mainProp">
|
|
105
105
|
<LogoField
|
|
@@ -188,100 +188,88 @@ const logoTabs: Tab[] = reactive([
|
|
|
188
188
|
]);
|
|
189
189
|
|
|
190
190
|
const data = reactive({
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
// so the snapshot's logoDraftAsset.isByo decides instead. `null` means
|
|
194
|
-
// "derive from props".
|
|
195
|
-
manualVisibleChoice: null as null | 1 | 2,
|
|
191
|
+
selectedOption: 1,
|
|
192
|
+
currentLogoIsByo: false,
|
|
196
193
|
logoEditUrl: '',
|
|
197
194
|
});
|
|
198
195
|
|
|
199
196
|
const containerStore = useBrandPageContainerStore();
|
|
200
|
-
const logoStore = useLogoStore();
|
|
201
|
-
const editableLogoStore = useUiEditableLogoStore();
|
|
202
|
-
const sideBarStore = useUiSideBarStore();
|
|
203
|
-
const userStore = useBrandPageMakerUserStore();
|
|
204
|
-
|
|
205
|
-
const currentLogoIsByo = computed(() => {
|
|
206
|
-
const logoDraftAsset = logoStore.getLogoDraftAssetByToken(
|
|
207
|
-
props.selectedLogoDraftToken,
|
|
208
|
-
);
|
|
209
|
-
|
|
210
|
-
return !!logoDraftAsset?.isByo;
|
|
211
|
-
});
|
|
212
|
-
|
|
213
|
-
// Highlighted button. Derived purely from props + the user's most recent
|
|
214
|
-
// manual choice — never from event-handler-set local state. Undo/redo
|
|
215
|
-
// restores `props` from the history snapshot, which clears the manual
|
|
216
|
-
// override (see watcher below) so the highlight tracks whatever the
|
|
217
|
-
// snapshot says: None when isLogoVisible is false, Upload when the
|
|
218
|
-
// restored logo is BYO, Logo otherwise.
|
|
219
|
-
const selectedOption = computed<0 | 1 | 2>(() => {
|
|
220
|
-
if (!props.isLogoVisible) return 0;
|
|
221
|
-
|
|
222
|
-
if (currentLogoIsByo.value) return 2;
|
|
223
|
-
|
|
224
|
-
return data.manualVisibleChoice ?? 1;
|
|
225
|
-
});
|
|
226
197
|
|
|
227
198
|
const options = computed<ButtonGroupOption[]>(() => {
|
|
228
199
|
const optionList = [
|
|
229
200
|
{
|
|
230
201
|
label: commonTr('none'),
|
|
231
202
|
value: '0',
|
|
232
|
-
isSelected: selectedOption
|
|
203
|
+
isSelected: data.selectedOption === 0,
|
|
233
204
|
iconName: `ban`,
|
|
234
205
|
iconSize: 'sm',
|
|
235
206
|
},
|
|
236
207
|
{
|
|
237
208
|
label: commonTr('logo'),
|
|
238
209
|
value: '1',
|
|
239
|
-
isSelected: selectedOption
|
|
210
|
+
isSelected: data.selectedOption === 1,
|
|
240
211
|
iconName: `bc-mast`,
|
|
241
212
|
iconSize: 'sm',
|
|
242
213
|
},
|
|
243
214
|
{
|
|
244
215
|
label: commonTr('upload'),
|
|
245
216
|
value: '2',
|
|
246
|
-
isSelected: selectedOption
|
|
217
|
+
isSelected: data.selectedOption === 2,
|
|
247
218
|
iconName: `upload-arrow`,
|
|
248
219
|
iconSize: 'sm',
|
|
249
220
|
},
|
|
250
221
|
];
|
|
251
222
|
|
|
252
|
-
if (currentLogoIsByo
|
|
223
|
+
if (data.currentLogoIsByo) {
|
|
253
224
|
return optionList.filter((x) => x.value !== '1');
|
|
254
225
|
}
|
|
255
226
|
|
|
256
227
|
return optionList;
|
|
257
228
|
});
|
|
258
229
|
|
|
230
|
+
const logoStore = useLogoStore();
|
|
231
|
+
const editableLogoStore = useUiEditableLogoStore();
|
|
232
|
+
const sideBarStore = useUiSideBarStore();
|
|
233
|
+
const userStore = useBrandPageMakerUserStore();
|
|
234
|
+
|
|
235
|
+
onMounted(() => updateState());
|
|
236
|
+
|
|
237
|
+
watch(
|
|
238
|
+
() => props.isLogoVisible,
|
|
239
|
+
() => updateState(),
|
|
240
|
+
);
|
|
241
|
+
|
|
242
|
+
watch(
|
|
243
|
+
() => props.selectedLogoDraftToken,
|
|
244
|
+
() => updateState(),
|
|
245
|
+
);
|
|
246
|
+
|
|
247
|
+
watch(
|
|
248
|
+
() => props.selectedLogo,
|
|
249
|
+
() => updateState(),
|
|
250
|
+
);
|
|
251
|
+
|
|
259
252
|
const updateState = () => {
|
|
260
253
|
const logoDraftAsset = logoStore.getLogoDraftAssetByToken(
|
|
261
254
|
props.selectedLogoDraftToken,
|
|
262
255
|
);
|
|
263
256
|
|
|
264
257
|
data.logoEditUrl = logoDraftAsset?.logoEditUrl || '';
|
|
265
|
-
};
|
|
266
258
|
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
() => props.selectedLogoDraftToken,
|
|
277
|
-
() => {
|
|
278
|
-
data.manualVisibleChoice = null;
|
|
279
|
-
updateState();
|
|
280
|
-
},
|
|
281
|
-
);
|
|
259
|
+
if (!props.isLogoVisible) {
|
|
260
|
+
data.selectedOption = 0;
|
|
261
|
+
} else {
|
|
262
|
+
if (logoDraftAsset?.isByo) {
|
|
263
|
+
data.selectedOption = 2;
|
|
264
|
+
} else {
|
|
265
|
+
data.selectedOption = data.selectedOption || 1;
|
|
266
|
+
}
|
|
267
|
+
}
|
|
282
268
|
|
|
283
|
-
|
|
284
|
-
|
|
269
|
+
if (logoDraftAsset?.isByo) {
|
|
270
|
+
data.currentLogoIsByo = true;
|
|
271
|
+
}
|
|
272
|
+
};
|
|
285
273
|
|
|
286
274
|
const logoSettingStore = useUiLogoSettingsStore();
|
|
287
275
|
|
|
@@ -332,14 +320,9 @@ const onEditableLogoVariationSelected = (selectedLogoVariation: {
|
|
|
332
320
|
};
|
|
333
321
|
|
|
334
322
|
const onOptionSelected = (selected: ButtonGroupOption) => {
|
|
335
|
-
|
|
323
|
+
data.selectedOption = parseInt(selected.value);
|
|
336
324
|
|
|
337
|
-
|
|
338
|
-
// highlight stays put while they interact with the visible options.
|
|
339
|
-
// `null` for None — the visibility flip handles that.
|
|
340
|
-
data.manualVisibleChoice = next === 1 || next === 2 ? next : null;
|
|
341
|
-
|
|
342
|
-
emit('on-logo-visible-changed', next !== 0);
|
|
325
|
+
emit('on-logo-visible-changed', data.selectedOption !== 0);
|
|
343
326
|
};
|
|
344
327
|
|
|
345
328
|
const handleLogoVisibleToggle = () => {
|
|
@@ -380,6 +363,8 @@ const onLogoUpload = (response: CreateWebsiteByoUploadResult) => {
|
|
|
380
363
|
if (response.logoDesignAttributes) {
|
|
381
364
|
logoSettingStore.applyLogoDesignAttributes(response.logoDesignAttributes);
|
|
382
365
|
}
|
|
366
|
+
|
|
367
|
+
data.currentLogoIsByo = true;
|
|
383
368
|
};
|
|
384
369
|
|
|
385
370
|
const onEditLogoButtonClicked = () => {
|
|
@@ -565,15 +565,10 @@ const onImageLinkToggleChange = (enabled: boolean, index: number): void => {
|
|
|
565
565
|
emitChange();
|
|
566
566
|
};
|
|
567
567
|
|
|
568
|
-
|
|
569
|
-
|
|
570
|
-
|
|
571
|
-
|
|
572
|
-
|
|
573
|
-
const applyValueWithDefaults = (
|
|
574
|
-
v: TextMediaItem[],
|
|
575
|
-
): (TextMediaItem | TextShapeItem)[] => {
|
|
576
|
-
return cloneDeep(v).map((o) => ({
|
|
568
|
+
onMounted(() => {
|
|
569
|
+
options.value = cloneDeep(props.value);
|
|
570
|
+
mediaType.value = props.settings.replaceImageSettings.mediaType;
|
|
571
|
+
options.value = options.value.map((o) => ({
|
|
577
572
|
...o,
|
|
578
573
|
mediaType: mediaType.value,
|
|
579
574
|
imageLink: o.imageLink !== undefined ? o.imageLink : false,
|
|
@@ -583,39 +578,15 @@ const applyValueWithDefaults = (
|
|
|
583
578
|
email: o.email || '',
|
|
584
579
|
tel: o.tel || '',
|
|
585
580
|
})) as (TextMediaItem | TextShapeItem)[];
|
|
586
|
-
};
|
|
587
|
-
|
|
588
|
-
onMounted(() => {
|
|
589
|
-
mediaType.value = props.settings.replaceImageSettings.mediaType;
|
|
590
|
-
isSyncingFromProps = true;
|
|
591
|
-
options.value = applyValueWithDefaults(props.value);
|
|
592
581
|
|
|
593
582
|
if (!changeDebounce.value) {
|
|
594
583
|
changeDebounce.value = debounce(emitChange, DEBOUNCE_IN_MS);
|
|
595
584
|
}
|
|
596
585
|
});
|
|
597
586
|
|
|
598
|
-
// Re-sync the local `options` mirror when the store-bound value changes
|
|
599
|
-
// externally (e.g. undo/redo via history-store). Without this the sidebar
|
|
600
|
-
// keeps showing the pre-undo state while the canvas reflects the reverted
|
|
601
|
-
// store.
|
|
602
|
-
watch(
|
|
603
|
-
() => props.value,
|
|
604
|
-
(newVal) => {
|
|
605
|
-
isSyncingFromProps = true;
|
|
606
|
-
options.value = applyValueWithDefaults(newVal);
|
|
607
|
-
},
|
|
608
|
-
);
|
|
609
|
-
|
|
610
587
|
watch(
|
|
611
588
|
options,
|
|
612
589
|
() => {
|
|
613
|
-
if (isSyncingFromProps) {
|
|
614
|
-
isSyncingFromProps = false;
|
|
615
|
-
|
|
616
|
-
return;
|
|
617
|
-
}
|
|
618
|
-
|
|
619
590
|
if (changeDebounce.value) {
|
|
620
591
|
changeDebounce.value();
|
|
621
592
|
}
|
|
@@ -83,17 +83,6 @@ export default defineComponent({
|
|
|
83
83
|
return 'tw-font-bold tw-text-xs';
|
|
84
84
|
},
|
|
85
85
|
},
|
|
86
|
-
watch: {
|
|
87
|
-
// Keeps the design/upload tab in sync with `enableEditMode` whenever it
|
|
88
|
-
// flips outside the user's tab clicks — undo/redo restoring a BYO upload
|
|
89
|
-
// (mode → false) or a designed logo (mode → true). User clicks within
|
|
90
|
-
// the same mode don't change `enableEditMode` and don't trigger this.
|
|
91
|
-
showEditLogoSetting(enabled: boolean) {
|
|
92
|
-
this.selectedTab = enabled
|
|
93
|
-
? this.tabsWithTranslations[0]
|
|
94
|
-
: this.tabsWithTranslations[1];
|
|
95
|
-
},
|
|
96
|
-
},
|
|
97
86
|
methods: {
|
|
98
87
|
disableTextToggle(currentTextEnabled) {
|
|
99
88
|
if (!this.isTextOnlyLogo || !currentTextEnabled) {
|
|
@@ -116,17 +116,11 @@ export interface EditableLogoState {
|
|
|
116
116
|
logoTemplateMetadata: string;
|
|
117
117
|
isLogoDraftSaved: boolean;
|
|
118
118
|
isTextOnlyLogo: boolean;
|
|
119
|
-
// Per-draft-token snapshot of `editableLogoVariations`. Repopulated each
|
|
120
|
-
// time `updateEditableLogoImageUrlAsync` finishes rendering for the active
|
|
121
|
-
// draft. Undo/redo reads from this map to restore the variations grid for
|
|
122
|
-
// the snapshot's `logoDraftToken` instead of re-rendering through fabric-
|
|
123
|
-
// render or stuffing 4 base64 PNGs into every history entry.
|
|
124
|
-
variationsByDraftToken: Record<string, EditableLogoVariation[]>;
|
|
125
119
|
}
|
|
126
120
|
|
|
127
121
|
export type SetStateAsyncPayload = Omit<
|
|
128
122
|
EditableLogoState,
|
|
129
|
-
'enableEditMode' | 'editableLogoVariations'
|
|
123
|
+
'enableEditMode' | 'editableLogoVariations'
|
|
130
124
|
>;
|
|
131
125
|
|
|
132
126
|
export const useUiEditableLogoStore = defineStore('uiEditableLogo', {
|
|
@@ -198,7 +192,6 @@ export const useUiEditableLogoStore = defineStore('uiEditableLogo', {
|
|
|
198
192
|
},
|
|
199
193
|
makerFonts: [],
|
|
200
194
|
isLogoDraftSaved: false,
|
|
201
|
-
variationsByDraftToken: {},
|
|
202
195
|
}),
|
|
203
196
|
actions: {
|
|
204
197
|
async setStateAsync(payload: {
|
|
@@ -449,32 +442,6 @@ export const useUiEditableLogoStore = defineStore('uiEditableLogo', {
|
|
|
449
442
|
}
|
|
450
443
|
});
|
|
451
444
|
});
|
|
452
|
-
|
|
453
|
-
// Stash the freshly rendered variation set under the active draft
|
|
454
|
-
// token so undo can restore it later without re-rendering. This is
|
|
455
|
-
// the only place in production that meaningfully populates
|
|
456
|
-
// `editableLogoVariations` (BYO upload + designed-logo setStateAsync
|
|
457
|
-
// both funnel here), so caching here keeps every distinct draft's
|
|
458
|
-
// grid available for the lifetime of the session.
|
|
459
|
-
if (this.logoDraftToken) {
|
|
460
|
-
this.variationsByDraftToken[this.logoDraftToken] =
|
|
461
|
-
this.editableLogoVariations.map((v) => ({ ...v }));
|
|
462
|
-
}
|
|
463
|
-
},
|
|
464
|
-
|
|
465
|
-
/**
|
|
466
|
-
* Restore the variations grid for `logoDraftToken` from the per-token
|
|
467
|
-
* cache. Called by `_syncLogoSettingsFromSnapshot` during undo/redo.
|
|
468
|
-
* Returns true on cache hit.
|
|
469
|
-
*/
|
|
470
|
-
restoreVariationsForDraftToken(logoDraftToken: string): boolean {
|
|
471
|
-
const cached = this.variationsByDraftToken[logoDraftToken];
|
|
472
|
-
|
|
473
|
-
if (!cached) return false;
|
|
474
|
-
|
|
475
|
-
this.editableLogoVariations = cached.map((v) => ({ ...v }));
|
|
476
|
-
|
|
477
|
-
return true;
|
|
478
445
|
},
|
|
479
446
|
|
|
480
447
|
async updateMetadataAsync(
|
|
@@ -539,14 +506,6 @@ export const useUiEditableLogoStore = defineStore('uiEditableLogo', {
|
|
|
539
506
|
|
|
540
507
|
if (logoDraft) {
|
|
541
508
|
logoDraft.metadata = metadata;
|
|
542
|
-
|
|
543
|
-
// Refresh the template-asset stamp in case the active asset has
|
|
544
|
-
// changed since this draft was first registered (e.g. successive
|
|
545
|
-
// BYO uploads that share an existing draft token would otherwise
|
|
546
|
-
// keep pointing at an older template).
|
|
547
|
-
if (logoStore.logoTemplateAsset) {
|
|
548
|
-
logoDraft.templateAsset = { ...logoStore.logoTemplateAsset };
|
|
549
|
-
}
|
|
550
509
|
} else {
|
|
551
510
|
logoStore.addLogoDraftAsset({
|
|
552
511
|
logoDraftAsset: {
|
|
@@ -554,9 +513,6 @@ export const useUiEditableLogoStore = defineStore('uiEditableLogo', {
|
|
|
554
513
|
metadata,
|
|
555
514
|
tick: Date.now(),
|
|
556
515
|
isByo: logoStore.logoTemplateAsset?.isByo || false,
|
|
557
|
-
templateAsset: logoStore.logoTemplateAsset
|
|
558
|
-
? { ...logoStore.logoTemplateAsset }
|
|
559
|
-
: undefined,
|
|
560
516
|
},
|
|
561
517
|
});
|
|
562
518
|
}
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
import { type ComputedRef } from 'vue';
|
|
2
|
-
/**
|
|
3
|
-
* Returns whether undo/redo is active for the current maker session. Two
|
|
4
|
-
* conditions must hold:
|
|
5
|
-
*
|
|
6
|
-
* 1. `userStore.features.canUseUndoRedo` is true. The flag is populated by
|
|
7
|
-
* the consumer (BrandCrowd.Net / web-renderer) via the
|
|
8
|
-
* `WebsiteDesignUserFeatures.CanUseUndoRedo` boolean on the ViewModel —
|
|
9
|
-
* same precedent as RichTextEditor / GettyVideos / AITextGenerator.
|
|
10
|
-
* 2. The maker is a brand-site (Website Maker). V1 scope is brand-site
|
|
11
|
-
* only; brand-page (single-page profile) and brand-contact (vCard) are
|
|
12
|
-
* out of scope. The flag itself is global on LaunchDarkly so it can't
|
|
13
|
-
* gate this on its own — `isBrandSite` is the per-session
|
|
14
|
-
* discriminator.
|
|
15
|
-
*/
|
|
16
|
-
export declare function useUndoRedoFlag(): ComputedRef<boolean>;
|
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
import { computed } from 'vue';
|
|
2
|
-
import { useBrandPageMakerUserStore } from '@brand-page-maker/stores/user';
|
|
3
|
-
import { useBrandPageMakerStore } from '@brand-page-maker/stores/brandpage-maker/brandpage-maker-store';
|
|
4
|
-
/**
|
|
5
|
-
* Returns whether undo/redo is active for the current maker session. Two
|
|
6
|
-
* conditions must hold:
|
|
7
|
-
*
|
|
8
|
-
* 1. `userStore.features.canUseUndoRedo` is true. The flag is populated by
|
|
9
|
-
* the consumer (BrandCrowd.Net / web-renderer) via the
|
|
10
|
-
* `WebsiteDesignUserFeatures.CanUseUndoRedo` boolean on the ViewModel —
|
|
11
|
-
* same precedent as RichTextEditor / GettyVideos / AITextGenerator.
|
|
12
|
-
* 2. The maker is a brand-site (Website Maker). V1 scope is brand-site
|
|
13
|
-
* only; brand-page (single-page profile) and brand-contact (vCard) are
|
|
14
|
-
* out of scope. The flag itself is global on LaunchDarkly so it can't
|
|
15
|
-
* gate this on its own — `isBrandSite` is the per-session
|
|
16
|
-
* discriminator.
|
|
17
|
-
*/
|
|
18
|
-
export function useUndoRedoFlag() {
|
|
19
|
-
const userStore = useBrandPageMakerUserStore();
|
|
20
|
-
const brandPageMakerStore = useBrandPageMakerStore();
|
|
21
|
-
return computed(() => userStore.features.canUseUndoRedo && brandPageMakerStore.isBrandSite);
|
|
22
|
-
}
|
|
@@ -1,104 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* A single history entry.
|
|
3
|
-
*
|
|
4
|
-
* `snapshot` is a **JSON-stringified** `BrandPageModel`, not a plain object.
|
|
5
|
-
* Stringifying up-front has two benefits:
|
|
6
|
-
* 1. Pinia's reactive proxy treats the string as a primitive — no traversal,
|
|
7
|
-
* no per-field getters/setters on our entries, no accidental shared refs
|
|
8
|
-
* with the live store.
|
|
9
|
-
* 2. `sizeBytes === snapshot.length` is automatic and accurate for the V2
|
|
10
|
-
* memory-budget instrumentation.
|
|
11
|
-
*
|
|
12
|
-
* Sidecar state that doesn't live on `brandPageData` (the variations grid in
|
|
13
|
-
* the Logo sidebar, the active `logoTemplateAsset`, the active
|
|
14
|
-
* `logoDraftToken`) is restored on undo by `_syncLogoSettingsFromSnapshot`
|
|
15
|
-
* via per-draft-token caches on the logo / editable-logo stores — keyed off
|
|
16
|
-
* `logoImage.logoDraftToken` which IS in the snapshot.
|
|
17
|
-
*/
|
|
18
|
-
export interface HistoryEntry {
|
|
19
|
-
/** JSON.stringify(BrandPageModel) at the moment of capture. */
|
|
20
|
-
snapshot: string;
|
|
21
|
-
/** ISO-8601 timestamp of when the entry was captured. */
|
|
22
|
-
timestamp: string;
|
|
23
|
-
/** What kind of change produced this entry. */
|
|
24
|
-
source: 'manual_edit' | 'template_switch' | 'ai_changeset' | 'rich_text';
|
|
25
|
-
/** Who authored the change. */
|
|
26
|
-
actor: 'user' | 'ai_builder';
|
|
27
|
-
/** Optional human-readable short description. Reserved for V2 UI / debugging. */
|
|
28
|
-
label?: string;
|
|
29
|
-
/** Serialized size in bytes (= snapshot.length in JS string semantics). */
|
|
30
|
-
sizeBytes: number;
|
|
31
|
-
/**
|
|
32
|
-
* The page the user was viewing when this entry was captured. Sidecar to the
|
|
33
|
-
* `BrandPageModel` snapshot — page-tab "selected" styling and the sidebar's
|
|
34
|
-
* `currentPage` getter both key off this id (via the route URL → routeStore →
|
|
35
|
-
* `pageNavigation.activePageId`). Snapshots only contain the document model,
|
|
36
|
-
* so without this we can't restore the URL/active-page on undo and the
|
|
37
|
-
* carousel highlight bleeds through to the page that no longer exists.
|
|
38
|
-
*
|
|
39
|
-
* Empty string when no page is active yet (e.g. earliest baseline before
|
|
40
|
-
* first router push). Always a real id once the editor has settled.
|
|
41
|
-
*/
|
|
42
|
-
activePageId: string;
|
|
43
|
-
}
|
|
44
|
-
export declare const useHistoryStore: import("pinia").StoreDefinition<"history", Pick<{
|
|
45
|
-
entries: import("vue").ShallowRef<HistoryEntry[], HistoryEntry[]>;
|
|
46
|
-
currentIndex: import("vue").Ref<number, number>;
|
|
47
|
-
isApplyingSnapshot: import("vue").Ref<boolean, boolean>;
|
|
48
|
-
baselineCaptured: import("vue").Ref<boolean, boolean>;
|
|
49
|
-
canUndo: import("vue").ComputedRef<boolean>;
|
|
50
|
-
canRedo: import("vue").ComputedRef<boolean>;
|
|
51
|
-
captureBaseline: () => void;
|
|
52
|
-
capture: (args: {
|
|
53
|
-
source: HistoryEntry['source'];
|
|
54
|
-
actor: HistoryEntry['actor'];
|
|
55
|
-
label?: string;
|
|
56
|
-
}) => 'committed' | 'oversized' | 'noop' | 'skipped';
|
|
57
|
-
captureTemplateSwitch: (label?: string) => 'committed' | 'oversized' | 'noop' | 'skipped';
|
|
58
|
-
captureAiChangeset: (label?: string) => 'committed' | 'oversized' | 'noop' | 'skipped';
|
|
59
|
-
undo: () => Promise<void>;
|
|
60
|
-
redo: () => Promise<void>;
|
|
61
|
-
reset: () => void;
|
|
62
|
-
getCurrentSizeBytes: () => number;
|
|
63
|
-
getCurrentEntryCount: () => number;
|
|
64
|
-
}, "entries" | "currentIndex" | "isApplyingSnapshot" | "baselineCaptured">, Pick<{
|
|
65
|
-
entries: import("vue").ShallowRef<HistoryEntry[], HistoryEntry[]>;
|
|
66
|
-
currentIndex: import("vue").Ref<number, number>;
|
|
67
|
-
isApplyingSnapshot: import("vue").Ref<boolean, boolean>;
|
|
68
|
-
baselineCaptured: import("vue").Ref<boolean, boolean>;
|
|
69
|
-
canUndo: import("vue").ComputedRef<boolean>;
|
|
70
|
-
canRedo: import("vue").ComputedRef<boolean>;
|
|
71
|
-
captureBaseline: () => void;
|
|
72
|
-
capture: (args: {
|
|
73
|
-
source: HistoryEntry['source'];
|
|
74
|
-
actor: HistoryEntry['actor'];
|
|
75
|
-
label?: string;
|
|
76
|
-
}) => 'committed' | 'oversized' | 'noop' | 'skipped';
|
|
77
|
-
captureTemplateSwitch: (label?: string) => 'committed' | 'oversized' | 'noop' | 'skipped';
|
|
78
|
-
captureAiChangeset: (label?: string) => 'committed' | 'oversized' | 'noop' | 'skipped';
|
|
79
|
-
undo: () => Promise<void>;
|
|
80
|
-
redo: () => Promise<void>;
|
|
81
|
-
reset: () => void;
|
|
82
|
-
getCurrentSizeBytes: () => number;
|
|
83
|
-
getCurrentEntryCount: () => number;
|
|
84
|
-
}, "canUndo" | "canRedo">, Pick<{
|
|
85
|
-
entries: import("vue").ShallowRef<HistoryEntry[], HistoryEntry[]>;
|
|
86
|
-
currentIndex: import("vue").Ref<number, number>;
|
|
87
|
-
isApplyingSnapshot: import("vue").Ref<boolean, boolean>;
|
|
88
|
-
baselineCaptured: import("vue").Ref<boolean, boolean>;
|
|
89
|
-
canUndo: import("vue").ComputedRef<boolean>;
|
|
90
|
-
canRedo: import("vue").ComputedRef<boolean>;
|
|
91
|
-
captureBaseline: () => void;
|
|
92
|
-
capture: (args: {
|
|
93
|
-
source: HistoryEntry['source'];
|
|
94
|
-
actor: HistoryEntry['actor'];
|
|
95
|
-
label?: string;
|
|
96
|
-
}) => 'committed' | 'oversized' | 'noop' | 'skipped';
|
|
97
|
-
captureTemplateSwitch: (label?: string) => 'committed' | 'oversized' | 'noop' | 'skipped';
|
|
98
|
-
captureAiChangeset: (label?: string) => 'committed' | 'oversized' | 'noop' | 'skipped';
|
|
99
|
-
undo: () => Promise<void>;
|
|
100
|
-
redo: () => Promise<void>;
|
|
101
|
-
reset: () => void;
|
|
102
|
-
getCurrentSizeBytes: () => number;
|
|
103
|
-
getCurrentEntryCount: () => number;
|
|
104
|
-
}, "reset" | "undo" | "redo" | "captureBaseline" | "capture" | "captureTemplateSwitch" | "captureAiChangeset" | "getCurrentSizeBytes" | "getCurrentEntryCount">>;
|