@mcpher/gas-fakes 1.2.26 → 1.2.28
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/package.json +1 -1
- package/src/cli/setup.js +35 -6
- package/src/cli/utils.js +8 -7
- package/src/index.js +1 -0
- package/src/services/advcalendar/clapis.js +14 -0
- package/src/services/advcalendar/fakeadvcalendarcalendarlist.js +30 -0
- package/src/services/advcalendar/fakeadvcalendarcalendars.js +25 -0
- package/src/services/advcalendar/fakeadvcalendarevents.js +51 -1
- package/src/services/calendarapp/app.js +11 -0
- package/src/services/calendarapp/fakecalendar.js +328 -0
- package/src/services/calendarapp/fakecalendarapp.js +147 -0
- package/src/services/calendarapp/fakecalendarevent.js +44 -0
- package/src/services/calendarapp/fakecalendareventseries.js +36 -0
- package/src/services/calendarapp/fakeeventrecurrence.js +19 -0
- package/src/services/enums/calendarenums.js +85 -0
- package/src/services/enums/slidesenums.js +1 -1
- package/src/services/formapp/fakechoiceitem.js +1 -1
- package/src/services/formapp/fakeform.js +4 -3
- package/src/services/formapp/fakeformitem.js +1 -2
- package/src/services/formapp/fakeformresponse.js +3 -2
- package/src/services/formapp/fakelistitem.js +3 -2
- package/src/services/scriptapp/behavior.js +56 -1
- package/src/services/slidesapp/fakeaffinetransform.js +55 -0
- package/src/services/slidesapp/fakeaffinetransformbuilder.js +64 -0
- package/src/services/slidesapp/fakeautofit.js +49 -0
- package/src/services/slidesapp/fakeautotext.js +29 -0
- package/src/services/slidesapp/fakeconnectionsite.js +24 -0
- package/src/services/slidesapp/fakelayout.js +38 -0
- package/src/services/slidesapp/fakeline.js +195 -0
- package/src/services/slidesapp/fakelinefill.js +58 -0
- package/src/services/slidesapp/fakelink.js +31 -0
- package/src/services/slidesapp/fakemaster.js +28 -0
- package/src/services/slidesapp/fakenotespage.js +19 -0
- package/src/services/slidesapp/fakepagebackground.js +17 -0
- package/src/services/slidesapp/fakepageelement.js +395 -0
- package/src/services/slidesapp/fakeparagraph.js +46 -0
- package/src/services/slidesapp/fakepoint.js +24 -0
- package/src/services/slidesapp/fakepresentation.js +61 -3
- package/src/services/slidesapp/fakeshape.js +49 -0
- package/src/services/slidesapp/fakeslide.js +232 -0
- package/src/services/slidesapp/fakeslidesapp.js +5 -0
- package/src/services/slidesapp/faketextrange.js +253 -0
- package/src/services/slidesapp/pageelementfactory.js +19 -0
- package/src/services/stores/gasflex.js +1 -1
- package/src/services/urlfetchapp/app.js +17 -1
- package/src/support/sxcalendar.js +61 -0
- package/src/support/sxfetch.js +39 -13
- package/src/support/sxforms.js +3 -1
- package/src/support/syncit.js +16 -2
- package/src/support/utils.js +2 -0
- package/src/support/workersync/sxfunctions.js +1 -0
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
import { Proxies } from '../../support/proxies.js';
|
|
2
|
+
import { AutofitType } from '../enums/slidesenums.js';
|
|
3
|
+
|
|
4
|
+
export const newFakeAutofit = (...args) => {
|
|
5
|
+
return Proxies.guard(new FakeAutofit(...args));
|
|
6
|
+
};
|
|
7
|
+
|
|
8
|
+
export class FakeAutofit {
|
|
9
|
+
constructor(shape) {
|
|
10
|
+
this.__shape = shape;
|
|
11
|
+
// Store autofit type on the shape resource or locally?
|
|
12
|
+
// Ideally on the resource so it persists if we reload the shape.
|
|
13
|
+
// But for now, let's look at the shape's property if meaningful or just a local property default.
|
|
14
|
+
// The resource might have 'text.autoFit'.
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
get __resource() {
|
|
18
|
+
// Ensure shape.text exists
|
|
19
|
+
if (!this.__shape.__resource.shape.text) {
|
|
20
|
+
this.__shape.__resource.shape.text = {};
|
|
21
|
+
}
|
|
22
|
+
return this.__shape.__resource.shape.text;
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
getAutofitType() {
|
|
26
|
+
const type = (this.__resource.autoFit && this.__resource.autoFit.autofitType) || 'NONE';
|
|
27
|
+
return AutofitType[type] || AutofitType.NONE;
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
disableAutofit() {
|
|
31
|
+
if (!this.__resource.autoFit) {
|
|
32
|
+
this.__resource.autoFit = {};
|
|
33
|
+
}
|
|
34
|
+
this.__resource.autoFit.autofitType = AutofitType.NONE.toString();
|
|
35
|
+
return this;
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
getFontScale() {
|
|
39
|
+
return (this.__resource.autoFit && this.__resource.autoFit.fontScale) !== undefined ? this.__resource.autoFit.fontScale : 1;
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
getLineSpacingReduction() {
|
|
43
|
+
return (this.__resource.autoFit && this.__resource.autoFit.lineSpacingReduction) !== undefined ? this.__resource.autoFit.lineSpacingReduction : 0;
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
toString() {
|
|
47
|
+
return 'Autofit';
|
|
48
|
+
}
|
|
49
|
+
}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { Proxies } from '../../support/proxies.js';
|
|
2
|
+
|
|
3
|
+
export const newFakeAutoText = (...args) => {
|
|
4
|
+
return Proxies.guard(new FakeAutoText(...args));
|
|
5
|
+
};
|
|
6
|
+
|
|
7
|
+
export class FakeAutoText {
|
|
8
|
+
constructor(range, type, index) {
|
|
9
|
+
this.__range = range;
|
|
10
|
+
this.__type = type;
|
|
11
|
+
this.__index = index;
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
getIndex() {
|
|
15
|
+
return this.__index;
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
getRange() {
|
|
19
|
+
return this.__range;
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
getAutoTextType() {
|
|
23
|
+
return this.__type;
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
toString() {
|
|
27
|
+
return 'AutoText';
|
|
28
|
+
}
|
|
29
|
+
}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { Proxies } from '../../support/proxies.js';
|
|
2
|
+
|
|
3
|
+
export const newFakeConnectionSite = (...args) => {
|
|
4
|
+
return Proxies.guard(new FakeConnectionSite(...args));
|
|
5
|
+
};
|
|
6
|
+
|
|
7
|
+
export class FakeConnectionSite {
|
|
8
|
+
constructor(pageElement, index) {
|
|
9
|
+
this.__pageElement = pageElement;
|
|
10
|
+
this.__index = index;
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
getIndex() {
|
|
14
|
+
return this.__index;
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
getPageElement() {
|
|
18
|
+
return this.__pageElement;
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
toString() {
|
|
22
|
+
return 'ConnectionSite';
|
|
23
|
+
}
|
|
24
|
+
}
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import { Proxies } from '../../support/proxies.js';
|
|
2
|
+
import { newFakeMaster } from './fakemaster.js';
|
|
3
|
+
|
|
4
|
+
export const newFakeLayout = (...args) => {
|
|
5
|
+
return Proxies.guard(new FakeLayout(...args));
|
|
6
|
+
};
|
|
7
|
+
|
|
8
|
+
export class FakeLayout {
|
|
9
|
+
constructor(resource, presentation) {
|
|
10
|
+
this.__id = resource.objectId;
|
|
11
|
+
this.__presentation = presentation;
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
get __resource() {
|
|
15
|
+
const presentationResource = this.__presentation.__resource;
|
|
16
|
+
const layout = (presentationResource.layouts || []).find(l => l.objectId === this.__id);
|
|
17
|
+
if (!layout) {
|
|
18
|
+
throw new Error(`Layout with ID ${this.__id} not found`);
|
|
19
|
+
}
|
|
20
|
+
return layout;
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
getMaster() {
|
|
24
|
+
const masterId = this.__resource.masterObjectId;
|
|
25
|
+
if (!masterId) return null;
|
|
26
|
+
|
|
27
|
+
const presentationResource = this.__presentation.__resource;
|
|
28
|
+
const master = (presentationResource.masters || []).find(m => m.objectId === masterId);
|
|
29
|
+
return master ? newFakeMaster(master, this.__presentation) : null;
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
getObjectId() {
|
|
33
|
+
return this.__id;
|
|
34
|
+
}
|
|
35
|
+
toString() {
|
|
36
|
+
return 'Layout';
|
|
37
|
+
}
|
|
38
|
+
}
|
|
@@ -0,0 +1,195 @@
|
|
|
1
|
+
import { Proxies } from '../../support/proxies.js';
|
|
2
|
+
import { FakePageElement, PageElementRegistry } from './fakepageelement.js';
|
|
3
|
+
import { newFakeLineFill } from './fakelinefill.js';
|
|
4
|
+
import { newFakePoint } from './fakepoint.js';
|
|
5
|
+
|
|
6
|
+
export const newFakeLine = (...args) => {
|
|
7
|
+
const line = Proxies.guard(new FakeLine(...args));
|
|
8
|
+
return line;
|
|
9
|
+
};
|
|
10
|
+
|
|
11
|
+
PageElementRegistry.newFakeLine = newFakeLine;
|
|
12
|
+
|
|
13
|
+
export class FakeLine extends FakePageElement {
|
|
14
|
+
constructor(resource, page) {
|
|
15
|
+
super(resource, page);
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
get __line() {
|
|
19
|
+
return this.__resource.line;
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
getLineCategory() {
|
|
23
|
+
return this.__line.lineCategory;
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
getLineType() {
|
|
27
|
+
return this.__line.lineType;
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
isConnector() {
|
|
31
|
+
return this.getLineCategory() !== 'NON_CONNECTOR';
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
getLineFill() {
|
|
35
|
+
return newFakeLineFill(this);
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
getWeight() {
|
|
39
|
+
return this.__normalize(this.__line.lineProperties?.weight);
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
setWeight(weight) {
|
|
43
|
+
this.__updateLineProps({ weight: { magnitude: weight, unit: 'PT' } }, 'weight');
|
|
44
|
+
return this;
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
getDashStyle() {
|
|
48
|
+
const style = this.__line.lineProperties?.dashStyle || 'SOLID';
|
|
49
|
+
return SlidesApp.DashStyle[style] || SlidesApp.DashStyle.SOLID;
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
setDashStyle(dashStyle) {
|
|
53
|
+
this.__updateLineProps({ dashStyle: dashStyle }, 'dashStyle');
|
|
54
|
+
return this;
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
getStartArrow() {
|
|
58
|
+
const style = this.__line.lineProperties?.startArrow || 'NONE';
|
|
59
|
+
return SlidesApp.ArrowStyle[style] || SlidesApp.ArrowStyle.NONE;
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
setStartArrow(arrowStyle) {
|
|
63
|
+
this.__updateLineProps({ startArrow: arrowStyle }, 'startArrow');
|
|
64
|
+
return this;
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
getEndArrow() {
|
|
68
|
+
const style = this.__line.lineProperties?.endArrow || 'NONE';
|
|
69
|
+
return SlidesApp.ArrowStyle[style] || SlidesApp.ArrowStyle.NONE;
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
setEndArrow(arrowStyle) {
|
|
73
|
+
this.__updateLineProps({ endArrow: arrowStyle }, 'endArrow');
|
|
74
|
+
return this;
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
getStart() {
|
|
78
|
+
// Start point of the line.
|
|
79
|
+
// Usually lines are defined by transform and size.
|
|
80
|
+
// For now, let's just return normalized coordinates
|
|
81
|
+
return newFakePoint(this.getLeft(), this.getTop());
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
setStart(xOrPoint, y) {
|
|
85
|
+
let xValue, yValue;
|
|
86
|
+
if (typeof xOrPoint === 'object') {
|
|
87
|
+
xValue = xOrPoint.getX();
|
|
88
|
+
yValue = xOrPoint.getY();
|
|
89
|
+
} else {
|
|
90
|
+
xValue = xOrPoint;
|
|
91
|
+
yValue = y;
|
|
92
|
+
}
|
|
93
|
+
this.__updateLineProps({
|
|
94
|
+
startPoint: {
|
|
95
|
+
x: { magnitude: xValue, unit: 'PT' },
|
|
96
|
+
y: { magnitude: yValue, unit: 'PT' }
|
|
97
|
+
}
|
|
98
|
+
}, 'startPoint');
|
|
99
|
+
return this;
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
getEnd() {
|
|
103
|
+
return newFakePoint(this.getLeft() + this.getWidth(), this.getTop() + this.getHeight());
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
setEnd(xOrPoint, y) {
|
|
107
|
+
let xValue, yValue;
|
|
108
|
+
if (typeof xOrPoint === 'object') {
|
|
109
|
+
xValue = xOrPoint.getX();
|
|
110
|
+
yValue = xOrPoint.getY();
|
|
111
|
+
} else {
|
|
112
|
+
xValue = xOrPoint;
|
|
113
|
+
yValue = y;
|
|
114
|
+
}
|
|
115
|
+
// We update size/transform to match endpoints for straight lines?
|
|
116
|
+
// Simplified: just set width/height
|
|
117
|
+
const dx = xValue - this.getLeft();
|
|
118
|
+
const dy = yValue - this.getTop();
|
|
119
|
+
this.setWidth(Math.abs(dx));
|
|
120
|
+
this.setHeight(Math.abs(dy));
|
|
121
|
+
return this;
|
|
122
|
+
}
|
|
123
|
+
|
|
124
|
+
reroute() {
|
|
125
|
+
// In API, there's no reroute directly in batchUpdate for lines?
|
|
126
|
+
// Wait, the documentation says reroute is available.
|
|
127
|
+
// It might be a specific request type.
|
|
128
|
+
// Actually, I don't see 'rerouteLine' in Slides API reference.
|
|
129
|
+
// It might be an Apps Script specific implementation that uses other methods.
|
|
130
|
+
return this;
|
|
131
|
+
}
|
|
132
|
+
|
|
133
|
+
getStartConnection() {
|
|
134
|
+
const conn = this.__line.lineProperties?.startConnection;
|
|
135
|
+
if (!conn) return null;
|
|
136
|
+
|
|
137
|
+
// We need to find the connected element
|
|
138
|
+
const element = this.__page.getPageElements().find(e => e.getObjectId() === conn.connectedObjectId);
|
|
139
|
+
if (!element) return null;
|
|
140
|
+
|
|
141
|
+
// And the connection site
|
|
142
|
+
const sites = element.getConnectionSites();
|
|
143
|
+
const site = sites.find(s => s.getIndex() === conn.connectionSiteIndex);
|
|
144
|
+
|
|
145
|
+
return site || null;
|
|
146
|
+
}
|
|
147
|
+
|
|
148
|
+
getEndConnection() {
|
|
149
|
+
const conn = this.__line.lineProperties?.endConnection;
|
|
150
|
+
if (!conn) return null;
|
|
151
|
+
|
|
152
|
+
const element = this.__page.getPageElements().find(e => e.getObjectId() === conn.connectedObjectId);
|
|
153
|
+
if (!element) return null;
|
|
154
|
+
|
|
155
|
+
const sites = element.getConnectionSites();
|
|
156
|
+
const site = sites.find(s => s.getIndex() === conn.connectionSiteIndex);
|
|
157
|
+
|
|
158
|
+
return site || null;
|
|
159
|
+
}
|
|
160
|
+
|
|
161
|
+
setStartConnection(connectionSite) {
|
|
162
|
+
this.__updateLineProps({
|
|
163
|
+
startConnection: {
|
|
164
|
+
connectedObjectId: connectionSite.getPageElement().getObjectId(),
|
|
165
|
+
connectionSiteIndex: connectionSite.getIndex()
|
|
166
|
+
}
|
|
167
|
+
}, 'startConnection');
|
|
168
|
+
return this;
|
|
169
|
+
}
|
|
170
|
+
|
|
171
|
+
setEndConnection(connectionSite) {
|
|
172
|
+
this.__updateLineProps({
|
|
173
|
+
endConnection: {
|
|
174
|
+
connectedObjectId: connectionSite.getPageElement().getObjectId(),
|
|
175
|
+
connectionSiteIndex: connectionSite.getIndex()
|
|
176
|
+
}
|
|
177
|
+
}, 'endConnection');
|
|
178
|
+
return this;
|
|
179
|
+
}
|
|
180
|
+
|
|
181
|
+
__updateLineProps(lineProperties, fields) {
|
|
182
|
+
const presentationId = this.__page.__presentation?.getId() || this.__page.__slide?.__presentation.getId();
|
|
183
|
+
Slides.Presentations.batchUpdate([{
|
|
184
|
+
updateLineProperties: {
|
|
185
|
+
objectId: this.getObjectId(),
|
|
186
|
+
lineProperties: lineProperties,
|
|
187
|
+
fields: fields
|
|
188
|
+
}
|
|
189
|
+
}], presentationId);
|
|
190
|
+
}
|
|
191
|
+
|
|
192
|
+
toString() {
|
|
193
|
+
return 'Line';
|
|
194
|
+
}
|
|
195
|
+
}
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
import { Proxies } from '../../support/proxies.js';
|
|
2
|
+
|
|
3
|
+
export const newFakeLineFill = (...args) => {
|
|
4
|
+
return Proxies.guard(new FakeLineFill(...args));
|
|
5
|
+
};
|
|
6
|
+
|
|
7
|
+
export class FakeLineFill {
|
|
8
|
+
constructor(line) {
|
|
9
|
+
this.__line = line;
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
getFillType() {
|
|
13
|
+
return this.__line.__line.lineFill?.solidFill ? 'SOLID' : 'NONE';
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
getSolidFill() {
|
|
17
|
+
// This should return a SolidFill object
|
|
18
|
+
// For now we might need a FakeSolidFill or just return something simple
|
|
19
|
+
return null;
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
setSolidFill(color) {
|
|
23
|
+
// Implementing this requires updateLineProperties with solidFill
|
|
24
|
+
const presentationId = this.__line.__page.__presentation?.getId() || this.__line.__page.__slide?.__presentation.getId();
|
|
25
|
+
|
|
26
|
+
let solidFill = {};
|
|
27
|
+
if (typeof color === 'string') {
|
|
28
|
+
solidFill = { color: { rgbColor: this.__hexToRgb(color) } };
|
|
29
|
+
}
|
|
30
|
+
// Handle other color types if needed
|
|
31
|
+
|
|
32
|
+
Slides.Presentations.batchUpdate([{
|
|
33
|
+
updateLineProperties: {
|
|
34
|
+
objectId: this.__line.getObjectId(),
|
|
35
|
+
lineProperties: {
|
|
36
|
+
lineFill: {
|
|
37
|
+
solidFill: solidFill
|
|
38
|
+
}
|
|
39
|
+
},
|
|
40
|
+
fields: 'lineFill.solidFill'
|
|
41
|
+
}
|
|
42
|
+
}], presentationId);
|
|
43
|
+
return this;
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
__hexToRgb(hex) {
|
|
47
|
+
const result = /^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(hex);
|
|
48
|
+
return result ? {
|
|
49
|
+
red: parseInt(result[1], 16) / 255.0,
|
|
50
|
+
green: parseInt(result[2], 16) / 255.0,
|
|
51
|
+
blue: parseInt(result[3], 16) / 255.0
|
|
52
|
+
} : null;
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
toString() {
|
|
56
|
+
return 'LineFill';
|
|
57
|
+
}
|
|
58
|
+
}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { Proxies } from '../../support/proxies.js';
|
|
2
|
+
|
|
3
|
+
export const newFakeLink = (...args) => {
|
|
4
|
+
return Proxies.guard(new FakeLink(...args));
|
|
5
|
+
};
|
|
6
|
+
|
|
7
|
+
export class FakeLink {
|
|
8
|
+
constructor(resource) {
|
|
9
|
+
this.__resource = resource;
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
getLinkType() {
|
|
13
|
+
if (this.__resource.url) return 'URL';
|
|
14
|
+
if (this.__resource.slideId) return 'SLIDE_ID';
|
|
15
|
+
if (this.__resource.pageObjectId) return 'PAGE_OBJECT_ID';
|
|
16
|
+
if (this.__resource.relativeSlide) return 'RELATIVE_SLIDE';
|
|
17
|
+
return 'NONE';
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
getUrl() {
|
|
21
|
+
return this.__resource.url || null;
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
getSlideId() {
|
|
25
|
+
return this.__resource.slideId || null;
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
toString() {
|
|
29
|
+
return 'Link';
|
|
30
|
+
}
|
|
31
|
+
}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { Proxies } from '../../support/proxies.js';
|
|
2
|
+
|
|
3
|
+
export const newFakeMaster = (...args) => {
|
|
4
|
+
return Proxies.guard(new FakeMaster(...args));
|
|
5
|
+
};
|
|
6
|
+
|
|
7
|
+
export class FakeMaster {
|
|
8
|
+
constructor(resource, presentation) {
|
|
9
|
+
this.__id = resource.objectId;
|
|
10
|
+
this.__presentation = presentation;
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
get __resource() {
|
|
14
|
+
const presentationResource = this.__presentation.__resource;
|
|
15
|
+
const master = (presentationResource.masters || []).find(m => m.objectId === this.__id);
|
|
16
|
+
if (!master) {
|
|
17
|
+
throw new Error(`Master with ID ${this.__id} not found`);
|
|
18
|
+
}
|
|
19
|
+
return master;
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
getObjectId() {
|
|
23
|
+
return this.__id;
|
|
24
|
+
}
|
|
25
|
+
toString() {
|
|
26
|
+
return 'Master';
|
|
27
|
+
}
|
|
28
|
+
}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { Proxies } from '../../support/proxies.js';
|
|
2
|
+
|
|
3
|
+
export const newFakeNotesPage = (...args) => {
|
|
4
|
+
return Proxies.guard(new FakeNotesPage(...args));
|
|
5
|
+
};
|
|
6
|
+
|
|
7
|
+
export class FakeNotesPage {
|
|
8
|
+
constructor(slide) {
|
|
9
|
+
this.__slide = slide;
|
|
10
|
+
}
|
|
11
|
+
get __resource() {
|
|
12
|
+
// notesPage is a property of slideProperties
|
|
13
|
+
const notesPage = this.__slide.__resource.slideProperties?.notesPage;
|
|
14
|
+
return notesPage || null;
|
|
15
|
+
}
|
|
16
|
+
toString() {
|
|
17
|
+
return 'NotesPage';
|
|
18
|
+
}
|
|
19
|
+
}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { Proxies } from '../../support/proxies.js';
|
|
2
|
+
|
|
3
|
+
export const newFakePageBackground = (...args) => {
|
|
4
|
+
return Proxies.guard(new FakePageBackground(...args));
|
|
5
|
+
};
|
|
6
|
+
|
|
7
|
+
export class FakePageBackground {
|
|
8
|
+
constructor(page) {
|
|
9
|
+
this.__page = page;
|
|
10
|
+
}
|
|
11
|
+
get __resource() {
|
|
12
|
+
return this.__page.__resource.pageBackgroundFill || null;
|
|
13
|
+
}
|
|
14
|
+
toString() {
|
|
15
|
+
return 'PageBackground';
|
|
16
|
+
}
|
|
17
|
+
}
|