@gridland/web 0.2.15 → 0.2.17
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.d.ts +2 -2
- package/dist/index.js +70 -13
- package/dist/index.js.map +2 -2
- package/dist/{next-CxYMg6AG.d.ts → next-BWTklBmN.d.ts} +22 -3
- package/dist/next.d.ts +1 -1
- package/dist/next.js +70 -13
- package/dist/next.js.map +2 -2
- package/dist/vite-plugin.js +73 -38
- package/dist/vite-plugin.js.map +1 -1
- package/package.json +7 -2
- package/src/browser-buffer.ts +715 -0
- package/src/core-shims/index.ts +269 -0
- package/src/core-shims/renderable-types.ts +4 -0
- package/src/core-shims/rgba.ts +195 -0
- package/src/core-shims/types.ts +132 -0
- package/src/shims/bun-ffi-structs.ts +20 -0
- package/src/shims/bun-ffi.ts +28 -0
- package/src/shims/console-stub.ts +13 -0
- package/src/shims/console.ts +3 -0
- package/src/shims/devtools-polyfill-stub.ts +3 -0
- package/src/shims/edit-buffer-stub.ts +475 -0
- package/src/shims/editor-view-stub.ts +388 -0
- package/src/shims/events-shim.ts +81 -0
- package/src/shims/filters-stub.ts +4 -0
- package/src/shims/hast-stub.ts +8 -0
- package/src/shims/native-span-feed-stub.ts +7 -0
- package/src/shims/node-buffer.ts +39 -0
- package/src/shims/node-fs.ts +20 -0
- package/src/shims/node-os.ts +6 -0
- package/src/shims/node-path.ts +35 -0
- package/src/shims/node-stream.ts +10 -0
- package/src/shims/node-url.ts +8 -0
- package/src/shims/node-util.ts +33 -0
- package/src/shims/renderer-stub.ts +21 -0
- package/src/shims/slider-deps.ts +8 -0
- package/src/shims/syntax-style-shim.ts +23 -0
- package/src/shims/text-buffer-shim.ts +3 -0
- package/src/shims/text-buffer-view-shim.ts +2 -0
- package/src/shims/timeline-stub.ts +43 -0
- package/src/shims/tree-sitter-stub.ts +47 -0
- package/src/shims/tree-sitter-styled-text-stub.ts +8 -0
- package/src/shims/zig-stub.ts +20 -0
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
// Shim that re-exports BrowserSyntaxStyle as SyntaxStyle
|
|
2
|
+
export { BrowserSyntaxStyle as SyntaxStyle } from "../browser-syntax-style"
|
|
3
|
+
|
|
4
|
+
// Types that opentui imports from syntax-style
|
|
5
|
+
export interface StyleDefinition {
|
|
6
|
+
fg?: any
|
|
7
|
+
bg?: any
|
|
8
|
+
attributes?: number
|
|
9
|
+
[key: string]: any
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
export interface MergedStyle {
|
|
13
|
+
attributes: number
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
export interface ThemeTokenStyle {
|
|
17
|
+
scope: string | string[]
|
|
18
|
+
settings: Record<string, any>
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
export function convertThemeToStyles(_theme: ThemeTokenStyle[]): Record<string, StyleDefinition> {
|
|
22
|
+
return {}
|
|
23
|
+
}
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
// Stub for opentui/packages/core/src/animation/Timeline.ts
|
|
2
|
+
export class Timeline {
|
|
3
|
+
public isPlaying: boolean = false
|
|
4
|
+
public isComplete: boolean = false
|
|
5
|
+
public duration: number = 1000
|
|
6
|
+
public loop: boolean = false
|
|
7
|
+
public synced: boolean = false
|
|
8
|
+
public currentTime: number = 0
|
|
9
|
+
public items: any[] = []
|
|
10
|
+
public subTimelines: any[] = []
|
|
11
|
+
|
|
12
|
+
constructor(_options: any = {}) {}
|
|
13
|
+
addStateChangeListener(_listener: any): void {}
|
|
14
|
+
removeStateChangeListener(_listener: any): void {}
|
|
15
|
+
add(_target: any, _options: any): this { return this }
|
|
16
|
+
call(_callback: () => void): this { return this }
|
|
17
|
+
play(): this {
|
|
18
|
+
this.isPlaying = true
|
|
19
|
+
return this
|
|
20
|
+
}
|
|
21
|
+
pause(): this {
|
|
22
|
+
this.isPlaying = false
|
|
23
|
+
return this
|
|
24
|
+
}
|
|
25
|
+
restart(): void {}
|
|
26
|
+
update(_deltaTime: number): void {}
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
class TimelineEngine {
|
|
30
|
+
defaults = { frameRate: 60 }
|
|
31
|
+
attach(_renderer: any): void {}
|
|
32
|
+
detach(): void {}
|
|
33
|
+
register(_timeline: Timeline): void {}
|
|
34
|
+
unregister(_timeline: Timeline): void {}
|
|
35
|
+
clear(): void {}
|
|
36
|
+
update(_deltaTime: number): void {}
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
export const engine = new TimelineEngine()
|
|
40
|
+
|
|
41
|
+
export function createTimeline(options: any = {}): Timeline {
|
|
42
|
+
return new Timeline(options)
|
|
43
|
+
}
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
// Stub for opentui tree-sitter module
|
|
2
|
+
export function getTreeSitterClient(): any {
|
|
3
|
+
return null
|
|
4
|
+
}
|
|
5
|
+
|
|
6
|
+
export function createTreeSitterClient(): any {
|
|
7
|
+
return null
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
export function treeSitterToStyledText(..._args: any[]): any {
|
|
11
|
+
return null
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
export function treeSitterToTextChunks(..._args: any[]): any[] {
|
|
15
|
+
return []
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
export class TreeSitterClient {
|
|
19
|
+
static create(): any {
|
|
20
|
+
return null
|
|
21
|
+
}
|
|
22
|
+
setDataPath(_path: string): void {}
|
|
23
|
+
highlight(_code: string, _language: string): any[] {
|
|
24
|
+
return []
|
|
25
|
+
}
|
|
26
|
+
getLanguages(): string[] {
|
|
27
|
+
return []
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
export const defaultParsers: any[] = []
|
|
32
|
+
export function registerParser(): void {}
|
|
33
|
+
export function getParser(): any {
|
|
34
|
+
return null
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
// Types
|
|
38
|
+
export type SimpleHighlight = any
|
|
39
|
+
export type TreeSitterClientOptions = any
|
|
40
|
+
|
|
41
|
+
// Re-export from tree-sitter-styled-text (which also gets stubbed)
|
|
42
|
+
export { treeSitterToTextChunks as treeSitterToTextChunksFromStyledText }
|
|
43
|
+
|
|
44
|
+
// resolve-ft exports
|
|
45
|
+
export function resolveFiletype(_filename: string): string | null {
|
|
46
|
+
return null
|
|
47
|
+
}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
// Stub for opentui/packages/core/src/zig.ts
|
|
2
|
+
// Provides no-op RenderLib and resolveRenderLib
|
|
3
|
+
|
|
4
|
+
export type Pointer = number
|
|
5
|
+
|
|
6
|
+
export interface LineInfo {
|
|
7
|
+
lineStarts: number[]
|
|
8
|
+
lineWidths: number[]
|
|
9
|
+
maxLineWidth: number
|
|
10
|
+
lineSources: number[]
|
|
11
|
+
lineWraps: number[]
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
export interface RenderLib {
|
|
15
|
+
[key: string]: any
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
export function resolveRenderLib(): RenderLib {
|
|
19
|
+
throw new Error("Zig render library not available in browser environment")
|
|
20
|
+
}
|