@a3s-lab/office 0.33.0 → 0.35.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.
Files changed (30) hide show
  1. package/README.md +23 -19
  2. package/dist/0~5809.js +123 -0
  3. package/dist/{0~7614.js → 0~7828.js} +376 -5
  4. package/dist/0~pdf-viewer.js +5 -1
  5. package/dist/0~presentation-editor.js +597 -71
  6. package/dist/0~spreadsheet-editor.js +166 -18
  7. package/dist/0~work-pptx-export.js +50 -14
  8. package/dist/0~work-pptx-import.js +21 -9
  9. package/dist/4121.js +122 -1
  10. package/dist/4560.js +33 -0
  11. package/dist/internal/features/work/editors/presentation-animation-panel.d.ts +11 -0
  12. package/dist/internal/features/work/editors/presentation-command-types.d.ts +16 -1
  13. package/dist/internal/features/work/editors/presentation-editor-focus.d.ts +2 -0
  14. package/dist/internal/features/work/editors/presentation-presenter-view.d.ts +2 -1
  15. package/dist/internal/features/work/editors/presentation-slide-canvas.d.ts +11 -3
  16. package/dist/internal/features/work/editors/presentation-text-editor.d.ts +7 -0
  17. package/dist/internal/features/work/editors/spreadsheet-command-controller.d.ts +10 -0
  18. package/dist/internal/features/work/editors/spreadsheet-command-selection.d.ts +22 -1
  19. package/dist/internal/features/work/editors/use-presentation-animation-commands.d.ts +15 -0
  20. package/dist/internal/features/work/editors/use-presentation-selection.d.ts +1 -1
  21. package/dist/internal/features/work/work-pptx-animation.d.ts +13 -0
  22. package/dist/internal/features/work/work-pptx-groups.d.ts +4 -0
  23. package/dist/internal/features/work/work-presentation-animation-constraints.d.ts +4 -0
  24. package/dist/internal/features/work/work-presentation-animation.d.ts +20 -0
  25. package/dist/internal/features/work/work-presentation-clipboard.d.ts +10 -3
  26. package/dist/internal/features/work/work-types.d.ts +17 -0
  27. package/dist/office-kernel.wasm +0 -0
  28. package/dist/styles.css +123 -0
  29. package/package.json +19 -13
  30. package/dist/0~work-presentation-transition.js +0 -38
package/dist/styles.css CHANGED
@@ -20175,6 +20175,129 @@ sub [data-office-character-position-half-points], sup [data-office-character-pos
20175
20175
  }
20176
20176
  }
20177
20177
 
