@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 CHANGED
@@ -8,7 +8,7 @@ photo and video editor SDK for React Native. Public APIs are pre-1.0 and experim
8
8
  ## Install
9
9
 
10
10
  ```sh
11
- pnpm add @pictor-sdk/ui@0.2.0
11
+ pnpm add @pictor-sdk/ui@0.2.1
12
12
  ```
13
13
 
14
14
  Install the package's declared peer dependencies in your app. Keep React, React Native,
package/dist/index.js CHANGED
@@ -810,10 +810,12 @@ function LayerGestureSurface({ onSnap }) {
810
810
  );
811
811
  const aspect = document.size.height / document.size.width;
812
812
  const [measureVersion, setMeasureVersion] = (0, import_react9.useState)(0);
813
- (0, import_react9.useEffect)(
814
- () => renderer.textMeasures.subscribe(() => setMeasureVersion((v) => v + 1)),
815
- [renderer]
816
- );
813
+ (0, import_react9.useEffect)(() => {
814
+ const refresh = () => setMeasureVersion((v) => v + 1);
815
+ const unsubscribe = renderer.textMeasures.subscribe(refresh);
816
+ refresh();
817
+ return unsubscribe;
818
+ }, [renderer]);
817
819
  const hitCandidates = (0, import_react9.useMemo)(
818
820
  () => document.layers.map((layer, index) => ({ layer, index })).filter(
819
821
  ({ layer, index }) => !layer.hidden && !layer.locked && (0, import_core8.isDirectManipulationLayer)(layer, index, profile.interaction?.layers)