note-blog-kit 0.1.0 → 0.2.0

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/dist/styles.css CHANGED
@@ -21,6 +21,14 @@
21
21
  --nbk-radius: 8px;
22
22
  --nbk-list-gap: 24px;
23
23
  --nbk-card-min-width: 280px;
24
+ /* 本文(NoteArticleBody)。既定は note の本文に合わせる */
25
+ --nbk-body-max-width: 620px;
26
+ --nbk-body-font-size: 18px;
27
+ --nbk-body-line-height: 2;
28
+ --nbk-body-gap: 1.5em;
29
+ --nbk-color-subtle: #f5f8fa;
30
+ --nbk-color-button-bg: #08131a;
31
+ --nbk-color-button-text: #fff;
24
32
  }
25
33
 
26
34
  /* 一覧 */
@@ -208,6 +216,207 @@
208
216
  font-size: 0.875rem;
209
217
  }
210
218
 
219
+ /* 本文。要素ごとに付く nbk-body__* クラスだけに当てる */
220
+ .nbk-body {
221
+ max-width: var(--nbk-body-max-width);
222
+ margin: 0 auto;
223
+ font-family: var(--nbk-font-family);
224
+ font-size: var(--nbk-body-font-size);
225
+ line-height: var(--nbk-body-line-height);
226
+ color: var(--nbk-color-text);
227
+ overflow-wrap: anywhere;
228
+ }
229
+
230
+ .nbk-body__p,
231
+ .nbk-body__ul,
232
+ .nbk-body__ol,
233
+ .nbk-body__blockquote,
234
+ .nbk-body__figure,
235
+ .nbk-body__pre,
236
+ .nbk-body__table,
237
+ .nbk-toc,
238
+ .nbk-embed,
239
+ .nbk-body__more {
240
+ margin: 0 0 var(--nbk-body-gap);
241
+ }
242
+
243
+ /* リストの項目の中の段落(note はリストの項目を段落で包む)や、最後の段落の下に余白を残さない */
244
+ .nbk-body__p:last-child {
245
+ margin-bottom: 0;
246
+ }
247
+
248
+ .nbk-body__h2,
249
+ .nbk-body__h3,
250
+ .nbk-body__h4 {
251
+ margin: 2.5em 0 var(--nbk-body-gap);
252
+ font-weight: 700;
253
+ line-height: 1.5;
254
+ }
255
+
256
+ .nbk-body__h2 {
257
+ font-size: 1.333em;
258
+ }
259
+
260
+ .nbk-body__h3 {
261
+ font-size: 1.111em;
262
+ }
263
+
264
+ .nbk-body__h4 {
265
+ font-size: 1em;
266
+ }
267
+
268
+ .nbk-body__a {
269
+ color: inherit;
270
+ text-decoration: underline;
271
+ text-underline-offset: 0.2em;
272
+ }
273
+
274
+ .nbk-body__a:hover {
275
+ color: var(--nbk-color-accent);
276
+ }
277
+
278
+ .nbk-body__ul,
279
+ .nbk-body__ol {
280
+ padding-left: 1.5em;
281
+ }
282
+
283
+ .nbk-body__blockquote {
284
+ padding: 0 0 0 1em;
285
+ color: var(--nbk-color-muted);
286
+ text-align: left;
287
+ border-left: 4px solid var(--nbk-color-border);
288
+ }
289
+
290
+ .nbk-body__figure {
291
+ text-align: center;
292
+ }
293
+
294
+ .nbk-body__img {
295
+ max-width: 100%;
296
+ height: auto;
297
+ vertical-align: bottom;
298
+ }
299
+
300
+ .nbk-body__figcaption {
301
+ margin-top: 0.5em;
302
+ color: var(--nbk-color-muted);
303
+ font-size: 0.75em;
304
+ }
305
+
306
+ .nbk-body__figcaption:empty {
307
+ display: none;
308
+ }
309
+
310
+ .nbk-body__pre {
311
+ padding: 1em;
312
+ overflow-x: auto;
313
+ font-size: 0.8em;
314
+ line-height: 1.7;
315
+ background: var(--nbk-color-subtle);
316
+ border-radius: var(--nbk-radius);
317
+ }
318
+
319
+ .nbk-body__code {
320
+ font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
321
+ }
322
+
323
+ .nbk-body__hr {
324
+ margin: 2.5em 0;
325
+ border: 0;
326
+ border-top: 1px solid var(--nbk-color-border);
327
+ }
328
+
329
+ .nbk-body__table {
330
+ display: block;
331
+ overflow-x: auto;
332
+ border-collapse: collapse;
333
+ font-size: 0.875em;
334
+ }
335
+
336
+ .nbk-body__th,
337
+ .nbk-body__td {
338
+ padding: 0.5em 0.75em;
339
+ border: 1px solid var(--nbk-color-border);
340
+ }
341
+
342
+ /* 目次 */
343
+ .nbk-toc {
344
+ padding: 1em 1.5em;
345
+ background: var(--nbk-color-subtle);
346
+ border-radius: var(--nbk-radius);
347
+ }
348
+
349
+ .nbk-toc__title {
350
+ margin: 0 0 0.5em;
351
+ font-weight: 700;
352
+ }
353
+
354
+ .nbk-toc__list {
355
+ margin: 0;
356
+ padding: 0;
357
+ list-style: none;
358
+ font-size: 0.875em;
359
+ line-height: 1.8;
360
+ }
361
+
362
+ .nbk-toc__item {
363
+ margin: 0;
364
+ }
365
+
366
+ .nbk-toc__item--h2 {
367
+ font-weight: 700;
368
+ }
369
+
370
+ .nbk-toc__item--h3 {
371
+ padding-left: 1em;
372
+ }
373
+
374
+ .nbk-toc__link {
375
+ color: inherit;
376
+ text-decoration: none;
377
+ }
378
+
379
+ .nbk-toc__link:hover {
380
+ color: var(--nbk-color-accent);
381
+ }
382
+
383
+ /* 埋め込み */
384
+ .nbk-embed {
385
+ padding: 1em;
386
+ border: 1px solid var(--nbk-color-border);
387
+ border-radius: var(--nbk-radius);
388
+ }
389
+
390
+ .nbk-embed__link {
391
+ color: inherit;
392
+ text-decoration: none;
393
+ overflow-wrap: anywhere;
394
+ }
395
+
396
+ .nbk-embed__link:hover {
397
+ color: var(--nbk-color-accent);
398
+ }
399
+
400
+ /* 続きは note で */
401
+ .nbk-body__more {
402
+ text-align: center;
403
+ }
404
+
405
+ .nbk-body__more-link {
406
+ display: inline-block;
407
+ padding: 0.5em 2em;
408
+ color: var(--nbk-color-button-text);
409
+ font-size: 0.875em;
410
+ font-weight: 700;
411
+ text-decoration: none;
412
+ background: var(--nbk-color-button-bg);
413
+ border-radius: 999px;
414
+ }
415
+
416
+ .nbk-body__more-link:hover {
417
+ opacity: 0.8;
418
+ }
419
+
211
420
  @media (prefers-reduced-motion: reduce) {
212
421
  .nbk-card__link,
213
422
  .nbk-pagination__prev,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "note-blog-kit",
3
- "version": "0.1.0",
3
+ "version": "0.2.0",
4
4
  "description": "Show your own note articles as a blog on React / Next.js sites (unofficial)",
5
5
  "license": "MIT",
6
6
  "author": "ludy-kida",
@@ -21,7 +21,7 @@
21
21
  "**/*.css"
22
22
  ],
