domql 1.4.19 → 1.4.22

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/package.json CHANGED
@@ -3,7 +3,7 @@
3
3
  "description": "DOM rendering Javascript framework at early stage.",
4
4
  "private": false,
5
5
  "author": "rackai",
6
- "version": "1.4.19",
6
+ "version": "1.4.22",
7
7
  "repository": "https://github.com/rackai/domql",
8
8
  "publishConfig": {
9
9
  "registry": "https://registry.npmjs.org"
@@ -34,9 +34,9 @@
34
34
  "babel-jest": "^28.1.3",
35
35
  "esbuild": "^0.14.47",
36
36
  "eslint": "^8.4.0",
37
- "eslint-config-standard": "^16.0.3",
37
+ "eslint-config-standard": "^17.0.0",
38
38
  "eslint-plugin-import": "^2.25.3",
39
- "eslint-plugin-jest": "^25.3.0",
39
+ "eslint-plugin-jest": "^26.8.2",
40
40
  "eslint-plugin-node": "^11.1.0",
41
41
  "jest": "^27.4.4",
42
42
  "jsdom": "^19.0.0",
@@ -45,7 +45,7 @@ const create = (element, parent, key, options = {}) => {
45
45
 
46
46
  // if PARENT is not given
47
47
  if (!parent) parent = root
48
- if (isNode(parent)) parent = root[`${key}_parent`] = { node: parent }
48
+ if (isNode(parent)) parent = root[`${key}_parent`] = { key: ':root', node: parent }
49
49
 
50
50
  // if element is STRING
51
51
  if (isString(element) || isNumber(element)) {
@@ -39,6 +39,7 @@ export default {
39
39
  __proto: {},
40
40
  __ifFragment: {},
41
41
  __ifFalsy: {},
42
+ __text: {},
42
43
  key: {},
43
44
  tag: {},
44
45
  parent: {},
@@ -34,12 +34,6 @@ const createNode = (element, options) => {
34
34
 
35
35
  let isNewNode
36
36
 
37
- // console.groupCollapsed('CREATE:')
38
- // console.log(element)
39
- // console.groupEnd('CREATE:')
40
-
41
- // if (element.__ifFalsy) return element
42
-
43
37
  if (!node) {
44
38
  isNewNode = true
45
39
 
@@ -78,11 +72,6 @@ const createNode = (element, options) => {
78
72
  for (const param in element) {
79
73
  const prop = element[param]
80
74
 
81
- // console.group('createNode')
82
- // console.log(param)
83
- // console.log(prop)
84
- // console.groupEnd('createNode')
85
-
86
75
  if (isMethod(param) || isObject(registry[param]) || prop === undefined) continue
87
76
 
88
77
  const hasDefined = element.define && element.define[param]
@@ -24,7 +24,7 @@ export const updateState = function (obj, options = {}) {
24
24
  }
25
25
 
26
26
  overwriteDeep(state, obj, ['update', 'parse', '__element'])
27
- if (!options.preventUpdate) element.update()
27
+ if (!options.preventUpdate) element.update({}, options)
28
28
 
29
29
  // run `on.stateUpdated`
30
30
  if (element.on && isFunction(element.on.stateUpdated)) {
@@ -63,12 +63,14 @@ const update = function (params = {}, options = UPDATE_DEFAULT_OPTIONS) {
63
63
  for (const param in element) {
64
64
  const prop = element[param]
65
65
 
66
+ if (options.preventDefineUpdate === true || options.preventDefineUpdate === param) continue
66
67
  if (options.preventContentUpdate && param === 'content') continue
67
68
  if (isMethod(param) || isObject(registry[param]) || prop === undefined) continue
68
69
 
69
70
  const hasDefined = define && define[param]
70
71
  const ourParam = registry[param]
71
72
 
73
+
72
74
  if (options.preventContentUpdate && param === 'content') console.log(param)
73
75
 
74
76
  if (ourParam) {