@contember/create 2.0.2 → 2.1.0-alpha.10
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/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 +24 -5
- package/dist/development/src/lib/TemplateInstaller.cjs.map +1 -1
- package/dist/development/src/lib/TemplateInstaller.js +24 -5
- 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/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 +24 -5
- package/dist/production/src/lib/TemplateInstaller.cjs.map +1 -1
- package/dist/production/src/lib/TemplateInstaller.js +24 -5
- 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/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 +7 -3
- 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/magicLintSent.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/block-repeater/block-repeater.tsx +4 -4
- package/resources/templates/{template-workspace → default}/admin/lib/board/board.tsx +3 -3
- package/resources/templates/{template-workspace → default}/admin/lib/datagrid/cells.tsx +47 -0
- package/resources/templates/{template-workspace → default}/admin/lib/datagrid/column-header.tsx +1 -1
- package/resources/templates/{template-workspace → default}/admin/lib/datagrid/columns.tsx +72 -9
- package/resources/templates/default/admin/lib/datagrid/elements.tsx +59 -0
- package/resources/templates/{template-workspace → default}/admin/lib/datagrid/empty.tsx +1 -1
- package/resources/templates/{template-workspace → default}/admin/lib/datagrid/filters/date.tsx +4 -4
- package/resources/templates/{template-workspace → default}/admin/lib/datagrid/filters/enum.tsx +37 -0
- package/resources/templates/{template-workspace → default}/admin/lib/datagrid/filters/relation.tsx +1 -1
- package/resources/templates/{template-workspace → default}/admin/lib/datagrid/pagination.tsx +1 -1
- package/resources/templates/{template-workspace → default}/admin/lib/datagrid/table.tsx +1 -1
- package/resources/templates/{template-workspace → default}/admin/lib/datagrid/ui.tsx +4 -4
- package/resources/templates/{template-workspace → default}/admin/lib/dimensions/dimensions.tsx +2 -2
- package/resources/templates/{template-workspace → default}/admin/lib/editor/common/editor-block-toolbar.tsx +1 -1
- package/resources/templates/{template-workspace → default}/admin/lib/editor/common/editor-canvas.tsx +2 -2
- package/resources/templates/{template-workspace → default}/admin/lib/editor/common/editor-inline-toolbar.tsx +1 -1
- package/resources/templates/{template-workspace → default}/admin/lib/editor/common/elements/BlockElement.tsx +2 -2
- package/resources/templates/{template-workspace → default}/admin/lib/editor/common/elements/TableCellElementRenderer.tsx +1 -1
- package/resources/templates/{template-workspace → default}/admin/lib/editor/editor-block.tsx +1 -1
- package/resources/templates/{template-workspace → default}/admin/lib/editor/sortable-block.tsx +1 -1
- package/resources/templates/{template-workspace → default}/admin/lib/form/container.tsx +2 -1
- package/resources/templates/{template-workspace → default}/admin/lib/layout/layout-boxed.tsx +4 -4
- package/resources/templates/{template-workspace → default}/admin/lib/repeater/repeater.tsx +3 -3
- package/resources/templates/{template-workspace → default}/admin/lib/select/ui.tsx +5 -5
- package/resources/templates/{template-workspace → default}/admin/lib/tenant/forms/common.tsx +1 -1
- package/resources/templates/{template-workspace → default}/admin/lib/tenant/forms/memberships-control.tsx +1 -1
- package/resources/templates/{template-workspace → default}/admin/lib/tenant/otp/otp-setup.tsx +1 -1
- package/resources/templates/{template-workspace → default}/admin/lib/toast/toast.tsx +4 -5
- package/resources/templates/{template-workspace → default}/admin/lib/ui/button.tsx +6 -6
- package/resources/templates/{template-workspace → default}/admin/lib/ui/card.tsx +1 -1
- package/resources/templates/{template-workspace → default}/admin/lib/ui/dialog.tsx +2 -2
- package/resources/templates/{template-workspace → default}/admin/lib/ui/dropdown.tsx +6 -6
- package/resources/templates/{template-workspace → default}/admin/lib/ui/input.tsx +11 -11
- package/resources/templates/{template-workspace → default}/admin/lib/ui/overlay.tsx +1 -1
- package/resources/templates/{template-workspace → default}/admin/lib/ui/popover.tsx +1 -1
- package/resources/templates/{template-workspace → default}/admin/lib/ui/property-list.tsx +3 -3
- package/resources/templates/{template-workspace → default}/admin/lib/ui/select.tsx +3 -3
- package/resources/templates/{template-workspace → default}/admin/lib/ui/sheet.tsx +4 -4
- package/resources/templates/{template-workspace → default}/admin/lib/ui/sidebar.tsx +15 -16
- package/resources/templates/{template-workspace → default}/admin/lib/ui/sortable.tsx +1 -1
- package/resources/templates/{template-workspace → default}/admin/lib/ui/switch.tsx +1 -1
- package/resources/templates/{template-workspace → default}/admin/lib/ui/table.tsx +3 -3
- package/resources/templates/{template-workspace → default}/admin/lib/ui/textarea.tsx +3 -3
- package/resources/templates/{template-workspace → default}/admin/lib/ui/toggle.tsx +2 -3
- package/resources/templates/{template-workspace → default}/admin/lib/ui/tooltip.tsx +2 -2
- package/resources/templates/{template-workspace → default}/admin/lib/upload/ui.tsx +4 -4
- package/resources/templates/{template-workspace → default}/admin/lib/upload/upload-progress.tsx +1 -1
- package/resources/templates/{template-workspace → default}/admin/lib/upload/view.tsx +3 -3
- package/resources/templates/{template-workspace → default}/admin/lib/utils/uic.tsx +30 -23
- package/resources/templates/{template-workspace → default}/admin/package.json +6 -3
- package/resources/templates/default/admin/postcss.config.js +5 -0
- 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 +2 -2
- 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 -24
- package/src/lib/FileSystem.ts +1 -0
- package/src/lib/TemplateInstaller.ts +30 -7
- package/src/lib/packageManagerDetector.ts +24 -0
- 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/datagrid/elements.tsx +0 -48
- 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}/.github/workflows/deploy.yaml +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/binding.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/hooks.tsx +0 -0
- /package/resources/templates/{template-workspace → default}/admin/lib/binding/identity.tsx +0 -0
- /package/resources/templates/{template-workspace → default}/admin/lib/binding/index.ts +0 -0
- /package/resources/templates/{template-workspace → default}/admin/lib/binding/navigation-guard-dialog.tsx +0 -0
- /package/resources/templates/{template-workspace → default}/admin/lib/binding/persist.tsx +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/back-button.tsx +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/boolean.tsx +0 -0
- /package/resources/templates/{template-workspace → default}/admin/lib/datagrid/filters/common.tsx +0 -0
- /package/resources/templates/{template-workspace → default}/admin/lib/datagrid/filters/defined.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/mobile.tsx +0 -0
- /package/resources/templates/{template-workspace → default}/admin/lib/datagrid/filters/number.tsx +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 +0 -0
- /package/resources/templates/{template-workspace → default}/admin/lib/datagrid/labels.tsx +0 -0
- /package/resources/templates/{template-workspace → default}/admin/lib/datagrid/layout-switcher.tsx +0 -0
- /package/resources/templates/{template-workspace → default}/admin/lib/datagrid/loader.tsx +0 -0
- /package/resources/templates/{template-workspace → default}/admin/lib/datagrid/tiles.tsx +0 -0
- /package/resources/templates/{template-workspace → default}/admin/lib/datagrid/toolbar.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/login-panel.tsx +0 -0
- /package/resources/templates/{template-workspace → default}/admin/lib/dev/todo.tsx +0 -0
- /package/resources/templates/{template-workspace → default}/admin/lib/dict.ts +0 -0
- /package/resources/templates/{template-workspace → default}/admin/lib/dimensions/index.ts +0 -0
- /package/resources/templates/{template-workspace → default}/admin/lib/editor/block-editor.tsx +0 -0
- /package/resources/templates/{template-workspace → default}/admin/lib/editor/common/baseEditorPlugins.tsx +0 -0
- /package/resources/templates/{template-workspace → default}/admin/lib/editor/common/buttons.tsx +0 -0
- /package/resources/templates/{template-workspace → default}/admin/lib/editor/common/editor-editable-canvas.tsx +0 -0
- /package/resources/templates/{template-workspace → default}/admin/lib/editor/common/elements/AnchorRenderer.tsx +0 -0
- /package/resources/templates/{template-workspace → default}/admin/lib/editor/common/elements/HeadingRenderer.tsx +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/TableElementRenderer.tsx +0 -0
- /package/resources/templates/{template-workspace → default}/admin/lib/editor/common/elements/TableRowElementRenderer.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/editor/rich-text-view.tsx +0 -0
- /package/resources/templates/{template-workspace → default}/admin/lib/editor/rich-text.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/inputs.tsx +0 -0
- /package/resources/templates/{template-workspace → default}/admin/lib/form/labels.tsx +0 -0
- /package/resources/templates/{template-workspace → default}/admin/lib/form/select.tsx +0 -0
- /package/resources/templates/{template-workspace → default}/admin/lib/form/ui.tsx +0 -0
- /package/resources/templates/{template-workspace → default}/admin/lib/form/upload-repeaters.tsx +0 -0
- /package/resources/templates/{template-workspace → default}/admin/lib/form/upload.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/enum-labels.ts +0 -0
- /package/resources/templates/{template-workspace → default}/admin/lib/labels/field-labels.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/layout/slots.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/outdated-application-dialog/outdated-application-dialog.tsx +0 -0
- /package/resources/templates/{template-workspace → default}/admin/lib/repeater/index.ts +0 -0
- /package/resources/templates/{template-workspace → default}/admin/lib/select/create-new.tsx +0 -0
- /package/resources/templates/{template-workspace → default}/admin/lib/select/filter.tsx +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/select/list.tsx +0 -0
- /package/resources/templates/{template-workspace → default}/admin/lib/select/multi-select.tsx +0 -0
- /package/resources/templates/{template-workspace → default}/admin/lib/select/select.tsx +0 -0
- /package/resources/templates/{template-workspace → default}/admin/lib/select/sortable-select.tsx +0 -0
- /package/resources/templates/{template-workspace → default}/admin/lib/tenant/forms/change-my-password.tsx +0 -0
- /package/resources/templates/{template-workspace → default}/admin/lib/tenant/forms/create-api-key.tsx +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/forms/invite.tsx +0 -0
- /package/resources/templates/{template-workspace → default}/admin/lib/tenant/forms/login.tsx +0 -0
- /package/resources/templates/{template-workspace → default}/admin/lib/tenant/forms/password-reset-request.tsx +0 -0
- /package/resources/templates/{template-workspace → default}/admin/lib/tenant/forms/password-reset.tsx +0 -0
- /package/resources/templates/{template-workspace → default}/admin/lib/tenant/forms/passwordless-signin-init.tsx +0 -0
- /package/resources/templates/{template-workspace → default}/admin/lib/tenant/forms/passwordless-signin.tsx +0 -0
- /package/resources/templates/{template-workspace → default}/admin/lib/tenant/forms/update-project-member.tsx +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/hooks/useInviteUser.tsx +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/api-key-list.tsx +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/listing/member-delete-dialog.tsx +0 -0
- /package/resources/templates/{template-workspace → default}/admin/lib/tenant/listing/member-list.tsx +0 -0
- /package/resources/templates/{template-workspace → default}/admin/lib/tenant/listing/person-list.tsx +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/toast/toaster.tsx +0 -0
- /package/resources/templates/{template-workspace → default}/admin/lib/ui/alert-dialog.tsx +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/loader.tsx +0 -0
- /package/resources/templates/{template-workspace → default}/admin/lib/ui/menu.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/scroll-area.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/ui/toggle-group.tsx +0 -0
- /package/resources/templates/{template-workspace → default}/admin/lib/upload/dropzone.tsx +0 -0
- /package/resources/templates/{template-workspace → default}/admin/lib/upload/index.ts +0 -0
- /package/resources/templates/{template-workspace → default}/admin/lib/upload/repeater.tsx +0 -0
- /package/resources/templates/{template-workspace → default}/admin/lib/utils/cn.ts +0 -0
- /package/resources/templates/{template-workspace → default}/admin/lib/utils/createComponentOpenHooks.tsx +0 -0
- /package/resources/templates/{template-workspace → default}/admin/lib/utils/index.ts +0 -0
- /package/resources/templates/{template-workspace → default}/admin/lib/utils/use-mobile.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,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>
|
|
@@ -28,13 +28,13 @@ import { Switch } from '../ui/switch'
|
|
|
28
28
|
import { uic } from '../utils'
|
|
29
29
|
|
|
30
30
|
const BlockRepeaterItemsWrapperUI = uic('div', {
|
|
31
|
-
baseClass: 'rounded border border-gray-300 px-4 py-8 flex flex-col',
|
|
31
|
+
baseClass: 'rounded-sm border border-gray-300 px-4 py-8 flex flex-col',
|
|
32
32
|
})
|
|
33
33
|
const BlockRepeaterItemUI = uic('div', {
|
|
34
|
-
baseClass: 'relative border-t transition-all group',
|
|
34
|
+
baseClass: 'relative border-t border-gray-200 transition-all group',
|
|
35
35
|
})
|
|
36
36
|
const BlockRepeaterDragOverlayUI = uic('div', {
|
|
37
|
-
baseClass: 'rounded border border-gray-300 p-4 relative bg-
|
|
37
|
+
baseClass: 'rounded-sm border border-gray-300 p-4 relative bg-gray-100/60 backdrop-blur-xs',
|
|
38
38
|
})
|
|
39
39
|
const BlockRepeaterHandleUI = uic('button', {
|
|
40
40
|
baseClass: 'absolute top-1/2 -left-6 h-6 w-6 flex justify-end align-center opacity-10 hover:opacity-100 transition-opacity -translate-y-1/2',
|
|
@@ -224,7 +224,7 @@ const BlockRepeaterAddItemBefore = ({ sortableBy }: { sortableBy: DefaultBlockRe
|
|
|
224
224
|
return (
|
|
225
225
|
<DropdownMenu>
|
|
226
226
|
<DropdownMenuTrigger asChild>
|
|
227
|
-
<Button className="absolute top-0 right-1/2 -translate-x-1/2 -translate-y-1/2 bg-
|
|
227
|
+
<Button className="absolute top-0 right-1/2 -translate-x-1/2 -translate-y-1/2 bg-background" variant="ghost">
|
|
228
228
|
<PlusCircleIcon className="w-4 h-4 opacity-25 hover:opacity-100 transition-opacity" />
|
|
229
229
|
</Button>
|
|
230
230
|
</DropdownMenuTrigger>
|
|
@@ -27,13 +27,13 @@ export const BoardColumnHeaderUI = uic('div', {
|
|
|
27
27
|
baseClass: 'px-4 py-1 border-b border-gray-100',
|
|
28
28
|
})
|
|
29
29
|
export const BoardCardUI = uic('div', {
|
|
30
|
-
baseClass: 'rounded border bg-card text-card-foreground shadow-
|
|
30
|
+
baseClass: 'rounded-sm border border-gray-200 bg-card text-card-foreground shadow-xs p-4 relative hover:shadow-md transition-all duration-200',
|
|
31
31
|
})
|
|
32
32
|
export const BoardColumnUI = uic('div', {
|
|
33
|
-
baseClass: 'rounded-lg border bg-card text-card-foreground shadow-md relative min-w-48 data-[sortable-over="item"]:bg-yellow-100 hover:shadow-lg transition-all duration-200',
|
|
33
|
+
baseClass: 'rounded-lg border border-gray-200 bg-card text-card-foreground shadow-md relative min-w-48 data-[sortable-over="item"]:bg-yellow-100 hover:shadow-lg transition-all duration-200',
|
|
34
34
|
})
|
|
35
35
|
export const BoardDragOverlayUI = uic('div', {
|
|
36
|
-
baseClass: 'rounded border border-gray-300 p-4 relative bg-
|
|
36
|
+
baseClass: 'rounded-sm border border-gray-200 border-gray-300 p-4 relative bg-gray-100/60 backdrop-blur-xs',
|
|
37
37
|
})
|
|
38
38
|
export const BoardItemHandleUI = uic('button', {
|
|
39
39
|
baseClass: 'absolute top-0 right-0 h-5 w-5 flex justify-center items-center opacity-10 hover:opacity-100 transition-opacity',
|
|
@@ -142,3 +142,50 @@ export const DataGridEnumCell = Component(({ field, options, filterName, tooltip
|
|
|
142
142
|
}} />
|
|
143
143
|
)
|
|
144
144
|
}, ({ field }) => <Field field={field} />, 'DataGridEnumCell')
|
|
145
|
+
|
|
146
|
+
|
|
147
|
+
/**
|
|
148
|
+
* Props for {@link DataGridEnumListCell}.
|
|
149
|
+
*/
|
|
150
|
+
export type DataGridEnumListCellProps = {
|
|
151
|
+
/**
|
|
152
|
+
* Field to be displayed.
|
|
153
|
+
*/
|
|
154
|
+
field: SugaredRelativeSingleField['field']
|
|
155
|
+
|
|
156
|
+
/**
|
|
157
|
+
* Filter identifier. If not provided, the filter is resolved from the field name.
|
|
158
|
+
*/
|
|
159
|
+
filterName?: string
|
|
160
|
+
|
|
161
|
+
/**
|
|
162
|
+
* Enum options to be displayed in the tooltip. If not provided, the options are resolved from the enum.
|
|
163
|
+
*/
|
|
164
|
+
options?: Record<string, ReactNode>
|
|
165
|
+
/**
|
|
166
|
+
* Custom actions to be displayed in the tooltip.
|
|
167
|
+
*/
|
|
168
|
+
tooltipActions?: ReactNode
|
|
169
|
+
}
|
|
170
|
+
|
|
171
|
+
/**
|
|
172
|
+
* Renders a cell with an enum list.
|
|
173
|
+
* Contains a tooltip with filter actions.
|
|
174
|
+
*/
|
|
175
|
+
export const DataGridEnumListCell = Component(({ field, options, filterName, tooltipActions }: DataGridEnumListCellProps) => {
|
|
176
|
+
const enumOptionsProvider = useEnumOptionsFormatter()
|
|
177
|
+
return (
|
|
178
|
+
<div className={'flex flex-wrap gap-2'}>
|
|
179
|
+
<FieldView<string[]> field={field} render={it => {
|
|
180
|
+
const resolvedOptions = options ?? enumOptionsProvider(it.schema.enumName!)
|
|
181
|
+
return it.value?.map(value => (
|
|
182
|
+
<DataGridEnumFieldTooltip key={value} value={value} field={field} name={filterName} actions={tooltipActions}>
|
|
183
|
+
<DataGridTooltipLabel>
|
|
184
|
+
{resolvedOptions[value]}
|
|
185
|
+
</DataGridTooltipLabel>
|
|
186
|
+
</DataGridEnumFieldTooltip>
|
|
187
|
+
)) ?? null
|
|
188
|
+
}} />
|
|
189
|
+
</div>
|
|
190
|
+
)
|
|
191
|
+
}, ({ field }) => <Field field={field} />, 'DataGridEnumListCell')
|
package/resources/templates/{template-workspace → default}/admin/lib/datagrid/column-header.tsx
RENAMED
|
@@ -57,7 +57,7 @@ export const DataGridColumnHeader = Component(({ sortingField, hidingName, child
|
|
|
57
57
|
<div className="flex flex-col gap-1">
|
|
58
58
|
|
|
59
59
|
{(sortingField || hidingName) && <>
|
|
60
|
-
<div className="flex gap-2 border rounded p-1">
|
|
60
|
+
<div className="flex gap-2 border border-gray-200 rounded-sm p-1">
|
|
61
61
|
{sortingField && <><DataViewSortingTrigger field={sortingField} action="toggleAsc">
|
|
62
62
|
<Button variant="ghost" className={'data-[active]:text-blue-600 cursor-pointer flex-1'} size="sm">
|
|
63
63
|
<ArrowDownAZIcon className="mr-2 h-3.5 w-3.5 text-muted-foreground/70" />
|
|
@@ -7,7 +7,7 @@ import {
|
|
|
7
7
|
DataViewBooleanFilter,
|
|
8
8
|
DataViewDateFilter,
|
|
9
9
|
DataViewElement,
|
|
10
|
-
DataViewEnumFilter,
|
|
10
|
+
DataViewEnumFilter, DataViewEnumListFilter,
|
|
11
11
|
DataViewHasManyFilter,
|
|
12
12
|
DataViewHasOneFilter,
|
|
13
13
|
DataViewIsDefinedFilter,
|
|
@@ -15,7 +15,7 @@ import {
|
|
|
15
15
|
DataViewTextFilter,
|
|
16
16
|
} from '@contember/react-dataview'
|
|
17
17
|
import { formatBoolean, formatDate, formatDateTime, formatNumber } from '../formatting'
|
|
18
|
-
import { DataGridEnumCell, DataGridHasManyCell, DataGridHasOneCell } from './cells'
|
|
18
|
+
import { DataGridEnumCell, DataGridEnumListCell, DataGridHasManyCell, DataGridHasOneCell } from './cells'
|
|
19
19
|
import { cn } from '../utils'
|
|
20
20
|
import {
|
|
21
21
|
DataGridBooleanFilterControls,
|
|
@@ -148,7 +148,7 @@ export const DataGridBooleanColumn = Component<DataGridBooleanColumnProps>(({ fi
|
|
|
148
148
|
children={children ?? <Field field={field} format={format ?? formatBoolean} />}
|
|
149
149
|
filterName={field}
|
|
150
150
|
filter={filter ?? <DataViewBooleanFilter field={field}>
|
|
151
|
-
<div className="border rounded p-2">
|
|
151
|
+
<div className="border border-gray-200 rounded-sm p-2">
|
|
152
152
|
<DataGridBooleanFilterControls />
|
|
153
153
|
</div>
|
|
154
154
|
</DataViewBooleanFilter>}
|
|
@@ -199,7 +199,7 @@ export const DataGridNumberColumn = Component<DataGridNumberColumnProps>(({ fiel
|
|
|
199
199
|
children={children ?? <Field field={field} format={format ?? formatNumber} />}
|
|
200
200
|
filterName={field}
|
|
201
201
|
filter={filter ?? <DataViewNumberFilter field={field}>
|
|
202
|
-
<div className="border rounded max-w-60 p-2">
|
|
202
|
+
<div className="border border-gray-200 rounded-sm max-w-60 p-2">
|
|
203
203
|
<DataGridNumberFilterControls/>
|
|
204
204
|
</div>
|
|
205
205
|
</DataViewNumberFilter>}
|
|
@@ -249,7 +249,7 @@ export const DataGridDateColumn = Component<DataGridDateColumnProps>(({ field, h
|
|
|
249
249
|
children={children ?? <Field field={field} format={format ?? formatDate} />}
|
|
250
250
|
filterName={field}
|
|
251
251
|
filter={filter ?? <DataViewDateFilter field={field}>
|
|
252
|
-
<div className="border rounded">
|
|
252
|
+
<div className="border border-gray-200 rounded-sm">
|
|
253
253
|
<DataGridDateFilterControls layout="row"/>
|
|
254
254
|
</div>
|
|
255
255
|
</DataViewDateFilter>}
|
|
@@ -300,7 +300,7 @@ export const DataGridDateTimeColumn = Component<DataGridDateTimeColumnProps>(({
|
|
|
300
300
|
children={children ?? <Field field={field} format={format ?? formatDateTime} />}
|
|
301
301
|
filterName={field}
|
|
302
302
|
filter={filter ?? <DataViewDateFilter field={field}>
|
|
303
|
-
<div className="border rounded">
|
|
303
|
+
<div className="border border-gray-200 rounded-sm">
|
|
304
304
|
<DataGridDateFilterControls layout="row" />
|
|
305
305
|
</div>
|
|
306
306
|
</DataViewDateFilter>}
|
|
@@ -363,13 +363,76 @@ export const DataGridEnumColumn = Component<DataGridEnumColumnProps>(({ field, h
|
|
|
363
363
|
children={children ?? <DataGridEnumCell field={field} options={options} tooltipActions={tooltipActions} />}
|
|
364
364
|
filterName={field}
|
|
365
365
|
filter={filter ?? <DataViewEnumFilter field={field}>
|
|
366
|
-
<div className="max-w-60 border rounded p-2">
|
|
366
|
+
<div className="max-w-60 border border-gray-200 rounded-sm p-2">
|
|
367
367
|
<DataGridEnumFilterControls options={options} />
|
|
368
368
|
</div>
|
|
369
369
|
</DataViewEnumFilter>}
|
|
370
370
|
/>
|
|
371
371
|
</>))
|
|
372
372
|
|
|
373
|
+
|
|
374
|
+
|
|
375
|
+
/**
|
|
376
|
+
* Props for {@link DataGridEnumListColumn}.
|
|
377
|
+
*/
|
|
378
|
+
export type DataGridEnumListColumnProps = {
|
|
379
|
+
|
|
380
|
+
/**
|
|
381
|
+
* Displayed field.
|
|
382
|
+
*/
|
|
383
|
+
field: string
|
|
384
|
+
|
|
385
|
+
/**
|
|
386
|
+
* Custom header. If not provided, the label formatter is used.
|
|
387
|
+
*/
|
|
388
|
+
header?: ReactNode
|
|
389
|
+
|
|
390
|
+
/**
|
|
391
|
+
* Enum options for value formatting and filter options. If not provided, the options are resolved from the enum.
|
|
392
|
+
*/
|
|
393
|
+
options?: Record<string, ReactNode>
|
|
394
|
+
|
|
395
|
+
/**
|
|
396
|
+
* Custom cell content. If not provided, the field value with a tooltip is displayed.
|
|
397
|
+
*/
|
|
398
|
+
children?: ReactNode
|
|
399
|
+
|
|
400
|
+
/**
|
|
401
|
+
* Custom filter. If not provided, a default enum filter is used.
|
|
402
|
+
*/
|
|
403
|
+
filter?: ReactNode
|
|
404
|
+
|
|
405
|
+
/**
|
|
406
|
+
* Additional actions in the tooltip.
|
|
407
|
+
*/
|
|
408
|
+
tooltipActions?: ReactNode
|
|
409
|
+
}
|
|
410
|
+
|
|
411
|
+
/**
|
|
412
|
+
* Renders a column with enum list content. Should be used in a {@link DataGridTable}.
|
|
413
|
+
*
|
|
414
|
+
* ## Example
|
|
415
|
+
* ```tsx
|
|
416
|
+
* <DataGridTable>
|
|
417
|
+
* <DataGridEnumListColumn field="target" />
|
|
418
|
+
* </DataGridTable>
|
|
419
|
+
* ```
|
|
420
|
+
*/
|
|
421
|
+
export const DataGridEnumListColumn = Component<DataGridEnumListColumnProps>(({ field, header, options, children, tooltipActions, filter }) => (<>
|
|
422
|
+
<DataGridColumn
|
|
423
|
+
header={header ?? <DataViewFieldLabel field={field} />}
|
|
424
|
+
name={field}
|
|
425
|
+
children={children ?? <DataGridEnumListCell field={field} options={options} tooltipActions={tooltipActions} />}
|
|
426
|
+
filterName={field}
|
|
427
|
+
filter={filter ?? <DataViewEnumListFilter field={field}>
|
|
428
|
+
<div className="max-w-60 border border-gray-200 rounded-sm p-2">
|
|
429
|
+
<DataGridEnumFilterControls options={options} />
|
|
430
|
+
</div>
|
|
431
|
+
</DataViewEnumListFilter>}
|
|
432
|
+
/>
|
|
433
|
+
</>))
|
|
434
|
+
|
|
435
|
+
|
|
373
436
|
/**
|
|
374
437
|
* Props for {@link DataGridIsDefinedColumn}.
|
|
375
438
|
*/
|
|
@@ -511,7 +574,7 @@ export const DataGridHasOneColumn = Component<DataGridHasOneColumnProps>(({ fiel
|
|
|
511
574
|
children={<DataGridHasOneCell field={field} filterName={filterName} tooltipActions={tooltipActions}>{children}</DataGridHasOneCell>}
|
|
512
575
|
filterName={filterName ?? (typeof field === 'string' ? field : undefined)}
|
|
513
576
|
filter={filter ?? <DataViewHasOneFilter field={field} name={filterName}>
|
|
514
|
-
<div className="border rounded p-2 max-w-60 flex flex-col gap-2">
|
|
577
|
+
<div className="border border-gray-200 rounded-sm p-2 max-w-60 flex flex-col gap-2">
|
|
515
578
|
<div className="flex flex-wrap gap-2">
|
|
516
579
|
<DataGridRelationFilteredItemsList>
|
|
517
580
|
{children}
|
|
@@ -574,7 +637,7 @@ export const DataGridHasManyColumn = Component<DataGridHasManyColumnProps>(({ fi
|
|
|
574
637
|
children={<DataGridHasManyCell field={field} filterName={filterName} tooltipActions={tooltipActions}>{children}</DataGridHasManyCell>}
|
|
575
638
|
filterName={filterName ?? (typeof field === 'string' ? field : undefined)}
|
|
576
639
|
filter={filter ?? <DataViewHasManyFilter field={field} name={filterName}>
|
|
577
|
-
<div className="border rounded p-2 max-w-60 flex flex-col gap-2">
|
|
640
|
+
<div className="border border-gray-200 rounded-sm p-2 max-w-60 flex flex-col gap-2">
|
|
578
641
|
<div className="flex flex-wrap gap-2">
|
|
579
642
|
<DataGridRelationFilteredItemsList>
|
|
580
643
|
{children}
|