@react-fabric/monaco 1.0.0-beta.36 → 1.0.0-beta.38
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/{src/components/CodeEditor.module.css → css/_codeEditor.css} +23 -25
- package/css/styles.css +24 -0
- package/dist/cjs/components/CodeEditor.js +2 -3
- package/dist/esm/components/CodeEditor.js +2 -3
- package/package.json +6 -4
- package/src/components/CodeEditor.tsx +2 -3
- package/dist/cjs/components/CodeEditor.module.css +0 -1
- package/dist/esm/components/CodeEditor.module.css +0 -1
|
@@ -23,67 +23,65 @@
|
|
|
23
23
|
|
|
24
24
|
/* stylelint-disable custom-property-pattern */
|
|
25
25
|
|
|
26
|
-
@layer
|
|
27
|
-
.codeEditor {
|
|
26
|
+
@layer utilities {
|
|
27
|
+
.fabric-codeEditor {
|
|
28
28
|
direction: ltr;
|
|
29
29
|
overflow: hidden;
|
|
30
30
|
border: 1px solid transparent;
|
|
31
31
|
border-bottom-width: 2px;
|
|
32
32
|
|
|
33
|
-
&:has(
|
|
34
|
-
border-color:
|
|
33
|
+
&:has(.monaco-editor.focused) {
|
|
34
|
+
border-color: var(--border-primary-500);
|
|
35
35
|
}
|
|
36
36
|
|
|
37
|
-
.editor {
|
|
38
|
-
& >
|
|
39
|
-
--vscode-menu-background:
|
|
40
|
-
--vscode-menu-border:
|
|
37
|
+
.fabric-editor {
|
|
38
|
+
& > .monaco-editor {
|
|
39
|
+
--vscode-menu-background: var(--color-tint.50) !important;
|
|
40
|
+
--vscode-menu-border: var(--border-color-base) !important;
|
|
41
41
|
--vscode-focusBorder: transparent !important;
|
|
42
42
|
--vscode-menu-selectionBackground: color(
|
|
43
|
-
from var(--primary) srgb r g b / 80%
|
|
43
|
+
from var(--color-primary) srgb r g b / 80%
|
|
44
44
|
) !important;
|
|
45
45
|
--vscode-editor-background: var(--fabric-bg) !important;
|
|
46
46
|
--vscode-editor-foreground: var(--fabric-text) !important;
|
|
47
47
|
--vscode-breadcrumb-background: var(--fabric-bg) !important;
|
|
48
48
|
--vscode-editorGutter-background: color(
|
|
49
|
-
from
|
|
49
|
+
from var(--color-tint.50) srgb r g g / 50%
|
|
50
50
|
) !important;
|
|
51
51
|
--vscode-minimapSlider-background: color(
|
|
52
|
-
from var(--tint) srgb r g b / 20%
|
|
52
|
+
from var(--color-tint) srgb r g b / 20%
|
|
53
53
|
) !important;
|
|
54
54
|
--vscode-minimapSlider-hoverBackground: color(
|
|
55
|
-
from var(--tint) srgb r g b / 25%
|
|
55
|
+
from var(--color-tint) srgb r g b / 25%
|
|
56
56
|
) !important;
|
|
57
57
|
--vscode-minimapSlider-activeBackground: color(
|
|
58
|
-
from var(--tint) srgb r g b / 30%
|
|
58
|
+
from var(--color-tint) srgb r g b / 30%
|
|
59
59
|
) !important;
|
|
60
|
-
--vscode-input-border: var(--primary) !important;
|
|
60
|
+
--vscode-input-border: var(--color-primary) !important;
|
|
61
61
|
--vscode-editorStickyScroll-background: var(--fabric-bg) !important;
|
|
62
62
|
--vscode-editorMarkerNavigation-background: var(--fabric-bg) !important;
|
|
63
63
|
--vscode-editor-wordHighlightTextBackground: color(
|
|
64
|
-
from
|
|
64
|
+
from var(--color-accent.700) srgb r g b / 20%
|
|
65
65
|
) !important;
|
|
66
66
|
}
|
|
67
67
|
|
|
68
|
-
&
|
|
68
|
+
& .minimap-decorations-layer {
|
|
69
69
|
background-color: color(
|
|
70
|
-
from
|
|
70
|
+
from var(--color-tint.50) srgb r g g / 50%
|
|
71
71
|
) !important;
|
|
72
72
|
}
|
|
73
73
|
|
|
74
|
-
&
|
|
74
|
+
& .folded-background {
|
|
75
75
|
opacity: 0.5;
|
|
76
76
|
}
|
|
77
77
|
|
|
78
|
-
&
|
|
78
|
+
& .monaco-findInput textarea {
|
|
79
79
|
resize: initial;
|
|
80
80
|
min-height: unset;
|
|
81
81
|
}
|
|
82
82
|
|
|
83
|
-
&
|
|
84
|
-
|
|
85
|
-
font-size: 0.75rem;
|
|
86
|
-
}
|
|
83
|
+
& .editor-widget.suggest-widget .message {
|
|
84
|
+
font-size: 0.75rem;
|
|
87
85
|
}
|
|
88
86
|
|
|
89
87
|
& span {
|
|
@@ -92,7 +90,7 @@
|
|
|
92
90
|
}
|
|
93
91
|
}
|
|
94
92
|
|
|
95
|
-
.editorTools {
|
|
96
|
-
background-color:
|
|
93
|
+
.fabric-editorTools {
|
|
94
|
+
background-color: var(--bg-color-base);
|
|
97
95
|
}
|
|
98
96
|
}
|
package/css/styles.css
ADDED
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* React Fabric
|
|
3
|
+
* @version: 1.0.0
|
|
4
|
+
*
|
|
5
|
+
*
|
|
6
|
+
* The MIT License (MIT)
|
|
7
|
+
* Copyright (c) 2025 Adarsh Pastakia
|
|
8
|
+
*
|
|
9
|
+
* Permission is hereby granted, free of charge, to any person obtaining a copy of this software
|
|
10
|
+
* and associated documentation files (the "Software"), to deal in the Software without restriction,
|
|
11
|
+
* including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense,
|
|
12
|
+
* and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so,
|
|
13
|
+
* subject to the following conditions:
|
|
14
|
+
*
|
|
15
|
+
* The above copyright notice and this permission notice shall be included in all copies or substantial
|
|
16
|
+
* portions of the Software.
|
|
17
|
+
*
|
|
18
|
+
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED
|
|
19
|
+
* TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
|
|
20
|
+
* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
|
|
21
|
+
* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
|
22
|
+
*/
|
|
23
|
+
|
|
24
|
+
@import "./_codeEditor.css";
|
|
@@ -9,7 +9,6 @@ var utilities = require('@react-fabric/utilities');
|
|
|
9
9
|
var classNames = require('classnames');
|
|
10
10
|
var react = require('react');
|
|
11
11
|
var MonacoEditor = require('react-monaco-editor');
|
|
12
|
-
var CodeEditor_module = require('./CodeEditor.module.css');
|
|
13
12
|
var jsxRuntime = require('react/jsx-runtime');
|
|
14
13
|
|
|
15
14
|
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
@@ -160,7 +159,7 @@ var CodeEditor = function CodeEditor(_ref) {
|
|
|
160
159
|
children: /*#__PURE__*/jsxRuntime.jsx("div", {
|
|
161
160
|
ref: containerRef,
|
|
162
161
|
"data-ref": "codeEditor",
|
|
163
|
-
className: classNames(
|
|
162
|
+
className: classNames("fabric-codeEditor", "absolute inset-0"),
|
|
164
163
|
children: /*#__PURE__*/jsxRuntime.jsx(MonacoEditor, {
|
|
165
164
|
editorDidMount: function editorDidMount(e, m) {
|
|
166
165
|
return [!!e && setEditorRef(e), !!m && setMonacoRef(m)];
|
|
@@ -171,7 +170,7 @@ var CodeEditor = function CodeEditor(_ref) {
|
|
|
171
170
|
language: language,
|
|
172
171
|
onChange: handleChange,
|
|
173
172
|
theme: theme,
|
|
174
|
-
className:
|
|
173
|
+
className: "fabric-editor",
|
|
175
174
|
options: {
|
|
176
175
|
readOnly: readOnly,
|
|
177
176
|
minimap: {
|
|
@@ -9,7 +9,6 @@ import { isString, isEmpty } from '@react-fabric/utilities';
|
|
|
9
9
|
import classNames from 'classnames';
|
|
10
10
|
import { useState, useLayoutEffect, useCallback, useDeferredValue, useMemo, useImperativeHandle, useRef } from 'react';
|
|
11
11
|
import MonacoEditor from 'react-monaco-editor';
|
|
12
|
-
import classes from './CodeEditor.module.css';
|
|
13
12
|
import { jsx } from 'react/jsx-runtime';
|
|
14
13
|
|
|
15
14
|
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
@@ -160,7 +159,7 @@ var CodeEditor = function CodeEditor(_ref) {
|
|
|
160
159
|
children: /*#__PURE__*/jsx("div", {
|
|
161
160
|
ref: containerRef,
|
|
162
161
|
"data-ref": "codeEditor",
|
|
163
|
-
className: classNames(
|
|
162
|
+
className: classNames("fabric-codeEditor", "absolute inset-0"),
|
|
164
163
|
children: /*#__PURE__*/jsx(MonacoEditor, {
|
|
165
164
|
editorDidMount: function editorDidMount(e, m) {
|
|
166
165
|
return [!!e && setEditorRef(e), !!m && setMonacoRef(m)];
|
|
@@ -171,7 +170,7 @@ var CodeEditor = function CodeEditor(_ref) {
|
|
|
171
170
|
language: language,
|
|
172
171
|
onChange: handleChange,
|
|
173
172
|
theme: theme,
|
|
174
|
-
className:
|
|
173
|
+
className: "fabric-editor",
|
|
175
174
|
options: {
|
|
176
175
|
readOnly: readOnly,
|
|
177
176
|
minimap: {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@react-fabric/monaco",
|
|
3
|
-
"version": "1.0.0-beta.
|
|
3
|
+
"version": "1.0.0-beta.38",
|
|
4
4
|
"description": "RUF: Monaco editor",
|
|
5
5
|
"author": "Adarsh Pastakia <adarshpastakia@outlook.com>",
|
|
6
6
|
"license": "MIT",
|
|
@@ -11,9 +11,11 @@
|
|
|
11
11
|
"types": "dist/types/index.d.ts",
|
|
12
12
|
"directories": {
|
|
13
13
|
"src": "src",
|
|
14
|
+
"styles": "css",
|
|
14
15
|
"test": "tests"
|
|
15
16
|
},
|
|
16
17
|
"files": [
|
|
18
|
+
"css",
|
|
17
19
|
"src",
|
|
18
20
|
"dist"
|
|
19
21
|
],
|
|
@@ -33,8 +35,8 @@
|
|
|
33
35
|
"watch": "npm-run-all -p watch:rollup watch:dts"
|
|
34
36
|
},
|
|
35
37
|
"dependencies": {
|
|
36
|
-
"@react-fabric/core": "^1.0.0-beta.
|
|
37
|
-
"@react-fabric/utilities": "^1.0.0-beta.
|
|
38
|
+
"@react-fabric/core": "^1.0.0-beta.38",
|
|
39
|
+
"@react-fabric/utilities": "^1.0.0-beta.38",
|
|
38
40
|
"classnames": "^2.5.1",
|
|
39
41
|
"monaco-editor": "^0.52.0",
|
|
40
42
|
"react-monaco-editor": "^0.56.2"
|
|
@@ -49,5 +51,5 @@
|
|
|
49
51
|
"node": ">=18.12.0",
|
|
50
52
|
"npm": ">=8.19.0"
|
|
51
53
|
},
|
|
52
|
-
"gitHead": "
|
|
54
|
+
"gitHead": "3be18ab7002b2aca45795376e8765dad79de92dc"
|
|
53
55
|
}
|
|
@@ -41,7 +41,6 @@ import {
|
|
|
41
41
|
useState,
|
|
42
42
|
} from "react";
|
|
43
43
|
import MonacoEditor from "react-monaco-editor";
|
|
44
|
-
import classes from "./CodeEditor.module.css";
|
|
45
44
|
|
|
46
45
|
export interface MonacoEditorRef {
|
|
47
46
|
validate: () => boolean;
|
|
@@ -227,7 +226,7 @@ export const CodeEditor = ({
|
|
|
227
226
|
<div
|
|
228
227
|
ref={containerRef}
|
|
229
228
|
data-ref="codeEditor"
|
|
230
|
-
className={classNames(
|
|
229
|
+
className={classNames("fabric-codeEditor", "absolute inset-0")}
|
|
231
230
|
>
|
|
232
231
|
<MonacoEditor
|
|
233
232
|
editorDidMount={(e, m) => [
|
|
@@ -240,7 +239,7 @@ export const CodeEditor = ({
|
|
|
240
239
|
language={language}
|
|
241
240
|
onChange={handleChange}
|
|
242
241
|
theme={theme}
|
|
243
|
-
className={
|
|
242
|
+
className={"fabric-editor"}
|
|
244
243
|
options={{
|
|
245
244
|
readOnly,
|
|
246
245
|
minimap: {
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
@layer util{.codeEditor{border:solid transparent;border-width:1px 1px 2px;direction:ltr;overflow:hidden;&:has(:global(.monaco-editor.focused)){border-color:theme(borderColor.primary.500)}.editor{&>:global(.monaco-editor){--vscode-menu-background:theme(colors.tint.50)!important;--vscode-menu-border:theme(borderColor.base)!important;--vscode-focusBorder:transparent!important;--vscode-menu-selectionBackground:color(from var(--primary) srgb r g b/80%)!important;--vscode-editor-background:var(--fabric-bg)!important;--vscode-editor-foreground:var(--fabric-text)!important;--vscode-breadcrumb-background:var(--fabric-bg)!important;--vscode-editorGutter-background:color(from theme(colors.tint.50) srgb r g g/50%)!important;--vscode-minimapSlider-background:color(from var(--tint) srgb r g b/20%)!important;--vscode-minimapSlider-hoverBackground:color(from var(--tint) srgb r g b/25%)!important;--vscode-minimapSlider-activeBackground:color(from var(--tint) srgb r g b/30%)!important;--vscode-input-border:var(--primary)!important;--vscode-editorStickyScroll-background:var(--fabric-bg)!important;--vscode-editorMarkerNavigation-background:var(--fabric-bg)!important;--vscode-editor-wordHighlightTextBackground:color(from theme(colors.accent.700) srgb r g b/20%)!important}& :global(.minimap-decorations-layer){background-color:color(from theme(colors.tint.50) srgb r g g/50%)!important}& :global(.folded-background){opacity:.5}& :global(.monaco-findInput) textarea{min-height:unset;resize:none}& :global{.editor-widget.suggest-widget .message{font-size:.75rem}}& span{padding:0}}}.editorTools{background-color:theme(backgroundColor.base)}}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
@layer util{.codeEditor{border:solid transparent;border-width:1px 1px 2px;direction:ltr;overflow:hidden;&:has(:global(.monaco-editor.focused)){border-color:theme(borderColor.primary.500)}.editor{&>:global(.monaco-editor){--vscode-menu-background:theme(colors.tint.50)!important;--vscode-menu-border:theme(borderColor.base)!important;--vscode-focusBorder:transparent!important;--vscode-menu-selectionBackground:color(from var(--primary) srgb r g b/80%)!important;--vscode-editor-background:var(--fabric-bg)!important;--vscode-editor-foreground:var(--fabric-text)!important;--vscode-breadcrumb-background:var(--fabric-bg)!important;--vscode-editorGutter-background:color(from theme(colors.tint.50) srgb r g g/50%)!important;--vscode-minimapSlider-background:color(from var(--tint) srgb r g b/20%)!important;--vscode-minimapSlider-hoverBackground:color(from var(--tint) srgb r g b/25%)!important;--vscode-minimapSlider-activeBackground:color(from var(--tint) srgb r g b/30%)!important;--vscode-input-border:var(--primary)!important;--vscode-editorStickyScroll-background:var(--fabric-bg)!important;--vscode-editorMarkerNavigation-background:var(--fabric-bg)!important;--vscode-editor-wordHighlightTextBackground:color(from theme(colors.accent.700) srgb r g b/20%)!important}& :global(.minimap-decorations-layer){background-color:color(from theme(colors.tint.50) srgb r g g/50%)!important}& :global(.folded-background){opacity:.5}& :global(.monaco-findInput) textarea{min-height:unset;resize:none}& :global{.editor-widget.suggest-widget .message{font-size:.75rem}}& span{padding:0}}}.editorTools{background-color:theme(backgroundColor.base)}}
|