@bquery/bquery 1.3.0 → 1.4.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 (71) hide show
  1. package/README.md +527 -501
  2. package/dist/{batch-4LAvfLE7.js → batch-x7b2eZST.js} +2 -2
  3. package/dist/{batch-4LAvfLE7.js.map → batch-x7b2eZST.js.map} +1 -1
  4. package/dist/component.es.mjs +1 -1
  5. package/dist/core/collection.d.ts +19 -3
  6. package/dist/core/collection.d.ts.map +1 -1
  7. package/dist/core/element.d.ts +23 -4
  8. package/dist/core/element.d.ts.map +1 -1
  9. package/dist/core/index.d.ts +1 -0
  10. package/dist/core/index.d.ts.map +1 -1
  11. package/dist/core/utils/function.d.ts +21 -4
  12. package/dist/core/utils/function.d.ts.map +1 -1
  13. package/dist/{core-COenAZjD.js → core-BhpuvPhy.js} +62 -37
  14. package/dist/core-BhpuvPhy.js.map +1 -0
  15. package/dist/core.es.mjs +174 -131
  16. package/dist/core.es.mjs.map +1 -1
  17. package/dist/full.es.mjs +7 -7
  18. package/dist/full.iife.js +2 -2
  19. package/dist/full.iife.js.map +1 -1
  20. package/dist/full.umd.js +2 -2
  21. package/dist/full.umd.js.map +1 -1
  22. package/dist/index.es.mjs +7 -7
  23. package/dist/motion.es.mjs.map +1 -1
  24. package/dist/{persisted-Dz_ryNuC.js → persisted-DHoi3uEs.js} +4 -4
  25. package/dist/{persisted-Dz_ryNuC.js.map → persisted-DHoi3uEs.js.map} +1 -1
  26. package/dist/platform/storage.d.ts.map +1 -1
  27. package/dist/platform.es.mjs +12 -7
  28. package/dist/platform.es.mjs.map +1 -1
  29. package/dist/reactive/core.d.ts +12 -0
  30. package/dist/reactive/core.d.ts.map +1 -1
  31. package/dist/reactive/effect.d.ts.map +1 -1
  32. package/dist/reactive/internals.d.ts +6 -0
  33. package/dist/reactive/internals.d.ts.map +1 -1
  34. package/dist/reactive.es.mjs +6 -6
  35. package/dist/router.es.mjs +1 -1
  36. package/dist/{sanitize-1FBEPAFH.js → sanitize-Cxvxa-DX.js} +50 -39
  37. package/dist/sanitize-Cxvxa-DX.js.map +1 -0
  38. package/dist/security/sanitize-core.d.ts.map +1 -1
  39. package/dist/security.es.mjs +2 -2
  40. package/dist/store.es.mjs +2 -2
  41. package/dist/type-guards-BdKlYYlS.js +32 -0
  42. package/dist/type-guards-BdKlYYlS.js.map +1 -0
  43. package/dist/untrack-DNnnqdlR.js +6 -0
  44. package/dist/{untrack-BuEQKH7_.js.map → untrack-DNnnqdlR.js.map} +1 -1
  45. package/dist/view/evaluate.d.ts.map +1 -1
  46. package/dist/view.es.mjs +157 -151
  47. package/dist/view.es.mjs.map +1 -1
  48. package/dist/{watch-CXyaBC_9.js → watch-DXXv3iAI.js} +3 -3
  49. package/dist/{watch-CXyaBC_9.js.map → watch-DXXv3iAI.js.map} +1 -1
  50. package/package.json +132 -132
  51. package/src/core/collection.ts +628 -588
  52. package/src/core/element.ts +774 -746
  53. package/src/core/index.ts +48 -47
  54. package/src/core/utils/function.ts +151 -110
  55. package/src/motion/animate.ts +113 -113
  56. package/src/motion/flip.ts +176 -176
  57. package/src/motion/scroll.ts +57 -57
  58. package/src/motion/spring.ts +150 -150
  59. package/src/motion/timeline.ts +246 -246
  60. package/src/motion/transition.ts +51 -51
  61. package/src/platform/storage.ts +215 -208
  62. package/src/reactive/core.ts +114 -93
  63. package/src/reactive/effect.ts +54 -43
  64. package/src/reactive/internals.ts +122 -105
  65. package/src/security/sanitize-core.ts +364 -343
  66. package/src/view/evaluate.ts +290 -274
  67. package/dist/core-COenAZjD.js.map +0 -1
  68. package/dist/sanitize-1FBEPAFH.js.map +0 -1
  69. package/dist/type-guards-DRma3-Kc.js +0 -16
  70. package/dist/type-guards-DRma3-Kc.js.map +0 -1
  71. package/dist/untrack-BuEQKH7_.js +0 -6
