create-pincast 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/README.md +12 -5
- package/package.json +16 -5
- package/src/cli.js +5 -173
- package/src/api.js +0 -138
- package/src/firstrun.js +0 -83
- package/src/starter.js +0 -156
- package/template/LICENSE +0 -21
- package/template/README.md +0 -91
- package/template/_env.example +0 -8
- package/template/_gitignore +0 -5
- package/template/_package-lock.json +0 -2626
- package/template/data/sample-collects.json +0 -12
- package/template/data/set.json +0 -14
- package/template/index.html +0 -12
- package/template/package.json +0 -28
- package/template/server/collection.js +0 -23
- package/template/server/index.js +0 -45
- package/template/server/route.js +0 -74
- package/template/shared/app.js +0 -11
- package/template/src/App.vue +0 -19
- package/template/src/lantern.css +0 -35
- package/template/src/main.js +0 -7
- package/template/src/tabletop.js +0 -27
- package/template/test/conformance.test.js +0 -18
- package/template/test/goldens/lantern-walk.table-laptop.html +0 -366
- package/template/test/goldens/lantern-walk.table-phone.html +0 -366
- package/template/test/mock-api.js +0 -48
- package/template/test/route.test.js +0 -142
- package/template/vite.config.js +0 -16
- package/template.json +0 -29
|
@@ -1,366 +0,0 @@
|
|
|
1
|
-
<div class="tt lantern-theme" style="--card-w: 111px; --gap: 6px;">
|
|
2
|
-
<header class="tt-top">
|
|
3
|
-
<div class="tt-top-in">
|
|
4
|
-
<a class="tt-back" href="https://github.com/pincastFM/placecard-kit-public">
|
|
5
|
-
<svg class="tt-i" viewBox="0 0 24 24" aria-hidden="true">
|
|
6
|
-
<path d="m15 18-6-6 6-6">
|
|
7
|
-
</path>
|
|
8
|
-
</svg>
|
|
9
|
-
<span>The kit</span>
|
|
10
|
-
</a>
|
|
11
|
-
<!--v-if-->
|
|
12
|
-
<span class="tt-cnt" aria-live="polite">
|
|
13
|
-
<b>5</b>
|
|
14
|
-
<span class="tt-cl">Cards</span>
|
|
15
|
-
<!--v-if-->
|
|
16
|
-
</span>
|
|
17
|
-
<div class="tt-top-sl">
|
|
18
|
-
<div class="tt-search is-open" role="search">
|
|
19
|
-
<button class="tt-s-btn" type="button" aria-label="Search">
|
|
20
|
-
<svg class="tt-i tt-i16" viewBox="0 0 24 24" aria-hidden="true">
|
|
21
|
-
<circle cx="11" cy="11" r="8">
|
|
22
|
-
</circle>
|
|
23
|
-
<path d="m21 21-4.3-4.3">
|
|
24
|
-
</path>
|
|
25
|
-
</svg>
|
|
26
|
-
</button>
|
|
27
|
-
<input type="search" placeholder="Name" aria-label="Name" autocomplete="off" autocapitalize="off" spellcheck="false" enterkeyhint="search">
|
|
28
|
-
<button class="tt-s-x" type="button" aria-label="Clear" hidden="">
|
|
29
|
-
<svg class="tt-i tt-i16" viewBox="0 0 24 24" aria-hidden="true">
|
|
30
|
-
<path d="M18 6 6 18">
|
|
31
|
-
</path>
|
|
32
|
-
<path d="m6 6 12 12">
|
|
33
|
-
</path>
|
|
34
|
-
</svg>
|
|
35
|
-
</button>
|
|
36
|
-
</div>
|
|
37
|
-
<div class="tt-slrow">
|
|
38
|
-
<div class="tt-ruler" style="--p: 17.74%;">
|
|
39
|
-
<input type="range" min="56" max="366" step="1" aria-label="Card size" aria-valuetext="3 across">
|
|
40
|
-
<span class="tt-tk is-on" style="left: calc(7px + 0.1774 * (100% - 14px));">
|
|
41
|
-
<span>3</span>
|
|
42
|
-
</span>
|
|
43
|
-
<span class="tt-tk" style="left: calc(7px + 0.3032 * (100% - 14px));">
|
|
44
|
-
<span>2</span>
|
|
45
|
-
</span>
|
|
46
|
-
<span class="tt-tk" style="left: calc(7px + 0.3871 * (100% - 14px));">
|
|
47
|
-
<span>2</span>
|
|
48
|
-
</span>
|
|
49
|
-
<span class="tt-tk" style="left: calc(7px + 0.5935 * (100% - 14px));">
|
|
50
|
-
<span>1</span>
|
|
51
|
-
</span>
|
|
52
|
-
</div>
|
|
53
|
-
<output class="tt-acr">3×</output>
|
|
54
|
-
</div>
|
|
55
|
-
</div>
|
|
56
|
-
<button class="tt-stk" type="button" aria-pressed="false">
|
|
57
|
-
<svg class="tt-i" viewBox="0 0 24 24" aria-hidden="true">
|
|
58
|
-
<path d="m12.83 2.18a2 2 0 0 0-1.66 0L2.6 6.08a1 1 0 0 0 0 1.83l8.58 3.91a2 2 0 0 0 1.66 0l8.58-3.9a1 1 0 0 0 0-1.83Z">
|
|
59
|
-
</path>
|
|
60
|
-
<path d="m22 17.65-9.17 4.16a2 2 0 0 1-1.66 0L2 17.65">
|
|
61
|
-
</path>
|
|
62
|
-
<path d="m22 12.65-9.17 4.16a2 2 0 0 1-1.66 0L2 12.65">
|
|
63
|
-
</path>
|
|
64
|
-
</svg>
|
|
65
|
-
<span>Stack</span>
|
|
66
|
-
</button>
|
|
67
|
-
</div>
|
|
68
|
-
</header>
|
|
69
|
-
<div class="tt-strip">
|
|
70
|
-
<nav class="tt-ledger" aria-label="Sets">
|
|
71
|
-
<button class="tt-lg" type="button" data-lg="set:old-town-lanterns" style="--app: #B4532A;" aria-current="true" aria-label="Old Town, 5 of 8">
|
|
72
|
-
<span class="tt-lg-top">
|
|
73
|
-
<span class="tt-lg-name">
|
|
74
|
-
<i>
|
|
75
|
-
</i>OLD TOWN</span>
|
|
76
|
-
<span class="tt-lg-fig">
|
|
77
|
-
<b>5</b>/8</span>
|
|
78
|
-
</span>
|
|
79
|
-
<span class="tt-bar" style="--n: 8; background: linear-gradient(90deg,var(--chrome) 0.000% 12.500%,var(--chrome) 12.500% 25.000%,var(--line-2) 25.000% 37.500%,var(--chrome) 37.500% 50.000%,var(--chrome) 50.000% 62.500%,var(--line-2) 62.500% 75.000%,var(--chrome) 75.000% 87.500%,var(--line-2) 87.500% 100.000%);">
|
|
80
|
-
</span>
|
|
81
|
-
</button>
|
|
82
|
-
</nav>
|
|
83
|
-
<div class="tt-strip-rail">
|
|
84
|
-
<div class="tt-rail">
|
|
85
|
-
<div class="tt-seg" role="radiogroup" aria-label="Group">
|
|
86
|
-
<button type="button" role="radio" aria-checked="true">Set</button>
|
|
87
|
-
<button type="button" role="radio" aria-checked="false">App</button>
|
|
88
|
-
<button type="button" role="radio" aria-checked="false">Kind</button>
|
|
89
|
-
<button type="button" role="radio" aria-checked="false">Rarity</button>
|
|
90
|
-
<button type="button" role="radio" aria-checked="false">None</button>
|
|
91
|
-
</div>
|
|
92
|
-
<button class="tt-chip" type="button" data-k="missing" aria-pressed="false">
|
|
93
|
-
<!--v-if-->
|
|
94
|
-
<!--v-if--> Missing<span class="tt-v">3</span>
|
|
95
|
-
</button>
|
|
96
|
-
<button class="tt-chip" type="button" data-k="rarity" aria-haspopup="true" aria-expanded="false">
|
|
97
|
-
<!--v-if-->
|
|
98
|
-
<!--v-if--> Rarity<!--v-if-->
|
|
99
|
-
</button>
|
|
100
|
-
<button class="tt-chip" type="button" data-k="sort" aria-haspopup="true" aria-expanded="false">
|
|
101
|
-
<!--v-if-->
|
|
102
|
-
<svg class="tt-i tt-i16" viewBox="0 0 24 24" aria-hidden="true">
|
|
103
|
-
<path d="m3 16 4 4 4-4">
|
|
104
|
-
</path>
|
|
105
|
-
<path d="M7 20V4">
|
|
106
|
-
</path>
|
|
107
|
-
<path d="m21 8-4-4-4 4">
|
|
108
|
-
</path>
|
|
109
|
-
<path d="M17 4v16">
|
|
110
|
-
</path>
|
|
111
|
-
</svg> Newest<!--v-if-->
|
|
112
|
-
</button>
|
|
113
|
-
<!--v-if-->
|
|
114
|
-
</div>
|
|
115
|
-
</div>
|
|
116
|
-
</div>
|
|
117
|
-
<main class="tt-main">
|
|
118
|
-
<div class="tt-groups is-solo">
|
|
119
|
-
<section class="tt-grp" data-sec="set:old-town-lanterns">
|
|
120
|
-
<button class="tt-bx" type="button" data-g="set:old-town-lanterns" style="--app: #B4532A;" aria-expanded="true" aria-label="Old Town, stack">
|
|
121
|
-
<span class="tt-bx-row">
|
|
122
|
-
<span class="tt-bx-name">OLD TOWN</span>
|
|
123
|
-
<!--v-if-->
|
|
124
|
-
<span class="tt-bx-end">
|
|
125
|
-
<!--v-if-->
|
|
126
|
-
<span class="tt-bx-fig">
|
|
127
|
-
<b>5</b>
|
|
128
|
-
<i> of 8</i>
|
|
129
|
-
<!--v-if-->
|
|
130
|
-
</span>
|
|
131
|
-
<svg class="tt-i tt-i16" viewBox="0 0 24 24" aria-hidden="true">
|
|
132
|
-
<path d="m12.83 2.18a2 2 0 0 0-1.66 0L2.6 6.08a1 1 0 0 0 0 1.83l8.58 3.91a2 2 0 0 0 1.66 0l8.58-3.9a1 1 0 0 0 0-1.83Z">
|
|
133
|
-
</path>
|
|
134
|
-
<path d="m22 17.65-9.17 4.16a2 2 0 0 1-1.66 0L2 17.65">
|
|
135
|
-
</path>
|
|
136
|
-
<path d="m22 12.65-9.17 4.16a2 2 0 0 1-1.66 0L2 12.65">
|
|
137
|
-
</path>
|
|
138
|
-
</svg>
|
|
139
|
-
</span>
|
|
140
|
-
</span>
|
|
141
|
-
<span class="tt-bar" style="--n: 8; background: linear-gradient(90deg,var(--chrome) 0.000% 12.500%,var(--chrome) 12.500% 25.000%,var(--line-2) 25.000% 37.500%,var(--chrome) 37.500% 50.000%,var(--chrome) 50.000% 62.500%,var(--line-2) 62.500% 75.000%,var(--chrome) 75.000% 87.500%,var(--line-2) 87.500% 100.000%);">
|
|
142
|
-
</span>
|
|
143
|
-
</button>
|
|
144
|
-
<div class="tt-grid">
|
|
145
|
-
<div class="tt-cell" data-id="lantern-walk:old-town-lanterns:lantern:harbor-light" data-face="lantern" data-held="true">
|
|
146
|
-
<div class="ttf ttf-front ttf-destination ttf-t-base ttf-c20 ttf-typo" lang="en" data-face="lantern" data-held="true" data-foil="false" data-id="lantern-walk:old-town-lanterns:lantern:harbor-light" style="--ac: #b4532a; --dp: #9d4a28; --lw: 6; --tl: 1;">
|
|
147
|
-
<span class="ttf-card">
|
|
148
|
-
<!-- Front, Treehopper print (cards.css .th-card, SpeciesCard.vue, BinderTile.vue) -->
|
|
149
|
-
<!-- Front, C20 without a photograph: the typographic face (LLStopCard.vue:36-40) -->
|
|
150
|
-
<span class="ttf-face">
|
|
151
|
-
<span class="ttf-art is-typo">
|
|
152
|
-
<span class="ttf-chip">OLD TOWN · <span class="ttf-no">No. 07</span>
|
|
153
|
-
</span>
|
|
154
|
-
<span class="ttf-mark" aria-hidden="true">07</span>
|
|
155
|
-
<span class="ttf-typo-in">
|
|
156
|
-
<span class="ttf-typo-type">The Long Quay</span>
|
|
157
|
-
<span class="ttf-typo-name">Harbor Light</span>
|
|
158
|
-
<span class="ttf-typo-fact">Seen from two miles out</span>
|
|
159
|
-
</span>
|
|
160
|
-
</span>
|
|
161
|
-
<span class="ttf-grain" aria-hidden="true">
|
|
162
|
-
</span>
|
|
163
|
-
</span>
|
|
164
|
-
<!--v-if-->
|
|
165
|
-
</span>
|
|
166
|
-
</div>
|
|
167
|
-
<button class="tt-hit" type="button" aria-label="Harbor Light, Old Town">
|
|
168
|
-
</button>
|
|
169
|
-
</div>
|
|
170
|
-
<div class="tt-cell" data-id="lantern-walk:old-town-lanterns:lantern:bell-yard" data-face="lantern" data-held="true">
|
|
171
|
-
<div class="ttf ttf-front ttf-destination ttf-t-base ttf-c20 ttf-typo" lang="en" data-face="lantern" data-held="true" data-foil="false" data-id="lantern-walk:old-town-lanterns:lantern:bell-yard" style="--ac: #b4532a; --dp: #9d4a28; --lw: 4; --tl: 1;">
|
|
172
|
-
<span class="ttf-card">
|
|
173
|
-
<!-- Front, Treehopper print (cards.css .th-card, SpeciesCard.vue, BinderTile.vue) -->
|
|
174
|
-
<!-- Front, C20 without a photograph: the typographic face (LLStopCard.vue:36-40) -->
|
|
175
|
-
<span class="ttf-face">
|
|
176
|
-
<span class="ttf-art is-typo">
|
|
177
|
-
<span class="ttf-chip">OLD TOWN · <span class="ttf-no">No. 05</span>
|
|
178
|
-
</span>
|
|
179
|
-
<span class="ttf-mark" aria-hidden="true">05</span>
|
|
180
|
-
<span class="ttf-typo-in">
|
|
181
|
-
<span class="ttf-typo-type">Chapel Row</span>
|
|
182
|
-
<span class="ttf-typo-name">Bell Yard</span>
|
|
183
|
-
<span class="ttf-typo-fact">Rings when the wind turns</span>
|
|
184
|
-
</span>
|
|
185
|
-
</span>
|
|
186
|
-
<span class="ttf-grain" aria-hidden="true">
|
|
187
|
-
</span>
|
|
188
|
-
</span>
|
|
189
|
-
<!--v-if-->
|
|
190
|
-
</span>
|
|
191
|
-
</div>
|
|
192
|
-
<button class="tt-hit" type="button" aria-label="Bell Yard, Old Town">
|
|
193
|
-
</button>
|
|
194
|
-
</div>
|
|
195
|
-
<div class="tt-cell" data-id="lantern-walk:old-town-lanterns:lantern:market-cross" data-face="lantern" data-held="true">
|
|
196
|
-
<div class="ttf ttf-front ttf-destination ttf-t-base ttf-c20 ttf-typo" lang="en" data-face="lantern" data-held="true" data-foil="false" data-id="lantern-walk:old-town-lanterns:lantern:market-cross" style="--ac: #b4532a; --dp: #9d4a28; --lw: 6; --tl: 1;">
|
|
197
|
-
<span class="ttf-card">
|
|
198
|
-
<!-- Front, Treehopper print (cards.css .th-card, SpeciesCard.vue, BinderTile.vue) -->
|
|
199
|
-
<!-- Front, C20 without a photograph: the typographic face (LLStopCard.vue:36-40) -->
|
|
200
|
-
<span class="ttf-face">
|
|
201
|
-
<span class="ttf-art is-typo">
|
|
202
|
-
<span class="ttf-chip">OLD TOWN · <span class="ttf-no">No. 04</span>
|
|
203
|
-
</span>
|
|
204
|
-
<span class="ttf-mark" aria-hidden="true">04</span>
|
|
205
|
-
<span class="ttf-typo-in">
|
|
206
|
-
<span class="ttf-typo-type">Market Square</span>
|
|
207
|
-
<span class="ttf-typo-name">Market Cross</span>
|
|
208
|
-
<span class="ttf-typo-fact">Four panes, one for each road</span>
|
|
209
|
-
</span>
|
|
210
|
-
</span>
|
|
211
|
-
<span class="ttf-grain" aria-hidden="true">
|
|
212
|
-
</span>
|
|
213
|
-
</span>
|
|
214
|
-
<!--v-if-->
|
|
215
|
-
</span>
|
|
216
|
-
</div>
|
|
217
|
-
<button class="tt-hit" type="button" aria-label="Market Cross, Old Town">
|
|
218
|
-
</button>
|
|
219
|
-
</div>
|
|
220
|
-
<div class="tt-cell" data-id="lantern-walk:old-town-lanterns:lantern:chandlers-corner" data-face="lantern" data-held="true">
|
|
221
|
-
<div class="ttf ttf-front ttf-destination ttf-t-base ttf-c20 ttf-typo" lang="en" data-face="lantern" data-held="true" data-foil="false" data-id="lantern-walk:old-town-lanterns:lantern:chandlers-corner" style="--ac: #b4532a; --dp: #9d4a28; --lw: 10; --tl: 1;">
|
|
222
|
-
<span class="ttf-card">
|
|
223
|
-
<!-- Front, Treehopper print (cards.css .th-card, SpeciesCard.vue, BinderTile.vue) -->
|
|
224
|
-
<!-- Front, C20 without a photograph: the typographic face (LLStopCard.vue:36-40) -->
|
|
225
|
-
<span class="ttf-face">
|
|
226
|
-
<span class="ttf-art is-typo">
|
|
227
|
-
<span class="ttf-chip">OLD TOWN · <span class="ttf-no">No. 02</span>
|
|
228
|
-
</span>
|
|
229
|
-
<span class="ttf-mark" aria-hidden="true">02</span>
|
|
230
|
-
<span class="ttf-typo-in">
|
|
231
|
-
<span class="ttf-typo-type">Rope Lane</span>
|
|
232
|
-
<span class="ttf-typo-name">Chandler's Corner</span>
|
|
233
|
-
<span class="ttf-typo-fact">Burned whale oil until 1902</span>
|
|
234
|
-
</span>
|
|
235
|
-
</span>
|
|
236
|
-
<span class="ttf-grain" aria-hidden="true">
|
|
237
|
-
</span>
|
|
238
|
-
</span>
|
|
239
|
-
<!--v-if-->
|
|
240
|
-
</span>
|
|
241
|
-
</div>
|
|
242
|
-
<button class="tt-hit" type="button" aria-label="Chandler's Corner, Old Town">
|
|
243
|
-
</button>
|
|
244
|
-
</div>
|
|
245
|
-
<div class="tt-cell" data-id="lantern-walk:old-town-lanterns:lantern:ferry-steps" data-face="lantern" data-held="true">
|
|
246
|
-
<div class="ttf ttf-front ttf-destination ttf-t-base ttf-c20 ttf-typo" lang="en" data-face="lantern" data-held="true" data-foil="false" data-id="lantern-walk:old-town-lanterns:lantern:ferry-steps" style="--ac: #b4532a; --dp: #9d4a28; --lw: 5; --tl: 1;">
|
|
247
|
-
<span class="ttf-card">
|
|
248
|
-
<!-- Front, Treehopper print (cards.css .th-card, SpeciesCard.vue, BinderTile.vue) -->
|
|
249
|
-
<!-- Front, C20 without a photograph: the typographic face (LLStopCard.vue:36-40) -->
|
|
250
|
-
<span class="ttf-face">
|
|
251
|
-
<span class="ttf-art is-typo">
|
|
252
|
-
<span class="ttf-chip">OLD TOWN · <span class="ttf-no">No. 01</span>
|
|
253
|
-
</span>
|
|
254
|
-
<span class="ttf-mark" aria-hidden="true">01</span>
|
|
255
|
-
<span class="ttf-typo-in">
|
|
256
|
-
<span class="ttf-typo-type">Harbor Road</span>
|
|
257
|
-
<span class="ttf-typo-name">Ferry Steps</span>
|
|
258
|
-
<span class="ttf-typo-fact">Lit at dusk since 1889</span>
|
|
259
|
-
</span>
|
|
260
|
-
</span>
|
|
261
|
-
<span class="ttf-grain" aria-hidden="true">
|
|
262
|
-
</span>
|
|
263
|
-
</span>
|
|
264
|
-
<!--v-if-->
|
|
265
|
-
</span>
|
|
266
|
-
</div>
|
|
267
|
-
<button class="tt-hit" type="button" aria-label="Ferry Steps, Old Town">
|
|
268
|
-
</button>
|
|
269
|
-
</div>
|
|
270
|
-
</div>
|
|
271
|
-
</section>
|
|
272
|
-
<!--v-if-->
|
|
273
|
-
</div>
|
|
274
|
-
</main>
|
|
275
|
-
<div class="tt-dock">
|
|
276
|
-
<div class="tt-rail">
|
|
277
|
-
<div class="tt-seg" role="radiogroup" aria-label="Group">
|
|
278
|
-
<button type="button" role="radio" aria-checked="true">Set</button>
|
|
279
|
-
<button type="button" role="radio" aria-checked="false">App</button>
|
|
280
|
-
<button type="button" role="radio" aria-checked="false">Kind</button>
|
|
281
|
-
<button type="button" role="radio" aria-checked="false">Rarity</button>
|
|
282
|
-
<button type="button" role="radio" aria-checked="false">None</button>
|
|
283
|
-
</div>
|
|
284
|
-
<button class="tt-chip" type="button" data-k="missing" aria-pressed="false">
|
|
285
|
-
<!--v-if-->
|
|
286
|
-
<!--v-if--> Missing<span class="tt-v">3</span>
|
|
287
|
-
</button>
|
|
288
|
-
<button class="tt-chip" type="button" data-k="rarity" aria-haspopup="true" aria-expanded="false">
|
|
289
|
-
<!--v-if-->
|
|
290
|
-
<!--v-if--> Rarity<!--v-if-->
|
|
291
|
-
</button>
|
|
292
|
-
<button class="tt-chip" type="button" data-k="sort" aria-haspopup="true" aria-expanded="false">
|
|
293
|
-
<!--v-if-->
|
|
294
|
-
<svg class="tt-i tt-i16" viewBox="0 0 24 24" aria-hidden="true">
|
|
295
|
-
<path d="m3 16 4 4 4-4">
|
|
296
|
-
</path>
|
|
297
|
-
<path d="M7 20V4">
|
|
298
|
-
</path>
|
|
299
|
-
<path d="m21 8-4-4-4 4">
|
|
300
|
-
</path>
|
|
301
|
-
<path d="M17 4v16">
|
|
302
|
-
</path>
|
|
303
|
-
</svg> Newest<!--v-if-->
|
|
304
|
-
</button>
|
|
305
|
-
<div class="tt-search" role="search">
|
|
306
|
-
<button class="tt-s-btn" type="button" aria-label="Search">
|
|
307
|
-
<svg class="tt-i tt-i16" viewBox="0 0 24 24" aria-hidden="true">
|
|
308
|
-
<circle cx="11" cy="11" r="8">
|
|
309
|
-
</circle>
|
|
310
|
-
<path d="m21 21-4.3-4.3">
|
|
311
|
-
</path>
|
|
312
|
-
</svg>
|
|
313
|
-
</button>
|
|
314
|
-
<input type="search" placeholder="Name" aria-label="Name" autocomplete="off" autocapitalize="off" spellcheck="false" enterkeyhint="search">
|
|
315
|
-
<button class="tt-s-x" type="button" aria-label="Clear" hidden="">
|
|
316
|
-
<svg class="tt-i tt-i16" viewBox="0 0 24 24" aria-hidden="true">
|
|
317
|
-
<path d="M18 6 6 18">
|
|
318
|
-
</path>
|
|
319
|
-
<path d="m6 6 12 12">
|
|
320
|
-
</path>
|
|
321
|
-
</svg>
|
|
322
|
-
</button>
|
|
323
|
-
</div>
|
|
324
|
-
</div>
|
|
325
|
-
<div class="tt-slrow">
|
|
326
|
-
<div class="tt-ruler" style="--p: 17.74%;">
|
|
327
|
-
<input type="range" min="56" max="366" step="1" aria-label="Card size" aria-valuetext="3 across">
|
|
328
|
-
<span class="tt-tk is-on" style="left: calc(7px + 0.1774 * (100% - 14px));">
|
|
329
|
-
<span>3</span>
|
|
330
|
-
</span>
|
|
331
|
-
<span class="tt-tk" style="left: calc(7px + 0.3032 * (100% - 14px));">
|
|
332
|
-
<span>2</span>
|
|
333
|
-
</span>
|
|
334
|
-
<span class="tt-tk" style="left: calc(7px + 0.3871 * (100% - 14px));">
|
|
335
|
-
<span>2</span>
|
|
336
|
-
</span>
|
|
337
|
-
<span class="tt-tk" style="left: calc(7px + 0.5935 * (100% - 14px));">
|
|
338
|
-
<span>1</span>
|
|
339
|
-
</span>
|
|
340
|
-
</div>
|
|
341
|
-
<output class="tt-acr">3×</output>
|
|
342
|
-
</div>
|
|
343
|
-
</div>
|
|
344
|
-
<!--v-if-->
|
|
345
|
-
<!--v-if-->
|
|
346
|
-
<div class="tt-stage" role="dialog" aria-modal="true" aria-label="Card">
|
|
347
|
-
<div class="tt-st-bg">
|
|
348
|
-
</div>
|
|
349
|
-
<button class="tt-st-x" type="button" aria-label="Close">
|
|
350
|
-
<svg class="tt-i" viewBox="0 0 24 24" aria-hidden="true">
|
|
351
|
-
<path d="M18 6 6 18">
|
|
352
|
-
</path>
|
|
353
|
-
<path d="m6 6 12 12">
|
|
354
|
-
</path>
|
|
355
|
-
</svg>
|
|
356
|
-
</button>
|
|
357
|
-
<div class="tt-st-col" style="--cw: 337px;">
|
|
358
|
-
<!--v-if-->
|
|
359
|
-
<div class="tt-st-wrap">
|
|
360
|
-
<div class="tt-st-card" role="button" tabindex="0" aria-label="Flip">
|
|
361
|
-
</div>
|
|
362
|
-
</div>
|
|
363
|
-
<!--v-if-->
|
|
364
|
-
</div>
|
|
365
|
-
</div>
|
|
366
|
-
</div>
|
|
@@ -1,48 +0,0 @@
|
|
|
1
|
-
// A local stand-in for GET /v1/sets/:set/collects, following the API reference: the key first
|
|
2
|
-
// (401 with none, 403 for a wrong one), then the limit (429), then the set id, the actor and the set.
|
|
3
|
-
import { createServer } from 'node:http'
|
|
4
|
-
import { APP, SET_ID } from '../shared/app.js'
|
|
5
|
-
|
|
6
|
-
export const MOCK_KEY = `pck_${APP.id}_mock0secret0mock0secret`
|
|
7
|
-
export const WRONG_KEY = `pck_${APP.id}_wrong0secret0wrong0secret`
|
|
8
|
-
const SET_RE = /^[a-z0-9][a-z0-9_-]{0,63}$/
|
|
9
|
-
|
|
10
|
-
const fail = (res, url, statusCode, message, headers = {}) => {
|
|
11
|
-
res.writeHead(statusCode, { 'Content-Type': 'application/json', ...headers })
|
|
12
|
-
res.end(JSON.stringify({ url, statusCode, statusMessage: '', message, data: { code: 'mock', fix: message } }))
|
|
13
|
-
}
|
|
14
|
-
|
|
15
|
-
export async function startMockApi({ holdings = {}, sets = [SET_ID], app = APP.id, limited = false } = {}) {
|
|
16
|
-
const calls = []
|
|
17
|
-
const server = createServer((req, res) => {
|
|
18
|
-
const url = new URL(req.url, 'http://mock')
|
|
19
|
-
calls.push({ method: req.method, path: url.pathname, actors: url.searchParams.getAll('actor'), key: req.headers['x-pincast-key'] })
|
|
20
|
-
const m = /^\/v1\/sets\/([^/]+)\/collects$/.exec(url.pathname)
|
|
21
|
-
if (!m || req.method !== 'GET') return fail(res, url.pathname, 404, 'Not found')
|
|
22
|
-
const key = req.headers['x-pincast-key']
|
|
23
|
-
if (!key) return fail(res, url.pathname, 401, 'X-Pincast-Key required')
|
|
24
|
-
if (key !== MOCK_KEY) return fail(res, url.pathname, 403, 'Invalid key')
|
|
25
|
-
if (limited) return fail(res, url.pathname, 429, 'Too many requests', { 'Retry-After': '7' })
|
|
26
|
-
const set = decodeURIComponent(m[1])
|
|
27
|
-
if (!SET_RE.test(set)) return fail(res, url.pathname, 400, 'Invalid set id')
|
|
28
|
-
const actors = url.searchParams.getAll('actor')
|
|
29
|
-
if (!actors.length) return fail(res, url.pathname, 400, 'actor required')
|
|
30
|
-
if (actors.length > 3 || actors.some(a => a.length > 255)) return fail(res, url.pathname, 400, 'At most three actor ids')
|
|
31
|
-
if (!sets.includes(set)) return fail(res, url.pathname, 404, `Set ${set} is not registered`)
|
|
32
|
-
const cards = actors.flatMap(a => holdings[a] || [])
|
|
33
|
-
const held = {}
|
|
34
|
-
for (const c of cards) held[c.type] = (held[c.type] || 0) + 1
|
|
35
|
-
res.writeHead(200, { 'Content-Type': 'application/json' })
|
|
36
|
-
res.end(JSON.stringify({ app, set, held, cards }))
|
|
37
|
-
})
|
|
38
|
-
await new Promise(resolve => server.listen(0, '127.0.0.1', resolve))
|
|
39
|
-
return {
|
|
40
|
-
url: `http://127.0.0.1:${server.address().port}/v1`,
|
|
41
|
-
calls,
|
|
42
|
-
close: () => new Promise(resolve => server.close(resolve)),
|
|
43
|
-
}
|
|
44
|
-
}
|
|
45
|
-
|
|
46
|
-
export const heldCard = (key, collectedAt = '2026-11-01T12:00:00.000Z') => ({
|
|
47
|
-
key, type: 'lantern', parent: null, via: null, collectedAt, lastCollectedAt: collectedAt, count: 1, source: 'anonymous',
|
|
48
|
-
})
|
|
@@ -1,142 +0,0 @@
|
|
|
1
|
-
import { afterEach, describe, expect, it } from 'vitest'
|
|
2
|
-
import { createServer } from 'node:http'
|
|
3
|
-
import { collectionRoute, readCollection } from '../server/route.js'
|
|
4
|
-
import { MOCK_KEY, WRONG_KEY, heldCard, startMockApi } from './mock-api.js'
|
|
5
|
-
|
|
6
|
-
let mock
|
|
7
|
-
afterEach(async () => { if (mock) await mock.close(); mock = null })
|
|
8
|
-
|
|
9
|
-
const live = (extra = {}) => ({ PINCAST_KEY: MOCK_KEY, PINCAST_ACTOR: 'guest-test-1', PINCAST_API: mock.url, ...extra })
|
|
10
|
-
const heldTitles = body => body.collection.cards.filter(c => c.held).map(c => c.title)
|
|
11
|
-
|
|
12
|
-
describe('with no key', () => {
|
|
13
|
-
it('answers from the sample and makes no network call', async () => {
|
|
14
|
-
const fetchImpl = () => { throw new Error('no call should be made') }
|
|
15
|
-
const { status, body } = await readCollection({}, fetchImpl)
|
|
16
|
-
expect(status).toBe(200)
|
|
17
|
-
expect(body.source).toBe('sample')
|
|
18
|
-
expect(body.collection.cards).toHaveLength(8)
|
|
19
|
-
expect(heldTitles(body)).toEqual(['Ferry Steps', "Chandler's Corner", 'Market Cross', 'Bell Yard', 'Harbor Light'])
|
|
20
|
-
})
|
|
21
|
-
|
|
22
|
-
it('treats a blank key as no key', async () => {
|
|
23
|
-
const { body } = await readCollection({ PINCAST_KEY: ' ' }, () => { throw new Error('no call') })
|
|
24
|
-
expect(body.source).toBe('sample')
|
|
25
|
-
})
|
|
26
|
-
})
|
|
27
|
-
|
|
28
|
-
describe('with a key', () => {
|
|
29
|
-
it('reads the set\'s collects with the key in the header, for the one actor', async () => {
|
|
30
|
-
mock = await startMockApi({ holdings: { 'guest-test-1': [heldCard('lantern:the-last-wick')] } })
|
|
31
|
-
const { status, body } = await readCollection(live())
|
|
32
|
-
expect(status).toBe(200)
|
|
33
|
-
expect(body.source).toBe('live')
|
|
34
|
-
expect(heldTitles(body)).toEqual(['The Last Wick'])
|
|
35
|
-
expect(mock.calls).toEqual([{ method: 'GET', path: '/v1/sets/old-town-lanterns/collects', actors: ['guest-test-1'], key: MOCK_KEY }])
|
|
36
|
-
})
|
|
37
|
-
|
|
38
|
-
it('never sends the key to the browser, on success or on a refusal', async () => {
|
|
39
|
-
mock = await startMockApi({ holdings: { 'guest-test-1': [heldCard('lantern:ferry-steps')] } })
|
|
40
|
-
expect(JSON.stringify((await readCollection(live())).body)).not.toContain(MOCK_KEY)
|
|
41
|
-
expect(JSON.stringify((await readCollection(live({ PINCAST_KEY: WRONG_KEY }))).body)).not.toContain(WRONG_KEY)
|
|
42
|
-
})
|
|
43
|
-
|
|
44
|
-
it('shows nothing held and makes no call when no person is set', async () => {
|
|
45
|
-
mock = await startMockApi()
|
|
46
|
-
const { status, body } = await readCollection(live({ PINCAST_ACTOR: '' }))
|
|
47
|
-
expect(status).toBe(200)
|
|
48
|
-
expect(body).toMatchObject({ source: 'live', signedIn: false })
|
|
49
|
-
expect(heldTitles(body)).toEqual([])
|
|
50
|
-
expect(mock.calls).toHaveLength(0)
|
|
51
|
-
})
|
|
52
|
-
|
|
53
|
-
it('refuses a key for another app before calling the API', async () => {
|
|
54
|
-
mock = await startMockApi()
|
|
55
|
-
const other = 'pck_other-app_mock0secret0mock0secret'
|
|
56
|
-
const { status, body } = await readCollection(live({ PINCAST_KEY: other }))
|
|
57
|
-
expect(status).toBe(500)
|
|
58
|
-
expect(body.error).toContain('other-app')
|
|
59
|
-
expect(body.error).not.toContain('mock0secret')
|
|
60
|
-
expect(mock.calls).toHaveLength(0)
|
|
61
|
-
})
|
|
62
|
-
|
|
63
|
-
it('refuses a key with the wrong shape without repeating it', async () => {
|
|
64
|
-
mock = await startMockApi()
|
|
65
|
-
const { status, body } = await readCollection(live({ PINCAST_KEY: 'not-a-key-at-all' }))
|
|
66
|
-
expect(status).toBe(500)
|
|
67
|
-
expect(body.error).not.toContain('not-a-key-at-all')
|
|
68
|
-
expect(mock.calls).toHaveLength(0)
|
|
69
|
-
})
|
|
70
|
-
})
|
|
71
|
-
|
|
72
|
-
describe('when the API refuses', () => {
|
|
73
|
-
it('403: says the key was refused', async () => {
|
|
74
|
-
mock = await startMockApi()
|
|
75
|
-
const { status, body } = await readCollection(live({ PINCAST_KEY: WRONG_KEY }))
|
|
76
|
-
expect(status).toBe(502)
|
|
77
|
-
expect(body.error).toContain('refused')
|
|
78
|
-
})
|
|
79
|
-
|
|
80
|
-
it('404: says to register the set first', async () => {
|
|
81
|
-
mock = await startMockApi({ sets: [] })
|
|
82
|
-
const { status, body } = await readCollection(live())
|
|
83
|
-
expect(status).toBe(502)
|
|
84
|
-
expect(body.error).toContain('PUT /v1/sets/old-town-lanterns')
|
|
85
|
-
})
|
|
86
|
-
|
|
87
|
-
it('429: passes Retry-After on, and calls once', async () => {
|
|
88
|
-
mock = await startMockApi({ limited: true })
|
|
89
|
-
const { status, retryAfter } = await readCollection(live())
|
|
90
|
-
expect(status).toBe(429)
|
|
91
|
-
expect(retryAfter).toBe('7')
|
|
92
|
-
expect(mock.calls).toHaveLength(1)
|
|
93
|
-
})
|
|
94
|
-
|
|
95
|
-
it('an answer for another app is an error, not a crash', async () => {
|
|
96
|
-
mock = await startMockApi({ app: 'other-app' })
|
|
97
|
-
const { status, body } = await readCollection(live())
|
|
98
|
-
expect(status).toBe(502)
|
|
99
|
-
expect(body.error).toBeTruthy()
|
|
100
|
-
})
|
|
101
|
-
|
|
102
|
-
it('an API it cannot reach is a 502', async () => {
|
|
103
|
-
const { status, body } = await readCollection({ PINCAST_KEY: MOCK_KEY, PINCAST_ACTOR: 'guest-test-1', PINCAST_API: 'http://127.0.0.1:9/v1' })
|
|
104
|
-
expect(status).toBe(502)
|
|
105
|
-
expect(body.error).toContain('reach')
|
|
106
|
-
})
|
|
107
|
-
})
|
|
108
|
-
|
|
109
|
-
describe('the route over HTTP', () => {
|
|
110
|
-
const serve = async (handler) => {
|
|
111
|
-
const server = createServer(handler)
|
|
112
|
-
await new Promise(resolve => server.listen(0, '127.0.0.1', resolve))
|
|
113
|
-
return { url: `http://127.0.0.1:${server.address().port}/`, close: () => new Promise(resolve => server.close(resolve)) }
|
|
114
|
-
}
|
|
115
|
-
|
|
116
|
-
it('answers GET with JSON that is not cached', async () => {
|
|
117
|
-
const s = await serve(collectionRoute({}))
|
|
118
|
-
const res = await fetch(s.url)
|
|
119
|
-
expect(res.status).toBe(200)
|
|
120
|
-
expect(res.headers.get('content-type')).toContain('application/json')
|
|
121
|
-
expect(res.headers.get('cache-control')).toBe('no-store')
|
|
122
|
-
expect((await res.json()).source).toBe('sample')
|
|
123
|
-
await s.close()
|
|
124
|
-
})
|
|
125
|
-
|
|
126
|
-
it('takes no actor from the browser', async () => {
|
|
127
|
-
mock = await startMockApi({ holdings: { 'guest-test-1': [heldCard('lantern:ferry-steps')], 'someone-else': [heldCard('lantern:harbor-light')] } })
|
|
128
|
-
const s = await serve(collectionRoute(live()))
|
|
129
|
-
const body = await (await fetch(`${s.url}?actor=someone-else`)).json()
|
|
130
|
-
expect(heldTitles(body)).toEqual(['Ferry Steps'])
|
|
131
|
-
expect(mock.calls[0].actors).toEqual(['guest-test-1'])
|
|
132
|
-
await s.close()
|
|
133
|
-
})
|
|
134
|
-
|
|
135
|
-
it('refuses anything but GET and HEAD', async () => {
|
|
136
|
-
const s = await serve(collectionRoute({}))
|
|
137
|
-
const res = await fetch(s.url, { method: 'POST' })
|
|
138
|
-
expect(res.status).toBe(405)
|
|
139
|
-
expect(res.headers.get('allow')).toBe('GET, HEAD')
|
|
140
|
-
await s.close()
|
|
141
|
-
})
|
|
142
|
-
})
|
package/template/vite.config.js
DELETED
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
import vue from '@vitejs/plugin-vue'
|
|
2
|
-
import { defineConfig, loadEnv } from 'vite'
|
|
3
|
-
import { collectionRoute } from './server/route.js'
|
|
4
|
-
|
|
5
|
-
export default defineConfig(({ mode }) => {
|
|
6
|
-
// Read on the server only. Vite puts nothing in the page unless its name starts with VITE_.
|
|
7
|
-
const env = loadEnv(mode, process.cwd(), '')
|
|
8
|
-
const mountRoute = (server) => { server.middlewares.use('/api/collection', collectionRoute(env)) }
|
|
9
|
-
return {
|
|
10
|
-
plugins: [vue(), { name: 'collection-route', configureServer: mountRoute, configurePreviewServer: mountRoute }],
|
|
11
|
-
test: {
|
|
12
|
-
include: ['test/**/*.test.js'],
|
|
13
|
-
server: { deps: { inline: [/@pincast\/placecard-kit/] } },
|
|
14
|
-
},
|
|
15
|
-
}
|
|
16
|
-
})
|
package/template.json
DELETED
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"source": "pincast-kit-example",
|
|
3
|
-
"commit": "192ebea9630ce7cbaa9c5398ff8f7b6f57d2e6d7",
|
|
4
|
-
"files": {
|
|
5
|
-
".env.example": "f856d9ef1a15ae99cd7bc243fc1d456529d366518087ce19a464148070d8078c",
|
|
6
|
-
".gitignore": "f822371805a9e9560e2ec2ed6803ce373c0b4328e35f655b79eb61f3703283ed",
|
|
7
|
-
"LICENSE": "b39d3a6d9cceafc50728f9830c5cf2ef996f5cf37fa4c7bf938b4af8d9ef5562",
|
|
8
|
-
"README.md": "6aa9e1c8186c20d03899890e37a26b8b7bf4f09f431b9c0e0bde3768942ce5c6",
|
|
9
|
-
"data/sample-collects.json": "f6e59c988d637da342ac635bceb6ae1273fc5f1c25e77312ef2b991608c96b10",
|
|
10
|
-
"data/set.json": "69c029dfb1554fee7ea572da0296a725aa794335481684c2cf85f7b6ca552580",
|
|
11
|
-
"index.html": "0c687695b76b996d07cdb8471d9dbb640499d971044ba77eaadba29b9e3575ae",
|
|
12
|
-
"package-lock.json": "16d33b155e11741fa6ceb570ce939ecb928fd34bdfae95f027f2152e06520ea0",
|
|
13
|
-
"package.json": "3da250cc1296143d4fcfbdb4ea02ccfe5915442343340668522263162cad036d",
|
|
14
|
-
"server/collection.js": "e740ae1c451b8eb3e4aa831246cc769b490a90345292e175dbc2ca506031ab83",
|
|
15
|
-
"server/index.js": "f26d6e904ac564d9076234ba275d3261c613acb67c8d7d09ee03850fb9233a79",
|
|
16
|
-
"server/route.js": "01c8531e2a472d317365fe2b2ebbb86ae761cded4bbe1b2563f9c9e87e987296",
|
|
17
|
-
"shared/app.js": "ee6b5ae31b21421d50941f4dc57dfa0469f1445713f971160019c0e6dc08d87c",
|
|
18
|
-
"src/App.vue": "aaf924bd39c6b287fda845068c039848f1b304f122b7f2044d51341ed34e5beb",
|
|
19
|
-
"src/lantern.css": "93eff596b14e7cf06dfbd830d778c7e5bf003945d84e4d3402d9ca5f642e8581",
|
|
20
|
-
"src/main.js": "d4758759ddb8fcf42c0308e826628840aec7f22f7f1b07fde559f837ef816ec7",
|
|
21
|
-
"src/tabletop.js": "401b9b7276622d3e24615024c235f6a1d23cb2049582af09451eee3a44e50bd8",
|
|
22
|
-
"test/conformance.test.js": "750fcbce01033a3047beddf1a517e3247de91a66f3bee5a244a756a9ea9aa656",
|
|
23
|
-
"test/goldens/lantern-walk.table-laptop.html": "0ca63c0c543be98f960b1ab3f396e360d655983a209af3fad11e0b5677231cbe",
|
|
24
|
-
"test/goldens/lantern-walk.table-phone.html": "e47edb8ba6b9bfcd49b698f1f0e4a5e534776b60b0efed7a2dd194748cca91d8",
|
|
25
|
-
"test/mock-api.js": "37f050aae660115032ef20a0a02f01a617dd2561a8b6ad4572d3c584e3e1a614",
|
|
26
|
-
"test/route.test.js": "f9e308efd838728c840c3728a9da7ea9560d19374ab13f334d5f1e354bdc9164",
|
|
27
|
-
"vite.config.js": "861533f25c79f18e643949731f7fdafaeeb3409f5be72aa44c05b702147afe12"
|
|
28
|
-
}
|
|
29
|
-
}
|