@custardui/custardui 1.0.0 → 2.0.1-beta.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 (66) hide show
  1. package/dist/custardui.js +2630 -901
  2. package/dist/custardui.js.map +1 -1
  3. package/dist/custardui.min.js +2 -2
  4. package/dist/custardui.min.js.map +1 -1
  5. package/dist/types/src/lib/app/types.d.ts +36 -0
  6. package/dist/types/src/lib/app/types.d.ts.map +1 -0
  7. package/dist/types/src/lib/app/ui-manager.d.ts +2 -35
  8. package/dist/types/src/lib/app/ui-manager.d.ts.map +1 -1
  9. package/dist/types/src/lib/features/adaptation/adaptation-manager.d.ts +1 -1
  10. package/dist/types/src/lib/features/adaptation/adaptation-manager.d.ts.map +1 -1
  11. package/dist/types/src/lib/features/anchor/descriptor.d.ts +6 -0
  12. package/dist/types/src/lib/features/anchor/descriptor.d.ts.map +1 -0
  13. package/dist/types/src/lib/features/anchor/index.d.ts +5 -0
  14. package/dist/types/src/lib/features/anchor/index.d.ts.map +1 -0
  15. package/dist/types/src/lib/features/anchor/resolver.d.ts +8 -0
  16. package/dist/types/src/lib/features/anchor/resolver.d.ts.map +1 -0
  17. package/dist/types/src/lib/features/anchor/serializer.d.ts +21 -0
  18. package/dist/types/src/lib/features/anchor/serializer.d.ts.map +1 -0
  19. package/dist/types/src/lib/features/anchor/stable-text.d.ts +41 -0
  20. package/dist/types/src/lib/features/anchor/stable-text.d.ts.map +1 -0
  21. package/dist/types/src/lib/features/anchor/types.d.ts +17 -0
  22. package/dist/types/src/lib/features/anchor/types.d.ts.map +1 -0
  23. package/dist/types/src/lib/features/focus/services/focus-service.svelte.d.ts +2 -2
  24. package/dist/types/src/lib/features/focus/services/focus-service.svelte.d.ts.map +1 -1
  25. package/dist/types/src/lib/features/highlight/highlight-logic.d.ts +6 -1
  26. package/dist/types/src/lib/features/highlight/highlight-logic.d.ts.map +1 -1
  27. package/dist/types/src/lib/features/highlight/services/highlight-annotations.d.ts +10 -0
  28. package/dist/types/src/lib/features/highlight/services/highlight-annotations.d.ts.map +1 -0
  29. package/dist/types/src/lib/features/highlight/services/highlight-colors.d.ts +24 -0
  30. package/dist/types/src/lib/features/highlight/services/highlight-colors.d.ts.map +1 -0
  31. package/dist/types/src/lib/features/highlight/services/highlight-service.svelte.d.ts +6 -1
  32. package/dist/types/src/lib/features/highlight/services/highlight-service.svelte.d.ts.map +1 -1
  33. package/dist/types/src/lib/features/highlight/services/highlight-types.d.ts +5 -0
  34. package/dist/types/src/lib/features/highlight/services/highlight-types.d.ts.map +1 -1
  35. package/dist/types/src/lib/features/placeholder/placeholder-binder.d.ts +13 -1
  36. package/dist/types/src/lib/features/placeholder/placeholder-binder.d.ts.map +1 -1
  37. package/dist/types/src/lib/features/placeholder/placeholder-manager.d.ts +6 -0
  38. package/dist/types/src/lib/features/placeholder/placeholder-manager.d.ts.map +1 -1
  39. package/dist/types/src/lib/features/placeholder/types.d.ts +6 -0
  40. package/dist/types/src/lib/features/placeholder/types.d.ts.map +1 -1
  41. package/dist/types/src/lib/features/settings/intro-manager.svelte.d.ts +3 -6
  42. package/dist/types/src/lib/features/settings/intro-manager.svelte.d.ts.map +1 -1
  43. package/dist/types/src/lib/features/settings/stores/icon-settings-store.svelte.d.ts +18 -0
  44. package/dist/types/src/lib/features/settings/stores/icon-settings-store.svelte.d.ts.map +1 -0
  45. package/dist/types/src/lib/features/settings/types.d.ts +1 -1
  46. package/dist/types/src/lib/features/settings/types.d.ts.map +1 -1
  47. package/dist/types/src/lib/features/share/stores/share-store.svelte.d.ts +12 -1
  48. package/dist/types/src/lib/features/share/stores/share-store.svelte.d.ts.map +1 -1
  49. package/dist/types/src/lib/features/url/url-state-manager.d.ts.map +1 -1
  50. package/dist/types/src/lib/runtime.svelte.d.ts +4 -6
  51. package/dist/types/src/lib/runtime.svelte.d.ts.map +1 -1
  52. package/dist/types/src/lib/stores/active-state-store.svelte.d.ts +16 -7
  53. package/dist/types/src/lib/stores/active-state-store.svelte.d.ts.map +1 -1
  54. package/dist/types/src/lib/stores/derived-store.svelte.d.ts +1 -0
  55. package/dist/types/src/lib/stores/derived-store.svelte.d.ts.map +1 -1
  56. package/dist/types/src/lib/utils/scroll-utils.d.ts +41 -15
  57. package/dist/types/src/lib/utils/scroll-utils.d.ts.map +1 -1
  58. package/dist/types/tests/lib/features/anchor/anchor.test.d.ts +2 -0
  59. package/dist/types/tests/lib/features/anchor/anchor.test.d.ts.map +1 -0
  60. package/dist/types/tests/lib/features/settings/stores/icon-settings-store.test.d.ts +2 -0
  61. package/dist/types/tests/lib/features/settings/stores/icon-settings-store.test.d.ts.map +1 -0
  62. package/package.json +2 -2
  63. package/dist/types/src/lib/utils/dom-element-locator.d.ts +0 -30
  64. package/dist/types/src/lib/utils/dom-element-locator.d.ts.map +0 -1
  65. package/dist/types/tests/lib/utils/dom-element-locator.test.d.ts +0 -2
  66. package/dist/types/tests/lib/utils/dom-element-locator.test.d.ts.map +0 -1
