@acoustte-digital-services/digitalstore-controls-dev 0.8.1-dev.20260709113231 → 0.8.1-dev.20260711052655

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.
@@ -21,6 +21,7 @@ function EnterAnimationClient({ hasEnterAnimation, children }) {
21
21
  observer.observe(ref.current);
22
22
  return () => observer.disconnect();
23
23
  }, [hasEnterAnimation]);
24
+ if (!children) return null;
24
25
  return /* @__PURE__ */ jsx(Fragment, { children: children && // enforce passing the ref to Wrapper
25
26
  //@ts-ignore
26
27
  React.cloneElement(children, { ref }) });
@@ -23,6 +23,7 @@ function EnterAnimationClient({ hasEnterAnimation, children }) {
23
23
  observer.observe(ref.current);
24
24
  return () => observer.disconnect();
25
25
  }, [hasEnterAnimation]);
26
+ if (!children) return null;
26
27
  return /* @__PURE__ */ jsx(Fragment, { children: children && // enforce passing the ref to Wrapper
27
28
  //@ts-ignore
28
29
  React.cloneElement(children, { ref }) });
@@ -14,13 +14,14 @@ import {
14
14
  PercentageInput_default,
15
15
  PhoneInput_default,
16
16
  SelectWithSearchInput_default,
17
- TimeInput_default
18
- } from "./chunk-YG6FKKQJ.mjs";
17
+ TimeInput_default,
18
+ VideoView_default
19
+ } from "./chunk-NT56SZOV.mjs";
19
20
  import {
20
21
  Hyperlink,
21
22
  Icon_default,
22
23
  InputControlType_default
23
- } from "./chunk-UWFXFVUU.mjs";
24
+ } from "./chunk-DBHUCH4B.mjs";
24
25
  import {
25
26
  Button_default,
26
27
  ClientButton_default
@@ -640,8 +641,97 @@ var SwitchInput = (props) => {
640
641
  };
641
642
  var SwitchInput_default = SwitchInput;
642
643
 
644
+ // src/components/controls/edit/VideoInput.tsx
645
+ import { Fragment, jsx as jsx5, jsxs as jsxs5 } from "react/jsx-runtime";
646
+ var normalizeVideoValue = (value) => {
647
+ if (typeof value === "string") {
648
+ const trimmed = value.trim();
649
+ if (!trimmed) return void 0;
650
+ try {
651
+ const parsed = JSON.parse(trimmed);
652
+ if (typeof parsed === "string") {
653
+ return parsed;
654
+ }
655
+ if (parsed && typeof parsed === "object") {
656
+ const candidate = parsed;
657
+ if (typeof candidate.assetUrl === "string") return candidate.assetUrl;
658
+ if (typeof candidate.url === "string") return candidate.url;
659
+ if (typeof candidate.src === "string") return candidate.src;
660
+ }
661
+ } catch {
662
+ return trimmed;
663
+ }
664
+ return trimmed;
665
+ }
666
+ if (value && typeof value === "object") {
667
+ const candidate = value;
668
+ if (typeof candidate.assetUrl === "string") return candidate.assetUrl;
669
+ if (typeof candidate.url === "string") return candidate.url;
670
+ if (typeof candidate.src === "string") return candidate.src;
671
+ }
672
+ return void 0;
673
+ };
674
+ var VideoInput = (props) => {
675
+ const isReadOnly = Boolean(
676
+ props.attributes?.readOnly || props.disable || props.attributes?.disable
677
+ );
678
+ const videoUrl = normalizeVideoValue(props.value ?? props.defaultValue);
679
+ const handleChange = (event) => {
680
+ const text = event.target.value;
681
+ props.callback?.({
682
+ name: props.name,
683
+ value: text,
684
+ index: props.index,
685
+ groupKey: props.groupKey
686
+ });
687
+ };
688
+ return /* @__PURE__ */ jsxs5("div", { className: "flex flex-col gap-2", children: [
689
+ "ayush testing",
690
+ props.attributes?.label ? /* @__PURE__ */ jsxs5("label", { className: "text-sm font-medium", children: [
691
+ props.attributes.label,
692
+ props.attributes?.required ? /* @__PURE__ */ jsx5("span", { className: "ml-1 text-red-500", children: "*" }) : null
693
+ ] }) : null,
694
+ isReadOnly ? /* @__PURE__ */ jsxs5(Fragment, { children: [
695
+ "called video view",
696
+ console.log(props.value, "vkjbvbvbvsdjkvdfn"),
697
+ /* @__PURE__ */ jsx5(
698
+ VideoView_default,
699
+ {
700
+ ...props,
701
+ value: props.value ?? props.defaultValue,
702
+ assetBaseUrl: props.serviceClient?.baseUrl
703
+ }
704
+ )
705
+ ] }) : /* @__PURE__ */ jsxs5(Fragment, { children: [
706
+ /* @__PURE__ */ jsx5(
707
+ "input",
708
+ {
709
+ type: "text",
710
+ name: props.name,
711
+ id: props.name,
712
+ value: videoUrl ?? "",
713
+ onChange: handleChange,
714
+ onBlur: props.onBlur,
715
+ placeholder: props.attributes?.placeholder || "Paste a video URL or blob URL",
716
+ disabled: isReadOnly,
717
+ className: "peer input mt-1 block w-full rounded shadow-sm"
718
+ }
719
+ ),
720
+ videoUrl ? /* @__PURE__ */ jsx5(
721
+ VideoView_default,
722
+ {
723
+ ...props,
724
+ value: props.value ?? props.defaultValue,
725
+ assetBaseUrl: props.serviceClient?.baseUrl
726
+ }
727
+ ) : null
728
+ ] })
729
+ ] });
730
+ };
731
+ var VideoInput_default = VideoInput;
732
+
643
733
  // src/components/controls/edit/InputControlClient.tsx
644
- import { jsx as jsx5 } from "react/jsx-runtime";
734
+ import { jsx as jsx6 } from "react/jsx-runtime";
645
735
  var InputControl = React5.forwardRef(
646
736
  (props, ref) => {
647
737
  const ControlComponents = {
@@ -662,10 +752,11 @@ var InputControl = React5.forwardRef(
662
752
  [InputControlType_default.booleanSelect]: BooleanSelect_default,
663
753
  [InputControlType_default.timeInput]: TimeInput_default,
664
754
  [InputControlType_default.asset]: AssetUpload_default,
665
- [InputControlType_default.switchInput]: SwitchInput_default
755
+ [InputControlType_default.switchInput]: SwitchInput_default,
756
+ [InputControlType_default.videoInput]: VideoInput_default
666
757
  };
667
758
  const SelectedControlComponent = ControlComponents[props.controlType];
668
- return /* @__PURE__ */ jsx5(React5.Fragment, { children: SelectedControlComponent ? /* @__PURE__ */ jsx5(SelectedControlComponent, { ...props }) : "Control not found" });
759
+ return /* @__PURE__ */ jsx6(React5.Fragment, { children: SelectedControlComponent ? /* @__PURE__ */ jsx6(SelectedControlComponent, { ...props }) : "Control not found" });
669
760
  }
670
761
  );
671
762
  InputControl.displayName = "InputControl";
@@ -16,13 +16,14 @@ import {
16
16
  PercentageInput_default,
17
17
  PhoneInput_default,
18
18
  SelectWithSearchInput_default,
19
- TimeInput_default
20
- } from "./chunk-7ZFZLN56.mjs";
19
+ TimeInput_default,
20
+ VideoView_default
21
+ } from "./chunk-6NCGSAPP.mjs";
21
22
  import {
22
23
  Hyperlink,
23
24
  Icon_default,
24
25
  InputControlType_default
25
- } from "./chunk-FI2KJBK2.mjs";
26
+ } from "./chunk-5GHPW7SJ.mjs";
26
27
  import {
27
28
  Button_default,
28
29
  ClientButton_default
@@ -642,8 +643,97 @@ var SwitchInput = (props) => {
642
643
  };
643
644
  var SwitchInput_default = SwitchInput;
644
645
 
646
+ // src/components/controls/edit/VideoInput.tsx
647
+ import { Fragment, jsx as jsx5, jsxs as jsxs5 } from "react/jsx-runtime";
648
+ var normalizeVideoValue = (value) => {
649
+ if (typeof value === "string") {
650
+ const trimmed = value.trim();
651
+ if (!trimmed) return void 0;
652
+ try {
653
+ const parsed = JSON.parse(trimmed);
654
+ if (typeof parsed === "string") {
655
+ return parsed;
656
+ }
657
+ if (parsed && typeof parsed === "object") {
658
+ const candidate = parsed;
659
+ if (typeof candidate.assetUrl === "string") return candidate.assetUrl;
660
+ if (typeof candidate.url === "string") return candidate.url;
661
+ if (typeof candidate.src === "string") return candidate.src;
662
+ }
663
+ } catch {
664
+ return trimmed;
665
+ }
666
+ return trimmed;
667
+ }
668
+ if (value && typeof value === "object") {
669
+ const candidate = value;
670
+ if (typeof candidate.assetUrl === "string") return candidate.assetUrl;
671
+ if (typeof candidate.url === "string") return candidate.url;
672
+ if (typeof candidate.src === "string") return candidate.src;
673
+ }
674
+ return void 0;
675
+ };
676
+ var VideoInput = (props) => {
677
+ const isReadOnly = Boolean(
678
+ props.attributes?.readOnly || props.disable || props.attributes?.disable
679
+ );
680
+ const videoUrl = normalizeVideoValue(props.value ?? props.defaultValue);
681
+ const handleChange = (event) => {
682
+ const text = event.target.value;
683
+ props.callback?.({
684
+ name: props.name,
685
+ value: text,
686
+ index: props.index,
687
+ groupKey: props.groupKey
688
+ });
689
+ };
690
+ return /* @__PURE__ */ jsxs5("div", { className: "flex flex-col gap-2", children: [
691
+ "ayush testing",
692
+ props.attributes?.label ? /* @__PURE__ */ jsxs5("label", { className: "text-sm font-medium", children: [
693
+ props.attributes.label,
694
+ props.attributes?.required ? /* @__PURE__ */ jsx5("span", { className: "ml-1 text-red-500", children: "*" }) : null
695
+ ] }) : null,
696
+ isReadOnly ? /* @__PURE__ */ jsxs5(Fragment, { children: [
697
+ "called video view",
698
+ console.log(props.value, "vkjbvbvbvsdjkvdfn"),
699
+ /* @__PURE__ */ jsx5(
700
+ VideoView_default,
701
+ {
702
+ ...props,
703
+ value: props.value ?? props.defaultValue,
704
+ assetBaseUrl: props.serviceClient?.baseUrl
705
+ }
706
+ )
707
+ ] }) : /* @__PURE__ */ jsxs5(Fragment, { children: [
708
+ /* @__PURE__ */ jsx5(
709
+ "input",
710
+ {
711
+ type: "text",
712
+ name: props.name,
713
+ id: props.name,
714
+ value: videoUrl ?? "",
715
+ onChange: handleChange,
716
+ onBlur: props.onBlur,
717
+ placeholder: props.attributes?.placeholder || "Paste a video URL or blob URL",
718
+ disabled: isReadOnly,
719
+ className: "peer input mt-1 block w-full rounded shadow-sm"
720
+ }
721
+ ),
722
+ videoUrl ? /* @__PURE__ */ jsx5(
723
+ VideoView_default,
724
+ {
725
+ ...props,
726
+ value: props.value ?? props.defaultValue,
727
+ assetBaseUrl: props.serviceClient?.baseUrl
728
+ }
729
+ ) : null
730
+ ] })
731
+ ] });
732
+ };
733
+ var VideoInput_default = VideoInput;
734
+
645
735
  // src/components/controls/edit/InputControlClient.tsx
646
- import { jsx as jsx5 } from "react/jsx-runtime";
736
+ import { jsx as jsx6 } from "react/jsx-runtime";
647
737
  var InputControl = React5.forwardRef(
648
738
  (props, ref) => {
649
739
  const ControlComponents = {
@@ -664,10 +754,11 @@ var InputControl = React5.forwardRef(
664
754
  [InputControlType_default.booleanSelect]: BooleanSelect_default,
665
755
  [InputControlType_default.timeInput]: TimeInput_default,
666
756
  [InputControlType_default.asset]: AssetUpload_default,
667
- [InputControlType_default.switchInput]: SwitchInput_default
757
+ [InputControlType_default.switchInput]: SwitchInput_default,
758
+ [InputControlType_default.videoInput]: VideoInput_default
668
759
  };
669
760
  const SelectedControlComponent = ControlComponents[props.controlType];
670
- return /* @__PURE__ */ jsx5(React5.Fragment, { children: SelectedControlComponent ? /* @__PURE__ */ jsx5(SelectedControlComponent, { ...props }) : "Control not found" });
761
+ return /* @__PURE__ */ jsx6(React5.Fragment, { children: SelectedControlComponent ? /* @__PURE__ */ jsx6(SelectedControlComponent, { ...props }) : "Control not found" });
671
762
  }
672
763
  );
673
764
  InputControl.displayName = "InputControl";
@@ -1,12 +1,12 @@
1
1
  "use client";
2
2
  import {
3
3
  OdataBuilder
4
- } from "./chunk-FYGNBMII.mjs";
4
+ } from "./chunk-UFKPTMM7.mjs";
5
5
  import {
6
6
  Constants,
7
7
  Hyperlink,
8
8
  Icon_default
9
- } from "./chunk-UWFXFVUU.mjs";
9
+ } from "./chunk-DBHUCH4B.mjs";
10
10
  import "./chunk-56HSDML5.mjs";
