@unsetsoft/ryunixjs 0.2.35 → 0.2.36-nightly.1
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/Ryunix.js +9 -2
- package/package.json +5 -2
- package/src/lib/createContext.js +8 -1
package/dist/Ryunix.js
CHANGED
|
@@ -120,7 +120,8 @@
|
|
|
120
120
|
* for the root element.
|
|
121
121
|
*/
|
|
122
122
|
const init = (root) => {
|
|
123
|
-
|
|
123
|
+
const rootElement = root || "__ryunix";
|
|
124
|
+
vars.containerRoot = document.getElementById(rootElement);
|
|
124
125
|
};
|
|
125
126
|
|
|
126
127
|
const isEvent = (key) => key.startsWith("on");
|
|
@@ -280,7 +281,13 @@
|
|
|
280
281
|
Provider: null,
|
|
281
282
|
};
|
|
282
283
|
|
|
283
|
-
context.Provider = (value) =>
|
|
284
|
+
context.Provider = (value) => {
|
|
285
|
+
const provider = {
|
|
286
|
+
value: value,
|
|
287
|
+
};
|
|
288
|
+
|
|
289
|
+
return createElement("div", provider, props.children);
|
|
290
|
+
};
|
|
284
291
|
|
|
285
292
|
return context;
|
|
286
293
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@unsetsoft/ryunixjs",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.36-nightly.1",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"main": "./dist/Ryunix.js",
|
|
6
6
|
"private": false,
|
|
@@ -52,5 +52,8 @@
|
|
|
52
52
|
},
|
|
53
53
|
"keywords": [
|
|
54
54
|
"ryunixjs"
|
|
55
|
-
]
|
|
55
|
+
],
|
|
56
|
+
"publishConfig": {
|
|
57
|
+
"registry": "https://registry.npmjs.org"
|
|
58
|
+
}
|
|
56
59
|
}
|
package/src/lib/createContext.js
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { RYUNIX_TYPES } from "../utils/index";
|
|
2
|
+
import { createElement } from "./createElement";
|
|
2
3
|
|
|
3
4
|
/**
|
|
4
5
|
* The function createContext creates a context object with a default value and methods to set and get
|
|
@@ -16,7 +17,13 @@ const createContext = (defaultValue) => {
|
|
|
16
17
|
Provider: null,
|
|
17
18
|
};
|
|
18
19
|
|
|
19
|
-
context.Provider = (value) =>
|
|
20
|
+
context.Provider = (value) => {
|
|
21
|
+
const provider = {
|
|
22
|
+
value: value,
|
|
23
|
+
};
|
|
24
|
+
|
|
25
|
+
return createElement("div", provider, props.children);
|
|
26
|
+
};
|
|
20
27
|
|
|
21
28
|
return context;
|
|
22
29
|
};
|