@customviews-js/customviews 1.4.1-beta.1 → 1.4.1-beta.3

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 (105) hide show
  1. package/dist/custom-views.cjs.js +12520 -0
  2. package/dist/custom-views.cjs.js.map +1 -0
  3. package/dist/custom-views.esm.js +12041 -4923
  4. package/dist/custom-views.esm.js.map +1 -1
  5. package/dist/custom-views.min.js +3 -3
  6. package/dist/custom-views.min.js.map +1 -1
  7. package/dist/types/{lib/custom-views.d.ts → CustomViews.d.ts} +4 -3
  8. package/dist/types/CustomViews.d.ts.map +1 -0
  9. package/dist/types/browser.d.ts +21 -0
  10. package/dist/types/browser.d.ts.map +1 -0
  11. package/dist/types/core/{config.d.ts → constants.d.ts} +1 -1
  12. package/dist/types/core/constants.d.ts.map +1 -0
  13. package/dist/types/core/core.svelte.d.ts +40 -0
  14. package/dist/types/core/core.svelte.d.ts.map +1 -0
  15. package/dist/types/core/{assets-manager.d.ts → managers/assets-manager.d.ts} +1 -1
  16. package/dist/types/core/managers/assets-manager.d.ts.map +1 -0
  17. package/dist/types/core/render.d.ts +1 -1
  18. package/dist/types/core/render.d.ts.map +1 -1
  19. package/dist/types/core/services/focus-service.d.ts +33 -0
  20. package/dist/types/core/services/focus-service.d.ts.map +1 -0
  21. package/dist/types/core/settings.d.ts +79 -0
  22. package/dist/types/core/settings.d.ts.map +1 -0
  23. package/dist/types/core/{persistence.d.ts → state/persistence.d.ts} +1 -1
  24. package/dist/types/core/state/persistence.d.ts.map +1 -0
  25. package/dist/types/core/{url-state-manager.d.ts → state/url-state-manager.d.ts} +1 -1
  26. package/dist/types/core/state/url-state-manager.d.ts.map +1 -0
  27. package/dist/types/core/stores/focus-store.d.ts +10 -0
  28. package/dist/types/core/stores/focus-store.d.ts.map +1 -0
  29. package/dist/types/core/stores/main-store.svelte.d.ts +93 -0
  30. package/dist/types/core/stores/main-store.svelte.d.ts.map +1 -0
  31. package/dist/types/core/stores/share-store.d.ts +21 -0
  32. package/dist/types/core/stores/share-store.d.ts.map +1 -0
  33. package/dist/types/core/stores/toast-store.d.ts +13 -0
  34. package/dist/types/core/stores/toast-store.d.ts.map +1 -0
  35. package/dist/types/core/utils/dom-element-locator.d.ts +27 -0
  36. package/dist/types/core/utils/dom-element-locator.d.ts.map +1 -0
  37. package/dist/types/index.d.ts +9 -9
  38. package/dist/types/index.d.ts.map +1 -1
  39. package/dist/types/registry.d.ts +6 -0
  40. package/dist/types/registry.d.ts.map +1 -0
  41. package/dist/types/types/assets.d.ts +19 -0
  42. package/dist/types/types/assets.d.ts.map +1 -0
  43. package/dist/types/types/config.d.ts +117 -0
  44. package/dist/types/types/config.d.ts.map +1 -0
  45. package/dist/types/types/elements.d.ts +12 -0
  46. package/dist/types/types/elements.d.ts.map +1 -0
  47. package/dist/types/types/state.d.ts +16 -0
  48. package/dist/types/types/state.d.ts.map +1 -0
  49. package/dist/types/types/types.d.ts +5 -129
  50. package/dist/types/types/types.d.ts.map +1 -1
  51. package/dist/types/utils/icons.d.ts +1 -1
  52. package/dist/types/utils/init-utils.d.ts +24 -0
  53. package/dist/types/utils/init-utils.d.ts.map +1 -0
  54. package/dist/types/utils/scroll-utils.d.ts +26 -0
  55. package/dist/types/utils/scroll-utils.d.ts.map +1 -0
  56. package/package.json +10 -5
  57. package/dist/custom-views.core.cjs.js +0 -5402
  58. package/dist/custom-views.core.cjs.js.map +0 -1
  59. package/dist/custom-views.core.esm.js +0 -5395
  60. package/dist/custom-views.core.esm.js.map +0 -1
  61. package/dist/custom-views.js +0 -5408
  62. package/dist/custom-views.js.map +0 -1
  63. package/dist/types/core/anchor-engine.d.ts +0 -55
  64. package/dist/types/core/anchor-engine.d.ts.map +0 -1
  65. package/dist/types/core/assets-manager.d.ts.map +0 -1
  66. package/dist/types/core/config.d.ts.map +0 -1
  67. package/dist/types/core/core.d.ts +0 -122
  68. package/dist/types/core/core.d.ts.map +0 -1
  69. package/dist/types/core/custom-elements.d.ts +0 -8
  70. package/dist/types/core/custom-elements.d.ts.map +0 -1
  71. package/dist/types/core/focus-manager.d.ts +0 -38
  72. package/dist/types/core/focus-manager.d.ts.map +0 -1
  73. package/dist/types/core/persistence.d.ts.map +0 -1
  74. package/dist/types/core/share-manager.d.ts +0 -70
  75. package/dist/types/core/share-manager.d.ts.map +0 -1
  76. package/dist/types/core/tab-manager.d.ts +0 -73
  77. package/dist/types/core/tab-manager.d.ts.map +0 -1
  78. package/dist/types/core/toast-manager.d.ts +0 -12
  79. package/dist/types/core/toast-manager.d.ts.map +0 -1
  80. package/dist/types/core/toggle-manager.d.ts +0 -43
  81. package/dist/types/core/toggle-manager.d.ts.map +0 -1
  82. package/dist/types/core/url-state-manager.d.ts.map +0 -1
  83. package/dist/types/core/visibility-manager.d.ts +0 -28
  84. package/dist/types/core/visibility-manager.d.ts.map +0 -1
  85. package/dist/types/core/widget.d.ts +0 -104
  86. package/dist/types/core/widget.d.ts.map +0 -1
  87. package/dist/types/entry/browser-entry.d.ts +0 -13
  88. package/dist/types/entry/browser-entry.d.ts.map +0 -1
  89. package/dist/types/lib/custom-views.d.ts.map +0 -1
  90. package/dist/types/styles/focus-mode-styles.d.ts +0 -8
  91. package/dist/types/styles/focus-mode-styles.d.ts.map +0 -1
  92. package/dist/types/styles/share-mode-styles.d.ts +0 -10
  93. package/dist/types/styles/share-mode-styles.d.ts.map +0 -1
  94. package/dist/types/styles/styles.d.ts +0 -7
  95. package/dist/types/styles/styles.d.ts.map +0 -1
  96. package/dist/types/styles/tab-styles.d.ts +0 -5
  97. package/dist/types/styles/tab-styles.d.ts.map +0 -1
  98. package/dist/types/styles/toast-styles.d.ts +0 -4
  99. package/dist/types/styles/toast-styles.d.ts.map +0 -1
  100. package/dist/types/styles/toggle-styles.d.ts +0 -5
  101. package/dist/types/styles/toggle-styles.d.ts.map +0 -1
  102. package/dist/types/styles/widget-styles.d.ts +0 -13
  103. package/dist/types/styles/widget-styles.d.ts.map +0 -1
  104. package/dist/types/utils/scroll-manager.d.ts +0 -26
  105. package/dist/types/utils/scroll-manager.d.ts.map +0 -1