23
23
  "engines": {
24
- "node": ">=20"
24
+ "node": ">=22.12"
25
25
  },
26
26
  "files": [
27
27
  "dist"
@@ -76,19 +76,11 @@
76
76
  "main": "./dist/index.cjs",
77
77
  "module": "./dist/index.js",
78
78
  "types": "./dist/index.d.ts",
79
- "scripts": {
80
- "build": "tsup",
81
- "typecheck": "tsc --noEmit",
82
- "api": "node ../../scripts/run-api-extractor.mjs",
83
- "api:check": "node ../../scripts/run-api-extractor.mjs --check",
84
- "check:dist": "publint --strict && attw --pack . --profile node16 --exclude-entrypoints ./styles.css",
85
- "size": "size-limit"
86
- },
87
79
  "publishConfig": {
88
- "access": "public",
89
- "provenance": true
80
+ "access": "public"
90
81
  },
91
82
  "dependencies": {
83
+ "sanitize-html": "^2.18.2",
92
84
  "zod": "^4.6.7"
93
85
  },
94
86
  "peerDependencies": {
@@ -104,8 +96,17 @@
104
96
  "@testing-library/react": "^16.3.3",
105
97
  "@types/react": "^19.3.0",
106
98
  "@types/react-dom": "^19.3.0",
99
+ "@types/sanitize-html": "^2.16.2",
107
100
  "happy-dom": "^21.0.4",
108
101
  "react": "^19.3.1",
109
102
  "react-dom": "^19.3.1"
103
+ },
104
+ "scripts": {
105
+ "build": "tsup",
106
+ "typecheck": "tsc --noEmit",
107
+ "api": "node ../../scripts/run-api-extractor.mjs",
108
+ "api:check": "node ../../scripts/run-api-extractor.mjs --check",
109
+ "check:dist": "publint --strict && attw --pack . --profile node16 --exclude-entrypoints ./styles.css",
110
+ "size": "size-limit"
110
111
  }
111
- }
112
+ }