@custardui/custardui 1.0.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 (142) hide show
  1. package/README.md +31 -0
  2. package/dist/custardui.js +16552 -0
  3. package/dist/custardui.js.map +1 -0
  4. package/dist/custardui.min.js +7 -0
  5. package/dist/custardui.min.js.map +1 -0
  6. package/dist/types/src/browser.d.ts +7 -0
  7. package/dist/types/src/browser.d.ts.map +1 -0
  8. package/dist/types/src/lib/app/ui-manager.d.ts +55 -0
  9. package/dist/types/src/lib/app/ui-manager.d.ts.map +1 -0
  10. package/dist/types/src/lib/features/adaptation/adaptation-manager.d.ts +54 -0
  11. package/dist/types/src/lib/features/adaptation/adaptation-manager.d.ts.map +1 -0
  12. package/dist/types/src/lib/features/adaptation/stores/adaptation-store.svelte.d.ts +11 -0
  13. package/dist/types/src/lib/features/adaptation/stores/adaptation-store.svelte.d.ts.map +1 -0
  14. package/dist/types/src/lib/features/adaptation/types.d.ts +13 -0
  15. package/dist/types/src/lib/features/adaptation/types.d.ts.map +1 -0
  16. package/dist/types/src/lib/features/focus/focus-logic.d.ts +31 -0
  17. package/dist/types/src/lib/features/focus/focus-logic.d.ts.map +1 -0
  18. package/dist/types/src/lib/features/focus/services/focus-service.svelte.d.ts +37 -0
  19. package/dist/types/src/lib/features/focus/services/focus-service.svelte.d.ts.map +1 -0
  20. package/dist/types/src/lib/features/focus/stores/focus-store.svelte.d.ts +14 -0
  21. package/dist/types/src/lib/features/focus/stores/focus-store.svelte.d.ts.map +1 -0
  22. package/dist/types/src/lib/features/highlight/highlight-logic.d.ts +29 -0
  23. package/dist/types/src/lib/features/highlight/highlight-logic.d.ts.map +1 -0
  24. package/dist/types/src/lib/features/highlight/services/highlight-service.svelte.d.ts +20 -0
  25. package/dist/types/src/lib/features/highlight/services/highlight-service.svelte.d.ts.map +1 -0
  26. package/dist/types/src/lib/features/highlight/services/highlight-types.d.ts +10 -0
  27. package/dist/types/src/lib/features/highlight/services/highlight-types.d.ts.map +1 -0
  28. package/dist/types/src/lib/features/notifications/stores/toast-store.svelte.d.ts +15 -0
  29. package/dist/types/src/lib/features/notifications/stores/toast-store.svelte.d.ts.map +1 -0
  30. package/dist/types/src/lib/features/placeholder/placeholder-binder.d.ts +64 -0
  31. package/dist/types/src/lib/features/placeholder/placeholder-binder.d.ts.map +1 -0
  32. package/dist/types/src/lib/features/placeholder/placeholder-manager.d.ts +38 -0
  33. package/dist/types/src/lib/features/placeholder/placeholder-manager.d.ts.map +1 -0
  34. package/dist/types/src/lib/features/placeholder/stores/placeholder-registry-store.svelte.d.ts +17 -0
  35. package/dist/types/src/lib/features/placeholder/stores/placeholder-registry-store.svelte.d.ts.map +1 -0
  36. package/dist/types/src/lib/features/placeholder/types.d.ts +18 -0
  37. package/dist/types/src/lib/features/placeholder/types.d.ts.map +1 -0
  38. package/dist/types/src/lib/features/render/assets.d.ts +12 -0
  39. package/dist/types/src/lib/features/render/assets.d.ts.map +1 -0
  40. package/dist/types/src/lib/features/render/render.d.ts +3 -0
  41. package/dist/types/src/lib/features/render/render.d.ts.map +1 -0
  42. package/dist/types/src/lib/features/render/types.d.ts +19 -0
  43. package/dist/types/src/lib/features/render/types.d.ts.map +1 -0
  44. package/dist/types/src/lib/features/settings/intro-manager.svelte.d.ts +30 -0
  45. package/dist/types/src/lib/features/settings/intro-manager.svelte.d.ts.map +1 -0
  46. package/dist/types/src/lib/features/settings/types.d.ts +61 -0
  47. package/dist/types/src/lib/features/settings/types.d.ts.map +1 -0
  48. package/dist/types/src/lib/features/share/constants.d.ts +4 -0
  49. package/dist/types/src/lib/features/share/constants.d.ts.map +1 -0
  50. package/dist/types/src/lib/features/share/share-logic.d.ts +36 -0
  51. package/dist/types/src/lib/features/share/share-logic.d.ts.map +1 -0
  52. package/dist/types/src/lib/features/share/stores/share-store.svelte.d.ts +24 -0
  53. package/dist/types/src/lib/features/share/stores/share-store.svelte.d.ts.map +1 -0
  54. package/dist/types/src/lib/features/share/types.d.ts +8 -0
  55. package/dist/types/src/lib/features/share/types.d.ts.map +1 -0
  56. package/dist/types/src/lib/features/tabs/types.d.ts +31 -0
  57. package/dist/types/src/lib/features/tabs/types.d.ts.map +1 -0
  58. package/dist/types/src/lib/features/toggles/types.d.ts +16 -0
  59. package/dist/types/src/lib/features/toggles/types.d.ts.map +1 -0
  60. package/dist/types/src/lib/features/url/url-action-handler.d.ts +22 -0
  61. package/dist/types/src/lib/features/url/url-action-handler.d.ts.map +1 -0
  62. package/dist/types/src/lib/features/url/url-action-router.svelte.d.ts +26 -0
  63. package/dist/types/src/lib/features/url/url-action-router.svelte.d.ts.map +1 -0
  64. package/dist/types/src/lib/features/url/url-state-manager.d.ts +67 -0
  65. package/dist/types/src/lib/features/url/url-state-manager.d.ts.map +1 -0
  66. package/dist/types/src/lib/registry.d.ts +8 -0
  67. package/dist/types/src/lib/registry.d.ts.map +1 -0
  68. package/dist/types/src/lib/runtime.svelte.d.ts +73 -0
  69. package/dist/types/src/lib/runtime.svelte.d.ts.map +1 -0
  70. package/dist/types/src/lib/stores/active-state-store.svelte.d.ts +144 -0
  71. package/dist/types/src/lib/stores/active-state-store.svelte.d.ts.map +1 -0
  72. package/dist/types/src/lib/stores/derived-store.svelte.d.ts +16 -0
  73. package/dist/types/src/lib/stores/derived-store.svelte.d.ts.map +1 -0
  74. package/dist/types/src/lib/stores/element-store.svelte.d.ts +49 -0
  75. package/dist/types/src/lib/stores/element-store.svelte.d.ts.map +1 -0
  76. package/dist/types/src/lib/stores/ui-store.svelte.d.ts +29 -0
  77. package/dist/types/src/lib/stores/ui-store.svelte.d.ts.map +1 -0
  78. package/dist/types/src/lib/types/config.d.ts +38 -0
  79. package/dist/types/src/lib/types/config.d.ts.map +1 -0
  80. package/dist/types/src/lib/types/index.d.ts +8 -0
  81. package/dist/types/src/lib/types/index.d.ts.map +1 -0
  82. package/dist/types/src/lib/types/state.d.ts +16 -0
  83. package/dist/types/src/lib/types/state.d.ts.map +1 -0
  84. package/dist/types/src/lib/utils/clipboard-utils.d.ts +7 -0
  85. package/dist/types/src/lib/utils/clipboard-utils.d.ts.map +1 -0
  86. package/dist/types/src/lib/utils/dom-element-locator.d.ts +30 -0
  87. package/dist/types/src/lib/utils/dom-element-locator.d.ts.map +1 -0
  88. package/dist/types/src/lib/utils/init-utils.d.ts +18 -0
  89. package/dist/types/src/lib/utils/init-utils.d.ts.map +1 -0
  90. package/dist/types/src/lib/utils/persistence.d.ts +34 -0
  91. package/dist/types/src/lib/utils/persistence.d.ts.map +1 -0
  92. package/dist/types/src/lib/utils/scroll-utils.d.ts +27 -0
  93. package/dist/types/src/lib/utils/scroll-utils.d.ts.map +1 -0
  94. package/dist/types/src/lib/utils/url-utils.d.ts +8 -0
  95. package/dist/types/src/lib/utils/url-utils.d.ts.map +1 -0
  96. package/dist/types/tests/functional/fingerprint-compatibility.test.d.ts +2 -0
  97. package/dist/types/tests/functional/fingerprint-compatibility.test.d.ts.map +1 -0
  98. package/dist/types/tests/lib/features/adaptation/adaptation-manager.test.d.ts +2 -0
  99. package/dist/types/tests/lib/features/adaptation/adaptation-manager.test.d.ts.map +1 -0
  100. package/dist/types/tests/lib/features/adaptation/stores/adaptation-store.test.d.ts +2 -0
  101. package/dist/types/tests/lib/features/adaptation/stores/adaptation-store.test.d.ts.map +1 -0
  102. package/dist/types/tests/lib/features/focus/focus-logic.test.d.ts +2 -0
  103. package/dist/types/tests/lib/features/focus/focus-logic.test.d.ts.map +1 -0
  104. package/dist/types/tests/lib/features/focus/focus-store.test.d.ts +2 -0
  105. package/dist/types/tests/lib/features/focus/focus-store.test.d.ts.map +1 -0
  106. package/dist/types/tests/lib/features/highlight/highlight-logic.test.d.ts +2 -0
  107. package/dist/types/tests/lib/features/highlight/highlight-logic.test.d.ts.map +1 -0
  108. package/dist/types/tests/lib/features/notifications/stores/toast-store.test.d.ts +2 -0
  109. package/dist/types/tests/lib/features/notifications/stores/toast-store.test.d.ts.map +1 -0
  110. package/dist/types/tests/lib/features/placeholder/placeholder-binder.test.d.ts +2 -0
  111. package/dist/types/tests/lib/features/placeholder/placeholder-binder.test.d.ts.map +1 -0
  112. package/dist/types/tests/lib/features/placeholder/placeholder-manager.test.d.ts +2 -0
  113. package/dist/types/tests/lib/features/placeholder/placeholder-manager.test.d.ts.map +1 -0
  114. package/dist/types/tests/lib/features/settings/intro-manager.test.d.ts +2 -0
  115. package/dist/types/tests/lib/features/settings/intro-manager.test.d.ts.map +1 -0
  116. package/dist/types/tests/lib/features/share/share-logic.test.d.ts +2 -0
  117. package/dist/types/tests/lib/features/share/share-logic.test.d.ts.map +1 -0
  118. package/dist/types/tests/lib/features/share/share-store.test.d.ts +2 -0
  119. package/dist/types/tests/lib/features/share/share-store.test.d.ts.map +1 -0
  120. package/dist/types/tests/lib/features/url/url-action-handler.test.d.ts +2 -0
  121. package/dist/types/tests/lib/features/url/url-action-handler.test.d.ts.map +1 -0
  122. package/dist/types/tests/lib/features/url/url-state-manager.test.d.ts +2 -0
  123. package/dist/types/tests/lib/features/url/url-state-manager.test.d.ts.map +1 -0
  124. package/dist/types/tests/lib/services/url-action-router.test.d.ts +2 -0
  125. package/dist/types/tests/lib/services/url-action-router.test.d.ts.map +1 -0
  126. package/dist/types/tests/lib/stores/active-state-store.test.d.ts +2 -0
  127. package/dist/types/tests/lib/stores/active-state-store.test.d.ts.map +1 -0
  128. package/dist/types/tests/lib/stores/element-store.test.d.ts +2 -0
  129. package/dist/types/tests/lib/stores/element-store.test.d.ts.map +1 -0
  130. package/dist/types/tests/lib/stores/ui-store.test.d.ts +2 -0
  131. package/dist/types/tests/lib/stores/ui-store.test.d.ts.map +1 -0
  132. package/dist/types/tests/lib/utils/dom-element-locator.test.d.ts +2 -0
  133. package/dist/types/tests/lib/utils/dom-element-locator.test.d.ts.map +1 -0
  134. package/dist/types/tests/lib/utils/persistence.test.d.ts +2 -0
  135. package/dist/types/tests/lib/utils/persistence.test.d.ts.map +1 -0
  136. package/dist/types/tests/lib/utils/scroll-utils.test.d.ts +2 -0
  137. package/dist/types/tests/lib/utils/scroll-utils.test.d.ts.map +1 -0
  138. package/dist/types/tests/lib/utils/url-utils.test.d.ts +2 -0
  139. package/dist/types/tests/lib/utils/url-utils.test.d.ts.map +1 -0
  140. package/dist/types/tests/setup.d.ts +2 -0
  141. package/dist/types/tests/setup.d.ts.map +1 -0
  142. package/package.json +80 -0