20178
+ .work-presentation-animation-options, .work-presentation-animation-timing {
20179
+ border: 0;
20180
+ align-items: center;
20181
+ gap: 6px;
20182
+ min-width: 0;
20183
+ margin: 0;
20184
+ padding: 0;
20185
+ display: flex;
20186
+ }
20187
+
20188
+ .work-presentation-animation-options .work-office-field, .work-presentation-animation-timing .work-office-field {
20189
+ flex: none;
20190
+ }
20191
+
20192
+ .work-presentation-animation-options .work-office-field.effect {
20193
+ width: 88px;
20194
+ }
20195
+
20196
+ .work-presentation-animation-options .work-office-field.trigger {
20197
+ width: 120px;
20198
+ }
20199
+
20200
+ .work-presentation-animation-options .work-office-field.direction {
20201
+ width: 82px;
20202
+ }
20203
+
20204
+ .work-presentation-animation-timing .work-office-field.seconds {
20205
+ width: 64px;
20206
+ }
20207
+
20208
+ .work-presentation-player .work-slide-element[data-slide-animation-state="pending"] {
20209
+ visibility: hidden;
20210
+ opacity: 0;
20211
+ }
20212
+
20213
+ .work-presentation-player .work-slide-element[data-slide-animation-state="playing"] {
20214
+ animation-delay: var(--work-slide-animation-delay, 0s);
20215
+ animation-duration: var(--work-slide-animation-duration, .5s);
20216
+ animation-timing-function: cubic-bezier(.16, 1, .3, 1);
20217
+ animation-fill-mode: both;
20218
+ }
20219
+
20220
+ .work-presentation-player .work-slide-element[data-slide-animation-state="finished"] {
20221
+ visibility: visible;
20222
+ opacity: var(--work-slide-element-opacity, 1);
20223
+ translate: 0;
20224
+ scale: 1;
20225
+ }
20226
+
20227
+ .work-presentation-player .work-slide-element[data-slide-animation-effect="appear"][data-slide-animation-state="playing"] {
20228
+ animation-name: work-slide-animation-appear;
20229
+ animation-timing-function: step-start;
20230
+ }
20231
+
20232
+ .work-presentation-player .work-slide-element[data-slide-animation-effect="fade"][data-slide-animation-state="playing"] {
20233
+ animation-name: work-slide-animation-fade;
20234
+ }
20235
+
20236
+ .work-presentation-player .work-slide-element[data-slide-animation-effect="fly-in"][data-slide-animation-state="playing"] {
20237
+ animation-name: work-slide-animation-fly-in;
20238
+ }
20239
+
20240
+ .work-presentation-player .work-slide-element[data-slide-animation-effect="zoom"][data-slide-animation-state="playing"] {
20241
+ animation-name: work-slide-animation-zoom;
20242
+ }
20243
+
20244
+ @keyframes work-slide-animation-appear {
20245
+ from {
20246
+ visibility: hidden;
20247
+ opacity: 0;
20248
+ }
20249
+
20250
+ to {
20251
+ visibility: visible;
20252
+ opacity: var(--work-slide-element-opacity, 1);
20253
+ }
20254
+ }
20255
+
20256
+ @keyframes work-slide-animation-fade {
20257
+ from {
20258
+ opacity: 0;
20259
+ }
20260
+
20261
+ to {
20262
+ opacity: var(--work-slide-element-opacity, 1);
20263
+ }
20264
+ }
20265
+
20266
+ @keyframes work-slide-animation-fly-in {
20267
+ from {
20268
+ opacity: 0;
20269
+ translate: var(--work-slide-animation-translate-x, -18%)
20270
+ var(--work-slide-animation-translate-y, 0);
20271
+ }
20272
+
20273
+ to {
20274
+ opacity: var(--work-slide-element-opacity, 1);
20275
+ translate: 0;
20276
+ }
20277
+ }
20278
+
20279
+ @keyframes work-slide-animation-zoom {
20280
+ from {
20281
+ opacity: 0;
20282
+ scale: .72;
20283
+ }
20284
+
20285
+ to {
20286
+ opacity: var(--work-slide-element-opacity, 1);
20287
+ scale: 1;
20288
+ }
20289
+ }
20290
+
20291
+ @media (prefers-reduced-motion: reduce) {
20292
+ .work-presentation-player .work-slide-element[data-slide-animation-state="playing"] {
20293
+ visibility: visible;
20294
+ opacity: var(--work-slide-element-opacity, 1);
20295
+ animation: none;
20296
+ translate: 0;
20297
+ scale: 1;
20298
+ }
20299
+ }
20300
+
20178
20301
  .work-presentation-comments-panel {
20179
20302
  border-bottom: 1px solid var(--a3s-line);
20180
20303
  background: var(--a3s-panel);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@a3s-lab/office",
3
- "version": "0.33.0",
3
+ "version": "0.35.0",
4
4
  "description": "Open-source collaborative browser editors for documents, Markdown, spreadsheets, presentations, and PDFs.",
5
5
  "keywords": [
6
6
  "office",
@@ -72,8 +72,8 @@
72
72
  "build": "bun run kernel:build && rslib",
73
73
  "collaboration-server:typecheck": "tsc --noEmit -p examples/collaboration-server/tsconfig.json",
74
74
  "dev": "bun run kernel:build && rslib --watch",
75
- "docs:build": "rspress build -c website/rspress.config.ts && bun scripts/rewrite-docs-base.ts",
76
- "docs:dev": "rspress -c website/rspress.config.ts",
75
+ "docs:build": "bun scripts/build-docs.ts",
76
+ "docs:dev": "rspress -c website/rspress.docs.config.ts",
77
77
  "format": "biome format --write .",
78
78
  "format:check": "biome format .",
79
79
  "lint": "biome lint .",
@@ -82,9 +82,9 @@
82
82
  "kernel:test": "bun run kernel:build && bun scripts/smoke-office-kernel.ts",
83
83
  "playground": "bun run playground:assets && rsbuild dev --config playground/rsbuild.config.ts",
84
84
  "playground:assets": "bun run build && bash scripts/package-office-skill.sh",
85
- "playground:build": "bun run playground:assets && rsbuild build --config playground/rsbuild.config.ts && bun run docs:build",
85
+ "playground:build": "bun run playground:assets && bun run docs:build && rsbuild build --config playground/rsbuild.config.ts",
86
86
  "playground:bundle-check": "bun scripts/check-playground-bundle.ts",
87
- "playground:preview": "rsbuild preview --config playground/rsbuild.config.ts --host 127.0.0.1 --port 4175 --strict-port",
87
+ "playground:preview": "rspress preview -c website/rspress.config.ts --host 127.0.0.1 --port 4175",
88
88
  "playground:typecheck": "tsc --noEmit -p playground/tsconfig.json",
89
89
  "playground:visual": "playwright test --config playwright.config.ts",
90
90
  "playground:visual:document-emphasis": "playwright test visual-tests/document-emphasis.functional.spec.ts --config playwright.config.ts",
@@ -114,15 +114,16 @@
114
114
  "playground:visual:spreadsheet-rich-text": "playwright test visual-tests/spreadsheet-rich-text.functional.spec.ts --config playwright.config.ts",
115
115
  "playground:visual:spreadsheet-underline": "playwright test visual-tests/spreadsheet-underline.functional.spec.ts --config playwright.config.ts",
116
116
  "playground:visual:spreadsheet-table": "playwright test visual-tests/spreadsheet-table.functional.spec.ts --config playwright.config.ts",
117
+ "playground:visual:presentation-animation": "playwright test visual-tests/presentation-animation.functional.spec.ts --config playwright.config.ts",
117
118
  "playground:visual:pdf-page-organization": "playwright test visual-tests/pdf-page-organization.functional.spec.ts --config playwright.config.ts",
118
119
  "playground:visual:update": "playwright test --config playwright.config.ts --update-snapshots",
119
120
  "performance:fixtures": "bun .a3s-test/performance/generate-fixtures.ts",
120
- "performance:large-document-edits": "bun .a3s-test/performance/generate-fixtures.ts --documents-only && bun .a3s-test/performance/benchmark-document-edit.ts http://127.0.0.1:4175/ 3",
121
- "performance:large-documents": "bun .a3s-test/performance/generate-fixtures.ts --documents-only && bun .a3s-test/performance/benchmark.ts --url http://127.0.0.1:4175/ --scenarios document-text,document-table --runs 3 --timeout-ms 180000",
122
- "performance:large-spreadsheet-edits": "bun .a3s-test/performance/generate-fixtures.ts --spreadsheets-only && bun .a3s-test/performance/benchmark-spreadsheet-edit.ts http://127.0.0.1:4175/ 3",
123
- "performance:large-spreadsheets": "bun .a3s-test/performance/generate-fixtures.ts --spreadsheets-only && bun .a3s-test/performance/benchmark.ts --url http://127.0.0.1:4175/ --scenarios spreadsheet --runs 5 --timeout-ms 180000",
124
- "performance:pdf": "bun .a3s-test/performance/generate-fixtures.ts --pdf-only && bun .a3s-test/performance/benchmark-pdf.ts --url http://127.0.0.1:4175/ --runs 3 --timeout-ms 120000",
125
- "performance:presentation": "bun .a3s-test/performance/generate-fixtures.ts --presentations-only && bun .a3s-test/performance/benchmark-presentation.ts --url http://127.0.0.1:4175/ --runs 3 --timeout-ms 120000 --modes default,content-visibility",
121
+ "performance:large-document-edits": "bun .a3s-test/performance/generate-fixtures.ts --documents-only && bun .a3s-test/performance/benchmark-document-edit.ts http://127.0.0.1:4175/playground/ 3",
122
+ "performance:large-documents": "bun .a3s-test/performance/generate-fixtures.ts --documents-only && bun .a3s-test/performance/benchmark.ts --url http://127.0.0.1:4175/playground/ --scenarios document-text,document-table --runs 3 --timeout-ms 180000",
123
+ "performance:large-spreadsheet-edits": "bun .a3s-test/performance/generate-fixtures.ts --spreadsheets-only && bun .a3s-test/performance/benchmark-spreadsheet-edit.ts http://127.0.0.1:4175/playground/ 3",
124
+ "performance:large-spreadsheets": "bun .a3s-test/performance/generate-fixtures.ts --spreadsheets-only && bun .a3s-test/performance/benchmark.ts --url http://127.0.0.1:4175/playground/ --scenarios spreadsheet --runs 5 --timeout-ms 180000",
125
+ "performance:pdf": "bun .a3s-test/performance/generate-fixtures.ts --pdf-only && bun .a3s-test/performance/benchmark-pdf.ts --url http://127.0.0.1:4175/playground/ --runs 3 --timeout-ms 120000",
126
+ "performance:presentation": "bun .a3s-test/performance/generate-fixtures.ts --presentations-only && bun .a3s-test/performance/benchmark-presentation.ts --url http://127.0.0.1:4175/playground/ --runs 3 --timeout-ms 120000 --modes default,content-visibility",
126
127
  "test": "rstest",
127
128
  "test:e2e": "bun run test:e2e:fixtures && a3s-test run tests/e2e/word-page-color.acl --json && a3s-test run tests/e2e/word-page-setup-phone.acl --json && a3s-test run tests/e2e/word-paragraph-layout-phone.acl --json && a3s-test run tests/e2e/word-list-formatting-phone.acl --json && a3s-test run tests/e2e/word-font-picker-phone.acl --json && a3s-test run tests/e2e/word-comments-drawer.acl --json && a3s-test run tests/e2e/word-comment-windowing.acl --json && a3s-test run tests/e2e/word-citations-phone.acl --json && a3s-test run tests/e2e/word-navigation-search.acl --json && a3s-test run tests/e2e/word-navigation-windowing.acl --json && a3s-test run tests/e2e/word-find-replace-phone.acl --json && a3s-test run tests/e2e/word-page-navigation.acl --json && a3s-test run tests/e2e/word-page-windowing.acl --json && a3s-test run tests/e2e/word-ai-question.acl --json && a3s-test run tests/e2e/word-picture-insert.acl --json && a3s-test run tests/e2e/word-picture-alt-text-phone.acl --json && a3s-test run tests/e2e/word-track-changes-phone.acl --json && a3s-test run tests/e2e/word-formatting-revision.acl --json && a3s-test run tests/e2e/word-paragraph-formatting-revision.acl --json && a3s-test run tests/e2e/word-document-comparison.acl --json && a3s-test run tests/e2e/word-review-conflict-phone.acl --json && a3s-test run tests/e2e/word-revision-windowing.acl --json && a3s-test run tests/e2e/word-table-phone.acl --json && a3s-test run tests/e2e/word-table-borders.acl --json && a3s-test run tests/e2e/word-theme-table.acl --json && a3s-test run tests/e2e/word-styled-table.acl --json && a3s-test run tests/e2e/word-multi-page-table.acl --json && a3s-test run tests/e2e/word-cross-reference-phone.acl --json && a3s-test run tests/e2e/word-bookmark-links-phone.acl --json && a3s-test run tests/e2e/word-notes-phone.acl --json && a3s-test run tests/e2e/word-fields-phone.acl --json && a3s-test run tests/e2e/spreadsheet-phone-rename.acl --json && a3s-test run tests/e2e/spreadsheet-phone-find.acl --json && a3s-test run tests/e2e/spreadsheet-phone-context-menu.acl --json && a3s-test run tests/e2e/spreadsheet-phone-task-pane.acl --json && a3s-test run tests/e2e/spreadsheet-maximum-sparse.acl --json && a3s-test run tests/e2e/spreadsheet-cell-style.acl --json && a3s-test run tests/e2e/spreadsheet-paste-special.acl --json && a3s-test run tests/e2e/spreadsheet-hyperlink.acl --json && a3s-test run tests/e2e/presentation-cut-paste-focus.acl --json && a3s-test run tests/e2e/presentation-presenter-view.acl --json && a3s-test run tests/e2e/presentation-phone-chart-pane.acl --json && a3s-test run tests/e2e/presentation-phone-comments.acl --json && a3s-test run tests/e2e/pdf-thumbnail-keyboard.acl --json && a3s-test run tests/e2e/pdf-page-drawer-phone.acl --json && a3s-test run tests/e2e/markdown-phone-modes.acl --json && a3s-test run tests/e2e/office-sidebar-breakpoint.acl --json && a3s-test run tests/e2e/office-docs-navigation.acl --json && a3s-test run tests/e2e/collaboration-playground-entry.acl --json && a3s-test run tests/e2e/collaboration-document-comments.acl --command-timeout-ms 120000 --json && a3s-test run tests/e2e/collaboration-document-suggestions.acl --command-timeout-ms 120000 --json && a3s-test run tests/e2e/collaboration-participants.acl --json && a3s-test run tests/e2e/collaboration-pdf-annotations.acl --json && a3s-test run tests/e2e/collaboration-spreadsheet-cells.acl --json && a3s-test run tests/e2e/collaboration-presentation-elements.acl --json",
128
129
  "test:e2e:check": "bun run test:e2e:fixtures && a3s-test check tests/e2e/word-page-color.acl --json && a3s-test check tests/e2e/word-page-setup-phone.acl --json && a3s-test check tests/e2e/word-paragraph-layout-phone.acl --json && a3s-test check tests/e2e/word-list-formatting-phone.acl --json && a3s-test check tests/e2e/word-font-picker-phone.acl --json && a3s-test check tests/e2e/word-comments-drawer.acl --json && a3s-test check tests/e2e/word-comment-windowing.acl --json && a3s-test check tests/e2e/word-citations-phone.acl --json && a3s-test check tests/e2e/word-navigation-search.acl --json && a3s-test check tests/e2e/word-navigation-windowing.acl --json && a3s-test check tests/e2e/word-find-replace-phone.acl --json && a3s-test check tests/e2e/word-page-navigation.acl --json && a3s-test check tests/e2e/word-page-windowing.acl --json && a3s-test check tests/e2e/word-ai-question.acl --json && a3s-test check tests/e2e/word-picture-insert.acl --json && a3s-test check tests/e2e/word-picture-alt-text-phone.acl --json && a3s-test check tests/e2e/word-track-changes-phone.acl --json && a3s-test check tests/e2e/word-formatting-revision.acl --json && a3s-test check tests/e2e/word-paragraph-formatting-revision.acl --json && a3s-test check tests/e2e/word-document-comparison.acl --json && a3s-test check tests/e2e/word-review-conflict-phone.acl --json && a3s-test check tests/e2e/word-revision-windowing.acl --json && a3s-test check tests/e2e/word-table-phone.acl --json && a3s-test check tests/e2e/word-table-borders.acl --json && a3s-test check tests/e2e/word-theme-table.acl --json && a3s-test check tests/e2e/word-styled-table.acl --json && a3s-test check tests/e2e/word-multi-page-table.acl --json && a3s-test check tests/e2e/word-cross-reference-phone.acl --json && a3s-test check tests/e2e/word-bookmark-links-phone.acl --json && a3s-test check tests/e2e/word-notes-phone.acl --json && a3s-test check tests/e2e/word-fields-phone.acl --json && a3s-test check tests/e2e/spreadsheet-phone-rename.acl --json && a3s-test check tests/e2e/spreadsheet-phone-find.acl --json && a3s-test check tests/e2e/spreadsheet-phone-context-menu.acl --json && a3s-test check tests/e2e/spreadsheet-phone-task-pane.acl --json && a3s-test check tests/e2e/spreadsheet-maximum-sparse.acl --json && a3s-test check tests/e2e/spreadsheet-cell-style.acl --json && a3s-test check tests/e2e/spreadsheet-paste-special.acl --json && a3s-test check tests/e2e/spreadsheet-hyperlink.acl --json && a3s-test check tests/e2e/presentation-cut-paste-focus.acl --json && a3s-test check tests/e2e/presentation-presenter-view.acl --json && a3s-test check tests/e2e/presentation-phone-chart-pane.acl --json && a3s-test check tests/e2e/presentation-phone-comments.acl --json && a3s-test check tests/e2e/pdf-thumbnail-keyboard.acl --json && a3s-test check tests/e2e/pdf-page-drawer-phone.acl --json && a3s-test check tests/e2e/markdown-phone-modes.acl --json && a3s-test check tests/e2e/office-sidebar-breakpoint.acl --json && a3s-test check tests/e2e/office-docs-navigation.acl --json && a3s-test check tests/e2e/collaboration-playground-entry.acl --json && a3s-test check tests/e2e/collaboration-document-comments.acl --json && a3s-test check tests/e2e/collaboration-document-suggestions.acl --json && a3s-test check tests/e2e/collaboration-participants.acl --json && a3s-test check tests/e2e/collaboration-pdf-annotations.acl --json && a3s-test check tests/e2e/collaboration-spreadsheet-cells.acl --json && a3s-test check tests/e2e/collaboration-presentation-elements.acl --json",
@@ -133,12 +134,16 @@
133
134
  "test:e2e:large-pdf:check": "a3s-test check tests/e2e/pdf-large-windowing.acl --json",
134
135
  "test:e2e:pdf-page-organization": "bun run test:e2e:fixtures && A3S_TEST_SUITE=tests/e2e/pdf-page-organization.acl bash scripts/run-a3s-test-web-gate.sh",
135
136
  "test:e2e:pdf-page-organization:check": "a3s-test check tests/e2e/pdf-page-organization.acl --json",
137
+ "test:e2e:presentation-animation": "A3S_TEST_SUITE=tests/e2e/presentation-animation.acl bash scripts/run-a3s-test-web-gate.sh",
138
+ "test:e2e:presentation-animation:check": "a3s-test check tests/e2e/presentation-animation.acl --json",
136
139
  "test:e2e:large-presentation": "bun .a3s-test/performance/generate-fixtures.ts --presentations-only && a3s-test run tests/e2e/presentation-large-windowing.acl --json",
137
140
  "test:e2e:large-presentation:check": "a3s-test check tests/e2e/presentation-large-windowing.acl --json",
138
141
  "test:e2e:initial-focus": "a3s-test run tests/e2e/office-editor-initial-focus.acl --json",
139
142
  "test:e2e:initial-focus:check": "a3s-test check tests/e2e/office-editor-initial-focus.acl --json",
140
143
  "test:e2e:docs": "a3s-test run tests/e2e/office-docs-navigation.acl --json",
141
144
  "test:e2e:docs:check": "a3s-test check tests/e2e/office-docs-navigation.acl --json",
145
+ "test:e2e:homepage": "A3S_TEST_SUITE=tests/e2e/homepage-editor-demo.acl bash scripts/run-a3s-test-web-gate.sh",
146
+ "test:e2e:homepage:check": "a3s-test check tests/e2e/homepage-editor-demo.acl --json",
142
147
  "test:e2e:latest-capabilities": "A3S_TEST_SUITE=tests/e2e/latest-capabilities-discoverability.acl bash scripts/run-a3s-test-web-gate.sh",
143
148
  "test:e2e:latest-capabilities:check": "a3s-test check tests/e2e/latest-capabilities-discoverability.acl --json",
144
149
  "test:e2e:collaboration-participants": "a3s-test run tests/e2e/collaboration-participants.acl --json",
@@ -304,15 +309,16 @@
304
309
  }
305
310
  },
