@a3s-lab/office 0.38.0 → 0.39.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/README.md +21 -7
- package/dist/0~7828.js +51 -29
- package/dist/0~presentation-editor.js +264 -118
- package/dist/0~work-pptx-import.js +1 -1
- package/dist/0~work-presentation-transition.js +38 -0
- package/dist/4121.js +42 -9
- package/dist/4560.js +124 -9
- package/dist/internal/features/work/editors/presentation-animation-panel.d.ts +9 -7
- package/dist/internal/features/work/editors/presentation-command-types.d.ts +10 -10
- package/dist/internal/features/work/editors/presentation-slide-canvas.d.ts +6 -4
- package/dist/internal/features/work/editors/use-presentation-animation-commands.d.ts +7 -7
- package/dist/internal/features/work/work-presentation-animation.d.ts +6 -2
- package/dist/internal/features/work/work-presentation-clipboard.d.ts +0 -5
- package/dist/internal/features/work/work-types.d.ts +7 -3
- package/dist/office-kernel.wasm +0 -0
- package/dist/styles.css +149 -26
- package/package.json +2 -1
- package/dist/0~5809.js +0 -123
package/dist/styles.css
CHANGED
|
@@ -20969,69 +20969,102 @@ sub [data-office-character-position-half-points], sup [data-office-character-pos
|
|
|
20969
20969
|
width: 64px;
|
|
20970
20970
|
}
|
|
20971
20971
|
|
|
20972
|
-
.work-presentation-player .work-slide-element[data-slide-animation-state="
|
|
20972
|
+
.work-presentation-player .work-slide-element[data-slide-animation-state="hidden"] {
|
|
20973
20973
|
visibility: hidden;
|
|
20974
20974
|
opacity: 0;
|
|
20975
20975
|
}
|
|
20976
20976
|
|
|
20977
|
-
.work-presentation-player .work-slide-element[data-slide-animation-state="
|
|
20978
|
-
|
|
20979
|
-
|
|
20980
|
-
|
|
20981
|
-
animation-fill-mode: both;
|
|
20977
|
+
.work-presentation-player .work-slide-element[data-slide-animation-state="visible"] {
|
|
20978
|
+
visibility: visible;
|
|
20979
|
+
translate: 0;
|
|
20980
|
+
scale: 1;
|
|
20982
20981
|
}
|
|
20983
20982
|
|
|
20984
|
-
.work-presentation-player .work-slide-element[data-slide-animation-state="
|
|
20983
|
+
.work-presentation-player .work-slide-element[data-slide-animation-state="playing"][data-slide-animation-initial-visibility="hidden"] {
|
|
20984
|
+
visibility: hidden;
|
|
20985
|
+
opacity: 0;
|
|
20986
|
+
}
|
|
20987
|
+
|
|
20988
|
+
.work-presentation-player .work-slide-element[data-slide-animation-state="playing"][data-slide-animation-initial-visibility="visible"] {
|
|
20985
20989
|
visibility: visible;
|
|
20986
|
-
opacity: var(--work-slide-element-opacity, 1);
|
|
20987
20990
|
translate: 0;
|
|
20988
20991
|
scale: 1;
|
|
20989
20992
|
}
|
|
20990
20993
|
|
|
20991
|
-
|
|
20992
|
-
|
|
20993
|
-
|
|
20994
|
-
|
|
20994
|
+
@keyframes work-slide-animation-appear {
|
|
20995
|
+
from {
|
|
20996
|
+
visibility: hidden;
|
|
20997
|
+
opacity: 0;
|
|
20998
|
+
}
|
|
20995
20999
|
|
|
20996
|
-
|
|
20997
|
-
|
|
21000
|
+
to {
|
|
21001
|
+
visibility: visible;
|
|
21002
|
+
opacity: var(--work-slide-element-opacity, 1);
|
|
21003
|
+
}
|
|
20998
21004
|
}
|
|
20999
21005
|
|
|
21000
|
-
|
|
21001
|
-
|
|
21006
|
+
@keyframes work-slide-animation-disappear {
|
|
21007
|
+
from {
|
|
21008
|
+
visibility: visible;
|
|
21009
|
+
opacity: var(--work-slide-element-opacity, 1);
|
|
21010
|
+
}
|
|
21011
|
+
|
|
21012
|
+
to {
|
|
21013
|
+
visibility: hidden;
|
|
21014
|
+
opacity: 0;
|
|
21015
|
+
}
|
|
21002
21016
|
}
|
|
21003
21017
|
|
|
21004
|
-
|
|
21005
|
-
|
|
21018
|
+
@keyframes work-slide-animation-fade {
|
|
21019
|
+
from {
|
|
21020
|
+
opacity: 0;
|
|
21021
|
+
}
|
|
21022
|
+
|
|
21023
|
+
to {
|
|
21024
|
+
opacity: var(--work-slide-element-opacity, 1);
|
|
21025
|
+
}
|
|
21006
21026
|
}
|
|
21007
21027
|
|
|
21008
|
-
@keyframes work-slide-animation-
|
|
21028
|
+
@keyframes work-slide-animation-fade-out {
|
|
21009
21029
|
from {
|
|
21030
|
+
visibility: visible;
|
|
21031
|
+
opacity: var(--work-slide-element-opacity, 1);
|
|
21032
|
+
}
|
|
21033
|
+
|
|
21034
|
+
to {
|
|
21010
21035
|
visibility: hidden;
|
|
21011
21036
|
opacity: 0;
|
|
21012
21037
|
}
|
|
21038
|
+
}
|
|
21039
|
+
|
|
21040
|
+
@keyframes work-slide-animation-fly-in-left {
|
|
21041
|
+
from {
|
|
21042
|
+
opacity: 0;
|
|
21043
|
+
translate: -18%;
|
|
21044
|
+
}
|
|
21013
21045
|
|
|
21014
21046
|
to {
|
|
21015
|
-
visibility: visible;
|
|
21016
21047
|
opacity: var(--work-slide-element-opacity, 1);
|
|
21048
|
+
translate: 0;
|
|
21017
21049
|
}
|
|
21018
21050
|
}
|
|
21019
21051
|
|
|
21020
|
-
@keyframes work-slide-animation-
|
|
21052
|
+
@keyframes work-slide-animation-fly-in-right {
|
|
21021
21053
|
from {
|
|
21022
21054
|
opacity: 0;
|
|
21055
|
+
translate: 18%;
|
|
21023
21056
|
}
|
|
21024
21057
|
|
|
21025
21058
|
to {
|
|
21026
21059
|
opacity: var(--work-slide-element-opacity, 1);
|
|
21060
|
+
translate: 0;
|
|
21027
21061
|
}
|
|
21028
21062
|
}
|
|
21029
21063
|
|
|
21030
|
-
@keyframes work-slide-animation-fly-in {
|
|
21064
|
+
@keyframes work-slide-animation-fly-in-up {
|
|
21031
21065
|
from {
|
|
21032
21066
|
opacity: 0;
|
|
21033
|
-
translate:
|
|
21034
|
-
var(--work-slide-animation-translate-y, 0);
|
|
21067
|
+
translate: 0 -18%;
|
|
21035
21068
|
}
|
|
21036
21069
|
|
|
21037
21070
|
to {
|
|
@@ -21040,6 +21073,74 @@ sub [data-office-character-position-half-points], sup [data-office-character-pos
|
|
|
21040
21073
|
}
|
|
21041
21074
|
}
|
|
21042
21075
|
|
|
21076
|
+
@keyframes work-slide-animation-fly-in-down {
|
|
21077
|
+
from {
|
|
21078
|
+
opacity: 0;
|
|
21079
|
+
translate: 0 18%;
|
|
21080
|
+
}
|
|
21081
|
+
|
|
21082
|
+
to {
|
|
21083
|
+
opacity: var(--work-slide-element-opacity, 1);
|
|
21084
|
+
translate: 0;
|
|
21085
|
+
}
|
|
21086
|
+
}
|
|
21087
|
+
|
|
21088
|
+
@keyframes work-slide-animation-fly-out-left {
|
|
21089
|
+
from {
|
|
21090
|
+
visibility: visible;
|
|
21091
|
+
opacity: var(--work-slide-element-opacity, 1);
|
|
21092
|
+
translate: 0;
|
|
21093
|
+
}
|
|
21094
|
+
|
|
21095
|
+
to {
|
|
21096
|
+
visibility: hidden;
|
|
21097
|
+
opacity: 0;
|
|
21098
|
+
translate: -18%;
|
|
21099
|
+
}
|
|
21100
|
+
}
|
|
21101
|
+
|
|
21102
|
+
@keyframes work-slide-animation-fly-out-right {
|
|
21103
|
+
from {
|
|
21104
|
+
visibility: visible;
|
|
21105
|
+
opacity: var(--work-slide-element-opacity, 1);
|
|
21106
|
+
translate: 0;
|
|
21107
|
+
}
|
|
21108
|
+
|
|
21109
|
+
to {
|
|
21110
|
+
visibility: hidden;
|
|
21111
|
+
opacity: 0;
|
|
21112
|
+
translate: 18%;
|
|
21113
|
+
}
|
|
21114
|
+
}
|
|
21115
|
+
|
|
21116
|
+
@keyframes work-slide-animation-fly-out-up {
|
|
21117
|
+
from {
|
|
21118
|
+
visibility: visible;
|
|
21119
|
+
opacity: var(--work-slide-element-opacity, 1);
|
|
21120
|
+
translate: 0;
|
|
21121
|
+
}
|
|
21122
|
+
|
|
21123
|
+
to {
|
|
21124
|
+
visibility: hidden;
|
|
21125
|
+
opacity: 0;
|
|
21126
|
+
translate: 0 -18%;
|
|
21127
|
+
}
|
|
21128
|
+
}
|
|
21129
|
+
|
|
21130
|
+
@keyframes work-slide-animation-fly-out-down {
|
|
21131
|
+
from {
|
|
21132
|
+
visibility: visible;
|
|
21133
|
+
opacity: var(--work-slide-element-opacity, 1);
|
|
21134
|
+
translate: 0;
|
|
21135
|
+
}
|
|
21136
|
+
|
|
21137
|
+
to {
|
|
21138
|
+
visibility: hidden;
|
|
21139
|
+
opacity: 0;
|
|
21140
|
+
translate: 0 18%;
|
|
21141
|
+
}
|
|
21142
|
+
}
|
|
21143
|
+
|
|
21043
21144
|
@keyframes work-slide-animation-zoom {
|
|
21044
21145
|
from {
|
|
21045
21146
|
opacity: 0;
|
|
@@ -21052,14 +21153,36 @@ sub [data-office-character-position-half-points], sup [data-office-character-pos
|
|
|
21052
21153
|
}
|
|
21053
21154
|
}
|
|
21054
21155
|
|
|
21055
|
-
@
|
|
21056
|
-
|
|
21156
|
+
@keyframes work-slide-animation-zoom-out {
|
|
21157
|
+
from {
|
|
21057
21158
|
visibility: visible;
|
|
21058
21159
|
opacity: var(--work-slide-element-opacity, 1);
|
|
21160
|
+
scale: 1;
|
|
21161
|
+
}
|
|
21162
|
+
|
|
21163
|
+
to {
|
|
21164
|
+
visibility: hidden;
|
|
21165
|
+
opacity: 0;
|
|
21166
|
+
scale: .72;
|
|
21167
|
+
}
|
|
21168
|
+
}
|
|
21169
|
+
|
|
21170
|
+
@media (prefers-reduced-motion: reduce) {
|
|
21171
|
+
.work-presentation-player .work-slide-element[data-slide-animation-state="playing"] {
|
|
21059
21172
|
animation: none;
|
|
21060
21173
|
translate: 0;
|
|
21061
21174
|
scale: 1;
|
|
21062
21175
|
}
|
|
21176
|
+
|
|
21177
|
+
.work-presentation-player .work-slide-element[data-slide-animation-state="playing"][data-slide-animation-final-visibility="hidden"] {
|
|
21178
|
+
visibility: hidden;
|
|
21179
|
+
opacity: 0;
|
|
21180
|
+
}
|
|
21181
|
+
|
|
21182
|
+
.work-presentation-player .work-slide-element[data-slide-animation-state="playing"][data-slide-animation-final-visibility="visible"] {
|
|
21183
|
+
visibility: visible;
|
|
21184
|
+
opacity: var(--work-slide-element-opacity, 1);
|
|
21185
|
+
}
|
|
21063
21186
|
}
|
|
21064
21187
|
|
|
21065
21188
|
.work-presentation-comments-panel {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@a3s-lab/office",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.39.0",
|
|
4
4
|
"description": "Open-source collaborative browser editors for documents, Markdown, spreadsheets, presentations, and PDFs.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"office",
|
|
@@ -88,6 +88,7 @@
|
|
|
88
88
|
"playground:typecheck": "tsc --noEmit -p playground/tsconfig.json",
|
|
89
89
|
"playground:ime:webkit": "playwright test --config playwright.ime.config.ts",
|
|
90
90
|
"playground:visual": "playwright test --config playwright.config.ts",
|
|
91
|
+
"playground:visual:docs-changelog": "playwright test visual-tests/docs-changelog.functional.spec.ts --config playwright.config.ts",
|
|
91
92
|
"playground:visual:document-emphasis": "playwright test visual-tests/document-emphasis.functional.spec.ts --config playwright.config.ts",
|
|
92
93
|
"playground:visual:document-index": "playwright test visual-tests/document-index.functional.spec.ts --config playwright.config.ts",
|
|
93
94
|
"playground:visual:document-comparison": "playwright test visual-tests/document-comparison.functional.spec.ts --config playwright.config.ts",
|
package/dist/0~5809.js
DELETED
|
@@ -1,123 +0,0 @@
|
|
|
1
|
-
import { createOfficeId as createWorkId } from "./4121.js";
|
|
2
|
-
function createWorkSlideAnimation(elementId, effect, previous) {
|
|
3
|
-
return normalizeWorkSlideAnimation({
|
|
4
|
-
id: previous?.id ?? createWorkId('slide-animation'),
|
|
5
|
-
elementId,
|
|
6
|
-
effect,
|
|
7
|
-
trigger: previous?.trigger ?? 'on-click',
|
|
8
|
-
durationMs: previous?.durationMs ?? 500,
|
|
9
|
-
delayMs: previous?.delayMs ?? 0,
|
|
10
|
-
direction: 'fly-in' === effect ? previous?.direction ?? 'left' : void 0
|
|
11
|
-
});
|
|
12
|
-
}
|
|
13
|
-
function normalizeWorkSlideAnimation(animation) {
|
|
14
|
-
return {
|
|
15
|
-
...animation,
|
|
16
|
-
durationMs: boundedInteger(animation.durationMs, 100, 60000),
|
|
17
|
-
delayMs: boundedInteger(animation.delayMs, 0, 60000),
|
|
18
|
-
direction: 'fly-in' === animation.effect ? normalizeWorkSlideAnimationDirection(animation.direction) : void 0
|
|
19
|
-
};
|
|
20
|
-
}
|
|
21
|
-
function workSlideAnimationForElement(slide, elementId) {
|
|
22
|
-
if (!elementId) return;
|
|
23
|
-
return slide.animations?.find((animation)=>animation.elementId === elementId);
|
|
24
|
-
}
|
|
25
|
-
function workSlideAnimationIndex(slide, animationId) {
|
|
26
|
-
if (!animationId) return -1;
|
|
27
|
-
return slide.animations?.findIndex((animation)=>animation.id === animationId) ?? -1;
|
|
28
|
-
}
|
|
29
|
-
function workSlideAnimationCues(animations) {
|
|
30
|
-
const cues = [];
|
|
31
|
-
let current;
|
|
32
|
-
for (const raw of animations ?? []){
|
|
33
|
-
const animation = normalizeWorkSlideAnimation(raw);
|
|
34
|
-
if (!current || 'on-click' === animation.trigger) {
|
|
35
|
-
current = {
|
|
36
|
-
automatic: 'on-click' !== animation.trigger,
|
|
37
|
-
items: [],
|
|
38
|
-
totalDurationMs: 0
|
|
39
|
-
};
|
|
40
|
-
cues.push(current);
|
|
41
|
-
}
|
|
42
|
-
const previous = current.items.at(-1);
|
|
43
|
-
const baseStart = 'after-previous' === animation.trigger ? previous?.endOffsetMs ?? 0 : 'with-previous' === animation.trigger ? previous?.startOffsetMs ?? 0 : 0;
|
|
44
|
-
const startOffsetMs = baseStart + animation.delayMs;
|
|
45
|
-
const endOffsetMs = startOffsetMs + animation.durationMs;
|
|
46
|
-
current.items.push({
|
|
47
|
-
animation,
|
|
48
|
-
startOffsetMs,
|
|
49
|
-
endOffsetMs
|
|
50
|
-
});
|
|
51
|
-
current.totalDurationMs = Math.max(current.totalDurationMs, endOffsetMs);
|
|
52
|
-
}
|
|
53
|
-
return cues;
|
|
54
|
-
}
|
|
55
|
-
function initialWorkSlideAnimationCueIndex(cues) {
|
|
56
|
-
return cues[0]?.automatic ? 0 : -1;
|
|
57
|
-
}
|
|
58
|
-
function removeWorkSlideAnimationsForElements(slide, elementIds) {
|
|
59
|
-
const animations = slide.animations?.filter((animation)=>!elementIds.has(animation.elementId));
|
|
60
|
-
if (animations?.length === slide.animations?.length) return slide;
|
|
61
|
-
return {
|
|
62
|
-
...slide,
|
|
63
|
-
animations: animations?.length ? animations : void 0
|
|
64
|
-
};
|
|
65
|
-
}
|
|
66
|
-
function remapWorkSlideAnimations(animations, elementIds) {
|
|
67
|
-
const remapped = (animations ?? []).flatMap((animation)=>{
|
|
68
|
-
const elementId = elementIds.get(animation.elementId);
|
|
69
|
-
return elementId ? [
|
|
70
|
-
{
|
|
71
|
-
...animation,
|
|
72
|
-
id: createWorkId('slide-animation'),
|
|
73
|
-
elementId
|
|
74
|
-
}
|
|
75
|
-
] : [];
|
|
76
|
-
});
|
|
77
|
-
return remapped.length ? remapped : void 0;
|
|
78
|
-
}
|
|
79
|
-
function normalizeWorkSlideAnimationDirection(direction) {
|
|
80
|
-
return 'right' === direction || 'up' === direction || 'down' === direction ? direction : 'left';
|
|
81
|
-
}
|
|
82
|
-
function boundedInteger(value, minimum, maximum) {
|
|
83
|
-
const finite = Number.isFinite(value) ? Math.round(value) : minimum;
|
|
84
|
-
return Math.min(maximum, Math.max(minimum, finite));
|
|
85
|
-
}
|
|
86
|
-
const CARDINAL_DIRECTIONS = new Set([
|
|
87
|
-
'left',
|
|
88
|
-
'right',
|
|
89
|
-
'up',
|
|
90
|
-
'down'
|
|
91
|
-
]);
|
|
92
|
-
const SPLIT_DIRECTIONS = new Set([
|
|
93
|
-
'in',
|
|
94
|
-
'out'
|
|
95
|
-
]);
|
|
96
|
-
function createWorkSlideTransition(type, previous) {
|
|
97
|
-
const common = {
|
|
98
|
-
type,
|
|
99
|
-
speed: previous?.speed ?? 'medium',
|
|
100
|
-
advanceOnClick: previous?.advanceOnClick ?? true,
|
|
101
|
-
advanceAfterMs: previous?.advanceAfterMs
|
|
102
|
-
};
|
|
103
|
-
if ('push' === type || 'wipe' === type) return {
|
|
104
|
-
...common,
|
|
105
|
-
direction: previous?.direction && CARDINAL_DIRECTIONS.has(previous.direction) ? previous.direction : 'left'
|
|
106
|
-
};
|
|
107
|
-
if ('split' === type) return {
|
|
108
|
-
...common,
|
|
109
|
-
direction: previous?.direction && SPLIT_DIRECTIONS.has(previous.direction) ? previous.direction : 'out',
|
|
110
|
-
orientation: previous?.orientation ?? 'horizontal'
|
|
111
|
-
};
|
|
112
|
-
return common;
|
|
113
|
-
}
|
|
114
|
-
function slideTransitionDurationMilliseconds(transition) {
|
|
115
|
-
if (transition?.speed === 'fast') return 500;
|
|
116
|
-
if (transition?.speed === 'slow') return 2000;
|
|
117
|
-
return 1000;
|
|
118
|
-
}
|
|
119
|
-
function workSlideTransitionsEqual(left, right) {
|
|
120
|
-
if (!left || !right) return left === right;
|
|
121
|
-
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;
|
|
122
|
-
}
|
|
123
|
-
export { createWorkSlideAnimation, createWorkSlideTransition, initialWorkSlideAnimationCueIndex, normalizeWorkSlideAnimation, remapWorkSlideAnimations, removeWorkSlideAnimationsForElements, slideTransitionDurationMilliseconds, workSlideAnimationCues, workSlideAnimationForElement, workSlideAnimationIndex, workSlideTransitionsEqual };
|