You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
refactor: enhance plugin registration and API options handling (#102)
* refactor: enhance plugin registration and API options handling
- Updated the API to include a `registerPlugin` method, allowing for more flexible plugin management.
- Refactored existing code to utilize the new plugin system, improving extensibility and maintainability.
- Adjusted type definitions and interfaces to support the new plugin architecture, ensuring compatibility with existing functionality.
* docs: update README for plugin system enhancements and usage examples
- Revised sections on plugin registration and lifecycle hooks to reflect recent API changes.
- Added detailed examples for new plugins, including analytics and context menu actions.
- Improved clarity in usage instructions and added a section on unregistering plugins.
* fix
* Update packages/grab/README.md
Co-authored-by: cubic-dev-ai[bot] <191113872+cubic-dev-ai[bot]@users.noreply.github.com>
* Update README.md
Co-authored-by: cubic-dev-ai[bot] <191113872+cubic-dev-ai[bot]@users.noreply.github.com>
* feat: enhance file opening functionality with plugin hooks
- Added `onOpenFile` hook to allow plugins to handle file opening events, providing flexibility for custom behaviors.
- Updated context menu handling to utilize the new `onOpenFile` hook, improving integration with plugins.
- Refactored related code to ensure consistent handling of file opening across the application.
* refactor: streamline agent capabilities handling in core index
- Updated the logic for setting agent capabilities to use a captured provider, improving clarity and reducing redundancy.
- Enhanced connection checking for the agent provider, ensuring accurate updates to the agent's connection status.
- Refactored related code for better maintainability and consistency in handling agent options.
* fix
* refactor: update plugin contribution interface and related types
- Renamed `PluginContribution` to `PluginConfig` to better reflect its purpose.
- Adjusted type definitions in the core and types files to ensure consistency with the new naming convention.
- Updated imports and references throughout the codebase to align with the refactored interface.
* refactor: improve options handling in plugin registry
- Enhanced the `setOptions` function to streamline the updating of plugin options, ensuring undefined values are ignored.
- Updated the logic for merging options to include direct overrides, improving the clarity and maintainability of the code.
- Refactored related code to ensure consistent handling of options within the plugin registry.
---------
Co-authored-by: cubic-dev-ai[bot] <191113872+cubic-dev-ai[bot]@users.noreply.github.com>
Copy file name to clipboardExpand all lines: README.md
+81-20Lines changed: 81 additions & 20 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -529,37 +529,98 @@ export default function RootLayout({ children }) {
529
529
530
530
## Extending React Grab
531
531
532
-
React Grab provides an public customization API. Check out the [type definitions](https://github.com/aidenybai/react-grab/blob/main/packages/react-grab/src/types.ts) to see all available options for extending React Grab.
532
+
React Grab uses a plugin system to extend functionality. Check out the [type definitions](https://github.com/aidenybai/react-grab/blob/main/packages/react-grab/src/types.ts) to see all available options.
533
+
534
+
#### Basic Usage
533
535
534
536
```typescript
535
537
import { init } from "react-grab/core";
536
538
537
-
const api = init({
538
-
theme: {
539
-
enabled: true, // disable all UI by setting to false
Copy file name to clipboardExpand all lines: packages/grab/README.md
+81-20Lines changed: 81 additions & 20 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -529,37 +529,98 @@ export default function RootLayout({ children }) {
529
529
530
530
## Extending React Grab
531
531
532
-
React Grab provides an public customization API. Check out the [type definitions](https://github.com/aidenybai/react-grab/blob/main/packages/react-grab/src/types.ts) to see all available options for extending React Grab.
532
+
React Grab uses a plugin system to extend functionality. Check out the [type definitions](https://github.com/aidenybai/react-grab/blob/main/packages/react-grab/src/types.ts) to see all available options.
533
+
534
+
#### Basic Usage
533
535
534
536
```typescript
535
537
import { init } from "grab/core";
536
538
537
-
const api = init({
538
-
theme: {
539
-
enabled: true, // disable all UI by setting to false
0 commit comments