feather-k-demo-utils 0.0.4 → 0.0.7
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.
|
@@ -3,4 +3,8 @@
|
|
|
3
3
|
* Returns the version as a string, or null if not found.
|
|
4
4
|
*/
|
|
5
5
|
export declare const getFeatherkStylesVersionFromUrl: (url: string) => string | null;
|
|
6
|
+
/**
|
|
7
|
+
* The resolved FeatherK styles version (evaluated at import time).
|
|
8
|
+
*/
|
|
9
|
+
export declare const FEATHERK_STYLES_VERSION: string | null;
|
|
6
10
|
export declare const featherkStylesVersion: string | null;
|
package/lib/utils/cdnVersion.js
CHANGED
|
@@ -1,10 +1,14 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { FEATHERK_STYLES_CDN_URL } from "./constants";
|
|
2
2
|
/**
|
|
3
3
|
* Extracts the version string (e.g. "1.2.3" or "latest") from a CDN URL for @featherk/styles.
|
|
4
4
|
* Returns the version as a string, or null if not found.
|
|
5
5
|
*/
|
|
6
6
|
export const getFeatherkStylesVersionFromUrl = (url) => {
|
|
7
7
|
const match = url.match(/@featherk\/styles@([^/]+)\//);
|
|
8
|
-
return match && typeof match[1] ===
|
|
8
|
+
return match && typeof match[1] === "string" ? match[1] : null;
|
|
9
9
|
};
|
|
10
|
-
|
|
10
|
+
/**
|
|
11
|
+
* The resolved FeatherK styles version (evaluated at import time).
|
|
12
|
+
*/
|
|
13
|
+
export const FEATHERK_STYLES_VERSION = getFeatherkStylesVersionFromUrl(FEATHERK_STYLES_CDN_URL);
|
|
14
|
+
export const featherkStylesVersion = FEATHERK_STYLES_VERSION;
|
package/lib/utils/constants.d.ts
CHANGED
|
@@ -3,3 +3,7 @@
|
|
|
3
3
|
* Uses import.meta.env.VITE_FEATHERK_STYLES_CDN_URL if available (Vite), otherwise falls back to the default CDN URL.
|
|
4
4
|
*/
|
|
5
5
|
export declare function getFeatherKStylesCdnUrl(): string;
|
|
6
|
+
/**
|
|
7
|
+
* The resolved FeatherK styles CDN URL (evaluated at import time).
|
|
8
|
+
*/
|
|
9
|
+
export declare const FEATHERK_STYLES_CDN_URL: string;
|
package/lib/utils/constants.js
CHANGED
|
@@ -14,3 +14,7 @@ export function getFeatherKStylesCdnUrl() {
|
|
|
14
14
|
}
|
|
15
15
|
return "https://cdn.jsdelivr.net/npm/@featherk/styles@latest/dist/styles.css";
|
|
16
16
|
}
|
|
17
|
+
/**
|
|
18
|
+
* The resolved FeatherK styles CDN URL (evaluated at import time).
|
|
19
|
+
*/
|
|
20
|
+
export const FEATHERK_STYLES_CDN_URL = getFeatherKStylesCdnUrl();
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "feather-k-demo-utils",
|
|
3
3
|
"private": false,
|
|
4
|
-
"version": "0.0.
|
|
4
|
+
"version": "0.0.7",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "lib/index.js",
|
|
7
7
|
"module": "lib/index.js",
|
|
@@ -22,7 +22,10 @@
|
|
|
22
22
|
],
|
|
23
23
|
"exports": {
|
|
24
24
|
"./utils": "./lib/utils/index.js",
|
|
25
|
-
"./styles":
|
|
25
|
+
"./styles": {
|
|
26
|
+
"default": "./lib/styles/demo.css",
|
|
27
|
+
"types": "./lib/styles/styles.d.ts"
|
|
28
|
+
}
|
|
26
29
|
},
|
|
27
30
|
"scripts": {
|
|
28
31
|
"dev": "vite",
|
|
@@ -46,6 +49,7 @@
|
|
|
46
49
|
},
|
|
47
50
|
"files": [
|
|
48
51
|
"lib/utils",
|
|
49
|
-
"lib/styles"
|
|
52
|
+
"lib/styles",
|
|
53
|
+
"lib/styles/styles.d.ts"
|
|
50
54
|
]
|
|
51
55
|
}
|