@cntrl-site/sdk 1.22.21 → 1.23.1-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/LICENSE +21 -21
- package/README.md +2 -2
- package/package.json +79 -79
- package/resources/template.scss.ejs +50 -50
- package/dist/Client/Client.d.ts +0 -32
- package/dist/Client/Client.js +0 -128
- package/dist/Client/Client.test.d.ts +0 -1
- package/dist/Client/__mock__/articleMock.d.ts +0 -2
- package/dist/Client/__mock__/keyframesMock.d.ts +0 -2
- package/dist/Client/__mock__/projectMock.d.ts +0 -2
- package/dist/Components/ControlSlider/ControlSlider.d.ts +0 -90
- package/dist/Components/ControlSlider/ControlSliderComponent.d.ts +0 -500
- package/dist/Components/components.d.ts +0 -2
- package/dist/Components/helpers/RichTextRenderer/RichTextRenderer.d.ts +0 -6
- package/dist/Components/helpers/SvgImage/SvgImage.d.ts +0 -9
- package/dist/Components/utils/scalingValue.d.ts +0 -1
- package/dist/FontFaceGenerator/FontFaceGenerator.d.ts +0 -6
- package/dist/FontFaceGenerator/FontFaceGenerator.test.d.ts +0 -1
- package/dist/ScrollPlaybackVideoManager/ScrollPlaybackVideoManager.d.ts +0 -31
- package/dist/VideoDecoder/VideoDecoder.d.ts +0 -12
- package/dist/cli.d.ts +0 -10
- package/dist/cli.js +0 -64
- package/dist/index.d.ts +0 -23
- package/dist/index.js +0 -2217
- package/dist/index.mjs +0 -2200
- package/dist/schemas/article/Article.schema.d.ts +0 -293
- package/dist/schemas/article/Article.schema.js +0 -11
- package/dist/schemas/article/Interaction.schema.d.ts +0 -78
- package/dist/schemas/article/Interaction.schema.js +0 -24
- package/dist/schemas/article/Item.schema.d.ts +0 -40
- package/dist/schemas/article/Item.schema.js +0 -241
- package/dist/schemas/article/ItemArea.schema.d.ts +0 -36
- package/dist/schemas/article/ItemArea.schema.js +0 -17
- package/dist/schemas/article/ItemBase.schema.d.ts +0 -137
- package/dist/schemas/article/ItemBase.schema.js +0 -23
- package/dist/schemas/article/ItemState.schema.d.ts +0 -13561
- package/dist/schemas/article/ItemState.schema.js +0 -74
- package/dist/schemas/article/RichTextItem.schema.d.ts +0 -1370
- package/dist/schemas/article/RichTextItem.schema.js +0 -60
- package/dist/schemas/article/Section.schema.d.ts +0 -176
- package/dist/schemas/article/Section.schema.js +0 -38
- package/dist/schemas/keyframe/Keyframes.schema.d.ts +0 -934
- package/dist/schemas/keyframe/Keyframes.schema.js +0 -119
- package/dist/schemas/project/Layout.schema.d.ts +0 -17
- package/dist/schemas/project/Layout.schema.js +0 -10
- package/dist/schemas/project/Project.schema.d.ts +0 -253
- package/dist/schemas/project/Project.schema.js +0 -48
- package/dist/sdk.css +0 -1
- package/dist/types/article/Article.d.ts +0 -7
- package/dist/types/article/Article.js +0 -2
- package/dist/types/article/ArticleItemType.d.ts +0 -13
- package/dist/types/article/ArticleItemType.js +0 -17
- package/dist/types/article/CompoundSettings.d.ts +0 -6
- package/dist/types/article/CompoundSettings.js +0 -2
- package/dist/types/article/FX.d.ts +0 -23
- package/dist/types/article/FX.js +0 -2
- package/dist/types/article/Interaction.d.ts +0 -22
- package/dist/types/article/Interaction.js +0 -2
- package/dist/types/article/Item.d.ts +0 -202
- package/dist/types/article/Item.js +0 -3
- package/dist/types/article/ItemArea.d.ts +0 -36
- package/dist/types/article/ItemArea.js +0 -31
- package/dist/types/article/ItemState.d.ts +0 -77
- package/dist/types/article/ItemState.js +0 -3
- package/dist/types/article/RichText.d.ts +0 -40
- package/dist/types/article/RichText.js +0 -27
- package/dist/types/article/Section.d.ts +0 -37
- package/dist/types/article/Section.js +0 -8
- package/dist/types/component/Component.d.ts +0 -15
- package/dist/types/keyframe/Keyframe.d.ts +0 -89
- package/dist/types/keyframe/Keyframe.js +0 -21
- package/dist/types/project/Fonts.d.ts +0 -22
- package/dist/types/project/Fonts.js +0 -11
- package/dist/types/project/Layout.d.ts +0 -6
- package/dist/types/project/Layout.js +0 -2
- package/dist/types/project/Meta.d.ts +0 -9
- package/dist/types/project/Meta.js +0 -2
- package/dist/types/project/Page.d.ts +0 -11
- package/dist/types/project/Page.js +0 -2
- package/dist/types/project/Project.d.ts +0 -17
- package/dist/types/project/Project.js +0 -2
- package/dist/utils.d.ts +0 -3
|
@@ -1,500 +0,0 @@
|
|
|
1
|
-
import { ControlSlider } from './ControlSlider';
|
|
2
|
-
export declare const ControlSliderComponent: {
|
|
3
|
-
element: typeof ControlSlider;
|
|
4
|
-
id: string;
|
|
5
|
-
name: string;
|
|
6
|
-
preview: {
|
|
7
|
-
type: "video";
|
|
8
|
-
url: string;
|
|
9
|
-
};
|
|
10
|
-
defaultSize: {
|
|
11
|
-
width: number;
|
|
12
|
-
height: number;
|
|
13
|
-
};
|
|
14
|
-
schema: {
|
|
15
|
-
type: string;
|
|
16
|
-
properties: {
|
|
17
|
-
settings: {
|
|
18
|
-
layoutBased: boolean;
|
|
19
|
-
type: string;
|
|
20
|
-
properties: {
|
|
21
|
-
triggers: {
|
|
22
|
-
name: string;
|
|
23
|
-
icon: string;
|
|
24
|
-
tooltip: string;
|
|
25
|
-
type: string;
|
|
26
|
-
properties: {
|
|
27
|
-
triggersList: {
|
|
28
|
-
type: string;
|
|
29
|
-
display: {
|
|
30
|
-
type: string;
|
|
31
|
-
};
|
|
32
|
-
properties: {
|
|
33
|
-
click: {
|
|
34
|
-
type: string;
|
|
35
|
-
};
|
|
36
|
-
drag: {
|
|
37
|
-
type: string;
|
|
38
|
-
};
|
|
39
|
-
};
|
|
40
|
-
};
|
|
41
|
-
autoPlay: {
|
|
42
|
-
type: string[];
|
|
43
|
-
label: string;
|
|
44
|
-
display: {
|
|
45
|
-
type: string;
|
|
46
|
-
};
|
|
47
|
-
enum: (string | null)[];
|
|
48
|
-
};
|
|
49
|
-
};
|
|
50
|
-
};
|
|
51
|
-
direction: {
|
|
52
|
-
name: string;
|
|
53
|
-
icon: string;
|
|
54
|
-
tooltip: string;
|
|
55
|
-
type: string;
|
|
56
|
-
display: {
|
|
57
|
-
type: string;
|
|
58
|
-
};
|
|
59
|
-
enum: string[];
|
|
60
|
-
};
|
|
61
|
-
transition: {
|
|
62
|
-
name: string;
|
|
63
|
-
icon: string;
|
|
64
|
-
tooltip: string;
|
|
65
|
-
type: string;
|
|
66
|
-
properties: {
|
|
67
|
-
type: {
|
|
68
|
-
type: string;
|
|
69
|
-
display: {
|
|
70
|
-
type: string;
|
|
71
|
-
};
|
|
72
|
-
enum: string[];
|
|
73
|
-
};
|
|
74
|
-
duration: {
|
|
75
|
-
type: string;
|
|
76
|
-
label: string;
|
|
77
|
-
display: {
|
|
78
|
-
type: string;
|
|
79
|
-
};
|
|
80
|
-
enum: string[];
|
|
81
|
-
};
|
|
82
|
-
};
|
|
83
|
-
};
|
|
84
|
-
controls: {
|
|
85
|
-
name: string;
|
|
86
|
-
icon: string;
|
|
87
|
-
tooltip: string;
|
|
88
|
-
type: string;
|
|
89
|
-
properties: {
|
|
90
|
-
isActive: {
|
|
91
|
-
type: string;
|
|
92
|
-
display: {
|
|
93
|
-
type: string;
|
|
94
|
-
};
|
|
95
|
-
};
|
|
96
|
-
arrowsImgUrl: {
|
|
97
|
-
type: string[];
|
|
98
|
-
display: {
|
|
99
|
-
type: string;
|
|
100
|
-
};
|
|
101
|
-
};
|
|
102
|
-
offset: {
|
|
103
|
-
type: string;
|
|
104
|
-
display: {
|
|
105
|
-
type: string;
|
|
106
|
-
};
|
|
107
|
-
properties: {
|
|
108
|
-
x: {
|
|
109
|
-
type: string;
|
|
110
|
-
};
|
|
111
|
-
y: {
|
|
112
|
-
type: string;
|
|
113
|
-
};
|
|
114
|
-
};
|
|
115
|
-
};
|
|
116
|
-
scale: {
|
|
117
|
-
type: string;
|
|
118
|
-
name: string;
|
|
119
|
-
min: number;
|
|
120
|
-
max: number;
|
|
121
|
-
display: {
|
|
122
|
-
type: string;
|
|
123
|
-
};
|
|
124
|
-
};
|
|
125
|
-
color: {
|
|
126
|
-
name: string;
|
|
127
|
-
type: string;
|
|
128
|
-
display: {
|
|
129
|
-
type: string;
|
|
130
|
-
format: string;
|
|
131
|
-
};
|
|
132
|
-
};
|
|
133
|
-
hover: {
|
|
134
|
-
name: string;
|
|
135
|
-
type: string;
|
|
136
|
-
display: {
|
|
137
|
-
type: string;
|
|
138
|
-
format: string;
|
|
139
|
-
};
|
|
140
|
-
};
|
|
141
|
-
};
|
|
142
|
-
};
|
|
143
|
-
pagination: {
|
|
144
|
-
name: string;
|
|
145
|
-
icon: string;
|
|
146
|
-
tooltip: string;
|
|
147
|
-
type: string;
|
|
148
|
-
properties: {
|
|
149
|
-
isActive: {
|
|
150
|
-
type: string;
|
|
151
|
-
display: {
|
|
152
|
-
type: string;
|
|
153
|
-
};
|
|
154
|
-
};
|
|
155
|
-
position: {
|
|
156
|
-
name: string;
|
|
157
|
-
display: {
|
|
158
|
-
type: string;
|
|
159
|
-
direction: string;
|
|
160
|
-
};
|
|
161
|
-
type: string;
|
|
162
|
-
enum: string[];
|
|
163
|
-
};
|
|
164
|
-
offset: {
|
|
165
|
-
type: string;
|
|
166
|
-
display: {
|
|
167
|
-
type: string;
|
|
168
|
-
};
|
|
169
|
-
properties: {
|
|
170
|
-
x: {
|
|
171
|
-
type: string;
|
|
172
|
-
};
|
|
173
|
-
y: {
|
|
174
|
-
type: string;
|
|
175
|
-
};
|
|
176
|
-
};
|
|
177
|
-
};
|
|
178
|
-
scale: {
|
|
179
|
-
type: string;
|
|
180
|
-
name: string;
|
|
181
|
-
min: number;
|
|
182
|
-
max: number;
|
|
183
|
-
display: {
|
|
184
|
-
type: string;
|
|
185
|
-
};
|
|
186
|
-
};
|
|
187
|
-
colors: {
|
|
188
|
-
display: {
|
|
189
|
-
type: string;
|
|
190
|
-
format: string;
|
|
191
|
-
};
|
|
192
|
-
name: string;
|
|
193
|
-
type: string;
|
|
194
|
-
items: {
|
|
195
|
-
type: string;
|
|
196
|
-
};
|
|
197
|
-
};
|
|
198
|
-
hover: {
|
|
199
|
-
name: string;
|
|
200
|
-
type: string;
|
|
201
|
-
display: {
|
|
202
|
-
type: string;
|
|
203
|
-
format: string;
|
|
204
|
-
};
|
|
205
|
-
};
|
|
206
|
-
};
|
|
207
|
-
};
|
|
208
|
-
caption: {
|
|
209
|
-
name: string;
|
|
210
|
-
icon: string;
|
|
211
|
-
tooltip: string;
|
|
212
|
-
type: string;
|
|
213
|
-
properties: {
|
|
214
|
-
isActive: {
|
|
215
|
-
type: string;
|
|
216
|
-
display: {
|
|
217
|
-
type: string;
|
|
218
|
-
};
|
|
219
|
-
};
|
|
220
|
-
alignment: {
|
|
221
|
-
name: string;
|
|
222
|
-
type: string;
|
|
223
|
-
display: {
|
|
224
|
-
type: string;
|
|
225
|
-
};
|
|
226
|
-
enum: string[];
|
|
227
|
-
};
|
|
228
|
-
offset: {
|
|
229
|
-
type: string;
|
|
230
|
-
display: {
|
|
231
|
-
type: string;
|
|
232
|
-
};
|
|
233
|
-
properties: {
|
|
234
|
-
x: {
|
|
235
|
-
type: string;
|
|
236
|
-
};
|
|
237
|
-
y: {
|
|
238
|
-
type: string;
|
|
239
|
-
};
|
|
240
|
-
};
|
|
241
|
-
};
|
|
242
|
-
hover: {
|
|
243
|
-
name: string;
|
|
244
|
-
type: string;
|
|
245
|
-
display: {
|
|
246
|
-
type: string;
|
|
247
|
-
format: string;
|
|
248
|
-
};
|
|
249
|
-
};
|
|
250
|
-
};
|
|
251
|
-
};
|
|
252
|
-
};
|
|
253
|
-
default: {
|
|
254
|
-
triggers: {
|
|
255
|
-
triggersList: {
|
|
256
|
-
click: boolean;
|
|
257
|
-
drag: boolean;
|
|
258
|
-
};
|
|
259
|
-
autoPlay: null;
|
|
260
|
-
};
|
|
261
|
-
controls: {
|
|
262
|
-
isActive: boolean;
|
|
263
|
-
arrowsImgUrl: null;
|
|
264
|
-
offset: {
|
|
265
|
-
x: number;
|
|
266
|
-
y: number;
|
|
267
|
-
};
|
|
268
|
-
scale: number;
|
|
269
|
-
color: string;
|
|
270
|
-
hover: string;
|
|
271
|
-
};
|
|
272
|
-
transition: {
|
|
273
|
-
type: string;
|
|
274
|
-
duration: string;
|
|
275
|
-
};
|
|
276
|
-
pagination: {
|
|
277
|
-
isActive: boolean;
|
|
278
|
-
scale: number;
|
|
279
|
-
position: string;
|
|
280
|
-
offset: {
|
|
281
|
-
x: number;
|
|
282
|
-
y: number;
|
|
283
|
-
};
|
|
284
|
-
colors: string[];
|
|
285
|
-
hover: string;
|
|
286
|
-
};
|
|
287
|
-
direction: string;
|
|
288
|
-
caption: {
|
|
289
|
-
offset: {
|
|
290
|
-
x: number;
|
|
291
|
-
y: number;
|
|
292
|
-
};
|
|
293
|
-
isActive: boolean;
|
|
294
|
-
alignment: string;
|
|
295
|
-
hover: string;
|
|
296
|
-
};
|
|
297
|
-
};
|
|
298
|
-
displayRules: {
|
|
299
|
-
if: {
|
|
300
|
-
name: string;
|
|
301
|
-
value: string;
|
|
302
|
-
};
|
|
303
|
-
then: {
|
|
304
|
-
name: string;
|
|
305
|
-
value: string;
|
|
306
|
-
};
|
|
307
|
-
}[];
|
|
308
|
-
};
|
|
309
|
-
content: {
|
|
310
|
-
layoutBased: boolean;
|
|
311
|
-
type: string;
|
|
312
|
-
items: {
|
|
313
|
-
type: string;
|
|
314
|
-
properties: {
|
|
315
|
-
image: {
|
|
316
|
-
type: string;
|
|
317
|
-
display: {
|
|
318
|
-
type: string;
|
|
319
|
-
};
|
|
320
|
-
properties: {
|
|
321
|
-
url: {
|
|
322
|
-
type: string;
|
|
323
|
-
};
|
|
324
|
-
name: {
|
|
325
|
-
type: string;
|
|
326
|
-
};
|
|
327
|
-
objectFit: {
|
|
328
|
-
type: string;
|
|
329
|
-
enum: string[];
|
|
330
|
-
};
|
|
331
|
-
};
|
|
332
|
-
required: string[];
|
|
333
|
-
};
|
|
334
|
-
imageCaption: {
|
|
335
|
-
display: {
|
|
336
|
-
type: string;
|
|
337
|
-
placeholder: string;
|
|
338
|
-
};
|
|
339
|
-
};
|
|
340
|
-
link: {
|
|
341
|
-
type: string;
|
|
342
|
-
display: {
|
|
343
|
-
type: string;
|
|
344
|
-
placeholder: string;
|
|
345
|
-
};
|
|
346
|
-
properties: {
|
|
347
|
-
text: {
|
|
348
|
-
type: string;
|
|
349
|
-
};
|
|
350
|
-
};
|
|
351
|
-
};
|
|
352
|
-
};
|
|
353
|
-
required: string[];
|
|
354
|
-
};
|
|
355
|
-
default: {
|
|
356
|
-
image: {
|
|
357
|
-
objectFit: string;
|
|
358
|
-
url: string;
|
|
359
|
-
name: string;
|
|
360
|
-
};
|
|
361
|
-
imageCaption: {
|
|
362
|
-
type: string;
|
|
363
|
-
children: {
|
|
364
|
-
text: string;
|
|
365
|
-
}[];
|
|
366
|
-
}[];
|
|
367
|
-
}[];
|
|
368
|
-
};
|
|
369
|
-
styles: {
|
|
370
|
-
layoutBased: boolean;
|
|
371
|
-
type: string;
|
|
372
|
-
properties: {
|
|
373
|
-
caption: {
|
|
374
|
-
dataName: string;
|
|
375
|
-
type: string;
|
|
376
|
-
properties: {
|
|
377
|
-
fontSettings: {
|
|
378
|
-
type: string;
|
|
379
|
-
display: {
|
|
380
|
-
type: string;
|
|
381
|
-
};
|
|
382
|
-
properties: {
|
|
383
|
-
fontFamily: {
|
|
384
|
-
type: string;
|
|
385
|
-
};
|
|
386
|
-
fontWeight: {
|
|
387
|
-
type: string;
|
|
388
|
-
};
|
|
389
|
-
fontStyle: {
|
|
390
|
-
type: string;
|
|
391
|
-
};
|
|
392
|
-
};
|
|
393
|
-
};
|
|
394
|
-
widthSettings: {
|
|
395
|
-
display: {
|
|
396
|
-
type: string;
|
|
397
|
-
};
|
|
398
|
-
type: string;
|
|
399
|
-
properties: {
|
|
400
|
-
width: {
|
|
401
|
-
type: string;
|
|
402
|
-
};
|
|
403
|
-
sizing: {
|
|
404
|
-
type: string;
|
|
405
|
-
enum: string[];
|
|
406
|
-
};
|
|
407
|
-
};
|
|
408
|
-
};
|
|
409
|
-
fontSizeLineHeight: {
|
|
410
|
-
type: string;
|
|
411
|
-
display: {
|
|
412
|
-
type: string;
|
|
413
|
-
};
|
|
414
|
-
properties: {
|
|
415
|
-
fontSize: {
|
|
416
|
-
type: string;
|
|
417
|
-
};
|
|
418
|
-
lineHeight: {
|
|
419
|
-
type: string;
|
|
420
|
-
};
|
|
421
|
-
};
|
|
422
|
-
};
|
|
423
|
-
letterSpacing: {
|
|
424
|
-
display: {
|
|
425
|
-
type: string;
|
|
426
|
-
};
|
|
427
|
-
type: string;
|
|
428
|
-
};
|
|
429
|
-
wordSpacing: {
|
|
430
|
-
display: {
|
|
431
|
-
type: string;
|
|
432
|
-
};
|
|
433
|
-
type: string;
|
|
434
|
-
};
|
|
435
|
-
textAlign: {
|
|
436
|
-
display: {
|
|
437
|
-
type: string;
|
|
438
|
-
};
|
|
439
|
-
type: string;
|
|
440
|
-
enum: string[];
|
|
441
|
-
};
|
|
442
|
-
textAppearance: {
|
|
443
|
-
display: {
|
|
444
|
-
type: string;
|
|
445
|
-
};
|
|
446
|
-
properties: {
|
|
447
|
-
textTransform: {
|
|
448
|
-
type: string;
|
|
449
|
-
enum: string[];
|
|
450
|
-
};
|
|
451
|
-
textDecoration: {
|
|
452
|
-
type: string;
|
|
453
|
-
enum: string[];
|
|
454
|
-
};
|
|
455
|
-
fontVariant: {
|
|
456
|
-
type: string;
|
|
457
|
-
enum: string[];
|
|
458
|
-
};
|
|
459
|
-
};
|
|
460
|
-
};
|
|
461
|
-
color: {
|
|
462
|
-
display: {
|
|
463
|
-
type: string;
|
|
464
|
-
};
|
|
465
|
-
type: string;
|
|
466
|
-
};
|
|
467
|
-
};
|
|
468
|
-
};
|
|
469
|
-
};
|
|
470
|
-
default: {
|
|
471
|
-
caption: {
|
|
472
|
-
widthSettings: {
|
|
473
|
-
width: number;
|
|
474
|
-
sizing: string;
|
|
475
|
-
};
|
|
476
|
-
fontSettings: {
|
|
477
|
-
fontFamily: string;
|
|
478
|
-
fontWeight: number;
|
|
479
|
-
fontStyle: string;
|
|
480
|
-
};
|
|
481
|
-
fontSizeLineHeight: {
|
|
482
|
-
fontSize: number;
|
|
483
|
-
lineHeight: number;
|
|
484
|
-
};
|
|
485
|
-
letterSpacing: number;
|
|
486
|
-
wordSpacing: number;
|
|
487
|
-
textAlign: string;
|
|
488
|
-
textAppearance: {
|
|
489
|
-
textTransform: string;
|
|
490
|
-
textDecoration: string;
|
|
491
|
-
fontVariant: string;
|
|
492
|
-
};
|
|
493
|
-
color: string;
|
|
494
|
-
};
|
|
495
|
-
};
|
|
496
|
-
};
|
|
497
|
-
};
|
|
498
|
-
required: string[];
|
|
499
|
-
};
|
|
500
|
-
};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export declare function scalingValue(value: number, isEditor?: boolean): string;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1,31 +0,0 @@
|
|
|
1
|
-
interface ScrollVideoOptions {
|
|
2
|
-
src: string;
|
|
3
|
-
videoContainer: HTMLElement | string;
|
|
4
|
-
}
|
|
5
|
-
export declare class ScrollPlaybackVideoManager {
|
|
6
|
-
private container?;
|
|
7
|
-
private video?;
|
|
8
|
-
private isSafari?;
|
|
9
|
-
private currentTime;
|
|
10
|
-
private targetTime;
|
|
11
|
-
private canvas;
|
|
12
|
-
private context;
|
|
13
|
-
private frames;
|
|
14
|
-
private frameRate;
|
|
15
|
-
private transitioning;
|
|
16
|
-
private debug;
|
|
17
|
-
private frameThreshold;
|
|
18
|
-
private transitionSpeed;
|
|
19
|
-
private useWebCodecs;
|
|
20
|
-
private resizeObserver;
|
|
21
|
-
constructor(options: ScrollVideoOptions);
|
|
22
|
-
private setCoverStyle;
|
|
23
|
-
private resize;
|
|
24
|
-
private decodeVideo;
|
|
25
|
-
private paintCanvasFrame;
|
|
26
|
-
private transitionToTargetTime;
|
|
27
|
-
private resetCanvasDimensions;
|
|
28
|
-
setTargetTimePercent(setPercentage: number, jump?: boolean): void;
|
|
29
|
-
destroy(): void;
|
|
30
|
-
}
|
|
31
|
-
export {};
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
export declare class Writer {
|
|
2
|
-
private data;
|
|
3
|
-
private idx;
|
|
4
|
-
private size;
|
|
5
|
-
constructor(size: number);
|
|
6
|
-
getData(): Uint8Array<ArrayBuffer>;
|
|
7
|
-
writeUint8(value: number): void;
|
|
8
|
-
writeUint16(value: number): void;
|
|
9
|
-
writeUint8Array(value: Uint8Array): void;
|
|
10
|
-
}
|
|
11
|
-
declare const _default: (src: string, emitFrame: (bitmap: ImageBitmap) => void, debug: boolean) => Promise<void>;
|
|
12
|
-
export default _default;
|
package/dist/cli.d.ts
DELETED
package/dist/cli.js
DELETED
|
@@ -1,64 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env node
|
|
2
|
-
"use strict";
|
|
3
|
-
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
4
|
-
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
5
|
-
return new (P || (P = Promise))(function (resolve, reject) {
|
|
6
|
-
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
7
|
-
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
8
|
-
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
9
|
-
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
10
|
-
});
|
|
11
|
-
};
|
|
12
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
13
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
14
|
-
};
|
|
15
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
16
|
-
const fs_1 = __importDefault(require("fs"));
|
|
17
|
-
const path_1 = __importDefault(require("path"));
|
|
18
|
-
const ejs_1 = __importDefault(require("ejs"));
|
|
19
|
-
const dotenv_1 = require("dotenv");
|
|
20
|
-
const commander_1 = require("commander");
|
|
21
|
-
const Client_1 = require("./Client/Client");
|
|
22
|
-
commander_1.program
|
|
23
|
-
.command('generate-layouts')
|
|
24
|
-
.option('-o, --output <outputFilePath>', 'Output file path', 'cntrl.scss')
|
|
25
|
-
.option('-e, --env <envFilename>', 'Name of the .env file', '.env.local')
|
|
26
|
-
.action((options) => __awaiter(void 0, void 0, void 0, function* () {
|
|
27
|
-
try {
|
|
28
|
-
(0, dotenv_1.config)({ path: options.env });
|
|
29
|
-
const templateFilePath = path_1.default.resolve(__dirname, '../resources/template.scss.ejs');
|
|
30
|
-
const scssTemplate = fs_1.default.readFileSync(templateFilePath, 'utf-8');
|
|
31
|
-
const apiUrl = process.env.CNTRL_API_URL;
|
|
32
|
-
if (!apiUrl) {
|
|
33
|
-
throw new Error('Environment variable "CNTRL_API_URL" must be set.');
|
|
34
|
-
}
|
|
35
|
-
const client = new Client_1.Client(apiUrl);
|
|
36
|
-
const layouts = yield client.getLayouts();
|
|
37
|
-
const ranges = convertLayouts(layouts);
|
|
38
|
-
const compiledTemplate = ejs_1.default.compile(scssTemplate);
|
|
39
|
-
const renderedTemplate = compiledTemplate({ ranges });
|
|
40
|
-
const outputFilePath = path_1.default.resolve(process.cwd(), options.output);
|
|
41
|
-
fs_1.default.writeFileSync(outputFilePath, renderedTemplate);
|
|
42
|
-
console.log(`Generated .scss file at ${outputFilePath}`);
|
|
43
|
-
}
|
|
44
|
-
catch (error) {
|
|
45
|
-
console.error('An error occurred:', error);
|
|
46
|
-
process.exit(1);
|
|
47
|
-
}
|
|
48
|
-
}));
|
|
49
|
-
function convertLayouts(layouts, maxLayoutWidth = Number.MAX_SAFE_INTEGER) {
|
|
50
|
-
const sorted = layouts.slice().sort((la, lb) => la.startsWith - lb.startsWith);
|
|
51
|
-
const mapped = sorted.map((layout, i, ls) => {
|
|
52
|
-
const next = ls[i + 1];
|
|
53
|
-
return {
|
|
54
|
-
start: layout.startsWith,
|
|
55
|
-
end: next ? next.startsWith - 1 : maxLayoutWidth,
|
|
56
|
-
exemplary: layout.exemplary,
|
|
57
|
-
name: layout.title,
|
|
58
|
-
isFirst: i === 0,
|
|
59
|
-
isLast: !next
|
|
60
|
-
};
|
|
61
|
-
});
|
|
62
|
-
return mapped;
|
|
63
|
-
}
|
|
64
|
-
commander_1.program.parse(process.argv);
|
package/dist/index.d.ts
DELETED
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
export { Client as CntrlClient } from './Client/Client';
|
|
2
|
-
export { FontFaceGenerator } from './FontFaceGenerator/FontFaceGenerator';
|
|
3
|
-
export { getLayoutStyles, getLayoutMediaQuery } from './utils';
|
|
4
|
-
export { ScrollPlaybackVideoManager } from './ScrollPlaybackVideoManager/ScrollPlaybackVideoManager';
|
|
5
|
-
export { SectionHeightMode } from './types/article/Section';
|
|
6
|
-
export { TextAlign, TextDecoration, TextTransform, VerticalAlign } from './types/article/RichText';
|
|
7
|
-
export { ArticleItemType } from './types/article/ArticleItemType';
|
|
8
|
-
export { AreaAnchor, AnchorSide, DimensionMode, PositionType } from './types/article/ItemArea';
|
|
9
|
-
export { KeyframeType } from './types/keyframe/Keyframe';
|
|
10
|
-
export type { Article } from './types/article/Article';
|
|
11
|
-
export type { Section, SectionHeight } from './types/article/Section';
|
|
12
|
-
export type { Item, ImageItem, ItemAny, CustomItem, ItemCommonParamsMap, ItemLayoutParamsMap, RectangleItem, StickyParams, VideoItem, RichTextItem, Link, VimeoEmbedItem, YoutubeEmbedItem, GroupItem, CodeEmbedItem, CompoundItem, ComponentItem } from './types/article/Item';
|
|
13
|
-
export type { RichTextBlock, RichTextEntity, RichTextStyle } from './types/article/RichText';
|
|
14
|
-
export type { ItemArea } from './types/article/ItemArea';
|
|
15
|
-
export type { ItemState, ItemStateParams, StateParams, ItemStatesMap } from './types/article/ItemState';
|
|
16
|
-
export type { Interaction, InteractionTrigger, InteractionState } from './types/article/Interaction';
|
|
17
|
-
export type { Layout } from './types/project/Layout';
|
|
18
|
-
export type { Project } from './types/project/Project';
|
|
19
|
-
export type { Meta } from './types/project/Meta';
|
|
20
|
-
export type { KeyframeValueMap, KeyframeAny } from './types/keyframe/Keyframe';
|
|
21
|
-
export type { CompoundSettings } from './types/article/CompoundSettings';
|
|
22
|
-
export type { Component } from './types/component/Component';
|
|
23
|
-
export { components } from './Components/components';
|