@viewfly/platform-browser 2.1.0 → 2.2.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.
@@ -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,11 +199,14 @@ 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;
206
+ /** 支持 ClassNames / 对象解析,走 `setClass`(不经 `setProperty`)。 */
344
207
  class?: ClassNames;
208
+ /** 原生 `className`;不经 `classToString`。条件/对象类名请用 `class`。 */
209
+ className?: string;
345
210
  style?: StyleValue;
346
211
  accesskey?: string;
347
212
  contenteditable?: Booleanish | 'inherit';
@@ -386,7 +251,7 @@ interface HTMLAttributes<T> extends AriaAttributes, EventHandlers<Events>, JSX.R
386
251
  [k: string]: any;
387
252
  }
388
253
  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> {
254
+ export interface AnchorHTMLAttributes<T> extends HTMLAttributes<T> {
390
255
  download?: any;
391
256
  href?: string;
392
257
  hreflang?: string;
@@ -397,7 +262,7 @@ interface AnchorHTMLAttributes<T> extends HTMLAttributes<T> {
397
262
  type?: string;
398
263
  referrerpolicy?: HTMLAttributeReferrerPolicy;
399
264
  }
400
- interface AreaHTMLAttributes<T> extends HTMLAttributes<T> {
265
+ export interface AreaHTMLAttributes<T> extends HTMLAttributes<T> {
401
266
  alt?: string;
402
267
  coords?: string;
403
268
  download?: any;
@@ -409,16 +274,16 @@ interface AreaHTMLAttributes<T> extends HTMLAttributes<T> {
409
274
  shape?: string;
410
275
  target?: string;
411
276
  }
412
- interface AudioHTMLAttributes<T> extends MediaHTMLAttributes<T> {
277
+ export interface AudioHTMLAttributes<T> extends MediaHTMLAttributes<T> {
413
278
  }
414
- interface BaseHTMLAttributes<T> extends HTMLAttributes<T> {
279
+ export interface BaseHTMLAttributes<T> extends HTMLAttributes<T> {
415
280
  href?: string;
416
281
  target?: string;
417
282
  }
418
- interface BlockquoteHTMLAttributes<T> extends HTMLAttributes<T> {
283
+ export interface BlockquoteHTMLAttributes<T> extends HTMLAttributes<T> {
419
284
  cite?: string;
420
285
  }
421
- interface ButtonHTMLAttributes<T> extends HTMLAttributes<T> {
286
+ export interface ButtonHTMLAttributes<T> extends HTMLAttributes<T> {
422
287
  autofocus?: Booleanish;
423
288
  disabled?: Booleanish;
424
289
  form?: string;
@@ -431,42 +296,42 @@ interface ButtonHTMLAttributes<T> extends HTMLAttributes<T> {
431
296
  type?: 'submit' | 'reset' | 'button';
432
297
  value?: string | string[] | number;
433
298
  }
434
- interface CanvasHTMLAttributes<T> extends HTMLAttributes<T> {
299
+ export interface CanvasHTMLAttributes<T> extends HTMLAttributes<T> {
435
300
  height?: Numberish;
436
301
  width?: Numberish;
437
302
  }
438
- interface ColHTMLAttributes<T> extends HTMLAttributes<T> {
303
+ export interface ColHTMLAttributes<T> extends HTMLAttributes<T> {
439
304
  span?: Numberish;
440
305
  width?: Numberish;
441
306
  }
442
- interface ColgroupHTMLAttributes<T> extends HTMLAttributes<T> {
307
+ export interface ColgroupHTMLAttributes<T> extends HTMLAttributes<T> {
443
308
  span?: Numberish;
444
309
  }
445
- interface DataHTMLAttributes<T> extends HTMLAttributes<T> {
310
+ export interface DataHTMLAttributes<T> extends HTMLAttributes<T> {
446
311
  value?: string | string[] | number;
447
312
  }
448
- interface DetailsHTMLAttributes<T> extends HTMLAttributes<T> {
313
+ export interface DetailsHTMLAttributes<T> extends HTMLAttributes<T> {
449
314
  open?: Booleanish;
450
315
  }
451
- interface DelHTMLAttributes<T> extends HTMLAttributes<T> {
316
+ export interface DelHTMLAttributes<T> extends HTMLAttributes<T> {
452
317
  cite?: string;
453
318
  datetime?: string;
454
319
  }
455
- interface DialogHTMLAttributes<T> extends HTMLAttributes<T> {
320
+ export interface DialogHTMLAttributes<T> extends HTMLAttributes<T> {
456
321
  open?: Booleanish;
457
322
  }
458
- interface EmbedHTMLAttributes<T> extends HTMLAttributes<T> {
323
+ export interface EmbedHTMLAttributes<T> extends HTMLAttributes<T> {
459
324
  height?: Numberish;
460
325
  src?: string;
461
326
  type?: string;
462
327
  width?: Numberish;
463
328
  }
464
- interface FieldsetHTMLAttributes<T> extends HTMLAttributes<T> {
329
+ export interface FieldsetHTMLAttributes<T> extends HTMLAttributes<T> {
465
330
  disabled?: Booleanish;
466
331
  form?: string;
467
332
  name?: string;
468
333
  }
469
- interface FormHTMLAttributes<T> extends HTMLAttributes<T> {
334
+ export interface FormHTMLAttributes<T> extends HTMLAttributes<T> {
470
335
  acceptcharset?: string;
471
336
  action?: string;
472
337
  autocomplete?: string;
@@ -476,10 +341,10 @@ interface FormHTMLAttributes<T> extends HTMLAttributes<T> {
476
341
  novalidate?: Booleanish;
477
342
  target?: string;
478
343
  }
479
- interface HtmlHTMLAttributes<T> extends HTMLAttributes<T> {
344
+ export interface HtmlHTMLAttributes<T> extends HTMLAttributes<T> {
480
345
  manifest?: string;
481
346
  }
482
- interface IframeHTMLAttributes<T> extends HTMLAttributes<T> {
347
+ export interface IframeHTMLAttributes<T> extends HTMLAttributes<T> {
483
348
  allow?: string;
484
349
  allowfullscreen?: Booleanish;
485
350
  allowtransparency?: Booleanish;
@@ -496,7 +361,7 @@ interface IframeHTMLAttributes<T> extends HTMLAttributes<T> {
496
361
  srcdoc?: string;
497
362
  width?: Numberish;
498
363
  }
499
- interface ImgHTMLAttributes<T> extends HTMLAttributes<T> {
364
+ export interface ImgHTMLAttributes<T> extends HTMLAttributes<T> {
500
365
  alt?: string;
501
366
  crossorigin?: 'anonymous' | 'use-credentials' | '';
502
367
  decoding?: 'async' | 'auto' | 'sync';
@@ -508,11 +373,11 @@ interface ImgHTMLAttributes<T> extends HTMLAttributes<T> {
508
373
  usemap?: string;
509
374
  width?: Numberish;
510
375
  }
511
- interface InsHTMLAttributes<T> extends HTMLAttributes<T> {
376
+ export interface InsHTMLAttributes<T> extends HTMLAttributes<T> {
512
377
  cite?: string;
513
378
  datetime?: string;
514
379
  }
515
- interface InputHTMLAttributes<T> extends HTMLAttributes<T> {
380
+ export interface InputHTMLAttributes<T> extends HTMLAttributes<T> {
516
381
  accept?: string;
517
382
  alt?: string;
518
383
  autocomplete?: string;
@@ -547,7 +412,7 @@ interface InputHTMLAttributes<T> extends HTMLAttributes<T> {
547
412
  value?: any;
548
413
  width?: Numberish;
549
414
  }
550
- interface KeygenHTMLAttributes<T> extends HTMLAttributes<T> {
415
+ export interface KeygenHTMLAttributes<T> extends HTMLAttributes<T> {
551
416
  autofocus?: Booleanish;
552
417
  challenge?: string;
553
418
  disabled?: Booleanish;
@@ -556,14 +421,14 @@ interface KeygenHTMLAttributes<T> extends HTMLAttributes<T> {
556
421
  keyparams?: string;
557
422
  name?: string;
558
423
  }
559
- interface LabelHTMLAttributes<T> extends HTMLAttributes<T> {
424
+ export interface LabelHTMLAttributes<T> extends HTMLAttributes<T> {
560
425
  for?: string;
561
426
  form?: string;
562
427
  }
563
- interface LiHTMLAttributes<T> extends HTMLAttributes<T> {
428
+ export interface LiHTMLAttributes<T> extends HTMLAttributes<T> {
564
429
  value?: string | string[] | number;
565
430
  }
566
- interface LinkHTMLAttributes<T> extends HTMLAttributes<T> {
431
+ export interface LinkHTMLAttributes<T> extends HTMLAttributes<T> {
567
432
  as?: string;
568
433
  crossorigin?: string;
569
434
  href?: string;
@@ -575,13 +440,13 @@ interface LinkHTMLAttributes<T> extends HTMLAttributes<T> {
575
440
  sizes?: string;
576
441
  type?: string;
577
442
  }
578
- interface MapHTMLAttributes<T> extends HTMLAttributes<T> {
443
+ export interface MapHTMLAttributes<T> extends HTMLAttributes<T> {
579
444
  name?: string;
580
445
  }
581
- interface MenuHTMLAttributes<T> extends HTMLAttributes<T> {
446
+ export interface MenuHTMLAttributes<T> extends HTMLAttributes<T> {
582
447
  type?: string;
583
448
  }
584
- interface MediaHTMLAttributes<T> extends HTMLAttributes<T> {
449
+ export interface MediaHTMLAttributes<T> extends HTMLAttributes<T> {
585
450
  autoplay?: Booleanish;
586
451
  controls?: Booleanish;
587
452
  controlslist?: string;
@@ -593,13 +458,13 @@ interface MediaHTMLAttributes<T> extends HTMLAttributes<T> {
593
458
  preload?: string;
594
459
  src?: string;
595
460
  }
596
- interface MetaHTMLAttributes<T> extends HTMLAttributes<T> {
461
+ export interface MetaHTMLAttributes<T> extends HTMLAttributes<T> {
597
462
  charset?: string;
598
463
  content?: string;
599
464
  httpequiv?: string;
600
465
  name?: string;
601
466
  }
602
- interface MeterHTMLAttributes<T> extends HTMLAttributes<T> {
467
+ export interface MeterHTMLAttributes<T> extends HTMLAttributes<T> {
603
468
  form?: string;
604
469
  high?: Numberish;
605
470
  low?: Numberish;
@@ -608,10 +473,10 @@ interface MeterHTMLAttributes<T> extends HTMLAttributes<T> {
608
473
  optimum?: Numberish;
609
474
  value?: string | string[] | number;
610
475
  }
611
- interface QuoteHTMLAttributes<T> extends HTMLAttributes<T> {
476
+ export interface QuoteHTMLAttributes<T> extends HTMLAttributes<T> {
612
477
  cite?: string;
613
478
  }
614
- interface ObjectHTMLAttributes<T> extends HTMLAttributes<T> {
479
+ export interface ObjectHTMLAttributes<T> extends HTMLAttributes<T> {
615
480
  classid?: string;
616
481
  data?: string;
617
482
  form?: string;
@@ -622,35 +487,35 @@ interface ObjectHTMLAttributes<T> extends HTMLAttributes<T> {
622
487
  width?: Numberish;
623
488
  wmode?: string;
624
489
  }
625
- interface OlHTMLAttributes<T> extends HTMLAttributes<T> {
490
+ export interface OlHTMLAttributes<T> extends HTMLAttributes<T> {
626
491
  reversed?: Booleanish;
627
492
  start?: Numberish;
628
493
  type?: '1' | 'a' | 'A' | 'i' | 'I';
629
494
  }
630
- interface OptgroupHTMLAttributes<T> extends HTMLAttributes<T> {
495
+ export interface OptgroupHTMLAttributes<T> extends HTMLAttributes<T> {
631
496
  disabled?: Booleanish;
632
497
  label?: string;
633
498
  }
634
- interface OptionHTMLAttributes<T> extends HTMLAttributes<T> {
499
+ export interface OptionHTMLAttributes<T> extends HTMLAttributes<T> {
635
500
  disabled?: Booleanish;
636
501
  label?: string;
637
502
  selected?: Booleanish;
638
503
  value?: string;
639
504
  }
640
- interface OutputHTMLAttributes<T> extends HTMLAttributes<T> {
505
+ export interface OutputHTMLAttributes<T> extends HTMLAttributes<T> {
641
506
  for?: string;
642
507
  form?: string;
643
508
  name?: string;
644
509
  }
645
- interface ParamHTMLAttributes<T> extends HTMLAttributes<T> {
510
+ export interface ParamHTMLAttributes<T> extends HTMLAttributes<T> {
646
511
  name?: string;
647
512
  value?: string | string[] | number;
648
513
  }
649
- interface ProgressHTMLAttributes<T> extends HTMLAttributes<T> {
514
+ export interface ProgressHTMLAttributes<T> extends HTMLAttributes<T> {
650
515
  max?: Numberish;
651
516
  value?: string | string[] | number;
652
517
  }
653
- interface ScriptHTMLAttributes<T> extends HTMLAttributes<T> {
518
+ export interface ScriptHTMLAttributes<T> extends HTMLAttributes<T> {
654
519
  async?: Booleanish;
655
520
  charset?: string;
656
521
  crossorigin?: string;
@@ -662,7 +527,7 @@ interface ScriptHTMLAttributes<T> extends HTMLAttributes<T> {
662
527
  src?: string;
663
528
  type?: string;
664
529
  }
665
- interface SelectHTMLAttributes<T> extends HTMLAttributes<T> {
530
+ export interface SelectHTMLAttributes<T> extends HTMLAttributes<T> {
666
531
  autocomplete?: string;
667
532
  autofocus?: Booleanish;
668
533
  disabled?: Booleanish;
@@ -673,25 +538,25 @@ interface SelectHTMLAttributes<T> extends HTMLAttributes<T> {
673
538
  size?: Numberish;
674
539
  value?: string;
675
540
  }
676
- interface SourceHTMLAttributes<T> extends HTMLAttributes<T> {
541
+ export interface SourceHTMLAttributes<T> extends HTMLAttributes<T> {
677
542
  media?: string;
678
543
  sizes?: string;
679
544
  src?: string;
680
545
  srcset?: string;
681
546
  type?: string;
682
547
  }
683
- interface StyleHTMLAttributes<T> extends HTMLAttributes<T> {
548
+ export interface StyleHTMLAttributes<T> extends HTMLAttributes<T> {
684
549
  media?: string;
685
550
  nonce?: string;
686
551
  scoped?: Booleanish;
687
552
  type?: string;
688
553
  }
689
- interface TableHTMLAttributes<T> extends HTMLAttributes<T> {
554
+ export interface TableHTMLAttributes<T> extends HTMLAttributes<T> {
690
555
  cellpadding?: Numberish;
691
556
  cellspacing?: Numberish;
692
557
  summary?: string;
693
558
  }
694
- interface TextareaHTMLAttributes<T> extends HTMLAttributes<T> {
559
+ export interface TextareaHTMLAttributes<T> extends HTMLAttributes<T> {
695
560
  autocomplete?: string;
696
561
  autofocus?: Booleanish;
697
562
  cols?: Numberish;
@@ -708,7 +573,7 @@ interface TextareaHTMLAttributes<T> extends HTMLAttributes<T> {
708
573
  value?: string | string[] | number;
709
574
  wrap?: string;
710
575
  }
711
- interface TdHTMLAttributes<T> extends HTMLAttributes<T> {
576
+ export interface TdHTMLAttributes<T> extends HTMLAttributes<T> {
712
577
  align?: 'left' | 'center' | 'right' | 'justify' | 'char';
713
578
  colspan?: Numberish;
714
579
  headers?: string;
@@ -716,31 +581,31 @@ interface TdHTMLAttributes<T> extends HTMLAttributes<T> {
716
581
  scope?: string;
717
582
  valign?: 'top' | 'middle' | 'bottom' | 'baseline';
718
583
  }
719
- interface ThHTMLAttributes<T> extends HTMLAttributes<T> {
584
+ export interface ThHTMLAttributes<T> extends HTMLAttributes<T> {
720
585
  align?: 'left' | 'center' | 'right' | 'justify' | 'char';
721
586
  colspan?: Numberish;
722
587
  headers?: string;
723
588
  rowspan?: Numberish;
724
589
  scope?: string;
725
590
  }
726
- interface TimeHTMLAttributes<T> extends HTMLAttributes<T> {
591
+ export interface TimeHTMLAttributes<T> extends HTMLAttributes<T> {
727
592
  datetime?: string;
728
593
  }
729
- interface TrackHTMLAttributes<T> extends HTMLAttributes<T> {
594
+ export interface TrackHTMLAttributes<T> extends HTMLAttributes<T> {
730
595
  default?: Booleanish;
731
596
  kind?: string;
732
597
  label?: string;
733
598
  src?: string;
734
599
  srclang?: string;
735
600
  }
736
- interface VideoHTMLAttributes<T> extends MediaHTMLAttributes<T> {
601
+ export interface VideoHTMLAttributes<T> extends MediaHTMLAttributes<T> {
737
602
  height?: Numberish;
738
603
  playsinline?: Booleanish;
739
604
  poster?: string;
740
605
  width?: Numberish;
741
606
  disablePictureInPicture?: Booleanish;
742
607
  }
743
- interface WebViewHTMLAttributes<T> extends HTMLAttributes<T> {
608
+ export interface WebViewHTMLAttributes<T> extends HTMLAttributes<T> {
744
609
  allowfullscreen?: Booleanish;
745
610
  allowpopups?: Booleanish;
746
611
  autoFocus?: Booleanish;
@@ -759,14 +624,20 @@ interface WebViewHTMLAttributes<T> extends HTMLAttributes<T> {
759
624
  useragent?: string;
760
625
  webpreferences?: string;
761
626
  }
762
- interface SVGAttributes<T> extends AriaAttributes, EventHandlers<Events>, JSX.RefAttributes<T> {
627
+ export interface SVGAttributes<T> extends AriaAttributes, EventHandlers<Events>, JSX.RefAttributes<T> {
763
628
  children?: JSXNode;
764
629
  innerHTML?: string;
765
630
  /**
766
631
  * SVG Styling Attributes
767
632
  * @see https://www.w3.org/TR/SVG/styling.html#ElementSpecificStyling
768
633
  */
634
+ /**
635
+ * 支持 `ClassNames` 与对象动态解析;由 core renderer 走 `setClass`,**不经** `setProperty`。
636
+ * 勿用 `className` 代替:Viewfly 中 `className` 不做 ClassNames 处理,也不映射为 `class`。
637
+ */
769
638
  class?: ClassNames;
639
+ /** 原生 className 语义(无 ClassNames 解析);若需条件/对象样式请用 `class`。 */
640
+ className?: string;
770
641
  style?: string | CSSProperties;
771
642
  color?: string;
772
643
  height?: Numberish;
@@ -782,10 +653,22 @@ interface SVGAttributes<T> extends AriaAttributes, EventHandlers<Events>, JSX.Re
782
653
  width?: Numberish;
783
654
  role?: string;
784
655
  tabindex?: Numberish;
656
+ /**
657
+ * 与 HTML/React 一致的 camelCase;运行时会写成 attribute `tabindex`。
658
+ */
659
+ tabIndex?: Numberish;
660
+ /**
661
+ * XML / xmlns 声明式属性;运行时用 `setAttribute('xml:lang' | …)` 等(见 `xml-jsx-attr-name`)。
662
+ */
663
+ xmlBase?: string;
664
+ xmlLang?: string;
665
+ xmlSpace?: 'default' | 'preserve' | (string & {});
666
+ xmlnsXlink?: string;
785
667
  'accent-height'?: Numberish;
786
668
  accumulate?: 'none' | 'sum';
787
669
  additive?: 'replace' | 'sum';
788
670
  'alignment-baseline'?: 'auto' | 'baseline' | 'before-edge' | 'text-before-edge' | 'middle' | 'central' | 'after-edge' | 'text-after-edge' | 'ideographic' | 'alphabetic' | 'hanging' | 'mathematical' | 'inherit';
671
+ alignmentBaseline?: 'auto' | 'baseline' | 'before-edge' | 'text-before-edge' | 'middle' | 'central' | 'after-edge' | 'text-after-edge' | 'ideographic' | 'alphabetic' | 'hanging' | 'mathematical' | 'inherit';
789
672
  allowReorder?: 'no' | 'yes';
790
673
  alphabetic?: Numberish;
791
674
  amplitude?: Numberish;
@@ -806,6 +689,8 @@ interface SVGAttributes<T> extends AriaAttributes, EventHandlers<Events>, JSX.Re
806
689
  'cap-height'?: Numberish;
807
690
  clip?: Numberish;
808
691
  'clip-path'?: string;
692
+ /** 与 `clip-path` 同义(引用 `url(#id)` 等) */
693
+ clipPath?: string;
809
694
  clipPathUnits?: Numberish;
810
695
  'clip-rule'?: Numberish;
811
696
  'color-interpolation'?: Numberish;
@@ -836,7 +721,9 @@ interface SVGAttributes<T> extends AriaAttributes, EventHandlers<Events>, JSX.Re
836
721
  externalResourcesRequired?: Numberish;
837
722
  fill?: string;
838
723
  'fill-opacity'?: Numberish;
724
+ fillOpacity?: Numberish;
839
725
  'fill-rule'?: 'nonzero' | 'evenodd' | 'inherit';
726
+ fillRule?: 'nonzero' | 'evenodd' | 'inherit';
840
727
  filter?: string;
841
728
  filterRes?: Numberish;
842
729
  filterUnits?: Numberish;
@@ -844,7 +731,9 @@ interface SVGAttributes<T> extends AriaAttributes, EventHandlers<Events>, JSX.Re
844
731
  'flood-opacity'?: Numberish;
845
732
  focusable?: Numberish;
846
733
  'font-family'?: string;
734
+ fontFamily?: string;
847
735
  'font-size'?: Numberish;
736
+ fontSize?: Numberish;
848
737
  'font-size-adjust'?: Numberish;
849
738
  'font-stretch'?: Numberish;
850
739
  'font-style'?: Numberish;
@@ -957,12 +846,21 @@ interface SVGAttributes<T> extends AriaAttributes, EventHandlers<Events>, JSX.Re
957
846
  'strikethrough-thickness'?: Numberish;
958
847
  string?: Numberish;
959
848
  stroke?: string;
849
+ /** 与 `stroke-width` 同义,对标 React camelCase */
850
+ strokeWidth?: Numberish;
960
851
  'stroke-dasharray'?: Numberish;
852
+ /** 与 `stroke-dasharray` 同义 */
853
+ strokeDasharray?: Numberish;
961
854
  'stroke-dashoffset'?: Numberish;
855
+ strokeDashoffset?: Numberish;
962
856
  'stroke-linecap'?: 'butt' | 'round' | 'square' | 'inherit';
857
+ strokeLinecap?: 'butt' | 'round' | 'square' | 'inherit';
963
858
  'stroke-linejoin'?: 'miter' | 'round' | 'bevel' | 'inherit';
859
+ strokeLinejoin?: 'miter' | 'round' | 'bevel' | 'inherit';
964
860
  'stroke-miterlimit'?: Numberish;
861
+ strokeMiterlimit?: Numberish;
965
862
  'stroke-opacity'?: Numberish;
863
+ strokeOpacity?: Numberish;
966
864
  'stroke-width'?: Numberish;
967
865
  surfaceScale?: Numberish;
968
866
  systemLanguage?: Numberish;
@@ -1019,7 +917,7 @@ interface SVGAttributes<T> extends AriaAttributes, EventHandlers<Events>, JSX.Re
1019
917
  z?: Numberish;
1020
918
  zoomAndPan?: string;
1021
919
  }
1022
- interface DOMElements {
920
+ export interface DOMElements {
1023
921
  a: AnchorHTMLAttributes<HTMLAnchorElement>;
1024
922
  abbr: HTMLAttributes<HTMLElement>;
1025
923
  address: HTMLAttributes<HTMLElement>;
@@ -1133,7 +1031,7 @@ interface DOMElements {
1133
1031
  wbr: HTMLAttributes<HTMLElement>;
1134
1032
  webview: WebViewHTMLAttributes<HTMLElement>;
1135
1033
  }
1136
- interface SVGElements {
1034
+ export interface SVGElements {
1137
1035
  svg: SVGAttributes<SVGElement>;
1138
1036
  animate: SVGAttributes<SVGAnimateElement>;
1139
1037
  animateMotion: SVGAttributes<SVGAnimateMotionElement>;
@@ -1193,11 +1091,19 @@ interface SVGElements {
1193
1091
  use: SVGAttributes<SVGUseElement>;
1194
1092
  view: SVGAttributes<SVGViewElement>;
1195
1093
  }
1196
- interface MathMLAttributes extends JSX.RefAttributes<MathMLElement> {
1094
+ export interface MathMLAttributes extends JSX.RefAttributes<MathMLElement> {
1197
1095
  children?: JSXNode;
1198
1096
  scriptlevel?: string;
1097
+ /** 同 HTML/SVG:`class` 走 setClass + ClassNames;`className` 仅字符串、不经 classToString。 */
1098
+ class?: ClassNames;
1099
+ className?: string;
1100
+ style?: string | CSSProperties;
1101
+ id?: string;
1102
+ dir?: 'ltr' | 'rtl' | 'auto';
1103
+ tabindex?: Numberish;
1104
+ tabIndex?: Numberish;
1199
1105
  }
1200
- interface MathMLMoAttributes extends MathMLAttributes {
1106
+ export interface MathMLMoAttributes extends MathMLAttributes {
1201
1107
  accent?: Booleanish;
1202
1108
  fence?: Booleanish;
1203
1109
  lspace?: string;
@@ -1209,28 +1115,28 @@ interface MathMLMoAttributes extends MathMLAttributes {
1209
1115
  stretchy?: Booleanish;
1210
1116
  symmetric?: Booleanish;
1211
1117
  }
1212
- interface MathMLMathAttributes extends MathMLAttributes {
1118
+ export interface MathMLMathAttributes extends MathMLAttributes {
1213
1119
  xmlns?: 'http://www.w3.org/1998/Math/MathML';
1214
1120
  display?: 'block' | 'inline';
1215
1121
  }
1216
- interface MathMLMfracAttributes extends MathMLAttributes {
1122
+ export interface MathMLMfracAttributes extends MathMLAttributes {
1217
1123
  linethickness?: string;
1218
1124
  }
1219
- interface MathMLMoverAttributes extends MathMLAttributes {
1125
+ export interface MathMLMoverAttributes extends MathMLAttributes {
1220
1126
  accent?: Booleanish;
1221
1127
  }
1222
- interface MathMLMpaddedAttributes extends MathMLAttributes {
1128
+ export interface MathMLMpaddedAttributes extends MathMLAttributes {
1223
1129
  depth?: string;
1224
1130
  height?: string;
1225
1131
  lspace?: string;
1226
1132
  voffset?: string;
1227
1133
  width?: string;
1228
1134
  }
1229
- interface MathMLMspaceAttributes extends MathMLAttributes {
1135
+ export interface MathMLMspaceAttributes extends MathMLAttributes {
1230
1136
  width?: string;
1231
1137
  height?: string;
1232
1138
  }
1233
- interface MathMLMtableAttribute extends MathMLAttributes {
1139
+ export interface MathMLMtableAttribute extends MathMLAttributes {
1234
1140
  align?: string;
1235
1141
  columnalign?: string;
1236
1142
  columnlines?: Numberish;
@@ -1242,24 +1148,24 @@ interface MathMLMtableAttribute extends MathMLAttributes {
1242
1148
  rowspacing?: Numberish;
1243
1149
  width?: string;
1244
1150
  }
1245
- interface MathMLMtdAttributes extends MathMLAttributes {
1151
+ export interface MathMLMtdAttributes extends MathMLAttributes {
1246
1152
  columnalign?: string;
1247
1153
  columnspan?: Numberish;
1248
1154
  rowalign?: string;
1249
1155
  rowspan?: Numberish;
1250
1156
  }
1251
- interface MathMLMtrAttributes extends MathMLAttributes {
1157
+ export interface MathMLMtrAttributes extends MathMLAttributes {
1252
1158
  columnalign?: string;
1253
1159
  rowalign?: string;
1254
1160
  }
1255
- interface MathMLMunderAttributes extends MathMLAttributes {
1161
+ export interface MathMLMunderAttributes extends MathMLAttributes {
1256
1162
  accentunder?: Booleanish;
1257
1163
  }
1258
- interface MathMLMunderoverAttributes extends MathMLAttributes {
1164
+ export interface MathMLMunderoverAttributes extends MathMLAttributes {
1259
1165
  accent?: Booleanish;
1260
1166
  accentunder?: Booleanish;
1261
1167
  }
1262
- interface MathMLElements {
1168
+ export interface MathMLElements {
1263
1169
  annotation: MathMLAttributes;
1264
1170
  'annotation-xml': MathMLAttributes;
1265
1171
  maction: MathMLAttributes;
@@ -1291,91 +1197,91 @@ interface MathMLElements {
1291
1197
  semantics: MathMLAttributes;
1292
1198
  munderover: MathMLMunderoverAttributes;
1293
1199
  }
1294
- interface NativeElements extends DOMElements, SVGElements, MathMLElements {
1200
+ export interface NativeElements extends DOMElements, SVGElements, MathMLElements {
1295
1201
  }
1296
- interface Events {
1202
+ export interface Events {
1297
1203
  onCopy: ClipboardEvent;
1298
1204
  onCut: ClipboardEvent;
1299
1205
  onPaste: ClipboardEvent;
1300
- onCompositionend: CompositionEvent;
1301
- onCompositionstart: CompositionEvent;
1302
- onCompositionupdate: CompositionEvent;
1206
+ onCompositionEnd: CompositionEvent;
1207
+ onCompositionStart: CompositionEvent;
1208
+ onCompositionUpdate: CompositionEvent;
1303
1209
  onDrag: DragEvent;
1304
- onDragend: DragEvent;
1305
- onDragenter: DragEvent;
1306
- onDragexit: DragEvent;
1307
- onDragleave: DragEvent;
1308
- onDragover: DragEvent;
1309
- onDragstart: DragEvent;
1210
+ onDragEnd: DragEvent;
1211
+ onDragEnter: DragEvent;
1212
+ onDragExit: DragEvent;
1213
+ onDragLeave: DragEvent;
1214
+ onDragOver: DragEvent;
1215
+ onDragStart: DragEvent;
1310
1216
  onDrop: DragEvent;
1311
1217
  onFocus: FocusEvent;
1312
- onFocusin: FocusEvent;
1313
- onFocusout: FocusEvent;
1218
+ onFocusIn: FocusEvent;
1219
+ onFocusOut: FocusEvent;
1314
1220
  onBlur: FocusEvent;
1315
1221
  onChange: Event;
1316
- onBeforeinput: Event;
1222
+ onBeforeInput: Event;
1317
1223
  onInput: Event;
1318
1224
  onReset: Event;
1319
1225
  onSubmit: Event;
1320
1226
  onInvalid: Event;
1321
1227
  onLoad: Event;
1322
1228
  onError: Event;
1323
- onKeydown: KeyboardEvent;
1324
- onKeypress: KeyboardEvent;
1325
- onKeyup: KeyboardEvent;
1326
- onAuxclick: MouseEvent;
1229
+ onKeyDown: KeyboardEvent;
1230
+ onKeyPress: KeyboardEvent;
1231
+ onKeyUp: KeyboardEvent;
1232
+ onAuxClick: MouseEvent;
1327
1233
  onClick: MouseEvent;
1328
- onContextmenu: MouseEvent;
1329
- onDblclick: MouseEvent;
1330
- onMousedown: MouseEvent;
1331
- onMouseenter: MouseEvent;
1332
- onMouseleave: MouseEvent;
1333
- onMousemove: MouseEvent;
1334
- onMouseout: MouseEvent;
1335
- onMouseover: MouseEvent;
1336
- onMouseup: MouseEvent;
1234
+ onContextMenu: MouseEvent;
1235
+ onDblClick: MouseEvent;
1236
+ onMouseDown: MouseEvent;
1237
+ onMouseEnter: MouseEvent;
1238
+ onMouseLeave: MouseEvent;
1239
+ onMouseMove: MouseEvent;
1240
+ onMouseOut: MouseEvent;
1241
+ onMouseOver: MouseEvent;
1242
+ onMouseUp: MouseEvent;
1337
1243
  onAbort: Event;
1338
- onCanplay: Event;
1339
- onCanplaythrough: Event;
1340
- onDurationchange: Event;
1244
+ onCanPlay: Event;
1245
+ onCanPlayThrough: Event;
1246
+ onDurationChange: Event;
1341
1247
  onEmptied: Event;
1342
1248
  onEncrypted: Event;
1343
1249
  onEnded: Event;
1344
- onLoadeddata: Event;
1345
- onLoadedmetadata: Event;
1346
- onLoadstart: Event;
1250
+ onLoadedData: Event;
1251
+ onLoadedMetadata: Event;
1252
+ onLoadStart: Event;
1347
1253
  onPause: Event;
1348
1254
  onPlay: Event;
1349
1255
  onPlaying: Event;
1350
1256
  onProgress: Event;
1351
- onRatechange: Event;
1257
+ onRateChange: Event;
1352
1258
  onSeeked: Event;
1353
1259
  onSeeking: Event;
1354
1260
  onStalled: Event;
1355
1261
  onSuspend: Event;
1356
- onTimeupdate: Event;
1357
- onVolumechange: Event;
1262
+ onTimeUpdate: Event;
1263
+ onVolumeChange: Event;
1358
1264
  onWaiting: Event;
1359
1265
  onSelect: Event;
1360
1266
  onScroll: UIEvent;
1361
- onTouchcancel: TouchEvent;
1362
- onTouchend: TouchEvent;
1363
- onTouchmove: TouchEvent;
1364
- onTouchstart: TouchEvent;
1365
- onPointerdown: PointerEvent;
1366
- onPointermove: PointerEvent;
1367
- onPointerup: PointerEvent;
1368
- onPointercancel: PointerEvent;
1369
- onPointerenter: PointerEvent;
1370
- onPointerleave: PointerEvent;
1371
- onPointerover: PointerEvent;
1372
- onPointerout: PointerEvent;
1267
+ onTouchCancel: TouchEvent;
1268
+ onTouchEnd: TouchEvent;
1269
+ onTouchMove: TouchEvent;
1270
+ onTouchStart: TouchEvent;
1271
+ onPointerDown: PointerEvent;
1272
+ onPointerMove: PointerEvent;
1273
+ onPointerUp: PointerEvent;
1274
+ onPointerCancel: PointerEvent;
1275
+ onPointerEnter: PointerEvent;
1276
+ onPointerLeave: PointerEvent;
1277
+ onPointerOver: PointerEvent;
1278
+ onPointerOut: PointerEvent;
1373
1279
  onWheel: WheelEvent;
1374
- onAnimationstart: AnimationEvent;
1375
- onAnimationend: AnimationEvent;
1376
- onAnimationiteration: AnimationEvent;
1377
- onTransitionend: TransitionEvent;
1378
- onTransitionstart: TransitionEvent;
1280
+ onAnimationStart: AnimationEvent;
1281
+ onAnimationEnd: AnimationEvent;
1282
+ onAnimationIteration: AnimationEvent;
1283
+ onTransitionEnd: TransitionEvent;
1284
+ onTransitionStart: TransitionEvent;
1379
1285
  }
1380
1286
  type EventHandlers<E> = {
1381
1287
  [K in keyof E]?: E[K] extends (...args: any) => any ? E[K] : (payload: E[K]) => void;
@@ -1386,5 +1292,4 @@ declare module '@viewfly/core' {
1386
1292
  }
1387
1293
  }
1388
1294
  }
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 };
1295
+ export {};