@streamoid/ui 0.6.53 → 0.6.54
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.d.mts +18 -2
- package/dist/index.d.ts +18 -2
- package/dist/index.js +76 -73
- package/dist/index.mjs +11 -8
- package/package.json +1 -1
package/dist/index.d.mts
CHANGED
|
@@ -911,7 +911,14 @@ interface ScSidebarWorkspaceTriggerProps {
|
|
|
911
911
|
className?: string;
|
|
912
912
|
style?: CSSProperties;
|
|
913
913
|
}
|
|
914
|
-
|
|
914
|
+
/**
|
|
915
|
+
* FORWARDS ITS REF, for the same reason `ScSidebarAppIdentity` does: the
|
|
916
|
+
* workspace popover's caret points HERE, and without a ref every host wraps
|
|
917
|
+
* this in a div to get one. Those wrappers are load-bearing in ways the host
|
|
918
|
+
* has to remember — see the app identity, where one shipped crammed against
|
|
919
|
+
* the footer's left edge.
|
|
920
|
+
*/
|
|
921
|
+
declare const ScSidebarWorkspaceTrigger: React$1.ForwardRefExoticComponent<ScSidebarWorkspaceTriggerProps & React$1.RefAttributes<HTMLButtonElement>>;
|
|
915
922
|
interface ScSidebarSearchTriggerProps {
|
|
916
923
|
expanded: boolean;
|
|
917
924
|
label?: string;
|
|
@@ -930,7 +937,16 @@ interface ScSidebarAppIdentityProps {
|
|
|
930
937
|
label?: string;
|
|
931
938
|
className?: string;
|
|
932
939
|
}
|
|
933
|
-
|
|
940
|
+
/**
|
|
941
|
+
* FORWARDS ITS REF, so a host can anchor a popover to it directly.
|
|
942
|
+
*
|
|
943
|
+
* Without one, a host that needs to point a caret here has to wrap this in a
|
|
944
|
+
* div — and a bare div inside the footer's row-flex is an ITEM sized to its
|
|
945
|
+
* content, so the `width: 100%` + `space-between` below resolve against the
|
|
946
|
+
* wrapper instead of the row and the wordmark and app-grid icon end up crammed
|
|
947
|
+
* together. That shipped in CXO. The wrapper was never the point; the ref was.
|
|
948
|
+
*/
|
|
949
|
+
declare const ScSidebarAppIdentity: React$1.ForwardRefExoticComponent<ScSidebarAppIdentityProps & React$1.RefAttributes<HTMLSpanElement>>;
|
|
934
950
|
interface ScWorkspaceAccountMenuProps extends Omit<React.HTMLAttributes<HTMLDivElement>, "onChange"> {
|
|
935
951
|
workspaceName: string;
|
|
936
952
|
workspaceRole?: string;
|
package/dist/index.d.ts
CHANGED
|
@@ -911,7 +911,14 @@ interface ScSidebarWorkspaceTriggerProps {
|
|
|
911
911
|
className?: string;
|
|
912
912
|
style?: CSSProperties;
|
|
913
913
|
}
|
|
914
|
-
|
|
914
|
+
/**
|
|
915
|
+
* FORWARDS ITS REF, for the same reason `ScSidebarAppIdentity` does: the
|
|
916
|
+
* workspace popover's caret points HERE, and without a ref every host wraps
|
|
917
|
+
* this in a div to get one. Those wrappers are load-bearing in ways the host
|
|
918
|
+
* has to remember — see the app identity, where one shipped crammed against
|
|
919
|
+
* the footer's left edge.
|
|
920
|
+
*/
|
|
921
|
+
declare const ScSidebarWorkspaceTrigger: React$1.ForwardRefExoticComponent<ScSidebarWorkspaceTriggerProps & React$1.RefAttributes<HTMLButtonElement>>;
|
|
915
922
|
interface ScSidebarSearchTriggerProps {
|
|
916
923
|
expanded: boolean;
|
|
917
924
|
label?: string;
|
|
@@ -930,7 +937,16 @@ interface ScSidebarAppIdentityProps {
|
|
|
930
937
|
label?: string;
|
|
931
938
|
className?: string;
|
|
932
939
|
}
|
|
933
|
-
|
|
940
|
+
/**
|
|
941
|
+
* FORWARDS ITS REF, so a host can anchor a popover to it directly.
|
|
942
|
+
*
|
|
943
|
+
* Without one, a host that needs to point a caret here has to wrap this in a
|
|
944
|
+
* div — and a bare div inside the footer's row-flex is an ITEM sized to its
|
|
945
|
+
* content, so the `width: 100%` + `space-between` below resolve against the
|
|
946
|
+
* wrapper instead of the row and the wordmark and app-grid icon end up crammed
|
|
947
|
+
* together. That shipped in CXO. The wrapper was never the point; the ref was.
|
|
948
|
+
*/
|
|
949
|
+
declare const ScSidebarAppIdentity: React$1.ForwardRefExoticComponent<ScSidebarAppIdentityProps & React$1.RefAttributes<HTMLSpanElement>>;
|
|
934
950
|
interface ScWorkspaceAccountMenuProps extends Omit<React.HTMLAttributes<HTMLDivElement>, "onChange"> {
|
|
935
951
|
workspaceName: string;
|
|
936
952
|
workspaceRole?: string;
|
package/dist/index.js
CHANGED
|
@@ -5626,6 +5626,7 @@ function StreamoidSidebar({
|
|
|
5626
5626
|
}
|
|
5627
5627
|
|
|
5628
5628
|
// src/SC-SidebarShell/ScSidebarShell.tsx
|
|
5629
|
+
var import_react16 = require("react");
|
|
5629
5630
|
var import_icons37 = require("@streamoid/icons");
|
|
5630
5631
|
|
|
5631
5632
|
// src/SC-SidebarShell/ScSidebarShell.module.css
|
|
@@ -5667,7 +5668,7 @@ var ScSidebarShell_default = {
|
|
|
5667
5668
|
|
|
5668
5669
|
// src/SC-SidebarShell/ScSidebarShell.tsx
|
|
5669
5670
|
var import_jsx_runtime54 = require("react/jsx-runtime");
|
|
5670
|
-
|
|
5671
|
+
var ScSidebarWorkspaceTrigger = (0, import_react16.forwardRef)(function ScSidebarWorkspaceTrigger2({
|
|
5671
5672
|
workspaceName,
|
|
5672
5673
|
workspaceImage,
|
|
5673
5674
|
expanded,
|
|
@@ -5675,11 +5676,12 @@ function ScSidebarWorkspaceTrigger({
|
|
|
5675
5676
|
onClick,
|
|
5676
5677
|
className,
|
|
5677
5678
|
style
|
|
5678
|
-
}) {
|
|
5679
|
+
}, ref) {
|
|
5679
5680
|
const initial = (workspaceName || "W").charAt(0).toUpperCase();
|
|
5680
5681
|
return /* @__PURE__ */ (0, import_jsx_runtime54.jsxs)(
|
|
5681
5682
|
"button",
|
|
5682
5683
|
{
|
|
5684
|
+
ref,
|
|
5683
5685
|
type: "button",
|
|
5684
5686
|
"aria-label": `Open ${workspaceName} workspace menu`,
|
|
5685
5687
|
"aria-expanded": open,
|
|
@@ -5711,7 +5713,7 @@ function ScSidebarWorkspaceTrigger({
|
|
|
5711
5713
|
]
|
|
5712
5714
|
}
|
|
5713
5715
|
);
|
|
5714
|
-
}
|
|
5716
|
+
});
|
|
5715
5717
|
function ScSidebarSearchTrigger({
|
|
5716
5718
|
expanded,
|
|
5717
5719
|
label = "Search or Ask CXO",
|
|
@@ -5754,18 +5756,19 @@ var COMPACT_APP_LABELS = {
|
|
|
5754
5756
|
catalogix: "Ca",
|
|
5755
5757
|
photogenix: "Ph"
|
|
5756
5758
|
};
|
|
5757
|
-
|
|
5759
|
+
var ScSidebarAppIdentity = (0, import_react16.forwardRef)(function ScSidebarAppIdentity2({
|
|
5758
5760
|
expanded,
|
|
5759
5761
|
product = "streamoid",
|
|
5760
5762
|
collapsedLabel,
|
|
5761
5763
|
collapsedMark,
|
|
5762
5764
|
label,
|
|
5763
5765
|
className
|
|
5764
|
-
}) {
|
|
5766
|
+
}, ref) {
|
|
5765
5767
|
const appLabel = label ?? (product === "streamoid" ? "Streamoid" : product);
|
|
5766
5768
|
return /* @__PURE__ */ (0, import_jsx_runtime54.jsx)(
|
|
5767
5769
|
"span",
|
|
5768
5770
|
{
|
|
5771
|
+
ref,
|
|
5769
5772
|
"aria-label": `Switch Apps. Current app: ${appLabel}`,
|
|
5770
5773
|
title: "Switch Apps",
|
|
5771
5774
|
className: `${ScSidebarShell_default.appIdentity} ${expanded ? ScSidebarShell_default.appIdentityExpanded : ScSidebarShell_default.appIdentityCollapsed}${className ? ` ${className}` : ""}`,
|
|
@@ -5781,7 +5784,7 @@ function ScSidebarAppIdentity({
|
|
|
5781
5784
|
] }) : collapsedMark ?? (product === "streamoid" ? /* @__PURE__ */ (0, import_jsx_runtime54.jsx)(ScStreamoidMascot, { size: 40 }) : /* @__PURE__ */ (0, import_jsx_runtime54.jsx)("span", { "aria-hidden": true, className: ScSidebarShell_default.collapsedProductMark, children: collapsedLabel ?? COMPACT_APP_LABELS[product] }))
|
|
5782
5785
|
}
|
|
5783
5786
|
);
|
|
5784
|
-
}
|
|
5787
|
+
});
|
|
5785
5788
|
function MenuActionRow({
|
|
5786
5789
|
icon,
|
|
5787
5790
|
label,
|
|
@@ -5973,7 +5976,7 @@ function ScWorkspaceAccountMenu({
|
|
|
5973
5976
|
}
|
|
5974
5977
|
|
|
5975
5978
|
// src/SC-SidebarShell/useStreamoidShellPreferences.ts
|
|
5976
|
-
var
|
|
5979
|
+
var import_react17 = require("react");
|
|
5977
5980
|
var THEME_COOKIE = "streamoid_theme";
|
|
5978
5981
|
var SIDEBAR_COOKIE = "streamoid_sidebar";
|
|
5979
5982
|
var THEME_STORAGE_KEY = "streamoid.shell.theme";
|
|
@@ -6055,7 +6058,7 @@ function readExpanded(options) {
|
|
|
6055
6058
|
}
|
|
6056
6059
|
function useStreamoidThemePreference(options = {}) {
|
|
6057
6060
|
const legacyKeySignature = (options.legacyStorageKeys ?? []).join("\0");
|
|
6058
|
-
const stableOptions = (0,
|
|
6061
|
+
const stableOptions = (0, import_react17.useMemo)(
|
|
6059
6062
|
() => ({
|
|
6060
6063
|
defaultMode: options.defaultMode,
|
|
6061
6064
|
legacyStorageKeys: legacyKeySignature ? legacyKeySignature.split("\0") : [],
|
|
@@ -6063,31 +6066,31 @@ function useStreamoidThemePreference(options = {}) {
|
|
|
6063
6066
|
}),
|
|
6064
6067
|
[options.defaultMode, options.applyToDocument, legacyKeySignature]
|
|
6065
6068
|
);
|
|
6066
|
-
const [preference, setPreferenceState] = (0,
|
|
6069
|
+
const [preference, setPreferenceState] = (0, import_react17.useState)(
|
|
6067
6070
|
() => readTheme(stableOptions)
|
|
6068
6071
|
);
|
|
6069
|
-
const [systemDark, setSystemDark] = (0,
|
|
6072
|
+
const [systemDark, setSystemDark] = (0, import_react17.useState)(
|
|
6070
6073
|
() => canUseDom() && window.matchMedia("(prefers-color-scheme: dark)").matches
|
|
6071
6074
|
);
|
|
6072
|
-
const setPreference = (0,
|
|
6075
|
+
const setPreference = (0, import_react17.useCallback)((mode) => {
|
|
6073
6076
|
setPreferenceState(mode);
|
|
6074
6077
|
writeStorage(THEME_STORAGE_KEY, mode);
|
|
6075
6078
|
stableOptions.legacyStorageKeys.forEach((key) => writeStorage(key, mode));
|
|
6076
6079
|
writeCookie(THEME_COOKIE, mode);
|
|
6077
6080
|
}, [stableOptions]);
|
|
6078
|
-
(0,
|
|
6081
|
+
(0, import_react17.useEffect)(() => {
|
|
6079
6082
|
writeStorage(THEME_STORAGE_KEY, preference);
|
|
6080
6083
|
stableOptions.legacyStorageKeys.forEach((key) => writeStorage(key, preference));
|
|
6081
6084
|
writeCookie(THEME_COOKIE, preference);
|
|
6082
6085
|
}, [preference, stableOptions]);
|
|
6083
|
-
(0,
|
|
6086
|
+
(0, import_react17.useEffect)(() => {
|
|
6084
6087
|
if (!canUseDom()) return;
|
|
6085
6088
|
const media = window.matchMedia("(prefers-color-scheme: dark)");
|
|
6086
6089
|
const onChange = (event) => setSystemDark(event.matches);
|
|
6087
6090
|
media.addEventListener("change", onChange);
|
|
6088
6091
|
return () => media.removeEventListener("change", onChange);
|
|
6089
6092
|
}, []);
|
|
6090
|
-
(0,
|
|
6093
|
+
(0, import_react17.useEffect)(() => {
|
|
6091
6094
|
if (!canUseDom()) return;
|
|
6092
6095
|
const sync = () => setPreferenceState(readTheme(stableOptions));
|
|
6093
6096
|
const onStorage = (event) => {
|
|
@@ -6103,7 +6106,7 @@ function useStreamoidThemePreference(options = {}) {
|
|
|
6103
6106
|
};
|
|
6104
6107
|
}, [stableOptions]);
|
|
6105
6108
|
const resolved = preference === "system" ? systemDark ? "dark" : "light" : preference;
|
|
6106
|
-
(0,
|
|
6109
|
+
(0, import_react17.useEffect)(() => {
|
|
6107
6110
|
if (!canUseDom() || !stableOptions.applyToDocument) return;
|
|
6108
6111
|
const root = document.documentElement;
|
|
6109
6112
|
root.setAttribute("data-theme", resolved === "light" ? "Light" : "Dark");
|
|
@@ -6113,15 +6116,15 @@ function useStreamoidThemePreference(options = {}) {
|
|
|
6113
6116
|
}
|
|
6114
6117
|
function useStreamoidSidebarPreference(options = {}) {
|
|
6115
6118
|
const legacyKeySignature = (options.legacyCollapsedKeys ?? []).join("\0");
|
|
6116
|
-
const stableOptions = (0,
|
|
6119
|
+
const stableOptions = (0, import_react17.useMemo)(
|
|
6117
6120
|
() => ({
|
|
6118
6121
|
defaultExpanded: options.defaultExpanded,
|
|
6119
6122
|
legacyCollapsedKeys: legacyKeySignature ? legacyKeySignature.split("\0") : []
|
|
6120
6123
|
}),
|
|
6121
6124
|
[options.defaultExpanded, legacyKeySignature]
|
|
6122
6125
|
);
|
|
6123
|
-
const [expanded, setExpandedState] = (0,
|
|
6124
|
-
const setExpanded = (0,
|
|
6126
|
+
const [expanded, setExpandedState] = (0, import_react17.useState)(() => readExpanded(stableOptions));
|
|
6127
|
+
const setExpanded = (0, import_react17.useCallback)((nextExpanded) => {
|
|
6125
6128
|
setExpandedState(nextExpanded);
|
|
6126
6129
|
const serialized = nextExpanded ? "expanded" : "collapsed";
|
|
6127
6130
|
writeStorage(SIDEBAR_STORAGE_KEY, serialized);
|
|
@@ -6130,7 +6133,7 @@ function useStreamoidSidebarPreference(options = {}) {
|
|
|
6130
6133
|
);
|
|
6131
6134
|
writeCookie(SIDEBAR_COOKIE, serialized);
|
|
6132
6135
|
}, [stableOptions]);
|
|
6133
|
-
const toggle = (0,
|
|
6136
|
+
const toggle = (0, import_react17.useCallback)(() => {
|
|
6134
6137
|
setExpandedState((current) => {
|
|
6135
6138
|
const next = !current;
|
|
6136
6139
|
const serialized = next ? "expanded" : "collapsed";
|
|
@@ -6142,7 +6145,7 @@ function useStreamoidSidebarPreference(options = {}) {
|
|
|
6142
6145
|
return next;
|
|
6143
6146
|
});
|
|
6144
6147
|
}, [stableOptions]);
|
|
6145
|
-
(0,
|
|
6148
|
+
(0, import_react17.useEffect)(() => {
|
|
6146
6149
|
const serialized = expanded ? "expanded" : "collapsed";
|
|
6147
6150
|
writeStorage(SIDEBAR_STORAGE_KEY, serialized);
|
|
6148
6151
|
stableOptions.legacyCollapsedKeys.forEach(
|
|
@@ -6150,7 +6153,7 @@ function useStreamoidSidebarPreference(options = {}) {
|
|
|
6150
6153
|
);
|
|
6151
6154
|
writeCookie(SIDEBAR_COOKIE, serialized);
|
|
6152
6155
|
}, [expanded, stableOptions]);
|
|
6153
|
-
(0,
|
|
6156
|
+
(0, import_react17.useEffect)(() => {
|
|
6154
6157
|
if (!canUseDom()) return;
|
|
6155
6158
|
const sync = () => setExpandedState(readExpanded(stableOptions));
|
|
6156
6159
|
const onStorage = (event) => {
|
|
@@ -6169,7 +6172,7 @@ function useStreamoidSidebarPreference(options = {}) {
|
|
|
6169
6172
|
}
|
|
6170
6173
|
|
|
6171
6174
|
// src/SC-SidebarShell/useStreamoidAnchoredPopoverPosition.ts
|
|
6172
|
-
var
|
|
6175
|
+
var import_react18 = require("react");
|
|
6173
6176
|
var ARROW_EDGE_INSET = 18;
|
|
6174
6177
|
function resolveAnchoredPopoverArrow({
|
|
6175
6178
|
anchor,
|
|
@@ -6224,7 +6227,7 @@ function useStreamoidAnchoredPopover(anchorRef, panelRef, {
|
|
|
6224
6227
|
inset = DEFAULT_INSET,
|
|
6225
6228
|
alignRef
|
|
6226
6229
|
}) {
|
|
6227
|
-
const [state, setState] = (0,
|
|
6230
|
+
const [state, setState] = (0, import_react18.useState)({
|
|
6228
6231
|
style: {
|
|
6229
6232
|
position: "fixed",
|
|
6230
6233
|
left: 0,
|
|
@@ -6236,7 +6239,7 @@ function useStreamoidAnchoredPopover(anchorRef, panelRef, {
|
|
|
6236
6239
|
},
|
|
6237
6240
|
arrow: null
|
|
6238
6241
|
});
|
|
6239
|
-
(0,
|
|
6242
|
+
(0, import_react18.useLayoutEffect)(() => {
|
|
6240
6243
|
const anchor = anchorRef.current;
|
|
6241
6244
|
if (!anchor || typeof window === "undefined") return;
|
|
6242
6245
|
const measure = () => {
|
|
@@ -6287,7 +6290,7 @@ function useStreamoidAnchoredPopover(anchorRef, panelRef, {
|
|
|
6287
6290
|
return state;
|
|
6288
6291
|
}
|
|
6289
6292
|
function useStreamoidAnchoredPopoverPosition(anchorRef, panelRef, { width, gap = DEFAULT_GAP, inset = DEFAULT_INSET }) {
|
|
6290
|
-
const [position, setPosition] = (0,
|
|
6293
|
+
const [position, setPosition] = (0, import_react18.useState)({
|
|
6291
6294
|
position: "fixed",
|
|
6292
6295
|
left: 0,
|
|
6293
6296
|
top: 0,
|
|
@@ -6296,7 +6299,7 @@ function useStreamoidAnchoredPopoverPosition(anchorRef, panelRef, { width, gap =
|
|
|
6296
6299
|
maxHeight: `calc(100dvh - ${inset * 2}px)`,
|
|
6297
6300
|
visibility: "hidden"
|
|
6298
6301
|
});
|
|
6299
|
-
(0,
|
|
6302
|
+
(0, import_react18.useLayoutEffect)(() => {
|
|
6300
6303
|
const anchor = anchorRef.current;
|
|
6301
6304
|
if (!anchor || typeof window === "undefined") return;
|
|
6302
6305
|
const measure = () => {
|
|
@@ -6340,7 +6343,7 @@ function useStreamoidAnchoredPopoverPosition(anchorRef, panelRef, { width, gap =
|
|
|
6340
6343
|
}
|
|
6341
6344
|
|
|
6342
6345
|
// src/SC-SidebarShell/useStreamoidSidebarPopoverPosition.ts
|
|
6343
|
-
var
|
|
6346
|
+
var import_react19 = require("react");
|
|
6344
6347
|
var VIEWPORT_INSET = 16;
|
|
6345
6348
|
function useStreamoidSidebarPopoverPosition(sidebarRef, {
|
|
6346
6349
|
placement,
|
|
@@ -6348,7 +6351,7 @@ function useStreamoidSidebarPopoverPosition(sidebarRef, {
|
|
|
6348
6351
|
gap = 8,
|
|
6349
6352
|
inset = 0
|
|
6350
6353
|
}) {
|
|
6351
|
-
const [position, setPosition] = (0,
|
|
6354
|
+
const [position, setPosition] = (0, import_react19.useState)({
|
|
6352
6355
|
position: "fixed",
|
|
6353
6356
|
left: 0,
|
|
6354
6357
|
top: 0,
|
|
@@ -6357,7 +6360,7 @@ function useStreamoidSidebarPopoverPosition(sidebarRef, {
|
|
|
6357
6360
|
maxHeight: `calc(100dvh - ${VIEWPORT_INSET * 2}px)`,
|
|
6358
6361
|
visibility: "hidden"
|
|
6359
6362
|
});
|
|
6360
|
-
(0,
|
|
6363
|
+
(0, import_react19.useLayoutEffect)(() => {
|
|
6361
6364
|
const sidebar = sidebarRef.current;
|
|
6362
6365
|
if (!sidebar || typeof window === "undefined") return;
|
|
6363
6366
|
const findCard = () => (sidebar.matches("[data-streamoid-sidebar-card]") ? sidebar : sidebar.querySelector(
|
|
@@ -6418,7 +6421,7 @@ function useStreamoidSidebarPopoverPosition(sidebarRef, {
|
|
|
6418
6421
|
}
|
|
6419
6422
|
|
|
6420
6423
|
// src/SC-SidebarShell/ScSidebarPopover.tsx
|
|
6421
|
-
var
|
|
6424
|
+
var import_react20 = require("react");
|
|
6422
6425
|
var import_react_dom = require("react-dom");
|
|
6423
6426
|
var import_jsx_runtime55 = require("react/jsx-runtime");
|
|
6424
6427
|
var SURFACE = "var(--sc-sidebar-popover-surface, var(--alias-surface-base, #101010))";
|
|
@@ -6437,13 +6440,13 @@ function ScSidebarPopover({
|
|
|
6437
6440
|
className,
|
|
6438
6441
|
style
|
|
6439
6442
|
}) {
|
|
6440
|
-
const panelRef = (0,
|
|
6443
|
+
const panelRef = (0, import_react20.useRef)(null);
|
|
6441
6444
|
const { style: position, arrow } = useStreamoidAnchoredPopover(
|
|
6442
6445
|
anchorRef,
|
|
6443
6446
|
panelRef,
|
|
6444
6447
|
{ width, alignRef }
|
|
6445
6448
|
);
|
|
6446
|
-
(0,
|
|
6449
|
+
(0, import_react20.useEffect)(() => {
|
|
6447
6450
|
const onKeyDown = (event) => {
|
|
6448
6451
|
if (event.key === "Escape") onClose();
|
|
6449
6452
|
};
|
|
@@ -6494,7 +6497,7 @@ function ScSidebarPopover({
|
|
|
6494
6497
|
}
|
|
6495
6498
|
|
|
6496
6499
|
// src/SC-Artifax-Sidebar/ScArtifaxSidebar.tsx
|
|
6497
|
-
var
|
|
6500
|
+
var import_react21 = require("react");
|
|
6498
6501
|
|
|
6499
6502
|
// src/SC-Artifax-Sidebar/ScArtifaxSidebar.module.css
|
|
6500
6503
|
var ScArtifaxSidebar_default = {
|
|
@@ -6610,8 +6613,8 @@ function SidebarHeader({
|
|
|
6610
6613
|
);
|
|
6611
6614
|
}
|
|
6612
6615
|
function useScrolled() {
|
|
6613
|
-
const [scrolled, setScrolled] = (0,
|
|
6614
|
-
const onScroll = (0,
|
|
6616
|
+
const [scrolled, setScrolled] = (0, import_react21.useState)(false);
|
|
6617
|
+
const onScroll = (0, import_react21.useCallback)((event) => {
|
|
6615
6618
|
const next = event.currentTarget.scrollTop > 0;
|
|
6616
6619
|
setScrolled((prev) => prev === next ? prev : next);
|
|
6617
6620
|
}, []);
|
|
@@ -6652,7 +6655,7 @@ var ScAppSidebar = ({
|
|
|
6652
6655
|
};
|
|
6653
6656
|
const isControlled = !!openSections;
|
|
6654
6657
|
const { scrolled, onScroll } = useScrolled();
|
|
6655
|
-
const [internalOpen, setInternalOpen] = (0,
|
|
6658
|
+
const [internalOpen, setInternalOpen] = (0, import_react21.useState)(
|
|
6656
6659
|
() => {
|
|
6657
6660
|
const init = {};
|
|
6658
6661
|
sections.forEach((s) => {
|
|
@@ -6662,7 +6665,7 @@ var ScAppSidebar = ({
|
|
|
6662
6665
|
}
|
|
6663
6666
|
);
|
|
6664
6667
|
const isSectionOpen = (id) => isControlled ? !!openSections?.[id] : !!internalOpen[id];
|
|
6665
|
-
const handleSectionToggle = (0,
|
|
6668
|
+
const handleSectionToggle = (0, import_react21.useCallback)(
|
|
6666
6669
|
(id) => {
|
|
6667
6670
|
const next = !isSectionOpen(id);
|
|
6668
6671
|
if (isControlled) {
|
|
@@ -6896,7 +6899,7 @@ var ScAppSidebar = ({
|
|
|
6896
6899
|
var ScArtifaxSidebar = ScAppSidebar;
|
|
6897
6900
|
|
|
6898
6901
|
// src/SC-Catalogix-Sidebar/ScCatalogixSidebar.tsx
|
|
6899
|
-
var
|
|
6902
|
+
var import_react22 = require("react");
|
|
6900
6903
|
|
|
6901
6904
|
// src/SC-Sidebar Switch menu/ScSidebarSwitchMenu.module.css
|
|
6902
6905
|
var ScSidebarSwitchMenu_default = {
|
|
@@ -7538,7 +7541,7 @@ var ScCatalogixSidebar = ({
|
|
|
7538
7541
|
className,
|
|
7539
7542
|
style
|
|
7540
7543
|
}) => {
|
|
7541
|
-
const [appListOpen, setAppListOpen] = (0,
|
|
7544
|
+
const [appListOpen, setAppListOpen] = (0, import_react22.useState)(false);
|
|
7542
7545
|
const handleSwitch = () => {
|
|
7543
7546
|
setAppListOpen((prev) => !prev);
|
|
7544
7547
|
onLogoClick?.();
|
|
@@ -7781,7 +7784,7 @@ var ScSlider = ({
|
|
|
7781
7784
|
};
|
|
7782
7785
|
|
|
7783
7786
|
// src/SC-WorkspaceSwitcher/streamoid-workspace-switcher.tsx
|
|
7784
|
-
var
|
|
7787
|
+
var import_react23 = require("react");
|
|
7785
7788
|
var import_icons42 = require("@streamoid/icons");
|
|
7786
7789
|
var import_jsx_runtime63 = require("react/jsx-runtime");
|
|
7787
7790
|
var PRIMARY_ICON = "var(--alias-text---icons-primary)";
|
|
@@ -7972,12 +7975,12 @@ function StreamoidWorkspaceSwitcher({
|
|
|
7972
7975
|
onSwitchWorkspace,
|
|
7973
7976
|
config
|
|
7974
7977
|
}) {
|
|
7975
|
-
const modalRef = (0,
|
|
7978
|
+
const modalRef = (0, import_react23.useRef)(null);
|
|
7976
7979
|
const title = config?.title || "Switch workspace";
|
|
7977
7980
|
const loadingText = config?.loadingText || "Loading workspaces\u2026";
|
|
7978
7981
|
const currentWorkspaceText = config?.currentWorkspaceText || "Current workspace";
|
|
7979
7982
|
const switchWorkspaceText = config?.switchWorkspaceText || "Switch workspace";
|
|
7980
|
-
(0,
|
|
7983
|
+
(0, import_react23.useEffect)(() => {
|
|
7981
7984
|
if (!open) return;
|
|
7982
7985
|
function handleKeyDown(e) {
|
|
7983
7986
|
if (e.key === "Escape") onClose();
|
|
@@ -9388,7 +9391,7 @@ var ScWorkspaceCard = ({
|
|
|
9388
9391
|
};
|
|
9389
9392
|
|
|
9390
9393
|
// src/SC-WorkspaceSwitchCard/ScWorkspaceSwitchCard.tsx
|
|
9391
|
-
var
|
|
9394
|
+
var import_react24 = require("react");
|
|
9392
9395
|
var import_icons62 = require("@streamoid/icons");
|
|
9393
9396
|
|
|
9394
9397
|
// src/SC-WorkspaceSwitchCard/ScWorkspaceSwitchCard.module.css
|
|
@@ -9429,7 +9432,7 @@ function ScWorkspaceSwitchCard({
|
|
|
9429
9432
|
onSettings,
|
|
9430
9433
|
onLeave
|
|
9431
9434
|
}) {
|
|
9432
|
-
const [internalHover, setInternalHover] = (0,
|
|
9435
|
+
const [internalHover, setInternalHover] = (0, import_react24.useState)(false);
|
|
9433
9436
|
const isHover = hover !== void 0 ? hover : internalHover;
|
|
9434
9437
|
const isCurrent = type === "currentWS";
|
|
9435
9438
|
const isOther = type === "otherWS";
|
|
@@ -9557,7 +9560,7 @@ function ScWorkspaceSwitchCard({
|
|
|
9557
9560
|
var NscWorkspaceSwitch = ScWorkspaceSwitchCard;
|
|
9558
9561
|
|
|
9559
9562
|
// src/SC-Modal/ScModal.tsx
|
|
9560
|
-
var
|
|
9563
|
+
var import_react25 = require("react");
|
|
9561
9564
|
var import_react_dom2 = require("react-dom");
|
|
9562
9565
|
|
|
9563
9566
|
// src/SC-Modal/ScModal.module.css
|
|
@@ -9579,7 +9582,7 @@ var ScModal = ({
|
|
|
9579
9582
|
closeOnBackdrop = true,
|
|
9580
9583
|
closeOnEsc = true
|
|
9581
9584
|
}) => {
|
|
9582
|
-
(0,
|
|
9585
|
+
(0, import_react25.useEffect)(() => {
|
|
9583
9586
|
if (!open || !closeOnEsc) return;
|
|
9584
9587
|
const onKey = (e) => {
|
|
9585
9588
|
if (e.key === "Escape") onClose?.();
|
|
@@ -9612,7 +9615,7 @@ var ScModal = ({
|
|
|
9612
9615
|
};
|
|
9613
9616
|
|
|
9614
9617
|
// src/SC-Drawer/ScDrawer.tsx
|
|
9615
|
-
var
|
|
9618
|
+
var import_react26 = require("react");
|
|
9616
9619
|
var import_react_dom3 = require("react-dom");
|
|
9617
9620
|
|
|
9618
9621
|
// src/SC-Drawer/ScDrawer.module.css
|
|
@@ -9640,8 +9643,8 @@ var ScDrawer = ({
|
|
|
9640
9643
|
backdrop = false,
|
|
9641
9644
|
zIndex
|
|
9642
9645
|
}) => {
|
|
9643
|
-
const panelRef = (0,
|
|
9644
|
-
(0,
|
|
9646
|
+
const panelRef = (0, import_react26.useRef)(null);
|
|
9647
|
+
(0, import_react26.useEffect)(() => {
|
|
9645
9648
|
if (!open) return;
|
|
9646
9649
|
const onKey = (e) => {
|
|
9647
9650
|
if (closeOnEsc && e.key === "Escape") onClose?.();
|
|
@@ -9739,7 +9742,7 @@ var ScTabs = ({
|
|
|
9739
9742
|
};
|
|
9740
9743
|
|
|
9741
9744
|
// src/SC-Counter/ScCounter.tsx
|
|
9742
|
-
var
|
|
9745
|
+
var import_react27 = require("react");
|
|
9743
9746
|
var import_icons63 = require("@streamoid/icons");
|
|
9744
9747
|
|
|
9745
9748
|
// src/SC-Counter/ScCounter.module.css
|
|
@@ -9761,7 +9764,7 @@ var ScCounter = ({
|
|
|
9761
9764
|
className,
|
|
9762
9765
|
style
|
|
9763
9766
|
}) => {
|
|
9764
|
-
const [showInput, setShowInput] = (0,
|
|
9767
|
+
const [showInput, setShowInput] = (0, import_react27.useState)(false);
|
|
9765
9768
|
const set = (n) => {
|
|
9766
9769
|
let v = n;
|
|
9767
9770
|
if (min !== void 0) v = Math.max(min, v);
|
|
@@ -10850,7 +10853,7 @@ var ScSelectionList = ({
|
|
|
10850
10853
|
};
|
|
10851
10854
|
|
|
10852
10855
|
// src/SC-textArea/ScTextArea.tsx
|
|
10853
|
-
var
|
|
10856
|
+
var import_react28 = require("react");
|
|
10854
10857
|
|
|
10855
10858
|
// src/SC-textArea/ScTextArea.module.css
|
|
10856
10859
|
var ScTextArea_default = {
|
|
@@ -10880,7 +10883,7 @@ var ScTextArea = ({
|
|
|
10880
10883
|
style,
|
|
10881
10884
|
...props
|
|
10882
10885
|
}) => {
|
|
10883
|
-
const [focused, setFocused] = (0,
|
|
10886
|
+
const [focused, setFocused] = (0, import_react28.useState)(false);
|
|
10884
10887
|
const derivedState = state ?? (props.disabled ? "disabled" : focused ? "active" : (props.value !== void 0 ? String(props.value).length > 0 : false) ? "filled" : "default");
|
|
10885
10888
|
const stateClass = ScTextArea_default["state-" + derivedState];
|
|
10886
10889
|
const labelGroupClass = ScTextArea_default["label-group-" + (labelGroup || "none")];
|
|
@@ -10922,7 +10925,7 @@ var ScTextArea = ({
|
|
|
10922
10925
|
};
|
|
10923
10926
|
|
|
10924
10927
|
// src/SC-select/ScSelect.tsx
|
|
10925
|
-
var
|
|
10928
|
+
var import_react29 = require("react");
|
|
10926
10929
|
|
|
10927
10930
|
// src/SC-select/ScSelect.module.css
|
|
10928
10931
|
var ScSelect_default = {
|
|
@@ -10959,9 +10962,9 @@ var ScSelect = (props) => {
|
|
|
10959
10962
|
disabled = false,
|
|
10960
10963
|
className
|
|
10961
10964
|
} = props;
|
|
10962
|
-
const [open, setOpen] = (0,
|
|
10963
|
-
const rootRef = (0,
|
|
10964
|
-
(0,
|
|
10965
|
+
const [open, setOpen] = (0, import_react29.useState)(false);
|
|
10966
|
+
const rootRef = (0, import_react29.useRef)(null);
|
|
10967
|
+
(0, import_react29.useEffect)(() => {
|
|
10965
10968
|
if (!open) return;
|
|
10966
10969
|
const handleClick = (e) => {
|
|
10967
10970
|
if (rootRef.current && !rootRef.current.contains(e.target)) {
|
|
@@ -11052,7 +11055,7 @@ var ScSelect = (props) => {
|
|
|
11052
11055
|
};
|
|
11053
11056
|
|
|
11054
11057
|
// src/SC-fileField/ScFileField.tsx
|
|
11055
|
-
var
|
|
11058
|
+
var import_react30 = require("react");
|
|
11056
11059
|
|
|
11057
11060
|
// src/SC-fileField/ScFileField.module.css
|
|
11058
11061
|
var ScFileField_default = {
|
|
@@ -11090,7 +11093,7 @@ var ScFileField = (props) => {
|
|
|
11090
11093
|
label,
|
|
11091
11094
|
className
|
|
11092
11095
|
} = props;
|
|
11093
|
-
const inputRef = (0,
|
|
11096
|
+
const inputRef = (0, import_react30.useRef)(null);
|
|
11094
11097
|
const hasFile = Boolean(fileName);
|
|
11095
11098
|
const isUploading = Boolean(uploading);
|
|
11096
11099
|
const clampedProgress = Math.max(0, Math.min(100, progress));
|
|
@@ -11209,7 +11212,7 @@ var ScFileField = (props) => {
|
|
|
11209
11212
|
};
|
|
11210
11213
|
|
|
11211
11214
|
// src/SC-mediaApproval/ScMediaApproval.tsx
|
|
11212
|
-
var
|
|
11215
|
+
var import_react31 = require("react");
|
|
11213
11216
|
|
|
11214
11217
|
// src/SC-mediaApproval/ScMediaApproval.module.css
|
|
11215
11218
|
var ScMediaApproval_default = {
|
|
@@ -11256,9 +11259,9 @@ var ScMediaApproval = (props) => {
|
|
|
11256
11259
|
className
|
|
11257
11260
|
} = props;
|
|
11258
11261
|
const total = mediaUrls.length;
|
|
11259
|
-
const [index, setIndex] = (0,
|
|
11260
|
-
const [mediaLoading, setMediaLoading] = (0,
|
|
11261
|
-
(0,
|
|
11262
|
+
const [index, setIndex] = (0, import_react31.useState)(activeIndex ?? 0);
|
|
11263
|
+
const [mediaLoading, setMediaLoading] = (0, import_react31.useState)(false);
|
|
11264
|
+
(0, import_react31.useEffect)(() => {
|
|
11262
11265
|
if (typeof activeIndex === "number") {
|
|
11263
11266
|
setIndex(activeIndex);
|
|
11264
11267
|
}
|
|
@@ -11393,7 +11396,7 @@ var ScMediaApproval = (props) => {
|
|
|
11393
11396
|
};
|
|
11394
11397
|
|
|
11395
11398
|
// src/SC-mediaSelect/ScMediaSelect.tsx
|
|
11396
|
-
var
|
|
11399
|
+
var import_react32 = require("react");
|
|
11397
11400
|
|
|
11398
11401
|
// src/SC-mediaSelect/ScMediaSelect.module.css
|
|
11399
11402
|
var ScMediaSelect_default = {
|
|
@@ -11449,7 +11452,7 @@ var ScMediaSelect = (props) => {
|
|
|
11449
11452
|
} = props;
|
|
11450
11453
|
const total = items.length;
|
|
11451
11454
|
const resolvedMax = typeof max === "number" ? max : total;
|
|
11452
|
-
const selectedSet = (0,
|
|
11455
|
+
const selectedSet = (0, import_react32.useMemo)(() => new Set(selected), [selected]);
|
|
11453
11456
|
const selectedCount = selectedSet.size;
|
|
11454
11457
|
let countLabel = selectedCount + " of " + total + " selected";
|
|
11455
11458
|
if (min > 0) countLabel += " (min " + min + ")";
|
|
@@ -11518,7 +11521,7 @@ var ScMediaSelect = (props) => {
|
|
|
11518
11521
|
};
|
|
11519
11522
|
|
|
11520
11523
|
// src/SC-todoList/ScTodoList.tsx
|
|
11521
|
-
var
|
|
11524
|
+
var import_react33 = require("react");
|
|
11522
11525
|
|
|
11523
11526
|
// src/SC-todoList/ScTodoList.module.css
|
|
11524
11527
|
var ScTodoList_default = {
|
|
@@ -11551,9 +11554,9 @@ var ScTodoList = ({
|
|
|
11551
11554
|
addPlaceholder = "Add an item",
|
|
11552
11555
|
className
|
|
11553
11556
|
}) => {
|
|
11554
|
-
const [editingId, setEditingId] = (0,
|
|
11555
|
-
const [editValue, setEditValue] = (0,
|
|
11556
|
-
const [newValue, setNewValue] = (0,
|
|
11557
|
+
const [editingId, setEditingId] = (0, import_react33.useState)(null);
|
|
11558
|
+
const [editValue, setEditValue] = (0, import_react33.useState)("");
|
|
11559
|
+
const [newValue, setNewValue] = (0, import_react33.useState)("");
|
|
11557
11560
|
const total = items.length;
|
|
11558
11561
|
const completed = items.filter((i) => i.status === "completed").length;
|
|
11559
11562
|
const startEditing = (item) => {
|
|
@@ -12407,7 +12410,7 @@ var ScWorkspaceSwitchMobileV2 = ({
|
|
|
12407
12410
|
};
|
|
12408
12411
|
|
|
12409
12412
|
// src/SC-imageField/ScImageField.tsx
|
|
12410
|
-
var
|
|
12413
|
+
var import_react34 = require("react");
|
|
12411
12414
|
|
|
12412
12415
|
// src/SC-imageField/ScImageField.module.css
|
|
12413
12416
|
var ScImageField_default = {
|
|
@@ -12434,7 +12437,7 @@ var ScImageField = ({
|
|
|
12434
12437
|
onRemove,
|
|
12435
12438
|
className
|
|
12436
12439
|
}) => {
|
|
12437
|
-
const inputRef = (0,
|
|
12440
|
+
const inputRef = (0, import_react34.useRef)(null);
|
|
12438
12441
|
const hasImage = !!imagePreview;
|
|
12439
12442
|
function handleClick() {
|
|
12440
12443
|
if (!hasImage) {
|
|
@@ -12670,7 +12673,7 @@ var ScPlanDetailsCardMobile = ({
|
|
|
12670
12673
|
};
|
|
12671
12674
|
|
|
12672
12675
|
// src/SC-ProfilePopup/ScProfilePopup.tsx
|
|
12673
|
-
var
|
|
12676
|
+
var import_react35 = require("react");
|
|
12674
12677
|
|
|
12675
12678
|
// src/SC-ProfilePopup/ScProfilePopup.module.css
|
|
12676
12679
|
var ScProfilePopup_default = {
|
|
@@ -12704,7 +12707,7 @@ var activateOnKey = (handler) => (event) => {
|
|
|
12704
12707
|
handler();
|
|
12705
12708
|
}
|
|
12706
12709
|
};
|
|
12707
|
-
var ScProfilePopup = (0,
|
|
12710
|
+
var ScProfilePopup = (0, import_react35.forwardRef)(
|
|
12708
12711
|
({
|
|
12709
12712
|
name = "Chris Hemsworth",
|
|
12710
12713
|
email = "chris@kepler.com",
|
package/dist/index.mjs
CHANGED
|
@@ -5433,6 +5433,7 @@ function StreamoidSidebar({
|
|
|
5433
5433
|
}
|
|
5434
5434
|
|
|
5435
5435
|
// src/SC-SidebarShell/ScSidebarShell.tsx
|
|
5436
|
+
import { forwardRef as forwardRef2 } from "react";
|
|
5436
5437
|
import {
|
|
5437
5438
|
SiconBilling as SiconBilling4,
|
|
5438
5439
|
SiconDark as SiconDark2,
|
|
@@ -5483,7 +5484,7 @@ var ScSidebarShell_default = {
|
|
|
5483
5484
|
|
|
5484
5485
|
// src/SC-SidebarShell/ScSidebarShell.tsx
|
|
5485
5486
|
import { Fragment as Fragment16, jsx as jsx53, jsxs as jsxs42 } from "react/jsx-runtime";
|
|
5486
|
-
|
|
5487
|
+
var ScSidebarWorkspaceTrigger = forwardRef2(function ScSidebarWorkspaceTrigger2({
|
|
5487
5488
|
workspaceName,
|
|
5488
5489
|
workspaceImage,
|
|
5489
5490
|
expanded,
|
|
@@ -5491,11 +5492,12 @@ function ScSidebarWorkspaceTrigger({
|
|
|
5491
5492
|
onClick,
|
|
5492
5493
|
className,
|
|
5493
5494
|
style
|
|
5494
|
-
}) {
|
|
5495
|
+
}, ref) {
|
|
5495
5496
|
const initial = (workspaceName || "W").charAt(0).toUpperCase();
|
|
5496
5497
|
return /* @__PURE__ */ jsxs42(
|
|
5497
5498
|
"button",
|
|
5498
5499
|
{
|
|
5500
|
+
ref,
|
|
5499
5501
|
type: "button",
|
|
5500
5502
|
"aria-label": `Open ${workspaceName} workspace menu`,
|
|
5501
5503
|
"aria-expanded": open,
|
|
@@ -5527,7 +5529,7 @@ function ScSidebarWorkspaceTrigger({
|
|
|
5527
5529
|
]
|
|
5528
5530
|
}
|
|
5529
5531
|
);
|
|
5530
|
-
}
|
|
5532
|
+
});
|
|
5531
5533
|
function ScSidebarSearchTrigger({
|
|
5532
5534
|
expanded,
|
|
5533
5535
|
label = "Search or Ask CXO",
|
|
@@ -5570,18 +5572,19 @@ var COMPACT_APP_LABELS = {
|
|
|
5570
5572
|
catalogix: "Ca",
|
|
5571
5573
|
photogenix: "Ph"
|
|
5572
5574
|
};
|
|
5573
|
-
|
|
5575
|
+
var ScSidebarAppIdentity = forwardRef2(function ScSidebarAppIdentity2({
|
|
5574
5576
|
expanded,
|
|
5575
5577
|
product = "streamoid",
|
|
5576
5578
|
collapsedLabel,
|
|
5577
5579
|
collapsedMark,
|
|
5578
5580
|
label,
|
|
5579
5581
|
className
|
|
5580
|
-
}) {
|
|
5582
|
+
}, ref) {
|
|
5581
5583
|
const appLabel = label ?? (product === "streamoid" ? "Streamoid" : product);
|
|
5582
5584
|
return /* @__PURE__ */ jsx53(
|
|
5583
5585
|
"span",
|
|
5584
5586
|
{
|
|
5587
|
+
ref,
|
|
5585
5588
|
"aria-label": `Switch Apps. Current app: ${appLabel}`,
|
|
5586
5589
|
title: "Switch Apps",
|
|
5587
5590
|
className: `${ScSidebarShell_default.appIdentity} ${expanded ? ScSidebarShell_default.appIdentityExpanded : ScSidebarShell_default.appIdentityCollapsed}${className ? ` ${className}` : ""}`,
|
|
@@ -5597,7 +5600,7 @@ function ScSidebarAppIdentity({
|
|
|
5597
5600
|
] }) : collapsedMark ?? (product === "streamoid" ? /* @__PURE__ */ jsx53(ScStreamoidMascot, { size: 40 }) : /* @__PURE__ */ jsx53("span", { "aria-hidden": true, className: ScSidebarShell_default.collapsedProductMark, children: collapsedLabel ?? COMPACT_APP_LABELS[product] }))
|
|
5598
5601
|
}
|
|
5599
5602
|
);
|
|
5600
|
-
}
|
|
5603
|
+
});
|
|
5601
5604
|
function MenuActionRow({
|
|
5602
5605
|
icon,
|
|
5603
5606
|
label,
|
|
@@ -12520,7 +12523,7 @@ var ScPlanDetailsCardMobile = ({
|
|
|
12520
12523
|
};
|
|
12521
12524
|
|
|
12522
12525
|
// src/SC-ProfilePopup/ScProfilePopup.tsx
|
|
12523
|
-
import { forwardRef as
|
|
12526
|
+
import { forwardRef as forwardRef3 } from "react";
|
|
12524
12527
|
|
|
12525
12528
|
// src/SC-ProfilePopup/ScProfilePopup.module.css
|
|
12526
12529
|
var ScProfilePopup_default = {
|
|
@@ -12565,7 +12568,7 @@ var activateOnKey = (handler) => (event) => {
|
|
|
12565
12568
|
handler();
|
|
12566
12569
|
}
|
|
12567
12570
|
};
|
|
12568
|
-
var ScProfilePopup =
|
|
12571
|
+
var ScProfilePopup = forwardRef3(
|
|
12569
12572
|
({
|
|
12570
12573
|
name = "Chris Hemsworth",
|
|
12571
12574
|
email = "chris@kepler.com",
|