valaxy 0.14.61 → 0.15.1

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.
Files changed (51) hide show
  1. package/client/components/ValaxyMd.vue +2 -0
  2. package/client/composables/back.ts +18 -0
  3. package/client/composables/categories.ts +0 -1
  4. package/client/composables/codeGroups.ts +52 -0
  5. package/client/composables/common.ts +0 -1
  6. package/client/composables/decrypt.ts +0 -1
  7. package/client/composables/helper.ts +0 -1
  8. package/client/composables/index.ts +1 -0
  9. package/client/composables/outline/headers.ts +0 -2
  10. package/client/composables/post.ts +0 -4
  11. package/client/composables/tags.ts +0 -1
  12. package/client/config.ts +0 -5
  13. package/client/layouts/404.vue +21 -23
  14. package/client/stores/app.ts +5 -0
  15. package/client/styles/common/code.scss +51 -51
  16. package/client/styles/common/markdown.scss +90 -36
  17. package/client/styles/components/code-group.scss +85 -0
  18. package/client/styles/components/custom-block.scss +190 -0
  19. package/client/styles/css-vars/borders.css +24 -0
  20. package/client/styles/css-vars/function.css +51 -0
  21. package/client/styles/css-vars/palette.css +83 -0
  22. package/client/styles/css-vars.scss +31 -2
  23. package/client/styles/global/reset.scss +1 -1
  24. package/client/styles/index.scss +2 -1
  25. package/client/styles/palette.scss +4 -4
  26. package/client/styles/vars.scss +3 -3
  27. package/client/utils/helper.ts +0 -1
  28. package/client/utils/time.ts +0 -1
  29. package/client/utils/wrap.ts +0 -1
  30. package/dist/chunk-DMHUSKCP.cjs +128 -0
  31. package/dist/chunk-M4Y54B6H.mjs +2 -0
  32. package/dist/chunk-MHVZJPKO.cjs +1 -0
  33. package/dist/chunk-MMTKTJH7.mjs +129 -0
  34. package/dist/{config-42c9d78a.d.ts → config-9f7e02a4.d.ts} +2 -12
  35. package/dist/node/cli.cjs +1 -1
  36. package/dist/node/cli.mjs +2 -1
  37. package/dist/node/index.cjs +1 -1
  38. package/dist/node/index.d.cts +7 -19
  39. package/dist/node/index.d.ts +7 -19
  40. package/dist/node/index.mjs +2 -1
  41. package/dist/types/index.cjs +1 -1
  42. package/dist/types/index.d.cts +3 -1
  43. package/dist/types/index.d.ts +3 -1
  44. package/dist/types/index.mjs +2 -0
  45. package/package.json +35 -31
  46. package/types/config.ts +1 -1
  47. package/types/{default-theme.ts → default-theme.d.ts} +1 -2
  48. package/types/index.ts +2 -2
  49. package/client/styles/common/custom-blocks.scss +0 -93
  50. package/dist/chunk-NERYRW7R.mjs +0 -129
  51. package/dist/chunk-QA3AARSF.cjs +0 -129
