@datagouv/components-next 1.4.1-dev.1359.g6dbe29f1 → 1.4.1-dev.1361.g08f7a0a4
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/package.json +1 -1
- package/src/main.ts +3 -1
- package/src/types/pages.ts +15 -4
package/package.json
CHANGED
package/src/main.ts
CHANGED
|
@@ -13,7 +13,7 @@ import type { License } from './types/licenses'
|
|
|
13
13
|
import type { Member, MemberRole, NewOrganization, Organization, OrganizationOrSuggest, OrganizationReference, OrganizationSuggest } from './types/organizations'
|
|
14
14
|
import type { Owned, OwnedWithFullObject, OwnedWithId } from './types/owned'
|
|
15
15
|
import type { Comment, Thread } from './types/discussions'
|
|
16
|
-
import type { PageBloc, SectionBloc, SectionContentBloc, BlocWidth, LeafBloc, ObjectBloc, TitleBloc, DatasetBloc, DataserviceBloc, ReuseBloc, ExploreBloc, LinkInBloc, LinksListBloc, MarkdownBloc, AccordionContentBloc, AccordionItemBloc, AccordionListBloc, ButtonBloc, ImageBloc, CardBloc, SectionColor } from './types/pages'
|
|
16
|
+
import type { PageBloc, SectionBloc, SectionContentBloc, BlocWidth, LeafBloc, ObjectBloc, TitleBloc, DatasetBloc, DataserviceBloc, ReuseBloc, ExploreBloc, LinkInBloc, LinksListBloc, MarkdownBloc, AccordionContentBloc, AccordionItemBloc, AccordionListBloc, ButtonBloc, ImageBloc, CardBloc, ColumnBloc, ColumnContentBloc, SectionColor } from './types/pages'
|
|
17
17
|
import type { Post, PostAncestor } from './types/posts'
|
|
18
18
|
import type { ReuseReference, NewReuse, Reuse, ReuseV2, ReuseTopic, ReuseType } from './types/reuses'
|
|
19
19
|
import type { RegisteredSchema, Schema, SchemaDetails, SchemaField, SchemaPath, SchemaPublicationMode, SchemaResponseData, SchemaVersion, ValidataError } from './types/schemas'
|
|
@@ -235,6 +235,8 @@ export type {
|
|
|
235
235
|
ButtonBloc,
|
|
236
236
|
ImageBloc,
|
|
237
237
|
CardBloc,
|
|
238
|
+
ColumnBloc,
|
|
239
|
+
ColumnContentBloc,
|
|
238
240
|
SectionColor,
|
|
239
241
|
PaginatedArray,
|
|
240
242
|
Post,
|
package/src/types/pages.ts
CHANGED
|
@@ -4,8 +4,8 @@ import type { Reuse } from './reuses'
|
|
|
4
4
|
|
|
5
5
|
export type BlocWidth = '1/4' | '1/3' | '1/2' | '2/3' | '3/4'
|
|
6
6
|
|
|
7
|
-
// Blocs inside a section
|
|
8
|
-
// the row is full. `null`: the whole row.
|
|
7
|
+
// Blocs inside a section, an accordion item or a column sit side by side, wrapping to a new
|
|
8
|
+
// row when the row is full. `null`: the whole row.
|
|
9
9
|
type Sized = { width: BlocWidth | null }
|
|
10
10
|
|
|
11
11
|
export type TitleBloc = Sized & {
|
|
@@ -86,7 +86,18 @@ export type ObjectBloc = DatasetBloc | DataserviceBloc | ReuseBloc
|
|
|
86
86
|
|
|
87
87
|
export type LeafBloc = TitleBloc | MarkdownBloc | LinksListBloc | ButtonBloc | ImageBloc | CardBloc | ExploreBloc | ObjectBloc
|
|
88
88
|
|
|
89
|
-
|
|
89
|
+
// The explorer is too wide for a column, a share of a row, or for an accordion.
|
|
90
|
+
export type ColumnContentBloc = Exclude<LeafBloc, ExploreBloc>
|
|
91
|
+
|
|
92
|
+
// Blocs stacked in a share of a row, beside the others: a title and its text beside an
|
|
93
|
+
// illustration.
|
|
94
|
+
export type ColumnBloc = Sized & {
|
|
95
|
+
class: 'ColumnBloc'
|
|
96
|
+
id: string
|
|
97
|
+
blocs: Array<ColumnContentBloc>
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
export type AccordionContentBloc = ColumnContentBloc | ColumnBloc
|
|
90
101
|
|
|
91
102
|
export type AccordionItemBloc = {
|
|
92
103
|
id: string
|
|
@@ -100,7 +111,7 @@ export type AccordionListBloc = Sized & {
|
|
|
100
111
|
items: Array<AccordionItemBloc>
|
|
101
112
|
}
|
|
102
113
|
|
|
103
|
-
export type SectionContentBloc = AccordionListBloc | LeafBloc
|
|
114
|
+
export type SectionContentBloc = AccordionListBloc | ColumnBloc | LeafBloc
|
|
104
115
|
|
|
105
116
|
export type SectionColor = 'primary' | 'green' | 'purple'
|
|
106
117
|
|