@customviews-js/customviews 1.1.10 → 1.1.11
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +18 -362
- package/dist/custom-views.core.cjs.js +1766 -1530
- package/dist/custom-views.core.cjs.js.map +1 -1
- package/dist/custom-views.core.esm.js +1766 -1530
- package/dist/custom-views.core.esm.js.map +1 -1
- package/dist/custom-views.esm.js +1766 -1530
- package/dist/custom-views.esm.js.map +1 -1
- package/dist/custom-views.js +1733 -1497
- package/dist/custom-views.js.map +1 -1
- package/dist/custom-views.min.js +2 -2
- package/dist/custom-views.min.js.map +1 -1
- package/dist/types/core/assets-manager.d.ts +1 -1
- package/dist/types/core/assets-manager.d.ts.map +1 -1
- package/dist/types/core/core.d.ts +10 -1
- package/dist/types/core/core.d.ts.map +1 -1
- package/dist/types/core/render.d.ts +1 -1
- package/dist/types/core/render.d.ts.map +1 -1
- package/dist/types/core/tab-manager.d.ts +7 -2
- package/dist/types/core/tab-manager.d.ts.map +1 -1
- package/dist/types/styles/tab-styles.d.ts +1 -1
- package/dist/types/styles/tab-styles.d.ts.map +1 -1
- package/dist/types/utils/icons.d.ts +1 -0
- package/dist/types/utils/icons.d.ts.map +1 -1
- package/dist/types/utils/scroll-manager.d.ts +26 -0
- package/dist/types/utils/scroll-manager.d.ts.map +1 -0
- package/package.json +63 -62
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"assets-manager.d.ts","sourceRoot":"","sources":["../../../src/core/assets-manager.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"assets-manager.d.ts","sourceRoot":"","sources":["../../../src/core/assets-manager.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,gBAAgB,CAAC;AAEtD,qBAAa,aAAa;IACxB,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,eAAe,CAAC,CAAC;IACxC,OAAO,CAAC,OAAO,CAAS;gBAEZ,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,eAAe,CAAC,EAAE,OAAO,GAAE,MAAW;IASzE,QAAQ,IAAI,OAAO;IAInB,GAAG,CAAC,OAAO,EAAE,MAAM,GAAG,eAAe,GAAG,SAAS;IAgBjD,OAAO,CAAC,cAAc;IAatB,YAAY,CAAC,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,eAAe,CAAC;IAIlD,oBAAoB,CAAC,gBAAgB,EAAE,MAAM,CAAC,MAAM,EAAE,eAAe,CAAC;CAIvE"}
|
|
@@ -39,8 +39,17 @@ export declare class CustomViewsCore {
|
|
|
39
39
|
private loadAndCallApplyState;
|
|
40
40
|
/**
|
|
41
41
|
* Apply a custom state, saves to localStorage and updates the URL
|
|
42
|
+
* Add 'source' in options to indicate the origin of the state change
|
|
43
|
+
* (e.g., 'widget' to trigger scroll behavior)
|
|
44
|
+
* Add scrollAnchor in options to maintain scroll position of a specific element
|
|
42
45
|
*/
|
|
43
|
-
applyState(state: State
|
|
46
|
+
applyState(state: State, options?: {
|
|
47
|
+
source?: string;
|
|
48
|
+
scrollAnchor?: {
|
|
49
|
+
element: HTMLElement;
|
|
50
|
+
top: number;
|
|
51
|
+
};
|
|
52
|
+
}): void;
|
|
44
53
|
/** Render all toggles for the current state */
|
|
45
54
|
private renderState;
|
|
46
55
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"core.d.ts","sourceRoot":"","sources":["../../../src/core/core.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,KAAK,EAAE,cAAc,EAAE,MAAM,EAAE,MAAM,gBAAgB,CAAC;AACpE,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;
|
|
1
|
+
{"version":3,"file":"core.d.ts","sourceRoot":"","sources":["../../../src/core/core.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,KAAK,EAAE,cAAc,EAAE,MAAM,E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AE;IAY1C;;OAEG;IACI,gBAAgB;IAWhB,SAAS,CAAC,IAAI,EAAE,MAAM,EAAE,KAAK,EAAE,OAAO,GAAG,IAAI;IAuBpD;;OAEG;IACI,sBAAsB,CAAC,QAAQ,EAAE,MAAM,IAAI,GAAG,IAAI;IAIzD;;OAEG;IACI,yBAAyB,CAAC,QAAQ,EAAE,MAAM,IAAI,GAAG,IAAI;IAO5D;;OAEG;IACH,OAAO,CAAC,0BAA0B;IAUlC;;OAEG;IACI,uBAAuB,CAAC,OAAO,EAAE,OAAO,GAAG,IAAI;IAItD;;OAEG;IACI,4BAA4B,IAAI,OAAO,GAAG,IAAI;IAIrD,OAAO,CAAC,UAAU;IAKlB,OAAO,CAAC,uBAAuB;CAYhC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"render.d.ts","sourceRoot":"","sources":["../../../src/core/render.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"render.d.ts","sourceRoot":"","sources":["../../../src/core/render.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;AAoEtD,wBAAgB,eAAe,CAC7B,EAAE,EAAE,WAAW,EACf,OAAO,EAAE,MAAM,EACf,aAAa,EAAE,aAAa,QAqB7B"}
|
|
@@ -7,7 +7,7 @@ export declare class TabManager {
|
|
|
7
7
|
/**
|
|
8
8
|
* Apply tab selections to all tab groups in the DOM
|
|
9
9
|
*/
|
|
10
|
-
static
|
|
10
|
+
static applyTabSelections(rootEl: HTMLElement, tabs: Record<string, string>, cfgGroups?: TabGroupConfig[]): void;
|
|
11
11
|
/**
|
|
12
12
|
* Resolve the active tab for a group based on state, config, and DOM
|
|
13
13
|
*
|
|
@@ -27,7 +27,7 @@ export declare class TabManager {
|
|
|
27
27
|
*/
|
|
28
28
|
private static extractTabContent;
|
|
29
29
|
/**
|
|
30
|
-
* Build navigation for tab groups
|
|
30
|
+
* Build navigation for tab groups (one-time setup)
|
|
31
31
|
*/
|
|
32
32
|
static buildNavs(rootEl: HTMLElement, cfgGroups?: TabGroupConfig[], onTabClick?: (groupId: string, tabId: string, groupEl: HTMLElement) => void, onTabDoubleClick?: (groupId: string, tabId: string, groupEl: HTMLElement) => void): void;
|
|
33
33
|
/**
|
|
@@ -64,5 +64,10 @@ export declare class TabManager {
|
|
|
64
64
|
* Returns array of group elements to be synced (excluding source).
|
|
65
65
|
*/
|
|
66
66
|
static getTabgroupsWithId(rootEl: HTMLElement, sourceGroupId: string, tabId: string): HTMLElement[];
|
|
67
|
+
/**
|
|
68
|
+
* Update pin icon visibility for all tab groups based on current state.
|
|
69
|
+
* Shows pin icon for tabs that are in the persisted state (i.e., have been double-clicked).
|
|
70
|
+
*/
|
|
71
|
+
static updatePinIcons(rootEl: HTMLElement, tabs: Record<string, string>): void;
|
|
67
72
|
}
|
|
68
73
|
//# sourceMappingURL=tab-manager.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tab-manager.d.ts","sourceRoot":"","sources":["../../../src/core/tab-manager.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,gBAAgB,CAAC;
|
|
1
|
+
{"version":3,"file":"tab-manager.d.ts","sourceRoot":"","sources":["../../../src/core/tab-manager.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,gBAAgB,CAAC;AAYrD,qBAAa,UAAU;IACrB;;OAEG;IACH,OAAO,CAAC,MAAM,CAAC,WAAW;IAM1B;;OAEG;WACW,kBAAkB,CAC9B,MAAM,EAAE,WAAW,EACnB,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,EAC5B,SAAS,CAAC,EAAE,cAAc,EAAE,GAC3B,IAAI;IA2CP;;;;OAIG;IACH,OAAO,CAAC,MAAM,CAAC,wBAAwB;IAqCvC;;OAEG;IACH,OAAO,CAAC,M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M,CAAC,GAC3B,IAAI;CA+BR"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Styles for tab groups and tab navigation
|
|
3
3
|
*/
|
|
4
|
-
export declare const TAB_STYLES = "\n/* Tab navigation styles - Bootstrap-style tabs matching MarkBind */\n.cv-tabs-nav {\n display: flex;\n flex-wrap: wrap;\n padding-left: 0;\n margin-top: 0.5rem;\n margin-bottom: 1rem;\n list-style: none;\n border-bottom: 1px solid #dee2e6;\n\n align-items: stretch;\n}\n\n.cv-tabs-nav .nav-item {\n margin-bottom: -1px;\n list-style: none;\n display: flex; /* was inline-block \u2192 make flex to stretch height */\n align-items: stretch; /* stretch link to full height */\n}\n\n.cv-tabs-nav .nav-link {\n display: flex;\n align-items: center;\n justify-content: center;\n padding: 0.5rem 1rem;\n color: #495057;\n text-decoration: none;\n background-color: transparent;\n border: 1px solid transparent;\n border-top-left-radius: 0.25rem;\n border-top-right-radius: 0.25rem;\n transition: color 0.15s ease-in-out, background-color 0.15s ease-in-out, border-color 0.15s ease-in-out;\n cursor: pointer;\n min-height: 2.5rem;\n box-sizing: border-box;\n}\n\n.cv-tabs-nav .nav-link p {\n margin: 0; /* remove default margins */\n display: inline; /* or inline-block */\n}\n\n.cv-tabs-nav .nav-link:hover,\n.cv-tabs-nav .nav-link:focus {\n border-color: #e9ecef #e9ecef #dee2e6;\n isolation: isolate;\n}\n\n.cv-tabs-nav .nav-link.active {\n color: #495057;\n background-color: #fff;\n border-color: #dee2e6 #dee2e6 #fff;\n}\n\n.cv-tabs-nav .nav-link:focus {\n outline: 0;\n box-shadow: 0 0 0 0.25rem rgba(13, 110, 253, 0.25);\n}\n\n/* Legacy button-based nav (deprecated, kept for compatibility) */\n.cv-tabs-nav-item {\n background: none;\n border: none;\n border-bottom: 2px solid transparent;\n padding: 0.5rem 1rem;\n cursor: pointer;\n font-size: 1rem;\n color: #6c757d;\n transition: color 150ms ease, border-color 150ms ease;\n}\n\n.cv-tabs-nav-item:hover {\n color: #495057;\n border-bottom-color: #dee2e6;\n}\n\n.cv-tabs-nav-item.active {\n color: #007bff;\n border-bottom-color: #007bff;\n font-weight: 500;\n}\n\n.cv-tabs-nav-item:focus {\n outline: 2px solid #007bff;\n outline-offset: 2px;\n}\n\n/* Tab panel base styles */\ncv-tab {\n display: block;\n}\n\n/* Hide cv-tab-header source element; content is extracted to nav link */\ncv-tab-header {\n display: none !important;\n}\n\n/* Allow cv-tab-body to flow naturally */\ncv-tab-body {\n display: block;\n}\n\n/* Override visibility for tab panels - use display instead of collapse animation */\ncv-tab.cv-hidden {\n display: none !important;\n}\n\ncv-tab.cv-visible {\n display: block !important;\n}\n\ncv-tabgroup {\n display: block;\n margin-bottom: 1.5rem;\n}\n\n/* Bottom border line for tab groups */\n.cv-tabgroup-bottom-border {\n border-bottom: 1px solid #dee2e6;\n margin-top: 1rem;\n}\n\n/* Tab content wrapper */\n.cv-tab-content {\n padding: 1rem 0;\n}\n\n/* Viewer-controlled nav visibility: hide nav containers when requested */\n.cv-tabs-nav-hidden {\n display: none !important;\n}\n\n/* Print-friendly: hide tab navigation when printing to reduce clutter */\n@media print {\n .cv-tabs-nav {\n display: none !important;\n }\n}\n";
|
|
4
|
+
export declare const TAB_STYLES = "\n/* Tab navigation styles - Bootstrap-style tabs matching MarkBind */\n.cv-tabs-nav {\n display: flex;\n flex-wrap: wrap;\n padding-left: 0;\n margin-top: 0.5rem;\n margin-bottom: 1rem;\n list-style: none;\n border-bottom: 1px solid #dee2e6;\n\n align-items: stretch;\n}\n\n.cv-tabs-nav .nav-item {\n margin-bottom: -1px;\n list-style: none;\n display: flex; /* was inline-block \u2192 make flex to stretch height */\n align-items: stretch; /* stretch link to full height */\n}\n\n.cv-tabs-nav .nav-link {\n display: flex;\n align-items: center;\n justify-content: center;\n padding: 0.5rem 1rem;\n color: #495057;\n text-decoration: none;\n background-color: transparent;\n border: 1px solid transparent;\n border-top-left-radius: 0.25rem;\n border-top-right-radius: 0.25rem;\n transition: color 0.15s ease-in-out, background-color 0.15s ease-in-out, border-color 0.15s ease-in-out;\n cursor: pointer;\n min-height: 2.5rem;\n box-sizing: border-box;\n}\n\n.cv-tabs-nav .nav-link p {\n margin: 0; /* remove default margins */\n display: inline; /* or inline-block */\n}\n\n/* Tab header container with pin icon */\n.cv-tab-header-container {\n display: flex;\n align-items: center;\n gap: 0.5rem;\n}\n\n.cv-tab-header-text {\n flex: 1;\n}\n\n.cv-tab-pin-icon {\n display: inline-block;\n line-height: 0;\n flex-shrink: 0;\n}\n\n.cv-tab-pin-icon svg {\n vertical-align: middle;\n width: 14px;\n height: 14px;\n}\n\n.cv-tabs-nav .nav-link:hover,\n.cv-tabs-nav .nav-link:focus {\n border-color: #e9ecef #e9ecef #dee2e6;\n isolation: isolate;\n}\n\n.cv-tabs-nav .nav-link.active {\n color: #495057;\n background-color: #fff;\n border-color: #dee2e6 #dee2e6 #fff;\n}\n\n.cv-tabs-nav .nav-link:focus {\n outline: 0;\n box-shadow: 0 0 0 0.25rem rgba(13, 110, 253, 0.25);\n}\n\n/* Legacy button-based nav (deprecated, kept for compatibility) */\n.cv-tabs-nav-item {\n background: none;\n border: none;\n border-bottom: 2px solid transparent;\n padding: 0.5rem 1rem;\n cursor: pointer;\n font-size: 1rem;\n color: #6c757d;\n transition: color 150ms ease, border-color 150ms ease;\n}\n\n.cv-tabs-nav-item:hover {\n color: #495057;\n border-bottom-color: #dee2e6;\n}\n\n.cv-tabs-nav-item.active {\n color: #007bff;\n border-bottom-color: #007bff;\n font-weight: 500;\n}\n\n.cv-tabs-nav-item:focus {\n outline: 2px solid #007bff;\n outline-offset: 2px;\n}\n\n/* Tab panel base styles */\ncv-tab {\n display: block;\n}\n\n/* Hide cv-tab-header source element; content is extracted to nav link */\ncv-tab-header {\n display: none !important;\n}\n\n/* Allow cv-tab-body to flow naturally */\ncv-tab-body {\n display: block;\n}\n\n/* Override visibility for tab panels - use display instead of collapse animation */\ncv-tab.cv-hidden {\n display: none !important;\n}\n\ncv-tab.cv-visible {\n display: block !important;\n}\n\ncv-tabgroup {\n display: block;\n margin-bottom: 1.5rem;\n}\n\n/* Bottom border line for tab groups */\n.cv-tabgroup-bottom-border {\n border-bottom: 1px solid #dee2e6;\n margin-top: 1rem;\n}\n\n/* Tab content wrapper */\n.cv-tab-content {\n padding: 1rem 0;\n}\n\n/* Viewer-controlled nav visibility: hide nav containers when requested */\n.cv-tabs-nav-hidden {\n display: none !important;\n}\n\n/* Print-friendly: hide tab navigation when printing to reduce clutter */\n@media print {\n .cv-tabs-nav {\n display: none !important;\n }\n}\n";
|
|
5
5
|
//# sourceMappingURL=tab-styles.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tab-styles.d.ts","sourceRoot":"","sources":["../../../src/styles/tab-styles.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,eAAO,MAAM,UAAU,
|
|
1
|
+
{"version":3,"file":"tab-styles.d.ts","sourceRoot":"","sources":["../../../src/styles/tab-styles.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,eAAO,MAAM,UAAU,03GAkKtB,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"icons.d.ts","sourceRoot":"","sources":["../../../src/utils/icons.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH;;GAEG;AACH,wBAAgB,WAAW,IAAI,MAAM,CAKpC;AAED;;GAEG;AACH,wBAAgB,YAAY,IAAI,MAAM,CAIrC;AAED;;GAEG;AACH,wBAAgB,YAAY,IAAI,MAAM,CAIrC;AAED;;GAEG;AACH,wBAAgB,WAAW,IAAI,MAAM,CAYpC;AAED,wBAAgB,WAAW,IAAI,MAAM,CAKpC;AAED,wBAAgB,mBAAmB,IAAI,MAAM,CAmB5C;AAED,wBAAgB,oBAAoB,IAAI,MAAM,CAU7C;AAED;;GAEG;AACH,wBAAgB,YAAY,IAAI,MAAM,CAmBrC"}
|
|
1
|
+
{"version":3,"file":"icons.d.ts","sourceRoot":"","sources":["../../../src/utils/icons.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH;;GAEG;AACH,wBAAgB,WAAW,IAAI,MAAM,CAKpC;AAED;;GAEG;AACH,wBAAgB,YAAY,IAAI,MAAM,CAIrC;AAED;;GAEG;AACH,wBAAgB,YAAY,IAAI,MAAM,CAIrC;AAED;;GAEG;AACH,wBAAgB,WAAW,IAAI,MAAM,CAYpC;AAED,wBAAgB,WAAW,IAAI,MAAM,CAKpC;AAED,wBAAgB,mBAAmB,IAAI,MAAM,CAmB5C;AAED,wBAAgB,oBAAoB,IAAI,MAAM,CAU7C;AAED;;GAEG;AACH,wBAAgB,YAAY,IAAI,MAAM,CAmBrC;AAGD,wBAAgB,UAAU,CAAC,QAAQ,GAAE,OAAe,GAAG,MAAM,CAU5D"}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
export declare class ScrollManager {
|
|
2
|
+
/**
|
|
3
|
+
* Finds the highest tab group currently in the viewport.
|
|
4
|
+
* This is intended to be called BEFORE the state changes, to identify which element to scroll to.
|
|
5
|
+
* @returns The HTMLElement of the highest visible tab group, or null if none are found.
|
|
6
|
+
*/
|
|
7
|
+
static findHighestVisibleTabGroup(): HTMLElement | null;
|
|
8
|
+
/**
|
|
9
|
+
* Scrolls the page to align the given tab group's header (or the group itself)
|
|
10
|
+
* to the top of the viewport, accounting for a fixed/sticky page header.
|
|
11
|
+
* This should be called AFTER the content has changed.
|
|
12
|
+
* @param groupEl The tab group element to scroll to.
|
|
13
|
+
*/
|
|
14
|
+
static scrollToTabGroup(groupEl: HTMLElement): void;
|
|
15
|
+
/**
|
|
16
|
+
* Adjusts the scroll position to keep a specific element in the same visual location
|
|
17
|
+
* after a content change. This is useful for preventing the page from jumping when
|
|
18
|
+
* content above the element is added or removed.
|
|
19
|
+
* @param scrollAnchor An object containing the element to anchor and its initial top position.
|
|
20
|
+
*/
|
|
21
|
+
static handleScrollAnchor(scrollAnchor: {
|
|
22
|
+
element: HTMLElement;
|
|
23
|
+
top: number;
|
|
24
|
+
}): void;
|
|
25
|
+
}
|
|
26
|
+
//# sourceMappingURL=scroll-manager.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"scroll-manager.d.ts","sourceRoot":"","sources":["../../../src/utils/scroll-manager.ts"],"names":[],"mappings":"AAEA,qBAAa,aAAa;IACxB;;;;OAIG;WACW,0BAA0B,IAAI,WAAW,GAAG,IAAI;IA8C9D;;;;;OAKG;WACW,gBAAgB,CAAC,OAAO,EAAE,WAAW,GAAG,IAAI;IA8B1D;;;;;OAKG;WACW,kBAAkB,CAAC,YAAY,EAAE;QAAE,OAAO,EAAE,WAAW,CAAC;QAAC,GAAG,EAAE,MAAM,CAAA;KAAE,GAAG,IAAI;CAe5F"}
|
package/package.json
CHANGED
|
@@ -1,62 +1,63 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "@customviews-js/customviews",
|
|
3
|
-
"version": "1.1.
|
|
4
|
-
"description": "A JavaScript dynamic custom views Library.",
|
|
5
|
-
"type": "module",
|
|
6
|
-
"types": "dist/index.d.ts",
|
|
7
|
-
"main": "dist/custom-views.min.js",
|
|
8
|
-
"module": "dist/custom-views.core.esm.js",
|
|
9
|
-
"browser": "dist/custom-views.min.js",
|
|
10
|
-
"unpkg": "dist/custom-views.min.js",
|
|
11
|
-
"jsdelivr": "dist/custom-views.min.js",
|
|
12
|
-
"repository": {
|
|
13
|
-
"type": "git",
|
|
14
|
-
"url": "https://github.com/customviews-js/customviews.git"
|
|
15
|
-
},
|
|
16
|
-
"files": [
|
|
17
|
-
"dist/"
|
|
18
|
-
],
|
|
19
|
-
"exports": {
|
|
20
|
-
".": {
|
|
21
|
-
"types": "./dist/index.d.ts",
|
|
22
|
-
"import": "./dist/custom-views.min.js",
|
|
23
|
-
"require": "./dist/custom-views.min.js",
|
|
24
|
-
"browser": "./dist/custom-views.min.js"
|
|
25
|
-
},
|
|
26
|
-
"./core": {
|
|
27
|
-
"import": "./dist/custom-views.core.esm.js",
|
|
28
|
-
"require": "./dist/custom-views.core.cjs.js"
|
|
29
|
-
}
|
|
30
|
-
},
|
|
31
|
-
"scripts": {
|
|
32
|
-
"clean": "rimraf dist",
|
|
33
|
-
"build:types": "tsc --project tsconfig.json",
|
|
34
|
-
"build:js": "rollup -c",
|
|
35
|
-
"build": "npm run clean && npm run build:types && npm run build:js",
|
|
36
|
-
"dev": "rollup -c -w",
|
|
37
|
-
"test": "vitest run",
|
|
38
|
-
"test:watch": "vitest"
|
|
39
|
-
},
|
|
40
|
-
"keywords": [
|
|
41
|
-
"javascript",
|
|
42
|
-
"library",
|
|
43
|
-
"custom views"
|
|
44
|
-
],
|
|
45
|
-
"author": "Chan Ger Teck",
|
|
46
|
-
"license": "MIT",
|
|
47
|
-
"devDependencies": {
|
|
48
|
-
"@rollup/plugin-terser": "^0.4.4",
|
|
49
|
-
"@rollup/plugin-typescript": "^12.1.4",
|
|
50
|
-
"@types/
|
|
51
|
-
"
|
|
52
|
-
"
|
|
53
|
-
"
|
|
54
|
-
"
|
|
55
|
-
"
|
|
56
|
-
"
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
1
|
+
{
|
|
2
|
+
"name": "@customviews-js/customviews",
|
|
3
|
+
"version": "1.1.11",
|
|
4
|
+
"description": "A JavaScript dynamic custom views Library.",
|
|
5
|
+
"type": "module",
|
|
6
|
+
"types": "dist/index.d.ts",
|
|
7
|
+
"main": "dist/custom-views.min.js",
|
|
8
|
+
"module": "dist/custom-views.core.esm.js",
|
|
9
|
+
"browser": "dist/custom-views.min.js",
|
|
10
|
+
"unpkg": "dist/custom-views.min.js",
|
|
11
|
+
"jsdelivr": "dist/custom-views.min.js",
|
|
12
|
+
"repository": {
|
|
13
|
+
"type": "git",
|
|
14
|
+
"url": "https://github.com/customviews-js/customviews.git"
|
|
15
|
+
},
|
|
16
|
+
"files": [
|
|
17
|
+
"dist/"
|
|
18
|
+
],
|
|
19
|
+
"exports": {
|
|
20
|
+
".": {
|
|
21
|
+
"types": "./dist/index.d.ts",
|
|
22
|
+
"import": "./dist/custom-views.min.js",
|
|
23
|
+
"require": "./dist/custom-views.min.js",
|
|
24
|
+
"browser": "./dist/custom-views.min.js"
|
|
25
|
+
},
|
|
26
|
+
"./core": {
|
|
27
|
+
"import": "./dist/custom-views.core.esm.js",
|
|
28
|
+
"require": "./dist/custom-views.core.cjs.js"
|
|
29
|
+
}
|
|
30
|
+
},
|
|
31
|
+
"scripts": {
|
|
32
|
+
"clean": "rimraf dist",
|
|
33
|
+
"build:types": "tsc --project tsconfig.json",
|
|
34
|
+
"build:js": "rollup -c",
|
|
35
|
+
"build": "npm run clean && npm run build:types && npm run build:js",
|
|
36
|
+
"dev": "rollup -c -w",
|
|
37
|
+
"test": "vitest run",
|
|
38
|
+
"test:watch": "vitest"
|
|
39
|
+
},
|
|
40
|
+
"keywords": [
|
|
41
|
+
"javascript",
|
|
42
|
+
"library",
|
|
43
|
+
"custom views"
|
|
44
|
+
],
|
|
45
|
+
"author": "Chan Ger Teck",
|
|
46
|
+
"license": "MIT",
|
|
47
|
+
"devDependencies": {
|
|
48
|
+
"@rollup/plugin-terser": "^0.4.4",
|
|
49
|
+
"@rollup/plugin-typescript": "^12.1.4",
|
|
50
|
+
"@types/jsdom": "^27.0.0",
|
|
51
|
+
"@types/node": "^24.3.1",
|
|
52
|
+
"jsdom": "^27.0.0",
|
|
53
|
+
"rimraf": "^6.0.1",
|
|
54
|
+
"rollup": "^4.46.2",
|
|
55
|
+
"tslib": "^2.8.1",
|
|
56
|
+
"typescript": "^5.9.2",
|
|
57
|
+
"vitest": "^3.2.4"
|
|
58
|
+
},
|
|
59
|
+
"bugs": {
|
|
60
|
+
"url": "https://github.com/customviews-js/customviews/issues"
|
|
61
|
+
},
|
|
62
|
+
"homepage": "https://github.com/customviews-js/customviews#readme"
|
|
63
|
+
}
|