@@ -0,0 +1,190 @@
1
+ .custom-block-title {
2
+ margin-bottom: -0.4rem;
3
+ font-weight: 600;
4
+ display: flex;
5
+ align-items: center;
6
+
7
+ > .icon {
8
+ display: inline-flex;
9
+ width: 1rem;
10
+ height: 1rem;
11
+ margin-right: 4px;
12
+ }
13
+ }
14
+
15
+ /**
16
+ * Component: Custom Block
17
+ * -------------------------------------------------------------------------- */
18
+ :root {
19
+ --va-custom-block-font-size: 14px;
20
+ --va-custom-block-code-font-size: 13px;
21
+
22
+ --va-custom-block-info-border: transparent;
23
+ --va-custom-block-info-text: var(--va-c-text-1);
24
+ --va-custom-block-info-bg: var(--va-c-default-soft);
25
+ --va-custom-block-info-code-bg: var(--va-c-default-soft);
26
+
27
+ --va-custom-block-tip-border: transparent;
28
+ --va-custom-block-tip-text: var(--va-c-text-1);
29
+ --va-custom-block-tip-bg: var(--va-c-brand-soft);
30
+ --va-custom-block-tip-code-bg: var(--va-c-brand-soft);
31
+
32
+ --va-custom-block-warning-border: transparent;
33
+ --va-custom-block-warning-text: var(--va-c-text-1);
34
+ --va-custom-block-warning-bg: var(--va-c-warning-soft);
35
+ --va-custom-block-warning-code-bg: var(--va-c-warning-soft);
36
+
37
+ --va-custom-block-danger-border: transparent;
38
+ --va-custom-block-danger-text: var(--va-c-text-1);
39
+ --va-custom-block-danger-bg: var(--va-c-danger-soft);
40
+ --va-custom-block-danger-code-bg: var(--va-c-danger-soft);
41
+
42
+ --va-custom-block-details-border: var(--va-custom-block-info-border);
43
+ --va-custom-block-details-text: var(--va-custom-block-info-text);
44
+ --va-custom-block-details-bg: var(--va-custom-block-info-bg);
45
+ --va-custom-block-details-code-bg: var(--va-custom-block-info-code-bg);
46
+ }
47
+
48
+ // ref vitepress
49
+ .custom-block {
50
+ border: 1px solid transparent;
51
+ border-radius: 8px;
52
+ padding: 16px 16px 8px;
53
+ line-height: 24px;
54
+ font-size: var(--va-custom-block-font-size);
55
+ color: var(--va-c-text-2);
56
+ }
57
+
58
+ .custom-block.info {
59
+ border-color: var(--va-custom-block-info-border);
60
+ color: var(--va-custom-block-info-text);
61
+ background-color: var(--va-custom-block-info-bg);
62
+ }
63
+
64
+ .custom-block.info a,
65
+ .custom-block.info code {
66
+ color: var(--va-c-brand-1);
67
+ }
68
+
69
+ .custom-block.info a:hover {
70
+ color: var(--va-c-brand-2);
71
+ }
72
+
73
+ .custom-block.info code {
74
+ background-color: var(--va-custom-block-info-code-bg);
75
+ }
76
+
77
+ .custom-block.tip {
78
+ border-color: var(--va-custom-block-tip-border);
79
+ color: var(--va-custom-block-tip-text);
80
+ background-color: var(--va-custom-block-tip-bg);
81
+ }
82
+
83
+ .custom-block.tip a,
84
+ .custom-block.tip code {
85
+ color: var(--va-c-brand-1);
86
+ }
87
+
88
+ .custom-block.tip a:hover {
89
+ color: var(--va-c-brand-2);
90
+ }
91
+
92
+ .custom-block.tip code {
93
+ background-color: var(--va-custom-block-tip-code-bg);
94
+ }
95
+
96
+ .custom-block.warning {
97
+ border-color: var(--va-custom-block-warning-border);
98
+ color: var(--va-custom-block-warning-text);
99
+ background-color: var(--va-custom-block-warning-bg);
100
+ }
101
+
102
+ .custom-block.warning a,
103
+ .custom-block.warning code {
104
+ color: var(--va-c-warning-1);
105
+ }
106
+
107
+ .custom-block.warning a:hover {
108
+ color: var(--va-c-warning-2);
109
+ }
110
+
111
+ .custom-block.warning code {
112
+ background-color: var(--va-custom-block-warning-code-bg);
113
+ }
114
+
115
+ .custom-block.danger {
116
+ border-color: var(--va-custom-block-danger-border);
117
+ color: var(--va-custom-block-danger-text);
118
+ background-color: var(--va-custom-block-danger-bg);
119
+ }
120
+
121
+ .custom-block.danger a,
122
+ .custom-block.danger code {
123
+ color: var(--va-c-danger-1);
124
+ }
125
+
126
+ .custom-block.danger a:hover {
127
+ color: var(--va-c-danger-2);
128
+ }
129
+
130
+ .custom-block.danger code {
131
+ background-color: var(--va-custom-block-danger-code-bg);
132
+ }
133
+
134
+ .custom-block.details {
135
+ border-color: var(--va-custom-block-details-border);
136
+ color: var(--va-custom-block-details-text);
137
+ background-color: var(--va-custom-block-details-bg);
138
+ }
139
+
140
+ .custom-block.details a {
141
+ color: var(--va-c-brand-1);
142
+ }
143
+
144
+ .custom-block.details a:hover {
145
+ color: var(--va-c-brand-2);
146
+ }
147
+
148
+ .custom-block.details code {
149
+ background-color: var(--va-custom-block-details-code-bg);
150
+ }
151
+
152
+ .custom-block-title {
153
+ font-weight: 600;
154
+ }
155
+
156
+ .custom-block p + p {
157
+ margin: 8px 0;
158
+ }
159
+
160
+ .custom-block.details summary {
161
+ margin: 0 0 8px;
162
+ font-weight: 700;
163
+ cursor: pointer;
164
+ }
165
+
166
+ .custom-block.details summary + p {
167
+ margin: 8px 0;
168
+ }
169
+
170
+ .custom-block a {
171
+ color: inherit;
172
+ font-weight: 600;
173
+ // text-decoration: underline;
174
+ text-underline-offset: 2px;
175
+ transition: opacity 0.25s;
176
+ }
177
+
178
+ .custom-block a:hover {
179
+ opacity: 0.75;
180
+ }
181
+
182
+ .custom-block code {
183
+ font-size: var(--va-custom-block-code-font-size);
184
+ }
185
+
186
+ .custom-block.custom-block th,
187
+ .custom-block.custom-block blockquote > p {
188
+ font-size: var(--va-custom-block-font-size);
189
+ color: inherit;
190
+ }
@@ -0,0 +1,24 @@
1
+ /**
2
+ * Colors: Borders
3
+ *
4
+ * - `divider`: This is used for separators. This is used to divide sections
5
+ * within the same components, such as having separator on "h2" heading.
6
+ *
7
+ * - `border`: This is designed for borders on interactive components.
8
+ * For example this should be used for a button outline.
9
+ *
10
+ * - `gutter`: This is used to divide components in the page. For example
11
+ * the header and the lest of the page.
12
+ * -------------------------------------------------------------------------- */
13
+
14
+ :root {
15
+ --va-c-border: #c2c2c4;
16
+ --va-c-divider: #e2e2e3;
17
+ --va-c-gutter: #e2e2e3;
18
+ }
19
+
20
+ .dark {
21
+ --va-c-border: #3c3f44;
22
+ --va-c-divider: #2e2e32;
23
+ --va-c-gutter: #000000;
24
+ }
@@ -0,0 +1,51 @@
1
+
2
+ /**
3
+ * Colors: Function
4
+ *
5
+ * - `default`: The color used purely for subtle indication without any
6
+ * special meanings attched to it such as bg color for menu hover state.
7
+ *
8
+ * - `brand`: Used for primary brand colors, such as link text, button with
9
+ * brand theme, etc.
10
+ *
11
+ * - `tip`: Used to indicate useful information. The default theme uses the
12
+ * brand color for this by default.
13
+ *
14
+ * - `warning`: Used to indicate warning to the users. Used in custom
15
+ * container, badges, etc.
16
+ *
17
+ * - `danger`: Used to show error, or dangerous message to the users. Used
18
+ * in custom container, badges, etc.
19
+ *
20
+ * To understand the scaling system, refer to "Colors: Palette" section.
21
+ * -------------------------------------------------------------------------- */
22
+
23
+ :root {
24
+ --va-c-default-1: var(--va-c-gray-1);
25
+ --va-c-default-2: var(--va-c-gray-2);
26
+ --va-c-default-3: var(--va-c-gray-3);
27
+ --va-c-default-soft: var(--va-c-gray-soft);
28
+
29
+ --va-c-brand-1: var(--va-c-indigo-1);
30
+ --va-c-brand-2: var(--va-c-indigo-2);
31
+ --va-c-brand-3: var(--va-c-indigo-3);
32
+ --va-c-brand-soft: var(--va-c-indigo-soft);
33
+
34
+ /* DEPRECATED: Use `--va-c-brand-1` instead. */
35
+ --va-c-brand: var(--va-c-brand-1);
36
+
37
+ --va-c-tip-1: var(--va-c-brand-1);
38
+ --va-c-tip-2: var(--va-c-brand-2);
39
+ --va-c-tip-3: var(--va-c-brand-3);
40
+ --va-c-tip-soft: var(--va-c-brand-soft);
41
+
42
+ --va-c-warning-1: var(--va-c-yellow-1);
43
+ --va-c-warning-2: var(--va-c-yellow-2);
44
+ --va-c-warning-3: var(--va-c-yellow-3);
45
+ --va-c-warning-soft: var(--va-c-yellow-soft);
46
+
47
+ --va-c-danger-1: var(--va-c-red-1);
48
+ --va-c-danger-2: var(--va-c-red-2);
49
+ --va-c-danger-3: var(--va-c-red-3);
50
+ --va-c-danger-soft: var(--va-c-red-soft);
51
+ }
@@ -0,0 +1,83 @@
1
+ /**
2
+ * Colors: Palette
3
+ *
4
+ * The primitive colors used for accent colors. These colors are referenced
5
+ * by functional colors such as "Text", "Background", or "Brand".
6
+ *
7
+ * Each colors have exact same color scale system with 3 levels of solid
8
+ * colors with different brightness, and 1 soft color.
9
+ *
10
+ * - `XXX-1`: The most solid color used mainly for colored text. It must
11
+ * satisfy the contrast ratio against when used on top of `XXX-soft`.
12
+ *
13
+ * - `XXX-2`: The color used mainly for hover state of the button.
14
+ *
15
+ * - `XXX-3`: The color for solid background, such as bg color of the button.
16
+ * It must satisfy the contrast ratio with pure white (#ffffff) text on
17
+ * top of it.
18
+ *
19
+ * - `XXX-soft`: The color used for subtle background such as custom container
20
+ * or badges. It must satisfy the contrast ratio when putting `XXX-1` colors
21
+ * on top of it.
22
+ *
23
+ * The soft color must be semi transparent alpha channel. This is crucial
24
+ * because it allows adding multiple "soft" colors on top of each other
25
+ * to create a accent, such as when having inline code block inside
26
+ * custom containers.
27
+ * -------------------------------------------------------------------------- */
28
+
29
+ :root {
30
+ --va-c-gray-1: #dddde3;
31
+ --va-c-gray-2: #e4e4e9;
32
+ --va-c-gray-3: #ebebef;
33
+ --va-c-gray-soft: rgba(142, 150, 170, 0.14);
34
+
35
+ --va-c-indigo-1: #3451b2;
36
+ --va-c-indigo-2: #3a5ccc;
37
+ --va-c-indigo-3: #5672cd;
38
+ --va-c-indigo-soft: rgba(100, 108, 255, 0.14);
39
+
40
+ --va-c-green-1: #18794e;
41
+ --va-c-green-2: #299764;
42
+ --va-c-green-3: #30a46c;
43
+ --va-c-green-soft: rgba(16, 185, 129, 0.14);
44
+
45
+ --va-c-yellow-1: #915930;
46
+ --va-c-yellow-2: #946300;
47
+ --va-c-yellow-3: #9f6a00;
48
+ --va-c-yellow-soft: rgba(234, 179, 8, 0.14);
49
+
50
+ --va-c-red-1: #b8272c;
51
+ --va-c-red-2: #d5393e;
52
+ --va-c-red-3: #e0575b;
53
+ --va-c-red-soft: rgba(244, 63, 94, 0.14);
54
+
55
+ --va-c-sponsor: #db2777;
56
+ }
57
+
58
+ .dark {
59
+ --va-c-gray-1: #515c67;
60
+ --va-c-gray-2: #414853;
61
+ --va-c-gray-3: #32363f;
62
+ --va-c-gray-soft: rgba(101, 117, 133, 0.16);
63
+
64
+ --va-c-indigo-1: #a8b1ff;
65
+ --va-c-indigo-2: #5c73e7;
66
+ --va-c-indigo-3: #3e63dd;
67
+ --va-c-indigo-soft: rgba(100, 108, 255, 0.16);
68
+
69
+ --va-c-green-1: #3dd68c;
70
+ --va-c-green-2: #30a46c;
71
+ --va-c-green-3: #298459;
72
+ --va-c-green-soft: rgba(16, 185, 129, 0.16);
73
+
74
+ --va-c-yellow-1: #f9b44e;
75
+ --va-c-yellow-2: #da8b17;
76
+ --va-c-yellow-3: #a46a0a;
77
+ --va-c-yellow-soft: rgba(234, 179, 8, 0.16);
78
+
79
+ --va-c-red-1: #f66f81;
80
+ --va-c-red-2: #f14158;
81
+ --va-c-red-3: #b62a3c;
82
+ --va-c-red-soft: rgba(244, 63, 94, 0.16);
83
+ }
@@ -10,6 +10,10 @@ $c-primary: #0078e7 !default;
10
10
  )
