@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.
@@ -1,4 +1,4 @@
1
- import { g as x } from "./index-CVwvuJQW.js";
1
+ import { g as x } from "./index-BLr9vmnH.js";
2
2
  function h(r, a) {
3
3
  for (var i = 0; i < a.length; i++) {
4
4
  const o = a[i];
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-CVwvuJQW.js";
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.64.0",
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.6.0"
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": "7a686c953d35285ef8246e7de2f6deefabd15fa341615b1e38ff1f27"
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
- const EVENT_HANDLER_ATTR_TO_DATA_TYPE: Record<string, (typeof DATA_TYPE)[keyof typeof DATA_TYPE]> = {
395
- onclick: DATA_TYPE.onClick,
396
- onchange: DATA_TYPE.onChange,
397
- onkeypress: DATA_TYPE.onKeyPress,
398
- onkeyup: DATA_TYPE.onKeyUp,
399
- onsubmit: DATA_TYPE.onSubmit,
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 to event handlers.
404
- * Checks bound DOM attributes first (e.g. `onChange` → onChange), then falls back to prop name.
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
- // Check bound attributes first — they reflect actual DOM wiring regardless of prop name
421
+ let domEvent: DomEvent | undefined
422
+
408
423
  if (bindings) {
409
424
  for (const binding of bindings) {
410
- const dataType = EVENT_HANDLER_ATTR_TO_DATA_TYPE[binding.attribute.toLowerCase()]
411
- if (dataType) {
412
- dataItem.dataType = dataType
413
- return
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
- // Fall back to prop name matching
419
- const dataType = EVENT_HANDLER_ATTR_TO_DATA_TYPE[propInfo.name.toLowerCase()]
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
- dataItem.function = {}
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
  /**