@nice2dev/ui 1.1.6 → 1.1.7

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.
Files changed (162) hide show
  1. package/CHANGELOG.md +52 -0
  2. package/README.md +50 -29
  3. package/css/legacy-bg-text-aliases.css +65 -61
  4. package/dist/NiceCodeEditor-Bc81wiaN.js +1134 -0
  5. package/dist/NiceCodeEditor-D6f8KdHN.js +1134 -0
  6. package/dist/NiceCodeEditor-DE3saxyt.cjs +260 -0
  7. package/dist/NiceCodeEditor-DZM16My5.cjs +260 -0
  8. package/dist/NiceCodeEditor-HqmcJjmZ.js +1179 -0
  9. package/dist/NiceColorPicker-6EqXaDj0.cjs +1 -0
  10. package/dist/NiceColorPicker-BiEWqWnd.js +596 -0
  11. package/dist/NiceColorPicker-Cuc6YXqz.cjs +1 -0
  12. package/dist/NiceColorPicker-DMATcNWG.js +596 -0
  13. package/dist/NiceColorPicker-R3O1nemp.js +596 -0
  14. package/dist/NiceConfirmDialog-B0e10fRL.cjs +1 -0
  15. package/dist/NiceConfirmDialog-BBDgEMHv.js +81 -0
  16. package/dist/NiceConfirmDialog-C7kdr8jJ.js +81 -0
  17. package/dist/NiceConfirmDialog-DMHqPfFM.js +81 -0
  18. package/dist/NiceConfirmDialog-ZJpQLQQS.cjs +1 -0
  19. package/dist/NiceDataGrid-BzUw4dSu.cjs +10 -0
  20. package/dist/NiceDataGrid-CPKcVOVz.js +1743 -0
  21. package/dist/NiceDataGrid-DJr33WMy.cjs +10 -0
  22. package/dist/NiceDataGrid-D_4gZ1Hu.js +1736 -0
  23. package/dist/NiceDataGrid-DlUAaXhD.js +1736 -0
  24. package/dist/NiceDocumentViewer-8ghRVtfO.js +672 -0
  25. package/dist/NiceDocumentViewer-ChWtA_Ry.cjs +180 -0
  26. package/dist/NiceDocumentViewer-DwLUV7Tc.js +672 -0
  27. package/dist/NiceDocumentViewer-goMzF1w3.cjs +180 -0
  28. package/dist/NiceDocumentViewer-gt1mxzP8.js +672 -0
  29. package/dist/NiceForm-CHEAHxDw.js +4805 -0
  30. package/dist/NiceForm-CJUp1CL0.cjs +1 -0
  31. package/dist/NiceForm-Cp_RH3Yj.js +4805 -0
  32. package/dist/NiceForm-a6tGr6ss.js +4819 -0
  33. package/dist/NiceForm-jU89oe2S.cjs +1 -0
  34. package/dist/NiceGantt-BnQwyTfG.cjs +1 -0
  35. package/dist/NiceGantt-D8coFAvK.js +328 -0
  36. package/dist/NiceGantt-DOZfT6r5.js +328 -0
  37. package/dist/NiceGantt-DQzH1V-R.js +328 -0
  38. package/dist/NiceGantt-jQ8ZpXko.cjs +1 -0
  39. package/dist/NiceHtmlEditor-B1nlXJNW.cjs +10 -0
  40. package/dist/NiceHtmlEditor-Bv3VqJPG.js +862 -0
  41. package/dist/NiceHtmlEditor-CKsGj-Ei.cjs +10 -0
  42. package/dist/NiceHtmlEditor-CloMgyzg.js +841 -0
  43. package/dist/NiceHtmlEditor-DUAHmkWI.js +841 -0
  44. package/dist/NiceLoginForm-Ce_QLnLf.js +736 -0
  45. package/dist/NiceLoginForm-DLpNTQlR.cjs +1 -0
  46. package/dist/NiceLoginForm-Dg0286Cc.js +736 -0
  47. package/dist/NiceLoginForm-X05Vadeg.js +708 -0
  48. package/dist/NiceLoginForm-f_dBCnUi.cjs +1 -0
  49. package/dist/NiceMention-BByI4nFG.js +11120 -0
  50. package/dist/NiceMention-C2TPiMph.cjs +430 -0
  51. package/dist/NiceMention-C67vT6m0.js +11145 -0
  52. package/dist/NiceMention-D1cdy63w.cjs +430 -0
  53. package/dist/NiceMention-QIuggb9Y.js +11122 -0
  54. package/dist/NiceMention.css +1 -1
  55. package/dist/NiceModal-CHaan9al.js +95 -0
  56. package/dist/NiceModal-Czq6OEAT.js +95 -0
  57. package/dist/NiceModal-D-HFwawr.js +95 -0
  58. package/dist/NiceModal-DOy2XTzc.cjs +1 -0
  59. package/dist/NiceModal-DkawKzEE.cjs +1 -0
  60. package/dist/NiceModuleLifecyclePanel-1CsP8Zst.js +6997 -0
  61. package/dist/NiceModuleLifecyclePanel-Bkx4Yg-3.cjs +1 -0
  62. package/dist/NiceModuleLifecyclePanel-C5oYtczk.js +6999 -0
  63. package/dist/NiceModuleLifecyclePanel-DCcy2yYi.cjs +1 -0
  64. package/dist/NiceModuleLifecyclePanel-DqdgW-0s.js +7004 -0
  65. package/dist/NiceModuleLifecyclePanel.css +1 -1
  66. package/dist/NicePagination-7od5KUa3.cjs +1 -0
  67. package/dist/NicePagination-DMrkR8hH.cjs +1 -0
  68. package/dist/NicePagination-DQmZpsSQ.js +179 -0
  69. package/dist/NicePagination-DipQRjPq.js +172 -0
  70. package/dist/NicePagination-KhlVXYaT.js +172 -0
  71. package/dist/NicePivotGrid-B-KthuqL.cjs +152 -0
  72. package/dist/NicePivotGrid-CLCTHkKO.cjs +152 -0
  73. package/dist/NicePivotGrid-DV54FCsH.js +1174 -0
  74. package/dist/NicePivotGrid-DoWLUPUs.js +1167 -0
  75. package/dist/NicePivotGrid-etwpfccz.js +1167 -0
  76. package/dist/NiceSavedQueryPanel-BABkTNc5.js +5129 -0
  77. package/dist/NiceSavedQueryPanel-Cfeig83P.cjs +586 -0
  78. package/dist/NiceSavedQueryPanel-DTWRLseb.cjs +586 -0
  79. package/dist/NiceSavedQueryPanel-Dy154sxE.js +5129 -0
  80. package/dist/NiceSavedQueryPanel-v7AffOOe.js +5129 -0
  81. package/dist/NiceSavedQueryPanel.css +1 -1
  82. package/dist/NiceScheduler-BEgB7ZgF.cjs +5 -0
  83. package/dist/NiceScheduler-C9JprsEI.cjs +5 -0
  84. package/dist/NiceScheduler-DSP-PPh0.js +1645 -0
  85. package/dist/NiceScheduler-DuPnaA3t.js +1652 -0
  86. package/dist/NiceScheduler-Oa89YZx9.js +1645 -0
  87. package/dist/NiceSelect-A336yeLZ.js +433 -0
  88. package/dist/NiceSelect-B5hTbqi2.js +433 -0
  89. package/dist/NiceSelect-BYSgDYzq.cjs +1 -0
  90. package/dist/NiceSelect-Dudf2T5T.js +433 -0
  91. package/dist/NiceSelect-DwBAIrX7.cjs +1 -0
  92. package/dist/NiceWindow-B6zjBTl9.cjs +1 -0
  93. package/dist/NiceWindow-BKQEx7Vf.js +1623 -0
  94. package/dist/NiceWindow-BnTH7Gy0.js +1623 -0
  95. package/dist/NiceWindow-CZN9NVZw.cjs +1 -0
  96. package/dist/NiceWindow-lxtPR7yZ.js +1623 -0
  97. package/dist/NiceWindow.css +1 -1
  98. package/dist/charts-B8_V3_nq.cjs +882 -0
  99. package/dist/charts-BZgyyybE.js +31933 -0
  100. package/dist/charts-FuDk5-r6.js +31958 -0
  101. package/dist/charts-INj3yFo5.js +31946 -0
  102. package/dist/charts-NolNXKUL.cjs +882 -0
  103. package/dist/charts.cjs +1 -1
  104. package/dist/charts.css +1 -1
  105. package/dist/charts.mjs +1 -1
  106. package/dist/core-A_A6c7an.js +795 -0
  107. package/dist/core-B2iH2J_X.js +795 -0
  108. package/dist/core-BmspZEfD.js +795 -0
  109. package/dist/core-DAfLOet6.cjs +1 -0
  110. package/dist/core-ZG3bgnBR.cjs +1 -0
  111. package/dist/data-branching-B3TOqXAO.cjs +1 -0
  112. package/dist/data-branching-BUGiICDZ.js +6275 -0
  113. package/dist/data-branching-DMXmcocj.js +6275 -0
  114. package/dist/data-branching-YE8P9M5P.js +6275 -0
  115. package/dist/data-branching-t6uhAwIm.cjs +1 -0
  116. package/dist/data-branching.cjs +1 -1
  117. package/dist/data-branching.mjs +1 -1
  118. package/dist/data.cjs +1 -1
  119. package/dist/data.d.ts +7 -2
  120. package/dist/data.mjs +3 -3
  121. package/dist/devops-BhV3OmF7.js +8285 -0
  122. package/dist/devops-BqUxnbRi.cjs +17 -0
  123. package/dist/devops-Bx-Qwj9w.cjs +17 -0
  124. package/dist/devops-DYZatW45.js +8251 -0
  125. package/dist/devops-R98k2zpd.js +8251 -0
  126. package/dist/devops.cjs +1 -1
  127. package/dist/devops.d.ts +29 -16
  128. package/dist/devops.mjs +1 -1
  129. package/dist/editors.cjs +1 -1
  130. package/dist/editors.d.ts +35 -20
  131. package/dist/editors.mjs +7 -7
  132. package/dist/feedback.cjs +1 -1
  133. package/dist/feedback.mjs +3 -3
  134. package/dist/index.cjs +445 -445
  135. package/dist/index.css +1 -1
  136. package/dist/index.d.ts +190 -111
  137. package/dist/index.mjs +16635 -16351
  138. package/dist/lazy.cjs +1 -1
  139. package/dist/lazy.d.ts +31 -18
  140. package/dist/lazy.mjs +24 -24
  141. package/dist/navigation.cjs +1 -1
  142. package/dist/navigation.d.ts +17 -14
  143. package/dist/navigation.mjs +130 -130
  144. package/dist/no-code-BPaAS4wW.cjs +332 -0
  145. package/dist/no-code-CBwUVL1i.js +7447 -0
  146. package/dist/no-code-CjktkQ50.js +7447 -0
  147. package/dist/no-code-DW2NrRba.js +7447 -0
  148. package/dist/no-code-DmFxrZ5T.cjs +332 -0
  149. package/dist/no-code.cjs +1 -1
  150. package/dist/no-code.d.ts +2 -2
  151. package/dist/no-code.mjs +1 -1
  152. package/dist/overlays.cjs +1 -1
  153. package/dist/overlays.d.ts +4 -4
  154. package/dist/overlays.mjs +2 -2
  155. package/dist/pickerCommons-C4XWRUvH.cjs +1 -0
  156. package/dist/pickerCommons-C_BpYs_m.cjs +1 -0
  157. package/dist/pickerCommons-DAOXH_u5.js +1122 -0
  158. package/dist/pickerCommons-Dn4wnDco.js +1122 -0
  159. package/dist/pickerCommons-DskswPS5.js +1122 -0
  160. package/dist/pickerCommons.css +1 -1
  161. package/dist/style.css +7 -7
  162. package/package.json +3 -3
