@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.
@@ -0,0 +1,8 @@
1
+ #!/usr/bin/env node
2
+ import fs from 'node:fs';
3
+ import path from 'node:path';
4
+
5
+ const viteCache = path.resolve(process.cwd(), 'node_modules', '.vite');
6
+ if (fs.existsSync(viteCache)) {
7
+ fs.rmSync(viteCache, { recursive: true });
8
+ }
@@ -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.14",
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
+ }
@@ -1,6 +1,8 @@
1
1
  @mixin use($anythingElse: '') {
2
- @include select('no-preference', $anythingElse) {
3
- @content;
2
+ @media screen {
3
+ @include select('no-preference', $anythingElse) {
4
+ @content;
5
+ }
4
6
  }
5
7
  }
6
8
 
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
- @each $key, $value in $themeConfig {
27
- $curTheme: $key !global;
27
+ @media screen {
28
+ @each $key, $value in $themeConfig {
29
+ $curTheme: $key !global;
28
30
 
29
- @include select($key, $anythingElse) {
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: '') {