@domql/element 2.31.0 → 2.31.2

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.
@@ -309,8 +309,7 @@ function variables(obj = {}) {
309
309
  };
310
310
  }
311
311
  function call(fnKey, ...args) {
312
- var _a, _b, _c, _d;
313
- const fn = ((_a = this.context.utils) == null ? void 0 : _a[fnKey]) || ((_b = this.context.functions) == null ? void 0 : _b[fnKey]) || ((_c = this.context.methods) == null ? void 0 : _c[fnKey]) || ((_d = this.context.snippets) == null ? void 0 : _d[fnKey]);
312
+ const fn = import_utils.getContextFunction.call(this, fnKey);
314
313
  if (!fn) return void 0;
315
314
  try {
316
315
  const result = fn.call(this, ...args);
@@ -46,6 +46,7 @@ const REGISTRY = {
46
46
  deps: (param, el) => param || el.parent.deps,
47
47
  extend: {},
48
48
  helmet: {},
49
+ metadata: {},
49
50
  childExtend: {},
50
51
  childExtendRecursive: {},
51
52
  props: {},
@@ -6,7 +6,8 @@ import {
6
6
  isObjectLike,
7
7
  isProduction,
8
8
  removeValueFromArray,
9
- deepClone
9
+ deepClone,
10
+ getContextFunction
10
11
  } from "@domql/utils";
11
12
  import { TREE } from "../tree.js";
12
13
  import { parseFilters, REGISTRY } from "../mixins/index.js";
@@ -267,8 +268,7 @@ function variables(obj = {}) {
267
268
  };
268
269
  }
269
270
  function call(fnKey, ...args) {
270
- var _a, _b, _c, _d;
271
- const fn = ((_a = this.context.utils) == null ? void 0 : _a[fnKey]) || ((_b = this.context.functions) == null ? void 0 : _b[fnKey]) || ((_c = this.context.methods) == null ? void 0 : _c[fnKey]) || ((_d = this.context.snippets) == null ? void 0 : _d[fnKey]);
271
+ const fn = getContextFunction.call(this, fnKey);
272
272
  if (!fn) return void 0;
273
273
  try {
274
274
  const result = fn.call(this, ...args);
@@ -20,6 +20,7 @@ const REGISTRY = {
20
20
  deps: (param, el) => param || el.parent.deps,
21
21
  extend: {},
22
22
  helmet: {},
23
+ metadata: {},
23
24
  childExtend: {},
24
25
  childExtendRecursive: {},
25
26
  props: {},
package/methods/index.js CHANGED
@@ -8,7 +8,8 @@ import {
8
8
  isObjectLike,
9
9
  isProduction,
10
10
  removeValueFromArray,
11
- deepClone
11
+ deepClone,
12
+ getContextFunction
12
13
  } from '@domql/utils'
13
14
  import { TREE } from '../tree.js'
14
15
  import { parseFilters, REGISTRY } from '../mixins/index.js'
@@ -345,12 +346,7 @@ export function variables(obj = {}) {
345
346
  * @returns {any|Promise} - The result or a Promise to the result
346
347
  */
347
348
  export function call(fnKey, ...args) {
348
- const fn =
349
- this.context.utils?.[fnKey] ||
350
- this.context.functions?.[fnKey] ||
351
- this.context.methods?.[fnKey] ||
352
- this.context.snippets?.[fnKey]
353
-
349
+ const fn = getContextFunction.call(this, fnKey)
354
350
  if (!fn) return undefined
355
351
 
356
352
  try {
@@ -25,6 +25,7 @@ export const REGISTRY = {
25
25
 
26
26
  extend: {},
27
27
  helmet: {},
28
+ metadata: {},
28
29
  childExtend: {},
29
30
  childExtendRecursive: {},
30
31
  props: {},
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@domql/element",
3
- "version": "2.31.0",
3
+ "version": "2.31.2",
4
4
  "license": "MIT",
5
5
  "type": "module",
6
6
  "module": "index.js",
@@ -27,12 +27,12 @@
27
27
  "prepublish": "npx rimraf -I dist && npm run build && npm run copy:package:cjs"
28
28
  },
29
29
  "dependencies": {
30
- "@domql/event": "^2.31.0",
31
- "@domql/render": "^2.31.0",
32
- "@domql/state": "^2.31.0",
33
- "@domql/utils": "^2.31.0"
30
+ "@domql/event": "^2.31.2",
31
+ "@domql/render": "^2.31.2",
32
+ "@domql/state": "^2.31.2",
33
+ "@domql/utils": "^2.31.2"
34
34
  },
35
- "gitHead": "dd5c64895320d678f28ca585c9fd4e4550a483cd",
35
+ "gitHead": "c7d23e63ab53e68a7c670f45e94cb2c7d514262e",
36
36
  "devDependencies": {
37
37
  "@babel/core": "^7.27.1"
38
38
  }