@remotion/skia 4.0.395 → 4.0.397

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/package.json CHANGED
@@ -3,7 +3,7 @@
3
3
  "url": "https://github.com/remotion-dev/remotion/tree/main/packages/skia"
4
4
  },
5
5
  "name": "@remotion/skia",
6
- "version": "4.0.395",
6
+ "version": "4.0.397",
7
7
  "description": "Include React Native Skia components in a Remotion video",
8
8
  "main": "dist/cjs/index.js",
9
9
  "types": "dist/cjs/index.d.ts",
@@ -21,7 +21,7 @@
21
21
  "url": "https://github.com/remotion-dev/remotion/issues"
22
22
  },
23
23
  "dependencies": {
24
- "remotion": "4.0.395"
24
+ "remotion": "4.0.397"
25
25
  },
26
26
  "peerDependencies": {
27
27
  "@shopify/react-native-skia": ">=0.1.191",
@@ -29,14 +29,14 @@
29
29
  "react-dom": ">=16.8.0"
30
30
  },
31
31
  "devDependencies": {
32
- "@remotion/bundler": "4.0.395",
32
+ "@remotion/bundler": "4.0.397",
33
33
  "@shopify/react-native-skia": "2.0.0",
34
34
  "canvaskit-wasm": "0.40.0",
35
35
  "@types/react-native": "^0.69.2",
36
36
  "react": "19.2.3",
37
37
  "react-dom": "19.2.3",
38
- "remotion": "4.0.395",
39
- "@remotion/eslint-config-internal": "4.0.395",
38
+ "remotion": "4.0.397",
39
+ "@remotion/eslint-config-internal": "4.0.397",
40
40
  "eslint": "9.19.0"
41
41
  },
