discourse/plugins
Renato Atilio e8aeb272bb
UX: improvements to rich editor spoiler (#34149)
Adds `commands` and `state` keys to the `RichEditorExtension` and uses
them for the spoiler toolbar item, so it shows the current state when
inside a spoiler node, and toggles the state when triggered.

Improves the `keymap` key chaining mechanism to also include the base
keymap as part of the chain, so custom commands can be triggered before
getting to the base keymap.

Extends the ENTER key handling with a different behavior for inline
nodes such as `[spoiler]` or `<kbd>` (inline spoiler and inline html):
- if at the start of a node, moves the node to a paragraph below
- if in the middle of the node, splits it but strips the node from the
second half, keeping it "unstyled"
- if at the end of the node, adds and selects a new paragraph

Appends an empty space (" ") after these inline nodes when they happen
at the end of a block node, allowing to tap/right-arrow out of the
inline node.

Adds a `[spoiler]` input rule which adds an inline spoiler if
mid-sentence or a block spoiler if at the beginning of a text block.

Replaces the "toggle" for revealing the spoiler node, instead of using a
click handler we now track the cursor position and reveal when it's
inside a spoiler node.

Tweaks the `bbcode-block` markdown-it handler to avoid applying a bbcode
block for a scenario like `[spoiler]spoiled[/spoiler] `, with the
trailing space, otherwise our inline node on ProseMirror would be
re-parsed as block on the next markdown-it parsing.

Updates the styling using the default `--d-border-radius`.

<img width="725" height="234" alt="image"
src="https://github.com/user-attachments/assets/6a509fe0-73e8-4f01-98c9-ed96d087ce1c"
/>
2025-08-21 13:56:31 -03:00
..
automation Update translations (#34436) 2025-08-21 11:02:39 +02:00
chat Update translations (#34436) 2025-08-21 11:02:39 +02:00
checklist DEV: Silence post-stream-widget-overrides in the checklist plugin (#33743) 2025-07-22 14:47:33 -03:00
discourse-adplugin Update translations (#34436) 2025-08-21 11:02:39 +02:00
discourse-affiliate Update translations (#34413) 2025-08-19 16:23:59 +02:00
discourse-ai UX: change "Open AI" to OpenAI (#34459) 2025-08-21 17:22:17 +05:30
discourse-apple-auth Update translations (#34436) 2025-08-21 11:02:39 +02:00
discourse-assign Update translations (#34436) 2025-08-21 11:02:39 +02:00
discourse-calendar Update translations (#34436) 2025-08-21 11:02:39 +02:00
discourse-chat-integration Update translations (#34436) 2025-08-21 11:02:39 +02:00
discourse-data-explorer Update translations (#34436) 2025-08-21 11:02:39 +02:00
discourse-details Update translations (#34436) 2025-08-21 11:02:39 +02:00
discourse-gamification Update translations (#34436) 2025-08-21 11:02:39 +02:00
discourse-github Update translations (#34436) 2025-08-21 11:02:39 +02:00
discourse-graphviz Update translations (#34436) 2025-08-21 11:02:39 +02:00
discourse-hcaptcha Update translations (#34116) 2025-08-19 12:14:51 +02:00
discourse-lazy-videos Update translations (#34116) 2025-08-19 12:14:51 +02:00
discourse-local-dates Update translations (#34436) 2025-08-21 11:02:39 +02:00
discourse-login-with-amazon DEV: Remove unnecessary rails_helper requires (#33812) 2025-07-24 13:50:04 +02:00
discourse-lti Build(deps-dev): Bump the lint group across 1 directory with 4 updates (#33881) 2025-07-28 18:02:41 +02:00
discourse-math Update translations (#34436) 2025-08-21 11:02:39 +02:00
discourse-microsoft-auth Update translations (#34413) 2025-08-19 16:23:59 +02:00
discourse-narrative-bot Update translations (#34436) 2025-08-21 11:02:39 +02:00
discourse-oauth2-basic Update translations (#34436) 2025-08-21 11:02:39 +02:00
discourse-openid-connect Update translations (#34413) 2025-08-19 16:23:59 +02:00
discourse-patreon Update translations (#34436) 2025-08-21 11:02:39 +02:00
discourse-policy Update translations (#34436) 2025-08-21 11:02:39 +02:00
discourse-post-voting Update translations (#34436) 2025-08-21 11:02:39 +02:00
discourse-presence Update translations (#34116) 2025-08-19 12:14:51 +02:00
discourse-reactions Update translations (#34413) 2025-08-19 16:23:59 +02:00
discourse-rss-polling Update translations (#34436) 2025-08-21 11:02:39 +02:00
discourse-solved Update translations (#34436) 2025-08-21 11:02:39 +02:00
discourse-subscriptions Update translations (#34436) 2025-08-21 11:02:39 +02:00
discourse-templates Update translations (#34436) 2025-08-21 11:02:39 +02:00
discourse-topic-voting Update translations (#34436) 2025-08-21 11:02:39 +02:00
discourse-user-notes Update translations (#34436) 2025-08-21 11:02:39 +02:00
discourse-zendesk-plugin Update translations (#34436) 2025-08-21 11:02:39 +02:00
footnote DEV: Remove @triggers args where eq to the default (#34321) 2025-08-14 16:21:33 +02:00
poll Update translations (#34436) 2025-08-21 11:02:39 +02:00
spoiler-alert UX: improvements to rich editor spoiler (#34149) 2025-08-21 13:56:31 -03:00
styleguide DEV: Replace <Input /> text usage in plugins (#34352) 2025-08-20 11:23:41 +10:00