@acoustte-digital-services/digitalstore-controls-dev 0.8.1-dev.20260328114717 → 0.8.1-dev.20260402052726

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/dist/index.js CHANGED
@@ -5251,17 +5251,13 @@ function generateCompleteBackgroundString(layers, apiBaseUrl) {
5251
5251
  return "";
5252
5252
  }).filter((bg) => bg.trim() !== "").join(", ");
5253
5253
  }
5254
- var generateCssString = (guid, stylesObject, mobileStylesObject) => {
5255
- {
5256
- }
5257
- const gridColumns = stylesObject.gridTemplateColumns ? stylesObject.gridTemplateColumns.match(/\d+/g) : [];
5258
- const hasGridProperties = gridColumns.length > 0;
5254
+ var generateCssString = (guid, stylesObject, tabletStylesObject, mobileStylesObject) => {
5255
+ const gridColumns = stylesObject?.gridTemplateColumns ? String(stylesObject.gridTemplateColumns).match(/\d+/g) ?? [] : [];
5256
+ const hasGridProperties = (gridColumns?.length ?? 0) > 0;
5259
5257
  const largeCols = hasGridProperties ? parseInt(gridColumns[0]) : 4;
5260
5258
  const tabletColumns = hasGridProperties ? Math.ceil(parseInt(gridColumns[0]) / 2) : 2;
5261
5259
  const mobileColumns = 1;
5262
- {
5263
- }
5264
- const cssRules = Object.entries(stylesObject).filter(([_, value]) => value !== void 0 && value !== "").map(([key, value]) => {
5260
+ const cssRules = Object.entries(stylesObject || {}).filter(([_, value]) => value !== void 0 && value !== "").map(([key, value]) => {
5265
5261
  const cssKey = key.replace(/([A-Z])/g, "-$1").toLowerCase();
5266
5262
  return `${cssKey}: ${value};`;
5267
5263
  });
@@ -5270,6 +5266,20 @@ ${cssRules.join(
5270
5266
  "\n"
5271
5267
  )}
5272
5268
  transition: all 0.3s ease-in-out; }`;
5269
+ if (tabletStylesObject) {
5270
+ const tabletCssRules = Object.entries(tabletStylesObject).filter(([_, value]) => value !== void 0 && value !== "").map(([key, value]) => {
5271
+ const cssKey = key.replace(/([A-Z])/g, "-$1").toLowerCase();
5272
+ return `${cssKey}: ${value};`;
5273
+ });
5274
+ if (tabletCssRules.length > 0) {
5275
+ css += `
5276
+ @media (max-width: 768px) {
5277
+ #${guid} {
5278
+ ${tabletCssRules.join("\n")}
5279
+ }
5280
+ }`;
5281
+ }
5282
+ }
5273
5283
  if (mobileStylesObject) {
5274
5284
  const mobileCssRules = Object.entries(mobileStylesObject).filter(([_, value]) => value !== void 0 && value !== "").map(([key, value]) => {
5275
5285
  const cssKey = key.replace(/([A-Z])/g, "-$1").toLowerCase();
@@ -5277,28 +5287,39 @@ ${cssRules.join(
5277
5287
  });
5278
5288
  if (mobileCssRules.length > 0) {
5279
5289
  css += `
5280
- @media (max-width: 480px) { #${guid} {
5281
- ${mobileCssRules.join(
5282
- "\n"
5283
- )}
5284
- } }`;
5290
+ @media (max-width: 480px) {
5291
+ #${guid} {
5292
+ ${mobileCssRules.join("\n")}
5293
+ }
5294
+ }`;
5285
5295
  }
5286
5296
  }
5287
5297
  if (hasGridProperties) {
5288
- css += `
5289
- @media (max-width: 1279px) { #${guid} { grid-template-columns: repeat(${tabletColumns}, minmax(0, 1fr)); } }`;
5290
- css += `
5291
- @media (max-width: 768px) { #${guid} { grid-template-columns: repeat(${tabletColumns}, minmax(0, 1fr)); } }`;
5292
- css += `
5293
- @media (max-width: 480px) { #${guid} { grid-template-columns: repeat(${mobileColumns}, minmax(0, 1fr)); } }`;
5298
+ const tabletHasGrid = tabletStylesObject?.gridTemplateColumns !== void 0;
5299
+ const mobileHasGrid = mobileStylesObject?.gridTemplateColumns !== void 0;
5300
+ if (!tabletHasGrid) {
5301
+ css += `
5302
+ @media (max-width: 768px) {
5303
+ #${guid} {
5304
+ grid-template-columns: repeat(${tabletColumns}, minmax(0, 1fr));
5305
+ }
5306
+ }`;
5307
+ }
5308
+ if (!mobileHasGrid) {
5309
+ css += `
5310
+ @media (max-width: 480px) {
5311
+ #${guid} {
5312
+ grid-template-columns: repeat(${mobileColumns}, minmax(0, 1fr));
5313
+ }
5314
+ }`;
5315
+ }
5294
5316
  }
