stream-monaco 0.0.40 → 0.0.42

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.
@@ -1,5 +1,5 @@
1
+ import * as monacoApi from "monaco-editor/esm/vs/editor/editor.api";
1
2
  import { Highlighter, SpecialTheme, ThemeInput } from "shiki";
2
- import * as monaco_editor0 from "monaco-editor";
3
3
  import * as monaco from "monaco-editor";
4
4
 
5
5
  //#region src/type.d.ts
@@ -142,6 +142,31 @@ interface MonacoOptions extends monaco.editor.IStandaloneEditorConstructionOptio
142
142
  * - Default (library): 50
143
143
  */
144
144
  updateThrottleMs?: number;
145
+ /**
146
+ * Smooth host container height changes while streaming content.
147
+ * Default: false
148
+ */
149
+ smoothHeightTransition?: boolean;
150
+ /**
151
+ * Height transition duration in milliseconds when smoothHeightTransition is enabled.
152
+ * Default: 120
153
+ */
154
+ heightTransitionMs?: number;
155
+ /**
156
+ * Height transition easing when smoothHeightTransition is enabled.
157
+ * Default: cubic-bezier(0.4, 0, 0.2, 1)
158
+ */
159
+ heightTransitionEasing?: string;
160
+ /**
161
+ * Debounce time (ms) to coalesce host height updates.
162
+ * Default: 0, or 16 when smoothHeightTransition is enabled
163
+ */
164
+ heightUpdateDebounceMs?: number;
165
+ /**
166
+ * Height delta tolerance in pixels before applying a new host height.
167
+ * Default: 12, or 1 when smoothHeightTransition is enabled
168
+ */
169
+ heightChangeTolerancePx?: number;
145
170
  /**
146
171
  * Time window (ms) used to throttle diff streaming updates in addition to RAF batching.
147
172
  * This affects `appendOriginal`/`appendModified` and the fast-path append branches of `updateDiff`.
@@ -165,7 +190,7 @@ interface MonacoOptions extends monaco.editor.IStandaloneEditorConstructionOptio
165
190
  * library will fall back to full `setValue` instead of attempting minimal edit.
166
191
  */
167
192
  minimalEditMaxChangeRatio?: number;
168
- onBeforeCreate?: (monaco: typeof monaco_editor0) => monaco.IDisposable[];
193
+ onBeforeCreate?: (monaco: typeof monacoApi) => monaco.IDisposable[];
169
194
  /**
170
195
  * Optional callback that is invoked after a theme change has been applied.
171
196
  * This callback will be awaited when possible so callers can track completion
@@ -208,7 +233,7 @@ interface UseMonacoReturn {
208
233
  getEditorView: () => monaco.editor.IStandaloneCodeEditor | null;
209
234
  getDiffEditorView: () => monaco.editor.IStandaloneDiffEditor | null;
210
235
  getDiffModels: () => DiffModels;
211
- getMonacoInstance: () => typeof monaco;
236
+ getMonacoInstance: () => typeof monacoApi;
212
237
  setUpdateThrottleMs: (ms: number) => void;
213
238
  getUpdateThrottleMs: () => number;
214
239
  getCode: () => MonacoCodeValue;
@@ -284,7 +309,7 @@ declare function registerMonacoThemes(themes: (ThemeInput | string | SpecialThem
284
309
  * @param {MonacoLanguage[]} [monacoOptions.languages] - 支持的编程语言数组
285
310
  * @param {string} [monacoOptions.theme] - 初始主题名称
286
311
  * @param {boolean} [monacoOptions.isCleanOnBeforeCreate] - 是否在创建前清理之前注册的资源, 默认为 true
287
- * @param {(monaco: typeof import('monaco-editor')) => monaco.IDisposable[]} [monacoOptions.onBeforeCreate] - 编辑器创建前的钩子函数
312
+ * @param {(monaco: typeof import('monaco-editor/esm/vs/editor/editor.api')) => monaco.IDisposable[]} [monacoOptions.onBeforeCreate] - 编辑器创建前的钩子函数
288
313
  *
289
314
  * @returns {{
290
315
  * createEditor: (container: HTMLElement, code: string, language: string) => Promise<monaco.editor.IStandaloneCodeEditor>,
@@ -1,5 +1,5 @@
1
- import * as monaco_editor0 from "monaco-editor";
2
1
  import * as monaco from "monaco-editor";
2
+ import * as monacoApi from "monaco-editor/esm/vs/editor/editor.api";
3
3
  import { Highlighter, SpecialTheme, ThemeInput } from "shiki";
4
4
 
5
5
  //#region src/type.d.ts
@@ -142,6 +142,31 @@ interface MonacoOptions extends monaco.editor.IStandaloneEditorConstructionOptio
142
142
  * - Default (library): 50
143
143
  */
