@uipath/apollo-wind 2.20.1 → 2.21.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/components/ui/index.cjs +16 -16
- package/dist/editor-themes/codemirror.cjs +194 -0
- package/dist/editor-themes/codemirror.d.ts +128 -0
- package/dist/editor-themes/codemirror.js +145 -0
- package/dist/editor-themes/index.cjs +70 -0
- package/dist/editor-themes/index.d.ts +23 -0
- package/dist/editor-themes/index.js +3 -0
- package/dist/editor-themes/monaco.cjs +1052 -0
- package/dist/editor-themes/monaco.d.ts +830 -0
- package/dist/editor-themes/monaco.js +1003 -0
- package/dist/index.cjs +9 -13
- package/dist/index.d.ts +0 -2
- package/dist/index.js +1 -2
- package/dist/styles.css +50 -7
- package/package.json +13 -3
- package/dist/components/ui/code-block.cjs +0 -235
- package/dist/components/ui/code-block.d.ts +0 -48
- package/dist/components/ui/code-block.js +0 -201
- /package/dist/templates/{Experiments → Patterns}/ideas-AnimatedGradientText.d.ts +0 -0
|
@@ -1,201 +0,0 @@
|
|
|
1
|
-
import { jsx, jsxs } from "react/jsx-runtime";
|
|
2
|
-
import { Check, Copy } from "lucide-react";
|
|
3
|
-
import { useEffect, useRef, useState } from "react";
|
|
4
|
-
import { Prism } from "react-syntax-highlighter";
|
|
5
|
-
import { atomDark, nightOwl, nord, oneDark, oneLight, prism, vs, vscDarkPlus } from "react-syntax-highlighter/dist/esm/styles/prism/index.js";
|
|
6
|
-
import { Button } from "./button.js";
|
|
7
|
-
import { cn } from "../../lib/index.js";
|
|
8
|
-
const THEME_CONFIG = {
|
|
9
|
-
dark: {
|
|
10
|
-
prismStyle: nord,
|
|
11
|
-
bg: '#182027',
|
|
12
|
-
headerBg: '#111920',
|
|
13
|
-
labelColor: '#8ea1b1',
|
|
14
|
-
iconColor: '#6b8899',
|
|
15
|
-
lineNumberColor: '#2e3f4c'
|
|
16
|
-
},
|
|
17
|
-
light: {
|
|
18
|
-
prismStyle: vs,
|
|
19
|
-
bg: '#ffffff',
|
|
20
|
-
headerBg: '#f0f4f8',
|
|
21
|
-
labelColor: '#374151',
|
|
22
|
-
iconColor: '#6b7280',
|
|
23
|
-
lineNumberColor: '#c8d4de'
|
|
24
|
-
},
|
|
25
|
-
'future-dark': {
|
|
26
|
-
prismStyle: vscDarkPlus,
|
|
27
|
-
bg: 'var(--surface-raised)',
|
|
28
|
-
headerBg: '#09090b',
|
|
29
|
-
labelColor: '#a1a1aa',
|
|
30
|
-
iconColor: '#71717a',
|
|
31
|
-
lineNumberColor: '#3f3f46'
|
|
32
|
-
},
|
|
33
|
-
'future-light': {
|
|
34
|
-
prismStyle: vs,
|
|
35
|
-
bg: 'var(--surface-raised)',
|
|
36
|
-
headerBg: '#f4f4f5',
|
|
37
|
-
labelColor: '#52525b',
|
|
38
|
-
iconColor: '#71717a',
|
|
39
|
-
lineNumberColor: '#d4d4d8'
|
|
40
|
-
},
|
|
41
|
-
wireframe: {
|
|
42
|
-
prismStyle: prism,
|
|
43
|
-
bg: '#f9fafb',
|
|
44
|
-
headerBg: '#f3f4f6',
|
|
45
|
-
labelColor: '#6b7280',
|
|
46
|
-
iconColor: '#9ca3af',
|
|
47
|
-
lineNumberColor: '#d1d5db'
|
|
48
|
-
},
|
|
49
|
-
vertex: {
|
|
50
|
-
prismStyle: nightOwl,
|
|
51
|
-
bg: 'oklch(0.21 0.03 258.5)',
|
|
52
|
-
headerBg: 'oklch(0.188 0.028 258.5)',
|
|
53
|
-
labelColor: '#a6b5c9',
|
|
54
|
-
iconColor: '#7a90a8',
|
|
55
|
-
lineNumberColor: 'oklch(0.32 0.03 258.5)'
|
|
56
|
-
},
|
|
57
|
-
canvas: {
|
|
58
|
-
prismStyle: atomDark,
|
|
59
|
-
bg: '#182027',
|
|
60
|
-
headerBg: '#111920',
|
|
61
|
-
labelColor: '#8ea1b1',
|
|
62
|
-
iconColor: '#6b8899',
|
|
63
|
-
lineNumberColor: '#2e3f4c'
|
|
64
|
-
},
|
|
65
|
-
'dark-hc': {
|
|
66
|
-
prismStyle: oneDark,
|
|
67
|
-
bg: '#0a0a0a',
|
|
68
|
-
headerBg: '#141414',
|
|
69
|
-
labelColor: '#e4e4e4',
|
|
70
|
-
iconColor: '#c8c8c8',
|
|
71
|
-
lineNumberColor: '#505050'
|
|
72
|
-
},
|
|
73
|
-
'light-hc': {
|
|
74
|
-
prismStyle: oneLight,
|
|
75
|
-
bg: '#ffffff',
|
|
76
|
-
headerBg: '#e8e8e8',
|
|
77
|
-
labelColor: '#111827',
|
|
78
|
-
iconColor: '#374151',
|
|
79
|
-
lineNumberColor: '#9ca3af'
|
|
80
|
-
}
|
|
81
|
-
};
|
|
82
|
-
const BODY_CLASS_PRIORITY = [
|
|
83
|
-
'future-dark',
|
|
84
|
-
'future-light',
|
|
85
|
-
'dark-hc',
|
|
86
|
-
'light-hc',
|
|
87
|
-
'dark',
|
|
88
|
-
'light',
|
|
89
|
-
'wireframe',
|
|
90
|
-
'vertex',
|
|
91
|
-
'canvas'
|
|
92
|
-
];
|
|
93
|
-
function getBodyTheme() {
|
|
94
|
-
if ("u" < typeof document) return 'dark';
|
|
95
|
-
const bodyClasses = document.body.classList;
|
|
96
|
-
const htmlClasses = document.documentElement.classList;
|
|
97
|
-
return BODY_CLASS_PRIORITY.find((t)=>bodyClasses.contains(t) || htmlClasses.contains(t)) ?? 'future-dark';
|
|
98
|
-
}
|
|
99
|
-
function useApolloTheme() {
|
|
100
|
-
const [theme, setTheme] = useState(getBodyTheme);
|
|
101
|
-
useEffect(()=>{
|
|
102
|
-
if ("u" < typeof document) return;
|
|
103
|
-
const observer = new MutationObserver(()=>setTheme(getBodyTheme()));
|
|
104
|
-
const targets = [
|
|
105
|
-
document.body,
|
|
106
|
-
document.documentElement
|
|
107
|
-
];
|
|
108
|
-
targets.forEach((target)=>{
|
|
109
|
-
if (target) observer.observe(target, {
|
|
110
|
-
attributes: true,
|
|
111
|
-
attributeFilter: [
|
|
112
|
-
'class'
|
|
113
|
-
]
|
|
114
|
-
});
|
|
115
|
-
});
|
|
116
|
-
return ()=>observer.disconnect();
|
|
117
|
-
}, []);
|
|
118
|
-
return theme;
|
|
119
|
-
}
|
|
120
|
-
function CodeBlock({ children, language = 'tsx', showLineNumbers = true, showCopyButton = true, fileName, theme, wrapLines = false, className }) {
|
|
121
|
-
const [copied, setCopied] = useState(false);
|
|
122
|
-
const timeoutRef = useRef(null);
|
|
123
|
-
const detectedTheme = useApolloTheme();
|
|
124
|
-
const activeTheme = theme ?? detectedTheme;
|
|
125
|
-
const config = THEME_CONFIG[activeTheme];
|
|
126
|
-
const code = children.trim();
|
|
127
|
-
async function handleCopy() {
|
|
128
|
-
try {
|
|
129
|
-
await navigator.clipboard.writeText(code);
|
|
130
|
-
setCopied(true);
|
|
131
|
-
timeoutRef.current = setTimeout(()=>setCopied(false), 1500);
|
|
132
|
-
} catch {}
|
|
133
|
-
}
|
|
134
|
-
useEffect(()=>()=>{
|
|
135
|
-
if (timeoutRef.current) clearTimeout(timeoutRef.current);
|
|
136
|
-
}, []);
|
|
137
|
-
const showHeader = !!(fileName || language || showCopyButton);
|
|
138
|
-
return /*#__PURE__*/ jsxs("div", {
|
|
139
|
-
className: cn('overflow-hidden rounded-lg border border-border future:border-border-subtle font-mono text-sm', className),
|
|
140
|
-
style: {
|
|
141
|
-
background: config.bg
|
|
142
|
-
},
|
|
143
|
-
children: [
|
|
144
|
-
showHeader && /*#__PURE__*/ jsxs("div", {
|
|
145
|
-
className: "flex items-center justify-between px-4 py-2 border-b border-border future:border-border-subtle",
|
|
146
|
-
style: {
|
|
147
|
-
background: config.headerBg
|
|
148
|
-
},
|
|
149
|
-
children: [
|
|
150
|
-
/*#__PURE__*/ jsx("span", {
|
|
151
|
-
className: "text-xs font-medium",
|
|
152
|
-
style: {
|
|
153
|
-
color: config.labelColor
|
|
154
|
-
},
|
|
155
|
-
children: fileName ?? language
|
|
156
|
-
}),
|
|
157
|
-
showCopyButton && /*#__PURE__*/ jsx(Button, {
|
|
158
|
-
icon: true,
|
|
159
|
-
variant: "ghost",
|
|
160
|
-
size: "2xs",
|
|
161
|
-
style: {
|
|
162
|
-
color: config.iconColor
|
|
163
|
-
},
|
|
164
|
-
onClick: handleCopy,
|
|
165
|
-
"aria-label": copied ? 'Copied!' : 'Copy code',
|
|
166
|
-
children: copied ? /*#__PURE__*/ jsx(Check, {}) : /*#__PURE__*/ jsx(Copy, {})
|
|
167
|
-
})
|
|
168
|
-
]
|
|
169
|
-
}),
|
|
170
|
-
/*#__PURE__*/ jsx(Prism, {
|
|
171
|
-
language: language,
|
|
172
|
-
style: config.prismStyle,
|
|
173
|
-
showLineNumbers: showLineNumbers,
|
|
174
|
-
wrapLines: wrapLines,
|
|
175
|
-
wrapLongLines: wrapLines,
|
|
176
|
-
customStyle: {
|
|
177
|
-
margin: 0,
|
|
178
|
-
border: 'none',
|
|
179
|
-
borderRadius: 0,
|
|
180
|
-
background: 'transparent',
|
|
181
|
-
padding: '1rem',
|
|
182
|
-
fontSize: 13,
|
|
183
|
-
lineHeight: 1.6
|
|
184
|
-
},
|
|
185
|
-
lineNumberStyle: {
|
|
186
|
-
color: config.lineNumberColor,
|
|
187
|
-
minWidth: '2.5em',
|
|
188
|
-
paddingRight: '1.25em',
|
|
189
|
-
userSelect: 'none'
|
|
190
|
-
},
|
|
191
|
-
codeTagProps: {
|
|
192
|
-
style: {
|
|
193
|
-
fontFamily: 'inherit'
|
|
194
|
-
}
|
|
195
|
-
},
|
|
196
|
-
children: code
|
|
197
|
-
})
|
|
198
|
-
]
|
|
199
|
-
});
|
|
200
|
-
}
|
|
201
|
-
export { CodeBlock };
|
|
File without changes
|