discourse/plugins
Alan Guo Xiang Tan 913fd3a7b3
DEV: Improve `addToolbarPopupMenuOptionsCallback` plugin api (#23769)
Why this change?

Previously just using the `addToolbarPopupMenuOptionsCallback` plugin
API itself was insufficient because it required the return object to
include an `action` key which only accepted a name of the action
function as a string. This was highly problematic because the action
function had to be defined on the `composer` service which means using
the `modifyClass` API to add the action function. This made the API
awkward to use leading to poor developer experiencec.

What does this change do?

This commit introduces a couple of improvemnts to the API.

1. First the API has been renamed to `addComposerToolbarPopupMenuOption` because
   the API no longer accepts a callback function which was quite
   redundant. Instead, it now accepts an Object. The
   `addToolbarPopupMenuOptionsCallback` API function is deprecated and
   will be dropped in Discourse 3.3. Note that passing the API a
   function is still supported but will be dropped when the `addToolbarPopupMenuOptionsCallback`
   is removed.

2. The `action` key in the Object passed to the function can now be a
   function and is passed the `toolbarEvent` object when called.

3. The `condition` on key in the Object passed to the function can now be a
   function and is passed the `composer` service when called.
2023-10-06 07:43:40 +08:00
..
chat DEV: skip mobile copy link spec (#23805) 2023-10-05 21:50:19 +02:00
checklist DEV: Future-proof `htmlSafe` interactions (#23596) 2023-09-14 23:04:57 +02:00
discourse-details DEV: Improve `addToolbarPopupMenuOptionsCallback` plugin api (#23769) 2023-10-06 07:43:40 +08:00
discourse-lazy-videos DEV: Remove decorateCookedElement id parameters (#23544) 2023-09-12 16:32:04 +01:00
discourse-local-dates DEV: FloatKit (#23650) 2023-09-26 13:39:52 +02:00
discourse-narrative-bot FIX: Hide core plugins from the admin Plugins list (#23328) 2023-08-31 10:01:01 +10:00
discourse-presence A11Y: disable non-essential CSS animations for reduced-motion users (#23571) 2023-09-14 17:31:43 -04:00
poll DEV: Improve `addToolbarPopupMenuOptionsCallback` plugin api (#23769) 2023-10-06 07:43:40 +08:00
styleguide Update translations (#23757) 2023-10-04 09:54:20 +02:00