@coldsmirk/inkstone-react 0.10.0 → 0.10.1

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/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-B27C5np1.js";
2
- import { i as MonacoEditor, n as MonacoDiffEditor, r as DEFAULT_MONACO_OPTIONS, t as monacoLanguages } from "./monaco-Bzo3cV2q.js";
2
+ import { i as MonacoEditor, n as MonacoDiffEditor, r as DEFAULT_MONACO_OPTIONS, t as monacoLanguages } from "./monaco-CP5BIXrw.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 };
@@ -6,6 +6,21 @@ import { shikiThemeId } from "@coldsmirk/inkstone-core";
6
6
  import { DiffEditor, Editor, loader } from "@monaco-editor/react";
7
7
  import { disabledKeybindings, ensureMonacoHost, installDisabledKeybindings, monacoLanguages } from "@coldsmirk/inkstone-monaco";
8
8
  import { shikiToMonaco } from "@shikijs/monaco";
9
+ //#region src/editor-face.tsx
10
+ const FACE_STYLE = {
11
+ display: "flex",
12
+ alignItems: "center",
13
+ justifyContent: "center",
14
+ height: "100%",
15
+ width: "100%"
16
+ };
17
+ function EditorFace({ children }) {
18
+ return /* @__PURE__ */ jsx("div", {
19
+ style: FACE_STYLE,
20
+ children
21
+ });
22
+ }
23
+ //#endregion
9
24
  //#region src/monaco-reconcile.ts
10
25
  function reconcileModelValue(model, externalValue) {
11
26
  const value = normalizeModelValue(model, externalValue);
@@ -241,8 +256,8 @@ function MonacoEditor({ value, onChange, language = "javascript", dark = false,
241
256
  tabSize,
242
257
  options
243
258
  ]);
244
- if (hostState === "failed") return failure;
245
- if (hostState === "loading" || shikiState === "loading") return loading;
259
+ if (hostState === "failed") return /* @__PURE__ */ jsx(EditorFace, { children: failure });
260
+ if (hostState === "loading" || shikiState === "loading") return /* @__PURE__ */ jsx(EditorFace, { children: loading });
246
261
  const handleBeforeMount = (monaco) => {
247
262
  const highlighter = highlighterRef.current;
248
263
  if (highlighter) registerShikiHighlighting(monaco, highlighter);
@@ -346,8 +361,8 @@ function MonacoDiffEditor({ original, modified, onChange, language = "javascript
346
361
  modifiedTransitionRef.current = false;
347
362
  }
348
363
  }, [modified, reconcileRevision]);
349
- if (hostState === "failed") return failure;
350
- if (hostState === "loading" || shikiState === "loading") return loading;
364
+ if (hostState === "failed") return /* @__PURE__ */ jsx(EditorFace, { children: failure });
365
+ if (hostState === "loading" || shikiState === "loading") return /* @__PURE__ */ jsx(EditorFace, { children: loading });
351
366
  const handleBeforeMount = (monaco) => {
352
367
  const highlighter = highlighterRef.current;
353
368
  if (highlighter) registerShikiHighlighting(monaco, highlighter);
package/dist/monaco.js CHANGED
@@ -1,2 +1,2 @@
1
- import { i as MonacoEditor, n as MonacoDiffEditor, r as DEFAULT_MONACO_OPTIONS, t as monacoLanguages } from "./monaco-Bzo3cV2q.js";
1
+ import { i as MonacoEditor, n as MonacoDiffEditor, r as DEFAULT_MONACO_OPTIONS, t as monacoLanguages } from "./monaco-CP5BIXrw.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.10.0",
3
+ "version": "0.10.1",
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",
@@ -51,9 +51,9 @@
51
51
  "@catppuccin/palette": "^1.8.0",
52
52
  "@monaco-editor/react": "^4.7.0",
53
53
  "@shikijs/monaco": "^4.3.1",
54
- "@coldsmirk/inkstone-codemirror": "^0.10.0",
55
- "@coldsmirk/inkstone-core": "^0.10.0",
56
- "@coldsmirk/inkstone-monaco": "^0.10.0"
54
+ "@coldsmirk/inkstone-codemirror": "^0.10.1",
55
+ "@coldsmirk/inkstone-core": "^0.10.1",
56
+ "@coldsmirk/inkstone-monaco": "^0.10.1"
57
57
  },
58
58
  "devDependencies": {
59
59
  "@codemirror/autocomplete": "^6.20.3",