You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Can a field widget rely on PortableTextEditor, onEditorReady and emdashPortableTextKey?
#3909
A custom field widget, built following "Custom field widgets" in the React admin extensions guide, can wrap the admin's own rich text editor for a portableText field to add behaviour such as inline highlights. Doing that relies on exports that the docs do not cover:
PortableTextEditor and PortableTextEditorProps from @emdash-cms/admin.
The onEditorReady prop, which hands over the TipTap editor (and null on unmount). The widget would call registerPlugin, unregisterPlugin, on/off for update and transaction, view.dispatch, and the setTextSelection and scrollIntoView commands.
The emdashPortableTextKey node attribute, which maps editor blocks back to Portable Text _key values.
API_BASE from @emdash-cms/admin, used to build a plugin route URL.
Are these public API that plugins can rely on across minor versions? If they are internal, is there a supported way for a field widget to reuse the host's rich text editor?
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
Uh oh!
There was an error while loading. Please reload this page.
A custom field widget, built following "Custom field widgets" in the React admin extensions guide, can wrap the admin's own rich text editor for a
portableTextfield to add behaviour such as inline highlights. Doing that relies on exports that the docs do not cover:PortableTextEditorandPortableTextEditorPropsfrom@emdash-cms/admin.onEditorReadyprop, which hands over the TipTap editor (andnullon unmount). The widget would callregisterPlugin,unregisterPlugin,on/offforupdateandtransaction,view.dispatch, and thesetTextSelectionandscrollIntoViewcommands.emdashPortableTextKeynode attribute, which maps editor blocks back to Portable Text_keyvalues.API_BASEfrom@emdash-cms/admin, used to build a plugin route URL.Are these public API that plugins can rely on across minor versions? If they are internal, is there a supported way for a field widget to reuse the host's rich text editor?
All reactions