@designcrowd/library.brand-page 5.12.11 → 5.12.12

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.
@@ -1,5 +1,5 @@
1
1
  import { createElementBlock as e, openBlock as l, createStaticVNode as a } from "vue";
2
- import { _ as t } from "./lib-CjyTfIxl.js";
2
+ import { _ as t } from "./lib-B_V63NKc.js";
3
3
  const i = {}, h = {
4
4
  width: "275",
5
5
  height: "36",
@@ -1,5 +1,5 @@
1
1
  import { createElementBlock as e, openBlock as l, createStaticVNode as a } from "vue";
2
- import { _ as t } from "./lib-CjyTfIxl.js";
2
+ import { _ as t } from "./lib-B_V63NKc.js";
3
3
  const i = {}, h = {
4
4
  width: "251",
5
5
  height: "36",
@@ -1,5 +1,5 @@
1
1
  import { createElementBlock as e, openBlock as l, createStaticVNode as a } from "vue";
2
- import { _ as t } from "./lib-CjyTfIxl.js";
2
+ import { _ as t } from "./lib-B_V63NKc.js";
3
3
  const i = {}, h = {
4
4
  width: "250",
5
5
  height: "36",
@@ -1,5 +1,5 @@
1
1
  import { createElementBlock as e, openBlock as l, createStaticVNode as a } from "vue";
2
- import { _ as t } from "./lib-CjyTfIxl.js";
2
+ import { _ as t } from "./lib-B_V63NKc.js";
3
3
  const i = {}, h = {
4
4
  width: "237",
5
5
  height: "36",
@@ -1,5 +1,5 @@
1
1
  import { createElementBlock as e, openBlock as l, createStaticVNode as a } from "vue";
2
- import { _ as t } from "./lib-CjyTfIxl.js";
2
+ import { _ as t } from "./lib-B_V63NKc.js";
3
3
  const i = {}, h = {
4
4
  width: "263",
5
5
  height: "36",
@@ -1,5 +1,5 @@
1
1
  import { createElementBlock as H, openBlock as V, createStaticVNode as t } from "vue";
2
- import { _ as e } from "./lib-CjyTfIxl.js";
2
+ import { _ as e } from "./lib-B_V63NKc.js";
3
3
  const M = {}, Z = {
4
4
  width: "242",
5
5
  height: "36",
@@ -1,5 +1,5 @@
1
1
  import { createElementBlock as H, openBlock as V, createStaticVNode as t } from "vue";
2
- import { _ as e } from "./lib-CjyTfIxl.js";
2
+ import { _ as e } from "./lib-B_V63NKc.js";
3
3
  const i = {}, M = {
4
4
  width: "231",
5
5
  height: "36",
@@ -1,5 +1,5 @@
1
1
  import { createElementBlock as H, openBlock as V, createStaticVNode as t } from "vue";
2
- import { _ as e } from "./lib-CjyTfIxl.js";
2
+ import { _ as e } from "./lib-B_V63NKc.js";
3
3
  const M = {}, Z = {
4
4
  width: "230",
5
5
  height: "36",
@@ -1,5 +1,5 @@
1
1
  import { createElementBlock as H, openBlock as V, createStaticVNode as t } from "vue";
2
- import { _ as e } from "./lib-CjyTfIxl.js";
2
+ import { _ as e } from "./lib-B_V63NKc.js";
3
3
  const i = {}, l = {
4
4
  width: "216",
5
5
  height: "36",
@@ -1,5 +1,5 @@
1
1
  import { createElementBlock as H, openBlock as V, createStaticVNode as t } from "vue";
2
- import { _ as M } from "./lib-CjyTfIxl.js";
2
+ import { _ as M } from "./lib-B_V63NKc.js";
3
3
  const Z = {}, e = {
4
4
  width: "232",
5
5
  height: "36",
@@ -9,6 +9,8 @@ declare const _default: import("vue").DefineComponent<import("vue").ExtractPropT
9
9
  svgData: string;
10
10
  svgDataObjectUrl: string;
11
11
  originalSvgData: string;
12
+ svgWidth: number;
13
+ svgHeight: number;
12
14
  }, {
13
15
  useObjectElement(): boolean;
14
16
  backgroundShapesStyle(): BrandPageCssStyle;
@@ -17,6 +19,7 @@ declare const _default: import("vue").DefineComponent<import("vue").ExtractPropT
17
19
  }, {
18
20
  isValidSvgUrl(url: string): boolean;
19
21
  applySvgAttributes(svgData: string): string;
22
+ setInternalSvgWidthAndHeight(svgData: string): void;
20
23
  render(): Promise<void>;
21
24
  }, import("vue").DefineComponent<import("vue").ExtractPropTypes<{
22
25
  isPreview: {
@@ -18,14 +18,25 @@ export default defineComponent({
18
18
  },
19
19
  },
20
20
  data() {
21
- return { svgData: '', svgDataObjectUrl: '', originalSvgData: '' };
21
+ return {
22
+ svgData: '',
23
+ svgDataObjectUrl: '',
24
+ originalSvgData: '',
25
+ svgWidth: 0,
26
+ svgHeight: 0,
27
+ };
22
28
  },
23
29
  computed: {
24
30
  useObjectElement() {
25
31
  return !!this.viewModel?.name.match(PROXY_SHAPE_URL_REGEX);
26
32
  },
27
33
  backgroundShapesStyle() {
28
- return this.viewModel?.style || {};
34
+ const style = this.viewModel?.style || {};
35
+ if (!style.width && !style.height && this.svgWidth && this.svgHeight) {
36
+ style.width = this.svgWidth;
37
+ style.height = this.svgHeight;
38
+ }
39
+ return style;
29
40
  },
30
41
  isFullBackground() {
31
42
  return (this.viewModel.style.width === '100%' &&
@@ -91,6 +102,25 @@ export default defineComponent({
91
102
  }
92
103
  return svgData;
93
104
  },
105
+ setInternalSvgWidthAndHeight(svgData) {
106
+ const svgTagMatch = svgData.match(/<svg\b[^>]*>/i);
107
+ if (svgTagMatch) {
108
+ const svgTagSection = svgTagMatch[0];
109
+ const widthHeightMatches = svgTagSection.match(/\b(width|height)\s*=\s*(?:"([^"]*)"|'([^']*)'|([^\s>]+))/gi);
110
+ if (widthHeightMatches) {
111
+ const widthMatch = widthHeightMatches.find((match) => match.startsWith('width='));
112
+ const widthValue = widthMatch?.match(/([^"]*)/g)?.[2];
113
+ const heightMatch = widthHeightMatches.find((match) => match.startsWith('height='));
114
+ const heightValue = heightMatch?.match(/([^"]*)/g)?.[2];
115
+ if (widthValue && !widthValue.endsWith('%')) {
116
+ this.svgWidth = `${widthValue}px`;
117
+ }
118
+ if (heightValue && !heightValue.endsWith('%')) {
119
+ this.svgHeight = `${heightValue}px`;
120
+ }
121
+ }
122
+ }
123
+ },
94
124
  async render() {
95
125
  if (this.useObjectElement) {
96
126
  return;
@@ -111,6 +141,7 @@ export default defineComponent({
111
141
  this.svgData = this.originalSvgData;
112
142
  }
113
143
  this.svgData = this.applySvgAttributes(this.svgData);
144
+ this.setInternalSvgWidthAndHeight(this.svgData);
114
145
  const blob = new Blob([this.svgData], { type: 'image/svg+xml' });
115
146
  const oldSvgDataObjectUrl = this.svgDataObjectUrl;
116
147
  // Create an Object URL
package/lib/src/index.mjs CHANGED
@@ -1,4 +1,4 @@
1
- import { bw as E, an as T, aP as I, a3 as N, ag as S, ad as s, bo as A, c3 as e, c2 as O, c1 as G, bX as C, aZ as D, aY as P, bH as R, bI as t, bP as L, bE as M, bG as o, bF as b, bJ as r, bK as F, bW as n, bU as B, am as g, bV as l, a6 as i, aU as Y, aW as U, aV as d, e as c, f as H, B as u, Y as y, d as p, Z as K, j as k, aj as V, X, bn as m, bD as v, at as h, aR as W, aN as x, bS as f, bR as Z, C as w, b0 as z, D as Q, b as j, a as q, bN as J, a$ as $, aS as aa, aO as _a, b$ as Ea, c0 as Ta, bQ as Ia, bA as Na, ab as Sa, bT as sa, bY as Aa, b5 as ea, aF as Oa, bb as Ga, F as Ca, a5 as Da, a4 as Pa, h as Ra, $ as ta, b2 as La, aQ as Ma, aM as oa, a1 as ba, G as ra, I as Fa, H as na, a7 as Ba, bx as ga, b6 as la, b7 as ia, bv as Ya, bd as Ua, bf as da, b1 as ca, L as Ha, aE as ua, bk as ya, aK as pa, bj as Ka, ao as ka, a9 as Va, bO as Xa, bZ as ma, b_ as va, aT as ha, N as Wa, aw as xa, av as fa, ax as Za, ar as wa, as as za, au as Qa, b9 as ja, bg as qa, b3 as Ja, n as $a, ah as a_, ai as __, ae as E_, af as T_, ac as I_, a2 as N_, l as S_, bl as s_, al as A_, bB as e_, bC as O_, bM as G_, aa as C_, bz as D_, bm as P_, m as R_, S as t_, P as L_, aD as M_, by as o_, ba as b_, br as r_, bp as F_, bt as n_, bu as B_, bq as g_, bs as l_, ay as i_, az as Y_, bi as U_, bh as d_, bc as c_, aB as H_, aC as u_, aH as y_, aX as p_, aG as K_, aI as k_, U as V_, a8 as X_, aL as m_, k as v_, b8 as h_, ak as W_, b4 as x_, be as f_, a_ as Z_, M as w_, a0 as z_, g as Q_, bL as j_, q as q_, J as J_, W as $_, aA as aE, aJ as _E, ap as EE, o as TE, T as IE, r as NE, u as SE, i as sE, aq as AE, c as eE, p as OE, t as GE, R as CE, K as DE, s as PE, V as RE, y as tE, v as LE, w as ME, Q as oE, z as bE, O as rE, A as FE, E as nE, x as BE } from "./lib-CjyTfIxl.js";
1
+ import { bw as E, an as T, aP as I, a3 as N, ag as S, ad as s, bo as A, c3 as e, c2 as O, c1 as G, bX as C, aZ as D, aY as P, bH as R, bI as t, bP as L, bE as M, bG as o, bF as b, bJ as r, bK as F, bW as n, bU as B, am as g, bV as l, a6 as i, aU as Y, aW as U, aV as d, e as c, f as H, B as u, Y as y, d as p, Z as K, j as k, aj as V, X, bn as m, bD as v, at as h, aR as W, aN as x, bS as f, bR as Z, C as w, b0 as z, D as Q, b as j, a as q, bN as J, a$ as $, aS as aa, aO as _a, b$ as Ea, c0 as Ta, bQ as Ia, bA as Na, ab as Sa, bT as sa, bY as Aa, b5 as ea, aF as Oa, bb as Ga, F as Ca, a5 as Da, a4 as Pa, h as Ra, $ as ta, b2 as La, aQ as Ma, aM as oa, a1 as ba, G as ra, I as Fa, H as na, a7 as Ba, bx as ga, b6 as la, b7 as ia, bv as Ya, bd as Ua, bf as da, b1 as ca, L as Ha, aE as ua, bk as ya, aK as pa, bj as Ka, ao as ka, a9 as Va, bO as Xa, bZ as ma, b_ as va, aT as ha, N as Wa, aw as xa, av as fa, ax as Za, ar as wa, as as za, au as Qa, b9 as ja, bg as qa, b3 as Ja, n as $a, ah as a_, ai as __, ae as E_, af as T_, ac as I_, a2 as N_, l as S_, bl as s_, al as A_, bB as e_, bC as O_, bM as G_, aa as C_, bz as D_, bm as P_, m as R_, S as t_, P as L_, aD as M_, by as o_, ba as b_, br as r_, bp as F_, bt as n_, bu as B_, bq as g_, bs as l_, ay as i_, az as Y_, bi as U_, bh as d_, bc as c_, aB as H_, aC as u_, aH as y_, aX as p_, aG as K_, aI as k_, U as V_, a8 as X_, aL as m_, k as v_, b8 as h_, ak as W_, b4 as x_, be as f_, a_ as Z_, M as w_, a0 as z_, g as Q_, bL as j_, q as q_, J as J_, W as $_, aA as aE, aJ as _E, ap as EE, o as TE, T as IE, r as NE, u as SE, i as sE, aq as AE, c as eE, p as OE, t as GE, R as CE, K as DE, s as PE, V as RE, y as tE, v as LE, w as ME, Q as oE, z as bE, O as rE, A as FE, E as nE, x as BE } from "./lib-B_V63NKc.js";
2
2
  import { createPinia as lE, setActivePinia as iE } from "pinia";
3
3
  export {
4
4
  E as ABOUT_SECTION_SETTINGS_CONFIG,
@@ -56982,10 +56982,10 @@ const q0 = /* @__PURE__ */ $6(FM1), UM1 = (e, t, n) => {
56982
56982
  Yt(() => n.context.isDesignCom, async () => {
56983
56983
  const S = mn().toLowerCase(), M = n.context.isDesignCom ? "Dcom" : "BrandCrowd";
56984
56984
  try {
56985
- const { default: T } = await y_(/* @__PURE__ */ Object.assign({ "./watermark/CreatedOnBrandCrowd-de-de.vue": () => import("./CreatedOnBrandCrowd-de-de-B1UmWzii.js"), "./watermark/CreatedOnBrandCrowd-en-us.vue": () => import("./CreatedOnBrandCrowd-en-us-BRK1hM-D.js"), "./watermark/CreatedOnBrandCrowd-es-es.vue": () => import("./CreatedOnBrandCrowd-es-es-CN_2N7lq.js"), "./watermark/CreatedOnBrandCrowd-fr-fr.vue": () => import("./CreatedOnBrandCrowd-fr-fr-BLLKZAU4.js"), "./watermark/CreatedOnBrandCrowd-pt-pt.vue": () => import("./CreatedOnBrandCrowd-pt-pt-Btsu98RA.js"), "./watermark/CreatedOnDcom-de-de.vue": () => import("./CreatedOnDcom-de-de-t1layjdN.js"), "./watermark/CreatedOnDcom-en-us.vue": () => import("./CreatedOnDcom-en-us-Cgr8OWqD.js"), "./watermark/CreatedOnDcom-es-es.vue": () => import("./CreatedOnDcom-es-es-BU30p1A3.js"), "./watermark/CreatedOnDcom-fr-fr.vue": () => import("./CreatedOnDcom-fr-fr-0WKXggE1.js"), "./watermark/CreatedOnDcom-pt-pt.vue": () => import("./CreatedOnDcom-pt-pt-DugorNKz.js") }), `./watermark/CreatedOn${M}-${S}.vue`, 3);
56985
+ const { default: T } = await y_(/* @__PURE__ */ Object.assign({ "./watermark/CreatedOnBrandCrowd-de-de.vue": () => import("./CreatedOnBrandCrowd-de-de-0XSNG_9q.js"), "./watermark/CreatedOnBrandCrowd-en-us.vue": () => import("./CreatedOnBrandCrowd-en-us-1HABXAj7.js"), "./watermark/CreatedOnBrandCrowd-es-es.vue": () => import("./CreatedOnBrandCrowd-es-es--pYO9W0D.js"), "./watermark/CreatedOnBrandCrowd-fr-fr.vue": () => import("./CreatedOnBrandCrowd-fr-fr-cP_ha4PV.js"), "./watermark/CreatedOnBrandCrowd-pt-pt.vue": () => import("./CreatedOnBrandCrowd-pt-pt-5U4thKFb.js"), "./watermark/CreatedOnDcom-de-de.vue": () => import("./CreatedOnDcom-de-de-dX6nMjfK.js"), "./watermark/CreatedOnDcom-en-us.vue": () => import("./CreatedOnDcom-en-us-CldjK0EC.js"), "./watermark/CreatedOnDcom-es-es.vue": () => import("./CreatedOnDcom-es-es-DhMbR7A4.js"), "./watermark/CreatedOnDcom-fr-fr.vue": () => import("./CreatedOnDcom-fr-fr-CsY16ori.js"), "./watermark/CreatedOnDcom-pt-pt.vue": () => import("./CreatedOnDcom-pt-pt-B0PDKMsQ.js") }), `./watermark/CreatedOn${M}-${S}.vue`, 3);
56986
56986
  i.value = T;
56987
56987
  } catch {
56988
- const { default: E } = await y_(/* @__PURE__ */ Object.assign({ "./watermark/CreatedOnBrandCrowd-en-us.vue": () => import("./CreatedOnBrandCrowd-en-us-BRK1hM-D.js"), "./watermark/CreatedOnDcom-en-us.vue": () => import("./CreatedOnDcom-en-us-Cgr8OWqD.js") }), `./watermark/CreatedOn${M}-en-us.vue`, 3);
56988
+ const { default: E } = await y_(/* @__PURE__ */ Object.assign({ "./watermark/CreatedOnBrandCrowd-en-us.vue": () => import("./CreatedOnBrandCrowd-en-us-1HABXAj7.js"), "./watermark/CreatedOnDcom-en-us.vue": () => import("./CreatedOnDcom-en-us-CldjK0EC.js") }), `./watermark/CreatedOn${M}-en-us.vue`, 3);
56989
56989
  i.value = E;
56990
56990
  }
56991
56991
  }, {
@@ -57365,7 +57365,13 @@ const Ck1 = /* @__PURE__ */ v(dk1, [["render", uk1]]), Ef = /* @__PURE__ */ t1({
57365
57365
  }
57366
57366
  },
57367
57367
  data() {
57368
- return { svgData: "", svgDataObjectUrl: "", originalSvgData: "" };
57368
+ return {
57369
+ svgData: "",
57370
+ svgDataObjectUrl: "",
57371
+ originalSvgData: "",
57372
+ svgWidth: 0,
57373
+ svgHeight: 0
57374
+ };
57369
57375
  },
57370
57376
  computed: {
57371
57377
  useObjectElement() {
@@ -57373,8 +57379,9 @@ const Ck1 = /* @__PURE__ */ v(dk1, [["render", uk1]]), Ef = /* @__PURE__ */ t1({
57373
57379
  return !!((e = this.viewModel) != null && e.name.match(KT));
57374
57380
  },
57375
57381
  backgroundShapesStyle() {
57376
- var e;
57377
- return ((e = this.viewModel) == null ? void 0 : e.style) || {};
57382
+ var t;
57383
+ const e = ((t = this.viewModel) == null ? void 0 : t.style) || {};
57384
+ return !e.width && !e.height && this.svgWidth && this.svgHeight && (e.width = this.svgWidth, e.height = this.svgHeight), e;
57378
57385
  },
57379
57386
  isFullBackground() {
57380
57387
  return this.viewModel.style.width === "100%" && this.viewModel.style.height === "100%";
@@ -57419,6 +57426,23 @@ const Ck1 = /* @__PURE__ */ v(dk1, [["render", uk1]]), Ef = /* @__PURE__ */ t1({
57419
57426
  const n = t.join(" ");
57420
57427
  return n && (e = e.replace("<svg ", `<svg ${n} `)), e;
57421
57428
  },
57429
+ setInternalSvgWidthAndHeight(e) {
57430
+ var n, i;
57431
+ const t = e.match(/<svg\b[^>]*>/i);
57432
+ if (t) {
57433
+ const s = t[0].match(
57434
+ /\b(width|height)\s*=\s*(?:"([^"]*)"|'([^']*)'|([^\s>]+))/gi
57435
+ );
57436
+ if (s) {
57437
+ const o = s.find(
57438
+ (c) => c.startsWith("width=")
57439
+ ), a = (n = o == null ? void 0 : o.match(/([^"]*)/g)) == null ? void 0 : n[2], l = s.find(
57440
+ (c) => c.startsWith("height=")
57441
+ ), d = (i = l == null ? void 0 : l.match(/([^"]*)/g)) == null ? void 0 : i[2];
57442
+ a && !a.endsWith("%") && (this.svgWidth = `${a}px`), d && !d.endsWith("%") && (this.svgHeight = `${d}px`);
57443
+ }
57444
+ }
57445
+ },
57422
57446
  async render() {
57423
57447
  if (this.useObjectElement)
57424
57448
  return;
@@ -57431,7 +57455,7 @@ const Ck1 = /* @__PURE__ */ v(dk1, [["render", uk1]]), Ef = /* @__PURE__ */ t1({
57431
57455
  this.viewModel.style.color ? this.svgData = sf1(
57432
57456
  this.originalSvgData,
57433
57457
  this.viewModel.style.color
57434
- ) : this.svgData = this.originalSvgData, this.svgData = this.applySvgAttributes(this.svgData);
57458
+ ) : this.svgData = this.originalSvgData, this.svgData = this.applySvgAttributes(this.svgData), this.setInternalSvgWidthAndHeight(this.svgData);
57435
57459
  const e = new Blob([this.svgData], { type: "image/svg+xml" }), t = this.svgDataObjectUrl;
57436
57460
  this.svgDataObjectUrl = URL.createObjectURL(e), t && URL.revokeObjectURL(t);
57437
57461
  }
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.12.11",
4
+ "version": "5.12.12",
5
5
  "author": "Design.com Eng",
6
6
  "license": "UNLICENSED",
7
7
  "type": "module",
@@ -22,7 +22,13 @@ export default defineComponent({
22
22
  },
23
23
  },
24
24
  data() {
25
- return { svgData: '', svgDataObjectUrl: '', originalSvgData: '' };
25
+ return {
26
+ svgData: '',
27
+ svgDataObjectUrl: '',
28
+ originalSvgData: '',
29
+ svgWidth: 0,
30
+ svgHeight: 0,
31
+ };
26
32
  },
27
33
  computed: {
28
34
  useObjectElement(): boolean {
@@ -30,7 +36,14 @@ export default defineComponent({
30
36
  },
31
37
 
32
38
  backgroundShapesStyle(): BrandPageCssStyle {
33
- return this.viewModel?.style || {};
39
+ const style = this.viewModel?.style || {};
40
+
41
+ if (!style.width && !style.height && this.svgWidth && this.svgHeight) {
42
+ style.width = this.svgWidth;
43
+ style.height = this.svgHeight;
44
+ }
45
+
46
+ return style;
34
47
  },
35
48
 
36
49
  isFullBackground(): boolean {
@@ -115,6 +128,40 @@ export default defineComponent({
115
128
  return svgData;
116
129
  },
117
130
 
131
+ setInternalSvgWidthAndHeight(svgData: string): void {
132
+ const svgTagMatch = svgData.match(/<svg\b[^>]*>/i);
133
+
134
+ if (svgTagMatch) {
135
+ const svgTagSection = svgTagMatch[0];
136
+
137
+ const widthHeightMatches = svgTagSection.match(
138
+ /\b(width|height)\s*=\s*(?:"([^"]*)"|'([^']*)'|([^\s>]+))/gi,
139
+ );
140
+
141
+ if (widthHeightMatches) {
142
+ const widthMatch = widthHeightMatches.find((match) =>
143
+ match.startsWith('width='),
144
+ );
145
+
146
+ const widthValue = widthMatch?.match(/([^"]*)/g)?.[2];
147
+
148
+ const heightMatch = widthHeightMatches.find((match) =>
149
+ match.startsWith('height='),
150
+ );
151
+
152
+ const heightValue = heightMatch?.match(/([^"]*)/g)?.[2];
153
+
154
+ if (widthValue && !widthValue.endsWith('%')) {
155
+ this.svgWidth = `${widthValue}px`;
156
+ }
157
+
158
+ if (heightValue && !heightValue.endsWith('%')) {
159
+ this.svgHeight = `${heightValue}px`;
160
+ }
161
+ }
162
+ }
163
+ },
164
+
118
165
  async render() {
119
166
  if (this.useObjectElement) {
120
167
  return;
@@ -143,6 +190,8 @@ export default defineComponent({
143
190
 
144
191
  this.svgData = this.applySvgAttributes(this.svgData);
145
192
 
193
+ this.setInternalSvgWidthAndHeight(this.svgData);
194
+
146
195
  const blob = new Blob([this.svgData], { type: 'image/svg+xml' });
147
196
 
148
197
  const oldSvgDataObjectUrl = this.svgDataObjectUrl;