@designcrowd/library.brand-page 5.6.4-fluid-6 → 5.6.4-scroll-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.
Files changed (35) hide show
  1. package/lib/src/brand-page/components/page/Page.mixin.d.ts +3 -4
  2. package/lib/src/brand-page/components/page/Page.mixin.js +22 -24
  3. package/lib/src/brand-page/components/text-wrapper/TextWrapper.mixin.d.ts +44 -0
  4. package/lib/src/brand-page/components/text-wrapper/TextWrapper.mixin.js +38 -0
  5. package/lib/src/brand-page/models/index.d.ts +0 -3
  6. package/lib/src/brand-page/utils/migration.util.js +0 -5
  7. package/lib/src/brand-page-maker/components/brand-page-maker/BrandPageMaker.stories.js +2 -206
  8. package/lib/src/brand-page-maker/components/brandpage-maker-page/BrandPageMakerPage.mixin.d.ts +3 -5
  9. package/lib/src/brand-page-maker/components/brandpage-maker-page/BrandPageMakerPage.mixin.js +0 -11
  10. package/lib/src/brand-page-maker/convertors/text-size-value.convertor.js +3 -3
  11. package/lib/src/brand-page-maker/utils/text.util.d.ts +2 -2
  12. package/lib/src/brand-page-maker/utils/text.util.js +3 -3
  13. package/lib/src/css/library.brand-page-brandCrowd.min.css +19 -19
  14. package/lib/src/css/library.brand-page-brandPage.min.css +19 -19
  15. package/lib/src/css/library.brand-page-designCom.min.css +19 -19
  16. package/lib/src/css/library.brand-page-preview.min.css +19 -19
  17. package/lib/src/index.mjs +11361 -11414
  18. package/package.json +1 -1
  19. package/src/brand-page/components/page/Page.mixin.ts +36 -30
  20. package/src/brand-page/components/page/Page.vue +3 -7
  21. package/src/brand-page/components/text/Text.vue +6 -9
  22. package/src/brand-page/components/text-wrapper/TextWrapper.mixin.ts +41 -0
  23. package/src/brand-page/components/text-wrapper/TextWrapper.vue +12 -169
  24. package/src/brand-page/models/index.ts +0 -4
  25. package/src/brand-page/utils/__snapshots__/migration.util.test.ts.snap +27 -27
  26. package/src/brand-page/utils/migration.util.ts +0 -5
  27. package/src/brand-page-maker/components/brand-page-maker/BrandPageMaker.stories.ts +5 -213
  28. package/src/brand-page-maker/components/brandpage-maker-page/BrandPageMakerPage.mixin.ts +0 -13
  29. package/src/brand-page-maker/components/shop/ProductConfigModal.vue +1 -1
  30. package/src/brand-page-maker/convertors/text-size-value.convertor.ts +3 -3
  31. package/src/brand-page-maker/stores/brandpage-maker/brandpage-maker-store.test.ts +3 -12
  32. package/src/brand-page-maker/utils/text.util.ts +3 -3
  33. package/lib/src/brand-page/utils/migration/migration-03.d.ts +0 -5
  34. package/lib/src/brand-page/utils/migration/migration-03.js +0 -35
  35. package/src/brand-page/utils/migration/migration-03.ts +0 -46
