@shiodome47/sekisho 0.0.0-stage → 0.1.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/LICENSE +33 -0
- package/README.md +140 -2
- package/dist/Sekisho-Bmo9R4cU.d.ts +173 -0
- package/dist/chunk-IQYSUTRQ.js +125 -0
- package/dist/chunk-IQYSUTRQ.js.map +1 -0
- package/dist/chunk-N6EMSDTH.js +205 -0
- package/dist/chunk-N6EMSDTH.js.map +1 -0
- package/dist/chunk-V2NPSBAT.js +381 -0
- package/dist/chunk-V2NPSBAT.js.map +1 -0
- package/dist/core/index.d.ts +179 -0
- package/dist/core/index.js +74 -0
- package/dist/core/index.js.map +1 -0
- package/dist/editor/index.d.ts +12 -0
- package/dist/editor/index.js +258 -0
- package/dist/editor/index.js.map +1 -0
- package/dist/index.d.ts +53 -0
- package/dist/index.js +516 -0
- package/dist/index.js.map +1 -0
- package/dist/style.css +768 -0
- package/dist/types-DxLG2LO0.d.ts +140 -0
- package/package.json +82 -4
|
@@ -0,0 +1,140 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* 関所めぐりのデータの形(@shiodome47/sekisho の土台)。
|
|
3
|
+
* 日時は ISO 8601 の文字列。
|
|
4
|
+
*
|
|
5
|
+
* コースの「設計」(Course)と、その人の「進み具合」(ItemProgress・Clear)を分けて持つ。
|
|
6
|
+
* こうすると、管理者がコースを新しい版にしても、進み具合は消えない。
|
|
7
|
+
*/
|
|
8
|
+
/**
|
|
9
|
+
* チェック項目の中身へのつなぎ。部品は中を見ない。アプリが表示と「開く」をする。
|
|
10
|
+
* 例: { type: 'segment', id: '…' }(手話アプリの区間)、{ type: 'lesson', id: '…' }(動画)
|
|
11
|
+
*/
|
|
12
|
+
interface TargetRef {
|
|
13
|
+
type: string;
|
|
14
|
+
id?: string;
|
|
15
|
+
[key: string]: unknown;
|
|
16
|
+
}
|
|
17
|
+
/**
|
|
18
|
+
* ご褒美の指定。type で、どのコネクタが出すかを決める。
|
|
19
|
+
* 例: { type: 'message', text: '…' }(ひみつの一言)、{ type: 'video', id: '…' }(アプリが足す)
|
|
20
|
+
*/
|
|
21
|
+
interface RewardRef {
|
|
22
|
+
type: string;
|
|
23
|
+
[key: string]: unknown;
|
|
24
|
+
}
|
|
25
|
+
/** チェック項目 */
|
|
26
|
+
interface CheckItem {
|
|
27
|
+
id: string;
|
|
28
|
+
/** 表示する文(「あいさつの区間を 10 回」など) */
|
|
29
|
+
title: string;
|
|
30
|
+
note?: string;
|
|
31
|
+
/** 中身へのつなぎ。無ければ文字だけの項目 */
|
|
32
|
+
target?: TargetRef;
|
|
33
|
+
/** くり返す回数(「10 回」)。無ければ 1 回(チェックを入れるだけ) */
|
|
34
|
+
count?: number;
|
|
35
|
+
}
|
|
36
|
+
/** 関所(チェック項目のまとまり。全部済んだらクリア) */
|
|
37
|
+
interface Gate {
|
|
38
|
+
id: string;
|
|
39
|
+
title: string;
|
|
40
|
+
description?: string;
|
|
41
|
+
items: CheckItem[];
|
|
42
|
+
/** スタンプの見た目。無ければ名前の 1 文字目・コースの色 */
|
|
43
|
+
stamp?: {
|
|
44
|
+
text?: string;
|
|
45
|
+
color?: string;
|
|
46
|
+
};
|
|
47
|
+
/** この関所のご褒美。無ければスタンプだけ */
|
|
48
|
+
reward?: RewardRef;
|
|
49
|
+
/** 点数。今は使わない(あとで足す場所) */
|
|
50
|
+
points?: number;
|
|
51
|
+
/** 作る画面(カードのボード)で置いた列と、列の中の順番。回る画面では使わない */
|
|
52
|
+
board?: {
|
|
53
|
+
column?: number;
|
|
54
|
+
order: number;
|
|
55
|
+
};
|
|
56
|
+
}
|
|
57
|
+
/** 回り方。'free' どこからでも(既定)/'ordered' 順番(前の関所をクリアすると次が開く) */
|
|
58
|
+
type Route = 'free' | 'ordered';
|
|
59
|
+
/** コース(関所の集まり) */
|
|
60
|
+
interface Course {
|
|
61
|
+
id: string;
|
|
62
|
+
title: string;
|
|
63
|
+
description?: string;
|
|
64
|
+
/** 'given' 与えられた(学ぶ人には読むだけ)/'own' 自分で作った */
|
|
65
|
+
origin: 'given' | 'own';
|
|
66
|
+
/** 回り方。無ければ 'free' */
|
|
67
|
+
route?: Route;
|
|
68
|
+
gates: Gate[];
|
|
69
|
+
/** スタンプの色(#rrggbb)。関所の stamp.color が優先 */
|
|
70
|
+
color?: string;
|
|
71
|
+
/** コースを全部クリアしたときのご褒美 */
|
|
72
|
+
reward?: RewardRef;
|
|
73
|
+
/** 設計の版。管理者が直して配り直すと上がる */
|
|
74
|
+
revision: number;
|
|
75
|
+
createdAt: string;
|
|
76
|
+
updatedAt: string;
|
|
77
|
+
}
|
|
78
|
+
/** 進み具合(1 人・1 チェック項目につき 1 件) */
|
|
79
|
+
interface ItemProgress {
|
|
80
|
+
/** `${courseId}|${itemId}`(progressId) */
|
|
81
|
+
id: string;
|
|
82
|
+
courseId: string;
|
|
83
|
+
itemId: string;
|
|
84
|
+
/** 今の回数(0 から、その項目の回数まで) */
|
|
85
|
+
done: number;
|
|
86
|
+
/** 済んだ日時(回数に届いたとき)。外すと消える */
|
|
87
|
+
checkedAt?: string;
|
|
88
|
+
updatedAt: string;
|
|
89
|
+
}
|
|
90
|
+
/**
|
|
91
|
+
* クリアの記録。gateId があれば関所のクリア、無ければコースを全部クリア。
|
|
92
|
+
* 一度付いたら消さない(項目を外しても残る。演出は 2 回目は出さない)
|
|
93
|
+
*/
|
|
94
|
+
interface Clear {
|
|
95
|
+
/** `${courseId}|${gateId}`、コースは `${courseId}|*`(clearId) */
|
|
96
|
+
id: string;
|
|
97
|
+
courseId: string;
|
|
98
|
+
gateId?: string;
|
|
99
|
+
clearedAt: string;
|
|
100
|
+
}
|
|
101
|
+
/** 部品が扱うデータ全部。アプリは、これを保存先から読んで渡す */
|
|
102
|
+
interface SekishoData {
|
|
103
|
+
courses: Course[];
|
|
104
|
+
progress: ItemProgress[];
|
|
105
|
+
clears: Clear[];
|
|
106
|
+
}
|
|
107
|
+
/** クリアの知らせ(画面がスタンプとご褒美を出すのに使う) */
|
|
108
|
+
interface ClearEvent {
|
|
109
|
+
kind: 'gate' | 'course';
|
|
110
|
+
course: Course;
|
|
111
|
+
/** kind === 'gate' のとき */
|
|
112
|
+
gate?: Gate;
|
|
113
|
+
/** クリアした関所の数(この知らせのぶんを入れて) */
|
|
114
|
+
cleared: number;
|
|
115
|
+
/** 関所の数 */
|
|
116
|
+
total: number;
|
|
117
|
+
at: string;
|
|
118
|
+
}
|
|
119
|
+
/**
|
|
120
|
+
* 変更(保存するもの)。関数はデータを直接は変えずに、これを返す。
|
|
121
|
+
* アプリは、これを保存先に書き、applyChanges で手元のデータにも当てる(planner と同じやり方)
|
|
122
|
+
*/
|
|
123
|
+
interface Changes {
|
|
124
|
+
courses?: Course[];
|
|
125
|
+
progress?: ItemProgress[];
|
|
126
|
+
clears?: Clear[];
|
|
127
|
+
deleteCourseIds?: string[];
|
|
128
|
+
deleteProgressIds?: string[];
|
|
129
|
+
deleteClearIds?: string[];
|
|
130
|
+
/** 新しくクリアしたもの(保存はしない。画面が演出に使う) */
|
|
131
|
+
events?: ClearEvent[];
|
|
132
|
+
}
|
|
133
|
+
/** アプリが知らせる「これをした」(自動のチェック)。target はチェック項目の target と同じ形 */
|
|
134
|
+
interface Activity {
|
|
135
|
+
target: TargetRef;
|
|
136
|
+
/** 何回分か。無ければ 1 */
|
|
137
|
+
amount?: number;
|
|
138
|
+
}
|
|
139
|
+
|
|
140
|
+
export type { Activity as A, ClearEvent as C, Gate as G, ItemProgress as I, RewardRef as R, SekishoData as S, TargetRef as T, Changes as a, CheckItem as b, Clear as c, Course as d, Route as e };
|
package/package.json
CHANGED
|
@@ -1,6 +1,84 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@shiodome47/sekisho",
|
|
3
|
-
"version": "0.
|
|
4
|
-
"
|
|
5
|
-
"
|
|
6
|
-
|
|
3
|
+
"version": "0.1.0",
|
|
4
|
+
"description": "関所めぐり: チェックリストをクリアしていくと、通行手形にスタンプが押される部品。コース・関所・チェック項目・ご褒美のコネクタ",
|
|
5
|
+
"keywords": [
|
|
6
|
+
"gamification",
|
|
7
|
+
"checklist",
|
|
8
|
+
"progress",
|
|
9
|
+
"stamp",
|
|
10
|
+
"rewards",
|
|
11
|
+
"learning"
|
|
12
|
+
],
|
|
13
|
+
"license": "MIT",
|
|
14
|
+
"repository": {
|
|
15
|
+
"type": "git",
|
|
16
|
+
"url": "git+https://github.com/shiodome47/sekisho.git"
|
|
17
|
+
},
|
|
18
|
+
"homepage": "https://github.com/shiodome47/sekisho#readme",
|
|
19
|
+
"bugs": "https://github.com/shiodome47/sekisho/issues",
|
|
20
|
+
"type": "module",
|
|
21
|
+
"sideEffects": [
|
|
22
|
+
"**/*.css"
|
|
23
|
+
],
|
|
24
|
+
"exports": {
|
|
25
|
+
".": {
|
|
26
|
+
"types": "./dist/index.d.ts",
|
|
27
|
+
"import": "./dist/index.js"
|
|
28
|
+
},
|
|
29
|
+
"./core": {
|
|
30
|
+
"types": "./dist/core/index.d.ts",
|
|
31
|
+
"import": "./dist/core/index.js"
|
|
32
|
+
},
|
|
33
|
+
"./editor": {
|
|
34
|
+
"types": "./dist/editor/index.d.ts",
|
|
35
|
+
"import": "./dist/editor/index.js"
|
|
36
|
+
},
|
|
37
|
+
"./style.css": "./dist/style.css",
|
|
38
|
+
"./package.json": "./package.json"
|
|
39
|
+
},
|
|
40
|
+
"files": [
|
|
41
|
+
"dist"
|
|
42
|
+
],
|
|
43
|
+
"scripts": {
|
|
44
|
+
"build": "tsup && node scripts/copy-css.mjs",
|
|
45
|
+
"test": "vitest run",
|
|
46
|
+
"test:watch": "vitest",
|
|
47
|
+
"typecheck": "tsc --noEmit",
|
|
48
|
+
"prepack": "npm run build",
|
|
49
|
+
"prepublishOnly": "npm run typecheck && npm test",
|
|
50
|
+
"dev": "vite --config examples/web/vite.config.ts",
|
|
51
|
+
"build:demo": "vite build --config examples/web/vite.config.ts"
|
|
52
|
+
},
|
|
53
|
+
"peerDependencies": {
|
|
54
|
+
"react": "^18.0.0 || ^19.0.0",
|
|
55
|
+
"react-dom": "^18.0.0 || ^19.0.0",
|
|
56
|
+
"linkshelf": "^0.9.1"
|
|
57
|
+
},
|
|
58
|
+
"peerDependenciesMeta": {
|
|
59
|
+
"linkshelf": {
|
|
60
|
+
"optional": true
|
|
61
|
+
}
|
|
62
|
+
},
|
|
63
|
+
"devDependencies": {
|
|
64
|
+
"@dnd-kit/core": "^6.3.1",
|
|
65
|
+
"@testing-library/dom": "^10.4.2",
|
|
66
|
+
"@testing-library/jest-dom": "^6.9.1",
|
|
67
|
+
"@testing-library/react": "^16.3.3",
|
|
68
|
+
"@types/node": "^22.20.5",
|
|
69
|
+
"@types/react": "^18.3.31",
|
|
70
|
+
"@types/react-dom": "^18.3.7",
|
|
71
|
+
"@vitejs/plugin-react": "^6.3.0",
|
|
72
|
+
"jsdom": "^26.1.0",
|
|
73
|
+
"linkshelf": "^0.9.1",
|
|
74
|
+
"react": "^18.3.1",
|
|
75
|
+
"react-dom": "^18.3.1",
|
|
76
|
+
"tsup": "^9.0.0",
|
|
77
|
+
"typescript": "^5.9.3",
|
|
78
|
+
"vite": "^8.3.8",
|
|
79
|
+
"vitest": "^5.1.1"
|
|
80
|
+
},
|
|
81
|
+
"publishConfig": {
|
|
82
|
+
"access": "public"
|
|
83
|
+
}
|
|
84
|
+
}
|