@designcrowd/library.brand-page 5.6.4-scroll-1 → 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.
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.6.4-scroll-1",
4
+ "version": "5.6.4-scroll-2",
5
5
  "author": "Design.com Eng",
6
6
  "license": "UNLICENSED",
7
7
  "type": "module",
@@ -107,7 +107,28 @@ export default defineComponent({
107
107
  return backgroundShapes;
108
108
  },
109
109
 
110
- rootStyles(): BrandPageCssStyle {
110
+ rootElementStyles(): BrandPageCssStyle {
111
+ const styles: BrandPageCssStyle = {};
112
+
113
+ Object.assign(styles, this.viewModel?.styles?.textStyles?.style);
114
+
115
+ const textFontFamilyKey =
116
+ this.viewModel.styles?.textStyles.textFontFamily ||
117
+ DEFAULT_FONT_FAMILY_KEY;
118
+
119
+ const textFontFamilyConfig = FONT_FAMILY_CONFIGS[textFontFamilyKey];
120
+
121
+ if (textFontFamilyConfig) {
122
+ styles.fontFamily = [
123
+ `"${textFontFamilyConfig.name}"`,
124
+ ...FALLBACK_FONT_FAMILIES,
125
+ ].join(', ');
126
+ }
127
+
128
+ return styles;
129
+ },
130
+
131
+ rootBackgroundStyles(): BrandPageCssStyle {
111
132
  const styles: BrandPageCssStyle = {
112
133
  ...(this.viewModel?.styles?.backgroundStyles?.style || {}),
113
134
  };
@@ -139,7 +160,9 @@ export default defineComponent({
139
160
  styles.backgroundImage = `url(${this.viewModel?.styles?.backgroundStyles?.backgroundImageUrl})`;
140
161
 
141
162
  if (!this.context.isTemplate) {
163
+ styles.position = 'fixed';
142
164
  styles.width = '100%';
165
+ styles.height = '100%';
143
166
  }
144
167
 
145
168
  delete styles.background;
@@ -155,21 +178,6 @@ export default defineComponent({
155
178
  styles.backgroundAttachment = 'fixed';
156
179
  }
157
180
 
158
- Object.assign(styles, this.viewModel?.styles?.textStyles?.style);
159
-
160
- const textFontFamilyKey =
161
- this.viewModel.styles?.textStyles.textFontFamily ||
162
- DEFAULT_FONT_FAMILY_KEY;
163
-
164
- const textFontFamilyConfig = FONT_FAMILY_CONFIGS[textFontFamilyKey];
165
-
166
- if (textFontFamilyConfig) {
167
- styles.fontFamily = [
168
- `"${textFontFamilyConfig.name}"`,
169
- ...FALLBACK_FONT_FAMILIES,
170
- ].join(', ');
171
- }
172
-
173
181
  return styles;
174
182
  },
175
183
 
@@ -329,7 +337,10 @@ export default defineComponent({
329
337
  },
330
338
  },
331
339
  watch: {
332
- rootStyles() {
340
+ rootElementStyles() {
341
+ this.setRootStyles();
342
+ },
343
+ rootBackgroundStyles() {
333
344
  this.setRootStyles();
334
345
  },
335
346
  },
@@ -364,12 +375,19 @@ export default defineComponent({
364
375
  */
365
376
  setRootStyles() {
366
377
  if (this.context.isPreview) {
367
- this.$emit('on-set-preview-styles', this.rootStyles);
378
+ this.$emit(
379
+ 'on-set-preview-styles',
380
+ Object.assign({}, this.rootElementStyles, this.rootBackgroundStyles),
381
+ );
368
382
 
369
383
  return;
370
384
  }
371
385
 
372
- this.styles = Object.assign(this.styles, this.rootStyles);
386
+ this.styles = Object.assign(
387
+ this.styles,
388
+ this.rootElementStyles,
389
+ this.rootBackgroundStyles,
390
+ );
373
391
  },
374
392
  scrollToLastContent() {
375
393
  if (!this.contents.length) {
@@ -1,7 +1,8 @@
1
1
  <template>
2
+ <div class="brand-page-root-background" :style="rootBackgroundStyles" />
2
3
  <div
3
4
  class="brand-page-root"
4
- :style="styles"
5
+ :style="rootElementStyles"
5
6
  :data-test-device-type="
6
7
  typeof isMobileDevice !== 'undefined'
7
8
  ? isMobileDevice
@@ -164,7 +164,7 @@ export default defineComponent({
164
164
  : null;
165
165
 
166
166
  if (!this.containerStore.baseFabricRenderUrl) {
167
- throw new Error('base fabric render url is undefined');
167
+ // throw new Error('base fabric render url is undefined');
168
168
  }
169
169
 
170
170
  FabricRenderClient.setInstance({