@simon_he/vue-tui 1.1.4 → 1.1.5

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.
@@ -3,5 +3,5 @@ export { isSimpleMermaidFlowchartSource, markMermaidRenderErrorFatal, } from "./
3
3
  export { beautifulMermaidRenderer, createBeautifulMermaidRenderer, TBeautifulMermaid, TBeautifulMermaidText, TMermaid, TMermaidText, } from "./vue/mermaid/beautiful-mermaid.js";
4
4
  export { TMermaidImage } from "./vue/components/TMermaidImage.js";
5
5
  export type { TMermaidImageCopyPayload, TMermaidImageProps, } from "./vue/components/TMermaidImage.js";
6
- export { clearMermaidImageCache, getCachedMermaidImage, getMermaidImage, isMermaidImageRendererReady, loadMermaidImageRenderer, normalizeMermaidImageOptions, resolveMermaidImageColor, setMermaidImageRasterizer, subscribeMermaidImage, } from "./vue/mermaid/mermaid-image.js";
6
+ export { clearMermaidImageCache, getCachedMermaidImage, getMermaidImage, isMermaidImageRendererReady, loadMermaidImageRenderer, normalizeMermaidImageOptions, resolveMermaidImageColor, resolveMermaidSvgForResvg, setMermaidImageRasterizer, subscribeMermaidImage, } from "./vue/mermaid/mermaid-image.js";
7
7
  export type { TuiMermaidImageCells, TuiMermaidImageOptions, TuiMermaidImageRasterizer, } from "./vue/mermaid/mermaid-image.js";
package/dist/mermaid.d.ts CHANGED
@@ -3,5 +3,5 @@ export { isSimpleMermaidFlowchartSource, markMermaidRenderErrorFatal, } from "./
3
3
  export { beautifulMermaidRenderer, createBeautifulMermaidRenderer, TBeautifulMermaid, TBeautifulMermaidText, TMermaid, TMermaidText, } from "./vue/mermaid/beautiful-mermaid.js";
4
4
  export { TMermaidImage } from "./vue/components/TMermaidImage.js";
5
5
  export type { TMermaidImageCopyPayload, TMermaidImageProps, } from "./vue/components/TMermaidImage.js";
6
- export { clearMermaidImageCache, getCachedMermaidImage, getMermaidImage, isMermaidImageRendererReady, loadMermaidImageRenderer, normalizeMermaidImageOptions, resolveMermaidImageColor, setMermaidImageRasterizer, subscribeMermaidImage, } from "./vue/mermaid/mermaid-image.js";
6
+ export { clearMermaidImageCache, getCachedMermaidImage, getMermaidImage, isMermaidImageRendererReady, loadMermaidImageRenderer, normalizeMermaidImageOptions, resolveMermaidImageColor, resolveMermaidSvgForResvg, setMermaidImageRasterizer, subscribeMermaidImage, } from "./vue/mermaid/mermaid-image.js";
7
7
  export type { TuiMermaidImageCells, TuiMermaidImageOptions, TuiMermaidImageRasterizer, } from "./vue/mermaid/mermaid-image.js";
package/dist/mermaid.js CHANGED
@@ -1,8 +1,8 @@
1
1
  import "./create-terminal-Db_-UGVQ.js";
2
2
  import "./rect-JzWMJxxc.js";
3
3
  import { isSimpleMermaidFlowchartSource, markMermaidRenderErrorFatal } from "./TMermaidText-wLnMMvVS.js";
4
- import "./terminal-graphics-DWZrl3oh.js";
4
+ import "./terminal-graphics-2FTRg9x3.js";
5
5
  import "./math-image-BZhmfUeu.js";
6
- import { TBeautifulMermaid, TBeautifulMermaidText, TMermaid, TMermaidImage, TMermaidText, beautifulMermaidRenderer, clearMermaidImageCache, createBeautifulMermaidRenderer, getCachedMermaidImage, getMermaidImage, isMermaidImageRendererReady, loadMermaidImageRenderer, normalizeMermaidImageOptions, resolveMermaidImageColor, setMermaidImageRasterizer, subscribeMermaidImage } from "./mermaid-uEfRItDe.js";
6
+ import { TBeautifulMermaid, TBeautifulMermaidText, TMermaid, TMermaidImage, TMermaidText, beautifulMermaidRenderer, clearMermaidImageCache, createBeautifulMermaidRenderer, getCachedMermaidImage, getMermaidImage, isMermaidImageRendererReady, loadMermaidImageRenderer, normalizeMermaidImageOptions, resolveMermaidImageColor, resolveMermaidSvgForResvg, setMermaidImageRasterizer, subscribeMermaidImage } from "./mermaid-N3kGTHFy.js";
7
7
 
