aberdeen 1.18.1 → 1.19.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/README.md +9 -0
- package/dist/src/aberdeen.d.ts +29 -0
- package/{dist-docs/assets/aberdeen/aberdeen.js → dist/src/aberdeen.dev.js} +796 -21
- package/dist/src/aberdeen.dev.js.map +12 -0
- package/dist/src/aberdeen.js +79 -19
- package/dist/src/aberdeen.js.map +3 -3
- package/dist/src/devtools.d.ts +26 -0
- package/dist/tests/fakedom.js +20 -3
- package/dist/tests/fakedom.js.map +3 -3
- package/dist/tests/helpers.js +20 -3
- package/dist/tests/helpers.js.map +3 -3
- package/html-to-aberdeen +9 -5
- package/package.json +17 -10
- package/skill/A.md +127 -0
- package/skill/Dispatcher.md +51 -0
- package/skill/OPAQUE.md +15 -0
- package/skill/PromiseProxy.md +25 -0
- package/skill/Route.md +50 -0
- package/skill/SKILL.md +272 -156
- package/skill/applyCanon.md +20 -0
- package/skill/applyPrediction.md +15 -0
- package/skill/back.md +11 -0
- package/skill/clean.md +43 -0
- package/skill/clone.md +15 -0
- package/skill/copy.md +40 -0
- package/skill/count.md +32 -0
- package/skill/cssVars.md +15 -0
- package/skill/darkMode.md +26 -0
- package/skill/derive.md +56 -0
- package/skill/developer-tools.md +23 -0
- package/skill/disableCreateDestroy.md +11 -0
- package/skill/dump.md +37 -0
- package/skill/freeze.md +20 -0
- package/skill/full-example-multi-page-app.md +146 -0
- package/skill/go.md +25 -0
- package/skill/grow.md +13 -0
- package/skill/html-to-aberdeen.md +9 -0
- package/skill/insertCss.md +79 -0
- package/skill/insertGlobalCss.md +68 -0
- package/skill/interceptLinks.md +19 -0
- package/skill/invertString.md +32 -0
- package/skill/isEmpty.md +38 -0
- package/skill/map.md +16 -0
- package/skill/matchCurrent.md +27 -0
- package/skill/merge.md +27 -0
- package/skill/mount.md +48 -0
- package/skill/multiMap.md +15 -0
- package/skill/onEach.md +14 -0
- package/skill/partition.md +15 -0
- package/skill/peek.md +36 -0
- package/skill/persistScroll.md +13 -0
- package/skill/proxy.md +11 -0
- package/skill/push.md +13 -0
- package/skill/ref.md +39 -0
- package/skill/runQueue.md +34 -0
- package/skill/setErrorHandler.md +48 -0
- package/skill/setLog.md +9 -0
- package/skill/setSpacingCssVars.md +31 -0
- package/skill/shrink.md +13 -0
- package/skill/unmountAll.md +9 -0
- package/skill/unproxy.md +43 -0
- package/skill/up.md +13 -0
- package/src/aberdeen.ts +220 -82
- package/src/devtools.ts +685 -0
- package/dist-docs/.nojekyll +0 -1
- package/dist-docs/Tutorial/index.html +0 -305
- package/dist-docs/aberdeen/A/index.html +0 -115
- package/dist-docs/aberdeen/CUSTOM_DUMP/index.html +0 -7
- package/dist-docs/aberdeen/NO_COPY/index.html +0 -2
- package/dist-docs/aberdeen/OPAQUE/index.html +0 -12
- package/dist-docs/aberdeen/PromiseProxy/index.html +0 -8
- package/dist-docs/aberdeen/clean/index.html +0 -11
- package/dist-docs/aberdeen/clone/index.html +0 -5
- package/dist-docs/aberdeen/copy/index.html +0 -22
- package/dist-docs/aberdeen/count/index.html +0 -7
- package/dist-docs/aberdeen/cssVars/index.html +0 -11
- package/dist-docs/aberdeen/darkMode/index.html +0 -9
- package/dist-docs/aberdeen/default/index.html +0 -341
- package/dist-docs/aberdeen/derive/index.html +0 -18
- package/dist-docs/aberdeen/disableCreateDestroy/index.html +0 -6
- package/dist-docs/aberdeen/dump/index.html +0 -11
- package/dist-docs/aberdeen/index.html +0 -54
- package/dist-docs/aberdeen/insertCss/index.html +0 -30
- package/dist-docs/aberdeen/insertGlobalCss/index.html +0 -19
- package/dist-docs/aberdeen/invertString/index.html +0 -13
- package/dist-docs/aberdeen/isEmpty/index.html +0 -12
- package/dist-docs/aberdeen/map/index.html +0 -26
- package/dist-docs/aberdeen/merge/index.html +0 -11
- package/dist-docs/aberdeen/mount/index.html +0 -17
- package/dist-docs/aberdeen/multiMap/index.html +0 -28
- package/dist-docs/aberdeen/onEach/index.html +0 -19
- package/dist-docs/aberdeen/partition/index.html +0 -36
- package/dist-docs/aberdeen/peek/index.html +0 -40
- package/dist-docs/aberdeen/proxy/index.html +0 -35
- package/dist-docs/aberdeen/ref/index.html +0 -13
- package/dist-docs/aberdeen/runQueue/index.html +0 -13
- package/dist-docs/aberdeen/setErrorHandler/index.html +0 -16
- package/dist-docs/aberdeen/setSpacingCssVars/index.html +0 -8
- package/dist-docs/aberdeen/unmountAll/index.html +0 -5
- package/dist-docs/aberdeen/unproxy/index.html +0 -11
- package/dist-docs/assets/aberdeen/aberdeen.d.ts +0 -961
- package/dist-docs/assets/aberdeen/aberdeen.js.map +0 -11
- package/dist-docs/assets/aberdeen/dispatcher.d.ts +0 -57
- package/dist-docs/assets/aberdeen/dispatcher.js +0 -66
- package/dist-docs/assets/aberdeen/dispatcher.js.map +0 -10
- package/dist-docs/assets/aberdeen/helpers/reverseSortedSet.d.ts +0 -96
- package/dist-docs/assets/aberdeen/prediction.d.ts +0 -33
- package/dist-docs/assets/aberdeen/prediction.js +0 -112
- package/dist-docs/assets/aberdeen/prediction.js.map +0 -10
- package/dist-docs/assets/aberdeen/route.d.ts +0 -137
- package/dist-docs/assets/aberdeen/route.js +0 -287
- package/dist-docs/assets/aberdeen/route.js.map +0 -10
- package/dist-docs/assets/aberdeen/transitions.d.ts +0 -18
- package/dist-docs/assets/aberdeen/transitions.js +0 -47
- package/dist-docs/assets/aberdeen/transitions.js.map +0 -10
- package/dist-docs/assets/custom.js +0 -573
- package/dist-docs/assets/favicon.png +0 -0
- package/dist-docs/assets/hierarchy.js +0 -1
- package/dist-docs/assets/highlight.css +0 -134
- package/dist-docs/assets/icons.js +0 -18
- package/dist-docs/assets/icons.svg +0 -1
- package/dist-docs/assets/main.js +0 -60
- package/dist-docs/assets/navigation.js +0 -1
- package/dist-docs/assets/search.js +0 -1
- package/dist-docs/assets/style.css +0 -1640
- package/dist-docs/dispatcher/Dispatcher/index.html +0 -21
- package/dist-docs/dispatcher/MATCH_FAILED/index.html +0 -2
- package/dist-docs/dispatcher/MATCH_REST/index.html +0 -2
- package/dist-docs/dispatcher/index.html +0 -4
- package/dist-docs/hierarchy.html +0 -1
- package/dist-docs/index.html +0 -61
- package/dist-docs/media/CHANGELOG.md +0 -260
- package/dist-docs/modules.html +0 -1
- package/dist-docs/prediction/applyCanon/index.html +0 -13
- package/dist-docs/prediction/applyPrediction/index.html +0 -8
- package/dist-docs/prediction/index.html +0 -9
- package/dist-docs/route/Route/index.html +0 -23
- package/dist-docs/route/back/index.html +0 -4
- package/dist-docs/route/current/index.html +0 -2
- package/dist-docs/route/go/index.html +0 -14
- package/dist-docs/route/index.html +0 -15
- package/dist-docs/route/interceptLinks/index.html +0 -8
- package/dist-docs/route/matchCurrent/index.html +0 -10
- package/dist-docs/route/persistScroll/index.html +0 -6
- package/dist-docs/route/push/index.html +0 -6
- package/dist-docs/route/setLog/index.html +0 -3
- package/dist-docs/route/up/index.html +0 -5
- package/dist-docs/sitemap.xml +0 -239
- package/dist-docs/transitions/grow/index.html +0 -6
- package/dist-docs/transitions/index.html +0 -5
- package/dist-docs/transitions/shrink/index.html +0 -6
- package/skill/aberdeen.md +0 -4584
- package/skill/dispatcher.md +0 -129
- package/skill/prediction.md +0 -73
- package/skill/route.md +0 -322
- package/skill/transitions.md +0 -59
package/README.md
CHANGED
|
@@ -19,6 +19,7 @@ Aberdeen wraps your state in ES6 `Proxy` objects for fine-grained property acces
|
|
|
19
19
|
- SVG support
|
|
20
20
|
- Helper functions for transforming reactive data (mapping, partitioning, filtering, etc)
|
|
21
21
|
- Hide/unhide transition effects
|
|
22
|
+
- Developer tools
|
|
22
23
|
|
|
23
24
|
## Why *not* use Aberdeen?
|
|
24
25
|
|
|
@@ -178,6 +179,14 @@ mkdir -p .claude/skills
|
|
|
178
179
|
ln -s ../../node_modules/aberdeen/skill .claude/skills/aberdeen
|
|
179
180
|
```
|
|
180
181
|
|
|
182
|
+
## Developer tools
|
|
183
|
+
|
|
184
|
+
Aberdeen ships with an in-browser inspector for its reactive scope tree: see what (re)rendered, when, which proxy change triggered it, and the `file:line` in your code where each scope was created. Hold `Alt` and hover any element to jump to the scope that drew it.
|
|
185
|
+
|
|
186
|
+
Open it with **`Ctrl/Cmd+Alt+A`**, or by adding **`?abdev=1`** to the URL (which also captures the initial render). It lives in the development build of Aberdeen, selected automatically by the `development` export condition (e.g. by Vite's dev server), and is completely stripped from production bundles.
|
|
187
|
+
|
|
188
|
+

|
|
189
|
+
|
|
181
190
|
## Changelog
|
|
182
191
|
|
|
183
192
|
See [CHANGELOG.md](CHANGELOG.md) for a full history of changes.
|
package/dist/src/aberdeen.d.ts
CHANGED
|
@@ -30,6 +30,24 @@
|
|
|
30
30
|
* ```
|
|
31
31
|
*/
|
|
32
32
|
export declare function runQueue(): void;
|
|
33
|
+
/**
|
|
34
|
+
* Pause processing of reactive updates until the returned *thaw* function is called.
|
|
35
|
+
*
|
|
36
|
+
* While frozen, changes to observed data still accumulate, but no re-renders run. Freezes
|
|
37
|
+
* stack: if there are multiple outstanding freezes, redraws resume only once the last one is
|
|
38
|
+
* thawed. This is useful to batch an async burst of changes into a single update pass, or to
|
|
39
|
+
* hold the UI steady (e.g. the dev tools use it for "freeze redraws").
|
|
40
|
+
*
|
|
41
|
+
* @returns A function that releases this freeze. Calling it more than once has no effect.
|
|
42
|
+
*
|
|
43
|
+
* @example
|
|
44
|
+
* ```typescript
|
|
45
|
+
* const thaw = A.freeze();
|
|
46
|
+
* // ...make many changes without intermediate redraws...
|
|
47
|
+
* thaw(); // redraws run now (if no other freezes remain)
|
|
48
|
+
* ```
|
|
49
|
+
*/
|
|
50
|
+
export declare function freeze(): () => void;
|
|
33
51
|
/**
|
|
34
52
|
* Creates a new string that has the opposite sort order compared to the input string.
|
|
35
53
|
*
|
|
@@ -449,6 +467,8 @@ export declare function disableCreateDestroy(): void;
|
|
|
449
467
|
*
|
|
450
468
|
* Also, when the value is a string starting with `$`, it is treated as a reference to a CSS variable, expanding to `var(--variableName)`. For numeric variable names (which can't be used directly as CSS custom property names), Aberdeen prefixes them with `m`, so `$3` expands to `var(--m3)`. This is primarily intended for use with {@link setSpacingCssVars}, which initializes spacing variables named `0` through `12` with an exponential spacing scale.
|
|
451
469
|
*
|
|
470
|
+
* To *set* a CSS custom property inline on an element, use a `--name` or (symmetrically with the `$`-reference syntax above) a `$name` key. For example `A('div --primary:red')` and `A('div $primary:red')` both set `--primary` to `red`.
|
|
471
|
+
*
|
|
452
472
|
* @returns The most inner DOM element that was created (not counting text nodes nor elements created by content functions), or the current element if no new element was created. You should normally not need to use the return value - use this function's DOM manipulation abilities instead. One valid use case is when integrating with non-Aberdeen code that requires a reference to a DOM element.
|
|
453
473
|
*
|
|
454
474
|
* @example Create Element
|
|
@@ -527,6 +547,10 @@ export declare function A(...args: any[]): undefined | Element;
|
|
|
527
547
|
*
|
|
528
548
|
* Supports the same CSS shortcuts as {@link A | A} and CSS variable references with `$` (e.g., `$primary`, `$3`).
|
|
529
549
|
*
|
|
550
|
+
* CSS is inserted into the <head> in an order relative to other insert(Global)Css items that is consistent
|
|
551
|
+
* based on when the containing Aberdeen scope was first defined. This allows changing styles without changing
|
|
552
|
+
* order-based precedence.
|
|
553
|
+
*
|
|
530
554
|
* @param style - A concise style string or a style object.
|
|
531
555
|
* @returns The unique class name prefix used for scoping (e.g., `.AbdStl1`).
|
|
532
556
|
* Use this prefix with {@link A | A} to apply the styles.
|
|
@@ -586,6 +610,10 @@ export declare function insertCss(style: string | object): string;
|
|
|
586
610
|
*
|
|
587
611
|
* @param style - Object with selectors as keys and concise CSS strings as values.
|
|
588
612
|
*
|
|
613
|
+
* CSS is inserted into the <head> in an order relative to other insert(Global)Css items that is consistent
|
|
614
|
+
* based on when the containing Aberdeen scope was first defined. This allows changing styles without changing
|
|
615
|
+
* order-based precedence.
|
|
616
|
+
*
|
|
589
617
|
* @example Global Reset and Base Styles
|
|
590
618
|
* ```typescript
|
|
591
619
|
* // Set up global styles using CSS shortcuts
|
|
@@ -937,6 +965,7 @@ declare const _default: typeof A & {
|
|
|
937
965
|
/** {@inheritDoc derive} */ derive: typeof derive;
|
|
938
966
|
/** {@inheritDoc disableCreateDestroy} */ disableCreateDestroy: typeof disableCreateDestroy;
|
|
939
967
|
/** {@inheritDoc dump} */ dump: typeof dump;
|
|
968
|
+
/** {@inheritDoc freeze} */ freeze: typeof freeze;
|
|
940
969
|
/** {@inheritDoc insertCss} */ insertCss: typeof insertCss;
|
|
941
970
|
/** {@inheritDoc insertGlobalCss} */ insertGlobalCss: typeof insertGlobalCss;
|
|
942
971
|
/** {@inheritDoc invertString} */ invertString: typeof invertString;
|