@contember/create 2.1.0-alpha.8 → 2.1.0-beta.1
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/dist/development/run.cjs +6 -4
- package/dist/development/run.cjs.map +1 -1
- package/dist/development/run.js +6 -4
- package/dist/development/run.js.map +1 -1
- package/dist/development/src/commands/WorkspaceCreateCommand.cjs +37 -23
- package/dist/development/src/commands/WorkspaceCreateCommand.cjs.map +1 -1
- package/dist/development/src/commands/WorkspaceCreateCommand.js +37 -23
- package/dist/development/src/commands/WorkspaceCreateCommand.js.map +1 -1
- package/dist/development/src/lib/FileSystem.cjs +1 -0
- package/dist/development/src/lib/FileSystem.cjs.map +1 -1
- package/dist/development/src/lib/FileSystem.js +1 -0
- package/dist/development/src/lib/FileSystem.js.map +1 -1
- package/dist/development/src/lib/TemplateInstaller.cjs +28 -12
- package/dist/development/src/lib/TemplateInstaller.cjs.map +1 -1
- package/dist/development/src/lib/TemplateInstaller.js +28 -12
- package/dist/development/src/lib/TemplateInstaller.js.map +1 -1
- package/dist/development/src/lib/packageManagerDetector.cjs +22 -0
- package/dist/development/src/lib/packageManagerDetector.cjs.map +1 -0
- package/dist/development/src/lib/packageManagerDetector.js +22 -0
- package/dist/development/src/lib/packageManagerDetector.js.map +1 -0
- package/dist/development/src/lib/version.cjs.map +1 -1
- package/dist/development/src/lib/version.js.map +1 -1
- package/dist/development/src/paths.cjs.map +1 -1
- package/dist/development/src/paths.js.map +1 -1
- package/dist/production/run.cjs +6 -4
- package/dist/production/run.cjs.map +1 -1
- package/dist/production/run.js +6 -4
- package/dist/production/run.js.map +1 -1
- package/dist/production/src/commands/WorkspaceCreateCommand.cjs +37 -23
- package/dist/production/src/commands/WorkspaceCreateCommand.cjs.map +1 -1
- package/dist/production/src/commands/WorkspaceCreateCommand.js +37 -23
- package/dist/production/src/commands/WorkspaceCreateCommand.js.map +1 -1
- package/dist/production/src/lib/FileSystem.cjs +1 -0
- package/dist/production/src/lib/FileSystem.cjs.map +1 -1
- package/dist/production/src/lib/FileSystem.js +1 -0
- package/dist/production/src/lib/FileSystem.js.map +1 -1
- package/dist/production/src/lib/TemplateInstaller.cjs +28 -12
- package/dist/production/src/lib/TemplateInstaller.cjs.map +1 -1
- package/dist/production/src/lib/TemplateInstaller.js +28 -12
- package/dist/production/src/lib/TemplateInstaller.js.map +1 -1
- package/dist/production/src/lib/packageManagerDetector.cjs +22 -0
- package/dist/production/src/lib/packageManagerDetector.cjs.map +1 -0
- package/dist/production/src/lib/packageManagerDetector.js +22 -0
- package/dist/production/src/lib/packageManagerDetector.js.map +1 -0
- package/dist/production/src/lib/version.cjs.map +1 -1
- package/dist/production/src/lib/version.js.map +1 -1
- package/dist/production/src/paths.cjs.map +1 -1
- package/dist/production/src/paths.js.map +1 -1
- package/dist/types/commands/WorkspaceCreateCommand.d.ts +4 -2
- package/dist/types/commands/WorkspaceCreateCommand.d.ts.map +1 -1
- package/dist/types/lib/FileSystem.d.ts +1 -0
- package/dist/types/lib/FileSystem.d.ts.map +1 -1
- package/dist/types/lib/TemplateInstaller.d.ts.map +1 -1
- package/dist/types/lib/packageManagerDetector.d.ts +3 -0
- package/dist/types/lib/packageManagerDetector.d.ts.map +1 -0
- package/dist/types/tsconfig.tsbuildinfo +1 -1
- package/package.json +15 -6
- package/resources/templates/{template-workspace → default}/.github/workflows/deploy.yaml +1 -1
- package/resources/templates/default/.gitignore.dist +154 -0
- package/resources/templates/default/README.md +98 -0
- package/resources/templates/{template-workspace → default}/admin/.env.development +1 -0
- package/resources/templates/{template-workspace → default}/admin/app/components/layout.tsx +7 -3
- package/resources/templates/default/admin/app/components/navigation.tsx +85 -0
- package/resources/templates/{template-workspace → default}/admin/app/index.tsx +4 -4
- package/resources/templates/default/admin/app/pages/tenant.tsx +160 -0
- package/resources/templates/default/admin/entrypoint/components/layout.tsx +14 -0
- package/resources/templates/default/admin/entrypoint/components/logged-in.tsx +47 -0
- package/resources/templates/default/admin/entrypoint/components/login.tsx +103 -0
- package/resources/templates/default/admin/entrypoint/config.ts +35 -0
- package/resources/templates/default/admin/entrypoint/contexts/login.tsx +18 -0
- package/resources/templates/default/admin/entrypoint/index.tsx +12 -0
- package/resources/templates/default/admin/entrypoint/login-entrypoint.tsx +24 -0
- package/resources/templates/default/admin/entrypoint/pages/index.tsx +48 -0
- package/resources/templates/default/admin/entrypoint/pages/magicLink.tsx +56 -0
- package/resources/templates/default/admin/entrypoint/pages/magicLinkSent.tsx +63 -0
- package/resources/templates/default/admin/entrypoint/pages/passwordReset.tsx +44 -0
- package/resources/templates/default/admin/entrypoint/pages/resetRequest.tsx +35 -0
- package/resources/templates/default/admin/entrypoint/pages/resetRequestSuccess.tsx +34 -0
- package/resources/templates/default/admin/index.css +94 -0
- package/resources/templates/{template-workspace → default}/admin/index.html +1 -1
- package/resources/templates/{template-workspace → default}/admin/lib/binding/binding.tsx +0 -2
- package/resources/templates/{template-workspace → default}/admin/lib/binding/hooks.tsx +14 -8
- package/resources/templates/default/admin/lib/binding/identity.tsx +51 -0
- package/resources/templates/{template-workspace → default}/admin/lib/binding/navigation-guard-dialog.tsx +12 -8
- package/resources/templates/{template-workspace → default}/admin/lib/binding/persist.tsx +7 -5
- package/resources/templates/{template-workspace → default}/admin/lib/block-repeater/block-repeater.tsx +14 -16
- package/resources/templates/{template-workspace → default}/admin/lib/board/board.tsx +61 -47
- package/resources/templates/{template-workspace → default}/admin/lib/buttons/back-button.tsx +1 -1
- package/resources/templates/{template-workspace → default}/admin/lib/datagrid/cells.tsx +49 -35
- package/resources/templates/{template-workspace → default}/admin/lib/datagrid/column-header.tsx +47 -38
- package/resources/templates/{template-workspace → default}/admin/lib/datagrid/columns.tsx +128 -105
- package/resources/templates/{template-workspace → default}/admin/lib/datagrid/elements.tsx +9 -5
- package/resources/templates/{template-workspace → default}/admin/lib/datagrid/empty.tsx +1 -1
- package/resources/templates/{template-workspace → default}/admin/lib/datagrid/filters/boolean.tsx +1 -4
- package/resources/templates/{template-workspace → default}/admin/lib/datagrid/filters/common.tsx +14 -14
- package/resources/templates/{template-workspace → default}/admin/lib/datagrid/filters/date.tsx +35 -21
- package/resources/templates/{template-workspace → default}/admin/lib/datagrid/filters/defined.tsx +0 -1
- package/resources/templates/{template-workspace → default}/admin/lib/datagrid/filters/enum.tsx +24 -30
- package/resources/templates/{template-workspace → default}/admin/lib/datagrid/filters/mobile.tsx +2 -3
- package/resources/templates/{template-workspace → default}/admin/lib/datagrid/filters/number.tsx +0 -3
- package/resources/templates/{template-workspace → default}/admin/lib/datagrid/filters/relation.tsx +36 -30
- package/resources/templates/{template-workspace → default}/admin/lib/datagrid/labels.tsx +0 -1
- package/resources/templates/{template-workspace → default}/admin/lib/datagrid/loader.tsx +2 -7
- package/resources/templates/{template-workspace → default}/admin/lib/datagrid/pagination.tsx +33 -38
- package/resources/templates/{template-workspace → default}/admin/lib/datagrid/table.tsx +8 -6
- package/resources/templates/{template-workspace → default}/admin/lib/datagrid/tiles.tsx +10 -5
- package/resources/templates/{template-workspace → default}/admin/lib/datagrid/toolbar.tsx +10 -7
- package/resources/templates/{template-workspace → default}/admin/lib/datagrid/ui.tsx +12 -15
- package/resources/templates/{template-workspace → default}/admin/lib/dev/login-panel.tsx +23 -16
- package/resources/templates/{template-workspace → default}/admin/lib/dict.ts +17 -5
- package/resources/templates/default/admin/lib/dimensions/dimensions.tsx +159 -0
- package/resources/templates/{template-workspace → default}/admin/lib/editor/block-editor.tsx +22 -10
- package/resources/templates/{template-workspace → default}/admin/lib/editor/common/baseEditorPlugins.tsx +0 -2
- package/resources/templates/default/admin/lib/editor/common/buttons.tsx +205 -0
- package/resources/templates/{template-workspace → default}/admin/lib/editor/common/editor-block-toolbar.tsx +3 -1
- package/resources/templates/{template-workspace → default}/admin/lib/editor/common/editor-canvas.tsx +6 -4
- package/resources/templates/{template-workspace → default}/admin/lib/editor/common/editor-editable-canvas.tsx +0 -1
- package/resources/templates/{template-workspace → default}/admin/lib/editor/common/editor-inline-toolbar.tsx +5 -2
- package/resources/templates/{template-workspace → default}/admin/lib/editor/common/elements/AnchorRenderer.tsx +18 -16
- package/resources/templates/default/admin/lib/editor/common/elements/BlockElement.tsx +60 -0
- package/resources/templates/{template-workspace → default}/admin/lib/editor/common/elements/HeadingRenderer.tsx +1 -1
- package/resources/templates/{template-workspace → default}/admin/lib/editor/common/elements/TableCellElementRenderer.tsx +1 -1
- package/resources/templates/{template-workspace → default}/admin/lib/editor/common/elements/TableElementRenderer.tsx +2 -7
- package/resources/templates/{template-workspace → default}/admin/lib/editor/common/elements/TableRowElementRenderer.tsx +1 -5
- package/resources/templates/{template-workspace → default}/admin/lib/editor/editor-block.tsx +17 -10
- package/resources/templates/{template-workspace → default}/admin/lib/editor/rich-text-view.tsx +11 -6
- package/resources/templates/{template-workspace → default}/admin/lib/editor/rich-text.tsx +6 -7
- package/resources/templates/default/admin/lib/editor/sortable-block.tsx +57 -0
- package/resources/templates/default/admin/lib/form/container.tsx +72 -0
- package/resources/templates/{template-workspace → default}/admin/lib/form/inputs.tsx +14 -12
- package/resources/templates/{template-workspace → default}/admin/lib/form/select.tsx +93 -51
- package/resources/templates/{template-workspace → default}/admin/lib/form/ui.tsx +1 -1
- package/resources/templates/default/admin/lib/form/upload-repeaters.tsx +221 -0
- package/resources/templates/{template-workspace → default}/admin/lib/form/upload.tsx +61 -62
- package/resources/templates/{template-workspace → default}/admin/lib/labels/enum-labels.ts +6 -3
- package/resources/templates/{template-workspace → default}/admin/lib/labels/field-labels.ts +4 -2
- package/resources/templates/{template-workspace → default}/admin/lib/layout/layout-boxed.tsx +39 -29
- package/resources/templates/{template-workspace → default}/admin/lib/layout/slots.tsx +1 -4
- package/resources/templates/{template-workspace → default}/admin/lib/outdated-application-dialog/outdated-application-dialog.tsx +10 -4
- package/resources/templates/{template-workspace → default}/admin/lib/repeater/repeater.tsx +24 -15
- package/resources/templates/{template-workspace → default}/admin/lib/select/create-new.tsx +0 -3
- package/resources/templates/{template-workspace → default}/admin/lib/select/filter.tsx +0 -1
- package/resources/templates/{template-workspace → default}/admin/lib/select/list.tsx +33 -28
- package/resources/templates/default/admin/lib/select/multi-select.tsx +92 -0
- package/resources/templates/default/admin/lib/select/select.tsx +109 -0
- package/resources/templates/default/admin/lib/select/sortable-select.tsx +138 -0
- package/resources/templates/{template-workspace → default}/admin/lib/select/ui.tsx +13 -11
- package/resources/templates/{template-workspace → default}/admin/lib/tenant/forms/change-my-password.tsx +21 -8
- package/resources/templates/{template-workspace → default}/admin/lib/tenant/forms/common.tsx +21 -12
- package/resources/templates/{template-workspace → default}/admin/lib/tenant/forms/create-api-key.tsx +9 -5
- package/resources/templates/{template-workspace → default}/admin/lib/tenant/forms/invite.tsx +12 -7
- package/resources/templates/{template-workspace → default}/admin/lib/tenant/forms/login.tsx +26 -7
- package/resources/templates/{template-workspace → default}/admin/lib/tenant/forms/memberships-control.tsx +32 -20
- package/resources/templates/{template-workspace → default}/admin/lib/tenant/forms/password-reset-request.tsx +9 -5
- package/resources/templates/{template-workspace → default}/admin/lib/tenant/forms/password-reset.tsx +21 -8
- package/resources/templates/{template-workspace → default}/admin/lib/tenant/forms/passwordless-signin-init.tsx +9 -5
- package/resources/templates/{template-workspace → default}/admin/lib/tenant/forms/passwordless-signin.tsx +25 -12
- package/resources/templates/{template-workspace → default}/admin/lib/tenant/forms/update-project-member.tsx +3 -4
- package/resources/templates/{template-workspace → default}/admin/lib/tenant/hooks/useInviteUser.tsx +2 -3
- package/resources/templates/{template-workspace → default}/admin/lib/tenant/listing/api-key-list.tsx +5 -3
- package/resources/templates/{template-workspace → default}/admin/lib/tenant/listing/member-delete-dialog.tsx +13 -2
- package/resources/templates/{template-workspace → default}/admin/lib/tenant/listing/member-list.tsx +17 -11
- package/resources/templates/{template-workspace → default}/admin/lib/tenant/listing/person-list.tsx +6 -4
- package/resources/templates/{template-workspace → default}/admin/lib/tenant/otp/otp-setup.tsx +86 -59
- package/resources/templates/default/admin/lib/toast/toast.tsx +113 -0
- package/resources/templates/{template-workspace → default}/admin/lib/toast/toaster.tsx +0 -1
- package/resources/templates/{template-workspace → default}/admin/lib/ui/alert-dialog.tsx +4 -3
- package/resources/templates/default/admin/lib/ui/button.tsx +30 -0
- package/resources/templates/{template-workspace → default}/admin/lib/ui/card.tsx +1 -1
- package/resources/templates/{template-workspace → default}/admin/lib/ui/dialog.tsx +12 -8
- package/resources/templates/default/admin/lib/ui/dimension.tsx +9 -0
- package/resources/templates/{template-workspace → default}/admin/lib/ui/dropdown.tsx +18 -15
- package/resources/templates/default/admin/lib/ui/input.tsx +68 -0
- package/resources/templates/{template-workspace → default}/admin/lib/ui/loader.tsx +1 -1
- package/resources/templates/{template-workspace → default}/admin/lib/ui/menu.tsx +3 -11
- package/resources/templates/{template-workspace → default}/admin/lib/ui/overlay.tsx +11 -9
- package/resources/templates/{template-workspace → default}/admin/lib/ui/popover.tsx +2 -2
- package/resources/templates/{template-workspace → default}/admin/lib/ui/property-list.tsx +5 -5
- package/resources/templates/{template-workspace → default}/admin/lib/ui/scroll-area.tsx +11 -11
- package/resources/templates/{template-workspace → default}/admin/lib/ui/select.tsx +4 -5
- package/resources/templates/{template-workspace → default}/admin/lib/ui/sheet.tsx +9 -8
- package/resources/templates/{template-workspace → default}/admin/lib/ui/sidebar.tsx +53 -42
- package/resources/templates/{template-workspace → default}/admin/lib/ui/sortable.tsx +1 -1
- package/resources/templates/default/admin/lib/ui/switch.tsx +11 -0
- package/resources/templates/{template-workspace → default}/admin/lib/ui/table.tsx +3 -3
- package/resources/templates/{template-workspace → default}/admin/lib/ui/textarea.tsx +10 -7
- package/resources/templates/{template-workspace → default}/admin/lib/ui/toggle-group.tsx +9 -5
- package/resources/templates/{template-workspace → default}/admin/lib/ui/toggle.tsx +3 -5
- package/resources/templates/{template-workspace → default}/admin/lib/ui/tooltip.tsx +4 -3
- package/resources/templates/{template-workspace → default}/admin/lib/upload/dropzone.tsx +14 -10
- package/resources/templates/{template-workspace → default}/admin/lib/upload/repeater.tsx +0 -1
- package/resources/templates/{template-workspace → default}/admin/lib/upload/ui.tsx +4 -8
- package/resources/templates/{template-workspace → default}/admin/lib/upload/upload-progress.tsx +28 -12
- package/resources/templates/{template-workspace → default}/admin/lib/upload/view.tsx +130 -68
- package/resources/templates/{template-workspace → default}/admin/lib/utils/createComponentOpenHooks.tsx +10 -6
- package/resources/templates/{template-workspace → default}/admin/lib/utils/uic.tsx +24 -14
- package/resources/templates/{template-workspace → default}/admin/lib/utils/use-mobile.ts +1 -3
- package/resources/templates/{template-workspace → default}/admin/package.json +6 -4
- package/resources/templates/default/admin/sentry.ts +26 -0
- package/resources/templates/{template-workspace → default}/admin/tsconfig.json +1 -9
- package/resources/templates/default/admin/vite-env.d.ts +12 -0
- package/resources/templates/default/admin/vite.config.ts +11 -0
- package/resources/templates/default/api/README.md +87 -0
- package/resources/templates/{template-workspace → default}/biome.json +1 -1
- package/resources/templates/default/client/README.md +285 -0
- package/resources/templates/{template-workspace → default}/contember.template.yaml +5 -0
- package/resources/templates/{template-workspace → default}/package.json +1 -1
- package/resources/templates/default/scripts/generate-client.sh +7 -0
- package/resources/templates/default/scripts/update-ui-lib.sh +344 -0
- package/src/commands/WorkspaceCreateCommand.ts +41 -25
- package/src/lib/FileSystem.ts +1 -0
- package/src/lib/TemplateInstaller.ts +32 -12
- package/src/lib/packageManagerDetector.ts +24 -0
- package/src/run.ts +8 -7
- package/resources/templates/template-workspace/.gitignore.dist +0 -3
- package/resources/templates/template-workspace/admin/app/components/navigation.tsx +0 -1
- package/resources/templates/template-workspace/admin/index.css +0 -53
- package/resources/templates/template-workspace/admin/index.tsx +0 -268
- package/resources/templates/template-workspace/admin/lib/binding/identity.tsx +0 -50
- package/resources/templates/template-workspace/admin/lib/dimensions/dimensions.tsx +0 -135
- package/resources/templates/template-workspace/admin/lib/editor/common/buttons.tsx +0 -83
- package/resources/templates/template-workspace/admin/lib/editor/common/elements/BlockElement.tsx +0 -48
- package/resources/templates/template-workspace/admin/lib/editor/sortable-block.tsx +0 -51
- package/resources/templates/template-workspace/admin/lib/form/container.tsx +0 -59
- package/resources/templates/template-workspace/admin/lib/form/upload-repeaters.tsx +0 -188
- package/resources/templates/template-workspace/admin/lib/select/multi-select.tsx +0 -96
- package/resources/templates/template-workspace/admin/lib/select/select.tsx +0 -104
- package/resources/templates/template-workspace/admin/lib/select/sortable-select.tsx +0 -136
- package/resources/templates/template-workspace/admin/lib/toast/toast.tsx +0 -112
- package/resources/templates/template-workspace/admin/lib/ui/button.tsx +0 -29
- package/resources/templates/template-workspace/admin/lib/ui/input.tsx +0 -69
- package/resources/templates/template-workspace/admin/lib/ui/switch.tsx +0 -9
- package/resources/templates/template-workspace/admin/postcss.config.js +0 -6
- package/resources/templates/template-workspace/admin/tailwind.config.js +0 -73
- package/resources/templates/template-workspace/admin/vite-env.d.ts +0 -7
- package/resources/templates/template-workspace/scripts/generate-client.sh +0 -8
- package/resources/templates/{template-workspace → default}/.github/scripts/setup-actions-variables.sh +0 -0
- package/resources/templates/{template-workspace → default}/admin/app/components/logo.tsx +0 -0
- package/resources/templates/{template-workspace → default}/admin/app/config.ts +0 -0
- package/resources/templates/{template-workspace → default}/admin/app/index.html +0 -0
- package/resources/templates/{template-workspace → default}/admin/app/pages/index.tsx +0 -0
- package/resources/templates/{template-workspace → default}/admin/lib/binding/delete.tsx +0 -0
- package/resources/templates/{template-workspace → default}/admin/lib/binding/index.ts +0 -0
- package/resources/templates/{template-workspace → default}/admin/lib/block-repeater/index.ts +0 -0
- package/resources/templates/{template-workspace → default}/admin/lib/board/index.ts +0 -0
- package/resources/templates/{template-workspace → default}/admin/lib/buttons/index.ts +0 -0
- package/resources/templates/{template-workspace → default}/admin/lib/buttons/link-back-button.tsx +0 -0
- package/resources/templates/{template-workspace → default}/admin/lib/datagrid/column-leaf.tsx +0 -0
- package/resources/templates/{template-workspace → default}/admin/lib/datagrid/export.tsx +0 -0
- package/resources/templates/{template-workspace → default}/admin/lib/datagrid/filters/index.ts +0 -0
- package/resources/templates/{template-workspace → default}/admin/lib/datagrid/filters/text.tsx +0 -0
- package/resources/templates/{template-workspace → default}/admin/lib/datagrid/grid.tsx +0 -0
- package/resources/templates/{template-workspace → default}/admin/lib/datagrid/index.ts +21 -21
- /package/resources/templates/{template-workspace → default}/admin/lib/datagrid/layout-switcher.tsx +0 -0
- /package/resources/templates/{template-workspace → default}/admin/lib/dev/index.ts +0 -0
- /package/resources/templates/{template-workspace → default}/admin/lib/dev/todo.tsx +0 -0
- /package/resources/templates/{template-workspace → default}/admin/lib/dimensions/index.ts +0 -0
- /package/resources/templates/{template-workspace → default}/admin/lib/editor/common/elements/HorizontalRuleRenderer.tsx +0 -0
- /package/resources/templates/{template-workspace → default}/admin/lib/editor/common/elements/ListItemRenderer.tsx +0 -0
- /package/resources/templates/{template-workspace → default}/admin/lib/editor/common/elements/OrderedListRenderer.tsx +0 -0
- /package/resources/templates/{template-workspace → default}/admin/lib/editor/common/elements/ParagraphRenderer.tsx +0 -0
- /package/resources/templates/{template-workspace → default}/admin/lib/editor/common/elements/ScrollTargetRenderer.tsx +0 -0
- /package/resources/templates/{template-workspace → default}/admin/lib/editor/common/elements/UnorderedListRenderer.tsx +0 -0
- /package/resources/templates/{template-workspace → default}/admin/lib/editor/common/index.ts +0 -0
- /package/resources/templates/{template-workspace → default}/admin/lib/editor/index.ts +0 -0
- /package/resources/templates/{template-workspace → default}/admin/lib/editor/plugins.tsx +0 -0
- /package/resources/templates/{template-workspace → default}/admin/lib/errors/error-boundary.tsx +0 -0
- /package/resources/templates/{template-workspace → default}/admin/lib/errors/index.ts +0 -0
- /package/resources/templates/{template-workspace → default}/admin/lib/errors/use-error-formatter.ts +0 -0
- /package/resources/templates/{template-workspace → default}/admin/lib/field/formatted-field.tsx +0 -0
- /package/resources/templates/{template-workspace → default}/admin/lib/field/index.ts +0 -0
- /package/resources/templates/{template-workspace → default}/admin/lib/form/index.ts +0 -0
- /package/resources/templates/{template-workspace → default}/admin/lib/form/labels.tsx +0 -0
- /package/resources/templates/{template-workspace → default}/admin/lib/formatting/formatting.ts +0 -0
- /package/resources/templates/{template-workspace → default}/admin/lib/formatting/index.ts +0 -0
- /package/resources/templates/{template-workspace → default}/admin/lib/images/formatImageResizeUrl.ts +0 -0
- /package/resources/templates/{template-workspace → default}/admin/lib/images/index.ts +0 -0
- /package/resources/templates/{template-workspace → default}/admin/lib/labels/index.ts +0 -0
- /package/resources/templates/{template-workspace → default}/admin/lib/layout/index.ts +0 -0
- /package/resources/templates/{template-workspace → default}/admin/lib/layout/layout.tsx +0 -0
- /package/resources/templates/{template-workspace → default}/admin/lib/outdated-application-dialog/index.ts +0 -0
- /package/resources/templates/{template-workspace → default}/admin/lib/repeater/index.ts +0 -0
- /package/resources/templates/{template-workspace → default}/admin/lib/select/highlight.tsx +0 -0
- /package/resources/templates/{template-workspace → default}/admin/lib/select/index.ts +0 -0
- /package/resources/templates/{template-workspace → default}/admin/lib/tenant/forms/index.ts +0 -0
- /package/resources/templates/{template-workspace → default}/admin/lib/tenant/hooks/useInvite.ts +0 -0
- /package/resources/templates/{template-workspace → default}/admin/lib/tenant/index.ts +0 -0
- /package/resources/templates/{template-workspace → default}/admin/lib/tenant/listing/index.ts +0 -0
- /package/resources/templates/{template-workspace → default}/admin/lib/tenant/otp/index.ts +0 -0
- /package/resources/templates/{template-workspace → default}/admin/lib/toast/index.ts +0 -0
- /package/resources/templates/{template-workspace → default}/admin/lib/ui/avatar.tsx +0 -0
- /package/resources/templates/{template-workspace → default}/admin/lib/ui/collapsible.tsx +0 -0
- /package/resources/templates/{template-workspace → default}/admin/lib/ui/divider.tsx +0 -0
- /package/resources/templates/{template-workspace → default}/admin/lib/ui/label.tsx +0 -0
- /package/resources/templates/{template-workspace → default}/admin/lib/ui/progress.tsx +0 -0
- /package/resources/templates/{template-workspace → default}/admin/lib/ui/separator.tsx +0 -0
- /package/resources/templates/{template-workspace → default}/admin/lib/ui/skeleton.tsx +0 -0
- /package/resources/templates/{template-workspace → default}/admin/lib/upload/index.ts +0 -0
- /package/resources/templates/{template-workspace → default}/admin/lib/utils/cn.ts +0 -0
- /package/resources/templates/{template-workspace → default}/admin/lib/utils/index.ts +0 -0
- /package/resources/templates/{template-workspace → default}/admin/public/favicon.png +0 -0
- /package/resources/templates/{template-workspace → default}/api/index.ts +0 -0
- /package/resources/templates/{template-workspace → default}/api/migrations/.gitkeep +0 -0
- /package/resources/templates/{template-workspace → default}/api/model/index.ts +0 -0
- /package/resources/templates/{template-workspace → default}/api/package.json +0 -0
- /package/resources/templates/{template-workspace → default}/api/tsconfig.json +0 -0
- /package/resources/templates/{template-workspace → default}/client/package.json +0 -0
- /package/resources/templates/{template-workspace → default}/client/src/index.ts +0 -0
- /package/resources/templates/{template-workspace → default}/client/tsconfig.json +0 -0
- /package/resources/templates/{template-workspace → default}/docker-compose.yaml +0 -0
- /package/resources/templates/{template-workspace → default}/tsconfig.json +0 -0
- /package/resources/templates/{template-workspace → default}/tsconfig.settings.json +0 -0
|
@@ -0,0 +1,154 @@
|
|
|
1
|
+
### Linux ###
|
|
2
|
+
*~
|
|
3
|
+
|
|
4
|
+
# temporary files which can be created if a process still has a handle open of a deleted file
|
|
5
|
+
.fuse_hidden*
|
|
6
|
+
|
|
7
|
+
# KDE directory preferences
|
|
8
|
+
.directory
|
|
9
|
+
|
|
10
|
+
# Linux trash folder which might appear on any partition or disk
|
|
11
|
+
.Trash-*
|
|
12
|
+
|
|
13
|
+
# .nfs files are created when an open file is removed but is still being accessed
|
|
14
|
+
.nfs*
|
|
15
|
+
|
|
16
|
+
### macOS ###
|
|
17
|
+
# General
|
|
18
|
+
.DS_Store
|
|
19
|
+
.AppleDouble
|
|
20
|
+
.LSOverride
|
|
21
|
+
|
|
22
|
+
# Icon must end with two \r
|
|
23
|
+
Icon
|
|
24
|
+
|
|
25
|
+
# Thumbnails
|
|
26
|
+
._*
|
|
27
|
+
|
|
28
|
+
# Files that might appear in the root of a volume
|
|
29
|
+
.DocumentRevisions-V100
|
|
30
|
+
.fseventsd
|
|
31
|
+
.Spotlight-V100
|
|
32
|
+
.TemporaryItems
|
|
33
|
+
.Trashes
|
|
34
|
+
.VolumeIcon.icns
|
|
35
|
+
.com.apple.timemachine.donotpresent
|
|
36
|
+
|
|
37
|
+
# Directories potentially created on remote AFP share
|
|
38
|
+
.AppleDB
|
|
39
|
+
.AppleDesktop
|
|
40
|
+
Network Trash Folder
|
|
41
|
+
Temporary Items
|
|
42
|
+
.apdisk
|
|
43
|
+
|
|
44
|
+
### macOS Patch ###
|
|
45
|
+
# iCloud generated files
|
|
46
|
+
*.icloud
|
|
47
|
+
|
|
48
|
+
### Node ###
|
|
49
|
+
# Logs
|
|
50
|
+
logs
|
|
51
|
+
*.log
|
|
52
|
+
npm-debug.log*
|
|
53
|
+
yarn-debug.log*
|
|
54
|
+
yarn-error.log*
|
|
55
|
+
lerna-debug.log*
|
|
56
|
+
.pnpm-debug.log*
|
|
57
|
+
|
|
58
|
+
# Diagnostic reports (https://nodejs.org/api/report.html)
|
|
59
|
+
report.[0-9]*.[0-9]*.[0-9]*.[0-9]*.json
|
|
60
|
+
|
|
61
|
+
# Compiled binary addons (https://nodejs.org/api/addons.html)
|
|
62
|
+
build/Release
|
|
63
|
+
|
|
64
|
+
# Dependency directories
|
|
65
|
+
node_modules/
|
|
66
|
+
jspm_packages/
|
|
67
|
+
|
|
68
|
+
# TypeScript cache
|
|
69
|
+
*.tsbuildinfo
|
|
70
|
+
|
|
71
|
+
# Optional npm cache directory
|
|
72
|
+
.npm
|
|
73
|
+
|
|
74
|
+
# Optional stylelint cache
|
|
75
|
+
.stylelintcache
|
|
76
|
+
|
|
77
|
+
# Microbundle cache
|
|
78
|
+
.rpt2_cache/
|
|
79
|
+
.rts2_cache_cjs/
|
|
80
|
+
.rts2_cache_es/
|
|
81
|
+
.rts2_cache_umd/
|
|
82
|
+
|
|
83
|
+
|
|
84
|
+
# Output of 'npm pack'
|
|
85
|
+
*.tgz
|
|
86
|
+
|
|
87
|
+
# Yarn Integrity file
|
|
88
|
+
.yarn-integrity
|
|
89
|
+
|
|
90
|
+
# dotenv environment variable files
|
|
91
|
+
.env
|
|
92
|
+
.env.development.local
|
|
93
|
+
.env.test.local
|
|
94
|
+
.env.production.local
|
|
95
|
+
.env.local
|
|
96
|
+
|
|
97
|
+
# Cloudflare Workers
|
|
98
|
+
.dev.vars
|
|
99
|
+
|
|
100
|
+
# Build output
|
|
101
|
+
dist
|
|
102
|
+
|
|
103
|
+
### react ###
|
|
104
|
+
.DS_*
|
|
105
|
+
**/*.backup.*
|
|
106
|
+
**/*.back.*
|
|
107
|
+
|
|
108
|
+
node_modules
|
|
109
|
+
|
|
110
|
+
### Windows ###
|
|
111
|
+
# Windows thumbnail cache files
|
|
112
|
+
Thumbs.db
|
|
113
|
+
Thumbs.db:encryptable
|
|
114
|
+
ehthumbs.db
|
|
115
|
+
ehthumbs_vista.db
|
|
116
|
+
|
|
117
|
+
# Dump file
|
|
118
|
+
*.stackdump
|
|
119
|
+
|
|
120
|
+
# Folder config file
|
|
121
|
+
[Dd]esktop.ini
|
|
122
|
+
|
|
123
|
+
# Recycle Bin used on file shares
|
|
124
|
+
$RECYCLE.BIN/
|
|
125
|
+
|
|
126
|
+
# Windows Installer files
|
|
127
|
+
*.cab
|
|
128
|
+
*.msi
|
|
129
|
+
*.msix
|
|
130
|
+
*.msm
|
|
131
|
+
*.msp
|
|
132
|
+
|
|
133
|
+
# Windows shortcuts
|
|
134
|
+
*.lnk
|
|
135
|
+
|
|
136
|
+
### yarn ###
|
|
137
|
+
# https://yarnpkg.com/getting-started/qa#which-files-should-be-gitignored
|
|
138
|
+
|
|
139
|
+
.yarn/*
|
|
140
|
+
!.yarn/releases
|
|
141
|
+
!.yarn/patches
|
|
142
|
+
!.yarn/plugins
|
|
143
|
+
!.yarn/sdks
|
|
144
|
+
!.yarn/versions
|
|
145
|
+
|
|
146
|
+
# if you are NOT using Zero-installs, then:
|
|
147
|
+
# comment the following lines
|
|
148
|
+
#!.yarn/cache
|
|
149
|
+
|
|
150
|
+
# and uncomment the following lines
|
|
151
|
+
.pnp.*
|
|
152
|
+
|
|
153
|
+
# Docker Compose override file
|
|
154
|
+
/docker-compose.override.yaml
|
|
@@ -0,0 +1,98 @@
|
|
|
1
|
+
# My awesome multilingual CMS
|
|
2
|
+
|
|
3
|
+
Welcome to your new project created with [Contember AI Studio](https://www.contember.com/studio)! If you need
|
|
4
|
+
assistance, feel free to join the conversation in
|
|
5
|
+
our [GitHub Discussions](https://github.com/orgs/contember/discussions/categories/support).
|
|
6
|
+
|
|
7
|
+
## Getting Started
|
|
8
|
+
|
|
9
|
+
Before you begin, ensure you have:
|
|
10
|
+
|
|
11
|
+
- [Yarn](https://yarnpkg.com/getting-started/install) installed
|
|
12
|
+
- [Docker](https://docs.docker.com/get-docker/) installed and running
|
|
13
|
+
|
|
14
|
+
### Project Overview
|
|
15
|
+
|
|
16
|
+
Your project consists of the following packages:
|
|
17
|
+
|
|
18
|
+
#### [@app/admin](./admin)
|
|
19
|
+
|
|
20
|
+
- **Location:** `./admin`
|
|
21
|
+
- **Description:** A React SPA that serves as the administration UI, built with Contember DataBinding for seamless integration with the Contember API.
|
|
22
|
+
- **Sentry:** [Sentry](https://sentry.io) is integrated into the project. To enable Sentry, set the `VITE_SENTRY_DSN` environment variable in the `.env.production` file.
|
|
23
|
+
|
|
24
|
+
#### [@app/api](./api)
|
|
25
|
+
|
|
26
|
+
- **Location:** `./api`
|
|
27
|
+
- **Description:** Defines the data model and permissions for the Contember API.
|
|
28
|
+
|
|
29
|
+
#### [@app/client](./client)
|
|
30
|
+
|
|
31
|
+
- **Location:** `./client`
|
|
32
|
+
- **Description:** A type-safe GraphQL client for interacting with the Contember API, complete with generated types.
|
|
33
|
+
- **Documentation:** [Client Documentation](./client/README.md)
|
|
34
|
+
|
|
35
|
+
#### [@app/worker](./worker)
|
|
36
|
+
|
|
37
|
+
- **Location:** `./worker`
|
|
38
|
+
- **Description:** A serverless function deployed to Cloudflare Workers for executing server-side operations.
|
|
39
|
+
- **Documentation:** [Worker Documentation](./worker/README.md)
|
|
40
|
+
|
|
41
|
+
- - -
|
|
42
|
+
|
|
43
|
+
## Running the Project Locally
|
|
44
|
+
|
|
45
|
+
Follow these steps to set up and run your project locally:
|
|
46
|
+
|
|
47
|
+
1. **Install Dependencies**
|
|
48
|
+
|
|
49
|
+
Run the following command to install all required dependencies:
|
|
50
|
+
```bash
|
|
51
|
+
{packageManager} install
|
|
52
|
+
```
|
|
53
|
+
|
|
54
|
+
2. **Start the Project**
|
|
55
|
+
|
|
56
|
+
Start the admin application and all necessary services with:
|
|
57
|
+
```bash
|
|
58
|
+
{packageManager} run start
|
|
59
|
+
```
|
|
60
|
+
|
|
61
|
+
This will launch the following components:
|
|
62
|
+
|
|
63
|
+
| Container | Port | Url |
|
|
64
|
+
|------------------|------|------------------------------------------------|
|
|
65
|
+
| Contember Engine | 1481 | [http://localhost:1481](http://localhost:1481) |
|
|
66
|
+
| Postgres | 1482 | [http://localhost:1482](http://localhost:1482) |
|
|
67
|
+
| S3 | 1483 | [http://localhost:1483](http://localhost:1483) |
|
|
68
|
+
| MailPit | 1484 | [http://localhost:1484](http://localhost:1484) |
|
|
69
|
+
| Adminer | 1485 | [http://localhost:1485](http://localhost:1485) |
|
|
70
|
+
| S3 Dashboard | 1486 | [http://localhost:1486](http://localhost:1486) |
|
|
71
|
+
|
|
72
|
+
When you're done, stop the Docker containers with:
|
|
73
|
+
|
|
74
|
+
```bash
|
|
75
|
+
docker compose down
|
|
76
|
+
```
|
|
77
|
+
|
|
78
|
+
- - -
|
|
79
|
+
|
|
80
|
+
## Next Steps
|
|
81
|
+
|
|
82
|
+
Congratulations, your project is now running locally! Access the administration UI
|
|
83
|
+
at [http://localhost:1480](http://localhost:1480/).
|
|
84
|
+
|
|
85
|
+
Enjoy building with Contember!
|
|
86
|
+
|
|
87
|
+
- - -
|
|
88
|
+
|
|
89
|
+
## Update headless UI components
|
|
90
|
+
|
|
91
|
+
To update the headless UI components, run the following command:
|
|
92
|
+
|
|
93
|
+
```bash
|
|
94
|
+
sh ./scripts/update-ui-lib.sh
|
|
95
|
+
```
|
|
96
|
+
|
|
97
|
+
This will update `lib` folder in the `@app/admin` package with the latest headless UI components. If you have made any
|
|
98
|
+
changes to the components, make sure to commit them before running this command.
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { memo, PropsWithChildren } from 'react'
|
|
2
|
-
import {
|
|
3
|
-
import { LayoutComponent, Slots } from '@app/lib/layout'
|
|
4
|
-
import { Navigation } from './navigation'
|
|
2
|
+
import { Navigation, UserNavigation } from './navigation'
|
|
5
3
|
import { Link } from '@contember/interface'
|
|
6
4
|
import { Logo } from './logo'
|
|
5
|
+
import { IdentityLoader } from '~/lib/binding'
|
|
6
|
+
import { LayoutComponent, Slots } from '~/lib/layout'
|
|
7
7
|
|
|
8
8
|
export const Layout = memo(({ children }: PropsWithChildren) => {
|
|
9
9
|
return (
|
|
@@ -20,6 +20,10 @@ export const Layout = memo(({ children }: PropsWithChildren) => {
|
|
|
20
20
|
<Navigation />
|
|
21
21
|
</Slots.Navigation>
|
|
22
22
|
|
|
23
|
+
<Slots.UserNavigation>
|
|
24
|
+
<UserNavigation />
|
|
25
|
+
</Slots.UserNavigation>
|
|
26
|
+
|
|
23
27
|
<Slots.Footer>
|
|
24
28
|
<p><small>Created with <a className="content-link" href="https://www.contember.com/">Contember</a></small></p>
|
|
25
29
|
</Slots.Footer>
|
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
import { Link, LogoutTrigger, useIdentity } from '@contember/interface'
|
|
2
|
+
import { BadgeCheckIcon, BellIcon, ChevronsUpDown, LogOutIcon } from 'lucide-react'
|
|
3
|
+
import { dict } from '~/lib/dict'
|
|
4
|
+
import { Avatar, AvatarFallback } from '~/lib/ui/avatar'
|
|
5
|
+
import { AnchorButton, Button } from '~/lib/ui/button'
|
|
6
|
+
import { DropdownMenu, DropdownMenuContent, DropdownMenuGroup, DropdownMenuItem, DropdownMenuLabel, DropdownMenuSeparator, DropdownMenuTrigger } from '~/lib/ui/dropdown'
|
|
7
|
+
import { SidebarMenuButton } from '~/lib/ui/sidebar'
|
|
8
|
+
import { useIsMobile } from '~/lib/utils/use-mobile'
|
|
9
|
+
|
|
10
|
+
export const Navigation = () => (<div>Navigation</div>)
|
|
11
|
+
|
|
12
|
+
export const UserNavigation = () => {
|
|
13
|
+
const isMobile = useIsMobile()
|
|
14
|
+
const identity = useIdentity()
|
|
15
|
+
|
|
16
|
+
const userEmail = identity?.person?.email
|
|
17
|
+
const userInitial = userEmail?.substring(0, 1).toLocaleUpperCase()
|
|
18
|
+
|
|
19
|
+
return (
|
|
20
|
+
<DropdownMenu>
|
|
21
|
+
<DropdownMenuTrigger asChild>
|
|
22
|
+
<SidebarMenuButton
|
|
23
|
+
size="lg"
|
|
24
|
+
className="data-[state=open]:bg-sidebar-accent data-[state=open]:text-sidebar-accent-foreground"
|
|
25
|
+
>
|
|
26
|
+
<Avatar className="icon h-6 w-6 rounded-lg">
|
|
27
|
+
<AvatarFallback avatarFallbackColorString={userEmail} className="rounded-lg">
|
|
28
|
+
{userInitial}
|
|
29
|
+
</AvatarFallback>
|
|
30
|
+
</Avatar>
|
|
31
|
+
<div className="grid flex-1 text-left text-sm leading-tight">
|
|
32
|
+
<span className="truncate font-semibold">{userEmail}</span>
|
|
33
|
+
</div>
|
|
34
|
+
<ChevronsUpDown className="ml-auto size-4" />
|
|
35
|
+
</SidebarMenuButton>
|
|
36
|
+
</DropdownMenuTrigger>
|
|
37
|
+
<DropdownMenuContent
|
|
38
|
+
className="w-[--radix-dropdown-menu-trigger-width] min-w-56 rounded-lg"
|
|
39
|
+
side={isMobile ? 'bottom' : 'right'}
|
|
40
|
+
align="end"
|
|
41
|
+
sideOffset={4}
|
|
42
|
+
>
|
|
43
|
+
<DropdownMenuLabel className="p-0 font-normal">
|
|
44
|
+
<div className="flex items-center gap-2 pl-3 pr-1 py-1.5 text-left text-sm">
|
|
45
|
+
<Avatar className="h-8 w-8 rounded-lg">
|
|
46
|
+
<AvatarFallback avatarFallbackColorString={userEmail} className="rounded-lg">
|
|
47
|
+
{userInitial}
|
|
48
|
+
</AvatarFallback>
|
|
49
|
+
</Avatar>
|
|
50
|
+
<div className="grid flex-1 text-left text-sm leading-tight">
|
|
51
|
+
<span className="truncate font-semibold">{userEmail}</span>
|
|
52
|
+
</div>
|
|
53
|
+
</div>
|
|
54
|
+
</DropdownMenuLabel>
|
|
55
|
+
<DropdownMenuSeparator />
|
|
56
|
+
<DropdownMenuGroup>
|
|
57
|
+
<DropdownMenuItem>
|
|
58
|
+
<Link to="tenant/security">
|
|
59
|
+
<AnchorButton variant="ghost" size="xs" className="flex gap-2">
|
|
60
|
+
<BadgeCheckIcon size={16} />
|
|
61
|
+
Security
|
|
62
|
+
</AnchorButton>
|
|
63
|
+
</Link>
|
|
64
|
+
</DropdownMenuItem>
|
|
65
|
+
<DropdownMenuItem>
|
|
66
|
+
<Link to="tenant/apiKeys">
|
|
67
|
+
<AnchorButton variant="ghost" size="xs" className="flex gap-2">
|
|
68
|
+
<BellIcon size={16} />
|
|
69
|
+
API keys
|
|
70
|
+
</AnchorButton>
|
|
71
|
+
</Link>
|
|
72
|
+
</DropdownMenuItem>
|
|
73
|
+
</DropdownMenuGroup>
|
|
74
|
+
<DropdownMenuSeparator />
|
|
75
|
+
<DropdownMenuItem>
|
|
76
|
+
<LogoutTrigger>
|
|
77
|
+
<Button variant="ghost" size="xs" className="flex gap-2">
|
|
78
|
+
<LogOutIcon size={16} /> {dict.logout}
|
|
79
|
+
</Button>
|
|
80
|
+
</LogoutTrigger>
|
|
81
|
+
</DropdownMenuItem>
|
|
82
|
+
</DropdownMenuContent>
|
|
83
|
+
</DropdownMenu>
|
|
84
|
+
)
|
|
85
|
+
}
|
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
import { LoginWithEmail } from '../lib/dev'
|
|
2
|
-
import { OutdatedApplicationDialog } from '@app/lib/outdated-application-dialog'
|
|
3
|
-
import { Toaster } from '@app/lib/toast'
|
|
4
1
|
import { ApplicationEntrypoint, PageModule, Pages } from '@contember/interface'
|
|
5
2
|
import { createErrorHandler, DevBar, DevPanel } from '@contember/react-devbar'
|
|
6
3
|
import { SlotsProvider } from '@contember/react-slots'
|
|
7
4
|
import { LogInIcon } from 'lucide-react'
|
|
8
5
|
import { createRoot } from 'react-dom/client'
|
|
9
|
-
import {
|
|
6
|
+
import { OutdatedApplicationDialog } from '~/lib/outdated-application-dialog'
|
|
7
|
+
import { Toaster } from '~/lib/toast'
|
|
10
8
|
import '../index.css'
|
|
9
|
+
import { LoginWithEmail } from '../lib/dev'
|
|
10
|
+
import { Layout } from './components/layout'
|
|
11
11
|
import { getConfig } from './config'
|
|
12
12
|
|
|
13
13
|
const errorHandler = createErrorHandler((dom, react, onRecoverableError) => createRoot(dom, { onRecoverableError }).render(react))
|
|
@@ -0,0 +1,160 @@
|
|
|
1
|
+
import { useProjectSlug } from '@contember/react-client'
|
|
2
|
+
import { ChangeMyPasswordForm, CreateApiKeyForm, InviteForm } from '@contember/react-identity'
|
|
3
|
+
import { KeyRoundIcon, LockKeyholeIcon, UsersIcon } from 'lucide-react'
|
|
4
|
+
import { ReactNode, useRef } from 'react'
|
|
5
|
+
import { Slots } from '~/lib/layout'
|
|
6
|
+
import {
|
|
7
|
+
ApiKeyList,
|
|
8
|
+
ChangeMyPasswordFormFields,
|
|
9
|
+
CreateApiKeyFormFields,
|
|
10
|
+
InviteFormFields,
|
|
11
|
+
MemberListController,
|
|
12
|
+
OtpSetup,
|
|
13
|
+
PersonList,
|
|
14
|
+
} from '~/lib/tenant'
|
|
15
|
+
import { ToastContent, useShowToast } from '~/lib/toast'
|
|
16
|
+
import { Card, CardContent, CardHeader, CardTitle } from '~/lib/ui/card'
|
|
17
|
+
import { Input } from '~/lib/ui/input'
|
|
18
|
+
|
|
19
|
+
const Title = ({ icon, children }: { icon?: ReactNode; children: ReactNode }) => {
|
|
20
|
+
return (
|
|
21
|
+
<div className="flex items-center">
|
|
22
|
+
{icon && <div className="mr-2">{icon}</div>}
|
|
23
|
+
<h1>{children}</h1>
|
|
24
|
+
</div>
|
|
25
|
+
)
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
export const Security = () => {
|
|
29
|
+
const showToast = useShowToast()
|
|
30
|
+
|
|
31
|
+
return (
|
|
32
|
+
<>
|
|
33
|
+
<Slots.Title>
|
|
34
|
+
<Title icon={<LockKeyholeIcon />}>Security</Title>
|
|
35
|
+
</Slots.Title>
|
|
36
|
+
|
|
37
|
+
<div className="flex flex-col gap-4">
|
|
38
|
+
<Card className="w-[40rem] max-w-full">
|
|
39
|
+
<CardHeader>
|
|
40
|
+
<CardTitle className="text-2xl">Change Password</CardTitle>
|
|
41
|
+
</CardHeader>
|
|
42
|
+
<CardContent>
|
|
43
|
+
<ChangeMyPasswordForm onSuccess={() => showToast(
|
|
44
|
+
<ToastContent>Password changed</ToastContent>, { type: 'success' })}>
|
|
45
|
+
<form className="grid gap-4">
|
|
46
|
+
<ChangeMyPasswordFormFields />
|
|
47
|
+
</form>
|
|
48
|
+
</ChangeMyPasswordForm>
|
|
49
|
+
</CardContent>
|
|
50
|
+
</Card>
|
|
51
|
+
<Card className="w-[40rem] max-w-full">
|
|
52
|
+
<CardHeader>
|
|
53
|
+
<CardTitle className="text-2xl">Two-factor setup</CardTitle>
|
|
54
|
+
</CardHeader>
|
|
55
|
+
<CardContent>
|
|
56
|
+
<OtpSetup />
|
|
57
|
+
</CardContent>
|
|
58
|
+
</Card>
|
|
59
|
+
</div>
|
|
60
|
+
</>
|
|
61
|
+
)
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
export const Members = () => {
|
|
65
|
+
const projectSlug = useProjectSlug()!
|
|
66
|
+
const showToast = useShowToast()
|
|
67
|
+
const memberListController = useRef<MemberListController>(undefined)
|
|
68
|
+
|
|
69
|
+
return (
|
|
70
|
+
<>
|
|
71
|
+
<Slots.Title>
|
|
72
|
+
<Title icon={<UsersIcon />}>Members</Title>
|
|
73
|
+
</Slots.Title>
|
|
74
|
+
|
|
75
|
+
<div className="flex flex-col gap-4">
|
|
76
|
+
<Card className="w-[40rem] max-w-full">
|
|
77
|
+
<CardHeader>
|
|
78
|
+
<CardTitle className="text-2xl">Invite</CardTitle>
|
|
79
|
+
</CardHeader>
|
|
80
|
+
<CardContent>
|
|
81
|
+
<InviteForm
|
|
82
|
+
projectSlug={projectSlug}
|
|
83
|
+
initialMemberships={[{ role: 'admin', variables: [] }]}
|
|
84
|
+
onSuccess={args => {
|
|
85
|
+
showToast(
|
|
86
|
+
<ToastContent>Invitation sent to {args.result.person?.email}</ToastContent>, { type: 'success' })
|
|
87
|
+
memberListController.current?.refresh()
|
|
88
|
+
}}
|
|
89
|
+
>
|
|
90
|
+
<form>
|
|
91
|
+
<InviteFormFields projectSlug={projectSlug} />
|
|
92
|
+
</form>
|
|
93
|
+
</InviteForm>
|
|
94
|
+
</CardContent>
|
|
95
|
+
</Card>
|
|
96
|
+
<Card className="w-[40rem] max-w-full">
|
|
97
|
+
<CardHeader>
|
|
98
|
+
<CardTitle className="text-2xl">Members</CardTitle>
|
|
99
|
+
</CardHeader>
|
|
100
|
+
<CardContent>
|
|
101
|
+
<PersonList controller={memberListController} />
|
|
102
|
+
</CardContent>
|
|
103
|
+
</Card>
|
|
104
|
+
|
|
105
|
+
</div>
|
|
106
|
+
</>
|
|
107
|
+
)
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
export const ApiKeys = () => {
|
|
111
|
+
const projectSlug = useProjectSlug()!
|
|
112
|
+
const showToast = useShowToast()
|
|
113
|
+
const memberListController = useRef<MemberListController>(undefined)
|
|
114
|
+
|
|
115
|
+
return (
|
|
116
|
+
<>
|
|
117
|
+
<Slots.Title>
|
|
118
|
+
<Title icon={<KeyRoundIcon />}>API keys</Title>
|
|
119
|
+
</Slots.Title>
|
|
120
|
+
|
|
121
|
+
<div className="flex flex-col gap-4">
|
|
122
|
+
<div>
|
|
123
|
+
<Card className="w-[40rem] max-w-full">
|
|
124
|
+
<CardHeader>
|
|
125
|
+
<CardTitle className="text-2xl">Create API key</CardTitle>
|
|
126
|
+
</CardHeader>
|
|
127
|
+
<CardContent>
|
|
128
|
+
<CreateApiKeyForm
|
|
129
|
+
projectSlug={projectSlug}
|
|
130
|
+
initialMemberships={[{ role: 'admin', variables: [] }]}
|
|
131
|
+
onSuccess={args => {
|
|
132
|
+
showToast((
|
|
133
|
+
<ToastContent title="API key created">
|
|
134
|
+
<Input value={args.result.apiKey.token} type="text" />
|
|
135
|
+
</ToastContent>
|
|
136
|
+
), { type: 'success' })
|
|
137
|
+
memberListController.current?.refresh()
|
|
138
|
+
}}
|
|
139
|
+
>
|
|
140
|
+
<form className="grid gap-4">
|
|
141
|
+
<CreateApiKeyFormFields projectSlug={projectSlug} />
|
|
142
|
+
</form>
|
|
143
|
+
</CreateApiKeyForm>
|
|
144
|
+
</CardContent>
|
|
145
|
+
</Card>
|
|
146
|
+
</div>
|
|
147
|
+
<div>
|
|
148
|
+
<Card className="w-[40rem] max-w-full">
|
|
149
|
+
<CardHeader>
|
|
150
|
+
<CardTitle className="text-2xl">API keys</CardTitle>
|
|
151
|
+
</CardHeader>
|
|
152
|
+
<CardContent>
|
|
153
|
+
<ApiKeyList controller={memberListController} />
|
|
154
|
+
</CardContent>
|
|
155
|
+
</Card>
|
|
156
|
+
</div>
|
|
157
|
+
</div>
|
|
158
|
+
</>
|
|
159
|
+
)
|
|
160
|
+
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
export const Layout = ({ children }: { children?: React.ReactNode }) => (
|
|
2
|
+
<div className="grid md:grid-cols-2 min-h-screen ">
|
|
3
|
+
<div className="bg-gray-100 p-4 flex items-center justify-center">
|
|
4
|
+
{children}
|
|
5
|
+
</div>
|
|
6
|
+
<div className="bg-gray-700 text-white p-4 flex items-center justify-center">
|
|
7
|
+
<div className="w-full max-w-md">
|
|
8
|
+
<div className="text-center text-2xl">Welcome to your app</div>
|
|
9
|
+
<p className="mt-8 text-center text-gray-300">Lorem ipsum dolor sit amet, consectetur adipiscing elit. Donec auctor, sem
|
|
10
|
+
eget ultricies ultricies, sapien urna tristique eros, ac tincidunt felis lacus nec nunc.</p>
|
|
11
|
+
</div>
|
|
12
|
+
</div>
|
|
13
|
+
</div>
|
|
14
|
+
)
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
import { useIdentity } from '@contember/react-identity'
|
|
2
|
+
import { useEffect } from 'react'
|
|
3
|
+
import { Card, CardDescription, CardHeader, CardTitle } from '~/lib/ui/card'
|
|
4
|
+
import { Loader } from '~/lib/ui/loader'
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* Props for {@link LoggedIn} component
|
|
8
|
+
*/
|
|
9
|
+
export type LoggedInProps = {
|
|
10
|
+
/**
|
|
11
|
+
* The URL to redirect to after successful login.
|
|
12
|
+
*/
|
|
13
|
+
appUrl: string
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
/**
|
|
17
|
+
* Props {@link LoggedInProps}
|
|
18
|
+
*
|
|
19
|
+
* `LoggedIn` displays a confirmation UI upon successful login and redirects the user to the specified app URL.
|
|
20
|
+
* Must be used in a context where `useIdentity` is available (e.g., inside a Contember admin interface).
|
|
21
|
+
*
|
|
22
|
+
* #### Example: login redirect screen
|
|
23
|
+
* ```tsx
|
|
24
|
+
* <LoggedIn appUrl="https://admin.example.com/dashboard" />
|
|
25
|
+
* ```
|
|
26
|
+
*/
|
|
27
|
+
export const LoggedIn = ({ appUrl }: LoggedInProps) => {
|
|
28
|
+
const identity = useIdentity()
|
|
29
|
+
|
|
30
|
+
useEffect(() => {
|
|
31
|
+
setTimeout(() => {
|
|
32
|
+
window.location.href = appUrl
|
|
33
|
+
}, 500)
|
|
34
|
+
}, [appUrl])
|
|
35
|
+
|
|
36
|
+
return (
|
|
37
|
+
<Card className="w-96 relative">
|
|
38
|
+
<CardHeader>
|
|
39
|
+
<CardTitle className="text-2xl">Logged in</CardTitle>
|
|
40
|
+
<CardDescription>
|
|
41
|
+
as {identity?.person?.email ?? 'unknown'}
|
|
42
|
+
</CardDescription>
|
|
43
|
+
</CardHeader>
|
|
44
|
+
<Loader position="static" />
|
|
45
|
+
</Card>
|
|
46
|
+
)
|
|
47
|
+
}
|