@mastra/playground-ui 34.1.0-alpha.3 → 35.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +188 -0
- package/dist/{code-block-CcVa6fM8.cjs → code-block-C4Zp_ewI.cjs} +18 -7
- package/dist/code-block-C4Zp_ewI.cjs.map +1 -0
- package/dist/{code-block-DPy5IAR8.js → code-block-CnRVTecy.js} +18 -7
- package/dist/code-block-CnRVTecy.js.map +1 -0
- package/dist/components/CodeBlock.cjs.js +1 -1
- package/dist/components/CodeBlock.es.js +1 -1
- package/dist/components/DateTimePicker.cjs.js +1 -1
- package/dist/components/DateTimePicker.es.js +1 -1
- package/dist/components/DateTimeRangePicker.cjs.js +1 -1
- package/dist/components/DateTimeRangePicker.es.js +1 -1
- package/dist/components/MainSidebar.cjs.js +1 -1
- package/dist/components/MainSidebar.es.js +1 -1
- package/dist/components/Popover.cjs.js +1 -1
- package/dist/components/Popover.es.js +1 -1
- package/dist/components/PropertyFilter.cjs.js +1 -1
- package/dist/components/PropertyFilter.es.js +1 -1
- package/dist/components/Tabs.cjs.js +1 -1
- package/dist/components/Tabs.es.js +1 -1
- package/dist/{date-time-picker-t67keTZg.js → date-time-picker-BKSdFrHR.js} +2 -2
- package/dist/{date-time-picker-t67keTZg.js.map → date-time-picker-BKSdFrHR.js.map} +1 -1
- package/dist/{date-time-picker-BKqGpw5w.cjs → date-time-picker-Bjr6V3AR.cjs} +2 -2
- package/dist/{date-time-picker-BKqGpw5w.cjs.map → date-time-picker-Bjr6V3AR.cjs.map} +1 -1
- package/dist/{date-time-range-picker-iMvwOfiZ.js → date-time-range-picker-DKvS9c4j.js} +2 -2
- package/dist/{date-time-range-picker-iMvwOfiZ.js.map → date-time-range-picker-DKvS9c4j.js.map} +1 -1
- package/dist/{date-time-range-picker-Do-3VVvo.cjs → date-time-range-picker-DjcVeD-Z.cjs} +2 -2
- package/dist/{date-time-range-picker-Do-3VVvo.cjs.map → date-time-range-picker-DjcVeD-Z.cjs.map} +1 -1
- package/dist/index.cjs.js +344 -26
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.css +114 -26
- package/dist/index.es.js +349 -32
- package/dist/index.es.js.map +1 -1
- package/dist/{main-sidebar-Bk2U9O57.js → main-sidebar-1GVDTtcD.js} +16 -33
- package/dist/main-sidebar-1GVDTtcD.js.map +1 -0
- package/dist/{main-sidebar-CWoM-yrH.cjs → main-sidebar-Djs_3tGw.cjs} +16 -33
- package/dist/main-sidebar-Djs_3tGw.cjs.map +1 -0
- package/dist/{popover-ttQgAb0m.cjs → popover-B8RFw-D-.cjs} +12 -2
- package/dist/popover-B8RFw-D-.cjs.map +1 -0
- package/dist/{popover-CRLP2Ay_.js → popover-C65fxQ7m.js} +12 -2
- package/dist/popover-C65fxQ7m.js.map +1 -0
- package/dist/{property-filter-creator-CnuA0Otn.js → property-filter-creator-B9tK0VY3.js} +2 -2
- package/dist/{property-filter-creator-CnuA0Otn.js.map → property-filter-creator-B9tK0VY3.js.map} +1 -1
- package/dist/{property-filter-creator-Cl7xhaML.cjs → property-filter-creator-DU8pl6-6.cjs} +2 -2
- package/dist/{property-filter-creator-Cl7xhaML.cjs.map → property-filter-creator-DU8pl6-6.cjs.map} +1 -1
- package/dist/src/ds/components/CodeBlock/code-block.d.ts +3 -1
- package/dist/src/ds/components/Popover/popover.d.ts +1 -1
- package/dist/src/hooks/use-is-mobile.d.ts +1 -0
- package/dist/src/index.d.ts +4 -1
- package/dist/src/lib/resize/collapsible-panel.d.ts +1 -1
- package/dist/src/lib/resize/panel-drawer.d.ts +8 -0
- package/dist/src/lib/resize/panel-edge-icon.d.ts +4 -0
- package/dist/src/lib/resize/panel-icon-button.d.ts +1 -0
- package/dist/src/lib/resize/use-clamped-element-cursor.d.ts +16 -0
- package/dist/{tabs-tab-Cjv_3xGC.js → tabs-tab-Bv9aRRTl.js} +15 -15
- package/dist/tabs-tab-Bv9aRRTl.js.map +1 -0
- package/dist/{tabs-tab-Dl9FqQhm.cjs → tabs-tab-CulV7e_n.cjs} +15 -15
- package/dist/tabs-tab-CulV7e_n.cjs.map +1 -0
- package/package.json +7 -7
- package/dist/code-block-CcVa6fM8.cjs.map +0 -1
- package/dist/code-block-DPy5IAR8.js.map +0 -1
- package/dist/main-sidebar-Bk2U9O57.js.map +0 -1
- package/dist/main-sidebar-CWoM-yrH.cjs.map +0 -1
- package/dist/popover-CRLP2Ay_.js.map +0 -1
- package/dist/popover-ttQgAb0m.cjs.map +0 -1
- package/dist/src/hooks/index.d.ts +0 -3
- package/dist/src/lib/resize/index.d.ts +0 -2
- package/dist/tabs-tab-Cjv_3xGC.js.map +0 -1
- package/dist/tabs-tab-Dl9FqQhm.cjs.map +0 -1
package/dist/index.cjs.js
CHANGED
|
@@ -26,7 +26,7 @@ const multiCombobox = require('./multi-combobox-DkFLK64B.cjs');
|
|
|
26
26
|
const combobox$1 = require('@base-ui/react/combobox');
|
|
27
27
|
const command = require('./command-D0tQ1Lpz.cjs');
|
|
28
28
|
const code = require('./code-B3WONxnA.cjs');
|
|
29
|
-
const codeBlock = require('./code-block-
|
|
29
|
+
const codeBlock = require('./code-block-C4Zp_ewI.cjs');
|
|
30
30
|
const copyButton = require('./copy-button-BaAuAgdC.cjs');
|
|
31
31
|
const dashboardCard = require('./dashboard-card-B9enj4NG.cjs');
|
|
32
32
|
const dialog = require('./dialog-46zkb32X.cjs');
|
|
@@ -47,8 +47,8 @@ const label = require('./label-U8omtW8w.cjs');
|
|
|
47
47
|
const markdownRenderer = require('./markdown-renderer-DyUlVfRt.cjs');
|
|
48
48
|
const metricsCard = require('./metrics-card-hs1pqY2Y.cjs');
|
|
49
49
|
const metricsFlexGrid = require('./metrics-flex-grid-DzlyAgr7.cjs');
|
|
50
|
-
const popover = require('./popover-
|
|
51
|
-
const propertyFilterCreator = require('./property-filter-creator-
|
|
50
|
+
const popover = require('./popover-B8RFw-D-.cjs');
|
|
51
|
+
const propertyFilterCreator = require('./property-filter-creator-DU8pl6-6.cjs');
|
|
52
52
|
const radioGroup = require('./radio-group-CcZMn-TY.cjs');
|
|
53
53
|
const scrollArea = require('./scroll-area-BqJfcT94.cjs');
|
|
54
54
|
const pendingIndicator = require('./pending-indicator-BxD-kwEk.cjs');
|
|
@@ -68,16 +68,16 @@ const buttonsGroup = require('./buttons-group-BvLg2kpv.cjs');
|
|
|
68
68
|
const mainContent = require('./main-content-CnmMWNin.cjs');
|
|
69
69
|
const mainHeader = require('./main-header-DJLRceP9.cjs');
|
|
70
70
|
const sections = require('./sections-BgrvBjOR.cjs');
|
|
71
|
-
const dateTimePicker = require('./date-time-picker-
|
|
71
|
+
const dateTimePicker = require('./date-time-picker-Bjr6V3AR.cjs');
|
|
72
72
|
const timePicker = require('./time-picker-DWrxHBfR.cjs');
|
|
73
73
|
const components_JSONSchemaForm = require('./components/JSONSchemaForm.cjs.js');
|
|
74
74
|
const keyValueList = require('./key-value-list-D067I300.cjs');
|
|
75
|
-
const mainSidebar = require('./main-sidebar-
|
|
75
|
+
const mainSidebar = require('./main-sidebar-Djs_3tGw.cjs');
|
|
76
76
|
const pageHeader = require('./page-header-C1ZlL4Ua.cjs');
|
|
77
77
|
const section = require('./section-muObW4n-.cjs');
|
|
78
78
|
const sectionCard = require('./section-card-23Os1QRs.cjs');
|
|
79
79
|
const processStepProgressBar = require('./process-step-progress-bar-D74Y-8Jo.cjs');
|
|
80
|
-
const tabsTab = require('./tabs-tab-
|
|
80
|
+
const tabsTab = require('./tabs-tab-CulV7e_n.cjs');
|
|
81
81
|
const tabsContent = require('./tabs-content-m86TGI_b.cjs');
|
|
82
82
|
const getShortId = require('./get-short-id-DtN4BmrD.cjs');
|
|
83
83
|
const contentBlock = require('./content-block-Csb01oxE.cjs');
|
|
@@ -102,7 +102,7 @@ const dataCodeSection = require('./data-code-section-BtFzBCox.cjs');
|
|
|
102
102
|
const components_DataDetailsPanel = require('./components/DataDetailsPanel.cjs.js');
|
|
103
103
|
const dataKeysAndValues = require('./data-keys-and-values-Spy2O_IE.cjs');
|
|
104
104
|
const dataPanel = require('./data-panel-DToYF7cH.cjs');
|
|
105
|
-
const dateTimeRangePicker = require('./date-time-range-picker-
|
|
105
|
+
const dateTimeRangePicker = require('./date-time-range-picker-DjcVeD-Z.cjs');
|
|
106
106
|
const horizontalBars = require('./horizontal-bars-C9qp4r47.cjs');
|
|
107
107
|
const metricsDataTable = require('./metrics-data-table-D7vx2WEJ.cjs');
|
|
108
108
|
const metricsLineChart = require('./metrics-line-chart-D1ZGVepo.cjs');
|
|
@@ -116,12 +116,12 @@ const transitions = require('./transitions-DpczSjmD.cjs');
|
|
|
116
116
|
const useCopyToClipboard = require('./use-copy-to-clipboard-CQgIuR1c.cjs');
|
|
117
117
|
const React = require('react');
|
|
118
118
|
const utils = require('./utils-vA5sWo9W.cjs');
|
|
119
|
-
const zustand = require('zustand');
|
|
120
|
-
const middleware = require('zustand/middleware');
|
|
121
119
|
const jsxRuntime = require('react/jsx-runtime');
|
|
122
120
|
const lucideReact = require('lucide-react');
|
|
123
121
|
const reactResizablePanels = require('react-resizable-panels');
|
|
124
122
|
const Icon = require('./Icon-C_Ooy-cP.cjs');
|
|
123
|
+
const zustand = require('zustand');
|
|
124
|
+
const middleware = require('zustand/middleware');
|
|
125
125
|
const dateFns = require('date-fns');
|
|
126
126
|
const observability = require('@mastra/core/observability');
|
|
127
127
|
const metricsKpiCard = require('./metrics-kpi-card-D_SaIWBc.cjs');
|
|
@@ -1426,6 +1426,19 @@ const useInView = () => {
|
|
|
1426
1426
|
return { inView, setRef };
|
|
1427
1427
|
};
|
|
1428
1428
|
|
|
1429
|
+
const useIsMobile = (breakpoint = 1024) => {
|
|
1430
|
+
const query = React.useMemo(() => `(max-width: ${breakpoint - 1}px)`, [breakpoint]);
|
|
1431
|
+
const [isMobile, setIsMobile] = React.useState(false);
|
|
1432
|
+
React.useLayoutEffect(() => {
|
|
1433
|
+
const mq = window.matchMedia(query);
|
|
1434
|
+
const update = () => setIsMobile(mq.matches);
|
|
1435
|
+
update();
|
|
1436
|
+
mq.addEventListener("change", update);
|
|
1437
|
+
return () => mq.removeEventListener("change", update);
|
|
1438
|
+
}, [query]);
|
|
1439
|
+
return isMobile;
|
|
1440
|
+
};
|
|
1441
|
+
|
|
1429
1442
|
const lodashTitleCase = (str) => {
|
|
1430
1443
|
const camelCased = str.replace(/[-_\s]+(.)?/g, (_, char) => char ? char.toUpperCase() : "").replace(/^(.)/, (char) => char.toLowerCase());
|
|
1431
1444
|
return camelCased.replace(/([A-Z])/g, " $1").replace(/^./, (str2) => str2.toUpperCase()).trim();
|
|
@@ -2160,33 +2173,315 @@ const RuleBuilder = ({
|
|
|
2160
2173
|
return /* @__PURE__ */ jsxRuntime.jsx("div", { className, children: /* @__PURE__ */ jsxRuntime.jsx(RuleGroupView, { schema, group: ruleGroup, onChange: handleGroupChange, depth: 0, maxDepth }) });
|
|
2161
2174
|
};
|
|
2162
2175
|
|
|
2163
|
-
const
|
|
2176
|
+
const PanelEdgeIcon = ({ side }) => /* @__PURE__ */ jsxRuntime.jsxs(
|
|
2177
|
+
"svg",
|
|
2178
|
+
{
|
|
2179
|
+
viewBox: "0 0 24 24",
|
|
2180
|
+
fill: "none",
|
|
2181
|
+
stroke: "currentColor",
|
|
2182
|
+
strokeWidth: "2",
|
|
2183
|
+
strokeLinecap: "round",
|
|
2184
|
+
strokeLinejoin: "round",
|
|
2185
|
+
"aria-hidden": "true",
|
|
2186
|
+
children: [
|
|
2187
|
+
/* @__PURE__ */ jsxRuntime.jsx("rect", { x: "3", y: "3", width: "18", height: "18", rx: "5" }),
|
|
2188
|
+
/* @__PURE__ */ jsxRuntime.jsx("path", { d: side === "left" ? "M9 3v18" : "M15 3v18" })
|
|
2189
|
+
]
|
|
2190
|
+
}
|
|
2191
|
+
);
|
|
2192
|
+
|
|
2193
|
+
const panelIconButtonClass = utils.cn(
|
|
2194
|
+
"flex size-8 cursor-pointer items-center justify-center rounded-full",
|
|
2195
|
+
"border border-transparent bg-transparent text-neutral5 hover:bg-neutral6/5 hover:text-neutral6 active:bg-neutral6/10",
|
|
2196
|
+
"transition-colors duration-150 ease-out-custom motion-reduce:transition-none",
|
|
2197
|
+
"focus-visible:outline-hidden focus-visible:border-accent1"
|
|
2198
|
+
);
|
|
2199
|
+
|
|
2200
|
+
const clamp = (value, min, max) => Math.min(max, Math.max(min, value));
|
|
2201
|
+
const readAxis = (point, rect, axis) => {
|
|
2202
|
+
return { client: point.clientY, start: rect.top, size: rect.height };
|
|
2203
|
+
};
|
|
2204
|
+
const getClampedElementCursorOffset = (point, rect, axis, margin = 0) => {
|
|
2205
|
+
const { client, start, size } = readAxis(point, rect);
|
|
2206
|
+
return clamp(client - start, margin, Math.max(margin, size - margin));
|
|
2207
|
+
};
|
|
2208
|
+
const useClampedElementCursor = ({
|
|
2209
|
+
axis,
|
|
2210
|
+
margin = 0,
|
|
2211
|
+
variableName
|
|
2212
|
+
}) => {
|
|
2213
|
+
const elementRef = React.useRef(null);
|
|
2214
|
+
const rectRef = React.useRef(null);
|
|
2215
|
+
const writePosition = React.useCallback(
|
|
2216
|
+
(point, refreshRect = false) => {
|
|
2217
|
+
const element = elementRef.current;
|
|
2218
|
+
if (!element) return;
|
|
2219
|
+
const rect = refreshRect || !rectRef.current ? element.getBoundingClientRect() : rectRef.current;
|
|
2220
|
+
rectRef.current = rect;
|
|
2221
|
+
const offset = getClampedElementCursorOffset(point, rect, axis, margin);
|
|
2222
|
+
element.style.setProperty(variableName, `${offset}px`);
|
|
2223
|
+
},
|
|
2224
|
+
[axis, margin, variableName]
|
|
2225
|
+
);
|
|
2226
|
+
const beginTracking = React.useCallback(
|
|
2227
|
+
(point) => {
|
|
2228
|
+
writePosition(point, true);
|
|
2229
|
+
},
|
|
2230
|
+
[writePosition]
|
|
2231
|
+
);
|
|
2232
|
+
const updateTracking = React.useCallback(
|
|
2233
|
+
(point) => {
|
|
2234
|
+
writePosition(point);
|
|
2235
|
+
},
|
|
2236
|
+
[writePosition]
|
|
2237
|
+
);
|
|
2238
|
+
const endTracking = React.useCallback(() => {
|
|
2239
|
+
rectRef.current = null;
|
|
2240
|
+
}, []);
|
|
2241
|
+
return { beginTracking, elementRef, endTracking, updateTracking };
|
|
2242
|
+
};
|
|
2243
|
+
|
|
2244
|
+
const PILL_EDGE_MARGIN = 22;
|
|
2245
|
+
const usePanelSizeTransitions = (elementRef) => {
|
|
2246
|
+
const [booted, setBooted] = React.useState(false);
|
|
2247
|
+
const bootedRef = React.useRef(false);
|
|
2248
|
+
const bootScheduled = React.useRef(false);
|
|
2249
|
+
const enableSizeTransitionsRef = React.useRef(() => {
|
|
2250
|
+
});
|
|
2251
|
+
const enableSizeTransitions = React.useCallback(() => {
|
|
2252
|
+
enableSizeTransitionsRef.current();
|
|
2253
|
+
}, []);
|
|
2254
|
+
const boot = React.useCallback(() => {
|
|
2255
|
+
if (bootScheduled.current) return;
|
|
2256
|
+
bootScheduled.current = true;
|
|
2257
|
+
requestAnimationFrame(() => {
|
|
2258
|
+
bootedRef.current = true;
|
|
2259
|
+
setBooted(true);
|
|
2260
|
+
enableSizeTransitionsRef.current();
|
|
2261
|
+
});
|
|
2262
|
+
}, []);
|
|
2263
|
+
React.useEffect(() => {
|
|
2264
|
+
if (window.matchMedia("(prefers-reduced-motion: reduce)").matches) return;
|
|
2265
|
+
const group = elementRef.current?.parentElement;
|
|
2266
|
+
if (!group) return;
|
|
2267
|
+
const panels = Array.from(group.children).filter(
|
|
2268
|
+
(child) => child instanceof HTMLElement && child.hasAttribute("data-panel")
|
|
2269
|
+
);
|
|
2270
|
+
const separators = Array.from(group.children).filter(
|
|
2271
|
+
(child) => child instanceof HTMLElement && child.hasAttribute("data-separator")
|
|
2272
|
+
);
|
|
2273
|
+
const enable = () => {
|
|
2274
|
+
if (!bootedRef.current) return;
|
|
2275
|
+
panels.forEach(
|
|
2276
|
+
(panel) => panel.style.transition = "flex-grow 300ms var(--ease-out-custom, ease), flex-basis 300ms var(--ease-out-custom, ease)"
|
|
2277
|
+
);
|
|
2278
|
+
};
|
|
2279
|
+
const disable = () => panels.forEach((panel) => panel.style.transition = "none");
|
|
2280
|
+
enable();
|
|
2281
|
+
enableSizeTransitionsRef.current = enable;
|
|
2282
|
+
separators.forEach((separator) => separator.addEventListener("pointerdown", disable));
|
|
2283
|
+
window.addEventListener("pointerup", enable);
|
|
2284
|
+
window.addEventListener("pointercancel", enable);
|
|
2285
|
+
return () => {
|
|
2286
|
+
enableSizeTransitionsRef.current = () => {
|
|
2287
|
+
};
|
|
2288
|
+
separators.forEach((separator) => separator.removeEventListener("pointerdown", disable));
|
|
2289
|
+
window.removeEventListener("pointerup", enable);
|
|
2290
|
+
window.removeEventListener("pointercancel", enable);
|
|
2291
|
+
panels.forEach((panel) => panel.style.transition = "");
|
|
2292
|
+
};
|
|
2293
|
+
}, [elementRef]);
|
|
2294
|
+
return { booted, boot, enableSizeTransitions };
|
|
2295
|
+
};
|
|
2296
|
+
const useCollapsedEdgePill = ({
|
|
2297
|
+
collapsed,
|
|
2298
|
+
direction,
|
|
2299
|
+
elementRef
|
|
2300
|
+
}) => {
|
|
2301
|
+
const expandButtonRef = React.useRef(null);
|
|
2302
|
+
const pillRef = React.useRef(null);
|
|
2303
|
+
const {
|
|
2304
|
+
beginTracking: beginPillTracking,
|
|
2305
|
+
elementRef: stripRef,
|
|
2306
|
+
endTracking: endPillTracking,
|
|
2307
|
+
updateTracking: updatePillTracking
|
|
2308
|
+
} = useClampedElementCursor({
|
|
2309
|
+
axis: "y",
|
|
2310
|
+
margin: PILL_EDGE_MARGIN,
|
|
2311
|
+
variableName: "--pill-y"
|
|
2312
|
+
});
|
|
2313
|
+
const setEdgeHovered = React.useCallback((hovered) => {
|
|
2314
|
+
const expandButton = expandButtonRef.current;
|
|
2315
|
+
const pill = pillRef.current;
|
|
2316
|
+
if (expandButton) expandButton.dataset.edgeHovered = hovered ? "true" : "false";
|
|
2317
|
+
if (pill) pill.dataset.edgeHovered = hovered ? "true" : "false";
|
|
2318
|
+
}, []);
|
|
2319
|
+
const spawnPill = React.useCallback(
|
|
2320
|
+
(point) => {
|
|
2321
|
+
const pill = pillRef.current;
|
|
2322
|
+
if (!pill) return;
|
|
2323
|
+
beginPillTracking(point);
|
|
2324
|
+
pill.style.transitionProperty = "opacity, translate";
|
|
2325
|
+
requestAnimationFrame(() => {
|
|
2326
|
+
pill.style.transitionProperty = "";
|
|
2327
|
+
});
|
|
2328
|
+
},
|
|
2329
|
+
[beginPillTracking]
|
|
2330
|
+
);
|
|
2331
|
+
const trackPillPosition = React.useCallback(
|
|
2332
|
+
(point) => {
|
|
2333
|
+
updatePillTracking(point);
|
|
2334
|
+
},
|
|
2335
|
+
[updatePillTracking]
|
|
2336
|
+
);
|
|
2337
|
+
React.useEffect(() => {
|
|
2338
|
+
if (!collapsed) return;
|
|
2339
|
+
const panelElement = elementRef.current;
|
|
2340
|
+
const separator = direction === "left" ? panelElement?.nextElementSibling : panelElement?.previousElementSibling;
|
|
2341
|
+
if (!(separator instanceof HTMLElement) || !separator.hasAttribute("data-separator")) return;
|
|
2342
|
+
const show = (event) => {
|
|
2343
|
+
setEdgeHovered(true);
|
|
2344
|
+
spawnPill(event);
|
|
2345
|
+
};
|
|
2346
|
+
const hide = () => {
|
|
2347
|
+
setEdgeHovered(false);
|
|
2348
|
+
endPillTracking();
|
|
2349
|
+
};
|
|
2350
|
+
const follow = (event) => trackPillPosition(event);
|
|
2351
|
+
separator.addEventListener("pointerenter", show);
|
|
2352
|
+
separator.addEventListener("pointerleave", hide);
|
|
2353
|
+
separator.addEventListener("pointermove", follow);
|
|
2354
|
+
return () => {
|
|
2355
|
+
separator.removeEventListener("pointerenter", show);
|
|
2356
|
+
separator.removeEventListener("pointerleave", hide);
|
|
2357
|
+
separator.removeEventListener("pointermove", follow);
|
|
2358
|
+
setEdgeHovered(false);
|
|
2359
|
+
endPillTracking();
|
|
2360
|
+
};
|
|
2361
|
+
}, [collapsed, direction, elementRef, endPillTracking, setEdgeHovered, spawnPill, trackPillPosition]);
|
|
2362
|
+
return { endPillTracking, expandButtonRef, stripRef, pillRef, spawnPill, trackPillPosition };
|
|
2363
|
+
};
|
|
2364
|
+
const CollapsiblePanel = ({
|
|
2365
|
+
collapsedSize,
|
|
2366
|
+
children,
|
|
2367
|
+
direction,
|
|
2368
|
+
className,
|
|
2369
|
+
onResize,
|
|
2370
|
+
style,
|
|
2371
|
+
minSize,
|
|
2372
|
+
...props
|
|
2373
|
+
}) => {
|
|
2164
2374
|
const [collapsed, setCollapsed] = React.useState(false);
|
|
2165
2375
|
const panelRef = reactResizablePanels.usePanelRef();
|
|
2166
|
-
const
|
|
2376
|
+
const elementRef = React.useRef(null);
|
|
2377
|
+
const { booted, boot, enableSizeTransitions } = usePanelSizeTransitions(elementRef);
|
|
2378
|
+
const { endPillTracking, expandButtonRef, stripRef, pillRef, spawnPill, trackPillPosition } = useCollapsedEdgePill({
|
|
2379
|
+
collapsed,
|
|
2380
|
+
direction,
|
|
2381
|
+
elementRef
|
|
2382
|
+
});
|
|
2383
|
+
const expand = React.useCallback(() => {
|
|
2384
|
+
enableSizeTransitions();
|
|
2167
2385
|
if (!panelRef.current) return;
|
|
2168
2386
|
panelRef.current.expand();
|
|
2169
|
-
};
|
|
2170
|
-
|
|
2387
|
+
}, [enableSizeTransitions, panelRef]);
|
|
2388
|
+
const numericMinSize = typeof minSize === "number" ? minSize : null;
|
|
2389
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
2171
2390
|
reactResizablePanels.Panel,
|
|
2172
2391
|
{
|
|
2173
2392
|
panelRef,
|
|
2393
|
+
elementRef,
|
|
2174
2394
|
collapsedSize,
|
|
2395
|
+
minSize,
|
|
2396
|
+
className: utils.cn("relative", className),
|
|
2397
|
+
style: {
|
|
2398
|
+
overflow: collapsed ? "visible" : "hidden",
|
|
2399
|
+
"--panel-min-w": numericMinSize ? `${numericMinSize}px` : void 0,
|
|
2400
|
+
...style
|
|
2401
|
+
},
|
|
2175
2402
|
...props,
|
|
2176
|
-
onResize: (size,
|
|
2177
|
-
|
|
2178
|
-
|
|
2179
|
-
|
|
2180
|
-
|
|
2181
|
-
setCollapsed(false);
|
|
2182
|
-
}
|
|
2183
|
-
}
|
|
2184
|
-
onResize?.(size, id, prevSize);
|
|
2403
|
+
onResize: (size, previousSize, panel) => {
|
|
2404
|
+
onResize?.(size, previousSize, panel);
|
|
2405
|
+
if (typeof collapsedSize !== "number") return;
|
|
2406
|
+
setCollapsed(size.inPixels <= collapsedSize);
|
|
2407
|
+
boot();
|
|
2185
2408
|
},
|
|
2186
|
-
children:
|
|
2187
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
2188
|
-
|
|
2189
|
-
|
|
2409
|
+
children: [
|
|
2410
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
2411
|
+
"div",
|
|
2412
|
+
{
|
|
2413
|
+
inert: collapsed,
|
|
2414
|
+
"data-state": collapsed ? "collapsed" : "open",
|
|
2415
|
+
"data-direction": direction,
|
|
2416
|
+
style: {
|
|
2417
|
+
minWidth: "var(--panel-min-w)",
|
|
2418
|
+
opacity: collapsed ? 0 : void 0,
|
|
2419
|
+
translate: collapsed ? direction === "left" ? "-100% 0" : "100% 0" : void 0
|
|
2420
|
+
},
|
|
2421
|
+
className: utils.cn(
|
|
2422
|
+
"absolute inset-y-0 w-full overflow-hidden",
|
|
2423
|
+
"transition-[opacity,translate] duration-300 ease-out-custom motion-reduce:transition-none",
|
|
2424
|
+
"data-[direction=left]:left-0 data-[direction=right]:right-0",
|
|
2425
|
+
"data-[state=collapsed]:z-10",
|
|
2426
|
+
!booted && "transition-none"
|
|
2427
|
+
),
|
|
2428
|
+
children
|
|
2429
|
+
}
|
|
2430
|
+
),
|
|
2431
|
+
collapsed && /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
|
|
2432
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
2433
|
+
"button",
|
|
2434
|
+
{
|
|
2435
|
+
ref: expandButtonRef,
|
|
2436
|
+
type: "button",
|
|
2437
|
+
"aria-label": "Expand panel",
|
|
2438
|
+
onClick: expand,
|
|
2439
|
+
className: utils.cn(
|
|
2440
|
+
panelIconButtonClass,
|
|
2441
|
+
"absolute top-2 z-10",
|
|
2442
|
+
"transition-[color,background-color,opacity] duration-300 starting:opacity-0",
|
|
2443
|
+
direction === "left" ? "left-2" : "right-2",
|
|
2444
|
+
"data-[edge-hovered=true]:text-neutral6"
|
|
2445
|
+
),
|
|
2446
|
+
children: /* @__PURE__ */ jsxRuntime.jsx(Icon.Icon, { children: /* @__PURE__ */ jsxRuntime.jsx(PanelEdgeIcon, { side: direction }) })
|
|
2447
|
+
}
|
|
2448
|
+
),
|
|
2449
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
2450
|
+
"button",
|
|
2451
|
+
{
|
|
2452
|
+
ref: stripRef,
|
|
2453
|
+
type: "button",
|
|
2454
|
+
tabIndex: -1,
|
|
2455
|
+
"aria-hidden": "true",
|
|
2456
|
+
onClick: expand,
|
|
2457
|
+
onPointerEnter: (event) => spawnPill(event),
|
|
2458
|
+
onPointerLeave: endPillTracking,
|
|
2459
|
+
onPointerMove: (event) => trackPillPosition(event),
|
|
2460
|
+
style: { "--pill-y": "50%" },
|
|
2461
|
+
className: utils.cn(
|
|
2462
|
+
"group/expand absolute inset-y-0 z-10 w-4 cursor-pointer focus-visible:outline-hidden",
|
|
2463
|
+
direction === "left" ? "left-1" : "right-1"
|
|
2464
|
+
),
|
|
2465
|
+
children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
2466
|
+
"span",
|
|
2467
|
+
{
|
|
2468
|
+
ref: pillRef,
|
|
2469
|
+
style: { top: "var(--pill-y)" },
|
|
2470
|
+
className: utils.cn(
|
|
2471
|
+
"absolute flex size-7 -translate-y-1/2 items-center justify-center rounded-full bg-neutral6 text-surface1 shadow-dialog",
|
|
2472
|
+
"pointer-events-none opacity-0 transition-[opacity,translate,top] duration-150 ease-out-custom motion-reduce:transition-none",
|
|
2473
|
+
direction === "left" ? "left-0.5 -translate-x-1" : "right-0.5 translate-x-1",
|
|
2474
|
+
"group-hover/expand:pointer-events-auto group-hover/expand:translate-x-0 group-hover/expand:opacity-100",
|
|
2475
|
+
"group-active/expand:bg-neutral6/80",
|
|
2476
|
+
"data-[edge-hovered=true]:pointer-events-auto data-[edge-hovered=true]:translate-x-0 data-[edge-hovered=true]:opacity-100"
|
|
2477
|
+
),
|
|
2478
|
+
children: /* @__PURE__ */ jsxRuntime.jsx(Icon.Icon, { children: direction === "left" ? /* @__PURE__ */ jsxRuntime.jsx(lucideReact.ChevronRight, {}) : /* @__PURE__ */ jsxRuntime.jsx(lucideReact.ChevronLeft, {}) })
|
|
2479
|
+
}
|
|
2480
|
+
)
|
|
2481
|
+
}
|
|
2482
|
+
)
|
|
2483
|
+
] })
|
|
2484
|
+
]
|
|
2190
2485
|
}
|
|
2191
2486
|
);
|
|
2192
2487
|
};
|
|
@@ -2225,6 +2520,27 @@ const PanelSeparator = ({ variant = "line" }) => {
|
|
|
2225
2520
|
);
|
|
2226
2521
|
};
|
|
2227
2522
|
|
|
2523
|
+
const PanelDrawer = ({ direction, label, children }) => {
|
|
2524
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(drawer.Drawer, { side: direction, children: [
|
|
2525
|
+
/* @__PURE__ */ jsxRuntime.jsx(drawer.DrawerTrigger, { asChild: true, children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
2526
|
+
"button",
|
|
2527
|
+
{
|
|
2528
|
+
type: "button",
|
|
2529
|
+
"aria-label": label,
|
|
2530
|
+
className: utils.cn(panelIconButtonClass, "absolute top-2 z-10", direction === "left" ? "left-2" : "right-2"),
|
|
2531
|
+
children: /* @__PURE__ */ jsxRuntime.jsx(Icon.Icon, { children: /* @__PURE__ */ jsxRuntime.jsx(PanelEdgeIcon, { side: direction }) })
|
|
2532
|
+
}
|
|
2533
|
+
) }),
|
|
2534
|
+
/* @__PURE__ */ jsxRuntime.jsxs(drawer.DrawerPortal, { keepMounted: true, children: [
|
|
2535
|
+
/* @__PURE__ */ jsxRuntime.jsx(drawer.DrawerBackdrop, {}),
|
|
2536
|
+
/* @__PURE__ */ jsxRuntime.jsx(drawer.DrawerViewport, { children: /* @__PURE__ */ jsxRuntime.jsxs(drawer.DrawerPopup, { className: "w-[calc(100vw-2.5rem)] max-w-[28rem]", children: [
|
|
2537
|
+
/* @__PURE__ */ jsxRuntime.jsx(drawer.DrawerTitle, { className: "sr-only", children: label }),
|
|
2538
|
+
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex min-h-0 flex-1 flex-col", children })
|
|
2539
|
+
] }) })
|
|
2540
|
+
] })
|
|
2541
|
+
] });
|
|
2542
|
+
};
|
|
2543
|
+
|
|
2228
2544
|
const EXTENSION_TO_MIME = {
|
|
2229
2545
|
jpg: "image/jpg",
|
|
2230
2546
|
jpeg: "image/jpeg",
|
|
@@ -8487,6 +8803,7 @@ exports.OpenAIIcon = OpenAIIcon;
|
|
|
8487
8803
|
exports.OpenErrorsInLogsButton = OpenErrorsInLogsButton;
|
|
8488
8804
|
exports.OpenInTracesButton = OpenInTracesButton;
|
|
8489
8805
|
exports.OpenaiChatIcon = OpenaiChatIcon;
|
|
8806
|
+
exports.PanelDrawer = PanelDrawer;
|
|
8490
8807
|
exports.PanelSeparator = PanelSeparator;
|
|
8491
8808
|
exports.ProcessorIcon = ProcessorIcon;
|
|
8492
8809
|
exports.PromptIcon = PromptIcon;
|
|
@@ -8625,6 +8942,7 @@ exports.useDrilldown = useDrilldown;
|
|
|
8625
8942
|
exports.useEntityNames = useEntityNames;
|
|
8626
8943
|
exports.useEnvironments = useEnvironments;
|
|
8627
8944
|
exports.useInView = useInView;
|
|
8945
|
+
exports.useIsMobile = useIsMobile;
|
|
8628
8946
|
exports.useLatencyMetrics = useLatencyMetrics;
|
|
8629
8947
|
exports.useLogs = useLogs;
|
|
8630
8948
|
exports.useLogsFilterPersistence = useLogsFilterPersistence;
|