@designcrowd/library.brand-page 5.18.3-actionable-buttons-2 → 5.18.3-ast-subnav-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-HPO35Atc.js → CreatedOnBrandCrowd-de-de-B84M_Lpj.js} +1 -1
- package/lib/src/{CreatedOnBrandCrowd-en-us-Cl4aaalq.js → CreatedOnBrandCrowd-en-us-2tw4Ggs-.js} +1 -1
- package/lib/src/{CreatedOnBrandCrowd-es-es-B_2laZxX.js → CreatedOnBrandCrowd-es-es-BPzo-3sX.js} +1 -1
- package/lib/src/{CreatedOnBrandCrowd-fr-fr-BTauzkB5.js → CreatedOnBrandCrowd-fr-ca-B1e5tc2p.js} +1 -1
- package/lib/src/{CreatedOnBrandCrowd-fr-ca-BTauzkB5.js → CreatedOnBrandCrowd-fr-fr-B1e5tc2p.js} +1 -1
- package/lib/src/{CreatedOnBrandCrowd-pt-pt-B0V4UZv3.js → CreatedOnBrandCrowd-pt-br-B4qlZq68.js} +1 -1
- package/lib/src/{CreatedOnBrandCrowd-pt-br-B0V4UZv3.js → CreatedOnBrandCrowd-pt-pt-B4qlZq68.js} +1 -1
- package/lib/src/{CreatedOnDcom-de-de-DvX7MlWL.js → CreatedOnDcom-de-de-EXRLWJ0w.js} +1 -1
- package/lib/src/{CreatedOnDcom-en-us-BnXBQ4jL.js → CreatedOnDcom-en-us-CEyz1cLr.js} +1 -1
- package/lib/src/{CreatedOnDcom-es-es-lKzARICU.js → CreatedOnDcom-es-es-BABu1jVr.js} +1 -1
- package/lib/src/{CreatedOnDcom-fr-ca-BXBuLMp3.js → CreatedOnDcom-fr-ca-Duj4QQWa.js} +1 -1
- package/lib/src/{CreatedOnDcom-fr-fr-wUZo-ppX.js → CreatedOnDcom-fr-fr-bI4SLcPm.js} +1 -1
- package/lib/src/{CreatedOnDcom-pt-br-Dcpf3PTV.js → CreatedOnDcom-pt-br-Cdi0wukS.js} +1 -1
- package/lib/src/{CreatedOnDcom-pt-pt-BUN3ynDi.js → CreatedOnDcom-pt-pt-CyOP-8m-.js} +1 -1
- package/lib/src/brand-page/models/navigation-styles.model.d.ts +7 -0
- package/lib/src/brand-page/models/navigation-styles.model.js +25 -2
- package/lib/src/brand-page/utils/migration/migration-16.d.ts +2 -0
- package/lib/src/brand-page/utils/migration/migration-16.js +58 -0
- package/lib/src/brand-page/utils/migration.util.js +7 -0
- package/lib/src/brand-page-maker/composables/ai-chat/types.d.ts +0 -3
- package/lib/src/brand-page-maker/composables/ai-chat/useAiWebsiteBuilderChat.js +172 -201
- package/lib/src/brand-page-maker/composables/useEventTracker.d.ts +0 -1
- package/lib/src/brand-page-maker/composables/useEventTracker.js +0 -1
- package/lib/src/css/library.brand-page-brandCrowd.min.css +43 -53
- package/lib/src/css/library.brand-page-brandPage.min.css +43 -53
- package/lib/src/css/library.brand-page-designCom.min.css +43 -53
- package/lib/src/css/library.brand-page-preview.min.css +43 -53
- package/lib/src/index.mjs +62 -60
- package/lib/src/{lib-BP3rUcsW.js → lib-BlrNje0X.js} +16384 -16399
- package/lib/src/shared/navigation-style-settings/components/navigation-style-settings/NavigationStyleSettings.mixin.js +10 -8
- package/lib/src/shared/navigation-style-settings/store/index.js +1 -12
- package/package.json +1 -1
- package/src/brand-page/components/navigation/navigation-side-menu/NavigationSideMenu.vue +4 -1
- package/src/brand-page/models/navigation-styles.model.ts +39 -1
- package/src/brand-page/utils/__snapshots__/migration.util.test.ts.snap +3 -3
- package/src/brand-page/utils/migration/migration-16.test.ts +239 -0
- package/src/brand-page/utils/migration/migration-16.ts +90 -0
- package/src/brand-page/utils/migration.util.ts +8 -0
- package/src/brand-page-maker/components/ai-text-edit/AiActionButtons.vue +7 -34
- package/src/brand-page-maker/components/ai-text-edit/AiChatbox.vue +0 -3
- package/src/brand-page-maker/components/ai-text-edit/TextBubble.vue +1 -7
- package/src/brand-page-maker/components/ai-website-builder/AiWebsiteBuilder.vue +1 -21
- package/src/brand-page-maker/components/color-palette/BpColorPalette.vue +9 -7
- package/src/brand-page-maker/composables/ai-chat/types.ts +0 -6
- package/src/brand-page-maker/composables/ai-chat/useAiWebsiteBuilderChat.ts +256 -305
- package/src/brand-page-maker/composables/useEventTracker.ts +0 -1
- package/src/shared/content-settings/components/color-field/ColorField.vue +10 -5
- package/src/shared/navigation-style-settings/components/navigation-style-settings/NavigationStyleSettings.mixin.ts +17 -11
- package/src/shared/navigation-style-settings/components/navigation-style-settings/NavigationStyleSettings.vue +4 -1
- package/src/shared/navigation-style-settings/store/index.ts +1 -21
- package/lib/src/brand-page-maker/composables/ai-chat/ui-actions.d.ts +0 -29
- package/lib/src/brand-page-maker/composables/ai-chat/ui-actions.js +0 -32
- package/src/brand-page-maker/composables/ai-chat/ui-actions.test.ts +0 -80
- package/src/brand-page-maker/composables/ai-chat/ui-actions.ts +0 -58
|
@@ -8,6 +8,13 @@ export declare class NavigationMenuStyles {
|
|
|
8
8
|
subNavBackgroundColor?: string;
|
|
9
9
|
constructor(options: Partial<NavigationMenuStyles>, defaultOptions: Partial<NavigationMenuStyles>);
|
|
10
10
|
}
|
|
11
|
+
export declare const getDefaultSubNavBackgroundColor: (defaultTextColor: string | undefined) => string | undefined;
|
|
12
|
+
/**
|
|
13
|
+
* The hamburger sub nav background colour is auto color-matched only when the
|
|
14
|
+
* user has not deliberately set it - i.e. it has no value or is transparent.
|
|
15
|
+
* Any explicit colour (a hex) or an already color-matched key is preserved.
|
|
16
|
+
*/
|
|
17
|
+
export declare const isUnsetOrTransparentColor: (color: string | undefined | null) => boolean;
|
|
11
18
|
type NavigationStylesOptionType = Partial<Omit<NavigationDesktop | NavigationMobile, 'hamburgerMenuStyle'>> & {
|
|
12
19
|
hamburgerMenuStyle?: Partial<NavigationMenuStyles>;
|
|
13
20
|
};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { DEFAULT_FONT_FAMILY_KEY, DEFAULT_FONT_STYLE, DEFAULT_TEXT_ALIGN, DEFAULT_TEXT_DECORATION, FONT_FAMILY_CONFIGS, FONT_SIZE_BODY, FONT_WEIGHT_NORMAL, defaultHamburgerNavigation, NAVIGATION_DISPLAY, } from '../constants';
|
|
1
|
+
import { DEFAULT_FONT_FAMILY_KEY, DEFAULT_FONT_STYLE, DEFAULT_TEXT_ALIGN, DEFAULT_TEXT_DECORATION, FONT_FAMILY_CONFIGS, FONT_SIZE_BODY, FONT_WEIGHT_NORMAL, STYLE_THEME_KEYS, defaultHamburgerNavigation, NAVIGATION_DISPLAY, } from '../constants';
|
|
2
2
|
import { VIEWPORTS } from './index';
|
|
3
3
|
import { TEXT_STYLE_TYPES } from './index';
|
|
4
4
|
import cloneDeep from 'lodash.clonedeep';
|
|
@@ -15,6 +15,29 @@ export class NavigationMenuStyles {
|
|
|
15
15
|
options.subNavBackgroundColor ?? defaultOptions.subNavBackgroundColor;
|
|
16
16
|
}
|
|
17
17
|
}
|
|
18
|
+
export const getDefaultSubNavBackgroundColor = (defaultTextColor) => {
|
|
19
|
+
if (defaultTextColor === STYLE_THEME_KEYS.LogoTextColor ||
|
|
20
|
+
defaultTextColor === STYLE_THEME_KEYS.LogoTextMultiColor) {
|
|
21
|
+
return STYLE_THEME_KEYS.LogoBackgroundColor;
|
|
22
|
+
}
|
|
23
|
+
if (defaultTextColor === STYLE_THEME_KEYS.LogoBackgroundColor ||
|
|
24
|
+
defaultTextColor === STYLE_THEME_KEYS.LogoBackgroundMultiColor) {
|
|
25
|
+
return STYLE_THEME_KEYS.LogoTextColor;
|
|
26
|
+
}
|
|
27
|
+
return undefined;
|
|
28
|
+
};
|
|
29
|
+
/**
|
|
30
|
+
* The hamburger sub nav background colour is auto color-matched only when the
|
|
31
|
+
* user has not deliberately set it - i.e. it has no value or is transparent.
|
|
32
|
+
* Any explicit colour (a hex) or an already color-matched key is preserved.
|
|
33
|
+
*/
|
|
34
|
+
export const isUnsetOrTransparentColor = (color) => {
|
|
35
|
+
if (color == null) {
|
|
36
|
+
return true;
|
|
37
|
+
}
|
|
38
|
+
const normalised = color.trim().toLowerCase();
|
|
39
|
+
return normalised === '' || normalised === 'transparent';
|
|
40
|
+
};
|
|
18
41
|
class NavigationStyles {
|
|
19
42
|
displayType;
|
|
20
43
|
renderAfterLogo;
|
|
@@ -79,7 +102,7 @@ class NavigationStyles {
|
|
|
79
102
|
color: theme?.secondaryColor,
|
|
80
103
|
backgroundColor: theme?.primaryColor,
|
|
81
104
|
},
|
|
82
|
-
|
|
105
|
+
// No sub nav default: a hex here defeats migration-16's colour match.
|
|
83
106
|
});
|
|
84
107
|
}
|
|
85
108
|
}
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
import { STYLE_THEME_KEYS, NAVIGATION_DISPLAY } from '../../constants';
|
|
2
|
+
import { getDefaultSubNavBackgroundColor, isUnsetOrTransparentColor, } from '../../models';
|
|
3
|
+
/**
|
|
4
|
+
* Migration 16: Default the sub nav background color to "color match on" for
|
|
5
|
+
* existing sites using the TAB_2 ("nav 2") or any hamburger display style.
|
|
6
|
+
*
|
|
7
|
+
* Before the sub nav background colour feature shipped, these styles defaulted
|
|
8
|
+
* to an explicit colour (e.g. the theme secondary colour for hamburger). This
|
|
9
|
+
* migration brings existing sites in line with the new default by setting the
|
|
10
|
+
* sub nav background colour to a logo theme key (color matched), unless the
|
|
11
|
+
* value is already color matched - in which case the user's choice is kept.
|
|
12
|
+
*/
|
|
13
|
+
const isColorMatched = (color) => !!color && Object.values(STYLE_THEME_KEYS).includes(color);
|
|
14
|
+
// Matches NavigationStyleSettings.getMenuStyles: hamburger styles live on the
|
|
15
|
+
// hamburgerMenuStyle (looser `.includes` to catch any hamburger variant),
|
|
16
|
+
// TAB_2 uses the top-level styles.
|
|
17
|
+
const isHamburger = (displayType) => displayType.includes('hamburger');
|
|
18
|
+
const isColorMatchTargetDisplayType = (displayType) => isHamburger(displayType) || displayType === NAVIGATION_DISPLAY.TAB_2;
|
|
19
|
+
const applyDefaultSubNavColorMatch = (navigation) => {
|
|
20
|
+
if (!navigation?.displayType) {
|
|
21
|
+
return;
|
|
22
|
+
}
|
|
23
|
+
if (!isColorMatchTargetDisplayType(navigation.displayType)) {
|
|
24
|
+
return;
|
|
25
|
+
}
|
|
26
|
+
let menuStyles;
|
|
27
|
+
if (isHamburger(navigation.displayType)) {
|
|
28
|
+
navigation.hamburgerMenuStyle =
|
|
29
|
+
navigation.hamburgerMenuStyle ?? {};
|
|
30
|
+
menuStyles = navigation.hamburgerMenuStyle;
|
|
31
|
+
// Hamburger: only auto-match when the sub nav has no value or is transparent.
|
|
32
|
+
// Preserve ANY explicit colour (a deliberate hex or an already color matched
|
|
33
|
+
// key) so we never overwrite a choice an admin/template made.
|
|
34
|
+
if (!isUnsetOrTransparentColor(menuStyles.subNavBackgroundColor)) {
|
|
35
|
+
return;
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
else {
|
|
39
|
+
menuStyles = navigation;
|
|
40
|
+
// TAB_2 (unchanged): respect an existing color matched value.
|
|
41
|
+
if (isColorMatched(menuStyles.subNavBackgroundColor)) {
|
|
42
|
+
return;
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
// Only color match the sub nav when the default text color is itself color
|
|
46
|
+
// matched - in which case it takes the opposite logo color (e.g. logo text
|
|
47
|
+
// color -> logo background color). Otherwise leave the sub nav as-is.
|
|
48
|
+
const colorMatchedSubNav = getDefaultSubNavBackgroundColor(menuStyles.defaultButtonStyle?.color);
|
|
49
|
+
if (colorMatchedSubNav) {
|
|
50
|
+
menuStyles.subNavBackgroundColor = colorMatchedSubNav;
|
|
51
|
+
}
|
|
52
|
+
};
|
|
53
|
+
export const migration16 = async (migrationResult) => {
|
|
54
|
+
const { brandPageModel } = migrationResult;
|
|
55
|
+
applyDefaultSubNavColorMatch(brandPageModel.pageHeaderDesktop?.navigation);
|
|
56
|
+
applyDefaultSubNavColorMatch(brandPageModel.pageHeaderMobile?.navigation);
|
|
57
|
+
return migrationResult;
|
|
58
|
+
};
|
|
@@ -18,6 +18,7 @@ import { migration12_1 } from './migration/migration-12_1';
|
|
|
18
18
|
import { migration13 } from './migration/migration-13';
|
|
19
19
|
import { migration14 } from './migration/migration-14';
|
|
20
20
|
import { migration15 } from './migration/migration-15';
|
|
21
|
+
import { migration16 } from './migration/migration-16';
|
|
21
22
|
const MIGRATION_TABLE = [
|
|
22
23
|
{
|
|
23
24
|
version: 1,
|
|
@@ -115,6 +116,12 @@ const MIGRATION_TABLE = [
|
|
|
115
116
|
migrateFn: migration15,
|
|
116
117
|
description: 'Adding default mediaOverlayStyle to background styles',
|
|
117
118
|
},
|
|
119
|
+
{
|
|
120
|
+
version: 16,
|
|
121
|
+
migrateFn: migration16,
|
|
122
|
+
runAlways: true,
|
|
123
|
+
description: 'Default sub nav background color to color match on for TAB_2 and hamburger navs depending on font color',
|
|
124
|
+
},
|
|
118
125
|
];
|
|
119
126
|
export const GetLatestModelVersion = () => Math.max(...MIGRATION_TABLE.map((x) => x.version));
|
|
120
127
|
export const migrateBrandPageModel = async (brandPageModel, options) => {
|
|
@@ -1,7 +1,5 @@
|
|
|
1
1
|
import type { ComputedRef, Ref } from 'vue';
|
|
2
2
|
import { type PlanItem } from '../../../clients/websocket-gateway-client';
|
|
3
|
-
import type { AgentAction } from './ui-actions';
|
|
4
|
-
export type { AgentAction };
|
|
5
3
|
export interface BaseThreadMessage {
|
|
6
4
|
id: string;
|
|
7
5
|
role: 'user' | 'agent';
|
|
@@ -16,7 +14,6 @@ export interface TextThreadMessage extends BaseThreadMessage {
|
|
|
16
14
|
initialMessage?: string;
|
|
17
15
|
planItems?: PlanItem[];
|
|
18
16
|
completedItemIds?: string[];
|
|
19
|
-
actions?: AgentAction[];
|
|
20
17
|
}
|
|
21
18
|
export interface ImageThreadMessage extends BaseThreadMessage {
|
|
22
19
|
type: 'image';
|