8
- export { TBeautifulMermaid, TBeautifulMermaidText, TMermaid, TMermaidImage, TMermaidText, beautifulMermaidRenderer, clearMermaidImageCache, createBeautifulMermaidRenderer, getCachedMermaidImage, getMermaidImage, isMermaidImageRendererReady, isSimpleMermaidFlowchartSource, loadMermaidImageRenderer, markMermaidRenderErrorFatal, normalizeMermaidImageOptions, resolveMermaidImageColor, setMermaidImageRasterizer, subscribeMermaidImage };
8
+ export { TBeautifulMermaid, TBeautifulMermaidText, TMermaid, TMermaidImage, TMermaidText, beautifulMermaidRenderer, clearMermaidImageCache, createBeautifulMermaidRenderer, getCachedMermaidImage, getMermaidImage, isMermaidImageRendererReady, isSimpleMermaidFlowchartSource, loadMermaidImageRenderer, markMermaidRenderErrorFatal, normalizeMermaidImageOptions, resolveMermaidImageColor, resolveMermaidSvgForResvg, setMermaidImageRasterizer, subscribeMermaidImage };
@@ -162,6 +162,23 @@ export type CreateTerminalGraphicPngSequenceOptions = Readonly<{
162
162
  sourceHeight?: number;
163
163
  placementColumns?: number;
164
164
  placementRows?: number;
165
+ /**
166
+ * Optional placement used by the initial transmission (a=T). Defaults to
167
+ * `placementColumns` / `placementRows`. When the resize placement changes
168
+ * over time (e.g. mermaid wheel zoom), keep this stable so the stdout
169
+ * renderer can replace the placement with the resize sequence instead of
170
+ * re-sending the PNG (the renderer compares the full transmission string).
171
+ */
172
+ transmissionColumns?: number;
173
+ transmissionRows?: number;
174
+ /**
175
+ * Whether the initial transmission (a=T) carries the source crop. Defaults
176
+ * to `true` (current behavior). Set to `false` when the same image must be
177
+ * re-placed with different crops later (e.g. wheel zoom): the transmission
178
+ * then stores the full image so every resize placement can reference any
179
+ * region of it.
180
+ */
181
+ cropTransmission?: boolean;
165
182
  rect?: TerminalGraphicPngViewport;
166
183
  fullRect?: TerminalGraphicPngViewport;
167
184
  zIndex?: number;
@@ -630,6 +630,11 @@ function createTerminalGraphicPngSequence(options) {
630
630
  ...crop
631
631
  };
632
632
  }
633
+ const cropTransmission = options.cropTransmission !== false;
634
+ const transmissionPlacement = cropTransmission ? placement : {
635
+ columns: options.transmissionColumns ?? options.placementColumns,
636
+ rows: options.transmissionRows ?? options.placementRows
637
+ };
633
638
  return {
634
639
  type: "sequence",
635
640
  protocol: "kitty",
@@ -637,7 +642,7 @@ function createTerminalGraphicPngSequence(options) {
637
642
  imageId: options.imageId,
638
643
  placementId: options.placementId,
639
644
  zIndex: options.zIndex,
640
- ...placement
645
+ ...transmissionPlacement
641
646
  }),
