@gravitee/graphene-core 2.44.0 → 2.45.0-monaco-base.11a7a3d
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/Skeleton-C30qULzD.js +1745 -0
- package/dist/code-editor/index.d.ts +2 -0
- package/dist/code-editor/index.d.ts.map +1 -0
- package/dist/code-editor/index.js +228 -0
- package/dist/composed/CodeEditor/CodeEditor.d.ts +29 -0
- package/dist/composed/CodeEditor/CodeEditor.d.ts.map +1 -0
- package/dist/composed/CodeEditor/index.d.ts +6 -0
- package/dist/composed/CodeEditor/index.d.ts.map +1 -0
- package/dist/composed/CodeEditor/models/index.d.ts +16 -0
- package/dist/composed/CodeEditor/models/index.d.ts.map +1 -0
- package/dist/composed/CodeEditor/setupCodeEditor.d.ts +65 -0
- package/dist/composed/CodeEditor/setupCodeEditor.d.ts.map +1 -0
- package/dist/composed/CodeEditor/theme/buildTheme.d.ts +49 -0
- package/dist/composed/CodeEditor/theme/buildTheme.d.ts.map +1 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +9051 -10795
- package/dist/styles/globals.css +1 -1
- package/dist/tokens/component.css +18 -0
- package/package.json +16 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/code-editor/index.ts"],"names":[],"mappings":"AAIA,cAAc,wBAAwB,CAAC"}
|
|
@@ -0,0 +1,228 @@
|
|
|
1
|
+
import { n as e, t } from "../Skeleton-C30qULzD.js";
|
|
2
|
+
import * as n from "react";
|
|
3
|
+
import { jsx as r } from "react/jsx-runtime";
|
|
4
|
+
import { Editor as i, loader as a } from "@monaco-editor/react";
|
|
5
|
+
//#region src/composed/CodeEditor/setupCodeEditor.ts
|
|
6
|
+
var o = "__grapheneCodeEditorConfigured__", s = !!globalThis[o];
|
|
7
|
+
function c({ baseUrl: e, monaco: t }) {
|
|
8
|
+
if (!s) {
|
|
9
|
+
if (t !== void 0) a.config({ monaco: t });
|
|
10
|
+
else if (e !== void 0) a.config({ paths: { vs: e.replace(/\/+$/, "") } });
|
|
11
|
+
else return;
|
|
12
|
+
s = !0, globalThis[o] = !0;
|
|
13
|
+
}
|
|
14
|
+
}
|
|
15
|
+
//#endregion
|
|
16
|
+
//#region src/composed/CodeEditor/theme/buildTheme.ts
|
|
17
|
+
var l = "graphene";
|
|
18
|
+
function u(e) {
|
|
19
|
+
let t = {}, n = [], r = document.createElement("div");
|
|
20
|
+
document.body.appendChild(r);
|
|
21
|
+
let i = getComputedStyle(r), a = document.createElement("canvas");
|
|
22
|
+
a.width = 1, a.height = 1;
|
|
23
|
+
let o = a.getContext("2d");
|
|
24
|
+
for (let a of e) {
|
|
25
|
+
if (!o) {
|
|
26
|
+
t[a] = "#000000";
|
|
27
|
+
continue;
|
|
28
|
+
}
|
|
29
|
+
r.style.backgroundColor = `var(${a})`;
|
|
30
|
+
let e = i.backgroundColor;
|
|
31
|
+
(e === "" || e === "rgba(0, 0, 0, 0)") && n.push(a), o.clearRect(0, 0, 1, 1), o.fillStyle = e, o.fillRect(0, 0, 1, 1);
|
|
32
|
+
let [s, c, l] = o.getImageData(0, 0, 1, 1).data;
|
|
33
|
+
t[a] = "#" + [
|
|
34
|
+
s,
|
|
35
|
+
c,
|
|
36
|
+
l
|
|
37
|
+
].map((e) => e.toString(16).padStart(2, "0")).join("");
|
|
38
|
+
}
|
|
39
|
+
return document.body.removeChild(r), t;
|
|
40
|
+
}
|
|
41
|
+
function d() {
|
|
42
|
+
let e = document.documentElement.classList.contains("dark"), t = u([
|
|
43
|
+
"--background",
|
|
44
|
+
"--foreground",
|
|
45
|
+
"--border",
|
|
46
|
+
"--muted",
|
|
47
|
+
"--muted-foreground",
|
|
48
|
+
"--primary",
|
|
49
|
+
"--code-editor-string",
|
|
50
|
+
"--code-editor-keyword",
|
|
51
|
+
"--code-editor-number",
|
|
52
|
+
"--code-editor-type",
|
|
53
|
+
"--code-editor-special"
|
|
54
|
+
]), n = t["--background"], r = t["--foreground"], i = t["--border"], a = t["--muted"], o = t["--muted-foreground"], s = t["--primary"], c = t["--code-editor-string"], l = t["--code-editor-keyword"], d = t["--code-editor-number"], f = t["--code-editor-type"], p = t["--code-editor-special"], m = (e) => e.slice(1);
|
|
55
|
+
return {
|
|
56
|
+
base: e ? "vs-dark" : "vs",
|
|
57
|
+
inherit: !0,
|
|
58
|
+
rules: [
|
|
59
|
+
{
|
|
60
|
+
token: "string",
|
|
61
|
+
foreground: m(c)
|
|
62
|
+
},
|
|
63
|
+
{
|
|
64
|
+
token: "string.key.json",
|
|
65
|
+
foreground: m(f)
|
|
66
|
+
},
|
|
67
|
+
{
|
|
68
|
+
token: "keyword",
|
|
69
|
+
foreground: m(l)
|
|
70
|
+
},
|
|
71
|
+
{
|
|
72
|
+
token: "keyword.json",
|
|
73
|
+
foreground: m(p)
|
|
74
|
+
},
|
|
75
|
+
{
|
|
76
|
+
token: "number",
|
|
77
|
+
foreground: m(d)
|
|
78
|
+
},
|
|
79
|
+
{
|
|
80
|
+
token: "type",
|
|
81
|
+
foreground: m(f)
|
|
82
|
+
},
|
|
83
|
+
{
|
|
84
|
+
token: "tag",
|
|
85
|
+
foreground: m(l)
|
|
86
|
+
},
|
|
87
|
+
{
|
|
88
|
+
token: "attribute.name",
|
|
89
|
+
foreground: m(f)
|
|
90
|
+
},
|
|
91
|
+
{
|
|
92
|
+
token: "attribute.value",
|
|
93
|
+
foreground: m(c)
|
|
94
|
+
},
|
|
95
|
+
{
|
|
96
|
+
token: "comment",
|
|
97
|
+
foreground: m(o),
|
|
98
|
+
fontStyle: "italic"
|
|
99
|
+
},
|
|
100
|
+
{
|
|
101
|
+
token: "comment.line",
|
|
102
|
+
foreground: m(o),
|
|
103
|
+
fontStyle: "italic"
|
|
104
|
+
},
|
|
105
|
+
{
|
|
106
|
+
token: "comment.block",
|
|
107
|
+
foreground: m(o),
|
|
108
|
+
fontStyle: "italic"
|
|
109
|
+
},
|
|
110
|
+
{
|
|
111
|
+
token: "identifier",
|
|
112
|
+
foreground: m(r)
|
|
113
|
+
},
|
|
114
|
+
{
|
|
115
|
+
token: "variable",
|
|
116
|
+
foreground: m(r)
|
|
117
|
+
},
|
|
118
|
+
{
|
|
119
|
+
token: "delimiter",
|
|
120
|
+
foreground: m(r)
|
|
121
|
+
}
|
|
122
|
+
],
|
|
123
|
+
colors: {
|
|
124
|
+
"editor.background": n,
|
|
125
|
+
"editor.foreground": r,
|
|
126
|
+
"editor.lineHighlightBackground": r + "08",
|
|
127
|
+
"editor.lineHighlightBorder": "#00000000",
|
|
128
|
+
"editor.selectionBackground": s + "4d",
|
|
129
|
+
"editor.inactiveSelectionBackground": s + "26",
|
|
130
|
+
"editorCursor.foreground": s,
|
|
131
|
+
"editorLineNumber.foreground": o,
|
|
132
|
+
"editorLineNumber.activeForeground": r,
|
|
133
|
+
"editorGutter.background": n,
|
|
134
|
+
"editorIndentGuide.background1": i,
|
|
135
|
+
"editorIndentGuide.activeBackground1": o,
|
|
136
|
+
"editorWidget.background": a,
|
|
137
|
+
"editorWidget.foreground": r,
|
|
138
|
+
"editorWidget.border": i,
|
|
139
|
+
"editorWidget.resizeBorder": i,
|
|
140
|
+
"widget.shadow": r + "1a",
|
|
141
|
+
"input.background": n,
|
|
142
|
+
"input.border": i,
|
|
143
|
+
"input.foreground": r,
|
|
144
|
+
"input.placeholderForeground": o,
|
|
145
|
+
"inputOption.activeBorder": s,
|
|
146
|
+
"inputOption.activeBackground": s + "26",
|
|
147
|
+
"inputOption.activeForeground": s,
|
|
148
|
+
"button.background": s,
|
|
149
|
+
"button.foreground": "#ffffff",
|
|
150
|
+
"editorSuggestWidget.background": n,
|
|
151
|
+
"editorSuggestWidget.border": i,
|
|
152
|
+
"editorSuggestWidget.selectedBackground": s + "26",
|
|
153
|
+
"scrollbarSlider.background": i + "80",
|
|
154
|
+
"scrollbarSlider.hoverBackground": i,
|
|
155
|
+
"scrollbarSlider.activeBackground": o + "80"
|
|
156
|
+
}
|
|
157
|
+
};
|
|
158
|
+
}
|
|
159
|
+
//#endregion
|
|
160
|
+
//#region src/composed/CodeEditor/CodeEditor.tsx
|
|
161
|
+
function f(e) {
|
|
162
|
+
e.editor.defineTheme(l, d()), e.editor.setTheme(l);
|
|
163
|
+
}
|
|
164
|
+
var p = (e) => {
|
|
165
|
+
f(e);
|
|
166
|
+
};
|
|
167
|
+
function m() {
|
|
168
|
+
let [e, t] = n.useState(typeof document < "u" && document.documentElement.classList.contains("dark"));
|
|
169
|
+
return n.useEffect(() => {
|
|
170
|
+
let e = new MutationObserver(() => {
|
|
171
|
+
t(document.documentElement.classList.contains("dark"));
|
|
172
|
+
});
|
|
173
|
+
return e.observe(document.documentElement, {
|
|
174
|
+
attributes: !0,
|
|
175
|
+
attributeFilter: ["class"]
|
|
176
|
+
}), () => e.disconnect();
|
|
177
|
+
}, []), e;
|
|
178
|
+
}
|
|
179
|
+
function h({ value: a, defaultValue: o, onChange: s, language: c = "plaintext", readOnly: u = !1, disabled: d = !1, height: h, className: g, options: _, onMount: v }) {
|
|
180
|
+
let y = m(), b = n.useRef(null), x = n.useRef(null);
|
|
181
|
+
n.useEffect(() => {
|
|
182
|
+
b.current && f(b.current);
|
|
183
|
+
}, [y]), n.useEffect(() => {}, []);
|
|
184
|
+
let S = n.useCallback((e, t) => {
|
|
185
|
+
b.current = t, x.current = e, v?.(e, t);
|
|
186
|
+
}, [v]), C = typeof h == "number" ? `${h}px` : h ?? "300px";
|
|
187
|
+
return /* @__PURE__ */ r("div", {
|
|
188
|
+
"data-slot": "code-editor",
|
|
189
|
+
"data-disabled": d ? "" : void 0,
|
|
190
|
+
"data-readonly": u && !d ? "" : void 0,
|
|
191
|
+
className: e("overflow-hidden rounded-lg border border-input bg-background", "data-disabled:pointer-events-none data-disabled:opacity-50", "data-readonly:bg-muted/30", g),
|
|
192
|
+
style: { height: C },
|
|
193
|
+
children: /* @__PURE__ */ r(i, {
|
|
194
|
+
height: "100%",
|
|
195
|
+
language: c,
|
|
196
|
+
value: a,
|
|
197
|
+
defaultValue: o,
|
|
198
|
+
theme: l,
|
|
199
|
+
onChange: s,
|
|
200
|
+
onMount: S,
|
|
201
|
+
beforeMount: p,
|
|
202
|
+
loading: /* @__PURE__ */ r(t, { className: "size-full" }),
|
|
203
|
+
options: {
|
|
204
|
+
readOnly: u || d,
|
|
205
|
+
minimap: { enabled: !1 },
|
|
206
|
+
scrollBeyondLastLine: !1,
|
|
207
|
+
automaticLayout: !0,
|
|
208
|
+
fontFamily: "ui-monospace, Menlo, Consolas, \"Cascadia Code\", \"Liberation Mono\", monospace",
|
|
209
|
+
fontSize: 13,
|
|
210
|
+
lineHeight: 20,
|
|
211
|
+
padding: {
|
|
212
|
+
top: 8,
|
|
213
|
+
bottom: 8
|
|
214
|
+
},
|
|
215
|
+
glyphMargin: !1,
|
|
216
|
+
renderLineHighlight: "line",
|
|
217
|
+
scrollbar: {
|
|
218
|
+
verticalScrollbarSize: 6,
|
|
219
|
+
horizontalScrollbarSize: 6
|
|
220
|
+
},
|
|
221
|
+
overviewRulerLanes: 0,
|
|
222
|
+
..._
|
|
223
|
+
}
|
|
224
|
+
})
|
|
225
|
+
});
|
|
226
|
+
}
|
|
227
|
+
//#endregion
|
|
228
|
+
export { h as CodeEditor, c as setupCodeEditor };
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { EditorProps } from '@monaco-editor/react';
|
|
2
|
+
import { CodeEditorLanguage } from './models';
|
|
3
|
+
import * as React from 'react';
|
|
4
|
+
export interface CodeEditorProps {
|
|
5
|
+
value?: string;
|
|
6
|
+
defaultValue?: string;
|
|
7
|
+
onChange?: (value: string | undefined) => void;
|
|
8
|
+
language?: CodeEditorLanguage;
|
|
9
|
+
/** Lock editing from the schema (read-only intent). */
|
|
10
|
+
readOnly?: boolean;
|
|
11
|
+
/** Lock editing from form state; also dims the editor. */
|
|
12
|
+
disabled?: boolean;
|
|
13
|
+
/**
|
|
14
|
+
* Editor height. Accepts a pixel number (`300`) or any CSS value (`"50vh"`). Defaults to
|
|
15
|
+
* `300px`. Applied as CSS `height` on the wrapper, so it sets the editor's intrinsic size.
|
|
16
|
+
* To make the editor stretch to fill a flex parent instead, pass
|
|
17
|
+
* `className="flex-1 min-h-0"` — `flex-1` overrides `height` via `flex-grow`, and
|
|
18
|
+
* `min-h-0` is required so the wrapper can shrink below its content's intrinsic size.
|
|
19
|
+
*/
|
|
20
|
+
height?: number | string;
|
|
21
|
+
className?: string;
|
|
22
|
+
/** Advanced escape hatch — passes through to Monaco's construction options. */
|
|
23
|
+
options?: EditorProps['options'];
|
|
24
|
+
/** Advanced escape hatch — Monaco editor + namespace once mounted. */
|
|
25
|
+
onMount?: EditorProps['onMount'];
|
|
26
|
+
}
|
|
27
|
+
declare function CodeEditor({ value, defaultValue, onChange, language, readOnly, disabled, height, className, options, onMount, }: CodeEditorProps): React.JSX.Element;
|
|
28
|
+
export { CodeEditor };
|
|
29
|
+
//# sourceMappingURL=CodeEditor.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"CodeEditor.d.ts","sourceRoot":"","sources":["../../../src/composed/CodeEditor/CodeEditor.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAe,WAAW,EAAU,MAAM,sBAAsB,CAAC;AAC7E,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAG/B,OAAO,KAAK,EAAE,kBAAkB,EAAoB,MAAM,UAAU,CAAC;AAIrE,MAAM,WAAW,eAAe;IAC9B,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,GAAG,SAAS,KAAK,IAAI,CAAC;IAC/C,QAAQ,CAAC,EAAE,kBAAkB,CAAC;IAC9B,uDAAuD;IACvD,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,0DAA0D;IAC1D,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB;;;;;;OAMG;IACH,MAAM,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;IACzB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,+EAA+E;IAC/E,OAAO,CAAC,EAAE,WAAW,CAAC,SAAS,CAAC,CAAC;IACjC,sEAAsE;IACtE,OAAO,CAAC,EAAE,WAAW,CAAC,SAAS,CAAC,CAAC;CAClC;AA6BD,iBAAS,UAAU,CAAC,EAClB,KAAK,EACL,YAAY,EACZ,QAAQ,EACR,QAAsB,EACtB,QAAgB,EAChB,QAAgB,EAChB,MAAM,EACN,SAAS,EACT,OAAO,EACP,OAAO,GACR,EAAE,eAAe,qBAwEjB;AAED,OAAO,EAAE,UAAU,EAAE,CAAC"}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
export { CodeEditor } from './CodeEditor';
|
|
2
|
+
export type { CodeEditorProps } from './CodeEditor';
|
|
3
|
+
export { setupCodeEditor } from './setupCodeEditor';
|
|
4
|
+
export type { SetupCodeEditorOptions } from './setupCodeEditor';
|
|
5
|
+
export type { CodeEditorLanguage } from './models';
|
|
6
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/composed/CodeEditor/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAC1C,YAAY,EAAE,eAAe,EAAE,MAAM,cAAc,CAAC;AACpD,OAAO,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;AACpD,YAAY,EAAE,sBAAsB,EAAE,MAAM,mBAAmB,CAAC;AAChE,YAAY,EAAE,kBAAkB,EAAE,MAAM,UAAU,CAAC"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { editor } from 'monaco-editor';
|
|
2
|
+
/**
|
|
3
|
+
* The Monaco standalone editor instance handed to `onMount`. Internal — deliberately kept out
|
|
4
|
+
* of the public barrel so no engine type leaks into the package surface.
|
|
5
|
+
*/
|
|
6
|
+
export type StandaloneEditor = editor.IStandaloneCodeEditor;
|
|
7
|
+
/**
|
|
8
|
+
* Languages with first-class support in the Graphene `CodeEditor`. The engine colors any
|
|
9
|
+
* built-in Monaco language id; this union curates the officially-supported set (and is what the
|
|
10
|
+
* JSON-schema integration maps onto in a later PR).
|
|
11
|
+
*
|
|
12
|
+
* `string & {}` widens the type to accept custom-registered language ids (e.g. GAPL) while
|
|
13
|
+
* preserving autocomplete for the known values.
|
|
14
|
+
*/
|
|
15
|
+
export type CodeEditorLanguage = 'json' | 'yaml' | 'html' | 'markdown' | 'css' | 'plaintext' | 'javascript' | (string & {});
|
|
16
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/composed/CodeEditor/models/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,eAAe,CAAC;AAE5C;;;GAGG;AACH,MAAM,MAAM,gBAAgB,GAAG,MAAM,CAAC,qBAAqB,CAAC;AAE5D;;;;;;;GAOG;AACH,MAAM,MAAM,kBAAkB,GAC1B,MAAM,GACN,MAAM,GACN,MAAM,GACN,UAAU,GACV,KAAK,GACL,WAAW,GACX,YAAY,GACZ,CAAC,MAAM,GAAG,EAAE,CAAC,CAAC"}
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
import { loader } from '@monaco-editor/react';
|
|
2
|
+
type MonacoLoaderConfig = Parameters<typeof loader.config>[0];
|
|
3
|
+
export interface SetupCodeEditorOptions {
|
|
4
|
+
/**
|
|
5
|
+
* AMD / self-hosted: URL serving `node_modules/monaco-editor/min/vs`, e.g. `"/assets/monaco/vs"`.
|
|
6
|
+
* Use when Monaco is served as static files (e.g. CopyPlugin, Nginx, CDN) rather than bundled.
|
|
7
|
+
*/
|
|
8
|
+
baseUrl?: string;
|
|
9
|
+
/**
|
|
10
|
+
* ESM / npm-bundled: the `monaco-editor` namespace import.
|
|
11
|
+
* Use for Rspack / webpack / Module Federation host shells where Monaco is bundled as ESM.
|
|
12
|
+
* @example
|
|
13
|
+
* import * as monaco from 'monaco-editor';
|
|
14
|
+
* setupCodeEditor({ monaco });
|
|
15
|
+
*/
|
|
16
|
+
monaco?: MonacoLoaderConfig['monaco'];
|
|
17
|
+
}
|
|
18
|
+
/**
|
|
19
|
+
* Configure Monaco's loader before the first `<CodeEditor>` mounts.
|
|
20
|
+
* Call once at app bootstrap — idempotent, first caller wins.
|
|
21
|
+
*
|
|
22
|
+
* Two modes:
|
|
23
|
+
* - `{ baseUrl }` — AMD/self-hosted, points `@monaco-editor/react`'s loader at a local `vs` folder.
|
|
24
|
+
* - `{ monaco }` — ESM/bundled, passes the `monaco-editor` namespace to the loader so it uses
|
|
25
|
+
* the npm-installed instance instead of fetching from CDN. Required for Rspack / MF hosts.
|
|
26
|
+
*
|
|
27
|
+
* If both `baseUrl` and `monaco` are passed, `monaco` wins and `baseUrl` is ignored (ESM > AMD).
|
|
28
|
+
* A DEV-only warning is emitted in that case — pick one and drop the other.
|
|
29
|
+
*
|
|
30
|
+
* @example
|
|
31
|
+
* // ESM mode under Vite / Rspack — pair `setupCodeEditor({ monaco })` with a `MonacoEnvironment`
|
|
32
|
+
* // that resolves each language worker through `new URL(..., import.meta.url)` so the bundler
|
|
33
|
+
* // emits one chunk per worker, served from the same origin (CSP-safe, offline-capable).
|
|
34
|
+
* import * as monaco from 'monaco-editor';
|
|
35
|
+
* import { setupCodeEditor } from '@gravitee/graphene-core';
|
|
36
|
+
*
|
|
37
|
+
* self.MonacoEnvironment = {
|
|
38
|
+
* getWorker(_workerId, label) {
|
|
39
|
+
* if (label === 'json') {
|
|
40
|
+
* return new Worker(new URL('monaco-editor/esm/vs/language/json/json.worker', import.meta.url));
|
|
41
|
+
* }
|
|
42
|
+
* if (label === 'css' || label === 'scss' || label === 'less') {
|
|
43
|
+
* return new Worker(new URL('monaco-editor/esm/vs/language/css/css.worker', import.meta.url));
|
|
44
|
+
* }
|
|
45
|
+
* if (label === 'html' || label === 'handlebars' || label === 'razor') {
|
|
46
|
+
* return new Worker(new URL('monaco-editor/esm/vs/language/html/html.worker', import.meta.url));
|
|
47
|
+
* }
|
|
48
|
+
* if (label === 'typescript' || label === 'javascript') {
|
|
49
|
+
* return new Worker(new URL('monaco-editor/esm/vs/language/typescript/ts.worker', import.meta.url));
|
|
50
|
+
* }
|
|
51
|
+
* return new Worker(new URL('monaco-editor/esm/vs/editor/editor.worker', import.meta.url));
|
|
52
|
+
* },
|
|
53
|
+
* };
|
|
54
|
+
*
|
|
55
|
+
* setupCodeEditor({ monaco });
|
|
56
|
+
*/
|
|
57
|
+
export declare function setupCodeEditor({ baseUrl, monaco }: SetupCodeEditorOptions): void;
|
|
58
|
+
/**
|
|
59
|
+
* Whether {@link setupCodeEditor} has been called. `<CodeEditor>` reads this to emit a dev-only
|
|
60
|
+
* warning when it mounts without an explicit init — otherwise Monaco silently falls back to the
|
|
61
|
+
* CDN, which breaks under a strict CSP or offline.
|
|
62
|
+
*/
|
|
63
|
+
export declare function isCodeEditorConfigured(): boolean;
|
|
64
|
+
export {};
|
|
65
|
+
//# sourceMappingURL=setupCodeEditor.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"setupCodeEditor.d.ts","sourceRoot":"","sources":["../../../src/composed/CodeEditor/setupCodeEditor.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,sBAAsB,CAAC;AAE9C,KAAK,kBAAkB,GAAG,UAAU,CAAC,OAAO,MAAM,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,CAAC;AAE9D,MAAM,WAAW,sBAAsB;IACrC;;;OAGG;IACH,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB;;;;;;OAMG;IACH,MAAM,CAAC,EAAE,kBAAkB,CAAC,QAAQ,CAAC,CAAC;CACvC;AASD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAsCG;AACH,wBAAgB,eAAe,CAAC,EAAE,OAAO,EAAE,MAAM,EAAE,EAAE,sBAAsB,GAAG,IAAI,CAoBjF;AAED;;;;GAIG;AACH,wBAAgB,sBAAsB,IAAI,OAAO,CAEhD"}
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
export declare const THEME_NAME = "graphene";
|
|
2
|
+
export declare function buildTheme(): {
|
|
3
|
+
base: "vs-dark" | "vs";
|
|
4
|
+
inherit: boolean;
|
|
5
|
+
rules: ({
|
|
6
|
+
token: string;
|
|
7
|
+
foreground: string;
|
|
8
|
+
fontStyle?: undefined;
|
|
9
|
+
} | {
|
|
10
|
+
token: string;
|
|
11
|
+
foreground: string;
|
|
12
|
+
fontStyle: string;
|
|
13
|
+
})[];
|
|
14
|
+
colors: {
|
|
15
|
+
'editor.background': string;
|
|
16
|
+
'editor.foreground': string;
|
|
17
|
+
'editor.lineHighlightBackground': string;
|
|
18
|
+
'editor.lineHighlightBorder': string;
|
|
19
|
+
'editor.selectionBackground': string;
|
|
20
|
+
'editor.inactiveSelectionBackground': string;
|
|
21
|
+
'editorCursor.foreground': string;
|
|
22
|
+
'editorLineNumber.foreground': string;
|
|
23
|
+
'editorLineNumber.activeForeground': string;
|
|
24
|
+
'editorGutter.background': string;
|
|
25
|
+
'editorIndentGuide.background1': string;
|
|
26
|
+
'editorIndentGuide.activeBackground1': string;
|
|
27
|
+
'editorWidget.background': string;
|
|
28
|
+
'editorWidget.foreground': string;
|
|
29
|
+
'editorWidget.border': string;
|
|
30
|
+
'editorWidget.resizeBorder': string;
|
|
31
|
+
'widget.shadow': string;
|
|
32
|
+
'input.background': string;
|
|
33
|
+
'input.border': string;
|
|
34
|
+
'input.foreground': string;
|
|
35
|
+
'input.placeholderForeground': string;
|
|
36
|
+
'inputOption.activeBorder': string;
|
|
37
|
+
'inputOption.activeBackground': string;
|
|
38
|
+
'inputOption.activeForeground': string;
|
|
39
|
+
'button.background': string;
|
|
40
|
+
'button.foreground': string;
|
|
41
|
+
'editorSuggestWidget.background': string;
|
|
42
|
+
'editorSuggestWidget.border': string;
|
|
43
|
+
'editorSuggestWidget.selectedBackground': string;
|
|
44
|
+
'scrollbarSlider.background': string;
|
|
45
|
+
'scrollbarSlider.hoverBackground': string;
|
|
46
|
+
'scrollbarSlider.activeBackground': string;
|
|
47
|
+
};
|
|
48
|
+
};
|
|
49
|
+
//# sourceMappingURL=buildTheme.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"buildTheme.d.ts","sourceRoot":"","sources":["../../../../src/composed/CodeEditor/theme/buildTheme.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,UAAU,aAAa,CAAC;AAqDrC,wBAAgB,UAAU;UAiCe,SAAS,GAAG,IAAI;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAuDxD"}
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,EAAE,EAAE,MAAM,aAAa,CAAC;AACjC,OAAO,EAAE,uBAAuB,EAAE,kBAAkB,EAAE,MAAM,8BAA8B,CAAC;AAG3F,cAAc,kBAAkB,CAAC;AACjC,cAAc,cAAc,CAAC;AAC7B,cAAc,eAAe,CAAC;AAC9B,cAAc,cAAc,CAAC;AAC7B,cAAc,mBAAmB,CAAC;AAClC,cAAc,eAAe,CAAC;AAC9B,cAAc,oBAAoB,CAAC;AACnC,cAAc,iBAAiB,CAAC;AAChC,cAAc,aAAa,CAAC;AAC5B,cAAc,iBAAiB,CAAC;AAChC,cAAc,oBAAoB,CAAC;AACnC,cAAc,iBAAiB,CAAC;AAChC,cAAc,gBAAgB,CAAC;AAC/B,cAAc,oBAAoB,CAAC;AACnC,cAAc,eAAe,CAAC;AAC9B,cAAc,eAAe,CAAC;AAC9B,cAAc,qBAAqB,CAAC;AACpC,cA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