5295
- const output = {
5317
+ return {
5296
5318
  css,
5297
5319
  gridColsLarge: largeCols,
5298
5320
  gridColsMedium: tabletColumns,
5299
5321
  gridColsSmall: mobileColumns
5300
5322
  };
5301
- return output;
5302
5323
  };
5303
5324
  var DivContainer = async (props) => {
5304
5325
  const NodeTypes2 = {
@@ -5319,6 +5340,7 @@ var DivContainer = async (props) => {
5319
5340
  };
5320
5341
  const styles = props.node.cssProperties;
5321
5342
  const mobileStyles = props.node.mobileCssProperties;
5343
+ const tabletStyles = props.node.tabletCssProperties;
5322
5344
  const dataBindingProperties = props.node.dataBinding;
5323
5345
  const updatedStyles = convertKeysToCamelCase(styles);
5324
5346
  const background = generateCompleteBackgroundString(props.node.backgroundLayers, props.assetBaseUrl);
@@ -5389,7 +5411,12 @@ var DivContainer = async (props) => {
5389
5411
  childCollectionData = getNestedValue2(props.dataitem, dataBindingProperties.childCollectionName);
5390
5412
  }
5391
5413
  }
5392
- const cssResult = generateCssString(guid, updatedStyle, mobileStyles);
5414
+ const cssResult = generateCssString(
5415
+ guid,
5416
+ updatedStyle,
5417
+ tabletStyles,
5418
+ mobileStyles
5419
+ );
5393
5420
  function renderNode(node, props2, dataitem, key, href) {
5394
5421
  {
5395
5422
  }
package/dist/index.mjs CHANGED
@@ -4283,17 +4283,13 @@ function generateCompleteBackgroundString(layers, apiBaseUrl) {
4283
4283
  return "";
4284
4284
  }).filter((bg) => bg.trim() !== "").join(", ");
4285
4285
  }
4286
- var generateCssString = (guid, stylesObject, mobileStylesObject) => {
4287
- {
4288
- }
4289
- const gridColumns = stylesObject.gridTemplateColumns ? stylesObject.gridTemplateColumns.match(/\d+/g) : [];
4290
- const hasGridProperties = gridColumns.length > 0;
4286
+ var generateCssString = (guid, stylesObject, tabletStylesObject, mobileStylesObject) => {
4287
+ const gridColumns = stylesObject?.gridTemplateColumns ? String(stylesObject.gridTemplateColumns).match(/\d+/g) ?? [] : [];
4288
+ const hasGridProperties = (gridColumns?.length ?? 0) > 0;
4291
4289
  const largeCols = hasGridProperties ? parseInt(gridColumns[0]) : 4;
4292
4290
  const tabletColumns = hasGridProperties ? Math.ceil(parseInt(gridColumns[0]) / 2) : 2;
4293
4291
  const mobileColumns = 1;
4294
- {
4295
- }
4296
- const cssRules = Object.entries(stylesObject).filter(([_, value]) => value !== void 0 && value !== "").map(([key, value]) => {
4292
+ const cssRules = Object.entries(stylesObject || {}).filter(([_, value]) => value !== void 0 && value !== "").map(([key, value]) => {
4297
4293
  const cssKey = key.replace(/([A-Z])/g, "-$1").toLowerCase();
4298
4294
  return `${cssKey}: ${value};`;
4299
4295
  });
@@ -4302,6 +4298,20 @@ ${cssRules.join(
4302
4298
  "\n"
4303
4299
  )}
4304
4300
  transition: all 0.3s ease-in-out; }`;
4301
+ if (tabletStylesObject) {
4302
+ const tabletCssRules = Object.entries(tabletStylesObject).filter(([_, value]) => value !== void 0 && value !== "").map(([key, value]) => {
4303
+ const cssKey = key.replace(/([A-Z])/g, "-$1").toLowerCase();
4304
+ return `${cssKey}: ${value};`;
4305
+ });
4306
+ if (tabletCssRules.length > 0) {
4307
+ css += `
4308
+ @media (max-width: 768px) {
4309
+ #${guid} {
4310
+ ${tabletCssRules.join("\n")}
4311
+ }
4312
+ }`;
4313
+ }
4314
+ }
4305
4315
  if (mobileStylesObject) {
4306
4316
  const mobileCssRules = Object.entries(mobileStylesObject).filter(([_, value]) => value !== void 0 && value !== "").map(([key, value]) => {
4307
4317
  const cssKey = key.replace(/([A-Z])/g, "-$1").toLowerCase();
@@ -4309,28 +4319,39 @@ ${cssRules.join(
4309
4319
  });
4310
4320
  if (mobileCssRules.length > 0) {
4311
4321
  css += `
4312
- @media (max-width: 480px) { #${guid} {
4313
- ${mobileCssRules.join(
4314
- "\n"
4315
- )}
4316
- } }`;
4322
+ @media (max-width: 480px) {
4323
+ #${guid} {
4324
+ ${mobileCssRules.join("\n")}
4325
+ }
4326
+ }`;
4317
4327
  }
