Closed swissspidy closed 3 months ago
From chatting with @AnuragVasanwala:
Some thoughts on implementation details:
packages/element-library
audio-sticker
element, which will be responsible for displaying the sticker in the editor and generating the actual <amp-story-audio-sticker>
markup for viewing the storysize
: 'small', 'large'
(small
is default)sticker
: 'headphone-cat','tape-player','loud-speaker','audio-cloud'
(headphone-cat
is default)style
: 'outline','dropshadow',
(default is none)output.js
is valid AMPproduct
element type for inspiration, as it's the most recent one.constants.js
are especially important, need to see which ones make sense for this element type.element-library
package to TypeScript
packages/output
output
package to TypeScript
KSES.php
In the editor UI
packages/story-editor/src/components/panels/design/audio-sticker
to hold the panel for the audio sticker element
sticker
, size
, and outline
sticker
: since we have 4 different sticker types, maybe we could just show them side by side and the user can select one? Similar to how filters are presented:
size
: Maybe a <Switch>
component to choose between small and large?style
maybe similar appearance as for the sticker types as there are effectively 3 different styles, and it would be nice to see a preview of them right in the panel.packages/story-editor/src/app/quickActions
, add a new quick action for quickly adding an audio sticker to the page.
From our discussion just now:
To detect whether a story has any audio (untested but should work):
const hasAudioAnywhere = useStory(
({ state }) =>
state.story.backgroundAudio ||
state.pages.some(
(page) =>
page.backgroundAudio ||
page.elements
.filter(elementIs.video)
.some((element) => !element.resource.isMuted)
)
);
Feature Description
This new
amp-story-audio-sticker
extension has been added recently, see https://github.com/ampproject/amphtml/pull/39184https://github.com/GoogleForCreators/web-stories-wp/assets/841956/85ab1728-3c76-4d20-9106-d6eaa7da54ac
No limits in how many stickers can be added to a story.
Color of the sticker drop shadow and outline can be customized.
Stickers can be added in two different sizes:
The following stickers exist:
Alternatives Considered
Additional Context
Currently blocked by: