@xiping/react-components 1.0.23 → 1.0.24
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/cjs/components/confetti-button/index.js +1 -1
- package/dist/cjs/components/dock/Duck.js +1 -1
- package/dist/cjs/components/pinch-content/PinchContent.js +1 -1
- package/dist/cjs/components/pointer/Pointer.d.ts +13 -0
- package/dist/cjs/components/pointer/Pointer.js +1 -0
- package/dist/cjs/components/pointer/index.d.ts +2 -0
- package/dist/cjs/components/sparkles-text/SparklesText.d.ts +43 -0
- package/dist/cjs/components/sparkles-text/SparklesText.js +1 -0
- package/dist/cjs/components/sparkles-text/index.d.ts +2 -0
- package/dist/cjs/components/txt-editor/TxtEditor.js +1 -1
- package/dist/cjs/components/txt-reader/TxtReader.js +1 -1
- package/dist/cjs/index.d.ts +2 -0
- package/dist/cjs/index.js +1 -1
- package/dist/cjs/node_modules/.pnpm/@monaco-editor_react@4.7.0_monaco-editor@0.52.2_react-dom@19.1.0_react@19.1.0__react@19.1.0/node_modules/@monaco-editor/react/dist/index.js +1 -1
- package/dist/cjs/react-components.css +1 -1
- package/dist/es/components/confetti-button/index.js +33 -34
- package/dist/es/components/dock/Duck.js +31 -32
- package/dist/es/components/pinch-content/PinchContent.js +27 -29
- package/dist/es/components/pointer/Pointer.d.ts +13 -0
- package/dist/es/components/pointer/Pointer.js +77 -0
- package/dist/es/components/pointer/index.d.ts +2 -0
- package/dist/es/components/sparkles-text/SparklesText.d.ts +43 -0
- package/dist/es/components/sparkles-text/SparklesText.js +70 -0
- package/dist/es/components/sparkles-text/index.d.ts +2 -0
- package/dist/es/components/txt-editor/TxtEditor.js +29 -29
- package/dist/es/components/txt-reader/TxtReader.js +41 -41
- package/dist/es/index.d.ts +2 -0
- package/dist/es/index.js +22 -18
- package/dist/es/node_modules/.pnpm/@monaco-editor_react@4.7.0_monaco-editor@0.52.2_react-dom@19.1.0_react@19.1.0__react@19.1.0/node_modules/@monaco-editor/react/dist/index.js +127 -142
- package/dist/es/react-components.css +1 -1
- package/package.json +9 -9
|
@@ -1,78 +1,78 @@
|
|
|
1
|
-
import { jsxs as
|
|
2
|
-
import { useRef as
|
|
3
|
-
import
|
|
4
|
-
import { useScroll as
|
|
5
|
-
import
|
|
1
|
+
import { jsxs as w, Fragment as E, jsx as e } from "react/jsx-runtime";
|
|
2
|
+
import { useRef as i } from "react";
|
|
3
|
+
import t from "clsx";
|
|
4
|
+
import { useScroll as F, useTransform as _, useMotionTemplate as v, motion as n } from "motion/react";
|
|
5
|
+
import y from "./index.module.css.js";
|
|
6
6
|
const I = 16, L = 1.5, R = "normal", k = ({
|
|
7
|
-
content:
|
|
8
|
-
lineHeight:
|
|
9
|
-
fontSize:
|
|
10
|
-
fontWeight:
|
|
11
|
-
className:
|
|
12
|
-
style:
|
|
13
|
-
onProgressChange:
|
|
7
|
+
content: c,
|
|
8
|
+
lineHeight: a = L,
|
|
9
|
+
fontSize: f = I,
|
|
10
|
+
fontWeight: m = R,
|
|
11
|
+
className: p = "",
|
|
12
|
+
style: d = {},
|
|
13
|
+
onProgressChange: u,
|
|
14
14
|
initialScrollPosition: S,
|
|
15
15
|
cacheKey: A,
|
|
16
|
-
showTopProgress:
|
|
17
|
-
topProgressClassName:
|
|
18
|
-
showBottomProgress:
|
|
19
|
-
bottomProgressClassName:
|
|
16
|
+
showTopProgress: g = !0,
|
|
17
|
+
topProgressClassName: h,
|
|
18
|
+
showBottomProgress: x = !0,
|
|
19
|
+
bottomProgressClassName: T
|
|
20
20
|
}) => {
|
|
21
|
-
const
|
|
22
|
-
container:
|
|
21
|
+
const r = i(null), o = i(null), { scrollYProgress: l } = F({
|
|
22
|
+
container: r,
|
|
23
23
|
target: o
|
|
24
|
-
}), s =
|
|
25
|
-
return s.on("change", (
|
|
26
|
-
|
|
27
|
-
}), /* @__PURE__ */ E
|
|
28
|
-
|
|
24
|
+
}), s = _(() => (l.get() * 100).toFixed(2).replace(/\.0*$/, "")), b = v`${s}%`;
|
|
25
|
+
return s.on("change", (N) => {
|
|
26
|
+
u?.(Number(N));
|
|
27
|
+
}), /* @__PURE__ */ w(E, { children: [
|
|
28
|
+
g && /* @__PURE__ */ e(
|
|
29
29
|
n.div,
|
|
30
30
|
{
|
|
31
31
|
id: "scroll-indicator",
|
|
32
|
-
className:
|
|
32
|
+
className: t(
|
|
33
33
|
"fixed left-0 top-0 right-0 bg-[#ff0088] h-2.5",
|
|
34
|
-
|
|
34
|
+
h
|
|
35
35
|
),
|
|
36
36
|
style: {
|
|
37
|
-
scaleX:
|
|
37
|
+
scaleX: l,
|
|
38
38
|
originX: 0
|
|
39
39
|
}
|
|
40
40
|
}
|
|
41
41
|
),
|
|
42
|
-
/* @__PURE__ */
|
|
42
|
+
/* @__PURE__ */ e(
|
|
43
43
|
"div",
|
|
44
44
|
{
|
|
45
|
-
className:
|
|
45
|
+
className: t(
|
|
46
46
|
"relative w-full h-full overflow-y-auto",
|
|
47
|
-
|
|
47
|
+
y.textContent
|
|
48
48
|
// "scrollbar-thumb-rounded-full scrollbar-track-rounded-full scrollbar scrollbar-thumb-slate-700 scrollbar-track-slate-300",
|
|
49
49
|
),
|
|
50
|
-
ref:
|
|
51
|
-
children: /* @__PURE__ */
|
|
50
|
+
ref: r,
|
|
51
|
+
children: /* @__PURE__ */ e(
|
|
52
52
|
"div",
|
|
53
53
|
{
|
|
54
54
|
ref: o,
|
|
55
|
-
className:
|
|
55
|
+
className: t("w-full whitespace-pre-wrap break-words", p),
|
|
56
56
|
style: {
|
|
57
|
-
fontSize: `${
|
|
58
|
-
lineHeight:
|
|
59
|
-
fontWeight:
|
|
60
|
-
...
|
|
57
|
+
fontSize: `${f}px`,
|
|
58
|
+
lineHeight: a,
|
|
59
|
+
fontWeight: m,
|
|
60
|
+
...d
|
|
61
61
|
},
|
|
62
|
-
children:
|
|
62
|
+
children: c
|
|
63
63
|
}
|
|
64
64
|
)
|
|
65
65
|
}
|
|
66
66
|
),
|
|
67
|
-
|
|
67
|
+
x && /* @__PURE__ */ e(
|
|
68
68
|
n.div,
|
|
69
69
|
{
|
|
70
70
|
id: "scroll-present",
|
|
71
|
-
className:
|
|
71
|
+
className: t(
|
|
72
72
|
"fixed text-white rounded text-sm bg-black bg-opacity-70 pl-2 pr-2 pb-1 pt-1 right-5 bottom-5",
|
|
73
|
-
|
|
73
|
+
T
|
|
74
74
|
),
|
|
75
|
-
children:
|
|
75
|
+
children: b
|
|
76
76
|
}
|
|
77
77
|
)
|
|
78
78
|
] });
|
package/dist/es/index.d.ts
CHANGED
|
@@ -14,3 +14,5 @@ export * from './components/qr-code';
|
|
|
14
14
|
export * from './components/react-force-graph-3d';
|
|
15
15
|
export * from './components/confetti-button';
|
|
16
16
|
export * from './hooks/useStayTimeReport';
|
|
17
|
+
export * from './components/pointer';
|
|
18
|
+
export * from './components/sparkles-text';
|
package/dist/es/index.js
CHANGED
|
@@ -1,40 +1,44 @@
|
|
|
1
1
|
/* empty css */
|
|
2
|
-
import { Button as
|
|
2
|
+
import { Button as e } from "./components/button/Button.js";
|
|
3
3
|
import { TxtReader as f } from "./components/txt-reader/TxtReader.js";
|
|
4
|
-
import { HyperText as
|
|
4
|
+
import { HyperText as x } from "./components/hyper-text/index.js";
|
|
5
5
|
import { TypingAnimation as n } from "./components/typing-animation/index.js";
|
|
6
|
-
import { QRCode as
|
|
6
|
+
import { QRCode as s } from "./components/qr-code/index.js";
|
|
7
7
|
import { Confetti as u, ConfettiButton as c } from "./components/confetti-button/index.js";
|
|
8
8
|
import { useStayTimeReport as l } from "./hooks/useStayTimeReport.js";
|
|
9
9
|
import { default as g } from "./components/pinch-content/PinchContent.js";
|
|
10
|
-
import { default as
|
|
10
|
+
import { default as h } from "./components/image-viewer/ImageViewer.js";
|
|
11
11
|
import { ShimmerButton as B } from "./components/shimmer-button/ShimmerButton.js";
|
|
12
12
|
import { default as I } from "./components/image-compare/ImageCompare.js";
|
|
13
|
-
import { TextAnimate as
|
|
14
|
-
import { Dock as
|
|
15
|
-
import { TxtEditor as
|
|
16
|
-
import { Message as
|
|
13
|
+
import { TextAnimate as S } from "./components/text-animate/TextAnimate.js";
|
|
14
|
+
import { Dock as P, DockIcon as V, dockVariants as w } from "./components/dock/Duck.js";
|
|
15
|
+
import { TxtEditor as F } from "./components/txt-editor/TxtEditor.js";
|
|
16
|
+
import { Message as H } from "./components/message/Message.js";
|
|
17
17
|
import { default as Q } from "./node_modules/.pnpm/react-force-graph-3d@1.28.0_react@19.1.0/node_modules/react-force-graph-3d/dist/react-force-graph-3d.js";
|
|
18
18
|
import { default as j } from "./node_modules/.pnpm/canvas-confetti@1.9.3/node_modules/canvas-confetti/dist/confetti.module.js";
|
|
19
|
+
import { Pointer as v } from "./components/pointer/Pointer.js";
|
|
20
|
+
import { SparklesText as J } from "./components/sparkles-text/SparklesText.js";
|
|
19
21
|
export {
|
|
20
|
-
|
|
22
|
+
e as Button,
|
|
21
23
|
u as Confetti,
|
|
22
24
|
c as ConfettiButton,
|
|
23
|
-
|
|
24
|
-
|
|
25
|
+
P as Dock,
|
|
26
|
+
V as DockIcon,
|
|
25
27
|
Q as ForceGraph3D,
|
|
26
|
-
|
|
28
|
+
x as HyperText,
|
|
27
29
|
I as ImageCompare,
|
|
28
|
-
|
|
29
|
-
|
|
30
|
+
h as ImageViewer,
|
|
31
|
+
H as Message,
|
|
30
32
|
g as PinchContent,
|
|
31
|
-
|
|
33
|
+
v as Pointer,
|
|
34
|
+
s as QRCode,
|
|
32
35
|
B as ShimmerButton,
|
|
33
|
-
|
|
34
|
-
|
|
36
|
+
J as SparklesText,
|
|
37
|
+
S as TextAnimate,
|
|
38
|
+
F as TxtEditor,
|
|
35
39
|
f as TxtReader,
|
|
36
40
|
n as TypingAnimation,
|
|
37
41
|
j as confetti,
|
|
38
|
-
|
|
42
|
+
w as dockVariants,
|
|
39
43
|
l as useStayTimeReport
|
|
40
44
|
};
|
|
@@ -1,169 +1,154 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
var
|
|
4
|
-
function
|
|
5
|
-
return
|
|
1
|
+
import $ from "../../../../../@monaco-editor_loader@1.5.0/node_modules/@monaco-editor/loader/lib/es/loader/index.js";
|
|
2
|
+
import k, { memo as X, useState as T, useRef as l, useCallback as Q, useEffect as E } from "react";
|
|
3
|
+
var te = { wrapper: { display: "flex", position: "relative", textAlign: "initial" }, fullWidth: { width: "100%" }, hide: { display: "none" } }, J = te, ne = { container: { display: "flex", height: "100%", width: "100%", justifyContent: "center", alignItems: "center" } }, ie = ne;
|
|
4
|
+
function ue({ children: e }) {
|
|
5
|
+
return k.createElement("div", { style: ie.container }, e);
|
|
6
6
|
}
|
|
7
|
-
var
|
|
8
|
-
function
|
|
9
|
-
return
|
|
7
|
+
var oe = ue, ae = oe;
|
|
8
|
+
function le({ width: e, height: n, isEditorReady: u, loading: r, _ref: g, className: p, wrapperProps: v }) {
|
|
9
|
+
return k.createElement("section", { style: { ...J.wrapper, width: e, height: n }, ...v }, !u && k.createElement(ae, null, r), k.createElement("div", { ref: g, style: { ...J.fullWidth, ...!u && J.hide }, className: p }));
|
|
10
10
|
}
|
|
11
|
-
var
|
|
12
|
-
function
|
|
13
|
-
|
|
11
|
+
var ce = le, q = X(ce);
|
|
12
|
+
function de(e) {
|
|
13
|
+
E(e, []);
|
|
14
14
|
}
|
|
15
|
-
var
|
|
16
|
-
function
|
|
17
|
-
let
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
} :
|
|
15
|
+
var K = de;
|
|
16
|
+
function se(e, n, u = !0) {
|
|
17
|
+
let r = l(!0);
|
|
18
|
+
E(r.current || !u ? () => {
|
|
19
|
+
r.current = !1;
|
|
20
|
+
} : e, n);
|
|
21
21
|
}
|
|
22
|
-
var
|
|
23
|
-
function
|
|
22
|
+
var M = se;
|
|
23
|
+
function R() {
|
|
24
24
|
}
|
|
25
|
-
function
|
|
26
|
-
return fe(
|
|
25
|
+
function O(e, n, u, r) {
|
|
26
|
+
return fe(e, r) || ge(e, n, u, r);
|
|
27
27
|
}
|
|
28
|
-
function fe(
|
|
29
|
-
return
|
|
28
|
+
function fe(e, n) {
|
|
29
|
+
return e.editor.getModel(ee(e, n));
|
|
30
30
|
}
|
|
31
|
-
function
|
|
32
|
-
return
|
|
31
|
+
function ge(e, n, u, r) {
|
|
32
|
+
return e.editor.createModel(n, u, r ? ee(e, r) : void 0);
|
|
33
33
|
}
|
|
34
|
-
function
|
|
35
|
-
return
|
|
34
|
+
function ee(e, n) {
|
|
35
|
+
return e.Uri.parse(n);
|
|
36
36
|
}
|
|
37
|
-
function
|
|
38
|
-
let [
|
|
39
|
-
|
|
40
|
-
let
|
|
41
|
-
return
|
|
42
|
-
}),
|
|
43
|
-
if (
|
|
44
|
-
let
|
|
45
|
-
|
|
37
|
+
function pe({ original: e, modified: n, language: u, originalLanguage: r, modifiedLanguage: g, originalModelPath: p, modifiedModelPath: v, keepCurrentOriginalModel: L = !1, keepCurrentModifiedModel: _ = !1, theme: w = "light", loading: b = "Loading...", options: m = {}, height: F = "100%", width: I = "100%", className: z, wrapperProps: H = {}, beforeMount: W = R, onMount: j = R }) {
|
|
38
|
+
let [h, y] = T(!1), [S, a] = T(!0), c = l(null), o = l(null), x = l(null), s = l(j), t = l(W), C = l(!1);
|
|
39
|
+
K(() => {
|
|
40
|
+
let i = $.init();
|
|
41
|
+
return i.then((d) => (o.current = d) && a(!1)).catch((d) => d?.type !== "cancelation" && console.error("Monaco initialization: error:", d)), () => c.current ? P() : i.cancel();
|
|
42
|
+
}), M(() => {
|
|
43
|
+
if (c.current && o.current) {
|
|
44
|
+
let i = c.current.getOriginalEditor(), d = O(o.current, e || "", r || u || "text", p || "");
|
|
45
|
+
d !== i.getModel() && i.setModel(d);
|
|
46
46
|
}
|
|
47
|
-
}, [
|
|
48
|
-
if (
|
|
49
|
-
let
|
|
50
|
-
|
|
47
|
+
}, [p], h), M(() => {
|
|
48
|
+
if (c.current && o.current) {
|
|
49
|
+
let i = c.current.getModifiedEditor(), d = O(o.current, n || "", g || u || "text", v || "");
|
|
50
|
+
d !== i.getModel() && i.setModel(d);
|
|
51
51
|
}
|
|
52
|
-
}, [
|
|
53
|
-
let
|
|
54
|
-
|
|
55
|
-
}, [
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
}, [
|
|
65
|
-
|
|
66
|
-
(
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
!
|
|
77
|
-
}, [
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
!k && !M && H();
|
|
82
|
-
}, [k, M, H]);
|
|
83
|
-
function U() {
|
|
84
|
-
var o, O, S, _;
|
|
85
|
-
let e = (o = g.current) == null ? void 0 : o.getModel();
|
|
86
|
-
C || ((O = e == null ? void 0 : e.original) == null || O.dispose()), A || ((S = e == null ? void 0 : e.modified) == null || S.dispose()), (_ = g.current) == null || _.dispose();
|
|
52
|
+
}, [v], h), M(() => {
|
|
53
|
+
let i = c.current.getModifiedEditor();
|
|
54
|
+
i.getOption(o.current.editor.EditorOption.readOnly) ? i.setValue(n || "") : n !== i.getValue() && (i.executeEdits("", [{ range: i.getModel().getFullModelRange(), text: n || "", forceMoveMarkers: !0 }]), i.pushUndoStop());
|
|
55
|
+
}, [n], h), M(() => {
|
|
56
|
+
c.current?.getModel()?.original.setValue(e || "");
|
|
57
|
+
}, [e], h), M(() => {
|
|
58
|
+
let { original: i, modified: d } = c.current.getModel();
|
|
59
|
+
o.current.editor.setModelLanguage(i, r || u || "text"), o.current.editor.setModelLanguage(d, g || u || "text");
|
|
60
|
+
}, [u, r, g], h), M(() => {
|
|
61
|
+
o.current?.editor.setTheme(w);
|
|
62
|
+
}, [w], h), M(() => {
|
|
63
|
+
c.current?.updateOptions(m);
|
|
64
|
+
}, [m], h);
|
|
65
|
+
let N = Q(() => {
|
|
66
|
+
if (!o.current) return;
|
|
67
|
+
t.current(o.current);
|
|
68
|
+
let i = O(o.current, e || "", r || u || "text", p || ""), d = O(o.current, n || "", g || u || "text", v || "");
|
|
69
|
+
c.current?.setModel({ original: i, modified: d });
|
|
70
|
+
}, [u, n, g, e, r, p, v]), D = Q(() => {
|
|
71
|
+
!C.current && x.current && (c.current = o.current.editor.createDiffEditor(x.current, { automaticLayout: !0, ...m }), N(), o.current?.editor.setTheme(w), y(!0), C.current = !0);
|
|
72
|
+
}, [m, w, N]);
|
|
73
|
+
E(() => {
|
|
74
|
+
h && s.current(c.current, o.current);
|
|
75
|
+
}, [h]), E(() => {
|
|
76
|
+
!S && !h && D();
|
|
77
|
+
}, [S, h, D]);
|
|
78
|
+
function P() {
|
|
79
|
+
let i = c.current?.getModel();
|
|
80
|
+
L || i?.original?.dispose(), _ || i?.modified?.dispose(), c.current?.dispose();
|
|
87
81
|
}
|
|
88
|
-
return
|
|
82
|
+
return k.createElement(q, { width: I, height: F, isEditorReady: h, loading: b, _ref: x, className: z, wrapperProps: H });
|
|
89
83
|
}
|
|
90
|
-
var
|
|
91
|
-
|
|
92
|
-
function
|
|
93
|
-
let
|
|
94
|
-
return
|
|
95
|
-
|
|
96
|
-
}, [
|
|
84
|
+
var he = pe;
|
|
85
|
+
X(he);
|
|
86
|
+
function Me(e) {
|
|
87
|
+
let n = l();
|
|
88
|
+
return E(() => {
|
|
89
|
+
n.current = e;
|
|
90
|
+
}, [e]), n.current;
|
|
97
91
|
}
|
|
98
|
-
var
|
|
99
|
-
function
|
|
100
|
-
let [
|
|
101
|
-
|
|
102
|
-
let
|
|
103
|
-
return
|
|
104
|
-
}),
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
(t =
|
|
111
|
-
}, [
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
let _ = $(() => {
|
|
125
|
-
var t;
|
|
126
|
-
if (!(!y.current || !f.current) && !O.current) {
|
|
127
|
-
H.current(f.current);
|
|
128
|
-
let a = h || l, v = P(f.current, n || r || "", u || p || "", a || "");
|
|
129
|
-
i.current = (t = f.current) == null ? void 0 : t.editor.create(y.current, { model: v, automaticLayout: !0, ...L }, R), E && i.current.restoreViewState(W.get(a)), f.current.editor.setTheme(w), C !== void 0 && i.current.revealLine(C), g(!0), O.current = !0;
|
|
92
|
+
var ve = Me, U = /* @__PURE__ */ new Map();
|
|
93
|
+
function me({ defaultValue: e, defaultLanguage: n, defaultPath: u, value: r, language: g, path: p, theme: v = "light", line: L, loading: _ = "Loading...", options: w = {}, overrideServices: b = {}, saveViewState: m = !0, keepCurrentModel: F = !1, width: I = "100%", height: z = "100%", className: H, wrapperProps: W = {}, beforeMount: j = R, onMount: h = R, onChange: y, onValidate: S = R }) {
|
|
94
|
+
let [a, c] = T(!1), [o, x] = T(!0), s = l(null), t = l(null), C = l(null), N = l(h), D = l(j), P = l(), i = l(r), d = ve(p), Y = l(!1), A = l(!1);
|
|
95
|
+
K(() => {
|
|
96
|
+
let f = $.init();
|
|
97
|
+
return f.then((V) => (s.current = V) && x(!1)).catch((V) => V?.type !== "cancelation" && console.error("Monaco initialization: error:", V)), () => t.current ? re() : f.cancel();
|
|
98
|
+
}), M(() => {
|
|
99
|
+
let f = O(s.current, e || r || "", n || g || "", p || u || "");
|
|
100
|
+
f !== t.current?.getModel() && (m && U.set(d, t.current?.saveViewState()), t.current?.setModel(f), m && t.current?.restoreViewState(U.get(p)));
|
|
101
|
+
}, [p], a), M(() => {
|
|
102
|
+
t.current?.updateOptions(w);
|
|
103
|
+
}, [w], a), M(() => {
|
|
104
|
+
!t.current || r === void 0 || (t.current.getOption(s.current.editor.EditorOption.readOnly) ? t.current.setValue(r) : r !== t.current.getValue() && (A.current = !0, t.current.executeEdits("", [{ range: t.current.getModel().getFullModelRange(), text: r, forceMoveMarkers: !0 }]), t.current.pushUndoStop(), A.current = !1));
|
|
105
|
+
}, [r], a), M(() => {
|
|
106
|
+
let f = t.current?.getModel();
|
|
107
|
+
f && g && s.current?.editor.setModelLanguage(f, g);
|
|
108
|
+
}, [g], a), M(() => {
|
|
109
|
+
L !== void 0 && t.current?.revealLine(L);
|
|
110
|
+
}, [L], a), M(() => {
|
|
111
|
+
s.current?.editor.setTheme(v);
|
|
112
|
+
}, [v], a);
|
|
113
|
+
let Z = Q(() => {
|
|
114
|
+
if (!(!C.current || !s.current) && !Y.current) {
|
|
115
|
+
D.current(s.current);
|
|
116
|
+
let f = p || u, V = O(s.current, r || e || "", n || g || "", f || "");
|
|
117
|
+
t.current = s.current?.editor.create(C.current, { model: V, automaticLayout: !0, ...w }, b), m && t.current.restoreViewState(U.get(f)), s.current.editor.setTheme(v), L !== void 0 && t.current.revealLine(L), c(!0), Y.current = !0;
|
|
130
118
|
}
|
|
131
|
-
}, [
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
}, [
|
|
135
|
-
!
|
|
136
|
-
}, [
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
S.current || N(i.current.getValue(), v);
|
|
119
|
+
}, [e, n, u, r, g, p, w, b, m, v, L]);
|
|
120
|
+
E(() => {
|
|
121
|
+
a && N.current(t.current, s.current);
|
|
122
|
+
}, [a]), E(() => {
|
|
123
|
+
!o && !a && Z();
|
|
124
|
+
}, [o, a, Z]), i.current = r, E(() => {
|
|
125
|
+
a && y && (P.current?.dispose(), P.current = t.current?.onDidChangeModelContent((f) => {
|
|
126
|
+
A.current || y(t.current.getValue(), f);
|
|
140
127
|
}));
|
|
141
|
-
}, [
|
|
142
|
-
if (
|
|
143
|
-
let
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
k == null || k(x);
|
|
128
|
+
}, [a, y]), E(() => {
|
|
129
|
+
if (a) {
|
|
130
|
+
let f = s.current.editor.onDidChangeMarkers((V) => {
|
|
131
|
+
let B = t.current.getModel()?.uri;
|
|
132
|
+
if (B && V.find((G) => G.path === B.path)) {
|
|
133
|
+
let G = s.current.editor.getModelMarkers({ resource: B });
|
|
134
|
+
S?.(G);
|
|
149
135
|
}
|
|
150
136
|
});
|
|
151
137
|
return () => {
|
|
152
|
-
|
|
138
|
+
f?.dispose();
|
|
153
139
|
};
|
|
154
140
|
}
|
|
155
141
|
return () => {
|
|
156
142
|
};
|
|
157
|
-
}, [
|
|
158
|
-
function
|
|
159
|
-
|
|
160
|
-
(t = U.current) == null || t.dispose(), B ? E && W.set(h, i.current.saveViewState()) : (a = i.current.getModel()) == null || a.dispose(), i.current.dispose();
|
|
143
|
+
}, [a, S]);
|
|
144
|
+
function re() {
|
|
145
|
+
P.current?.dispose(), F ? m && U.set(p, t.current.saveViewState()) : t.current.getModel()?.dispose(), t.current.dispose();
|
|
161
146
|
}
|
|
162
|
-
return
|
|
147
|
+
return k.createElement(q, { width: I, height: z, isEditorReady: a, loading: _, _ref: C, className: H, wrapperProps: W });
|
|
163
148
|
}
|
|
164
|
-
var
|
|
149
|
+
var we = me, Ee = X(we), Ce = Ee;
|
|
165
150
|
export {
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
151
|
+
Ee as Editor,
|
|
152
|
+
Ce as default,
|
|
153
|
+
$ as loader
|
|
169
154
|
};
|