Skip to content

Commit

Permalink
chore: change stock page -d
Browse files Browse the repository at this point in the history
  • Loading branch information
arpowers committed Sep 9, 2024
1 parent dc6fb88 commit 51f2d06
Show file tree
Hide file tree
Showing 18 changed files with 46 additions and 37 deletions.
2 changes: 1 addition & 1 deletion @fiction/cards/gallery/index.ts
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
import { vue } from '@fiction/core'
import { CardTemplate } from '@fiction/site'
import { InputOption } from '@fiction/ui'
import { stockMediaHandler } from '@fiction/ui/stock/index.js'
import { z } from 'zod'
import type { SiteUserConfig } from '@fiction/site/schema'
import { standardOption } from '../inputSets'
import { stockMediaHandler } from '../stock/index.js'

const templateId = 'gallery'

Expand Down
2 changes: 1 addition & 1 deletion @fiction/cards/hero/index.ts
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
import { colorTheme, vue } from '@fiction/core'
import { CardTemplate } from '@fiction/site'
import { InputOption } from '@fiction/ui'
import { stockMediaHandler } from '@fiction/ui/stock/index.js'
import { z } from 'zod'
import { standardOption } from '../inputSets'
import { XButtonSchema } from '../schemaSets.js'
import { stockMediaHandler } from '../stock/index.js'

const templateId = 'hero'

Expand Down
2 changes: 1 addition & 1 deletion @fiction/cards/hitlist/index.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import { vue } from '@fiction/core'
import { CardTemplate } from '@fiction/site'
import { InputOption } from '@fiction/ui'
import { stockMediaHandler } from '@fiction/ui/stock/index.js'
import { z } from 'zod'
import { stockMediaHandler } from '../stock/index.js'

const templateId = 'hitlist'

Expand Down
2 changes: 1 addition & 1 deletion @fiction/cards/magazine/index.ts
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
import { PostHandlingSchema, safeDirname, vue } from '@fiction/core'
import { CardTemplate } from '@fiction/site'
import { InputOption } from '@fiction/ui'
import { stockMediaHandler } from '@fiction/ui/stock/index.js'
import { z } from 'zod'
import type { Site } from '@fiction/site'
import type { SiteUserConfig } from '@fiction/site/schema'
import { stockMediaHandler } from '../stock/index.js'

const templateId = 'magazine'

Expand Down
4 changes: 2 additions & 2 deletions @fiction/cards/marquee/index.ts
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
import { vue } from '@fiction/core'
import { CardTemplate } from '@fiction/site'
import { InputOption } from '@fiction/ui'
import { stockMediaHandler } from '@fiction/ui/stock/index.js'
import { z } from 'zod'
import type { MediaItem } from '@fiction/core'
import type { Tag } from '@fiction/ui/stock/index.js'
import { standardOption } from '../inputSets'
import { stockMediaHandler } from '../stock/index.js'
import type { Tag } from '../stock/index.js'

const el = vue.defineAsyncComponent(async () => import('./ElMarquee.vue'))

Expand Down
2 changes: 1 addition & 1 deletion @fiction/cards/overSlide/index.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import { vue } from '@fiction/core'
import { CardTemplate } from '@fiction/site'
import { InputOption } from '@fiction/ui'
import { stockMediaHandler } from '@fiction/ui/stock/index.js'
import { z } from 'zod'
import { mediaSchema } from '../schemaSets.js'
import { stockMediaHandler } from '../stock/index.js'

const templateId = 'overSlide'

Expand Down
2 changes: 1 addition & 1 deletion @fiction/cards/people/index.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import { vue } from '@fiction/core'
import { CardTemplate } from '@fiction/site'
import { InputOption } from '@fiction/ui'
import { stockMediaHandler } from '@fiction/ui/stock/index.js'
import { z } from 'zod'
import { stockMediaHandler } from '../stock/index.js'

const templateId = 'people'

Expand Down
2 changes: 1 addition & 1 deletion @fiction/cards/profile/index.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import { vue } from '@fiction/core'
import { CardTemplate } from '@fiction/site/card'
import { InputOption } from '@fiction/ui'
import { stockMediaHandler } from '@fiction/ui/stock/index.js'
import { z } from 'zod'
import { standardOption } from '../inputSets'
import { stockMediaHandler } from '../stock/index.js'

