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

First iteration of Hotspot content element #2106

Merged
merged 34 commits into from
May 15, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
34 commits
Select commit Hold shift + click to select a range
ed8fae5
Make image import in Jest more realistic
tf Apr 30, 2024
4b35cd4
Fix React mouse events in editor dialog views
tf Apr 30, 2024
07f4832
Add editor dialog to edit hotspot area outline and indicator position
tf May 3, 2024
f0dd1d4
Do not fail if element has already been removed
tf May 3, 2024
e80197f
Add editor sidebar views for hotspot element
tf May 3, 2024
83fa1a6
Build hotspots element via separate pack
tf May 8, 2024
a23bb57
Add renderInContentElement test helper
tf May 8, 2024
3ab62c1
Lazy load hotspot image
tf May 8, 2024
733d8ab
Render clipped hotspot areas
tf May 8, 2024
d525331
Render area outlines as SVG when hotspots element in editor
tf May 8, 2024
229825f
Hightlight area outline when hovering areas list items
tf May 8, 2024
9b14615
Support potrait image and outlines for hotspots element
tf May 10, 2024
52a3fbc
Add hotspot area indicators
tf May 10, 2024
fc8046e
Add hotspot area tooltips
tf May 10, 2024
430bc58
Show hotspot area tooltips on hover and click
tf May 10, 2024
e274c29
Keep hotspot area tooltip boxes in viewport horizontally
tf May 10, 2024
f12f9f9
Navigate to hotspot area editor route when activating area
tf May 10, 2024
1478150
Activate hotspot area when clicking edit button in areas list
tf May 10, 2024
1457fb3
Make hotspot area indicator color configurable
tf May 10, 2024
ac173b1
Make hotspot area tooltip position configurable
tf May 10, 2024
25657bc
Support active image for hotspot areas
tf May 13, 2024
8d87e91
Add fullscreen mode for hotspots element
tf May 13, 2024
1e36b59
Make alignment and gap of link tooltip configurable
tf May 14, 2024
8a49f15
Extract link tooltip from editable text
tf May 15, 2024
267f1db
Extract link component from editable text
tf May 15, 2024
a14ca0f
Do not display link tooltip if href is blank
tf May 15, 2024
c179aed
Add EditableLink component
tf May 15, 2024
94da583
Render editable link in hotspot area tooltip
tf May 15, 2024
56b40e4
Fade out blank placeholder button in hotspot tooltips
tf May 15, 2024
ac38678
Ensure link tooltip displays above action buttons
tf May 15, 2024
fcb6784
Hide blank elements in hotspot area tooltips
tf May 15, 2024
7e0232a
Improve hotspot area tooltip typography
tf May 15, 2024
111cae7
Use tooltip titles as titles in hotspot area list
tf May 15, 2024
72eb860
Add feature flag for hotspots element
tf May 15, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
79 changes: 79 additions & 0 deletions entry_types/scrolled/config/locales/new/hotspots.de.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,79 @@
de:
pageflow:
hotspots_content_element:
feature_name: Hotspots Inhaltselement
pageflow_scrolled:
public:
more: Mehr
inline_editing:
select_link_destination: "Link-Ziel auswählen"
change_link_destination: "Link-Ziel ändern"
editor:
content_elements:
hotspots:
edit_area:
tabs:
area: Hotspot-Breiech
portrait: Hochkant
attributes:
tooltipPosition:
label: Tooltip-Position
values:
below: Unterhalb
above: Oberhalb
color:
label: Farbe
activeImage:
label: Aktives Bild
area:
label: Bereich
portraitTooltipPosition:
label: Tooltip-Position (Hochkant)
values:
below: Below
above: Above
portraitColor:
label: Farbe (Hochkant)
portraitActiveImage:
label: Aktives Bild (Hochkant)
portraitArea:
label: Bereich (Hochkant)
edit_area_dialog:
header: Bereichsumriss und Indikatorposition
tabs:
default: Standard-Bild
portrait: Hochkant-Bild
modes:
rect: Rechteck
polygon: Polygon
hotspots_image: Hotspotbild
double_click_to_delete: Doppelklick, um Punkt zu entfernen
indicator_title: Ziehen um Indikator zu positionieren
save: Speichern
cancel: Abbrechen
areas:
add: Hinzufügen
label: Bereiche
confirm_delete: Soll der Bereich wirklich gelöscht werden?
area_input:
edit: Umriss und Indikatorposition bearbeiten
attributes:
image:
label: Bild
portraitImage:
inline_help: Wird gezeigt, wenn der Browser-Viewport höher als breit ist - zum Beispiel auf Smartphones oder Tablets in Portrait-Ausrichtung. Kann als Alternative zu einem querformatigen Bild konfiguriert werden, das ansonsten zu klein dargestellt würde.
label: Bild (Hochkant)
enablePanZoom:
label: Pan & Zoom
values:
phonePlatform: Im Phone-Layout
always: Immer
never: Nie
panZoomInitially:
label: Pan & Zoom bei erstem Bereich starten
enableFullscreen:
label: Vollbildmodus erlauben
description: Bild mit anklickbaren Bereichen
name: Hotspots
tabs:
general: Hotspots
79 changes: 79 additions & 0 deletions entry_types/scrolled/config/locales/new/hotspots.en.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,79 @@
en:
pageflow:
hotspots_content_element:
feature_name: Hotspots content element
pageflow_scrolled:
public:
more: More
inline_editing:
select_link_destination: "Select link destination"
change_link_destination: "Change link destination"
editor:
content_elements:
hotspots:
edit_area:
tabs:
area: Hotspot Area
portrait: Portrait
attributes:
tooltipPosition:
label: Tooltip orientation
values:
below: Below
above: Above
color:
label: Color
activeImage:
label: Active image
area:
label: Area
portraitTooltipPosition:
label: Tooltip orientation (Portrait)
values:
below: Below
above: Above
portraitColor:
label: Color (Portrait)
portraitActiveImage:
label: Active image (Portrait)
portraitArea:
label: Area (Portrait)
edit_area_dialog:
header: Area outline and indicator position
tabs:
default: Default image
portrait: Portrait image
modes:
rect: Rectangle
polygon: Polygon
hotspots_image: Hotspots image
double_click_to_delete: Double click to remove point
indicator_title: Drag to position indicator
save: Save
cancel: Cancel
areas:
add: Add
label: Areas
confirm_delete: Are you sure you want to delete this area?
area_input:
edit: Edit outline and indicator position
attributes:
image:
label: Image
portraitImage:
inline_help: Displayed when the browser viewport is taller than wide, for example on phones or tablets in portrait orientation. Can be used to provide an alternative to a landscape image that would otherwise be displayed too small.
label: Image (Portrait)
enablePanZoom:
label: Pan zoom
values:
phonePlatform: In phone layout
always: Always
never: Never
panZoomInitially:
label: Pan to first area initially
enableFullscreen:
label: Enable fullscreen
description: Image with clickable areas
name: Hotspots
tabs:
general: Hotspots
11 changes: 7 additions & 4 deletions entry_types/scrolled/lib/pageflow_scrolled/plugin.rb
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,12 @@ def configure(config)

