@agent-native/core-corpus 0.214.0 → 0.216.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/corpus/README.md +1 -1
- package/corpus/templates/analytics/.agents/skills/actions/references/action-fields.md +1 -1
- package/corpus/templates/analytics/CHANGELOG.md +1 -0
- package/corpus/templates/analytics/changelog/2026-10-21-session-replay-quotas-count-the-compressed-size-analytics-st.md +6 -0
- package/corpus/templates/analytics/server/lib/session-replay.ts +40 -9
- package/corpus/templates/assets/.agents/skills/actions/references/action-fields.md +1 -1
- package/corpus/templates/brain/.agents/skills/actions/references/action-fields.md +1 -1
- package/corpus/templates/calendar/.agents/skills/actions/references/action-fields.md +1 -1
- package/corpus/templates/chat/.agents/skills/actions/references/action-fields.md +1 -1
- package/corpus/templates/clips/.agents/skills/actions/references/action-fields.md +1 -1
- package/corpus/templates/community/qr/package.json +1 -1
- package/corpus/templates/content/.agents/skills/actions/references/action-fields.md +1 -1
- package/corpus/templates/content/.agents/skills/content-product-development/references/verification.md +36 -0
- package/corpus/templates/content/.agents/skills/document-editing/SKILL.md +10 -0
- package/corpus/templates/content/.agents/skills/document-editing/references/databases.md +11 -0
- package/corpus/templates/content/.agents/skills/notion-integration/SKILL.md +4 -2
- package/corpus/templates/content/CHANGELOG.md +46 -0
- package/corpus/templates/content/acceptance/_writers.ts +604 -0
- package/corpus/templates/content/acceptance/generate-action-registry.ts +10 -0
- package/corpus/templates/content/acceptance/golden/gate-off-stored-bytes/create-document.json +75 -0
- package/corpus/templates/content/acceptance/golden/gate-off-stored-bytes/duplicate-page.json +75 -0
- package/corpus/templates/content/acceptance/golden/gate-off-stored-bytes/edit-document-find-and-replace-without-a-revision.json +75 -0
- package/corpus/templates/content/acceptance/golden/gate-off-stored-bytes/edit-document-find-and-replace.json +75 -0
- package/corpus/templates/content/acceptance/golden/gate-off-stored-bytes/edit-document-initializecontent.json +75 -0
- package/corpus/templates/content/acceptance/golden/gate-off-stored-bytes/import-content.json +75 -0
- package/corpus/templates/content/acceptance/golden/gate-off-stored-bytes/local-files-import-content-source-existing-page.json +75 -0
- package/corpus/templates/content/acceptance/golden/gate-off-stored-bytes/local-files-import-content-source-new-page.json +75 -0
- package/corpus/templates/content/acceptance/golden/gate-off-stored-bytes/local-files-sync-local-folder-source-changed-file.json +75 -0
- package/corpus/templates/content/acceptance/golden/gate-off-stored-bytes/local-files-sync-local-folder-source-new-file.json +75 -0
- package/corpus/templates/content/acceptance/golden/gate-off-stored-bytes/restore-document-version.json +75 -0
- package/corpus/templates/content/acceptance/golden/gate-off-stored-bytes/set-document-property-primary-blocks-field.json +75 -0
- package/corpus/templates/content/acceptance/golden/gate-off-stored-bytes/set-image-alt-text.json +75 -0
- package/corpus/templates/content/acceptance/golden/gate-off-stored-bytes/undo-content-import.json +75 -0
- package/corpus/templates/content/acceptance/golden/gate-off-stored-bytes/update-document-browser-full-rewrite.json +75 -0
- package/corpus/templates/content/acceptance/known-loss.ts +69 -0
- package/corpus/templates/content/acceptance/round-trip-corpus.ts +1397 -0
- package/corpus/templates/content/actions/_blocks-field-identity.ts +35 -1
- package/corpus/templates/content/actions/_content-database-lifecycle.ts +11 -11
- package/corpus/templates/content/actions/_content-database-personal-view.ts +2 -0
- package/corpus/templates/content/actions/_content-favorites.ts +37 -0
- package/corpus/templates/content/actions/_database-membership-lock.ts +39 -8
- package/corpus/templates/content/actions/_database-navigation.ts +19 -21
- package/corpus/templates/content/actions/_database-row-batch.ts +41 -18
- package/corpus/templates/content/actions/_database-row-mutation.ts +17 -28
- package/corpus/templates/content/actions/_database-source-utils.ts +18 -1
- package/corpus/templates/content/actions/_database-utils.ts +3 -0
- package/corpus/templates/content/actions/_database-view-setup.ts +16 -0
- package/corpus/templates/content/actions/_document-edit-mutation.ts +33 -32
- package/corpus/templates/content/actions/_document-flush.ts +593 -171
- package/corpus/templates/content/actions/_document-save-locks.ts +54 -0
- package/corpus/templates/content/actions/_document-save-row.ts +133 -0
- package/corpus/templates/content/actions/_github-source.ts +18 -8
- package/corpus/templates/content/actions/_move-page-to-space.ts +189 -25
- package/corpus/templates/content/actions/_nfm-syntax.ts +2 -0
- package/corpus/templates/content/actions/_row-lock-order.ts +115 -0
- package/corpus/templates/content/actions/create-content-database.ts +11 -0
- package/corpus/templates/content/actions/create-document.ts +13 -1
- package/corpus/templates/content/actions/delete-content-database.ts +17 -14
- package/corpus/templates/content/actions/delete-document-property.ts +5 -0
- package/corpus/templates/content/actions/delete-document.ts +270 -97
- package/corpus/templates/content/actions/edit-document.ts +18 -5
- package/corpus/templates/content/actions/export-document.ts +3 -0
- package/corpus/templates/content/actions/get-blocks-field-word-count.ts +22 -5
- package/corpus/templates/content/actions/import-content-source.ts +170 -54
- package/corpus/templates/content/actions/move-document.ts +191 -73
- package/corpus/templates/content/actions/pull-document.ts +8 -2
- package/corpus/templates/content/actions/remove-database-items.ts +23 -4
- package/corpus/templates/content/actions/restore-content-database.ts +76 -55
- package/corpus/templates/content/actions/restore-document-version.ts +19 -35
- package/corpus/templates/content/actions/restore-document.ts +65 -53
- package/corpus/templates/content/actions/rollback-created-slash-document.ts +11 -16
- package/corpus/templates/content/actions/set-document-property.ts +15 -1
- package/corpus/templates/content/actions/share-local-file-document.ts +18 -14
- package/corpus/templates/content/actions/suggest-document-edit.ts +2 -3
- package/corpus/templates/content/actions/sync-local-folder-source.ts +35 -1
- package/corpus/templates/content/actions/undo-content-import.ts +16 -12
- package/corpus/templates/content/actions/update-content-database-view.ts +2 -0
- package/corpus/templates/content/actions/update-document.ts +19 -14
- package/corpus/templates/content/app/components/editor/BubbleToolbar.tsx +1 -6
- package/corpus/templates/content/app/components/editor/CommentsSidebar.tsx +49 -3
- package/corpus/templates/content/app/components/editor/ContentImportDialog.tsx +2 -0
- package/corpus/templates/content/app/components/editor/DocumentBlockFields.tsx +53 -11
- package/corpus/templates/content/app/components/editor/DocumentEditor.tsx +608 -353
- package/corpus/templates/content/app/components/editor/StaticDocumentBody.tsx +765 -0
- package/corpus/templates/content/app/components/editor/VisualEditor.tsx +233 -80
- package/corpus/templates/content/app/components/editor/blockFieldSaveController.ts +32 -3
- package/corpus/templates/content/app/components/editor/blockFieldSaveRegistry.ts +88 -23
- package/corpus/templates/content/app/components/editor/comment-anchors.ts +19 -0
- package/corpus/templates/content/app/components/editor/database/DatabaseView.tsx +205 -71
- package/corpus/templates/content/app/components/editor/document-flush-participant.ts +253 -0
- package/corpus/templates/content/app/components/editor/editor-transaction-meta.ts +28 -0
- package/corpus/templates/content/app/components/editor/extensions/AudioBlock.tsx +2 -1
- package/corpus/templates/content/app/components/editor/extensions/ImageBlock.tsx +27 -6
- package/corpus/templates/content/app/components/editor/extensions/LocalMdxComponentNode.tsx +0 -1
- package/corpus/templates/content/app/components/editor/extensions/NotionExtensions.tsx +4 -4
- package/corpus/templates/content/app/components/editor/extensions/SuggestionHighlight.ts +24 -2
- package/corpus/templates/content/app/components/editor/extensions/VideoBlock.tsx +25 -6
- package/corpus/templates/content/app/components/editor/pending-document-persistence.ts +59 -1
- package/corpus/templates/content/app/components/editor/stored-body-images.ts +27 -0
- package/corpus/templates/content/app/components/editor/suggestions/presentation-rebase.ts +17 -0
- package/corpus/templates/content/app/components/sidebar/DocumentSidebar.tsx +11 -4
- package/corpus/templates/content/app/components/trash/TrashBrowser.tsx +4 -1
- package/corpus/templates/content/app/global.css +21 -0
- package/corpus/templates/content/app/hooks/use-content-trash.ts +8 -0
- package/corpus/templates/content/app/import-messages.ts +25 -0
- package/corpus/templates/content/app/trash-messages.ts +16 -0
- package/corpus/templates/content/changelog/2026-10-16-a-page-open-in-a-tab-that-shows-it-s-in-the-trash-reopens-wi.md +6 -0
- package/corpus/templates/content/changelog/2026-10-16-a-page-restored-from-trash-returns-to-its-place-in-its-colle.md +6 -0
- package/corpus/templates/content/changelog/2026-10-16-agent-written-markdown-keeps-nested-lists-indented-with-spac.md +6 -0
- package/corpus/templates/content/changelog/2026-10-16-opening-a-page-you-can-edit-no-longer-rebuilds-its-editor-on.md +6 -0
- package/corpus/templates/content/changelog/2026-10-16-pages-moved-or-imported-at-the-same-time-can-no-longer-end-u.md +6 -0
- package/corpus/templates/content/changelog/2026-10-16-re-importing-a-markdown-export-of-a-page-no-longer-reports-t.md +6 -0
- package/corpus/templates/content/changelog/2026-10-16-saving-a-page-or-restoring-one-of-its-versions-no-longer-fai.md +6 -0
- package/corpus/templates/content/changelog/2026-10-17-agents-reading-a-page-you-have-open-no-longer-wait-or-fail-w.md +6 -0
- package/corpus/templates/content/changelog/2026-10-19-fresh-document-reads-require-confirmation-from-every-open-ed.md +6 -0
- package/corpus/templates/content/changelog/2026-10-20-html-table-cells-preserve-a-trailing-backslash-when-opening-.md +6 -0
- package/corpus/templates/content/changelog/2026-10-20-preserve-empty-paragraph-colors-and-refuse-unsupported-inlin.md +6 -0
- package/corpus/templates/content/changelog/2026-10-20-the-advanced-filter-and-each-filter-group-inside-it-have-the.md +6 -0
- package/corpus/templates/content/changelog/2026-10-21-blocks-fields-keep-unconfirmed-saves-visible-and-agent-reads.md +6 -0
- package/corpus/templates/content/changelog/2026-10-21-preserve-compact-table-row-groups-and-report-invalid-block-colors.md +6 -0
- package/corpus/templates/content/changelog/2026-10-21-suggested-edits-show-an-agent-s-whole-reason-open-a-group-to.md +6 -0
- package/corpus/templates/content/changelog/2026-10-21-suggestions-keep-refusing-unmatched-emphasis-in-stored-markd.md +6 -0
- package/corpus/templates/content/changelog/2026-10-22-accept-remaining-and-reject-remaining-show-the-result-for-ev.md +6 -0
- package/corpus/templates/content/changelog/2026-10-22-accepting-a-group-of-suggested-edits-saves-faster-and-adds-o.md +6 -0
- package/corpus/templates/content/changelog/2026-10-22-agents-read-saved-page-text-after-failed-icon-change.md +6 -0
- package/corpus/templates/content/changelog/2026-10-22-changes-made-from-a-menu-or-popover-such-as-an-image-s-alt-t.md +6 -0
- package/corpus/templates/content/changelog/2026-10-22-text-an-agent-writes-inside-a-callout-column-or-synced-block.md +6 -0
- package/corpus/templates/content/e2e/auth-files.ts +28 -0
- package/corpus/templates/content/e2e/convergence-summary.ts +84 -29
- package/corpus/templates/content/e2e/gate-arm.ts +15 -0
- package/corpus/templates/content/e2e/global-setup.ts +43 -75
- package/corpus/templates/content/e2e/global-teardown.ts +34 -0
- package/corpus/templates/content/e2e/helpers.ts +598 -92
- package/corpus/templates/content/e2e/live-body-gate.ts +188 -0
- package/corpus/templates/content/e2e/playwright.config.ts +12 -3
- package/corpus/templates/content/e2e/server-identity.ts +47 -0
- package/corpus/templates/content/e2e/stored-form/collab-blocks.ts +123 -0
- package/corpus/templates/content/package.json +1 -1
- package/corpus/templates/content/scripts/_stored-form-census-kinds.ts +30 -2
- package/corpus/templates/content/scripts/historical-icon-apply.ts +9 -1
- package/corpus/templates/content/scripts/trace-startup.mjs +460 -133
- package/corpus/templates/content/server/db/exec.ts +58 -0
- package/corpus/templates/content/server/db/schema.ts +1 -0
- package/corpus/templates/content/server/lib/content-trash-purge.ts +208 -144
- package/corpus/templates/content/server/lib/document-metadata-updated-at.ts +43 -1
- package/corpus/templates/content/server/lib/document-revision.ts +23 -0
- package/corpus/templates/content/server/lib/live-body-writer.ts +199 -0
- package/corpus/templates/content/server/lib/notion-sync.ts +63 -29
- package/corpus/templates/content/server/lib/notion.ts +5 -5
- package/corpus/templates/content/server/lib/suggested-edits.ts +357 -230
- package/corpus/templates/content/server/plugins/db.ts +5 -0
- package/corpus/templates/content/server/routes/api/documents/[id]/move.patch.ts +50 -168
- package/corpus/templates/content/shared/api.ts +2 -0
- package/corpus/templates/content/shared/blocks-fields-manifest.ts +106 -0
- package/corpus/templates/content/shared/database-query.ts +192 -30
- package/corpus/templates/content/shared/document-export.ts +12 -14
- package/corpus/templates/content/shared/document-flush-protocol.ts +88 -0
- package/corpus/templates/content/shared/editor-save-state.ts +97 -0
- package/corpus/templates/content/shared/feature-flags.ts +10 -0
- package/corpus/templates/content/shared/import/markdown.ts +91 -7
- package/corpus/templates/content/shared/import/types.ts +2 -0
- package/corpus/templates/content/shared/inline-math.ts +6 -4
- package/corpus/templates/content/shared/nfm-fidelity.ts +247 -0
- package/corpus/templates/content/shared/nfm.ts +1933 -340
- package/corpus/templates/content/shared/suggestion-diff.ts +13 -0
- package/corpus/templates/content/shared/suggestion-formatting.ts +143 -20
- package/corpus/templates/content/shared/suggestion-text.ts +39 -0
- package/corpus/templates/content/vitest.config.ts +10 -0
- package/corpus/templates/crm/.agents/skills/actions/references/action-fields.md +1 -1
- package/corpus/templates/design/.agents/skills/actions/references/action-fields.md +1 -1
- package/corpus/templates/design/.agents/skills/native-effects/SKILL.md +9 -2
- package/corpus/templates/design/.generated/bridge/shader-fill-preview.generated.ts +3 -249
- package/corpus/templates/design/.generated/bridge/shader-runtime.generated.ts +5 -88
- package/corpus/templates/design/AGENTS.md +1 -3
- package/corpus/templates/design/CHANGELOG.md +32 -0
- package/corpus/templates/design/CODE_NATIVE_DESIGN_STUDIO_IMPLEMENTATION_PLAN.md +1 -6
- package/corpus/templates/design/DESIGN-STUDIO-PLAN.md +5 -7
- package/corpus/templates/design/actions/_native-local-export-server.ts +44 -31
- package/corpus/templates/design/actions/_native-render-contexts.ts +76 -21
- package/corpus/templates/design/actions/claim-native-local-export.ts +5 -0
- package/corpus/templates/design/actions/finish-native-local-export.ts +13 -2
- package/corpus/templates/design/actions/get-native-shader-approvals.ts +35 -0
- package/corpus/templates/design/actions/get-shader.ts +134 -219
- package/corpus/templates/design/actions/list-design-extensions.ts +3 -58
- package/corpus/templates/design/actions/request-native-local-export.ts +32 -6
- package/corpus/templates/design/actions/run-design-extension-action.ts +0 -29
- package/corpus/templates/design/app/components/design/DesignCanvas.tsx +131 -108
- package/corpus/templates/design/app/components/design/DesignExtensionsPanel.tsx +0 -218
- package/corpus/templates/design/app/components/design/DesignThumbnail.tsx +59 -3
- package/corpus/templates/design/app/components/design/EditPanel.tsx +35 -47
- package/corpus/templates/design/app/components/design/MultiScreenCanvas.tsx +242 -62
- package/corpus/templates/design/app/components/design/NativePreviewErrorBoundary.tsx +53 -0
- package/corpus/templates/design/app/components/design/bridge/codegen.ts +18 -3
- package/corpus/templates/design/app/components/design/bridge/native-composition-clock.ts +5 -4
- package/corpus/templates/design/app/components/design/bridge/native-dom.ts +37 -0
- package/corpus/templates/design/app/components/design/bridge/native-intrinsic-image.ts +2 -1
- package/corpus/templates/design/app/components/design/bridge/native-mesh-grid.ts +90 -0
- package/corpus/templates/design/app/components/design/bridge/native-opaque-public-asset.ts +363 -0
- package/corpus/templates/design/app/components/design/bridge/native-opaque-worker-lease.ts +179 -0
- package/corpus/templates/design/app/components/design/bridge/native-preview-geometry.ts +132 -7
- package/corpus/templates/design/app/components/design/bridge/native-preview-policy.ts +4 -0
- package/corpus/templates/design/app/components/design/bridge/native-preview-viewport-transport.ts +378 -0
- package/corpus/templates/design/app/components/design/bridge/native-scene-body-transform.ts +62 -0
- package/corpus/templates/design/app/components/design/bridge/native-scene-presentation-element.ts +10 -0
- package/corpus/templates/design/app/components/design/bridge/native-shader-runtime.bridge.ts +646 -167
- package/corpus/templates/design/app/components/design/bridge/native-source-provider.ts +246 -192
- package/corpus/templates/design/app/components/design/bridge/native-stateful-resource.ts +2 -2
- package/corpus/templates/design/app/components/design/bridge/native-stateless-compute.ts +5 -2
- package/corpus/templates/design/app/components/design/bridge/native-svg-source.ts +11 -1
- package/corpus/templates/design/app/components/design/bridge/native-worker-broker.ts +6 -0
- package/corpus/templates/design/app/components/design/bridge/native-worker-entry.ts +761 -303
- package/corpus/templates/design/app/components/design/bridge/native-worker-fill.ts +16 -6
- package/corpus/templates/design/app/components/design/bridge/native-worker-gpu.ts +854 -91
- package/corpus/templates/design/app/components/design/bridge/native-worker-host.ts +15 -1
- package/corpus/templates/design/app/components/design/bridge/native-worker-input-assets.ts +200 -0
- package/corpus/templates/design/app/components/design/bridge/native-worker-protocol.ts +40 -1
- package/corpus/templates/design/app/components/design/bridge/native-worker-scene-host.ts +425 -126
- package/corpus/templates/design/app/components/design/bridge/native-worker-source-snapshot.ts +21 -0
- package/corpus/templates/design/app/components/design/bridge/shader-fill-preview.bridge.ts +5 -371
- package/corpus/templates/design/app/components/design/bridge/shader-runtime.bridge.ts +4 -146
- package/corpus/templates/design/app/components/design/design-canvas/interact-document.ts +5 -9
- package/corpus/templates/design/app/components/design/design-canvas/native-preview-surface.ts +150 -0
- package/corpus/templates/design/app/components/design/design-canvas/native-public-asset-preview.ts +409 -0
- package/corpus/templates/design/app/components/design/design-canvas/native-public-worker-preview.ts +1086 -0
- package/corpus/templates/design/app/components/design/design-canvas/private-replay-screenshot-preview.ts +2 -2
- package/corpus/templates/design/app/components/design/edit-panel/effects-properties.tsx +15 -26
- package/corpus/templates/design/app/components/design/edit-panel/fill-properties.tsx +74 -67
- package/corpus/templates/design/app/components/design/edit-panel/panel-primitives.tsx +7 -19
- package/corpus/templates/design/app/components/design/inspector/DesignColorPicker.tsx +39 -30
- package/corpus/templates/design/app/components/design/inspector/GradientEditor.tsx +4 -0
- package/corpus/templates/design/app/components/design/inspector/NativeShaderColorControls.tsx +3 -7
- package/corpus/templates/design/app/components/design/inspector/NativeShaderPaintControls.tsx +12 -5
- package/corpus/templates/design/app/components/design/inspector/NativeShaderPanel.tsx +705 -190
- package/corpus/templates/design/app/components/design/inspector/fill-field-reading.ts +1 -2
- package/corpus/templates/design/app/components/design/inspector/index.ts +0 -6
- package/corpus/templates/design/app/components/design/inspector/native-catalog-display.ts +26 -5
- package/corpus/templates/design/app/components/design/inspector/native-shader-catalog-fixture.ts +42 -0
- package/corpus/templates/design/app/components/design/inspector/native-shader-catalog-preview.ts +51 -33
- package/corpus/templates/design/app/components/design/inspector/native-shader-paint.ts +1 -0
- package/corpus/templates/design/app/components/design/inspector/native-shader-property-draft.ts +89 -23
- package/corpus/templates/design/app/components/design/inspector/saved-glsl-shader.tsx +243 -0
- package/corpus/templates/design/app/components/design/multi-screen/board-surface-html.ts +54 -5
- package/corpus/templates/design/app/components/design/shader-source-coordination.ts +66 -0
- package/corpus/templates/design/app/components/design/use-native-shader-approvals.ts +36 -8
- package/corpus/templates/design/app/components/templates/TemplatePreview.tsx +60 -3
- package/corpus/templates/design/app/i18n/en-US.ts +78 -2
- package/corpus/templates/design/app/pages/Present.tsx +36 -1
- package/corpus/templates/design/app/pages/design-editor/commands/apply-file-content-update.ts +1 -1
- package/corpus/templates/design/app/pages/design-editor/commands/apply-local-content-update.ts +1 -1
- package/corpus/templates/design/app/pages/design-editor/commands/commit-visual-styles.ts +2 -3
- package/corpus/templates/design/app/pages/design-editor/commands/cross-screen-element-drop.ts +1 -1
- package/corpus/templates/design/app/pages/design-editor/commands/layer-move-to-screen.ts +1 -1
- package/corpus/templates/design/app/pages/design-editor/commands/paste-selection.ts +1 -1
- package/corpus/templates/design/app/pages/design-editor/commands/paste-svg-layer.ts +1 -1
- package/corpus/templates/design/app/pages/design-editor/commands/prepare-content-history-replay.ts +1 -1
- package/corpus/templates/design/app/pages/design-editor/commands/redo.ts +1 -1
- package/corpus/templates/design/app/pages/design-editor/commands/render-png-blob.ts +84 -41
- package/corpus/templates/design/app/pages/design-editor/commands/shader-source-edit.ts +1 -1
- package/corpus/templates/design/app/pages/design-editor/commands/undo.ts +1 -1
- package/corpus/templates/design/app/pages/design-editor/design-editor-view.tsx +0 -2
- package/corpus/templates/design/app/pages/design-editor/domains/use-editor-content-and-components.ts +4 -33
- package/corpus/templates/design/app/pages/design-editor/domains/use-editor-export-and-handoff.ts +2 -2
- package/corpus/templates/design/app/pages/design-editor/domains/use-editor-history.ts +0 -11
- package/corpus/templates/design/app/pages/design-editor/domains/use-editor-layer-models.ts +2 -55
- package/corpus/templates/design/app/pages/design-editor/domains/use-editor-screen-rendering.tsx +0 -3
- package/corpus/templates/design/app/pages/design-editor/domains/use-editor-selection-and-styles.ts +0 -24
- package/corpus/templates/design/app/pages/design-editor/text-edit-utils.ts +0 -16
- package/corpus/templates/design/app/pages/design-editor/use-native-local-export-requests.ts +70 -11
- package/corpus/templates/design/app/pages/design-editor/view/single-screen-canvas.tsx +0 -2
- package/corpus/templates/design/changelog/2026-10-20-folded-mesh-adds-an-animated-sculpted-fill-with-editable-col.md +6 -0
- package/corpus/templates/design/changelog/2026-10-20-read-only-design-views-render-native-shader-previews-in-nest.md +6 -0
- package/corpus/templates/design/changelog/2026-10-20-selected-screens-with-shader-effects-can-be-exported-togethe.md +6 -0
- package/corpus/templates/design/changelog/2026-10-20-shader-previews-reuse-validated-scene-data-while-panning-inc.md +6 -0
- package/corpus/templates/design/changelog/2026-10-20-shader-previews-stay-aligned-while-you-zoom.md +6 -0
- package/corpus/templates/design/changelog/2026-10-20-signed-out-sessions-no-longer-watch-for-private-png-export-r.md +6 -0
- package/corpus/templates/design/changelog/2026-10-21-effect-thumbnails-show-richer-previews.md +6 -0
- package/corpus/templates/design/changelog/2026-10-21-native-effects-render-across-previews.md +6 -0
- package/corpus/templates/design/changelog/2026-10-21-native-shader-previews-use-less-gpu-memory-when-many-mesh-ef.md +6 -0
- package/corpus/templates/design/changelog/2026-10-21-opening-design-no-longer-shows-png-export-errors-when-no-exp.md +6 -0
- package/corpus/templates/design/changelog/2026-10-21-pulsing-border-controls-grouped.md +6 -0
- package/corpus/templates/design/changelog/2026-10-21-pulsing-border-follows-element-outlines.md +6 -0
- package/corpus/templates/design/changelog/2026-10-21-remove-obsolete-shader-fills.md +6 -0
- package/corpus/templates/design/changelog/2026-10-21-shader-previews-recover-from-temporary-gpu-and-image-failure.md +6 -0
- package/corpus/templates/design/changelog/2026-10-22-shader-fills-and-effects-render-correctly-on-canvas-elements.md +6 -0
- package/corpus/templates/design/package.json +0 -1
- package/corpus/templates/design/playwright.config.ts +1 -1
- package/corpus/templates/design/scripts/runtime-budget-zoom.ts +9 -21
- package/corpus/templates/design/scripts/runtime-budget.ts +10 -24
- package/corpus/templates/design/server/plugins/agent-chat.ts +0 -2
- package/corpus/templates/design/shared/effect-graph.ts +46 -1
- package/corpus/templates/design/shared/generation-output-receipt.ts +0 -1
- package/corpus/templates/design/shared/native-effect-animation-capability.ts +6 -0
- package/corpus/templates/design/shared/native-effect-folded-mesh-v1.ts +268 -0
- package/corpus/templates/design/shared/native-effect-folded-mesh-v2.ts +310 -0
- package/corpus/templates/design/shared/native-effect-folded-mesh.ts +489 -0
- package/corpus/templates/design/shared/native-effect-gallery-additions.ts +2 -2
- package/corpus/templates/design/shared/native-effect-paint.ts +8 -0
- package/corpus/templates/design/shared/native-effect-parameter-constraints.ts +8 -1
- package/corpus/templates/design/shared/native-effect-presets.ts +18 -1
- package/corpus/templates/design/shared/native-effect-property-presentation.ts +81 -0
- package/corpus/templates/design/shared/native-effect-pulsing-border-v3.ts +281 -0
- package/corpus/templates/design/shared/native-effect-pulsing-border-v4.ts +284 -0
- package/corpus/templates/design/shared/native-effect-pulsing-border.ts +300 -0
- package/corpus/templates/design/shared/native-effect-trust.ts +6 -0
- package/corpus/templates/design/shared/native-effect-wgsl.ts +12 -0
- package/corpus/templates/design/shared/native-effects.ts +528 -15
- package/corpus/templates/design/shared/native-input-resources.ts +36 -0
- package/corpus/templates/design/shared/native-local-export.ts +14 -0
- package/corpus/templates/design/shared/native-parameter-animation.ts +1 -0
- package/corpus/templates/design/shared/native-pointer-input.ts +9 -11
- package/corpus/templates/design/shared/shader-fills.ts +0 -513
- package/corpus/templates/design/vitest.setup.ts +7 -1
- package/corpus/templates/dispatch/.agents/skills/actions/references/action-fields.md +1 -1
- package/corpus/templates/dispatch/.agents/skills/turn-into-app/SKILL.md +20 -18
- package/corpus/templates/factory/.agents/skills/actions/references/action-fields.md +1 -1
- package/corpus/templates/factory/.agents/skills/review-latest-feedback/SKILL.md +36 -80
- package/corpus/templates/factory/.agents/skills/review-latest-feedback/references/channel-inventory.md +54 -16
- package/corpus/templates/factory/.agents/skills/review-latest-feedback/references/slack-reaction-replies.md +50 -73
- package/corpus/templates/factory/.agents/skills/turn-into-app/SKILL.md +20 -18
- package/corpus/templates/forms/.agents/skills/actions/references/action-fields.md +1 -1
- package/corpus/templates/mail/.agents/skills/actions/references/action-fields.md +1 -1
- package/corpus/templates/plan/.agents/skills/actions/references/action-fields.md +1 -1
- package/corpus/templates/slides/.agents/skills/actions/references/action-fields.md +1 -1
- package/corpus/templates/slides-2/.agents/skills/actions/SKILL.md +199 -0
- package/corpus/templates/slides-2/.agents/skills/actions/references/action-fields.md +145 -0
- package/corpus/templates/slides-2/.agents/skills/actions/references/examples.md +96 -0
- package/corpus/templates/slides-2/.agents/skills/actions/references/provider-apis.md +95 -0
- package/corpus/templates/slides-2/.agents/skills/adding-a-feature/SKILL.md +235 -0
- package/corpus/templates/slides-2/.agents/skills/agent-native-docs/SKILL.md +161 -0
- package/corpus/templates/slides-2/.agents/skills/agent-native-toolkit/SKILL.md +314 -0
- package/corpus/templates/slides-2/.agents/skills/analytics-data-for-decks/SKILL.md +44 -0
- package/corpus/templates/slides-2/.agents/skills/apply-slide-comments/SKILL.md +63 -0
- package/corpus/templates/slides-2/.agents/skills/client-side-routing/SKILL.md +87 -0
- package/corpus/templates/slides-2/.agents/skills/context-awareness/SKILL.md +282 -0
- package/corpus/templates/slides-2/.agents/skills/create-deck/SKILL.md +263 -0
- package/corpus/templates/slides-2/.agents/skills/create-deck/references/reference-inputs.md +72 -0
- package/corpus/templates/slides-2/.agents/skills/create-deck/references/slide-templates.md +93 -0
- package/corpus/templates/slides-2/.agents/skills/create-deck/references/source-material.md +16 -0
- package/corpus/templates/slides-2/.agents/skills/creative-context/SKILL.md +134 -0
- package/corpus/templates/slides-2/.agents/skills/customizing-agent-native/SKILL.md +219 -0
- package/corpus/templates/slides-2/.agents/skills/deck-management/SKILL.md +182 -0
- package/corpus/templates/slides-2/.agents/skills/delegate-to-agent/SKILL.md +62 -0
- package/corpus/templates/slides-2/.agents/skills/design-systems/SKILL.md +233 -0
- package/corpus/templates/slides-2/.agents/skills/external-agents/SKILL.md +549 -0
- package/corpus/templates/slides-2/.agents/skills/external-agents/references/mcp-apps-embedding.md +169 -0
- package/corpus/templates/slides-2/.agents/skills/frontend-design/SKILL.md +102 -0
- package/corpus/templates/slides-2/.agents/skills/frontend-design/references/visual-direction.md +102 -0
- package/corpus/templates/slides-2/.agents/skills/image-generation-via-a2a/SKILL.md +134 -0
- package/corpus/templates/slides-2/.agents/skills/performance/SKILL.md +79 -0
- package/corpus/templates/slides-2/.agents/skills/portability/SKILL.md +108 -0
- package/corpus/templates/slides-2/.agents/skills/real-time-sync/SKILL.md +146 -0
- package/corpus/templates/slides-2/.agents/skills/reliable-mutations/SKILL.md +72 -0
- package/corpus/templates/slides-2/.agents/skills/secrets/SKILL.md +82 -0
- package/corpus/templates/slides-2/.agents/skills/security/SKILL.md +80 -0
- package/corpus/templates/slides-2/.agents/skills/self-modifying-code/SKILL.md +123 -0
- package/corpus/templates/slides-2/.agents/skills/shadcn-ui/SKILL.md +71 -0
- package/corpus/templates/slides-2/.agents/skills/sharing/SKILL.md +286 -0
- package/corpus/templates/slides-2/.agents/skills/slide-design/SKILL.md +144 -0
- package/corpus/templates/slides-2/.agents/skills/slide-editing/SKILL.md +284 -0
- package/corpus/templates/slides-2/.agents/skills/slide-editing/references/animations.md +33 -0
- package/corpus/templates/slides-2/.agents/skills/slide-editing/references/freeform-objects.md +22 -0
- package/corpus/templates/slides-2/.agents/skills/slide-editing/references/restyling.md +69 -0
- package/corpus/templates/slides-2/.agents/skills/slide-editing/references/transitions.md +26 -0
- package/corpus/templates/slides-2/.agents/skills/slide-editing/references/video.md +45 -0
- package/corpus/templates/slides-2/.agents/skills/slide-images/SKILL.md +136 -0
- package/corpus/templates/slides-2/.agents/skills/storing-data/SKILL.md +234 -0
- package/corpus/templates/slides-2/.agents/skills/turn-into-skill/SKILL.md +112 -0
- package/corpus/templates/slides-2/.agents/skills/turn-into-skill/agents/openai.yaml +4 -0
- package/corpus/templates/slides-2/.agents/skills/workspace-conventions/SKILL.md +103 -0
- package/corpus/templates/slides-2/.builder/rules/deploy-app.mdc +22 -0
- package/corpus/templates/slides-2/.builder/rules/organize-ui.mdc +9 -0
- package/corpus/templates/slides-2/.dockerignore +61 -0
- package/corpus/templates/slides-2/.env.example +23 -0
- package/corpus/templates/slides-2/.ignore +3 -0
- package/corpus/templates/slides-2/.mcp.json +8 -0
- package/corpus/templates/slides-2/.oxfmtrc.json +8 -0
- package/corpus/templates/slides-2/AGENTS.md +66 -0
- package/corpus/templates/slides-2/CHANGELOG.md +76 -0
- package/corpus/templates/slides-2/DEVELOPING.md +157 -0
- package/corpus/templates/slides-2/README.md +58 -0
- package/corpus/templates/slides-2/THIRD_PARTY_NOTICES.md +33 -0
- package/corpus/templates/slides-2/_gitignore +38 -0
- package/corpus/templates/slides-2/actions/_agent-presence.ts +29 -0
- package/corpus/templates/slides-2/actions/_app-url.ts +37 -0
- package/corpus/templates/slides-2/actions/_deck-app-scope.ts +30 -0
- package/corpus/templates/slides-2/actions/_deck-tracking.ts +260 -0
- package/corpus/templates/slides-2/actions/_deck-write.ts +206 -0
- package/corpus/templates/slides-2/actions/_imported-slide-source.ts +162 -0
- package/corpus/templates/slides-2/actions/_inline-image-storage.ts +1013 -0
- package/corpus/templates/slides-2/actions/_linked-design-system.ts +83 -0
- package/corpus/templates/slides-2/actions/_presenter-notes.ts +83 -0
- package/corpus/templates/slides-2/actions/_render-artifacts.ts +111 -0
- package/corpus/templates/slides-2/actions/_slide-source.ts +344 -0
- package/corpus/templates/slides-2/actions/_tab-state.ts +51 -0
- package/corpus/templates/slides-2/actions/_test-brandfetch.ts +31 -0
- package/corpus/templates/slides-2/actions/_uploaded-files.ts +114 -0
- package/corpus/templates/slides-2/actions/add-deck.ts +123 -0
- package/corpus/templates/slides-2/actions/add-slide-comment.ts +267 -0
- package/corpus/templates/slides-2/actions/add-slide.ts +888 -0
- package/corpus/templates/slides-2/actions/analyze-brand-assets.ts +66 -0
- package/corpus/templates/slides-2/actions/apply-design-system.ts +111 -0
- package/corpus/templates/slides-2/actions/approve-deck-access-request.ts +287 -0
- package/corpus/templates/slides-2/actions/audit-contrast.ts +143 -0
- package/corpus/templates/slides-2/actions/check-image-gen.ts +17 -0
- package/corpus/templates/slides-2/actions/clone-context-slide.ts +340 -0
- package/corpus/templates/slides-2/actions/clone-creative-context-deck.ts +143 -0
- package/corpus/templates/slides-2/actions/control-deck-history.ts +186 -0
- package/corpus/templates/slides-2/actions/control-presenter.ts +117 -0
- package/corpus/templates/slides-2/actions/control-slide-editor.ts +267 -0
- package/corpus/templates/slides-2/actions/create-deck-from-template.ts +274 -0
- package/corpus/templates/slides-2/actions/create-deck.ts +1243 -0
- package/corpus/templates/slides-2/actions/create-design-system.ts +131 -0
- package/corpus/templates/slides-2/actions/create-share-link.ts +127 -0
- package/corpus/templates/slides-2/actions/db-health.ts +22 -0
- package/corpus/templates/slides-2/actions/delete-asset.ts +154 -0
- package/corpus/templates/slides-2/actions/delete-deck.ts +427 -0
- package/corpus/templates/slides-2/actions/delete-design-system.ts +167 -0
- package/corpus/templates/slides-2/actions/delete-slide-comment.ts +143 -0
- package/corpus/templates/slides-2/actions/delete-staged-dataset.ts +30 -0
- package/corpus/templates/slides-2/actions/duplicate-deck.ts +299 -0
- package/corpus/templates/slides-2/actions/export-google-slides.ts +41 -0
- package/corpus/templates/slides-2/actions/export-html.ts +770 -0
- package/corpus/templates/slides-2/actions/export-pptx.ts +2203 -0
- package/corpus/templates/slides-2/actions/extract-pdf.ts +49 -0
- package/corpus/templates/slides-2/actions/generate-image-api.ts +671 -0
- package/corpus/templates/slides-2/actions/generate-image.ts +492 -0
- package/corpus/templates/slides-2/actions/get-agent-access-deck.ts +52 -0
- package/corpus/templates/slides-2/actions/get-deck-access-status.ts +130 -0
- package/corpus/templates/slides-2/actions/get-deck-design-tokens.ts +62 -0
- package/corpus/templates/slides-2/actions/get-deck-reference-context.ts +232 -0
- package/corpus/templates/slides-2/actions/get-deck-template.ts +38 -0
- package/corpus/templates/slides-2/actions/get-deck-version.ts +85 -0
- package/corpus/templates/slides-2/actions/get-deck.ts +562 -0
- package/corpus/templates/slides-2/actions/get-design-system-decode-job-status.ts +57 -0
- package/corpus/templates/slides-2/actions/get-design-system-tier-limit.ts +12 -0
- package/corpus/templates/slides-2/actions/get-design-system.ts +453 -0
- package/corpus/templates/slides-2/actions/get-google-docs-status.ts +106 -0
- package/corpus/templates/slides-2/actions/get-google-picker-token.ts +84 -0
- package/corpus/templates/slides-2/actions/get-home-suggestions.ts +52 -0
- package/corpus/templates/slides-2/actions/get-layout-overflows.ts +192 -0
- package/corpus/templates/slides-2/actions/get-slide-render.ts +125 -0
- package/corpus/templates/slides-2/actions/get-slide-source.ts +115 -0
- package/corpus/templates/slides-2/actions/get-slide-theme-preview.ts +64 -0
- package/corpus/templates/slides-2/actions/get-slide-theme.ts +44 -0
- package/corpus/templates/slides-2/actions/get-slides-2-upload-storage-status.ts +17 -0
- package/corpus/templates/slides-2/actions/get-slides-notification-prefs.ts +37 -0
- package/corpus/templates/slides-2/actions/get-workspace-defaults.ts +51 -0
- package/corpus/templates/slides-2/actions/image-gen-status.ts +35 -0
- package/corpus/templates/slides-2/actions/import-code.ts +26 -0
- package/corpus/templates/slides-2/actions/import-design-project.ts +49 -0
- package/corpus/templates/slides-2/actions/import-document.ts +125 -0
- package/corpus/templates/slides-2/actions/import-docx.ts +57 -0
- package/corpus/templates/slides-2/actions/import-file.ts +1273 -0
- package/corpus/templates/slides-2/actions/import-from-url.ts +25 -0
- package/corpus/templates/slides-2/actions/import-google-doc.ts +208 -0
- package/corpus/templates/slides-2/actions/import-google-font.ts +110 -0
- package/corpus/templates/slides-2/actions/import-google-slides-reference.ts +667 -0
- package/corpus/templates/slides-2/actions/import-pptx.ts +564 -0
- package/corpus/templates/slides-2/actions/import-svgl-logo.ts +115 -0
- package/corpus/templates/slides-2/actions/index-design-system-with-builder.ts +181 -0
- package/corpus/templates/slides-2/actions/index-uploaded-design-system-files.ts +77 -0
- package/corpus/templates/slides-2/actions/list-assets.ts +286 -0
- package/corpus/templates/slides-2/actions/list-deck-templates.ts +83 -0
- package/corpus/templates/slides-2/actions/list-deck-versions.ts +185 -0
- package/corpus/templates/slides-2/actions/list-decks.ts +591 -0
- package/corpus/templates/slides-2/actions/list-design-systems.ts +180 -0
- package/corpus/templates/slides-2/actions/list-slide-comments.ts +128 -0
- package/corpus/templates/slides-2/actions/list-slide-themes.ts +17 -0
- package/corpus/templates/slides-2/actions/list-staged-datasets.ts +14 -0
- package/corpus/templates/slides-2/actions/logo-config.ts +13 -0
- package/corpus/templates/slides-2/actions/navigate.ts +158 -0
- package/corpus/templates/slides-2/actions/patch-deck.ts +2378 -0
- package/corpus/templates/slides-2/actions/provider-api-catalog.ts +25 -0
- package/corpus/templates/slides-2/actions/provider-api-docs.ts +83 -0
- package/corpus/templates/slides-2/actions/provider-api-request.ts +222 -0
- package/corpus/templates/slides-2/actions/query-staged-dataset.ts +83 -0
- package/corpus/templates/slides-2/actions/read-composer-source.ts +108 -0
- package/corpus/templates/slides-2/actions/request-deck-access.ts +803 -0
- package/corpus/templates/slides-2/actions/restore-deck-version.ts +203 -0
- package/corpus/templates/slides-2/actions/run.ts +2 -0
- package/corpus/templates/slides-2/actions/save-deck.ts +313 -0
- package/corpus/templates/slides-2/actions/search-google-fonts.ts +61 -0
- package/corpus/templates/slides-2/actions/search-images.ts +30 -0
- package/corpus/templates/slides-2/actions/search-logos.ts +23 -0
- package/corpus/templates/slides-2/actions/search-svgl-logos.ts +42 -0
- package/corpus/templates/slides-2/actions/set-default-design-system.ts +88 -0
- package/corpus/templates/slides-2/actions/set-workspace-defaults.ts +61 -0
- package/corpus/templates/slides-2/actions/start-design-system-upload.ts +80 -0
- package/corpus/templates/slides-2/actions/sync-design-system-with-builder.ts +84 -0
- package/corpus/templates/slides-2/actions/toggle-slide-comment-reaction.ts +150 -0
- package/corpus/templates/slides-2/actions/transform-slide-objects.ts +1528 -0
- package/corpus/templates/slides-2/actions/update-asset.ts +499 -0
- package/corpus/templates/slides-2/actions/update-deck-aspect-ratio.ts +95 -0
- package/corpus/templates/slides-2/actions/update-deck-design-tokens.ts +175 -0
- package/corpus/templates/slides-2/actions/update-design-system.ts +95 -0
- package/corpus/templates/slides-2/actions/update-slide-comment.ts +213 -0
- package/corpus/templates/slides-2/actions/update-slide-source.ts +353 -0
- package/corpus/templates/slides-2/actions/update-slide.ts +850 -0
- package/corpus/templates/slides-2/actions/update-slides-notification-prefs.ts +55 -0
- package/corpus/templates/slides-2/actions/view-screen.ts +1098 -0
- package/corpus/templates/slides-2/agent-native.app-skill.json +165 -0
- package/corpus/templates/slides-2/agent-native.config.ts +20 -0
- package/corpus/templates/slides-2/agent-native.json +18 -0
- package/corpus/templates/slides-2/app/components/ThemeToggle.tsx +47 -0
- package/corpus/templates/slides-2/app/components/comments/SlideCommentPins.tsx +781 -0
- package/corpus/templates/slides-2/app/components/comments/SlideCommentsPanel.tsx +1075 -0
- package/corpus/templates/slides-2/app/components/deck/DeckCard.tsx +304 -0
- package/corpus/templates/slides-2/app/components/deck/DeckFilterMenu.tsx +83 -0
- package/corpus/templates/slides-2/app/components/deck/ExcalidrawSlide.tsx +183 -0
- package/corpus/templates/slides-2/app/components/deck/MermaidRenderer.tsx +126 -0
- package/corpus/templates/slides-2/app/components/deck/SlideRenderer.tsx +1553 -0
- package/corpus/templates/slides-2/app/components/design-system/DesignSystemCard.tsx +235 -0
- package/corpus/templates/slides-2/app/components/design-system/DesignSystemSetup.tsx +2021 -0
- package/corpus/templates/slides-2/app/components/design-system/builder-design-system-upload.ts +200 -0
- package/corpus/templates/slides-2/app/components/design-system/builder-index-response.ts +104 -0
- package/corpus/templates/slides-2/app/components/editor/AddSlidePopover.tsx +461 -0
- package/corpus/templates/slides-2/app/components/editor/AiEditingMarker.tsx +24 -0
- package/corpus/templates/slides-2/app/components/editor/AlignmentGuides.tsx +82 -0
- package/corpus/templates/slides-2/app/components/editor/AnimationsPanel.tsx +698 -0
- package/corpus/templates/slides-2/app/components/editor/AppMenu.tsx +356 -0
- package/corpus/templates/slides-2/app/components/editor/AssetLibraryPanel.tsx +508 -0
- package/corpus/templates/slides-2/app/components/editor/BlockBubbleMenu.tsx +548 -0
- package/corpus/templates/slides-2/app/components/editor/DeckAccessDeniedPage.tsx +173 -0
- package/corpus/templates/slides-2/app/components/editor/DeckEditorSkeleton.tsx +35 -0
- package/corpus/templates/slides-2/app/components/editor/DeferredPopoverFallback.tsx +148 -0
- package/corpus/templates/slides-2/app/components/editor/EditorActionCluster.tsx +217 -0
- package/corpus/templates/slides-2/app/components/editor/EditorSidebar.tsx +1047 -0
- package/corpus/templates/slides-2/app/components/editor/EditorToolbar.tsx +1285 -0
- package/corpus/templates/slides-2/app/components/editor/ExportMenu.tsx +579 -0
- package/corpus/templates/slides-2/app/components/editor/GeneratingOverlay.tsx +21 -0
- package/corpus/templates/slides-2/app/components/editor/GeneratingSlidePreview.tsx +73 -0
- package/corpus/templates/slides-2/app/components/editor/GoogleDocImportHint.tsx +378 -0
- package/corpus/templates/slides-2/app/components/editor/GoogleDriveConnectionCta.tsx +154 -0
- package/corpus/templates/slides-2/app/components/editor/GoogleSlidesReferenceImport.tsx +299 -0
- package/corpus/templates/slides-2/app/components/editor/HistoryPanel.tsx +354 -0
- package/corpus/templates/slides-2/app/components/editor/HomeQuickStartDialog.tsx +202 -0
- package/corpus/templates/slides-2/app/components/editor/ImageCropOverlay.tsx +820 -0
- package/corpus/templates/slides-2/app/components/editor/ImageDropPromptPopover.tsx +280 -0
- package/corpus/templates/slides-2/app/components/editor/ImageGenPanel.tsx +244 -0
- package/corpus/templates/slides-2/app/components/editor/ImageOverlay.tsx +280 -0
- package/corpus/templates/slides-2/app/components/editor/ImageSearchPanel.tsx +183 -0
- package/corpus/templates/slides-2/app/components/editor/ImportDeckButton.tsx +247 -0
- package/corpus/templates/slides-2/app/components/editor/LogoSearchPanel.tsx +366 -0
- package/corpus/templates/slides-2/app/components/editor/MermaidToExcalidrawPanel.tsx +99 -0
- package/corpus/templates/slides-2/app/components/editor/MissingDeckAccessPane.tsx +219 -0
- package/corpus/templates/slides-2/app/components/editor/NewDeckReferenceStep.tsx +812 -0
- package/corpus/templates/slides-2/app/components/editor/PromptDialog.tsx +963 -0
- package/corpus/templates/slides-2/app/components/editor/QuestionFlow.tsx +119 -0
- package/corpus/templates/slides-2/app/components/editor/RequestDeckAccessDialog.tsx +101 -0
- package/corpus/templates/slides-2/app/components/editor/ShareDialog.tsx +126 -0
- package/corpus/templates/slides-2/app/components/editor/SlideContextToolbar.tsx +1471 -0
- package/corpus/templates/slides-2/app/components/editor/SlideEditor.tsx +11183 -0
- package/corpus/templates/slides-2/app/components/editor/SlideOverflowWarning.tsx +82 -0
- package/corpus/templates/slides-2/app/components/editor/SlideScrollStack.tsx +307 -0
- package/corpus/templates/slides-2/app/components/editor/SlideSlashCommandMenu.tsx +692 -0
- package/corpus/templates/slides-2/app/components/editor/SlideThumbnailContextMenu.tsx +52 -0
- package/corpus/templates/slides-2/app/components/editor/SlideTransitionControl.tsx +184 -0
- package/corpus/templates/slides-2/app/components/editor/SlidesComposerContext.tsx +789 -0
- package/corpus/templates/slides-2/app/components/editor/SlidesComposerContextProvider.tsx +74 -0
- package/corpus/templates/slides-2/app/components/editor/SlidesLayersPanel.tsx +377 -0
- package/corpus/templates/slides-2/app/components/editor/SpeakerNotesPanel.tsx +119 -0
- package/corpus/templates/slides-2/app/components/editor/TweaksPanel.tsx +77 -0
- package/corpus/templates/slides-2/app/components/editor/UploadStorageGate.tsx +37 -0
- package/corpus/templates/slides-2/app/components/editor/bullet-editing.ts +880 -0
- package/corpus/templates/slides-2/app/components/editor/canvas-interactions/index.ts +12 -0
- package/corpus/templates/slides-2/app/components/editor/canvas-interactions/slides-canvas-adapter.ts +119 -0
- package/corpus/templates/slides-2/app/components/editor/commit-active-edit.ts +14 -0
- package/corpus/templates/slides-2/app/components/editor/editor-command-model.ts +35 -0
- package/corpus/templates/slides-2/app/components/editor/fit-text-object.ts +31 -0
- package/corpus/templates/slides-2/app/components/editor/in-place-text-session.browser-cases.json +983 -0
- package/corpus/templates/slides-2/app/components/editor/in-place-text-session.browser-host.ts +747 -0
- package/corpus/templates/slides-2/app/components/editor/in-place-text-session.ts +6891 -0
- package/corpus/templates/slides-2/app/components/editor/inline-edit-session.ts +26 -0
- package/corpus/templates/slides-2/app/components/editor/list-editing.ts +501 -0
- package/corpus/templates/slides-2/app/components/editor/rich-text-selection.ts +975 -0
- package/corpus/templates/slides-2/app/components/editor/rte-test-utils.ts +265 -0
- package/corpus/templates/slides-2/app/components/editor/selection-overlay-measurement.ts +191 -0
- package/corpus/templates/slides-2/app/components/editor/slide-escape-arbiter.ts +34 -0
- package/corpus/templates/slides-2/app/components/editor/slide-object-interactions.ts +6362 -0
- package/corpus/templates/slides-2/app/components/editor/slide-object-transform.browser-host.ts +19 -0
- package/corpus/templates/slides-2/app/components/editor/slide-pointer-target.ts +432 -0
- package/corpus/templates/slides-2/app/components/editor/slide-presence.ts +13 -0
- package/corpus/templates/slides-2/app/components/editor/slide-style.ts +243 -0
- package/corpus/templates/slides-2/app/components/editor/slide-text-targets.ts +540 -0
- package/corpus/templates/slides-2/app/components/editor/style-clipboard.ts +102 -0
- package/corpus/templates/slides-2/app/components/editor/use-prompt-import.ts +159 -0
- package/corpus/templates/slides-2/app/components/home/SlidesHomeLibrary.tsx +79 -0
- package/corpus/templates/slides-2/app/components/layout/AgentWorkIndicator.tsx +193 -0
- package/corpus/templates/slides-2/app/components/layout/Header.tsx +110 -0
- package/corpus/templates/slides-2/app/components/layout/Layout.tsx +492 -0
- package/corpus/templates/slides-2/app/components/layout/Sidebar.tsx +109 -0
- package/corpus/templates/slides-2/app/components/layout/layout-route-policy.ts +28 -0
- package/corpus/templates/slides-2/app/components/presentation/PresentationView.tsx +1116 -0
- package/corpus/templates/slides-2/app/components/presentation/PresenterView.tsx +526 -0
- package/corpus/templates/slides-2/app/components/presentation/SlideTransitionStage.tsx +297 -0
- package/corpus/templates/slides-2/app/components/presentation/present-channel.ts +31 -0
- package/corpus/templates/slides-2/app/components/presentation/slide-build-steps.ts +231 -0
- package/corpus/templates/slides-2/app/components/presentation/slide-navigation.ts +273 -0
- package/corpus/templates/slides-2/app/components/presentation/slide-transition-motion.ts +258 -0
- package/corpus/templates/slides-2/app/components/presentation/voice-navigation.ts +61 -0
- package/corpus/templates/slides-2/app/components/settings/notification-settings.tsx +93 -0
- package/corpus/templates/slides-2/app/components/slides-2-editor/Slides2AssetBrowser.tsx +726 -0
- package/corpus/templates/slides-2/app/components/slides-2-editor/Slides2CommandMenu.tsx +453 -0
- package/corpus/templates/slides-2/app/components/slides-2-editor/Slides2Comments.tsx +571 -0
- package/corpus/templates/slides-2/app/components/slides-2-editor/Slides2DesignTokens.tsx +345 -0
- package/corpus/templates/slides-2/app/components/slides-2-editor/Slides2Editor.tsx +4804 -0
- package/corpus/templates/slides-2/app/components/slides-2-editor/Slides2ExportMenu.tsx +671 -0
- package/corpus/templates/slides-2/app/components/slides-2-editor/Slides2FontBrowser.tsx +342 -0
- package/corpus/templates/slides-2/app/components/slides-2-editor/Slides2ImageCropControls.tsx +487 -0
- package/corpus/templates/slides-2/app/components/slides-2-editor/Slides2Inspector.tsx +950 -0
- package/corpus/templates/slides-2/app/components/slides-2-editor/Slides2SvglLogoSearchDialog.tsx +332 -0
- package/corpus/templates/slides-2/app/components/slides-2-editor/cross-slide-edit-history.ts +151 -0
- package/corpus/templates/slides-2/app/components/slides-2-editor/design-token-presets.ts +140 -0
- package/corpus/templates/slides-2/app/components/slides-2-editor/editor-action-errors.ts +47 -0
- package/corpus/templates/slides-2/app/components/slides-2-editor/editor-export-errors.ts +60 -0
- package/corpus/templates/slides-2/app/components/slides-2-editor/geometry.ts +275 -0
- package/corpus/templates/slides-2/app/components/slides-2-editor/image-crop-style.ts +82 -0
- package/corpus/templates/slides-2/app/components/slides-2-editor/inline-text-editor.tsx +631 -0
- package/corpus/templates/slides-2/app/components/slides-2-editor/keyboard-shortcuts.ts +104 -0
- package/corpus/templates/slides-2/app/components/slides-2-editor/object-insertion.ts +13 -0
- package/corpus/templates/slides-2/app/components/slides-2-editor/preview-patches.ts +54 -0
- package/corpus/templates/slides-2/app/components/slides-2-editor/sandbox-render-errors.ts +23 -0
- package/corpus/templates/slides-2/app/components/slides-2-editor/source-structure.ts +634 -0
- package/corpus/templates/slides-2/app/components/slides-2-editor/types.ts +85 -0
- package/corpus/templates/slides-2/app/components/slides-2-presenter/Slides2BlackoutOverlay.tsx +13 -0
- package/corpus/templates/slides-2/app/components/slides-2-presenter/Slides2ControlBar.tsx +285 -0
- package/corpus/templates/slides-2/app/components/slides-2-presenter/Slides2HelpDialog.tsx +72 -0
- package/corpus/templates/slides-2/app/components/slides-2-presenter/Slides2JumpInput.tsx +38 -0
- package/corpus/templates/slides-2/app/components/slides-2-presenter/Slides2LaserPointer.tsx +67 -0
- package/corpus/templates/slides-2/app/components/slides-2-presenter/Slides2Overview.tsx +161 -0
- package/corpus/templates/slides-2/app/components/slides-2-presenter/Slides2Player.tsx +839 -0
- package/corpus/templates/slides-2/app/components/slides-2-presenter/Slides2ProgressBar.tsx +23 -0
- package/corpus/templates/slides-2/app/components/slides-2-presenter/keyboard.ts +36 -0
- package/corpus/templates/slides-2/app/components/slides-2-presenter/presenter-channel.ts +131 -0
- package/corpus/templates/slides-2/app/components/slides-2-presenter/use-presenter-action-bridge.ts +296 -0
- package/corpus/templates/slides-2/app/components/slides-2-presenter/useSlides2TouchSwipe.ts +80 -0
- package/corpus/templates/slides-2/app/components/slides-2-runtime/SandboxedSlide.tsx +724 -0
- package/corpus/templates/slides-2/app/components/slides-2-runtime/SlideContentRenderer.tsx +137 -0
- package/corpus/templates/slides-2/app/components/slides-2-runtime/Slides2Canvas.tsx +99 -0
- package/corpus/templates/slides-2/app/components/slides-2-runtime/constants.ts +4 -0
- package/corpus/templates/slides-2/app/components/slides-2-runtime/protocol.ts +1400 -0
- package/corpus/templates/slides-2/app/components/slides-2-runtime/transition-frame.ts +439 -0
- package/corpus/templates/slides-2/app/components/templates/DeckTemplateLibrary.tsx +314 -0
- package/corpus/templates/slides-2/app/components/templates/DeckTemplatePreview.tsx +60 -0
- package/corpus/templates/slides-2/app/components/templates/DeckTemplateStage.tsx +45 -0
- package/corpus/templates/slides-2/app/components/ui/alert-dialog.tsx +1 -0
- package/corpus/templates/slides-2/app/components/ui/avatar.tsx +1 -0
- package/corpus/templates/slides-2/app/components/ui/button-group.tsx +1 -0
- package/corpus/templates/slides-2/app/components/ui/button.tsx +1 -0
- package/corpus/templates/slides-2/app/components/ui/card.tsx +1 -0
- package/corpus/templates/slides-2/app/components/ui/command.tsx +1 -0
- package/corpus/templates/slides-2/app/components/ui/context-menu.tsx +32 -0
- package/corpus/templates/slides-2/app/components/ui/dialog.tsx +1 -0
- package/corpus/templates/slides-2/app/components/ui/dropdown-menu.tsx +1 -0
- package/corpus/templates/slides-2/app/components/ui/filter-trigger.tsx +1 -0
- package/corpus/templates/slides-2/app/components/ui/input.tsx +1 -0
- package/corpus/templates/slides-2/app/components/ui/label.tsx +1 -0
- package/corpus/templates/slides-2/app/components/ui/popover.tsx +1 -0
- package/corpus/templates/slides-2/app/components/ui/progress.tsx +1 -0
- package/corpus/templates/slides-2/app/components/ui/scroll-area.tsx +1 -0
- package/corpus/templates/slides-2/app/components/ui/select.tsx +1 -0
- package/corpus/templates/slides-2/app/components/ui/separator.tsx +1 -0
- package/corpus/templates/slides-2/app/components/ui/sheet.tsx +1 -0
- package/corpus/templates/slides-2/app/components/ui/skeleton.tsx +1 -0
- package/corpus/templates/slides-2/app/components/ui/slider.tsx +1 -0
- package/corpus/templates/slides-2/app/components/ui/spinner.tsx +1 -0
- package/corpus/templates/slides-2/app/components/ui/switch.tsx +1 -0
- package/corpus/templates/slides-2/app/components/ui/tabs.tsx +59 -0
- package/corpus/templates/slides-2/app/components/ui/textarea.tsx +1 -0
- package/corpus/templates/slides-2/app/components/ui/toggle-group.tsx +1 -0
- package/corpus/templates/slides-2/app/components/ui/toolkit-provider.tsx +17 -0
- package/corpus/templates/slides-2/app/components/ui/tooltip.tsx +1 -0
- package/corpus/templates/slides-2/app/components/visual-editor/CanvasCommentPins.tsx +46 -0
- package/corpus/templates/slides-2/app/components/visual-editor/DrawOverlay.tsx +27 -0
- package/corpus/templates/slides-2/app/components/visual-editor/MultiSelectChip.tsx +97 -0
- package/corpus/templates/slides-2/app/components/visual-editor/SaveStatusIndicator.tsx +273 -0
- package/corpus/templates/slides-2/app/components/visual-editor/index.ts +4 -0
- package/corpus/templates/slides-2/app/context/DeckContext.tsx +7486 -0
- package/corpus/templates/slides-2/app/design-system.ts +3 -0
- package/corpus/templates/slides-2/app/entry.client.tsx +10 -0
- package/corpus/templates/slides-2/app/entry.server.tsx +10 -0
- package/corpus/templates/slides-2/app/global.css +1626 -0
- package/corpus/templates/slides-2/app/hooks/use-agent-generating.ts +517 -0
- package/corpus/templates/slides-2/app/hooks/use-compact-editor-layout.ts +26 -0
- package/corpus/templates/slides-2/app/hooks/use-contrast-audit-bridge.ts +49 -0
- package/corpus/templates/slides-2/app/hooks/use-deck-access-reload.ts +70 -0
- package/corpus/templates/slides-2/app/hooks/use-deck-access.ts +50 -0
- package/corpus/templates/slides-2/app/hooks/use-deck-design-system.ts +146 -0
- package/corpus/templates/slides-2/app/hooks/use-deck-history-action-bridge.ts +266 -0
- package/corpus/templates/slides-2/app/hooks/use-deck-presence.ts +89 -0
- package/corpus/templates/slides-2/app/hooks/use-deck-role.ts +46 -0
- package/corpus/templates/slides-2/app/hooks/use-deck-versions.ts +43 -0
- package/corpus/templates/slides-2/app/hooks/use-design-system-workflows.ts +11 -0
- package/corpus/templates/slides-2/app/hooks/use-design-systems.ts +31 -0
- package/corpus/templates/slides-2/app/hooks/use-generating-slide-preview.ts +115 -0
- package/corpus/templates/slides-2/app/hooks/use-navigation-state.ts +229 -0
- package/corpus/templates/slides-2/app/hooks/use-new-deck-generation-signal.ts +46 -0
- package/corpus/templates/slides-2/app/hooks/use-new-deck-generation.ts +710 -0
- package/corpus/templates/slides-2/app/hooks/use-sidebar-collapsed.ts +95 -0
- package/corpus/templates/slides-2/app/hooks/use-slide-comments.ts +202 -0
- package/corpus/templates/slides-2/app/hooks/use-slide-file-storage-status.ts +55 -0
- package/corpus/templates/slides-2/app/hooks/use-undo-selection.ts +66 -0
- package/corpus/templates/slides-2/app/hooks/use-workspace-defaults.ts +31 -0
- package/corpus/templates/slides-2/app/i18n/en-US.ts +1507 -0
- package/corpus/templates/slides-2/app/i18n/index.ts +19 -0
- package/corpus/templates/slides-2/app/lib/agent-visible-message.ts +21 -0
- package/corpus/templates/slides-2/app/lib/aspect-ratios.ts +7 -0
- package/corpus/templates/slides-2/app/lib/asset-error-copy.ts +59 -0
- package/corpus/templates/slides-2/app/lib/canvas-zoom.ts +47 -0
- package/corpus/templates/slides-2/app/lib/composer-context.ts +152 -0
- package/corpus/templates/slides-2/app/lib/composer-draft.ts +34 -0
- package/corpus/templates/slides-2/app/lib/contrast-audit.ts +390 -0
- package/corpus/templates/slides-2/app/lib/contrast-resolve.ts +240 -0
- package/corpus/templates/slides-2/app/lib/create-deck-generation.ts +938 -0
- package/corpus/templates/slides-2/app/lib/deck-access-lost.ts +4 -0
- package/corpus/templates/slides-2/app/lib/deck-backup.ts +186 -0
- package/corpus/templates/slides-2/app/lib/deck-editor-loading.ts +91 -0
- package/corpus/templates/slides-2/app/lib/deck-export-file-client.ts +77 -0
- package/corpus/templates/slides-2/app/lib/deck-filter.ts +52 -0
- package/corpus/templates/slides-2/app/lib/deck-list-loading.ts +16 -0
- package/corpus/templates/slides-2/app/lib/deck-preview-frame.ts +15 -0
- package/corpus/templates/slides-2/app/lib/deck-share-links.ts +9 -0
- package/corpus/templates/slides-2/app/lib/deck-sorting.ts +19 -0
- package/corpus/templates/slides-2/app/lib/deferred-editor-surfaces.ts +24 -0
- package/corpus/templates/slides-2/app/lib/design-system-selection.ts +11 -0
- package/corpus/templates/slides-2/app/lib/design-systems.ts +231 -0
- package/corpus/templates/slides-2/app/lib/dynamic-import.ts +50 -0
- package/corpus/templates/slides-2/app/lib/editor-agent-handoff.ts +92 -0
- package/corpus/templates/slides-2/app/lib/editor-shortcuts.ts +153 -0
- package/corpus/templates/slides-2/app/lib/export-google-slides-client.ts +168 -0
- package/corpus/templates/slides-2/app/lib/export-pdf-client.ts +684 -0
- package/corpus/templates/slides-2/app/lib/export-pptx-client.ts +2420 -0
- package/corpus/templates/slides-2/app/lib/generation-lifecycle.ts +24 -0
- package/corpus/templates/slides-2/app/lib/generation-state.ts +247 -0
- package/corpus/templates/slides-2/app/lib/google-docs-client.ts +110 -0
- package/corpus/templates/slides-2/app/lib/google-slides-export-availability-client.ts +53 -0
- package/corpus/templates/slides-2/app/lib/google-slides-reference-source.ts +18 -0
- package/corpus/templates/slides-2/app/lib/image-download.ts +85 -0
- package/corpus/templates/slides-2/app/lib/image-drop-to-agent.ts +210 -0
- package/corpus/templates/slides-2/app/lib/import-uploaded-deck.ts +132 -0
- package/corpus/templates/slides-2/app/lib/inline-edit-remote.ts +55 -0
- package/corpus/templates/slides-2/app/lib/localize-slides-changelog.ts +47 -0
- package/corpus/templates/slides-2/app/lib/mermaid-blocks.ts +18 -0
- package/corpus/templates/slides-2/app/lib/new-deck-reference-selection.ts +174 -0
- package/corpus/templates/slides-2/app/lib/normalize-slide-padding.ts +74 -0
- package/corpus/templates/slides-2/app/lib/pending-deck-changes.ts +33 -0
- package/corpus/templates/slides-2/app/lib/portaled-layer.ts +7 -0
- package/corpus/templates/slides-2/app/lib/pptx-google-slides.ts +204 -0
- package/corpus/templates/slides-2/app/lib/prompt-attachment-adapter.ts +37 -0
- package/corpus/templates/slides-2/app/lib/prompt-file-uploads.ts +557 -0
- package/corpus/templates/slides-2/app/lib/recent-references.ts +106 -0
- package/corpus/templates/slides-2/app/lib/reference-document-hydration.ts +406 -0
- package/corpus/templates/slides-2/app/lib/register-chat-renderers.tsx +645 -0
- package/corpus/templates/slides-2/app/lib/reveal-after-delete.ts +55 -0
- package/corpus/templates/slides-2/app/lib/sanitize-slide-html.ts +752 -0
- package/corpus/templates/slides-2/app/lib/slide-agent-context.ts +148 -0
- package/corpus/templates/slides-2/app/lib/slide-animation-elements.ts +900 -0
- package/corpus/templates/slides-2/app/lib/slide-clipboard.ts +534 -0
- package/corpus/templates/slides-2/app/lib/slide-comment-anchor.ts +286 -0
- package/corpus/templates/slides-2/app/lib/slide-content-merge.ts +295 -0
- package/corpus/templates/slides-2/app/lib/slide-image-replacement.ts +1919 -0
- package/corpus/templates/slides-2/app/lib/slide-live-remote.ts +215 -0
- package/corpus/templates/slides-2/app/lib/slide-scroll.ts +56 -0
- package/corpus/templates/slides-2/app/lib/slide-source-map.ts +1099 -0
- package/corpus/templates/slides-2/app/lib/slide-video.ts +390 -0
- package/corpus/templates/slides-2/app/lib/slides-relay-tracking.ts +114 -0
- package/corpus/templates/slides-2/app/lib/streaming-slide-html.ts +77 -0
- package/corpus/templates/slides-2/app/lib/tab-id.ts +3 -0
- package/corpus/templates/slides-2/app/lib/template-navigation.ts +15 -0
- package/corpus/templates/slides-2/app/lib/text-tool-shortcut.ts +75 -0
- package/corpus/templates/slides-2/app/lib/undo-reveal.ts +332 -0
- package/corpus/templates/slides-2/app/lib/upload-response.ts +107 -0
- package/corpus/templates/slides-2/app/lib/utils.ts +38 -0
- package/corpus/templates/slides-2/app/lib/validate-native-slide-html.ts +177 -0
- package/corpus/templates/slides-2/app/lib/video-upload.ts +354 -0
- package/corpus/templates/slides-2/app/pages/DeckEditor.tsx +6158 -0
- package/corpus/templates/slides-2/app/pages/DesignSystems.tsx +363 -0
- package/corpus/templates/slides-2/app/pages/Index.tsx +3254 -0
- package/corpus/templates/slides-2/app/pages/NotFound.tsx +33 -0
- package/corpus/templates/slides-2/app/pages/Presentation.tsx +120 -0
- package/corpus/templates/slides-2/app/pages/SharedPresentation.tsx +174 -0
- package/corpus/templates/slides-2/app/pages/SlideThemeDetail.tsx +227 -0
- package/corpus/templates/slides-2/app/pages/SlideThemes.tsx +155 -0
- package/corpus/templates/slides-2/app/pages/Slides2EditorPage.tsx +1618 -0
- package/corpus/templates/slides-2/app/pages/Slides2PresenterConsolePage.tsx +937 -0
- package/corpus/templates/slides-2/app/pages/Slides2PresenterPage.tsx +979 -0
- package/corpus/templates/slides-2/app/pages/Templates.tsx +32 -0
- package/corpus/templates/slides-2/app/root.tsx +391 -0
- package/corpus/templates/slides-2/app/routes/$.tsx +10 -0
- package/corpus/templates/slides-2/app/routes/_index.tsx +1 -0
- package/corpus/templates/slides-2/app/routes/access-request.approve.tsx +276 -0
- package/corpus/templates/slides-2/app/routes/agent.tsx +19 -0
- package/corpus/templates/slides-2/app/routes/chat.$threadId.tsx +1 -0
- package/corpus/templates/slides-2/app/routes/chat.tsx +190 -0
- package/corpus/templates/slides-2/app/routes/deck.$id.tsx +10 -0
- package/corpus/templates/slides-2/app/routes/deck.$id_.present.tsx +10 -0
- package/corpus/templates/slides-2/app/routes/design-systems.tsx +10 -0
- package/corpus/templates/slides-2/app/routes/extensions.$id.$slug.tsx +2 -0
- package/corpus/templates/slides-2/app/routes/extensions.$id.tsx +5 -0
- package/corpus/templates/slides-2/app/routes/extensions._index.tsx +5 -0
- package/corpus/templates/slides-2/app/routes/extensions.tsx +5 -0
- package/corpus/templates/slides-2/app/routes/home-layout.tsx +31 -0
- package/corpus/templates/slides-2/app/routes/home.tsx +22 -0
- package/corpus/templates/slides-2/app/routes/p.$id.tsx +195 -0
- package/corpus/templates/slides-2/app/routes/settings.$.tsx +1 -0
- package/corpus/templates/slides-2/app/routes/settings.tsx +131 -0
- package/corpus/templates/slides-2/app/routes/share.$token.tsx +137 -0
- package/corpus/templates/slides-2/app/routes/slide.tsx +209 -0
- package/corpus/templates/slides-2/app/routes/team.tsx +11 -0
- package/corpus/templates/slides-2/app/routes/templates.tsx +1 -0
- package/corpus/templates/slides-2/app/routes/themes.$id.tsx +1 -0
- package/corpus/templates/slides-2/app/routes/themes.tsx +1 -0
- package/corpus/templates/slides-2/app/routes.ts +24 -0
- package/corpus/templates/slides-2/app/vite-env.d.ts +24 -0
- package/corpus/templates/slides-2/changelog/2026-10-17-find-and-switch-decks-from-the-presenter-console.md +6 -0
- package/corpus/templates/slides-2/changelog/2026-10-17-meet-slides-2-create-and-refine-editable-slide-decks-with-an.md +6 -0
- package/corpus/templates/slides-2/changelog/2026-10-17-pptx-image-export.md +6 -0
- package/corpus/templates/slides-2/changelog/2026-10-17-visual-editor.md +6 -0
- package/corpus/templates/slides-2/changelog/2026-10-18-apply-an-accessible-design-system-to-an-existing-deck-before.md +6 -0
- package/corpus/templates/slides-2/changelog/2026-10-18-choose-a-template-or-start-a-new-presentation-from-the-slide.md +6 -0
- package/corpus/templates/slides-2/changelog/2026-10-18-generate-decks-from-a-prompt-then-edit-slide-elements-direct.md +6 -0
- package/corpus/templates/slides-2/changelog/2026-10-18-generate-presentation-decks-from-a-prompt-and-edit-every-sli.md +6 -0
- package/corpus/templates/slides-2/changelog/2026-10-18-new-presentation-drafts-save-before-generation-starts-so-you.md +6 -0
- package/corpus/templates/slides-2/changelog/2026-10-18-the-assistant-can-undo-redo-and-save-pending-edits-in-the-vi.md +6 -0
- package/corpus/templates/slides-2/changelog/2026-10-19-agents-can-insert-duplicate-and-delete-canvas-objects-in-sou.md +6 -0
- package/corpus/templates/slides-2/changelog/2026-10-19-browse-slide-themes.md +6 -0
- package/corpus/templates/slides-2/changelog/2026-10-19-clicking-a-slide-preview-in-overview-selects-that-slide.md +6 -0
- package/corpus/templates/slides-2/changelog/2026-10-19-create-decks-from-a-prompt-and-edit-slides-directly-on-the-c.md +6 -0
- package/corpus/templates/slides-2/changelog/2026-10-19-creating-and-editing-decks-now-starts-with-the-tools-most-re.md +6 -0
- package/corpus/templates/slides-2/changelog/2026-10-19-deleting-decks-revokes-public-links.md +7 -0
- package/corpus/templates/slides-2/changelog/2026-10-19-escape-cancels-an-in-progress-slide-drag-without-losing-earl.md +6 -0
- package/corpus/templates/slides-2/changelog/2026-10-19-import-failures-now-show-clear-localized-descriptions-instea.md +6 -0
- package/corpus/templates/slides-2/changelog/2026-10-19-presenter-controls-stay-responsive-when-moving-over-the-slid.md +6 -0
- package/corpus/templates/slides-2/changelog/2026-10-19-presenter-notes-stay-private-from-viewers-and-commenters.md +6 -0
- package/corpus/templates/slides-2/changelog/2026-10-19-preview-generated-slides-in-chat.md +6 -0
- package/corpus/templates/slides-2/changelog/2026-10-19-remote-image-previews-accept-supported-raster-formats.md +6 -0
- package/corpus/templates/slides-2/changelog/2026-10-19-search-the-svgl-catalog-and-add-svg-logos-to-a-deck-or-the-g.md +6 -0
- package/corpus/templates/slides-2/changelog/2026-10-19-slide-generation-explains-when-react-effect-hooks-cannot-run.md +6 -0
- package/corpus/templates/slides-2/changelog/2026-10-19-the-editor-highlights-hovered-objects-and-keeps-image-replac.md +6 -0
- package/corpus/templates/slides-2/changelog/2026-10-19-the-slide-editor-uses-the-shared-agent-native-controls.md +6 -0
- package/corpus/templates/slides-2/changelog/2026-10-20-deck-editing-controls-match-the-workspace.md +6 -0
- package/corpus/templates/slides-2/changelog/2026-10-20-google-slides-imports-now-report-missing-image-data-instead-.md +6 -0
- package/corpus/templates/slides-2/changelog/2026-10-20-imports-and-previews-handle-large-content-safely.md +6 -0
- package/corpus/templates/slides-2/changelog/2026-10-20-public-deck-pages-can-export-source-backed-slides-to-pdf.md +6 -0
- package/corpus/templates/slides-2/changelog/2026-10-20-saved-slide-images-stay-available.md +6 -0
- package/corpus/templates/slides-2/changelog/2026-10-20-scope-global-media-picks-to-assets-the-current-deck-can-reso.md +6 -0
- package/corpus/templates/slides-2/components.json +20 -0
- package/corpus/templates/slides-2/drizzle.config.ts +3 -0
- package/corpus/templates/slides-2/learnings.defaults.md +5 -0
- package/corpus/templates/slides-2/netlify.toml +24 -0
- package/corpus/templates/slides-2/package.json +147 -0
- package/corpus/templates/slides-2/public/agent-native-icon-dark.svg +10 -0
- package/corpus/templates/slides-2/public/agent-native-icon-light.svg +10 -0
- package/corpus/templates/slides-2/public/agent-native-logo-dark.svg +21 -0
- package/corpus/templates/slides-2/public/agent-native-logo-light.svg +21 -0
- package/corpus/templates/slides-2/public/assets/builder-logo-white.svg +15 -0
- package/corpus/templates/slides-2/public/assets/generated/preview.html +61 -0
- package/corpus/templates/slides-2/public/assets/intuit-logo-white.svg +6 -0
- package/corpus/templates/slides-2/public/assets/walmart-logo-white.svg +6 -0
- package/corpus/templates/slides-2/public/chatgpt-plugin-icon.svg +7 -0
- package/corpus/templates/slides-2/public/favicon.svg +1 -0
- package/corpus/templates/slides-2/public/icon-180.svg +1 -0
- package/corpus/templates/slides-2/public/icon-192.svg +1 -0
- package/corpus/templates/slides-2/public/icon-512.svg +1 -0
- package/corpus/templates/slides-2/public/manifest.json +20 -0
- package/corpus/templates/slides-2/public/placeholder.svg +1 -0
- package/corpus/templates/slides-2/public/robots.txt +14 -0
- package/corpus/templates/slides-2/public/visual-edit-structure-proof.html +99 -0
- package/corpus/templates/slides-2/react-router.config.ts +7 -0
- package/corpus/templates/slides-2/scripts/edit-fidelity/README.md +499 -0
- package/corpus/templates/slides-2/scripts/edit-fidelity/authoring-fuzz.ts +9517 -0
- package/corpus/templates/slides-2/scripts/edit-fidelity/baseline.json +16427 -0
- package/corpus/templates/slides-2/scripts/edit-fidelity/dev-server-url.ts +10 -0
- package/corpus/templates/slides-2/scripts/edit-fidelity/lib/in-page.ts +1975 -0
- package/corpus/templates/slides-2/scripts/edit-fidelity/lib/metrics.ts +1401 -0
- package/corpus/templates/slides-2/scripts/edit-fidelity/retry-infra.ts +7 -0
- package/corpus/templates/slides-2/scripts/edit-fidelity/run-options.ts +21 -0
- package/corpus/templates/slides-2/scripts/edit-fidelity/run-outcomes.ts +127 -0
- package/corpus/templates/slides-2/scripts/edit-fidelity/run.ts +8451 -0
- package/corpus/templates/slides-2/scripts/export-fidelity/README.md +116 -0
- package/corpus/templates/slides-2/scripts/export-fidelity/compare-layout-lib.ts +241 -0
- package/corpus/templates/slides-2/scripts/export-fidelity/compare-layout.ts +30 -0
- package/corpus/templates/slides-2/scripts/export-fidelity/diff.ts +222 -0
- package/corpus/templates/slides-2/scripts/export-fidelity/export.ts +765 -0
- package/corpus/templates/slides-2/scripts/export-fidelity/fixtures/agent-dark-deck.json +48 -0
- package/corpus/templates/slides-2/scripts/export-fidelity/generate-calibration.ts +765 -0
- package/corpus/templates/slides-2/scripts/export-fidelity/google-export.ts +137 -0
- package/corpus/templates/slides-2/scripts/export-fidelity/google-layout.ts +82 -0
- package/corpus/templates/slides-2/scripts/export-fidelity/resolve-pkg.ts +29 -0
- package/corpus/templates/slides-2/scripts/migrate-production.ts +22 -0
- package/corpus/templates/slides-2/server/db/index.ts +73 -0
- package/corpus/templates/slides-2/server/db/schema.ts +189 -0
- package/corpus/templates/slides-2/server/handlers/assets-url.ts +13 -0
- package/corpus/templates/slides-2/server/handlers/assets.ts +3217 -0
- package/corpus/templates/slides-2/server/handlers/decks.ts +185 -0
- package/corpus/templates/slides-2/server/handlers/demo.ts +9 -0
- package/corpus/templates/slides-2/server/handlers/design-systems.ts +219 -0
- package/corpus/templates/slides-2/server/handlers/google-docs-auth.ts +165 -0
- package/corpus/templates/slides-2/server/handlers/image-gen.ts +153 -0
- package/corpus/templates/slides-2/server/handlers/image-providers/gemini.ts +209 -0
- package/corpus/templates/slides-2/server/handlers/image-providers/index.ts +61 -0
- package/corpus/templates/slides-2/server/handlers/image-providers/openai.ts +288 -0
- package/corpus/templates/slides-2/server/handlers/image-providers/types.ts +35 -0
- package/corpus/templates/slides-2/server/handlers/import/docx-parser.ts +31 -0
- package/corpus/templates/slides-2/server/handlers/import/html-converter.ts +1534 -0
- package/corpus/templates/slides-2/server/handlers/import/pdf-fidelity-parser.ts +1039 -0
- package/corpus/templates/slides-2/server/handlers/import/pdf-sidecar-reader.ts +81 -0
- package/corpus/templates/slides-2/server/handlers/import/pdf-style-digest.ts +187 -0
- package/corpus/templates/slides-2/server/handlers/import/pptx-assets.ts +155 -0
- package/corpus/templates/slides-2/server/handlers/import/pptx-parser.ts +57 -0
- package/corpus/templates/slides-2/server/handlers/request-auth-context.ts +108 -0
- package/corpus/templates/slides-2/server/handlers/share.ts +52 -0
- package/corpus/templates/slides-2/server/handlers/uploads-chunked.ts +1066 -0
- package/corpus/templates/slides-2/server/handlers/uploads.ts +457 -0
- package/corpus/templates/slides-2/server/lib/access-request-email.ts +66 -0
- package/corpus/templates/slides-2/server/lib/assets-image-delegation.ts +331 -0
- package/corpus/templates/slides-2/server/lib/bounded-multipart.ts +49 -0
- package/corpus/templates/slides-2/server/lib/builder-design-system-proxy.ts +122 -0
- package/corpus/templates/slides-2/server/lib/chat-attachments.ts +425 -0
- package/corpus/templates/slides-2/server/lib/chatgpt-directory-tools.ts +246 -0
- package/corpus/templates/slides-2/server/lib/chunked-upload-session.ts +195 -0
- package/corpus/templates/slides-2/server/lib/comment-notifications.ts +184 -0
- package/corpus/templates/slides-2/server/lib/deck-access-requests.ts +102 -0
- package/corpus/templates/slides-2/server/lib/deck-asset-scope.ts +150 -0
- package/corpus/templates/slides-2/server/lib/deck-export-tracking.ts +119 -0
- package/corpus/templates/slides-2/server/lib/deck-templates/a-case-study.ts +154 -0
- package/corpus/templates/slides-2/server/lib/deck-templates/a-company.ts +160 -0
- package/corpus/templates/slides-2/server/lib/deck-templates/a-pitch.ts +151 -0
- package/corpus/templates/slides-2/server/lib/deck-templates/a-quarterly.ts +264 -0
- package/corpus/templates/slides-2/server/lib/deck-templates/a-shared.ts +35 -0
- package/corpus/templates/slides-2/server/lib/deck-templates/a-update.ts +188 -0
- package/corpus/templates/slides-2/server/lib/deck-templates/a-workshop.ts +196 -0
- package/corpus/templates/slides-2/server/lib/deck-templates/b-keynote.ts +131 -0
- package/corpus/templates/slides-2/server/lib/deck-templates/b-lesson.ts +209 -0
- package/corpus/templates/slides-2/server/lib/deck-templates/b-manifesto.ts +149 -0
- package/corpus/templates/slides-2/server/lib/deck-templates/b-portfolio.ts +144 -0
- package/corpus/templates/slides-2/server/lib/deck-templates/b-research.ts +221 -0
- package/corpus/templates/slides-2/server/lib/deck-templates/b-roadmap.ts +264 -0
- package/corpus/templates/slides-2/server/lib/deck-templates/b-shared.ts +44 -0
- package/corpus/templates/slides-2/server/lib/deck-templates/group-a.ts +16 -0
- package/corpus/templates/slides-2/server/lib/deck-templates/group-b.ts +16 -0
- package/corpus/templates/slides-2/server/lib/deck-templates/legacy.ts +567 -0
- package/corpus/templates/slides-2/server/lib/deck-templates.ts +60 -0
- package/corpus/templates/slides-2/server/lib/deck-versions.ts +233 -0
- package/corpus/templates/slides-2/server/lib/design-system-workflows.ts +22 -0
- package/corpus/templates/slides-2/server/lib/emails.ts +84 -0
- package/corpus/templates/slides-2/server/lib/env-config.ts +15 -0
- package/corpus/templates/slides-2/server/lib/fetch-remote-image.ts +245 -0
- package/corpus/templates/slides-2/server/lib/generation-completion.ts +278 -0
- package/corpus/templates/slides-2/server/lib/google-docs-access.ts +51 -0
- package/corpus/templates/slides-2/server/lib/google-docs-error.ts +54 -0
- package/corpus/templates/slides-2/server/lib/google-docs-oauth.ts +422 -0
- package/corpus/templates/slides-2/server/lib/google-fonts.ts +509 -0
- package/corpus/templates/slides-2/server/lib/google-oauth-preflight.ts +119 -0
- package/corpus/templates/slides-2/server/lib/google-slides-export-availability.ts +55 -0
- package/corpus/templates/slides-2/server/lib/image-proxy-response.ts +16 -0
- package/corpus/templates/slides-2/server/lib/image-proxy-url.ts +155 -0
- package/corpus/templates/slides-2/server/lib/import-asset-storage.ts +214 -0
- package/corpus/templates/slides-2/server/lib/imported-asset-batch.ts +218 -0
- package/corpus/templates/slides-2/server/lib/legacy-slide-source.ts +692 -0
- package/corpus/templates/slides-2/server/lib/media-search-providers.ts +216 -0
- package/corpus/templates/slides-2/server/lib/native-creative-context.ts +295 -0
- package/corpus/templates/slides-2/server/lib/pdf-parse-setup.ts +115 -0
- package/corpus/templates/slides-2/server/lib/provider-api.ts +57 -0
- package/corpus/templates/slides-2/server/lib/request-wait-until.ts +30 -0
- package/corpus/templates/slides-2/server/lib/shared-deck.ts +29 -0
- package/corpus/templates/slides-2/server/lib/slide-asset-references.ts +309 -0
- package/corpus/templates/slides-2/server/lib/slide-content-patch.ts +1004 -0
- package/corpus/templates/slides-2/server/lib/slide-hygiene.ts +731 -0
- package/corpus/templates/slides-2/server/lib/slide-image-insertion.ts +136 -0
- package/corpus/templates/slides-2/server/lib/slide-reveal-issues.ts +41 -0
- package/corpus/templates/slides-2/server/lib/slide-source-editing/babel-walk.ts +117 -0
- package/corpus/templates/slides-2/server/lib/slide-source-editing/batch-edit.ts +152 -0
- package/corpus/templates/slides-2/server/lib/slide-source-editing/edit-ops.ts +1478 -0
- package/corpus/templates/slides-2/server/lib/slide-source-editing/image-target.ts +128 -0
- package/corpus/templates/slides-2/server/lib/slide-source-editing/text-diff.ts +23 -0
- package/corpus/templates/slides-2/server/lib/slide-source-limits.ts +9 -0
- package/corpus/templates/slides-2/server/lib/slide-source.ts +1786 -0
- package/corpus/templates/slides-2/server/lib/slide-theme-demo-sources.ts +2106 -0
- package/corpus/templates/slides-2/server/lib/slide-themes.ts +2174 -0
- package/corpus/templates/slides-2/server/lib/slide-worker-runtime.ts +1995 -0
- package/corpus/templates/slides-2/server/lib/slides-tracking.ts +73 -0
- package/corpus/templates/slides-2/server/lib/source-import.ts +213 -0
- package/corpus/templates/slides-2/server/lib/svgl.ts +364 -0
- package/corpus/templates/slides-2/server/lib/tenant-files.ts +179 -0
- package/corpus/templates/slides-2/server/lib/upload-storage-status.ts +9 -0
- package/corpus/templates/slides-2/server/lib/uploaded-asset-cleanup-outbox.ts +521 -0
- package/corpus/templates/slides-2/server/lib/uploaded-asset-object-lifecycle.ts +404 -0
- package/corpus/templates/slides-2/server/lib/uploaded-fonts.ts +696 -0
- package/corpus/templates/slides-2/server/lib/uploaded-reference-storage.ts +77 -0
- package/corpus/templates/slides-2/server/lib/validate-slide-animations.ts +341 -0
- package/corpus/templates/slides-2/server/middleware/auth.ts +6 -0
- package/corpus/templates/slides-2/server/plugins/_dev-upload-stub.ts +6 -0
- package/corpus/templates/slides-2/server/plugins/agent-chat.ts +402 -0
- package/corpus/templates/slides-2/server/plugins/auth.ts +31 -0
- package/corpus/templates/slides-2/server/plugins/collab.ts +30 -0
- package/corpus/templates/slides-2/server/plugins/config.ts +6 -0
- package/corpus/templates/slides-2/server/plugins/core-routes.ts +30 -0
- package/corpus/templates/slides-2/server/plugins/creative-context.ts +187 -0
- package/corpus/templates/slides-2/server/plugins/db.ts +462 -0
- package/corpus/templates/slides-2/server/plugins/feature-flags.ts +5 -0
- package/corpus/templates/slides-2/server/plugins/labs.ts +8 -0
- package/corpus/templates/slides-2/server/plugins/orphaned-asset-cleanup.ts +17 -0
- package/corpus/templates/slides-2/server/plugins/otel.ts +6 -0
- package/corpus/templates/slides-2/server/plugins/transactional-emails.ts +5 -0
- package/corpus/templates/slides-2/server/register-secrets.ts +209 -0
- package/corpus/templates/slides-2/server/routes/[...page].get.ts +5 -0
- package/corpus/templates/slides-2/server/routes/[...page].head.ts +1 -0
- package/corpus/templates/slides-2/server/routes/[base]/_agent-native/google-docs/auth-url.get.ts +1 -0
- package/corpus/templates/slides-2/server/routes/[base]/_agent-native/google-docs/callback.get.ts +1 -0
- package/corpus/templates/slides-2/server/routes/_agent-native/google-docs/auth-url.get.ts +1 -0
- package/corpus/templates/slides-2/server/routes/_agent-native/google-docs/callback.get.ts +1 -0
- package/corpus/templates/slides-2/server/routes/api/assets/upload-video.post.ts +1 -0
- package/corpus/templates/slides-2/server/routes/api/assets/upload.post.ts +1 -0
- package/corpus/templates/slides-2/server/routes/api/assets/video-uploads.delete.ts +1 -0
- package/corpus/templates/slides-2/server/routes/api/deck-agent-context.json.get.ts +105 -0
- package/corpus/templates/slides-2/server/routes/api/decks/events.get.ts +1 -0
- package/corpus/templates/slides-2/server/routes/api/demo.get.ts +1 -0
- package/corpus/templates/slides-2/server/routes/api/exports/[filename].get.ts +221 -0
- package/corpus/templates/slides-2/server/routes/api/exports/google-slides.post.ts +240 -0
- package/corpus/templates/slides-2/server/routes/api/exports/html.post.ts +67 -0
- package/corpus/templates/slides-2/server/routes/api/exports/pptx.post.ts +100 -0
- package/corpus/templates/slides-2/server/routes/api/gen-preview/[...].get.ts +24 -0
- package/corpus/templates/slides-2/server/routes/api/generated/[...].get.ts +24 -0
- package/corpus/templates/slides-2/server/routes/api/image-proxy.get.ts +518 -0
- package/corpus/templates/slides-2/server/routes/api/import-assets/[token].get.ts +70 -0
- package/corpus/templates/slides-2/server/routes/api/preview-images.get.ts +20 -0
- package/corpus/templates/slides-2/server/routes/api/share/[token].get.ts +1 -0
- package/corpus/templates/slides-2/server/routes/api/uploads-chunked/[sessionId]/chunk.post.ts +1 -0
- package/corpus/templates/slides-2/server/routes/api/uploads-chunked/[sessionId]/status.get.ts +1 -0
- package/corpus/templates/slides-2/server/routes/api/uploads-chunked/[sessionId].delete.ts +1 -0
- package/corpus/templates/slides-2/server/routes/api/uploads-chunked/start.post.ts +1 -0
- package/corpus/templates/slides-2/server/routes/api/uploads.delete.ts +1 -0
- package/corpus/templates/slides-2/server/routes/api/uploads.post.ts +1 -0
- package/corpus/templates/slides-2/server/workspace-defaults.ts +196 -0
- package/corpus/templates/slides-2/shared/action-ui.ts +147 -0
- package/corpus/templates/slides-2/shared/agent-readable.ts +2 -0
- package/corpus/templates/slides-2/shared/api.ts +406 -0
- package/corpus/templates/slides-2/shared/app-state-tabs.ts +30 -0
- package/corpus/templates/slides-2/shared/app-storage.ts +9 -0
- package/corpus/templates/slides-2/shared/aspect-ratios.ts +49 -0
- package/corpus/templates/slides-2/shared/blank-slide.ts +179 -0
- package/corpus/templates/slides-2/shared/client-compatibility.ts +2 -0
- package/corpus/templates/slides-2/shared/contrast-audit.ts +255 -0
- package/corpus/templates/slides-2/shared/deck-access.ts +26 -0
- package/corpus/templates/slides-2/shared/deck-app-scope.ts +14 -0
- package/corpus/templates/slides-2/shared/deck-content.ts +37 -0
- package/corpus/templates/slides-2/shared/deck-history-control.ts +79 -0
- package/corpus/templates/slides-2/shared/deck-scope.ts +5 -0
- package/corpus/templates/slides-2/shared/deck-title.ts +199 -0
- package/corpus/templates/slides-2/shared/deck-write.ts +61 -0
- package/corpus/templates/slides-2/shared/design-flags.ts +7 -0
- package/corpus/templates/slides-2/shared/design-system-validation.ts +88 -0
- package/corpus/templates/slides-2/shared/editor-control.ts +120 -0
- package/corpus/templates/slides-2/shared/generation-timing.ts +19 -0
- package/corpus/templates/slides-2/shared/google-docs.ts +69 -0
- package/corpus/templates/slides-2/shared/labs.ts +10 -0
- package/corpus/templates/slides-2/shared/overview-navigation.ts +34 -0
- package/corpus/templates/slides-2/shared/ownership.ts +6 -0
- package/corpus/templates/slides-2/shared/pdf-sidecar.ts +130 -0
- package/corpus/templates/slides-2/shared/presenter-control.ts +111 -0
- package/corpus/templates/slides-2/shared/representative-slide.ts +89 -0
- package/corpus/templates/slides-2/shared/slide-background.ts +30 -0
- package/corpus/templates/slides-2/shared/slide-comment-anchor.ts +117 -0
- package/corpus/templates/slides-2/shared/slide-comment-reactions.ts +47 -0
- package/corpus/templates/slides-2/shared/slide-design-tokens.ts +92 -0
- package/corpus/templates/slides-2/shared/slide-fit.ts +78 -0
- package/corpus/templates/slides-2/shared/slide-ids.ts +133 -0
- package/corpus/templates/slides-2/shared/slide-number.ts +124 -0
- package/corpus/templates/slides-2/shared/slide-object-structure.ts +790 -0
- package/corpus/templates/slides-2/shared/slide-text-range-selection.ts +50 -0
- package/corpus/templates/slides-2/shared/slide-transitions.ts +70 -0
- package/corpus/templates/slides-2/shared/slides-2-transition.ts +194 -0
- package/corpus/templates/slides-2/shared/slides-user-prefs.ts +22 -0
- package/corpus/templates/slides-2/shared/source-import-errors.ts +12 -0
- package/corpus/templates/slides-2/shared/source-runtime-export.ts +76 -0
- package/corpus/templates/slides-2/shared/upload-types.ts +41 -0
- package/corpus/templates/slides-2/ssr-entry.ts +11 -0
- package/corpus/templates/slides-2/tsconfig.json +27 -0
- package/corpus/templates/slides-2/vite.config.ts +77 -0
- package/corpus/templates/slides-2/vitest.config.ts +28 -0
- package/corpus/templates/tasks/.agents/skills/actions/references/action-fields.md +1 -1
- package/package.json +1 -1
- package/corpus/templates/design/.agents/skills/shader-fills/SKILL.md +0 -182
- package/corpus/templates/design/actions/apply-shader-fill.ts +0 -450
- package/corpus/templates/design/actions/apply-shader.ts +0 -257
- package/corpus/templates/design/actions/preview-shader-fill.ts +0 -157
- package/corpus/templates/design/app/components/design/inspector/GlslShaderPanel.tsx +0 -1144
- package/corpus/templates/design/app/components/design/inspector/SHADER_INTEGRATION.md +0 -450
- package/corpus/templates/design/app/components/design/inspector/ShaderControls.stories.tsx +0 -71
- package/corpus/templates/design/app/components/design/inspector/ShaderControls.tsx +0 -555
- package/corpus/templates/design/app/components/design/inspector/ShaderEffectRow.tsx +0 -105
- package/corpus/templates/design/app/components/design/inspector/ShaderFillsPanel.tsx +0 -433
- package/corpus/templates/design/app/components/design/inspector/color-picker-shader-pane.tsx +0 -648
- package/corpus/templates/design/shared/shader-fill.ts +0 -174
- package/corpus/templates/design/shared/shader-presets.ts +0 -1523
|
@@ -0,0 +1,1401 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Node-side scoring for the edit-fidelity harness: pixel diffs, computed-style
|
|
3
|
+
* deltas, saved-HTML checks and the baseline ratchet. Pure functions except
|
|
4
|
+
* the lazily-loaded pixelmatch/pngjs, so the spec can cover the logic.
|
|
5
|
+
*/
|
|
6
|
+
import { parse, type DefaultTreeAdapterTypes as P5 } from "parse5";
|
|
7
|
+
|
|
8
|
+
import { resolvePnpmEntry } from "../../export-fidelity/resolve-pkg.ts";
|
|
9
|
+
import type {
|
|
10
|
+
KeepaliveWrite,
|
|
11
|
+
OutsideSnapshot,
|
|
12
|
+
Rect,
|
|
13
|
+
SnapRecord,
|
|
14
|
+
Snapshot,
|
|
15
|
+
} from "./in-page.ts";
|
|
16
|
+
|
|
17
|
+
// ---------------------------------------------------------------- pixels ---
|
|
18
|
+
|
|
19
|
+
let codecs: { pixelmatch: any; PNG: any } | null = null;
|
|
20
|
+
async function loadCodecs() {
|
|
21
|
+
if (!codecs) {
|
|
22
|
+
const pm: any = await import(resolvePnpmEntry("pixelmatch", "7.2"));
|
|
23
|
+
const png: any = await import(resolvePnpmEntry("pngjs", "7."));
|
|
24
|
+
codecs = {
|
|
25
|
+
pixelmatch: pm.default ?? pm,
|
|
26
|
+
PNG: png.PNG ?? png.default?.PNG,
|
|
27
|
+
};
|
|
28
|
+
}
|
|
29
|
+
return codecs;
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
export interface PixelDiff {
|
|
33
|
+
/** Percent of compared pixels that differ. */
|
|
34
|
+
pct: number;
|
|
35
|
+
diffPixels: number;
|
|
36
|
+
comparedPixels: number;
|
|
37
|
+
sizeMismatch: boolean;
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
/**
|
|
41
|
+
* pixelmatch at threshold 0.1 over the overlap of two PNGs. Excluded rects are
|
|
42
|
+
* blanked in both images and left out of the denominator, so a larger
|
|
43
|
+
* exclusion can never read as a better score. A size mismatch is reported,
|
|
44
|
+
* never resized away.
|
|
45
|
+
*/
|
|
46
|
+
export async function diffPngs(
|
|
47
|
+
a: Buffer,
|
|
48
|
+
b: Buffer,
|
|
49
|
+
exclude: Rect[] = [],
|
|
50
|
+
): Promise<PixelDiff & { png: Buffer }> {
|
|
51
|
+
const { pixelmatch, PNG } = await loadCodecs();
|
|
52
|
+
const ia = PNG.sync.read(a);
|
|
53
|
+
const ib = PNG.sync.read(b);
|
|
54
|
+
const width = Math.min(ia.width, ib.width);
|
|
55
|
+
const height = Math.min(ia.height, ib.height);
|
|
56
|
+
const crop = (img: any) => {
|
|
57
|
+
const out = Buffer.alloc(width * height * 4);
|
|
58
|
+
for (let y = 0; y < height; y++) {
|
|
59
|
+
img.data.copy(
|
|
60
|
+
out,
|
|
61
|
+
y * width * 4,
|
|
62
|
+
y * img.width * 4,
|
|
63
|
+
(y * img.width + width) * 4,
|
|
64
|
+
);
|
|
65
|
+
}
|
|
66
|
+
return out;
|
|
67
|
+
};
|
|
68
|
+
const da = crop(ia);
|
|
69
|
+
const db = crop(ib);
|
|
70
|
+
let excluded = 0;
|
|
71
|
+
const mask = new Uint8Array(width * height);
|
|
72
|
+
for (const r of exclude) {
|
|
73
|
+
const x0 = Math.max(0, Math.floor(r.x));
|
|
74
|
+
const y0 = Math.max(0, Math.floor(r.y));
|
|
75
|
+
const x1 = Math.min(width, Math.ceil(r.x + r.width));
|
|
76
|
+
const y1 = Math.min(height, Math.ceil(r.y + r.height));
|
|
77
|
+
for (let y = y0; y < y1; y++) {
|
|
78
|
+
for (let x = x0; x < x1; x++) mask[y * width + x] = 1;
|
|
79
|
+
}
|
|
80
|
+
}
|
|
81
|
+
for (let i = 0; i < mask.length; i++) {
|
|
82
|
+
if (!mask[i]) continue;
|
|
83
|
+
excluded++;
|
|
84
|
+
da.fill(0, i * 4, i * 4 + 4);
|
|
85
|
+
db.fill(0, i * 4, i * 4 + 4);
|
|
86
|
+
}
|
|
87
|
+
const out = new PNG({ width, height });
|
|
88
|
+
const diffPixels = pixelmatch(da, db, out.data, width, height, {
|
|
89
|
+
threshold: 0.1,
|
|
90
|
+
});
|
|
91
|
+
const comparedPixels = Math.max(1, width * height - excluded);
|
|
92
|
+
return {
|
|
93
|
+
pct: round3((diffPixels / comparedPixels) * 100),
|
|
94
|
+
diffPixels,
|
|
95
|
+
comparedPixels,
|
|
96
|
+
sizeMismatch: ia.width !== ib.width || ia.height !== ib.height,
|
|
97
|
+
png: PNG.sync.write(out),
|
|
98
|
+
};
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
/** Padding around exclusion rects: anti-aliasing and focus rings bleed. */
|
|
102
|
+
export function padRect(r: Rect, pad = 4): Rect {
|
|
103
|
+
return {
|
|
104
|
+
x: r.x - pad,
|
|
105
|
+
y: r.y - pad,
|
|
106
|
+
width: r.width + pad * 2,
|
|
107
|
+
height: r.height + pad * 2,
|
|
108
|
+
};
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
// ---------------------------------------------------------------- styles ---
|
|
112
|
+
|
|
113
|
+
const GEOMETRY_TOLERANCE = 1;
|
|
114
|
+
|
|
115
|
+
/** Unknown rects and subpixel noise cannot waive the outside-pixel check. */
|
|
116
|
+
export const resized = (a: Rect | null, b: Rect | null) =>
|
|
117
|
+
!!a &&
|
|
118
|
+
!!b &&
|
|
119
|
+
(Math.abs(a.width - b.width) >= GEOMETRY_TOLERANCE ||
|
|
120
|
+
Math.abs(a.height - b.height) >= GEOMETRY_TOLERANCE);
|
|
121
|
+
|
|
122
|
+
/** Event Timing omits entries below its configured duration threshold. */
|
|
123
|
+
export function p95IndexFromThresholdedSamples(
|
|
124
|
+
totalCount: number,
|
|
125
|
+
observedCount: number,
|
|
126
|
+
threshold: number,
|
|
127
|
+
):
|
|
128
|
+
| { kind: "observed"; index: number }
|
|
129
|
+
| { kind: "below-threshold"; bound: number } {
|
|
130
|
+
if (
|
|
131
|
+
!Number.isSafeInteger(totalCount) ||
|
|
132
|
+
totalCount < 1 ||
|
|
133
|
+
!Number.isSafeInteger(observedCount) ||
|
|
134
|
+
observedCount < 0 ||
|
|
135
|
+
observedCount > totalCount ||
|
|
136
|
+
!Number.isFinite(threshold) ||
|
|
137
|
+
threshold < 0
|
|
138
|
+
) {
|
|
139
|
+
throw new RangeError("invalid thresholded percentile sample counts");
|
|
140
|
+
}
|
|
141
|
+
const rank = Math.ceil(totalCount * 0.95) - 1;
|
|
142
|
+
const belowThresholdCount = totalCount - observedCount;
|
|
143
|
+
return rank < belowThresholdCount
|
|
144
|
+
? { kind: "below-threshold", bound: threshold }
|
|
145
|
+
: { kind: "observed", index: rank - belowThresholdCount };
|
|
146
|
+
}
|
|
147
|
+
|
|
148
|
+
export interface StyleDelta {
|
|
149
|
+
key: string;
|
|
150
|
+
prop: string;
|
|
151
|
+
a: string;
|
|
152
|
+
b: string;
|
|
153
|
+
inside: boolean;
|
|
154
|
+
}
|
|
155
|
+
|
|
156
|
+
export interface StyleDiff {
|
|
157
|
+
/** Non-geometry property changes on records present on both sides. */
|
|
158
|
+
deltas: StyleDelta[];
|
|
159
|
+
/** Position/size changes beyond 1px. */
|
|
160
|
+
geometry: StyleDelta[];
|
|
161
|
+
missing: Array<{ key: string; inside: boolean }>;
|
|
162
|
+
added: Array<{ key: string; inside: boolean }>;
|
|
163
|
+
}
|
|
164
|
+
|
|
165
|
+
export const followsCenteredFlexReflow = (
|
|
166
|
+
before: SnapRecord | undefined,
|
|
167
|
+
after: SnapRecord | undefined,
|
|
168
|
+
prop: string,
|
|
169
|
+
actualShift: number,
|
|
170
|
+
) => {
|
|
171
|
+
const a = before?.flexCrossAlignment;
|
|
172
|
+
const b = after?.flexCrossAlignment;
|
|
173
|
+
if (
|
|
174
|
+
!a ||
|
|
175
|
+
!b ||
|
|
176
|
+
prop !== a.axis ||
|
|
177
|
+
a.axis !== b.axis ||
|
|
178
|
+
a.context !== b.context
|
|
179
|
+
)
|
|
180
|
+
return false;
|
|
181
|
+
const containerShift = b.containerPosition - a.containerPosition;
|
|
182
|
+
const containerSizeShift = b.containerSize - a.containerSize;
|
|
183
|
+
const editedItemSizeShift = b.editedItemSize - a.editedItemSize;
|
|
184
|
+
const expectedShift =
|
|
185
|
+
containerShift + (containerSizeShift - (b.itemSize - a.itemSize)) / 2;
|
|
186
|
+
// Only edit-caused line growth with a stationary parent and unchanged item-local offset is natural reflow.
|
|
187
|
+
const lineFollowsEdit =
|
|
188
|
+
Math.abs(containerSizeShift) <= 1 ||
|
|
189
|
+
(Math.sign(containerSizeShift) === Math.sign(editedItemSizeShift) &&
|
|
190
|
+
Math.abs(containerSizeShift) <= Math.abs(editedItemSizeShift) + 1);
|
|
191
|
+
return (
|
|
192
|
+
lineFollowsEdit &&
|
|
193
|
+
Math.abs(containerShift) <= 1 &&
|
|
194
|
+
Math.abs(actualShift - expectedShift) <= 1
|
|
195
|
+
);
|
|
196
|
+
};
|
|
197
|
+
|
|
198
|
+
function textOf(key: string): string | null {
|
|
199
|
+
const m = key.match(/^text:(.*)#\d+$/);
|
|
200
|
+
return m ? m[1].replace(/\s+/g, "") : null;
|
|
201
|
+
}
|
|
202
|
+
|
|
203
|
+
const baseOf = (key: string) => key.replace(/#\d+$/, "");
|
|
204
|
+
|
|
205
|
+
const CSS_PIXEL_QUANTIZATION = 1 / 64;
|
|
206
|
+
// Computed CSS pixels are serialized to thousandths, so two rounded samples
|
|
207
|
+
// can differ by one layout quantum plus at most a thousandth.
|
|
208
|
+
const CSS_PIXEL_SERIALIZATION_TOLERANCE = 0.001;
|
|
209
|
+
const PX_VALUE = /^(-?\d+(?:\.\d+)?)px$/u;
|
|
210
|
+
|
|
211
|
+
function sameComputedPosition(prop: string, before: string, after: string) {
|
|
212
|
+
const closePixels = (a: string, b: string) => {
|
|
213
|
+
const left = PX_VALUE.exec(a);
|
|
214
|
+
const right = PX_VALUE.exec(b);
|
|
215
|
+
return Boolean(
|
|
216
|
+
left &&
|
|
217
|
+
right &&
|
|
218
|
+
Math.abs(Number(left[1]) - Number(right[1])) <=
|
|
219
|
+
CSS_PIXEL_QUANTIZATION + CSS_PIXEL_SERIALIZATION_TOLERANCE,
|
|
220
|
+
);
|
|
221
|
+
};
|
|
222
|
+
if (["top", "right", "bottom", "left"].includes(prop)) {
|
|
223
|
+
return closePixels(before, after);
|
|
224
|
+
}
|
|
225
|
+
if (prop === "transform-origin") {
|
|
226
|
+
const left = before.split(/\s+/u);
|
|
227
|
+
const right = after.split(/\s+/u);
|
|
228
|
+
return (
|
|
229
|
+
left.length === right.length &&
|
|
230
|
+
left.every(
|
|
231
|
+
(value, index) =>
|
|
232
|
+
value === right[index] || closePixels(value, right[index]!),
|
|
233
|
+
)
|
|
234
|
+
);
|
|
235
|
+
}
|
|
236
|
+
if (prop === "transform") {
|
|
237
|
+
const matrix = (value: string) => {
|
|
238
|
+
const match = /^matrix\(([^)]+)\)$/u.exec(value);
|
|
239
|
+
return match ? match[1]!.split(/,\s*/u).map(Number) : null;
|
|
240
|
+
};
|
|
241
|
+
const left = matrix(before);
|
|
242
|
+
const right = matrix(after);
|
|
243
|
+
return Boolean(
|
|
244
|
+
left &&
|
|
245
|
+
right &&
|
|
246
|
+
left.length === 6 &&
|
|
247
|
+
right.length === 6 &&
|
|
248
|
+
left.slice(0, 4).every((value, index) => value === right[index]) &&
|
|
249
|
+
Math.abs(left[4]! - right[4]!) <=
|
|
250
|
+
CSS_PIXEL_QUANTIZATION + CSS_PIXEL_SERIALIZATION_TOLERANCE &&
|
|
251
|
+
Math.abs(left[5]! - right[5]!) <=
|
|
252
|
+
CSS_PIXEL_QUANTIZATION + CSS_PIXEL_SERIALIZATION_TOLERANCE,
|
|
253
|
+
);
|
|
254
|
+
}
|
|
255
|
+
return false;
|
|
256
|
+
}
|
|
257
|
+
|
|
258
|
+
/**
|
|
259
|
+
* Pairs the unchanged head and tail of the record sequence by position, the
|
|
260
|
+
* middle by key, then leftover text records whose text only grew or shrank at
|
|
261
|
+
* the end (append / enter3 change the edited run's own key).
|
|
262
|
+
*/
|
|
263
|
+
export function diffSnapshots(
|
|
264
|
+
a: Pick<Snapshot, "records">,
|
|
265
|
+
b: Pick<Snapshot, "records">,
|
|
266
|
+
): StyleDiff {
|
|
267
|
+
const allA = a.records;
|
|
268
|
+
const allB = b.records;
|
|
269
|
+
const stableB = new Map(
|
|
270
|
+
allB.flatMap((record) =>
|
|
271
|
+
record.stableKey ? [[record.stableKey, record] as const] : [],
|
|
272
|
+
),
|
|
273
|
+
);
|
|
274
|
+
const pairs: Array<[SnapRecord, SnapRecord]> = [];
|
|
275
|
+
const pairedB = new Set<SnapRecord>();
|
|
276
|
+
const unmatchedA = allA.filter((record) => {
|
|
277
|
+
const other = record.stableKey ? stableB.get(record.stableKey) : undefined;
|
|
278
|
+
if (
|
|
279
|
+
other &&
|
|
280
|
+
(!record.pptxRecordKey ||
|
|
281
|
+
!other.pptxRecordKey ||
|
|
282
|
+
record.pptxRecordKey === other.pptxRecordKey)
|
|
283
|
+
) {
|
|
284
|
+
pairs.push([record, other]);
|
|
285
|
+
pairedB.add(other);
|
|
286
|
+
return false;
|
|
287
|
+
}
|
|
288
|
+
return true;
|
|
289
|
+
});
|
|
290
|
+
const B = allB.filter((record) => !pairedB.has(record));
|
|
291
|
+
const pptxB = new Map<string, SnapRecord[]>();
|
|
292
|
+
for (const record of B) {
|
|
293
|
+
if (!record.pptxRecordKey) continue;
|
|
294
|
+
const records = pptxB.get(record.pptxRecordKey) ?? [];
|
|
295
|
+
records.push(record);
|
|
296
|
+
pptxB.set(record.pptxRecordKey, records);
|
|
297
|
+
}
|
|
298
|
+
const A = unmatchedA.filter((record) => {
|
|
299
|
+
const matches = record.pptxRecordKey
|
|
300
|
+
? pptxB.get(record.pptxRecordKey)
|
|
301
|
+
: undefined;
|
|
302
|
+
if (matches?.length !== 1 || pairedB.has(matches[0]!)) return true;
|
|
303
|
+
pairs.push([record, matches[0]!]);
|
|
304
|
+
pairedB.add(matches[0]!);
|
|
305
|
+
return false;
|
|
306
|
+
});
|
|
307
|
+
const unmatchedB = B.filter((record) => !pairedB.has(record));
|
|
308
|
+
// An edit changes one contiguous stretch of the document, so the head and
|
|
309
|
+
// tail pair by position. Per-text ordinals cannot: when the edited copy of a
|
|
310
|
+
// repeated text changes, later copies renumber onto their neighbours. Never
|
|
311
|
+
// pair on `inside`; each snapshot locates the edited element differently.
|
|
312
|
+
const same = (i: number, j: number) =>
|
|
313
|
+
baseOf(A[i].key) === baseOf(unmatchedB[j].key);
|
|
314
|
+
let head = 0;
|
|
315
|
+
while (head < A.length && head < unmatchedB.length && same(head, head))
|
|
316
|
+
head++;
|
|
317
|
+
let tail = 0;
|
|
318
|
+
while (
|
|
319
|
+
head + tail < A.length &&
|
|
320
|
+
head + tail < unmatchedB.length &&
|
|
321
|
+
same(A.length - 1 - tail, unmatchedB.length - 1 - tail)
|
|
322
|
+
) {
|
|
323
|
+
tail++;
|
|
324
|
+
}
|
|
325
|
+
for (let i = 0; i < head; i++) pairs.push([A[i], unmatchedB[i]]);
|
|
326
|
+
for (let i = 1; i <= tail; i++)
|
|
327
|
+
pairs.push([A[A.length - i], unmatchedB[unmatchedB.length - i]]);
|
|
328
|
+
const bByKey = new Map(
|
|
329
|
+
unmatchedB.slice(head, unmatchedB.length - tail).map((r) => [r.key, r]),
|
|
330
|
+
);
|
|
331
|
+
const leftA: SnapRecord[] = [];
|
|
332
|
+
for (const r of A.slice(head, A.length - tail)) {
|
|
333
|
+
const other = bByKey.get(r.key);
|
|
334
|
+
if (other) {
|
|
335
|
+
pairs.push([r, other]);
|
|
336
|
+
bByKey.delete(r.key);
|
|
337
|
+
} else {
|
|
338
|
+
leftA.push(r);
|
|
339
|
+
}
|
|
340
|
+
}
|
|
341
|
+
const leftB = [...bByKey.values()];
|
|
342
|
+
const missing: StyleDiff["missing"] = [];
|
|
343
|
+
for (const r of leftA) {
|
|
344
|
+
const t = textOf(r.key);
|
|
345
|
+
const idx =
|
|
346
|
+
t === null
|
|
347
|
+
? -1
|
|
348
|
+
: leftB.findIndex((o) => {
|
|
349
|
+
const u = textOf(o.key);
|
|
350
|
+
return !!u && !!t && (u.startsWith(t) || t.startsWith(u));
|
|
351
|
+
});
|
|
352
|
+
if (idx >= 0) {
|
|
353
|
+
pairs.push([r, leftB[idx]]);
|
|
354
|
+
leftB.splice(idx, 1);
|
|
355
|
+
} else {
|
|
356
|
+
missing.push({
|
|
357
|
+
key: r.key,
|
|
358
|
+
inside: r.inside && !r.protectedStructure,
|
|
359
|
+
});
|
|
360
|
+
}
|
|
361
|
+
}
|
|
362
|
+
const deltas: StyleDelta[] = [];
|
|
363
|
+
const geometry: StyleDelta[] = [];
|
|
364
|
+
for (const [ra, rb] of pairs) {
|
|
365
|
+
const inside = ra.inside || rb.inside;
|
|
366
|
+
const protectedInside = inside && !(ra.protectedStyle || rb.protectedStyle);
|
|
367
|
+
const protectedRectStable = Boolean(
|
|
368
|
+
ra.protectedStyle &&
|
|
369
|
+
rb.protectedStyle &&
|
|
370
|
+
ra.protectedRect &&
|
|
371
|
+
rb.protectedRect &&
|
|
372
|
+
(["x", "y", "width", "height"] as const).every(
|
|
373
|
+
(prop) =>
|
|
374
|
+
Math.abs(ra.protectedRect![prop] - rb.protectedRect![prop]) <=
|
|
375
|
+
GEOMETRY_TOLERANCE,
|
|
376
|
+
),
|
|
377
|
+
);
|
|
378
|
+
// Computed values can change with intrinsic layout; authored attrs cannot.
|
|
379
|
+
for (const [prop, before, after] of [
|
|
380
|
+
["class", ra.className, rb.className],
|
|
381
|
+
["style", ra.inlineStyle, rb.inlineStyle],
|
|
382
|
+
] as const) {
|
|
383
|
+
if (before !== undefined && after !== undefined && before !== after) {
|
|
384
|
+
deltas.push({
|
|
385
|
+
key: ra.key,
|
|
386
|
+
prop,
|
|
387
|
+
a: "changed",
|
|
388
|
+
b: "changed",
|
|
389
|
+
inside: protectedInside,
|
|
390
|
+
});
|
|
391
|
+
}
|
|
392
|
+
}
|
|
393
|
+
for (const prop of new Set([
|
|
394
|
+
...Object.keys(ra.props),
|
|
395
|
+
...Object.keys(rb.props),
|
|
396
|
+
])) {
|
|
397
|
+
const beforeValue =
|
|
398
|
+
ra.props[prop] ?? (prop.startsWith("--") ? "" : undefined);
|
|
399
|
+
const afterValue =
|
|
400
|
+
rb.props[prop] ?? (prop.startsWith("--") ? "" : undefined);
|
|
401
|
+
if (
|
|
402
|
+
beforeValue !== afterValue &&
|
|
403
|
+
!(
|
|
404
|
+
beforeValue &&
|
|
405
|
+
afterValue &&
|
|
406
|
+
sameComputedPosition(prop, beforeValue, afterValue)
|
|
407
|
+
)
|
|
408
|
+
) {
|
|
409
|
+
deltas.push({
|
|
410
|
+
key: ra.key,
|
|
411
|
+
prop,
|
|
412
|
+
a: beforeValue ?? "(absent)",
|
|
413
|
+
b: afterValue ?? "(absent)",
|
|
414
|
+
inside: protectedInside,
|
|
415
|
+
});
|
|
416
|
+
}
|
|
417
|
+
}
|
|
418
|
+
for (const prop of ["x", "y", "width", "height"] as const) {
|
|
419
|
+
if (Math.abs(ra.rect[prop] - rb.rect[prop]) > GEOMETRY_TOLERANCE) {
|
|
420
|
+
geometry.push({
|
|
421
|
+
key: ra.key,
|
|
422
|
+
prop,
|
|
423
|
+
a: String(ra.rect[prop]),
|
|
424
|
+
b: String(rb.rect[prop]),
|
|
425
|
+
inside: protectedInside || protectedRectStable,
|
|
426
|
+
});
|
|
427
|
+
}
|
|
428
|
+
}
|
|
429
|
+
}
|
|
430
|
+
return {
|
|
431
|
+
deltas,
|
|
432
|
+
geometry,
|
|
433
|
+
missing,
|
|
434
|
+
added: leftB.map((r) => ({
|
|
435
|
+
key: r.key,
|
|
436
|
+
inside: r.inside && !r.protectedStructure,
|
|
437
|
+
})),
|
|
438
|
+
};
|
|
439
|
+
}
|
|
440
|
+
|
|
441
|
+
export function outsideChangesFor(
|
|
442
|
+
before: OutsideSnapshot,
|
|
443
|
+
after: OutsideSnapshot,
|
|
444
|
+
) {
|
|
445
|
+
const outside = diffSnapshots(before, after);
|
|
446
|
+
const targetResized =
|
|
447
|
+
before.editedRect !== null &&
|
|
448
|
+
after.editedRect !== null &&
|
|
449
|
+
(Math.abs(before.editedRect.width - after.editedRect.width) > 1 ||
|
|
450
|
+
Math.abs(before.editedRect.height - after.editedRect.height) > 1);
|
|
451
|
+
const naturalReflow =
|
|
452
|
+
targetResized && before.editedInFlow && after.editedInFlow;
|
|
453
|
+
const beforeRecords = new Map(
|
|
454
|
+
before.records.map((record) => [record.key, record]),
|
|
455
|
+
);
|
|
456
|
+
const afterRecordsByKey = new Map(
|
|
457
|
+
after.records.map((record) => [record.key, record]),
|
|
458
|
+
);
|
|
459
|
+
const afterRecordsByStableKey = new Map(
|
|
460
|
+
after.records.flatMap((record) =>
|
|
461
|
+
record.stableKey ? [[record.stableKey, record] as const] : [],
|
|
462
|
+
),
|
|
463
|
+
);
|
|
464
|
+
const afterRecordsByPptxKey = new Map(
|
|
465
|
+
after.records.flatMap((record) =>
|
|
466
|
+
record.pptxRecordKey ? [[record.pptxRecordKey, record] as const] : [],
|
|
467
|
+
),
|
|
468
|
+
);
|
|
469
|
+
const copiedMarkerRecords = () => {
|
|
470
|
+
const fragments = after.editedAuthoringFragmentRects ?? [];
|
|
471
|
+
const beforeObject = before.editedObjectRect;
|
|
472
|
+
const afterObject = after.editedObjectRect;
|
|
473
|
+
const objectUnchanged =
|
|
474
|
+
!!beforeObject &&
|
|
475
|
+
!!afterObject &&
|
|
476
|
+
(["x", "y", "width", "height"] as const).every(
|
|
477
|
+
(prop) => Math.abs(beforeObject[prop] - afterObject[prop]) <= 1,
|
|
478
|
+
);
|
|
479
|
+
if (
|
|
480
|
+
!before.editedObjectId ||
|
|
481
|
+
before.editedObjectId !== after.editedObjectId ||
|
|
482
|
+
before.editedParagraphId !== after.editedParagraphId ||
|
|
483
|
+
!objectUnchanged ||
|
|
484
|
+
fragments.length !== 1 ||
|
|
485
|
+
!after.editedTargetRect ||
|
|
486
|
+
!fragments.some((fragment) =>
|
|
487
|
+
(["x", "y", "width", "height"] as const).every(
|
|
488
|
+
(prop) =>
|
|
489
|
+
Math.abs(fragment[prop] - after.editedTargetRect![prop]) <= 1,
|
|
490
|
+
),
|
|
491
|
+
)
|
|
492
|
+
) {
|
|
493
|
+
return { missing: new Set<string>(), added: new Set<string>() };
|
|
494
|
+
}
|
|
495
|
+
const fragment = fragments[0]!;
|
|
496
|
+
const markerFitsFragment = (record: SnapRecord) =>
|
|
497
|
+
record.rect.x >= fragment.x - 1 &&
|
|
498
|
+
record.rect.y >= fragment.y - 1 &&
|
|
499
|
+
record.rect.x + record.rect.width <= fragment.x + fragment.width + 1 &&
|
|
500
|
+
record.rect.y + record.rect.height <= fragment.y + fragment.height + 1;
|
|
501
|
+
const beforeMarkers = before.records.filter(
|
|
502
|
+
(record) =>
|
|
503
|
+
record.slideObjectId === before.editedObjectId &&
|
|
504
|
+
record.styledBulletMarker,
|
|
505
|
+
);
|
|
506
|
+
const afterMarkers = after.records.filter(
|
|
507
|
+
(record) =>
|
|
508
|
+
record.slideObjectId === before.editedObjectId &&
|
|
509
|
+
record.styledBulletMarker,
|
|
510
|
+
);
|
|
511
|
+
const beforeTargetMarkers = beforeMarkers.filter(
|
|
512
|
+
(record) => record.pptxParagraph === before.editedParagraphId,
|
|
513
|
+
);
|
|
514
|
+
const afterTargetMarkers = afterMarkers.filter(
|
|
515
|
+
(record) => record.pptxParagraph === before.editedParagraphId,
|
|
516
|
+
);
|
|
517
|
+
const markersByParagraph = (records: SnapRecord[]) => {
|
|
518
|
+
const grouped = new Map<string, SnapRecord[]>();
|
|
519
|
+
for (const record of records) {
|
|
520
|
+
const paragraph = record.pptxParagraph;
|
|
521
|
+
if (!paragraph) return null;
|
|
522
|
+
const group = grouped.get(paragraph) ?? [];
|
|
523
|
+
group.push(record);
|
|
524
|
+
grouped.set(paragraph, group);
|
|
525
|
+
}
|
|
526
|
+
return grouped;
|
|
527
|
+
};
|
|
528
|
+
const beforeByParagraph = markersByParagraph(beforeMarkers);
|
|
529
|
+
const afterByParagraph = markersByParagraph(afterMarkers);
|
|
530
|
+
if (
|
|
531
|
+
!beforeByParagraph ||
|
|
532
|
+
!afterByParagraph ||
|
|
533
|
+
beforeTargetMarkers.length !== 1 ||
|
|
534
|
+
afterTargetMarkers.length !== 2 ||
|
|
535
|
+
afterMarkers.length !== beforeMarkers.length + 1
|
|
536
|
+
) {
|
|
537
|
+
return { missing: new Set<string>(), added: new Set<string>() };
|
|
538
|
+
}
|
|
539
|
+
const sameMarkerAppearance = (previous: SnapRecord, current: SnapRecord) =>
|
|
540
|
+
previous.styledBulletMarker &&
|
|
541
|
+
current.styledBulletMarker &&
|
|
542
|
+
previous.slideObjectId === current.slideObjectId &&
|
|
543
|
+
previous.slideObjectId === before.editedObjectId &&
|
|
544
|
+
previous.tag === current.tag &&
|
|
545
|
+
previous.className === current.className &&
|
|
546
|
+
previous.inlineStyle === current.inlineStyle &&
|
|
547
|
+
previous.styledBulletMarkerText === current.styledBulletMarkerText &&
|
|
548
|
+
JSON.stringify(previous.props) === JSON.stringify(current.props);
|
|
549
|
+
const retainedMarkers = new Set<string>();
|
|
550
|
+
const retainedBeforeMarkers = new Set<string>();
|
|
551
|
+
for (const [paragraph, previousMarkers] of beforeByParagraph) {
|
|
552
|
+
const currentMarkers = afterByParagraph.get(paragraph) ?? [];
|
|
553
|
+
if (paragraph === before.editedParagraphId) {
|
|
554
|
+
if (
|
|
555
|
+
previousMarkers.length !== 1 ||
|
|
556
|
+
currentMarkers.length !== previousMarkers.length + 1
|
|
557
|
+
) {
|
|
558
|
+
return { missing: new Set<string>(), added: new Set<string>() };
|
|
559
|
+
}
|
|
560
|
+
const previous = previousMarkers[0]!;
|
|
561
|
+
const retained = currentMarkers.filter(
|
|
562
|
+
(current) =>
|
|
563
|
+
sameMarkerAppearance(previous, current) &&
|
|
564
|
+
(["x", "y", "width", "height"] as const).every(
|
|
565
|
+
(prop) => Math.abs(previous.rect[prop] - current.rect[prop]) <= 1,
|
|
566
|
+
),
|
|
567
|
+
);
|
|
568
|
+
if (retained.length !== 1) {
|
|
569
|
+
return { missing: new Set<string>(), added: new Set<string>() };
|
|
570
|
+
}
|
|
571
|
+
retainedMarkers.add(retained[0]!.key);
|
|
572
|
+
retainedBeforeMarkers.add(previous.key);
|
|
573
|
+
continue;
|
|
574
|
+
}
|
|
575
|
+
if (currentMarkers.length !== previousMarkers.length) {
|
|
576
|
+
return { missing: new Set<string>(), added: new Set<string>() };
|
|
577
|
+
}
|
|
578
|
+
for (const previous of previousMarkers) {
|
|
579
|
+
const matches = currentMarkers.filter(
|
|
580
|
+
(current) =>
|
|
581
|
+
sameMarkerAppearance(previous, current) &&
|
|
582
|
+
previous.pptxRecordKey &&
|
|
583
|
+
current.pptxRecordKey === previous.pptxRecordKey,
|
|
584
|
+
);
|
|
585
|
+
if (matches.length !== 1) {
|
|
586
|
+
return { missing: new Set<string>(), added: new Set<string>() };
|
|
587
|
+
}
|
|
588
|
+
retainedMarkers.add(matches[0]!.key);
|
|
589
|
+
retainedBeforeMarkers.add(previous.key);
|
|
590
|
+
}
|
|
591
|
+
}
|
|
592
|
+
const insertedMarkers = afterTargetMarkers.filter(
|
|
593
|
+
(record) => !retainedMarkers.has(record.key),
|
|
594
|
+
);
|
|
595
|
+
const sourceMarker = beforeTargetMarkers[0]!;
|
|
596
|
+
if (
|
|
597
|
+
insertedMarkers.length !== 1 ||
|
|
598
|
+
!markerFitsFragment(insertedMarkers[0]!) ||
|
|
599
|
+
!sameMarkerAppearance(sourceMarker, insertedMarkers[0]!)
|
|
600
|
+
) {
|
|
601
|
+
return { missing: new Set<string>(), added: new Set<string>() };
|
|
602
|
+
}
|
|
603
|
+
const addedMarkers = outside.added.filter((change) => {
|
|
604
|
+
const record = afterRecordsByKey.get(change.key);
|
|
605
|
+
return (
|
|
606
|
+
!!record &&
|
|
607
|
+
record.slideObjectId === before.editedObjectId &&
|
|
608
|
+
record.styledBulletMarker
|
|
609
|
+
);
|
|
610
|
+
});
|
|
611
|
+
if (
|
|
612
|
+
addedMarkers.some(
|
|
613
|
+
(change) =>
|
|
614
|
+
!retainedMarkers.has(change.key) &&
|
|
615
|
+
change.key !== insertedMarkers[0]!.key,
|
|
616
|
+
)
|
|
617
|
+
) {
|
|
618
|
+
return { missing: new Set<string>(), added: new Set<string>() };
|
|
619
|
+
}
|
|
620
|
+
const missingMarkers = outside.missing.filter((change) => {
|
|
621
|
+
const record = beforeRecords.get(change.key);
|
|
622
|
+
return (
|
|
623
|
+
!change.inside &&
|
|
624
|
+
!!record &&
|
|
625
|
+
record.slideObjectId === before.editedObjectId &&
|
|
626
|
+
record.styledBulletMarker
|
|
627
|
+
);
|
|
628
|
+
});
|
|
629
|
+
if (
|
|
630
|
+
missingMarkers.some((change) => !retainedBeforeMarkers.has(change.key))
|
|
631
|
+
) {
|
|
632
|
+
return { missing: new Set<string>(), added: new Set<string>() };
|
|
633
|
+
}
|
|
634
|
+
return {
|
|
635
|
+
missing: new Set(missingMarkers.map((change) => change.key)),
|
|
636
|
+
added: new Set(addedMarkers.map((change) => change.key)),
|
|
637
|
+
};
|
|
638
|
+
};
|
|
639
|
+
const followsNaturalReflow = (change: StyleDelta) => {
|
|
640
|
+
const beforeRecord = beforeRecords.get(change.key);
|
|
641
|
+
const afterRecord = beforeRecord?.stableKey
|
|
642
|
+
? (afterRecordsByStableKey.get(beforeRecord.stableKey) ??
|
|
643
|
+
afterRecordsByKey.get(change.key))
|
|
644
|
+
: afterRecordsByKey.get(change.key);
|
|
645
|
+
if (
|
|
646
|
+
!naturalReflow ||
|
|
647
|
+
(change.prop !== "x" && change.prop !== "y") ||
|
|
648
|
+
!beforeRecord?.downstreamFlow ||
|
|
649
|
+
!afterRecord?.downstreamFlow ||
|
|
650
|
+
!before.editedRect ||
|
|
651
|
+
!after.editedRect
|
|
652
|
+
) {
|
|
653
|
+
return false;
|
|
654
|
+
}
|
|
655
|
+
const position = change.prop === "x" ? "x" : "y";
|
|
656
|
+
const extent = change.prop === "x" ? "width" : "height";
|
|
657
|
+
const expectedShift =
|
|
658
|
+
after.editedRect[position] +
|
|
659
|
+
after.editedRect[extent] -
|
|
660
|
+
before.editedRect[position] -
|
|
661
|
+
before.editedRect[extent];
|
|
662
|
+
const actualShift = Number(change.b) - Number(change.a);
|
|
663
|
+
return (
|
|
664
|
+
Math.abs(actualShift - expectedShift) <= 1 ||
|
|
665
|
+
followsCenteredFlexReflow(
|
|
666
|
+
beforeRecord,
|
|
667
|
+
afterRecord,
|
|
668
|
+
change.prop,
|
|
669
|
+
actualShift,
|
|
670
|
+
)
|
|
671
|
+
);
|
|
672
|
+
};
|
|
673
|
+
const followsImportedTextObjectReflow = (change: StyleDelta) => {
|
|
674
|
+
const beforeRecord = beforeRecords.get(change.key);
|
|
675
|
+
const stableAfter = beforeRecord?.stableKey
|
|
676
|
+
? afterRecordsByStableKey.get(beforeRecord.stableKey)
|
|
677
|
+
: undefined;
|
|
678
|
+
const stableAfterMatchesParagraph =
|
|
679
|
+
!beforeRecord?.pptxRecordKey ||
|
|
680
|
+
!stableAfter?.pptxRecordKey ||
|
|
681
|
+
beforeRecord.pptxRecordKey === stableAfter.pptxRecordKey;
|
|
682
|
+
const afterRecord = beforeRecord?.pptxRecordKey
|
|
683
|
+
? (afterRecordsByPptxKey.get(beforeRecord.pptxRecordKey) ??
|
|
684
|
+
(stableAfterMatchesParagraph ? stableAfter : undefined) ??
|
|
685
|
+
afterRecordsByKey.get(change.key))
|
|
686
|
+
: (stableAfter ?? afterRecordsByKey.get(change.key));
|
|
687
|
+
const beforeObject = before.editedObjectRect;
|
|
688
|
+
const afterObject = after.editedObjectRect;
|
|
689
|
+
const beforeTarget = before.editedFlowAnchorRect ?? before.editedTargetRect;
|
|
690
|
+
const afterTarget = after.editedFlowAnchorRect ?? after.editedTargetRect;
|
|
691
|
+
const targetParagraph = Number(before.editedParagraphId);
|
|
692
|
+
const siblingParagraph = Number(beforeRecord?.pptxParagraph);
|
|
693
|
+
const targetShift =
|
|
694
|
+
beforeTarget && afterTarget ? afterTarget.y - beforeTarget.y : 0;
|
|
695
|
+
const targetGrowth =
|
|
696
|
+
beforeTarget && afterTarget
|
|
697
|
+
? afterTarget.height - beforeTarget.height
|
|
698
|
+
: 0;
|
|
699
|
+
const targetTextShift =
|
|
700
|
+
before.editedTargetRect && after.editedTargetRect
|
|
701
|
+
? after.editedTargetRect.y - before.editedTargetRect.y
|
|
702
|
+
: null;
|
|
703
|
+
const insertedBeforeTarget =
|
|
704
|
+
targetShift > GEOMETRY_TOLERANCE &&
|
|
705
|
+
Math.abs(targetGrowth) <= GEOMETRY_TOLERANCE;
|
|
706
|
+
const siblingYShifts = outside.geometry.flatMap((geometry) => {
|
|
707
|
+
if (geometry.prop !== "y") return [];
|
|
708
|
+
const previous = beforeRecords.get(geometry.key);
|
|
709
|
+
const stable = previous?.stableKey
|
|
710
|
+
? afterRecordsByStableKey.get(previous.stableKey)
|
|
711
|
+
: undefined;
|
|
712
|
+
const current = previous?.pptxRecordKey
|
|
713
|
+
? (afterRecordsByPptxKey.get(previous.pptxRecordKey) ??
|
|
714
|
+
(stable?.pptxRecordKey === previous.pptxRecordKey
|
|
715
|
+
? stable
|
|
716
|
+
: undefined))
|
|
717
|
+
: stable;
|
|
718
|
+
const paragraph = Number(previous?.pptxParagraph);
|
|
719
|
+
if (
|
|
720
|
+
!previous ||
|
|
721
|
+
!current ||
|
|
722
|
+
previous.slideObjectId !== before.editedObjectId ||
|
|
723
|
+
current.slideObjectId !== before.editedObjectId ||
|
|
724
|
+
!Number.isSafeInteger(paragraph) ||
|
|
725
|
+
paragraph <= targetParagraph
|
|
726
|
+
) {
|
|
727
|
+
return [];
|
|
728
|
+
}
|
|
729
|
+
return [Number(geometry.b) - Number(geometry.a)];
|
|
730
|
+
});
|
|
731
|
+
const insertedFragments = after.editedAuthoringFragmentRects ?? [];
|
|
732
|
+
const insertedFragmentBounds = insertedFragments.reduce(
|
|
733
|
+
(bounds, fragment) => ({
|
|
734
|
+
top: Math.min(bounds.top, fragment.y),
|
|
735
|
+
bottom: Math.max(bounds.bottom, fragment.y + fragment.height),
|
|
736
|
+
}),
|
|
737
|
+
{ top: Infinity, bottom: -Infinity },
|
|
738
|
+
);
|
|
739
|
+
const insertedFlowExtent =
|
|
740
|
+
insertedFragments.length > 0
|
|
741
|
+
? insertedFragmentBounds.bottom - insertedFragmentBounds.top
|
|
742
|
+
: null;
|
|
743
|
+
const editedTargetIsInsertedFragment =
|
|
744
|
+
!!after.editedTargetRect &&
|
|
745
|
+
insertedFragments.some((fragment) =>
|
|
746
|
+
(["x", "y", "width", "height"] as const).every(
|
|
747
|
+
(prop) =>
|
|
748
|
+
Math.abs(fragment[prop] - after.editedTargetRect![prop]) <=
|
|
749
|
+
GEOMETRY_TOLERANCE,
|
|
750
|
+
),
|
|
751
|
+
);
|
|
752
|
+
// A multi-block paste pushes the original text by the first block's offset
|
|
753
|
+
// plus the complete inserted run. A single split row uses its final edge.
|
|
754
|
+
const insertedAfterTargetShift =
|
|
755
|
+
targetTextShift !== null &&
|
|
756
|
+
insertedFlowExtent !== null &&
|
|
757
|
+
targetTextShift >= -GEOMETRY_TOLERANCE &&
|
|
758
|
+
targetTextShift <= insertedFlowExtent + GEOMETRY_TOLERANCE
|
|
759
|
+
? insertedFragments.length > 1
|
|
760
|
+
? targetTextShift + insertedFlowExtent
|
|
761
|
+
: editedTargetIsInsertedFragment && beforeTarget
|
|
762
|
+
? insertedFragmentBounds.bottom -
|
|
763
|
+
(beforeTarget.y + beforeTarget.height)
|
|
764
|
+
: targetTextShift + insertedFlowExtent
|
|
765
|
+
: null;
|
|
766
|
+
const downstreamAfterY = after.records
|
|
767
|
+
.filter(
|
|
768
|
+
(record) =>
|
|
769
|
+
record.slideObjectId === before.editedObjectId &&
|
|
770
|
+
Number.isSafeInteger(Number(record.pptxParagraph)) &&
|
|
771
|
+
Number(record.pptxParagraph) > targetParagraph,
|
|
772
|
+
)
|
|
773
|
+
.reduce((nearest, record) => Math.min(nearest, record.rect.y), Infinity);
|
|
774
|
+
const growsTarget =
|
|
775
|
+
targetGrowth > GEOMETRY_TOLERANCE &&
|
|
776
|
+
Math.abs(targetShift) <= GEOMETRY_TOLERANCE;
|
|
777
|
+
const insertedAfterTargetBase =
|
|
778
|
+
!!beforeTarget &&
|
|
779
|
+
!!afterTarget &&
|
|
780
|
+
Math.abs(targetShift) <= GEOMETRY_TOLERANCE &&
|
|
781
|
+
Math.abs(targetGrowth) <= GEOMETRY_TOLERANCE &&
|
|
782
|
+
insertedFragments.length > 0 &&
|
|
783
|
+
insertedFragments.every(
|
|
784
|
+
(fragment) =>
|
|
785
|
+
fragment.y >=
|
|
786
|
+
beforeTarget.y + beforeTarget.height - GEOMETRY_TOLERANCE &&
|
|
787
|
+
fragment.y + fragment.height <= downstreamAfterY + GEOMETRY_TOLERANCE,
|
|
788
|
+
) &&
|
|
789
|
+
insertedAfterTargetShift !== null &&
|
|
790
|
+
siblingYShifts.length > 0 &&
|
|
791
|
+
siblingYShifts.every(
|
|
792
|
+
(shift) => Math.abs(shift - siblingYShifts[0]!) <= GEOMETRY_TOLERANCE,
|
|
793
|
+
);
|
|
794
|
+
const expectedFlowShift = growsTarget
|
|
795
|
+
? targetGrowth
|
|
796
|
+
: insertedBeforeTarget
|
|
797
|
+
? targetShift
|
|
798
|
+
: insertedAfterTargetBase
|
|
799
|
+
? insertedAfterTargetShift
|
|
800
|
+
: null;
|
|
801
|
+
const flowMarkers = before.records.filter((record) => {
|
|
802
|
+
const paragraph = Number(record.pptxParagraph);
|
|
803
|
+
return (
|
|
804
|
+
record.slideObjectId === before.editedObjectId &&
|
|
805
|
+
record.styledBulletMarker &&
|
|
806
|
+
Number.isSafeInteger(paragraph) &&
|
|
807
|
+
(paragraph > targetParagraph ||
|
|
808
|
+
(insertedBeforeTarget && paragraph === targetParagraph))
|
|
809
|
+
);
|
|
810
|
+
});
|
|
811
|
+
const flowMarkersMatch =
|
|
812
|
+
expectedFlowShift === null ||
|
|
813
|
+
flowMarkers.every((previous) => {
|
|
814
|
+
if (!previous.pptxRecordKey || !previous.pptxParagraph) return false;
|
|
815
|
+
const matches = after.records.filter(
|
|
816
|
+
(current) =>
|
|
817
|
+
current.slideObjectId === before.editedObjectId &&
|
|
818
|
+
current.styledBulletMarker &&
|
|
819
|
+
current.pptxParagraph === previous.pptxParagraph &&
|
|
820
|
+
current.pptxRecordKey === previous.pptxRecordKey,
|
|
821
|
+
);
|
|
822
|
+
if (matches.length !== 1) return false;
|
|
823
|
+
const current = matches[0]!;
|
|
824
|
+
return (
|
|
825
|
+
previous.tag === current.tag &&
|
|
826
|
+
previous.className === current.className &&
|
|
827
|
+
previous.inlineStyle === current.inlineStyle &&
|
|
828
|
+
previous.styledBulletMarkerText === current.styledBulletMarkerText &&
|
|
829
|
+
JSON.stringify(previous.props) === JSON.stringify(current.props) &&
|
|
830
|
+
(["x", "width", "height"] as const).every(
|
|
831
|
+
(prop) =>
|
|
832
|
+
Math.abs(previous.rect[prop] - current.rect[prop]) <=
|
|
833
|
+
GEOMETRY_TOLERANCE,
|
|
834
|
+
) &&
|
|
835
|
+
Math.abs(current.rect.y - previous.rect.y - expectedFlowShift) <=
|
|
836
|
+
GEOMETRY_TOLERANCE
|
|
837
|
+
);
|
|
838
|
+
});
|
|
839
|
+
const insertedAfterTarget = insertedAfterTargetBase && flowMarkersMatch;
|
|
840
|
+
if (
|
|
841
|
+
change.prop !== "y" ||
|
|
842
|
+
!before.editedObjectId ||
|
|
843
|
+
before.editedObjectId !== after.editedObjectId ||
|
|
844
|
+
!before.editedParagraphId ||
|
|
845
|
+
before.editedParagraphId !== after.editedParagraphId ||
|
|
846
|
+
before.editedObjectPosition !== "absolute" ||
|
|
847
|
+
after.editedObjectPosition !== "absolute" ||
|
|
848
|
+
!beforeObject ||
|
|
849
|
+
!afterObject ||
|
|
850
|
+
!beforeTarget ||
|
|
851
|
+
!afterTarget ||
|
|
852
|
+
!beforeRecord ||
|
|
853
|
+
!afterRecord ||
|
|
854
|
+
beforeRecord.slideObjectId !== before.editedObjectId ||
|
|
855
|
+
afterRecord.slideObjectId !== before.editedObjectId ||
|
|
856
|
+
!beforeRecord.pptxParagraph ||
|
|
857
|
+
!afterRecord.pptxParagraph ||
|
|
858
|
+
!Number.isSafeInteger(targetParagraph) ||
|
|
859
|
+
!Number.isSafeInteger(siblingParagraph) ||
|
|
860
|
+
!Number.isSafeInteger(Number(afterRecord.pptxParagraph)) ||
|
|
861
|
+
siblingParagraph < targetParagraph ||
|
|
862
|
+
(siblingParagraph === targetParagraph &&
|
|
863
|
+
!insertedBeforeTarget &&
|
|
864
|
+
!editedTargetIsInsertedFragment) ||
|
|
865
|
+
(["x", "y", "width", "height"] as const).some(
|
|
866
|
+
(prop) => Math.abs(beforeObject[prop] - afterObject[prop]) > 1,
|
|
867
|
+
) ||
|
|
868
|
+
(["x", "width"] as const).some(
|
|
869
|
+
(prop) => Math.abs(beforeTarget[prop] - afterTarget[prop]) > 1,
|
|
870
|
+
)
|
|
871
|
+
) {
|
|
872
|
+
return false;
|
|
873
|
+
}
|
|
874
|
+
const siblingShift = Number(change.b) - Number(change.a);
|
|
875
|
+
const editedFragmentShift =
|
|
876
|
+
insertedAfterTarget &&
|
|
877
|
+
siblingParagraph === targetParagraph &&
|
|
878
|
+
editedTargetIsInsertedFragment
|
|
879
|
+
? targetTextShift
|
|
880
|
+
: null;
|
|
881
|
+
const expectedShift = growsTarget
|
|
882
|
+
? targetGrowth
|
|
883
|
+
: insertedBeforeTarget
|
|
884
|
+
? targetShift
|
|
885
|
+
: insertedAfterTarget
|
|
886
|
+
? (editedFragmentShift ?? insertedAfterTargetShift)
|
|
887
|
+
: null;
|
|
888
|
+
const afterParagraph = Number(afterRecord.pptxParagraph);
|
|
889
|
+
if (
|
|
890
|
+
expectedShift === null ||
|
|
891
|
+
!flowMarkersMatch ||
|
|
892
|
+
afterParagraph < targetParagraph ||
|
|
893
|
+
(siblingParagraph === targetParagraph &&
|
|
894
|
+
!insertedBeforeTarget &&
|
|
895
|
+
editedFragmentShift === null)
|
|
896
|
+
) {
|
|
897
|
+
return false;
|
|
898
|
+
}
|
|
899
|
+
return Math.abs(siblingShift - expectedShift) <= GEOMETRY_TOLERANCE;
|
|
900
|
+
};
|
|
901
|
+
const copiedMarkers = copiedMarkerRecords();
|
|
902
|
+
const normalizedOutside = {
|
|
903
|
+
...outside,
|
|
904
|
+
missing: outside.missing.filter(
|
|
905
|
+
(change) => !copiedMarkers.missing.has(change.key),
|
|
906
|
+
),
|
|
907
|
+
added: outside.added.filter(
|
|
908
|
+
(change) => !copiedMarkers.added.has(change.key),
|
|
909
|
+
),
|
|
910
|
+
};
|
|
911
|
+
const changes = [
|
|
912
|
+
...outside.deltas,
|
|
913
|
+
...outside.geometry.filter(
|
|
914
|
+
(change) =>
|
|
915
|
+
!followsNaturalReflow(change) &&
|
|
916
|
+
!followsImportedTextObjectReflow(change),
|
|
917
|
+
),
|
|
918
|
+
...normalizedOutside.missing,
|
|
919
|
+
...normalizedOutside.added,
|
|
920
|
+
].filter((change) => !change.inside);
|
|
921
|
+
return { outside: normalizedOutside, changes };
|
|
922
|
+
}
|
|
923
|
+
|
|
924
|
+
// ---------------------------------------------------------------- writes ---
|
|
925
|
+
|
|
926
|
+
export const stripSpace = (s: string) => s.replace(/[\s\u200b\ufeff]+/g, "");
|
|
927
|
+
|
|
928
|
+
const UNRENDERED = new Set(["style", "script", "svg", "template", "math"]);
|
|
929
|
+
|
|
930
|
+
/** A parse5 node's text, skipping elements the renderer drops. */
|
|
931
|
+
export const visibleTextOf = (node: P5.Node): string =>
|
|
932
|
+
node.nodeName === "#text"
|
|
933
|
+
? (node as P5.TextNode).value
|
|
934
|
+
: "childNodes" in node &&
|
|
935
|
+
!UNRENDERED.has((node as P5.Element).tagName ?? "")
|
|
936
|
+
? (node as P5.ParentNode).childNodes.map(visibleTextOf).join("")
|
|
937
|
+
: "";
|
|
938
|
+
|
|
939
|
+
/**
|
|
940
|
+
* The slide's content in a write's JSON body, once per operation naming the
|
|
941
|
+
* slide; null where an operation deletes the slide or a full save leaves it
|
|
942
|
+
* out.
|
|
943
|
+
*/
|
|
944
|
+
export function slideContentsOf(
|
|
945
|
+
action: string,
|
|
946
|
+
body: any,
|
|
947
|
+
slideId: string,
|
|
948
|
+
): Array<string | null> {
|
|
949
|
+
const entries: Array<[unknown, unknown]> =
|
|
950
|
+
action === "patch-deck"
|
|
951
|
+
? (body.operations ?? []).flatMap((op: any) => {
|
|
952
|
+
if (String(op.slideId) !== slideId) return [];
|
|
953
|
+
if (op.op === "delete-slide") return [[op.slideId, null]];
|
|
954
|
+
if (op.op !== "patch-slide" && op.op !== "add-slide") return [];
|
|
955
|
+
return Object.hasOwn(op.fields ?? {}, "content")
|
|
956
|
+
? [[op.slideId, op.fields.content]]
|
|
957
|
+
: [];
|
|
958
|
+
})
|
|
959
|
+
: action === "update-slide"
|
|
960
|
+
? Object.hasOwn(body, "content")
|
|
961
|
+
? [[body.slideId, body.content]]
|
|
962
|
+
: []
|
|
963
|
+
: (body.deck?.slides ?? []).map((s: any) => [s.id, s.content]);
|
|
964
|
+
const named = entries.filter(([id]) => String(id) === slideId);
|
|
965
|
+
if (action === "save-deck" && !named.length) return [null];
|
|
966
|
+
return named.map(([, content]) =>
|
|
967
|
+
typeof content === "string" ? content : null,
|
|
968
|
+
);
|
|
969
|
+
}
|
|
970
|
+
|
|
971
|
+
/** The slide content a write sets when that is all it changes; else null. */
|
|
972
|
+
function contentOnlyPatch(
|
|
973
|
+
action: string,
|
|
974
|
+
body: any,
|
|
975
|
+
slideId: string,
|
|
976
|
+
): string | null {
|
|
977
|
+
const ops = action === "patch-deck" ? (body.operations ?? []) : [];
|
|
978
|
+
const [op] = ops;
|
|
979
|
+
return ops.length === 1 &&
|
|
980
|
+
op.op === "patch-slide" &&
|
|
981
|
+
String(op.slideId) === slideId &&
|
|
982
|
+
Object.keys(op.fields ?? {}).join() === "content" &&
|
|
983
|
+
typeof op.fields.content === "string"
|
|
984
|
+
? op.fields.content
|
|
985
|
+
: null;
|
|
986
|
+
}
|
|
987
|
+
|
|
988
|
+
/**
|
|
989
|
+
* Whether one phase's writes are the editor's draft then revert: keys far
|
|
990
|
+
* enough apart that the typed state saved before the delete saved the stored
|
|
991
|
+
* bytes back. Both writes may set only the edited slide's content, and the
|
|
992
|
+
* draft is held to append's rule: bytes outside the edited element (`element`,
|
|
993
|
+
* its range in `stored`) are unchanged, and inside it only `typed` was added
|
|
994
|
+
* to its text.
|
|
995
|
+
*/
|
|
996
|
+
export function isDraftRevert(
|
|
997
|
+
stored: string,
|
|
998
|
+
element: { start: number; end: number },
|
|
999
|
+
typed: string,
|
|
1000
|
+
writes: Array<{ action: string; body: any }>,
|
|
1001
|
+
slideId: string,
|
|
1002
|
+
): boolean {
|
|
1003
|
+
if (writes.length !== 2) return false;
|
|
1004
|
+
const [draft, revert] = writes.map((w) =>
|
|
1005
|
+
contentOnlyPatch(w.action, w.body, slideId),
|
|
1006
|
+
);
|
|
1007
|
+
if (draft === null || revert !== stored) return false;
|
|
1008
|
+
const before = stored.slice(0, element.start);
|
|
1009
|
+
const after = stored.slice(element.end);
|
|
1010
|
+
if (
|
|
1011
|
+
draft.length < before.length + after.length ||
|
|
1012
|
+
!draft.startsWith(before) ||
|
|
1013
|
+
!draft.endsWith(after)
|
|
1014
|
+
) {
|
|
1015
|
+
return false;
|
|
1016
|
+
}
|
|
1017
|
+
if (!typed) return false;
|
|
1018
|
+
const beforeTree = parse(stored.slice(element.start, element.end));
|
|
1019
|
+
const afterTree = parse(
|
|
1020
|
+
draft.slice(element.start, draft.length - after.length),
|
|
1021
|
+
);
|
|
1022
|
+
let changedTextNodes = 0;
|
|
1023
|
+
const attrsOf = (node: P5.Node) =>
|
|
1024
|
+
"attrs" in node
|
|
1025
|
+
? node.attrs
|
|
1026
|
+
.map((attr) =>
|
|
1027
|
+
JSON.stringify([
|
|
1028
|
+
attr.namespace,
|
|
1029
|
+
attr.prefix,
|
|
1030
|
+
attr.name,
|
|
1031
|
+
attr.value,
|
|
1032
|
+
]),
|
|
1033
|
+
)
|
|
1034
|
+
.sort()
|
|
1035
|
+
: [];
|
|
1036
|
+
const childrenOf = (node: P5.Node): P5.Node[] => [
|
|
1037
|
+
...("childNodes" in node ? node.childNodes : []),
|
|
1038
|
+
...("content" in node ? node.content.childNodes : []),
|
|
1039
|
+
];
|
|
1040
|
+
const sameTree = (a: P5.Node, b: P5.Node): boolean => {
|
|
1041
|
+
if (a.nodeName !== b.nodeName) return false;
|
|
1042
|
+
for (const prop of [
|
|
1043
|
+
"tagName",
|
|
1044
|
+
"namespaceURI",
|
|
1045
|
+
"prefix",
|
|
1046
|
+
"data",
|
|
1047
|
+
"name",
|
|
1048
|
+
"publicId",
|
|
1049
|
+
"systemId",
|
|
1050
|
+
]) {
|
|
1051
|
+
if ((a as any)[prop] !== (b as any)[prop]) return false;
|
|
1052
|
+
}
|
|
1053
|
+
if (JSON.stringify(attrsOf(a)) !== JSON.stringify(attrsOf(b))) return false;
|
|
1054
|
+
if (a.nodeName === "#text") {
|
|
1055
|
+
if (
|
|
1056
|
+
collapse((a as P5.TextNode).value) !==
|
|
1057
|
+
collapse((b as P5.TextNode).value)
|
|
1058
|
+
) {
|
|
1059
|
+
changedTextNodes++;
|
|
1060
|
+
}
|
|
1061
|
+
}
|
|
1062
|
+
const aChildren = childrenOf(a);
|
|
1063
|
+
const bChildren = childrenOf(b);
|
|
1064
|
+
return (
|
|
1065
|
+
aChildren.length === bChildren.length &&
|
|
1066
|
+
aChildren.every((child, i) => sameTree(child, bChildren[i]))
|
|
1067
|
+
);
|
|
1068
|
+
};
|
|
1069
|
+
if (!sameTree(beforeTree, afterTree) || changedTextNodes !== 1) return false;
|
|
1070
|
+
const textOf = (node: P5.Node) => collapse(visibleTextOf(node));
|
|
1071
|
+
const want = textOf(beforeTree);
|
|
1072
|
+
const have = textOf(afterTree);
|
|
1073
|
+
for (let i = 0; i < have.length; i++) {
|
|
1074
|
+
if (
|
|
1075
|
+
have.startsWith(typed, i) &&
|
|
1076
|
+
have.slice(0, i) + have.slice(i + typed.length) === want
|
|
1077
|
+
)
|
|
1078
|
+
return true;
|
|
1079
|
+
}
|
|
1080
|
+
return false;
|
|
1081
|
+
}
|
|
1082
|
+
|
|
1083
|
+
/**
|
|
1084
|
+
* The slide contents unload keepalive writes carried that differ from what
|
|
1085
|
+
* the edit saved; null for a body that could not be read, and for a write
|
|
1086
|
+
* that deletes or replaces the slide without content to compare.
|
|
1087
|
+
*/
|
|
1088
|
+
export function keepaliveMismatches(
|
|
1089
|
+
writes: KeepaliveWrite[],
|
|
1090
|
+
slideId: string,
|
|
1091
|
+
saved: string,
|
|
1092
|
+
): Array<string | null> {
|
|
1093
|
+
return writes.flatMap((w) =>
|
|
1094
|
+
w.body === null
|
|
1095
|
+
? [null]
|
|
1096
|
+
: slideContentsOf(w.action, JSON.parse(w.body), slideId).filter(
|
|
1097
|
+
(c) => c !== saved,
|
|
1098
|
+
),
|
|
1099
|
+
);
|
|
1100
|
+
}
|
|
1101
|
+
|
|
1102
|
+
// ------------------------------------------------------------------ html ---
|
|
1103
|
+
|
|
1104
|
+
export const HARD_FAIL_PATTERNS: Record<string, RegExp> = {
|
|
1105
|
+
"data-slide-content-scope": /data-slide-content-scope/g,
|
|
1106
|
+
"visibility:hidden": /visibility\s*:\s*hidden/gi,
|
|
1107
|
+
"data-editing-block": /data-editing-block/g,
|
|
1108
|
+
contenteditable: /contenteditable/gi,
|
|
1109
|
+
"data-builder-id": /data-builder-id/g,
|
|
1110
|
+
ProseMirror: /ProseMirror/g,
|
|
1111
|
+
"data-src-i": /data-src-i/g,
|
|
1112
|
+
};
|
|
1113
|
+
|
|
1114
|
+
const count = (s: string, re: RegExp) => (s.match(re) ?? []).length;
|
|
1115
|
+
const styleTexts = (s: string) =>
|
|
1116
|
+
[...s.matchAll(/<style\b[^>]*>([\s\S]*?)<\/style>/gi)].map((m) =>
|
|
1117
|
+
m[1].replace(/\s+/g, " ").trim(),
|
|
1118
|
+
);
|
|
1119
|
+
|
|
1120
|
+
/** Markers of editor/renderer state leaking into the stored source. */
|
|
1121
|
+
export function hardFailures(stored: string, saved: string): string[] {
|
|
1122
|
+
const out: string[] = [];
|
|
1123
|
+
for (const [name, re] of Object.entries(HARD_FAIL_PATTERNS)) {
|
|
1124
|
+
const before = count(stored, re);
|
|
1125
|
+
const after = count(saved, re);
|
|
1126
|
+
if (after > before) out.push(`${name} ${before}->${after}`);
|
|
1127
|
+
}
|
|
1128
|
+
if (styleTexts(stored).join("\n") !== styleTexts(saved).join("\n")) {
|
|
1129
|
+
out.push("<style> text changed");
|
|
1130
|
+
}
|
|
1131
|
+
for (const tag of ["svg", "img"]) {
|
|
1132
|
+
const re = new RegExp(`<${tag}\\b`, "gi");
|
|
1133
|
+
const before = count(stored, re);
|
|
1134
|
+
const after = count(saved, re);
|
|
1135
|
+
if (after < before) out.push(`<${tag}> ${before}->${after}`);
|
|
1136
|
+
}
|
|
1137
|
+
return out;
|
|
1138
|
+
}
|
|
1139
|
+
|
|
1140
|
+
/** Minimal line diff (LCS) for canonical HTML; `-` stored, `+` saved. */
|
|
1141
|
+
export function lineDiff(a: string[], b: string[], max = 120): string[] {
|
|
1142
|
+
let start = 0;
|
|
1143
|
+
while (start < a.length && start < b.length && a[start] === b[start]) start++;
|
|
1144
|
+
let endA = a.length;
|
|
1145
|
+
let endB = b.length;
|
|
1146
|
+
while (endA > start && endB > start && a[endA - 1] === b[endB - 1]) {
|
|
1147
|
+
endA--;
|
|
1148
|
+
endB--;
|
|
1149
|
+
}
|
|
1150
|
+
const ma = a.slice(start, endA);
|
|
1151
|
+
const mb = b.slice(start, endB);
|
|
1152
|
+
// ponytail: O(n*m) LCS on the differing middle only; fine for slide-sized HTML.
|
|
1153
|
+
const lcs: number[][] = Array.from({ length: ma.length + 1 }, () =>
|
|
1154
|
+
new Array(mb.length + 1).fill(0),
|
|
1155
|
+
);
|
|
1156
|
+
for (let i = ma.length - 1; i >= 0; i--) {
|
|
1157
|
+
for (let j = mb.length - 1; j >= 0; j--) {
|
|
1158
|
+
lcs[i][j] =
|
|
1159
|
+
ma[i] === mb[j]
|
|
1160
|
+
? lcs[i + 1][j + 1] + 1
|
|
1161
|
+
: Math.max(lcs[i + 1][j], lcs[i][j + 1]);
|
|
1162
|
+
}
|
|
1163
|
+
}
|
|
1164
|
+
const out: string[] = [];
|
|
1165
|
+
let i = 0;
|
|
1166
|
+
let j = 0;
|
|
1167
|
+
while (i < ma.length || j < mb.length) {
|
|
1168
|
+
if (i < ma.length && j < mb.length && ma[i] === mb[j]) {
|
|
1169
|
+
i++;
|
|
1170
|
+
j++;
|
|
1171
|
+
} else if (
|
|
1172
|
+
i < ma.length &&
|
|
1173
|
+
(j >= mb.length || lcs[i + 1][j] >= lcs[i][j + 1])
|
|
1174
|
+
) {
|
|
1175
|
+
out.push(`- ${ma[i++]}`);
|
|
1176
|
+
} else {
|
|
1177
|
+
out.push(`+ ${mb[j++]}`);
|
|
1178
|
+
}
|
|
1179
|
+
}
|
|
1180
|
+
return out.length > max
|
|
1181
|
+
? [...out.slice(0, max), `… ${out.length - max} more changed lines`]
|
|
1182
|
+
: out;
|
|
1183
|
+
}
|
|
1184
|
+
|
|
1185
|
+
const collapse = (s: string) =>
|
|
1186
|
+
s
|
|
1187
|
+
.replace(/[\u200b\ufeff]/g, "")
|
|
1188
|
+
.replace(/\s+/g, " ")
|
|
1189
|
+
.trim();
|
|
1190
|
+
|
|
1191
|
+
/**
|
|
1192
|
+
* `after` is `before` with `token` inserted exactly once, at any point: End
|
|
1193
|
+
* lands mid-text in a wrapped paragraph. Beside the token, the insertion may
|
|
1194
|
+
* only hold spaces and marker glyphs, since Enter in a custom bullet row
|
|
1195
|
+
* clones its marker; any letter or digit there, or any text of `before`
|
|
1196
|
+
* missing, fails. Whitespace runs compare as one space, so a line break reads
|
|
1197
|
+
* as a space and a token's leading space may merge with one already there,
|
|
1198
|
+
* but a lost space fails.
|
|
1199
|
+
*/
|
|
1200
|
+
export function isSplicedOnce(
|
|
1201
|
+
before: string,
|
|
1202
|
+
token: string,
|
|
1203
|
+
after: string,
|
|
1204
|
+
): boolean {
|
|
1205
|
+
const b = collapse(before);
|
|
1206
|
+
const t = collapse(token);
|
|
1207
|
+
const a = collapse(after);
|
|
1208
|
+
const spaced = /^\s/.test(token);
|
|
1209
|
+
for (let i = 0; i <= b.length; i++) {
|
|
1210
|
+
const tail = b.length - i;
|
|
1211
|
+
if (a.length - tail < i + t.length) break;
|
|
1212
|
+
if (!a.startsWith(b.slice(0, i)) || !a.endsWith(b.slice(i))) continue;
|
|
1213
|
+
const inserted = a.slice(i, a.length - tail).split(t);
|
|
1214
|
+
if (inserted.length !== 2 || /[\p{L}\p{N}]/u.test(inserted.join("")))
|
|
1215
|
+
continue;
|
|
1216
|
+
const lead = a.slice(0, i) + inserted[0];
|
|
1217
|
+
if (!spaced || lead === "" || lead.endsWith(" ")) return true;
|
|
1218
|
+
}
|
|
1219
|
+
return false;
|
|
1220
|
+
}
|
|
1221
|
+
|
|
1222
|
+
/**
|
|
1223
|
+
* Keys of text records `b` adds inside the edited element whose style no
|
|
1224
|
+
* text of that element had in `a`: typing that lands in a new node outside
|
|
1225
|
+
* the run it continued, so it loses the run's color or weight. `diffSnapshots`
|
|
1226
|
+
* lists such records as added, which alone is no violation.
|
|
1227
|
+
*/
|
|
1228
|
+
export function restyledAddedText(
|
|
1229
|
+
a: Snapshot,
|
|
1230
|
+
b: Snapshot,
|
|
1231
|
+
startingBlockTag: string | null = null,
|
|
1232
|
+
): string[] {
|
|
1233
|
+
const added = new Set(diffSnapshots(a, b).added.map((r) => r.key));
|
|
1234
|
+
const startsInConvertibleBlock =
|
|
1235
|
+
/^h[1-6]$/i.test(startingBlockTag ?? "") ||
|
|
1236
|
+
startingBlockTag?.toLowerCase() === "li";
|
|
1237
|
+
const known = new Set(
|
|
1238
|
+
a.records
|
|
1239
|
+
.filter((r) => r.kind === "text" && r.inside)
|
|
1240
|
+
.map((r) => JSON.stringify(r.props)),
|
|
1241
|
+
);
|
|
1242
|
+
return b.records
|
|
1243
|
+
.filter(
|
|
1244
|
+
(r) =>
|
|
1245
|
+
r.kind === "text" &&
|
|
1246
|
+
r.inside &&
|
|
1247
|
+
added.has(r.key) &&
|
|
1248
|
+
!(
|
|
1249
|
+
startsInConvertibleBlock &&
|
|
1250
|
+
r.tag === "p" &&
|
|
1251
|
+
!r.inlineStyle?.trim()
|
|
1252
|
+
) &&
|
|
1253
|
+
!known.has(JSON.stringify(r.props)),
|
|
1254
|
+
)
|
|
1255
|
+
.map((r) => r.key);
|
|
1256
|
+
}
|
|
1257
|
+
|
|
1258
|
+
// -------------------------------------------------------------- baseline ---
|
|
1259
|
+
|
|
1260
|
+
export type Status = "pass" | "fail" | "no-edit" | "error";
|
|
1261
|
+
const STATUS_RANK: Record<Status, number> = {
|
|
1262
|
+
pass: 0,
|
|
1263
|
+
fail: 1,
|
|
1264
|
+
"no-edit": 2,
|
|
1265
|
+
error: 3,
|
|
1266
|
+
};
|
|
1267
|
+
|
|
1268
|
+
/** Ratcheted numbers per case/slide/target/scenario. */
|
|
1269
|
+
export interface ScenarioMetrics {
|
|
1270
|
+
status: Status;
|
|
1271
|
+
editingPct: number;
|
|
1272
|
+
afterPct: number;
|
|
1273
|
+
reloadPct: number;
|
|
1274
|
+
/** Typed, still editing -> after exit, whole slide. */
|
|
1275
|
+
typedPct: number;
|
|
1276
|
+
outsideEditingPct: number;
|
|
1277
|
+
outsideAfterPct: number;
|
|
1278
|
+
styleDeltasEditing: number;
|
|
1279
|
+
styleDeltasAfter: number;
|
|
1280
|
+
missingAfter: number;
|
|
1281
|
+
htmlDiffLines: number;
|
|
1282
|
+
hardFailures: number;
|
|
1283
|
+
violations: number;
|
|
1284
|
+
}
|
|
1285
|
+
|
|
1286
|
+
const PCT_FIELDS = [
|
|
1287
|
+
"editingPct",
|
|
1288
|
+
"afterPct",
|
|
1289
|
+
"reloadPct",
|
|
1290
|
+
"typedPct",
|
|
1291
|
+
"outsideEditingPct",
|
|
1292
|
+
"outsideAfterPct",
|
|
1293
|
+
] as const;
|
|
1294
|
+
const COUNT_FIELDS = [
|
|
1295
|
+
"styleDeltasEditing",
|
|
1296
|
+
"styleDeltasAfter",
|
|
1297
|
+
"missingAfter",
|
|
1298
|
+
"htmlDiffLines",
|
|
1299
|
+
"hardFailures",
|
|
1300
|
+
"violations",
|
|
1301
|
+
] as const;
|
|
1302
|
+
|
|
1303
|
+
export type BaselineEntry = ScenarioMetrics;
|
|
1304
|
+
|
|
1305
|
+
/** Same slack as the Design harness: d + max(0.1, 15% of d). */
|
|
1306
|
+
export function ceilingFor(pct: number): number {
|
|
1307
|
+
return Number((pct + Math.max(0.1, pct * 0.15)).toFixed(3));
|
|
1308
|
+
}
|
|
1309
|
+
|
|
1310
|
+
export function toBaselineEntry(m: ScenarioMetrics): BaselineEntry {
|
|
1311
|
+
const entry = { ...m };
|
|
1312
|
+
for (const f of PCT_FIELDS) entry[f] = ceilingFor(m[f]);
|
|
1313
|
+
return entry;
|
|
1314
|
+
}
|
|
1315
|
+
|
|
1316
|
+
/** An entry recorded before a field existed holds it to the invariant. */
|
|
1317
|
+
function pctCeiling(entry: BaselineEntry, f: (typeof PCT_FIELDS)[number]) {
|
|
1318
|
+
return entry[f] ?? ceilingFor(0);
|
|
1319
|
+
}
|
|
1320
|
+
|
|
1321
|
+
/**
|
|
1322
|
+
* The entry `--update` writes: a fresh measurement for a new key, and for an
|
|
1323
|
+
* existing one the stricter of the two per field, so an update never loosens
|
|
1324
|
+
* the ratchet. Loosening an entry is a deliberate edit, not a re-measure.
|
|
1325
|
+
*/
|
|
1326
|
+
export function ratchetBaselineEntry(
|
|
1327
|
+
existing: BaselineEntry | undefined,
|
|
1328
|
+
m: ScenarioMetrics,
|
|
1329
|
+
): BaselineEntry {
|
|
1330
|
+
const next = toBaselineEntry(m);
|
|
1331
|
+
if (!existing) return next;
|
|
1332
|
+
if (STATUS_RANK[existing.status] < STATUS_RANK[next.status]) {
|
|
1333
|
+
next.status = existing.status;
|
|
1334
|
+
}
|
|
1335
|
+
for (const f of PCT_FIELDS)
|
|
1336
|
+
next[f] = Math.min(pctCeiling(existing, f), next[f]);
|
|
1337
|
+
for (const f of COUNT_FIELDS) next[f] = Math.min(existing[f], next[f]);
|
|
1338
|
+
return next;
|
|
1339
|
+
}
|
|
1340
|
+
|
|
1341
|
+
/**
|
|
1342
|
+
* Regressions against the ratchet. `expected` lists keys that should have run
|
|
1343
|
+
* this time (within the run's filters and limits); a baselined key among them
|
|
1344
|
+
* that produced no result is a problem, because a harness that silently runs
|
|
1345
|
+
* less can never fail.
|
|
1346
|
+
*/
|
|
1347
|
+
export function findBaselineProblems(
|
|
1348
|
+
results: Map<string, ScenarioMetrics>,
|
|
1349
|
+
baseline: Record<string, BaselineEntry>,
|
|
1350
|
+
isExpected: (key: string) => boolean,
|
|
1351
|
+
): string[] {
|
|
1352
|
+
const problems: string[] = [];
|
|
1353
|
+
for (const [key, m] of results) {
|
|
1354
|
+
// An error measured nothing, so no baseline can make it a pass.
|
|
1355
|
+
if (m.status === "error") {
|
|
1356
|
+
problems.push(`${key}: errored`);
|
|
1357
|
+
continue;
|
|
1358
|
+
}
|
|
1359
|
+
const b = baseline[key];
|
|
1360
|
+
if (!b) {
|
|
1361
|
+
problems.push(
|
|
1362
|
+
`${key}: no baseline entry (status ${m.status}) - run with --update to record one`,
|
|
1363
|
+
);
|
|
1364
|
+
continue;
|
|
1365
|
+
}
|
|
1366
|
+
if (STATUS_RANK[m.status] > STATUS_RANK[b.status]) {
|
|
1367
|
+
problems.push(`${key}: status ${b.status} -> ${m.status}`);
|
|
1368
|
+
}
|
|
1369
|
+
for (const f of PCT_FIELDS) {
|
|
1370
|
+
const ceiling = pctCeiling(b, f);
|
|
1371
|
+
if (m[f] > ceiling)
|
|
1372
|
+
problems.push(`${key}: ${f} ${m[f]}% exceeds ceiling ${ceiling}%`);
|
|
1373
|
+
}
|
|
1374
|
+
for (const f of COUNT_FIELDS) {
|
|
1375
|
+
if (m[f] > b[f])
|
|
1376
|
+
problems.push(`${key}: ${f} ${m[f]} exceeds baseline ${b[f]}`);
|
|
1377
|
+
}
|
|
1378
|
+
}
|
|
1379
|
+
for (const key of Object.keys(baseline)) {
|
|
1380
|
+
if (!results.has(key) && isExpected(key)) {
|
|
1381
|
+
problems.push(`${key}: baselined scenario did not run`);
|
|
1382
|
+
}
|
|
1383
|
+
}
|
|
1384
|
+
return problems;
|
|
1385
|
+
}
|
|
1386
|
+
|
|
1387
|
+
/** Baseline keys whose case, or slide within it, the corpus no longer has. */
|
|
1388
|
+
export function orphanedBaselineKeys(
|
|
1389
|
+
keys: string[],
|
|
1390
|
+
slideCounts: Map<string, number>,
|
|
1391
|
+
): string[] {
|
|
1392
|
+
return keys.filter((key) => {
|
|
1393
|
+
const [caseId, slide] = key.split("/");
|
|
1394
|
+
const count = slideCounts.get(caseId);
|
|
1395
|
+
return count === undefined || Number(slide.slice(1)) > count;
|
|
1396
|
+
});
|
|
1397
|
+
}
|
|
1398
|
+
|
|
1399
|
+
function round3(n: number): number {
|
|
1400
|
+
return Math.round(n * 1000) / 1000;
|
|
1401
|
+
}
|