@designcrowd/library.brand-page 5.8.7 → 5.8.8
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/brand-page/components/media/Shape.mixin.js +3 -0
- package/lib/src/brand-page/constants/misc.constants.d.ts +0 -22
- package/lib/src/brand-page/constants/misc.constants.js +0 -22
- package/lib/src/brand-page/utils/color.util.d.ts +2 -0
- package/lib/src/brand-page/utils/color.util.js +13 -0
- package/lib/src/brand-page/utils/style.util.d.ts +6 -2
- package/lib/src/brand-page/utils/style.util.js +43 -27
- package/lib/src/brand-page-maker/components/admin-background-settings/AdminBackgroundSettings.mixin.d.ts +0 -22
- package/lib/src/index.mjs +14680 -13727
- package/lib/src/shared/content-settings/components/color-field/ColorField.mixin.d.ts +8 -26
- package/lib/src/shared/content-settings/components/color-field/ColorField.mixin.js +3 -2
- package/lib/src/shared/style-settings/components/StyleSettings.mixin.d.ts +0 -22
- package/package.json +2 -1
- package/src/brand-page/components/media/Shape.mixin.ts +4 -0
- package/src/brand-page/constants/misc.constants.ts +0 -22
- package/src/brand-page/utils/color.util.test.ts +47 -0
- package/src/brand-page/utils/color.util.ts +18 -0
- package/src/brand-page/utils/style.util.test.ts +1 -0
- package/src/brand-page/utils/style.util.ts +94 -27
- package/src/shared/content-settings/components/color-field/ColorField.mixin.ts +3 -2
- package/src/shared/content-settings/components/color-replacements-field/ColorReplacementsField.vue +126 -37
- package/lib/src/shared/content-settings/components/color-replacements-field/ColorReplacementsField.mixin.d.ts +0 -112
- package/lib/src/shared/content-settings/components/color-replacements-field/ColorReplacementsField.mixin.js +0 -104
- package/src/shared/content-settings/components/color-replacements-field/ColorReplacementsField.mixin.ts +0 -118
|
@@ -1,112 +0,0 @@
|
|
|
1
|
-
/// <reference types="types/lodash-shims" />
|
|
2
|
-
import type { DebounceHandle } from 'lodash.debounce';
|
|
3
|
-
import type { PropType } from 'vue';
|
|
4
|
-
import type { ColorReplacement, LogoTheme } from '../../../../brand-page';
|
|
5
|
-
import type { UpdateItemValuePayload } from '../../../content-settings/models';
|
|
6
|
-
declare const _default: import("vue").DefineComponent<import("vue").ExtractPropTypes<{
|
|
7
|
-
id: {
|
|
8
|
-
type: StringConstructor;
|
|
9
|
-
required: true;
|
|
10
|
-
};
|
|
11
|
-
name: {
|
|
12
|
-
type: StringConstructor;
|
|
13
|
-
required: true;
|
|
14
|
-
};
|
|
15
|
-
value: {
|
|
16
|
-
type: PropType<ColorReplacement[]>;
|
|
17
|
-
required: true;
|
|
18
|
-
};
|
|
19
|
-
isAdmin: {
|
|
20
|
-
type: BooleanConstructor;
|
|
21
|
-
required: true;
|
|
22
|
-
};
|
|
23
|
-
label: {
|
|
24
|
-
type: StringConstructor;
|
|
25
|
-
required: false;
|
|
26
|
-
default: undefined;
|
|
27
|
-
};
|
|
28
|
-
toggleUniqueId: {
|
|
29
|
-
type: StringConstructor;
|
|
30
|
-
required: false;
|
|
31
|
-
default: string;
|
|
32
|
-
};
|
|
33
|
-
logoTheme: {
|
|
34
|
-
type: PropType<LogoTheme>;
|
|
35
|
-
required: true;
|
|
36
|
-
};
|
|
37
|
-
}>, {}, {
|
|
38
|
-
colorReplacements: ColorReplacement[];
|
|
39
|
-
changeColorDebounce: DebounceHandle;
|
|
40
|
-
styleThemeKeys: Readonly<{
|
|
41
|
-
LogoTextColor: "logo-text-color";
|
|
42
|
-
LogoBackgroundColor: "logo-background-color";
|
|
43
|
-
LogoTextColor50: "logo-text-color-50";
|
|
44
|
-
LogoTextColor100: "logo-text-color-100";
|
|
45
|
-
LogoTextColor200: "logo-text-color-200";
|
|
46
|
-
LogoTextColor300: "logo-text-color-300";
|
|
47
|
-
LogoTextColor400: "logo-text-color-400";
|
|
48
|
-
LogoTextColor500: "logo-text-color-500";
|
|
49
|
-
LogoTextColor600: "logo-text-color-600";
|
|
50
|
-
LogoTextColor700: "logo-text-color-700";
|
|
51
|
-
LogoTextColor800: "logo-text-color-800";
|
|
52
|
-
LogoTextColor900: "logo-text-color-900";
|
|
53
|
-
LogoTextColor950: "logo-text-color-950";
|
|
54
|
-
LogoBackgroundColor50: "logo-background-color-50";
|
|
55
|
-
LogoBackgroundColor100: "logo-background-color-100";
|
|
56
|
-
LogoBackgroundColor200: "logo-background-color-200";
|
|
57
|
-
LogoBackgroundColor300: "logo-background-color-300";
|
|
58
|
-
LogoBackgroundColor400: "logo-background-color-400";
|
|
59
|
-
LogoBackgroundColor500: "logo-background-color-500";
|
|
60
|
-
LogoBackgroundColor600: "logo-background-color-600";
|
|
61
|
-
LogoBackgroundColor700: "logo-background-color-700";
|
|
62
|
-
LogoBackgroundColor800: "logo-background-color-800";
|
|
63
|
-
LogoBackgroundColor900: "logo-background-color-900";
|
|
64
|
-
LogoBackgroundColor950: "logo-background-color-950";
|
|
65
|
-
}>;
|
|
66
|
-
}, {
|
|
67
|
-
colorFieldMode(): string;
|
|
68
|
-
isOptionColorMatched(): boolean;
|
|
69
|
-
toggleIdSuffix(): string;
|
|
70
|
-
}, {
|
|
71
|
-
onColorPickerInput(color: UpdateItemValuePayload<string>, index: number): void;
|
|
72
|
-
onColorPickerInputDropdown(color: string, index: number): void;
|
|
73
|
-
changeColor(): void;
|
|
74
|
-
onColorMatchToggled(value: boolean): void;
|
|
75
|
-
}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, "update:modelValue"[], "update:modelValue", import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
|
|
76
|
-
id: {
|
|
77
|
-
type: StringConstructor;
|
|
78
|
-
required: true;
|
|
79
|
-
};
|
|
80
|
-
name: {
|
|
81
|
-
type: StringConstructor;
|
|
82
|
-
required: true;
|
|
83
|
-
};
|
|
84
|
-
value: {
|
|
85
|
-
type: PropType<ColorReplacement[]>;
|
|
86
|
-
required: true;
|
|
87
|
-
};
|
|
88
|
-
isAdmin: {
|
|
89
|
-
type: BooleanConstructor;
|
|
90
|
-
required: true;
|
|
91
|
-
};
|
|
92
|
-
label: {
|
|
93
|
-
type: StringConstructor;
|
|
94
|
-
required: false;
|
|
95
|
-
default: undefined;
|
|
96
|
-
};
|
|
97
|
-
toggleUniqueId: {
|
|
98
|
-
type: StringConstructor;
|
|
99
|
-
required: false;
|
|
100
|
-
default: string;
|
|
101
|
-
};
|
|
102
|
-
logoTheme: {
|
|
103
|
-
type: PropType<LogoTheme>;
|
|
104
|
-
required: true;
|
|
105
|
-
};
|
|
106
|
-
}>> & Readonly<{
|
|
107
|
-
"onUpdate:modelValue"?: ((...args: any[]) => any) | undefined;
|
|
108
|
-
}>, {
|
|
109
|
-
label: string;
|
|
110
|
-
toggleUniqueId: string;
|
|
111
|
-
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
|
|
112
|
-
export default _default;
|
|
@@ -1,104 +0,0 @@
|
|
|
1
|
-
import { defineComponent } from 'vue';
|
|
2
|
-
import debounce from 'lodash.debounce';
|
|
3
|
-
import cloneDeep from 'lodash.clonedeep';
|
|
4
|
-
import { isColorMatched } from '../../../../brand-page-maker/utils';
|
|
5
|
-
import { STYLE_THEME_KEYS } from '../../../../brand-page/constants';
|
|
6
|
-
const DEBOUNCE_WAIT_IN_MS = 10;
|
|
7
|
-
export default defineComponent({
|
|
8
|
-
props: {
|
|
9
|
-
id: {
|
|
10
|
-
type: String,
|
|
11
|
-
required: true,
|
|
12
|
-
},
|
|
13
|
-
name: {
|
|
14
|
-
type: String,
|
|
15
|
-
required: true,
|
|
16
|
-
},
|
|
17
|
-
value: {
|
|
18
|
-
type: Array,
|
|
19
|
-
required: true,
|
|
20
|
-
},
|
|
21
|
-
isAdmin: {
|
|
22
|
-
type: Boolean,
|
|
23
|
-
required: true,
|
|
24
|
-
},
|
|
25
|
-
label: {
|
|
26
|
-
type: String,
|
|
27
|
-
required: false,
|
|
28
|
-
default: undefined,
|
|
29
|
-
},
|
|
30
|
-
toggleUniqueId: {
|
|
31
|
-
type: String,
|
|
32
|
-
required: false,
|
|
33
|
-
default: '',
|
|
34
|
-
},
|
|
35
|
-
logoTheme: {
|
|
36
|
-
type: Object,
|
|
37
|
-
required: true,
|
|
38
|
-
},
|
|
39
|
-
},
|
|
40
|
-
emits: ['update:modelValue'],
|
|
41
|
-
data() {
|
|
42
|
-
return {
|
|
43
|
-
colorReplacements: [],
|
|
44
|
-
changeColorDebounce: null,
|
|
45
|
-
styleThemeKeys: STYLE_THEME_KEYS,
|
|
46
|
-
};
|
|
47
|
-
},
|
|
48
|
-
computed: {
|
|
49
|
-
colorFieldMode() {
|
|
50
|
-
return this.value.length === 1 ? 'color-and-text' : 'color-only';
|
|
51
|
-
},
|
|
52
|
-
isOptionColorMatched() {
|
|
53
|
-
return this.colorReplacements?.every((x) => isColorMatched(x.replacementColor));
|
|
54
|
-
},
|
|
55
|
-
toggleIdSuffix() {
|
|
56
|
-
return this.toggleUniqueId ? `-${this.toggleUniqueId}` : '';
|
|
57
|
-
},
|
|
58
|
-
},
|
|
59
|
-
watch: {
|
|
60
|
-
value(newVal) {
|
|
61
|
-
this.colorReplacements = cloneDeep(newVal);
|
|
62
|
-
},
|
|
63
|
-
},
|
|
64
|
-
created() {
|
|
65
|
-
this.changeColorDebounce = debounce(this.changeColor, DEBOUNCE_WAIT_IN_MS);
|
|
66
|
-
this.colorReplacements = cloneDeep(this.value);
|
|
67
|
-
},
|
|
68
|
-
methods: {
|
|
69
|
-
onColorPickerInput(color, index) {
|
|
70
|
-
if (color) {
|
|
71
|
-
if (typeof color.value === 'string') {
|
|
72
|
-
this.colorReplacements[index].replacementColor = color.value;
|
|
73
|
-
}
|
|
74
|
-
}
|
|
75
|
-
this.changeColorDebounce();
|
|
76
|
-
},
|
|
77
|
-
onColorPickerInputDropdown(color, index) {
|
|
78
|
-
if (typeof color === 'string') {
|
|
79
|
-
this.colorReplacements[index].replacementColor = color;
|
|
80
|
-
}
|
|
81
|
-
this.changeColorDebounce();
|
|
82
|
-
},
|
|
83
|
-
changeColor() {
|
|
84
|
-
this.$emit('update:modelValue', {
|
|
85
|
-
id: this.id,
|
|
86
|
-
name: this.name,
|
|
87
|
-
value: this.colorReplacements,
|
|
88
|
-
});
|
|
89
|
-
},
|
|
90
|
-
onColorMatchToggled(value) {
|
|
91
|
-
if (value) {
|
|
92
|
-
this.colorReplacements.forEach((x) => {
|
|
93
|
-
x.replacementColor = STYLE_THEME_KEYS.LogoTextColor;
|
|
94
|
-
});
|
|
95
|
-
}
|
|
96
|
-
else {
|
|
97
|
-
this.colorReplacements.forEach((x) => {
|
|
98
|
-
x.replacementColor = x.originalColor;
|
|
99
|
-
});
|
|
100
|
-
}
|
|
101
|
-
this.changeColorDebounce();
|
|
102
|
-
},
|
|
103
|
-
},
|
|
104
|
-
});
|
|
@@ -1,118 +0,0 @@
|
|
|
1
|
-
import { defineComponent } from 'vue';
|
|
2
|
-
import type { DebounceHandle } from 'lodash.debounce';
|
|
3
|
-
import debounce from 'lodash.debounce';
|
|
4
|
-
import type { PropType } from 'vue';
|
|
5
|
-
import type { ColorReplacement, LogoTheme } from '../../../../brand-page';
|
|
6
|
-
import cloneDeep from 'lodash.clonedeep';
|
|
7
|
-
import { isColorMatched } from '../../../../brand-page-maker/utils';
|
|
8
|
-
import { STYLE_THEME_KEYS } from '../../../../brand-page/constants';
|
|
9
|
-
import type { UpdateItemValuePayload } from '../../../content-settings/models';
|
|
10
|
-
|
|
11
|
-
const DEBOUNCE_WAIT_IN_MS = 10;
|
|
12
|
-
|
|
13
|
-
export default defineComponent({
|
|
14
|
-
props: {
|
|
15
|
-
id: {
|
|
16
|
-
type: String,
|
|
17
|
-
required: true,
|
|
18
|
-
},
|
|
19
|
-
name: {
|
|
20
|
-
type: String,
|
|
21
|
-
required: true,
|
|
22
|
-
},
|
|
23
|
-
value: {
|
|
24
|
-
type: Array as PropType<ColorReplacement[]>,
|
|
25
|
-
required: true,
|
|
26
|
-
},
|
|
27
|
-
isAdmin: {
|
|
28
|
-
type: Boolean,
|
|
29
|
-
required: true,
|
|
30
|
-
},
|
|
31
|
-
label: {
|
|
32
|
-
type: String,
|
|
33
|
-
required: false,
|
|
34
|
-
default: undefined,
|
|
35
|
-
},
|
|
36
|
-
toggleUniqueId: {
|
|
37
|
-
type: String,
|
|
38
|
-
required: false,
|
|
39
|
-
default: '',
|
|
40
|
-
},
|
|
41
|
-
logoTheme: {
|
|
42
|
-
type: Object as PropType<LogoTheme>,
|
|
43
|
-
required: true,
|
|
44
|
-
},
|
|
45
|
-
},
|
|
46
|
-
emits: ['update:modelValue'],
|
|
47
|
-
data() {
|
|
48
|
-
return {
|
|
49
|
-
colorReplacements: [] as ColorReplacement[],
|
|
50
|
-
changeColorDebounce: null as any as DebounceHandle,
|
|
51
|
-
styleThemeKeys: STYLE_THEME_KEYS,
|
|
52
|
-
};
|
|
53
|
-
},
|
|
54
|
-
computed: {
|
|
55
|
-
colorFieldMode(): string {
|
|
56
|
-
return this.value.length === 1 ? 'color-and-text' : 'color-only';
|
|
57
|
-
},
|
|
58
|
-
|
|
59
|
-
isOptionColorMatched(): boolean {
|
|
60
|
-
return this.colorReplacements?.every((x) =>
|
|
61
|
-
isColorMatched(x.replacementColor),
|
|
62
|
-
);
|
|
63
|
-
},
|
|
64
|
-
|
|
65
|
-
toggleIdSuffix(): string {
|
|
66
|
-
return this.toggleUniqueId ? `-${this.toggleUniqueId}` : '';
|
|
67
|
-
},
|
|
68
|
-
},
|
|
69
|
-
watch: {
|
|
70
|
-
value(newVal: ColorReplacement[]) {
|
|
71
|
-
this.colorReplacements = cloneDeep(newVal);
|
|
72
|
-
},
|
|
73
|
-
},
|
|
74
|
-
created() {
|
|
75
|
-
this.changeColorDebounce = debounce(this.changeColor, DEBOUNCE_WAIT_IN_MS);
|
|
76
|
-
|
|
77
|
-
this.colorReplacements = cloneDeep(this.value);
|
|
78
|
-
},
|
|
79
|
-
methods: {
|
|
80
|
-
onColorPickerInput(color: UpdateItemValuePayload<string>, index: number) {
|
|
81
|
-
if (color) {
|
|
82
|
-
if (typeof color.value === 'string') {
|
|
83
|
-
this.colorReplacements[index].replacementColor = color.value;
|
|
84
|
-
}
|
|
85
|
-
}
|
|
86
|
-
|
|
87
|
-
this.changeColorDebounce();
|
|
88
|
-
},
|
|
89
|
-
onColorPickerInputDropdown(color: string, index: number) {
|
|
90
|
-
if (typeof color === 'string') {
|
|
91
|
-
this.colorReplacements[index].replacementColor = color;
|
|
92
|
-
}
|
|
93
|
-
|
|
94
|
-
this.changeColorDebounce();
|
|
95
|
-
},
|
|
96
|
-
changeColor() {
|
|
97
|
-
this.$emit('update:modelValue', {
|
|
98
|
-
id: this.id,
|
|
99
|
-
name: this.name,
|
|
100
|
-
value: this.colorReplacements,
|
|
101
|
-
});
|
|
102
|
-
},
|
|
103
|
-
|
|
104
|
-
onColorMatchToggled(value: boolean) {
|
|
105
|
-
if (value) {
|
|
106
|
-
this.colorReplacements.forEach((x) => {
|
|
107
|
-
x.replacementColor = STYLE_THEME_KEYS.LogoTextColor;
|
|
108
|
-
});
|
|
109
|
-
} else {
|
|
110
|
-
this.colorReplacements.forEach((x) => {
|
|
111
|
-
x.replacementColor = x.originalColor;
|
|
112
|
-
});
|
|
113
|
-
}
|
|
114
|
-
|
|
115
|
-
this.changeColorDebounce();
|
|
116
|
-
},
|
|
117
|
-
},
|
|
118
|
-
});
|