11
11
 
12
12
  // src/components/Pagination.tsx
@@ -0,0 +1,183 @@
1
+ "use client";
2
+
3
+ "use client";
4
+ import {
5
+ OdataBuilder
6
+ } from "./chunk-X3YSXTD2.mjs";
7
+ import {
8
+ Constants,
9
+ Hyperlink,
10
+ Icon_default
11
+ } from "./chunk-5GHPW7SJ.mjs";
12
+ import "./chunk-IMNQO57B.mjs";
13
+
14
+ // src/components/Pagination.tsx
15
+ import { useMemo } from "react";
16
+ import { jsx, jsxs } from "react/jsx-runtime";
17
+ var Pagination = (props) => {
18
+ const { dataset, path, query, showPageSizeSelector = false, showJumpToPage = false } = props;
19
+ const builder = useMemo(() => {
20
+ const b = new OdataBuilder(path);
21
+ if (query) b.setQuery(query);
22
+ return b;
23
+ }, [path, query]);
24
+ const activePageNumber = builder.getPageNumber(Constants.pagesize);
25
+ const totalItems = dataset?.count || 0;
26
+ const itemsPerPage = parseInt(builder.top || Constants.pagesize.toString());
27
+ const totalPages = Math.ceil(totalItems / itemsPerPage);
28
+ const startItem = totalItems > 0 ? (activePageNumber - 1) * itemsPerPage + 1 : 0;
29
+ const endItem = Math.min(activePageNumber * itemsPerPage, totalItems);
30
+ const getPaginationRange = () => {
31
+ const delta = 1;
32
+ const range = [];
33
+ if (totalPages <= 7) {
34
+ return Array.from({ length: totalPages }, (_, i) => i + 1);
35
+ }
36
+ range.push(1);
37
+ let start = Math.max(2, activePageNumber - delta);
38
+ let end = Math.min(totalPages - 1, activePageNumber + delta);
39
+ if (activePageNumber - delta <= 2) {
40
+ end = Math.min(totalPages - 1, 4);
41
+ }
42
+ if (activePageNumber + delta >= totalPages - 1) {
43
+ start = Math.max(2, totalPages - 4);
44
+ }
45
+ if (start > 2) {
46
+ range.push("...");
47
+ }
48
+ for (let i = start; i <= end; i++) {
49
+ range.push(i);
50
+ }
51
+ if (end < totalPages - 1) {
52
+ range.push("...");
53
+ }
54
+ if (totalPages > 1) {
55
+ range.push(totalPages);
56
+ }
57
+ return range;
58
+ };
59
+ const paginationRange = getPaginationRange();
60
+ const PageButton = ({ page, children }) => /* @__PURE__ */ jsx(
61
+ Hyperlink,
62
+ {
63
+ linkType: "Link" /* Link */,
64
+ className: `
65
+ min-w-[20px] md:min-w-[40px] h-10 flex items-center justify-center px-2.5 md:px-3
66
+ border text-sm font-medium transition-colors duration-150
67
+ ${activePageNumber === page ? "bg-primary-base font-semibold" : ""}
68
+ `,
69
+ href: builder.getNewPageUrl(page),
70
+ children
71
+ }
72
+ );
73
+ const NavigationButton = ({ page, disabled, children }) => {
74
+ if (disabled) {
75
+ return /* @__PURE__ */ jsx("span", { className: "min-w-[20px] md:min-w-[40px] h-10 flex items-center justify-center px-2 md:px-3 border bg-neutral-base cursor-not-allowed", children });
76
+ }
77
+ return /* @__PURE__ */ jsx(
78
+ Hyperlink,
79
+ {
80
+ className: "min-w-[20px] md:min-w-[40px] h-10 flex items-center justify-center px-2 md:px-3 border transition-colors duration-150",
81
+ href: builder.getNewPageUrl(page),
82
+ children
83
+ }
84
+ );
85
+ };
86
+ if (totalPages <= 1 && totalItems === 0) return null;
87
+ return /* @__PURE__ */ jsxs("div", { className: "py-6 border-t bg-default", children: [
88
+ /* @__PURE__ */ jsxs("div", { className: "flex flex-col sm:flex-row items-center justify-between gap-4", children: [
89
+ /* @__PURE__ */ jsxs("div", { className: "text-sm", children: [
90
+ "Showing ",
91
+ /* @__PURE__ */ jsxs("span", { className: "font-semibold", children: [
92
+ startItem,
93
+ "-",
94
+ endItem
95
+ ] }),
96
+ " ",
97
+ "out of ",
98
+ /* @__PURE__ */ jsx("span", { className: "font-semibold", children: totalItems.toLocaleString() }),
99
+ " results"
100
+ ] }),
101
+ totalPages > 1 && /* @__PURE__ */ jsxs("div", { className: "flex items-center space-x-1", children: [
102
+ /* @__PURE__ */ jsxs(
103
+ NavigationButton,
104
+ {
105
+ page: activePageNumber - 1,
106
+ disabled: activePageNumber === 1,
107
+ children: [
108
+ /* @__PURE__ */ jsx("span", { children: /* @__PURE__ */ jsx(Icon_default, { name: "chevronLeft", className: "w-4 h-4 mr-1" }) }),
109
+ /* @__PURE__ */ jsx("span", { className: "text-sm", children: "Prev" })
110
+ ]
111
+ }
112
+ ),
113
+ paginationRange.map((item, index) => {
114
+ if (item === "...") {
115
+ return /* @__PURE__ */ jsx(
116
+ "span",
117
+ {
118
+ className: "min-w-[20px] md:min-w-[40px] h-10 flex items-center justify-center text-gray-500",
119
+ children: "..."
120
+ },
121
+ `ellipsis-${index}`
122
+ );
123
+ }
124
+ const page = item;
125
+ return /* @__PURE__ */ jsx(PageButton, { page, children: page }, page);
126
+ }),
127
+ /* @__PURE__ */ jsxs(
128
+ NavigationButton,
129
+ {
130
+ page: activePageNumber + 1,
131
+ disabled: activePageNumber === totalPages,
132
+ children: [
133
+ /* @__PURE__ */ jsx("span", { className: "text-sm", children: "Next" }),
134
+ /* @__PURE__ */ jsx("span", { children: /* @__PURE__ */ jsx(Icon_default, { name: "chevronRight", className: "w-4 h-4 ml-1" }) })
135
+ ]
136
+ }
137
+ )
138
+ ] }),
139
+ showJumpToPage && totalPages > 5 && /* @__PURE__ */ jsxs("div", { className: "flex items-center space-x-2", children: [
140
+ /* @__PURE__ */ jsx("span", { className: "text-sm", children: "Go to:" }),
141
+ /* @__PURE__ */ jsx("div", { className: "relative", children: /* @__PURE__ */ jsx(
142
+ "input",
143
+ {
144
+ type: "number",
145
+ min: "1",
146
+ max: totalPages,
147
+ defaultValue: activePageNumber,
148
+ className: "w-20 h-10 px-3 border rounded text-sm focus:outline-none focus:ring-2 focus:border-transparent",
149
+ onKeyDown: (e) => {
150
+ if (e.key === "Enter") {
151
+ const input = e.target;
152
+ const page = parseInt(input.value);
153
+ if (page >= 1 && page <= totalPages && page !== activePageNumber) {
154
+ window.location.href = builder.getNewPageUrl(page);
155
+ }
156
+ }
157
+ }
158
+ }
159
+ ) })
160
+ ] })
161
+ ] }),
162
+ showPageSizeSelector && /* @__PURE__ */ jsx("div", { className: "mt-4 pt-4 border-t bg-default", children: /* @__PURE__ */ jsxs("div", { className: "flex items-center justify-center space-x-2", children: [
163
+ /* @__PURE__ */ jsx("span", { className: "text-sm", children: "Show:" }),
164
+ /* @__PURE__ */ jsx("div", { className: "flex space-x-1", children: [10, 25, 50, 100].map((size) => /* @__PURE__ */ jsx(
165
+ Hyperlink,
166
+ {
167
+ className: `
168
+ px-3 py-1 text-sm rounded border transition-colors duration-150
169
+ ${itemsPerPage === size ? "bg-primary-base font-medium" : "bg-neutral-weak"}
170
+ `,
171
+ href: builder.getNewPageSizeUrl(size),
172
+ children: size
173
+ },
174
+ size
175
+ )) }),
176
+ /* @__PURE__ */ jsx("span", { className: "text-sm", children: "per page" })
177
+ ] }) })
178
+ ] });
179
+ };
180
+ var Pagination_default = Pagination;
181
+ export {
182
+ Pagination_default as default
183
+ };
@@ -0,0 +1,111 @@
1
+ "use client";
2
+
3
+ import {
4
+ buttonClasses
5
+ } from "./chunk-IMNQO57B.mjs";
6
+
7
+ // src/components/controls/edit/InputControlType.tsx
8
+ var Constants = {
9
+ pagesize: 10
10
+ };
11
+ var InputControlType = {
12
+ lineTextInput: "text",
13
+ multilineTextInput: "multilinetext",
14
+ emailInput: "email",
15
+ moneyInput: "money",
16
+ select: "select",
17
+ percentageInput: "percentage",
18
+ asset: "asset",
19
+ phoneInput: "phone",
20
+ numberInput: "number",
21
+ checkboxInput: "boolean",
22
+ otpInput: "otp",
23
+ datetimeInput: "datetime",
24
+ timeInput: "time",
25
+ colorInput: "colorInput",
26
+ selectWithSearchInput: "selectWithSearchInput",
27
+ selectWithSearchPanel: "selectWithSearchPanel",
28
+ booleanSelect: "booleanSelect",
29
+ switchInput: "switchInput",
30
+ videoInput: "videoInput"
31
+ };
32
+ var InputControlType_default = InputControlType;
33
+
34
+ // src/components/dataForm/Hyperlink.tsx
35
+ import Link from "next/link";
36
+ import { Fragment, jsx } from "react/jsx-runtime";
37
+ function Hyperlink(props) {
38
+ let linkClass = props.linkType ? buttonClasses.get(props.linkType) : buttonClasses.get("Link" /* Link */);
39
+ const target = props?.href?.startsWith("http") ? "_blank" : "_self";
40
+ const additionalProps = {};
41
+ if (target == "_blank") {
42
+ additionalProps.rel = "noopener noreferrer";
43
+ }
44
+ return /* @__PURE__ */ jsx(Fragment, { children: props.href ? /* @__PURE__ */ jsx(
45
+ Link,
46
+ {
47
+ href: props.href,
48
+ prefetch: false,
49
+ className: [linkClass, props.className].filter(Boolean).join(" "),
50
+ ...additionalProps,
51
+ target,
52
+ children: props.children
53
+ }
54
+ ) : props.isHeading ? /* @__PURE__ */ jsx("h5", { className: props.className + "inline-block", children: props.children }) : /* @__PURE__ */ jsx("span", { className: props.className, children: props.children }) });
55
+ }
56
+
57
+ // src/svg/chevron-updown.tsx
58
+ import { jsx as jsx2 } from "react/jsx-runtime";
59
+ var ChevronUpDown = (props) => {
60
+ return /* @__PURE__ */ jsx2("svg", { xmlns: "http://www.w3.org/2000/svg", fill: "none", viewBox: "0 0 24 24", strokeWidth: 1.5, stroke: "currentColor", className: props.className, children: /* @__PURE__ */ jsx2("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M8.25 15L12 18.75 15.75 15m-7.5-6L12 5.25 15.75 9" }) });
61
+ };
62
+ var chevron_updown_default = ChevronUpDown;
63
+
64
+ // src/svg/chevron-down.tsx
65
+ import { jsx as jsx3 } from "react/jsx-runtime";
66
+ var ChevronDown = (props) => {
67
+ return /* @__PURE__ */ jsx3("svg", { xmlns: "http://www.w3.org/2000/svg", fill: "none", viewBox: "0 0 24 24", strokeWidth: 1.5, stroke: "currentColor", className: props.className, children: /* @__PURE__ */ jsx3("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M19.5 8.25l-7.5 7.5-7.5-7.5" }) });
68
+ };
69
+ var chevron_down_default = ChevronDown;
70
+
71
+ // src/svg/chevron-up.tsx
72
+ import { jsx as jsx4 } from "react/jsx-runtime";
73
+ var ChevronUp = (props) => {
74
+ return /* @__PURE__ */ jsx4("svg", { xmlns: "http://www.w3.org/2000/svg", fill: "none", viewBox: "0 0 24 24", strokeWidth: 1.5, stroke: "currentColor", className: props.className, children: /* @__PURE__ */ jsx4("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M4.5 15.75l7.5-7.5 7.5 7.5" }) });
75
+ };
76
+ var chevron_up_default = ChevronUp;
77
+
78
+ // src/svg/plus.tsx
79
+ import { jsx as jsx5 } from "react/jsx-runtime";
80
+ var Plus = (props) => {
81
+ return /* @__PURE__ */ jsx5("svg", { xmlns: "http://www.w3.org/2000/svg", fill: "none", viewBox: "0 0 24 24", strokeWidth: 1.5, stroke: "currentColor", className: props.className, children: /* @__PURE__ */ jsx5("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M12 4.5v15m7.5-7.5h-15" }) });
82
+ };
83
+ var plus_default = Plus;
84
+
85
+ // src/svg/Icons.tsx
86
+ var Icons = {
87
+ chevronUpDown: chevron_updown_default,
88
+ chevronDown: chevron_down_default,
89
+ chevronUp: chevron_up_default,
90
+ plus: plus_default
91
+ };
92
+ var Icons_default = Icons;
93
+
94
+ // src/svg/Icon.tsx
95
+ import { jsx as jsx6 } from "react/jsx-runtime";
96
+ var Icon = ({ name, className, ...props }) => {
97
+ const IconComponent = Icons_default[name];
98
+ if (!IconComponent) {
99
+ console.error(`Icon "${name}" not found.`);
100
+ return null;
101
+ }
102
+ return /* @__PURE__ */ jsx6(IconComponent, { ...props, className });
103
+ };
104
+ var Icon_default = Icon;
105
+
106
+ export {
107
+ Constants,
108
+ InputControlType_default,
109
+ Hyperlink,
110
+ Icon_default
111
+ };
@@ -884,8 +884,90 @@ var AssetUtility = class {
884
884
  };
885
885
  var AssetUtility_default = AssetUtility;
886
886
 
887
+ // src/components/controls/view/VideoView.tsx
888
+ import { jsx as jsx15, jsxs as jsxs15 } from "react/jsx-runtime";
889
+ var parseAssets = (value) => {
890
+ if (!value) return [];
891
+ if (Array.isArray(value)) {
892
+ return value;
893
+ }
894
+ if (typeof value === "string") {
895
+ const trimmed = value.trim();
896
+ if (!trimmed) return [];
897
+ try {
898
+ const parsed = JSON.parse(trimmed);
899
+ if (Array.isArray(parsed)) {
900
+ return parsed;
901
+ }
902
+ if (parsed && typeof parsed === "object") {
903
+ return [parsed];
904
+ }
905
+ } catch {
906
+ return [{ assetUrl: trimmed }];
907
+ }
908
+ return [{ assetUrl: trimmed }];
909
+ }
910
+ if (typeof value === "object") {
911
+ return [value];
912
+ }
913
+ return [];
914
+ };
915
+ var VideoView = (props) => {
916
+ const assets = parseAssets(props.value);
917
+ const asset = assets.find((item) => item.type?.toLowerCase() === "video") ?? assets[0];
918
+ if (!asset?.assetUrl) {
919
+ return null;
920
+ }
921
+ const resolvedAssetUrl = AssetUtility_default.resolveUrl(props.assetBaseUrl ?? props.apiBaseUrl, asset.assetUrl);
922
+ const resolvedPosterUrl = asset.posterUrl ? AssetUtility_default.resolveUrl(props.assetBaseUrl ?? props.apiBaseUrl, asset.posterUrl) : void 0;
923
+ const isHls = resolvedAssetUrl?.endsWith(".m3u8");
924
+ const isVideoFile = /\.(mp4|webm|ogg|mov)$/i.test(resolvedAssetUrl ?? "");
925
+ const titleText = typeof asset.title === "string" ? asset.title : typeof props.customProps?.title === "string" ? props.customProps.title : "Video";
926
+ const fileName = typeof asset.title === "string" ? asset.title : asset.assetUrl?.split("/").pop() || "video";
927
+ const containerStyle = {
928
+ width: props.width || "100%"
929
+ };
930
+ const renderMedia = () => {
931
+ if (resolvedAssetUrl && isVideoFile) {
932
+ return /* @__PURE__ */ jsx15("div", { className: "w-full overflow-hidden rounded-lg bg-black", children: /* @__PURE__ */ jsxs15(
933
+ "video",
934
+ {
935
+ controls: true,
936
+ playsInline: true,
937
+ preload: "metadata",
938
+ poster: resolvedPosterUrl,
939
+ className: "w-full h-auto max-h-[70vh] object-contain bg-black",
940
+ style: { width: "100%" },
941
+ children: [
942
+ /* @__PURE__ */ jsx15("source", { src: resolvedAssetUrl }),
943
+ "Your browser does not support the video tag."
944
+ ]
945
+ }
946
+ ) });
947
+ }
948
+ return null;
949
+ };
950
+ return /* @__PURE__ */ jsxs15("div", { style: containerStyle, className: "flex flex-col gap-2", children: [
951
+ titleText ? /* @__PURE__ */ jsx15("div", { className: "font-medium text-sm", children: titleText }) : null,
952
+ renderMedia(),
953
+ resolvedAssetUrl ? /* @__PURE__ */ jsx15(
954
+ "a",
955
+ {
956
+ href: resolvedAssetUrl,
957
+ download: fileName,
958
+ target: "_blank",
959
+ rel: "noreferrer",
960
+ className: "inline-flex w-fit items-center rounded-md border border-slate-300 px-3 py-2 text-sm font-medium text-slate-700 hover:bg-slate-50",
961
+ children: "Download video"
962
+ }
963
+ ) : null
964
+ ] });
965
+ };
966
+ var VideoView_default = VideoView;
967
+
887
968
  export {
888
969
  AssetUtility_default,
970
+ VideoView_default,
889
971
  MultilineTextInput_default,
890
972
  LineTextInput_default,
891
973
  MoneyInput_default,