@@ -1,4 +1,4 @@
1
- import { e as t, b } from "./core-COenAZjD.js";
1
+ import { e as t, b } from "./core-BhpuvPhy.js";
2
2
  const e = (a) => {
3
3
  b();
4
4
  try {
@@ -10,4 +10,4 @@ const e = (a) => {
10
10
  export {
11
11
  e as b
12
12
  };
13
- //# sourceMappingURL=batch-4LAvfLE7.js.map
13
+ //# sourceMappingURL=batch-x7b2eZST.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"batch-4LAvfLE7.js","sources":["../src/reactive/batch.ts"],"sourcesContent":["/**\n * Batched reactive updates.\n */\n\nimport { beginBatch, endBatch } from './internals';\n\n/**\n * Batches multiple signal updates into a single notification cycle.\n *\n * Updates made inside the batch function are deferred until the batch\n * completes, preventing intermediate re-renders and improving performance.\n *\n * @param fn - Function containing multiple signal updates\n */\nexport const batch = (fn: () => void): void => {\n beginBatch();\n try {\n fn();\n } finally {\n endBatch();\n }\n};\n"],"names":["batch","fn","beginBatch","endBatch"],"mappings":";AAcO,MAAMA,IAAQ,CAACC,MAAyB;AAC7C,EAAAC,EAAA;AACA,MAAI;AACF,IAAAD,EAAA;AAAA,EACF,UAAA;AACE,IAAAE,EAAA;AAAA,EACF;AACF;"}
1
+ {"version":3,"file":"batch-x7b2eZST.js","sources":["../src/reactive/batch.ts"],"sourcesContent":["/**\n * Batched reactive updates.\n */\n\nimport { beginBatch, endBatch } from './internals';\n\n/**\n * Batches multiple signal updates into a single notification cycle.\n *\n * Updates made inside the batch function are deferred until the batch\n * completes, preventing intermediate re-renders and improving performance.\n *\n * @param fn - Function containing multiple signal updates\n */\nexport const batch = (fn: () => void): void => {\n beginBatch();\n try {\n fn();\n } finally {\n endBatch();\n }\n};\n"],"names":["batch","fn","beginBatch","endBatch"],"mappings":";AAcO,MAAMA,IAAQ,CAACC,MAAyB;AAC7C,EAAAC,EAAA;AACA,MAAI;AACF,IAAAD,EAAA;AAAA,EACF,UAAA;AACE,IAAAE,EAAA;AAAA,EACF;AACF;"}
@@ -1,4 +1,4 @@
1
- import { s as h } from "./sanitize-1FBEPAFH.js";
1
+ import { s as h } from "./sanitize-Cxvxa-DX.js";
2
2
  const p = (e, r) => {
3
3
  const { type: s } = r;
4
4
  if (s === String) return e;
@@ -148,13 +148,16 @@ export declare class BQueryCollection {
148
148
  /** Insert content after all elements. */
149
149
  after(content: InsertableContent): this;
150
150
  /**
151
- * Applies CSS styles to all elements.
151
+ * Gets or sets CSS styles on all elements.
152
+ * When getting, returns the computed style value from the first element.
152
153
  *
153
154
  * @param property - Property name or object of properties
154
155
  * @param value - Value when setting single property
155
- * @returns The instance for method chaining
156
+ * @returns The computed style value when getting, instance when setting
156
157
  */
157
- css(property: string | Record<string, string>, value?: string): this;
158
+ css(property: string): string;
159
+ css(property: string, value: string): this;
160
+ css(property: Record<string, string>): this;
158
161
  /** Wrap each element with a wrapper element or tag. */
159
162
  wrap(wrapper: string | Element): this;
160
163
  /**
@@ -262,6 +265,19 @@ export declare class BQueryCollection {
262
265
  * ```
263
266
  */
264
267
  undelegate(event: string, selector: string, handler: (event: Event, target: Element) => void): this;
268
+ /**
269
+ * Finds all descendant elements matching the selector across all elements
270
+ * in the collection. Returns a new BQueryCollection with the results.
271
+ *
272
+ * @param selector - CSS selector to match
273
+ * @returns A new BQueryCollection with all matching descendants
274
+ *
275
+ * @example
276
+ * ```ts
277
+ * $$('.container').find('.item').addClass('highlight');
278
+ * ```
279
+ */
280
+ find(selector: string): BQueryCollection;
265
281
  /**
266
282
  * Removes all elements from the DOM.
267
283
  *
@@ -1 +1 @@
1
- {"version":3,"file":"collection.d.ts","sourceRoot":"","sources":["../../src/core/collection.ts"],"names":[],"mappings":"AAAA,OAAO,EAIL,KAAK,iBAAiB,EACvB,MAAM,OAAO,CAAC;AACf,OAAO,EAAE,aAAa,EAAE,MAAM,WAAW,CAAC;AAM1C;;;;;;;;;;;;;;;;GAgBG;AACH,qBAAa,gBAAgB;aAgBC,QAAQ,EAAE,OAAO,EAAE;IAf/C;;;;;OAKG;IACH,OAAO,CAAC,QAAQ,CAAC,iBAAiB,CAG9B;IAEJ;;;OAGG;gBACyB,QAAQ,EAAE,OAAO,EAAE;IAE/C;;OAE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AAa,GAAG,IAAI;IAKjD;;;;;;OAMG;IACH,GAAG,CAAC,KAAK,EAAE,MAAM,EAAE,OAAO,EAAE,kCAAkC,GAAG,IAAI;IAKrE;;;;;;OAMG;IACH,OAAO,CAAC,KAAK,EAAE,MAAM,EAAE,MAAM,CAAC,EAAE,OAAO,GAAG,IAAI;IAO9C;;;;;;;;;;;;;;;;;;;OAmBG;IACH,QAAQ,CACN,KAAK,EAAE,MAAM,EACb,QAAQ,EAAE,MAAM,EAChB,OAAO,EAAE,CAAC,KAAK,EAAE,KAAK,EAAE,MAAM,EAAE,OAAO,KAAK,IAAI,GAC/C,IAAI;IA4BP;;;;;;;;;;;;;;;;OAgBG;IACH,UAAU,CACR,KAAK,EAAE,MAAM,EACb,QAAQ,EAAE,MAAM,EAChB,OAAO,EAAE,CAAC,KAAK,EAAE,KAAK,EAAE,MAAM,EAAE,OAAO,KAAK,IAAI,GAC/C,IAAI;IA4BP;;;;;;;;;;;OAWG;IACH,IAAI,CAAC,QAAQ,EAAE,MAAM,GAAG,gBAAgB;IAexC;;;;OAIG;IACH,MAAM,IAAI,IAAI;IAKd;;;;OAIG;IACH,KAAK,IAAI,IAAI;IAOb,gBAAgB;IAChB,OAAO,CAAC,SAAS;CAiBlB"}
@@ -68,18 +68,23 @@ export declare class BQueryElement {
68
68
  *
69
69
  * @param property - A CSS property name or an object of property-value pairs
70
70
  * @param value - The value when setting a single property
71
- * @returns The instance for method chaining
71
+ * @returns The computed style value when getting a single property, or the instance for method chaining when setting
72
72
  *
73
73
  * @example
74
74
  * ```ts
75
- * // Single property
75
+ * // Get a computed style value
76
+ * const color = $('#box').css('color');
77
+ *
78
+ * // Set a single property
76
79
  * $('#box').css('color', 'red');
77
80
  *
78
- * // Multiple properties
81
+ * // Set multiple properties
79
82
  * $('#box').css({ color: 'red', 'font-size': '16px' });
80
83
  * ```
81
84
  */
82
- css(property: string | Record<string, string>, value?: string): this;
85
+ css(property: string): string;
86
+ css(property: string, value: string): this;
87
+ css(property: Record<string, string>): this;
83
88
  /**
84
89
  * Appends HTML or elements to the end of the element.
85
90
  *
@@ -313,6 +318,20 @@ export declare class BQueryElement {
313
318
  * @returns True if the element matches the selector
314
319
  */
315
320
  matches(selector: string): boolean;
321
+ /**
322
+ * Alias for `matches()`. Checks if the element matches a CSS selector.
323
+ *
324
+ * @param selector - CSS selector to match against
325
+ * @returns True if the element matches the selector
326
+ *
327
+ * @example
328
+ * ```ts
329
+ * if ($('#el').is('.active')) {
330
+ * console.log('Element is active');
331
+ * }
332
+ * ```
333
+ */
334
+ is(selector: string): boolean;
316
335
  /**
317
336
  * Checks if the element has a specific class.
318
337
  *
@@ -1 +1 @@
1
- {"version":3,"file":"element.d.ts","sourceRoot":"","sources":["../../src/core/element.ts"],"names":[],"mappings":"AA2BA,qBAAa,aAAa;IAYZ,OAAO,CAAC,QAAQ,CAAC,OAAO;IAXpC;;;;OAIG;IACH,OAAO,CAAC,QAAQ,CAAC,iBAAiB,CAA2D;IAE7F;;;OAGG;gBAC0B,OAAO,EAAE,OAAO;IAE7C;;;OAGG;IACH,IAAI,GAAG,IAAI,OAAO,CAEjB;IAED;;;OAGG;IACH,IAAI,IAAI,IAAI,OAAO,CAElB;IAED,+BAA+B;IAC/B,QAAQ,CAAC,GAAG,UAAU,EAAE,MAAM,EAAE,GAAG,IAAI;IAKvC,kCAAkC;IAClC,WAAW,CAAC,GAAG,UAAU,EAAE,MAAM,EAAE,GAAG,IAAI;IAK1C,8BAA8B;IAC9B,WAAW,CAAC,SAAS,EAAE,MAAM,EAAE,KAAK,CAAC,EAAE,OAAO,GAAG,IAAI;IAKrD,+BAA+B;IAC/B,IAAI,CAAC,IAAI,EAAE,MAAM,EAAE,KAAK,CAAC,EAAE,MAAM,GAAG,MAAM,GAAG,IAAI;IAQjD,2BAA2B;IAC3B,UAAU,CAAC,IAAI,EAAE,MAAM,GAAG,IAAI;IAK9B,kCAAkC;IAClC,UAAU,CAAC,IAAI,EAAE,MAAM,EAAE,KAAK,CAA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O;IAI7B;;;;;OAKG;IACH,QAAQ,CAAC,SAAS,EAAE,MAAM,GAAG,OAAO;IAIpC;;;;;OAKG;IACH,IAAI,CAAC,OAAO,GAAE,MAAW,GAAG,IAAI;IAMhC;;;;OAIG;IACH,IAAI,IAAI,IAAI;IAKZ;;;;;OAKG;IACH,MAAM,CAAC,KAAK,CAAC,EAAE,OAAO,GAAG,IAAI;IAM7B;;;;OAIG;IACH,KAAK,IAAI,IAAI;IAKb;;;;OAIG;IACH,IAAI,IAAI,IAAI;IAKZ;;;;;OAKG;IACH,GAAG,CAAC,QAAQ,CAAC,EAAE,MAAM,GAAG,MAAM,GAAG,IAAI;IASrC;;;;;;;;;;;;OAYG;IACH,SAAS,IAAI,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,EAAE,CAAC;IA4B9C;;;;;;;;;;OAUG;IACH,eAAe,IAAI,MAAM;IAkBzB;;;;OAIG;IACH,IAAI,IAAI,OAAO;IAIf;;;;OAIG;IACH,MAAM,IAAI;QAAE,KAAK,EAAE,MAAM,CAAC;QAAC,MAAM,EAAE,MAAM,CAAC;QAAC,GAAG,EAAE,MAAM,CAAC;QAAC,IAAI,EAAE,MAAM,CAAA;KAAE;IAUtE;;;OAGG;IACH,OAAO,CAAC,aAAa;CAGtB"}
@@ -3,4 +3,5 @@ export { BQueryElement } from './element';
3
3
  export { $, $$ } from './selector';
4
4
  export { utils } from './utils';
5
5
  export { chunk, compact, ensureArray, flatten, unique, debounce, noop, once, throttle, isEmpty, parseJson, sleep, uid, clamp, inRange, randomInt, toNumber, clone, hasOwn, isPlainObject, merge, omit, pick, capitalize, escapeRegExp, slugify, toCamelCase, toKebabCase, truncate, isArray, isBoolean, isCollection, isDate, isElement, isFunction, isNumber, isObject, isPromise, isString, } from './utils';
6
+ export type { DebouncedFn, ThrottledFn } from './utils';
6
7
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/core/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,MAAM,cAAc,CAAC;AAChD,OAAO,EAAE,aAAa,EAAE,MAAM,WAAW,CAAC;AAC1C,OAAO,EAAE,CAAC,EAAE,EAAE,EAAE,MAAM,YAAY,CAAC;AAEnC,OAAO,EAAE,KAAK,EAAE,MAAM,SAAS,CAAC;AAEhC,OAAO,EACL,KAAK,EACL,OAAO,EACP,WAAW,EACX,OAAO,EACP,MAAM,EACN,QAAQ,EACR,IAAI,EACJ,IAAI,EACJ,QAAQ,EACR,OAAO,EACP,SAAS,EACT,KAAK,EACL,GAAG,EACH,KAAK,EACL,OAAO,EACP,SAAS,EACT,QAAQ,EACR,KAAK,EACL,MAAM,EACN,aAAa,EACb,KAAK,EACL,IAAI,EACJ,IAAI,EACJ,UAAU,EACV,YAAY,EACZ,OAAO,EACP,WAAW,EACX,WAAW,EACX,QAAQ,EACR,OAAO,EACP,SAAS,EACT,YAAY,EACZ,MAAM,EACN,SAAS,EACT,UAAU,EACV,QAAQ,EACR,QAAQ,EACR,SAAS,EACT,QAAQ,GACT,MAAM,SAAS,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/core/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,MAAM,cAAc,CAAC;AAChD,OAAO,EAAE,aAAa,EAAE,MAAM,WAAW,CAAC;AAC1C,OAAO,EAAE,CAAC,EAAE,EAAE,EAAE,MAAM,YAAY,CAAC;AAEnC,OAAO,EAAE,KAAK,EAAE,MAAM,SAAS,CAAC;AAEhC,OAAO,EACL,KAAK,EACL,OAAO,EACP,WAAW,EACX,OAAO,EACP,MAAM,EACN,QAAQ,EACR,IAAI,EACJ,IAAI,EACJ,QAAQ,EACR,OAAO,EACP,SAAS,EACT,KAAK,EACL,GAAG,EACH,KAAK,EACL,OAAO,EACP,SAAS,EACT,QAAQ,EACR,KAAK,EACL,MAAM,EACN,aAAa,EACb,KAAK,EACL,IAAI,EACJ,IAAI,EACJ,UAAU,EACV,YAAY,EACZ,OAAO,EACP,WAAW,EACX,WAAW,EACX,QAAQ,EACR,OAAO,EACP,SAAS,EACT,YAAY,EACZ,MAAM,EACN,SAAS,EACT,UAAU,EACV,QAAQ,EACR,QAAQ,EACR,SAAS,EACT,QAAQ,GACT,MAAM,SAAS,CAAC;AACjB,YAAY,EAAE,WAAW,EAAE,WAAW,EAAE,MAAM,SAAS,CAAC"}
@@ -3,6 +3,18 @@
3
3
  *
4
4
  * @module bquery/core/utils/function
5
5
  */
6
+ /** A debounced function with a cancel method to clear the pending timeout. */
7
+ export interface DebouncedFn<TArgs extends unknown[]> {
8
+ (...args: TArgs): void;
9
+ /** Cancels the pending debounced invocation. */
10
+ cancel(): void;
11
+ }
12
+ /** A throttled function with a cancel method to reset the throttle timer. */
13
+ export interface ThrottledFn<TArgs extends unknown[]> {
14
+ (...args: TArgs): void;
15
+ /** Resets the throttle timer, allowing the next call to execute immediately. */
16
+ cancel(): void;
17
+ }
6
18
  /**
7
19
  * Creates a debounced function that delays execution until after
8
20
  * the specified delay has elapsed since the last call.
@@ -10,7 +22,7 @@
10
22
  * @template TArgs - The argument types of the function
11
23
  * @param fn - The function to debounce
12
24
  * @param delayMs - Delay in milliseconds
13
- * @returns A debounced version of the function
25
+ * @returns A debounced version of the function with a `cancel()` method
14
26
  *
15
27
  * @example
16
28
  * ```ts
@@ -21,16 +33,19 @@
21
33
  * search('h');
22
34
  * search('he');
23
35
  * search('hello'); // Only this call executes after 300ms
36
+ *
37
+ * search('cancel me');
38
+ * search.cancel(); // Cancels the pending invocation
24
39
  * ```
25
40
  */
26
- export declare function debounce<TArgs extends unknown[]>(fn: (...args: TArgs) => void, delayMs: number): (...args: TArgs) => void;
41
+ export declare function debounce<TArgs extends unknown[]>(fn: (...args: TArgs) => void, delayMs: number): DebouncedFn<TArgs>;
27
42
  /**
28
43
  * Creates a throttled function that runs at most once per interval.
29
44
  *
30
45
  * @template TArgs - The argument types of the function
31
46
  * @param fn - The function to throttle
32
47
  * @param intervalMs - Minimum interval between calls in milliseconds
33
- * @returns A throttled version of the function
48
+ * @returns A throttled version of the function with a `cancel()` method
34
49
  *
35
50
  * @example
36
51
  * ```ts
@@ -39,9 +54,11 @@ export declare function debounce<TArgs extends unknown[]>(fn: (...args: TArgs) =
39
54
  * }, 100);
40
55
  *
41
56
  * window.addEventListener('scroll', handleScroll);
57
+ *
58
+ * handleScroll.cancel(); // Resets throttle, next call executes immediately
42
59
  * ```
43
60
  */
44
- export declare function throttle<TArgs extends unknown[]>(fn: (...args: TArgs) => void, intervalMs: number): (...args: TArgs) => void;
61
+ export declare function throttle<TArgs extends unknown[]>(fn: (...args: TArgs) => void, intervalMs: number): ThrottledFn<TArgs>;
45
62
  /**
46
63
  * Ensures a function only runs once. Subsequent calls return the first result.
47
64
  *
@@ -1 +1 @@
1
- {"version":3,"file":"function.d.ts","sourceRoot":"","sources":["../../../src/core/utils/function.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH;;;;;;;;;;;;;;;;;;;GAmBG;AACH,wBAAgB,QAAQ,CAAC,KAAK,SAAS,OAAO,EAAE,EAC9C,EAAE,EAAE,CAAC,GAAG,IAAI,EAAE,KAAK,KAAK,IAAI,EAC5B,OAAO,EAAE,MAAM,GACd,CAAC,GAAG,IAAI,EAAE,KAAK,KAAK,IAAI,CAQ1B;AAED;;;;;;;;;;;;;;;;GAgBG;AACH,wBAAgB,QAAQ,CAAC,KAAK,SAAS,OAAO,EAAE,EAC9C,EAAE,EAAE,CAAC,GAAG,IAAI,EAAE,KAAK,KAAK,IAAI,EAC5B,UAAU,EAAE,MAAM,GACjB,CAAC,GAAG,IAAI,EAAE,KAAK,KAAK,IAAI,CAS1B;AAED;;;;;;;;;;;;;;GAcG;AACH,wBAAgB,IAAI,CAAC,KAAK,SAAS,OAAO,EAAE,EAAE,OAAO,EACnD,EAAE,EAAE,CAAC,GAAG,IAAI,EAAE,KAAK,KAAK,OAAO,GAC9B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 -1,13 +1,13 @@
1
1
  const r = [];
2
2
  let i = 0;
3
- const n = /* @__PURE__ */ new Set(), a = /* @__PURE__ */ new WeakMap(), u = (e, s) => {
3
+ const u = /* @__PURE__ */ new Set(), c = /* @__PURE__ */ new WeakMap(), a = (e, s) => {
4
4
  r.push(e);
5
5
  try {
6
6
  return s();
7
7
  } finally {
8
8
  r.pop();
9
9
  }
10
- }, o = () => r[r.length - 1], y = (e) => {
10
+ }, h = () => r[r.length - 1], v = (e) => {
11
11
  r.push(void 0);
12
12
  try {
13
13
  return e();
@@ -16,29 +16,38 @@ const n = /* @__PURE__ */ new Set(), a = /* @__PURE__ */ new WeakMap(), u = (e,
16
16
  }
17
17
  }, b = (e) => {
18
18
  if (i > 0) {
19
- n.add(e);
19
+ u.add(e);
20
20
  return;
21
21
  }
22
22
  e();
23
- }, d = () => {
24
- for (const e of Array.from(n))
25
- n.delete(e), e();
26
- }, v = () => {
27
- i += 1;
23
+ }, l = () => {
24
+ for (const e of Array.from(u)) {
25
+ u.delete(e);
26
+ try {
27
+ e();
28
+ } catch (s) {
29
+ console.error("bQuery reactive: Error in observer during batch flush", s);
30
+ }
31
+ }
28
32
  }, m = () => {
29
- i -= 1, i === 0 && d();
30
- }, l = (e, s) => {
31
- let t = a.get(e);
32
- t || (t = /* @__PURE__ */ new Set(), a.set(e, t)), t.add(s);
33
- }, h = (e) => {
34
- const s = a.get(e);
33
+ i += 1;
34
+ }, g = () => {
35
+ i <= 0 || (i -= 1, i === 0 && l());
36
+ }, d = (e, s) => {
37
+ let t = c.get(e);
38
+ t || (t = /* @__PURE__ */ new Set(), c.set(e, t)), t.add(s);
39
+ }, f = (e, s) => {
40
+ const t = c.get(e);
41
+ t && t.delete(s);
42
+ }, o = (e) => {
43
+ const s = c.get(e);
35
44
  if (s) {
36
45
  for (const t of s)
37
46
  t.unsubscribe(e);
38
47
  s.clear();
39
48
  }
40
49
  };
41
- class f {
50
+ class p {
42
51
  /**
43
52
  * Creates a new computed value.
44
53
  * @param compute - Function that computes the value
@@ -47,8 +56,8 @@ class f {
47
56
  this.compute = s, this.dirty = !0, this.subscribers = /* @__PURE__ */ new Set(), this.markDirty = () => {
48
57
  this.dirty = !0;
49
58
  const t = Array.from(this.subscribers);
50
- for (const c of t)
51
- b(c);
59
+ for (const n of t)
60
+ b(n);
52
61
  };
53
62
  }
54
63
  /**
@@ -56,8 +65,8 @@ class f {
56
65
  * During untrack calls, getCurrentObserver returns undefined, preventing dependency tracking.
57
66
  */
58
67
  get value() {
59
- const s = o();
60
- return s && (this.subscribers.add(s), l(s, this)), this.dirty && (this.dirty = !1, h(this.markDirty), this.cachedValue = u(this.markDirty, this.compute)), this.cachedValue;
68
+ const s = h();
69
+ return s && (this.subscribers.add(s), d(s, this)), this.dirty && (this.dirty = !1, o(this.markDirty), this.cachedValue = a(this.markDirty, this.compute)), this.cachedValue;
61
70
  }
62
71
  /**
63
72
  * Reads the current computed value without tracking.
@@ -66,7 +75,7 @@ class f {
66
75
  * @returns The current cached value (recomputes if dirty)
67
76
  */
68
77
  peek() {
69
- return this.dirty && (this.dirty = !1, h(this.markDirty), this.cachedValue = u(this.markDirty, this.compute)), this.cachedValue;
78
+ return this.dirty && (this.dirty = !1, o(this.markDirty), this.cachedValue = a(this.markDirty, this.compute)), this.cachedValue;
70
79
  }
71
80
  /**
72
81
  * Removes an observer from this computed's subscriber set.
@@ -76,8 +85,8 @@ class f {
76
85
  this.subscribers.delete(s);
77
86
  }
78
87
  }
79
- const g = (e) => new f(e);
80
- class p {
88
+ const k = (e) => new p(e);
89
+ class y {
81
90
  /**
82
91
  * Creates a new signal with an initial value.
83
92
  * @param _value - The initial value
@@ -90,8 +99,8 @@ class p {
90
99
  * During untrack calls, getCurrentObserver returns undefined, preventing dependency tracking.
91
100
  */
92
101
  get value() {
93
- const s = o();
94
- return s && (this.subscribers.add(s), l(s, this)), this._value;
102
+ const s = h();
103
+ return s && (this.subscribers.add(s), d(s, this)), this._value;
95
104
  }
96
105
  /**
97
106
  * Sets a new value and notifies all subscribers if the value changed.
@@ -101,8 +110,8 @@ class p {
101
110
  if (Object.is(this._value, s)) return;
102
111
  this._value = s;
103
112
  const t = Array.from(this.subscribers);
104
- for (const c of t)
105
- b(c);
113
+ for (const n of t)
114
+ b(n);
106
115
  }
107
116
  /**
108
117
  * Reads the current value without tracking.
@@ -122,6 +131,22 @@ class p {
122
131
  update(s) {
123
132
  this.value = s(this._value);
124
133
  }
134
+ /**
135
+ * Removes all subscribers from this signal.
136
+ * Use this when a signal is no longer needed to prevent memory leaks.
137
+ *
138
+ * @example
139
+ * ```ts
140
+ * const count = signal(0);
141
+ * effect(() => console.log(count.value));
142
+ * count.dispose(); // All subscribers removed
143
+ * ```
144
+ */
145
+ dispose() {
146
+ for (const s of this.subscribers)
147
+ f(s, this);
148
+ this.subscribers.clear();
149
+ }
125
150
  /**
126
151
  * Removes an observer from this signal's subscriber set.
127
152
  * @internal
@@ -130,16 +155,16 @@ class p {
130
155
  this.subscribers.delete(s);
131
156
  }
132
157
  }
133
- const k = (e) => new p(e);
158
+ const D = (e) => new y(e);
134
159
  export {
135
- f as C,
136
- p as S,
137
- h as a,
138
- v as b,
139
- g as c,
140
- m as e,
141
- k as s,
142
- u as t,
143
- y as w
160
+ p as C,
161
+ y as S,
162
+ o as a,
163
+ m as b,
164
+ k as c,
165
+ g as e,
166
+ D as s,
167
+ a as t,
168
+ v as w
144
169
  };
145
- //# sourceMappingURL=core-COenAZjD.js.map
170
+ //# sourceMappingURL=core-BhpuvPhy.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"core-BhpuvPhy.js","sources":["../src/reactive/internals.ts","../src/reactive/computed.ts","../src/reactive/core.ts"],"sourcesContent":["/**\r\n * Internal reactive plumbing shared across primitives.\r\n * @internal\r\n */\r\n\r\nexport type Observer = () => void;\r\nexport type CleanupFn = () => void;\r\n\r\n/**\r\n * Interface for reactive sources (Signals, Computed) that can unsubscribe observers.\r\n * @internal\r\n */\r\nexport interface ReactiveSource {\r\n unsubscribe(observer: Observer): void;\r\n}\r\n\r\nconst observerStack: Observer[] = [];\r\nlet batchDepth = 0;\r\nconst pendingObservers = new Set<Observer>();\r\n\r\n// Track dependencies for each observer to enable cleanup\r\nconst observerDependencies = new WeakMap<Observer, Set<ReactiveSource>>();\r\n\r\nexport const track = <T>(observer: Observer, fn: () => T): T => {\r\n observerStack.push(observer);\r\n try {\r\n return fn();\r\n } finally {\r\n observerStack.pop();\r\n }\r\n};\r\n\r\nexport const getCurrentObserver = (): Observer | undefined =>\r\n observerStack[observerStack.length - 1];\r\n\r\n/**\r\n * Executes a function without exposing the current observer to dependencies.\r\n * Unlike disabling tracking globally, this still allows nested reactive internals\r\n * (e.g., computed recomputation) to track their own dependencies.\r\n * @internal\r\n */\r\nexport const withoutCurrentObserver = <T>(fn: () => T): T => {\r\n // Push undefined to temporarily \"hide\" the current observer\r\n // This way, Signal.value reads won't link to the previous observer,\r\n // but nested track() calls (e.g., computed recompute) still work normally.\r\n observerStack.push(undefined as unknown as Observer);\r\n try {\r\n return fn();\r\n } finally {\r\n observerStack.pop();\r\n }\r\n};\r\n\r\nexport const scheduleObserver = (observer: Observer): void => {\r\n if (batchDepth > 0) {\r\n pendingObservers.add(observer);\r\n return;\r\n }\r\n observer();\r\n};\r\n\r\nconst flushObservers = (): void => {\r\n for (const observer of Array.from(pendingObservers)) {\r\n pendingObservers.delete(observer);\r\n try {\r\n observer();\r\n } catch (error) {\r\n console.error('bQuery reactive: Error in observer during batch flush', error);\r\n }\r\n }\r\n};\r\n\r\nexport const beginBatch = (): void => {\r\n batchDepth += 1;\r\n};\r\n\r\nexport const endBatch = (): void => {\r\n if (batchDepth <= 0) return;\r\n batchDepth -= 1;\r\n if (batchDepth === 0) {\r\n flushObservers();\r\n }\r\n};\r\n\r\n/**\r\n * Registers a dependency between an observer and a reactive source.\r\n * @internal\r\n */\r\nexport const registerDependency = (observer: Observer, source: ReactiveSource): void => {\r\n let deps = observerDependencies.get(observer);\r\n if (!deps) {\r\n deps = new Set();\r\n observerDependencies.set(observer, deps);\r\n }\r\n deps.add(source);\r\n};\r\n\r\n/**\r\n * Removes a specific source from an observer's dependency set.\r\n * Used when a source (e.g. Signal) is disposed to prevent stale references.\r\n * @internal\r\n */\r\nexport const removeDependency = (observer: Observer, source: ReactiveSource): void => {\r\n const deps = observerDependencies.get(observer);\r\n if (deps) {\r\n deps.delete(source);\r\n }\r\n};\r\n\r\n/**\r\n * Clears all dependencies for an observer, unsubscribing from all sources.\r\n * @internal\r\n */\r\nexport const clearDependencies = (observer: Observer): void => {\r\n const deps = observerDependencies.get(observer);\r\n if (deps) {\r\n for (const source of deps) {\r\n source.unsubscribe(observer);\r\n }\r\n deps.clear();\r\n }\r\n};\r\n","/**\n * Computed reactive values.\n */\n\nimport {\n clearDependencies,\n getCurrentObserver,\n registerDependency,\n scheduleObserver,\n track,\n type ReactiveSource,\n} from './internals';\n\n/**\n * A computed value that derives from other reactive sources.\n *\n * Computed values are lazily evaluated and cached. They only\n * recompute when their dependencies change.\n *\n * @template T - The type of the computed value\n */\nexport class Computed<T> implements ReactiveSource {\n private cachedValue!: T;\n private dirty = true;\n private subscribers = new Set<() => void>();\n private readonly markDirty = () => {\n this.dirty = true;\n // Create snapshot to avoid issues with subscribers modifying the set during iteration\n const subscribersSnapshot = Array.from(this.subscribers);\n for (const subscriber of subscribersSnapshot) {\n scheduleObserver(subscriber);\n }\n };\n\n /**\n * Creates a new computed value.\n * @param compute - Function that computes the value\n */\n constructor(private readonly compute: () => T) {}\n\n /**\n * Gets the computed value, recomputing if dependencies changed.\n * During untrack calls, getCurrentObserver returns undefined, preventing dependency tracking.\n */\n get value(): T {\n const current = getCurrentObserver();\n if (current) {\n this.subscribers.add(current);\n registerDependency(current, this);\n }\n if (this.dirty) {\n this.dirty = false;\n // Clear old dependencies before recomputing\n clearDependencies(this.markDirty);\n this.cachedValue = track(this.markDirty, this.compute);\n }\n return this.cachedValue;\n }\n\n /**\n * Reads the current computed value without tracking.\n * Useful when you need the value but don't want to create a dependency.\n *\n * @returns The current cached value (recomputes if dirty)\n */\n peek(): T {\n if (this.dirty) {\n this.dirty = false;\n // Clear old dependencies before recomputing\n clearDependencies(this.markDirty);\n this.cachedValue = track(this.markDirty, this.compute);\n }\n return this.cachedValue;\n }\n\n /**\n * Removes an observer from this computed's subscriber set.\n * @internal\n */\n unsubscribe(observer: () => void): void {\n this.subscribers.delete(observer);\n }\n}\n\n/**\n * Creates a new computed value.\n *\n * @template T - The type of the computed value\n * @param fn - Function that computes the value from reactive sources\n * @returns A new Computed instance\n */\nexport const computed = <T>(fn: () => T): Computed<T> => new Computed(fn);\n","/**\r\n * Core reactive signals.\r\n */\r\n\r\nimport {\r\n getCurrentObserver,\r\n registerDependency,\r\n removeDependency,\r\n scheduleObserver,\r\n type ReactiveSource,\r\n} from './internals';\r\n\r\n/**\r\n * A reactive value container that notifies subscribers on change.\r\n *\r\n * Signals are the foundational primitive of the reactive system.\r\n * Reading a signal's value inside an effect or computed automatically\r\n * establishes a reactive dependency.\r\n *\r\n * @template T - The type of the stored value\r\n */\r\nexport class Signal<T> implements ReactiveSource {\r\n private subscribers = new Set<() => void>();\r\n\r\n /**\r\n * Creates a new signal with an initial value.\r\n * @param _value - The initial value\r\n */\r\n constructor(private _value: T) {}\r\n\r\n /**\r\n * Gets the current value and tracks the read if inside an observer.\r\n * During untrack calls, getCurrentObserver returns undefined, preventing dependency tracking.\r\n */\r\n get value(): T {\r\n const current = getCurrentObserver();\r\n if (current) {\r\n this.subscribers.add(current);\r\n registerDependency(current, this);\r\n }\r\n return this._value;\r\n }\r\n\r\n /**\r\n * Sets a new value and notifies all subscribers if the value changed.\r\n * Uses Object.is for equality comparison.\r\n */\r\n set value(next: T) {\r\n if (Object.is(this._value, next)) return;\r\n this._value = next;\r\n // Create snapshot to avoid issues with subscribers modifying the set during iteration\r\n const subscribersSnapshot = Array.from(this.subscribers);\r\n for (const subscriber of subscribersSnapshot) {\r\n scheduleObserver(subscriber);\r\n }\r\n }\r\n\r\n /**\r\n * Reads the current value without tracking.\r\n * Useful when you need the value but don't want to create a dependency.\r\n *\r\n * @returns The current value\r\n */\r\n peek(): T {\r\n return this._value;\r\n }\r\n\r\n /**\r\n * Updates the value using a function.\r\n * Useful for updates based on the current value.\r\n *\r\n * @param updater - Function that receives current value and returns new value\r\n */\r\n update(updater: (current: T) => T): void {\r\n this.value = updater(this._value);\r\n }\r\n\r\n /**\r\n * Removes all subscribers from this signal.\r\n * Use this when a signal is no longer needed to prevent memory leaks.\r\n *\r\n * @example\r\n * ```ts\r\n * const count = signal(0);\r\n * effect(() => console.log(count.value));\r\n * count.dispose(); // All subscribers removed\r\n * ```\r\n */\r\n dispose(): void {\r\n // Remove this signal from each subscriber's dependency set\r\n // so the observer no longer holds a strong reference to it\r\n for (const subscriber of this.subscribers) {\r\n removeDependency(subscriber, this);\r\n }\r\n this.subscribers.clear();\r\n }\r\n\r\n /**\r\n * Removes an observer from this signal's subscriber set.\r\n * @internal\r\n */\r\n unsubscribe(observer: () => void): void {\r\n this.subscribers.delete(observer);\r\n }\r\n}\r\n\r\n/**\r\n * Creates a new reactive signal.\r\n *\r\n * @template T - The type of the signal value\r\n * @param value - The initial value\r\n * @returns A new Signal instance\r\n */\r\nexport const signal = <T>(value: T): Signal<T> => new Signal(value);\r\n"],"names":["observerStack","batchDepth","pendingObservers","observerDependencies","track","observer","fn","getCurrentObserver","withoutCurrentObserver","scheduleObserver","flushObservers","error","beginBatch","endBatch","registerDependency","source","deps","removeDependency","clearDependencies","Computed","compute","subscribersSnapshot","subscriber","current","computed","Signal","_value","next","updater","signal","value"],"mappings":"AAgBA,MAAMA,IAA4B,CAAA;AAClC,IAAIC,IAAa;AACjB,MAAMC,wBAAuB,IAAA,GAGvBC,wBAA2B,QAAA,GAEpBC,IAAQ,CAAIC,GAAoBC,MAAmB;AAC9D,EAAAN,EAAc,KAAKK,CAAQ;AAC3B,MAAI;AACF,WAAOC,EAAA;AAAA,EACT,UAAA;AACE,IAAAN,E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