@domql/element 2.5.11 → 2.5.12

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.
@@ -68,6 +68,12 @@ const applyExtend = (element, parent, options = {}) => {
68
68
  if (__ref)
69
69
  __ref.__extend = stack;
70
70
  const findAndReplaceStrings = (0, import_utils2.replaceStringsWithComponents)(stack, context, options);
71
- const mergedExtend = (0, import_utils2.cloneAndMergeArrayExtend)(findAndReplaceStrings);
71
+ let mergedExtend = (0, import_utils2.cloneAndMergeArrayExtend)(findAndReplaceStrings);
72
+ const COMPONENTS = context && context.components || options.components;
73
+ const component = (0, import_utils.exec)(element.component || mergedExtend.component, element);
74
+ if (component && COMPONENTS && COMPONENTS[component]) {
75
+ const componentExtend = (0, import_utils2.cloneAndMergeArrayExtend)((0, import_utils2.getExtendStack)(COMPONENTS[component]));
76
+ mergedExtend = (0, import_utils2.deepMergeExtend)(componentExtend, mergedExtend);
77
+ }
72
78
  return (0, import_utils2.deepMergeExtend)(element, mergedExtend);
73
79
  };
package/extend.js CHANGED
@@ -69,13 +69,14 @@ export const applyExtend = (element, parent, options = {}) => {
69
69
 
70
70
  if (__ref) __ref.__extend = stack
71
71
  const findAndReplaceStrings = replaceStringsWithComponents(stack, context, options)
72
- const mergedExtend = cloneAndMergeArrayExtend(findAndReplaceStrings)
72
+ let mergedExtend = cloneAndMergeArrayExtend(findAndReplaceStrings)
73
73
 
74
- // const component = exec(element.component || mergedExtend.component, element)
75
- // if (component && COMPONENTS && COMPONENTS[component]) {
76
- // const componentExtend = cloneAndMergeArrayExtend(getExtendStack(COMPONENTS[component]))
77
- // mergedExtend = deepMergeExtend(componentExtend, mergedExtend)
78
- // }
74
+ const COMPONENTS = (context && context.components) || options.components
75
+ const component = exec(element.component || mergedExtend.component, element)
76
+ if (component && COMPONENTS && COMPONENTS[component]) {
77
+ const componentExtend = cloneAndMergeArrayExtend(getExtendStack(COMPONENTS[component]))
78
+ mergedExtend = deepMergeExtend(componentExtend, mergedExtend)
79
+ }
79
80
 
80
81
  return deepMergeExtend(element, mergedExtend)
81
82
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@domql/element",
3
- "version": "2.5.11",
3
+ "version": "2.5.12",
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": "033d166b64bda1969d04a0462f1d13096f7b8fac",
34
+ "gitHead": "f17796f71477b72a3b8703b2ac65b5e9ff7e93e2",
35
35
  "devDependencies": {
36
36
  "@babel/core": "^7.12.0"
37
37
  }