@clyrex-digital/clyrex-controls-dev 0.8.1-dev.20261003110136 → 0.8.1-dev.20261006100546

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
@@ -7880,7 +7880,9 @@ var import_jsx_runtime60 = require("react/jsx-runtime");
7880
7880
  var TextNode = (props) => {
7881
7881
  function cssStringToJson(cssString) {
7882
7882
  const styleObject = {};
7883
- const matches = cssString?.match(/([\w-]+)\s*:\s*([^;]+)\s*;/g);
7883
+ if (!cssString || typeof cssString !== "string") return styleObject;
7884
+ const normalized = cssString.trim().endsWith(";") ? cssString.trim() : `${cssString.trim()};`;
7885
+ const matches = normalized.match(/([\w-]+)\s*:\s*([^;]+)\s*;/g);
7884
7886
  if (matches) {
7885
7887
  matches.forEach((match) => {
7886
7888
  const parts = match.match(/([\w-]+)\s*:\s*([^;]+)\s*;/);
@@ -8261,7 +8263,9 @@ function getNestedProperty(obj, path) {
8261
8263
  var DatafieldNode = (props) => {
8262
8264
  function cssStringToJson(cssString) {
8263
8265
  const styleObject = {};
8264
- const matches = cssString?.match(/([\w-]+)\s*:\s*([^;]+)\s*;/g);
8266
+ if (!cssString || typeof cssString !== "string") return styleObject;
8267
+ const normalized = cssString.trim().endsWith(";") ? cssString.trim() : `${cssString.trim()};`;
8268
+ const matches = normalized.match(/([\w-]+)\s*:\s*([^;]+)\s*;/g);
8265
8269
  if (matches) {
8266
8270
  matches.forEach((match) => {
8267
8271
  const parts = match.match(/([\w-]+)\s*:\s*([^;]+)\s*;/);
@@ -9864,6 +9868,14 @@ var Slider2 = (0, import_dynamic15.default)(() => Promise.resolve().then(() => (
9864
9868
  function toCamelCase(str) {
9865
9869
  return str.replace(/-([a-z])/g, (_, letter) => letter.toUpperCase());
9866
9870
  }
9871
+ function hasRepeatedContainer(node) {
9872
+ if (!node || typeof node !== "object") return false;
9873
+ const container = node;
9874
+ if (container.type === "div-container" && (container.repeatForEachItem === true || container.replicate === true)) {
9875
+ return true;
9876
+ }
9877
+ return Array.isArray(container.children) && container.children.some(hasRepeatedContainer);
9878
+ }
9867
9879
  function convertKeysToCamelCase(obj) {
9868
9880
  if (!obj || typeof obj !== "object") return obj;
9869
9881
  if (Array.isArray(obj)) return obj.map(convertKeysToCamelCase);
@@ -10184,7 +10196,7 @@ var DivContainer = async (props) => {
10184
10196
  return dataItem[key] !== void 0 ? dataItem[key] : match;
10185
10197
  });
10186
10198
  }
10187
- const arrayResult = Array.isArray(result) ? result : null;
10199
+ const arrayResult = Array.isArray(result) ? result : !dataSource && Array.isArray(props.dataitem) ? props.dataitem : null;
10188
10200
  const hasReplicatedChildren = Boolean(
10189
10201
  props.node.children?.some(
10190
10202
  (node) => node?.type === "div-container" && (node?.repeatForEachItem === true || node?.replicate === true)
@@ -10220,9 +10232,22 @@ var DivContainer = async (props) => {
10220
10232
  const renderContainerChildren = () => {
10221
10233
  if (!hasReplicatedChildren) {
10222
10234
  if (Array.isArray(arrayResult)) {
10223
- return props.node.children.flatMap(
10224
- (node, childIndex) => node?.type === "div-container" ? [] : [renderNode(node, props, props.dataitem, `static-${childIndex}`)]
10225
- );
10235
+ return props.node.children.flatMap((node, childIndex) => {
10236
+ if (node.type !== "div-container") {
10237
+ return [
10238
+ renderNode(node, props, props.dataitem, `static-${childIndex}`)
10239
+ ];
10240
+ }
10241
+ const containsRepeater = node.children.some(hasRepeatedContainer);
10242
+ return [
10243
+ renderNode(
10244
+ node,
10245
+ props,
10246
+ containsRepeater ? arrayResult : props.dataitem,
10247
+ `${containsRepeater ? "nested-repeater" : "static"}-${childIndex}`
10248
+ )
10249
+ ];
10250
+ });
10226
10251
  }
10227
10252
  return dataToRender.map(
10228
10253
  (item, idx) => item?.links?.view && renderLink ? renderChildren2(
package/dist/index.mjs CHANGED
@@ -479,7 +479,9 @@ import { jsx as jsx16, jsxs as jsxs6 } from "react/jsx-runtime";
479
479
  var TextNode = (props) => {
480
480
  function cssStringToJson(cssString) {
481
481
  const styleObject = {};
482
- const matches = cssString?.match(/([\w-]+)\s*:\s*([^;]+)\s*;/g);
482
+ if (!cssString || typeof cssString !== "string") return styleObject;
483
+ const normalized = cssString.trim().endsWith(";") ? cssString.trim() : `${cssString.trim()};`;
484
+ const matches = normalized.match(/([\w-]+)\s*:\s*([^;]+)\s*;/g);
483
485
  if (matches) {
484
486
  matches.forEach((match) => {
485
487
  const parts = match.match(/([\w-]+)\s*:\s*([^;]+)\s*;/);
@@ -857,7 +859,9 @@ function getNestedProperty(obj, path) {
857
859
  var DatafieldNode = (props) => {
858
860
  function cssStringToJson(cssString) {
859
861
  const styleObject = {};
860
- const matches = cssString?.match(/([\w-]+)\s*:\s*([^;]+)\s*;/g);
862
+ if (!cssString || typeof cssString !== "string") return styleObject;
863
+ const normalized = cssString.trim().endsWith(";") ? cssString.trim() : `${cssString.trim()};`;
864
+ const matches = normalized.match(/([\w-]+)\s*:\s*([^;]+)\s*;/g);
861
865
  if (matches) {
862
866
  matches.forEach((match) => {
863
867
  const parts = match.match(/([\w-]+)\s*:\s*([^;]+)\s*;/);
@@ -2451,6 +2455,14 @@ var Slider = dynamic15(() => import("./Slider-42T6THEQ.mjs"), {
2451
2455
  function toCamelCase(str) {
2452
2456
  return str.replace(/-([a-z])/g, (_, letter) => letter.toUpperCase());
2453
2457
  }
2458
+ function hasRepeatedContainer(node) {
2459
+ if (!node || typeof node !== "object") return false;
2460
+ const container = node;
2461
+ if (container.type === "div-container" && (container.repeatForEachItem === true || container.replicate === true)) {
2462
+ return true;
2463
+ }
2464
+ return Array.isArray(container.children) && container.children.some(hasRepeatedContainer);
2465
+ }
2454
2466
  function convertKeysToCamelCase(obj) {
2455
2467
  if (!obj || typeof obj !== "object") return obj;
2456
2468
  if (Array.isArray(obj)) return obj.map(convertKeysToCamelCase);
@@ -2771,7 +2783,7 @@ var DivContainer = async (props) => {
2771
2783
  return dataItem[key] !== void 0 ? dataItem[key] : match;
2772
2784
  });
2773
2785
  }
2774
- const arrayResult = Array.isArray(result) ? result : null;
2786
+ const arrayResult = Array.isArray(result) ? result : !dataSource && Array.isArray(props.dataitem) ? props.dataitem : null;
2775
2787
  const hasReplicatedChildren = Boolean(
2776
2788
  props.node.children?.some(
2777
2789
  (node) => node?.type === "div-container" && (node?.repeatForEachItem === true || node?.replicate === true)
@@ -2807,9 +2819,22 @@ var DivContainer = async (props) => {
2807
2819
  const renderContainerChildren = () => {
2808
2820
  if (!hasReplicatedChildren) {
2809
2821
  if (Array.isArray(arrayResult)) {
2810
- return props.node.children.flatMap(
2811
- (node, childIndex) => node?.type === "div-container" ? [] : [renderNode(node, props, props.dataitem, `static-${childIndex}`)]
2812
- );
2822
+ return props.node.children.flatMap((node, childIndex) => {
2823
+ if (node.type !== "div-container") {
2824
+ return [
2825
+ renderNode(node, props, props.dataitem, `static-${childIndex}`)
2826
+ ];
2827
+ }
2828
+ const containsRepeater = node.children.some(hasRepeatedContainer);
2829
+ return [
2830
+ renderNode(
2831
+ node,
2832
+ props,
2833
+ containsRepeater ? arrayResult : props.dataitem,
2834
+ `${containsRepeater ? "nested-repeater" : "static"}-${childIndex}`
2835
+ )
2836
+ ];
2837
+ });
2813
2838
  }
2814
2839
  return dataToRender.map(
2815
2840
  (item, idx) => item?.links?.view && renderLink ? renderChildren(
package/dist/server.js CHANGED
@@ -5058,7 +5058,9 @@ var import_jsx_runtime = require("react/jsx-runtime");
5058
5058
  var TextNode = (props) => {
5059
5059
  function cssStringToJson(cssString) {
5060
5060
  const styleObject = {};
5061
- const matches = cssString?.match(/([\w-]+)\s*:\s*([^;]+)\s*;/g);
5061
+ if (!cssString || typeof cssString !== "string") return styleObject;
5062
+ const normalized = cssString.trim().endsWith(";") ? cssString.trim() : `${cssString.trim()};`;
5063
+ const matches = normalized.match(/([\w-]+)\s*:\s*([^;]+)\s*;/g);
5062
5064
  if (matches) {
5063
5065
  matches.forEach((match) => {
5064
5066
  const parts = match.match(/([\w-]+)\s*:\s*([^;]+)\s*;/);
@@ -5854,7 +5856,9 @@ function getNestedProperty(obj, path) {
5854
5856
  var DatafieldNode = (props) => {
5855
5857
  function cssStringToJson(cssString) {
5856
5858
  const styleObject = {};
5857
- const matches = cssString?.match(/([\w-]+)\s*:\s*([^;]+)\s*;/g);
5859
+ if (!cssString || typeof cssString !== "string") return styleObject;
5860
+ const normalized = cssString.trim().endsWith(";") ? cssString.trim() : `${cssString.trim()};`;
5861
+ const matches = normalized.match(/([\w-]+)\s*:\s*([^;]+)\s*;/g);
5858
5862
  if (matches) {
5859
5863
  matches.forEach((match) => {
5860
5864
  const parts = match.match(/([\w-]+)\s*:\s*([^;]+)\s*;/);
@@ -7457,6 +7461,14 @@ var Slider2 = (0, import_dynamic14.default)(() => Promise.resolve().then(() => (
7457
7461
  function toCamelCase(str) {
7458
7462
  return str.replace(/-([a-z])/g, (_, letter) => letter.toUpperCase());
7459
7463
  }
7464
+ function hasRepeatedContainer(node) {
7465
+ if (!node || typeof node !== "object") return false;
7466
+ const container = node;
7467
+ if (container.type === "div-container" && (container.repeatForEachItem === true || container.replicate === true)) {
7468
+ return true;
7469
+ }
7470
+ return Array.isArray(container.children) && container.children.some(hasRepeatedContainer);
7471
+ }
7460
7472
  function convertKeysToCamelCase(obj) {
7461
7473
  if (!obj || typeof obj !== "object") return obj;
7462
7474
  if (Array.isArray(obj)) return obj.map(convertKeysToCamelCase);
@@ -7777,7 +7789,7 @@ var DivContainer = async (props) => {
7777
7789
  return dataItem[key] !== void 0 ? dataItem[key] : match;
7778
7790
  });
7779
7791
  }
7780
- const arrayResult = Array.isArray(result) ? result : null;
7792
+ const arrayResult = Array.isArray(result) ? result : !dataSource && Array.isArray(props.dataitem) ? props.dataitem : null;
7781
7793
  const hasReplicatedChildren = Boolean(
7782
7794
  props.node.children?.some(
7783
7795
  (node) => node?.type === "div-container" && (node?.repeatForEachItem === true || node?.replicate === true)
@@ -7813,9 +7825,22 @@ var DivContainer = async (props) => {
7813
7825
  const renderContainerChildren = () => {
7814
7826
  if (!hasReplicatedChildren) {
7815
7827
  if (Array.isArray(arrayResult)) {
7816
- return props.node.children.flatMap(
7817
- (node, childIndex) => node?.type === "div-container" ? [] : [renderNode(node, props, props.dataitem, `static-${childIndex}`)]
7818
- );
7828
+ return props.node.children.flatMap((node, childIndex) => {
7829
+ if (node.type !== "div-container") {
7830
+ return [
7831
+ renderNode(node, props, props.dataitem, `static-${childIndex}`)
7832
+ ];
7833
+ }
7834
+ const containsRepeater = node.children.some(hasRepeatedContainer);
7835
+ return [
7836
+ renderNode(
7837
+ node,
7838
+ props,
7839
+ containsRepeater ? arrayResult : props.dataitem,
7840
+ `${containsRepeater ? "nested-repeater" : "static"}-${childIndex}`
7841
+ )
7842
+ ];
7843
+ });
7819
7844
  }
7820
7845
  return dataToRender.map(
7821
7846
  (item, idx) => item?.links?.view && renderLink ? renderChildren2(
package/dist/server.mjs CHANGED
@@ -22,7 +22,9 @@ import { jsx, jsxs } from "react/jsx-runtime";
22
22
  var TextNode = (props) => {
23
23
  function cssStringToJson(cssString) {
24
24
  const styleObject = {};
25
- const matches = cssString?.match(/([\w-]+)\s*:\s*([^;]+)\s*;/g);
25
+ if (!cssString || typeof cssString !== "string") return styleObject;
26
+ const normalized = cssString.trim().endsWith(";") ? cssString.trim() : `${cssString.trim()};`;
27
+ const matches = normalized.match(/([\w-]+)\s*:\s*([^;]+)\s*;/g);
26
28
  if (matches) {
27
29
  matches.forEach((match) => {
28
30
  const parts = match.match(/([\w-]+)\s*:\s*([^;]+)\s*;/);
@@ -813,7 +815,9 @@ function getNestedProperty(obj, path) {
813
815
  var DatafieldNode = (props) => {
814
816
  function cssStringToJson(cssString) {
815
817
  const styleObject = {};
816
- const matches = cssString?.match(/([\w-]+)\s*:\s*([^;]+)\s*;/g);
818
+ if (!cssString || typeof cssString !== "string") return styleObject;
819
+ const normalized = cssString.trim().endsWith(";") ? cssString.trim() : `${cssString.trim()};`;
820
+ const matches = normalized.match(/([\w-]+)\s*:\s*([^;]+)\s*;/g);
817
821
  if (matches) {
818
822
  matches.forEach((match) => {
819
823
  const parts = match.match(/([\w-]+)\s*:\s*([^;]+)\s*;/);
@@ -2407,6 +2411,14 @@ var Slider = dynamic14(() => import("./Slider-UNNVADVP.mjs"), {
2407
2411
  function toCamelCase(str) {
2408
2412
  return str.replace(/-([a-z])/g, (_, letter) => letter.toUpperCase());
2409
2413
  }
2414
+ function hasRepeatedContainer(node) {
2415
+ if (!node || typeof node !== "object") return false;
2416
+ const container = node;
2417
+ if (container.type === "div-container" && (container.repeatForEachItem === true || container.replicate === true)) {
2418
+ return true;
2419
+ }
2420
+ return Array.isArray(container.children) && container.children.some(hasRepeatedContainer);
2421
+ }
2410
2422
  function convertKeysToCamelCase(obj) {
2411
2423
  if (!obj || typeof obj !== "object") return obj;
2412
2424
  if (Array.isArray(obj)) return obj.map(convertKeysToCamelCase);
@@ -2727,7 +2739,7 @@ var DivContainer = async (props) => {
2727
2739
  return dataItem[key] !== void 0 ? dataItem[key] : match;
2728
2740
  });
2729
2741
  }
2730
- const arrayResult = Array.isArray(result) ? result : null;
2742
+ const arrayResult = Array.isArray(result) ? result : !dataSource && Array.isArray(props.dataitem) ? props.dataitem : null;
2731
2743
  const hasReplicatedChildren = Boolean(
2732
2744
  props.node.children?.some(
2733
2745
  (node) => node?.type === "div-container" && (node?.repeatForEachItem === true || node?.replicate === true)
@@ -2763,9 +2775,22 @@ var DivContainer = async (props) => {
2763
2775
  const renderContainerChildren = () => {
2764
2776
  if (!hasReplicatedChildren) {
2765
2777
  if (Array.isArray(arrayResult)) {
2766
- return props.node.children.flatMap(
2767
- (node, childIndex) => node?.type === "div-container" ? [] : [renderNode(node, props, props.dataitem, `static-${childIndex}`)]
2768
- );
2778
+ return props.node.children.flatMap((node, childIndex) => {
2779
+ if (node.type !== "div-container") {
2780
+ return [
2781
+ renderNode(node, props, props.dataitem, `static-${childIndex}`)
2782
+ ];
2783
+ }
2784
+ const containsRepeater = node.children.some(hasRepeatedContainer);
2785
+ return [
2786
+ renderNode(
2787
+ node,
2788
+ props,
2789
+ containsRepeater ? arrayResult : props.dataitem,
2790
+ `${containsRepeater ? "nested-repeater" : "static"}-${childIndex}`
2791
+ )
2792
+ ];
2793
+ });
2769
2794
  }
2770
2795
  return dataToRender.map(
2771
2796
  (item, idx) => item?.links?.view && renderLink ? renderChildren(
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@clyrex-digital/clyrex-controls-dev",
3
- "version": "0.8.1-dev.20261003110136",
3
+ "version": "0.8.1-dev.20261006100546",
4
4
  "description": "Reusable React components",
5
5
  "main": "dist/index.js",
6
6
  "module": "dist/index.mjs",