@pie-players/pie-section-player 0.2.12 → 0.2.13
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 +28 -568
- package/dist/component-definitions.d.ts +0 -3
- package/dist/component-definitions.d.ts.map +1 -1
- package/dist/components/section-player-vertical-element.d.ts +2 -0
- package/dist/components/section-player-vertical-element.d.ts.map +1 -0
- package/dist/components/shared/composition.d.ts +9 -0
- package/dist/components/shared/composition.d.ts.map +1 -0
- package/dist/components/shared/player-action.d.ts +18 -0
- package/dist/components/shared/player-action.d.ts.map +1 -0
- package/dist/components/shared/player-preload.d.ts +37 -0
- package/dist/components/shared/player-preload.d.ts.map +1 -0
- package/dist/components/shared/section-player-runtime.d.ts +104 -0
- package/dist/components/shared/section-player-runtime.d.ts.map +1 -0
- package/dist/components/shared/section-player-view-state.d.ts +24 -0
- package/dist/components/shared/section-player-view-state.d.ts.map +1 -0
- package/dist/controllers/SectionContentService.d.ts.map +1 -1
- package/dist/controllers/SectionController.d.ts +5 -1
- package/dist/controllers/SectionController.d.ts.map +1 -1
- package/dist/controllers/SectionSessionService.d.ts +0 -1
- package/dist/controllers/SectionSessionService.d.ts.map +1 -1
- package/dist/controllers/toolkit-section-contracts.d.ts +2 -28
- package/dist/controllers/toolkit-section-contracts.d.ts.map +1 -1
- package/dist/controllers/types.d.ts +28 -1
- package/dist/controllers/types.d.ts.map +1 -1
- package/dist/pie-item-player-B1iGN63e.js +6189 -0
- package/dist/pie-section-player.d.ts +0 -8
- package/dist/pie-section-player.d.ts.map +1 -1
- package/dist/pie-section-player.js +56558 -11
- package/dist/player-preload-CQVG0Bih.js +705 -0
- package/dist/utils/player-preload.d.ts +2 -0
- package/dist/utils/player-preload.d.ts.map +1 -0
- package/dist/utils/player-preload.js +8 -0
- package/package.json +23 -32
- package/src/components/ItemShellElement.svelte +10 -1
- package/src/components/PieSectionPlayerBaseElement.svelte +21 -78
- package/src/components/PieSectionPlayerSplitPaneElement.svelte +236 -295
- package/src/components/PieSectionPlayerVerticalElement.svelte +424 -0
- package/src/components/shared/SectionItemCard.svelte +92 -0
- package/src/components/shared/SectionPassageCard.svelte +88 -0
- package/dist/ItemRenderer-MsjF_Beu.js +0 -467
- package/dist/PieItemModeLayoutElement-D7oTzA9T.js +0 -316
- package/dist/PieSplitPanelLayoutElement-GUtJ_NlF.js +0 -246
- package/dist/PieVerticalLayoutElement-BoA3FO5g.js +0 -194
- package/dist/controllers/SectionToolkitService.d.ts +0 -24
- package/dist/controllers/SectionToolkitService.d.ts.map +0 -1
- package/dist/controllers/SessionPersistenceStrategy.d.ts +0 -15
- package/dist/controllers/SessionPersistenceStrategy.d.ts.map +0 -1
- package/dist/index.d.ts +0 -2
- package/dist/pie-section-player-DJ5NcwdT.js +0 -17078
- package/dist/runtime/runtime-event-guards.d.ts +0 -4
- package/dist/runtime/runtime-event-guards.d.ts.map +0 -1
- package/src/PieSectionPlayer.svelte +0 -826
- package/src/components/ItemModeLayout.svelte +0 -172
- package/src/components/ItemNavigation.svelte +0 -96
- package/src/components/ItemPlayerBridge.svelte +0 -110
- package/src/components/ItemRenderer.svelte +0 -248
- package/src/components/ItemShell.svelte +0 -86
- package/src/components/layout-elements/PieItemModeLayoutElement.svelte +0 -47
- package/src/components/layout-elements/PieSplitPanelLayoutElement.svelte +0 -62
- package/src/components/layout-elements/PieVerticalLayoutElement.svelte +0 -41
- package/src/components/layouts/SplitPanelLayout.svelte +0 -385
- package/src/components/layouts/VerticalLayout.svelte +0 -193
|
@@ -1,193 +0,0 @@
|
|
|
1
|
-
<!--
|
|
2
|
-
VerticalLayout - Internal Component
|
|
3
|
-
|
|
4
|
-
Renders vertical layout - passages first, then all items stacked vertically.
|
|
5
|
-
Traditional assessment format with linear reading flow.
|
|
6
|
-
Not exposed as a web component - used internally in PieSectionPlayer.
|
|
7
|
-
-->
|
|
8
|
-
<script lang="ts">
|
|
9
|
-
import type { SectionCompositionModel } from '../../controllers/types.js';
|
|
10
|
-
import ItemRenderer from '../ItemRenderer.svelte';
|
|
11
|
-
|
|
12
|
-
let {
|
|
13
|
-
composition,
|
|
14
|
-
env = { mode: 'gather', role: 'student' },
|
|
15
|
-
toolbarPosition = 'right',
|
|
16
|
-
showToolbar = true
|
|
17
|
-
}: {
|
|
18
|
-
composition: SectionCompositionModel;
|
|
19
|
-
env?: { mode: 'gather' | 'view' | 'evaluate' | 'author'; role: 'student' | 'instructor' };
|
|
20
|
-
toolbarPosition?: 'top' | 'right' | 'bottom' | 'left' | 'none';
|
|
21
|
-
showToolbar?: boolean;
|
|
22
|
-
} = $props();
|
|
23
|
-
let passages = $derived(composition?.passages || []);
|
|
24
|
-
let items = $derived(composition?.items || []);
|
|
25
|
-
let itemSessionsByItemId = $derived(composition?.itemSessionsByItemId || {});
|
|
26
|
-
let shouldRenderToolbar = $derived(showToolbar && toolbarPosition !== 'none');
|
|
27
|
-
let isToolbarBeforeContent = $derived(
|
|
28
|
-
toolbarPosition === 'top' || toolbarPosition === 'left'
|
|
29
|
-
);
|
|
30
|
-
|
|
31
|
-
let isScrolling = $state(false);
|
|
32
|
-
let scrollTimer: ReturnType<typeof setTimeout> | null = null;
|
|
33
|
-
|
|
34
|
-
function markScrolling() {
|
|
35
|
-
isScrolling = true;
|
|
36
|
-
if (scrollTimer) clearTimeout(scrollTimer);
|
|
37
|
-
scrollTimer = setTimeout(() => {
|
|
38
|
-
isScrolling = false;
|
|
39
|
-
}, 700);
|
|
40
|
-
}
|
|
41
|
-
</script>
|
|
42
|
-
|
|
43
|
-
<div class={`pie-section-player__layout-shell pie-section-player__layout-shell--${toolbarPosition}`}>
|
|
44
|
-
{#if shouldRenderToolbar && isToolbarBeforeContent}
|
|
45
|
-
<pie-section-tools-toolbar
|
|
46
|
-
position={toolbarPosition}
|
|
47
|
-
></pie-section-tools-toolbar>
|
|
48
|
-
{/if}
|
|
49
|
-
<div
|
|
50
|
-
class={`pie-section-player__vertical-layout ${isScrolling ? 'pie-section-player__vertical-layout--scrolling' : ''}`}
|
|
51
|
-
onscroll={markScrolling}
|
|
52
|
-
>
|
|
53
|
-
<!-- Passages -->
|
|
54
|
-
{#if passages.length > 0}
|
|
55
|
-
<div class="pie-section-player__passages-section">
|
|
56
|
-
{#each passages as passage (passage.id)}
|
|
57
|
-
<div class="pie-section-player__passage-wrapper">
|
|
58
|
-
<ItemRenderer
|
|
59
|
-
item={passage}
|
|
60
|
-
contentKind="rubric-block-stimulus"
|
|
61
|
-
env={{ mode: 'view', role: env.role }}
|
|
62
|
-
customClassName="pie-section-player__passage-item"
|
|
63
|
-
/>
|
|
64
|
-
</div>
|
|
65
|
-
{/each}
|
|
66
|
-
</div>
|
|
67
|
-
{/if}
|
|
68
|
-
|
|
69
|
-
<!-- All Items -->
|
|
70
|
-
<div class="pie-section-player__items-section">
|
|
71
|
-
{#each items as item, index (item.id || index)}
|
|
72
|
-
<div class="pie-section-player__item-wrapper" data-item-index={index}>
|
|
73
|
-
<ItemRenderer
|
|
74
|
-
{item}
|
|
75
|
-
contentKind="assessment-item"
|
|
76
|
-
{env}
|
|
77
|
-
session={itemSessionsByItemId[item.id || '']}
|
|
78
|
-
customClassName="pie-section-player__item-content"
|
|
79
|
-
/>
|
|
80
|
-
</div>
|
|
81
|
-
{/each}
|
|
82
|
-
</div>
|
|
83
|
-
</div>
|
|
84
|
-
{#if shouldRenderToolbar && !isToolbarBeforeContent}
|
|
85
|
-
<pie-section-tools-toolbar
|
|
86
|
-
position={toolbarPosition}
|
|
87
|
-
></pie-section-tools-toolbar>
|
|
88
|
-
{/if}
|
|
89
|
-
</div>
|
|
90
|
-
|
|
91
|
-
<style>
|
|
92
|
-
.pie-section-player__layout-shell {
|
|
93
|
-
display: flex;
|
|
94
|
-
width: 100%;
|
|
95
|
-
height: 100%;
|
|
96
|
-
min-height: 0;
|
|
97
|
-
overflow: hidden;
|
|
98
|
-
}
|
|
99
|
-
|
|
100
|
-
.pie-section-player__layout-shell--top,
|
|
101
|
-
.pie-section-player__layout-shell--bottom,
|
|
102
|
-
.pie-section-player__layout-shell--none {
|
|
103
|
-
flex-direction: column;
|
|
104
|
-
}
|
|
105
|
-
|
|
106
|
-
.pie-section-player__layout-shell--left,
|
|
107
|
-
.pie-section-player__layout-shell--right {
|
|
108
|
-
flex-direction: row;
|
|
109
|
-
}
|
|
110
|
-
|
|
111
|
-
.pie-section-player__vertical-layout {
|
|
112
|
-
display: flex;
|
|
113
|
-
flex-direction: column;
|
|
114
|
-
gap: 1.5rem;
|
|
115
|
-
padding: 1rem;
|
|
116
|
-
height: 100%;
|
|
117
|
-
flex: 1;
|
|
118
|
-
overflow-y: auto;
|
|
119
|
-
overflow-x: hidden;
|
|
120
|
-
/* Firefox auto-hide scrollbar */
|
|
121
|
-
scrollbar-width: auto;
|
|
122
|
-
scrollbar-color: transparent transparent;
|
|
123
|
-
}
|
|
124
|
-
|
|
125
|
-
.pie-section-player__vertical-layout--scrolling {
|
|
126
|
-
scrollbar-color: var(--pie-blue-grey-300, #c1c1c1) var(--pie-secondary-background, #f1f1f1);
|
|
127
|
-
}
|
|
128
|
-
|
|
129
|
-
.pie-section-player__passages-section {
|
|
130
|
-
display: flex;
|
|
131
|
-
flex-direction: column;
|
|
132
|
-
gap: 1.5rem;
|
|
133
|
-
}
|
|
134
|
-
|
|
135
|
-
.pie-section-player__items-section {
|
|
136
|
-
display: flex;
|
|
137
|
-
flex-direction: column;
|
|
138
|
-
gap: 1.5rem;
|
|
139
|
-
}
|
|
140
|
-
|
|
141
|
-
.pie-section-player__item-wrapper {
|
|
142
|
-
flex-shrink: 0;
|
|
143
|
-
}
|
|
144
|
-
|
|
145
|
-
.pie-section-player__passage-wrapper {
|
|
146
|
-
flex-shrink: 0;
|
|
147
|
-
}
|
|
148
|
-
|
|
149
|
-
.pie-section-player__item-wrapper,
|
|
150
|
-
.pie-section-player__passage-wrapper {
|
|
151
|
-
padding: 0.25rem;
|
|
152
|
-
background: var(--pie-white, white);
|
|
153
|
-
border: 1px solid var(--pie-border-light, #e5e7eb);
|
|
154
|
-
border-radius: 6px;
|
|
155
|
-
}
|
|
156
|
-
|
|
157
|
-
/* Responsive */
|
|
158
|
-
@media (max-width: 768px) {
|
|
159
|
-
.pie-section-player__vertical-layout {
|
|
160
|
-
padding: 0.5rem;
|
|
161
|
-
gap: 1rem;
|
|
162
|
-
}
|
|
163
|
-
|
|
164
|
-
.pie-section-player__items-section {
|
|
165
|
-
gap: 1rem;
|
|
166
|
-
}
|
|
167
|
-
}
|
|
168
|
-
|
|
169
|
-
/* Hide scrollbar by default - WebKit (Chrome, Safari, Edge) */
|
|
170
|
-
.pie-section-player__vertical-layout::-webkit-scrollbar {
|
|
171
|
-
width: 0px;
|
|
172
|
-
background: transparent;
|
|
173
|
-
}
|
|
174
|
-
|
|
175
|
-
/* Show scrollbar while scrolling */
|
|
176
|
-
.pie-section-player__vertical-layout--scrolling::-webkit-scrollbar {
|
|
177
|
-
width: 8px;
|
|
178
|
-
}
|
|
179
|
-
|
|
180
|
-
.pie-section-player__vertical-layout--scrolling::-webkit-scrollbar-track {
|
|
181
|
-
background: var(--pie-secondary-background, #f1f1f1);
|
|
182
|
-
border-radius: 4px;
|
|
183
|
-
}
|
|
184
|
-
|
|
185
|
-
.pie-section-player__vertical-layout--scrolling::-webkit-scrollbar-thumb {
|
|
186
|
-
background: var(--pie-blue-grey-300, #c1c1c1);
|
|
187
|
-
border-radius: 4px;
|
|
188
|
-
}
|
|
189
|
-
|
|
190
|
-
.pie-section-player__vertical-layout--scrolling::-webkit-scrollbar-thumb:hover {
|
|
191
|
-
background: var(--pie-blue-grey-600, #a1a1a1);
|
|
192
|
-
}
|
|
193
|
-
</style>
|