@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.
Files changed (115) hide show
  1. package/lib/src/{CreatedOnBrandCrowd-de-de-Bze5WUip.js → CreatedOnBrandCrowd-de-de-9YvB5ocm.js} +1 -1
  2. package/lib/src/{CreatedOnBrandCrowd-en-us-Dw5uSnX8.js → CreatedOnBrandCrowd-en-us-B8OpZpMP.js} +1 -1
  3. package/lib/src/{CreatedOnBrandCrowd-es-es-Cz-oPdjt.js → CreatedOnBrandCrowd-es-es-D_d6SwvE.js} +1 -1
  4. package/lib/src/{CreatedOnBrandCrowd-fr-fr-zldLXw3G.js → CreatedOnBrandCrowd-fr-ca-CPqNeevd.js} +1 -1
  5. package/lib/src/{CreatedOnBrandCrowd-fr-ca-zldLXw3G.js → CreatedOnBrandCrowd-fr-fr-CPqNeevd.js} +1 -1
  6. package/lib/src/{CreatedOnBrandCrowd-pt-pt-64QJpEaD.js → CreatedOnBrandCrowd-pt-br-D0DpxtjY.js} +1 -1
  7. package/lib/src/{CreatedOnBrandCrowd-pt-br-64QJpEaD.js → CreatedOnBrandCrowd-pt-pt-D0DpxtjY.js} +1 -1
  8. package/lib/src/{CreatedOnDcom-de-de-8SXOvjEH.js → CreatedOnDcom-de-de-BLKiD1pl.js} +1 -1
  9. package/lib/src/{CreatedOnDcom-en-us-ClZBYY_t.js → CreatedOnDcom-en-us-DGNjFV5B.js} +1 -1
  10. package/lib/src/{CreatedOnDcom-es-es-xg4ZwvEb.js → CreatedOnDcom-es-es-C2IDMZZe.js} +1 -1
  11. package/lib/src/{CreatedOnDcom-fr-ca-4zo2gxc1.js → CreatedOnDcom-fr-ca-ZRxz3QKj.js} +1 -1
  12. package/lib/src/{CreatedOnDcom-fr-fr-Dw9Fuy7U.js → CreatedOnDcom-fr-fr-5bE7oSdF.js} +1 -1
  13. package/lib/src/{CreatedOnDcom-pt-br-Dbl0EWcU.js → CreatedOnDcom-pt-br-WCumEx63.js} +1 -1
  14. package/lib/src/{CreatedOnDcom-pt-pt-Bps73oQE.js → CreatedOnDcom-pt-pt-C8Hinnmg.js} +1 -1
  15. package/lib/src/brand-page-maker/components/action-bar/ActionBar.mixin.d.ts +2 -7
  16. package/lib/src/brand-page-maker/components/brand-page-maker/BrandPageMaker.mixin.d.ts +2 -7
  17. package/lib/src/brand-page-maker/components/brand-page-maker/BrandPageMaker.mixin.js +0 -10
  18. package/lib/src/brand-page-maker/components/brand-page-maker/BrandPageMakerTemplateSettings.mixin.d.ts +2 -7
  19. package/lib/src/brand-page-maker/components/brand-page-maker/__fixtures__/brand-page-examples.js +0 -1
  20. package/lib/src/brand-page-maker/components/brandpage-maker-page/BrandPageMakerPage.mixin.d.ts +2 -23
  21. package/lib/src/brand-page-maker/components/brandpage-settings/ReplaceImageSettingsForBrandPageSettings.mixin.d.ts +2 -7
  22. package/lib/src/brand-page-maker/components/quick-link-bar/QuickLinkBar.mixin.d.ts +0 -3
  23. package/lib/src/brand-page-maker/components/quick-link-bar/QuickLinkBar.mixin.js +0 -11
  24. package/lib/src/brand-page-maker/components/seo-settings/SeoPageSettings.mixin.d.ts +2 -7
  25. package/lib/src/brand-page-maker/components/seo-settings/UrlSettings.mixin.d.ts +2 -7
  26. package/lib/src/brand-page-maker/components/social-share/SocialShare.mixin.d.ts +2 -7
  27. package/lib/src/brand-page-maker/components/template-preview/TemplatePreview.mixin.d.ts +2 -7
  28. package/lib/src/brand-page-maker/composables/ai-chat/useAiWebsiteBuilderChat.js +0 -9
  29. package/lib/src/brand-page-maker/composables/rich-text-editor/useRichTextEditor.js +1 -17
  30. package/lib/src/brand-page-maker/composables/useEventTracker.d.ts +0 -20
  31. package/lib/src/brand-page-maker/composables/useEventTracker.js +0 -17
  32. package/lib/src/brand-page-maker/stores/ai-thread/ai-website-builder-thread-store.d.ts +1 -1
  33. package/lib/src/brand-page-maker/stores/brandpage-maker/brandpage-maker-store.d.ts +2 -41
  34. package/lib/src/brand-page-maker/stores/brandpage-maker/brandpage-maker-store.js +5 -247
  35. package/lib/src/brand-page-maker/stores/logo-store/logo-store.d.ts +0 -1
  36. package/lib/src/brand-page-maker/stores/user/user-store.js +0 -1
  37. package/lib/src/bundled-translations-Bu_5FO26.js +173 -0
  38. package/lib/src/bundles/bundled-translations.json +1 -3
  39. package/lib/src/constants/ui.d.ts +0 -1
  40. package/lib/src/css/library.brand-page-brandCrowd.min.css +17 -22
  41. package/lib/src/css/library.brand-page-brandPage.min.css +18 -22
  42. package/lib/src/css/library.brand-page-designCom.min.css +17 -22
  43. package/lib/src/css/library.brand-page-preview.min.css +17 -22
  44. package/lib/src/index.mjs +1 -1
  45. package/lib/src/{lib-BgvZxeSl.js → lib-BF9ONIgx.js} +23292 -23913
  46. package/lib/src/shared/content-settings/components/GenericTextInput.mixin.d.ts +1 -1
  47. package/lib/src/shared/content-settings/components/content-settings/ContentSettings.mixin.d.ts +2 -23
  48. package/lib/src/shared/content-settings/components/content-settings/ContentSettings.stories.js +0 -1
  49. package/lib/src/shared/content-settings/components/content-settings/ReplaceImageSettingsForContent.mixin.d.ts +2 -23
  50. package/lib/src/shared/content-settings/components/content-settings-item/ContentSettingsItem.mixin.d.ts +0 -16
  51. package/lib/src/shared/content-settings/components/content-settings-item/ContentSettingsItemField.mixin.d.ts +2 -7
  52. package/lib/src/shared/content-settings/components/draggable-item-list/DraggableItemList.mixin.d.ts +0 -3
  53. package/lib/src/shared/content-settings/components/draggable-item-list/DraggableItemList.mixin.js +2 -19
  54. package/lib/src/shared/content-settings/components/email-field/EmailField.mixin.d.ts +1 -1
  55. package/lib/src/shared/content-settings/components/form-fields-field/FormFieldsField.mixin.js +8 -18
  56. package/lib/src/shared/content-settings/components/radio-field/RadioField.mixin.d.ts +1 -1
  57. package/lib/src/shared/content-settings/components/tel-field/TelField.mixin.d.ts +1 -1
  58. package/lib/src/shared/content-settings/components/text-field/TextField.mixin.d.ts +1 -1
  59. package/lib/src/shared/content-settings/components/textarea-field/TextareaField.mixin.d.ts +1 -1
  60. package/lib/src/shared/content-settings/components/url-field/UrlField.mixin.d.ts +1 -1
  61. package/lib/src/shared/content-settings/components/youtube-video-field/YoutubeVideoField.mixin.d.ts +1 -1
  62. package/lib/src/shared/logo-settings/components/EditLogoSettings.mixin.d.ts +0 -18
  63. package/lib/src/shared/logo-settings/components/EditLogoSettings.mixin.js +0 -11
  64. package/lib/src/shared/logo-settings/components/LogoSettings.mixin.d.ts +2 -9
  65. package/lib/src/shared/logo-settings/store/editable-logo-store.d.ts +1 -9
  66. package/lib/src/shared/logo-settings/store/editable-logo-store.js +0 -33
  67. package/lib/src/shared/page-settings/components/page-settings/PageSettings.mixin.d.ts +2 -24
  68. package/lib/src/shared/page-settings/components/page-settings-section-styles/PageSettingsSectionStyles.mixin.d.ts +2 -9
  69. package/lib/src/shared/publish-brand-page-with-state/PublishBrandPageModalWithState.mixin.d.ts +2 -23
  70. package/lib/src/shared/side-bar/components/SideBarTabButton.mixin.d.ts +0 -16
  71. package/lib/src/shared/style-settings/components/StyleSettings.mixin.d.ts +2 -23
  72. package/lib/src/shared/template-settings/components/TemplatesSettings.mixin.d.ts +0 -16
  73. package/package.json +1 -1
  74. package/src/brand-page/components/video/Video.vue +0 -2
  75. package/src/brand-page-maker/components/brand-page-maker/BrandPageMaker.mixin.ts +0 -11
  76. package/src/brand-page-maker/components/brand-page-maker/BrandPageMaker.vue +3 -2
  77. package/src/brand-page-maker/components/brand-page-maker/__fixtures__/brand-page-examples.ts +0 -1
  78. package/src/brand-page-maker/components/cookie-collection/CookieSettings.vue +17 -18
  79. package/src/brand-page-maker/components/quick-link-bar/QuickLinkBar.mixin.ts +0 -13
  80. package/src/brand-page-maker/components/quick-link-bar/QuickLinkBar.vue +4 -14
  81. package/src/brand-page-maker/components/quick-link-bar/i18n/quick-link-bar.json +1 -3
  82. package/src/brand-page-maker/components/save-contact/SaveContact.vue +19 -12
  83. package/src/brand-page-maker/composables/ai-chat/useAiWebsiteBuilderChat.ts +0 -10
  84. package/src/brand-page-maker/composables/rich-text-editor/useRichTextEditor.ts +1 -20
  85. package/src/brand-page-maker/composables/useEventTracker.ts +0 -29
  86. package/src/brand-page-maker/stores/brandpage-maker/brandpage-maker-store.test.ts +0 -166
  87. package/src/brand-page-maker/stores/brandpage-maker/brandpage-maker-store.ts +4 -287
  88. package/src/brand-page-maker/stores/logo-store/logo-store.ts +0 -5
  89. package/src/brand-page-maker/stores/user/user-store.ts +0 -1
  90. package/src/bundles/bundled-translations.json +1 -3
  91. package/src/constants/ui.ts +0 -1
  92. package/src/shared/content-settings/components/content-settings/ContentSettings.stories.ts +0 -1
  93. package/src/shared/content-settings/components/draggable-item-list/DraggableItemList.mixin.ts +2 -19
  94. package/src/shared/content-settings/components/draggable-item-list/DraggableItemList.vue +1 -1
  95. package/src/shared/content-settings/components/form-fields-field/FormFieldsField.mixin.ts +10 -26
  96. package/src/shared/content-settings/components/logo-selection-field/LogoSelection.vue +48 -63
  97. package/src/shared/content-settings/components/text-field/TextField.vue +0 -1
  98. package/src/shared/content-settings/components/text-image-field/TextImageField.vue +4 -33
  99. package/src/shared/logo-settings/components/EditLogoSettings.mixin.ts +0 -11
  100. package/src/shared/logo-settings/store/editable-logo-store.ts +1 -45
  101. package/lib/src/brand-page-maker/composables/useUndoRedoFlag.d.ts +0 -16
  102. package/lib/src/brand-page-maker/composables/useUndoRedoFlag.js +0 -22
  103. package/lib/src/brand-page-maker/stores/history/history-store.d.ts +0 -104
  104. package/lib/src/brand-page-maker/stores/history/history-store.js +0 -836
  105. package/lib/src/bundled-translations-CWHKs3in.js +0 -173
  106. package/lib/src/metadata-builder/builders/reorder-pages-builder.d.ts +0 -13
  107. package/lib/src/metadata-builder/builders/reorder-pages-builder.js +0 -49
  108. package/src/brand-page-maker/components/quick-link-bar/RedoButton.test.ts +0 -166
  109. package/src/brand-page-maker/components/quick-link-bar/RedoButton.vue +0 -66
  110. package/src/brand-page-maker/components/quick-link-bar/UndoButton.test.ts +0 -166
  111. package/src/brand-page-maker/components/quick-link-bar/UndoButton.vue +0 -66
  112. package/src/brand-page-maker/composables/useUndoRedoFlag.ts +0 -26
  113. package/src/brand-page-maker/stores/history/history-store.test.ts +0 -1246
  114. package/src/brand-page-maker/stores/history/history-store.ts +0 -1041
  115. package/src/metadata-builder/builders/reorder-pages-builder.ts +0 -80
