@brilo/base-blocks 0.1.28 → 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/career/career-header/edit.d.ts +6 -0
- package/build/blocks/career/career-header/edit.d.ts.map +1 -0
- package/build/blocks/career/career-header/edit.js +11 -0
- package/build/blocks/career/career-header/factory.d.ts +5 -0
- package/build/blocks/career/career-header/factory.d.ts.map +1 -0
- package/build/blocks/career/career-header/factory.js +24 -0
- package/build/blocks/career/career-header/icon.d.ts.map +1 -0
- package/build/blocks/career/career-header/icon.js +2 -0
- package/build/blocks/career/career-header/index.d.ts +5 -0
- package/build/blocks/career/career-header/index.d.ts.map +1 -0
- package/build/blocks/career/career-header/index.js +4 -0
- package/build/blocks/career/career-header/types.d.ts +10 -0
- package/build/blocks/career/career-header/types.d.ts.map +1 -0
- package/build/blocks/career/job-position-group/JobPositionsSelectModal.d.ts +9 -0
- package/build/blocks/career/job-position-group/JobPositionsSelectModal.d.ts.map +1 -0
- package/build/blocks/career/job-position-group/JobPositionsSelectModal.js +123 -0
- package/build/blocks/career/job-position-group/constants.d.ts +10 -0
- package/build/blocks/career/job-position-group/constants.d.ts.map +1 -0
- package/build/blocks/career/job-position-group/constants.js +9 -0
- package/build/blocks/career/job-position-group/edit.d.ts +6 -0
- package/build/blocks/career/job-position-group/edit.d.ts.map +1 -0
- package/build/blocks/career/job-position-group/edit.js +17 -0
- package/build/blocks/career/job-position-group/factory.d.ts +5 -0
- package/build/blocks/career/job-position-group/factory.d.ts.map +1 -0
- package/build/blocks/career/job-position-group/factory.js +44 -0
- package/build/blocks/career/job-position-group/icon.d.ts +2 -0
- package/build/blocks/career/job-position-group/icon.d.ts.map +1 -0
- package/build/blocks/career/job-position-group/icon.js +2 -0
- package/build/blocks/career/job-position-group/index.d.ts +6 -0
- package/build/blocks/career/job-position-group/index.d.ts.map +1 -0
- package/build/blocks/career/job-position-group/index.js +5 -0
- package/build/blocks/career/job-position-group/types.d.ts +20 -0
- package/build/blocks/career/job-position-group/types.d.ts.map +1 -0
- package/build/blocks/career/job-position-group/types.js +1 -0
- 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 +2 -0
- 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/blocks/document/documents-grid/types.js +1 -0
- package/build/blocks/post/post-content/edit.d.ts +6 -0
- package/build/blocks/post/post-content/edit.d.ts.map +1 -0
- package/build/blocks/post/post-content/edit.js +9 -0
- package/build/blocks/post/post-content/factory.d.ts +5 -0
- package/build/blocks/post/post-content/factory.d.ts.map +1 -0
- package/build/blocks/post/post-content/factory.js +18 -0
- package/build/blocks/post/post-content/icon.d.ts +2 -0
- package/build/blocks/post/post-content/icon.d.ts.map +1 -0
- package/build/blocks/post/post-content/icon.js +2 -0
- package/build/blocks/post/post-content/index.d.ts +5 -0
- package/build/blocks/post/post-content/index.d.ts.map +1 -0
- package/build/blocks/post/post-content/index.js +4 -0
- package/build/blocks/post/post-content/types.d.ts +5 -0
- package/build/blocks/post/post-content/types.d.ts.map +1 -0
- package/build/blocks/post/post-content/types.js +1 -0
- package/build/blocks/share/share/constants.d.ts +2 -0
- package/build/blocks/share/share/constants.d.ts.map +1 -0
- package/build/blocks/share/share/constants.js +1 -0
- package/build/blocks/share/share/edit.d.ts +6 -0
- package/build/blocks/share/share/edit.d.ts.map +1 -0
- package/build/blocks/share/share/edit.js +18 -0
- package/build/blocks/share/share/factory.d.ts +5 -0
- package/build/blocks/share/share/factory.d.ts.map +1 -0
- package/build/blocks/share/share/factory.js +26 -0
- package/build/blocks/share/share/icon.d.ts +2 -0
- package/build/blocks/share/share/icon.d.ts.map +1 -0
- package/build/blocks/share/share/icon.js +2 -0
- package/build/blocks/share/share/index.d.ts +5 -0
- package/build/blocks/share/share/index.d.ts.map +1 -0
- package/build/blocks/share/share/index.js +4 -0
- package/build/blocks/share/share/types.d.ts +11 -0
- package/build/blocks/share/share/types.d.ts.map +1 -0
- package/build/blocks/share/share/types.js +1 -0
- package/build/index.d.ts +10 -2
- package/build/index.d.ts.map +1 -1
- package/build/index.js +5 -1
- package/package.json +1 -1
- package/src/blocks/career/career-header/edit.tsx +61 -0
- package/src/blocks/career/career-header/factory.tsx +28 -0
- package/src/blocks/career/career-header/icon.tsx +8 -0
- package/src/blocks/career/career-header/index.ts +8 -0
- package/src/blocks/career/career-header/types.ts +11 -0
- package/src/blocks/career/job-position-group/JobPositionsSelectModal.tsx +238 -0
- package/src/blocks/career/job-position-group/constants.ts +11 -0
- package/src/blocks/career/job-position-group/edit.tsx +93 -0
- package/src/blocks/career/job-position-group/factory.tsx +56 -0
- package/src/blocks/career/job-position-group/icon.tsx +7 -0
- package/src/blocks/career/job-position-group/index.ts +15 -0
- package/src/blocks/career/job-position-group/types.ts +23 -0
- 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/blocks/post/post-content/edit.tsx +18 -0
- package/src/blocks/post/post-content/factory.tsx +22 -0
- package/src/blocks/post/post-content/icon.tsx +9 -0
- package/src/blocks/post/post-content/index.ts +8 -0
- package/src/blocks/post/post-content/types.ts +6 -0
- package/src/blocks/share/share/constants.ts +1 -0
- package/src/blocks/share/share/edit.tsx +57 -0
- package/src/blocks/share/share/factory.tsx +30 -0
- package/src/blocks/share/share/icon.tsx +9 -0
- package/src/blocks/share/share/index.ts +8 -0
- package/src/blocks/share/share/types.ts +12 -0
- package/src/index.ts +21 -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 → career/career-header}/icon.d.ts +0 -0
- /package/build/blocks/{document/documents-group → career/career-header}/types.js +0 -0
- /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.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
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import type {BlockConfiguration} from '@wordpress/blocks'
|
|
2
|
+
import {__} from '@wordpress/i18n'
|
|
3
|
+
import {createPostContentEdit} from './edit'
|
|
4
|
+
import {icon as defaultIcon} from './icon'
|
|
5
|
+
import type {PostContentAttributes, PostContentOptions} from './types'
|
|
6
|
+
|
|
7
|
+
export type {PostContentAttributes, PostContentOptions}
|
|
8
|
+
|
|
9
|
+
export function createPostContentBlock(options: PostContentOptions): BlockConfiguration<PostContentAttributes> {
|
|
10
|
+
return {
|
|
11
|
+
name: options.name,
|
|
12
|
+
title: options.title ?? __('Content postu', 'brilo-blocks'),
|
|
13
|
+
description: options.description,
|
|
14
|
+
category: options.category ?? 'widgets',
|
|
15
|
+
...(options.parent && {parent: options.parent}),
|
|
16
|
+
icon: options.icon ?? {src: defaultIcon},
|
|
17
|
+
supports: {html: false, customClassName: false},
|
|
18
|
+
attributes: {},
|
|
19
|
+
edit: createPostContentEdit(options),
|
|
20
|
+
save: () => null,
|
|
21
|
+
} as unknown as BlockConfiguration<PostContentAttributes>
|
|
22
|
+
}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
export const icon = (
|
|
2
|
+
<svg width="20" height="20" viewBox="0 0 20 20" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
3
|
+
<rect x="3" y="2" width="14" height="16" rx="1" stroke="black" fill="none" />
|
|
4
|
+
<line x1="6" y1="6" x2="14" y2="6" stroke="black" />
|
|
5
|
+
<line x1="6" y1="9" x2="14" y2="9" stroke="black" />
|
|
6
|
+
<line x1="6" y1="12" x2="14" y2="12" stroke="black" />
|
|
7
|
+
<line x1="6" y1="15" x2="10" y2="15" stroke="black" />
|
|
8
|
+
</svg>
|
|
9
|
+
)
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
export type {PostContentAttributes, PostContentOptions} from './types'
|
|
2
|
+
export {createPostContentBlock} from './factory'
|
|
3
|
+
|
|
4
|
+
import type {PostContentOptions} from './types'
|
|
5
|
+
|
|
6
|
+
export const postContentDefaults: PostContentOptions = {
|
|
7
|
+
name: 'brilo/post-content',
|
|
8
|
+
}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import type {BriloBlockType} from '~/types'
|
|
2
|
+
|
|
3
|
+
// biome-ignore lint/complexity/noBannedTypes: no block-specific attributes, matches BriloBlockType's generic constraint shape
|
|
4
|
+
export interface PostContentAttributes extends Record<string, unknown> {}
|
|
5
|
+
|
|
6
|
+
export type PostContentOptions = BriloBlockType
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export const SHARE_TITLE_DEFAULT = 'Sdílejte tento obsah'
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
import {InspectorControls, useBlockProps} from '@wordpress/block-editor'
|
|
2
|
+
import {PanelBody, TextControl, ToggleControl} from '@wordpress/components'
|
|
3
|
+
import {__} from '@wordpress/i18n'
|
|
4
|
+
import type {ShareAttributes, ShareOptions} from './types'
|
|
5
|
+
|
|
6
|
+
export function createShareEdit(_options: ShareOptions) {
|
|
7
|
+
return function Edit({attributes, setAttributes}: {attributes: ShareAttributes; setAttributes: (a: Partial<ShareAttributes>) => void}) {
|
|
8
|
+
const {title, showFacebook, showLinkedin, showX, showEmail, showCopyLink} = attributes
|
|
9
|
+
|
|
10
|
+
const blockProps = useBlockProps({className: 'wp-block-section'})
|
|
11
|
+
|
|
12
|
+
const enabledNetworks = [
|
|
13
|
+
showFacebook && 'Facebook',
|
|
14
|
+
showLinkedin && 'LinkedIn',
|
|
15
|
+
showX && 'X',
|
|
16
|
+
showEmail && __('E-mail', 'brilo-blocks'),
|
|
17
|
+
showCopyLink && __('Kopírovat odkaz', 'brilo-blocks'),
|
|
18
|
+
].filter(Boolean)
|
|
19
|
+
|
|
20
|
+
return (
|
|
21
|
+
<>
|
|
22
|
+
<InspectorControls>
|
|
23
|
+
<PanelBody title={__('Nastavení sdílení', 'brilo-blocks')} initialOpen>
|
|
24
|
+
<TextControl
|
|
25
|
+
label={__('Titulek', 'brilo-blocks')}
|
|
26
|
+
value={title}
|
|
27
|
+
onChange={(value) => setAttributes({title: value})}
|
|
28
|
+
__next40pxDefaultSize
|
|
29
|
+
/>
|
|
30
|
+
<ToggleControl label="Facebook" checked={showFacebook} onChange={(value) => setAttributes({showFacebook: value})} />
|
|
31
|
+
<ToggleControl label="LinkedIn" checked={showLinkedin} onChange={(value) => setAttributes({showLinkedin: value})} />
|
|
32
|
+
<ToggleControl label="X" checked={showX} onChange={(value) => setAttributes({showX: value})} />
|
|
33
|
+
<ToggleControl
|
|
34
|
+
label={__('E-mail', 'brilo-blocks')}
|
|
35
|
+
checked={showEmail}
|
|
36
|
+
onChange={(value) => setAttributes({showEmail: value})}
|
|
37
|
+
/>
|
|
38
|
+
<ToggleControl
|
|
39
|
+
label={__('Kopírovat odkaz', 'brilo-blocks')}
|
|
40
|
+
checked={showCopyLink}
|
|
41
|
+
onChange={(value) => setAttributes({showCopyLink: value})}
|
|
42
|
+
/>
|
|
43
|
+
</PanelBody>
|
|
44
|
+
</InspectorControls>
|
|
45
|
+
|
|
46
|
+
<div {...blockProps}>
|
|
47
|
+
<div className="components-placeholder">
|
|
48
|
+
<div className="components-placeholder__label">{title || __('Blok na sdílení', 'brilo-blocks')}</div>
|
|
49
|
+
<div className="components-placeholder__instructions">
|
|
50
|
+
{enabledNetworks.length > 0 ? enabledNetworks.join(', ') : __('Žádné sítě nejsou povoleny.', 'brilo-blocks')}
|
|
51
|
+
</div>
|
|
52
|
+
</div>
|
|
53
|
+
</div>
|
|
54
|
+
</>
|
|
55
|
+
)
|
|
56
|
+
}
|
|
57
|
+
}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import type {BlockConfiguration} from '@wordpress/blocks'
|
|
2
|
+
import {__} from '@wordpress/i18n'
|
|
3
|
+
import {SHARE_TITLE_DEFAULT} from './constants'
|
|
4
|
+
import {createShareEdit} from './edit'
|
|
5
|
+
import {icon as defaultIcon} from './icon'
|
|
6
|
+
import type {ShareAttributes, ShareOptions} from './types'
|
|
7
|
+
|
|
8
|
+
export type {ShareAttributes, ShareOptions}
|
|
9
|
+
|
|
10
|
+
export function createShareBlock(options: ShareOptions): BlockConfiguration<ShareAttributes> {
|
|
11
|
+
return {
|
|
12
|
+
name: options.name,
|
|
13
|
+
title: options.title ?? __('Blok na sdílení', 'brilo-blocks'),
|
|
14
|
+
description: options.description,
|
|
15
|
+
category: options.category ?? 'widgets',
|
|
16
|
+
...(options.parent && {parent: options.parent}),
|
|
17
|
+
icon: options.icon ?? {src: defaultIcon},
|
|
18
|
+
supports: {html: false, customClassName: false},
|
|
19
|
+
attributes: {
|
|
20
|
+
title: {type: 'string', default: SHARE_TITLE_DEFAULT},
|
|
21
|
+
showFacebook: {type: 'boolean', default: true},
|
|
22
|
+
showLinkedin: {type: 'boolean', default: true},
|
|
23
|
+
showX: {type: 'boolean', default: true},
|
|
24
|
+
showEmail: {type: 'boolean', default: true},
|
|
25
|
+
showCopyLink: {type: 'boolean', default: true},
|
|
26
|
+
},
|
|
27
|
+
edit: createShareEdit(options),
|
|
28
|
+
save: () => null,
|
|
29
|
+
} as unknown as BlockConfiguration<ShareAttributes>
|
|
30
|
+
}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
export const icon = (
|
|
2
|
+
<svg width="20" height="20" viewBox="0 0 20 20" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
3
|
+
<circle cx="5" cy="10" r="2" stroke="black" fill="none" />
|
|
4
|
+
<circle cx="15" cy="4" r="2" stroke="black" fill="none" />
|
|
5
|
+
<circle cx="15" cy="16" r="2" stroke="black" fill="none" />
|
|
6
|
+
<line x1="6.7" y1="9" x2="13.3" y2="5" stroke="black" />
|
|
7
|
+
<line x1="6.7" y1="11" x2="13.3" y2="15" stroke="black" />
|
|
8
|
+
</svg>
|
|
9
|
+
)
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import type {BriloBlockType} from '~/types'
|
|
2
|
+
|
|
3
|
+
export interface ShareAttributes extends Record<string, unknown> {
|
|
4
|
+
title: string
|
|
5
|
+
showFacebook: boolean
|
|
6
|
+
showLinkedin: boolean
|
|
7
|
+
showX: boolean
|
|
8
|
+
showEmail: boolean
|
|
9
|
+
showCopyLink: boolean
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
export type ShareOptions = BriloBlockType
|
package/src/index.ts
CHANGED
|
@@ -150,13 +150,13 @@ export {createPostSliderGroupBlock, postSliderGroupDefaults} from './blocks/post
|
|
|
150
150
|
export type {PostsGridAttributes, PostsGridOptions} from './blocks/post/posts-grid'
|
|
151
151
|
export {createPostsGridBlock, postsGridDefaults} from './blocks/post/posts-grid'
|
|
152
152
|
export type {
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
} from './blocks/document/documents-
|
|
159
|
-
export {
|
|
153
|
+
DocumentsGridAttributes,
|
|
154
|
+
DocumentsGridOptions,
|
|
155
|
+
DocumentsGridListingStyle,
|
|
156
|
+
DocumentsGridMode,
|
|
157
|
+
DocumentsGridSortBy,
|
|
158
|
+
} from './blocks/document/documents-grid'
|
|
159
|
+
export {createDocumentsGridBlock, documentsGridDefaults, DocumentsSelectModal} from './blocks/document/documents-grid'
|
|
160
160
|
export type {LinkItemAttributes, LinkItemIcon, LinkItemOptions} from './blocks/link/link-item'
|
|
161
161
|
export {createLinkItemBlock, linkItemDefaults} from './blocks/link/link-item'
|
|
162
162
|
export type {ContentWithAsideAttributes, ContentWithAsideOptions} from './blocks/layout/layout-content-w-aside'
|
|
@@ -165,3 +165,17 @@ export type {ContentAttributes, ContentOptions} from './blocks/layout/layout-con
|
|
|
165
165
|
export {createContentBlock, contentDefaults} from './blocks/layout/layout-content'
|
|
166
166
|
export type {AsideAttributes, AsideOptions} from './blocks/layout/layout-aside'
|
|
167
167
|
export {createAsideBlock, asideDefaults} from './blocks/layout/layout-aside'
|
|
168
|
+
export type {
|
|
169
|
+
JobPositionGroupAttributes,
|
|
170
|
+
JobPositionGroupOptions,
|
|
171
|
+
JobPositionGroupMode,
|
|
172
|
+
JobPositionGroupSortBy,
|
|
173
|
+
JobPositionGroupSortOrder,
|
|
174
|
+
} from './blocks/career/job-position-group'
|
|
175
|
+
export {createJobPositionGroupBlock, jobPositionGroupDefaults, JobPositionsSelectModal} from './blocks/career/job-position-group'
|
|
176
|
+
export type {CareerHeaderAttributes, CareerHeaderOptions} from './blocks/career/career-header'
|
|
177
|
+
export {createCareerHeaderBlock, careerHeaderDefaults} from './blocks/career/career-header'
|
|
178
|
+
export type {PostContentAttributes, PostContentOptions} from './blocks/post/post-content'
|
|
179
|
+
export {createPostContentBlock, postContentDefaults} from './blocks/post/post-content'
|
|
180
|
+
export type {ShareAttributes, ShareOptions} from './blocks/share/share'
|
|
181
|
+
export {createShareBlock, shareDefaults} from './blocks/share/share'
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"DocumentsSelectModal.d.ts","sourceRoot":"","sources":["../../../../src/blocks/document/documents-group/DocumentsSelectModal.tsx"],"names":[],"mappings":"AAMA,OAAO,KAAqC,MAAM,OAAO,CAAA;AACzD,OAAO,KAAK,EAAC,kBAAkB,EAAC,MAAM,SAAS,CAAA;AAgH/C;;;;;;;GAOG;AACH,wBAAgB,oBAAoB,CAAC,EAAC,aAAa,EAAE,QAAQ,EAAC,EAAE,kBAAkB,qBAiJjF"}
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import type { DocumentsGroupColumns, DocumentsGroupMode, DocumentsGroupListingStyle, DocumentsGroupSortBy } from './types';
|
|
2
|
-
export declare const DOCUMENTS_GROUP_MODE_DEFAULT: DocumentsGroupMode;
|
|
3
|
-
export declare const DOCUMENTS_GROUP_LISTING_STYLE_DEFAULT: DocumentsGroupListingStyle;
|
|
4
|
-
export declare const DOCUMENTS_GROUP_SORT_BY_DEFAULT: DocumentsGroupSortBy;
|
|
5
|
-
export declare const DOCUMENTS_GROUP_COLUMNS_DEFAULT: DocumentsGroupColumns;
|
|
6
|
-
export declare const DOCUMENTS_GROUP_COLUMNS: DocumentsGroupColumns[];
|
|
7
|
-
//# sourceMappingURL=constants.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../../../../src/blocks/document/documents-group/constants.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAC,qBAAqB,EAAE,kBAAkB,EAAE,0BAA0B,EAAE,oBAAoB,EAAC,MAAM,SAAS,CAAA;AAExH,eAAO,MAAM,4BAA4B,EAAE,kBAA6B,CAAA;AACxE,eAAO,MAAM,qCAAqC,EAAE,0BAAsC,CAAA;AAC1F,eAAO,MAAM,+BAA+B,EAAE,oBAAqC,CAAA;AACnF,eAAO,MAAM,+BAA+B,EAAE,qBAAyB,CAAA;AACvE,eAAO,MAAM,uBAAuB,EAAE,qBAAqB,EAAoB,CAAA"}
|
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
export const DOCUMENTS_GROUP_MODE_DEFAULT = 'manual';
|
|
2
|
-
export const DOCUMENTS_GROUP_LISTING_STYLE_DEFAULT = 'classic';
|
|
3
|
-
export const DOCUMENTS_GROUP_SORT_BY_DEFAULT = 'manual-order';
|
|
4
|
-
export const DOCUMENTS_GROUP_COLUMNS_DEFAULT = 1;
|
|
5
|
-
export const DOCUMENTS_GROUP_COLUMNS = [1, 2, 3, 4, 6];
|
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
import type { DocumentsGroupAttributes, DocumentsGroupOptions } from './types';
|
|
2
|
-
export declare function createDocumentsGroupEdit(options: DocumentsGroupOptions): ({ attributes, setAttributes, }: {
|
|
3
|
-
attributes: DocumentsGroupAttributes;
|
|
4
|
-
setAttributes: (a: Partial<DocumentsGroupAttributes>) => void;
|
|
5
|
-
}) => import("react").JSX.Element;
|
|
6
|
-
//# sourceMappingURL=edit.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"edit.d.ts","sourceRoot":"","sources":["../../../../src/blocks/document/documents-group/edit.tsx"],"names":[],"mappings":"AAQA,OAAO,KAAK,EAAC,wBAAwB,EAAE,qBAAqB,EAAC,MAAM,SAAS,CAAA;AAE5E,wBAAgB,wBAAwB,CAAC,OAAO,EAAE,qBAAqB,oCAIlE;IACD,UAAU,EAAE,wBAAwB,CAAA;IACpC,aAAa,EAAE,CAAC,CAAC,EAAE,OAAO,CAAC,wBAAwB,CAAC,KAAK,IAAI,CAAA;CAC9D,iCA8EF"}
|
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
import type { BlockConfiguration } from '@wordpress/blocks';
|
|
2
|
-
import type { DocumentsGroupAttributes, DocumentsGroupOptions } from './types';
|
|
3
|
-
export type { DocumentsGroupAttributes, DocumentsGroupOptions };
|
|
4
|
-
export declare function createDocumentsGroupBlock(options: DocumentsGroupOptions): BlockConfiguration<DocumentsGroupAttributes>;
|
|
5
|
-
//# sourceMappingURL=factory.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"factory.d.ts","sourceRoot":"","sources":["../../../../src/blocks/document/documents-group/factory.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAC,kBAAkB,EAAC,MAAM,mBAAmB,CAAA;AAUzD,OAAO,KAAK,EAAC,wBAAwB,EAAE,qBAAqB,EAAC,MAAM,SAAS,CAAA;AAE5E,YAAY,EAAC,wBAAwB,EAAE,qBAAqB,EAAC,CAAA;AAE7D,wBAAgB,yBAAyB,CAAC,OAAO,EAAE,qBAAqB,GAAG,kBAAkB,CAAC,wBAAwB,CAAC,CA4CtH"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"icon.d.ts","sourceRoot":"","sources":["../../../../src/blocks/document/documents-group/icon.tsx"],"names":[],"mappings":"AAAA,eAAO,MAAM,IAAI,6BAQhB,CAAA"}
|
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
export type { DocumentsGroupAttributes, DocumentsGroupOptions, DocumentsGroupListingStyle, DocumentsGroupMode, DocumentsGroupSortBy, } from './types';
|
|
2
|
-
export { createDocumentsGroupBlock } from './factory';
|
|
3
|
-
export { DocumentsSelectModal } from './DocumentsSelectModal';
|
|
4
|
-
import type { DocumentsGroupOptions } from './types';
|
|
5
|
-
export declare const documentsGroupDefaults: DocumentsGroupOptions;
|
|
6
|
-
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/blocks/document/documents-group/index.ts"],"names":[],"mappings":"AAAA,YAAY,EACV,wBAAwB,EACxB,qBAAqB,EACrB,0BAA0B,EAC1B,kBAAkB,EAClB,oBAAoB,GACrB,MAAM,SAAS,CAAA;AAChB,OAAO,EAAC,yBAAyB,EAAC,MAAM,WAAW,CAAA;AACnD,OAAO,EAAC,oBAAoB,EAAC,MAAM,wBAAwB,CAAA;AAE3D,OAAO,KAAK,EAAC,qBAAqB,EAAC,MAAM,SAAS,CAAA;AAElD,eAAO,MAAM,sBAAsB,EAAE,qBAEpC,CAAA"}
|
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
import type { BriloBlockType } from '../../../types';
|
|
2
|
-
export type DocumentsGroupMode = 'manual' | 'category';
|
|
3
|
-
export type DocumentsGroupListingStyle = 'classic' | 'group-by-category';
|
|
4
|
-
export type DocumentsGroupSortBy = 'menu_order' | 'date' | 'manual-order';
|
|
5
|
-
export type DocumentsGroupColumns = 1 | 2 | 3 | 4 | 6;
|
|
6
|
-
export interface DocumentsGroupAttributes extends Record<string, unknown> {
|
|
7
|
-
mode: DocumentsGroupMode;
|
|
8
|
-
listingStyle: DocumentsGroupListingStyle;
|
|
9
|
-
sortBy: DocumentsGroupSortBy;
|
|
10
|
-
columns: DocumentsGroupColumns;
|
|
11
|
-
selectedDocuments: number[];
|
|
12
|
-
selectedCategories: number[];
|
|
13
|
-
}
|
|
14
|
-
export interface SelectControlProps {
|
|
15
|
-
selectedItems: number[];
|
|
16
|
-
onChange: (ids: number[]) => void;
|
|
17
|
-
}
|
|
18
|
-
export interface DocumentsGroupOptions extends BriloBlockType {
|
|
19
|
-
renderCategoryControl?: (props: SelectControlProps) => JSX.Element;
|
|
20
|
-
renderDocumentsControl?: (props: SelectControlProps) => JSX.Element;
|
|
21
|
-
}
|
|
22
|
-
//# sourceMappingURL=types.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../src/blocks/document/documents-group/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAC,cAAc,EAAC,MAAM,SAAS,CAAA;AAE3C,MAAM,MAAM,kBAAkB,GAAG,QAAQ,GAAG,UAAU,CAAA;AACtD,MAAM,MAAM,0BAA0B,GAAG,SAAS,GAAG,mBAAmB,CAAA;AACxE,MAAM,MAAM,oBAAoB,GAAG,YAAY,GAAG,MAAM,GAAG,cAAc,CAAA;AACzE,MAAM,MAAM,qBAAqB,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,CAAA;AAErD,MAAM,WAAW,wBAAyB,SAAQ,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC;IACvE,IAAI,EAAE,kBAAkB,CAAA;IACxB,YAAY,EAAE,0BAA0B,CAAA;IACxC,MAAM,EAAE,oBAAoB,CAAA;IAC5B,OAAO,EAAE,qBAAqB,CAAA;IAC9B,iBAAiB,EAAE,MAAM,EAAE,CAAA;IAC3B,kBAAkB,EAAE,MAAM,EAAE,CAAA;CAC7B;AAED,MAAM,WAAW,kBAAkB;IACjC,aAAa,EAAE,MAAM,EAAE,CAAA;IACvB,QAAQ,EAAE,CAAC,GAAG,EAAE,MAAM,EAAE,KAAK,IAAI,CAAA;CAClC;AAED,MAAM,WAAW,qBAAsB,SAAQ,cAAc;IAC3D,qBAAqB,CAAC,EAAE,CAAC,KAAK,EAAE,kBAAkB,KAAK,GAAG,CAAC,OAAO,CAAA;IAClE,sBAAsB,CAAC,EAAE,CAAC,KAAK,EAAE,kBAAkB,KAAK,GAAG,CAAC,OAAO,CAAA;CACpE"}
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import type {DocumentsGroupColumns, DocumentsGroupMode, DocumentsGroupListingStyle, DocumentsGroupSortBy} from './types'
|
|
2
|
-
|
|
3
|
-
export const DOCUMENTS_GROUP_MODE_DEFAULT: DocumentsGroupMode = 'manual'
|
|
4
|
-
export const DOCUMENTS_GROUP_LISTING_STYLE_DEFAULT: DocumentsGroupListingStyle = 'classic'
|
|
5
|
-
export const DOCUMENTS_GROUP_SORT_BY_DEFAULT: DocumentsGroupSortBy = 'manual-order'
|
|
6
|
-
export const DOCUMENTS_GROUP_COLUMNS_DEFAULT: DocumentsGroupColumns = 1
|
|
7
|
-
export const DOCUMENTS_GROUP_COLUMNS: DocumentsGroupColumns[] = [1, 2, 3, 4, 6]
|
|
@@ -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
|