polen 0.9.0-next.5 → 0.9.0-next.7
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/README.md +42 -0
- package/build/api/builder/builder.d.ts +1 -0
- package/build/api/builder/builder.d.ts.map +1 -1
- package/build/api/builder/builder.js +1 -0
- package/build/api/builder/builder.js.map +1 -1
- package/build/api/config/configurator.d.ts +21 -5
- package/build/api/config/configurator.d.ts.map +1 -1
- package/build/api/config/configurator.js +12 -0
- package/build/api/config/configurator.js.map +1 -1
- package/build/api/config-resolver/resolve.d.ts +1 -1
- package/build/api/config-resolver/resolve.js +1 -1
- package/build/api/config-resolver/vite.d.ts.map +1 -1
- package/build/api/config-resolver/vite.js +1 -0
- package/build/api/config-resolver/vite.js.map +1 -1
- package/build/api/schema/read.d.ts +1 -1
- package/build/api/singletons/markdown/markdown.d.ts.map +1 -1
- package/build/api/singletons/markdown/markdown.js +33 -11
- package/build/api/singletons/markdown/markdown.js.map +1 -1
- package/build/api/utils/asset-url/asset-url.d.ts +20 -0
- package/build/api/utils/asset-url/asset-url.d.ts.map +1 -0
- package/build/api/utils/asset-url/asset-url.js +35 -0
- package/build/api/utils/asset-url/asset-url.js.map +1 -0
- package/build/api/utils/asset-url/index.d.ts +2 -0
- package/build/api/utils/asset-url/index.d.ts.map +1 -0
- package/build/api/utils/asset-url/index.js +2 -0
- package/build/api/utils/asset-url/index.js.map +1 -0
- package/build/api/vite/plugins/core.d.ts.map +1 -1
- package/build/api/vite/plugins/core.js +10 -4
- package/build/api/vite/plugins/core.js.map +1 -1
- package/build/api/vite/plugins/pages.d.ts.map +1 -1
- package/build/api/vite/plugins/pages.js +27 -2
- package/build/api/vite/plugins/pages.js.map +1 -1
- package/build/cli/commands/build.js +2 -0
- package/build/cli/commands/build.js.map +1 -1
- package/build/cli/commands/dev.js +2 -0
- package/build/cli/commands/dev.js.map +1 -1
- package/build/lib/shiki/index.d.ts +2 -0
- package/build/lib/shiki/index.d.ts.map +1 -0
- package/build/lib/shiki/index.js +2 -0
- package/build/lib/shiki/index.js.map +1 -0
- package/build/lib/shiki/shiki.d.ts +26 -0
- package/build/lib/shiki/shiki.d.ts.map +1 -0
- package/build/lib/shiki/shiki.js +105 -0
- package/build/lib/shiki/shiki.js.map +1 -0
- package/build/lib/vite-virtual/identifier.d.ts +2 -2
- package/build/project-data.d.ts +1 -0
- package/build/project-data.d.ts.map +1 -1
- package/build/template/components/CodeBlock.d.ts +17 -0
- package/build/template/components/CodeBlock.d.ts.map +1 -0
- package/build/template/components/CodeBlock.jsx +42 -0
- package/build/template/components/CodeBlock.jsx.map +1 -0
- package/build/template/components/Link.d.ts.map +1 -1
- package/build/template/components/Link.jsx +2 -1
- package/build/template/components/Link.jsx.map +1 -1
- package/build/template/entry.client.jsx +3 -0
- package/build/template/entry.client.jsx.map +1 -1
- package/build/template/routes/root.d.ts.map +1 -1
- package/build/template/routes/root.jsx +37 -2
- package/build/template/routes/root.jsx.map +1 -1
- package/build/template/server/manifest.d.ts +1 -1
- package/build/template/server/manifest.d.ts.map +1 -1
- package/build/template/server/manifest.js +6 -5
- package/build/template/server/manifest.js.map +1 -1
- package/build/template/server/render-page.d.ts.map +1 -1
- package/build/template/server/render-page.jsx +2 -1
- package/build/template/server/render-page.jsx.map +1 -1
- package/build/template/server/ssg/generate.d.ts.map +1 -1
- package/build/template/server/ssg/generate.js +50 -7
- package/build/template/server/ssg/generate.js.map +1 -1
- package/build/template/server/view.d.ts.map +1 -1
- package/build/template/server/view.js +4 -1
- package/build/template/server/view.js.map +1 -1
- package/package.json +10 -1
- package/src/api/builder/builder.ts +2 -0
- package/src/api/config/configurator.ts +34 -5
- package/src/api/config-resolver/resolve.ts +1 -1
- package/src/api/config-resolver/vite.ts +1 -0
- package/src/api/schema/read.ts +1 -1
- package/src/api/singletons/markdown/markdown.test.ts +89 -0
- package/src/api/singletons/markdown/markdown.ts +35 -13
- package/src/api/utils/asset-url/asset-url.test.ts +47 -0
- package/src/api/utils/asset-url/asset-url.ts +38 -0
- package/src/api/utils/asset-url/index.ts +1 -0
- package/src/api/vite/plugins/core.ts +10 -4
- package/src/api/vite/plugins/pages.ts +27 -2
- package/src/cli/commands/build.ts +5 -0
- package/src/cli/commands/dev.ts +5 -0
- package/src/lib/shiki/index.ts +1 -0
- package/src/lib/shiki/shiki.test.ts +107 -0
- package/src/lib/shiki/shiki.ts +161 -0
- package/src/lib/vite-virtual/identifier.ts +2 -2
- package/src/project-data.ts +1 -0
- package/src/template/components/CodeBlock.tsx +73 -0
- package/src/template/components/Link.tsx +4 -3
- package/src/template/entry.client.tsx +3 -0
- package/src/template/routes/root.tsx +37 -2
- package/src/template/server/manifest.ts +6 -3
- package/src/template/server/render-page.tsx +2 -1
- package/src/template/server/ssg/generate.ts +70 -7
- package/src/template/server/view.ts +4 -1
- package/src/template/styles/code-block.css +186 -0
@@ -0,0 +1,186 @@
|
|
1
|
+
/* Code Block Styles */
|
2
|
+
|
3
|
+
/* Base code block container */
|
4
|
+
.code-block {
|
5
|
+
position: relative;
|
6
|
+
margin: 1rem 0;
|
7
|
+
border-radius: 8px;
|
8
|
+
overflow: hidden;
|
9
|
+
font-size: 14px;
|
10
|
+
line-height: 1.6;
|
11
|
+
}
|
12
|
+
|
13
|
+
.code-block pre {
|
14
|
+
margin: 0;
|
15
|
+
padding: 1rem;
|
16
|
+
overflow-x: auto;
|
17
|
+
background: inherit;
|
18
|
+
}
|
19
|
+
|
20
|
+
.code-block code {
|
21
|
+
font-family: 'JetBrains Mono', 'Fira Code', 'SF Mono', Consolas, 'Liberation Mono', Menlo, monospace;
|
22
|
+
font-variant-ligatures: contextual;
|
23
|
+
}
|
24
|
+
|
25
|
+
/* Shiki theme switching with CSS variables */
|
26
|
+
/* Default to light theme */
|
27
|
+
:root {
|
28
|
+
color-scheme: light;
|
29
|
+
}
|
30
|
+
|
31
|
+
/* When dark mode is active */
|
32
|
+
.dark {
|
33
|
+
color-scheme: dark;
|
34
|
+
}
|
35
|
+
|
36
|
+
/* Shiki code blocks */
|
37
|
+
pre.shiki {
|
38
|
+
margin: 1rem 0;
|
39
|
+
padding: 1rem;
|
40
|
+
border-radius: 8px;
|
41
|
+
overflow-x: auto;
|
42
|
+
font-size: 14px;
|
43
|
+
line-height: 1.6;
|
44
|
+
}
|
45
|
+
|
46
|
+
pre.shiki code {
|
47
|
+
font-family: 'JetBrains Mono', 'Fira Code', 'SF Mono', Consolas, 'Liberation Mono', Menlo, monospace;
|
48
|
+
font-variant-ligatures: contextual;
|
49
|
+
}
|
50
|
+
|
51
|
+
/* Line numbers */
|
52
|
+
.code-block[data-line-numbers="true"] pre {
|
53
|
+
padding-left: 3.5rem;
|
54
|
+
position: relative;
|
55
|
+
}
|
56
|
+
|
57
|
+
.code-block[data-line-numbers="true"] .line {
|
58
|
+
position: relative;
|
59
|
+
}
|
60
|
+
|
61
|
+
.code-block[data-line-numbers="true"] .line::before {
|
62
|
+
content: attr(data-line);
|
63
|
+
position: absolute;
|
64
|
+
left: -3rem;
|
65
|
+
width: 2.5rem;
|
66
|
+
text-align: right;
|
67
|
+
color: var(--gray-a6);
|
68
|
+
user-select: none;
|
69
|
+
}
|
70
|
+
|
71
|
+
/* Line highlighting */
|
72
|
+
.code-block .line[data-highlighted="true"] {
|
73
|
+
background-color: var(--amber-a3);
|
74
|
+
display: block;
|
75
|
+
margin: 0 -1rem;
|
76
|
+
padding: 0 1rem;
|
77
|
+
}
|
78
|
+
|
79
|
+
/* Diff lines */
|
80
|
+
.code-block .line[data-diff="+"] {
|
81
|
+
background-color: var(--green-a3);
|
82
|
+
display: block;
|
83
|
+
margin: 0 -1rem;
|
84
|
+
padding: 0 1rem;
|
85
|
+
}
|
86
|
+
|
87
|
+
.code-block .line[data-diff="-"] {
|
88
|
+
background-color: var(--red-a3);
|
89
|
+
display: block;
|
90
|
+
margin: 0 -1rem;
|
91
|
+
padding: 0 1rem;
|
92
|
+
}
|
93
|
+
|
94
|
+
.code-block .line[data-diff="+"]::before {
|
95
|
+
content: "+ ";
|
96
|
+
color: var(--green-11);
|
97
|
+
font-weight: bold;
|
98
|
+
}
|
99
|
+
|
100
|
+
.code-block .line[data-diff="-"]::before {
|
101
|
+
content: "- ";
|
102
|
+
color: var(--red-11);
|
103
|
+
font-weight: bold;
|
104
|
+
}
|
105
|
+
|
106
|
+
/* Focus lines */
|
107
|
+
.code-block .line:not([data-focus="true"]) {
|
108
|
+
opacity: 0.5;
|
109
|
+
filter: grayscale(100%);
|
110
|
+
transition: opacity 0.2s, filter 0.2s;
|
111
|
+
}
|
112
|
+
|
113
|
+
.code-block:hover .line:not([data-focus="true"]) {
|
114
|
+
opacity: 0.8;
|
115
|
+
filter: grayscale(0%);
|
116
|
+
}
|
117
|
+
|
118
|
+
/* Copy button */
|
119
|
+
.code-block-copy {
|
120
|
+
position: absolute;
|
121
|
+
top: 0.5rem;
|
122
|
+
right: 0.5rem;
|
123
|
+
padding: 0.25rem 0.5rem;
|
124
|
+
border-radius: 4px;
|
125
|
+
background: var(--gray-a3);
|
126
|
+
color: var(--gray-12);
|
127
|
+
border: 1px solid var(--gray-a5);
|
128
|
+
cursor: pointer;
|
129
|
+
font-size: 12px;
|
130
|
+
transition: all 0.2s;
|
131
|
+
}
|
132
|
+
|
133
|
+
.code-block-copy:hover {
|
134
|
+
background: var(--gray-a4);
|
135
|
+
border-color: var(--gray-a6);
|
136
|
+
}
|
137
|
+
|
138
|
+
.code-block-copy.copied {
|
139
|
+
background: var(--green-a3);
|
140
|
+
border-color: var(--green-a5);
|
141
|
+
color: var(--green-11);
|
142
|
+
}
|
143
|
+
|
144
|
+
/* Language badge */
|
145
|
+
.code-block-lang {
|
146
|
+
position: absolute;
|
147
|
+
top: 0;
|
148
|
+
right: 0;
|
149
|
+
padding: 0.25rem 0.75rem;
|
150
|
+
background: var(--gray-a3);
|
151
|
+
color: var(--gray-11);
|
152
|
+
font-size: 12px;
|
153
|
+
font-weight: 500;
|
154
|
+
border-bottom-left-radius: 4px;
|
155
|
+
user-select: none;
|
156
|
+
}
|
157
|
+
|
158
|
+
/* Scrollbar styling */
|
159
|
+
.code-block pre::-webkit-scrollbar {
|
160
|
+
height: 8px;
|
161
|
+
width: 8px;
|
162
|
+
}
|
163
|
+
|
164
|
+
.code-block pre::-webkit-scrollbar-track {
|
165
|
+
background: var(--gray-a3);
|
166
|
+
border-radius: 4px;
|
167
|
+
}
|
168
|
+
|
169
|
+
.code-block pre::-webkit-scrollbar-thumb {
|
170
|
+
background: var(--gray-a6);
|
171
|
+
border-radius: 4px;
|
172
|
+
}
|
173
|
+
|
174
|
+
.code-block pre::-webkit-scrollbar-thumb:hover {
|
175
|
+
background: var(--gray-a7);
|
176
|
+
}
|
177
|
+
|
178
|
+
/* Inline code */
|
179
|
+
code:not(.code-block code) {
|
180
|
+
padding: 0.2em 0.4em;
|
181
|
+
margin: 0;
|
182
|
+
font-size: 0.85em;
|
183
|
+
background-color: var(--gray-a3);
|
184
|
+
border-radius: 4px;
|
185
|
+
font-family: 'JetBrains Mono', 'Fira Code', 'SF Mono', Consolas, 'Liberation Mono', Menlo, monospace;
|
186
|
+
}
|