@rendiv/three 0.1.2 → 0.1.4

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.
@@ -1 +1 @@
1
- {"version":3,"file":"ThreeCanvas.d.ts","sourceRoot":"","sources":["../src/ThreeCanvas.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAKZ,KAAK,aAAa,EACnB,MAAM,OAAO,CAAC;AACf,OAAO,EAAE,MAAM,EAAE,MAAM,oBAAoB,CAAC;AAW5C,MAAM,WAAW,gBAAgB;IAC/B,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC;IAC1B,KAAK,CAAC,EAAE,aAAa,CAAC;IACtB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,gCAAgC;IAChC,MAAM,CAAC,EAAE,KAAK,CAAC,cAAc,CAAC,OAAO,MAAM,CAAC,CAAC,QAAQ,CAAC,CAAC;IACvD,mCAAmC;IACnC,EAAE,CAAC,EAAE,KAAK,CAAC,cAAc,CAAC,OAAO,MAAM,CAAC,CAAC,IAAI,CAAC,CAAC;CAChD;AAMD;;;;;;GAMG;AACH,wBAAgB,WAAW,CAAC,EAC1B,QAAQ,EACR,KAAK,EACL,SAAS,EACT,MAAM,EACN,EAAE,GACH,EAAE,gBAAgB,GAAG,KAAK,CAAC,YAAY,CAmGvC"}
1
+ {"version":3,"file":"ThreeCanvas.d.ts","sourceRoot":"","sources":["../src/ThreeCanvas.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAKZ,KAAK,aAAa,EACnB,MAAM,OAAO,CAAC;AACf,OAAO,EAAE,MAAM,EAAE,MAAM,oBAAoB,CAAC;AAW5C,MAAM,WAAW,gBAAgB;IAC/B,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC;IAC1B,KAAK,CAAC,EAAE,aAAa,CAAC;IACtB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,gCAAgC;IAChC,MAAM,CAAC,EAAE,KAAK,CAAC,cAAc,CAAC,OAAO,MAAM,CAAC,CAAC,QAAQ,CAAC,CAAC;IACvD,mCAAmC;IACnC,EAAE,CAAC,EAAE,KAAK,CAAC,cAAc,CAAC,OAAO,MAAM,CAAC,CAAC,IAAI,CAAC,CAAC;CAChD;AAMD;;;;;;GAMG;AACH,wBAAgB,WAAW,CAAC,EAC1B,QAAQ,EACR,KAAK,EACL,SAAS,EACT,MAAM,EACN,EAAE,GACH,EAAE,gBAAgB,GAAG,KAAK,CAAC,YAAY,CAoGvC"}
package/dist/index.cjs CHANGED
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const l=require("react/jsx-runtime"),n=require("react"),w=require("@react-three/fiber"),e=require("@rendiv/core");function R({timeline:s,sequence:a,composition:d,environment:f,children:c}){return l.jsx(e.RendivEnvironmentContext.Provider,{value:f,children:l.jsx(e.CompositionContext.Provider,{value:d,children:l.jsx(e.TimelineContext.Provider,{value:s,children:l.jsx(e.SequenceContext.Provider,{value:a,children:c})})})})}function P({children:s,style:a,className:d,camera:f,gl:c}){const C=n.useContext(e.TimelineContext),m=n.useContext(e.SequenceContext),r=n.useContext(e.CompositionContext),x=n.useContext(e.RendivEnvironmentContext),o=x.environment==="rendering",t=n.useRef(null),v=n.useRef(null);n.useEffect(()=>{const i=e.holdRender("Initializing <ThreeCanvas>",{timeoutInMilliseconds:3e4});return t.current=i,()=>{t.current!==null&&(e.releaseRender(t.current),t.current=null)}},[]);const g=n.useCallback(i=>{v.current=i,o&&i.advance(performance.now()),t.current!==null&&(e.releaseRender(t.current),t.current=null)},[o]),u=n.useRef(null);n.useEffect(()=>{if(!o||!v.current)return;const i=e.holdRender("ThreeCanvas: advancing frame");return u.current=i,requestAnimationFrame(()=>{var h;(h=v.current)==null||h.advance(performance.now()),u.current!==null&&(e.releaseRender(u.current),u.current=null)}),()=>{u.current!==null&&(e.releaseRender(u.current),u.current=null)}},[C.frame,o]);const j=(r==null?void 0:r.width)??1920,q=(r==null?void 0:r.height)??1080,T=o?{preserveDrawingBuffer:!0,...c}:c;return l.jsx(w.Canvas,{frameloop:o?"never":"always",camera:f,gl:T,onCreated:g,style:{width:j,height:q,...a},className:d,children:l.jsx(R,{timeline:C,sequence:m,composition:r,environment:x,children:s})})}exports.RendivContextBridge=R;exports.ThreeCanvas=P;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const l=require("react/jsx-runtime"),n=require("react"),w=require("@react-three/fiber"),e=require("@rendiv/core");function R({timeline:s,sequence:a,composition:d,environment:f,children:c}){return l.jsx(e.RendivEnvironmentContext.Provider,{value:f,children:l.jsx(e.CompositionContext.Provider,{value:d,children:l.jsx(e.TimelineContext.Provider,{value:s,children:l.jsx(e.SequenceContext.Provider,{value:a,children:c})})})})}function S({children:s,style:a,className:d,camera:f,gl:c}){const C=n.useContext(e.TimelineContext),m=n.useContext(e.SequenceContext),r=n.useContext(e.CompositionContext),x=n.useContext(e.RendivEnvironmentContext),i=x.environment==="rendering",t=n.useRef(null),v=n.useRef(null);n.useEffect(()=>{const o=e.holdRender("Initializing <ThreeCanvas>",{timeoutInMilliseconds:3e4});return t.current=o,()=>{t.current!==null&&(e.releaseRender(t.current),t.current=null)}},[]);const g=n.useCallback(o=>{v.current=o,i&&o.advance(performance.now()),t.current!==null&&(e.releaseRender(t.current),t.current=null)},[i]),u=n.useRef(null);n.useEffect(()=>{if(!i||!v.current)return;const o=e.holdRender("ThreeCanvas: advancing frame");return u.current=o,requestAnimationFrame(()=>{var h;(h=v.current)==null||h.advance(performance.now()),u.current!==null&&(e.releaseRender(u.current),u.current=null)}),()=>{u.current!==null&&(e.releaseRender(u.current),u.current=null)}},[C.frame,i]);const j=(r==null?void 0:r.width)??1920,q=(r==null?void 0:r.height)??1080,T=i?{preserveDrawingBuffer:!0,...c}:c;return l.jsx(w.Canvas,{frameloop:i?"never":"always",camera:f,gl:T,resize:{offsetSize:!0},onCreated:g,style:{width:j,height:q,...a},className:d,children:l.jsx(R,{timeline:C,sequence:m,composition:r,environment:x,children:s})})}exports.RendivContextBridge=R;exports.ThreeCanvas=S;
package/dist/index.js CHANGED
@@ -1,60 +1,61 @@
1
- import { jsx as u } from "react/jsx-runtime";
2
- import { useContext as i, useRef as m, useEffect as R, useCallback as I } from "react";
3
- import { Canvas as S } from "@react-three/fiber";
1
+ import { jsx as l } from "react/jsx-runtime";
2
+ import { useContext as o, useRef as m, useEffect as R, useCallback as E } from "react";
3
+ import { Canvas as H } from "@react-three/fiber";
4
4
  import { RendivEnvironmentContext as p, CompositionContext as w, TimelineContext as P, SequenceContext as T, holdRender as x, releaseRender as c } from "@rendiv/core";
5
- function b({
5
+ function I({
6
6
  timeline: a,
7
- sequence: d,
8
- composition: s,
7
+ sequence: s,
8
+ composition: d,
9
9
  environment: f,
10
- children: o
10
+ children: i
11
11
  }) {
12
- return /* @__PURE__ */ u(p.Provider, { value: f, children: /* @__PURE__ */ u(w.Provider, { value: s, children: /* @__PURE__ */ u(P.Provider, { value: a, children: /* @__PURE__ */ u(T.Provider, { value: d, children: o }) }) }) });
12
+ return /* @__PURE__ */ l(p.Provider, { value: f, children: /* @__PURE__ */ l(w.Provider, { value: d, children: /* @__PURE__ */ l(P.Provider, { value: a, children: /* @__PURE__ */ l(T.Provider, { value: s, children: i }) }) }) });
13
13
  }
14
14
  function D({
15
15
  children: a,
16
- style: d,
17
- className: s,
16
+ style: s,
17
+ className: d,
18
18
  camera: f,
19
- gl: o
19
+ gl: i
20
20
  }) {
21
- const h = i(P), q = i(T), e = i(w), C = i(p), t = C.environment === "rendering", n = m(null), v = m(null);
21
+ const h = o(P), q = o(T), e = o(w), C = o(p), t = C.environment === "rendering", n = m(null), v = m(null);
22
22
  R(() => {
23
- const l = x("Initializing <ThreeCanvas>", {
23
+ const u = x("Initializing <ThreeCanvas>", {
24
24
  timeoutInMilliseconds: 3e4
25
25
  });
26
- return n.current = l, () => {
26
+ return n.current = u, () => {
27
27
  n.current !== null && (c(n.current), n.current = null);
28
28
  };
29
29
  }, []);
30
- const y = I(
31
- (l) => {
32
- v.current = l, t && l.advance(performance.now()), n.current !== null && (c(n.current), n.current = null);
30
+ const z = E(
31
+ (u) => {
32
+ v.current = u, t && u.advance(performance.now()), n.current !== null && (c(n.current), n.current = null);
33
33
  },
34
34
  [t]
35
35
  ), r = m(null);
36
36
  R(() => {
37
37
  if (!t || !v.current) return;
38
- const l = x("ThreeCanvas: advancing frame");
39
- return r.current = l, requestAnimationFrame(() => {
38
+ const u = x("ThreeCanvas: advancing frame");
39
+ return r.current = u, requestAnimationFrame(() => {
40
40
  var g;
41
41
  (g = v.current) == null || g.advance(performance.now()), r.current !== null && (c(r.current), r.current = null);
42
42
  }), () => {
43
43
  r.current !== null && (c(r.current), r.current = null);
44
44
  };
45
45
  }, [h.frame, t]);
46
- const B = (e == null ? void 0 : e.width) ?? 1920, E = (e == null ? void 0 : e.height) ?? 1080, H = t ? { preserveDrawingBuffer: !0, ...o } : o;
47
- return /* @__PURE__ */ u(
48
- S,
46
+ const S = (e == null ? void 0 : e.width) ?? 1920, y = (e == null ? void 0 : e.height) ?? 1080, B = t ? { preserveDrawingBuffer: !0, ...i } : i;
47
+ return /* @__PURE__ */ l(
48
+ H,
49
49
  {
50
50
  frameloop: t ? "never" : "always",
51
51
  camera: f,
52
- gl: H,
53
- onCreated: y,
54
- style: { width: B, height: E, ...d },
55
- className: s,
56
- children: /* @__PURE__ */ u(
57
- b,
52
+ gl: B,
53
+ resize: { offsetSize: !0 },
54
+ onCreated: z,
55
+ style: { width: S, height: y, ...s },
56
+ className: d,
57
+ children: /* @__PURE__ */ l(
58
+ I,
58
59
  {
59
60
  timeline: h,
60
61
  sequence: q,
@@ -67,6 +68,6 @@ function D({
67
68
  );
68
69
  }
69
70
  export {
70
- b as RendivContextBridge,
71
+ I as RendivContextBridge,
71
72
  D as ThreeCanvas
72
73
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rendiv/three",
3
- "version": "0.1.2",
3
+ "version": "0.1.4",
4
4
  "license": "Apache-2.0",
5
5
  "type": "module",
6
6
  "main": "./dist/index.cjs",
@@ -21,7 +21,7 @@
21
21
  "react-dom": "^18.0.0 || ^19.0.0",
22
22
  "three": ">=0.150.0",
23
23
  "@react-three/fiber": ">=9.0.0",
24
- "@rendiv/core": "0.1.2"
24
+ "@rendiv/core": "0.1.4"
25
25
  },
26
26
  "devDependencies": {
27
27
  "@types/react": "^19.0.0",
@@ -35,7 +35,7 @@
35
35
  "vite-plugin-dts": "^4.3.0",
36
36
  "typescript": "^5.7.0",
37
37
  "@rendiv/tsconfig": "0.0.0",
38
- "@rendiv/core": "0.1.2"
38
+ "@rendiv/core": "0.1.4"
39
39
  },
40
40
  "scripts": {
41
41
  "build": "vite build",