@contember/create 1.4.0-rc.8 → 2.0.0-alpha.12
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/development/run.cjs +27 -0
- package/dist/development/run.cjs.map +1 -0
- package/dist/development/run.js +26 -0
- package/dist/development/run.js.map +1 -0
- package/dist/development/src/commands/WorkspaceCreateCommand.cjs +50 -0
- package/dist/development/src/commands/WorkspaceCreateCommand.cjs.map +1 -0
- package/dist/development/src/commands/WorkspaceCreateCommand.js +50 -0
- package/dist/development/src/commands/WorkspaceCreateCommand.js.map +1 -0
- package/dist/development/src/lib/FileSystem.cjs +48 -0
- package/dist/development/src/lib/FileSystem.cjs.map +1 -0
- package/dist/development/src/lib/FileSystem.js +32 -0
- package/dist/development/src/lib/FileSystem.js.map +1 -0
- package/dist/development/src/lib/PackageDownloader.cjs +33 -0
- package/dist/development/src/lib/PackageDownloader.cjs.map +1 -0
- package/dist/development/src/lib/PackageDownloader.js +33 -0
- package/dist/development/src/lib/PackageDownloader.js.map +1 -0
- package/dist/development/src/lib/TemplateInstaller.cjs +87 -0
- package/dist/development/src/lib/TemplateInstaller.cjs.map +1 -0
- package/dist/development/src/lib/TemplateInstaller.js +87 -0
- package/dist/development/src/lib/TemplateInstaller.js.map +1 -0
- package/dist/development/src/lib/version.cjs +10 -0
- package/dist/development/src/lib/version.cjs.map +1 -0
- package/dist/development/src/lib/version.js +10 -0
- package/dist/development/src/lib/version.js.map +1 -0
- package/dist/development/src/paths.cjs +10 -0
- package/dist/development/src/paths.cjs.map +1 -0
- package/dist/development/src/paths.js +9 -0
- package/dist/development/src/paths.js.map +1 -0
- package/dist/production/run.cjs +27 -0
- package/dist/production/run.cjs.map +1 -0
- package/dist/production/run.js +26 -0
- package/dist/production/run.js.map +1 -0
- package/dist/production/src/commands/WorkspaceCreateCommand.cjs +50 -0
- package/dist/production/src/commands/WorkspaceCreateCommand.cjs.map +1 -0
- package/dist/production/src/commands/WorkspaceCreateCommand.js +50 -0
- package/dist/production/src/commands/WorkspaceCreateCommand.js.map +1 -0
- package/dist/production/src/lib/FileSystem.cjs +48 -0
- package/dist/production/src/lib/FileSystem.cjs.map +1 -0
- package/dist/production/src/lib/FileSystem.js +32 -0
- package/dist/production/src/lib/FileSystem.js.map +1 -0
- package/dist/production/src/lib/PackageDownloader.cjs +33 -0
- package/dist/production/src/lib/PackageDownloader.cjs.map +1 -0
- package/dist/production/src/lib/PackageDownloader.js +33 -0
- package/dist/production/src/lib/PackageDownloader.js.map +1 -0
- package/dist/production/src/lib/TemplateInstaller.cjs +87 -0
- package/dist/production/src/lib/TemplateInstaller.cjs.map +1 -0
- package/dist/production/src/lib/TemplateInstaller.js +87 -0
- package/dist/production/src/lib/TemplateInstaller.js.map +1 -0
- package/dist/production/src/lib/version.cjs +10 -0
- package/dist/production/src/lib/version.cjs.map +1 -0
- package/dist/production/src/lib/version.js +10 -0
- package/dist/production/src/lib/version.js.map +1 -0
- package/dist/production/src/paths.cjs +10 -0
- package/dist/production/src/paths.cjs.map +1 -0
- package/dist/production/src/paths.js +9 -0
- package/dist/production/src/paths.js.map +1 -0
- package/dist/types/commands/WorkspaceCreateCommand.d.ts.map +1 -0
- package/dist/{src → types}/lib/FileSystem.d.ts +0 -1
- package/dist/types/lib/FileSystem.d.ts.map +1 -0
- package/dist/{src → types}/lib/PackageDownloader.d.ts.map +1 -1
- package/dist/{src → types}/lib/TemplateInstaller.d.ts.map +1 -1
- package/dist/types/lib/version.d.ts +2 -0
- package/dist/types/lib/version.d.ts.map +1 -0
- package/dist/{src/lib/pathUtils.d.ts → types/paths.d.ts} +1 -1
- package/dist/types/paths.d.ts.map +1 -0
- package/dist/types/tsconfig.tsbuildinfo +1 -0
- package/package.json +27 -6
- package/resources/templates/template-workspace/admin/app/index.html +1 -1
- package/resources/templates/template-workspace/admin/lib/binding/delete.tsx +1 -1
- package/resources/templates/template-workspace/admin/lib/block-repeater/block-repeater.tsx +2 -2
- package/resources/templates/template-workspace/admin/lib/datagrid/column-header.tsx +64 -40
- package/resources/templates/template-workspace/admin/lib/datagrid/columns.tsx +166 -33
- package/resources/templates/template-workspace/admin/lib/datagrid/filters/boolean.tsx +23 -17
- package/resources/templates/template-workspace/admin/lib/datagrid/filters/date.tsx +44 -35
- package/resources/templates/template-workspace/admin/lib/datagrid/filters/enum.tsx +22 -14
- package/resources/templates/template-workspace/admin/lib/datagrid/filters/mobile.tsx +4 -4
- package/resources/templates/template-workspace/admin/lib/datagrid/filters/number.tsx +31 -24
- package/resources/templates/template-workspace/admin/lib/datagrid/filters/relation.tsx +51 -32
- package/resources/templates/template-workspace/admin/lib/datagrid/grid.tsx +2 -10
- package/resources/templates/template-workspace/admin/lib/datagrid/table.tsx +17 -10
- package/resources/templates/template-workspace/admin/lib/datagrid/tiles.tsx +4 -2
- package/resources/templates/template-workspace/admin/lib/datagrid/toolbar.tsx +8 -2
- package/resources/templates/template-workspace/admin/lib/datagrid/ui.tsx +4 -4
- package/resources/templates/template-workspace/admin/lib/dict.ts +65 -72
- package/resources/templates/template-workspace/admin/lib/dimensions/dimensions.tsx +2 -2
- package/resources/templates/template-workspace/admin/lib/editor/common/editor-canvas.tsx +2 -2
- package/resources/templates/template-workspace/admin/lib/editor/common/editor-editable-canvas.tsx +1 -1
- package/resources/templates/template-workspace/admin/lib/editor/common/editor-inline-toolbar.tsx +2 -5
- package/resources/templates/template-workspace/admin/lib/editor/common/elements/TableElementRenderer.tsx +2 -2
- package/resources/templates/template-workspace/admin/lib/editor/editor-block.tsx +1 -1
- package/resources/templates/template-workspace/admin/lib/editor/rich-text.tsx +5 -5
- package/resources/templates/template-workspace/admin/lib/editor/sortable-block.tsx +3 -3
- package/resources/templates/template-workspace/admin/lib/form/container.tsx +5 -4
- package/resources/templates/template-workspace/admin/lib/form/inputs.tsx +15 -12
- package/resources/templates/template-workspace/admin/lib/form/select.tsx +23 -10
- package/resources/templates/template-workspace/admin/lib/form/ui.tsx +9 -0
- package/resources/templates/template-workspace/admin/lib/form/upload.tsx +119 -36
- package/resources/templates/template-workspace/admin/lib/formatting/formatting.ts +6 -8
- package/resources/templates/template-workspace/admin/lib/layout/layout.tsx +3 -2
- package/resources/templates/template-workspace/admin/lib/repeater/repeater.tsx +16 -8
- package/resources/templates/template-workspace/admin/lib/select/create-new.tsx +1 -1
- package/resources/templates/template-workspace/admin/lib/select/highlight.tsx +9 -9
- package/resources/templates/template-workspace/admin/lib/select/select.tsx +15 -3
- package/resources/templates/template-workspace/admin/lib/tenant/forms/common.tsx +1 -1
- package/resources/templates/template-workspace/admin/lib/tenant/hooks/useInvite.ts +3 -3
- package/resources/templates/template-workspace/admin/lib/tenant/hooks/useInviteUser.tsx +19 -19
- package/resources/templates/template-workspace/admin/lib/tenant/listing/member-list.tsx +1 -1
- package/resources/templates/template-workspace/admin/lib/ui/dropdown.tsx +7 -7
- package/resources/templates/template-workspace/admin/lib/ui/input.tsx +4 -6
- package/resources/templates/template-workspace/admin/lib/ui/scroll-area.tsx +24 -24
- package/resources/templates/template-workspace/admin/lib/ui/select.tsx +79 -0
- package/resources/templates/template-workspace/admin/lib/ui/sheet.tsx +0 -2
- package/resources/templates/template-workspace/admin/lib/upload/dropzone.tsx +13 -2
- package/resources/templates/template-workspace/admin/lib/upload/ui.tsx +1 -11
- package/resources/templates/template-workspace/admin/lib/upload/upload-progress.tsx +1 -1
- package/resources/templates/template-workspace/admin/lib/upload/view.tsx +39 -26
- package/resources/templates/template-workspace/admin/lib/utils/uic.tsx +6 -6
- package/resources/templates/template-workspace/admin/package.json +18 -18
- package/resources/templates/template-workspace/api/package.json +0 -3
- package/resources/templates/template-workspace/client/package.json +0 -3
- package/resources/templates/template-workspace/package.json +1 -1
- package/src/commands/WorkspaceCreateCommand.ts +3 -2
- package/src/lib/version.ts +7 -0
- package/src/{lib/pathUtils.ts → paths.ts} +3 -1
- package/src/run.ts +1 -1
- package/src/tsconfig.json +1 -1
- package/dist/src/commands/WorkspaceCreateCommand.d.ts.map +0 -1
- package/dist/src/commands/WorkspaceCreateCommand.js +0 -54
- package/dist/src/commands/WorkspaceCreateCommand.js.map +0 -1
- package/dist/src/commands/index.js +0 -18
- package/dist/src/commands/index.js.map +0 -1
- package/dist/src/lib/FileSystem.d.ts.map +0 -1
- package/dist/src/lib/FileSystem.js +0 -54
- package/dist/src/lib/FileSystem.js.map +0 -1
- package/dist/src/lib/PackageDownloader.js +0 -32
- package/dist/src/lib/PackageDownloader.js.map +0 -1
- package/dist/src/lib/TemplateInstaller.js +0 -75
- package/dist/src/lib/TemplateInstaller.js.map +0 -1
- package/dist/src/lib/pathUtils.d.ts.map +0 -1
- package/dist/src/lib/pathUtils.js +0 -7
- package/dist/src/lib/pathUtils.js.map +0 -1
- package/dist/src/run.js +0 -25
- package/dist/src/run.js.map +0 -1
- package/dist/src/tsconfig.tsbuildinfo +0 -1
- package/resources/templates/template-workspace/admin/lib/utils/dict-format.tsx +0 -3
- package/resources/templates/template-workspace/admin/lib/utils/format-image-resize-url.ts +0 -17
- package/resources/templates/template-workspace/admin/lib/utils/formatting.ts +0 -60
- package/resources/templates/template-workspace/admin/vite.config.ts +0 -39
- /package/dist/{src → types}/commands/WorkspaceCreateCommand.d.ts +0 -0
- /package/dist/{src → types}/commands/index.d.ts +0 -0
- /package/dist/{src → types}/commands/index.d.ts.map +0 -0
- /package/dist/{src → types}/lib/PackageDownloader.d.ts +0 -0
- /package/dist/{src → types}/lib/TemplateInstaller.d.ts +0 -0
- /package/dist/{src → types}/run.d.ts +0 -0
- /package/dist/{src → types}/run.d.ts.map +0 -0
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import * as React from 'react'
|
|
2
|
-
import { ReactNode } from 'react'
|
|
2
|
+
import { ReactNode, useCallback } from 'react'
|
|
3
3
|
import { Popover, PopoverTrigger } from '../ui/popover'
|
|
4
|
-
import { Component, SugaredQualifiedEntityList } from '@contember/interface'
|
|
4
|
+
import { Component, SugaredQualifiedEntityList, useEntity, useEntityBeforePersist } from '@contember/interface'
|
|
5
5
|
import { Button } from '../ui/button'
|
|
6
6
|
import { SugaredRelativeSingleEntity } from '@contember/interface'
|
|
7
7
|
import { ChevronDownIcon, XIcon } from 'lucide-react'
|
|
@@ -12,6 +12,7 @@ import { CreateEntityDialog } from './create-new'
|
|
|
12
12
|
import { SelectDefaultFilter } from './filter'
|
|
13
13
|
import { DataViewSortingDirections, DataViewUnionFilterFields } from '@contember/react-dataview'
|
|
14
14
|
import { useFormFieldId } from '@contember/react-form'
|
|
15
|
+
import { dict } from '../dict'
|
|
15
16
|
|
|
16
17
|
export type SelectInputProps =
|
|
17
18
|
& {
|
|
@@ -22,12 +23,23 @@ export type SelectInputProps =
|
|
|
22
23
|
createNewForm?: ReactNode
|
|
23
24
|
queryField?: DataViewUnionFilterFields
|
|
24
25
|
initialSorting?: DataViewSortingDirections
|
|
26
|
+
required?: boolean
|
|
25
27
|
}
|
|
26
28
|
|
|
27
29
|
|
|
28
|
-
export const SelectInput = Component<SelectInputProps>(({ field, queryField, options, children, placeholder, createNewForm, initialSorting }) => {
|
|
30
|
+
export const SelectInput = Component<SelectInputProps>(({ field, queryField, options, children, placeholder, createNewForm, initialSorting, required }) => {
|
|
29
31
|
const [open, setOpen] = React.useState(false)
|
|
30
32
|
const id = useFormFieldId()
|
|
33
|
+
const getEntity = useEntity().getAccessor
|
|
34
|
+
useEntityBeforePersist(useCallback(() => {
|
|
35
|
+
if (!required) {
|
|
36
|
+
return
|
|
37
|
+
}
|
|
38
|
+
const entity = getEntity().getEntity({ field })
|
|
39
|
+
if (!entity.existsOnServer && !entity.hasUnpersistedChanges) {
|
|
40
|
+
entity.addError(dict.errors.required)
|
|
41
|
+
}
|
|
42
|
+
}, [field, getEntity, required]))
|
|
31
43
|
|
|
32
44
|
return (
|
|
33
45
|
<Select field={field} onSelect={() => setOpen(false)} options={options}>
|
|
@@ -25,7 +25,7 @@ export const TenantFormError = <CtxValue extends FormContextValue<any, any, any>
|
|
|
25
25
|
)
|
|
26
26
|
}
|
|
27
27
|
|
|
28
|
-
const TenantFormSingleError = ({ error, developerMessage }: { error: string
|
|
28
|
+
const TenantFormSingleError = ({ error, developerMessage }: { error: string; developerMessage?: string }) => {
|
|
29
29
|
const [showDeveloperMessage, setShowDeveloperMessage] = useState(false)
|
|
30
30
|
return <>
|
|
31
31
|
<FormErrorUI>{error}</FormErrorUI>
|
|
@@ -12,9 +12,9 @@ export const useInvite = () => {
|
|
|
12
12
|
const api = useTenantApi()
|
|
13
13
|
|
|
14
14
|
return useCallback(async (variables: {
|
|
15
|
-
email: string
|
|
16
|
-
projectSlug: string
|
|
17
|
-
memberships: TenantApi.MembershipInput[]
|
|
15
|
+
email: string
|
|
16
|
+
projectSlug: string
|
|
17
|
+
memberships: TenantApi.MembershipInput[]
|
|
18
18
|
}) => {
|
|
19
19
|
return (await api(TenantApi.mutation$.invite(InviteFetcher), {
|
|
20
20
|
variables: {
|
|
@@ -18,28 +18,28 @@ export const useInviteUser = ({ emailField, personIdField, memberships }: {
|
|
|
18
18
|
const toast = useShowToast()
|
|
19
19
|
|
|
20
20
|
return useReferentiallyStableCallback(async (getAccessor: () => EntityAccessor) => {
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
21
|
+
const accessor = getAccessor()
|
|
22
|
+
const personId = accessor.getField<string>(personIdField)
|
|
23
|
+
const email = accessor.getField<string>(emailField)
|
|
24
24
|
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
25
|
+
if (personId.value || !email.value) {
|
|
26
|
+
return
|
|
27
|
+
}
|
|
28
28
|
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
29
|
+
const result = await invite({
|
|
30
|
+
email: email.value,
|
|
31
|
+
projectSlug: project!,
|
|
32
|
+
memberships: memberships,
|
|
33
|
+
})
|
|
34
34
|
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
}
|
|
41
|
-
personId.updateValue(result.result.person.id)
|
|
35
|
+
return () => {
|
|
36
|
+
if (!result?.ok || !result?.result) {
|
|
37
|
+
return toast(<ToastContent title={dict.inviteErrors[result?.error?.code ?? 'fallback']} />, {
|
|
38
|
+
type: 'error',
|
|
39
|
+
})
|
|
42
40
|
}
|
|
43
|
-
|
|
41
|
+
personId.updateValue(result.result.person.id)
|
|
42
|
+
}
|
|
43
|
+
},
|
|
44
44
|
)
|
|
45
45
|
}
|
|
@@ -118,7 +118,7 @@ export const MemberList = ({ filter, labels, tableColumns, controller, tableHead
|
|
|
118
118
|
}
|
|
119
119
|
}
|
|
120
120
|
|
|
121
|
-
const EditMembershipDialog = ({ projectSlug, identityId, onSuccess }: { projectSlug: string
|
|
121
|
+
const EditMembershipDialog = ({ projectSlug, identityId, onSuccess }: { projectSlug: string; identityId: string; onSuccess: () => void }) => {
|
|
122
122
|
|
|
123
123
|
const showToast = useShowToast()
|
|
124
124
|
const [open, setOpen] = useState(false)
|
|
@@ -98,11 +98,11 @@ export const DropDownTriggerButton = uic('button', {
|
|
|
98
98
|
export const DefaultDropdown = ({ children }: {
|
|
99
99
|
children: ReactNode
|
|
100
100
|
}) => (<DropdownMenu>
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
101
|
+
<DropdownMenuTrigger asChild>
|
|
102
|
+
<DropDownTriggerButton />
|
|
103
|
+
</DropdownMenuTrigger>
|
|
104
|
+
<DropdownMenuContent className="w-[160px]">
|
|
105
|
+
{children}
|
|
106
|
+
</DropdownMenuContent>
|
|
107
|
+
</DropdownMenu>
|
|
108
108
|
)
|
|
@@ -24,17 +24,12 @@ export const Input = uic('input', {
|
|
|
24
24
|
displayName: 'Input',
|
|
25
25
|
})
|
|
26
26
|
|
|
27
|
-
export const Select = uic('select', {
|
|
28
|
-
baseClass: 'flex w-full h-10 rounded-md p-2 text-sm border border-input bg-background ring-offset-background file:border-0 file:bg-transparent file:text-sm file:font-medium placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50 data-[invalid]:border-destructive data-[invalid]:ring-destructive',
|
|
29
|
-
displayName: 'Select',
|
|
30
|
-
})
|
|
31
|
-
|
|
32
27
|
export const InputLike = uic('div', {
|
|
33
28
|
baseClass: `
|
|
34
29
|
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
|
|
35
30
|
file:border-0 file:bg-transparent file:text-sm file:font-medium
|
|
36
31
|
placeholder:text-muted-foreground
|
|
37
|
-
focus-
|
|
32
|
+
focus-within:outline-none focus-within:ring-2 focus-within:ring-ring focus-within:ring-offset-2
|
|
38
33
|
disabled:cursor-not-allowed
|
|
39
34
|
disabled:opacity-50
|
|
40
35
|
`,
|
|
@@ -52,6 +47,9 @@ export const InputBare = uic('input', {
|
|
|
52
47
|
|
|
53
48
|
export const CheckboxInput = uic('input', {
|
|
54
49
|
baseClass: 'w-4 h-4',
|
|
50
|
+
defaultProps: {
|
|
51
|
+
type: 'checkbox',
|
|
52
|
+
},
|
|
55
53
|
})
|
|
56
54
|
|
|
57
55
|
export const RadioInput = uic('input', {
|
|
@@ -6,17 +6,17 @@ const ScrollArea = React.forwardRef<
|
|
|
6
6
|
React.ElementRef<typeof ScrollAreaPrimitive.Root>,
|
|
7
7
|
React.ComponentPropsWithoutRef<typeof ScrollAreaPrimitive.Root>
|
|
8
8
|
>(({ className, children, ...props }, ref) => (
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
9
|
+
<ScrollAreaPrimitive.Root
|
|
10
|
+
ref={ref}
|
|
11
|
+
className={'relative overflow-hidden'}
|
|
12
|
+
{...props}
|
|
13
|
+
>
|
|
14
|
+
<ScrollAreaPrimitive.Viewport className={cn('h-full w-full rounded-[inherit]', className)}>
|
|
15
|
+
{children}
|
|
16
|
+
</ScrollAreaPrimitive.Viewport>
|
|
17
|
+
<ScrollBar/>
|
|
18
|
+
<ScrollAreaPrimitive.Corner/>
|
|
19
|
+
</ScrollAreaPrimitive.Root>
|
|
20
20
|
))
|
|
21
21
|
ScrollArea.displayName = ScrollAreaPrimitive.Root.displayName
|
|
22
22
|
|
|
@@ -24,21 +24,21 @@ const ScrollBar = React.forwardRef<
|
|
|
24
24
|
React.ElementRef<typeof ScrollAreaPrimitive.ScrollAreaScrollbar>,
|
|
25
25
|
React.ComponentPropsWithoutRef<typeof ScrollAreaPrimitive.ScrollAreaScrollbar>
|
|
26
26
|
>(({ className, orientation = 'vertical', ...props }, ref) => (
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
27
|
+
<ScrollAreaPrimitive.ScrollAreaScrollbar
|
|
28
|
+
ref={ref}
|
|
29
|
+
orientation={orientation}
|
|
30
|
+
className={cn(
|
|
31
|
+
'flex touch-none select-none transition-colors',
|
|
32
|
+
orientation === 'vertical' &&
|
|
33
33
|
'h-full w-2.5 border-l border-l-transparent p-[1px]',
|
|
34
|
-
|
|
34
|
+
orientation === 'horizontal' &&
|
|
35
35
|
'h-2.5 flex-col border-t border-t-transparent p-[1px]',
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
36
|
+
className,
|
|
37
|
+
)}
|
|
38
|
+
{...props}
|
|
39
|
+
>
|
|
40
|
+
<ScrollAreaPrimitive.ScrollAreaThumb className="relative flex-1 rounded-full bg-border"/>
|
|
41
|
+
</ScrollAreaPrimitive.ScrollAreaScrollbar>
|
|
42
42
|
))
|
|
43
43
|
ScrollBar.displayName = ScrollAreaPrimitive.ScrollAreaScrollbar.displayName
|
|
44
44
|
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
import * as SelectPrimitive from '@radix-ui/react-select'
|
|
2
|
+
import { Check, ChevronDown, ChevronUp } from 'lucide-react'
|
|
3
|
+
import { uic } from '../utils'
|
|
4
|
+
|
|
5
|
+
export const Select = SelectPrimitive.Root
|
|
6
|
+
|
|
7
|
+
export const SelectGroup = SelectPrimitive.Group
|
|
8
|
+
|
|
9
|
+
export const SelectValue = SelectPrimitive.Value
|
|
10
|
+
|
|
11
|
+
export const SelectTrigger = uic(SelectPrimitive.Trigger, {
|
|
12
|
+
baseClass:
|
|
13
|
+
'flex gap-1 h-10 w-full items-center justify-between rounded-md border border-input bg-background px-3 py-2 text-sm ring-offset-background placeholder:text-muted-foreground focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50 [&>span]:line-clamp-1',
|
|
14
|
+
afterChildren: (
|
|
15
|
+
<SelectPrimitive.Icon asChild>
|
|
16
|
+
<ChevronDown className="h-4 w-4 opacity-50" />
|
|
17
|
+
</SelectPrimitive.Icon>
|
|
18
|
+
),
|
|
19
|
+
displayName: SelectPrimitive.Trigger.displayName,
|
|
20
|
+
})
|
|
21
|
+
|
|
22
|
+
export const SelectScrollUpButton = uic(SelectPrimitive.ScrollUpButton, {
|
|
23
|
+
baseClass: 'flex cursor-default items-center justify-center py-1',
|
|
24
|
+
beforeChildren: <ChevronUp className="h-4 w-4" />,
|
|
25
|
+
displayName: SelectPrimitive.ScrollUpButton.displayName,
|
|
26
|
+
})
|
|
27
|
+
|
|
28
|
+
export const SelectScrollDownButton = uic(SelectPrimitive.ScrollDownButton, {
|
|
29
|
+
baseClass: 'flex cursor-default items-center justify-center py-1',
|
|
30
|
+
beforeChildren: <ChevronDown className="h-4 w-4" />,
|
|
31
|
+
displayName: SelectPrimitive.ScrollDownButton.displayName,
|
|
32
|
+
})
|
|
33
|
+
|
|
34
|
+
export const SelectContent = uic(SelectPrimitive.Content, {
|
|
35
|
+
baseClass:
|
|
36
|
+
'relative z-50 max-h-96 min-w-[8rem] overflow-hidden rounded-md border bg-popover text-popover-foreground shadow-md data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2',
|
|
37
|
+
displayName: SelectPrimitive.Content.displayName,
|
|
38
|
+
variants: {
|
|
39
|
+
position: {
|
|
40
|
+
popper:
|
|
41
|
+
'data-[side=bottom]:translate-y-1 data-[side=left]:-translate-x-1 data-[side=right]:translate-x-1 data-[side=top]:-translate-y-1',
|
|
42
|
+
},
|
|
43
|
+
},
|
|
44
|
+
defaultVariants: {
|
|
45
|
+
position: 'popper',
|
|
46
|
+
},
|
|
47
|
+
wrapInner: ({ children }) => (
|
|
48
|
+
<>
|
|
49
|
+
<SelectScrollUpButton />
|
|
50
|
+
<SelectPrimitive.Viewport className="p-1 h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)]">
|
|
51
|
+
{children}
|
|
52
|
+
</SelectPrimitive.Viewport>
|
|
53
|
+
<SelectScrollDownButton />
|
|
54
|
+
</>
|
|
55
|
+
),
|
|
56
|
+
})
|
|
57
|
+
|
|
58
|
+
export const SelectLabel = uic(SelectPrimitive.Label, {
|
|
59
|
+
baseClass: 'py-1.5 pl-8 pr-2 text-sm font-semibold',
|
|
60
|
+
displayName: SelectPrimitive.Label.displayName,
|
|
61
|
+
})
|
|
62
|
+
|
|
63
|
+
export const SelectItem = uic(SelectPrimitive.Item, {
|
|
64
|
+
baseClass:
|
|
65
|
+
'relative flex w-full cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50',
|
|
66
|
+
beforeChildren: (
|
|
67
|
+
<span className="absolute left-2 flex h-3.5 w-3.5 items-center justify-center">
|
|
68
|
+
<SelectPrimitive.ItemIndicator>
|
|
69
|
+
<Check className="h-4 w-4" />
|
|
70
|
+
</SelectPrimitive.ItemIndicator>
|
|
71
|
+
</span>
|
|
72
|
+
),
|
|
73
|
+
displayName: SelectPrimitive.Item.displayName,
|
|
74
|
+
})
|
|
75
|
+
|
|
76
|
+
export const SelectSeparator = uic(SelectPrimitive.Separator, {
|
|
77
|
+
baseClass: '-mx-1 my-1 h-px bg-muted',
|
|
78
|
+
displayName: SelectPrimitive.Separator.displayName,
|
|
79
|
+
})
|
|
@@ -2,9 +2,13 @@ import * as React from 'react'
|
|
|
2
2
|
import { UploaderDropzoneArea, UploaderDropzoneRoot } from '@contember/react-uploader-dropzone'
|
|
3
3
|
import { useUploaderStateFiles } from '@contember/react-uploader'
|
|
4
4
|
import { UploaderDropzoneAreaUI, UploaderDropzoneWrapperUI, UploaderInactiveDropzoneUI } from './ui'
|
|
5
|
+
import { ReactNode } from 'react'
|
|
6
|
+
import { UploadIcon } from 'lucide-react'
|
|
7
|
+
import { dict } from '../dict'
|
|
8
|
+
import { Button } from '../ui/button'
|
|
5
9
|
|
|
6
10
|
|
|
7
|
-
export const UploaderDropzone = ({ inactiveOnUpload }: { inactiveOnUpload?: boolean }) => {
|
|
11
|
+
export const UploaderDropzone = ({ inactiveOnUpload, dropzonePlaceholder }: { inactiveOnUpload?: boolean; dropzonePlaceholder?: ReactNode }) => {
|
|
8
12
|
const filesInProgress = useUploaderStateFiles({ state: ['uploading', 'initial', 'finalizing'] })
|
|
9
13
|
const showLoader = inactiveOnUpload && filesInProgress.length > 0
|
|
10
14
|
|
|
@@ -13,7 +17,14 @@ export const UploaderDropzone = ({ inactiveOnUpload }: { inactiveOnUpload?: bool
|
|
|
13
17
|
<UploaderDropzoneWrapperUI>
|
|
14
18
|
{showLoader
|
|
15
19
|
? <UploaderInactiveDropzoneUI />
|
|
16
|
-
: <UploaderDropzoneArea
|
|
20
|
+
: <UploaderDropzoneArea>{dropzonePlaceholder ?? <UploaderDropzoneAreaUI>
|
|
21
|
+
<UploadIcon className={'w-12 h-12 text-gray-400'} />
|
|
22
|
+
<div className={'font-semibold text-sm'}>{dict.uploader.dropFiles}</div>
|
|
23
|
+
<div className={'text-xs'}>{dict.uploader.or}</div>
|
|
24
|
+
<div className={'flex gap-2 items-center text-xs'}>
|
|
25
|
+
<Button size={'sm'} variant={'outline'}>{dict.uploader.browseFiles}</Button>
|
|
26
|
+
</div>
|
|
27
|
+
</UploaderDropzoneAreaUI>}</UploaderDropzoneArea>
|
|
17
28
|
}
|
|
18
29
|
</UploaderDropzoneWrapperUI>
|
|
19
30
|
</UploaderDropzoneRoot>
|
|
@@ -1,8 +1,6 @@
|
|
|
1
1
|
import * as React from 'react'
|
|
2
2
|
import { Loader } from '../ui/loader'
|
|
3
|
-
import { GripIcon
|
|
4
|
-
import { dict } from '../dict'
|
|
5
|
-
import { Button } from '../ui/button'
|
|
3
|
+
import { GripIcon } from 'lucide-react'
|
|
6
4
|
import { uic } from '../utils/uic'
|
|
7
5
|
|
|
8
6
|
export const UploaderDropzoneWrapperUI = uic('div', { baseClass: 'rounded border p-1 shadow' })
|
|
@@ -21,14 +19,6 @@ export const UploaderDropzoneAreaUI = uic('div', {
|
|
|
21
19
|
defaultVariants: {
|
|
22
20
|
size: 'square',
|
|
23
21
|
},
|
|
24
|
-
beforeChildren: <>
|
|
25
|
-
<UploadIcon className={'w-12 h-12 text-gray-400'} />
|
|
26
|
-
<div className={'font-semibold text-sm'}>{dict.uploader.dropFiles}</div>
|
|
27
|
-
<div className={'text-xs'}>{dict.uploader.or}</div>
|
|
28
|
-
<div className={'flex gap-2 items-center text-xs'}>
|
|
29
|
-
<Button size={'sm'} variant={'outline'}>{dict.uploader.browseFiles}</Button>
|
|
30
|
-
</div>
|
|
31
|
-
</>,
|
|
32
22
|
})
|
|
33
23
|
|
|
34
24
|
|
|
@@ -40,7 +40,7 @@ const UploadError = ({ state: { error } }: { state: UploaderFileStateError }) =>
|
|
|
40
40
|
return <div className="text-red-700 text-xs font-semibold">{formattedError}</div>
|
|
41
41
|
}
|
|
42
42
|
|
|
43
|
-
export const UploaderFileProgressUI = ({ file, progress, info, actions }: { file: File
|
|
43
|
+
export const UploaderFileProgressUI = ({ file, progress, info, actions }: { file: File; progress?: number; actions?: ReactNode; info?: ReactNode }) => {
|
|
44
44
|
const fileName = file.name
|
|
45
45
|
const extension = file.name.split('.').pop()?.toUpperCase()
|
|
46
46
|
|
|
@@ -2,19 +2,19 @@ import * as React from 'react'
|
|
|
2
2
|
import { ComponentType, ReactNode } from 'react'
|
|
3
3
|
import { Component, Field, SugaredRelativeSingleField, useEntity, useField } from '@contember/interface'
|
|
4
4
|
import { AudioFileDataExtractorProps, FileUrlDataExtractorProps, GenericFileMetadataExtractorProps, ImageFileDataExtractorProps, VideoFileDataExtractorProps } from '@contember/react-uploader'
|
|
5
|
-
import { formatBytes, formatDate, formatDuration } from '../formatting
|
|
5
|
+
import { formatBytes, formatDate, formatDuration } from '../formatting'
|
|
6
6
|
import { Button } from '../ui/button'
|
|
7
7
|
import { FileIcon, InfoIcon, TrashIcon } from 'lucide-react'
|
|
8
8
|
import { Popover, PopoverContent, PopoverTrigger } from '../ui/popover'
|
|
9
|
-
import { formatImageResizeUrl } from '../images
|
|
9
|
+
import { formatImageResizeUrl } from '../images'
|
|
10
10
|
|
|
11
11
|
export type UploadedImageViewProps =
|
|
12
12
|
& FileUrlDataExtractorProps
|
|
13
13
|
& GenericFileMetadataExtractorProps
|
|
14
14
|
& ImageFileDataExtractorProps
|
|
15
15
|
& {
|
|
16
|
-
|
|
17
|
-
}
|
|
16
|
+
DestroyAction?: ComponentType<{ children: ReactNode }>
|
|
17
|
+
}
|
|
18
18
|
|
|
19
19
|
export const UploadedImageView = Component<UploadedImageViewProps>(({ DestroyAction, ...props }) => {
|
|
20
20
|
const url = useField<string>(props.urlField).value
|
|
@@ -22,22 +22,24 @@ export const UploadedImageView = Component<UploadedImageViewProps>(({ DestroyAct
|
|
|
22
22
|
<div className="flex items-center justify-center h-40 w-40 rounded-md group relative">
|
|
23
23
|
{url && <img src={formatImageResizeUrl(url)} className="max-w-full max-h-full" />}
|
|
24
24
|
<FileActions DestroyAction={DestroyAction}>
|
|
25
|
-
|
|
25
|
+
<ImageMetadata {...props} />
|
|
26
26
|
</FileActions>
|
|
27
27
|
</div>
|
|
28
28
|
)
|
|
29
|
-
},
|
|
30
|
-
|
|
31
|
-
|
|
29
|
+
}, props => {
|
|
30
|
+
return <>
|
|
31
|
+
<Field field={props.urlField} />
|
|
32
|
+
<ImageMetadata {...props} />
|
|
33
|
+
</>
|
|
32
34
|
})
|
|
33
35
|
|
|
34
|
-
const ImageMetadata = ({ heightField, widthField, ...props }: UploadedImageViewProps) => {
|
|
36
|
+
const ImageMetadata = Component(({ heightField, widthField, ...props }: UploadedImageViewProps) => {
|
|
35
37
|
return (
|
|
36
38
|
<Metadata {...props}>
|
|
37
39
|
<DimensionsMeta widthField={widthField} heightField={heightField} />
|
|
38
40
|
</Metadata>
|
|
39
41
|
)
|
|
40
|
-
}
|
|
42
|
+
})
|
|
41
43
|
|
|
42
44
|
|
|
43
45
|
export type UploadedAudioViewProps =
|
|
@@ -58,9 +60,11 @@ export const UploadedAudioView = Component<UploadedAudioViewProps>(({ DestroyAct
|
|
|
58
60
|
</FileActions>
|
|
59
61
|
</div>
|
|
60
62
|
)
|
|
61
|
-
},
|
|
62
|
-
|
|
63
|
-
|
|
63
|
+
}, props => {
|
|
64
|
+
return <>
|
|
65
|
+
<Field field={props.urlField} />
|
|
66
|
+
<AudioMetadata {...props} />
|
|
67
|
+
</>
|
|
64
68
|
})
|
|
65
69
|
|
|
66
70
|
const AudioMetadata = ({ durationField, ...props }: UploadedAudioViewProps) => {
|
|
@@ -90,19 +94,21 @@ export const UploadedVideoView = Component<UploadedVideoViewProps>(({ DestroyAct
|
|
|
90
94
|
</FileActions>
|
|
91
95
|
</div>
|
|
92
96
|
)
|
|
93
|
-
},
|
|
94
|
-
|
|
95
|
-
|
|
97
|
+
}, props => {
|
|
98
|
+
return <>
|
|
99
|
+
<Field field={props.urlField} />
|
|
100
|
+
<VideoMetadata {...props} />
|
|
101
|
+
</>
|
|
96
102
|
})
|
|
97
103
|
|
|
98
|
-
const VideoMetadata = ({ durationField, widthField, heightField, ...props }: UploadedVideoViewProps) => {
|
|
104
|
+
const VideoMetadata = Component(({ durationField, widthField, heightField, ...props }: UploadedVideoViewProps) => {
|
|
99
105
|
return (
|
|
100
106
|
<Metadata {...props}>
|
|
101
107
|
<MetaField field={durationField} label="Duration:" format={formatDuration} />
|
|
102
108
|
<DimensionsMeta widthField={widthField} heightField={heightField} />
|
|
103
109
|
</Metadata>
|
|
104
110
|
)
|
|
105
|
-
}
|
|
111
|
+
})
|
|
106
112
|
|
|
107
113
|
export type UploadedAnyViewProps =
|
|
108
114
|
& FileUrlDataExtractorProps
|
|
@@ -137,7 +143,7 @@ type MetadataProps =
|
|
|
137
143
|
children?: ReactNode
|
|
138
144
|
}
|
|
139
145
|
|
|
140
|
-
const Metadata = ({ children, urlField, fileSizeField, fileNameField, lastModifiedField, fileTypeField }: MetadataProps) => {
|
|
146
|
+
const Metadata = Component(({ children, urlField, fileSizeField, fileNameField, lastModifiedField, fileTypeField }: MetadataProps) => {
|
|
141
147
|
return (
|
|
142
148
|
<div className="grid grid-cols-[6rem_1fr] gap-2">
|
|
143
149
|
<MetaField field={fileSizeField} label="Size:" format={formatBytes} />
|
|
@@ -152,9 +158,9 @@ const Metadata = ({ children, urlField, fileSizeField, fileNameField, lastModifi
|
|
|
152
158
|
)} />
|
|
153
159
|
</div>
|
|
154
160
|
)
|
|
155
|
-
}
|
|
161
|
+
})
|
|
156
162
|
|
|
157
|
-
const DimensionsMeta = ({ widthField, heightField }: {
|
|
163
|
+
const DimensionsMeta = Component(({ widthField, heightField }: {
|
|
158
164
|
widthField?: SugaredRelativeSingleField['field']
|
|
159
165
|
heightField?: SugaredRelativeSingleField['field']
|
|
160
166
|
}) => {
|
|
@@ -171,14 +177,19 @@ const DimensionsMeta = ({ widthField, heightField }: {
|
|
|
171
177
|
<span>{width} x {height} px</span>
|
|
172
178
|
</>
|
|
173
179
|
)
|
|
180
|
+
}, ({ widthField, heightField }) => {
|
|
181
|
+
return <>
|
|
182
|
+
{widthField && <Field field={widthField} />}
|
|
183
|
+
{heightField && <Field field={heightField} />}
|
|
184
|
+
</>
|
|
185
|
+
})
|
|
174
186
|
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
const MetaField = ({ field, label, format = it => it }: {
|
|
187
|
+
interface MetaFieldProps {
|
|
178
188
|
field?: SugaredRelativeSingleField['field']
|
|
179
189
|
label: ReactNode
|
|
180
190
|
format?: (value: any) => ReactNode
|
|
181
|
-
}
|
|
191
|
+
}
|
|
192
|
+
const MetaField = Component<MetaFieldProps>(({ field, label, format = it => it }) => {
|
|
182
193
|
const entity = useEntity()
|
|
183
194
|
return field ? (
|
|
184
195
|
<>
|
|
@@ -188,7 +199,9 @@ const MetaField = ({ field, label, format = it => it }: {
|
|
|
188
199
|
</span>
|
|
189
200
|
</>
|
|
190
201
|
) : null
|
|
191
|
-
}
|
|
202
|
+
}, ({ field }) => {
|
|
203
|
+
return field ? <Field field={field} /> : null
|
|
204
|
+
})
|
|
192
205
|
|
|
193
206
|
|
|
194
207
|
const FileActions = ({ DestroyAction, children }: {
|
|
@@ -5,8 +5,8 @@ import { Slot } from '@radix-ui/react-slot'
|
|
|
5
5
|
import { cva } from 'class-variance-authority'
|
|
6
6
|
import { twMerge } from 'tailwind-merge'
|
|
7
7
|
|
|
8
|
-
type StringToBoolean<T> = T extends 'true' | 'false' ? boolean : T
|
|
9
|
-
type ConfigSchema = Record<string, Record<string, ClassValue
|
|
8
|
+
type StringToBoolean<T> = T extends 'true' | 'false' ? boolean : T
|
|
9
|
+
type ConfigSchema = Record<string, Record<string, ClassValue>>
|
|
10
10
|
|
|
11
11
|
export type ConfigVariants<T extends ConfigSchema | undefined> = T extends ConfigSchema ? {
|
|
12
12
|
[Variant in keyof T]?: StringToBoolean<keyof T[Variant]> | null | undefined;
|
|
@@ -18,12 +18,12 @@ type ConfigVariantsMulti<T extends ConfigSchema | undefined> = T extends ConfigS
|
|
|
18
18
|
|
|
19
19
|
type Config<T extends ConfigSchema | undefined, El extends React.ElementType> = {
|
|
20
20
|
baseClass?: ClassValue
|
|
21
|
-
variants?: T
|
|
21
|
+
variants?: T
|
|
22
22
|
passVariantProps?: string[]
|
|
23
23
|
defaultProps?: Partial<React.ComponentProps<El>>
|
|
24
|
-
defaultVariants?: ConfigVariants<T
|
|
25
|
-
compoundVariants?: ((ConfigVariants<T> | ConfigVariantsMulti<T>) & { className?: string })[]
|
|
26
|
-
displayName?: string
|
|
24
|
+
defaultVariants?: ConfigVariants<T>
|
|
25
|
+
compoundVariants?: ((ConfigVariants<T> | ConfigVariantsMulti<T>) & { className?: string })[]
|
|
26
|
+
displayName?: string
|
|
27
27
|
wrapOuter?: ComponentType<{ children?: ReactNode } & ConfigVariants<T>>
|
|
28
28
|
wrapInner?: ComponentType<{ children?: ReactNode } & ConfigVariants<T>>
|
|
29
29
|
beforeChildren?: ReactElement
|
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
"test": "echo \"Error: no test specified\" && exit 1"
|
|
9
9
|
},
|
|
10
10
|
"devDependencies": {
|
|
11
|
-
"@contember/vite-plugin": "
|
|
11
|
+
"@contember/vite-plugin": "{version}",
|
|
12
12
|
"@types/react": "^18",
|
|
13
13
|
"@types/react-dom": "^18",
|
|
14
14
|
"@vitejs/plugin-react": "^4.2.1",
|
|
@@ -19,23 +19,23 @@
|
|
|
19
19
|
"vite": "^5"
|
|
20
20
|
},
|
|
21
21
|
"dependencies": {
|
|
22
|
-
"@contember/client-content": "
|
|
23
|
-
"@contember/graphql-client": "
|
|
22
|
+
"@contember/client-content": "{version}",
|
|
23
|
+
"@contember/graphql-client": "{version}",
|
|
24
24
|
"@contember/graphql-client-tenant": "{version}",
|
|
25
|
-
"@contember/interface": "
|
|
26
|
-
"@contember/react-block-repeater": "
|
|
27
|
-
"@contember/react-board": "
|
|
28
|
-
"@contember/react-board-dnd-kit": "
|
|
29
|
-
"@contember/react-dataview": "
|
|
30
|
-
"@contember/react-form": "
|
|
31
|
-
"@contember/react-repeater": "
|
|
32
|
-
"@contember/react-repeater-dnd-kit": "
|
|
33
|
-
"@contember/react-select": "
|
|
34
|
-
"@contember/react-slate-editor": "
|
|
35
|
-
"@contember/react-slate-editor-base": "
|
|
36
|
-
"@contember/react-slots": "
|
|
37
|
-
"@contember/react-uploader": "
|
|
38
|
-
"@contember/react-uploader-dropzone": "
|
|
25
|
+
"@contember/interface": "{version}",
|
|
26
|
+
"@contember/react-block-repeater": "{version}",
|
|
27
|
+
"@contember/react-board": "{version}",
|
|
28
|
+
"@contember/react-board-dnd-kit": "{version}",
|
|
29
|
+
"@contember/react-dataview": "{version}",
|
|
30
|
+
"@contember/react-form": "{version}",
|
|
31
|
+
"@contember/react-repeater": "{version}",
|
|
32
|
+
"@contember/react-repeater-dnd-kit": "{version}",
|
|
33
|
+
"@contember/react-select": "{version}",
|
|
34
|
+
"@contember/react-slate-editor": "{version}",
|
|
35
|
+
"@contember/react-slate-editor-base": "{version}",
|
|
36
|
+
"@contember/react-slots": "{version}",
|
|
37
|
+
"@contember/react-uploader": "{version}",
|
|
38
|
+
"@contember/react-uploader-dropzone": "{version}",
|
|
39
39
|
"@radix-ui/react-alert-dialog": "^1.0.5",
|
|
40
40
|
"@radix-ui/react-checkbox": "^1.0.4",
|
|
41
41
|
"@radix-ui/react-dropdown-menu": "^2.0.6",
|
|
@@ -52,7 +52,7 @@
|
|
|
52
52
|
"@radix-ui/react-toolbar": "^1.0.4",
|
|
53
53
|
"@radix-ui/react-tooltip": "^1.0.7",
|
|
54
54
|
"class-variance-authority": "^0.7.0",
|
|
55
|
-
"lucide-react": "^0.
|
|
55
|
+
"lucide-react": "^0.416.0",
|
|
56
56
|
"qrcode-generator": "^1.4.4",
|
|
57
57
|
"react": "^18.2.0",
|
|
58
58
|
"react-dom": "^18.2.0",
|