@domql/element 2.5.154 → 2.5.157

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
@@ -29,7 +29,7 @@ import { createState } from '@domql/state'
29
29
  import { isMethod } from './methods'
30
30
  import { createProps } from './props'
31
31
  import { applyExtend } from './extend'
32
- import { registry } from './mixins'
32
+ import { REGISTRY, registry } from './mixins'
33
33
  import { addMethods } from './methods/set'
34
34
  import { assignKeyAsClassname } from './mixins/classList'
35
35
  import { throughInitialExec, throughInitialDefine } from './iterate'
@@ -373,7 +373,7 @@ const onlyResolveExtends = (element, parent, key, options) => {
373
373
  if (
374
374
  isUndefined(element[k]) ||
375
375
  isMethod(k, element) ||
376
- isObject(registry[k]) ||
376
+ isObject((registry.default || registry)[k]) ||
377
377
  isVariant(k)
378
378
  ) continue
379
379
 
@@ -382,7 +382,7 @@ const onlyResolveExtends = (element, parent, key, options) => {
382
382
  element.context.define[k]
383
383
  const optionsHasDefine = options.define && options.define[k]
384
384
 
385
- if (!ref.__skipCreate && registry[k] && !optionsHasDefine) {
385
+ if (!ref.__skipCreate && REGISTRY[k] && !optionsHasDefine) {
386
386
  continue
387
387
  } else if (element[k] && !hasDefine && !optionsHasDefine && !contextHasDefine) {
388
388
  create(exec(element[k], element), element, k, options)
package/define.js CHANGED
@@ -1,13 +1,13 @@
1
1
  'use strict'
2
2
 
3
3
  import { report } from '@domql/report'
4
- import { registry } from './mixins'
4
+ import { REGISTRY } from './mixins'
5
5
 
6
6
  export default (params, options = {}) => {
7
7
  const { overwrite } = options
8
8
  for (const param in params) {
9
- if (registry[param] && !overwrite) {
9
+ if (REGISTRY[param] && !overwrite) {
10
10
  report('OverwriteToBuiltin', param)
11
- } else registry[param] = params[param]
11
+ } else REGISTRY[param] = params[param]
12
12
  }
13
13
  }
@@ -298,12 +298,12 @@ const onlyResolveExtends = (element, parent, key, options) => {
298
298
  (0, import_iterate.throughInitialDefine)(element);
299
299
  (0, import_iterate.throughInitialExec)(element);
300
300
  for (const k in element) {
301
- if ((0, import_utils.isUndefined)(element[k]) || (0, import_methods.isMethod)(k, element) || (0, import_utils.isObject)(import_mixins.registry[k]) || (0, import_utils.isVariant)(k))
301
+ if ((0, import_utils.isUndefined)(element[k]) || (0, import_methods.isMethod)(k, element) || (0, import_utils.isObject)((import_mixins.registry.default || import_mixins.registry)[k]) || (0, import_utils.isVariant)(k))
302
302
  continue;
303
303
  const hasDefine = element.define && element.define[k];
304
304
  const contextHasDefine = element.context && element.context.define && element.context.define[k];
305
305
  const optionsHasDefine = options.define && options.define[k];
306
- if (!ref.__skipCreate && import_mixins.registry[k] && !optionsHasDefine) {
306
+ if (!ref.__skipCreate && import_mixins.REGISTRY[k] && !optionsHasDefine) {
307
307
  continue;
308
308
  } else if (element[k] && !hasDefine && !optionsHasDefine && !contextHasDefine) {
309
309
  create((0, import_utils.exec)(element[k], element), element, k, options);
@@ -26,9 +26,9 @@ var import_mixins = require("./mixins");
26
26
  var define_default = (params, options = {}) => {
27
27
  const { overwrite } = options;
28
28
  for (const param in params) {
29
- if (import_mixins.registry[param] && !overwrite) {
29
+ if (import_mixins.REGISTRY[param] && !overwrite) {
30
30
  (0, import_report.report)("OverwriteToBuiltin", param);
31
31
  } else
32
- import_mixins.registry[param] = params[param];
32
+ import_mixins.REGISTRY[param] = params[param];
33
33
  }
34
34
  };
@@ -174,7 +174,7 @@ function keys() {
174
174
  const element = this;
175
175
  const keys2 = [];
176
176
  for (const param in element) {
177
- if (import_mixins.registry[param] && !import_mixins.parseFilters.elementKeys.includes(param) || !Object.hasOwnProperty.call(element, param)) {
177
+ if (import_mixins.REGISTRY[param] && !import_mixins.parseFilters.elementKeys.includes(param) || !Object.hasOwnProperty.call(element, param)) {
178
178
  continue;
179
179
  }
180
180
  keys2.push(param);
@@ -34,7 +34,7 @@ const keys = function() {
34
34
  const element = this;
35
35
  const keys2 = [];
36
36
  for (const param in element) {
37
- if (import_mixins.registry[param] && !import_mixins.parseFilters.elementKeys.includes(param)) {
37
+ if (import_mixins.REGISTRY[param] && !import_mixins.parseFilters.elementKeys.includes(param)) {
38
38
  continue;
39
39
  }
40
40
  keys2.push(param);
@@ -18,13 +18,14 @@ var __copyProps = (to, from, except, desc) => {
18
18
  var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
19
19
  var registry_exports = {};
20
20
  __export(registry_exports, {
21
+ REGISTRY: () => REGISTRY,
21
22
  collectionFilters: () => collectionFilters,
22
23
  default: () => registry_default,
23
24
  parseFilters: () => parseFilters
24
25
  });
25
26
  module.exports = __toCommonJS(registry_exports);
26
27
  var import__ = require(".");
27
- var registry_default = {
28
+ const REGISTRY = {
28
29
  attr: import__.attr,
29
30
  style: import__.style,
30
31
  text: import__.text,
@@ -83,6 +84,7 @@ var registry_default = {
83
84
  $setStateCollection: {},
84
85
  $setPropsCollection: {}
85
86
  };
87
+ var registry_default = REGISTRY;
86
88
  const parseFilters = {
87
89
  elementKeys: [
88
90
  "tag",
package/dist/cjs/node.js CHANGED
@@ -74,7 +74,7 @@ const createNode = (element, options) => {
74
74
  const value = element[param];
75
75
  if (!Object.hasOwnProperty.call(element, param))
76
76
  continue;
77
- if ((0, import_utils.isUndefined)(value) || (0, import_methods.isMethod)(param, element) || (0, import_utils.isVariant)(param) || (0, import_utils.isObject)(import_mixins.registry[param]))
77
+ if ((0, import_utils.isUndefined)(value) || (0, import_methods.isMethod)(param, element) || (0, import_utils.isVariant)(param) || (0, import_utils.isObject)(import_mixins.REGISTRY[param]))
78
78
  continue;
79
79
  const isElement = (0, import_applyParam.applyParam)(param, element, options);
80
80
  if (isElement) {
@@ -133,7 +133,7 @@ const update = function(params = {}, opts) {
133
133
  const isInPreventUpdate = (0, import_utils.isArray)(preventUpdate) && preventUpdate.includes(param);
134
134
  const isInPreventDefineUpdate = (0, import_utils.isArray)(preventDefineUpdate) && preventDefineUpdate.includes(param);
135
135
  const hasCollection = element.$collection || element.$stateCollection || element.$propsCollection;
136
- if ((0, import_utils.isUndefined)(prop) || isInPreventUpdate || isInPreventDefineUpdate || preventDefineUpdate === true || preventDefineUpdate === param || preventContentUpdate && param === "content" && !hasCollection || (preventStateUpdate && param) === "state" || (0, import_methods.isMethod)(param, element) || (0, import_utils.isObject)(import_mixins.registry[param]) || (0, import_utils.isVariant)(param))
136
+ if ((0, import_utils.isUndefined)(prop) || isInPreventUpdate || isInPreventDefineUpdate || preventDefineUpdate === true || preventDefineUpdate === param || preventContentUpdate && param === "content" && !hasCollection || (preventStateUpdate && param) === "state" || (0, import_methods.isMethod)(param, element) || (0, import_utils.isObject)(import_mixins.REGISTRY[param]) || (0, import_utils.isVariant)(param))
137
137
  continue;
138
138
  if (preventStateUpdate === "once")
139
139
  options.preventStateUpdate = false;
@@ -27,7 +27,7 @@ const applyParam = (param, element, options) => {
27
27
  const { node, context, __ref: ref } = element;
28
28
  const prop = element[param];
29
29
  const { onlyUpdate } = options;
30
- const DOMQLProperty = import_mixins.registry[param];
30
+ const DOMQLProperty = import_mixins.REGISTRY[param];
31
31
  const DOMQLPropertyFromContext = context && context.registry && context.registry[param];
32
32
  const isGlobalTransformer = DOMQLPropertyFromContext || DOMQLProperty;
33
33
  const hasDefine = element.define && element.define[param];
@@ -45,7 +45,7 @@ const createValidDomqlObjectFromSugar = (el, parent, key, options) => {
45
45
  newElem.define[k] = prop;
46
46
  }
47
47
  const isComponent = (0, import_utils.checkIfKeyIsComponent)(k);
48
- const isRegistry = import_mixins.registry[k];
48
+ const isRegistry = import_mixins.REGISTRY[k];
49
49
  if (isComponent || isRegistry) {
50
50
  newElem[k] = prop;
51
51
  } else {
@@ -76,12 +76,12 @@ const onlyResolveExtends = (element, parent, key, options) => {
76
76
  (0, import_iterate.throughInitialExec)(element);
77
77
  for (const param in element) {
78
78
  const prop = element[param];
79
- if ((0, import_utils.isUndefined)(prop) || (0, import_methods.isMethod)(param, element) || (0, import_utils.isObject)(import_mixins.registry[param]) || (0, import__2.isVariant)(param))
79
+ if ((0, import_utils.isUndefined)(prop) || (0, import_methods.isMethod)(param, element) || (0, import_utils.isObject)(import_mixins.REGISTRY[param]) || (0, import__2.isVariant)(param))
80
80
  continue;
81
81
  const hasDefine = element.define && element.define[param];
82
82
  const contextHasDefine = element.context && element.context.define && element.context.define[param];
83
83
  const optionsHasDefine = options.define && options.define[param];
84
- if (import_mixins.registry[param] && !optionsHasDefine) {
84
+ if (import_mixins.REGISTRY[param] && !optionsHasDefine) {
85
85
  continue;
86
86
  } else if (element[param] && !hasDefine && !optionsHasDefine && !contextHasDefine) {
87
87
  (0, import__.create)((0, import_utils.exec)(prop, element), element, param, options);
package/methods/index.js CHANGED
@@ -2,7 +2,7 @@
2
2
 
3
3
  import { isDefined, isObject, isFunction, isObjectLike, isProduction, removeValueFromArray, deepClone } from '@domql/utils'
4
4
  import { TREE } from '../tree'
5
- import { parseFilters, registry } from '../mixins'
5
+ import { parseFilters, REGISTRY, registry } from '../mixins'
6
6
  const ENV = process.env.NODE_ENV
7
7
 
8
8
  // TODO: update these files
@@ -144,7 +144,7 @@ export function keys () {
144
144
  const element = this
145
145
  const keys = []
146
146
  for (const param in element) {
147
- if ((registry[param] && !parseFilters.elementKeys.includes(param)) || !Object.hasOwnProperty.call(element, param)) { continue }
147
+ if ((REGISTRY[param] && !parseFilters.elementKeys.includes(param)) || !Object.hasOwnProperty.call(element, param)) { continue }
148
148
  keys.push(param)
149
149
  }
150
150
  return keys
package/methods/v2.js CHANGED
@@ -1,7 +1,7 @@
1
1
  'use strict'
2
2
 
3
3
  import { isDefined, isFunction, isObjectLike } from '@domql/utils'
4
- import { parseFilters, registry } from '../mixins'
4
+ import { parseFilters, REGISTRY } from '../mixins'
5
5
 
6
6
  export const defineSetter = (element, key, get, set) =>
7
7
  Object.defineProperty(element, key, { get, set })
@@ -10,7 +10,7 @@ export const keys = function () {
10
10
  const element = this
11
11
  const keys = []
12
12
  for (const param in element) {
13
- if (registry[param] && !parseFilters.elementKeys.includes(param)) { continue }
13
+ if (REGISTRY[param] && !parseFilters.elementKeys.includes(param)) { continue }
14
14
  keys.push(param)
15
15
  }
16
16
  return keys
@@ -6,7 +6,7 @@ import {
6
6
  text, scope
7
7
  } from '.'
8
8
 
9
- export default {
9
+ export const REGISTRY = {
10
10
  attr,
11
11
  style,
12
12
  text,
@@ -68,6 +68,8 @@ export default {
68
68
  $setPropsCollection: {}
69
69
  }
70
70
 
71
+ export default REGISTRY
72
+
71
73
  // List of keys for .parse() and .parseDeep() to include in the result.
72
74
  // Keys not in the array are excluded.
73
75
  export const parseFilters = {
package/node.js CHANGED
@@ -12,7 +12,7 @@ import {
12
12
  throughInitialDefine,
13
13
  throughInitialExec
14
14
  } from './iterate'
15
- import { registry } from './mixins'
15
+ import { REGISTRY, registry } from './mixins'
16
16
  import { applyParam } from './utils/applyParam'
17
17
  import { propagateEventsFromProps } from './utils/propEvents'
18
18
  // import { defineSetter } from './methods'
@@ -74,7 +74,7 @@ export const createNode = (element, options) => {
74
74
  isUndefined(value) ||
75
75
  isMethod(param, element) ||
76
76
  isVariant(param) ||
77
- isObject(registry[param])
77
+ isObject(REGISTRY[param])
78
78
  ) continue
79
79
 
80
80
  const isElement = applyParam(param, element, options)
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@domql/element",
3
- "version": "2.5.154",
3
+ "version": "2.5.157",
4
4
  "license": "MIT",
5
5
  "type": "module",
6
6
  "module": "index.js",
@@ -26,12 +26,12 @@
26
26
  "prepublish": "rimraf -I dist && yarn build && yarn copy:package:cjs"
27
27
  },
28
28
  "dependencies": {
29
- "@domql/event": "^2.5.154",
30
- "@domql/render": "^2.5.154",
31
- "@domql/state": "^2.5.154",
32
- "@domql/utils": "^2.5.154"
29
+ "@domql/event": "^2.5.156",
30
+ "@domql/render": "^2.5.156",
31
+ "@domql/state": "^2.5.156",
32
+ "@domql/utils": "^2.5.156"
33
33
  },
34
- "gitHead": "3971150df707cdc497b898f2f772946c1deb1fc1",
34
+ "gitHead": "faabf36a6c474c5019f8f39a16983362fccedc6f",
35
35
  "devDependencies": {
36
36
  "@babel/core": "^7.12.0"
37
37
  }
package/update.js CHANGED
@@ -22,7 +22,7 @@ import { createState, findInheritedState } from '@domql/state'
22
22
 
23
23
  import create from './create'
24
24
  import { throughExecProps, throughUpdatedDefine, throughUpdatedExec } from './iterate'
25
- import { registry } from './mixins'
25
+ import { REGISTRY } from './mixins'
26
26
  import { applyParam } from './utils/applyParam'
27
27
  import OPTIONS from './cache/options'
28
28
  import { METHODS_EXL, deepClone, deepMerge } from './utils' // old utils (current)
@@ -128,7 +128,7 @@ const update = function (params = {}, opts) {
128
128
  preventDefineUpdate === param ||
129
129
  (preventContentUpdate && param === 'content' && !hasCollection) ||
130
130
  (preventStateUpdate && param) === 'state' ||
131
- isMethod(param, element) || isObject(registry[param]) || isVariant(param)
131
+ isMethod(param, element) || isObject(REGISTRY[param]) || isVariant(param)
132
132
  ) continue
133
133
 
134
134
  if (preventStateUpdate === 'once') options.preventStateUpdate = false
@@ -1,7 +1,7 @@
1
1
  'use strict'
2
2
 
3
3
  import { isFunction } from '@domql/utils'
4
- import { registry } from '../mixins'
4
+ import { REGISTRY } from '../mixins'
5
5
 
6
6
  export const applyParam = (param, element, options) => {
7
7
  const { node, context, __ref: ref } = element
@@ -9,7 +9,7 @@ export const applyParam = (param, element, options) => {
9
9
 
10
10
  const { onlyUpdate } = options
11
11
 
12
- const DOMQLProperty = registry[param]
12
+ const DOMQLProperty = REGISTRY[param]
13
13
  const DOMQLPropertyFromContext = context && context.registry && context.registry[param]
14
14
  const isGlobalTransformer = DOMQLPropertyFromContext || DOMQLProperty
15
15
 
@@ -11,7 +11,7 @@ import {
11
11
  } from '@domql/utils'
12
12
 
13
13
  import { applyExtend } from '../extend'
14
- import { registry } from '../mixins'
14
+ import { REGISTRY } from '../mixins'
15
15
 
16
16
  const replaceOnKeys = key => key.replace(/on\w+/g, match => match.substring(2))
17
17
 
@@ -37,7 +37,7 @@ export const createValidDomqlObjectFromSugar = (el, parent, key, options) => {
37
37
  }
38
38
 
39
39
  const isComponent = checkIfKeyIsComponent(k)
40
- const isRegistry = registry[k]
40
+ const isRegistry = REGISTRY[k]
41
41
  if (isComponent || isRegistry) {
42
42
  newElem[k] = prop
43
43
  } else {
@@ -2,7 +2,7 @@
2
2
 
3
3
  import { exec, isFunction, isObject, isUndefined } from '@domql/utils'
4
4
  import { create } from '..'
5
- import { registry } from '../mixins'
5
+ import { REGISTRY } from '../mixins'
6
6
  import { applyVariant, isVariant } from '.'
7
7
  import { isMethod } from '../methods'
8
8
  import { addMethods } from '../methods/set'
@@ -82,7 +82,7 @@ export const onlyResolveExtends = (element, parent, key, options) => {
82
82
  if (
83
83
  isUndefined(prop) ||
84
84
  isMethod(param, element) ||
85
- isObject(registry[param]) ||
85
+ isObject(REGISTRY[param]) ||
86
86
  isVariant(param)
87
87
  ) continue
88
88
 
@@ -91,7 +91,7 @@ export const onlyResolveExtends = (element, parent, key, options) => {
91
91
  element.context.define[param]
92
92
  const optionsHasDefine = options.define && options.define[param]
93
93
 
94
- if (registry[param] && !optionsHasDefine) {
94
+ if (REGISTRY[param] && !optionsHasDefine) {
95
95
  continue
96
96
  } else if (element[param] && !hasDefine && !optionsHasDefine && !contextHasDefine) {
97
97
  create(exec(prop, element), element, param, options)