306
311
  "devDependencies": {
312
+ "@a3s-lab/testkit": "0.6.2",
307
313
  "@biomejs/biome": "2.4.15",
308
314
  "@fontsource-variable/geist": "^5.3.0",
309
315
  "@fontsource-variable/geist-mono": "^5.3.0",
310
- "@rspress/core": "^2.0.17",
311
- "@rspress/shared": "2.0.19",
312
316
  "@playwright/test": "1.61.1",
313
317
  "@rsbuild/core": "^2.1.5",
314
318
  "@rsbuild/plugin-react": "^2.1.0",
315
319
  "@rslib/core": "^0.23.2",
320
+ "@rspress/core": "^2.0.17",
321
+ "@rspress/shared": "2.0.19",
316
322
  "@rstest/adapter-rslib": "^0.10.6",
317
323
  "@rstest/core": "^0.10.6",
318
324
  "@rstest/coverage-v8": "0.10.6",
@@ -1,38 +0,0 @@
1
- const CARDINAL_DIRECTIONS = new Set([
2
- 'left',
3
- 'right',
4
- 'up',
5
- 'down'
6
- ]);
7
- const SPLIT_DIRECTIONS = new Set([
8
- 'in',
9
- 'out'
10
- ]);
11
- function createWorkSlideTransition(type, previous) {
12
- const common = {
13
- type,
14
- speed: previous?.speed ?? 'medium',
15
- advanceOnClick: previous?.advanceOnClick ?? true,
16
- advanceAfterMs: previous?.advanceAfterMs
17
- };
18
- if ('push' === type || 'wipe' === type) return {
19
- ...common,
20
- direction: previous?.direction && CARDINAL_DIRECTIONS.has(previous.direction) ? previous.direction : 'left'
21
- };
22
- if ('split' === type) return {
23
- ...common,
24
- direction: previous?.direction && SPLIT_DIRECTIONS.has(previous.direction) ? previous.direction : 'out',
25
- orientation: previous?.orientation ?? 'horizontal'
26
- };
27
- return common;
28
- }
29
- function slideTransitionDurationMilliseconds(transition) {
30
- if (transition?.speed === 'fast') return 500;
31
- if (transition?.speed === 'slow') return 2000;
32
- return 1000;
33
- }
34
- function workSlideTransitionsEqual(left, right) {
35
- if (!left || !right) return left === right;
36
- return left.type === right.type && left.speed === right.speed && left.direction === right.direction && left.orientation === right.orientation && left.advanceOnClick === right.advanceOnClick && left.advanceAfterMs === right.advanceAfterMs;
37
- }
38
- export { createWorkSlideTransition, slideTransitionDurationMilliseconds, workSlideTransitionsEqual };