@@ -1,6 +1,8 @@
1
1
  import type { ConfigFile } from '$lib/types/index';
2
2
  import type { AssetsManager } from '$features/render/assets';
3
3
  import type { AdaptationConfig } from '$features/adaptation/types';
4
+ import { PersistenceManager } from './utils/persistence';
5
+ import { IconSettingsStore } from '$features/settings/stores/icon-settings-store.svelte';
4
6
  export interface RuntimeOptions {
5
7
  assetsManager: AssetsManager;
6
8
  configFile: ConfigFile;
@@ -15,8 +17,9 @@ export interface RuntimeOptions {
15
17
  */
16
18
  export declare class AppRuntime {
17
19
  private rootEl;
18
- private persistenceManager;
20
+ persistenceManager: PersistenceManager;
19
21
  private focusService;
22
+ iconSettingsStore: IconSettingsStore;
20
23
  private observer?;
21
24
  private destroyEffectRoot?;
22
25
  private onHashChange?;
@@ -63,11 +66,6 @@ export declare class AppRuntime {
63
66
  */
64
67
  private handleForPlaceholders;
65
68
  resetToDefault(): void;
66
- getIconPosition(): number | null;
67
- saveIconPosition(offset: number): void;
68
- clearIconPosition(): void;
69
- isIntroSeen(): boolean;
70
- markIntroSeen(): void;
71
69
  destroy(): void;
72
70
  }
73
71
  //# sourceMappingURL=runtime.svelte.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"runtime.svelte.d.ts","sourceRoot":"","sources":["../../../../src/lib/runtime.svelte.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AACnD,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,yBAAyB,CAAC;AAC7D,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,4BAA4B,CAAC;AAenE,MAAM,WAAW,cAAc;IAC7B,aAAa,EAAE,aAAa,CAAC;IAC7B,UAAU,EAAE,UAAU,CAAC;IACvB,MAAM,CAAC,EAAE,WAAW,GAAG,SAAS,CAAC;IACjC,UAAU,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IAChC,gBAAgB,CAAC,EAAE,gBAAgB,GAAG,IAAI,CAAC;CAC5C;AAED;;;;GAIG;AACH,qBAAa,UAAU;IACrB,OAAO,CAAC,MAAM,CAAc;IAC5B,OAAO,CAAC,kBAAkB,CAAqB;IAC/C,OAAO,CAAC,YAAY,CAAe;IAEnC,OAAO,CAAC,QAAQ,CAAC,CAAmB;IACpC,OAAO,CAAC,iBAAiB,CAAC,CAAa;IACvC,OAAO,CAAC,YAAY,CAAC,CAAa;gBAEtB,GAAG,EAAE,cAAc;IAuB/B;;;OAGG;IACH,OAAO,CAAC,UAAU;IAsBlB;;;;;;;;;;OAUG;IACH,OAAO,CAAC,mBAAmB;IA0B3B;;;;;OAKG;IACI,KAAK;IAQZ;;OAEG;IACH,OAAO,CAAC,OAAO;IAMf;;OAEG;IACH,OAAO,CAAC,qBAAqB;IA0B7B;;;OAGG;IACH,OAAO,CAAC,sBAAsB;IAY9B;;OAEG;IACH,OAAO,CAAC,qBAAqB;IA6BtB,cAAc;IASd,eAAe,IAAI,MAAM,GAAG,IAAI;IAKhC,gBAAgB,CAAC,MAAM,EAAE,MAAM,GAAG,IAAI;IAItC,iBAAiB,IAAI,IAAI;IAMzB,WAAW,IAAI,OAAO;IAItB,aAAa,IAAI,IAAI;IAIrB,OAAO;CAQf"}
1
+ {"version":3,"file":"runtime.svelte.d.ts","sourceRoot":"","sources":["../../../../src/lib/runtime.svelte.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAS,MAAM,kBAAkB,CAAC;AAC1D,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,yBAAyB,CAAC;AAC7D,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,4BAA4B,CAAC;AAEnE,OAAO,EAAE,kBAAkB,EAAE,MAAM,qBAAqB,CAAC;AACzD,OAAO,EAAE,iBAAiB,EAAE,MAAM,sDAAsD,CAAC;AA4BzF,MAAM,WAAW,cAAc;IAC7B,aAAa,EAAE,aAAa,CAAC;IAC7B,UAAU,EAAE,UAAU,CAAC;IACvB,MAAM,CAAC,EAAE,WAAW,GAAG,SAAS,CAAC;IACjC,UAAU,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IAChC,gBAAgB,CAAC,EAAE,gBAAgB,GAAG,IAAI,CAAC;CAC5C;AAED;;;;GAIG;AACH,qBAAa,UAAU;IACrB,OAAO,CAAC,MAAM,CAAc;IACrB,kBAAkB,EAAE,kBAAkB,CAAC;IAC9C,OAAO,CAAC,YAAY,CAAe;IAC5B,iBAAiB,EAAE,iBAAiB,CAAC;IAE5C,OAAO,CAAC,QAAQ,CAAC,CAAmB;IACpC,OAAO,CAAC,iBAAiB,CAAC,CAAa;IACvC,OAAO,CAAC,YAAY,CAAC,CAAa;gBAEtB,GAAG,EAAE,cAAc;IAwB/B;;;OAGG;IACH,OAAO,CAAC,UAAU;IAsBlB;;;;;;;;;;OAUG;IACH,OAAO,CAAC,mBAAmB;IA0B3B;;;;;OAKG;IACI,KAAK;IAQZ;;OAEG;IACH,OAAO,CAAC,OAAO;IAMf;;OAEG;IACH,OAAO,CAAC,qBAAqB;IA0B7B;;;OAGG;IACH,OAAO,CAAC,sBAAsB;IAY9B;;OAEG;IACH,OAAO,CAAC,qBAAqB;IA6BtB,cAAc;IAWd,OAAO;CAQf"}
@@ -18,7 +18,7 @@ export declare class ActiveStateStore {
18
18
  configSectionOrder: ("toggles" | "tabGroups" | "placeholders")[];
19
19
  /**
20
20
  * Mutable application state representing user choices.
21
- * Use actions like `setPinnedTab` or `setToggles` to modify this.
21
+ * Use actions like `setMarkedTab` or `setToggles` to modify this.
22
22
  */
23
23
  state: State;
24
24
  constructor(initialConfig?: Config);
@@ -27,18 +27,25 @@ export declare class ActiveStateStore {
27
27
  */
28
28
  init(config: Config): void;
29
29
  /**
30
- * Set the pinned tab for a specific tab group.
30
+ * Set the marked tab for a specific tab group.
31
31
  * This syncs across all tab groups with the same ID.
32
32
  * @param groupId The ID of the tab group.
33
- * @param tabId The ID of the tab to pin.
33
+ * @param tabId The ID of the tab to mark.
34
34
  */
35
- setPinnedTab(groupId: string, tabId: string): void;
35
+ setMarkedTab(groupId: string, tabId: string): void;
36
36
  /**
37
37
  * Update the visibility of toggles.
38
38
  * @param shown List of IDs for toggles in "Show" state.
39
39
  * @param peek List of IDs for toggles in "Peek" state.
40
40
  */
41
41
  setToggles(shown: string[], peek: string[]): void;
42
+ /**
43
+ * Update the visibility state of a specific toggle.
44
+ * Handled internally so UI components (like Modal) don't need to mutate arrays directly.
45
+ * @param toggleId The ID of the toggle.
46
+ * @param value The new visibility state.
47
+ */
48
+ updateToggleState(toggleId: string, value: 'show' | 'hide' | 'peek'): void;
42
49
  /**
43
50
  * Set a specific placeholder value.
44
51
  * @param key The ID/name of the placeholder.
@@ -49,9 +56,11 @@ export declare class ActiveStateStore {
49
56
  * Replaces the full application state (e.g. from persistence).
50
57
  *
51
58
  * Precedence model:
52
- * 1. Start from computed defaults (config-driven).
53
- * 2. Layer in the incoming `newState`, sanitizing tabs and placeholders.
54
- * 3. Sync any tab-group-derived placeholders that weren't explicitly set.
59
+ * 1. Start from computed defaults for toggles and tabs.
60
+ * 2. Layer in the incoming `newState`, sanitizing toggles, tabs, and user-settable placeholders.
61
+ * 3. For placeholders, use the CURRENT state as the base (preserving adaptation defaults)
62
+ * and merge user-persisted values on top.
63
+ * 4. Sync any tab-group-derived placeholders that weren't explicitly set.
55
64
  *
56
65
  * @param newState The persisted state to restore.
57
66
  */
@@ -1 +1 @@
1
- {"version":3,"file":"active-state-store.svelte.d.ts","sourceRoot":"","sources":["../../../../../src/lib/stores/active-state-store.svelte.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,MAAM,EAAoB,KAAK,EAAgB,MAAM,kBAAkB,CAAC;AAEtF,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,4BAA4B,CAAC;AAEnE;;;;;;GAMG;AACH,qBAAa,gBAAgB;IAC3B;;OAEG;IACH,MAAM,SAAsB;IAE5B;;OAEG;IACH,kBAAkB,+CAAkC;IAEpD;;;OAGG;IACH,KAAK,QAKF;gBAES,aAAa,GAAE,MAAW;IAQtC;;OAEG;IACH,IAAI,CAAC,MAAM,EAAE,MAAM;IAiBnB;;;;;OAKG;IACH,YAAY,CAAC,OAAO,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM;IAU3C;;;;OAIG;IACH,UAAU,CAAC,KAAK,EAAE,MAAM,EAAE,EAAE,IAAI,EAAE,MAAM,EAAE;IAK1C;;;;OAIG;IACH,cAAc,CAAC,GAAG,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM;IAOzC;;;;;;;;;OASG;IACH,UAAU,CAAC,QAAQ,EAAE,KAAK;IAmB1B;;;;;;;;;;;;;OAaG;IACH,sBAAsB,CAAC,UAAU,EAAE,KAAK;IAMxC;;;;;OAKG;IACH,uBAAuB,CAAC,QAAQ,EAAE,gBAAgB,CAAC,UAAU,CAAC,GAAG,IAAI;IAcrE;;OAEG;IACH,KAAK;IAKE,mBAAmB,IAAI,KAAK;IAqDnC;;;;OAIG;IACH,OAAO,CAAC,yBAAyB;IAIjC;;;;OAIG;IACH,OAAO,CAAC,cAAc;IAwBtB;;;;OAIG;IACH,OAAO,CAAC,gBAAgB;IAqBxB;;;;;OAKG;IACH,OAAO,CAAC,cAAc;IAWtB;;;;OAIG;IACH,OAAO,CAAC,sBAAsB;IAO9B;;;;;;;OAOG;IACH,OAAO,CAAC,eAAe;IAsBvB;;;OAGG;IACH,OAAO,CAAC,kBAAkB;IAsB1B;;;;;;;;;OASG;IACH,OAAO,CAAC,wBAAwB;CAwBjC;AAED,eAAO,MAAM,gBAAgB,kBAAyB,CAAC"}
1
+ {"version":3,"file":"active-state-store.svelte.d.ts","sourceRoot":"","sources":["../../../../../src/lib/stores/active-state-store.svelte.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,MAAM,EAAoB,KAAK,EAAgB,MAAM,kBAAkB,CAAC;AAEtF,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,4BAA4B,CAAC;AAEnE;;;;;;GAMG;AACH,qBAAa,gBAAgB;IAC3B;;OAEG;IACH,MAAM,SAAsB;IAE5B;;OAEG;IACH,kBAAkB,+CAAkC;IAEpD;;;OAGG;IACH,KAAK,QAKF;gBAES,aAAa,GAAE,MAAW;IAQtC;;OAEG;IACH,IAAI,CAAC,MAAM,EAAE,MAAM;IAiBnB;;;;;OAKG;IACH,YAAY,CAAC,OAAO,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM;IAU3C;;;;OAIG;IACH,UAAU,CAAC,KAAK,EAAE,MAAM,EAAE,EAAE,IAAI,EAAE,MAAM,EAAE;IAK1C;;;;;OAKG;IACH,iBAAiB,CAAC,QAAQ,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,GAAG,MAAM,GAAG,MAAM;IAanE;;;;OAIG;IACH,cAAc,CAAC,GAAG,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM;IAOzC;;;;;;;;;;;OAWG;IACH,UAAU,CAAC,QAAQ,EAAE,KAAK;IAqB1B;;;;;;;;;;;;;OAaG;IACH,sBAAsB,CAAC,UAAU,EAAE,KAAK;IAMxC;;;;;OAKG;IACH,uBAAuB,CAAC,QAAQ,EAAE,gBAAgB,CAAC,UAAU,CAAC,GAAG,IAAI;IAcrE;;OAEG;IACH,KAAK;IAKE,mBAAmB,IAAI,KAAK;IAuDnC;;;;OAIG;IACH,OAAO,CAAC,yBAAyB;IAIjC;;;;OAIG;IACH,OAAO,CAAC,cAAc;IAwBtB;;;;OAIG;IACH,OAAO,CAAC,gBAAgB;IAqBxB;;;;;OAKG;IACH,OAAO,CAAC,cAAc;IAWtB;;;;OAIG;IACH,OAAO,CAAC,sBAAsB;IAO9B;;;;;;;OAOG;IACH,OAAO,CAAC,eAAe;IAsBvB;;;OAGG;IACH,OAAO,CAAC,kBAAkB;IAsB1B;;;;;;;;;OASG;IACH,OAAO,CAAC,wBAAwB;CAwBjC;AAED,eAAO,MAAM,gBAAgB,kBAAyB,CAAC"}
@@ -7,6 +7,7 @@ declare class DerivedStateStore {
7
7
  assetsManager: AssetsManager | undefined;
8
8
  menuToggles: import("../types").ToggleConfig[];
9
9
  menuTabGroups: import("../types").TabGroupConfig[];
10
+ hiddenToggleIds: string[];
10
11
  hasVisiblePlaceholders: boolean;
11
12
  hasMenuOptions: boolean;
12
13
  setAssetsManager(manager: AssetsManager): void;
@@ -1 +1 @@
1
- {"version":3,"file":"derived-store.svelte.d.ts","sourceRoot":"","sources":["../../../../../src/lib/stores/derived-store.svelte.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,yBAAyB,CAAC;AAK7D;;;GAGG;AACH,cAAM,iBAAiB;IACrB,aAAa,4BAAgD;IAI7D,WAAW,oCAKR;IAEH,aAAa,sCAKV;IAEH,sBAAsB,UAQnB;IAEH,cAAc,UAIZ;IAEF,gBAAgB,CAAC,OAAO,EAAE,aAAa;CAGxC;AAED,eAAO,MAAM,YAAY,mBAA0B,CAAC"}
1
+ {"version":3,"file":"derived-store.svelte.d.ts","sourceRoot":"","sources":["../../../../../src/lib/stores/derived-store.svelte.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,yBAAyB,CAAC;AAK7D;;;GAGG;AACH,cAAM,iBAAiB;IACrB,aAAa,4BAAgD;IAI7D,WAAW,oCAKR;IAEH,aAAa,sCAKV;IAEH,eAAe,WAMZ;IAEH,sBAAsB,UAQnB;IAEH,cAAc,UAIZ;IAEF,gBAAgB,CAAC,OAAO,EAAE,aAAa;CAGxC;AAED,eAAO,MAAM,YAAY,mBAA0B,CAAC"}
@@ -1,27 +1,53 @@
1
+ /**
2
+ * A captured scroll anchor — a snapshot of an element's viewport position before
3
+ * a layout-shifting operation. Pass to `restoreScrollAnchor` afterwards to compensate.
4
+ */
5
+ export interface ScrollAnchor {
6
+ element: HTMLElement;
7
+ /** The element's `getBoundingClientRect().top` at capture time. */
8
+ top: number;
9
+ }
10
+ /**
11
+ * Captures the current viewport-relative position of a given element.
12
+ * Call this *before* a layout-shifting operation, then pass the result to `restoreScrollAnchor`.
13
+ *
14
+ * @param element The element to anchor to.
15
+ * @returns A `ScrollAnchor` snapshot.
16
+ */
17
+ export declare function captureScrollAnchor(element: HTMLElement): ScrollAnchor;
1
18
  /**
2
19
  * Calculates the total height of fixed or sticky elements at the top of the viewport.
3
- * This includes the standard site header and any custom elements marked with [data-cv-scroll-offset].
4
- * Used to offset scroll positions so content isn't hidden behind these fixed elements.
20
+ * This includes the standard site header and any custom elements marked with
21
+ * `[data-cv-scroll-offset]`. Used to offset scroll positions so content isn't
22
+ * hidden behind these fixed elements.
5
23
  */
6
24
  export declare function getScrollTopOffset(): number;
7
25
  /**
8
- * Finds the highest element matching the selector that is currently in the viewport.
9
- * @param selector The CSS selector to match elements against.
10
- * @returns The HTMLElement of the highest visible element, or null if none are found.
26
+ * Returns the highest element matching a CSS selector that is visible in the
27
+ * current viewport (below any fixed/sticky header).
28
+ *
29
+ * @param selector CSS selector to match elements.
30
+ * @returns The highest visible matching element, or `null` if none found.
11
31
  */
12
32
  export declare function findHighestVisibleElement(selector: string): HTMLElement | null;
33
+ /** Function signature for requestAnimationFrame-like schedulers. */
34
+ export type FrameScheduler = (callback: FrameRequestCallback) => number;
13
35
  /**
14
- * Scrolls the page to align the element to the top of the viewport,
15
- * accounting for fixed/sticky headers and adding some padding.
16
- * @param element The element to scroll to.
36
+ * Allows tests to override the frame scheduler used by `restoreScrollAnchor`.
37
+ * Pass `null` to reset to the default implementation.
17
38
  */
18
- export declare function scrollToElement(element: HTMLElement): void;
39
+ export declare function setFrameScheduler(scheduler: FrameScheduler | null): void;
19
40
  /**
20
- * Adjusts the scroll position to keep a specific element in the same visual location.
21
- * Useful when content additions/removals above might cause jumps.
41
+ * Restores the visual scroll position after a layout-shifting operation.
42
+ *
43
+ * Pass a `ScrollAnchor` captured *before* the layout change.
44
+ * Uses two `requestAnimationFrame` ticks to ensure the browser has fully
45
+ * reflowed the page before measuring and correcting.
46
+ *
47
+ * Note: When calling from a Svelte component, prefer using `tick()` before
48
+ * calling this function so Svelte's DOM updates are applied first.
49
+ *
50
+ * @param anchor A `ScrollAnchor` captured before the layout change.
22
51
  */
23
- export declare function handleScrollAnchor(scrollAnchor: {
24
- element: HTMLElement;
25
- top: number;
26
- }): void;
52
+ export declare function restoreScrollAnchor(anchor: ScrollAnchor): void;
27
53
  //# sourceMappingURL=scroll-utils.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"scroll-utils.d.ts","sourceRoot":"","sources":["../../../../../src/lib/utils/scroll-utils.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,wBAAgB,kBAAkB,IAAI,MAAM,CA0B3C;AAED;;;;GAIG;AACH,wBAAgB,yBAAyB,CAAC,QAAQ,EAAE,MAAM,GAAG,WAAW,GAAG,IAAI,CAmC9E;AAED;;;;GAIG;AACH,wBAAgB,eAAe,CAAC,OAAO,EAAE,WAAW,GAAG,IAAI,CAY1D;AAED;;;GAGG;AACH,wBAAgB,kBAAkB,CAAC,YAAY,EAAE;IAAE,OAAO,EAAE,WAAW,CAAC;IAAC,GAAG,EAAE,MAAM,CAAA;CAAE,GAAG,IAAI,CAkB5F"}
1
+ {"version":3,"file":"scroll-utils.d.ts","sourceRoot":"","sources":["../../../../../src/lib/utils/scroll-utils.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,MAAM,WAAW,YAAY;IAC3B,OAAO,EAAE,WAAW,CAAC;IACrB,mEAAmE;IACnE,GAAG,EAAE,MAAM,CAAC;CACb;AAED;;;;;;GAMG;AACH,wBAAgB,mBAAmB,CAAC,OAAO,EAAE,WAAW,GAAG,YAAY,CAEtE;AAED;;;;;GAKG;AACH,wBAAgB,kBAAkB,IAAI,MAAM,CAoB3C;AAED;;;;;;GAMG;AACH,wBAAgB,yBAAyB,CAAC,QAAQ,EAAE,MAAM,GAAG,WAAW,GAAG,IAAI,CAuB9E;AAED,oEAAoE;AACpE,MAAM,MAAM,cAAc,GAAG,CAAC,QAAQ,EAAE,oBAAoB,KAAK,MAAM,CAAC;AAmBxE;;;GAGG;AACH,wBAAgB,iBAAiB,CAAC,SAAS,EAAE,cAAc,GAAG,IAAI,GAAG,IAAI,CAExE;AAED;;;;;;;;;;;GAWG;AACH,wBAAgB,mBAAmB,CAAC,MAAM,EAAE,YAAY,GAAG,IAAI,CAc9D"}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=anchor.test.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"anchor.test.d.ts","sourceRoot":"","sources":["../../../../../../tests/lib/features/anchor/anchor.test.ts"],"names":[],"mappings":""}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=icon-settings-store.test.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"icon-settings-store.test.d.ts","sourceRoot":"","sources":["../../../../../../../tests/lib/features/settings/stores/icon-settings-store.test.ts"],"names":[],"mappings":""}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@custardui/custardui",
3
- "version": "1.0.0",
3
+ "version": "2.0.1-beta.0",
4
4
  "description": "A JavaScript dynamic custom views Library.",
5
5
  "type": "module",
6
6
  "main": "dist/custardui.min.js",
@@ -26,7 +26,7 @@
26
26
  "bump:patch": "npm version patch",
27
27
  "bump:minor": "npm version minor",
28
28
  "bump:major": "npm version major",
29
- "deploydocs:stable": "cd docs && markbind deploy -s stable-site.json",
29
+ "deploydocs:prod": "cd docs && markbind deploy -s prod-site.json",
30
30
  "deploydocs": "cd docs && markbind deploy -s site.json",
31
31
  "dev": "rollup -c -w",
32
32
  "watch": "rollup -c -w",
@@ -1,30 +0,0 @@
1
- /**
2
- * Descriptor for an anchor that represents a DOM element.
3
- */
4
- export interface AnchorDescriptor {
5
- tag: string;
6
- index: number;
7
- parentId?: string;
8
- textSnippet: string;
9
- textHash: number;
10
- elementId?: string;
11
- }
12
- /**
13
- * Creates an AnchorDescriptor for a given DOM element.
14
- */
15
- export declare function createDescriptor(el: HTMLElement): AnchorDescriptor;
16
- /**
17
- * Serializes a list of AnchorDescriptors into a URL-safe string.
18
- */
19
- export declare function serialize(descriptors: AnchorDescriptor[]): string;
20
- /**
21
- * Deserializes a URL-safe string back into a list of AnchorDescriptors.
22
- */
23
- export declare function deserialize(encoded: string): AnchorDescriptor[];
24
- /**
25
- * Finds the best DOM element match(es) for a descriptor.
26
- * Returns an array of elements. For specific descriptors, usually contains 0 or 1 element.
27
- * For ID-only descriptors (tag='ANY'), may return multiple if duplicates exist.
28
- */
29
- export declare function resolve(root: HTMLElement, descriptor: AnchorDescriptor): HTMLElement[];
30
- //# sourceMappingURL=dom-element-locator.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"dom-element-locator.d.ts","sourceRoot":"","sources":["../../../../../src/lib/utils/dom-element-locator.ts"],"names":[],"mappings":"AACA;;GAEG;AACH,MAAM,WAAW,gBAAgB;IAC/B,GAAG,EAAE,MAAM,CAAC;IACZ,KAAK,EAAE,MAAM,CAAC;IACd,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,WAAW,EAAE,MAAM,CAAC;IACpB,QAAQ,EAAE,MAAM,CAAC;IACjB,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAuBD;;GAEG;AACH,wBAAgB,gBAAgB,CAAC,EAAE,EAAE,WAAW,GAAG,gBAAgB,CAkClE;AAED;;GAEG;AACH,wBAAgB,SAAS,CAAC,WAAW,EAAE,gBAAgB,EAAE,GAAG,MAAM,CA6BjE;AAED;;GAEG;AACH,wBAAgB,WAAW,CAAC,OAAO,EAAE,MAAM,GAAG,gBAAgB,EAAE,CA6C/D;AAsBD;;;;GAIG;AACH,wBAAgB,OAAO,CAAC,IAAI,EAAE,WAAW,EAAE,UAAU,EAAE,gBAAgB,GAAG,WAAW,EAAE,CA+EtF"}
@@ -1,2 +0,0 @@
1
- export {};
2
- //# sourceMappingURL=dom-element-locator.test.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"dom-element-locator.test.d.ts","sourceRoot":"","sources":["../../../../../tests/lib/utils/dom-element-locator.test.ts"],"names":[],"mappings":""}