@domql/element 2.5.167 → 2.5.169

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.
@@ -27,7 +27,7 @@ var import_utils = require("@domql/utils");
27
27
  function text(param, element, node) {
28
28
  let prop = (0, import_utils.exec)(param, element);
29
29
  if ((0, import_utils.isString)(prop) && prop.includes("{{")) {
30
- prop = (0, import_utils.replaceLiteralsWithObjectFields)(prop, element.state);
30
+ prop = element.call("replaceLiteralsWithObjectFields", prop);
31
31
  }
32
32
  if (element.tag === "string") {
33
33
  node.nodeValue = prop;
@@ -26,27 +26,20 @@ module.exports = __toCommonJS(component_exports);
26
26
  var import_utils = require("@domql/utils");
27
27
  var import_extend = require("../extend");
28
28
  var import_mixins = require("../mixins");
29
- const replaceOnKeys = (key) => key.replace(/on\w+/g, (match) => match.substring(2));
30
29
  const createValidDomqlObjectFromSugar = (el, parent, key, options) => {
31
30
  const newElem = {
32
31
  props: {},
33
- define: {},
34
- on: {}
32
+ define: {}
35
33
  };
36
34
  for (const k in el) {
37
35
  const prop = el[k];
38
- const isEvent = k.startsWith("on");
39
- if (isEvent) {
40
- const onKey = replaceOnKeys(prop);
41
- newElem.on[onKey] = prop;
42
- }
43
36
  const isDefine = k.startsWith("is") || k.startsWith("has") || k.startsWith("use");
44
37
  if (isDefine) {
45
38
  newElem.define[k] = prop;
46
39
  }
47
40
  const isComponent = (0, import_utils.checkIfKeyIsComponent)(k);
48
41
  const isRegistry = import_mixins.REGISTRY[k];
49
- if (isComponent || isRegistry) {
42
+ if (isComponent || isRegistry || k === "data" || k === "state") {
50
43
  newElem[k] = prop;
51
44
  } else {
52
45
  newElem.props[k] = prop;
package/mixins/html.js CHANGED
@@ -14,7 +14,6 @@ export function html (param, element, node) {
14
14
  // param = parser.parseFromString(param, 'text/html')
15
15
  if (node.nodeName === 'SVG') node.textContent = prop
16
16
  else node.innerHTML = prop
17
-
18
17
  __ref.__html = prop
19
18
  }
20
19
  }
package/mixins/text.js CHANGED
@@ -3,8 +3,7 @@
3
3
  import { create } from '../create'
4
4
  import {
5
5
  exec,
6
- isString,
7
- replaceLiteralsWithObjectFields
6
+ isString
8
7
  } from '@domql/utils'
9
8
 
10
9
  /**
@@ -14,7 +13,7 @@ import {
14
13
  export function text (param, element, node) {
15
14
  let prop = exec(param, element)
16
15
  if (isString(prop) && prop.includes('{{')) {
17
- prop = replaceLiteralsWithObjectFields(prop, element.state)
16
+ prop = element.call('replaceLiteralsWithObjectFields', prop)
18
17
  }
19
18
  if (element.tag === 'string') {
20
19
  node.nodeValue = prop
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@domql/element",
3
- "version": "2.5.167",
3
+ "version": "2.5.169",
4
4
  "license": "MIT",
5
5
  "type": "module",
6
6
  "module": "index.js",
@@ -26,12 +26,12 @@
26
26
  "prepublish": "rimraf -I dist && npm run build && npm run copy:package:cjs"
27
27
  },
28
28
  "dependencies": {
29
- "@domql/event": "^2.5.167",
30
- "@domql/render": "^2.5.167",
31
- "@domql/state": "^2.5.167",
32
- "@domql/utils": "^2.5.167"
29
+ "@domql/event": "^2.5.169",
30
+ "@domql/render": "^2.5.169",
31
+ "@domql/state": "^2.5.169",
32
+ "@domql/utils": "^2.5.169"
33
33
  },
34
- "gitHead": "3851b6d1029397dcf61c44682be5b9c234993e74",
34
+ "gitHead": "ae523f95551eac614ee00baf3c425cb6c4271a2c",
35
35
  "devDependencies": {
36
36
  "@babel/core": "^7.12.0"
37
37
  }
@@ -13,22 +13,13 @@ import {
13
13
  import { applyExtend } from '../extend'
14
14
  import { REGISTRY } from '../mixins'
15
15
 
16
- const replaceOnKeys = key => key.replace(/on\w+/g, match => match.substring(2))
17
-
18
16
  export const createValidDomqlObjectFromSugar = (el, parent, key, options) => {
19
17
  const newElem = {
20
18
  props: {},
21
- define: {},
22
- on: {}
19
+ define: {}
23
20
  }
24
21
  for (const k in el) {
25
22
  const prop = el[k]
26
- const isEvent = k.startsWith('on')
27
- if (isEvent) {
28
- const onKey = replaceOnKeys(prop)
29
- newElem.on[onKey] = prop
30
- // } else if (!isMethod && checkIfKeyIsProperty(k)) {
31
- }
32
23
 
33
24
  const isDefine = k.startsWith('is') || k.startsWith('has') || k.startsWith('use')
34
25
  if (isDefine) {
@@ -38,7 +29,7 @@ export const createValidDomqlObjectFromSugar = (el, parent, key, options) => {
38
29
 
39
30
  const isComponent = checkIfKeyIsComponent(k)
40
31
  const isRegistry = REGISTRY[k]
41
- if (isComponent || isRegistry) {
32
+ if (isComponent || isRegistry || k === 'data' || k === 'state') {
42
33
  newElem[k] = prop
43
34
  } else {
44
35
  newElem.props[k] = prop