aberdeen 1.12.1 → 1.13.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 (74) hide show
  1. package/dist/src/aberdeen.d.ts +19 -4
  2. package/dist/src/aberdeen.js +13 -10
  3. package/dist/src/aberdeen.js.map +3 -3
  4. package/dist-docs/Tutorial/index.html +2 -2
  5. package/dist-docs/aberdeen/A/index.html +2 -2
  6. package/dist-docs/aberdeen/NO_COPY/index.html +2 -4
  7. package/dist-docs/aberdeen/OPAQUE/index.html +12 -0
  8. package/dist-docs/aberdeen/PromiseProxy/index.html +5 -5
  9. package/dist-docs/aberdeen/clean/index.html +2 -2
  10. package/dist-docs/aberdeen/clone/index.html +2 -2
  11. package/dist-docs/aberdeen/copy/index.html +3 -3
  12. package/dist-docs/aberdeen/count/index.html +2 -2
  13. package/dist-docs/aberdeen/cssVars/index.html +2 -2
  14. package/dist-docs/aberdeen/darkMode/index.html +2 -2
  15. package/dist-docs/aberdeen/default/index.html +14 -5
  16. package/dist-docs/aberdeen/derive/index.html +2 -2
  17. package/dist-docs/aberdeen/disableCreateDestroy/index.html +2 -2
  18. package/dist-docs/aberdeen/dump/index.html +2 -2
  19. package/dist-docs/aberdeen/index.html +4 -5
  20. package/dist-docs/aberdeen/insertCss/index.html +2 -2
  21. package/dist-docs/aberdeen/insertGlobalCss/index.html +2 -2
  22. package/dist-docs/aberdeen/invertString/index.html +2 -2
  23. package/dist-docs/aberdeen/isEmpty/index.html +2 -2
  24. package/dist-docs/aberdeen/map/index.html +4 -4
  25. package/dist-docs/aberdeen/merge/index.html +3 -3
  26. package/dist-docs/aberdeen/mount/index.html +2 -2
  27. package/dist-docs/aberdeen/multiMap/index.html +4 -4
  28. package/dist-docs/aberdeen/onEach/index.html +2 -2
  29. package/dist-docs/aberdeen/partition/index.html +4 -4
  30. package/dist-docs/aberdeen/peek/index.html +5 -5
  31. package/dist-docs/aberdeen/proxy/index.html +2 -2
  32. package/dist-docs/aberdeen/ref/index.html +2 -2
  33. package/dist-docs/aberdeen/runQueue/index.html +2 -2
  34. package/dist-docs/aberdeen/setErrorHandler/index.html +2 -2
  35. package/dist-docs/aberdeen/setSpacingCssVars/index.html +2 -2
  36. package/dist-docs/aberdeen/unmountAll/index.html +2 -2
  37. package/dist-docs/aberdeen/unproxy/index.html +2 -2
  38. package/dist-docs/assets/aberdeen/aberdeen.d.ts +19 -4
  39. package/dist-docs/assets/aberdeen/aberdeen.js +13 -10
  40. package/dist-docs/assets/aberdeen/aberdeen.js.map +3 -3
  41. package/dist-docs/assets/navigation.js +1 -1
  42. package/dist-docs/assets/search.js +1 -1
  43. package/dist-docs/dispatcher/Dispatcher/index.html +4 -4
  44. package/dist-docs/dispatcher/MATCH_FAILED/index.html +2 -2
  45. package/dist-docs/dispatcher/MATCH_REST/index.html +2 -2
  46. package/dist-docs/dispatcher/index.html +2 -2
  47. package/dist-docs/hierarchy.html +1 -1
  48. package/dist-docs/index.html +2 -2
  49. package/dist-docs/media/CHANGELOG.md +6 -0
  50. package/dist-docs/modules.html +1 -1
  51. package/dist-docs/prediction/applyCanon/index.html +2 -2
  52. package/dist-docs/prediction/applyPrediction/index.html +2 -2
  53. package/dist-docs/prediction/index.html +2 -2
  54. package/dist-docs/route/Route/index.html +9 -9
  55. package/dist-docs/route/back/index.html +2 -2
  56. package/dist-docs/route/current/index.html +2 -2
  57. package/dist-docs/route/go/index.html +2 -2
  58. package/dist-docs/route/index.html +2 -2
  59. package/dist-docs/route/interceptLinks/index.html +2 -2
  60. package/dist-docs/route/persistScroll/index.html +2 -2
  61. package/dist-docs/route/push/index.html +2 -2
  62. package/dist-docs/route/setLog/index.html +2 -2
  63. package/dist-docs/route/up/index.html +2 -2
  64. package/dist-docs/sitemap.xml +60 -56
  65. package/dist-docs/transitions/grow/index.html +2 -2
  66. package/dist-docs/transitions/index.html +2 -2
  67. package/dist-docs/transitions/shrink/index.html +2 -2
  68. package/package.json +1 -1
  69. package/skill/aberdeen.md +94 -60
  70. package/skill/dispatcher.md +6 -6
  71. package/skill/prediction.md +3 -3
  72. package/skill/route.md +17 -17
  73. package/skill/transitions.md +3 -3
  74. package/src/aberdeen.ts +29 -13
