@xterm/addon-image 0.10.0-beta.30 → 0.10.0-beta.301
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 +40 -42
- package/lib/addon-image.js +1 -1
- package/lib/addon-image.js.map +1 -1
- package/lib/addon-image.mjs +1 -22
- package/lib/addon-image.mjs.map +4 -4
- package/package.json +5 -5
- package/src/IIPHandler.ts +124 -47
- package/src/IIPHeaderParser.ts +89 -13
- package/src/IIPImageStorage.ts +28 -0
- package/src/IIPMetrics.ts +71 -5
- package/src/ImageAddon.ts +74 -13
- package/src/ImageRenderer.ts +99 -53
- package/src/ImageStorage.ts +151 -172
- package/src/SixelHandler.ts +4 -4
- package/src/SixelImageStorage.ts +52 -0
- package/src/Types.ts +19 -18
- package/src/kitty/KittyGraphicsHandler.ts +819 -0
- package/src/kitty/KittyGraphicsTypes.ts +195 -0
- package/src/kitty/KittyImageStorage.ts +155 -0
- package/typings/addon-image.d.ts +15 -1
package/src/Types.ts
CHANGED
|
@@ -8,8 +8,8 @@ import { IDisposable, IMarker, Terminal } from '@xterm/xterm';
|
|
|
8
8
|
// private imports from base repo we build against
|
|
9
9
|
import { Attributes, BgFlags, Content, ExtFlags, UnderlineStyle } from 'common/buffer/Constants';
|
|
10
10
|
import type { AttributeData } from 'common/buffer/AttributeData';
|
|
11
|
-
import type { IParams, IDcsHandler, IOscHandler, IEscapeSequenceParser } from 'common/parser/Types';
|
|
12
|
-
import type {
|
|
11
|
+
import type { IParams, IDcsHandler, IOscHandler, IApcHandler, IEscapeSequenceParser } from 'common/parser/Types';
|
|
12
|
+
import type { IInputHandler } from 'common/Types';
|
|
13
13
|
import type { ITerminal, ReadonlyColorSet } from 'browser/Types';
|
|
14
14
|
import type { IRenderDimensions } from 'browser/renderer/shared/Types';
|
|
15
15
|
import type { ICoreBrowserService, IRenderService, IThemeService } from 'browser/services/Services';
|
|
@@ -22,7 +22,7 @@ export const enum Cell {
|
|
|
22
22
|
}
|
|
23
23
|
|
|
24
24
|
// export some privates for local usage
|
|
25
|
-
export { AttributeData, IParams, IDcsHandler, IOscHandler, BgFlags, IRenderDimensions, IRenderService, Content, ExtFlags, Attributes, UnderlineStyle, ReadonlyColorSet };
|
|
25
|
+
export { AttributeData, IParams, IDcsHandler, IOscHandler, IApcHandler, BgFlags, IRenderDimensions, IRenderService, Content, ExtFlags, Attributes, UnderlineStyle, ReadonlyColorSet };
|
|
26
26
|
|
|
27
27
|
/**
|
|
28
28
|
* Plugin ctor options.
|
|
@@ -38,6 +38,8 @@ export interface IImageAddonOptions {
|
|
|
38
38
|
sixelSizeLimit: number;
|
|
39
39
|
iipSupport: boolean;
|
|
40
40
|
iipSizeLimit: number;
|
|
41
|
+
kittySupport: boolean;
|
|
42
|
+
kittySizeLimit: number;
|
|
41
43
|
}
|
|
42
44
|
|
|
43
45
|
export interface IResetHandler {
|
|
@@ -45,6 +47,7 @@ export interface IResetHandler {
|
|
|
45
47
|
reset(): void;
|
|
46
48
|
}
|
|
47
49
|
|
|
50
|
+
/* eslint-disable */
|
|
48
51
|
/**
|
|
49
52
|
* Stub into private interfaces.
|
|
50
53
|
* This should be kept in line with common libs.
|
|
@@ -52,19 +55,6 @@ export interface IResetHandler {
|
|
|
52
55
|
* have a somewhat reliable testing against code changes in the core repo.
|
|
53
56
|
*/
|
|
54
57
|
|
|
55
|
-
// overloaded IExtendedAttrs to hold image refs
|
|
56
|
-
export interface IExtendedAttrsImage extends IExtendedAttrs {
|
|
57
|
-
imageId: number;
|
|
58
|
-
tileId: number;
|
|
59
|
-
clone(): IExtendedAttrsImage;
|
|
60
|
-
}
|
|
61
|
-
|
|
62
|
-
/* eslint-disable */
|
|
63
|
-
export interface IBufferLineExt extends IBufferLine {
|
|
64
|
-
_extendedAttrs: {[index: number]: IExtendedAttrsImage | undefined};
|
|
65
|
-
_data: Uint32Array;
|
|
66
|
-
}
|
|
67
|
-
|
|
68
58
|
interface IInputHandlerExt extends IInputHandler {
|
|
69
59
|
_parser: IEscapeSequenceParser;
|
|
70
60
|
_curAttrData: AttributeData;
|
|
@@ -75,6 +65,7 @@ interface IInputHandlerExt extends IInputHandler {
|
|
|
75
65
|
};
|
|
76
66
|
onRequestReset(handler: () => void): IDisposable;
|
|
77
67
|
}
|
|
68
|
+
/* eslint-enable */
|
|
78
69
|
|
|
79
70
|
export interface ICoreTerminalExt extends ITerminal {
|
|
80
71
|
_themeService: IThemeService | undefined;
|
|
@@ -86,8 +77,6 @@ export interface ICoreTerminalExt extends ITerminal {
|
|
|
86
77
|
export interface ITerminalExt extends Terminal {
|
|
87
78
|
_core: ICoreTerminalExt;
|
|
88
79
|
}
|
|
89
|
-
/* eslint-enable */
|
|
90
|
-
|
|
91
80
|
|
|
92
81
|
/**
|
|
93
82
|
* Some storage definitions.
|
|
@@ -97,6 +86,16 @@ export interface ICellSize {
|
|
|
97
86
|
height: number;
|
|
98
87
|
}
|
|
99
88
|
|
|
89
|
+
export type ImageLayer = 'top' | 'bottom';
|
|
90
|
+
export type CursorPos = 'vt340' | 'iip';
|
|
91
|
+
|
|
92
|
+
export interface IAddImageOpts {
|
|
93
|
+
scrolling: boolean;
|
|
94
|
+
layer: ImageLayer;
|
|
95
|
+
zIndex: number;
|
|
96
|
+
cursorPos: CursorPos;
|
|
97
|
+
}
|
|
98
|
+
|
|
100
99
|
export interface IImageSpec {
|
|
101
100
|
orig: HTMLCanvasElement | ImageBitmap | undefined;
|
|
102
101
|
origCellSize: ICellSize;
|
|
@@ -105,4 +104,6 @@ export interface IImageSpec {
|
|
|
105
104
|
marker: IMarker | undefined;
|
|
106
105
|
tileCount: number;
|
|
107
106
|
bufferType: 'alternate' | 'normal';
|
|
107
|
+
layer: ImageLayer;
|
|
108
|
+
zIndex: number;
|
|
108
109
|
}
|