@vincentt-xr/sdk 2.0.0-alpha.17 → 2.0.0-alpha.18

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.
Files changed (70) hide show
  1. package/GROUNDING.md +181 -0
  2. package/components.json +144 -0
  3. package/dist/{CanonicalHeadFrame-vn-jM9fG.js → CanonicalHeadFrame-CQe2YX9a.js} +3 -3
  4. package/dist/{DebuggerUI-DDpU-nBF.js → DebuggerUI-CKYrYmod.js} +1 -1
  5. package/dist/{FaceRetouch-D2xH5OpW.js → FaceRetouch-l7y4oZBu.js} +4 -4
  6. package/dist/Scenes-BX0bR1j4.js +44 -0
  7. package/dist/Scenes-Dtt8UGE8.cjs +1 -0
  8. package/dist/audio/AudioPlayer.d.ts +2 -1
  9. package/dist/{bodyMaskMaterial-C3aXItLo.js → bodyMaskMaterial-BOdSJUEM.js} +1 -1
  10. package/dist/{cache-C85JjyZA.js → cache-Mu-VO_6E.js} +2 -2
  11. package/dist/components/Button/index.d.ts +23 -0
  12. package/dist/components/Button/safeLink.d.ts +6 -0
  13. package/dist/components/HtmlRegion/index.d.ts +8 -0
  14. package/dist/components/Model/index.d.ts +16 -0
  15. package/dist/components/Object3D/index.d.ts +13 -0
  16. package/dist/components/ScreenImage/types.d.ts +2 -2
  17. package/dist/components/ScreenText/types.d.ts +2 -1
  18. package/dist/components/ThemeProvider/index.d.ts +24 -0
  19. package/dist/components/index.d.ts +4 -0
  20. package/dist/{contexts-B5GODwuV.js → contexts-Cl-4dUOI.js} +2 -2
  21. package/dist/debug-ui/media-source.js +1 -1
  22. package/dist/debug-ui.cjs +1 -1
  23. package/dist/debug-ui.js +11 -11
  24. package/dist/{drawNormalizedCrop-BLfB484W.js → drawNormalizedCrop-D606u5-F.js} +5 -5
  25. package/dist/editor-defs/definitions.d.ts +2 -0
  26. package/dist/editor-defs/index.d.ts +3 -0
  27. package/dist/editor-defs/types.d.ts +54 -0
  28. package/dist/editor-sample/sample.d.ts +15 -0
  29. package/dist/editor-scenes.cjs +1 -1
  30. package/dist/editor-scenes.js +39 -25
  31. package/dist/entries/core.d.ts +11 -1
  32. package/dist/face-effects.js +17 -17
  33. package/dist/{getFaceInfo-D_tCSQC7.js → getFaceInfo-Mt44zlej.js} +1 -1
  34. package/dist/{index-B9DdHE4u.js → index-B0EYdofX.js} +1 -1
  35. package/dist/{index-D_pgrgJg.cjs → index-B5X4N2tc.cjs} +3 -3
  36. package/dist/{index-CTqQJj5p.js → index-BDxJWWyy.js} +85 -85
  37. package/dist/{index-DlP4xxaT.js → index-Bn72laBn.js} +4 -4
  38. package/dist/{index-D10O6vqR.js → index-CbBCl2ZU.js} +2 -2
  39. package/dist/{index-CNt8esFO.js → index-CicO_Tnw.js} +1 -1
  40. package/dist/{index-Z5eKEUdE.js → index-D5NbXaCn.js} +4 -4
  41. package/dist/{index-Otoo-rph.js → index-DN_eHnag.js} +201 -195
  42. package/dist/instructions.js +7 -7
  43. package/dist/{internal-TD4QhIry.js → internal-BoFDq5hC.js} +3 -3
  44. package/dist/internal.js +2 -2
  45. package/dist/{landmarks-vLy5QKt6.js → landmarks-C3LvDhMt.js} +1 -1
  46. package/dist/low-level.js +17 -17
  47. package/dist/main.cjs +1 -1
  48. package/dist/main.js +932 -749
  49. package/dist/particles.js +5 -5
  50. package/dist/product.js +2 -2
  51. package/dist/{providers-DmJlgrDD.js → providers-Bxt_MfPK.js} +3 -3
  52. package/dist/{renderGroups-BcQYy_J2.js → renderGroups-uYPzUa66.js} +1 -1
  53. package/dist/{renderPasses-DIPTIU_x.js → renderPasses-C0wu5Cwg.js} +4 -4
  54. package/dist/scene-object.js +2 -2
  55. package/dist/scenes/Scenes.d.ts +17 -0
  56. package/dist/scenes/edit.d.ts +9 -1
  57. package/dist/{segmentation-CZs5aVvY.js → segmentation-DccvYBBO.js} +9 -9
  58. package/dist/{selectors-K5JKCWxw.js → selectors-J06V0eDb.js} +1 -1
  59. package/dist/{session-DHBNTyJJ.js → session-CYiWfcvz.js} +1 -1
  60. package/dist/tracking.js +25 -25
  61. package/dist/{trigger-BwZ81ENx.js → trigger-CQviD4xp.js} +155 -155
  62. package/dist/{useBodies-BMKHXAOL.js → useBodies-DOuwRuew.js} +2 -2
  63. package/dist/{useFaceInfo-BNVdnprN.js → useFaceInfo-XUGYTdfN.js} +4 -4
  64. package/dist/{useFaceResultReader-B15wn6RB.js → useFaceResultReader-D8wXbF1L.js} +1 -1
  65. package/dist/{useIrisTracking-CYm-KDIZ.js → useIrisTracking-B0uLWgNE.js} +10 -10
  66. package/dist/{useXRCapabilities-ClWlG5_Y.js → useXRCapabilities-DPUOvpdf.js} +1 -1
  67. package/package.json +6 -2
  68. package/settings.json +1 -1
  69. package/dist/Scenes-B30XZfTq.js +0 -29
  70. 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,183 @@ 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
