@elevasis/ui 2.36.0 → 2.38.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/dist/api/index.js +4 -3
- package/dist/app/index.css +0 -384
- package/dist/app/index.d.ts +75 -2
- package/dist/app/index.js +22 -21
- package/dist/auth/index.d.ts +91 -28
- package/dist/auth/index.js +5 -1
- package/dist/charts/index.js +9 -3
- package/dist/chunk-4O3VAALW.js +349 -0
- package/dist/{chunk-O2Q4VMRN.js → chunk-566XWGPP.js} +76 -109
- package/dist/chunk-5EYJ2GIN.js +122 -0
- package/dist/chunk-6D4LCJ52.js +10 -0
- package/dist/chunk-6ROXVZ3L.js +9 -0
- package/dist/{chunk-YYX7OPZQ.js → chunk-73EWE2EW.js} +1 -1
- package/dist/{chunk-SIQ3P4OR.js → chunk-7GQFIWP4.js} +8 -756
- package/dist/{chunk-VKIZUUPM.js → chunk-7YXZFS56.js} +31 -14
- package/dist/{chunk-AKW7KISS.js → chunk-7ZWXTH5J.js} +2 -44
- package/dist/chunk-A7IG36LB.js +215 -0
- package/dist/chunk-B2DZLPDL.js +39 -0
- package/dist/chunk-C6BDBZRO.js +422 -0
- package/dist/chunk-CLDCYJQT.js +1 -0
- package/dist/{chunk-LUYVRATI.js → chunk-DA6I5VEY.js} +5 -213
- package/dist/chunk-H2MEFUQD.js +337 -0
- package/dist/chunk-I53EX4VU.js +734 -0
- package/dist/chunk-IIMU5YAJ.js +53 -0
- package/dist/chunk-JXVNHVK7.js +79 -0
- package/dist/chunk-M7Q4UBRY.js +85 -0
- package/dist/{chunk-K4UZU3TU.js → chunk-P34FFSOX.js} +1 -1
- package/dist/chunk-PGWANFNE.js +112 -0
- package/dist/{chunk-F6EFC2MJ.js → chunk-Q64E2TZY.js} +440 -2075
- package/dist/chunk-S3XR4II4.js +30 -0
- package/dist/chunk-SHZT7ULK.js +425 -0
- package/dist/{chunk-GX6XBRRF.js → chunk-TYRUKGGD.js} +2 -1
- package/dist/{chunk-R3VCBZDC.js → chunk-X4WBGKJQ.js} +3 -50
- package/dist/{chunk-GEFWMU26.js → chunk-X66MVMZT.js} +1 -9
- package/dist/{chunk-57OZ3AEG.js → chunk-Y3JQBSKQ.js} +1 -1
- package/dist/components/index.d.ts +74 -42
- package/dist/components/index.js +34 -19
- package/dist/components/navigation/index.js +3 -31
- package/dist/features/auth/index.d.ts +97 -99
- package/dist/features/auth/index.js +37 -99
- package/dist/features/clients/index.js +34 -19
- package/dist/features/crm/index.d.ts +65 -0
- package/dist/features/crm/index.js +34 -19
- package/dist/features/dashboard/index.js +34 -19
- package/dist/features/delivery/index.d.ts +65 -0
- package/dist/features/delivery/index.js +34 -19
- package/dist/features/knowledge/index.js +6 -30
- package/dist/features/lead-gen/index.d.ts +1096 -1
- package/dist/features/lead-gen/index.js +34 -19
- package/dist/features/monitoring/index.js +34 -19
- package/dist/features/monitoring/requests/index.js +34 -19
- package/dist/features/notes/index.d.ts +72 -0
- package/dist/features/notes/index.js +621 -0
- package/dist/features/operations/index.d.ts +10 -2
- package/dist/features/operations/index.js +34 -19
- package/dist/features/right-panel-host/index.d.ts +214 -0
- package/dist/features/right-panel-host/index.js +639 -0
- package/dist/features/seo/index.js +3 -2
- package/dist/features/settings/index.d.ts +68 -35
- package/dist/features/settings/index.js +34 -19
- package/dist/hooks/access/index.d.ts +90 -0
- package/dist/hooks/access/index.js +10 -0
- package/dist/hooks/delivery/index.d.ts +65 -0
- package/dist/hooks/delivery/index.js +34 -19
- package/dist/hooks/index.d.ts +1644 -1651
- package/dist/hooks/index.js +34 -19
- package/dist/hooks/published.d.ts +1644 -1651
- package/dist/hooks/published.js +34 -19
- package/dist/hooks/user-notes/index.d.ts +57 -0
- package/dist/hooks/user-notes/index.js +3 -0
- package/dist/index.d.ts +294 -277
- package/dist/index.js +35 -20
- package/dist/initialization/index.d.ts +65 -19
- package/dist/knowledge/index.d.ts +10 -2
- package/dist/knowledge/index.js +173 -28
- package/dist/layout/index.js +5 -3
- package/dist/organization/index.d.ts +0 -19
- package/dist/organization/index.js +34 -19
- package/dist/profile/index.d.ts +65 -0
- package/dist/provider/index.css +0 -384
- package/dist/provider/index.d.ts +75 -2
- package/dist/provider/index.js +16 -21
- package/dist/provider/published.css +0 -523
- package/dist/provider/published.d.ts +75 -2
- package/dist/provider/published.js +11 -21
- package/dist/supabase/index.d.ts +127 -0
- package/dist/test-utils/index.d.ts +2 -21
- package/dist/test-utils/index.js +5 -18
- package/dist/theme/index.js +3 -1
- package/dist/types/index.d.ts +115 -59
- package/dist/utils/index.js +2 -1
- package/package.json +21 -5
- package/src/auth/README.md +6 -6
- package/dist/components/navigation/index.css +0 -649
- package/dist/features/knowledge/index.css +0 -649
|
@@ -0,0 +1,639 @@
|
|
|
1
|
+
import '../../chunk-I2KLQ2HA.js';
|
|
2
|
+
import { createContext, useContext, useRef, useCallback, useState, useMemo, useEffect } from 'react';
|
|
3
|
+
import { useStore, create } from 'zustand';
|
|
4
|
+
import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
|
|
5
|
+
import { useMediaQuery } from '@mantine/hooks';
|
|
6
|
+
import { useComputedColorScheme, Tooltip } from '@mantine/core';
|
|
7
|
+
|
|
8
|
+
// src/features/right-panel-host/constants.ts
|
|
9
|
+
var RIGHT_PANEL_Z_INDEX = { PANEL: 300, TRIGGER: 400 };
|
|
10
|
+
var RIGHT_PANEL_DEFAULTS = {
|
|
11
|
+
WIDTH: 600,
|
|
12
|
+
MIN_WIDTH: 600,
|
|
13
|
+
MAX_WIDTH: 1200,
|
|
14
|
+
WIDTH_STEP: 5
|
|
15
|
+
};
|
|
16
|
+
var ASSISTANT_PANEL_WIDTH_KEY = "elevasis-assistant-panel-width";
|
|
17
|
+
var RIGHT_PANEL_TRIGGER = {
|
|
18
|
+
WIDTH: 20,
|
|
19
|
+
HEIGHT: 80,
|
|
20
|
+
LIGHT_BAR_WIDTH: 2,
|
|
21
|
+
LIGHT_BAR_HEIGHT: 52,
|
|
22
|
+
ARM_WIDTH: 50
|
|
23
|
+
};
|
|
24
|
+
var RIGHT_PANEL_HISTORY_WIDTH = 260;
|
|
25
|
+
var RIGHT_PANEL_HISTORY_COLLAPSED_WIDTH = 48;
|
|
26
|
+
var RIGHT_PANEL_MOBILE_BREAKPOINT = 768;
|
|
27
|
+
var RIGHT_PANEL_DEFAULT_VIEW_ID = "overview";
|
|
28
|
+
|
|
29
|
+
// src/features/right-panel-host/store.ts
|
|
30
|
+
function loadSavedWidth() {
|
|
31
|
+
try {
|
|
32
|
+
const saved = localStorage.getItem(ASSISTANT_PANEL_WIDTH_KEY);
|
|
33
|
+
if (saved) {
|
|
34
|
+
const n = Number(saved);
|
|
35
|
+
if (n >= RIGHT_PANEL_DEFAULTS.MIN_WIDTH && n <= RIGHT_PANEL_DEFAULTS.MAX_WIDTH) return n;
|
|
36
|
+
}
|
|
37
|
+
} catch {
|
|
38
|
+
}
|
|
39
|
+
return RIGHT_PANEL_DEFAULTS.WIDTH;
|
|
40
|
+
}
|
|
41
|
+
function buildInitialState(overrides) {
|
|
42
|
+
return {
|
|
43
|
+
isOpen: false,
|
|
44
|
+
isMinimized: false,
|
|
45
|
+
hasBeenOpened: false,
|
|
46
|
+
width: loadSavedWidth(),
|
|
47
|
+
activeViewId: RIGHT_PANEL_DEFAULT_VIEW_ID,
|
|
48
|
+
...overrides
|
|
49
|
+
};
|
|
50
|
+
}
|
|
51
|
+
function createRightPanelStore(initialState) {
|
|
52
|
+
return create((set, get) => ({
|
|
53
|
+
...buildInitialState(initialState),
|
|
54
|
+
open: (viewId) => set((state) => ({
|
|
55
|
+
isOpen: true,
|
|
56
|
+
isMinimized: false,
|
|
57
|
+
hasBeenOpened: true,
|
|
58
|
+
activeViewId: viewId ?? state.activeViewId
|
|
59
|
+
})),
|
|
60
|
+
close: () => set({ isOpen: false, isMinimized: false }),
|
|
61
|
+
minimize: () => set({ isMinimized: true }),
|
|
62
|
+
restore: () => set({ isMinimized: false }),
|
|
63
|
+
setActiveView: (viewId) => set({ activeViewId: viewId }),
|
|
64
|
+
setWidth: (width) => set({ width }),
|
|
65
|
+
toggle: () => {
|
|
66
|
+
const { isOpen, isMinimized, open, close, restore } = get();
|
|
67
|
+
if (isOpen && isMinimized) {
|
|
68
|
+
restore();
|
|
69
|
+
} else if (isOpen) {
|
|
70
|
+
close();
|
|
71
|
+
} else {
|
|
72
|
+
open();
|
|
73
|
+
}
|
|
74
|
+
}
|
|
75
|
+
}));
|
|
76
|
+
}
|
|
77
|
+
var RightPanelStoreContext = createContext(null);
|
|
78
|
+
function useRightPanelStore() {
|
|
79
|
+
const store = useContext(RightPanelStoreContext);
|
|
80
|
+
if (!store) {
|
|
81
|
+
throw new Error("useRightPanel must be used within a <RightPanelProvider>");
|
|
82
|
+
}
|
|
83
|
+
return store;
|
|
84
|
+
}
|
|
85
|
+
function useRightPanel() {
|
|
86
|
+
const store = useRightPanelStore();
|
|
87
|
+
return useStore(store);
|
|
88
|
+
}
|
|
89
|
+
var RightPanelContextValue = createContext({});
|
|
90
|
+
function useRightPanelContext() {
|
|
91
|
+
return useContext(RightPanelContextValue);
|
|
92
|
+
}
|
|
93
|
+
function RightPanelProvider({ children, initialState, contextValue = {} }) {
|
|
94
|
+
const storeRef = useRef(null);
|
|
95
|
+
if (!storeRef.current) {
|
|
96
|
+
storeRef.current = createRightPanelStore(initialState);
|
|
97
|
+
}
|
|
98
|
+
return /* @__PURE__ */ jsx(RightPanelStoreContext.Provider, { value: storeRef.current, children: /* @__PURE__ */ jsx(RightPanelContextValue.Provider, { value: contextValue, children }) });
|
|
99
|
+
}
|
|
100
|
+
function useMobileRightPanel() {
|
|
101
|
+
const matches = useMediaQuery(`(max-width: ${RIGHT_PANEL_MOBILE_BREAKPOINT}px)`);
|
|
102
|
+
return { isMobile: !!matches };
|
|
103
|
+
}
|
|
104
|
+
var isMac = typeof navigator !== "undefined" && /Mac|iPod|iPhone|iPad/.test(navigator.userAgent);
|
|
105
|
+
var shortcutLabel = isMac ? "\u2318Space" : "Ctrl+Space";
|
|
106
|
+
var DRAG_THRESHOLD = 4;
|
|
107
|
+
function TriggerSVG({
|
|
108
|
+
width,
|
|
109
|
+
height,
|
|
110
|
+
isOpen,
|
|
111
|
+
isProcessing,
|
|
112
|
+
isLight
|
|
113
|
+
}) {
|
|
114
|
+
const cx = width / 2;
|
|
115
|
+
const barTop = 8;
|
|
116
|
+
const barBottom = height - 8;
|
|
117
|
+
const barH = barBottom - barTop;
|
|
118
|
+
let lightOpacity = 0.5;
|
|
119
|
+
let glowStd = 1.5;
|
|
120
|
+
if (isOpen && isProcessing) {
|
|
121
|
+
lightOpacity = 1;
|
|
122
|
+
glowStd = 4;
|
|
123
|
+
} else if (isOpen) {
|
|
124
|
+
lightOpacity = 1;
|
|
125
|
+
glowStd = 3.5;
|
|
126
|
+
}
|
|
127
|
+
const metal = isLight ? "color-mix(in srgb, var(--color-primary) 20%, #aaa)" : "color-mix(in srgb, var(--color-primary) 15%, var(--color-border))";
|
|
128
|
+
const metalBright = isLight ? "color-mix(in srgb, var(--color-primary) 30%, #aaa)" : "color-mix(in srgb, var(--color-primary) 25%, var(--color-border))";
|
|
129
|
+
const primary = "var(--color-text-subtle)";
|
|
130
|
+
return /* @__PURE__ */ jsxs(
|
|
131
|
+
"svg",
|
|
132
|
+
{
|
|
133
|
+
width,
|
|
134
|
+
height,
|
|
135
|
+
viewBox: `0 0 ${width} ${height}`,
|
|
136
|
+
fill: "none",
|
|
137
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
138
|
+
style: { display: "block" },
|
|
139
|
+
children: [
|
|
140
|
+
/* @__PURE__ */ jsxs("defs", { children: [
|
|
141
|
+
/* @__PURE__ */ jsxs("linearGradient", { id: "rp-triggerMetal", x1: "0", y1: "0", x2: "1", y2: "0", children: [
|
|
142
|
+
/* @__PURE__ */ jsx("stop", { offset: "0%", stopColor: metal, stopOpacity: "0.6" }),
|
|
143
|
+
/* @__PURE__ */ jsx("stop", { offset: "50%", stopColor: metalBright, stopOpacity: "0.8" }),
|
|
144
|
+
/* @__PURE__ */ jsx("stop", { offset: "100%", stopColor: metal, stopOpacity: "0.6" })
|
|
145
|
+
] }),
|
|
146
|
+
/* @__PURE__ */ jsxs("linearGradient", { id: "rp-triggerLight", x1: "0", y1: "0", x2: "0", y2: "1", children: [
|
|
147
|
+
/* @__PURE__ */ jsx("stop", { offset: "0%", stopColor: primary, stopOpacity: "0.15" }),
|
|
148
|
+
/* @__PURE__ */ jsx("stop", { offset: "15%", stopColor: primary, stopOpacity: "0.9" }),
|
|
149
|
+
/* @__PURE__ */ jsx("stop", { offset: "85%", stopColor: primary, stopOpacity: "0.9" }),
|
|
150
|
+
/* @__PURE__ */ jsx("stop", { offset: "100%", stopColor: primary, stopOpacity: "0.15" })
|
|
151
|
+
] }),
|
|
152
|
+
/* @__PURE__ */ jsxs("filter", { id: "rp-triggerGlow", children: [
|
|
153
|
+
/* @__PURE__ */ jsx("feGaussianBlur", { stdDeviation: glowStd, result: "blur" }),
|
|
154
|
+
/* @__PURE__ */ jsxs("feMerge", { children: [
|
|
155
|
+
/* @__PURE__ */ jsx("feMergeNode", { in: "blur" }),
|
|
156
|
+
/* @__PURE__ */ jsx("feMergeNode", { in: "SourceGraphic" })
|
|
157
|
+
] })
|
|
158
|
+
] })
|
|
159
|
+
] }),
|
|
160
|
+
/* @__PURE__ */ jsx("rect", { x: cx - 2.5, y: barTop, width: "5", height: barH, rx: "2.5", fill: "url(#rp-triggerMetal)", opacity: "0.7" }),
|
|
161
|
+
/* @__PURE__ */ jsx("rect", { x: cx - 1.5, y: barTop + 1.5, width: "3", height: barH - 3, rx: "1.5", fill: "rgba(0,0,0,0.3)" }),
|
|
162
|
+
/* @__PURE__ */ jsx(
|
|
163
|
+
"rect",
|
|
164
|
+
{
|
|
165
|
+
x: cx - 1,
|
|
166
|
+
y: barTop + 3,
|
|
167
|
+
width: "2",
|
|
168
|
+
height: barH - 6,
|
|
169
|
+
rx: "1",
|
|
170
|
+
fill: "url(#rp-triggerLight)",
|
|
171
|
+
opacity: lightOpacity,
|
|
172
|
+
filter: "url(#rp-triggerGlow)",
|
|
173
|
+
style: isOpen && isProcessing ? {
|
|
174
|
+
animation: "rp-streakPulse 1.5s ease-in-out infinite"
|
|
175
|
+
} : void 0
|
|
176
|
+
}
|
|
177
|
+
),
|
|
178
|
+
/* @__PURE__ */ jsx("circle", { cx, cy: barTop - 2, r: "1.2", fill: metalBright, opacity: "0.4" }),
|
|
179
|
+
/* @__PURE__ */ jsx("circle", { cx, cy: barBottom + 2, r: "1.2", fill: metalBright, opacity: "0.4" })
|
|
180
|
+
]
|
|
181
|
+
}
|
|
182
|
+
);
|
|
183
|
+
}
|
|
184
|
+
function RightPanelTrigger({ onResizeDrag, onResizeEnd, isProcessing = false }) {
|
|
185
|
+
const { isOpen, isMinimized, width, open, close, restore } = useRightPanel();
|
|
186
|
+
const computedColorScheme = useComputedColorScheme("dark");
|
|
187
|
+
const isLight = computedColorScheme === "light";
|
|
188
|
+
const isDraggingRef = useRef(false);
|
|
189
|
+
const handleClick = useCallback(() => {
|
|
190
|
+
if (isOpen && isMinimized) {
|
|
191
|
+
restore();
|
|
192
|
+
} else if (isOpen) {
|
|
193
|
+
close();
|
|
194
|
+
} else {
|
|
195
|
+
open();
|
|
196
|
+
}
|
|
197
|
+
}, [isOpen, isMinimized, restore, close, open]);
|
|
198
|
+
const handlePointerDown = useCallback(
|
|
199
|
+
(e) => {
|
|
200
|
+
if (e.button !== 0) return;
|
|
201
|
+
const canResize = isOpen && !isMinimized && !!onResizeDrag;
|
|
202
|
+
const startX = e.clientX;
|
|
203
|
+
const startW = width;
|
|
204
|
+
isDraggingRef.current = false;
|
|
205
|
+
const target = e.currentTarget;
|
|
206
|
+
target.setPointerCapture(e.pointerId);
|
|
207
|
+
const onMove = (ev) => {
|
|
208
|
+
if (!canResize) return;
|
|
209
|
+
const dx = ev.clientX - startX;
|
|
210
|
+
if (!isDraggingRef.current && Math.abs(dx) >= DRAG_THRESHOLD) {
|
|
211
|
+
isDraggingRef.current = true;
|
|
212
|
+
document.body.style.cursor = "col-resize";
|
|
213
|
+
document.body.style.userSelect = "none";
|
|
214
|
+
}
|
|
215
|
+
if (isDraggingRef.current) {
|
|
216
|
+
onResizeDrag(dx, startW);
|
|
217
|
+
}
|
|
218
|
+
};
|
|
219
|
+
const onUp = () => {
|
|
220
|
+
target.removeEventListener("pointermove", onMove);
|
|
221
|
+
target.removeEventListener("pointerup", onUp);
|
|
222
|
+
target.removeEventListener("pointercancel", onUp);
|
|
223
|
+
document.body.style.cursor = "";
|
|
224
|
+
document.body.style.userSelect = "";
|
|
225
|
+
if (isDraggingRef.current) {
|
|
226
|
+
onResizeEnd?.();
|
|
227
|
+
} else {
|
|
228
|
+
handleClick();
|
|
229
|
+
}
|
|
230
|
+
isDraggingRef.current = false;
|
|
231
|
+
};
|
|
232
|
+
target.addEventListener("pointermove", onMove);
|
|
233
|
+
target.addEventListener("pointerup", onUp);
|
|
234
|
+
target.addEventListener("pointercancel", onUp);
|
|
235
|
+
},
|
|
236
|
+
[isOpen, isMinimized, width, onResizeDrag, onResizeEnd, handleClick]
|
|
237
|
+
);
|
|
238
|
+
return /* @__PURE__ */ jsx(Tooltip, { label: `Right panel (${shortcutLabel})`, position: "left", withArrow: true, children: /* @__PURE__ */ jsx(
|
|
239
|
+
"div",
|
|
240
|
+
{
|
|
241
|
+
role: "button",
|
|
242
|
+
tabIndex: 0,
|
|
243
|
+
onPointerDown: handlePointerDown,
|
|
244
|
+
onKeyDown: (e) => {
|
|
245
|
+
if (e.key === "Enter" || e.key === " ") {
|
|
246
|
+
e.preventDefault();
|
|
247
|
+
handleClick();
|
|
248
|
+
}
|
|
249
|
+
},
|
|
250
|
+
"aria-label": isOpen ? "Close right panel" : "Open right panel",
|
|
251
|
+
style: {
|
|
252
|
+
width: RIGHT_PANEL_TRIGGER.WIDTH,
|
|
253
|
+
height: RIGHT_PANEL_TRIGGER.HEIGHT,
|
|
254
|
+
borderRadius: "var(--mantine-radius-default)",
|
|
255
|
+
background: "var(--glass-background)",
|
|
256
|
+
backdropFilter: "var(--glass-blur)",
|
|
257
|
+
WebkitBackdropFilter: "var(--glass-blur)",
|
|
258
|
+
border: "1px solid var(--color-border)",
|
|
259
|
+
boxShadow: "light-dark(0 0 20px rgba(0,0,0,0.1), 0 0 24px rgba(0,0,0,0.75)), light-dark(0 0 60px rgba(0,0,0,0.05), 0 0 80px rgba(0,0,0,0.65))",
|
|
260
|
+
display: "flex",
|
|
261
|
+
alignItems: "center",
|
|
262
|
+
justifyContent: "center",
|
|
263
|
+
cursor: "pointer",
|
|
264
|
+
padding: 0
|
|
265
|
+
},
|
|
266
|
+
children: /* @__PURE__ */ jsx(
|
|
267
|
+
TriggerSVG,
|
|
268
|
+
{
|
|
269
|
+
width: RIGHT_PANEL_TRIGGER.WIDTH,
|
|
270
|
+
height: RIGHT_PANEL_TRIGGER.HEIGHT,
|
|
271
|
+
isOpen,
|
|
272
|
+
isProcessing,
|
|
273
|
+
isLight
|
|
274
|
+
}
|
|
275
|
+
)
|
|
276
|
+
}
|
|
277
|
+
) });
|
|
278
|
+
}
|
|
279
|
+
var { MIN_WIDTH, MAX_WIDTH, WIDTH_STEP } = RIGHT_PANEL_DEFAULTS;
|
|
280
|
+
function snapToStep(value) {
|
|
281
|
+
return Math.round(value / WIDTH_STEP) * WIDTH_STEP;
|
|
282
|
+
}
|
|
283
|
+
function clampWidth(raw) {
|
|
284
|
+
const clamped = Math.max(MIN_WIDTH, Math.min(MAX_WIDTH, raw));
|
|
285
|
+
return snapToStep(clamped);
|
|
286
|
+
}
|
|
287
|
+
var SLIDE_TRANSITION = "transform 0.3s cubic-bezier(0.16, 1, 0.3, 1)";
|
|
288
|
+
var PANEL_SHADOW_STYLE = {
|
|
289
|
+
boxShadow: [
|
|
290
|
+
"light-dark(0 0 20px rgba(0,0,0,0.1), 0 0 24px rgba(0,0,0,0.75))",
|
|
291
|
+
"light-dark(0 0 60px rgba(0,0,0,0.05), 0 0 80px rgba(0,0,0,0.65))",
|
|
292
|
+
"light-dark(0 0 120px rgba(0,0,0,0.04), 0 0 160px rgba(0,0,0,0.46))",
|
|
293
|
+
"light-dark(-4px 0 16px rgba(0,0,0,0.01), -8px 0 40px rgba(0,0,0,0.5))"
|
|
294
|
+
].join(", ")
|
|
295
|
+
};
|
|
296
|
+
function RightPanelLayer({ views, isProcessing = false, sidebar, sidebarWidth = 0 }) {
|
|
297
|
+
const { isOpen, isMinimized, hasBeenOpened, width, activeViewId, setActiveView, setWidth } = useRightPanel();
|
|
298
|
+
const ctx = useRightPanelContext();
|
|
299
|
+
const { isMobile } = useMobileRightPanel();
|
|
300
|
+
const [isResizing, setIsResizing] = useState(false);
|
|
301
|
+
const availableViews = useMemo(
|
|
302
|
+
() => views.filter((v) => !v.isAvailable || v.isAvailable(ctx)),
|
|
303
|
+
// ctx changes identity often; stringify to detect real changes
|
|
304
|
+
[views, JSON.stringify(ctx)]
|
|
305
|
+
);
|
|
306
|
+
const activeView = useMemo(
|
|
307
|
+
() => availableViews.find((v) => v.id === activeViewId) ?? availableViews[0],
|
|
308
|
+
[activeViewId, availableViews]
|
|
309
|
+
);
|
|
310
|
+
useEffect(() => {
|
|
311
|
+
if (activeView && activeView.id !== activeViewId) {
|
|
312
|
+
setActiveView(activeView.id);
|
|
313
|
+
}
|
|
314
|
+
}, [activeView, activeViewId, setActiveView]);
|
|
315
|
+
const saveTimerRef = useRef(null);
|
|
316
|
+
const persistWidth = useCallback((w) => {
|
|
317
|
+
if (saveTimerRef.current) clearTimeout(saveTimerRef.current);
|
|
318
|
+
saveTimerRef.current = setTimeout(() => {
|
|
319
|
+
try {
|
|
320
|
+
localStorage.setItem(ASSISTANT_PANEL_WIDTH_KEY, String(w));
|
|
321
|
+
} catch {
|
|
322
|
+
}
|
|
323
|
+
}, 300);
|
|
324
|
+
}, []);
|
|
325
|
+
const handleResizeDrag = useCallback(
|
|
326
|
+
(deltaX, startWidth) => {
|
|
327
|
+
setIsResizing(true);
|
|
328
|
+
const newWidth = clampWidth(startWidth - deltaX);
|
|
329
|
+
setWidth(newWidth);
|
|
330
|
+
persistWidth(newWidth);
|
|
331
|
+
},
|
|
332
|
+
[setWidth, persistWidth]
|
|
333
|
+
);
|
|
334
|
+
const handleResizeEnd = useCallback(() => {
|
|
335
|
+
setIsResizing(false);
|
|
336
|
+
}, []);
|
|
337
|
+
if (isMobile) {
|
|
338
|
+
const ActiveComponent = activeView?.component;
|
|
339
|
+
return /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
340
|
+
/* @__PURE__ */ jsx(RightPanelTrigger, { isProcessing }),
|
|
341
|
+
isOpen && !isMinimized && ActiveComponent && /* @__PURE__ */ jsx(ActiveComponent, {})
|
|
342
|
+
] });
|
|
343
|
+
}
|
|
344
|
+
const panelVisible = isOpen && !isMinimized;
|
|
345
|
+
const armWidth = RIGHT_PANEL_TRIGGER.ARM_WIDTH;
|
|
346
|
+
const totalPanelWidth = width + (sidebar ? sidebarWidth : 0);
|
|
347
|
+
const transition = isResizing ? "none" : SLIDE_TRANSITION;
|
|
348
|
+
return /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
349
|
+
/* @__PURE__ */ jsx(
|
|
350
|
+
"div",
|
|
351
|
+
{
|
|
352
|
+
style: {
|
|
353
|
+
position: "fixed",
|
|
354
|
+
top: "10vh",
|
|
355
|
+
right: 10,
|
|
356
|
+
height: "80vh",
|
|
357
|
+
zIndex: RIGHT_PANEL_Z_INDEX.TRIGGER,
|
|
358
|
+
display: "flex",
|
|
359
|
+
alignItems: "center",
|
|
360
|
+
transform: panelVisible ? `translateX(-${totalPanelWidth + armWidth}px)` : "translateX(0)",
|
|
361
|
+
transition
|
|
362
|
+
},
|
|
363
|
+
children: /* @__PURE__ */ jsx(RightPanelTrigger, { onResizeDrag: handleResizeDrag, onResizeEnd: handleResizeEnd, isProcessing })
|
|
364
|
+
}
|
|
365
|
+
),
|
|
366
|
+
/* @__PURE__ */ jsxs(
|
|
367
|
+
"div",
|
|
368
|
+
{
|
|
369
|
+
style: {
|
|
370
|
+
position: "fixed",
|
|
371
|
+
top: "10vh",
|
|
372
|
+
right: 0,
|
|
373
|
+
height: "80vh",
|
|
374
|
+
zIndex: RIGHT_PANEL_Z_INDEX.PANEL,
|
|
375
|
+
display: "flex",
|
|
376
|
+
flexDirection: "row",
|
|
377
|
+
alignItems: "stretch",
|
|
378
|
+
transform: panelVisible ? "translateX(0)" : `translateX(${totalPanelWidth + armWidth}px)`,
|
|
379
|
+
transition,
|
|
380
|
+
pointerEvents: panelVisible ? "auto" : "none"
|
|
381
|
+
},
|
|
382
|
+
children: [
|
|
383
|
+
/* @__PURE__ */ jsxs(
|
|
384
|
+
"div",
|
|
385
|
+
{
|
|
386
|
+
style: {
|
|
387
|
+
...PANEL_SHADOW_STYLE,
|
|
388
|
+
display: "flex",
|
|
389
|
+
height: "100%",
|
|
390
|
+
borderRadius: "var(--mantine-radius-default)"
|
|
391
|
+
},
|
|
392
|
+
children: [
|
|
393
|
+
sidebar && /* @__PURE__ */ jsx(
|
|
394
|
+
"div",
|
|
395
|
+
{
|
|
396
|
+
style: {
|
|
397
|
+
width: sidebarWidth,
|
|
398
|
+
height: "100%",
|
|
399
|
+
flexShrink: 0,
|
|
400
|
+
overflow: "hidden",
|
|
401
|
+
transition: "width 0.25s cubic-bezier(0.16, 1, 0.3, 1)"
|
|
402
|
+
},
|
|
403
|
+
children: sidebar({
|
|
404
|
+
views: availableViews,
|
|
405
|
+
activeViewId: activeView?.id ?? activeViewId,
|
|
406
|
+
onSelectView: setActiveView
|
|
407
|
+
})
|
|
408
|
+
}
|
|
409
|
+
),
|
|
410
|
+
/* @__PURE__ */ jsx("div", { style: { width, height: "100%", flexShrink: 0 }, children: hasBeenOpened && availableViews.map((view) => {
|
|
411
|
+
const Component = view.component;
|
|
412
|
+
const isActive = view.id === activeView?.id;
|
|
413
|
+
if (!view.alwaysMount && !isActive) return null;
|
|
414
|
+
return /* @__PURE__ */ jsx("div", { style: { width: "100%", height: "100%", display: isActive ? "block" : "none" }, children: /* @__PURE__ */ jsx(Component, {}) }, view.id);
|
|
415
|
+
}) })
|
|
416
|
+
]
|
|
417
|
+
}
|
|
418
|
+
),
|
|
419
|
+
/* @__PURE__ */ jsx(MountingArm, { width: armWidth, isProcessing: panelVisible && isProcessing })
|
|
420
|
+
]
|
|
421
|
+
}
|
|
422
|
+
)
|
|
423
|
+
] });
|
|
424
|
+
}
|
|
425
|
+
function MountingArm({ width, isProcessing }) {
|
|
426
|
+
return /* @__PURE__ */ jsxs(
|
|
427
|
+
"div",
|
|
428
|
+
{
|
|
429
|
+
style: {
|
|
430
|
+
display: "flex",
|
|
431
|
+
flexDirection: "column",
|
|
432
|
+
justifyContent: "center",
|
|
433
|
+
width,
|
|
434
|
+
flexShrink: 0,
|
|
435
|
+
pointerEvents: "none",
|
|
436
|
+
gap: 12
|
|
437
|
+
},
|
|
438
|
+
children: [
|
|
439
|
+
/* @__PURE__ */ jsx(MountingRail, { width, isProcessing, railId: "top" }),
|
|
440
|
+
/* @__PURE__ */ jsx(MountingRail, { width, isProcessing, railId: "bottom" })
|
|
441
|
+
]
|
|
442
|
+
}
|
|
443
|
+
);
|
|
444
|
+
}
|
|
445
|
+
function MountingRail({ width, isProcessing, railId }) {
|
|
446
|
+
const h = 16;
|
|
447
|
+
return /* @__PURE__ */ jsxs(
|
|
448
|
+
"svg",
|
|
449
|
+
{
|
|
450
|
+
width,
|
|
451
|
+
height: h,
|
|
452
|
+
viewBox: `0 0 ${width} ${h}`,
|
|
453
|
+
fill: "none",
|
|
454
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
455
|
+
style: { display: "block", overflow: "visible" },
|
|
456
|
+
children: [
|
|
457
|
+
/* @__PURE__ */ jsxs("defs", { children: [
|
|
458
|
+
/* @__PURE__ */ jsxs("linearGradient", { id: "rp-metalPipe", x1: "0", y1: "0", x2: "0", y2: "1", children: [
|
|
459
|
+
/* @__PURE__ */ jsx(
|
|
460
|
+
"stop",
|
|
461
|
+
{
|
|
462
|
+
offset: "0%",
|
|
463
|
+
stopColor: "light-dark(color-mix(in srgb, var(--color-primary) 25%, #aaa), color-mix(in srgb, var(--color-primary) 20%, var(--color-border)))"
|
|
464
|
+
}
|
|
465
|
+
),
|
|
466
|
+
/* @__PURE__ */ jsx(
|
|
467
|
+
"stop",
|
|
468
|
+
{
|
|
469
|
+
offset: "40%",
|
|
470
|
+
stopColor: "light-dark(color-mix(in srgb, var(--color-primary) 15%, #aaa), color-mix(in srgb, var(--color-primary) 10%, var(--color-border)))"
|
|
471
|
+
}
|
|
472
|
+
),
|
|
473
|
+
/* @__PURE__ */ jsx(
|
|
474
|
+
"stop",
|
|
475
|
+
{
|
|
476
|
+
offset: "60%",
|
|
477
|
+
stopColor: "light-dark(color-mix(in srgb, var(--color-primary) 12%, #aaa), color-mix(in srgb, var(--color-primary) 6%, var(--color-border)))"
|
|
478
|
+
}
|
|
479
|
+
),
|
|
480
|
+
/* @__PURE__ */ jsx(
|
|
481
|
+
"stop",
|
|
482
|
+
{
|
|
483
|
+
offset: "100%",
|
|
484
|
+
stopColor: "light-dark(color-mix(in srgb, var(--color-primary) 20%, #aaa), color-mix(in srgb, var(--color-primary) 14%, var(--color-border)))"
|
|
485
|
+
}
|
|
486
|
+
)
|
|
487
|
+
] }),
|
|
488
|
+
/* @__PURE__ */ jsxs("linearGradient", { id: "rp-lightBar", x1: "0", y1: "0", x2: "1", y2: "0", children: [
|
|
489
|
+
/* @__PURE__ */ jsx("stop", { offset: "0%", stopColor: "var(--color-primary)", stopOpacity: "0.3" }),
|
|
490
|
+
/* @__PURE__ */ jsx("stop", { offset: "30%", stopColor: "var(--color-primary)", stopOpacity: "0.7" }),
|
|
491
|
+
/* @__PURE__ */ jsx("stop", { offset: "70%", stopColor: "var(--color-primary)", stopOpacity: "0.7" }),
|
|
492
|
+
/* @__PURE__ */ jsx("stop", { offset: "100%", stopColor: "var(--color-primary)", stopOpacity: "0.2" })
|
|
493
|
+
] }),
|
|
494
|
+
/* @__PURE__ */ jsxs("filter", { id: "rp-lightGlow", children: [
|
|
495
|
+
/* @__PURE__ */ jsx("feGaussianBlur", { stdDeviation: "1.2", result: "blur" }),
|
|
496
|
+
/* @__PURE__ */ jsxs("feMerge", { children: [
|
|
497
|
+
/* @__PURE__ */ jsx("feMergeNode", { in: "blur" }),
|
|
498
|
+
/* @__PURE__ */ jsx("feMergeNode", { in: "SourceGraphic" })
|
|
499
|
+
] })
|
|
500
|
+
] })
|
|
501
|
+
] }),
|
|
502
|
+
/* @__PURE__ */ jsx("rect", { x: "0", y: "2", width: "3", height: "12", rx: "0.5", fill: "url(#rp-metalPipe)", opacity: "0.8" }),
|
|
503
|
+
/* @__PURE__ */ jsx("rect", { x: "2", y: "4", width: "2", height: "8", rx: "0.5", fill: "url(#rp-metalPipe)", opacity: "0.65" }),
|
|
504
|
+
/* @__PURE__ */ jsx(
|
|
505
|
+
"circle",
|
|
506
|
+
{
|
|
507
|
+
cx: "1.5",
|
|
508
|
+
cy: "5",
|
|
509
|
+
r: "0.7",
|
|
510
|
+
fill: "color-mix(in srgb, var(--color-primary) 25%, var(--color-border))",
|
|
511
|
+
opacity: "0.6"
|
|
512
|
+
}
|
|
513
|
+
),
|
|
514
|
+
/* @__PURE__ */ jsx(
|
|
515
|
+
"circle",
|
|
516
|
+
{
|
|
517
|
+
cx: "1.5",
|
|
518
|
+
cy: "11",
|
|
519
|
+
r: "0.7",
|
|
520
|
+
fill: "color-mix(in srgb, var(--color-primary) 25%, var(--color-border))",
|
|
521
|
+
opacity: "0.6"
|
|
522
|
+
}
|
|
523
|
+
),
|
|
524
|
+
/* @__PURE__ */ jsx("rect", { x: "4", y: "4", width: width - 9, height: "8", rx: "3", fill: "url(#rp-metalPipe)", opacity: "0.7" }),
|
|
525
|
+
/* @__PURE__ */ jsx("rect", { x: "5", y: "5.5", width: width - 11, height: "5", rx: "2", fill: "rgba(0,0,0,0.3)" }),
|
|
526
|
+
/* @__PURE__ */ jsx("rect", { x: "6", y: "6.5", width: width - 13, height: "3", rx: "1.5", fill: "url(#rp-lightBar)", filter: "url(#rp-lightGlow)" }),
|
|
527
|
+
isProcessing && /* @__PURE__ */ jsxs("g", { children: [
|
|
528
|
+
/* @__PURE__ */ jsxs("radialGradient", { id: `rp-energyGlow-${railId}`, cx: "50%", cy: "50%", rx: "50%", ry: "50%", children: [
|
|
529
|
+
/* @__PURE__ */ jsx("stop", { offset: "0%", stopColor: "var(--color-primary)", stopOpacity: "1" }),
|
|
530
|
+
/* @__PURE__ */ jsx("stop", { offset: "40%", stopColor: "var(--color-primary)", stopOpacity: "0.7" }),
|
|
531
|
+
/* @__PURE__ */ jsx("stop", { offset: "100%", stopColor: "var(--color-primary)", stopOpacity: "0" })
|
|
532
|
+
] }),
|
|
533
|
+
/* @__PURE__ */ jsxs("filter", { id: `rp-energyBlur-${railId}`, children: [
|
|
534
|
+
/* @__PURE__ */ jsx("feGaussianBlur", { stdDeviation: "1", result: "blur" }),
|
|
535
|
+
/* @__PURE__ */ jsxs("feMerge", { children: [
|
|
536
|
+
/* @__PURE__ */ jsx("feMergeNode", { in: "blur" }),
|
|
537
|
+
/* @__PURE__ */ jsx("feMergeNode", { in: "SourceGraphic" })
|
|
538
|
+
] })
|
|
539
|
+
] }),
|
|
540
|
+
/* @__PURE__ */ jsx("clipPath", { id: `rp-pipeClip-${railId}`, children: /* @__PURE__ */ jsx("rect", { x: "5", y: "4", width: width - 11, height: "8", rx: "3" }) }),
|
|
541
|
+
/* @__PURE__ */ jsx("g", { clipPath: `url(#rp-pipeClip-${railId})`, children: /* @__PURE__ */ jsx(
|
|
542
|
+
"ellipse",
|
|
543
|
+
{
|
|
544
|
+
cx: width + 10,
|
|
545
|
+
cy: h / 2,
|
|
546
|
+
rx: "10",
|
|
547
|
+
ry: "2",
|
|
548
|
+
fill: `url(#rp-energyGlow-${railId})`,
|
|
549
|
+
filter: `url(#rp-energyBlur-${railId})`,
|
|
550
|
+
style: {
|
|
551
|
+
animation: "rp-energySweep 1.5s ease-in-out infinite",
|
|
552
|
+
"--sweep-distance": `${-(width + 20)}px`
|
|
553
|
+
}
|
|
554
|
+
}
|
|
555
|
+
) })
|
|
556
|
+
] }),
|
|
557
|
+
/* @__PURE__ */ jsxs("g", { opacity: "0.75", children: [
|
|
558
|
+
/* @__PURE__ */ jsx(
|
|
559
|
+
"circle",
|
|
560
|
+
{
|
|
561
|
+
cx: width / 2,
|
|
562
|
+
cy: h / 2,
|
|
563
|
+
r: "3.5",
|
|
564
|
+
fill: "color-mix(in srgb, var(--color-primary) 12%, var(--color-border))"
|
|
565
|
+
}
|
|
566
|
+
),
|
|
567
|
+
/* @__PURE__ */ jsx("circle", { cx: width / 2, cy: h / 2, r: "2.5", fill: "rgba(0,0,0,0.25)" }),
|
|
568
|
+
/* @__PURE__ */ jsx(
|
|
569
|
+
"circle",
|
|
570
|
+
{
|
|
571
|
+
cx: width / 2,
|
|
572
|
+
cy: h / 2,
|
|
573
|
+
r: "1.2",
|
|
574
|
+
fill: "color-mix(in srgb, var(--color-primary) 30%, var(--color-border))"
|
|
575
|
+
}
|
|
576
|
+
),
|
|
577
|
+
/* @__PURE__ */ jsx(
|
|
578
|
+
"circle",
|
|
579
|
+
{
|
|
580
|
+
cx: width / 2 - 0.3,
|
|
581
|
+
cy: h / 2 - 0.3,
|
|
582
|
+
r: "0.5",
|
|
583
|
+
fill: "color-mix(in srgb, var(--color-primary) 50%, white)",
|
|
584
|
+
opacity: "0.4"
|
|
585
|
+
}
|
|
586
|
+
)
|
|
587
|
+
] }),
|
|
588
|
+
/* @__PURE__ */ jsx("rect", { x: width - 5, y: "1", width: "5", height: "14", rx: "1", fill: "url(#rp-metalPipe)", opacity: "0.8" }),
|
|
589
|
+
/* @__PURE__ */ jsx("line", { x1: width - 4, y1: "3", x2: width - 4, y2: "13", stroke: "rgba(0,0,0,0.15)", strokeWidth: "0.5" }),
|
|
590
|
+
/* @__PURE__ */ jsx("line", { x1: width - 2, y1: "3", x2: width - 2, y2: "13", stroke: "rgba(0,0,0,0.15)", strokeWidth: "0.5" }),
|
|
591
|
+
/* @__PURE__ */ jsx(
|
|
592
|
+
"circle",
|
|
593
|
+
{
|
|
594
|
+
cx: width - 2.5,
|
|
595
|
+
cy: "4",
|
|
596
|
+
r: "0.8",
|
|
597
|
+
fill: "color-mix(in srgb, var(--color-primary) 20%, var(--color-border))",
|
|
598
|
+
opacity: "0.5"
|
|
599
|
+
}
|
|
600
|
+
),
|
|
601
|
+
/* @__PURE__ */ jsx(
|
|
602
|
+
"circle",
|
|
603
|
+
{
|
|
604
|
+
cx: width - 2.5,
|
|
605
|
+
cy: "12",
|
|
606
|
+
r: "0.8",
|
|
607
|
+
fill: "color-mix(in srgb, var(--color-primary) 20%, var(--color-border))",
|
|
608
|
+
opacity: "0.5"
|
|
609
|
+
}
|
|
610
|
+
)
|
|
611
|
+
]
|
|
612
|
+
}
|
|
613
|
+
);
|
|
614
|
+
}
|
|
615
|
+
function useRightPanelKeyboardShortcut(enabled = true) {
|
|
616
|
+
const { isOpen, isMinimized, open, close, restore } = useRightPanel();
|
|
617
|
+
useEffect(() => {
|
|
618
|
+
if (!enabled) return;
|
|
619
|
+
const handler = (e) => {
|
|
620
|
+
if (!((e.metaKey || e.ctrlKey) && e.key === " ")) return;
|
|
621
|
+
const target = e.target;
|
|
622
|
+
if (target && (target.tagName === "INPUT" || target.tagName === "TEXTAREA" || target.isContentEditable)) {
|
|
623
|
+
return;
|
|
624
|
+
}
|
|
625
|
+
e.preventDefault();
|
|
626
|
+
if (isOpen && isMinimized) {
|
|
627
|
+
restore();
|
|
628
|
+
} else if (isOpen) {
|
|
629
|
+
close();
|
|
630
|
+
} else {
|
|
631
|
+
open();
|
|
632
|
+
}
|
|
633
|
+
};
|
|
634
|
+
window.addEventListener("keydown", handler);
|
|
635
|
+
return () => window.removeEventListener("keydown", handler);
|
|
636
|
+
}, [enabled, isOpen, isMinimized, open, close, restore]);
|
|
637
|
+
}
|
|
638
|
+
|
|
639
|
+
export { ASSISTANT_PANEL_WIDTH_KEY, RIGHT_PANEL_DEFAULTS, RIGHT_PANEL_DEFAULT_VIEW_ID, RIGHT_PANEL_HISTORY_COLLAPSED_WIDTH, RIGHT_PANEL_HISTORY_WIDTH, RIGHT_PANEL_MOBILE_BREAKPOINT, RIGHT_PANEL_TRIGGER, RIGHT_PANEL_Z_INDEX, RightPanelLayer, RightPanelProvider, RightPanelTrigger, useMobileRightPanel, useRightPanel, useRightPanelContext, useRightPanelKeyboardShortcut };
|
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
export { SEOSidebar, SEOSidebarMiddle, SEOSidebarTop, seoManifest } from '../../chunk-
|
|
2
|
-
import '../../chunk-
|
|
1
|
+
export { SEOSidebar, SEOSidebarMiddle, SEOSidebarTop, seoManifest } from '../../chunk-TYRUKGGD.js';
|
|
2
|
+
import '../../chunk-X4WBGKJQ.js';
|
|
3
|
+
import '../../chunk-IIMU5YAJ.js';
|
|
3
4
|
import '../../chunk-DT3QYZVU.js';
|
|
4
5
|
import '../../chunk-2IFYDILW.js';
|
|
5
6
|
import '../../chunk-Q7DJKLEN.js';
|