@acoustte-digital-services/digitalstore-controls-dev 0.8.1-dev.20260325114210 → 0.8.1-dev.20260325114832

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
@@ -4680,8 +4680,86 @@ var Pagination = (props) => {
4680
4680
  };
4681
4681
  var Pagination_default = Pagination;
4682
4682
 
4683
- // src/components/pageRenderingEngine/nodes/DivContainer.tsx
4683
+ // src/components/pageRenderingEngine/nodes/ImageGalleryNode.tsx
4684
+ var import_dynamic4 = __toESM(require("next/dynamic"));
4684
4685
  var import_jsx_runtime67 = require("react/jsx-runtime");
4686
+ var HlsPlayer1 = (0, import_dynamic4.default)(() => Promise.resolve().then(() => (init_HlsPlayer(), HlsPlayer_exports)), {
4687
+ ssr: false
4688
+ });
4689
+ var parseMaybeNumber = (value) => {
4690
+ if (typeof value === "number")
4691
+ return Number.isFinite(value) ? value : void 0;
4692
+ if (typeof value !== "string") return void 0;
4693
+ const n = Number(value);
4694
+ return Number.isFinite(n) ? n : void 0;
4695
+ };
4696
+ var shouldRenderForDevice = (imageDevice, currentDevice) => {
4697
+ if (!imageDevice) return true;
4698
+ return imageDevice == currentDevice;
4699
+ };
4700
+ var ImageGalleryNode = (props) => {
4701
+ const resolveImageUrl = (imageUrl) => {
4702
+ if (!imageUrl) return "";
4703
+ if (imageUrl.startsWith("http")) return imageUrl;
4704
+ return AssetUtility_default.getAssetFullPath(props.assetBaseUrl, imageUrl);
4705
+ };
4706
+ const resolvePosterUrl = (posterUrl) => {
4707
+ if (!posterUrl) return void 0;
4708
+ return AssetUtility_default.resolveUrl(props.assetBaseUrl, posterUrl);
4709
+ };
4710
+ const currentDevice = props.device;
4711
+ const images = Array.isArray(props.node.images) ? props.node.images : [];
4712
+ const visibleImages = images.filter(
4713
+ (img) => shouldRenderForDevice(img.device, currentDevice)
4714
+ );
4715
+ if (visibleImages.length === 0) return null;
4716
+ const FormatClass = {
4717
+ center: "justify-center",
4718
+ left: "justify-start",
4719
+ right: "justify-end"
4720
+ };
4721
+ const formatClasses = FormatClass[props.node.format || ""] || "";
4722
+ return /* @__PURE__ */ (0, import_jsx_runtime67.jsx)("div", { className: `flex flex-wrap gap-4 ${formatClasses}`, children: visibleImages.map((img, idx) => {
4723
+ const imageUrl = resolveImageUrl(img.imageUrl);
4724
+ if (!imageUrl) return null;
4725
+ const posterUrl = resolvePosterUrl(img.posterUrl);
4726
+ const intrinsicWidth = parseMaybeNumber(img.intrinsicWidth);
4727
+ const intrinsicHeight = parseMaybeNumber(img.intrinsicHeight);
4728
+ const isHls = imageUrl.endsWith(".m3u8");
4729
+ const alt = img.title || "Gallery image";
4730
+ return /* @__PURE__ */ (0, import_jsx_runtime67.jsx)("div", { className: "max-w-full", children: isHls ? /* @__PURE__ */ (0, import_jsx_runtime67.jsx)(
4731
+ HlsPlayer1,
4732
+ {
4733
+ assetUrl: imageUrl,
4734
+ posterUrl,
4735
+ intrinsicWidth: intrinsicWidth?.toString(),
4736
+ intrinsicHeight: intrinsicHeight?.toString(),
4737
+ showControls: true,
4738
+ loop: false,
4739
+ playOptions: void 0,
4740
+ apiBaseUrl: props.apiBaseUrl,
4741
+ session: props.session
4742
+ }
4743
+ ) : (
4744
+ /* eslint-disable-next-line @next/next/no-img-element */
4745
+ /* @__PURE__ */ (0, import_jsx_runtime67.jsx)(
4746
+ "img",
4747
+ {
4748
+ loading: "lazy",
4749
+ className: "object-cover max-w-full",
4750
+ src: imageUrl,
4751
+ width: intrinsicWidth,
4752
+ height: intrinsicHeight,
4753
+ alt
4754
+ }
4755
+ )
4756
+ ) }, `${img.imageUrl}-${idx}`);
4757
+ }) });
4758
+ };
4759
+ var ImageGalleryNode_default = ImageGalleryNode;
4760
+
4761
+ // src/components/pageRenderingEngine/nodes/DivContainer.tsx
4762
+ var import_jsx_runtime68 = require("react/jsx-runtime");
4685
4763
  function toCamelCase(str) {
4686
4764
  return str.replace(/-([a-z])/g, (_, letter) => letter.toUpperCase());
4687
4765
  }
