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

Placeholders parameters #1138

Merged
merged 23 commits into from
Jun 20, 2024
Merged

Conversation

didoda
Copy link
Member

@didoda didoda commented Jun 10, 2024

This provides a new feature to handle placeholders parameters.

Richtext editors provide already the placeholder utility: you can add BEdita object placeholders inside the rich text.
With this, you will have a list of placeholders after each richtext editor, with the possibility to set "bearing", "pitch" and "zoom" parameters.

image

Each object type can have its own parameters structure: you can define it using Placeholders configuration. For example:

'Placeholders' => [
    'audio' => [
        'controls' => 'boolean',
        'autoplay' => 'boolean',
    ],
    'files' => [
        'download' => 'boolean',
    ],
    'images' => [
        'width' => ['small', 'medium', 'large'],
        'height' => ['small', 'medium', 'large'],
        'bearing' => 'integer',
        'pitch' => 'integer',
        'zoom' => 'integer',
    ],
    'videos' => [
        'controls' => 'boolean',
        'autoplay' => 'boolean',
    ],
],

Bonus: this introduces EventBus component, that allows developers to handle global events among components.
Usage:

import { EventBus } from 'app/components/event-bus';

// this listen to "my-event-name", lauch callback function when event is triggered
EventBus.listen('my-event-name', callback);

// trigger event "my-event-name" with some data
EventBus.send('my-event-name', data);

@didoda didoda added feature New feature or request UI / UX release:minor labels Jun 10, 2024
@didoda didoda added this to the 4.x milestone Jun 10, 2024
Copy link

codecov bot commented Jun 14, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 99.69%. Comparing base (fda3647) to head (ac01944).
Report is 4 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff            @@
##             master    #1138   +/-   ##
=========================================
  Coverage     99.68%   99.69%           
- Complexity     1254     1255    +1     
=========================================
  Files            95       95           
  Lines          4836     4851   +15     
=========================================
+ Hits           4821     4836   +15     
  Misses           15       15           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@didoda didoda marked this pull request as ready for review June 14, 2024 12:43
@fquffio fquffio merged commit 4af955f into bedita:master Jun 20, 2024
28 checks passed
@didoda didoda deleted the feat/placeholders-params branch June 20, 2024 14:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants