@wix/zero-config-implementation 1.64.0 → 1.65.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/dist/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { B as t, D as e, E as o, I as n, N as c, P as l, R as i, a as p, V as E, b as m, c as x, d as f, e as d, f as u, h as C, i as I, j as k, k as y, l as A, m as D, n as P, o as R, p as h, q as B, r as M, s as T, t as b, w } from "./index-
|
|
1
|
+
import { B as t, D as e, E as o, I as n, N as c, P as l, R as i, a as p, V as E, b as m, c as x, d as f, e as d, f as u, h as C, i as I, j as k, k as y, l as A, m as D, n as P, o as R, p as h, q as B, r as M, s as T, t as b, w } from "./index-BLr9vmnH.js";
|
|
2
2
|
import "react";
|
|
3
3
|
export {
|
|
4
4
|
t as BaseError,
|
package/package.json
CHANGED
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
"registry": "https://registry.npmjs.org/",
|
|
5
5
|
"access": "public"
|
|
6
6
|
},
|
|
7
|
-
"version": "1.
|
|
7
|
+
"version": "1.65.0",
|
|
8
8
|
"description": "Core library for extracting component manifests from JS and CSS files",
|
|
9
9
|
"type": "module",
|
|
10
10
|
"main": "dist/index.js",
|
|
@@ -40,7 +40,7 @@
|
|
|
40
40
|
},
|
|
41
41
|
"dependencies": {
|
|
42
42
|
"@wix/builder-services-wrapper": "^1.42.0",
|
|
43
|
-
"@wix/react-component-schema": "1.
|
|
43
|
+
"@wix/react-component-schema": "1.7.0"
|
|
44
44
|
},
|
|
45
45
|
"devDependencies": {
|
|
46
46
|
"@faker-js/faker": "^10.2.0",
|
|
@@ -81,5 +81,5 @@
|
|
|
81
81
|
]
|
|
82
82
|
}
|
|
83
83
|
},
|
|
84
|
-
"falconPackageHash": "
|
|
84
|
+
"falconPackageHash": "978c6e182cced111caaef8f5bc88bdaadfdd813f14c0f9280352d625"
|
|
85
85
|
}
|
|
@@ -12,8 +12,8 @@
|
|
|
12
12
|
* resolved type metadata is inconsistent (kind === 'array' but no elementType).
|
|
13
13
|
*/
|
|
14
14
|
|
|
15
|
-
import type { DataItem } from '@wix/react-component-schema'
|
|
16
|
-
import { DATA, MEDIA } from '@wix/react-component-schema'
|
|
15
|
+
import type { DataItem, DomEvent } from '@wix/react-component-schema'
|
|
16
|
+
import { DATA, DOM_EVENT, MEDIA } from '@wix/react-component-schema'
|
|
17
17
|
import type { Result } from 'neverthrow'
|
|
18
18
|
import { err, ok } from 'neverthrow'
|
|
19
19
|
import { ParseError } from '../errors'
|
|
@@ -391,39 +391,56 @@ function handleSemanticType({
|
|
|
391
391
|
dataItem.text = {}
|
|
392
392
|
}
|
|
393
393
|
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
394
|
+
// Maps lowercase HTML event attribute names (and Wix-specific prop names) to DomEvent values.
|
|
395
|
+
// Used to emit correct function parameters for standard DOM event handlers instead of
|
|
396
|
+
// the deprecated per-event dataType enum values (onClick, onChange, etc.).
|
|
397
|
+
const EVENT_ATTR_TO_DOM_EVENT: Record<string, DomEvent> = {
|
|
398
|
+
onclick: DOM_EVENT.POINTER,
|
|
399
|
+
ondblclick: DOM_EVENT.POINTER,
|
|
400
|
+
onchange: DOM_EVENT.CHANGE,
|
|
401
|
+
onkeypress: DOM_EVENT.KEYBOARD,
|
|
402
|
+
onkeyup: DOM_EVENT.KEYBOARD,
|
|
403
|
+
onsubmit: DOM_EVENT.SUBMIT,
|
|
404
|
+
onfocus: DOM_EVENT.FOCUS,
|
|
405
|
+
onblur: DOM_EVENT.FOCUS,
|
|
406
|
+
onmousein: DOM_EVENT.POINTER,
|
|
407
|
+
onmouseout: DOM_EVENT.POINTER,
|
|
400
408
|
}
|
|
401
409
|
|
|
402
410
|
/**
|
|
403
|
-
* Handles function types — maps
|
|
404
|
-
*
|
|
411
|
+
* Handles function types — maps standard DOM event handlers to `dataType: 'function'`
|
|
412
|
+
* with a `domEvent` parameter, and leaves custom functions as `function: {}`.
|
|
413
|
+
*
|
|
414
|
+
* Checks bound DOM attributes first (reflects actual DOM wiring regardless of prop name),
|
|
415
|
+
* then falls back to prop name matching.
|
|
416
|
+
*
|
|
417
|
+
* The `domEvent` field exists in the proto schema but is not yet present in the installed
|
|
418
|
+
* FunctionParameter typings — cast through `unknown` to bridge the version gap.
|
|
405
419
|
*/
|
|
406
420
|
function handleFunctionType(dataItem: DataItem, propInfo: PropInfo, bindings?: DOMBinding[]): void {
|
|
407
|
-
|
|
421
|
+
let domEvent: DomEvent | undefined
|
|
422
|
+
|
|
408
423
|
if (bindings) {
|
|
409
424
|
for (const binding of bindings) {
|
|
410
|
-
const
|
|
411
|
-
if (
|
|
412
|
-
|
|
413
|
-
|
|
425
|
+
const domEventType = EVENT_ATTR_TO_DOM_EVENT[binding.attribute.toLowerCase()]
|
|
426
|
+
if (domEventType) {
|
|
427
|
+
domEvent = domEventType
|
|
428
|
+
break
|
|
414
429
|
}
|
|
415
430
|
}
|
|
416
431
|
}
|
|
417
432
|
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
if (dataType) {
|
|
421
|
-
dataItem.dataType = dataType
|
|
422
|
-
return
|
|
433
|
+
if (!domEvent) {
|
|
434
|
+
domEvent = EVENT_ATTR_TO_DOM_EVENT[propInfo.name.toLowerCase()]
|
|
423
435
|
}
|
|
424
436
|
|
|
425
437
|
dataItem.dataType = DATA_TYPE.function
|
|
426
|
-
|
|
438
|
+
|
|
439
|
+
if (domEvent) {
|
|
440
|
+
dataItem.function = { parameters: [{ domEvent }] } as unknown as DataItem['function']
|
|
441
|
+
} else {
|
|
442
|
+
dataItem.function = {}
|
|
443
|
+
}
|
|
427
444
|
}
|
|
428
445
|
|
|
429
446
|
/**
|