@windrun-huaiin/lib 7.1.2 → 10.1.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.
- package/dist/index.js +1 -0
- package/dist/index.mjs +1 -1
- package/dist/llm-utils.js +1 -1
- package/dist/llm-utils.mjs +1 -1
- package/dist/utils.d.ts +1 -0
- package/dist/utils.d.ts.map +1 -1
- package/dist/utils.js +5 -0
- package/dist/utils.mjs +5 -1
- package/package.json +8 -8
- package/src/utils.ts +4 -0
- /package/dist/node_modules/.pnpm/{@rollup_plugin-typescript@12.1.4_rollup@4.46.2_tslib@2.8.1_typescript@5.9.2 → @rollup_plugin-typescript@12.1.4_rollup@4.46.2_tslib@2.8.1_typescript@5.9.3}/node_modules/tslib/tslib.es6.js +0 -0
- /package/dist/node_modules/.pnpm/{@rollup_plugin-typescript@12.1.4_rollup@4.46.2_tslib@2.8.1_typescript@5.9.2 → @rollup_plugin-typescript@12.1.4_rollup@4.46.2_tslib@2.8.1_typescript@5.9.3}/node_modules/tslib/tslib.es6.mjs +0 -0
package/dist/index.js
CHANGED
|
@@ -9,6 +9,7 @@ var commonAppConfig = require('./common-app-config.js');
|
|
|
9
9
|
exports.cn = utils.cn;
|
|
10
10
|
exports.formatTimestamp = utils.formatTimestamp;
|
|
11
11
|
exports.handlePastePlainText = utils.handlePastePlainText;
|
|
12
|
+
exports.viewLocalTime = utils.viewLocalTime;
|
|
12
13
|
exports.getLLMText = llmUtils.getLLMText;
|
|
13
14
|
exports.LOCALE_PRESETS = commonAppConfig.LOCALE_PRESETS;
|
|
14
15
|
exports.createCommonAppConfig = commonAppConfig.createCommonAppConfig;
|
package/dist/index.mjs
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
export { cn, formatTimestamp, handlePastePlainText } from './utils.mjs';
|
|
1
|
+
export { cn, formatTimestamp, handlePastePlainText, viewLocalTime } from './utils.mjs';
|
|
2
2
|
export { getLLMText } from './llm-utils.mjs';
|
|
3
3
|
export { LOCALE_PRESETS, createCommonAppConfig, createI18nHelpers } from './common-app-config.mjs';
|
package/dist/llm-utils.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var tslib_es6 = require('./node_modules/.pnpm/@rollup_plugin-typescript@12.1.4_rollup@4.46.2_tslib@2.8.1_typescript@5.9.
|
|
3
|
+
var tslib_es6 = require('./node_modules/.pnpm/@rollup_plugin-typescript@12.1.4_rollup@4.46.2_tslib@2.8.1_typescript@5.9.3/node_modules/tslib/tslib.es6.js');
|
|
4
4
|
var remark = require('remark');
|
|
5
5
|
var remarkGfm = require('remark-gfm');
|
|
6
6
|
var remarkMdx = require('remark-mdx');
|
package/dist/llm-utils.mjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { __awaiter } from './node_modules/.pnpm/@rollup_plugin-typescript@12.1.4_rollup@4.46.2_tslib@2.8.1_typescript@5.9.
|
|
1
|
+
import { __awaiter } from './node_modules/.pnpm/@rollup_plugin-typescript@12.1.4_rollup@4.46.2_tslib@2.8.1_typescript@5.9.3/node_modules/tslib/tslib.es6.mjs';
|
|
2
2
|
import { remark } from 'remark';
|
|
3
3
|
import remarkGfm from 'remark-gfm';
|
|
4
4
|
import remarkMdx from 'remark-mdx';
|
package/dist/utils.d.ts
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import type * as React from "react";
|
|
2
2
|
import { type ClassValue } from "clsx";
|
|
3
3
|
export declare function cn(...inputs: ClassValue[]): string;
|
|
4
|
+
export declare function viewLocalTime(origin: Date | null): string;
|
|
4
5
|
export declare function formatTimestamp(timestamp: string, formatter: string): string;
|
|
5
6
|
export declare function handlePastePlainText(e: React.ClipboardEvent<HTMLElement>): void;
|
|
6
7
|
//# sourceMappingURL=utils.d.ts.map
|
package/dist/utils.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../src/utils.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,KAAK,MAAM,OAAO,CAAC;AACpC,OAAO,EAAQ,KAAK,UAAU,EAAE,MAAM,MAAM,CAAA;AAI5C,wBAAgB,EAAE,CAAC,GAAG,MAAM,EAAE,UAAU,EAAE,UAEzC;AAED,wBAAgB,eAAe,CAAC,SAAS,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,UA4BnE;AAGD,wBAAgB,oBAAoB,CAAC,CAAC,EAAE,KAAK,CAAC,cAAc,CAAC,WAAW,CAAC,QAgBxE"}
|
|
1
|
+
{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../src/utils.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,KAAK,MAAM,OAAO,CAAC;AACpC,OAAO,EAAQ,KAAK,UAAU,EAAE,MAAM,MAAM,CAAA;AAI5C,wBAAgB,EAAE,CAAC,GAAG,MAAM,EAAE,UAAU,EAAE,UAEzC;AAED,wBAAgB,aAAa,CAAC,MAAM,EAAE,IAAI,GAAG,IAAI,UAEhD;AAED,wBAAgB,eAAe,CAAC,SAAS,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,UA4BnE;AAGD,wBAAgB,oBAAoB,CAAC,CAAC,EAAE,KAAK,CAAC,cAAc,CAAC,WAAW,CAAC,QAgBxE"}
|
package/dist/utils.js
CHANGED
|
@@ -7,6 +7,10 @@ var dateFns = require('date-fns');
|
|
|
7
7
|
function cn(...inputs) {
|
|
8
8
|
return tailwindMerge.twMerge(clsx.clsx(inputs));
|
|
9
9
|
}
|
|
10
|
+
function viewLocalTime(origin) {
|
|
11
|
+
var _a;
|
|
12
|
+
return formatTimestamp((_a = origin === null || origin === void 0 ? void 0 : origin.getTime().toString()) !== null && _a !== void 0 ? _a : "", 'yyyy-MM-dd HH:mm:ss');
|
|
13
|
+
}
|
|
10
14
|
function formatTimestamp(timestamp, formatter) {
|
|
11
15
|
const fail = "";
|
|
12
16
|
if (!timestamp) {
|
|
@@ -56,3 +60,4 @@ function handlePastePlainText(e) {
|
|
|
56
60
|
exports.cn = cn;
|
|
57
61
|
exports.formatTimestamp = formatTimestamp;
|
|
58
62
|
exports.handlePastePlainText = handlePastePlainText;
|
|
63
|
+
exports.viewLocalTime = viewLocalTime;
|
package/dist/utils.mjs
CHANGED
|
@@ -5,6 +5,10 @@ import { isValid, format } from 'date-fns';
|
|
|
5
5
|
function cn(...inputs) {
|
|
6
6
|
return twMerge(clsx(inputs));
|
|
7
7
|
}
|
|
8
|
+
function viewLocalTime(origin) {
|
|
9
|
+
var _a;
|
|
10
|
+
return formatTimestamp((_a = origin === null || origin === void 0 ? void 0 : origin.getTime().toString()) !== null && _a !== void 0 ? _a : "", 'yyyy-MM-dd HH:mm:ss');
|
|
11
|
+
}
|
|
8
12
|
function formatTimestamp(timestamp, formatter) {
|
|
9
13
|
const fail = "";
|
|
10
14
|
if (!timestamp) {
|
|
@@ -51,4 +55,4 @@ function handlePastePlainText(e) {
|
|
|
51
55
|
selection.addRange(range);
|
|
52
56
|
}
|
|
53
57
|
|
|
54
|
-
export { cn, formatTimestamp, handlePastePlainText };
|
|
58
|
+
export { cn, formatTimestamp, handlePastePlainText, viewLocalTime };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@windrun-huaiin/lib",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "10.1.0",
|
|
4
4
|
"description": "Common utilities and configuration",
|
|
5
5
|
"main": "./dist/index.js",
|
|
6
6
|
"module": "./dist/index.mjs",
|
|
@@ -38,21 +38,21 @@
|
|
|
38
38
|
"dependencies": {
|
|
39
39
|
"date-fns": "2.30.0",
|
|
40
40
|
"remark": "^15.0.1",
|
|
41
|
+
"remark-frontmatter": "^5.0.0",
|
|
41
42
|
"remark-gfm": "^4.0.1",
|
|
42
43
|
"remark-mdx": "^3.1.0",
|
|
43
|
-
"remark-frontmatter": "^5.0.0",
|
|
44
44
|
"unist-util-visit": "^5.0.0"
|
|
45
45
|
},
|
|
46
46
|
"devDependencies": {
|
|
47
|
-
"
|
|
48
|
-
"@types/
|
|
49
|
-
"
|
|
47
|
+
"@types/node": "22.17.2",
|
|
48
|
+
"@types/react": "19.1.2",
|
|
49
|
+
"typescript": "^5.8.3"
|
|
50
50
|
},
|
|
51
51
|
"peerDependencies": {
|
|
52
52
|
"clsx": "^2.1.1",
|
|
53
|
-
"
|
|
54
|
-
"react": "19.
|
|
55
|
-
"
|
|
53
|
+
"react": "19.2.0",
|
|
54
|
+
"react-dom": "19.2.0",
|
|
55
|
+
"tailwind-merge": "^3.3.0"
|
|
56
56
|
},
|
|
57
57
|
"keywords": [
|
|
58
58
|
"utilities",
|
package/src/utils.ts
CHANGED
|
@@ -7,6 +7,10 @@ export function cn(...inputs: ClassValue[]) {
|
|
|
7
7
|
return twMerge(clsx(inputs))
|
|
8
8
|
}
|
|
9
9
|
|
|
10
|
+
export function viewLocalTime(origin: Date | null) {
|
|
11
|
+
return formatTimestamp(origin?.getTime().toString() ?? "", 'yyyy-MM-dd HH:mm:ss');
|
|
12
|
+
}
|
|
13
|
+
|
|
10
14
|
export function formatTimestamp(timestamp: string, formatter: string) {
|
|
11
15
|
const fail = "";
|
|
12
16
|
if (!timestamp) {
|
|
File without changes
|