export const schema = z.object({
heading: z.string().optional().describe('Primary headline for profile 3 to 8 words'),
Expand Down
2 changes: 1 addition & 1 deletion @fiction/cards/showcase/index.ts
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
import { vue } from '@fiction/core'
import { CardTemplate } from '@fiction/site'
import { InputOption } from '@fiction/ui'
import { stockMediaHandler } from '@fiction/ui/stock/index.js'
import { z } from 'zod'
import type { PostItem } from '@fiction/core'
import { standardOption } from '../inputSets'
import { stockMediaHandler } from '../stock/index.js'

const el = vue.defineAsyncComponent(async () => import('./ElShowcase.vue'))
const aspects = ['square', 'tall', 'wide', 'golden', 'portrait', 'landscape', 'cinema'] as const
Expand Down
2 changes: 1 addition & 1 deletion @fiction/cards/statement/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,12 @@ import { ActionButtonSchema, vue } from '@fiction/core'
import { CardTemplate } from '@fiction/site'
import { CardFactory } from '@fiction/site/cardFactory'
import { InputOption } from '@fiction/ui'
import { stockMediaHandler } from '@fiction/ui/stock/index.js'
import { z } from 'zod'
import type { Site, TableCardConfig } from '@fiction/site'
import type { SiteUserConfig } from '@fiction/site/schema'
import { getCardTemplates } from '../index.js'
import { standardOption } from '../inputSets'
import { stockMediaHandler } from '../stock/index.js'

const templateId = 'statement'

Expand Down
2 changes: 1 addition & 1 deletion @fiction/cards/story/index.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import { vue } from '@fiction/core'
import { CardTemplate } from '@fiction/site'
import { InputOption } from '@fiction/ui'
import { stockMediaHandler } from '@fiction/ui/stock/index.js'
import { z } from 'zod'
import type { Site } from '@fiction/site'
import { stockMediaHandler } from '../stock/index.js'

const templateId = 'story'

Expand Down
2 changes: 1 addition & 1 deletion @fiction/cards/testimonials/index.ts
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
import { vue } from '@fiction/core'
import { CardTemplate } from '@fiction/site'
import { InputOption } from '@fiction/ui'
import { stockMediaHandler } from '@fiction/ui/stock/index.js'
import { z } from 'zod'
import type { SiteUserConfig } from '@fiction/site/schema'
import { standardOption } from '../inputSets'
import { stockMediaHandler } from '../stock/index.js'

const templateId = 'testimonials'

Expand Down
2 changes: 1 addition & 1 deletion @fiction/cards/tour/index.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import { vue } from '@fiction/core'
import { CardTemplate } from '@fiction/site'
import { InputOption } from '@fiction/ui'
import { stockMediaHandler } from '@fiction/ui/stock/index.js'
import { z } from 'zod'
import { options as heroOptions, schema as heroSchema } from '../hero/index'
import { stockMediaHandler } from '../stock/index.js'

const templateId = 'tour'

Expand Down
2 changes: 1 addition & 1 deletion @fiction/cards/trek/index.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import { vue } from '@fiction/core'
import { CardTemplate } from '@fiction/site'
import { InputOption } from '@fiction/ui'
import { stockMediaHandler } from '@fiction/ui/stock/index.js'
import { z } from 'zod'
import { stockMediaHandler } from '../stock/index.js'

const templateId = 'trek'

Expand Down
2 changes: 1 addition & 1 deletion @fiction/themes/fiction/home/index.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { stockMediaHandler } from '@fiction/cards/stock/index.js'
import { createCard } from '@fiction/site/theme.js'
import { staticFileUrls } from '@fiction/site/utils/site.js'
import { stockMediaHandler } from '@fiction/ui/stock/index.js'
import type { Site } from '@fiction/site/site.js'
import { templates } from '../templates.js'
import andrew from './img/andrew.jpg'
Expand Down
2 changes: 1 addition & 1 deletion @fiction/themes/minimal/index.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import { getCardTemplates } from '@fiction/cards/index.js'
import { stockMediaHandler } from '@fiction/cards/stock/index.js'
import { safeDirname } from '@fiction/core'
import { CardFactory } from '@fiction/site/cardFactory.js'
import { Theme } from '@fiction/site/theme.js'
import { stockMediaHandler } from '@fiction/ui/stock/index.js'
import type { FictionEnv } from '@fiction/core'
import type { Site } from '@fiction/site/site.js'

Expand Down
45 changes: 27 additions & 18 deletions @fiction/ui/media/XMediaInline.vue
Original file line number Diff line number Diff line change
Expand Up @@ -22,22 +22,29 @@ const emit = defineEmits<{
}>()
const mediaFormat = vue.computed(() => {
if (props.media.format) return props.media.format
if (props.media.format)
return props.media.format
if (props.media.url) {
const extension = props.media.url.split('.').pop()?.toLowerCase()
if (extension && ['mp4', 'webm', 'ogg'].includes(extension)) return 'video'
if (extension && ['mp4', 'webm', 'ogg'].includes(extension))
return 'video'
return 'image'
}
if (props.media.html) return 'html'
if (props.media.typography) return 'typography'
if (props.media.iconId) return 'iconId'
if (props.media.el) return 'component'
if (props.media.html)
return 'html'
if (props.media.typography)
return 'typography'
if (props.media.iconId)
return 'iconId'
if (props.media.el)
return 'component'
return 'url'
})
const typographyStyle = vue.computed(() => {
const typography = props.media.typography
if (!typography) return {}
if (!typography)
return {}
return {
fontFamily: typography.font,
fontWeight: typography.weight,
Expand All @@ -57,9 +64,11 @@ const containerClass = vue.computed(() => {
if (props.alignment === 'left') {
classes.push('justify-start')
} else if (props.alignment === 'center') {
}
else if (props.alignment === 'center') {
classes.push('justify-center')
} else if (props.alignment === 'right') {
}
else if (props.alignment === 'right') {
classes.push('justify-end')
}
Expand Down Expand Up @@ -94,9 +103,11 @@ const htmlWrapperClass = vue.computed(() => {
if (props.alignment === 'left') {
classes.push('justify-start')
} else if (props.alignment === 'center') {
}
else if (props.alignment === 'center') {
classes.push('justify-center')
} else if (props.alignment === 'right') {
}
else if (props.alignment === 'right') {
classes.push('justify-end')
}
Expand All @@ -105,21 +116,19 @@ const htmlWrapperClass = vue.computed(() => {
return classes
})
const iconStyling = vue.computed(() => {
let maskPosition = 'center'
if (props.alignment === 'left') {
maskPosition = 'left'
} else if (props.alignment === 'right') {
}
else if (props.alignment === 'right') {
maskPosition = 'right'
}
return {
classes: ['w-full h-full'],
style: { maskPosition, }
classes: ['w-full h-full'],
style: { maskPosition },
}
})
</script>
Expand Down Expand Up @@ -169,7 +178,7 @@ const iconStyling = vue.computed(() => {
</video>
</template>

<template v-else-if="mediaFormat === 'component'" class="">
<template v-else-if="mediaFormat === 'component'">
<component
:is="media.el"
v-bind="media"
Expand Down
4 changes: 2 additions & 2 deletions scripts/cloudinaryUrls.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import { fileURLToPath } from 'node:url'
import { v2 as cloudinary } from 'cloudinary'
import dotenv from 'dotenv'
import fetch from 'node-fetch'
import { tagSet } from '../@fiction/cards/stock/tags.js'
import { tagSet } from '../@fiction/ui/stock/tags.js'

const __dirname = path.dirname(fileURLToPath(import.meta.url))

Expand Down Expand Up @@ -34,7 +34,7 @@ type MediaItem = {
slug: string
}

function flattenTagSet(tagSet: typeof import('../@fiction/cards/stock/tags.js').tagSet): string[] {
function flattenTagSet(tagSet: typeof import('../@fiction/ui/stock/tags.js').tagSet): string[] {
return Object.values(tagSet).flat()
}

Expand Down

0 comments on commit 51f2d06

Please sign in to comment.