@coldsmirk/inkstone-react 0.29.0 → 0.31.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -31,7 +31,7 @@ import { MonacoEditor } from "@coldsmirk/inkstone-react/monaco";
31
31
  One component brings: the local `monaco-editor` instance (no CDN), bundled offline workers, Shiki catppuccin highlighting registered before first paint, light/dark switching via `dark`, and VS Code's auto-closing JSX tags on TypeScript/JavaScript models whose `path` ends in `.tsx` / `.jsx` (parser-backed via the bundled TS worker).
32
32
 
33
33
  - **Locale** — chrome speaks stock English; `locale="zh-cn"` switches to Monaco's official Simplified-Chinese catalog. Page-global and locked by the first editor to mount, so give every editor the same value.
34
- - **Type & metrics** — `fontSize` defaults to 14, `lineHeight` to 1.6 (Monaco's convention: values below 8 multiply the font size); `DEFAULT_MONACO_OPTIONS` is exported for hosts that need the same baseline.
34
+ - **Type & metrics** — `fontSize` defaults to 14, `lineHeight` to 1.6 (Monaco's convention: values below 8 multiply the font size); `DEFAULT_MONACO_OPTIONS` is exported for hosts that need the same baseline. `lineWrapping` (opt-in) soft-wraps long lines and ends each wrapped line in Monaco's ↩ (`wordWrapIndicator`), so a soft wrap reads apart from a real line break — on `<MonacoDiffEditor>` too.
35
35
  - **Loading / failure** — the host, the highlighter, and the Monaco chunk each have a loading window; `loading` and `failure` render nodes for them. A host load failure is not cached — a fresh mount retries.
36
36
  - **Embedded-friendly** — `find.addExtraSpaceOnTop` is off by default and the find-widget tooltip geometry of [monaco-editor#5177](https://github.com/microsoft/monaco-editor/issues/5177) is worked around. `disableContextMenu` / `disableFind` / `disableCommandPalette` switch off Monaco's browsing chrome per editor.
37
37
  - **Escape hatches** — `options` (raw `IStandaloneEditorConstructionOptions`), `hostOptions` (e.g. a custom `getWorker`; first mount wins), `beforeMount` / `onMount` for language-service configuration.
@@ -1,2 +1 @@
1
- import { a as CodeMirrorDiffEditor, i as CodeMirrorEditor, n as normalizeContext, r as searchPhrasesZhCn, t as codeMirrorLanguages } from "./codemirror-bROXidfr.js";
2
- export { CodeMirrorDiffEditor, CodeMirrorEditor, codeMirrorLanguages, normalizeContext, searchPhrasesZhCn };
1
+ export { a as CodeMirrorDiffEditor, i as CodeMirrorEditor, t as codeMirrorLanguages, n as normalizeContext, r as searchPhrasesZhCn } from "./codemirror-bROXidfr.js";
package/dist/index.d.ts CHANGED
@@ -1,4 +1,4 @@
1
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-OhCg_705.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-DkmB9ON5.js";
3
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
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-FFb6p4ut.js";
2
+ import { i as MonacoDiffEditor, n as monacoLanguages, r as MonacoEditor, t as DEFAULT_MONACO_OPTIONS } from "./monaco-DbsfKRWu.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 };
@@ -63,6 +63,7 @@ function useMonacoHost(locale, hostOptions) {
63
63
  function diffDocumentOptions({ lineWrapping, showLineNumbers, readOnly, collapseUnchanged, fontSize, lineHeight }) {
64
64
  const resolved = {
65
65
  wordWrap: lineWrapping ? "on" : "off",
66
+ wordWrapIndicator: lineWrapping,
66
67
  lineNumbers: showLineNumbers ? "on" : "off",
67
68
  readOnly,
68
69
  hideUnchangedRegions: { enabled: collapseUnchanged }
@@ -176,6 +177,7 @@ function documentOptions({ placeholder, lineWrapping, showLineNumbers, folding,
176
177
  const resolved = {
177
178
  placeholder,
178
179
  wordWrap: lineWrapping ? "on" : "off",
180
+ wordWrapIndicator: lineWrapping,
179
181
  lineNumbers: showLineNumbers ? "on" : "off",
180
182
  folding,
181
183
  contextmenu: !disableContextMenu
@@ -310,7 +312,7 @@ function MonacoEditor({ value, onChange, language = "javascript", dark = false,
310
312
  return /* @__PURE__ */ jsx(Editor, {
311
313
  keepCurrentModel: true,
312
314
  beforeMount: handleBeforeMount,
313
- className,
315
+ className: className === void 0 ? "monaco-component" : `monaco-component ${className}`,
314
316
  defaultValue: value,
315
317
  height,
316
318
  language,
@@ -63,7 +63,7 @@ interface MonacoDiffEditorProps {
63
63
  collapseUnchanged?: boolean;
64
64
  /**
65
65
  * Soft-wrap long lines on both sides (Monaco `wordWrap`; the diff editor's own
66
- * `diffWordWrap` inherits it).
66
+ * `diffWordWrap` inherits it), each wrapped line ending in Monaco's ↩ (`wordWrapIndicator`).
67
67
  *
68
68
  * @default false
69
69
  */
@@ -175,7 +175,8 @@ interface MonacoEditorProps {
175
175
  */
176
176
  placeholder?: string;
177
177
  /**
178
- * Soft-wrap long lines (Monaco `wordWrap`).
178
+ * Soft-wrap long lines (Monaco `wordWrap`), each wrapped line ending in Monaco's ↩
179
+ * (`wordWrapIndicator`), so a soft wrap reads apart from a real line break.
179
180
  *
180
181
  * @default false
181
182
  */
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-OhCg_705.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-DkmB9ON5.js";
2
2
  export { DEFAULT_MONACO_OPTIONS, MonacoDiffEditor, type MonacoDiffEditorProps, MonacoEditor, type MonacoEditorProps, type MonacoLanguage, monacoLanguages };
package/dist/monaco.js CHANGED
@@ -1,2 +1 @@
1
- import { i as MonacoDiffEditor, n as monacoLanguages, r as MonacoEditor, t as DEFAULT_MONACO_OPTIONS } from "./monaco-FFb6p4ut.js";
2
- export { DEFAULT_MONACO_OPTIONS, MonacoDiffEditor, MonacoEditor, monacoLanguages };
1
+ export { t as DEFAULT_MONACO_OPTIONS, i as MonacoDiffEditor, r as MonacoEditor, n as monacoLanguages } from "./monaco-DbsfKRWu.js";
package/dist/shiki.js CHANGED
@@ -1,2 +1 @@
1
- import { t as useShikiHighlighter } from "./use-shiki-highlighter-CzSQcX2f.js";
2
- export { useShikiHighlighter };
1
+ export { t as useShikiHighlighter } from "./use-shiki-highlighter-CzSQcX2f.js";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@coldsmirk/inkstone-react",
3
- "version": "0.29.0",
3
+ "version": "0.31.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,20 +48,20 @@
48
48
  ],
49
49
  "dependencies": {
50
50
  "@monaco-editor/react": "^4.7.0",
51
- "@coldsmirk/inkstone-codemirror": "^0.29.0",
52
- "@coldsmirk/inkstone-core": "^0.29.0",
53
- "@coldsmirk/inkstone-monaco": "^0.29.0"
51
+ "@coldsmirk/inkstone-codemirror": "^0.31.0",
52
+ "@coldsmirk/inkstone-core": "^0.31.0",
53
+ "@coldsmirk/inkstone-monaco": "^0.31.0"
54
54
  },
55
55
  "devDependencies": {
56
56
  "@codemirror/autocomplete": "^6.20.3",
57
- "@codemirror/commands": "^6.10.4",
58
- "@codemirror/language": "^6.12.3",
59
- "@codemirror/search": "^6.6.0",
60
- "@codemirror/state": "^6.6.0",
61
- "@codemirror/view": "^6.43.0",
62
- "monaco-editor": "^0.56.0",
63
- "react": "^19.2.8",
64
- "react-dom": "^19.2.8"
57
+ "@codemirror/commands": "^6.11.1",
58
+ "@codemirror/language": "^6.13.1",
59
+ "@codemirror/search": "^6.7.2",
60
+ "@codemirror/state": "^6.7.6",
61
+ "@codemirror/view": "^6.43.14",
62
+ "monaco-editor": "^0.57.0",
63
+ "react": "^19.3.0",
64
+ "react-dom": "^19.3.0"
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.56.0",
73
+ "monaco-editor": "^0.57.0",
74
74
  "react": ">=19"
75
75
  },
76
76
  "peerDependenciesMeta": {