11
11
  );
12
12
 
13
+ @use './css-vars/borders.css' as *;
14
+ @use './css-vars/palette.css' as *;
15
+ @use './css-vars/function.css' as *;
16
+
13
17
  // common
14
18
  :root {
15
19
  @include set-css-var-from-map($common);
@@ -69,8 +73,17 @@ $c-primary: #0078e7 !default;
69
73
 
70
74
  --va-code-lang-color: var(--va-c-text-3);
71
75
 
72
- --va-code-line-highlight-color: rgba(0, 0, 0, 0.5);
73
- --va-code-line-number-color: var(--va-c-text-dark-3);
76
+ --va-code-line-highlight-color: var(--va-c-default-soft);
77
+ --va-code-line-number-color: var(--va-c-text-3);
78
+
79
+ --va-code-line-diff-add-color: var(--va-c-green-soft);
80
+ --va-code-line-diff-add-symbol-color: var(--va-c-green-1);
81
+
82
+ --va-code-line-diff-remove-color: var(--va-c-red-soft);
83
+ --va-code-line-diff-remove-symbol-color: var(--va-c-red-1);
84
+
85
+ --va-code-line-warning-color: var(--va-c-yellow-soft);
86
+ --va-code-line-error-color: var(--va-c-red-soft);
74
87
 
75
88
  // copy
76
89
  --va-code-copy-code-border-color: var(--va-c-divider);
@@ -79,6 +92,14 @@ $c-primary: #0078e7 !default;
79
92
  --va-code-copy-code-hover-bg: var(--va-c-bg);
80
93
  --va-code-copy-code-active-text: var(--va-c-text-2);
81
94
  --va-code-copy-copied-text-content: 'Copied';
95
+
96
+ // code-group
97
+ --va-code-tab-divider: var(--va-code-block-divider-color);
98
+ --va-code-tab-text-color: var(--va-c-text-2);
99
+ --va-code-tab-bg: var(--va-code-block-bg);
100
+ --va-code-tab-hover-text-color: var(--va-c-text-1);
101
+ --va-code-tab-active-text-color: var(--va-c-text-1);
102
+ --va-code-tab-active-bar-color: var(--va-c-brand-1);
82
103
  }
