@tarve/core 0.1.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/LICENSE +201 -0
- package/PERFORMANCE.md +82 -0
- package/README.md +549 -0
- package/RELEASE.md +72 -0
- package/dist/npm/build.js +259 -0
- package/dist/npm/cli.js +285 -0
- package/dist/npm/embedded-assets.js +52 -0
- package/dist/npm/index.js +7077 -0
- package/dist/npm/jsx-dev-runtime.js +17 -0
- package/dist/npm/jsx-runtime.js +27 -0
- package/dist/npm/native-runtime.json +7 -0
- package/dist/npm/protocol.js +8 -0
- package/dist/npm/runtime.js +98 -0
- package/dist/types/core/build.d.ts +13 -0
- package/dist/types/core/cli.d.ts +2 -0
- package/dist/types/core/native-runtime.d.ts +22 -0
- package/dist/types/core/src/advanced-controls.d.ts +120 -0
- package/dist/types/core/src/app.d.ts +59 -0
- package/dist/types/core/src/assets.d.ts +4 -0
- package/dist/types/core/src/bridge/binding.d.ts +34 -0
- package/dist/types/core/src/bridge/index.d.ts +41 -0
- package/dist/types/core/src/bridge/runtime.d.ts +4 -0
- package/dist/types/core/src/chat-controls.d.ts +40 -0
- package/dist/types/core/src/component-adapter.d.ts +11 -0
- package/dist/types/core/src/components/button.d.ts +12 -0
- package/dist/types/core/src/components/icon.d.ts +13 -0
- package/dist/types/core/src/components/image.d.ts +43 -0
- package/dist/types/core/src/components/input.d.ts +22 -0
- package/dist/types/core/src/components/layout.d.ts +22 -0
- package/dist/types/core/src/components/link.d.ts +10 -0
- package/dist/types/core/src/components/modal.d.ts +15 -0
- package/dist/types/core/src/components/pressable.d.ts +19 -0
- package/dist/types/core/src/components/rich-content.d.ts +45 -0
- package/dist/types/core/src/components/scroll.d.ts +12 -0
- package/dist/types/core/src/components/svg.d.ts +61 -0
- package/dist/types/core/src/components/text.d.ts +9 -0
- package/dist/types/core/src/components/titlebar.d.ts +10 -0
- package/dist/types/core/src/components/window.d.ts +20 -0
- package/dist/types/core/src/components.d.ts +34 -0
- package/dist/types/core/src/controls.d.ts +84 -0
- package/dist/types/core/src/desktop-controls.d.ts +62 -0
- package/dist/types/core/src/dev-overlay.d.ts +9 -0
- package/dist/types/core/src/embedded-assets.d.ts +4 -0
- package/dist/types/core/src/extra-controls.d.ts +182 -0
- package/dist/types/core/src/form-controls.d.ts +118 -0
- package/dist/types/core/src/hotkeys.d.ts +3 -0
- package/dist/types/core/src/index.d.ts +36 -0
- package/dist/types/core/src/intrinsic-style.d.ts +3 -0
- package/dist/types/core/src/jsx-dev-runtime.d.ts +2 -0
- package/dist/types/core/src/jsx-runtime.d.ts +279 -0
- package/dist/types/core/src/list.d.ts +10 -0
- package/dist/types/core/src/motion.d.ts +19 -0
- package/dist/types/core/src/popups.d.ts +115 -0
- package/dist/types/core/src/reconciler.d.ts +54 -0
- package/dist/types/core/src/render-scope.d.ts +3 -0
- package/dist/types/core/src/select.d.ts +17 -0
- package/dist/types/core/src/style.d.ts +7 -0
- package/dist/types/core/src/test-renderer.d.ts +84 -0
- package/dist/types/core/src/text-search.d.ts +37 -0
- package/dist/types/core/src/theme.d.ts +91 -0
- package/dist/types/core/src/virtual-list.d.ts +31 -0
- package/dist/types/core/src/visual-testing.d.ts +24 -0
- package/dist/types/core/targets.d.ts +16 -0
- package/dist/types/protocol/src/index.d.ts +534 -0
- package/native/linux-x64/libtarve_native.so +0 -0
- package/native/linux-x64/runtime.json +10 -0
- package/native/win32-x64/runtime.json +10 -0
- package/native/win32-x64/tarve_native.dll +0 -0
- package/package.json +131 -0
|
@@ -0,0 +1,534 @@
|
|
|
1
|
+
/** Renderer-independent, versioned messages crossing the C ABI as UTF-8 JSON. */
|
|
2
|
+
export declare const NATIVE_ABI_VERSION = 5;
|
|
3
|
+
export declare const PROTOCOL_VERSION = 45;
|
|
4
|
+
export type Renderer = "auto" | "gpu" | "cpu";
|
|
5
|
+
export type Length = number | `${number}%` | "auto";
|
|
6
|
+
export type MotionProperty = "width" | "height" | "top" | "right" | "bottom" | "left" | "opacity" | "radius";
|
|
7
|
+
export type MotionEasing = "linear" | "ease" | "easeIn" | "easeOut" | "easeInOut";
|
|
8
|
+
export interface MotionTransition {
|
|
9
|
+
/** Duration in milliseconds. Defaults to 200 when omitted. */
|
|
10
|
+
duration?: number;
|
|
11
|
+
/** Delay in milliseconds. Defaults to 0. */
|
|
12
|
+
delay?: number;
|
|
13
|
+
easing?: MotionEasing;
|
|
14
|
+
}
|
|
15
|
+
export type MotionTransitions = Partial<Record<MotionProperty | "all", MotionTransition>>;
|
|
16
|
+
export type MotionValues = Partial<Record<MotionProperty, number>>;
|
|
17
|
+
export type NodeKind = "window" | "titlebar" | "view" | "row" | "column" | "text" | "markdown" | "code" | "diff" | "button" | "image" | "svg" | "scroll" | "input" | "textarea" | "pressable" | "slider" | "splitter";
|
|
18
|
+
export type SvgElementName = "path" | "circle" | "ellipse" | "g" | "line" | "polygon" | "polyline" | "rect";
|
|
19
|
+
export type SvgAttributeValue = string | number;
|
|
20
|
+
export type SvgAttributes = Record<string, SvgAttributeValue>;
|
|
21
|
+
export type SvgNode = readonly [SvgElementName, SvgAttributes] | readonly [SvgElementName, SvgAttributes, readonly SvgNode[]];
|
|
22
|
+
export type Insets = number | {
|
|
23
|
+
top?: number;
|
|
24
|
+
right?: number;
|
|
25
|
+
bottom?: number;
|
|
26
|
+
left?: number;
|
|
27
|
+
};
|
|
28
|
+
export type OutlineStyle = "dotted" | "dashed" | "solid" | "double" | "groove" | "ridge" | "inset" | "outset" | "none" | "hidden";
|
|
29
|
+
export type UserSelect = "auto" | "text" | "none" | "all";
|
|
30
|
+
export type TextDecoration = "none" | "underline" | "overline" | "line-through";
|
|
31
|
+
export interface SyntaxTheme {
|
|
32
|
+
comment: string;
|
|
33
|
+
keyword: string;
|
|
34
|
+
string: string;
|
|
35
|
+
stringSpecial: string;
|
|
36
|
+
escape: string;
|
|
37
|
+
number: string;
|
|
38
|
+
boolean: string;
|
|
39
|
+
typeName: string;
|
|
40
|
+
typeBuiltin: string;
|
|
41
|
+
constructor: string;
|
|
42
|
+
function: string;
|
|
43
|
+
functionBuiltin: string;
|
|
44
|
+
macro: string;
|
|
45
|
+
property: string;
|
|
46
|
+
constant: string;
|
|
47
|
+
variable: string;
|
|
48
|
+
variableSpecial: string;
|
|
49
|
+
parameter: string;
|
|
50
|
+
operator: string;
|
|
51
|
+
punctuation: string;
|
|
52
|
+
tag: string;
|
|
53
|
+
attribute: string;
|
|
54
|
+
label: string;
|
|
55
|
+
embedded: string;
|
|
56
|
+
invalid: string;
|
|
57
|
+
}
|
|
58
|
+
export interface TextHighlightRange {
|
|
59
|
+
start: number;
|
|
60
|
+
end: number;
|
|
61
|
+
}
|
|
62
|
+
export interface TextHighlight {
|
|
63
|
+
query?: string;
|
|
64
|
+
ranges?: TextHighlightRange[];
|
|
65
|
+
activeIndex?: number;
|
|
66
|
+
caseSensitive?: boolean;
|
|
67
|
+
wholeWord?: boolean;
|
|
68
|
+
color?: string;
|
|
69
|
+
activeColor?: string;
|
|
70
|
+
}
|
|
71
|
+
export interface StateStyle {
|
|
72
|
+
background?: string;
|
|
73
|
+
foreground?: string;
|
|
74
|
+
borderColor?: string;
|
|
75
|
+
radius?: number;
|
|
76
|
+
opacity?: number;
|
|
77
|
+
outlineWidth?: number;
|
|
78
|
+
outlineColor?: string;
|
|
79
|
+
outlineOffset?: number;
|
|
80
|
+
outlineRadius?: number;
|
|
81
|
+
outlineStyle?: OutlineStyle;
|
|
82
|
+
placeholderColor?: string;
|
|
83
|
+
selectionColor?: string;
|
|
84
|
+
caretColor?: string;
|
|
85
|
+
scrollbarColor?: string;
|
|
86
|
+
placeholderBackground?: string;
|
|
87
|
+
thumbColor?: string;
|
|
88
|
+
textDecoration?: TextDecoration;
|
|
89
|
+
}
|
|
90
|
+
export interface Style extends StateStyle {
|
|
91
|
+
width?: Length;
|
|
92
|
+
height?: Length;
|
|
93
|
+
minWidth?: Length;
|
|
94
|
+
minHeight?: Length;
|
|
95
|
+
maxWidth?: Length;
|
|
96
|
+
maxHeight?: Length;
|
|
97
|
+
flex?: number;
|
|
98
|
+
shrink?: number;
|
|
99
|
+
aspectRatio?: number;
|
|
100
|
+
position?: "relative" | "absolute";
|
|
101
|
+
top?: Length;
|
|
102
|
+
right?: Length;
|
|
103
|
+
bottom?: Length;
|
|
104
|
+
left?: Length;
|
|
105
|
+
direction?: "row" | "row-reverse" | "column" | "column-reverse";
|
|
106
|
+
wrap?: boolean;
|
|
107
|
+
gap?: number;
|
|
108
|
+
padding?: Insets;
|
|
109
|
+
margin?: Insets;
|
|
110
|
+
align?: "start" | "center" | "end" | "stretch";
|
|
111
|
+
justify?: "start" | "center" | "end" | "between";
|
|
112
|
+
display?: "flex" | "grid" | "none";
|
|
113
|
+
columns?: number;
|
|
114
|
+
zIndex?: number;
|
|
115
|
+
borderWidth?: Insets;
|
|
116
|
+
radius?: number;
|
|
117
|
+
fontSize?: number;
|
|
118
|
+
fontWeight?: number;
|
|
119
|
+
fontFamily?: string;
|
|
120
|
+
/** Native retained transitions. Bun sends the target once; Rust owns interpolation. */
|
|
121
|
+
transition?: MotionTransitions;
|
|
122
|
+
lineHeight?: number;
|
|
123
|
+
textAlign?: "start" | "center" | "end";
|
|
124
|
+
taskMarkerColor?: string;
|
|
125
|
+
taskMarkerCheckColor?: string;
|
|
126
|
+
markdownCodeBackground?: string;
|
|
127
|
+
markdownQuoteBackground?: string;
|
|
128
|
+
markdownQuoteAccent?: string;
|
|
129
|
+
markdownTableHeaderBackground?: string;
|
|
130
|
+
markdownTableRule?: string;
|
|
131
|
+
/** Markdown surfaces. Each colour falls back to the active theme when unset. */
|
|
132
|
+
markdownCodeColor?: string;
|
|
133
|
+
markdownQuoteColor?: string;
|
|
134
|
+
markdownLinkColor?: string;
|
|
135
|
+
markdownInlineCodeColor?: string;
|
|
136
|
+
markdownMutedColor?: string;
|
|
137
|
+
/** Diff row colours. Omit a background key to paint no layer at all. */
|
|
138
|
+
diffHeaderBackground?: string;
|
|
139
|
+
diffHeaderForeground?: string;
|
|
140
|
+
diffNoticeBackground?: string;
|
|
141
|
+
diffNoticeForeground?: string;
|
|
142
|
+
diffHunkBackground?: string;
|
|
143
|
+
diffHunkForeground?: string;
|
|
144
|
+
diffAddedBackground?: string;
|
|
145
|
+
diffAddedEmphasisBackground?: string;
|
|
146
|
+
diffAddedForeground?: string;
|
|
147
|
+
diffAddedAccent?: string;
|
|
148
|
+
diffRemovedBackground?: string;
|
|
149
|
+
diffRemovedEmphasisBackground?: string;
|
|
150
|
+
diffRemovedForeground?: string;
|
|
151
|
+
diffRemovedAccent?: string;
|
|
152
|
+
/** Line-number gutter colour, for `diff` and for `code`. */
|
|
153
|
+
diffGutterColor?: string;
|
|
154
|
+
gutterColor?: string;
|
|
155
|
+
hover?: StateStyle;
|
|
156
|
+
focus?: StateStyle;
|
|
157
|
+
focusVisible?: StateStyle;
|
|
158
|
+
active?: StateStyle;
|
|
159
|
+
disabled?: StateStyle;
|
|
160
|
+
strokeWidth?: number;
|
|
161
|
+
pointerEvents?: "auto" | "block";
|
|
162
|
+
userSelect?: UserSelect;
|
|
163
|
+
}
|
|
164
|
+
export interface Control {
|
|
165
|
+
role: "button" | "link" | "checkbox" | "switch" | "radio" | "radiogroup" | "tab" | "tablist" | "navigation" | "menuitem" | "tree" | "treeitem" | "grid" | "row" | "toggle" | "togglegroup" | "slider" | "progress" | "virtualList" | "select" | "group" | "field" | "alert" | "status" | "label" | "option" | "otpSlot";
|
|
166
|
+
label?: string;
|
|
167
|
+
checked?: boolean;
|
|
168
|
+
selected?: boolean;
|
|
169
|
+
expanded?: boolean;
|
|
170
|
+
group?: string;
|
|
171
|
+
orientation?: "horizontal" | "vertical";
|
|
172
|
+
value?: number;
|
|
173
|
+
min?: number;
|
|
174
|
+
max?: number;
|
|
175
|
+
step?: number;
|
|
176
|
+
required?: boolean;
|
|
177
|
+
description?: string;
|
|
178
|
+
sortDirection?: "ascending" | "descending" | "other";
|
|
179
|
+
}
|
|
180
|
+
export interface VirtualListLayout {
|
|
181
|
+
estimatedItemHeight: number;
|
|
182
|
+
itemCount: number;
|
|
183
|
+
windowStart: number;
|
|
184
|
+
windowEnd: number;
|
|
185
|
+
renderedKeys: string[];
|
|
186
|
+
retainedKey?: string;
|
|
187
|
+
alignment: "top" | "bottom";
|
|
188
|
+
followTail: boolean;
|
|
189
|
+
scrollRequest?: {
|
|
190
|
+
generation: number;
|
|
191
|
+
offset: number;
|
|
192
|
+
};
|
|
193
|
+
}
|
|
194
|
+
export interface VirtualListMeasurement {
|
|
195
|
+
key: string;
|
|
196
|
+
height: number;
|
|
197
|
+
}
|
|
198
|
+
export interface VirtualListAnchor {
|
|
199
|
+
index: number;
|
|
200
|
+
key: string;
|
|
201
|
+
offset: number;
|
|
202
|
+
}
|
|
203
|
+
export type NativeImageSource = {
|
|
204
|
+
kind: "encoded";
|
|
205
|
+
key: string;
|
|
206
|
+
data: string;
|
|
207
|
+
mediaType?: string;
|
|
208
|
+
} | {
|
|
209
|
+
kind: "rgba";
|
|
210
|
+
key: string;
|
|
211
|
+
data: string;
|
|
212
|
+
width: number;
|
|
213
|
+
height: number;
|
|
214
|
+
premultiplied?: boolean;
|
|
215
|
+
};
|
|
216
|
+
export interface NativeNode {
|
|
217
|
+
id: string;
|
|
218
|
+
kind: NodeKind;
|
|
219
|
+
style: Style;
|
|
220
|
+
children: NativeNode[];
|
|
221
|
+
text?: string;
|
|
222
|
+
source?: string;
|
|
223
|
+
language?: string;
|
|
224
|
+
path?: string;
|
|
225
|
+
oldText?: string;
|
|
226
|
+
newText?: string;
|
|
227
|
+
showLineNumbers?: boolean;
|
|
228
|
+
syntaxTheme?: Partial<SyntaxTheme>;
|
|
229
|
+
wordDiff?: boolean;
|
|
230
|
+
collapsedPaths?: string[];
|
|
231
|
+
maxLines?: number;
|
|
232
|
+
highlight?: TextHighlight;
|
|
233
|
+
src?: string;
|
|
234
|
+
image?: NativeImageSource;
|
|
235
|
+
fit?: "cover" | "contain";
|
|
236
|
+
disabled?: boolean;
|
|
237
|
+
svg?: string;
|
|
238
|
+
value?: string;
|
|
239
|
+
placeholder?: string;
|
|
240
|
+
inputType?: "text" | "password" | "email" | "number" | "search" | "tel" | "url";
|
|
241
|
+
submitOnEnter?: boolean;
|
|
242
|
+
scrollSpeed?: number;
|
|
243
|
+
scrollOrientation?: ScrollOrientation;
|
|
244
|
+
virtualList?: VirtualListLayout;
|
|
245
|
+
control?: Control | null;
|
|
246
|
+
modal?: boolean;
|
|
247
|
+
focusable?: boolean;
|
|
248
|
+
rovingGroup?: string;
|
|
249
|
+
portal?: boolean;
|
|
250
|
+
dismissOnOutside?: boolean;
|
|
251
|
+
labelledBy?: string[];
|
|
252
|
+
closeIntercept?: boolean;
|
|
253
|
+
dragRegion?: boolean;
|
|
254
|
+
windowAction?: "minimize" | "toggleMaximize" | "close";
|
|
255
|
+
/** Optional initial numeric values used only when the native node is first mounted. */
|
|
256
|
+
motionFrom?: MotionValues;
|
|
257
|
+
}
|
|
258
|
+
export type ScrollOrientation = "vertical" | "horizontal" | "both";
|
|
259
|
+
export interface ScrollPosition {
|
|
260
|
+
x: number;
|
|
261
|
+
y: number;
|
|
262
|
+
maxX: number;
|
|
263
|
+
maxY: number;
|
|
264
|
+
}
|
|
265
|
+
export type WindowPositionPreset = "top-left" | "top" | "top-right" | "left" | "center" | "right" | "bottom-left" | "bottom" | "bottom-right";
|
|
266
|
+
export type WindowPosition = WindowPositionPreset | {
|
|
267
|
+
x: number;
|
|
268
|
+
y: number;
|
|
269
|
+
};
|
|
270
|
+
export interface WindowOptions {
|
|
271
|
+
title: string;
|
|
272
|
+
width: number;
|
|
273
|
+
height: number;
|
|
274
|
+
minWidth: number;
|
|
275
|
+
minHeight: number;
|
|
276
|
+
background: string;
|
|
277
|
+
decorations: boolean;
|
|
278
|
+
resizable: boolean;
|
|
279
|
+
position?: WindowPosition;
|
|
280
|
+
debug?: boolean;
|
|
281
|
+
/** Test/runtime option: keep the native desktop window hidden. */
|
|
282
|
+
visible?: boolean;
|
|
283
|
+
}
|
|
284
|
+
export interface SceneDocument {
|
|
285
|
+
version: number;
|
|
286
|
+
renderer: Renderer;
|
|
287
|
+
window: WindowOptions;
|
|
288
|
+
root: NativeNode;
|
|
289
|
+
}
|
|
290
|
+
export type TreeMutation = {
|
|
291
|
+
type: "create";
|
|
292
|
+
node: NativeNode;
|
|
293
|
+
} | {
|
|
294
|
+
type: "patch";
|
|
295
|
+
node: NativeNode;
|
|
296
|
+
} | {
|
|
297
|
+
type: "children";
|
|
298
|
+
id: string;
|
|
299
|
+
children: string[];
|
|
300
|
+
} | {
|
|
301
|
+
type: "remove";
|
|
302
|
+
id: string;
|
|
303
|
+
};
|
|
304
|
+
export interface FileDialogFilter {
|
|
305
|
+
name: string;
|
|
306
|
+
extensions: string[];
|
|
307
|
+
}
|
|
308
|
+
export interface FileDialogOptions {
|
|
309
|
+
title?: string;
|
|
310
|
+
directory?: string;
|
|
311
|
+
fileName?: string;
|
|
312
|
+
filters?: FileDialogFilter[];
|
|
313
|
+
}
|
|
314
|
+
export type FileDialogMode = "openFile" | "openFiles" | "openFolder" | "saveFile";
|
|
315
|
+
export type NativeCommand = {
|
|
316
|
+
type: "patch";
|
|
317
|
+
nodes: NativeNode[];
|
|
318
|
+
} | {
|
|
319
|
+
type: "mutate";
|
|
320
|
+
mutations: TreeMutation[];
|
|
321
|
+
} | {
|
|
322
|
+
type: "update";
|
|
323
|
+
root: NativeNode;
|
|
324
|
+
} | {
|
|
325
|
+
type: "close";
|
|
326
|
+
} | {
|
|
327
|
+
type: "cancelCloseRequest";
|
|
328
|
+
} | {
|
|
329
|
+
type: "frameOverlay";
|
|
330
|
+
enabled: boolean;
|
|
331
|
+
} | {
|
|
332
|
+
type: "focus";
|
|
333
|
+
id: string;
|
|
334
|
+
} | {
|
|
335
|
+
type: "scrollToItem";
|
|
336
|
+
id: string;
|
|
337
|
+
index: number;
|
|
338
|
+
offset?: number;
|
|
339
|
+
} | {
|
|
340
|
+
type: "inspect";
|
|
341
|
+
requestId: string;
|
|
342
|
+
} | {
|
|
343
|
+
type: "resize";
|
|
344
|
+
width: number;
|
|
345
|
+
height: number;
|
|
346
|
+
} | {
|
|
347
|
+
type: "capture";
|
|
348
|
+
path: string;
|
|
349
|
+
requestId: string;
|
|
350
|
+
} | {
|
|
351
|
+
type: "motionAdvance";
|
|
352
|
+
milliseconds: number;
|
|
353
|
+
requestId: string;
|
|
354
|
+
} | {
|
|
355
|
+
type: "fileDialog";
|
|
356
|
+
mode: FileDialogMode;
|
|
357
|
+
options: FileDialogOptions;
|
|
358
|
+
requestId: string;
|
|
359
|
+
} | {
|
|
360
|
+
type: "input";
|
|
361
|
+
action: "move" | "down" | "up" | "wheel" | "text" | "key";
|
|
362
|
+
x?: number;
|
|
363
|
+
y?: number;
|
|
364
|
+
delta?: number;
|
|
365
|
+
deltaX?: number;
|
|
366
|
+
deltaY?: number;
|
|
367
|
+
text?: string;
|
|
368
|
+
};
|
|
369
|
+
export interface NodeSnapshot {
|
|
370
|
+
id: string;
|
|
371
|
+
kind: NodeKind;
|
|
372
|
+
x: number;
|
|
373
|
+
y: number;
|
|
374
|
+
width: number;
|
|
375
|
+
height: number;
|
|
376
|
+
scroll: number;
|
|
377
|
+
scrollMax: number;
|
|
378
|
+
text: string;
|
|
379
|
+
scrollX?: number;
|
|
380
|
+
scrollY?: number;
|
|
381
|
+
scrollMaxX?: number;
|
|
382
|
+
scrollMaxY?: number;
|
|
383
|
+
control?: Control | null;
|
|
384
|
+
virtualListAnchor?: VirtualListAnchor | null;
|
|
385
|
+
}
|
|
386
|
+
export interface Snapshot {
|
|
387
|
+
layoutNodes: number;
|
|
388
|
+
layoutNodesCreated: number;
|
|
389
|
+
measureCalls: number;
|
|
390
|
+
paintedNodes: number;
|
|
391
|
+
frames: number;
|
|
392
|
+
layouts: number;
|
|
393
|
+
shapes: number;
|
|
394
|
+
paints: number;
|
|
395
|
+
activeMotions: number;
|
|
396
|
+
hovered: string | null;
|
|
397
|
+
focused: string | null;
|
|
398
|
+
nodes: NodeSnapshot[];
|
|
399
|
+
width: number;
|
|
400
|
+
height: number;
|
|
401
|
+
scale: number;
|
|
402
|
+
}
|
|
403
|
+
export type NativeEvent = {
|
|
404
|
+
type: "ready" | "closed";
|
|
405
|
+
} | {
|
|
406
|
+
type: "closeRequest";
|
|
407
|
+
} | {
|
|
408
|
+
type: "escape";
|
|
409
|
+
} | {
|
|
410
|
+
type: "click";
|
|
411
|
+
id: string;
|
|
412
|
+
} | {
|
|
413
|
+
type: "context";
|
|
414
|
+
id: string;
|
|
415
|
+
x: number;
|
|
416
|
+
y: number;
|
|
417
|
+
} | {
|
|
418
|
+
type: "outside";
|
|
419
|
+
id: string;
|
|
420
|
+
} | {
|
|
421
|
+
type: "change";
|
|
422
|
+
id: string;
|
|
423
|
+
value: string;
|
|
424
|
+
} | {
|
|
425
|
+
type: "submit";
|
|
426
|
+
id: string;
|
|
427
|
+
value: string;
|
|
428
|
+
} | {
|
|
429
|
+
type: "paste";
|
|
430
|
+
id: string;
|
|
431
|
+
files?: string[];
|
|
432
|
+
image?: {
|
|
433
|
+
width: number;
|
|
434
|
+
height: number;
|
|
435
|
+
rgba: string;
|
|
436
|
+
};
|
|
437
|
+
} | {
|
|
438
|
+
type: "valueChange";
|
|
439
|
+
id: string;
|
|
440
|
+
value: number;
|
|
441
|
+
} | {
|
|
442
|
+
type: "scroll";
|
|
443
|
+
id: string;
|
|
444
|
+
offset: number;
|
|
445
|
+
max: number;
|
|
446
|
+
offsetX?: number;
|
|
447
|
+
offsetY?: number;
|
|
448
|
+
maxX?: number;
|
|
449
|
+
maxY?: number;
|
|
450
|
+
} | {
|
|
451
|
+
type: "virtualListLayout";
|
|
452
|
+
id: string;
|
|
453
|
+
items: VirtualListMeasurement[];
|
|
454
|
+
} | {
|
|
455
|
+
type: "virtualListScrollToItem";
|
|
456
|
+
id: string;
|
|
457
|
+
index: number;
|
|
458
|
+
offset: number;
|
|
459
|
+
} | {
|
|
460
|
+
type: "virtualListFocus";
|
|
461
|
+
id: string;
|
|
462
|
+
key: string | null;
|
|
463
|
+
} | {
|
|
464
|
+
type: "markdownLink";
|
|
465
|
+
id: string;
|
|
466
|
+
href: string;
|
|
467
|
+
} | {
|
|
468
|
+
type: "diffToggleFile";
|
|
469
|
+
id: string;
|
|
470
|
+
path: string;
|
|
471
|
+
} | {
|
|
472
|
+
type: "diffShowMore";
|
|
473
|
+
id: string;
|
|
474
|
+
hidden: number;
|
|
475
|
+
path?: string | null;
|
|
476
|
+
} | {
|
|
477
|
+
type: "diffLineClick";
|
|
478
|
+
id: string;
|
|
479
|
+
text: string;
|
|
480
|
+
path?: string | null;
|
|
481
|
+
oldLine?: number | null;
|
|
482
|
+
newLine?: number | null;
|
|
483
|
+
} | {
|
|
484
|
+
type: "highlight";
|
|
485
|
+
id: string;
|
|
486
|
+
matchCount: number;
|
|
487
|
+
query?: string;
|
|
488
|
+
caseSensitive?: boolean;
|
|
489
|
+
wholeWord?: boolean;
|
|
490
|
+
} | {
|
|
491
|
+
type: "hover";
|
|
492
|
+
id: string;
|
|
493
|
+
entered: boolean;
|
|
494
|
+
} | {
|
|
495
|
+
type: "key";
|
|
496
|
+
id: string;
|
|
497
|
+
key: string;
|
|
498
|
+
} | {
|
|
499
|
+
type: "blur";
|
|
500
|
+
id: string;
|
|
501
|
+
} | {
|
|
502
|
+
type: "shortcut";
|
|
503
|
+
shortcut: string;
|
|
504
|
+
} | {
|
|
505
|
+
type: "error";
|
|
506
|
+
message: string;
|
|
507
|
+
} | {
|
|
508
|
+
type: "inspect";
|
|
509
|
+
requestId: string;
|
|
510
|
+
snapshot: Snapshot;
|
|
511
|
+
} | {
|
|
512
|
+
type: "captured";
|
|
513
|
+
requestId: string;
|
|
514
|
+
path: string;
|
|
515
|
+
error?: string;
|
|
516
|
+
} | {
|
|
517
|
+
type: "motionComplete";
|
|
518
|
+
id: string;
|
|
519
|
+
property: MotionProperty;
|
|
520
|
+
} | {
|
|
521
|
+
type: "motionAdvanced";
|
|
522
|
+
requestId: string;
|
|
523
|
+
milliseconds: number;
|
|
524
|
+
activeMotions: number;
|
|
525
|
+
error?: string;
|
|
526
|
+
} | {
|
|
527
|
+
type: "fileDialog";
|
|
528
|
+
requestId: string;
|
|
529
|
+
paths: string[];
|
|
530
|
+
error?: string;
|
|
531
|
+
} | {
|
|
532
|
+
type: "frame";
|
|
533
|
+
frames: number;
|
|
534
|
+
};
|
|
Binary file
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
{
|
|
2
|
+
"schemaVersion": 1,
|
|
3
|
+
"packageVersion": "0.1.1",
|
|
4
|
+
"protocolVersion": 45,
|
|
5
|
+
"nativeAbiVersion": 5,
|
|
6
|
+
"sourceFingerprint": "949246d98b0f65a3ce1c13ab378e1ea907ff24ccea11b74453073e8eb4e7eba2",
|
|
7
|
+
"target": "linux-x64",
|
|
8
|
+
"nativeName": "libtarve_native.so",
|
|
9
|
+
"sha256": "fb29e12b8be842c202cc44ec5cf9bb69933d004269efe800741cdd736ec0a598"
|
|
10
|
+
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
{
|
|
2
|
+
"schemaVersion": 1,
|
|
3
|
+
"packageVersion": "0.1.1",
|
|
4
|
+
"protocolVersion": 45,
|
|
5
|
+
"nativeAbiVersion": 5,
|
|
6
|
+
"sourceFingerprint": "949246d98b0f65a3ce1c13ab378e1ea907ff24ccea11b74453073e8eb4e7eba2",
|
|
7
|
+
"target": "windows-x64",
|
|
8
|
+
"nativeName": "tarve_native.dll",
|
|
9
|
+
"sha256": "9985f800887ab441686f33fae6e024aca582529e1b31bce4985cdada4109a02a"
|
|
10
|
+
}
|
|
Binary file
|
package/package.json
ADDED
|
@@ -0,0 +1,131 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@tarve/core",
|
|
3
|
+
"version": "0.1.1",
|
|
4
|
+
"description": "Native Bun/TSX GUI with Taffy layout, Parley text and Vello rendering",
|
|
5
|
+
"license": "Apache-2.0",
|
|
6
|
+
"keywords": [
|
|
7
|
+
"gui",
|
|
8
|
+
"desktop",
|
|
9
|
+
"native",
|
|
10
|
+
"bun",
|
|
11
|
+
"tsx",
|
|
12
|
+
"jsx",
|
|
13
|
+
"ui",
|
|
14
|
+
"vello",
|
|
15
|
+
"taffy",
|
|
16
|
+
"windows",
|
|
17
|
+
"linux"
|
|
18
|
+
],
|
|
19
|
+
"homepage": "https://github.com/omarcosr/tarve#readme",
|
|
20
|
+
"repository": {
|
|
21
|
+
"type": "git",
|
|
22
|
+
"url": "git+https://github.com/omarcosr/tarve.git"
|
|
23
|
+
},
|
|
24
|
+
"bugs": {
|
|
25
|
+
"url": "https://github.com/omarcosr/tarve/issues"
|
|
26
|
+
},
|
|
27
|
+
"publishConfig": {
|
|
28
|
+
"access": "public",
|
|
29
|
+
"provenance": true
|
|
30
|
+
},
|
|
31
|
+
"bin": {
|
|
32
|
+
"tarve": "./dist/npm/cli.js"
|
|
33
|
+
},
|
|
34
|
+
"workspaces": [
|
|
35
|
+
"packages/*"
|
|
36
|
+
],
|
|
37
|
+
"files": [
|
|
38
|
+
"dist/npm",
|
|
39
|
+
"dist/types",
|
|
40
|
+
"native/win32-x64",
|
|
41
|
+
"native/linux-x64",
|
|
42
|
+
"README.md",
|
|
43
|
+
"PERFORMANCE.md",
|
|
44
|
+
"RELEASE.md",
|
|
45
|
+
"LICENSE"
|
|
46
|
+
],
|
|
47
|
+
"os": [
|
|
48
|
+
"win32",
|
|
49
|
+
"linux"
|
|
50
|
+
],
|
|
51
|
+
"cpu": [
|
|
52
|
+
"x64"
|
|
53
|
+
],
|
|
54
|
+
"type": "module",
|
|
55
|
+
"imports": {
|
|
56
|
+
"#tarve/runtime": "./dist/npm/runtime.js",
|
|
57
|
+
"#tarve/assets": "./dist/npm/embedded-assets.js"
|
|
58
|
+
},
|
|
59
|
+
"exports": {
|
|
60
|
+
".": {
|
|
61
|
+
"types": "./dist/types/core/src/index.d.ts",
|
|
62
|
+
"default": "./dist/npm/index.js"
|
|
63
|
+
},
|
|
64
|
+
"./jsx-runtime": {
|
|
65
|
+
"types": "./dist/types/core/src/jsx-runtime.d.ts",
|
|
66
|
+
"default": "./dist/npm/jsx-runtime.js"
|
|
67
|
+
},
|
|
68
|
+
"./jsx-dev-runtime": {
|
|
69
|
+
"types": "./dist/types/core/src/jsx-dev-runtime.d.ts",
|
|
70
|
+
"default": "./dist/npm/jsx-dev-runtime.js"
|
|
71
|
+
},
|
|
72
|
+
"./build": {
|
|
73
|
+
"types": "./dist/types/core/build.d.ts",
|
|
74
|
+
"default": "./dist/npm/build.js"
|
|
75
|
+
},
|
|
76
|
+
"./protocol": {
|
|
77
|
+
"types": "./dist/types/protocol/src/index.d.ts",
|
|
78
|
+
"default": "./dist/npm/protocol.js"
|
|
79
|
+
},
|
|
80
|
+
"./assets": {
|
|
81
|
+
"types": "./dist/types/core/src/assets.d.ts"
|
|
82
|
+
},
|
|
83
|
+
"./package.json": "./package.json"
|
|
84
|
+
},
|
|
85
|
+
"scripts": {
|
|
86
|
+
"dev": "bun scripts/dev.ts",
|
|
87
|
+
"dev:example": "bun scripts/dev.ts --entry examples/basic.tsx",
|
|
88
|
+
"build": "bun scripts/build.ts --release",
|
|
89
|
+
"build:exe": "bun scripts/build.ts --exe",
|
|
90
|
+
"build:example": "bun scripts/build.ts --exe --entry examples/basic.tsx",
|
|
91
|
+
"build:native": "bun scripts/build.ts",
|
|
92
|
+
"package": "bun scripts/package.ts",
|
|
93
|
+
"package:local": "bun scripts/package.ts --local",
|
|
94
|
+
"package:native": "bun scripts/package.ts --native-only",
|
|
95
|
+
"prepack": "bun scripts/prepack.ts",
|
|
96
|
+
"pack": "bun pm pack --ignore-scripts --destination dist",
|
|
97
|
+
"start:example": "bun run setup:examples && bun examples/basic.tsx",
|
|
98
|
+
"check": "bun node_modules/typescript/bin/tsc --noEmit",
|
|
99
|
+
"lint": "cargo clippy --manifest-path native/Cargo.toml --all-targets -- -D warnings",
|
|
100
|
+
"setup:examples": "bun scripts/setup-examples.ts",
|
|
101
|
+
"install:examples": "bun install --cwd examples --frozen-lockfile",
|
|
102
|
+
"verify": "bun scripts/verify.ts",
|
|
103
|
+
"release:check": "bun run verify",
|
|
104
|
+
"release:policy": "bun scripts/release-policy.ts",
|
|
105
|
+
"release:build": "bun scripts/release.ts",
|
|
106
|
+
"version:check": "bun scripts/version-policy.ts --check",
|
|
107
|
+
"version:set": "bun scripts/version-policy.ts --set",
|
|
108
|
+
"test": "bun test packages/core && cargo test --manifest-path native/Cargo.toml",
|
|
109
|
+
"test:package-clean": "bun test scripts/package-output.test.ts",
|
|
110
|
+
"test:release-policy": "bun test scripts/version-policy.test.ts scripts/release-policy.test.ts",
|
|
111
|
+
"test:visual": "bun run setup:examples && bun scripts/visual-regression.tsx",
|
|
112
|
+
"smoke": "bun run build:native && bun run setup:examples && bun scripts/smoke.ts",
|
|
113
|
+
"smoke:controls": "bun run build:native && bun run setup:examples && bun scripts/smoke-controls.ts",
|
|
114
|
+
"smoke:virtual-list": "bun run build:native && bun run setup:examples && bun scripts/smoke-virtual-list.ts",
|
|
115
|
+
"smoke:rich-content": "bun run build:native && bun scripts/smoke-rich-content.ts",
|
|
116
|
+
"smoke:motion": "bun run build:native && bun scripts/smoke-motion.tsx",
|
|
117
|
+
"smoke:editor": "bun run build:native && bun scripts/smoke-editor.tsx",
|
|
118
|
+
"smoke:devtools": "bun run build:native && bun scripts/smoke-devtools.ts",
|
|
119
|
+
"smoke:accessibility": "bun run build:native && powershell.exe -NoProfile -ExecutionPolicy Bypass -File scripts/smoke-accessibility.ps1",
|
|
120
|
+
"smoke:exe": "bun scripts/smoke-exe.ts",
|
|
121
|
+
"smoke:package": "bun scripts/smoke-package.ts",
|
|
122
|
+
"bench": "bun scripts/benchmark.tsx"
|
|
123
|
+
},
|
|
124
|
+
"devDependencies": {
|
|
125
|
+
"@types/bun": "^1.4.2",
|
|
126
|
+
"typescript": "^7.0.2"
|
|
127
|
+
},
|
|
128
|
+
"engines": {
|
|
129
|
+
"bun": ">=1.4.0"
|
|
130
|
+
}
|
|
131
|
+
}
|