@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
|
@@ -0,0 +1,424 @@
|
|
|
1
|
+
<svelte:options
|
|
2
|
+
customElement={{
|
|
3
|
+
tag: "pie-section-player-vertical",
|
|
4
|
+
// Use light DOM so item-player/runtime styles can cascade into rendered item content.
|
|
5
|
+
shadow: "none",
|
|
6
|
+
props: {
|
|
7
|
+
assessmentId: { attribute: "assessment-id", type: "String" },
|
|
8
|
+
runtime: { type: "Object", reflect: false },
|
|
9
|
+
section: { type: "Object", reflect: false },
|
|
10
|
+
sectionId: { attribute: "section-id", type: "String" },
|
|
11
|
+
attemptId: { attribute: "attempt-id", type: "String" },
|
|
12
|
+
playerType: { attribute: "player-type", type: "String" },
|
|
13
|
+
player: { type: "Object", reflect: false },
|
|
14
|
+
lazyInit: { attribute: "lazy-init", type: "Boolean" },
|
|
15
|
+
tools: { type: "Object", reflect: false },
|
|
16
|
+
accessibility: { type: "Object", reflect: false },
|
|
17
|
+
coordinator: { type: "Object", reflect: false },
|
|
18
|
+
createSectionController: { type: "Object", reflect: false },
|
|
19
|
+
isolation: { attribute: "isolation", type: "String" },
|
|
20
|
+
env: { type: "Object", reflect: false },
|
|
21
|
+
iifeBundleHost: { attribute: "iife-bundle-host", type: "String" },
|
|
22
|
+
showToolbar: { attribute: "show-toolbar", type: "Boolean" },
|
|
23
|
+
toolbarPosition: { attribute: "toolbar-position", type: "String" },
|
|
24
|
+
enabledTools: { attribute: "enabled-tools", type: "String" },
|
|
25
|
+
itemToolbarTools: { attribute: "item-toolbar-tools", type: "String" },
|
|
26
|
+
passageToolbarTools: { attribute: "passage-toolbar-tools", type: "String" },
|
|
27
|
+
},
|
|
28
|
+
}}
|
|
29
|
+
/>
|
|
30
|
+
|
|
31
|
+
<script lang="ts">
|
|
32
|
+
import "./section-player-base-element.js";
|
|
33
|
+
import * as SectionItemCardModule from "./shared/SectionItemCard.svelte";
|
|
34
|
+
import * as SectionPassageCardModule from "./shared/SectionPassageCard.svelte";
|
|
35
|
+
import "@pie-players/pie-toolbars/components/section-toolbar-element";
|
|
36
|
+
import "@pie-players/pie-tool-calculator";
|
|
37
|
+
import "@pie-players/pie-tool-graph";
|
|
38
|
+
import "@pie-players/pie-tool-periodic-table";
|
|
39
|
+
import "@pie-players/pie-tool-protractor";
|
|
40
|
+
import "@pie-players/pie-tool-line-reader";
|
|
41
|
+
import "@pie-players/pie-tool-ruler";
|
|
42
|
+
import "@pie-players/pie-tool-theme";
|
|
43
|
+
import type { Component } from "svelte";
|
|
44
|
+
import type { SectionCompositionModel } from "../controllers/types.js";
|
|
45
|
+
import type { AssessmentSection } from "@pie-players/pie-players-shared/types";
|
|
46
|
+
import {
|
|
47
|
+
EMPTY_COMPOSITION,
|
|
48
|
+
} from "./shared/composition.js";
|
|
49
|
+
import { createPlayerAction } from "./shared/player-action.js";
|
|
50
|
+
import {
|
|
51
|
+
getRenderablesSignature,
|
|
52
|
+
orchestratePlayerElementPreload,
|
|
53
|
+
type PlayerPreloadState,
|
|
54
|
+
} from "./shared/player-preload.js";
|
|
55
|
+
import {
|
|
56
|
+
getCanonicalItemId,
|
|
57
|
+
getCompositionFromEvent,
|
|
58
|
+
getItemPlayerParams,
|
|
59
|
+
getPassagePlayerParams,
|
|
60
|
+
} from "./shared/section-player-view-state.js";
|
|
61
|
+
import {
|
|
62
|
+
mapRenderablesToItems,
|
|
63
|
+
resolveSectionPlayerRuntimeState,
|
|
64
|
+
type RuntimeConfig,
|
|
65
|
+
} from "./shared/section-player-runtime.js";
|
|
66
|
+
|
|
67
|
+
const SectionItemCard = (
|
|
68
|
+
SectionItemCardModule as unknown as { default: Component<any, any, any> }
|
|
69
|
+
).default;
|
|
70
|
+
const SectionPassageCard = (
|
|
71
|
+
SectionPassageCardModule as unknown as {
|
|
72
|
+
default: Component<any, any, any>;
|
|
73
|
+
}
|
|
74
|
+
).default;
|
|
75
|
+
|
|
76
|
+
let {
|
|
77
|
+
assessmentId,
|
|
78
|
+
runtime = null as RuntimeConfig | null,
|
|
79
|
+
section = null as AssessmentSection | null,
|
|
80
|
+
sectionId = "",
|
|
81
|
+
attemptId = "",
|
|
82
|
+
playerType,
|
|
83
|
+
player,
|
|
84
|
+
lazyInit,
|
|
85
|
+
tools,
|
|
86
|
+
accessibility,
|
|
87
|
+
coordinator,
|
|
88
|
+
createSectionController,
|
|
89
|
+
isolation,
|
|
90
|
+
env,
|
|
91
|
+
iifeBundleHost,
|
|
92
|
+
showToolbar = true,
|
|
93
|
+
toolbarPosition = "right",
|
|
94
|
+
enabledTools = "",
|
|
95
|
+
itemToolbarTools = "",
|
|
96
|
+
passageToolbarTools = "",
|
|
97
|
+
} = $props();
|
|
98
|
+
|
|
99
|
+
let compositionModel = $state<SectionCompositionModel>(EMPTY_COMPOSITION);
|
|
100
|
+
let elementsLoaded = $state(false);
|
|
101
|
+
let lastPreloadSignature = $state("");
|
|
102
|
+
let preloadRunToken = $state(0);
|
|
103
|
+
|
|
104
|
+
const passages = $derived(compositionModel.passages || []);
|
|
105
|
+
const items = $derived(compositionModel.items || []);
|
|
106
|
+
const shouldRenderToolbar = $derived(showToolbar && toolbarPosition !== "none");
|
|
107
|
+
const toolbarBeforeContent = $derived(
|
|
108
|
+
toolbarPosition === "top" || toolbarPosition === "left",
|
|
109
|
+
);
|
|
110
|
+
const toolbarInline = $derived(toolbarPosition === "left" || toolbarPosition === "right");
|
|
111
|
+
const preloadedRenderables = $derived.by(() =>
|
|
112
|
+
mapRenderablesToItems(compositionModel.renderables || []),
|
|
113
|
+
);
|
|
114
|
+
const preloadedRenderablesSignature = $derived.by(() =>
|
|
115
|
+
getRenderablesSignature(compositionModel.renderables || []),
|
|
116
|
+
);
|
|
117
|
+
const runtimeState = $derived.by(() =>
|
|
118
|
+
resolveSectionPlayerRuntimeState({
|
|
119
|
+
assessmentId,
|
|
120
|
+
playerType,
|
|
121
|
+
player,
|
|
122
|
+
lazyInit,
|
|
123
|
+
tools,
|
|
124
|
+
accessibility,
|
|
125
|
+
coordinator,
|
|
126
|
+
createSectionController,
|
|
127
|
+
isolation,
|
|
128
|
+
env,
|
|
129
|
+
runtime,
|
|
130
|
+
enabledTools,
|
|
131
|
+
itemToolbarTools,
|
|
132
|
+
passageToolbarTools,
|
|
133
|
+
}),
|
|
134
|
+
);
|
|
135
|
+
const effectiveRuntime = $derived(runtimeState.effectiveRuntime);
|
|
136
|
+
const playerRuntime = $derived(runtimeState.playerRuntime);
|
|
137
|
+
const resolvedPlayerDefinition = $derived(playerRuntime.resolvedPlayerDefinition);
|
|
138
|
+
const resolvedPlayerTag = $derived(playerRuntime.resolvedPlayerTag);
|
|
139
|
+
const resolvedPlayerAttributes = $derived(playerRuntime.resolvedPlayerAttributes);
|
|
140
|
+
const resolvedPlayerProps = $derived(playerRuntime.resolvedPlayerProps);
|
|
141
|
+
const resolvedPlayerEnv = $derived(playerRuntime.resolvedPlayerEnv);
|
|
142
|
+
const playerStrategy = $derived(playerRuntime.strategy);
|
|
143
|
+
const verticalPlayerAction = createPlayerAction({
|
|
144
|
+
stateKey: "__verticalAppliedParams",
|
|
145
|
+
includeSessionRefInState: false,
|
|
146
|
+
});
|
|
147
|
+
|
|
148
|
+
function handleBaseCompositionChanged(event: Event) {
|
|
149
|
+
compositionModel = getCompositionFromEvent(event);
|
|
150
|
+
}
|
|
151
|
+
|
|
152
|
+
$effect(() => {
|
|
153
|
+
resolvedPlayerDefinition?.ensureDefined?.().catch((error) => {
|
|
154
|
+
console.error("[pie-section-player-vertical] Failed to load item player component:", error);
|
|
155
|
+
});
|
|
156
|
+
});
|
|
157
|
+
|
|
158
|
+
$effect(() => {
|
|
159
|
+
orchestratePlayerElementPreload({
|
|
160
|
+
componentTag: "pie-section-player-vertical",
|
|
161
|
+
strategy: playerStrategy,
|
|
162
|
+
renderables: preloadedRenderables,
|
|
163
|
+
renderablesSignature: preloadedRenderablesSignature,
|
|
164
|
+
resolvedPlayerProps: resolvedPlayerProps as Record<string, unknown>,
|
|
165
|
+
resolvedPlayerEnv: resolvedPlayerEnv as Record<string, unknown>,
|
|
166
|
+
iifeBundleHost,
|
|
167
|
+
getState: () =>
|
|
168
|
+
({
|
|
169
|
+
lastPreloadSignature,
|
|
170
|
+
preloadRunToken,
|
|
171
|
+
elementsLoaded,
|
|
172
|
+
}) as PlayerPreloadState,
|
|
173
|
+
setState: (next) => {
|
|
174
|
+
if (next.lastPreloadSignature !== undefined) {
|
|
175
|
+
lastPreloadSignature = next.lastPreloadSignature;
|
|
176
|
+
}
|
|
177
|
+
if (next.preloadRunToken !== undefined) {
|
|
178
|
+
preloadRunToken = next.preloadRunToken;
|
|
179
|
+
}
|
|
180
|
+
if (next.elementsLoaded !== undefined) {
|
|
181
|
+
elementsLoaded = next.elementsLoaded;
|
|
182
|
+
}
|
|
183
|
+
},
|
|
184
|
+
});
|
|
185
|
+
});
|
|
186
|
+
|
|
187
|
+
</script>
|
|
188
|
+
|
|
189
|
+
<pie-section-player-base
|
|
190
|
+
runtime={effectiveRuntime}
|
|
191
|
+
{section}
|
|
192
|
+
section-id={sectionId}
|
|
193
|
+
attempt-id={attemptId}
|
|
194
|
+
oncomposition-changed={handleBaseCompositionChanged}
|
|
195
|
+
>
|
|
196
|
+
<div
|
|
197
|
+
class={`pie-section-player-shell pie-section-player-shell--${toolbarPosition}`}
|
|
198
|
+
>
|
|
199
|
+
{#if shouldRenderToolbar && toolbarBeforeContent}
|
|
200
|
+
<pie-section-toolbar
|
|
201
|
+
class={`pie-section-player-toolbar pie-section-player-toolbar--${toolbarPosition}`}
|
|
202
|
+
position={toolbarPosition}
|
|
203
|
+
enabled-tools={enabledTools}
|
|
204
|
+
></pie-section-toolbar>
|
|
205
|
+
{/if}
|
|
206
|
+
|
|
207
|
+
<div
|
|
208
|
+
class={`pie-section-player-layout-body ${toolbarInline ? "pie-section-player-layout-body--inline" : ""}`}
|
|
209
|
+
>
|
|
210
|
+
<div class="pie-section-player-vertical-content">
|
|
211
|
+
{#if !elementsLoaded}
|
|
212
|
+
<div class="pie-section-player-content-card">
|
|
213
|
+
<div
|
|
214
|
+
class="pie-section-player-content-card-body pie-section-player-item-content pie-section-player__item-content"
|
|
215
|
+
>
|
|
216
|
+
Loading section content...
|
|
217
|
+
</div>
|
|
218
|
+
</div>
|
|
219
|
+
{:else}
|
|
220
|
+
{#if passages.length > 0}
|
|
221
|
+
<section class="pie-section-player-passages-section" aria-label="Passages">
|
|
222
|
+
{#each passages as passage, passageIndex (passage.id || passageIndex)}
|
|
223
|
+
<SectionPassageCard
|
|
224
|
+
{passage}
|
|
225
|
+
{resolvedPlayerTag}
|
|
226
|
+
playerAction={verticalPlayerAction}
|
|
227
|
+
playerParams={getPassagePlayerParams({
|
|
228
|
+
passage,
|
|
229
|
+
resolvedPlayerEnv,
|
|
230
|
+
resolvedPlayerAttributes,
|
|
231
|
+
resolvedPlayerProps,
|
|
232
|
+
playerStrategy,
|
|
233
|
+
})}
|
|
234
|
+
{passageToolbarTools}
|
|
235
|
+
/>
|
|
236
|
+
{/each}
|
|
237
|
+
</section>
|
|
238
|
+
{/if}
|
|
239
|
+
|
|
240
|
+
<section class="pie-section-player-items-section" aria-label="Items">
|
|
241
|
+
{#each items as item, itemIndex (item.id || itemIndex)}
|
|
242
|
+
<SectionItemCard
|
|
243
|
+
{item}
|
|
244
|
+
canonicalItemId={getCanonicalItemId({ compositionModel, item })}
|
|
245
|
+
{resolvedPlayerTag}
|
|
246
|
+
playerAction={verticalPlayerAction}
|
|
247
|
+
playerParams={getItemPlayerParams({
|
|
248
|
+
item,
|
|
249
|
+
compositionModel,
|
|
250
|
+
resolvedPlayerEnv,
|
|
251
|
+
resolvedPlayerAttributes,
|
|
252
|
+
resolvedPlayerProps,
|
|
253
|
+
playerStrategy,
|
|
254
|
+
})}
|
|
255
|
+
{itemToolbarTools}
|
|
256
|
+
/>
|
|
257
|
+
{/each}
|
|
258
|
+
</section>
|
|
259
|
+
{/if}
|
|
260
|
+
</div>
|
|
261
|
+
|
|
262
|
+
{#if shouldRenderToolbar && toolbarInline && toolbarPosition === "right"}
|
|
263
|
+
<aside
|
|
264
|
+
class="pie-section-player-toolbar-pane pie-section-player-toolbar-pane--right"
|
|
265
|
+
aria-label="Section tools"
|
|
266
|
+
>
|
|
267
|
+
<pie-section-toolbar
|
|
268
|
+
position="right"
|
|
269
|
+
enabled-tools={enabledTools}
|
|
270
|
+
></pie-section-toolbar>
|
|
271
|
+
</aside>
|
|
272
|
+
{/if}
|
|
273
|
+
|
|
274
|
+
{#if shouldRenderToolbar && toolbarInline && toolbarPosition === "left"}
|
|
275
|
+
<aside
|
|
276
|
+
class="pie-section-player-toolbar-pane pie-section-player-toolbar-pane--left"
|
|
277
|
+
aria-label="Section tools"
|
|
278
|
+
>
|
|
279
|
+
<pie-section-toolbar
|
|
280
|
+
position="left"
|
|
281
|
+
enabled-tools={enabledTools}
|
|
282
|
+
></pie-section-toolbar>
|
|
283
|
+
</aside>
|
|
284
|
+
{/if}
|
|
285
|
+
</div>
|
|
286
|
+
|
|
287
|
+
{#if shouldRenderToolbar && !toolbarBeforeContent && !toolbarInline}
|
|
288
|
+
<pie-section-toolbar
|
|
289
|
+
class={`pie-section-player-toolbar pie-section-player-toolbar--${toolbarPosition}`}
|
|
290
|
+
position={toolbarPosition}
|
|
291
|
+
enabled-tools={enabledTools}
|
|
292
|
+
></pie-section-toolbar>
|
|
293
|
+
{/if}
|
|
294
|
+
</div>
|
|
295
|
+
</pie-section-player-base>
|
|
296
|
+
|
|
297
|
+
<style>
|
|
298
|
+
:host {
|
|
299
|
+
display: block;
|
|
300
|
+
width: 100%;
|
|
301
|
+
height: 100%;
|
|
302
|
+
min-height: 0;
|
|
303
|
+
max-height: 100%;
|
|
304
|
+
overflow: hidden;
|
|
305
|
+
}
|
|
306
|
+
|
|
307
|
+
.pie-section-player-shell {
|
|
308
|
+
display: flex;
|
|
309
|
+
flex-direction: column;
|
|
310
|
+
height: 100%;
|
|
311
|
+
min-height: 0;
|
|
312
|
+
overflow: hidden;
|
|
313
|
+
background: var(--pie-background-dark, #ecedf1);
|
|
314
|
+
}
|
|
315
|
+
|
|
316
|
+
.pie-section-player-shell--left,
|
|
317
|
+
.pie-section-player-shell--right {
|
|
318
|
+
flex-direction: row;
|
|
319
|
+
}
|
|
320
|
+
|
|
321
|
+
.pie-section-player-shell--left .pie-section-player-layout-body--inline {
|
|
322
|
+
order: 2;
|
|
323
|
+
}
|
|
324
|
+
|
|
325
|
+
.pie-section-player-shell--left .pie-section-player-toolbar-pane--left {
|
|
326
|
+
order: 1;
|
|
327
|
+
}
|
|
328
|
+
|
|
329
|
+
.pie-section-player-layout-body {
|
|
330
|
+
display: grid;
|
|
331
|
+
grid-template-columns: minmax(0, 1fr);
|
|
332
|
+
flex: 1;
|
|
333
|
+
min-height: 0;
|
|
334
|
+
overflow: hidden;
|
|
335
|
+
background: var(--pie-background-dark, #ecedf1);
|
|
336
|
+
}
|
|
337
|
+
|
|
338
|
+
.pie-section-player-layout-body--inline {
|
|
339
|
+
grid-template-columns: minmax(0, 1fr) auto;
|
|
340
|
+
gap: 1rem;
|
|
341
|
+
}
|
|
342
|
+
|
|
343
|
+
.pie-section-player-vertical-content {
|
|
344
|
+
height: 100%;
|
|
345
|
+
max-height: 100%;
|
|
346
|
+
min-height: 0;
|
|
347
|
+
min-width: 0;
|
|
348
|
+
overflow-y: auto;
|
|
349
|
+
overflow-x: hidden;
|
|
350
|
+
overscroll-behavior: contain;
|
|
351
|
+
display: flex;
|
|
352
|
+
flex-direction: column;
|
|
353
|
+
gap: 1rem;
|
|
354
|
+
padding: 0.5rem;
|
|
355
|
+
box-sizing: border-box;
|
|
356
|
+
background: var(--pie-background-dark, #ecedf1);
|
|
357
|
+
}
|
|
358
|
+
|
|
359
|
+
.pie-section-player-passages-section,
|
|
360
|
+
.pie-section-player-items-section {
|
|
361
|
+
display: flex;
|
|
362
|
+
flex-direction: column;
|
|
363
|
+
gap: 1rem;
|
|
364
|
+
}
|
|
365
|
+
|
|
366
|
+
.pie-section-player-toolbar-pane {
|
|
367
|
+
min-height: 0;
|
|
368
|
+
overflow: auto;
|
|
369
|
+
padding: 0.5rem;
|
|
370
|
+
box-sizing: border-box;
|
|
371
|
+
background: var(--pie-background-dark, #ecedf1);
|
|
372
|
+
}
|
|
373
|
+
|
|
374
|
+
.pie-section-player-toolbar-pane--right {
|
|
375
|
+
border-left: 1px solid var(--pie-border-light, #e5e7eb);
|
|
376
|
+
}
|
|
377
|
+
|
|
378
|
+
.pie-section-player-toolbar-pane--left {
|
|
379
|
+
border-right: 1px solid var(--pie-border-light, #e5e7eb);
|
|
380
|
+
}
|
|
381
|
+
|
|
382
|
+
.pie-section-player-toolbar {
|
|
383
|
+
margin: 0.5rem;
|
|
384
|
+
}
|
|
385
|
+
|
|
386
|
+
.pie-section-player-toolbar-pane pie-section-toolbar {
|
|
387
|
+
margin: 0.5rem;
|
|
388
|
+
}
|
|
389
|
+
|
|
390
|
+
.pie-section-player-content-card {
|
|
391
|
+
border: 1px solid var(--pie-border-light, #e5e7eb);
|
|
392
|
+
border-radius: 8px;
|
|
393
|
+
background: var(--pie-background, #fff);
|
|
394
|
+
}
|
|
395
|
+
|
|
396
|
+
.pie-section-player-content-card-header {
|
|
397
|
+
display: flex;
|
|
398
|
+
align-items: center;
|
|
399
|
+
justify-content: space-between;
|
|
400
|
+
padding: 0.75rem 1rem;
|
|
401
|
+
border-bottom: 1px solid var(--pie-border-light, #e5e7eb);
|
|
402
|
+
}
|
|
403
|
+
|
|
404
|
+
.pie-section-player-content-card-body {
|
|
405
|
+
padding: 1rem;
|
|
406
|
+
}
|
|
407
|
+
|
|
408
|
+
@media (max-width: 1100px) {
|
|
409
|
+
.pie-section-player-shell--left,
|
|
410
|
+
.pie-section-player-shell--right {
|
|
411
|
+
flex-direction: column;
|
|
412
|
+
}
|
|
413
|
+
|
|
414
|
+
.pie-section-player-layout-body--inline {
|
|
415
|
+
grid-template-columns: 1fr;
|
|
416
|
+
}
|
|
417
|
+
|
|
418
|
+
.pie-section-player-toolbar-pane--left,
|
|
419
|
+
.pie-section-player-toolbar-pane--right {
|
|
420
|
+
border: none;
|
|
421
|
+
padding: 0;
|
|
422
|
+
}
|
|
423
|
+
}
|
|
424
|
+
</style>
|
|
@@ -0,0 +1,92 @@
|
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
import "../item-shell-element.js";
|
|
3
|
+
import "@pie-players/pie-toolbars/components/item-toolbar-element";
|
|
4
|
+
import type { ItemEntity } from "@pie-players/pie-players-shared/types";
|
|
5
|
+
import { getEntityTitle } from "./composition.js";
|
|
6
|
+
import type { PlayerElementParams } from "./player-action.js";
|
|
7
|
+
|
|
8
|
+
let {
|
|
9
|
+
item,
|
|
10
|
+
canonicalItemId,
|
|
11
|
+
resolvedPlayerTag,
|
|
12
|
+
playerAction,
|
|
13
|
+
playerParams,
|
|
14
|
+
itemToolbarTools,
|
|
15
|
+
} = $props<{
|
|
16
|
+
item: ItemEntity;
|
|
17
|
+
canonicalItemId: string;
|
|
18
|
+
resolvedPlayerTag: string;
|
|
19
|
+
playerAction: (node: HTMLElement, params: PlayerElementParams) => unknown;
|
|
20
|
+
playerParams: PlayerElementParams;
|
|
21
|
+
itemToolbarTools: string;
|
|
22
|
+
}>();
|
|
23
|
+
</script>
|
|
24
|
+
|
|
25
|
+
<pie-item-shell
|
|
26
|
+
item-id={item.id}
|
|
27
|
+
canonical-item-id={canonicalItemId}
|
|
28
|
+
content-kind="assessment-item"
|
|
29
|
+
item={item}
|
|
30
|
+
>
|
|
31
|
+
<div class="pie-section-player-content-card">
|
|
32
|
+
<div
|
|
33
|
+
class="pie-section-player-content-card-header pie-section-player-item-header pie-section-player__item-header"
|
|
34
|
+
data-region="header"
|
|
35
|
+
>
|
|
36
|
+
{#if getEntityTitle(item)}
|
|
37
|
+
<h2>{getEntityTitle(item)}</h2>
|
|
38
|
+
{/if}
|
|
39
|
+
<pie-item-toolbar
|
|
40
|
+
item-id={item.id}
|
|
41
|
+
catalog-id={item.id}
|
|
42
|
+
tools={itemToolbarTools}
|
|
43
|
+
content-kind="assessment-item"
|
|
44
|
+
size="md"
|
|
45
|
+
language="en-US"
|
|
46
|
+
></pie-item-toolbar>
|
|
47
|
+
</div>
|
|
48
|
+
<div
|
|
49
|
+
class="pie-section-player-content-card-body pie-section-player-item-content pie-section-player__item-content"
|
|
50
|
+
data-region="content"
|
|
51
|
+
>
|
|
52
|
+
<svelte:element
|
|
53
|
+
this={resolvedPlayerTag}
|
|
54
|
+
use:playerAction={playerParams}
|
|
55
|
+
></svelte:element>
|
|
56
|
+
</div>
|
|
57
|
+
<div data-region="footer"></div>
|
|
58
|
+
</div>
|
|
59
|
+
</pie-item-shell>
|
|
60
|
+
|
|
61
|
+
<style>
|
|
62
|
+
.pie-section-player-content-card {
|
|
63
|
+
border: 1px solid var(--pie-border-light, #e5e7eb);
|
|
64
|
+
border-radius: 8px;
|
|
65
|
+
background: var(--pie-background, #fff);
|
|
66
|
+
color: var(--pie-text, #111827);
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
.pie-section-player-content-card-header {
|
|
70
|
+
display: flex;
|
|
71
|
+
align-items: center;
|
|
72
|
+
gap: 0.75rem;
|
|
73
|
+
padding: 0.75rem 1rem;
|
|
74
|
+
border-bottom: 1px solid var(--pie-border-light, #e5e7eb);
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
.pie-section-player-content-card-header h2 {
|
|
78
|
+
margin: 0;
|
|
79
|
+
font-size: 0.95rem;
|
|
80
|
+
font-weight: 600;
|
|
81
|
+
color: var(--pie-text, #111827);
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
.pie-section-player-content-card-header pie-item-toolbar {
|
|
85
|
+
margin-left: auto;
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
.pie-section-player-content-card-body {
|
|
89
|
+
padding: 1rem;
|
|
90
|
+
color: var(--pie-text, #111827);
|
|
91
|
+
}
|
|
92
|
+
</style>
|
|
@@ -0,0 +1,88 @@
|
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
import "../passage-shell-element.js";
|
|
3
|
+
import "@pie-players/pie-toolbars/components/item-toolbar-element";
|
|
4
|
+
import { getEntityTitle } from "./composition.js";
|
|
5
|
+
import type { PassageEntity } from "@pie-players/pie-players-shared/types";
|
|
6
|
+
import type { PlayerElementParams } from "./player-action.js";
|
|
7
|
+
|
|
8
|
+
let {
|
|
9
|
+
passage,
|
|
10
|
+
resolvedPlayerTag,
|
|
11
|
+
playerAction,
|
|
12
|
+
playerParams,
|
|
13
|
+
passageToolbarTools,
|
|
14
|
+
} = $props<{
|
|
15
|
+
passage: PassageEntity;
|
|
16
|
+
resolvedPlayerTag: string;
|
|
17
|
+
playerAction: (node: HTMLElement, params: PlayerElementParams) => unknown;
|
|
18
|
+
playerParams: PlayerElementParams;
|
|
19
|
+
passageToolbarTools: string;
|
|
20
|
+
}>();
|
|
21
|
+
</script>
|
|
22
|
+
|
|
23
|
+
<pie-passage-shell
|
|
24
|
+
item-id={passage.id}
|
|
25
|
+
content-kind="rubric-block-stimulus"
|
|
26
|
+
item={passage}
|
|
27
|
+
>
|
|
28
|
+
<div class="pie-section-player-content-card">
|
|
29
|
+
<div
|
|
30
|
+
class="pie-section-player-content-card-header pie-section-player-passage-header pie-section-player__passage-header"
|
|
31
|
+
data-region="header"
|
|
32
|
+
>
|
|
33
|
+
{#if getEntityTitle(passage)}
|
|
34
|
+
<h2>{getEntityTitle(passage)}</h2>
|
|
35
|
+
{/if}
|
|
36
|
+
<pie-item-toolbar
|
|
37
|
+
item-id={passage.id}
|
|
38
|
+
catalog-id={passage.id}
|
|
39
|
+
tools={passageToolbarTools}
|
|
40
|
+
content-kind="rubric-block-stimulus"
|
|
41
|
+
size="md"
|
|
42
|
+
language="en-US"
|
|
43
|
+
></pie-item-toolbar>
|
|
44
|
+
</div>
|
|
45
|
+
<div
|
|
46
|
+
class="pie-section-player-content-card-body pie-section-player-passage-content pie-section-player__passage-content"
|
|
47
|
+
data-region="content"
|
|
48
|
+
>
|
|
49
|
+
<svelte:element
|
|
50
|
+
this={resolvedPlayerTag}
|
|
51
|
+
use:playerAction={playerParams}
|
|
52
|
+
></svelte:element>
|
|
53
|
+
</div>
|
|
54
|
+
</div>
|
|
55
|
+
</pie-passage-shell>
|
|
56
|
+
|
|
57
|
+
<style>
|
|
58
|
+
.pie-section-player-content-card {
|
|
59
|
+
border: 1px solid var(--pie-border-light, #e5e7eb);
|
|
60
|
+
border-radius: 8px;
|
|
61
|
+
background: var(--pie-background, #fff);
|
|
62
|
+
color: var(--pie-text, #111827);
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
.pie-section-player-content-card-header {
|
|
66
|
+
display: flex;
|
|
67
|
+
align-items: center;
|
|
68
|
+
gap: 0.75rem;
|
|
69
|
+
padding: 0.75rem 1rem;
|
|
70
|
+
border-bottom: 1px solid var(--pie-border-light, #e5e7eb);
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
.pie-section-player-content-card-header h2 {
|
|
74
|
+
margin: 0;
|
|
75
|
+
font-size: 0.95rem;
|
|
76
|
+
font-weight: 600;
|
|
77
|
+
color: var(--pie-text, #111827);
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
.pie-section-player-content-card-header pie-item-toolbar {
|
|
81
|
+
margin-left: auto;
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
.pie-section-player-content-card-body {
|
|
85
|
+
padding: 1rem;
|
|
86
|
+
color: var(--pie-text, #111827);
|
|
87
|
+
}
|
|
88
|
+
</style>
|