@domql/element 2.28.1 → 2.28.18
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/dist/cjs/extend.js +1 -1
- package/dist/cjs/mixins/content.js +1 -0
- package/dist/cjs/mixins/registry.js +21 -27
- package/dist/cjs/node.js +1 -1
- package/dist/cjs/utils/applyParam.js +1 -1
- package/dist/esm/extend.js +1 -1
- package/dist/esm/mixins/content.js +1 -0
- package/dist/esm/mixins/registry.js +14 -10
- package/dist/esm/node.js +1 -1
- package/dist/esm/utils/applyParam.js +1 -1
- package/extend.js +2 -1
- package/mixins/content.js +2 -0
- package/mixins/registry.js +34 -14
- package/node.js +1 -1
- package/package.json +6 -6
- package/utils/applyParam.js +2 -1
package/dist/cjs/extend.js
CHANGED
|
@@ -32,7 +32,7 @@ const applyExtend = (element, parent, options = {}) => {
|
|
|
32
32
|
const context = element.context || parent.context;
|
|
33
33
|
extend = (0, import_utils2.fallbackStringExtend)(extend, context, options, variant);
|
|
34
34
|
const extendStack = (0, import_utils2.getExtendStack)(extend, context);
|
|
35
|
-
|
|
35
|
+
delete element.extend;
|
|
36
36
|
let childExtendStack = [];
|
|
37
37
|
if (parent) {
|
|
38
38
|
element.parent = parent;
|
|
@@ -56,6 +56,7 @@ const removeContent = function(el, opts = {}) {
|
|
|
56
56
|
else if (__cached[contentElementKey] && (0, import_utils.isFunction)(__cached[contentElementKey].remove))
|
|
57
57
|
__cached[contentElementKey].remove();
|
|
58
58
|
}
|
|
59
|
+
ref.__children.splice(ref.__children.indexOf(element[contentElementKey]), 1);
|
|
59
60
|
delete element[contentElementKey];
|
|
60
61
|
}
|
|
61
62
|
};
|
|
@@ -1,9 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
var __create = Object.create;
|
|
3
2
|
var __defProp = Object.defineProperty;
|
|
4
3
|
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
5
4
|
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
6
|
-
var __getProtoOf = Object.getPrototypeOf;
|
|
7
5
|
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
8
6
|
var __export = (target, all) => {
|
|
9
7
|
for (var name in all)
|
|
@@ -17,14 +15,6 @@ var __copyProps = (to, from, except, desc) => {
|
|
|
17
15
|
}
|
|
18
16
|
return to;
|
|
19
17
|
};
|
|
20
|
-
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
21
|
-
// If the importer is in node compatibility mode or this is not an ESM
|
|
22
|
-
// file that has been converted to a CommonJS file using a Babel-
|
|
23
|
-
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
24
|
-
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
25
|
-
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
26
|
-
mod
|
|
27
|
-
));
|
|
28
18
|
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
29
19
|
var registry_exports = {};
|
|
30
20
|
__export(registry_exports, {
|
|
@@ -34,25 +24,25 @@ __export(registry_exports, {
|
|
|
34
24
|
parseFilters: () => parseFilters
|
|
35
25
|
});
|
|
36
26
|
module.exports = __toCommonJS(registry_exports);
|
|
37
|
-
var import_attr =
|
|
27
|
+
var import_attr = require("./attr.js");
|
|
38
28
|
var import_classList = require("./classList.js");
|
|
39
|
-
var import_content =
|
|
40
|
-
var import_data =
|
|
41
|
-
var import_html =
|
|
42
|
-
var import_scope =
|
|
43
|
-
var import_state =
|
|
44
|
-
var import_style =
|
|
45
|
-
var import_text =
|
|
29
|
+
var import_content = require("./content.js");
|
|
30
|
+
var import_data = require("./data.js");
|
|
31
|
+
var import_html = require("./html.js");
|
|
32
|
+
var import_scope = require("./scope.js");
|
|
33
|
+
var import_state = require("./state.js");
|
|
34
|
+
var import_style = require("./style.js");
|
|
35
|
+
var import_text = require("./text.js");
|
|
46
36
|
const REGISTRY = {
|
|
47
|
-
attr: import_attr.
|
|
48
|
-
style: import_style.
|
|
49
|
-
text: import_text.
|
|
50
|
-
html: import_html.
|
|
51
|
-
content: import_content.
|
|
52
|
-
data: import_data.
|
|
37
|
+
attr: import_attr.attr,
|
|
38
|
+
style: import_style.style,
|
|
39
|
+
text: import_text.text,
|
|
40
|
+
html: import_html.html,
|
|
41
|
+
content: import_content.setContent,
|
|
42
|
+
data: import_data.data,
|
|
53
43
|
class: import_classList.classList,
|
|
54
|
-
state: import_state.
|
|
55
|
-
scope: import_scope.
|
|
44
|
+
state: import_state.state,
|
|
45
|
+
scope: import_scope.scope,
|
|
56
46
|
deps: (param, el) => param || el.parent.deps,
|
|
57
47
|
extend: {},
|
|
58
48
|
childExtend: {},
|
|
@@ -132,4 +122,8 @@ const parseFilters = {
|
|
|
132
122
|
propsKeys: ["__element", "update"],
|
|
133
123
|
stateKeys: []
|
|
134
124
|
};
|
|
135
|
-
const collectionFilters = [
|
|
125
|
+
const collectionFilters = [
|
|
126
|
+
"$collection",
|
|
127
|
+
"$stateCollection",
|
|
128
|
+
"$propsCollection"
|
|
129
|
+
];
|
package/dist/cjs/node.js
CHANGED
|
@@ -64,7 +64,7 @@ const createNode = async (element, options) => {
|
|
|
64
64
|
const isElement = await (0, import_applyParam.applyParam)(param, element, options);
|
|
65
65
|
if (!isElement) continue;
|
|
66
66
|
const { hasDefine, hasContextDefine } = isElement;
|
|
67
|
-
if (
|
|
67
|
+
if (value && isElement && !hasDefine && !hasContextDefine) {
|
|
68
68
|
const createAsync = async () => {
|
|
69
69
|
await (0, import_create.create)(await (0, import_utils.exec)(value, element), element, param, options);
|
|
70
70
|
};
|
|
@@ -37,8 +37,8 @@ const applyParam = async (param, element, options) => {
|
|
|
37
37
|
if (isGlobalTransformer && !hasContextDefine && hasOnlyUpdate) {
|
|
38
38
|
if ((0, import_utils.isFunction)(isGlobalTransformer)) {
|
|
39
39
|
await isGlobalTransformer(prop, element, node, options);
|
|
40
|
-
return;
|
|
41
40
|
}
|
|
41
|
+
return;
|
|
42
42
|
}
|
|
43
43
|
return { hasDefine, hasContextDefine };
|
|
44
44
|
};
|
package/dist/esm/extend.js
CHANGED
|
@@ -15,7 +15,7 @@ const applyExtend = (element, parent, options = {}) => {
|
|
|
15
15
|
const context = element.context || parent.context;
|
|
16
16
|
extend = fallbackStringExtend(extend, context, options, variant);
|
|
17
17
|
const extendStack = getExtendStack(extend, context);
|
|
18
|
-
|
|
18
|
+
delete element.extend;
|
|
19
19
|
let childExtendStack = [];
|
|
20
20
|
if (parent) {
|
|
21
21
|
element.parent = parent;
|
|
@@ -30,6 +30,7 @@ const removeContent = function(el, opts = {}) {
|
|
|
30
30
|
else if (__cached[contentElementKey] && isFunction(__cached[contentElementKey].remove))
|
|
31
31
|
__cached[contentElementKey].remove();
|
|
32
32
|
}
|
|
33
|
+
ref.__children.splice(ref.__children.indexOf(element[contentElementKey]), 1);
|
|
33
34
|
delete element[contentElementKey];
|
|
34
35
|
}
|
|
35
36
|
};
|
|
@@ -1,18 +1,18 @@
|
|
|
1
|
-
import attr from "./attr.js";
|
|
1
|
+
import { attr } from "./attr.js";
|
|
2
2
|
import { classList } from "./classList.js";
|
|
3
|
-
import
|
|
4
|
-
import data from "./data.js";
|
|
5
|
-
import html from "./html.js";
|
|
6
|
-
import scope from "./scope.js";
|
|
7
|
-
import state from "./state.js";
|
|
8
|
-
import style from "./style.js";
|
|
9
|
-
import text from "./text.js";
|
|
3
|
+
import { setContent } from "./content.js";
|
|
4
|
+
import { data } from "./data.js";
|
|
5
|
+
import { html } from "./html.js";
|
|
6
|
+
import { scope } from "./scope.js";
|
|
7
|
+
import { state } from "./state.js";
|
|
8
|
+
import { style } from "./style.js";
|
|
9
|
+
import { text } from "./text.js";
|
|
10
10
|
const REGISTRY = {
|
|
11
11
|
attr,
|
|
12
12
|
style,
|
|
13
13
|
text,
|
|
14
14
|
html,
|
|
15
|
-
content,
|
|
15
|
+
content: setContent,
|
|
16
16
|
data,
|
|
17
17
|
class: classList,
|
|
18
18
|
state,
|
|
@@ -96,7 +96,11 @@ const parseFilters = {
|
|
|
96
96
|
propsKeys: ["__element", "update"],
|
|
97
97
|
stateKeys: []
|
|
98
98
|
};
|
|
99
|
-
const collectionFilters = [
|
|
99
|
+
const collectionFilters = [
|
|
100
|
+
"$collection",
|
|
101
|
+
"$stateCollection",
|
|
102
|
+
"$propsCollection"
|
|
103
|
+
];
|
|
100
104
|
export {
|
|
101
105
|
REGISTRY,
|
|
102
106
|
collectionFilters,
|
package/dist/esm/node.js
CHANGED
|
@@ -50,7 +50,7 @@ const createNode = async (element, options) => {
|
|
|
50
50
|
const isElement = await applyParam(param, element, options);
|
|
51
51
|
if (!isElement) continue;
|
|
52
52
|
const { hasDefine, hasContextDefine } = isElement;
|
|
53
|
-
if (
|
|
53
|
+
if (value && isElement && !hasDefine && !hasContextDefine) {
|
|
54
54
|
const createAsync = async () => {
|
|
55
55
|
await create(await exec(value, element), element, param, options);
|
|
56
56
|
};
|
|
@@ -14,8 +14,8 @@ const applyParam = async (param, element, options) => {
|
|
|
14
14
|
if (isGlobalTransformer && !hasContextDefine && hasOnlyUpdate) {
|
|
15
15
|
if (isFunction(isGlobalTransformer)) {
|
|
16
16
|
await isGlobalTransformer(prop, element, node, options);
|
|
17
|
-
return;
|
|
18
17
|
}
|
|
18
|
+
return;
|
|
19
19
|
}
|
|
20
20
|
return { hasDefine, hasContextDefine };
|
|
21
21
|
};
|
package/extend.js
CHANGED
|
@@ -27,7 +27,8 @@ export const applyExtend = (element, parent, options = {}) => {
|
|
|
27
27
|
|
|
28
28
|
const extendStack = getExtendStack(extend, context)
|
|
29
29
|
|
|
30
|
-
if (isProduction()) delete element.extend
|
|
30
|
+
// if (isProduction()) delete element.extend
|
|
31
|
+
delete element.extend
|
|
31
32
|
|
|
32
33
|
let childExtendStack = []
|
|
33
34
|
if (parent) {
|
package/mixins/content.js
CHANGED
package/mixins/registry.js
CHANGED
|
@@ -1,21 +1,21 @@
|
|
|
1
1
|
'use strict'
|
|
2
2
|
|
|
3
|
-
import attr from './attr.js'
|
|
3
|
+
import { attr } from './attr.js'
|
|
4
4
|
import { classList } from './classList.js'
|
|
5
|
-
import
|
|
6
|
-
import data from './data.js'
|
|
7
|
-
import html from './html.js'
|
|
8
|
-
import scope from './scope.js'
|
|
9
|
-
import state from './state.js'
|
|
10
|
-
import style from './style.js'
|
|
11
|
-
import text from './text.js'
|
|
5
|
+
import { setContent } from './content.js'
|
|
6
|
+
import { data } from './data.js'
|
|
7
|
+
import { html } from './html.js'
|
|
8
|
+
import { scope } from './scope.js'
|
|
9
|
+
import { state } from './state.js'
|
|
10
|
+
import { style } from './style.js'
|
|
11
|
+
import { text } from './text.js'
|
|
12
12
|
|
|
13
13
|
export const REGISTRY = {
|
|
14
14
|
attr,
|
|
15
15
|
style,
|
|
16
16
|
text,
|
|
17
17
|
html,
|
|
18
|
-
content,
|
|
18
|
+
content: setContent,
|
|
19
19
|
data,
|
|
20
20
|
class: classList,
|
|
21
21
|
state,
|
|
@@ -81,13 +81,33 @@ export default REGISTRY
|
|
|
81
81
|
// Keys not in the array are excluded.
|
|
82
82
|
export const parseFilters = {
|
|
83
83
|
elementKeys: [
|
|
84
|
-
'tag',
|
|
85
|
-
'
|
|
86
|
-
'
|
|
87
|
-
'
|
|
84
|
+
'tag',
|
|
85
|
+
'text',
|
|
86
|
+
'style',
|
|
87
|
+
'attr',
|
|
88
|
+
'class',
|
|
89
|
+
'state',
|
|
90
|
+
'props',
|
|
91
|
+
'data',
|
|
92
|
+
'content',
|
|
93
|
+
'html',
|
|
94
|
+
'on',
|
|
95
|
+
'key',
|
|
96
|
+
'extend',
|
|
97
|
+
'childExtend',
|
|
98
|
+
'childExtendRecursive',
|
|
99
|
+
'scope',
|
|
100
|
+
'query',
|
|
101
|
+
'$collection',
|
|
102
|
+
'$stateCollection',
|
|
103
|
+
'$propsCollection'
|
|
88
104
|
],
|
|
89
105
|
propsKeys: ['__element', 'update'],
|
|
90
106
|
stateKeys: []
|
|
91
107
|
}
|
|
92
108
|
|
|
93
|
-
export const collectionFilters = [
|
|
109
|
+
export const collectionFilters = [
|
|
110
|
+
'$collection',
|
|
111
|
+
'$stateCollection',
|
|
112
|
+
'$propsCollection'
|
|
113
|
+
]
|
package/node.js
CHANGED
|
@@ -83,7 +83,7 @@ export const createNode = async (element, options) => {
|
|
|
83
83
|
|
|
84
84
|
const { hasDefine, hasContextDefine } = isElement
|
|
85
85
|
|
|
86
|
-
if (
|
|
86
|
+
if (value && isElement && !hasDefine && !hasContextDefine) {
|
|
87
87
|
const createAsync = async () => {
|
|
88
88
|
await create(await exec(value, element), element, param, options)
|
|
89
89
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@domql/element",
|
|
3
|
-
"version": "2.28.
|
|
3
|
+
"version": "2.28.18",
|
|
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.28.
|
|
31
|
-
"@domql/render": "^2.28.
|
|
32
|
-
"@domql/state": "^2.28.
|
|
33
|
-
"@domql/utils": "^2.28.
|
|
30
|
+
"@domql/event": "^2.28.18",
|
|
31
|
+
"@domql/render": "^2.28.18",
|
|
32
|
+
"@domql/state": "^2.28.18",
|
|
33
|
+
"@domql/utils": "^2.28.18"
|
|
34
34
|
},
|
|
35
|
-
"gitHead": "
|
|
35
|
+
"gitHead": "09442a79ea4ff9b05ab22cf63770f25d979f0264",
|
|
36
36
|
"devDependencies": {
|
|
37
37
|
"@babel/core": "^7.26.0"
|
|
38
38
|
}
|
package/utils/applyParam.js
CHANGED
|
@@ -10,6 +10,7 @@ export const applyParam = async (param, element, options) => {
|
|
|
10
10
|
const { onlyUpdate } = options
|
|
11
11
|
|
|
12
12
|
const DOMQLProperty = REGISTRY[param]
|
|
13
|
+
|
|
13
14
|
const DOMQLPropertyFromContext =
|
|
14
15
|
context && context.registry && context.registry[param]
|
|
15
16
|
const isGlobalTransformer = DOMQLPropertyFromContext || DOMQLProperty
|
|
@@ -26,8 +27,8 @@ export const applyParam = async (param, element, options) => {
|
|
|
26
27
|
if (isGlobalTransformer && !hasContextDefine && hasOnlyUpdate) {
|
|
27
28
|
if (isFunction(isGlobalTransformer)) {
|
|
28
29
|
await isGlobalTransformer(prop, element, node, options)
|
|
29
|
-
return
|
|
30
30
|
}
|
|
31
|
+
return
|
|
31
32
|
}
|
|
32
33
|
|
|
33
34
|
return { hasDefine, hasContextDefine }
|