@@ -0,0 +1,1134 @@
1
+ import { jsxs as _, jsx as o } from "react/jsx-runtime";
2
+ import { Q as Ee, Y as Oe, o as N } from "./charts-BZgyyybE.js";
3
+ import { forwardRef as Te, useRef as L, useState as O, useMemo as ue, useEffect as y, useImperativeHandle as Pe, useCallback as me } from "react";
4
+ const Re = [
5
+ {
6
+ target: ".nice-code-editor-wrap",
7
+ titleKey: "tutorial.codeEditor.intro.title",
8
+ title: "Code editor",
9
+ contentKey: "tutorial.codeEditor.intro.content",
10
+ content: "Edit code with syntax highlighting, IntelliSense and the toolbar. Ctrl+S saves; the status bar shows the cursor position and any problems.",
11
+ placement: "auto"
12
+ }
13
+ ];
14
+ let V = null, H = null;
15
+ const Ie = "0.45.0", Z = `https://cdn.jsdelivr.net/npm/monaco-editor@${Ie}/min/vs`, pe = 15e3;
16
+ function ge() {
17
+ const u = window;
18
+ if (u.MonacoEnvironment?.getWorkerUrl)
19
+ return;
20
+ const a = `self.MonacoEnvironment={baseUrl:'${Z}/'};importScripts('${Z}/base/worker/workerMain.js');`, m = URL.createObjectURL(new Blob([a], { type: "text/javascript" }));
21
+ u.MonacoEnvironment = {
22
+ getWorkerUrl: () => m
23
+ };
24
+ }
25
+ function $(u) {
26
+ if (u !== "auto")
27
+ return u;
28
+ if (typeof document > "u")
29
+ return "vs";
30
+ const a = document.documentElement.dataset.theme;
31
+ return a === "dark" ? "vs-dark" : a === "light" ? "vs" : window.matchMedia?.("(prefers-color-scheme: dark)").matches ? "vs-dark" : "vs";
32
+ }
33
+ function be() {
34
+ return H ? Promise.resolve(H) : V || (V = new Promise((u, a) => {
35
+ if (window.monaco) {
36
+ ge(), H = window.monaco, u(H);
37
+ return;
38
+ }
39
+ let m = !1;
40
+ const d = window.setTimeout(() => {
41
+ m || (m = !0, V = null, a(new Error(`Monaco editor failed to load within ${pe}ms`)));
42
+ }, pe), b = document.createElement("script");
43
+ b.src = `${Z}/loader.min.js`, b.async = !0, b.onload = () => {
44
+ const h = window.require;
45
+ h.config({ paths: { vs: Z } }), ge(), h(["vs/editor/editor.main"], (x) => {
46
+ m || (m = !0, window.clearTimeout(d), H = x, u(x));
47
+ });
48
+ }, b.onerror = () => {
49
+ m || (m = !0, window.clearTimeout(d), V = null, a(new Error("Failed to load Monaco Editor loader script")));
50
+ }, document.head.appendChild(b);
51
+ }), V);
52
+ }
53
+ const We = Te(
54
+ function(a, m) {
55
+ const {
56
+ value: d,
57
+ onChange: b,
58
+ language: h = "plaintext",
59
+ theme: x = "auto",
60
+ options: n = {},
61
+ height: U = 400,
62
+ width: j = "100%",
63
+ markers: C = [],
64
+ decorations: z = [],
65
+ completionProvider: A,
66
+ onMount: T,
67
+ onCursorPositionChange: E,
68
+ onSelectionChange: D,
69
+ onSave: S,
70
+ loading: P,
71
+ disabled: M = !1,
72
+ showToolbar: F = !1,
73
+ showStatusBar: W = !1,
74
+ editorSize: B = "standard",
75
+ className: q,
76
+ "data-testid": k,
77
+ lsp: c,
78
+ extraLibs: l,
79
+ tutorial: p
80
+ } = a, v = L(null), i = L(null), w = L(null), X = L([]), R = L(null), [K, Q] = O(!0), [ee, ke] = O(null), [ae, ve] = O({
81
+ lineNumber: 1,
82
+ column: 1
83
+ }), [ce, ye] = O(""), [te, we] = O(n.wordWrap === "on"), ne = ue(() => ({
84
+ automaticLayout: !0,
85
+ readOnly: M || n.readOnly,
86
+ minimap: { enabled: n.minimap ?? !0 },
87
+ lineNumbers: n.lineNumbers ?? "on",
88
+ wordWrap: n.wordWrap ?? "off",
89
+ tabSize: n.tabSize ?? 2,
90
+ insertSpaces: n.insertSpaces ?? !0,
91
+ fontSize: n.fontSize ?? 14,
92
+ fontFamily: n.fontFamily ?? "'Fira Code', 'Consolas', 'Monaco', monospace",
93
+ fontLigatures: n.fontLigatures ?? !0,
94
+ cursorStyle: n.cursorStyle ?? "line",
95
+ cursorBlinking: n.cursorBlinking ?? "blink",
96
+ autoClosingBrackets: n.autoClosingBrackets ?? "languageDefined",
97
+ autoClosingQuotes: n.autoClosingQuotes ?? "languageDefined",
98
+ formatOnPaste: n.formatOnPaste ?? !1,
99
+ formatOnType: n.formatOnType ?? !1,
100
+ renderWhitespace: n.renderWhitespace ?? "selection",
101
+ renderControlCharacters: n.renderControlCharacters ?? !1,
102
+ scrollBeyondLastLine: n.scrollBeyondLastLine ?? !0,
103
+ smoothScrolling: n.smoothScrolling ?? !0,
104
+ folding: n.folding ?? !0,
105
+ showFoldingControls: n.showFoldingControls ?? "mouseover",
106
+ "bracketPairColorization.enabled": n.bracketPairColorization ?? !0,
107
+ guides: n.guides ?? {
108
+ bracketPairs: !0,
109
+ indentation: !0,
110
+ highlightActiveIndentation: !0
111
+ },
112
+ stickyScroll: { enabled: n.stickyScroll ?? !1 },
113
+ quickSuggestions: n.quickSuggestions ?? !0,
114
+ suggestOnTriggerCharacters: n.suggestOnTriggerCharacters ?? !0,
115
+ acceptSuggestionOnEnter: n.acceptSuggestionOnEnter ?? "on",
116
+ inlayHints: { enabled: n.inlayHints ? "on" : "off" }
117
+ }), [n, M]);
118
+ y(() => {
119
+ if (!v.current)
120
+ return;
121
+ let e = !0;
122
+ return be().then(async (r) => {
123
+ if (!e || !v.current)
124
+ return;
125
+ w.current = r;
126
+ const t = r.editor.create(v.current, {
127
+ value: d,
128
+ language: h,
129
+ theme: $(x),
130
+ ...ne
131
+ });
132
+ if (i.current = t, Q(!1), t.onDidChangeModelContent(() => {
133
+ const s = t.getValue();
134
+ b?.(s);
135
+ }), t.onDidChangeCursorPosition(
136
+ (s) => {
137
+ ve({ lineNumber: s.position.lineNumber, column: s.position.column }), E?.({
138
+ lineNumber: s.position.lineNumber,
139
+ column: s.position.column
140
+ });
141
+ }
142
+ ), t.onDidChangeCursorSelection(
143
+ (s) => {
144
+ const f = s.selection, g = t.getModel()?.getValueInRange(f) ?? "";
145
+ ye(g), D?.({
146
+ startLineNumber: f.startLineNumber,
147
+ startColumn: f.startColumn,
148
+ endLineNumber: f.endLineNumber,
149
+ endColumn: f.endColumn
150
+ });
151
+ }
152
+ ), t.addCommand(r.KeyMod.CtrlCmd | r.KeyCode.KeyS, () => {
153
+ S?.(t.getValue());
154
+ }), c && typeof window < "u")
155
+ try {
156
+ await J(
157
+ "https://cdn.jsdelivr.net/npm/vscode-ws-jsonrpc@1.0.2/lib/browser/index.min.js"
158
+ ), await J(
159
+ "https://cdn.jsdelivr.net/npm/monaco-languageclient@0.15.0/lib/monaco-languageclient.min.js"
160
+ );
161
+ const s = window, f = s.ReconnectingWebSocket, { MonacoLanguageClient: g, CloseAction: Y, ErrorAction: G, createConnection: se } = s.monacoLanguageClient || {};
162
+ if (g && se) {
163
+ const Ce = c.url, Ne = c.language, de = new f(Ce), Se = new s.VSCodeWebSocketMessageReader(de), Me = new s.VSCodeWebSocketMessageWriter(de), Le = se(Se, Me), le = new g({
164
+ name: "LSP Client",
165
+ clientOptions: {
166
+ documentSelector: [Ne],
167
+ initializationOptions: c.initOptions,
168
+ errorHandler: {
169
+ error: () => G.Continue,
170
+ closed: () => Y.Restart
171
+ }
172
+ },
173
+ connectionProvider: {
174
+ get: () => Promise.resolve(Le)
175
+ }
176
+ });
177
+ le.start(), i.current.__lspClient = le;
178
+ }
179
+ } catch (s) {
180
+ console.warn("LSP bridge failed to load:", s);
181
+ }
182
+ T?.(t, r);
183
+ }).catch((r) => {
184
+ e && (ke(r.message ?? "Failed to load editor"), Q(!1));
185
+ }), () => {
186
+ if (e = !1, i.current?.dispose(), R.current?.dispose(), i.current && i.current.__lspClient)
187
+ try {
188
+ i.current.__lspClient.stop();
189
+ } catch {
190
+ }
191
+ };
192
+ }, [c]), y(() => {
193
+ const e = i.current;
194
+ if (e && d !== e.getValue()) {
195
+ const r = e.getPosition();
196
+ e.setValue(d), r && e.setPosition(r);
197
+ }
198
+ }, [d]), y(() => {
199
+ const e = i.current, r = w.current;
200
+ if (e && r) {
201
+ const t = e.getModel();
202
+ t && r.editor.setModelLanguage(t, h);
203
+ }
204
+ }, [h]), y(() => {
205
+ const e = w.current;
206
+ if (!e || K || !l || l.length === 0 || h !== "javascript" && h !== "typescript")
207
+ return;
208
+ const r = e.languages?.typescript;
209
+ if (!r)
210
+ return;
211
+ const t = [];
212
+ try {
213
+ l.forEach((s, f) => {
214
+ const g = s.filePath ?? `inmemory://model/nice-extralib-${f}.d.ts`, Y = r.typescriptDefaults?.addExtraLib(s.content, g);
215
+ Y && t.push(Y);
216
+ const G = r.javascriptDefaults?.addExtraLib(s.content, g);
217
+ G && t.push(G);
218
+ });
219
+ } catch (s) {
220
+ console.warn("Failed to register extraLibs:", s);
221
+ }
222
+ return () => {
223
+ t.forEach((s) => {
224
+ try {
225
+ s.dispose();
226
+ } catch {
227
+ }
228
+ });
229
+ };
230
+ }, [l, h, K]), y(() => {
231
+ const e = w.current;
232
+ if (!e || (e.editor.setTheme($(x)), x !== "auto" || typeof document > "u"))
233
+ return;
234
+ const r = () => {
235
+ w.current?.editor.setTheme($("auto"));
236
+ }, t = new MutationObserver(r);
237
+ t.observe(document.documentElement, {
238
+ attributes: !0,
239
+ attributeFilter: ["data-theme", "class"]
240
+ });
241
+ const s = window.matchMedia?.("(prefers-color-scheme: dark)");
242
+ return s?.addEventListener?.("change", r), () => {
243
+ t.disconnect(), s?.removeEventListener?.("change", r);
244
+ };
245
+ }, [x]), y(() => {
246
+ const e = i.current;
247
+ e && e.updateOptions(ne);
248
+ }, [ne]), y(() => {
249
+ const e = i.current, r = w.current;
250
+ if (e && r) {
251
+ const t = e.getModel();
252
+ if (t) {
253
+ const s = C.map((f) => ({
254
+ startLineNumber: f.startLineNumber,
255
+ startColumn: f.startColumn,
256
+ endLineNumber: f.endLineNumber,
257
+ endColumn: f.endColumn,
258
+ message: f.message,
259
+ severity: f.severity
260
+ }));
261
+ r.editor.setModelMarkers(t, "owner", s);
262
+ }
263
+ }
264
+ }, [C]), y(() => {
265
+ const e = i.current;
266
+ if (e && z.length > 0) {
267
+ const r = z.map((t) => ({
268
+ range: {
269
+ startLineNumber: t.range.startLineNumber,
270
+ startColumn: t.range.startColumn,
271
+ endLineNumber: t.range.endLineNumber,
272
+ endColumn: t.range.endColumn
273
+ },
274
+ options: {
275
+ className: t.className,
276
+ glyphMarginClassName: t.glyphMarginClassName,
277
+ hoverMessage: t.hoverMessage ? { value: t.hoverMessage } : void 0,
278
+ isWholeLine: t.isWholeLine
279
+ }
280
+ }));
281
+ X.current = e.deltaDecorations(
282
+ X.current,
283
+ r
284
+ );
285
+ }
286
+ }, [z]), y(() => {
287
+ const e = w.current;
288
+ if (!e || !A)
289
+ return;
290
+ R.current?.dispose();
291
+ const r = {
292
+ text: 0,
293
+ method: 1,
294
+ function: 2,
295
+ constructor: 3,
296
+ field: 4,
297
+ variable: 5,
298
+ class: 6,
299
+ interface: 7,
300
+ module: 8,
301
+ property: 9,
302
+ keyword: 13,
303
+ snippet: 14,
304
+ color: 15,
305
+ file: 16,
306
+ reference: 17,
307
+ folder: 18
308
+ };
309
+ return R.current = e.languages.registerCompletionItemProvider(h, {
310
+ provideCompletionItems: async (t, s) => ({
311
+ suggestions: (await A(t, s)).map((g) => ({
312
+ label: g.label,
313
+ kind: r[g.kind] ?? 0,
314
+ insertText: g.insertText,
315
+ insertTextRules: g.insertTextRules === "insertAsSnippet" ? 4 : void 0,
316
+ documentation: g.documentation,
317
+ detail: g.detail,
318
+ range: {
319
+ startLineNumber: s.lineNumber,
320
+ startColumn: s.column,
321
+ endLineNumber: s.lineNumber,
322
+ endColumn: s.column
323
+ }
324
+ }))
325
+ })
326
+ }), () => {
327
+ R.current?.dispose();
328
+ };
329
+ }, [h, A]), Pe(
330
+ m,
331
+ () => ({
332
+ getEditor: () => i.current,
333
+ getMonaco: () => w.current,
334
+ focus: () => i.current?.focus(),
335
+ getValue: () => i.current?.getValue() ?? "",
336
+ setValue: (e) => i.current?.setValue(e),
337
+ getSelection: () => {
338
+ const e = i.current;
339
+ if (!e)
340
+ return "";
341
+ const r = e.getSelection();
342
+ return r ? e.getModel()?.getValueInRange(r) ?? "" : "";
343
+ },
344
+ insertText: (e) => {
345
+ const r = i.current;
346
+ if (!r)
347
+ return;
348
+ const t = r.getSelection();
349
+ t && r.executeEdits("", [{ range: t, text: e }]);
350
+ },
351
+ formatDocument: () => {
352
+ i.current?.getAction("editor.action.formatDocument")?.run();
353
+ },
354
+ goToLine: (e, r = 1) => {
355
+ const t = i.current;
356
+ t && (t.setPosition({ lineNumber: e, column: r }), t.revealLineInCenter(e), t.focus());
357
+ },
358
+ findReplace: () => {
359
+ i.current?.getAction("editor.action.startFindReplaceAction")?.run();
360
+ },
361
+ undo: () => {
362
+ i.current?.trigger("keyboard", "undo", null);
363
+ },
364
+ redo: () => {
365
+ i.current?.trigger("keyboard", "redo", null);
366
+ },
367
+ getCursorPosition: () => {
368
+ const e = i.current?.getPosition();
369
+ return { lineNumber: e?.lineNumber ?? 1, column: e?.column ?? 1 };
370
+ },
371
+ setMarkers: (e) => {
372
+ const r = i.current, t = w.current;
373
+ if (r && t) {
374
+ const s = r.getModel();
375
+ if (s) {
376
+ const f = e.map((g) => ({
377
+ startLineNumber: g.startLineNumber,
378
+ startColumn: g.startColumn,
379
+ endLineNumber: g.endLineNumber,
380
+ endColumn: g.endColumn,
381
+ message: g.message,
382
+ severity: g.severity
383
+ }));
384
+ t.editor.setModelMarkers(s, "owner", f);
385
+ }
386
+ }
387
+ }
388
+ }),
389
+ []
390
+ );
391
+ const I = ue(
392
+ () => ({
393
+ format: () => i.current?.getAction("editor.action.formatDocument")?.run(),
394
+ undo: () => i.current?.trigger("keyboard", "undo", null),
395
+ redo: () => i.current?.trigger("keyboard", "redo", null),
396
+ find: () => i.current?.getAction("editor.action.startFindReplaceAction")?.run(),
397
+ toggleWordWrap: () => {
398
+ const e = !te;
399
+ we(e), i.current?.updateOptions({ wordWrap: e ? "on" : "off" });
400
+ },
401
+ toggleMinimap: () => {
402
+ const e = i.current?.getOption?.(
403
+ w.current?.editor?.EditorOption?.minimap
404
+ );
405
+ i.current?.updateOptions({ minimap: { enabled: !e?.enabled } });
406
+ },
407
+ foldAll: () => i.current?.getAction("editor.foldAll")?.run(),
408
+ unfoldAll: () => i.current?.getAction("editor.unfoldAll")?.run()
409
+ }),
410
+ [te]
411
+ ), _e = d.split(`
412
+ `).length, xe = d.length;
413
+ return /* @__PURE__ */ _(
414
+ "div",
415
+ {
416
+ className: `nice-code-editor-wrap nice-editor--${B} ${q ?? ""}`,
417
+ style: { height: U, width: j, display: "flex", flexDirection: "column", position: "relative" },
418
+ "data-testid": k,
419
+ children: [
420
+ /* @__PURE__ */ o("span", { style: { position: "absolute", top: 6, right: 6, zIndex: 20 }, children: /* @__PURE__ */ o(Ee, { steps: Oe(p, Re) }) }),
421
+ ee && /* @__PURE__ */ _(
422
+ "div",
423
+ {
424
+ className: "nice-code-editor__error",
425
+ style: {
426
+ position: "absolute",
427
+ inset: 0,
428
+ zIndex: 2,
429
+ background: "var(--nice-bg-primary, #fff)"
430
+ },
431
+ children: [
432
+ /* @__PURE__ */ _("span", { children: [
433
+ /* @__PURE__ */ o(N, { name: "warning", size: 16 }),
434
+ " ",
435
+ ee
436
+ ] }),
437
+ /* @__PURE__ */ o(
438
+ "textarea",
439
+ {
440
+ value: d,
441
+ onChange: (e) => b?.(e.target.value),
442
+ readOnly: M || n.readOnly,
443
+ style: { width: "100%", height: "100%", fontFamily: "monospace" }
444
+ }
445
+ )
446
+ ]
447
+ }
448
+ ),
449
+ K && !ee && /* @__PURE__ */ o(
450
+ "div",
451
+ {
452
+ className: "nice-code-editor__loader-overlay",
453
+ style: {
454
+ position: "absolute",
455
+ inset: 0,
456
+ zIndex: 2,
457
+ display: "flex",
458
+ alignItems: "center",
459
+ justifyContent: "center",
460
+ background: "var(--nice-bg-primary, #fff)"
461
+ },
462
+ children: P ?? /* @__PURE__ */ o("div", { className: "nice-code-editor__loader", children: "Loading editor..." })
463
+ }
464
+ ),
465
+ F && /* @__PURE__ */ _("div", { className: "nice-code-editor__toolbar", children: [
466
+ /* @__PURE__ */ o(
467
+ "button",
468
+ {
469
+ className: "nice-code-editor__toolbar-btn",
470
+ onClick: I.undo,
471
+ title: "Undo (Ctrl+Z)",
472
+ "aria-label": "Undo",
473
+ children: /* @__PURE__ */ o(N, { name: "reply", size: 16 })
474
+ }
475
+ ),
476
+ /* @__PURE__ */ o(
477
+ "button",
478
+ {
479
+ className: "nice-code-editor__toolbar-btn",
480
+ onClick: I.redo,
481
+ title: "Redo (Ctrl+Y)",
482
+ "aria-label": "Redo",
483
+ children: /* @__PURE__ */ o(N, { name: "forward", size: 16 })
484
+ }
485
+ ),
486
+ /* @__PURE__ */ o("span", { className: "nice-code-editor__toolbar-sep" }),
487
+ /* @__PURE__ */ o(
488
+ "button",
489
+ {
490
+ className: "nice-code-editor__toolbar-btn",
491
+ onClick: I.format,
492
+ title: "Format (Shift+Alt+F)",
493
+ "aria-label": "Format",
494
+ children: /* @__PURE__ */ o(N, { name: "type", size: 16 })
495
+ }
496
+ ),
497
+ /* @__PURE__ */ o(
498
+ "button",
499
+ {
500
+ className: "nice-code-editor__toolbar-btn",
501
+ onClick: I.find,
502
+ title: "Find & Replace (Ctrl+H)",
503
+ "aria-label": "Find & Replace",
504
+ children: /* @__PURE__ */ o(N, { name: "search", size: 16 })
505
+ }
506
+ ),
507
+ /* @__PURE__ */ o("span", { className: "nice-code-editor__toolbar-sep" }),
508
+ /* @__PURE__ */ o(
509
+ "button",
510
+ {
511
+ className: `nice-code-editor__toolbar-btn${te ? " nice-code-editor__toolbar-btn--active" : ""}`,
512
+ onClick: I.toggleWordWrap,
513
+ title: "Toggle Word Wrap",
514
+ "aria-label": "Toggle Word Wrap",
515
+ children: /* @__PURE__ */ o(N, { name: "align-left", size: 16 })
516
+ }
517
+ ),
518
+ /* @__PURE__ */ o(
519
+ "button",
520
+ {
521
+ className: "nice-code-editor__toolbar-btn",
522
+ onClick: I.toggleMinimap,
523
+ title: "Toggle Minimap",
524
+ "aria-label": "Toggle Minimap",
525
+ children: /* @__PURE__ */ o(N, { name: "columns", size: 16 })
526
+ }
527
+ ),
528
+ /* @__PURE__ */ o("span", { className: "nice-code-editor__toolbar-sep" }),
529
+ /* @__PURE__ */ o(
530
+ "button",
531
+ {
532
+ className: "nice-code-editor__toolbar-btn",
533
+ onClick: I.foldAll,
534
+ title: "Fold All",
535
+ "aria-label": "Fold All",
536
+ children: /* @__PURE__ */ o(N, { name: "collapse", size: 16 })
537
+ }
538
+ ),
539
+ /* @__PURE__ */ o(
540
+ "button",
541
+ {
542
+ className: "nice-code-editor__toolbar-btn",
543
+ onClick: I.unfoldAll,
544
+ title: "Unfold All",
545
+ "aria-label": "Unfold All",
546
+ children: /* @__PURE__ */ o(N, { name: "expand", size: 16 })
547
+ }
548
+ )
549
+ ] }),
550
+ /* @__PURE__ */ o("div", { ref: v, className: "nice-code-editor", style: { flex: 1, minHeight: 0 } }),
551
+ W && /* @__PURE__ */ _("div", { className: "nice-code-editor__statusbar", children: [
552
+ /* @__PURE__ */ _("span", { children: [
553
+ "Ln ",
554
+ ae.lineNumber,
555
+ ", Col ",
556
+ ae.column
557
+ ] }),
558
+ ce.length > 0 && /* @__PURE__ */ _("span", { children: [
559
+ "(",
560
+ ce.length,
561
+ " selected)"
562
+ ] }),
563
+ /* @__PURE__ */ o("span", { className: "nice-code-editor__statusbar-spacer" }),
564
+ /* @__PURE__ */ _("span", { children: [
565
+ _e,
566
+ " lines · ",
567
+ xe,
568
+ " chars"
569
+ ] }),
570
+ /* @__PURE__ */ o("span", { className: "nice-code-editor__statusbar-lang", children: h }),
571
+ C.length > 0 && /* @__PURE__ */ _("span", { className: "nice-code-editor__statusbar-markers", children: [
572
+ /* @__PURE__ */ o(N, { name: "warning", size: 14 }),
573
+ " ",
574
+ C.length
575
+ ] })
576
+ ] })
577
+ ]
578
+ }
579
+ );
580
+ }
581
+ );
582
+ function Ve(u) {
583
+ const {
584
+ original: a,
585
+ modified: m,
586
+ language: d = "plaintext",
587
+ theme: b = "auto",
588
+ height: h = 400,
589
+ width: x = "100%",
590
+ inline: n = !1,
591
+ renderSideBySide: U = !0,
592
+ originalEditable: j = !1,
593
+ modifiedEditable: C = !1,
594
+ onOriginalChange: z,
595
+ onModifiedChange: A,
596
+ loading: T,
597
+ className: E,
598
+ "data-testid": D
599
+ } = u, S = L(null), P = L(null), M = L(null), [F, W] = O(!0), [B, q] = O(null);
600
+ return y(() => {
601
+ if (!S.current)
602
+ return;
603
+ let k = !0;
604
+ return be().then((c) => {
605
+ if (!k || !S.current)
606
+ return;
607
+ M.current = c;
608
+ const l = c.editor.createModel(a, d), p = c.editor.createModel(m, d), v = c.editor.createDiffEditor(S.current, {
609
+ automaticLayout: !0,
610
+ theme: $(b),
611
+ renderSideBySide: !n && U,
612
+ originalEditable: j,
613
+ readOnly: !C
614
+ });
615
+ v.setModel({
616
+ original: l,
617
+ modified: p
618
+ }), P.current = v, W(!1), j && l.onDidChangeContent(() => {
619
+ z?.(l.getValue());
620
+ }), C && p.onDidChangeContent(() => {
621
+ A?.(p.getValue());
622
+ });
623
+ }).catch((c) => {
624
+ k && (q(c.message ?? "Failed to load diff editor"), W(!1));
625
+ }), () => {
626
+ k = !1, P.current?.dispose();
627
+ };
628
+ }, []), y(() => {
629
+ const k = P.current;
630
+ if (!k)
631
+ return;
632
+ const c = k.getModel();
633
+ c && (c.original.getValue() !== a && c.original.setValue(a), c.modified.getValue() !== m && c.modified.setValue(m));
634
+ }, [a, m]), y(() => {
635
+ const k = M.current;
636
+ if (!k || (k.editor.setTheme($(b)), b !== "auto" || typeof document > "u"))
637
+ return;
638
+ const c = () => {
639
+ M.current?.editor.setTheme($("auto"));
640
+ }, l = new MutationObserver(c);
641
+ l.observe(document.documentElement, {
642
+ attributes: !0,
643
+ attributeFilter: ["data-theme", "class"]
644
+ });
645
+ const p = window.matchMedia?.("(prefers-color-scheme: dark)");
646
+ return p?.addEventListener?.("change", c), () => {
647
+ l.disconnect(), p?.removeEventListener?.("change", c);
648
+ };
649
+ }, [b, F]), B ? /* @__PURE__ */ o(
650
+ "div",
651
+ {
652
+ className: `nice-code-diff-editor nice-code-diff-editor--error ${E ?? ""}`,
653
+ style: { height: h, width: x },
654
+ "data-testid": D,
655
+ children: /* @__PURE__ */ o("div", { className: "nice-code-editor__error", children: /* @__PURE__ */ _("span", { children: [
656
+ /* @__PURE__ */ o(N, { name: "warning", size: 16 }),
657
+ " ",
658
+ B
659
+ ] }) })
660
+ }
661
+ ) : /* @__PURE__ */ _(
662
+ "div",
663
+ {
664
+ className: `nice-code-diff-editor ${E ?? ""}`,
665
+ style: { height: h, width: x, position: "relative" },
666
+ "data-testid": D,
667
+ children: [
668
+ /* @__PURE__ */ o("div", { ref: S, style: { position: "absolute", inset: 0 } }),
669
+ F && /* @__PURE__ */ o(
670
+ "div",
671
+ {
672
+ style: {
673
+ position: "absolute",
674
+ inset: 0,
675
+ display: "flex",
676
+ alignItems: "center",
677
+ justifyContent: "center",
678
+ background: "var(--nice-bg-primary, #fff)",
679
+ zIndex: 2
680
+ },
681
+ children: T ?? /* @__PURE__ */ o("div", { className: "nice-code-editor__loader", children: "Loading diff editor..." })
682
+ }
683
+ )
684
+ ]
685
+ }
686
+ );
687
+ }
688
+ const ze = "1.29.0", fe = `https://cdn.jsdelivr.net/npm/prismjs@${ze}`;
689
+ let re = null;
690
+ const ie = {
691
+ javascript: "javascript",
692
+ typescript: "typescript",
693
+ json: "json",
694
+ html: "markup",
695
+ css: "css",
696
+ scss: "scss",
697
+ less: "less",
698
+ markdown: "markdown",
699
+ xml: "markup",
700
+ yaml: "yaml",
701
+ sql: "sql",
702
+ python: "python",
703
+ csharp: "csharp",
704
+ java: "java",
705
+ cpp: "cpp",
706
+ c: "c",
707
+ go: "go",
708
+ rust: "rust",
709
+ php: "php",
710
+ ruby: "ruby",
711
+ shell: "bash",
712
+ powershell: "powershell",
713
+ plaintext: "plain"
714
+ };
715
+ function J(u) {
716
+ return new Promise((a, m) => {
717
+ if (document.querySelector(`script[data-prism-src="${u}"]`)) {
718
+ a();
719
+ return;
720
+ }
721
+ const d = document.createElement("script");
722
+ d.src = u, d.async = !0, d.dataset.prismSrc = u, d.onload = () => a(), d.onerror = () => m(new Error(`Failed to load ${u}`)), document.head.appendChild(d);
723
+ });
724
+ }
725
+ function Ae(u) {
726
+ if (typeof window > "u")
727
+ return Promise.resolve(null);
728
+ const a = window, m = ie[u] ?? "plain", d = async () => {
729
+ if (m !== "plain" && !a.Prism?.languages?.[m])
730
+ try {
731
+ await J(`${fe}/components/prism-${m}.min.js`);
732
+ } catch {
733
+ }
734
+ };
735
+ return a.Prism?.languages ? d().then(() => a.Prism) : (re || (re = (async () => (window.Prism = { manual: !0 }, await J(`${fe}/prism.min.js`), window.Prism))()), re.then(async () => (await d(), window.Prism)));
736
+ }
737
+ function oe(u) {
738
+ return u.replace(/&/g, "&amp;").replace(/</g, "&lt;").replace(/>/g, "&gt;");
739
+ }
740
+ function $e(u) {
741
+ const {
742
+ value: a,
743
+ onChange: m,
744
+ language: d = "plaintext",
745
+ height: b = 300,
746
+ width: h = "100%",
747
+ readOnly: x = !1,
748
+ tabSize: n = 2,
749
+ lineNumbers: U = !0,
750
+ placeholder: j,
751
+ theme: C = "auto",
752
+ className: z,
753
+ "data-testid": A
754
+ } = u, T = L(null), E = L(null), [D, S] = O(() => oe(a)), [P, M] = O("light");
755
+ y(() => {
756
+ const c = () => {
757
+ if (C !== "auto")
758
+ return C;
759
+ if (typeof document > "u")
760
+ return "light";
761
+ const i = document.documentElement.dataset.theme;
762
+ return i === "dark" ? "dark" : i === "light" ? "light" : window.matchMedia?.("(prefers-color-scheme: dark)").matches ? "dark" : "light";
763
+ };
764
+ if (M(c()), C !== "auto" || typeof document > "u")
765
+ return;
766
+ const l = () => M(c()), p = new MutationObserver(l);
767
+ p.observe(document.documentElement, {
768
+ attributes: !0,
769
+ attributeFilter: ["data-theme", "class"]
770
+ });
771
+ const v = window.matchMedia?.("(prefers-color-scheme: dark)");
772
+ return v?.addEventListener?.("change", l), () => {
773
+ p.disconnect(), v?.removeEventListener?.("change", l);
774
+ };
775
+ }, [C]), y(() => {
776
+ let c = !0;
777
+ return Ae(d).then((l) => {
778
+ if (!c)
779
+ return;
780
+ const p = ie[d] ?? "plain";
781
+ if (l?.languages?.[p])
782
+ try {
783
+ const v = l.highlight(a, l.languages[p], p);
784
+ S(v);
785
+ return;
786
+ } catch {
787
+ }
788
+ S(oe(a));
789
+ }).catch(() => {
790
+ c && S(oe(a));
791
+ }), () => {
792
+ c = !1;
793
+ };
794
+ }, [a, d]);
795
+ const F = me(() => {
796
+ !E.current || !T.current || (E.current.scrollTop = T.current.scrollTop, E.current.scrollLeft = T.current.scrollLeft);
797
+ }, []), W = me(
798
+ (c) => {
799
+ if (c.key === "Tab") {
800
+ c.preventDefault();
801
+ const l = c.currentTarget, p = l.selectionStart, v = l.selectionEnd, i = " ".repeat(n);
802
+ if (c.shiftKey) {
803
+ const R = a.substring(0, p).lastIndexOf(`
804
+ `) + 1;
805
+ if ((a.substring(R, p).match(/^(\s*)/)?.[1] ?? "").length >= n) {
806
+ const Q = a.substring(0, R) + a.substring(R + n);
807
+ m?.(Q), setTimeout(() => {
808
+ l.selectionStart = l.selectionEnd = p - n;
809
+ }, 0);
810
+ }
811
+ } else {
812
+ const w = a.substring(0, p) + i + a.substring(v);
813
+ m?.(w), setTimeout(() => {
814
+ l.selectionStart = l.selectionEnd = p + n;
815
+ }, 0);
816
+ }
817
+ }
818
+ },
819
+ [a, m, n]
820
+ ), q = a.split(`
821
+ `).length, k = ie[d] ?? "plain";
822
+ return /* @__PURE__ */ _(
823
+ "div",
824
+ {
825
+ className: `nice-simple-code-editor nice-simple-code-editor--${P} ${z ?? ""}`,
826
+ style: { height: b, width: h },
827
+ "data-testid": A,
828
+ "data-language": d,
829
+ "data-theme": P,
830
+ children: [
831
+ U && /* @__PURE__ */ o("div", { className: "nice-simple-code-editor__line-numbers", children: Array.from({ length: q }, (c, l) => /* @__PURE__ */ o("div", { className: "nice-simple-code-editor__line-number", children: l + 1 }, l)) }),
832
+ /* @__PURE__ */ _("div", { className: "nice-simple-code-editor__editor-area", children: [
833
+ /* @__PURE__ */ o(
834
+ "pre",
835
+ {
836
+ ref: E,
837
+ "aria-hidden": "true",
838
+ className: `nice-simple-code-editor__highlight language-${k}`,
839
+ children: /* @__PURE__ */ o(
840
+ "code",
841
+ {
842
+ className: `language-${k}`,
843
+ dangerouslySetInnerHTML: { __html: D + (a.endsWith(`
844
+ `) ? `
845
+ ` : "") }
846
+ }
847
+ )
848
+ }
849
+ ),
850
+ /* @__PURE__ */ o(
851
+ "textarea",
852
+ {
853
+ ref: T,
854
+ className: "nice-simple-code-editor__textarea",
855
+ value: a,
856
+ onChange: (c) => m?.(c.target.value),
857
+ onKeyDown: W,
858
+ onScroll: F,
859
+ readOnly: x,
860
+ placeholder: j,
861
+ spellCheck: !1,
862
+ autoCapitalize: "off",
863
+ autoCorrect: "off"
864
+ }
865
+ )
866
+ ] })
867
+ ]
868
+ }
869
+ );
870
+ }
871
+ const he = "nice-code-editor-styles";
872
+ if (typeof document < "u" && !document.getElementById(he)) {
873
+ const u = document.createElement("style");
874
+ u.id = he, u.textContent = `
875
+ .nice-code-editor,
876
+ .nice-code-diff-editor {
877
+ border: 1px solid var(--nice-border, #e0e0e0);
878
+ border-radius: var(--nice-radius-sm, 4px);
879
+ overflow: hidden;
880
+ }
881
+
882
+ .nice-code-editor--loading,
883
+ .nice-code-editor--error,
884
+ .nice-code-diff-editor--loading {
885
+ display: flex;
886
+ align-items: center;
887
+ justify-content: center;
888
+ background: var(--nice-bg-muted, #f5f5f5);
889
+ }
890
+
891
+ .nice-code-editor__loader {
892
+ color: var(--nice-text-secondary, #666);
893
+ font-size: 14px;
894
+ }
895
+
896
+ .nice-code-editor__error {
897
+ display: flex;
898
+ flex-direction: column;
899
+ width: 100%;
900
+ height: 100%;
901
+ padding: var(--nice-space-2, 8px);
902
+ gap: var(--nice-space-2, 8px);
903
+ }
904
+
905
+ .nice-code-editor__error span {
906
+ color: var(--nice-error, #d32f2f);
907
+ }
908
+
909
+ /* Simple code editor */
910
+ .nice-simple-code-editor {
911
+ display: flex;
912
+ border: 1px solid var(--nice-border-color, var(--nice-border, #e0e0e0));
913
+ border-radius: var(--nice-radius-sm, 4px);
914
+ overflow: hidden;
915
+ font-family: 'Fira Code', 'Consolas', 'Monaco', monospace;
916
+ font-size: 14px;
917
+ line-height: 1.5;
918
+ background: var(--nice-bg-primary, var(--nice-bg-surface, #fff));
919
+ color: var(--nice-text-primary, var(--nice-text-primary, #333));
920
+ }
921
+ .nice-simple-code-editor--dark {
922
+ background: var(--nice-bg, #1e1e1e);
923
+ color: var(--nice-text, #d4d4d4);
924
+ }
925
+
926
+ .nice-simple-code-editor__line-numbers {
927
+ padding: var(--nice-space-2, 8px) 0;
928
+ background: var(--nice-bg-secondary, var(--nice-bg-muted, #f5f5f5));
929
+ border-right: 1px solid var(--nice-border-color, var(--nice-border, #e0e0e0));
930
+ user-select: none;
931
+ text-align: right;
932
+ color: var(--nice-text-secondary, var(--nice-text-secondary, #999));
933
+ overflow: hidden;
934
+ }
935
+ .nice-simple-code-editor--dark .nice-simple-code-editor__line-numbers {
936
+ background: var(--nice-bg-secondary, #252526);
937
+ border-right-color: var(--nice-border, #3c3c3c);
938
+ color: var(--nice-text-muted, #858585);
939
+ }
940
+
941
+ .nice-simple-code-editor__line-number {
942
+ padding: 0 var(--nice-space-3, 12px);
943
+ min-width: 40px;
944
+ }
945
+
946
+ .nice-simple-code-editor__editor-area {
947
+ position: relative;
948
+ flex: 1;
949
+ overflow: hidden;
950
+ }
951
+
952
+ .nice-simple-code-editor__highlight,
953
+ .nice-simple-code-editor__textarea {
954
+ position: absolute;
955
+ inset: 0;
956
+ margin: 0;
957
+ padding: var(--nice-space-2, 8px) var(--nice-space-3, 12px);
958
+ border: 0;
959
+ font: inherit;
960
+ line-height: inherit;
961
+ white-space: pre;
962
+ overflow: auto;
963
+ tab-size: 2;
964
+ }
965
+
966
+ .nice-simple-code-editor__highlight {
967
+ pointer-events: none;
968
+ background: transparent;
969
+ color: inherit;
970
+ }
971
+ .nice-simple-code-editor__highlight code {
972
+ font: inherit;
973
+ background: transparent;
974
+ }
975
+
976
+ .nice-simple-code-editor__textarea {
977
+ background: transparent;
978
+ color: transparent;
979
+ caret-color: var(--nice-text-primary, var(--nice-text-primary, #333));
980
+ resize: none;
981
+ outline: none;
982
+ -webkit-text-fill-color: transparent;
983
+ }
984
+ .nice-simple-code-editor--dark .nice-simple-code-editor__textarea {
985
+ caret-color: var(--nice-text, #d4d4d4);
986
+ }
987
+
988
+ .nice-simple-code-editor__textarea::placeholder {
989
+ color: var(--nice-text-secondary, var(--nice-text-secondary, #999));
990
+ -webkit-text-fill-color: var(--nice-text-secondary, var(--nice-text-secondary, #999));
991
+ }
992
+ .nice-simple-code-editor--dark .nice-simple-code-editor__textarea::placeholder {
993
+ color: var(--nice-text-muted, #858585);
994
+ -webkit-text-fill-color: var(--nice-text-muted, #858585);
995
+ }
996
+
997
+ /* Prism token colors — light */
998
+ .nice-simple-code-editor .token.comment,
999
+ .nice-simple-code-editor .token.prolog,
1000
+ .nice-simple-code-editor .token.doctype,
1001
+ .nice-simple-code-editor .token.cdata { color: #6a737d; font-style: italic; }
1002
+ .nice-simple-code-editor .token.punctuation { color: #586069; }
1003
+ .nice-simple-code-editor .token.property,
1004
+ .nice-simple-code-editor .token.tag,
1005
+ .nice-simple-code-editor .token.boolean,
1006
+ .nice-simple-code-editor .token.number,
1007
+ .nice-simple-code-editor .token.constant,
1008
+ .nice-simple-code-editor .token.symbol,
1009
+ .nice-simple-code-editor .token.deleted { color: #005cc5; }
1010
+ .nice-simple-code-editor .token.selector,
1011
+ .nice-simple-code-editor .token.attr-name,
1012
+ .nice-simple-code-editor .token.string,
1013
+ .nice-simple-code-editor .token.char,
1014
+ .nice-simple-code-editor .token.builtin,
1015
+ .nice-simple-code-editor .token.inserted { color: #032f62; }
1016
+ .nice-simple-code-editor .token.operator,
1017
+ .nice-simple-code-editor .token.entity,
1018
+ .nice-simple-code-editor .token.url,
1019
+ .nice-simple-code-editor .token.variable { color: var(--nice-danger, #d73a49); }
1020
+ .nice-simple-code-editor .token.atrule,
1021
+ .nice-simple-code-editor .token.attr-value,
1022
+ .nice-simple-code-editor .token.keyword { color: var(--nice-danger, #d73a49); font-weight: 600; }
1023
+ .nice-simple-code-editor .token.function,
1024
+ .nice-simple-code-editor .token.class-name { color: #6f42c1; }
1025
+ .nice-simple-code-editor .token.regex,
1026
+ .nice-simple-code-editor .token.important { color: #e36209; }
1027
+
1028
+ /* Prism token colors — dark */
1029
+ .nice-simple-code-editor--dark .token.comment,
1030
+ .nice-simple-code-editor--dark .token.prolog,
1031
+ .nice-simple-code-editor--dark .token.doctype,
1032
+ .nice-simple-code-editor--dark .token.cdata { color: var(--nice-success, #6a9955); font-style: italic; }
1033
+ .nice-simple-code-editor--dark .token.punctuation { color: var(--nice-text, #d4d4d4); }
1034
+ .nice-simple-code-editor--dark .token.property,
1035
+ .nice-simple-code-editor--dark .token.tag,
1036
+ .nice-simple-code-editor--dark .token.boolean,
1037
+ .nice-simple-code-editor--dark .token.number,
1038
+ .nice-simple-code-editor--dark .token.constant,
1039
+ .nice-simple-code-editor--dark .token.symbol,
1040
+ .nice-simple-code-editor--dark .token.deleted { color: var(--nice-success-light, #b5cea8); }
1041
+ .nice-simple-code-editor--dark .token.selector,
1042
+ .nice-simple-code-editor--dark .token.attr-name,
1043
+ .nice-simple-code-editor--dark .token.string,
1044
+ .nice-simple-code-editor--dark .token.char,
1045
+ .nice-simple-code-editor--dark .token.builtin,
1046
+ .nice-simple-code-editor--dark .token.inserted { color: var(--nice-warning, #ce9178); }
1047
+ .nice-simple-code-editor--dark .token.operator,
1048
+ .nice-simple-code-editor--dark .token.entity,
1049
+ .nice-simple-code-editor--dark .token.url,
1050
+ .nice-simple-code-editor--dark .token.variable { color: var(--nice-primary, #569cd6); }
1051
+ .nice-simple-code-editor--dark .token.atrule,
1052
+ .nice-simple-code-editor--dark .token.attr-value,
1053
+ .nice-simple-code-editor--dark .token.keyword { color: #c586c0; font-weight: 600; }
1054
+ .nice-simple-code-editor--dark .token.function,
1055
+ .nice-simple-code-editor--dark .token.class-name { color: #dcdcaa; }
1056
+ .nice-simple-code-editor--dark .token.regex,
1057
+ .nice-simple-code-editor--dark .token.important { color: #d7ba7d; }
1058
+
1059
+ /* Toolbar */
1060
+ .nice-code-editor-wrap {
1061
+ border: 1px solid var(--nice-border, #e0e0e0);
1062
+ border-radius: var(--nice-radius-sm, 4px);
1063
+ overflow: hidden;
1064
+ }
1065
+ .nice-code-editor-wrap .nice-code-editor {
1066
+ border: none;
1067
+ border-radius: 0;
1068
+ }
1069
+ .nice-code-editor__toolbar {
1070
+ display: flex;
1071
+ align-items: center;
1072
+ gap: var(--nice-space-0-5, 2px);
1073
+ padding: var(--nice-space-0-75, 3px) var(--nice-space-1-5, 6px);
1074
+ background: var(--nice-bg-muted, #f5f5f5);
1075
+ border-bottom: 1px solid var(--nice-border, #e0e0e0);
1076
+ }
1077
+ .nice-code-editor__toolbar-btn {
1078
+ display: inline-flex;
1079
+ align-items: center;
1080
+ justify-content: center;
1081
+ width: 26px;
1082
+ height: 26px;
1083
+ border: none;
1084
+ border-radius: var(--nice-radius-sm, 3px);
1085
+ background: transparent;
1086
+ color: var(--nice-text-secondary, #666);
1087
+ cursor: pointer;
1088
+ font-size: 14px;
1089
+ transition: background 0.15s, color 0.15s;
1090
+ }
1091
+ .nice-code-editor__toolbar-btn:hover {
1092
+ background: var(--nice-hover, #e0e0e0);
1093
+ color: var(--nice-text-primary, #333);
1094
+ }
1095
+ .nice-code-editor__toolbar-btn--active {
1096
+ background: var(--nice-accent, #1976d2);
1097
+ color: var(--nice-bg, #FFF);
1098
+ }
1099
+ .nice-code-editor__toolbar-sep {
1100
+ width: 1px;
1101
+ height: 18px;
1102
+ background: var(--nice-border, #e0e0e0);
1103
+ margin: 0 var(--nice-space-1, 4px);
1104
+ }
1105
+
1106
+ /* Status bar */
1107
+ .nice-code-editor__statusbar {
1108
+ display: flex;
1109
+ align-items: center;
1110
+ gap: var(--nice-space-3, 12px);
1111
+ padding: var(--nice-space-0-5, 2px) var(--nice-space-2-5, 10px);
1112
+ background: var(--nice-bg-muted, #f5f5f5);
1113
+ border-top: 1px solid var(--nice-border, #e0e0e0);
1114
+ font-size: 12px;
1115
+ color: var(--nice-text-secondary, #666);
1116
+ user-select: none;
1117
+ }
1118
+ .nice-code-editor__statusbar-spacer { flex: 1; }
1119
+ .nice-code-editor__statusbar-lang {
1120
+ text-transform: uppercase;
1121
+ font-weight: 600;
1122
+ font-size: 11px;
1123
+ }
1124
+ .nice-code-editor__statusbar-markers {
1125
+ color: var(--nice-warning, #f39c12);
1126
+ font-weight: 600;
1127
+ }
1128
+ `, document.head.appendChild(u);
1129
+ }
1130
+ export {
1131
+ Ve as NiceCodeDiffEditor,
1132
+ We as NiceCodeEditor,
1133
+ $e as NiceSimpleCodeEditor
1134
+ };