@kuankuan/assist-2026 0.1.14 → 0.1.16
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/bin/clear-vite-deps.js +8 -0
- package/dist/utils.d.ts +1 -0
- package/dist/utils.js +16 -0
- package/package.json +3 -2
- package/src/utils.ts +15 -0
- package/styles/motion.scss +4 -2
- package/styles/theme.scss +13 -4
package/dist/utils.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare let copyText: (text: string) => void;
|
package/dist/utils.js
ADDED
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
export let copyText = (text) => {
|
|
2
|
+
if (window.navigator.clipboard) {
|
|
3
|
+
copyText = (text) => window.navigator.clipboard.writeText(text);
|
|
4
|
+
}
|
|
5
|
+
else {
|
|
6
|
+
copyText = (text) => {
|
|
7
|
+
const textarea = document.createElement('textarea');
|
|
8
|
+
textarea.value = text;
|
|
9
|
+
document.body.appendChild(textarea);
|
|
10
|
+
textarea.select();
|
|
11
|
+
document.execCommand('copy');
|
|
12
|
+
document.body.removeChild(textarea);
|
|
13
|
+
};
|
|
14
|
+
}
|
|
15
|
+
copyText(text);
|
|
16
|
+
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@kuankuan/assist-2026",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.16",
|
|
4
4
|
"description": "A toolset from kuankuan",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"scripts": {
|
|
@@ -10,7 +10,8 @@
|
|
|
10
10
|
"build": "npm run clean && tsc"
|
|
11
11
|
},
|
|
12
12
|
"bin": {
|
|
13
|
-
"load-fontello": "bin/load-fontello.js"
|
|
13
|
+
"load-fontello": "bin/load-fontello.js",
|
|
14
|
+
"clear-vite-deps": "bin/clear-vite-deps.js"
|
|
14
15
|
},
|
|
15
16
|
"repository": {
|
|
16
17
|
"type": "git",
|
package/src/utils.ts
ADDED
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
export let copyText = (text: string) => {
|
|
2
|
+
if (window.navigator.clipboard) {
|
|
3
|
+
copyText = (text: string) => window.navigator.clipboard.writeText(text);
|
|
4
|
+
} else {
|
|
5
|
+
copyText = (text: string) => {
|
|
6
|
+
const textarea = document.createElement('textarea');
|
|
7
|
+
textarea.value = text;
|
|
8
|
+
document.body.appendChild(textarea);
|
|
9
|
+
textarea.select();
|
|
10
|
+
document.execCommand('copy');
|
|
11
|
+
document.body.removeChild(textarea);
|
|
12
|
+
};
|
|
13
|
+
}
|
|
14
|
+
copyText(text);
|
|
15
|
+
}
|
package/styles/motion.scss
CHANGED
package/styles/theme.scss
CHANGED
|
@@ -22,16 +22,25 @@ $defaultTheme: (
|
|
|
22
22
|
);
|
|
23
23
|
|
|
24
24
|
$curTheme: 'light';
|
|
25
|
+
$printTheme: 'light';
|
|
25
26
|
@mixin use($anythingElse: '', $themeConfig: $defaultTheme) {
|
|
26
|
-
@
|
|
27
|
-
|
|
27
|
+
@media screen {
|
|
28
|
+
@each $key, $value in $themeConfig {
|
|
29
|
+
$curTheme: $key !global;
|
|
28
30
|
|
|
29
|
-
|
|
31
|
+
@include select($key, $anythingElse) {
|
|
32
|
+
@content;
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
@media print {
|
|
37
|
+
$curTheme: $printTheme !global;
|
|
38
|
+
@include select($printTheme, $anythingElse) {
|
|
30
39
|
@content;
|
|
31
40
|
}
|
|
32
41
|
}
|
|
33
42
|
}
|
|
34
|
-
@function selecter($theme){
|
|
43
|
+
@function selecter($theme) {
|
|
35
44
|
@return "[data-theme='#{$theme}']";
|
|
36
45
|
}
|
|
37
46
|
@mixin select($theme, $anythingElse: '') {
|