@domql/state 2.5.64 → 2.5.65
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 +1 -1
- package/dist/cjs/create.js +1 -1
- package/dist/cjs/ignore.js +1 -1
- package/dist/cjs/inherit.js +1 -1
- package/dist/cjs/methods.js +1 -1
- package/ignore.js +1 -1
- package/inherit.js +1 -1
- package/methods.js +1 -1
- package/package.json +2 -2
package/create.js
CHANGED
package/dist/cjs/create.js
CHANGED
|
@@ -112,7 +112,7 @@ const applyMethods = (element) => {
|
|
|
112
112
|
parent: element.parent.state,
|
|
113
113
|
__element: element,
|
|
114
114
|
__children: {},
|
|
115
|
-
|
|
115
|
+
root: ref.root ? ref.root.state : state
|
|
116
116
|
};
|
|
117
117
|
if ((0, import_utils.isArray)(state)) {
|
|
118
118
|
addProtoToArray(state, proto);
|
package/dist/cjs/ignore.js
CHANGED
package/dist/cjs/inherit.js
CHANGED
|
@@ -35,7 +35,7 @@ const getRootStateInKey = (stateKey, parentState) => {
|
|
|
35
35
|
return;
|
|
36
36
|
const arr = stateKey.split("~/");
|
|
37
37
|
if (arr.length > 1)
|
|
38
|
-
return parentState.
|
|
38
|
+
return parentState.root;
|
|
39
39
|
};
|
|
40
40
|
const getParentStateInKey = (stateKey, parentState) => {
|
|
41
41
|
if (!stateKey.includes("../"))
|
package/dist/cjs/methods.js
CHANGED
|
@@ -105,7 +105,7 @@ const rootUpdate = function(obj, options = {}) {
|
|
|
105
105
|
const state = this;
|
|
106
106
|
if (!state)
|
|
107
107
|
return;
|
|
108
|
-
const rootState = state.__element.__ref.
|
|
108
|
+
const rootState = state.__element.__ref.root.state;
|
|
109
109
|
return rootState.update(obj, { isHoisted: false, ...options });
|
|
110
110
|
};
|
|
111
111
|
const add = function(value, options = {}) {
|
package/ignore.js
CHANGED
|
@@ -2,5 +2,5 @@
|
|
|
2
2
|
|
|
3
3
|
export const IGNORE_STATE_PARAMS = [
|
|
4
4
|
'update', 'parse', 'clean', 'create', 'destroy', 'add', 'toggle', 'remove', 'apply', 'set', 'reset',
|
|
5
|
-
'rootUpdate', 'parentUpdate', 'parent', '__element', '__depends', '__ref', '__children', '
|
|
5
|
+
'rootUpdate', 'parentUpdate', 'parent', '__element', '__depends', '__ref', '__children', 'root'
|
|
6
6
|
]
|
package/inherit.js
CHANGED
|
@@ -6,7 +6,7 @@ import { IGNORE_STATE_PARAMS } from './ignore'
|
|
|
6
6
|
export const getRootStateInKey = (stateKey, parentState) => {
|
|
7
7
|
if (!stateKey.includes('~/')) return
|
|
8
8
|
const arr = stateKey.split('~/')
|
|
9
|
-
if (arr.length > 1) return parentState.
|
|
9
|
+
if (arr.length > 1) return parentState.root
|
|
10
10
|
}
|
|
11
11
|
|
|
12
12
|
export const getParentStateInKey = (stateKey, parentState) => {
|
package/methods.js
CHANGED
|
@@ -80,7 +80,7 @@ export const parentUpdate = function (obj, options = {}) {
|
|
|
80
80
|
export const rootUpdate = function (obj, options = {}) {
|
|
81
81
|
const state = this
|
|
82
82
|
if (!state) return
|
|
83
|
-
const rootState = (state.__element.__ref.
|
|
83
|
+
const rootState = (state.__element.__ref.root).state
|
|
84
84
|
return rootState.update(obj, { isHoisted: false, ...options })
|
|
85
85
|
}
|
|
86
86
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@domql/state",
|
|
3
|
-
"version": "2.5.
|
|
3
|
+
"version": "2.5.65",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"module": "dist/esm/index.js",
|
|
@@ -31,5 +31,5 @@
|
|
|
31
31
|
"@domql/report": "latest",
|
|
32
32
|
"@domql/utils": "latest"
|
|
33
33
|
},
|
|
34
|
-
"gitHead": "
|
|
34
|
+
"gitHead": "473e5569815c8e062b8e584549889557330c249a"
|
|
35
35
|
}
|