@nxgt/material 3.48.0 → 3.50.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/CHANGELOG.md +32 -0
- package/README.md +3 -3
- package/dist/{async-slice-DlvKCKAa.js → async-slice-3loEtzUY.js} +2 -2
- package/dist/{button-yaltbQmC.js → button-BRUaHD8z.js} +81 -112
- package/dist/charts.js +144 -144
- package/dist/{chip-BqWbbr1b.js → chip-DneTrtNj.js} +56 -56
- package/dist/{code-editor-C9qBNoYb.js → code-editor-R_nPN_-d.js} +308 -308
- package/dist/code-editor.js +47 -47
- package/dist/{code-language-items-DAHtfQ7W.js → code-language-items-BKEUhQlF.js} +2 -2
- package/dist/components/components.css +1 -0
- package/dist/components/ui/actions/action-card/action-card-indicator.css +48 -0
- package/dist/components/ui/actions/action-card/action-card-modes.css +4 -1
- package/dist/components/ui/actions/action-card/action-card-tile.css +141 -0
- package/dist/components/ui/actions/action-card/action-card.css +33 -3
- package/dist/{components-Ox6FHmpx.js → components-D6xFLcoE.js} +17646 -17567
- package/dist/components.js +26 -27
- package/dist/{dialog-CCCcnTIx.js → dialog-S7dLsYRZ.js} +16 -16
- package/dist/dnd.js +1 -1
- package/dist/{dropdown-menu-Df8785nt.js → dropdown-menu-XLlxfDgq.js} +271 -272
- package/dist/editor.js +1028 -1028
- package/dist/{empty-state-DcF4TBzi.js → empty-state-Dsf6R-Zo.js} +37 -37
- package/dist/{escape-owner-C4W_sOAU.js → escape-owner-B9eCwjLw.js} +1 -1
- package/dist/{field-blur-CJHzVSh9.js → field-blur-5uRDFHvB.js} +1 -1
- package/dist/{field-blur-context-Cft9s7Hg.js → field-blur-context-Cwt4TuBq.js} +1 -1
- package/dist/hooks.js +4 -4
- package/dist/{hover-card-C0fw2kLK.js → hover-card-PHUgRSjJ.js} +24 -24
- package/dist/{i18n-provider-C0fB0sEL.js → i18n-provider-DPM_ALQ4.js} +1 -1
- package/dist/i18n.js +5 -5
- package/dist/{icon-badge-aJ22mKGh.js → icon-badge-Dh6-FNOF.js} +3 -3
- package/dist/{icon-button-CN9r5TNE.js → icon-button-DSC2-IAG.js} +118 -86
- package/dist/lib/components/ui/actions/action-card/action-card-semantics.d.ts +25 -2
- package/dist/lib/components/ui/actions/action-card/action-card.d.ts +18 -2
- package/dist/lib/components/ui/actions/action-card/partials/action-card-icon.d.ts +6 -0
- package/dist/lib/components/ui/actions/action-card/partials/action-card-meta.d.ts +15 -0
- package/dist/lib/components/ui/actions/action-card/partials/action-card-status.d.ts +6 -0
- package/dist/lib/components/ui/actions/action-card/partials/action-card-text.d.ts +20 -0
- package/dist/lib/components/ui/actions/action-card/partials/action-card-title-button.d.ts +14 -0
- package/dist/lib/components/ui/actions/action-card/partials/action-card-trail.d.ts +6 -0
- package/dist/lib/components/ui/actions/action-card/use-action-card-names.d.ts +22 -0
- package/dist/lib/components/ui/actions/action-card/use-reveal.d.ts +23 -0
- package/dist/lib/components/ui/actions/button/button.variants.d.ts +1 -1
- package/dist/lib/components/ui/actions/icon-button/icon-button-busy.d.ts +22 -0
- package/dist/lib/components/ui/actions/icon-button/icon-button-shape.d.ts +2 -0
- package/dist/lib/components/ui/actions/icon-button/icon-button.d.ts +7 -0
- package/dist/lib/components/ui/actions/icon-button/icon-button.variants.d.ts +1 -1
- package/dist/lib/components/ui/collections/filter/bar/partials/filter-quick-toggle.d.ts +3 -2
- package/dist/lib/components/ui/collections/filter/sections/filter-sections-classes.d.ts +7 -1
- package/dist/lib/components/ui/collections/page-footer/page-footer.d.ts +6 -1
- package/dist/lib/components/ui/collections/row-menu/row-menu-trigger.d.ts +5 -2
- package/dist/lib/components/ui/collections/row-menu/row-menu.d.ts +1 -1
- package/dist/lib/components/ui/collections/server-table/index.d.ts +1 -1
- package/dist/lib/components/ui/collections/server-table/partials/server-table-empty-chips.d.ts +5 -3
- package/dist/lib/components/ui/collections/server-table/types-paging.d.ts +17 -0
- package/dist/lib/components/ui/collections/server-table/types.d.ts +3 -10
- package/dist/lib/components/ui/dates/duration-field/partials/use-duration-box.d.ts +1 -1
- package/dist/lib/components/ui/display/badge/badge.d.ts +1 -1
- package/dist/lib/components/ui/display/day-separator/day-separator.d.ts +1 -1
- package/dist/lib/components/ui/feedback/step-up-dialog/partials/step-up-body.d.ts +5 -3
- package/dist/lib/components/ui/feedback/step-up-dialog/partials/step-up-request-error.d.ts +15 -0
- package/dist/lib/components/ui/feedback/step-up-dialog/step-up-dialog.d.ts +6 -3
- package/dist/lib/components/ui/feedback/step-up-dialog/types.d.ts +12 -1
- package/dist/lib/components/ui/feedback/step-up-dialog/use-retry-focus.d.ts +27 -0
- package/dist/lib/components/ui/feedback/step-up-dialog/use-retry.d.ts +11 -0
- package/dist/lib/components/ui/fields/contacts/placeholders.d.ts +1 -1
- package/dist/lib/components/ui/fields/slider/split-slider-props.d.ts +20 -20
- package/dist/lib/components/ui/fields/slider/use-slider-control.d.ts +20 -20
- package/dist/lib/components/ui/fields/verification-code/use-settled-focus.d.ts +10 -0
- package/dist/lib/components/ui/layout/app-shell/route-transition.d.ts +1 -1
- package/dist/lib/components/ui/media/carousel/use-carousel-engine.d.ts +1 -1
- package/dist/lib/components/ui/media/media-player/engine/use-queue-actions.d.ts +1 -1
- package/dist/lib/components/ui/media/pdf-reader/pdf-reader.slice.d.ts +1 -1
- package/dist/lib/components/ui/selection/choice-group/use-choice-group-field.d.ts +34 -34
- package/dist/lib/components/ui/widgets/chat/chat-message.variants.d.ts +2 -2
- package/dist/lib/components/ui/widgets/event-calendar/use-event-calendar.d.ts +1 -1
- package/dist/lib/i18n/resources/en/en.d.ts +1 -0
- package/dist/lib/i18n/resources/en/material.json.d.ts +2 -1
- package/dist/lib/i18n/resources/fr/fr.d.ts +1 -0
- package/dist/lib/i18n/resources/fr/material.json.d.ts +2 -1
- package/dist/lib/i18n/resources/resources.d.ts +2 -0
- package/dist/lib/i18n/translator.d.ts +1 -1
- package/dist/lib.js +1 -1
- package/dist/main.js +43 -44
- package/dist/map.js +79 -79
- package/dist/material.css +1 -1
- package/dist/nxgt-theme-ivgNca3z.js +37 -0
- package/dist/pdf-reader.js +1 -1
- package/dist/print.js +2 -2
- package/dist/{public-zVb_Nq_D.js → public-vxiijIJF.js} +82 -82
- package/dist/{rich-code-block-DMWZZJma.js → rich-code-block-BwvCXPqq.js} +52 -52
- package/dist/{sortable-provider-DstbgMVf.js → sortable-provider-D2pAFWQB.js} +218 -218
- package/dist/{tooltip-CkttDIab.js → spinner-BpVwI1ps.js} +503 -278
- package/dist/{stored-language-IaL1Ftn_.js → stored-language-Beyj2ult.js} +4 -2
- package/dist/theme-picker.js +45 -45
- package/dist/{theme-store-CSl51uNH.js → theme-store-BdPp43cV.js} +13 -13
- package/dist/{theme-toggle-CGW2_K54.js → theme-toggle-BTYRPkP4.js} +16 -16
- package/dist/themes.js +17 -17
- package/dist/{toggle-group-BMJNcFAC.js → toggle-group-BkH23Jk4.js} +11 -11
- package/dist/{toolbar-items-CsLGJMEJ.js → toolbar-items-CIMo4F9q.js} +421 -421
- package/dist/{translate-material-v9u-e7Kd.js → translate-material-DEUlaL_1.js} +2 -2
- package/dist/{translator-Dk4_qE6U.js → translator-CBgIb3zP.js} +1 -1
- package/dist/{use-chat-composer-Brcb5f7r.js → use-chat-composer-D8UAsX0f.js} +6228 -5999
- package/dist/{button-tones-BwuVvAmd.js → use-click-lock-BZYtTmVt.js} +37 -7
- package/dist/{use-heading-spy-DjKixjLm.js → use-heading-spy-C5LXtA8Z.js} +1 -1
- package/dist/{use-material-translation-DOkTaWK_.js → use-material-translation-DWWeeg-B.js} +2 -2
- package/dist/{use-theme-DMcyJ52N.js → use-theme-BCLireTd.js} +1 -1
- package/docs/components/buttons-and-actions.md +64 -5
- package/docs/components/data-table-filter-and-lists.md +30 -10
- package/docs/components/feedback-and-status.md +22 -3
- package/docs/components/form-fields.md +7 -0
- package/docs/guides/cards-and-tiles.md +60 -0
- package/docs/guides/server-lists-url.md +3 -2
- package/docs/roadmap.md +11 -0
- package/lib/components/components.css +1 -0
- package/lib/components/ui/actions/action-card/action-card-indicator.css +48 -0
- package/lib/components/ui/actions/action-card/action-card-modes.css +4 -1
- package/lib/components/ui/actions/action-card/action-card-tile.css +141 -0
- package/lib/components/ui/actions/action-card/action-card.css +33 -3
- package/package.json +1 -1
- package/dist/nxgt-theme-ZS945iMP.js +0 -37
- package/dist/spinner-C4CgDEYm.js +0 -229
|
@@ -1,38 +1,38 @@
|
|
|
1
1
|
import { r as e } from "./rolldown-runtime-BFFgcFxR.js";
|
|
2
2
|
import { t } from "./utils-BLfntITJ.js";
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import { a as
|
|
7
|
-
import { t as g } from "./
|
|
8
|
-
import { t as _ } from "./use-material-translation-
|
|
9
|
-
import { i as v, n as y, o as b, t as x } from "./code-language-items-
|
|
3
|
+
import { t as n } from "./is-production-GLw59WU8.js";
|
|
4
|
+
import { a as r } from "./dist-lmHmz_bu.js";
|
|
5
|
+
import { c as i, d as a, f as o, n as s, t as c } from "./dropdown-menu-XLlxfDgq.js";
|
|
6
|
+
import { a as l, i as u, n as d } from "./field-blur-context-Cwt4TuBq.js";
|
|
7
|
+
import { a as f, d as p, r as m, t as h, u as g } from "./toolbar-items-CIMo4F9q.js";
|
|
8
|
+
import { t as _ } from "./use-material-translation-DWWeeg-B.js";
|
|
9
|
+
import { i as v, n as y, o as b, t as x } from "./code-language-items-BKEUhQlF.js";
|
|
10
10
|
import { t as S } from "./useIsomorphicLayoutEffect-DfgAhWcH.js";
|
|
11
|
-
import { n as C, t as w } from "./escape-owner-
|
|
11
|
+
import { n as C, t as w } from "./escape-owner-B9eCwjLw.js";
|
|
12
12
|
import { t as T } from "./skeleton-DSdtr2qc.js";
|
|
13
13
|
import { t as E } from "./react-node-text-Crkpfpco.js";
|
|
14
|
-
import
|
|
15
|
-
import
|
|
16
|
-
import {
|
|
17
|
-
import { inertOthers as
|
|
14
|
+
import D, { memo as O, useCallback as ee, useEffect as k, useId as A, useImperativeHandle as j, useMemo as M, useRef as N, useState as P } from "react";
|
|
15
|
+
import { Fragment as te, jsx as F, jsxs as I } from "react/jsx-runtime";
|
|
16
|
+
import { Check as L, ChevronDown as R, CircleAlert as ne, Copy as re, FileCode2 as ie, Lock as ae, Maximize2 as oe, Minimize2 as se, Search as ce, TriangleAlert as le, WandSparkles as ue, WrapText as de } from "lucide-react";
|
|
17
|
+
import { inertOthers as fe } from "@nxgt/material-core/inert-others";
|
|
18
18
|
//#region ../../node_modules/@monaco-editor/loader/lib/es/_virtual/_rollupPluginBabelHelpers.js
|
|
19
|
-
function
|
|
19
|
+
function pe(e, t) {
|
|
20
20
|
(t == null || t > e.length) && (t = e.length);
|
|
21
21
|
for (var n = 0, r = Array(t); n < t; n++) r[n] = e[n];
|
|
22
22
|
return r;
|
|
23
23
|
}
|
|
24
|
-
function
|
|
24
|
+
function me(e) {
|
|
25
25
|
if (Array.isArray(e)) return e;
|
|
26
26
|
}
|
|
27
|
-
function
|
|
28
|
-
return (t =
|
|
27
|
+
function he(e, t, n) {
|
|
28
|
+
return (t = we(t)) in e ? Object.defineProperty(e, t, {
|
|
29
29
|
value: n,
|
|
30
30
|
enumerable: !0,
|
|
31
31
|
configurable: !0,
|
|
32
32
|
writable: !0
|
|
33
33
|
}) : e[t] = n, e;
|
|
34
34
|
}
|
|
35
|
-
function
|
|
35
|
+
function ge(e, t) {
|
|
36
36
|
var n = e == null ? null : typeof Symbol < "u" && e[Symbol.iterator] || e["@@iterator"];
|
|
37
37
|
if (n != null) {
|
|
38
38
|
var r, i, a, o, s = [], c = !0, l = !1;
|
|
@@ -50,10 +50,10 @@ function ve(e, t) {
|
|
|
50
50
|
return s;
|
|
51
51
|
}
|
|
52
52
|
}
|
|
53
|
-
function
|
|
53
|
+
function _e() {
|
|
54
54
|
throw TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
|
|
55
55
|
}
|
|
56
|
-
function
|
|
56
|
+
function ve(e, t) {
|
|
57
57
|
var n = Object.keys(e);
|
|
58
58
|
if (Object.getOwnPropertySymbols) {
|
|
59
59
|
var r = Object.getOwnPropertySymbols(e);
|
|
@@ -63,27 +63,27 @@ function be(e, t) {
|
|
|
63
63
|
}
|
|
64
64
|
return n;
|
|
65
65
|
}
|
|
66
|
-
function
|
|
66
|
+
function ye(e) {
|
|
67
67
|
for (var t = 1; t < arguments.length; t++) {
|
|
68
68
|
var n = arguments[t] == null ? {} : arguments[t];
|
|
69
|
-
t % 2 ?
|
|
70
|
-
|
|
71
|
-
}) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(n)) :
|
|
69
|
+
t % 2 ? ve(Object(n), !0).forEach(function(t) {
|
|
70
|
+
he(e, t, n[t]);
|
|
71
|
+
}) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(n)) : ve(Object(n)).forEach(function(t) {
|
|
72
72
|
Object.defineProperty(e, t, Object.getOwnPropertyDescriptor(n, t));
|
|
73
73
|
});
|
|
74
74
|
}
|
|
75
75
|
return e;
|
|
76
76
|
}
|
|
77
|
-
function
|
|
77
|
+
function be(e, t) {
|
|
78
78
|
if (e == null) return {};
|
|
79
|
-
var n, r, i =
|
|
79
|
+
var n, r, i = xe(e, t);
|
|
80
80
|
if (Object.getOwnPropertySymbols) {
|
|
81
81
|
var a = Object.getOwnPropertySymbols(e);
|
|
82
82
|
for (r = 0; r < a.length; r++) n = a[r], t.indexOf(n) === -1 && {}.propertyIsEnumerable.call(e, n) && (i[n] = e[n]);
|
|
83
83
|
}
|
|
84
84
|
return i;
|
|
85
85
|
}
|
|
86
|
-
function
|
|
86
|
+
function xe(e, t) {
|
|
87
87
|
if (e == null) return {};
|
|
88
88
|
var n = {};
|
|
89
89
|
for (var r in e) if ({}.hasOwnProperty.call(e, r)) {
|
|
@@ -92,10 +92,10 @@ function Ce(e, t) {
|
|
|
92
92
|
}
|
|
93
93
|
return n;
|
|
94
94
|
}
|
|
95
|
-
function
|
|
96
|
-
return
|
|
95
|
+
function Se(e, t) {
|
|
96
|
+
return me(e) || ge(e, t) || Te(e, t) || _e();
|
|
97
97
|
}
|
|
98
|
-
function
|
|
98
|
+
function Ce(e, t) {
|
|
99
99
|
if (typeof e != "object" || !e) return e;
|
|
100
100
|
var n = e[Symbol.toPrimitive];
|
|
101
101
|
if (n !== void 0) {
|
|
@@ -105,20 +105,20 @@ function Te(e, t) {
|
|
|
105
105
|
}
|
|
106
106
|
return (t === "string" ? String : Number)(e);
|
|
107
107
|
}
|
|
108
|
-
function
|
|
109
|
-
var t =
|
|
108
|
+
function we(e) {
|
|
109
|
+
var t = Ce(e, "string");
|
|
110
110
|
return typeof t == "symbol" ? t : t + "";
|
|
111
111
|
}
|
|
112
|
-
function
|
|
112
|
+
function Te(e, t) {
|
|
113
113
|
if (e) {
|
|
114
|
-
if (typeof e == "string") return
|
|
114
|
+
if (typeof e == "string") return pe(e, t);
|
|
115
115
|
var n = {}.toString.call(e).slice(8, -1);
|
|
116
|
-
return n === "Object" && e.constructor && (n = e.constructor.name), n === "Map" || n === "Set" ? Array.from(e) : n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n) ?
|
|
116
|
+
return n === "Object" && e.constructor && (n = e.constructor.name), n === "Map" || n === "Set" ? Array.from(e) : n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n) ? pe(e, t) : void 0;
|
|
117
117
|
}
|
|
118
118
|
}
|
|
119
119
|
//#endregion
|
|
120
120
|
//#region ../../node_modules/state-local/lib/es/state-local.js
|
|
121
|
-
function
|
|
121
|
+
function Ee(e, t, n) {
|
|
122
122
|
return t in e ? Object.defineProperty(e, t, {
|
|
123
123
|
value: n,
|
|
124
124
|
enumerable: !0,
|
|
@@ -126,7 +126,7 @@ function Oe(e, t, n) {
|
|
|
126
126
|
writable: !0
|
|
127
127
|
}) : e[t] = n, e;
|
|
128
128
|
}
|
|
129
|
-
function
|
|
129
|
+
function De(e, t) {
|
|
130
130
|
var n = Object.keys(e);
|
|
131
131
|
if (Object.getOwnPropertySymbols) {
|
|
132
132
|
var r = Object.getOwnPropertySymbols(e);
|
|
@@ -136,18 +136,18 @@ function ke(e, t) {
|
|
|
136
136
|
}
|
|
137
137
|
return n;
|
|
138
138
|
}
|
|
139
|
-
function
|
|
139
|
+
function Oe(e) {
|
|
140
140
|
for (var t = 1; t < arguments.length; t++) {
|
|
141
141
|
var n = arguments[t] == null ? {} : arguments[t];
|
|
142
|
-
t % 2 ?
|
|
143
|
-
|
|
144
|
-
}) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(n)) :
|
|
142
|
+
t % 2 ? De(Object(n), !0).forEach(function(t) {
|
|
143
|
+
Ee(e, t, n[t]);
|
|
144
|
+
}) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(n)) : De(Object(n)).forEach(function(t) {
|
|
145
145
|
Object.defineProperty(e, t, Object.getOwnPropertyDescriptor(n, t));
|
|
146
146
|
});
|
|
147
147
|
}
|
|
148
148
|
return e;
|
|
149
149
|
}
|
|
150
|
-
function
|
|
150
|
+
function ke() {
|
|
151
151
|
var e = [...arguments];
|
|
152
152
|
return function(t) {
|
|
153
153
|
return e.reduceRight(function(e, t) {
|
|
@@ -155,7 +155,7 @@ function je() {
|
|
|
155
155
|
}, t);
|
|
156
156
|
};
|
|
157
157
|
}
|
|
158
|
-
function
|
|
158
|
+
function z(e) {
|
|
159
159
|
return function t() {
|
|
160
160
|
var n = this, r = [...arguments];
|
|
161
161
|
return r.length >= e.length ? e.apply(this, r) : function() {
|
|
@@ -164,38 +164,38 @@ function L(e) {
|
|
|
164
164
|
};
|
|
165
165
|
};
|
|
166
166
|
}
|
|
167
|
-
function
|
|
167
|
+
function B(e) {
|
|
168
168
|
return {}.toString.call(e).includes("Object");
|
|
169
169
|
}
|
|
170
|
-
function
|
|
170
|
+
function Ae(e) {
|
|
171
171
|
return !Object.keys(e).length;
|
|
172
172
|
}
|
|
173
|
-
function
|
|
173
|
+
function V(e) {
|
|
174
174
|
return typeof e == "function";
|
|
175
175
|
}
|
|
176
|
-
function
|
|
176
|
+
function je(e, t) {
|
|
177
177
|
return Object.prototype.hasOwnProperty.call(e, t);
|
|
178
178
|
}
|
|
179
|
-
function
|
|
180
|
-
return
|
|
181
|
-
return !
|
|
182
|
-
}) &&
|
|
179
|
+
function Me(e, t) {
|
|
180
|
+
return B(t) || H("changeType"), Object.keys(t).some(function(t) {
|
|
181
|
+
return !je(e, t);
|
|
182
|
+
}) && H("changeField"), t;
|
|
183
183
|
}
|
|
184
|
-
function
|
|
185
|
-
|
|
184
|
+
function Ne(e) {
|
|
185
|
+
V(e) || H("selectorType");
|
|
186
186
|
}
|
|
187
|
-
function
|
|
188
|
-
|
|
189
|
-
return !
|
|
190
|
-
}) &&
|
|
187
|
+
function Pe(e) {
|
|
188
|
+
V(e) || B(e) || H("handlerType"), B(e) && Object.values(e).some(function(e) {
|
|
189
|
+
return !V(e);
|
|
190
|
+
}) && H("handlersType");
|
|
191
191
|
}
|
|
192
|
-
function
|
|
193
|
-
e ||
|
|
192
|
+
function Fe(e) {
|
|
193
|
+
e || H("initialIsRequired"), B(e) || H("initialType"), Ae(e) && H("initialContent");
|
|
194
194
|
}
|
|
195
|
-
function
|
|
195
|
+
function Ie(e, t) {
|
|
196
196
|
throw Error(e[t] || e.default);
|
|
197
197
|
}
|
|
198
|
-
var
|
|
198
|
+
var H = z(Ie)({
|
|
199
199
|
initialIsRequired: "initial state is required",
|
|
200
200
|
initialType: "initial state should be an object",
|
|
201
201
|
initialContent: "initial state shouldn't be an empty object",
|
|
@@ -205,42 +205,42 @@ var B = L(Re)({
|
|
|
205
205
|
changeType: "provided value of changes should be an object",
|
|
206
206
|
changeField: "it seams you want to change a field in the state which is not specified in the \"initial\" state",
|
|
207
207
|
default: "an unknown error accured in `state-local` package"
|
|
208
|
-
}),
|
|
209
|
-
changes:
|
|
210
|
-
selector:
|
|
211
|
-
handler:
|
|
212
|
-
initial:
|
|
208
|
+
}), U = {
|
|
209
|
+
changes: Me,
|
|
210
|
+
selector: Ne,
|
|
211
|
+
handler: Pe,
|
|
212
|
+
initial: Fe
|
|
213
213
|
};
|
|
214
|
-
function
|
|
214
|
+
function Le(e) {
|
|
215
215
|
var t = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {};
|
|
216
|
-
|
|
217
|
-
var n = { current: e }, r =
|
|
216
|
+
U.initial(e), U.handler(t);
|
|
217
|
+
var n = { current: e }, r = z(Be)(n, t), i = z(ze)(n), a = z(U.changes)(e), o = z(Re)(n);
|
|
218
218
|
function s() {
|
|
219
219
|
var e = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : function(e) {
|
|
220
220
|
return e;
|
|
221
221
|
};
|
|
222
|
-
return
|
|
222
|
+
return U.selector(e), e(n.current);
|
|
223
223
|
}
|
|
224
224
|
function c(e) {
|
|
225
|
-
|
|
225
|
+
ke(r, i, a, o)(e);
|
|
226
226
|
}
|
|
227
227
|
return [s, c];
|
|
228
228
|
}
|
|
229
|
-
function
|
|
230
|
-
return
|
|
229
|
+
function Re(e, t) {
|
|
230
|
+
return V(t) ? t(e.current) : t;
|
|
231
231
|
}
|
|
232
|
-
function
|
|
233
|
-
return e.current =
|
|
232
|
+
function ze(e, t) {
|
|
233
|
+
return e.current = Oe(Oe({}, e.current), t), t;
|
|
234
234
|
}
|
|
235
|
-
function
|
|
236
|
-
return
|
|
235
|
+
function Be(e, t, n) {
|
|
236
|
+
return V(t) ? t(e.current) : Object.keys(n).forEach(function(n) {
|
|
237
237
|
return t[n]?.call(t, e.current[n]);
|
|
238
238
|
}), n;
|
|
239
239
|
}
|
|
240
|
-
var
|
|
240
|
+
var Ve = { create: Le }, He = { paths: { vs: "https://cdn.jsdelivr.net/npm/monaco-editor@0.55.1/min/vs" } };
|
|
241
241
|
//#endregion
|
|
242
242
|
//#region ../../node_modules/@monaco-editor/loader/lib/es/utils/curry.js
|
|
243
|
-
function
|
|
243
|
+
function Ue(e) {
|
|
244
244
|
return function t() {
|
|
245
245
|
var n = this, r = [...arguments];
|
|
246
246
|
return r.length >= e.length ? e.apply(this, r) : function() {
|
|
@@ -251,26 +251,26 @@ function Ge(e) {
|
|
|
251
251
|
}
|
|
252
252
|
//#endregion
|
|
253
253
|
//#region ../../node_modules/@monaco-editor/loader/lib/es/utils/isObject.js
|
|
254
|
-
function
|
|
254
|
+
function We(e) {
|
|
255
255
|
return {}.toString.call(e).includes("Object");
|
|
256
256
|
}
|
|
257
257
|
//#endregion
|
|
258
258
|
//#region ../../node_modules/@monaco-editor/loader/lib/es/validators/index.js
|
|
259
|
-
function
|
|
260
|
-
return e ||
|
|
259
|
+
function Ge(e) {
|
|
260
|
+
return e || Ye("configIsRequired"), We(e) || Ye("configType"), e.urls ? (Ke(), { paths: { vs: e.urls.monacoBase } }) : e;
|
|
261
261
|
}
|
|
262
|
-
function
|
|
263
|
-
console.warn(
|
|
262
|
+
function Ke() {
|
|
263
|
+
console.warn(Je.deprecation);
|
|
264
264
|
}
|
|
265
|
-
function
|
|
265
|
+
function qe(e, t) {
|
|
266
266
|
throw Error(e[t] || e.default);
|
|
267
267
|
}
|
|
268
|
-
var
|
|
268
|
+
var Je = {
|
|
269
269
|
configIsRequired: "the configuration object is required",
|
|
270
270
|
configType: "the configuration object should be an object",
|
|
271
271
|
default: "an unknown error accured in `@monaco-editor/loader` package",
|
|
272
272
|
deprecation: "Deprecation warning!\n You are using deprecated way of configuration.\n\n Instead of using\n monaco.config({ urls: { monacoBase: '...' } })\n use\n monaco.config({ paths: { vs: '...' } })\n\n For more please check the link https://github.com/suren-atoyan/monaco-loader#config\n "
|
|
273
|
-
},
|
|
273
|
+
}, Ye = Ue(qe)(Je), Xe = { config: Ge }, Ze = function() {
|
|
274
274
|
var e = [...arguments];
|
|
275
275
|
return function(t) {
|
|
276
276
|
return e.reduceRight(function(e, t) {
|
|
@@ -280,21 +280,21 @@ var Xe = {
|
|
|
280
280
|
};
|
|
281
281
|
//#endregion
|
|
282
282
|
//#region ../../node_modules/@monaco-editor/loader/lib/es/utils/deepMerge.js
|
|
283
|
-
function
|
|
283
|
+
function Qe(e, t) {
|
|
284
284
|
return Object.keys(t).forEach(function(n) {
|
|
285
|
-
t[n] instanceof Object && e[n] && Object.assign(t[n],
|
|
286
|
-
}),
|
|
285
|
+
t[n] instanceof Object && e[n] && Object.assign(t[n], Qe(e[n], t[n]));
|
|
286
|
+
}), ye(ye({}, e), t);
|
|
287
287
|
}
|
|
288
288
|
//#endregion
|
|
289
289
|
//#region ../../node_modules/@monaco-editor/loader/lib/es/utils/makeCancelable.js
|
|
290
|
-
var
|
|
290
|
+
var $e = {
|
|
291
291
|
type: "cancelation",
|
|
292
292
|
msg: "operation is manually canceled"
|
|
293
293
|
};
|
|
294
|
-
function
|
|
294
|
+
function et(e) {
|
|
295
295
|
var t = !1, n = new Promise(function(n, r) {
|
|
296
296
|
e.then(function(e) {
|
|
297
|
-
return t ? r(
|
|
297
|
+
return t ? r($e) : n(e);
|
|
298
298
|
}), e.catch(r);
|
|
299
299
|
});
|
|
300
300
|
return n.cancel = function() {
|
|
@@ -303,24 +303,24 @@ function nt(e) {
|
|
|
303
303
|
}
|
|
304
304
|
//#endregion
|
|
305
305
|
//#region ../../node_modules/@monaco-editor/loader/lib/es/loader/index.js
|
|
306
|
-
var
|
|
307
|
-
config:
|
|
306
|
+
var tt = ["monaco"], nt = Se(Ve.create({
|
|
307
|
+
config: He,
|
|
308
308
|
isInitialized: !1,
|
|
309
309
|
resolve: null,
|
|
310
310
|
reject: null,
|
|
311
311
|
monaco: null
|
|
312
|
-
}), 2),
|
|
313
|
-
function
|
|
314
|
-
var t =
|
|
315
|
-
|
|
312
|
+
}), 2), W = nt[0], G = nt[1];
|
|
313
|
+
function rt(e) {
|
|
314
|
+
var t = Xe.config(e), n = t.monaco, r = be(t, tt);
|
|
315
|
+
G(function(e) {
|
|
316
316
|
return {
|
|
317
|
-
config:
|
|
317
|
+
config: Qe(e.config, r),
|
|
318
318
|
monaco: n
|
|
319
319
|
};
|
|
320
320
|
});
|
|
321
321
|
}
|
|
322
|
-
function
|
|
323
|
-
var e =
|
|
322
|
+
function it() {
|
|
323
|
+
var e = W(function(e) {
|
|
324
324
|
return {
|
|
325
325
|
monaco: e.monaco,
|
|
326
326
|
isInitialized: e.isInitialized,
|
|
@@ -328,32 +328,32 @@ function ot() {
|
|
|
328
328
|
};
|
|
329
329
|
});
|
|
330
330
|
if (!e.isInitialized) {
|
|
331
|
-
if (
|
|
332
|
-
if (window.monaco && window.monaco.editor) return
|
|
333
|
-
|
|
331
|
+
if (G({ isInitialized: !0 }), e.monaco) return e.resolve(e.monaco), et(dt);
|
|
332
|
+
if (window.monaco && window.monaco.editor) return lt(window.monaco), e.resolve(window.monaco), et(dt);
|
|
333
|
+
Ze(at, st)(ct);
|
|
334
334
|
}
|
|
335
|
-
return
|
|
335
|
+
return et(dt);
|
|
336
336
|
}
|
|
337
|
-
function
|
|
337
|
+
function at(e) {
|
|
338
338
|
return document.body.appendChild(e);
|
|
339
339
|
}
|
|
340
|
-
function
|
|
340
|
+
function ot(e) {
|
|
341
341
|
var t = document.createElement("script");
|
|
342
342
|
return e && (t.src = e), t;
|
|
343
343
|
}
|
|
344
|
-
function
|
|
345
|
-
var t =
|
|
344
|
+
function st(e) {
|
|
345
|
+
var t = W(function(e) {
|
|
346
346
|
return {
|
|
347
347
|
config: e.config,
|
|
348
348
|
reject: e.reject
|
|
349
349
|
};
|
|
350
|
-
}), n =
|
|
350
|
+
}), n = ot(`${t.config.paths.vs}/loader.js`);
|
|
351
351
|
return n.onload = function() {
|
|
352
352
|
return e();
|
|
353
353
|
}, n.onerror = t.reject, n;
|
|
354
354
|
}
|
|
355
|
-
function
|
|
356
|
-
var e =
|
|
355
|
+
function ct() {
|
|
356
|
+
var e = W(function(e) {
|
|
357
357
|
return {
|
|
358
358
|
config: e.config,
|
|
359
359
|
resolve: e.resolve,
|
|
@@ -362,29 +362,29 @@ function ut() {
|
|
|
362
362
|
}), t = window.require;
|
|
363
363
|
t.config(e.config), t(["vs/editor/editor.main"], function(t) {
|
|
364
364
|
var n = t.m || t;
|
|
365
|
-
|
|
365
|
+
lt(n), e.resolve(n);
|
|
366
366
|
}, function(t) {
|
|
367
367
|
e.reject(t);
|
|
368
368
|
});
|
|
369
369
|
}
|
|
370
|
-
function
|
|
371
|
-
|
|
370
|
+
function lt(e) {
|
|
371
|
+
W().monaco || G({ monaco: e });
|
|
372
372
|
}
|
|
373
|
-
function
|
|
374
|
-
return
|
|
373
|
+
function ut() {
|
|
374
|
+
return W(function(e) {
|
|
375
375
|
return e.monaco;
|
|
376
376
|
});
|
|
377
377
|
}
|
|
378
|
-
var
|
|
379
|
-
return
|
|
378
|
+
var dt = new Promise(function(e, t) {
|
|
379
|
+
return G({
|
|
380
380
|
resolve: e,
|
|
381
381
|
reject: t
|
|
382
382
|
});
|
|
383
|
-
}),
|
|
384
|
-
config:
|
|
385
|
-
init:
|
|
386
|
-
__getMonacoInstance:
|
|
387
|
-
},
|
|
383
|
+
}), K = {
|
|
384
|
+
config: rt,
|
|
385
|
+
init: it,
|
|
386
|
+
__getMonacoInstance: ut
|
|
387
|
+
}, ft = {
|
|
388
388
|
wrapper: {
|
|
389
389
|
display: "flex",
|
|
390
390
|
position: "relative",
|
|
@@ -392,99 +392,99 @@ var pt = new Promise(function(e, t) {
|
|
|
392
392
|
},
|
|
393
393
|
fullWidth: { width: "100%" },
|
|
394
394
|
hide: { display: "none" }
|
|
395
|
-
},
|
|
395
|
+
}, pt = { container: {
|
|
396
396
|
display: "flex",
|
|
397
397
|
height: "100%",
|
|
398
398
|
width: "100%",
|
|
399
399
|
justifyContent: "center",
|
|
400
400
|
alignItems: "center"
|
|
401
401
|
} };
|
|
402
|
-
function
|
|
403
|
-
return
|
|
402
|
+
function mt({ children: e }) {
|
|
403
|
+
return D.createElement("div", { style: pt.container }, e);
|
|
404
404
|
}
|
|
405
|
-
var
|
|
406
|
-
function
|
|
407
|
-
return
|
|
405
|
+
var ht = mt;
|
|
406
|
+
function gt({ width: e, height: t, isEditorReady: n, loading: r, _ref: i, className: a, wrapperProps: o }) {
|
|
407
|
+
return D.createElement("section", {
|
|
408
408
|
style: {
|
|
409
|
-
...
|
|
409
|
+
...ft.wrapper,
|
|
410
410
|
width: e,
|
|
411
411
|
height: t
|
|
412
412
|
},
|
|
413
413
|
...o
|
|
414
|
-
}, !n &&
|
|
414
|
+
}, !n && D.createElement(ht, null, r), D.createElement("div", {
|
|
415
415
|
ref: i,
|
|
416
416
|
style: {
|
|
417
|
-
...
|
|
418
|
-
...!n &&
|
|
417
|
+
...ft.fullWidth,
|
|
418
|
+
...!n && ft.hide
|
|
419
419
|
},
|
|
420
420
|
className: a
|
|
421
421
|
}));
|
|
422
422
|
}
|
|
423
|
-
var
|
|
424
|
-
function
|
|
425
|
-
|
|
423
|
+
var _t = O(gt);
|
|
424
|
+
function vt(e) {
|
|
425
|
+
k(e, []);
|
|
426
426
|
}
|
|
427
|
-
var
|
|
428
|
-
function
|
|
427
|
+
var yt = vt;
|
|
428
|
+
function bt(e, t, n = !0) {
|
|
429
429
|
let r = N(!0);
|
|
430
|
-
|
|
430
|
+
k(r.current || !n ? () => {
|
|
431
431
|
r.current = !1;
|
|
432
432
|
} : e, t);
|
|
433
433
|
}
|
|
434
|
-
var
|
|
435
|
-
function
|
|
436
|
-
function
|
|
437
|
-
return
|
|
434
|
+
var q = bt;
|
|
435
|
+
function J() {}
|
|
436
|
+
function Y(e, t, n, r) {
|
|
437
|
+
return xt(e, r) || St(e, t, n, r);
|
|
438
438
|
}
|
|
439
|
-
function
|
|
440
|
-
return e.editor.getModel(
|
|
439
|
+
function xt(e, t) {
|
|
440
|
+
return e.editor.getModel(Ct(e, t));
|
|
441
441
|
}
|
|
442
|
-
function
|
|
443
|
-
return e.editor.createModel(t, n, r ?
|
|
442
|
+
function St(e, t, n, r) {
|
|
443
|
+
return e.editor.createModel(t, n, r ? Ct(e, r) : void 0);
|
|
444
444
|
}
|
|
445
|
-
function
|
|
445
|
+
function Ct(e, t) {
|
|
446
446
|
return e.Uri.parse(t);
|
|
447
447
|
}
|
|
448
|
-
function
|
|
449
|
-
let [v, y] = P(!1), [b, x] = P(!0), S = N(null), C = N(null), w = N(null), T = N(_), E = N(g),
|
|
450
|
-
|
|
451
|
-
let e =
|
|
452
|
-
return e.then((e) => (C.current = e) && x(!1)).catch((e) => e?.type !== "cancelation" && console.error("Monaco initialization: error:", e)), () => S.current ?
|
|
453
|
-
}),
|
|
448
|
+
function wt({ original: e, modified: t, language: n, originalLanguage: r, modifiedLanguage: i, originalModelPath: a, modifiedModelPath: o, keepCurrentOriginalModel: s = !1, keepCurrentModifiedModel: c = !1, theme: l = "light", loading: u = "Loading...", options: d = {}, height: f = "100%", width: p = "100%", className: m, wrapperProps: h = {}, beforeMount: g = J, onMount: _ = J }) {
|
|
449
|
+
let [v, y] = P(!1), [b, x] = P(!0), S = N(null), C = N(null), w = N(null), T = N(_), E = N(g), O = N(!1);
|
|
450
|
+
yt(() => {
|
|
451
|
+
let e = K.init();
|
|
452
|
+
return e.then((e) => (C.current = e) && x(!1)).catch((e) => e?.type !== "cancelation" && console.error("Monaco initialization: error:", e)), () => S.current ? M() : e.cancel();
|
|
453
|
+
}), q(() => {
|
|
454
454
|
if (S.current && C.current) {
|
|
455
|
-
let t = S.current.getOriginalEditor(), i =
|
|
455
|
+
let t = S.current.getOriginalEditor(), i = Y(C.current, e || "", r || n || "text", a || "");
|
|
456
456
|
i !== t.getModel() && t.setModel(i);
|
|
457
457
|
}
|
|
458
|
-
}, [a], v),
|
|
458
|
+
}, [a], v), q(() => {
|
|
459
459
|
if (S.current && C.current) {
|
|
460
|
-
let e = S.current.getModifiedEditor(), r =
|
|
460
|
+
let e = S.current.getModifiedEditor(), r = Y(C.current, t || "", i || n || "text", o || "");
|
|
461
461
|
r !== e.getModel() && e.setModel(r);
|
|
462
462
|
}
|
|
463
|
-
}, [o], v),
|
|
463
|
+
}, [o], v), q(() => {
|
|
464
464
|
let e = S.current.getModifiedEditor();
|
|
465
465
|
e.getOption(C.current.editor.EditorOption.readOnly) ? e.setValue(t || "") : t !== e.getValue() && (e.executeEdits("", [{
|
|
466
466
|
range: e.getModel().getFullModelRange(),
|
|
467
467
|
text: t || "",
|
|
468
468
|
forceMoveMarkers: !0
|
|
469
469
|
}]), e.pushUndoStop());
|
|
470
|
-
}, [t], v),
|
|
470
|
+
}, [t], v), q(() => {
|
|
471
471
|
S.current?.getModel()?.original.setValue(e || "");
|
|
472
|
-
}, [e], v),
|
|
472
|
+
}, [e], v), q(() => {
|
|
473
473
|
let { original: e, modified: t } = S.current.getModel();
|
|
474
474
|
C.current.editor.setModelLanguage(e, r || n || "text"), C.current.editor.setModelLanguage(t, i || n || "text");
|
|
475
475
|
}, [
|
|
476
476
|
n,
|
|
477
477
|
r,
|
|
478
478
|
i
|
|
479
|
-
], v),
|
|
479
|
+
], v), q(() => {
|
|
480
480
|
C.current?.editor.setTheme(l);
|
|
481
|
-
}, [l], v),
|
|
481
|
+
}, [l], v), q(() => {
|
|
482
482
|
S.current?.updateOptions(d);
|
|
483
483
|
}, [d], v);
|
|
484
|
-
let
|
|
484
|
+
let A = ee(() => {
|
|
485
485
|
if (!C.current) return;
|
|
486
486
|
E.current(C.current);
|
|
487
|
-
let s =
|
|
487
|
+
let s = Y(C.current, e || "", r || n || "text", a || ""), c = Y(C.current, t || "", i || n || "text", o || "");
|
|
488
488
|
S.current?.setModel({
|
|
489
489
|
original: s,
|
|
490
490
|
modified: c
|
|
@@ -497,30 +497,30 @@ function Et({ original: e, modified: t, language: n, originalLanguage: r, modifi
|
|
|
497
497
|
r,
|
|
498
498
|
a,
|
|
499
499
|
o
|
|
500
|
-
]),
|
|
501
|
-
!
|
|
500
|
+
]), j = ee(() => {
|
|
501
|
+
!O.current && w.current && (S.current = C.current.editor.createDiffEditor(w.current, {
|
|
502
502
|
automaticLayout: !0,
|
|
503
503
|
...d
|
|
504
|
-
}),
|
|
504
|
+
}), A(), C.current?.editor.setTheme(l), y(!0), O.current = !0);
|
|
505
505
|
}, [
|
|
506
506
|
d,
|
|
507
507
|
l,
|
|
508
|
-
|
|
508
|
+
A
|
|
509
509
|
]);
|
|
510
|
-
|
|
510
|
+
k(() => {
|
|
511
511
|
v && T.current(S.current, C.current);
|
|
512
|
-
}, [v]),
|
|
513
|
-
!b && !v &&
|
|
512
|
+
}, [v]), k(() => {
|
|
513
|
+
!b && !v && j();
|
|
514
514
|
}, [
|
|
515
515
|
b,
|
|
516
516
|
v,
|
|
517
|
-
|
|
517
|
+
j
|
|
518
518
|
]);
|
|
519
|
-
function
|
|
519
|
+
function M() {
|
|
520
520
|
let e = S.current?.getModel();
|
|
521
521
|
s || e?.original?.dispose(), c || e?.modified?.dispose(), S.current?.dispose();
|
|
522
522
|
}
|
|
523
|
-
return
|
|
523
|
+
return D.createElement(_t, {
|
|
524
524
|
width: p,
|
|
525
525
|
height: f,
|
|
526
526
|
isEditorReady: v,
|
|
@@ -530,47 +530,47 @@ function Et({ original: e, modified: t, language: n, originalLanguage: r, modifi
|
|
|
530
530
|
wrapperProps: h
|
|
531
531
|
});
|
|
532
532
|
}
|
|
533
|
-
var
|
|
534
|
-
function
|
|
533
|
+
var Tt = O(wt);
|
|
534
|
+
function Et(e) {
|
|
535
535
|
let t = N();
|
|
536
|
-
return
|
|
536
|
+
return k(() => {
|
|
537
537
|
t.current = e;
|
|
538
538
|
}, [e]), t.current;
|
|
539
539
|
}
|
|
540
|
-
var
|
|
541
|
-
function
|
|
542
|
-
let [x, S] = P(!1), [C, w] = P(!0), T = N(null), E = N(null),
|
|
543
|
-
|
|
544
|
-
let e =
|
|
545
|
-
return e.then((e) => (T.current = e) && w(!1)).catch((e) => e?.type !== "cancelation" && console.error("Monaco initialization: error:", e)), () => E.current ?
|
|
546
|
-
}),
|
|
547
|
-
let o =
|
|
548
|
-
o !== E.current?.getModel() && (d &&
|
|
549
|
-
}, [a], x),
|
|
540
|
+
var Dt = Et, Ot = /* @__PURE__ */ new Map();
|
|
541
|
+
function kt({ defaultValue: e, defaultLanguage: t, defaultPath: n, value: r, language: i, path: a, theme: o = "light", line: s, loading: c = "Loading...", options: l = {}, overrideServices: u = {}, saveViewState: d = !0, keepCurrentModel: f = !1, width: p = "100%", height: m = "100%", className: h, wrapperProps: g = {}, beforeMount: _ = J, onMount: v = J, onChange: y, onValidate: b = J }) {
|
|
542
|
+
let [x, S] = P(!1), [C, w] = P(!0), T = N(null), E = N(null), O = N(null), A = N(v), j = N(_), M = N(), te = N(r), F = Dt(a), I = N(!1), L = N(!1);
|
|
543
|
+
yt(() => {
|
|
544
|
+
let e = K.init();
|
|
545
|
+
return e.then((e) => (T.current = e) && w(!1)).catch((e) => e?.type !== "cancelation" && console.error("Monaco initialization: error:", e)), () => E.current ? ne() : e.cancel();
|
|
546
|
+
}), q(() => {
|
|
547
|
+
let o = Y(T.current, e || r || "", t || i || "", a || n || "");
|
|
548
|
+
o !== E.current?.getModel() && (d && Ot.set(F, E.current?.saveViewState()), E.current?.setModel(o), d && E.current?.restoreViewState(Ot.get(a)));
|
|
549
|
+
}, [a], x), q(() => {
|
|
550
550
|
E.current?.updateOptions(l);
|
|
551
|
-
}, [l], x),
|
|
552
|
-
!E.current || r === void 0 || (E.current.getOption(T.current.editor.EditorOption.readOnly) ? E.current.setValue(r) : r !== E.current.getValue() && (
|
|
551
|
+
}, [l], x), q(() => {
|
|
552
|
+
!E.current || r === void 0 || (E.current.getOption(T.current.editor.EditorOption.readOnly) ? E.current.setValue(r) : r !== E.current.getValue() && (L.current = !0, E.current.executeEdits("", [{
|
|
553
553
|
range: E.current.getModel().getFullModelRange(),
|
|
554
554
|
text: r,
|
|
555
555
|
forceMoveMarkers: !0
|
|
556
|
-
}]), E.current.pushUndoStop(),
|
|
557
|
-
}, [r], x),
|
|
556
|
+
}]), E.current.pushUndoStop(), L.current = !1));
|
|
557
|
+
}, [r], x), q(() => {
|
|
558
558
|
let e = E.current?.getModel();
|
|
559
559
|
e && i && T.current?.editor.setModelLanguage(e, i);
|
|
560
|
-
}, [i], x),
|
|
560
|
+
}, [i], x), q(() => {
|
|
561
561
|
s !== void 0 && E.current?.revealLine(s);
|
|
562
|
-
}, [s], x),
|
|
562
|
+
}, [s], x), q(() => {
|
|
563
563
|
T.current?.editor.setTheme(o);
|
|
564
564
|
}, [o], x);
|
|
565
|
-
let
|
|
566
|
-
if (!(!
|
|
567
|
-
|
|
568
|
-
let c = a || n, f =
|
|
569
|
-
E.current = T.current?.editor.create(
|
|
565
|
+
let R = ee(() => {
|
|
566
|
+
if (!(!O.current || !T.current) && !I.current) {
|
|
567
|
+
j.current(T.current);
|
|
568
|
+
let c = a || n, f = Y(T.current, r || e || "", t || i || "", c || "");
|
|
569
|
+
E.current = T.current?.editor.create(O.current, {
|
|
570
570
|
model: f,
|
|
571
571
|
automaticLayout: !0,
|
|
572
572
|
...l
|
|
573
|
-
}, u), d && E.current.restoreViewState(
|
|
573
|
+
}, u), d && E.current.restoreViewState(Ot.get(c)), T.current.editor.setTheme(o), s !== void 0 && E.current.revealLine(s), S(!0), I.current = !0;
|
|
574
574
|
}
|
|
575
575
|
}, [
|
|
576
576
|
e,
|
|
@@ -585,19 +585,19 @@ function At({ defaultValue: e, defaultLanguage: t, defaultPath: n, value: r, lan
|
|
|
585
585
|
o,
|
|
586
586
|
s
|
|
587
587
|
]);
|
|
588
|
-
|
|
589
|
-
x &&
|
|
590
|
-
}, [x]),
|
|
591
|
-
!C && !x &&
|
|
588
|
+
k(() => {
|
|
589
|
+
x && A.current(E.current, T.current);
|
|
590
|
+
}, [x]), k(() => {
|
|
591
|
+
!C && !x && R();
|
|
592
592
|
}, [
|
|
593
593
|
C,
|
|
594
594
|
x,
|
|
595
|
-
|
|
596
|
-
]), te.current = r,
|
|
597
|
-
x && y && (
|
|
598
|
-
|
|
595
|
+
R
|
|
596
|
+
]), te.current = r, k(() => {
|
|
597
|
+
x && y && (M.current?.dispose(), M.current = E.current?.onDidChangeModelContent((e) => {
|
|
598
|
+
L.current || y(E.current.getValue(), e);
|
|
599
599
|
}));
|
|
600
|
-
}, [x, y]),
|
|
600
|
+
}, [x, y]), k(() => {
|
|
601
601
|
if (x) {
|
|
602
602
|
let e = T.current.editor.onDidChangeMarkers((e) => {
|
|
603
603
|
let t = E.current.getModel()?.uri;
|
|
@@ -612,23 +612,23 @@ function At({ defaultValue: e, defaultLanguage: t, defaultPath: n, value: r, lan
|
|
|
612
612
|
}
|
|
613
613
|
return () => {};
|
|
614
614
|
}, [x, b]);
|
|
615
|
-
function
|
|
616
|
-
|
|
615
|
+
function ne() {
|
|
616
|
+
M.current?.dispose(), f ? d && Ot.set(a, E.current.saveViewState()) : E.current.getModel()?.dispose(), E.current.dispose();
|
|
617
617
|
}
|
|
618
|
-
return
|
|
618
|
+
return D.createElement(_t, {
|
|
619
619
|
width: p,
|
|
620
620
|
height: m,
|
|
621
621
|
isEditorReady: x,
|
|
622
622
|
loading: c,
|
|
623
|
-
_ref:
|
|
623
|
+
_ref: O,
|
|
624
624
|
className: h,
|
|
625
625
|
wrapperProps: g
|
|
626
626
|
});
|
|
627
627
|
}
|
|
628
|
-
var
|
|
628
|
+
var At = O(kt);
|
|
629
629
|
//#endregion
|
|
630
630
|
//#region lib/components/ui/display/code/monaco-load-failed.tsx
|
|
631
|
-
function
|
|
631
|
+
function jt({ height: e }) {
|
|
632
632
|
let { t } = _();
|
|
633
633
|
return /* @__PURE__ */ F("p", {
|
|
634
634
|
role: "alert",
|
|
@@ -639,11 +639,11 @@ function Mt({ height: e }) {
|
|
|
639
639
|
}
|
|
640
640
|
//#endregion
|
|
641
641
|
//#region lib/components/ui/display/code/use-monaco-load-failed.ts
|
|
642
|
-
function
|
|
642
|
+
function Mt() {
|
|
643
643
|
let [e, t] = P(!1);
|
|
644
|
-
return
|
|
644
|
+
return k(() => {
|
|
645
645
|
let e = !0;
|
|
646
|
-
return
|
|
646
|
+
return K.init().catch((n) => {
|
|
647
647
|
let r = n?.type;
|
|
648
648
|
e && r !== "cancelation" && t(!0);
|
|
649
649
|
}), () => {
|
|
@@ -653,7 +653,7 @@ function Nt() {
|
|
|
653
653
|
}
|
|
654
654
|
//#endregion
|
|
655
655
|
//#region lib/components/ui/widgets/code-editor/code-editor-options.ts
|
|
656
|
-
var
|
|
656
|
+
var Nt = {
|
|
657
657
|
minimap: { enabled: !1 },
|
|
658
658
|
overviewRulerLanes: 0,
|
|
659
659
|
overviewRulerBorder: !1,
|
|
@@ -670,18 +670,18 @@ var Pt = {
|
|
|
670
670
|
fontSize: 13,
|
|
671
671
|
lineHeight: 20,
|
|
672
672
|
fixedOverflowWidgets: !0
|
|
673
|
-
},
|
|
673
|
+
}, Pt = {
|
|
674
674
|
renderLineHighlight: "none",
|
|
675
675
|
matchBrackets: "never",
|
|
676
676
|
occurrencesHighlight: "off",
|
|
677
677
|
selectionHighlight: !1,
|
|
678
678
|
cursorBlinking: "solid"
|
|
679
679
|
};
|
|
680
|
-
function
|
|
680
|
+
function Ft({ disabled: e, readOnly: t, lineNumbers: n = !0, minimap: r = !1, tabSize: i = 2, fontSize: a = 13, required: o, wordWrap: s, label: c, overflowWidgetsDomNode: l }) {
|
|
681
681
|
return {
|
|
682
|
-
...
|
|
682
|
+
...Nt,
|
|
683
683
|
overflowWidgetsDomNode: l,
|
|
684
|
-
...t &&
|
|
684
|
+
...t && Pt,
|
|
685
685
|
readOnly: e || t,
|
|
686
686
|
domReadOnly: e || t,
|
|
687
687
|
ariaRequired: o,
|
|
@@ -700,7 +700,7 @@ function It({ disabled: e, readOnly: t, lineNumbers: n = !0, minimap: r = !1, ta
|
|
|
700
700
|
}
|
|
701
701
|
//#endregion
|
|
702
702
|
//#region lib/components/ui/widgets/code-editor/theme/token-rules.ts
|
|
703
|
-
var
|
|
703
|
+
var It = [
|
|
704
704
|
"comment",
|
|
705
705
|
"keyword",
|
|
706
706
|
"string",
|
|
@@ -714,7 +714,7 @@ var Lt = [
|
|
|
714
714
|
"attribute",
|
|
715
715
|
"regexp",
|
|
716
716
|
"invalid"
|
|
717
|
-
],
|
|
717
|
+
], Lt = [
|
|
718
718
|
["comment", "comment"],
|
|
719
719
|
["keyword", "keyword"],
|
|
720
720
|
["string", "string"],
|
|
@@ -737,7 +737,7 @@ var Lt = [
|
|
|
737
737
|
["key", "attribute"],
|
|
738
738
|
["regexp", "regexp"],
|
|
739
739
|
["invalid", "invalid"]
|
|
740
|
-
],
|
|
740
|
+
], Rt = [
|
|
741
741
|
["namespace", "type"],
|
|
742
742
|
["class", "type"],
|
|
743
743
|
["enum", "type"],
|
|
@@ -753,41 +753,41 @@ var Lt = [
|
|
|
753
753
|
["macro", "function"],
|
|
754
754
|
["decorator", "function"],
|
|
755
755
|
["modifier", "keyword"]
|
|
756
|
-
],
|
|
757
|
-
function
|
|
756
|
+
], zt = [...Lt, ...Rt], Bt = Object.fromEntries(It.map((e, t) => [e, (1056816 + (t + 1) * 65793).toString(16)])), Vt = "0f0f0f", Ht = "fefefe";
|
|
757
|
+
function Ut() {
|
|
758
758
|
return [{
|
|
759
759
|
token: "",
|
|
760
|
-
foreground:
|
|
761
|
-
background:
|
|
762
|
-
}, ...
|
|
760
|
+
foreground: Vt,
|
|
761
|
+
background: Ht
|
|
762
|
+
}, ...zt.map(([e, t]) => ({
|
|
763
763
|
token: e,
|
|
764
|
-
foreground:
|
|
764
|
+
foreground: Bt[t],
|
|
765
765
|
...t === "comment" ? { fontStyle: "italic" } : {}
|
|
766
766
|
}))];
|
|
767
767
|
}
|
|
768
768
|
//#endregion
|
|
769
769
|
//#region lib/components/ui/widgets/code-editor/theme/structural-theme.ts
|
|
770
|
-
var
|
|
770
|
+
var Wt = "nxgt-structural", Gt = /* @__PURE__ */ new WeakSet();
|
|
771
771
|
function Kt(e) {
|
|
772
|
-
Gt.has(e) || (e.editor.defineTheme(
|
|
772
|
+
Gt.has(e) || (e.editor.defineTheme(Wt, {
|
|
773
773
|
base: "vs",
|
|
774
774
|
inherit: !1,
|
|
775
|
-
rules:
|
|
775
|
+
rules: Ut(),
|
|
776
776
|
colors: {
|
|
777
|
-
"editor.background": `#${
|
|
778
|
-
"editor.foreground": `#${
|
|
777
|
+
"editor.background": `#${Ht}`,
|
|
778
|
+
"editor.foreground": `#${Vt}`
|
|
779
779
|
}
|
|
780
780
|
}), Gt.add(e));
|
|
781
781
|
}
|
|
782
782
|
function qt(e) {
|
|
783
|
-
Kt(e), e.editor.setTheme(
|
|
783
|
+
Kt(e), e.editor.setTheme(Wt);
|
|
784
784
|
}
|
|
785
785
|
//#endregion
|
|
786
786
|
//#region lib/components/ui/widgets/code-editor/code-editor-monaco.tsx
|
|
787
787
|
function Jt({ language: e, height: t, value: n, defaultValue: r, onChange: i, onBlur: a, disabled: o, required: s, wordWrap: c, labelText: l, overflowWidgetsDomNode: u, onInstance: d, path: f, panel: p, ...m }) {
|
|
788
|
-
let h =
|
|
788
|
+
let h = Mt(), g = N(a);
|
|
789
789
|
g.current = a;
|
|
790
|
-
let _ =
|
|
790
|
+
let _ = M(() => Ft({
|
|
791
791
|
disabled: o,
|
|
792
792
|
required: s,
|
|
793
793
|
wordWrap: c,
|
|
@@ -810,7 +810,7 @@ function Jt({ language: e, height: t, value: n, defaultValue: r, onChange: i, on
|
|
|
810
810
|
l,
|
|
811
811
|
u
|
|
812
812
|
]), [v, y] = P(), b = m.tabSize ?? 2;
|
|
813
|
-
return
|
|
813
|
+
return k(() => {
|
|
814
814
|
if (!v) return;
|
|
815
815
|
let e = () => v.getModel()?.updateOptions({
|
|
816
816
|
tabSize: b,
|
|
@@ -819,10 +819,10 @@ function Jt({ language: e, height: t, value: n, defaultValue: r, onChange: i, on
|
|
|
819
819
|
e();
|
|
820
820
|
let t = v.onDidChangeModel(e);
|
|
821
821
|
return () => t.dispose();
|
|
822
|
-
}, [v, b]), h ? /* @__PURE__ */ F(
|
|
822
|
+
}, [v, b]), h ? /* @__PURE__ */ F(jt, { height: t }) : /* @__PURE__ */ F(At, {
|
|
823
823
|
language: e,
|
|
824
824
|
height: t,
|
|
825
|
-
theme:
|
|
825
|
+
theme: Wt,
|
|
826
826
|
path: f,
|
|
827
827
|
value: n,
|
|
828
828
|
defaultValue: r,
|
|
@@ -878,16 +878,16 @@ function Yt({ props: e, code: t, view: n, language: r, wordWrap: i, readOnly: a,
|
|
|
878
878
|
//#region lib/components/ui/widgets/code-editor/code-editor-field.tsx
|
|
879
879
|
function Xt({ label: e, required: n, helperText: r, invalid: i, className: a, children: o }) {
|
|
880
880
|
return /* @__PURE__ */ I("div", {
|
|
881
|
-
ref:
|
|
881
|
+
ref: d(),
|
|
882
882
|
"data-slot": "code-editor",
|
|
883
883
|
className: t("grid w-full min-w-0 max-w-full gap-1.5", a),
|
|
884
884
|
children: [
|
|
885
|
-
/* @__PURE__ */ F(
|
|
885
|
+
/* @__PURE__ */ F(u, {
|
|
886
886
|
withAsterisk: n,
|
|
887
887
|
children: e
|
|
888
888
|
}),
|
|
889
889
|
o,
|
|
890
|
-
r && /* @__PURE__ */ F(
|
|
890
|
+
r && /* @__PURE__ */ F(l, {
|
|
891
891
|
error: i,
|
|
892
892
|
children: r
|
|
893
893
|
})
|
|
@@ -933,20 +933,20 @@ function rn(e, t) {
|
|
|
933
933
|
let r = n[0], i = n[n.length - 1], a = document.activeElement;
|
|
934
934
|
e.shiftKey && (a === r || a === t) ? (e.preventDefault(), i.focus()) : !e.shiftKey && a === i && (e.preventDefault(), r.focus());
|
|
935
935
|
}
|
|
936
|
-
function an(e, t,
|
|
937
|
-
let [i, a] =
|
|
938
|
-
prop:
|
|
936
|
+
function an(e, t, n) {
|
|
937
|
+
let [i, a] = r({
|
|
938
|
+
prop: n?.fullscreen,
|
|
939
939
|
defaultProp: !1,
|
|
940
|
-
onChange:
|
|
940
|
+
onChange: n?.onFullscreenChange
|
|
941
941
|
});
|
|
942
|
-
|
|
942
|
+
k(() => {
|
|
943
943
|
let n = e.current;
|
|
944
944
|
if (!i || !n) return;
|
|
945
945
|
let r = document.activeElement;
|
|
946
946
|
n.contains(r) || n.focus();
|
|
947
947
|
let a = t?.parentElement;
|
|
948
948
|
t && n.appendChild(t);
|
|
949
|
-
let o = tn(), s = n.parentElement?.querySelector(`:scope > [data-slot="${Zt}"]`), c =
|
|
949
|
+
let o = tn(), s = n.parentElement?.querySelector(`:scope > [data-slot="${Zt}"]`), c = fe(n, [s]);
|
|
950
950
|
return () => {
|
|
951
951
|
c(), t && a && n.isConnected && a.appendChild(t), o();
|
|
952
952
|
let e = document.activeElement;
|
|
@@ -987,7 +987,7 @@ function on({ language: e, position: t, markers: n, onReveal: r, readOnly: i })
|
|
|
987
987
|
children: [
|
|
988
988
|
i && /* @__PURE__ */ I("span", {
|
|
989
989
|
className: "nxgt-code-read-only",
|
|
990
|
-
children: [/* @__PURE__ */ F(
|
|
990
|
+
children: [/* @__PURE__ */ F(ae, { "aria-hidden": !0 }), a("material.code.read-only", "Read-only")]
|
|
991
991
|
}),
|
|
992
992
|
c && /* @__PURE__ */ I("button", {
|
|
993
993
|
type: "button",
|
|
@@ -996,7 +996,7 @@ function on({ language: e, position: t, markers: n, onReveal: r, readOnly: i })
|
|
|
996
996
|
title: c.message,
|
|
997
997
|
onClick: () => r(c),
|
|
998
998
|
children: [
|
|
999
|
-
F(o ?
|
|
999
|
+
F(o ? ne : le, { "aria-hidden": !0 }),
|
|
1000
1000
|
/* @__PURE__ */ F("span", { children: l }),
|
|
1001
1001
|
/* @__PURE__ */ I("span", {
|
|
1002
1002
|
className: "nxgt-code-problem-msg",
|
|
@@ -1054,7 +1054,7 @@ function un({ files: e, activePath: t, onActivePathChange: n, baseId: r }) {
|
|
|
1054
1054
|
children: [/* @__PURE__ */ F("span", {
|
|
1055
1055
|
className: "nxgt-code-tab-name",
|
|
1056
1056
|
children: e.label ?? e.path.split("/").pop()
|
|
1057
|
-
}), e.dirty && /* @__PURE__ */ I(
|
|
1057
|
+
}), e.dirty && /* @__PURE__ */ I(te, { children: [/* @__PURE__ */ F("i", {
|
|
1058
1058
|
className: "nxgt-code-dirty",
|
|
1059
1059
|
"aria-hidden": !0
|
|
1060
1060
|
}), /* @__PURE__ */ F("span", {
|
|
@@ -1071,15 +1071,15 @@ function dn(e, t, n) {
|
|
|
1071
1071
|
return new Set(n.map((n) => e.parse(t + n.path).toString()));
|
|
1072
1072
|
}
|
|
1073
1073
|
function fn(e, t) {
|
|
1074
|
-
let { files: n, onFileChange: r, onChange: i } = e, a =
|
|
1075
|
-
if (
|
|
1074
|
+
let { files: n, onFileChange: r, onChange: i } = e, a = A().replace(/[^a-zA-Z0-9]/g, "").toLowerCase(), o = `inmemory://nxgt-${a}/`, s = n?.length ? n.find((t) => t.path === e.activePath) ?? n[0] : void 0;
|
|
1075
|
+
if (k(() => {
|
|
1076
1076
|
if (!t) return;
|
|
1077
1077
|
let e = dn(t.Uri, o, n ?? []);
|
|
1078
1078
|
for (let n of t.editor.getModels()) {
|
|
1079
1079
|
let t = n.uri.toString();
|
|
1080
1080
|
t.startsWith(o) && !e.has(t) && !n.isAttachedToEditor() && n.dispose();
|
|
1081
1081
|
}
|
|
1082
|
-
}),
|
|
1082
|
+
}), k(() => {
|
|
1083
1083
|
if (t) return () => {
|
|
1084
1084
|
for (let e of t.editor.getModels()) e.uri.toString().startsWith(o) && !e.isAttachedToEditor() && e.dispose();
|
|
1085
1085
|
};
|
|
@@ -1179,7 +1179,7 @@ function bn(e, t) {
|
|
|
1179
1179
|
//#endregion
|
|
1180
1180
|
//#region lib/components/ui/widgets/code-editor/theme/check-contrast.ts
|
|
1181
1181
|
var xn = [
|
|
1182
|
-
...
|
|
1182
|
+
...It,
|
|
1183
1183
|
"fg",
|
|
1184
1184
|
"gutter",
|
|
1185
1185
|
"error"
|
|
@@ -1258,12 +1258,12 @@ function Tn(e, t) {
|
|
|
1258
1258
|
//#endregion
|
|
1259
1259
|
//#region lib/components/ui/widgets/code-editor/theme/define-code-theme.ts
|
|
1260
1260
|
function En(e) {
|
|
1261
|
-
let t = Tn(e.light, "light"),
|
|
1262
|
-
return
|
|
1261
|
+
let t = Tn(e.light, "light"), r = Tn(e.dark, "dark"), i = [...Sn(t, "light"), ...Sn(r, "dark")];
|
|
1262
|
+
return i.length > 0 && !n() && console.warn(`defineCodeTheme: ${i.length} colour(s) under 4.5:1 — ${i.map((e) => `${e.scheme} ${e.token} on ${e.on} ${e.ratio.toFixed(2)}:1`).join(", ")}`), {
|
|
1263
1263
|
kind: "code-theme",
|
|
1264
1264
|
light: t,
|
|
1265
|
-
dark:
|
|
1266
|
-
issues:
|
|
1265
|
+
dark: r,
|
|
1266
|
+
issues: i
|
|
1267
1267
|
};
|
|
1268
1268
|
}
|
|
1269
1269
|
function Dn(e) {
|
|
@@ -1309,7 +1309,7 @@ function Mn() {
|
|
|
1309
1309
|
return e.className = "monaco-editor nxgt-code-overflow", e.dataset.slot = "code-editor-overflow", e;
|
|
1310
1310
|
}
|
|
1311
1311
|
function Nn(e, t) {
|
|
1312
|
-
let n =
|
|
1312
|
+
let n = M(() => kn(e, t), [e, t]), r = N(null), [i] = P(() => typeof document > "u" ? void 0 : Mn()), a = N(void 0);
|
|
1313
1313
|
return S(() => {
|
|
1314
1314
|
let e = r.current;
|
|
1315
1315
|
e && An(e, n, a.current), i && jn(i, n, a.current), a.current = n;
|
|
@@ -1330,13 +1330,13 @@ function Nn(e, t) {
|
|
|
1330
1330
|
//#region lib/components/ui/widgets/code-editor/tabs/code-file-picker.tsx
|
|
1331
1331
|
var Pn = (e) => e.path.split("/").pop() ?? e.path, Fn = (e) => e.label ?? Pn(e);
|
|
1332
1332
|
function In({ files: e, activePath: t, onActivePathChange: n }) {
|
|
1333
|
-
let { t:
|
|
1334
|
-
return /* @__PURE__ */ I(
|
|
1333
|
+
let { t: r } = _(), l = Math.max(e.findIndex((e) => e.path === t), 0), u = e[l];
|
|
1334
|
+
return /* @__PURE__ */ I(c, { children: [/* @__PURE__ */ F(i, {
|
|
1335
1335
|
asChild: !0,
|
|
1336
1336
|
children: /* @__PURE__ */ I("button", {
|
|
1337
1337
|
type: "button",
|
|
1338
1338
|
className: "nxgt-code-picker",
|
|
1339
|
-
"aria-label":
|
|
1339
|
+
"aria-label": r("material.code.file-of", "File: {name}, {index} of {count}", {
|
|
1340
1340
|
name: E(u.label) || Pn(u),
|
|
1341
1341
|
index: l + 1,
|
|
1342
1342
|
count: e.length
|
|
@@ -1359,23 +1359,23 @@ function In({ files: e, activePath: t, onActivePathChange: n }) {
|
|
|
1359
1359
|
e.length
|
|
1360
1360
|
]
|
|
1361
1361
|
}),
|
|
1362
|
-
/* @__PURE__ */ F(
|
|
1362
|
+
/* @__PURE__ */ F(R, { "aria-hidden": !0 })
|
|
1363
1363
|
]
|
|
1364
1364
|
})
|
|
1365
|
-
}), /* @__PURE__ */ F(
|
|
1365
|
+
}), /* @__PURE__ */ F(s, {
|
|
1366
1366
|
align: "start",
|
|
1367
1367
|
className: "max-h-80",
|
|
1368
|
-
children: /* @__PURE__ */ F(
|
|
1368
|
+
children: /* @__PURE__ */ F(a, {
|
|
1369
1369
|
value: u.path,
|
|
1370
1370
|
onValueChange: n,
|
|
1371
|
-
children: e.map((e) => /* @__PURE__ */ I(
|
|
1371
|
+
children: e.map((e) => /* @__PURE__ */ I(o, {
|
|
1372
1372
|
value: e.path,
|
|
1373
1373
|
children: [/* @__PURE__ */ F("span", {
|
|
1374
1374
|
className: "truncate",
|
|
1375
1375
|
children: e.path
|
|
1376
1376
|
}), e.dirty && /* @__PURE__ */ F("span", {
|
|
1377
1377
|
className: "ms-auto text-xs opacity-80",
|
|
1378
|
-
children:
|
|
1378
|
+
children: r("material.code.unsaved", "unsaved changes")
|
|
1379
1379
|
})]
|
|
1380
1380
|
}, e.path))
|
|
1381
1381
|
})
|
|
@@ -1384,8 +1384,8 @@ function In({ files: e, activePath: t, onActivePathChange: n }) {
|
|
|
1384
1384
|
//#endregion
|
|
1385
1385
|
//#region lib/components/ui/widgets/code-editor/toolbar/code-copy-tool.tsx
|
|
1386
1386
|
function Ln({ reader: e, status: t, disabled: n, onCopy: r }) {
|
|
1387
|
-
let { t: i } = _(), a = i("material.code.copy", "Copy"), o = F(t === "copied" ?
|
|
1388
|
-
return e ? /* @__PURE__ */ F(
|
|
1387
|
+
let { t: i } = _(), a = i("material.code.copy", "Copy"), o = F(t === "copied" ? L : re, {});
|
|
1388
|
+
return e ? /* @__PURE__ */ F(f, {
|
|
1389
1389
|
label: a,
|
|
1390
1390
|
fit: !1,
|
|
1391
1391
|
priority: "pinned",
|
|
@@ -1396,7 +1396,7 @@ function Ln({ reader: e, status: t, disabled: n, onCopy: r }) {
|
|
|
1396
1396
|
onClick: r,
|
|
1397
1397
|
children: [o, /* @__PURE__ */ F("span", { children: t === "copied" ? i("material.code.copied", "Copied") : a })]
|
|
1398
1398
|
})
|
|
1399
|
-
}) : /* @__PURE__ */ F(
|
|
1399
|
+
}) : /* @__PURE__ */ F(h, {
|
|
1400
1400
|
icon: o,
|
|
1401
1401
|
label: a,
|
|
1402
1402
|
priority: 2,
|
|
@@ -1407,14 +1407,14 @@ function Ln({ reader: e, status: t, disabled: n, onCopy: r }) {
|
|
|
1407
1407
|
//#endregion
|
|
1408
1408
|
//#region lib/components/ui/widgets/code-editor/toolbar/code-language-menu.tsx
|
|
1409
1409
|
function Rn({ language: e, onLanguageChange: t, disabled: n }) {
|
|
1410
|
-
let { t:
|
|
1410
|
+
let { t: r } = _(), a = v(e), o = r("material.code.language-is", "Language: {name}", { name: a }), l = /* @__PURE__ */ F(x, {
|
|
1411
1411
|
language: e,
|
|
1412
1412
|
onChange: t
|
|
1413
1413
|
});
|
|
1414
|
-
return /* @__PURE__ */ I(
|
|
1414
|
+
return /* @__PURE__ */ I(c, { children: [/* @__PURE__ */ F(i, {
|
|
1415
1415
|
asChild: !0,
|
|
1416
|
-
children: /* @__PURE__ */ F(
|
|
1417
|
-
label:
|
|
1416
|
+
children: /* @__PURE__ */ F(f, {
|
|
1417
|
+
label: o,
|
|
1418
1418
|
fit: !1,
|
|
1419
1419
|
priority: 9,
|
|
1420
1420
|
more: {
|
|
@@ -1426,18 +1426,18 @@ function Rn({ language: e, onLanguageChange: t, disabled: n }) {
|
|
|
1426
1426
|
type: "button",
|
|
1427
1427
|
className: "nxgt-code-lang nxgt-touch-target",
|
|
1428
1428
|
disabled: n,
|
|
1429
|
-
"aria-label":
|
|
1429
|
+
"aria-label": o,
|
|
1430
1430
|
children: [
|
|
1431
|
-
/* @__PURE__ */ F(
|
|
1431
|
+
/* @__PURE__ */ F(ie, { "aria-hidden": !0 }),
|
|
1432
1432
|
/* @__PURE__ */ F("span", { children: a }),
|
|
1433
|
-
/* @__PURE__ */ F(
|
|
1433
|
+
/* @__PURE__ */ F(R, {
|
|
1434
1434
|
"aria-hidden": !0,
|
|
1435
1435
|
className: "nxgt-code-lang-chevron"
|
|
1436
1436
|
})
|
|
1437
1437
|
]
|
|
1438
1438
|
})
|
|
1439
1439
|
})
|
|
1440
|
-
}), /* @__PURE__ */ F(
|
|
1440
|
+
}), /* @__PURE__ */ F(s, {
|
|
1441
1441
|
align: "end",
|
|
1442
1442
|
className: "max-h-80",
|
|
1443
1443
|
children: l
|
|
@@ -1448,7 +1448,7 @@ function Rn({ language: e, onLanguageChange: t, disabled: n }) {
|
|
|
1448
1448
|
var zn = "editor.action.formatDocument";
|
|
1449
1449
|
function Bn(e) {
|
|
1450
1450
|
let [t, n] = P(!1);
|
|
1451
|
-
return
|
|
1451
|
+
return k(() => {
|
|
1452
1452
|
if (!e) return;
|
|
1453
1453
|
let t = () => n(!!e.getAction(zn)?.isSupported());
|
|
1454
1454
|
t();
|
|
@@ -1468,10 +1468,10 @@ function Bn(e) {
|
|
|
1468
1468
|
//#endregion
|
|
1469
1469
|
//#region lib/components/ui/widgets/code-editor/toolbar/code-editor-toolbar.tsx
|
|
1470
1470
|
function Vn({ editor: e, language: t, onLanguageChange: n, wordWrap: r, onWordWrapChange: i, fallbackCode: a = "", readOnly: o, disabled: s, fullscreen: c, onFullscreenChange: l }) {
|
|
1471
|
-
let { t: u } = _(), { status: d, copy:
|
|
1471
|
+
let { t: u } = _(), { status: d, copy: f } = b(), v = Bn(e), x = (t) => {
|
|
1472
1472
|
e?.focus(), e?.getAction(t)?.run();
|
|
1473
1473
|
};
|
|
1474
|
-
return /* @__PURE__ */ I(
|
|
1474
|
+
return /* @__PURE__ */ I(te, { children: [/* @__PURE__ */ I(p, {
|
|
1475
1475
|
label: u("material.code.tools", "Code tools"),
|
|
1476
1476
|
variant: "floating",
|
|
1477
1477
|
selectedLook: "morph",
|
|
@@ -1486,25 +1486,25 @@ function Vn({ editor: e, language: t, onLanguageChange: n, wordWrap: r, onWordWr
|
|
|
1486
1486
|
language: t,
|
|
1487
1487
|
onLanguageChange: n
|
|
1488
1488
|
}),
|
|
1489
|
-
/* @__PURE__ */ I(
|
|
1489
|
+
/* @__PURE__ */ I(g, {
|
|
1490
1490
|
label: u("material.code.view", "View"),
|
|
1491
1491
|
priority: 3,
|
|
1492
1492
|
children: [
|
|
1493
|
-
/* @__PURE__ */ F(
|
|
1494
|
-
icon: /* @__PURE__ */ F(
|
|
1493
|
+
/* @__PURE__ */ F(h, {
|
|
1494
|
+
icon: /* @__PURE__ */ F(ce, {}),
|
|
1495
1495
|
label: u("material.code.find", "Find"),
|
|
1496
1496
|
disabled: s,
|
|
1497
1497
|
onClick: () => x("actions.find")
|
|
1498
1498
|
}),
|
|
1499
|
-
/* @__PURE__ */ F(
|
|
1500
|
-
icon: /* @__PURE__ */ F(
|
|
1499
|
+
/* @__PURE__ */ F(m, {
|
|
1500
|
+
icon: /* @__PURE__ */ F(de, {}),
|
|
1501
1501
|
label: u("material.code.word-wrap", "Word wrap"),
|
|
1502
1502
|
pressed: r,
|
|
1503
1503
|
disabled: s,
|
|
1504
1504
|
onPressedChange: i
|
|
1505
1505
|
}),
|
|
1506
|
-
l && /* @__PURE__ */ F(
|
|
1507
|
-
icon: F(c ?
|
|
1506
|
+
l && /* @__PURE__ */ F(m, {
|
|
1507
|
+
icon: F(c ? se : oe, {}),
|
|
1508
1508
|
label: u("material.code.fullscreen", "Full screen"),
|
|
1509
1509
|
pressed: !!c,
|
|
1510
1510
|
disabled: s,
|
|
@@ -1512,8 +1512,8 @@ function Vn({ editor: e, language: t, onLanguageChange: n, wordWrap: r, onWordWr
|
|
|
1512
1512
|
})
|
|
1513
1513
|
]
|
|
1514
1514
|
}),
|
|
1515
|
-
v && !o && /* @__PURE__ */ F(
|
|
1516
|
-
icon: /* @__PURE__ */ F(
|
|
1515
|
+
v && !o && /* @__PURE__ */ F(h, {
|
|
1516
|
+
icon: /* @__PURE__ */ F(ue, {}),
|
|
1517
1517
|
label: u("material.code.format", "Format document"),
|
|
1518
1518
|
priority: 1,
|
|
1519
1519
|
disabled: s,
|
|
@@ -1523,7 +1523,7 @@ function Vn({ editor: e, language: t, onLanguageChange: n, wordWrap: r, onWordWr
|
|
|
1523
1523
|
reader: o,
|
|
1524
1524
|
status: d,
|
|
1525
1525
|
disabled: s,
|
|
1526
|
-
onCopy: () => void
|
|
1526
|
+
onCopy: () => void f(e?.getValue() ?? a)
|
|
1527
1527
|
})
|
|
1528
1528
|
]
|
|
1529
1529
|
}), /* @__PURE__ */ F(y, {
|
|
@@ -1534,7 +1534,7 @@ function Vn({ editor: e, language: t, onLanguageChange: n, wordWrap: r, onWordWr
|
|
|
1534
1534
|
function Hn({ filename: e, tabs: t, ...n }) {
|
|
1535
1535
|
return /* @__PURE__ */ I("div", {
|
|
1536
1536
|
className: "nxgt-code-head",
|
|
1537
|
-
children: [t ? /* @__PURE__ */ I(
|
|
1537
|
+
children: [t ? /* @__PURE__ */ I(te, { children: [/* @__PURE__ */ F(un, { ...t }), /* @__PURE__ */ F(In, { ...t })] }) : e && /* @__PURE__ */ F("span", {
|
|
1538
1538
|
className: "nxgt-code-filename",
|
|
1539
1539
|
children: e
|
|
1540
1540
|
}), /* @__PURE__ */ F(Vn, { ...n })]
|
|
@@ -1543,7 +1543,7 @@ function Hn({ filename: e, tabs: t, ...n }) {
|
|
|
1543
1543
|
//#endregion
|
|
1544
1544
|
//#region lib/components/ui/widgets/code-editor/use-code-editor-handle.ts
|
|
1545
1545
|
function Un(e, t) {
|
|
1546
|
-
|
|
1546
|
+
j(e, () => {
|
|
1547
1547
|
let e = t?.editor ?? null, n = (t, n) => {
|
|
1548
1548
|
!e || !t || (e.pushUndoStop(), e.executeEdits("nxgt", [{
|
|
1549
1549
|
range: t,
|
|
@@ -1621,7 +1621,7 @@ function Yn(e) {
|
|
|
1621
1621
|
//#region lib/components/ui/widgets/code-editor/status/use-code-markers.ts
|
|
1622
1622
|
function Xn(e) {
|
|
1623
1623
|
let [t, n] = P(null);
|
|
1624
|
-
return
|
|
1624
|
+
return k(() => {
|
|
1625
1625
|
if (!e) return;
|
|
1626
1626
|
n(e.editor.getModel());
|
|
1627
1627
|
let t = e.editor.onDidChangeModel(() => n(e.editor.getModel()));
|
|
@@ -1632,7 +1632,7 @@ function Zn(e, t, n) {
|
|
|
1632
1632
|
let [r, i] = P([]), a = N(n);
|
|
1633
1633
|
a.current = n;
|
|
1634
1634
|
let o = Xn(e), s = JSON.stringify(t ?? []);
|
|
1635
|
-
return
|
|
1635
|
+
return k(() => {
|
|
1636
1636
|
if (!e || !o) return;
|
|
1637
1637
|
let t = JSON.parse(s);
|
|
1638
1638
|
e.monaco.editor.setModelMarkers(o, Wn, t.map((e) => Kn(e, o)));
|
|
@@ -1640,9 +1640,9 @@ function Zn(e, t, n) {
|
|
|
1640
1640
|
e,
|
|
1641
1641
|
o,
|
|
1642
1642
|
s
|
|
1643
|
-
]),
|
|
1643
|
+
]), k(() => {
|
|
1644
1644
|
if (!(!e || !o)) return () => e.monaco.editor.setModelMarkers(o, Wn, []);
|
|
1645
|
-
}, [e, o]),
|
|
1645
|
+
}, [e, o]), k(() => {
|
|
1646
1646
|
if (!e || !o) return;
|
|
1647
1647
|
let { monaco: t } = e, n = "", r = () => {
|
|
1648
1648
|
let e = Yn(t.editor.getModelMarkers({ resource: o.uri }).map(qn).filter((e) => !!e)), r = JSON.stringify(e);
|
|
@@ -1670,7 +1670,7 @@ function $n(e) {
|
|
|
1670
1670
|
column: 1,
|
|
1671
1671
|
lines: 1
|
|
1672
1672
|
});
|
|
1673
|
-
return
|
|
1673
|
+
return k(() => {
|
|
1674
1674
|
if (!e) return;
|
|
1675
1675
|
let t = () => {
|
|
1676
1676
|
let t = e.getPosition(), r = e.getModel()?.getLineCount() ?? 1;
|
|
@@ -1698,7 +1698,7 @@ function $n(e) {
|
|
|
1698
1698
|
//#region lib/components/ui/widgets/code-editor/use-code-editor-instance.ts
|
|
1699
1699
|
function er({ error: e, markers: t, onMarkersChange: n }) {
|
|
1700
1700
|
let [r, i] = P(null), a = Zn(r, t, n), o = $n(r?.editor), s = !!e || a.some((e) => e.severity === "error");
|
|
1701
|
-
return
|
|
1701
|
+
return k(() => {
|
|
1702
1702
|
let e = r?.editor.getDomNode()?.querySelector("textarea, .native-edit-context");
|
|
1703
1703
|
s ? e?.setAttribute("aria-invalid", "true") : e?.removeAttribute("aria-invalid");
|
|
1704
1704
|
}, [r, s]), {
|
|
@@ -1712,11 +1712,11 @@ function er({ error: e, markers: t, onMarkersChange: n }) {
|
|
|
1712
1712
|
}
|
|
1713
1713
|
//#endregion
|
|
1714
1714
|
//#region lib/components/ui/widgets/code-editor/use-word-wrap.ts
|
|
1715
|
-
function tr(e, t = !1,
|
|
1716
|
-
return
|
|
1715
|
+
function tr(e, t = !1, n) {
|
|
1716
|
+
return r({
|
|
1717
1717
|
prop: e,
|
|
1718
1718
|
defaultProp: t,
|
|
1719
|
-
onChange:
|
|
1719
|
+
onChange: n
|
|
1720
1720
|
});
|
|
1721
1721
|
}
|
|
1722
1722
|
//#endregion
|
|
@@ -1779,4 +1779,4 @@ function rr(e) {
|
|
|
1779
1779
|
});
|
|
1780
1780
|
}
|
|
1781
1781
|
//#endregion
|
|
1782
|
-
export { On as a, qt as c,
|
|
1782
|
+
export { On as a, qt as c, Mt as d, jt as f, Nn as i, Kt as l, K as m, nr as n, En as o, Tt as p, Ln as r, Wt as s, rr as t, Nt as u };
|