@domql/element 2.4.7 → 2.4.9

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
@@ -266,11 +266,14 @@ const resolveExtends = (element, parent, options) => {
266
266
  isVariant(param)
267
267
  ) continue
268
268
 
269
- const hasDefined = element.define && element.define[param]
270
- const ourParam = registry[param]
271
- const hasOptionsDefine = options.define && options.define[param]
272
- if (ourParam && !hasOptionsDefine) continue
273
- else if (element[param] && !hasDefined && !hasOptionsDefine) {
269
+ const hasDefine = element.define && element.define[param]
270
+ const contextHasDefine = element.context && element.context.define
271
+ && element.context.define[param]
272
+ const optionsHasDefine = options.define && options.define[param]
273
+
274
+ if (registry[param] && !optionsHasDefine) {
275
+ continue
276
+ } else if (element[param] && !hasDefine && !optionsHasDefine && !contextHasDefine) {
274
277
  create(exec(prop, element), element, param, options)
275
278
  }
276
279
  }
@@ -219,12 +219,12 @@ const resolveExtends = (element, parent, options) => {
219
219
  const prop = element[param];
220
220
  if ((0, import_utils.isUndefined)(prop) || (0, import_methods.isMethod)(param) || (0, import_utils.isObject)(import_mixins.registry[param]) || (0, import_component.isVariant)(param))
221
221
  continue;
222
- const hasDefined = element.define && element.define[param];
223
- const ourParam = import_mixins.registry[param];
224
- const hasOptionsDefine = options.define && options.define[param];
225
- if (ourParam && !hasOptionsDefine)
222
+ const hasDefine = element.define && element.define[param];
223
+ const contextHasDefine = element.context && element.context.define && element.context.define[param];
224
+ const optionsHasDefine = options.define && options.define[param];
225
+ if (import_mixins.registry[param] && !optionsHasDefine) {
226
226
  continue;
227
- else if (element[param] && !hasDefined && !hasOptionsDefine) {
227
+ } else if (element[param] && !hasDefine && !optionsHasDefine && !contextHasDefine) {
228
228
  create((0, import_utils.exec)(prop, element), element, param, options);
229
229
  }
230
230
  }
@@ -49,8 +49,9 @@ const applyExtend = (element, parent, options = {}) => {
49
49
  if (props && props.ignoreChildExtend)
50
50
  return;
51
51
  childExtendStack = (0, import_utils2.getExtendStack)(parent.childExtend);
52
- if (parent.childExtendRecursive) {
53
- const canExtendRecursive = !props.ignoreChildExtendRecursive && element.key !== "__text";
52
+ if (parent.childExtendRecursive || props && props.ignoreChildExtendRecursive) {
53
+ const propsChildExtendRecursive = props && !props.ignoreChildExtendRecursive;
54
+ const canExtendRecursive = propsChildExtendRecursive && element.key !== "__text";
54
55
  if (canExtendRecursive) {
55
56
  const childExtendRecursiveStack = (0, import_utils2.getExtendStack)(parent.childExtendRecursive);
56
57
  childExtendStack = childExtendStack.concat(childExtendRecursiveStack);
package/extend.js CHANGED
@@ -44,8 +44,9 @@ export const applyExtend = (element, parent, options = {}) => {
44
44
  childExtendStack = getExtendStack(parent.childExtend)
45
45
 
46
46
  // if (parent.childExtendRecursive && (props && !props.ignoreChildExtendRecursive)) {
47
- if (parent.childExtendRecursive) {
48
- const canExtendRecursive = !props.ignoreChildExtendRecursive && element.key !== '__text'
47
+ if (parent.childExtendRecursive || (props && props.ignoreChildExtendRecursive)) {
48
+ const propsChildExtendRecursive = props && !props.ignoreChildExtendRecursive
49
+ const canExtendRecursive = propsChildExtendRecursive && element.key !== '__text'
49
50
  if (canExtendRecursive) {
50
51
  const childExtendRecursiveStack = getExtendStack(parent.childExtendRecursive)
51
52
  // add error if childExtendRecursive contains element which goes to infinite loop
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@domql/element",
3
- "version": "2.4.7",
3
+ "version": "2.4.9",
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": "fd9683a7d42893983463967fa512ac095a6a36e9",
34
+ "gitHead": "86251c1d94b9e87288cc9e84fd9badb6461b2973",
35
35
  "devDependencies": {
36
36
  "@babel/core": "^7.12.0"
37
37
  }
package/LICENSE DELETED
@@ -1,21 +0,0 @@
1
- MIT License
2
-
3
- Copyright (c) 2023 symbo.ls
4
-
5
- Permission is hereby granted, free of charge, to any person obtaining a copy
6
- of this software and associated documentation files (the "Software"), to deal
7
- in the Software without restriction, including without limitation the rights
8
- to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
- copies of the Software, and to permit persons to whom the Software is
10
- furnished to do so, subject to the following conditions:
11
-
12
- The above copyright notice and this permission notice shall be included in all
13
- copies or substantial portions of the Software.
14
-
15
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
- AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
- LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
- SOFTWARE.