Skip to content

Commit

Permalink
Added skeleton for experience slice
Browse files Browse the repository at this point in the history
  • Loading branch information
hunterbryant committed Jan 23, 2024
1 parent f64a184 commit 38dbf2a
Show file tree
Hide file tree
Showing 7 changed files with 253 additions and 1 deletion.
3 changes: 3 additions & 0 deletions customtypes/information/index.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,9 @@
"fieldset": "Slice Zone",
"config": {
"choices": {
"experience": {
"type": "SharedSlice"
},
"expertise": {
"type": "SharedSlice"
},
Expand Down
9 changes: 9 additions & 0 deletions src/lib/slices/Experience/index.svelte
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
<script lang="ts">
import type { Content } from '@prismicio/client';
export let slice: Content.ExperienceSlice;
</script>

<section data-slice-type={slice.slice_type} data-slice-variation={slice.variation}>
Placeholder component for {slice.slice_type} (variation: {slice.variation}) Slices
</section>
72 changes: 72 additions & 0 deletions src/lib/slices/Experience/mocks.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
[
{
"__TYPE__": "SharedSliceContent",
"variation": "default",
"primary": {},
"items": [
{
"__TYPE__": "GroupItemContent",
"value": [
[
"title",
{
"__TYPE__": "FieldContent",
"value": "particles",
"type": "Text"
}
],
[
"affiliation",
{
"__TYPE__": "LinkContent",
"value": {
"__TYPE__": "DocumentLink",
"id": "mock_document_id"
}
}
],
[
"url",
{
"__TYPE__": "LinkContent",
"value": {
"__TYPE__": "ExternalLink",
"url": "https://prismic.io"
}
}
],
[
"timeframe",
{
"__TYPE__": "FieldContent",
"value": "plan",
"type": "Text"
}
],
[
"caption",
{
"__TYPE__": "FieldContent",
"value": "lady",
"type": "Text"
}
],
[
"body",
{
"__TYPE__": "StructuredTextContent",
"value": [
{
"type": "paragraph",
"content": {
"text": "Est mollit anim et sunt Lorem minim incididunt consequat aliqua ipsum do enim anim."
}
}
]
}
]
]
}
]
}
]
67 changes: 67 additions & 0 deletions src/lib/slices/Experience/model.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
{
"id": "experience",
"type": "SharedSlice",
"name": "Experience",
"description": "Experience",
"variations": [
{
"id": "default",
"name": "Default",
"docURL": "...",
"version": "initial",
"description": "Default",
"imageUrl": "",
"primary": {},
"items": {
"title": {
"type": "Text",
"config": {
"label": "Title",
"placeholder": ""
}
},
"affiliation": {
"type": "Link",
"config": {
"label": "Affiliation",
"select": "document",
"customtypes": [
"affiliation"
]
}
},
"url": {
"type": "Link",
"config": {
"label": "URL",
"placeholder": "",
"select": null
}
},
"timeframe": {
"type": "Text",
"config": {
"label": "Timeframe",
"placeholder": ""
}
},
"caption": {
"type": "Text",
"config": {
"label": "Caption",
"placeholder": ""
}
},
"body": {
"type": "StructuredText",
"config": {
"label": "Body",
"placeholder": "",
"allowTargetBlank": true,
"single": "paragraph,preformatted,heading1,heading2,heading3,heading4,heading5,heading6,strong,em,hyperlink,image,embed,list-item,o-list-item,rtl"
}
}
}
}
]
}
Binary file added src/lib/slices/Experience/screenshot-default.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 2 additions & 0 deletions src/lib/slices/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

import ContentHighlight from './ContentHighlight/index.svelte';
import EmbedBlock from './EmbedBlock/index.svelte';
import Experience from './Experience/index.svelte';
import Expertise from './Expertise/index.svelte';
import ImageBlock from './ImageBlock/index.svelte';
import InfoEducationImage from './InfoEducationImage/index.svelte';
Expand All @@ -10,6 +11,7 @@ import TextBlock from './TextBlock/index.svelte';
export const components = {
content_highlight: ContentHighlight,
embed_block: EmbedBlock,
experience: Experience,
expertise: Expertise,
image_block: ImageBlock,
info_education_image: InfoEducationImage,
Expand Down
101 changes: 100 additions & 1 deletion src/prismicio-types.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -267,7 +267,10 @@ export type HomeDocument<Lang extends string = string> = prismic.PrismicDocument
Lang
>;

type InformationDocumentDataSlicesSlice = ExpertiseSlice | InfoEducationImageSlice;
type InformationDocumentDataSlicesSlice =
| ExperienceSlice
| ExpertiseSlice
| InfoEducationImageSlice;

/**
* Content for Info documents
Expand Down Expand Up @@ -473,6 +476,98 @@ type EmbedBlockSliceVariation = EmbedBlockSliceDefault;
*/
export type EmbedBlockSlice = prismic.SharedSlice<'embed_block', EmbedBlockSliceVariation>;

/**
* Primary content in *Experience → Items*
*/
export interface ExperienceSliceDefaultItem {
/**
* Title field in *Experience → Items*
*
* - **Field Type**: Text
* - **Placeholder**: *None*
* - **API ID Path**: experience.items[].title
* - **Documentation**: https://prismic.io/docs/field#key-text
*/
title: prismic.KeyTextField;

/**
* Affiliation field in *Experience → Items*
*
* - **Field Type**: Content Relationship
* - **Placeholder**: *None*
* - **API ID Path**: experience.items[].affiliation
* - **Documentation**: https://prismic.io/docs/field#link-content-relationship
*/
affiliation: prismic.ContentRelationshipField<'affiliation'>;

/**
* URL field in *Experience → Items*
*
* - **Field Type**: Link
* - **Placeholder**: *None*
* - **API ID Path**: experience.items[].url
* - **Documentation**: https://prismic.io/docs/field#link-content-relationship
*/
url: prismic.LinkField;

/**
* Timeframe field in *Experience → Items*
*
* - **Field Type**: Text
* - **Placeholder**: *None*
* - **API ID Path**: experience.items[].timeframe
* - **Documentation**: https://prismic.io/docs/field#key-text
*/
timeframe: prismic.KeyTextField;

/**
* Caption field in *Experience → Items*
*
* - **Field Type**: Text
* - **Placeholder**: *None*
* - **API ID Path**: experience.items[].caption
* - **Documentation**: https://prismic.io/docs/field#key-text
*/
caption: prismic.KeyTextField;

/**
* Body field in *Experience → Items*
*
* - **Field Type**: Rich Text
* - **Placeholder**: *None*
* - **API ID Path**: experience.items[].body
* - **Documentation**: https://prismic.io/docs/field#rich-text-title
*/
body: prismic.RichTextField;
}

/**
* Default variation for Experience Slice
*
* - **API ID**: `default`
* - **Description**: Default
* - **Documentation**: https://prismic.io/docs/slice
*/
export type ExperienceSliceDefault = prismic.SharedSliceVariation<
'default',
Record<string, never>,
Simplify<ExperienceSliceDefaultItem>
>;

/**
* Slice variation for *Experience*
*/
type ExperienceSliceVariation = ExperienceSliceDefault;

/**
* Experience Shared Slice
*
* - **API ID**: `experience`
* - **Description**: Experience
* - **Documentation**: https://prismic.io/docs/slice
*/
export type ExperienceSlice = prismic.SharedSlice<'experience', ExperienceSliceVariation>;

/**
* Primary content in *Expertise → Items*
*/
Expand Down Expand Up @@ -765,6 +860,10 @@ declare module '@prismicio/client' {
EmbedBlockSliceDefaultPrimary,
EmbedBlockSliceVariation,
EmbedBlockSliceDefault,
ExperienceSlice,
ExperienceSliceDefaultItem,
ExperienceSliceVariation,
ExperienceSliceDefault,
ExpertiseSlice,
ExpertiseSliceDefaultItem,
ExpertiseSliceVariation,
Expand Down

0 comments on commit 38dbf2a

Please sign in to comment.