feat(widgets): add phase 4 validation and accessibility
This commit is contained in:
1 parent
8cad3c2d3d
commit
e1723a8f08
117 files changed
+6
-17338
No files matched your search
@@ -1,25 +0,0 @@
|
||||
export const featureSchema = {
|
||||
key: 'post_list.feature',
|
||||
title: '文章功能',
|
||||
icon: 'fas fa-magic',
|
||||
description: '配置文章页的互动功能开关。',
|
||||
defaults: {
|
||||
feature_pdf_export: false,
|
||||
feature_print: true,
|
||||
feature_word_count: true,
|
||||
feature_reading_time: true,
|
||||
},
|
||||
groups: [
|
||||
{
|
||||
key: 'tools',
|
||||
title: '工具功能',
|
||||
icon: 'fas fa-tools',
|
||||
fields: [
|
||||
{ key: 'feature_print', label: '打印文章', type: 'switch', default: true },
|
||||
{ key: 'feature_word_count', label: '字数统计', type: 'switch', default: true },
|
||||
{ key: 'feature_reading_time', label: '预计阅读时间', type: 'switch', default: true },
|
||||
{ key: 'feature_pdf_export', label: 'PDF 导出', type: 'switch', default: false, help: '实验性功能' },
|
||||
],
|
||||
},
|
||||
],
|
||||
}
|
||||
@@ -1,25 +0,0 @@
|
||||
/**
|
||||
* Post & List domain schemas.
|
||||
*/
|
||||
|
||||
import { listSchema } from './list.js'
|
||||
import { thumbSchema } from './thumb.js'
|
||||
import { pageSchema } from './page.js'
|
||||
import { filterSchema } from './filter.js'
|
||||
import { featureSchema } from './feature.js'
|
||||
import { paySchema } from './pay.js'
|
||||
import { shareSchema } from './share.js'
|
||||
import { commentSchema } from './comment.js'
|
||||
import { submitSchema } from './submit.js'
|
||||
|
||||
export const postListSchemas = {
|
||||
list: listSchema,
|
||||
thumb: thumbSchema,
|
||||
page: pageSchema,
|
||||
filter: filterSchema,
|
||||
feature: featureSchema,
|
||||
pay: paySchema,
|
||||
share: shareSchema,
|
||||
comment: commentSchema,
|
||||
submit: submitSchema,
|
||||
}
|
||||
@@ -1,46 +0,0 @@
|
||||
export const paySchema = {
|
||||
key: 'post_list.pay',
|
||||
title: '付费内容',
|
||||
icon: 'fas fa-yen-sign',
|
||||
description: '配置文章付费阅读、下载功能和购买用户显示。',
|
||||
defaults: {
|
||||
post_pay_enable: false,
|
||||
post_pay_price_default: 0,
|
||||
post_pay_free_logged_show: false,
|
||||
post_pay_box_position: 'content',
|
||||
post_pay_mark: '付费',
|
||||
post_pay_show_user: false,
|
||||
post_download_enable: false,
|
||||
post_download_remote_s: false,
|
||||
post_download_verify_nonce: true,
|
||||
post_download_user_log: true,
|
||||
post_download_post_log: true,
|
||||
},
|
||||
groups: [
|
||||
{
|
||||
key: 'basic',
|
||||
title: '付费设置',
|
||||
icon: 'fas fa-coins',
|
||||
fields: [
|
||||
{ key: 'post_pay_enable', label: '启用付费内容', type: 'switch', default: false },
|
||||
{ key: 'post_pay_price_default', label: '默认价格', type: 'number', default: 0, min: 0, max: 9999, dependsOn: { key: 'post_pay_enable', value: true } },
|
||||
{ key: 'post_pay_free_logged_show', label: '登录用户显示免费', type: 'switch', default: false, dependsOn: { key: 'post_pay_enable', value: true } },
|
||||
{ key: 'post_pay_box_position', label: '付费框位置', type: 'radio', default: 'content', options: [{ label: '内容前', value: 'content' }, { label: '全文遮罩', value: 'mask' }], dependsOn: { key: 'post_pay_enable', value: true } },
|
||||
{ key: 'post_pay_mark', label: '付费标记', type: 'input', default: '付费', dependsOn: { key: 'post_pay_enable', value: true } },
|
||||
{ key: 'post_pay_show_user', label: '显示购买用户', type: 'switch', default: false, dependsOn: { key: 'post_pay_enable', value: true } },
|
||||
],
|
||||
},
|
||||
{
|
||||
key: 'download',
|
||||
title: '下载设置',
|
||||
icon: 'fas fa-download',
|
||||
fields: [
|
||||
{ key: 'post_download_enable', label: '启用下载功能', type: 'switch', default: false },
|
||||
{ key: 'post_download_remote_s', label: '远程文件下载', type: 'switch', default: false, dependsOn: { key: 'post_download_enable', value: true } },
|
||||
{ key: 'post_download_verify_nonce', label: '下载鉴权', type: 'switch', default: true, dependsOn: { key: 'post_download_enable', value: true } },
|
||||
{ key: 'post_download_user_log', label: '用户下载日志', type: 'switch', default: true, dependsOn: { key: 'post_download_enable', value: true } },
|
||||
{ key: 'post_download_post_log', label: '文章下载日志', type: 'switch', default: true, dependsOn: { key: 'post_download_enable', value: true } },
|
||||
],
|
||||
},
|
||||
],
|
||||
}
|
||||
@@ -1,42 +0,0 @@
|
||||
export const shareSchema = {
|
||||
key: 'post_list.share',
|
||||
title: '分享设置',
|
||||
icon: 'fas fa-share-alt',
|
||||
description: '配置微信分享凭据、海报分享和社交分享选项。',
|
||||
defaults: {
|
||||
share_wechat_s: false,
|
||||
share_wechat_appid: '',
|
||||
share_wechat_app_secret: '',
|
||||
share_only_logo: false,
|
||||
share_img_compatible_s: false,
|
||||
share_img_byimg: '',
|
||||
share_logo: '',
|
||||
share_img: '',
|
||||
share_desc: '扫一扫 立即查看',
|
||||
},
|
||||
groups: [
|
||||
{
|
||||
key: 'wechat',
|
||||
title: '微信分享',
|
||||
icon: 'fab fa-weixin',
|
||||
fields: [
|
||||
{ key: 'share_wechat_s', label: '启用微信分享', type: 'switch', default: false, help: '启用后文章页将支持微信 JSAPI 分享' },
|
||||
{ key: 'share_wechat_appid', label: 'AppID', type: 'input', default: '', dependsOn: { key: 'share_wechat_s', value: true }, help: '微信公众号 AppID' },
|
||||
{ key: 'share_wechat_app_secret', label: 'AppSecret', type: 'input', default: '', dependsOn: { key: 'share_wechat_s', value: true }, help: '微信公众号 AppSecret(请确保 JS 安全域名已配置)' },
|
||||
{ key: 'share_only_logo', label: '仅显示 Logo', type: 'switch', default: false, help: '分享时仅显示站点 Logo' },
|
||||
],
|
||||
},
|
||||
{
|
||||
key: 'poster',
|
||||
title: '海报分享',
|
||||
icon: 'fas fa-image',
|
||||
fields: [
|
||||
{ key: 'share_img_compatible_s', label: '兼容模式', type: 'switch', default: false, help: '启用后使用兼容模式生成分享海报' },
|
||||
{ key: 'share_img_byimg', label: '海报默认图', type: 'media', default: '', help: '海报分享使用的默认背景图' },
|
||||
{ key: 'share_logo', label: '海报 LOGO', type: 'media', default: '', help: '海报上叠加的站点 LOGO' },
|
||||
{ key: 'share_img', label: '分享图片', type: 'media', default: '', help: '社交平台分享预览图' },
|
||||
{ key: 'share_desc', label: '分享描述', type: 'textarea', default: '扫一扫 立即查看', help: '海报或分享卡片的描述文案' },
|
||||
],
|
||||
},
|
||||
],
|
||||
}
|
||||
@@ -1,70 +0,0 @@
|
||||
export const thumbSchema = {
|
||||
key: 'post_list.thumb',
|
||||
title: '列表缩略图',
|
||||
icon: 'fas fa-images',
|
||||
description: '配置缩略图来源优先级、尺寸、占位图和多图模式。',
|
||||
defaults: {
|
||||
thumb_priority: 'featured,attachment,resource,custom',
|
||||
thumb_fallback: 'placeholder',
|
||||
thumb_spare_images: [],
|
||||
thumb_lazy: true,
|
||||
thumb_aspect_ratio: '16:9',
|
||||
list_thumb_fit: 'cover',
|
||||
thumb_multi_enabled: false,
|
||||
thumb_multi_count: 3,
|
||||
list_thumb_slides_s: true,
|
||||
list_thumb_video_s: true,
|
||||
list_thumb_video_mute_s: true,
|
||||
thumb_postfirstimg_s: true,
|
||||
thumb_catimg_s: true,
|
||||
mult_thumb_cat: [],
|
||||
},
|
||||
groups: [
|
||||
{
|
||||
key: 'source',
|
||||
title: '图片来源',
|
||||
icon: 'fas fa-image',
|
||||
fields: [
|
||||
{ key: 'thumb_priority', label: '图片优先级', type: 'input', default: 'featured,attachment,resource,custom', help: '逗号分隔: featured(特色图), attachment(附件), resource(资源封面), custom(自定义), post_first_img(文章首图), category_cover(分类封面)' },
|
||||
{ key: 'thumb_fallback', label: '无图时处理', type: 'radio', default: 'placeholder', options: [
|
||||
{ label: '显示占位图', value: 'placeholder' },
|
||||
{ label: '隐藏缩略图', value: 'hide' },
|
||||
{ label: '随机封面', value: 'random' },
|
||||
]},
|
||||
{ key: 'thumb_spare_images', label: '备用缩略图', type: 'gallery', default: [], help: '当无图处理选择"随机封面"时从此图库随机选取', dependsOn: { key: 'thumb_fallback', value: 'random' } },
|
||||
{ key: 'thumb_aspect_ratio', label: '图片比例', type: 'select', default: '16:9', options: [
|
||||
{ label: '16:9 宽屏', value: '16:9' },
|
||||
{ label: '4:3 标准', value: '4:3' },
|
||||
{ label: '1:1 正方形', value: '1:1' },
|
||||
{ label: '自适应', value: 'auto' },
|
||||
]},
|
||||
{ key: 'list_thumb_fit', label: '缩略图填充方式', type: 'radio', default: 'cover', options: [
|
||||
{ label: '填充裁剪', value: 'cover' },
|
||||
{ label: '完整显示', value: 'contain' },
|
||||
]},
|
||||
{ key: 'list_thumb_slides_s', label: '幻灯片缩略图', type: 'switch', default: true, help: '允许幻灯片作为列表缩略图' },
|
||||
{ key: 'list_thumb_video_s', label: '视频缩略图', type: 'switch', default: true, help: '鼠标悬停时自动播放视频缩略图' },
|
||||
{ key: 'list_thumb_video_mute_s', label: '视频缩略图静音', type: 'switch', default: true, dependsOn: { key: 'list_thumb_video_s', value: true }, help: '视频缩略图播放时静音' },
|
||||
{ key: 'thumb_postfirstimg_s', label: '自动获取文章首图', type: 'switch', default: true, help: '自动从文章内容中提取第一张图片作为缩略图' },
|
||||
{ key: 'thumb_postfirstimg_size', label: '首图尺寸', type: 'select', default: 'medium', options: [
|
||||
{ label: '缩略图', value: 'thumbnail' },
|
||||
{ label: '中等', value: 'medium' },
|
||||
{ label: '大', value: 'large' },
|
||||
{ label: '原始', value: 'full' },
|
||||
], dependsOn: { key: 'thumb_postfirstimg_s', value: true }, help: '自动获取文章首图时使用的 WP 图片尺寸' },
|
||||
{ key: 'thumb_catimg_s', label: '自动获取分类封面', type: 'switch', default: true, help: '无特色图时使用分类封面图作为缩略图' },
|
||||
],
|
||||
},
|
||||
{
|
||||
key: 'multi',
|
||||
title: '多图模式',
|
||||
icon: 'fas fa-images',
|
||||
fields: [
|
||||
{ key: 'thumb_multi_enabled', label: '多图卡片', type: 'switch', default: false, help: '当文章有多张图片时,在列表中展示多图预览' },
|
||||
{ key: 'thumb_multi_count', label: '最多显示几张', type: 'number', default: 3, min: 2, max: 6, dependsOn: { key: 'thumb_multi_enabled', value: true } },
|
||||
{ key: 'mult_thumb_cat', label: '按分类多图显示', type: 'taxonomy_select', taxonomy: 'category', multiple: true, default: [], help: '选择的分类下所有文章自动显示多张缩略图' },
|
||||
{ key: 'thumb_lazy', label: '懒加载', type: 'switch', default: true },
|
||||
],
|
||||
},
|
||||
],
|
||||
}
|
||||
Reference in new issue
Block a user