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 Bindings: enhance block attribute binding to external sources #58895

Closed
wants to merge 74 commits into from
Closed
Changes from 1 commit
Commits
Show all changes
74 commits
Select commit Hold shift + click to select a range
e9a1ddf
replace use-binding-attributes with block-binding-support
retrofox Feb 12, 2024
8c20db3
minor enhancement
retrofox Feb 10, 2024
31c1bec
minor change
retrofox Feb 10, 2024
8a8a839
tweak
retrofox Feb 10, 2024
39b7a89
do not import use-binding-attributes
retrofox Feb 10, 2024
9f643e7
use isItPossibleToBindBlock() helper
retrofox Feb 10, 2024
f89fc68
introduce core/entity source handler
retrofox Feb 10, 2024
8ef5a5b
rename folder
retrofox Feb 11, 2024
b5a86ac
rename source name
retrofox Feb 12, 2024
71e716c
polish post-entity source handler
retrofox Feb 12, 2024
12d5cd4
make core/post-entity more consistent with core-data
retrofox Feb 12, 2024
ebb9bb2
make entity source hand;ler more generic
retrofox Feb 12, 2024
1470818
fix entity sour handl;er issues
retrofox Feb 12, 2024
64eedc2
remove uneeded useValue () hook (crossfingers)
retrofox Feb 12, 2024
a2d5cb2
minor jsdoc improvement
retrofox Feb 12, 2024
4deda60
clean
retrofox Feb 12, 2024
2510322
rename with updateValue()
retrofox Feb 12, 2024
fce8539
remove core/entity binding source handler
retrofox Feb 12, 2024
8d71311
move useSource to Connector cmp
retrofox Feb 12, 2024
411ede8
move the whole dryining logic to the Connect component
retrofox Feb 12, 2024
eb7e032
improve jsdoc
retrofox Feb 12, 2024
b8a9061
rename to blockProps
retrofox Feb 12, 2024
2ae62f0
minor jsdoc improvements
retrofox Feb 13, 2024
cc21a16
use a single effect to update attr and value
retrofox Feb 13, 2024
396dfb3
discard useValue. Return value and setValue instead
retrofox Feb 13, 2024
f25f9b8
check wheter updateValue function is defined
retrofox Feb 13, 2024
f3b3e05
check prop value is defined when updating attr
retrofox Feb 13, 2024
56ae182
handle `placerholder`
retrofox Feb 14, 2024
7de80c3
ensure to put attribute in sync when onmount
retrofox Feb 14, 2024
8866135
remove // eslint comment
retrofox Feb 14, 2024
42ed184
enable editing for bound with post-meta
retrofox Feb 14, 2024
60e73d4
move block bindiung processor to hooks/
retrofox Feb 14, 2024
3c9a341
ensure update bound attr once when mounting
retrofox Feb 15, 2024
7263d22
Update packages/block-editor/src/hooks/block-binding-support/index.js
retrofox Feb 15, 2024
d5b5e78
disable editing block attribute
retrofox Feb 15, 2024
7268a55
move changes to the use-binding-attributes file
retrofox Feb 15, 2024
10b7765
introduce BlockBindingBridge component
retrofox Feb 15, 2024
472d01e
update isItPossibleToBindBlock() import path
retrofox Feb 15, 2024
37c6ab9
introduce hasPossibleBlockBinding() helper
retrofox Feb 15, 2024
eab050b
use hooks API to extened blocks with bound attts
retrofox Feb 15, 2024
de04130
fix propagating attr value. jsdoc
retrofox Feb 15, 2024
28eb168
minor changes
retrofox Feb 15, 2024
fcc5b8a
minor code enhancement
retrofox Feb 19, 2024
cb9e380
not edit bound prop for now
retrofox Feb 19, 2024
bd9cf18
jsdoc
retrofox Feb 19, 2024
7ecfab9
revert using hooks API to extrend block
retrofox Feb 19, 2024
ed16267
jsdoc
retrofox Feb 19, 2024
dbf70e5
update internal path
retrofox Feb 19, 2024
8bb843d
rollback hook utils chnages
retrofox Feb 19, 2024
1abf420
tidy
retrofox Feb 20, 2024
ef40bd4
wrap Connector instances with a Fragment
retrofox Feb 20, 2024
ca54c3f
return original Edit instance when no bindings
retrofox Feb 20, 2024
bfde100
check whether useSource is defined
retrofox Feb 20, 2024
9aedf87
Use `useSelect` and move it out of the for loop
michalczaplinski Feb 20, 2024
dd77b7c
check attr value type
retrofox Feb 20, 2024
b17ce14
iterare when creating BindingConnector instances
retrofox Feb 21, 2024
74b32ad
rename helper functions
retrofox Feb 21, 2024
93430da
use useSelect to get binding sources
retrofox Feb 21, 2024
ecaf10a
Update packages/block-editor/src/hooks/use-bindings-attributes.js
retrofox Feb 21, 2024
2fd9911
Update packages/block-editor/src/hooks/use-bindings-attributes.js
retrofox Feb 21, 2024
5bd3a79
pass prev attr value to compare
retrofox Feb 22, 2024
1741497
improve binding allowed block attributes
retrofox Feb 22, 2024
e435a3d
sync derevied updates when updating bound attr
retrofox Feb 22, 2024
8f27c48
improve getting attr source
retrofox Feb 22, 2024
3d953f8
check properly bindings data
retrofox Feb 22, 2024
3d106ce
preserve the RichTextData for block attr
retrofox Feb 23, 2024
994bed1
comment line just for tesrting purposes
retrofox Feb 23, 2024
4998315
rebasing changes
retrofox Feb 23, 2024
9072e6a
rollback change foir testing purposes
retrofox Feb 23, 2024
2133393
change cmp prop name. improve jsdoc
retrofox Feb 27, 2024
91f64d6
simplify checking bindins value
retrofox Feb 27, 2024
987fb58
use attr name as key instance
retrofox Feb 27, 2024
db32d18
Refactor useMarkPersistent function
michalczaplinski Feb 26, 2024
e55f6bc
pick block data from straight props
retrofox Feb 27, 2024
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
clean
  • Loading branch information
retrofox authored and michalczaplinski committed Feb 27, 2024
commit 4deda605de3c555c6da796611136f576cde5b29a
8 changes: 1 addition & 7 deletions packages/editor/src/bindings/entity/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,14 +30,8 @@ const useSource = ( blockProps, sourceArgs ) => {
}

const { context } = blockProps;
const {
kind = 'postType',
name: nameFromArgs = 'post',
prop,
id,
} = sourceArgs;
const { kind = 'postType', name: nameFromArgs, prop, id } = sourceArgs;

// Let's define `postType` as the default kind.
const { postType: nameFromContext } = context;

/*
Expand Down