From 216ba52381752f58fbf5b20bcedd0f45e7b87c1f Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Wed, 29 Nov 2023 18:11:53 +0100 Subject: [PATCH] Version Packages (#77) * Version Packages * Update changelog & docs * Fix CI --------- Co-authored-by: github-actions[bot] Co-authored-by: foyarash <11079152+foyarash@users.noreply.github.com> --- .changeset/nervous-foxes-act.md | 2 ++ .changeset/smart-books-grab.md | 7 ------- apps/docs/pages/docs/api-docs.mdx | 12 +++++++++--- packages/next-admin/CHANGELOG.md | 10 +++++++++- packages/next-admin/package.json | 2 +- 5 files changed, 21 insertions(+), 12 deletions(-) create mode 100644 .changeset/nervous-foxes-act.md delete mode 100644 .changeset/smart-books-grab.md diff --git a/.changeset/nervous-foxes-act.md b/.changeset/nervous-foxes-act.md new file mode 100644 index 00000000..a845151c --- /dev/null +++ b/.changeset/nervous-foxes-act.md @@ -0,0 +1,2 @@ +--- +--- diff --git a/.changeset/smart-books-grab.md b/.changeset/smart-books-grab.md deleted file mode 100644 index 33b01d24..00000000 --- a/.changeset/smart-books-grab.md +++ /dev/null @@ -1,7 +0,0 @@ ---- -"@premieroctet/next-admin": major ---- - -# New feature - -App router is now supported. You can find an exemple of its usage in the example app. diff --git a/apps/docs/pages/docs/api-docs.mdx b/apps/docs/pages/docs/api-docs.mdx index a008d235..d1ad133e 100644 --- a/apps/docs/pages/docs/api-docs.mdx +++ b/apps/docs/pages/docs/api-docs.mdx @@ -232,9 +232,9 @@ The `fields` property is available in both `list` and `edit` properties. For the `list` property, it can take the following: -| Name | Description | -| --------- | -------------------------------------------------------------------------------- | -| formatter | a function that takes the field value as a parameter, and that return a JSX node | +| Name | Description | +| --------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| formatter | a function that takes the field value as a parameter, and that return a JSX node. It also accepts a second argument which is the [`NextAdmin` context](#nextadmin-context) | For the `edit` property, it can take the following: @@ -319,3 +319,9 @@ const options: NextAdminOptions = { const adminRouter = await nextAdminRouter(prisma, schema, options); ``` + +## NextAdmin Context + +The `NextAdmin` context is an object containing the following properties: + +- `locale`: the locale used by the calling page. (refers to the `accept-language` header). diff --git a/packages/next-admin/CHANGELOG.md b/packages/next-admin/CHANGELOG.md index e4c4171c..7ab925de 100644 --- a/packages/next-admin/CHANGELOG.md +++ b/packages/next-admin/CHANGELOG.md @@ -1,5 +1,14 @@ # @premieroctet/next-admin +## 3.0.0 + +### Major Changes + +- 16aba39: # New feature + + - App router is now supported. You can find an exemple of its usage in the example app. + - New context object, currently passed only to the `formatter` function + ## 2.0.0 ### Major Changes @@ -23,7 +32,6 @@ Introduce handler object to handle custom logic for a property in edit mode Add ability to use input variant in edit mode Fix datetime-local input to store correct datetime - ## 1.4.1 diff --git a/packages/next-admin/package.json b/packages/next-admin/package.json index 96c47b58..17870c7a 100644 --- a/packages/next-admin/package.json +++ b/packages/next-admin/package.json @@ -1,6 +1,6 @@ { "name": "@premieroctet/next-admin", - "version": "2.0.0", + "version": "3.0.0", "main": "./dist/index.js", "types": "./dist/index.d.ts", "license": "MIT",