Merge branch 'develop' into cli-readme

This commit is contained in:
Gerrie van Wyk 2021-09-18 15:39:52 +02:00 committed by GitHub
commit 84ec4f0871
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 26 additions and 8 deletions

View File

@ -31,11 +31,11 @@ const ParagraphBlock = ({ blockId, events, properties, methods }) => (
copyable={
type.isObject(properties.copyable)
? {
text: properties.copyable.text,
text: properties.copyable.text || properties.content,
onCopy: () => {
methods.triggerEvent({
name: 'onCopy',
event: { value: properties.copyable.text },
event: { value: properties.copyable.text || properties.content },
});
},
icon:
@ -64,7 +64,15 @@ const ParagraphBlock = ({ blockId, events, properties, methods }) => (
)),
tooltips: properties.copyable.tooltips,
}
: properties.copyable
: properties.copyable && {
text: properties.content,
onCopy: () => {
methods.triggerEvent({
name: 'onCopy',
event: { value: properties.content },
});
},
}
}
delete={properties.delete}
disabled={properties.disabled}

View File

@ -35,11 +35,11 @@ const TitleBlock = ({ blockId, events, properties, methods }) => {
copyable={
type.isObject(properties.copyable)
? {
text: properties.copyable.text,
text: properties.copyable.text || properties.content,
onCopy: () => {
methods.triggerEvent({
name: 'onCopy',
event: { value: properties.copyable.text },
event: { value: properties.copyable.text || properties.content },
});
},
icon:
@ -68,7 +68,15 @@ const TitleBlock = ({ blockId, events, properties, methods }) => {
)),
tooltips: properties.copyable.tooltips,
}
: properties.copyable
: properties.copyable && {
text: properties.content,
onCopy: () => {
methods.triggerEvent({
name: 'onCopy',
event: { value: properties.content },
});
},
}
}
delete={properties.delete}
disabled={properties.disabled}

View File

@ -20,11 +20,13 @@ _ref:
schema: ../blocks/blocksAntd/src/blocks/Title/Title.json
filePath: blocks/display/Title.yaml
init_state_values:
__type_block.properties.copyable: boolean
__type_block.properties.ellipsis: boolean
__boolean_block.properties.copyable: false
__boolean_block.properties.ellipsis: false
__type_block.properties.value: number
__number_block.properties.value: 33.3
init_property_values:
content: A title block.
description_content: |
A title component. Corresponds to html h1, h2, h3 and h4 elements.