@brilo/base-blocks 0.1.29 → 0.1.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/build/.tsbuildinfo +1 -1
- package/build/blocks/document/documents-grid/DocumentsSelectModal.d.ts.map +1 -0
- package/build/blocks/document/documents-grid/constants.d.ts +9 -0
- package/build/blocks/document/documents-grid/constants.d.ts.map +1 -0
- package/build/blocks/document/documents-grid/constants.js +8 -0
- package/build/blocks/document/documents-grid/edit.d.ts +6 -0
- package/build/blocks/document/documents-grid/edit.d.ts.map +1 -0
- package/build/blocks/document/{documents-group → documents-grid}/edit.js +10 -8
- package/build/blocks/document/documents-grid/factory.d.ts +5 -0
- package/build/blocks/document/documents-grid/factory.d.ts.map +1 -0
- package/build/blocks/document/{documents-group → documents-grid}/factory.js +12 -12
- package/build/blocks/document/documents-grid/icon.d.ts.map +1 -0
- package/build/blocks/document/documents-grid/index.d.ts +6 -0
- package/build/blocks/document/documents-grid/index.d.ts.map +1 -0
- package/build/blocks/document/documents-grid/index.js +5 -0
- package/build/blocks/document/documents-grid/types.d.ts +23 -0
- package/build/blocks/document/documents-grid/types.d.ts.map +1 -0
- package/build/index.d.ts +2 -2
- package/build/index.d.ts.map +1 -1
- package/build/index.js +1 -1
- package/package.json +1 -1
- package/src/blocks/document/documents-grid/constants.ts +9 -0
- package/src/blocks/document/{documents-group → documents-grid}/edit.tsx +17 -15
- package/src/blocks/document/documents-grid/factory.tsx +63 -0
- package/src/blocks/document/documents-grid/index.ts +15 -0
- package/src/blocks/document/documents-grid/types.ts +31 -0
- package/src/index.ts +7 -7
- package/build/blocks/document/documents-group/DocumentsSelectModal.d.ts.map +0 -1
- package/build/blocks/document/documents-group/constants.d.ts +0 -7
- package/build/blocks/document/documents-group/constants.d.ts.map +0 -1
- package/build/blocks/document/documents-group/constants.js +0 -5
- package/build/blocks/document/documents-group/edit.d.ts +0 -6
- package/build/blocks/document/documents-group/edit.d.ts.map +0 -1
- package/build/blocks/document/documents-group/factory.d.ts +0 -5
- package/build/blocks/document/documents-group/factory.d.ts.map +0 -1
- package/build/blocks/document/documents-group/icon.d.ts.map +0 -1
- package/build/blocks/document/documents-group/index.d.ts +0 -6
- package/build/blocks/document/documents-group/index.d.ts.map +0 -1
- package/build/blocks/document/documents-group/index.js +0 -5
- package/build/blocks/document/documents-group/types.d.ts +0 -22
- package/build/blocks/document/documents-group/types.d.ts.map +0 -1
- package/src/blocks/document/documents-group/constants.ts +0 -7
- package/src/blocks/document/documents-group/factory.tsx +0 -59
- package/src/blocks/document/documents-group/index.ts +0 -15
- package/src/blocks/document/documents-group/types.ts +0 -25
- /package/build/blocks/document/{documents-group → documents-grid}/DocumentsSelectModal.d.ts +0 -0
- /package/build/blocks/document/{documents-group → documents-grid}/DocumentsSelectModal.js +0 -0
- /package/build/blocks/document/{documents-group → documents-grid}/icon.d.ts +0 -0
- /package/build/blocks/document/{documents-group → documents-grid}/icon.js +0 -0
- /package/build/blocks/document/{documents-group → documents-grid}/types.js +0 -0
- /package/src/blocks/document/{documents-group → documents-grid}/DocumentsSelectModal.tsx +0 -0
- /package/src/blocks/document/{documents-group → documents-grid}/icon.tsx +0 -0
|
@@ -1,59 +0,0 @@
|
|
|
1
|
-
import type {BlockConfiguration} from '@wordpress/blocks'
|
|
2
|
-
import {__} from '@wordpress/i18n'
|
|
3
|
-
import {
|
|
4
|
-
DOCUMENTS_GROUP_COLUMNS_DEFAULT,
|
|
5
|
-
DOCUMENTS_GROUP_LISTING_STYLE_DEFAULT,
|
|
6
|
-
DOCUMENTS_GROUP_MODE_DEFAULT,
|
|
7
|
-
DOCUMENTS_GROUP_SORT_BY_DEFAULT,
|
|
8
|
-
} from './constants'
|
|
9
|
-
import {createDocumentsGroupEdit} from './edit'
|
|
10
|
-
import {icon as defaultIcon} from './icon'
|
|
11
|
-
import type {DocumentsGroupAttributes, DocumentsGroupOptions} from './types'
|
|
12
|
-
|
|
13
|
-
export type {DocumentsGroupAttributes, DocumentsGroupOptions}
|
|
14
|
-
|
|
15
|
-
export function createDocumentsGroupBlock(options: DocumentsGroupOptions): BlockConfiguration<DocumentsGroupAttributes> {
|
|
16
|
-
return {
|
|
17
|
-
name: options.name,
|
|
18
|
-
title: options.title ?? __('Dokumenty', 'brilo-blocks'),
|
|
19
|
-
description: options.description,
|
|
20
|
-
category: options.category ?? 'widgets',
|
|
21
|
-
...(options.parent && {parent: options.parent}),
|
|
22
|
-
icon: options.icon ?? {src: defaultIcon},
|
|
23
|
-
supports: {html: false, customClassName: false},
|
|
24
|
-
attributes: {
|
|
25
|
-
mode: {
|
|
26
|
-
type: 'string',
|
|
27
|
-
default: DOCUMENTS_GROUP_MODE_DEFAULT,
|
|
28
|
-
enum: ['manual', 'category'],
|
|
29
|
-
},
|
|
30
|
-
listingStyle: {
|
|
31
|
-
type: 'string',
|
|
32
|
-
default: DOCUMENTS_GROUP_LISTING_STYLE_DEFAULT,
|
|
33
|
-
enum: ['classic', 'group-by-category'],
|
|
34
|
-
},
|
|
35
|
-
sortBy: {
|
|
36
|
-
type: 'string',
|
|
37
|
-
default: DOCUMENTS_GROUP_SORT_BY_DEFAULT,
|
|
38
|
-
enum: ['menu_order', 'date', 'manual-order'],
|
|
39
|
-
},
|
|
40
|
-
columns: {
|
|
41
|
-
type: 'number',
|
|
42
|
-
default: DOCUMENTS_GROUP_COLUMNS_DEFAULT,
|
|
43
|
-
enum: [1, 2, 3, 4, 6],
|
|
44
|
-
},
|
|
45
|
-
selectedDocuments: {
|
|
46
|
-
type: 'array',
|
|
47
|
-
default: [],
|
|
48
|
-
items: {type: 'number'},
|
|
49
|
-
},
|
|
50
|
-
selectedCategories: {
|
|
51
|
-
type: 'array',
|
|
52
|
-
default: [],
|
|
53
|
-
items: {type: 'number'},
|
|
54
|
-
},
|
|
55
|
-
},
|
|
56
|
-
edit: createDocumentsGroupEdit(options),
|
|
57
|
-
save: () => null,
|
|
58
|
-
} as unknown as BlockConfiguration<DocumentsGroupAttributes>
|
|
59
|
-
}
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
export type {
|
|
2
|
-
DocumentsGroupAttributes,
|
|
3
|
-
DocumentsGroupOptions,
|
|
4
|
-
DocumentsGroupListingStyle,
|
|
5
|
-
DocumentsGroupMode,
|
|
6
|
-
DocumentsGroupSortBy,
|
|
7
|
-
} from './types'
|
|
8
|
-
export {createDocumentsGroupBlock} from './factory'
|
|
9
|
-
export {DocumentsSelectModal} from './DocumentsSelectModal'
|
|
10
|
-
|
|
11
|
-
import type {DocumentsGroupOptions} from './types'
|
|
12
|
-
|
|
13
|
-
export const documentsGroupDefaults: DocumentsGroupOptions = {
|
|
14
|
-
name: 'brilo/documents-group',
|
|
15
|
-
}
|
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
import type {BriloBlockType} from '~/types'
|
|
2
|
-
|
|
3
|
-
export type DocumentsGroupMode = 'manual' | 'category'
|
|
4
|
-
export type DocumentsGroupListingStyle = 'classic' | 'group-by-category'
|
|
5
|
-
export type DocumentsGroupSortBy = 'menu_order' | 'date' | 'manual-order'
|
|
6
|
-
export type DocumentsGroupColumns = 1 | 2 | 3 | 4 | 6
|
|
7
|
-
|
|
8
|
-
export interface DocumentsGroupAttributes extends Record<string, unknown> {
|
|
9
|
-
mode: DocumentsGroupMode
|
|
10
|
-
listingStyle: DocumentsGroupListingStyle
|
|
11
|
-
sortBy: DocumentsGroupSortBy
|
|
12
|
-
columns: DocumentsGroupColumns
|
|
13
|
-
selectedDocuments: number[]
|
|
14
|
-
selectedCategories: number[]
|
|
15
|
-
}
|
|
16
|
-
|
|
17
|
-
export interface SelectControlProps {
|
|
18
|
-
selectedItems: number[]
|
|
19
|
-
onChange: (ids: number[]) => void
|
|
20
|
-
}
|
|
21
|
-
|
|
22
|
-
export interface DocumentsGroupOptions extends BriloBlockType {
|
|
23
|
-
renderCategoryControl?: (props: SelectControlProps) => JSX.Element
|
|
24
|
-
renderDocumentsControl?: (props: SelectControlProps) => JSX.Element
|
|
25
|
-
}
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|