@olenbetong/synergi-course 2.1.0 → 2.2.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/es/document/cues.d.ts +1 -1
- package/es/document/cues.js +3 -1
- package/es/document/effects.d.ts +3 -3
- package/es/document/effects.js +3 -1
- package/es/document/schema.d.ts +1778 -190
- package/es/document/schema.js +35 -2
- package/es/document/validate.js +14 -18
- package/es/index.d.ts +3 -2
- package/es/index.js +1 -1
- package/es/player/CoursePlayer.css +18 -0
- package/es/player/CoursePlayer.js +3 -2
- package/es/player/PlayerBars.d.ts +32 -0
- package/es/player/PlayerBars.js +14 -0
- package/es/steps/Blocks.d.ts +24 -3
- package/es/steps/Blocks.js +14 -7
- package/es/steps/Markdown.js +1 -1
- package/es/steps/QuizStepView.d.ts +2 -1
- package/es/steps/QuizStepView.js +20 -10
- package/es/steps/SlideStepView.d.ts +1 -1
- package/es/steps/SlideStepView.js +14 -4
- package/es/steps/StepBodyProps.d.ts +9 -0
- package/es/steps/StepView.css +65 -7
- package/es/steps/StepView.d.ts +29 -3
- package/es/steps/StepView.js +21 -5
- package/es/types.d.ts +13 -2
- package/package.json +1 -1
- package/src/document/box.test.ts +234 -0
- package/src/document/cues.ts +2 -1
- package/src/document/effects.ts +4 -3
- package/src/document/schema.ts +44 -2
- package/src/document/validate.ts +15 -19
- package/src/index.ts +11 -1
- package/src/player/CoursePlayer.css +18 -0
- package/src/player/CoursePlayer.tsx +38 -58
- package/src/player/PlayerBars.tsx +106 -0
- package/src/steps/Blocks.tsx +55 -8
- package/src/steps/Box.test.tsx +95 -0
- package/src/steps/Markdown.test.tsx +3 -0
- package/src/steps/Markdown.tsx +1 -1
- package/src/steps/QuizStepView.test.tsx +79 -0
- package/src/steps/QuizStepView.tsx +34 -12
- package/src/steps/SlideStepView.tsx +15 -3
- package/src/steps/StepBodyProps.ts +9 -0
- package/src/steps/StepView.css +65 -7
- package/src/steps/StepView.test.tsx +116 -0
- package/src/steps/StepView.tsx +100 -19
- package/src/types.ts +13 -2
package/es/document/cues.d.ts
CHANGED
|
@@ -12,7 +12,7 @@ export declare function getActiveCue(cues: Cue[], time: number): Cue | undefined
|
|
|
12
12
|
export declare function hasCueText(cues: Cue[]): boolean;
|
|
13
13
|
/** The ids of every cue that has started at `time`. */
|
|
14
14
|
export declare function getStartedCueIds(cues: Cue[], time: number): Set<string>;
|
|
15
|
-
/** Every block, list item and canvas item of a slide in document order, columns flattened. */
|
|
15
|
+
/** Every block, list item and canvas item of a slide in document order, columns and boxes flattened. */
|
|
16
16
|
export declare function getTimedParts(blocks: Block[]): Timed[];
|
|
17
17
|
/**
|
|
18
18
|
* The ids of the parts that wait for a press of Next, in the order they are shown. None on a
|
package/es/document/cues.js
CHANGED
|
@@ -30,7 +30,7 @@ export function getStartedCueIds(cues, time) {
|
|
|
30
30
|
}
|
|
31
31
|
return started;
|
|
32
32
|
}
|
|
33
|
-
/** Every block, list item and canvas item of a slide in document order, columns flattened. */
|
|
33
|
+
/** Every block, list item and canvas item of a slide in document order, columns and boxes flattened. */
|
|
34
34
|
export function getTimedParts(blocks) {
|
|
35
35
|
let parts = [];
|
|
36
36
|
function add(block) {
|
|
@@ -43,6 +43,8 @@ export function getTimedParts(blocks) {
|
|
|
43
43
|
for (let column of block.columns)
|
|
44
44
|
column.blocks.forEach(add);
|
|
45
45
|
}
|
|
46
|
+
if (block.type === "box")
|
|
47
|
+
block.blocks.forEach(add);
|
|
46
48
|
}
|
|
47
49
|
blocks.forEach(add);
|
|
48
50
|
return parts;
|
package/es/document/effects.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { type RevealState } from "./cues";
|
|
2
|
-
import type { Block, ContentBlock, EffectBlock } from "./schema";
|
|
2
|
+
import type { Block, BoxContentBlock, ContentBlock, EffectBlock } from "./schema";
|
|
3
3
|
export declare const DEFAULT_EFFECT_DURATION = 300;
|
|
4
4
|
/** What the effects on one part add up to right now, and how the part changes into it. */
|
|
5
5
|
export interface PartEffect {
|
|
@@ -13,8 +13,8 @@ export interface PartEffect {
|
|
|
13
13
|
delay: number;
|
|
14
14
|
duration: number;
|
|
15
15
|
}
|
|
16
|
-
/** Every effect block of a slide in document order, those in columns included. */
|
|
17
|
-
export declare function getEffectBlocks(blocks: Array<Block | ContentBlock>): EffectBlock[];
|
|
16
|
+
/** Every effect block of a slide in document order, those in columns and boxes included. */
|
|
17
|
+
export declare function getEffectBlocks(blocks: Array<Block | ContentBlock | BoxContentBlock>): EffectBlock[];
|
|
18
18
|
export declare function effectTargets(effect: EffectBlock): string[];
|
|
19
19
|
/** The ids of the effects that are shown, and so act on their targets, in this state. */
|
|
20
20
|
export declare function getActiveEffects(blocks: Block[], state: RevealState): Set<string>;
|
package/es/document/effects.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { isVisible } from "./cues";
|
|
2
2
|
export const DEFAULT_EFFECT_DURATION = 300;
|
|
3
|
-
/** Every effect block of a slide in document order, those in columns included. */
|
|
3
|
+
/** Every effect block of a slide in document order, those in columns and boxes included. */
|
|
4
4
|
export function getEffectBlocks(blocks) {
|
|
5
5
|
let effects = [];
|
|
6
6
|
for (let block of blocks) {
|
|
@@ -10,6 +10,8 @@ export function getEffectBlocks(blocks) {
|
|
|
10
10
|
for (let column of block.columns)
|
|
11
11
|
effects.push(...getEffectBlocks(column.blocks));
|
|
12
12
|
}
|
|
13
|
+
if (block.type === "box")
|
|
14
|
+
effects.push(...getEffectBlocks(block.blocks));
|
|
13
15
|
}
|
|
14
16
|
return effects;
|
|
15
17
|
}
|