OpenPanel/packages/kbar/CHANGELOG.md
Stefan Pejcic 8595a9f4e5 back
2024-05-08 19:58:53 +02:00

15 KiB

@refinedev/kbar

1.3.5

Patch Changes

1.3.4

Patch Changes

  • #5022 80513a4e42f Thanks @BatuhanW! - chore: update README.md

    • fix grammar errors.
    • make all README.md files consistent.
    • add code example code snippets.

1.3.3

Patch Changes

  • #5022 80513a4e42f Thanks @BatuhanW! - chore: update README.md

    • fix grammar errors.
    • make all README.md files consistent.
    • add code example code snippets.

1.3.2

Patch Changes

1.3.1

Patch Changes

1.3.0

Minor Changes

  • #4741 026ccf34356 Thanks @aliemir! - Added sideEffects: false to package.json to help bundlers tree-shake unused code.

1.2.0

Minor Changes

  • #4741 026ccf34356 Thanks @aliemir! - Added sideEffects: false to package.json to help bundlers tree-shake unused code.

1.1.2

Patch Changes

1.1.1

Patch Changes

1.1.0

Minor Changes

Patch Changes

0.12.0

Minor Changes

0.11.0

Minor Changes

0.10.2

Patch Changes

  • Fixed version of react-router to 6.3.0

0.10.1

Patch Changes

0.10.0

Minor Changes

  • Update type declaration generation with tsc instead of tsup for better navigation throughout projects source code.

0.9.0

Minor Changes

  • #2440 0150dcd070 Thanks @aliemir! - Update type declaration generation with tsc instead of tsup for better navigation throughout projects source code.

0.8.0

Minor Changes

  • Add React@18 support 🚀

0.7.0

Minor Changes

0.6.0

Minor Changes

  • Pass the full resource to the accessControlProvider can method. This will enable Attribute Based Access Control (ABAC), for example granting permissions based on the value of a field in the resource object.

    const App: React.FC = () => {
        <Refine
            // other providers and props
            accessControlProvider={{
                can: async ({ resource, action, params }) => {
                    if (resource === "posts" && action === "edit") {
                        return Promise.resolve({
                            can: false,
                            reason: "Unauthorized",
                        });
                    }
    
                    // or you can access directly *resource object
                    // const resourceName = params?.resource?.name;
                    // const anyUsefulOption = params?.resource?.options?.yourUsefulOption;
                    // if (resourceName === "posts" && anyUsefulOption === true && action === "edit") {
                    //     return Promise.resolve({
                    //         can: false,
                    //         reason: "Unauthorized",
                    //     });
                    // }
    
                    return Promise.resolve({ can: true });
                },
            }}
        />;
    };
    

0.5.0

Minor Changes

  • e78b181b12 Thanks @omeraplak! - Pass the full resource to the accessControlProvider can method. This will enable Attribute Based Access Control (ABAC), for example granting permissions based on the value of a field in the resource object.

    const App: React.FC = () => {
        <Refine
            // other providers and props
            accessControlProvider={{
                can: async ({ resource, action, params }) => {
                    if (resource === "posts" && action === "edit") {
                        return Promise.resolve({
                            can: false,
                            reason: "Unauthorized",
                        });
                    }
    
                    // or you can access directly *resource object
                    // const resourceName = params?.resource?.name;
                    // const anyUsefulOption = params?.resource?.options?.yourUsefulOption;
                    // if (resourceName === "posts" && anyUsefulOption === true && action === "edit") {
                    //     return Promise.resolve({
                    //         can: false,
                    //         reason: "Unauthorized",
                    //     });
                    // }
    
                    return Promise.resolve({ can: true });
                },
            }}
        />;
    };
    

0.4.0

Minor Changes

  • All of the refine packages have dependencies on the @pankod/refine-core package. So far we have managed these dependencies with peerDependencies + dependencies but this causes issues like #2183. (having more than one @pankod/refine-core version in node_modules and creating different instances)

    Managing as peerDependencies + devDependencies seems like the best way for now to avoid such issues.

0.3.0

Minor Changes

  • #2217 b4aae00f77 Thanks @omeraplak! - All of the refine packages have dependencies on the @pankod/refine-core package. So far we have managed these dependencies with peerDependencies + dependencies but this causes issues like #2183. (having more than one @pankod/refine-core version in node_modules and creating different instances)

    Managing as peerDependencies + devDependencies seems like the best way for now to avoid such issues.

0.2.2

Patch Changes

  • Fixed react-dom dependency version

    - "react-dom": "^17.0.4"
    + "react-dom": "^17.0.0 || ^18.0.0"
    

0.2.1

Patch Changes

  • #2178 7a8e74a0af Thanks @biskuvit! - Fixed react-dom dependency version

    - "react-dom": "^17.0.4"
    + "react-dom": "^17.0.0 || ^18.0.0"
    

0.2.0

Minor Changes

  • Command palette for the refine. this package use kbar to generate the command palette.

    💡 How use the refine-kbar command palette?

    1. Import the package
    
    
    1. Wrap the <Refine> component with the <RefineKbarProvider>.
    import { Refine } from "@pankod/refine-core";
    import { RefineKbarProvider } from "@pankod/refine-kbar";
    const App: React.FC = () => {
        return (
            <RefineKbarProvider>
                <Refine />
            </RefineKbarProvider>
        );
    };
    
    1. Create <OffLayoutArea/> component for the Refine component and use the refine-kbar command palette in <OffLayoutArea>

    We have the <RefineKbar> component to provide the command palette to the <Refine> component.

    import { Refine } from "@pankod/refine-core";
    import { RefineKbar, RefineKbarProvider } from "@pankod/refine-kbar";
    
    const OffLayoutArea: React.FC = () => {
        return <RefineKbar />;
    };
    const App: React.FC = () => {
        return (
            <RefineKbarProvider>
                <Refine OffLayoutArea={OffLayoutArea} />
            </RefineKbarProvider>
        );
    };
    

    Note

    📢 Q: Why we need to wrap the <Refine> component with the <RefineKbarProvider>? A: The <RefineKbarProvider> is a wrapper component that provides the command palette to the <Refine> component. Q: Why we need to add <OffLayoutArea> to the <Refine> component? A: Because we need to reach the resources property of the <Refine> component.

0.1.0

Minor Changes

  • #2117 e941ac0f47 Thanks @biskuvit! - Command palette for the refine. this package use kbar to generate the command palette.

    💡 How use the refine-kbar command palette?

    1. Import the package
    
    
    1. Wrap the <Refine> component with the <RefineKbarProvider>.
    import { Refine } from "@pankod/refine-core";
    import { RefineKbarProvider } from "@pankod/refine-kbar";
    const App: React.FC = () => {
        return (
            <RefineKbarProvider>
                <Refine />
            </RefineKbarProvider>
        );
    };
    
    1. Create <OffLayoutArea/> component for the Refine component and use the refine-kbar command palette in <OffLayoutArea>

    We have the <RefineKbar> component to provide the command palette to the <Refine> component.

    import { Refine } from "@pankod/refine-core";
    import { RefineKbar, RefineKbarProvider } from "@pankod/refine-kbar";
    
    const OffLayoutArea: React.FC = () => {
        return <RefineKbar />;
    };
    const App: React.FC = () => {
        return (
            <RefineKbarProvider>
                <Refine OffLayoutArea={OffLayoutArea} />
            </RefineKbarProvider>
        );
    };
    

    Note

    📢 Q: Why we need to wrap the <Refine> component with the <RefineKbarProvider>? A: The <RefineKbarProvider> is a wrapper component that provides the command palette to the <Refine> component. Q: Why we need to add <OffLayoutArea> to the <Refine> component? A: Because we need to reach the resources property of the <Refine> component.