@vincentt-xr/sdk 2.0.0-alpha.17 → 2.0.0-alpha.19
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/GROUNDING.md +225 -0
- package/components.json +221 -0
- package/dist/{CanonicalHeadFrame-vn-jM9fG.js → CanonicalHeadFrame-CQe2YX9a.js} +3 -3
- package/dist/{DebuggerUI-DDpU-nBF.js → DebuggerUI-CKYrYmod.js} +1 -1
- package/dist/{FaceRetouch-D2xH5OpW.js → FaceRetouch-l7y4oZBu.js} +4 -4
- package/dist/Scenes-BX0bR1j4.js +44 -0
- package/dist/Scenes-Dtt8UGE8.cjs +1 -0
- package/dist/audio/AudioPlayer.d.ts +2 -1
- package/dist/{bodyMaskMaterial-C3aXItLo.js → bodyMaskMaterial-BOdSJUEM.js} +1 -1
- package/dist/{cache-C85JjyZA.js → cache-Mu-VO_6E.js} +2 -2
- package/dist/components/Button/index.d.ts +23 -0
- package/dist/components/Button/safeLink.d.ts +6 -0
- package/dist/components/HtmlRegion/index.d.ts +8 -0
- package/dist/components/Light/index.d.ts +26 -0
- package/dist/components/Model/index.d.ts +16 -0
- package/dist/components/Object3D/index.d.ts +13 -0
- package/dist/components/PaintedFace/index.d.ts +24 -0
- package/dist/components/ScreenImage/types.d.ts +2 -2
- package/dist/components/ScreenText/types.d.ts +2 -1
- package/dist/components/ThemeProvider/index.d.ts +24 -0
- package/dist/components/index.d.ts +6 -0
- package/dist/{contexts-B5GODwuV.js → contexts-Cl-4dUOI.js} +2 -2
- package/dist/debug-ui/media-source.js +1 -1
- package/dist/debug-ui.cjs +1 -1
- package/dist/debug-ui.js +11 -11
- package/dist/{drawNormalizedCrop-BLfB484W.js → drawNormalizedCrop-D606u5-F.js} +5 -5
- package/dist/editor-defs/definitions.d.ts +2 -0
- package/dist/editor-defs/index.d.ts +3 -0
- package/dist/editor-defs/types.d.ts +54 -0
- package/dist/editor-sample/sample.d.ts +15 -0
- package/dist/editor-scenes.cjs +1 -1
- package/dist/editor-scenes.js +39 -25
- package/dist/entries/core.d.ts +13 -1
- package/dist/entries/face-effects.d.ts +2 -0
- package/dist/face-effects.cjs +68 -68
- package/dist/face-effects.js +1353 -1333
- package/dist/{getFaceInfo-D_tCSQC7.js → getFaceInfo-Mt44zlej.js} +1 -1
- package/dist/{index-B9DdHE4u.js → index-B0EYdofX.js} +1 -1
- package/dist/{index-CTqQJj5p.js → index-BDxJWWyy.js} +85 -85
- package/dist/{index-DlP4xxaT.js → index-Bn72laBn.js} +4 -4
- package/dist/{index-Otoo-rph.js → index-CM3jkleV.js} +240 -223
- package/dist/{index-D10O6vqR.js → index-CbBCl2ZU.js} +2 -2
- package/dist/{index-CNt8esFO.js → index-CicO_Tnw.js} +1 -1
- package/dist/{index-Z5eKEUdE.js → index-D5NbXaCn.js} +4 -4
- package/dist/{index-D_pgrgJg.cjs → index-fDwL47CM.cjs} +3 -3
- package/dist/instructions.js +7 -7
- package/dist/{internal-TD4QhIry.js → internal-BoFDq5hC.js} +3 -3
- package/dist/internal.js +2 -2
- package/dist/{landmarks-vLy5QKt6.js → landmarks-C3LvDhMt.js} +1 -1
- package/dist/low-level.js +17 -17
- package/dist/main.cjs +1 -1
- package/dist/main.js +1046 -814
- package/dist/particles.js +5 -5
- package/dist/product.js +2 -2
- package/dist/{providers-DmJlgrDD.js → providers-Bxt_MfPK.js} +3 -3
- package/dist/{renderGroups-BcQYy_J2.js → renderGroups-uYPzUa66.js} +1 -1
- package/dist/{renderPasses-DIPTIU_x.js → renderPasses-C0wu5Cwg.js} +4 -4
- package/dist/scene-object.js +2 -2
- package/dist/scenes/Scenes.d.ts +17 -0
- package/dist/scenes/edit.d.ts +9 -1
- package/dist/{segmentation-CZs5aVvY.js → segmentation-DccvYBBO.js} +9 -9
- package/dist/{selectors-K5JKCWxw.js → selectors-J06V0eDb.js} +1 -1
- package/dist/{session-DHBNTyJJ.js → session-CYiWfcvz.js} +1 -1
- package/dist/tracking.js +25 -25
- package/dist/{trigger-BwZ81ENx.js → trigger-CQviD4xp.js} +155 -155
- package/dist/{useBodies-BMKHXAOL.js → useBodies-DOuwRuew.js} +2 -2
- package/dist/{useFaceInfo-BNVdnprN.js → useFaceInfo-XUGYTdfN.js} +4 -4
- package/dist/{useFaceResultReader-B15wn6RB.js → useFaceResultReader-D8wXbF1L.js} +1 -1
- package/dist/{useIrisTracking-CYm-KDIZ.js → useIrisTracking-B0uLWgNE.js} +10 -10
- package/dist/{useXRCapabilities-ClWlG5_Y.js → useXRCapabilities-DPUOvpdf.js} +1 -1
- package/package.json +6 -2
- package/settings.json +1 -1
- package/dist/Scenes-B30XZfTq.js +0 -29
- package/dist/Scenes-BLL7YvLw.cjs +0 -1
package/GROUNDING.md
CHANGED
|
@@ -287,6 +287,7 @@ The editor reads source, so the shape of the code decides what a creator can cha
|
|
|
287
287
|
- **Settings live in the schema file.** Put every number, string, colour and list a creator may tune in `src/settings.ts` (a zod schema plus the `settings` values), and read it from there. Never hard-code a count, duration, label or colour in a component.
|
|
288
288
|
- **Each scene renders on its own.** A `Scene` must render with no earlier scene having run, using the sample values from `settings`. The editor opens any scene directly; a scene that needs state from another one fails to open.
|
|
289
289
|
- **Spawned objects are a component in `.map()`.** Render each kind as `settings.fruits.map((f) => <FallingFruit key={f.name} {...f} />)` and declare the list's varieties in the schema with `.meta({ varietiesOf: "FallingFruit" })`.
|
|
290
|
+
- **Theme goes in one schema group.** Put app-wide colours and fonts in one object marked `.meta({ kind: "theme" })` (for example `theme: z.object({ brand: z.string().meta({ kind: "colour" }), headingFont: z.enum(["Inter", "Georgia"]) }).meta({ kind: "theme" })`) and wrap the app in `<ThemeProvider theme={settings.theme}>` (`import { ThemeProvider } from "@vincentt-xr/sdk"`). Each value becomes a `--vincentt-*` CSS variable (`brand` -> `--vincentt-brand`, `headingFont` -> `--vincentt-heading-font`); read it with `var(--vincentt-brand)`. Only colours, lengths and font lists are accepted. The editor lists the group as "Theme" with no per-use count.
|
|
290
291
|
- **Style with Tailwind classes** in a literal `className`. No CSS files and no inline `style` for anything a creator would change.
|
|
291
292
|
- **Plain file paths.** Import with relative or plain paths; no glob imports, no computed dynamic `import()`.
|
|
292
293
|
- **Check your work.** Run `vincentt editor --check` and fix everything it lists that you can, until what remains is code only.
|
|
@@ -8808,3 +8809,227 @@ const player = useRef<AudioPlayerHandle>(null);
|
|
|
8808
8809
|
|
|
8809
8810
|
// From a user gesture: player.current?.play(), .pause(), or .stop().
|
|
8810
8811
|
```
|
|
8812
|
+
|
|
8813
|
+
<!-- editable-components:start (generated by pnpm components:generate) -->
|
|
8814
|
+
|
|
8815
|
+
## Editable components
|
|
8816
|
+
|
|
8817
|
+
The editor lists only the components below, imported by name from the package shown. Text, images,
|
|
8818
|
+
sounds and models a person may change go in these components, as literal values
|
|
8819
|
+
(`text="Hello"`, not `text={copy}`).
|
|
8820
|
+
|
|
8821
|
+
Props on every component here: `name` (a literal string; the label the editor shows) and
|
|
8822
|
+
`locked` (literal `true` keeps the part out of the editor; anything else counts as locked).
|
|
8823
|
+
Neither changes how the app renders. Status, error, timer and debug text stays plain code.
|
|
8824
|
+
|
|
8825
|
+
### Declared settings
|
|
8826
|
+
|
|
8827
|
+
Declare editable values in `src/settings.ts` with `import * as z from "zod/mini"`, e.g.
|
|
8828
|
+
`z.string().check(z.minLength(1), z.maxLength(80), z.meta({ label: "Title" }))`.
|
|
8829
|
+
Classic `zod` also parses but costs about 87 KB gzip at first visit; use `zod/mini`.
|
|
8830
|
+
|
|
8831
|
+
### Self-check
|
|
8832
|
+
|
|
8833
|
+
After editing, run `vincentt editor --check --json` and fix every item it reports, then run it
|
|
8834
|
+
again until it reports none. Each item has a `code`, a `component`, a `file` and a `line`.
|
|
8835
|
+
|
|
8836
|
+
| Code | Meaning | Fix |
|
|
8837
|
+
| --------------------------------- | --------------------------------------------- | -------------------------------------------------------- |
|
|
8838
|
+
| `unnamed` | The part has no `name` | Add a literal `name="..."` |
|
|
8839
|
+
| `from_code.computed` | A value is built by an expression | Write the value as a literal |
|
|
8840
|
+
| `from_code.constant` | A value is read from a constant | Write the value in the prop |
|
|
8841
|
+
| `from_code.imported` | A value is imported from another file | Write the value in the prop |
|
|
8842
|
+
| `from_code.conditional` | A value depends on a condition | Use one literal; keep the condition around the component |
|
|
8843
|
+
| `from_code.spread_after` | A later `{...props}` can override the prop | Move the literal after the spread |
|
|
8844
|
+
| `not_recognized.namespace_import` | `import * as` was used | Use a named import |
|
|
8845
|
+
| `not_recognized.reexported` | Imported through a project file | Import from the package itself |
|
|
8846
|
+
| `not_recognized.wrapped` | A project wrapper stands in for the component | Use the component directly |
|
|
8847
|
+
| `not_recognized.sdk_missing` | The SDK is not a declared dependency | Add `@vincentt-xr/sdk` and install |
|
|
8848
|
+
| `not_recognized.sdk_too_old` | The installed SDK has no components list | Update `@vincentt-xr/sdk` |
|
|
8849
|
+
|
|
8850
|
+
### `<AudioPlayer>` - Sound
|
|
8851
|
+
|
|
8852
|
+
Import: `import { AudioPlayer } from "@vincentt-xr/sdk"`.
|
|
8853
|
+
Headless sound. Edit `src`, `volume` (0 to 100) and `playMode` (once, loop or infinite); it draws nothing.
|
|
8854
|
+
|
|
8855
|
+
| Prop | Label | Control |
|
|
8856
|
+
| ---------- | ------ | -------------------------------- |
|
|
8857
|
+
| `src` | Sound | file, accepts audio |
|
|
8858
|
+
| `volume` | Volume | number, 0..100, % |
|
|
8859
|
+
| `playMode` | Loop | choice, once or loop or infinite |
|
|
8860
|
+
|
|
8861
|
+
Insert:
|
|
8862
|
+
|
|
8863
|
+
```tsx
|
|
8864
|
+
<AudioPlayer src="/audio/sound.mp3" />
|
|
8865
|
+
```
|
|
8866
|
+
|
|
8867
|
+
### `<Button>` - Button
|
|
8868
|
+
|
|
8869
|
+
Import: `import { Button } from "@vincentt-xr/sdk"`.
|
|
8870
|
+
A page button. Edit `label`; give it a `link` (https, http or mailto) to open, or write `onTap` code. A button with neither is listed as Not wired yet.
|
|
8871
|
+
|
|
8872
|
+
| Prop | Label | Control |
|
|
8873
|
+
| --------- | ----------- | ----------------------- |
|
|
8874
|
+
| `label` | Label | shortText, max 40 chars |
|
|
8875
|
+
| `link` | Link | link, max 2048 chars |
|
|
8876
|
+
| `onTap` | When tapped | code |
|
|
8877
|
+
| `color` | Colour | colour |
|
|
8878
|
+
| `visible` | Show | switch |
|
|
8879
|
+
|
|
8880
|
+
Insert:
|
|
8881
|
+
|
|
8882
|
+
```tsx
|
|
8883
|
+
<Button label="Button" />
|
|
8884
|
+
```
|
|
8885
|
+
|
|
8886
|
+
### `<HtmlRegion>` - Text block
|
|
8887
|
+
|
|
8888
|
+
Import: `import { HtmlRegion } from "@vincentt-xr/sdk"`.
|
|
8889
|
+
A block of page markup (p, h1-h6, span, lists, links). The editor lists its text pieces; `name` and `locked` are editor-only and change nothing in the published app. Pass `className` for styling.
|
|
8890
|
+
|
|
8891
|
+
| Prop | Label | Control |
|
|
8892
|
+
| ---- | ----- | ------- |
|
|
8893
|
+
|
|
8894
|
+
Insert:
|
|
8895
|
+
|
|
8896
|
+
```tsx
|
|
8897
|
+
<HtmlRegion />
|
|
8898
|
+
```
|
|
8899
|
+
|
|
8900
|
+
### `<Light>` - Light
|
|
8901
|
+
|
|
8902
|
+
Import: `import { Light } from "@vincentt-xr/sdk"`.
|
|
8903
|
+
A light. `castShadow` is off by default because shadows cost frame time on phones. `distance` and `decay` apply to point and spot, `angle` (radians) and `penumbra` to spot only; the editor lists them only when written in the tag. Move it with `position={{ x, y, z }}` written as literal numbers; rotation stays in code.
|
|
8904
|
+
Placement: position3.
|
|
8905
|
+
|
|
8906
|
+
| Prop | Label | Control |
|
|
8907
|
+
| ------------ | ---------------------------- | ----------------------------------------------- |
|
|
8908
|
+
| `type` | Type | choice, ambient or directional or point or spot |
|
|
8909
|
+
| `color` | Colour | colour |
|
|
8910
|
+
| `intensity` | Intensity | number, 0.. |
|
|
8911
|
+
| `enabled` | On | switch |
|
|
8912
|
+
| `castShadow` | Casts shadows (slows phones) | switch |
|
|
8913
|
+
| `distance` | Distance | number, 0.. |
|
|
8914
|
+
| `decay` | Decay | number, 0.. |
|
|
8915
|
+
| `angle` | Angle | number, 0..1.57 |
|
|
8916
|
+
| `penumbra` | Edge softness | number, 0..1 |
|
|
8917
|
+
|
|
8918
|
+
Insert:
|
|
8919
|
+
|
|
8920
|
+
```tsx
|
|
8921
|
+
<Light type="point" />
|
|
8922
|
+
```
|
|
8923
|
+
|
|
8924
|
+
### `<Model>` - Model
|
|
8925
|
+
|
|
8926
|
+
Import: `import { Model } from "@vincentt-xr/sdk"`.
|
|
8927
|
+
A 3D model. Edit the `src` prop; a literal project path or library URL shows in the editor. Move it with `position={{ x, y, z }}`, `rotation={{ x, y, z }}` (degrees) and `scale={{ x, y, z }}` written as literal numbers; the editor drags those.
|
|
8928
|
+
Placement: position3.
|
|
8929
|
+
|
|
8930
|
+
| Prop | Label | Control |
|
|
8931
|
+
| ----- | ----- | ------------------- |
|
|
8932
|
+
| `src` | Model | file, accepts model |
|
|
8933
|
+
|
|
8934
|
+
Insert:
|
|
8935
|
+
|
|
8936
|
+
```tsx
|
|
8937
|
+
<Model />
|
|
8938
|
+
```
|
|
8939
|
+
|
|
8940
|
+
### `<Object3D>` - 3D object
|
|
8941
|
+
|
|
8942
|
+
Import: `import { Object3D } from "@vincentt-xr/sdk"`.
|
|
8943
|
+
Wraps react-three-fiber children. `colour` and `texture` apply to every child mesh material, `size` scales uniformly, `visible` shows or hides. The editor lists only the props present in the tag; position, rotation and scale stay in code.
|
|
8944
|
+
|
|
8945
|
+
| Prop | Label | Control |
|
|
8946
|
+
| --------- | ------- | ------------------- |
|
|
8947
|
+
| `colour` | Colour | colour |
|
|
8948
|
+
| `texture` | Texture | file, accepts image |
|
|
8949
|
+
| `size` | Size | number, 0.. |
|
|
8950
|
+
| `visible` | Show | switch |
|
|
8951
|
+
|
|
8952
|
+
Insert:
|
|
8953
|
+
|
|
8954
|
+
```tsx
|
|
8955
|
+
<Object3D />
|
|
8956
|
+
```
|
|
8957
|
+
|
|
8958
|
+
### `<PaintedFace>` - Face texture
|
|
8959
|
+
|
|
8960
|
+
Import: `import { PaintedFace } from "@vincentt-xr/sdk"`.
|
|
8961
|
+
A painted face from an image, drawn on the tracked face. Paint it in the canonical face layout (`canonicalFaceTextureUrl` is the template). Tracking is unchanged. Live-face swap and mirror modes stay in code (`FaceSwap`, `FaceTextureLayer`).
|
|
8962
|
+
|
|
8963
|
+
| Prop | Label | Control |
|
|
8964
|
+
| ---------- | --------- | ---------------------------------- |
|
|
8965
|
+
| `src` | Image | file, accepts image |
|
|
8966
|
+
| `amount` | Strength | number, 0..1 |
|
|
8967
|
+
| `layout` | Layout | choice, asIs or flip or upsideDown |
|
|
8968
|
+
| `ownEyes` | Own eyes | switch |
|
|
8969
|
+
| `ownMouth` | Own mouth | switch |
|
|
8970
|
+
| `visible` | Show | switch |
|
|
8971
|
+
|
|
8972
|
+
Insert:
|
|
8973
|
+
|
|
8974
|
+
```tsx
|
|
8975
|
+
<PaintedFace src="/images/face.png" />
|
|
8976
|
+
```
|
|
8977
|
+
|
|
8978
|
+
### `<Scene>` - Scene
|
|
8979
|
+
|
|
8980
|
+
Import: `import { Scene } from "@vincentt-xr/sdk"`.
|
|
8981
|
+
A screen the editor can jump to, inside <Scenes current>. `sample`, `overlay`, `open` and `over` are literals the editor reads; they change nothing in the published app. Read sample values with `useSceneSample(key, real)`.
|
|
8982
|
+
|
|
8983
|
+
| Prop | Label | Control |
|
|
8984
|
+
| --------- | ------------------------ | ----------------------- |
|
|
8985
|
+
| `label` | Scene name | shortText, max 60 chars |
|
|
8986
|
+
| `sample` | Sample values | code |
|
|
8987
|
+
| `overlay` | Opens over another scene | switch |
|
|
8988
|
+
| `open` | Open | switch |
|
|
8989
|
+
| `over` | Over scene | shortText, max 64 chars |
|
|
8990
|
+
|
|
8991
|
+
Insert:
|
|
8992
|
+
|
|
8993
|
+
```tsx
|
|
8994
|
+
<Scene id="scene" label="Blank scene" />
|
|
8995
|
+
```
|
|
8996
|
+
|
|
8997
|
+
### `<ScreenImage>` - Image
|
|
8998
|
+
|
|
8999
|
+
Import: `import { ScreenImage } from "@vincentt-xr/sdk"`.
|
|
9000
|
+
Screen-space image. Edit the `src` prop; a literal project path or library URL shows in the editor.
|
|
9001
|
+
Placement: transform.
|
|
9002
|
+
|
|
9003
|
+
| Prop | Label | Control |
|
|
9004
|
+
| ----- | ----- | ------------------- |
|
|
9005
|
+
| `src` | Image | file, accepts image |
|
|
9006
|
+
|
|
9007
|
+
Insert:
|
|
9008
|
+
|
|
9009
|
+
```tsx
|
|
9010
|
+
<ScreenImage transform={{ position: { x: 0, y: 0 }, size: { width: 300, height: 300 } }} />
|
|
9011
|
+
```
|
|
9012
|
+
|
|
9013
|
+
### `<ScreenText>` - Text
|
|
9014
|
+
|
|
9015
|
+
Import: `import { ScreenText } from "@vincentt-xr/sdk"`.
|
|
9016
|
+
Screen-space text. Edit the `text` prop; a literal string shows in the editor.
|
|
9017
|
+
Placement: screenTransform.
|
|
9018
|
+
|
|
9019
|
+
| Prop | Label | Control |
|
|
9020
|
+
| ----------- | ----------- | ------------------------------- |
|
|
9021
|
+
| `text` | Text | longText, max 500 chars |
|
|
9022
|
+
| `color` | Text colour | colour |
|
|
9023
|
+
| `fontSize` | Font size | number, 1.., px |
|
|
9024
|
+
| `textAlign` | Text align | choice, left or center or right |
|
|
9025
|
+
|
|
9026
|
+
Insert:
|
|
9027
|
+
|
|
9028
|
+
```tsx
|
|
9029
|
+
<ScreenText
|
|
9030
|
+
text="Your text"
|
|
9031
|
+
screenTransform={{ position: { x: 0, y: 0 }, size: { width: 600, height: 120 } }}
|
|
9032
|
+
/>
|
|
9033
|
+
```
|
|
9034
|
+
|
|
9035
|
+
<!-- editable-components:end -->
|
package/components.json
ADDED
|
@@ -0,0 +1,221 @@
|
|
|
1
|
+
{
|
|
2
|
+
"schema": "vincentt.components/1",
|
|
3
|
+
"package": "@vincentt-xr/sdk",
|
|
4
|
+
"version": "2.0.0-alpha.19",
|
|
5
|
+
"components": {
|
|
6
|
+
"AudioPlayer": {
|
|
7
|
+
"kind": "sound",
|
|
8
|
+
"label": "Sound",
|
|
9
|
+
"tree": "3d",
|
|
10
|
+
"from": "@vincentt-xr/sdk",
|
|
11
|
+
"nameFrom": "file",
|
|
12
|
+
"props": {
|
|
13
|
+
"src": { "control": "file", "label": "Sound", "accept": "audio" },
|
|
14
|
+
"volume": {
|
|
15
|
+
"control": "number",
|
|
16
|
+
"label": "Volume",
|
|
17
|
+
"showWhenAbsent": true,
|
|
18
|
+
"min": 0,
|
|
19
|
+
"max": 100,
|
|
20
|
+
"step": 1,
|
|
21
|
+
"unit": "%"
|
|
22
|
+
},
|
|
23
|
+
"playMode": {
|
|
24
|
+
"control": "choice",
|
|
25
|
+
"label": "Loop",
|
|
26
|
+
"showWhenAbsent": true,
|
|
27
|
+
"options": ["once", "loop", "infinite"]
|
|
28
|
+
}
|
|
29
|
+
},
|
|
30
|
+
"insert": { "jsx": "<AudioPlayer src=\"/audio/sound.mp3\" />", "asset": "audio" }
|
|
31
|
+
},
|
|
32
|
+
"Button": {
|
|
33
|
+
"kind": "button",
|
|
34
|
+
"label": "Button",
|
|
35
|
+
"tree": "html",
|
|
36
|
+
"from": "@vincentt-xr/sdk",
|
|
37
|
+
"nameFrom": "label",
|
|
38
|
+
"props": {
|
|
39
|
+
"label": { "control": "shortText", "label": "Label", "maxLength": 40 },
|
|
40
|
+
"link": { "control": "link", "label": "Link", "maxLength": 2048 },
|
|
41
|
+
"onTap": { "control": "code", "label": "When tapped" },
|
|
42
|
+
"color": { "control": "colour", "label": "Colour", "group": "Style" },
|
|
43
|
+
"visible": { "control": "switch", "label": "Show", "showWhenAbsent": true }
|
|
44
|
+
},
|
|
45
|
+
"insert": { "jsx": "<Button label=\"Button\" />" }
|
|
46
|
+
},
|
|
47
|
+
"HtmlRegion": {
|
|
48
|
+
"kind": "region",
|
|
49
|
+
"label": "Text block",
|
|
50
|
+
"tree": "html",
|
|
51
|
+
"from": "@vincentt-xr/sdk",
|
|
52
|
+
"nameFrom": "fixed",
|
|
53
|
+
"props": {},
|
|
54
|
+
"insert": { "jsx": "<HtmlRegion />" }
|
|
55
|
+
},
|
|
56
|
+
"Light": {
|
|
57
|
+
"kind": "light",
|
|
58
|
+
"label": "Light",
|
|
59
|
+
"tree": "3d",
|
|
60
|
+
"from": "@vincentt-xr/sdk",
|
|
61
|
+
"nameFrom": "label",
|
|
62
|
+
"place": "position3",
|
|
63
|
+
"props": {
|
|
64
|
+
"type": {
|
|
65
|
+
"control": "choice",
|
|
66
|
+
"label": "Type",
|
|
67
|
+
"showWhenAbsent": true,
|
|
68
|
+
"options": ["ambient", "directional", "point", "spot"]
|
|
69
|
+
},
|
|
70
|
+
"color": { "control": "colour", "label": "Colour", "showWhenAbsent": true },
|
|
71
|
+
"intensity": {
|
|
72
|
+
"control": "number",
|
|
73
|
+
"label": "Intensity",
|
|
74
|
+
"showWhenAbsent": true,
|
|
75
|
+
"min": 0,
|
|
76
|
+
"step": 0.1
|
|
77
|
+
},
|
|
78
|
+
"enabled": { "control": "switch", "label": "On", "showWhenAbsent": true },
|
|
79
|
+
"castShadow": {
|
|
80
|
+
"control": "switch",
|
|
81
|
+
"label": "Casts shadows (slows phones)",
|
|
82
|
+
"showWhenAbsent": true,
|
|
83
|
+
"group": "Shadows"
|
|
84
|
+
},
|
|
85
|
+
"distance": {
|
|
86
|
+
"control": "number",
|
|
87
|
+
"label": "Distance",
|
|
88
|
+
"group": "Reach",
|
|
89
|
+
"min": 0,
|
|
90
|
+
"step": 0.5
|
|
91
|
+
},
|
|
92
|
+
"decay": { "control": "number", "label": "Decay", "group": "Reach", "min": 0, "step": 0.1 },
|
|
93
|
+
"angle": {
|
|
94
|
+
"control": "number",
|
|
95
|
+
"label": "Angle",
|
|
96
|
+
"group": "Spot",
|
|
97
|
+
"min": 0,
|
|
98
|
+
"max": 1.57,
|
|
99
|
+
"step": 0.05
|
|
100
|
+
},
|
|
101
|
+
"penumbra": {
|
|
102
|
+
"control": "number",
|
|
103
|
+
"label": "Edge softness",
|
|
104
|
+
"group": "Spot",
|
|
105
|
+
"min": 0,
|
|
106
|
+
"max": 1,
|
|
107
|
+
"step": 0.05
|
|
108
|
+
}
|
|
109
|
+
},
|
|
110
|
+
"insert": { "jsx": "<Light type=\"point\" />" }
|
|
111
|
+
},
|
|
112
|
+
"Model": {
|
|
113
|
+
"kind": "model",
|
|
114
|
+
"label": "Model",
|
|
115
|
+
"tree": "3d",
|
|
116
|
+
"from": "@vincentt-xr/sdk",
|
|
117
|
+
"nameFrom": "file",
|
|
118
|
+
"place": "position3",
|
|
119
|
+
"props": { "src": { "control": "file", "label": "Model", "accept": "model" } },
|
|
120
|
+
"insert": { "jsx": "<Model />", "asset": "model" }
|
|
121
|
+
},
|
|
122
|
+
"Object3D": {
|
|
123
|
+
"kind": "object3d",
|
|
124
|
+
"label": "3D object",
|
|
125
|
+
"tree": "3d",
|
|
126
|
+
"from": "@vincentt-xr/sdk",
|
|
127
|
+
"nameFrom": "fixed",
|
|
128
|
+
"exposeByPresence": true,
|
|
129
|
+
"props": {
|
|
130
|
+
"colour": { "control": "colour", "label": "Colour" },
|
|
131
|
+
"texture": { "control": "file", "label": "Texture", "accept": "image" },
|
|
132
|
+
"size": { "control": "number", "label": "Size", "min": 0, "step": 0.1 },
|
|
133
|
+
"visible": { "control": "switch", "label": "Show" }
|
|
134
|
+
},
|
|
135
|
+
"insert": { "jsx": "<Object3D />" }
|
|
136
|
+
},
|
|
137
|
+
"PaintedFace": {
|
|
138
|
+
"kind": "facetexture",
|
|
139
|
+
"label": "Face texture",
|
|
140
|
+
"tree": "3d",
|
|
141
|
+
"from": "@vincentt-xr/sdk",
|
|
142
|
+
"nameFrom": "fixed",
|
|
143
|
+
"exposeByPresence": true,
|
|
144
|
+
"props": {
|
|
145
|
+
"src": { "control": "file", "label": "Image", "accept": "image" },
|
|
146
|
+
"amount": { "control": "number", "label": "Strength", "min": 0, "max": 1, "step": 0.05 },
|
|
147
|
+
"layout": {
|
|
148
|
+
"control": "choice",
|
|
149
|
+
"label": "Layout",
|
|
150
|
+
"options": ["asIs", "flip", "upsideDown"]
|
|
151
|
+
},
|
|
152
|
+
"ownEyes": { "control": "switch", "label": "Own eyes" },
|
|
153
|
+
"ownMouth": { "control": "switch", "label": "Own mouth" },
|
|
154
|
+
"visible": { "control": "switch", "label": "Show" }
|
|
155
|
+
},
|
|
156
|
+
"insert": { "jsx": "<PaintedFace src=\"/images/face.png\" />", "asset": "image" }
|
|
157
|
+
},
|
|
158
|
+
"Scene": {
|
|
159
|
+
"kind": "scene",
|
|
160
|
+
"label": "Scene",
|
|
161
|
+
"tree": "both",
|
|
162
|
+
"from": "@vincentt-xr/sdk",
|
|
163
|
+
"nameFrom": "label",
|
|
164
|
+
"props": {
|
|
165
|
+
"label": { "control": "shortText", "label": "Scene name", "maxLength": 60 },
|
|
166
|
+
"sample": { "control": "code", "label": "Sample values", "group": "Preview" },
|
|
167
|
+
"overlay": { "control": "switch", "label": "Opens over another scene", "group": "Preview" },
|
|
168
|
+
"open": { "control": "switch", "label": "Open", "group": "Preview" },
|
|
169
|
+
"over": {
|
|
170
|
+
"control": "shortText",
|
|
171
|
+
"label": "Over scene",
|
|
172
|
+
"group": "Preview",
|
|
173
|
+
"maxLength": 64
|
|
174
|
+
}
|
|
175
|
+
},
|
|
176
|
+
"insert": { "jsx": "<Scene id=\"scene\" label=\"Blank scene\" />" }
|
|
177
|
+
},
|
|
178
|
+
"ScreenImage": {
|
|
179
|
+
"kind": "image",
|
|
180
|
+
"label": "Image",
|
|
181
|
+
"tree": "3d",
|
|
182
|
+
"from": "@vincentt-xr/sdk",
|
|
183
|
+
"nameFrom": "file",
|
|
184
|
+
"place": "transform",
|
|
185
|
+
"props": { "src": { "control": "file", "label": "Image", "accept": "image" } },
|
|
186
|
+
"insert": {
|
|
187
|
+
"jsx": "<ScreenImage transform={{ position: { x: 0, y: 0 }, size: { width: 300, height: 300 } }} />",
|
|
188
|
+
"asset": "image"
|
|
189
|
+
}
|
|
190
|
+
},
|
|
191
|
+
"ScreenText": {
|
|
192
|
+
"kind": "text",
|
|
193
|
+
"label": "Text",
|
|
194
|
+
"tree": "3d",
|
|
195
|
+
"from": "@vincentt-xr/sdk",
|
|
196
|
+
"nameFrom": "text",
|
|
197
|
+
"place": "screenTransform",
|
|
198
|
+
"props": {
|
|
199
|
+
"text": { "control": "longText", "label": "Text", "maxLength": 500 },
|
|
200
|
+
"color": { "control": "colour", "label": "Text colour", "group": "Style" },
|
|
201
|
+
"fontSize": {
|
|
202
|
+
"control": "number",
|
|
203
|
+
"label": "Font size",
|
|
204
|
+
"group": "Style",
|
|
205
|
+
"min": 1,
|
|
206
|
+
"step": 1,
|
|
207
|
+
"unit": "px"
|
|
208
|
+
},
|
|
209
|
+
"textAlign": {
|
|
210
|
+
"control": "choice",
|
|
211
|
+
"label": "Text align",
|
|
212
|
+
"group": "Style",
|
|
213
|
+
"options": ["left", "center", "right"]
|
|
214
|
+
}
|
|
215
|
+
},
|
|
216
|
+
"insert": {
|
|
217
|
+
"jsx": "<ScreenText text=\"Your text\" screenTransform={{ position: { x: 0, y: 0 }, size: { width: 600, height: 120 } }} />"
|
|
218
|
+
}
|
|
219
|
+
}
|
|
220
|
+
}
|
|
221
|
+
}
|
|
@@ -2,9 +2,9 @@ import { jsx as _ } from "react/jsx-runtime";
|
|
|
2
2
|
import { useCallback as H, useRef as S, createContext as g } from "react";
|
|
3
3
|
import { useThree as h } from "@react-three/fiber";
|
|
4
4
|
import * as l from "three";
|
|
5
|
-
import { j as w, n as d } from "./index-
|
|
6
|
-
import { u as P } from "./index-
|
|
7
|
-
import { b as y } from "./selectors-
|
|
5
|
+
import { j as w, n as d } from "./index-BDxJWWyy.js";
|
|
6
|
+
import { u as P } from "./index-CbBCl2ZU.js";
|
|
7
|
+
import { b as y } from "./selectors-J06V0eDb.js";
|
|
8
8
|
import { s as M } from "./similarityFit-Bbz-R8AY.js";
|
|
9
9
|
import { L as k, u as v } from "./useLandmarkPoseFit-Bmb3h6Mw.js";
|
|
10
10
|
const Y = /* @__PURE__ */ Float32Array.from([
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { jsx as e, jsxs as n, Fragment as u } from "react/jsx-runtime";
|
|
2
2
|
import { useState as k, useEffect as w } from "react";
|
|
3
3
|
import { createPortal as R } from "react-dom";
|
|
4
|
-
import { f as i } from "./internal-
|
|
4
|
+
import { f as i } from "./internal-BoFDq5hC.js";
|
|
5
5
|
const v = {
|
|
6
6
|
position: "fixed",
|
|
7
7
|
top: "10px",
|
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
import { F as v, a as q, b as B, c as N, d as J, e as d, f as R } from "./renderPasses-
|
|
1
|
+
import { F as v, a as q, b as B, c as N, d as J, e as d, f as R } from "./renderPasses-C0wu5Cwg.js";
|
|
2
2
|
import * as S from "three";
|
|
3
3
|
import { jsx as _, jsxs as ge } from "react/jsx-runtime";
|
|
4
4
|
import { useMemo as M, useEffect as Q } from "react";
|
|
5
|
-
import { j as fe } from "./index-
|
|
6
|
-
import { u as be } from "./landmarks-
|
|
5
|
+
import { j as fe } from "./index-BDxJWWyy.js";
|
|
6
|
+
import { u as be } from "./landmarks-C3LvDhMt.js";
|
|
7
7
|
import { F as ve, r as Se, a as ye } from "./renderState-CJNmj5jz.js";
|
|
8
8
|
import { useThree as ke, useFrame as xe } from "@react-three/fiber";
|
|
9
|
-
import { c as Ee } from "./selectors-
|
|
9
|
+
import { c as Ee } from "./selectors-J06V0eDb.js";
|
|
10
10
|
import { f as Me } from "./FaceSurface-DmP9AEeC.js";
|
|
11
11
|
import { c as Re, d as we } from "./landmarkMask-DHivVjJm.js";
|
|
12
12
|
const ht = [
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import { jsx as s, Fragment as c } from "react/jsx-runtime";
|
|
2
|
+
import { createContext as u, useContext as p, Children as a, isValidElement as f, Fragment as l } from "react";
|
|
3
|
+
const m = u(null);
|
|
4
|
+
function g(t) {
|
|
5
|
+
if (!(typeof t != "object" || t === null || Array.isArray(t)))
|
|
6
|
+
return t;
|
|
7
|
+
}
|
|
8
|
+
function d(t, n) {
|
|
9
|
+
const e = p(m);
|
|
10
|
+
return e === null || !e.direct ? n : Object.prototype.hasOwnProperty.call(e.values, t) ? e.values[t] : n;
|
|
11
|
+
}
|
|
12
|
+
function x(t, n) {
|
|
13
|
+
return d(t, n);
|
|
14
|
+
}
|
|
15
|
+
const o = "vctScene";
|
|
16
|
+
function y({ children: t }) {
|
|
17
|
+
return /* @__PURE__ */ s(c, { children: t });
|
|
18
|
+
}
|
|
19
|
+
y[o] = !0;
|
|
20
|
+
function i(t) {
|
|
21
|
+
const n = [];
|
|
22
|
+
for (const e of a.toArray(t)) {
|
|
23
|
+
if (!f(e)) continue;
|
|
24
|
+
if (e.type === l) {
|
|
25
|
+
n.push(...i(e.props.children));
|
|
26
|
+
continue;
|
|
27
|
+
}
|
|
28
|
+
const r = e.type;
|
|
29
|
+
typeof r == "string" || r[o] !== !0 || typeof e.props.id == "string" && n.push({ id: e.props.id, element: e });
|
|
30
|
+
}
|
|
31
|
+
return n;
|
|
32
|
+
}
|
|
33
|
+
function C({ current: t, children: n }) {
|
|
34
|
+
const e = i(n).find((r) => r.id === t);
|
|
35
|
+
return e ? e.element : null;
|
|
36
|
+
}
|
|
37
|
+
export {
|
|
38
|
+
m as S,
|
|
39
|
+
y as a,
|
|
40
|
+
C as b,
|
|
41
|
+
g as r,
|
|
42
|
+
i as s,
|
|
43
|
+
x as u
|
|
44
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";const i=require("react/jsx-runtime"),r=require("react"),s=r.createContext(null);function l(e){if(!(typeof e!="object"||e===null||Array.isArray(e)))return e}function f(e,t){const n=r.useContext(s);return n===null||!n.direct?t:Object.prototype.hasOwnProperty.call(n.values,e)?n.values[e]:t}function a(e,t){return f(e,t)}const u="vctScene";function p({children:e}){return i.jsx(i.Fragment,{children:e})}p[u]=!0;function o(e){const t=[];for(const n of r.Children.toArray(e)){if(!r.isValidElement(n))continue;if(n.type===r.Fragment){t.push(...o(n.props.children));continue}const c=n.type;typeof c=="string"||c[u]!==!0||typeof n.props.id=="string"&&t.push({id:n.props.id,element:n})}return t}function S({current:e,children:t}){const n=o(t).find(c=>c.id===e);return n?n.element:null}exports.SampleContext=s;exports.Scene=p;exports.Scenes=S;exports.readSample=l;exports.sceneEntries=o;exports.useSceneSample=a;
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { KnownComponentProps } from '../editor-defs/types';
|
|
1
2
|
export type AudioPlayMode = "once" | "loop" | "infinite";
|
|
2
3
|
export interface AudioPlayerHandle {
|
|
3
4
|
play: () => Promise<void>;
|
|
@@ -5,7 +6,7 @@ export interface AudioPlayerHandle {
|
|
|
5
6
|
stop: () => void;
|
|
6
7
|
readonly current: HTMLAudioElement | null;
|
|
7
8
|
}
|
|
8
|
-
export interface AudioPlayerProps {
|
|
9
|
+
export interface AudioPlayerProps extends KnownComponentProps {
|
|
9
10
|
/** @tweak asset accept=audio */
|
|
10
11
|
src: string;
|
|
11
12
|
playMode?: AudioPlayMode;
|
|
@@ -2,8 +2,8 @@ var w = Object.defineProperty;
|
|
|
2
2
|
var m = (n, e, s) => e in n ? w(n, e, { enumerable: !0, configurable: !0, writable: !0, value: s }) : n[e] = s;
|
|
3
3
|
var a = (n, e, s) => m(n, typeof e != "symbol" ? e + "" : e, s);
|
|
4
4
|
import { useMemo as g, useCallback as f } from "react";
|
|
5
|
-
import { u as v, r as p, a as S, l as A, b as k, E } from "./index-
|
|
6
|
-
import { u as B, a as _ } from "./selectors-
|
|
5
|
+
import { u as v, r as p, a as S, l as A, b as k, E } from "./index-BDxJWWyy.js";
|
|
6
|
+
import { u as B, a as _ } from "./selectors-J06V0eDb.js";
|
|
7
7
|
const X = (n) => {
|
|
8
8
|
const { session: e } = v(), s = B(), i = _(), o = JSON.stringify(n ?? null), t = g(
|
|
9
9
|
() => n ? p(n) : i ?? p(),
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { MouseEvent, ReactNode } from 'react';
|
|
2
|
+
import { KnownComponentProps } from '../../editor-defs/types';
|
|
3
|
+
export { safeLink } from './safeLink';
|
|
4
|
+
export type ButtonProps = KnownComponentProps & {
|
|
5
|
+
/** Button text. */
|
|
6
|
+
label?: string;
|
|
7
|
+
/** Where a tap goes: https, http, mailto, "#section" or "/path". Anything else is ignored. */
|
|
8
|
+
link?: string;
|
|
9
|
+
/** Code that runs on a tap. The editor shows it read-only; a button with neither this nor `link` reads "Not wired yet". */
|
|
10
|
+
onTap?: (event: MouseEvent<HTMLElement>) => void;
|
|
11
|
+
/** Background colour (CSS colour). Defaults to the theme's `--vincentt-button`. */
|
|
12
|
+
color?: string;
|
|
13
|
+
/** `false` hides it. Default `true`. */
|
|
14
|
+
visible?: boolean;
|
|
15
|
+
className?: string;
|
|
16
|
+
children?: ReactNode;
|
|
17
|
+
};
|
|
18
|
+
/**
|
|
19
|
+
* A page button (DOM, outside the canvas). A valid `link` makes it an anchor that opens the link;
|
|
20
|
+
* `onTap` runs on a tap either way. With neither it is a plain button that does nothing, which the
|
|
21
|
+
* editor lists as "Not wired yet".
|
|
22
|
+
*/
|
|
23
|
+
export declare function Button({ label, link, onTap, color, visible, className, children, name: _name, locked: _locked, }: ButtonProps): import("react/jsx-runtime").JSX.Element | null;
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The editor's Link grammar: https, http, mailto, an in-page "#x" or a site path. The editor
|
|
3
|
+
* refuses anything else on write; this stops code, a hand edit or a stale file from putting a
|
|
4
|
+
* script URL on a published page.
|
|
5
|
+
*/
|
|
6
|
+
export declare function safeLink(link: unknown): string | undefined;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { ReactNode } from 'react';
|
|
2
|
+
import { KnownComponentProps } from '../../editor-defs/types';
|
|
3
|
+
export type HtmlRegionProps = KnownComponentProps & {
|
|
4
|
+
className?: string;
|
|
5
|
+
/** Markup only. The editor lists its text pieces. */
|
|
6
|
+
children?: ReactNode;
|
|
7
|
+
};
|
|
8
|
+
export declare function HtmlRegion({ className, children, name: _name, locked: _locked, }: HtmlRegionProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { KnownComponentProps } from '../../editor-defs/types';
|
|
2
|
+
import { LightType } from '../LightObject';
|
|
3
|
+
import { Transform3DVector } from '../Transform3D';
|
|
4
|
+
export type LightProps = KnownComponentProps & {
|
|
5
|
+
type?: LightType;
|
|
6
|
+
/** CSS colour, for example `#ffffff`. */
|
|
7
|
+
color?: string;
|
|
8
|
+
intensity?: number;
|
|
9
|
+
enabled?: boolean;
|
|
10
|
+
/** Shadows cost frame time on phones, so this is off unless asked for. */
|
|
11
|
+
castShadow?: boolean;
|
|
12
|
+
/** Point and spot only. */
|
|
13
|
+
distance?: number;
|
|
14
|
+
/** Point and spot only. */
|
|
15
|
+
decay?: number;
|
|
16
|
+
/** Spot only, radians. */
|
|
17
|
+
angle?: number;
|
|
18
|
+
/** Spot only. */
|
|
19
|
+
penumbra?: number;
|
|
20
|
+
/** An axis left out keeps its default, so the editor may write one axis at a time. */
|
|
21
|
+
position?: Partial<Transform3DVector>;
|
|
22
|
+
/** Degrees; code only. */
|
|
23
|
+
rotation?: Partial<Transform3DVector>;
|
|
24
|
+
showHelper?: boolean;
|
|
25
|
+
};
|
|
26
|
+
export declare function Light({ type, color, intensity, enabled, castShadow, distance, decay, angle, penumbra, position, rotation, showHelper, name: _name, locked: _locked, }: LightProps): import("react/jsx-runtime").JSX.Element;
|