sanity-plugin-studio-scene 0.1.0 → 0.1.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -54,7 +54,7 @@ defineField({
54
54
  | `styles.controls` | Which style controls "Customise" shows. Default: all (`STYLE_CONTROLS`). |
55
55
  | `styles.presets` | One-click looks. Default: Dark card, Light card, Outline, Text only. |
56
56
  | `placementTitle` | What editors see the placement called. Default "Scroll scene". |
57
- | `runtimeUrl` | URL of `scroll-scene.js` for the preview. Default: the copy bundled with the plugin. |
57
+ | `runtimeUrl` | URL of `scroll-scene.js` for the preview. Default: the `@createthebox/scroll-scene` package, which installs with the plugin. |
58
58
 
59
59
  ## On your site
60
60
 
@@ -66,7 +66,9 @@ import { studioScenePlacementProjection } from 'sanity-plugin-studio-scene/groq'
66
66
  import { styleVars, motionVars, MOTION_CSS } from 'sanity-plugin-studio-scene/style'
67
67
  ```
68
68
 
69
- `sanity-plugin-studio-scene/groq` and `/style` don't import Sanity or React, so a frontend can use them.
69
+ `sanity-plugin-studio-scene/groq` and `/style` don't import Sanity or React, so a frontend can use them. Sanity,
70
+ React and `@sanity/ui` are optional peer dependencies: a Studio has them already, and a site that only uses
71
+ `/groq` and `/style` doesn't need them.
70
72
  `styleVars` and `motionVars` turn a slot's style and motion into the CSS variables the content reads, and
71
73
  `MOTION_CSS` is the stylesheet that animates shot content in step with the camera.
72
74
 
@@ -6,8 +6,8 @@ let runtime = null;
6
6
  function loadRuntime(url) {
7
7
  if (customElements.get("scroll-scene"))
8
8
  return Promise.resolve();
9
- // The bundled copy is code-split, so the Studio only downloads it when a preview opens.
10
- runtime ??= url ? import(/* @vite-ignore */ url) : import("./runtime/scroll-scene.js");
9
+ // The player (@createthebox/scroll-scene) is code-split, so the Studio only downloads it when a preview opens.
10
+ runtime ??= url ? import(/* @vite-ignore */ url) : import("@createthebox/scroll-scene");
11
11
  return runtime;
12
12
  }
13
13
  const FRAME_W = 1280, FRAME_H = 720;
package/dist/options.d.ts CHANGED
@@ -29,7 +29,7 @@ export interface StudioSceneOptions {
29
29
  /** One-click looks. Default: Dark card, Light card, Outline, Text only. */
30
30
  presets?: StylePreset[];
31
31
  };
32
- /** URL of scroll-scene.js for the Studio preview. Default: the copy bundled with the plugin. */
32
+ /** URL of scroll-scene.js for the Studio preview. Default: the @createthebox/scroll-scene package. */
33
33
  runtimeUrl?: string;
34
34
  /** What editors see the placed scene called (in "Add item" menus and previews). Default: "Scroll scene". */
35
35
  placementTitle?: string;
package/package.json CHANGED
@@ -1,29 +1,69 @@
1
1
  {
2
2
  "name": "sanity-plugin-studio-scene",
3
- "version": "0.1.0",
3
+ "version": "0.1.1",
4
4
  "description": "Place Create the Box STUDIO scroll scenes on Sanity pages: a scene library from export zips, shot-by-shot content and a live preview.",
5
5
  "license": "MIT",
6
6
  "type": "module",
7
7
  "exports": {
8
- ".": { "types": "./dist/index.d.ts", "default": "./dist/index.js" },
9
- "./style": { "types": "./dist/styleTokens.d.ts", "default": "./dist/styleTokens.js" },
10
- "./groq": { "types": "./dist/groq.d.ts", "default": "./dist/groq.js" },
8
+ ".": {
9
+ "types": "./dist/index.d.ts",
10
+ "default": "./dist/index.js"
11
+ },
12
+ "./style": {
13
+ "types": "./dist/styleTokens.d.ts",
14
+ "default": "./dist/styleTokens.js"
15
+ },
16
+ "./groq": {
17
+ "types": "./dist/groq.d.ts",
18
+ "default": "./dist/groq.js"
19
+ },
11
20
  "./package.json": "./package.json"
12
21
  },
13
22
  "types": "./dist/index.d.ts",
14
- "files": ["dist", "README.md", "LICENSE"],
23
+ "files": [
24
+ "dist",
25
+ "README.md",
26
+ "LICENSE"
27
+ ],
15
28
  "sideEffects": false,
16
29
  "scripts": {
17
- "build": "rm -rf dist && tsc -p tsconfig.build.json && mkdir -p dist/runtime && cp src/runtime/scroll-scene.js dist/runtime/",
30
+ "build": "rm -rf dist && tsc -p tsconfig.build.json",
18
31
  "prepack": "npm run build"
19
32
  },
33
+ "dependencies": {
34
+ "@createthebox/scroll-scene": "^0.1.0"
35
+ },
20
36
  "peerDependencies": {
21
37
  "@sanity/ui": "^3 || ^4",
22
38
  "react": "^19",
23
39
  "sanity": "^5"
24
40
  },
25
- "keywords": ["sanity", "sanity-plugin", "three", "scroll", "3d", "create-the-box"],
41
+ "peerDependenciesMeta": {
42
+ "@sanity/ui": {
43
+ "optional": true
44
+ },
45
+ "react": {
46
+ "optional": true
47
+ },
48
+ "sanity": {
49
+ "optional": true
50
+ }
51
+ },
52
+ "keywords": [
53
+ "sanity",
54
+ "sanity-plugin",
55
+ "three",
56
+ "scroll",
57
+ "3d",
58
+ "create-the-box"
59
+ ],
26
60
  "homepage": "https://studio.createthebox.com",
27
- "repository": { "type": "git", "url": "git+https://github.com/theboxcreates/studio.git", "directory": "packages/sanity-plugin-studio-scene" },
28
- "publishConfig": { "access": "public" }
61
+ "repository": {
62
+ "type": "git",
63
+ "url": "git+https://github.com/theboxcreates/studio.git",
64
+ "directory": "packages/sanity-plugin-studio-scene"
65
+ },
66
+ "publishConfig": {
67
+ "access": "public"
68
+ }
29
69
  }