Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Block API: Add supports object to block attributes to configure copy support #38643

Open
wants to merge 32 commits into
base: trunk
Choose a base branch
from
Open
Changes from 1 commit
Commits
Show all changes
32 commits
Select commit Hold shift + click to select a range
135c788
Add internal experimentalRole for attributes
stacimc Sep 10, 2021
7fde6d4
Add tests
stacimc Sep 10, 2021
22ce576
Refactor removeAttributesByRole to take role param and return block
stacimc Sep 21, 2021
f0a5e68
Remove internal attrs when copying via keyboard command
stacimc Sep 21, 2021
44e1659
Remove internal attrs when copying via CopyMenuItem
stacimc Sep 21, 2021
730f2e2
Do not alter attributes of block being duplicated
stacimc Sep 22, 2021
46596a5
Use `__experimentalCloneSanitizedBlock` in copy handlers
stacimc Sep 22, 2021
8256770
Use internal attribute for widgetId
stacimc Sep 22, 2021
250e4a8
Update tests for __experimentalRemoveAttributesByRole
stacimc Sep 22, 2021
b5fabc6
Update packages/widgets/package.json
ntsekouras Sep 23, 2021
3f5c24a
Move attribute registration to function called in widget initialization
stacimc Sep 23, 2021
4f83c53
Corrected docstring
stacimc Sep 23, 2021
1d4b93a
Check for existence of widget before moving sidebars
stacimc Oct 11, 2021
bc065eb
Do not separately sanitize attributes in cloneSanitizedBlock
stacimc Oct 11, 2021
9a72f51
Remove __experimentalSanitizeBlockAttributes
stacimc Oct 13, 2021
0d6388a
Remove unnecessary attribute sanitization in ServerSideRender component
stacimc Oct 13, 2021
a41909a
Remove removeAttributesByRole
stacimc Feb 1, 2022
a25b7cd
Remove experimentalCloneSanitizeBlock and make retaining internal att…
stacimc Feb 2, 2022
2b109ab
Add option to serialize to retain internal attrs
stacimc Feb 7, 2022
54989c6
Refactor to use a 'supports' property instead of '__experimentalRole'
stacimc Feb 8, 2022
ae5a3b5
Do not pass widgetId to /block-renderer
stacimc Feb 8, 2022
fea6451
Update test
stacimc Feb 8, 2022
42eefe8
Update use of 'internal' terminology in docs
stacimc Feb 8, 2022
c547f6b
Mark supports object as experimental
stacimc Feb 11, 2022
ad1749d
Update option name, mark as experimental
stacimc Feb 11, 2022
c5d3eae
Add TODO to remove special handling for internalWidgetId when possible
stacimc Feb 11, 2022
8a2c987
Correctly exclude noncopyable attrs in duplicate
stacimc Feb 23, 2022
085000f
Use __experimentalExcludeAttributes option
stacimc Feb 24, 2022
ccba197
Use new serializer options
stacimc Feb 24, 2022
94efe0c
Remove logic from serializer in favor of using cloneBlock in copy han…
stacimc Feb 25, 2022
aca0d35
Clarify arguments for cloneBlock
stacimc Mar 24, 2022
191c4f2
Rename argument
stacimc Mar 25, 2022
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Update test
  • Loading branch information
stacimc committed Mar 17, 2022
commit fea64514a2a03ed1ca8b886821b5b862f4a6de68
6 changes: 4 additions & 2 deletions packages/blocks/src/api/test/serializer.js
Original file line number Diff line number Diff line change
Expand Up @@ -329,7 +329,9 @@ describe( 'block serializer', () => {
},
internal: {
type: 'string',
__experimentalRole: 'internal',
supports: {
copy: false
},
},
},
save( { attributes } ) {
Expand Down Expand Up @@ -394,7 +396,7 @@ describe( 'block serializer', () => {
);
} );

it( 'should omit internal attributes when retainCopyAttributes is fasle', () => {
it( 'should omit internal attributes when retainCopyAttributes is false', () => {
const block = createBlock( 'core/test-block', {
content: 'content',
internal: 'copy me',
Expand Down