@nice2dev/ui 1.1.9 → 1.2.0

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 (163) hide show
  1. package/CHANGELOG.md +150 -0
  2. package/README.md +27 -34
  3. package/dist/NiceButton-5tWvfXKl.cjs +1 -0
  4. package/dist/NiceButton-DHSgQT1_.js +112 -0
  5. package/dist/NiceCodeEditor-B8At55f5.js +1179 -0
  6. package/dist/NiceCodeEditor-BJSEzhcY.cjs +260 -0
  7. package/dist/NiceCodeEditor-BfkH1bsZ.cjs +260 -0
  8. package/dist/NiceCodeEditor-CduGYggj.js +1179 -0
  9. package/dist/NiceColorPicker-CdUnhM-A.cjs +1 -0
  10. package/dist/NiceColorPicker-DCgmE-3H.cjs +1 -0
  11. package/dist/NiceColorPicker-DK30kJgy.js +486 -0
  12. package/dist/NiceColorPicker-DpXwnDwL.js +598 -0
  13. package/dist/NiceColorPicker-DtPFxDKM.cjs +1 -0
  14. package/dist/NiceColorPicker-bNJBAU_c.js +598 -0
  15. package/dist/NiceConfirmDialog-B7aNRL2K.cjs +1 -0
  16. package/dist/NiceConfirmDialog-BdhWenrO.js +81 -0
  17. package/dist/NiceDataGrid-BOCJr6XF.js +2217 -0
  18. package/dist/NiceDataGrid-BV5Oh-gy.cjs +10 -0
  19. package/dist/NiceDataGrid-CVYEo_nv.cjs +10 -0
  20. package/dist/NiceDataGrid-D-rm4lu8.js +2217 -0
  21. package/dist/NiceDataGrid-Dd7SI-M6.cjs +10 -0
  22. package/dist/NiceDataGrid-DjZchXYG.js +2217 -0
  23. package/dist/NiceDocumentViewer-BgcgLWJ3.cjs +180 -0
  24. package/dist/NiceDocumentViewer-sukmGhRx.js +672 -0
  25. package/dist/NiceForm-BCEXovJR.cjs +1 -0
  26. package/dist/NiceForm-D7oyWHXg.js +4820 -0
  27. package/dist/NiceForm-DUhxXArr.js +4817 -0
  28. package/dist/NiceForm-DVc0Xoly.js +4819 -0
  29. package/dist/NiceForm-qD_RKPYz.cjs +1 -0
  30. package/dist/NiceForm-uCeVmTrD.cjs +1 -0
  31. package/dist/NiceGantt-4UBd4uJ8.cjs +1 -0
  32. package/dist/NiceGantt-B_1lwEsp.js +328 -0
  33. package/dist/NiceHtmlEditor-BYk1roA4.cjs +10 -0
  34. package/dist/NiceHtmlEditor-Bce9Vwe1.cjs +10 -0
  35. package/dist/NiceHtmlEditor-C5kLeF9H.cjs +10 -0
  36. package/dist/NiceHtmlEditor-CFVMIC5L.js +848 -0
  37. package/dist/NiceHtmlEditor-CGRgcu2h.js +848 -0
  38. package/dist/NiceHtmlEditor-mWebBmy1.js +849 -0
  39. package/dist/NiceLoginForm-BHyDY7br.cjs +1 -0
  40. package/dist/NiceLoginForm-BTuQ0eKk.cjs +1 -0
  41. package/dist/NiceLoginForm-BuxFY2Rk.js +750 -0
  42. package/dist/NiceLoginForm-o1A-TBcp.js +736 -0
  43. package/dist/NiceLoginForm.css +1 -0
  44. package/dist/NiceMention-CA7CL5BI.js +11263 -0
  45. package/dist/NiceMention-CHcKRl-L.cjs +430 -0
  46. package/dist/NiceMention-DJD0BLcp.js +11269 -0
  47. package/dist/NiceMention-DcaUEMSg.cjs +430 -0
  48. package/dist/NiceMention-Dds9GQzk.cjs +430 -0
  49. package/dist/NiceMention-DlLXWddO.js +11268 -0
  50. package/dist/NiceMention.css +1 -1
  51. package/dist/NiceModal-C4p8a82e.cjs +1 -0
  52. package/dist/NiceModal-Dr1e3nQZ.cjs +1 -0
  53. package/dist/NiceModal-TNlkaL_i.js +85 -0
  54. package/dist/NiceModal-sihGCfDy.js +95 -0
  55. package/dist/NiceModuleLifecyclePanel-BWbKdVC_.js +7054 -0
  56. package/dist/NiceModuleLifecyclePanel-CZHIzvkE.cjs +1 -0
  57. package/dist/NiceModuleLifecyclePanel-Du7G3-RG.js +7053 -0
  58. package/dist/NiceModuleLifecyclePanel-OC9YK2kG.js +7052 -0
  59. package/dist/NiceModuleLifecyclePanel-_OcfDmtC.cjs +1 -0
  60. package/dist/NiceModuleLifecyclePanel-js1p7LIY.cjs +1 -0
  61. package/dist/NicePagination-8XsBbMNx.js +165 -0
  62. package/dist/NicePagination-CkOoXf0f.js +165 -0
  63. package/dist/NicePagination-D44waj9o.cjs +1 -0
  64. package/dist/NicePagination-D7lek1G7.cjs +1 -0
  65. package/dist/NicePagination-DdxH8KMG.js +179 -0
  66. package/dist/NicePagination-OjTEfZJE.cjs +1 -0
  67. package/dist/NicePivotGrid-B2YHP3Z6.js +1183 -0
  68. package/dist/NicePivotGrid-BJRSciWl.js +1183 -0
  69. package/dist/NicePivotGrid-BtVUWiud.cjs +152 -0
  70. package/dist/NicePivotGrid-CS1dPmNI.cjs +152 -0
  71. package/dist/NicePivotGrid-D2AxqDzJ.js +1183 -0
  72. package/dist/NicePivotGrid-DxQ6Py9D.cjs +152 -0
  73. package/dist/NiceSavedQueryPanel-B5HhqlAI.cjs +586 -0
  74. package/dist/NiceSavedQueryPanel-C0A-eoYN.js +5142 -0
  75. package/dist/NiceSavedQueryPanel-CMStDOKe.js +5125 -0
  76. package/dist/NiceSavedQueryPanel-D2i34e_b.cjs +586 -0
  77. package/dist/NiceSavedQueryPanel-ZrilZRtf.cjs +586 -0
  78. package/dist/NiceSavedQueryPanel-mPO2THs7.js +5142 -0
  79. package/dist/NiceSavedQueryPanel.css +1 -1
  80. package/dist/NiceScheduler-7gP7vcLy.cjs +5 -0
  81. package/dist/NiceScheduler-Cy7F9tgH.js +1693 -0
  82. package/dist/NiceScheduler-DquRUZxD.cjs +5 -0
  83. package/dist/NiceScheduler-KSzaUQxC.js +1693 -0
  84. package/dist/NiceScheduler-O3AwmdGG.cjs +5 -0
  85. package/dist/NiceScheduler-l8N4yCWd.js +1716 -0
  86. package/dist/NiceSelect-BCbWtu1v.js +433 -0
  87. package/dist/NiceSelect-BqtiQbfD.cjs +1 -0
  88. package/dist/NiceSelect-DZB1Rs9x.js +435 -0
  89. package/dist/NiceSelect-tMz9QQUs.cjs +1 -0
  90. package/dist/NiceStreamDashboard.doc-74KUXya1.cjs +8 -0
  91. package/dist/NiceStreamDashboard.doc-k8PQfCM0.js +32 -0
  92. package/dist/NiceWindow-BEov3s9F.js +2094 -0
  93. package/dist/NiceWindow-BU1Ce7gS.js +1623 -0
  94. package/dist/NiceWindow-CDt6PCEg.cjs +1 -0
  95. package/dist/NiceWindow-jjdE6vGy.cjs +1 -0
  96. package/dist/NiceWindow.css +1 -1
  97. package/dist/charts-C047IMVn.cjs +768 -0
  98. package/dist/charts-C44vJber.cjs +768 -0
  99. package/dist/charts-CCXSb3xk.js +4752 -0
  100. package/dist/charts-CqETcUhH.js +4752 -0
  101. package/dist/charts-DouiiHOT.cjs +768 -0
  102. package/dist/charts-XVlDwU0y.js +4732 -0
  103. package/dist/charts.cjs +1 -1
  104. package/dist/charts.mjs +8 -8
  105. package/dist/core-BL-KmGYC.js +795 -0
  106. package/dist/core-BxiH7vkV.cjs +1 -0
  107. package/dist/core-Chg-oYCr.cjs +1 -0
  108. package/dist/core-CxBnKAhs.cjs +1 -0
  109. package/dist/core-DMV6_SEE.js +795 -0
  110. package/dist/core-D_LRh59n.js +795 -0
  111. package/dist/data-branching-Km4lc8P_.cjs +1 -0
  112. package/dist/data-branching-YQtJJEtn.js +6273 -0
  113. package/dist/data-branching-oEH04O3i.js +6273 -0
  114. package/dist/data-branching-wmsbLNfa.cjs +1 -0
  115. package/dist/data-branching.cjs +1 -1
  116. package/dist/data-branching.mjs +1 -1
  117. package/dist/data.cjs +1 -1
  118. package/dist/data.d.ts +2 -53
  119. package/dist/data.mjs +3 -3
  120. package/dist/devops-Bt6EsfPa.cjs +17 -0
  121. package/dist/devops-CnZQ1rU5.js +8312 -0
  122. package/dist/devops-D5yIDM3e.js +8312 -0
  123. package/dist/devops-rVpB0ZAX.cjs +17 -0
  124. package/dist/devops.cjs +1 -1
  125. package/dist/devops.mjs +1 -1
  126. package/dist/editors.cjs +1 -1
  127. package/dist/editors.d.ts +8 -26
  128. package/dist/editors.mjs +55 -54
  129. package/dist/feedback.cjs +1 -1
  130. package/dist/feedback.d.ts +5 -0
  131. package/dist/feedback.mjs +3 -3
  132. package/dist/index.cjs +290 -290
  133. package/dist/index.css +1 -1
  134. package/dist/index.d.ts +239 -234
  135. package/dist/index.mjs +20262 -19440
  136. package/dist/lazy.cjs +1 -1
  137. package/dist/lazy.mjs +29 -29
  138. package/dist/navigation.cjs +1 -1
  139. package/dist/navigation.d.ts +4 -4
  140. package/dist/navigation.mjs +69 -69
  141. package/dist/no-code-4GtIBr6f.js +7503 -0
  142. package/dist/no-code-6WyYb3hL.cjs +331 -0
  143. package/dist/no-code-BH5oVFC6.js +8186 -0
  144. package/dist/no-code-Bdwh1vyS.cjs +332 -0
  145. package/dist/no-code-CnHG5_Vn.js +8186 -0
  146. package/dist/no-code-DMKlg1Zl.cjs +331 -0
  147. package/dist/no-code.cjs +1 -1
  148. package/dist/no-code.css +1 -1
  149. package/dist/no-code.d.ts +25 -18
  150. package/dist/no-code.mjs +3 -3
  151. package/dist/overlays.cjs +1 -1
  152. package/dist/overlays.d.ts +24 -24
  153. package/dist/overlays.mjs +24 -490
  154. package/dist/pickerCommons-0vyK1Knv.js +547 -0
  155. package/dist/pickerCommons-31hyz1gs.js +1122 -0
  156. package/dist/pickerCommons-BFbItm8o.cjs +1 -0
  157. package/dist/pickerCommons-BHirHJyn.js +548 -0
  158. package/dist/pickerCommons-BifIkPdk.cjs +1 -0
  159. package/dist/pickerCommons-Bt8JIaTN.cjs +1 -0
  160. package/dist/pickerCommons.css +1 -1
  161. package/dist/style.css +10 -7
  162. package/package.json +5 -7
  163. package/css/legacy-bg-text-aliases.css +0 -87
