@designcrowd/library.brand-page 6.1.2-color-v2-2 → 6.1.2
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-dmDPJ3B5.js → CreatedOnBrandCrowd-de-de-CU9qFyWP.js} +1 -1
- package/lib/src/{CreatedOnBrandCrowd-en-us-enXUVsBp.js → CreatedOnBrandCrowd-en-us-Yjpb7jdP.js} +1 -1
- package/lib/src/{CreatedOnBrandCrowd-es-es-C3MEil9A.js → CreatedOnBrandCrowd-es-es-D2WZ8nVO.js} +1 -1
- package/lib/src/{CreatedOnBrandCrowd-fr-fr-BZTF6RtW.js → CreatedOnBrandCrowd-fr-ca-i3ikf-KU.js} +1 -1
- package/lib/src/{CreatedOnBrandCrowd-fr-ca-BZTF6RtW.js → CreatedOnBrandCrowd-fr-fr-i3ikf-KU.js} +1 -1
- package/lib/src/{CreatedOnBrandCrowd-pt-pt-0mwjA9fv.js → CreatedOnBrandCrowd-pt-br-pjIejWpt.js} +1 -1
- package/lib/src/{CreatedOnBrandCrowd-pt-br-0mwjA9fv.js → CreatedOnBrandCrowd-pt-pt-pjIejWpt.js} +1 -1
- package/lib/src/{CreatedOnDcom-de-de-Bk2_qT2O.js → CreatedOnDcom-de-de-DpKoYjkj.js} +1 -1
- package/lib/src/{CreatedOnDcom-en-us-Ddfk_ipz.js → CreatedOnDcom-en-us-CTGKfegI.js} +1 -1
- package/lib/src/{CreatedOnDcom-es-es-5bvFd1op.js → CreatedOnDcom-es-es-BjeZz5zs.js} +1 -1
- package/lib/src/{CreatedOnDcom-fr-ca-BwLVAwM8.js → CreatedOnDcom-fr-ca-CrtEoLCA.js} +1 -1
- package/lib/src/{CreatedOnDcom-fr-fr-BVT4iQTJ.js → CreatedOnDcom-fr-fr-QFHt16jZ.js} +1 -1
- package/lib/src/{CreatedOnDcom-pt-br-BX-jIWSe.js → CreatedOnDcom-pt-br-D2dgmjtV.js} +1 -1
- package/lib/src/{CreatedOnDcom-pt-pt-VvU6cH6q.js → CreatedOnDcom-pt-pt-ZSCFPLEN.js} +1 -1
- package/lib/src/brand-page/components/background-shape/BackgroundShape.mixin.d.ts +0 -1
- package/lib/src/brand-page/components/background-shape/BackgroundShape.mixin.js +3 -18
- package/lib/src/brand-page/components/media/Shape.mixin.d.ts +0 -1
- package/lib/src/brand-page/components/media/Shape.mixin.js +2 -20
- package/lib/src/brand-page/components/page/Page.mixin.d.ts +0 -2
- package/lib/src/brand-page/components/page/Page.mixin.js +2 -21
- package/lib/src/brand-page/models/index.d.ts +0 -13
- package/lib/src/brand-page/models/index.js +0 -4
- package/lib/src/brand-page/utils/color.util.js +0 -18
- package/lib/src/brand-page/utils/index.d.ts +0 -2
- package/lib/src/brand-page/utils/index.js +0 -2
- package/lib/src/brand-page/utils/migration.util.d.ts +1 -2
- package/lib/src/brand-page/utils/migration.util.js +0 -27
- package/lib/src/brand-page/utils/style.util.d.ts +1 -14
- package/lib/src/brand-page/utils/style.util.js +0 -43
- package/lib/src/brand-page/utils/view-model.util.js +22 -22
- package/lib/src/brand-page/view-models.d.ts +1 -2
- package/lib/src/brand-page-maker/components/brandpage-maker-page/BrandPageMakerPage.mixin.d.ts +0 -2
- package/lib/src/brand-page-maker/components/brandpage-maker-page/BrandPageMakerPage.mixin.js +14 -18
- package/lib/src/brand-page-maker/components/color-picker/components/GradientColorSlider.mixin.d.ts +1 -1
- package/lib/src/brand-page-maker/components/template-preview/TemplatePreview.mixin.js +14 -17
- package/lib/src/brand-page-maker/composables/rich-text-editor/useRichTextEditor.js +5 -18
- package/lib/src/brand-page-maker/constants/sidebar-constant.d.ts +0 -1
- package/lib/src/brand-page-maker/constants/sidebar-constant.js +0 -12
- package/lib/src/brand-page-maker/stores/ai-checkpoint/ai-checkpoint-store.d.ts +0 -30
- package/lib/src/brand-page-maker/stores/brandpage-maker/brandpage-maker-store.js +35 -43
- package/lib/src/brand-page-maker/utils/index.d.ts +1 -0
- package/lib/src/brand-page-maker/utils/index.js +13 -0
- package/lib/src/brand-page-maker/utils/rich-text-editor.util.d.ts +0 -16
- package/lib/src/brand-page-maker/utils/rich-text-editor.util.js +47 -31
- package/lib/src/bundled-translations-2HkRBbBD.js +177 -0
- package/lib/src/bundled-translations.de-DE-CL9ZEhU2.js +177 -0
- package/lib/src/bundled-translations.es-ES-uj7Sliu0.js +177 -0
- package/lib/src/bundled-translations.fr-CA-BMnBtr_w.js +177 -0
- package/lib/src/bundled-translations.fr-FR-9PEZedzq.js +177 -0
- package/lib/src/bundled-translations.pt-BR-B3oNDkoe.js +177 -0
- package/lib/src/bundled-translations.pt-PT-DM7Vsf-h.js +177 -0
- package/lib/src/bundles/bundled-translations.de-DE.json +4 -3
- package/lib/src/bundles/bundled-translations.es-ES.json +4 -3
- package/lib/src/bundles/bundled-translations.fr-CA.json +4 -3
- package/lib/src/bundles/bundled-translations.fr-FR.json +4 -3
- package/lib/src/bundles/bundled-translations.json +5 -10
- package/lib/src/bundles/bundled-translations.pt-BR.json +4 -3
- package/lib/src/bundles/bundled-translations.pt-PT.json +4 -3
- package/lib/src/css/library.brand-page-brandCrowd.min.css +87 -145
- package/lib/src/css/library.brand-page-brandPage.min.css +87 -145
- package/lib/src/css/library.brand-page-designCom.min.css +87 -145
- package/lib/src/css/library.brand-page-preview.min.css +87 -145
- package/lib/src/index.mjs +1 -1
- package/lib/src/{lib-D3mtUOE0.js → lib-CkR-Ncgf.js} +33562 -34435
- package/lib/src/shared/background-settings/components/background-shapes/BackgroundShapeSettings.mixin.d.ts +286 -0
- package/lib/src/shared/background-settings/components/background-shapes/BackgroundShapeSettings.mixin.js +60 -0
- package/lib/src/shared/background-settings/composables/useSingleBackgroundShape.js +7 -5
- package/lib/src/shared/color-picker/components/ColorPicker.mixin.d.ts +1 -30
- package/lib/src/shared/color-picker/components/ColorPicker.mixin.js +6 -76
- package/lib/src/shared/color-picker/models.d.ts +0 -2
- package/lib/src/shared/content-settings/components/content-settings-item/ContentSettingsItem.mixin.d.ts +0 -3
- package/lib/src/shared/content-settings/components/content-settings-item/ContentSettingsItem.mixin.js +0 -32
- package/lib/src/shared/content-settings/components/focused-content-item-settings/FocusedContentItemSettings.mixin.d.ts +0 -3
- package/lib/src/shared/content-settings/components/focused-content-item-settings/FocusedContentItemSettings.mixin.js +0 -38
- package/lib/src/shared/content-settings/components/text-style-field/TextStyleField.mixin.d.ts +0 -9
- package/lib/src/shared/content-settings/components/text-style-field/TextStyleField.mixin.js +0 -27
- package/lib/src/shared/navigation-style-settings/components/navigation-style-settings/NavigationStyleSettings.mixin.d.ts +5 -0
- package/lib/src/shared/navigation-style-settings/components/navigation-style-settings/NavigationStyleSettings.mixin.js +50 -3
- package/lib/src/shared/style-settings/components/StyleSettings.mixin.d.ts +53 -44
- package/lib/src/shared/style-settings/components/StyleSettings.mixin.js +56 -11
- package/lib/src/shared/style-settings/models.d.ts +1 -0
- package/package.json +1 -1
- package/src/brand-page/components/background-shape/BackgroundShape.mixin.ts +3 -23
- package/src/brand-page/components/media/Shape.mixin.ts +2 -25
- package/src/brand-page/components/page/Page.mixin.ts +2 -28
- package/src/brand-page/components/page/Page.vue +0 -6
- package/src/brand-page/models/index.ts +0 -18
- package/src/brand-page/utils/__snapshots__/migration.util.test.ts.snap +27 -108
- package/src/brand-page/utils/__snapshots__/migration2.util.test.ts.snap +0 -1
- package/src/brand-page/utils/__snapshots__/model.util.test.ts.snap +0 -2
- package/src/brand-page/utils/color.util.test.ts +0 -35
- package/src/brand-page/utils/color.util.ts +0 -24
- package/src/brand-page/utils/index.ts +0 -2
- package/src/brand-page/utils/migration.util.ts +1 -37
- package/src/brand-page/utils/style.util.test.ts +0 -54
- package/src/brand-page/utils/style.util.ts +0 -57
- package/src/brand-page/utils/view-model.util.test.ts +3 -186
- package/src/brand-page/utils/view-model.util.ts +22 -22
- package/src/brand-page/view-models.ts +0 -2
- package/src/brand-page-maker/components/admin-logo-settings/AdminLogoSettings.vue +5 -2
- package/src/brand-page-maker/components/brand-page-maker/BrandPageMaker.vue +0 -2
- package/src/brand-page-maker/components/brandpage-maker-page/BrandPageMakerPage.mixin.ts +15 -21
- package/src/brand-page-maker/components/color-palette/BpColorPalette.vue +6 -75
- package/src/brand-page-maker/components/color-palette/BpColorPicker.vue +20 -91
- package/src/brand-page-maker/components/color-palette/i18n/color-palette.de-DE.json +1 -2
- package/src/brand-page-maker/components/color-palette/i18n/color-palette.es-ES.json +1 -2
- package/src/brand-page-maker/components/color-palette/i18n/color-palette.fr-CA.json +1 -2
- package/src/brand-page-maker/components/color-palette/i18n/color-palette.fr-FR.json +1 -2
- package/src/brand-page-maker/components/color-palette/i18n/color-palette.json +1 -2
- package/src/brand-page-maker/components/color-palette/i18n/color-palette.pt-BR.json +1 -2
- package/src/brand-page-maker/components/color-palette/i18n/color-palette.pt-PT.json +1 -2
- package/src/brand-page-maker/components/rich-text-editor/RichTextEditor.vue +21 -4
- package/src/brand-page-maker/components/template-preview/TemplatePreview.mixin.ts +14 -17
- package/src/brand-page-maker/composables/rich-text-editor/useRichTextEditor.ts +5 -23
- package/src/brand-page-maker/constants/sidebar-constant.ts +0 -12
- package/src/brand-page-maker/stores/brandpage-maker/__snapshots__/brandpage-maker-store.test.ts.snap +3 -3
- package/src/brand-page-maker/stores/brandpage-maker/brandpage-maker-store.test.ts +9 -80
- package/src/brand-page-maker/stores/brandpage-maker/brandpage-maker-store.ts +62 -47
- package/src/brand-page-maker/utils/index.ts +18 -0
- package/src/brand-page-maker/utils/rich-text-editor.util.test.ts +0 -67
- package/src/brand-page-maker/utils/rich-text-editor.util.ts +53 -38
- package/src/bundles/bundled-translations.de-DE.json +4 -3
- package/src/bundles/bundled-translations.es-ES.json +4 -3
- package/src/bundles/bundled-translations.fr-CA.json +4 -3
- package/src/bundles/bundled-translations.fr-FR.json +4 -3
- package/src/bundles/bundled-translations.json +5 -10
- package/src/bundles/bundled-translations.pt-BR.json +4 -3
- package/src/bundles/bundled-translations.pt-PT.json +4 -3
- package/src/shared/background-settings/components/BackgroundSettings.vue +1 -0
- package/src/shared/background-settings/components/MultiBackgroundShapes.vue +10 -4
- package/src/shared/background-settings/components/SingleBackgroundShape.vue +2 -0
- package/src/shared/background-settings/components/background-color/BackgroundColorSettings.vue +26 -5
- package/src/shared/background-settings/components/background-shapes/BackgroundShapeSettings.mixin.ts +66 -0
- package/src/shared/background-settings/components/background-shapes/BackgroundShapeSettings.vue +28 -0
- package/src/shared/background-settings/composables/useSingleBackgroundShape.ts +8 -5
- package/src/shared/color-picker/components/ColorPicker.mixin.ts +7 -81
- package/src/shared/color-picker/models.ts +0 -7
- package/src/shared/content-settings/components/color-field/ColorField.vue +122 -181
- package/src/shared/content-settings/components/color-field/i18n/color-field.json +1 -4
- package/src/shared/content-settings/components/color-replacements-field/ColorReplacementsField.vue +87 -8
- package/src/shared/content-settings/components/color-replacements-field/i18n/color-replacement-field.de-DE.json +3 -1
- package/src/shared/content-settings/components/color-replacements-field/i18n/color-replacement-field.es-ES.json +3 -1
- package/src/shared/content-settings/components/color-replacements-field/i18n/color-replacement-field.fr-CA.json +3 -1
- package/src/shared/content-settings/components/color-replacements-field/i18n/color-replacement-field.fr-FR.json +3 -1
- package/src/shared/content-settings/components/color-replacements-field/i18n/color-replacement-field.json +3 -1
- package/src/shared/content-settings/components/color-replacements-field/i18n/color-replacement-field.pt-BR.json +3 -1
- package/src/shared/content-settings/components/color-replacements-field/i18n/color-replacement-field.pt-PT.json +3 -1
- package/src/shared/content-settings/components/content-settings-item/ContentSettingsItem.mixin.ts +0 -45
- package/src/shared/content-settings/components/content-settings-item/ContentSettingsItem.vue +0 -15
- package/src/shared/content-settings/components/content-settings-item/ContentSettingsItemField.vue +1 -0
- package/src/shared/content-settings/components/draggable-item-list/DraggableItemList.vue +1 -0
- package/src/shared/content-settings/components/focused-content-item-settings/FocusedContentItemSettings.mixin.ts +0 -53
- package/src/shared/content-settings/components/focused-content-item-settings/FocusedContentItemSettings.vue +0 -10
- package/src/shared/content-settings/components/shape-field/ShapeField.vue +101 -100
- package/src/shared/content-settings/components/testimonial-items-field/TestimonialItemsField.vue +228 -227
- package/src/shared/content-settings/components/text-image-field/TextImageField.vue +1 -0
- package/src/shared/content-settings/components/text-style-field/TextStyleField.mixin.ts +0 -29
- package/src/shared/content-settings/components/text-style-field/TextStyleField.vue +15 -9
- package/src/shared/navigation-style-settings/components/navigation-style-settings/NavigationStyleSettings.mixin.ts +64 -3
- package/src/shared/navigation-style-settings/components/navigation-style-settings/NavigationStyleSettings.vue +66 -18
- package/src/shared/page-settings/components/page-settings-section-styles/PageSettingsSectionStyles.vue +4 -0
- package/src/shared/style-settings/components/StyleSettings.mixin.ts +67 -14
- package/src/shared/style-settings/components/StyleSettings.vue +213 -32
- package/src/shared/style-settings/components/i18n/style-settings.json +0 -3
- package/src/shared/style-settings/models.ts +1 -0
- package/lib/src/brand-page/utils/color-palette.util.d.ts +0 -179
- package/lib/src/brand-page/utils/color-palette.util.js +0 -372
- package/lib/src/brand-page/utils/migration/migration-21.d.ts +0 -2
- package/lib/src/brand-page/utils/migration/migration-21.js +0 -332
- package/lib/src/brand-page/utils/migration/migration-22.d.ts +0 -2
- package/lib/src/brand-page/utils/migration/migration-22.js +0 -177
- package/lib/src/brand-page/utils/text-style.util.d.ts +0 -41
- package/lib/src/brand-page/utils/text-style.util.js +0 -37
- package/lib/src/brand-page-maker/utils/apply-color-strategy.d.ts +0 -61
- package/lib/src/brand-page-maker/utils/apply-color-strategy.js +0 -136
- package/lib/src/brand-page-maker/utils/rte-field-pairs.d.ts +0 -24
- package/lib/src/brand-page-maker/utils/rte-field-pairs.js +0 -84
- package/lib/src/bundled-translations-Cdaimg3K.js +0 -177
- package/lib/src/bundled-translations.de-DE--RgmAzqM.js +0 -177
- package/lib/src/bundled-translations.es-ES-CdwBqPR4.js +0 -177
- package/lib/src/bundled-translations.fr-CA-TlHb3mW5.js +0 -177
- package/lib/src/bundled-translations.fr-FR-CUgtJXTn.js +0 -177
- package/lib/src/bundled-translations.pt-BR-BFtnOkWA.js +0 -177
- package/lib/src/bundled-translations.pt-PT-D-csapLA.js +0 -177
- package/lib/src/shared/background-settings/shape-color.util.d.ts +0 -16
- package/lib/src/shared/background-settings/shape-color.util.js +0 -26
- package/lib/src/shared/color-palette/color-match-state.d.ts +0 -57
- package/lib/src/shared/color-palette/color-match-state.js +0 -48
- package/lib/src/shared/color-palette/store/color-palette-store.d.ts +0 -92
- package/lib/src/shared/color-palette/store/color-palette-store.js +0 -171
- package/lib/src/shared/color-palette/store/index.d.ts +0 -1
- package/lib/src/shared/color-palette/store/index.js +0 -1
- package/lib/src/shared/color-strategies/color-strategies.d.ts +0 -143
- package/lib/src/shared/color-strategies/color-strategies.js +0 -276
- package/lib/src/shared/color-strategies/models.d.ts +0 -149
- package/lib/src/shared/color-strategies/models.js +0 -5
- package/lib/src/shared/color-strategies/page-anchors.d.ts +0 -38
- package/lib/src/shared/color-strategies/page-anchors.js +0 -24
- package/lib/src/shared/color-strategies/rte-color.d.ts +0 -16
- package/lib/src/shared/color-strategies/rte-color.js +0 -96
- package/src/brand-page/utils/color-palette.util.test.ts +0 -554
- package/src/brand-page/utils/color-palette.util.ts +0 -520
- package/src/brand-page/utils/migration/migration-21.test.ts +0 -762
- package/src/brand-page/utils/migration/migration-21.ts +0 -437
- package/src/brand-page/utils/migration/migration-22.test.ts +0 -367
- package/src/brand-page/utils/migration/migration-22.ts +0 -245
- package/src/brand-page/utils/text-style.util.ts +0 -45
- package/src/brand-page-maker/components/admin-settings/AdminSettings.vue +0 -54
- package/src/brand-page-maker/utils/__snapshots__/apply-color-strategy.golden.test.ts.snap +0 -26599
- package/src/brand-page-maker/utils/apply-color-strategy.golden.test.ts +0 -164
- package/src/brand-page-maker/utils/apply-color-strategy.test.ts +0 -1185
- package/src/brand-page-maker/utils/apply-color-strategy.ts +0 -240
- package/src/brand-page-maker/utils/rte-field-pairs.test.ts +0 -50
- package/src/brand-page-maker/utils/rte-field-pairs.ts +0 -98
- package/src/shared/background-settings/shape-color.util.test.ts +0 -35
- package/src/shared/background-settings/shape-color.util.ts +0 -28
- package/src/shared/color-palette/color-match-state.test.ts +0 -153
- package/src/shared/color-palette/color-match-state.ts +0 -109
- package/src/shared/color-palette/store/color-palette-store.test.ts +0 -325
- package/src/shared/color-palette/store/color-palette-store.ts +0 -251
- package/src/shared/color-palette/store/index.ts +0 -1
- package/src/shared/color-strategies/color-strategies.test.ts +0 -548
- package/src/shared/color-strategies/color-strategies.ts +0 -359
- package/src/shared/color-strategies/models.ts +0 -173
- package/src/shared/color-strategies/page-anchors.ts +0 -45
- package/src/shared/color-strategies/rte-color.test.ts +0 -209
- package/src/shared/color-strategies/rte-color.ts +0 -116
- package/src/shared/content-settings/components/color-field/ColorField.test.ts +0 -209
- package/src/shared/content-settings/components/color-match-indicator/ColorMatchIndicator.test.ts +0 -109
- package/src/shared/content-settings/components/color-match-indicator/ColorMatchIndicator.vue +0 -146
- package/src/shared/content-settings/components/color-replacements-field/ColorReplacementsField.test.ts +0 -112
- package/src/shared/content-settings/components/color-strategy-panel/ColorStrategyPanel.test.ts +0 -131
- package/src/shared/content-settings/components/color-strategy-panel/ColorStrategyPanel.vue +0 -98
- package/src/shared/content-settings/components/color-strategy-panel/color-strategy-gate.test.ts +0 -113
- package/src/shared/content-settings/components/text-style-field/TextStyleField.mixin.test.ts +0 -96
- package/src/shared/side-bar/components/SideBar.tabs.test.ts +0 -64
- package/src/shared/style-settings/components/color-palette-settings-with-state/ColorPaletteSettingsWithState.vue +0 -85
- package/src/shared/style-settings/components/style-option-color-field-with-state/StyleOptionColorFieldWithState.test.ts +0 -105
- package/src/shared/style-settings/components/style-option-color-field-with-state/StyleOptionColorFieldWithState.vue +0 -80
|
@@ -16,7 +16,6 @@ declare const _default: import("vue").DefineComponent<import("vue").ExtractPropT
|
|
|
16
16
|
backgroundShapesStyle(): BrandPageCssStyle;
|
|
17
17
|
isFullBackground(): boolean;
|
|
18
18
|
objectUrl(): string;
|
|
19
|
-
resolvedShapeColor(): string;
|
|
20
19
|
}, {
|
|
21
20
|
isValidSvgUrl(url: string): boolean;
|
|
22
21
|
applySvgAttributes(svgData: string): string;
|
|
@@ -2,7 +2,6 @@ import { defineComponent } from 'vue';
|
|
|
2
2
|
import ComponentCommonMixin from '../mixins/component-common.mixin';
|
|
3
3
|
import axios from 'axios';
|
|
4
4
|
import { applyColorToSvgString } from '@brand-page/utils/svg-color.util';
|
|
5
|
-
import { resolveColorReference, } from '@brand-page/utils/color-palette.util';
|
|
6
5
|
import { isURL } from '../../../utils/validator.util';
|
|
7
6
|
import { PROXY_SHAPE_URL_REGEX } from '@brand-page/constants';
|
|
8
7
|
import { getRegexToMatchAttributeInSvgTag } from '@brand-page/utils/svg.util';
|
|
@@ -18,11 +17,6 @@ export default defineComponent({
|
|
|
18
17
|
required: true,
|
|
19
18
|
},
|
|
20
19
|
},
|
|
21
|
-
inject: {
|
|
22
|
-
// BP-5886: getter for the page palette (provided by <Page>) to resolve
|
|
23
|
-
// `var(--id)` fills.
|
|
24
|
-
getPaletteColors: { default: undefined },
|
|
25
|
-
},
|
|
26
20
|
data() {
|
|
27
21
|
return {
|
|
28
22
|
svgData: '',
|
|
@@ -54,18 +48,9 @@ export default defineComponent({
|
|
|
54
48
|
}
|
|
55
49
|
return this.viewModel.name;
|
|
56
50
|
},
|
|
57
|
-
// BP-5886: the shape's colour with any palette `var(--id)` resolved to its
|
|
58
|
-
// concrete value — `var()` can't resolve inside the <img>-embedded SVG.
|
|
59
|
-
resolvedShapeColor() {
|
|
60
|
-
const getColors = this.getPaletteColors;
|
|
61
|
-
const colors = getColors?.() ?? [];
|
|
62
|
-
return resolveColorReference(this.viewModel?.style?.color, colors);
|
|
63
|
-
},
|
|
64
51
|
},
|
|
65
52
|
watch: {
|
|
66
|
-
|
|
67
|
-
// colour edit and an edit to a referenced palette role.
|
|
68
|
-
resolvedShapeColor: {
|
|
53
|
+
'viewModel.style.color': {
|
|
69
54
|
handler() {
|
|
70
55
|
this.render();
|
|
71
56
|
},
|
|
@@ -161,8 +146,8 @@ export default defineComponent({
|
|
|
161
146
|
else {
|
|
162
147
|
this.originalSvgData = this.viewModel.name;
|
|
163
148
|
}
|
|
164
|
-
if (this.
|
|
165
|
-
this.svgData = applyColorToSvgString(this.originalSvgData, this.
|
|
149
|
+
if (this.viewModel.style.color) {
|
|
150
|
+
this.svgData = applyColorToSvgString(this.originalSvgData, this.viewModel.style.color);
|
|
166
151
|
}
|
|
167
152
|
else {
|
|
168
153
|
this.svgData = this.originalSvgData;
|
|
@@ -30,7 +30,6 @@ declare const _default: import("vue").DefineComponent<import("vue").ExtractPropT
|
|
|
30
30
|
originalSvgData: string;
|
|
31
31
|
}, {
|
|
32
32
|
useObjectElement(): boolean;
|
|
33
|
-
resolvedColorReplacements(): ColorReplacement[];
|
|
34
33
|
objectStyle(): {
|
|
35
34
|
width?: undefined;
|
|
36
35
|
height?: undefined;
|
|
@@ -2,7 +2,6 @@ import { defineComponent } from 'vue';
|
|
|
2
2
|
import ComponentCommonMixin from '../mixins/component-common.mixin';
|
|
3
3
|
import axios from 'axios';
|
|
4
4
|
import { applyColorReplacementsToSvgString } from '@brand-page/utils/svg-color.util';
|
|
5
|
-
import { resolveColorReference, } from '@brand-page/utils/color-palette.util';
|
|
6
5
|
import { PROXY_SHAPE_URL_REGEX } from '@brand-page/constants';
|
|
7
6
|
import { getRegexToMatchAttributeInSvgTag } from '@brand-page/utils/svg.util';
|
|
8
7
|
export default defineComponent({
|
|
@@ -32,11 +31,6 @@ export default defineComponent({
|
|
|
32
31
|
default: undefined,
|
|
33
32
|
},
|
|
34
33
|
},
|
|
35
|
-
inject: {
|
|
36
|
-
// BP-5886: getter for the page palette (provided by <Page>) — used to resolve
|
|
37
|
-
// `var(--id)` fills to concrete colours before the SVG is built.
|
|
38
|
-
getPaletteColors: { default: undefined },
|
|
39
|
-
},
|
|
40
34
|
data() {
|
|
41
35
|
return { svgData: '', svgDataObjectUrl: '', originalSvgData: '' };
|
|
42
36
|
},
|
|
@@ -44,16 +38,6 @@ export default defineComponent({
|
|
|
44
38
|
useObjectElement() {
|
|
45
39
|
return !!this.imageUrl.match(PROXY_SHAPE_URL_REGEX);
|
|
46
40
|
},
|
|
47
|
-
// BP-5886: colour replacements with any palette `var(--id)` resolved to its
|
|
48
|
-
// concrete value — `var()` can't resolve inside the <img>-embedded SVG.
|
|
49
|
-
resolvedColorReplacements() {
|
|
50
|
-
const getColors = this.getPaletteColors;
|
|
51
|
-
const colors = getColors?.() ?? [];
|
|
52
|
-
return (this.colorReplacements ?? []).map((c) => ({
|
|
53
|
-
...c,
|
|
54
|
-
replacementColor: resolveColorReference(c.replacementColor, colors),
|
|
55
|
-
}));
|
|
56
|
-
},
|
|
57
41
|
objectStyle() {
|
|
58
42
|
if (!this.size) {
|
|
59
43
|
return {};
|
|
@@ -76,9 +60,7 @@ export default defineComponent({
|
|
|
76
60
|
},
|
|
77
61
|
},
|
|
78
62
|
watch: {
|
|
79
|
-
|
|
80
|
-
// its own colours change and when a referenced palette colour is edited.
|
|
81
|
-
resolvedColorReplacements: {
|
|
63
|
+
colorReplacements: {
|
|
82
64
|
handler(newVal, oldVal) {
|
|
83
65
|
if (newVal &&
|
|
84
66
|
oldVal &&
|
|
@@ -154,7 +136,7 @@ export default defineComponent({
|
|
|
154
136
|
if (!this.originalSvgData) {
|
|
155
137
|
return;
|
|
156
138
|
}
|
|
157
|
-
this.svgData = applyColorReplacementsToSvgString(this.originalSvgData, this.
|
|
139
|
+
this.svgData = applyColorReplacementsToSvgString(this.originalSvgData, this.colorReplacements);
|
|
158
140
|
this.svgData = this.applySvgAttributes(this.svgData);
|
|
159
141
|
const blob = new Blob([this.svgData], { type: 'image/svg+xml' });
|
|
160
142
|
const oldSvgDataObjectUrl = this.svgDataObjectUrl;
|
|
@@ -52,8 +52,6 @@ declare const _default: import("vue").DefineComponent<import("vue").ExtractPropT
|
|
|
52
52
|
styles: {};
|
|
53
53
|
}, {
|
|
54
54
|
brandPageToken(): string | null;
|
|
55
|
-
shouldEmitPaletteRoot(): boolean;
|
|
56
|
-
paletteRootStyleHtml(): string;
|
|
57
55
|
contents(): ContentViewModel[];
|
|
58
56
|
backgroundShapes(): BackgroundShape[];
|
|
59
57
|
rootElementStyles(): BrandPageCssStyle;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { defineComponent
|
|
1
|
+
import { defineComponent } from 'vue';
|
|
2
2
|
import { DEFAULT_FONT_FAMILY_KEY, FALLBACK_FONT_FAMILIES, FONT_FAMILY_CONFIGS, } from '../../constants';
|
|
3
|
-
import { getSlugFromContext, getPageHeadingText
|
|
3
|
+
import { getSlugFromContext, getPageHeadingText } from '@brand-page/utils';
|
|
4
4
|
import { findNavItemByRelativePath } from '@brand-page/utils/route.util';
|
|
5
5
|
import { BRAND_PAGE_TYPES } from '@brand-page/models';
|
|
6
6
|
import { hasProfileContent as checkHasProfileContent } from '@brand-page/utils/vcard.util';
|
|
@@ -59,14 +59,6 @@ export default defineComponent({
|
|
|
59
59
|
'save-contact-widget-click',
|
|
60
60
|
],
|
|
61
61
|
setup(props) {
|
|
62
|
-
// BP-5886: shapes render as <img>-embedded SVG, an isolated document the
|
|
63
|
-
// `:root` palette block can't reach, so a `var(--id)` fill won't resolve.
|
|
64
|
-
// Provide the palette as a getter so the shape mixins can resolve their refs
|
|
65
|
-
// to concrete colours before building the SVG. A getter (not a provided ref)
|
|
66
|
-
// sidesteps Options-API inject ref-unwrapping ambiguity and stays reactive:
|
|
67
|
-
// calling it inside a shape's computed tracks `viewModel.styles.colors`, so
|
|
68
|
-
// shapes recolour when a referenced palette colour is edited.
|
|
69
|
-
provide('getPaletteColors', () => props.viewModel?.styles?.colors ?? []);
|
|
70
62
|
return {
|
|
71
63
|
fluidText: JSON.stringify({
|
|
72
64
|
default: props.context.brandPageType === BRAND_PAGE_TYPES.brandSite
|
|
@@ -85,17 +77,6 @@ export default defineComponent({
|
|
|
85
77
|
brandPageToken() {
|
|
86
78
|
return this.viewModel?.brandPageToken || null;
|
|
87
79
|
},
|
|
88
|
-
// BP-5886 — global colour palette emitted as a single `:root` block.
|
|
89
|
-
// Only the published single-document surfaces emit the global block:
|
|
90
|
-
// template-grid cards get scoped vars (TemplatePreview) and the maker main
|
|
91
|
-
// preview emits from BrandPageMakerPage, so guard those out to avoid a
|
|
92
|
-
// duplicate / colliding `:root`.
|
|
93
|
-
shouldEmitPaletteRoot() {
|
|
94
|
-
return !this.context?.isTemplate && !this.context?.isPreview;
|
|
95
|
-
},
|
|
96
|
-
paletteRootStyleHtml() {
|
|
97
|
-
return buildPaletteRootCss(this.viewModel?.styles?.colors ?? []);
|
|
98
|
-
},
|
|
99
80
|
contents() {
|
|
100
81
|
return this.pageViewModel?.contents || [];
|
|
101
82
|
},
|
|
@@ -61,7 +61,6 @@ export declare class PageStyles {
|
|
|
61
61
|
logoStyles: LogoStyles;
|
|
62
62
|
textStyles: TextStyles;
|
|
63
63
|
galleryStyles: GalleryStyles;
|
|
64
|
-
colors: ColorItem[];
|
|
65
64
|
constructor(option?: Partial<Omit<PageStyles, 'logoStyles' | 'buttonStyles' | 'backgroundStyles' | 'textStyles'>> & {
|
|
66
65
|
logoStyles?: Partial<LogoStyles>;
|
|
67
66
|
buttonStyles?: Partial<ButtonStyles>;
|
|
@@ -379,18 +378,6 @@ export interface ColorReplacement {
|
|
|
379
378
|
originalColor: string;
|
|
380
379
|
replacementColor: string;
|
|
381
380
|
}
|
|
382
|
-
/**
|
|
383
|
-
* A single entry in the global colour palette (BP-5886).
|
|
384
|
-
* `id` is the CSS-variable name emitted at :root (`--<id>`); elements reference
|
|
385
|
-
* the colour via `var(--<id>)`. `value` is a concrete literal (rgb/#hex or a
|
|
386
|
-
* gradient string). `palette` = the 4 static brand roles (`palette-0`…`palette-3`);
|
|
387
|
-
* `custom` = one-off colours chosen on elements (`palette-custom-<uuid>`).
|
|
388
|
-
*/
|
|
389
|
-
export interface ColorItem {
|
|
390
|
-
id: string;
|
|
391
|
-
value: string;
|
|
392
|
-
type: 'palette' | 'custom';
|
|
393
|
-
}
|
|
394
381
|
export interface TestimonialSectionContent extends Content {
|
|
395
382
|
type: 'testimonial-section';
|
|
396
383
|
title: RichTextValue;
|
|
@@ -85,9 +85,6 @@ export class PageStyles {
|
|
|
85
85
|
logoStyles;
|
|
86
86
|
textStyles;
|
|
87
87
|
galleryStyles;
|
|
88
|
-
// BP-5886 global colour palette. Non-nullable (default []) per the model
|
|
89
|
-
// reactivity rule; old persisted `styles` that omit it hydrate to [].
|
|
90
|
-
colors;
|
|
91
88
|
constructor(option = {}) {
|
|
92
89
|
this.backgroundStyles = new BackgroundStyles(option.backgroundStyles || {
|
|
93
90
|
backgroundImageUrl: '',
|
|
@@ -112,7 +109,6 @@ export class PageStyles {
|
|
|
112
109
|
? new TextStyles(option.textStyles)
|
|
113
110
|
: TextStyles.GetDefaultTextStyle();
|
|
114
111
|
this.galleryStyles = new GalleryStyles(option.galleryStyles);
|
|
115
|
-
this.colors = option.colors ? option.colors.map((c) => ({ ...c })) : [];
|
|
116
112
|
}
|
|
117
113
|
}
|
|
118
114
|
export const ASPECT_RATIOS = {
|
|
@@ -25,34 +25,16 @@ export const calculateLuminanceRatio = (color1, color2) => {
|
|
|
25
25
|
: (color1luminance + 0.05) / (color2luminance + 0.05);
|
|
26
26
|
return ratio;
|
|
27
27
|
};
|
|
28
|
-
// BP-5886: these helpers assume a `#rrggbb[aa]` hex. Under the palette model a
|
|
29
|
-
// colour value may instead be a `var(--id)` reference (or a named colour /
|
|
30
|
-
// gradient), and blindly substringing those yields garbage (e.g. `var(--p`),
|
|
31
|
-
// which corrupts the picker swatch. Guard so a non-hex value passes through
|
|
32
|
-
// untouched rather than being mangled.
|
|
33
|
-
const isHashPrefixedHex = (value) => typeof value === 'string' && value.trim().startsWith('#');
|
|
34
28
|
export const isHexTransparent = (hex) => {
|
|
35
|
-
if (!isHashPrefixedHex(hex)) {
|
|
36
|
-
return false;
|
|
37
|
-
}
|
|
38
29
|
return hex.trim().substring(7, 9) === '00';
|
|
39
30
|
};
|
|
40
31
|
export const removeAlphaFromHex = (hex) => {
|
|
41
|
-
if (!isHashPrefixedHex(hex)) {
|
|
42
|
-
return hex;
|
|
43
|
-
}
|
|
44
32
|
return hex.trim().substring(0, 7);
|
|
45
33
|
};
|
|
46
34
|
export const addTransparentAlphaChannelToHex = (hex) => {
|
|
47
|
-
if (!isHashPrefixedHex(hex)) {
|
|
48
|
-
return hex;
|
|
49
|
-
}
|
|
50
35
|
return `${removeAlphaFromHex(hex)}00`;
|
|
51
36
|
};
|
|
52
37
|
export const addOpacityToHex = (hex, opacity) => {
|
|
53
|
-
if (!isHashPrefixedHex(hex)) {
|
|
54
|
-
return hex;
|
|
55
|
-
}
|
|
56
38
|
return `${removeAlphaFromHex(hex)}${Math.round(opacity * 255).toString(16)}`;
|
|
57
39
|
};
|
|
58
40
|
export const setRgbAlpha = (rgb, alpha) => {
|
|
@@ -1,9 +1,7 @@
|
|
|
1
1
|
export * from './style.util';
|
|
2
|
-
export * from './color-palette.util';
|
|
3
2
|
export * from './content-padding.util';
|
|
4
3
|
export * from './view-model.util';
|
|
5
4
|
export * from './text.util';
|
|
6
|
-
export * from './text-style.util';
|
|
7
5
|
export * from './model.util';
|
|
8
6
|
export * from './validation.util';
|
|
9
7
|
export * from './payment.util';
|
|
@@ -1,9 +1,7 @@
|
|
|
1
1
|
export * from './style.util';
|
|
2
|
-
export * from './color-palette.util';
|
|
3
2
|
export * from './content-padding.util';
|
|
4
3
|
export * from './view-model.util';
|
|
5
4
|
export * from './text.util';
|
|
6
|
-
export * from './text-style.util';
|
|
7
5
|
export * from './model.util';
|
|
8
6
|
export * from './validation.util';
|
|
9
7
|
export * from './payment.util';
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { type BrandPageModel, type LogoImageModel
|
|
1
|
+
import { type BrandPageModel, type LogoImageModel } from '../models';
|
|
2
2
|
export interface MigrationData {
|
|
3
3
|
brandPageModel: BrandPageModel;
|
|
4
4
|
useOldLogoRenderSize: boolean;
|
|
@@ -8,7 +8,6 @@ export interface MigrationOptions {
|
|
|
8
8
|
isUserDraft: boolean;
|
|
9
9
|
isServerRender: boolean;
|
|
10
10
|
disableLogoSizeMigration?: boolean;
|
|
11
|
-
logoTheme?: LogoTheme;
|
|
12
11
|
}
|
|
13
12
|
export declare const GetLatestModelVersion: () => number;
|
|
14
13
|
export declare const migrateBrandPageModel: (brandPageModel: BrandPageModel, options: MigrationOptions) => Promise<MigrationData>;
|
|
@@ -23,8 +23,6 @@ import { migration17 } from './migration/migration-17';
|
|
|
23
23
|
import { migration18 } from './migration/migration-18';
|
|
24
24
|
import { migration19 } from './migration/migration-19';
|
|
25
25
|
import { migration20 } from './migration/migration-20';
|
|
26
|
-
import { migration21 } from './migration/migration-21';
|
|
27
|
-
import { migration22 } from './migration/migration-22';
|
|
28
26
|
const MIGRATION_TABLE = [
|
|
29
27
|
{
|
|
30
28
|
version: 1,
|
|
@@ -163,31 +161,6 @@ const MIGRATION_TABLE = [
|
|
|
163
161
|
// JSON directly, so there is no recurring post-load source of HTML to catch.
|
|
164
162
|
description: 'BP-5787: convert inline-HTML RTE content to Tiptap JSON on first load (client or server); AI builders emit JSON directly, so this runs once per site',
|
|
165
163
|
},
|
|
166
|
-
{
|
|
167
|
-
version: 21,
|
|
168
|
-
migrateFn: migration21,
|
|
169
|
-
// Version-gated (runs once, when modelVersion < 21): builds the palette + 4
|
|
170
|
-
// palette roles and referencifies every colour, then the model is stamped v21
|
|
171
|
-
// and never re-migrated. Idempotent if it ever re-runs (existing palette + only
|
|
172
|
-
// var() values). Ordered after migration19 so its seeded colours extract too.
|
|
173
|
-
//
|
|
174
|
-
// Ordered AFTER migration20 (BP-5787), which ships first: by the time this
|
|
175
|
-
// runs, RTE content is Tiptap JSON, never HTML. That is why the colour walk
|
|
176
|
-
// handles both shapes — see migration-21's RTE note.
|
|
177
|
-
description: 'BP-5886 Global Color V2: extract every colour into a central styles.colors palette (4 palette roles + palette-custom-<uuid>) and rewrite references to var(--id) — RTE, shapes, box-shadow, gradients included (lossless, once)',
|
|
178
|
-
},
|
|
179
|
-
{
|
|
180
|
-
version: 22,
|
|
181
|
-
migrateFn: migration22,
|
|
182
|
-
// Prerequisite for colour strategies touching text. Phase 1 makes `color`
|
|
183
|
-
// cascade (element wins over its global text style) instead of being dropped;
|
|
184
|
-
// this clears the element colours that are shadowed TODAY so none of them
|
|
185
|
-
// spring to life when the cascade ships. Lossless — those values render
|
|
186
|
-
// nowhere under current semantics. MUST ship in the same release as the
|
|
187
|
-
// resolver change (decision 0007: no flag on a persisted-model migration).
|
|
188
|
-
// Ordered after migration21 so it sees referencified var(--id) colours.
|
|
189
|
-
description: 'BP-5886 colour strategies Phase 1: drop element text `color` that is shadowed by the linked global text style (dead data today) so the new colour cascade does not resurface it',
|
|
190
|
-
},
|
|
191
164
|
];
|
|
192
165
|
export const GetLatestModelVersion = () => Math.max(...MIGRATION_TABLE.map((x) => x.version));
|
|
193
166
|
export const migrateBrandPageModel = async (brandPageModel, options) => {
|
|
@@ -1,19 +1,6 @@
|
|
|
1
|
-
import type { BrandPageModel, LogoTheme, ThemeColor, FabricLogoTheme, ButtonStyles, PageModel
|
|
1
|
+
import type { BrandPageModel, LogoTheme, ThemeColor, FabricLogoTheme, ButtonStyles, PageModel } from '../models';
|
|
2
2
|
import { NavigationDesktop, NavigationMobile } from '../models';
|
|
3
3
|
import { PageStyles, PageHeaderMobile, PageHeaderDesktop, PageFooterMobile, PageFooterDesktop } from '../models';
|
|
4
|
-
/**
|
|
5
|
-
* BP-5886 — global colour palette emission.
|
|
6
|
-
*
|
|
7
|
-
* A `ColorItem` already holds one resolved value, so emission is a straight
|
|
8
|
-
* `--id: value` map (no gradient/solid gating here — that's an authoring-time
|
|
9
|
-
* concern). These are the single source of truth for the `:root` block across
|
|
10
|
-
* the maker preview, the published `<Page>` (SSR), and template-grid cards.
|
|
11
|
-
*/
|
|
12
|
-
export declare const paletteToCssVarDeclarations: (colors: ColorItem[]) => string;
|
|
13
|
-
/** Full `<style>:root{…}</style>` block for `v-html` consumers (Page.vue, maker). */
|
|
14
|
-
export declare const buildPaletteRootCss: (colors: ColorItem[]) => string;
|
|
15
|
-
/** `{ '--id': 'value' }` for scoped inline `:style` consumers (template grid). */
|
|
16
|
-
export declare const buildPaletteVarStyle: (colors: ColorItem[]) => Record<string, string>;
|
|
17
4
|
/**
|
|
18
5
|
* Simple utility to convert any color format to hex for consistent comparison
|
|
19
6
|
*/
|
|
@@ -6,34 +6,6 @@ import { addTransparentAlphaChannelToHex, calculateLuminanceRatio, getNewColorBa
|
|
|
6
6
|
import { isRgbColor } from '@src/utils/helpers';
|
|
7
7
|
import chroma from 'chroma-js';
|
|
8
8
|
import { isRteHtmlString, RTE_ALLOWED_SECTION_TYPES, } from '@brand-page-maker/utils';
|
|
9
|
-
import { isColorVarReference } from './color-palette.util';
|
|
10
|
-
/**
|
|
11
|
-
* BP-5886 — global colour palette emission.
|
|
12
|
-
*
|
|
13
|
-
* A `ColorItem` already holds one resolved value, so emission is a straight
|
|
14
|
-
* `--id: value` map (no gradient/solid gating here — that's an authoring-time
|
|
15
|
-
* concern). These are the single source of truth for the `:root` block across
|
|
16
|
-
* the maker preview, the published `<Page>` (SSR), and template-grid cards.
|
|
17
|
-
*/
|
|
18
|
-
export const paletteToCssVarDeclarations = (colors) => (colors ?? [])
|
|
19
|
-
.filter((c) => c && c.id && c.value)
|
|
20
|
-
.map((c) => `--${c.id}: ${c.value};`)
|
|
21
|
-
.join('\n ');
|
|
22
|
-
/** Full `<style>:root{…}</style>` block for `v-html` consumers (Page.vue, maker). */
|
|
23
|
-
export const buildPaletteRootCss = (colors) => {
|
|
24
|
-
const declarations = paletteToCssVarDeclarations(colors);
|
|
25
|
-
return declarations
|
|
26
|
-
? `<style>
|
|
27
|
-
:root {
|
|
28
|
-
${declarations}
|
|
29
|
-
}
|
|
30
|
-
</style>`
|
|
31
|
-
: '';
|
|
32
|
-
};
|
|
33
|
-
/** `{ '--id': 'value' }` for scoped inline `:style` consumers (template grid). */
|
|
34
|
-
export const buildPaletteVarStyle = (colors) => Object.fromEntries((colors ?? [])
|
|
35
|
-
.filter((c) => c && c.id && c.value)
|
|
36
|
-
.map((c) => [`--${c.id}`, c.value]));
|
|
37
9
|
/**
|
|
38
10
|
* Simple utility to convert any color format to hex for consistent comparison
|
|
39
11
|
*/
|
|
@@ -87,13 +59,6 @@ export const getColorValueForCorrectCssProperty = (k, colorData) => {
|
|
|
87
59
|
: colorData.rgb;
|
|
88
60
|
};
|
|
89
61
|
export const colorMatchCssKeyValue = (cssKey, cssValue, logoTheme, applyColorWithMatchingLuminance) => {
|
|
90
|
-
// BP-5886: never bake a palette reference. Once a value is a `var(--id)` (from
|
|
91
|
-
// migration-20) it is resolved by the emitted :root block — the legacy logo
|
|
92
|
-
// theme bake must leave it untouched (the substring match below would otherwise
|
|
93
|
-
// rewrite `var(--logo-text-color)` back to rgb).
|
|
94
|
-
if (isColorVarReference(cssValue)) {
|
|
95
|
-
return { cssValue, isModified: false };
|
|
96
|
-
}
|
|
97
62
|
if (applyColorWithMatchingLuminance?.originalColor) {
|
|
98
63
|
let themeToApply;
|
|
99
64
|
if (cssValue === STYLE_THEME_KEYS.LogoTextMultiColor) {
|
|
@@ -349,14 +314,6 @@ export const applyLogoThemeToBrandPageStyles = (logoTheme, pageStyles) => {
|
|
|
349
314
|
let isModified = false;
|
|
350
315
|
const newStyle = new PageStyles();
|
|
351
316
|
for (const [key, value] of Object.entries(pageStyles)) {
|
|
352
|
-
// BP-5886: `colors` is the global palette (ColorItem[]), not an element
|
|
353
|
-
// style — preserve it verbatim. The logo-theme bake must never walk/rewrite
|
|
354
|
-
// the palette (the generic array branch below would collapse it to a single
|
|
355
|
-
// element and break every downstream `colors.map`).
|
|
356
|
-
if (key === 'colors') {
|
|
357
|
-
newStyle.colors = value;
|
|
358
|
-
continue;
|
|
359
|
-
}
|
|
360
317
|
if (Array.isArray(value)) {
|
|
361
318
|
for (let i = 0; i < value.length; i++) {
|
|
362
319
|
const output = applyLogoThemeToBrandPageStyleRecursive(logoTheme, `pageStyles`, value[i]);
|
|
@@ -8,7 +8,6 @@ import uniq from 'lodash/uniq';
|
|
|
8
8
|
import { generateGoogleFontUrl } from './font-loader.util';
|
|
9
9
|
import { isValidSvgUrl } from './image.util';
|
|
10
10
|
import { isLogoContent } from './model.util';
|
|
11
|
-
import { resolveTextColor } from './text-style.util';
|
|
12
11
|
import { getBoxShadowValue } from './button.util';
|
|
13
12
|
import { findNavItemByPageId, getRouteNameByPageIndex, getRouteParamsByPage, } from './route.util';
|
|
14
13
|
import { hasRTEContent, isTiptapDocument } from '../../brand-page-maker/utils';
|
|
@@ -38,8 +37,8 @@ const getTextStyleByContentTextStyle = (contentTextStyle, textStyleOptions) => {
|
|
|
38
37
|
if (contentTextStyle.textStyleType) {
|
|
39
38
|
const textStyle = textStyleOptions[contentTextStyle.textStyleType].style;
|
|
40
39
|
return Object.assign({}, textStyle, {
|
|
41
|
-
|
|
42
|
-
|
|
40
|
+
color: textStyle.color ||
|
|
41
|
+
contentTextStyle.color ||
|
|
43
42
|
FALLBACK_DEFAULT_LINK_COLOR,
|
|
44
43
|
fontWeight: textStyle.fontWeight || undefined,
|
|
45
44
|
fontStyle: textStyle.fontStyle || undefined,
|
|
@@ -58,7 +57,6 @@ const getCopyrightTextStyle = (contentTextStyle, textStyleOptions) => {
|
|
|
58
57
|
return applyDefaultViewModelTextStyle(Object.assign({}, textStyleOption, {
|
|
59
58
|
applyAutoScale: contentTextStyle.applyAutoScale,
|
|
60
59
|
textAlign: contentTextStyle.textAlign || DEFAULT_TEXT_ALIGN,
|
|
61
|
-
color: resolveTextColor(contentTextStyle, textStyleOption),
|
|
62
60
|
}));
|
|
63
61
|
}
|
|
64
62
|
}
|
|
@@ -73,7 +71,6 @@ const getTextStyleByContentTextStyleProperty = (content, contentPropKey, textSty
|
|
|
73
71
|
applyAutoScale: contentTextStyle.applyAutoScale,
|
|
74
72
|
textAlign: contentTextStyle.textAlign || DEFAULT_TEXT_ALIGN,
|
|
75
73
|
textStyleType: contentTextStyle.textStyleType,
|
|
76
|
-
color: resolveTextColor(contentTextStyle, textStyleOption.style),
|
|
77
74
|
}));
|
|
78
75
|
}
|
|
79
76
|
}
|
|
@@ -97,7 +94,6 @@ const applyViewModelTextItemTextStyles = (textItems, styles) => {
|
|
|
97
94
|
applyAutoScale: itemTextStyle.applyAutoScale,
|
|
98
95
|
textAlign: itemTextStyle.textAlign || DEFAULT_TEXT_ALIGN,
|
|
99
96
|
textStyleType: itemTextStyle.textStyleType || undefined,
|
|
100
|
-
color: resolveTextColor(itemTextStyle, textStyleOption?.style),
|
|
101
97
|
};
|
|
102
98
|
}
|
|
103
99
|
return {
|
|
@@ -557,15 +553,22 @@ const mapToTestimonialSectionViewModel = (content, styles) => {
|
|
|
557
553
|
...content,
|
|
558
554
|
role: content.type,
|
|
559
555
|
type: 'testimonial-section',
|
|
560
|
-
|
|
561
|
-
|
|
562
|
-
|
|
563
|
-
|
|
564
|
-
|
|
565
|
-
|
|
566
|
-
|
|
567
|
-
|
|
568
|
-
|
|
556
|
+
titleStyle: {
|
|
557
|
+
color: styles.textStyles.style.color,
|
|
558
|
+
...content.titleStyle,
|
|
559
|
+
},
|
|
560
|
+
nameStyle: {
|
|
561
|
+
color: styles.textStyles.style.color,
|
|
562
|
+
...content.nameStyle,
|
|
563
|
+
},
|
|
564
|
+
positionStyle: {
|
|
565
|
+
color: styles.textStyles.style.color,
|
|
566
|
+
...content.positionStyle,
|
|
567
|
+
},
|
|
568
|
+
testimonialStyle: {
|
|
569
|
+
color: styles.textStyles.style.color,
|
|
570
|
+
...content.testimonialStyle,
|
|
571
|
+
},
|
|
569
572
|
isFullWidth: true,
|
|
570
573
|
}, styles);
|
|
571
574
|
};
|
|
@@ -574,12 +577,10 @@ const mapToSocialLinksViewModel = (content, styles, brandPageType) => {
|
|
|
574
577
|
...content,
|
|
575
578
|
role: content.type,
|
|
576
579
|
type: 'social-links',
|
|
577
|
-
|
|
578
|
-
|
|
579
|
-
|
|
580
|
-
|
|
581
|
-
// `fill`, not a `color`, so `resolveTextColor` does not apply.
|
|
582
|
-
titleStyle: { ...content.titleStyle },
|
|
580
|
+
titleStyle: {
|
|
581
|
+
color: styles.textStyles.style.color,
|
|
582
|
+
...content.titleStyle,
|
|
583
|
+
},
|
|
583
584
|
iconFillStyles: {
|
|
584
585
|
fill: styles.textStyles?.style.color,
|
|
585
586
|
...content.iconFillStyles,
|
|
@@ -648,7 +649,6 @@ export const mapToPageStyleViewModel = (pageStyles, options) => {
|
|
|
648
649
|
logoStyles: pageStyles.logoStyles,
|
|
649
650
|
textStyles: pageStyles.textStyles,
|
|
650
651
|
galleryStyles: pageStyles.galleryStyles,
|
|
651
|
-
colors: pageStyles.colors ?? [],
|
|
652
652
|
};
|
|
653
653
|
};
|
|
654
654
|
export const mapToPageHeaderViewModel = (pageHeader, pageStyles, pages, useOldLogoRenderSize = false) => {
|