+ {isLivePreviewing && (
+ <>
+
Custom live preview being rendered
+
+ >
+ )}
+
+ )
+}
diff --git a/test/live-preview/components/styles.css b/test/live-preview/components/styles.css
new file mode 100644
index 000000000..0089516a0
--- /dev/null
+++ b/test/live-preview/components/styles.css
@@ -0,0 +1,13 @@
+.custom-live-preview {
+ width: 80%;
+ display: none;
+ overflow: hidden;
+
+ &.custom-live-preview--is-live-previewing {
+ display: block;
+ }
+
+ .live-preview-window {
+ width: 100%;
+ }
+}
diff --git a/test/live-preview/config.ts b/test/live-preview/config.ts
index 106343fc9..6631fd91a 100644
--- a/test/live-preview/config.ts
+++ b/test/live-preview/config.ts
@@ -6,6 +6,7 @@ import { buildConfigWithDefaults } from '../buildConfigWithDefaults.js'
import { MediaBlock } from './blocks/MediaBlock/index.js'
import { Categories } from './collections/Categories.js'
import { CollectionLevelConfig } from './collections/CollectionLevelConfig.js'
+import { CustomLivePreview } from './collections/CustomLivePreview.js'
import { Media } from './collections/Media.js'
import { NoURLCollection } from './collections/NoURL.js'
import { Pages } from './collections/Pages.js'
@@ -19,6 +20,7 @@ import { Footer } from './globals/Footer.js'
import { Header } from './globals/Header.js'
import { seed } from './seed/index.js'
import {
+ customLivePreviewSlug,
desktopBreakpoint,
mobileBreakpoint,
pagesSlug,
@@ -42,7 +44,13 @@ export default buildConfigWithDefaults({
// The Live Preview config cascades from the top down, properties are inherited from here
url: formatLivePreviewURL,
breakpoints: [mobileBreakpoint, desktopBreakpoint],
- collections: [pagesSlug, postsSlug, ssrPagesSlug, ssrAutosavePagesSlug],
+ collections: [
+ pagesSlug,
+ postsSlug,
+ ssrPagesSlug,
+ ssrAutosavePagesSlug,
+ customLivePreviewSlug,
+ ],
globals: ['header', 'footer'],
},
},
@@ -59,6 +67,7 @@ export default buildConfigWithDefaults({
Media,
CollectionLevelConfig,
StaticURLCollection,
+ CustomLivePreview,
NoURLCollection,
],
globals: [Header, Footer],
diff --git a/test/live-preview/e2e.spec.ts b/test/live-preview/e2e.spec.ts
index b05f5954b..a913ff82d 100644
--- a/test/live-preview/e2e.spec.ts
+++ b/test/live-preview/e2e.spec.ts
@@ -36,6 +36,7 @@ import {
} from './helpers.js'
import {
collectionLevelConfigSlug,
+ customLivePreviewSlug,
desktopBreakpoint,
mobileBreakpoint,
pagesSlug,
@@ -58,6 +59,7 @@ describe('Live Preview', () => {
let postsURLUtil: AdminUrlUtil
let ssrPagesURLUtil: AdminUrlUtil
let ssrAutosavePagesURLUtil: AdminUrlUtil
+ let customLivePreviewURLUtil: AdminUrlUtil
let payload: PayloadTestSDK