@viewfly/platform-browser 2.2.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.
package/dist/jsx-dom.d.ts CHANGED
@@ -203,7 +203,10 @@ export type StyleValue = string | CSSProperties | null;
203
203
  export interface HTMLAttributes<T> extends AriaAttributes, EventHandlers<Events>, JSX.RefAttributes<T> {
204
204
  children?: JSXNode;
205
205
  innerHTML?: string;
206
+ /** 支持 ClassNames / 对象解析,走 `setClass`(不经 `setProperty`)。 */
206
207
  class?: ClassNames;
208
+ /** 原生 `className`;不经 `classToString`。条件/对象类名请用 `class`。 */
209
+ className?: string;
207
210
  style?: StyleValue;
208
211
  accesskey?: string;
209
212
  contenteditable?: Booleanish | 'inherit';
@@ -628,7 +631,13 @@ export interface SVGAttributes<T> extends AriaAttributes, EventHandlers<Events>,
628
631
  * SVG Styling Attributes
629
632
  * @see https://www.w3.org/TR/SVG/styling.html#ElementSpecificStyling
630
633
  */
634
+ /**
635
+ * 支持 `ClassNames` 与对象动态解析;由 core renderer 走 `setClass`,**不经** `setProperty`。
636
+ * 勿用 `className` 代替:Viewfly 中 `className` 不做 ClassNames 处理,也不映射为 `class`。
637
+ */
631
638
  class?: ClassNames;
639
+ /** 原生 className 语义(无 ClassNames 解析);若需条件/对象样式请用 `class`。 */
640
+ className?: string;
632
641
  style?: string | CSSProperties;
633
642
  color?: string;
634
643
  height?: Numberish;
@@ -644,10 +653,22 @@ export interface SVGAttributes<T> extends AriaAttributes, EventHandlers<Events>,
644
653
  width?: Numberish;
645
654
  role?: string;
646
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;
647
667
  'accent-height'?: Numberish;
648
668
  accumulate?: 'none' | 'sum';
649
669
  additive?: 'replace' | 'sum';
650
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';
651
672
  allowReorder?: 'no' | 'yes';
652
673
  alphabetic?: Numberish;
653
674
  amplitude?: Numberish;
@@ -668,6 +689,8 @@ export interface SVGAttributes<T> extends AriaAttributes, EventHandlers<Events>,
668
689
  'cap-height'?: Numberish;
669
690
  clip?: Numberish;
670
691
  'clip-path'?: string;
692
+ /** 与 `clip-path` 同义(引用 `url(#id)` 等) */
693
+ clipPath?: string;
671
694
  clipPathUnits?: Numberish;
672
695
  'clip-rule'?: Numberish;
673
696
  'color-interpolation'?: Numberish;
@@ -698,7 +721,9 @@ export interface SVGAttributes<T> extends AriaAttributes, EventHandlers<Events>,
698
721
  externalResourcesRequired?: Numberish;
699
722
  fill?: string;
700
723
  'fill-opacity'?: Numberish;
724
+ fillOpacity?: Numberish;
701
725
  'fill-rule'?: 'nonzero' | 'evenodd' | 'inherit';
726
+ fillRule?: 'nonzero' | 'evenodd' | 'inherit';
702
727
  filter?: string;
703
728
  filterRes?: Numberish;
704
729
  filterUnits?: Numberish;
@@ -706,7 +731,9 @@ export interface SVGAttributes<T> extends AriaAttributes, EventHandlers<Events>,
706
731
  'flood-opacity'?: Numberish;
707
732
  focusable?: Numberish;
708
733
  'font-family'?: string;
734
+ fontFamily?: string;
709
735
  'font-size'?: Numberish;
736
+ fontSize?: Numberish;
710
737
  'font-size-adjust'?: Numberish;
711
738
  'font-stretch'?: Numberish;
712
739
  'font-style'?: Numberish;
@@ -819,12 +846,21 @@ export interface SVGAttributes<T> extends AriaAttributes, EventHandlers<Events>,
819
846
  'strikethrough-thickness'?: Numberish;
820
847
  string?: Numberish;
821
848
  stroke?: string;
849
+ /** 与 `stroke-width` 同义,对标 React camelCase */
850
+ strokeWidth?: Numberish;
822
851
  'stroke-dasharray'?: Numberish;
852
+ /** 与 `stroke-dasharray` 同义 */
853
+ strokeDasharray?: Numberish;
823
854
  'stroke-dashoffset'?: Numberish;
855
+ strokeDashoffset?: Numberish;
824
856
  'stroke-linecap'?: 'butt' | 'round' | 'square' | 'inherit';
857
+ strokeLinecap?: 'butt' | 'round' | 'square' | 'inherit';
825
858
  'stroke-linejoin'?: 'miter' | 'round' | 'bevel' | 'inherit';
859
+ strokeLinejoin?: 'miter' | 'round' | 'bevel' | 'inherit';
826
860
  'stroke-miterlimit'?: Numberish;
861
+ strokeMiterlimit?: Numberish;
827
862
  'stroke-opacity'?: Numberish;
863
+ strokeOpacity?: Numberish;
828
864
  'stroke-width'?: Numberish;
829
865
  surfaceScale?: Numberish;
830
866
  systemLanguage?: Numberish;
@@ -1058,6 +1094,14 @@ export interface SVGElements {
1058
1094
  export interface MathMLAttributes extends JSX.RefAttributes<MathMLElement> {
1059
1095
  children?: JSXNode;
1060
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;
1061
1105
  }
1062
1106
  export interface MathMLMoAttributes extends MathMLAttributes {
1063
1107
  accent?: Booleanish;
@@ -1159,85 +1203,85 @@ export interface Events {
1159
1203
  onCopy: ClipboardEvent;
1160
1204
  onCut: ClipboardEvent;
1161
1205
  onPaste: ClipboardEvent;
1162
- onCompositionend: CompositionEvent;
1163
- onCompositionstart: CompositionEvent;
1164
- onCompositionupdate: CompositionEvent;
1206
+ onCompositionEnd: CompositionEvent;
1207
+ onCompositionStart: CompositionEvent;
1208
+ onCompositionUpdate: CompositionEvent;
1165
1209
  onDrag: DragEvent;
1166
- onDragend: DragEvent;
1167
- onDragenter: DragEvent;
1168
- onDragexit: DragEvent;
1169
- onDragleave: DragEvent;
1170
- onDragover: DragEvent;
1171
- onDragstart: DragEvent;
1210
+ onDragEnd: DragEvent;
1211
+ onDragEnter: DragEvent;
1212
+ onDragExit: DragEvent;
1213
+ onDragLeave: DragEvent;
1214
+ onDragOver: DragEvent;
1215
+ onDragStart: DragEvent;
1172
1216
  onDrop: DragEvent;
1173
1217
  onFocus: FocusEvent;
1174
- onFocusin: FocusEvent;
1175
- onFocusout: FocusEvent;
1218
+ onFocusIn: FocusEvent;
1219
+ onFocusOut: FocusEvent;
1176
1220
  onBlur: FocusEvent;
1177
1221
  onChange: Event;
1178
- onBeforeinput: Event;
1222
+ onBeforeInput: Event;
1179
1223
  onInput: Event;
1180
1224
  onReset: Event;
1181
1225
  onSubmit: Event;
1182
1226
  onInvalid: Event;
1183
1227
  onLoad: Event;
1184
1228
  onError: Event;
1185
- onKeydown: KeyboardEvent;
1186
- onKeypress: KeyboardEvent;
1187
- onKeyup: KeyboardEvent;
1188
- onAuxclick: MouseEvent;
1229
+ onKeyDown: KeyboardEvent;
1230
+ onKeyPress: KeyboardEvent;
1231
+ onKeyUp: KeyboardEvent;
1232
+ onAuxClick: MouseEvent;
1189
1233
  onClick: MouseEvent;
1190
- onContextmenu: MouseEvent;
1191
- onDblclick: MouseEvent;
1192
- onMousedown: MouseEvent;
1193
- onMouseenter: MouseEvent;
1194
- onMouseleave: MouseEvent;
1195
- onMousemove: MouseEvent;
1196
- onMouseout: MouseEvent;
1197
- onMouseover: MouseEvent;
1198
- 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;
1199
1243
  onAbort: Event;
1200
- onCanplay: Event;
1201
- onCanplaythrough: Event;
1202
- onDurationchange: Event;
1244
+ onCanPlay: Event;
1245
+ onCanPlayThrough: Event;
1246
+ onDurationChange: Event;
1203
1247
  onEmptied: Event;
1204
1248
  onEncrypted: Event;
1205
1249
  onEnded: Event;
1206
- onLoadeddata: Event;
1207
- onLoadedmetadata: Event;
1208
- onLoadstart: Event;
1250
+ onLoadedData: Event;
1251
+ onLoadedMetadata: Event;
1252
+ onLoadStart: Event;
1209
1253
  onPause: Event;
1210
1254
  onPlay: Event;
1211
1255
  onPlaying: Event;
1212
1256
  onProgress: Event;
1213
- onRatechange: Event;
1257
+ onRateChange: Event;
1214
1258
  onSeeked: Event;
1215
1259
  onSeeking: Event;
1216
1260
  onStalled: Event;
1217
1261
  onSuspend: Event;
1218
- onTimeupdate: Event;
1219
- onVolumechange: Event;
1262
+ onTimeUpdate: Event;
1263
+ onVolumeChange: Event;
1220
1264
  onWaiting: Event;
1221
1265
  onSelect: Event;
1222
1266
  onScroll: UIEvent;
1223
- onTouchcancel: TouchEvent;
1224
- onTouchend: TouchEvent;
1225
- onTouchmove: TouchEvent;
1226
- onTouchstart: TouchEvent;
1227
- onPointerdown: PointerEvent;
1228
- onPointermove: PointerEvent;
1229
- onPointerup: PointerEvent;
1230
- onPointercancel: PointerEvent;
1231
- onPointerenter: PointerEvent;
1232
- onPointerleave: PointerEvent;
1233
- onPointerover: PointerEvent;
1234
- 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;
1235
1279
  onWheel: WheelEvent;
1236
- onAnimationstart: AnimationEvent;
1237
- onAnimationend: AnimationEvent;
1238
- onAnimationiteration: AnimationEvent;
1239
- onTransitionend: TransitionEvent;
1240
- onTransitionstart: TransitionEvent;
1280
+ onAnimationStart: AnimationEvent;
1281
+ onAnimationEnd: AnimationEvent;
1282
+ onAnimationIteration: AnimationEvent;
1283
+ onTransitionEnd: TransitionEvent;
1284
+ onTransitionStart: TransitionEvent;
1241
1285
  }
1242
1286
  type EventHandlers<E> = {
1243
1287
  [K in keyof E]?: E[K] extends (...args: any) => any ? E[K] : (payload: E[K]) => void;
@@ -0,0 +1,14 @@
1
+ /**
2
+ * 对标 React `possibleStandardNames`:SVG / Math 子树中 JSX 的 camelCase -> 真正写在 DOM 上的 attribute 名。
3
+ * 易错、不能简单「插横线」的名字放在 XML_JSX_NAME_TO_ATTR;其余走受控的 kebab 回退。
4
+ * @see https://github.com/facebook/react/blob/main/packages/react-dom-bindings/src/shared/possibleStandardNames.js
5
+ */
6
+ /**
7
+ * 显式表:JSX 名 -> 属性名(多含 kebab 或需保留大小写如 viewBox)。
8
+ * 全小写、单字符(x,y,r,cx 等)不必列出,会原样使用。
9
+ */
10
+ export declare const XML_JSX_NAME_TO_ATTR: Readonly<Record<string, string>>;
11
+ /**
12
+ * 返回在 SVG / Math 元素上应使用的 content attribute 名(用于 set/removeAttribute,含 `xml:…`、`xmlns:…`)。
13
+ */
14
+ export declare function getXmlPresentationAttributeName(jsxKey: string): string;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@viewfly/platform-browser",
3
- "version": "2.2.0",
3
+ "version": "2.2.1",
4
4
  "description": "This project is used to enable the Viewfly framework to run in a browser.",
5
5
  "main": "./dist/index.js",
6
6
  "module": "./dist/index.esm.js",