-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(SLB-292): horizontal separator gutenberg block
- Loading branch information
Showing
11 changed files
with
63 additions
and
0 deletions.
There are no files selected for viewing
21 changes: 21 additions & 0 deletions
21
packages/drupal/gutenberg_blocks/src/blocks/horizontal-separator.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
import { registerBlockType } from 'wordpress__blocks'; | ||
import { compose, withState } from 'wordpress__compose'; | ||
|
||
declare const Drupal: { t: (s: string) => string }; | ||
|
||
const { t: __ } = Drupal; | ||
|
||
// @ts-ignore | ||
registerBlockType(`custom/horizontal-separator`, { | ||
title: __('Horizontal separator'), | ||
icon: 'minus', | ||
category: 'text', | ||
attributes: {}, | ||
// @ts-ignore | ||
edit: compose(withState())(() => { | ||
return <hr />; | ||
}), | ||
save() { | ||
return null; | ||
}, | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
5 changes: 5 additions & 0 deletions
5
packages/schema/src/fragments/PageContent/BlockHorizontalSeparator.gql
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
fragment BlockHorizontalSeparator on BlockHorizontalSeparator { | ||
# This is not really used, but until we have other real setting fields, we | ||
# have to provide a dummy one. | ||
markup | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
11 changes: 11 additions & 0 deletions
11
packages/ui/src/components/Organisms/PageContent/BlockHorizontalSeparator.stories.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
import { Meta, StoryObj } from '@storybook/react'; | ||
|
||
import { BlockHorizontalSeparator } from './BlockHorizontalSeparator'; | ||
|
||
export default { | ||
component: BlockHorizontalSeparator, | ||
} satisfies Meta<typeof BlockHorizontalSeparator>; | ||
|
||
export const HorizontalSeparator = { | ||
args: {}, | ||
} satisfies StoryObj<typeof BlockHorizontalSeparator>; |
5 changes: 5 additions & 0 deletions
5
packages/ui/src/components/Organisms/PageContent/BlockHorizontalSeparator.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
import React from 'react'; | ||
|
||
export function BlockHorizontalSeparator() { | ||
return <hr />; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters