react-grab 0.0.74 → 0.0.76
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/{chunk-ZK4APTZS.js → chunk-FZG56F6B.js} +18 -11
- package/dist/{chunk-DV467MQN.cjs → chunk-IKBHXHKY.cjs} +18 -11
- package/dist/cli.cjs +273 -0
- package/dist/core.cjs +7 -7
- package/dist/core.js +1 -1
- package/dist/index.cjs +8 -8
- package/dist/index.global.js +4 -4
- package/dist/index.js +2 -2
- package/package.json +6 -3
package/README.md
CHANGED
|
@@ -19,7 +19,7 @@ https://github.com/user-attachments/assets/fdb34329-b471-4b39-b433-0b1a27a94bd8
|
|
|
19
19
|
Run this command to install React Grab into your project. Ensure you are running at project root (e.g. where the `next.config.ts` or `vite.config.ts` file is located).
|
|
20
20
|
|
|
21
21
|
```html
|
|
22
|
-
npx
|
|
22
|
+
npx react-grab@latest init
|
|
23
23
|
```
|
|
24
24
|
|
|
25
25
|
## Manual Installation
|
|
@@ -1078,7 +1078,7 @@ var buildOpenFileUrl = (filePath, lineNumber) => {
|
|
|
1078
1078
|
};
|
|
1079
1079
|
|
|
1080
1080
|
// src/constants.ts
|
|
1081
|
-
var VERSION = "0.0.
|
|
1081
|
+
var VERSION = "0.0.76";
|
|
1082
1082
|
var VIEWPORT_MARGIN_PX = 8;
|
|
1083
1083
|
var OFFSCREEN_POSITION = -1e3;
|
|
1084
1084
|
var SELECTION_LERP_FACTOR = 0.95;
|
|
@@ -4059,14 +4059,10 @@ var BottomSection = (props) => (() => {
|
|
|
4059
4059
|
})();
|
|
4060
4060
|
var DismissConfirmation = (props) => {
|
|
4061
4061
|
const handleKeyDown = (event) => {
|
|
4062
|
-
if (event.code === "Enter") {
|
|
4062
|
+
if (event.code === "Enter" || event.code === "Escape") {
|
|
4063
4063
|
event.preventDefault();
|
|
4064
4064
|
event.stopPropagation();
|
|
4065
4065
|
props.onConfirm?.();
|
|
4066
|
-
} else if (event.code === "Escape") {
|
|
4067
|
-
event.preventDefault();
|
|
4068
|
-
event.stopPropagation();
|
|
4069
|
-
props.onCancel?.();
|
|
4070
4066
|
}
|
|
4071
4067
|
};
|
|
4072
4068
|
onMount(() => {
|
|
@@ -6268,9 +6264,15 @@ var isTargetKeyCombination = (event, options) => {
|
|
|
6268
6264
|
};
|
|
6269
6265
|
|
|
6270
6266
|
// src/utils/is-event-from-overlay.ts
|
|
6271
|
-
var isEventFromOverlay = (event, attribute) =>
|
|
6272
|
-
|
|
6273
|
-
)
|
|
6267
|
+
var isEventFromOverlay = (event, attribute) => {
|
|
6268
|
+
try {
|
|
6269
|
+
return event.composedPath().some(
|
|
6270
|
+
(target) => target instanceof HTMLElement && target.hasAttribute(attribute)
|
|
6271
|
+
);
|
|
6272
|
+
} catch {
|
|
6273
|
+
return false;
|
|
6274
|
+
}
|
|
6275
|
+
};
|
|
6274
6276
|
|
|
6275
6277
|
// src/theme.ts
|
|
6276
6278
|
var DEFAULT_THEME = {
|
|
@@ -6783,7 +6785,7 @@ var init = (rawOptions) => {
|
|
|
6783
6785
|
hasInited = true;
|
|
6784
6786
|
const logIntro = () => {
|
|
6785
6787
|
try {
|
|
6786
|
-
const version = "0.0.
|
|
6788
|
+
const version = "0.0.76";
|
|
6787
6789
|
const logoDataUri = `data:image/svg+xml;base64,${btoa(LOGO_SVG)}`;
|
|
6788
6790
|
console.log(`%cReact Grab${version ? ` v${version}` : ""}%c
|
|
6789
6791
|
https://react-grab.com`, `background: #330039; color: #ffffff; border: 1px solid #d75fcb; padding: 4px 4px 4px 24px; border-radius: 4px; background-image: url("${logoDataUri}"); background-size: 16px 16px; background-repeat: no-repeat; background-position: 4px center; display: inline-block; margin-bottom: 4px;`, "");
|
|
@@ -7659,7 +7661,12 @@ ${plainTextContentOnly}` : plainTextContentOnly;
|
|
|
7659
7661
|
});
|
|
7660
7662
|
}
|
|
7661
7663
|
const blockEnterIfNeeded = (event) => {
|
|
7662
|
-
|
|
7664
|
+
let originalKey;
|
|
7665
|
+
try {
|
|
7666
|
+
originalKey = originalKeyDescriptor?.get ? originalKeyDescriptor.get.call(event) : event.key;
|
|
7667
|
+
} catch {
|
|
7668
|
+
return false;
|
|
7669
|
+
}
|
|
7663
7670
|
const isEnterKey = originalKey === "Enter" || isEnterCode(event.code);
|
|
7664
7671
|
const isOverlayActive = isActivated() || isHoldingKeys();
|
|
7665
7672
|
const shouldBlockEnter = isEnterKey && isOverlayActive && !isInputMode() && !isToggleMode();
|
|
@@ -1080,7 +1080,7 @@ var buildOpenFileUrl = (filePath, lineNumber) => {
|
|
|
1080
1080
|
};
|
|
1081
1081
|
|
|
1082
1082
|
// src/constants.ts
|
|
1083
|
-
var VERSION = "0.0.
|
|
1083
|
+
var VERSION = "0.0.76";
|
|
1084
1084
|
var VIEWPORT_MARGIN_PX = 8;
|
|
1085
1085
|
var OFFSCREEN_POSITION = -1e3;
|
|
1086
1086
|
var SELECTION_LERP_FACTOR = 0.95;
|
|
@@ -4061,14 +4061,10 @@ var BottomSection = (props) => (() => {
|
|
|
4061
4061
|
})();
|
|
4062
4062
|
var DismissConfirmation = (props) => {
|
|
4063
4063
|
const handleKeyDown = (event) => {
|
|
4064
|
-
if (event.code === "Enter") {
|
|
4064
|
+
if (event.code === "Enter" || event.code === "Escape") {
|
|
4065
4065
|
event.preventDefault();
|
|
4066
4066
|
event.stopPropagation();
|
|
4067
4067
|
props.onConfirm?.();
|
|
4068
|
-
} else if (event.code === "Escape") {
|
|
4069
|
-
event.preventDefault();
|
|
4070
|
-
event.stopPropagation();
|
|
4071
|
-
props.onCancel?.();
|
|
4072
4068
|
}
|
|
4073
4069
|
};
|
|
4074
4070
|
onMount(() => {
|
|
@@ -6270,9 +6266,15 @@ var isTargetKeyCombination = (event, options) => {
|
|
|
6270
6266
|
};
|
|
6271
6267
|
|
|
6272
6268
|
// src/utils/is-event-from-overlay.ts
|
|
6273
|
-
var isEventFromOverlay = (event, attribute) =>
|
|
6274
|
-
|
|
6275
|
-
)
|
|
6269
|
+
var isEventFromOverlay = (event, attribute) => {
|
|
6270
|
+
try {
|
|
6271
|
+
return event.composedPath().some(
|
|
6272
|
+
(target) => target instanceof HTMLElement && target.hasAttribute(attribute)
|
|
6273
|
+
);
|
|
6274
|
+
} catch {
|
|
6275
|
+
return false;
|
|
6276
|
+
}
|
|
6277
|
+
};
|
|
6276
6278
|
|
|
6277
6279
|
// src/theme.ts
|
|
6278
6280
|
var DEFAULT_THEME = {
|
|
@@ -6785,7 +6787,7 @@ var init = (rawOptions) => {
|
|
|
6785
6787
|
hasInited = true;
|
|
6786
6788
|
const logIntro = () => {
|
|
6787
6789
|
try {
|
|
6788
|
-
const version = "0.0.
|
|
6790
|
+
const version = "0.0.76";
|
|
6789
6791
|
const logoDataUri = `data:image/svg+xml;base64,${btoa(LOGO_SVG)}`;
|
|
6790
6792
|
console.log(`%cReact Grab${version ? ` v${version}` : ""}%c
|
|
6791
6793
|
https://react-grab.com`, `background: #330039; color: #ffffff; border: 1px solid #d75fcb; padding: 4px 4px 4px 24px; border-radius: 4px; background-image: url("${logoDataUri}"); background-size: 16px 16px; background-repeat: no-repeat; background-position: 4px center; display: inline-block; margin-bottom: 4px;`, "");
|
|
@@ -7661,7 +7663,12 @@ ${plainTextContentOnly}` : plainTextContentOnly;
|
|
|
7661
7663
|
});
|
|
7662
7664
|
}
|
|
7663
7665
|
const blockEnterIfNeeded = (event) => {
|
|
7664
|
-
|
|
7666
|
+
let originalKey;
|
|
7667
|
+
try {
|
|
7668
|
+
originalKey = originalKeyDescriptor?.get ? originalKeyDescriptor.get.call(event) : event.key;
|
|
7669
|
+
} catch {
|
|
7670
|
+
return false;
|
|
7671
|
+
}
|
|
7665
7672
|
const isEnterKey = originalKey === "Enter" || isEnterCode(event.code);
|
|
7666
7673
|
const isOverlayActive = isActivated() || isHoldingKeys();
|
|
7667
7674
|
const shouldBlockEnter = isEnterKey && isOverlayActive && !isInputMode() && !isToggleMode();
|