Commit Graph

16 Commits

Author SHA1 Message Date
augushong
f6fc53940c feat(phone-image): Wave2 CSS样式+自动保存+历史加载
- T4: 新增编辑器区/操作栏/弹框CSS样式(390行),覆盖两栏布局、
  wangeditor编辑区排版、divider分页标记、设置弹框、右侧预览区
- T5: onChange自动保存(2.6s防抖),保存状态指示器(waiting/saving/saved/error)
- T6: loadFromHistory改用editor.setHtml()+updateConfig()替换旧init
- 修复: doAutoSave删除无效递归调用
2026-05-11 22:55:24 +08:00
augushong
1f8128385f refactor(phone-image): wangeditor 排版引擎核心重构
- 两栏布局:取消左侧工具栏,中间改为wangeditor v5编辑器
- 顶部操作栏:设置/保存/生成并保存+更多下拉(历史/重新生成/下载/长图)
- 设置弹框:尺寸选择+水印输入,删除全局字号滑块
- wangeditor完整工具栏+divider分割线标记分页
- 删除旧渲染管线:renderContentFlow/insertPageBreak/removePageBreak/convertFlowBlocksToImages/measureBlockHeights
- 新增captureEditorBlocks:从编辑器DOM测高+按分割线分组+实际高度分页
- 新增exportLongImage:从wangeditor DOM截长图
- getContentHtml改为从wangeditor实例读取
2026-05-11 22:45:38 +08:00
augushong
e9d839ae8a docs(phone-image): 产出排版功能架构文档
fix(phone-image): 修复分页标记丢失bug,消除双数据源问题

- 新增 getContentHtml() 和 updateConfig() 引擎API
- 保存逻辑改用引擎内部 content_html,不再从DOM读取
- doRender 改用 updateConfig,配置变更不重置内容
- loadFromHistory 改用 init+render 全量初始化
- PHP/JS 配置字段对齐(移除template/font,新增pageAlignments)
2026-05-11 21:17:37 +08:00
augushong
ba543040fa fix(phone-image): concurrent render silence rendering error
T3 fix: silence err===rendering in catch block to avoid
showing meaningless rendering failed message to users
2026-05-07 22:16:41 +08:00
augushong
90b4b1d5f2 refactor(phone-image): 清理死代码、修复历史记录和媒体标签安全移除
T8: 删除estimateImageHeight/estimateTableHeight/showGeneratedThumbnails/switchSize/
    getConfig/getPages/renderContentFlow等未使用函数,exportLongImage添加render锁检查
T9: loadFromHistory恢复pageAlignments,font_size→fontSize命名统一(PHP+JS双向兼容),
    修复历史加载时fontSize显示值bug
T10: preprocessContent移除iframe/video/svg/embed/object标签,
    封面图添加onerror处理
2026-05-07 21:53:03 +08:00
augushong
9aacfab11d fix(phone-image): 修复XSS注入、正则兼容性、render锁稳定性和缓存清理
T1: XSS修复 - PHP模板注入改用json_encode,poster URL转义处理
T2: fontSize NaN修复 - parseInt统一处理,lookbehind正则替换为兼容方案
T3: render锁稳定性 - insertPageBreak/removePageBreak添加15次重试上限,
     fontsReady添加catch处理,_pending递归添加错误捕获
T4: 缓存清理 - init()清空缓存,render()超过3倍blocks数自动清理
2026-05-07 21:29:45 +08:00
augushong
2233b2b71a fix(phone-image): 修复代码块/表格转换DOM索引失效bug,增加重新生成按钮和中间栏表格样式
- convertCodeBlocks/convertTables: 改为每次重新find().first()替代缓存索引
- 修复replaceWith后jQuery集合中后续元素DOM引用失效的问题
- 新增'重新生成'按钮,强制重新渲染缩略图
- 新增中间栏content-flow-block表格CSS样式
2026-05-03 22:56:34 +08:00
augushong
168f0a9adc fix(phone-image): remove output-manage button and fix history date display 2026-05-03 22:06:57 +08:00
augushong
5f5dc180c9 feat(phone-image): add history popup with load config support 2026-05-03 21:22:00 +08:00
augushong
c51cd8beb5 feat(phone-image): add save button and state management 2026-05-03 21:16:00 +08:00
augushong
8aeda4c518 refactor(phone-image): JS engine renders thumbnails via html2canvas 2026-05-03 09:08:15 +08:00
augushong
3cc024409f refactor(phone-image): CSS and HTML for thumbnail preview container 2026-05-03 09:00:32 +08:00
augushong
9dce9854c8 fix(phone-image): T7 integration fixes
Fix 3 bugs found during Playwright integration testing:

1. Template syntax: {|json_encode|default='{}'} -> PHP native (curly braces parsed as TP6 tags)

2. jQuery event namespace mismatch: off('click.phoneImage') -> off('click') to match on('click')

3. Migration executed on server

All 6 Playwright test scenarios passed: layout, content flow, preview, alignment, font size, toolbar buttons
2026-05-02 09:54:59 +08:00
augushong
57187a9d1d refactor(phone-image): three-column layout with content flow and paginated preview
T6: Rewrite phone_image.html to three-column layout (toolbar 220px | content flow 540px | paginated preview flex:1)

- Remove: template buttons, font selector, AI section, preview button, page navigation

- Add: content-flow area, paginated-preview area, export long image button

- Update: postData with coverText, layoutContentHtml, savedConfig restore

- Debounced doRender (300ms), auto-render on page load
2026-05-02 09:30:20 +08:00
augushong
34fe255829 feat(phone-image): 增加翻页预览与无封面图排版样式
- 为手机截图生成器添加翻页功能,支持在生成前预览各页内容
- 增加无封面图时的排版样式,使用装饰线条和居中布局
- 改进图片处理逻辑,清除内联样式并展平嵌套包装元素
- 修复 models.dev 同步接口,支持 GET 请求获取缓存数据
- 优化网络请求,添加直连失败后的本地代理重试机制
2026-05-01 16:31:26 +08:00
augushong
83a2bd48a2 feat(post): 新增手机图片排版与AI智能排版功能
- 新增手机图片排版功能,支持小红书/抖音尺寸输出
- 新增AI智能排版顾问,支持内容分析与优化推荐
- 新增AI供应商管理,支持多渠道配置与同步
- 新增文章输出管理页面,支持图片预览与批量下载
- 新增字体文件与排版样式配置
2026-05-01 12:23:17 +08:00