@inf-monkeys-tech/monkeys-design 1.0.11 → 1.0.12
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/components/agent-workbench/index.d.mts +57 -2
- package/dist/components/agent-workbench/index.d.ts +57 -2
- package/dist/components/agent-workbench/index.js +669 -43
- package/dist/components/agent-workbench/index.js.map +1 -1
- package/dist/components/agent-workbench/index.mjs +636 -39
- package/dist/components/agent-workbench/index.mjs.map +1 -1
- package/dist/components/base/index.js +32 -0
- package/dist/components/base/index.js.map +1 -1
- package/dist/components/base/index.mjs +32 -0
- package/dist/components/base/index.mjs.map +1 -1
- package/dist/components/data-explorer/index.js +32 -0
- package/dist/components/data-explorer/index.js.map +1 -1
- package/dist/components/data-explorer/index.mjs +32 -0
- package/dist/components/data-explorer/index.mjs.map +1 -1
- package/dist/components/layout/index.js +32 -0
- package/dist/components/layout/index.js.map +1 -1
- package/dist/components/layout/index.mjs +32 -0
- package/dist/components/layout/index.mjs.map +1 -1
- package/dist/components/runtime/index.js +32 -0
- package/dist/components/runtime/index.js.map +1 -1
- package/dist/components/runtime/index.mjs +32 -0
- package/dist/components/runtime/index.mjs.map +1 -1
- package/dist/components/toast/index.d.mts +1 -1
- package/dist/components/toast/index.d.ts +1 -1
- package/dist/components/toast/index.js +32 -0
- package/dist/components/toast/index.js.map +1 -1
- package/dist/components/toast/index.mjs +32 -0
- package/dist/components/toast/index.mjs.map +1 -1
- package/dist/components/toolbar/index.js +32 -0
- package/dist/components/toolbar/index.js.map +1 -1
- package/dist/components/toolbar/index.mjs +32 -0
- package/dist/components/toolbar/index.mjs.map +1 -1
- package/dist/components/workbench/index.js +32 -0
- package/dist/components/workbench/index.js.map +1 -1
- package/dist/components/workbench/index.mjs +32 -0
- package/dist/components/workbench/index.mjs.map +1 -1
- package/dist/index.d.mts +2 -2
- package/dist/index.d.ts +2 -2
- package/dist/index.js +1021 -386
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +645 -17
- package/dist/index.mjs.map +1 -1
- package/dist/locale/index.d.mts +70 -2
- package/dist/locale/index.d.ts +70 -2
- package/dist/locale/index.js +68 -0
- package/dist/locale/index.js.map +1 -1
- package/dist/locale/index.mjs +68 -0
- package/dist/locale/index.mjs.map +1 -1
- package/dist/provider/index.d.mts +2 -2
- package/dist/provider/index.d.ts +2 -2
- package/dist/provider/index.js +68 -0
- package/dist/provider/index.js.map +1 -1
- package/dist/provider/index.mjs +68 -0
- package/dist/provider/index.mjs.map +1 -1
- package/dist/styles.css +1 -1
- package/dist/{types-3d3e043f0ccb.d.mts → types-37967a434f7c.d.mts} +35 -0
- package/dist/{types-3d3e043f0ccb.d.ts → types-37967a434f7c.d.ts} +35 -0
- package/package.json +3 -3
package/dist/index.js
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
var debounce = require('lodash/debounce.js');
|
|
4
4
|
var runtime = require('@inf-monkeys-tech/monkeys/runtime');
|
|
5
|
-
var
|
|
5
|
+
var React2 = require('react');
|
|
6
6
|
var jsxRuntime = require('react/jsx-runtime');
|
|
7
7
|
var lucideReact = require('lucide-react');
|
|
8
8
|
var DropdownMenu2 = require('@radix-ui/react-dropdown-menu');
|
|
@@ -11,6 +11,15 @@ var ContextMenu = require('@radix-ui/react-context-menu');
|
|
|
11
11
|
var reactDom = require('react-dom');
|
|
12
12
|
var Dialog = require('@radix-ui/react-dialog');
|
|
13
13
|
var Tooltip2 = require('@radix-ui/react-tooltip');
|
|
14
|
+
var AccordionPrimitive = require('@radix-ui/react-accordion');
|
|
15
|
+
var CheckboxPrimitive = require('@radix-ui/react-checkbox');
|
|
16
|
+
var PopoverPrimitive = require('@radix-ui/react-popover');
|
|
17
|
+
var ScrollAreaPrimitive = require('@radix-ui/react-scroll-area');
|
|
18
|
+
var reactSlot = require('@radix-ui/react-slot');
|
|
19
|
+
var SwitchPrimitive = require('@radix-ui/react-switch');
|
|
20
|
+
var TabsPrimitive = require('@radix-ui/react-tabs');
|
|
21
|
+
var classVarianceAuthority = require('class-variance-authority');
|
|
22
|
+
var SelectPrimitive = require('@radix-ui/react-select');
|
|
14
23
|
var core = require('@dnd-kit/core');
|
|
15
24
|
var sonner = require('sonner');
|
|
16
25
|
|
|
@@ -35,11 +44,18 @@ function _interopNamespace(e) {
|
|
|
35
44
|
}
|
|
36
45
|
|
|
37
46
|
var debounce__default = /*#__PURE__*/_interopDefault(debounce);
|
|
38
|
-
var
|
|
47
|
+
var React2__namespace = /*#__PURE__*/_interopNamespace(React2);
|
|
39
48
|
var DropdownMenu2__namespace = /*#__PURE__*/_interopNamespace(DropdownMenu2);
|
|
40
49
|
var ContextMenu__namespace = /*#__PURE__*/_interopNamespace(ContextMenu);
|
|
41
50
|
var Dialog__namespace = /*#__PURE__*/_interopNamespace(Dialog);
|
|
42
51
|
var Tooltip2__namespace = /*#__PURE__*/_interopNamespace(Tooltip2);
|
|
52
|
+
var AccordionPrimitive__namespace = /*#__PURE__*/_interopNamespace(AccordionPrimitive);
|
|
53
|
+
var CheckboxPrimitive__namespace = /*#__PURE__*/_interopNamespace(CheckboxPrimitive);
|
|
54
|
+
var PopoverPrimitive__namespace = /*#__PURE__*/_interopNamespace(PopoverPrimitive);
|
|
55
|
+
var ScrollAreaPrimitive__namespace = /*#__PURE__*/_interopNamespace(ScrollAreaPrimitive);
|
|
56
|
+
var SwitchPrimitive__namespace = /*#__PURE__*/_interopNamespace(SwitchPrimitive);
|
|
57
|
+
var TabsPrimitive__namespace = /*#__PURE__*/_interopNamespace(TabsPrimitive);
|
|
58
|
+
var SelectPrimitive__namespace = /*#__PURE__*/_interopNamespace(SelectPrimitive);
|
|
43
59
|
|
|
44
60
|
// node_modules/chroma-js/src/utils/limit.js
|
|
45
61
|
var limit_default = (x, low = 0, high = 1) => {
|
|
@@ -3103,6 +3119,38 @@ var enUS = {
|
|
|
3103
3119
|
label: "Context usage",
|
|
3104
3120
|
context: ({ used, total }) => `${used} / ${total} tokens`
|
|
3105
3121
|
},
|
|
3122
|
+
navigation: {
|
|
3123
|
+
search: "Search agents and sessions",
|
|
3124
|
+
searchShortcut: "Focus search",
|
|
3125
|
+
clearSearch: "Clear search",
|
|
3126
|
+
tabsLabel: "Agent workbench navigation",
|
|
3127
|
+
agents: "Agents",
|
|
3128
|
+
sessions: "Sessions",
|
|
3129
|
+
newAgent: "New Agent",
|
|
3130
|
+
newSession: "New Session",
|
|
3131
|
+
capabilities: "Capabilities & Extensions",
|
|
3132
|
+
settings: "Agent Settings",
|
|
3133
|
+
allAgents: "All Agents",
|
|
3134
|
+
recentSessions: "Recent Sessions",
|
|
3135
|
+
builtIn: "Built-in",
|
|
3136
|
+
noDescription: "No description",
|
|
3137
|
+
loading: "Loading...",
|
|
3138
|
+
emptyAgents: "No agents yet",
|
|
3139
|
+
emptySessions: "No sessions yet",
|
|
3140
|
+
noResults: "No matching results",
|
|
3141
|
+
retry: "Retry",
|
|
3142
|
+
pin: "Pin",
|
|
3143
|
+
unpin: "Unpin",
|
|
3144
|
+
rename: "Rename",
|
|
3145
|
+
delete: "Delete",
|
|
3146
|
+
actions: "Actions",
|
|
3147
|
+
save: "Save",
|
|
3148
|
+
cancel: "Cancel",
|
|
3149
|
+
running: "Running",
|
|
3150
|
+
completed: "Completed",
|
|
3151
|
+
failed: "Failed",
|
|
3152
|
+
contextUsage: ({ percent }) => `${percent}% context used`
|
|
3153
|
+
},
|
|
3106
3154
|
details: {
|
|
3107
3155
|
title: "Task details",
|
|
3108
3156
|
description: "Summary and workspace activity",
|
|
@@ -3284,6 +3332,38 @@ var zhCN = {
|
|
|
3284
3332
|
label: "\u4E0A\u4E0B\u6587\u7528\u91CF",
|
|
3285
3333
|
context: ({ used, total }) => `${used} / ${total} tokens`
|
|
3286
3334
|
},
|
|
3335
|
+
navigation: {
|
|
3336
|
+
search: "\u641C\u7D22\u667A\u80FD\u4F53\u548C\u4F1A\u8BDD",
|
|
3337
|
+
searchShortcut: "\u805A\u7126\u641C\u7D22\u6846",
|
|
3338
|
+
clearSearch: "\u6E05\u9664\u641C\u7D22",
|
|
3339
|
+
tabsLabel: "\u667A\u80FD\u4F53\u5DE5\u4F5C\u53F0\u5BFC\u822A",
|
|
3340
|
+
agents: "\u667A\u80FD\u4F53",
|
|
3341
|
+
sessions: "\u4F1A\u8BDD",
|
|
3342
|
+
newAgent: "\u65B0\u5EFA\u667A\u80FD\u4F53",
|
|
3343
|
+
newSession: "\u65B0\u5EFA\u4F1A\u8BDD",
|
|
3344
|
+
capabilities: "\u80FD\u529B\u4E0E\u6269\u5C55",
|
|
3345
|
+
settings: "\u667A\u80FD\u4F53\u8BBE\u7F6E",
|
|
3346
|
+
allAgents: "\u5168\u90E8\u667A\u80FD\u4F53",
|
|
3347
|
+
recentSessions: "\u6700\u8FD1\u4F1A\u8BDD",
|
|
3348
|
+
builtIn: "\u5185\u7F6E",
|
|
3349
|
+
noDescription: "\u6682\u65E0\u63CF\u8FF0",
|
|
3350
|
+
loading: "\u52A0\u8F7D\u4E2D...",
|
|
3351
|
+
emptyAgents: "\u6682\u65E0\u667A\u80FD\u4F53",
|
|
3352
|
+
emptySessions: "\u6682\u65E0\u4F1A\u8BDD",
|
|
3353
|
+
noResults: "\u6CA1\u6709\u5339\u914D\u7ED3\u679C",
|
|
3354
|
+
retry: "\u91CD\u8BD5",
|
|
3355
|
+
pin: "\u7F6E\u9876",
|
|
3356
|
+
unpin: "\u53D6\u6D88\u7F6E\u9876",
|
|
3357
|
+
rename: "\u91CD\u547D\u540D",
|
|
3358
|
+
delete: "\u5220\u9664",
|
|
3359
|
+
actions: "\u64CD\u4F5C",
|
|
3360
|
+
save: "\u4FDD\u5B58",
|
|
3361
|
+
cancel: "\u53D6\u6D88",
|
|
3362
|
+
running: "\u8FD0\u884C\u4E2D",
|
|
3363
|
+
completed: "\u5DF2\u5B8C\u6210",
|
|
3364
|
+
failed: "\u5931\u8D25",
|
|
3365
|
+
contextUsage: ({ percent }) => `\u5DF2\u4F7F\u7528 ${percent}% \u4E0A\u4E0B\u6587`
|
|
3366
|
+
},
|
|
3287
3367
|
details: {
|
|
3288
3368
|
title: "\u4EFB\u52A1\u8BE6\u60C5",
|
|
3289
3369
|
description: "\u6458\u8981\u4E0E\u5DE5\u4F5C\u533A\u6D3B\u52A8",
|
|
@@ -3470,6 +3550,10 @@ function mergeMonkeysLocaleMessages(base, override) {
|
|
|
3470
3550
|
...base.agentWorkbench.usage,
|
|
3471
3551
|
...override.agentWorkbench?.usage
|
|
3472
3552
|
},
|
|
3553
|
+
navigation: {
|
|
3554
|
+
...base.agentWorkbench.navigation,
|
|
3555
|
+
...override.agentWorkbench?.navigation
|
|
3556
|
+
},
|
|
3473
3557
|
details: {
|
|
3474
3558
|
...base.agentWorkbench.details,
|
|
3475
3559
|
...override.agentWorkbench?.details,
|
|
@@ -3546,17 +3630,17 @@ var MONKEYS_PROVIDER_CONTEXTS_KEY = /* @__PURE__ */ Symbol.for(
|
|
|
3546
3630
|
);
|
|
3547
3631
|
function createMonkeysProviderContexts() {
|
|
3548
3632
|
return Object.freeze({
|
|
3549
|
-
locale:
|
|
3633
|
+
locale: React2.createContext({
|
|
3550
3634
|
...defaultMonkeysLocale,
|
|
3551
3635
|
provided: false
|
|
3552
3636
|
}),
|
|
3553
|
-
theme:
|
|
3637
|
+
theme: React2.createContext({
|
|
3554
3638
|
provided: false
|
|
3555
3639
|
}),
|
|
3556
|
-
direction:
|
|
3640
|
+
direction: React2.createContext({
|
|
3557
3641
|
provided: false
|
|
3558
3642
|
}),
|
|
3559
|
-
environment:
|
|
3643
|
+
environment: React2.createContext({
|
|
3560
3644
|
provided: false,
|
|
3561
3645
|
environment: EMPTY_ENVIRONMENT,
|
|
3562
3646
|
portal: EMPTY_PORTAL
|
|
@@ -3592,43 +3676,43 @@ function mergeAppearance(inherited, explicit) {
|
|
|
3592
3676
|
};
|
|
3593
3677
|
}
|
|
3594
3678
|
function useMonkeysLocale() {
|
|
3595
|
-
return
|
|
3679
|
+
return React2.useContext(MonkeysLocaleContext);
|
|
3596
3680
|
}
|
|
3597
3681
|
function useMonkeysLocaleMessages() {
|
|
3598
|
-
return
|
|
3682
|
+
return React2.useContext(MonkeysLocaleContext).messages;
|
|
3599
3683
|
}
|
|
3600
3684
|
function useMonkeysResolvedTheme() {
|
|
3601
|
-
return
|
|
3685
|
+
return React2.useContext(MonkeysThemeContext).resolvedTheme;
|
|
3602
3686
|
}
|
|
3603
3687
|
function useMonkeysBaseAppearance(explicit) {
|
|
3604
|
-
const inherited =
|
|
3605
|
-
return
|
|
3688
|
+
const inherited = React2.useContext(MonkeysThemeContext).baseAppearance;
|
|
3689
|
+
return React2.useMemo(
|
|
3606
3690
|
() => mergeAppearance(inherited, explicit),
|
|
3607
3691
|
[explicit, inherited]
|
|
3608
3692
|
);
|
|
3609
3693
|
}
|
|
3610
3694
|
function useMonkeysDataExplorerAppearance(explicit) {
|
|
3611
|
-
const inherited =
|
|
3612
|
-
return
|
|
3695
|
+
const inherited = React2.useContext(MonkeysThemeContext).dataExplorerAppearance;
|
|
3696
|
+
return React2.useMemo(
|
|
3613
3697
|
() => mergeAppearance(inherited, explicit),
|
|
3614
3698
|
[explicit, inherited]
|
|
3615
3699
|
);
|
|
3616
3700
|
}
|
|
3617
3701
|
function useMonkeysDirection() {
|
|
3618
|
-
return
|
|
3702
|
+
return React2.useContext(MonkeysDirectionContext).direction;
|
|
3619
3703
|
}
|
|
3620
3704
|
function useMonkeysEnvironment() {
|
|
3621
|
-
return
|
|
3705
|
+
return React2.useContext(MonkeysEnvironmentContext).environment;
|
|
3622
3706
|
}
|
|
3623
3707
|
function useMonkeysPortalOptions() {
|
|
3624
|
-
return
|
|
3708
|
+
return React2.useContext(MonkeysEnvironmentContext).portal;
|
|
3625
3709
|
}
|
|
3626
3710
|
function useMonkeysComponentAttributes() {
|
|
3627
|
-
const locale =
|
|
3628
|
-
const theme =
|
|
3629
|
-
const direction =
|
|
3711
|
+
const locale = React2.useContext(MonkeysLocaleContext);
|
|
3712
|
+
const theme = React2.useContext(MonkeysThemeContext);
|
|
3713
|
+
const direction = React2.useContext(MonkeysDirectionContext);
|
|
3630
3714
|
const providerActive = locale.provided || theme.provided || direction.provided;
|
|
3631
|
-
return
|
|
3715
|
+
return React2.useMemo(
|
|
3632
3716
|
() => providerActive ? {
|
|
3633
3717
|
dir: direction.direction,
|
|
3634
3718
|
"data-monkeys-direction": direction.direction,
|
|
@@ -3701,22 +3785,22 @@ function MonkeysProvider({
|
|
|
3701
3785
|
environment,
|
|
3702
3786
|
portal
|
|
3703
3787
|
}) {
|
|
3704
|
-
const parentLocale =
|
|
3705
|
-
const parentTheme =
|
|
3706
|
-
const parentDirection =
|
|
3707
|
-
const parentEnvironment =
|
|
3788
|
+
const parentLocale = React2.useContext(MonkeysLocaleContext);
|
|
3789
|
+
const parentTheme = React2.useContext(MonkeysThemeContext);
|
|
3790
|
+
const parentDirection = React2.useContext(MonkeysDirectionContext);
|
|
3791
|
+
const parentEnvironment = React2.useContext(MonkeysEnvironmentContext);
|
|
3708
3792
|
validateDirection(direction);
|
|
3709
3793
|
validateEnvironment(environment);
|
|
3710
3794
|
validatePortal(portal);
|
|
3711
|
-
const resolvedLocale =
|
|
3795
|
+
const resolvedLocale = React2.useMemo(
|
|
3712
3796
|
() => resolveMonkeysLocale(locale, messages, parentLocale),
|
|
3713
3797
|
[locale, messages, parentLocale]
|
|
3714
3798
|
);
|
|
3715
|
-
const localeValue =
|
|
3799
|
+
const localeValue = React2.useMemo(
|
|
3716
3800
|
() => ({ ...resolvedLocale, provided: true }),
|
|
3717
3801
|
[resolvedLocale]
|
|
3718
3802
|
);
|
|
3719
|
-
const resolvedTheme =
|
|
3803
|
+
const resolvedTheme = React2.useMemo(
|
|
3720
3804
|
() => resolveProviderTheme(
|
|
3721
3805
|
theme,
|
|
3722
3806
|
colorMode,
|
|
@@ -3725,7 +3809,7 @@ function MonkeysProvider({
|
|
|
3725
3809
|
),
|
|
3726
3810
|
[colorMode, density, parentTheme.resolvedTheme, theme]
|
|
3727
3811
|
);
|
|
3728
|
-
const themeValue =
|
|
3812
|
+
const themeValue = React2.useMemo(
|
|
3729
3813
|
() => ({
|
|
3730
3814
|
provided: true,
|
|
3731
3815
|
resolvedTheme,
|
|
@@ -3768,14 +3852,14 @@ function MonkeysProvider({
|
|
|
3768
3852
|
themeId
|
|
3769
3853
|
]
|
|
3770
3854
|
);
|
|
3771
|
-
const directionValue =
|
|
3855
|
+
const directionValue = React2.useMemo(
|
|
3772
3856
|
() => ({
|
|
3773
3857
|
provided: true,
|
|
3774
3858
|
direction: direction ?? parentDirection.direction ?? "ltr"
|
|
3775
3859
|
}),
|
|
3776
3860
|
[direction, parentDirection.direction]
|
|
3777
3861
|
);
|
|
3778
|
-
const environmentValue =
|
|
3862
|
+
const environmentValue = React2.useMemo(
|
|
3779
3863
|
() => ({
|
|
3780
3864
|
provided: true,
|
|
3781
3865
|
environment: {
|
|
@@ -5492,7 +5576,7 @@ function getDomIdFragments(items) {
|
|
|
5492
5576
|
return fragment;
|
|
5493
5577
|
});
|
|
5494
5578
|
}
|
|
5495
|
-
var BaseAccordion =
|
|
5579
|
+
var BaseAccordion = React2.forwardRef(
|
|
5496
5580
|
function BaseAccordion2({
|
|
5497
5581
|
items = [],
|
|
5498
5582
|
value,
|
|
@@ -5519,19 +5603,19 @@ var BaseAccordion = React.forwardRef(
|
|
|
5519
5603
|
const resolvedAppearance = useMonkeysBaseAppearance(appearance);
|
|
5520
5604
|
const componentAttributes = useMonkeysComponentAttributes();
|
|
5521
5605
|
const theme = resolveBaseAppearance(resolvedAppearance);
|
|
5522
|
-
const generatedId =
|
|
5606
|
+
const generatedId = React2.useId();
|
|
5523
5607
|
const rootId = id ?? generatedId;
|
|
5524
|
-
const [uncontrolledValue, setUncontrolledValue] =
|
|
5525
|
-
const [focusedValue, setFocusedValue] =
|
|
5526
|
-
const triggerRefs =
|
|
5527
|
-
const ownsTriggerFocusRef =
|
|
5608
|
+
const [uncontrolledValue, setUncontrolledValue] = React2.useState(defaultValue);
|
|
5609
|
+
const [focusedValue, setFocusedValue] = React2.useState();
|
|
5610
|
+
const triggerRefs = React2.useRef(/* @__PURE__ */ new Map());
|
|
5611
|
+
const ownsTriggerFocusRef = React2.useRef(false);
|
|
5528
5612
|
const isControlled = value !== void 0;
|
|
5529
5613
|
const openValue = isControlled ? value : uncontrolledValue;
|
|
5530
5614
|
const idFragments = getDomIdFragments(items);
|
|
5531
5615
|
const enabledItems = items.filter((item) => !item.disabled);
|
|
5532
5616
|
const openItem = items.find((item) => item.value === openValue);
|
|
5533
5617
|
const layerDirection = typeof accordionProps.dir === "string" ? accordionProps.dir : componentAttributes.dir;
|
|
5534
|
-
|
|
5618
|
+
React2.useEffect(() => {
|
|
5535
5619
|
if (!ownsTriggerFocusRef.current || focusedValue === void 0) return;
|
|
5536
5620
|
const focusedItem = items.find((item) => item.value === focusedValue);
|
|
5537
5621
|
if (focusedItem && !focusedItem.disabled) return;
|
|
@@ -5626,7 +5710,7 @@ var BaseAccordion = React.forwardRef(
|
|
|
5626
5710
|
const panelId = `${rootId}-${itemId}-panel`;
|
|
5627
5711
|
const open = item.value === openValue;
|
|
5628
5712
|
const state = open ? "open" : "closed";
|
|
5629
|
-
return /* @__PURE__ */
|
|
5713
|
+
return /* @__PURE__ */ React2.createElement(
|
|
5630
5714
|
"div",
|
|
5631
5715
|
{
|
|
5632
5716
|
...componentAttributes,
|
|
@@ -5731,7 +5815,7 @@ function getInitials(name) {
|
|
|
5731
5815
|
if (!words.length) return void 0;
|
|
5732
5816
|
return words.slice(0, 2).map((word) => word[0]?.toUpperCase()).join("");
|
|
5733
5817
|
}
|
|
5734
|
-
var BaseAvatar =
|
|
5818
|
+
var BaseAvatar = React2.forwardRef(
|
|
5735
5819
|
function BaseAvatar2({
|
|
5736
5820
|
src,
|
|
5737
5821
|
alt,
|
|
@@ -5754,14 +5838,14 @@ var BaseAvatar = React.forwardRef(
|
|
|
5754
5838
|
const resolvedAppearance = useMonkeysBaseAppearance(appearance);
|
|
5755
5839
|
const componentAttributes = useMonkeysComponentAttributes();
|
|
5756
5840
|
const theme = resolveBaseAppearance(resolvedAppearance);
|
|
5757
|
-
const [failedSrc, setFailedSrc] =
|
|
5841
|
+
const [failedSrc, setFailedSrc] = React2.useState();
|
|
5758
5842
|
const imageFailed = Boolean(src && failedSrc === src);
|
|
5759
5843
|
const showImage = Boolean(src) && !imageFailed;
|
|
5760
5844
|
const generatedInitials = getInitials(name);
|
|
5761
5845
|
const fallbackKind = hasRenderableNode(children) ? "children" : hasRenderableNode(initials) ? "initials" : hasRenderableNode(generatedInitials) ? "name" : hasRenderableNode(icon) ? "icon" : "default";
|
|
5762
5846
|
const fallback = hasRenderableNode(children) ? children : hasRenderableNode(initials) ? initials : hasRenderableNode(generatedInitials) ? generatedInitials : hasRenderableNode(icon) ? icon : "?";
|
|
5763
5847
|
const statusKind = isStatusPreset(status) ? status : hasRenderableNode(status) ? "custom" : void 0;
|
|
5764
|
-
|
|
5848
|
+
React2.useEffect(() => {
|
|
5765
5849
|
setFailedSrc(void 0);
|
|
5766
5850
|
}, [src]);
|
|
5767
5851
|
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
@@ -5848,7 +5932,7 @@ function resolveAspectRatio(value) {
|
|
|
5848
5932
|
}
|
|
5849
5933
|
return String(value);
|
|
5850
5934
|
}
|
|
5851
|
-
var BaseAspectRatio =
|
|
5935
|
+
var BaseAspectRatio = React2.forwardRef(function BaseAspectRatio2({
|
|
5852
5936
|
children,
|
|
5853
5937
|
ratio = 16 / 9,
|
|
5854
5938
|
appearance,
|
|
@@ -5879,7 +5963,7 @@ var BaseAspectRatio = React.forwardRef(function BaseAspectRatio2({
|
|
|
5879
5963
|
}
|
|
5880
5964
|
);
|
|
5881
5965
|
});
|
|
5882
|
-
var BaseBadge =
|
|
5966
|
+
var BaseBadge = React2.forwardRef(
|
|
5883
5967
|
function BaseBadge2({
|
|
5884
5968
|
children,
|
|
5885
5969
|
label,
|
|
@@ -6092,7 +6176,7 @@ function LoadingIcon() {
|
|
|
6092
6176
|
}
|
|
6093
6177
|
);
|
|
6094
6178
|
}
|
|
6095
|
-
var BaseButton =
|
|
6179
|
+
var BaseButton = React2.forwardRef(
|
|
6096
6180
|
function BaseButton2({
|
|
6097
6181
|
children,
|
|
6098
6182
|
label,
|
|
@@ -6286,17 +6370,17 @@ function resolveBaseFieldValidationResult(result) {
|
|
|
6286
6370
|
"BaseField validate must return a non-empty error string or null."
|
|
6287
6371
|
);
|
|
6288
6372
|
}
|
|
6289
|
-
var BaseFieldContext =
|
|
6373
|
+
var BaseFieldContext = React2.createContext(
|
|
6290
6374
|
null
|
|
6291
6375
|
);
|
|
6292
6376
|
function useBaseFieldControl() {
|
|
6293
|
-
const context =
|
|
6294
|
-
const controlKeyRef =
|
|
6377
|
+
const context = React2.useContext(BaseFieldContext);
|
|
6378
|
+
const controlKeyRef = React2.useRef(null);
|
|
6295
6379
|
if (controlKeyRef.current === null) {
|
|
6296
6380
|
controlKeyRef.current = /* @__PURE__ */ Symbol("BaseFieldControl");
|
|
6297
6381
|
}
|
|
6298
6382
|
const registerControl = context?.registerControl;
|
|
6299
|
-
|
|
6383
|
+
React2.useEffect(() => {
|
|
6300
6384
|
if (!registerControl || controlKeyRef.current === null) return void 0;
|
|
6301
6385
|
return registerControl(controlKeyRef.current);
|
|
6302
6386
|
}, [registerControl]);
|
|
@@ -6304,11 +6388,11 @@ function useBaseFieldControl() {
|
|
|
6304
6388
|
const notifyChange = context?.notifyChange;
|
|
6305
6389
|
return {
|
|
6306
6390
|
invalid: context?.invalid ?? false,
|
|
6307
|
-
notifyBlur:
|
|
6391
|
+
notifyBlur: React2.useCallback(
|
|
6308
6392
|
(value) => notifyBlur?.(value),
|
|
6309
6393
|
[notifyBlur]
|
|
6310
6394
|
),
|
|
6311
|
-
notifyChange:
|
|
6395
|
+
notifyChange: React2.useCallback(
|
|
6312
6396
|
(value) => notifyChange?.(value),
|
|
6313
6397
|
[notifyChange]
|
|
6314
6398
|
)
|
|
@@ -6334,7 +6418,7 @@ function setRefs(element, ...refs) {
|
|
|
6334
6418
|
ref.current = element;
|
|
6335
6419
|
}
|
|
6336
6420
|
}
|
|
6337
|
-
var BaseCheckbox =
|
|
6421
|
+
var BaseCheckbox = React2.forwardRef(
|
|
6338
6422
|
function BaseCheckbox2({
|
|
6339
6423
|
label,
|
|
6340
6424
|
description,
|
|
@@ -6374,17 +6458,17 @@ var BaseCheckbox = React.forwardRef(
|
|
|
6374
6458
|
const resolvedInvalid = invalid || fieldControl.invalid;
|
|
6375
6459
|
const hasLabel = hasRenderableNode(label);
|
|
6376
6460
|
const hasDescription = hasNonEmptyRenderableNode(description);
|
|
6377
|
-
const inputRef =
|
|
6378
|
-
const indeterminateRef =
|
|
6461
|
+
const inputRef = React2.useRef(null);
|
|
6462
|
+
const indeterminateRef = React2.useRef(indeterminate);
|
|
6379
6463
|
indeterminateRef.current = indeterminate;
|
|
6380
|
-
const [uncontrolledChecked, setUncontrolledChecked] =
|
|
6464
|
+
const [uncontrolledChecked, setUncontrolledChecked] = React2.useState(
|
|
6381
6465
|
defaultChecked ?? false
|
|
6382
6466
|
);
|
|
6383
6467
|
const isControlled = checked !== void 0;
|
|
6384
6468
|
const resolvedChecked = Boolean(isControlled ? checked : uncontrolledChecked);
|
|
6385
6469
|
const active = indeterminate || resolvedChecked;
|
|
6386
6470
|
const state = indeterminate ? "mixed" : resolvedChecked ? "checked" : "unchecked";
|
|
6387
|
-
const setInputRef =
|
|
6471
|
+
const setInputRef = React2.useCallback(
|
|
6388
6472
|
(element) => {
|
|
6389
6473
|
inputRef.current = element;
|
|
6390
6474
|
if (element) element.indeterminate = indeterminateRef.current;
|
|
@@ -6392,7 +6476,7 @@ var BaseCheckbox = React.forwardRef(
|
|
|
6392
6476
|
},
|
|
6393
6477
|
[forwardedRef]
|
|
6394
6478
|
);
|
|
6395
|
-
|
|
6479
|
+
React2.useEffect(() => {
|
|
6396
6480
|
if (inputRef.current) {
|
|
6397
6481
|
inputRef.current.indeterminate = indeterminate;
|
|
6398
6482
|
}
|
|
@@ -6523,7 +6607,7 @@ var BaseCheckbox = React.forwardRef(
|
|
|
6523
6607
|
);
|
|
6524
6608
|
}
|
|
6525
6609
|
);
|
|
6526
|
-
var BaseCode =
|
|
6610
|
+
var BaseCode = React2.forwardRef(function BaseCode2({
|
|
6527
6611
|
children,
|
|
6528
6612
|
display = "inline",
|
|
6529
6613
|
appearance,
|
|
@@ -6587,7 +6671,7 @@ var BaseCode = React.forwardRef(function BaseCode2({
|
|
|
6587
6671
|
}
|
|
6588
6672
|
);
|
|
6589
6673
|
});
|
|
6590
|
-
var BaseContainer =
|
|
6674
|
+
var BaseContainer = React2.forwardRef(
|
|
6591
6675
|
function BaseContainer2({
|
|
6592
6676
|
children,
|
|
6593
6677
|
maxWidth = "80rem",
|
|
@@ -6674,8 +6758,8 @@ function resolveBasePortalContainer({
|
|
|
6674
6758
|
function BasePortal(props) {
|
|
6675
6759
|
const environment = useMonkeysEnvironment();
|
|
6676
6760
|
const portalOptions = useMonkeysPortalOptions();
|
|
6677
|
-
const [mounted, setMounted] =
|
|
6678
|
-
|
|
6761
|
+
const [mounted, setMounted] = React2.useState(false);
|
|
6762
|
+
React2.useEffect(() => {
|
|
6679
6763
|
setMounted(true);
|
|
6680
6764
|
}, []);
|
|
6681
6765
|
if (props.disabled !== void 0 && typeof props.disabled !== "boolean") {
|
|
@@ -6745,8 +6829,8 @@ function getDefaultDocument() {
|
|
|
6745
6829
|
function useBaseOverlayPortal(options = {}) {
|
|
6746
6830
|
const environment = useMonkeysEnvironment();
|
|
6747
6831
|
const portalOptions = useMonkeysPortalOptions();
|
|
6748
|
-
const [mounted, setMounted] =
|
|
6749
|
-
|
|
6832
|
+
const [mounted, setMounted] = React2.useState(false);
|
|
6833
|
+
React2.useEffect(() => {
|
|
6750
6834
|
setMounted(true);
|
|
6751
6835
|
}, []);
|
|
6752
6836
|
return resolveBaseOverlayPortalState({
|
|
@@ -6899,7 +6983,7 @@ function BaseContextMenu({
|
|
|
6899
6983
|
}
|
|
6900
6984
|
);
|
|
6901
6985
|
}
|
|
6902
|
-
var BaseContextMenuTrigger =
|
|
6986
|
+
var BaseContextMenuTrigger = React2.forwardRef(function BaseContextMenuTrigger2({
|
|
6903
6987
|
children,
|
|
6904
6988
|
disabled = false,
|
|
6905
6989
|
asChild = false,
|
|
@@ -6934,7 +7018,7 @@ var BaseContextMenuTrigger = React.forwardRef(function BaseContextMenuTrigger2({
|
|
|
6934
7018
|
}
|
|
6935
7019
|
);
|
|
6936
7020
|
});
|
|
6937
|
-
var BaseContextMenuContent =
|
|
7021
|
+
var BaseContextMenuContent = React2.forwardRef(function BaseContextMenuContent2({
|
|
6938
7022
|
children,
|
|
6939
7023
|
appearance,
|
|
6940
7024
|
className,
|
|
@@ -6964,7 +7048,7 @@ var BaseContextMenuContent = React.forwardRef(function BaseContextMenuContent2({
|
|
|
6964
7048
|
);
|
|
6965
7049
|
return portal.shouldPortal ? /* @__PURE__ */ jsxRuntime.jsx(ContextMenu__namespace.Portal, { ...portal.radixPortalProps, children: content }) : content;
|
|
6966
7050
|
});
|
|
6967
|
-
var BaseContextMenuLabel =
|
|
7051
|
+
var BaseContextMenuLabel = React2.forwardRef(function BaseContextMenuLabel2({ children, appearance, className, style, ...labelProps }, ref) {
|
|
6968
7052
|
const resolvedAppearance = useMonkeysBaseAppearance(appearance);
|
|
6969
7053
|
const componentAttributes = useMonkeysComponentAttributes();
|
|
6970
7054
|
const theme = resolveBaseAppearance(resolvedAppearance);
|
|
@@ -6982,7 +7066,7 @@ var BaseContextMenuLabel = React.forwardRef(function BaseContextMenuLabel2({ chi
|
|
|
6982
7066
|
}
|
|
6983
7067
|
);
|
|
6984
7068
|
});
|
|
6985
|
-
var BaseContextMenuSeparator =
|
|
7069
|
+
var BaseContextMenuSeparator = React2.forwardRef(function BaseContextMenuSeparator2({ appearance, className, style, ...separatorProps }, ref) {
|
|
6986
7070
|
const resolvedAppearance = useMonkeysBaseAppearance(appearance);
|
|
6987
7071
|
const componentAttributes = useMonkeysComponentAttributes();
|
|
6988
7072
|
const theme = resolveBaseAppearance(resolvedAppearance);
|
|
@@ -6999,7 +7083,7 @@ var BaseContextMenuSeparator = React.forwardRef(function BaseContextMenuSeparato
|
|
|
6999
7083
|
}
|
|
7000
7084
|
);
|
|
7001
7085
|
});
|
|
7002
|
-
var BaseContextMenuItem =
|
|
7086
|
+
var BaseContextMenuItem = React2.forwardRef(function BaseContextMenuItem2({
|
|
7003
7087
|
children,
|
|
7004
7088
|
label,
|
|
7005
7089
|
icon,
|
|
@@ -7065,7 +7149,7 @@ var BaseContextMenuItem = React.forwardRef(function BaseContextMenuItem2({
|
|
|
7065
7149
|
}
|
|
7066
7150
|
);
|
|
7067
7151
|
});
|
|
7068
|
-
var BaseContextMenuCheckboxItem =
|
|
7152
|
+
var BaseContextMenuCheckboxItem = React2.forwardRef(function BaseContextMenuCheckboxItem2({
|
|
7069
7153
|
children,
|
|
7070
7154
|
label,
|
|
7071
7155
|
icon,
|
|
@@ -7160,7 +7244,7 @@ function BaseContextMenuRadioGroup({
|
|
|
7160
7244
|
}) {
|
|
7161
7245
|
return /* @__PURE__ */ jsxRuntime.jsx(ContextMenu__namespace.RadioGroup, { value, onValueChange, children });
|
|
7162
7246
|
}
|
|
7163
|
-
var BaseContextMenuRadioItem =
|
|
7247
|
+
var BaseContextMenuRadioItem = React2.forwardRef(function BaseContextMenuRadioItem2({
|
|
7164
7248
|
children,
|
|
7165
7249
|
label,
|
|
7166
7250
|
icon,
|
|
@@ -7258,7 +7342,7 @@ function BaseContextMenuSub({
|
|
|
7258
7342
|
}
|
|
7259
7343
|
);
|
|
7260
7344
|
}
|
|
7261
|
-
var BaseContextMenuSubTrigger =
|
|
7345
|
+
var BaseContextMenuSubTrigger = React2.forwardRef(function BaseContextMenuSubTrigger2({
|
|
7262
7346
|
children,
|
|
7263
7347
|
label,
|
|
7264
7348
|
icon,
|
|
@@ -7341,7 +7425,7 @@ var BaseContextMenuSubTrigger = React.forwardRef(function BaseContextMenuSubTrig
|
|
|
7341
7425
|
}
|
|
7342
7426
|
);
|
|
7343
7427
|
});
|
|
7344
|
-
var BaseContextMenuSubContent =
|
|
7428
|
+
var BaseContextMenuSubContent = React2.forwardRef(function BaseContextMenuSubContent2({
|
|
7345
7429
|
children,
|
|
7346
7430
|
appearance,
|
|
7347
7431
|
className,
|
|
@@ -7497,7 +7581,7 @@ function renderTrigger({
|
|
|
7497
7581
|
}
|
|
7498
7582
|
);
|
|
7499
7583
|
}
|
|
7500
|
-
var BaseDialog =
|
|
7584
|
+
var BaseDialog = React2.forwardRef(
|
|
7501
7585
|
function BaseDialog2({
|
|
7502
7586
|
open,
|
|
7503
7587
|
defaultOpen = false,
|
|
@@ -7555,9 +7639,9 @@ var BaseDialog = React.forwardRef(
|
|
|
7555
7639
|
const resolvedCloseLabel = closeLabel === void 0 ? messages.close : closeLabel;
|
|
7556
7640
|
const theme = resolveBaseAppearance(resolvedAppearance);
|
|
7557
7641
|
const overlayPortal = useBaseOverlayPortal({ disabled: !portal });
|
|
7558
|
-
const [uncontrolledOpen, setUncontrolledOpen] =
|
|
7559
|
-
const panelRef =
|
|
7560
|
-
const returnFocusRef =
|
|
7642
|
+
const [uncontrolledOpen, setUncontrolledOpen] = React2.useState(defaultOpen);
|
|
7643
|
+
const panelRef = React2.useRef(null);
|
|
7644
|
+
const returnFocusRef = React2.useRef(null);
|
|
7561
7645
|
const isControlled = open !== void 0;
|
|
7562
7646
|
const isOpen = isControlled ? open : uncontrolledOpen;
|
|
7563
7647
|
const portalState = portal && overlayPortal.shouldPortal ? "portaled" : "inline";
|
|
@@ -7575,7 +7659,7 @@ var BaseDialog = React.forwardRef(
|
|
|
7575
7659
|
}
|
|
7576
7660
|
onOpenChange?.(nextOpen);
|
|
7577
7661
|
};
|
|
7578
|
-
|
|
7662
|
+
React2.useEffect(() => {
|
|
7579
7663
|
if (!isOpen || !keepMounted) return void 0;
|
|
7580
7664
|
const panel = panelRef.current;
|
|
7581
7665
|
const ownerDocument = panel?.ownerDocument;
|
|
@@ -7852,7 +7936,7 @@ var BaseDialog = React.forwardRef(
|
|
|
7852
7936
|
);
|
|
7853
7937
|
}
|
|
7854
7938
|
);
|
|
7855
|
-
var BaseDivider =
|
|
7939
|
+
var BaseDivider = React2.forwardRef(
|
|
7856
7940
|
function BaseDivider2({
|
|
7857
7941
|
orientation = "horizontal",
|
|
7858
7942
|
label,
|
|
@@ -8047,7 +8131,7 @@ function renderTrigger2({
|
|
|
8047
8131
|
}
|
|
8048
8132
|
);
|
|
8049
8133
|
}
|
|
8050
|
-
var BaseDropdownMenu =
|
|
8134
|
+
var BaseDropdownMenu = React2.forwardRef(function BaseDropdownMenu2({
|
|
8051
8135
|
items = [],
|
|
8052
8136
|
label,
|
|
8053
8137
|
trigger,
|
|
@@ -8084,7 +8168,7 @@ var BaseDropdownMenu = React.forwardRef(function BaseDropdownMenu2({
|
|
|
8084
8168
|
const messages = useMonkeysLocaleMessages().dropdownMenu;
|
|
8085
8169
|
const theme = resolveBaseAppearance(resolvedAppearance);
|
|
8086
8170
|
const overlayPortal = useBaseOverlayPortal({ disabled: !portal });
|
|
8087
|
-
const [uncontrolledOpen, setUncontrolledOpen] =
|
|
8171
|
+
const [uncontrolledOpen, setUncontrolledOpen] = React2.useState(defaultOpen);
|
|
8088
8172
|
const isControlled = open !== void 0;
|
|
8089
8173
|
const isOpen = isControlled ? open : uncontrolledOpen;
|
|
8090
8174
|
const resolvedTriggerLabel = triggerLabel === void 0 ? messages.actions : triggerLabel;
|
|
@@ -8333,7 +8417,7 @@ function DefaultEmptyIcon() {
|
|
|
8333
8417
|
}
|
|
8334
8418
|
);
|
|
8335
8419
|
}
|
|
8336
|
-
var BaseEmptyState =
|
|
8420
|
+
var BaseEmptyState = React2.forwardRef(
|
|
8337
8421
|
function BaseEmptyState2({
|
|
8338
8422
|
icon = /* @__PURE__ */ jsxRuntime.jsx(DefaultEmptyIcon, {}),
|
|
8339
8423
|
title,
|
|
@@ -8420,7 +8504,7 @@ function resolveOptionalId(value, fallback, name) {
|
|
|
8420
8504
|
}
|
|
8421
8505
|
return value;
|
|
8422
8506
|
}
|
|
8423
|
-
var BaseField =
|
|
8507
|
+
var BaseField = React2.forwardRef(
|
|
8424
8508
|
function BaseField2({
|
|
8425
8509
|
label,
|
|
8426
8510
|
description,
|
|
@@ -8457,33 +8541,33 @@ var BaseField = React.forwardRef(
|
|
|
8457
8541
|
'BaseField validationMode must be "onBlur" or "onChange".'
|
|
8458
8542
|
);
|
|
8459
8543
|
}
|
|
8460
|
-
const generatedId =
|
|
8544
|
+
const generatedId = React2.useId();
|
|
8461
8545
|
const resolvedAppearance = useMonkeysBaseAppearance(appearance);
|
|
8462
8546
|
const componentAttributes = useMonkeysComponentAttributes();
|
|
8463
8547
|
const theme = resolveBaseAppearance(resolvedAppearance);
|
|
8464
8548
|
const hasDescription = hasRenderableNode(description);
|
|
8465
|
-
const [internalError, setInternalError] =
|
|
8466
|
-
const registeredControlsRef =
|
|
8467
|
-
const validateRef =
|
|
8468
|
-
const validationModeRef =
|
|
8469
|
-
const disabledRef =
|
|
8549
|
+
const [internalError, setInternalError] = React2.useState(null);
|
|
8550
|
+
const registeredControlsRef = React2.useRef(/* @__PURE__ */ new Set());
|
|
8551
|
+
const validateRef = React2.useRef(validate);
|
|
8552
|
+
const validationModeRef = React2.useRef(validationMode);
|
|
8553
|
+
const disabledRef = React2.useRef(disabled);
|
|
8470
8554
|
validateRef.current = validate;
|
|
8471
8555
|
validationModeRef.current = validationMode;
|
|
8472
8556
|
disabledRef.current = disabled;
|
|
8473
8557
|
const hasValidator = validate !== void 0;
|
|
8474
|
-
|
|
8558
|
+
React2.useEffect(() => {
|
|
8475
8559
|
if (!hasValidator || disabled) {
|
|
8476
8560
|
setInternalError(null);
|
|
8477
8561
|
}
|
|
8478
8562
|
}, [disabled, hasValidator]);
|
|
8479
|
-
|
|
8563
|
+
React2.useEffect(() => {
|
|
8480
8564
|
if (hasValidator && registeredControlsRef.current.size !== 1) {
|
|
8481
8565
|
throw new TypeError(
|
|
8482
8566
|
"BaseField with validate must contain exactly one compatible Base control."
|
|
8483
8567
|
);
|
|
8484
8568
|
}
|
|
8485
8569
|
}, [hasValidator]);
|
|
8486
|
-
const registerControl =
|
|
8570
|
+
const registerControl = React2.useCallback((controlKey) => {
|
|
8487
8571
|
const registeredControls = registeredControlsRef.current;
|
|
8488
8572
|
if (validateRef.current !== void 0 && !registeredControls.has(controlKey) && registeredControls.size > 0) {
|
|
8489
8573
|
throw new TypeError(
|
|
@@ -8495,7 +8579,7 @@ var BaseField = React.forwardRef(
|
|
|
8495
8579
|
registeredControls.delete(controlKey);
|
|
8496
8580
|
};
|
|
8497
8581
|
}, []);
|
|
8498
|
-
const runValidation =
|
|
8582
|
+
const runValidation = React2.useCallback(
|
|
8499
8583
|
(mode, value) => {
|
|
8500
8584
|
const currentValidate = validateRef.current;
|
|
8501
8585
|
if (disabledRef.current || currentValidate === void 0 || validationModeRef.current !== mode) {
|
|
@@ -8510,11 +8594,11 @@ var BaseField = React.forwardRef(
|
|
|
8510
8594
|
},
|
|
8511
8595
|
[]
|
|
8512
8596
|
);
|
|
8513
|
-
const notifyBlur =
|
|
8597
|
+
const notifyBlur = React2.useCallback(
|
|
8514
8598
|
(value) => runValidation("onBlur", value),
|
|
8515
8599
|
[runValidation]
|
|
8516
8600
|
);
|
|
8517
|
-
const notifyChange =
|
|
8601
|
+
const notifyChange = React2.useCallback(
|
|
8518
8602
|
(value) => runValidation("onChange", value),
|
|
8519
8603
|
[runValidation]
|
|
8520
8604
|
);
|
|
@@ -8544,7 +8628,7 @@ var BaseField = React.forwardRef(
|
|
|
8544
8628
|
disabled: disabled || void 0
|
|
8545
8629
|
};
|
|
8546
8630
|
const renderedChildren = typeof children === "function" ? children(controlProps) : children;
|
|
8547
|
-
const fieldContextValue =
|
|
8631
|
+
const fieldContextValue = React2.useMemo(
|
|
8548
8632
|
() => ({
|
|
8549
8633
|
invalid: hasError,
|
|
8550
8634
|
registerControl,
|
|
@@ -8664,7 +8748,7 @@ function resolveOptionalId2(value, fallback, name) {
|
|
|
8664
8748
|
}
|
|
8665
8749
|
return value;
|
|
8666
8750
|
}
|
|
8667
|
-
var BaseFieldset =
|
|
8751
|
+
var BaseFieldset = React2.forwardRef(
|
|
8668
8752
|
function BaseFieldset2({
|
|
8669
8753
|
children,
|
|
8670
8754
|
legend,
|
|
@@ -8681,7 +8765,7 @@ var BaseFieldset = React.forwardRef(
|
|
|
8681
8765
|
"aria-errormessage": ariaErrorMessage,
|
|
8682
8766
|
...fieldsetProps
|
|
8683
8767
|
}, ref) {
|
|
8684
|
-
const generatedId =
|
|
8768
|
+
const generatedId = React2.useId();
|
|
8685
8769
|
const resolvedAppearance = useMonkeysBaseAppearance(appearance);
|
|
8686
8770
|
const componentAttributes = useMonkeysComponentAttributes();
|
|
8687
8771
|
const theme = resolveBaseAppearance(resolvedAppearance);
|
|
@@ -8765,7 +8849,7 @@ var BaseFieldset = React.forwardRef(
|
|
|
8765
8849
|
function isHeadingLevel(value) {
|
|
8766
8850
|
return typeof value === "number" && Number.isInteger(value) && value >= 1 && value <= 6;
|
|
8767
8851
|
}
|
|
8768
|
-
var BaseHeading =
|
|
8852
|
+
var BaseHeading = React2.forwardRef(
|
|
8769
8853
|
function BaseHeading2({
|
|
8770
8854
|
level = 2,
|
|
8771
8855
|
children,
|
|
@@ -8783,7 +8867,7 @@ var BaseHeading = React.forwardRef(
|
|
|
8783
8867
|
if (!isHeadingLevel(level)) {
|
|
8784
8868
|
throw new RangeError("BaseHeading level must be an integer from 1 to 6.");
|
|
8785
8869
|
}
|
|
8786
|
-
return
|
|
8870
|
+
return React2.createElement(
|
|
8787
8871
|
`h${level}`,
|
|
8788
8872
|
{
|
|
8789
8873
|
...componentAttributes,
|
|
@@ -8810,7 +8894,7 @@ var BaseHeading = React.forwardRef(
|
|
|
8810
8894
|
);
|
|
8811
8895
|
}
|
|
8812
8896
|
);
|
|
8813
|
-
var BaseGrid =
|
|
8897
|
+
var BaseGrid = React2.forwardRef(
|
|
8814
8898
|
function BaseGrid2({
|
|
8815
8899
|
children,
|
|
8816
8900
|
columns = 1,
|
|
@@ -8857,7 +8941,7 @@ var controlSizeClassNames = {
|
|
|
8857
8941
|
md: "h-9 px-3 text-sm",
|
|
8858
8942
|
lg: "h-10 px-3.5 text-base"
|
|
8859
8943
|
};
|
|
8860
|
-
var BaseInput =
|
|
8944
|
+
var BaseInput = React2.forwardRef(
|
|
8861
8945
|
function BaseInput2({
|
|
8862
8946
|
icon,
|
|
8863
8947
|
trailing,
|
|
@@ -8966,7 +9050,7 @@ var BaseInput = React.forwardRef(
|
|
|
8966
9050
|
);
|
|
8967
9051
|
}
|
|
8968
9052
|
);
|
|
8969
|
-
var BaseInputGroup =
|
|
9053
|
+
var BaseInputGroup = React2.forwardRef(function BaseInputGroup2({
|
|
8970
9054
|
children,
|
|
8971
9055
|
startElement,
|
|
8972
9056
|
endElement,
|
|
@@ -9083,7 +9167,7 @@ var BaseInputGroup = React.forwardRef(function BaseInputGroup2({
|
|
|
9083
9167
|
}
|
|
9084
9168
|
);
|
|
9085
9169
|
});
|
|
9086
|
-
var BaseInline =
|
|
9170
|
+
var BaseInline = React2.forwardRef(
|
|
9087
9171
|
function BaseInline2({
|
|
9088
9172
|
children,
|
|
9089
9173
|
gap,
|
|
@@ -9128,7 +9212,7 @@ var BaseInline = React.forwardRef(
|
|
|
9128
9212
|
);
|
|
9129
9213
|
}
|
|
9130
9214
|
);
|
|
9131
|
-
var BaseKbd =
|
|
9215
|
+
var BaseKbd = React2.forwardRef(function BaseKbd2({
|
|
9132
9216
|
children,
|
|
9133
9217
|
appearance,
|
|
9134
9218
|
className,
|
|
@@ -9246,7 +9330,7 @@ function setPointerCaptureIfAvailable(target, pointerId) {
|
|
|
9246
9330
|
throw error;
|
|
9247
9331
|
}
|
|
9248
9332
|
}
|
|
9249
|
-
var BaseLayout =
|
|
9333
|
+
var BaseLayout = React2.forwardRef(
|
|
9250
9334
|
function BaseLayout2({
|
|
9251
9335
|
header,
|
|
9252
9336
|
sidebar,
|
|
@@ -9376,7 +9460,7 @@ var BaseLayout = React.forwardRef(
|
|
|
9376
9460
|
);
|
|
9377
9461
|
}
|
|
9378
9462
|
);
|
|
9379
|
-
var BaseLayoutPane =
|
|
9463
|
+
var BaseLayoutPane = React2.forwardRef(
|
|
9380
9464
|
function BaseLayoutPane2({
|
|
9381
9465
|
as = "div",
|
|
9382
9466
|
scrollable = false,
|
|
@@ -9424,7 +9508,7 @@ var BaseLayoutPane = React.forwardRef(
|
|
|
9424
9508
|
);
|
|
9425
9509
|
}
|
|
9426
9510
|
);
|
|
9427
|
-
var BaseLayoutResizeHandle =
|
|
9511
|
+
var BaseLayoutResizeHandle = React2.forwardRef(function BaseLayoutResizeHandle2({
|
|
9428
9512
|
orientation = "horizontal",
|
|
9429
9513
|
resizable = false,
|
|
9430
9514
|
disabled = false,
|
|
@@ -9506,7 +9590,7 @@ var BaseLayoutResizeHandle = React.forwardRef(function BaseLayoutResizeHandle2({
|
|
|
9506
9590
|
}
|
|
9507
9591
|
);
|
|
9508
9592
|
});
|
|
9509
|
-
var BaseLayoutSplit =
|
|
9593
|
+
var BaseLayoutSplit = React2.forwardRef(
|
|
9510
9594
|
function BaseLayoutSplit2({
|
|
9511
9595
|
orientation = "horizontal",
|
|
9512
9596
|
primary,
|
|
@@ -9542,9 +9626,9 @@ var BaseLayoutSplit = React.forwardRef(
|
|
|
9542
9626
|
bounds.min,
|
|
9543
9627
|
bounds.max
|
|
9544
9628
|
);
|
|
9545
|
-
const [uncontrolledSize, setUncontrolledSize] =
|
|
9546
|
-
const rootRef =
|
|
9547
|
-
const cleanupRef =
|
|
9629
|
+
const [uncontrolledSize, setUncontrolledSize] = React2.useState(initialSize);
|
|
9630
|
+
const rootRef = React2.useRef(null);
|
|
9631
|
+
const cleanupRef = React2.useRef(null);
|
|
9548
9632
|
const controlled = size !== void 0;
|
|
9549
9633
|
const interactive = resizable && !disabled;
|
|
9550
9634
|
const renderedSize = resolveSplitSize(
|
|
@@ -9555,14 +9639,14 @@ var BaseLayoutSplit = React.forwardRef(
|
|
|
9555
9639
|
bounds.max
|
|
9556
9640
|
);
|
|
9557
9641
|
const resolvedDirection = splitProps.dir ?? componentAttributes.dir;
|
|
9558
|
-
const setRootRef =
|
|
9642
|
+
const setRootRef = React2.useCallback(
|
|
9559
9643
|
(node) => {
|
|
9560
9644
|
rootRef.current = node;
|
|
9561
9645
|
assignRef(ref, node);
|
|
9562
9646
|
},
|
|
9563
9647
|
[ref]
|
|
9564
9648
|
);
|
|
9565
|
-
const commitSize =
|
|
9649
|
+
const commitSize = React2.useCallback(
|
|
9566
9650
|
(nextSize) => {
|
|
9567
9651
|
const clampedSize = clamp(nextSize, bounds.min, bounds.max);
|
|
9568
9652
|
if (!controlled) {
|
|
@@ -9572,7 +9656,7 @@ var BaseLayoutSplit = React.forwardRef(
|
|
|
9572
9656
|
},
|
|
9573
9657
|
[bounds.max, bounds.min, controlled, onSizeChange]
|
|
9574
9658
|
);
|
|
9575
|
-
const updateFromPointer =
|
|
9659
|
+
const updateFromPointer = React2.useCallback(
|
|
9576
9660
|
(event) => {
|
|
9577
9661
|
const root = rootRef.current;
|
|
9578
9662
|
if (!root) return;
|
|
@@ -9584,12 +9668,12 @@ var BaseLayoutSplit = React.forwardRef(
|
|
|
9584
9668
|
},
|
|
9585
9669
|
[commitSize, orientation]
|
|
9586
9670
|
);
|
|
9587
|
-
const stopResize =
|
|
9671
|
+
const stopResize = React2.useCallback(() => {
|
|
9588
9672
|
const cleanup = cleanupRef.current;
|
|
9589
9673
|
cleanupRef.current = null;
|
|
9590
9674
|
cleanup?.();
|
|
9591
9675
|
}, []);
|
|
9592
|
-
|
|
9676
|
+
React2.useEffect(() => {
|
|
9593
9677
|
if (!interactive) stopResize();
|
|
9594
9678
|
return stopResize;
|
|
9595
9679
|
}, [interactive, stopResize]);
|
|
@@ -9766,7 +9850,7 @@ function DefaultLoadingIcon({ className }) {
|
|
|
9766
9850
|
}
|
|
9767
9851
|
);
|
|
9768
9852
|
}
|
|
9769
|
-
var BaseLoadingState =
|
|
9853
|
+
var BaseLoadingState = React2.forwardRef(function BaseLoadingState2({
|
|
9770
9854
|
icon,
|
|
9771
9855
|
title,
|
|
9772
9856
|
description,
|
|
@@ -9849,7 +9933,7 @@ var BaseLoadingState = React.forwardRef(function BaseLoadingState2({
|
|
|
9849
9933
|
}
|
|
9850
9934
|
);
|
|
9851
9935
|
});
|
|
9852
|
-
var BaseLink =
|
|
9936
|
+
var BaseLink = React2.forwardRef(
|
|
9853
9937
|
function BaseLink2({
|
|
9854
9938
|
children,
|
|
9855
9939
|
size = "md",
|
|
@@ -9889,7 +9973,7 @@ var BaseLink = React.forwardRef(
|
|
|
9889
9973
|
);
|
|
9890
9974
|
}
|
|
9891
9975
|
);
|
|
9892
|
-
var BaseList =
|
|
9976
|
+
var BaseList = React2.forwardRef(function BaseList2({
|
|
9893
9977
|
ordered = false,
|
|
9894
9978
|
marker = "auto",
|
|
9895
9979
|
spacing = "default",
|
|
@@ -9926,7 +10010,7 @@ var BaseList = React.forwardRef(function BaseList2({
|
|
|
9926
10010
|
};
|
|
9927
10011
|
return ordered ? /* @__PURE__ */ jsxRuntime.jsx("ol", { ...sharedProps, ref }) : /* @__PURE__ */ jsxRuntime.jsx("ul", { ...sharedProps, ref });
|
|
9928
10012
|
});
|
|
9929
|
-
var BaseListItem =
|
|
10013
|
+
var BaseListItem = React2.forwardRef(
|
|
9930
10014
|
function BaseListItem2({
|
|
9931
10015
|
children,
|
|
9932
10016
|
appearance,
|
|
@@ -10061,7 +10145,7 @@ function getOptionText(option) {
|
|
|
10061
10145
|
function toDomId2(value) {
|
|
10062
10146
|
return value.replace(/[^a-zA-Z0-9_-]/g, "-");
|
|
10063
10147
|
}
|
|
10064
|
-
var BaseMultiSelect =
|
|
10148
|
+
var BaseMultiSelect = React2.forwardRef(
|
|
10065
10149
|
function BaseMultiSelect2({
|
|
10066
10150
|
options,
|
|
10067
10151
|
value,
|
|
@@ -10103,46 +10187,46 @@ var BaseMultiSelect = React.forwardRef(
|
|
|
10103
10187
|
const resolvedAppearance = useMonkeysBaseAppearance(appearance);
|
|
10104
10188
|
const componentAttributes = useMonkeysComponentAttributes();
|
|
10105
10189
|
const theme = resolveBaseAppearance(resolvedAppearance);
|
|
10106
|
-
const generatedId =
|
|
10190
|
+
const generatedId = React2.useId();
|
|
10107
10191
|
const multiSelectId = id ?? generatedId;
|
|
10108
10192
|
const controlId = `${multiSelectId}-control`;
|
|
10109
10193
|
const listboxId = `${multiSelectId}-listbox`;
|
|
10110
|
-
const rootRef =
|
|
10111
|
-
const controlRef =
|
|
10112
|
-
const composingRef =
|
|
10113
|
-
const typeaheadBufferRef =
|
|
10114
|
-
const typeaheadTimerRef =
|
|
10194
|
+
const rootRef = React2.useRef(null);
|
|
10195
|
+
const controlRef = React2.useRef(null);
|
|
10196
|
+
const composingRef = React2.useRef(false);
|
|
10197
|
+
const typeaheadBufferRef = React2.useRef("");
|
|
10198
|
+
const typeaheadTimerRef = React2.useRef(null);
|
|
10115
10199
|
const optionList = options ?? [];
|
|
10116
10200
|
const optionIds = optionList.map(
|
|
10117
10201
|
(option, index) => `${multiSelectId}-option-${index}-${toDomId2(option.value)}`
|
|
10118
10202
|
);
|
|
10119
10203
|
const forceOpen = openForPreview;
|
|
10120
|
-
const [uncontrolledOpen, setUncontrolledOpen] =
|
|
10204
|
+
const [uncontrolledOpen, setUncontrolledOpen] = React2.useState(false);
|
|
10121
10205
|
const open = forceOpen || uncontrolledOpen;
|
|
10122
|
-
const initialDefaultValueRef =
|
|
10123
|
-
const [uncontrolledValue, setUncontrolledValue] =
|
|
10206
|
+
const initialDefaultValueRef = React2.useRef(normalizeValues(defaultValue));
|
|
10207
|
+
const [uncontrolledValue, setUncontrolledValue] = React2.useState(() => [
|
|
10124
10208
|
...initialDefaultValueRef.current
|
|
10125
10209
|
]);
|
|
10126
|
-
const [activeIndex, setActiveIndex] =
|
|
10210
|
+
const [activeIndex, setActiveIndex] = React2.useState(
|
|
10127
10211
|
() => getBoundaryEnabledIndex(optionList, "first")
|
|
10128
10212
|
);
|
|
10129
10213
|
const isControlled = value !== void 0;
|
|
10130
|
-
const selectedValues =
|
|
10214
|
+
const selectedValues = React2.useMemo(
|
|
10131
10215
|
() => normalizeValues(isControlled ? value : uncontrolledValue),
|
|
10132
10216
|
[isControlled, uncontrolledValue, value]
|
|
10133
10217
|
);
|
|
10134
|
-
const selectedValueSet =
|
|
10218
|
+
const selectedValueSet = React2.useMemo(
|
|
10135
10219
|
() => new Set(selectedValues),
|
|
10136
10220
|
[selectedValues]
|
|
10137
10221
|
);
|
|
10138
|
-
const optionByValue =
|
|
10222
|
+
const optionByValue = React2.useMemo(() => {
|
|
10139
10223
|
const map = /* @__PURE__ */ new Map();
|
|
10140
10224
|
optionList.forEach((option) => {
|
|
10141
10225
|
if (!map.has(option.value)) map.set(option.value, option);
|
|
10142
10226
|
});
|
|
10143
10227
|
return map;
|
|
10144
10228
|
}, [optionList]);
|
|
10145
|
-
const selectedOptions =
|
|
10229
|
+
const selectedOptions = React2.useMemo(
|
|
10146
10230
|
() => selectedValues.map((selectedValue) => optionByValue.get(selectedValue)).filter(
|
|
10147
10231
|
(option) => option !== void 0
|
|
10148
10232
|
),
|
|
@@ -10272,7 +10356,7 @@ var BaseMultiSelect = React.forwardRef(
|
|
|
10272
10356
|
handleTypeahead(event, event.key);
|
|
10273
10357
|
}
|
|
10274
10358
|
};
|
|
10275
|
-
|
|
10359
|
+
React2.useEffect(() => {
|
|
10276
10360
|
if (!open || forceOpen) return void 0;
|
|
10277
10361
|
const ownerDocument = rootRef.current?.ownerDocument;
|
|
10278
10362
|
if (!ownerDocument) return void 0;
|
|
@@ -10284,7 +10368,7 @@ var BaseMultiSelect = React.forwardRef(
|
|
|
10284
10368
|
ownerDocument.addEventListener("pointerdown", handlePointerDown);
|
|
10285
10369
|
return () => ownerDocument.removeEventListener("pointerdown", handlePointerDown);
|
|
10286
10370
|
}, [forceOpen, open]);
|
|
10287
|
-
|
|
10371
|
+
React2.useEffect(() => {
|
|
10288
10372
|
if (isControlled) return void 0;
|
|
10289
10373
|
const form = rootRef.current?.closest("form");
|
|
10290
10374
|
if (!form) return void 0;
|
|
@@ -10296,7 +10380,7 @@ var BaseMultiSelect = React.forwardRef(
|
|
|
10296
10380
|
form.addEventListener("reset", handleReset);
|
|
10297
10381
|
return () => form.removeEventListener("reset", handleReset);
|
|
10298
10382
|
}, [forceOpen, isControlled, optionList]);
|
|
10299
|
-
|
|
10383
|
+
React2.useEffect(
|
|
10300
10384
|
() => () => {
|
|
10301
10385
|
if (typeaheadTimerRef.current) {
|
|
10302
10386
|
typeaheadTimerRef.current.ownerWindow.clearTimeout(
|
|
@@ -10497,7 +10581,7 @@ var BaseMultiSelect = React.forwardRef(
|
|
|
10497
10581
|
)
|
|
10498
10582
|
}
|
|
10499
10583
|
),
|
|
10500
|
-
name ? selectedValues.map((selectedValue) => /* @__PURE__ */
|
|
10584
|
+
name ? selectedValues.map((selectedValue) => /* @__PURE__ */ React2.createElement(
|
|
10501
10585
|
"input",
|
|
10502
10586
|
{
|
|
10503
10587
|
...componentAttributes,
|
|
@@ -10531,7 +10615,7 @@ var BaseMultiSelect = React.forwardRef(
|
|
|
10531
10615
|
const selected = selectedValueSet.has(option.value);
|
|
10532
10616
|
const active = index === resolvedActiveIndex;
|
|
10533
10617
|
const optionState = option.disabled ? "disabled" : active ? "active" : selected ? "selected" : "idle";
|
|
10534
|
-
return /* @__PURE__ */
|
|
10618
|
+
return /* @__PURE__ */ React2.createElement(
|
|
10535
10619
|
"button",
|
|
10536
10620
|
{
|
|
10537
10621
|
...componentAttributes,
|
|
@@ -10676,7 +10760,7 @@ function validateLabel(name, value) {
|
|
|
10676
10760
|
function isInRange(value, min5, max5) {
|
|
10677
10761
|
return value !== null && (min5 === void 0 || value >= min5) && (max5 === void 0 || value <= max5);
|
|
10678
10762
|
}
|
|
10679
|
-
var BaseNumberInput =
|
|
10763
|
+
var BaseNumberInput = React2.forwardRef(function BaseNumberInput2({
|
|
10680
10764
|
value,
|
|
10681
10765
|
defaultValue = "",
|
|
10682
10766
|
min: min5,
|
|
@@ -10729,7 +10813,7 @@ var BaseNumberInput = React.forwardRef(function BaseNumberInput2({
|
|
|
10729
10813
|
const resolvedDecrementLabel = decrementLabel ?? messages.numberInput.decrement;
|
|
10730
10814
|
validateLabel("incrementLabel", resolvedIncrementLabel);
|
|
10731
10815
|
validateLabel("decrementLabel", resolvedDecrementLabel);
|
|
10732
|
-
const [uncontrolledValue, setUncontrolledValue] =
|
|
10816
|
+
const [uncontrolledValue, setUncontrolledValue] = React2.useState(defaultValue);
|
|
10733
10817
|
const isControlled = value !== void 0;
|
|
10734
10818
|
const rawValue = isControlled ? value : uncontrolledValue;
|
|
10735
10819
|
const parsedValue = parseBaseNumberInputValue(rawValue);
|
|
@@ -11053,7 +11137,7 @@ function validateLabel2(name, value) {
|
|
|
11053
11137
|
throw new TypeError(`BasePasswordInput ${name} must be a non-empty string.`);
|
|
11054
11138
|
}
|
|
11055
11139
|
}
|
|
11056
|
-
var BasePasswordInput =
|
|
11140
|
+
var BasePasswordInput = React2.forwardRef(function BasePasswordInput2({
|
|
11057
11141
|
visible,
|
|
11058
11142
|
defaultVisible = false,
|
|
11059
11143
|
onVisibleChange,
|
|
@@ -11087,8 +11171,8 @@ var BasePasswordInput = React.forwardRef(function BasePasswordInput2({
|
|
|
11087
11171
|
const resolvedHideLabel = hidePasswordLabel ?? messages.passwordInput.hidePassword;
|
|
11088
11172
|
validateLabel2("showPasswordLabel", resolvedShowLabel);
|
|
11089
11173
|
validateLabel2("hidePasswordLabel", resolvedHideLabel);
|
|
11090
|
-
const inputRef =
|
|
11091
|
-
const [uncontrolledVisible, setUncontrolledVisible] =
|
|
11174
|
+
const inputRef = React2.useRef(null);
|
|
11175
|
+
const [uncontrolledVisible, setUncontrolledVisible] = React2.useState(defaultVisible);
|
|
11092
11176
|
const isControlled = visible !== void 0;
|
|
11093
11177
|
const resolvedVisible = isControlled ? visible : uncontrolledVisible;
|
|
11094
11178
|
const resolvedAppearance = useMonkeysBaseAppearance(appearance);
|
|
@@ -11257,7 +11341,7 @@ function getPageItems(currentPage, pageCount, boundaryCount, siblingCount) {
|
|
|
11257
11341
|
});
|
|
11258
11342
|
return items;
|
|
11259
11343
|
}
|
|
11260
|
-
var BasePagination =
|
|
11344
|
+
var BasePagination = React2.forwardRef(
|
|
11261
11345
|
function BasePagination2({
|
|
11262
11346
|
page,
|
|
11263
11347
|
defaultPage,
|
|
@@ -11285,7 +11369,7 @@ var BasePagination = React.forwardRef(
|
|
|
11285
11369
|
const resolvedAppearance = useMonkeysBaseAppearance(appearance);
|
|
11286
11370
|
const componentAttributes = useMonkeysComponentAttributes();
|
|
11287
11371
|
const theme = resolveBaseAppearance(resolvedAppearance);
|
|
11288
|
-
const [uncontrolledPage, setUncontrolledPage] =
|
|
11372
|
+
const [uncontrolledPage, setUncontrolledPage] = React2.useState(
|
|
11289
11373
|
() => defaultPage ?? 1
|
|
11290
11374
|
);
|
|
11291
11375
|
if (page !== void 0) assertPositiveInteger(page, "page");
|
|
@@ -11481,7 +11565,7 @@ var BasePagination = React.forwardRef(
|
|
|
11481
11565
|
function clamp2(value, min5, max5) {
|
|
11482
11566
|
return Math.min(Math.max(value, min5), max5);
|
|
11483
11567
|
}
|
|
11484
|
-
var BaseProgress =
|
|
11568
|
+
var BaseProgress = React2.forwardRef(
|
|
11485
11569
|
function BaseProgress2({
|
|
11486
11570
|
value = 0,
|
|
11487
11571
|
max: max5 = 100,
|
|
@@ -11496,7 +11580,7 @@ var BaseProgress = React.forwardRef(
|
|
|
11496
11580
|
"aria-labelledby": nativeAriaLabelledBy,
|
|
11497
11581
|
...progressProps
|
|
11498
11582
|
}, ref) {
|
|
11499
|
-
const generatedLabelId = `${
|
|
11583
|
+
const generatedLabelId = `${React2.useId()}-label`;
|
|
11500
11584
|
if (typeof max5 !== "number" || !Number.isFinite(max5) || max5 <= 0) {
|
|
11501
11585
|
throw new TypeError("BaseProgress max must be a positive finite number.");
|
|
11502
11586
|
}
|
|
@@ -11610,7 +11694,7 @@ var indicatorSizeClassNames2 = {
|
|
|
11610
11694
|
md: "h-2 w-2",
|
|
11611
11695
|
lg: "h-2.5 w-2.5"
|
|
11612
11696
|
};
|
|
11613
|
-
var BaseRadioGroup =
|
|
11697
|
+
var BaseRadioGroup = React2.forwardRef(function BaseRadioGroup2({
|
|
11614
11698
|
options = [],
|
|
11615
11699
|
value,
|
|
11616
11700
|
defaultValue,
|
|
@@ -11682,10 +11766,10 @@ var BaseRadioGroup = React.forwardRef(function BaseRadioGroup2({
|
|
|
11682
11766
|
const resolvedAppearance = useMonkeysBaseAppearance(appearance);
|
|
11683
11767
|
const componentAttributes = useMonkeysComponentAttributes();
|
|
11684
11768
|
const theme = resolveBaseAppearance(resolvedAppearance);
|
|
11685
|
-
const generatedId =
|
|
11769
|
+
const generatedId = React2.useId();
|
|
11686
11770
|
const rootId = id ?? generatedId;
|
|
11687
11771
|
const resolvedName = name ?? rootId;
|
|
11688
|
-
const [uncontrolledValue, setUncontrolledValue] =
|
|
11772
|
+
const [uncontrolledValue, setUncontrolledValue] = React2.useState(defaultValue);
|
|
11689
11773
|
const isControlled = value !== void 0;
|
|
11690
11774
|
const selectedValue = isControlled ? value : uncontrolledValue;
|
|
11691
11775
|
const handleSelect = (event, optionDisabled) => {
|
|
@@ -11861,7 +11945,7 @@ function resolveOverflow(axis) {
|
|
|
11861
11945
|
}
|
|
11862
11946
|
throw new TypeError('BaseScrollArea axis must be "x", "y", or "both".');
|
|
11863
11947
|
}
|
|
11864
|
-
var BaseScrollArea =
|
|
11948
|
+
var BaseScrollArea = React2.forwardRef(
|
|
11865
11949
|
function BaseScrollArea2({
|
|
11866
11950
|
children,
|
|
11867
11951
|
axis = "y",
|
|
@@ -12005,7 +12089,7 @@ function getOptionText2(option) {
|
|
|
12005
12089
|
function toDomId4(value) {
|
|
12006
12090
|
return value.replace(/[^a-zA-Z0-9_-]/g, "-");
|
|
12007
12091
|
}
|
|
12008
|
-
var BaseSelect =
|
|
12092
|
+
var BaseSelect = React2.forwardRef(
|
|
12009
12093
|
function BaseSelect2({
|
|
12010
12094
|
options,
|
|
12011
12095
|
placeholder,
|
|
@@ -12049,29 +12133,29 @@ var BaseSelect = React.forwardRef(
|
|
|
12049
12133
|
const theme = resolveBaseAppearance(resolvedAppearance);
|
|
12050
12134
|
const fieldControl = useBaseFieldControl();
|
|
12051
12135
|
const resolvedInvalid = invalid || fieldControl.invalid;
|
|
12052
|
-
const generatedId =
|
|
12136
|
+
const generatedId = React2.useId();
|
|
12053
12137
|
const selectId = id ?? generatedId;
|
|
12054
12138
|
const triggerId = `${selectId}-button`;
|
|
12055
12139
|
const listboxId = `${selectId}-listbox`;
|
|
12056
|
-
const rootRef =
|
|
12057
|
-
const triggerRef =
|
|
12058
|
-
const selectRef =
|
|
12059
|
-
const optionRefs =
|
|
12060
|
-
const composingRef =
|
|
12061
|
-
const typeaheadBufferRef =
|
|
12062
|
-
const typeaheadTimerRef =
|
|
12140
|
+
const rootRef = React2.useRef(null);
|
|
12141
|
+
const triggerRef = React2.useRef(null);
|
|
12142
|
+
const selectRef = React2.useRef(null);
|
|
12143
|
+
const optionRefs = React2.useRef([]);
|
|
12144
|
+
const composingRef = React2.useRef(false);
|
|
12145
|
+
const typeaheadBufferRef = React2.useRef("");
|
|
12146
|
+
const typeaheadTimerRef = React2.useRef(null);
|
|
12063
12147
|
const optionList = options ?? [];
|
|
12064
12148
|
const isCustomSelect = optionList.length > 0;
|
|
12065
12149
|
const forceOpen = openForPreview;
|
|
12066
|
-
const [uncontrolledOpen, setUncontrolledOpen] =
|
|
12150
|
+
const [uncontrolledOpen, setUncontrolledOpen] = React2.useState(false);
|
|
12067
12151
|
const open = forceOpen || uncontrolledOpen;
|
|
12068
|
-
const [uncontrolledValue, setUncontrolledValue] =
|
|
12152
|
+
const [uncontrolledValue, setUncontrolledValue] = React2.useState(
|
|
12069
12153
|
() => normalizeValue(defaultValue)
|
|
12070
12154
|
);
|
|
12071
12155
|
const isControlled = value !== void 0;
|
|
12072
12156
|
const selectedValue = isControlled ? normalizeValue(value) : uncontrolledValue;
|
|
12073
12157
|
const selectedOption = findOption(optionList, selectedValue);
|
|
12074
|
-
const [activeIndex, setActiveIndex] =
|
|
12158
|
+
const [activeIndex, setActiveIndex] = React2.useState(
|
|
12075
12159
|
() => getInitialActiveIndex(optionList, selectedValue)
|
|
12076
12160
|
);
|
|
12077
12161
|
const resolvedActiveIndex = activeIndex >= 0 && !optionList[activeIndex]?.disabled ? activeIndex : getInitialActiveIndex(optionList, selectedValue);
|
|
@@ -12243,7 +12327,7 @@ var BaseSelect = React.forwardRef(
|
|
|
12243
12327
|
event.preventDefault();
|
|
12244
12328
|
triggerRef.current?.focus();
|
|
12245
12329
|
};
|
|
12246
|
-
|
|
12330
|
+
React2.useEffect(() => {
|
|
12247
12331
|
if (!isCustomSelect || !open || forceOpen) return void 0;
|
|
12248
12332
|
const ownerDocument = rootRef.current?.ownerDocument;
|
|
12249
12333
|
if (!ownerDocument) return void 0;
|
|
@@ -12257,13 +12341,13 @@ var BaseSelect = React.forwardRef(
|
|
|
12257
12341
|
ownerDocument.removeEventListener("pointerdown", handlePointerDown);
|
|
12258
12342
|
};
|
|
12259
12343
|
}, [forceOpen, isCustomSelect, open, optionList, selectedValue]);
|
|
12260
|
-
|
|
12344
|
+
React2.useEffect(() => {
|
|
12261
12345
|
if (!isCustomSelect || !open || resolvedActiveIndex < 0) return;
|
|
12262
12346
|
optionRefs.current[resolvedActiveIndex]?.scrollIntoView?.({
|
|
12263
12347
|
block: "nearest"
|
|
12264
12348
|
});
|
|
12265
12349
|
}, [isCustomSelect, open, resolvedActiveIndex]);
|
|
12266
|
-
|
|
12350
|
+
React2.useEffect(() => {
|
|
12267
12351
|
if (!isCustomSelect || isControlled) return void 0;
|
|
12268
12352
|
const selectElement = selectRef.current;
|
|
12269
12353
|
const form = selectElement?.form;
|
|
@@ -12280,7 +12364,7 @@ var BaseSelect = React.forwardRef(
|
|
|
12280
12364
|
form.addEventListener("reset", handleReset);
|
|
12281
12365
|
return () => form.removeEventListener("reset", handleReset);
|
|
12282
12366
|
}, [defaultValue, forceOpen, isControlled, isCustomSelect, optionList]);
|
|
12283
|
-
|
|
12367
|
+
React2.useEffect(
|
|
12284
12368
|
() => () => {
|
|
12285
12369
|
if (typeaheadTimerRef.current) {
|
|
12286
12370
|
typeaheadTimerRef.current.ownerWindow.clearTimeout(
|
|
@@ -12506,7 +12590,7 @@ var BaseSelect = React.forwardRef(
|
|
|
12506
12590
|
const selected = option.value === selectedValue;
|
|
12507
12591
|
const active = index === resolvedActiveIndex;
|
|
12508
12592
|
const optionState = option.disabled ? "disabled" : active ? "active" : selected ? "selected" : "idle";
|
|
12509
|
-
return /* @__PURE__ */
|
|
12593
|
+
return /* @__PURE__ */ React2.createElement(
|
|
12510
12594
|
"button",
|
|
12511
12595
|
{
|
|
12512
12596
|
...componentAttributes,
|
|
@@ -12631,7 +12715,7 @@ function BaseSegmentedControl({
|
|
|
12631
12715
|
...controlProps
|
|
12632
12716
|
}) {
|
|
12633
12717
|
const theme = resolveBaseAppearance(appearance);
|
|
12634
|
-
const [uncontrolledValue, setUncontrolledValue] =
|
|
12718
|
+
const [uncontrolledValue, setUncontrolledValue] = React2.useState(
|
|
12635
12719
|
() => getInitialSegmentValue(options, defaultValue)
|
|
12636
12720
|
);
|
|
12637
12721
|
const isControlled = value !== void 0;
|
|
@@ -12710,7 +12794,7 @@ var variantClassNames = {
|
|
|
12710
12794
|
block: "h-24 w-full",
|
|
12711
12795
|
circle: "aspect-square h-10 rounded-full"
|
|
12712
12796
|
};
|
|
12713
|
-
var BaseSkeleton =
|
|
12797
|
+
var BaseSkeleton = React2.forwardRef(
|
|
12714
12798
|
function BaseSkeleton2({
|
|
12715
12799
|
variant = "line",
|
|
12716
12800
|
animated = true,
|
|
@@ -12758,7 +12842,7 @@ var BaseSkeleton = React.forwardRef(
|
|
|
12758
12842
|
);
|
|
12759
12843
|
}
|
|
12760
12844
|
);
|
|
12761
|
-
var BaseSpinner =
|
|
12845
|
+
var BaseSpinner = React2.forwardRef(
|
|
12762
12846
|
function BaseSpinner2({
|
|
12763
12847
|
decorative = false,
|
|
12764
12848
|
label,
|
|
@@ -12814,7 +12898,7 @@ var BaseSpinner = React.forwardRef(
|
|
|
12814
12898
|
);
|
|
12815
12899
|
}
|
|
12816
12900
|
);
|
|
12817
|
-
var BaseStack =
|
|
12901
|
+
var BaseStack = React2.forwardRef(
|
|
12818
12902
|
function BaseStack2({
|
|
12819
12903
|
children,
|
|
12820
12904
|
gap,
|
|
@@ -12994,7 +13078,7 @@ function getIndicatorClassName(status, slots) {
|
|
|
12994
13078
|
status === "error" && slots.stepsIndicatorError
|
|
12995
13079
|
);
|
|
12996
13080
|
}
|
|
12997
|
-
var BaseSteps =
|
|
13081
|
+
var BaseSteps = React2.forwardRef(
|
|
12998
13082
|
function BaseSteps2({
|
|
12999
13083
|
items,
|
|
13000
13084
|
orientation = "horizontal",
|
|
@@ -13008,7 +13092,7 @@ var BaseSteps = React.forwardRef(
|
|
|
13008
13092
|
"aria-labelledby": ariaLabelledBy,
|
|
13009
13093
|
...stepsProps
|
|
13010
13094
|
}, ref) {
|
|
13011
|
-
const generatedId =
|
|
13095
|
+
const generatedId = React2.useId();
|
|
13012
13096
|
const messages = useMonkeysLocaleMessages().steps;
|
|
13013
13097
|
const resolvedAppearance = useMonkeysBaseAppearance(appearance);
|
|
13014
13098
|
const componentAttributes = useMonkeysComponentAttributes();
|
|
@@ -13219,7 +13303,7 @@ var densitySize = {
|
|
|
13219
13303
|
default: "md",
|
|
13220
13304
|
comfortable: "lg"
|
|
13221
13305
|
};
|
|
13222
|
-
var BaseSwitch =
|
|
13306
|
+
var BaseSwitch = React2.forwardRef(
|
|
13223
13307
|
function BaseSwitch2({
|
|
13224
13308
|
label,
|
|
13225
13309
|
description,
|
|
@@ -13247,7 +13331,7 @@ var BaseSwitch = React.forwardRef(
|
|
|
13247
13331
|
const theme = resolveBaseAppearance(resolvedAppearance);
|
|
13248
13332
|
const hasLabel = hasRenderableNode(label);
|
|
13249
13333
|
const hasDescription = hasNonEmptyRenderableNode(description);
|
|
13250
|
-
const [uncontrolledChecked, setUncontrolledChecked] =
|
|
13334
|
+
const [uncontrolledChecked, setUncontrolledChecked] = React2.useState(
|
|
13251
13335
|
defaultChecked ?? false
|
|
13252
13336
|
);
|
|
13253
13337
|
const isControlled = checked !== void 0;
|
|
@@ -13540,9 +13624,9 @@ function setPointerCaptureIfAvailable2(target, pointerId) {
|
|
|
13540
13624
|
throw error;
|
|
13541
13625
|
}
|
|
13542
13626
|
}
|
|
13543
|
-
var BaseTableContext =
|
|
13627
|
+
var BaseTableContext = React2.createContext(null);
|
|
13544
13628
|
function useBaseTableContext(appearance) {
|
|
13545
|
-
const context =
|
|
13629
|
+
const context = React2.useContext(BaseTableContext);
|
|
13546
13630
|
const providerAppearance = useMonkeysBaseAppearance(appearance);
|
|
13547
13631
|
if (context) {
|
|
13548
13632
|
const resolvedAppearance = appearance === void 0 ? context.appearance : providerAppearance;
|
|
@@ -13563,8 +13647,8 @@ function useBaseTableContext(appearance) {
|
|
|
13563
13647
|
}
|
|
13564
13648
|
function hasSplitScrollTable(children) {
|
|
13565
13649
|
let found = false;
|
|
13566
|
-
|
|
13567
|
-
if (found || !
|
|
13650
|
+
React2.Children.forEach(children, (child) => {
|
|
13651
|
+
if (found || !React2.isValidElement(child)) return;
|
|
13568
13652
|
const childProps = child.props;
|
|
13569
13653
|
if (childProps.layout === "split-scroll") {
|
|
13570
13654
|
found = true;
|
|
@@ -13727,7 +13811,7 @@ function DragHandleIcon() {
|
|
|
13727
13811
|
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "h-0.5 w-0.5 rounded-full bg-current" })
|
|
13728
13812
|
] });
|
|
13729
13813
|
}
|
|
13730
|
-
var BaseTableContainer =
|
|
13814
|
+
var BaseTableContainer = React2.forwardRef(function BaseTableContainer2({
|
|
13731
13815
|
appearance,
|
|
13732
13816
|
attachedFooter = false,
|
|
13733
13817
|
children,
|
|
@@ -13771,7 +13855,7 @@ var BaseTableContainer = React.forwardRef(function BaseTableContainer2({
|
|
|
13771
13855
|
}
|
|
13772
13856
|
);
|
|
13773
13857
|
});
|
|
13774
|
-
var BaseTable =
|
|
13858
|
+
var BaseTable = React2.forwardRef(
|
|
13775
13859
|
function BaseTable2({
|
|
13776
13860
|
appearance,
|
|
13777
13861
|
className,
|
|
@@ -13801,9 +13885,9 @@ var BaseTable = React.forwardRef(
|
|
|
13801
13885
|
const resolvedAppearance = useMonkeysBaseAppearance(appearance);
|
|
13802
13886
|
const componentAttributes = useMonkeysComponentAttributes();
|
|
13803
13887
|
const theme = resolveBaseAppearance(resolvedAppearance);
|
|
13804
|
-
const [draggingColumnId, setDraggingColumnId] =
|
|
13805
|
-
const splitHeaderRef =
|
|
13806
|
-
const splitFooterRef =
|
|
13888
|
+
const [draggingColumnId, setDraggingColumnId] = React2.useState();
|
|
13889
|
+
const splitHeaderRef = React2.useRef(null);
|
|
13890
|
+
const splitFooterRef = React2.useRef(null);
|
|
13807
13891
|
const isSplitScroll = layout === "split-scroll";
|
|
13808
13892
|
const columnTemplate = isSplitScroll ? buildSplitColumnTemplate(columns, columnSizes) : void 0;
|
|
13809
13893
|
const contextValue = {
|
|
@@ -13851,7 +13935,7 @@ var BaseTable = React.forwardRef(
|
|
|
13851
13935
|
) });
|
|
13852
13936
|
}
|
|
13853
13937
|
);
|
|
13854
|
-
var BaseTableHeader =
|
|
13938
|
+
var BaseTableHeader = React2.forwardRef(function BaseTableHeader2({ appearance, className, classNames, style, ...headerProps }, ref) {
|
|
13855
13939
|
const { layout, splitHeaderRef, theme } = useBaseTableContext(appearance);
|
|
13856
13940
|
const isSplitScroll = layout === "split-scroll";
|
|
13857
13941
|
const setHeaderRef = (node) => {
|
|
@@ -13878,7 +13962,7 @@ var BaseTableHeader = React.forwardRef(function BaseTableHeader2({ appearance, c
|
|
|
13878
13962
|
}
|
|
13879
13963
|
);
|
|
13880
13964
|
});
|
|
13881
|
-
var BaseTableBody =
|
|
13965
|
+
var BaseTableBody = React2.forwardRef(function BaseTableBody2({ appearance, className, classNames, onScroll, style, ...bodyProps }, ref) {
|
|
13882
13966
|
const {
|
|
13883
13967
|
bodyClassName,
|
|
13884
13968
|
bodyMaxHeight,
|
|
@@ -13921,7 +14005,7 @@ var BaseTableBody = React.forwardRef(function BaseTableBody2({ appearance, class
|
|
|
13921
14005
|
}
|
|
13922
14006
|
);
|
|
13923
14007
|
});
|
|
13924
|
-
var BaseTableFooter =
|
|
14008
|
+
var BaseTableFooter = React2.forwardRef(function BaseTableFooter2({ appearance, className, classNames, style, ...footerProps }, ref) {
|
|
13925
14009
|
const { layout, splitFooterRef, theme } = useBaseTableContext(appearance);
|
|
13926
14010
|
const isSplitScroll = layout === "split-scroll";
|
|
13927
14011
|
const setFooterRef = (node) => {
|
|
@@ -13948,7 +14032,7 @@ var BaseTableFooter = React.forwardRef(function BaseTableFooter2({ appearance, c
|
|
|
13948
14032
|
}
|
|
13949
14033
|
);
|
|
13950
14034
|
});
|
|
13951
|
-
var BaseTableRow =
|
|
14035
|
+
var BaseTableRow = React2.forwardRef(
|
|
13952
14036
|
function BaseTableRow2({
|
|
13953
14037
|
interactive,
|
|
13954
14038
|
selected,
|
|
@@ -13990,7 +14074,7 @@ var BaseTableRow = React.forwardRef(
|
|
|
13990
14074
|
);
|
|
13991
14075
|
}
|
|
13992
14076
|
);
|
|
13993
|
-
var BaseTableHead =
|
|
14077
|
+
var BaseTableHead = React2.forwardRef(function BaseTableHead2({
|
|
13994
14078
|
columnId,
|
|
13995
14079
|
align,
|
|
13996
14080
|
verticalAlign,
|
|
@@ -14055,10 +14139,10 @@ var BaseTableHead = React.forwardRef(function BaseTableHead2({
|
|
|
14055
14139
|
const isSplitScroll = tableContext.layout === "split-scroll";
|
|
14056
14140
|
const resolvedAlign = align ?? (isSplitScroll ? "center" : "left");
|
|
14057
14141
|
const resolvedVerticalAlign = verticalAlign ?? "middle";
|
|
14058
|
-
const headRef =
|
|
14059
|
-
const resizeCleanupRef =
|
|
14142
|
+
const headRef = React2.useRef(null);
|
|
14143
|
+
const resizeCleanupRef = React2.useRef(() => {
|
|
14060
14144
|
});
|
|
14061
|
-
const [measuredWidth, setMeasuredWidth] =
|
|
14145
|
+
const [measuredWidth, setMeasuredWidth] = React2.useState();
|
|
14062
14146
|
const setHeadRef = (node) => {
|
|
14063
14147
|
headRef.current = node;
|
|
14064
14148
|
assignRef2(forwardedRef, node);
|
|
@@ -14297,7 +14381,7 @@ var BaseTableHead = React.forwardRef(function BaseTableHead2({
|
|
|
14297
14381
|
}
|
|
14298
14382
|
);
|
|
14299
14383
|
};
|
|
14300
|
-
|
|
14384
|
+
React2.useEffect(() => {
|
|
14301
14385
|
if (typeof controlledWidth === "number") {
|
|
14302
14386
|
setMeasuredWidth(void 0);
|
|
14303
14387
|
return;
|
|
@@ -14310,7 +14394,7 @@ var BaseTableHead = React.forwardRef(function BaseTableHead2({
|
|
|
14310
14394
|
);
|
|
14311
14395
|
}
|
|
14312
14396
|
}, [controlledWidth, minWidth, maxWidth, canResize]);
|
|
14313
|
-
|
|
14397
|
+
React2.useEffect(() => {
|
|
14314
14398
|
if (!canResize) resizeCleanupRef.current();
|
|
14315
14399
|
return () => resizeCleanupRef.current();
|
|
14316
14400
|
}, [canResize, columnId, tableContext.onColumnSizeChange]);
|
|
@@ -14369,7 +14453,7 @@ var BaseTableHead = React.forwardRef(function BaseTableHead2({
|
|
|
14369
14453
|
}
|
|
14370
14454
|
);
|
|
14371
14455
|
});
|
|
14372
|
-
var BaseTableCell =
|
|
14456
|
+
var BaseTableCell = React2.forwardRef(
|
|
14373
14457
|
function BaseTableCell2({
|
|
14374
14458
|
align = "left",
|
|
14375
14459
|
appearance,
|
|
@@ -14404,7 +14488,7 @@ var BaseTableCell = React.forwardRef(
|
|
|
14404
14488
|
);
|
|
14405
14489
|
}
|
|
14406
14490
|
);
|
|
14407
|
-
var BaseTableCaption =
|
|
14491
|
+
var BaseTableCaption = React2.forwardRef(function BaseTableCaption2({ appearance, className, classNames, style, ...captionProps }, ref) {
|
|
14408
14492
|
const { theme } = useBaseTableContext(appearance);
|
|
14409
14493
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
14410
14494
|
"caption",
|
|
@@ -14420,7 +14504,7 @@ var BaseTableCaption = React.forwardRef(function BaseTableCaption2({ appearance,
|
|
|
14420
14504
|
}
|
|
14421
14505
|
);
|
|
14422
14506
|
});
|
|
14423
|
-
var BaseTableEmpty =
|
|
14507
|
+
var BaseTableEmpty = React2.forwardRef(
|
|
14424
14508
|
function BaseTableEmpty2({
|
|
14425
14509
|
colSpan,
|
|
14426
14510
|
icon,
|
|
@@ -14572,7 +14656,7 @@ function BaseTableLoading({
|
|
|
14572
14656
|
rowIndex
|
|
14573
14657
|
)) });
|
|
14574
14658
|
}
|
|
14575
|
-
var BaseTableFooterBar =
|
|
14659
|
+
var BaseTableFooterBar = React2.forwardRef(function BaseTableFooterBar2({
|
|
14576
14660
|
appearance,
|
|
14577
14661
|
leading,
|
|
14578
14662
|
actions,
|
|
@@ -14697,7 +14781,7 @@ function getHorizontalStep(event, key) {
|
|
|
14697
14781
|
if (key === "ArrowRight") return rtl ? -1 : 1;
|
|
14698
14782
|
return rtl ? 1 : -1;
|
|
14699
14783
|
}
|
|
14700
|
-
var BaseTabs =
|
|
14784
|
+
var BaseTabs = React2.forwardRef(
|
|
14701
14785
|
function BaseTabs2({
|
|
14702
14786
|
items = [],
|
|
14703
14787
|
value,
|
|
@@ -14724,16 +14808,16 @@ var BaseTabs = React.forwardRef(
|
|
|
14724
14808
|
const resolvedAppearance = useMonkeysBaseAppearance(appearance);
|
|
14725
14809
|
const componentAttributes = useMonkeysComponentAttributes();
|
|
14726
14810
|
const theme = resolveBaseAppearance(resolvedAppearance);
|
|
14727
|
-
const generatedId =
|
|
14811
|
+
const generatedId = React2.useId();
|
|
14728
14812
|
const rootId = id ?? generatedId;
|
|
14729
14813
|
const initialCandidate = value !== void 0 ? value : defaultValue;
|
|
14730
|
-
const [uncontrolledValue, setUncontrolledValue] =
|
|
14814
|
+
const [uncontrolledValue, setUncontrolledValue] = React2.useState(
|
|
14731
14815
|
() => getResolvedValue(items, defaultValue)
|
|
14732
14816
|
);
|
|
14733
|
-
const [focusedValue, setFocusedValue] =
|
|
14817
|
+
const [focusedValue, setFocusedValue] = React2.useState(
|
|
14734
14818
|
() => getResolvedValue(items, initialCandidate)
|
|
14735
14819
|
);
|
|
14736
|
-
const triggerRefs =
|
|
14820
|
+
const triggerRefs = React2.useRef([]);
|
|
14737
14821
|
const isControlled = value !== void 0;
|
|
14738
14822
|
const selectedValue = getResolvedValue(
|
|
14739
14823
|
items,
|
|
@@ -14839,7 +14923,7 @@ var BaseTabs = React.forwardRef(
|
|
|
14839
14923
|
const itemId = idFragments[index];
|
|
14840
14924
|
const selected = index === selectedIndex;
|
|
14841
14925
|
const state = item.disabled ? "disabled" : selected ? "active" : "inactive";
|
|
14842
|
-
return /* @__PURE__ */
|
|
14926
|
+
return /* @__PURE__ */ React2.createElement(
|
|
14843
14927
|
"button",
|
|
14844
14928
|
{
|
|
14845
14929
|
...componentAttributes,
|
|
@@ -14909,7 +14993,7 @@ var controlSizeClassNames2 = {
|
|
|
14909
14993
|
md: "min-h-24 px-3 py-2 text-sm leading-6",
|
|
14910
14994
|
lg: "min-h-28 px-3.5 py-2.5 text-base leading-7"
|
|
14911
14995
|
};
|
|
14912
|
-
var BaseTextarea =
|
|
14996
|
+
var BaseTextarea = React2.forwardRef(
|
|
14913
14997
|
function BaseTextarea2({
|
|
14914
14998
|
invalid = false,
|
|
14915
14999
|
disabled = false,
|
|
@@ -14987,7 +15071,7 @@ var BaseTextarea = React.forwardRef(
|
|
|
14987
15071
|
);
|
|
14988
15072
|
}
|
|
14989
15073
|
);
|
|
14990
|
-
var BaseText =
|
|
15074
|
+
var BaseText = React2.forwardRef(function BaseText2({
|
|
14991
15075
|
as = "p",
|
|
14992
15076
|
children,
|
|
14993
15077
|
size = "md",
|
|
@@ -15001,7 +15085,7 @@ var BaseText = React.forwardRef(function BaseText2({
|
|
|
15001
15085
|
const resolvedAppearance = useMonkeysBaseAppearance(appearance);
|
|
15002
15086
|
const componentAttributes = useMonkeysComponentAttributes();
|
|
15003
15087
|
const theme = resolveBaseAppearance(resolvedAppearance);
|
|
15004
|
-
return
|
|
15088
|
+
return React2.createElement(
|
|
15005
15089
|
as,
|
|
15006
15090
|
{
|
|
15007
15091
|
...componentAttributes,
|
|
@@ -15039,12 +15123,12 @@ function validatePlacement2(value) {
|
|
|
15039
15123
|
}
|
|
15040
15124
|
}
|
|
15041
15125
|
function normalizeTrigger(children, disabled) {
|
|
15042
|
-
if (
|
|
15126
|
+
if (React2.isValidElement(children) && children.type !== React2.Fragment) {
|
|
15043
15127
|
return children;
|
|
15044
15128
|
}
|
|
15045
15129
|
return /* @__PURE__ */ jsxRuntime.jsx("span", { tabIndex: !disabled && hasRenderableNode(children) ? 0 : void 0, children });
|
|
15046
15130
|
}
|
|
15047
|
-
var BaseTooltip =
|
|
15131
|
+
var BaseTooltip = React2.forwardRef(
|
|
15048
15132
|
function BaseTooltip2({
|
|
15049
15133
|
content,
|
|
15050
15134
|
children,
|
|
@@ -15069,7 +15153,7 @@ var BaseTooltip = React.forwardRef(
|
|
|
15069
15153
|
const componentAttributes = useMonkeysComponentAttributes();
|
|
15070
15154
|
const theme = resolveBaseAppearance(resolvedAppearance);
|
|
15071
15155
|
const overlayPortal = useBaseOverlayPortal({ disabled: !portal });
|
|
15072
|
-
const [uncontrolledOpen, setUncontrolledOpen] =
|
|
15156
|
+
const [uncontrolledOpen, setUncontrolledOpen] = React2.useState(defaultOpen);
|
|
15073
15157
|
const isControlled = open !== void 0;
|
|
15074
15158
|
const canShow = !disabled && hasRenderableNode(content);
|
|
15075
15159
|
const requestedOpen = isControlled ? open : uncontrolledOpen;
|
|
@@ -15210,7 +15294,7 @@ function BaseToolbar({
|
|
|
15210
15294
|
}
|
|
15211
15295
|
);
|
|
15212
15296
|
}
|
|
15213
|
-
var BaseVisuallyHidden =
|
|
15297
|
+
var BaseVisuallyHidden = React2.forwardRef(function BaseVisuallyHidden2({
|
|
15214
15298
|
children,
|
|
15215
15299
|
focusable = false,
|
|
15216
15300
|
appearance,
|
|
@@ -15269,7 +15353,7 @@ var footerTokenStyles = {
|
|
|
15269
15353
|
background: "var(--monkeys-component-app-shell-sidebar-footer-background, hsl(var(--muted) / 0.22))",
|
|
15270
15354
|
borderColor: "var(--monkeys-component-app-shell-sidebar-footer-border-color, hsl(var(--border)))"
|
|
15271
15355
|
};
|
|
15272
|
-
var AppShellSidebar =
|
|
15356
|
+
var AppShellSidebar = React2.forwardRef(
|
|
15273
15357
|
function AppShellSidebar2({
|
|
15274
15358
|
navigation,
|
|
15275
15359
|
header,
|
|
@@ -15881,15 +15965,15 @@ function SidebarNavList({
|
|
|
15881
15965
|
onNavigate,
|
|
15882
15966
|
defaultExpandedGroups
|
|
15883
15967
|
}) {
|
|
15884
|
-
const [expanded, setExpanded] =
|
|
15968
|
+
const [expanded, setExpanded] = React2.useState(() => {
|
|
15885
15969
|
const map = {};
|
|
15886
15970
|
(defaultExpandedGroups ?? items.map((i) => i.id)).forEach((id) => {
|
|
15887
15971
|
map[id] = true;
|
|
15888
15972
|
});
|
|
15889
15973
|
return map;
|
|
15890
15974
|
});
|
|
15891
|
-
const [localActiveItemId, setLocalActiveItemId] =
|
|
15892
|
-
|
|
15975
|
+
const [localActiveItemId, setLocalActiveItemId] = React2.useState(activeItemId);
|
|
15976
|
+
React2.useEffect(() => {
|
|
15893
15977
|
if (activeItemId !== void 0) {
|
|
15894
15978
|
setLocalActiveItemId(activeItemId);
|
|
15895
15979
|
}
|
|
@@ -16196,8 +16280,8 @@ function SidebarNavigationList({
|
|
|
16196
16280
|
onNavigate,
|
|
16197
16281
|
revealRequest
|
|
16198
16282
|
}) {
|
|
16199
|
-
const navRef =
|
|
16200
|
-
const [expandedByRoot, setExpandedByRoot] =
|
|
16283
|
+
const navRef = React2.useRef(null);
|
|
16284
|
+
const [expandedByRoot, setExpandedByRoot] = React2.useState(
|
|
16201
16285
|
{}
|
|
16202
16286
|
);
|
|
16203
16287
|
const toggleRoot = (id) => {
|
|
@@ -16206,7 +16290,7 @@ function SidebarNavigationList({
|
|
|
16206
16290
|
[id]: !current[id]
|
|
16207
16291
|
}));
|
|
16208
16292
|
};
|
|
16209
|
-
|
|
16293
|
+
React2.useEffect(() => {
|
|
16210
16294
|
if (!revealRequest) return;
|
|
16211
16295
|
setExpandedByRoot((current) => ({
|
|
16212
16296
|
...current,
|
|
@@ -16478,8 +16562,8 @@ function HeadbarNavMenuItem({
|
|
|
16478
16562
|
onNavigate,
|
|
16479
16563
|
useTokenRadius
|
|
16480
16564
|
}) {
|
|
16481
|
-
const [open, setOpen] =
|
|
16482
|
-
const closeTimerRef =
|
|
16565
|
+
const [open, setOpen] = React2.useState(false);
|
|
16566
|
+
const closeTimerRef = React2.useRef(null);
|
|
16483
16567
|
const clearCloseTimer = () => {
|
|
16484
16568
|
if (!closeTimerRef.current) return;
|
|
16485
16569
|
clearTimeout(closeTimerRef.current);
|
|
@@ -16496,7 +16580,7 @@ function HeadbarNavMenuItem({
|
|
|
16496
16580
|
closeTimerRef.current = null;
|
|
16497
16581
|
}, 120);
|
|
16498
16582
|
};
|
|
16499
|
-
|
|
16583
|
+
React2.useEffect(() => clearCloseTimer, []);
|
|
16500
16584
|
return /* @__PURE__ */ jsxRuntime.jsxs(DropdownMenu2__namespace.Root, { modal: false, open, onOpenChange: setOpen, children: [
|
|
16501
16585
|
/* @__PURE__ */ jsxRuntime.jsx(DropdownMenu2__namespace.Trigger, { asChild: true, children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
16502
16586
|
BaseButton,
|
|
@@ -16752,21 +16836,21 @@ function NavigationLayout({
|
|
|
16752
16836
|
switchToHeadbarLabel = "Switch to headbar",
|
|
16753
16837
|
switchToSidebarLabel = "Switch to sidebar"
|
|
16754
16838
|
}) {
|
|
16755
|
-
const [uncontrolledMode, setUncontrolledMode] =
|
|
16756
|
-
const [uncontrolledSidebarCollapsed, setUncontrolledSidebarCollapsed] =
|
|
16757
|
-
const [revealRequest, setRevealRequest] =
|
|
16839
|
+
const [uncontrolledMode, setUncontrolledMode] = React2.useState(defaultMode);
|
|
16840
|
+
const [uncontrolledSidebarCollapsed, setUncontrolledSidebarCollapsed] = React2.useState(defaultSidebarCollapsed);
|
|
16841
|
+
const [revealRequest, setRevealRequest] = React2.useState(null);
|
|
16758
16842
|
const isModeControlled = mode !== void 0;
|
|
16759
16843
|
const isSidebarCollapsedControlled = controlledSidebarCollapsed !== void 0;
|
|
16760
16844
|
const navigationMode = isModeControlled ? mode : uncontrolledMode;
|
|
16761
16845
|
const sidebarCollapsed = isSidebarCollapsedControlled ? controlledSidebarCollapsed : uncontrolledSidebarCollapsed;
|
|
16762
16846
|
const isHeadbarMode = navigationMode === "headbar";
|
|
16763
16847
|
const sidebarWidth = sidebarCollapsed ? collapsedSidebarWidth : expandedSidebarWidth;
|
|
16764
|
-
|
|
16848
|
+
React2.useEffect(() => {
|
|
16765
16849
|
if (!isModeControlled) {
|
|
16766
16850
|
setUncontrolledMode(defaultMode);
|
|
16767
16851
|
}
|
|
16768
16852
|
}, [defaultMode, isModeControlled]);
|
|
16769
|
-
|
|
16853
|
+
React2.useEffect(() => {
|
|
16770
16854
|
if (!isSidebarCollapsedControlled) {
|
|
16771
16855
|
setUncontrolledSidebarCollapsed(defaultSidebarCollapsed);
|
|
16772
16856
|
}
|
|
@@ -16924,6 +17008,556 @@ function NavigationLayout({
|
|
|
16924
17008
|
}
|
|
16925
17009
|
);
|
|
16926
17010
|
}
|
|
17011
|
+
var AccordionItem = React2__namespace.forwardRef(({ className, style, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
17012
|
+
AccordionPrimitive__namespace.Item,
|
|
17013
|
+
{
|
|
17014
|
+
ref,
|
|
17015
|
+
className: cn("border-b", className),
|
|
17016
|
+
style: {
|
|
17017
|
+
borderColor: "var(--monkeys-component-accordion-item-border-color, hsl(var(--border)))",
|
|
17018
|
+
...style
|
|
17019
|
+
},
|
|
17020
|
+
...props
|
|
17021
|
+
}
|
|
17022
|
+
));
|
|
17023
|
+
AccordionItem.displayName = "AccordionItem";
|
|
17024
|
+
var AccordionTrigger = React2__namespace.forwardRef(({ className, children, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsx(AccordionPrimitive__namespace.Header, { className: "flex", children: /* @__PURE__ */ jsxRuntime.jsxs(
|
|
17025
|
+
AccordionPrimitive__namespace.Trigger,
|
|
17026
|
+
{
|
|
17027
|
+
ref,
|
|
17028
|
+
className: cn(
|
|
17029
|
+
"flex flex-1 items-center justify-between py-4 text-sm font-medium transition-all hover:underline [&[data-state=open]>svg]:rotate-180",
|
|
17030
|
+
className
|
|
17031
|
+
),
|
|
17032
|
+
...props,
|
|
17033
|
+
children: [
|
|
17034
|
+
children,
|
|
17035
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
17036
|
+
lucideReact.ChevronDown,
|
|
17037
|
+
{
|
|
17038
|
+
"aria-hidden": "true",
|
|
17039
|
+
className: "h-4 w-4 shrink-0 transition-transform duration-200"
|
|
17040
|
+
}
|
|
17041
|
+
)
|
|
17042
|
+
]
|
|
17043
|
+
}
|
|
17044
|
+
) }));
|
|
17045
|
+
AccordionTrigger.displayName = "AccordionTrigger";
|
|
17046
|
+
var AccordionContent = React2__namespace.forwardRef(({ className, children, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
17047
|
+
AccordionPrimitive__namespace.Content,
|
|
17048
|
+
{
|
|
17049
|
+
ref,
|
|
17050
|
+
className: "overflow-hidden text-sm transition-all data-[state=closed]:animate-accordion-up data-[state=open]:animate-accordion-down",
|
|
17051
|
+
...props,
|
|
17052
|
+
children: /* @__PURE__ */ jsxRuntime.jsx("div", { className: cn("pb-4 pt-0", className), children })
|
|
17053
|
+
}
|
|
17054
|
+
));
|
|
17055
|
+
AccordionContent.displayName = "AccordionContent";
|
|
17056
|
+
var Checkbox = React2__namespace.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
17057
|
+
CheckboxPrimitive__namespace.Root,
|
|
17058
|
+
{
|
|
17059
|
+
ref,
|
|
17060
|
+
className: cn(
|
|
17061
|
+
"peer h-4 w-4 shrink-0 rounded-sm border border-primary shadow focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50 data-[state=checked]:bg-primary data-[state=checked]:text-primary-foreground",
|
|
17062
|
+
className
|
|
17063
|
+
),
|
|
17064
|
+
...props,
|
|
17065
|
+
children: /* @__PURE__ */ jsxRuntime.jsx(CheckboxPrimitive__namespace.Indicator, { className: "flex items-center justify-center text-current", children: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.Check, { "aria-hidden": "true", className: "h-4 w-4" }) })
|
|
17066
|
+
}
|
|
17067
|
+
));
|
|
17068
|
+
Checkbox.displayName = "Checkbox";
|
|
17069
|
+
var buttonVariants = classVarianceAuthority.cva(
|
|
17070
|
+
"inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0",
|
|
17071
|
+
{
|
|
17072
|
+
variants: {
|
|
17073
|
+
variant: {
|
|
17074
|
+
default: "bg-primary text-primary-foreground shadow-sm hover:bg-primary/90",
|
|
17075
|
+
destructive: "bg-destructive text-destructive-foreground shadow-sm hover:bg-destructive/90",
|
|
17076
|
+
outline: "border border-input bg-background shadow-sm hover:bg-accent hover:text-accent-foreground",
|
|
17077
|
+
secondary: "bg-secondary text-secondary-foreground shadow-sm hover:bg-secondary/80",
|
|
17078
|
+
ghost: "hover:bg-accent hover:text-accent-foreground",
|
|
17079
|
+
link: "text-primary underline-offset-4 hover:underline"
|
|
17080
|
+
},
|
|
17081
|
+
size: {
|
|
17082
|
+
default: "h-10 px-4 py-2",
|
|
17083
|
+
sm: "h-9 rounded-sm px-3",
|
|
17084
|
+
lg: "h-11 rounded-md px-8",
|
|
17085
|
+
icon: "h-10 w-10"
|
|
17086
|
+
}
|
|
17087
|
+
},
|
|
17088
|
+
defaultVariants: { variant: "default", size: "default" }
|
|
17089
|
+
}
|
|
17090
|
+
);
|
|
17091
|
+
var Button = React2__namespace.forwardRef(
|
|
17092
|
+
({ className, variant, size, asChild = false, ...props }, ref) => {
|
|
17093
|
+
const Component = asChild ? reactSlot.Slot : "button";
|
|
17094
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
17095
|
+
Component,
|
|
17096
|
+
{
|
|
17097
|
+
ref,
|
|
17098
|
+
className: buttonVariants({ variant, size, className }),
|
|
17099
|
+
...props
|
|
17100
|
+
}
|
|
17101
|
+
);
|
|
17102
|
+
}
|
|
17103
|
+
);
|
|
17104
|
+
Button.displayName = "Button";
|
|
17105
|
+
var PopoverContent = React2__namespace.forwardRef(({ className, align = "center", sideOffset = 4, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsx(PopoverPrimitive__namespace.Portal, { children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
17106
|
+
PopoverPrimitive__namespace.Content,
|
|
17107
|
+
{
|
|
17108
|
+
ref,
|
|
17109
|
+
align,
|
|
17110
|
+
sideOffset,
|
|
17111
|
+
className: cn(
|
|
17112
|
+
"z-50 w-72 rounded-lg border bg-popover p-4 text-popover-foreground shadow-md outline-none data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",
|
|
17113
|
+
className
|
|
17114
|
+
),
|
|
17115
|
+
...props
|
|
17116
|
+
}
|
|
17117
|
+
) }));
|
|
17118
|
+
PopoverContent.displayName = "PopoverContent";
|
|
17119
|
+
var ScrollArea = React2__namespace.forwardRef(
|
|
17120
|
+
({
|
|
17121
|
+
className,
|
|
17122
|
+
children,
|
|
17123
|
+
viewportClassName,
|
|
17124
|
+
viewportRef,
|
|
17125
|
+
onViewportScroll,
|
|
17126
|
+
scrollbar = true,
|
|
17127
|
+
scrollbarOrientation = "vertical",
|
|
17128
|
+
scrollBarDisabled = false,
|
|
17129
|
+
...props
|
|
17130
|
+
}, ref) => /* @__PURE__ */ jsxRuntime.jsxs(
|
|
17131
|
+
ScrollAreaPrimitive__namespace.Root,
|
|
17132
|
+
{
|
|
17133
|
+
ref,
|
|
17134
|
+
className: cn(
|
|
17135
|
+
"group relative overflow-hidden",
|
|
17136
|
+
scrollBarDisabled && "no-scrollbar",
|
|
17137
|
+
className
|
|
17138
|
+
),
|
|
17139
|
+
...props,
|
|
17140
|
+
children: [
|
|
17141
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
17142
|
+
ScrollAreaPrimitive__namespace.Viewport,
|
|
17143
|
+
{
|
|
17144
|
+
ref: viewportRef,
|
|
17145
|
+
onScroll: onViewportScroll,
|
|
17146
|
+
className: cn("h-full w-full rounded-[inherit]", viewportClassName),
|
|
17147
|
+
children
|
|
17148
|
+
}
|
|
17149
|
+
),
|
|
17150
|
+
scrollbar ? /* @__PURE__ */ jsxRuntime.jsx(
|
|
17151
|
+
ScrollBar,
|
|
17152
|
+
{
|
|
17153
|
+
orientation: scrollbarOrientation,
|
|
17154
|
+
className: cn(scrollBarDisabled && "size-0 p-0")
|
|
17155
|
+
}
|
|
17156
|
+
) : null,
|
|
17157
|
+
/* @__PURE__ */ jsxRuntime.jsx(ScrollAreaPrimitive__namespace.Corner, {})
|
|
17158
|
+
]
|
|
17159
|
+
}
|
|
17160
|
+
)
|
|
17161
|
+
);
|
|
17162
|
+
ScrollArea.displayName = "ScrollArea";
|
|
17163
|
+
var ScrollBar = React2__namespace.forwardRef(({ className, orientation = "vertical", ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
17164
|
+
ScrollAreaPrimitive__namespace.ScrollAreaScrollbar,
|
|
17165
|
+
{
|
|
17166
|
+
ref,
|
|
17167
|
+
orientation,
|
|
17168
|
+
className: cn(
|
|
17169
|
+
"flex touch-none select-none opacity-0 transition-opacity group-hover:opacity-100 group-focus-within:opacity-100 data-[state=visible]:opacity-100",
|
|
17170
|
+
orientation === "vertical" && "h-full w-2.5 border-l border-l-transparent p-px",
|
|
17171
|
+
orientation === "horizontal" && "h-2.5 flex-col border-t border-t-transparent p-px",
|
|
17172
|
+
className
|
|
17173
|
+
),
|
|
17174
|
+
...props,
|
|
17175
|
+
children: /* @__PURE__ */ jsxRuntime.jsx(ScrollAreaPrimitive__namespace.ScrollAreaThumb, { className: "relative flex-1 rounded-full bg-border" })
|
|
17176
|
+
}
|
|
17177
|
+
));
|
|
17178
|
+
ScrollBar.displayName = "ScrollBar";
|
|
17179
|
+
var Switch = React2__namespace.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
17180
|
+
SwitchPrimitive__namespace.Root,
|
|
17181
|
+
{
|
|
17182
|
+
ref,
|
|
17183
|
+
className: cn(
|
|
17184
|
+
"peer inline-flex h-6 w-11 shrink-0 cursor-pointer items-center rounded-full border-2 border-transparent transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-background disabled:cursor-not-allowed disabled:opacity-50 data-[state=checked]:bg-primary data-[state=unchecked]:bg-input",
|
|
17185
|
+
className
|
|
17186
|
+
),
|
|
17187
|
+
...props,
|
|
17188
|
+
children: /* @__PURE__ */ jsxRuntime.jsx(SwitchPrimitive__namespace.Thumb, { className: "pointer-events-none block h-5 w-5 rounded-full bg-background shadow-lg ring-0 transition-transform data-[state=checked]:translate-x-5 data-[state=unchecked]:translate-x-0" })
|
|
17189
|
+
}
|
|
17190
|
+
));
|
|
17191
|
+
Switch.displayName = "Switch";
|
|
17192
|
+
var Tabs = React2__namespace.forwardRef(({ variant = "default", ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsx(TabsPrimitive__namespace.Root, { ref, "data-variant": variant, ...props }));
|
|
17193
|
+
Tabs.displayName = "Tabs";
|
|
17194
|
+
var TabsList = React2__namespace.forwardRef(({ className, gap, style, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
17195
|
+
TabsPrimitive__namespace.List,
|
|
17196
|
+
{
|
|
17197
|
+
ref,
|
|
17198
|
+
className: cn(
|
|
17199
|
+
"inline-flex h-10 items-center justify-center rounded-lg bg-muted p-1 text-muted-foreground",
|
|
17200
|
+
className
|
|
17201
|
+
),
|
|
17202
|
+
style: { gap, ...style },
|
|
17203
|
+
...props
|
|
17204
|
+
}
|
|
17205
|
+
));
|
|
17206
|
+
TabsList.displayName = "TabsList";
|
|
17207
|
+
var TabsTrigger = React2__namespace.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
17208
|
+
TabsPrimitive__namespace.Trigger,
|
|
17209
|
+
{
|
|
17210
|
+
ref,
|
|
17211
|
+
className: cn(
|
|
17212
|
+
"inline-flex items-center justify-center whitespace-nowrap rounded-md px-3 py-1.5 text-sm font-medium ring-offset-background transition-all focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 data-[state=active]:bg-background data-[state=active]:text-foreground data-[state=active]:shadow-sm",
|
|
17213
|
+
className
|
|
17214
|
+
),
|
|
17215
|
+
...props
|
|
17216
|
+
}
|
|
17217
|
+
));
|
|
17218
|
+
TabsTrigger.displayName = "TabsTrigger";
|
|
17219
|
+
var TabsContent = React2__namespace.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
17220
|
+
TabsPrimitive__namespace.Content,
|
|
17221
|
+
{
|
|
17222
|
+
ref,
|
|
17223
|
+
className: cn(
|
|
17224
|
+
"mt-2 ring-offset-background focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2",
|
|
17225
|
+
className
|
|
17226
|
+
),
|
|
17227
|
+
...props
|
|
17228
|
+
}
|
|
17229
|
+
));
|
|
17230
|
+
TabsContent.displayName = "TabsContent";
|
|
17231
|
+
var TooltipContent = React2__namespace.forwardRef(({ className, sideOffset = 4, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsx(Tooltip2__namespace.Portal, { children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
17232
|
+
Tooltip2__namespace.Content,
|
|
17233
|
+
{
|
|
17234
|
+
ref,
|
|
17235
|
+
sideOffset,
|
|
17236
|
+
className: cn(
|
|
17237
|
+
"z-50 overflow-hidden rounded-md border bg-popover px-3 py-1.5 text-xs text-popover-foreground shadow-md animate-in fade-in-0 zoom-in-95 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",
|
|
17238
|
+
className
|
|
17239
|
+
),
|
|
17240
|
+
...props
|
|
17241
|
+
}
|
|
17242
|
+
) }));
|
|
17243
|
+
TooltipContent.displayName = "TooltipContent";
|
|
17244
|
+
var menuItemClassName = "relative flex cursor-default select-none items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50 [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0";
|
|
17245
|
+
var menuContentClassName = "z-50 min-w-[8rem] overflow-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-md data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2";
|
|
17246
|
+
var DropdownMenu4 = DropdownMenu2__namespace.Root;
|
|
17247
|
+
var DropdownMenuTrigger = DropdownMenu2__namespace.Trigger;
|
|
17248
|
+
var DropdownMenuSubTrigger = React2__namespace.forwardRef(({ className, inset, children, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsxs(DropdownMenu2__namespace.SubTrigger, { ref, className: cn(menuItemClassName, "data-[state=open]:bg-accent", inset && "pl-8", className), ...props, children: [
|
|
17249
|
+
children,
|
|
17250
|
+
/* @__PURE__ */ jsxRuntime.jsx(lucideReact.ChevronRight, { "aria-hidden": "true", className: "ml-auto" })
|
|
17251
|
+
] }));
|
|
17252
|
+
DropdownMenuSubTrigger.displayName = "DropdownMenuSubTrigger";
|
|
17253
|
+
var DropdownMenuSubContent = React2__namespace.forwardRef(
|
|
17254
|
+
({ className, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsx(DropdownMenu2__namespace.SubContent, { ref, className: cn(menuContentClassName, className), ...props })
|
|
17255
|
+
);
|
|
17256
|
+
DropdownMenuSubContent.displayName = "DropdownMenuSubContent";
|
|
17257
|
+
var DropdownMenuContent = React2__namespace.forwardRef(
|
|
17258
|
+
({ className, sideOffset = 4, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsx(DropdownMenu2__namespace.Portal, { children: /* @__PURE__ */ jsxRuntime.jsx(DropdownMenu2__namespace.Content, { ref, sideOffset, className: cn(menuContentClassName, className), ...props }) })
|
|
17259
|
+
);
|
|
17260
|
+
DropdownMenuContent.displayName = "DropdownMenuContent";
|
|
17261
|
+
var DropdownMenuItem = React2__namespace.forwardRef(
|
|
17262
|
+
({ className, inset, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsx(DropdownMenu2__namespace.Item, { ref, className: cn(menuItemClassName, inset && "pl-8", className), ...props })
|
|
17263
|
+
);
|
|
17264
|
+
DropdownMenuItem.displayName = "DropdownMenuItem";
|
|
17265
|
+
var DropdownMenuCheckboxItem = React2__namespace.forwardRef(
|
|
17266
|
+
({ className, children, checked, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsxs(DropdownMenu2__namespace.CheckboxItem, { ref, className: cn(menuItemClassName, "pl-8", className), checked, ...props, children: [
|
|
17267
|
+
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "absolute left-2 flex h-3.5 w-3.5 items-center justify-center", children: /* @__PURE__ */ jsxRuntime.jsx(DropdownMenu2__namespace.ItemIndicator, { children: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.Check, { "aria-hidden": "true", className: "h-4 w-4" }) }) }),
|
|
17268
|
+
children
|
|
17269
|
+
] })
|
|
17270
|
+
);
|
|
17271
|
+
DropdownMenuCheckboxItem.displayName = "DropdownMenuCheckboxItem";
|
|
17272
|
+
var DropdownMenuRadioItem = React2__namespace.forwardRef(
|
|
17273
|
+
({ className, children, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsxs(DropdownMenu2__namespace.RadioItem, { ref, className: cn(menuItemClassName, "pl-8", className), ...props, children: [
|
|
17274
|
+
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "absolute left-2 flex h-3.5 w-3.5 items-center justify-center", children: /* @__PURE__ */ jsxRuntime.jsx(DropdownMenu2__namespace.ItemIndicator, { children: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.Circle, { "aria-hidden": "true", className: "h-2 w-2 fill-current" }) }) }),
|
|
17275
|
+
children
|
|
17276
|
+
] })
|
|
17277
|
+
);
|
|
17278
|
+
DropdownMenuRadioItem.displayName = "DropdownMenuRadioItem";
|
|
17279
|
+
var DropdownMenuLabel = React2__namespace.forwardRef(
|
|
17280
|
+
({ className, inset, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsx(DropdownMenu2__namespace.Label, { ref, className: cn("px-2 py-1.5 text-sm font-semibold", inset && "pl-8", className), ...props })
|
|
17281
|
+
);
|
|
17282
|
+
DropdownMenuLabel.displayName = "DropdownMenuLabel";
|
|
17283
|
+
var DropdownMenuSeparator = React2__namespace.forwardRef(
|
|
17284
|
+
({ className, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsx(DropdownMenu2__namespace.Separator, { ref, className: cn("-mx-1 my-1 h-px bg-muted", className), ...props })
|
|
17285
|
+
);
|
|
17286
|
+
DropdownMenuSeparator.displayName = "DropdownMenuSeparator";
|
|
17287
|
+
var SelectTrigger = React2__namespace.forwardRef(
|
|
17288
|
+
({ className, children, iconClassName, size = "default", ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsxs(SelectPrimitive__namespace.Trigger, { ref, className: cn("flex h-10 w-full items-center justify-between whitespace-nowrap rounded-md border border-input bg-background px-3 py-2 text-left text-sm shadow-sm ring-offset-background data-[placeholder]:text-muted-foreground focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50 [&>span]:line-clamp-1 [&>span]:min-w-0 [&>span]:flex-1 [&>span]:text-left", size === "sm" && "h-8 px-2 py-1 text-xs", className), ...props, children: [
|
|
17289
|
+
children,
|
|
17290
|
+
/* @__PURE__ */ jsxRuntime.jsx(SelectPrimitive__namespace.Icon, { asChild: true, children: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.ChevronDown, { "aria-hidden": "true", className: cn("h-4 w-4 opacity-50", iconClassName) }) })
|
|
17291
|
+
] })
|
|
17292
|
+
);
|
|
17293
|
+
SelectTrigger.displayName = "SelectTrigger";
|
|
17294
|
+
var SelectScrollUpButton = React2__namespace.forwardRef(
|
|
17295
|
+
({ className, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsx(SelectPrimitive__namespace.ScrollUpButton, { ref, className: cn("flex cursor-default items-center justify-center py-1", className), ...props, children: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.ChevronUp, { "aria-hidden": "true", className: "h-4 w-4" }) })
|
|
17296
|
+
);
|
|
17297
|
+
SelectScrollUpButton.displayName = "SelectScrollUpButton";
|
|
17298
|
+
var SelectScrollDownButton = React2__namespace.forwardRef(
|
|
17299
|
+
({ className, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsx(SelectPrimitive__namespace.ScrollDownButton, { ref, className: cn("flex cursor-default items-center justify-center py-1", className), ...props, children: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.ChevronDown, { "aria-hidden": "true", className: "h-4 w-4" }) })
|
|
17300
|
+
);
|
|
17301
|
+
SelectScrollDownButton.displayName = "SelectScrollDownButton";
|
|
17302
|
+
var SelectContent = React2__namespace.forwardRef(
|
|
17303
|
+
({ className, children, position = "popper", viewportClassName, disableTriggerViewportSizing = false, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsx(SelectPrimitive__namespace.Portal, { children: /* @__PURE__ */ jsxRuntime.jsxs(SelectPrimitive__namespace.Content, { ref, position, className: cn(menuContentClassName, "relative max-h-[var(--radix-select-content-available-height)] overflow-y-auto overflow-x-hidden", position === "popper" && "data-[side=bottom]:translate-y-1 data-[side=left]:-translate-x-1 data-[side=right]:translate-x-1 data-[side=top]:-translate-y-1", className), ...props, children: [
|
|
17304
|
+
/* @__PURE__ */ jsxRuntime.jsx(SelectScrollUpButton, {}),
|
|
17305
|
+
/* @__PURE__ */ jsxRuntime.jsx(SelectPrimitive__namespace.Viewport, { className: cn("p-1", position === "popper" && "w-full min-w-[var(--radix-select-trigger-width)]", position === "popper" && !disableTriggerViewportSizing && "h-[var(--radix-select-trigger-height)]", viewportClassName), children }),
|
|
17306
|
+
/* @__PURE__ */ jsxRuntime.jsx(SelectScrollDownButton, {})
|
|
17307
|
+
] }) })
|
|
17308
|
+
);
|
|
17309
|
+
SelectContent.displayName = "SelectContent";
|
|
17310
|
+
var SelectLabel = React2__namespace.forwardRef(
|
|
17311
|
+
({ className, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsx(SelectPrimitive__namespace.Label, { ref, className: cn("px-2 py-1.5 text-sm font-semibold", className), ...props })
|
|
17312
|
+
);
|
|
17313
|
+
SelectLabel.displayName = "SelectLabel";
|
|
17314
|
+
var SelectItem = React2__namespace.forwardRef(
|
|
17315
|
+
({ className, children, indicatorClassName, itemText, hideIndicator = false, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsxs(SelectPrimitive__namespace.Item, { ref, className: cn(menuItemClassName, "w-full", hideIndicator ? "px-2" : "pl-8 pr-2", className), ...props, children: [
|
|
17316
|
+
!hideIndicator ? /* @__PURE__ */ jsxRuntime.jsx("span", { className: cn("absolute left-2 flex h-3.5 w-3.5 items-center justify-center", indicatorClassName), children: /* @__PURE__ */ jsxRuntime.jsx(SelectPrimitive__namespace.ItemIndicator, { children: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.Check, { "aria-hidden": "true", className: "h-4 w-4" }) }) }) : null,
|
|
17317
|
+
itemText ? /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
|
|
17318
|
+
/* @__PURE__ */ jsxRuntime.jsx(SelectPrimitive__namespace.ItemText, { asChild: true, children: /* @__PURE__ */ jsxRuntime.jsx("span", { className: "sr-only", children: itemText }) }),
|
|
17319
|
+
children
|
|
17320
|
+
] }) : /* @__PURE__ */ jsxRuntime.jsx(SelectPrimitive__namespace.ItemText, { children })
|
|
17321
|
+
] })
|
|
17322
|
+
);
|
|
17323
|
+
SelectItem.displayName = "SelectItem";
|
|
17324
|
+
var SelectSeparator = React2__namespace.forwardRef(
|
|
17325
|
+
({ className, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsx(SelectPrimitive__namespace.Separator, { ref, className: cn("-mx-1 my-1 h-px bg-muted", className), ...props })
|
|
17326
|
+
);
|
|
17327
|
+
SelectSeparator.displayName = "SelectSeparator";
|
|
17328
|
+
function ItemAvatar({ item }) {
|
|
17329
|
+
const [failed, setFailed] = React2.useState(false);
|
|
17330
|
+
if (item.iconUrl && !failed) {
|
|
17331
|
+
return /* @__PURE__ */ jsxRuntime.jsx("img", { src: item.iconUrl, alt: "", className: "size-full object-cover", onError: () => setFailed(true) });
|
|
17332
|
+
}
|
|
17333
|
+
const initial = item.name.trim().charAt(0).toLocaleUpperCase();
|
|
17334
|
+
return initial ? /* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-sm font-semibold", children: initial }) : /* @__PURE__ */ jsxRuntime.jsx(lucideReact.Bot, { className: "size-4" });
|
|
17335
|
+
}
|
|
17336
|
+
function SessionAvatar({ item }) {
|
|
17337
|
+
const [failed, setFailed] = React2.useState(false);
|
|
17338
|
+
if (item.thumbnailUrl && !failed) {
|
|
17339
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
17340
|
+
"img",
|
|
17341
|
+
{
|
|
17342
|
+
src: item.thumbnailUrl,
|
|
17343
|
+
alt: "",
|
|
17344
|
+
className: "size-full object-cover",
|
|
17345
|
+
loading: "lazy",
|
|
17346
|
+
onError: () => setFailed(true)
|
|
17347
|
+
}
|
|
17348
|
+
);
|
|
17349
|
+
}
|
|
17350
|
+
return /* @__PURE__ */ jsxRuntime.jsx(lucideReact.Image, { className: "size-5", "aria-hidden": "true" });
|
|
17351
|
+
}
|
|
17352
|
+
function CollectionState({
|
|
17353
|
+
status,
|
|
17354
|
+
empty,
|
|
17355
|
+
noResults,
|
|
17356
|
+
hasItems,
|
|
17357
|
+
query,
|
|
17358
|
+
error,
|
|
17359
|
+
onRetry
|
|
17360
|
+
}) {
|
|
17361
|
+
const messages = useMonkeysLocaleMessages().agentWorkbench.navigation;
|
|
17362
|
+
if (status === "loading" && !hasItems) {
|
|
17363
|
+
return /* @__PURE__ */ jsxRuntime.jsx("div", { className: "px-3 py-8 text-center text-sm text-muted-foreground", children: messages.loading });
|
|
17364
|
+
}
|
|
17365
|
+
if (status === "error") {
|
|
17366
|
+
return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex flex-col items-center gap-3 px-3 py-8 text-center", children: [
|
|
17367
|
+
/* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-sm text-muted-foreground", role: "alert", children: error }),
|
|
17368
|
+
/* @__PURE__ */ jsxRuntime.jsxs("button", { type: "button", className: "inline-flex items-center gap-1.5 text-sm font-medium text-primary", onClick: onRetry, children: [
|
|
17369
|
+
/* @__PURE__ */ jsxRuntime.jsx(lucideReact.RefreshCw, { className: "size-3.5", "aria-hidden": "true" }),
|
|
17370
|
+
messages.retry
|
|
17371
|
+
] })
|
|
17372
|
+
] });
|
|
17373
|
+
}
|
|
17374
|
+
if (!hasItems) {
|
|
17375
|
+
return /* @__PURE__ */ jsxRuntime.jsx("div", { className: "px-3 py-8 text-center text-sm text-muted-foreground", children: query ? noResults : empty });
|
|
17376
|
+
}
|
|
17377
|
+
return null;
|
|
17378
|
+
}
|
|
17379
|
+
function StatusIndicator({ status }) {
|
|
17380
|
+
const messages = useMonkeysLocaleMessages().agentWorkbench.navigation;
|
|
17381
|
+
if (status === "running") {
|
|
17382
|
+
return /* @__PURE__ */ jsxRuntime.jsx(lucideReact.Loader2, { className: "size-4 animate-spin text-primary", "aria-label": messages.running });
|
|
17383
|
+
}
|
|
17384
|
+
if (status === "completed") {
|
|
17385
|
+
return /* @__PURE__ */ jsxRuntime.jsx(lucideReact.CheckCircle2, { className: "size-4 text-primary", "aria-label": messages.completed });
|
|
17386
|
+
}
|
|
17387
|
+
if (status === "error") {
|
|
17388
|
+
return /* @__PURE__ */ jsxRuntime.jsx(lucideReact.AlertCircle, { className: "size-4 text-destructive-text", "aria-label": messages.failed });
|
|
17389
|
+
}
|
|
17390
|
+
return null;
|
|
17391
|
+
}
|
|
17392
|
+
function SessionActions({
|
|
17393
|
+
item,
|
|
17394
|
+
capabilities,
|
|
17395
|
+
onIntent
|
|
17396
|
+
}) {
|
|
17397
|
+
const messages = useMonkeysLocaleMessages().agentWorkbench.navigation;
|
|
17398
|
+
if (!capabilities.renameSessions && !capabilities.deleteSessions) return null;
|
|
17399
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(DropdownMenu4, { children: [
|
|
17400
|
+
/* @__PURE__ */ jsxRuntime.jsx(DropdownMenuTrigger, { asChild: true, children: /* @__PURE__ */ jsxRuntime.jsx("button", { type: "button", className: "flex size-8 items-center justify-center rounded-md hover:bg-muted", "aria-label": messages.actions, children: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.Ellipsis, { className: "size-4", "aria-hidden": "true" }) }) }),
|
|
17401
|
+
/* @__PURE__ */ jsxRuntime.jsxs(DropdownMenuContent, { align: "end", children: [
|
|
17402
|
+
capabilities.renameSessions ? /* @__PURE__ */ jsxRuntime.jsxs(DropdownMenuItem, { onSelect: () => onIntent?.({ type: "rename-session", sessionId: item.id, title: item.title }), children: [
|
|
17403
|
+
/* @__PURE__ */ jsxRuntime.jsx(lucideReact.Pencil, { className: "mr-2 size-4", "aria-hidden": "true" }),
|
|
17404
|
+
messages.rename
|
|
17405
|
+
] }) : null,
|
|
17406
|
+
capabilities.deleteSessions ? /* @__PURE__ */ jsxRuntime.jsxs(DropdownMenuItem, { className: "text-destructive-text", onSelect: () => onIntent?.({ type: "delete-session", sessionId: item.id }), children: [
|
|
17407
|
+
/* @__PURE__ */ jsxRuntime.jsx(lucideReact.Trash2, { className: "mr-2 size-4", "aria-hidden": "true" }),
|
|
17408
|
+
messages.delete
|
|
17409
|
+
] }) : null
|
|
17410
|
+
] })
|
|
17411
|
+
] });
|
|
17412
|
+
}
|
|
17413
|
+
function AgentWorkbenchSidebar({ viewModel, className, classNames, onIntent }) {
|
|
17414
|
+
const { locale } = useMonkeysLocale();
|
|
17415
|
+
const messages = useMonkeysLocaleMessages().agentWorkbench.navigation;
|
|
17416
|
+
const searchRef = React2.useRef(null);
|
|
17417
|
+
const query = viewModel.searchQuery.trim().toLocaleLowerCase();
|
|
17418
|
+
const agents = React2.useMemo(
|
|
17419
|
+
() => viewModel.agents.items.filter((item) => !query || `${item.name} ${item.description ?? ""}`.toLocaleLowerCase().includes(query)),
|
|
17420
|
+
[query, viewModel.agents.items]
|
|
17421
|
+
);
|
|
17422
|
+
const sessions = React2.useMemo(
|
|
17423
|
+
() => viewModel.sessions.items.filter((item) => !query || item.title.toLocaleLowerCase().includes(query)),
|
|
17424
|
+
[query, viewModel.sessions.items]
|
|
17425
|
+
);
|
|
17426
|
+
React2.useEffect(() => {
|
|
17427
|
+
const handleShortcut = (event) => {
|
|
17428
|
+
if (!(event.ctrlKey || event.metaKey) || event.key.toLocaleLowerCase() !== "k") return;
|
|
17429
|
+
event.preventDefault();
|
|
17430
|
+
searchRef.current?.focus();
|
|
17431
|
+
searchRef.current?.select();
|
|
17432
|
+
};
|
|
17433
|
+
window.addEventListener("keydown", handleShortcut);
|
|
17434
|
+
return () => window.removeEventListener("keydown", handleShortcut);
|
|
17435
|
+
}, []);
|
|
17436
|
+
return /* @__PURE__ */ jsxRuntime.jsx("nav", { "aria-label": messages.tabsLabel, className: cn2("h-full min-h-0", classNames?.root, className), children: /* @__PURE__ */ jsxRuntime.jsxs(
|
|
17437
|
+
Tabs,
|
|
17438
|
+
{
|
|
17439
|
+
value: viewModel.activeTab,
|
|
17440
|
+
onValueChange: (value) => {
|
|
17441
|
+
if (value === "agents" || value === "sessions") onIntent?.({ type: "change-tab", tab: value });
|
|
17442
|
+
},
|
|
17443
|
+
className: "flex h-full min-h-0 flex-col bg-background text-foreground",
|
|
17444
|
+
children: [
|
|
17445
|
+
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "shrink-0 space-y-3 p-4 pb-2", children: [
|
|
17446
|
+
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: cn2("flex h-10 items-center gap-2 rounded-lg border border-border bg-card px-3 focus-within:ring-2 focus-within:ring-ring", classNames?.search), children: [
|
|
17447
|
+
/* @__PURE__ */ jsxRuntime.jsx(lucideReact.Search, { className: "size-4 shrink-0 text-muted-foreground", "aria-hidden": "true" }),
|
|
17448
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
17449
|
+
"input",
|
|
17450
|
+
{
|
|
17451
|
+
ref: searchRef,
|
|
17452
|
+
type: "search",
|
|
17453
|
+
value: viewModel.searchQuery,
|
|
17454
|
+
"aria-label": messages.search,
|
|
17455
|
+
placeholder: messages.search,
|
|
17456
|
+
className: "min-w-0 flex-1 bg-transparent text-sm outline-none placeholder:text-muted-foreground [&::-webkit-search-cancel-button]:hidden",
|
|
17457
|
+
onChange: (event) => onIntent?.({ type: "change-search", query: event.target.value }),
|
|
17458
|
+
onKeyDown: (event) => {
|
|
17459
|
+
if (event.key !== "Escape") return;
|
|
17460
|
+
onIntent?.({ type: "change-search", query: "" });
|
|
17461
|
+
event.currentTarget.blur();
|
|
17462
|
+
}
|
|
17463
|
+
}
|
|
17464
|
+
),
|
|
17465
|
+
viewModel.searchQuery ? /* @__PURE__ */ jsxRuntime.jsx("button", { type: "button", className: "flex size-6 items-center justify-center rounded-md hover:bg-muted", "aria-label": messages.clearSearch, onClick: () => onIntent?.({ type: "change-search", query: "" }), children: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.X, { className: "size-3.5", "aria-hidden": "true" }) }) : /* @__PURE__ */ jsxRuntime.jsx("kbd", { className: "rounded border border-border px-1.5 py-0.5 text-[10px] text-muted-foreground", children: "Ctrl K" })
|
|
17466
|
+
] }),
|
|
17467
|
+
/* @__PURE__ */ jsxRuntime.jsxs(TabsList, { className: cn2("grid w-full grid-cols-2 text-foreground", classNames?.tabs), "aria-label": messages.tabsLabel, children: [
|
|
17468
|
+
/* @__PURE__ */ jsxRuntime.jsx(TabsTrigger, { value: "agents", children: messages.agents }),
|
|
17469
|
+
/* @__PURE__ */ jsxRuntime.jsx(TabsTrigger, { value: "sessions", children: messages.sessions })
|
|
17470
|
+
] })
|
|
17471
|
+
] }),
|
|
17472
|
+
/* @__PURE__ */ jsxRuntime.jsxs(TabsContent, { value: "agents", className: cn2("mt-0 min-h-0 flex-1 overflow-y-auto px-4 pb-4", classNames?.body), children: [
|
|
17473
|
+
viewModel.capabilities.createAgent ? /* @__PURE__ */ jsxRuntime.jsxs("button", { type: "button", className: "mb-3 flex h-9 w-full items-center gap-2 rounded-md px-3 text-left text-sm font-medium hover:bg-muted", onClick: () => onIntent?.({ type: "create-agent" }), children: [
|
|
17474
|
+
/* @__PURE__ */ jsxRuntime.jsx(lucideReact.Plus, { className: "size-4", "aria-hidden": "true" }),
|
|
17475
|
+
messages.newAgent
|
|
17476
|
+
] }) : null,
|
|
17477
|
+
/* @__PURE__ */ jsxRuntime.jsx("h3", { className: "mb-2 px-3 text-xs font-medium text-muted-foreground", children: messages.allAgents }),
|
|
17478
|
+
/* @__PURE__ */ jsxRuntime.jsx(CollectionState, { status: viewModel.agents.status, empty: messages.emptyAgents, noResults: messages.noResults, hasItems: agents.length > 0, query, error: viewModel.agents.error, onRetry: () => onIntent?.({ type: "retry-agents" }) }),
|
|
17479
|
+
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "space-y-1", children: agents.map((item) => /* @__PURE__ */ jsxRuntime.jsxs(
|
|
17480
|
+
"div",
|
|
17481
|
+
{
|
|
17482
|
+
"aria-current": item.id === viewModel.selectedAgentItem ? "page" : void 0,
|
|
17483
|
+
className: cn2("group flex w-full items-center gap-3 rounded-lg border border-transparent px-3 py-2 text-left hover:bg-muted aria-[current=page]:border-primary aria-[current=page]:bg-muted", classNames?.item),
|
|
17484
|
+
children: [
|
|
17485
|
+
/* @__PURE__ */ jsxRuntime.jsxs("button", { type: "button", className: "flex min-w-0 flex-1 items-center gap-3 text-left", onClick: () => onIntent?.({ type: "select-agent", itemId: item.id }), children: [
|
|
17486
|
+
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "flex size-10 shrink-0 items-center justify-center overflow-hidden rounded-lg bg-muted", children: /* @__PURE__ */ jsxRuntime.jsx(ItemAvatar, { item }) }),
|
|
17487
|
+
/* @__PURE__ */ jsxRuntime.jsxs("span", { className: "min-w-0 flex-1", children: [
|
|
17488
|
+
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "block truncate text-sm font-medium", children: item.name }),
|
|
17489
|
+
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "block truncate text-xs text-foreground/80", children: item.description || messages.noDescription })
|
|
17490
|
+
] })
|
|
17491
|
+
] }),
|
|
17492
|
+
item.builtIn ? /* @__PURE__ */ jsxRuntime.jsx("span", { className: "rounded-full bg-muted px-1.5 py-1 text-[10px] text-foreground", children: messages.builtIn }) : null,
|
|
17493
|
+
viewModel.capabilities.pinAgents ? /* @__PURE__ */ jsxRuntime.jsx(
|
|
17494
|
+
"button",
|
|
17495
|
+
{
|
|
17496
|
+
type: "button",
|
|
17497
|
+
"aria-label": item.pinned ? messages.unpin : messages.pin,
|
|
17498
|
+
className: cn2("flex size-8 items-center justify-center rounded-md text-muted-foreground opacity-0 hover:bg-muted group-hover:opacity-100", item.pinned && "text-primary opacity-100"),
|
|
17499
|
+
onClick: (event) => {
|
|
17500
|
+
event.stopPropagation();
|
|
17501
|
+
onIntent?.({ type: "toggle-agent-pin", itemId: item.id, pinned: !item.pinned });
|
|
17502
|
+
},
|
|
17503
|
+
onKeyDown: (event) => {
|
|
17504
|
+
if (event.key === "Enter" || event.key === " ") {
|
|
17505
|
+
event.preventDefault();
|
|
17506
|
+
event.stopPropagation();
|
|
17507
|
+
onIntent?.({ type: "toggle-agent-pin", itemId: item.id, pinned: !item.pinned });
|
|
17508
|
+
}
|
|
17509
|
+
},
|
|
17510
|
+
children: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.Pin, { className: cn2("size-4", item.pinned && "fill-current", item.pinPending && "animate-pulse") })
|
|
17511
|
+
}
|
|
17512
|
+
) : null
|
|
17513
|
+
]
|
|
17514
|
+
},
|
|
17515
|
+
item.id
|
|
17516
|
+
)) })
|
|
17517
|
+
] }),
|
|
17518
|
+
/* @__PURE__ */ jsxRuntime.jsxs(TabsContent, { value: "sessions", className: cn2("mt-0 min-h-0 flex-1 overflow-y-auto px-4 pb-4", classNames?.body), children: [
|
|
17519
|
+
viewModel.capabilities.createSession ? /* @__PURE__ */ jsxRuntime.jsxs("button", { type: "button", className: "flex h-9 w-full items-center gap-2 rounded-md px-3 text-left text-sm font-medium hover:bg-muted", onClick: () => onIntent?.({ type: "create-session" }), children: [
|
|
17520
|
+
/* @__PURE__ */ jsxRuntime.jsx(lucideReact.SquarePen, { className: "size-4", "aria-hidden": "true" }),
|
|
17521
|
+
messages.newSession
|
|
17522
|
+
] }) : null,
|
|
17523
|
+
viewModel.capabilities.manageCapabilities ? /* @__PURE__ */ jsxRuntime.jsxs("button", { type: "button", className: "mb-3 flex h-9 w-full items-center gap-2 rounded-md px-3 text-left text-sm font-medium hover:bg-muted", onClick: () => onIntent?.({ type: "open-capabilities" }), children: [
|
|
17524
|
+
/* @__PURE__ */ jsxRuntime.jsx(lucideReact.Blocks, { className: "size-4", "aria-hidden": "true" }),
|
|
17525
|
+
messages.capabilities
|
|
17526
|
+
] }) : null,
|
|
17527
|
+
/* @__PURE__ */ jsxRuntime.jsx("h3", { className: "mb-2 px-3 text-xs font-medium text-muted-foreground", children: messages.recentSessions }),
|
|
17528
|
+
/* @__PURE__ */ jsxRuntime.jsx(CollectionState, { status: viewModel.sessions.status, empty: messages.emptySessions, noResults: messages.noResults, hasItems: sessions.length > 0, query, error: viewModel.sessions.error, onRetry: () => onIntent?.({ type: "retry-sessions" }) }),
|
|
17529
|
+
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "space-y-1", children: sessions.map((item) => {
|
|
17530
|
+
const percent = item.contextUsage ? Math.min(100, Math.round(item.contextUsage.usedTokens / item.contextUsage.maxTokens * 100)) : void 0;
|
|
17531
|
+
return /* @__PURE__ */ jsxRuntime.jsxs("div", { "aria-current": item.id === viewModel.selectedSessionItem ? "page" : void 0, className: cn2("group flex w-full items-center gap-3 rounded-lg border border-transparent px-3 py-2 text-left hover:bg-muted aria-[current=page]:border-primary aria-[current=page]:bg-muted", classNames?.item), children: [
|
|
17532
|
+
/* @__PURE__ */ jsxRuntime.jsxs("button", { type: "button", className: "flex min-w-0 flex-1 items-center gap-3 text-left", onClick: () => onIntent?.({ type: "select-session", sessionId: item.id }), children: [
|
|
17533
|
+
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "flex size-10 shrink-0 items-center justify-center overflow-hidden rounded-lg bg-muted", children: /* @__PURE__ */ jsxRuntime.jsx(SessionAvatar, { item }) }),
|
|
17534
|
+
/* @__PURE__ */ jsxRuntime.jsxs("span", { className: "min-w-0 flex-1", children: [
|
|
17535
|
+
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "block truncate text-sm font-medium", children: item.title }),
|
|
17536
|
+
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "block truncate text-xs text-foreground/80", children: new Intl.DateTimeFormat(locale, { dateStyle: "medium", timeStyle: "short" }).format(new Date(item.updatedAt)) })
|
|
17537
|
+
] })
|
|
17538
|
+
] }),
|
|
17539
|
+
/* @__PURE__ */ jsxRuntime.jsxs("span", { className: "flex items-center gap-1", children: [
|
|
17540
|
+
percent !== void 0 && item.status === "idle" ? /* @__PURE__ */ jsxRuntime.jsxs("span", { className: "text-xs text-foreground", "aria-label": messages.contextUsage({ percent }), children: [
|
|
17541
|
+
percent,
|
|
17542
|
+
"%"
|
|
17543
|
+
] }) : /* @__PURE__ */ jsxRuntime.jsx(StatusIndicator, { status: item.status }),
|
|
17544
|
+
viewModel.capabilities.pinSessions ? /* @__PURE__ */ jsxRuntime.jsx("button", { type: "button", "aria-label": item.pinned ? messages.unpin : messages.pin, className: cn2("flex size-8 items-center justify-center rounded-md text-muted-foreground opacity-0 hover:bg-muted group-hover:opacity-100", item.pinned && "text-primary opacity-100"), onClick: (event) => {
|
|
17545
|
+
event.stopPropagation();
|
|
17546
|
+
onIntent?.({ type: "toggle-session-pin", sessionId: item.id, pinned: !item.pinned });
|
|
17547
|
+
}, children: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.Pin, { className: cn2("size-4", item.pinned && "fill-current") }) }) : null,
|
|
17548
|
+
/* @__PURE__ */ jsxRuntime.jsx("span", { onClick: (event) => event.stopPropagation(), onKeyDown: (event) => event.stopPropagation(), children: /* @__PURE__ */ jsxRuntime.jsx(SessionActions, { item, capabilities: viewModel.capabilities, onIntent }) })
|
|
17549
|
+
] })
|
|
17550
|
+
] }, item.id);
|
|
17551
|
+
}) })
|
|
17552
|
+
] }),
|
|
17553
|
+
viewModel.capabilities.manageAgentSettings ? /* @__PURE__ */ jsxRuntime.jsx("div", { className: cn2("shrink-0 border-t border-border p-4", classNames?.footer), children: /* @__PURE__ */ jsxRuntime.jsxs("button", { type: "button", className: "flex h-10 w-full items-center gap-2 rounded-md px-3 text-left text-sm font-medium hover:bg-muted", onClick: () => onIntent?.({ type: "open-agent-settings" }), children: [
|
|
17554
|
+
/* @__PURE__ */ jsxRuntime.jsx(lucideReact.Settings, { className: "size-4", "aria-hidden": "true" }),
|
|
17555
|
+
messages.settings
|
|
17556
|
+
] }) }) : null
|
|
17557
|
+
]
|
|
17558
|
+
}
|
|
17559
|
+
) });
|
|
17560
|
+
}
|
|
16927
17561
|
|
|
16928
17562
|
// src/components/agent-workbench/activity-model.ts
|
|
16929
17563
|
var EVENT_CAPABILITIES = {
|
|
@@ -17053,7 +17687,7 @@ function AgentWorkbenchTool({
|
|
|
17053
17687
|
onExpandedChange
|
|
17054
17688
|
}) {
|
|
17055
17689
|
const messages = useMonkeysLocaleMessages().agentWorkbench.tool;
|
|
17056
|
-
const [uncontrolledExpanded, setUncontrolledExpanded] =
|
|
17690
|
+
const [uncontrolledExpanded, setUncontrolledExpanded] = React2.useState(defaultExpanded);
|
|
17057
17691
|
const isControlled = expanded !== void 0;
|
|
17058
17692
|
const isExpanded = expanded ?? uncontrolledExpanded;
|
|
17059
17693
|
const status = event.payload.status;
|
|
@@ -17086,7 +17720,7 @@ function AgentWorkbenchTool({
|
|
|
17086
17720
|
children: [
|
|
17087
17721
|
/* @__PURE__ */ jsxRuntime.jsx(lucideReact.TerminalSquare, { className: "size-4 shrink-0 text-muted-foreground", "aria-hidden": "true" }),
|
|
17088
17722
|
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "min-w-0 flex-1 truncate font-medium", children: event.payload.toolName }),
|
|
17089
|
-
/* @__PURE__ */ jsxRuntime.jsxs("span", { className: "inline-flex shrink-0 items-center gap-1 rounded-full bg-muted px-2 py-0.5 text-xs text-
|
|
17723
|
+
/* @__PURE__ */ jsxRuntime.jsxs("span", { className: "inline-flex shrink-0 items-center gap-1 rounded-full bg-muted px-2 py-0.5 text-xs text-foreground", children: [
|
|
17090
17724
|
/* @__PURE__ */ jsxRuntime.jsx(ToolStatus, { status }),
|
|
17091
17725
|
messages.status[status]
|
|
17092
17726
|
] }),
|
|
@@ -17116,7 +17750,7 @@ function AgentWorkbenchTool({
|
|
|
17116
17750
|
);
|
|
17117
17751
|
}
|
|
17118
17752
|
function ActivityDetails({
|
|
17119
|
-
icon:
|
|
17753
|
+
icon: Icon2,
|
|
17120
17754
|
title,
|
|
17121
17755
|
open,
|
|
17122
17756
|
streaming,
|
|
@@ -17142,7 +17776,7 @@ function ActivityDetails({
|
|
|
17142
17776
|
triggerClassName
|
|
17143
17777
|
),
|
|
17144
17778
|
children: [
|
|
17145
|
-
streaming ? /* @__PURE__ */ jsxRuntime.jsx(lucideReact.Loader2, { className: "size-4 shrink-0 animate-spin", "aria-hidden": "true" }) : /* @__PURE__ */ jsxRuntime.jsx(
|
|
17779
|
+
streaming ? /* @__PURE__ */ jsxRuntime.jsx(lucideReact.Loader2, { className: "size-4 shrink-0 animate-spin", "aria-hidden": "true" }) : /* @__PURE__ */ jsxRuntime.jsx(Icon2, { className: "size-4 shrink-0 text-muted-foreground", "aria-hidden": "true" }),
|
|
17146
17780
|
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "min-w-0 flex-1 truncate", children: title }),
|
|
17147
17781
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
17148
17782
|
lucideReact.ChevronDown,
|
|
@@ -17404,7 +18038,7 @@ function AgentWorkbenchActivity({
|
|
|
17404
18038
|
{
|
|
17405
18039
|
className: cn2("flex justify-end", classNames?.usage),
|
|
17406
18040
|
"aria-label": messages.usage.label,
|
|
17407
|
-
children: /* @__PURE__ */ jsxRuntime.jsx("span", { className: "rounded-full border border-border bg-muted px-2.5 py-1 text-xs text-
|
|
18041
|
+
children: /* @__PURE__ */ jsxRuntime.jsx("span", { className: "rounded-full border border-border bg-muted px-2.5 py-1 text-xs text-foreground", children: messages.usage.context({
|
|
17408
18042
|
used: usage.contextTokens ?? usage.totalTokens ?? 0,
|
|
17409
18043
|
total: contextWindow
|
|
17410
18044
|
}) })
|
|
@@ -17521,12 +18155,12 @@ function formatDate(value, locale) {
|
|
|
17521
18155
|
}).format(date);
|
|
17522
18156
|
}
|
|
17523
18157
|
function Count({ value }) {
|
|
17524
|
-
return /* @__PURE__ */ jsxRuntime.jsx("span", { className: "rounded-full bg-muted px-1.5 py-0.5 text-[10px] font-semibold text-
|
|
18158
|
+
return /* @__PURE__ */ jsxRuntime.jsx("span", { className: "rounded-full bg-muted px-1.5 py-0.5 text-[10px] font-semibold text-foreground", children: value });
|
|
17525
18159
|
}
|
|
17526
18160
|
function DetailsSection({
|
|
17527
18161
|
title,
|
|
17528
18162
|
count,
|
|
17529
|
-
icon:
|
|
18163
|
+
icon: Icon2,
|
|
17530
18164
|
className,
|
|
17531
18165
|
children
|
|
17532
18166
|
}) {
|
|
@@ -17541,7 +18175,7 @@ function DetailsSection({
|
|
|
17541
18175
|
open: true,
|
|
17542
18176
|
children: [
|
|
17543
18177
|
/* @__PURE__ */ jsxRuntime.jsxs("summary", { className: "flex cursor-pointer list-none items-center gap-2 px-3 py-2.5 text-sm font-medium outline-none focus-visible:ring-2 focus-visible:ring-ring [&::-webkit-details-marker]:hidden", children: [
|
|
17544
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
18178
|
+
/* @__PURE__ */ jsxRuntime.jsx(Icon2, { className: "size-4 text-muted-foreground", "aria-hidden": "true" }),
|
|
17545
18179
|
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "min-w-0 flex-1 truncate", children: title }),
|
|
17546
18180
|
/* @__PURE__ */ jsxRuntime.jsx(Count, { value: count }),
|
|
17547
18181
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
@@ -18053,9 +18687,9 @@ function LoginPage({
|
|
|
18053
18687
|
externalPanel,
|
|
18054
18688
|
callout
|
|
18055
18689
|
}) {
|
|
18056
|
-
const availableMethods =
|
|
18690
|
+
const availableMethods = React2.useMemo(() => methods.filter((method) => !method.hidden), [methods]);
|
|
18057
18691
|
const fallbackMethodId = defaultMethodId ?? availableMethods[0]?.id;
|
|
18058
|
-
const [internalMethodId, setInternalMethodId] =
|
|
18692
|
+
const [internalMethodId, setInternalMethodId] = React2.useState(fallbackMethodId);
|
|
18059
18693
|
const currentMethodId = activeMethodId ?? internalMethodId;
|
|
18060
18694
|
const activeMethod = availableMethods.find((method) => method.id === currentMethodId) ?? availableMethods[0];
|
|
18061
18695
|
const hasTabs = availableMethods.length > 1;
|
|
@@ -18067,7 +18701,7 @@ function LoginPage({
|
|
|
18067
18701
|
const { lightUrl: logoLightUrl, darkUrl: logoDarkUrl } = resolveLogoUrls(logo);
|
|
18068
18702
|
const hasLogo = Boolean(logoLightUrl || logoDarkUrl);
|
|
18069
18703
|
const usesSeparateModeLogos = Boolean(logoLightUrl && logoDarkUrl && logoLightUrl !== logoDarkUrl);
|
|
18070
|
-
|
|
18704
|
+
React2.useEffect(() => {
|
|
18071
18705
|
if (!availableMethods.length) {
|
|
18072
18706
|
setInternalMethodId(void 0);
|
|
18073
18707
|
return;
|
|
@@ -18099,7 +18733,7 @@ function LoginPage({
|
|
|
18099
18733
|
]
|
|
18100
18734
|
}
|
|
18101
18735
|
);
|
|
18102
|
-
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
18736
|
+
return /* @__PURE__ */ jsxRuntime.jsx(React2__namespace.default.Fragment, { children: method.render ? method.render(button) : button }, method.id);
|
|
18103
18737
|
};
|
|
18104
18738
|
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
18105
18739
|
"main",
|
|
@@ -18384,7 +19018,7 @@ function readStoredLayout(storageKey, options) {
|
|
|
18384
19018
|
return fallback;
|
|
18385
19019
|
}
|
|
18386
19020
|
}
|
|
18387
|
-
var WorkbenchResizableSidebar =
|
|
19021
|
+
var WorkbenchResizableSidebar = React2.forwardRef(
|
|
18388
19022
|
function WorkbenchResizableSidebar2({
|
|
18389
19023
|
title,
|
|
18390
19024
|
items,
|
|
@@ -18413,7 +19047,7 @@ var WorkbenchResizableSidebar = React.forwardRef(
|
|
|
18413
19047
|
classNames,
|
|
18414
19048
|
style
|
|
18415
19049
|
}, ref) {
|
|
18416
|
-
const initialLayoutRef =
|
|
19050
|
+
const initialLayoutRef = React2.useRef(null);
|
|
18417
19051
|
if (!initialLayoutRef.current) {
|
|
18418
19052
|
initialLayoutRef.current = readStoredLayout(storageKey, {
|
|
18419
19053
|
defaultCollapsed,
|
|
@@ -18422,10 +19056,10 @@ var WorkbenchResizableSidebar = React.forwardRef(
|
|
|
18422
19056
|
maxWidth
|
|
18423
19057
|
});
|
|
18424
19058
|
}
|
|
18425
|
-
const sidebarRef =
|
|
18426
|
-
const [internalCollapsed, setInternalCollapsed] =
|
|
18427
|
-
const [internalWidth, setInternalWidth] =
|
|
18428
|
-
const [isResizing, setIsResizing] =
|
|
19059
|
+
const sidebarRef = React2.useRef(null);
|
|
19060
|
+
const [internalCollapsed, setInternalCollapsed] = React2.useState(initialLayoutRef.current.collapsed);
|
|
19061
|
+
const [internalWidth, setInternalWidth] = React2.useState(initialLayoutRef.current.width);
|
|
19062
|
+
const [isResizing, setIsResizing] = React2.useState(false);
|
|
18429
19063
|
const resolvedCollapsed = collapsed ?? internalCollapsed;
|
|
18430
19064
|
const resolvedWidth = width ?? internalWidth;
|
|
18431
19065
|
const isCollapsedControlled = collapsed !== void 0;
|
|
@@ -18473,14 +19107,14 @@ var WorkbenchResizableSidebar = React.forwardRef(
|
|
|
18473
19107
|
updateWidth(resolvedWidth + 24);
|
|
18474
19108
|
}
|
|
18475
19109
|
};
|
|
18476
|
-
|
|
19110
|
+
React2.useEffect(() => {
|
|
18477
19111
|
if (typeof window === "undefined" || !storageKey) return;
|
|
18478
19112
|
window.localStorage.setItem(storageKey, JSON.stringify({
|
|
18479
19113
|
collapsed: resolvedCollapsed,
|
|
18480
19114
|
width: clampWidth2(resolvedWidth, minWidth, maxWidth)
|
|
18481
19115
|
}));
|
|
18482
19116
|
}, [maxWidth, minWidth, resolvedCollapsed, resolvedWidth, storageKey]);
|
|
18483
|
-
|
|
19117
|
+
React2.useEffect(() => {
|
|
18484
19118
|
if (!isResizing) return void 0;
|
|
18485
19119
|
const handlePointerMove = (event) => {
|
|
18486
19120
|
const sidebarNode = sidebarRef.current;
|
|
@@ -18633,7 +19267,7 @@ function shouldRenderBodyWrapper(props) {
|
|
|
18633
19267
|
props.header || props.footer || props.bodyAs || props.bodyClassName || props.bodyProps || props.classNames?.body
|
|
18634
19268
|
);
|
|
18635
19269
|
}
|
|
18636
|
-
var WorkbenchContentPane =
|
|
19270
|
+
var WorkbenchContentPane = React2.forwardRef(
|
|
18637
19271
|
function WorkbenchContentPane2({
|
|
18638
19272
|
as: Component = "section",
|
|
18639
19273
|
bodyAs: BodyComponent = "div",
|
|
@@ -19049,9 +19683,9 @@ function WorkbenchGallerySettingsButton({
|
|
|
19049
19683
|
...panelProps
|
|
19050
19684
|
}) {
|
|
19051
19685
|
const resolvedLabels = { ...defaultLabels, ...labels };
|
|
19052
|
-
const rootRef =
|
|
19053
|
-
const [uncontrolledOpen, setUncontrolledOpen] =
|
|
19054
|
-
const [popoverStyle, setPopoverStyle] =
|
|
19686
|
+
const rootRef = React2.useRef(null);
|
|
19687
|
+
const [uncontrolledOpen, setUncontrolledOpen] = React2.useState(defaultOpen);
|
|
19688
|
+
const [popoverStyle, setPopoverStyle] = React2.useState({});
|
|
19055
19689
|
const isControlled = open !== void 0;
|
|
19056
19690
|
const isOpen = isControlled ? Boolean(open) : uncontrolledOpen;
|
|
19057
19691
|
const setOpen = (nextOpen) => {
|
|
@@ -19060,7 +19694,7 @@ function WorkbenchGallerySettingsButton({
|
|
|
19060
19694
|
}
|
|
19061
19695
|
onOpenChange?.(nextOpen);
|
|
19062
19696
|
};
|
|
19063
|
-
|
|
19697
|
+
React2.useLayoutEffect(() => {
|
|
19064
19698
|
if (!isOpen) return void 0;
|
|
19065
19699
|
const updatePopoverPosition = () => {
|
|
19066
19700
|
const triggerRect = rootRef.current?.getBoundingClientRect();
|
|
@@ -19206,11 +19840,11 @@ function WorkbenchContentToolbarViewModeControl({
|
|
|
19206
19840
|
onValueChange,
|
|
19207
19841
|
classNames
|
|
19208
19842
|
}) {
|
|
19209
|
-
const rootRef =
|
|
19210
|
-
const [open, setOpen] =
|
|
19843
|
+
const rootRef = React2.useRef(null);
|
|
19844
|
+
const [open, setOpen] = React2.useState(false);
|
|
19211
19845
|
const activeOption = options.find((option) => option.value === value) || options.find((option) => !option.disabled) || options[0];
|
|
19212
19846
|
const activeIcon = activeOption ? getViewModeOptionIcon(activeOption) : null;
|
|
19213
|
-
|
|
19847
|
+
React2.useEffect(() => {
|
|
19214
19848
|
if (!open) return void 0;
|
|
19215
19849
|
const handlePointerDown = (event) => {
|
|
19216
19850
|
if (!rootRef.current?.contains(event.target)) {
|
|
@@ -19287,7 +19921,7 @@ function WorkbenchContentToolbarViewModeControl({
|
|
|
19287
19921
|
) : null
|
|
19288
19922
|
] });
|
|
19289
19923
|
}
|
|
19290
|
-
var WorkbenchContentToolbar =
|
|
19924
|
+
var WorkbenchContentToolbar = React2.forwardRef(
|
|
19291
19925
|
function WorkbenchContentToolbar2({
|
|
19292
19926
|
as: Component = "div",
|
|
19293
19927
|
children,
|
|
@@ -19380,7 +20014,7 @@ function hasRenderableChildren(children) {
|
|
|
19380
20014
|
if (children === null || children === void 0 || typeof children === "boolean") return false;
|
|
19381
20015
|
if (typeof children === "string") return children.trim().length > 0;
|
|
19382
20016
|
if (Array.isArray(children)) return children.some(hasRenderableChildren);
|
|
19383
|
-
const childList =
|
|
20017
|
+
const childList = React2.Children.toArray(children);
|
|
19384
20018
|
if (!childList.length) return false;
|
|
19385
20019
|
return childList.some((child) => typeof child === "string" ? child.trim().length > 0 : true);
|
|
19386
20020
|
}
|
|
@@ -19419,7 +20053,7 @@ function getMediaDisplayData(value) {
|
|
|
19419
20053
|
const isImageUrl = /\.(avif|gif|jpe?g|png|svg|webp)(\?.*)?$/i.test(value);
|
|
19420
20054
|
return isDataImage || isImageUrl ? { src: value } : null;
|
|
19421
20055
|
}
|
|
19422
|
-
if (typeof value !== "object" ||
|
|
20056
|
+
if (typeof value !== "object" || React2.isValidElement(value)) return null;
|
|
19423
20057
|
const media = value;
|
|
19424
20058
|
const src = media.src || media.url || media.thumbnail || media.preview || media.image;
|
|
19425
20059
|
return src ? {
|
|
@@ -19443,7 +20077,7 @@ function renderMaybeFieldIcon(icon, className) {
|
|
|
19443
20077
|
return /* @__PURE__ */ jsxRuntime.jsx("span", { className: cn("inline-flex h-3.5 min-w-3.5 shrink-0 items-center justify-center rounded-sm text-[10px] font-semibold text-primary", className), children: icon });
|
|
19444
20078
|
}
|
|
19445
20079
|
if (typeof icon === "boolean") return null;
|
|
19446
|
-
if (
|
|
20080
|
+
if (React2.isValidElement(icon)) return icon;
|
|
19447
20081
|
const IconComponent = icon;
|
|
19448
20082
|
return /* @__PURE__ */ jsxRuntime.jsx(IconComponent, { className: cn("h-3.5 w-3.5 shrink-0 text-primary", className) });
|
|
19449
20083
|
}
|
|
@@ -19471,7 +20105,7 @@ function WorkbenchDetailSidebarMediaValue({
|
|
|
19471
20105
|
}
|
|
19472
20106
|
function getDefaultDetailDisplayValue(value, emptyValue, field, classNames) {
|
|
19473
20107
|
if (isEmptyDetailValue(value)) return emptyValue;
|
|
19474
|
-
if (
|
|
20108
|
+
if (React2.isValidElement(value)) return value;
|
|
19475
20109
|
if (shouldRenderAsMedia(field, value)) {
|
|
19476
20110
|
const media = getMediaDisplayData(value);
|
|
19477
20111
|
if (media) return /* @__PURE__ */ jsxRuntime.jsx(WorkbenchDetailSidebarMediaValue, { media, classNames });
|
|
@@ -19566,7 +20200,7 @@ function WorkbenchDetailSidebarAutoContent({
|
|
|
19566
20200
|
] }, sectionKey);
|
|
19567
20201
|
}) });
|
|
19568
20202
|
}
|
|
19569
|
-
var WorkbenchDetailSidebar =
|
|
20203
|
+
var WorkbenchDetailSidebar = React2.forwardRef(
|
|
19570
20204
|
function WorkbenchDetailSidebar2({
|
|
19571
20205
|
as: Component = "aside",
|
|
19572
20206
|
bodyAs: BodyComponent = "div",
|
|
@@ -19657,14 +20291,14 @@ var WorkbenchDetailSidebar = React.forwardRef(
|
|
|
19657
20291
|
);
|
|
19658
20292
|
function isWorkbenchIconComponent(icon) {
|
|
19659
20293
|
if (typeof icon === "function") return true;
|
|
19660
|
-
return typeof icon === "object" && icon !== null && !
|
|
20294
|
+
return typeof icon === "object" && icon !== null && !React2.isValidElement(icon) && "$$typeof" in icon;
|
|
19661
20295
|
}
|
|
19662
20296
|
function renderWorkbenchIcon(icon, className) {
|
|
19663
20297
|
if (!icon) return null;
|
|
19664
|
-
if (
|
|
20298
|
+
if (React2.isValidElement(icon)) return icon;
|
|
19665
20299
|
if (isWorkbenchIconComponent(icon)) {
|
|
19666
|
-
const
|
|
19667
|
-
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
20300
|
+
const Icon2 = icon;
|
|
20301
|
+
return /* @__PURE__ */ jsxRuntime.jsx(Icon2, { className });
|
|
19668
20302
|
}
|
|
19669
20303
|
return icon;
|
|
19670
20304
|
}
|
|
@@ -19793,22 +20427,22 @@ function WorkbenchTableView({
|
|
|
19793
20427
|
hiddenRowsMessage
|
|
19794
20428
|
}) {
|
|
19795
20429
|
const columnKeySignature = columns.map((column) => column.key).join("");
|
|
19796
|
-
const defaultColumnOrder =
|
|
19797
|
-
const [internalColumnOrder, setInternalColumnOrder] =
|
|
19798
|
-
const [internalColumnSizes, setInternalColumnSizes] =
|
|
19799
|
-
|
|
20430
|
+
const defaultColumnOrder = React2.useMemo(() => columnKeySignature ? columnKeySignature.split("") : [], [columnKeySignature]);
|
|
20431
|
+
const [internalColumnOrder, setInternalColumnOrder] = React2.useState(defaultColumnOrder);
|
|
20432
|
+
const [internalColumnSizes, setInternalColumnSizes] = React2.useState({});
|
|
20433
|
+
React2.useEffect(() => {
|
|
19800
20434
|
setInternalColumnOrder((current) => normalizeColumnOrder(defaultColumnOrder, current));
|
|
19801
20435
|
}, [defaultColumnOrder]);
|
|
19802
20436
|
const resolvedColumnOrder = columnOrder ? normalizeColumnOrder(defaultColumnOrder, columnOrder) : internalColumnOrder;
|
|
19803
20437
|
const resolvedColumnSizes = columnSizes ?? internalColumnSizes;
|
|
19804
|
-
const handleColumnOrderChange =
|
|
20438
|
+
const handleColumnOrderChange = React2.useCallback((nextOrder, detail) => {
|
|
19805
20439
|
const normalizedOrder = normalizeColumnOrder(defaultColumnOrder, nextOrder);
|
|
19806
20440
|
if (!columnOrder) {
|
|
19807
20441
|
setInternalColumnOrder(normalizedOrder);
|
|
19808
20442
|
}
|
|
19809
20443
|
onColumnOrderChange?.(normalizedOrder, detail);
|
|
19810
20444
|
}, [columnOrder, defaultColumnOrder, onColumnOrderChange]);
|
|
19811
|
-
const handleColumnSizeChange =
|
|
20445
|
+
const handleColumnSizeChange = React2.useCallback((columnId, width, detail) => {
|
|
19812
20446
|
if (!columnSizes) {
|
|
19813
20447
|
setInternalColumnSizes((current) => ({
|
|
19814
20448
|
...current,
|
|
@@ -20205,29 +20839,29 @@ function InteractiveTable({
|
|
|
20205
20839
|
}) {
|
|
20206
20840
|
const internalLabels = useMonkeysLocaleMessages().workbench.interactiveTable;
|
|
20207
20841
|
const columnKeySignature = columns.map((column) => column.key).join("");
|
|
20208
|
-
const defaultOrder =
|
|
20842
|
+
const defaultOrder = React2.useMemo(
|
|
20209
20843
|
() => columnKeySignature ? columnKeySignature.split("") : [],
|
|
20210
20844
|
[columnKeySignature]
|
|
20211
20845
|
);
|
|
20212
|
-
const defaultSizes =
|
|
20846
|
+
const defaultSizes = React2.useMemo(
|
|
20213
20847
|
() => buildDefaultColumnSizes(columns, defaultColumnSizes),
|
|
20214
20848
|
[columns, defaultColumnSizes]
|
|
20215
20849
|
);
|
|
20216
|
-
const [internalColumnOrder, setInternalColumnOrder] =
|
|
20217
|
-
const [internalColumnSizes, setInternalColumnSizes] =
|
|
20218
|
-
const [internalFrozenColumnCount, setInternalFrozenColumnCount] =
|
|
20219
|
-
const [internalFrozenEndColumnCount, setInternalFrozenEndColumnCount] =
|
|
20220
|
-
|
|
20850
|
+
const [internalColumnOrder, setInternalColumnOrder] = React2.useState(defaultOrder);
|
|
20851
|
+
const [internalColumnSizes, setInternalColumnSizes] = React2.useState(() => loadStoredColumnSizes(columnStorageKey, defaultSizes));
|
|
20852
|
+
const [internalFrozenColumnCount, setInternalFrozenColumnCount] = React2.useState(() => loadStoredFrozenColumnCount(columnStorageKey, frozenColumnCount, columns.length));
|
|
20853
|
+
const [internalFrozenEndColumnCount, setInternalFrozenEndColumnCount] = React2.useState(() => loadStoredFrozenEndColumnCount(columnStorageKey, frozenEndColumnCount, columns.length));
|
|
20854
|
+
React2.useEffect(() => {
|
|
20221
20855
|
setInternalColumnOrder((current) => normalizeColumnOrder2(defaultOrder, current));
|
|
20222
20856
|
}, [defaultOrder]);
|
|
20223
|
-
|
|
20857
|
+
React2.useEffect(() => {
|
|
20224
20858
|
if (columnSizes) return;
|
|
20225
20859
|
setInternalColumnSizes(loadStoredColumnSizes(columnStorageKey, defaultSizes));
|
|
20226
20860
|
}, [columnSizes, columnStorageKey, defaultSizes]);
|
|
20227
|
-
|
|
20861
|
+
React2.useEffect(() => {
|
|
20228
20862
|
setInternalFrozenColumnCount(loadStoredFrozenColumnCount(columnStorageKey, frozenColumnCount, columns.length));
|
|
20229
20863
|
}, [columnStorageKey, columns.length, frozenColumnCount]);
|
|
20230
|
-
|
|
20864
|
+
React2.useEffect(() => {
|
|
20231
20865
|
setInternalFrozenEndColumnCount(loadStoredFrozenEndColumnCount(columnStorageKey, frozenEndColumnCount, columns.length));
|
|
20232
20866
|
}, [columnStorageKey, columns.length, frozenEndColumnCount]);
|
|
20233
20867
|
const resolvedColumnOrder = columnOrder ? normalizeColumnOrder2(defaultOrder, columnOrder) : internalColumnOrder;
|
|
@@ -20250,14 +20884,14 @@ function InteractiveTable({
|
|
|
20250
20884
|
resetColumnWidth: columnMenuLabels?.resetColumnWidth ?? internalLabels.resetColumnWidth,
|
|
20251
20885
|
frozenColumnTitle: columnMenuLabels?.frozenColumnTitle ?? internalLabels.frozenColumnTitle
|
|
20252
20886
|
};
|
|
20253
|
-
const handleColumnOrderChange =
|
|
20887
|
+
const handleColumnOrderChange = React2.useCallback((nextOrder, detail) => {
|
|
20254
20888
|
const normalizedOrder = normalizeColumnOrder2(defaultOrder, nextOrder);
|
|
20255
20889
|
if (!columnOrder) {
|
|
20256
20890
|
setInternalColumnOrder(normalizedOrder);
|
|
20257
20891
|
}
|
|
20258
20892
|
onColumnOrderChange?.(normalizedOrder, detail);
|
|
20259
20893
|
}, [columnOrder, defaultOrder, onColumnOrderChange]);
|
|
20260
|
-
const handleColumnSizeChange =
|
|
20894
|
+
const handleColumnSizeChange = React2.useCallback((columnId, width, detail) => {
|
|
20261
20895
|
const column = columns.find((item) => item.key === columnId);
|
|
20262
20896
|
const minWidth = column?.minWidth;
|
|
20263
20897
|
const maxWidth = column?.maxWidth;
|
|
@@ -20275,7 +20909,7 @@ function InteractiveTable({
|
|
|
20275
20909
|
persistColumnSizes(columnStorageKey, nextSizes);
|
|
20276
20910
|
onColumnSizeChange?.(columnId, nextWidth, detail);
|
|
20277
20911
|
}, [columnSizes, columnStorageKey, columns, onColumnSizeChange, resolvedColumnSizes]);
|
|
20278
|
-
const handleResetColumnSize =
|
|
20912
|
+
const handleResetColumnSize = React2.useCallback((column) => {
|
|
20279
20913
|
const nextWidth = defaultSizes[column.key] ?? getColumnDefaultSize(column);
|
|
20280
20914
|
const previousWidth = getColumnNumericWidth(column, resolvedColumnSizes);
|
|
20281
20915
|
const nextSizes = {
|
|
@@ -20294,13 +20928,13 @@ function InteractiveTable({
|
|
|
20294
20928
|
});
|
|
20295
20929
|
onResetColumnSizes?.(nextSizes);
|
|
20296
20930
|
}, [columnSizes, columnStorageKey, defaultSizes, onColumnSizeChange, onResetColumnSizes, resolvedColumnSizes]);
|
|
20297
|
-
const setFrozenColumnCount =
|
|
20931
|
+
const setFrozenColumnCount = React2.useCallback((nextCount) => {
|
|
20298
20932
|
const normalizedCount = clampFrozenColumnCount(nextCount, Math.max(0, orderedColumns.length - resolvedFrozenEndColumnCount));
|
|
20299
20933
|
setInternalFrozenColumnCount(normalizedCount);
|
|
20300
20934
|
persistFrozenColumnCount(columnStorageKey, normalizedCount);
|
|
20301
20935
|
onFrozenColumnCountChange?.(normalizedCount);
|
|
20302
20936
|
}, [columnStorageKey, onFrozenColumnCountChange, orderedColumns.length, resolvedFrozenEndColumnCount]);
|
|
20303
|
-
const setFrozenEndColumnCount =
|
|
20937
|
+
const setFrozenEndColumnCount = React2.useCallback((nextCount) => {
|
|
20304
20938
|
const normalizedCount = clampFrozenColumnCount(nextCount, Math.max(0, orderedColumns.length - resolvedFrozenColumnCount));
|
|
20305
20939
|
setInternalFrozenEndColumnCount(normalizedCount);
|
|
20306
20940
|
persistFrozenEndColumnCount(columnStorageKey, normalizedCount);
|
|
@@ -20553,11 +21187,11 @@ function InteractiveTableEditableTextCell({
|
|
|
20553
21187
|
onCommit
|
|
20554
21188
|
}) {
|
|
20555
21189
|
const initialValue = String(value || "");
|
|
20556
|
-
const [draft, setDraft] =
|
|
20557
|
-
|
|
21190
|
+
const [draft, setDraft] = React2.useState(initialValue);
|
|
21191
|
+
React2.useEffect(() => {
|
|
20558
21192
|
setDraft(initialValue);
|
|
20559
21193
|
}, [initialValue]);
|
|
20560
|
-
const commit =
|
|
21194
|
+
const commit = React2.useCallback(async () => {
|
|
20561
21195
|
const nextValue = String(draft || "").trim();
|
|
20562
21196
|
const previousValue = String(initialValue || "").trim();
|
|
20563
21197
|
if (nextValue === previousValue) return;
|
|
@@ -21085,17 +21719,17 @@ function WorkbenchMasonryLayout({
|
|
|
21085
21719
|
placementStrategy = "shelf",
|
|
21086
21720
|
className
|
|
21087
21721
|
}) {
|
|
21088
|
-
const containerRef =
|
|
21089
|
-
const itemNodesRef =
|
|
21090
|
-
const itemObserverRef =
|
|
21091
|
-
const [containerWidth, setContainerWidth] =
|
|
21092
|
-
const [measuredHeights, setMeasuredHeights] =
|
|
21093
|
-
const itemKeys =
|
|
21722
|
+
const containerRef = React2.useRef(null);
|
|
21723
|
+
const itemNodesRef = React2.useRef(/* @__PURE__ */ new Map());
|
|
21724
|
+
const itemObserverRef = React2.useRef(null);
|
|
21725
|
+
const [containerWidth, setContainerWidth] = React2.useState(0);
|
|
21726
|
+
const [measuredHeights, setMeasuredHeights] = React2.useState({});
|
|
21727
|
+
const itemKeys = React2.useMemo(
|
|
21094
21728
|
() => items.map((item, index) => String(getItemKey(item, index))),
|
|
21095
21729
|
[getItemKey, items]
|
|
21096
21730
|
);
|
|
21097
21731
|
const itemKeysSignature = itemKeys.join("|");
|
|
21098
|
-
|
|
21732
|
+
React2.useEffect(() => {
|
|
21099
21733
|
const node = containerRef.current;
|
|
21100
21734
|
if (!node) return void 0;
|
|
21101
21735
|
const updateWidth = () => {
|
|
@@ -21111,7 +21745,7 @@ function WorkbenchMasonryLayout({
|
|
|
21111
21745
|
window.addEventListener("resize", updateWidth);
|
|
21112
21746
|
return () => window.removeEventListener("resize", updateWidth);
|
|
21113
21747
|
}, []);
|
|
21114
|
-
|
|
21748
|
+
React2.useEffect(() => {
|
|
21115
21749
|
setMeasuredHeights((prev) => {
|
|
21116
21750
|
const next = Object.fromEntries(
|
|
21117
21751
|
Object.entries(prev).filter(([key]) => itemKeys.includes(key))
|
|
@@ -21132,7 +21766,7 @@ function WorkbenchMasonryLayout({
|
|
|
21132
21766
|
gap
|
|
21133
21767
|
});
|
|
21134
21768
|
const resolvedColumnWidth = containerWidth > 0 ? (containerWidth - gap * Math.max(columnCount - 1, 0)) / columnCount : resolvedTargetColumnWidth;
|
|
21135
|
-
const layoutItems =
|
|
21769
|
+
const layoutItems = React2.useMemo(() => items.map((item, index) => {
|
|
21136
21770
|
const key = itemKeys[index];
|
|
21137
21771
|
const size = typeof getItemSize === "function" ? getItemSize(item, {
|
|
21138
21772
|
columnCount,
|
|
@@ -21171,7 +21805,7 @@ function WorkbenchMasonryLayout({
|
|
|
21171
21805
|
resolvedColumnWidth,
|
|
21172
21806
|
rowHeight
|
|
21173
21807
|
]);
|
|
21174
|
-
|
|
21808
|
+
React2.useLayoutEffect(() => {
|
|
21175
21809
|
const nextMeasurements = {};
|
|
21176
21810
|
itemNodesRef.current.forEach((node, key) => {
|
|
21177
21811
|
const nextHeight = Math.ceil(node.getBoundingClientRect().height);
|
|
@@ -21185,7 +21819,7 @@ function WorkbenchMasonryLayout({
|
|
|
21185
21819
|
return areMeasurementMapsEqual(prev, merged) ? prev : merged;
|
|
21186
21820
|
});
|
|
21187
21821
|
}, [columnCount, isDensePlacement, itemKeysSignature, resolvedColumnWidth]);
|
|
21188
|
-
|
|
21822
|
+
React2.useEffect(() => {
|
|
21189
21823
|
if (typeof ResizeObserver !== "function") return void 0;
|
|
21190
21824
|
const observer = new ResizeObserver((entries) => {
|
|
21191
21825
|
setMeasuredHeights((prev) => {
|
|
@@ -21685,8 +22319,8 @@ function WorkbenchGalleryView({
|
|
|
21685
22319
|
formatLabel,
|
|
21686
22320
|
getMasonryItemSize
|
|
21687
22321
|
}) {
|
|
21688
|
-
const containerRef =
|
|
21689
|
-
const [containerWidth, setContainerWidth] =
|
|
22322
|
+
const containerRef = React2.useRef(null);
|
|
22323
|
+
const [containerWidth, setContainerWidth] = React2.useState(0);
|
|
21690
22324
|
const { min: resolvedMinCardWidth, ideal: resolvedIdealCardWidth, max: resolvedMaxCardWidth } = getGalleryCardWidthMetrics(galleryDensity);
|
|
21691
22325
|
const resolvedRailCardWidth = galleryRailCardWidth || resolvedMinCardWidth;
|
|
21692
22326
|
const resolvedGridColumnCount = getNormalizedGalleryGridColumns(galleryGridColumns);
|
|
@@ -21706,7 +22340,7 @@ function WorkbenchGalleryView({
|
|
|
21706
22340
|
const resolvedIsTitleCandidate = isTitleCandidate || ((column, row) => isDefaultGalleryTitleCandidate(column, row, { isMediaColumn: resolvedIsMediaColumn }));
|
|
21707
22341
|
const resolvedIsSummaryCandidate = isSummaryCandidate || ((column, row) => isDefaultGallerySummaryCandidate(column, row, { isMediaColumn: resolvedIsMediaColumn }));
|
|
21708
22342
|
const resolvedRenderFieldValue = renderFieldValue || ((column, row, { compact } = {}) => /* @__PURE__ */ jsxRuntime.jsx("span", { children: resolvedGetDisplayText(resolvedGetFieldValue(column, row)) }));
|
|
21709
|
-
|
|
22343
|
+
React2.useEffect(() => {
|
|
21710
22344
|
if (isMasonry || isRailLayout || resolvedGridCardWidth) return void 0;
|
|
21711
22345
|
const node = containerRef.current;
|
|
21712
22346
|
if (!node) return void 0;
|
|
@@ -21723,7 +22357,7 @@ function WorkbenchGalleryView({
|
|
|
21723
22357
|
window.addEventListener("resize", updateWidth);
|
|
21724
22358
|
return () => window.removeEventListener("resize", updateWidth);
|
|
21725
22359
|
}, [isMasonry, isRailLayout, resolvedGridCardWidth]);
|
|
21726
|
-
const layoutStyle =
|
|
22360
|
+
const layoutStyle = React2.useMemo(() => getGalleryGridLayoutStyle({
|
|
21727
22361
|
isRailLayout,
|
|
21728
22362
|
railCardWidth: resolvedRailCardWidth,
|
|
21729
22363
|
fixedCardWidth: resolvedGridCardWidth,
|
|
@@ -21940,17 +22574,17 @@ function WorkbenchLaneView({
|
|
|
21940
22574
|
classNames,
|
|
21941
22575
|
style
|
|
21942
22576
|
}) {
|
|
21943
|
-
const [activeRowId, setActiveRowId] =
|
|
22577
|
+
const [activeRowId, setActiveRowId] = React2.useState(null);
|
|
21944
22578
|
const sensors = core.useSensors(core.useSensor(core.PointerSensor, { activationConstraint: { distance: activationDistance } }));
|
|
21945
|
-
const columnMap =
|
|
21946
|
-
const rowEntries =
|
|
22579
|
+
const columnMap = React2.useMemo(() => new Map(columns.map((column) => [column.id, column])), [columns]);
|
|
22580
|
+
const rowEntries = React2.useMemo(() => rows.map((row, rowIndex) => ({
|
|
21947
22581
|
row,
|
|
21948
22582
|
rowIndex,
|
|
21949
22583
|
rowId: getRowId(row, rowIndex),
|
|
21950
22584
|
columnId: getColumnId(row, rowIndex)
|
|
21951
22585
|
})), [getColumnId, getRowId, rows]);
|
|
21952
22586
|
const activeEntry = activeRowId ? rowEntries.find((entry) => entry.rowId === activeRowId) : void 0;
|
|
21953
|
-
const rowsByColumn =
|
|
22587
|
+
const rowsByColumn = React2.useMemo(() => {
|
|
21954
22588
|
const next = /* @__PURE__ */ new Map();
|
|
21955
22589
|
columns.forEach((column) => next.set(column.id, []));
|
|
21956
22590
|
rowEntries.forEach(({ row, rowIndex, rowId, columnId }) => {
|
|
@@ -21959,10 +22593,10 @@ function WorkbenchLaneView({
|
|
|
21959
22593
|
return next;
|
|
21960
22594
|
}, [columns, rowEntries]);
|
|
21961
22595
|
const activeColumn = activeEntry ? columnMap.get(activeEntry.columnId) : void 0;
|
|
21962
|
-
const handleDragStart =
|
|
22596
|
+
const handleDragStart = React2.useCallback((event) => {
|
|
21963
22597
|
setActiveRowId(String(event.active.id));
|
|
21964
22598
|
}, []);
|
|
21965
|
-
const handleDragEnd =
|
|
22599
|
+
const handleDragEnd = React2.useCallback((event) => {
|
|
21966
22600
|
setActiveRowId(null);
|
|
21967
22601
|
const rowId = String(event.active.id);
|
|
21968
22602
|
const nextColumnId = String(event.over?.id ?? "");
|
|
@@ -21970,7 +22604,7 @@ function WorkbenchLaneView({
|
|
|
21970
22604
|
if (!activeRow || !columnMap.has(nextColumnId) || activeRow.columnId === nextColumnId) return;
|
|
21971
22605
|
onMoveRow?.(rowId, nextColumnId, activeRow.row);
|
|
21972
22606
|
}, [columnMap, onMoveRow, rowEntries]);
|
|
21973
|
-
const handleDragCancel =
|
|
22607
|
+
const handleDragCancel = React2.useCallback(() => {
|
|
21974
22608
|
setActiveRowId(null);
|
|
21975
22609
|
}, []);
|
|
21976
22610
|
return /* @__PURE__ */ jsxRuntime.jsxs(core.DndContext, { sensors, onDragStart: handleDragStart, onDragEnd: handleDragEnd, onDragCancel: handleDragCancel, children: [
|
|
@@ -23319,7 +23953,7 @@ function cn3(...classNames) {
|
|
|
23319
23953
|
return classNames.filter(Boolean).join(" ");
|
|
23320
23954
|
}
|
|
23321
23955
|
function isToastInput(input) {
|
|
23322
|
-
if (!input || typeof input !== "object" ||
|
|
23956
|
+
if (!input || typeof input !== "object" || React2.isValidElement(input)) {
|
|
23323
23957
|
return false;
|
|
23324
23958
|
}
|
|
23325
23959
|
return "title" in input || "description" in input || "variant" in input;
|
|
@@ -23454,10 +24088,10 @@ function MonkeysToastProvider({ children, toasterProps }) {
|
|
|
23454
24088
|
] });
|
|
23455
24089
|
}
|
|
23456
24090
|
function useToastOnValue(value, options = {}) {
|
|
23457
|
-
const previousSignatureRef =
|
|
24091
|
+
const previousSignatureRef = React2.useRef(null);
|
|
23458
24092
|
const localeMessages = useMonkeysLocaleMessages().toast;
|
|
23459
24093
|
const translate = options.translate;
|
|
23460
|
-
|
|
24094
|
+
React2.useEffect(() => {
|
|
23461
24095
|
if (!value) {
|
|
23462
24096
|
previousSignatureRef.current = null;
|
|
23463
24097
|
return;
|
|
@@ -23510,10 +24144,10 @@ function useToastOnValue(value, options = {}) {
|
|
|
23510
24144
|
]);
|
|
23511
24145
|
}
|
|
23512
24146
|
function useToastFeed(items, options = {}) {
|
|
23513
|
-
const previousVisibleSignaturesRef =
|
|
24147
|
+
const previousVisibleSignaturesRef = React2.useRef(/* @__PURE__ */ new Set());
|
|
23514
24148
|
const localeMessages = useMonkeysLocaleMessages().toast;
|
|
23515
24149
|
const translate = options.translate;
|
|
23516
|
-
const emitItem =
|
|
24150
|
+
const emitItem = React2.useCallback(
|
|
23517
24151
|
(item, index, visibleSignatures) => {
|
|
23518
24152
|
const variant = item.variant ?? "info";
|
|
23519
24153
|
const title = translateMessage(
|
|
@@ -23546,7 +24180,7 @@ function useToastFeed(items, options = {}) {
|
|
|
23546
24180
|
},
|
|
23547
24181
|
[localeMessages, options.messages, translate]
|
|
23548
24182
|
);
|
|
23549
|
-
|
|
24183
|
+
React2.useEffect(() => {
|
|
23550
24184
|
const visibleSignatures = /* @__PURE__ */ new Set();
|
|
23551
24185
|
items.forEach((item, index) => {
|
|
23552
24186
|
if (item) {
|
|
@@ -23732,55 +24366,55 @@ function RenderNodeHost({
|
|
|
23732
24366
|
...props
|
|
23733
24367
|
}) {
|
|
23734
24368
|
const Component = as;
|
|
23735
|
-
const hostRef =
|
|
23736
|
-
const [viewportWidth, setViewportWidth] =
|
|
23737
|
-
const [mountedNodeId, setMountedNodeId] =
|
|
24369
|
+
const hostRef = React2.useRef(null);
|
|
24370
|
+
const [viewportWidth, setViewportWidth] = React2.useState(() => typeof window === "undefined" ? void 0 : window.innerWidth);
|
|
24371
|
+
const [mountedNodeId, setMountedNodeId] = React2.useState(() => shouldMountNode(node, active, visible) ? node.nodeId : void 0);
|
|
23738
24372
|
const policyMounted = shouldMountNode(node, active, visible);
|
|
23739
|
-
|
|
24373
|
+
React2.useEffect(() => {
|
|
23740
24374
|
if (node.responsive.length === 0 || typeof window === "undefined") return void 0;
|
|
23741
24375
|
const handleResize = () => setViewportWidth(window.innerWidth);
|
|
23742
24376
|
handleResize();
|
|
23743
24377
|
window.addEventListener("resize", handleResize, { passive: true });
|
|
23744
24378
|
return () => window.removeEventListener("resize", handleResize);
|
|
23745
24379
|
}, [node.responsive.length]);
|
|
23746
|
-
const resolvedLayout =
|
|
23747
|
-
|
|
24380
|
+
const resolvedLayout = React2.useMemo(() => resolveRenderNodeLayout(node, viewportWidth), [node, viewportWidth]);
|
|
24381
|
+
React2.useEffect(() => {
|
|
23748
24382
|
if (!active || !visible || !node.lifecycle.deepLink || !["page", "record"].includes(node.kind)) return;
|
|
23749
24383
|
const element = hostRef.current;
|
|
23750
24384
|
if (!element || element.style.display === "contents") return;
|
|
23751
24385
|
element.focus({ preventScroll: true });
|
|
23752
24386
|
}, [active, node.kind, node.lifecycle.deepLink, node.nodeId, visible]);
|
|
23753
|
-
|
|
24387
|
+
React2.useEffect(() => {
|
|
23754
24388
|
if (policyMounted) setMountedNodeId(node.nodeId);
|
|
23755
24389
|
else if (!node.lifecycle.retainOnDeactivate) setMountedNodeId(void 0);
|
|
23756
24390
|
}, [node.lifecycle.retainOnDeactivate, node.nodeId, policyMounted]);
|
|
23757
|
-
const policyState =
|
|
24391
|
+
const policyState = React2.useMemo(() => resolveRenderNodePolicyState(node, {
|
|
23758
24392
|
active,
|
|
23759
24393
|
visible,
|
|
23760
24394
|
manualQueryEnabled,
|
|
23761
24395
|
previouslyMounted: mountedNodeId === node.nodeId
|
|
23762
24396
|
}), [active, manualQueryEnabled, mountedNodeId, node, visible]);
|
|
23763
|
-
const activate =
|
|
24397
|
+
const activate = React2.useCallback(() => {
|
|
23764
24398
|
onActivate?.(node.activation, node);
|
|
23765
24399
|
}, [node, onActivate]);
|
|
23766
|
-
const setManualQueryEnabled =
|
|
24400
|
+
const setManualQueryEnabled = React2.useCallback((enabled) => {
|
|
23767
24401
|
onManualQueryEnabledChange?.(enabled, node);
|
|
23768
24402
|
}, [node, onManualQueryEnabledChange]);
|
|
23769
|
-
const runtimeState =
|
|
24403
|
+
const runtimeState = React2.useMemo(() => ({
|
|
23770
24404
|
...policyState,
|
|
23771
24405
|
activate,
|
|
23772
24406
|
setManualQueryEnabled
|
|
23773
24407
|
}), [activate, policyState, setManualQueryEnabled]);
|
|
23774
|
-
|
|
24408
|
+
React2.useEffect(() => {
|
|
23775
24409
|
onRuntimeStateChange?.(policyState, node);
|
|
23776
24410
|
}, [node, onRuntimeStateChange, policyState]);
|
|
23777
|
-
const setHostRef =
|
|
24411
|
+
const setHostRef = React2.useCallback((value) => {
|
|
23778
24412
|
hostRef.current = value;
|
|
23779
24413
|
assignRef4(elementRef, value);
|
|
23780
24414
|
}, [elementRef]);
|
|
23781
24415
|
const scrollAdapter = scrollRestoration === false ? void 0 : scrollRestoration;
|
|
23782
24416
|
const restoresHostScroll = scrollAdapter !== void 0 && node.scroll.owner !== "provider" && !node.scroll.virtualizationBoundary && node.scroll.axis !== "none" && node.scroll.restoreKey !== void 0;
|
|
23783
|
-
const readPosition =
|
|
24417
|
+
const readPosition = React2.useCallback(() => {
|
|
23784
24418
|
const element = hostRef.current;
|
|
23785
24419
|
if (!element) return { x: 0, y: 0 };
|
|
23786
24420
|
return {
|
|
@@ -23788,7 +24422,7 @@ function RenderNodeHost({
|
|
|
23788
24422
|
y: node.scroll.axis === "x" ? 0 : element.scrollTop
|
|
23789
24423
|
};
|
|
23790
24424
|
}, [node.scroll.axis]);
|
|
23791
|
-
|
|
24425
|
+
React2.useEffect(() => {
|
|
23792
24426
|
if (!policyState.mounted || !restoresHostScroll || !scrollAdapter) return void 0;
|
|
23793
24427
|
const key = node.scroll.restoreKey;
|
|
23794
24428
|
const element = hostRef.current;
|
|
@@ -23928,10 +24562,10 @@ function OverlayNodeHost({
|
|
|
23928
24562
|
onRuntimeStateChange,
|
|
23929
24563
|
onOpenChange
|
|
23930
24564
|
}) {
|
|
23931
|
-
const historyEntryOwnedRef =
|
|
23932
|
-
const initializedUrlRef =
|
|
24565
|
+
const historyEntryOwnedRef = React2.useRef(false);
|
|
24566
|
+
const initializedUrlRef = React2.useRef(false);
|
|
23933
24567
|
const zIndex = getOverlayZIndex(node.zIndexLane);
|
|
23934
|
-
const syncUrl =
|
|
24568
|
+
const syncUrl = React2.useCallback((nextOpen) => {
|
|
23935
24569
|
if (!node.renderNode.lifecycle.deepLink || historyAdapter === false) return;
|
|
23936
24570
|
const currentUrl = historyAdapter.getCurrentUrl();
|
|
23937
24571
|
if (isOverlayUrlActive(node, currentUrl) === nextOpen) return;
|
|
@@ -23954,11 +24588,11 @@ function OverlayNodeHost({
|
|
|
23954
24588
|
historyEntryOwnedRef.current = false;
|
|
23955
24589
|
}
|
|
23956
24590
|
}, [historyAdapter, node]);
|
|
23957
|
-
const requestOpenChange =
|
|
24591
|
+
const requestOpenChange = React2.useCallback((nextOpen) => {
|
|
23958
24592
|
syncUrl(nextOpen);
|
|
23959
24593
|
onOpenChange(nextOpen);
|
|
23960
24594
|
}, [onOpenChange, syncUrl]);
|
|
23961
|
-
|
|
24595
|
+
React2.useEffect(() => {
|
|
23962
24596
|
if (!node.renderNode.lifecycle.deepLink || historyAdapter === false) return void 0;
|
|
23963
24597
|
const urlOpen = isOverlayUrlActive(node, historyAdapter.getCurrentUrl());
|
|
23964
24598
|
if (!initializedUrlRef.current) {
|
|
@@ -23974,12 +24608,12 @@ function OverlayNodeHost({
|
|
|
23974
24608
|
if (nextOpen !== open) onOpenChange(nextOpen);
|
|
23975
24609
|
});
|
|
23976
24610
|
}, [historyAdapter, node, onOpenChange, open, syncUrl]);
|
|
23977
|
-
|
|
24611
|
+
React2.useEffect(() => {
|
|
23978
24612
|
if (!open || !node.renderNode.lifecycle.focusReturn || typeof document === "undefined") return void 0;
|
|
23979
24613
|
const target = focusReturnRef?.current ?? (document.activeElement instanceof HTMLElement ? document.activeElement : null);
|
|
23980
24614
|
return () => scheduleFocus(focusReturnRef?.current ?? target);
|
|
23981
24615
|
}, [focusReturnRef, node.renderNode.lifecycle.focusReturn, open]);
|
|
23982
|
-
const renderNodeAttributes =
|
|
24616
|
+
const renderNodeAttributes = React2.useMemo(
|
|
23983
24617
|
() => getRenderNodeDataAttributes(node.renderNode),
|
|
23984
24618
|
[node.renderNode]
|
|
23985
24619
|
);
|
|
@@ -24588,7 +25222,7 @@ function LoadingIcon2() {
|
|
|
24588
25222
|
}
|
|
24589
25223
|
);
|
|
24590
25224
|
}
|
|
24591
|
-
var DataExplorerButton =
|
|
25225
|
+
var DataExplorerButton = React2.forwardRef(function DataExplorerButton2({
|
|
24592
25226
|
children,
|
|
24593
25227
|
label,
|
|
24594
25228
|
icon,
|
|
@@ -25743,7 +26377,7 @@ function DataExplorerDisplayActionMenu({
|
|
|
25743
26377
|
className,
|
|
25744
26378
|
classNames
|
|
25745
26379
|
}) {
|
|
25746
|
-
const [open, setOpen] =
|
|
26380
|
+
const [open, setOpen] = React2.useState(false);
|
|
25747
26381
|
const theme = resolveDataExplorerAppearance(appearance);
|
|
25748
26382
|
const context = {
|
|
25749
26383
|
itemId,
|
|
@@ -26404,13 +27038,13 @@ function DataExplorerViewCollection({
|
|
|
26404
27038
|
);
|
|
26405
27039
|
const measuredGridGap = resolveNonNegativeNumber(measuredGridOptions?.gap, 8);
|
|
26406
27040
|
const measuredGridMinColumnWidth = measuredGridOptions?.minColumnWidth ?? "220px";
|
|
26407
|
-
const measuredElementsRef =
|
|
26408
|
-
const measuredCallbacksRef =
|
|
26409
|
-
const measuredSpansRef =
|
|
26410
|
-
const resizeObserverRef =
|
|
26411
|
-
const [, setMeasuredLayoutVersion] =
|
|
27041
|
+
const measuredElementsRef = React2.useRef(/* @__PURE__ */ new Map());
|
|
27042
|
+
const measuredCallbacksRef = React2.useRef(/* @__PURE__ */ new Map());
|
|
27043
|
+
const measuredSpansRef = React2.useRef(/* @__PURE__ */ new Map());
|
|
27044
|
+
const resizeObserverRef = React2.useRef(null);
|
|
27045
|
+
const [, setMeasuredLayoutVersion] = React2.useState(0);
|
|
26412
27046
|
const resolveItemStyle = typeof itemStyle === "function" ? (props) => itemStyle(props) : () => itemStyle;
|
|
26413
|
-
|
|
27047
|
+
React2.useEffect(() => {
|
|
26414
27048
|
if (!measuredGridEnabled || typeof ResizeObserver === "undefined") {
|
|
26415
27049
|
return void 0;
|
|
26416
27050
|
}
|
|
@@ -26446,7 +27080,7 @@ function DataExplorerViewCollection({
|
|
|
26446
27080
|
}
|
|
26447
27081
|
};
|
|
26448
27082
|
}, [measuredGridEnabled, measuredGridGap, measuredGridRowHeight]);
|
|
26449
|
-
|
|
27083
|
+
React2.useEffect(() => {
|
|
26450
27084
|
if (!measuredGridEnabled) {
|
|
26451
27085
|
measuredElementsRef.current.clear();
|
|
26452
27086
|
measuredCallbacksRef.current.clear();
|
|
@@ -26473,7 +27107,7 @@ function DataExplorerViewCollection({
|
|
|
26473
27107
|
setMeasuredLayoutVersion((version2) => version2 + 1);
|
|
26474
27108
|
}
|
|
26475
27109
|
}, [measuredGridEnabled, resolvedItems, resolveItemId]);
|
|
26476
|
-
const getMeasuredRef =
|
|
27110
|
+
const getMeasuredRef = React2.useCallback((itemId) => {
|
|
26477
27111
|
const cached = measuredCallbacksRef.current.get(itemId);
|
|
26478
27112
|
if (cached) return cached;
|
|
26479
27113
|
const callback = (node) => {
|
|
@@ -26584,7 +27218,7 @@ function DataExplorerViewCollection({
|
|
|
26584
27218
|
} : resolvedStyle;
|
|
26585
27219
|
if (!wrapItems) {
|
|
26586
27220
|
if (!measuredGridEnabled) {
|
|
26587
|
-
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
27221
|
+
return /* @__PURE__ */ jsxRuntime.jsx(React2.Fragment, { children: renderedItem }, itemId);
|
|
26588
27222
|
}
|
|
26589
27223
|
return /* @__PURE__ */ jsxRuntime.jsx("div", { className: itemClassName, style: measuredStyle, children: /* @__PURE__ */ jsxRuntime.jsx("div", { ref: getMeasuredRef(itemId), children: renderedItem }) }, itemId);
|
|
26590
27224
|
}
|
|
@@ -26836,21 +27470,21 @@ function DataExplorerImagePreview({
|
|
|
26836
27470
|
appearance ?? { background: "dark-stage" }
|
|
26837
27471
|
);
|
|
26838
27472
|
const imageSrc = typeof src === "string" ? src.trim() : "";
|
|
26839
|
-
const stageRef =
|
|
26840
|
-
const stageSizeRef =
|
|
26841
|
-
const viewRef =
|
|
26842
|
-
const draggingRef =
|
|
26843
|
-
const [naturalSize, setNaturalSize] =
|
|
26844
|
-
const [dragging, setDragging] =
|
|
26845
|
-
const [{ scale: scale3, translateX, translateY }, setView] =
|
|
27473
|
+
const stageRef = React2.useRef(null);
|
|
27474
|
+
const stageSizeRef = React2.useRef(null);
|
|
27475
|
+
const viewRef = React2.useRef({ scale: 1, translateX: stagePadding, translateY: stagePadding });
|
|
27476
|
+
const draggingRef = React2.useRef(void 0);
|
|
27477
|
+
const [naturalSize, setNaturalSize] = React2.useState(null);
|
|
27478
|
+
const [dragging, setDragging] = React2.useState(false);
|
|
27479
|
+
const [{ scale: scale3, translateX, translateY }, setView] = React2.useState(() => ({
|
|
26846
27480
|
scale: 1,
|
|
26847
27481
|
translateX: stagePadding,
|
|
26848
27482
|
translateY: stagePadding
|
|
26849
27483
|
}));
|
|
26850
|
-
|
|
27484
|
+
React2.useEffect(() => {
|
|
26851
27485
|
viewRef.current = { scale: scale3, translateX, translateY };
|
|
26852
27486
|
}, [scale3, translateX, translateY]);
|
|
26853
|
-
|
|
27487
|
+
React2.useEffect(() => {
|
|
26854
27488
|
setNaturalSize(null);
|
|
26855
27489
|
setView({ scale: 1, translateX: stagePadding, translateY: stagePadding });
|
|
26856
27490
|
}, [imageSrc, stagePadding]);
|
|
@@ -26858,7 +27492,7 @@ function DataExplorerImagePreview({
|
|
|
26858
27492
|
const normalizedMaxScale = Number.isFinite(maxScale) ? Math.max(normalizedMinScale, maxScale) : MAX_SAFE_SCALE;
|
|
26859
27493
|
const normalizedZoomStep = Number.isFinite(zoomStep) && zoomStep > 1 ? zoomStep : DEFAULT_ZOOM_STEP;
|
|
26860
27494
|
const normalizedStagePadding = Number.isFinite(stagePadding) && stagePadding >= 0 ? stagePadding : DEFAULT_STAGE_PADDING;
|
|
26861
|
-
const resetView =
|
|
27495
|
+
const resetView = React2.useCallback(
|
|
26862
27496
|
(nextNaturalSize) => {
|
|
26863
27497
|
const stage = stageRef.current;
|
|
26864
27498
|
const size = nextNaturalSize ?? naturalSize;
|
|
@@ -26893,7 +27527,7 @@ function DataExplorerImagePreview({
|
|
|
26893
27527
|
},
|
|
26894
27528
|
[naturalSize, normalizedMaxScale, normalizedMinScale, normalizedStagePadding]
|
|
26895
27529
|
);
|
|
26896
|
-
const compensateStageResize =
|
|
27530
|
+
const compensateStageResize = React2.useCallback((width, height) => {
|
|
26897
27531
|
if (!Number.isFinite(width) || !Number.isFinite(height)) return;
|
|
26898
27532
|
if (width <= 0 || height <= 0) return;
|
|
26899
27533
|
const previous = stageSizeRef.current;
|
|
@@ -26908,7 +27542,7 @@ function DataExplorerImagePreview({
|
|
|
26908
27542
|
translateY: current.translateY + deltaY
|
|
26909
27543
|
}));
|
|
26910
27544
|
}, [imageSrc]);
|
|
26911
|
-
|
|
27545
|
+
React2.useLayoutEffect(() => {
|
|
26912
27546
|
const stage = stageRef.current;
|
|
26913
27547
|
if (!stage) return;
|
|
26914
27548
|
compensateStageResize(stage.clientWidth, stage.clientHeight);
|
|
@@ -26927,7 +27561,7 @@ function DataExplorerImagePreview({
|
|
|
26927
27561
|
window.addEventListener("resize", handleResize);
|
|
26928
27562
|
return () => window.removeEventListener("resize", handleResize);
|
|
26929
27563
|
}, [compensateStageResize]);
|
|
26930
|
-
const zoomAtPoint =
|
|
27564
|
+
const zoomAtPoint = React2.useCallback(
|
|
26931
27565
|
(factor, stageX, stageY) => {
|
|
26932
27566
|
if (!Number.isFinite(factor) || factor === 1) return;
|
|
26933
27567
|
if (!Number.isFinite(stageX) || !Number.isFinite(stageY)) return;
|
|
@@ -26950,7 +27584,7 @@ function DataExplorerImagePreview({
|
|
|
26950
27584
|
},
|
|
26951
27585
|
[normalizedMaxScale, normalizedMinScale]
|
|
26952
27586
|
);
|
|
26953
|
-
|
|
27587
|
+
React2.useEffect(() => {
|
|
26954
27588
|
const stage = stageRef.current;
|
|
26955
27589
|
if (!stage || !imageSrc || !naturalSize) return;
|
|
26956
27590
|
const handleWheel = (event) => {
|
|
@@ -26965,7 +27599,7 @@ function DataExplorerImagePreview({
|
|
|
26965
27599
|
stage.addEventListener("wheel", handleWheel, { passive: false });
|
|
26966
27600
|
return () => stage.removeEventListener("wheel", handleWheel);
|
|
26967
27601
|
}, [imageSrc, naturalSize, normalizedZoomStep, zoomAtPoint]);
|
|
26968
|
-
const handlePointerDown =
|
|
27602
|
+
const handlePointerDown = React2.useCallback(
|
|
26969
27603
|
(event) => {
|
|
26970
27604
|
if (event.button !== 0) return;
|
|
26971
27605
|
if (!imageSrc || !naturalSize) return;
|
|
@@ -26985,7 +27619,7 @@ function DataExplorerImagePreview({
|
|
|
26985
27619
|
},
|
|
26986
27620
|
[imageSrc, naturalSize]
|
|
26987
27621
|
);
|
|
26988
|
-
const handlePointerMove =
|
|
27622
|
+
const handlePointerMove = React2.useCallback((event) => {
|
|
26989
27623
|
const drag = draggingRef.current;
|
|
26990
27624
|
if (!drag || drag.pointerId !== event.pointerId) return;
|
|
26991
27625
|
event.preventDefault();
|
|
@@ -26995,7 +27629,7 @@ function DataExplorerImagePreview({
|
|
|
26995
27629
|
translateY: drag.startTranslateY + event.clientY - drag.startClientY
|
|
26996
27630
|
});
|
|
26997
27631
|
}, []);
|
|
26998
|
-
const endDrag =
|
|
27632
|
+
const endDrag = React2.useCallback((event) => {
|
|
26999
27633
|
const drag = draggingRef.current;
|
|
27000
27634
|
if (!drag || drag.pointerId !== event.pointerId) return;
|
|
27001
27635
|
draggingRef.current = void 0;
|
|
@@ -27005,7 +27639,7 @@ function DataExplorerImagePreview({
|
|
|
27005
27639
|
stage.releasePointerCapture(event.pointerId);
|
|
27006
27640
|
}
|
|
27007
27641
|
}, []);
|
|
27008
|
-
const handleDoubleClick =
|
|
27642
|
+
const handleDoubleClick = React2.useCallback(
|
|
27009
27643
|
(event) => {
|
|
27010
27644
|
if (!imageSrc || !naturalSize) return;
|
|
27011
27645
|
if (isNoDragTarget(event.target)) return;
|
|
@@ -27013,7 +27647,7 @@ function DataExplorerImagePreview({
|
|
|
27013
27647
|
},
|
|
27014
27648
|
[imageSrc, naturalSize, resetView]
|
|
27015
27649
|
);
|
|
27016
|
-
const handleZoomButtonClick =
|
|
27650
|
+
const handleZoomButtonClick = React2.useCallback(
|
|
27017
27651
|
(factor) => {
|
|
27018
27652
|
const stage = stageRef.current;
|
|
27019
27653
|
if (!stage || !naturalSize) return;
|
|
@@ -27889,7 +28523,7 @@ function DataExplorerViewTree({
|
|
|
27889
28523
|
const loadingContent = loadingNode ?? labels?.loading ?? internalLabels.loading;
|
|
27890
28524
|
const emptyContent = empty ?? labels?.empty ?? internalLabels.empty;
|
|
27891
28525
|
const hasExplicitGroups = Array.isArray(groups);
|
|
27892
|
-
const resolvedGroups =
|
|
28526
|
+
const resolvedGroups = React2.useMemo(
|
|
27893
28527
|
() => {
|
|
27894
28528
|
if (hasExplicitGroups) {
|
|
27895
28529
|
return groups;
|
|
@@ -27905,19 +28539,19 @@ function DataExplorerViewTree({
|
|
|
27905
28539
|
},
|
|
27906
28540
|
[groups, hasExplicitGroups, nodes]
|
|
27907
28541
|
);
|
|
27908
|
-
const flattenedNodeMap =
|
|
28542
|
+
const flattenedNodeMap = React2.useMemo(
|
|
27909
28543
|
() => buildFlattenedNodeMap(resolvedGroups),
|
|
27910
28544
|
[resolvedGroups]
|
|
27911
28545
|
);
|
|
27912
|
-
const [internalExpandedNodeIds, setInternalExpandedNodeIds] =
|
|
28546
|
+
const [internalExpandedNodeIds, setInternalExpandedNodeIds] = React2.useState(
|
|
27913
28547
|
() => buildDefaultNodeExpandedSet(resolvedGroups, defaultExpandedNodeIds)
|
|
27914
28548
|
);
|
|
27915
|
-
const [internalExpandedGroupIds, setInternalExpandedGroupIds] =
|
|
28549
|
+
const [internalExpandedGroupIds, setInternalExpandedGroupIds] = React2.useState(
|
|
27916
28550
|
() => buildDefaultGroupExpandedSet(resolvedGroups, defaultExpandedGroupIds)
|
|
27917
28551
|
);
|
|
27918
|
-
const [draggingNodeId, setDraggingNodeId] =
|
|
27919
|
-
const [dragOverNodeId, setDragOverNodeId] =
|
|
27920
|
-
|
|
28552
|
+
const [draggingNodeId, setDraggingNodeId] = React2.useState();
|
|
28553
|
+
const [dragOverNodeId, setDragOverNodeId] = React2.useState();
|
|
28554
|
+
React2.useEffect(() => {
|
|
27921
28555
|
setInternalExpandedNodeIds(
|
|
27922
28556
|
buildDefaultNodeExpandedSet(resolvedGroups, defaultExpandedNodeIds)
|
|
27923
28557
|
);
|
|
@@ -28555,7 +29189,7 @@ function DarkModeSelector({
|
|
|
28555
29189
|
className: "z-50 min-w-[8rem] rounded-md border border-[hsl(var(--border))] bg-[hsl(var(--popover))] p-1 text-[hsl(var(--popover-foreground))] shadow-md animate-in fade-in-0 zoom-in-95",
|
|
28556
29190
|
sideOffset: 5,
|
|
28557
29191
|
align: "end",
|
|
28558
|
-
children: options.map(({ value, label, Icon }) => /* @__PURE__ */ jsxRuntime.jsxs(
|
|
29192
|
+
children: options.map(({ value, label, Icon: Icon2 }) => /* @__PURE__ */ jsxRuntime.jsxs(
|
|
28559
29193
|
DropdownMenu2__namespace.Item,
|
|
28560
29194
|
{
|
|
28561
29195
|
className: cn5(
|
|
@@ -28564,7 +29198,7 @@ function DarkModeSelector({
|
|
|
28564
29198
|
),
|
|
28565
29199
|
onSelect: () => onModeChange(value),
|
|
28566
29200
|
children: [
|
|
28567
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
29201
|
+
/* @__PURE__ */ jsxRuntime.jsx(Icon2, { className: "h-4 w-4" }),
|
|
28568
29202
|
label
|
|
28569
29203
|
]
|
|
28570
29204
|
},
|
|
@@ -28631,7 +29265,7 @@ function DarkModeSubMenu({
|
|
|
28631
29265
|
{
|
|
28632
29266
|
className: "z-50 min-w-[8rem] rounded-md border border-[hsl(var(--border))] bg-[hsl(var(--popover))] p-1 text-[hsl(var(--popover-foreground))] shadow-md animate-in fade-in-0 zoom-in-95",
|
|
28633
29267
|
sideOffset: 8,
|
|
28634
|
-
children: options.map(({ value, label: optLabel, Icon }) => /* @__PURE__ */ jsxRuntime.jsxs(
|
|
29268
|
+
children: options.map(({ value, label: optLabel, Icon: Icon2 }) => /* @__PURE__ */ jsxRuntime.jsxs(
|
|
28635
29269
|
DropdownMenu2__namespace.CheckboxItem,
|
|
28636
29270
|
{
|
|
28637
29271
|
checked: mode === value,
|
|
@@ -28642,7 +29276,7 @@ function DarkModeSubMenu({
|
|
|
28642
29276
|
onCheckedChange: () => onModeChange(value),
|
|
28643
29277
|
children: [
|
|
28644
29278
|
/* @__PURE__ */ jsxRuntime.jsx(DropdownMenu2__namespace.ItemIndicator, { className: "absolute left-2 inline-flex items-center justify-center", children: /* @__PURE__ */ jsxRuntime.jsx("svg", { xmlns: "http://www.w3.org/2000/svg", width: "12", height: "12", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round", children: /* @__PURE__ */ jsxRuntime.jsx("path", { d: "M20 6 9 17l-5-5" }) }) }),
|
|
28645
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
29279
|
+
/* @__PURE__ */ jsxRuntime.jsx(Icon2, { className: "h-4 w-4" }),
|
|
28646
29280
|
optLabel
|
|
28647
29281
|
]
|
|
28648
29282
|
},
|
|
@@ -28746,19 +29380,19 @@ function applyClass(resolved) {
|
|
|
28746
29380
|
}
|
|
28747
29381
|
}
|
|
28748
29382
|
function useDarkMode() {
|
|
28749
|
-
const [mode, setModeState] =
|
|
28750
|
-
const [resolvedMode, setResolvedMode] =
|
|
28751
|
-
const setMode =
|
|
29383
|
+
const [mode, setModeState] = React2.useState(getStoredMode);
|
|
29384
|
+
const [resolvedMode, setResolvedMode] = React2.useState(() => resolve(mode));
|
|
29385
|
+
const setMode = React2.useCallback((next) => {
|
|
28752
29386
|
localStorage.setItem(STORAGE_KEY, next);
|
|
28753
29387
|
setModeState(next);
|
|
28754
29388
|
const r = resolve(next);
|
|
28755
29389
|
setResolvedMode(r);
|
|
28756
29390
|
applyClass(r);
|
|
28757
29391
|
}, []);
|
|
28758
|
-
|
|
29392
|
+
React2.useEffect(() => {
|
|
28759
29393
|
applyClass(resolvedMode);
|
|
28760
29394
|
}, []);
|
|
28761
|
-
|
|
29395
|
+
React2.useEffect(() => {
|
|
28762
29396
|
if (mode !== "auto") return;
|
|
28763
29397
|
const mql = window.matchMedia("(prefers-color-scheme: dark)");
|
|
28764
29398
|
const handler = (e) => {
|
|
@@ -28773,6 +29407,7 @@ function useDarkMode() {
|
|
|
28773
29407
|
}
|
|
28774
29408
|
|
|
28775
29409
|
exports.AgentWorkbenchActivity = AgentWorkbenchActivity;
|
|
29410
|
+
exports.AgentWorkbenchSidebar = AgentWorkbenchSidebar;
|
|
28776
29411
|
exports.AgentWorkbenchTaskDetails = AgentWorkbenchTaskDetails;
|
|
28777
29412
|
exports.AgentWorkbenchTool = AgentWorkbenchTool;
|
|
28778
29413
|
exports.AppHeader = AppHeader;
|