4318
4328
  }
4319
4329
  if (hasGridProperties) {
4320
- css += `
4321
- @media (max-width: 1279px) { #${guid} { grid-template-columns: repeat(${tabletColumns}, minmax(0, 1fr)); } }`;
4322
- css += `
4323
- @media (max-width: 768px) { #${guid} { grid-template-columns: repeat(${tabletColumns}, minmax(0, 1fr)); } }`;
4324
- css += `
4325
- @media (max-width: 480px) { #${guid} { grid-template-columns: repeat(${mobileColumns}, minmax(0, 1fr)); } }`;
4330
+ const tabletHasGrid = tabletStylesObject?.gridTemplateColumns !== void 0;
4331
+ const mobileHasGrid = mobileStylesObject?.gridTemplateColumns !== void 0;
4332
+ if (!tabletHasGrid) {
4333
+ css += `
4334
+ @media (max-width: 768px) {
4335
+ #${guid} {
4336
+ grid-template-columns: repeat(${tabletColumns}, minmax(0, 1fr));
4337
+ }
4338
+ }`;
4339
+ }
4340
+ if (!mobileHasGrid) {
4341
+ css += `
4342
+ @media (max-width: 480px) {
4343
+ #${guid} {
4344
+ grid-template-columns: repeat(${mobileColumns}, minmax(0, 1fr));
4345
+ }
4346
+ }`;
4347
+ }
4326
4348
  }
4327
- const output = {
4349
+ return {
4328
4350
  css,
4329
4351
  gridColsLarge: largeCols,
4330
4352
  gridColsMedium: tabletColumns,
4331
4353
  gridColsSmall: mobileColumns
4332
4354
  };
4333
- return output;
4334
4355
  };
4335
4356
  var DivContainer = async (props) => {
4336
4357
  const NodeTypes2 = {
@@ -4351,6 +4372,7 @@ var DivContainer = async (props) => {
4351
4372
  };
4352
4373
  const styles = props.node.cssProperties;
4353
4374
  const mobileStyles = props.node.mobileCssProperties;
4375
+ const tabletStyles = props.node.tabletCssProperties;
4354
4376
  const dataBindingProperties = props.node.dataBinding;
4355
4377
  const updatedStyles = convertKeysToCamelCase(styles);
4356
4378
  const background = generateCompleteBackgroundString(props.node.backgroundLayers, props.assetBaseUrl);
@@ -4421,7 +4443,12 @@ var DivContainer = async (props) => {
4421
4443
  childCollectionData = getNestedValue2(props.dataitem, dataBindingProperties.childCollectionName);
4422
4444
  }
4423
4445
  }
4424
- const cssResult = generateCssString(guid, updatedStyle, mobileStyles);
4446
+ const cssResult = generateCssString(
4447
+ guid,
4448
+ updatedStyle,
4449
+ tabletStyles,
4450
+ mobileStyles
4451
+ );
4425
4452
  function renderNode(node, props2, dataitem, key, href) {
4426
4453
  {
4427
4454
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@acoustte-digital-services/digitalstore-controls-dev",
3
- "version": "0.8.1-dev.20260328114717",
3
+ "version": "0.8.1-dev.20260402052726",
4
4
  "description": "Reusable React components",
5
5
  "main": "dist/index.js",
6
6
  "module": "dist/index.mjs",