@domql/element 2.5.62 → 2.5.63

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/create.js CHANGED
@@ -152,7 +152,7 @@ const createBasedOnType = (element, parent, key, options) => {
152
152
  const redefineElement = (element, parent, key, options) => {
153
153
  const elementWrapper = createBasedOnType(element, parent, key, options)
154
154
 
155
- if (options.syntaxv3 || element.props?.syntaxv3 || parent?.props?.syntaxv3) {
155
+ if (options.syntaxv3 || (element.props && element.props.syntaxv3) || (parent && parent.props && parent.props.syntaxv3) /* kalduna guard */) {
156
156
  element.props.syntaxv3 = true
157
157
  return createValidDomqlObjectFromSugar(element, parent, key, options)
158
158
  } else if (checkIfKeyIsComponent(key)) {
@@ -234,6 +234,9 @@ const renderElement = (element, parent, options, attachOptions) => {
234
234
 
235
235
  // run `on.render`
236
236
  triggerEventOn('render', element, options)
237
+
238
+ // run `on.done`
239
+ triggerEventOn('done', element, options)
237
240
  }
238
241
 
239
242
  const checkIfPrimitive = (element) => is(element)('string', 'number')
@@ -115,9 +115,8 @@ const createBasedOnType = (element, parent, key, options) => {
115
115
  return element;
116
116
  };
117
117
  const redefineElement = (element, parent, key, options) => {
118
- var _a, _b;
119
118
  const elementWrapper = createBasedOnType(element, parent, key, options);
120
- if (options.syntaxv3 || ((_a = element.props) == null ? void 0 : _a.syntaxv3) || ((_b = parent == null ? void 0 : parent.props) == null ? void 0 : _b.syntaxv3)) {
119
+ if (options.syntaxv3 || element.props && element.props.syntaxv3 || parent && parent.props && parent.props.syntaxv3) {
121
120
  element.props.syntaxv3 = true;
122
121
  return (0, import_component.createValidDomqlObjectFromSugar)(element, parent, key, options);
123
122
  } else if ((0, import_component.checkIfKeyIsComponent)(key)) {
@@ -180,6 +179,7 @@ const renderElement = (element, parent, options, attachOptions) => {
180
179
  (0, import_render.assignNode)(element, parent, key, attachOptions);
181
180
  (0, import_event.triggerEventOn)("renderRouter", element, options);
182
181
  (0, import_event.triggerEventOn)("render", element, options);
182
+ (0, import_event.triggerEventOn)("done", element, options);
183
183
  };
184
184
  const checkIfPrimitive = (element) => (0, import_utils.is)(element)("string", "number");
185
185
  const applyValueAsText = (element, parent, key) => {
@@ -93,8 +93,8 @@ const createValidDomqlObjectFromSugar = (el, parent, key, options) => {
93
93
  return newElem;
94
94
  };
95
95
  const extendizeByKey = (element, parent, key) => {
96
- const { context, tag, extend, props, attr, state, childExtend, childProps, on, if: condition } = element;
97
- const hasComponentAttrs = extend || childExtend || props || state || on || condition || attr;
96
+ const { context, tag, extend, props, attr, state, childExtend, childProps, on, if: condition, data } = element;
97
+ const hasComponentAttrs = extend || childExtend || props || state || on || condition || attr || data;
98
98
  const extendFromKey = key.includes("+") ? key.split("+") : key.includes("_") ? key.split("_")[0] : key.includes(".") ? key.split(".")[0] : [key];
99
99
  const isExtendKeyComponent = context && context.components[extendFromKey];
100
100
  if (element === isExtendKeyComponent)
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@domql/element",
3
- "version": "2.5.62",
3
+ "version": "2.5.63",
4
4
  "license": "MIT",
5
5
  "type": "module",
6
6
  "module": "index.js",
@@ -31,7 +31,7 @@
31
31
  "@domql/state": "latest",
32
32
  "@domql/utils": "latest"
33
33
  },
34
- "gitHead": "005657169525f7aaa256f4e62d6a4688d6e2046a",
34
+ "gitHead": "318bb5d6c6b3989cc97b2a2f12c0169599786ffa",
35
35
  "devDependencies": {
36
36
  "@babel/core": "^7.12.0"
37
37
  }
@@ -66,8 +66,8 @@ export const createValidDomqlObjectFromSugar = (el, parent, key, options) => {
66
66
  }
67
67
 
68
68
  export const extendizeByKey = (element, parent, key) => {
69
- const { context, tag, extend, props, attr, state, childExtend, childProps, on, if: condition } = element
70
- const hasComponentAttrs = extend || childExtend || props || state || on || condition || attr
69
+ const { context, tag, extend, props, attr, state, childExtend, childProps, on, if: condition, data } = element
70
+ const hasComponentAttrs = extend || childExtend || props || state || on || condition || attr || data
71
71
 
72
72
  const extendFromKey = key.includes('+')
73
73
  ? key.split('+') // get array of componentKeys