Skip to content

Commit 4841b69

Browse files
committed
wip: rfct
1 parent a9e4bdd commit 4841b69

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

43 files changed

+1834
-2096
lines changed

@fiction/admin/dashboard/DashWrap.vue

-6
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@ import ElClose from '@fiction/ui/common/ElClose.vue'
99
import ElSpinner from '@fiction/ui/loaders/ElSpinner.vue'
1010
import El404 from '@fiction/ui/page/El404.vue'
1111
import DashBar from './DashBar.vue'
12-
import DashDarkModeToggle from './DashDarkModeToggle.vue'
1312
import DashNav from './DashNav.vue'
1413
1514
export type UserConfig = {
@@ -101,11 +100,6 @@ const accountMenu: vue.ComputedRef<IndexItem[]> = vue.computed(() => {
101100
href: card.link({ path: '/settings/account' }),
102101
icon: 'i-tabler-user-cog',
103102
},
104-
{
105-
label: 'Dark/Light Mode',
106-
icon: card.site?.isLightMode ? 'i-tabler-sun' : 'i-tabler-moon-stars',
107-
figure: { el: DashDarkModeToggle },
108-
},
109103
{
110104
label: 'Sign Out',
111105
icon: 'i-tabler-logout',

@fiction/admin/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
"@types/mapbox-gl": "^3.4.1",
1212
"@vueuse/core": "^12.8.2",
1313
"animejs": "^3.2.2",
14-
"mapbox-gl": "^3.10.0",
14+
"mapbox-gl": "^3.11.0",
1515
"tailwindcss": "^3.4.17",
1616
"vue": "^3.5.13"
1717
},

@fiction/admin/theme/index.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import type { template as TransactionTemplate } from '@fiction/cards/page/transaction/index.js'
22
import type { CardFactory } from '@fiction/site/cardFactory.js'
3-
import type { SiteGlobalUserConfig, StandardUserConfig } from '@fiction/site/schema.js'
3+
import type { SiteGlobalUserConfig } from '@fiction/site/schema.js'
44
import type { Site } from '@fiction/site/site.js'
55
import type { authTemplate, template as dashTemplate, panelTemplate } from '../dashboard/cardDash.js'
66
import type { FictionAdmin } from '../index.js'

@fiction/cards/CardSite.vue

+1-2
Original file line numberDiff line numberDiff line change
@@ -170,7 +170,7 @@ unhead.useHead({
170170
171171
vue.onMounted(async () => {
172172
unhead.useHead({
173-
bodyAttrs: { class: () => !site.value?.isLightMode.value ? 'dark' : 'light' },
173+
bodyAttrs: { class: () => 'dark' },
174174
})
175175
176176
if (!site.value)
@@ -259,7 +259,6 @@ vue.onMounted(async () => {
259259
:data-site-id="site?.siteId ?? '-'"
260260
:data-user-email="fictionUser.activeUser.value?.email ?? '-'"
261261
:data-fiction-router-id="site?.siteRouter.routerId ?? '-'"
262-
:data-editing-style="site?.editor.value.savedEditingStyle ?? '-'"
263262
class="x-site bg-theme-50 dark:bg-theme-900 text-theme-800 dark:text-theme-0"
264263
>
265264
<div class="x-font-body x-site-content relative z-10 bg-theme-0 dark:bg-theme-950">

@fiction/cards/CardWrap.vue

+4-25
Original file line numberDiff line numberDiff line change
@@ -15,28 +15,15 @@ const loaded = vue.ref(false)
1515
const config = vue.computed(() => props.card.config.value || {})
1616
const siteUc = vue.computed(() => props.card.site?.fullConfig.value || {})
1717
const standardUc = vue.computed(() => config.value.standard)
18-
const isReversed = vue.computed(() => standardUc.value?.invertColorScheme)
19-
const isLightMode = vue.computed(() => {
20-
const siteLightMode = props.card.site?.isLightMode.value
21-
return (siteLightMode && !isReversed.value) || (!siteLightMode && isReversed.value)
22-
})
2318
2419
const colorScheme = vue.computed(() => {
2520
const siteStandard = siteUc.value?.standard || {}
2621
const cardStandard = standardUc.value || {}
2722
28-
const siteBackground = siteStandard?.[isLightMode.value ? 'backgroundAlt' : 'background'] ?? siteStandard?.background
29-
const sitePrimaryColor = siteStandard?.[isLightMode.value ? 'primaryColorAlt' : 'primaryColor'] ?? siteStandard?.primaryColor
30-
const siteThemeColor = siteStandard?.[isLightMode.value ? 'themeColorAlt' : 'themeColor'] ?? siteStandard?.themeColor
31-
32-
const cardBackground = cardStandard?.[isLightMode.value ? 'backgroundAlt' : 'background'] ?? cardStandard?.background
33-
const cardPrimaryColor = cardStandard?.[isLightMode.value ? 'primaryColorAlt' : 'primaryColor'] ?? cardStandard?.primaryColor
34-
const cardThemeColor = cardStandard?.[isLightMode.value ? 'themeColorAlt' : 'themeColor'] ?? cardStandard?.themeColor
35-
3623
return {
37-
background: cardBackground || siteBackground,
38-
primary: cardPrimaryColor || sitePrimaryColor,
39-
theme: cardThemeColor || siteThemeColor,
24+
background: cardStandard?.background || siteStandard?.background,
25+
primary: cardStandard?.primaryColor || siteStandard?.primaryColor,
26+
theme: cardStandard?.themeColor || siteStandard?.themeColor,
4027
}
4128
})
4229
@@ -91,12 +78,6 @@ vue.watch(() => standardUc.value?.fonts, (fontStyle) => {
9178
}
9279
}, { immediate: true })
9380
94-
const autoSetDark = vue.computed(() => {
95-
const baseBg = standardUc.value?.background
96-
const lightBg = standardUc.value?.backgroundAlt
97-
return baseBg && !lightBg
98-
})
99-
10081
const editDropdownVisible = vue.ref(false)
10182
10283
const editDropdownItems = vue.computed(() => {
@@ -121,12 +102,10 @@ function handleEditDropdownClick(item: { value: 'delete' | 'edit' | 'add' }) {
121102
<div
122103
ref="cardWrap"
123104
:key="card.cardId"
124-
class="relative card-wrap "
105+
class="relative card-wrap dark"
125106
:style="containerStyle"
126107
:class="[
127108
card.classes.value.verticalSpacing,
128-
isReversed ? (isLightMode ? 'light' : 'dark') : '',
129-
autoSetDark ? 'dark' : '',
130109
loaded ? 'loaded' : '',
131110
card.depth.value <= 1 ? `overflow-x-clip` : '',
132111
]"

@fiction/cards/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
"@fiction/ui": "workspace:*",
1111
"@types/mapbox-gl": "^3.4.1",
1212
"animejs": "^3.2.2",
13-
"mapbox-gl": "^3.10.0",
13+
"mapbox-gl": "^3.11.0",
1414
"tailwindcss": "^3.4.17",
1515
"vue": "^3.5.13"
1616
},

@fiction/core/package.json

+17-17
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,8 @@
1313
}
1414
],
1515
"dependencies": {
16-
"@aws-sdk/client-cloudfront": "^3.777.0",
17-
"@aws-sdk/client-s3": "^3.779.0",
16+
"@aws-sdk/client-cloudfront": "^3.782.0",
17+
"@aws-sdk/client-s3": "^3.782.0",
1818
"@egoist/tailwindcss-icons": "^1.9.0",
1919
"@faker-js/faker": "^9.6.0",
2020
"@iconify-json/carbon": "^1.2.8",
@@ -25,16 +25,16 @@
2525
"@iconify-json/logos": "^1.2.4",
2626
"@iconify-json/svg-spinners": "^1.2.2",
2727
"@iconify-json/tabler": "^1.2.17",
28-
"@sinclair/typebox": "^0.34.31",
28+
"@sinclair/typebox": "^0.34.33",
2929
"@slack/webhook": "^7.0.5",
3030
"@tailwindcss/container-queries": "^0.1.1",
3131
"@types/cookie-parser": "^1.4.8",
3232
"@types/ffprobe": "^1.1.8",
3333
"@types/ffprobe-static": "^2.0.3",
3434
"@types/turndown": "^5.0.5",
35-
"@unhead/schema": "^2.0.2",
36-
"@unhead/ssr": "^2.0.2",
37-
"@unhead/vue": "^2.0.2",
35+
"@unhead/schema": "^2.0.5",
36+
"@unhead/ssr": "^2.0.5",
37+
"@unhead/vue": "^2.0.5",
3838
"@vitejs/plugin-vue": "^5.2.3",
3939
"@vue-email/compiler": "^0.8.14",
4040
"@vue-email/components": "^0.0.21",
@@ -57,13 +57,13 @@
5757
"consola": "^3.4.2",
5858
"cookie-parser": "^1.4.7",
5959
"cors": "^2.8.5",
60-
"cron": "^4.1.3",
61-
"cronstrue": "^2.57.0",
60+
"cron": "^4.1.4",
61+
"cronstrue": "^2.58.0",
6262
"crypto-browserify": "^3.12.1",
6363
"dayjs": "^1.11.13",
6464
"deepmerge": "^4.3.1",
6565
"domhandler": "^5.0.3",
66-
"dompurify": "^3.2.4",
66+
"dompurify": "^3.2.5",
6767
"dotenv": "^16.4.7",
6868
"enquirer": "^2.4.1",
6969
"es-module-lexer": "^1.6.0",
@@ -97,11 +97,11 @@
9797
"jsonwebtoken": "^9.0.2",
9898
"knex": "^3.1.0",
9999
"knex-stringcase": "^1.5.5",
100-
"less": "^4.2.2",
100+
"less": "^4.3.0",
101101
"magic-string": "^0.30.17",
102-
"marked": "^15.0.7",
102+
"marked": "^15.0.8",
103103
"marked-gfm-heading-id": "^4.1.1",
104-
"mime": "^4.0.6",
104+
"mime": "^4.0.7",
105105
"mime-types": "^2.1.35",
106106
"minimist": "^1.2.8",
107107
"module-alias": "^2.2.3",
@@ -138,10 +138,10 @@
138138
"ts-node": "^10.9.2",
139139
"tsup": "^8.4.0",
140140
"turndown": "^7.2.0",
141-
"typescript": "^5.8.2",
141+
"typescript": "^5.8.3",
142142
"uuid-apikey": "^1.5.3",
143143
"validator": "^13.15.0",
144-
"vite": "^6.2.4",
144+
"vite": "^6.2.5",
145145
"vue": "^3.5.13",
146146
"vue-router": "^4.5.0",
147147
"ws": "^8.18.1",
@@ -165,7 +165,7 @@
165165
"@types/jsonwebtoken": "^9.0.9",
166166
"@types/mime-types": "^2.1.4",
167167
"@types/multer": "^1.4.12",
168-
"@types/node": "^22.13.14",
168+
"@types/node": "^22.14.0",
169169
"@types/nodemailer": "^6.4.17",
170170
"@types/nodemailer-html-to-text": "^3.1.3",
171171
"@types/pg": "^8.11.11",
@@ -175,14 +175,14 @@
175175
"@types/serve-favicon": "^2.5.7",
176176
"@types/spark-md5": "^3.0.5",
177177
"@types/validator": "^13.12.3",
178-
"@types/ws": "^8.18.0",
178+
"@types/ws": "^8.18.1",
179179
"@vitest/ui": "^3.1.1",
180180
"deep-object-diff": "^1.1.9",
181181
"fake-indexeddb": "^6.0.0",
182182
"ngrok": "5.0.0-beta.2",
183183
"playwright": "^1.51.1",
184184
"react-dom": "^19.1.0",
185-
"rollup": "^4.38.0",
185+
"rollup": "^4.39.0",
186186
"rollup-plugin-visualizer": "^5.14.0",
187187
"util": "^0.12.5",
188188
"websocket-polyfill": "^1.0.0"

@fiction/plugins/plugin-ai/package.json

+5-5
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
{
22
"dependencies": {
3-
"@ai-sdk/anthropic": "^1.2.4",
4-
"@ai-sdk/openai": "^1.3.6",
5-
"@ai-sdk/xai": "^1.2.5",
3+
"@ai-sdk/anthropic": "^1.2.8",
4+
"@ai-sdk/openai": "^1.3.9",
5+
"@ai-sdk/xai": "^1.2.9",
66
"@fiction/core": "workspace:*",
77
"@pinecone-database/pinecone": "^5.1.1",
8-
"ai": "^4.2.10",
9-
"openai": "^4.91.0",
8+
"ai": "^4.3.4",
9+
"openai": "^4.93.0",
1010
"tailwindcss": "^3.4.17",
1111
"vue": "^3.5.13"
1212
},

@fiction/plugins/plugin-monitor/package.json

+3-3
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,9 @@
77
"main": "index.ts",
88
"dependencies": {
99
"@fiction/core": "workspace:*",
10-
"@sentry/browser": "^9.10.1",
11-
"@sentry/node": "^9.10.1",
12-
"@sentry/vue": "^9.10.1",
10+
"@sentry/browser": "^9.12.0",
11+
"@sentry/node": "^9.12.0",
12+
"@sentry/vue": "^9.12.0",
1313
"@slack/webhook": "^7.0.5",
1414
"highlight.run": "^9.15.0"
1515
},

@fiction/posts/package.json

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
{
22
"dependencies": {
3-
"@ai-sdk/vue": "^1.2.4",
3+
"@ai-sdk/vue": "^1.2.7",
44
"@fiction/admin": "workspace:*",
55
"@fiction/cards": "workspace:*",
66
"@fiction/core": "workspace:*",
77
"@fiction/plugin-ai": "workspace:*",
88
"@fiction/site": "workspace:*",
99
"@fiction/ui": "workspace:*",
10-
"cron": "^4.1.3"
10+
"cron": "^4.1.4"
1111
},
1212
"gitHead": "b257411e1c6c32b52b444cc6f1518bf1bee1e480",
1313
"license": "MIT",

@fiction/posts/widgets/WidgetPosts.vue

+8-7
Original file line numberDiff line numberDiff line change
@@ -3,12 +3,12 @@ import type { ActionButton, ColorThemeUser, IndexItem } from '@fiction/core'
33
import type { Card } from '@fiction/site'
44
import type { FictionPosts, Post } from '..'
55
import WidgetWrap from '@fiction/admin/dashboard/WidgetWrap.vue'
6+
import { dayjs, useService, vue } from '@fiction/core'
67
import XButton from '@fiction/ui/buttons/XButton.vue'
78
import XButtonList from '@fiction/ui/buttons/XButtonList.vue'
89
import XLink from '@fiction/ui/common/XLink.vue'
9-
import ElSpinner from '@fiction/ui/loaders/ElSpinner.vue'
1010
import ElIndexItemMedia from '@fiction/ui/lists/ElIndexItemMedia.vue'
11-
import { dayjs, useService, vue } from '@fiction/core'
11+
import ElSpinner from '@fiction/ui/loaders/ElSpinner.vue'
1212
import { managePostIndex } from '..'
1313
1414
type SubscriberWidget = FictionPosts['widgets']['recentPosts']
@@ -55,7 +55,8 @@ const buttons: ActionButton[] = [
5555
]
5656
5757
function formatDate(dateIso?: string): string {
58-
if (!dateIso) return ''
58+
if (!dateIso)
59+
return ''
5960
return dayjs(dateIso).fromNow()
6061
}
6162
@@ -71,12 +72,12 @@ function getPostTypeTheme(type: string): ColorThemeUser {
7172
}
7273
}
7374
74-
const list = vue.computed<(IndexItem & {meta: {type: string, typeTheme: ColorThemeUser, views: number, likes: number}})[]>(() => {
75+
const list = vue.computed<(IndexItem & { meta: { type: string, typeTheme: ColorThemeUser, views: number, likes: number } })[]>(() => {
7576
return posts.value.map((post) => {
7677
const postType = getPostType(post)
7778
return {
7879
media: post.media.value,
79-
icon: {class: 'i-tabler-pencil'},
80+
icon: { class: 'i-tabler-pencil' },
8081
label: post.title.value || 'Untitled',
8182
description: post.excerpt.value || post.subTitle.value,
8283
href: props.card.link(`/edit-post?postId=${post.postId}`),
@@ -86,7 +87,7 @@ const list = vue.computed<(IndexItem & {meta: {type: string, typeTheme: ColorThe
8687
typeTheme: getPostTypeTheme(postType),
8788
views: Math.floor(Math.random() * 200),
8889
likes: Math.floor(Math.random() * 30),
89-
}
90+
},
9091
}
9192
})
9293
})
@@ -164,7 +165,7 @@ const list = vue.computed<(IndexItem & {meta: {type: string, typeTheme: ColorThe
164165
class="@[32rem]/posts:hidden inline-flex px-1.5 py-0.5 rounded-sm text-xs"
165166
:class="{
166167
'bg-emerald-50 dark:bg-emerald-950/30 text-emerald-700 dark:text-emerald-400': item.meta.type === 'Newsletter',
167-
'bg-blue-50 dark:bg-blue-950/30 text-blue-700 dark:text-blue-400': item.meta.type === 'Article'
168+
'bg-blue-50 dark:bg-blue-950/30 text-blue-700 dark:text-blue-400': item.meta.type === 'Article',
168169
}"
169170
>
170171
{{ item.meta.type }}

@fiction/site/admin/ElSitePreviewFrame.vue

-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
<script lang="ts" setup>
2-
import type { vue } from '@fiction/core'
32
import type { SiteListItem } from '../utils/list'
43
import XLink from '@fiction/ui/common/XLink.vue'
54

@fiction/site/admin/widgets/WidgetSites.vue

-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
<script lang="ts" setup>
2-
import type { ActionButton } from '@fiction/core'
32
import type { Card } from '../..'
43
import type { FictionSites } from '../../index.js'
54
import type { Site } from '../../site.js'

@fiction/site/cardStandard.ts

+1-2
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
import type { Card } from './card'
2-
import { colorTheme, colorThemeBright, HeaderLayoutSchema, SizeSchema, SizeSchemaComplete } from '@fiction/core'
2+
import { colorThemeBright, HeaderLayoutSchema, SizeSchema, SizeSchemaComplete } from '@fiction/core'
33
import { createOption } from '@fiction/ui'
4-
import InputAi from './ai/InputAi.vue'
54
import { StandardUserConfigSchema as schema } from './schema'
65

76
export function standardCardOptions(args: { card: Card }) {

@fiction/site/index.ts

-1
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@ import type { TableSiteConfig } from './tables.js'
99
import { initializeClientTag } from '@fiction/analytics/tag/entry.js'
1010
import { crossVar, FictionPlugin, getAnonymousId, isNode, safeDirname, vue } from '@fiction/core'
1111
import { EnvVar, vars } from '@fiction/core/plugin-env'
12-
import { getWidgets } from './admin/widgets/index.js'
1312
import { CardQueryHandler } from './cardQuery.js'
1413
import { ManageDomain } from './endpoint-domains.js'
1514
import { ManagePage, ManageSite, ManageSites } from './endpoint.js'

@fiction/site/plugin-builder/SiteEditor.vue

+1-1
Original file line numberDiff line numberDiff line change
@@ -183,7 +183,7 @@ async function resetToPublished() {
183183
</XDropDown>
184184
</div>
185185
<CardButton
186-
v-if="site.editor.value.savedNeedsPublish || site.editor.value.isDirty"
186+
v-if="site.editor.value.savedNeedsPublish"
187187
:card
188188
theme="primary"
189189
:loading="sending === 'save'"

@fiction/site/plugin-builder/SiteEditorFrame.vue

-10
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@ import type { Card } from '../card'
55
import type { Site } from '../site'
66
import type { FramePostMessageList } from '../utils/frame'
77
import { toLabel, vue } from '@fiction/core'
8-
import { animateItemEnter, useElementVisible } from '@fiction/ui/anim'
98
import XButton from '@fiction/ui/buttons/XButton.vue'
109
import ElTooltip from '@fiction/ui/common/ElTooltip.vue'
1110
import XDropDown from '@fiction/ui/common/XDropDown.vue'
@@ -45,15 +44,6 @@ vue.watch(
4544
{ immediate: true },
4645
)
4746
48-
function toggleDarkLightMode() {
49-
if (!props.site)
50-
return
51-
const v = !props.site.isLightMode.value
52-
props.site.isLightMode.value = v
53-
54-
props.site.syncChange({ caller: 'updateDarkLightMode' })
55-
}
56-
5747
// Page grid view state
5848
const showPageGrid = vue.computed({
5949
get: () => props.site?.editorController.isUsingTool({ toolId: 'pages' }) || false,

@fiction/site/plugin-builder/tools/InputAddElements.vue

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<script lang="ts" setup>
22
import type { EditorTool } from '@fiction/admin'
3-
import type { ListItem, NavListItem } from '@fiction/core'
3+
import type { NavListItem } from '@fiction/core'
44
import type { CardTemplate } from '../../card'
55
import type { Site } from '../../site'
66
import type { PageRegion } from '../../tables'

0 commit comments

Comments
 (0)