@pyreon/ui-core 0.1.2 → 0.3.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.
Files changed (2) hide show
  1. package/lib/index.js +10 -11
  2. package/package.json +3 -3
package/lib/index.js CHANGED
@@ -1,5 +1,5 @@
1
1
  import { css, keyframes, styled } from "@pyreon/styler";
2
- import { createContext, h, onUnmount, popContext, pushContext } from "@pyreon/core";
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
- const contextValue = {
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,9 +285,9 @@ const render = (content, attachProps) => {
287
285
  };
288
286
 
289
287
  //#endregion
290
- //#region ../../node_modules/.bun/@pyreon+reactivity@0.5.4/node_modules/@pyreon/reactivity/lib/index.js
288
+ //#region ../../node_modules/.bun/@pyreon+reactivity@0.7.12/node_modules/@pyreon/reactivity/lib/index.js
291
289
  let batchDepth = 0;
292
- let setA = /* @__PURE__ */ new Set();
290
+ const setA = /* @__PURE__ */ new Set();
293
291
  let pendingNotifications = setA;
294
292
  function isBatching() {
295
293
  return batchDepth > 0;
@@ -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
- const subscribers = host._s;
312
- subscribers.add(activeEffect);
313
- if (_depsCollector) _depsCollector.push(subscribers);
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(subscribers);
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.1.2",
3
+ "version": "0.3.0",
4
4
  "repository": {
5
5
  "type": "git",
6
6
  "url": "https://github.com/pyreon/ui-system",
@@ -38,10 +38,10 @@
38
38
  },
39
39
  "peerDependencies": {
40
40
  "@pyreon/core": ">=0.4.0 <1.0.0",
41
- "@pyreon/styler": ">=0.1.2"
41
+ "@pyreon/styler": ">=0.3.0"
42
42
  },
43
43
  "devDependencies": {
44
44
  "@vitus-labs/tools-rolldown": "^1.15.3",
45
- "@vitus-labs/tools-typescript": "^1.15.3"
45
+ "@pyreon/typescript": "^0.7.4"
46
46
  }
47
47
  }