@refinedev/core 4.25.0 → 4.26.0
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/CHANGELOG.md +39 -0
- package/dist/definitions/helpers/generateDocumentTitle/index.d.ts +2 -4
- package/dist/definitions/helpers/generateDocumentTitle/index.d.ts.map +1 -1
- package/dist/definitions/helpers/safe-translate/index.d.ts +3 -0
- package/dist/definitions/helpers/safe-translate/index.d.ts.map +1 -0
- package/dist/esm/index.js +6 -6
- package/dist/esm/index.js.map +1 -1
- package/dist/iife/index.js +6 -6
- package/dist/iife/index.js.map +1 -1
- package/dist/index.js +6 -6
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
- package/src/definitions/helpers/generateDocumentTitle/index.ts +16 -12
- package/src/definitions/helpers/safe-translate/index.ts +20 -0
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,44 @@
|
|
|
1
1
|
# @pankod/refine-core
|
|
2
2
|
|
|
3
|
+
## 4.26.0
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- [#4568](https://github.com/refinedev/refine/pull/4568) [`8c2b3be35b0`](https://github.com/refinedev/refine/commit/8c2b3be35b0132fc9a7b79287d281a9f922424d0) Thanks [@salihozdemir](https://github.com/salihozdemir)! - feat: add the `textTransformers` option to `<Refine/>` component
|
|
8
|
+
|
|
9
|
+
The `textTransformers` option in **refine** is used to transform the resource name displayed on the user interface (UI). By default, if you define a resource named `posts`, refine will display it as `Posts`. Similarly, when you delete a record, notification messages will be shown as `Post deleted successfully.`.
|
|
10
|
+
|
|
11
|
+
You have the flexibility to customize these messages by using the `textTransformers` option. For instance, if you wish to disable any transformation, you can set the `textTransformers` option as shown in the example below:
|
|
12
|
+
|
|
13
|
+
```tsx
|
|
14
|
+
const App: React.FC = () => (
|
|
15
|
+
<Refine
|
|
16
|
+
// ...
|
|
17
|
+
options={{
|
|
18
|
+
textTransformers: {
|
|
19
|
+
humanize: (text) => text,
|
|
20
|
+
plural: (text) => text,
|
|
21
|
+
singular: (text) => text,
|
|
22
|
+
},
|
|
23
|
+
}}
|
|
24
|
+
/>
|
|
25
|
+
);
|
|
26
|
+
```
|
|
27
|
+
|
|
28
|
+
### Patch Changes
|
|
29
|
+
|
|
30
|
+
- [#4583](https://github.com/refinedev/refine/pull/4583) [`c3c0deed564`](https://github.com/refinedev/refine/commit/c3c0deed564bdbded58c615357a55e666473923a) Thanks [@aliemir](https://github.com/aliemir)! - Added the missing `resource` property in `params` of the `useCan` call, which was leading to missing resource details in the access control checks in the `can` function.
|
|
31
|
+
|
|
32
|
+
The provided `resource` item is sanitized to remove non-serializable properties such as `icon` etc. If you need such items, you should try to access your `resource` item directly from your defitinions.
|
|
33
|
+
|
|
34
|
+
- [#4599](https://github.com/refinedev/refine/pull/4599) [`5bb6f47a4d4`](https://github.com/refinedev/refine/commit/5bb6f47a4d4e29a7de5426879754fcd78e3fa4d5) Thanks [@aliemir](https://github.com/aliemir)! - Update default document title generation to use the fallback title when `i18n`'s `translate` function returns the `key` value.
|
|
35
|
+
|
|
36
|
+
## 4.25.1
|
|
37
|
+
|
|
38
|
+
### Patch Changes
|
|
39
|
+
|
|
40
|
+
- [#4599](https://github.com/refinedev/refine/pull/4599) [`5bb6f47a4d4`](https://github.com/refinedev/refine/commit/5bb6f47a4d4e29a7de5426879754fcd78e3fa4d5) Thanks [@aliemir](https://github.com/aliemir)! - Update default document title generation to use the fallback title when `i18n`'s `translate` function returns the `key` value.
|
|
41
|
+
|
|
3
42
|
## 4.25.0
|
|
4
43
|
|
|
5
44
|
### Minor Changes
|
|
@@ -1,9 +1,7 @@
|
|
|
1
1
|
import { IResourceItem } from "@contexts/resource";
|
|
2
|
+
import type { useTranslate } from "@hooks/translate";
|
|
2
3
|
/**
|
|
3
4
|
* Generates document title for the given resource and action.
|
|
4
5
|
*/
|
|
5
|
-
export declare function generateDefaultDocumentTitle(translate:
|
|
6
|
-
(key: string, options?: any, defaultMessage?: string | undefined): string;
|
|
7
|
-
(key: string, defaultMessage?: string | undefined): string;
|
|
8
|
-
}, resource?: IResourceItem, action?: string, id?: string, resourceName?: string): string;
|
|
6
|
+
export declare function generateDefaultDocumentTitle(translate: ReturnType<typeof useTranslate>, resource?: IResourceItem, action?: string, id?: string, resourceName?: string): string;
|
|
9
7
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/definitions/helpers/generateDocumentTitle/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/definitions/helpers/generateDocumentTitle/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AAEnD,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,kBAAkB,CAAC;AAGrD;;GAEG;AACH,wBAAgB,4BAA4B,CACxC,SAAS,EAAE,UAAU,CAAC,OAAO,YAAY,CAAC,EAC1C,QAAQ,CAAC,EAAE,aAAa,EACxB,MAAM,CAAC,EAAE,MAAM,EACf,EAAE,CAAC,EAAE,MAAM,EACX,YAAY,CAAC,EAAE,MAAM,UAgDxB"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/definitions/helpers/safe-translate/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,kBAAkB,CAAC;AAErD,eAAO,MAAM,aAAa,cACX,WAAW,mBAAmB,CAAC,OACrC,MAAM,mBACM,MAAM,YACb,GAAG,WAahB,CAAC"}
|