83
104
 
84
105
  .dark {
@@ -90,3 +111,11 @@ $c-primary: #0078e7 !default;
90
111
  --va-icon-copy: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' height='20' width='20' stroke='rgba(128,128,128,1)' stroke-width='2' class='h-6 w-6' viewBox='0 0 24 24'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' d='M9 5H7a2 2 0 0 0-2 2v12a2 2 0 0 0 2 2h10a2 2 0 0 0 2-2V7a2 2 0 0 0-2-2h-2M9 5a2 2 0 0 0 2 2h2a2 2 0 0 0 2-2M9 5a2 2 0 0 1 2-2h2a2 2 0 0 1 2 2'/%3E%3C/svg%3E");
91
112
  --va-icon-copied: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' height='20' width='20' stroke='rgba(128,128,128,1)' stroke-width='2' class='h-6 w-6' viewBox='0 0 24 24'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' d='M9 5H7a2 2 0 0 0-2 2v12a2 2 0 0 0 2 2h10a2 2 0 0 0 2-2V7a2 2 0 0 0-2-2h-2M9 5a2 2 0 0 0 2 2h2a2 2 0 0 0 2-2M9 5a2 2 0 0 1 2-2h2a2 2 0 0 1 2 2m-6 9 2 2 4-4'/%3E%3C/svg%3E");
92
113
  }