c.revision_components.register(Storyline)

c.additional_frontend_packs.register(
'pageflow-scrolled/contentElements/tikTokEmbed-frontend',
content_element_type_names: ['tikTokEmbed']
)
['tikTokEmbed', 'hotspots'].each do |name|
c.additional_frontend_packs.register(
"pageflow-scrolled/contentElements/#{name}-frontend",
content_element_type_names: [name]
)
end

c.widget_types.register(ReactWidgetType.new(name: 'defaultNavigation',
role: 'header'),
Expand All @@ -35,6 +37,7 @@ def configure(config)
c.features.register('datawrapper_chart_embed_opt_in')
c.features.enable_by_default('datawrapper_chart_embed_opt_in')
c.features.register('iframe_embed_content_element')
c.features.register('hotspots_content_element')
c.features.register('image_gallery_content_element')
c.features.register('frontend_v2')
c.features.register('scrolled_entry_fragment_caching')
Expand Down
6 changes: 6 additions & 0 deletions entry_types/scrolled/package/config/webpack.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,12 @@ module.exports = {
'pageflow-scrolled/contentElements/tikTokEmbed-frontend.css'
]
},
'pageflow-scrolled/contentElements/hotspots-frontend': {
import: [
'pageflow-scrolled/contentElements/hotspots-frontend',
'pageflow-scrolled/contentElements/hotspots-frontend.css'
]
},
'pageflow-scrolled/widgets/defaultNavigation': {
import: [
'pageflow-scrolled/widgets/defaultNavigation',
Expand Down
1 change: 1 addition & 0 deletions entry_types/scrolled/package/contentElements-server.js
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
import 'pageflow-scrolled/contentElements-frontend';
import 'pageflow-scrolled/contentElements/hotspots-frontend';
import 'pageflow-scrolled/contentElements/tikTokEmbed-frontend';
2 changes: 2 additions & 0 deletions entry_types/scrolled/package/documentation.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ toc:
children:
- AudioPlayer
- ContentElementBox
- ContentElementFigure
- Figure
- FitViewport
- Image
Expand Down Expand Up @@ -57,6 +58,7 @@ toc:
children:
- normalizeSeed
- renderInEntry
- renderInContentElement
- renderHookInEntry
- name: Storybook Support
description: |
Expand Down
8 changes: 6 additions & 2 deletions entry_types/scrolled/package/jest.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,10 @@ module.exports = {
globals: {
...globals
},
setupFiles: ['<rootDir>/spec/support/matchMediaStub.js'],
setupFilesAfterEnv: ['<rootDir>/spec/support/fakeBrowserFeatures.js'],
setupFilesAfterEnv: [
'<rootDir>/spec/support/matchMediaStub.js',
'<rootDir>/spec/support/fakeBrowserFeatures.js'
],
modulePaths: ['<rootDir>/src', '<rootDir>/spec'],

testURL: 'https://story.example.com',
Expand All @@ -27,6 +29,8 @@ module.exports = {
},
transform: {
...transform,
'^.+/editor/.+/images/.+\\.svg$': '<rootDir>/spec/support/jest/image-transform',
'^.+/pictogram\\.svg$': '<rootDir>/spec/support/jest/image-transform',
'^.+\\.svg$': '<rootDir>/spec/support/jest/svg-transform'
}
};
Loading
Loading