@@ -237,11 +237,25 @@ export declare function copy<T extends object>(dst: T, dstKey: keyof T, src: T[t
237
237
  export declare function merge<T extends object>(dst: T, value: Partial<T>): boolean;
238
238
  export declare function merge<T extends object>(dst: T, dstKey: keyof T, value: Partial<T[typeof dstKey]>): boolean;
239
239
  /**
240
- * A symbol that can be added to an object to prevent it from being cloned by {@link clone} or {@link copy}.
241
- * This is useful for objects that should be shared by reference. That also mean that their contents won't
242
- * be observed for changes.
240
+ * A symbol that controls how Aberdeen handles an object in copy operations and proxy wrapping.
241
+ *
242
+ * The **presence** of this symbol (regardless of its value) prevents deep-copying: the object is
243
+ * stored and passed by reference in {@link clone} and {@link copy}.
244
+ *
245
+ * The **value** of the symbol controls proxy wrapping when the object is read from reactive state:
246
+ * - **Truthy** (e.g. `true`): the object is fully opaque — it is not wrapped in a proxy, so its
247
+ * properties are not observable. Use this for objects that break when proxied (e.g. class instances
248
+ * with internal slots, Promises) or that must be invisible to Aberdeen's reactive system.
249
+ * - **Falsy** (e.g. `false`): the object is still wrapped in a proxy, so reads on its properties
250
+ * create reactive dependencies as normal — only deep-copying is suppressed.
251
+ */
252
+ export declare const OPAQUE: unique symbol;
253
+ /**
254
+ * Use {@link OPAQUE} instead. This is an alias kept for backward compatibility.
255
+ *
256
+ * @deprecated
243
257
  */
244
- export declare const NO_COPY: unique symbol;
258
+ export declare const NO_COPY: symbol;
245
259
  /**
246
260
  * A reactive object containing CSS variable definitions.
247
261
  *
@@ -916,6 +930,7 @@ declare const _default: typeof A & {
916
930
  /** {@inheritDoc merge} */ merge: typeof merge;
917
931
  /** {@inheritDoc mount} */ mount: typeof mount;
918
932
  /** {@inheritDoc multiMap} */ multiMap: typeof multiMap;
933
+ /** {@inheritDoc OPAQUE} */ OPAQUE: symbol;
919
934
  /** {@inheritDoc NO_COPY} */ NO_COPY: symbol;
920
935
  /** {@inheritDoc onEach} */ onEach: typeof onEach;
921
936
  /** {@inheritDoc partition} */ partition: typeof partition;
@@ -981,7 +981,7 @@ var setHandler = {
981
981
  };
982
982
  var proxyMap = new WeakMap;
983
983
  function optProxy(value) {
984
- if (typeof value !== "object" || !value || value[TARGET_SYMBOL] !== undefined || NO_COPY in value) {
984
+ if (typeof value !== "object" || !value || value[TARGET_SYMBOL] !== undefined || value[OPAQUE]) {
985
985
  return value;
986
986
  }
987
987
  let proxied = proxyMap.get(value);
@@ -1083,7 +1083,7 @@ function copyRecursive(dst, src, flags) {
1083
1083
  changed = true;
1084
1084
  } else if (dstValue !== srcValue) {
1085
1085
  if (typeof srcValue === "object" && srcValue !== null) {
1086
- if (typeof dstValue === "object" && dstValue !== null && srcValue.constructor === dstValue.constructor && !(NO_COPY in srcValue)) {
1086
+ if (typeof dstValue === "object" && dstValue !== null && srcValue.constructor === dstValue.constructor && !(OPAQUE in srcValue)) {
1087
1087
  changed = copyRecursive(dstValue, srcValue, flags) || changed;
1088
1088
  continue;
1089
1089
  }
@@ -1117,7 +1117,7 @@ function copyRecursive(dst, src, flags) {
1117
1117
  dstValue = EMPTY;
1118
1118
  if (dstValue !== srcValue) {
1119
1119
  if (typeof srcValue === "object" && srcValue !== null) {
1120
- if (typeof dstValue === "object" && dstValue !== null && srcValue.constructor === dstValue.constructor && !(NO_COPY in srcValue)) {
1120
+ if (typeof dstValue === "object" && dstValue !== null && srcValue.constructor === dstValue.constructor && !(OPAQUE in srcValue)) {
1121
1121
  changed = copyRecursive(dstValue, srcValue, flags) || changed;
1122
1122
  continue;
1123
1123
  }
@@ -1147,7 +1147,7 @@ function copyRecursive(dst, src, flags) {
1147
1147
  const dstValue = dst.hasOwnProperty(key) ? dst[key] : EMPTY;
1148
1148
  if (dstValue !== srcValue) {
1149
1149
  if (typeof srcValue === "object" && srcValue !== null) {
1150
- if (typeof dstValue === "object" && dstValue !== null && srcValue.constructor === dstValue.constructor && !(NO_COPY in srcValue)) {
1150
+ if (typeof dstValue === "object" && dstValue !== null && srcValue.constructor === dstValue.constructor && !(OPAQUE in srcValue)) {
1151
1151
  changed = copyRecursive(dstValue, srcValue, flags) || changed;
1152
1152
  continue;
1153
1153
  }
@@ -1179,8 +1179,9 @@ function copyRecursive(dst, src, flags) {
1179
1179
  var MERGE = 1;
1180
1180
  var COPY_SUBSCRIBE = 32;
1181
1181
  var COPY_EMIT = 64;
1182
- var NO_COPY = Symbol("NO_COPY");
1183
- Promise.prototype[NO_COPY] = true;
1182
+ var OPAQUE = Symbol("OPAQUE");
1183
+ var NO_COPY = OPAQUE;
1184
+ Promise.prototype[OPAQUE] = true;
1184
1185
  var cssVars = optProxy({});
1185
1186
  function setSpacingCssVars(base = 1, unit = "rem") {
1186
1187
  for (let i = 0;i <= 12; i++) {
@@ -1211,7 +1212,7 @@ function darkMode() {
1211
1212
  return darkModeState.value;
1212
1213
  }
1213
1214
  function cloneRecursive(src, flags) {
1214
- if (NO_COPY in src)
1215
+ if (OPAQUE in src)
1215
1216
  return src;
1216
1217
  if (flags & COPY_SUBSCRIBE)
1217
1218
  subscribe(src, ANY_SYMBOL);
@@ -1735,8 +1736,8 @@ function dump(data) {
1735
1736
  if (data && typeof data === "object") {
1736
1737
  const name = data.constructor.name.toLowerCase() || "unknown object";
1737
1738
  A(`#<${name}>`);
1738
- if (NO_COPY in data) {
1739
- A("# [NO_COPY]");
1739
+ if (OPAQUE in data) {
1740
+ A("# [OPAQUE]");
1740
1741
  } else {
1741
1742
  A("ul", () => {
1742
1743
  onEach(data, (value, key) => {
@@ -1821,6 +1822,7 @@ var aberdeen_default = Object.assign(A, {
1821
1822
  merge,
1822
1823
  mount,
1823
1824
  multiMap,
1825
+ OPAQUE,
1824
1826
  NO_COPY,
1825
1827
  onEach,
1826
1828
  partition,
@@ -1865,11 +1867,12 @@ export {
1865
1867
  copy,
1866
1868
  clone,
1867
1869
  clean,
1870
+ OPAQUE,
1868
1871
  NO_COPY,
1869
1872
  MAP_SIZE_SYMBOL,
1870
1873
  EMPTY,
1871
1874
  A
1872
1875
  };
1873
1876
 
1874
- //# debugId=C25FF24CC098C9BC64756E2164756E21
1877
+ //# debugId=B5E9F155214345E564756E2164756E21
1875
1878
  //# sourceMappingURL=aberdeen.js.map