wordpress-activitypub/build/reply-intent/plugin.js
Matthias Pfefferle b240589e78
Add "reply context" support (#819)
* add basic reply context support

* UX improvements

* remove unused style file

* built

* Add bookmarklet!

* add build

* small UX tweaks

* add toolbox box

* improved text

* optimized block filter

* add in-reply-to to activity

* refactor to add inboxes using filters

and retrieve/add inboxes of `in-reply-to` links

* renamings

* plugins do not like slashed IDs

* rename to match new get param

---------

Co-authored-by: Matt Wiebe <wiebe@automattic.com>
2024-07-24 23:44:01 +02:00

1 line
No EOL
508 B
JavaScript

(()=>{"use strict";const t=window.wp.plugins,e=window.wp.blocks,n=window.wp.data,i=window.wp.blockEditor,r=window.wp.element;(0,t.registerPlugin)("activitypub-reply-intent",{render:()=>{const[t,o]=(0,r.useState)(!1);return(0,r.useEffect)((()=>{if(t)return;const r=new URLSearchParams(window.location.search).get("in_reply_to");r&&setTimeout((()=>{const t=(0,e.createBlock)("activitypub/reply",{url:r}),o=(0,n.dispatch)(i.store);o.insertBlock(t),o.insertAfterBlock(t.clientId)}),200),o(!0)}),[t]),null}})})();