required-doc 0.0.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/README.md +298 -0
- package/dist/index.js +1758 -0
- package/package.json +34 -0
- package/style.css +51 -0
- package/types.d.ts +51 -0
package/package.json
ADDED
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "required-doc",
|
|
3
|
+
"version": "0.0.0",
|
|
4
|
+
"type": "module",
|
|
5
|
+
"files": ["dist", "style.css", "types.d.ts"],
|
|
6
|
+
"main": "./dist/index.js",
|
|
7
|
+
"module": "./dist/index.js",
|
|
8
|
+
"types": "./types.d.ts",
|
|
9
|
+
"exports": {
|
|
10
|
+
".": {
|
|
11
|
+
"types": "./types.d.ts",
|
|
12
|
+
"import": "./dist/index.js"
|
|
13
|
+
},
|
|
14
|
+
"./style.css": "./style.css"
|
|
15
|
+
},
|
|
16
|
+
"sideEffects": ["**/*.css"],
|
|
17
|
+
"scripts": {
|
|
18
|
+
"build": "vite build"
|
|
19
|
+
},
|
|
20
|
+
"peerDependencies": {
|
|
21
|
+
"vue": "^3.5.0",
|
|
22
|
+
"vue-router": "^4.0.0"
|
|
23
|
+
},
|
|
24
|
+
"dependencies": {
|
|
25
|
+
"marked": "^15.0.0"
|
|
26
|
+
},
|
|
27
|
+
"devDependencies": {
|
|
28
|
+
"@vitejs/plugin-vue": "^6.0.6",
|
|
29
|
+
"typescript": "~6.0.2",
|
|
30
|
+
"vite": "^8.0.12",
|
|
31
|
+
"vue": "^3.5.34",
|
|
32
|
+
"vue-router": "^4.6.4"
|
|
33
|
+
}
|
|
34
|
+
}
|
package/style.css
ADDED
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
/* spec-viewer の独自スタイル(Tailwind ユーティリティは利用側の Tailwind が生成する)。
|
|
2
|
+
preflight で消える見出し/リスト/表を req-md 内で復活させ、ダーク配色も定義する。 */
|
|
3
|
+
|
|
4
|
+
body {
|
|
5
|
+
margin: 0;
|
|
6
|
+
background-color: #f5f6f8;
|
|
7
|
+
color: #1f2937;
|
|
8
|
+
font-family: system-ui, -apple-system, "Segoe UI", sans-serif;
|
|
9
|
+
transition: background-color 0.2s, color 0.2s;
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
html.dark body {
|
|
13
|
+
background-color: #0f1115;
|
|
14
|
+
color: #e5e7eb;
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
.req-md h1 { font-size: 1.5rem; font-weight: 700; margin: 0 0 0.75rem; }
|
|
18
|
+
.req-md h2 { font-size: 1.25rem; font-weight: 700; margin: 1.25rem 0 0.5rem; }
|
|
19
|
+
.req-md h3 { font-size: 1.05rem; font-weight: 700; margin: 1rem 0 0.4rem; }
|
|
20
|
+
.req-md p { margin: 0.5rem 0; line-height: 1.7; }
|
|
21
|
+
.req-md ul { list-style: disc; padding-left: 1.4rem; margin: 0.5rem 0; }
|
|
22
|
+
.req-md ol { list-style: decimal; padding-left: 1.4rem; margin: 0.5rem 0; }
|
|
23
|
+
.req-md li { margin: 0.2rem 0; line-height: 1.6; }
|
|
24
|
+
.req-md code {
|
|
25
|
+
background: #eef0f3;
|
|
26
|
+
padding: 0.1rem 0.35rem;
|
|
27
|
+
border-radius: 4px;
|
|
28
|
+
font-size: 0.85em;
|
|
29
|
+
}
|
|
30
|
+
.req-md table {
|
|
31
|
+
width: 100%;
|
|
32
|
+
border-collapse: collapse;
|
|
33
|
+
margin: 0.75rem 0;
|
|
34
|
+
font-size: 0.9rem;
|
|
35
|
+
}
|
|
36
|
+
.req-md th,
|
|
37
|
+
.req-md td {
|
|
38
|
+
border: 1px solid #d1d5db;
|
|
39
|
+
padding: 0.4rem 0.6rem;
|
|
40
|
+
text-align: left;
|
|
41
|
+
}
|
|
42
|
+
.req-md th { background: #f3f4f6; font-weight: 700; }
|
|
43
|
+
.req-md a { color: #2563eb; text-decoration: underline; }
|
|
44
|
+
.req-md hr { border: none; border-top: 1px solid #e5e7eb; margin: 1rem 0; }
|
|
45
|
+
|
|
46
|
+
.dark .req-md code { background: #374151; }
|
|
47
|
+
.dark .req-md th { background: #374151; }
|
|
48
|
+
.dark .req-md th,
|
|
49
|
+
.dark .req-md td { border-color: #4b5563; }
|
|
50
|
+
.dark .req-md a { color: #60a5fa; }
|
|
51
|
+
.dark .req-md hr { border-top-color: #374151; }
|
package/types.d.ts
ADDED
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
import type { App, Component } from 'vue'
|
|
2
|
+
|
|
3
|
+
export type ItemKind = 'component' | 'page'
|
|
4
|
+
|
|
5
|
+
export interface VersionEntry {
|
|
6
|
+
view: string | Component
|
|
7
|
+
req: string
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
export interface ItemMeta {
|
|
11
|
+
name: string
|
|
12
|
+
kind: ItemKind
|
|
13
|
+
title: string
|
|
14
|
+
desc: string
|
|
15
|
+
latest: string
|
|
16
|
+
versions: Record<string, VersionEntry>
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
export interface ColorToken {
|
|
20
|
+
name: string
|
|
21
|
+
light: string
|
|
22
|
+
dark: string
|
|
23
|
+
desc?: string
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
export interface DeviceConfig {
|
|
27
|
+
id: string
|
|
28
|
+
label: string
|
|
29
|
+
frame: 'pc' | 'phone' | 'tablet'
|
|
30
|
+
width: number
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
export interface BaseColorSet {
|
|
34
|
+
bg: string
|
|
35
|
+
font: string
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
export interface SpecViewerOptions {
|
|
39
|
+
showThemeToggle?: boolean
|
|
40
|
+
devices?: DeviceConfig[]
|
|
41
|
+
baseColors?: { light: BaseColorSet; dark: BaseColorSet }
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
export interface SpecViewerConfig {
|
|
45
|
+
components: ItemMeta[]
|
|
46
|
+
pages: ItemMeta[]
|
|
47
|
+
colors: ColorToken[]
|
|
48
|
+
options?: SpecViewerOptions
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
export function createSpecViewer(config: SpecViewerConfig): App
|