@designcrowd/library.brand-page 5.10.15-sync-fix-1 → 5.10.15

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/index.mjs CHANGED
@@ -63798,7 +63798,7 @@ const r0 = (e) => {
63798
63798
  pageIndex: e,
63799
63799
  contents: t
63800
63800
  }) {
63801
- e >= this.pages.length || (console.log("before", this.pages[e].contents), this.pages[e].contents = [...t], console.log("after", this.pages[e].contents));
63801
+ e >= this.pages.length || (this.pages[e].contents = t);
63802
63802
  },
63803
63803
  setPages({ pages: e }) {
63804
63804
  var r;
@@ -64190,15 +64190,14 @@ const rt = Qt("uiContentSettings", {
64190
64190
  item: e,
64191
64191
  index: t
64192
64192
  }) {
64193
- console.log("Adding item:", e), this.items.splice(t ?? this.items.length, 0, e), this.initialiseItemState({ item: e });
64193
+ this.items.splice(t ?? this.items.length, 0, e), this.initialiseItemState({ item: e });
64194
64194
  },
64195
64195
  async setState(e) {
64196
64196
  this.$patch(e.newState), await this.updateIsDefaultTextColorRequired();
64197
64197
  },
64198
64198
  _deleteItem({ id: e }) {
64199
- console.log("Deleting item with id:", e, this.items);
64200
- const t = this.items.findIndex((n) => (console.log("Checking items ", n, "againsts:", e), n.id === e));
64201
- if (console.log("Item index:", t), t < 0) {
64199
+ const t = this.items.findIndex((n) => n.id === e);
64200
+ if (t < 0) {
64202
64201
  console.error(`Unable to find content item by id '${e}'`);
64203
64202
  return;
64204
64203
  }
@@ -64392,7 +64391,7 @@ const rt = Qt("uiContentSettings", {
64392
64391
  id: e,
64393
64392
  itemState: t
64394
64393
  }) {
64395
- console.log("======= before setItemState =======", this.itemStates), this.itemStates[e] = t, console.log("======= after setItemState =======", this.itemStates);
64394
+ this.itemStates[e] = t;
64396
64395
  },
64397
64396
  setItemGroupState({
64398
64397
  id: e,
@@ -64896,16 +64895,19 @@ const rt = Qt("uiContentSettings", {
64896
64895
  logoImageBase64Url: void 0
64897
64896
  });
64898
64897
  });
64899
- }), n.pages.forEach((i) => {
64900
- i.contents.forEach((r) => {
64901
- if (r.type !== "logo")
64902
- return r;
64903
- const s = { ...r };
64904
- let o = e;
64905
- t && (o = {
64906
- ...o,
64907
- logoVariation: s.settings.content.logoImage.logoVariation
64908
- }), s.settings.content.logoImage = o, s.settings.content.logoImageBase64Url = void 0;
64898
+ }), n.pages.forEach((i, r) => {
64899
+ n.setPageContents({
64900
+ pageIndex: r,
64901
+ contents: i.contents.map((s) => {
64902
+ if (s.type !== "logo")
64903
+ return s;
64904
+ const o = { ...s };
64905
+ let a = e;
64906
+ return t && (a = {
64907
+ ...a,
64908
+ logoVariation: o.settings.content.logoImage.logoVariation
64909
+ }), o.settings.content.logoImage = a, o.settings.content.logoImageBase64Url = void 0, o;
64910
+ })
64909
64911
  });
64910
64912
  });
64911
64913
  },
@@ -78821,7 +78823,7 @@ const eZ1 = /* @__PURE__ */ v(KF1, [["render", QF1], ["__scopeId", "data-v-8240b
78821
78823
  };
78822
78824
  g.setLogoImageToAllContentsAndSections({
78823
78825
  logoImage: N
78824
- }), g.setSelectedLogoImage(N), D.logoDesignAttributes && (console.log("Here? "), g.applyLogoDesignAttributes(D.logoDesignAttributes));
78826
+ }), g.setSelectedLogoImage(N), D.logoDesignAttributes && g.applyLogoDesignAttributes(D.logoDesignAttributes), s.currentLogoIsByo = !0;
78825
78827
  }, R = () => {
78826
78828
  if (o.isPrePurchase) {
78827
78829
  c.setSelectedTabName({
@@ -89186,9 +89188,9 @@ const L6e = /* @__PURE__ */ v(T6e, [["render", H6e], ["__scopeId", "data-v-99257
89186
89188
  logoVariation: 0,
89187
89189
  logoLastUpdate: Date.now().toString()
89188
89190
  };
89189
- this.logoSettingsStore.setLogoImageToAllContentsAndSections({
89191
+ this.logoSettingStore.setLogoImageToAllContentsAndSections({
89190
89192
  logoImage: t
89191
- }), this.logoSettingsStore.setSelectedLogoImage(t), e.logoDesignAttributes && this.logoSettingsStore.applyLogoDesignAttributes(
89193
+ }), this.logoSettingStore.setSelectedLogoImage(t), e.logoDesignAttributes && this.logoSettingStore.applyLogoDesignAttributes(
89192
89194
  e.logoDesignAttributes
89193
89195
  );
89194
89196
  }
@@ -8,7 +8,6 @@ import { useUiSideBarStore } from '../../side-bar/store';
8
8
  import { createDefaultContentItemGroupState, createDefaultContentItemState, } from '../../navigation-style-settings/store';
9
9
  import { adminValidatorsDict, dummyValidator, validatorDict, } from '../../../brand-page-maker/validators';
10
10
  import { vueDeepMerge } from '../../../helpers/vue.helper';
11
- import cloneDeep from 'lodash.clonedeep';
12
11
  const DEFAULT_TEXT_COLOR_DEPENDENT_TYPES = [
13
12
  'profile',
14
13
  'text',
@@ -40,7 +39,6 @@ export const useUiContentSettingsStore = defineStore('uiContentSettings', {
40
39
  uiStore.onContentChanged();
41
40
  },
42
41
  _addItem({ item, index, }) {
43
- console.log('Adding item:', item);
44
42
  this.items.splice(index ?? this.items.length, 0, item);
45
43
  this.initialiseItemState({ item });
46
44
  },
@@ -49,12 +47,7 @@ export const useUiContentSettingsStore = defineStore('uiContentSettings', {
49
47
  await this.updateIsDefaultTextColorRequired();
50
48
  },
51
49
  _deleteItem({ id: id }) {
52
- console.log('Deleting item with id:', id, this.items);
53
- const idx = this.items.findIndex((i) => {
54
- console.log('Checking items ', i, 'againsts:', id);
55
- return i.id === id;
56
- });
57
- console.log('Item index:', idx);
50
+ const idx = this.items.findIndex((i) => i.id === id);
58
51
  if (idx < 0) {
59
52
  console.error(`Unable to find content item by id '${id}'`);
60
53
  return;
@@ -249,9 +242,7 @@ export const useUiContentSettingsStore = defineStore('uiContentSettings', {
249
242
  this.activeCategoryTab = activeCategoryTab;
250
243
  },
251
244
  setItemState({ id, itemState, }) {
252
- console.log('======= before setItemState =======', this.itemStates);
253
245
  this.itemStates[id] = itemState;
254
- console.log('======= after setItemState =======', this.itemStates);
255
246
  },
256
247
  setItemGroupState({ id, groupId, groupState, }) {
257
248
  if (!this.itemStates[id]) {
@@ -39,12 +39,12 @@ export default defineComponent({
39
39
  logoVariation: 0,
40
40
  logoLastUpdate: Date.now().toString(),
41
41
  };
42
- this.logoSettingsStore.setLogoImageToAllContentsAndSections({
42
+ this.logoSettingStore.setLogoImageToAllContentsAndSections({
43
43
  logoImage,
44
44
  });
45
- this.logoSettingsStore.setSelectedLogoImage(logoImage);
45
+ this.logoSettingStore.setSelectedLogoImage(logoImage);
46
46
  if (response.logoDesignAttributes) {
47
- this.logoSettingsStore.applyLogoDesignAttributes(response.logoDesignAttributes);
47
+ this.logoSettingStore.applyLogoDesignAttributes(response.logoDesignAttributes);
48
48
  }
49
49
  },
50
50
  },
@@ -69,23 +69,25 @@ export const useUiLogoSettingsStore = defineStore('uiLogoSettings', {
69
69
  });
70
70
  });
71
71
  // TODO: test me
72
- pageSettingsStore.pages.forEach((p) => {
73
- // This is modifying the p.contents in memory. Calling map (over forEach) will create a new array
74
- // causing the content in the page and contents settings store to be out of sync
75
- p.contents.forEach((c) => {
76
- if (c.type !== 'logo') {
77
- return c;
78
- }
79
- const logoContentItem = { ...c };
80
- let thisLogoImage = logoImage;
81
- if (keepLogoVariation) {
82
- thisLogoImage = {
83
- ...thisLogoImage,
84
- logoVariation: logoContentItem.settings.content.logoImage.logoVariation,
85
- };
86
- }
87
- logoContentItem.settings.content.logoImage = thisLogoImage;
88
- logoContentItem.settings.content.logoImageBase64Url = undefined;
72
+ pageSettingsStore.pages.forEach((p, i) => {
73
+ pageSettingsStore.setPageContents({
74
+ pageIndex: i,
75
+ contents: p.contents.map((c) => {
76
+ if (c.type !== 'logo') {
77
+ return c;
78
+ }
79
+ const logoContentItem = { ...c };
80
+ let thisLogoImage = logoImage;
81
+ if (keepLogoVariation) {
82
+ thisLogoImage = {
83
+ ...thisLogoImage,
84
+ logoVariation: logoContentItem.settings.content.logoImage.logoVariation,
85
+ };
86
+ }
87
+ logoContentItem.settings.content.logoImage = thisLogoImage;
88
+ logoContentItem.settings.content.logoImageBase64Url = undefined;
89
+ return logoContentItem;
90
+ }),
89
91
  });
90
92
  });
91
93
  },
@@ -70,9 +70,7 @@ export const useUiPageSettingsStore = defineStore('uiPageSettings', {
70
70
  if (pageIndex >= this.pages.length) {
71
71
  return;
72
72
  }
73
- console.log('before', this.pages[pageIndex].contents);
74
- this.pages[pageIndex].contents = [...contents];
75
- console.log('after', this.pages[pageIndex].contents);
73
+ this.pages[pageIndex].contents = contents;
76
74
  },
77
75
  setPages({ pages }) {
78
76
  const contentSettingsStore = useUiContentSettingsStore();
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.10.15-sync-fix-1",
4
+ "version": "5.10.15",
5
5
  "author": "Design.com Eng",
6
6
  "license": "UNLICENSED",
7
7
  "type": "module",
@@ -357,9 +357,10 @@ const onLogoUpload = (response: CreateWebsiteByoUploadResult) => {
357
357
  logoSettingStore.setSelectedLogoImage(logoImage);
358
358
 
359
359
  if (response.logoDesignAttributes) {
360
- console.log('Here? ');
361
360
  logoSettingStore.applyLogoDesignAttributes(response.logoDesignAttributes);
362
361
  }
362
+
363
+ data.currentLogoIsByo = true;
363
364
  };
364
365
 
365
366
  const onEditLogoButtonClicked = () => {
@@ -50,7 +50,6 @@ import {
50
50
  validatorDict,
51
51
  } from '../../../brand-page-maker/validators';
52
52
  import { vueDeepMerge } from '../../../helpers/vue.helper';
53
- import cloneDeep from 'lodash.clonedeep';
54
53
 
55
54
  const DEFAULT_TEXT_COLOR_DEPENDENT_TYPES: readonly ContentType[] = [
56
55
  'profile',
@@ -115,7 +114,6 @@ export const useUiContentSettingsStore = defineStore('uiContentSettings', {
115
114
  item: ContentItem<any>;
116
115
  index?: number;
117
116
  }): void {
118
- console.log('Adding item:', item);
119
117
  this.items.splice(index ?? this.items.length, 0, item);
120
118
  this.initialiseItemState({ item });
121
119
  },
@@ -127,15 +125,7 @@ export const useUiContentSettingsStore = defineStore('uiContentSettings', {
127
125
  await this.updateIsDefaultTextColorRequired();
128
126
  },
129
127
  _deleteItem({ id: id }: { id: string }): void {
130
- console.log('Deleting item with id:', id, this.items);
131
-
132
- const idx = this.items.findIndex((i) => {
133
- console.log('Checking items ', i, 'againsts:', id);
134
-
135
- return i.id === id;
136
- });
137
-
138
- console.log('Item index:', idx);
128
+ const idx = this.items.findIndex((i) => i.id === id);
139
129
 
140
130
  if (idx < 0) {
141
131
  console.error(`Unable to find content item by id '${id}'`);
@@ -466,9 +456,7 @@ export const useUiContentSettingsStore = defineStore('uiContentSettings', {
466
456
  id: string;
467
457
  itemState: ContentSettingsItemState;
468
458
  }): void {
469
- console.log('======= before setItemState =======', this.itemStates);
470
459
  this.itemStates[id] = itemState;
471
- console.log('======= after setItemState =======', this.itemStates);
472
460
  },
473
461
  setItemGroupState({
474
462
  id,
@@ -55,14 +55,14 @@ export default defineComponent({
55
55
  logoLastUpdate: Date.now().toString(),
56
56
  };
57
57
 
58
- this.logoSettingsStore.setLogoImageToAllContentsAndSections({
58
+ this.logoSettingStore.setLogoImageToAllContentsAndSections({
59
59
  logoImage,
60
60
  });
61
61
 
62
- this.logoSettingsStore.setSelectedLogoImage(logoImage);
62
+ this.logoSettingStore.setSelectedLogoImage(logoImage);
63
63
 
64
64
  if (response.logoDesignAttributes) {
65
- this.logoSettingsStore.applyLogoDesignAttributes(
65
+ this.logoSettingStore.applyLogoDesignAttributes(
66
66
  response.logoDesignAttributes,
67
67
  );
68
68
  }
@@ -134,29 +134,32 @@ export const useUiLogoSettingsStore = defineStore('uiLogoSettings', {
134
134
  });
135
135
 
136
136
  // TODO: test me
137
- pageSettingsStore.pages.forEach((p) => {
138
- // This is modifying the p.contents in memory. Calling map (over forEach) will create a new array
139
- // causing the content in the page and contents settings store to be out of sync
140
- p.contents.forEach((c) => {
141
- if (c.type !== 'logo') {
142
- return c;
143
- }
137
+ pageSettingsStore.pages.forEach((p, i) => {
138
+ pageSettingsStore.setPageContents({
139
+ pageIndex: i,
140
+ contents: p.contents.map((c) => {
141
+ if (c.type !== 'logo') {
142
+ return c;
143
+ }
144
144
 
145
- const logoContentItem = { ...c } as ContentItem<LogoContent>;
145
+ const logoContentItem = { ...c } as ContentItem<LogoContent>;
146
146
 
147
- let thisLogoImage = logoImage;
147
+ let thisLogoImage = logoImage;
148
148
 
149
- if (keepLogoVariation) {
150
- thisLogoImage = {
151
- ...thisLogoImage,
152
- logoVariation:
153
- logoContentItem.settings.content.logoImage.logoVariation,
154
- };
155
- }
149
+ if (keepLogoVariation) {
150
+ thisLogoImage = {
151
+ ...thisLogoImage,
152
+ logoVariation:
153
+ logoContentItem.settings.content.logoImage.logoVariation,
154
+ };
155
+ }
156
156
 
157
- logoContentItem.settings.content.logoImage = thisLogoImage;
157
+ logoContentItem.settings.content.logoImage = thisLogoImage;
158
158
 
159
- logoContentItem.settings.content.logoImageBase64Url = undefined;
159
+ logoContentItem.settings.content.logoImageBase64Url = undefined;
160
+
161
+ return logoContentItem;
162
+ }),
160
163
  });
161
164
  });
162
165
  },
@@ -146,11 +146,7 @@ export const useUiPageSettingsStore = defineStore('uiPageSettings', {
146
146
  return;
147
147
  }
148
148
 
149
- console.log('before', this.pages[pageIndex].contents);
150
-
151
- this.pages[pageIndex].contents = [...contents];
152
-
153
- console.log('after', this.pages[pageIndex].contents);
149
+ this.pages[pageIndex].contents = contents;
154
150
  },
155
151
  setPages({ pages }: { pages: ContentPage[] }): void {
156
152
  const contentSettingsStore = useUiContentSettingsStore();