@contember/create 2.0.0-alpha.39 → 2.0.0-alpha.40
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/paths.cjs +3 -1
- package/dist/development/src/paths.cjs.map +1 -1
- package/dist/development/src/paths.js +4 -2
- package/dist/development/src/paths.js.map +1 -1
- package/dist/production/src/paths.cjs +3 -1
- package/dist/production/src/paths.cjs.map +1 -1
- package/dist/production/src/paths.js +4 -2
- package/dist/production/src/paths.js.map +1 -1
- package/dist/types/paths.d.ts.map +1 -1
- package/dist/types/tsconfig.tsbuildinfo +1 -1
- package/package.json +2 -22
- package/resources/templates/template-workspace/admin/lib/block-repeater/block-repeater.tsx +45 -8
- package/resources/templates/template-workspace/admin/lib/datagrid/cells.tsx +66 -0
- package/resources/templates/template-workspace/admin/lib/datagrid/column-header.tsx +11 -3
- package/resources/templates/template-workspace/admin/lib/datagrid/column-leaf.tsx +21 -0
- package/resources/templates/template-workspace/admin/lib/datagrid/columns.tsx +319 -20
- package/resources/templates/template-workspace/admin/lib/datagrid/elements.tsx +6 -0
- package/resources/templates/template-workspace/admin/lib/datagrid/export.tsx +9 -0
- package/resources/templates/template-workspace/admin/lib/datagrid/filters/boolean.tsx +20 -4
- package/resources/templates/template-workspace/admin/lib/datagrid/filters/common.tsx +3 -0
- package/resources/templates/template-workspace/admin/lib/datagrid/filters/date.tsx +23 -1
- package/resources/templates/template-workspace/admin/lib/datagrid/filters/defined.tsx +20 -4
- package/resources/templates/template-workspace/admin/lib/datagrid/filters/enum.tsx +31 -3
- package/resources/templates/template-workspace/admin/lib/datagrid/filters/index.ts +0 -1
- package/resources/templates/template-workspace/admin/lib/datagrid/filters/mobile.tsx +0 -1
- package/resources/templates/template-workspace/admin/lib/datagrid/filters/number.tsx +19 -4
- package/resources/templates/template-workspace/admin/lib/datagrid/filters/relation.tsx +116 -16
- package/resources/templates/template-workspace/admin/lib/datagrid/filters/text.tsx +46 -4
- package/resources/templates/template-workspace/admin/lib/datagrid/grid.tsx +67 -3
- package/resources/templates/template-workspace/admin/lib/datagrid/index.ts +30 -4
- package/resources/templates/template-workspace/admin/lib/datagrid/labels.tsx +10 -1
- package/resources/templates/template-workspace/admin/lib/datagrid/layout-switcher.tsx +3 -0
- package/resources/templates/template-workspace/admin/lib/datagrid/loader.tsx +19 -3
- package/resources/templates/template-workspace/admin/lib/datagrid/pagination.tsx +8 -0
- package/resources/templates/template-workspace/admin/lib/datagrid/table.tsx +15 -1
- package/resources/templates/template-workspace/admin/lib/datagrid/tiles.tsx +13 -0
- package/resources/templates/template-workspace/admin/lib/datagrid/toolbar.tsx +19 -0
- package/resources/templates/template-workspace/admin/lib/editor/index.ts +1 -0
- package/resources/templates/template-workspace/admin/lib/editor/rich-text-view.tsx +17 -0
- package/resources/templates/template-workspace/admin/lib/repeater/repeater.tsx +82 -60
- package/resources/templates/template-workspace/admin/lib/select/list.tsx +1 -2
- package/resources/templates/template-workspace/admin/lib/upload/view.tsx +2 -2
- package/src/paths.ts +4 -3
|
@@ -3,11 +3,27 @@ import { ReactNode } from 'react'
|
|
|
3
3
|
import { Loader } from '../ui/loader'
|
|
4
4
|
import { DataViewLoaderState } from '@contember/react-dataview'
|
|
5
5
|
|
|
6
|
+
/**
|
|
7
|
+
* Props for the {@link DataGridLoader} component.
|
|
8
|
+
*/
|
|
6
9
|
export interface DataGridLoaderProps {
|
|
7
10
|
children: ReactNode
|
|
8
11
|
}
|
|
9
12
|
|
|
10
|
-
|
|
13
|
+
/**
|
|
14
|
+
* A component that provides a loading state for a data grid.
|
|
15
|
+
* It displays different loaders based on the current loading state.
|
|
16
|
+
*
|
|
17
|
+
* ## Example
|
|
18
|
+
* ```tsx
|
|
19
|
+
* <DataGridLoader>
|
|
20
|
+
* <DataGridTable>
|
|
21
|
+
* <DataGridTextColumn header="Title" field="title" />
|
|
22
|
+
* </DataGridTable>
|
|
23
|
+
* </DataGridLoader>
|
|
24
|
+
* ```
|
|
25
|
+
*/
|
|
26
|
+
export const DataGridLoader = ({ children }: { children: ReactNode }) => (
|
|
11
27
|
<>
|
|
12
28
|
<DataViewLoaderState refreshing loaded>
|
|
13
29
|
<div className="relative">
|
|
@@ -27,10 +43,10 @@ export const DataGridLoader = ({ children }: DataGridLoaderProps) => (
|
|
|
27
43
|
)
|
|
28
44
|
|
|
29
45
|
|
|
30
|
-
|
|
46
|
+
const DataGridOverlayLoader = () => (
|
|
31
47
|
<Loader position={'absolute'} />
|
|
32
48
|
)
|
|
33
49
|
|
|
34
|
-
|
|
50
|
+
const DataGridInitialLoader = () => (
|
|
35
51
|
<Loader position={'static'} />
|
|
36
52
|
)
|
|
@@ -7,6 +7,14 @@ import { DropdownMenuContent, DropdownMenuItem, DropdownMenuTrigger } from '../u
|
|
|
7
7
|
import { dictFormat } from '../dict'
|
|
8
8
|
import { dict } from '../dict'
|
|
9
9
|
|
|
10
|
+
/**
|
|
11
|
+
* Pagination controls UI for DataView.
|
|
12
|
+
*
|
|
13
|
+
* ## Example
|
|
14
|
+
* ```tsx
|
|
15
|
+
* <DataGridPagination />
|
|
16
|
+
* ```
|
|
17
|
+
*/
|
|
10
18
|
export const DataGridPagination = () => (
|
|
11
19
|
<div className="flex gap-6 lg:gap-8 justify-between mt-4">
|
|
12
20
|
<div className="">
|
|
@@ -6,12 +6,26 @@ import { DataViewEachRow, DataViewEmpty, DataViewLayout, DataViewNonEmpty } from
|
|
|
6
6
|
import { SheetIcon } from 'lucide-react'
|
|
7
7
|
import { dict } from '../dict'
|
|
8
8
|
import { ChildrenAnalyzer, Leaf } from '@contember/react-multipass-rendering'
|
|
9
|
-
import { DataGridColumnLeaf, DataGridColumnLeafProps } from './columns'
|
|
10
9
|
|
|
10
|
+
import { DataGridColumnLeaf, DataGridColumnLeafProps } from './column-leaf'
|
|
11
|
+
|
|
12
|
+
/**
|
|
13
|
+
* Props for the {@link DataGridTable} component.
|
|
14
|
+
*/
|
|
11
15
|
export interface DataViewTableProps {
|
|
12
16
|
children: ReactNode
|
|
13
17
|
}
|
|
14
18
|
|
|
19
|
+
/**
|
|
20
|
+
* Table layout for DataView.
|
|
21
|
+
*
|
|
22
|
+
* ## Example
|
|
23
|
+
* ```tsx
|
|
24
|
+
* <DataGridTable>
|
|
25
|
+
* <DataGridTextColumn header="Title" field="title" />
|
|
26
|
+
* </DataGridTable>
|
|
27
|
+
* ```
|
|
28
|
+
*/
|
|
15
29
|
export const DataGridTable = Component<DataViewTableProps>(({ children }) => {
|
|
16
30
|
return (
|
|
17
31
|
<DataViewLayout name="table" label={<>
|
|
@@ -5,11 +5,24 @@ import { dict } from '../dict'
|
|
|
5
5
|
import { LayoutGridIcon } from 'lucide-react'
|
|
6
6
|
import { cn } from '../utils'
|
|
7
7
|
|
|
8
|
+
/**
|
|
9
|
+
* Props for the {@link DataGridTiles} component.
|
|
10
|
+
*/
|
|
8
11
|
export interface DataGridTilesProps {
|
|
9
12
|
children: React.ReactNode
|
|
10
13
|
className?: string
|
|
11
14
|
}
|
|
12
15
|
|
|
16
|
+
/**
|
|
17
|
+
* Simple grid layout for DataView.
|
|
18
|
+
*
|
|
19
|
+
* ## Example
|
|
20
|
+
* ```tsx
|
|
21
|
+
* <DataGridTiles>
|
|
22
|
+
* <MyCustomTile />
|
|
23
|
+
* </DataGridTiles>
|
|
24
|
+
* ```
|
|
25
|
+
*/
|
|
13
26
|
export const DataGridTiles = Component< DataGridTilesProps>(({ children, className }) => {
|
|
14
27
|
return (
|
|
15
28
|
<DataViewLayout name={'grid'} label={<>
|
|
@@ -15,10 +15,29 @@ import { DataGridAutoExport } from './export'
|
|
|
15
15
|
import { DataGridToolbarVisibleElements } from './elements'
|
|
16
16
|
import { DataViewReloadTrigger } from '@contember/react-dataview'
|
|
17
17
|
|
|
18
|
+
/**
|
|
19
|
+
* Props for the {@link DataGridToolbar} component.
|
|
20
|
+
*/
|
|
18
21
|
export interface DataGridToolbarProps {
|
|
19
22
|
children?: ReactNode
|
|
20
23
|
}
|
|
21
24
|
|
|
25
|
+
/**
|
|
26
|
+
* Toolbar for DataGrid with default UI.
|
|
27
|
+
* It contains
|
|
28
|
+
* - filters (with default DataGridQueryFilter, which can be replaced by custom filters in children)
|
|
29
|
+
* - settings (layout switcher, visible elements, per page selector)
|
|
30
|
+
* - export button
|
|
31
|
+
* - reload button
|
|
32
|
+
*
|
|
33
|
+
* ## Example
|
|
34
|
+
* ```tsx
|
|
35
|
+
* <DataGridToolbar>
|
|
36
|
+
* <DataGridQueryFilter />
|
|
37
|
+
* <DataGridTextFilter field={'name'} label="Name" />
|
|
38
|
+
* </DataGridToolbar>
|
|
39
|
+
* ```
|
|
40
|
+
*/
|
|
22
41
|
export const DataGridToolbar = Component<DataGridToolbarProps>(({ children }) => {
|
|
23
42
|
const [showFilters, setShowFilters] = React.useState(false)
|
|
24
43
|
return (
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { Component, FieldView, SugaredRelativeSingleField } from '@contember/interface'
|
|
2
|
+
import { RichTextFieldRenderer, RichTextFieldRendererProps } from '@contember/react-client'
|
|
3
|
+
|
|
4
|
+
export type RichTextRendererProps =
|
|
5
|
+
& {
|
|
6
|
+
field: SugaredRelativeSingleField['field']
|
|
7
|
+
}
|
|
8
|
+
& Omit<RichTextFieldRendererProps, 'source'>
|
|
9
|
+
|
|
10
|
+
export const RichTextView = Component<RichTextRendererProps>(({ field, ...props }) => {
|
|
11
|
+
return <FieldView<string> field={field} render={it => {
|
|
12
|
+
if (!it.value) {
|
|
13
|
+
return null
|
|
14
|
+
}
|
|
15
|
+
return <RichTextFieldRenderer source={JSON.parse(it.value)} {...props} />
|
|
16
|
+
}} />
|
|
17
|
+
})
|
|
@@ -23,18 +23,21 @@ import { DropIndicator } from '../ui/sortable'
|
|
|
23
23
|
import { dict } from '../dict'
|
|
24
24
|
import { ReactNode } from 'react'
|
|
25
25
|
|
|
26
|
-
|
|
27
|
-
baseClass: 'flex flex-col gap-2 relative
|
|
26
|
+
const RepeaterWrapperUI = uic('div', {
|
|
27
|
+
baseClass: 'flex flex-col gap-2 relative bg-white mb-4',
|
|
28
28
|
})
|
|
29
|
-
|
|
29
|
+
const RepeaterItemUI = uic('div', {
|
|
30
30
|
baseClass: 'rounded border bg-gray-50 border-gray-200 p-4 relative group',
|
|
31
31
|
})
|
|
32
|
-
|
|
32
|
+
const RepeaterDragOverlayUI = uic('div', {
|
|
33
33
|
baseClass: 'rounded border border-gray-300 p-4 relative bg-opacity-60 bg-gray-100 backdrop-blur-sm',
|
|
34
34
|
})
|
|
35
|
-
|
|
35
|
+
const RepeaterHandleUI = uic('button', {
|
|
36
36
|
baseClass: 'absolute top-1/2 -left-7 h-6 w-6 flex justify-end align-center opacity-10 group-hover:opacity-30 hover:!opacity-100 transition-opacity -translate-y-1/2',
|
|
37
|
-
beforeChildren: <GripVerticalIcon size={16}/>,
|
|
37
|
+
beforeChildren: <GripVerticalIcon size={16} />,
|
|
38
|
+
})
|
|
39
|
+
const RepeaterEmptyUI = uic('div', {
|
|
40
|
+
baseClass: 'italic text-sm text-gray-600',
|
|
38
41
|
})
|
|
39
42
|
|
|
40
43
|
export const RepeaterDropIndicator = ({ position }: { position: 'before' | 'after' }) => (
|
|
@@ -58,6 +61,9 @@ export const RepeaterAddItemButton = ({ children, index }: { children?: React.Re
|
|
|
58
61
|
</RepeaterAddItemTrigger>
|
|
59
62
|
)
|
|
60
63
|
|
|
64
|
+
/**
|
|
65
|
+
* A button that removes the item from the repeater.
|
|
66
|
+
*/
|
|
61
67
|
export const RepeaterRemoveItemButton = ({ children }: { children?: React.ReactNode }) => (
|
|
62
68
|
<RepeaterRemoveItemTrigger>
|
|
63
69
|
<Button variant={'link'} size={'sm'} className={'gap-1 px-0 group/button'}>
|
|
@@ -68,6 +74,9 @@ export const RepeaterRemoveItemButton = ({ children }: { children?: React.ReactN
|
|
|
68
74
|
</RepeaterRemoveItemTrigger>
|
|
69
75
|
)
|
|
70
76
|
|
|
77
|
+
/**
|
|
78
|
+
* A container for actions that can be performed on a repeater item. Placed in the top right corner of the item.
|
|
79
|
+
*/
|
|
71
80
|
export const RepeaterItemActions = uic('div', {
|
|
72
81
|
baseClass: 'absolute top-1 right-2 flex gap-2',
|
|
73
82
|
})
|
|
@@ -75,10 +84,29 @@ export const RepeaterItemActions = uic('div', {
|
|
|
75
84
|
export type DefaultRepeaterProps =
|
|
76
85
|
& {
|
|
77
86
|
title?: ReactNode
|
|
87
|
+
/**
|
|
88
|
+
* Position of the add button.
|
|
89
|
+
*/
|
|
78
90
|
addButtonPosition?: 'none' | 'after' | 'before' | 'around'
|
|
79
91
|
}
|
|
80
92
|
& RepeaterProps
|
|
81
93
|
|
|
94
|
+
/**
|
|
95
|
+
* DefaultRepeater is a wrapper around Repeater that provides a default UI for a list of items.
|
|
96
|
+
*
|
|
97
|
+
* ## Props {@link DefaultRepeaterProps}
|
|
98
|
+
* - field or entities, sortableBy or orderBy, addButtonPosition, title
|
|
99
|
+
*
|
|
100
|
+
* ## Example
|
|
101
|
+
* ```tsx
|
|
102
|
+
* <DefaultRepeater entities="RepeaterItem" sortableBy="order" title="Foo items" addButtonPosition="around">
|
|
103
|
+
* <InputField field="title" />
|
|
104
|
+
* <RepeaterItemActions>
|
|
105
|
+
* <RepeaterRemoveItemButton />
|
|
106
|
+
* </RepeaterItemActions>
|
|
107
|
+
* </DefaultRepeater>
|
|
108
|
+
* ```
|
|
109
|
+
*/
|
|
82
110
|
export const DefaultRepeater = Component<DefaultRepeaterProps>(props => {
|
|
83
111
|
if ('field' in props) {
|
|
84
112
|
return (
|
|
@@ -90,71 +118,65 @@ export const DefaultRepeater = Component<DefaultRepeaterProps>(props => {
|
|
|
90
118
|
return <DefaultRepeaterInner {...props}/>
|
|
91
119
|
})
|
|
92
120
|
|
|
93
|
-
|
|
121
|
+
const DefaultRepeaterInner = Component<DefaultRepeaterProps>(({ title, children, addButtonPosition = 'after', ...props }) => {
|
|
94
122
|
const isSortable = props.sortableBy !== undefined
|
|
95
123
|
|
|
96
124
|
if (!isSortable) {
|
|
97
125
|
return (
|
|
98
|
-
<div>
|
|
99
|
-
<Repeater {...props}>
|
|
100
|
-
{title && <h3 className={'font-medium'}>{title}</h3>}
|
|
101
|
-
|
|
102
|
-
{(addButtonPosition === 'before' || addButtonPosition === 'around') && <RepeaterAddItemButton index="first" />}
|
|
103
|
-
<RepeaterWrapperUI>
|
|
104
|
-
<RepeaterEmpty>
|
|
105
|
-
<div className="italic text-sm text-gray-600">
|
|
106
|
-
{dict.repeater.empty}
|
|
107
|
-
</div>
|
|
108
|
-
</RepeaterEmpty>
|
|
109
|
-
<RepeaterEachItem>
|
|
110
|
-
<RepeaterItemUI>
|
|
111
|
-
{children}
|
|
112
|
-
</RepeaterItemUI>
|
|
113
|
-
</RepeaterEachItem>
|
|
114
|
-
</RepeaterWrapperUI>
|
|
115
|
-
|
|
116
|
-
{(addButtonPosition === 'after' || addButtonPosition === 'around') && <RepeaterAddItemButton />}
|
|
117
|
-
</Repeater>
|
|
118
|
-
</div>
|
|
119
|
-
)
|
|
120
|
-
}
|
|
121
|
-
return (
|
|
122
|
-
<div>
|
|
123
126
|
<Repeater {...props}>
|
|
124
127
|
<RepeaterWrapperUI>
|
|
125
128
|
{title && <h3 className={'font-medium'}>{title}</h3>}
|
|
126
129
|
{(addButtonPosition === 'before' || addButtonPosition === 'around') && <RepeaterAddItemButton index="first" />}
|
|
127
|
-
<
|
|
128
|
-
<
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
<
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
<RepeaterItemUI>
|
|
138
|
-
<RepeaterSortableItemActivator>
|
|
139
|
-
<RepeaterHandleUI/>
|
|
140
|
-
</RepeaterSortableItemActivator>
|
|
141
|
-
{children}
|
|
142
|
-
</RepeaterItemUI>
|
|
143
|
-
</RepeaterSortableItemNode>
|
|
144
|
-
<RepeaterDropIndicator position={'after'}/>
|
|
145
|
-
</div>
|
|
146
|
-
</RepeaterSortableEachItem>
|
|
147
|
-
<RepeaterSortableDragOverlay>
|
|
148
|
-
<RepeaterDragOverlayUI>
|
|
149
|
-
{children}
|
|
150
|
-
</RepeaterDragOverlayUI>
|
|
151
|
-
</RepeaterSortableDragOverlay>
|
|
152
|
-
</RepeaterSortable>
|
|
153
|
-
|
|
130
|
+
<RepeaterEmpty>
|
|
131
|
+
<RepeaterEmptyUI>
|
|
132
|
+
{dict.repeater.empty}
|
|
133
|
+
</RepeaterEmptyUI>
|
|
134
|
+
</RepeaterEmpty>
|
|
135
|
+
<RepeaterEachItem>
|
|
136
|
+
<RepeaterItemUI>
|
|
137
|
+
{children}
|
|
138
|
+
</RepeaterItemUI>
|
|
139
|
+
</RepeaterEachItem>
|
|
154
140
|
{(addButtonPosition === 'after' || addButtonPosition === 'around') && <RepeaterAddItemButton />}
|
|
155
141
|
</RepeaterWrapperUI>
|
|
156
142
|
</Repeater>
|
|
157
|
-
|
|
143
|
+
)
|
|
144
|
+
}
|
|
145
|
+
return (
|
|
146
|
+
<Repeater {...props}>
|
|
147
|
+
<RepeaterWrapperUI>
|
|
148
|
+
{title && <h3 className={'font-medium'}>{title}</h3>}
|
|
149
|
+
{(addButtonPosition === 'before' || addButtonPosition === 'around') && <RepeaterAddItemButton index="first" />}
|
|
150
|
+
<RepeaterSortable>
|
|
151
|
+
<RepeaterEmpty>
|
|
152
|
+
<RepeaterEmptyUI>
|
|
153
|
+
{dict.repeater.empty}
|
|
154
|
+
</RepeaterEmptyUI>
|
|
155
|
+
</RepeaterEmpty>
|
|
156
|
+
<RepeaterSortableEachItem>
|
|
157
|
+
<div>
|
|
158
|
+
<RepeaterDropIndicator position={'before'}/>
|
|
159
|
+
<RepeaterSortableItemNode>
|
|
160
|
+
<RepeaterItemUI>
|
|
161
|
+
<RepeaterSortableItemActivator>
|
|
162
|
+
<RepeaterHandleUI/>
|
|
163
|
+
</RepeaterSortableItemActivator>
|
|
164
|
+
{children}
|
|
165
|
+
</RepeaterItemUI>
|
|
166
|
+
</RepeaterSortableItemNode>
|
|
167
|
+
<RepeaterDropIndicator position={'after'}/>
|
|
168
|
+
</div>
|
|
169
|
+
</RepeaterSortableEachItem>
|
|
170
|
+
<RepeaterSortableDragOverlay>
|
|
171
|
+
<RepeaterDragOverlayUI>
|
|
172
|
+
{children}
|
|
173
|
+
</RepeaterDragOverlayUI>
|
|
174
|
+
</RepeaterSortableDragOverlay>
|
|
175
|
+
</RepeaterSortable>
|
|
176
|
+
|
|
177
|
+
{(addButtonPosition === 'after' || addButtonPosition === 'around') && <RepeaterAddItemButton />}
|
|
178
|
+
</RepeaterWrapperUI>
|
|
179
|
+
</Repeater>
|
|
158
180
|
)
|
|
159
181
|
}, props => {
|
|
160
182
|
return <Repeater {...props}/>
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import * as React from 'react'
|
|
2
2
|
import { ReactNode } from 'react'
|
|
3
3
|
import { ScrollArea } from '../ui/scroll-area'
|
|
4
|
-
import { DataGridOverlayLoader } from '../datagrid'
|
|
5
4
|
import { Loader } from '../ui/loader'
|
|
6
5
|
import {
|
|
7
6
|
DataViewHighlightRow,
|
|
@@ -65,7 +64,7 @@ export const SelectListInner = Component(({ children, filterToolbar }: SelectLis
|
|
|
65
64
|
<ScrollArea className={'max-h-96'}>
|
|
66
65
|
<div className={'flex flex-col gap-1'}>
|
|
67
66
|
<DataViewLoaderState refreshing>
|
|
68
|
-
<
|
|
67
|
+
<Loader position={'absolute'} />
|
|
69
68
|
</DataViewLoaderState>
|
|
70
69
|
<DataViewLoaderState refreshing loaded>
|
|
71
70
|
<DataViewInfiniteLoadEachRow>
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as React from 'react'
|
|
2
|
-
import { ComponentType, ReactNode } from 'react'
|
|
2
|
+
import { ComponentType, ReactElement, ReactNode } from 'react'
|
|
3
3
|
import { Component, Field, FieldView, StaticRender, SugaredRelativeSingleEntity, SugaredRelativeSingleField } from '@contember/interface'
|
|
4
4
|
import {
|
|
5
5
|
AudioFileDataExtractorProps,
|
|
@@ -20,7 +20,7 @@ export type BaseFileViewProps = {
|
|
|
20
20
|
actions?: ReactNode
|
|
21
21
|
edit?: ReactNode
|
|
22
22
|
noDestroy?: boolean
|
|
23
|
-
DestroyAction?: ComponentType<{ children:
|
|
23
|
+
DestroyAction?: ComponentType<{ children: ReactElement }>
|
|
24
24
|
}
|
|
25
25
|
|
|
26
26
|
|
package/src/paths.ts
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { dirname } from 'node:path'
|
|
1
|
+
import { findPackageRoot } from '@contember/cli-common'
|
|
2
|
+
import { dirname, join } from 'node:path'
|
|
3
3
|
import { fileURLToPath } from 'node:url'
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
const currentFilePath = dirname(fileURLToPath(import.meta.url))
|
|
6
|
+
export const packageRoot = process.env.CONTEMBER_CLI_PACKAGE_ROOT || findPackageRoot(currentFilePath)
|
|
6
7
|
export const resourcesDir = join(packageRoot, './resources')
|