@nixxie-cms/core 1.0.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 +3158 -0
- package/LICENSE +21 -0
- package/README.md +6 -0
- package/___internal-do-not-use-will-break-in-patch/admin-ui/id-field-view/dist/nixxie-cms-core-___internal-do-not-use-will-break-in-patch-admin-ui-id-field-view.cjs.d.ts +2 -0
- package/___internal-do-not-use-will-break-in-patch/admin-ui/id-field-view/dist/nixxie-cms-core-___internal-do-not-use-will-break-in-patch-admin-ui-id-field-view.cjs.js +244 -0
- package/___internal-do-not-use-will-break-in-patch/admin-ui/id-field-view/dist/nixxie-cms-core-___internal-do-not-use-will-break-in-patch-admin-ui-id-field-view.esm.js +235 -0
- package/___internal-do-not-use-will-break-in-patch/admin-ui/id-field-view/package.json +4 -0
- package/___internal-do-not-use-will-break-in-patch/admin-ui/next-config/package.json +4 -0
- package/___internal-do-not-use-will-break-in-patch/admin-ui/pages/App/dist/nixxie-cms-core-___internal-do-not-use-will-break-in-patch-admin-ui-pages-App.cjs.d.ts +2 -0
- package/___internal-do-not-use-will-break-in-patch/admin-ui/pages/App/dist/nixxie-cms-core-___internal-do-not-use-will-break-in-patch-admin-ui-pages-App.cjs.js +59 -0
- package/___internal-do-not-use-will-break-in-patch/admin-ui/pages/App/dist/nixxie-cms-core-___internal-do-not-use-will-break-in-patch-admin-ui-pages-App.esm.js +55 -0
- package/___internal-do-not-use-will-break-in-patch/admin-ui/pages/App/package.json +4 -0
- package/___internal-do-not-use-will-break-in-patch/admin-ui/pages/CreateItemPage/dist/nixxie-cms-core-___internal-do-not-use-will-break-in-patch-admin-ui-pages-CreateItemPage.cjs.d.ts +2 -0
- package/___internal-do-not-use-will-break-in-patch/admin-ui/pages/CreateItemPage/dist/nixxie-cms-core-___internal-do-not-use-will-break-in-patch-admin-ui-pages-CreateItemPage.cjs.js +116 -0
- package/___internal-do-not-use-will-break-in-patch/admin-ui/pages/CreateItemPage/dist/nixxie-cms-core-___internal-do-not-use-will-break-in-patch-admin-ui-pages-CreateItemPage.esm.js +112 -0
- package/___internal-do-not-use-will-break-in-patch/admin-ui/pages/CreateItemPage/package.json +4 -0
- package/___internal-do-not-use-will-break-in-patch/admin-ui/pages/HomePage/dist/nixxie-cms-core-___internal-do-not-use-will-break-in-patch-admin-ui-pages-HomePage.cjs.d.ts +2 -0
- package/___internal-do-not-use-will-break-in-patch/admin-ui/pages/HomePage/dist/nixxie-cms-core-___internal-do-not-use-will-break-in-patch-admin-ui-pages-HomePage.cjs.js +336 -0
- package/___internal-do-not-use-will-break-in-patch/admin-ui/pages/HomePage/dist/nixxie-cms-core-___internal-do-not-use-will-break-in-patch-admin-ui-pages-HomePage.esm.js +332 -0
- package/___internal-do-not-use-will-break-in-patch/admin-ui/pages/HomePage/package.json +4 -0
- package/___internal-do-not-use-will-break-in-patch/admin-ui/pages/ItemPage/dist/nixxie-cms-core-___internal-do-not-use-will-break-in-patch-admin-ui-pages-ItemPage.cjs.d.ts +2 -0
- package/___internal-do-not-use-will-break-in-patch/admin-ui/pages/ItemPage/dist/nixxie-cms-core-___internal-do-not-use-will-break-in-patch-admin-ui-pages-ItemPage.cjs.js +463 -0
- package/___internal-do-not-use-will-break-in-patch/admin-ui/pages/ItemPage/dist/nixxie-cms-core-___internal-do-not-use-will-break-in-patch-admin-ui-pages-ItemPage.esm.js +455 -0
- package/___internal-do-not-use-will-break-in-patch/admin-ui/pages/ItemPage/package.json +4 -0
- package/___internal-do-not-use-will-break-in-patch/admin-ui/pages/ListPage/dist/nixxie-cms-core-___internal-do-not-use-will-break-in-patch-admin-ui-pages-ListPage.cjs.d.ts +2 -0
- package/___internal-do-not-use-will-break-in-patch/admin-ui/pages/ListPage/dist/nixxie-cms-core-___internal-do-not-use-will-break-in-patch-admin-ui-pages-ListPage.cjs.js +1195 -0
- package/___internal-do-not-use-will-break-in-patch/admin-ui/pages/ListPage/dist/nixxie-cms-core-___internal-do-not-use-will-break-in-patch-admin-ui-pages-ListPage.esm.js +1187 -0
- package/___internal-do-not-use-will-break-in-patch/admin-ui/pages/ListPage/package.json +4 -0
- package/___internal-do-not-use-will-break-in-patch/admin-ui/pages/NoAccessPage/dist/nixxie-cms-core-___internal-do-not-use-will-break-in-patch-admin-ui-pages-NoAccessPage.cjs.d.ts +2 -0
- package/___internal-do-not-use-will-break-in-patch/admin-ui/pages/NoAccessPage/dist/nixxie-cms-core-___internal-do-not-use-will-break-in-patch-admin-ui-pages-NoAccessPage.cjs.js +40 -0
- package/___internal-do-not-use-will-break-in-patch/admin-ui/pages/NoAccessPage/dist/nixxie-cms-core-___internal-do-not-use-will-break-in-patch-admin-ui-pages-NoAccessPage.esm.js +35 -0
- package/___internal-do-not-use-will-break-in-patch/admin-ui/pages/NoAccessPage/package.json +4 -0
- package/___internal-do-not-use-will-break-in-patch/artifacts/dist/nixxie-cms-core-___internal-do-not-use-will-break-in-patch-artifacts.cjs.d.ts +2 -0
- package/___internal-do-not-use-will-break-in-patch/artifacts/dist/nixxie-cms-core-___internal-do-not-use-will-break-in-patch-artifacts.cjs.js +51 -0
- package/___internal-do-not-use-will-break-in-patch/artifacts/dist/nixxie-cms-core-___internal-do-not-use-will-break-in-patch-artifacts.esm.js +38 -0
- package/___internal-do-not-use-will-break-in-patch/artifacts/package.json +4 -0
- package/access/dist/nixxie-cms-core-access.cjs.d.ts +2 -0
- package/access/dist/nixxie-cms-core-access.cjs.js +26 -0
- package/access/dist/nixxie-cms-core-access.esm.js +19 -0
- package/access/package.json +4 -0
- package/admin-ui/apollo/dist/nixxie-cms-core-admin-ui-apollo.cjs.d.ts +2 -0
- package/admin-ui/apollo/dist/nixxie-cms-core-admin-ui-apollo.cjs.js +87 -0
- package/admin-ui/apollo/dist/nixxie-cms-core-admin-ui-apollo.esm.js +2 -0
- package/admin-ui/apollo/package.json +4 -0
- package/admin-ui/components/dist/nixxie-cms-core-admin-ui-components.cjs.d.ts +2 -0
- package/admin-ui/components/dist/nixxie-cms-core-admin-ui-components.cjs.js +77 -0
- package/admin-ui/components/dist/nixxie-cms-core-admin-ui-components.esm.js +58 -0
- package/admin-ui/components/package.json +4 -0
- package/admin-ui/context/dist/nixxie-cms-core-admin-ui-context.cjs.d.ts +2 -0
- package/admin-ui/context/dist/nixxie-cms-core-admin-ui-context.cjs.js +35 -0
- package/admin-ui/context/dist/nixxie-cms-core-admin-ui-context.esm.js +23 -0
- package/admin-ui/context/package.json +4 -0
- package/admin-ui/image/dist/nixxie-cms-core-admin-ui-image.cjs.d.ts +3 -0
- package/admin-ui/image/dist/nixxie-cms-core-admin-ui-image.cjs.js +18 -0
- package/admin-ui/image/dist/nixxie-cms-core-admin-ui-image.esm.js +2 -0
- package/admin-ui/image/package.json +4 -0
- package/admin-ui/router/dist/nixxie-cms-core-admin-ui-router.cjs.d.ts +2 -0
- package/admin-ui/router/dist/nixxie-cms-core-admin-ui-router.cjs.js +34 -0
- package/admin-ui/router/dist/nixxie-cms-core-admin-ui-router.esm.js +12 -0
- package/admin-ui/router/package.json +4 -0
- package/admin-ui/utils/dist/nixxie-cms-core-admin-ui-utils.cjs.d.ts +2 -0
- package/admin-ui/utils/dist/nixxie-cms-core-admin-ui-utils.cjs.js +45 -0
- package/admin-ui/utils/dist/nixxie-cms-core-admin-ui-utils.esm.js +22 -0
- package/admin-ui/utils/package.json +4 -0
- package/bin/cli.js +3 -0
- package/context/dist/nixxie-cms-core-context.cjs.d.ts +2 -0
- package/context/dist/nixxie-cms-core-context.cjs.js +31 -0
- package/context/dist/nixxie-cms-core-context.esm.js +23 -0
- package/context/package.json +4 -0
- package/dist/CreateItemDialog-33335548.esm.js +55 -0
- package/dist/CreateItemDialog-56cf59b7.cjs.js +57 -0
- package/dist/Errors-575adfa3.cjs.js +147 -0
- package/dist/Errors-bf24759e.esm.js +143 -0
- package/dist/Field-47f85161.esm.js +278 -0
- package/dist/Field-ed8d7627.cjs.js +287 -0
- package/dist/Fields-956d9a14.esm.js +203 -0
- package/dist/Fields-e2c28056.cjs.js +206 -0
- package/dist/GraphQLErrorNotice-cd74180d.cjs.js +57 -0
- package/dist/GraphQLErrorNotice-d9f0931b.esm.js +55 -0
- package/dist/NullableFieldWrapper-6ea48af3.esm.js +71 -0
- package/dist/NullableFieldWrapper-daa0a080.cjs.js +74 -0
- package/dist/PageContainer-27c27f10.cjs.js +1144 -0
- package/dist/PageContainer-7db73317.esm.js +1129 -0
- package/dist/actionData-64d4c37a.esm.js +28 -0
- package/dist/actionData-7858738d.cjs.js +32 -0
- package/dist/admin-meta-14c60fec.esm.js +210 -0
- package/dist/admin-meta-18d0c276.cjs.js +217 -0
- package/dist/admin-meta-graphql-6f7f5331.esm.js +142 -0
- package/dist/admin-meta-graphql-c8f926e9.cjs.js +144 -0
- package/dist/common-1a350e11.cjs.js +324 -0
- package/dist/common-29fc82e6.esm.js +315 -0
- package/dist/context-3132c3ed.esm.js +419 -0
- package/dist/context-e7a45152.cjs.js +432 -0
- package/dist/declarations/src/___internal-do-not-use-will-break-in-patch/admin-ui/id-field-view.d.ts +6 -0
- package/dist/declarations/src/___internal-do-not-use-will-break-in-patch/admin-ui/id-field-view.d.ts.map +1 -0
- package/dist/declarations/src/___internal-do-not-use-will-break-in-patch/admin-ui/pages/App/index.d.ts +10 -0
- package/dist/declarations/src/___internal-do-not-use-will-break-in-patch/admin-ui/pages/App/index.d.ts.map +1 -0
- package/dist/declarations/src/___internal-do-not-use-will-break-in-patch/admin-ui/pages/CreateItemPage/index.d.ts +6 -0
- package/dist/declarations/src/___internal-do-not-use-will-break-in-patch/admin-ui/pages/CreateItemPage/index.d.ts.map +1 -0
- package/dist/declarations/src/___internal-do-not-use-will-break-in-patch/admin-ui/pages/HomePage/index.d.ts +2 -0
- package/dist/declarations/src/___internal-do-not-use-will-break-in-patch/admin-ui/pages/HomePage/index.d.ts.map +1 -0
- package/dist/declarations/src/___internal-do-not-use-will-break-in-patch/admin-ui/pages/ItemPage/index.d.ts +6 -0
- package/dist/declarations/src/___internal-do-not-use-will-break-in-patch/admin-ui/pages/ItemPage/index.d.ts.map +1 -0
- package/dist/declarations/src/___internal-do-not-use-will-break-in-patch/admin-ui/pages/ListPage/index.d.ts +12 -0
- package/dist/declarations/src/___internal-do-not-use-will-break-in-patch/admin-ui/pages/ListPage/index.d.ts.map +1 -0
- package/dist/declarations/src/___internal-do-not-use-will-break-in-patch/admin-ui/pages/NoAccessPage/index.d.ts +7 -0
- package/dist/declarations/src/___internal-do-not-use-will-break-in-patch/admin-ui/pages/NoAccessPage/index.d.ts.map +1 -0
- package/dist/declarations/src/___internal-do-not-use-will-break-in-patch/artifacts.d.ts +6 -0
- package/dist/declarations/src/___internal-do-not-use-will-break-in-patch/artifacts.d.ts.map +1 -0
- package/dist/declarations/src/access.d.ts +12 -0
- package/dist/declarations/src/access.d.ts.map +1 -0
- package/dist/declarations/src/admin-ui/apollo.d.ts +8 -0
- package/dist/declarations/src/admin-ui/apollo.d.ts.map +1 -0
- package/dist/declarations/src/admin-ui/components/CellContainer.d.ts +5 -0
- package/dist/declarations/src/admin-ui/components/CellContainer.d.ts.map +1 -0
- package/dist/declarations/src/admin-ui/components/CreateItemDialog.d.ts +5 -0
- package/dist/declarations/src/admin-ui/components/CreateItemDialog.d.ts.map +1 -0
- package/dist/declarations/src/admin-ui/components/Errors.d.ts +28 -0
- package/dist/declarations/src/admin-ui/components/Errors.d.ts.map +1 -0
- package/dist/declarations/src/admin-ui/components/GraphQLErrorNotice.d.ts +6 -0
- package/dist/declarations/src/admin-ui/components/GraphQLErrorNotice.d.ts.map +1 -0
- package/dist/declarations/src/admin-ui/components/InlineCode.d.ts +3 -0
- package/dist/declarations/src/admin-ui/components/InlineCode.d.ts.map +1 -0
- package/dist/declarations/src/admin-ui/components/Logo.d.ts +2 -0
- package/dist/declarations/src/admin-ui/components/Logo.d.ts.map +1 -0
- package/dist/declarations/src/admin-ui/components/Navigation.d.ts +22 -0
- package/dist/declarations/src/admin-ui/components/Navigation.d.ts.map +1 -0
- package/dist/declarations/src/admin-ui/components/NullableFieldWrapper.d.ts +33 -0
- package/dist/declarations/src/admin-ui/components/NullableFieldWrapper.d.ts.map +1 -0
- package/dist/declarations/src/admin-ui/components/PageContainer.d.ts +10 -0
- package/dist/declarations/src/admin-ui/components/PageContainer.d.ts.map +1 -0
- package/dist/declarations/src/admin-ui/components/index.d.ts +11 -0
- package/dist/declarations/src/admin-ui/components/index.d.ts.map +1 -0
- package/dist/declarations/src/admin-ui/context.d.ts +50 -0
- package/dist/declarations/src/admin-ui/context.d.ts.map +1 -0
- package/dist/declarations/src/admin-ui/image.d.ts +3 -0
- package/dist/declarations/src/admin-ui/image.d.ts.map +1 -0
- package/dist/declarations/src/admin-ui/router.d.ts +15 -0
- package/dist/declarations/src/admin-ui/router.d.ts.map +1 -0
- package/dist/declarations/src/admin-ui/utils/Fields.d.ts +16 -0
- package/dist/declarations/src/admin-ui/utils/Fields.d.ts.map +1 -0
- package/dist/declarations/src/admin-ui/utils/filters.d.ts +10 -0
- package/dist/declarations/src/admin-ui/utils/filters.d.ts.map +1 -0
- package/dist/declarations/src/admin-ui/utils/index.d.ts +8 -0
- package/dist/declarations/src/admin-ui/utils/index.d.ts.map +1 -0
- package/dist/declarations/src/admin-ui/utils/useCreateItem.d.ts +24 -0
- package/dist/declarations/src/admin-ui/utils/useCreateItem.d.ts.map +1 -0
- package/dist/declarations/src/admin-ui/utils/utils.d.ts +8 -0
- package/dist/declarations/src/admin-ui/utils/utils.d.ts.map +1 -0
- package/dist/declarations/src/artifacts.d.ts +14 -0
- package/dist/declarations/src/artifacts.d.ts.map +1 -0
- package/dist/declarations/src/context.d.ts +2 -0
- package/dist/declarations/src/context.d.ts.map +1 -0
- package/dist/declarations/src/fields/filters/enum-filter.d.ts +27 -0
- package/dist/declarations/src/fields/filters/enum-filter.d.ts.map +1 -0
- package/dist/declarations/src/fields/filters/index.d.ts +2 -0
- package/dist/declarations/src/fields/filters/index.d.ts.map +1 -0
- package/dist/declarations/src/fields/filters/internal.d.ts +21 -0
- package/dist/declarations/src/fields/filters/internal.d.ts.map +1 -0
- package/dist/declarations/src/fields/filters/providers/mysql.d.ts +182 -0
- package/dist/declarations/src/fields/filters/providers/mysql.d.ts.map +1 -0
- package/dist/declarations/src/fields/filters/providers/postgresql.d.ts +182 -0
- package/dist/declarations/src/fields/filters/providers/postgresql.d.ts.map +1 -0
- package/dist/declarations/src/fields/filters/providers/sqlite.d.ts +179 -0
- package/dist/declarations/src/fields/filters/providers/sqlite.d.ts.map +1 -0
- package/dist/declarations/src/fields/index.d.ts +35 -0
- package/dist/declarations/src/fields/index.d.ts.map +1 -0
- package/dist/declarations/src/fields/types/bigInt/index.d.ts +20 -0
- package/dist/declarations/src/fields/types/bigInt/index.d.ts.map +1 -0
- package/dist/declarations/src/fields/types/bigInt/views/index.d.ts +24 -0
- package/dist/declarations/src/fields/types/bigInt/views/index.d.ts.map +1 -0
- package/dist/declarations/src/fields/types/bytes/index.d.ts +70 -0
- package/dist/declarations/src/fields/types/bytes/index.d.ts.map +1 -0
- package/dist/declarations/src/fields/types/bytes/views/index.d.ts +24 -0
- package/dist/declarations/src/fields/types/bytes/views/index.d.ts.map +1 -0
- package/dist/declarations/src/fields/types/calendarDay/index.d.ts +15 -0
- package/dist/declarations/src/fields/types/calendarDay/index.d.ts.map +1 -0
- package/dist/declarations/src/fields/types/calendarDay/views/index.d.ts +18 -0
- package/dist/declarations/src/fields/types/calendarDay/views/index.d.ts.map +1 -0
- package/dist/declarations/src/fields/types/checkbox/index.d.ts +11 -0
- package/dist/declarations/src/fields/types/checkbox/index.d.ts.map +1 -0
- package/dist/declarations/src/fields/types/checkbox/views/index.d.ts +9 -0
- package/dist/declarations/src/fields/types/checkbox/views/index.d.ts.map +1 -0
- package/dist/declarations/src/fields/types/decimal/index.d.ts +20 -0
- package/dist/declarations/src/fields/types/decimal/index.d.ts.map +1 -0
- package/dist/declarations/src/fields/types/decimal/views/index.d.ts +22 -0
- package/dist/declarations/src/fields/types/decimal/views/index.d.ts.map +1 -0
- package/dist/declarations/src/fields/types/file/index.d.ts +34 -0
- package/dist/declarations/src/fields/types/file/index.d.ts.map +1 -0
- package/dist/declarations/src/fields/types/file/views/Field.d.ts +17 -0
- package/dist/declarations/src/fields/types/file/views/Field.d.ts.map +1 -0
- package/dist/declarations/src/fields/types/file/views/index.d.ts +29 -0
- package/dist/declarations/src/fields/types/file/views/index.d.ts.map +1 -0
- package/dist/declarations/src/fields/types/float/index.d.ts +18 -0
- package/dist/declarations/src/fields/types/float/index.d.ts.map +1 -0
- package/dist/declarations/src/fields/types/float/views/index.d.ts +22 -0
- package/dist/declarations/src/fields/types/float/views/index.d.ts.map +1 -0
- package/dist/declarations/src/fields/types/image/index.d.ts +34 -0
- package/dist/declarations/src/fields/types/image/index.d.ts.map +1 -0
- package/dist/declarations/src/fields/types/image/utils.d.ts +2 -0
- package/dist/declarations/src/fields/types/image/utils.d.ts.map +1 -0
- package/dist/declarations/src/fields/types/image/views/Field.d.ts +4 -0
- package/dist/declarations/src/fields/types/image/views/Field.d.ts.map +1 -0
- package/dist/declarations/src/fields/types/image/views/index.d.ts +49 -0
- package/dist/declarations/src/fields/types/image/views/index.d.ts.map +1 -0
- package/dist/declarations/src/fields/types/integer/index.d.ts +20 -0
- package/dist/declarations/src/fields/types/integer/index.d.ts.map +1 -0
- package/dist/declarations/src/fields/types/integer/views/index.d.ts +23 -0
- package/dist/declarations/src/fields/types/integer/views/index.d.ts.map +1 -0
- package/dist/declarations/src/fields/types/json/index.d.ts +25 -0
- package/dist/declarations/src/fields/types/json/index.d.ts.map +1 -0
- package/dist/declarations/src/fields/types/json/views/index.d.ts +9 -0
- package/dist/declarations/src/fields/types/json/views/index.d.ts.map +1 -0
- package/dist/declarations/src/fields/types/multiselect/index.d.ts +50 -0
- package/dist/declarations/src/fields/types/multiselect/index.d.ts.map +1 -0
- package/dist/declarations/src/fields/types/multiselect/views/index.d.ts +26 -0
- package/dist/declarations/src/fields/types/multiselect/views/index.d.ts.map +1 -0
- package/dist/declarations/src/fields/types/password/index.d.ts +49 -0
- package/dist/declarations/src/fields/types/password/index.d.ts.map +1 -0
- package/dist/declarations/src/fields/types/password/views/index.d.ts +47 -0
- package/dist/declarations/src/fields/types/password/views/index.d.ts.map +1 -0
- package/dist/declarations/src/fields/types/relationship/index.d.ts +113 -0
- package/dist/declarations/src/fields/types/relationship/index.d.ts.map +1 -0
- package/dist/declarations/src/fields/types/relationship/views/ComboboxMany.d.ts +26 -0
- package/dist/declarations/src/fields/types/relationship/views/ComboboxMany.d.ts.map +1 -0
- package/dist/declarations/src/fields/types/relationship/views/ComboboxSingle.d.ts +24 -0
- package/dist/declarations/src/fields/types/relationship/views/ComboboxSingle.d.ts.map +1 -0
- package/dist/declarations/src/fields/types/relationship/views/index.d.ts +27 -0
- package/dist/declarations/src/fields/types/relationship/views/index.d.ts.map +1 -0
- package/dist/declarations/src/fields/types/relationship/views/types.d.ts +39 -0
- package/dist/declarations/src/fields/types/relationship/views/types.d.ts.map +1 -0
- package/dist/declarations/src/fields/types/select/index.d.ts +42 -0
- package/dist/declarations/src/fields/types/select/index.d.ts.map +1 -0
- package/dist/declarations/src/fields/types/select/views/index.d.ts +32 -0
- package/dist/declarations/src/fields/types/select/views/index.d.ts.map +1 -0
- package/dist/declarations/src/fields/types/text/index.d.ts +58 -0
- package/dist/declarations/src/fields/types/text/index.d.ts.map +1 -0
- package/dist/declarations/src/fields/types/text/views/index.d.ts +36 -0
- package/dist/declarations/src/fields/types/text/views/index.d.ts.map +1 -0
- package/dist/declarations/src/fields/types/timestamp/index.d.ts +19 -0
- package/dist/declarations/src/fields/types/timestamp/index.d.ts.map +1 -0
- package/dist/declarations/src/fields/types/timestamp/views/index.d.ts +14 -0
- package/dist/declarations/src/fields/types/timestamp/views/index.d.ts.map +1 -0
- package/dist/declarations/src/fields/types/timestamp/views/utils.d.ts +14 -0
- package/dist/declarations/src/fields/types/timestamp/views/utils.d.ts.map +1 -0
- package/dist/declarations/src/fields/types/virtual/index.d.ts +40 -0
- package/dist/declarations/src/fields/types/virtual/index.d.ts.map +1 -0
- package/dist/declarations/src/fields/types/virtual/views/index.d.ts +7 -0
- package/dist/declarations/src/fields/types/virtual/views/index.d.ts.map +1 -0
- package/dist/declarations/src/graphql-ts.d.ts +5 -0
- package/dist/declarations/src/graphql-ts.d.ts.map +1 -0
- package/dist/declarations/src/helpers.d.ts +121 -0
- package/dist/declarations/src/helpers.d.ts.map +1 -0
- package/dist/declarations/src/index.d.ts +6 -0
- package/dist/declarations/src/index.d.ts.map +1 -0
- package/dist/declarations/src/lib/admin-meta.d.ts +71 -0
- package/dist/declarations/src/lib/admin-meta.d.ts.map +1 -0
- package/dist/declarations/src/lib/core/access-control.d.ts +39 -0
- package/dist/declarations/src/lib/core/access-control.d.ts.map +1 -0
- package/dist/declarations/src/lib/core/initialise-lists.d.ts +131 -0
- package/dist/declarations/src/lib/core/initialise-lists.d.ts.map +1 -0
- package/dist/declarations/src/lib/core/resolve-relationships.d.ts +30 -0
- package/dist/declarations/src/lib/core/resolve-relationships.d.ts.map +1 -0
- package/dist/declarations/src/lib/core/where-inputs.d.ts +15 -0
- package/dist/declarations/src/lib/core/where-inputs.d.ts.map +1 -0
- package/dist/declarations/src/lib/express.d.ts +10 -0
- package/dist/declarations/src/lib/express.d.ts.map +1 -0
- package/dist/declarations/src/lib/migrations.d.ts +13 -0
- package/dist/declarations/src/lib/migrations.d.ts.map +1 -0
- package/dist/declarations/src/lib/system.d.ts +35 -0
- package/dist/declarations/src/lib/system.d.ts.map +1 -0
- package/dist/declarations/src/schema.d.ts +40 -0
- package/dist/declarations/src/schema.d.ts.map +1 -0
- package/dist/declarations/src/scripts/cli.d.ts +11 -0
- package/dist/declarations/src/scripts/cli.d.ts.map +1 -0
- package/dist/declarations/src/scripts/index.d.ts +2 -0
- package/dist/declarations/src/scripts/index.d.ts.map +1 -0
- package/dist/declarations/src/scripts/utils.d.ts +7 -0
- package/dist/declarations/src/scripts/utils.d.ts.map +1 -0
- package/dist/declarations/src/session.d.ts +86 -0
- package/dist/declarations/src/session.d.ts.map +1 -0
- package/dist/declarations/src/testing.d.ts +2 -0
- package/dist/declarations/src/testing.d.ts.map +1 -0
- package/dist/declarations/src/types/admin-meta.d.ts +190 -0
- package/dist/declarations/src/types/admin-meta.d.ts.map +1 -0
- package/dist/declarations/src/types/config/access-control.d.ts +108 -0
- package/dist/declarations/src/types/config/access-control.d.ts.map +1 -0
- package/dist/declarations/src/types/config/fields.d.ts +67 -0
- package/dist/declarations/src/types/config/fields.d.ts.map +1 -0
- package/dist/declarations/src/types/config/hooks.d.ts +441 -0
- package/dist/declarations/src/types/config/hooks.d.ts.map +1 -0
- package/dist/declarations/src/types/config/index.d.ts +283 -0
- package/dist/declarations/src/types/config/index.d.ts.map +1 -0
- package/dist/declarations/src/types/config/lists.d.ts +430 -0
- package/dist/declarations/src/types/config/lists.d.ts.map +1 -0
- package/dist/declarations/src/types/context.d.ts +458 -0
- package/dist/declarations/src/types/context.d.ts.map +1 -0
- package/dist/declarations/src/types/core.d.ts +9 -0
- package/dist/declarations/src/types/core.d.ts.map +1 -0
- package/dist/declarations/src/types/index.d.ts +9 -0
- package/dist/declarations/src/types/index.d.ts.map +1 -0
- package/dist/declarations/src/types/next-fields.d.ts +308 -0
- package/dist/declarations/src/types/next-fields.d.ts.map +1 -0
- package/dist/declarations/src/types/prisma.d.ts +13 -0
- package/dist/declarations/src/types/prisma.d.ts.map +1 -0
- package/dist/declarations/src/types/schema/g.d.ts +7 -0
- package/dist/declarations/src/types/schema/g.d.ts.map +1 -0
- package/dist/declarations/src/types/schema/gWithContext.d.ts +12 -0
- package/dist/declarations/src/types/schema/gWithContext.d.ts.map +1 -0
- package/dist/declarations/src/types/schema/index.d.ts +4 -0
- package/dist/declarations/src/types/schema/index.d.ts.map +1 -0
- package/dist/declarations/src/types/schema/legacy-alias.d.ts +28 -0
- package/dist/declarations/src/types/schema/scalars.d.ts +22 -0
- package/dist/declarations/src/types/schema/scalars.d.ts.map +1 -0
- package/dist/declarations/src/types/session.d.ts +28 -0
- package/dist/declarations/src/types/session.d.ts.map +1 -0
- package/dist/declarations/src/types/type-info.d.ts +35 -0
- package/dist/declarations/src/types/type-info.d.ts.map +1 -0
- package/dist/declarations/src/types/utils.d.ts +78 -0
- package/dist/declarations/src/types/utils.d.ts.map +1 -0
- package/dist/declarations/types/dist/nixxie-cms-core-types.cjs.d.ts +2 -0
- package/dist/express-6743b918.esm.js +476 -0
- package/dist/express-e9ed9a7d.cjs.js +495 -0
- package/dist/filters-8c8616f9.esm.js +89 -0
- package/dist/filters-b3e5eb50.cjs.js +96 -0
- package/dist/index-24b78415.esm.js +419 -0
- package/dist/index-ac01583b.cjs.js +425 -0
- package/dist/migrations-996e66a0.esm.js +76 -0
- package/dist/migrations-ab2e0fd4.cjs.js +78 -0
- package/dist/next-fields-49c025ef.cjs.js +251 -0
- package/dist/next-fields-9bf04ed8.esm.js +241 -0
- package/dist/nixxie-cms-core.cjs.d.ts +2 -0
- package/dist/nixxie-cms-core.cjs.js +522 -0
- package/dist/nixxie-cms-core.esm.js +504 -0
- package/dist/non-null-graphql-17b83ddc.cjs.js +72 -0
- package/dist/non-null-graphql-5315718c.esm.js +67 -0
- package/dist/pick-5fe45878.cjs.js +71 -0
- package/dist/pick-b7ef3115.esm.js +68 -0
- package/dist/resolve-hooks-17aafd37.esm.js +2026 -0
- package/dist/resolve-hooks-66fe8a8e.cjs.js +2043 -0
- package/dist/system-48c5f6df.cjs.js +4283 -0
- package/dist/system-dfec2f0a.esm.js +4273 -0
- package/dist/useCreateItem-1be4987e.cjs.js +160 -0
- package/dist/useCreateItem-1f94d252.esm.js +157 -0
- package/dist/useFilter-0b5a1ee6.esm.js +118 -0
- package/dist/useFilter-1a4e6900.cjs.js +120 -0
- package/dist/utils-0cc426c8.esm.js +19 -0
- package/dist/utils-1b632a8f.cjs.js +21 -0
- package/dist/utils-230cddb1.cjs.js +150 -0
- package/dist/utils-5e1d4d28.esm.js +138 -0
- package/dist/utils-b031e11c.cjs.js +49 -0
- package/dist/utils-e74e3527.cjs.js +87 -0
- package/dist/utils-ef2cd0f4.esm.js +80 -0
- package/dist/utils-f9556354.esm.js +41 -0
- package/fields/dist/nixxie-cms-core-fields.cjs.d.ts +2 -0
- package/fields/dist/nixxie-cms-core-fields.cjs.js +1808 -0
- package/fields/dist/nixxie-cms-core-fields.esm.js +1785 -0
- package/fields/package.json +4 -0
- package/fields/types/bigInt/views/dist/nixxie-cms-core-fields-types-bigInt-views.cjs.d.ts +2 -0
- package/fields/types/bigInt/views/dist/nixxie-cms-core-fields-types-bigInt-views.cjs.js +258 -0
- package/fields/types/bigInt/views/dist/nixxie-cms-core-fields-types-bigInt-views.esm.js +253 -0
- package/fields/types/bigInt/views/package.json +4 -0
- package/fields/types/bytes/dist/nixxie-cms-core-fields-types-bytes.cjs.d.ts +2 -0
- package/fields/types/bytes/dist/nixxie-cms-core-fields-types-bytes.cjs.js +221 -0
- package/fields/types/bytes/dist/nixxie-cms-core-fields-types-bytes.esm.js +216 -0
- package/fields/types/bytes/package.json +4 -0
- package/fields/types/bytes/views/dist/nixxie-cms-core-fields-types-bytes-views.cjs.d.ts +2 -0
- package/fields/types/bytes/views/dist/nixxie-cms-core-fields-types-bytes-views.cjs.js +239 -0
- package/fields/types/bytes/views/dist/nixxie-cms-core-fields-types-bytes-views.esm.js +234 -0
- package/fields/types/bytes/views/package.json +4 -0
- package/fields/types/calendarDay/views/dist/nixxie-cms-core-fields-types-calendarDay-views.cjs.d.ts +2 -0
- package/fields/types/calendarDay/views/dist/nixxie-cms-core-fields-types-calendarDay-views.cjs.js +147 -0
- package/fields/types/calendarDay/views/dist/nixxie-cms-core-fields-types-calendarDay-views.esm.js +141 -0
- package/fields/types/calendarDay/views/package.json +4 -0
- package/fields/types/checkbox/views/dist/nixxie-cms-core-fields-types-checkbox-views.cjs.d.ts +2 -0
- package/fields/types/checkbox/views/dist/nixxie-cms-core-fields-types-checkbox-views.cjs.js +126 -0
- package/fields/types/checkbox/views/dist/nixxie-cms-core-fields-types-checkbox-views.esm.js +120 -0
- package/fields/types/checkbox/views/package.json +4 -0
- package/fields/types/decimal/views/dist/nixxie-cms-core-fields-types-decimal-views.cjs.d.ts +2 -0
- package/fields/types/decimal/views/dist/nixxie-cms-core-fields-types-decimal-views.cjs.js +248 -0
- package/fields/types/decimal/views/dist/nixxie-cms-core-fields-types-decimal-views.esm.js +239 -0
- package/fields/types/decimal/views/package.json +4 -0
- package/fields/types/file/utils/package.json +4 -0
- package/fields/types/file/views/dist/nixxie-cms-core-fields-types-file-views.cjs.d.ts +2 -0
- package/fields/types/file/views/dist/nixxie-cms-core-fields-types-file-views.cjs.js +86 -0
- package/fields/types/file/views/dist/nixxie-cms-core-fields-types-file-views.esm.js +81 -0
- package/fields/types/file/views/package.json +4 -0
- package/fields/types/float/views/dist/nixxie-cms-core-fields-types-float-views.cjs.d.ts +2 -0
- package/fields/types/float/views/dist/nixxie-cms-core-fields-types-float-views.cjs.js +237 -0
- package/fields/types/float/views/dist/nixxie-cms-core-fields-types-float-views.esm.js +232 -0
- package/fields/types/float/views/package.json +4 -0
- package/fields/types/image/utils/dist/nixxie-cms-core-fields-types-image-utils.cjs.d.ts +2 -0
- package/fields/types/image/utils/dist/nixxie-cms-core-fields-types-image-utils.cjs.js +7 -0
- package/fields/types/image/utils/dist/nixxie-cms-core-fields-types-image-utils.esm.js +3 -0
- package/fields/types/image/utils/package.json +4 -0
- package/fields/types/image/views/dist/nixxie-cms-core-fields-types-image-views.cjs.d.ts +2 -0
- package/fields/types/image/views/dist/nixxie-cms-core-fields-types-image-views.cjs.js +361 -0
- package/fields/types/image/views/dist/nixxie-cms-core-fields-types-image-views.esm.js +354 -0
- package/fields/types/image/views/package.json +4 -0
- package/fields/types/integer/views/dist/nixxie-cms-core-fields-types-integer-views.cjs.d.ts +2 -0
- package/fields/types/integer/views/dist/nixxie-cms-core-fields-types-integer-views.cjs.js +254 -0
- package/fields/types/integer/views/dist/nixxie-cms-core-fields-types-integer-views.esm.js +249 -0
- package/fields/types/integer/views/package.json +4 -0
- package/fields/types/json/views/dist/nixxie-cms-core-fields-types-json-views.cjs.d.ts +2 -0
- package/fields/types/json/views/dist/nixxie-cms-core-fields-types-json-views.cjs.js +83 -0
- package/fields/types/json/views/dist/nixxie-cms-core-fields-types-json-views.esm.js +77 -0
- package/fields/types/json/views/package.json +4 -0
- package/fields/types/multiselect/views/dist/nixxie-cms-core-fields-types-multiselect-views.cjs.d.ts +2 -0
- package/fields/types/multiselect/views/dist/nixxie-cms-core-fields-types-multiselect-views.cjs.js +147 -0
- package/fields/types/multiselect/views/dist/nixxie-cms-core-fields-types-multiselect-views.esm.js +141 -0
- package/fields/types/multiselect/views/package.json +4 -0
- package/fields/types/password/dist/nixxie-cms-core-fields-types-password.cjs.d.ts +2 -0
- package/fields/types/password/dist/nixxie-cms-core-fields-types-password.cjs.js +206 -0
- package/fields/types/password/dist/nixxie-cms-core-fields-types-password.esm.js +196 -0
- package/fields/types/password/package.json +4 -0
- package/fields/types/password/views/dist/nixxie-cms-core-fields-types-password-views.cjs.d.ts +2 -0
- package/fields/types/password/views/dist/nixxie-cms-core-fields-types-password-views.cjs.js +330 -0
- package/fields/types/password/views/dist/nixxie-cms-core-fields-types-password-views.esm.js +320 -0
- package/fields/types/password/views/package.json +4 -0
- package/fields/types/relationship/views/RelationshipSelect/package.json +4 -0
- package/fields/types/relationship/views/dist/nixxie-cms-core-fields-types-relationship-views.cjs.d.ts +2 -0
- package/fields/types/relationship/views/dist/nixxie-cms-core-fields-types-relationship-views.cjs.js +1213 -0
- package/fields/types/relationship/views/dist/nixxie-cms-core-fields-types-relationship-views.esm.js +1201 -0
- package/fields/types/relationship/views/package.json +4 -0
- package/fields/types/select/views/dist/nixxie-cms-core-fields-types-select-views.cjs.d.ts +2 -0
- package/fields/types/select/views/dist/nixxie-cms-core-fields-types-select-views.cjs.js +422 -0
- package/fields/types/select/views/dist/nixxie-cms-core-fields-types-select-views.esm.js +416 -0
- package/fields/types/select/views/package.json +4 -0
- package/fields/types/text/views/dist/nixxie-cms-core-fields-types-text-views.cjs.d.ts +2 -0
- package/fields/types/text/views/dist/nixxie-cms-core-fields-types-text-views.cjs.js +316 -0
- package/fields/types/text/views/dist/nixxie-cms-core-fields-types-text-views.esm.js +311 -0
- package/fields/types/text/views/package.json +4 -0
- package/fields/types/timestamp/views/dist/nixxie-cms-core-fields-types-timestamp-views.cjs.d.ts +2 -0
- package/fields/types/timestamp/views/dist/nixxie-cms-core-fields-types-timestamp-views.cjs.js +285 -0
- package/fields/types/timestamp/views/dist/nixxie-cms-core-fields-types-timestamp-views.esm.js +279 -0
- package/fields/types/timestamp/views/package.json +4 -0
- package/fields/types/virtual/views/dist/nixxie-cms-core-fields-types-virtual-views.cjs.d.ts +2 -0
- package/fields/types/virtual/views/dist/nixxie-cms-core-fields-types-virtual-views.cjs.js +54 -0
- package/fields/types/virtual/views/dist/nixxie-cms-core-fields-types-virtual-views.esm.js +48 -0
- package/fields/types/virtual/views/package.json +4 -0
- package/graphql-ts/dist/nixxie-cms-core-graphql-ts.cjs.d.ts +2 -0
- package/graphql-ts/dist/nixxie-cms-core-graphql-ts.cjs.js +45 -0
- package/graphql-ts/dist/nixxie-cms-core-graphql-ts.esm.js +2 -0
- package/graphql-ts/package.json +4 -0
- package/package.json +339 -0
- package/schema/package.json +4 -0
- package/scripts/cli/dist/nixxie-cms-core-scripts-cli.cjs.d.ts +2 -0
- package/scripts/cli/dist/nixxie-cms-core-scripts-cli.cjs.js +1607 -0
- package/scripts/cli/dist/nixxie-cms-core-scripts-cli.esm.js +1586 -0
- package/scripts/cli/package.json +4 -0
- package/scripts/dist/nixxie-cms-core-scripts.cjs.d.ts +2 -0
- package/scripts/dist/nixxie-cms-core-scripts.cjs.js +73 -0
- package/scripts/dist/nixxie-cms-core-scripts.esm.js +71 -0
- package/scripts/package.json +4 -0
- package/session/dist/nixxie-cms-core-session.cjs.d.ts +2 -0
- package/session/dist/nixxie-cms-core-session.cjs.js +157 -0
- package/session/dist/nixxie-cms-core-session.esm.js +129 -0
- package/session/package.json +4 -0
- package/src/___internal-do-not-use-will-break-in-patch/admin-ui/id-field-view.tsx +167 -0
- package/src/___internal-do-not-use-will-break-in-patch/admin-ui/pages/App/index.tsx +22 -0
- package/src/___internal-do-not-use-will-break-in-patch/admin-ui/pages/CreateItemPage/index.tsx +71 -0
- package/src/___internal-do-not-use-will-break-in-patch/admin-ui/pages/HomePage/index.tsx +333 -0
- package/src/___internal-do-not-use-will-break-in-patch/admin-ui/pages/ItemPage/common.tsx +358 -0
- package/src/___internal-do-not-use-will-break-in-patch/admin-ui/pages/ItemPage/index.tsx +483 -0
- package/src/___internal-do-not-use-will-break-in-patch/admin-ui/pages/ListPage/FilterAdd.tsx +221 -0
- package/src/___internal-do-not-use-will-break-in-patch/admin-ui/pages/ListPage/PaginationControls.tsx +170 -0
- package/src/___internal-do-not-use-will-break-in-patch/admin-ui/pages/ListPage/Tag.tsx +72 -0
- package/src/___internal-do-not-use-will-break-in-patch/admin-ui/pages/ListPage/index.tsx +1006 -0
- package/src/___internal-do-not-use-will-break-in-patch/admin-ui/pages/NoAccessPage/index.tsx +24 -0
- package/src/___internal-do-not-use-will-break-in-patch/artifacts.ts +5 -0
- package/src/access.ts +25 -0
- package/src/admin-ui/admin-meta-graphql.ts +168 -0
- package/src/admin-ui/apollo.tsx +35 -0
- package/src/admin-ui/components/CellContainer.tsx +6 -0
- package/src/admin-ui/components/CommandPalette.tsx +431 -0
- package/src/admin-ui/components/Container.tsx +14 -0
- package/src/admin-ui/components/CreateButtonLink.tsx +46 -0
- package/src/admin-ui/components/CreateItemDialog.tsx +56 -0
- package/src/admin-ui/components/EmptyState.tsx +52 -0
- package/src/admin-ui/components/Errors.tsx +130 -0
- package/src/admin-ui/components/GraphQLErrorNotice.tsx +78 -0
- package/src/admin-ui/components/InlineCode.tsx +17 -0
- package/src/admin-ui/components/Logo.tsx +70 -0
- package/src/admin-ui/components/Navigation.tsx +385 -0
- package/src/admin-ui/components/NullableFieldWrapper.tsx +72 -0
- package/src/admin-ui/components/PageContainer.tsx +310 -0
- package/src/admin-ui/components/WelcomeDialog.tsx +119 -0
- package/src/admin-ui/components/index.ts +23 -0
- package/src/admin-ui/context.tsx +338 -0
- package/src/admin-ui/image.tsx +2 -0
- package/src/admin-ui/index.tsx +1 -0
- package/src/admin-ui/router.tsx +24 -0
- package/src/admin-ui/system/generateAdminUI.ts +155 -0
- package/src/admin-ui/system/index.ts +1 -0
- package/src/admin-ui/templates/app.ts +60 -0
- package/src/admin-ui/templates/create-item.ts +5 -0
- package/src/admin-ui/templates/home.ts +2 -0
- package/src/admin-ui/templates/index.ts +53 -0
- package/src/admin-ui/templates/item.tsx +5 -0
- package/src/admin-ui/templates/list.tsx +5 -0
- package/src/admin-ui/templates/next-config.ts +16 -0
- package/src/admin-ui/templates/no-access.ts +7 -0
- package/src/admin-ui/utils/Fields.tsx +241 -0
- package/src/admin-ui/utils/actionData.ts +36 -0
- package/src/admin-ui/utils/filters.ts +148 -0
- package/src/admin-ui/utils/index.ts +10 -0
- package/src/admin-ui/utils/pick.ts +12 -0
- package/src/admin-ui/utils/useCreateItem.ts +171 -0
- package/src/admin-ui/utils/usePreventNavigation.tsx +31 -0
- package/src/admin-ui/utils/utils.tsx +127 -0
- package/src/artifacts.ts +110 -0
- package/src/context.ts +1 -0
- package/src/fields/filters/enum-filter.ts +77 -0
- package/src/fields/filters/index.ts +1 -0
- package/src/fields/filters/internal.ts +89 -0
- package/src/fields/filters/providers/mysql.ts +450 -0
- package/src/fields/filters/providers/postgresql.ts +448 -0
- package/src/fields/filters/providers/sqlite.ts +442 -0
- package/src/fields/index.ts +34 -0
- package/src/fields/non-null-graphql.ts +115 -0
- package/src/fields/resolve-hooks.ts +61 -0
- package/src/fields/types/bigInt/index.ts +181 -0
- package/src/fields/types/bigInt/views/index.tsx +254 -0
- package/src/fields/types/bytes/index.ts +275 -0
- package/src/fields/types/bytes/views/index.tsx +190 -0
- package/src/fields/types/calendarDay/index.ts +194 -0
- package/src/fields/types/calendarDay/views/index.tsx +144 -0
- package/src/fields/types/checkbox/index.ts +76 -0
- package/src/fields/types/checkbox/views/index.tsx +97 -0
- package/src/fields/types/decimal/index.ts +182 -0
- package/src/fields/types/decimal/views/index.tsx +215 -0
- package/src/fields/types/file/index.ts +168 -0
- package/src/fields/types/file/views/Field.tsx +300 -0
- package/src/fields/types/file/views/index.tsx +74 -0
- package/src/fields/types/float/index.ts +133 -0
- package/src/fields/types/float/views/index.tsx +215 -0
- package/src/fields/types/image/index.ts +244 -0
- package/src/fields/types/image/internal-utils.ts +58 -0
- package/src/fields/types/image/utils.ts +1 -0
- package/src/fields/types/image/views/Field.tsx +295 -0
- package/src/fields/types/image/views/index.tsx +92 -0
- package/src/fields/types/integer/index.ts +156 -0
- package/src/fields/types/integer/views/index.tsx +255 -0
- package/src/fields/types/json/index.ts +77 -0
- package/src/fields/types/json/views/index.tsx +76 -0
- package/src/fields/types/multiselect/index.ts +212 -0
- package/src/fields/types/multiselect/views/index.tsx +151 -0
- package/src/fields/types/password/index.ts +241 -0
- package/src/fields/types/password/views/index.tsx +342 -0
- package/src/fields/types/relationship/index.ts +381 -0
- package/src/fields/types/relationship/views/ComboboxMany.tsx +110 -0
- package/src/fields/types/relationship/views/ComboboxSingle.tsx +115 -0
- package/src/fields/types/relationship/views/ContextualActions.tsx +139 -0
- package/src/fields/types/relationship/views/RelationshipTable.tsx +190 -0
- package/src/fields/types/relationship/views/index.tsx +492 -0
- package/src/fields/types/relationship/views/types.ts +46 -0
- package/src/fields/types/relationship/views/useApolloQuery.ts +185 -0
- package/src/fields/types/relationship/views/useFilter.tsx +109 -0
- package/src/fields/types/select/index.ts +226 -0
- package/src/fields/types/select/views/SegmentedControl.tsx +83 -0
- package/src/fields/types/select/views/index.tsx +318 -0
- package/src/fields/types/text/index.ts +207 -0
- package/src/fields/types/text/views/index.tsx +273 -0
- package/src/fields/types/timestamp/index.ts +116 -0
- package/src/fields/types/timestamp/views/__tests__/index.tsx +68 -0
- package/src/fields/types/timestamp/views/__tests__/utils.tsx +16 -0
- package/src/fields/types/timestamp/views/index.tsx +262 -0
- package/src/fields/types/timestamp/views/utils.ts +22 -0
- package/src/fields/types/virtual/index.ts +108 -0
- package/src/fields/types/virtual/views/index.tsx +53 -0
- package/src/graphql-ts.ts +32 -0
- package/src/helpers.ts +316 -0
- package/src/index.ts +20 -0
- package/src/lib/admin-meta-graphql.ts +407 -0
- package/src/lib/admin-meta.ts +369 -0
- package/src/lib/coerceAndValidateForGraphQLInput.ts +29 -0
- package/src/lib/context/api.ts +99 -0
- package/src/lib/context/createContext.ts +161 -0
- package/src/lib/context/graphql.ts +300 -0
- package/src/lib/core/access-control.ts +434 -0
- package/src/lib/core/field-assertions.ts +118 -0
- package/src/lib/core/filter-order-access.ts +48 -0
- package/src/lib/core/graphql-errors.ts +76 -0
- package/src/lib/core/hooks.ts +111 -0
- package/src/lib/core/initialise-lists.ts +1097 -0
- package/src/lib/core/mutations/index.ts +917 -0
- package/src/lib/core/mutations/nested-mutation-many-input-resolvers.ts +145 -0
- package/src/lib/core/mutations/nested-mutation-one-input-resolvers.ts +71 -0
- package/src/lib/core/prisma-schema-printer.ts +256 -0
- package/src/lib/core/queries/index.ts +66 -0
- package/src/lib/core/queries/output-field.ts +178 -0
- package/src/lib/core/queries/resolvers.ts +258 -0
- package/src/lib/core/resolve-relationships.ts +303 -0
- package/src/lib/core/utils.ts +56 -0
- package/src/lib/core/where-inputs.ts +130 -0
- package/src/lib/express.ts +109 -0
- package/src/lib/graphql.ts +83 -0
- package/src/lib/id-field.ts +214 -0
- package/src/lib/middleware.ts +68 -0
- package/src/lib/migrations.ts +90 -0
- package/src/lib/otel.ts +43 -0
- package/src/lib/prompts.ts +29 -0
- package/src/lib/system.ts +207 -0
- package/src/lib/telemetry.ts +342 -0
- package/src/lib/typescript-schema-printer.ts +227 -0
- package/src/lib/utils.ts +21 -0
- package/src/pkg-dir.ts +6 -0
- package/src/schema.ts +233 -0
- package/src/scripts/build.ts +64 -0
- package/src/scripts/cli.ts +124 -0
- package/src/scripts/dev.ts +452 -0
- package/src/scripts/esbuild.ts +120 -0
- package/src/scripts/index.ts +20 -0
- package/src/scripts/migrate.ts +214 -0
- package/src/scripts/prisma.ts +49 -0
- package/src/scripts/start.ts +76 -0
- package/src/scripts/telemetry.ts +37 -0
- package/src/scripts/utils.ts +22 -0
- package/src/session.ts +168 -0
- package/src/testing.ts +23 -0
- package/src/types/admin-meta.ts +218 -0
- package/src/types/config/access-control.ts +186 -0
- package/src/types/config/fields.ts +96 -0
- package/src/types/config/hooks.ts +529 -0
- package/src/types/config/index.ts +333 -0
- package/src/types/config/lists.ts +565 -0
- package/src/types/context.ts +530 -0
- package/src/types/core.ts +16 -0
- package/src/types/index.ts +8 -0
- package/src/types/next-fields.ts +499 -0
- package/src/types/prisma.ts +16 -0
- package/src/types/schema/g.ts +5 -0
- package/src/types/schema/gWithContext.ts +20 -0
- package/src/types/schema/index.ts +4 -0
- package/src/types/schema/legacy-alias.d.ts +28 -0
- package/src/types/schema/legacy-alias.js +1 -0
- package/src/types/schema/scalars.ts +220 -0
- package/src/types/session.ts +26 -0
- package/src/types/telemetry.ts +51 -0
- package/src/types/type-info.ts +38 -0
- package/src/types/type-tests.ts +21 -0
- package/src/types/utils.ts +108 -0
- package/static/admin-error.html +53 -0
- package/static/dev-loading.html +146 -0
- package/static/favicon.ico +0 -0
- package/static/favicon.svg +4 -0
- package/system/package.json +4 -0
- package/testing/dist/nixxie-cms-core-testing.cjs.d.ts +2 -0
- package/testing/dist/nixxie-cms-core-testing.cjs.js +29 -0
- package/testing/dist/nixxie-cms-core-testing.esm.js +21 -0
- package/testing/package.json +4 -0
- package/tests/conditional-filters.test.ts +326 -0
- package/tests/telemetry.test.ts +361 -0
- package/tsconfig.json +20 -0
- package/types/dist/nixxie-cms-core-types.cjs.d.ts +2 -0
- package/types/dist/nixxie-cms-core-types.cjs.js +29 -0
- package/types/dist/nixxie-cms-core-types.esm.js +9 -0
- package/types/package.json +4 -0
|
@@ -0,0 +1,190 @@
|
|
|
1
|
+
import { TextField } from '@keystar/ui/text-field'
|
|
2
|
+
import { useState } from 'react'
|
|
3
|
+
|
|
4
|
+
import type { TextFieldMeta } from '..'
|
|
5
|
+
import { NullableFieldWrapper } from '../../../../admin-ui/components'
|
|
6
|
+
import { entriesTyped } from '../../../../lib/core/utils'
|
|
7
|
+
import type {
|
|
8
|
+
FieldController,
|
|
9
|
+
FieldControllerConfig,
|
|
10
|
+
FieldProps,
|
|
11
|
+
SimpleFieldTypeInfo,
|
|
12
|
+
} from '../../../../types'
|
|
13
|
+
|
|
14
|
+
export function Field(props: FieldProps<typeof controller>) {
|
|
15
|
+
const { autoFocus, field, forceValidation, onChange, value, isRequired } = props
|
|
16
|
+
|
|
17
|
+
const [shouldShowErrors, setShouldShowErrors] = useState(false)
|
|
18
|
+
const validationMessages = validate(value, props.isRequired, field.label)
|
|
19
|
+
|
|
20
|
+
const isReadOnly = onChange == null
|
|
21
|
+
const isNull = value.inner.kind === 'null'
|
|
22
|
+
|
|
23
|
+
return (
|
|
24
|
+
<NullableFieldWrapper
|
|
25
|
+
isAllowed={field.isNullable}
|
|
26
|
+
autoFocus={isNull && autoFocus}
|
|
27
|
+
label={field.label}
|
|
28
|
+
isReadOnly={isReadOnly}
|
|
29
|
+
isNull={isNull}
|
|
30
|
+
onChange={() => {
|
|
31
|
+
if (!onChange) return
|
|
32
|
+
|
|
33
|
+
const inner =
|
|
34
|
+
value.inner.kind === 'value'
|
|
35
|
+
? ({ kind: 'null', prev: value.inner.value } as const)
|
|
36
|
+
: ({ kind: 'value', value: value.inner.prev } as const)
|
|
37
|
+
|
|
38
|
+
onChange({ ...value, inner })
|
|
39
|
+
}}
|
|
40
|
+
>
|
|
41
|
+
<TextField
|
|
42
|
+
autoFocus={autoFocus}
|
|
43
|
+
description={field.description}
|
|
44
|
+
label={field.label}
|
|
45
|
+
errorMessage={
|
|
46
|
+
!!validationMessages.length && (shouldShowErrors || forceValidation)
|
|
47
|
+
? validationMessages.join('. ')
|
|
48
|
+
: undefined
|
|
49
|
+
}
|
|
50
|
+
isDisabled={isNull}
|
|
51
|
+
isReadOnly={isReadOnly}
|
|
52
|
+
isRequired={isRequired}
|
|
53
|
+
onBlur={() => {
|
|
54
|
+
setShouldShowErrors(true)
|
|
55
|
+
}}
|
|
56
|
+
onChange={textValue => {
|
|
57
|
+
if (!onChange) return
|
|
58
|
+
onChange({
|
|
59
|
+
...value,
|
|
60
|
+
inner: {
|
|
61
|
+
kind: 'value',
|
|
62
|
+
value: textValue,
|
|
63
|
+
},
|
|
64
|
+
})
|
|
65
|
+
}}
|
|
66
|
+
// maintain the previous value when set to null in aid of continuity for
|
|
67
|
+
// the user. it will be cleared when the item is saved
|
|
68
|
+
value={value.inner.kind === 'value' ? value.inner.value : value.inner.prev}
|
|
69
|
+
/>
|
|
70
|
+
</NullableFieldWrapper>
|
|
71
|
+
)
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
type Config = FieldControllerConfig<TextFieldMeta>
|
|
75
|
+
|
|
76
|
+
function validate(value: TextValue, isRequired: boolean, fieldLabel: string): string[] {
|
|
77
|
+
// if the value is the same as the initial for an update, we don't want to block saving
|
|
78
|
+
// since we're not gonna send it anyway if it's the same
|
|
79
|
+
// and going "fix this thing that is unrelated to the thing you're doing" is bad
|
|
80
|
+
// and also bc it could be null bc of read access control
|
|
81
|
+
if (
|
|
82
|
+
value.kind === 'update' &&
|
|
83
|
+
((value.initial.kind === 'null' && value.inner.kind === 'null') ||
|
|
84
|
+
(value.initial.kind === 'value' &&
|
|
85
|
+
value.inner.kind === 'value' &&
|
|
86
|
+
value.inner.value === value.initial.value))
|
|
87
|
+
) {
|
|
88
|
+
return []
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
if (value.inner.kind === 'null') {
|
|
92
|
+
if (isRequired) return [`${fieldLabel} is required`]
|
|
93
|
+
return []
|
|
94
|
+
}
|
|
95
|
+
return []
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
type InnerTextValue = { kind: 'null'; prev: string } | { kind: 'value'; value: string }
|
|
99
|
+
type TextValue =
|
|
100
|
+
| { kind: 'create'; inner: InnerTextValue }
|
|
101
|
+
| { kind: 'update'; inner: InnerTextValue; initial: InnerTextValue }
|
|
102
|
+
|
|
103
|
+
function deserializeTextValue(value: string | null): InnerTextValue {
|
|
104
|
+
if (value === null) return { kind: 'null', prev: '' }
|
|
105
|
+
return { kind: 'value', value }
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
export function controller(config: Config): FieldController<
|
|
109
|
+
TextValue,
|
|
110
|
+
string,
|
|
111
|
+
SimpleFieldTypeInfo<'String'>['inputs']['where']
|
|
112
|
+
> & {
|
|
113
|
+
isNullable: boolean
|
|
114
|
+
} {
|
|
115
|
+
return {
|
|
116
|
+
fieldKey: config.fieldKey,
|
|
117
|
+
label: config.label,
|
|
118
|
+
description: config.description,
|
|
119
|
+
defaultValue: { kind: 'create', inner: deserializeTextValue(config.fieldMeta.defaultValue) },
|
|
120
|
+
isNullable: config.fieldMeta.isNullable,
|
|
121
|
+
deserialize: data => {
|
|
122
|
+
const inner = deserializeTextValue(data[config.fieldKey])
|
|
123
|
+
return { kind: 'update', inner, initial: inner }
|
|
124
|
+
},
|
|
125
|
+
serialize: value => ({
|
|
126
|
+
[config.fieldKey]: value.inner.kind === 'null' ? null : value.inner.value,
|
|
127
|
+
}),
|
|
128
|
+
|
|
129
|
+
validate: (val, opts) => validate(val, opts.isRequired, config.label).length === 0,
|
|
130
|
+
graphqlSelection: config.fieldKey,
|
|
131
|
+
filter: {
|
|
132
|
+
Filter(props) {
|
|
133
|
+
const { autoFocus, context, typeLabel, onChange, type, value, ...otherProps } = props
|
|
134
|
+
|
|
135
|
+
const labelProps =
|
|
136
|
+
context === 'add' ? { label: config.label, description: typeLabel } : { label: typeLabel }
|
|
137
|
+
|
|
138
|
+
// NOTE: "type" is a valid attribute for an input element, however the
|
|
139
|
+
// prop represents a filter type in this context e.g. "contains_i", so
|
|
140
|
+
// we're filtering it out of the spread.
|
|
141
|
+
// TODO: more consideration is needed for the filter API, once
|
|
142
|
+
// requirements are better understood.
|
|
143
|
+
return (
|
|
144
|
+
<TextField
|
|
145
|
+
{...otherProps}
|
|
146
|
+
{...labelProps}
|
|
147
|
+
autoFocus={autoFocus}
|
|
148
|
+
onChange={onChange}
|
|
149
|
+
value={value}
|
|
150
|
+
/>
|
|
151
|
+
)
|
|
152
|
+
},
|
|
153
|
+
Label({ label, value }) {
|
|
154
|
+
const trimmedLabel = label.toLowerCase().replace(' exactly', '')
|
|
155
|
+
return `${trimmedLabel} "${value}"`
|
|
156
|
+
},
|
|
157
|
+
|
|
158
|
+
graphql: ({ type, value }) => {
|
|
159
|
+
const isNot = type.startsWith('not_')
|
|
160
|
+
const filter = { equals: value }
|
|
161
|
+
return {
|
|
162
|
+
[config.fieldKey]: {
|
|
163
|
+
...(isNot ? { not: filter } : filter),
|
|
164
|
+
},
|
|
165
|
+
}
|
|
166
|
+
},
|
|
167
|
+
parseGraphQL: value => {
|
|
168
|
+
return entriesTyped(value).flatMap(([type, _value]) => {
|
|
169
|
+
if (!_value) return []
|
|
170
|
+
if (type === 'equals') return { type: 'is_i', value: _value as string }
|
|
171
|
+
if (type === 'not') {
|
|
172
|
+
const notValue = _value as any
|
|
173
|
+
if (notValue?.equals) return { type: 'not_i', value: notValue.equals as string }
|
|
174
|
+
}
|
|
175
|
+
return []
|
|
176
|
+
})
|
|
177
|
+
},
|
|
178
|
+
types: {
|
|
179
|
+
is_i: {
|
|
180
|
+
label: 'Is exactly',
|
|
181
|
+
initialValue: '',
|
|
182
|
+
},
|
|
183
|
+
not_i: {
|
|
184
|
+
label: 'Is not exactly',
|
|
185
|
+
initialValue: '',
|
|
186
|
+
},
|
|
187
|
+
},
|
|
188
|
+
},
|
|
189
|
+
}
|
|
190
|
+
}
|
|
@@ -0,0 +1,194 @@
|
|
|
1
|
+
import type {
|
|
2
|
+
GArg,
|
|
3
|
+
GInputObjectType,
|
|
4
|
+
GList,
|
|
5
|
+
GNonNull,
|
|
6
|
+
InferValueFromInputType,
|
|
7
|
+
} from '@graphql-ts/schema'
|
|
8
|
+
|
|
9
|
+
import { g } from '../../..'
|
|
10
|
+
import {
|
|
11
|
+
type BaseListTypeInfo,
|
|
12
|
+
type CommonFieldConfig,
|
|
13
|
+
type FieldTypeFunc,
|
|
14
|
+
type SimpleFieldTypeInfo,
|
|
15
|
+
fieldType,
|
|
16
|
+
orderDirectionEnum,
|
|
17
|
+
} from '../../../types'
|
|
18
|
+
import { filters } from '../../filters'
|
|
19
|
+
import { defaultIsRequired, makeValidateHook } from '../../non-null-graphql'
|
|
20
|
+
import type { CalendarDayFieldMeta } from './views'
|
|
21
|
+
|
|
22
|
+
export type CalendarDayFieldConfig<ListTypeInfo extends BaseListTypeInfo> = CommonFieldConfig<
|
|
23
|
+
ListTypeInfo,
|
|
24
|
+
SimpleFieldTypeInfo<'String' | 'DateTime'>
|
|
25
|
+
> & {
|
|
26
|
+
isIndexed?: boolean | 'unique'
|
|
27
|
+
validation?: {
|
|
28
|
+
isRequired?: boolean
|
|
29
|
+
}
|
|
30
|
+
defaultValue?: string
|
|
31
|
+
db?: {
|
|
32
|
+
isNullable?: boolean
|
|
33
|
+
extendPrismaSchema?: (field: string) => string
|
|
34
|
+
map?: string
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
export function calendarDay<ListTypeInfo extends BaseListTypeInfo>(
|
|
39
|
+
config: CalendarDayFieldConfig<ListTypeInfo> = {}
|
|
40
|
+
): FieldTypeFunc<ListTypeInfo> {
|
|
41
|
+
const { isIndexed, validation, defaultValue } = config
|
|
42
|
+
return meta => {
|
|
43
|
+
if (typeof defaultValue === 'string') {
|
|
44
|
+
try {
|
|
45
|
+
g.CalendarDay.parseValue(defaultValue)
|
|
46
|
+
} catch (err) {
|
|
47
|
+
throw new Error(
|
|
48
|
+
`The calendarDay field at ${meta.listKey}.${meta.fieldKey} specifies defaultValue: ${defaultValue} but values must be provided as a full-date ISO8601 string such as 1970-01-01`
|
|
49
|
+
)
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
const usesNativeDateType = meta.provider === 'postgresql' || meta.provider === 'mysql'
|
|
54
|
+
|
|
55
|
+
function resolveInput(value: string | null | undefined) {
|
|
56
|
+
if (meta.provider === 'sqlite' || value == null) {
|
|
57
|
+
return value
|
|
58
|
+
}
|
|
59
|
+
return dateStringToDateObjectInUTC(value)
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
const { mode, validate } = makeValidateHook(meta, config)
|
|
63
|
+
const commonResolveFilter = mode === 'optional' ? filters.resolveCommon : <T>(x: T) => x
|
|
64
|
+
|
|
65
|
+
return fieldType({
|
|
66
|
+
kind: 'scalar',
|
|
67
|
+
mode,
|
|
68
|
+
scalar: usesNativeDateType ? 'DateTime' : 'String',
|
|
69
|
+
index: isIndexed === true ? 'index' : isIndexed || undefined,
|
|
70
|
+
default:
|
|
71
|
+
typeof defaultValue === 'string'
|
|
72
|
+
? {
|
|
73
|
+
kind: 'literal',
|
|
74
|
+
value: defaultValue,
|
|
75
|
+
}
|
|
76
|
+
: undefined,
|
|
77
|
+
map: config.db?.map,
|
|
78
|
+
extendPrismaSchema: config.db?.extendPrismaSchema,
|
|
79
|
+
nativeType: usesNativeDateType ? 'Date' : undefined,
|
|
80
|
+
})({
|
|
81
|
+
...config,
|
|
82
|
+
...defaultIsRequired(config, validation?.isRequired ?? false),
|
|
83
|
+
hooks: {
|
|
84
|
+
...config.hooks,
|
|
85
|
+
validate,
|
|
86
|
+
},
|
|
87
|
+
input: {
|
|
88
|
+
uniqueWhere:
|
|
89
|
+
isIndexed === 'unique'
|
|
90
|
+
? {
|
|
91
|
+
arg: g.arg({ type: g.CalendarDay }),
|
|
92
|
+
resolve: usesNativeDateType ? dateStringToDateObjectInUTC : undefined,
|
|
93
|
+
}
|
|
94
|
+
: undefined,
|
|
95
|
+
where: {
|
|
96
|
+
arg: g.arg({
|
|
97
|
+
type: mode === 'optional' ? CalendarDayNullableFilter : CalendarDayFilter,
|
|
98
|
+
}),
|
|
99
|
+
resolve: usesNativeDateType
|
|
100
|
+
? value => commonResolveFilter(transformFilterDateStringsToDateObjects(value))
|
|
101
|
+
: commonResolveFilter,
|
|
102
|
+
},
|
|
103
|
+
create: {
|
|
104
|
+
arg: g.arg({
|
|
105
|
+
type: g.CalendarDay,
|
|
106
|
+
defaultValue,
|
|
107
|
+
}),
|
|
108
|
+
resolve(val: string | null | undefined) {
|
|
109
|
+
if (val === undefined) {
|
|
110
|
+
val = defaultValue ?? null
|
|
111
|
+
}
|
|
112
|
+
return resolveInput(val)
|
|
113
|
+
},
|
|
114
|
+
},
|
|
115
|
+
update: { arg: g.arg({ type: g.CalendarDay }), resolve: resolveInput },
|
|
116
|
+
orderBy: { arg: g.arg({ type: orderDirectionEnum }) },
|
|
117
|
+
},
|
|
118
|
+
output: g.field({
|
|
119
|
+
type: g.CalendarDay,
|
|
120
|
+
resolve({ value }) {
|
|
121
|
+
if (value instanceof Date) {
|
|
122
|
+
return value.toISOString().slice(0, 10)
|
|
123
|
+
}
|
|
124
|
+
return value
|
|
125
|
+
},
|
|
126
|
+
}),
|
|
127
|
+
__ksTelemetryFieldTypeName: '@nixxie-cms/calendarDay',
|
|
128
|
+
views: '@nixxie-cms/core/fields/types/calendarDay/views',
|
|
129
|
+
getAdminMeta(): CalendarDayFieldMeta {
|
|
130
|
+
return {
|
|
131
|
+
defaultValue: defaultValue ?? null,
|
|
132
|
+
}
|
|
133
|
+
},
|
|
134
|
+
})
|
|
135
|
+
}
|
|
136
|
+
}
|
|
137
|
+
|
|
138
|
+
function dateStringToDateObjectInUTC(value: string) {
|
|
139
|
+
return new Date(`${value}T00:00Z`)
|
|
140
|
+
}
|
|
141
|
+
|
|
142
|
+
type CalendarDayFilterType = GInputObjectType<{
|
|
143
|
+
equals: GArg<typeof g.CalendarDay>
|
|
144
|
+
in: GArg<GList<GNonNull<typeof g.CalendarDay>>>
|
|
145
|
+
notIn: GArg<GList<GNonNull<typeof g.CalendarDay>>>
|
|
146
|
+
lt: GArg<typeof g.CalendarDay>
|
|
147
|
+
lte: GArg<typeof g.CalendarDay>
|
|
148
|
+
gt: GArg<typeof g.CalendarDay>
|
|
149
|
+
gte: GArg<typeof g.CalendarDay>
|
|
150
|
+
not: GArg<CalendarDayFilterType>
|
|
151
|
+
}>
|
|
152
|
+
|
|
153
|
+
function transformFilterDateStringsToDateObjects(
|
|
154
|
+
filter: InferValueFromInputType<CalendarDayFilterType>
|
|
155
|
+
): Parameters<typeof filters.resolveCommon>[0] {
|
|
156
|
+
if (filter === null) {
|
|
157
|
+
return filter
|
|
158
|
+
}
|
|
159
|
+
return Object.fromEntries(
|
|
160
|
+
Object.entries(filter).map(([key, value]) => {
|
|
161
|
+
if (value == null) {
|
|
162
|
+
return [key, value]
|
|
163
|
+
}
|
|
164
|
+
if (Array.isArray(value)) {
|
|
165
|
+
return [key, value.map(dateStringToDateObjectInUTC)]
|
|
166
|
+
}
|
|
167
|
+
if (typeof value === 'object') {
|
|
168
|
+
return [key, transformFilterDateStringsToDateObjects(value)]
|
|
169
|
+
}
|
|
170
|
+
return [key, dateStringToDateObjectInUTC(value)]
|
|
171
|
+
})
|
|
172
|
+
)
|
|
173
|
+
}
|
|
174
|
+
|
|
175
|
+
const filterFields = (nestedType: CalendarDayFilterType) => ({
|
|
176
|
+
equals: g.arg({ type: g.CalendarDay }),
|
|
177
|
+
in: g.arg({ type: g.list(g.nonNull(g.CalendarDay)) }),
|
|
178
|
+
notIn: g.arg({ type: g.list(g.nonNull(g.CalendarDay)) }),
|
|
179
|
+
lt: g.arg({ type: g.CalendarDay }),
|
|
180
|
+
lte: g.arg({ type: g.CalendarDay }),
|
|
181
|
+
gt: g.arg({ type: g.CalendarDay }),
|
|
182
|
+
gte: g.arg({ type: g.CalendarDay }),
|
|
183
|
+
not: g.arg({ type: nestedType }),
|
|
184
|
+
})
|
|
185
|
+
|
|
186
|
+
const CalendarDayNullableFilter: CalendarDayFilterType = g.inputObject({
|
|
187
|
+
name: 'CalendarDayNullableFilter',
|
|
188
|
+
fields: () => filterFields(CalendarDayNullableFilter),
|
|
189
|
+
})
|
|
190
|
+
|
|
191
|
+
const CalendarDayFilter: CalendarDayFilterType = g.inputObject({
|
|
192
|
+
name: 'CalendarDayFilter',
|
|
193
|
+
fields: () => filterFields(CalendarDayFilter),
|
|
194
|
+
})
|
|
@@ -0,0 +1,144 @@
|
|
|
1
|
+
import { CalendarDate, getLocalTimeZone, now, parseDate } from '@internationalized/date'
|
|
2
|
+
import { useDateFormatter } from '@react-aria/i18n'
|
|
3
|
+
import { useMemo, useReducer, useState } from 'react'
|
|
4
|
+
|
|
5
|
+
import { ToggleButton } from '@keystar/ui/button'
|
|
6
|
+
import { DatePicker } from '@keystar/ui/date-time'
|
|
7
|
+
import { Icon } from '@keystar/ui/icon'
|
|
8
|
+
import { calendarClockIcon } from '@keystar/ui/icon/icons/calendarClockIcon'
|
|
9
|
+
import { Grid } from '@keystar/ui/layout'
|
|
10
|
+
import { TextField } from '@keystar/ui/text-field'
|
|
11
|
+
import { Tooltip, TooltipTrigger } from '@keystar/ui/tooltip'
|
|
12
|
+
import { Text } from '@keystar/ui/typography'
|
|
13
|
+
|
|
14
|
+
import type {
|
|
15
|
+
CellComponent,
|
|
16
|
+
FieldController,
|
|
17
|
+
FieldControllerConfig,
|
|
18
|
+
FieldProps,
|
|
19
|
+
} from '../../../../types'
|
|
20
|
+
|
|
21
|
+
export type Value =
|
|
22
|
+
| { kind: 'create'; value: string | null }
|
|
23
|
+
| { kind: 'update'; value: string | null; initial: string | null }
|
|
24
|
+
|
|
25
|
+
export function Field(props: FieldProps<typeof controller>) {
|
|
26
|
+
const { field, value, forceValidation, onChange, isRequired } = props
|
|
27
|
+
const parsedValue = value.value ? parseDate(value.value) : null
|
|
28
|
+
|
|
29
|
+
const [isDirty, setDirty] = useState(false)
|
|
30
|
+
const [isReadonlyUTC, toggleReadonlyUTC] = useReducer(prev => !prev, false)
|
|
31
|
+
const dateFormatter = useDateFormatter({ dateStyle: 'long' })
|
|
32
|
+
const placeholderValue = useMemo(() => {
|
|
33
|
+
const today = now(getLocalTimeZone())
|
|
34
|
+
return new CalendarDate(today.year, today.month, today.day)
|
|
35
|
+
}, [])
|
|
36
|
+
|
|
37
|
+
// the read-only date field is deceptively interactive, better to render a
|
|
38
|
+
// text field to avoid confusion. when there's no value the field is disabled,
|
|
39
|
+
// placeholder text is shown, and the toggle button is hidden
|
|
40
|
+
if (!onChange) {
|
|
41
|
+
return (
|
|
42
|
+
<Grid
|
|
43
|
+
columns={parsedValue ? 'minmax(0, 1fr) auto' : undefined}
|
|
44
|
+
gap="regular"
|
|
45
|
+
alignItems="end"
|
|
46
|
+
>
|
|
47
|
+
<TextField
|
|
48
|
+
label={field.label}
|
|
49
|
+
description={field.description}
|
|
50
|
+
isDisabled={!parsedValue}
|
|
51
|
+
isReadOnly
|
|
52
|
+
value={
|
|
53
|
+
parsedValue
|
|
54
|
+
? isReadonlyUTC
|
|
55
|
+
? parsedValue.toString()
|
|
56
|
+
: dateFormatter.format(parsedValue.toDate(getLocalTimeZone()))
|
|
57
|
+
: 'yyyy-mm-dd'
|
|
58
|
+
}
|
|
59
|
+
/>
|
|
60
|
+
{!!parsedValue && (
|
|
61
|
+
<TooltipTrigger>
|
|
62
|
+
<ToggleButton
|
|
63
|
+
aria-label="utc time"
|
|
64
|
+
isSelected={isReadonlyUTC}
|
|
65
|
+
onPress={toggleReadonlyUTC}
|
|
66
|
+
>
|
|
67
|
+
<Icon src={calendarClockIcon} />
|
|
68
|
+
</ToggleButton>
|
|
69
|
+
<Tooltip>Local / UTC</Tooltip>
|
|
70
|
+
</TooltipTrigger>
|
|
71
|
+
)}
|
|
72
|
+
</Grid>
|
|
73
|
+
)
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
const showValidation = isDirty || forceValidation
|
|
77
|
+
const validationMessage = showValidation ? validate(value, isRequired, field.label) : undefined
|
|
78
|
+
|
|
79
|
+
return (
|
|
80
|
+
<DatePicker
|
|
81
|
+
label={field.label}
|
|
82
|
+
description={field.description}
|
|
83
|
+
errorMessage={showValidation ? validationMessage : undefined}
|
|
84
|
+
granularity="day"
|
|
85
|
+
// isReadOnly={undefined} // read-only state handled above
|
|
86
|
+
isRequired={isRequired}
|
|
87
|
+
// NOTE: in addition to providing a cue for users about the expected input
|
|
88
|
+
// format, the `placeholderValue` determines the type of value for the
|
|
89
|
+
// field. the implementation below ensures `CalendarDate` so we can avoid
|
|
90
|
+
// unnecessary guards or transformations.
|
|
91
|
+
placeholderValue={placeholderValue}
|
|
92
|
+
onBlur={() => setDirty(true)}
|
|
93
|
+
onChange={datetime => {
|
|
94
|
+
onChange({ ...value, value: datetime?.toString() ?? null })
|
|
95
|
+
}}
|
|
96
|
+
value={parsedValue}
|
|
97
|
+
/>
|
|
98
|
+
)
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
function validate(value: Value, isRequired: boolean, label: string): string | undefined {
|
|
102
|
+
// if we receive null initially on the item view and the current value is null,
|
|
103
|
+
// we should always allow saving it because:
|
|
104
|
+
// - the value might be null in the database and we don't want to prevent saving the whole item because of that
|
|
105
|
+
// - we might have null because of an access control error
|
|
106
|
+
if (value.kind === 'update' && value.initial === null && value.value === null) {
|
|
107
|
+
return undefined
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
if (isRequired && value.value === null) {
|
|
111
|
+
return `${label} is required`
|
|
112
|
+
}
|
|
113
|
+
return undefined
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
export const Cell: CellComponent<typeof controller> = ({ value }) => {
|
|
117
|
+
const dateFormatter = useDateFormatter({ dateStyle: 'medium' })
|
|
118
|
+
return value ? <Text>{dateFormatter.format(new Date(value))}</Text> : null
|
|
119
|
+
}
|
|
120
|
+
|
|
121
|
+
export type CalendarDayFieldMeta = {
|
|
122
|
+
defaultValue: string | null
|
|
123
|
+
}
|
|
124
|
+
|
|
125
|
+
export function controller(
|
|
126
|
+
config: FieldControllerConfig<CalendarDayFieldMeta>
|
|
127
|
+
): FieldController<Value, string> & { fieldMeta: CalendarDayFieldMeta } {
|
|
128
|
+
return {
|
|
129
|
+
fieldKey: config.fieldKey,
|
|
130
|
+
label: config.label,
|
|
131
|
+
description: config.description,
|
|
132
|
+
graphqlSelection: config.fieldKey,
|
|
133
|
+
fieldMeta: config.fieldMeta,
|
|
134
|
+
defaultValue: { kind: 'create', value: null },
|
|
135
|
+
deserialize: data => {
|
|
136
|
+
const value = data[config.fieldKey]
|
|
137
|
+
return { kind: 'update', initial: value, value }
|
|
138
|
+
},
|
|
139
|
+
serialize: ({ value }) => {
|
|
140
|
+
return { [config.fieldKey]: value }
|
|
141
|
+
},
|
|
142
|
+
validate: (value, opts) => validate(value, opts.isRequired, config.label) === undefined,
|
|
143
|
+
}
|
|
144
|
+
}
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
import { userInputError } from '../../../lib/core/graphql-errors'
|
|
2
|
+
import type { SimpleFieldTypeInfo } from '../../../types'
|
|
3
|
+
import {
|
|
4
|
+
type BaseListTypeInfo,
|
|
5
|
+
type CommonFieldConfig,
|
|
6
|
+
type FieldTypeFunc,
|
|
7
|
+
fieldType,
|
|
8
|
+
orderDirectionEnum,
|
|
9
|
+
} from '../../../types'
|
|
10
|
+
import { g } from '../../..'
|
|
11
|
+
import { assertReadIsNonNullAllowed } from '../../non-null-graphql'
|
|
12
|
+
import { filters } from '../../filters'
|
|
13
|
+
import type { controller } from './views'
|
|
14
|
+
|
|
15
|
+
export type CheckboxFieldConfig<ListTypeInfo extends BaseListTypeInfo> = CommonFieldConfig<
|
|
16
|
+
ListTypeInfo,
|
|
17
|
+
SimpleFieldTypeInfo<'Boolean'>
|
|
18
|
+
> & {
|
|
19
|
+
defaultValue?: boolean
|
|
20
|
+
db?: {
|
|
21
|
+
map?: string
|
|
22
|
+
extendPrismaSchema?: (field: string) => string
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
export function checkbox<ListTypeInfo extends BaseListTypeInfo>(
|
|
27
|
+
config: CheckboxFieldConfig<ListTypeInfo> = {}
|
|
28
|
+
): FieldTypeFunc<ListTypeInfo> {
|
|
29
|
+
const { defaultValue = false } = config
|
|
30
|
+
|
|
31
|
+
return meta => {
|
|
32
|
+
if ((config as any).isIndexed === 'unique') {
|
|
33
|
+
throw TypeError("isIndexed: 'unique' is not a supported option for field type checkbox")
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
assertReadIsNonNullAllowed(meta, config, false)
|
|
37
|
+
|
|
38
|
+
return fieldType({
|
|
39
|
+
kind: 'scalar',
|
|
40
|
+
mode: 'required',
|
|
41
|
+
scalar: 'Boolean',
|
|
42
|
+
default: { kind: 'literal', value: defaultValue },
|
|
43
|
+
map: config.db?.map,
|
|
44
|
+
extendPrismaSchema: config.db?.extendPrismaSchema,
|
|
45
|
+
})({
|
|
46
|
+
...config,
|
|
47
|
+
input: {
|
|
48
|
+
where: { arg: g.arg({ type: filters[meta.provider].Boolean.required }) },
|
|
49
|
+
create: {
|
|
50
|
+
arg: g.arg({
|
|
51
|
+
type: g.Boolean,
|
|
52
|
+
defaultValue: typeof defaultValue === 'boolean' ? defaultValue : undefined,
|
|
53
|
+
}),
|
|
54
|
+
resolve(val) {
|
|
55
|
+
if (val === null) throw userInputError('Checkbox fields cannot be set to null')
|
|
56
|
+
return val ?? defaultValue
|
|
57
|
+
},
|
|
58
|
+
},
|
|
59
|
+
update: {
|
|
60
|
+
arg: g.arg({ type: g.Boolean }),
|
|
61
|
+
resolve(val) {
|
|
62
|
+
if (val === null) throw userInputError('Checkbox fields cannot be set to null')
|
|
63
|
+
return val
|
|
64
|
+
},
|
|
65
|
+
},
|
|
66
|
+
orderBy: { arg: g.arg({ type: orderDirectionEnum }) },
|
|
67
|
+
},
|
|
68
|
+
output: g.field({ type: g.Boolean }),
|
|
69
|
+
__ksTelemetryFieldTypeName: '@nixxie-cms/checkbox',
|
|
70
|
+
views: '@nixxie-cms/core/fields/types/checkbox/views',
|
|
71
|
+
getAdminMeta: (): Parameters<typeof controller>[0]['fieldMeta'] => ({
|
|
72
|
+
defaultValue,
|
|
73
|
+
}),
|
|
74
|
+
})
|
|
75
|
+
}
|
|
76
|
+
}
|
|
@@ -0,0 +1,97 @@
|
|
|
1
|
+
import { Checkbox } from '@keystar/ui/checkbox'
|
|
2
|
+
import { Icon } from '@keystar/ui/icon'
|
|
3
|
+
import { checkIcon } from '@keystar/ui/icon/icons/checkIcon'
|
|
4
|
+
import { Text, VisuallyHidden } from '@keystar/ui/typography'
|
|
5
|
+
|
|
6
|
+
import { entriesTyped } from '../../../../lib/core/utils'
|
|
7
|
+
import type {
|
|
8
|
+
CellComponent,
|
|
9
|
+
FieldController,
|
|
10
|
+
FieldControllerConfig,
|
|
11
|
+
FieldProps,
|
|
12
|
+
SimpleFieldTypeInfo,
|
|
13
|
+
} from '../../../../types'
|
|
14
|
+
|
|
15
|
+
export function Field({ field, value, onChange, autoFocus }: FieldProps<typeof controller>) {
|
|
16
|
+
return (
|
|
17
|
+
<Checkbox
|
|
18
|
+
autoFocus={autoFocus}
|
|
19
|
+
isReadOnly={onChange == null}
|
|
20
|
+
isSelected={value}
|
|
21
|
+
onChange={onChange}
|
|
22
|
+
>
|
|
23
|
+
<Text>{field.label}</Text>
|
|
24
|
+
{field.description && <Text slot="description">{field.description}</Text>}
|
|
25
|
+
</Checkbox>
|
|
26
|
+
)
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
export const Cell: CellComponent<typeof controller> = ({ value }) => {
|
|
30
|
+
return value ? <Icon src={checkIcon} aria-label="true" /> : <VisuallyHidden>false</VisuallyHidden>
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
type CheckboxController = FieldController<
|
|
34
|
+
boolean,
|
|
35
|
+
boolean,
|
|
36
|
+
SimpleFieldTypeInfo<'Boolean'>['inputs']['where']
|
|
37
|
+
>
|
|
38
|
+
|
|
39
|
+
export function controller(
|
|
40
|
+
config: FieldControllerConfig<{ defaultValue: boolean }>
|
|
41
|
+
): CheckboxController {
|
|
42
|
+
return {
|
|
43
|
+
fieldKey: config.fieldKey,
|
|
44
|
+
label: config.label,
|
|
45
|
+
description: config.description,
|
|
46
|
+
defaultValue: config.fieldMeta.defaultValue,
|
|
47
|
+
deserialize(item) {
|
|
48
|
+
const value = item[config.fieldKey]
|
|
49
|
+
return typeof value === 'boolean' ? value : false
|
|
50
|
+
},
|
|
51
|
+
serialize(value) {
|
|
52
|
+
return { [config.fieldKey]: value }
|
|
53
|
+
},
|
|
54
|
+
graphqlSelection: config.fieldKey,
|
|
55
|
+
filter: {
|
|
56
|
+
Filter(props) {
|
|
57
|
+
const { autoFocus, context, typeLabel, onChange, value, type, ...otherProps } = props
|
|
58
|
+
return (
|
|
59
|
+
<Checkbox autoFocus={autoFocus} onChange={onChange} isSelected={value} {...otherProps}>
|
|
60
|
+
{typeLabel} {config.label.toLocaleLowerCase()}
|
|
61
|
+
</Checkbox>
|
|
62
|
+
)
|
|
63
|
+
},
|
|
64
|
+
Label({ label, type, value }) {
|
|
65
|
+
return `${label.toLowerCase()} ${value ? 'true' : 'false'}`
|
|
66
|
+
},
|
|
67
|
+
graphql({ type, value }) {
|
|
68
|
+
return {
|
|
69
|
+
[config.fieldKey]: {
|
|
70
|
+
equals: type === 'not' ? !value : value,
|
|
71
|
+
},
|
|
72
|
+
}
|
|
73
|
+
},
|
|
74
|
+
parseGraphQL: value => {
|
|
75
|
+
return entriesTyped(value).flatMap(([type, value]) => {
|
|
76
|
+
if (value == null) return []
|
|
77
|
+
if (type === 'equals') return { type: 'is', value }
|
|
78
|
+
if (type === 'not') {
|
|
79
|
+
if (value.equals == null) return []
|
|
80
|
+
return { type: 'not', value: value.equals }
|
|
81
|
+
}
|
|
82
|
+
return []
|
|
83
|
+
})
|
|
84
|
+
},
|
|
85
|
+
types: {
|
|
86
|
+
is: {
|
|
87
|
+
label: 'Is',
|
|
88
|
+
initialValue: true,
|
|
89
|
+
},
|
|
90
|
+
not: {
|
|
91
|
+
label: 'Is not',
|
|
92
|
+
initialValue: true,
|
|
93
|
+
},
|
|
94
|
+
},
|
|
95
|
+
},
|
|
96
|
+
}
|
|
97
|
+
}
|