@contember/create 2.1.0-alpha.3 → 2.1.0-alpha.30
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/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/persist.tsx +7 -5
- 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/column-header.tsx +1 -1
- package/resources/templates/{template-workspace → default}/admin/lib/datagrid/columns.tsx +8 -8
- 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/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/dict.ts +3 -1
- package/resources/templates/default/admin/lib/dimensions/dimensions.tsx +147 -0
- 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/default/admin/lib/form/container.tsx +66 -0
- package/resources/templates/{template-workspace → default}/admin/lib/form/inputs.tsx +4 -6
- package/resources/templates/{template-workspace → default}/admin/lib/form/select.tsx +19 -9
- package/resources/templates/{template-workspace → default}/admin/lib/form/ui.tsx +1 -1
- package/resources/templates/{template-workspace → default}/admin/lib/form/upload-repeaters.tsx +61 -28
- package/resources/templates/{template-workspace → default}/admin/lib/form/upload.tsx +6 -3
- 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 +6 -6
- 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/default/admin/lib/ui/dimension.tsx +9 -0
- package/resources/templates/{template-workspace → default}/admin/lib/ui/dropdown.tsx +6 -6
- package/resources/templates/default/admin/lib/ui/input.tsx +68 -0
- 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 +14 -14
- 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/package.json +5 -2
- 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 +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 -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/lib/dimensions/dimensions.tsx +0 -135
- package/resources/templates/template-workspace/admin/lib/form/container.tsx +0 -59
- package/resources/templates/template-workspace/admin/lib/ui/input.tsx +0 -69
- 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/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/cells.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/enum.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/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/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/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/uic.tsx +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
|
@@ -1,268 +0,0 @@
|
|
|
1
|
-
import './index.css'
|
|
2
|
-
import { dict } from '@app/lib/dict'
|
|
3
|
-
import { LoginFormFields, PasswordResetRequestFormFields } from '@app/lib/tenant'
|
|
4
|
-
import { PasswordResetFormFields } from '@app/lib/tenant'
|
|
5
|
-
import { ToastContent, Toaster, useShowToast } from '@app/lib/toast'
|
|
6
|
-
import { AnchorButton, Button } from '@app/lib/ui/button'
|
|
7
|
-
import { Card, CardContent, CardDescription, CardFooter, CardHeader, CardTitle } from '@app/lib/ui/card'
|
|
8
|
-
import { Loader } from '@app/lib/ui/loader'
|
|
9
|
-
import { Overlay } from '@app/lib/ui/overlay'
|
|
10
|
-
import { Pages, useIdentity } from '@contember/interface'
|
|
11
|
-
import { ContemberClient } from '@contember/react-client'
|
|
12
|
-
import { createErrorHandler } from '@contember/react-devbar'
|
|
13
|
-
import {
|
|
14
|
-
IDP,
|
|
15
|
-
IDPInitTrigger,
|
|
16
|
-
IDPState,
|
|
17
|
-
IdentityProvider,
|
|
18
|
-
IdentityState,
|
|
19
|
-
LoginForm,
|
|
20
|
-
LogoutTrigger,
|
|
21
|
-
PasswordResetForm,
|
|
22
|
-
PasswordResetRequestForm,
|
|
23
|
-
} from '@contember/react-identity'
|
|
24
|
-
import { Link, RoutingProvider, useCurrentRequest, useRedirect } from '@contember/react-routing'
|
|
25
|
-
import { MailIcon } from 'lucide-react'
|
|
26
|
-
import { useEffect } from 'react'
|
|
27
|
-
import { createRoot } from 'react-dom/client'
|
|
28
|
-
|
|
29
|
-
const errorHandler = createErrorHandler((dom, react, onRecoverableError) => createRoot(dom, { onRecoverableError }).render(react))
|
|
30
|
-
|
|
31
|
-
const rootEl = document.body.appendChild(document.createElement('div'))
|
|
32
|
-
|
|
33
|
-
// Un-comment this to setup idp sign in
|
|
34
|
-
// const Idps = {
|
|
35
|
-
// google: 'Login with Google',
|
|
36
|
-
// }
|
|
37
|
-
|
|
38
|
-
const hasTokenFromEnv = import.meta.env.VITE_CONTEMBER_ADMIN_SESSION_TOKEN !== '__SESSION_TOKEN__'
|
|
39
|
-
const appUrl = '/app'
|
|
40
|
-
|
|
41
|
-
const Login = () => {
|
|
42
|
-
const showToast = useShowToast()
|
|
43
|
-
return (
|
|
44
|
-
<>
|
|
45
|
-
<IDP
|
|
46
|
-
onInitError={error =>
|
|
47
|
-
showToast(
|
|
48
|
-
<ToastContent>
|
|
49
|
-
{dict.tenant.login.idpInitError} {error}
|
|
50
|
-
</ToastContent>,
|
|
51
|
-
{ type: 'error' },
|
|
52
|
-
)
|
|
53
|
-
}
|
|
54
|
-
onResponseError={error =>
|
|
55
|
-
showToast(
|
|
56
|
-
<ToastContent>
|
|
57
|
-
{dict.tenant.login.idpResponseError} {error}
|
|
58
|
-
</ToastContent>,
|
|
59
|
-
{ type: 'error' },
|
|
60
|
-
)
|
|
61
|
-
}
|
|
62
|
-
>
|
|
63
|
-
<Card className="w-96 relative">
|
|
64
|
-
<CardHeader>
|
|
65
|
-
<CardTitle className="text-2xl">{dict.tenant.login.title}</CardTitle>
|
|
66
|
-
<CardDescription>{dict.tenant.login.description}</CardDescription>
|
|
67
|
-
</CardHeader>
|
|
68
|
-
<CardContent>
|
|
69
|
-
{hasTokenFromEnv && (
|
|
70
|
-
<AnchorButton href={appUrl} size="lg" className="w-full" variant="destructive">
|
|
71
|
-
Continue as default user
|
|
72
|
-
</AnchorButton>
|
|
73
|
-
)}
|
|
74
|
-
<LoginForm>
|
|
75
|
-
<form className="grid gap-4">
|
|
76
|
-
<LoginFormFields />
|
|
77
|
-
</form>
|
|
78
|
-
</LoginForm>
|
|
79
|
-
|
|
80
|
-
{/* Un-comment this to setup idp sign in */}
|
|
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
|
-
</CardContent>
|
|
89
|
-
<IDPState state={['processing_init', 'processing_response', 'success']}>
|
|
90
|
-
<Loader />
|
|
91
|
-
</IDPState>
|
|
92
|
-
</Card>
|
|
93
|
-
</IDP>
|
|
94
|
-
</>
|
|
95
|
-
)
|
|
96
|
-
}
|
|
97
|
-
|
|
98
|
-
const LoggedIn = () => {
|
|
99
|
-
const identity = useIdentity()
|
|
100
|
-
useEffect(() => {
|
|
101
|
-
setTimeout(() => {
|
|
102
|
-
window.location.href = appUrl
|
|
103
|
-
}, 500)
|
|
104
|
-
}, [])
|
|
105
|
-
|
|
106
|
-
return (
|
|
107
|
-
<Card className="w-96 relative">
|
|
108
|
-
<CardHeader>
|
|
109
|
-
<CardTitle className="text-2xl">Logged in </CardTitle>
|
|
110
|
-
<CardDescription>as {identity?.person?.email ?? 'unknown'}</CardDescription>
|
|
111
|
-
</CardHeader>
|
|
112
|
-
<Loader position="static" />
|
|
113
|
-
</Card>
|
|
114
|
-
)
|
|
115
|
-
}
|
|
116
|
-
|
|
117
|
-
const IndexPage = () => {
|
|
118
|
-
return (
|
|
119
|
-
<IdentityProvider>
|
|
120
|
-
<IdentityState state={['none', 'cleared']}>
|
|
121
|
-
<Login />
|
|
122
|
-
</IdentityState>
|
|
123
|
-
<IdentityState state="success">
|
|
124
|
-
<LoggedIn />
|
|
125
|
-
</IdentityState>
|
|
126
|
-
<IdentityState state="loading">
|
|
127
|
-
<Loader />
|
|
128
|
-
</IdentityState>
|
|
129
|
-
<IdentityState state="failed">
|
|
130
|
-
<Overlay>
|
|
131
|
-
<div className="bg-gray-100 flex flex-col gap-4 items-center justify-center p-16 rounded-lg shadow-lg border">
|
|
132
|
-
<p className="text-lg">Failed to load identity.</p>
|
|
133
|
-
<LogoutTrigger>
|
|
134
|
-
<Button className="w-full" variant="outline">
|
|
135
|
-
Logout
|
|
136
|
-
</Button>
|
|
137
|
-
</LogoutTrigger>
|
|
138
|
-
</div>
|
|
139
|
-
</Overlay>
|
|
140
|
-
</IdentityState>
|
|
141
|
-
</IdentityProvider>
|
|
142
|
-
)
|
|
143
|
-
}
|
|
144
|
-
|
|
145
|
-
const PasswordResetRequestPage = () => {
|
|
146
|
-
const redirect = useRedirect()
|
|
147
|
-
return (
|
|
148
|
-
<Card className="w-96">
|
|
149
|
-
<CardHeader>
|
|
150
|
-
<CardTitle className="text-2xl">{dict.tenant.passwordResetRequest.title}</CardTitle>
|
|
151
|
-
<CardDescription>{dict.tenant.passwordResetRequest.description}</CardDescription>
|
|
152
|
-
</CardHeader>
|
|
153
|
-
<CardContent>
|
|
154
|
-
<PasswordResetRequestForm onSuccess={() => redirect('resetRequestSuccess')}>
|
|
155
|
-
<form>
|
|
156
|
-
<PasswordResetRequestFormFields />
|
|
157
|
-
</form>
|
|
158
|
-
</PasswordResetRequestForm>
|
|
159
|
-
</CardContent>
|
|
160
|
-
<CardFooter>
|
|
161
|
-
<Link to="index">
|
|
162
|
-
<AnchorButton variant="link" className="ml-auto">
|
|
163
|
-
{dict.tenant.login.backToLogin}
|
|
164
|
-
</AnchorButton>
|
|
165
|
-
</Link>
|
|
166
|
-
</CardFooter>
|
|
167
|
-
</Card>
|
|
168
|
-
)
|
|
169
|
-
}
|
|
170
|
-
|
|
171
|
-
const PasswordResetPage = () => {
|
|
172
|
-
const request = useCurrentRequest()
|
|
173
|
-
const redirect = useRedirect()
|
|
174
|
-
const showToast = useShowToast()
|
|
175
|
-
const token = request?.parameters.token as string | undefined
|
|
176
|
-
return (
|
|
177
|
-
<Card className="w-96">
|
|
178
|
-
<CardHeader>
|
|
179
|
-
<CardTitle className="text-2xl">{dict.tenant.passwordReset.title}</CardTitle>
|
|
180
|
-
<CardDescription>{dict.tenant.passwordReset.description}</CardDescription>
|
|
181
|
-
</CardHeader>
|
|
182
|
-
<CardContent>
|
|
183
|
-
<PasswordResetForm
|
|
184
|
-
onSuccess={() => {
|
|
185
|
-
showToast(<ToastContent>Password has been reset</ToastContent>, { type: 'success' })
|
|
186
|
-
redirect('index')
|
|
187
|
-
}}
|
|
188
|
-
token={token}
|
|
189
|
-
>
|
|
190
|
-
<form>
|
|
191
|
-
<PasswordResetFormFields hasToken={!!token} />
|
|
192
|
-
</form>
|
|
193
|
-
</PasswordResetForm>
|
|
194
|
-
</CardContent>
|
|
195
|
-
<CardFooter>
|
|
196
|
-
<Link to="index">
|
|
197
|
-
<AnchorButton variant="link" className="ml-auto">
|
|
198
|
-
{dict.tenant.login.backToLogin}
|
|
199
|
-
</AnchorButton>
|
|
200
|
-
</Link>
|
|
201
|
-
</CardFooter>
|
|
202
|
-
</Card>
|
|
203
|
-
)
|
|
204
|
-
}
|
|
205
|
-
|
|
206
|
-
const PasswordResetRequestSuccessPage = () => (
|
|
207
|
-
<Card className="w-96">
|
|
208
|
-
<CardHeader>
|
|
209
|
-
<CardTitle className="text-2xl">{dict.tenant.passwordResetRequest.title}</CardTitle>
|
|
210
|
-
<CardDescription>{dict.tenant.passwordResetRequest.description}</CardDescription>
|
|
211
|
-
</CardHeader>
|
|
212
|
-
<CardContent>
|
|
213
|
-
<div className="flex flex-col items-center justify-center gap-4">
|
|
214
|
-
<MailIcon className="text-gray-300 w-16 h-16" />
|
|
215
|
-
<div className="text-center">An email with password reset instructions has been sent to your email address.</div>
|
|
216
|
-
<div className="text-center text-gray-500">
|
|
217
|
-
<Link to="passwordReset">
|
|
218
|
-
<a className="underline">{dict.tenant.passwordResetRequest.entryCode}</a>
|
|
219
|
-
</Link>
|
|
220
|
-
</div>
|
|
221
|
-
</div>
|
|
222
|
-
</CardContent>
|
|
223
|
-
<CardFooter>
|
|
224
|
-
<Link to="index">
|
|
225
|
-
<AnchorButton variant="link" className="ml-auto">
|
|
226
|
-
{dict.tenant.login.backToLogin}
|
|
227
|
-
</AnchorButton>
|
|
228
|
-
</Link>
|
|
229
|
-
</CardFooter>
|
|
230
|
-
</Card>
|
|
231
|
-
)
|
|
232
|
-
|
|
233
|
-
const Layout = ({ children }: { children?: React.ReactNode }) => (
|
|
234
|
-
<div className="grid md:grid-cols-2 min-h-screen ">
|
|
235
|
-
<div className="bg-gray-100 p-4 flex items-center justify-center">{children}</div>
|
|
236
|
-
<div className="bg-gray-700 text-white p-4 flex items-center justify-center">
|
|
237
|
-
<div className="w-full max-w-md">
|
|
238
|
-
<div className="text-center text-2xl">Welcome to your app</div>
|
|
239
|
-
{/*<p className="mt-8 text-center text-gray-300">*/}
|
|
240
|
-
{/* Lorem ipsum dolor sit amet, consectetur adipiscing elit. Donec auctor, sem eget ultricies ultricies, sapien urna tristique eros, ac*/}
|
|
241
|
-
{/* tincidunt felis lacus nec nunc.*/}
|
|
242
|
-
{/*</p>*/}
|
|
243
|
-
</div>
|
|
244
|
-
</div>
|
|
245
|
-
</div>
|
|
246
|
-
)
|
|
247
|
-
|
|
248
|
-
errorHandler(onRecoverableError =>
|
|
249
|
-
createRoot(rootEl, { onRecoverableError }).render(
|
|
250
|
-
<>
|
|
251
|
-
<ContemberClient apiBaseUrl={import.meta.env.VITE_CONTEMBER_ADMIN_API_BASE_URL} loginToken={import.meta.env.VITE_CONTEMBER_ADMIN_LOGIN_TOKEN}>
|
|
252
|
-
<RoutingProvider pageInQuery>
|
|
253
|
-
<Toaster>
|
|
254
|
-
<Pages
|
|
255
|
-
layout={Layout}
|
|
256
|
-
children={{
|
|
257
|
-
index: IndexPage,
|
|
258
|
-
resetRequest: PasswordResetRequestPage,
|
|
259
|
-
resetRequestSuccess: PasswordResetRequestSuccessPage,
|
|
260
|
-
passwordReset: PasswordResetPage,
|
|
261
|
-
}}
|
|
262
|
-
/>
|
|
263
|
-
</Toaster>
|
|
264
|
-
</RoutingProvider>
|
|
265
|
-
</ContemberClient>
|
|
266
|
-
</>,
|
|
267
|
-
),
|
|
268
|
-
)
|
|
@@ -1,48 +0,0 @@
|
|
|
1
|
-
import { EyeIcon, EyeOffIcon } from 'lucide-react'
|
|
2
|
-
import { dict } from '../dict'
|
|
3
|
-
import * as React from 'react'
|
|
4
|
-
import { ReactNode } from 'react'
|
|
5
|
-
import { DataViewVisibilityTrigger, useDataViewElements } from '@contember/react-dataview'
|
|
6
|
-
import { ScrollArea } from '../ui/scroll-area'
|
|
7
|
-
|
|
8
|
-
/**
|
|
9
|
-
* Props for {@link DataGridToolbarVisibleElements}.
|
|
10
|
-
*/
|
|
11
|
-
export interface DataGridToolbarVisibleElementsProps {
|
|
12
|
-
elements?: {
|
|
13
|
-
name: string
|
|
14
|
-
label: ReactNode
|
|
15
|
-
}[]
|
|
16
|
-
}
|
|
17
|
-
|
|
18
|
-
/**
|
|
19
|
-
* Control for toggling visibility of columns in data grid.
|
|
20
|
-
*/
|
|
21
|
-
export const DataGridToolbarVisibleElements = ({ elements }: DataGridToolbarVisibleElementsProps) => {
|
|
22
|
-
const globalElements = useDataViewElements()
|
|
23
|
-
|
|
24
|
-
const resolvedElements = elements ?? globalElements
|
|
25
|
-
if (resolvedElements.length === 0) {
|
|
26
|
-
return null
|
|
27
|
-
}
|
|
28
|
-
return (
|
|
29
|
-
<div>
|
|
30
|
-
<p className="text-gray-400 text-xs font-semibold mb-1">{dict.datagrid.visibleFields}</p>
|
|
31
|
-
<div className="flex flex-col bg-gray-50 p-2 border rounded shadow-inner">
|
|
32
|
-
<ScrollArea className={'max-h-48'}>
|
|
33
|
-
<div className="flex flex-col">
|
|
34
|
-
{resolvedElements.map(element => (
|
|
35
|
-
element.name && <DataViewVisibilityTrigger key={element.name} name={element.name} value={it => !(it ?? true)}>
|
|
36
|
-
<button className={'gap-2 group text-gray-400 data-[current]:text-black text-left inline-flex items-center p-0.5 text-sm rounded hover:bg-white'}>
|
|
37
|
-
<EyeIcon className={'w-3 h-3 hidden group-data-[current]:block'} />
|
|
38
|
-
<EyeOffIcon className={'w-3 h-3 block group-data-[current]:hidden'} />
|
|
39
|
-
<span>{element.label}</span>
|
|
40
|
-
</button>
|
|
41
|
-
</DataViewVisibilityTrigger>
|
|
42
|
-
))}
|
|
43
|
-
</div>
|
|
44
|
-
</ScrollArea>
|
|
45
|
-
</div>
|
|
46
|
-
</div>
|
|
47
|
-
)
|
|
48
|
-
}
|
|
@@ -1,135 +0,0 @@
|
|
|
1
|
-
import {
|
|
2
|
-
Component,
|
|
3
|
-
DimensionLink,
|
|
4
|
-
DimensionRenderer,
|
|
5
|
-
Entity,
|
|
6
|
-
EntityAccessor,
|
|
7
|
-
Field,
|
|
8
|
-
HasOne,
|
|
9
|
-
StaticRender,
|
|
10
|
-
SugaredQualifiedEntityList,
|
|
11
|
-
SugaredRelativeSingleEntity,
|
|
12
|
-
SugaredRelativeSingleField,
|
|
13
|
-
useDimensionState,
|
|
14
|
-
useEntity,
|
|
15
|
-
} from '@contember/interface'
|
|
16
|
-
import { DataView, DataViewEachRow, DataViewLoaderState, DataViewSortingDirections, useDataViewEntityListAccessor } from '@contember/react-dataview'
|
|
17
|
-
import * as React from 'react'
|
|
18
|
-
import { ReactNode, useMemo } from 'react'
|
|
19
|
-
import { CheckIcon } from 'lucide-react'
|
|
20
|
-
import { Loader } from '../ui/loader'
|
|
21
|
-
import { Popover, PopoverContent, PopoverTrigger } from '../ui/popover'
|
|
22
|
-
import { Button } from '../ui/button'
|
|
23
|
-
|
|
24
|
-
export interface DimensionsSwitcherProps {
|
|
25
|
-
options: SugaredQualifiedEntityList['entities']
|
|
26
|
-
orderBy?: DataViewSortingDirections
|
|
27
|
-
dimension: string
|
|
28
|
-
children: ReactNode
|
|
29
|
-
slugField: SugaredRelativeSingleField['field']
|
|
30
|
-
isMulti?: boolean
|
|
31
|
-
}
|
|
32
|
-
|
|
33
|
-
export const DimensionsSwitcher = Component(({ options, dimension, children, slugField, orderBy, isMulti }: DimensionsSwitcherProps) => {
|
|
34
|
-
return (
|
|
35
|
-
<DataView entities={options} initialSorting={orderBy}>
|
|
36
|
-
<DataViewLoaderState initial refreshing>
|
|
37
|
-
<Loader position={'static'} />
|
|
38
|
-
</DataViewLoaderState>
|
|
39
|
-
<DataViewLoaderState loaded>
|
|
40
|
-
|
|
41
|
-
<Popover>
|
|
42
|
-
<PopoverTrigger asChild>
|
|
43
|
-
<Button variant={'outline'} size="sm">
|
|
44
|
-
<DimensionSwitcherCurrentValues dimension={dimension} slugField={slugField}>
|
|
45
|
-
{children}
|
|
46
|
-
</DimensionSwitcherCurrentValues>
|
|
47
|
-
</Button>
|
|
48
|
-
</PopoverTrigger>
|
|
49
|
-
<PopoverContent className="p-2" align="start">
|
|
50
|
-
<div className="flex flex-col gap-1">
|
|
51
|
-
<DataViewEachRow>
|
|
52
|
-
<DimensionSwitcherItem dimension={dimension} slugField={slugField} isMulti={isMulti}>
|
|
53
|
-
{children}
|
|
54
|
-
<StaticRender>
|
|
55
|
-
<Field field={slugField} />
|
|
56
|
-
</StaticRender>
|
|
57
|
-
</DimensionSwitcherItem>
|
|
58
|
-
</DataViewEachRow>
|
|
59
|
-
</div>
|
|
60
|
-
</PopoverContent>
|
|
61
|
-
</Popover>
|
|
62
|
-
</DataViewLoaderState>
|
|
63
|
-
</DataView>
|
|
64
|
-
)
|
|
65
|
-
})
|
|
66
|
-
|
|
67
|
-
const DimensionSwitcherCurrentValues = ({ children, dimension, slugField }: { children: ReactNode; dimension: string; slugField: SugaredRelativeSingleField['field'] }) => {
|
|
68
|
-
const entitiesBySlug = useDimensionEntitiesBySlug(slugField)
|
|
69
|
-
|
|
70
|
-
const currentDimensionValue = useDimensionState({
|
|
71
|
-
dimension,
|
|
72
|
-
defaultValue: Object.keys(entitiesBySlug)[0],
|
|
73
|
-
storage: 'local',
|
|
74
|
-
})
|
|
75
|
-
|
|
76
|
-
const values = useMemo(() => currentDimensionValue.map(it => entitiesBySlug[it]).filter(Boolean), [currentDimensionValue, entitiesBySlug])
|
|
77
|
-
|
|
78
|
-
return (
|
|
79
|
-
<div className="flex gap-1">
|
|
80
|
-
{values.map(it => (
|
|
81
|
-
<Entity key={it.key} accessor={it}>
|
|
82
|
-
<div className={'gap-1 group text-black text-left inline-flex items-center px-1 text-sm border-b'}>
|
|
83
|
-
<span>{children}</span>
|
|
84
|
-
</div>
|
|
85
|
-
</Entity>
|
|
86
|
-
))}
|
|
87
|
-
</div>
|
|
88
|
-
)
|
|
89
|
-
}
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
const DimensionSwitcherItem = ({ children, dimension, slugField, isMulti }: { children: ReactNode; dimension: string; slugField: SugaredRelativeSingleField['field']; isMulti?: boolean }) => {
|
|
93
|
-
const entity = useEntity()
|
|
94
|
-
const slugValue = entity.getField<string>(slugField).value
|
|
95
|
-
if (!slugValue) {
|
|
96
|
-
return null
|
|
97
|
-
}
|
|
98
|
-
|
|
99
|
-
return (
|
|
100
|
-
<DimensionLink dimension={dimension} value={slugValue} action={isMulti ? 'toggle' : 'set'}>
|
|
101
|
-
<a className={'gap-1 group text-gray-800 text-left inline-flex items-center px-1 py-1 text-sm rounded transition-all hover:bg-accent hover:text-accent-foreground group data-[active]:text-black'}>
|
|
102
|
-
<CheckIcon className={'w-3 h-3 hidden group-data-[active]:block'} />
|
|
103
|
-
<span className={'w-3 h-3 group-data-[active]:hidden'} />
|
|
104
|
-
<span>{children}</span>
|
|
105
|
-
</a>
|
|
106
|
-
</DimensionLink>
|
|
107
|
-
)
|
|
108
|
-
}
|
|
109
|
-
|
|
110
|
-
export interface SideDimensionsProps {
|
|
111
|
-
dimension: string
|
|
112
|
-
as: string
|
|
113
|
-
field: SugaredRelativeSingleEntity['field']
|
|
114
|
-
children: ReactNode
|
|
115
|
-
}
|
|
116
|
-
|
|
117
|
-
export const SideDimensions = Component<SideDimensionsProps>(({ dimension, children, as, field }) => {
|
|
118
|
-
return (
|
|
119
|
-
<div className="flex mt-4 gap-4">
|
|
120
|
-
<DimensionRenderer dimension={dimension} as={as}>
|
|
121
|
-
<HasOne field={field}>
|
|
122
|
-
<div className="flex-1">
|
|
123
|
-
{children}
|
|
124
|
-
</div>
|
|
125
|
-
</HasOne>
|
|
126
|
-
</DimensionRenderer>
|
|
127
|
-
</div>
|
|
128
|
-
)
|
|
129
|
-
})
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
const useDimensionEntitiesBySlug = (slugField: SugaredRelativeSingleField['field']): Record<string, EntityAccessor> => {
|
|
133
|
-
const accessor = useDataViewEntityListAccessor()
|
|
134
|
-
return useMemo(() => Object.fromEntries(Array.from(accessor ?? []).map(it => [it.getField<string>(slugField).value, it])), [accessor, slugField])
|
|
135
|
-
}
|
|
@@ -1,59 +0,0 @@
|
|
|
1
|
-
import * as React from 'react'
|
|
2
|
-
import { ReactNode } from 'react'
|
|
3
|
-
import { FormContainerUI, FormDescriptionUI, FormErrorUI, FormLabelUI, FormLabelWrapperUI } from './ui'
|
|
4
|
-
import { useErrorFormatter } from '../errors'
|
|
5
|
-
import { Component, ErrorAccessor } from '@contember/interface'
|
|
6
|
-
import { FormError, FormFieldStateProvider, FormLabel, useFormFieldState } from '@contember/react-form'
|
|
7
|
-
import { FormFieldLabel } from './labels'
|
|
8
|
-
|
|
9
|
-
export interface FormContainerProps {
|
|
10
|
-
label?: ReactNode
|
|
11
|
-
description?: ReactNode
|
|
12
|
-
children: ReactNode
|
|
13
|
-
errors?: ErrorAccessor.Error[] | ReactNode
|
|
14
|
-
required?: boolean
|
|
15
|
-
}
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
export const FormContainer = Component(({ children, description, label, required, errors }: FormContainerProps) => {
|
|
19
|
-
const errorsNode = Array.isArray(errors) ? undefined : errors
|
|
20
|
-
const errorsList = Array.isArray(errors) ? errors : []
|
|
21
|
-
const state = useFormFieldState()
|
|
22
|
-
label ??= <FormFieldLabel />
|
|
23
|
-
const errorFormatter = useErrorFormatter()
|
|
24
|
-
|
|
25
|
-
const inner = <>
|
|
26
|
-
<FormContainerUI>
|
|
27
|
-
<FormLabelWrapperUI>
|
|
28
|
-
{label && <FormLabel>
|
|
29
|
-
<FormLabelUI required={required}>
|
|
30
|
-
{label}
|
|
31
|
-
</FormLabelUI>
|
|
32
|
-
</FormLabel>}
|
|
33
|
-
</FormLabelWrapperUI>
|
|
34
|
-
<div>
|
|
35
|
-
{children}
|
|
36
|
-
</div>
|
|
37
|
-
{(description || errorsNode || state?.errors?.length || errorsList?.length) ? <div>
|
|
38
|
-
{description && <FormDescriptionUI>{description}</FormDescriptionUI>}
|
|
39
|
-
|
|
40
|
-
<FormError formatter={errorFormatter}>
|
|
41
|
-
<FormErrorUI />
|
|
42
|
-
</FormError>
|
|
43
|
-
{errorsNode}
|
|
44
|
-
</div> : null}
|
|
45
|
-
</FormContainerUI>
|
|
46
|
-
</>
|
|
47
|
-
return state !== undefined
|
|
48
|
-
? inner
|
|
49
|
-
: <FormFieldStateProvider required={required} errors={errorsList} dirty={false}>{inner}</FormFieldStateProvider>
|
|
50
|
-
}, ({ children, label, description }) => <>
|
|
51
|
-
{label}
|
|
52
|
-
{children}
|
|
53
|
-
{description}
|
|
54
|
-
</>)
|
|
55
|
-
|
|
56
|
-
/**
|
|
57
|
-
* @deprecated use `FormContainer` instead
|
|
58
|
-
*/
|
|
59
|
-
export const StandaloneFormContainer = FormContainer
|
|
@@ -1,69 +0,0 @@
|
|
|
1
|
-
import { uic, uiconfig } from '../utils'
|
|
2
|
-
|
|
3
|
-
export const inputConfig = uiconfig({
|
|
4
|
-
baseClass: `
|
|
5
|
-
flex w-full bg-background
|
|
6
|
-
file:border-0 file:bg-transparent file:text-sm file:font-medium
|
|
7
|
-
placeholder:text-muted-foreground
|
|
8
|
-
focus-visible:outline-none
|
|
9
|
-
disabled:cursor-not-allowed disabled:opacity-50
|
|
10
|
-
read-only:bg-gray-100
|
|
11
|
-
` /*data-[dirty]:border-yellow-500 focus-visible:data-[dirty]:border-input*/ + `
|
|
12
|
-
data-[invalid]:border-destructive data-[invalid]:ring-destructive
|
|
13
|
-
`,
|
|
14
|
-
variants: {
|
|
15
|
-
inputSize: {
|
|
16
|
-
default: 'h-10 rounded-md p-2 text-sm',
|
|
17
|
-
sm: 'h-8 rounded p-1 text-sm',
|
|
18
|
-
lg: 'h-12 rounded-lg p-3 text-lg',
|
|
19
|
-
},
|
|
20
|
-
variant: {
|
|
21
|
-
default: 'border border-input ring-offset-background focus-visible:ring-2 focus-visible:ring-ring',
|
|
22
|
-
ghost: 'border-transparent border-b focus-visible:ring-transparent rounded-none',
|
|
23
|
-
},
|
|
24
|
-
},
|
|
25
|
-
defaultVariants: {
|
|
26
|
-
variant: 'default',
|
|
27
|
-
inputSize: 'default',
|
|
28
|
-
},
|
|
29
|
-
})
|
|
30
|
-
|
|
31
|
-
export const Input = uic('input', {
|
|
32
|
-
...inputConfig,
|
|
33
|
-
displayName: 'Input',
|
|
34
|
-
})
|
|
35
|
-
|
|
36
|
-
export const InputLike = uic('div', {
|
|
37
|
-
baseClass: `
|
|
38
|
-
flex items-center min-h-10 w-full rounded-md border border-input bg-background p-2 text-sm ring-offset-background max-w-md
|
|
39
|
-
file:border-0 file:bg-transparent file:text-sm file:font-medium
|
|
40
|
-
placeholder:text-muted-foreground
|
|
41
|
-
focus-within:outline-none focus-within:ring-2 focus-within:ring-ring focus-within:ring-offset-2
|
|
42
|
-
disabled:cursor-not-allowed
|
|
43
|
-
disabled:opacity-50
|
|
44
|
-
`,
|
|
45
|
-
displayName: 'InputLike',
|
|
46
|
-
})
|
|
47
|
-
|
|
48
|
-
/**
|
|
49
|
-
* without any styling, without ring, border etc; so it must be resetted
|
|
50
|
-
*/
|
|
51
|
-
export const InputBare = uic('input', {
|
|
52
|
-
baseClass: 'w-full h-full focus-visible:outline-none',
|
|
53
|
-
displayName: 'InputBare',
|
|
54
|
-
})
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
export const CheckboxInput = uic('input', {
|
|
58
|
-
baseClass: 'w-4 h-4',
|
|
59
|
-
defaultProps: {
|
|
60
|
-
type: 'checkbox',
|
|
61
|
-
},
|
|
62
|
-
})
|
|
63
|
-
|
|
64
|
-
export const RadioInput = uic('input', {
|
|
65
|
-
baseClass: `
|
|
66
|
-
appearance-none bg-white rounded-full w-4 h-4 ring-1 ring-gray-400 hover:ring-gray-600 grid place-items-center
|
|
67
|
-
before:rounded-full before:bg-gray-600 before:w-2 before:h-2 before:ring-2 before:ring-white before:content-[''] before:transform before:transition-all before:scale-0 checked:before:scale-100
|
|
68
|
-
`,
|
|
69
|
-
})
|
|
@@ -1,73 +0,0 @@
|
|
|
1
|
-
|
|
2
|
-
/** @type {import('tailwindcss').Config} */
|
|
3
|
-
module.exports = {
|
|
4
|
-
content: ['./{app,lib}/**/*.{html,js,tsx,ts}', '*.{html,js,ts,tsx}'],
|
|
5
|
-
darkMode: ['class'],
|
|
6
|
-
theme: {
|
|
7
|
-
container: {
|
|
8
|
-
center: true,
|
|
9
|
-
padding: '2rem',
|
|
10
|
-
screens: {
|
|
11
|
-
'2xl': '1400px',
|
|
12
|
-
},
|
|
13
|
-
},
|
|
14
|
-
extend: {
|
|
15
|
-
colors: {
|
|
16
|
-
border: 'hsl(var(--border))',
|
|
17
|
-
input: 'hsl(var(--input))',
|
|
18
|
-
ring: 'hsl(var(--ring))',
|
|
19
|
-
background: 'hsl(var(--background))',
|
|
20
|
-
foreground: 'hsl(var(--foreground))',
|
|
21
|
-
primary: {
|
|
22
|
-
DEFAULT: 'hsl(var(--primary))',
|
|
23
|
-
foreground: 'hsl(var(--primary-foreground))',
|
|
24
|
-
},
|
|
25
|
-
secondary: {
|
|
26
|
-
DEFAULT: 'hsl(var(--secondary))',
|
|
27
|
-
foreground: 'hsl(var(--secondary-foreground))',
|
|
28
|
-
},
|
|
29
|
-
destructive: {
|
|
30
|
-
DEFAULT: 'hsl(var(--destructive) / <alpha-value>)',
|
|
31
|
-
foreground: 'hsl(var(--destructive-foreground) / <alpha-value>)',
|
|
32
|
-
},
|
|
33
|
-
muted: {
|
|
34
|
-
DEFAULT: 'hsl(var(--muted))',
|
|
35
|
-
foreground: 'hsl(var(--muted-foreground))',
|
|
36
|
-
},
|
|
37
|
-
accent: {
|
|
38
|
-
DEFAULT: 'hsl(var(--accent))',
|
|
39
|
-
foreground: 'hsl(var(--accent-foreground))',
|
|
40
|
-
},
|
|
41
|
-
popover: {
|
|
42
|
-
DEFAULT: 'hsl(var(--popover))',
|
|
43
|
-
foreground: 'hsl(var(--popover-foreground))',
|
|
44
|
-
},
|
|
45
|
-
card: {
|
|
46
|
-
DEFAULT: 'hsl(var(--card))',
|
|
47
|
-
foreground: 'hsl(var(--card-foreground))',
|
|
48
|
-
},
|
|
49
|
-
},
|
|
50
|
-
borderRadius: {
|
|
51
|
-
xl: `calc(var(--radius) + 4px)`,
|
|
52
|
-
lg: `var(--radius)`,
|
|
53
|
-
md: `calc(var(--radius) - 2px)`,
|
|
54
|
-
sm: 'calc(var(--radius) - 4px)',
|
|
55
|
-
},
|
|
56
|
-
keyframes: {
|
|
57
|
-
'accordion-down': {
|
|
58
|
-
from: { height: '0' },
|
|
59
|
-
to: { height: 'var(--radix-accordion-content-height)' },
|
|
60
|
-
},
|
|
61
|
-
'accordion-up': {
|
|
62
|
-
from: { height: 'var(--radix-accordion-content-height)' },
|
|
63
|
-
to: { height: '0' },
|
|
64
|
-
},
|
|
65
|
-
},
|
|
66
|
-
animation: {
|
|
67
|
-
'accordion-down': 'accordion-down 0.2s ease-out',
|
|
68
|
-
'accordion-up': 'accordion-up 0.2s ease-out',
|
|
69
|
-
},
|
|
70
|
-
},
|
|
71
|
-
},
|
|
72
|
-
plugins: [require('tailwindcss-animate')],
|
|
73
|
-
}
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env bash
|
|
2
|
-
|
|
3
|
-
docker-compose run --rm --entrypoint="" contember-cli sh -c "
|
|
4
|
-
node /opt/contember/run.js project:print-schema --format=schema > /tmp/contember-schema.json
|
|
5
|
-
yarn run --silent contember-client-generator /tmp/contember-schema.json ./client/src
|
|
6
|
-
rm /tmp/contember-schema.json
|
|
7
|
-
"
|
|
8
|
-
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|