@@ -231,48 +231,8 @@ export const SampleBanner = (): any => {
231
231
  const brandPageMakerStore = useBrandPageMakerStore();
232
232
 
233
233
  const bannerContent = createInitialBannerSectionContent();
234
- bannerContent.title = 'LAUNCHING SOON';
235
- bannerContent.description = 'This Is Going To Be Epic';
236
- bannerContent.buttonText = 'CONTACT US';
237
- bannerContent.titleStyle.textStyleType = undefined;
238
- bannerContent.titleStyle.fontSize = '6.25em';
239
- bannerContent.titleStyle.fontFamily = 'Ubuntu';
240
- bannerContent.titleStyle.lineHeight = '1';
241
- bannerContent.titleStyle.textAlign = 'left';
242
- bannerContent.displayStyle = 'left-aligned';
243
-
244
- bannerContent.descriptionStyle.textStyleType = undefined;
245
- bannerContent.descriptionStyle.fontFamily = 'Work Sans';
246
- bannerContent.descriptionStyle.fontSize = '2.6875em';
247
- bannerContent.descriptionStyle.textAlign = 'left';
248
-
249
- bannerContent.buttonTextStyle.textStyleType = undefined;
250
- bannerContent.buttonTextStyle.fontFamily = 'Ubuntu';
251
- bannerContent.buttonTextStyle.fontSize = '1.5em';
252
- bannerContent.buttonTextStyle.textAlign = 'left';
253
-
254
- console.log('bannerContent', bannerContent);
255
-
256
- const bannerContent2 = createInitialBannerSectionContent();
257
- bannerContent2.title = 'LAUNCHING SOON';
258
- bannerContent2.description = 'This Is Going To Be Epic2';
259
- bannerContent2.buttonText = 'CONTACT US';
260
- bannerContent2.titleStyle.textStyleType = undefined;
261
- bannerContent2.titleStyle.fontSize = '6.25em';
262
- bannerContent2.titleStyle.fontFamily = 'Ubuntu';
263
- bannerContent2.titleStyle.lineHeight = '1';
264
- bannerContent2.titleStyle.textAlign = 'left';
265
- bannerContent2.displayStyle = 'left-aligned';
266
-
267
- bannerContent2.descriptionStyle.textStyleType = undefined;
268
- bannerContent2.descriptionStyle.fontFamily = 'Work Sans';
269
- bannerContent2.descriptionStyle.fontSize = '2.6875em';
270
- bannerContent2.descriptionStyle.textAlign = 'left';
271
-
272
- bannerContent2.buttonTextStyle.textStyleType = undefined;
273
- bannerContent2.buttonTextStyle.fontFamily = 'Ubuntu';
274
- bannerContent2.buttonTextStyle.fontSize = '1.5em';
275
- bannerContent2.buttonTextStyle.textAlign = 'left';
234
+ bannerContent.description = 'Lorem ipsum dolor sit amet';
235
+
276
236
  brandPageMakerStore.setViewport({
277
237
  viewport: VIEWPORTS.desktop,
278
238
  });
@@ -290,176 +250,7 @@ export const SampleBanner = (): any => {
290
250
  {
291
251
  title: 'Home',
292
252
  slug: 'home',
293
- contents: [
294
- {
295
- id: 'acc69f79-8ecd-4c6e-9665-f0f7c06150ca',
296
- url: '',
297
- type: 'banner-section',
298
- title: "SPORT'S KICKOFF",
299
- imageUrl: '',
300
- pageSlug: '',
301
- cardStyle: {
302
- backgroundColor: 'rgb(255,255,255)',
303
- },
304
- buttonText: 'Buy Tickets',
305
- titleStyle: {
306
- color: '#ffffff',
307
- fontSize: '2.375em',
308
- textAlign: 'center',
309
- wordBreak: 'normal',
310
- fontFamily: 'Jost',
311
- fontWeight: 'bold',
312
- lineHeight: '1.0',
313
- overflowWrap: 'anywhere',
314
- letterSpacing: '0.132em',
315
- textDecoration: '',
316
- },
317
- description: 'SOCCER MATCH',
318
- displayStyle: 'centered',
319
- overlayColor: {
320
- backgroundColor: 'rgb(0,0,0)',
321
- },
322
- buttonLinkType: 'url',
323
- overlayOpacity: 50,
324
- backgroundStyle: {
325
- backgroundColor: '',
326
- },
327
- buttonTextStyle: {
328
- color: '#fffbf4',
329
- fontSize: '1.25em',
330
- textAlign: 'center',
331
- wordBreak: 'normal',
332
- fontFamily: 'Jost',
333
- fontWeight: 'bold',
334
- lineHeight: '1.3',
335
- overflowWrap: 'anywhere',
336
- letterSpacing: '0',
337
- textDecoration: '',
338
- },
339
- descriptionStyle: {
340
- color: '#ffffff',
341
- fontSize: '5.625em',
342
- textAlign: 'center',
343
- wordBreak: 'normal',
344
- fontFamily: 'Alfa Slab One',
345
- fontWeight: 'normal',
346
- lineHeight: '1.0',
347
- overflowWrap: 'anywhere',
348
- letterSpacing: '0.011em',
349
- textDecoration: '',
350
- },
351
- colorReplacements: [],
352
- },
353
- {
354
- id: 'dfeafaf4-b5ab-435e-a902-adfa74d7c63b',
355
- text: '',
356
- type: 'text',
357
- iconUrl: '',
358
- textSize: {
359
- fontSize: '1em',
360
- lineHeight: '1.5',
361
- },
362
- textColor: {},
363
- textItems: [
364
- {
365
- text: 'UPCOMING GAMES',
366
- textStyle: {
367
- color: '#d6ad7a',
368
- fontSize: '3.4375em',
369
- textAlign: 'center',
370
- fontFamily: 'Alfa Slab One',
371
- lineHeight: '1.4',
372
- letterSpacing: '0.018em',
373
- },
374
- },
375
- ],
376
- textStyle: {
377
- textAlign: 'center',
378
- textStyleType: 'paragraphs',
379
- },
380
- columnStyle: '1',
381
- textAlignment: {},
382
- backgroundColor: {
383
- backgroundColor: '#fffbf4',
384
- },
385
- },
386
- {
387
- id: '943e80c0-3d77-4aed-84a0-ed51d351661a',
388
- text: '',
389
- type: 'text',
390
- iconUrl: '',
391
- textSize: {
392
- fontSize: '1em',
393
- lineHeight: '1.5',
394
- },
395
- textColor: {},
396
- textItems: [
397
- {
398
- text: 'THURSDAY',
399
- textStyle: {
400
- color: '#d6ad7a',
401
- fontSize: '1.875em',
402
- textAlign: 'center',
403
- fontFamily: 'Pridi',
404
- fontWeight: 'bold',
405
- lineHeight: '1.3',
406
- letterSpacing: '0.033em',
407
- textDecoration: '',
408
- },
409
- },
410
- {
411
- text: 'FRIDAY',
412
- textStyle: {
413
- color: '#d6ad7a',
414
- fontSize: '1.875em',
415
- textAlign: 'center',
416
- fontFamily: 'Pridi',
417
- fontWeight: 'bold',
418
- lineHeight: '1.3',
419
- letterSpacing: '0.033em',
420
- textDecoration: '',
421
- },
422
- },
423
- {
424
- text: 'SATURDAY',
425
- textStyle: {
426
- color: '#d6ad7a',
427
- fontSize: '1.875em',
428
- textAlign: 'center',
429
- fontFamily: 'Pridi',
430
- fontWeight: 'bold',
431
- lineHeight: '1.3',
432
- letterSpacing: '0.033em',
433
- textDecoration: '',
434
- },
435
- },
436
- {
437
- text: 'SUNDAY',
438
- textStyle: {
439
- color: '#d6ad7a',
440
- fontSize: '1.875em',
441
- textAlign: 'center',
442
- fontFamily: 'Pridi',
443
- fontWeight: 'bold',
444
- lineHeight: '1.3',
445
- letterSpacing: '0.033em',
446
- textDecoration: '',
447
- },
448
- },
449
- ],
450
- textStyle: {
451
- textAlign: 'center',
452
- textStyleType: 'paragraphs',
453
- },
454
- columnStyle: '4',
455
- textAlignment: {},
456
- backgroundColor: {
457
- backgroundColor: '#fffbf4',
458
- },
459
- },
460
- bannerContent,
461
- bannerContent2,
462
- ],
253
+ contents: [bannerContent],
463
254
  },
464
255
  ],
465
256
  brandPageType: BRAND_PAGE_TYPES.brandSite,
@@ -999,6 +790,7 @@ SamplePremiumUser.story = {
999
790
  };
1000
791
 
1001
792
  export const SamplePremiumBContactUser = (): any => {
793
+
1002
794
  return {
1003
795
  components: {
1004
796
  BrandPageMaker,
@@ -1165,7 +957,7 @@ export const SamplePrePurchase = (): any => {
1165
957
  setup() {
1166
958
  const containerStore = useBrandPageContainerStore();
1167
959
  const logoStore = useLogoStore();
1168
-
960
+
1169
961
  logoStore.$patch({
1170
962
  logoTemplateAsset: {
1171
963
  token: logoTemplateToken,
@@ -106,13 +106,7 @@ export default defineComponent({
106
106
  };
107
107
  },
108
108
  },
109
- mounted() {
110
- this.dispatchViewPortChangeEvent();
111
- },
112
109
  watch: {
113
- viewport() {
114
- this.dispatchViewPortChangeEvent();
115
- },
116
110
  selectedItemId(itemId: string) {
117
111
  this.scrollToContentItemByItemId(itemId);
118
112
  },
@@ -140,13 +134,6 @@ export default defineComponent({
140
134
  },
141
135
  },
142
136
  methods: {
143
- dispatchViewPortChangeEvent() {
144
- window.dispatchEvent(
145
- new CustomEvent('editor:viewport', {
146
- detail: { viewport: this.viewport },
147
- }),
148
- );
149
- },
150
137
  onDraggingStart(): void {
151
138
  this.isDraggingContent = true;
152
139
 
@@ -30,7 +30,7 @@
30
30
  <AddOrEditProductContainer v-if="!isImageUpload" />
31
31
  <ImageUpload v-else />
32
32
  </template>
33
- <template #footer v-if="!isImageUpload">
33
+ <template v-if="!isImageUpload" #footer>
34
34
  <div
35
35
  class="tw-flex tw-justify-center tw-pt-4 tw-border-t tw-border-solid tw-border-grayscale-500"
36
36
  >
@@ -1,6 +1,6 @@
1
1
  import type { ValueConvertor } from '../models';
2
2
  import { DEFAULT_FONT_SIZE } from '../../brand-page/constants/';
3
- import { pxToEm, emToPx } from '../utils/text.util';
3
+ import { pxToRem, remToPx } from '../utils/text.util';
4
4
 
5
5
  export const textSizeValueConvertor: ValueConvertor<BrandPageCssStyle, string> =
6
6
  {
@@ -8,13 +8,13 @@ export const textSizeValueConvertor: ValueConvertor<BrandPageCssStyle, string> =
8
8
 
9
9
  convert(value: BrandPageCssStyle): string {
10
10
  return (
11
- value.fontSize ? emToPx(value.fontSize) : DEFAULT_FONT_SIZE
11
+ value.fontSize ? remToPx(value.fontSize) : DEFAULT_FONT_SIZE
12
12
  ).toString();
13
13
  },
14
14
 
15
15
  convertBack(valuePx: string): BrandPageCssStyle {
16
16
  return {
17
- fontSize: pxToEm(valuePx),
17
+ fontSize: pxToRem(valuePx),
18
18
  };
19
19
  },
20
20
  };
@@ -472,22 +472,13 @@ describe('brand page maker store module', () => {
472
472
  // Assert
473
473
  expect(
474
474
  styleSettingsStore.textStyles.textStyleOptions.titles.style.fontSize,
475
- ).toBe(
476
- textStyles.textStyleOptions.titles.style.fontSize?.replace('rem', 'em'),
477
- );
475
+ ).toBe(textStyles.textStyleOptions.titles.style.fontSize);
478
476
  expect(
479
477
  styleSettingsStore.textStyles.textStyleOptions.headings.style.fontSize,
480
- ).toBe(
481
- textStyles.textStyleOptions.headings.style.fontSize?.replace('rem', 'em'),
482
- );
478
+ ).toBe(textStyles.textStyleOptions.headings.style.fontSize);
483
479
  expect(
484
480
  styleSettingsStore.textStyles.textStyleOptions.paragraphs.style.fontSize,
485
- ).toBe(
486
- textStyles.textStyleOptions.paragraphs.style.fontSize?.replace(
487
- 'rem',
488
- 'em',
489
- ),
490
- );
481
+ ).toBe(textStyles.textStyleOptions.paragraphs.style.fontSize);
491
482
  });
492
483
 
493
484
  test('applySelectedTemplate should not set design template token when applying selected template and is admin', async () => {
@@ -1,10 +1,10 @@
1
- export const pxToEm = (px: string) => {
1
+ export const pxToRem = (px: string) => {
2
2
  const value = parseFloat(px) / 16;
3
3
 
4
- return `${value}em`;
4
+ return `${value}rem`;
5
5
  };
6
6
 
7
- export const emToPx = (rem: string) => {
7
+ export const remToPx = (rem: string) => {
8
8
  const value = parseFloat(rem) * 16;
9
9
 
10
10
  return `${value}`;
@@ -1,5 +0,0 @@
1
- import { type BrandPageModel, type LogoImageModel } from '../..';
2
- export declare const migration03: (brandPageModel: BrandPageModel, options: {
3
- logoImage?: LogoImageModel;
4
- isUserDraft: boolean;
5
- }) => BrandPageModel;
@@ -1,35 +0,0 @@
1
- import {} from '../..';
2
- const handleRecursiveFontSizeMigration = (object) => {
3
- if (!object) {
4
- return;
5
- }
6
- if (object['fontSize']) {
7
- // Handle conversion here
8
- object['fontSize'] = object['fontSize'].replace('rem', 'em');
9
- }
10
- Object.keys(object).forEach((k) => {
11
- if (typeof object[k] === 'object') {
12
- if (Array.isArray(object[k])) {
13
- object[k].forEach((o) => {
14
- handleRecursiveFontSizeMigration(o);
15
- });
16
- }
17
- else {
18
- handleRecursiveFontSizeMigration(object[k]);
19
- }
20
- }
21
- });
22
- };
23
- export const migration03 = (brandPageModel, options) => {
24
- handleRecursiveFontSizeMigration(brandPageModel.pageHeaderDesktop);
25
- handleRecursiveFontSizeMigration(brandPageModel.pageHeaderMobile);
26
- handleRecursiveFontSizeMigration(brandPageModel.pageFooterDesktop);
27
- handleRecursiveFontSizeMigration(brandPageModel.pageFooterMobile);
28
- handleRecursiveFontSizeMigration(brandPageModel.styles);
29
- brandPageModel.pages.forEach((page) => {
30
- page.contents.forEach((content) => {
31
- handleRecursiveFontSizeMigration(content);
32
- });
33
- });
34
- return brandPageModel;
35
- };
@@ -1,46 +0,0 @@
1
- import { type BrandPageModel, type LogoImageModel } from '../..';
2
-
3
- const handleRecursiveFontSizeMigration = (object: object) => {
4
- if (!object) {
5
- return;
6
- }
7
-
8
- if (object['fontSize']) {
9
- // Handle conversion here
10
- object['fontSize'] = object['fontSize'].replace('rem', 'em');
11
- }
12
-
13
- Object.keys(object).forEach((k) => {
14
- if (typeof object[k] === 'object') {
15
- if (Array.isArray(object[k])) {
16
- object[k].forEach((o) => {
17
- handleRecursiveFontSizeMigration(o);
18
- });
19
- } else {
20
- handleRecursiveFontSizeMigration(object[k]);
21
- }
22
- }
23
- });
24
- };
25
-
26
- export const migration03 = (
27
- brandPageModel: BrandPageModel,
28
- options: {
29
- logoImage?: LogoImageModel;
30
- isUserDraft: boolean;
31
- },
32
- ): BrandPageModel => {
33
- handleRecursiveFontSizeMigration(brandPageModel.pageHeaderDesktop);
34
- handleRecursiveFontSizeMigration(brandPageModel.pageHeaderMobile);
35
- handleRecursiveFontSizeMigration(brandPageModel.pageFooterDesktop);
36
- handleRecursiveFontSizeMigration(brandPageModel.pageFooterMobile);
37
- handleRecursiveFontSizeMigration(brandPageModel.styles);
38
-
39
- brandPageModel.pages.forEach((page) => {
40
- page.contents.forEach((content) => {
41
- handleRecursiveFontSizeMigration(content);
42
- });
43
- });
44
-
45
- return brandPageModel;
46
- };