@@ -1,166 +0,0 @@
1
- import { describe, it, expect, beforeEach, vi } from 'vitest';
2
- import { mount } from '@vue/test-utils';
3
- import UndoButton from './UndoButton.vue';
4
- import { createPinia, setActivePinia } from 'pinia';
5
-
6
- // The i18n helper is imported with a constant key list. Translate to strings
7
- // so the template renders deterministically.
8
- vi.mock('@src/composables/useTranslate', () => ({
9
- quickLinkBarTr: (key: string) => {
10
- const translations: Record<string, string> = {
11
- undoLabel: 'Undo',
12
- redoLabel: 'Redo',
13
- };
14
-
15
- return translations[key] || key;
16
- },
17
- }));
18
-
19
- // fe-shared-lib primitives. Replaced with minimal stubs that surface the
20
- // data-* attributes the component sets on them — so `wrapper.find(...)` can
21
- // match them in tests.
22
- vi.mock('@designcrowd/fe-shared-lib', () => ({
23
- Icon: {
24
- name: 'Icon',
25
- inheritAttrs: true,
26
- template: '<span v-bind="$attrs" @click="$emit(\'click\', $event)" />',
27
- },
28
- Tooltip: {
29
- name: 'Tooltip',
30
- // Render the named `open` slot (where UndoButton mounts the Icon) plus
31
- // the named `content` slot (the tooltip body text).
32
- template: '<div><slot name="open" /><slot name="content" /></div>',
33
- },
34
- }));
35
-
36
- // History store mock — mutable so each test can set canUndo on it.
37
- const historyStoreMock = {
38
- canUndo: true,
39
- canRedo: false,
40
- undo: vi.fn(),
41
- redo: vi.fn(),
42
- };
43
-
44
- vi.mock('@brand-page-maker/stores/history/history-store', () => ({
45
- useHistoryStore: vi.fn(() => historyStoreMock),
46
- }));
47
-
48
- // AI-processing store mock — mutable so each test can flip isProcessing.
49
- const aiStoreMock = {
50
- isProcessing: false,
51
- };
52
-
53
- vi.mock(
54
- '@brand-page-maker/stores/ai-thread/ai-website-builder-thread-store',
55
- () => ({
56
- useAiWebsiteBuilderThreadStore: vi.fn(() => aiStoreMock),
57
- }),
58
- );
59
-
60
- // Container store mock — mutable so each test can flip isSaving.
61
- const containerStoreMock = {
62
- isSaving: false,
63
- };
64
-
65
- vi.mock('@brand-page-maker/stores/brandpage-container', () => ({
66
- useBrandPageContainerStore: vi.fn(() => containerStoreMock),
67
- }));
68
-
69
- describe('UndoButton.vue', () => {
70
- beforeEach(() => {
71
- setActivePinia(createPinia());
72
- // Reset mock state so tests are independent.
73
- historyStoreMock.canUndo = true;
74
- historyStoreMock.canRedo = false;
75
- historyStoreMock.undo = vi.fn();
76
- historyStoreMock.redo = vi.fn();
77
- aiStoreMock.isProcessing = false;
78
- containerStoreMock.isSaving = false;
79
- });
80
-
81
- it('renders the expected data-test selector', () => {
82
- const wrapper = mount(UndoButton);
83
-
84
- expect(wrapper.find('[data-test-undo-button]').exists()).toBe(true);
85
- });
86
-
87
- it('renders the expected data-component attribute', () => {
88
- const wrapper = mount(UndoButton);
89
-
90
- expect(wrapper.find('[data-component="undo-button"]').exists()).toBe(true);
91
- });
92
-
93
- it('exposes the localized aria-label', () => {
94
- const wrapper = mount(UndoButton);
95
- const icon = wrapper.find('[data-test-undo-button]');
96
-
97
- expect(icon.attributes('aria-label')).toBe('Undo');
98
- });
99
-
100
- it('marks itself disabled (via class) when canUndo is false', () => {
101
- historyStoreMock.canUndo = false;
102
-
103
- const wrapper = mount(UndoButton);
104
- const icon = wrapper.find('[data-test-undo-button]');
105
-
106
- expect(icon.classes()).toContain('tw-cursor-not-allowed');
107
- expect(icon.classes()).toContain('tw-opacity-50');
108
- });
109
-
110
- it('marks itself disabled while the AI builder is processing', () => {
111
- aiStoreMock.isProcessing = true;
112
-
113
- const wrapper = mount(UndoButton);
114
- const icon = wrapper.find('[data-test-undo-button]');
115
-
116
- expect(icon.classes()).toContain('tw-cursor-not-allowed');
117
- });
118
-
119
- it('marks itself disabled while a save is in flight', () => {
120
- containerStoreMock.isSaving = true;
121
-
122
- const wrapper = mount(UndoButton);
123
- const icon = wrapper.find('[data-test-undo-button]');
124
-
125
- expect(icon.classes()).toContain('tw-cursor-not-allowed');
126
- });
127
-
128
- it('does not dispatch historyStore.undo on click while saving', async () => {
129
- containerStoreMock.isSaving = true;
130
-
131
- const wrapper = mount(UndoButton);
132
- const icon = wrapper.find('[data-test-undo-button]');
133
-
134
- await icon.trigger('click');
135
-
136
- expect(historyStoreMock.undo).not.toHaveBeenCalled();
137
- });
138
-
139
- it('is interactive (no disabled class) at baseline with canUndo', () => {
140
- const wrapper = mount(UndoButton);
141
- const icon = wrapper.find('[data-test-undo-button]');
142
-
143
- expect(icon.classes()).toContain('tw-cursor-pointer');
144
- expect(icon.classes()).not.toContain('tw-cursor-not-allowed');
145
- });
146
-
147
- it('dispatches historyStore.undo on click when enabled', async () => {
148
- const wrapper = mount(UndoButton);
149
- const icon = wrapper.find('[data-test-undo-button]');
150
-
151
- await icon.trigger('click');
152
-
153
- expect(historyStoreMock.undo).toHaveBeenCalled();
154
- });
155
-
156
- it('does not dispatch historyStore.undo on click when disabled', async () => {
157
- historyStoreMock.canUndo = false;
158
-
159
- const wrapper = mount(UndoButton);
160
- const icon = wrapper.find('[data-test-undo-button]');
161
-
162
- await icon.trigger('click');
163
-
164
- expect(historyStoreMock.undo).not.toHaveBeenCalled();
165
- });
166
- });
@@ -1,66 +0,0 @@
1
- <template>
2
- <Tooltip
3
- direction="top"
4
- alignment="center"
5
- :should-show-icon="false"
6
- class="c-undo-button-tooltip"
7
- >
8
- <template #open>
9
- <Icon
10
- data-component="undo-button"
11
- data-test-undo-button
12
- name="undo"
13
- size="md"
14
- :aria-label="quickLinkBarTr('undoLabel')"
15
- role="button"
16
- tabindex="0"
17
- :class="[
18
- 'tw-p-2 tw-rounded tw-transition-colors',
19
- isDisabled
20
- ? 'tw-text-grayscale-500 tw-cursor-not-allowed tw-opacity-50'
21
- : 'tw-text-grayscale-800 tw-cursor-pointer hover:tw-bg-grayscale-300',
22
- ]"
23
- @click.stop="onClick"
24
- @keydown.enter.stop="onClick"
25
- @keydown.space.stop.prevent="onClick"
26
- />
27
- </template>
28
- <template #content>
29
- <span class="tw-whitespace-nowrap tw-text-sm">
30
- {{ quickLinkBarTr('undoLabel') }}
31
- </span>
32
- </template>
33
- </Tooltip>
34
- </template>
35
-
36
- <script setup lang="ts">
37
- import { computed } from 'vue';
38
- import { Icon, Tooltip } from '@designcrowd/fe-shared-lib';
39
- import { useHistoryStore } from '@brand-page-maker/stores/history/history-store';
40
- import { useAiWebsiteBuilderThreadStore } from '@brand-page-maker/stores/ai-thread/ai-website-builder-thread-store';
41
- import { useBrandPageContainerStore } from '@brand-page-maker/stores/brandpage-container';
42
- import { quickLinkBarTr } from '@src/composables/useTranslate';
43
-
44
- const historyStore = useHistoryStore();
45
- const aiThreadStore = useAiWebsiteBuilderThreadStore();
46
- const containerStore = useBrandPageContainerStore();
47
-
48
- const isDisabled = computed(
49
- () =>
50
- !historyStore.canUndo ||
51
- aiThreadStore.isProcessing ||
52
- containerStore.isSaving,
53
- );
54
-
55
- const onClick = () => {
56
- if (isDisabled.value) return;
57
- historyStore.undo();
58
- };
59
- </script>
60
-
61
- <style scoped>
62
- .c-undo-button-tooltip :deep(.shared-tooltip__body) {
63
- width: auto;
64
- padding: 4px 8px;
65
- }
66
- </style>
@@ -1,26 +0,0 @@
1
- import { computed, type ComputedRef } 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
- /**
6
- * Returns whether undo/redo is active for the current maker session. Two
7
- * conditions must hold:
8
- *
9
- * 1. `userStore.features.canUseUndoRedo` is true. The flag is populated by
10
- * the consumer (BrandCrowd.Net / web-renderer) via the
11
- * `WebsiteDesignUserFeatures.CanUseUndoRedo` boolean on the ViewModel —
12
- * same precedent as RichTextEditor / GettyVideos / AITextGenerator.
13
- * 2. The maker is a brand-site (Website Maker). V1 scope is brand-site
14
- * only; brand-page (single-page profile) and brand-contact (vCard) are
15
- * out of scope. The flag itself is global on LaunchDarkly so it can't
16
- * gate this on its own — `isBrandSite` is the per-session
17
- * discriminator.
18
- */
19
- export function useUndoRedoFlag(): ComputedRef<boolean> {
20
- const userStore = useBrandPageMakerUserStore();
21
- const brandPageMakerStore = useBrandPageMakerStore();
22
-
23
- return computed(
24
- () => userStore.features.canUseUndoRedo && brandPageMakerStore.isBrandSite,
25
- );
26
- }