@shopify/react-native-skia 1.9.1 → 1.10.0
Sign up to get free protection for your applications and to get access to all the features.
- package/lib/commonjs/index.d.ts +1 -1
- package/lib/commonjs/index.js +8 -8
- package/lib/commonjs/index.js.map +1 -1
- package/lib/commonjs/renderer/Canvas.d.ts +9 -10
- package/lib/commonjs/renderer/Canvas.js +67 -59
- package/lib/commonjs/renderer/Canvas.js.map +1 -1
- package/lib/commonjs/renderer/CanvasOld.d.ts +11 -0
- package/lib/commonjs/renderer/CanvasOld.js +96 -0
- package/lib/commonjs/renderer/CanvasOld.js.map +1 -0
- package/lib/commonjs/sksg/Container.js +11 -6
- package/lib/commonjs/sksg/Container.js.map +1 -1
- package/lib/commonjs/sksg/HostConfig2.d.ts +19 -0
- package/lib/commonjs/sksg/HostConfig2.js +159 -0
- package/lib/commonjs/sksg/HostConfig2.js.map +1 -0
- package/lib/commonjs/sksg/Recorder/Core.js +1 -0
- package/lib/commonjs/sksg/Recorder/Core.js.map +1 -1
- package/lib/commonjs/sksg/Recorder/Player.js +2 -2
- package/lib/commonjs/sksg/Recorder/Player.js.map +1 -1
- package/lib/commonjs/sksg/Recorder/Recorder.js +0 -1
- package/lib/commonjs/sksg/Recorder/Recorder.js.map +1 -1
- package/lib/module/index.d.ts +1 -1
- package/lib/module/index.js +1 -1
- package/lib/module/index.js.map +1 -1
- package/lib/module/renderer/Canvas.d.ts +9 -10
- package/lib/module/renderer/Canvas.js +65 -55
- package/lib/module/renderer/Canvas.js.map +1 -1
- package/lib/module/renderer/CanvasOld.d.ts +11 -0
- package/lib/module/renderer/CanvasOld.js +87 -0
- package/lib/module/renderer/CanvasOld.js.map +1 -0
- package/lib/module/sksg/Container.js +11 -6
- package/lib/module/sksg/Container.js.map +1 -1
- package/lib/module/sksg/HostConfig2.d.ts +19 -0
- package/lib/module/sksg/HostConfig2.js +152 -0
- package/lib/module/sksg/HostConfig2.js.map +1 -0
- package/lib/module/sksg/Recorder/Core.js +1 -0
- package/lib/module/sksg/Recorder/Core.js.map +1 -1
- package/lib/module/sksg/Recorder/Player.js +2 -2
- package/lib/module/sksg/Recorder/Player.js.map +1 -1
- package/lib/module/sksg/Recorder/Recorder.js +0 -1
- package/lib/module/sksg/Recorder/Recorder.js.map +1 -1
- package/lib/typescript/lib/commonjs/renderer/Canvas.d.ts +2 -2
- package/lib/typescript/lib/commonjs/renderer/CanvasOld.d.ts +3 -0
- package/lib/typescript/lib/commonjs/sksg/HostConfig2.d.ts +44 -0
- package/lib/typescript/lib/module/index.d.ts +1 -1
- package/lib/typescript/lib/module/renderer/Canvas.d.ts +1 -3
- package/lib/typescript/lib/module/renderer/CanvasOld.d.ts +3 -0
- package/lib/typescript/lib/module/sksg/HostConfig2.d.ts +43 -0
- package/lib/typescript/src/index.d.ts +1 -1
- package/lib/typescript/src/renderer/Canvas.d.ts +9 -10
- package/lib/typescript/src/renderer/CanvasOld.d.ts +11 -0
- package/lib/typescript/src/sksg/HostConfig2.d.ts +19 -0
- package/package.json +1 -1
- package/src/index.ts +1 -1
- package/src/renderer/Canvas.tsx +80 -78
- package/src/renderer/CanvasOld.tsx +126 -0
- package/src/sksg/Container.ts +6 -2
- package/src/sksg/HostConfig2.ts +247 -0
- package/src/sksg/Recorder/Core.ts +1 -0
- package/src/sksg/Recorder/Player.ts +2 -2
- package/src/sksg/Recorder/Recorder.ts +0 -1
- package/lib/commonjs/renderer/Canvas2.d.ts +0 -10
- package/lib/commonjs/renderer/Canvas2.js +0 -104
- package/lib/commonjs/renderer/Canvas2.js.map +0 -1
- package/lib/commonjs/renderer/Canvas2.web.d.ts +0 -3
- package/lib/commonjs/renderer/Canvas2.web.js +0 -9
- package/lib/commonjs/renderer/Canvas2.web.js.map +0 -1
- package/lib/module/renderer/Canvas2.d.ts +0 -10
- package/lib/module/renderer/Canvas2.js +0 -97
- package/lib/module/renderer/Canvas2.js.map +0 -1
- package/lib/module/renderer/Canvas2.web.d.ts +0 -3
- package/lib/module/renderer/Canvas2.web.js +0 -3
- package/lib/module/renderer/Canvas2.web.js.map +0 -1
- package/lib/typescript/lib/commonjs/renderer/Canvas2.d.ts +0 -3
- package/lib/typescript/lib/commonjs/renderer/Canvas2.web.d.ts +0 -2
- package/lib/typescript/lib/module/renderer/Canvas2.d.ts +0 -1
- package/lib/typescript/lib/module/renderer/Canvas2.web.d.ts +0 -1
- package/lib/typescript/src/renderer/Canvas2.d.ts +0 -10
- package/lib/typescript/src/renderer/Canvas2.web.d.ts +0 -3
- package/src/renderer/Canvas2.tsx +0 -128
- package/src/renderer/Canvas2.web.tsx +0 -6
@@ -0,0 +1,247 @@
|
|
1
|
+
/*global NodeJS*/
|
2
|
+
import type { Fiber, HostConfig } from "react-reconciler";
|
3
|
+
import { DefaultEventPriority } from "react-reconciler/constants";
|
4
|
+
|
5
|
+
import type { NodeType } from "../dom/types";
|
6
|
+
import { shallowEq } from "../renderer/typeddash";
|
7
|
+
|
8
|
+
import type { Container } from "./Container";
|
9
|
+
import type { Node } from "./Node";
|
10
|
+
|
11
|
+
const DEBUG = false;
|
12
|
+
export const debug = (...args: Parameters<typeof console.log>) => {
|
13
|
+
if (DEBUG) {
|
14
|
+
console.log(...args);
|
15
|
+
}
|
16
|
+
};
|
17
|
+
|
18
|
+
type Instance = Node<unknown>;
|
19
|
+
|
20
|
+
type Props = object;
|
21
|
+
type TextInstance = Node<unknown>;
|
22
|
+
type SuspenseInstance = Instance;
|
23
|
+
type HydratableInstance = Instance;
|
24
|
+
type PublicInstance = Instance;
|
25
|
+
type HostContext = null;
|
26
|
+
type UpdatePayload = Container;
|
27
|
+
type ChildSet = unknown;
|
28
|
+
type TimeoutHandle = NodeJS.Timeout;
|
29
|
+
type NoTimeout = -1;
|
30
|
+
|
31
|
+
type SkiaHostConfig = HostConfig<
|
32
|
+
NodeType,
|
33
|
+
Props,
|
34
|
+
Container,
|
35
|
+
Instance,
|
36
|
+
TextInstance,
|
37
|
+
SuspenseInstance,
|
38
|
+
HydratableInstance,
|
39
|
+
PublicInstance,
|
40
|
+
HostContext,
|
41
|
+
UpdatePayload,
|
42
|
+
ChildSet,
|
43
|
+
TimeoutHandle,
|
44
|
+
NoTimeout
|
45
|
+
>;
|
46
|
+
|
47
|
+
const appendNode = (parent: Node<unknown>, child: Node<unknown>) => {
|
48
|
+
parent.children.push(child);
|
49
|
+
};
|
50
|
+
|
51
|
+
const removeNode = (parent: Node<unknown>, child: Node<unknown>) => {
|
52
|
+
parent.children.splice(parent.children.indexOf(child), 1);
|
53
|
+
};
|
54
|
+
|
55
|
+
const insertBefore = (
|
56
|
+
parent: Node<unknown>,
|
57
|
+
child: Node<unknown>,
|
58
|
+
before: Node<unknown>
|
59
|
+
) => {
|
60
|
+
parent.children.splice(parent.children.indexOf(before), 0, child);
|
61
|
+
};
|
62
|
+
|
63
|
+
export const sksgHostConfig: SkiaHostConfig = {
|
64
|
+
/**
|
65
|
+
* This function is used by the reconciler in order to calculate current time for prioritising work.
|
66
|
+
*/
|
67
|
+
supportsMutation: true,
|
68
|
+
isPrimaryRenderer: false,
|
69
|
+
supportsPersistence: false,
|
70
|
+
supportsHydration: false,
|
71
|
+
//supportsMicrotask: true,
|
72
|
+
|
73
|
+
scheduleTimeout: setTimeout,
|
74
|
+
cancelTimeout: clearTimeout,
|
75
|
+
noTimeout: -1,
|
76
|
+
|
77
|
+
appendChildToContainer(container, child) {
|
78
|
+
debug("appendChildToContainer");
|
79
|
+
container.root.push(child);
|
80
|
+
},
|
81
|
+
|
82
|
+
appendChild(parent, child) {
|
83
|
+
debug("appendChild", parent, child);
|
84
|
+
appendNode(parent, child);
|
85
|
+
},
|
86
|
+
|
87
|
+
getRootHostContext: (_rootContainerInstance: Container) => {
|
88
|
+
debug("getRootHostContext");
|
89
|
+
return null;
|
90
|
+
},
|
91
|
+
|
92
|
+
getChildHostContext(_parentHostContext, _type, _rootContainerInstance) {
|
93
|
+
debug("getChildHostContext");
|
94
|
+
return null;
|
95
|
+
},
|
96
|
+
|
97
|
+
shouldSetTextContent(_type, _props) {
|
98
|
+
return false;
|
99
|
+
},
|
100
|
+
|
101
|
+
createTextInstance(
|
102
|
+
_text,
|
103
|
+
_rootContainerInstance,
|
104
|
+
_hostContext,
|
105
|
+
_internalInstanceHandle
|
106
|
+
) {
|
107
|
+
debug("createTextInstance");
|
108
|
+
// return SpanNode({}, text) as SkNode;
|
109
|
+
throw new Error("Text nodes are not supported yet");
|
110
|
+
},
|
111
|
+
|
112
|
+
createInstance(
|
113
|
+
type,
|
114
|
+
propsWithChildren,
|
115
|
+
_container,
|
116
|
+
_hostContext,
|
117
|
+
_internalInstanceHandle
|
118
|
+
) {
|
119
|
+
debug("createInstance", type);
|
120
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
121
|
+
const { children, ...props } = propsWithChildren as any;
|
122
|
+
debug("createInstance", type);
|
123
|
+
const instance = {
|
124
|
+
type,
|
125
|
+
props,
|
126
|
+
children: [],
|
127
|
+
};
|
128
|
+
return instance;
|
129
|
+
},
|
130
|
+
|
131
|
+
appendInitialChild(parentInstance, child) {
|
132
|
+
debug("appendInitialChild");
|
133
|
+
appendNode(parentInstance, child);
|
134
|
+
},
|
135
|
+
|
136
|
+
finalizeInitialChildren(
|
137
|
+
parentInstance,
|
138
|
+
_type,
|
139
|
+
_props,
|
140
|
+
_rootContainerInstance,
|
141
|
+
_hostContext
|
142
|
+
) {
|
143
|
+
debug("finalizeInitialChildren", parentInstance);
|
144
|
+
return false;
|
145
|
+
},
|
146
|
+
|
147
|
+
commitMount() {
|
148
|
+
// if finalizeInitialChildren = true
|
149
|
+
debug("commitMount");
|
150
|
+
},
|
151
|
+
|
152
|
+
prepareForCommit(_containerInfo) {
|
153
|
+
debug("prepareForCommit");
|
154
|
+
return null;
|
155
|
+
},
|
156
|
+
|
157
|
+
resetAfterCommit(container) {
|
158
|
+
debug("resetAfterCommit");
|
159
|
+
container.redraw();
|
160
|
+
},
|
161
|
+
|
162
|
+
getPublicInstance(node: Instance) {
|
163
|
+
debug("getPublicInstance");
|
164
|
+
return node;
|
165
|
+
},
|
166
|
+
|
167
|
+
prepareUpdate: (
|
168
|
+
_instance,
|
169
|
+
type,
|
170
|
+
oldProps,
|
171
|
+
newProps,
|
172
|
+
rootContainerInstance,
|
173
|
+
_hostContext
|
174
|
+
) => {
|
175
|
+
debug("prepareUpdate");
|
176
|
+
const propsAreEqual = shallowEq(oldProps, newProps);
|
177
|
+
if (propsAreEqual) {
|
178
|
+
return null;
|
179
|
+
}
|
180
|
+
debug("update ", type);
|
181
|
+
return rootContainerInstance;
|
182
|
+
},
|
183
|
+
|
184
|
+
commitUpdate(
|
185
|
+
instance,
|
186
|
+
_updatePayload,
|
187
|
+
type,
|
188
|
+
prevProps,
|
189
|
+
nextProps,
|
190
|
+
_internalHandle
|
191
|
+
) {
|
192
|
+
debug("commitUpdate: ", type);
|
193
|
+
if (shallowEq(prevProps, nextProps)) {
|
194
|
+
return;
|
195
|
+
}
|
196
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
197
|
+
const { children, ...props } = nextProps as any;
|
198
|
+
instance.props = props;
|
199
|
+
},
|
200
|
+
|
201
|
+
commitTextUpdate: (
|
202
|
+
_textInstance: TextInstance,
|
203
|
+
_oldText: string,
|
204
|
+
_newText: string
|
205
|
+
) => {
|
206
|
+
// textInstance.instance = newText;
|
207
|
+
},
|
208
|
+
|
209
|
+
clearContainer: (container) => {
|
210
|
+
debug("clearContainer");
|
211
|
+
container.root = [];
|
212
|
+
},
|
213
|
+
|
214
|
+
preparePortalMount: () => {
|
215
|
+
debug("preparePortalMount");
|
216
|
+
},
|
217
|
+
|
218
|
+
removeChild: (parent, child) => {
|
219
|
+
removeNode(parent, child);
|
220
|
+
},
|
221
|
+
|
222
|
+
removeChildFromContainer: (container, child) => {
|
223
|
+
container.root.splice(container.root.indexOf(child), 1);
|
224
|
+
},
|
225
|
+
|
226
|
+
insertInContainerBefore: (container, child, before) => {
|
227
|
+
container.root.splice(container.root.indexOf(before), 0, child);
|
228
|
+
},
|
229
|
+
|
230
|
+
insertBefore: (parent, child, before) => {
|
231
|
+
insertBefore(parent, child, before);
|
232
|
+
},
|
233
|
+
|
234
|
+
// see https://github.com/pmndrs/react-three-fiber/pull/2360#discussion_r916356874
|
235
|
+
getCurrentEventPriority: () => DefaultEventPriority,
|
236
|
+
beforeActiveInstanceBlur: () => {},
|
237
|
+
afterActiveInstanceBlur: () => {},
|
238
|
+
detachDeletedInstance: () => {},
|
239
|
+
|
240
|
+
getInstanceFromNode: function (_node): Fiber | null | undefined {
|
241
|
+
return null;
|
242
|
+
},
|
243
|
+
prepareScopeUpdate: function (_scopeInstance, _instance): void {},
|
244
|
+
getInstanceFromScope: function (_scopeInstance): Instance | null {
|
245
|
+
return null;
|
246
|
+
},
|
247
|
+
};
|
@@ -49,7 +49,7 @@ import {
|
|
49
49
|
} from "./Core";
|
50
50
|
import type { DrawingContext } from "./DrawingContext";
|
51
51
|
|
52
|
-
|
52
|
+
function play(ctx: DrawingContext, command: Command) {
|
53
53
|
"worklet";
|
54
54
|
if (isGroup(command)) {
|
55
55
|
command.children.forEach((child) => play(ctx, child));
|
@@ -154,7 +154,7 @@ const play = (ctx: DrawingContext, command: Command) => {
|
|
154
154
|
ctx.paints.pop();
|
155
155
|
});
|
156
156
|
}
|
157
|
-
}
|
157
|
+
}
|
158
158
|
|
159
159
|
export const replay = (ctx: DrawingContext, commands: Command[]) => {
|
160
160
|
"worklet";
|
@@ -1,10 +0,0 @@
|
|
1
|
-
import type { ViewProps } from "react-native";
|
2
|
-
import type { SharedValue } from "react-native-reanimated";
|
3
|
-
import type { SkSize } from "../skia/types";
|
4
|
-
export interface Canvas2Props extends ViewProps {
|
5
|
-
debug?: boolean;
|
6
|
-
opaque?: boolean;
|
7
|
-
onSize?: SharedValue<SkSize>;
|
8
|
-
mode?: "continuous" | "default";
|
9
|
-
}
|
10
|
-
export declare const Canvas2: import("react").ForwardRefExoticComponent<Canvas2Props & import("react").RefAttributes<unknown>>;
|
@@ -1,104 +0,0 @@
|
|
1
|
-
"use strict";
|
2
|
-
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
4
|
-
value: true
|
5
|
-
});
|
6
|
-
exports.Canvas2 = void 0;
|
7
|
-
var _react = require("react");
|
8
|
-
var _SkiaViewNativeId = require("../views/SkiaViewNativeId");
|
9
|
-
var _SkiaPictureViewNativeComponent = _interopRequireDefault(require("../specs/SkiaPictureViewNativeComponent"));
|
10
|
-
var _Reconciler = require("../sksg/Reconciler");
|
11
|
-
var _skia = require("../skia");
|
12
|
-
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
13
|
-
function _extends() { return _extends = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends.apply(null, arguments); }
|
14
|
-
const NativeSkiaPictureView = _SkiaPictureViewNativeComponent.default;
|
15
|
-
|
16
|
-
// TODO: no need to go through the JS thread for this
|
17
|
-
const useOnSizeEvent = (resultValue, onLayout) => {
|
18
|
-
return (0, _react.useCallback)(event => {
|
19
|
-
if (onLayout) {
|
20
|
-
onLayout(event);
|
21
|
-
}
|
22
|
-
const {
|
23
|
-
width,
|
24
|
-
height
|
25
|
-
} = event.nativeEvent.layout;
|
26
|
-
if (resultValue) {
|
27
|
-
resultValue.value = {
|
28
|
-
width,
|
29
|
-
height
|
30
|
-
};
|
31
|
-
}
|
32
|
-
}, [onLayout, resultValue]);
|
33
|
-
};
|
34
|
-
const Canvas2 = exports.Canvas2 = /*#__PURE__*/(0, _react.forwardRef)(({
|
35
|
-
mode,
|
36
|
-
debug,
|
37
|
-
opaque,
|
38
|
-
children,
|
39
|
-
onSize,
|
40
|
-
onLayout: _onLayout,
|
41
|
-
...viewProps
|
42
|
-
}, ref) => {
|
43
|
-
const rafId = (0, _react.useRef)(null);
|
44
|
-
const onLayout = useOnSizeEvent(onSize, _onLayout);
|
45
|
-
// Native ID
|
46
|
-
const nativeId = (0, _react.useMemo)(() => {
|
47
|
-
return _SkiaViewNativeId.SkiaViewNativeId.current++;
|
48
|
-
}, []);
|
49
|
-
|
50
|
-
// Root
|
51
|
-
const root = (0, _react.useMemo)(() => new _Reconciler.SkiaSGRoot(_skia.Skia, nativeId), [nativeId]);
|
52
|
-
|
53
|
-
// Render effects
|
54
|
-
(0, _react.useEffect)(() => {
|
55
|
-
root.render(children);
|
56
|
-
}, [children, root]);
|
57
|
-
(0, _react.useEffect)(() => {
|
58
|
-
return () => {
|
59
|
-
root.unmount();
|
60
|
-
};
|
61
|
-
}, [root]);
|
62
|
-
const requestRedraw = (0, _react.useCallback)(() => {
|
63
|
-
rafId.current = requestAnimationFrame(() => {
|
64
|
-
root.render(children);
|
65
|
-
if (mode === "continuous") {
|
66
|
-
requestRedraw();
|
67
|
-
}
|
68
|
-
});
|
69
|
-
}, [children, mode, root]);
|
70
|
-
(0, _react.useEffect)(() => {
|
71
|
-
if (mode === "continuous") {
|
72
|
-
requestRedraw();
|
73
|
-
}
|
74
|
-
return () => {
|
75
|
-
if (rafId.current !== null) {
|
76
|
-
cancelAnimationFrame(rafId.current);
|
77
|
-
}
|
78
|
-
};
|
79
|
-
}, [mode, requestRedraw]);
|
80
|
-
|
81
|
-
// Component methods
|
82
|
-
(0, _react.useImperativeHandle)(ref, () => ({
|
83
|
-
makeImageSnapshot: rect => {
|
84
|
-
return SkiaViewApi.makeImageSnapshot(nativeId, rect);
|
85
|
-
},
|
86
|
-
makeImageSnapshotAsync: rect => {
|
87
|
-
return SkiaViewApi.makeImageSnapshotAsync(nativeId, rect);
|
88
|
-
},
|
89
|
-
redraw: () => {
|
90
|
-
SkiaViewApi.requestRedraw(nativeId);
|
91
|
-
},
|
92
|
-
getNativeId: () => {
|
93
|
-
return nativeId;
|
94
|
-
}
|
95
|
-
}));
|
96
|
-
return /*#__PURE__*/React.createElement(NativeSkiaPictureView, _extends({
|
97
|
-
collapsable: false,
|
98
|
-
nativeID: `${nativeId}`,
|
99
|
-
debug: debug,
|
100
|
-
opaque: opaque,
|
101
|
-
onLayout: onLayout
|
102
|
-
}, viewProps));
|
103
|
-
});
|
104
|
-
//# sourceMappingURL=Canvas2.js.map
|
@@ -1 +0,0 @@
|
|
1
|
-
{"version":3,"names":["_react","require","_SkiaViewNativeId","_SkiaPictureViewNativeComponent","_interopRequireDefault","_Reconciler","_skia","e","__esModule","default","_extends","Object","assign","bind","n","arguments","length","t","r","hasOwnProperty","call","apply","NativeSkiaPictureView","SkiaPictureViewNativeComponent","useOnSizeEvent","resultValue","onLayout","useCallback","event","width","height","nativeEvent","layout","value","Canvas2","exports","forwardRef","mode","debug","opaque","children","onSize","_onLayout","viewProps","ref","rafId","useRef","nativeId","useMemo","SkiaViewNativeId","current","root","SkiaSGRoot","Skia","useEffect","render","unmount","requestRedraw","requestAnimationFrame","cancelAnimationFrame","useImperativeHandle","makeImageSnapshot","rect","SkiaViewApi","makeImageSnapshotAsync","redraw","getNativeId","React","createElement","collapsable","nativeID"],"sources":["Canvas2.tsx"],"sourcesContent":["import {\n forwardRef,\n useCallback,\n useEffect,\n useImperativeHandle,\n useMemo,\n useRef,\n} from \"react\";\nimport type { LayoutChangeEvent, ViewProps } from \"react-native\";\nimport type { SharedValue } from \"react-native-reanimated\";\n\nimport { SkiaViewNativeId } from \"../views/SkiaViewNativeId\";\nimport SkiaPictureViewNativeComponent from \"../specs/SkiaPictureViewNativeComponent\";\nimport type { SkRect, SkSize } from \"../skia/types\";\nimport { SkiaSGRoot } from \"../sksg/Reconciler\";\nimport { Skia } from \"../skia\";\nimport type { SkiaBaseViewProps } from \"../views\";\n\nconst NativeSkiaPictureView = SkiaPictureViewNativeComponent;\n\n// TODO: no need to go through the JS thread for this\nconst useOnSizeEvent = (\n resultValue: SkiaBaseViewProps[\"onSize\"],\n onLayout?: (event: LayoutChangeEvent) => void\n) => {\n return useCallback(\n (event: LayoutChangeEvent) => {\n if (onLayout) {\n onLayout(event);\n }\n const { width, height } = event.nativeEvent.layout;\n\n if (resultValue) {\n resultValue.value = { width, height };\n }\n },\n [onLayout, resultValue]\n );\n};\n\nexport interface Canvas2Props extends ViewProps {\n debug?: boolean;\n opaque?: boolean;\n onSize?: SharedValue<SkSize>;\n mode?: \"continuous\" | \"default\";\n}\n\nexport const Canvas2 = forwardRef(\n (\n {\n mode,\n debug,\n opaque,\n children,\n onSize,\n onLayout: _onLayout,\n ...viewProps\n }: Canvas2Props,\n ref\n ) => {\n const rafId = useRef<number | null>(null);\n const onLayout = useOnSizeEvent(onSize, _onLayout);\n // Native ID\n const nativeId = useMemo(() => {\n return SkiaViewNativeId.current++;\n }, []);\n\n // Root\n const root = useMemo(() => new SkiaSGRoot(Skia, nativeId), [nativeId]);\n\n // Render effects\n useEffect(() => {\n root.render(children);\n }, [children, root]);\n\n useEffect(() => {\n return () => {\n root.unmount();\n };\n }, [root]);\n\n const requestRedraw = useCallback(() => {\n rafId.current = requestAnimationFrame(() => {\n root.render(children);\n if (mode === \"continuous\") {\n requestRedraw();\n }\n });\n }, [children, mode, root]);\n\n useEffect(() => {\n if (mode === \"continuous\") {\n requestRedraw();\n }\n return () => {\n if (rafId.current !== null) {\n cancelAnimationFrame(rafId.current);\n }\n };\n }, [mode, requestRedraw]);\n\n // Component methods\n useImperativeHandle(ref, () => ({\n makeImageSnapshot: (rect?: SkRect) => {\n return SkiaViewApi.makeImageSnapshot(nativeId, rect);\n },\n makeImageSnapshotAsync: (rect?: SkRect) => {\n return SkiaViewApi.makeImageSnapshotAsync(nativeId, rect);\n },\n redraw: () => {\n SkiaViewApi.requestRedraw(nativeId);\n },\n getNativeId: () => {\n return nativeId;\n },\n }));\n return (\n <NativeSkiaPictureView\n collapsable={false}\n nativeID={`${nativeId}`}\n debug={debug}\n opaque={opaque}\n onLayout={onLayout}\n {...viewProps}\n />\n );\n }\n);\n"],"mappings":";;;;;;AAAA,IAAAA,MAAA,GAAAC,OAAA;AAWA,IAAAC,iBAAA,GAAAD,OAAA;AACA,IAAAE,+BAAA,GAAAC,sBAAA,CAAAH,OAAA;A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AC,EAAE,CAACb,IAAI,EAAEoB,aAAa,CAAC,CAAC;;EAEzB;EACA,IAAAG,0BAAmB,EAAChB,GAAG,EAAE,OAAO;IAC9BiB,iBAAiB,EAAGC,IAAa,IAAK;MACpC,OAAOC,WAAW,CAACF,iBAAiB,CAACd,QAAQ,EAAEe,IAAI,CAAC;IACtD,CAAC;IACDE,sBAAsB,EAAGF,IAAa,IAAK;MACzC,OAAOC,WAAW,CAACC,sBAAsB,CAACjB,QAAQ,EAAEe,IAAI,CAAC;IAC3D,CAAC;IACDG,MAAM,EAAEA,CAAA,KAAM;MACZF,WAAW,CAACN,aAAa,CAACV,QAAQ,CAAC;IACrC,CAAC;IACDmB,WAAW,EAAEA,CAAA,KAAM;MACjB,OAAOnB,QAAQ;IACjB;EACF,CAAC,CAAC,CAAC;EACH,oBACEoB,KAAA,CAAAC,aAAA,CAAC9C,qBAAqB,EAAAZ,QAAA;IACpB2D,WAAW,EAAE,KAAM;IACnBC,QAAQ,EAAE,GAAGvB,QAAQ,EAAG;IACxBT,KAAK,EAAEA,KAAM;IACbC,MAAM,EAAEA,MAAO;IACfb,QAAQ,EAAEA;EAAS,GACfiB,SAAS,CACd,CAAC;AAEN,CACF,CAAC","ignoreList":[]}
|
@@ -1 +0,0 @@
|
|
1
|
-
{"version":3,"names":["_Canvas","require","Canvas2","exports","Canvas"],"sources":["Canvas2.web.tsx"],"sourcesContent":["import type { CanvasProps } from \"./Canvas\";\nimport { Canvas } from \"./Canvas\";\n\nexport type Canvas2Props = CanvasProps;\n\nexport const Canvas2 = Canvas;\n"],"mappings":";;;;;;AACA,IAAAA,OAAA,GAAAC,OAAA;AAIO,MAAMC,OAAO,GAAAC,OAAA,CAAAD,OAAA,GAAGE,cAAM","ignoreList":[]}
|
@@ -1,10 +0,0 @@
|
|
1
|
-
import type { ViewProps } from "react-native";
|
2
|
-
import type { SharedValue } from "react-native-reanimated";
|
3
|
-
import type { SkSize } from "../skia/types";
|
4
|
-
export interface Canvas2Props extends ViewProps {
|
5
|
-
debug?: boolean;
|
6
|
-
opaque?: boolean;
|
7
|
-
onSize?: SharedValue<SkSize>;
|
8
|
-
mode?: "continuous" | "default";
|
9
|
-
}
|
10
|
-
export declare const Canvas2: import("react").ForwardRefExoticComponent<Canvas2Props & import("react").RefAttributes<unknown>>;
|
@@ -1,97 +0,0 @@
|
|
1
|
-
function _extends() { return _extends = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends.apply(null, arguments); }
|
2
|
-
import { forwardRef, useCallback, useEffect, useImperativeHandle, useMemo, useRef } from "react";
|
3
|
-
import { SkiaViewNativeId } from "../views/SkiaViewNativeId";
|
4
|
-
import SkiaPictureViewNativeComponent from "../specs/SkiaPictureViewNativeComponent";
|
5
|
-
import { SkiaSGRoot } from "../sksg/Reconciler";
|
6
|
-
import { Skia } from "../skia";
|
7
|
-
const NativeSkiaPictureView = SkiaPictureViewNativeComponent;
|
8
|
-
|
9
|
-
// TODO: no need to go through the JS thread for this
|
10
|
-
const useOnSizeEvent = (resultValue, onLayout) => {
|
11
|
-
return useCallback(event => {
|
12
|
-
if (onLayout) {
|
13
|
-
onLayout(event);
|
14
|
-
}
|
15
|
-
const {
|
16
|
-
width,
|
17
|
-
height
|
18
|
-
} = event.nativeEvent.layout;
|
19
|
-
if (resultValue) {
|
20
|
-
resultValue.value = {
|
21
|
-
width,
|
22
|
-
height
|
23
|
-
};
|
24
|
-
}
|
25
|
-
}, [onLayout, resultValue]);
|
26
|
-
};
|
27
|
-
export const Canvas2 = /*#__PURE__*/forwardRef(({
|
28
|
-
mode,
|
29
|
-
debug,
|
30
|
-
opaque,
|
31
|
-
children,
|
32
|
-
onSize,
|
33
|
-
onLayout: _onLayout,
|
34
|
-
...viewProps
|
35
|
-
}, ref) => {
|
36
|
-
const rafId = useRef(null);
|
37
|
-
const onLayout = useOnSizeEvent(onSize, _onLayout);
|
38
|
-
// Native ID
|
39
|
-
const nativeId = useMemo(() => {
|
40
|
-
return SkiaViewNativeId.current++;
|
41
|
-
}, []);
|
42
|
-
|
43
|
-
// Root
|
44
|
-
const root = useMemo(() => new SkiaSGRoot(Skia, nativeId), [nativeId]);
|
45
|
-
|
46
|
-
// Render effects
|
47
|
-
useEffect(() => {
|
48
|
-
root.render(children);
|
49
|
-
}, [children, root]);
|
50
|
-
useEffect(() => {
|
51
|
-
return () => {
|
52
|
-
root.unmount();
|
53
|
-
};
|
54
|
-
}, [root]);
|
55
|
-
const requestRedraw = useCallback(() => {
|
56
|
-
rafId.current = requestAnimationFrame(() => {
|
57
|
-
root.render(children);
|
58
|
-
if (mode === "continuous") {
|
59
|
-
requestRedraw();
|
60
|
-
}
|
61
|
-
});
|
62
|
-
}, [children, mode, root]);
|
63
|
-
useEffect(() => {
|
64
|
-
if (mode === "continuous") {
|
65
|
-
requestRedraw();
|
66
|
-
}
|
67
|
-
return () => {
|
68
|
-
if (rafId.current !== null) {
|
69
|
-
cancelAnimationFrame(rafId.current);
|
70
|
-
}
|
71
|
-
};
|
72
|
-
}, [mode, requestRedraw]);
|
73
|
-
|
74
|
-
// Component methods
|
75
|
-
useImperativeHandle(ref, () => ({
|
76
|
-
makeImageSnapshot: rect => {
|
77
|
-
return SkiaViewApi.makeImageSnapshot(nativeId, rect);
|
78
|
-
},
|
79
|
-
makeImageSnapshotAsync: rect => {
|
80
|
-
return SkiaViewApi.makeImageSnapshotAsync(nativeId, rect);
|
81
|
-
},
|
82
|
-
redraw: () => {
|
83
|
-
SkiaViewApi.requestRedraw(nativeId);
|
84
|
-
},
|
85
|
-
getNativeId: () => {
|
86
|
-
return nativeId;
|
87
|
-
}
|
88
|
-
}));
|
89
|
-
return /*#__PURE__*/React.createElement(NativeSkiaPictureView, _extends({
|
90
|
-
collapsable: false,
|
91
|
-
nativeID: `${nativeId}`,
|
92
|
-
debug: debug,
|
93
|
-
opaque: opaque,
|
94
|
-
onLayout: onLayout
|
95
|
-
}, viewProps));
|
96
|
-
});
|
97
|
-
//# sourceMappingURL=Canvas2.js.map
|
@@ -1 +0,0 @@
|
|
1
|
-
{"version":3,"names":["forwardRef","useCallback","useEffect","useImperativeHandle","useMemo","useRef","SkiaViewNativeId","SkiaPictureViewNativeComponent","SkiaSGRoot","Skia","NativeSkiaPictureView","useOnSizeEvent","resultValue","onLayout","event","width","height","nativeEvent","layout","value","Canvas2","mode","debug","opaque","children","onSize","_onLayout","viewProps","ref","rafId","nativeId","current","root","render","unmount","requestRedraw","requestAnimationFrame","cancelAnimationFrame","makeImageSnapshot","rect","SkiaViewApi","makeImageSnapshotAsync","redraw","getNativeId","React","createElement","_extends","collapsable","nativeID"],"sources":["Canvas2.tsx"],"sourcesContent":["import {\n forwardRef,\n useCallback,\n useEffect,\n useImperativeHandle,\n useMemo,\n useRef,\n} from \"react\";\nimport type { LayoutChangeEvent, ViewProps } from \"react-native\";\nimport type { SharedValue } from \"react-native-reanimated\";\n\nimport { SkiaViewNativeId } from \"../views/SkiaViewNativeId\";\nimport SkiaPictureViewNativeComponent from \"../specs/SkiaPictureViewNativeComponent\";\nimport type { SkRect, SkSize } from \"../skia/types\";\nimport { SkiaSGRoot } from \"../sksg/Reconciler\";\nimport { Skia } from \"../skia\";\nimport type { SkiaBaseViewProps } from \"../views\";\n\nconst NativeSkiaPictureView = SkiaPictureViewNativeComponent;\n\n// TODO: no need to go through the JS thread for this\nconst useOnSizeEvent = (\n resultValue: SkiaBaseViewProps[\"onSize\"],\n onLayout?: (event: LayoutChangeEvent) => void\n) => {\n return useCallback(\n (event: LayoutChangeEvent) => {\n if (onLayout) {\n onLayout(event);\n }\n const { width, height } = event.nativeEvent.layout;\n\n if (resultValue) {\n resultValue.value = { width, height };\n }\n },\n [onLayout, resultValue]\n );\n};\n\nexport interface Canvas2Props extends ViewProps {\n debug?: boolean;\n opaque?: boolean;\n onSize?: SharedValue<SkSize>;\n mode?: \"continuous\" | \"default\";\n}\n\nexport const Canvas2 = forwardRef(\n (\n {\n mode,\n debug,\n opaque,\n children,\n onSize,\n onLayout: _onLayout,\n ...viewProps\n }: Canvas2Props,\n ref\n ) => {\n const rafId = useRef<number | null>(null);\n const onLayout = useOnSizeEvent(onSize, _onLayout);\n // Native ID\n const nativeId = useMemo(() => {\n return SkiaViewNativeId.current++;\n }, []);\n\n // Root\n const root = useMemo(() => new SkiaSGRoot(Skia, nativeId), [nativeId]);\n\n // Render effects\n useEffect(() => {\n root.render(children);\n }, [children, root]);\n\n useEffect(() => {\n return () => {\n root.unmount();\n };\n }, [root]);\n\n const requestRedraw = useCallback(() => {\n rafId.current = requestAnimationFrame(() => {\n root.render(children);\n if (mode === \"continuous\") {\n requestRedraw();\n }\n });\n }, [children, mode, root]);\n\n useEffect(() => {\n if (mode === \"continuous\") {\n requestRedraw();\n }\n return () => {\n if (rafId.current !== null) {\n cancelAnimationFrame(rafId.current);\n }\n };\n }, [mode, requestRedraw]);\n\n // Component methods\n useImperativeHandle(ref, () => ({\n makeImageSnapshot: (rect?: SkRect) => {\n return SkiaViewApi.makeImageSnapshot(nativeId, rect);\n },\n makeImageSnapshotAsync: (rect?: SkRect) => {\n return SkiaViewApi.makeImageSnapshotAsync(nativeId, rect);\n },\n redraw: () => {\n SkiaViewApi.requestRedraw(nativeId);\n },\n getNativeId: () => {\n return nativeId;\n },\n }));\n return (\n <NativeSkiaPictureView\n collapsable={false}\n nativeID={`${nativeId}`}\n debug={debug}\n opaque={opaque}\n onLayout={onLayout}\n {...viewProps}\n />\n );\n }\n);\n"],"mappings":";AAAA,SACEA,UAAU,EACVC,WAAW,EACXC,SAAS,EACTC,mBAAmB,EACnBC,OAAO,EACPC,MAAM,QACD,OAAO;AAId,SAASC,gBAAgB,QAAQ,2BAA2B;AAC5D,OAAOC,8BAA8B,MAAM,yCAAyC;AAEpF,SAASC,UAAU,QAAQ,oBAAoB;AAC/C,SAASC,IAAI,QAAQ,SAAS;AAG9B,MAAMC,qBAAqB,GAAGH,8BAA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AAS,GACfc,SAAS,CACd,CAAC;AAEN,CACF,CAAC","ignoreList":[]}
|
@@ -1 +0,0 @@
|
|
1
|
-
{"version":3,"names":["Canvas","Canvas2"],"sources":["Canvas2.web.tsx"],"sourcesContent":["import type { CanvasProps } from \"./Canvas\";\nimport { Canvas } from \"./Canvas\";\n\nexport type Canvas2Props = CanvasProps;\n\nexport const Canvas2 = Canvas;\n"],"mappings":"AACA,SAASA,MAAM,QAAQ,UAAU;AAIjC,OAAO,MAAMC,OAAO,GAAGD,MAAM","ignoreList":[]}
|
@@ -1 +0,0 @@
|
|
1
|
-
export const Canvas2: import("react").ForwardRefExoticComponent<import("react").RefAttributes<any>>;
|
@@ -1 +0,0 @@
|
|
1
|
-
export const Canvas2: import("react").ForwardRefExoticComponent<import("react").RefAttributes<any>>;
|
@@ -1,10 +0,0 @@
|
|
1
|
-
import type { ViewProps } from "react-native";
|
2
|
-
import type { SharedValue } from "react-native-reanimated";
|
3
|
-
import type { SkSize } from "../skia/types";
|
4
|
-
export interface Canvas2Props extends ViewProps {
|
5
|
-
debug?: boolean;
|
6
|
-
opaque?: boolean;
|
7
|
-
onSize?: SharedValue<SkSize>;
|
8
|
-
mode?: "continuous" | "default";
|
9
|
-
}
|
10
|
-
export declare const Canvas2: import("react").ForwardRefExoticComponent<Canvas2Props & import("react").RefAttributes<unknown>>;
|