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

docs(examples): refresh cms-prismic example #40121

Merged
merged 20 commits into from
Oct 1, 2022
Merged
Show file tree
Hide file tree
Changes from 15 commits
Commits
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
3 changes: 0 additions & 3 deletions examples/cms-prismic/.env.local.example

This file was deleted.

Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
{
"id": "mock-doc-id",
"url": null,
"type": "author",
"href": null,
"tags": [],
"first_publication_date": "1970-01-01T00:00:01+0000",
"last_publication_date": "1970-01-01T00:00:01+0000",
"slugs": [],
"linked_documents": [],
"lang": "en-us",
"alternate_languages": [],
"data": {
"name": [
{
"type": "heading1",
"text": "Border",
"spans": []
}
],
"picture": {
"dimensions": {
"width": 900,
"height": 500
},
"alt": null,
"copyright": null,
"url": "https://images.unsplash.com/photo-1587614295999-6c1c13675117"
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
{
"id": "mock-doc-id",
"url": null,
"type": "post",
"href": null,
"tags": [],
"first_publication_date": "1970-01-01T00:00:01+0000",
"last_publication_date": "1970-01-01T00:00:01+0000",
"slugs": [],
"linked_documents": [],
"lang": "en-us",
"alternate_languages": [],
"data": {
"title": [
{
"type": "heading1",
"text": "Shine",
"spans": []
}
],
"date": "2014-07-30",
"author": {
"id": "mock_document_id",
"link_type": "Document",
"type": "author",
"tags": [],
"lang": "en-us",
"slug": null,
"first_publication_date": "1970-01-01T00:00:01+0000",
"last_publication_date": "1970-01-01T01:00:00+0000"
},
"excerpt": "knew",
"cover_image": {
"dimensions": {
"width": 900,
"height": 500
},
"alt": null,
"copyright": null,
"url": "https://images.unsplash.com/photo-1587614295999-6c1c13675117"
},
"slices": []
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
import MyComponent from '../../../../slices/Image'

export default {
title: 'slices/Image',
}

export const _Default = () => (
<MyComponent
slice={{
variation: 'default',
version: 'sktwi1xtmkfgx8626',
items: [{}],
primary: {
image: {
dimensions: { width: 900, height: 500 },
alt: null,
copyright: null,
url: 'https://images.unsplash.com/photo-1607582278043-57198ac8da43',
},
},
slice_type: 'image',
id: '_Default',
}}
/>
)
_Default.storyName = ''
19 changes: 19 additions & 0 deletions examples/cms-prismic/.slicemachine/assets/slices/Image/mocks.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
[
{
"variation": "default",
"version": "sktwi1xtmkfgx8626",
"items": [{}],
"primary": {
"image": {
"dimensions": {
"width": 900,
"height": 500
},
"alt": null,
"copyright": null,
"url": "https://images.unsplash.com/photo-1607582278043-57198ac8da43"
}
},
"slice_type": "image"
}
]
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
import MyComponent from '../../../../slices/Text'

export default {
title: 'slices/Text',
}

export const _Default = () => (
<MyComponent
slice={{
variation: 'default',
version: 'sktwi1xtmkfgx8626',
items: [{}],
primary: {
text: [
{
type: 'paragraph',
text: 'Nostrud minim fugiat deserunt velit cupidatat pariatur consequat sunt officia eiusmod.',
spans: [],
},
],
},
slice_type: 'text',
id: '_Default',
}}
/>
)
_Default.storyName = ''
17 changes: 17 additions & 0 deletions examples/cms-prismic/.slicemachine/assets/slices/Text/mocks.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
[
{
"variation": "default",
"version": "sktwi1xtmkfgx8626",
"items": [{}],
"primary": {
"text": [
{
"type": "paragraph",
"text": "Nostrud minim fugiat deserunt velit cupidatat pariatur consequat sunt officia eiusmod.",
"spans": []
}
]
},
"slice_type": "text"
}
]
119 changes: 119 additions & 0 deletions examples/cms-prismic/.slicemachine/libraries-state.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,119 @@
{
"slices": {
"components": {
"image": {
"library": "slices",
"id": "image",
"name": "Image",
"description": "Image",
"model": {
"id": "image",
"type": "SharedSlice",
"name": "Image",
"description": "Image",
"variations": [
{
"id": "default",
"name": "Default",
"docURL": "...",
"version": "sktwi1xtmkfgx8626",
"description": "Image",
"primary": {
"image": {
"type": "Image",
"config": {
"label": "Image",
"constraint": {},
"thumbnails": []
}
}
},
"items": {},
"imageUrl": "https://images.prismic.io/slice-machine/621a5ec4-0387-4bc5-9860-2dd46cbc07cd_default_ss.png?auto=compress,format"
}
]
},
"mocks": {
"default": {
"variation": "default",
"version": "sktwi1xtmkfgx8626",
"items": [{}],
"primary": {
"image": {
"dimensions": {
"width": 900,
"height": 500
},
"alt": null,
"copyright": null,
"url": "https://images.unsplash.com/photo-1607582278043-57198ac8da43"
}
},
"slice_type": "image"
}
},
"meta": {
"fileName": "index",
"extension": "js"
},
"screenshotPaths": {}
},
"text": {
"library": "slices",
"id": "text",
"name": "Text",
"description": "Text",
"model": {
"id": "text",
"type": "SharedSlice",
"name": "Text",
"description": "Text",
"variations": [
{
"id": "default",
"name": "Default",
"docURL": "...",
"version": "sktwi1xtmkfgx8626",
"description": "Text",
"primary": {
"text": {
"type": "StructuredText",
"config": {
"label": "Text",
"placeholder": "Rich text with formatting",
"allowTargetBlank": true,
"multi": "paragraph,preformatted,heading1,heading2,heading3,heading4,heading5,heading6,strong,em,hyperlink,image,embed,list-item,o-list-item,rtl"
}
}
},
"items": {},
"imageUrl": "https://images.prismic.io/slice-machine/621a5ec4-0387-4bc5-9860-2dd46cbc07cd_default_ss.png?auto=compress,format"
}
]
},
"mocks": {
"default": {
"variation": "default",
"version": "sktwi1xtmkfgx8626",
"items": [{}],
"primary": {
"text": [
{
"type": "paragraph",
"text": "Nostrud minim fugiat deserunt velit cupidatat pariatur consequat sunt officia eiusmod.",
"spans": []
}
]
},
"slice_type": "text"
}
},
"meta": {
"fileName": "index",
"extension": "js"
},
"screenshotPaths": {}
}
}
}
}
39 changes: 39 additions & 0 deletions examples/cms-prismic/.slicemachine/mock-config.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
{
"_cts": {
"author": {
"name": {
"config": {
"patternType": "HEADING",
"blocks": 1
}
}
},
"post": {
"title": {
"config": {
"patternType": "HEADING",
"blocks": 1
}
}
}
},
"slices": {
"Text": {
"default": {
"primary": {
"text": {
"config": {
"patternType": "PARAGRAPH",
"blocks": 1
}
}
}
}
},
"Image": {
"default": {
"primary": {}
}
}
}
}
Loading