642
647
  resizeSequence: createKittyPlacementSequence({
643
648
  imageId: options.imageId,
@@ -5,7 +5,7 @@ import { TView, TuiThemeContextKey, createFrameMailbox, defaultActiveStyle, link
5
5
  import { framePerfNow } from "./frame-perf-CHpWhbC4.js";
6
6
  import { terminalSelectionRowSpans, terminalSelectionVisibleRowSpans } from "./terminal-selection-4W1SJj4c.js";
7
7
  import { applyWheelScroll, createWheelScrollState, resetWheelScrollState } from "./wheel-scroll-DASkEZr-.js";
8
- import { canDrawTerminalGraphicRect, createKittyDeleteGraphicsSequence, createKittyPlacementSequence, getTerminalGraphicsOutput, getTerminalGraphicsOutputVersion, isSafeTerminalGraphicsSequence, isTerminalGraphicsProtocol, normalizeTerminalGraphicSize, sanitizeTerminalFallbackText, stableTerminalGraphicNumericId, subscribeTerminalGraphicsOutput } from "./terminal-graphics-DWZrl3oh.js";
8
+ import { canDrawTerminalGraphicRect, createKittyDeleteGraphicsSequence, createKittyPlacementSequence, getTerminalGraphicsOutput, getTerminalGraphicsOutputVersion, isSafeTerminalGraphicsSequence, isTerminalGraphicsProtocol, normalizeTerminalGraphicSize, sanitizeTerminalFallbackText, stableTerminalGraphicNumericId, subscribeTerminalGraphicsOutput } from "./terminal-graphics-2FTRg9x3.js";
9
9
  import { computed, defineComponent, getCurrentInstance, h, inject, markRaw, onBeforeUnmount, provide, ref, shallowReactive, shallowRef, watch, watchEffect } from "vue";
10
10
 
11
11
  //#region src/vue/utils/row-scroll.ts
@@ -1,5 +1,6 @@
1
1
  import type { ExtractPublicPropTypes, PropType } from "vue";
2
2
  import type { Style } from "../../core/types.js";
3
+ import type { TMermaidAsciiOptions, TMermaidRenderEligibility, TMermaidRenderer } from "./TMermaidText.js";
3
4
  import { type TuiMermaidImageRasterizer } from "../mermaid/mermaid-image.js";
4
5
  export type TMermaidImageCopyPayload = Readonly<{
5
6
  text: string;
@@ -87,6 +88,18 @@ export declare const tMermaidImageProps: {
87
88
  readonly type: NumberConstructor;
88
89
  readonly default: undefined;
89
90
  };
91
+ readonly textRenderer: {
92
+ readonly type: PropType<TMermaidRenderer>;
93
+ readonly default: undefined;
94
+ };
95
+ readonly shouldRenderSource: {
96
+ readonly type: PropType<TMermaidRenderEligibility>;
97
+ readonly default: undefined;
98
+ };
99
+ readonly textOptions: {
100
+ readonly type: PropType<TMermaidAsciiOptions>;
101
+ readonly default: undefined;
102
+ };
90
103
  readonly box: {
91
104
  readonly type: BooleanConstructor;
92
105
  readonly default: true;
@@ -131,6 +144,26 @@ export declare const tMermaidImageProps: {
131
144
  readonly type: BooleanConstructor;
132
145
  readonly default: false;
133
146
  };
147
+ readonly zoomOnWheel: {
148
+ readonly type: BooleanConstructor;
149
+ readonly default: true;
150
+ };
151
+ readonly zoomModifier: {
152
+ readonly type: PropType<"meta" | "ctrl" | "metaCtrl" | "none">;
153
+ readonly default: "metaCtrl";
154
+ };
155
+ readonly minZoom: {
156
+ readonly type: NumberConstructor;
157
+ readonly default: 1;
158
+ };
159
+ readonly maxZoom: {
160
+ readonly type: NumberConstructor;
161
+ readonly default: 6;
162
+ };
163
+ readonly zoomSensitivity: {
164
+ readonly type: NumberConstructor;
165
+ readonly default: 0.002;
166
+ };
134
167
  };
135
168
  export type TMermaidImageProps = ExtractPublicPropTypes<typeof tMermaidImageProps>;
136
169
  export declare const TMermaidImage: import("vue").DefineComponent<import("vue").ExtractPropTypes<{
@@ -214,6 +247,18 @@ export declare const TMermaidImage: import("vue").DefineComponent<import("vue").
214
247
  readonly type: NumberConstructor;
215
248
  readonly default: undefined;
216
249
  };
250
+ readonly textRenderer: {
251
+ readonly type: PropType<TMermaidRenderer>;
252
+ readonly default: undefined;
253
+ };
254
+ readonly shouldRenderSource: {
255
+ readonly type: PropType<TMermaidRenderEligibility>;
256
+ readonly default: undefined;
257
+ };
258
+ readonly textOptions: {
259
+ readonly type: PropType<TMermaidAsciiOptions>;
260
+ readonly default: undefined;
261
+ };
217
262
  readonly box: {
218
263
  readonly type: BooleanConstructor;
219
264
  readonly default: true;
@@ -258,6 +303,26 @@ export declare const TMermaidImage: import("vue").DefineComponent<import("vue").
258
303
  readonly type: BooleanConstructor;
259
304
  readonly default: false;
260
305
  };
306
+ readonly zoomOnWheel: {
307
+ readonly type: BooleanConstructor;
308
+ readonly default: true;
309
+ };
310
+ readonly zoomModifier: {
311
+ readonly type: PropType<"meta" | "ctrl" | "metaCtrl" | "none">;
312
+ readonly default: "metaCtrl";
313
+ };
314
+ readonly minZoom: {
315
+ readonly type: NumberConstructor;
316
+ readonly default: 1;
317
+ };
318
+ readonly maxZoom: {
319
+ readonly type: NumberConstructor;
320
+ readonly default: 6;
321
+ };
322
+ readonly zoomSensitivity: {
323
+ readonly type: NumberConstructor;
324
+ readonly default: 0.002;
325
+ };
261
326
  }>, () => import("vue").VNode<import("vue").RendererNode, import("vue").RendererElement, {
262
327
  [key: string]: any;
263
328
  }>, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
@@ -343,6 +408,18 @@ export declare const TMermaidImage: import("vue").DefineComponent<import("vue").
343
408
  readonly type: NumberConstructor;
344
409
  readonly default: undefined;
345
410
  };
411
+ readonly textRenderer: {
412
+ readonly type: PropType<TMermaidRenderer>;
413
+ readonly default: undefined;
414
+ };
415
+ readonly shouldRenderSource: {
416
+ readonly type: PropType<TMermaidRenderEligibility>;
417
+ readonly default: undefined;
418
+ };
419
+ readonly textOptions: {
420
+ readonly type: PropType<TMermaidAsciiOptions>;
421
+ readonly default: undefined;
422
+ };
346
423
  readonly box: {
347
424
  readonly type: BooleanConstructor;
348
425
  readonly default: true;
@@ -387,6 +464,26 @@ export declare const TMermaidImage: import("vue").DefineComponent<import("vue").
387
464
  readonly type: BooleanConstructor;
388
465
  readonly default: false;
389
466
  };
467
+ readonly zoomOnWheel: {
468
+ readonly type: BooleanConstructor;
469
+ readonly default: true;
470
+ };
471
+ readonly zoomModifier: {
472
+ readonly type: PropType<"meta" | "ctrl" | "metaCtrl" | "none">;
473
+ readonly default: "metaCtrl";
474
+ };
475
+ readonly minZoom: {
476
+ readonly type: NumberConstructor;
477
+ readonly default: 1;
478
+ };
479
+ readonly maxZoom: {
480
+ readonly type: NumberConstructor;
481
+ readonly default: 6;
482
+ };
483
+ readonly zoomSensitivity: {
484
+ readonly type: NumberConstructor;
485
+ readonly default: 0.002;
486
+ };
390
487
  }>> & Readonly<{
391
488
  onCopy?: ((_payload: Readonly<{
392
489
  text: string;
@@ -421,6 +518,7 @@ export declare const TMermaidImage: import("vue").DefineComponent<import("vue").
421
518
  readonly scale: number;
422
519
  readonly maxWidthCells: number;
423
520
  readonly ascii: boolean;
521
+ readonly shouldRenderSource: TMermaidRenderEligibility;
424
522
  readonly box: boolean;
425
523
  readonly copyButton: boolean;
426
524
  readonly copyText: string;
@@ -429,8 +527,20 @@ export declare const TMermaidImage: import("vue").DefineComponent<import("vue").
429
527
  readonly maxRenderSourceChars: number;
430
528
  readonly maxRenderSourceLines: number;
431
529
  readonly copiedDurationMs: number;
530
+ readonly minZoom: number;
531
+ readonly maxZoom: number;
532
+ readonly zoomSensitivity: number;
432
533
  readonly maxHeightCells: number;
534
+ readonly textRenderer: TMermaidRenderer;
535
+ readonly textOptions: Readonly<{
536
+ paddingX?: number;
537
+ paddingY?: number;
538
+ boxBorderPadding?: number;
539
+ theme?: import("./TMermaidText.js").TMermaidAsciiTheme;
540
+ }>;
433
541
  readonly copyOnClick: boolean;
542
+ readonly zoomOnWheel: boolean;
543
+ readonly zoomModifier: "none" | "meta" | "ctrl" | "metaCtrl";
434
544
  }, {}>;
435
545
  export declare const TMermaidImageText: import("vue").DefineComponent<import("vue").ExtractPropTypes<{
436
546
  readonly x: {
@@ -513,6 +623,18 @@ export declare const TMermaidImageText: import("vue").DefineComponent<import("vu
513
623
  readonly type: NumberConstructor;
514
624
  readonly default: undefined;
515
625
  };
626
+ readonly textRenderer: {
627
+ readonly type: PropType<TMermaidRenderer>;
628
+ readonly default: undefined;
629
+ };
630
+ readonly shouldRenderSource: {
631
+ readonly type: PropType<TMermaidRenderEligibility>;
632
+ readonly default: undefined;
633
+ };
634
+ readonly textOptions: {
635
+ readonly type: PropType<TMermaidAsciiOptions>;
636
+ readonly default: undefined;
637
+ };
516
638
  readonly box: {
517
639
  readonly type: BooleanConstructor;
518
640
  readonly default: true;
@@ -557,6 +679,26 @@ export declare const TMermaidImageText: import("vue").DefineComponent<import("vu
557
679
  readonly type: BooleanConstructor;
558
680
  readonly default: false;
559
681
  };
682
+ readonly zoomOnWheel: {
683
+ readonly type: BooleanConstructor;
684
+ readonly default: true;
685
+ };
686
+ readonly zoomModifier: {
687
+ readonly type: PropType<"meta" | "ctrl" | "metaCtrl" | "none">;
688
+ readonly default: "metaCtrl";
689
+ };
690
+ readonly minZoom: {
691
+ readonly type: NumberConstructor;
692
+ readonly default: 1;
693
+ };
694
+ readonly maxZoom: {
695
+ readonly type: NumberConstructor;
696
+ readonly default: 6;
697
+ };
698
+ readonly zoomSensitivity: {
699
+ readonly type: NumberConstructor;
700
+ readonly default: 0.002;
701
+ };
560
702
  }>, () => import("vue").VNode<import("vue").RendererNode, import("vue").RendererElement, {
561
703
  [key: string]: any;
562
704
  }>, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
@@ -642,6 +784,18 @@ export declare const TMermaidImageText: import("vue").DefineComponent<import("vu
642
784
  readonly type: NumberConstructor;
643
785
  readonly default: undefined;
644
786
  };
787
+ readonly textRenderer: {
788
+ readonly type: PropType<TMermaidRenderer>;
789
+ readonly default: undefined;
790
+ };
791
+ readonly shouldRenderSource: {
792
+ readonly type: PropType<TMermaidRenderEligibility>;
793
+ readonly default: undefined;
794
+ };
795
+ readonly textOptions: {
796
+ readonly type: PropType<TMermaidAsciiOptions>;
797
+ readonly default: undefined;
798
+ };
645
799
  readonly box: {
646
800
  readonly type: BooleanConstructor;
647
801
  readonly default: true;
@@ -686,6 +840,26 @@ export declare const TMermaidImageText: import("vue").DefineComponent<import("vu
686
840
  readonly type: BooleanConstructor;
687
841
  readonly default: false;
688
842
  };
843
+ readonly zoomOnWheel: {
844
+ readonly type: BooleanConstructor;
845
+ readonly default: true;
846
+ };
847
+ readonly zoomModifier: {
848
+ readonly type: PropType<"meta" | "ctrl" | "metaCtrl" | "none">;
849
+ readonly default: "metaCtrl";
850
+ };
851
+ readonly minZoom: {
852
+ readonly type: NumberConstructor;
853
+ readonly default: 1;
854
+ };
855
+ readonly maxZoom: {
856
+ readonly type: NumberConstructor;
857
+ readonly default: 6;
858
+ };
859
+ readonly zoomSensitivity: {
860
+ readonly type: NumberConstructor;
861
+ readonly default: 0.002;
862
+ };
689
863
  }>> & Readonly<{
690
864
  onCopy?: ((_payload: Readonly<{
691
865
  text: string;
@@ -720,6 +894,7 @@ export declare const TMermaidImageText: import("vue").DefineComponent<import("vu
720
894
  readonly scale: number;
721
895
  readonly maxWidthCells: number;
722
896
  readonly ascii: boolean;
897
+ readonly shouldRenderSource: TMermaidRenderEligibility;
723
898
  readonly box: boolean;
724
899
  readonly copyButton: boolean;
725
900
  readonly copyText: string;
@@ -728,6 +903,18 @@ export declare const TMermaidImageText: import("vue").DefineComponent<import("vu
728
903
  readonly maxRenderSourceChars: number;
729
904
  readonly maxRenderSourceLines: number;
730
905
  readonly copiedDurationMs: number;
906
+ readonly minZoom: number;
907
+ readonly maxZoom: number;
908
+ readonly zoomSensitivity: number;
731
909
  readonly maxHeightCells: number;
910
+ readonly textRenderer: TMermaidRenderer;
911
+ readonly textOptions: Readonly<{
912
+ paddingX?: number;
913
+ paddingY?: number;
914
+ boxBorderPadding?: number;
915
+ theme?: import("./TMermaidText.js").TMermaidAsciiTheme;
916
+ }>;
732
917
  readonly copyOnClick: boolean;
918
+ readonly zoomOnWheel: boolean;
919
+ readonly zoomModifier: "none" | "meta" | "ctrl" | "metaCtrl";
733
920
  }, {}>;