@pyreon/ui-core 0.1.1 → 0.2.0
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/lib/index.js +9 -10
- package/package.json +2 -2
package/lib/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { css, keyframes, styled } from "@pyreon/styler";
|
|
2
|
-
import { createContext, h,
|
|
2
|
+
import { createContext, h, provide } from "@pyreon/core";
|
|
3
3
|
|
|
4
4
|
//#region src/compose.ts
|
|
5
5
|
const compose = (...fns) => (p) => fns.reduceRight((acc, cur) => cur(acc), p);
|
|
@@ -54,12 +54,10 @@ const context = createContext({});
|
|
|
54
54
|
*/
|
|
55
55
|
function Provider({ theme, children, ...props }) {
|
|
56
56
|
if (isEmpty(theme) || !theme) return children ?? null;
|
|
57
|
-
|
|
57
|
+
provide(context, {
|
|
58
58
|
theme,
|
|
59
59
|
...props
|
|
60
|
-
};
|
|
61
|
-
pushContext(new Map([[context.id, contextValue]]));
|
|
62
|
-
onUnmount(() => popContext());
|
|
60
|
+
});
|
|
63
61
|
return children ?? null;
|
|
64
62
|
}
|
|
65
63
|
|
|
@@ -287,7 +285,7 @@ const render = (content, attachProps) => {
|
|
|
287
285
|
};
|
|
288
286
|
|
|
289
287
|
//#endregion
|
|
290
|
-
//#region ../../node_modules/.bun/@pyreon+reactivity@0.
|
|
288
|
+
//#region ../../node_modules/.bun/@pyreon+reactivity@0.7.0/node_modules/@pyreon/reactivity/lib/index.js
|
|
291
289
|
let batchDepth = 0;
|
|
292
290
|
let setA = /* @__PURE__ */ new Set();
|
|
293
291
|
let pendingNotifications = setA;
|
|
@@ -300,6 +298,7 @@ function enqueuePendingNotification(notify) {
|
|
|
300
298
|
let activeEffect = null;
|
|
301
299
|
const effectDeps = /* @__PURE__ */ new WeakMap();
|
|
302
300
|
let _depsCollector = null;
|
|
301
|
+
let _skipDepsCollection = false;
|
|
303
302
|
/**
|
|
304
303
|
* Register the active effect as a subscriber of the given reactive source.
|
|
305
304
|
* The subscriber Set is created lazily on the host — sources read only outside
|
|
@@ -308,16 +307,16 @@ let _depsCollector = null;
|
|
|
308
307
|
function trackSubscriber(host) {
|
|
309
308
|
if (activeEffect) {
|
|
310
309
|
if (!host._s) host._s = /* @__PURE__ */ new Set();
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
if (_depsCollector) _depsCollector.push(
|
|
310
|
+
host._s.add(activeEffect);
|
|
311
|
+
if (_skipDepsCollection) return;
|
|
312
|
+
if (_depsCollector) _depsCollector.push(host._s);
|
|
314
313
|
else {
|
|
315
314
|
let deps = effectDeps.get(activeEffect);
|
|
316
315
|
if (!deps) {
|
|
317
316
|
deps = /* @__PURE__ */ new Set();
|
|
318
317
|
effectDeps.set(activeEffect, deps);
|
|
319
318
|
}
|
|
320
|
-
deps.add(
|
|
319
|
+
deps.add(host._s);
|
|
321
320
|
}
|
|
322
321
|
}
|
|
323
322
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@pyreon/ui-core",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.2.0",
|
|
4
4
|
"repository": {
|
|
5
5
|
"type": "git",
|
|
6
6
|
"url": "https://github.com/pyreon/ui-system",
|
|
@@ -38,7 +38,7 @@
|
|
|
38
38
|
},
|
|
39
39
|
"peerDependencies": {
|
|
40
40
|
"@pyreon/core": ">=0.4.0 <1.0.0",
|
|
41
|
-
"@pyreon/styler": ">=0.
|
|
41
|
+
"@pyreon/styler": ">=0.2.0"
|
|
42
42
|
},
|
|
43
43
|
"devDependencies": {
|
|
44
44
|
"@vitus-labs/tools-rolldown": "^1.15.3",
|