144
144
  updateThrottleMs?: number;
145
+ /**
146
+ * Smooth host container height changes while streaming content.
147
+ * Default: false
148
+ */
149
+ smoothHeightTransition?: boolean;
150
+ /**
151
+ * Height transition duration in milliseconds when smoothHeightTransition is enabled.
152
+ * Default: 120
153
+ */
154
+ heightTransitionMs?: number;
155
+ /**
156
+ * Height transition easing when smoothHeightTransition is enabled.
157
+ * Default: cubic-bezier(0.4, 0, 0.2, 1)
158
+ */
159
+ heightTransitionEasing?: string;
160
+ /**
161
+ * Debounce time (ms) to coalesce host height updates.
162
+ * Default: 0, or 16 when smoothHeightTransition is enabled
163
+ */
164
+ heightUpdateDebounceMs?: number;
165
+ /**
166
+ * Height delta tolerance in pixels before applying a new host height.
167
+ * Default: 12, or 1 when smoothHeightTransition is enabled
168
+ */
169
+ heightChangeTolerancePx?: number;
145
170
  /**
146
171
  * Time window (ms) used to throttle diff streaming updates in addition to RAF batching.
147
172
  * This affects `appendOriginal`/`appendModified` and the fast-path append branches of `updateDiff`.
@@ -165,7 +190,7 @@ interface MonacoOptions extends monaco.editor.IStandaloneEditorConstructionOptio
165
190
  * library will fall back to full `setValue` instead of attempting minimal edit.
166
191
  */
167
192
  minimalEditMaxChangeRatio?: number;
