@shopify/react-native-skia 1.11.11 → 1.11.18
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/android/build.gradle +10 -0
- package/lib/commonjs/specs/NativeSkiaModule.web.d.ts +2 -0
- package/lib/commonjs/specs/NativeSkiaModule.web.js +10 -1
- package/lib/commonjs/specs/NativeSkiaModule.web.js.map +1 -1
- package/lib/module/specs/NativeSkiaModule.web.d.ts +2 -0
- package/lib/module/specs/NativeSkiaModule.web.js +10 -1
- package/lib/module/specs/NativeSkiaModule.web.js.map +1 -1
- package/lib/typescript/src/specs/NativeSkiaModule.web.d.ts +2 -0
- package/package.json +5 -4
- package/src/specs/NativeSkiaModule.web.ts +12 -2
package/android/build.gradle
CHANGED
@@ -132,6 +132,16 @@ android {
|
|
132
132
|
|
133
133
|
compileSdkVersion safeExtGet('compileSdkVersion', DEFAULT_COMPILE_SDK_VERSION)
|
134
134
|
buildToolsVersion safeExtGet('buildToolsVersion', DEFAULT_BUILD_TOOLS_VERSION)
|
135
|
+
|
136
|
+
// Used to override the NDK path/version on internal CI or by allowing
|
137
|
+
// users to customize the NDK path/version from their root project.
|
138
|
+
if (rootProject.hasProperty("ndkPath")) {
|
139
|
+
ndkPath rootProject.ext.ndkPath
|
140
|
+
}
|
141
|
+
if (rootProject.hasProperty("ndkVersion")) {
|
142
|
+
ndkVersion rootProject.ext.ndkVersion
|
143
|
+
}
|
144
|
+
|
135
145
|
defaultConfig {
|
136
146
|
minSdkVersion safeExtGet('minSdkVersion', DEFAULT_MIN_SDK_VERSION)
|
137
147
|
targetSdkVersion safeExtGet('targetSdkVersion', DEFAULT_TARGET_SDK_VERSION)
|
@@ -1,7 +1,9 @@
|
|
1
|
+
import type { SkPicture } from "../skia/types";
|
1
2
|
import type { ISkiaViewApi } from "../views/types";
|
2
3
|
import type { SkiaPictureView } from "../views/SkiaPictureView.web";
|
3
4
|
export type ISkiaViewApiWeb = ISkiaViewApi & {
|
4
5
|
views: Record<string, SkiaPictureView>;
|
6
|
+
deferedPictures: Record<string, SkPicture>;
|
5
7
|
registerView(nativeId: string, view: SkiaPictureView): void;
|
6
8
|
};
|
7
9
|
declare const _default: {};
|
@@ -8,14 +8,23 @@ exports.default = void 0;
|
|
8
8
|
|
9
9
|
global.SkiaViewApi = {
|
10
10
|
views: {},
|
11
|
+
deferedPictures: {},
|
11
12
|
web: true,
|
12
13
|
registerView(nativeId, view) {
|
14
|
+
// Maybe a picture for this view was already set
|
15
|
+
if (this.deferedPictures[nativeId]) {
|
16
|
+
view.setPicture(this.deferedPictures[nativeId]);
|
17
|
+
}
|
13
18
|
this.views[nativeId] = view;
|
14
19
|
},
|
15
20
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
16
21
|
setJsiProperty(nativeId, name, value) {
|
17
22
|
if (name === "picture") {
|
18
|
-
this.views[`${nativeId}`]
|
23
|
+
if (!this.views[`${nativeId}`]) {
|
24
|
+
this.deferedPictures[`${nativeId}`] = value;
|
25
|
+
} else {
|
26
|
+
this.views[`${nativeId}`].setPicture(value);
|
27
|
+
}
|
19
28
|
}
|
20
29
|
},
|
21
30
|
requestRedraw(nativeId) {
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"names":["global","SkiaViewApi","views","web","registerView","nativeId","view","setJsiProperty","name","value","
|
1
|
+
{"version":3,"names":["global","SkiaViewApi","views","deferedPictures","web","registerView","nativeId","view","setPicture","setJsiProperty","name","value","requestRedraw","redraw","makeImageSnapshot","rect","makeImageSnapshotAsync","Promise","resolve","reject","result","Error","_default","exports","default"],"sources":["NativeSkiaModule.web.ts"],"sourcesContent":["/* eslint-disable import/no-anonymous-default-export */\nimport type { SkPicture, SkRect } from \"../skia/types\";\nimport type { ISkiaViewApi } from \"../views/types\";\nimport type { SkiaPictureView } from \"../views/SkiaPictureView.web\";\n\nexport type ISkiaViewApiWeb = ISkiaViewApi & {\n views: Record<string, SkiaPictureView>;\n deferedPictures: Record<string, SkPicture>;\n registerView(nativeId: string, view: SkiaPictureView): void;\n};\n\nglobal.SkiaViewApi = {\n views: {},\n deferedPictures: {},\n web: true,\n registerView(nativeId: string, view: SkiaPictureView) {\n // Maybe a picture for this view was already set\n if (this.deferedPictures[nativeId]) {\n view.setPicture(this.deferedPictures[nativeId] as SkPicture);\n }\n this.views[nativeId] = view;\n },\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n setJsiProperty(nativeId: number, name: string, value: any) {\n if (name === \"picture\") {\n if (!this.views[`${nativeId}`]) {\n this.deferedPictures[`${nativeId}`] = value;\n } else {\n this.views[`${nativeId}`].setPicture(value);\n }\n }\n },\n requestRedraw(nativeId: number) {\n this.views[`${nativeId}`].redraw();\n },\n makeImageSnapshot(nativeId: number, rect?: SkRect) {\n return this.views[`${nativeId}`].makeImageSnapshot(rect);\n },\n makeImageSnapshotAsync(nativeId: number, rect?: SkRect) {\n return new Promise((resolve, reject) => {\n const result = this.views[`${nativeId}`].makeImageSnapshot(rect);\n if (result) {\n resolve(result);\n } else {\n reject(new Error(\"Failed to make image snapshot\"));\n }\n });\n },\n} as ISkiaViewApiWeb;\n\n// eslint-disable-next-line import/no-default-export\nexport default {};\n"],"mappings":";;;;;;AAAA;;AAWAA,MAAM,CAACC,WAAW,GAAG;EACnBC,KAAK,EAAE,CAAC,CAAC;EACTC,eAAe,EAAE,CAAC,CAAC;EACnBC,GAAG,EAAE,IAAI;EACTC,YAAYA,CAACC,QAAgB,EAAEC,IAAqB,EAAE;IACpD;IACA,IAAI,IAAI,CAACJ,eAAe,CAACG,QAAQ,CAAC,EAAE;MAClCC,IAAI,CAACC,UAAU,CAAC,IAAI,CAACL,eAAe,CAACG,QAAQ,CAAc,CAAC;IAC9D;IACA,IAAI,CAACJ,KAAK,CAACI,QAAQ,CAAC,GAAGC,IAAI;EAC7B,CAAC;EACD;EACAE,cAAcA,CAACH,QAAgB,EAAEI,IAAY,EAAEC,KAAU,EAAE;IACzD,IAAID,IAAI,KAAK,SAAS,EAAE;MACtB,IAAI,CAAC,IAAI,CAACR,KAAK,CAAC,GAAGI,QAAQ,EAAE,CAAC,EAAE;QAC9B,IAAI,CAACH,eAAe,CAAC,GAAGG,QAAQ,EAAE,CAAC,GAAGK,KAAK;MAC7C,CAAC,MAAM;QACL,IAAI,CAACT,KAAK,CAAC,GAAGI,QAAQ,EAAE,CAAC,CAACE,UAAU,CAACG,KAAK,CAAC;MAC7C;IACF;EACF,CAAC;EACDC,aAAaA,CAACN,QAAgB,EAAE;IAC9B,IAAI,CAACJ,KAAK,CAAC,GAAGI,QAAQ,EAAE,CAAC,CAACO,MAAM,CAAC,CAAC;EACpC,CAAC;EACDC,iBAAiBA,CAACR,QAAgB,EAAES,IAAa,EAAE;IACjD,OAAO,IAAI,CAACb,KAAK,CAAC,GAAGI,QAAQ,EAAE,CAAC,CAACQ,iBAAiB,CAACC,IAAI,CAAC;EAC1D,CAAC;EACDC,sBAAsBA,CAACV,QAAgB,EAAES,IAAa,EAAE;IACtD,OAAO,IAAIE,OAAO,CAAC,CAACC,OAAO,EAAEC,MAAM,KAAK;MACtC,MAAMC,MAAM,GAAG,IAAI,CAAClB,KAAK,CAAC,GAAGI,QAAQ,EAAE,CAAC,CAACQ,iBAAiB,CAACC,IAAI,CAAC;MAChE,IAAIK,MAAM,EAAE;QACVF,OAAO,CAACE,MAAM,CAAC;MACjB,CAAC,MAAM;QACLD,MAAM,CAAC,IAAIE,KAAK,CAAC,+BAA+B,CAAC,CAAC;MACpD;IACF,CAAC,CAAC;EACJ;AACF,CAAoB;;AAEpB;AAAA,IAAAC,QAAA,GAAAC,OAAA,CAAAC,OAAA,GACe,CAAC,CAAC","ignoreList":[]}
|
@@ -1,7 +1,9 @@
|
|
1
|
+
import type { SkPicture } from "../skia/types";
|
1
2
|
import type { ISkiaViewApi } from "../views/types";
|
2
3
|
import type { SkiaPictureView } from "../views/SkiaPictureView.web";
|
3
4
|
export type ISkiaViewApiWeb = ISkiaViewApi & {
|
4
5
|
views: Record<string, SkiaPictureView>;
|
6
|
+
deferedPictures: Record<string, SkPicture>;
|
5
7
|
registerView(nativeId: string, view: SkiaPictureView): void;
|
6
8
|
};
|
7
9
|
declare const _default: {};
|
@@ -2,14 +2,23 @@
|
|
2
2
|
|
3
3
|
global.SkiaViewApi = {
|
4
4
|
views: {},
|
5
|
+
deferedPictures: {},
|
5
6
|
web: true,
|
6
7
|
registerView(nativeId, view) {
|
8
|
+
// Maybe a picture for this view was already set
|
9
|
+
if (this.deferedPictures[nativeId]) {
|
10
|
+
view.setPicture(this.deferedPictures[nativeId]);
|
11
|
+
}
|
7
12
|
this.views[nativeId] = view;
|
8
13
|
},
|
9
14
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
10
15
|
setJsiProperty(nativeId, name, value) {
|
11
16
|
if (name === "picture") {
|
12
|
-
this.views[`${nativeId}`]
|
17
|
+
if (!this.views[`${nativeId}`]) {
|
18
|
+
this.deferedPictures[`${nativeId}`] = value;
|
19
|
+
} else {
|
20
|
+
this.views[`${nativeId}`].setPicture(value);
|
21
|
+
}
|
13
22
|
}
|
14
23
|
},
|
15
24
|
requestRedraw(nativeId) {
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"names":["global","SkiaViewApi","views","web","registerView","nativeId","view","setJsiProperty","name","value","
|
1
|
+
{"version":3,"names":["global","SkiaViewApi","views","deferedPictures","web","registerView","nativeId","view","setPicture","setJsiProperty","name","value","requestRedraw","redraw","makeImageSnapshot","rect","makeImageSnapshotAsync","Promise","resolve","reject","result","Error"],"sources":["NativeSkiaModule.web.ts"],"sourcesContent":["/* eslint-disable import/no-anonymous-default-export */\nimport type { SkPicture, SkRect } from \"../skia/types\";\nimport type { ISkiaViewApi } from \"../views/types\";\nimport type { SkiaPictureView } from \"../views/SkiaPictureView.web\";\n\nexport type ISkiaViewApiWeb = ISkiaViewApi & {\n views: Record<string, SkiaPictureView>;\n deferedPictures: Record<string, SkPicture>;\n registerView(nativeId: string, view: SkiaPictureView): void;\n};\n\nglobal.SkiaViewApi = {\n views: {},\n deferedPictures: {},\n web: true,\n registerView(nativeId: string, view: SkiaPictureView) {\n // Maybe a picture for this view was already set\n if (this.deferedPictures[nativeId]) {\n view.setPicture(this.deferedPictures[nativeId] as SkPicture);\n }\n this.views[nativeId] = view;\n },\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n setJsiProperty(nativeId: number, name: string, value: any) {\n if (name === \"picture\") {\n if (!this.views[`${nativeId}`]) {\n this.deferedPictures[`${nativeId}`] = value;\n } else {\n this.views[`${nativeId}`].setPicture(value);\n }\n }\n },\n requestRedraw(nativeId: number) {\n this.views[`${nativeId}`].redraw();\n },\n makeImageSnapshot(nativeId: number, rect?: SkRect) {\n return this.views[`${nativeId}`].makeImageSnapshot(rect);\n },\n makeImageSnapshotAsync(nativeId: number, rect?: SkRect) {\n return new Promise((resolve, reject) => {\n const result = this.views[`${nativeId}`].makeImageSnapshot(rect);\n if (result) {\n resolve(result);\n } else {\n reject(new Error(\"Failed to make image snapshot\"));\n }\n });\n },\n} as ISkiaViewApiWeb;\n\n// eslint-disable-next-line import/no-default-export\nexport default {};\n"],"mappings":"AAAA;;AAWAA,MAAM,CAACC,WAAW,GAAG;EACnBC,KAAK,EAAE,CAAC,CAAC;EACTC,eAAe,EAAE,CAAC,CAAC;EACnBC,GAAG,EAAE,IAAI;EACTC,YAAYA,CAACC,QAAgB,EAAEC,IAAqB,EAAE;IACpD;IACA,IAAI,IAAI,CAACJ,eAAe,CAACG,QAAQ,CAAC,EAAE;MAClCC,IAAI,CAACC,UAAU,CAAC,IAAI,CAACL,eAAe,CAACG,QAAQ,CAAc,CAAC;IAC9D;IACA,IAAI,CAACJ,KAAK,CAACI,QAAQ,CAAC,GAAGC,IAAI;EAC7B,CAAC;EACD;EACAE,cAAcA,CAACH,QAAgB,EAAEI,IAAY,EAAEC,KAAU,EAAE;IACzD,IAAID,IAAI,KAAK,SAAS,EAAE;MACtB,IAAI,CAAC,IAAI,CAACR,KAAK,CAAC,GAAGI,QAAQ,EAAE,CAAC,EAAE;QAC9B,IAAI,CAACH,eAAe,CAAC,GAAGG,QAAQ,EAAE,CAAC,GAAGK,KAAK;MAC7C,CAAC,MAAM;QACL,IAAI,CAACT,KAAK,CAAC,GAAGI,QAAQ,EAAE,CAAC,CAACE,UAAU,CAACG,KAAK,CAAC;MAC7C;IACF;EACF,CAAC;EACDC,aAAaA,CAACN,QAAgB,EAAE;IAC9B,IAAI,CAACJ,KAAK,CAAC,GAAGI,QAAQ,EAAE,CAAC,CAACO,MAAM,CAAC,CAAC;EACpC,CAAC;EACDC,iBAAiBA,CAACR,QAAgB,EAAES,IAAa,EAAE;IACjD,OAAO,IAAI,CAACb,KAAK,CAAC,GAAGI,QAAQ,EAAE,CAAC,CAACQ,iBAAiB,CAACC,IAAI,CAAC;EAC1D,CAAC;EACDC,sBAAsBA,CAACV,QAAgB,EAAES,IAAa,EAAE;IACtD,OAAO,IAAIE,OAAO,CAAC,CAACC,OAAO,EAAEC,MAAM,KAAK;MACtC,MAAMC,MAAM,GAAG,IAAI,CAAClB,KAAK,CAAC,GAAGI,QAAQ,EAAE,CAAC,CAACQ,iBAAiB,CAACC,IAAI,CAAC;MAChE,IAAIK,MAAM,EAAE;QACVF,OAAO,CAACE,MAAM,CAAC;MACjB,CAAC,MAAM;QACLD,MAAM,CAAC,IAAIE,KAAK,CAAC,+BAA+B,CAAC,CAAC;MACpD;IACF,CAAC,CAAC;EACJ;AACF,CAAoB;;AAEpB;AACA,eAAe,CAAC,CAAC","ignoreList":[]}
|
@@ -1,7 +1,9 @@
|
|
1
|
+
import type { SkPicture } from "../skia/types";
|
1
2
|
import type { ISkiaViewApi } from "../views/types";
|
2
3
|
import type { SkiaPictureView } from "../views/SkiaPictureView.web";
|
3
4
|
export type ISkiaViewApiWeb = ISkiaViewApi & {
|
4
5
|
views: Record<string, SkiaPictureView>;
|
6
|
+
deferedPictures: Record<string, SkPicture>;
|
5
7
|
registerView(nativeId: string, view: SkiaPictureView): void;
|
6
8
|
};
|
7
9
|
declare const _default: {};
|
package/package.json
CHANGED
@@ -5,10 +5,10 @@
|
|
5
5
|
"provenance": true
|
6
6
|
},
|
7
7
|
"bin": {
|
8
|
-
"setup-skia-web": "
|
8
|
+
"setup-skia-web": "scripts/setup-canvaskit.js"
|
9
9
|
},
|
10
10
|
"title": "React Native Skia",
|
11
|
-
"version": "1.11.
|
11
|
+
"version": "1.11.18",
|
12
12
|
"description": "High-performance React Native Graphics using Skia",
|
13
13
|
"main": "lib/module/index.js",
|
14
14
|
"react-native": "src/index.ts",
|
@@ -76,8 +76,8 @@
|
|
76
76
|
"licenseFilename": "LICENSE.md",
|
77
77
|
"readmeFilename": "README.md",
|
78
78
|
"peerDependencies": {
|
79
|
-
"react": ">=18.0",
|
80
|
-
"react-native": ">=0.64",
|
79
|
+
"react": ">=18.0 <19.0.0",
|
80
|
+
"react-native": ">=0.64 <0.78.0",
|
81
81
|
"react-native-reanimated": ">=2.0.0"
|
82
82
|
},
|
83
83
|
"peerDependenciesMeta": {
|
@@ -91,6 +91,7 @@
|
|
91
91
|
"devDependencies": {
|
92
92
|
"@babel/plugin-proposal-nullish-coalescing-operator": "7.18.6",
|
93
93
|
"@semantic-release/commit-analyzer": "^13.0.0",
|
94
|
+
"@semantic-release/exec": "^7.0.3",
|
94
95
|
"@semantic-release/github": "^10.3.3",
|
95
96
|
"@semantic-release/release-notes-generator": "^14.0.1",
|
96
97
|
"@types/jest": "29.5.6",
|
@@ -1,23 +1,33 @@
|
|
1
1
|
/* eslint-disable import/no-anonymous-default-export */
|
2
|
-
import type { SkRect } from "../skia/types";
|
2
|
+
import type { SkPicture, SkRect } from "../skia/types";
|
3
3
|
import type { ISkiaViewApi } from "../views/types";
|
4
4
|
import type { SkiaPictureView } from "../views/SkiaPictureView.web";
|
5
5
|
|
6
6
|
export type ISkiaViewApiWeb = ISkiaViewApi & {
|
7
7
|
views: Record<string, SkiaPictureView>;
|
8
|
+
deferedPictures: Record<string, SkPicture>;
|
8
9
|
registerView(nativeId: string, view: SkiaPictureView): void;
|
9
10
|
};
|
10
11
|
|
11
12
|
global.SkiaViewApi = {
|
12
13
|
views: {},
|
14
|
+
deferedPictures: {},
|
13
15
|
web: true,
|
14
16
|
registerView(nativeId: string, view: SkiaPictureView) {
|
17
|
+
// Maybe a picture for this view was already set
|
18
|
+
if (this.deferedPictures[nativeId]) {
|
19
|
+
view.setPicture(this.deferedPictures[nativeId] as SkPicture);
|
20
|
+
}
|
15
21
|
this.views[nativeId] = view;
|
16
22
|
},
|
17
23
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
18
24
|
setJsiProperty(nativeId: number, name: string, value: any) {
|
19
25
|
if (name === "picture") {
|
20
|
-
this.views[`${nativeId}`]
|
26
|
+
if (!this.views[`${nativeId}`]) {
|
27
|
+
this.deferedPictures[`${nativeId}`] = value;
|
28
|
+
} else {
|
29
|
+
this.views[`${nativeId}`].setPicture(value);
|
30
|
+
}
|
21
31
|
}
|
22
32
|
},
|
23
33
|
requestRedraw(nativeId: number) {
|