@uipath/apollo-react 6.23.0 → 6.24.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/README.md +2 -1
- package/dist/canvas/components/CanvasLeftSidebar/CanvasLeftSidebar.cjs +245 -0
- package/dist/canvas/components/CanvasLeftSidebar/CanvasLeftSidebar.d.ts +30 -0
- package/dist/canvas/components/CanvasLeftSidebar/CanvasLeftSidebar.d.ts.map +1 -0
- package/dist/canvas/components/CanvasLeftSidebar/CanvasLeftSidebar.js +196 -0
- package/dist/canvas/components/CanvasLeftSidebar/index.cjs +51 -0
- package/dist/canvas/components/CanvasLeftSidebar/index.d.ts +3 -0
- package/dist/canvas/components/CanvasLeftSidebar/index.d.ts.map +1 -0
- package/dist/canvas/components/CanvasLeftSidebar/index.js +2 -0
- package/dist/canvas/components/CanvasTakeoverModal/CanvasTakeoverModal.cjs +156 -0
- package/dist/canvas/components/CanvasTakeoverModal/CanvasTakeoverModal.d.ts +17 -0
- package/dist/canvas/components/CanvasTakeoverModal/CanvasTakeoverModal.d.ts.map +1 -0
- package/dist/canvas/components/CanvasTakeoverModal/CanvasTakeoverModal.js +112 -0
- package/dist/canvas/components/CanvasTakeoverModal/index.cjs +36 -0
- package/dist/canvas/components/CanvasTakeoverModal/index.d.ts +3 -0
- package/dist/canvas/components/CanvasTakeoverModal/index.d.ts.map +1 -0
- package/dist/canvas/components/CanvasTakeoverModal/index.js +2 -0
- package/dist/canvas/components/JsonTree/JsonTree.cjs +1 -1
- package/dist/canvas/components/JsonTree/JsonTree.js +1 -1
- package/dist/canvas/components/JsonTree/JsonTreeRow.cjs +16 -11
- package/dist/canvas/components/JsonTree/JsonTreeRow.d.ts.map +1 -1
- package/dist/canvas/components/JsonTree/JsonTreeRow.js +16 -11
- package/dist/canvas/components/JsonTree/NodeKey.cjs +1 -1
- package/dist/canvas/components/JsonTree/NodeKey.d.ts.map +1 -1
- package/dist/canvas/components/JsonTree/NodeKey.js +1 -1
- package/dist/canvas/components/JsonTree/ScalarValueCell.cjs +2 -2
- package/dist/canvas/components/JsonTree/ScalarValueCell.d.ts.map +1 -1
- package/dist/canvas/components/JsonTree/ScalarValueCell.js +2 -2
- package/dist/canvas/components/JsonTree/buildJsonTree.cjs +2 -2
- package/dist/canvas/components/JsonTree/buildJsonTree.d.ts +3 -1
- package/dist/canvas/components/JsonTree/buildJsonTree.d.ts.map +1 -1
- package/dist/canvas/components/JsonTree/buildJsonTree.js +2 -2
- package/dist/canvas/components/NodeIOView/PanelTitleBar.cjs +5 -7
- package/dist/canvas/components/NodeIOView/PanelTitleBar.d.ts.map +1 -1
- package/dist/canvas/components/NodeIOView/PanelTitleBar.js +5 -7
- package/dist/canvas/components/NodePropertyPanel/NodePropertyPanelLayout.cjs +75 -0
- package/dist/canvas/components/NodePropertyPanel/NodePropertyPanelLayout.d.ts +9 -0
- package/dist/canvas/components/NodePropertyPanel/NodePropertyPanelLayout.d.ts.map +1 -0
- package/dist/canvas/components/NodePropertyPanel/NodePropertyPanelLayout.js +41 -0
- package/dist/canvas/components/NodePropertyPanel/index.cjs +4 -0
- package/dist/canvas/components/NodePropertyPanel/index.d.ts +1 -0
- package/dist/canvas/components/NodePropertyPanel/index.d.ts.map +1 -1
- package/dist/canvas/components/NodePropertyPanel/index.js +2 -1
- package/dist/canvas/components/ToolbarButton.cjs +3 -2
- package/dist/canvas/components/ToolbarButton.d.ts +2 -1
- package/dist/canvas/components/ToolbarButton.d.ts.map +1 -1
- package/dist/canvas/components/ToolbarButton.js +3 -2
- package/dist/canvas/components/index.cjs +66 -52
- package/dist/canvas/components/index.d.ts +2 -0
- package/dist/canvas/components/index.d.ts.map +1 -1
- package/dist/canvas/components/index.js +2 -0
- package/dist/canvas/controls/NodeOutputModeSelect/NodeOutputModeSelect.cjs +6 -18
- package/dist/canvas/controls/NodeOutputModeSelect/NodeOutputModeSelect.d.ts.map +1 -1
- package/dist/canvas/controls/NodeOutputModeSelect/NodeOutputModeSelect.js +8 -20
- package/dist/canvas/locales/en.cjs +1 -1
- package/dist/canvas/locales/en.d.ts.map +1 -1
- package/dist/canvas/locales/en.js +1 -1
- package/dist/canvas/styles/tailwind.canvas.css +1 -1
- package/dist/canvas/utils/nodePropsEqual.cjs +1 -1
- package/dist/canvas/utils/nodePropsEqual.js +1 -1
- package/dist/core/index.cjs +5 -5
- package/dist/core/index.d.ts +1 -1
- package/dist/core/index.d.ts.map +1 -1
- package/dist/core/index.js +1 -1
- package/dist/core/tokens/jss/palette.cjs +1697 -3442
- package/dist/core/tokens/jss/palette.js +1688 -1
- package/package.json +4 -3
|
@@ -0,0 +1,156 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __webpack_require__ = {};
|
|
3
|
+
(()=>{
|
|
4
|
+
__webpack_require__.n = (module)=>{
|
|
5
|
+
var getter = module && module.__esModule ? ()=>module['default'] : ()=>module;
|
|
6
|
+
__webpack_require__.d(getter, {
|
|
7
|
+
a: getter
|
|
8
|
+
});
|
|
9
|
+
return getter;
|
|
10
|
+
};
|
|
11
|
+
})();
|
|
12
|
+
(()=>{
|
|
13
|
+
__webpack_require__.d = (exports1, definition)=>{
|
|
14
|
+
for(var key in definition)if (__webpack_require__.o(definition, key) && !__webpack_require__.o(exports1, key)) Object.defineProperty(exports1, key, {
|
|
15
|
+
enumerable: true,
|
|
16
|
+
get: definition[key]
|
|
17
|
+
});
|
|
18
|
+
};
|
|
19
|
+
})();
|
|
20
|
+
(()=>{
|
|
21
|
+
__webpack_require__.o = (obj, prop)=>Object.prototype.hasOwnProperty.call(obj, prop);
|
|
22
|
+
})();
|
|
23
|
+
(()=>{
|
|
24
|
+
__webpack_require__.r = (exports1)=>{
|
|
25
|
+
if ("u" > typeof Symbol && Symbol.toStringTag) Object.defineProperty(exports1, Symbol.toStringTag, {
|
|
26
|
+
value: 'Module'
|
|
27
|
+
});
|
|
28
|
+
Object.defineProperty(exports1, '__esModule', {
|
|
29
|
+
value: true
|
|
30
|
+
});
|
|
31
|
+
};
|
|
32
|
+
})();
|
|
33
|
+
var __webpack_exports__ = {};
|
|
34
|
+
__webpack_require__.r(__webpack_exports__);
|
|
35
|
+
__webpack_require__.d(__webpack_exports__, {
|
|
36
|
+
CanvasTakeoverModal: ()=>CanvasTakeoverModal
|
|
37
|
+
});
|
|
38
|
+
const jsx_runtime_namespaceObject = require("react/jsx-runtime");
|
|
39
|
+
const apollo_wind_namespaceObject = require("@uipath/apollo-wind");
|
|
40
|
+
const external_lucide_react_namespaceObject = require("lucide-react");
|
|
41
|
+
const external_react_namespaceObject = require("react");
|
|
42
|
+
const external_react_focus_lock_namespaceObject = require("react-focus-lock");
|
|
43
|
+
var external_react_focus_lock_default = /*#__PURE__*/ __webpack_require__.n(external_react_focus_lock_namespaceObject);
|
|
44
|
+
function CanvasTakeoverModal({ open, onOpenChange, title, headerActions, sidebar, children, expanded: controlledExpanded, defaultExpanded = false, onExpandedChange, className, sidebarClassName, closeOnBackdropClick = true }) {
|
|
45
|
+
const titleId = (0, external_react_namespaceObject.useId)();
|
|
46
|
+
const expandButtonRef = (0, external_react_namespaceObject.useRef)(null);
|
|
47
|
+
const previouslyFocusedElementRef = (0, external_react_namespaceObject.useRef)(null);
|
|
48
|
+
const [uncontrolledExpanded, setUncontrolledExpanded] = (0, external_react_namespaceObject.useState)(defaultExpanded);
|
|
49
|
+
const expanded = controlledExpanded ?? uncontrolledExpanded;
|
|
50
|
+
(0, external_react_namespaceObject.useEffect)(()=>{
|
|
51
|
+
if (!open) return;
|
|
52
|
+
previouslyFocusedElementRef.current = document.activeElement instanceof HTMLElement ? document.activeElement : null;
|
|
53
|
+
const animationFrame = requestAnimationFrame(()=>expandButtonRef.current?.focus());
|
|
54
|
+
const handleKeyDown = (event)=>{
|
|
55
|
+
if ('Escape' === event.key) onOpenChange?.(false);
|
|
56
|
+
};
|
|
57
|
+
document.addEventListener('keydown', handleKeyDown);
|
|
58
|
+
return ()=>{
|
|
59
|
+
cancelAnimationFrame(animationFrame);
|
|
60
|
+
document.removeEventListener('keydown', handleKeyDown);
|
|
61
|
+
previouslyFocusedElementRef.current?.focus();
|
|
62
|
+
previouslyFocusedElementRef.current = null;
|
|
63
|
+
};
|
|
64
|
+
}, [
|
|
65
|
+
onOpenChange,
|
|
66
|
+
open
|
|
67
|
+
]);
|
|
68
|
+
if (!open) return null;
|
|
69
|
+
const setExpanded = (nextExpanded)=>{
|
|
70
|
+
if (void 0 === controlledExpanded) setUncontrolledExpanded(nextExpanded);
|
|
71
|
+
onExpandedChange?.(nextExpanded);
|
|
72
|
+
};
|
|
73
|
+
const handleBackdropClick = (event)=>{
|
|
74
|
+
if (closeOnBackdropClick && event.target === event.currentTarget) onOpenChange?.(false);
|
|
75
|
+
};
|
|
76
|
+
return /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)("div", {
|
|
77
|
+
className: (0, apollo_wind_namespaceObject.cn)('absolute inset-0 z-50 flex items-center justify-center bg-ui-backdrop', expanded ? 'p-0' : 'p-3'),
|
|
78
|
+
onMouseDown: handleBackdropClick,
|
|
79
|
+
"data-testid": "canvas-takeover-backdrop",
|
|
80
|
+
children: /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(external_react_focus_lock_default(), {
|
|
81
|
+
autoFocus: false,
|
|
82
|
+
className: "contents",
|
|
83
|
+
children: /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsxs)("section", {
|
|
84
|
+
role: "dialog",
|
|
85
|
+
"aria-modal": "true",
|
|
86
|
+
"aria-labelledby": titleId,
|
|
87
|
+
"data-expanded": expanded,
|
|
88
|
+
className: (0, apollo_wind_namespaceObject.cn)('flex min-h-0 flex-col overflow-hidden border border-border-subtle bg-surface-raised text-foreground shadow-xl transition-[width,height,border-radius] duration-200', expanded ? 'h-full w-full rounded-none' : 'h-[95%] w-[95%] rounded-2xl', className),
|
|
89
|
+
children: [
|
|
90
|
+
/*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsxs)("header", {
|
|
91
|
+
className: "flex h-12 shrink-0 items-center gap-3 border-b border-border-subtle px-4",
|
|
92
|
+
children: [
|
|
93
|
+
/*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)("h2", {
|
|
94
|
+
id: titleId,
|
|
95
|
+
className: "min-w-0 flex-1 truncate text-sm font-semibold",
|
|
96
|
+
children: title
|
|
97
|
+
}),
|
|
98
|
+
headerActions,
|
|
99
|
+
/*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsxs)("div", {
|
|
100
|
+
className: "-mr-1 flex shrink-0 items-center gap-1",
|
|
101
|
+
children: [
|
|
102
|
+
/*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)("button", {
|
|
103
|
+
ref: expandButtonRef,
|
|
104
|
+
type: "button",
|
|
105
|
+
onClick: ()=>setExpanded(!expanded),
|
|
106
|
+
className: "grid size-8 place-items-center rounded-md text-foreground-muted transition-colors hover:bg-surface-hover hover:text-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-border-focus",
|
|
107
|
+
"aria-label": expanded ? 'Collapse modal' : 'Expand modal',
|
|
108
|
+
title: expanded ? 'Collapse modal' : 'Expand modal',
|
|
109
|
+
children: expanded ? /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(external_lucide_react_namespaceObject.Minimize2, {
|
|
110
|
+
size: 16,
|
|
111
|
+
strokeWidth: 1.75
|
|
112
|
+
}) : /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(external_lucide_react_namespaceObject.Maximize2, {
|
|
113
|
+
size: 16,
|
|
114
|
+
strokeWidth: 1.75
|
|
115
|
+
})
|
|
116
|
+
}),
|
|
117
|
+
/*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)("button", {
|
|
118
|
+
type: "button",
|
|
119
|
+
onClick: ()=>onOpenChange?.(false),
|
|
120
|
+
className: "grid size-8 place-items-center rounded-md text-foreground-muted transition-colors hover:bg-surface-hover hover:text-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-border-focus",
|
|
121
|
+
"aria-label": "Close modal",
|
|
122
|
+
title: "Close modal",
|
|
123
|
+
children: /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(external_lucide_react_namespaceObject.X, {
|
|
124
|
+
size: 16,
|
|
125
|
+
strokeWidth: 1.75
|
|
126
|
+
})
|
|
127
|
+
})
|
|
128
|
+
]
|
|
129
|
+
})
|
|
130
|
+
]
|
|
131
|
+
}),
|
|
132
|
+
/*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsxs)("div", {
|
|
133
|
+
className: "flex min-h-0 flex-1",
|
|
134
|
+
children: [
|
|
135
|
+
null != sidebar && /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)("aside", {
|
|
136
|
+
className: (0, apollo_wind_namespaceObject.cn)('w-64 shrink-0 overflow-auto border-r border-border-subtle', sidebarClassName),
|
|
137
|
+
children: sidebar
|
|
138
|
+
}),
|
|
139
|
+
/*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)("main", {
|
|
140
|
+
className: "min-w-0 flex-1 overflow-auto",
|
|
141
|
+
children: children
|
|
142
|
+
})
|
|
143
|
+
]
|
|
144
|
+
})
|
|
145
|
+
]
|
|
146
|
+
})
|
|
147
|
+
})
|
|
148
|
+
});
|
|
149
|
+
}
|
|
150
|
+
exports.CanvasTakeoverModal = __webpack_exports__.CanvasTakeoverModal;
|
|
151
|
+
for(var __rspack_i in __webpack_exports__)if (-1 === [
|
|
152
|
+
"CanvasTakeoverModal"
|
|
153
|
+
].indexOf(__rspack_i)) exports[__rspack_i] = __webpack_exports__[__rspack_i];
|
|
154
|
+
Object.defineProperty(exports, '__esModule', {
|
|
155
|
+
value: true
|
|
156
|
+
});
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { type ReactNode } from 'react';
|
|
2
|
+
export interface CanvasTakeoverModalProps {
|
|
3
|
+
open: boolean;
|
|
4
|
+
onOpenChange?: (open: boolean) => void;
|
|
5
|
+
title: ReactNode;
|
|
6
|
+
headerActions?: ReactNode;
|
|
7
|
+
sidebar?: ReactNode;
|
|
8
|
+
children: ReactNode;
|
|
9
|
+
expanded?: boolean;
|
|
10
|
+
defaultExpanded?: boolean;
|
|
11
|
+
onExpandedChange?: (expanded: boolean) => void;
|
|
12
|
+
className?: string;
|
|
13
|
+
sidebarClassName?: string;
|
|
14
|
+
closeOnBackdropClick?: boolean;
|
|
15
|
+
}
|
|
16
|
+
export declare function CanvasTakeoverModal({ open, onOpenChange, title, headerActions, sidebar, children, expanded: controlledExpanded, defaultExpanded, onExpandedChange, className, sidebarClassName, closeOnBackdropClick, }: CanvasTakeoverModalProps): import("react/jsx-runtime").JSX.Element | null;
|
|
17
|
+
//# sourceMappingURL=CanvasTakeoverModal.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"CanvasTakeoverModal.d.ts","sourceRoot":"","sources":["../../../../src/canvas/components/CanvasTakeoverModal/CanvasTakeoverModal.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAmB,KAAK,SAAS,EAAsC,MAAM,OAAO,CAAC;AAG5F,MAAM,WAAW,wBAAwB;IAEvC,IAAI,EAAE,OAAO,CAAC;IAEd,YAAY,CAAC,EAAE,CAAC,IAAI,EAAE,OAAO,KAAK,IAAI,CAAC;IAEvC,KAAK,EAAE,SAAS,CAAC;IAEjB,aAAa,CAAC,EAAE,SAAS,CAAC;IAE1B,OAAO,CAAC,EAAE,SAAS,CAAC;IAEpB,QAAQ,EAAE,SAAS,CAAC;IAEpB,QAAQ,CAAC,EAAE,OAAO,CAAC;IAEnB,eAAe,CAAC,EAAE,OAAO,CAAC;IAE1B,gBAAgB,CAAC,EAAE,CAAC,QAAQ,EAAE,OAAO,KAAK,IAAI,CAAC;IAE/C,SAAS,CAAC,EAAE,MAAM,CAAC;IAEnB,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAE1B,oBAAoB,CAAC,EAAE,OAAO,CAAC;CAChC;AAMD,wBAAgB,mBAAmB,CAAC,EAClC,IAAI,EACJ,YAAY,EACZ,KAAK,EACL,aAAa,EACb,OAAO,EACP,QAAQ,EACR,QAAQ,EAAE,kBAAkB,EAC5B,eAAuB,EACvB,gBAAgB,EAChB,SAAS,EACT,gBAAgB,EAChB,oBAA2B,GAC5B,EAAE,wBAAwB,kDA2G1B"}
|
|
@@ -0,0 +1,112 @@
|
|
|
1
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { cn } from "@uipath/apollo-wind";
|
|
3
|
+
import { Maximize2, Minimize2, X } from "lucide-react";
|
|
4
|
+
import { useEffect, useId, useRef, useState } from "react";
|
|
5
|
+
import react_focus_lock from "react-focus-lock";
|
|
6
|
+
function CanvasTakeoverModal({ open, onOpenChange, title, headerActions, sidebar, children, expanded: controlledExpanded, defaultExpanded = false, onExpandedChange, className, sidebarClassName, closeOnBackdropClick = true }) {
|
|
7
|
+
const titleId = useId();
|
|
8
|
+
const expandButtonRef = useRef(null);
|
|
9
|
+
const previouslyFocusedElementRef = useRef(null);
|
|
10
|
+
const [uncontrolledExpanded, setUncontrolledExpanded] = useState(defaultExpanded);
|
|
11
|
+
const expanded = controlledExpanded ?? uncontrolledExpanded;
|
|
12
|
+
useEffect(()=>{
|
|
13
|
+
if (!open) return;
|
|
14
|
+
previouslyFocusedElementRef.current = document.activeElement instanceof HTMLElement ? document.activeElement : null;
|
|
15
|
+
const animationFrame = requestAnimationFrame(()=>expandButtonRef.current?.focus());
|
|
16
|
+
const handleKeyDown = (event)=>{
|
|
17
|
+
if ('Escape' === event.key) onOpenChange?.(false);
|
|
18
|
+
};
|
|
19
|
+
document.addEventListener('keydown', handleKeyDown);
|
|
20
|
+
return ()=>{
|
|
21
|
+
cancelAnimationFrame(animationFrame);
|
|
22
|
+
document.removeEventListener('keydown', handleKeyDown);
|
|
23
|
+
previouslyFocusedElementRef.current?.focus();
|
|
24
|
+
previouslyFocusedElementRef.current = null;
|
|
25
|
+
};
|
|
26
|
+
}, [
|
|
27
|
+
onOpenChange,
|
|
28
|
+
open
|
|
29
|
+
]);
|
|
30
|
+
if (!open) return null;
|
|
31
|
+
const setExpanded = (nextExpanded)=>{
|
|
32
|
+
if (void 0 === controlledExpanded) setUncontrolledExpanded(nextExpanded);
|
|
33
|
+
onExpandedChange?.(nextExpanded);
|
|
34
|
+
};
|
|
35
|
+
const handleBackdropClick = (event)=>{
|
|
36
|
+
if (closeOnBackdropClick && event.target === event.currentTarget) onOpenChange?.(false);
|
|
37
|
+
};
|
|
38
|
+
return /*#__PURE__*/ jsx("div", {
|
|
39
|
+
className: cn('absolute inset-0 z-50 flex items-center justify-center bg-ui-backdrop', expanded ? 'p-0' : 'p-3'),
|
|
40
|
+
onMouseDown: handleBackdropClick,
|
|
41
|
+
"data-testid": "canvas-takeover-backdrop",
|
|
42
|
+
children: /*#__PURE__*/ jsx(react_focus_lock, {
|
|
43
|
+
autoFocus: false,
|
|
44
|
+
className: "contents",
|
|
45
|
+
children: /*#__PURE__*/ jsxs("section", {
|
|
46
|
+
role: "dialog",
|
|
47
|
+
"aria-modal": "true",
|
|
48
|
+
"aria-labelledby": titleId,
|
|
49
|
+
"data-expanded": expanded,
|
|
50
|
+
className: cn('flex min-h-0 flex-col overflow-hidden border border-border-subtle bg-surface-raised text-foreground shadow-xl transition-[width,height,border-radius] duration-200', expanded ? 'h-full w-full rounded-none' : 'h-[95%] w-[95%] rounded-2xl', className),
|
|
51
|
+
children: [
|
|
52
|
+
/*#__PURE__*/ jsxs("header", {
|
|
53
|
+
className: "flex h-12 shrink-0 items-center gap-3 border-b border-border-subtle px-4",
|
|
54
|
+
children: [
|
|
55
|
+
/*#__PURE__*/ jsx("h2", {
|
|
56
|
+
id: titleId,
|
|
57
|
+
className: "min-w-0 flex-1 truncate text-sm font-semibold",
|
|
58
|
+
children: title
|
|
59
|
+
}),
|
|
60
|
+
headerActions,
|
|
61
|
+
/*#__PURE__*/ jsxs("div", {
|
|
62
|
+
className: "-mr-1 flex shrink-0 items-center gap-1",
|
|
63
|
+
children: [
|
|
64
|
+
/*#__PURE__*/ jsx("button", {
|
|
65
|
+
ref: expandButtonRef,
|
|
66
|
+
type: "button",
|
|
67
|
+
onClick: ()=>setExpanded(!expanded),
|
|
68
|
+
className: "grid size-8 place-items-center rounded-md text-foreground-muted transition-colors hover:bg-surface-hover hover:text-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-border-focus",
|
|
69
|
+
"aria-label": expanded ? 'Collapse modal' : 'Expand modal',
|
|
70
|
+
title: expanded ? 'Collapse modal' : 'Expand modal',
|
|
71
|
+
children: expanded ? /*#__PURE__*/ jsx(Minimize2, {
|
|
72
|
+
size: 16,
|
|
73
|
+
strokeWidth: 1.75
|
|
74
|
+
}) : /*#__PURE__*/ jsx(Maximize2, {
|
|
75
|
+
size: 16,
|
|
76
|
+
strokeWidth: 1.75
|
|
77
|
+
})
|
|
78
|
+
}),
|
|
79
|
+
/*#__PURE__*/ jsx("button", {
|
|
80
|
+
type: "button",
|
|
81
|
+
onClick: ()=>onOpenChange?.(false),
|
|
82
|
+
className: "grid size-8 place-items-center rounded-md text-foreground-muted transition-colors hover:bg-surface-hover hover:text-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-border-focus",
|
|
83
|
+
"aria-label": "Close modal",
|
|
84
|
+
title: "Close modal",
|
|
85
|
+
children: /*#__PURE__*/ jsx(X, {
|
|
86
|
+
size: 16,
|
|
87
|
+
strokeWidth: 1.75
|
|
88
|
+
})
|
|
89
|
+
})
|
|
90
|
+
]
|
|
91
|
+
})
|
|
92
|
+
]
|
|
93
|
+
}),
|
|
94
|
+
/*#__PURE__*/ jsxs("div", {
|
|
95
|
+
className: "flex min-h-0 flex-1",
|
|
96
|
+
children: [
|
|
97
|
+
null != sidebar && /*#__PURE__*/ jsx("aside", {
|
|
98
|
+
className: cn('w-64 shrink-0 overflow-auto border-r border-border-subtle', sidebarClassName),
|
|
99
|
+
children: sidebar
|
|
100
|
+
}),
|
|
101
|
+
/*#__PURE__*/ jsx("main", {
|
|
102
|
+
className: "min-w-0 flex-1 overflow-auto",
|
|
103
|
+
children: children
|
|
104
|
+
})
|
|
105
|
+
]
|
|
106
|
+
})
|
|
107
|
+
]
|
|
108
|
+
})
|
|
109
|
+
})
|
|
110
|
+
});
|
|
111
|
+
}
|
|
112
|
+
export { CanvasTakeoverModal };
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __webpack_require__ = {};
|
|
3
|
+
(()=>{
|
|
4
|
+
__webpack_require__.d = (exports1, definition)=>{
|
|
5
|
+
for(var key in definition)if (__webpack_require__.o(definition, key) && !__webpack_require__.o(exports1, key)) Object.defineProperty(exports1, key, {
|
|
6
|
+
enumerable: true,
|
|
7
|
+
get: definition[key]
|
|
8
|
+
});
|
|
9
|
+
};
|
|
10
|
+
})();
|
|
11
|
+
(()=>{
|
|
12
|
+
__webpack_require__.o = (obj, prop)=>Object.prototype.hasOwnProperty.call(obj, prop);
|
|
13
|
+
})();
|
|
14
|
+
(()=>{
|
|
15
|
+
__webpack_require__.r = (exports1)=>{
|
|
16
|
+
if ("u" > typeof Symbol && Symbol.toStringTag) Object.defineProperty(exports1, Symbol.toStringTag, {
|
|
17
|
+
value: 'Module'
|
|
18
|
+
});
|
|
19
|
+
Object.defineProperty(exports1, '__esModule', {
|
|
20
|
+
value: true
|
|
21
|
+
});
|
|
22
|
+
};
|
|
23
|
+
})();
|
|
24
|
+
var __webpack_exports__ = {};
|
|
25
|
+
__webpack_require__.r(__webpack_exports__);
|
|
26
|
+
__webpack_require__.d(__webpack_exports__, {
|
|
27
|
+
CanvasTakeoverModal: ()=>external_CanvasTakeoverModal_cjs_namespaceObject.CanvasTakeoverModal
|
|
28
|
+
});
|
|
29
|
+
const external_CanvasTakeoverModal_cjs_namespaceObject = require("./CanvasTakeoverModal.cjs");
|
|
30
|
+
exports.CanvasTakeoverModal = __webpack_exports__.CanvasTakeoverModal;
|
|
31
|
+
for(var __rspack_i in __webpack_exports__)if (-1 === [
|
|
32
|
+
"CanvasTakeoverModal"
|
|
33
|
+
].indexOf(__rspack_i)) exports[__rspack_i] = __webpack_exports__[__rspack_i];
|
|
34
|
+
Object.defineProperty(exports, '__esModule', {
|
|
35
|
+
value: true
|
|
36
|
+
});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/canvas/components/CanvasTakeoverModal/index.ts"],"names":[],"mappings":"AAAA,YAAY,EAAE,wBAAwB,EAAE,MAAM,uBAAuB,CAAC;AACtE,OAAO,EAAE,mBAAmB,EAAE,MAAM,uBAAuB,CAAC"}
|
|
@@ -147,7 +147,7 @@ function JsonTree({ nodes, collapsed = {}, onToggleCollapsed, query, filterPredi
|
|
|
147
147
|
depth: depth
|
|
148
148
|
}, node.path)),
|
|
149
149
|
0 === rows.length && /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)("span", {
|
|
150
|
-
className: "
|
|
150
|
+
className: "p-4 text-center text-xs text-foreground-subtle",
|
|
151
151
|
children: resolvedEmptyMessage
|
|
152
152
|
})
|
|
153
153
|
]
|
|
@@ -119,7 +119,7 @@ function JsonTree({ nodes, collapsed = {}, onToggleCollapsed, query, filterPredi
|
|
|
119
119
|
depth: depth
|
|
120
120
|
}, node.path)),
|
|
121
121
|
0 === rows.length && /*#__PURE__*/ jsx("span", {
|
|
122
|
-
className: "
|
|
122
|
+
className: "p-4 text-center text-xs text-foreground-subtle",
|
|
123
123
|
children: resolvedEmptyMessage
|
|
124
124
|
})
|
|
125
125
|
]
|
|
@@ -41,7 +41,7 @@ const external_NodeKey_cjs_namespaceObject = require("./NodeKey.cjs");
|
|
|
41
41
|
const external_RowActions_cjs_namespaceObject = require("./RowActions.cjs");
|
|
42
42
|
const external_ScalarValueCell_cjs_namespaceObject = require("./ScalarValueCell.cjs");
|
|
43
43
|
const ROW_CLASS = 'group flex min-h-7 cursor-default items-center gap-1.5 py-1 pr-1 transition hover:bg-surface-overlay';
|
|
44
|
-
const
|
|
44
|
+
const VALUE_CELL_CLASS = 'flex min-w-8 flex-1 items-center';
|
|
45
45
|
function rowIndent(depth, extra = 0) {
|
|
46
46
|
return {
|
|
47
47
|
paddingLeft: `${6 + 12 * depth + extra}px`
|
|
@@ -253,7 +253,7 @@ function JsonTreeRow({ node, depth }) {
|
|
|
253
253
|
})
|
|
254
254
|
}),
|
|
255
255
|
null != customCell && /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)("span", {
|
|
256
|
-
className:
|
|
256
|
+
className: VALUE_CELL_CLASS,
|
|
257
257
|
children: customCell
|
|
258
258
|
}),
|
|
259
259
|
/*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(external_DecorationChip_cjs_namespaceObject.DecorationChip, {
|
|
@@ -268,7 +268,7 @@ function JsonTreeRow({ node, depth }) {
|
|
|
268
268
|
}) : /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsxs)(jsx_runtime_namespaceObject.Fragment, {
|
|
269
269
|
children: [
|
|
270
270
|
!wrapped && (null != customCell ? /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)("span", {
|
|
271
|
-
className:
|
|
271
|
+
className: VALUE_CELL_CLASS,
|
|
272
272
|
children: customCell
|
|
273
273
|
}) : !(readOnly && void 0 === node.value || isTemplate) && /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsxs)(jsx_runtime_namespaceObject.Fragment, {
|
|
274
274
|
children: [
|
|
@@ -276,13 +276,16 @@ function JsonTreeRow({ node, depth }) {
|
|
|
276
276
|
className: "shrink-0 font-mono text-xs text-foreground-subtle",
|
|
277
277
|
children: "="
|
|
278
278
|
}),
|
|
279
|
-
/*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
279
|
+
/*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)("span", {
|
|
280
|
+
className: (0, apollo_wind_namespaceObject.cn)(VALUE_CELL_CLASS, 'shrink-3'),
|
|
281
|
+
children: /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(external_ScalarValueCell_cjs_namespaceObject.ScalarValueCell, {
|
|
282
|
+
node: node,
|
|
283
|
+
readOnly: readOnly,
|
|
284
|
+
editing: editingPath === node.path,
|
|
285
|
+
onStartEdit: (n)=>setEditingPath(n.path),
|
|
286
|
+
onStopEdit: ()=>setEditingPath(null),
|
|
287
|
+
onEdit: canEdit ? commitEdit : void 0
|
|
288
|
+
})
|
|
286
289
|
})
|
|
287
290
|
]
|
|
288
291
|
})),
|
|
@@ -328,7 +331,9 @@ function JsonTreeRow({ node, depth }) {
|
|
|
328
331
|
message: 'Click to edit'
|
|
329
332
|
}) : void 0,
|
|
330
333
|
className: (0, apollo_wind_namespaceObject.cn)('w-full whitespace-pre-wrap break-all rounded text-left font-mono text-xs leading-5', canEdit && 'cursor-text', (0, external_ScalarValueCell_cjs_namespaceObject.valueColorClass)(node.type, node.value)),
|
|
331
|
-
children:
|
|
334
|
+
children: (0, external_buildJsonTree_cjs_namespaceObject.formatLeafValue)(node.type, node.value, {
|
|
335
|
+
preserveStringWhitespace: true
|
|
336
|
+
})
|
|
332
337
|
})
|
|
333
338
|
}),
|
|
334
339
|
isContainer && jsonEditingPath === node.path && /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)("div", {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"JsonTreeRow.d.ts","sourceRoot":"","sources":["../../../../src/canvas/components/JsonTree/JsonTreeRow.tsx"],"names":[],"mappings":"AAQA,OAAO,KAAK,EACV,SAAS,EACT,cAAc,EACd,YAAY,EACZ,kBAAkB,EAClB,SAAS,EAET,mBAAmB,EACnB,cAAc,EACd,gBAAgB,EAChB,eAAe,EAChB,MAAM,kBAAkB,CAAC;
|
|
1
|
+
{"version":3,"file":"JsonTreeRow.d.ts","sourceRoot":"","sources":["../../../../src/canvas/components/JsonTree/JsonTreeRow.tsx"],"names":[],"mappings":"AAQA,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AAI,CAAC;IACvC,SAAS,EAAE,CAAC,IAAI,EAAE,YAAY,KAAK,IAAI,CAAC;IACxC,aAAa,EAAE,CAAC,IAAI,EAAE,YAAY,KAAK,IAAI,CAAC;IAC5C,UAAU,EAAE,CAAC,IAAI,EAAE,YAAY,EAAE,KAAK,EAAE,SAAS,GAAG,SAAS,KAAK,IAAI,CAAC;CACxE;AAID,eAAO,MAAM,0BAA0B,0DAA8B,CAAC;AAgBtE,wBAAgB,WAAW,CAAC,EAAE,IAAI,EAAE,KAAK,EAAE,EAAE;IAAE,IAAI,EAAE,YAAY,CAAC;IAAC,KAAK,EAAE,MAAM,CAAA;CAAE,2CA+WjF"}
|
|
@@ -12,7 +12,7 @@ import { NodeKey } from "./NodeKey.js";
|
|
|
12
12
|
import { RowActions } from "./RowActions.js";
|
|
13
13
|
import { ScalarValueCell, valueColorClass } from "./ScalarValueCell.js";
|
|
14
14
|
const ROW_CLASS = 'group flex min-h-7 cursor-default items-center gap-1.5 py-1 pr-1 transition hover:bg-surface-overlay';
|
|
15
|
-
const
|
|
15
|
+
const VALUE_CELL_CLASS = 'flex min-w-8 flex-1 items-center';
|
|
16
16
|
function rowIndent(depth, extra = 0) {
|
|
17
17
|
return {
|
|
18
18
|
paddingLeft: `${6 + 12 * depth + extra}px`
|
|
@@ -224,7 +224,7 @@ function JsonTreeRow({ node, depth }) {
|
|
|
224
224
|
})
|
|
225
225
|
}),
|
|
226
226
|
null != customCell && /*#__PURE__*/ jsx("span", {
|
|
227
|
-
className:
|
|
227
|
+
className: VALUE_CELL_CLASS,
|
|
228
228
|
children: customCell
|
|
229
229
|
}),
|
|
230
230
|
/*#__PURE__*/ jsx(DecorationChip, {
|
|
@@ -239,7 +239,7 @@ function JsonTreeRow({ node, depth }) {
|
|
|
239
239
|
}) : /*#__PURE__*/ jsxs(Fragment, {
|
|
240
240
|
children: [
|
|
241
241
|
!wrapped && (null != customCell ? /*#__PURE__*/ jsx("span", {
|
|
242
|
-
className:
|
|
242
|
+
className: VALUE_CELL_CLASS,
|
|
243
243
|
children: customCell
|
|
244
244
|
}) : !(readOnly && void 0 === node.value || isTemplate) && /*#__PURE__*/ jsxs(Fragment, {
|
|
245
245
|
children: [
|
|
@@ -247,13 +247,16 @@ function JsonTreeRow({ node, depth }) {
|
|
|
247
247
|
className: "shrink-0 font-mono text-xs text-foreground-subtle",
|
|
248
248
|
children: "="
|
|
249
249
|
}),
|
|
250
|
-
/*#__PURE__*/ jsx(
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
250
|
+
/*#__PURE__*/ jsx("span", {
|
|
251
|
+
className: cn(VALUE_CELL_CLASS, 'shrink-3'),
|
|
252
|
+
children: /*#__PURE__*/ jsx(ScalarValueCell, {
|
|
253
|
+
node: node,
|
|
254
|
+
readOnly: readOnly,
|
|
255
|
+
editing: editingPath === node.path,
|
|
256
|
+
onStartEdit: (n)=>setEditingPath(n.path),
|
|
257
|
+
onStopEdit: ()=>setEditingPath(null),
|
|
258
|
+
onEdit: canEdit ? commitEdit : void 0
|
|
259
|
+
})
|
|
257
260
|
})
|
|
258
261
|
]
|
|
259
262
|
})),
|
|
@@ -299,7 +302,9 @@ function JsonTreeRow({ node, depth }) {
|
|
|
299
302
|
message: 'Click to edit'
|
|
300
303
|
}) : void 0,
|
|
301
304
|
className: cn('w-full whitespace-pre-wrap break-all rounded text-left font-mono text-xs leading-5', canEdit && 'cursor-text', valueColorClass(node.type, node.value)),
|
|
302
|
-
children:
|
|
305
|
+
children: formatLeafValue(node.type, node.value, {
|
|
306
|
+
preserveStringWhitespace: true
|
|
307
|
+
})
|
|
303
308
|
})
|
|
304
309
|
}),
|
|
305
310
|
isContainer && jsonEditingPath === node.path && /*#__PURE__*/ jsx("div", {
|
|
@@ -34,7 +34,7 @@ function NodeKey({ node, label, displayPath, onCopyPath, className }) {
|
|
|
34
34
|
const { _ } = (0, index_cjs_namespaceObject.useSafeLingui)();
|
|
35
35
|
const text = label ?? node.key;
|
|
36
36
|
const copyPathText = displayPath ?? node.path;
|
|
37
|
-
const keyClass = (0, apollo_wind_namespaceObject.cn)('max-w-[45%]
|
|
37
|
+
const keyClass = (0, apollo_wind_namespaceObject.cn)('min-w-4 max-w-[45%] truncate text-xs text-foreground', null != label ? 'font-medium' : 'font-mono', void 0 === node.value && 'text-foreground-muted', className);
|
|
38
38
|
if (!onCopyPath) return /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)("span", {
|
|
39
39
|
className: keyClass,
|
|
40
40
|
children: text
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"NodeKey.d.ts","sourceRoot":"","sources":["../../../../src/canvas/components/JsonTree/NodeKey.tsx"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,kBAAkB,CAAC;AAErD,MAAM,WAAW,YAAY;IAC3B,IAAI,EAAE,YAAY,CAAC;IAEnB,KAAK,CAAC,EAAE,MAAM,CAAC;IAEf,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,UAAU,CAAC,EAAE,CAAC,IAAI,EAAE,YAAY,KAAK,IAAI,CAAC;IAC1C,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAOD,wBAAgB,OAAO,CAAC,EAAE,IAAI,EAAE,KAAK,EAAE,WAAW,EAAE,UAAU,EAAE,SAAS,EAAE,EAAE,YAAY,
|
|
1
|
+
{"version":3,"file":"NodeKey.d.ts","sourceRoot":"","sources":["../../../../src/canvas/components/JsonTree/NodeKey.tsx"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,kBAAkB,CAAC;AAErD,MAAM,WAAW,YAAY;IAC3B,IAAI,EAAE,YAAY,CAAC;IAEnB,KAAK,CAAC,EAAE,MAAM,CAAC;IAEf,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,UAAU,CAAC,EAAE,CAAC,IAAI,EAAE,YAAY,KAAK,IAAI,CAAC;IAC1C,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAOD,wBAAgB,OAAO,CAAC,EAAE,IAAI,EAAE,KAAK,EAAE,WAAW,EAAE,UAAU,EAAE,SAAS,EAAE,EAAE,YAAY,2CA4DxF"}
|
|
@@ -6,7 +6,7 @@ function NodeKey({ node, label, displayPath, onCopyPath, className }) {
|
|
|
6
6
|
const { _ } = useSafeLingui();
|
|
7
7
|
const text = label ?? node.key;
|
|
8
8
|
const copyPathText = displayPath ?? node.path;
|
|
9
|
-
const keyClass = cn('max-w-[45%]
|
|
9
|
+
const keyClass = cn('min-w-4 max-w-[45%] truncate text-xs text-foreground', null != label ? 'font-medium' : 'font-mono', void 0 === node.value && 'text-foreground-muted', className);
|
|
10
10
|
if (!onCopyPath) return /*#__PURE__*/ jsx("span", {
|
|
11
11
|
className: keyClass,
|
|
12
12
|
children: text
|
|
@@ -39,7 +39,7 @@ function valueColorClass(type, value) {
|
|
|
39
39
|
if ('boolean' === type) return value ? 'text-success' : 'text-error';
|
|
40
40
|
return 'text-foreground';
|
|
41
41
|
}
|
|
42
|
-
const VALUE_CELL_CLASS = 'min-w-0
|
|
42
|
+
const VALUE_CELL_CLASS = 'min-w-0 truncate rounded font-mono text-xs transition hover:bg-surface-raised';
|
|
43
43
|
function ScalarValueCell({ node, readOnly, editing, onStartEdit, onStopEdit, onEdit }) {
|
|
44
44
|
const { _ } = (0, index_cjs_namespaceObject.useSafeLingui)();
|
|
45
45
|
const missing = void 0 === node.value;
|
|
@@ -59,7 +59,7 @@ function ScalarValueCell({ node, readOnly, editing, onStartEdit, onStopEdit, onE
|
|
|
59
59
|
onCancel: onStopEdit
|
|
60
60
|
});
|
|
61
61
|
if (readOnly || !onEdit) return /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)("span", {
|
|
62
|
-
className: (0, apollo_wind_namespaceObject.cn)('min-w-0
|
|
62
|
+
className: (0, apollo_wind_namespaceObject.cn)('min-w-0 truncate font-mono text-xs', colorClass),
|
|
63
63
|
children: display
|
|
64
64
|
});
|
|
65
65
|
const editTitle = _({
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ScalarValueCell.d.ts","sourceRoot":"","sources":["../../../../src/canvas/components/JsonTree/ScalarValueCell.tsx"],"names":[],"mappings":"AAUA,OAAO,KAAK,EAAE,YAAY,EAAE,gBAAgB,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAC;AAGlF,wBAAgB,eAAe,CAAC,IAAI,EAAE,gBAAgB,EAAE,KAAK,EAAE,SAAS,GAAG,SAAS,GAAG,MAAM,CAM5F;
|
|
1
|
+
{"version":3,"file":"ScalarValueCell.d.ts","sourceRoot":"","sources":["../../../../src/canvas/components/JsonTree/ScalarValueCell.tsx"],"names":[],"mappings":"AAUA,OAAO,KAAK,EAAE,YAAY,EAAE,gBAAgB,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAC;AAGlF,wBAAgB,eAAe,CAAC,IAAI,EAAE,gBAAgB,EAAE,KAAK,EAAE,SAAS,GAAG,SAAS,GAAG,MAAM,CAM5F;AASD,MAAM,WAAW,oBAAoB;IACnC,IAAI,EAAE,YAAY,CAAC;IACnB,QAAQ,EAAE,OAAO,CAAC;IAClB,OAAO,EAAE,OAAO,CAAC;IACjB,WAAW,EAAE,CAAC,IAAI,EAAE,YAAY,KAAK,IAAI,CAAC;IAC1C,UAAU,EAAE,MAAM,IAAI,CAAC;IACvB,MAAM,CAAC,EAAE,CAAC,IAAI,EAAE,YAAY,EAAE,KAAK,EAAE,SAAS,KAAK,IAAI,CAAC;CACzD;AAQD,wBAAgB,eAAe,CAAC,EAC9B,IAAI,EACJ,QAAQ,EACR,OAAO,EACP,WAAW,EACX,UAAU,EACV,MAAM,GACP,EAAE,oBAAoB,2CAkHtB"}
|
|
@@ -10,7 +10,7 @@ function valueColorClass(type, value) {
|
|
|
10
10
|
if ('boolean' === type) return value ? 'text-success' : 'text-error';
|
|
11
11
|
return 'text-foreground';
|
|
12
12
|
}
|
|
13
|
-
const VALUE_CELL_CLASS = 'min-w-0
|
|
13
|
+
const VALUE_CELL_CLASS = 'min-w-0 truncate rounded font-mono text-xs transition hover:bg-surface-raised';
|
|
14
14
|
function ScalarValueCell({ node, readOnly, editing, onStartEdit, onStopEdit, onEdit }) {
|
|
15
15
|
const { _ } = useSafeLingui();
|
|
16
16
|
const missing = void 0 === node.value;
|
|
@@ -30,7 +30,7 @@ function ScalarValueCell({ node, readOnly, editing, onStartEdit, onStopEdit, onE
|
|
|
30
30
|
onCancel: onStopEdit
|
|
31
31
|
});
|
|
32
32
|
if (readOnly || !onEdit) return /*#__PURE__*/ jsx("span", {
|
|
33
|
-
className: cn('min-w-0
|
|
33
|
+
className: cn('min-w-0 truncate font-mono text-xs', colorClass),
|
|
34
34
|
children: display
|
|
35
35
|
});
|
|
36
36
|
const editTitle = _({
|
|
@@ -285,9 +285,9 @@ function removeValueAtPath(root, segments) {
|
|
|
285
285
|
[head]: child
|
|
286
286
|
};
|
|
287
287
|
}
|
|
288
|
-
function formatLeafValue(type, value) {
|
|
288
|
+
function formatLeafValue(type, value, options) {
|
|
289
289
|
if (null == value) return 'null';
|
|
290
|
-
if ('string' === type) return JSON.stringify(value);
|
|
290
|
+
if ('string' === type) return options?.preserveStringWhitespace ? `"${value}"` : JSON.stringify(value);
|
|
291
291
|
return String(value);
|
|
292
292
|
}
|
|
293
293
|
exports.appendPathSegment = __webpack_exports__.appendPathSegment;
|
|
@@ -33,5 +33,7 @@ export declare function collectContainerPaths(nodes: JsonTreeNode[], depth?: num
|
|
|
33
33
|
export declare function getValueAtPath(root: JsonValue | undefined, segments: PathSegment[]): JsonValue | undefined;
|
|
34
34
|
export declare function setValueAtPath(root: JsonValue | undefined, segments: PathSegment[], value: JsonValue): JsonValue;
|
|
35
35
|
export declare function removeValueAtPath(root: JsonValue | undefined, segments: PathSegment[]): JsonValue | undefined;
|
|
36
|
-
export declare function formatLeafValue(type: JsonTreeNodeType, value: JsonValue | undefined
|
|
36
|
+
export declare function formatLeafValue(type: JsonTreeNodeType, value: JsonValue | undefined, options?: {
|
|
37
|
+
preserveStringWhitespace?: boolean;
|
|
38
|
+
}): string;
|
|
37
39
|
//# sourceMappingURL=buildJsonTree.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"buildJsonTree.d.ts","sourceRoot":"","sources":["../../../../src/canvas/components/JsonTree/buildJsonTree.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,aAAa,EACb,UAAU,EACV,UAAU,EAEV,YAAY,EACZ,gBAAgB,EAChB,SAAS,EACT,WAAW,EACZ,MAAM,kBAAkB,CAAC;AAI1B,wBAAgB,YAAY,CAAC,KAAK,EAAE,SAAS,GAAG,SAAS,GAAG,KAAK,IAAI,UAAU,CAE9E;AAGD,wBAAgB,iBAAiB,CAAC,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,WAAW,GAAG,MAAM,CAI5E;AAED,wBAAgB,cAAc,CAAC,KAAK,EAAE,SAAS,GAAG,gBAAgB,CAajE;AAQD,wBAAgB,iBAAiB,CAAC,MAAM,EAAE,UAAU,GAAG,SAAS,GAAG,gBAAgB,CASlF;AAuJD,MAAM,WAAW,oBAAoB;IACnC,MAAM,CAAC,EAAE,UAAU,CAAC;IAEpB,KAAK,CAAC,EAAE,aAAa,CAAC;IAEtB,QAAQ,CAAC,EAAE,MAAM,CAAC;CACnB;AASD,wBAAgB,aAAa,CAAC,OAAO,EAAE,oBAAoB,GAAG,YAAY,EAAE,CAc3E;AASD,wBAAgB,uBAAuB,CAAC,IAAI,EAAE,YAAY,GAAG,OAAO,CAEnE;AAED,MAAM,WAAW,eAAe;IAC9B,IAAI,EAAE,YAAY,CAAC;IACnB,KAAK,EAAE,MAAM,CAAC;CACf;AAGD,MAAM,MAAM,gBAAgB,GAAG,CAC7B,IAAI,EAAE,YAAY,KACf;IAAE,KAAK,CAAC,EAAE,MAAM,CAAC;IAAC,QAAQ,CAAC,EAAE,MAAM,CAAA;CAAE,GAAG,SAAS,CA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,MAAM,CAAC;CACf;AAGD,wBAAgB,qBAAqB,CAAC,KAAK,EAAE,YAAY,EAAE,EAAE,KAAK,SAAI,GAAG,aAAa,EAAE,CASvF;AAED,wBAAgB,cAAc,CAC5B,IAAI,EAAE,SAAS,GAAG,SAAS,EAC3B,QAAQ,EAAE,WAAW,EAAE,GACtB,SAAS,GAAG,SAAS,CAcvB;AAOD,wBAAgB,cAAc,CAC5B,IAAI,EAAE,SAAS,GAAG,SAAS,EAC3B,QAAQ,EAAE,WAAW,EAAE,EACvB,KAAK,EAAE,SAAS,GACf,SAAS,CAoBX;AAOD,wBAAgB,iBAAiB,CAC/B,IAAI,EAAE,SAAS,GAAG,SAAS,EAC3B,QAAQ,EAAE,WAAW,EAAE,GACtB,SAAS,GAAG,SAAS,CAyBvB;AAGD,wBAAgB,eAAe,CAC7B,IAAI,EAAE,gBAAgB,EACtB,KAAK,EAAE,SAAS,GAAG,SAAS,EAC5B,OAAO,CAAC,EAAE;IAAE,wBAAwB,CAAC,EAAE,OAAO,CAAA;CAAE,GAC/C,MAAM,CAMR"}
|
|
@@ -246,9 +246,9 @@ function removeValueAtPath(root, segments) {
|
|
|
246
246
|
[head]: child
|
|
247
247
|
};
|
|
248
248
|
}
|
|
249
|
-
function formatLeafValue(type, value) {
|
|
249
|
+
function formatLeafValue(type, value, options) {
|
|
250
250
|
if (null == value) return 'null';
|
|
251
|
-
if ('string' === type) return JSON.stringify(value);
|
|
251
|
+
if ('string' === type) return options?.preserveStringWhitespace ? `"${value}"` : JSON.stringify(value);
|
|
252
252
|
return String(value);
|
|
253
253
|
}
|
|
254
254
|
export { appendPathSegment, buildJsonTree, collectContainerPaths, flattenJsonTree, formatLeafValue, getValueAtPath, inferValueType, isArrayItemTemplateRoot, isJsonObject, removeValueAtPath, schemaDisplayType, setValueAtPath };
|