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

[sitecore-jss-react] [Editing Integration] Add support for chrome hydration for Placeholders #1776

Merged
Show file tree
Hide file tree
Changes from 37 commits
Commits
Show all changes
41 commits
Select commit Hold shift + click to select a range
d933925
conditinally emit edit chromes metadata for placeholders, rendering
addy-pathania Apr 17, 2024
24c36ee
refactor PlaceholderWithMetadata component
addy-pathania Apr 18, 2024
89d366c
update tests
addy-pathania Apr 18, 2024
fc6f25f
update changelog
addy-pathania Apr 18, 2024
983ace9
remove extra lines
addy-pathania Apr 18, 2024
d89ca37
remove editMode mock data
addy-pathania Apr 19, 2024
fd60d80
update unit test, change code tag chrometype
addy-pathania Apr 19, 2024
e9ae072
remove only
addy-pathania Apr 19, 2024
12e4926
refactor as per new requirements
addy-pathania Apr 22, 2024
9973138
Update packages/sitecore-jss/src/layout/models.ts
addy-pathania Apr 22, 2024
6449ec7
Update packages/sitecore-jss-react/src/components/PlaceholderMetadata…
addy-pathania Apr 22, 2024
57da890
Update packages/sitecore-jss-react/src/components/PlaceholderMetadata…
addy-pathania Apr 22, 2024
1ef2054
Update packages/sitecore-jss-react/src/components/PlaceholderMetadata…
addy-pathania Apr 22, 2024
504d5fd
Update CHANGELOG.md
addy-pathania Apr 22, 2024
bbb9efc
refactor unit test
addy-pathania Apr 22, 2024
db130e3
Merge branch 'feature/jss-1828-editing-integration-placeholder' of gi…
addy-pathania Apr 22, 2024
472328b
change naming of props and types
addy-pathania Apr 22, 2024
de00777
add test for placeholder
addy-pathania Apr 23, 2024
109e156
update PlaceholderMetadata to render a component
addy-pathania Apr 23, 2024
a81bb95
add test for missing component
addy-pathania Apr 24, 2024
b1a0c9e
merge with feature branch
addy-pathania Apr 24, 2024
c352fb3
merge with feature branch
addy-pathania Apr 24, 2024
8ca899a
fix nextjs placeholder
addy-pathania Apr 24, 2024
5b2a8af
remove context
addy-pathania Apr 24, 2024
934fe6e
reset nextjs placeholder
addy-pathania Apr 24, 2024
6a86756
update changelog
addy-pathania Apr 25, 2024
ee494c1
update test data
addy-pathania Apr 25, 2024
2a15ac2
change PlaceholderMetadata implmentation
addy-pathania Apr 29, 2024
364546f
Placeholder metadata refactor - wip
yavorsk Apr 29, 2024
7b9d42d
update tests, refactor Placeholder component
addy-pathania Apr 29, 2024
e1e6330
remove redundant data
addy-pathania Apr 30, 2024
a77fae6
update unit test - wip
yavorsk Apr 30, 2024
baa8ff8
move tests to placeholder, refactor placeholder
addy-pathania Apr 30, 2024
3a3d157
refactor tests
addy-pathania Apr 30, 2024
6343d4e
refactor placeholdermetadata component, update tests
addy-pathania May 1, 2024
b57941c
refactor placeholder tests, update jsdoc
addy-pathania May 1, 2024
ac4d813
update nextjs types
addy-pathania May 1, 2024
3c3b086
remove keys from code
addy-pathania May 2, 2024
1c25b89
fix nextjs placeholder props
addy-pathania May 3, 2024
5ad9d0e
change deprecated statement
addy-pathania May 3, 2024
25bf498
update deprecated 2
addy-pathania May 3, 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
5 changes: 4 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,10 @@ Our versioning strategy is as follows:
## Unreleased

### 🎉 New Features & Improvements
* `[sitecore-jss-react]` `[sitecore-jss-nextjs]` Introduce FieldMetadata component and functionality to render it when metadata field property is provided in the field's layout data. In such case the field component is wrapped with metadata markup to enable chromes hydration when editing in pages. Ability to render metadata has been added to the field rendering components for react and nextjs. ([#1773](https://github.com/Sitecore/jss/pull/1773))
* Editing Integration Support:
* `[sitecore-jss-react]` `[sitecore-jss]` Introduces `PlaceholderMetadata` component which supports the hydration of chromes on Pages by rendering the components and placeholders with required metadata. ([#1776](https://github.com/Sitecore/jss/pull/1776))
* Chromes are hydrated based on the basis of new `editMode` property derived from LayoutData, which is defined as an enum consisting of `metadata` and `chromes`.
* `[sitecore-jss-react]` `[sitecore-jss-nextjs]` Introduce FieldMetadata component and functionality to render it when metadata field property is provided in the field's layout data. In such case the field component is wrapped with metadata markup to enable chromes hydration when editing in pages. Ability to render metadata has been added to the field rendering components for react and nextjs. ([#1773](https://github.com/Sitecore/jss/pull/1773))

### 🛠 Breaking Changes

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ export const Placeholder = (props: PlaceholderComponentProps) => {
return (
<ReactPlaceholder
{...props}
modifyComponentProps={(initialProps) => {
modifyComponentProps={(initialProps: { rendering: { uid: string | number } }) => {
addy-pathania marked this conversation as resolved.
Show resolved Hide resolved
if (!initialProps.rendering.uid) return initialProps;

const data = componentPropsContext[initialProps.rendering.uid] as {
Expand Down
1 change: 1 addition & 0 deletions packages/sitecore-jss-nextjs/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ export {
EDITING_COMPONENT_PLACEHOLDER,
EDITING_COMPONENT_ID,
getContentStylesheetLink,
EditMode,
} from '@sitecore-jss/sitecore-jss/layout';
export { mediaApi } from '@sitecore-jss/sitecore-jss/media';
export {
Expand Down
Loading