@viewfly/platform-browser 2.0.2 → 2.2.0
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 +34 -37
- package/dist/create-app.d.ts +17 -0
- package/dist/create-portal.d.ts +35 -0
- package/dist/dom-renderer.d.ts +28 -0
- package/dist/html-renderer.d.ts +57 -0
- package/dist/index.d.ts +5 -0
- package/dist/index.esm.js +354 -0
- package/dist/index.js +362 -0
- package/{bundles/index.d.ts → dist/jsx-dom.d.ts} +73 -211
- package/package.json +25 -18
- package/bundles/index.esm.js +0 -487
- package/bundles/index.js +0 -496
- package/rollup-d.config.ts +0 -14
|
@@ -1,143 +1,6 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { JSX, ClassNames, JSXNode } from '@viewfly/core';
|
|
2
2
|
import * as CSS from 'csstype';
|
|
3
|
-
|
|
4
|
-
/**
|
|
5
|
-
* 创建一个 Viewfly 实例
|
|
6
|
-
* @param root 应用根节点
|
|
7
|
-
* @param autoUpdate 是否自动更新视图,默认为 true,当值为 false 时,Viewfly
|
|
8
|
-
* 只会首次渲染,直到手动调用 app 的 render() 方法,这在单元测试中非常有用,
|
|
9
|
-
* 我们无需等待 Viewfly 默认的异步调度,实现同步更新视图
|
|
10
|
-
* ```tsx
|
|
11
|
-
* const app = createApp(<App/>, false).mount(document.getElementById('app'))
|
|
12
|
-
*
|
|
13
|
-
* // do something...
|
|
14
|
-
*
|
|
15
|
-
* app.render() // 手动更新视图
|
|
16
|
-
* ```
|
|
17
|
-
*/
|
|
18
|
-
declare function createApp<T extends NativeNode>(root: ViewFlyNode, autoUpdate?: boolean): Application<T>;
|
|
19
|
-
declare function createApp<T extends NativeNode>(root: ViewFlyNode, config?: Partial<Omit<Config, 'root'>>): Application<T>;
|
|
20
|
-
|
|
21
|
-
/**
|
|
22
|
-
* 用于创建脱离当前 DOM 树的子节点,常用于弹窗等
|
|
23
|
-
* @param childRender
|
|
24
|
-
* @param host
|
|
25
|
-
* @example
|
|
26
|
-
* ```tsx
|
|
27
|
-
* function App() {
|
|
28
|
-
* const number = createSignal(0)
|
|
29
|
-
*
|
|
30
|
-
* setInterval(() => {
|
|
31
|
-
* number.set(number() + 1)
|
|
32
|
-
* }, 1000)
|
|
33
|
-
*
|
|
34
|
-
* const ModalPortal = function (props) {
|
|
35
|
-
* return createPortal(() => {
|
|
36
|
-
* return <div class="modal">parent data is {props.text}</div>
|
|
37
|
-
* }, document.body)
|
|
38
|
-
* }
|
|
39
|
-
* return () => {
|
|
40
|
-
* return (
|
|
41
|
-
* <div>
|
|
42
|
-
* <div>data is {number()}</div>
|
|
43
|
-
* <ModalPortal text={number()}/>
|
|
44
|
-
* </div>
|
|
45
|
-
* )
|
|
46
|
-
* }
|
|
47
|
-
* }
|
|
48
|
-
* ```
|
|
49
|
-
*/
|
|
50
|
-
declare function createPortal<T extends NativeNode>(childRender: () => JSXNode, host: T): {
|
|
51
|
-
$portalHost: T;
|
|
52
|
-
$render: () => JSXNode;
|
|
53
|
-
};
|
|
54
|
-
|
|
55
|
-
declare class VDOMNode {
|
|
56
|
-
parent: VDOMElement | null;
|
|
57
|
-
remove(): void;
|
|
58
|
-
}
|
|
59
|
-
declare class VDOMElement extends VDOMNode {
|
|
60
|
-
name: string;
|
|
61
|
-
props: Map<string, any>;
|
|
62
|
-
children: Array<VDOMElement | VDOMText>;
|
|
63
|
-
style: Map<string, any>;
|
|
64
|
-
className: string;
|
|
65
|
-
constructor(name: string);
|
|
66
|
-
}
|
|
67
|
-
declare class VDOMText extends VDOMNode {
|
|
68
|
-
text: string;
|
|
69
|
-
constructor(text: string);
|
|
70
|
-
}
|
|
71
|
-
/**
|
|
72
|
-
* 用于生成模拟轻量 DOM 节点的渲染器
|
|
73
|
-
*/
|
|
74
|
-
declare class HTMLRenderer extends NativeRenderer<VDOMElement, VDOMText> {
|
|
75
|
-
createElement(name: string): VDOMElement;
|
|
76
|
-
createTextNode(textContent: string): VDOMText;
|
|
77
|
-
setProperty(node: VDOMElement, key: string, value: any): void;
|
|
78
|
-
appendChild(parent: VDOMElement, newChild: VDOMElement | VDOMText): void;
|
|
79
|
-
prependChild(parent: VDOMElement, newChild: VDOMElement | VDOMText): void;
|
|
80
|
-
removeProperty(node: VDOMElement, key: string): void;
|
|
81
|
-
setStyle(target: VDOMElement, key: string, value: any): void;
|
|
82
|
-
removeStyle(target: VDOMElement, key: string): void;
|
|
83
|
-
setClass(target: VDOMElement, value: string): void;
|
|
84
|
-
listen(): void;
|
|
85
|
-
unListen(): void;
|
|
86
|
-
remove(node: VDOMElement | VDOMText): void;
|
|
87
|
-
cleanChildren(node: VDOMElement): void;
|
|
88
|
-
syncTextContent(target: VDOMText, content: string): void;
|
|
89
|
-
insertAfter(newNode: VDOMElement | VDOMText, ref: VDOMElement | VDOMText): void;
|
|
90
|
-
getNameSpace(): void;
|
|
91
|
-
}
|
|
92
|
-
/**
|
|
93
|
-
* 轻量 DOM 转换为 HTML 字符串的转换器
|
|
94
|
-
*/
|
|
95
|
-
declare class OutputTranslator {
|
|
96
|
-
static singleTags: string[];
|
|
97
|
-
static simpleXSSFilter: {
|
|
98
|
-
text(text: string): string;
|
|
99
|
-
attrName(text: string): string;
|
|
100
|
-
attrValue(text: string): string;
|
|
101
|
-
};
|
|
102
|
-
private singleTagTest;
|
|
103
|
-
/**
|
|
104
|
-
* 将虚拟 DOM 转换为 HTML 字符串的方法
|
|
105
|
-
* @param vDom 虚拟 DOM 节点
|
|
106
|
-
*/
|
|
107
|
-
transform(vDom: VDOMElement): string;
|
|
108
|
-
private vDomToHTMLString;
|
|
109
|
-
private replaceEmpty;
|
|
110
|
-
}
|
|
111
|
-
|
|
112
|
-
declare class DomRenderer extends NativeRenderer<HTMLElement, Text> {
|
|
113
|
-
static NAMESPACES: Record<string, string>;
|
|
114
|
-
propMap: Record<string, Record<string, string>>;
|
|
115
|
-
/**
|
|
116
|
-
* IDL 属性赋 `''` 会被转成数字 0(如 maxLength/minLength),无法表示「未设置」。
|
|
117
|
-
* 这些键在移除时应删掉对应 content attribute。
|
|
118
|
-
*/
|
|
119
|
-
private static readonly REMOVE_VIA_ATTRIBUTE;
|
|
120
|
-
createElement(name: string, namespace: ElementNamespace): HTMLElement;
|
|
121
|
-
createTextNode(textContent: string): Text;
|
|
122
|
-
appendChild(parent: HTMLElement, newChild: any): void;
|
|
123
|
-
prependChild(parent: HTMLElement, newChild: HTMLElement | Text): void;
|
|
124
|
-
insertAfter(newNode: HTMLElement | Text, ref: HTMLElement | Text): void;
|
|
125
|
-
remove(node: HTMLElement | Text): void;
|
|
126
|
-
cleanChildren(node: HTMLElement): void;
|
|
127
|
-
setProperty(node: HTMLElement, key: string, value: any, namespace: ElementNamespace): void;
|
|
128
|
-
removeProperty(node: HTMLElement, key: string, namespace: ElementNamespace): void;
|
|
129
|
-
setClass(target: HTMLElement, className: string): void;
|
|
130
|
-
setStyle(target: HTMLElement, key: string, value: any): void;
|
|
131
|
-
removeStyle(target: HTMLElement, key: string): void;
|
|
132
|
-
listen<T = any>(node: HTMLElement, type: string, callback: (ev: T) => any): void;
|
|
133
|
-
unListen(node: HTMLElement, type: string, callback: (ev: any) => any): void;
|
|
134
|
-
syncTextContent(target: Text, content: string): void;
|
|
135
|
-
getNameSpace(type: string, namespace: ElementNamespace): string | void;
|
|
136
|
-
private normalizedEventType;
|
|
137
|
-
private insertBefore;
|
|
138
|
-
}
|
|
139
|
-
|
|
140
|
-
interface CSSProperties extends CSS.Properties<string | number>, CSS.PropertiesHyphen<string | number> {
|
|
3
|
+
export interface CSSProperties extends CSS.Properties<string | number>, CSS.PropertiesHyphen<string | number> {
|
|
141
4
|
/**
|
|
142
5
|
* The index signature was removed to enable closed typing for style
|
|
143
6
|
* using CSSType. You're able to use type assertion or module augmentation
|
|
@@ -336,8 +199,8 @@ interface AriaAttributes {
|
|
|
336
199
|
/** Defines the human readable text alternative of aria-valuenow for a range widget. */
|
|
337
200
|
'aria-valuetext'?: string;
|
|
338
201
|
}
|
|
339
|
-
type StyleValue = string | CSSProperties | null;
|
|
340
|
-
interface HTMLAttributes<T> extends AriaAttributes, EventHandlers<Events>, JSX.RefAttributes<T> {
|
|
202
|
+
export type StyleValue = string | CSSProperties | null;
|
|
203
|
+
export interface HTMLAttributes<T> extends AriaAttributes, EventHandlers<Events>, JSX.RefAttributes<T> {
|
|
341
204
|
children?: JSXNode;
|
|
342
205
|
innerHTML?: string;
|
|
343
206
|
class?: ClassNames;
|
|
@@ -385,7 +248,7 @@ interface HTMLAttributes<T> extends AriaAttributes, EventHandlers<Events>, JSX.R
|
|
|
385
248
|
[k: string]: any;
|
|
386
249
|
}
|
|
387
250
|
type HTMLAttributeReferrerPolicy = '' | 'no-referrer' | 'no-referrer-when-downgrade' | 'origin' | 'origin-when-cross-origin' | 'same-origin' | 'strict-origin' | 'strict-origin-when-cross-origin' | 'unsafe-url';
|
|
388
|
-
interface AnchorHTMLAttributes<T> extends HTMLAttributes<T> {
|
|
251
|
+
export interface AnchorHTMLAttributes<T> extends HTMLAttributes<T> {
|
|
389
252
|
download?: any;
|
|
390
253
|
href?: string;
|
|
391
254
|
hreflang?: string;
|
|
@@ -396,7 +259,7 @@ interface AnchorHTMLAttributes<T> extends HTMLAttributes<T> {
|
|
|
396
259
|
type?: string;
|
|
397
260
|
referrerpolicy?: HTMLAttributeReferrerPolicy;
|
|
398
261
|
}
|
|
399
|
-
interface AreaHTMLAttributes<T> extends HTMLAttributes<T> {
|
|
262
|
+
export interface AreaHTMLAttributes<T> extends HTMLAttributes<T> {
|
|
400
263
|
alt?: string;
|
|
401
264
|
coords?: string;
|
|
402
265
|
download?: any;
|
|
@@ -408,16 +271,16 @@ interface AreaHTMLAttributes<T> extends HTMLAttributes<T> {
|
|
|
408
271
|
shape?: string;
|
|
409
272
|
target?: string;
|
|
410
273
|
}
|
|
411
|
-
interface AudioHTMLAttributes<T> extends MediaHTMLAttributes<T> {
|
|
274
|
+
export interface AudioHTMLAttributes<T> extends MediaHTMLAttributes<T> {
|
|
412
275
|
}
|
|
413
|
-
interface BaseHTMLAttributes<T> extends HTMLAttributes<T> {
|
|
276
|
+
export interface BaseHTMLAttributes<T> extends HTMLAttributes<T> {
|
|
414
277
|
href?: string;
|
|
415
278
|
target?: string;
|
|
416
279
|
}
|
|
417
|
-
interface BlockquoteHTMLAttributes<T> extends HTMLAttributes<T> {
|
|
280
|
+
export interface BlockquoteHTMLAttributes<T> extends HTMLAttributes<T> {
|
|
418
281
|
cite?: string;
|
|
419
282
|
}
|
|
420
|
-
interface ButtonHTMLAttributes<T> extends HTMLAttributes<T> {
|
|
283
|
+
export interface ButtonHTMLAttributes<T> extends HTMLAttributes<T> {
|
|
421
284
|
autofocus?: Booleanish;
|
|
422
285
|
disabled?: Booleanish;
|
|
423
286
|
form?: string;
|
|
@@ -430,42 +293,42 @@ interface ButtonHTMLAttributes<T> extends HTMLAttributes<T> {
|
|
|
430
293
|
type?: 'submit' | 'reset' | 'button';
|
|
431
294
|
value?: string | string[] | number;
|
|
432
295
|
}
|
|
433
|
-
interface CanvasHTMLAttributes<T> extends HTMLAttributes<T> {
|
|
296
|
+
export interface CanvasHTMLAttributes<T> extends HTMLAttributes<T> {
|
|
434
297
|
height?: Numberish;
|
|
435
298
|
width?: Numberish;
|
|
436
299
|
}
|
|
437
|
-
interface ColHTMLAttributes<T> extends HTMLAttributes<T> {
|
|
300
|
+
export interface ColHTMLAttributes<T> extends HTMLAttributes<T> {
|
|
438
301
|
span?: Numberish;
|
|
439
302
|
width?: Numberish;
|
|
440
303
|
}
|
|
441
|
-
interface ColgroupHTMLAttributes<T> extends HTMLAttributes<T> {
|
|
304
|
+
export interface ColgroupHTMLAttributes<T> extends HTMLAttributes<T> {
|
|
442
305
|
span?: Numberish;
|
|
443
306
|
}
|
|
444
|
-
interface DataHTMLAttributes<T> extends HTMLAttributes<T> {
|
|
307
|
+
export interface DataHTMLAttributes<T> extends HTMLAttributes<T> {
|
|
445
308
|
value?: string | string[] | number;
|
|
446
309
|
}
|
|
447
|
-
interface DetailsHTMLAttributes<T> extends HTMLAttributes<T> {
|
|
310
|
+
export interface DetailsHTMLAttributes<T> extends HTMLAttributes<T> {
|
|
448
311
|
open?: Booleanish;
|
|
449
312
|
}
|
|
450
|
-
interface DelHTMLAttributes<T> extends HTMLAttributes<T> {
|
|
313
|
+
export interface DelHTMLAttributes<T> extends HTMLAttributes<T> {
|
|
451
314
|
cite?: string;
|
|
452
315
|
datetime?: string;
|
|
453
316
|
}
|
|
454
|
-
interface DialogHTMLAttributes<T> extends HTMLAttributes<T> {
|
|
317
|
+
export interface DialogHTMLAttributes<T> extends HTMLAttributes<T> {
|
|
455
318
|
open?: Booleanish;
|
|
456
319
|
}
|
|
457
|
-
interface EmbedHTMLAttributes<T> extends HTMLAttributes<T> {
|
|
320
|
+
export interface EmbedHTMLAttributes<T> extends HTMLAttributes<T> {
|
|
458
321
|
height?: Numberish;
|
|
459
322
|
src?: string;
|
|
460
323
|
type?: string;
|
|
461
324
|
width?: Numberish;
|
|
462
325
|
}
|
|
463
|
-
interface FieldsetHTMLAttributes<T> extends HTMLAttributes<T> {
|
|
326
|
+
export interface FieldsetHTMLAttributes<T> extends HTMLAttributes<T> {
|
|
464
327
|
disabled?: Booleanish;
|
|
465
328
|
form?: string;
|
|
466
329
|
name?: string;
|
|
467
330
|
}
|
|
468
|
-
interface FormHTMLAttributes<T> extends HTMLAttributes<T> {
|
|
331
|
+
export interface FormHTMLAttributes<T> extends HTMLAttributes<T> {
|
|
469
332
|
acceptcharset?: string;
|
|
470
333
|
action?: string;
|
|
471
334
|
autocomplete?: string;
|
|
@@ -475,10 +338,10 @@ interface FormHTMLAttributes<T> extends HTMLAttributes<T> {
|
|
|
475
338
|
novalidate?: Booleanish;
|
|
476
339
|
target?: string;
|
|
477
340
|
}
|
|
478
|
-
interface HtmlHTMLAttributes<T> extends HTMLAttributes<T> {
|
|
341
|
+
export interface HtmlHTMLAttributes<T> extends HTMLAttributes<T> {
|
|
479
342
|
manifest?: string;
|
|
480
343
|
}
|
|
481
|
-
interface IframeHTMLAttributes<T> extends HTMLAttributes<T> {
|
|
344
|
+
export interface IframeHTMLAttributes<T> extends HTMLAttributes<T> {
|
|
482
345
|
allow?: string;
|
|
483
346
|
allowfullscreen?: Booleanish;
|
|
484
347
|
allowtransparency?: Booleanish;
|
|
@@ -495,7 +358,7 @@ interface IframeHTMLAttributes<T> extends HTMLAttributes<T> {
|
|
|
495
358
|
srcdoc?: string;
|
|
496
359
|
width?: Numberish;
|
|
497
360
|
}
|
|
498
|
-
interface ImgHTMLAttributes<T> extends HTMLAttributes<T> {
|
|
361
|
+
export interface ImgHTMLAttributes<T> extends HTMLAttributes<T> {
|
|
499
362
|
alt?: string;
|
|
500
363
|
crossorigin?: 'anonymous' | 'use-credentials' | '';
|
|
501
364
|
decoding?: 'async' | 'auto' | 'sync';
|
|
@@ -507,11 +370,11 @@ interface ImgHTMLAttributes<T> extends HTMLAttributes<T> {
|
|
|
507
370
|
usemap?: string;
|
|
508
371
|
width?: Numberish;
|
|
509
372
|
}
|
|
510
|
-
interface InsHTMLAttributes<T> extends HTMLAttributes<T> {
|
|
373
|
+
export interface InsHTMLAttributes<T> extends HTMLAttributes<T> {
|
|
511
374
|
cite?: string;
|
|
512
375
|
datetime?: string;
|
|
513
376
|
}
|
|
514
|
-
interface InputHTMLAttributes<T> extends HTMLAttributes<T> {
|
|
377
|
+
export interface InputHTMLAttributes<T> extends HTMLAttributes<T> {
|
|
515
378
|
accept?: string;
|
|
516
379
|
alt?: string;
|
|
517
380
|
autocomplete?: string;
|
|
@@ -546,7 +409,7 @@ interface InputHTMLAttributes<T> extends HTMLAttributes<T> {
|
|
|
546
409
|
value?: any;
|
|
547
410
|
width?: Numberish;
|
|
548
411
|
}
|
|
549
|
-
interface KeygenHTMLAttributes<T> extends HTMLAttributes<T> {
|
|
412
|
+
export interface KeygenHTMLAttributes<T> extends HTMLAttributes<T> {
|
|
550
413
|
autofocus?: Booleanish;
|
|
551
414
|
challenge?: string;
|
|
552
415
|
disabled?: Booleanish;
|
|
@@ -555,14 +418,14 @@ interface KeygenHTMLAttributes<T> extends HTMLAttributes<T> {
|
|
|
555
418
|
keyparams?: string;
|
|
556
419
|
name?: string;
|
|
557
420
|
}
|
|
558
|
-
interface LabelHTMLAttributes<T> extends HTMLAttributes<T> {
|
|
421
|
+
export interface LabelHTMLAttributes<T> extends HTMLAttributes<T> {
|
|
559
422
|
for?: string;
|
|
560
423
|
form?: string;
|
|
561
424
|
}
|
|
562
|
-
interface LiHTMLAttributes<T> extends HTMLAttributes<T> {
|
|
425
|
+
export interface LiHTMLAttributes<T> extends HTMLAttributes<T> {
|
|
563
426
|
value?: string | string[] | number;
|
|
564
427
|
}
|
|
565
|
-
interface LinkHTMLAttributes<T> extends HTMLAttributes<T> {
|
|
428
|
+
export interface LinkHTMLAttributes<T> extends HTMLAttributes<T> {
|
|
566
429
|
as?: string;
|
|
567
430
|
crossorigin?: string;
|
|
568
431
|
href?: string;
|
|
@@ -574,13 +437,13 @@ interface LinkHTMLAttributes<T> extends HTMLAttributes<T> {
|
|
|
574
437
|
sizes?: string;
|
|
575
438
|
type?: string;
|
|
576
439
|
}
|
|
577
|
-
interface MapHTMLAttributes<T> extends HTMLAttributes<T> {
|
|
440
|
+
export interface MapHTMLAttributes<T> extends HTMLAttributes<T> {
|
|
578
441
|
name?: string;
|
|
579
442
|
}
|
|
580
|
-
interface MenuHTMLAttributes<T> extends HTMLAttributes<T> {
|
|
443
|
+
export interface MenuHTMLAttributes<T> extends HTMLAttributes<T> {
|
|
581
444
|
type?: string;
|
|
582
445
|
}
|
|
583
|
-
interface MediaHTMLAttributes<T> extends HTMLAttributes<T> {
|
|
446
|
+
export interface MediaHTMLAttributes<T> extends HTMLAttributes<T> {
|
|
584
447
|
autoplay?: Booleanish;
|
|
585
448
|
controls?: Booleanish;
|
|
586
449
|
controlslist?: string;
|
|
@@ -592,13 +455,13 @@ interface MediaHTMLAttributes<T> extends HTMLAttributes<T> {
|
|
|
592
455
|
preload?: string;
|
|
593
456
|
src?: string;
|
|
594
457
|
}
|
|
595
|
-
interface MetaHTMLAttributes<T> extends HTMLAttributes<T> {
|
|
458
|
+
export interface MetaHTMLAttributes<T> extends HTMLAttributes<T> {
|
|
596
459
|
charset?: string;
|
|
597
460
|
content?: string;
|
|
598
461
|
httpequiv?: string;
|
|
599
462
|
name?: string;
|
|
600
463
|
}
|
|
601
|
-
interface MeterHTMLAttributes<T> extends HTMLAttributes<T> {
|
|
464
|
+
export interface MeterHTMLAttributes<T> extends HTMLAttributes<T> {
|
|
602
465
|
form?: string;
|
|
603
466
|
high?: Numberish;
|
|
604
467
|
low?: Numberish;
|
|
@@ -607,10 +470,10 @@ interface MeterHTMLAttributes<T> extends HTMLAttributes<T> {
|
|
|
607
470
|
optimum?: Numberish;
|
|
608
471
|
value?: string | string[] | number;
|
|
609
472
|
}
|
|
610
|
-
interface QuoteHTMLAttributes<T> extends HTMLAttributes<T> {
|
|
473
|
+
export interface QuoteHTMLAttributes<T> extends HTMLAttributes<T> {
|
|
611
474
|
cite?: string;
|
|
612
475
|
}
|
|
613
|
-
interface ObjectHTMLAttributes<T> extends HTMLAttributes<T> {
|
|
476
|
+
export interface ObjectHTMLAttributes<T> extends HTMLAttributes<T> {
|
|
614
477
|
classid?: string;
|
|
615
478
|
data?: string;
|
|
616
479
|
form?: string;
|
|
@@ -621,35 +484,35 @@ interface ObjectHTMLAttributes<T> extends HTMLAttributes<T> {
|
|
|
621
484
|
width?: Numberish;
|
|
622
485
|
wmode?: string;
|
|
623
486
|
}
|
|
624
|
-
interface OlHTMLAttributes<T> extends HTMLAttributes<T> {
|
|
487
|
+
export interface OlHTMLAttributes<T> extends HTMLAttributes<T> {
|
|
625
488
|
reversed?: Booleanish;
|
|
626
489
|
start?: Numberish;
|
|
627
490
|
type?: '1' | 'a' | 'A' | 'i' | 'I';
|
|
628
491
|
}
|
|
629
|
-
interface OptgroupHTMLAttributes<T> extends HTMLAttributes<T> {
|
|
492
|
+
export interface OptgroupHTMLAttributes<T> extends HTMLAttributes<T> {
|
|
630
493
|
disabled?: Booleanish;
|
|
631
494
|
label?: string;
|
|
632
495
|
}
|
|
633
|
-
interface OptionHTMLAttributes<T> extends HTMLAttributes<T> {
|
|
496
|
+
export interface OptionHTMLAttributes<T> extends HTMLAttributes<T> {
|
|
634
497
|
disabled?: Booleanish;
|
|
635
498
|
label?: string;
|
|
636
499
|
selected?: Booleanish;
|
|
637
500
|
value?: string;
|
|
638
501
|
}
|
|
639
|
-
interface OutputHTMLAttributes<T> extends HTMLAttributes<T> {
|
|
502
|
+
export interface OutputHTMLAttributes<T> extends HTMLAttributes<T> {
|
|
640
503
|
for?: string;
|
|
641
504
|
form?: string;
|
|
642
505
|
name?: string;
|
|
643
506
|
}
|
|
644
|
-
interface ParamHTMLAttributes<T> extends HTMLAttributes<T> {
|
|
507
|
+
export interface ParamHTMLAttributes<T> extends HTMLAttributes<T> {
|
|
645
508
|
name?: string;
|
|
646
509
|
value?: string | string[] | number;
|
|
647
510
|
}
|
|
648
|
-
interface ProgressHTMLAttributes<T> extends HTMLAttributes<T> {
|
|
511
|
+
export interface ProgressHTMLAttributes<T> extends HTMLAttributes<T> {
|
|
649
512
|
max?: Numberish;
|
|
650
513
|
value?: string | string[] | number;
|
|
651
514
|
}
|
|
652
|
-
interface ScriptHTMLAttributes<T> extends HTMLAttributes<T> {
|
|
515
|
+
export interface ScriptHTMLAttributes<T> extends HTMLAttributes<T> {
|
|
653
516
|
async?: Booleanish;
|
|
654
517
|
charset?: string;
|
|
655
518
|
crossorigin?: string;
|
|
@@ -661,7 +524,7 @@ interface ScriptHTMLAttributes<T> extends HTMLAttributes<T> {
|
|
|
661
524
|
src?: string;
|
|
662
525
|
type?: string;
|
|
663
526
|
}
|
|
664
|
-
interface SelectHTMLAttributes<T> extends HTMLAttributes<T> {
|
|
527
|
+
export interface SelectHTMLAttributes<T> extends HTMLAttributes<T> {
|
|
665
528
|
autocomplete?: string;
|
|
666
529
|
autofocus?: Booleanish;
|
|
667
530
|
disabled?: Booleanish;
|
|
@@ -672,25 +535,25 @@ interface SelectHTMLAttributes<T> extends HTMLAttributes<T> {
|
|
|
672
535
|
size?: Numberish;
|
|
673
536
|
value?: string;
|
|
674
537
|
}
|
|
675
|
-
interface SourceHTMLAttributes<T> extends HTMLAttributes<T> {
|
|
538
|
+
export interface SourceHTMLAttributes<T> extends HTMLAttributes<T> {
|
|
676
539
|
media?: string;
|
|
677
540
|
sizes?: string;
|
|
678
541
|
src?: string;
|
|
679
542
|
srcset?: string;
|
|
680
543
|
type?: string;
|
|
681
544
|
}
|
|
682
|
-
interface StyleHTMLAttributes<T> extends HTMLAttributes<T> {
|
|
545
|
+
export interface StyleHTMLAttributes<T> extends HTMLAttributes<T> {
|
|
683
546
|
media?: string;
|
|
684
547
|
nonce?: string;
|
|
685
548
|
scoped?: Booleanish;
|
|
686
549
|
type?: string;
|
|
687
550
|
}
|
|
688
|
-
interface TableHTMLAttributes<T> extends HTMLAttributes<T> {
|
|
551
|
+
export interface TableHTMLAttributes<T> extends HTMLAttributes<T> {
|
|
689
552
|
cellpadding?: Numberish;
|
|
690
553
|
cellspacing?: Numberish;
|
|
691
554
|
summary?: string;
|
|
692
555
|
}
|
|
693
|
-
interface TextareaHTMLAttributes<T> extends HTMLAttributes<T> {
|
|
556
|
+
export interface TextareaHTMLAttributes<T> extends HTMLAttributes<T> {
|
|
694
557
|
autocomplete?: string;
|
|
695
558
|
autofocus?: Booleanish;
|
|
696
559
|
cols?: Numberish;
|
|
@@ -707,7 +570,7 @@ interface TextareaHTMLAttributes<T> extends HTMLAttributes<T> {
|
|
|
707
570
|
value?: string | string[] | number;
|
|
708
571
|
wrap?: string;
|
|
709
572
|
}
|
|
710
|
-
interface TdHTMLAttributes<T> extends HTMLAttributes<T> {
|
|
573
|
+
export interface TdHTMLAttributes<T> extends HTMLAttributes<T> {
|
|
711
574
|
align?: 'left' | 'center' | 'right' | 'justify' | 'char';
|
|
712
575
|
colspan?: Numberish;
|
|
713
576
|
headers?: string;
|
|
@@ -715,31 +578,31 @@ interface TdHTMLAttributes<T> extends HTMLAttributes<T> {
|
|
|
715
578
|
scope?: string;
|
|
716
579
|
valign?: 'top' | 'middle' | 'bottom' | 'baseline';
|
|
717
580
|
}
|
|
718
|
-
interface ThHTMLAttributes<T> extends HTMLAttributes<T> {
|
|
581
|
+
export interface ThHTMLAttributes<T> extends HTMLAttributes<T> {
|
|
719
582
|
align?: 'left' | 'center' | 'right' | 'justify' | 'char';
|
|
720
583
|
colspan?: Numberish;
|
|
721
584
|
headers?: string;
|
|
722
585
|
rowspan?: Numberish;
|
|
723
586
|
scope?: string;
|
|
724
587
|
}
|
|
725
|
-
interface TimeHTMLAttributes<T> extends HTMLAttributes<T> {
|
|
588
|
+
export interface TimeHTMLAttributes<T> extends HTMLAttributes<T> {
|
|
726
589
|
datetime?: string;
|
|
727
590
|
}
|
|
728
|
-
interface TrackHTMLAttributes<T> extends HTMLAttributes<T> {
|
|
591
|
+
export interface TrackHTMLAttributes<T> extends HTMLAttributes<T> {
|
|
729
592
|
default?: Booleanish;
|
|
730
593
|
kind?: string;
|
|
731
594
|
label?: string;
|
|
732
595
|
src?: string;
|
|
733
596
|
srclang?: string;
|
|
734
597
|
}
|
|
735
|
-
interface VideoHTMLAttributes<T> extends MediaHTMLAttributes<T> {
|
|
598
|
+
export interface VideoHTMLAttributes<T> extends MediaHTMLAttributes<T> {
|
|
736
599
|
height?: Numberish;
|
|
737
600
|
playsinline?: Booleanish;
|
|
738
601
|
poster?: string;
|
|
739
602
|
width?: Numberish;
|
|
740
603
|
disablePictureInPicture?: Booleanish;
|
|
741
604
|
}
|
|
742
|
-
interface WebViewHTMLAttributes<T> extends HTMLAttributes<T> {
|
|
605
|
+
export interface WebViewHTMLAttributes<T> extends HTMLAttributes<T> {
|
|
743
606
|
allowfullscreen?: Booleanish;
|
|
744
607
|
allowpopups?: Booleanish;
|
|
745
608
|
autoFocus?: Booleanish;
|
|
@@ -758,7 +621,7 @@ interface WebViewHTMLAttributes<T> extends HTMLAttributes<T> {
|
|
|
758
621
|
useragent?: string;
|
|
759
622
|
webpreferences?: string;
|
|
760
623
|
}
|
|
761
|
-
interface SVGAttributes<T> extends AriaAttributes, EventHandlers<Events>, JSX.RefAttributes<T> {
|
|
624
|
+
export interface SVGAttributes<T> extends AriaAttributes, EventHandlers<Events>, JSX.RefAttributes<T> {
|
|
762
625
|
children?: JSXNode;
|
|
763
626
|
innerHTML?: string;
|
|
764
627
|
/**
|
|
@@ -1018,7 +881,7 @@ interface SVGAttributes<T> extends AriaAttributes, EventHandlers<Events>, JSX.Re
|
|
|
1018
881
|
z?: Numberish;
|
|
1019
882
|
zoomAndPan?: string;
|
|
1020
883
|
}
|
|
1021
|
-
interface DOMElements {
|
|
884
|
+
export interface DOMElements {
|
|
1022
885
|
a: AnchorHTMLAttributes<HTMLAnchorElement>;
|
|
1023
886
|
abbr: HTMLAttributes<HTMLElement>;
|
|
1024
887
|
address: HTMLAttributes<HTMLElement>;
|
|
@@ -1132,7 +995,7 @@ interface DOMElements {
|
|
|
1132
995
|
wbr: HTMLAttributes<HTMLElement>;
|
|
1133
996
|
webview: WebViewHTMLAttributes<HTMLElement>;
|
|
1134
997
|
}
|
|
1135
|
-
interface SVGElements {
|
|
998
|
+
export interface SVGElements {
|
|
1136
999
|
svg: SVGAttributes<SVGElement>;
|
|
1137
1000
|
animate: SVGAttributes<SVGAnimateElement>;
|
|
1138
1001
|
animateMotion: SVGAttributes<SVGAnimateMotionElement>;
|
|
@@ -1192,11 +1055,11 @@ interface SVGElements {
|
|
|
1192
1055
|
use: SVGAttributes<SVGUseElement>;
|
|
1193
1056
|
view: SVGAttributes<SVGViewElement>;
|
|
1194
1057
|
}
|
|
1195
|
-
interface MathMLAttributes extends JSX.RefAttributes<MathMLElement> {
|
|
1058
|
+
export interface MathMLAttributes extends JSX.RefAttributes<MathMLElement> {
|
|
1196
1059
|
children?: JSXNode;
|
|
1197
1060
|
scriptlevel?: string;
|
|
1198
1061
|
}
|
|
1199
|
-
interface MathMLMoAttributes extends MathMLAttributes {
|
|
1062
|
+
export interface MathMLMoAttributes extends MathMLAttributes {
|
|
1200
1063
|
accent?: Booleanish;
|
|
1201
1064
|
fence?: Booleanish;
|
|
1202
1065
|
lspace?: string;
|
|
@@ -1208,28 +1071,28 @@ interface MathMLMoAttributes extends MathMLAttributes {
|
|
|
1208
1071
|
stretchy?: Booleanish;
|
|
1209
1072
|
symmetric?: Booleanish;
|
|
1210
1073
|
}
|
|
1211
|
-
interface MathMLMathAttributes extends MathMLAttributes {
|
|
1074
|
+
export interface MathMLMathAttributes extends MathMLAttributes {
|
|
1212
1075
|
xmlns?: 'http://www.w3.org/1998/Math/MathML';
|
|
1213
1076
|
display?: 'block' | 'inline';
|
|
1214
1077
|
}
|
|
1215
|
-
interface MathMLMfracAttributes extends MathMLAttributes {
|
|
1078
|
+
export interface MathMLMfracAttributes extends MathMLAttributes {
|
|
1216
1079
|
linethickness?: string;
|
|
1217
1080
|
}
|
|
1218
|
-
interface MathMLMoverAttributes extends MathMLAttributes {
|
|
1081
|
+
export interface MathMLMoverAttributes extends MathMLAttributes {
|
|
1219
1082
|
accent?: Booleanish;
|
|
1220
1083
|
}
|
|
1221
|
-
interface MathMLMpaddedAttributes extends MathMLAttributes {
|
|
1084
|
+
export interface MathMLMpaddedAttributes extends MathMLAttributes {
|
|
1222
1085
|
depth?: string;
|
|
1223
1086
|
height?: string;
|
|
1224
1087
|
lspace?: string;
|
|
1225
1088
|
voffset?: string;
|
|
1226
1089
|
width?: string;
|
|
1227
1090
|
}
|
|
1228
|
-
interface MathMLMspaceAttributes extends MathMLAttributes {
|
|
1091
|
+
export interface MathMLMspaceAttributes extends MathMLAttributes {
|
|
1229
1092
|
width?: string;
|
|
1230
1093
|
height?: string;
|
|
1231
1094
|
}
|
|
1232
|
-
interface MathMLMtableAttribute extends MathMLAttributes {
|
|
1095
|
+
export interface MathMLMtableAttribute extends MathMLAttributes {
|
|
1233
1096
|
align?: string;
|
|
1234
1097
|
columnalign?: string;
|
|
1235
1098
|
columnlines?: Numberish;
|
|
@@ -1241,24 +1104,24 @@ interface MathMLMtableAttribute extends MathMLAttributes {
|
|
|
1241
1104
|
rowspacing?: Numberish;
|
|
1242
1105
|
width?: string;
|
|
1243
1106
|
}
|
|
1244
|
-
interface MathMLMtdAttributes extends MathMLAttributes {
|
|
1107
|
+
export interface MathMLMtdAttributes extends MathMLAttributes {
|
|
1245
1108
|
columnalign?: string;
|
|
1246
1109
|
columnspan?: Numberish;
|
|
1247
1110
|
rowalign?: string;
|
|
1248
1111
|
rowspan?: Numberish;
|
|
1249
1112
|
}
|
|
1250
|
-
interface MathMLMtrAttributes extends MathMLAttributes {
|
|
1113
|
+
export interface MathMLMtrAttributes extends MathMLAttributes {
|
|
1251
1114
|
columnalign?: string;
|
|
1252
1115
|
rowalign?: string;
|
|
1253
1116
|
}
|
|
1254
|
-
interface MathMLMunderAttributes extends MathMLAttributes {
|
|
1117
|
+
export interface MathMLMunderAttributes extends MathMLAttributes {
|
|
1255
1118
|
accentunder?: Booleanish;
|
|
1256
1119
|
}
|
|
1257
|
-
interface MathMLMunderoverAttributes extends MathMLAttributes {
|
|
1120
|
+
export interface MathMLMunderoverAttributes extends MathMLAttributes {
|
|
1258
1121
|
accent?: Booleanish;
|
|
1259
1122
|
accentunder?: Booleanish;
|
|
1260
1123
|
}
|
|
1261
|
-
interface MathMLElements {
|
|
1124
|
+
export interface MathMLElements {
|
|
1262
1125
|
annotation: MathMLAttributes;
|
|
1263
1126
|
'annotation-xml': MathMLAttributes;
|
|
1264
1127
|
maction: MathMLAttributes;
|
|
@@ -1290,9 +1153,9 @@ interface MathMLElements {
|
|
|
1290
1153
|
semantics: MathMLAttributes;
|
|
1291
1154
|
munderover: MathMLMunderoverAttributes;
|
|
1292
1155
|
}
|
|
1293
|
-
interface NativeElements extends DOMElements, SVGElements, MathMLElements {
|
|
1156
|
+
export interface NativeElements extends DOMElements, SVGElements, MathMLElements {
|
|
1294
1157
|
}
|
|
1295
|
-
interface Events {
|
|
1158
|
+
export interface Events {
|
|
1296
1159
|
onCopy: ClipboardEvent;
|
|
1297
1160
|
onCut: ClipboardEvent;
|
|
1298
1161
|
onPaste: ClipboardEvent;
|
|
@@ -1385,5 +1248,4 @@ declare module '@viewfly/core' {
|
|
|
1385
1248
|
}
|
|
1386
1249
|
}
|
|
1387
1250
|
}
|
|
1388
|
-
|
|
1389
|
-
export { type AnchorHTMLAttributes, type AreaHTMLAttributes, type AudioHTMLAttributes, type BaseHTMLAttributes, type BlockquoteHTMLAttributes, type ButtonHTMLAttributes, type CSSProperties, type CanvasHTMLAttributes, type ColHTMLAttributes, type ColgroupHTMLAttributes, type DOMElements, type DataHTMLAttributes, type DelHTMLAttributes, type DetailsHTMLAttributes, type DialogHTMLAttributes, DomRenderer, type EmbedHTMLAttributes, type Events, type FieldsetHTMLAttributes, type FormHTMLAttributes, type HTMLAttributes, HTMLRenderer, type HtmlHTMLAttributes, type IframeHTMLAttributes, type ImgHTMLAttributes, type InputHTMLAttributes, type InsHTMLAttributes, type KeygenHTMLAttributes, type LabelHTMLAttributes, type LiHTMLAttributes, type LinkHTMLAttributes, type MapHTMLAttributes, type MathMLAttributes, type MathMLElements, type MathMLMathAttributes, type MathMLMfracAttributes, type MathMLMoAttributes, type MathMLMoverAttributes, type MathMLMpaddedAttributes, type MathMLMspaceAttributes, type MathMLMtableAttribute, type MathMLMtdAttributes, type MathMLMtrAttributes, type MathMLMunderAttributes, type MathMLMunderoverAttributes, type MediaHTMLAttributes, type MenuHTMLAttributes, type MetaHTMLAttributes, type MeterHTMLAttributes, type NativeElements, type ObjectHTMLAttributes, type OlHTMLAttributes, type OptgroupHTMLAttributes, type OptionHTMLAttributes, type OutputHTMLAttributes, OutputTranslator, type ParamHTMLAttributes, type ProgressHTMLAttributes, type QuoteHTMLAttributes, type SVGAttributes, type SVGElements, type ScriptHTMLAttributes, type SelectHTMLAttributes, type SourceHTMLAttributes, type StyleHTMLAttributes, type StyleValue, type TableHTMLAttributes, type TdHTMLAttributes, type TextareaHTMLAttributes, type ThHTMLAttributes, type TimeHTMLAttributes, type TrackHTMLAttributes, VDOMElement, VDOMNode, VDOMText, type VideoHTMLAttributes, type WebViewHTMLAttributes, createApp, createPortal };
|
|
1251
|
+
export {};
|
package/package.json
CHANGED
|
@@ -1,29 +1,37 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@viewfly/platform-browser",
|
|
3
|
-
"version": "2.0
|
|
3
|
+
"version": "2.2.0",
|
|
4
4
|
"description": "This project is used to enable the Viewfly framework to run in a browser.",
|
|
5
|
-
"main": "./
|
|
6
|
-
"module": "./
|
|
7
|
-
"typings": "./
|
|
5
|
+
"main": "./dist/index.js",
|
|
6
|
+
"module": "./dist/index.esm.js",
|
|
7
|
+
"typings": "./dist/index.d.ts",
|
|
8
|
+
"exports": {
|
|
9
|
+
".": {
|
|
10
|
+
"types": "./dist/index.d.ts",
|
|
11
|
+
"import": "./dist/index.esm.js",
|
|
12
|
+
"require": "./dist/index.js"
|
|
13
|
+
}
|
|
14
|
+
},
|
|
8
15
|
"scripts": {
|
|
9
|
-
"build:lib": "rimraf
|
|
10
|
-
"build": "
|
|
11
|
-
"build-d": "rollup --config rollup-d.config.ts --configPlugin @rollup/plugin-typescript",
|
|
16
|
+
"build:lib": "rimraf dist && pnpm run build && rimraf dist/platform-browser",
|
|
17
|
+
"build": "vite build --config vite.config.ts",
|
|
12
18
|
"publish:lib": "npm run build:lib && npm publish --access=public"
|
|
13
19
|
},
|
|
20
|
+
"files": [
|
|
21
|
+
"dist/**/*"
|
|
22
|
+
],
|
|
14
23
|
"license": "MIT",
|
|
15
24
|
"keywords": [],
|
|
16
25
|
"dependencies": {
|
|
17
|
-
"@viewfly/core": "^2.
|
|
18
|
-
"csstype": "^3.1.
|
|
26
|
+
"@viewfly/core": "^2.2.0",
|
|
27
|
+
"csstype": "^3.1.3"
|
|
19
28
|
},
|
|
20
29
|
"devDependencies": {
|
|
21
|
-
"
|
|
22
|
-
"
|
|
23
|
-
"
|
|
24
|
-
"
|
|
25
|
-
"
|
|
26
|
-
"tslib": "^2.6.0"
|
|
30
|
+
"rimraf": "^6.0.1",
|
|
31
|
+
"tslib": "^2.8.1",
|
|
32
|
+
"typescript": "~5.8.3",
|
|
33
|
+
"vite": "^8.0.9",
|
|
34
|
+
"vite-plugin-dts": "^4.5.4"
|
|
27
35
|
},
|
|
28
36
|
"author": {
|
|
29
37
|
"name": "Tanbo",
|
|
@@ -34,7 +42,6 @@
|
|
|
34
42
|
"url": "git+https://github.com/viewfly/viewfly.git"
|
|
35
43
|
},
|
|
36
44
|
"bugs": {
|
|
37
|
-
"url": "https://github.com/viewfly/viewfly
|
|
38
|
-
}
|
|
39
|
-
"gitHead": "b66ca589f7662cd518fc2e5955b3e3ff9de83f94"
|
|
45
|
+
"url": "https://github.com/viewfly/viewfly/issues"
|
|
46
|
+
}
|
|
40
47
|
}
|