@designcrowd/library.brand-page 5.11.9 → 5.12.0-shape-1

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 (32) hide show
  1. package/lib/src/{CreatedOnBrandCrowd-de-de-v4Pf4hwN.js → CreatedOnBrandCrowd-de-de-DNryFC5E.js} +1 -1
  2. package/lib/src/{CreatedOnBrandCrowd-en-us-B3vNwipT.js → CreatedOnBrandCrowd-en-us-DYmndMFm.js} +1 -1
  3. package/lib/src/{CreatedOnBrandCrowd-es-es-Dc8YQ5_G.js → CreatedOnBrandCrowd-es-es-DOPG0rp0.js} +1 -1
  4. package/lib/src/{CreatedOnBrandCrowd-fr-fr-B3T3BPVB.js → CreatedOnBrandCrowd-fr-fr-BEPFCaA_.js} +1 -1
  5. package/lib/src/{CreatedOnBrandCrowd-pt-pt-CFYi-3vN.js → CreatedOnBrandCrowd-pt-pt-BcFmnqq_.js} +1 -1
  6. package/lib/src/{CreatedOnDcom-de-de-DeOW1C8t.js → CreatedOnDcom-de-de-f2_fnThs.js} +1 -1
  7. package/lib/src/{CreatedOnDcom-en-us-DhLZ8yLF.js → CreatedOnDcom-en-us-BLDKgwu0.js} +1 -1
  8. package/lib/src/{CreatedOnDcom-es-es-CijeJ_l_.js → CreatedOnDcom-es-es-C9pazi7v.js} +1 -1
  9. package/lib/src/{CreatedOnDcom-fr-fr-DTBt4j-e.js → CreatedOnDcom-fr-fr-D_3gNrhb.js} +1 -1
  10. package/lib/src/{CreatedOnDcom-pt-pt-BB0gCU7S.js → CreatedOnDcom-pt-pt-B4eBjdr2.js} +1 -1
  11. package/lib/src/brand-page/components/background-shape/BackgroundShape.mixin.d.ts +2 -0
  12. package/lib/src/brand-page/components/background-shape/BackgroundShape.mixin.js +14 -1
  13. package/lib/src/brand-page/components/media/Shape.mixin.d.ts +2 -1
  14. package/lib/src/brand-page/components/media/Shape.mixin.js +12 -2
  15. package/lib/src/clients/design-template-client.d.ts +1 -0
  16. package/lib/src/clients/template-client.d.ts +1 -1
  17. package/lib/src/clients/template-client.js +4 -1
  18. package/lib/src/css/library.brand-page-brandCrowd.min.css +5 -5
  19. package/lib/src/css/library.brand-page-brandPage.min.css +5 -5
  20. package/lib/src/css/library.brand-page-designCom.min.css +5 -5
  21. package/lib/src/css/library.brand-page-preview.min.css +5 -5
  22. package/lib/src/index.mjs +1 -1
  23. package/lib/src/{lib-5zBDwXN9.js → lib-B6IHh63L.js} +4157 -4156
  24. package/lib/src/shared/template-settings/store/template-settings-store.js +3 -1
  25. package/package.json +1 -1
  26. package/src/brand-page/components/background-shape/BackgroundShape.mixin.ts +19 -1
  27. package/src/brand-page/components/background-shape/BackgroundShape.vue +2 -12
  28. package/src/brand-page/components/media/Shape.mixin.ts +16 -2
  29. package/src/brand-page/components/media/Shape.vue +0 -7
  30. package/src/clients/design-template-client.ts +1 -0
  31. package/src/clients/template-client.js +6 -0
  32. package/src/shared/template-settings/store/template-settings-store.ts +7 -1
@@ -9,7 +9,7 @@ import { BrandPageModel } from '../../../brand-page/models';
9
9
  import { migrateBrandPageModel } from '../../../brand-page/utils';
10
10
  import { getAiContentIndexByTemplateTokenAndNumberOfVariations } from '../../../brand-page-maker/utils/ai-content-selection.util';
11
11
  import { useUiLogoSettingsStore } from '../../logo-settings/store';
12
- import { templateSettingsTr } from '../../../composables/useTranslate';
12
+ import { templateSettingsTr, getCurrentLocale, } from '../../../composables/useTranslate';
13
13
  export const DEFAULT_PAGE_SIZE = 6;
14
14
  const LOAD_PAGE_RETRY_DELAY = 250;
