@pictor-sdk/ui 0.2.0 → 0.2.1
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/README.md +1 -1
- package/dist/index.js +6 -4
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +6 -4
- package/dist/index.mjs.map +1 -1
- package/package.json +4 -4
- package/src/gestures/LayerGestureSurface.tsx +7 -4
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@pictor-sdk/ui",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.1",
|
|
4
4
|
"description": "Default slot-based editor UI for Pictor, built entirely on the public headless API.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"sideEffects": false,
|
|
@@ -34,7 +34,7 @@
|
|
|
34
34
|
"react-native-reanimated": ">=3.16.0",
|
|
35
35
|
"react-native-worklets": ">=0.5.1",
|
|
36
36
|
"@pictor-sdk/core": "^0.2.0",
|
|
37
|
-
"@pictor-sdk/skia": "^0.2.
|
|
37
|
+
"@pictor-sdk/skia": "^0.2.1"
|
|
38
38
|
},
|
|
39
39
|
"devDependencies": {
|
|
40
40
|
"@shopify/react-native-skia": "^2.0.0",
|
|
@@ -44,8 +44,8 @@
|
|
|
44
44
|
"react-native-gesture-handler": "^2.28.0",
|
|
45
45
|
"react-native-reanimated": "^4.1.0",
|
|
46
46
|
"react-native-worklets": "0.5.1",
|
|
47
|
-
"@pictor-sdk/
|
|
48
|
-
"@pictor-sdk/
|
|
47
|
+
"@pictor-sdk/skia": "0.2.1",
|
|
48
|
+
"@pictor-sdk/core": "0.2.0"
|
|
49
49
|
},
|
|
50
50
|
"publishConfig": {
|
|
51
51
|
"access": "public",
|
|
@@ -73,10 +73,13 @@ export function LayerGestureSurface({ onSnap }: LayerGestureSurfaceProps) {
|
|
|
73
73
|
// Rebuild hit geometry when the renderer publishes a new text measurement,
|
|
74
74
|
// so a layer's touch box tracks the box it actually draws.
|
|
75
75
|
const [measureVersion, setMeasureVersion] = useState(0)
|
|
76
|
-
useEffect(
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
76
|
+
useEffect(() => {
|
|
77
|
+
const refresh = () => setMeasureVersion((v) => v + 1)
|
|
78
|
+
const unsubscribe = renderer.textMeasures.subscribe(refresh)
|
|
79
|
+
// The first scene may have committed before this passive effect subscribed.
|
|
80
|
+
refresh()
|
|
81
|
+
return unsubscribe
|
|
82
|
+
}, [renderer])
|
|
80
83
|
|
|
81
84
|
const hitCandidates = useMemo(
|
|
82
85
|
() =>
|