@@ -0,0 +1,117 @@
1
+ /**
2
+ * Configuration for a single tab within a tab group
3
+ */
4
+ export interface TabConfig {
5
+ /** Tab identifier */
6
+ tabId: string;
7
+ /** Display label for the tab */
8
+ label?: string;
9
+ }
10
+ /**
11
+ * Configuration for a tab group
12
+ */
13
+ export interface TabGroupConfig {
14
+ /** Group identifier (stable across the page) */
15
+ groupId: string;
16
+ /** Display name for widget/nav */
17
+ label?: string;
18
+ /** Available tabs in this group */
19
+ tabs: TabConfig[];
20
+ /** Determines if the tab group is only shown on pages where it's used. */
21
+ isLocal?: boolean;
22
+ /** Optional description to display below label */
23
+ description?: string;
24
+ /** Default tab ID to select */
25
+ default?: string;
26
+ }
27
+ /**
28
+ * Configuration for a single toggle.
29
+ */
30
+ export interface ToggleConfig {
31
+ /** Toggle identifier */
32
+ toggleId: string;
33
+ /** Display label for the toggle */
34
+ label?: string;
35
+ /** Determines if the toggle is only shown on pages where it's used. */
36
+ isLocal?: boolean;
37
+ /** Optional description to display below functionality */
38
+ description?: string;
39
+ /** Default state for this toggle: 'show', 'hide', or 'peek' */
40
+ default?: 'show' | 'hide' | 'peek';
41
+ }
42
+ /**
43
+ * Configuration for the site, has default state and list of toggles
44
+ */
45
+ export interface ShareExclusions {
46
+ tags?: string[];
47
+ ids?: string[];
48
+ }
49
+ /**
50
+ * Configuration for the site, has default state and list of toggles
51
+ */
52
+ export interface Config {
53
+ /** All available toggle categories */
54
+ toggles?: ToggleConfig[];
55
+ /** Optional tab group configurations */
56
+ tabGroups?: TabGroupConfig[];
57
+ /** Excluded tags and IDs for Share/Focus modes */
58
+ shareExclusions?: ShareExclusions;
59
+ }
60
+ /**
61
+ * Represents the configuration file structure for CustomViews auto-initialization.
62
+ */
63
+ export interface ConfigFile {
64
+ /** Core configuration object with toggles and defaultState */
65
+ config?: Config;
66
+ /** Path to the assets JSON file */
67
+ assetsJsonPath?: string;
68
+ /** Base URL for all paths */
69
+ baseUrl?: string;
70
+ /** Whether to keep the `view` state parameter visible in the browser URL bar */
71
+ showUrl?: boolean;
72
+ /** Widget configuration options */
73
+ settings?: {
74
+ /** Whether the settings widget is enabled */
75
+ enabled?: boolean;
76
+ /** Settings panel configuration */
77
+ panel?: {
78
+ /** Widget title */
79
+ title?: string;
80
+ /** Widget description text */
81
+ description?: string;
82
+ /** Whether to show tab groups section in widget (default: true) */
83
+ showTabGroups?: boolean;
84
+ /** Whether to show reset button */
85
+ showReset?: boolean;
86
+ /** Widget theme */
87
+ theme?: 'light' | 'dark';
88
+ };
89
+ /** Callout configuration options */
90
+ callout?: {
91
+ /** Whether to show the callout (default: false) */
92
+ show?: boolean;
93
+ /** Message to display in the callout */
94
+ message?: string;
95
+ /** Whether to enable pulse animation */
96
+ enablePulse?: boolean;
97
+ /** Custom background color */
98
+ backgroundColor?: string;
99
+ /** Custom text color */
100
+ textColor?: string;
101
+ };
102
+ /** Custom icon styling options */
103
+ icon?: {
104
+ /** Widget position */
105
+ position?: 'top-right' | 'top-left' | 'bottom-right' | 'bottom-left' | 'middle-left' | 'middle-right';
106
+ /** Custom icon color */
107
+ color?: string;
108
+ /** Custom background color */
109
+ backgroundColor?: string;
110
+ /** Custom opacity (0-1) */
111
+ opacity?: number;
112
+ /** Custom scale factor */
113
+ scale?: number;
114
+ };
115
+ };
116
+ }
117
+ //# sourceMappingURL=config.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"config.d.ts","sourceRoot":"","sources":["../../../src/types/config.ts"],"names":[],"mappings":"AAEA;;GAEG;AACH,MAAM,WAAW,SAAS;IACxB,qBAAqB;IACrB,KAAK,EAAE,MAAM,CAAC;IACd,gCAAgC;IAChC,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB;AAED;;GAEG;AACH,MAAM,WAAW,cAAc;IAC7B,gDAAgD;IAChD,OAAO,EAAE,MAAM,CAAC;IAChB,kCAAkC;IAClC,KAAK,CAAC,EAAE,M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AE;YACN,mBAAmB;YACnB,KAAK,CAAC,EAAE,MAAM,CAAC;YACf,8BAA8B;YAC9B,WAAW,CAAC,EAAE,MAAM,CAAC;YACrB,mEAAmE;YACnE,aAAa,CAAC,EAAE,OAAO,CAAC;YACxB,mCAAmC;YACnC,SAAS,CAAC,EAAE,OAAO,CAAC;YACpB,mBAAmB;YACnB,KAAK,CAAC,EAAE,OAAO,GAAG,MAAM,CAAC;SAC1B,CAAC;QACF,oCAAoC;QACpC,OAAO,CAAC,EAAE;YACR,mDAAmD;YACnD,IAAI,CAAC,EAAE,OAAO,CAAC;YACf,wCAAwC;YACxC,OAAO,CAAC,EAAE,MAAM,CAAC;YACjB,wCAAwC;YACxC,WAAW,CAAC,EAAE,OAAO,CAAC;YACtB,8BAA8B;YAC9B,eAAe,CAAC,EAAE,MAAM,CAAC;YACzB,wBAAwB;YACxB,SAAS,CAAC,EAAE,MAAM,CAAC;SACpB,CAAC;QACF,kCAAkC;QAClC,IAAI,CAAC,EAAE;YACL,sBAAsB;YACtB,QAAQ,CAAC,EAAE,WAAW,GAAG,UAAU,GAAG,cAAc,GAAG,aAAa,GAAG,aAAa,GAAG,cAAc,CAAC;YACtG,wBAAwB;YACxB,KAAK,CAAC,EAAE,MAAM,CAAC;YACf,8BAA8B;YAC9B,eAAe,CAAC,EAAE,MAAM,CAAC;YACzB,2BAA2B;YAC3B,OAAO,CAAC,EAAE,MAAM,CAAC;YACjB,0BAA0B;YAC1B,KAAK,CAAC,EAAE,MAAM,CAAC;SAChB,CAAC;KACH,CAAC;CACH"}
@@ -0,0 +1,12 @@
1
+ /**
2
+ * Interface for the <cv-tabgroup> custom element.
3
+ * Has both HTMLElement and the Svelte component props.
4
+ */
5
+ export interface TabGroupElement extends HTMLElement {
6
+ activeTabId?: string;
7
+ isTabGroupNavHeadingVisible?: boolean;
8
+ pinnedTabId?: string;
9
+ hasTab: (tabId: string) => boolean;
10
+ _listenersAttached?: boolean;
11
+ }
12
+ //# sourceMappingURL=elements.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"elements.d.ts","sourceRoot":"","sources":["../../../src/types/elements.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,MAAM,WAAW,eAAgB,SAAQ,WAAW;IAClD,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,2BAA2B,CAAC,EAAE,OAAO,CAAC;IACtC,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,MAAM,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,OAAO,CAAC;IAGnC,kBAAkB,CAAC,EAAE,OAAO,CAAC;CAC9B"}
@@ -0,0 +1,16 @@
1
+ export type ToggleId = string;
2
+ /**
3
+ * Represents a specific state of a custom view.
4
+ * States contain the list of toggle categories that should be displayed in this state.
5
+ */
6
+ export interface State {
7
+ /** List of toggle categories that should be fully displayed ("Show" state) */
8
+ shownToggles?: ToggleId[];
9
+ /** List of toggle categories that should be in preview mode ("Peek" state) */
10
+ peekToggles?: ToggleId[];
11
+ /** Optional tab selections: groupId -> tabId */
12
+ tabs?: Record<string, string>;
13
+ /** Optional focus selections: array of element IDs */
14
+ focus?: string[];
15
+ }
16
+ //# sourceMappingURL=state.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"state.d.ts","sourceRoot":"","sources":["../../../src/types/state.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,QAAQ,GAAG,MAAM,CAAC;AAE9B;;;GAGG;AACH,MAAM,WAAW,KAAK;IACpB,8EAA8E;IAC9E,YAAY,CAAC,EAAE,QAAQ,EAAE,CAAC;IAC1B,8EAA8E;IAC9E,WAAW,CAAC,EAAE,QAAQ,EAAE,CAAC;IACzB,gDAAgD;IAChD,IAAI,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IAC9B,sDAAsD;IACtD,KAAK,CAAC,EAAE,MAAM,EAAE,CAAC;CAClB"}
@@ -1,130 +1,6 @@
1
- /**
2
- * Represents an individual asset that can be rendered in a custom view.
3
- */
4
- export interface CustomViewAsset {
5
- /** Optional type. If not provided, auto-detected from src/content. */
6
- type?: 'image' | 'text' | 'html' | string;
7
- /** Image source URL */
8
- src?: string;
9
- /** Alt text for images */
10
- alt?: string;
11
- /** Text or HTML content */
12
- content?: string;
13
- /** CSS class name(s) to apply */
14
- className?: string;
15
- /** Inline CSS styles to apply */
16
- style?: string;
17
- [key: string]: any;
18
- }
19
- /**
20
- * Represents a specific state of a custom view.
21
- * States contain the list of toggle categories that should be displayed in this state.
22
- */
23
- export interface State {
24
- /** List of toggle categories that should be fully displayed ("Show" state) */
25
- shownToggles?: ToggleId[];
26
- /** List of toggle categories that should be in preview mode ("Peek" state) */
27
- peekToggles?: ToggleId[];
28
- /** Optional tab selections: groupId -> tabId */
29
- tabs?: Record<string, string>;
30
- /** Optional focus selections: array of element IDs */
31
- focus?: string[];
32
- }
33
- export type ToggleId = string;
34
- /**
35
- * Configuration for a single tab within a tab group
36
- */
37
- export interface TabConfig {
38
- /** Tab identifier */
39
- id: string;
40
- /** Display label for the tab */
41
- label?: string;
42
- }
43
- /**
44
- * Configuration for a tab group
45
- */
46
- export interface TabGroupConfig {
47
- /** Group identifier (stable across the page) */
48
- id: string;
49
- /** Display name for widget/nav */
50
- label?: string;
51
- /** Available tabs in this group */
52
- tabs: TabConfig[];
53
- /** Determines if the tab group is only shown on pages where it's used. */
54
- isLocal?: boolean;
55
- }
56
- /**
57
- * Configuration for a single toggle.
58
- */
59
- export interface ToggleConfig {
60
- /** Toggle identifier */
61
- id: string;
62
- /** Display label for the toggle */
63
- label?: string;
64
- /** Determines if the toggle is only shown on pages where it's used. */
65
- isLocal?: boolean;
66
- }
67
- /**
68
- * Configuration for the site, has default state and list of toggles
69
- */
70
- export interface Config {
71
- /** All available toggle categories */
72
- toggles?: ToggleConfig[];
73
- /** Default state for the site */
74
- defaultState?: State;
75
- /** Optional tab group configurations */
76
- tabGroups?: TabGroupConfig[];
77
- /** Excluded tags and IDs for Share/Focus modes */
78
- shareExclusions?: {
79
- tags?: string[];
80
- ids?: string[];
81
- };
82
- }
83
- /**
84
- * Represents the configuration file structure for CustomViews auto-initialization.
85
- */
86
- export interface ConfigFile {
87
- /** Core configuration object with toggles and defaultState */
88
- config?: Config;
89
- /** Path to the assets JSON file */
90
- assetsJsonPath?: string;
91
- /** Base URL for all paths */
92
- baseUrl?: string;
93
- /** Whether to keep the `view` state parameter visible in the browser URL bar */
94
- showUrl?: boolean;
95
- /** Widget configuration options */
96
- widget?: {
97
- /** Whether the widget is enabled */
98
- enabled?: boolean;
99
- /** Widget position */
100
- position?: 'top-right' | 'top-left' | 'bottom-right' | 'bottom-left' | 'middle-left' | 'middle-right';
101
- /** Widget theme */
102
- theme?: 'light' | 'dark';
103
- /** Whether to show reset button */
104
- showReset?: boolean;
105
- /** Widget title */
106
- title?: string;
107
- /** Widget description text */
108
- description?: string;
109
- /** Whether to show welcome modal on first visit */
110
- showWelcome?: boolean;
111
- /** Welcome modal message */
112
- welcomeMessage?: string;
113
- /** Whether to show tab groups section in widget (default: true) */
114
- showTabGroups?: boolean;
115
- };
116
- }
117
- /**
118
- * Global window interface augmentation for CustomViews
119
- */
120
- declare global {
121
- interface Window {
122
- CustomViews: any;
123
- CustomViewsWidget: any;
124
- customViewsInstance?: {
125
- core: any;
126
- widget?: any;
127
- };
128
- }
129
- }
1
+ export * from './assets';
2
+ export * from './state';
3
+ export * from './config';
4
+ export * from './elements';
5
+ export * from './global';
130
6
  //# sourceMappingURL=types.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/types/types.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,MAAM,WAAW,eAAe;IAC9B,sEAAsE;IACtE,IAAI,CAAC,EAAE,OAAO,GAAG,MAAM,GAAG,MAAM,GAAG,MAAM,CAAC;IAC1C,uBAAuB;IACvB,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,0BAA0B;IAC1B,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,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AG,CAAC;SACd,CAAC;KACH;CACF"}
