expo-gl 15.1.2 → 15.1.4
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/CHANGELOG.md +8 -0
- package/android/build.gradle +2 -2
- package/build/Canvas.d.ts.map +1 -1
- package/build/Canvas.js +25 -22
- package/build/Canvas.js.map +1 -1
- package/expo-module.config.json +1 -1
- package/local-maven-repo/host/exp/exponent/expo.modules.gl/15.1.4/expo.modules.gl-15.1.4.aar +0 -0
- package/local-maven-repo/host/exp/exponent/expo.modules.gl/15.1.4/expo.modules.gl-15.1.4.aar.md5 +1 -0
- package/local-maven-repo/host/exp/exponent/expo.modules.gl/15.1.4/expo.modules.gl-15.1.4.aar.sha1 +1 -0
- package/local-maven-repo/host/exp/exponent/expo.modules.gl/15.1.4/expo.modules.gl-15.1.4.aar.sha256 +1 -0
- package/local-maven-repo/host/exp/exponent/expo.modules.gl/15.1.4/expo.modules.gl-15.1.4.aar.sha512 +1 -0
- package/local-maven-repo/host/exp/exponent/expo.modules.gl/{15.1.2/expo.modules.gl-15.1.2.module → 15.1.4/expo.modules.gl-15.1.4.module} +17 -17
- package/local-maven-repo/host/exp/exponent/expo.modules.gl/15.1.4/expo.modules.gl-15.1.4.module.md5 +1 -0
- package/local-maven-repo/host/exp/exponent/expo.modules.gl/15.1.4/expo.modules.gl-15.1.4.module.sha1 +1 -0
- package/local-maven-repo/host/exp/exponent/expo.modules.gl/15.1.4/expo.modules.gl-15.1.4.module.sha256 +1 -0
- package/local-maven-repo/host/exp/exponent/expo.modules.gl/15.1.4/expo.modules.gl-15.1.4.module.sha512 +1 -0
- package/local-maven-repo/host/exp/exponent/expo.modules.gl/{15.1.2/expo.modules.gl-15.1.2.pom → 15.1.4/expo.modules.gl-15.1.4.pom} +1 -1
- package/local-maven-repo/host/exp/exponent/expo.modules.gl/15.1.4/expo.modules.gl-15.1.4.pom.md5 +1 -0
- package/local-maven-repo/host/exp/exponent/expo.modules.gl/15.1.4/expo.modules.gl-15.1.4.pom.sha1 +1 -0
- package/local-maven-repo/host/exp/exponent/expo.modules.gl/15.1.4/expo.modules.gl-15.1.4.pom.sha256 +1 -0
- package/local-maven-repo/host/exp/exponent/expo.modules.gl/15.1.4/expo.modules.gl-15.1.4.pom.sha512 +1 -0
- package/local-maven-repo/host/exp/exponent/expo.modules.gl/maven-metadata.xml +4 -4
- package/local-maven-repo/host/exp/exponent/expo.modules.gl/maven-metadata.xml.md5 +1 -1
- package/local-maven-repo/host/exp/exponent/expo.modules.gl/maven-metadata.xml.sha1 +1 -1
- package/local-maven-repo/host/exp/exponent/expo.modules.gl/maven-metadata.xml.sha256 +1 -1
- package/local-maven-repo/host/exp/exponent/expo.modules.gl/maven-metadata.xml.sha512 +1 -1
- package/package.json +3 -3
- package/src/Canvas.tsx +51 -35
- package/local-maven-repo/host/exp/exponent/expo.modules.gl/15.1.2/expo.modules.gl-15.1.2.aar +0 -0
- package/local-maven-repo/host/exp/exponent/expo.modules.gl/15.1.2/expo.modules.gl-15.1.2.aar.md5 +0 -1
- package/local-maven-repo/host/exp/exponent/expo.modules.gl/15.1.2/expo.modules.gl-15.1.2.aar.sha1 +0 -1
- package/local-maven-repo/host/exp/exponent/expo.modules.gl/15.1.2/expo.modules.gl-15.1.2.aar.sha256 +0 -1
- package/local-maven-repo/host/exp/exponent/expo.modules.gl/15.1.2/expo.modules.gl-15.1.2.aar.sha512 +0 -1
- package/local-maven-repo/host/exp/exponent/expo.modules.gl/15.1.2/expo.modules.gl-15.1.2.module.md5 +0 -1
- package/local-maven-repo/host/exp/exponent/expo.modules.gl/15.1.2/expo.modules.gl-15.1.2.module.sha1 +0 -1
- package/local-maven-repo/host/exp/exponent/expo.modules.gl/15.1.2/expo.modules.gl-15.1.2.module.sha256 +0 -1
- package/local-maven-repo/host/exp/exponent/expo.modules.gl/15.1.2/expo.modules.gl-15.1.2.module.sha512 +0 -1
- package/local-maven-repo/host/exp/exponent/expo.modules.gl/15.1.2/expo.modules.gl-15.1.2.pom.md5 +0 -1
- package/local-maven-repo/host/exp/exponent/expo.modules.gl/15.1.2/expo.modules.gl-15.1.2.pom.sha1 +0 -1
- package/local-maven-repo/host/exp/exponent/expo.modules.gl/15.1.2/expo.modules.gl-15.1.2.pom.sha256 +0 -1
- package/local-maven-repo/host/exp/exponent/expo.modules.gl/15.1.2/expo.modules.gl-15.1.2.pom.sha512 +0 -1
- /package/local-maven-repo/host/exp/exponent/expo.modules.gl/{15.1.2/expo.modules.gl-15.1.2-sources.jar → 15.1.4/expo.modules.gl-15.1.4-sources.jar} +0 -0
- /package/local-maven-repo/host/exp/exponent/expo.modules.gl/{15.1.2/expo.modules.gl-15.1.2-sources.jar.md5 → 15.1.4/expo.modules.gl-15.1.4-sources.jar.md5} +0 -0
- /package/local-maven-repo/host/exp/exponent/expo.modules.gl/{15.1.2/expo.modules.gl-15.1.2-sources.jar.sha1 → 15.1.4/expo.modules.gl-15.1.4-sources.jar.sha1} +0 -0
- /package/local-maven-repo/host/exp/exponent/expo.modules.gl/{15.1.2/expo.modules.gl-15.1.2-sources.jar.sha256 → 15.1.4/expo.modules.gl-15.1.4-sources.jar.sha256} +0 -0
- /package/local-maven-repo/host/exp/exponent/expo.modules.gl/{15.1.2/expo.modules.gl-15.1.2-sources.jar.sha512 → 15.1.4/expo.modules.gl-15.1.4-sources.jar.sha512} +0 -0
package/CHANGELOG.md
CHANGED
|
@@ -10,6 +10,14 @@
|
|
|
10
10
|
|
|
11
11
|
### 💡 Others
|
|
12
12
|
|
|
13
|
+
## 15.1.4 — 2025-04-25
|
|
14
|
+
|
|
15
|
+
_This version does not introduce any user-facing changes._
|
|
16
|
+
|
|
17
|
+
## 15.1.3 — 2025-04-21
|
|
18
|
+
|
|
19
|
+
_This version does not introduce any user-facing changes._
|
|
20
|
+
|
|
13
21
|
## 15.1.2 — 2025-04-14
|
|
14
22
|
|
|
15
23
|
_This version does not introduce any user-facing changes._
|
package/android/build.gradle
CHANGED
|
@@ -9,7 +9,7 @@ def reactNativeArchitectures() {
|
|
|
9
9
|
}
|
|
10
10
|
|
|
11
11
|
group = 'host.exp.exponent'
|
|
12
|
-
version = '15.1.
|
|
12
|
+
version = '15.1.4'
|
|
13
13
|
|
|
14
14
|
android {
|
|
15
15
|
if (rootProject.hasProperty("ndkPath")) {
|
|
@@ -22,7 +22,7 @@ android {
|
|
|
22
22
|
namespace "expo.modules.gl"
|
|
23
23
|
defaultConfig {
|
|
24
24
|
versionCode 31
|
|
25
|
-
versionName "15.1.
|
|
25
|
+
versionName "15.1.4"
|
|
26
26
|
|
|
27
27
|
externalNativeBuild {
|
|
28
28
|
cmake {
|
package/build/Canvas.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Canvas.d.ts","sourceRoot":"","sources":["../src/Canvas.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAE/B,OAAO,EAAmD,SAAS,EAAE,MAAM,cAAc,CAAC;
|
|
1
|
+
{"version":3,"file":"Canvas.d.ts","sourceRoot":"","sources":["../src/Canvas.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAE/B,OAAO,EAAmD,SAAS,EAAE,MAAM,cAAc,CAAC;AAgD1F,QAAA,MAAM,aAAa,EAAE,KAAK,CAAC,iBAAiB,CAC1C,SAAS,GAAG;IACV,SAAS,EAAE,KAAK,CAAC,GAAG,CAAC,iBAAiB,CAAC,CAAC;CACzC,CAmEF,CAAC;AAQF,eAAe,aAAa,CAAC"}
|
package/build/Canvas.js
CHANGED
|
@@ -21,45 +21,48 @@ function setRef(refProp, ref) {
|
|
|
21
21
|
refProp.current = ref;
|
|
22
22
|
}
|
|
23
23
|
}
|
|
24
|
+
function getSize({ size, ref }) {
|
|
25
|
+
if (size) {
|
|
26
|
+
return size;
|
|
27
|
+
}
|
|
28
|
+
else if (!ref.current || typeof window === 'undefined') {
|
|
29
|
+
return { width: 0, height: 0 };
|
|
30
|
+
}
|
|
31
|
+
const element = getElement(ref.current);
|
|
32
|
+
const { offsetWidth: width = 0, offsetHeight: height = 0 } = element;
|
|
33
|
+
return { width, height };
|
|
34
|
+
}
|
|
24
35
|
const Canvas = React.forwardRef((props, ref) => createElement('canvas', { ...props, ref }));
|
|
25
36
|
const CanvasWrapper = ({ pointerEvents, children, style, ...props }) => {
|
|
26
37
|
const [size, setSize] = React.useState(null);
|
|
27
38
|
const ref = React.useRef(null);
|
|
28
39
|
const _canvasRef = React.useRef(null);
|
|
29
|
-
|
|
40
|
+
const updateCanvasSize = React.useCallback(() => {
|
|
30
41
|
const canvas = _canvasRef.current;
|
|
31
42
|
if (typeof HTMLCanvasElement !== 'undefined' && canvas instanceof HTMLCanvasElement) {
|
|
32
|
-
const
|
|
43
|
+
const currentSize = getSize({
|
|
44
|
+
size,
|
|
45
|
+
ref,
|
|
46
|
+
});
|
|
33
47
|
const scale = PixelRatio.get();
|
|
34
|
-
canvas.style.width = `${
|
|
35
|
-
canvas.style.height = `${
|
|
36
|
-
canvas.width =
|
|
37
|
-
canvas.height =
|
|
48
|
+
canvas.style.width = `${currentSize.width}px`;
|
|
49
|
+
canvas.style.height = `${currentSize.height}px`;
|
|
50
|
+
canvas.width = currentSize.width * scale;
|
|
51
|
+
canvas.height = currentSize.height * scale;
|
|
38
52
|
}
|
|
39
|
-
}
|
|
40
|
-
|
|
41
|
-
if (size) {
|
|
42
|
-
return size;
|
|
43
|
-
}
|
|
44
|
-
else if (!ref.current || typeof window === 'undefined') {
|
|
45
|
-
return { width: 0, height: 0 };
|
|
46
|
-
}
|
|
47
|
-
const element = getElement(ref.current);
|
|
48
|
-
const { offsetWidth: width = 0, offsetHeight: height = 0 } = element;
|
|
49
|
-
return { width, height };
|
|
50
|
-
}
|
|
51
|
-
const onLayout = (event) => {
|
|
53
|
+
}, [size?.width, size?.height]);
|
|
54
|
+
const onLayout = React.useCallback((event) => {
|
|
52
55
|
const { nativeEvent: { layout: { width, height }, }, } = event;
|
|
53
|
-
if (width !== size?.width || height !== size
|
|
56
|
+
if (width !== size?.width || height !== size?.height) {
|
|
54
57
|
setSize({ width, height });
|
|
55
58
|
if (props.onLayout) {
|
|
56
59
|
props.onLayout(event);
|
|
57
60
|
}
|
|
58
61
|
}
|
|
59
|
-
};
|
|
62
|
+
}, [size?.width, size?.height, props.onLayout]);
|
|
60
63
|
React.useEffect(() => {
|
|
61
64
|
if (ref.current != null) {
|
|
62
|
-
setSize(getSize());
|
|
65
|
+
setSize(getSize({ size, ref }));
|
|
63
66
|
}
|
|
64
67
|
}, [ref]);
|
|
65
68
|
React.useEffect(() => {
|
package/build/Canvas.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Canvas.js","sourceRoot":"","sources":["../src/Canvas.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,EAAE,WAAW,EAAE,MAAM,WAAW,CAAC;AACxC,OAAO,EAAqB,UAAU,EAAE,UAAU,EAAE,IAAI,EAAa,MAAM,cAAc,CAAC;AAC1F,OAAO,aAAa,MAAM,6CAA6C,CAAC;
|
|
1
|
+
{"version":3,"file":"Canvas.js","sourceRoot":"","sources":["../src/Canvas.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,EAAE,WAAW,EAAE,MAAM,WAAW,CAAC;AACxC,OAAO,EAAqB,UAAU,EAAE,UAAU,EAAE,IAAI,EAAa,MAAM,cAAc,CAAC;AAC1F,OAAO,aAAa,MAAM,6CAA6C,CAAC;AAYxE,SAAS,UAAU,CAAC,SAA8B;IAChD,IAAI,CAAC;QACH,OAAO,WAAW,CAAC,SAAS,CAAC,CAAC;IAChC,CAAC;IAAC,MAAM,CAAC;QACP,OAAO,SAAS,CAAC;IACnB,CAAC;AACH,CAAC;AAED,SAAS,MAAM,CAAI,OAAqB,EAAE,GAAa;IACrD,IAAI,CAAC,OAAO;QAAE,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","sourcesContent":["import * as React from 'react';\nimport { findDOMNode } from 'react-dom';\nimport { LayoutChangeEvent, PixelRatio, StyleSheet, View, ViewProps } from 'react-native';\nimport createElement from 'react-native-web/dist/exports/createElement';\n\ninterface Size {\n width: number;\n height: number;\n}\n\ninterface GetSizeParams {\n size: Size | null;\n ref: React.RefObject<View | null>;\n}\n\nfunction getElement(component: React.ReactInstance): React.ReactInstance | Element | null | Text {\n try {\n return findDOMNode(component);\n } catch {\n return component;\n }\n}\n\nfunction setRef<T>(refProp: React.Ref<T>, ref: T | null) {\n if (!refProp) return;\n\n if (typeof refProp === 'function') {\n refProp(ref);\n } else if ('current' in refProp) {\n // @ts-ignore\n refProp.current = ref;\n }\n}\n\nfunction getSize({ size, ref }: GetSizeParams): Size {\n if (size) {\n return size;\n } else if (!ref.current || typeof window === 'undefined') {\n return { width: 0, height: 0 };\n }\n const element = getElement(ref.current);\n const { offsetWidth: width = 0, offsetHeight: height = 0 } = element as HTMLElement;\n return { width, height };\n}\n\nconst Canvas = React.forwardRef(\n (props: React.ComponentProps<typeof View>, ref: React.Ref<HTMLCanvasElement>) =>\n createElement('canvas', { ...props, ref })\n);\n\nconst CanvasWrapper: React.FunctionComponent<\n ViewProps & {\n canvasRef: React.Ref<HTMLCanvasElement>;\n }\n> = ({ pointerEvents, children, style, ...props }) => {\n const [size, setSize] = React.useState<Size | null>(null);\n\n const ref = React.useRef<View>(null);\n const _canvasRef = React.useRef<HTMLCanvasElement>(null);\n\n const updateCanvasSize = React.useCallback(() => {\n const canvas = _canvasRef.current;\n if (typeof HTMLCanvasElement !== 'undefined' && canvas instanceof HTMLCanvasElement) {\n const currentSize = getSize({\n size,\n ref,\n });\n const scale = PixelRatio.get();\n\n canvas.style.width = `${currentSize.width}px`;\n canvas.style.height = `${currentSize.height}px`;\n\n canvas.width = currentSize.width * scale;\n canvas.height = currentSize.height * scale;\n }\n }, [size?.width, size?.height]);\n\n const onLayout = React.useCallback(\n (event: LayoutChangeEvent) => {\n const {\n nativeEvent: {\n layout: { width, height },\n },\n } = event;\n\n if (width !== size?.width || height !== size?.height) {\n setSize({ width, height });\n\n if (props.onLayout) {\n props.onLayout(event);\n }\n }\n },\n [size?.width, size?.height, props.onLayout]\n );\n\n React.useEffect(() => {\n if (ref.current != null) {\n setSize(getSize({ size, ref }));\n }\n }, [ref]);\n\n React.useEffect(() => {\n updateCanvasSize();\n }, [size]);\n\n React.useEffect(() => {\n const canvas = _canvasRef.current;\n if (canvas) {\n updateCanvasSize();\n }\n setRef(props.canvasRef, canvas);\n }, [_canvasRef]);\n\n return (\n <View {...props} style={[styles.wrapper, style]} ref={ref} onLayout={onLayout}>\n <Canvas ref={_canvasRef} pointerEvents={pointerEvents} style={StyleSheet.absoluteFill} />\n {children}\n </View>\n );\n};\n\nconst styles = StyleSheet.create({\n wrapper: {\n pointerEvents: 'box-none',\n },\n});\n\nexport default CanvasWrapper;\n"]}
|
package/expo-module.config.json
CHANGED
|
Binary file
|
package/local-maven-repo/host/exp/exponent/expo.modules.gl/15.1.4/expo.modules.gl-15.1.4.aar.md5
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
6af6372bf2b5d9ea9227fbd0a61f63fb
|
package/local-maven-repo/host/exp/exponent/expo.modules.gl/15.1.4/expo.modules.gl-15.1.4.aar.sha1
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
5a6984fd505eea39466cc712b96ba496dd0d971f
|
package/local-maven-repo/host/exp/exponent/expo.modules.gl/15.1.4/expo.modules.gl-15.1.4.aar.sha256
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
ee7a402caaed9e705e0b231695992e58cc1b9a13c205745fc9754732542ac4d1
|
package/local-maven-repo/host/exp/exponent/expo.modules.gl/15.1.4/expo.modules.gl-15.1.4.aar.sha512
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
18e2f80fbf4225810cb66b18dd1e462c9a23c5f510018bd9a760c660a0c0d8b24a972971682a078b2a18a7caebb070239547dd2126e44ba2ff65d15bf55f5886
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
"component": {
|
|
4
4
|
"group": "host.exp.exponent",
|
|
5
5
|
"module": "expo.modules.gl",
|
|
6
|
-
"version": "15.1.
|
|
6
|
+
"version": "15.1.4",
|
|
7
7
|
"attributes": {
|
|
8
8
|
"org.gradle.status": "release"
|
|
9
9
|
}
|
|
@@ -24,13 +24,13 @@
|
|
|
24
24
|
},
|
|
25
25
|
"files": [
|
|
26
26
|
{
|
|
27
|
-
"name": "expo.modules.gl-15.1.
|
|
28
|
-
"url": "expo.modules.gl-15.1.
|
|
29
|
-
"size":
|
|
30
|
-
"sha512": "
|
|
31
|
-
"sha256": "
|
|
32
|
-
"sha1": "
|
|
33
|
-
"md5": "
|
|
27
|
+
"name": "expo.modules.gl-15.1.4.aar",
|
|
28
|
+
"url": "expo.modules.gl-15.1.4.aar",
|
|
29
|
+
"size": 1044169,
|
|
30
|
+
"sha512": "18e2f80fbf4225810cb66b18dd1e462c9a23c5f510018bd9a760c660a0c0d8b24a972971682a078b2a18a7caebb070239547dd2126e44ba2ff65d15bf55f5886",
|
|
31
|
+
"sha256": "ee7a402caaed9e705e0b231695992e58cc1b9a13c205745fc9754732542ac4d1",
|
|
32
|
+
"sha1": "5a6984fd505eea39466cc712b96ba496dd0d971f",
|
|
33
|
+
"md5": "6af6372bf2b5d9ea9227fbd0a61f63fb"
|
|
34
34
|
}
|
|
35
35
|
]
|
|
36
36
|
},
|
|
@@ -53,13 +53,13 @@
|
|
|
53
53
|
],
|
|
54
54
|
"files": [
|
|
55
55
|
{
|
|
56
|
-
"name": "expo.modules.gl-15.1.
|
|
57
|
-
"url": "expo.modules.gl-15.1.
|
|
58
|
-
"size":
|
|
59
|
-
"sha512": "
|
|
60
|
-
"sha256": "
|
|
61
|
-
"sha1": "
|
|
62
|
-
"md5": "
|
|
56
|
+
"name": "expo.modules.gl-15.1.4.aar",
|
|
57
|
+
"url": "expo.modules.gl-15.1.4.aar",
|
|
58
|
+
"size": 1044169,
|
|
59
|
+
"sha512": "18e2f80fbf4225810cb66b18dd1e462c9a23c5f510018bd9a760c660a0c0d8b24a972971682a078b2a18a7caebb070239547dd2126e44ba2ff65d15bf55f5886",
|
|
60
|
+
"sha256": "ee7a402caaed9e705e0b231695992e58cc1b9a13c205745fc9754732542ac4d1",
|
|
61
|
+
"sha1": "5a6984fd505eea39466cc712b96ba496dd0d971f",
|
|
62
|
+
"md5": "6af6372bf2b5d9ea9227fbd0a61f63fb"
|
|
63
63
|
}
|
|
64
64
|
]
|
|
65
65
|
},
|
|
@@ -73,8 +73,8 @@
|
|
|
73
73
|
},
|
|
74
74
|
"files": [
|
|
75
75
|
{
|
|
76
|
-
"name": "expo.modules.gl-15.1.
|
|
77
|
-
"url": "expo.modules.gl-15.1.
|
|
76
|
+
"name": "expo.modules.gl-15.1.4-sources.jar",
|
|
77
|
+
"url": "expo.modules.gl-15.1.4-sources.jar",
|
|
78
78
|
"size": 12381,
|
|
79
79
|
"sha512": "1cab724074b050f7459a884ac9e98fbf2d009d8239810ca6384c5113f52dd33e5ac40a72ec7174b297e1b10521e56682d73f533715316be5be66ce0e482356d8",
|
|
80
80
|
"sha256": "e8892c6837d1eb5093b2c3b063883d7511799b0e246940c5b70f1515cb4451cd",
|
package/local-maven-repo/host/exp/exponent/expo.modules.gl/15.1.4/expo.modules.gl-15.1.4.module.md5
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
0df8376a3ca879fbb44caf3a24737bf0
|
package/local-maven-repo/host/exp/exponent/expo.modules.gl/15.1.4/expo.modules.gl-15.1.4.module.sha1
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
cb91905b40d81fe170b4c6a307b3653a3744c060
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
4052465f1b77c1815176d8444245c3d7a9bec3e5cdf3c2d255a9b4a231b8109f
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
ba807448b0a25de618d328f06fc2ef66999a744d601e88a3bef6cc5cf7a71da64bc6f57903864d17be2a0f20a153c282ceb2589470b14a71745e2bed582bd302
|
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
<modelVersion>4.0.0</modelVersion>
|
|
10
10
|
<groupId>host.exp.exponent</groupId>
|
|
11
11
|
<artifactId>expo.modules.gl</artifactId>
|
|
12
|
-
<version>15.1.
|
|
12
|
+
<version>15.1.4</version>
|
|
13
13
|
<packaging>aar</packaging>
|
|
14
14
|
<name>expo.modules.gl</name>
|
|
15
15
|
<url>https://github.com/expo/expo</url>
|
package/local-maven-repo/host/exp/exponent/expo.modules.gl/15.1.4/expo.modules.gl-15.1.4.pom.md5
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
89fcdbe99b326e1f11dee8b080e39662
|
package/local-maven-repo/host/exp/exponent/expo.modules.gl/15.1.4/expo.modules.gl-15.1.4.pom.sha1
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
2eb1d810df17c75455e815a5697d3aa894c91223
|
package/local-maven-repo/host/exp/exponent/expo.modules.gl/15.1.4/expo.modules.gl-15.1.4.pom.sha256
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
7f7435bc616d373f289af72a5e2f74b57b25bdffb034a7a65bb872218cc8045c
|
package/local-maven-repo/host/exp/exponent/expo.modules.gl/15.1.4/expo.modules.gl-15.1.4.pom.sha512
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
8fd3e52b583b6da27115bd59a43c5fe9281afb2f328887630f44e1c5667c7c9ba788482b220622f7447fd431f2ef2edf48cf931f9f1b92d376f6d02e2a823fc3
|
|
@@ -3,11 +3,11 @@
|
|
|
3
3
|
<groupId>host.exp.exponent</groupId>
|
|
4
4
|
<artifactId>expo.modules.gl</artifactId>
|
|
5
5
|
<versioning>
|
|
6
|
-
<latest>15.1.
|
|
7
|
-
<release>15.1.
|
|
6
|
+
<latest>15.1.4</latest>
|
|
7
|
+
<release>15.1.4</release>
|
|
8
8
|
<versions>
|
|
9
|
-
<version>15.1.
|
|
9
|
+
<version>15.1.4</version>
|
|
10
10
|
</versions>
|
|
11
|
-
<lastUpdated>
|
|
11
|
+
<lastUpdated>20250425210750</lastUpdated>
|
|
12
12
|
</versioning>
|
|
13
13
|
</metadata>
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
1b9210c163a2241ff4f6baed9d33fee0
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
53e34d49bfd57b6dc493121fff0d2daff7e629e3
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
c77e14c1ea8ce2ad9f38c50619f75f5254ee0cfe18a5720a5e972a18a06caeb2
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
215f41d473752c30f56692a1c45ce1945467cfdb586e982482e39a783aee611b36a5dc0ba3a2a384026f4eedf1ce587cee0033f507d612fc0fbb5cd45b4d3f9f
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "expo-gl",
|
|
3
|
-
"version": "15.1.
|
|
3
|
+
"version": "15.1.4",
|
|
4
4
|
"description": "Provides GLView that acts as OpenGL ES render target and gives GL context object implementing WebGL 2.0 specification.",
|
|
5
5
|
"main": "build/index.js",
|
|
6
6
|
"types": "build/index.d.ts",
|
|
@@ -43,7 +43,7 @@
|
|
|
43
43
|
"@types/invariant": "^2.2.33",
|
|
44
44
|
"@types/offscreencanvas": "2019.6.4",
|
|
45
45
|
"@types/webgl2": "^0.0.6",
|
|
46
|
-
"expo-module-scripts": "^4.1.
|
|
46
|
+
"expo-module-scripts": "^4.1.5",
|
|
47
47
|
"react-test-renderer": "19.0.0"
|
|
48
48
|
},
|
|
49
49
|
"peerDependencies": {
|
|
@@ -57,5 +57,5 @@
|
|
|
57
57
|
"optional": true
|
|
58
58
|
}
|
|
59
59
|
},
|
|
60
|
-
"gitHead": "
|
|
60
|
+
"gitHead": "3cd208465df78e385ca9380531bbbfe33ca68e81"
|
|
61
61
|
}
|
package/src/Canvas.tsx
CHANGED
|
@@ -3,6 +3,16 @@ import { findDOMNode } from 'react-dom';
|
|
|
3
3
|
import { LayoutChangeEvent, PixelRatio, StyleSheet, View, ViewProps } from 'react-native';
|
|
4
4
|
import createElement from 'react-native-web/dist/exports/createElement';
|
|
5
5
|
|
|
6
|
+
interface Size {
|
|
7
|
+
width: number;
|
|
8
|
+
height: number;
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
interface GetSizeParams {
|
|
12
|
+
size: Size | null;
|
|
13
|
+
ref: React.RefObject<View | null>;
|
|
14
|
+
}
|
|
15
|
+
|
|
6
16
|
function getElement(component: React.ReactInstance): React.ReactInstance | Element | null | Text {
|
|
7
17
|
try {
|
|
8
18
|
return findDOMNode(component);
|
|
@@ -22,6 +32,17 @@ function setRef<T>(refProp: React.Ref<T>, ref: T | null) {
|
|
|
22
32
|
}
|
|
23
33
|
}
|
|
24
34
|
|
|
35
|
+
function getSize({ size, ref }: GetSizeParams): Size {
|
|
36
|
+
if (size) {
|
|
37
|
+
return size;
|
|
38
|
+
} else if (!ref.current || typeof window === 'undefined') {
|
|
39
|
+
return { width: 0, height: 0 };
|
|
40
|
+
}
|
|
41
|
+
const element = getElement(ref.current);
|
|
42
|
+
const { offsetWidth: width = 0, offsetHeight: height = 0 } = element as HTMLElement;
|
|
43
|
+
return { width, height };
|
|
44
|
+
}
|
|
45
|
+
|
|
25
46
|
const Canvas = React.forwardRef(
|
|
26
47
|
(props: React.ComponentProps<typeof View>, ref: React.Ref<HTMLCanvasElement>) =>
|
|
27
48
|
createElement('canvas', { ...props, ref })
|
|
@@ -32,55 +53,50 @@ const CanvasWrapper: React.FunctionComponent<
|
|
|
32
53
|
canvasRef: React.Ref<HTMLCanvasElement>;
|
|
33
54
|
}
|
|
34
55
|
> = ({ pointerEvents, children, style, ...props }) => {
|
|
35
|
-
const [size, setSize] = React.useState<
|
|
56
|
+
const [size, setSize] = React.useState<Size | null>(null);
|
|
36
57
|
|
|
37
58
|
const ref = React.useRef<View>(null);
|
|
38
59
|
const _canvasRef = React.useRef<HTMLCanvasElement>(null);
|
|
39
60
|
|
|
40
|
-
|
|
61
|
+
const updateCanvasSize = React.useCallback(() => {
|
|
41
62
|
const canvas = _canvasRef.current;
|
|
42
63
|
if (typeof HTMLCanvasElement !== 'undefined' && canvas instanceof HTMLCanvasElement) {
|
|
43
|
-
const
|
|
64
|
+
const currentSize = getSize({
|
|
65
|
+
size,
|
|
66
|
+
ref,
|
|
67
|
+
});
|
|
44
68
|
const scale = PixelRatio.get();
|
|
45
69
|
|
|
46
|
-
canvas.style.width = `${
|
|
47
|
-
canvas.style.height = `${
|
|
48
|
-
|
|
49
|
-
canvas.width = size.width * scale;
|
|
50
|
-
canvas.height = size.height * scale;
|
|
51
|
-
}
|
|
52
|
-
}
|
|
70
|
+
canvas.style.width = `${currentSize.width}px`;
|
|
71
|
+
canvas.style.height = `${currentSize.height}px`;
|
|
53
72
|
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
return size;
|
|
57
|
-
} else if (!ref.current || typeof window === 'undefined') {
|
|
58
|
-
return { width: 0, height: 0 };
|
|
73
|
+
canvas.width = currentSize.width * scale;
|
|
74
|
+
canvas.height = currentSize.height * scale;
|
|
59
75
|
}
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
props.onLayout(event);
|
|
76
|
+
}, [size?.width, size?.height]);
|
|
77
|
+
|
|
78
|
+
const onLayout = React.useCallback(
|
|
79
|
+
(event: LayoutChangeEvent) => {
|
|
80
|
+
const {
|
|
81
|
+
nativeEvent: {
|
|
82
|
+
layout: { width, height },
|
|
83
|
+
},
|
|
84
|
+
} = event;
|
|
85
|
+
|
|
86
|
+
if (width !== size?.width || height !== size?.height) {
|
|
87
|
+
setSize({ width, height });
|
|
88
|
+
|
|
89
|
+
if (props.onLayout) {
|
|
90
|
+
props.onLayout(event);
|
|
91
|
+
}
|
|
77
92
|
}
|
|
78
|
-
}
|
|
79
|
-
|
|
93
|
+
},
|
|
94
|
+
[size?.width, size?.height, props.onLayout]
|
|
95
|
+
);
|
|
80
96
|
|
|
81
97
|
React.useEffect(() => {
|
|
82
98
|
if (ref.current != null) {
|
|
83
|
-
setSize(getSize());
|
|
99
|
+
setSize(getSize({ size, ref }));
|
|
84
100
|
}
|
|
85
101
|
}, [ref]);
|
|
86
102
|
|
package/local-maven-repo/host/exp/exponent/expo.modules.gl/15.1.2/expo.modules.gl-15.1.2.aar
DELETED
|
Binary file
|
package/local-maven-repo/host/exp/exponent/expo.modules.gl/15.1.2/expo.modules.gl-15.1.2.aar.md5
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
abbfb2cd09e7dc57d480c0d623e7fe90
|
package/local-maven-repo/host/exp/exponent/expo.modules.gl/15.1.2/expo.modules.gl-15.1.2.aar.sha1
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
38f6d9e29f69a67ff7f07c60b7579c8215210c96
|
package/local-maven-repo/host/exp/exponent/expo.modules.gl/15.1.2/expo.modules.gl-15.1.2.aar.sha256
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
6d8b8667da77b17356443b62170d2e4be9ecc56ab3d134456bb93334d0ea6584
|
package/local-maven-repo/host/exp/exponent/expo.modules.gl/15.1.2/expo.modules.gl-15.1.2.aar.sha512
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
f91f6be8c66741bf857a39bfbbe858f34193ba0eb1cf2f00e0b48734bb5b2d7c43d2bfb5a6cffac2b01c28d3c958dbd6549334ff11e122dd9ed80bb5b75a7194
|
package/local-maven-repo/host/exp/exponent/expo.modules.gl/15.1.2/expo.modules.gl-15.1.2.module.md5
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
29e561f8ebb945a330ee02c0a75c2737
|
package/local-maven-repo/host/exp/exponent/expo.modules.gl/15.1.2/expo.modules.gl-15.1.2.module.sha1
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
444fa02a8e892d377e3d4bcd9b0692974fc7804d
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
c446f7e365c70ba89cce0e41dc7a9fd23fdcbf2ac36c5d1abe787c4d80b21009
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
e53ac2d909f8d988faff892e026efc28617a2a3c8b9793c96cc81ca123bfee09abfd35e2a98ef88bd20de7d6c1fe534bba75bbeeb4122d98ee28686ea2c5ae67
|
package/local-maven-repo/host/exp/exponent/expo.modules.gl/15.1.2/expo.modules.gl-15.1.2.pom.md5
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
03d7e62564cefcfe24b0aed8cbf9718f
|
package/local-maven-repo/host/exp/exponent/expo.modules.gl/15.1.2/expo.modules.gl-15.1.2.pom.sha1
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
8baf6165b52b9bfceec96d084732e5f7833e45b2
|
package/local-maven-repo/host/exp/exponent/expo.modules.gl/15.1.2/expo.modules.gl-15.1.2.pom.sha256
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
7693fbe2a0ade6abefe8c4fd3e5fa5ad7011cf3fc24f5d1bae987f5affaf5087
|
package/local-maven-repo/host/exp/exponent/expo.modules.gl/15.1.2/expo.modules.gl-15.1.2.pom.sha512
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
0eae926ad3cdc9e01377942b26957dab2c772c032bf4f027877606ac9e8cfb78bb18a036ecb3861e6b6385f59284c041a7f0b840e7d5216f8f0edb59bdb80ced
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|