-
Notifications
You must be signed in to change notification settings - Fork 0
feat: add address slot #794
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
Merged
Merged
Changes from all commits
Commits
Show all changes
33 commits
Select commit
Hold shift + click to select a range
c422df4
add address slot
asanehisa 314fd35
docs: auto-generate component documentation
github-actions[bot] be2f28b
Update component screenshots for visual-editor
github-actions[bot] bec3f2d
update gap
asanehisa 6554951
update hasCoreInfo
asanehisa dfe8f3b
Update component screenshots for visual-editor
github-actions[bot] 12ed569
adjust hasCoreInfo bool
asanehisa e4c4baa
Update component screenshots for visual-editor
github-actions[bot] 40e30ca
adjust to usePuck
asanehisa 7faf476
Merge branch 'address-slot' of https://github.com/yext/visual-editor …
asanehisa 8901d5f
adjust again
asanehisa ffe7a1a
Update component screenshots for visual-editor
github-actions[bot] 6c6e6ca
Merge branch 'fall-2025-slot-ify-components' into address-slot
asanehisa 1968e28
use resolveData on live page
asanehisa 7fe25d9
docs: auto-generate component documentation
github-actions[bot] 75445d5
clean up
asanehisa 3146ecf
clean
asanehisa 804b553
Update component screenshots for visual-editor
github-actions[bot] 80c22b9
add metadata to screenshot test
asanehisa 84225eb
Update component screenshots for visual-editor
github-actions[bot] 92908a5
add locale to document in test
asanehisa 4e8e711
Update component screenshots for visual-editor
github-actions[bot] 71f5b72
manually delete 3 screenshots
asanehisa f03f44c
add resolveAllData
asanehisa 1a213bf
Update component screenshots for visual-editor
github-actions[bot] 9b6f341
Merge branch 'fall-2025-slot-ify-components' into address-slot
asanehisa 5bb162a
merge + adjust resolveAllData
asanehisa 6d4277d
Update component screenshots for visual-editor
github-actions[bot] bc77098
Update component screenshots for visual-editor
github-actions[bot] 5d4e23a
Update component screenshots for visual-editor
github-actions[bot] 4ee6705
Update component screenshots for visual-editor
github-actions[bot] a702237
address comments
asanehisa 730154b
Update component screenshots for visual-editor
github-actions[bot] File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
119 changes: 119 additions & 0 deletions
119
packages/visual-editor/src/components/migrations/0024_core_info_section_slots.ts
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,119 @@ | ||
| import { Migration } from "@yext/visual-editor"; | ||
|
|
||
| export const coreInfoSectionSlots: Migration = { | ||
| CoreInfoSection: { | ||
| action: "updated", | ||
| propTransformation: (props) => { | ||
| const infoHeadingText = props.data.info.headingText ?? { | ||
| constantValue: { | ||
| en: "Information", | ||
| hasLocalizedValue: "true", | ||
| }, | ||
| constantValueEnabled: true, | ||
| field: "", | ||
| }; | ||
| const hoursHeadingText = props.data.hours.headingText ?? { | ||
| constantValue: { | ||
| en: "Hours", | ||
| hasLocalizedValue: "true", | ||
| }, | ||
| constantValueEnabled: true, | ||
| field: "", | ||
| }; | ||
| const servicesHeadingText = props.data.services.headingText ?? { | ||
| constantValue: { | ||
| en: "Services", | ||
| hasLocalizedValue: "true", | ||
| }, | ||
| constantValueEnabled: true, | ||
| field: "", | ||
| }; | ||
| const headingLevel = props.styles.heading?.level ?? 3; | ||
| const headingAlign = props.styles.heading?.align ?? "left"; | ||
|
|
||
| const address = props.data.info.address ?? { | ||
| constantValue: { | ||
| line1: "", | ||
| city: "", | ||
| postalCode: "", | ||
| countryCode: "", | ||
| }, | ||
| field: "address", | ||
| }; | ||
| const addressStyles = { | ||
| showGetDirectionsLink: props.styles.info.showGetDirectionsLink ?? true, | ||
| ctaVariant: props.styles.info.ctaVariant, | ||
| }; | ||
|
|
||
| // Clean up old props | ||
| delete props.data.info.headingText; | ||
| delete props.data.hours.headingText; | ||
| delete props.data.services.headingText; | ||
| delete props.data.info.address; | ||
| delete props.styles.heading; | ||
| delete props.styles.info.showGetDirectionsLink; | ||
| delete props.styles.info.ctaVariant; | ||
|
|
||
| return { | ||
| ...props, | ||
| slots: { | ||
| CoreInfoHeadingSlot: [ | ||
| { | ||
| type: "HeadingTextSlot", | ||
| props: { | ||
| data: { | ||
| text: infoHeadingText, | ||
| }, | ||
| styles: { | ||
| level: headingLevel, | ||
| align: headingAlign, | ||
| }, | ||
| }, | ||
| }, | ||
| ], | ||
| CoreInfoAddressSlot: [ | ||
| { | ||
| type: "AddressSlot", | ||
| props: { | ||
| data: { | ||
| address: address, | ||
| }, | ||
| styles: { | ||
| ...addressStyles, | ||
| }, | ||
| }, | ||
| }, | ||
| ], | ||
| HoursHeadingSlot: [ | ||
| { | ||
| type: "HeadingTextSlot", | ||
| props: { | ||
| data: { | ||
| text: hoursHeadingText, | ||
| }, | ||
| styles: { | ||
| level: headingLevel, | ||
| align: headingAlign, | ||
| }, | ||
| }, | ||
| }, | ||
| ], | ||
| ServicesHeadingSlot: [ | ||
| { | ||
| type: "HeadingTextSlot", | ||
| props: { | ||
| data: { | ||
| text: servicesHeadingText, | ||
| }, | ||
| styles: { | ||
| level: headingLevel, | ||
| align: headingAlign, | ||
| }, | ||
| }, | ||
| }, | ||
| ], | ||
| }, | ||
| }; | ||
| }, | ||
| }, | ||
| }; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.