@acoustte-digital-services/digitalstore-controls-dev 0.8.1-dev.20260623122324 → 0.8.1-dev.20260624051314

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.
Files changed (3) hide show
  1. package/dist/index.js +369 -87
  2. package/dist/index.mjs +369 -87
  3. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -5643,37 +5643,275 @@ var getNestedValue4 = (obj, path) => {
5643
5643
  return current && current[key] !== void 0 ? current[key] : void 0;
5644
5644
  }, obj);
5645
5645
  };
5646
- var PdfIcon = () => /* @__PURE__ */ (0, import_jsx_runtime70.jsxs)("svg", { width: "24", height: "24", viewBox: "0 0 24 24", fill: "none", xmlns: "http://www.w3.org/2000/svg", className: "text-red-500 w-8 h-8", children: [
5647
- /* @__PURE__ */ (0, import_jsx_runtime70.jsx)("path", { d: "M7 3H14L19 8V20C19 20.5304 18.7893 21.0391 18.4142 21.4142C18.0391 21.7893 17.5304 22 17 22H7C6.46957 22 5.96086 21.7893 5.58579 21.4142C5.21071 21.0391 5 20.5304 5 20V5C5 4.46957 5.21071 3.96086 5.58579 3.58579C5.96086 3.21071 6.46957 3 7 3Z", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round" }),
5648
- /* @__PURE__ */ (0, import_jsx_runtime70.jsx)("path", { d: "M14 3V8H19", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round" }),
5649
- /* @__PURE__ */ (0, import_jsx_runtime70.jsx)("path", { d: "M9 14H11C11.5304 14 12.0391 13.7893 12.4142 13.4142C12.7893 13.0391 13 12.5304 13 12C13 11.4696 12.7893 10.9609 12.4142 10.5858C12.0391 10.2107 11.5304 10 11 10H9V18", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round" }),
5650
- /* @__PURE__ */ (0, import_jsx_runtime70.jsx)("path", { d: "M9 14H12", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round" })
5651
- ] });
5652
- var ExcelIcon = () => /* @__PURE__ */ (0, import_jsx_runtime70.jsxs)("svg", { width: "24", height: "24", viewBox: "0 0 24 24", fill: "none", xmlns: "http://www.w3.org/2000/svg", className: "text-green-600 w-8 h-8", children: [
5653
- /* @__PURE__ */ (0, import_jsx_runtime70.jsx)("path", { d: "M14 3V8H19", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round" }),
5654
- /* @__PURE__ */ (0, import_jsx_runtime70.jsx)("path", { d: "M5 20V5C5 4.46957 5.21071 3.96086 5.58579 3.58579C5.96086 3.21071 6.46957 3 7 3H14L19 8V20C19 20.5304 18.7893 21.0391 18.4142 21.4142C18.0391 21.7893 17.5304 22 17 22H7C6.46957 22 5.96086 21.7893 5.58579 21.4142C5.21071 21.0391 5 20.5304 5 20Z", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round" }),
5655
- /* @__PURE__ */ (0, import_jsx_runtime70.jsx)("path", { d: "M9 11L15 17", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round" }),
5656
- /* @__PURE__ */ (0, import_jsx_runtime70.jsx)("path", { d: "M15 11L9 17", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round" })
5657
- ] });
5658
- var WordIcon = () => /* @__PURE__ */ (0, import_jsx_runtime70.jsxs)("svg", { width: "24", height: "24", viewBox: "0 0 24 24", fill: "none", xmlns: "http://www.w3.org/2000/svg", className: "text-blue-600 w-8 h-8", children: [
5659
- /* @__PURE__ */ (0, import_jsx_runtime70.jsx)("path", { d: "M14 3V8H19", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round" }),
5660
- /* @__PURE__ */ (0, import_jsx_runtime70.jsx)("path", { d: "M5 20V5C5 4.46957 5.21071 3.96086 5.58579 3.58579C5.96086 3.21071 6.46957 3 7 3H14L19 8V20C19 20.5304 18.7893 21.0391 18.4142 21.4142C18.0391 21.7893 17.5304 22 17 22H7C6.46957 22 5.96086 21.7893 5.58579 21.4142C5.21071 21.0391 5 20.5304 5 20Z", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round" }),
5661
- /* @__PURE__ */ (0, import_jsx_runtime70.jsx)("path", { d: "M8 12L10 17L12 14L14 17L16 12", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round" })
5662
- ] });
5663
- var ImageIcon = () => /* @__PURE__ */ (0, import_jsx_runtime70.jsxs)("svg", { width: "24", height: "24", viewBox: "0 0 24 24", fill: "none", xmlns: "http://www.w3.org/2000/svg", className: "text-yellow-500 w-8 h-8", children: [
5664
- /* @__PURE__ */ (0, import_jsx_runtime70.jsx)("path", { d: "M21 15V19C21 19.5304 20.7893 20.0391 20.4142 20.4142C20.0391 20.7893 19.5304 21 19 21H5C4.46957 21 3.96086 20.7893 3.58579 20.4142C3.21071 20.0391 3 19.5304 3 19V5C3 4.46957 3.21071 3.96086 3.58579 3.58579C3.96086 3.21071 4.46957 3 5 3H19C19.5304 3 20.0391 3.21071 20.4142 3.58579C20.7893 3.96086 21 4.46957 21 5V15ZM21 15L16 10L9 17L6 14L3 17", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round" }),
5665
- /* @__PURE__ */ (0, import_jsx_runtime70.jsx)("path", { d: "M16 8C16 8.55228 15.5523 9 15 9C14.4477 9 14 8.55228 14 8C14 7.44772 14.4477 7 15 7C15.5523 7 16 7.44772 16 8Z", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round" })
5666
- ] });
5667
- var StandardIcon = () => /* @__PURE__ */ (0, import_jsx_runtime70.jsxs)("svg", { width: "24", height: "24", viewBox: "0 0 24 24", fill: "none", xmlns: "http://www.w3.org/2000/svg", className: "text-gray-500 w-8 h-8", children: [
5668
- /* @__PURE__ */ (0, import_jsx_runtime70.jsx)("path", { d: "M14 3V8H19", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round" }),
5669
- /* @__PURE__ */ (0, import_jsx_runtime70.jsx)("path", { d: "M5 20V5C5 4.46957 5.21071 3.96086 5.58579 3.58579C5.96086 3.21071 6.46957 3 7 3H14L19 8V20C19 20.5304 18.7893 21.0391 18.4142 21.4142C18.0391 21.7893 17.5304 22 17 22H7C6.46957 22 5.96086 21.7893 5.58579 21.4142C5.21071 21.0391 5 20.5304 5 20Z", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round" })
5670
- ] });
5646
+ var PdfIcon = () => /* @__PURE__ */ (0, import_jsx_runtime70.jsxs)(
5647
+ "svg",
5648
+ {
5649
+ width: "24",
5650
+ height: "24",
5651
+ viewBox: "0 0 24 24",
5652
+ fill: "none",
5653
+ xmlns: "http://www.w3.org/2000/svg",
5654
+ className: "text-red-500 w-8 h-8",
5655
+ children: [
5656
+ /* @__PURE__ */ (0, import_jsx_runtime70.jsx)(
5657
+ "path",
5658
+ {
5659
+ d: "M7 3H14L19 8V20C19 20.5304 18.7893 21.0391 18.4142 21.4142C18.0391 21.7893 17.5304 22 17 22H7C6.46957 22 5.96086 21.7893 5.58579 21.4142C5.21071 21.0391 5 20.5304 5 20V5C5 4.46957 5.21071 3.96086 5.58579 3.58579C5.96086 3.21071 6.46957 3 7 3Z",
5660
+ stroke: "currentColor",
5661
+ strokeWidth: "2",
5662
+ strokeLinecap: "round",
5663
+ strokeLinejoin: "round"
5664
+ }
5665
+ ),
5666
+ /* @__PURE__ */ (0, import_jsx_runtime70.jsx)(
5667
+ "path",
5668
+ {
5669
+ d: "M14 3V8H19",
5670
+ stroke: "currentColor",
5671
+ strokeWidth: "2",
5672
+ strokeLinecap: "round",
5673
+ strokeLinejoin: "round"
5674
+ }
5675
+ ),
5676
+ /* @__PURE__ */ (0, import_jsx_runtime70.jsx)(
5677
+ "path",
5678
+ {
5679
+ d: "M9 14H11C11.5304 14 12.0391 13.7893 12.4142 13.4142C12.7893 13.0391 13 12.5304 13 12C13 11.4696 12.7893 10.9609 12.4142 10.5858C12.0391 10.2107 11.5304 10 11 10H9V18",
5680
+ stroke: "currentColor",
5681
+ strokeWidth: "2",
5682
+ strokeLinecap: "round",
5683
+ strokeLinejoin: "round"
5684
+ }
5685
+ ),
5686
+ /* @__PURE__ */ (0, import_jsx_runtime70.jsx)(
5687
+ "path",
5688
+ {
5689
+ d: "M9 14H12",
5690
+ stroke: "currentColor",
5691
+ strokeWidth: "2",
5692
+ strokeLinecap: "round",
5693
+ strokeLinejoin: "round"
5694
+ }
5695
+ )
5696
+ ]
5697
+ }
5698
+ );
5699
+ var ExcelIcon = () => /* @__PURE__ */ (0, import_jsx_runtime70.jsxs)(
5700
+ "svg",
5701
+ {
5702
+ width: "24",
5703
+ height: "24",
5704
+ viewBox: "0 0 24 24",
5705
+ fill: "none",
5706
+ xmlns: "http://www.w3.org/2000/svg",
5707
+ className: "text-green-600 w-8 h-8",
5708
+ children: [
5709
+ /* @__PURE__ */ (0, import_jsx_runtime70.jsx)(
5710
+ "path",
5711
+ {
5712
+ d: "M14 3V8H19",
5713
+ stroke: "currentColor",
5714
+ strokeWidth: "2",
5715
+ strokeLinecap: "round",
5716
+ strokeLinejoin: "round"
5717
+ }
5718
+ ),
5719
+ /* @__PURE__ */ (0, import_jsx_runtime70.jsx)(
5720
+ "path",
5721
+ {
5722
+ d: "M5 20V5C5 4.46957 5.21071 3.96086 5.58579 3.58579C5.96086 3.21071 6.46957 3 7 3H14L19 8V20C19 20.5304 18.7893 21.0391 18.4142 21.4142C18.0391 21.7893 17.5304 22 17 22H7C6.46957 22 5.96086 21.7893 5.58579 21.4142C5.21071 21.0391 5 20.5304 5 20Z",
5723
+ stroke: "currentColor",
5724
+ strokeWidth: "2",
5725
+ strokeLinecap: "round",
5726
+ strokeLinejoin: "round"
5727
+ }
5728
+ ),
5729
+ /* @__PURE__ */ (0, import_jsx_runtime70.jsx)(
5730
+ "path",
5731
+ {
5732
+ d: "M9 11L15 17",
5733
+ stroke: "currentColor",
5734
+ strokeWidth: "2",
5735
+ strokeLinecap: "round",
5736
+ strokeLinejoin: "round"
5737
+ }
5738
+ ),
5739
+ /* @__PURE__ */ (0, import_jsx_runtime70.jsx)(
5740
+ "path",
5741
+ {
5742
+ d: "M15 11L9 17",
5743
+ stroke: "currentColor",
5744
+ strokeWidth: "2",
5745
+ strokeLinecap: "round",
5746
+ strokeLinejoin: "round"
5747
+ }
5748
+ )
5749
+ ]
5750
+ }
5751
+ );
5752
+ var WordIcon = () => /* @__PURE__ */ (0, import_jsx_runtime70.jsxs)(
5753
+ "svg",
5754
+ {
5755
+ width: "24",
5756
+ height: "24",
5757
+ viewBox: "0 0 24 24",
5758
+ fill: "none",
5759
+ xmlns: "http://www.w3.org/2000/svg",
5760
+ className: "text-blue-600 w-8 h-8",
5761
+ children: [
5762
+ /* @__PURE__ */ (0, import_jsx_runtime70.jsx)(
5763
+ "path",
5764
+ {
5765
+ d: "M14 3V8H19",
5766
+ stroke: "currentColor",
5767
+ strokeWidth: "2",
5768
+ strokeLinecap: "round",
5769
+ strokeLinejoin: "round"
5770
+ }
5771
+ ),
5772
+ /* @__PURE__ */ (0, import_jsx_runtime70.jsx)(
5773
+ "path",
5774
+ {
5775
+ d: "M5 20V5C5 4.46957 5.21071 3.96086 5.58579 3.58579C5.96086 3.21071 6.46957 3 7 3H14L19 8V20C19 20.5304 18.7893 21.0391 18.4142 21.4142C18.0391 21.7893 17.5304 22 17 22H7C6.46957 22 5.96086 21.7893 5.58579 21.4142C5.21071 21.0391 5 20.5304 5 20Z",
5776
+ stroke: "currentColor",
5777
+ strokeWidth: "2",
5778
+ strokeLinecap: "round",
5779
+ strokeLinejoin: "round"
5780
+ }
5781
+ ),
5782
+ /* @__PURE__ */ (0, import_jsx_runtime70.jsx)(
5783
+ "path",
5784
+ {
5785
+ d: "M8 12L10 17L12 14L14 17L16 12",
5786
+ stroke: "currentColor",
5787
+ strokeWidth: "2",
5788
+ strokeLinecap: "round",
5789
+ strokeLinejoin: "round"
5790
+ }
5791
+ )
5792
+ ]
5793
+ }
5794
+ );
5795
+ var StandardIcon = () => /* @__PURE__ */ (0, import_jsx_runtime70.jsxs)(
5796
+ "svg",
5797
+ {
5798
+ width: "24",
5799
+ height: "24",
5800
+ viewBox: "0 0 24 24",
5801
+ fill: "none",
5802
+ xmlns: "http://www.w3.org/2000/svg",
5803
+ className: "text-gray-500 w-8 h-8",
5804
+ children: [
5805
+ /* @__PURE__ */ (0, import_jsx_runtime70.jsx)(
5806
+ "path",
5807
+ {
5808
+ d: "M14 3V8H19",
5809
+ stroke: "currentColor",
5810
+ strokeWidth: "2",
5811
+ strokeLinecap: "round",
5812
+ strokeLinejoin: "round"
5813
+ }
5814
+ ),
5815
+ /* @__PURE__ */ (0, import_jsx_runtime70.jsx)(
5816
+ "path",
5817
+ {
5818
+ d: "M5 20V5C5 4.46957 5.21071 3.96086 5.58579 3.58579C5.96086 3.21071 6.46957 3 7 3H14L19 8V20C19 20.5304 18.7893 21.0391 18.4142 21.4142C18.0391 21.7893 17.5304 22 17 22H7C6.46957 22 5.96086 21.7893 5.58579 21.4142C5.21071 21.0391 5 20.5304 5 20Z",
5819
+ stroke: "currentColor",
5820
+ strokeWidth: "2",
5821
+ strokeLinecap: "round",
5822
+ strokeLinejoin: "round"
5823
+ }
5824
+ )
5825
+ ]
5826
+ }
5827
+ );
5828
+ var PowerPointIcon = () => /* @__PURE__ */ (0, import_jsx_runtime70.jsxs)(
5829
+ "svg",
5830
+ {
5831
+ width: "24",
5832
+ height: "24",
5833
+ viewBox: "0 0 24 24",
5834
+ fill: "none",
5835
+ xmlns: "http://www.w3.org/2000/svg",
5836
+ className: "text-orange-600 w-8 h-8",
5837
+ children: [
5838
+ /* @__PURE__ */ (0, import_jsx_runtime70.jsx)(
5839
+ "path",
5840
+ {
5841
+ d: "M14 3V8H19",
5842
+ stroke: "currentColor",
5843
+ strokeWidth: "2",
5844
+ strokeLinecap: "round",
5845
+ strokeLinejoin: "round"
5846
+ }
5847
+ ),
5848
+ /* @__PURE__ */ (0, import_jsx_runtime70.jsx)(
5849
+ "path",
5850
+ {
5851
+ d: "M5 20V5C5 3.9 5.9 3 7 3H14L19 8V20C19 21.1 18.1 22 17 22H7C5.9 22 5 21.1 5 20Z",
5852
+ stroke: "currentColor",
5853
+ strokeWidth: "2"
5854
+ }
5855
+ ),
5856
+ /* @__PURE__ */ (0, import_jsx_runtime70.jsx)("text", { x: "8", y: "16", fontSize: "6", fill: "currentColor", children: "P" })
5857
+ ]
5858
+ }
5859
+ );
5860
+ var TextIcon = () => /* @__PURE__ */ (0, import_jsx_runtime70.jsxs)(
5861
+ "svg",
5862
+ {
5863
+ width: "24",
5864
+ height: "24",
5865
+ viewBox: "0 0 24 24",
5866
+ fill: "none",
5867
+ xmlns: "http://www.w3.org/2000/svg",
5868
+ className: "text-gray-600 w-8 h-8",
5869
+ children: [
5870
+ /* @__PURE__ */ (0, import_jsx_runtime70.jsx)("path", { d: "M14 3V8H19", stroke: "currentColor", strokeWidth: "2" }),
5871
+ /* @__PURE__ */ (0, import_jsx_runtime70.jsx)(
5872
+ "path",
5873
+ {
5874
+ d: "M5 20V5C5 3.9 5.9 3 7 3H14L19 8V20C19 21.1 18.1 22 17 22H7C5.9 22 5 21.1 5 20Z",
5875
+ stroke: "currentColor",
5876
+ strokeWidth: "2"
5877
+ }
5878
+ ),
5879
+ /* @__PURE__ */ (0, import_jsx_runtime70.jsx)("path", { d: "M8 11H16M8 15H14", stroke: "currentColor", strokeWidth: "2" })
5880
+ ]
5881
+ }
5882
+ );
5883
+ var ArchiveIcon = () => /* @__PURE__ */ (0, import_jsx_runtime70.jsxs)(
5884
+ "svg",
5885
+ {
5886
+ width: "24",
5887
+ height: "24",
5888
+ viewBox: "0 0 24 24",
5889
+ fill: "none",
5890
+ xmlns: "http://www.w3.org/2000/svg",
5891
+ className: "text-yellow-700 w-8 h-8",
5892
+ children: [
5893
+ /* @__PURE__ */ (0, import_jsx_runtime70.jsx)(
5894
+ "rect",
5895
+ {
5896
+ x: "4",
5897
+ y: "4",
5898
+ width: "16",
5899
+ height: "16",
5900
+ rx: "2",
5901
+ stroke: "currentColor",
5902
+ strokeWidth: "2"
5903
+ }
5904
+ ),
5905
+ /* @__PURE__ */ (0, import_jsx_runtime70.jsx)("path", { d: "M9 8H15M10 12H14M11 16H13", stroke: "currentColor", strokeWidth: "2" })
5906
+ ]
5907
+ }
5908
+ );
5671
5909
  var getFileDetails = (url) => {
5672
5910
  const extMatch = url.match(/\.([a-zA-Z0-9]+)(?:[\?#]|$)/);
5673
5911
  const ext = extMatch ? extMatch[1].toLowerCase() : "";
5674
5912
  let Icon2 = StandardIcon;
5675
5913
  let extLabel = "FILE";
5676
- if (["pdf"].includes(ext)) {
5914
+ if (ext === "pdf") {
5677
5915
  Icon2 = PdfIcon;
5678
5916
  extLabel = "PDF";
5679
5917
  } else if (["xls", "xlsx", "csv"].includes(ext)) {
@@ -5681,10 +5919,16 @@ var getFileDetails = (url) => {
5681
5919
  extLabel = "Excel";
5682
5920
  } else if (["doc", "docx"].includes(ext)) {
5683
5921
  Icon2 = WordIcon;
5684
- extLabel = ext.toUpperCase();
5685
- } else if (["jpg", "jpeg", "png", "gif", "webp", "svg"].includes(ext)) {
5686
- Icon2 = ImageIcon;
5687
- extLabel = ext.toUpperCase();
5922
+ extLabel = "Word";
5923
+ } else if (["ppt", "pptx"].includes(ext)) {
5924
+ Icon2 = PowerPointIcon;
5925
+ extLabel = "PowerPoint";
5926
+ } else if (["txt", "rtf"].includes(ext)) {
5927
+ Icon2 = TextIcon;
5928
+ extLabel = "Text";
5929
+ } else if (["zip", "rar", "7z"].includes(ext)) {
5930
+ Icon2 = ArchiveIcon;
5931
+ extLabel = "Archive";
5688
5932
  } else if (ext) {
5689
5933
  extLabel = ext.toUpperCase();
5690
5934
  }
@@ -5695,8 +5939,7 @@ var DocumentNode = (props) => {
5695
5939
  console.log("props", props);
5696
5940
  console.log("dataitem", props.dataitem);
5697
5941
  console.log("node", props.node);
5698
- let documentUrl;
5699
- let documentTitle;
5942
+ let documents = [];
5700
5943
  if (props.dataitem && props.node.documentKey) {
5701
5944
  const docData = getNestedValue4(props.dataitem, props.node.documentKey);
5702
5945
  if (typeof docData === "string") {
@@ -5704,71 +5947,110 @@ var DocumentNode = (props) => {
5704
5947
  if (trimmed.startsWith("[") || trimmed.startsWith("{")) {
5705
5948
  try {
5706
5949
  const parsed = JSON.parse(trimmed);
5707
- const asset = Array.isArray(parsed) ? parsed[0] : parsed;
5708
- if (asset && asset.assetUrl) {
5709
- documentUrl = AssetUtility_default.resolveUrl(props.assetBaseUrl, asset.assetUrl);
5710
- if (asset.title) documentTitle = asset.title;
5950
+ if (Array.isArray(parsed)) {
5951
+ documents = parsed.filter(
5952
+ (item) => item && item.assetUrl
5953
+ );
5954
+ } else if (parsed?.assetUrl) {
5955
+ documents = [parsed];
5711
5956
  }
5712
- } catch (e) {
5957
+ } catch {
5713
5958
  }
5714
5959
  } else {
5715
- documentUrl = AssetUtility_default.resolveUrl(props.assetBaseUrl, docData);
5716
- }
5717
- } else if (Array.isArray(docData) && docData.length > 0) {
5718
- const asset = docData[0];
5719
- if (asset && asset.assetUrl) {
5720
- documentUrl = AssetUtility_default.resolveUrl(props.assetBaseUrl, asset.assetUrl);
5721
- if (asset.title) documentTitle = asset.title;
5722
- }
5723
- } else if (docData && typeof docData === "object") {
5724
- const asset = docData;
5725
- if (asset && asset.assetUrl) {
5726
- documentUrl = AssetUtility_default.resolveUrl(props.assetBaseUrl, asset.assetUrl);
5727
- if (asset.title) documentTitle = asset.title;
5960
+ documents = [
5961
+ {
5962
+ assetUrl: docData
5963
+ }
5964
+ ];
5728
5965
  }
5966
+ } else if (Array.isArray(docData)) {
5967
+ documents = docData.filter((item) => item && item.assetUrl);
5968
+ } else if (docData && typeof docData === "object" && docData.assetUrl) {
5969
+ documents = [docData];
5729
5970
  }
5730
5971
  }
5731
- if (!documentUrl) return null;
5732
- const { Icon: Icon2, extLabel } = getFileDetails(documentUrl);
5733
- if (!documentTitle) {
5734
- try {
5735
- const pathName = new URL(documentUrl).pathname;
5736
- documentTitle = pathName.split("/").pop() || "Document";
5737
- } catch {
5738
- documentTitle = documentUrl.split("/").pop() || "Document";
5739
- }
5740
- documentTitle = documentTitle.replace(/\.[^/.]+$/, "");
5741
- }
5742
- return /* @__PURE__ */ (0, import_jsx_runtime70.jsxs)("div", { className: "flex items-center justify-between py-4 bg-default", children: [
5743
- /* @__PURE__ */ (0, import_jsx_runtime70.jsxs)("div", { className: "flex items-center space-x-4", children: [
5744
- /* @__PURE__ */ (0, import_jsx_runtime70.jsx)("div", { className: "flex items-center justify-center p-2 rounded bg-secondary-soft border", children: /* @__PURE__ */ (0, import_jsx_runtime70.jsx)(Icon2, {}) }),
5745
- /* @__PURE__ */ (0, import_jsx_runtime70.jsxs)("div", { className: "flex items-baseline space-x-2", children: [
5746
- /* @__PURE__ */ (0, import_jsx_runtime70.jsx)("h4", { className: "text-base font-semibold", children: documentTitle }),
5747
- /* @__PURE__ */ (0, import_jsx_runtime70.jsxs)("span", { className: "text-sm font-medium", children: [
5748
- "(",
5749
- extLabel,
5750
- ")"
5751
- ] })
5752
- ] })
5753
- ] }),
5754
- /* @__PURE__ */ (0, import_jsx_runtime70.jsxs)(
5755
- "a",
5972
+ if (documents.length === 0) return null;
5973
+ return /* @__PURE__ */ (0, import_jsx_runtime70.jsx)("div", { className: "space-y-4", children: documents.map((doc, index) => {
5974
+ const documentUrl = AssetUtility_default.resolveUrl(
5975
+ props.assetBaseUrl,
5976
+ doc.assetUrl
5977
+ );
5978
+ let documentTitle = doc.title;
5979
+ if (!documentUrl) {
5980
+ return null;
5981
+ }
5982
+ if (!documentTitle) {
5983
+ try {
5984
+ const pathName = new URL(documentUrl).pathname;
5985
+ documentTitle = pathName.split("/").pop()?.replace(/\.[^/.]+$/, "") || "Document";
5986
+ } catch {
5987
+ documentTitle = documentUrl.split("/").pop()?.replace(/\.[^/.]+$/, "") || "Document";
5988
+ }
5989
+ }
5990
+ const { Icon: Icon2, extLabel } = getFileDetails(documentUrl);
5991
+ return /* @__PURE__ */ (0, import_jsx_runtime70.jsxs)(
5992
+ "div",
5756
5993
  {
5757
- href: documentUrl,
5758
- download: true,
5759
- target: "_blank",
5760
- rel: "noreferrer",
5761
- className: "inline-flex items-center px-4 py-2 text-sm font-medium bg-default border rounded focus:outline-none focus:ring-2 focus:ring-offset-2 transition-colors",
5994
+ className: "flex items-center justify-between py-4 bg-default",
5762
5995
  children: [
5763
- /* @__PURE__ */ (0, import_jsx_runtime70.jsxs)("svg", { className: "w-4 h-4 mr-2", fill: "none", stroke: "currentColor", viewBox: "0 0 24 24", xmlns: "http://www.w3.org/2000/svg", children: [
5764
- /* @__PURE__ */ (0, import_jsx_runtime70.jsx)("path", { strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: "2", d: "M4 16v1a3 3 0 003 3h10a3 3 0 003-3v-1m-4-4l-4 4m0 0l-4-4m4 4V4" }),
5765
- /* @__PURE__ */ (0, import_jsx_runtime70.jsx)("path", { strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: "2", d: "M12 12v5m0 0l-3-3m3 3l3-3M12 8v4" })
5996
+ /* @__PURE__ */ (0, import_jsx_runtime70.jsxs)("div", { className: "flex items-center space-x-4", children: [
5997
+ /* @__PURE__ */ (0, import_jsx_runtime70.jsx)("div", { className: "flex items-center justify-center p-2 rounded bg-neutral-soft", children: /* @__PURE__ */ (0, import_jsx_runtime70.jsx)(Icon2, {}) }),
5998
+ /* @__PURE__ */ (0, import_jsx_runtime70.jsxs)("div", { className: "flex items-baseline space-x-2", children: [
5999
+ /* @__PURE__ */ (0, import_jsx_runtime70.jsx)("h4", { className: "text-base font-semibold", children: documentTitle }),
6000
+ /* @__PURE__ */ (0, import_jsx_runtime70.jsxs)("span", { className: "text-sm font-medium", children: [
6001
+ "(",
6002
+ extLabel,
6003
+ ")"
6004
+ ] })
6005
+ ] })
5766
6006
  ] }),
5767
- "Download"
6007
+ /* @__PURE__ */ (0, import_jsx_runtime70.jsxs)(
6008
+ "a",
6009
+ {
6010
+ href: documentUrl,
6011
+ download: true,
6012
+ target: "_blank",
6013
+ rel: "noreferrer",
6014
+ className: "inline-flex items-center px-4 py-2 text-sm font-medium bg-default border rounded focus:outline-none focus:ring-2 focus:ring-offset-2 transition-colors",
6015
+ children: [
6016
+ /* @__PURE__ */ (0, import_jsx_runtime70.jsxs)(
6017
+ "svg",
6018
+ {
6019
+ className: "w-4 h-4 mr-2",
6020
+ fill: "none",
6021
+ stroke: "currentColor",
6022
+ viewBox: "0 0 24 24",
6023
+ children: [
6024
+ /* @__PURE__ */ (0, import_jsx_runtime70.jsx)(
6025
+ "path",
6026
+ {
6027
+ strokeLinecap: "round",
6028
+ strokeLinejoin: "round",
6029
+ strokeWidth: "2",
6030
+ d: "M4 16v1a3 3 0 003 3h10a3 3 0 003-3v-1m-4-4l-4 4m0 0l-4-4m4 4V4"
6031
+ }
6032
+ ),
6033
+ /* @__PURE__ */ (0, import_jsx_runtime70.jsx)(
6034
+ "path",
6035
+ {
6036
+ strokeLinecap: "round",
6037
+ strokeLinejoin: "round",
6038
+ strokeWidth: "2",
6039
+ d: "M12 12v5m0 0l-3-3m3 3l3-3M12 8v4"
6040
+ }
6041
+ )
6042
+ ]
6043
+ }
6044
+ ),
6045
+ "Download"
6046
+ ]
6047
+ }
6048
+ )
5768
6049
  ]
5769
- }
5770
- )
5771
- ] });
6050
+ },
6051
+ `${documentUrl}-${index}`
6052
+ );
6053
+ }) });
5772
6054
  };
5773
6055
  var DocumentNode_default = DocumentNode;
5774
6056
 
package/dist/index.mjs CHANGED
@@ -4037,37 +4037,275 @@ var getNestedValue4 = (obj, path) => {
4037
4037
  return current && current[key] !== void 0 ? current[key] : void 0;
4038
4038
  }, obj);
4039
4039
  };
4040
- var PdfIcon = () => /* @__PURE__ */ jsxs32("svg", { width: "24", height: "24", viewBox: "0 0 24 24", fill: "none", xmlns: "http://www.w3.org/2000/svg", className: "text-red-500 w-8 h-8", children: [
4041
- /* @__PURE__ */ jsx59("path", { d: "M7 3H14L19 8V20C19 20.5304 18.7893 21.0391 18.4142 21.4142C18.0391 21.7893 17.5304 22 17 22H7C6.46957 22 5.96086 21.7893 5.58579 21.4142C5.21071 21.0391 5 20.5304 5 20V5C5 4.46957 5.21071 3.96086 5.58579 3.58579C5.96086 3.21071 6.46957 3 7 3Z", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round" }),
4042
- /* @__PURE__ */ jsx59("path", { d: "M14 3V8H19", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round" }),
4043
- /* @__PURE__ */ jsx59("path", { d: "M9 14H11C11.5304 14 12.0391 13.7893 12.4142 13.4142C12.7893 13.0391 13 12.5304 13 12C13 11.4696 12.7893 10.9609 12.4142 10.5858C12.0391 10.2107 11.5304 10 11 10H9V18", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round" }),
4044
- /* @__PURE__ */ jsx59("path", { d: "M9 14H12", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round" })
4045
- ] });
4046
- var ExcelIcon = () => /* @__PURE__ */ jsxs32("svg", { width: "24", height: "24", viewBox: "0 0 24 24", fill: "none", xmlns: "http://www.w3.org/2000/svg", className: "text-green-600 w-8 h-8", children: [
4047
- /* @__PURE__ */ jsx59("path", { d: "M14 3V8H19", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round" }),
4048
- /* @__PURE__ */ jsx59("path", { d: "M5 20V5C5 4.46957 5.21071 3.96086 5.58579 3.58579C5.96086 3.21071 6.46957 3 7 3H14L19 8V20C19 20.5304 18.7893 21.0391 18.4142 21.4142C18.0391 21.7893 17.5304 22 17 22H7C6.46957 22 5.96086 21.7893 5.58579 21.4142C5.21071 21.0391 5 20.5304 5 20Z", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round" }),
4049
- /* @__PURE__ */ jsx59("path", { d: "M9 11L15 17", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round" }),
4050
- /* @__PURE__ */ jsx59("path", { d: "M15 11L9 17", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round" })
4051
- ] });
4052
- var WordIcon = () => /* @__PURE__ */ jsxs32("svg", { width: "24", height: "24", viewBox: "0 0 24 24", fill: "none", xmlns: "http://www.w3.org/2000/svg", className: "text-blue-600 w-8 h-8", children: [
4053
- /* @__PURE__ */ jsx59("path", { d: "M14 3V8H19", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round" }),
4054
- /* @__PURE__ */ jsx59("path", { d: "M5 20V5C5 4.46957 5.21071 3.96086 5.58579 3.58579C5.96086 3.21071 6.46957 3 7 3H14L19 8V20C19 20.5304 18.7893 21.0391 18.4142 21.4142C18.0391 21.7893 17.5304 22 17 22H7C6.46957 22 5.96086 21.7893 5.58579 21.4142C5.21071 21.0391 5 20.5304 5 20Z", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round" }),
4055
- /* @__PURE__ */ jsx59("path", { d: "M8 12L10 17L12 14L14 17L16 12", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round" })
4056
- ] });
4057
- var ImageIcon = () => /* @__PURE__ */ jsxs32("svg", { width: "24", height: "24", viewBox: "0 0 24 24", fill: "none", xmlns: "http://www.w3.org/2000/svg", className: "text-yellow-500 w-8 h-8", children: [
4058
- /* @__PURE__ */ jsx59("path", { d: "M21 15V19C21 19.5304 20.7893 20.0391 20.4142 20.4142C20.0391 20.7893 19.5304 21 19 21H5C4.46957 21 3.96086 20.7893 3.58579 20.4142C3.21071 20.0391 3 19.5304 3 19V5C3 4.46957 3.21071 3.96086 3.58579 3.58579C3.96086 3.21071 4.46957 3 5 3H19C19.5304 3 20.0391 3.21071 20.4142 3.58579C20.7893 3.96086 21 4.46957 21 5V15ZM21 15L16 10L9 17L6 14L3 17", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round" }),
4059
- /* @__PURE__ */ jsx59("path", { d: "M16 8C16 8.55228 15.5523 9 15 9C14.4477 9 14 8.55228 14 8C14 7.44772 14.4477 7 15 7C15.5523 7 16 7.44772 16 8Z", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round" })
4060
- ] });
4061
- var StandardIcon = () => /* @__PURE__ */ jsxs32("svg", { width: "24", height: "24", viewBox: "0 0 24 24", fill: "none", xmlns: "http://www.w3.org/2000/svg", className: "text-gray-500 w-8 h-8", children: [
4062
- /* @__PURE__ */ jsx59("path", { d: "M14 3V8H19", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round" }),
4063
- /* @__PURE__ */ jsx59("path", { d: "M5 20V5C5 4.46957 5.21071 3.96086 5.58579 3.58579C5.96086 3.21071 6.46957 3 7 3H14L19 8V20C19 20.5304 18.7893 21.0391 18.4142 21.4142C18.0391 21.7893 17.5304 22 17 22H7C6.46957 22 5.96086 21.7893 5.58579 21.4142C5.21071 21.0391 5 20.5304 5 20Z", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round" })
4064
- ] });
4040
+ var PdfIcon = () => /* @__PURE__ */ jsxs32(
4041
+ "svg",
4042
+ {
4043
+ width: "24",
4044
+ height: "24",
4045
+ viewBox: "0 0 24 24",
4046
+ fill: "none",
4047
+ xmlns: "http://www.w3.org/2000/svg",
4048
+ className: "text-red-500 w-8 h-8",
4049
+ children: [
4050
+ /* @__PURE__ */ jsx59(
4051
+ "path",
4052
+ {
4053
+ d: "M7 3H14L19 8V20C19 20.5304 18.7893 21.0391 18.4142 21.4142C18.0391 21.7893 17.5304 22 17 22H7C6.46957 22 5.96086 21.7893 5.58579 21.4142C5.21071 21.0391 5 20.5304 5 20V5C5 4.46957 5.21071 3.96086 5.58579 3.58579C5.96086 3.21071 6.46957 3 7 3Z",
4054
+ stroke: "currentColor",
4055
+ strokeWidth: "2",
4056
+ strokeLinecap: "round",
4057
+ strokeLinejoin: "round"
4058
+ }
4059
+ ),
4060
+ /* @__PURE__ */ jsx59(
4061
+ "path",
4062
+ {
4063
+ d: "M14 3V8H19",
4064
+ stroke: "currentColor",
4065
+ strokeWidth: "2",
4066
+ strokeLinecap: "round",
4067
+ strokeLinejoin: "round"
4068
+ }
4069
+ ),
4070
+ /* @__PURE__ */ jsx59(
4071
+ "path",
4072
+ {
4073
+ d: "M9 14H11C11.5304 14 12.0391 13.7893 12.4142 13.4142C12.7893 13.0391 13 12.5304 13 12C13 11.4696 12.7893 10.9609 12.4142 10.5858C12.0391 10.2107 11.5304 10 11 10H9V18",
4074
+ stroke: "currentColor",
4075
+ strokeWidth: "2",
4076
+ strokeLinecap: "round",
4077
+ strokeLinejoin: "round"
4078
+ }
4079
+ ),
4080
+ /* @__PURE__ */ jsx59(
4081
+ "path",
4082
+ {
4083
+ d: "M9 14H12",
4084
+ stroke: "currentColor",
4085
+ strokeWidth: "2",
4086
+ strokeLinecap: "round",
4087
+ strokeLinejoin: "round"
4088
+ }
4089
+ )
4090
+ ]
4091
+ }
4092
+ );
4093
+ var ExcelIcon = () => /* @__PURE__ */ jsxs32(
4094
+ "svg",
4095
+ {
4096
+ width: "24",
4097
+ height: "24",
4098
+ viewBox: "0 0 24 24",
4099
+ fill: "none",
4100
+ xmlns: "http://www.w3.org/2000/svg",
4101
+ className: "text-green-600 w-8 h-8",
4102
+ children: [
4103
+ /* @__PURE__ */ jsx59(
4104
+ "path",
4105
+ {
4106
+ d: "M14 3V8H19",
4107
+ stroke: "currentColor",
4108
+ strokeWidth: "2",
4109
+ strokeLinecap: "round",
4110
+ strokeLinejoin: "round"
4111
+ }
4112
+ ),
4113
+ /* @__PURE__ */ jsx59(
4114
+ "path",
4115
+ {
4116
+ d: "M5 20V5C5 4.46957 5.21071 3.96086 5.58579 3.58579C5.96086 3.21071 6.46957 3 7 3H14L19 8V20C19 20.5304 18.7893 21.0391 18.4142 21.4142C18.0391 21.7893 17.5304 22 17 22H7C6.46957 22 5.96086 21.7893 5.58579 21.4142C5.21071 21.0391 5 20.5304 5 20Z",
4117
+ stroke: "currentColor",
4118
+ strokeWidth: "2",
4119
+ strokeLinecap: "round",
4120
+ strokeLinejoin: "round"
4121
+ }
4122
+ ),
4123
+ /* @__PURE__ */ jsx59(
4124
+ "path",
4125
+ {
4126
+ d: "M9 11L15 17",
4127
+ stroke: "currentColor",
4128
+ strokeWidth: "2",
4129
+ strokeLinecap: "round",
4130
+ strokeLinejoin: "round"
4131
+ }
4132
+ ),
4133
+ /* @__PURE__ */ jsx59(
4134
+ "path",
4135
+ {
4136
+ d: "M15 11L9 17",
4137
+ stroke: "currentColor",
4138
+ strokeWidth: "2",
4139
+ strokeLinecap: "round",
4140
+ strokeLinejoin: "round"
4141
+ }
4142
+ )
4143
+ ]
4144
+ }
4145
+ );
4146
+ var WordIcon = () => /* @__PURE__ */ jsxs32(
4147
+ "svg",
4148
+ {
4149
+ width: "24",
4150
+ height: "24",
4151
+ viewBox: "0 0 24 24",
4152
+ fill: "none",
4153
+ xmlns: "http://www.w3.org/2000/svg",
4154
+ className: "text-blue-600 w-8 h-8",
4155
+ children: [
4156
+ /* @__PURE__ */ jsx59(
4157
+ "path",
4158
+ {
4159
+ d: "M14 3V8H19",
4160
+ stroke: "currentColor",
4161
+ strokeWidth: "2",
4162
+ strokeLinecap: "round",
4163
+ strokeLinejoin: "round"
4164
+ }
4165
+ ),
4166
+ /* @__PURE__ */ jsx59(
4167
+ "path",
4168
+ {
4169
+ d: "M5 20V5C5 4.46957 5.21071 3.96086 5.58579 3.58579C5.96086 3.21071 6.46957 3 7 3H14L19 8V20C19 20.5304 18.7893 21.0391 18.4142 21.4142C18.0391 21.7893 17.5304 22 17 22H7C6.46957 22 5.96086 21.7893 5.58579 21.4142C5.21071 21.0391 5 20.5304 5 20Z",
4170
+ stroke: "currentColor",
4171
+ strokeWidth: "2",
4172
+ strokeLinecap: "round",
4173
+ strokeLinejoin: "round"
4174
+ }
4175
+ ),
4176
+ /* @__PURE__ */ jsx59(
4177
+ "path",
4178
+ {
4179
+ d: "M8 12L10 17L12 14L14 17L16 12",
4180
+ stroke: "currentColor",
4181
+ strokeWidth: "2",
4182
+ strokeLinecap: "round",
4183
+ strokeLinejoin: "round"
4184
+ }
4185
+ )
4186
+ ]
4187
+ }
4188
+ );
4189
+ var StandardIcon = () => /* @__PURE__ */ jsxs32(
4190
+ "svg",
4191
+ {
4192
+ width: "24",
4193
+ height: "24",
4194
+ viewBox: "0 0 24 24",
4195
+ fill: "none",
4196
+ xmlns: "http://www.w3.org/2000/svg",
4197
+ className: "text-gray-500 w-8 h-8",
4198
+ children: [
4199
+ /* @__PURE__ */ jsx59(
4200
+ "path",
4201
+ {
4202
+ d: "M14 3V8H19",
4203
+ stroke: "currentColor",
4204
+ strokeWidth: "2",
4205
+ strokeLinecap: "round",
4206
+ strokeLinejoin: "round"
4207
+ }
4208
+ ),
4209
+ /* @__PURE__ */ jsx59(
4210
+ "path",
4211
+ {
4212
+ d: "M5 20V5C5 4.46957 5.21071 3.96086 5.58579 3.58579C5.96086 3.21071 6.46957 3 7 3H14L19 8V20C19 20.5304 18.7893 21.0391 18.4142 21.4142C18.0391 21.7893 17.5304 22 17 22H7C6.46957 22 5.96086 21.7893 5.58579 21.4142C5.21071 21.0391 5 20.5304 5 20Z",
4213
+ stroke: "currentColor",
4214
+ strokeWidth: "2",
4215
+ strokeLinecap: "round",
4216
+ strokeLinejoin: "round"
4217
+ }
4218
+ )
4219
+ ]
4220
+ }
4221
+ );
4222
+ var PowerPointIcon = () => /* @__PURE__ */ jsxs32(
4223
+ "svg",
4224
+ {
4225
+ width: "24",
4226
+ height: "24",
4227
+ viewBox: "0 0 24 24",
4228
+ fill: "none",
4229
+ xmlns: "http://www.w3.org/2000/svg",
4230
+ className: "text-orange-600 w-8 h-8",
4231
+ children: [
4232
+ /* @__PURE__ */ jsx59(
4233
+ "path",
4234
+ {
4235
+ d: "M14 3V8H19",
4236
+ stroke: "currentColor",
4237
+ strokeWidth: "2",
4238
+ strokeLinecap: "round",
4239
+ strokeLinejoin: "round"
4240
+ }
4241
+ ),
4242
+ /* @__PURE__ */ jsx59(
4243
+ "path",
4244
+ {
4245
+ d: "M5 20V5C5 3.9 5.9 3 7 3H14L19 8V20C19 21.1 18.1 22 17 22H7C5.9 22 5 21.1 5 20Z",
4246
+ stroke: "currentColor",
4247
+ strokeWidth: "2"
4248
+ }
4249
+ ),
4250
+ /* @__PURE__ */ jsx59("text", { x: "8", y: "16", fontSize: "6", fill: "currentColor", children: "P" })
4251
+ ]
4252
+ }
4253
+ );
4254
+ var TextIcon = () => /* @__PURE__ */ jsxs32(
4255
+ "svg",
4256
+ {
4257
+ width: "24",
4258
+ height: "24",
4259
+ viewBox: "0 0 24 24",
4260
+ fill: "none",
4261
+ xmlns: "http://www.w3.org/2000/svg",
4262
+ className: "text-gray-600 w-8 h-8",
4263
+ children: [
4264
+ /* @__PURE__ */ jsx59("path", { d: "M14 3V8H19", stroke: "currentColor", strokeWidth: "2" }),
4265
+ /* @__PURE__ */ jsx59(
4266
+ "path",
4267
+ {
4268
+ d: "M5 20V5C5 3.9 5.9 3 7 3H14L19 8V20C19 21.1 18.1 22 17 22H7C5.9 22 5 21.1 5 20Z",
4269
+ stroke: "currentColor",
4270
+ strokeWidth: "2"
4271
+ }
4272
+ ),
4273
+ /* @__PURE__ */ jsx59("path", { d: "M8 11H16M8 15H14", stroke: "currentColor", strokeWidth: "2" })
4274
+ ]
4275
+ }
4276
+ );
4277
+ var ArchiveIcon = () => /* @__PURE__ */ jsxs32(
4278
+ "svg",
4279
+ {
4280
+ width: "24",
4281
+ height: "24",
4282
+ viewBox: "0 0 24 24",
4283
+ fill: "none",
4284
+ xmlns: "http://www.w3.org/2000/svg",
4285
+ className: "text-yellow-700 w-8 h-8",
4286
+ children: [
4287
+ /* @__PURE__ */ jsx59(
4288
+ "rect",
4289
+ {
4290
+ x: "4",
4291
+ y: "4",
4292
+ width: "16",
4293
+ height: "16",
4294
+ rx: "2",
4295
+ stroke: "currentColor",
4296
+ strokeWidth: "2"
4297
+ }
4298
+ ),
4299
+ /* @__PURE__ */ jsx59("path", { d: "M9 8H15M10 12H14M11 16H13", stroke: "currentColor", strokeWidth: "2" })
4300
+ ]
4301
+ }
4302
+ );
4065
4303
  var getFileDetails = (url) => {
4066
4304
  const extMatch = url.match(/\.([a-zA-Z0-9]+)(?:[\?#]|$)/);
4067
4305
  const ext = extMatch ? extMatch[1].toLowerCase() : "";
4068
4306
  let Icon2 = StandardIcon;
4069
4307
  let extLabel = "FILE";
4070
- if (["pdf"].includes(ext)) {
4308
+ if (ext === "pdf") {
4071
4309
  Icon2 = PdfIcon;
4072
4310
  extLabel = "PDF";
4073
4311
  } else if (["xls", "xlsx", "csv"].includes(ext)) {
@@ -4075,10 +4313,16 @@ var getFileDetails = (url) => {
4075
4313
  extLabel = "Excel";
4076
4314
  } else if (["doc", "docx"].includes(ext)) {
4077
4315
  Icon2 = WordIcon;
4078
- extLabel = ext.toUpperCase();
4079
- } else if (["jpg", "jpeg", "png", "gif", "webp", "svg"].includes(ext)) {
4080
- Icon2 = ImageIcon;
4081
- extLabel = ext.toUpperCase();
4316
+ extLabel = "Word";
4317
+ } else if (["ppt", "pptx"].includes(ext)) {
4318
+ Icon2 = PowerPointIcon;
4319
+ extLabel = "PowerPoint";
4320
+ } else if (["txt", "rtf"].includes(ext)) {
4321
+ Icon2 = TextIcon;
4322
+ extLabel = "Text";
4323
+ } else if (["zip", "rar", "7z"].includes(ext)) {
4324
+ Icon2 = ArchiveIcon;
4325
+ extLabel = "Archive";
4082
4326
  } else if (ext) {
4083
4327
  extLabel = ext.toUpperCase();
4084
4328
  }
@@ -4089,8 +4333,7 @@ var DocumentNode = (props) => {
4089
4333
  console.log("props", props);
4090
4334
  console.log("dataitem", props.dataitem);
4091
4335
  console.log("node", props.node);
4092
- let documentUrl;
4093
- let documentTitle;
4336
+ let documents = [];
4094
4337
  if (props.dataitem && props.node.documentKey) {
4095
4338
  const docData = getNestedValue4(props.dataitem, props.node.documentKey);
4096
4339
  if (typeof docData === "string") {
@@ -4098,71 +4341,110 @@ var DocumentNode = (props) => {
4098
4341
  if (trimmed.startsWith("[") || trimmed.startsWith("{")) {
4099
4342
  try {
4100
4343
  const parsed = JSON.parse(trimmed);
4101
- const asset = Array.isArray(parsed) ? parsed[0] : parsed;
4102
- if (asset && asset.assetUrl) {
4103
- documentUrl = AssetUtility_default.resolveUrl(props.assetBaseUrl, asset.assetUrl);
4104
- if (asset.title) documentTitle = asset.title;
4344
+ if (Array.isArray(parsed)) {
4345
+ documents = parsed.filter(
4346
+ (item) => item && item.assetUrl
4347
+ );
4348
+ } else if (parsed?.assetUrl) {
4349
+ documents = [parsed];
4105
4350
  }
4106
- } catch (e) {
4351
+ } catch {
4107
4352
  }
4108
4353
  } else {
4109
- documentUrl = AssetUtility_default.resolveUrl(props.assetBaseUrl, docData);
4110
- }
4111
- } else if (Array.isArray(docData) && docData.length > 0) {
4112
- const asset = docData[0];
4113
- if (asset && asset.assetUrl) {
4114
- documentUrl = AssetUtility_default.resolveUrl(props.assetBaseUrl, asset.assetUrl);
4115
- if (asset.title) documentTitle = asset.title;
4116
- }
4117
- } else if (docData && typeof docData === "object") {
4118
- const asset = docData;
4119
- if (asset && asset.assetUrl) {
4120
- documentUrl = AssetUtility_default.resolveUrl(props.assetBaseUrl, asset.assetUrl);
4121
- if (asset.title) documentTitle = asset.title;
4354
+ documents = [
4355
+ {
4356
+ assetUrl: docData
4357
+ }
4358
+ ];
4122
4359
  }
4360
+ } else if (Array.isArray(docData)) {
4361
+ documents = docData.filter((item) => item && item.assetUrl);
4362
+ } else if (docData && typeof docData === "object" && docData.assetUrl) {
4363
+ documents = [docData];
4123
4364
  }
4124
4365
  }
4125
- if (!documentUrl) return null;
4126
- const { Icon: Icon2, extLabel } = getFileDetails(documentUrl);
4127
- if (!documentTitle) {
4128
- try {
4129
- const pathName = new URL(documentUrl).pathname;
4130
- documentTitle = pathName.split("/").pop() || "Document";
4131
- } catch {
4132
- documentTitle = documentUrl.split("/").pop() || "Document";
4133
- }
4134
- documentTitle = documentTitle.replace(/\.[^/.]+$/, "");
4135
- }
4136
- return /* @__PURE__ */ jsxs32("div", { className: "flex items-center justify-between py-4 bg-default", children: [
4137
- /* @__PURE__ */ jsxs32("div", { className: "flex items-center space-x-4", children: [
4138
- /* @__PURE__ */ jsx59("div", { className: "flex items-center justify-center p-2 rounded bg-secondary-soft border", children: /* @__PURE__ */ jsx59(Icon2, {}) }),
4139
- /* @__PURE__ */ jsxs32("div", { className: "flex items-baseline space-x-2", children: [
4140
- /* @__PURE__ */ jsx59("h4", { className: "text-base font-semibold", children: documentTitle }),
4141
- /* @__PURE__ */ jsxs32("span", { className: "text-sm font-medium", children: [
4142
- "(",
4143
- extLabel,
4144
- ")"
4145
- ] })
4146
- ] })
4147
- ] }),
4148
- /* @__PURE__ */ jsxs32(
4149
- "a",
4366
+ if (documents.length === 0) return null;
4367
+ return /* @__PURE__ */ jsx59("div", { className: "space-y-4", children: documents.map((doc, index) => {
4368
+ const documentUrl = AssetUtility_default.resolveUrl(
4369
+ props.assetBaseUrl,
4370
+ doc.assetUrl
4371
+ );
4372
+ let documentTitle = doc.title;
4373
+ if (!documentUrl) {
4374
+ return null;
4375
+ }
4376
+ if (!documentTitle) {
4377
+ try {
4378
+ const pathName = new URL(documentUrl).pathname;
4379
+ documentTitle = pathName.split("/").pop()?.replace(/\.[^/.]+$/, "") || "Document";
4380
+ } catch {
4381
+ documentTitle = documentUrl.split("/").pop()?.replace(/\.[^/.]+$/, "") || "Document";
4382
+ }
4383
+ }
4384
+ const { Icon: Icon2, extLabel } = getFileDetails(documentUrl);
4385
+ return /* @__PURE__ */ jsxs32(
4386
+ "div",
4150
4387
  {
4151
- href: documentUrl,
4152
- download: true,
4153
- target: "_blank",
4154
- rel: "noreferrer",
4155
- className: "inline-flex items-center px-4 py-2 text-sm font-medium bg-default border rounded focus:outline-none focus:ring-2 focus:ring-offset-2 transition-colors",
4388
+ className: "flex items-center justify-between py-4 bg-default",
4156
4389
  children: [
4157
- /* @__PURE__ */ jsxs32("svg", { className: "w-4 h-4 mr-2", fill: "none", stroke: "currentColor", viewBox: "0 0 24 24", xmlns: "http://www.w3.org/2000/svg", children: [
4158
- /* @__PURE__ */ jsx59("path", { strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: "2", d: "M4 16v1a3 3 0 003 3h10a3 3 0 003-3v-1m-4-4l-4 4m0 0l-4-4m4 4V4" }),
4159
- /* @__PURE__ */ jsx59("path", { strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: "2", d: "M12 12v5m0 0l-3-3m3 3l3-3M12 8v4" })
4390
+ /* @__PURE__ */ jsxs32("div", { className: "flex items-center space-x-4", children: [
4391
+ /* @__PURE__ */ jsx59("div", { className: "flex items-center justify-center p-2 rounded bg-neutral-soft", children: /* @__PURE__ */ jsx59(Icon2, {}) }),
4392
+ /* @__PURE__ */ jsxs32("div", { className: "flex items-baseline space-x-2", children: [
4393
+ /* @__PURE__ */ jsx59("h4", { className: "text-base font-semibold", children: documentTitle }),
4394
+ /* @__PURE__ */ jsxs32("span", { className: "text-sm font-medium", children: [
4395
+ "(",
4396
+ extLabel,
4397
+ ")"
4398
+ ] })
4399
+ ] })
4160
4400
  ] }),
4161
- "Download"
4401
+ /* @__PURE__ */ jsxs32(
4402
+ "a",
4403
+ {
4404
+ href: documentUrl,
4405
+ download: true,
4406
+ target: "_blank",
4407
+ rel: "noreferrer",
4408
+ className: "inline-flex items-center px-4 py-2 text-sm font-medium bg-default border rounded focus:outline-none focus:ring-2 focus:ring-offset-2 transition-colors",
4409
+ children: [
4410
+ /* @__PURE__ */ jsxs32(
4411
+ "svg",
4412
+ {
4413
+ className: "w-4 h-4 mr-2",
4414
+ fill: "none",
4415
+ stroke: "currentColor",
4416
+ viewBox: "0 0 24 24",
4417
+ children: [
4418
+ /* @__PURE__ */ jsx59(
4419
+ "path",
4420
+ {
4421
+ strokeLinecap: "round",
4422
+ strokeLinejoin: "round",
4423
+ strokeWidth: "2",
4424
+ d: "M4 16v1a3 3 0 003 3h10a3 3 0 003-3v-1m-4-4l-4 4m0 0l-4-4m4 4V4"
4425
+ }
4426
+ ),
4427
+ /* @__PURE__ */ jsx59(
4428
+ "path",
4429
+ {
4430
+ strokeLinecap: "round",
4431
+ strokeLinejoin: "round",
4432
+ strokeWidth: "2",
4433
+ d: "M12 12v5m0 0l-3-3m3 3l3-3M12 8v4"
4434
+ }
4435
+ )
4436
+ ]
4437
+ }
4438
+ ),
4439
+ "Download"
4440
+ ]
4441
+ }
4442
+ )
4162
4443
  ]
4163
- }
4164
- )
4165
- ] });
4444
+ },
4445
+ `${documentUrl}-${index}`
4446
+ );
4447
+ }) });
4166
4448
  };
4167
4449
  var DocumentNode_default = DocumentNode;
4168
4450
 
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.20260623122324",
3
+ "version": "0.8.1-dev.20260624051314",
4
4
  "description": "Reusable React components",
5
5
  "main": "dist/index.js",
6
6
  "module": "dist/index.mjs",