@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,103 @@
|
|
|
1
|
+
import { ToastContent, useShowToast } from '~/lib/toast'
|
|
2
|
+
import { dict } from '~/lib/dict'
|
|
3
|
+
import { Card, CardContent, CardDescription, CardHeader, CardTitle } from '~/lib/ui/card'
|
|
4
|
+
import { AnchorButton, Button } from '~/lib/ui/button'
|
|
5
|
+
import { LoginFormFields } from '~/lib/tenant'
|
|
6
|
+
import { PasswordlessSignInInitFormFields } from '~/lib/tenant/forms/passwordless-signin-init'
|
|
7
|
+
import { Loader } from '~/lib/ui/loader'
|
|
8
|
+
import { useRedirect } from '@contember/react-routing'
|
|
9
|
+
import { IDP, IDPInitTrigger, IDPState, LoginForm, PasswordlessSignInInitForm } from '@contember/react-identity'
|
|
10
|
+
|
|
11
|
+
/**
|
|
12
|
+
* Props for {@link Login} component
|
|
13
|
+
*/
|
|
14
|
+
export type LoginProps = {
|
|
15
|
+
/**
|
|
16
|
+
* IDPs to be displayed in the login form
|
|
17
|
+
*/
|
|
18
|
+
idps: Record<string, string>
|
|
19
|
+
/**
|
|
20
|
+
* Whether the login form should display a token from environment
|
|
21
|
+
*/
|
|
22
|
+
hasTokenFromEnv: boolean
|
|
23
|
+
/**
|
|
24
|
+
* The URL of the application
|
|
25
|
+
*/
|
|
26
|
+
appUrl: string
|
|
27
|
+
/**
|
|
28
|
+
* Whether the login form should display a magic link
|
|
29
|
+
*/
|
|
30
|
+
magicLink: boolean
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
/**
|
|
34
|
+
* Props {@link LoginProps}
|
|
35
|
+
*
|
|
36
|
+
* `Login` renders a flexible authentication UI supporting multiple identity providers (IDPs), magic link login, and fallback login options.
|
|
37
|
+
* Must be used within a Contember environment where `useShowToast` and `useRedirect` are available.
|
|
38
|
+
*
|
|
39
|
+
* - Supports IDP login (OAuth, SAML, etc.) with customizable labels
|
|
40
|
+
* - Displays errors via toast notifications
|
|
41
|
+
* - Supports magic link (passwordless) login
|
|
42
|
+
* - Optional login as a default user using token from environment
|
|
43
|
+
*
|
|
44
|
+
* #### Example: full-featured login page
|
|
45
|
+
* ```tsx
|
|
46
|
+
* <Login
|
|
47
|
+
* idps={{ github: 'GitHub', google: 'Google' }}
|
|
48
|
+
* hasTokenFromEnv={true}
|
|
49
|
+
* appUrl="https://admin.example.com/dashboard"
|
|
50
|
+
* magicLink={true}
|
|
51
|
+
* />
|
|
52
|
+
* ```
|
|
53
|
+
*/
|
|
54
|
+
export const Login = ({ idps, hasTokenFromEnv, appUrl, magicLink }: LoginProps) => {
|
|
55
|
+
const showToast = useShowToast()
|
|
56
|
+
const redirect = useRedirect()
|
|
57
|
+
|
|
58
|
+
return (
|
|
59
|
+
<IDP
|
|
60
|
+
onInitError={error => showToast(<ToastContent>{dict.tenant.login.idpInitError} {error}</ToastContent>, { type: 'error' })}
|
|
61
|
+
onResponseError={error => showToast(
|
|
62
|
+
<ToastContent>{dict.tenant.login.idpResponseError} {error}</ToastContent>, { type: 'error' })}
|
|
63
|
+
>
|
|
64
|
+
<Card className="w-96 relative">
|
|
65
|
+
<CardHeader>
|
|
66
|
+
<CardTitle className="text-2xl">{dict.tenant.login.title}</CardTitle>
|
|
67
|
+
<CardDescription>
|
|
68
|
+
{dict.tenant.login.description}
|
|
69
|
+
</CardDescription>
|
|
70
|
+
</CardHeader>
|
|
71
|
+
<CardContent>
|
|
72
|
+
{hasTokenFromEnv && <AnchorButton href={appUrl} size="lg" className="w-full" variant="destructive">
|
|
73
|
+
Continue as default user
|
|
74
|
+
</AnchorButton>}
|
|
75
|
+
<LoginForm>
|
|
76
|
+
<form className="grid gap-4">
|
|
77
|
+
<LoginFormFields />
|
|
78
|
+
</form>
|
|
79
|
+
</LoginForm>
|
|
80
|
+
|
|
81
|
+
{Object.entries(idps).map(([idp, label]) => (
|
|
82
|
+
<IDPInitTrigger key={idp} identityProvider={idp}>
|
|
83
|
+
<Button variant="outline" className="w-full">
|
|
84
|
+
{label}
|
|
85
|
+
</Button>
|
|
86
|
+
</IDPInitTrigger>
|
|
87
|
+
))}
|
|
88
|
+
|
|
89
|
+
{magicLink && <PasswordlessSignInInitForm onSuccess={({ result }) => {
|
|
90
|
+
redirect('magicLinkSent(request_id: $requestId)', { requestId: result.requestId })
|
|
91
|
+
}}>
|
|
92
|
+
<form>
|
|
93
|
+
<PasswordlessSignInInitFormFields />
|
|
94
|
+
</form>
|
|
95
|
+
</PasswordlessSignInInitForm>}
|
|
96
|
+
</CardContent>
|
|
97
|
+
<IDPState state={['processing_init', 'processing_response', 'success']}>
|
|
98
|
+
<Loader />
|
|
99
|
+
</IDPState>
|
|
100
|
+
</Card>
|
|
101
|
+
</IDP>
|
|
102
|
+
)
|
|
103
|
+
}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import { ContemberClientProps } from '@contember/react-client'
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Configuration for the login entrypoint.
|
|
5
|
+
* Loads environment variables and prepares configuration for the Contember client.
|
|
6
|
+
*/
|
|
7
|
+
export const loginEntrypointConfig = (() => {
|
|
8
|
+
const apiBaseUrl = import.meta.env.VITE_CONTEMBER_ADMIN_API_BASE_URL
|
|
9
|
+
const loginToken = import.meta.env.VITE_CONTEMBER_ADMIN_LOGIN_TOKEN
|
|
10
|
+
|
|
11
|
+
if (!apiBaseUrl) {
|
|
12
|
+
throw new Error('VITE_CONTEMBER_ADMIN_API_BASE_URL is not set')
|
|
13
|
+
}
|
|
14
|
+
if (!loginToken) {
|
|
15
|
+
throw new Error('VITE_CONTEMBER_ADMIN_LOGIN_TOKEN is not set')
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
const clientConfig = {
|
|
19
|
+
apiBaseUrl,
|
|
20
|
+
loginToken,
|
|
21
|
+
} satisfies ContemberClientProps
|
|
22
|
+
|
|
23
|
+
// You can add more IDPs here
|
|
24
|
+
const identityProviders = {
|
|
25
|
+
// google: 'Login with Google',
|
|
26
|
+
} satisfies Record<string, string>
|
|
27
|
+
|
|
28
|
+
return {
|
|
29
|
+
...clientConfig,
|
|
30
|
+
idps: identityProviders,
|
|
31
|
+
appUrl: '/app',
|
|
32
|
+
hasTokenFromEnv: import.meta.env.VITE_CONTEMBER_ADMIN_SESSION_TOKEN !== '__SESSION_TOKEN__',
|
|
33
|
+
magicLink: true,
|
|
34
|
+
}
|
|
35
|
+
})()
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { createRequiredContext } from '@contember/react-utils'
|
|
2
|
+
import { PropsWithChildren } from 'react'
|
|
3
|
+
|
|
4
|
+
export type LoginConfig = {
|
|
5
|
+
appUrl: string
|
|
6
|
+
hasTokenFromEnv: boolean
|
|
7
|
+
idps: Record<string, string>
|
|
8
|
+
magicLink: boolean
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
const [LoginConfigContext, useLoginConfig] = createRequiredContext<LoginConfig>('LoginConfigContext')
|
|
12
|
+
export { LoginConfigContext, useLoginConfig }
|
|
13
|
+
|
|
14
|
+
export const LoginConfigProvider = ({ children, ...config }: PropsWithChildren<LoginConfig>) => (
|
|
15
|
+
<LoginConfigContext.Provider value={config}>
|
|
16
|
+
{children}
|
|
17
|
+
</LoginConfigContext.Provider>
|
|
18
|
+
)
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { createErrorHandler } from '@contember/react-devbar'
|
|
2
|
+
import { LoginEntrypoint } from './login-entrypoint'
|
|
3
|
+
import { createRoot } from 'react-dom/client'
|
|
4
|
+
import '../index.css'
|
|
5
|
+
import '../sentry'
|
|
6
|
+
import { loginEntrypointConfig } from './config'
|
|
7
|
+
|
|
8
|
+
const errorHandler = createErrorHandler((dom, react, onRecoverableError) => createRoot(dom, { onRecoverableError }).render(react))
|
|
9
|
+
|
|
10
|
+
const rootEl = document.body.appendChild(document.createElement('div'))
|
|
11
|
+
|
|
12
|
+
errorHandler(onRecoverableError => createRoot(rootEl, { onRecoverableError }).render(<LoginEntrypoint {...loginEntrypointConfig} />))
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { ContemberClient, ContemberClientProps } from '@contember/react-client'
|
|
2
|
+
import { type PageModule, Pages, RoutingProvider } from '@contember/react-routing'
|
|
3
|
+
import { Toaster } from '~/lib/toast/toast'
|
|
4
|
+
import { Layout } from './components/layout'
|
|
5
|
+
import { type LoginConfig, LoginConfigProvider } from './contexts/login'
|
|
6
|
+
|
|
7
|
+
export type LoginEntrypointProps = ContemberClientProps & LoginConfig
|
|
8
|
+
|
|
9
|
+
export const LoginEntrypoint = ({ appUrl, hasTokenFromEnv, idps, magicLink, apiBaseUrl, sessionToken, loginToken, project, stage }: LoginEntrypointProps) => (
|
|
10
|
+
<ContemberClient apiBaseUrl={apiBaseUrl} sessionToken={sessionToken} loginToken={loginToken} project={project} stage={stage}>
|
|
11
|
+
<LoginConfigProvider appUrl={appUrl} hasTokenFromEnv={hasTokenFromEnv} idps={idps} magicLink={magicLink}>
|
|
12
|
+
<RoutingProvider pageInQuery>
|
|
13
|
+
<Toaster>
|
|
14
|
+
<Pages
|
|
15
|
+
layout={Layout}
|
|
16
|
+
children={import.meta.glob<PageModule>(
|
|
17
|
+
'./pages/**/*.tsx',
|
|
18
|
+
{ eager: true }
|
|
19
|
+
)} />
|
|
20
|
+
</Toaster>
|
|
21
|
+
</RoutingProvider>
|
|
22
|
+
</LoginConfigProvider>
|
|
23
|
+
</ContemberClient>
|
|
24
|
+
)
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import { CircleAlert } from 'lucide-react'
|
|
2
|
+
import { dict } from '~/lib/dict'
|
|
3
|
+
import { Button } from '~/lib/ui/button'
|
|
4
|
+
import { Card, CardContent } from '~/lib/ui/card'
|
|
5
|
+
import { Loader } from '~/lib/ui/loader'
|
|
6
|
+
import { Overlay } from '~/lib/ui/overlay'
|
|
7
|
+
import { Login } from '../components/login'
|
|
8
|
+
import { LoggedIn } from '../components/logged-in'
|
|
9
|
+
import { useLoginConfig } from '../contexts/login'
|
|
10
|
+
import { IdentityProvider, IdentityState, LogoutTrigger } from '@contember/react-identity'
|
|
11
|
+
|
|
12
|
+
export default () => {
|
|
13
|
+
const entrypointConfig = useLoginConfig()
|
|
14
|
+
|
|
15
|
+
return (
|
|
16
|
+
<IdentityProvider>
|
|
17
|
+
<IdentityState state={['none', 'cleared']}>
|
|
18
|
+
<Login
|
|
19
|
+
appUrl={entrypointConfig.appUrl}
|
|
20
|
+
hasTokenFromEnv={entrypointConfig.hasTokenFromEnv}
|
|
21
|
+
idps={entrypointConfig.idps}
|
|
22
|
+
magicLink={entrypointConfig.magicLink}
|
|
23
|
+
/>
|
|
24
|
+
</IdentityState>
|
|
25
|
+
<IdentityState state="success">
|
|
26
|
+
<LoggedIn appUrl={entrypointConfig.appUrl} />
|
|
27
|
+
</IdentityState>
|
|
28
|
+
<IdentityState state="loading">
|
|
29
|
+
<Loader />
|
|
30
|
+
</IdentityState>
|
|
31
|
+
<IdentityState state="failed">
|
|
32
|
+
<Overlay>
|
|
33
|
+
<Card className="w-72">
|
|
34
|
+
<CardContent className="flex flex-col items-center gap-2">
|
|
35
|
+
<CircleAlert className="h-12 w-12 text-destructive" />
|
|
36
|
+
<p className="text-center text-lg text-gray-600">
|
|
37
|
+
{dict.identityLoader.fail}
|
|
38
|
+
</p>
|
|
39
|
+
<LogoutTrigger>
|
|
40
|
+
<Button>Login again</Button>
|
|
41
|
+
</LogoutTrigger>
|
|
42
|
+
</CardContent>
|
|
43
|
+
</Card>
|
|
44
|
+
</Overlay>
|
|
45
|
+
</IdentityState>
|
|
46
|
+
</IdentityProvider>
|
|
47
|
+
)
|
|
48
|
+
}
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
import { Card, CardContent, CardFooter, CardHeader, CardTitle } from '~/lib/ui/card'
|
|
2
|
+
import { dict } from '~/lib/dict'
|
|
3
|
+
import { Loader } from '~/lib/ui/loader'
|
|
4
|
+
import { PasswordlessSignInFormFields } from '~/lib/tenant/forms/passwordless-signin'
|
|
5
|
+
import { AnchorButton } from '~/lib/ui/button'
|
|
6
|
+
import { Link, useCurrentRequest, useRedirect } from '@contember/react-routing'
|
|
7
|
+
import { PasswordlessSignInForm, usePasswordlessOtpActivator } from '@contember/react-identity'
|
|
8
|
+
|
|
9
|
+
export default () => {
|
|
10
|
+
const request = useCurrentRequest()
|
|
11
|
+
const redirect = useRedirect()
|
|
12
|
+
const requestId = request?.parameters.request_id as string | undefined
|
|
13
|
+
const token = request?.parameters.token as string | undefined
|
|
14
|
+
const otpActivation = usePasswordlessOtpActivator()
|
|
15
|
+
|
|
16
|
+
if (!requestId || !token || otpActivation.type === 'empty') {
|
|
17
|
+
return <p>Invalid request</p>
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
return (
|
|
21
|
+
<Card className="w-96">
|
|
22
|
+
<CardHeader>
|
|
23
|
+
<CardTitle className="text-2xl">{dict.tenant.passwordlessSignIn.title}</CardTitle>
|
|
24
|
+
</CardHeader>
|
|
25
|
+
<CardContent>
|
|
26
|
+
{otpActivation.type === 'otp_activating' && <Loader />}
|
|
27
|
+
{otpActivation.type === 'otp_activation_failed' && <div className="text-red-500 text-center">
|
|
28
|
+
{dict.tenant.otpActivation.errorMessages[otpActivation.error]}
|
|
29
|
+
</div>}
|
|
30
|
+
{otpActivation.type === 'otp_activated' && <div className="flex flex-col items-center gap-4">
|
|
31
|
+
<p className="text-lg text-center">
|
|
32
|
+
Enter the following code where you initiated signing in:
|
|
33
|
+
</p>
|
|
34
|
+
<div className="text-4xl font-bold border p-2 rounded font-mono">
|
|
35
|
+
{otpActivation.otp}
|
|
36
|
+
</div>
|
|
37
|
+
|
|
38
|
+
</div>}
|
|
39
|
+
{otpActivation.type === 'can_proceed_to_login' && <PasswordlessSignInForm onSuccess={() => {
|
|
40
|
+
redirect('index')
|
|
41
|
+
}} requestId={requestId} token={token?.toString()} validationType="token">
|
|
42
|
+
<form>
|
|
43
|
+
<PasswordlessSignInFormFields type="token" />
|
|
44
|
+
</form>
|
|
45
|
+
</PasswordlessSignInForm>}
|
|
46
|
+
</CardContent>
|
|
47
|
+
<CardFooter>
|
|
48
|
+
<Link to="index">
|
|
49
|
+
<AnchorButton variant="link" className="ml-auto">
|
|
50
|
+
{dict.tenant.login.backToLogin}
|
|
51
|
+
</AnchorButton>
|
|
52
|
+
</Link>
|
|
53
|
+
</CardFooter>
|
|
54
|
+
</Card>
|
|
55
|
+
)
|
|
56
|
+
}
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
import { useEffect, useState } from 'react'
|
|
2
|
+
import { Card, CardContent, CardFooter, CardHeader, CardTitle } from '~/lib/ui/card'
|
|
3
|
+
import { dict } from '~/lib/dict'
|
|
4
|
+
import { PasswordlessSignInFormFields } from '~/lib/tenant/forms/passwordless-signin'
|
|
5
|
+
import { MailIcon } from 'lucide-react'
|
|
6
|
+
import { AnchorButton } from '~/lib/ui/button'
|
|
7
|
+
import { PasswordlessSignInForm } from '@contember/react-identity'
|
|
8
|
+
import { Link, useCurrentRequest, useRedirect } from '@contember/react-routing'
|
|
9
|
+
|
|
10
|
+
export default () => {
|
|
11
|
+
const request = useCurrentRequest()
|
|
12
|
+
const redirect = useRedirect()
|
|
13
|
+
const requestId = request?.parameters.request_id as string | undefined
|
|
14
|
+
const [showOtp, setShowOtp] = useState(false)
|
|
15
|
+
|
|
16
|
+
useEffect(() => {
|
|
17
|
+
setTimeout(() => {
|
|
18
|
+
setShowOtp(true)
|
|
19
|
+
}, 5000)
|
|
20
|
+
}, [])
|
|
21
|
+
|
|
22
|
+
if (!requestId) {
|
|
23
|
+
return <p>Invalid request</p>
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
return (
|
|
27
|
+
<Card className="w-96">
|
|
28
|
+
<CardHeader>
|
|
29
|
+
<CardTitle className="text-2xl">{dict.tenant.passwordlessSignIn.title}</CardTitle>
|
|
30
|
+
</CardHeader>
|
|
31
|
+
<CardContent>
|
|
32
|
+
{showOtp ? (<>
|
|
33
|
+
<p className="text-gray-600">Have a verification code? Enter it here:</p>
|
|
34
|
+
<PasswordlessSignInForm onSuccess={() => {
|
|
35
|
+
redirect('index')
|
|
36
|
+
}} requestId={requestId} validationType="otp">
|
|
37
|
+
<form>
|
|
38
|
+
<PasswordlessSignInFormFields type="otp" />
|
|
39
|
+
</form>
|
|
40
|
+
</PasswordlessSignInForm>
|
|
41
|
+
</>) : <div className="flex flex-col items-center justify-center gap-4">
|
|
42
|
+
<MailIcon className="text-gray-300 w-16 h-16" />
|
|
43
|
+
<div className="text-center">
|
|
44
|
+
An email with password reset instructions has been sent to your email address.
|
|
45
|
+
</div>
|
|
46
|
+
<div className="text-xs text-gray-600">
|
|
47
|
+
Do you have a verification code?{' '}
|
|
48
|
+
<span onClick={() => setShowOtp(true)} className="underline cursor-pointer">
|
|
49
|
+
Enter manually
|
|
50
|
+
</span>
|
|
51
|
+
</div>
|
|
52
|
+
</div>}
|
|
53
|
+
</CardContent>
|
|
54
|
+
<CardFooter>
|
|
55
|
+
<Link to="index">
|
|
56
|
+
<AnchorButton variant="link" className="ml-auto">
|
|
57
|
+
{dict.tenant.login.backToLogin}
|
|
58
|
+
</AnchorButton>
|
|
59
|
+
</Link>
|
|
60
|
+
</CardFooter>
|
|
61
|
+
</Card>
|
|
62
|
+
)
|
|
63
|
+
}
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import { ToastContent, useShowToast } from '~/lib/toast'
|
|
2
|
+
import { Card, CardContent, CardDescription, CardFooter, CardHeader, CardTitle } from '~/lib/ui/card'
|
|
3
|
+
import { dict } from '~/lib/dict'
|
|
4
|
+
import { PasswordResetFormFields } from '~/lib/tenant'
|
|
5
|
+
import { AnchorButton } from '~/lib/ui/button'
|
|
6
|
+
import { Link, useCurrentRequest, useRedirect } from '@contember/react-routing'
|
|
7
|
+
import { PasswordResetForm } from '@contember/react-identity'
|
|
8
|
+
|
|
9
|
+
export default () => {
|
|
10
|
+
const request = useCurrentRequest()
|
|
11
|
+
const redirect = useRedirect()
|
|
12
|
+
const showToast = useShowToast()
|
|
13
|
+
const token = request?.parameters.token as string | undefined
|
|
14
|
+
|
|
15
|
+
return (
|
|
16
|
+
<Card className="w-96">
|
|
17
|
+
<CardHeader>
|
|
18
|
+
<CardTitle className="text-2xl">{dict.tenant.passwordReset.title}</CardTitle>
|
|
19
|
+
<CardDescription>
|
|
20
|
+
{dict.tenant.passwordReset.description}
|
|
21
|
+
</CardDescription>
|
|
22
|
+
</CardHeader>
|
|
23
|
+
<CardContent>
|
|
24
|
+
<PasswordResetForm onSuccess={() => {
|
|
25
|
+
showToast(<ToastContent>
|
|
26
|
+
Password has been reset
|
|
27
|
+
</ToastContent>, { type: 'success' })
|
|
28
|
+
redirect('index')
|
|
29
|
+
}} token={token}>
|
|
30
|
+
<form>
|
|
31
|
+
<PasswordResetFormFields hasToken={!!token} />
|
|
32
|
+
</form>
|
|
33
|
+
</PasswordResetForm>
|
|
34
|
+
</CardContent>
|
|
35
|
+
<CardFooter>
|
|
36
|
+
<Link to="index">
|
|
37
|
+
<AnchorButton variant="link" className="ml-auto">
|
|
38
|
+
{dict.tenant.login.backToLogin}
|
|
39
|
+
</AnchorButton>
|
|
40
|
+
</Link>
|
|
41
|
+
</CardFooter>
|
|
42
|
+
</Card>
|
|
43
|
+
)
|
|
44
|
+
}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import { Card, CardContent, CardDescription, CardFooter, CardHeader, CardTitle } from '~/lib/ui/card'
|
|
2
|
+
import { dict } from '~/lib/dict'
|
|
3
|
+
import { PasswordResetRequestFormFields } from '~/lib/tenant'
|
|
4
|
+
import { AnchorButton } from '~/lib/ui/button'
|
|
5
|
+
import { Link, useRedirect } from '@contember/react-routing'
|
|
6
|
+
import { PasswordResetRequestForm } from '@contember/react-identity'
|
|
7
|
+
|
|
8
|
+
export default () => {
|
|
9
|
+
const redirect = useRedirect()
|
|
10
|
+
|
|
11
|
+
return (
|
|
12
|
+
<Card className="w-96">
|
|
13
|
+
<CardHeader>
|
|
14
|
+
<CardTitle className="text-2xl">{dict.tenant.passwordResetRequest.title}</CardTitle>
|
|
15
|
+
<CardDescription>
|
|
16
|
+
{dict.tenant.passwordResetRequest.description}
|
|
17
|
+
</CardDescription>
|
|
18
|
+
</CardHeader>
|
|
19
|
+
<CardContent>
|
|
20
|
+
<PasswordResetRequestForm onSuccess={() => redirect('resetRequestSuccess')}>
|
|
21
|
+
<form>
|
|
22
|
+
<PasswordResetRequestFormFields />
|
|
23
|
+
</form>
|
|
24
|
+
</PasswordResetRequestForm>
|
|
25
|
+
</CardContent>
|
|
26
|
+
<CardFooter>
|
|
27
|
+
<Link to="index">
|
|
28
|
+
<AnchorButton variant="link" className="ml-auto">
|
|
29
|
+
{dict.tenant.login.backToLogin}
|
|
30
|
+
</AnchorButton>
|
|
31
|
+
</Link>
|
|
32
|
+
</CardFooter>
|
|
33
|
+
</Card>
|
|
34
|
+
)
|
|
35
|
+
}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import { Card, CardContent, CardDescription, CardFooter, CardHeader, CardTitle } from '~/lib/ui/card'
|
|
2
|
+
import { dict } from '~/lib/dict'
|
|
3
|
+
import { MailIcon } from 'lucide-react'
|
|
4
|
+
import { AnchorButton } from '~/lib/ui/button'
|
|
5
|
+
import { Link } from '@contember/react-routing'
|
|
6
|
+
|
|
7
|
+
export default () => (
|
|
8
|
+
<Card className="w-96">
|
|
9
|
+
<CardHeader>
|
|
10
|
+
<CardTitle className="text-2xl">{dict.tenant.passwordResetRequest.title}</CardTitle>
|
|
11
|
+
<CardDescription>
|
|
12
|
+
{dict.tenant.passwordResetRequest.description}
|
|
13
|
+
</CardDescription>
|
|
14
|
+
</CardHeader>
|
|
15
|
+
<CardContent>
|
|
16
|
+
<div className="flex flex-col items-center justify-center gap-4">
|
|
17
|
+
<MailIcon className="text-gray-300 w-16 h-16" />
|
|
18
|
+
<div className="text-center">
|
|
19
|
+
An email with password reset instructions has been sent to your email address.
|
|
20
|
+
</div>
|
|
21
|
+
<div className="text-center text-gray-500">
|
|
22
|
+
<Link to="passwordReset"><a className="underline">{dict.tenant.passwordResetRequest.entryCode}</a></Link>
|
|
23
|
+
</div>
|
|
24
|
+
</div>
|
|
25
|
+
</CardContent>
|
|
26
|
+
<CardFooter>
|
|
27
|
+
<Link to="index">
|
|
28
|
+
<AnchorButton variant="link" className="ml-auto">
|
|
29
|
+
{dict.tenant.login.backToLogin}
|
|
30
|
+
</AnchorButton>
|
|
31
|
+
</Link>
|
|
32
|
+
</CardFooter>
|
|
33
|
+
</Card>
|
|
34
|
+
)
|
|
@@ -0,0 +1,94 @@
|
|
|
1
|
+
@import '@contember/react-devbar/index.css' layer(base);
|
|
2
|
+
@import 'tailwindcss';
|
|
3
|
+
|
|
4
|
+
@layer base {
|
|
5
|
+
:root {
|
|
6
|
+
--background: hsl(0 0% 100%);
|
|
7
|
+
--foreground: hsl(240 10% 3.9%);
|
|
8
|
+
--card: hsl(0 0% 100%);
|
|
9
|
+
--card-foreground: hsl(240 10% 3.9%);
|
|
10
|
+
--popover: hsl(0 0% 100%);
|
|
11
|
+
--popover-foreground: hsl(240 10% 3.9%);
|
|
12
|
+
--primary: hsl(240 5.9% 10%);
|
|
13
|
+
--primary-foreground: hsl(0 0% 98%);
|
|
14
|
+
--secondary: hsl(240 4.8% 95.9%);
|
|
15
|
+
--secondary-foreground: hsl(240 5.9% 10%);
|
|
16
|
+
--muted: hsl(240 4.8% 95.9%);
|
|
17
|
+
--muted-foreground: hsl(240 3.8% 46.1%);
|
|
18
|
+
--accent: hsl(240 4.8% 95.9%);
|
|
19
|
+
--accent-foreground: hsl(240 5.9% 10%);
|
|
20
|
+
--destructive: hsl(0 72.22% 50.59%);
|
|
21
|
+
--destructive-foreground: hsl(0 0% 98%);
|
|
22
|
+
--border: hsl(240 5.9% 90%);
|
|
23
|
+
--input: hsl(240 5.9% 90%);
|
|
24
|
+
--ring: hsl(240 5% 64.9%);
|
|
25
|
+
--radius: 0.5rem;
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
.dark {
|
|
29
|
+
--background: hsl(240 10% 3.9%);
|
|
30
|
+
--foreground: hsl(0 0% 98%);
|
|
31
|
+
--card: hsl(240 10% 3.9%);
|
|
32
|
+
--card-foreground: hsl(0 0% 98%);
|
|
33
|
+
--popover: hsl(240 10% 3.9%);
|
|
34
|
+
--popover-foreground: hsl(0 0% 98%);
|
|
35
|
+
--primary: hsl(0 0% 98%);
|
|
36
|
+
--primary-foreground: hsl(240 5.9% 10%);
|
|
37
|
+
--secondary: hsl(240 3.7% 15.9%);
|
|
38
|
+
--secondary-foreground: hsl(0 0% 98%);
|
|
39
|
+
--muted: hsl(240 3.7% 15.9%);
|
|
40
|
+
--muted-foreground: hsl(240 5% 64.9%);
|
|
41
|
+
--accent: hsl(240 3.7% 15.9%);
|
|
42
|
+
--accent-foreground: hsl(0 0% 98%);
|
|
43
|
+
--destructive: hsl(0 62.8% 30.6%);
|
|
44
|
+
--destructive-foreground: hsl(0 85.7% 97.3%);
|
|
45
|
+
--border: hsl(240 3.7% 15.9%);
|
|
46
|
+
--input: hsl(240 3.7% 15.9%);
|
|
47
|
+
--ring: hsl(240 4.9% 83.9%);
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
@utility container {
|
|
52
|
+
margin-inline: auto;
|
|
53
|
+
padding-inline: 2rem;
|
|
54
|
+
|
|
55
|
+
@media screen and (min-width: 1400px) {
|
|
56
|
+
max-width: 1400px;
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
@theme {
|
|
61
|
+
--color-background: var(--background);
|
|
62
|
+
--color-foreground: var(--foreground);
|
|
63
|
+
--color-border: var(--border);
|
|
64
|
+
--color-input: var(--input);
|
|
65
|
+
--color-ring: var(--ring);
|
|
66
|
+
--color-background: var(--background);
|
|
67
|
+
--color-foreground: var(--foreground);
|
|
68
|
+
--color-primary: var(--primary);
|
|
69
|
+
--color-primary-foreground: var(--primary-foreground);
|
|
70
|
+
--color-secondary: var(--secondary);
|
|
71
|
+
--color-secondary-foreground: var(--secondary-foreground);
|
|
72
|
+
--color-destructive: var(--destructive);
|
|
73
|
+
--color-destructive-foreground: var(--destructive-foreground);
|
|
74
|
+
--color-muted: var(--muted);
|
|
75
|
+
--color-muted-foreground: var(--muted-foreground);
|
|
76
|
+
--color-accent: var(--accent);
|
|
77
|
+
--color-accent-foreground: var(--accent-foreground);
|
|
78
|
+
--color-popover: var(--popover);
|
|
79
|
+
--color-popover-foreground: var(--popover-foreground);
|
|
80
|
+
--color-card: var(--card);
|
|
81
|
+
--color-card-foreground: var(--card-foreground);
|
|
82
|
+
|
|
83
|
+
--color-divider: var(--border);
|
|
84
|
+
--color-sidebar-border: var(--border);
|
|
85
|
+
|
|
86
|
+
--border-radius-xl: calc(var(--radius) + 4px),
|
|
87
|
+
--border-radius-lg: var(--radius),
|
|
88
|
+
--border-radius-md: calc(var(--radius) - 2px),
|
|
89
|
+
--border-radius-sm: calc(var(--radius) - 4px),
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
:focus-visible {
|
|
93
|
+
outline: 0
|
|
94
|
+
}
|
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
<link rel="icon" type="image/png" href="favicon.png">
|
|
8
8
|
<link rel="apple-touch-icon" href="apple-touch-icon.png">
|
|
9
9
|
<title>My Contember Application</title>
|
|
10
|
-
<script type="module" src="/index.tsx"></script>
|
|
10
|
+
<script type="module" src="/entrypoint/index.tsx"></script>
|
|
11
11
|
</head>
|
|
12
12
|
|
|
13
13
|
</html>
|
|
@@ -29,7 +29,6 @@ export interface BindingStateRendererProps {
|
|
|
29
29
|
children?: ReactNode
|
|
30
30
|
}
|
|
31
31
|
|
|
32
|
-
|
|
33
32
|
function BindingStateRenderer({ accessorTreeState, children }: BindingStateRendererProps) {
|
|
34
33
|
useEffect(() => {
|
|
35
34
|
if (accessorTreeState.name === 'error' && accessorTreeState.error.type === 'unauthorized') {
|
|
@@ -55,4 +54,3 @@ function BindingStateRenderer({ accessorTreeState, children }: BindingStateRende
|
|
|
55
54
|
|
|
56
55
|
return <>{children}</>
|
|
57
56
|
}
|
|
58
|
-
|
|
@@ -14,7 +14,6 @@ export const usePersistWithFeedback = () => {
|
|
|
14
14
|
}, [onPersistSuccess, triggerPersist])
|
|
15
15
|
}
|
|
16
16
|
|
|
17
|
-
|
|
18
17
|
export const usePersistFeedbackHandlers = () => {
|
|
19
18
|
return {
|
|
20
19
|
onPersistSuccess: usePersistSuccessHandler(),
|
|
@@ -32,15 +31,18 @@ export const usePersistErrorHandler = () => {
|
|
|
32
31
|
title={dict.persist.invalidInputError}
|
|
33
32
|
children={<ul>{errorList.map((it, i) => <li key={i}>{it}</li>)}</ul>}
|
|
34
33
|
details={result.response?.errorMessage}
|
|
35
|
-
/>,
|
|
34
|
+
/>,
|
|
35
|
+
{
|
|
36
36
|
type: 'error',
|
|
37
|
-
}
|
|
37
|
+
},
|
|
38
|
+
)
|
|
38
39
|
} else if (result.type === 'invalidResponse') {
|
|
39
40
|
showToast(
|
|
40
41
|
<ToastContent
|
|
41
42
|
title={dict.persist.invalidResponseError}
|
|
42
43
|
children={dict.persist.invalidResponseErrorDetails}
|
|
43
|
-
/>,
|
|
44
|
+
/>,
|
|
45
|
+
{
|
|
44
46
|
type: 'error',
|
|
45
47
|
},
|
|
46
48
|
)
|
|
@@ -55,16 +57,20 @@ export const usePersistSuccessHandler = () => {
|
|
|
55
57
|
showToast(
|
|
56
58
|
<ToastContent
|
|
57
59
|
title={dict.persist.success}
|
|
58
|
-
/>,
|
|
60
|
+
/>,
|
|
61
|
+
{
|
|
59
62
|
type: 'success',
|
|
60
|
-
}
|
|
63
|
+
},
|
|
64
|
+
)
|
|
61
65
|
if (result.type === 'justSuccess' && result.afterPersistError) {
|
|
62
66
|
showToast(
|
|
63
67
|
<ToastContent
|
|
64
68
|
title={dict.persist.afterPersistError}
|
|
65
|
-
/>,
|
|
69
|
+
/>,
|
|
70
|
+
{
|
|
66
71
|
type: 'warning',
|
|
67
|
-
}
|
|
72
|
+
},
|
|
73
|
+
)
|
|
68
74
|
}
|
|
69
75
|
}, [showToast])
|
|
70
76
|
}
|