react-grab 0.1.25 → 0.1.26
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 +11 -3
- package/dist/chunk-447CSJVY.js +26 -0
- package/dist/chunk-EMBZHHMN.js +101 -0
- package/dist/chunk-GGMYMQUS.cjs +101 -0
- package/dist/chunk-LCM4WNAK.cjs +26 -0
- package/dist/core/index.cjs +1 -1
- package/dist/core/index.d.cts +1 -1
- package/dist/core/index.d.ts +1 -1
- package/dist/core/index.js +1 -1
- package/dist/{index-BurXddDF.d.cts → index-CN8HkCli.d.cts} +2 -2
- package/dist/{index-BurXddDF.d.ts → index-CN8HkCli.d.ts} +2 -2
- package/dist/index.cjs +2 -2
- package/dist/index.d.cts +2 -2
- package/dist/index.d.ts +2 -2
- package/dist/index.global.js +37 -37
- package/dist/index.js +1 -1
- package/dist/primitives.cjs +2 -2
- package/dist/primitives.js +2 -2
- package/dist/styles.css +1 -1
- package/package.json +3 -13
- package/dist/chunk-2J7DC6YX.cjs +0 -101
- package/dist/chunk-3NX6LHF6.cjs +0 -26
- package/dist/chunk-MG2QQPFZ.js +0 -101
- package/dist/chunk-T6Z6IZX5.js +0 -26
- package/dist/react.cjs +0 -19239
- package/dist/react.d.cts +0 -345
- package/dist/react.d.ts +0 -345
- package/dist/react.js +0 -19225
package/README.md
CHANGED
|
@@ -217,9 +217,17 @@ Then, put this in your React app:
|
|
|
217
217
|
|
|
218
218
|
```tsx
|
|
219
219
|
import { useState } from "react";
|
|
220
|
-
import {
|
|
221
|
-
|
|
222
|
-
|
|
220
|
+
import {
|
|
221
|
+
getElementContext,
|
|
222
|
+
freeze,
|
|
223
|
+
unfreeze,
|
|
224
|
+
openFile,
|
|
225
|
+
type ReactGrabElementContext,
|
|
226
|
+
} from "react-grab/primitives";
|
|
227
|
+
|
|
228
|
+
const useElementSelector = (
|
|
229
|
+
onSelect: (context: ReactGrabElementContext) => void,
|
|
230
|
+
) => {
|
|
223
231
|
const [isActive, setIsActive] = useState(false);
|
|
224
232
|
|
|
225
233
|
const startSelecting = () => {
|