@hackersheet/next-document-content-components 0.1.0-alpha.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.
- package/README.md +3 -0
- package/dist/cjs/components/code-block/code-block-copy-button.d.ts +8 -0
- package/dist/cjs/components/code-block/code-block-copy-button.js +47 -0
- package/dist/cjs/components/code-block/code-block-icon.d.ts +8 -0
- package/dist/cjs/components/code-block/code-block-icon.js +66 -0
- package/dist/cjs/components/code-block/code-block-kifu.d.ts +9 -0
- package/dist/cjs/components/code-block/code-block-kifu.js +66 -0
- package/dist/cjs/components/code-block/code-block-mermaid.d.ts +8 -0
- package/dist/cjs/components/code-block/code-block-mermaid.js +71 -0
- package/dist/cjs/components/code-block/code-block.d.ts +6 -0
- package/dist/cjs/components/code-block/code-block.js +48 -0
- package/dist/cjs/components/code-block/shiki.d.ts +3 -0
- package/dist/cjs/components/code-block/shiki.js +52 -0
- package/dist/cjs/components/image/image.d.ts +6 -0
- package/dist/cjs/components/image/image.js +38 -0
- package/dist/cjs/components/index.d.ts +9 -0
- package/dist/cjs/components/index.js +56 -0
- package/dist/cjs/components/kifu-to/kifu-to.d.ts +6 -0
- package/dist/cjs/components/kifu-to/kifu-to.js +41 -0
- package/dist/cjs/components/link/link.d.ts +6 -0
- package/dist/cjs/components/link/link.js +38 -0
- package/dist/cjs/components/link-card/link-card.d.ts +6 -0
- package/dist/cjs/components/link-card/link-card.js +47 -0
- package/dist/cjs/components/x-post/x-post.d.ts +6 -0
- package/dist/cjs/components/x-post/x-post.js +49 -0
- package/dist/cjs/components/youtube/youtube.d.ts +6 -0
- package/dist/cjs/components/youtube/youtube.js +39 -0
- package/dist/cjs/index.d.ts +9 -0
- package/dist/cjs/index.js +22 -0
- package/dist/esm/components/code-block/code-block-copy-button.d.mts +8 -0
- package/dist/esm/components/code-block/code-block-copy-button.mjs +17 -0
- package/dist/esm/components/code-block/code-block-icon.d.mts +8 -0
- package/dist/esm/components/code-block/code-block-icon.mjs +36 -0
- package/dist/esm/components/code-block/code-block-kifu.d.mts +9 -0
- package/dist/esm/components/code-block/code-block-kifu.mjs +36 -0
- package/dist/esm/components/code-block/code-block-mermaid.d.mts +8 -0
- package/dist/esm/components/code-block/code-block-mermaid.mjs +41 -0
- package/dist/esm/components/code-block/code-block.d.mts +6 -0
- package/dist/esm/components/code-block/code-block.mjs +18 -0
- package/dist/esm/components/code-block/shiki.d.mts +3 -0
- package/dist/esm/components/code-block/shiki.mjs +28 -0
- package/dist/esm/components/image/image.d.mts +6 -0
- package/dist/esm/components/image/image.mjs +8 -0
- package/dist/esm/components/index.d.mts +9 -0
- package/dist/esm/components/index.mjs +16 -0
- package/dist/esm/components/kifu-to/kifu-to.d.mts +6 -0
- package/dist/esm/components/kifu-to/kifu-to.mjs +11 -0
- package/dist/esm/components/link/link.d.mts +6 -0
- package/dist/esm/components/link/link.mjs +8 -0
- package/dist/esm/components/link-card/link-card.d.mts +6 -0
- package/dist/esm/components/link-card/link-card.mjs +17 -0
- package/dist/esm/components/x-post/x-post.d.mts +6 -0
- package/dist/esm/components/x-post/x-post.mjs +19 -0
- package/dist/esm/components/youtube/youtube.d.mts +6 -0
- package/dist/esm/components/youtube/youtube.mjs +9 -0
- package/dist/esm/index.d.mts +9 -0
- package/dist/esm/index.mjs +1 -0
- package/dist/style.module.css +279 -0
- package/dist/style.module.scss.d.ts +9 -0
- package/license.md +21 -0
- package/package.json +73 -0
|
@@ -0,0 +1,279 @@
|
|
|
1
|
+
.main :first-child {
|
|
2
|
+
margin-top: 0;
|
|
3
|
+
}
|
|
4
|
+
.main * {
|
|
5
|
+
word-break: break-word;
|
|
6
|
+
scroll-margin-top: var(--hsdc-scroll-margin-top);
|
|
7
|
+
}
|
|
8
|
+
.main h1,
|
|
9
|
+
.main h2,
|
|
10
|
+
.main h3,
|
|
11
|
+
.main h4,
|
|
12
|
+
.main h5,
|
|
13
|
+
.main h6 {
|
|
14
|
+
margin: 4rem 0 1.5rem 0;
|
|
15
|
+
padding: 0.5rem 0;
|
|
16
|
+
font-weight: 700;
|
|
17
|
+
border-bottom: 1px solid hsl(var(--hsdc-border));
|
|
18
|
+
}
|
|
19
|
+
.main p {
|
|
20
|
+
margin: 1.8rem 0;
|
|
21
|
+
}
|
|
22
|
+
.main strong {
|
|
23
|
+
font-weight: 700;
|
|
24
|
+
}
|
|
25
|
+
.main hr {
|
|
26
|
+
margin: 4rem 0;
|
|
27
|
+
}
|
|
28
|
+
.main h1 {
|
|
29
|
+
font-size: 2rem;
|
|
30
|
+
}
|
|
31
|
+
.main h2 {
|
|
32
|
+
font-size: 1.5rem;
|
|
33
|
+
}
|
|
34
|
+
.main h3 {
|
|
35
|
+
font-size: 1.2rem;
|
|
36
|
+
}
|
|
37
|
+
.main h4 {
|
|
38
|
+
font-size: 1rem;
|
|
39
|
+
}
|
|
40
|
+
.main h5 {
|
|
41
|
+
font-size: 0.8rem;
|
|
42
|
+
}
|
|
43
|
+
.main h6 {
|
|
44
|
+
font-size: 0.7rem;
|
|
45
|
+
}
|
|
46
|
+
.main p {
|
|
47
|
+
line-height: 2.2;
|
|
48
|
+
letter-spacing: 0.04em;
|
|
49
|
+
}
|
|
50
|
+
.main ol,
|
|
51
|
+
.main ul {
|
|
52
|
+
padding-left: 1.5em;
|
|
53
|
+
}
|
|
54
|
+
.main ol ol,
|
|
55
|
+
.main ol ul,
|
|
56
|
+
.main ul ol,
|
|
57
|
+
.main ul ul {
|
|
58
|
+
padding-left: 1em;
|
|
59
|
+
}
|
|
60
|
+
.main ol li,
|
|
61
|
+
.main ul li {
|
|
62
|
+
line-height: 2rem;
|
|
63
|
+
padding-left: 0.5rem;
|
|
64
|
+
}
|
|
65
|
+
.main ul {
|
|
66
|
+
list-style-type: disc;
|
|
67
|
+
}
|
|
68
|
+
.main ul ul {
|
|
69
|
+
list-style-type: circle;
|
|
70
|
+
}
|
|
71
|
+
.main ul ul ul {
|
|
72
|
+
list-style-type: square;
|
|
73
|
+
}
|
|
74
|
+
.main ol {
|
|
75
|
+
list-style-type: decimal;
|
|
76
|
+
}
|
|
77
|
+
.main ol ul {
|
|
78
|
+
list-style-type: circle;
|
|
79
|
+
}
|
|
80
|
+
.main ol ul ul {
|
|
81
|
+
list-style-type: square;
|
|
82
|
+
}
|
|
83
|
+
.main table {
|
|
84
|
+
width: 100%;
|
|
85
|
+
table-layout: fixed;
|
|
86
|
+
border-collapse: separate;
|
|
87
|
+
border-radius: 8px;
|
|
88
|
+
border-spacing: 0;
|
|
89
|
+
border: 1px solid hsl(var(--hsdc-border));
|
|
90
|
+
overflow: hidden;
|
|
91
|
+
}
|
|
92
|
+
.main table thead {
|
|
93
|
+
background-color: hsl(var(--hsdc-muted));
|
|
94
|
+
}
|
|
95
|
+
.main table tbody td {
|
|
96
|
+
border-top: 1px solid hsl(var(--hsdc-border));
|
|
97
|
+
}
|
|
98
|
+
.main table tbody tr:hover {
|
|
99
|
+
background-color: hsl(var(--hsdc-muted)/0.5);
|
|
100
|
+
}
|
|
101
|
+
.main table th,
|
|
102
|
+
.main table td {
|
|
103
|
+
padding: 8px;
|
|
104
|
+
font-size: 0.875rem;
|
|
105
|
+
text-align: left;
|
|
106
|
+
}
|
|
107
|
+
.main table th :global(&.left),
|
|
108
|
+
.main table td :global(&.left) {
|
|
109
|
+
text-align: left;
|
|
110
|
+
}
|
|
111
|
+
.main table th :global(&.center),
|
|
112
|
+
.main table td :global(&.center) {
|
|
113
|
+
text-align: center;
|
|
114
|
+
}
|
|
115
|
+
.main table th :global(&.right),
|
|
116
|
+
.main table td :global(&.right) {
|
|
117
|
+
text-align: right;
|
|
118
|
+
}
|
|
119
|
+
.main code:not(pre code) {
|
|
120
|
+
border-radius: 4px;
|
|
121
|
+
display: inline-block;
|
|
122
|
+
box-sizing: border-box;
|
|
123
|
+
padding: 2px 8px;
|
|
124
|
+
font-family: var(--hsdc-font-code);
|
|
125
|
+
line-height: 1.5;
|
|
126
|
+
border: 1px solid hsl(var(--hsdc-border));
|
|
127
|
+
background-color: hsl(var(--hsdc-muted));
|
|
128
|
+
}
|
|
129
|
+
.main blockquote {
|
|
130
|
+
border-left: 12px solid hsl(var(--hsdc-border));
|
|
131
|
+
color: hsl(var(--hsdc-muted-foreground));
|
|
132
|
+
margin: 0;
|
|
133
|
+
padding: 0 16px;
|
|
134
|
+
}
|
|
135
|
+
.main blockquote blockquote {
|
|
136
|
+
margin: 0 12px;
|
|
137
|
+
}
|
|
138
|
+
.main a:not(article a) {
|
|
139
|
+
color: hsl(var(--hsdc-link));
|
|
140
|
+
}
|
|
141
|
+
.main a:not(article a):hover {
|
|
142
|
+
text-decoration-line: underline;
|
|
143
|
+
}
|
|
144
|
+
.main summary {
|
|
145
|
+
cursor: pointer;
|
|
146
|
+
}
|
|
147
|
+
.main :global(.footnotes) {
|
|
148
|
+
margin: 4rem 0 1.5rem 0;
|
|
149
|
+
color: hsl(var(--hsdc-muted-foreground));
|
|
150
|
+
}
|
|
151
|
+
.main :global(.footnotes) p {
|
|
152
|
+
margin: 0;
|
|
153
|
+
}
|
|
154
|
+
.main :global(.contains-task-list) {
|
|
155
|
+
list-style-type: none;
|
|
156
|
+
padding-left: 0;
|
|
157
|
+
}
|
|
158
|
+
.main :global(.contains-task-list) input {
|
|
159
|
+
margin-right: 0.5rem;
|
|
160
|
+
}
|
|
161
|
+
|
|
162
|
+
.main :global(.react-tweet-theme) p {
|
|
163
|
+
margin: 0;
|
|
164
|
+
line-height: 1.5;
|
|
165
|
+
font-size: 17px;
|
|
166
|
+
}
|
|
167
|
+
.main :global(.code-block) {
|
|
168
|
+
margin: 1.5rem 0;
|
|
169
|
+
border: 1px solid hsl(var(--hsdc-border));
|
|
170
|
+
border-radius: 8px;
|
|
171
|
+
overflow: hidden;
|
|
172
|
+
}
|
|
173
|
+
.main :global(.code-block) pre {
|
|
174
|
+
font-family: var(--hsdc-font-code);
|
|
175
|
+
font-size: 14px;
|
|
176
|
+
padding: 16px;
|
|
177
|
+
overflow: auto;
|
|
178
|
+
background-color: hsl(var(--hsdc-code-block));
|
|
179
|
+
}
|
|
180
|
+
.main :global(.code-block) :global(.code-block-header) {
|
|
181
|
+
display: flex;
|
|
182
|
+
flex-direction: row;
|
|
183
|
+
align-items: center;
|
|
184
|
+
gap: 8px;
|
|
185
|
+
font-size: 14px;
|
|
186
|
+
padding: 8px 16px;
|
|
187
|
+
background-color: hsl(var(--hsdc-muted));
|
|
188
|
+
border-bottom: 1px solid hsl(var(--hsdc-border));
|
|
189
|
+
}
|
|
190
|
+
.main :global(.code-block) :global(.code-block-filename) {
|
|
191
|
+
flex: 1 1 auto;
|
|
192
|
+
}
|
|
193
|
+
.main :global(.shiki) code {
|
|
194
|
+
width: 100%;
|
|
195
|
+
min-width: max-content;
|
|
196
|
+
display: flex;
|
|
197
|
+
flex-direction: column;
|
|
198
|
+
margin: 0 -16px;
|
|
199
|
+
}
|
|
200
|
+
.main :global(.shiki) :global(span.line) {
|
|
201
|
+
position: relative;
|
|
202
|
+
width: 100%;
|
|
203
|
+
padding: 0 16px;
|
|
204
|
+
}
|
|
205
|
+
.main :global(.shiki) :global(span.line.diff.add) {
|
|
206
|
+
background-color: hsl(var(--hsdc-shiki-diff-add)/0.1) !important;
|
|
207
|
+
}
|
|
208
|
+
.main :global(.shiki) :global(span.line.diff.add)::before {
|
|
209
|
+
position: absolute;
|
|
210
|
+
left: 2px;
|
|
211
|
+
content: "+";
|
|
212
|
+
color: hsl(var(--hsdc-shiki-diff-add));
|
|
213
|
+
}
|
|
214
|
+
.main :global(.shiki) :global(span.line.diff.remove) {
|
|
215
|
+
background-color: hsl(var(--hsdc-shiki-diff-remove)/0.1) !important;
|
|
216
|
+
}
|
|
217
|
+
.main :global(.shiki) :global(span.line.diff.remove)::before {
|
|
218
|
+
position: absolute;
|
|
219
|
+
left: 2px;
|
|
220
|
+
content: "-";
|
|
221
|
+
color: hsl(var(--hsdc-shiki-diff-remove));
|
|
222
|
+
}
|
|
223
|
+
.main :global(.shiki) :global(.highlighted-word) {
|
|
224
|
+
background-color: hsl(var(--hsdc-shiki-highlighted-word)/0.2);
|
|
225
|
+
padding: 2px 0;
|
|
226
|
+
margin: -2px 0;
|
|
227
|
+
}
|
|
228
|
+
.main :global(.link-card) {
|
|
229
|
+
display: flex;
|
|
230
|
+
flex-direction: row;
|
|
231
|
+
border: 1px solid hsl(var(--hsdc-border));
|
|
232
|
+
border-radius: 8px;
|
|
233
|
+
overflow: hidden;
|
|
234
|
+
color: inherit;
|
|
235
|
+
width: 100%;
|
|
236
|
+
max-height: 144px;
|
|
237
|
+
margin: 1.8rem 0;
|
|
238
|
+
}
|
|
239
|
+
.main :global(.link-card):hover {
|
|
240
|
+
text-decoration: none;
|
|
241
|
+
background-color: hsl(var(--hsdc-muted)/0.5);
|
|
242
|
+
}
|
|
243
|
+
.main :global(.link-card) :global(.link-card-main) {
|
|
244
|
+
flex: 1;
|
|
245
|
+
display: flex;
|
|
246
|
+
flex-direction: column;
|
|
247
|
+
padding: 12px 16px;
|
|
248
|
+
overflow: hidden;
|
|
249
|
+
gap: 8px;
|
|
250
|
+
}
|
|
251
|
+
.main :global(.link-card) :global(.link-card-main) > div {
|
|
252
|
+
overflow: hidden;
|
|
253
|
+
display: -webkit-box;
|
|
254
|
+
-webkit-box-orient: vertical;
|
|
255
|
+
line-clamp: 2;
|
|
256
|
+
}
|
|
257
|
+
.main :global(.link-card) :global(.link-card-main) :global(.link-card-title) {
|
|
258
|
+
flex: 1 1 auto;
|
|
259
|
+
}
|
|
260
|
+
.main :global(.link-card) :global(.link-card-main) :global(.link-card-description) {
|
|
261
|
+
font-size: 0.75rem;
|
|
262
|
+
color: hsl(var(--hsdc-muted-foreground));
|
|
263
|
+
}
|
|
264
|
+
.main :global(.link-card) :global(.link-card-main) :global(.link-card-domain) {
|
|
265
|
+
display: flex;
|
|
266
|
+
flex-direction: row;
|
|
267
|
+
align-items: center;
|
|
268
|
+
gap: 8px;
|
|
269
|
+
font-size: 0.75rem;
|
|
270
|
+
color: hsl(var(--hsdc-muted-foreground));
|
|
271
|
+
}
|
|
272
|
+
.main :global(.link-card) :global(.link-card-image) {
|
|
273
|
+
width: 35%;
|
|
274
|
+
}
|
|
275
|
+
.main :global(.link-card) :global(.link-card-image) img {
|
|
276
|
+
object-fit: cover;
|
|
277
|
+
width: 100%;
|
|
278
|
+
height: 100%;
|
|
279
|
+
}
|
package/license.md
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2024 Hacker Sheet
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/package.json
ADDED
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@hackersheet/next-document-content-components",
|
|
3
|
+
"version": "0.1.0-alpha.1",
|
|
4
|
+
"description": "Hacker Sheet document content components for Next.js",
|
|
5
|
+
"keywords": [],
|
|
6
|
+
"repository": {
|
|
7
|
+
"type": "git",
|
|
8
|
+
"url": "https://github.com/hackersheet/javascript.git",
|
|
9
|
+
"directory": "packages/next-document-content-components"
|
|
10
|
+
},
|
|
11
|
+
"license": "MIT",
|
|
12
|
+
"author": "",
|
|
13
|
+
"sideEffects": [
|
|
14
|
+
"*.css"
|
|
15
|
+
],
|
|
16
|
+
"exports": {
|
|
17
|
+
".": {
|
|
18
|
+
"require": "./dist/cjs/index.js",
|
|
19
|
+
"import": "./dist/esm/index.mjs",
|
|
20
|
+
"types": "./dist/esm/index.d.ts"
|
|
21
|
+
},
|
|
22
|
+
"./style": {
|
|
23
|
+
"import": "./dist/style.module.css",
|
|
24
|
+
"require": "./dist/style.module.css",
|
|
25
|
+
"types": "./dist/style.module.scss.d.ts"
|
|
26
|
+
}
|
|
27
|
+
},
|
|
28
|
+
"main": "./dist/cjs/index.js",
|
|
29
|
+
"module": "./dist/esm/index.mjs",
|
|
30
|
+
"types": "./dist/esm/index.d.ts",
|
|
31
|
+
"files": [
|
|
32
|
+
"dist"
|
|
33
|
+
],
|
|
34
|
+
"dependencies": {
|
|
35
|
+
"@hackersheet/core": "alpha",
|
|
36
|
+
"@hackersheet/react-document-content": "alpha",
|
|
37
|
+
"@next/third-parties": "^14.2.5",
|
|
38
|
+
"@shikijs/transformers": "^1.10.3",
|
|
39
|
+
"kifu-for-js": "^5.4.1",
|
|
40
|
+
"mermaid": "^10.9.1",
|
|
41
|
+
"next-themes": "^0.3.0",
|
|
42
|
+
"react-icons": "^5.2.1",
|
|
43
|
+
"react-tweet": "^3.2.1",
|
|
44
|
+
"shiki": "^1.10.3"
|
|
45
|
+
},
|
|
46
|
+
"devDependencies": {
|
|
47
|
+
"@types/react": "^18.0.0",
|
|
48
|
+
"@types/react-dom": "^18.0.0",
|
|
49
|
+
"next": "14.2.5",
|
|
50
|
+
"postcss": "8.4.39",
|
|
51
|
+
"react": "^18.0.0",
|
|
52
|
+
"react-dom": "^18.0.0",
|
|
53
|
+
"sass": "1.77.8",
|
|
54
|
+
"typed-scss-modules": "8.0.1",
|
|
55
|
+
"@hackersheet/eslint-config-custom": "0.0.0"
|
|
56
|
+
},
|
|
57
|
+
"peerDependencies": {
|
|
58
|
+
"next": "^14.0.0",
|
|
59
|
+
"react": "^18.0.0",
|
|
60
|
+
"react-dom": "^18.0.0"
|
|
61
|
+
},
|
|
62
|
+
"scripts": {
|
|
63
|
+
"build": "rm -rf ./dist && pnpm tsup && pnpm typegen:scss && pnpm build:css",
|
|
64
|
+
"build:css": "cp src/styles/*.ts dist && pnpm sass src/styles/style.module.scss dist/style.module.css --no-source-map",
|
|
65
|
+
"check": "pnpm tsc && pnpm lint",
|
|
66
|
+
"format": "pnpm -w format && pnpm lint:fix",
|
|
67
|
+
"lint": "eslint \"**/*.{ts,tsx}\"",
|
|
68
|
+
"lint:fix": "eslint --fix \"**/*.{ts,tsx}\"",
|
|
69
|
+
"pub": "pnpm publish --access=public --tag alpha",
|
|
70
|
+
"test": "echo \"Error: no test specified\" && exit 1",
|
|
71
|
+
"typegen:scss": "typed-scss-modules src/styles/style.module.scss"
|
|
72
|
+
}
|
|
73
|
+
}
|