@remotion/skia 3.3.77 → 3.3.78

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.
@@ -0,0 +1,13 @@
1
+ import type { CanvasProps } from '@shopify/react-native-skia';
2
+ import type { ReactNode } from 'react';
3
+ declare type RemotionCanvasProps = CanvasProps & {
4
+ children: ReactNode;
5
+ width: number;
6
+ height: number;
7
+ };
8
+ /**
9
+ * @description A React Native Skia <Canvas /> component that wraps Remotion contexts.
10
+ * @see [Documentation](https://www.remotion.dev/docs/skia/skia-canvas)
11
+ */
12
+ export declare const SkiaCanvas: ({ children, height, width, style, ...otherProps }: RemotionCanvasProps) => JSX.Element;
13
+ export {};
@@ -0,0 +1,28 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.SkiaCanvas = void 0;
4
+ const jsx_runtime_1 = require("react/jsx-runtime");
5
+ const react_native_skia_1 = require("@shopify/react-native-skia");
6
+ const react_1 = require("react");
7
+ const remotion_1 = require("remotion");
8
+ /**
9
+ * @description A React Native Skia <Canvas /> component that wraps Remotion contexts.
10
+ * @see [Documentation](https://www.remotion.dev/docs/skia/skia-canvas)
11
+ */
12
+ const SkiaCanvas = ({ children, height, width, style, ...otherProps }) => {
13
+ const contexts = remotion_1.Internals.useRemotionContexts();
14
+ const props = (0, react_1.useMemo)(() => {
15
+ return {
16
+ style: [
17
+ {
18
+ width,
19
+ height,
20
+ },
21
+ style,
22
+ ],
23
+ ...otherProps,
24
+ };
25
+ }, [height, otherProps, style, width]);
26
+ return ((0, jsx_runtime_1.jsx)(react_native_skia_1.Canvas, { ...props, children: (0, jsx_runtime_1.jsx)(remotion_1.Internals.RemotionContextProvider, { contexts: contexts, children: children }) }));
27
+ };
28
+ exports.SkiaCanvas = SkiaCanvas;
@@ -0,0 +1,6 @@
1
+ import type { WebpackOverrideFn } from '@remotion/bundler';
2
+ /**
3
+ * @description A function that modifies the default Webpack configuration to make the necessary changes to support Skia.
4
+ * @see [Documentation](https://www.remotion.dev/docs/skia/enable-skia)
5
+ */
6
+ export declare const enableSkia: WebpackOverrideFn;
@@ -0,0 +1,48 @@
1
+ "use strict";
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ exports.enableSkia = void 0;
7
+ const copy_webpack_plugin_1 = __importDefault(require("copy-webpack-plugin"));
8
+ /**
9
+ * @description A function that modifies the default Webpack configuration to make the necessary changes to support Skia.
10
+ * @see [Documentation](https://www.remotion.dev/docs/skia/enable-skia)
11
+ */
12
+ const enableSkia = (currentConfiguration) => {
13
+ var _a, _b;
14
+ return {
15
+ ...currentConfiguration,
16
+ plugins: [
17
+ ...((_a = currentConfiguration.plugins) !== null && _a !== void 0 ? _a : []),
18
+ new copy_webpack_plugin_1.default({
19
+ patterns: [
20
+ { from: 'node_modules/canvaskit-wasm/bin/full/canvaskit.wasm' },
21
+ ],
22
+ }),
23
+ ],
24
+ resolve: {
25
+ ...currentConfiguration.resolve,
26
+ // FIXME: To fix missing modules in browser when using webassembly
27
+ fallback: {
28
+ fs: false,
29
+ path: false,
30
+ },
31
+ extensions: [
32
+ '.web.js',
33
+ '.web.ts',
34
+ '.web.tsx',
35
+ '.js',
36
+ '.ts',
37
+ '.tsx',
38
+ '...',
39
+ ],
40
+ },
41
+ externals: {
42
+ ...((_b = currentConfiguration.externals) !== null && _b !== void 0 ? _b : {}),
43
+ 'react-native-reanimated': "require('react-native-reanimated')",
44
+ 'react-native-reanimated/lib/reanimated2/core': "require('react-native-reanimated/lib/reanimated2/core')",
45
+ },
46
+ };
47
+ };
48
+ exports.enableSkia = enableSkia;
@@ -0,0 +1 @@
1
+ export { SkiaCanvas } from './SkiaCanvas';
package/dist/index.js ADDED
@@ -0,0 +1,5 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.SkiaCanvas = void 0;
4
+ var SkiaCanvas_1 = require("./SkiaCanvas");
5
+ Object.defineProperty(exports, "SkiaCanvas", { enumerable: true, get: function () { return SkiaCanvas_1.SkiaCanvas; } });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@remotion/skia",
3
- "version": "3.3.77",
3
+ "version": "3.3.78",
4
4
  "description": "Utilities for using react-native-skia in Remotion",
5
5
  "main": "dist/cjs/index.js",
6
6
  "types": "dist/cjs/index.d.ts",
@@ -17,17 +17,17 @@
17
17
  },
18
18
  "dependencies": {
19
19
  "copy-webpack-plugin": "11",
20
- "remotion": "3.3.77"
20
+ "remotion": "3.3.78"
21
21
  },
22
22
  "peerDependencies": {
23
- "@remotion/bundler": "3.3.77",
23
+ "@remotion/bundler": "3.3.78",
24
24
  "@shopify/react-native-skia": "^0.1.139",
25
25
  "react": ">=16.8.0",
26
26
  "react-dom": ">=16.8.0"
27
27
  },
28
28
  "devDependencies": {
29
29
  "@jonny/eslint-config": "3.0.266",
30
- "@remotion/bundler": "3.3.77",
30
+ "@remotion/bundler": "3.3.78",
31
31
  "@rollup/plugin-typescript": "^8.2.0",
32
32
  "@shopify/react-native-skia": "^0.1.139",
33
33
  "@types/react": "18.0.26",
@@ -37,7 +37,7 @@
37
37
  "prettier-plugin-organize-imports": "^2.3.4",
38
38
  "react": "18.0.0",
39
39
  "react-dom": "18.0.0",
40
- "remotion": "3.3.77",
40
+ "remotion": "3.3.78",
41
41
  "rollup": "^2.70.1",
42
42
  "typescript": "^4.7.0"
43
43
  },