42
42
  "keywords": [
@@ -1,13 +0,0 @@
1
- import type { CanvasProps } from '@shopify/react-native-skia';
2
- import type { ReactNode } from 'react';
3
- type RemotionCanvasProps = CanvasProps & {
4
- readonly children: ReactNode;
5
- readonly width: number;
6
- readonly 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) => import("react/jsx-runtime").JSX.Element;
13
- export {};
@@ -1,30 +0,0 @@
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 mergedStyles = (0, react_1.useMemo)(() => {
15
- var _a;
16
- return {
17
- width,
18
- height,
19
- ...((_a = style) !== null && _a !== void 0 ? _a : {}),
20
- };
21
- }, [height, style, width]);
22
- const props = (0, react_1.useMemo)(() => {
23
- return {
24
- style: mergedStyles,
25
- ...otherProps,
26
- };
27
- }, [mergedStyles, otherProps]);
28
- 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 }) }));
29
- };
30
- exports.SkiaCanvas = SkiaCanvas;
@@ -1,6 +0,0 @@
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;
@@ -1,61 +0,0 @@
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 bundler_1 = require("@remotion/bundler");
8
- const fs_1 = __importDefault(require("fs"));
9
- /**
10
- * @description A function that modifies the default Webpack configuration to make the necessary changes to support Skia.
11
- * @see [Documentation](https://www.remotion.dev/docs/skia/enable-skia)
12
- */
13
- const enableSkia = (currentConfiguration) => {
14
- var _a, _b, _c, _d;
15
- const newExtensions = [
16
- '.web.js',
17
- '.web.ts',
18
- '.web.tsx',
19
- ...((_b = (_a = currentConfiguration.resolve) === null || _a === void 0 ? void 0 : _a.extensions) !== null && _b !== void 0 ? _b : []),
20
- ];
21
- const deduplicatedExtensions = [...new Set(newExtensions)];
22
- return {
23
- ...currentConfiguration,
24
- plugins: [
25
- ...((_c = currentConfiguration.plugins) !== null && _c !== void 0 ? _c : []),
26
- new (class CopySkiaPlugin {
27
- apply(compiler) {
28
- compiler.hooks.thisCompilation.tap('AddSkiaPlugin', (compilation) => {
29
- compilation.hooks.processAssets.tapPromise({
30
- name: 'copy-skia',
31
- stage: compiler.webpack.Compilation.PROCESS_ASSETS_STAGE_ADDITIONAL,
32
- }, async () => {
33
- const src = require.resolve('canvaskit-wasm/bin/full/canvaskit.wasm');
34
- if (compilation.getAsset(src)) {
35
- // Skip emitting the asset again because it's immutable
36
- return;
37
- }
38
- compilation.emitAsset('/canvaskit.wasm', new bundler_1.webpack.sources.RawSource(await fs_1.default.promises.readFile(src)));
39
- });
40
- });
41
- }
42
- })(),
43
- ],
44
- resolve: {
45
- ...currentConfiguration.resolve,
46
- // FIXME: To fix missing modules in browser when using webassembly
47
- fallback: {
48
- fs: false,
49
- path: false,
50
- },
51
- extensions: deduplicatedExtensions,
52
- alias: {
53
- ...(_d = currentConfiguration.resolve) === null || _d === void 0 ? void 0 : _d.alias,
54
- 'react-native-reanimated': "require('react-native-reanimated')",
55
- 'react-native-reanimated/lib/reanimated2/core': "require('react-native-reanimated/lib/reanimated2/core')",
56
- 'react-native/Libraries/Image/AssetRegistry': false,
57
- },
58
- },
59
- };
60
- };
61
- exports.enableSkia = enableSkia;
@@ -1 +0,0 @@
1
- export { SkiaCanvas } from './SkiaCanvas';
@@ -1,5 +0,0 @@
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; } });
@@ -1,54 +0,0 @@
1
- import { createRequire } from "node:module";
2
- var __require = /* @__PURE__ */ createRequire(import.meta.url);
3
-
4
- // src/enable.ts
5
- import { webpack } from "@remotion/bundler";
6
- import fs from "fs";
7
- var enableSkia = (currentConfiguration) => {
8
- const newExtensions = [
9
- ".web.js",
10
- ".web.ts",
11
- ".web.tsx",
12
- ...currentConfiguration.resolve?.extensions ?? []
13
- ];
14
- const deduplicatedExtensions = [...new Set(newExtensions)];
15
- return {
16
- ...currentConfiguration,
17
- plugins: [
18
- ...currentConfiguration.plugins ?? [],
19
- new class CopySkiaPlugin {
20
- apply(compiler) {
21
- compiler.hooks.thisCompilation.tap("AddSkiaPlugin", (compilation) => {
22
- compilation.hooks.processAssets.tapPromise({
23
- name: "copy-skia",
24
- stage: compiler.webpack.Compilation.PROCESS_ASSETS_STAGE_ADDITIONAL
25
- }, async () => {
26
- const src = __require.resolve("canvaskit-wasm/bin/full/canvaskit.wasm");
27
- if (compilation.getAsset(src)) {
28
- return;
29
- }
30
- compilation.emitAsset("/canvaskit.wasm", new webpack.sources.RawSource(await fs.promises.readFile(src)));
31
- });
32
- });
33
- }
34
- }
35
- ],
36
- resolve: {
37
- ...currentConfiguration.resolve,
38
- fallback: {
39
- fs: false,
40
- path: false
41
- },
42
- extensions: deduplicatedExtensions,
43
- alias: {
44
- ...currentConfiguration.resolve?.alias,
45
- "react-native-reanimated": "require('react-native-reanimated')",
46
- "react-native-reanimated/lib/reanimated2/core": "require('react-native-reanimated/lib/reanimated2/core')",
47
- "react-native/Libraries/Image/AssetRegistry": false
48
- }
49
- }
50
- };
51
- };
52
- export {
53
- enableSkia
54
- };
@@ -1,37 +0,0 @@
1
- // src/SkiaCanvas.tsx
2
- import { Canvas } from "@shopify/react-native-skia";
3
- import { useMemo } from "react";
4
- import { Internals } from "remotion";
5
- import { jsx } from "react/jsx-runtime";
6
- var SkiaCanvas = ({
7
- children,
8
- height,
9
- width,
10
- style,
11
- ...otherProps
12
- }) => {
13
- const contexts = Internals.useRemotionContexts();
14
- const mergedStyles = useMemo(() => {
15
- return {
16
- width,
17
- height,
18
- ...style ?? {}
19
- };
20
- }, [height, style, width]);
21
- const props = useMemo(() => {
22
- return {
23
- style: mergedStyles,
24
- ...otherProps
25
- };
26
- }, [mergedStyles, otherProps]);
27
- return /* @__PURE__ */ jsx(Canvas, {
28
- ...props,
29
- children: /* @__PURE__ */ jsx(Internals.RemotionContextProvider, {
30
- contexts,
31
- children
32
- })
33
- });
34
- };
35
- export {
36
- SkiaCanvas
37
- };