15
15
  export const useUiTemplateSettingsStore = defineStore('uiTemplateSettings', {
@@ -155,6 +155,7 @@ export const useUiTemplateSettingsStore = defineStore('uiTemplateSettings', {
155
155
  this._setIsBusy({ isBusy: true });
156
156
  try {
157
157
  const designTemplateClient = DesignTemplateClient.getInstance();
158
+ const currentLocale = getCurrentLocale();
158
159
  const result = await designTemplateClient.getTemplateItemsByTemplateType(this.templateType, {
159
160
  page: pageNo,
160
161
  pageSize: DEFAULT_PAGE_SIZE,
@@ -163,6 +164,7 @@ export const useUiTemplateSettingsStore = defineStore('uiTemplateSettings', {
163
164
  logoDraftToken: logoSettingsStore.selectedLogoImage.logoDraftToken,
164
165
  personalisable: this.selectedTab.key === TEMPLATE_TABS.AI,
165
166
  selectedTemplateToken: designTemplateToken,
167
+ locale: currentLocale,
166
168
  });
167
169
  if (!result) {
168
170
  return;
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@designcrowd/library.brand-page",
3
3
  "description": "A collection of Maker/Designer applications",
4
- "version": "5.11.9",
4
+ "version": "5.12.0-shape-1",
5
5
  "author": "Design.com Eng",
6
6
  "license": "UNLICENSED",
7
7
  "type": "module",
@@ -21,7 +21,7 @@ export default defineComponent({
21
21
  },
22
22
  },
23
23
  data() {
24
- return { svgData: '', originalSvgData: '' };
24
+ return { svgData: '', svgDataObjectUrl: '', originalSvgData: '' };
25
25
  },
26
26
  computed: {
27
27
  useObjectElement(): boolean {
@@ -49,6 +49,14 @@ export default defineComponent({
49
49
 
50
50
  return attributes.join(' ');
51
51
  },
52
+
53
+ objectUrl(): string {
54
+ if (!this.useObjectElement) {
55
+ return this.svgDataObjectUrl;
56
+ }
57
+
58
+ return this.viewModel.name;
59
+ },
52
60
  },
53
61
  watch: {
54
62
  'viewModel.style.color': {
@@ -79,6 +87,11 @@ export default defineComponent({
79
87
  return;
80
88
  }
81
89
 
90
+ if (this.svgDataObjectUrl) {
91
+ // clean up previous Object URL
92
+ URL.revokeObjectURL(this.svgDataObjectUrl);
93
+ }
94
+
82
95
  if (isURL(this.viewModel.name)) {
83
96
  if (!this.isValidSvgUrl(this.viewModel.name)) {
84
97
  return;
@@ -102,6 +115,11 @@ export default defineComponent({
102
115
  '<svg ',
103
116
  `<svg ${this.svgAttributes} `,
104
117
  );
118
+
119
+ const blob = new Blob([this.svgData], { type: 'image/svg+xml' });
120
+
121
+ // Create an Object URL
122
+ this.svgDataObjectUrl = URL.createObjectURL(blob);
105
123
  },
106
124
  },
107
125
  });
@@ -1,18 +1,8 @@
1
1
  <template>
2
2
  <div class="c-shape-background">
3
- <div
4
- v-if="useObjectElement"
5
- :style="backgroundShapesStyle"
6
- class="c-shape c-shape-object"
7
- >
8
- <object class="tw-w-full tw-h-full" :data="viewModel.name" />
3
+ <div :style="backgroundShapesStyle" class="c-shape c-shape-object">
4
+ <object class="tw-w-full tw-h-full" :data="objectUrl" />
9
5
  </div>
10
- <div
11
- v-else
12
- :style="backgroundShapesStyle"
13
- class="c-shape"
14
- v-html="svgData"
15
- />
16
6
  </div>
17
7
  </template>
18
8
  <script>
@@ -34,7 +34,7 @@ export default defineComponent({
34
34
  },
35
35
  },
36
36
  data() {
37
- return { svgData: '', originalSvgData: '' };
37
+ return { svgData: '', svgDataObjectUrl: '', originalSvgData: '' };
38
38
  },
39
39
  computed: {
40
40
  useObjectElement(): boolean {
@@ -53,6 +53,10 @@ export default defineComponent({
53
53
  },
54
54
 
55
55
  objectUrl() {
56
+ if (!this.useObjectElement) {
57
+ return this.svgDataObjectUrl;
58
+ }
59
+
56
60
  let dimensionQuery = ``;
57
61
 
58
62
  if (this.size) {
@@ -68,7 +72,7 @@ export default defineComponent({
68
72
  const attributes: string[] = [];
69
73
 
70
74
  if (this.size) {
71
- attributes.push(`height=${this.size} width=${this.size}`);
75
+ attributes.push(`height="${this.size}" width="${this.size}"`);
72
76
  }
73
77
 
74
78
  return attributes.join(' ');
@@ -125,6 +129,11 @@ export default defineComponent({
125
129
  return;
126
130
  }
127
131
 
132
+ if (this.svgDataObjectUrl) {
133
+ // clean up previous Object URL
134
+ URL.revokeObjectURL(this.svgDataObjectUrl);
135
+ }
136
+
128
137
  this.svgData = applyColorReplacementsToSvgString(
129
138
  this.originalSvgData,
130
139
  this.colorReplacements,
@@ -134,6 +143,11 @@ export default defineComponent({
134
143
  '<svg ',
135
144
  `<svg ${this.svgAttributes} `,
136
145
  );
146
+
147
+ const blob = new Blob([this.svgData], { type: 'image/svg+xml' });
148
+
149
+ // Create an Object URL
150
+ this.svgDataObjectUrl = URL.createObjectURL(blob);
137
151
  },
138
152
  },
139
153
  });
@@ -1,18 +1,11 @@
1
1
  <template>
2
2
  <div :class="imgClasses">
3
3
  <div
4
- v-if="useObjectElement"
5
4
  class="c-shape c-shape-object"
6
5
  :class="{ 'tw-flex tw-justify-center tw-items-center': size }"
7
6
  >
8
7
  <object :style="objectStyle" :data="objectUrl" />
9
8
  </div>
10
- <div
11
- v-else
12
- class="c-shape"
13
- :class="{ 'tw-flex tw-justify-center tw-items-center': size }"
14
- v-html="svgData"
15
- />
16
9
  </div>
17
10
  </template>
18
11
  <script>
@@ -24,6 +24,7 @@ interface GetTemplatesAsyncOptions {
24
24
  pageSize?: number;
25
25
  personalisable?: boolean;
26
26
  selectedTemplateToken?: string | false;
27
+ locale?: string;
27
28
  }
28
29
 
29
30
  export const getTemplatesEndpoint = (templateTypeName: string) =>
@@ -143,6 +143,7 @@ export default class TemplateClient {
143
143
  pageSize,
144
144
  selectedTemplateToken,
145
145
  aiSettings,
146
+ locale,
146
147
  ) {
147
148
  try {
148
149
  const contentKey = aiSettings?.contentKey || null;
@@ -160,6 +161,11 @@ export default class TemplateClient {
160
161
  personalisable: !!contentKey && !!userToken,
161
162
  pageName: this.getPageName(),
162
163
  };
164
+
165
+ if (locale) {
166
+ params.locale = locale;
167
+ }
168
+
163
169
  if (this.isTrackingEnabled()) {
164
170
  params['pageSection'] = this.getPageSection();
165
171
  }
@@ -27,7 +27,10 @@ import { BrandPageModel } from '../../../brand-page/models';
27
27
  import { migrateBrandPageModel } from '../../../brand-page/utils';
28
28
  import { getAiContentIndexByTemplateTokenAndNumberOfVariations } from '../../../brand-page-maker/utils/ai-content-selection.util';
29
29
  import { useUiLogoSettingsStore } from '../../logo-settings/store';
30
- import { templateSettingsTr } from '../../../composables/useTranslate';
30
+ import {
31
+ templateSettingsTr,
32
+ getCurrentLocale,
33
+ } from '../../../composables/useTranslate';
31
34
 
32
35
  export const DEFAULT_PAGE_SIZE = 6;
33
36
  const LOAD_PAGE_RETRY_DELAY = 250;
@@ -245,6 +248,8 @@ export const useUiTemplateSettingsStore = defineStore('uiTemplateSettings', {
245
248
  try {
246
249
  const designTemplateClient = DesignTemplateClient.getInstance();
247
250
 
251
+ const currentLocale = getCurrentLocale();
252
+
248
253
  const result =
249
254
  await designTemplateClient.getTemplateItemsByTemplateType(
250
255
  this.templateType,
@@ -257,6 +262,7 @@ export const useUiTemplateSettingsStore = defineStore('uiTemplateSettings', {
257
262
  logoSettingsStore.selectedLogoImage.logoDraftToken,
258
263
  personalisable: this.selectedTab.key === TEMPLATE_TABS.AI,
259
264
  selectedTemplateToken: designTemplateToken,
265
+ locale: currentLocale,
260
266
  },
261
267
  );
262
268