Repository navigation
feat(viewer): 交互序列按点击触发形状播放,不再混进主序列(#84) - #89
Merged
Merged
Conversation
PowerPoint 的触发器动画写在 p:timing 的 nodeType="interactiveSeq" 序列里。此前解析器把整棵 时间树里带 presetClass 的节点一律当成主序列的点击批次,答题类课件因此变成「任意点击一次, 答案就出现」。 - core:交互序列单独解析为 Slide.interactiveSequences(触发形状、序列内点击批次、restart), 不再进 Slide.animations;触发形状取不到的序列整条丢弃。新增 interactiveGroups 与 playbackHidden;staticHidden 的终态包含交互序列 - viewer-core:PresentationState 新增 isInteractiveTrigger / playInteractive / settleInteractive, 隐藏集包含尚未触发的入场目标;Viewer 点到触发形状只播它的序列,主序列进度不变,点击不冒泡 到宿主的翻页监听,并给触发形状打上 data-ppt-trigger 供宿主排除 - 线性导出:分步打印、分步 PDF 与视频里交互序列停在触发之前,入场目标全程隐藏 - 官网放映与独立查看器的翻页判定排除 [data-ppt-trigger] - 新增确定性固件 sample-animation-trigger.pptx 与解析、可见性、状态机、分步导出断言, 以及真实浏览器的点击触发与视频像素断言 Closes #84
…quences # Conflicts: # CHANGELOG.md # package.json
- core 与 viewer-core 的 API 报告随公开面更新,补 isInteractiveTrigger 的注释 - viewer-core 体积 11.80KB gzip(README / README.en / 官网);核心断言 2641 项、 固件 184 份、编辑等价指纹 1250 对、官网断言总数 12592 - 官网首次打开依赖闭包预算按实测上调 raw 2_100B、gzip 500B
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
变更
Closes #84
PowerPoint 的「触发器」动画写在
p:timing的nodeType="interactiveSeq"序列里,由点击指定形状启动。此前解析器把整棵时间树里带presetClass的节点一律当成主序列的点击批次,issue 附带的课件因此变成「任意点击一次,答案图片就出现」。@web-ppt/core)Slide.interactiveSequences(触发形状 id、序列内的点击批次、restart),不再进Slide.animations;触发形状取不到的序列整条丢弃。新增interactiveGroups与playbackHidden,staticHidden的终态包含交互序列PresentationState)isInteractiveTrigger/playInteractive/settleInteractive;序列播放中再点按restart:always立即重播、whenNotActive忽略、never播完后不再响应。隐藏集包含尚未触发的入场目标Viewerdata-ppt-trigger,供把监听挂在容器自身或捕获阶段的宿主排除[data-ppt-trigger],与[data-slide]、[data-media-toggle]同一处理边界:
.ppt不解析交互序列;序列里不挂在效果下的p:audio/p:video节点不映射。公开 API:
InteractiveSequence、Slide.interactiveSequences、interactiveGroups、playbackHidden,以及PresentationState的三个方法和StateChange.interactive;API 报告已随代码更新。验证
npm run check && npm test && npm run build && npm run verify全部通过(本机 Chrome 158 不绕过任何失败,已含 fix(test): 适配 Chrome 158 的两处计算样式变化,恢复动画验收与窄屏外壳契约 #90 的 Chrome 158 适配;CI 全部 29 个作业通过——dist (render)首次因 runner 上test-font-worker.mjs --dist被 SIGTRAP 终止的已知偶发失败,重跑通过)fixtures/sample-animation-trigger.pptx(主序列与两个交互序列并存 / 只有交互序列 / 只有主序列的对照页,重跑字节一致)clickGroup、三种restart;afterPrev归入同一批;触发形状缺失的序列整条丢弃;含交互序列的页动画来源只读,对照页仍可编辑playbackHidden在主序列各步的结果;静态浏览取终态;分步打印两种模式下逐页的隐藏状态restart处理;never播完后不再响应;always播放中重播;换页后进度重建;主序列批次与交互批次的「已完成步骤」关系test-editor-browser)data-ppt-trigger;播放中再点被忽略;播完后重播;非触发形状的点击照常冒泡test-video-audio)npm run test:ooxml:170 份保存产物通过 XSD 与 OpenXmlValidatortest2.pptx两页均解析为「无主序列 + 三个交互序列」,触发形状与 PowerPoint 一致变异验证:把解析器改回「交互序列并入主序列」→ 12 项失败;去掉线性导出里未触发目标的隐藏 → 6 项失败且视频像素断言取到形状颜色;去掉
Viewer的stopPropagation→ 「触发形状的点击冒泡到了宿主」。三处均已恢复。按 verify 实测同步的数字:viewer-core 11.80KB gzip;核心断言 2641 项;固件 184 份、编辑等价指纹 1250 对;官网断言总数 12592。官网首次打开依赖闭包预算上调 raw 2_100B / gzip 500B。