feat(creator-studio): 前台 Gutenberg 创作工作台与受保护付费附件
前台投稿页改为沉浸式创作工作台:Gutenberg 负责区块解析与序列化, React + TypeScript 负责工作台外壳与发布抽屉,Jio 服务端继续作为权限、 审核与付费的唯一权威。 - 新增 assets/creator-studio 独立构建(wp-scripts,锁定 WP 6.4 时代包), 仅在投稿模板加载,构建缺失或游客访问时回退原有 TinyMCE 表单 - 自动保存(4s 防抖 + rev 冲突 409)、本地快照恢复、发布配置抽屉、 移动端全屏单列与安全区适配 - 图片插入走现有 front-submit 上传管线,保留能力校验与待认领生命周期 - 已发布文章的改稿写入私有版本,审核通过前线上内容/链接/付费条款不变; 原生后台「改稿审核」一次性应用或退回,并校验源文章并发指纹 - 私有附件新表 jio_private_asset + jio_dl_token.asset_id,schema 升到 3.4.0; 文件存放 ABSPATH 之外,未配置私有存储时 fail closed - 下载令牌绑定文章/附件/用户/IP/UA/次数,每次交付复核 Visibility 的 订单、VIP 与配额判定;中断传输归还次数 - 付费字段改为写入前校验,非法价格不再留下半保存文章 - 新增 creator-studio 契约测试;更新受影响的 schema/下载/投稿契约 Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
This commit is contained in:
1 parent
7a8279f8e7
commit
fac4a714e0
45 files changed
+28495
-56
No files matched your search
@@ -32,6 +32,38 @@ if (!empty($_GET['edit']) && empty($ctx['edit_post'])) {
|
||||
exit;
|
||||
}
|
||||
|
||||
// Jio Creator Studio:登录用户 + 构建产物存在时使用沉浸式 Gutenberg 工作台。
|
||||
// 否则保留原有 TinyMCE 表单作为降级路径(游客投稿、未构建、无权限)。
|
||||
$studio = class_exists('\Jio\Core\CreatorStudio') ? \Jio\Core\CreatorStudio::get_instance() : null;
|
||||
$use_studio = $studio
|
||||
&& $studio::is_built()
|
||||
&& get_current_user_id() > 0
|
||||
&& !empty($ctx['is_can_new']);
|
||||
if ($use_studio) {
|
||||
get_header();
|
||||
?>
|
||||
<main id="main-content" role="main" tabindex="-1">
|
||||
<div id="jio-creator-studio">
|
||||
<div class="jio-studio-skeleton" aria-live="polite">
|
||||
<?php esc_html_e('正在加载创作工作台…', 'jio'); ?>
|
||||
</div>
|
||||
</div>
|
||||
<?php
|
||||
// 人机验证挂载点:由发布抽屉在提交时移入并展示,脚本扫描只执行一次。
|
||||
if (function_exists('jio_render_captcha') && function_exists('jio_is_captcha_enabled_for') && jio_is_captcha_enabled_for('front_submit')) :
|
||||
?>
|
||||
<div id="jio-creator-captcha" hidden>
|
||||
<?php jio_render_captcha('front_submit'); ?>
|
||||
</div>
|
||||
<?php
|
||||
endif;
|
||||
?>
|
||||
</main>
|
||||
<?php
|
||||
get_footer();
|
||||
return;
|
||||
}
|
||||
|
||||
// wp_editor() is rendered after get_header(); queue its runtime before wp_head.
|
||||
wp_enqueue_editor();
|
||||
|
||||
|
||||
Reference in new issue
Block a user