@nice2dev/ui 1.2.1 → 1.2.2

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