@coldsmirk/inkstone-react 0.17.1 → 0.19.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
@@ -61,6 +61,7 @@ A controlled CM6 editor: create-once view, external value changes reconcile with
61
61
  - **Metrics & layout** — `fontSize` 14 and `lineHeight` 1.6 by default; `height` / `width` size the editor; `lineWrapping`, `showLineNumbers`, `folding` are opt-in.
62
62
  - **Accessibility** — the textbox defaults to `ariaLabel="Editor content"`; pass a workflow-specific `ariaLabel` when needed. Focus presentation belongs to the surrounding application chrome.
63
63
  - **Extensions** — `extensions` is create-once; `dynamicExtensions` reconfigures live. The catppuccin theme sits at low precedence, so a caller theme in `dynamicExtensions` overrides it.
64
+ - **Surfaces & tokens** — to paint both editors' chrome in your design language, configure `@coldsmirk/inkstone-core`'s `configureEditorSurface` once before the first editor mounts (per-scheme colors for background, current line, line numbers, floating widgets) and declare `--inkstone-radius-*` / `--inkstone-shadow-*` on your root; the syntax palette stays catppuccin's.
64
65
 
65
66
  `useShikiHighlighter` is exported from `@coldsmirk/inkstone-react/shiki`; `codeMirrorLanguages` / `normalizeContext` / `searchPhrasesZhCn` live on the CodeMirror entry, and `monacoLanguages` lives on the Monaco entry. The aggregate root re-exports them for compatibility.
66
67
 
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-DZj8pXIv.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";
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-DD8hJaMr.js";
2
+ import { i as MonacoDiffEditor, n as monacoLanguages, r as MonacoEditor, t as DEFAULT_MONACO_OPTIONS } from "./monaco-DczRavzN.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 };
@@ -3,7 +3,7 @@ import { t as useShikiHighlighter } from "./use-shiki-highlighter-CzSQcX2f.js";
3
3
  import { useCallback, useEffect, useInsertionEffect, useLayoutEffect, useMemo, useRef, useState } from "react";
4
4
  import { jsx } from "react/jsx-runtime";
5
5
  import { shikiThemeId } from "@coldsmirk/inkstone-core";
6
- import { DEFAULT_MONACO_OPTIONS, DEFAULT_MONACO_OPTIONS as DEFAULT_MONACO_OPTIONS$1, disabledKeybindings, ensureMonacoHost, installDisabledKeybindings, installJsxTagClosing, modelValueMatches, monacoLanguages, reconcileModelValue, registerShikiHighlighting } from "@coldsmirk/inkstone-monaco";
6
+ import { DEFAULT_MONACO_OPTIONS, DEFAULT_MONACO_OPTIONS as DEFAULT_MONACO_OPTIONS$1, disabledKeybindings, ensureMonacoHost, installDisabledKeybindings, installHoverDeadBandFix, installJsxTagClosing, modelValueMatches, monacoLanguages, reconcileModelValue, registerShikiHighlighting } from "@coldsmirk/inkstone-monaco";
7
7
  import { DiffEditor, Editor, loader } from "@monaco-editor/react";
8
8
  //#region src/editor-face.tsx
9
9
  const FACE_STYLE = {
@@ -293,6 +293,7 @@ function MonacoEditor({ value, onChange, language = "javascript", dark = false,
293
293
  reconcileModel(monaco, editorInstance, valueRef.current, languageRef.current, reconcilingRef);
294
294
  installDisabledKeybindings(monaco, editorInstance, disabledKeybindings(monaco, disableFind, disableCommandPalette));
295
295
  installJsxTagClosing(monaco, editorInstance);
296
+ installHoverDeadBandFix(editorInstance);
296
297
  editorInstance.onDidFocusEditorText(() => onFocusRef.current?.());
297
298
  editorInstance.onDidBlurEditorText(() => onBlurRef.current?.());
298
299
  onMountRef.current?.(editorInstance, monaco);
@@ -290,7 +290,9 @@ interface MonacoEditorProps {
290
290
  * `value` / `onChange` and everything else is wired. The UI speaks Monaco's stock English;
291
291
  * pass `hostOptions={{ locale: "zh-cn" }}` for the official Simplified-Chinese chrome.
292
292
  * TypeScript / JavaScript models whose `path` ends in `.tsx` / `.jsx` also get VS Code's
293
- * auto-closing JSX tags (`installJsxTagClosing`), served by the bundled TS worker.
293
+ * auto-closing JSX tags (`installJsxTagClosing`), served by the bundled TS worker; every
294
+ * editor gets the content-hover dead-band fix (`installHoverDeadBandFix`), so a slowly moved
295
+ * pointer can actually reach the hover widget.
294
296
  *
295
297
  * Mounting is gated on the Monaco host and the Shiki highlighter so the first paint already
296
298
  * has the right theme; if the highlighter fails to load, the editor falls back to Monaco's
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-DZj8pXIv.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-OhCg_705.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-DD8hJaMr.js";
1
+ import { i as MonacoDiffEditor, n as monacoLanguages, r as MonacoEditor, t as DEFAULT_MONACO_OPTIONS } from "./monaco-DczRavzN.js";
2
2
  export { DEFAULT_MONACO_OPTIONS, MonacoDiffEditor, MonacoEditor, monacoLanguages };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@coldsmirk/inkstone-react",
3
- "version": "0.17.1",
3
+ "version": "0.19.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-codemirror": "^0.17.1",
52
- "@coldsmirk/inkstone-core": "^0.17.1",
53
- "@coldsmirk/inkstone-monaco": "^0.17.1"
51
+ "@coldsmirk/inkstone-codemirror": "^0.19.0",
52
+ "@coldsmirk/inkstone-monaco": "^0.19.0",
53
+ "@coldsmirk/inkstone-core": "^0.19.0"
54
54
  },
55
55
  "devDependencies": {
56
56
  "@codemirror/autocomplete": "^6.20.3",