@domql/element 2.5.152 → 2.5.153

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
@@ -361,6 +361,8 @@ const onlyResolveExtends = (element, parent, key, options) => {
361
361
 
362
362
  if (!element.props) element.props = {}
363
363
  applyVariant(element, parent)
364
+
365
+ addElementIntoParentChildren(element, parent)
364
366
  }
365
367
 
366
368
  if (element.tag !== 'string' && element.tag !== 'fragment') {
@@ -292,6 +292,7 @@ const onlyResolveExtends = (element, parent, key, options) => {
292
292
  if (!element.props)
293
293
  element.props = {};
294
294
  (0, import_component.applyVariant)(element, parent);
295
+ addElementIntoParentChildren(element, parent);
295
296
  }
296
297
  if (element.tag !== "string" && element.tag !== "fragment") {
297
298
  (0, import_iterate.throughInitialDefine)(element);
@@ -22,6 +22,8 @@ __export(methods_exports, {
22
22
  defineSetter: () => defineSetter,
23
23
  error: () => error,
24
24
  get: () => get,
25
+ getPath: () => getPath,
26
+ getRef: () => getRef,
25
27
  isMethod: () => isMethod,
26
28
  keys: () => keys,
27
29
  log: () => log,
@@ -161,6 +163,12 @@ function setProps(param, options) {
161
163
  element.update({ props: param }, options);
162
164
  return element;
163
165
  }
166
+ function getRef() {
167
+ return this.__ref;
168
+ }
169
+ function getPath() {
170
+ return this.getRef().path;
171
+ }
164
172
  const defineSetter = (element, key, get2, set) => Object.defineProperty(element, key, { get: get2, set });
165
173
  function keys() {
166
174
  const element = this;
@@ -222,9 +230,9 @@ function verbose(...args) {
222
230
  } else {
223
231
  console.log(ref.path);
224
232
  const keys2 = element.keys();
225
- keys2.forEach((v) => console.log(`%c${v}:
226
- `, "font-weight: bold", element[v]));
233
+ keys2.forEach((v) => console.log(`%c${v}:`, "font-weight: bold", element[v]));
227
234
  }
235
+ console.log(element);
228
236
  console.groupEnd(element.key);
229
237
  return element;
230
238
  }
@@ -310,6 +318,8 @@ const METHODS = [
310
318
  "lookup",
311
319
  "lookdown",
312
320
  "lookdownAll",
321
+ "getRef",
322
+ "getPath",
313
323
  "setNodeStyles",
314
324
  "spotByPath",
315
325
  "keys",
@@ -49,6 +49,8 @@ const addMethods = (element, parent, options = {}) => {
49
49
  lookup: import__.lookup,
50
50
  lookdown: import__.lookdown,
51
51
  lookdownAll: import__.lookdownAll,
52
+ getRef: import__.getRef,
53
+ getPath: import__.getPath,
52
54
  setNodeStyles: import__.setNodeStyles,
53
55
  spotByPath: import__.spotByPath,
54
56
  parse: import__.parse,
@@ -64,6 +64,8 @@ var registry_default = {
64
64
  variables: {},
65
65
  lookup: {},
66
66
  lookdown: {},
67
+ getRef: {},
68
+ getPath: {},
67
69
  lookdownAll: {},
68
70
  setNodeStyles: {},
69
71
  spotByPath: {},
@@ -29,6 +29,7 @@ const objectizeStringProperty = (propValue) => {
29
29
  return propValue;
30
30
  };
31
31
  const inheritParentProps = (element, parent) => {
32
+ var _a;
32
33
  let propsStack = [];
33
34
  const parentProps = (0, import_utils.exec)(parent, parent.state).props;
34
35
  const matchParent = parent.props && parentProps[element.key];
@@ -46,7 +47,7 @@ const inheritParentProps = (element, parent) => {
46
47
  propsStack.push(objectizeStringProperty(matchParent));
47
48
  }
48
49
  }
49
- if (matchParentChildProps)
50
+ if (matchParentChildProps && !((_a = element == null ? void 0 : element.props) == null ? void 0 : _a.ignoreChildProps))
50
51
  propsStack.push(matchParentChildProps);
51
52
  return propsStack;
52
53
  };
@@ -70,6 +70,8 @@ const METHODS = [
70
70
  "lookup",
71
71
  "lookdown",
72
72
  "lookdownAll",
73
+ "getRef",
74
+ "getPath",
73
75
  "setNodeStyles",
74
76
  "spotByPath",
75
77
  "keys",
package/methods/index.js CHANGED
@@ -123,6 +123,14 @@ export function setProps (param, options) {
123
123
  return element
124
124
  }
125
125
 
126
+ export function getRef () {
127
+ return this.__ref
128
+ }
129
+
130
+ export function getPath () {
131
+ return this.getRef().path
132
+ }
133
+
126
134
  // export function set () {
127
135
  // }
128
136
 
@@ -185,8 +193,9 @@ export function verbose (...args) {
185
193
  } else {
186
194
  console.log(ref.path)
187
195
  const keys = element.keys()
188
- keys.forEach(v => console.log(`%c${v}:\n`, 'font-weight: bold', element[v]))
196
+ keys.forEach(v => console.log(`%c${v}:`, 'font-weight: bold', element[v]))
189
197
  }
198
+ console.log(element)
190
199
  console.groupEnd(element.key)
191
200
  return element
192
201
  }
@@ -275,6 +284,8 @@ export const METHODS = [
275
284
  'lookup',
276
285
  'lookdown',
277
286
  'lookdownAll',
287
+ 'getRef',
288
+ 'getPath',
278
289
  'setNodeStyles',
279
290
  'spotByPath',
280
291
  'keys',
package/methods/set.js CHANGED
@@ -9,6 +9,8 @@ import {
9
9
  lookup,
10
10
  lookdown,
11
11
  lookdownAll,
12
+ getRef,
13
+ getPath,
12
14
  setNodeStyles,
13
15
  setProps,
14
16
  remove,
@@ -40,6 +42,8 @@ export const addMethods = (element, parent, options = {}) => {
40
42
  lookup,
41
43
  lookdown,
42
44
  lookdownAll,
45
+ getRef,
46
+ getPath,
43
47
  setNodeStyles,
44
48
  spotByPath,
45
49
  parse,
@@ -48,6 +48,8 @@ export default {
48
48
  variables: {},
49
49
  lookup: {},
50
50
  lookdown: {},
51
+ getRef: {},
52
+ getPath: {},
51
53
  lookdownAll: {},
52
54
  setNodeStyles: {},
53
55
  spotByPath: {},
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@domql/element",
3
- "version": "2.5.152",
3
+ "version": "2.5.153",
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.152",
30
- "@domql/render": "^2.5.152",
31
- "@domql/state": "^2.5.152",
32
- "@domql/utils": "^2.5.152"
29
+ "@domql/event": "^2.5.153",
30
+ "@domql/render": "^2.5.153",
31
+ "@domql/state": "^2.5.153",
32
+ "@domql/utils": "^2.5.153"
33
33
  },
34
- "gitHead": "249d2545f3ee35b450ca90d399fc7c3e54a4a7bc",
34
+ "gitHead": "ebf5debf658fdae4ec5a99b541b2518c7767e6a8",
35
35
  "devDependencies": {
36
36
  "@babel/core": "^7.12.0"
37
37
  }
package/props/inherit.js CHANGED
@@ -28,7 +28,7 @@ export const inheritParentProps = (element, parent) => {
28
28
  propsStack.push(objectizeStringProperty(matchParent))
29
29
  }
30
30
  }
31
- if (matchParentChildProps) propsStack.push(matchParentChildProps)
31
+ if (matchParentChildProps && !element?.props?.ignoreChildProps) propsStack.push(matchParentChildProps)
32
32
 
33
33
  return propsStack
34
34
  }
package/utils/object.js CHANGED
@@ -23,6 +23,8 @@ export const METHODS = [
23
23
  'lookup',
24
24
  'lookdown',
25
25
  'lookdownAll',
26
+ 'getRef',
27
+ 'getPath',
26
28
  'setNodeStyles',
27
29
  'spotByPath',
28
30
  'keys',