@prtcl/plonk-hooks 1.0.1-beta.0 → 1.0.1-beta.3
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/dist/index.cjs +115 -0
- package/dist/index.cjs.map +1 -0
- package/dist/index.d.cts +22 -0
- package/dist/index.d.ts +22 -0
- package/dist/index.js +89 -0
- package/dist/index.js.map +1 -0
- package/package.json +2 -2
- package/tsup.config.ts +0 -10
package/dist/index.cjs
ADDED
|
@@ -0,0 +1,115 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
"use client";
|
|
3
|
+
var __defProp = Object.defineProperty;
|
|
4
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
5
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
6
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
7
|
+
var __export = (target, all) => {
|
|
8
|
+
for (var name in all)
|
|
9
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
10
|
+
};
|
|
11
|
+
var __copyProps = (to, from, except, desc) => {
|
|
12
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
13
|
+
for (let key of __getOwnPropNames(from))
|
|
14
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
15
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
16
|
+
}
|
|
17
|
+
return to;
|
|
18
|
+
};
|
|
19
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
20
|
+
|
|
21
|
+
// src/index.ts
|
|
22
|
+
var src_exports = {};
|
|
23
|
+
__export(src_exports, {
|
|
24
|
+
useFrames: () => useFrames,
|
|
25
|
+
useMetro: () => useMetro,
|
|
26
|
+
usePrevious: () => usePrevious
|
|
27
|
+
});
|
|
28
|
+
module.exports = __toCommonJS(src_exports);
|
|
29
|
+
var import_client_only = require("client-only");
|
|
30
|
+
|
|
31
|
+
// src/hooks/useFrames.ts
|
|
32
|
+
var import_react2 = require("react");
|
|
33
|
+
var import_plonk = require("@prtcl/plonk");
|
|
34
|
+
|
|
35
|
+
// src/hooks/usePrevious.ts
|
|
36
|
+
var import_react = require("react");
|
|
37
|
+
var usePrevious = (value) => {
|
|
38
|
+
const ref = (0, import_react.useRef)({
|
|
39
|
+
value,
|
|
40
|
+
prev: void 0
|
|
41
|
+
});
|
|
42
|
+
const current = ref.current.value;
|
|
43
|
+
if (value !== current) {
|
|
44
|
+
ref.current = {
|
|
45
|
+
value,
|
|
46
|
+
prev: current
|
|
47
|
+
};
|
|
48
|
+
}
|
|
49
|
+
return ref.current.prev;
|
|
50
|
+
};
|
|
51
|
+
|
|
52
|
+
// src/hooks/useFrames.ts
|
|
53
|
+
var useFrames = (callback, opts) => {
|
|
54
|
+
const { autostart = true } = opts || {};
|
|
55
|
+
const callbackRef = (0, import_react2.useRef)(callback);
|
|
56
|
+
const optsRef = (0, import_react2.useRef)(opts);
|
|
57
|
+
const prevOpts = usePrevious(opts);
|
|
58
|
+
callbackRef.current = callback;
|
|
59
|
+
const frames = (0, import_react2.useMemo)(() => {
|
|
60
|
+
return new import_plonk.Frames((m) => {
|
|
61
|
+
callbackRef.current(m);
|
|
62
|
+
}, optsRef.current);
|
|
63
|
+
}, []);
|
|
64
|
+
(0, import_react2.useEffect)(() => {
|
|
65
|
+
if (opts && prevOpts && opts.fps !== prevOpts.fps) {
|
|
66
|
+
frames.setFPS(opts.fps);
|
|
67
|
+
}
|
|
68
|
+
}, [opts, prevOpts, frames]);
|
|
69
|
+
(0, import_react2.useEffect)(() => {
|
|
70
|
+
if (autostart) {
|
|
71
|
+
frames.run();
|
|
72
|
+
}
|
|
73
|
+
return () => {
|
|
74
|
+
frames.stop();
|
|
75
|
+
};
|
|
76
|
+
}, [frames]);
|
|
77
|
+
return frames;
|
|
78
|
+
};
|
|
79
|
+
|
|
80
|
+
// src/hooks/useMetro.ts
|
|
81
|
+
var import_react3 = require("react");
|
|
82
|
+
var import_plonk2 = require("@prtcl/plonk");
|
|
83
|
+
var useMetro = (callback, opts) => {
|
|
84
|
+
const { autostart = true } = opts || {};
|
|
85
|
+
const callbackRef = (0, import_react3.useRef)(callback);
|
|
86
|
+
const optsRef = (0, import_react3.useRef)(opts);
|
|
87
|
+
const prevOpts = usePrevious(opts);
|
|
88
|
+
callbackRef.current = callback;
|
|
89
|
+
const metro = (0, import_react3.useMemo)(() => {
|
|
90
|
+
return new import_plonk2.Metro((m) => {
|
|
91
|
+
callbackRef.current(m);
|
|
92
|
+
}, optsRef.current);
|
|
93
|
+
}, []);
|
|
94
|
+
(0, import_react3.useEffect)(() => {
|
|
95
|
+
if (opts && prevOpts && opts.time !== prevOpts.time) {
|
|
96
|
+
metro.setTime(opts.time);
|
|
97
|
+
}
|
|
98
|
+
}, [opts, prevOpts, metro]);
|
|
99
|
+
(0, import_react3.useEffect)(() => {
|
|
100
|
+
if (autostart) {
|
|
101
|
+
metro.run();
|
|
102
|
+
}
|
|
103
|
+
return () => {
|
|
104
|
+
metro.stop();
|
|
105
|
+
};
|
|
106
|
+
}, [metro]);
|
|
107
|
+
return metro;
|
|
108
|
+
};
|
|
109
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
110
|
+
0 && (module.exports = {
|
|
111
|
+
useFrames,
|
|
112
|
+
useMetro,
|
|
113
|
+
usePrevious
|
|
114
|
+
});
|
|
115
|
+
//# sourceMappingURL=index.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/index.ts","../src/hooks/useFrames.ts","../src/hooks/usePrevious.ts","../src/hooks/useMetro.ts"],"sourcesContent":["'use client';\n\nimport 'client-only';\n\nexport { useFrames, type UseFramesOptions } from './hooks/useFrames';\nexport { useMetro, type UseMetroOptions } from './hooks/useMetro';\nexport { usePrevious } from './hooks/usePrevious';\n","import { useEffect, useMemo, useRef } from 'react';\nimport { Frames, type FramesOptions, type TimerCallback } from '@prtcl/plonk';\nimport { usePrevious } from './usePrevious';\n\nexport type UseFramesOptions = FramesOptions & {\n autostart?: boolean;\n};\n\n/**\n * Hook wrapper for Frames which provides an animation loop with variable frame rate\n */\nexport const useFrames = (\n callback: TimerCallback<Frames>,\n opts?: UseFramesOptions,\n) => {\n const { autostart = true } = opts || {};\n const callbackRef = useRef<TimerCallback<Frames>>(callback);\n const optsRef = useRef<UseFramesOptions | undefined>(opts);\n const prevOpts = usePrevious(opts);\n\n callbackRef.current = callback;\n\n const frames = useMemo<Frames>(() => {\n return new Frames((m) => {\n callbackRef.current(m);\n }, optsRef.current);\n }, []);\n\n useEffect(() => {\n if (opts && prevOpts && opts.fps !== prevOpts.fps) {\n frames.setFPS(opts.fps);\n }\n }, [opts, prevOpts, frames]);\n\n useEffect(() => {\n if (autostart) {\n frames.run();\n }\n\n return () => {\n frames.stop();\n };\n }, [frames]);\n\n return frames;\n};\n","import { useRef } from 'react';\n\ntype ValueCache<Value> = {\n value: Value;\n prev: Value | undefined;\n};\n\n/** Returns the previous value without causing additional updates. */\nexport const usePrevious = <Value>(value: Value): Value | undefined => {\n const ref = useRef<ValueCache<Value>>({\n value,\n prev: undefined,\n });\n\n const current = ref.current.value;\n\n if (value !== current) {\n ref.current = {\n value,\n prev: current,\n };\n }\n\n return ref.current.prev;\n};\n","import { useEffect, useMemo, useRef } from 'react';\nimport { Metro, type MetroOptions, type TimerCallback } from '@prtcl/plonk';\nimport { usePrevious } from './usePrevious';\n\nexport type UseMetroOptions = MetroOptions & {\n autostart?: boolean;\n};\n\n/**\n * Hook wrapper for Metro which provides a timer loop with variable interval.\n */\nexport const useMetro = (\n callback: TimerCallback<Metro>,\n opts?: UseMetroOptions,\n) => {\n const { autostart = true } = opts || {};\n const callbackRef = useRef<TimerCallback<Metro>>(callback);\n const optsRef = useRef<UseMetroOptions | undefined>(opts);\n const prevOpts = usePrevious(opts);\n\n callbackRef.current = callback;\n\n const metro = useMemo<Metro>(() => {\n return new Metro((m) => {\n callbackRef.current(m);\n }, optsRef.current);\n }, []);\n\n useEffect(() => {\n if (opts && prevOpts && opts.time !== prevOpts.time) {\n metro.setTime(opts.time);\n }\n }, [opts, prevOpts, metro]);\n\n useEffect(() => {\n if (autostart) {\n metro.run();\n }\n\n return () => {\n metro.stop();\n };\n }, [metro]);\n\n return metro;\n};\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAEA,yBAAO;;;ACFP,IAAAA,gBAA2C;AAC3C,mBAA+D;;;ACD/D,mBAAuB;AAQhB,IAAM,cAAc,CAAQ,UAAoC;AACrE,QAAM,UAAM,qBAA0B;AAAA,IACpC;AAAA,IACA,MAAM;AAAA,EACR,CAAC;AAED,QAAM,UAAU,IAAI,QAAQ;AAE5B,MAAI,UAAU,SAAS;AACrB,QAAI,UAAU;AAAA,MACZ;AAAA,MACA,MAAM;AAAA,IACR;AAAA,EACF;AAEA,SAAO,IAAI,QAAQ;AACrB;;;ADbO,IAAM,YAAY,CACvB,UACA,SACG;AACH,QAAM,EAAE,YAAY,KAAK,IAAI,QAAQ,CAAC;AACtC,QAAM,kBAAc,sBAA8B,QAAQ;AAC1D,QAAM,cAAU,sBAAqC,IAAI;AACzD,QAAM,WAAW,YAAY,IAAI;AAEjC,cAAY,UAAU;AAEtB,QAAM,aAAS,uBAAgB,MAAM;AACnC,WAAO,IAAI,oBAAO,CAAC,MAAM;AACvB,kBAAY,QAAQ,CAAC;AAAA,IACvB,GAAG,QAAQ,OAAO;AAAA,EACpB,GAAG,CAAC,CAAC;AAEL,+BAAU,MAAM;AACd,QAAI,QAAQ,YAAY,KAAK,QAAQ,SAAS,KAAK;AACjD,aAAO,OAAO,KAAK,GAAG;AAAA,IACxB;AAAA,EACF,GAAG,CAAC,MAAM,UAAU,MAAM,CAAC;AAE3B,+BAAU,MAAM;AACd,QAAI,WAAW;AACb,aAAO,IAAI;AAAA,IACb;AAEA,WAAO,MAAM;AACX,aAAO,KAAK;AAAA,IACd;AAAA,EACF,GAAG,CAAC,MAAM,CAAC;AAEX,SAAO;AACT;;;AE7CA,IAAAC,gBAA2C;AAC3C,IAAAC,gBAA6D;AAUtD,IAAM,WAAW,CACtB,UACA,SACG;AACH,QAAM,EAAE,YAAY,KAAK,IAAI,QAAQ,CAAC;AACtC,QAAM,kBAAc,sBAA6B,QAAQ;AACzD,QAAM,cAAU,sBAAoC,IAAI;AACxD,QAAM,WAAW,YAAY,IAAI;AAEjC,cAAY,UAAU;AAEtB,QAAM,YAAQ,uBAAe,MAAM;AACjC,WAAO,IAAI,oBAAM,CAAC,MAAM;AACtB,kBAAY,QAAQ,CAAC;AAAA,IACvB,GAAG,QAAQ,OAAO;AAAA,EACpB,GAAG,CAAC,CAAC;AAEL,+BAAU,MAAM;AACd,QAAI,QAAQ,YAAY,KAAK,SAAS,SAAS,MAAM;AACnD,YAAM,QAAQ,KAAK,IAAI;AAAA,IACzB;AAAA,EACF,GAAG,CAAC,MAAM,UAAU,KAAK,CAAC;AAE1B,+BAAU,MAAM;AACd,QAAI,WAAW;AACb,YAAM,IAAI;AAAA,IACZ;AAEA,WAAO,MAAM;AACX,YAAM,KAAK;AAAA,IACb;AAAA,EACF,GAAG,CAAC,KAAK,CAAC;AAEV,SAAO;AACT;","names":["import_react","import_react","import_plonk"]}
|
package/dist/index.d.cts
ADDED
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { FramesOptions, TimerCallback, Frames, MetroOptions, Metro } from '@prtcl/plonk';
|
|
2
|
+
|
|
3
|
+
type UseFramesOptions = FramesOptions & {
|
|
4
|
+
autostart?: boolean;
|
|
5
|
+
};
|
|
6
|
+
/**
|
|
7
|
+
* Hook wrapper for Frames which provides an animation loop with variable frame rate
|
|
8
|
+
*/
|
|
9
|
+
declare const useFrames: (callback: TimerCallback<Frames>, opts?: UseFramesOptions) => Frames;
|
|
10
|
+
|
|
11
|
+
type UseMetroOptions = MetroOptions & {
|
|
12
|
+
autostart?: boolean;
|
|
13
|
+
};
|
|
14
|
+
/**
|
|
15
|
+
* Hook wrapper for Metro which provides a timer loop with variable interval.
|
|
16
|
+
*/
|
|
17
|
+
declare const useMetro: (callback: TimerCallback<Metro>, opts?: UseMetroOptions) => Metro;
|
|
18
|
+
|
|
19
|
+
/** Returns the previous value without causing additional updates. */
|
|
20
|
+
declare const usePrevious: <Value>(value: Value) => Value | undefined;
|
|
21
|
+
|
|
22
|
+
export { type UseFramesOptions, type UseMetroOptions, useFrames, useMetro, usePrevious };
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { FramesOptions, TimerCallback, Frames, MetroOptions, Metro } from '@prtcl/plonk';
|
|
2
|
+
|
|
3
|
+
type UseFramesOptions = FramesOptions & {
|
|
4
|
+
autostart?: boolean;
|
|
5
|
+
};
|
|
6
|
+
/**
|
|
7
|
+
* Hook wrapper for Frames which provides an animation loop with variable frame rate
|
|
8
|
+
*/
|
|
9
|
+
declare const useFrames: (callback: TimerCallback<Frames>, opts?: UseFramesOptions) => Frames;
|
|
10
|
+
|
|
11
|
+
type UseMetroOptions = MetroOptions & {
|
|
12
|
+
autostart?: boolean;
|
|
13
|
+
};
|
|
14
|
+
/**
|
|
15
|
+
* Hook wrapper for Metro which provides a timer loop with variable interval.
|
|
16
|
+
*/
|
|
17
|
+
declare const useMetro: (callback: TimerCallback<Metro>, opts?: UseMetroOptions) => Metro;
|
|
18
|
+
|
|
19
|
+
/** Returns the previous value without causing additional updates. */
|
|
20
|
+
declare const usePrevious: <Value>(value: Value) => Value | undefined;
|
|
21
|
+
|
|
22
|
+
export { type UseFramesOptions, type UseMetroOptions, useFrames, useMetro, usePrevious };
|
package/dist/index.js
ADDED
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
|
|
3
|
+
// src/index.ts
|
|
4
|
+
import "client-only";
|
|
5
|
+
|
|
6
|
+
// src/hooks/useFrames.ts
|
|
7
|
+
import { useEffect, useMemo, useRef as useRef2 } from "react";
|
|
8
|
+
import { Frames } from "@prtcl/plonk";
|
|
9
|
+
|
|
10
|
+
// src/hooks/usePrevious.ts
|
|
11
|
+
import { useRef } from "react";
|
|
12
|
+
var usePrevious = (value) => {
|
|
13
|
+
const ref = useRef({
|
|
14
|
+
value,
|
|
15
|
+
prev: void 0
|
|
16
|
+
});
|
|
17
|
+
const current = ref.current.value;
|
|
18
|
+
if (value !== current) {
|
|
19
|
+
ref.current = {
|
|
20
|
+
value,
|
|
21
|
+
prev: current
|
|
22
|
+
};
|
|
23
|
+
}
|
|
24
|
+
return ref.current.prev;
|
|
25
|
+
};
|
|
26
|
+
|
|
27
|
+
// src/hooks/useFrames.ts
|
|
28
|
+
var useFrames = (callback, opts) => {
|
|
29
|
+
const { autostart = true } = opts || {};
|
|
30
|
+
const callbackRef = useRef2(callback);
|
|
31
|
+
const optsRef = useRef2(opts);
|
|
32
|
+
const prevOpts = usePrevious(opts);
|
|
33
|
+
callbackRef.current = callback;
|
|
34
|
+
const frames = useMemo(() => {
|
|
35
|
+
return new Frames((m) => {
|
|
36
|
+
callbackRef.current(m);
|
|
37
|
+
}, optsRef.current);
|
|
38
|
+
}, []);
|
|
39
|
+
useEffect(() => {
|
|
40
|
+
if (opts && prevOpts && opts.fps !== prevOpts.fps) {
|
|
41
|
+
frames.setFPS(opts.fps);
|
|
42
|
+
}
|
|
43
|
+
}, [opts, prevOpts, frames]);
|
|
44
|
+
useEffect(() => {
|
|
45
|
+
if (autostart) {
|
|
46
|
+
frames.run();
|
|
47
|
+
}
|
|
48
|
+
return () => {
|
|
49
|
+
frames.stop();
|
|
50
|
+
};
|
|
51
|
+
}, [frames]);
|
|
52
|
+
return frames;
|
|
53
|
+
};
|
|
54
|
+
|
|
55
|
+
// src/hooks/useMetro.ts
|
|
56
|
+
import { useEffect as useEffect2, useMemo as useMemo2, useRef as useRef3 } from "react";
|
|
57
|
+
import { Metro } from "@prtcl/plonk";
|
|
58
|
+
var useMetro = (callback, opts) => {
|
|
59
|
+
const { autostart = true } = opts || {};
|
|
60
|
+
const callbackRef = useRef3(callback);
|
|
61
|
+
const optsRef = useRef3(opts);
|
|
62
|
+
const prevOpts = usePrevious(opts);
|
|
63
|
+
callbackRef.current = callback;
|
|
64
|
+
const metro = useMemo2(() => {
|
|
65
|
+
return new Metro((m) => {
|
|
66
|
+
callbackRef.current(m);
|
|
67
|
+
}, optsRef.current);
|
|
68
|
+
}, []);
|
|
69
|
+
useEffect2(() => {
|
|
70
|
+
if (opts && prevOpts && opts.time !== prevOpts.time) {
|
|
71
|
+
metro.setTime(opts.time);
|
|
72
|
+
}
|
|
73
|
+
}, [opts, prevOpts, metro]);
|
|
74
|
+
useEffect2(() => {
|
|
75
|
+
if (autostart) {
|
|
76
|
+
metro.run();
|
|
77
|
+
}
|
|
78
|
+
return () => {
|
|
79
|
+
metro.stop();
|
|
80
|
+
};
|
|
81
|
+
}, [metro]);
|
|
82
|
+
return metro;
|
|
83
|
+
};
|
|
84
|
+
export {
|
|
85
|
+
useFrames,
|
|
86
|
+
useMetro,
|
|
87
|
+
usePrevious
|
|
88
|
+
};
|
|
89
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/index.ts","../src/hooks/useFrames.ts","../src/hooks/usePrevious.ts","../src/hooks/useMetro.ts"],"sourcesContent":["'use client';\n\nimport 'client-only';\n\nexport { useFrames, type UseFramesOptions } from './hooks/useFrames';\nexport { useMetro, type UseMetroOptions } from './hooks/useMetro';\nexport { usePrevious } from './hooks/usePrevious';\n","import { useEffect, useMemo, useRef } from 'react';\nimport { Frames, type FramesOptions, type TimerCallback } from '@prtcl/plonk';\nimport { usePrevious } from './usePrevious';\n\nexport type UseFramesOptions = FramesOptions & {\n autostart?: boolean;\n};\n\n/**\n * Hook wrapper for Frames which provides an animation loop with variable frame rate\n */\nexport const useFrames = (\n callback: TimerCallback<Frames>,\n opts?: UseFramesOptions,\n) => {\n const { autostart = true } = opts || {};\n const callbackRef = useRef<TimerCallback<Frames>>(callback);\n const optsRef = useRef<UseFramesOptions | undefined>(opts);\n const prevOpts = usePrevious(opts);\n\n callbackRef.current = callback;\n\n const frames = useMemo<Frames>(() => {\n return new Frames((m) => {\n callbackRef.current(m);\n }, optsRef.current);\n }, []);\n\n useEffect(() => {\n if (opts && prevOpts && opts.fps !== prevOpts.fps) {\n frames.setFPS(opts.fps);\n }\n }, [opts, prevOpts, frames]);\n\n useEffect(() => {\n if (autostart) {\n frames.run();\n }\n\n return () => {\n frames.stop();\n };\n }, [frames]);\n\n return frames;\n};\n","import { useRef } from 'react';\n\ntype ValueCache<Value> = {\n value: Value;\n prev: Value | undefined;\n};\n\n/** Returns the previous value without causing additional updates. */\nexport const usePrevious = <Value>(value: Value): Value | undefined => {\n const ref = useRef<ValueCache<Value>>({\n value,\n prev: undefined,\n });\n\n const current = ref.current.value;\n\n if (value !== current) {\n ref.current = {\n value,\n prev: current,\n };\n }\n\n return ref.current.prev;\n};\n","import { useEffect, useMemo, useRef } from 'react';\nimport { Metro, type MetroOptions, type TimerCallback } from '@prtcl/plonk';\nimport { usePrevious } from './usePrevious';\n\nexport type UseMetroOptions = MetroOptions & {\n autostart?: boolean;\n};\n\n/**\n * Hook wrapper for Metro which provides a timer loop with variable interval.\n */\nexport const useMetro = (\n callback: TimerCallback<Metro>,\n opts?: UseMetroOptions,\n) => {\n const { autostart = true } = opts || {};\n const callbackRef = useRef<TimerCallback<Metro>>(callback);\n const optsRef = useRef<UseMetroOptions | undefined>(opts);\n const prevOpts = usePrevious(opts);\n\n callbackRef.current = callback;\n\n const metro = useMemo<Metro>(() => {\n return new Metro((m) => {\n callbackRef.current(m);\n }, optsRef.current);\n }, []);\n\n useEffect(() => {\n if (opts && prevOpts && opts.time !== prevOpts.time) {\n metro.setTime(opts.time);\n }\n }, [opts, prevOpts, metro]);\n\n useEffect(() => {\n if (autostart) {\n metro.run();\n }\n\n return () => {\n metro.stop();\n };\n }, [metro]);\n\n return metro;\n};\n"],"mappings":";;;AAEA,OAAO;;;ACFP,SAAS,WAAW,SAAS,UAAAA,eAAc;AAC3C,SAAS,cAAsD;;;ACD/D,SAAS,cAAc;AAQhB,IAAM,cAAc,CAAQ,UAAoC;AACrE,QAAM,MAAM,OAA0B;AAAA,IACpC;AAAA,IACA,MAAM;AAAA,EACR,CAAC;AAED,QAAM,UAAU,IAAI,QAAQ;AAE5B,MAAI,UAAU,SAAS;AACrB,QAAI,UAAU;AAAA,MACZ;AAAA,MACA,MAAM;AAAA,IACR;AAAA,EACF;AAEA,SAAO,IAAI,QAAQ;AACrB;;;ADbO,IAAM,YAAY,CACvB,UACA,SACG;AACH,QAAM,EAAE,YAAY,KAAK,IAAI,QAAQ,CAAC;AACtC,QAAM,cAAcC,QAA8B,QAAQ;AAC1D,QAAM,UAAUA,QAAqC,IAAI;AACzD,QAAM,WAAW,YAAY,IAAI;AAEjC,cAAY,UAAU;AAEtB,QAAM,SAAS,QAAgB,MAAM;AACnC,WAAO,IAAI,OAAO,CAAC,MAAM;AACvB,kBAAY,QAAQ,CAAC;AAAA,IACvB,GAAG,QAAQ,OAAO;AAAA,EACpB,GAAG,CAAC,CAAC;AAEL,YAAU,MAAM;AACd,QAAI,QAAQ,YAAY,KAAK,QAAQ,SAAS,KAAK;AACjD,aAAO,OAAO,KAAK,GAAG;AAAA,IACxB;AAAA,EACF,GAAG,CAAC,MAAM,UAAU,MAAM,CAAC;AAE3B,YAAU,MAAM;AACd,QAAI,WAAW;AACb,aAAO,IAAI;AAAA,IACb;AAEA,WAAO,MAAM;AACX,aAAO,KAAK;AAAA,IACd;AAAA,EACF,GAAG,CAAC,MAAM,CAAC;AAEX,SAAO;AACT;;;AE7CA,SAAS,aAAAC,YAAW,WAAAC,UAAS,UAAAC,eAAc;AAC3C,SAAS,aAAoD;AAUtD,IAAM,WAAW,CACtB,UACA,SACG;AACH,QAAM,EAAE,YAAY,KAAK,IAAI,QAAQ,CAAC;AACtC,QAAM,cAAcC,QAA6B,QAAQ;AACzD,QAAM,UAAUA,QAAoC,IAAI;AACxD,QAAM,WAAW,YAAY,IAAI;AAEjC,cAAY,UAAU;AAEtB,QAAM,QAAQC,SAAe,MAAM;AACjC,WAAO,IAAI,MAAM,CAAC,MAAM;AACtB,kBAAY,QAAQ,CAAC;AAAA,IACvB,GAAG,QAAQ,OAAO;AAAA,EACpB,GAAG,CAAC,CAAC;AAEL,EAAAC,WAAU,MAAM;AACd,QAAI,QAAQ,YAAY,KAAK,SAAS,SAAS,MAAM;AACnD,YAAM,QAAQ,KAAK,IAAI;AAAA,IACzB;AAAA,EACF,GAAG,CAAC,MAAM,UAAU,KAAK,CAAC;AAE1B,EAAAA,WAAU,MAAM;AACd,QAAI,WAAW;AACb,YAAM,IAAI;AAAA,IACZ;AAEA,WAAO,MAAM;AACX,YAAM,KAAK;AAAA,IACb;AAAA,EACF,GAAG,CAAC,KAAK,CAAC;AAEV,SAAO;AACT;","names":["useRef","useRef","useEffect","useMemo","useRef","useRef","useMemo","useEffect"]}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@prtcl/plonk-hooks",
|
|
3
|
-
"version": "1.0.1-beta.
|
|
3
|
+
"version": "1.0.1-beta.3",
|
|
4
4
|
"description": "React hook wrappers for plonk",
|
|
5
5
|
"author": "Cory O'Brien <cory@prtcl.cc>",
|
|
6
6
|
"license": "MIT",
|
|
@@ -23,7 +23,7 @@
|
|
|
23
23
|
"test": "vitest --browser.name=chrome --browser.headless --watch=false"
|
|
24
24
|
},
|
|
25
25
|
"dependencies": {
|
|
26
|
-
"@prtcl/plonk": "1.0.1-beta.
|
|
26
|
+
"@prtcl/plonk": "1.0.1-beta.3",
|
|
27
27
|
"client-only": "^0.0.1"
|
|
28
28
|
},
|
|
29
29
|
"peerDependencies": {
|