@threlte/xr 1.0.0-next.4 → 1.0.0-next.6

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.
@@ -10,11 +10,9 @@ declare const __propDef: {
10
10
  }) | undefined;
11
11
  force?: "enter" | "exit" | undefined;
12
12
  styled?: boolean | undefined;
13
- children?: ((this: void, args_0: {
13
+ children?: import("svelte").Snippet<[{
14
14
  state: "blocked" | "unsupported" | "insecure" | "supported";
15
- }) => typeof import("svelte").SnippetReturn & {
16
- _: "functions passed to {@render ...} tags must use the `Snippet` type imported from \"svelte\"";
17
- }) | undefined;
15
+ }]> | undefined;
18
16
  onclick?: ((event: {
19
17
  state: "blocked" | "unsupported" | "insecure" | "supported";
20
18
  nativeEvent: MouseEvent;
@@ -1,28 +1,15 @@
1
1
  import { SvelteComponent } from "svelte";
2
2
  import type { XRControllerEvents } from '../types';
3
+ import type { Snippet } from 'svelte';
3
4
  declare const __propDef: {
4
5
  props: {
5
- children?: ((this: void) => typeof import("svelte").SnippetReturn & {
6
- _: "functions passed to {@render ...} tags must use the `Snippet` type imported from \"svelte\"";
7
- }) | undefined;
8
- grip?: ((this: void) => typeof import("svelte").SnippetReturn & {
9
- _: "functions passed to {@render ...} tags must use the `Snippet` type imported from \"svelte\"";
10
- }) | undefined;
11
- targetRay?: ((this: void) => typeof import("svelte").SnippetReturn & {
12
- _: "functions passed to {@render ...} tags must use the `Snippet` type imported from \"svelte\"";
13
- }) | undefined;
14
- pointerRay?: ((this: void) => typeof import("svelte").SnippetReturn & {
15
- _: "functions passed to {@render ...} tags must use the `Snippet` type imported from \"svelte\"";
16
- }) | undefined;
17
- pointerCursor?: ((this: void) => typeof import("svelte").SnippetReturn & {
18
- _: "functions passed to {@render ...} tags must use the `Snippet` type imported from \"svelte\"";
19
- }) | undefined;
20
- teleportRay?: ((this: void) => typeof import("svelte").SnippetReturn & {
21
- _: "functions passed to {@render ...} tags must use the `Snippet` type imported from \"svelte\"";
22
- }) | undefined;
23
- teleportCursor?: ((this: void) => typeof import("svelte").SnippetReturn & {
24
- _: "functions passed to {@render ...} tags must use the `Snippet` type imported from \"svelte\"";
25
- }) | undefined;
6
+ children?: Snippet<[]> | undefined;
7
+ grip?: Snippet<[]> | undefined;
8
+ targetRay?: Snippet<[]> | undefined;
9
+ pointerRay?: Snippet<[]> | undefined;
10
+ pointerCursor?: Snippet<[]> | undefined;
11
+ teleportRay?: Snippet<[]> | undefined;
12
+ teleportCursor?: Snippet<[]> | undefined;
26
13
  } & XRControllerEvents & ({
27
14
  /** Whether the controller should be matched with the left hand. */
28
15
  left: true;
@@ -1,16 +1,11 @@
1
1
  import { SvelteComponent } from "svelte";
2
2
  import type { XRHandEvents } from '../types';
3
+ import type { Snippet } from 'svelte';
3
4
  declare const __propDef: {
4
5
  props: {
5
- children?: ((this: void) => typeof import("svelte").SnippetReturn & {
6
- _: "functions passed to {@render ...} tags must use the `Snippet` type imported from \"svelte\"";
7
- }) | undefined;
8
- targetRay?: ((this: void) => typeof import("svelte").SnippetReturn & {
9
- _: "functions passed to {@render ...} tags must use the `Snippet` type imported from \"svelte\"";
10
- }) | undefined;
11
- wrist?: ((this: void) => typeof import("svelte").SnippetReturn & {
12
- _: "functions passed to {@render ...} tags must use the `Snippet` type imported from \"svelte\"";
13
- }) | undefined;
6
+ children?: Snippet<[]> | undefined;
7
+ targetRay?: Snippet<[]> | undefined;
8
+ wrist?: Snippet<[]> | undefined;
14
9
  } & XRHandEvents & ({
15
10
  /** Whether the XRHand should be matched with the left hand. */
16
11
  left: true;
@@ -1,9 +1,7 @@
1
1
  import { SvelteComponent } from "svelte";
2
2
  declare const __propDef: {
3
3
  props: {
4
- children?: ((this: void) => typeof import("svelte").SnippetReturn & {
5
- _: "functions passed to {@render ...} tags must use the `Snippet` type imported from \"svelte\"";
6
- }) | undefined;
4
+ children?: import("svelte").Snippet<[]> | undefined;
7
5
  };
8
6
  events: {
9
7
  [evt: string]: CustomEvent<any>;
@@ -10,11 +10,9 @@ declare const __propDef: {
10
10
  }) | undefined;
11
11
  force?: "enter" | "exit" | undefined;
12
12
  styled?: boolean | undefined;
13
- children?: ((this: void, args_0: {
13
+ children?: import("svelte").Snippet<[{
14
14
  state: "blocked" | "unsupported" | "insecure" | "supported";
15
- }) => typeof import("svelte").SnippetReturn & {
16
- _: "functions passed to {@render ...} tags must use the `Snippet` type imported from \"svelte\"";
17
- }) | undefined;
15
+ }]> | undefined;
18
16
  onclick?: ((event: {
19
17
  state: "blocked" | "unsupported" | "insecure" | "supported";
20
18
  nativeEvent: MouseEvent;
@@ -1,5 +1,6 @@
1
1
  /// <reference types="webxr" />
2
2
  import { SvelteComponent } from "svelte";
3
+ import { type Snippet } from 'svelte';
3
4
  import type { XRSessionEvent } from '../types';
4
5
  declare const __propDef: {
5
6
  props: {
@@ -22,12 +23,8 @@ declare const __propDef: {
22
23
  frameRate?: number | undefined;
23
24
  /** Type of WebXR reference space to use. Default is `local-floor` */
24
25
  referenceSpace?: XRReferenceSpaceType | undefined;
25
- fallback?: ((this: void) => typeof import("svelte").SnippetReturn & {
26
- _: "functions passed to {@render ...} tags must use the `Snippet` type imported from \"svelte\"";
27
- }) | undefined;
28
- children?: ((this: void) => typeof import("svelte").SnippetReturn & {
29
- _: "functions passed to {@render ...} tags must use the `Snippet` type imported from \"svelte\"";
30
- }) | undefined;
26
+ fallback?: Snippet<[]> | undefined;
27
+ children?: Snippet<[]> | undefined;
31
28
  /** Called as an XRSession is requested */
32
29
  onsessionstart?: ((event: XRSessionEvent<'sessionstart'>) => void) | undefined;
33
30
  /** Called after an XRSession is terminated */
@@ -20,7 +20,16 @@ display info about your WebXR session. This is aliased by `ARButton` and
20
20
  <script lang="ts">import { getXRSupportState } from "../lib/getXRSupportState";
21
21
  import { toggleXRSession } from "../lib/toggleXRSession";
22
22
  import { session, xr } from "../internal/stores";
23
- let { mode, sessionInit, force, styled = true, onclick, onerror, children, ...props } = $props();
23
+ let {
24
+ mode,
25
+ sessionInit,
26
+ force,
27
+ styled = true,
28
+ onclick,
29
+ onerror,
30
+ children,
31
+ ...props
32
+ } = $props();
24
33
  const handleButtonClick = async (nativeEvent, state) => {
25
34
  if (!$xr) {
26
35
  throw new Error(
@@ -1,6 +1,7 @@
1
1
  /// <reference types="webxr" />
2
2
  import { SvelteComponent } from "svelte";
3
3
  import type { HTMLButtonAttributes } from 'svelte/elements';
4
+ import type { Snippet } from 'svelte';
4
5
  declare const __propDef: {
5
6
  props: HTMLButtonAttributes & {
6
7
  /** The type of `XRSession` to create */
@@ -18,11 +19,9 @@ declare const __propDef: {
18
19
  force?: "enter" | "exit" | undefined;
19
20
  /** Whether to apply automatic styling to the button. Set false to apply custom styles. Default is true. */
20
21
  styled?: boolean | undefined;
21
- children?: ((this: void, args_0: {
22
+ children?: Snippet<[{
22
23
  state: "blocked" | "unsupported" | "insecure" | "supported";
23
- }) => typeof import("svelte").SnippetReturn & {
24
- _: "functions passed to {@render ...} tags must use the `Snippet` type imported from \"svelte\"";
25
- }) | undefined;
24
+ }]> | undefined;
26
25
  onclick?: ((event: {
27
26
  state: "blocked" | "unsupported" | "insecure" | "supported";
28
27
  nativeEvent: MouseEvent;
@@ -1,10 +1,9 @@
1
1
  import { SvelteComponent } from "svelte";
2
+ import type { Snippet } from 'svelte';
2
3
  declare const __propDef: {
3
4
  props: {
4
5
  handedness: 'left' | 'right';
5
- children?: ((this: void) => typeof import("svelte").SnippetReturn & {
6
- _: "functions passed to {@render ...} tags must use the `Snippet` type imported from \"svelte\"";
7
- }) | undefined;
6
+ children?: Snippet<[]> | undefined;
8
7
  };
9
8
  events: {
10
9
  [evt: string]: CustomEvent<any>;
@@ -1,9 +1,7 @@
1
1
  import { SvelteComponent } from "svelte";
2
2
  declare const __propDef: {
3
3
  props: {
4
- children?: ((this: void) => typeof import("svelte").SnippetReturn & {
5
- _: "functions passed to {@render ...} tags must use the `Snippet` type imported from \"svelte\"";
6
- }) | undefined;
4
+ children?: import("svelte").Snippet<[]> | undefined;
7
5
  };
8
6
  events: {
9
7
  [evt: string]: CustomEvent<any>;
@@ -1,10 +1,9 @@
1
1
  import { SvelteComponent } from "svelte";
2
+ import type { Snippet } from 'svelte';
2
3
  declare const __propDef: {
3
4
  props: {
4
5
  handedness: 'left' | 'right';
5
- children?: ((this: void) => typeof import("svelte").SnippetReturn & {
6
- _: "functions passed to {@render ...} tags must use the `Snippet` type imported from \"svelte\"";
7
- }) | undefined;
6
+ children?: Snippet<[]> | undefined;
8
7
  };
9
8
  events: {
10
9
  [evt: string]: CustomEvent<any>;
@@ -1,10 +1,9 @@
1
1
  import { SvelteComponent } from "svelte";
2
+ import type { Snippet } from 'svelte';
2
3
  declare const __propDef: {
3
4
  props: {
4
5
  handedness: 'left' | 'right';
5
- children?: ((this: void) => typeof import("svelte").SnippetReturn & {
6
- _: "functions passed to {@render ...} tags must use the `Snippet` type imported from \"svelte\"";
7
- }) | undefined;
6
+ children?: Snippet<[]> | undefined;
8
7
  };
9
8
  events: {
10
9
  [evt: string]: CustomEvent<any>;
@@ -1,12 +1,11 @@
1
1
  import { SvelteComponent } from "svelte";
2
2
  import { type XRTargetRaySpace } from 'three';
3
+ import type { Snippet } from 'svelte';
3
4
  declare const __propDef: {
4
5
  props: {
5
6
  handedness: 'left' | 'right';
6
7
  targetRay: XRTargetRaySpace;
7
- children?: ((this: void) => typeof import("svelte").SnippetReturn & {
8
- _: "functions passed to {@render ...} tags must use the `Snippet` type imported from \"svelte\"";
9
- }) | undefined;
8
+ children?: Snippet<[]> | undefined;
10
9
  };
11
10
  events: {
12
11
  [evt: string]: CustomEvent<any>;
package/package.json CHANGED
@@ -1,8 +1,9 @@
1
1
  {
2
2
  "name": "@threlte/xr",
3
- "version": "1.0.0-next.4",
3
+ "version": "1.0.0-next.6",
4
4
  "author": "Micheal Parks <michealparks1989@gmail.com> (https://parks.lol)",
5
5
  "license": "MIT",
6
+ "description": "Tools to more easily create VR and AR experiences with Threlte",
6
7
  "devDependencies": {
7
8
  "@sveltejs/adapter-auto": "^3.2.0",
8
9
  "@sveltejs/kit": "^2.5.5",
@@ -14,22 +15,41 @@
14
15
  "eslint-plugin-svelte": "^2.36.0",
15
16
  "svelte-check": "^3.6.9",
16
17
  "typescript": "^5.4.5",
17
- "@types/three": "^0.163.0",
18
+ "@types/three": "^0.166.0",
18
19
  "autoprefixer": "^10.4.19",
19
20
  "postcss": "^8.4.38",
20
21
  "publint": "^0.2.7",
21
- "svelte": "^5.0.0-next.107",
22
- "three": "^0.163.0",
22
+ "svelte": "^5.0.0-next.181",
23
+ "three": "^0.166.1",
23
24
  "tslib": "^2.6.2",
24
25
  "vite": "^5.2.8",
25
26
  "vite-plugin-mkcert": "^1.17.5",
26
- "@threlte/core": "8.0.0-next.6"
27
+ "@threlte/core": "8.0.0-next.12"
27
28
  },
28
29
  "peerDependencies": {
29
30
  "svelte": ">=5",
30
31
  "three": ">=0.155"
31
32
  },
32
33
  "type": "module",
34
+ "keywords": [
35
+ "webxr",
36
+ "vr",
37
+ "ar",
38
+ "threlte",
39
+ "svelte",
40
+ "three",
41
+ "three.js",
42
+ "3d"
43
+ ],
44
+ "homepage": "https://threlte.xyz",
45
+ "repository": {
46
+ "type": "git",
47
+ "url": "https://github.com/threlte/threlte.git",
48
+ "directory": "packages/xr"
49
+ },
50
+ "bugs": {
51
+ "url": "https://github.com/threlte/threlte/issues"
52
+ },
33
53
  "exports": {
34
54
  ".": {
35
55
  "types": "./dist/index.d.ts",
@@ -48,8 +68,8 @@
48
68
  "package": "svelte-kit sync && svelte-package && node ./scripts/cleanupPackage.js && publint",
49
69
  "check": "svelte-check --tsconfig ./tsconfig.json",
50
70
  "check:watch": "svelte-check --tsconfig ./tsconfig.json --watch",
51
- "lint": "prettier --check --plugin-search-dir=. . && eslint .",
52
- "format": "prettier --write --plugin-search-dir=. .",
71
+ "lint": "prettier --check .",
72
+ "format": "prettier --write .",
53
73
  "cleanup": "rimraf node_modules .svelte-kit dist"
54
74
  }
55
75
  }