@@ -0,0 +1,49 @@
1
+ import { SvelteSet } from 'svelte/reactivity';
2
+ /**
3
+ * Store for converting DOM presence into reactive state.
4
+ * Tracks which custom elements are currently in the DOM.
5
+ */
6
+ export declare class ElementStore {
7
+ /**
8
+ * Registry of toggle IDs that are currently present in the DOM.
9
+ * Used to filter the `menuToggles` list.
10
+ */
11
+ detectedToggles: SvelteSet<string>;
12
+ /**
13
+ * Registry of tab group IDs that are currently present in the DOM.
14
+ * Used to filter the `menuTabGroups` list.
15
+ */
16
+ detectedTabGroups: SvelteSet<string>;
17
+ /**
18
+ * Registry of placeholder names that are currently present in the DOM.
19
+ * Used to filter `isLocal` placeholders in settings.
20
+ */
21
+ detectedPlaceholders: SvelteSet<string>;
22
+ /**
23
+ * Returns true if there are any active components (toggles or tab groups) actually present in the DOM.
24
+ */
25
+ hasPageElements: boolean;
26
+ /**
27
+ * Registers a toggle as active on the current page.
28
+ * @param id The ID of the toggle found in the DOM.
29
+ */
30
+ registerToggle(id: string): void;
31
+ /**
32
+ * Registers a tab group as active on the current page.
33
+ * @param id The ID of the tab group found in the DOM.
34
+ */
35
+ registerTabGroup(id: string): void;
36
+ /**
37
+ * Registers a placeholder variable as active on the current page.
38
+ * @param name The name of the placeholder found in the DOM.
39
+ */
40
+ registerPlaceholder(name: string): void;
41
+ /**
42
+ * Clears the component registry.
43
+ * Should be called when scanning a fresh part of the DOM or resetting.
44
+ */
45
+ clearRegistry(): void;
46
+ clearDetectedPlaceholders(): void;
47
+ }
48
+ export declare const elementStore: ElementStore;
49
+ //# sourceMappingURL=element-store.svelte.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"element-store.svelte.d.ts","sourceRoot":"","sources":["../../../../../src/lib/stores/element-store.svelte.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,mBAAmB,CAAC;AAE9C;;;GAGG;AACH,qBAAa,YAAY;IACvB;;;OAGG;IACH,eAAe,oBAA8C;IAE7D;;;OAGG;IACH,iBAAiB,oBAA8C;IAE/D;;;OAGG;IACH,oBAAoB,oBAA8C;IAElE;;OAEG;IACH,eAAe,UAA8E;IAI7F;;;OAGG;IACH,cAAc,CAAC,EAAE,EAAE,MAAM;IAIzB;;;OAGG;IACH,gBAAgB,CAAC,EAAE,EAAE,MAAM;IAI3B;;;OAGG;IACH,mBAAmB,CAAC,IAAI,EAAE,MAAM;IAIhC;;;OAGG;IACH,aAAa;IAMb,yBAAyB;CAG1B;AAED,eAAO,MAAM,YAAY,cAAqB,CAAC"}
@@ -0,0 +1,29 @@
1
+ /**
2
+ * Store for UI Configuration Options.
3
+ * Stores settings related to the UI appearance and behavior (e.g. visibility of specific sections).
4
+ */
5
+ export declare class UIStore {
6
+ uiOptions: {
7
+ showTabGroups: boolean;
8
+ showReset: boolean;
9
+ title: string;
10
+ description: string;
11
+ };
12
+ /**
13
+ * Controls the visibility of the tab navigation headers globally.
14
+ */
15
+ isTabGroupNavHeadingVisible: boolean;
16
+ /**
17
+ * Updates the UI configuration options.
18
+ * @param options Partial UI options to merge.
19
+ */
20
+ setUIOptions(options: {
21
+ showTabGroups?: boolean;
22
+ showReset?: boolean;
23
+ title?: string;
24
+ description?: string;
25
+ }): void;
26
+ reset(): void;
27
+ }
28
+ export declare const uiStore: UIStore;
29
+ //# sourceMappingURL=ui-store.svelte.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ui-store.svelte.d.ts","sourceRoot":"","sources":["../../../../../src/lib/stores/ui-store.svelte.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,qBAAa,OAAO;IAClB,SAAS;;;;;MAKN;IAEH;;OAEG;IACH,2BAA2B,UAAgB;IAE3C;;;OAGG;IACH,YAAY,CAAC,OAAO,EAAE;QACpB,aAAa,CAAC,EAAE,OAAO,CAAC;QACxB,SAAS,CAAC,EAAE,OAAO,CAAC;QACpB,KAAK,CAAC,EAAE,MAAM,CAAC;QACf,WAAW,CAAC,EAAE,MAAM,CAAC;KACtB;IAeD,KAAK;CAUN;AAED,eAAO,MAAM,OAAO,SAAgB,CAAC"}
@@ -0,0 +1,38 @@
1
+ import type { PlaceholderDefinition } from '../features/placeholder/types';
2
+ import type { TabGroupConfig } from '../features/tabs/types';
3
+ import type { ToggleConfig } from '../features/toggles/types';
4
+ import type { ShareExclusions } from '../features/share/types';
5
+ import type { WidgetSettings } from '../features/settings/types';
6
+ declare const CONFIG_SECTION_KEYS: readonly ["toggles", "tabGroups", "placeholders"];
7
+ export type ConfigSectionKey = (typeof CONFIG_SECTION_KEYS)[number];
8
+ export declare function isValidConfigSection(key: string): key is ConfigSectionKey;
9
+ /**
10
+ * Configuration (website author-defined) for the site
11
+ */
12
+ export interface Config {
13
+ /** All available toggle categories */
14
+ toggles?: ToggleConfig[];
15
+ /** Optional tab group configurations */
16
+ tabGroups?: TabGroupConfig[];
17
+ /** Excluded tags and IDs for Share/Focus modes */
18
+ shareExclusions?: ShareExclusions;
19
+ /** Global placeholder definitions */
20
+ placeholders?: PlaceholderDefinition[];
21
+ }
22
+ /**
23
+ * Represents the configuration file structure for CustardUI auto-initialization.
24
+ */
25
+ export interface ConfigFile {
26
+ /** Core configuration object with toggles and defaultState */
27
+ config?: Config;
28
+ /** Path to the assets JSON file */
29
+ assetsJsonPath?: string;
30
+ /** Base URL for all paths */
31
+ baseUrl?: string;
32
+ /** Optional key to namespace localStorage items for isolation */
33
+ storageKey?: string;
34
+ /** Widget configuration options */
35
+ settings?: WidgetSettings;
36
+ }
37
+ export {};
38
+ //# sourceMappingURL=config.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"config.d.ts","sourceRoot":"","sources":["../../../../../src/lib/types/config.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,+BAA+B,CAAC;AAC3E,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,wBAAwB,CAAC;AAC7D,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,2BAA2B,CAAC;AAC9D,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,yBAAyB,CAAC;AAC/D,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,4BAA4B,CAAC;AAEjE,QAAA,MAAM,mBAAmB,mDAAoD,CAAC;AAE9E,MAAM,MAAM,gBAAgB,GAAG,CAAC,OAAO,mBAAmB,CAAC,CAAC,MAAM,CAAC,CAAC;AAEpE,wBAAgB,oBAAoB,CAAC,GAAG,EAAE,MAAM,GAAG,GAAG,IAAI,gBAAgB,CAEzE;AAED;;GAEG;AACH,MAAM,WAAW,MAAM;IACrB,sCAAsC;IACtC,OAAO,CAAC,EAAE,YAAY,EAAE,CAAC;IACzB,wCAAwC;IACxC,SAAS,CAAC,EAAE,cAAc,EAAE,CAAC;IAC7B,kDAAkD;IAClD,eAAe,CAAC,EAAE,eAAe,CAAC;IAClC,qCAAqC;IACrC,YAAY,CAAC,EAAE,qBAAqB,EAAE,CAAC;CACxC;AAED;;GAEG;AACH,MAAM,WAAW,UAAU;IACzB,8DAA8D;IAC9D,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,mCAAmC;IACnC,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,6BAA6B;IAC7B,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,iEAAiE;IACjE,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,mCAAmC;IACnC,QAAQ,CAAC,EAAE,cAAc,CAAC;CAC3B"}
@@ -0,0 +1,8 @@
1
+ export * from './state';
2
+ export * from './config';
3
+ export * from '../features/render/types';
4
+ export * from '../features/tabs/types';
5
+ export * from '../features/toggles/types';
6
+ export * from '../features/share/types';
7
+ export * from '../features/placeholder/types';
8
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/lib/types/index.ts"],"names":[],"mappings":"AAAA,cAAc,SAAS,CAAC;AACxB,cAAc,UAAU,CAAC;AACzB,cAAc,0BAA0B,CAAC;AACzC,cAAc,wBAAwB,CAAC;AACvC,cAAc,2BAA2B,CAAC;AAC1C,cAAc,yBAAyB,CAAC;AACxC,cAAc,+BAA+B,CAAC"}
@@ -0,0 +1,16 @@
1
+ /**
2
+ * Represents a specific state of a custom view.
3
+ */
4
+ export interface State {
5
+ /** List of toggle categories that should be fully displayed ("Show" state) */
6
+ shownToggles?: string[];
7
+ /** List of toggle categories that should be in preview mode ("Peek" state) */
8
+ peekToggles?: string[];
9
+ /** List of toggle categories that should be explicitly hidden ("Hide" state) */
10
+ hiddenToggles?: string[];
11
+ /** Tab selections: groupId -> tabId */
12
+ tabs?: Record<string, string>;
13
+ /** Placeholder values: key -> value */
14
+ placeholders?: Record<string, string>;
15
+ }
16
+ //# sourceMappingURL=state.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"state.d.ts","sourceRoot":"","sources":["../../../../../src/lib/types/state.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,MAAM,WAAW,KAAK;IACpB,8EAA8E;IAC9E,YAAY,CAAC,EAAE,MAAM,EAAE,CAAC;IACxB,8EAA8E;IAC9E,WAAW,CAAC,EAAE,MAAM,EAAE,CAAC;IACvB,gFAAgF;IAChF,aAAa,CAAC,EAAE,MAAM,EAAE,CAAC;IACzB,uCAAuC;IACvC,IAAI,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IAC9B,uCAAuC;IACvC,YAAY,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;CACvC"}
@@ -0,0 +1,7 @@
1
+ /**
2
+ * Copies text to the clipboard with fallback for non-secure contexts.
3
+ * @param text The text to copy
4
+ * @returns Promise that resolves if copy was successful, rejects otherwise.
5
+ */
6
+ export declare function copyToClipboard(text: string): Promise<void>;
7
+ //# sourceMappingURL=clipboard-utils.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"clipboard-utils.d.ts","sourceRoot":"","sources":["../../../../../src/lib/utils/clipboard-utils.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,wBAAsB,eAAe,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAoCjE"}
@@ -0,0 +1,30 @@
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
@@ -0,0 +1 @@
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"}
@@ -0,0 +1,18 @@
1
+ import type { ConfigFile } from '$lib/types/index';
2
+ /**
3
+ * structure for script attributes
4
+ */
5
+ export interface ScriptAttributes {
6
+ baseURL: string;
7
+ configPath: string;
8
+ }
9
+ /**
10
+ * Finds the script tag that loaded the library and extracts configuration attributes.
11
+ * Looks for `data-base-url` and `data-config-path`.
12
+ */
13
+ export declare function getScriptAttributes(): ScriptAttributes;
14
+ /**
15
+ * Fetches and parses the configuration file.
16
+ */
17
+ export declare function fetchConfig(configPath: string, baseURL: string): Promise<ConfigFile>;
18
+ //# sourceMappingURL=init-utils.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"init-utils.d.ts","sourceRoot":"","sources":["../../../../../src/lib/utils/init-utils.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAEnD;;GAEG;AACH,MAAM,WAAW,gBAAgB;IAC/B,OAAO,EAAE,MAAM,CAAC;IAChB,UAAU,EAAE,MAAM,CAAC;CACpB;AAED;;;GAGG;AACH,wBAAgB,mBAAmB,IAAI,gBAAgB,CAkCtD;AAED;;GAEG;AACH,wBAAsB,WAAW,CAAC,UAAU,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,GAAG,OAAO,CAAC,UAAU,CAAC,CAqB1F"}
@@ -0,0 +1,34 @@
1
+ import type { State } from '$lib/types/index';
2
+ /**
3
+ * Manages persistence of custom views state using browser localStorage
4
+ */
5
+ export declare class PersistenceManager {
6
+ private prefix;
7
+ constructor(storageKey?: string);
8
+ /**
9
+ * Check if localStorage is available in the current environment
10
+ */
11
+ private isStorageAvailable;
12
+ /**
13
+ * Generic set item with prefix
14
+ */
15
+ setItem(key: string, value: string): void;
16
+ /**
17
+ * Generic get item with prefix
18
+ * Keys are automatically prefixed with user specified storageKey
19
+ */
20
+ getItem(key: string): string | null;
21
+ /**
22
+ * Generic remove item with prefix
23
+ * Keys are automatically prefixed with user specified storageKey
24
+ */
25
+ removeItem(key: string): void;
26
+ private getPrefixedKey;
27
+ persistState(state: State): void;
28
+ getPersistedState(): State | null;
29
+ clearAll(): void;
30
+ persistTabNavVisibility(visible: boolean): void;
31
+ getPersistedTabNavVisibility(): boolean | null;
32
+ hasPersistedData(): boolean;
33
+ }
34
+ //# sourceMappingURL=persistence.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"persistence.d.ts","sourceRoot":"","sources":["../../../../../src/lib/utils/persistence.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,kBAAkB,CAAC;AAE9C;;GAEG;AACH,qBAAa,kBAAkB;IAE7B,OAAO,CAAC,MAAM,CAAS;gBAEX,UAAU,CAAC,EAAE,MAAM;IAI/B;;OAEG;IACH,OAAO,CAAC,kBAAkB;IAI1B;;OAEG;IACI,OAAO,CAAC,GAAG,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,GAAG,IAAI;IAShD;;;OAGG;IACI,OAAO,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,GAAG,IAAI;IAU1C;;;OAGG;IACI,UAAU,CAAC,GAAG,EAAE,MAAM,GAAG,IAAI;IASpC,OAAO,CAAC,cAAc;IAMf,YAAY,CAAC,KAAK,EAAE,KAAK,GAAG,IAAI;IAIhC,iBAAiB,IAAI,KAAK,GAAG,IAAI;IAWjC,QAAQ,IAAI,IAAI;IAKhB,uBAAuB,CAAC,OAAO,EAAE,OAAO,GAAG,IAAI;IAI/C,4BAA4B,IAAI,OAAO,GAAG,IAAI;IAK9C,gBAAgB,IAAI,OAAO;CAGnC"}
@@ -0,0 +1,27 @@
1
+ /**
2
+ * 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.
5
+ */
6
+ export declare function getScrollTopOffset(): number;
7
+ /**
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.
11
+ */
12
+ export declare function findHighestVisibleElement(selector: string): HTMLElement | null;
13
+ /**
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.
17
+ */
18
+ export declare function scrollToElement(element: HTMLElement): void;
19
+ /**
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.
22
+ */
23
+ export declare function handleScrollAnchor(scrollAnchor: {
24
+ element: HTMLElement;
25
+ top: number;
26
+ }): void;
27
+ //# sourceMappingURL=scroll-utils.d.ts.map
@@ -0,0 +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"}
@@ -0,0 +1,8 @@
1
+ /**
2
+ * Helper function to prepend baseUrl to a path
3
+ * @param path The path to prepend the baseUrl to
4
+ * @param baseUrl The base URL to prepend
5
+ * @returns The full URL with baseUrl prepended if applicable
6
+ */
7
+ export declare function prependBaseUrl(path: string, baseUrl: string): string;
8
+ //# sourceMappingURL=url-utils.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"url-utils.d.ts","sourceRoot":"","sources":["../../../../../src/lib/utils/url-utils.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH,wBAAgB,cAAc,CAAC,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,GAAG,MAAM,CAapE"}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=fingerprint-compatibility.test.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"fingerprint-compatibility.test.d.ts","sourceRoot":"","sources":["../../../../tests/functional/fingerprint-compatibility.test.ts"],"names":[],"mappings":""}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=adaptation-manager.test.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"adaptation-manager.test.d.ts","sourceRoot":"","sources":["../../../../../../tests/lib/features/adaptation/adaptation-manager.test.ts"],"names":[],"mappings":""}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=adaptation-store.test.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"adaptation-store.test.d.ts","sourceRoot":"","sources":["../../../../../../../tests/lib/features/adaptation/stores/adaptation-store.test.ts"],"names":[],"mappings":""}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=focus-logic.test.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"focus-logic.test.d.ts","sourceRoot":"","sources":["../../../../../../tests/lib/features/focus/focus-logic.test.ts"],"names":[],"mappings":""}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=focus-store.test.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"focus-store.test.d.ts","sourceRoot":"","sources":["../../../../../../tests/lib/features/focus/focus-store.test.ts"],"names":[],"mappings":""}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=highlight-logic.test.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"highlight-logic.test.d.ts","sourceRoot":"","sources":["../../../../../../tests/lib/features/highlight/highlight-logic.test.ts"],"names":[],"mappings":""}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=toast-store.test.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"toast-store.test.d.ts","sourceRoot":"","sources":["../../../../../../../tests/lib/features/notifications/stores/toast-store.test.ts"],"names":[],"mappings":""}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=placeholder-binder.test.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"placeholder-binder.test.d.ts","sourceRoot":"","sources":["../../../../../../tests/lib/features/placeholder/placeholder-binder.test.ts"],"names":[],"mappings":""}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=placeholder-manager.test.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"placeholder-manager.test.d.ts","sourceRoot":"","sources":["../../../../../../tests/lib/features/placeholder/placeholder-manager.test.ts"],"names":[],"mappings":""}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=intro-manager.test.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"intro-manager.test.d.ts","sourceRoot":"","sources":["../../../../../../tests/lib/features/settings/intro-manager.test.ts"],"names":[],"mappings":""}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=share-logic.test.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"share-logic.test.d.ts","sourceRoot":"","sources":["../../../../../../tests/lib/features/share/share-logic.test.ts"],"names":[],"mappings":""}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=share-store.test.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"share-store.test.d.ts","sourceRoot":"","sources":["../../../../../../tests/lib/features/share/share-store.test.ts"],"names":[],"mappings":""}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=url-action-handler.test.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"url-action-handler.test.d.ts","sourceRoot":"","sources":["../../../../../../tests/lib/features/url/url-action-handler.test.ts"],"names":[],"mappings":""}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=url-state-manager.test.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"url-state-manager.test.d.ts","sourceRoot":"","sources":["../../../../../../tests/lib/features/url/url-state-manager.test.ts"],"names":[],"mappings":""}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=url-action-router.test.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"url-action-router.test.d.ts","sourceRoot":"","sources":["../../../../../tests/lib/services/url-action-router.test.ts"],"names":[],"mappings":""}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=active-state-store.test.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"active-state-store.test.d.ts","sourceRoot":"","sources":["../../../../../tests/lib/stores/active-state-store.test.ts"],"names":[],"mappings":""}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=element-store.test.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"element-store.test.d.ts","sourceRoot":"","sources":["../../../../../tests/lib/stores/element-store.test.ts"],"names":[],"mappings":""}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=ui-store.test.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ui-store.test.d.ts","sourceRoot":"","sources":["../../../../../tests/lib/stores/ui-store.test.ts"],"names":[],"mappings":""}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=dom-element-locator.test.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"dom-element-locator.test.d.ts","sourceRoot":"","sources":["../../../../../tests/lib/utils/dom-element-locator.test.ts"],"names":[],"mappings":""}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=persistence.test.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"persistence.test.d.ts","sourceRoot":"","sources":["../../../../../tests/lib/utils/persistence.test.ts"],"names":[],"mappings":""}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=scroll-utils.test.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"scroll-utils.test.d.ts","sourceRoot":"","sources":["../../../../../tests/lib/utils/scroll-utils.test.ts"],"names":[],"mappings":""}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=url-utils.test.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"url-utils.test.d.ts","sourceRoot":"","sources":["../../../../../tests/lib/utils/url-utils.test.ts"],"names":[],"mappings":""}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=setup.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"setup.d.ts","sourceRoot":"","sources":["../../../tests/setup.ts"],"names":[],"mappings":""}
package/package.json ADDED
@@ -0,0 +1,80 @@
1
+ {
2
+ "name": "@custardui/custardui",
3
+ "version": "1.0.0",
4
+ "description": "A JavaScript dynamic custom views Library.",
5
+ "type": "module",
6
+ "main": "dist/custardui.min.js",
7
+ "browser": "dist/custardui.min.js",
8
+ "unpkg": "dist/custardui.min.js",
9
+ "jsdelivr": "dist/custardui.min.js",
10
+ "repository": {
11
+ "type": "git",
12
+ "url": "https://github.com/custardui/custardui.git"
13
+ },
14
+ "files": [
15
+ "dist/"
16
+ ],
17
+ "scripts": {
18
+ "clean": "rimraf dist",
19
+ "build:types": "tsc --project tsconfig.json",
20
+ "build:js": "rollup -c",
21
+ "build": "npm run clean && npm run build:types && npm run build:js",
22
+ "release": "npm run release:beta",
23
+ "release:beta": "npm run build && npm publish --access public --tag beta && git push --tags",
24
+ "release:prod": "npm run build && npm publish --access public --tag latest && git push --tags",
25
+ "bump:beta": "npm version prerelease --preid=beta",
26
+ "bump:patch": "npm version patch",
27
+ "bump:minor": "npm version minor",
28
+ "bump:major": "npm version major",
29
+ "deploydocs:stable": "cd docs && markbind deploy -s stable-site.json",
30
+ "deploydocs": "cd docs && markbind deploy -s site.json",
31
+ "dev": "rollup -c -w",
32
+ "watch": "rollup -c -w",
33
+ "lint": "eslint .",
34
+ "lint:fix": "eslint . --fix",
35
+ "format": "prettier --write .",
36
+ "format:check": "prettier --check .",
37
+ "test": "vitest run --reporter verbose"
38
+ },
39
+ "keywords": [
40
+ "javascript",
41
+ "library",
42
+ "custom views",
43
+ "custardui"
44
+ ],
45
+ "author": "Chan Ger Teck",
46
+ "license": "MIT",
47
+ "devDependencies": {
48
+ "@eslint/js": "^9.39.2",
49
+ "@rollup/plugin-alias": "^6.0.0",
50
+ "@rollup/plugin-node-resolve": "^16.0.3",
51
+ "@rollup/plugin-terser": "^0.4.4",
52
+ "@rollup/plugin-typescript": "^12.1.4",
53
+ "@sveltejs/vite-plugin-svelte": "^6.2.4",
54
+ "@tsconfig/svelte": "^5.0.6",
55
+ "@types/jsdom": "^27.0.0",
56
+ "@types/node": "^24.3.1",
57
+ "eslint": "^9.39.2",
58
+ "eslint-config-prettier": "^10.1.8",
59
+ "eslint-plugin-svelte": "^3.14.0",
60
+ "globals": "^17.3.0",
61
+ "jsdom": "^27.0.0",
62
+ "prettier": "^3.8.1",
63
+ "prettier-plugin-svelte": "^3.4.1",
64
+ "rimraf": "^6.0.1",
65
+ "rollup": "^4.46.2",
66
+ "rollup-plugin-svelte": "^7.2.3",
67
+ "svelte": "^5.46.1",
68
+ "svelte-eslint-parser": "^1.4.1",
69
+ "svelte-preprocess": "^6.0.3",
70
+ "tslib": "^2.8.1",
71
+ "typescript": "^5.9.2",
72
+ "typescript-eslint": "^8.54.0",
73
+ "vite-tsconfig-paths": "^6.0.5",
74
+ "vitest": "^3.2.4"
75
+ },
76
+ "bugs": {
77
+ "url": "https://github.com/custardui/custardui/issues"
78
+ },
79
+ "homepage": "https://github.com/custardui/custardui#readme"
80
+ }