@@ -4789,6 +4867,7 @@ var DivContainer = async (props) => {
4789
4867
  quote: QuoteNode_default,
4790
4868
  code: CodeNode_default,
4791
4869
  image: ImageNode_default,
4870
+ "image-gallery": ImageGalleryNode_default,
4792
4871
  horizontalrule: HorizontalRuleNode_default,
4793
4872
  widget: WidgetNode_default,
4794
4873
  embed: EmbedNode_default,
@@ -4863,7 +4942,7 @@ var DivContainer = async (props) => {
4863
4942
  response = await serviceClient.get(endpoint);
4864
4943
  result = response?.result;
4865
4944
  if (dataBindingProperties.showNoResultsMessage && (result === void 0 || result.length == 0)) {
4866
- return /* @__PURE__ */ (0, import_jsx_runtime67.jsx)(NoDataFound_default, {});
4945
+ return /* @__PURE__ */ (0, import_jsx_runtime68.jsx)(NoDataFound_default, {});
4867
4946
  }
4868
4947
  if (dataBindingProperties.childCollectionName && props.dataitem) {
4869
4948
  childCollectionData = getNestedValue2(props.dataitem, dataBindingProperties.childCollectionName);
@@ -4875,7 +4954,7 @@ var DivContainer = async (props) => {
4875
4954
  }
4876
4955
  const SelectedNode = NodeTypes2[node.type];
4877
4956
  if (!SelectedNode) return null;
4878
- return /* @__PURE__ */ (0, import_jsx_runtime67.jsx)(import_react50.default.Fragment, { children: /* @__PURE__ */ (0, import_jsx_runtime67.jsx)(
4957
+ return /* @__PURE__ */ (0, import_jsx_runtime68.jsx)(import_react50.default.Fragment, { children: /* @__PURE__ */ (0, import_jsx_runtime68.jsx)(
4879
4958
  SelectedNode,
4880
4959
  {
4881
4960
  node,
@@ -4975,9 +5054,9 @@ var DivContainer = async (props) => {
4975
5054
  props.node.autoFormat && "auto-format",
4976
5055
  props.node.bgClass
4977
5056
  ].filter(Boolean).join(" ");
4978
- return /* @__PURE__ */ (0, import_jsx_runtime67.jsxs)(import_react50.default.Fragment, { children: [
4979
- /* @__PURE__ */ (0, import_jsx_runtime67.jsx)("style", { dangerouslySetInnerHTML: { __html: cssResult.css + animationCSS } }),
4980
- /* @__PURE__ */ (0, import_jsx_runtime67.jsx)(import_react50.default.Fragment, { children: /* @__PURE__ */ (0, import_jsx_runtime67.jsx)(
5057
+ return /* @__PURE__ */ (0, import_jsx_runtime68.jsxs)(import_react50.default.Fragment, { children: [
5058
+ /* @__PURE__ */ (0, import_jsx_runtime68.jsx)("style", { dangerouslySetInnerHTML: { __html: cssResult.css + animationCSS } }),
5059
+ /* @__PURE__ */ (0, import_jsx_runtime68.jsx)(import_react50.default.Fragment, { children: /* @__PURE__ */ (0, import_jsx_runtime68.jsx)(
4981
5060
  Wrapper,
4982
5061
  {
4983
5062
  id: guid,
@@ -4986,18 +5065,18 @@ var DivContainer = async (props) => {
4986
5065
  ...wrapperProps,
4987
5066
  children: dataToRender.map(
4988
5067
  (item, idx) => item?.links?.view && renderLink ? renderChildren(props.node.children, props, item, idx, props.href ? void 0 : item?.links?.view)?.map(
4989
- (child, i) => /* @__PURE__ */ (0, import_jsx_runtime67.jsx)(import_react50.default.Fragment, { children: child }, i)
5068
+ (child, i) => /* @__PURE__ */ (0, import_jsx_runtime68.jsx)(import_react50.default.Fragment, { children: child }, i)
4990
5069
  ) : renderChildren(props.node.children, props, item, idx)
4991
5070
  )
4992
5071
  }
4993
5072
  ) }),
4994
- dataBindingProperties && props.node.dataBinding.enablePagination && /* @__PURE__ */ (0, import_jsx_runtime67.jsx)("div", { children: /* @__PURE__ */ (0, import_jsx_runtime67.jsx)(Pagination_default, { path: props.path, query: props.query, dataset: response }) })
5073
+ dataBindingProperties && props.node.dataBinding.enablePagination && /* @__PURE__ */ (0, import_jsx_runtime68.jsx)("div", { children: /* @__PURE__ */ (0, import_jsx_runtime68.jsx)(Pagination_default, { path: props.path, query: props.query, dataset: response }) })
4995
5074
  ] });
4996
5075
  };
4997
5076
  var DivContainer_default = DivContainer;
4998
5077
 
4999
5078
  // src/components/pageRenderingEngine/PageBodyRenderer.tsx
5000
- var import_jsx_runtime68 = require("react/jsx-runtime");
5079
+ var import_jsx_runtime69 = require("react/jsx-runtime");
5001
5080
  var NodeTypes = {
5002
5081
  ["paragraph"]: ParagraphNode_default,
5003
5082
  ["heading"]: HeadingNode_default,
@@ -5005,6 +5084,7 @@ var NodeTypes = {
5005
5084
  ["quote"]: QuoteNode_default,
5006
5085
  ["code"]: CodeNode_default,
5007
5086
  ["image"]: ImageNode_default,
5087
+ ["image-gallery"]: ImageGalleryNode_default,
5008
5088
  ["horizontalrule"]: HorizontalRuleNode_default,
5009
5089
  ["widget"]: WidgetNode_default,
5010
5090
  ["form-container"]: FormContainerNode_default,
@@ -5024,11 +5104,11 @@ var PageBodyRenderer = (props) => {
5024
5104
  if (pageBodyTree && pageBodyTree.root) {
5025
5105
  rootNode = pageBodyTree.root;
5026
5106
  }
5027
- return /* @__PURE__ */ (0, import_jsx_runtime68.jsx)(import_react51.default.Fragment, { children: rootNode && rootNode?.children?.map((node, index) => {
5107
+ return /* @__PURE__ */ (0, import_jsx_runtime69.jsx)(import_react51.default.Fragment, { children: rootNode && rootNode?.children?.map((node, index) => {
5028
5108
  {
5029
5109
  }
5030
5110
  const SelectedNode = NodeTypes[node.type];
5031
- return /* @__PURE__ */ (0, import_jsx_runtime68.jsx)(import_react51.default.Fragment, { children: SelectedNode && /* @__PURE__ */ (0, import_jsx_runtime68.jsx)(import_react51.default.Fragment, { children: node.type == "layout-container" ? /* @__PURE__ */ (0, import_jsx_runtime68.jsx)(import_react51.default.Fragment, { children: /* @__PURE__ */ (0, import_jsx_runtime68.jsx)(
5111
+ return /* @__PURE__ */ (0, import_jsx_runtime69.jsx)(import_react51.default.Fragment, { children: SelectedNode && /* @__PURE__ */ (0, import_jsx_runtime69.jsx)(import_react51.default.Fragment, { children: node.type == "layout-container" ? /* @__PURE__ */ (0, import_jsx_runtime69.jsx)(import_react51.default.Fragment, { children: /* @__PURE__ */ (0, import_jsx_runtime69.jsx)(
5032
5112
  SelectedNode,
5033
5113
  {
5034
5114
  node,
@@ -5043,7 +5123,7 @@ var PageBodyRenderer = (props) => {
5043
5123
  assetBaseUrl: props.assetBaseUrl,
5044
5124
  device: props.device
5045
5125
  }
5046
- ) }) : /* @__PURE__ */ (0, import_jsx_runtime68.jsx)(import_react51.default.Fragment, { children: /* @__PURE__ */ (0, import_jsx_runtime68.jsx)(
5126
+ ) }) : /* @__PURE__ */ (0, import_jsx_runtime69.jsx)(import_react51.default.Fragment, { children: /* @__PURE__ */ (0, import_jsx_runtime69.jsx)(
5047
5127
  SelectedNode,
5048
5128
  {
5049
5129
  node,
package/dist/index.mjs CHANGED
@@ -4336,8 +4336,86 @@ var Pagination = (props) => {
4336
4336
  };
4337
4337
  var Pagination_default = Pagination;
4338
4338
 
4339
+ // src/components/pageRenderingEngine/nodes/ImageGalleryNode.tsx
4340
+ import dynamic4 from "next/dynamic";
4341
+ import { jsx as jsx63 } from "react/jsx-runtime";
4342
+ var HlsPlayer1 = dynamic4(() => import("./HlsPlayer-FFEIK6FG.mjs"), {
4343
+ ssr: false
4344
+ });
4345
+ var parseMaybeNumber = (value) => {
4346
+ if (typeof value === "number")
4347
+ return Number.isFinite(value) ? value : void 0;
4348
+ if (typeof value !== "string") return void 0;
4349
+ const n = Number(value);
4350
+ return Number.isFinite(n) ? n : void 0;
4351
+ };
4352
+ var shouldRenderForDevice = (imageDevice, currentDevice) => {
4353
+ if (!imageDevice) return true;
4354
+ return imageDevice == currentDevice;
4355
+ };
4356
+ var ImageGalleryNode = (props) => {
4357
+ const resolveImageUrl = (imageUrl) => {
4358
+ if (!imageUrl) return "";
4359
+ if (imageUrl.startsWith("http")) return imageUrl;
4360
+ return AssetUtility_default.getAssetFullPath(props.assetBaseUrl, imageUrl);
4361
+ };
4362
+ const resolvePosterUrl = (posterUrl) => {
4363
+ if (!posterUrl) return void 0;
4364
+ return AssetUtility_default.resolveUrl(props.assetBaseUrl, posterUrl);
4365
+ };
4366
+ const currentDevice = props.device;
4367
+ const images = Array.isArray(props.node.images) ? props.node.images : [];
4368
+ const visibleImages = images.filter(
4369
+ (img) => shouldRenderForDevice(img.device, currentDevice)
4370
+ );
4371
+ if (visibleImages.length === 0) return null;
4372
+ const FormatClass = {
4373
+ center: "justify-center",
4374
+ left: "justify-start",
4375
+ right: "justify-end"
4376
+ };
4377
+ const formatClasses = FormatClass[props.node.format || ""] || "";
4378
+ return /* @__PURE__ */ jsx63("div", { className: `flex flex-wrap gap-4 ${formatClasses}`, children: visibleImages.map((img, idx) => {
4379
+ const imageUrl = resolveImageUrl(img.imageUrl);
4380
+ if (!imageUrl) return null;
4381
+ const posterUrl = resolvePosterUrl(img.posterUrl);
4382
+ const intrinsicWidth = parseMaybeNumber(img.intrinsicWidth);
4383
+ const intrinsicHeight = parseMaybeNumber(img.intrinsicHeight);
4384
+ const isHls = imageUrl.endsWith(".m3u8");
4385
+ const alt = img.title || "Gallery image";
4386
+ return /* @__PURE__ */ jsx63("div", { className: "max-w-full", children: isHls ? /* @__PURE__ */ jsx63(
4387
+ HlsPlayer1,
4388
+ {
4389
+ assetUrl: imageUrl,
4390
+ posterUrl,
4391
+ intrinsicWidth: intrinsicWidth?.toString(),
4392
+ intrinsicHeight: intrinsicHeight?.toString(),
4393
+ showControls: true,
4394
+ loop: false,
4395
+ playOptions: void 0,
4396
+ apiBaseUrl: props.apiBaseUrl,
4397
+ session: props.session
4398
+ }
4399
+ ) : (
4400
+ /* eslint-disable-next-line @next/next/no-img-element */
4401
+ /* @__PURE__ */ jsx63(
4402
+ "img",
4403
+ {
4404
+ loading: "lazy",
4405
+ className: "object-cover max-w-full",
4406
+ src: imageUrl,
4407
+ width: intrinsicWidth,
4408
+ height: intrinsicHeight,
4409
+ alt
4410
+ }
4411
+ )
4412
+ ) }, `${img.imageUrl}-${idx}`);
4413
+ }) });
4414
+ };
4415
+ var ImageGalleryNode_default = ImageGalleryNode;
4416
+
4339
4417
  // src/components/pageRenderingEngine/nodes/DivContainer.tsx
4340
- import { jsx as jsx63, jsxs as jsxs31 } from "react/jsx-runtime";
4418
+ import { jsx as jsx64, jsxs as jsxs31 } from "react/jsx-runtime";
4341
4419
  function toCamelCase(str) {
4342
4420
  return str.replace(/-([a-z])/g, (_, letter) => letter.toUpperCase());
4343
4421
  }
@@ -4445,6 +4523,7 @@ var DivContainer = async (props) => {
4445
4523
  quote: QuoteNode_default,
4446
4524
  code: CodeNode_default,
4447
4525
  image: ImageNode_default,
4526
+ "image-gallery": ImageGalleryNode_default,
4448
4527
  horizontalrule: HorizontalRuleNode_default,
4449
4528
  widget: WidgetNode_default,
4450
4529
  embed: EmbedNode_default,
@@ -4519,7 +4598,7 @@ var DivContainer = async (props) => {
4519
4598
  response = await serviceClient.get(endpoint);
4520
4599
  result = response?.result;
4521
4600
  if (dataBindingProperties.showNoResultsMessage && (result === void 0 || result.length == 0)) {
4522
- return /* @__PURE__ */ jsx63(NoDataFound_default, {});
4601
+ return /* @__PURE__ */ jsx64(NoDataFound_default, {});
4523
4602
  }
4524
4603
  if (dataBindingProperties.childCollectionName && props.dataitem) {
4525
4604
  childCollectionData = getNestedValue2(props.dataitem, dataBindingProperties.childCollectionName);
@@ -4531,7 +4610,7 @@ var DivContainer = async (props) => {
4531
4610
  }
4532
4611
  const SelectedNode = NodeTypes2[node.type];
4533
4612
  if (!SelectedNode) return null;
4534
- return /* @__PURE__ */ jsx63(React46.Fragment, { children: /* @__PURE__ */ jsx63(
4613
+ return /* @__PURE__ */ jsx64(React46.Fragment, { children: /* @__PURE__ */ jsx64(
4535
4614
  SelectedNode,
4536
4615
  {
4537
4616
  node,
@@ -4632,8 +4711,8 @@ var DivContainer = async (props) => {
4632
4711
  props.node.bgClass
4633
4712
  ].filter(Boolean).join(" ");
4634
4713
  return /* @__PURE__ */ jsxs31(React46.Fragment, { children: [
4635
- /* @__PURE__ */ jsx63("style", { dangerouslySetInnerHTML: { __html: cssResult.css + animationCSS } }),
4636
- /* @__PURE__ */ jsx63(React46.Fragment, { children: /* @__PURE__ */ jsx63(
4714
+ /* @__PURE__ */ jsx64("style", { dangerouslySetInnerHTML: { __html: cssResult.css + animationCSS } }),
4715
+ /* @__PURE__ */ jsx64(React46.Fragment, { children: /* @__PURE__ */ jsx64(
4637
4716
  Wrapper,
4638
4717
  {
4639
4718
  id: guid,
@@ -4642,18 +4721,18 @@ var DivContainer = async (props) => {
4642
4721
  ...wrapperProps,
4643
4722
  children: dataToRender.map(
4644
4723
  (item, idx) => item?.links?.view && renderLink ? renderChildren(props.node.children, props, item, idx, props.href ? void 0 : item?.links?.view)?.map(
4645
- (child, i) => /* @__PURE__ */ jsx63(React46.Fragment, { children: child }, i)
4724
+ (child, i) => /* @__PURE__ */ jsx64(React46.Fragment, { children: child }, i)
4646
4725
  ) : renderChildren(props.node.children, props, item, idx)
4647
4726
  )
4648
4727
  }
4649
4728
  ) }),
4650
- dataBindingProperties && props.node.dataBinding.enablePagination && /* @__PURE__ */ jsx63("div", { children: /* @__PURE__ */ jsx63(Pagination_default, { path: props.path, query: props.query, dataset: response }) })
4729
+ dataBindingProperties && props.node.dataBinding.enablePagination && /* @__PURE__ */ jsx64("div", { children: /* @__PURE__ */ jsx64(Pagination_default, { path: props.path, query: props.query, dataset: response }) })
4651
4730
  ] });
4652
4731
  };
4653
4732
  var DivContainer_default = DivContainer;
4654
4733
 
4655
4734
  // src/components/pageRenderingEngine/PageBodyRenderer.tsx
4656
- import { jsx as jsx64 } from "react/jsx-runtime";
4735
+ import { jsx as jsx65 } from "react/jsx-runtime";
4657
4736
  var NodeTypes = {
4658
4737
  ["paragraph"]: ParagraphNode_default,
4659
4738
  ["heading"]: HeadingNode_default,
@@ -4661,6 +4740,7 @@ var NodeTypes = {
4661
4740
  ["quote"]: QuoteNode_default,
4662
4741
  ["code"]: CodeNode_default,
4663
4742
  ["image"]: ImageNode_default,
4743
+ ["image-gallery"]: ImageGalleryNode_default,
4664
4744
  ["horizontalrule"]: HorizontalRuleNode_default,
4665
4745
  ["widget"]: WidgetNode_default,
4666
4746
  ["form-container"]: FormContainerNode_default,
@@ -4680,11 +4760,11 @@ var PageBodyRenderer = (props) => {
4680
4760
  if (pageBodyTree && pageBodyTree.root) {
4681
4761
  rootNode = pageBodyTree.root;
4682
4762
  }
4683
- return /* @__PURE__ */ jsx64(React47.Fragment, { children: rootNode && rootNode?.children?.map((node, index) => {
4763
+ return /* @__PURE__ */ jsx65(React47.Fragment, { children: rootNode && rootNode?.children?.map((node, index) => {
4684
4764
  {
4685
4765
  }
4686
4766
  const SelectedNode = NodeTypes[node.type];
4687
- return /* @__PURE__ */ jsx64(React47.Fragment, { children: SelectedNode && /* @__PURE__ */ jsx64(React47.Fragment, { children: node.type == "layout-container" ? /* @__PURE__ */ jsx64(React47.Fragment, { children: /* @__PURE__ */ jsx64(
4767
+ return /* @__PURE__ */ jsx65(React47.Fragment, { children: SelectedNode && /* @__PURE__ */ jsx65(React47.Fragment, { children: node.type == "layout-container" ? /* @__PURE__ */ jsx65(React47.Fragment, { children: /* @__PURE__ */ jsx65(
4688
4768
  SelectedNode,
4689
4769
  {
4690
4770
  node,
@@ -4699,7 +4779,7 @@ var PageBodyRenderer = (props) => {
4699
4779
  assetBaseUrl: props.assetBaseUrl,
4700
4780
  device: props.device
4701
4781
  }
4702
- ) }) : /* @__PURE__ */ jsx64(React47.Fragment, { children: /* @__PURE__ */ jsx64(
4782
+ ) }) : /* @__PURE__ */ jsx65(React47.Fragment, { children: /* @__PURE__ */ jsx65(
4703
4783
  SelectedNode,
4704
4784
  {
4705
4785
  node,
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.20260325114210",
3
+ "version": "0.8.1-dev.20260325114832",
4
4
  "description": "Reusable React components",
5
5
  "main": "dist/index.js",
6
6
  "module": "dist/index.mjs",