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

feat: custom byline interface #3746

Merged
merged 53 commits into from
Mar 28, 2025
Merged
Changes from 1 commit
Commits
Show all changes
53 commits
Select commit Hold shift + click to select a range
a367a74
feat: modify textarea to RichText and add TagInlineBlock with dummy a…
allysonsouza Feb 5, 2025
c18b8b5
feat: fetch authors from co-authors plus and set tokens on BylinesSet…
allysonsouza Feb 5, 2025
f319231
chore: improve inline documentation
allysonsouza Feb 5, 2025
a971770
feat: [WIP] add author tokens on click
allysonsouza Feb 7, 2025
c7fce76
feat: append users to the end of the byline
allysonsouza Feb 7, 2025
63563d9
feat: add author tokens to custom byline
allysonsouza Feb 10, 2025
772a101
feat: handling tokens with vanilla JS (WIP)
allysonsouza Feb 11, 2025
7d74e71
feat: useRef to manage tokens in use
allysonsouza Feb 12, 2025
1db290f
chore: improve inline docs
allysonsouza Feb 12, 2025
e876bdb
feat: check custom byline after DOM ready
allysonsouza Feb 12, 2025
b9b6a8a
chore: addEventListener trough ref instead of DOM directly
allysonsouza Feb 12, 2025
b1ba1d4
feat: display icons on tokens (plus to insert and close to remove)
allysonsouza Feb 13, 2025
c7ddeb1
feat: add mutation observer to remove tokens on erasing with backspac…
allysonsouza Feb 13, 2025
ef4d1f4
chore: enhance inline documentation
allysonsouza Feb 13, 2025
9428999
fix: stylize tokens according to FormTokenField
allysonsouza Feb 17, 2025
a0138b2
fix: remove token when characterData changes
allysonsouza Feb 18, 2025
bdba077
fix: improved mutation observer callback logic to update data correctly
allysonsouza Feb 20, 2025
0117cbd
fix: initilize only on DOM ready and main byline element ready
allysonsouza Feb 20, 2025
cfe3d7c
fix: properly add the mutation observer after child component is ready
allysonsouza Feb 25, 2025
85834ec
fix: implement setTokensInUse function to better reuse code
allysonsouza Feb 25, 2025
d149b19
fix: split byline "textarea" and tokens to avoid unwanted re-rendering
allysonsouza Feb 26, 2025
a9efa9d
feat: parse meta with <Author> before rendering byline
allysonsouza Feb 26, 2025
0172c39
feat: store byline meta according to the expected format
allysonsouza Feb 28, 2025
bdebb41
chore: refacot bylineParser function
allysonsouza Feb 28, 2025
de13264
feat: make custom bylines to work without co-author plus activated
allysonsouza Mar 11, 2025
c7cd705
feat: make custom byline field to be displayed on a modal
allysonsouza Mar 12, 2025
8ecca9f
fix: mystype newspackByline.is_co_authors_plus_active
allysonsouza Mar 17, 2025
6e8898a
fix: adding space after token insertion at the end of byline
allysonsouza Mar 17, 2025
d7691f1
fix: improve byline innerHTML assignment
allysonsouza Mar 17, 2025
8e03133
fix: typo isTokensdReady
allysonsouza Mar 18, 2025
d0b1e1c
docs: update docs
leogermani Mar 18, 2025
108d7e7
fix: remove non used authors query
allysonsouza Mar 18, 2025
2c00941
fix: cubic-bezier transition typo
allysonsouza Mar 18, 2025
03d4100
fix: remove updateBylineMeta from click on x/removal callback event
allysonsouza Mar 18, 2025
cab5d82
fix: remove unnecessary "backwards" compatibility since it's new feature
allysonsouza Mar 18, 2025
6fede99
refactor: replace MutationObserver with event listeners
goldenapples Mar 21, 2025
36b097e
fix: update effect registration so it only runs on mounting
goldenapples Mar 21, 2025
aa4087a
refactor: remove unneded "remove token" handler
goldenapples Mar 21, 2025
13a1d33
fix: look up the byline meta on mount, not just on initial render
goldenapples Mar 21, 2025
3d17eee
fix: set contenteditable="false" on token spans
goldenapples Mar 23, 2025
fa68c1c
chore: add some missing docblocks and fix some lint issues
goldenapples Mar 23, 2025
5323909
fix: set default insert location to end of editable field
goldenapples Mar 24, 2025
5ebb183
fix: remove margin from last token to prevent confusion with whitespace
allysonsouza Mar 24, 2025
07c5bcf
feat: add preview to sidebar interface
goldenapples Mar 25, 2025
3e51b6b
fix: rename panel to Byline
allysonsouza Mar 25, 2025
75218f7
fix: make modal width fixed
allysonsouza Mar 25, 2025
d403417
feat: add function to parse meta for preview
allysonsouza Mar 25, 2025
95ac5a6
feat: default custom byline on first toggle
allysonsouza Mar 27, 2025
1781934
feat: set default custom byline meta on toggle
joeleenk Mar 27, 2025
111b539
feat: update styles to match new designs
joeleenk Mar 27, 2025
c82d575
feat: update styles to match designs
joeleenk Mar 27, 2025
b2edadb
chore: cleanup, comments, organization
joeleenk Mar 28, 2025
65fd450
Merge branch 'trunk' into feat/byline-interface
leogermani Mar 28, 2025
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
feat: add preview to sidebar interface
goldenapples committed Mar 25, 2025
commit 07c5bcf8b38cc97e35f80177ed95ef304fd04108
9 changes: 9 additions & 0 deletions src/bylines/index.js
Original file line number Diff line number Diff line change
@@ -94,8 +94,17 @@ const CustomBylineModal = ( { children } ) => {
const openModal = () => setOpen( true );
const closeModal = () => setOpen( false );

const byline = useSelect( select => {
const meta = select( 'core/editor' ).getEditedPostAttribute( 'meta' );
return meta[ newspackBylines.metaKeyByline ];
} );

return (
<>
<p
className="description"
dangerouslySetInnerHTML={ { __html: byline } }
/>
<Button variant="secondary" onClick={ openModal }>
Set Custom Byline
</Button>