114
+
115
+ /**
116
+ * Component: Header Anchor
117
+ * -------------------------------------------------------------------------- */
118
+
119
+ :root {
120
+ --va-header-anchor-symbol: '#';
121
+ }
@@ -2,6 +2,7 @@
2
2
 
3
3
  html {
4
4
  -webkit-tap-highlight-color: transparent;
5
+ font-family: var(--va-font-sans);
5
6
  }
6
7
 
7
8
  a {
@@ -14,7 +15,6 @@ a {
14
15
  }
15
16
 
16
17
  hr {
17
- opacity: 0.2;
18
18
  margin: 1rem;
19
19
  }
20
20
 
@@ -12,7 +12,6 @@ $c-primary: #0078e7 !default;
12
12
 
13
13
  // common
14
14
  @use "./common/code.scss" as *;
15
- @use "./common/custom-blocks.scss" as *;
16
15
  @use "./common/hamburger.scss" as *;
17
16
 
18
17
  @use "./common/scrollbar.scss" as *;
@@ -20,3 +19,5 @@ $c-primary: #0078e7 !default;
20
19
 
21
20
  // markdown
22
21
  @use "./common/markdown.scss";
22
+
23
+ // components import by yourself
@@ -81,14 +81,14 @@ $dark: map.merge(
81
81
  (
82
82
  "border-color": #e6e6e6,
83
83
 
84
- "c-bg": #1a1a1a,
85
- "c-bg-light": #1d1e1f,
84
+ "c-bg": #1b1b1f,
85
+ "c-bg-light": #202127,
86
86
  "c-bg-dark": #1a1a1a,
87
87
  "c-bg-opacity": rgba(0, 0, 0, 0.8),
88
88
 
89
- "c-bg-soft": #1d1e1f,
90
- "c-bg-mute": #2f2f2f,
91
89
  "c-bg-alt": #161618,
90
+ "c-bg-soft": #202127,
91
+ "c-bg-mute": #2f2f2f,
92
92
 
93
93
  "c-text": #f2f2f2,
94
94
  "c-text-light": #ddd,
@@ -20,10 +20,10 @@ $border: map.merge(
20
20
  $font: () !default;
21
21
  $font: map.merge(
22
22
  (
23
- "serif": "'Noto Serif SC', STZhongsong, STKaiti, KaiTi, Roboto, serif",
23
+ "serif": "'Noto Serif SC', DM Serif Display, STZhongsong, STKaiti, KaiTi, Roboto, serif",
24
24
  "sans":
25
- 'Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen, Ubuntu, Cantarell, "Fira Sans", "Droid Sans", "Helvetica Neue", sans-serif',
26
- "mono": 'Menlo, Monaco, Consolas, "Courier New", monospace',
25
+ 'DM Sans, Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen, Ubuntu, Cantarell, "Fira Sans", "Droid Sans", "Helvetica Neue", sans-serif',
26
+ "mono": 'DM Mono, Menlo, Monaco, Consolas, "Courier New", monospace',
27
27
  ),
28
28
  $font
29
29
  );
@@ -1,6 +1,5 @@
1
1
  /**
2
2
  * 生成介于 min 与 max 之间的随机数
3
- * @returns
4
3
  */
5
4
  export function random(min: number, max: number) {
6
5
  return Math.random() * (max - min) + min
@@ -11,7 +11,6 @@ dayjs.extend(timezone)
11
11
  * use dayjs format date
12
12
  * @param date
13
13
  * @param template
14
- * @returns
15
14
  */
16
15
  export function formatDate(date: string | number | Date, template = 'YYYY-MM-DD') {
17
16
  const today = dayjs.tz(date)
@@ -1,6 +1,5 @@
1
1
  /**
2
2
  * wrap node
3
- * @param className
4
3
  */
5
4
  export function wrap(el: HTMLElement, className: string) {
6
5
  const wrapper = document.createElement('div')