1
+ {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/types/types.ts"],"names":[],"mappings":"AAAA,cAAc,UAAU,CAAC;AACzB,cAAc,SAAS,CAAC;AACxB,cAAc,UAAU,CAAC;AACzB,cAAc,YAAY,CAAC;AAC3B,cAAc,UAAU,CAAC"}
@@ -1,5 +1,5 @@
1
1
  /**
2
- * Icon utilities for CustomViews widget
2
+ * Icon utilities for CustomViews settings
3
3
  * Centralized SVG icons for better maintainability and reusability
4
4
  */
5
5
  /**
@@ -0,0 +1,24 @@
1
+ import type { ConfigFile } from "../types/types";
2
+ import { CustomViewsSettings } from "../core/settings";
3
+ import type { CustomViewsCore } from "../core/core.svelte";
4
+ /**
5
+ * structure for script attributes
6
+ */
7
+ export interface ScriptAttributes {
8
+ baseURL: string;
9
+ configPath: string;
10
+ }
11
+ /**
12
+ * Finds the script tag that loaded the library and extracts configuration attributes.
13
+ * Looks for `data-base-url` and `data-config-path`.
14
+ */
15
+ export declare function getScriptAttributes(): ScriptAttributes;
16
+ /**
17
+ * Fetches and parses the configuration file.
18
+ */
19
+ export declare function fetchConfig(configPath: string, baseURL: string): Promise<ConfigFile>;
20
+ /**
21
+ * Initializes the settings if enabled in the config.
22
+ */
23
+ export declare function initializeWidget(core: CustomViewsCore, config: ConfigFile): CustomViewsSettings | undefined;
24
+ //# sourceMappingURL=init-utils.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"init-utils.d.ts","sourceRoot":"","sources":["../../../src/utils/init-utils.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,gBAAgB,CAAC;AACjD,OAAO,EAAE,mBAAmB,EAAE,MAAM,kBAAkB,CAAC;AACvD,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,qBAAqB,CAAC;AAE3D;;GAEG;AACH,MAAM,WAAW,gBAAgB;IAC/B,OAAO,EAAE,MAAM,CAAC;IAChB,UAAU,EAAE,MAAM,CAAC;CACpB;AAED;;;GAGG;AACH,wBAAgB,mBAAmB,IAAI,gBAAgB,CA4BtD;AAED;;GAEG;AACH,wBAAsB,WAAW,CAAC,UAAU,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,GAAG,OAAO,CAAC,UAAU,CAAC,CAyB1F;AAED;;GAEG;AACH,wBAAgB,gBAAgB,CAAC,IAAI,EAAE,eAAe,EAAE,MAAM,EAAE,UAAU,GAAG,mBAAmB,GAAG,SAAS,CAa3G"}
@@ -0,0 +1,26 @@
1
+ /**
2
+ * Calculates the height of a fixed or sticky header, if present.
3
+ * This is used to offset scroll positions so content isn't hidden behind the header.
4
+ */
5
+ export declare function getHeaderOffset(): number;
6
+ /**
7
+ * Finds the highest element matching the selector that is currently in the viewport.
8
+ * @param selector The CSS selector to match elements against.
9
+ * @returns The HTMLElement of the highest visible element, or null if none are found.
10
+ */
11
+ export declare function findHighestVisibleElement(selector: string): HTMLElement | null;
12
+ /**
13
+ * Scrolls the page to align the element to the top of the viewport,
14
+ * accounting for fixed/sticky headers and adding some padding.
15
+ * @param element The element to scroll to.
16
+ */
17
+ export declare function scrollToElement(element: HTMLElement): void;
18
+ /**
19
+ * Adjusts the scroll position to keep a specific element in the same visual location.
20
+ * Useful when content additions/removals above might cause jumps.
21
+ */
22
+ export declare function handleScrollAnchor(scrollAnchor: {
23
+ element: HTMLElement;
24
+ top: number;
25
+ }): void;
26
+ //# sourceMappingURL=scroll-utils.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"scroll-utils.d.ts","sourceRoot":"","sources":["../../../src/utils/scroll-utils.ts"],"names":[],"mappings":"AACA;;;GAGG;AACH,wBAAgB,eAAe,IAAI,MAAM,CAQxC;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"}
package/package.json CHANGED
@@ -1,11 +1,11 @@
1
1
  {
2
2
  "name": "@customviews-js/customviews",
3
- "version": "1.4.1-beta.1",
3
+ "version": "1.4.1-beta.3",
4
4
  "description": "A JavaScript dynamic custom views Library.",
5
5
  "type": "module",
6
6
  "types": "dist/index.d.ts",
7
7
  "main": "dist/custom-views.min.js",
8
- "module": "dist/custom-views.core.esm.js",
8
+ "module": "dist/custom-views.esm.js",
9
9
  "browser": "dist/custom-views.min.js",
10
10
  "unpkg": "dist/custom-views.min.js",
11
11
  "jsdelivr": "dist/custom-views.min.js",
@@ -19,13 +19,13 @@
19
19
  "exports": {
20
20
  ".": {
21
21
  "types": "./dist/index.d.ts",
22
- "import": "./dist/custom-views.min.js",
22
+ "import": "./dist/custom-views.esm.js",
23
23
  "require": "./dist/custom-views.min.js",
24
24
  "browser": "./dist/custom-views.min.js"
25
25
  },
26
26
  "./core": {
27
- "import": "./dist/custom-views.core.esm.js",
28
- "require": "./dist/custom-views.core.cjs.js"
27
+ "import": "./dist/custom-views.esm.js",
28
+ "require": "./dist/custom-views.cjs.js"
29
29
  }
30
30
  },
31
31
  "scripts": {
@@ -51,13 +51,18 @@
51
51
  "author": "Chan Ger Teck",
52
52
  "license": "MIT",
53
53
  "devDependencies": {
54
+ "@rollup/plugin-node-resolve": "^16.0.3",
54
55
  "@rollup/plugin-terser": "^0.4.4",
55
56
  "@rollup/plugin-typescript": "^12.1.4",
57
+ "@tsconfig/svelte": "^5.0.6",
56
58
  "@types/jsdom": "^27.0.0",
57
59
  "@types/node": "^24.3.1",
58
60
  "jsdom": "^27.0.0",
59
61
  "rimraf": "^6.0.1",
60
62
  "rollup": "^4.46.2",
63
+ "rollup-plugin-svelte": "^7.2.3",
64
+ "svelte": "^5.46.1",
65
+ "svelte-preprocess": "^6.0.3",
61
66
  "tslib": "^2.8.1",
62
67
  "typescript": "^5.9.2",
63
68
  "vitest": "^3.2.4"