+ ### `<Model>` - Model
8901
+
8902
+ Import: `import { Model } from "@vincentt-xr/sdk"`.
8903
+ 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.
8904
+ Placement: position3.
8905
+
8906
+ | Prop | Label | Control |
8907
+ | ----- | ----- | ------------------- |
8908
+ | `src` | Model | file, accepts model |
8909
+
8910
+ Insert:
8911
+
8912
+ ```tsx
8913
+ <Model />
8914
+ ```
8915
+
8916
+ ### `<Object3D>` - 3D object
8917
+
8918
+ Import: `import { Object3D } from "@vincentt-xr/sdk"`.
8919
+ 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.
8920
+
8921
+ | Prop | Label | Control |
8922
+ | --------- | ------- | ------------------- |
8923
+ | `colour` | Colour | colour |
8924
+ | `texture` | Texture | file, accepts image |
8925
+ | `size` | Size | number, 0.. |
8926
+ | `visible` | Show | switch |
8927
+
8928
+ Insert:
8929
+
8930
+ ```tsx
8931
+ <Object3D />
8932
+ ```
8933
+
8934
+ ### `<Scene>` - Scene
8935
+
8936
+ Import: `import { Scene } from "@vincentt-xr/sdk"`.
8937
+ 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)`.
8938
+
8939
+ | Prop | Label | Control |
8940
+ | --------- | ------------------------ | ----------------------- |
8941
+ | `label` | Scene name | shortText, max 60 chars |
8942
+ | `sample` | Sample values | code |
8943
+ | `overlay` | Opens over another scene | switch |
8944
+ | `open` | Open | switch |
8945
+ | `over` | Over scene | shortText, max 64 chars |
8946
+
8947
+ Insert:
8948
+
8949
+ ```tsx
8950
+ <Scene id="scene" label="Blank scene" />
8951
+ ```
8952
+
8953
+ ### `<ScreenImage>` - Image
8954
+
8955
+ Import: `import { ScreenImage } from "@vincentt-xr/sdk"`.
8956
+ Screen-space image. Edit the `src` prop; a literal project path or library URL shows in the editor.
8957
+ Placement: transform.
8958
+
8959
+ | Prop | Label | Control |
8960
+ | ----- | ----- | ------------------- |
8961
+ | `src` | Image | file, accepts image |
8962
+
8963
+ Insert:
8964
+
8965
+ ```tsx
8966
+ <ScreenImage transform={{ position: { x: 0, y: 0 }, size: { width: 300, height: 300 } }} />
8967
+ ```
8968
+
8969
+ ### `<ScreenText>` - Text
8970
+
8971
+ Import: `import { ScreenText } from "@vincentt-xr/sdk"`.
8972
+ Screen-space text. Edit the `text` prop; a literal string shows in the editor.
8973
+ Placement: screenTransform.
8974
+
8975
+ | Prop | Label | Control |
8976
+ | ----------- | ----------- | ------------------------------- |
8977
+ | `text` | Text | longText, max 500 chars |
8978
+ | `color` | Text colour | colour |
8979
+ | `fontSize` | Font size | number, 1.., px |
8980
+ | `textAlign` | Text align | choice, left or center or right |
8981
+
8982
+ Insert:
8983
+
8984
+ ```tsx
8985
+ <ScreenText
8986
+ text="Your text"
8987
+ screenTransform={{ position: { x: 0, y: 0 }, size: { width: 600, height: 120 } }}
8988
+ />
8989
+ ```
8990
+
8991
+ <!-- editable-components:end -->
@@ -0,0 +1,144 @@
1
+ {
2
+ "schema": "vincentt.components/1",
3
+ "package": "@vincentt-xr/sdk",
4
+ "version": "2.0.0-alpha.18",
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
+ "Model": {
57
+ "kind": "model",
58
+ "label": "Model",
59
+ "tree": "3d",
60
+ "from": "@vincentt-xr/sdk",
61
+ "nameFrom": "file",
62
+ "place": "position3",
63
+ "props": { "src": { "control": "file", "label": "Model", "accept": "model" } },
64
+ "insert": { "jsx": "<Model />", "asset": "model" }
65
+ },
66
+ "Object3D": {
67
+ "kind": "object3d",
68
+ "label": "3D object",
69
+ "tree": "3d",
70
+ "from": "@vincentt-xr/sdk",
71
+ "nameFrom": "fixed",
72
+ "exposeByPresence": true,
73
+ "props": {
74
+ "colour": { "control": "colour", "label": "Colour" },
75
+ "texture": { "control": "file", "label": "Texture", "accept": "image" },
76
+ "size": { "control": "number", "label": "Size", "min": 0, "step": 0.1 },
77
+ "visible": { "control": "switch", "label": "Show" }
78
+ },
79
+ "insert": { "jsx": "<Object3D />" }
80
+ },
81
+ "Scene": {
82
+ "kind": "scene",
83
+ "label": "Scene",
84
+ "tree": "both",
85
+ "from": "@vincentt-xr/sdk",
86
+ "nameFrom": "label",
87
+ "props": {
88
+ "label": { "control": "shortText", "label": "Scene name", "maxLength": 60 },
89
+ "sample": { "control": "code", "label": "Sample values", "group": "Preview" },
90
+ "overlay": { "control": "switch", "label": "Opens over another scene", "group": "Preview" },
91
+ "open": { "control": "switch", "label": "Open", "group": "Preview" },
92
+ "over": {
93
+ "control": "shortText",
94
+ "label": "Over scene",
95
+ "group": "Preview",
96
+ "maxLength": 64
97
+ }
98
+ },
99
+ "insert": { "jsx": "<Scene id=\"scene\" label=\"Blank scene\" />" }
100
+ },
101
+ "ScreenImage": {
102
+ "kind": "image",
103
+ "label": "Image",
104
+ "tree": "3d",
105
+ "from": "@vincentt-xr/sdk",
106
+ "nameFrom": "file",
107
+ "place": "transform",
108
+ "props": { "src": { "control": "file", "label": "Image", "accept": "image" } },
109
+ "insert": {
110
+ "jsx": "<ScreenImage transform={{ position: { x: 0, y: 0 }, size: { width: 300, height: 300 } }} />",
111
+ "asset": "image"
112
+ }
113
+ },
114
+ "ScreenText": {
115
+ "kind": "text",
116
+ "label": "Text",
117
+ "tree": "3d",
118
+ "from": "@vincentt-xr/sdk",
119
+ "nameFrom": "text",
120
+ "place": "screenTransform",
121
+ "props": {
122
+ "text": { "control": "longText", "label": "Text", "maxLength": 500 },
123
+ "color": { "control": "colour", "label": "Text colour", "group": "Style" },
124
+ "fontSize": {
125
+ "control": "number",
126
+ "label": "Font size",
127
+ "group": "Style",
128
+ "min": 1,
129
+ "step": 1,
130
+ "unit": "px"
131
+ },
132
+ "textAlign": {
133
+ "control": "choice",
134
+ "label": "Text align",
135
+ "group": "Style",
136
+ "options": ["left", "center", "right"]
137
+ }
138
+ },
139
+ "insert": {
140
+ "jsx": "<ScreenText text=\"Your text\" screenTransform={{ position: { x: 0, y: 0 }, size: { width: 600, height: 120 } }} />"
141
+ }
142
+ }
143
+ }
144
+ }
@@ -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-CTqQJj5p.js";
6
- import { u as P } from "./index-D10O6vqR.js";
7
- import { b as y } from "./selectors-K5JKCWxw.js";
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-TD4QhIry.js";
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-DIPTIU_x.js";
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-CTqQJj5p.js";
6
- import { u as be } from "./landmarks-vLy5QKt6.js";
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-K5JKCWxw.js";
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;
@@ -1,5 +1,5 @@
1
1
  import * as p from "three";
2
- import { B as e, X as S } from "./index-CTqQJj5p.js";
2
+ import { B as e, X as S } from "./index-BDxJWWyy.js";
3
3
  const b = [
4
4
  [e.leftShoulder, e.rightShoulder],
5
5
  [e.leftHip, e.rightHip],
@@ -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-CTqQJj5p.js";
6
- import { u as B, a as _ } from "./selectors-K5JKCWxw.js";
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,16 @@
1
+ import { KnownComponentProps } from '../../editor-defs/types';
2
+ import { MeshRendererSettings } from '../MeshRenderer';
3
+ import { Transform3DVector } from '../Transform3D';
4
+ export type ModelProps = KnownComponentProps & {
5
+ /** GLTF/GLB project path or library URL. */
6
+ src?: string;
7
+ /** An axis left out keeps its default, so the editor may write one axis at a time. */
8
+ position?: Partial<Transform3DVector>;
9
+ /** Degrees. */
10
+ rotation?: Partial<Transform3DVector>;
11
+ scale?: Partial<Transform3DVector>;
12
+ visible?: boolean;
13
+ /** MeshRenderer settings other than the model file; code only. */
14
+ material?: Partial<MeshRendererSettings["material"]>;
15
+ };
16
+ export declare function Model({ src, position, rotation, scale, visible, material, name: _name, locked: _locked, }: ModelProps): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,13 @@
1
+ import { ReactNode } from 'react';
2
+ import { KnownComponentProps } from '../../editor-defs/types';
3
+ export type Object3DProps = KnownComponentProps & {
4
+ /** CSS colour applied to every mesh material under the children. */
5
+ colour?: string;
6
+ /** Image project path or library URL used as the colour map of every mesh material. */
7
+ texture?: string;
8
+ /** Uniform scale. */
9
+ size?: number;
10
+ visible?: boolean;
11
+ children?: ReactNode;
12
+ };
13
+ export declare function Object3D({ colour, texture, size, visible, children, name: _name, locked: _locked, }: Object3DProps): import("react/jsx-runtime").JSX.Element;
@@ -1,3 +1,4 @@
1
+ import { KnownComponentProps } from '../../editor-defs/types';
1
2
  import { ScreenAnchorEdges, ScreenOffsetEdges, ScreenTransformGuideLayer } from '../ScreenSpaceUI';
2
3
  import { ScreenCanvasSize, ScreenCoordinateSpace, ScreenTransform2DSettings } from '../../screen2d';
3
4
  import { ScreenImageFit, ScreenImageStretchMode } from './fit';
@@ -20,8 +21,7 @@ export type ScreenImageAnchorEdges = ScreenAnchorEdges & {
20
21
  /** @tweak unit=ratio min=-2 max=2 step=0.001 label="Bottom anchor" */
21
22
  bottom?: number;
22
23
  };
23
- export type ScreenImageProps = {
24
- name?: string;
24
+ export type ScreenImageProps = KnownComponentProps & {
25
25
  source?: ScreenImageSource;
26
26
  /**
27
27
  * Image URL or project path. Ignored while `source` is set.
@@ -1,3 +1,4 @@
1
+ import { KnownComponentProps } from '../../editor-defs/types';
1
2
  import { TextBendPreset, TextLabelProps } from '../TextLabel';
2
3
  import { ScreenAnchorEdges, ScreenTransformGuideLayer } from '../ScreenSpaceUI';
3
4
  import { ScreenCanvasSize, ScreenCoordinateSpace, ScreenTransform2D, ScreenTransform2DSettings } from '../../screen2d';
@@ -6,7 +7,7 @@ export type ScreenTextBendSettings = {
6
7
  preset: TextBendPreset;
7
8
  strength: number;
8
9
  };
9
- export type ScreenTextProps = Omit<TextLabelProps, "aspect" | "position" | "rotation" | "scale"> & {
10
+ export type ScreenTextProps = Omit<TextLabelProps, "aspect" | "position" | "rotation" | "scale"> & KnownComponentProps & {
10
11
  anchors?: ScreenAnchorEdges;
11
12
  coordinateSpace?: ScreenCoordinateSpace;
12
13
  canvasSize?: ScreenCanvasSize;
@@ -0,0 +1,24 @@
1
+ import { ReactNode } from 'react';
2
+ export type ThemeValue = string | number | boolean | null | undefined | ThemeValues;
3
+ export interface ThemeValues {
4
+ [key: string]: ThemeValue;
5
+ }
6
+ export type ThemeProviderProps = {
7
+ /** The settings file's theme group, e.g. `settings.theme`. */
8
+ theme: ThemeValues;
9
+ className?: string;
10
+ children?: ReactNode;
11
+ };
12
+ /**
13
+ * Only a colour, a length or a font list reaches the page; anything else (a `;`, a `url(...)`,
14
+ * a brace, a comment) is dropped so a theme value can never carry more than one declaration.
15
+ */
16
+ export declare function themeValueOk(v: string): boolean;
17
+ /** `{ brand: "#f06", font: { heading: "Inter" } }` -> `{ "--vincentt-brand": "#f06", "--vincentt-font-heading": "Inter" }`. */
18
+ export declare function themeVariables(theme: ThemeValues): Record<string, string>;
19
+ /**
20
+ * Publishes a settings theme group as `--vincentt-*` CSS variables for everything inside it
21
+ * (the wrapper adds no box of its own). The editor's Theme group is the `kind: 'theme'` object of
22
+ * the zod settings file; pass it straight in.
23
+ */
24
+ export declare function ThemeProvider({ theme, className, children }: ThemeProviderProps): import("react/jsx-runtime").JSX.Element;
@@ -27,6 +27,10 @@ export * from './SpringSwing';
27
27
  export * from './Necklace';
28
28
  export * from './HairLock';
29
29
  export * from './MeshRenderer';
30
+ export * from './Model';
31
+ export * from './Object3D';
32
+ export * from './ThemeProvider';
33
+ export * from './Button';
30
34
  export * from './LightObject';
31
35
  export * from './LookAt';
32
36
  export * from './Panel';
@@ -6,8 +6,8 @@ import { Canvas as ye, useThree as Se, useFrame as _e } from "@react-three/fiber
6
6
  import { useRef as K, useState as Re, useEffect as J, useMemo as ne, useContext as fe, createContext as ve } from "react";
7
7
  import * as U from "three";
8
8
  import { R as pe } from "./uv-DJU_XfmN.js";
9
- import { d as Ee, e as Te, u as Me, a as Ae } from "./selectors-K5JKCWxw.js";
10
- import { u as ue } from "./index-CTqQJj5p.js";
9
+ import { d as Ee, e as Te, u as Me, a as Ae } from "./selectors-J06V0eDb.js";
10
+ import { u as ue } from "./index-BDxJWWyy.js";
11
11
  import { u as ke, S as Ce } from "./context-DTxSQvp4.js";
12
12
  const xe = {
13
13
  display: "flex",
@@ -1,4 +1,4 @@
1
- import { M as a, d, f as i, s as o, a as r, b as c, u, c as S } from "../session-DHBNTyJJ.js";
1
+ import { M as a, d, f as i, s as o, a as r, b as c, u, c as S } from "../session-CYiWfcvz.js";
2
2
  export {
3
3
  a as MediaSourceSwitcher,
4
4
  d as defaultMediaSources,