168
- onBeforeCreate?: (monaco: typeof monaco_editor0) => monaco.IDisposable[];
193
+ onBeforeCreate?: (monaco: typeof monacoApi) => monaco.IDisposable[];
169
194
  /**
170
195
  * Optional callback that is invoked after a theme change has been applied.
171
196
  * This callback will be awaited when possible so callers can track completion
@@ -208,7 +233,7 @@ interface UseMonacoReturn {
208
233
  getEditorView: () => monaco.editor.IStandaloneCodeEditor | null;
209
234
  getDiffEditorView: () => monaco.editor.IStandaloneDiffEditor | null;
210
235
  getDiffModels: () => DiffModels;
211
- getMonacoInstance: () => typeof monaco;
236
+ getMonacoInstance: () => typeof monacoApi;
212
237
  setUpdateThrottleMs: (ms: number) => void;
213
238
  getUpdateThrottleMs: () => number;
214
239
  getCode: () => MonacoCodeValue;
@@ -284,7 +309,7 @@ declare function registerMonacoThemes(themes: (ThemeInput | string | SpecialThem
284
309
  * @param {MonacoLanguage[]} [monacoOptions.languages] - 支持的编程语言数组
285
310
  * @param {string} [monacoOptions.theme] - 初始主题名称
286
311
  * @param {boolean} [monacoOptions.isCleanOnBeforeCreate] - 是否在创建前清理之前注册的资源, 默认为 true
287
- * @param {(monaco: typeof import('monaco-editor')) => monaco.IDisposable[]} [monacoOptions.onBeforeCreate] - 编辑器创建前的钩子函数
312
+ * @param {(monaco: typeof import('monaco-editor/esm/vs/editor/editor.api')) => monaco.IDisposable[]} [monacoOptions.onBeforeCreate] - 编辑器创建前的钩子函数
288
313
  *
289
314
  * @returns {{
290
315
  * createEditor: (container: HTMLElement, code: string, language: string) => Promise<monaco.editor.IStandaloneCodeEditor>,
package/dist/index.cjs CHANGED
@@ -1,4 +1,4 @@
1
- const require_preloadMonacoWorkers_shared = require('./preloadMonacoWorkers.shared-DoDO6Bui.cjs');
1
+ const require_preloadMonacoWorkers_shared = require('./preloadMonacoWorkers.shared-CASMnPWz.cjs');
2
2
 
3
3
  //#region src/ensureMonacoWorkers.ts
4
4
  function ensureMonacoWorkers() {
package/dist/index.d.cts CHANGED
@@ -1,4 +1,4 @@
1
- import { DiffAppearance, DiffCodeValue, DiffHideUnchangedRegions, DiffHunkActionContext, DiffHunkActionKind, DiffHunkSide, DiffLineStyle, DiffModelPair, DiffModelTransitionOptions, DiffModels, DiffUnchangedRegionStyle, MonacoCodeValue, MonacoDiffEditorInstance, MonacoEditorInstance, MonacoLanguage, MonacoOptions, MonacoTheme, RevealStrategy, ShikiHighlighter, UseMonacoReturn, clearHighlighterCache, defaultRevealDebounceMs, detectLanguage, getOrCreateHighlighter, registerMonacoThemes, useMonaco } from "./index.base-uTGkC8S0.cjs";
1
+ import { DiffAppearance, DiffCodeValue, DiffHideUnchangedRegions, DiffHunkActionContext, DiffHunkActionKind, DiffHunkSide, DiffLineStyle, DiffModelPair, DiffModelTransitionOptions, DiffModels, DiffUnchangedRegionStyle, MonacoCodeValue, MonacoDiffEditorInstance, MonacoEditorInstance, MonacoLanguage, MonacoOptions, MonacoTheme, RevealStrategy, ShikiHighlighter, UseMonacoReturn, clearHighlighterCache, defaultRevealDebounceMs, detectLanguage, getOrCreateHighlighter, registerMonacoThemes, useMonaco } from "./index.base-CovAkDA-.cjs";
2
2
 
3
3
  //#region src/ensureMonacoWorkers.d.ts
4
4
  declare function ensureMonacoWorkers(): void;
package/dist/index.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- import { DiffAppearance, DiffCodeValue, DiffHideUnchangedRegions, DiffHunkActionContext, DiffHunkActionKind, DiffHunkSide, DiffLineStyle, DiffModelPair, DiffModelTransitionOptions, DiffModels, DiffUnchangedRegionStyle, MonacoCodeValue, MonacoDiffEditorInstance, MonacoEditorInstance, MonacoLanguage, MonacoOptions, MonacoTheme, RevealStrategy, ShikiHighlighter, UseMonacoReturn, clearHighlighterCache, defaultRevealDebounceMs, detectLanguage, getOrCreateHighlighter, registerMonacoThemes, useMonaco } from "./index.base-BB334pQY.js";
1
+ import { DiffAppearance, DiffCodeValue, DiffHideUnchangedRegions, DiffHunkActionContext, DiffHunkActionKind, DiffHunkSide, DiffLineStyle, DiffModelPair, DiffModelTransitionOptions, DiffModels, DiffUnchangedRegionStyle, MonacoCodeValue, MonacoDiffEditorInstance, MonacoEditorInstance, MonacoLanguage, MonacoOptions, MonacoTheme, RevealStrategy, ShikiHighlighter, UseMonacoReturn, clearHighlighterCache, defaultRevealDebounceMs, detectLanguage, getOrCreateHighlighter, registerMonacoThemes, useMonaco } from "./index.base-CGq2Nep1.js";
2
2
 
3
3
  //#region src/ensureMonacoWorkers.d.ts
4
4
  declare function ensureMonacoWorkers(): void;
package/dist/index.js CHANGED
@@ -1,4 +1,4 @@
1
- import { RevealStrategy, clearHighlighterCache, defaultRevealDebounceMs, detectLanguage, editorWorkerPath, getOrCreateHighlighter, registerMonacoThemes, uniqueWorkerPaths, useMonaco, workerPathByLabel } from "./preloadMonacoWorkers.shared-f9Ole_8P.js";
1
+ import { RevealStrategy, clearHighlighterCache, defaultRevealDebounceMs, detectLanguage, editorWorkerPath, getOrCreateHighlighter, registerMonacoThemes, uniqueWorkerPaths, useMonaco, workerPathByLabel } from "./preloadMonacoWorkers.shared-C6J5pk0l.js";
2
2
 
3
3
  //#region src/ensureMonacoWorkers.ts
4
4
  function ensureMonacoWorkers() {
@@ -1,4 +1,4 @@
1
- const require_preloadMonacoWorkers_shared = require('./preloadMonacoWorkers.shared-DoDO6Bui.cjs');
1
+ const require_preloadMonacoWorkers_shared = require('./preloadMonacoWorkers.shared-CASMnPWz.cjs');
2
2
  const monaco_editor_esm_vs_basic_languages_cpp_cpp = require_preloadMonacoWorkers_shared.__toESM(require("monaco-editor/esm/vs/basic-languages/cpp/cpp"));
3
3
  const monaco_editor_esm_vs_basic_languages_javascript_javascript = require_preloadMonacoWorkers_shared.__toESM(require("monaco-editor/esm/vs/basic-languages/javascript/javascript"));
4
4
  const monaco_editor_esm_vs_basic_languages_powershell_powershell = require_preloadMonacoWorkers_shared.__toESM(require("monaco-editor/esm/vs/basic-languages/powershell/powershell"));
@@ -1,4 +1,4 @@
1
- import { DiffAppearance, DiffCodeValue, DiffHideUnchangedRegions, DiffHunkActionContext, DiffHunkActionKind, DiffHunkSide, DiffLineStyle, DiffModelPair, DiffModelTransitionOptions, DiffModels, DiffUnchangedRegionStyle, MonacoCodeValue, MonacoDiffEditorInstance, MonacoEditorInstance, MonacoLanguage, MonacoOptions, MonacoTheme, RevealStrategy, ShikiHighlighter, UseMonacoReturn, clearHighlighterCache, defaultRevealDebounceMs, detectLanguage, getOrCreateHighlighter, registerMonacoThemes, useMonaco } from "./index.base-uTGkC8S0.cjs";
1
+ import { DiffAppearance, DiffCodeValue, DiffHideUnchangedRegions, DiffHunkActionContext, DiffHunkActionKind, DiffHunkSide, DiffLineStyle, DiffModelPair, DiffModelTransitionOptions, DiffModels, DiffUnchangedRegionStyle, MonacoCodeValue, MonacoDiffEditorInstance, MonacoEditorInstance, MonacoLanguage, MonacoOptions, MonacoTheme, RevealStrategy, ShikiHighlighter, UseMonacoReturn, clearHighlighterCache, defaultRevealDebounceMs, detectLanguage, getOrCreateHighlighter, registerMonacoThemes, useMonaco } from "./index.base-CovAkDA-.cjs";
2
2
 
3
3
  //#region src/ensureMonacoWorkers.legacy.d.ts
4
4
  declare function ensureMonacoWorkersLegacy(options?: {
@@ -1,4 +1,4 @@
1
- import { DiffAppearance, DiffCodeValue, DiffHideUnchangedRegions, DiffHunkActionContext, DiffHunkActionKind, DiffHunkSide, DiffLineStyle, DiffModelPair, DiffModelTransitionOptions, DiffModels, DiffUnchangedRegionStyle, MonacoCodeValue, MonacoDiffEditorInstance, MonacoEditorInstance, MonacoLanguage, MonacoOptions, MonacoTheme, RevealStrategy, ShikiHighlighter, UseMonacoReturn, clearHighlighterCache, defaultRevealDebounceMs, detectLanguage, getOrCreateHighlighter, registerMonacoThemes, useMonaco } from "./index.base-BB334pQY.js";
1
+ import { DiffAppearance, DiffCodeValue, DiffHideUnchangedRegions, DiffHunkActionContext, DiffHunkActionKind, DiffHunkSide, DiffLineStyle, DiffModelPair, DiffModelTransitionOptions, DiffModels, DiffUnchangedRegionStyle, MonacoCodeValue, MonacoDiffEditorInstance, MonacoEditorInstance, MonacoLanguage, MonacoOptions, MonacoTheme, RevealStrategy, ShikiHighlighter, UseMonacoReturn, clearHighlighterCache, defaultRevealDebounceMs, detectLanguage, getOrCreateHighlighter, registerMonacoThemes, useMonaco } from "./index.base-CGq2Nep1.js";
2
2
  import "monaco-editor/esm/vs/basic-languages/javascript/javascript.contribution";
3
3
  import "monaco-editor/esm/vs/basic-languages/typescript/typescript.contribution";
4
4
  import "monaco-editor/esm/vs/basic-languages/python/python.contribution";
@@ -1,4 +1,4 @@
1
- import { RevealStrategy, clearHighlighterCache, defaultRevealDebounceMs, detectLanguage, getOrCreateHighlighter, monaco_shim_exports, processedLanguage, registerMonacoThemes, useMonaco, workerPathByLabel } from "./preloadMonacoWorkers.shared-f9Ole_8P.js";
1
+ import { RevealStrategy, clearHighlighterCache, defaultRevealDebounceMs, detectLanguage, getOrCreateHighlighter, monaco_shim_exports, processedLanguage, registerMonacoThemes, useMonaco, workerPathByLabel } from "./preloadMonacoWorkers.shared-C6J5pk0l.js";
2
2
  import { conf, language } from "monaco-editor/esm/vs/basic-languages/cpp/cpp";
3
3
  import { conf as conf$1, language as language$1 } from "monaco-editor/esm/vs/basic-languages/javascript/javascript";
4
4
  import { conf as conf$2, language as language$2 } from "monaco-editor/esm/vs/basic-languages/powershell/powershell";