@_linked/shape-ui 2.3.2 → 2.3.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.
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
export declare function generateRandomName(format: string): string;
|
|
2
|
+
/**
|
|
3
|
+
* Fixes the image path for Android devices during development.
|
|
4
|
+
* Replaces 'localhost' with the appropriate site root URL.
|
|
5
|
+
* @param croppedImage
|
|
6
|
+
* @returns
|
|
7
|
+
*/
|
|
8
|
+
export declare function replaceLocalhostWithSiteRoot(croppedImage: string): string;
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { Capacitor } from '@capacitor/core';
|
|
2
|
+
// currently use for generate
|
|
3
|
+
export function generateRandomName(format) {
|
|
4
|
+
const timestamp = new Date().getTime();
|
|
5
|
+
const randomString = Math.random().toString(15).substring(7); // Generate a random string
|
|
6
|
+
return format
|
|
7
|
+
? `${timestamp}_${randomString}.${format}`
|
|
8
|
+
: `${timestamp}_${randomString}`;
|
|
9
|
+
}
|
|
10
|
+
/**
|
|
11
|
+
* Fixes the image path for Android devices during development.
|
|
12
|
+
* Replaces 'localhost' with the appropriate site root URL.
|
|
13
|
+
* @param croppedImage
|
|
14
|
+
* @returns
|
|
15
|
+
*/
|
|
16
|
+
export function replaceLocalhostWithSiteRoot(croppedImage) {
|
|
17
|
+
let imageSrc = croppedImage;
|
|
18
|
+
if (imageSrc &&
|
|
19
|
+
process.env.NODE_ENV !== 'production' &&
|
|
20
|
+
Capacitor.getPlatform() === 'android') {
|
|
21
|
+
if (imageSrc.includes('localhost')) {
|
|
22
|
+
imageSrc = imageSrc.replace(/http\:\/\/localhost\:\d+/, process.env.SITE_ROOT);
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
return imageSrc;
|
|
26
|
+
}
|
|
27
|
+
//# sourceMappingURL=helper.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"helper.js","sourceRoot":"","sources":["../../../src/utils/helper.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAE5C,6BAA6B;AAC7B,MAAM,UAAU,kBAAkB,CAAC,MAAc;IAC/C,MAAM,SAAS,GAAG,IAAI,IAAI,EAAE,CAAC,OAAO,EAAE,CAAC;IACvC,MAAM,YAAY,GAAG,IAAI,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,EAAE,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,CAAC,CAAC,2BAA2B;IAEzF,OAAO,MAAM;QACX,CAAC,CAAC,GAAG,SAAS,IAAI,YAAY,IAAI,MAAM,EAAE;QAC1C,CAAC,CAAC,GAAG,SAAS,IAAI,YAAY,EAAE,CAAC;AACrC,CAAC;AAED;;;;;GAKG;AACH,MAAM,UAAU,4BAA4B,CAAC,YAAoB;IAC/D,IAAI,QAAQ,GAAG,YAAY,CAAC;IAC5B,IACE,QAAQ;QACR,OAAO,CAAC,GAAG,CAAC,QAAQ,KAAK,YAAY;QACrC,SAAS,CAAC,WAAW,EAAE,KAAK,SAAS,EACrC,CAAC;QACD,IAAI,QAAQ,CAAC,QAAQ,CAAC,WAAW,CAAC,EAAE,CAAC;YACnC,QAAQ,GAAG,QAAQ,CAAC,OAAO,CACzB,0BAA0B,EAC1B,OAAO,CAAC,GAAG,CAAC,SAAS,CACtB,CAAC;QACJ,CAAC;IACH,CAAC;IAED,OAAO,QAAQ,CAAC;AAClB,CAAC"}
|
package/package.json
CHANGED
|
@@ -10,12 +10,12 @@
|
|
|
10
10
|
"type": "git",
|
|
11
11
|
"url": "git+https://github.com/linked-fw/shape-ui.git"
|
|
12
12
|
},
|
|
13
|
-
"version": "2.3.
|
|
13
|
+
"version": "2.3.3",
|
|
14
14
|
"packageManager": "npm@11.19.1",
|
|
15
15
|
"type": "module",
|
|
16
16
|
"linkedPackage": true,
|
|
17
17
|
"main": "lib/esm/index.js",
|
|
18
|
-
"types": "
|
|
18
|
+
"types": "index.d.ts",
|
|
19
19
|
"license": "ISC",
|
|
20
20
|
"scripts": {
|
|
21
21
|
"start": "npm exec linked dev",
|
|
@@ -45,11 +45,11 @@
|
|
|
45
45
|
"@changesets/changelog-github": "^0.5.2",
|
|
46
46
|
"@changesets/cli": "^2.29.8",
|
|
47
47
|
"@types/node": "^20.14.9",
|
|
48
|
-
"@types/react": "^
|
|
48
|
+
"@types/react": "^19.3.0",
|
|
49
49
|
"copyfiles": "^2.4.1",
|
|
50
50
|
"framer-motion": "^12.0.0",
|
|
51
|
-
"react": "^
|
|
52
|
-
"react-dom": "^
|
|
51
|
+
"react": "^19.3.0",
|
|
52
|
+
"react-dom": "^19.3.0",
|
|
53
53
|
"rimraf": "^5.0.7",
|
|
54
54
|
"tsconfig-to-dual-package": "^1.2.0",
|
|
55
55
|
"typescript": "^5.7.3",
|