@@ -0,0 +1,435 @@
1
+ import { jsxs as o, jsx as n, Fragment as xe } from "react/jsx-runtime";
2
+ import { NiceThemeContext as He, useNiceAccessMode as Ke, useNiceTranslation as We, useComponentDisplayStyle as qe, useComponentDisplayClass as Be, useControlId as Ue, useDisplayModeEdit as Pe, useNiceLookupSource as Ve, COMMON_SHORTCUTS as de, NiceKeyboardHint as Ge, DisplayModeView as Je, NiceIcon as be } from "@nice2dev/ui-core";
3
+ import Qe, { useRef as se, useState as _, useContext as Xe, useLayoutEffect as fe, useEffect as Ye, forwardRef as Ze, useMemo as q, useCallback as ue } from "react";
4
+ import { createPortal as en } from "react-dom";
5
+ function nn(a) {
6
+ const s = a?.closest?.("[data-theme], .nice-dark, .nice-light, .dark");
7
+ if (!s)
8
+ return "";
9
+ const p = s.getAttribute("data-theme");
10
+ return p === "dark" || s.classList.contains("nice-dark") || s.classList.contains("dark") ? "nice-dark" : p === "light" || s.classList.contains("nice-light") ? "nice-light" : "";
11
+ }
12
+ function tn(a, s, p, d) {
13
+ const B = d?.maxHeight ?? 320, k = d?.anchorKey, $ = se(null), [he, U] = _(null), [ce, P] = _(!1), [le, A] = _(""), v = Xe(He)?.portalTarget ?? (typeof document < "u" ? document.body : null), u = se(p);
14
+ return u.current = p, fe(() => {
15
+ if (!a || !s.current)
16
+ return;
17
+ A(nn(s.current)), P(!1);
18
+ const g = () => {
19
+ const C = s.current;
20
+ if (!C)
21
+ return;
22
+ const l = C.getBoundingClientRect(), E = $.current?.offsetHeight ?? B;
23
+ let L = l.bottom;
24
+ L + E > window.innerHeight - 8 && l.top - E > 8 && (L = l.top - E);
25
+ let S = l.left;
26
+ S + l.width > window.innerWidth - 8 && (S = Math.max(8, window.innerWidth - l.width - 8)), U(
27
+ (w) => w && w.left === S && w.top === L && w.width === l.width ? w : { left: S, top: L, width: l.width }
28
+ );
29
+ };
30
+ g();
31
+ const c = requestAnimationFrame(() => {
32
+ g(), P(!0);
33
+ }), y = (C) => {
34
+ const l = C.target;
35
+ l instanceof Node && ($.current?.contains(l) || s.current?.contains(l)) || u.current();
36
+ }, m = () => u.current();
37
+ return window.addEventListener("scroll", y, !0), window.addEventListener("resize", m), () => {
38
+ cancelAnimationFrame(c), window.removeEventListener("scroll", y, !0), window.removeEventListener("resize", m);
39
+ };
40
+ }, [a, s, B, k]), Ye(() => {
41
+ if (!a)
42
+ return;
43
+ const g = (y) => {
44
+ const m = y.target;
45
+ s.current?.contains(m) || $.current?.contains(m) || (m instanceof Element ? m : m?.parentElement ?? null)?.closest('.nice-select__dropdown, [role="listbox"], [role="option"]') || u.current();
46
+ }, c = (y) => {
47
+ y.key === "Escape" && u.current();
48
+ };
49
+ return document.addEventListener("mousedown", g), document.addEventListener("keydown", c), () => {
50
+ document.removeEventListener("mousedown", g), document.removeEventListener("keydown", c);
51
+ };
52
+ }, [a, s]), { popupRef: $, coords: he, ready: ce, themeClass: le, portalTarget: v };
53
+ }
54
+ const ke = Ze(
55
+ ({
56
+ label: a,
57
+ "aria-label": s,
58
+ helperText: p,
59
+ error: d,
60
+ required: B,
61
+ disabled: k,
62
+ size: $ = "md",
63
+ name: he,
64
+ id: U,
65
+ className: ce,
66
+ style: P,
67
+ accessMode: le,
68
+ displayStyle: A,
69
+ options: pe,
70
+ value: v,
71
+ onChange: u,
72
+ placeholder: g,
73
+ multiple: c = !1,
74
+ searchable: y = !0,
75
+ clearable: m = !1,
76
+ emptyText: C,
77
+ maxHeight: l = 240,
78
+ optionsSource: E,
79
+ valueField: L,
80
+ labelField: S,
81
+ virtualScroll: w,
82
+ optionHeight: O = 36,
83
+ onSearch: F,
84
+ loading: N,
85
+ renderOption: V,
86
+ multipleAutosize: G = !1,
87
+ showKeyboardHints: $e,
88
+ labelPlacement: Ce,
89
+ errorPlacement: J,
90
+ labelWidth: Q,
91
+ controlWidth: z,
92
+ displayMode: Ee
93
+ }, X) => {
94
+ const re = Ke(le, U), Me = re === "hidden";
95
+ (re === "disabled" || re === "readOnly") && (k = !0);
96
+ const { t: x } = We(), Le = qe("input", A), Se = Be("input", A), D = Ue(U), me = Pe({ enabled: Ee, disabled: k }), [b, R] = _(!1), [Y, Z] = _(""), [T, j] = _(-1), [_e, De] = _(0), ve = se(null), H = se(null), [ge, Re] = _(null);
97
+ fe(() => {
98
+ !N && H.current && Re(H.current.offsetWidth);
99
+ }, [N, v, A]);
100
+ const [K, Te] = _(null);
101
+ fe(() => {
102
+ c && !G && H.current && K == null && Te(H.current.offsetWidth);
103
+ }, [c, G, K]);
104
+ const Ie = Ve(
105
+ E ?? null,
106
+ L ?? E?.keyField ?? "id",
107
+ S ?? "name"
108
+ ), M = E ? Ie.options : (pe ?? []).map(
109
+ (e) => typeof e == "string" ? { value: e, label: e } : e
110
+ ), { popupRef: Ae, coords: W, ready: ye, themeClass: ee, portalTarget: we } = tn(
111
+ b,
112
+ ve,
113
+ () => {
114
+ R(!1), Z("");
115
+ }
116
+ ), r = q(() => v ? Array.isArray(v) ? v : [v] : [], [v]), f = q(() => {
117
+ if (!Y && !F || F)
118
+ return M;
119
+ const e = Y.toLowerCase();
120
+ return M.filter(
121
+ (i) => i.label.toLowerCase().includes(e) || String(i.value).toLowerCase().includes(e)
122
+ );
123
+ }, [M, Y, F]), Ne = q(() => {
124
+ const e = /* @__PURE__ */ new Map();
125
+ for (const i of f) {
126
+ const t = i.group || "";
127
+ e.has(t) || e.set(t, []), e.get(t).push(i);
128
+ }
129
+ return e;
130
+ }, [f]), ne = ue(
131
+ (e) => {
132
+ if (c) {
133
+ const i = r.includes(e) ? r.filter((t) => t !== e) : [...r, e];
134
+ u?.(i);
135
+ } else
136
+ u?.(e), R(!1), Z("");
137
+ },
138
+ [c, r, u]
139
+ ), Oe = ue(
140
+ (e) => {
141
+ if (e.key === "Escape") {
142
+ R(!1), Z("");
143
+ return;
144
+ }
145
+ if (e.key === "Enter" || e.key === " ") {
146
+ if (!b) {
147
+ R(!0), e.preventDefault();
148
+ return;
149
+ }
150
+ T >= 0 && f[T] && (ne(f[T].value), e.preventDefault());
151
+ return;
152
+ }
153
+ e.key === "ArrowDown" && (e.preventDefault(), j((i) => Math.min(i + 1, f.length - 1))), e.key === "ArrowUp" && (e.preventDefault(), j((i) => Math.max(i - 1, 0)));
154
+ },
155
+ [b, T, f, ne]
156
+ ), oe = q(() => r.length === 0 ? null : c ? r.map((e) => M.find((i) => i.value === e)?.label || e).join(", ") : M.find((e) => e.value === r[0])?.label || r[0], [r, M, c]), Fe = ue(
157
+ (e) => {
158
+ e.stopPropagation(), u?.(c ? [] : "");
159
+ },
160
+ [u, c]
161
+ ), ze = q(
162
+ () => [
163
+ { key: "Enter", description: x("shortcuts.select", "Select") },
164
+ { key: "Space", description: x("shortcuts.openDropdown", "Open dropdown") },
165
+ de.moveUp,
166
+ de.moveDown,
167
+ de.cancel
168
+ ],
169
+ [x]
170
+ );
171
+ return Me ? null : /* @__PURE__ */ o(
172
+ "div",
173
+ {
174
+ className: `nice-field ${z == null ? "nice-field--select-auto" : ""} nice-field--${$} ${Ce === "left" ? "nice-field--label-left" : ""} ${N ? "nice-field--loading" : ""} ${ce || ""}`,
175
+ style: {
176
+ ...P,
177
+ ...Q != null && {
178
+ "--nice-field-label-width": typeof Q == "number" ? `${Q}px` : Q
179
+ },
180
+ ...z != null && {
181
+ "--nice-field-control-width": typeof z == "number" ? `${z}px` : z
182
+ },
183
+ ...N && ge != null && { "--nice-select-locked-width": `${ge}px` }
184
+ },
185
+ "aria-busy": N || void 0,
186
+ children: [
187
+ a && /* @__PURE__ */ o(
188
+ "label",
189
+ {
190
+ htmlFor: D,
191
+ className: `nice-field__label ${B ? "nice-field__label--required" : ""}`,
192
+ children: [
193
+ a,
194
+ $e && /* @__PURE__ */ n(Ge, { shortcuts: ze, size: "sm" })
195
+ ]
196
+ }
197
+ ),
198
+ /* @__PURE__ */ o("div", { className: "nice-field__control", children: [
199
+ me.isDisplay ? /* @__PURE__ */ n(
200
+ Je,
201
+ {
202
+ value: oe,
203
+ placeholder: g || x("controls.select", "Select..."),
204
+ disabled: k,
205
+ onActivate: () => {
206
+ me.enterEdit(), R(!0);
207
+ },
208
+ ariaLabel: a ?? s
209
+ }
210
+ ) : /* @__PURE__ */ o("div", { className: "nice-select", ref: ve, children: [
211
+ /* @__PURE__ */ o(
212
+ "button",
213
+ {
214
+ ref: (e) => {
215
+ H.current = e, typeof X == "function" ? X(e) : X && (X.current = e);
216
+ },
217
+ type: "button",
218
+ id: D,
219
+ role: "combobox",
220
+ "aria-label": a ? void 0 : s,
221
+ "aria-expanded": b,
222
+ "aria-haspopup": "listbox",
223
+ "aria-invalid": !!d,
224
+ className: `nice-select__trigger nice-select__trigger--${$} nice-select--ds-${Se} ${b ? "nice-select__trigger--open" : ""} ${d ? "nice-select__trigger--error" : ""} ${k ? "nice-select__trigger--disabled" : ""}`,
225
+ style: {
226
+ ...Le,
227
+ ...c && !G && K != null ? {
228
+ width: K,
229
+ maxWidth: K,
230
+ overflow: "hidden"
231
+ } : {}
232
+ },
233
+ disabled: k,
234
+ onClick: () => R(!b),
235
+ onKeyDown: Oe,
236
+ children: [
237
+ oe ? /* @__PURE__ */ n(
238
+ "span",
239
+ {
240
+ style: c && !G ? {
241
+ flex: 1,
242
+ minWidth: 0,
243
+ overflow: "hidden",
244
+ textOverflow: "ellipsis",
245
+ whiteSpace: "nowrap"
246
+ } : void 0,
247
+ children: oe
248
+ }
249
+ ) : /* @__PURE__ */ n("span", { className: "nice-select__placeholder", children: g || x("controls.select", "Select...") }),
250
+ /* @__PURE__ */ o("span", { style: { display: "flex", alignItems: "center", gap: 4 }, children: [
251
+ m && r.length > 0 && /* @__PURE__ */ n(
252
+ "span",
253
+ {
254
+ className: "nice-input__clear",
255
+ onClick: Fe,
256
+ role: "button",
257
+ "aria-label": x("controls.clear", "Clear"),
258
+ children: /* @__PURE__ */ n(be, { name: "close", size: 14 })
259
+ }
260
+ ),
261
+ /* @__PURE__ */ n(
262
+ "span",
263
+ {
264
+ className: `nice-select__chevron ${b ? "nice-select__chevron--open" : ""}`,
265
+ children: /* @__PURE__ */ n(be, { name: "chevron-down", size: 16 })
266
+ }
267
+ )
268
+ ] })
269
+ ]
270
+ }
271
+ ),
272
+ b && W && we && en(
273
+ /* @__PURE__ */ o(
274
+ "div",
275
+ {
276
+ ref: Ae,
277
+ className: `nice-select__dropdown${ee ? ` ${ee}` : ""}`,
278
+ "data-theme": ee === "nice-dark" ? "dark" : ee === "nice-light" ? "light" : void 0,
279
+ role: "listbox",
280
+ style: {
281
+ maxHeight: l,
282
+ position: "fixed",
283
+ left: W.left,
284
+ top: W.top,
285
+ width: W.width,
286
+ minWidth: W.width,
287
+ zIndex: 1e3,
288
+ // Hidden until measured so the estimate frame never paints above.
289
+ opacity: ye ? 1 : 0,
290
+ pointerEvents: ye ? void 0 : "none"
291
+ },
292
+ onScroll: w ? (e) => De(e.currentTarget.scrollTop) : void 0,
293
+ children: [
294
+ (y || F) && /* @__PURE__ */ n("div", { className: "nice-select__search", children: /* @__PURE__ */ n(
295
+ "input",
296
+ {
297
+ type: "text",
298
+ value: Y,
299
+ onChange: (e) => {
300
+ Z(e.target.value), j(0), F?.(e.target.value);
301
+ },
302
+ placeholder: x("controls.search", "Search..."),
303
+ autoFocus: !0
304
+ }
305
+ ) }),
306
+ N && /* @__PURE__ */ n("div", { className: "nice-select__loading", children: /* @__PURE__ */ n(
307
+ "div",
308
+ {
309
+ className: "nice-spinner nice-spinner--sm",
310
+ style: { margin: "8px auto" }
311
+ }
312
+ ) }),
313
+ !N && f.length === 0 ? /* @__PURE__ */ n("div", { className: "nice-select__empty", children: C || x("controls.noResults", "No results found") }) : w && !Array.from(Ne.keys()).some((e) => e !== "") ? (() => {
314
+ const i = f.length * O, t = Math.max(
315
+ 0,
316
+ Math.floor(_e / O) - 3
317
+ ), I = Math.min(
318
+ f.length,
319
+ Math.ceil((_e + l) / O) + 3
320
+ ), te = f.slice(t, I);
321
+ return /* @__PURE__ */ n("div", { style: { height: i, position: "relative" }, children: te.map((h, je) => {
322
+ const ae = t + je, ie = r.includes(h.value);
323
+ return /* @__PURE__ */ n(
324
+ "div",
325
+ {
326
+ role: "option",
327
+ "aria-selected": ie,
328
+ className: `nice-select__option ${ie ? "nice-select__option--selected" : ""} ${ae === T ? "nice-select__option--highlighted" : ""} ${h.disabled ? "nice-select__option--disabled" : ""}`,
329
+ style: {
330
+ position: "absolute",
331
+ top: ae * O,
332
+ left: 0,
333
+ right: 0,
334
+ height: O,
335
+ display: "flex",
336
+ alignItems: "center",
337
+ padding: "0 12px"
338
+ },
339
+ onClick: () => !h.disabled && ne(String(h.value)),
340
+ onMouseEnter: () => j(ae),
341
+ children: V ? V(h, ie) : /* @__PURE__ */ o(xe, { children: [
342
+ h.icon && /* @__PURE__ */ n("span", { children: h.icon }),
343
+ /* @__PURE__ */ o("div", { style: { flex: 1 }, children: [
344
+ /* @__PURE__ */ n("div", { children: h.label }),
345
+ h.description && /* @__PURE__ */ n("div", { className: "nice-select__option-desc", children: h.description })
346
+ ] }),
347
+ ie && /* @__PURE__ */ n(
348
+ "svg",
349
+ {
350
+ className: "nice-select__option-check",
351
+ viewBox: "0 0 20 20",
352
+ fill: "currentColor",
353
+ children: /* @__PURE__ */ n(
354
+ "path",
355
+ {
356
+ fillRule: "evenodd",
357
+ d: "M16.704 4.153a.75.75 0 01.143 1.052l-8 10.5a.75.75 0 01-1.127.075l-4.5-4.5a.75.75 0 011.06-1.06l3.894 3.893 7.48-9.817a.75.75 0 011.05-.143z",
358
+ clipRule: "evenodd"
359
+ }
360
+ )
361
+ }
362
+ )
363
+ ] })
364
+ },
365
+ h.value
366
+ );
367
+ }) });
368
+ })() : Array.from(Ne.entries()).map(([e, i]) => /* @__PURE__ */ o(Qe.Fragment, { children: [
369
+ e && /* @__PURE__ */ n("div", { className: "nice-select__group-label", children: e }),
370
+ i.map((t) => {
371
+ const I = r.includes(t.value), te = f.indexOf(t);
372
+ return /* @__PURE__ */ n(
373
+ "div",
374
+ {
375
+ role: "option",
376
+ "aria-selected": I,
377
+ className: `nice-select__option ${I ? "nice-select__option--selected" : ""} ${te === T ? "nice-select__option--highlighted" : ""} ${t.disabled ? "nice-select__option--disabled" : ""}`,
378
+ onClick: () => !t.disabled && ne(String(t.value)),
379
+ onMouseEnter: () => j(te),
380
+ children: V ? V(t, I) : /* @__PURE__ */ o(xe, { children: [
381
+ t.icon && /* @__PURE__ */ n("span", { children: t.icon }),
382
+ /* @__PURE__ */ o("div", { style: { flex: 1 }, children: [
383
+ /* @__PURE__ */ n("div", { children: t.label }),
384
+ t.description && /* @__PURE__ */ n("div", { className: "nice-select__option-desc", children: t.description })
385
+ ] }),
386
+ I && /* @__PURE__ */ n(
387
+ "svg",
388
+ {
389
+ className: "nice-select__option-check",
390
+ viewBox: "0 0 20 20",
391
+ fill: "currentColor",
392
+ children: /* @__PURE__ */ n(
393
+ "path",
394
+ {
395
+ fillRule: "evenodd",
396
+ d: "M16.704 4.153a.75.75 0 01.143 1.052l-8 10.5a.75.75 0 01-1.127.075l-4.5-4.5a.75.75 0 011.06-1.06l3.894 3.893 7.48-9.817a.75.75 0 011.05-.143z",
397
+ clipRule: "evenodd"
398
+ }
399
+ )
400
+ }
401
+ )
402
+ ] })
403
+ },
404
+ t.value
405
+ );
406
+ })
407
+ ] }, e))
408
+ ]
409
+ }
410
+ ),
411
+ we
412
+ )
413
+ ] }),
414
+ N && /* @__PURE__ */ n("span", { className: "nice-field__spinner", children: /* @__PURE__ */ n("span", { className: "nice-spinner nice-spinner--sm" }) }),
415
+ J === "right" && d && /* @__PURE__ */ n("div", { id: `${D}-error`, className: "nice-field__error", role: "alert", children: d }),
416
+ J === "right" && !d && p && /* @__PURE__ */ n("div", { id: `${D}-helper`, className: "nice-field__helper", children: p })
417
+ ] }),
418
+ J !== "right" && d && /* @__PURE__ */ n("div", { id: `${D}-error`, className: "nice-field__error", role: "alert", children: d }),
419
+ J !== "right" && !d && p && /* @__PURE__ */ n("div", { id: `${D}-helper`, className: "nice-field__helper", children: p })
420
+ ]
421
+ }
422
+ );
423
+ }
424
+ );
425
+ ke.displayName = "NiceSelect";
426
+ const on = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
427
+ __proto__: null,
428
+ NiceSelect: ke
429
+ }, Symbol.toStringTag, { value: "Module" }));
430
+ export {
431
+ ke as N,
432
+ on as a,
433
+ nn as s,
434
+ tn as u
435
+ };
@@ -0,0 +1 @@
1
+ "use strict";const t=require("react/jsx-runtime"),o=require("@nice2dev/ui-core"),s=require("react"),Oe=require("react-dom");function ve(d){const c=d?.closest?.("[data-theme], .nice-dark, .nice-light, .dark");if(!c)return"";const m=c.getAttribute("data-theme");return m==="dark"||c.classList.contains("nice-dark")||c.classList.contains("dark")?"nice-dark":m==="light"||c.classList.contains("nice-light")?"nice-light":""}function ge(d,c,m,u){const U=u?.maxHeight??320,b=u?.anchorKey,k=s.useRef(null),[ae,W]=s.useState(null),[ne,B]=s.useState(!1),[ie,O]=s.useState(""),_=s.useContext(o.NiceThemeContext)?.portalTarget??(typeof document<"u"?document.body:null),f=s.useRef(m);return f.current=m,s.useLayoutEffect(()=>{if(!d||!c.current)return;O(ve(c.current)),B(!1);const v=()=>{const C=c.current;if(!C)return;const r=C.getBoundingClientRect(),S=k.current?.offsetHeight??U;let $=r.bottom;$+S>window.innerHeight-8&&r.top-S>8&&($=r.top-S);let E=r.left;E+r.width>window.innerWidth-8&&(E=Math.max(8,window.innerWidth-r.width-8)),W(y=>y&&y.left===E&&y.top===$&&y.width===r.width?y:{left:E,top:$,width:r.width})};v();const l=requestAnimationFrame(()=>{v(),B(!0)}),g=C=>{const r=C.target;r instanceof Node&&(k.current?.contains(r)||c.current?.contains(r))||f.current()},x=()=>f.current();return window.addEventListener("scroll",g,!0),window.addEventListener("resize",x),()=>{cancelAnimationFrame(l),window.removeEventListener("scroll",g,!0),window.removeEventListener("resize",x)}},[d,c,U,b]),s.useEffect(()=>{if(!d)return;const v=g=>{const x=g.target;c.current?.contains(x)||k.current?.contains(x)||(x instanceof Element?x:x?.parentElement??null)?.closest('.nice-select__dropdown, [role="listbox"], [role="option"]')||f.current()},l=g=>{g.key==="Escape"&&f.current()};return document.addEventListener("mousedown",v),document.addEventListener("keydown",l),()=>{document.removeEventListener("mousedown",v),document.removeEventListener("keydown",l)}},[d,c]),{popupRef:k,coords:ae,ready:ne,themeClass:ie,portalTarget:_}}const oe=s.forwardRef(({label:d,"aria-label":c,helperText:m,error:u,required:U,disabled:b,size:k="md",name:ae,id:W,className:ne,style:B,accessMode:ie,displayStyle:O,options:de,value:_,onChange:f,placeholder:v,multiple:l=!1,searchable:g=!0,clearable:x=!1,emptyText:C,maxHeight:r=240,optionsSource:S,valueField:$,labelField:E,virtualScroll:y,optionHeight:I=36,onSearch:A,loading:w,renderOption:P,multipleAutosize:V=!1,showKeyboardHints:ye,labelPlacement:we,errorPlacement:G,labelWidth:J,controlWidth:F,displayMode:je},Q)=>{const ce=o.useNiceAccessMode(ie,W),Ne=ce==="hidden";(ce==="disabled"||ce==="readOnly")&&(b=!0);const{t:j}=o.useNiceTranslation(),be=o.useComponentDisplayStyle("input",O),ke=o.useComponentDisplayClass("input",O),L=o.useControlId(W),ue=o.useDisplayModeEdit({enabled:je,disabled:b}),[N,R]=s.useState(!1),[X,Y]=s.useState(""),[D,q]=s.useState(-1),[fe,Ce]=s.useState(0),he=s.useRef(null),H=s.useRef(null),[pe,Se]=s.useState(null);s.useLayoutEffect(()=>{!w&&H.current&&Se(H.current.offsetWidth)},[w,_,O]);const[z,Me]=s.useState(null);s.useLayoutEffect(()=>{l&&!V&&H.current&&z==null&&Me(H.current.offsetWidth)},[l,V,z]);const $e=o.useNiceLookupSource(S??null,$??S?.keyField??"id",E??"name"),M=S?$e.options:(de??[]).map(e=>typeof e=="string"?{value:e,label:e}:e),{popupRef:Ee,coords:K,ready:me,themeClass:Z,portalTarget:xe}=ge(N,he,()=>{R(!1),Y("")}),a=s.useMemo(()=>_?Array.isArray(_)?_:[_]:[],[_]),h=s.useMemo(()=>{if(!X&&!A||A)return M;const e=X.toLowerCase();return M.filter(i=>i.label.toLowerCase().includes(e)||String(i.value).toLowerCase().includes(e))},[M,X,A]),_e=s.useMemo(()=>{const e=new Map;for(const i of h){const n=i.group||"";e.has(n)||e.set(n,[]),e.get(n).push(i)}return e},[h]),ee=s.useCallback(e=>{if(l){const i=a.includes(e)?a.filter(n=>n!==e):[...a,e];f?.(i)}else f?.(e),R(!1),Y("")},[l,a,f]),Le=s.useCallback(e=>{if(e.key==="Escape"){R(!1),Y("");return}if(e.key==="Enter"||e.key===" "){if(!N){R(!0),e.preventDefault();return}D>=0&&h[D]&&(ee(h[D].value),e.preventDefault());return}e.key==="ArrowDown"&&(e.preventDefault(),q(i=>Math.min(i+1,h.length-1))),e.key==="ArrowUp"&&(e.preventDefault(),q(i=>Math.max(i-1,0)))},[N,D,h,ee]),le=s.useMemo(()=>a.length===0?null:l?a.map(e=>M.find(i=>i.value===e)?.label||e).join(", "):M.find(e=>e.value===a[0])?.label||a[0],[a,M,l]),Re=s.useCallback(e=>{e.stopPropagation(),f?.(l?[]:"")},[f,l]),De=s.useMemo(()=>[{key:"Enter",description:j("shortcuts.select","Select")},{key:"Space",description:j("shortcuts.openDropdown","Open dropdown")},o.COMMON_SHORTCUTS.moveUp,o.COMMON_SHORTCUTS.moveDown,o.COMMON_SHORTCUTS.cancel],[j]);return Ne?null:t.jsxs("div",{className:`nice-field ${F==null?"nice-field--select-auto":""} nice-field--${k} ${we==="left"?"nice-field--label-left":""} ${w?"nice-field--loading":""} ${ne||""}`,style:{...B,...J!=null&&{"--nice-field-label-width":typeof J=="number"?`${J}px`:J},...F!=null&&{"--nice-field-control-width":typeof F=="number"?`${F}px`:F},...w&&pe!=null&&{"--nice-select-locked-width":`${pe}px`}},"aria-busy":w||void 0,children:[d&&t.jsxs("label",{htmlFor:L,className:`nice-field__label ${U?"nice-field__label--required":""}`,children:[d,ye&&t.jsx(o.NiceKeyboardHint,{shortcuts:De,size:"sm"})]}),t.jsxs("div",{className:"nice-field__control",children:[ue.isDisplay?t.jsx(o.DisplayModeView,{value:le,placeholder:v||j("controls.select","Select..."),disabled:b,onActivate:()=>{ue.enterEdit(),R(!0)},ariaLabel:d??c}):t.jsxs("div",{className:"nice-select",ref:he,children:[t.jsxs("button",{ref:e=>{H.current=e,typeof Q=="function"?Q(e):Q&&(Q.current=e)},type:"button",id:L,role:"combobox","aria-label":d?void 0:c,"aria-expanded":N,"aria-haspopup":"listbox","aria-invalid":!!u,className:`nice-select__trigger nice-select__trigger--${k} nice-select--ds-${ke} ${N?"nice-select__trigger--open":""} ${u?"nice-select__trigger--error":""} ${b?"nice-select__trigger--disabled":""}`,style:{...be,...l&&!V&&z!=null?{width:z,maxWidth:z,overflow:"hidden"}:{}},disabled:b,onClick:()=>R(!N),onKeyDown:Le,children:[le?t.jsx("span",{style:l&&!V?{flex:1,minWidth:0,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"}:void 0,children:le}):t.jsx("span",{className:"nice-select__placeholder",children:v||j("controls.select","Select...")}),t.jsxs("span",{style:{display:"flex",alignItems:"center",gap:4},children:[x&&a.length>0&&t.jsx("span",{className:"nice-input__clear",onClick:Re,role:"button","aria-label":j("controls.clear","Clear"),children:t.jsx(o.NiceIcon,{name:"close",size:14})}),t.jsx("span",{className:`nice-select__chevron ${N?"nice-select__chevron--open":""}`,children:t.jsx(o.NiceIcon,{name:"chevron-down",size:16})})]})]}),N&&K&&xe&&Oe.createPortal(t.jsxs("div",{ref:Ee,className:`nice-select__dropdown${Z?` ${Z}`:""}`,"data-theme":Z==="nice-dark"?"dark":Z==="nice-light"?"light":void 0,role:"listbox",style:{maxHeight:r,position:"fixed",left:K.left,top:K.top,width:K.width,minWidth:K.width,zIndex:1e3,opacity:me?1:0,pointerEvents:me?void 0:"none"},onScroll:y?e=>Ce(e.currentTarget.scrollTop):void 0,children:[(g||A)&&t.jsx("div",{className:"nice-select__search",children:t.jsx("input",{type:"text",value:X,onChange:e=>{Y(e.target.value),q(0),A?.(e.target.value)},placeholder:j("controls.search","Search..."),autoFocus:!0})}),w&&t.jsx("div",{className:"nice-select__loading",children:t.jsx("div",{className:"nice-spinner nice-spinner--sm",style:{margin:"8px auto"}})}),!w&&h.length===0?t.jsx("div",{className:"nice-select__empty",children:C||j("controls.noResults","No results found")}):y&&!Array.from(_e.keys()).some(e=>e!=="")?(()=>{const i=h.length*I,n=Math.max(0,Math.floor(fe/I)-3),T=Math.min(h.length,Math.ceil((fe+r)/I)+3),te=h.slice(n,T);return t.jsx("div",{style:{height:i,position:"relative"},children:te.map((p,Te)=>{const re=n+Te,se=a.includes(p.value);return t.jsx("div",{role:"option","aria-selected":se,className:`nice-select__option ${se?"nice-select__option--selected":""} ${re===D?"nice-select__option--highlighted":""} ${p.disabled?"nice-select__option--disabled":""}`,style:{position:"absolute",top:re*I,left:0,right:0,height:I,display:"flex",alignItems:"center",padding:"0 12px"},onClick:()=>!p.disabled&&ee(String(p.value)),onMouseEnter:()=>q(re),children:P?P(p,se):t.jsxs(t.Fragment,{children:[p.icon&&t.jsx("span",{children:p.icon}),t.jsxs("div",{style:{flex:1},children:[t.jsx("div",{children:p.label}),p.description&&t.jsx("div",{className:"nice-select__option-desc",children:p.description})]}),se&&t.jsx("svg",{className:"nice-select__option-check",viewBox:"0 0 20 20",fill:"currentColor",children:t.jsx("path",{fillRule:"evenodd",d:"M16.704 4.153a.75.75 0 01.143 1.052l-8 10.5a.75.75 0 01-1.127.075l-4.5-4.5a.75.75 0 011.06-1.06l3.894 3.893 7.48-9.817a.75.75 0 011.05-.143z",clipRule:"evenodd"})})]})},p.value)})})})():Array.from(_e.entries()).map(([e,i])=>t.jsxs(s.Fragment,{children:[e&&t.jsx("div",{className:"nice-select__group-label",children:e}),i.map(n=>{const T=a.includes(n.value),te=h.indexOf(n);return t.jsx("div",{role:"option","aria-selected":T,className:`nice-select__option ${T?"nice-select__option--selected":""} ${te===D?"nice-select__option--highlighted":""} ${n.disabled?"nice-select__option--disabled":""}`,onClick:()=>!n.disabled&&ee(String(n.value)),onMouseEnter:()=>q(te),children:P?P(n,T):t.jsxs(t.Fragment,{children:[n.icon&&t.jsx("span",{children:n.icon}),t.jsxs("div",{style:{flex:1},children:[t.jsx("div",{children:n.label}),n.description&&t.jsx("div",{className:"nice-select__option-desc",children:n.description})]}),T&&t.jsx("svg",{className:"nice-select__option-check",viewBox:"0 0 20 20",fill:"currentColor",children:t.jsx("path",{fillRule:"evenodd",d:"M16.704 4.153a.75.75 0 01.143 1.052l-8 10.5a.75.75 0 01-1.127.075l-4.5-4.5a.75.75 0 011.06-1.06l3.894 3.893 7.48-9.817a.75.75 0 011.05-.143z",clipRule:"evenodd"})})]})},n.value)})]},e))]}),xe)]}),w&&t.jsx("span",{className:"nice-field__spinner",children:t.jsx("span",{className:"nice-spinner nice-spinner--sm"})}),G==="right"&&u&&t.jsx("div",{id:`${L}-error`,className:"nice-field__error",role:"alert",children:u}),G==="right"&&!u&&m&&t.jsx("div",{id:`${L}-helper`,className:"nice-field__helper",children:m})]}),G!=="right"&&u&&t.jsx("div",{id:`${L}-error`,className:"nice-field__error",role:"alert",children:u}),G!=="right"&&!u&&m&&t.jsx("div",{id:`${L}-helper`,className:"nice-field__helper",children:m})]})});oe.displayName="NiceSelect";const Ie=Object.freeze(Object.defineProperty({__proto__:null,NiceSelect:oe},Symbol.toStringTag,{value:"Module"}));exports.NiceSelect=oe;exports.NiceSelect$1=Ie;exports.scopeThemeClass=ve;exports.useAnchoredPopup=ge;
@@ -0,0 +1,8 @@
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e="https://nice2dev.com/schemas/component-doc-v1.json",t="NiceStreamDashboard",a="Live-production dashboard: scenes and their sources, preview and program with transitions, platform connections, chat, stats and quick actions. The dashboard manages the state; streaming, platform APIs and rendering are the host's — every control that needs them calls a callback, and is disabled with a reason when the callback is missing. Children can use `useStreamDashboard()`, e.g. to feed incoming chat with `receiveChatMessage`.",s="media",n="1.0.0",i="stable",o=[{name:"platforms",type:"PlatformConnection[]",description:"Connected streaming platforms"},{name:"scenes",type:"Scene[]",description:"Scenes with their sources"},{name:"config",type:"Partial<StreamConfig>",description:"Stream configuration (title, encoding, recording)"},{name:"maxChatMessages",type:"number",default:"500",description:"How many chat messages the panel keeps"},{name:"autoRecord",type:"boolean",default:"false",description:"Start recording when the stream starts"},{name:"onStreamStart",type:"() => void",description:"Called when the stream starts"},{name:"onStreamStop",type:"() => void",description:"Called when the stream stops"},{name:"onChatMessage",type:"(message: ChatMessage) => void",description:"Called for every message fed in with `receiveChatMessage`"},{name:"onSendChatMessage",type:"(platform: StreamPlatform, message: string) => void | Promise<void>",description:"Sends a chat message through the platform's API; without it the chat input is disabled"},{name:"onAddPlatform",type:"() => void",description:'Connects a new platform account; without it "Add platform" is disabled'},{name:"onTransition",type:"(sceneId: string, transition: string, durationMs: number) => void",description:"Called when the program switches scenes, with the chosen transition and its duration"},{name:"onAlert",type:"(config: AlertConfig, data: unknown) => void",description:"Called when an alert is triggered"},{name:"onAnalyticsUpdate",type:"(analytics: StreamAnalytics) => void",description:"Called whenever the stats change"},{name:"onVODCreated",type:"(vod: VOD) => void",description:"Called when a recording or clip is created"},{name:"onScreenshot",type:"() => void",description:'"Screenshot" quick action; disabled without it'},{name:"onOpenAudioMixer",type:"() => void",description:'"Audio Mixer" quick action; disabled without it'},{name:"onOpenSettings",type:"() => void",description:'"Settings" quick action; disabled without it'},{name:"renderPreview",type:"(scene: Scene | null) => ReactNode",description:"Renders the preview and program canvases"},{name:"renderChatMessage",type:"(message: ChatMessage) => ReactNode",description:"Custom chat message row"},{name:"children",type:"ReactNode",description:"Rendered inside the dashboard's context"}],r=[{title:"Stream Dashboard",description:"Platforms, scenes and chat wired to the host",code:`<NiceStreamDashboard
2
+ platforms={platforms}
3
+ scenes={scenes}
4
+ onSendChatMessage={(platform, text) => api.chat.send(platform, text)}
5
+ onTransition={(sceneId, transition, ms) => renderer.switchTo(sceneId, transition, ms)}
6
+ onStreamStart={startEncoder}
7
+ onStreamStop={stopEncoder}
8
+ />`}],c={keyboard:["Tab through panels","Enter in the chat field sends the message"],aria:["Icon buttons are labelled","Disabled controls say in their title what is missing"]},d=["NiceVideoChat","NiceChat"],h={$schema:e,name:t,description:a,category:s,since:n,status:i,props:o,examples:r,accessibility:c,seeAlso:d};exports.$schema=e;exports.accessibility=c;exports.category=s;exports.default=h;exports.description=a;exports.examples=r;exports.name=t;exports.props=o;exports.seeAlso=d;exports.since=n;exports.status=i;
@@ -0,0 +1,32 @@
1
+ const e = "https://nice2dev.com/schemas/component-doc-v1.json", t = "NiceStreamDashboard", a = "Live-production dashboard: scenes and their sources, preview and program with transitions, platform connections, chat, stats and quick actions. The dashboard manages the state; streaming, platform APIs and rendering are the host's — every control that needs them calls a callback, and is disabled with a reason when the callback is missing. Children can use `useStreamDashboard()`, e.g. to feed incoming chat with `receiveChatMessage`.", n = "media", s = "1.0.0", i = "stable", o = [{ name: "platforms", type: "PlatformConnection[]", description: "Connected streaming platforms" }, { name: "scenes", type: "Scene[]", description: "Scenes with their sources" }, { name: "config", type: "Partial<StreamConfig>", description: "Stream configuration (title, encoding, recording)" }, { name: "maxChatMessages", type: "number", default: "500", description: "How many chat messages the panel keeps" }, { name: "autoRecord", type: "boolean", default: "false", description: "Start recording when the stream starts" }, { name: "onStreamStart", type: "() => void", description: "Called when the stream starts" }, { name: "onStreamStop", type: "() => void", description: "Called when the stream stops" }, { name: "onChatMessage", type: "(message: ChatMessage) => void", description: "Called for every message fed in with `receiveChatMessage`" }, { name: "onSendChatMessage", type: "(platform: StreamPlatform, message: string) => void | Promise<void>", description: "Sends a chat message through the platform's API; without it the chat input is disabled" }, { name: "onAddPlatform", type: "() => void", description: 'Connects a new platform account; without it "Add platform" is disabled' }, { name: "onTransition", type: "(sceneId: string, transition: string, durationMs: number) => void", description: "Called when the program switches scenes, with the chosen transition and its duration" }, { name: "onAlert", type: "(config: AlertConfig, data: unknown) => void", description: "Called when an alert is triggered" }, { name: "onAnalyticsUpdate", type: "(analytics: StreamAnalytics) => void", description: "Called whenever the stats change" }, { name: "onVODCreated", type: "(vod: VOD) => void", description: "Called when a recording or clip is created" }, { name: "onScreenshot", type: "() => void", description: '"Screenshot" quick action; disabled without it' }, { name: "onOpenAudioMixer", type: "() => void", description: '"Audio Mixer" quick action; disabled without it' }, { name: "onOpenSettings", type: "() => void", description: '"Settings" quick action; disabled without it' }, { name: "renderPreview", type: "(scene: Scene | null) => ReactNode", description: "Renders the preview and program canvases" }, { name: "renderChatMessage", type: "(message: ChatMessage) => ReactNode", description: "Custom chat message row" }, { name: "children", type: "ReactNode", description: "Rendered inside the dashboard's context" }], r = [{ title: "Stream Dashboard", description: "Platforms, scenes and chat wired to the host", code: `<NiceStreamDashboard
2
+ platforms={platforms}
3
+ scenes={scenes}
4
+ onSendChatMessage={(platform, text) => api.chat.send(platform, text)}
5
+ onTransition={(sceneId, transition, ms) => renderer.switchTo(sceneId, transition, ms)}
6
+ onStreamStart={startEncoder}
7
+ onStreamStop={stopEncoder}
8
+ />` }], d = { keyboard: ["Tab through panels", "Enter in the chat field sends the message"], aria: ["Icon buttons are labelled", "Disabled controls say in their title what is missing"] }, c = ["NiceVideoChat", "NiceChat"], h = {
9
+ $schema: e,
10
+ name: t,
11
+ description: a,
12
+ category: n,
13
+ since: s,
14
+ status: i,
15
+ props: o,
16
+ examples: r,
17
+ accessibility: d,
18
+ seeAlso: c
19
+ };
20
+ export {
21
+ e as $schema,
22
+ d as accessibility,
23
+ n as category,
24
+ h as default,
25
+ a as description,
26
+ r as examples,
27
+ t as name,
28
+ o as props,
29
+ c as seeAlso,
30
+ s as since,
31
+ i as status
32
+ };