@skinhub/viewer 0.1.1 → 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/EMBED.md +97 -1
- package/dist/SkinViewer.js +1 -1
- package/dist/SkinViewer.js.map +1 -1
- package/dist/index.d.ts +10 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +9 -0
- package/dist/index.js.map +1 -1
- package/dist/item.d.ts +26 -1
- package/dist/item.d.ts.map +1 -1
- package/dist/item.js +37 -8
- package/dist/item.js.map +1 -1
- package/dist/protocol.d.ts +38 -1
- package/dist/protocol.d.ts.map +1 -1
- package/dist/protocol.js.map +1 -1
- package/dist/state.d.ts +25 -4
- package/dist/state.d.ts.map +1 -1
- package/dist/state.js +139 -12
- package/dist/state.js.map +1 -1
- package/dist/types.d.ts +118 -4
- package/dist/types.d.ts.map +1 -1
- package/dist/types.js +11 -0
- package/dist/types.js.map +1 -1
- package/package.json +1 -1
- package/src/SkinViewer.tsx +1 -1
- package/src/index.ts +13 -0
- package/src/item.ts +72 -1
- package/src/protocol.ts +32 -1
- package/src/state.ts +166 -15
- package/src/types.ts +144 -1
package/dist/state.js
CHANGED
|
@@ -30,7 +30,7 @@
|
|
|
30
30
|
*
|
|
31
31
|
* So the diff is structural: a field is in the patch only if its VALUE moved.
|
|
32
32
|
*/
|
|
33
|
-
import { resolveSubject } from './item.js';
|
|
33
|
+
import { resolveStandalone, resolveSubject } from './item.js';
|
|
34
34
|
const HELP_FOR = {
|
|
35
35
|
'no-item': 'no-item',
|
|
36
36
|
'bad-inspect-link': 'bad-link',
|
|
@@ -52,13 +52,9 @@ const HELP_FOR = {
|
|
|
52
52
|
* rather than a `TypeError`.
|
|
53
53
|
*/
|
|
54
54
|
export const resolveState = (props) => {
|
|
55
|
-
const subject = resolveSubject(props);
|
|
56
55
|
const settings = toFrameSettings(props.settings);
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
inspectPayload: subject.inspectPayload,
|
|
60
|
-
help: subject.error ? HELP_FOR[subject.error.code] : null,
|
|
61
|
-
subjectError: subject.error,
|
|
56
|
+
/* Everything true of every subject. Hoisted so the two returns below cannot drift apart. */
|
|
57
|
+
const common = {
|
|
62
58
|
...(props.view !== undefined && { view: props.view }),
|
|
63
59
|
...(props.agent !== undefined && { agent: props.agent }),
|
|
64
60
|
...(props.gloves !== undefined && { gloves: props.gloves }),
|
|
@@ -66,6 +62,38 @@ export const resolveState = (props) => {
|
|
|
66
62
|
...(props.interactions !== undefined && { interactions: { ...props.interactions } }),
|
|
67
63
|
...(props.editingSlot !== undefined && { editingSlot: props.editingSlot }),
|
|
68
64
|
};
|
|
65
|
+
/*
|
|
66
|
+
* THE OTHER FOUR SUBJECTS FIRST, because each is named by its own prop and the weapon is the
|
|
67
|
+
* fall-through. `item` stays null for them: there IS no weapon, and inventing one would put a rifle
|
|
68
|
+
* into this package's URL that the frame would then hold behind a subject nobody is looking at.
|
|
69
|
+
*
|
|
70
|
+
* `agent` IS WRITTEN LAST for the operator, so `operator={{ pose }}` beats an `agent={{ pose }}` a
|
|
71
|
+
* host also happened to pass. Two props answering one question is only reachable through the types'
|
|
72
|
+
* back door, and the subject arm is the more specific statement.
|
|
73
|
+
*/
|
|
74
|
+
const standalone = resolveStandalone(props);
|
|
75
|
+
if (standalone)
|
|
76
|
+
return {
|
|
77
|
+
subject: standalone.subject,
|
|
78
|
+
item: null,
|
|
79
|
+
...(standalone.sticker && { sticker: standalone.sticker }),
|
|
80
|
+
...(standalone.charm && { charm: standalone.charm }),
|
|
81
|
+
...(standalone.collectible && { collectible: standalone.collectible }),
|
|
82
|
+
inspectPayload: null,
|
|
83
|
+
help: standalone.error ? HELP_FOR[standalone.error.code] : null,
|
|
84
|
+
subjectError: standalone.error,
|
|
85
|
+
...common,
|
|
86
|
+
...(standalone.agent && { agent: standalone.agent }),
|
|
87
|
+
};
|
|
88
|
+
const subject = resolveSubject(props);
|
|
89
|
+
return {
|
|
90
|
+
subject: 'weapon',
|
|
91
|
+
item: subject.item,
|
|
92
|
+
inspectPayload: subject.inspectPayload,
|
|
93
|
+
help: subject.error ? HELP_FOR[subject.error.code] : null,
|
|
94
|
+
subjectError: subject.error,
|
|
95
|
+
...common,
|
|
96
|
+
};
|
|
69
97
|
};
|
|
70
98
|
/**
|
|
71
99
|
* The public settings as the wire's.
|
|
@@ -123,6 +151,32 @@ export const frameUrl = (origin, desired) => {
|
|
|
123
151
|
const item = desired.item;
|
|
124
152
|
if (desired.help)
|
|
125
153
|
params.set('help', desired.help);
|
|
154
|
+
/*
|
|
155
|
+
* ── THE SUBJECT ──────────────────────────────────────────────────────────────────────────
|
|
156
|
+
*
|
|
157
|
+
* `?subject=` IS WRITTEN FOR EVERY NON-WEAPON AND NEVER FOR A WEAPON. Not writing it for the weapon
|
|
158
|
+
* keeps this file's promise about defaults: `?subject=weapon` in a customer's `<iframe src>` would
|
|
159
|
+
* be OUR default frozen into THEIR embed. Writing it for the other four is not the same thing - it
|
|
160
|
+
* is the caller's own statement, and for the operator it is the only way to say it, because
|
|
161
|
+
* `?agent=` on its own has always meant "who holds the weapon".
|
|
162
|
+
*
|
|
163
|
+
* The id params are what the frame reads back; `?sticker=`/`?charm=`/`?collectible=` each imply the
|
|
164
|
+
* subject on their own, so the pair is redundant by design rather than by accident - a URL that says
|
|
165
|
+
* the same thing twice cannot be half-copied into meaning something else.
|
|
166
|
+
*/
|
|
167
|
+
if (desired.subject !== 'weapon')
|
|
168
|
+
params.set('subject', desired.subject);
|
|
169
|
+
if (desired.sticker) {
|
|
170
|
+
params.set('sticker', String(desired.sticker.id));
|
|
171
|
+
num(params, 'wear', desired.sticker.wear);
|
|
172
|
+
}
|
|
173
|
+
if (desired.charm) {
|
|
174
|
+
params.set('charm', String(desired.charm.id));
|
|
175
|
+
// `?pattern=` and not `?seed=` - on this URL `seed` is already the WEAPON's paint seed.
|
|
176
|
+
num(params, 'pattern', desired.charm.pattern);
|
|
177
|
+
}
|
|
178
|
+
if (desired.collectible)
|
|
179
|
+
params.set('collectible', String(desired.collectible.id));
|
|
126
180
|
if (item) {
|
|
127
181
|
params.set('weapon', item.weaponType);
|
|
128
182
|
params.set('paint', String(item.paintIndex));
|
|
@@ -259,6 +313,45 @@ export const diffState = (previous, next) => {
|
|
|
259
313
|
if (Object.keys(item).length > 0)
|
|
260
314
|
patch.item = item;
|
|
261
315
|
}
|
|
316
|
+
/*
|
|
317
|
+
* ── THE OTHER FOUR SUBJECTS ───────────────────────────────────────────────────────────────
|
|
318
|
+
*
|
|
319
|
+
* A GROUP IS DIFFED EVEN WHEN THE SUBJECT DID NOT MOVE, so a `wear` drag on a sticker is one small
|
|
320
|
+
* patch per tick and nothing else - the identical shape a `float` drag on a rifle has, and cheap for
|
|
321
|
+
* the identical reason: the id is not in the patch, so nothing keyed on the id can move.
|
|
322
|
+
*
|
|
323
|
+
* THE SUBJECT IS DIFFED SEPARATELY AND CARRIES NO GROUP WITH IT. Switching to a sticker whose id has
|
|
324
|
+
* not changed sends `{ subject: 'sticker' }` alone, because the frame still holds the id it was given
|
|
325
|
+
* before - which is what makes flipping between two subjects cost one field.
|
|
326
|
+
*/
|
|
327
|
+
if (next.subject !== previous.subject) {
|
|
328
|
+
patch.subject = next.subject;
|
|
329
|
+
changed = true;
|
|
330
|
+
}
|
|
331
|
+
/*
|
|
332
|
+
* *** FIELD BY FIELD, NOT WHOLE-GROUP, AND THE TEST BELOW IS WHY. *** Sending the whole group would
|
|
333
|
+
* be correct on the wire - the frame merges by field either way - and would still break the
|
|
334
|
+
* contract, because `coversCanvas` reads `sticker.id !== undefined` to decide whether to raise the
|
|
335
|
+
* caller's `loading` slot. A `wear` drag that restated the id would raise it sixty times a second
|
|
336
|
+
* over a picture the frame never covered, which from outside is indistinguishable from a reload.
|
|
337
|
+
* The item above is diffed per field for the same reason; gloves are the one group sent wholesale,
|
|
338
|
+
* and that is because a partial pair is a state the renderer cannot resolve.
|
|
339
|
+
*/
|
|
340
|
+
const sticker = diffGroup(previous.sticker, next.sticker);
|
|
341
|
+
if (sticker) {
|
|
342
|
+
patch.sticker = sticker;
|
|
343
|
+
changed = true;
|
|
344
|
+
}
|
|
345
|
+
const charm = diffGroup(previous.charm, next.charm);
|
|
346
|
+
if (charm) {
|
|
347
|
+
patch.charm = charm;
|
|
348
|
+
changed = true;
|
|
349
|
+
}
|
|
350
|
+
const collectible = diffGroup(previous.collectible, next.collectible);
|
|
351
|
+
if (collectible) {
|
|
352
|
+
patch.collectible = collectible;
|
|
353
|
+
changed = true;
|
|
354
|
+
}
|
|
262
355
|
if (next.view !== undefined && next.view !== previous.view) {
|
|
263
356
|
patch.view = next.view;
|
|
264
357
|
changed = true;
|
|
@@ -291,6 +384,27 @@ export const diffState = (previous, next) => {
|
|
|
291
384
|
}
|
|
292
385
|
return changed ? patch : undefined;
|
|
293
386
|
};
|
|
387
|
+
/**
|
|
388
|
+
* One flat group, per field. `undefined` when nothing moved, so the caller can skip the key entirely.
|
|
389
|
+
*
|
|
390
|
+
* A KEY THE NEXT RENDER DID NOT MENTION IS NOT DIFFED AWAY - there is no way to say "unset" over the
|
|
391
|
+
* wire, and the alternative reading would make a conditional prop destructive. Same rule as
|
|
392
|
+
* {@link diffSettings} one level in.
|
|
393
|
+
*/
|
|
394
|
+
const diffGroup = (previous, next) => {
|
|
395
|
+
if (!next)
|
|
396
|
+
return undefined;
|
|
397
|
+
if (!previous)
|
|
398
|
+
return { ...next };
|
|
399
|
+
const out = {};
|
|
400
|
+
let changed = false;
|
|
401
|
+
for (const key of Object.keys(next))
|
|
402
|
+
if (!Object.is(previous[key], next[key])) {
|
|
403
|
+
out[key] = next[key];
|
|
404
|
+
changed = true;
|
|
405
|
+
}
|
|
406
|
+
return changed ? out : undefined;
|
|
407
|
+
};
|
|
294
408
|
const glovesEqual = (a, b) => {
|
|
295
409
|
if (a === b)
|
|
296
410
|
return true;
|
|
@@ -336,15 +450,28 @@ const overlaysEqual = (a, b) => {
|
|
|
336
450
|
return false;
|
|
337
451
|
return a.stickerGizmo === b.stickerGizmo && a.charmGizmo === b.charmGizmo && shallowEqual(a.gizmoStyle, b.gizmoStyle);
|
|
338
452
|
};
|
|
339
|
-
/**
|
|
340
|
-
|
|
453
|
+
/**
|
|
454
|
+
* True when a patch would cover the canvas - see {@link IDENTITY_FIELDS} and `CHEAP_FIELDS`.
|
|
455
|
+
*
|
|
456
|
+
* IT TAKES THE WHOLE NEXT STATE rather than just the view, because one of the answers depends on which
|
|
457
|
+
* SUBJECT the patch lands on: an operator's id covers under `subject: 'agent'` for the same reason it
|
|
458
|
+
* covers under `view: 'agent'`, and does not under `hands`.
|
|
459
|
+
*/
|
|
460
|
+
export const coversCanvas = (patch, next) => {
|
|
461
|
+
// A different KIND of subject is a different renderer. Always a reload, in every direction.
|
|
462
|
+
if (patch.subject !== undefined)
|
|
463
|
+
return true;
|
|
341
464
|
if (patch.view !== undefined)
|
|
342
465
|
return true;
|
|
343
466
|
if (patch.item && IDENTITY_FIELDS.some(field => patch.item?.[field] !== undefined))
|
|
344
467
|
return true;
|
|
345
|
-
//
|
|
346
|
-
|
|
347
|
-
|
|
468
|
+
// An id is identity for all four standalone subjects; their second field (`wear`, `pattern`) is not.
|
|
469
|
+
if (patch.sticker?.id !== undefined || patch.charm?.id !== undefined || patch.collectible?.id !== undefined)
|
|
470
|
+
return true;
|
|
471
|
+
// The operator is identity when they ARE the subject, and in the `agent` view, where their
|
|
472
|
+
// `<Suspense>` tears the subtree down; cheap in `hands`, where the arms are already mounted. The
|
|
473
|
+
// asymmetry is the renderer's, not ours.
|
|
474
|
+
if (patch.agent?.id !== undefined && (next.subject === 'agent' || next.view === 'agent'))
|
|
348
475
|
return true;
|
|
349
476
|
return false;
|
|
350
477
|
};
|
package/dist/state.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"state.js","sourceRoot":"","sources":["../src/state.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA+BG;AAGH,OAAO,E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AAA;IAC5C,IAAI,KAAK,CAAC,IAAI,KAAK,SAAS;QAAE,OAAO,IAAI,CAAA;IACzC,IAAI,KAAK,CAAC,IAAI,IAAI,eAAe,CAAC,IAAI,CAAC,KAAK,CAAC,EAAE,CAAC,KAAK,CAAC,IAAI,EAAE,CAAC,KAAK,CAAC,KAAK,SAAS,CAAC;QAAE,OAAO,IAAI,CAAA;IAC/F,qGAAqG;IACrG,IAAI,KAAK,CAAC,OAAO,EAAE,EAAE,KAAK,SAAS,IAAI,KAAK,CAAC,KAAK,EAAE,EAAE,KAAK,SAAS,IAAI,KAAK,CAAC,WAAW,EAAE,EAAE,KAAK,SAAS;QAC1G,OAAO,IAAI,CAAA;IACZ,2FAA2F;IAC3F,iGAAiG;IACjG,yCAAyC;IACzC,IAAI,KAAK,CAAC,KAAK,EAAE,EAAE,KAAK,SAAS,IAAI,CAAC,IAAI,CAAC,OAAO,KAAK,OAAO,IAAI,IAAI,CAAC,IAAI,KAAK,OAAO,CAAC;QAAE,OAAO,IAAI,CAAA;IACrG,OAAO,KAAK,CAAA;AACb,CAAC,CAAA"}
|
package/dist/types.d.ts
CHANGED
|
@@ -135,6 +135,17 @@ type ItemConfiguration = {
|
|
|
135
135
|
* This list is the FIRST half. It is here, as a value, because {@link SkinViewerProps.loading} is
|
|
136
136
|
* raised off its complement - see `SkinViewer.tsx`'s `isIdentityChange` - and because a contract an
|
|
137
137
|
* integrator relies on should be readable without opening the renderer.
|
|
138
|
+
*
|
|
139
|
+
* *** AND THE SAME SPLIT FOR THE OTHER FOUR SUBJECTS, which is a shorter table because they are
|
|
140
|
+
* smaller items: ***
|
|
141
|
+
*
|
|
142
|
+
* `sticker` identity `id`, cheap `wear`
|
|
143
|
+
* `charm` identity `id`, cheap `pattern`
|
|
144
|
+
* `collectible` identity `id`, and NOTHING is cheap - there is no other field to change
|
|
145
|
+
* `operator` identity `id`, cheap `pose`
|
|
146
|
+
*
|
|
147
|
+
* *** CHANGING WHICH SUBJECT YOU PASS IS ALWAYS AN IDENTITY CHANGE, *** in every direction: a weapon
|
|
148
|
+
* and a pin are drawn by different renderers, so the picture is rebuilt from nothing.
|
|
138
149
|
*/
|
|
139
150
|
export declare const CHEAP_FIELDS: readonly ["float", "seed", "statTrak", "nameTag", "stickers", "charm"];
|
|
140
151
|
/**
|
|
@@ -164,10 +175,99 @@ export type SkinViewerItem = ItemConfiguration & ({
|
|
|
164
175
|
defindex: number;
|
|
165
176
|
weapon?: never;
|
|
166
177
|
});
|
|
178
|
+
/**
|
|
179
|
+
* ONE STICKER, ON NOTHING - what `/sticker/:id` shows on our own site.
|
|
180
|
+
*
|
|
181
|
+
* *** NOT {@link SkinViewerSticker}, AND THE MISSING FIELDS ARE THE DIFFERENCE. *** That type is a
|
|
182
|
+
* sticker APPLIED to a weapon and carries a slot, a rotation and an offset; all three are statements
|
|
183
|
+
* about the sticker being ON something. Here the quad is the whole surface, so what is left is the id
|
|
184
|
+
* and how scratched it is.
|
|
185
|
+
*
|
|
186
|
+
* IT IS THE REAL SHADER AND NOT AN IMAGE ON A PLANE: holo, foil and glitter are functions of the view
|
|
187
|
+
* direction and of screen-space derivatives, so they exist only in 3D and only under lighting. That is
|
|
188
|
+
* the entire reason to embed a sticker rather than show your catalogue's icon.
|
|
189
|
+
*/
|
|
190
|
+
export type ViewerStickerSubject = {
|
|
191
|
+
/** `sticker_id` - the id in `@skinhub/cdn`'s `stickers.json`. */
|
|
192
|
+
id: number;
|
|
193
|
+
/** Scratch, `0` (mint) to `1` (scraped off). Default `0`. Updates IN PLACE - see {@link CHEAP_FIELDS}. */
|
|
194
|
+
wear?: number;
|
|
195
|
+
};
|
|
196
|
+
/**
|
|
197
|
+
* ONE CHARM, OFF THE GUN.
|
|
198
|
+
*
|
|
199
|
+
* It hangs in the pose its own model authors and does not swing: the physics exists to answer to how a
|
|
200
|
+
* rifle is being turned, and there is no rifle here. Everything that is the charm's own - its model,
|
|
201
|
+
* its per-id material, its template - is unchanged.
|
|
202
|
+
*/
|
|
203
|
+
export type ViewerCharmSubject = {
|
|
204
|
+
/** The id in `@skinhub/cdn`'s `keychains.json`. */
|
|
205
|
+
id: number;
|
|
206
|
+
/**
|
|
207
|
+
* The charm's template. NOT a variant: it drives a hue/saturation/brightness adjust on the charm's
|
|
208
|
+
* own albedo, so two charms with the same `id` and a different value are the same model in different
|
|
209
|
+
* colours. Default `0`. Updates IN PLACE.
|
|
210
|
+
*
|
|
211
|
+
* *** SPELLED `pattern` HERE AND `seed` ON {@link SkinViewerCharm}, WHICH IS DELIBERATE. *** On a
|
|
212
|
+
* weapon the charm sits beside a paint `seed` and calling it a seed reads naturally; as a SUBJECT it
|
|
213
|
+
* sits beside nothing, and `pattern` is what the wire, the game and the URL (`?pattern=`) all call
|
|
214
|
+
* it. The one word that could not be reused in both places is `seed`, because on the URL that is
|
|
215
|
+
* already the weapon's paint seed.
|
|
216
|
+
*/
|
|
217
|
+
pattern?: number;
|
|
218
|
+
};
|
|
219
|
+
/**
|
|
220
|
+
* ONE PIN, COIN, MEDAL OR TROPHY.
|
|
221
|
+
*
|
|
222
|
+
* *** IT HAS NOTHING ELSE, AND THAT IS THE WHOLE TYPE. *** No float, no seed, no wear, no template, no
|
|
223
|
+
* pose: two copies of the same medal ARE the same object. If you are drawing controls for an embedded
|
|
224
|
+
* collectible, there is nothing to draw except the camera.
|
|
225
|
+
*/
|
|
226
|
+
export type ViewerCollectibleSubject = {
|
|
227
|
+
/** The item definition index in `@skinhub/cdn`'s `collectibles.json`. */
|
|
228
|
+
id: number;
|
|
229
|
+
};
|
|
230
|
+
/**
|
|
231
|
+
* ONE OPERATOR, ALONE - the agent as the SUBJECT rather than as the person holding a weapon.
|
|
232
|
+
*
|
|
233
|
+
* ═════════════════════════════════════════════════════════════════════════════════════════════
|
|
234
|
+
* *** WHY THIS IS NOT {@link ViewerAgent}, WHEN IT NAMES THE SAME CATALOGUE ROW. ***
|
|
235
|
+
*
|
|
236
|
+
* They are two pictures, and the prop you pass is which one you get:
|
|
237
|
+
*
|
|
238
|
+
* `agent={{ id }}` WHO IS HOLDING IT. A modifier on the weapon subject, visible in the `hands`
|
|
239
|
+
* and `agent` views, ignored in `gun`. The weapon is what is being shown.
|
|
240
|
+
* `operator={{ id }}` THE PERSON IS WHAT IS BEING SHOWN. No weapon is drawn at all.
|
|
241
|
+
*
|
|
242
|
+
* A marketplace with an agent row in an inventory wants the second: they asked for Sir Bloody Darryl,
|
|
243
|
+
* and rendering him holding an AK-47 nobody named would be a picture of two items, one of them
|
|
244
|
+
* invented. (Our own site made the opposite call for its own routes, for a reason that does not carry:
|
|
245
|
+
* in the app there is always a weapon being configured, so `/agent/:id` folds into `?view=agent`
|
|
246
|
+
* rather than duplicating a surface. An embed has no such weapon.)
|
|
247
|
+
*
|
|
248
|
+
* PASSING BOTH IS NOT POSSIBLE for the subject - `?: never` - and passing `agent` ALONGSIDE `operator`
|
|
249
|
+
* simply does nothing, because there is no weapon for anyone to hold.
|
|
250
|
+
*/
|
|
251
|
+
export type ViewerOperatorSubject = {
|
|
252
|
+
/** An agent's item definition index; `5036` is the default Terrorist. */
|
|
253
|
+
id: number;
|
|
254
|
+
/**
|
|
255
|
+
* Which main-menu performance they play, by clip leaf name, or `null` (the default) for their
|
|
256
|
+
* team's own knife idle - what CS2's main menu opens on.
|
|
257
|
+
*
|
|
258
|
+
* 285 leaves across 44 weapon families are reachable. THE WEAPON EACH CLIP HOLDS IS NOT DRAWN, so
|
|
259
|
+
* `Look at gun` is an operator studying an empty hand; that is a property of the performance rather
|
|
260
|
+
* than a defect. Updates IN PLACE - the clip is swapped on a rig that keeps running.
|
|
261
|
+
*/
|
|
262
|
+
pose?: string | null;
|
|
263
|
+
};
|
|
167
264
|
/**
|
|
168
265
|
* What the item is being shown ON. All three are the same item under the same lighting, finish,
|
|
169
266
|
* stickers and charm - the difference is the camera and what is holding the weapon.
|
|
170
267
|
*
|
|
268
|
+
* *** IT IS A PROPERTY OF THE WEAPON SUBJECT AND IS IGNORED BY THE OTHER FOUR. *** A sticker is not a
|
|
269
|
+
* way of showing a weapon, so there is nothing for it to choose between.
|
|
270
|
+
*
|
|
171
271
|
* `gun` the item alone, orbitable, framed to the viewport. The default.
|
|
172
272
|
* `hands` CS2's first-person viewmodel, driven by the game's own clips. Orbit is off here because
|
|
173
273
|
* there is nothing to orbit: the weapon is welded to the eye.
|
|
@@ -426,14 +526,28 @@ export type ViewerResize = {
|
|
|
426
526
|
* was still `undefined` when the component mounted: the frame renders a short instruction card rather
|
|
427
527
|
* than a blank box or - worse - our default AK-47, which would look like a successful render of the
|
|
428
528
|
* wrong item. `onError` fires with `no-item` at the same time. See `SkinViewer.tsx`.
|
|
529
|
+
*
|
|
530
|
+
* *** AND IT IS SIX ARMS NOW RATHER THAN TWO, on exactly the same rule. *** A weapon, an inspect link
|
|
531
|
+
* and the four subjects above are six ways of naming ONE thing to render, and the same `?: never`
|
|
532
|
+
* enforcement covers all of them: passing two is an excess-property error, passing none is a
|
|
533
|
+
* missing-property error, and there is no `kind` discriminator anywhere because the prop you passed is
|
|
534
|
+
* the discriminator.
|
|
429
535
|
*/
|
|
430
|
-
|
|
536
|
+
type SubjectArms = {
|
|
431
537
|
inspectLink: string;
|
|
432
|
-
item?: never;
|
|
433
|
-
} | {
|
|
434
538
|
item: SkinViewerItem;
|
|
435
|
-
|
|
539
|
+
sticker: ViewerStickerSubject;
|
|
540
|
+
charm: ViewerCharmSubject;
|
|
541
|
+
collectible: ViewerCollectibleSubject;
|
|
542
|
+
operator: ViewerOperatorSubject;
|
|
543
|
+
};
|
|
544
|
+
/** One arm present, the other five forbidden. Written once so six arms cannot disagree about five. */
|
|
545
|
+
type OnlySubject<K extends keyof SubjectArms> = {
|
|
546
|
+
[P in K]: SubjectArms[P];
|
|
547
|
+
} & {
|
|
548
|
+
[P in Exclude<keyof SubjectArms, K>]?: never;
|
|
436
549
|
};
|
|
550
|
+
export type ViewerSubject = OnlySubject<'inspectLink'> | OnlySubject<'item'> | OnlySubject<'sticker'> | OnlySubject<'charm'> | OnlySubject<'collectible'> | OnlySubject<'operator'>;
|
|
437
551
|
export type SkinViewerProps = ViewerSubject & {
|
|
438
552
|
/** Default `'gun'`. See {@link ViewerView}. */
|
|
439
553
|
view?: ViewerView;
|
package/dist/types.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA8BG;AAEH,OAAO,KAAK,EAAE,aAAa,EAAE,SAAS,EAAE,MAAM,OAAO,CAAA;AAErD,OAAO,EAAE,IAAI,EAAE,KAAK,UAAU,EAAE,MAAM,WAAW,CAAA;AACjD,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,cAAc,CAAA;AAM5C;;;;;;GAMG;AACH,MAAM,MAAM,iBAAiB,GAAG;IAC/B,iEAAiE;IACjE,EAAE,EAAE,MAAM,CAAA;IACV;;;OAGG;IACH,IAAI,CAAC,EAAE,CAAC,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,CAAA;IACxB,6DAA6D;IAC7D,IAAI,CAAC,EAAE,MAAM,CAAA;IACb,8DAA8D;IAC9D,QAAQ,CAAC,EAAE,MAAM,CAAA;IACjB,6DAA6D;IAC7D,OAAO,CAAC,EAAE,MAAM,CAAA;IAChB,OAAO,CAAC,EAAE,MAAM,CAAA;CAChB,CAAA;AAED,4FAA4F;AAC5F,MAAM,MAAM,eAAe,GAAG;IAC7B,mDAAmD;IACnD,EAAE,EAAE,MAAM,CAAA;IACV;;;;OAIG;IACH,IAAI,CAAC,EAAE,MAAM,CAAA;IACb;;;;;;;;;OASG;IACH,MAAM,CAAC,EAAE,SAAS,CAAC,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,MAAM,CAAC,CAAA;CACnD,CAAA;AAED,iHAAiH;AACjH,KAAK,iBAAiB,GAAG;IACxB;;;OAGG;IACH,U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AE,SAAS,CAAA;IACnB;;;;;OAKG;IACH,QAAQ,CAAC,EAAE,SAAS,GAAG,CAAC,CAAC,KAAK,EAAE,eAAe,KAAK,SAAS,CAAC,CAAA;IAG9D;;;;;;;OAOG;IACH,MAAM,CAAC,EAAE,MAAM,CAAA;IACf;;;;;;OAMG;IACH,MAAM,CAAC,EAAE,gBAAgB,CAAA;CACzB,CAAA;AAMD,qEAAqE;AACrE,MAAM,MAAM,YAAY;AACvB,8CAA8C;AAC5C,YAAY;AACd,8EAA8E;GAC5E,SAAS;AACX,8BAA8B;GAC5B,OAAO;AACT,gDAAgD;GAC9C,OAAO,CAAA;AAEV;;;;;;GAMG;AACH,MAAM,MAAM,gBAAgB,GAAG;IAC9B,mEAAmE;IACnE,QAAQ,CAAC,CAAC,IAAI,CAAC,EAAE,UAAU,CAAA;IAC3B;;;;;;OAMG;IACH,MAAM,EAAE,MAAM,IAAI,CAAA;IAClB,0DAA0D;IAC1D,MAAM,EAAE,YAAY,CAAA;IACpB,iDAAiD;IACjD,KAAK,EAAE,eAAe,GAAG,IAAI,CAAA;IAC7B;;;;;;OAMG;IACH,QAAQ,EAAE,SAAS,MAAM,EAAE,CAAA;CAC3B,CAAA"}
|
package/dist/types.js
CHANGED
|
@@ -41,6 +41,17 @@ import { LINK } from './link.js';
|
|
|
41
41
|
* This list is the FIRST half. It is here, as a value, because {@link SkinViewerProps.loading} is
|
|
42
42
|
* raised off its complement - see `SkinViewer.tsx`'s `isIdentityChange` - and because a contract an
|
|
43
43
|
* integrator relies on should be readable without opening the renderer.
|
|
44
|
+
*
|
|
45
|
+
* *** AND THE SAME SPLIT FOR THE OTHER FOUR SUBJECTS, which is a shorter table because they are
|
|
46
|
+
* smaller items: ***
|
|
47
|
+
*
|
|
48
|
+
* `sticker` identity `id`, cheap `wear`
|
|
49
|
+
* `charm` identity `id`, cheap `pattern`
|
|
50
|
+
* `collectible` identity `id`, and NOTHING is cheap - there is no other field to change
|
|
51
|
+
* `operator` identity `id`, cheap `pose`
|
|
52
|
+
*
|
|
53
|
+
* *** CHANGING WHICH SUBJECT YOU PASS IS ALWAYS AN IDENTITY CHANGE, *** in every direction: a weapon
|
|
54
|
+
* and a pin are drawn by different renderers, so the picture is rebuilt from nothing.
|
|
44
55
|
*/
|
|
45
56
|
export const CHEAP_FIELDS = ['float', 'seed', 'statTrak', 'nameTag', 'stickers', 'charm'];
|
|
46
57
|
/* ═════════════════════════════════════════════════════════════════════════════════════════════
|
package/dist/types.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.js","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA8BG;AAIH,OAAO,EAAE,IAAI,EAAmB,MAAM,WAAW,CAAA;AAsGjD
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA8BG;AAIH,OAAO,EAAE,IAAI,EAAmB,MAAM,WAAW,CAAA;AAsGjD;;;;;;;;;;;;;;;;;;;;;;GAsBG;AACH,MAAM,CAAC,MAAM,YAAY,GAAG,CAAC,OAAO,EAAE,MAAM,EAAE,UAAU,EAAE,SAAS,EAAE,UAAU,EAAE,OAAO,CAAU,CAAA;AAwLlG;;;;;;;;;;;;iGAYiG;AAEjG;;;;;;;;;GASG;AACH,MAAM,CAAC,MAAM,SAAS,GAAG;IACxB,SAAS;IACT,QAAQ;IACR,SAAS;IACT,OAAO;IACP,SAAS;IACT,SAAS;IACT,OAAO;IACP,QAAQ;IACR,MAAM;IACN,QAAQ;IACR,UAAU;IACV,OAAO;IACP,SAAS;IACT,WAAW;CACF,CAAA;AA2ZV;;;;;;;;;;;;GAYG;AAEH;;;;;;;GAOG"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@skinhub/viewer",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.2.0",
|
|
4
4
|
"description": "React wrapper for the SkinHub CS2 skin viewer embed — props in, postMessage out. No three.js, no renderer, no asset bundle; React is the only peer.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "dist/index.js",
|
package/src/SkinViewer.tsx
CHANGED
|
@@ -201,7 +201,7 @@ export const SkinViewer = (props: SkinViewerProps) => {
|
|
|
201
201
|
* showing, or the next real item would be diffed against a hole and sent in full for no reason.
|
|
202
202
|
*/
|
|
203
203
|
sent.current = { ...next, item: next.item ?? sent.current.item }
|
|
204
|
-
if (coversCanvas(patch, next
|
|
204
|
+
if (coversCanvas(patch, next)) {
|
|
205
205
|
setStatus('loading')
|
|
206
206
|
// A NEW ITEM IS A NEW CHANCE. A lost GL context or a 404 on one model says nothing about the
|
|
207
207
|
// next one, so the fallback comes down and the frame is allowed to try. A protocol mismatch is
|
package/src/index.ts
CHANGED
|
@@ -6,6 +6,15 @@
|
|
|
6
6
|
* <SkinViewer item={{ weapon: 'weapon_ak47', paintIndex: 1449, float: 0.27 }} style={{ height: 420 }} />
|
|
7
7
|
* <SkinViewer inspectLink={tradeOffer.inspectLink} style={{ height: 420 }} />
|
|
8
8
|
*
|
|
9
|
+
* A weapon (or a glove) is one of SIX ways to name a subject, and each is its own prop:
|
|
10
|
+
*
|
|
11
|
+
* <SkinViewer sticker={{ id: 37, wear: 0.2 }} /> one sticker, the real holo/foil shader
|
|
12
|
+
* <SkinViewer charm={{ id: 5 }} /> one charm, off the gun
|
|
13
|
+
* <SkinViewer collectible={{ id: 874 }} /> one pin, coin, medal or trophy
|
|
14
|
+
* <SkinViewer operator={{ id: 5036 }} /> one agent, alone
|
|
15
|
+
*
|
|
16
|
+
* Exactly one of the six, enforced in the types - see `ViewerSubject`.
|
|
17
|
+
*
|
|
9
18
|
* The 3D is not in here. It is a page on our origin that this component embeds and drives over
|
|
10
19
|
* `postMessage`, which is why installing this pulls in no `three`, no `@react-three/fiber` and no
|
|
11
20
|
* asset bundle - the only peer dependency is React. `EMBED.md` documents the same contract for stacks
|
|
@@ -62,14 +71,18 @@ export type {
|
|
|
62
71
|
ViewerAgent,
|
|
63
72
|
ViewerBackground,
|
|
64
73
|
ViewerCameraSettings,
|
|
74
|
+
ViewerCharmSubject,
|
|
75
|
+
ViewerCollectibleSubject,
|
|
65
76
|
ViewerEnvironmentSettings,
|
|
66
77
|
ViewerGloves,
|
|
67
78
|
ViewerInteractions,
|
|
79
|
+
ViewerOperatorSubject,
|
|
68
80
|
ViewerOverlaySettings,
|
|
69
81
|
ViewerQualitySettings,
|
|
70
82
|
ViewerResize,
|
|
71
83
|
ViewerSettings,
|
|
72
84
|
ViewerStatus,
|
|
85
|
+
ViewerStickerSubject,
|
|
73
86
|
ViewerSubject,
|
|
74
87
|
ViewerView,
|
|
75
88
|
} from './types.js'
|
package/src/item.ts
CHANGED
|
@@ -33,7 +33,14 @@
|
|
|
33
33
|
import { buildInspectUrl, readInspectUrl } from '@skinhub/cdn/inspect'
|
|
34
34
|
import { emptyKeychain, emptySticker, makeSkinPlacement, type SkinPlacement } from '@skinhub/cdn/placement'
|
|
35
35
|
|
|
36
|
-
import type {
|
|
36
|
+
import type {
|
|
37
|
+
FrameCharm,
|
|
38
|
+
FrameCollectible,
|
|
39
|
+
FrameItem,
|
|
40
|
+
FrameSticker,
|
|
41
|
+
FrameSubjectKind,
|
|
42
|
+
PlacementSlots,
|
|
43
|
+
} from './protocol.js'
|
|
37
44
|
import type { SkinViewerCharm, SkinViewerError, SkinViewerItem, SkinViewerSticker, ViewerSubject } from './types.js'
|
|
38
45
|
import { defindexForWeaponId, normalizeWeaponId, weaponIdForDefindex } from './weapons.js'
|
|
39
46
|
|
|
@@ -182,6 +189,70 @@ const fromPlacement = (placement: SkinPlacement, weaponType: string): FrameItem
|
|
|
182
189
|
* build the frame's URL in a `useState` initialiser and have the FIRST PAINT be the integrator's item
|
|
183
190
|
* rather than ours swapped a tick later.
|
|
184
191
|
*/
|
|
192
|
+
/**
|
|
193
|
+
* *** THE OTHER FOUR SUBJECTS, RESOLVED BEFORE THE WEAPON IS EVEN LOOKED FOR. ***
|
|
194
|
+
*
|
|
195
|
+
* Returns null when the props name none of them, which is what sends {@link resolveSubject} on to the
|
|
196
|
+
* `inspectLink` / `item` pair below. The ORDER is the arm order in `types.ts` and it only matters for
|
|
197
|
+
* props that bypassed the types (plain JavaScript, an `any`), where naming two subjects has to mean
|
|
198
|
+
* SOMETHING - it means the first one on this list.
|
|
199
|
+
*
|
|
200
|
+
* *** AN ID THAT IS NOT A POSITIVE INTEGER IS `no-item`, NOT A ZERO. *** `sticker_id: 0` IS the empty
|
|
201
|
+
* slot throughout the renderer, so passing it through would ask the frame to draw an item that by
|
|
202
|
+
* definition does not exist; the instruction card plus an `onError` is a far better answer than an
|
|
203
|
+
* empty canvas. This is the same "data had not arrived yet" case the `no-item` code exists for.
|
|
204
|
+
*/
|
|
205
|
+
export type ResolvedStandalone = {
|
|
206
|
+
subject: Exclude<FrameSubjectKind, 'weapon'>
|
|
207
|
+
sticker?: FrameSticker
|
|
208
|
+
charm?: FrameCharm
|
|
209
|
+
collectible?: FrameCollectible
|
|
210
|
+
agent?: { id: number; pose?: string | null }
|
|
211
|
+
error: SkinViewerError | null
|
|
212
|
+
}
|
|
213
|
+
|
|
214
|
+
export const resolveStandalone = (props: Partial<ViewerSubject>): ResolvedStandalone | null => {
|
|
215
|
+
const bad = (subject: ResolvedStandalone['subject'], prop: string, id: unknown): ResolvedStandalone => ({
|
|
216
|
+
subject,
|
|
217
|
+
error: {
|
|
218
|
+
code: 'no-item',
|
|
219
|
+
message: `\`${prop}.id\` must be a positive integer, got ${JSON.stringify(id)}. In TypeScript that is a compile error, so this is JavaScript, an \`any\`, or data that had not arrived yet.`,
|
|
220
|
+
},
|
|
221
|
+
})
|
|
222
|
+
const ok = (id: unknown) => typeof id === 'number' && Number.isSafeInteger(id) && id > 0
|
|
223
|
+
|
|
224
|
+
if (props.sticker)
|
|
225
|
+
return ok(props.sticker.id)
|
|
226
|
+
? { subject: 'sticker', sticker: dropUndefined({ id: props.sticker.id, wear: props.sticker.wear }), error: null }
|
|
227
|
+
: bad('sticker', 'sticker', props.sticker.id)
|
|
228
|
+
|
|
229
|
+
if (props.charm)
|
|
230
|
+
return ok(props.charm.id)
|
|
231
|
+
? { subject: 'charm', charm: dropUndefined({ id: props.charm.id, pattern: props.charm.pattern }), error: null }
|
|
232
|
+
: bad('charm', 'charm', props.charm.id)
|
|
233
|
+
|
|
234
|
+
if (props.collectible)
|
|
235
|
+
return ok(props.collectible.id)
|
|
236
|
+
? { subject: 'collectible', collectible: { id: props.collectible.id }, error: null }
|
|
237
|
+
: bad('collectible', 'collectible', props.collectible.id)
|
|
238
|
+
|
|
239
|
+
/* `operator` BECOMES `agent` ON THE WIRE - see `FrameSubjectKind`. The pose rides in the same group
|
|
240
|
+
the weapon views use, because it is the same question (which performance) asked of the same row. */
|
|
241
|
+
if (props.operator)
|
|
242
|
+
return ok(props.operator.id)
|
|
243
|
+
? { subject: 'agent', agent: dropUndefined({ id: props.operator.id, pose: props.operator.pose }), error: null }
|
|
244
|
+
: bad('agent', 'operator', props.operator.id)
|
|
245
|
+
|
|
246
|
+
return null
|
|
247
|
+
}
|
|
248
|
+
|
|
249
|
+
/** Drops keys the caller did not set, so "say nothing" survives into the URL and into the diff. */
|
|
250
|
+
const dropUndefined = <T extends object>(source: T): T => {
|
|
251
|
+
const out = {} as T
|
|
252
|
+
for (const key of Object.keys(source) as (keyof T)[]) if (source[key] !== undefined) out[key] = source[key]
|
|
253
|
+
return out
|
|
254
|
+
}
|
|
255
|
+
|
|
185
256
|
export const resolveSubject = (subject: Partial<ViewerSubject>): ResolvedSubject => {
|
|
186
257
|
const fail = (code: SkinViewerError['code'], message: string): ResolvedSubject => ({
|
|
187
258
|
item: null,
|