Skip to content

Commit

Permalink
feat(pte): expose data-attributes on PTE Text + Object blocks (#6641)
Browse files Browse the repository at this point in the history
* feat: expose data attributes on PTE text block components

* feat: expose data attributes on PTE default block object component
  • Loading branch information
robinpyon authored and ricokahler committed May 14, 2024
1 parent b13fff4 commit fceff23
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -282,7 +282,12 @@ export function BlockObject(props: BlockObjectProps) {
ref={memberItem?.elementRef as RefObject<HTMLDivElement> | undefined}
contentEditable={false}
>
<Flex paddingBottom={1} marginY={3} style={debugRender()}>
<Flex
data-object-block="" // used by create
paddingBottom={1}
marginY={3}
style={debugRender()}
>
<InnerFlex flex={1}>
<Tooltip
placement="top"
Expand All @@ -291,7 +296,10 @@ export function BlockObject(props: BlockObjectProps) {
disabled={isOpen ? true : !tooltipEnabled}
content={toolTipContent}
>
<PreviewContainer {...innerPaddingProps}>
<PreviewContainer
data-object-block-inner="" // used by create
{...innerPaddingProps}
>
{renderBlock && renderBlock(componentProps)}
</PreviewContainer>
</Tooltip>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -269,13 +269,18 @@ export function TextBlock(props: TextBlockProps) {
return useMemo(
() => (
<Box
data-testid="text-block"
{...outerPaddingProps}
style={debugRender()}
data-testid="text-block"
data-text-block="" // used by create
ref={memberItem?.elementRef as RefObject<HTMLDivElement>}
style={debugRender()}
>
<TextBlockFlexWrapper data-testid="text-block__wrapper">
<Flex flex={1} {...innerPaddingProps}>
<Flex
data-text-block-inner="" // used by create
flex={1}
{...innerPaddingProps}
>
<Box flex={1}>
<Tooltip
content={toolTipContent}
Expand Down

0 comments on commit fceff23

Please sign in to comment.