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