@coldsmirk/inkstone-react 0.14.0 → 0.15.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.
@@ -2,7 +2,6 @@ import { Extension } from "@codemirror/state";
2
2
  import { EditorView } from "@codemirror/view";
3
3
  import { CodeMirrorLanguage, CodeMirrorLanguage as CodeMirrorLanguage$1, EditorContext, EditorContext as EditorContext$1, MergeView, MergeView as MergeView$1, SqlSchema, SqlSchema as SqlSchema$1, codeMirrorLanguages, normalizeContext as normalizeContext$1, searchPhrasesZhCn as searchPhrasesZhCn$1 } from "@coldsmirk/inkstone-codemirror";
4
4
  import { ReactNode } from "react";
5
-
6
5
  //#region src/codemirror-diff-editor.d.ts
7
6
  interface CodeMirrorDiffEditorProps {
8
7
  /**
@@ -136,28 +135,7 @@ interface CodeMirrorDiffEditorProps {
136
135
  * sides share `language`, `extensions`, and the theme; dark flips, language loads, and
137
136
  * `revertControls` / `collapseUnchanged` all swap in place without rebuilding the view.
138
137
  */
139
- declare function CodeMirrorDiffEditor({
140
- original,
141
- modified,
142
- onChange,
143
- language,
144
- readOnly,
145
- revertControls,
146
- collapseUnchanged,
147
- lineWrapping,
148
- showLineNumbers,
149
- extensions,
150
- dynamicExtensions,
151
- dark,
152
- height,
153
- width,
154
- fontSize,
155
- lineHeight,
156
- className,
157
- originalAriaLabel,
158
- modifiedAriaLabel,
159
- onMount
160
- }: CodeMirrorDiffEditorProps): ReactNode;
138
+ declare function CodeMirrorDiffEditor({ original, modified, onChange, language, readOnly, revertControls, collapseUnchanged, lineWrapping, showLineNumbers, extensions, dynamicExtensions, dark, height, width, fontSize, lineHeight, className, originalAriaLabel, modifiedAriaLabel, onMount }: CodeMirrorDiffEditorProps): ReactNode;
161
139
  //#endregion
162
140
  //#region src/codemirror-editor.d.ts
163
141
  interface CodeMirrorEditorProps {
@@ -317,32 +295,6 @@ interface CodeMirrorEditorProps {
317
295
  * `height` / `width` for sizing — parity with `<MonacoEditor>`. Bring your own language
318
296
  * support via `extensions`; a theme passed through `dynamicExtensions` overrides the default.
319
297
  */
320
- declare function CodeMirrorEditor({
321
- value,
322
- onChange,
323
- language,
324
- context,
325
- sqlSchema,
326
- placeholder,
327
- lineWrapping,
328
- showLineNumbers,
329
- folding,
330
- spellcheck,
331
- search,
332
- extensions,
333
- dynamicExtensions,
334
- dark,
335
- locale,
336
- height,
337
- width,
338
- fontSize,
339
- lineHeight,
340
- tabSize,
341
- className,
342
- onMount,
343
- onFocus,
344
- onBlur,
345
- ariaLabel
346
- }: CodeMirrorEditorProps): ReactNode;
298
+ declare function CodeMirrorEditor({ value, onChange, language, context, sqlSchema, placeholder, lineWrapping, showLineNumbers, folding, spellcheck, search, extensions, dynamicExtensions, dark, locale, height, width, fontSize, lineHeight, tabSize, className, onMount, onFocus, onBlur, ariaLabel }: CodeMirrorEditorProps): ReactNode;
347
299
  //#endregion
348
300
  export { codeMirrorLanguages as a, CodeMirrorEditor as c, CodeMirrorDiffEditorProps as d, SqlSchema$1 as i, CodeMirrorEditorProps as l, EditorContext$1 as n, normalizeContext$1 as o, MergeView$1 as r, searchPhrasesZhCn$1 as s, CodeMirrorLanguage$1 as t, CodeMirrorDiffEditor as u };
@@ -198,8 +198,10 @@ function CodeMirrorEditor({ value, onChange, language, context, sqlSchema, place
198
198
  search
199
199
  }),
200
200
  EditorView.updateListener.of((update) => {
201
- if (update.focusChanged) if (update.view.hasFocus) onFocusRef.current?.();
202
- else onBlurRef.current?.();
201
+ if (update.focusChanged) {
202
+ if (update.view.hasFocus) onFocusRef.current?.();
203
+ else onBlurRef.current?.();
204
+ }
203
205
  }),
204
206
  ...extensions ?? []
205
207
  ],
@@ -1,2 +1,2 @@
1
- import { a as codeMirrorLanguages, c as CodeMirrorEditor, d as CodeMirrorDiffEditorProps, i as SqlSchema, l as CodeMirrorEditorProps, n as EditorContext, o as normalizeContext, r as MergeView, s as searchPhrasesZhCn, t as CodeMirrorLanguage, u as CodeMirrorDiffEditor } from "./codemirror-B3GlIVaX.js";
1
+ import { a as codeMirrorLanguages, c as CodeMirrorEditor, d as CodeMirrorDiffEditorProps, i as SqlSchema, l as CodeMirrorEditorProps, n as EditorContext, o as normalizeContext, r as MergeView, s as searchPhrasesZhCn, t as CodeMirrorLanguage, u as CodeMirrorDiffEditor } from "./codemirror-BW_zSOVE.js";
2
2
  export { CodeMirrorDiffEditor, type CodeMirrorDiffEditorProps, CodeMirrorEditor, type CodeMirrorEditorProps, type CodeMirrorLanguage, type EditorContext, type MergeView, type SqlSchema, codeMirrorLanguages, normalizeContext, searchPhrasesZhCn };
@@ -1,2 +1,2 @@
1
- import { a as CodeMirrorDiffEditor, i as CodeMirrorEditor, n as normalizeContext, r as searchPhrasesZhCn, t as codeMirrorLanguages } from "./codemirror-Bvwl0fxH.js";
1
+ import { a as CodeMirrorDiffEditor, i as CodeMirrorEditor, n as normalizeContext, r as searchPhrasesZhCn, t as codeMirrorLanguages } from "./codemirror-bROXidfr.js";
2
2
  export { CodeMirrorDiffEditor, CodeMirrorEditor, codeMirrorLanguages, normalizeContext, searchPhrasesZhCn };
package/dist/index.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- import { a as codeMirrorLanguages, c as CodeMirrorEditor, d as CodeMirrorDiffEditorProps, i as SqlSchema, l as CodeMirrorEditorProps, n as EditorContext, o as normalizeContext, r as MergeView, s as searchPhrasesZhCn, t as CodeMirrorLanguage, u as CodeMirrorDiffEditor } from "./codemirror-B3GlIVaX.js";
2
- import { a as MonacoEditorProps, i as MonacoEditor, n as MonacoLanguage, o as MonacoDiffEditor, r as monacoLanguages, s as MonacoDiffEditorProps, t as DEFAULT_MONACO_OPTIONS } from "./monaco-BoTcTdm-.js";
3
- import { n as useShikiHighlighter, t as ShikiState } from "./shiki-D-IjmhhO.js";
1
+ import { a as codeMirrorLanguages, c as CodeMirrorEditor, d as CodeMirrorDiffEditorProps, i as SqlSchema, l as CodeMirrorEditorProps, n as EditorContext, o as normalizeContext, r as MergeView, s as searchPhrasesZhCn, t as CodeMirrorLanguage, u as CodeMirrorDiffEditor } from "./codemirror-BW_zSOVE.js";
2
+ import { a as MonacoEditorProps, i as MonacoEditor, n as MonacoLanguage, o as MonacoDiffEditor, r as monacoLanguages, s as MonacoDiffEditorProps, t as DEFAULT_MONACO_OPTIONS } from "./monaco-B9Ju25D7.js";
3
+ import { n as useShikiHighlighter, t as ShikiState } from "./shiki-Ds-uZ7XH.js";
4
4
  export { CodeMirrorDiffEditor, type CodeMirrorDiffEditorProps, CodeMirrorEditor, type CodeMirrorEditorProps, type CodeMirrorLanguage, DEFAULT_MONACO_OPTIONS, type EditorContext, type MergeView, MonacoDiffEditor, type MonacoDiffEditorProps, MonacoEditor, type MonacoEditorProps, type MonacoLanguage, type ShikiState, type SqlSchema, codeMirrorLanguages, monacoLanguages, normalizeContext, searchPhrasesZhCn, useShikiHighlighter };
package/dist/index.js CHANGED
@@ -1,5 +1,5 @@
1
- import { a as CodeMirrorDiffEditor, i as CodeMirrorEditor, n as normalizeContext, r as searchPhrasesZhCn, t as codeMirrorLanguages } from "./codemirror-Bvwl0fxH.js";
2
- import { i as MonacoDiffEditor, n as monacoLanguages, r as MonacoEditor, t as DEFAULT_MONACO_OPTIONS } from "./monaco-IkYCUn1k.js";
1
+ import { a as CodeMirrorDiffEditor, i as CodeMirrorEditor, n as normalizeContext, r as searchPhrasesZhCn, t as codeMirrorLanguages } from "./codemirror-bROXidfr.js";
2
+ import { i as MonacoDiffEditor, n as monacoLanguages, r as MonacoEditor, t as DEFAULT_MONACO_OPTIONS } from "./monaco-D-f6AaBt.js";
3
3
  import { t as useShikiHighlighter } from "./use-shiki-highlighter-CzSQcX2f.js";
4
4
  import "./shiki.js";
5
5
  export { CodeMirrorDiffEditor, CodeMirrorEditor, DEFAULT_MONACO_OPTIONS, MonacoDiffEditor, MonacoEditor, codeMirrorLanguages, monacoLanguages, normalizeContext, searchPhrasesZhCn, useShikiHighlighter };
@@ -2,7 +2,6 @@ import { ReactNode } from "react";
2
2
  import { DEFAULT_MONACO_OPTIONS as DEFAULT_MONACO_OPTIONS$1, MonacoHostOptions, MonacoLanguage, MonacoLanguage as MonacoLanguage$1, MonacoUiLocale, monacoLanguages } from "@coldsmirk/inkstone-monaco";
3
3
  import { BeforeMount, DiffBeforeMount, DiffOnMount, OnMount } from "@monaco-editor/react";
4
4
  import { editor } from "monaco-editor";
5
-
6
5
  //#region src/monaco-diff-editor.d.ts
7
6
  interface MonacoDiffEditorProps {
8
7
  /**
@@ -138,29 +137,7 @@ interface MonacoDiffEditorProps {
138
137
  * statically (type-only imports are fine), and the first mounted editor wins the host
139
138
  * configuration.
140
139
  */
141
- declare function MonacoDiffEditor({
142
- original,
143
- modified,
144
- onChange,
145
- language,
146
- dark,
147
- locale,
148
- readOnly,
149
- collapseUnchanged,
150
- lineWrapping,
151
- showLineNumbers,
152
- fontSize,
153
- lineHeight,
154
- height,
155
- width,
156
- className,
157
- options,
158
- hostOptions,
159
- loading,
160
- failure,
161
- beforeMount,
162
- onMount
163
- }: MonacoDiffEditorProps): ReactNode;
140
+ declare function MonacoDiffEditor({ original, modified, onChange, language, dark, locale, readOnly, collapseUnchanged, lineWrapping, showLineNumbers, fontSize, lineHeight, height, width, className, options, hostOptions, loading, failure, beforeMount, onMount }: MonacoDiffEditorProps): ReactNode;
164
141
  //#endregion
165
142
  //#region src/monaco-editor.d.ts
166
143
  interface MonacoEditorProps {
@@ -320,34 +297,6 @@ interface MonacoEditorProps {
320
297
  * Do not `import "monaco-editor"` statically elsewhere in the app — that would evaluate
321
298
  * Monaco before its UI locale is set (see `ensureMonacoHost`). Type-only imports are fine.
322
299
  */
323
- declare function MonacoEditor({
324
- value,
325
- onChange,
326
- language,
327
- dark,
328
- locale,
329
- placeholder,
330
- lineWrapping,
331
- showLineNumbers,
332
- folding,
333
- disableContextMenu,
334
- disableFind,
335
- disableCommandPalette,
336
- fontSize,
337
- lineHeight,
338
- tabSize,
339
- path,
340
- height,
341
- width,
342
- className,
343
- options,
344
- hostOptions,
345
- loading,
346
- failure,
347
- beforeMount,
348
- onMount,
349
- onFocus,
350
- onBlur
351
- }: MonacoEditorProps): ReactNode;
300
+ declare function MonacoEditor({ value, onChange, language, dark, locale, placeholder, lineWrapping, showLineNumbers, folding, disableContextMenu, disableFind, disableCommandPalette, fontSize, lineHeight, tabSize, path, height, width, className, options, hostOptions, loading, failure, beforeMount, onMount, onFocus, onBlur }: MonacoEditorProps): ReactNode;
352
301
  //#endregion
353
302
  export { MonacoEditorProps as a, MonacoEditor as i, MonacoLanguage$1 as n, MonacoDiffEditor as o, monacoLanguages as r, MonacoDiffEditorProps as s, DEFAULT_MONACO_OPTIONS$1 as t };
@@ -296,6 +296,7 @@ function MonacoEditor({ value, onChange, language = "javascript", dark = false,
296
296
  editorInstance.onDidBlurEditorText(() => onBlurRef.current?.());
297
297
  onMountRef.current?.(editorInstance, monaco);
298
298
  };
299
+ const theme = shikiState === "ready" ? shikiThemeId(dark) : dark ? "vs-dark" : "vs";
299
300
  return /* @__PURE__ */ jsx(Editor, {
300
301
  beforeMount: handleBeforeMount,
301
302
  className,
@@ -305,7 +306,7 @@ function MonacoEditor({ value, onChange, language = "javascript", dark = false,
305
306
  loading,
306
307
  options: mergedOptions,
307
308
  path,
308
- theme: shikiState === "ready" ? shikiThemeId(dark) : dark ? "vs-dark" : "vs",
309
+ theme,
309
310
  width,
310
311
  onChange: handleChange,
311
312
  onMount: handleMount
package/dist/monaco.d.ts CHANGED
@@ -1,2 +1,2 @@
1
- import { a as MonacoEditorProps, i as MonacoEditor, n as MonacoLanguage, o as MonacoDiffEditor, r as monacoLanguages, s as MonacoDiffEditorProps, t as DEFAULT_MONACO_OPTIONS } from "./monaco-BoTcTdm-.js";
1
+ import { a as MonacoEditorProps, i as MonacoEditor, n as MonacoLanguage, o as MonacoDiffEditor, r as monacoLanguages, s as MonacoDiffEditorProps, t as DEFAULT_MONACO_OPTIONS } from "./monaco-B9Ju25D7.js";
2
2
  export { DEFAULT_MONACO_OPTIONS, MonacoDiffEditor, type MonacoDiffEditorProps, MonacoEditor, type MonacoEditorProps, type MonacoLanguage, monacoLanguages };
package/dist/monaco.js CHANGED
@@ -1,2 +1,2 @@
1
- import { i as MonacoDiffEditor, n as monacoLanguages, r as MonacoEditor, t as DEFAULT_MONACO_OPTIONS } from "./monaco-IkYCUn1k.js";
1
+ import { i as MonacoDiffEditor, n as monacoLanguages, r as MonacoEditor, t as DEFAULT_MONACO_OPTIONS } from "./monaco-D-f6AaBt.js";
2
2
  export { DEFAULT_MONACO_OPTIONS, MonacoDiffEditor, MonacoEditor, monacoLanguages };
@@ -1,6 +1,5 @@
1
1
  import { RefObject } from "react";
2
2
  import { HighlighterCore } from "@coldsmirk/inkstone-core";
3
-
4
3
  //#region src/use-shiki-highlighter.d.ts
5
4
  type ShikiState = "loading" | "ready" | "failed";
6
5
  /**
package/dist/shiki.d.ts CHANGED
@@ -1,2 +1,2 @@
1
- import { n as useShikiHighlighter, t as ShikiState } from "./shiki-D-IjmhhO.js";
1
+ import { n as useShikiHighlighter, t as ShikiState } from "./shiki-Ds-uZ7XH.js";
2
2
  export { type ShikiState, useShikiHighlighter };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@coldsmirk/inkstone-react",
3
- "version": "0.14.0",
3
+ "version": "0.15.0",
4
4
  "description": "Drop-in React code editors: a preconfigured Monaco <MonacoEditor> (offline workers, Shiki catppuccin themes, dark switching, opt-in zh-CN UI) and a controlled CodeMirror 6 <CodeMirrorEditor> (catppuccin themes, dark switching, sizing).",
5
5
  "keywords": [
6
6
  "react",
@@ -48,9 +48,9 @@
48
48
  ],
49
49
  "dependencies": {
50
50
  "@monaco-editor/react": "^4.7.0",
51
- "@coldsmirk/inkstone-core": "^0.14.0",
52
- "@coldsmirk/inkstone-monaco": "^0.14.0",
53
- "@coldsmirk/inkstone-codemirror": "^0.14.0"
51
+ "@coldsmirk/inkstone-codemirror": "^0.15.0",
52
+ "@coldsmirk/inkstone-core": "^0.15.0",
53
+ "@coldsmirk/inkstone-monaco": "^0.15.0"
54
54
  },
55
55
  "devDependencies": {
56
56
  "@codemirror/autocomplete": "^6.20.3",
@@ -59,9 +59,9 @@
59
59
  "@codemirror/search": "^6.6.0",
60
60
  "@codemirror/state": "^6.6.0",
61
61
  "@codemirror/view": "^6.43.0",
62
- "monaco-editor": "^0.55.1",
63
- "react": "^19.2.7",
64
- "react-dom": "^19.2.7"
62
+ "monaco-editor": "^0.56.0",
63
+ "react": "^19.2.8",
64
+ "react-dom": "^19.2.8"
65
65
  },
66
66
  "peerDependencies": {
67
67
  "@codemirror/autocomplete": "^6.20.3",
@@ -70,7 +70,7 @@
70
70
  "@codemirror/search": "^6.6.0",
71
71
  "@codemirror/state": "^6.6.0",
72
72
  "@codemirror/view": "^6.43.0",
73
- "monaco-editor": "^0.55.1",
73
+ "monaco-editor": "^0.56.0",
74
74
  "react": ">=19"
75
75
  },
76
76
  "peerDependenciesMeta": {