@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.
Files changed (62) hide show
  1. package/README.md +28 -568
  2. package/dist/component-definitions.d.ts +0 -3
  3. package/dist/component-definitions.d.ts.map +1 -1
  4. package/dist/components/section-player-vertical-element.d.ts +2 -0
  5. package/dist/components/section-player-vertical-element.d.ts.map +1 -0
  6. package/dist/components/shared/composition.d.ts +9 -0
  7. package/dist/components/shared/composition.d.ts.map +1 -0
  8. package/dist/components/shared/player-action.d.ts +18 -0
  9. package/dist/components/shared/player-action.d.ts.map +1 -0
  10. package/dist/components/shared/player-preload.d.ts +37 -0
  11. package/dist/components/shared/player-preload.d.ts.map +1 -0
  12. package/dist/components/shared/section-player-runtime.d.ts +104 -0
  13. package/dist/components/shared/section-player-runtime.d.ts.map +1 -0
  14. package/dist/components/shared/section-player-view-state.d.ts +24 -0
  15. package/dist/components/shared/section-player-view-state.d.ts.map +1 -0
  16. package/dist/controllers/SectionContentService.d.ts.map +1 -1
  17. package/dist/controllers/SectionController.d.ts +5 -1
  18. package/dist/controllers/SectionController.d.ts.map +1 -1
  19. package/dist/controllers/SectionSessionService.d.ts +0 -1
  20. package/dist/controllers/SectionSessionService.d.ts.map +1 -1
  21. package/dist/controllers/toolkit-section-contracts.d.ts +2 -28
  22. package/dist/controllers/toolkit-section-contracts.d.ts.map +1 -1
  23. package/dist/controllers/types.d.ts +28 -1
  24. package/dist/controllers/types.d.ts.map +1 -1
  25. package/dist/pie-item-player-B1iGN63e.js +6189 -0
  26. package/dist/pie-section-player.d.ts +0 -8
  27. package/dist/pie-section-player.d.ts.map +1 -1
  28. package/dist/pie-section-player.js +56558 -11
  29. package/dist/player-preload-CQVG0Bih.js +705 -0
  30. package/dist/utils/player-preload.d.ts +2 -0
  31. package/dist/utils/player-preload.d.ts.map +1 -0
  32. package/dist/utils/player-preload.js +8 -0
  33. package/package.json +23 -32
  34. package/src/components/ItemShellElement.svelte +10 -1
  35. package/src/components/PieSectionPlayerBaseElement.svelte +21 -78
  36. package/src/components/PieSectionPlayerSplitPaneElement.svelte +236 -295
  37. package/src/components/PieSectionPlayerVerticalElement.svelte +424 -0
  38. package/src/components/shared/SectionItemCard.svelte +92 -0
  39. package/src/components/shared/SectionPassageCard.svelte +88 -0
  40. package/dist/ItemRenderer-MsjF_Beu.js +0 -467
  41. package/dist/PieItemModeLayoutElement-D7oTzA9T.js +0 -316
  42. package/dist/PieSplitPanelLayoutElement-GUtJ_NlF.js +0 -246
  43. package/dist/PieVerticalLayoutElement-BoA3FO5g.js +0 -194
  44. package/dist/controllers/SectionToolkitService.d.ts +0 -24
  45. package/dist/controllers/SectionToolkitService.d.ts.map +0 -1
  46. package/dist/controllers/SessionPersistenceStrategy.d.ts +0 -15
  47. package/dist/controllers/SessionPersistenceStrategy.d.ts.map +0 -1
  48. package/dist/index.d.ts +0 -2
  49. package/dist/pie-section-player-DJ5NcwdT.js +0 -17078
  50. package/dist/runtime/runtime-event-guards.d.ts +0 -4
  51. package/dist/runtime/runtime-event-guards.d.ts.map +0 -1
  52. package/src/PieSectionPlayer.svelte +0 -826
  53. package/src/components/ItemModeLayout.svelte +0 -172
  54. package/src/components/ItemNavigation.svelte +0 -96
  55. package/src/components/ItemPlayerBridge.svelte +0 -110
  56. package/src/components/ItemRenderer.svelte +0 -248
  57. package/src/components/ItemShell.svelte +0 -86
  58. package/src/components/layout-elements/PieItemModeLayoutElement.svelte +0 -47
  59. package/src/components/layout-elements/PieSplitPanelLayoutElement.svelte +0 -62
  60. package/src/components/layout-elements/PieVerticalLayoutElement.svelte +0 -41
  61. package/src/components/layouts/SplitPanelLayout.svelte +0 -385
  62. package/src/components/layouts/VerticalLayout.svelte +0 -193
@@ -1,316 +0,0 @@
1
- import { p as O, a as G, b as r, f as g, c as I, d as P, t as B, B as D, k as _, l as R, n as i, r as y, C as ie, x as se, y as z, i as q, g as t, o as v, v as ae, z as N, e as le } from "./pie-section-player-DJ5NcwdT.js";
2
- import { I as F } from "./ItemRenderer-MsjF_Beu.js";
3
- var ce = g('<div class="pie-section-player__item-navigation svelte-1qbjn8v"><button type="button" class="pie-section-player__nav-button pie-section-player__nav-button--previous svelte-1qbjn8v">Previous</button> <span class="pie-section-player__item-counter svelte-1qbjn8v"> </span> <button type="button" class="pie-section-player__nav-button pie-section-player__nav-button--next svelte-1qbjn8v">Next</button></div>');
4
- const pe = {
5
- hash: "svelte-1qbjn8v",
6
- code: `.pie-section-player__item-navigation.svelte-1qbjn8v {display:flex;justify-content:space-between;align-items:center;padding:1rem;background:var(--pie-secondary-background, #f9f9f9);border-top:1px solid var(--pie-border-light, #e0e0e0);gap:1rem;}.pie-section-player__nav-button.svelte-1qbjn8v {padding:0.5rem 1rem;background:var(--pie-primary, #007bff);color:var(--pie-white, white);border:none;border-radius:4px;cursor:pointer;font-size:0.9rem;transition:background 0.2s;min-width:100px;}.pie-section-player__nav-button.svelte-1qbjn8v:hover:not(:disabled) {background:var(--pie-primary-dark, #0056b3);}.pie-section-player__nav-button.svelte-1qbjn8v:disabled {background:var(--pie-disabled-secondary, #ccc);cursor:not-allowed;opacity:0.6;}.pie-section-player__item-counter.svelte-1qbjn8v {font-size:0.9rem;color:var(--pie-disabled, #666);font-weight:500;}
7
-
8
- /* Responsive */
9
- @media (max-width: 768px) {.pie-section-player__item-navigation.svelte-1qbjn8v {flex-direction:column;}.pie-section-player__nav-button.svelte-1qbjn8v {width:100%;}
10
- }`
11
- };
12
- function H(x, o) {
13
- O(o, !0), G(x, pe);
14
- let c = r(o, "currentIndex", 7), p = r(o, "totalItems", 7), l = r(o, "canNext", 7), d = r(o, "canPrevious", 7), u = r(o, "onprevious", 7), b = r(o, "onnext", 7);
15
- var h = {
16
- get currentIndex() {
17
- return c();
18
- },
19
- set currentIndex(s) {
20
- c(s), i();
21
- },
22
- get totalItems() {
23
- return p();
24
- },
25
- set totalItems(s) {
26
- p(s), i();
27
- },
28
- get canNext() {
29
- return l();
30
- },
31
- set canNext(s) {
32
- l(s), i();
33
- },
34
- get canPrevious() {
35
- return d();
36
- },
37
- set canPrevious(s) {
38
- d(s), i();
39
- },
40
- get onprevious() {
41
- return u();
42
- },
43
- set onprevious(s) {
44
- u(s), i();
45
- },
46
- get onnext() {
47
- return b();
48
- },
49
- set onnext(s) {
50
- b(s), i();
51
- }
52
- }, n = ce(), m = P(n), f = I(m, 2), w = P(f);
53
- y(f);
54
- var k = I(f, 2);
55
- return y(n), B(() => {
56
- m.disabled = !d(), ie(w, `${c() + 1} / ${p() ?? ""}`), k.disabled = !l();
57
- }), D("click", m, function(...s) {
58
- u()?.apply(this, s);
59
- }), D("click", k, function(...s) {
60
- b()?.apply(this, s);
61
- }), _(x, n), R(h);
62
- }
63
- se(["click"]);
64
- z(
65
- H,
66
- {
67
- currentIndex: {},
68
- totalItems: {},
69
- canNext: {},
70
- canPrevious: {},
71
- onprevious: {},
72
- onnext: {}
73
- },
74
- [],
75
- [],
76
- { mode: "open" }
77
- );
78
- var ve = g("<pie-section-tools-toolbar></pie-section-tools-toolbar>", 2), de = g('<div class="pie-section-player__passage-wrapper svelte-1sxbnc2"><!></div>'), ue = g('<div class="pie-section-player__passages-section svelte-1sxbnc2"></div>'), be = g('<div class="pie-section-player__current-item-section svelte-1sxbnc2"><!></div>'), me = g('<div class="pie-section-player__no-item svelte-1sxbnc2"><p>No item to display</p></div>'), _e = g("<pie-section-tools-toolbar></pie-section-tools-toolbar>", 2), ge = g('<div><!> <div class="pie-section-player__item-mode-layout svelte-1sxbnc2"><!> <!> <!></div> <!></div>');
79
- const xe = {
80
- hash: "svelte-1sxbnc2",
81
- code: `.pie-section-player__layout-shell.svelte-1sxbnc2 {display:flex;width:100%;height:100%;min-height:0;overflow:hidden;}.pie-section-player__layout-shell--top.svelte-1sxbnc2,
82
- .pie-section-player__layout-shell--bottom.svelte-1sxbnc2,
83
- .pie-section-player__layout-shell--none.svelte-1sxbnc2 {flex-direction:column;}.pie-section-player__layout-shell--left.svelte-1sxbnc2,
84
- .pie-section-player__layout-shell--right.svelte-1sxbnc2 {flex-direction:row;}.pie-section-player__item-mode-layout.svelte-1sxbnc2 {flex:1;display:flex;flex-direction:column;gap:1.5rem;padding:1rem;overflow-y:auto;}.pie-section-player__passages-section.svelte-1sxbnc2 {display:flex;flex-direction:column;gap:1rem;}.pie-section-player__passages-section.svelte-1sxbnc2 .pie-section-player__passage-item {padding:0;background:transparent;border:0;border-radius:0;}.pie-section-player__passage-wrapper.svelte-1sxbnc2 {flex-shrink:0;padding:0.25rem;background:var(--pie-white, white);border:1px solid var(--pie-border-light, #e5e7eb);border-radius:6px;}.pie-section-player__current-item-section.svelte-1sxbnc2 {padding:0.25rem;background:var(--pie-white, white);border:1px solid var(--pie-border-light, #e5e7eb);border-radius:6px;min-height:300px;}.pie-section-player__no-item.svelte-1sxbnc2 {padding:2rem;text-align:center;color:var(--pie-disabled-secondary, #999);}
85
-
86
- /* Responsive */
87
- @media (max-width: 768px) {.pie-section-player__item-mode-layout.svelte-1sxbnc2 {gap:1rem;}
88
- }`
89
- };
90
- function J(x, o) {
91
- O(o, !0), G(x, xe);
92
- let c = r(o, "composition", 7), p = r(o, "env", 23, () => ({ mode: "gather", role: "student" })), l = r(o, "toolbarPosition", 7, "right"), d = r(o, "showToolbar", 7, !0), u = r(o, "onprevious", 7), b = r(o, "onnext", 7), h = v(() => c()?.passages || []), n = v(() => c()?.items || []), m = v(() => c()?.currentItemIndex || 0), f = v(() => t(n).length), w = v(() => c()?.currentItem || t(n)[t(m)] || null), k = v(() => c()?.itemSessionsByItemId || {}), s = v(() => t(w)?.id ? t(k)[t(w).id] : void 0), Q = v(() => t(m) > 0), U = v(() => t(m) < t(f) - 1), E = v(() => d() && l() !== "none"), K = v(() => l() === "top" || l() === "left");
93
- var V = {
94
- get composition() {
95
- return c();
96
- },
97
- set composition(e) {
98
- c(e), i();
99
- },
100
- get env() {
101
- return p();
102
- },
103
- set env(e = { mode: "gather", role: "student" }) {
104
- p(e), i();
105
- },
106
- get toolbarPosition() {
107
- return l();
108
- },
109
- set toolbarPosition(e = "right") {
110
- l(e), i();
111
- },
112
- get showToolbar() {
113
- return d();
114
- },
115
- set showToolbar(e = !0) {
116
- d(e), i();
117
- },
118
- get onprevious() {
119
- return u();
120
- },
121
- set onprevious(e) {
122
- u(e), i();
123
- },
124
- get onnext() {
125
- return b();
126
- },
127
- set onnext(e) {
128
- b(e), i();
129
- }
130
- }, T = ge(), L = P(T);
131
- {
132
- var W = (e) => {
133
- var a = ve();
134
- B(() => N(a, "position", l())), N(a, "enabled-tools", ""), _(e, a);
135
- };
136
- q(L, (e) => {
137
- t(E) && t(K) && e(W);
138
- });
139
- }
140
- var S = I(L, 2), M = P(S);
141
- {
142
- var X = (e) => {
143
- var a = ue();
144
- le(a, 21, () => t(h), (j) => j.id, (j, oe) => {
145
- var C = de(), ne = P(C);
146
- {
147
- let re = v(() => ({ mode: "view", role: p().role }));
148
- F(ne, {
149
- get item() {
150
- return t(oe);
151
- },
152
- contentKind: "rubric-block-stimulus",
153
- get env() {
154
- return t(re);
155
- },
156
- customClassName: "pie-section-player__passage-item"
157
- });
158
- }
159
- y(C), _(j, C);
160
- }), y(a), _(e, a);
161
- };
162
- q(M, (e) => {
163
- t(h).length > 0 && e(X);
164
- });
165
- }
166
- var A = I(M, 2);
167
- {
168
- var Y = (e) => {
169
- var a = be(), j = P(a);
170
- F(j, {
171
- get item() {
172
- return t(w);
173
- },
174
- contentKind: "assessment-item",
175
- get env() {
176
- return p();
177
- },
178
- get session() {
179
- return t(s);
180
- },
181
- customClassName: "pie-section-player__item-content"
182
- }), y(a), _(e, a);
183
- }, Z = (e) => {
184
- var a = me();
185
- _(e, a);
186
- };
187
- q(A, (e) => {
188
- t(w) ? e(Y) : e(Z, !1);
189
- });
190
- }
191
- var $ = I(A, 2);
192
- H($, {
193
- get currentIndex() {
194
- return t(m);
195
- },
196
- get totalItems() {
197
- return t(f);
198
- },
199
- get canNext() {
200
- return t(U);
201
- },
202
- get canPrevious() {
203
- return t(Q);
204
- },
205
- get onprevious() {
206
- return u();
207
- },
208
- get onnext() {
209
- return b();
210
- }
211
- }), y(S);
212
- var ee = I(S, 2);
213
- {
214
- var te = (e) => {
215
- var a = _e();
216
- B(() => N(a, "position", l())), N(a, "enabled-tools", ""), _(e, a);
217
- };
218
- q(ee, (e) => {
219
- t(E) && !t(K) && e(te);
220
- });
221
- }
222
- return y(T), B(() => ae(T, 1, `pie-section-player__layout-shell pie-section-player__layout-shell--${l()}`, "svelte-1sxbnc2")), _(x, T), R(V);
223
- }
224
- z(
225
- J,
226
- {
227
- composition: {},
228
- env: {},
229
- toolbarPosition: {},
230
- showToolbar: {},
231
- onprevious: {},
232
- onnext: {}
233
- },
234
- [],
235
- [],
236
- { mode: "open" }
237
- );
238
- function ye(x, o) {
239
- O(o, !0);
240
- let c = r(o, "composition", 7), p = r(o, "env", 23, () => ({ mode: "gather", role: "student" })), l = r(o, "toolbarPosition", 7, "right"), d = r(o, "showToolbar", 7, !0), u = r(o, "onnext", 7, void 0), b = r(o, "onprevious", 7, void 0);
241
- var h = {
242
- get composition() {
243
- return c();
244
- },
245
- set composition(n) {
246
- c(n), i();
247
- },
248
- get env() {
249
- return p();
250
- },
251
- set env(n = { mode: "gather", role: "student" }) {
252
- p(n), i();
253
- },
254
- get toolbarPosition() {
255
- return l();
256
- },
257
- set toolbarPosition(n = "right") {
258
- l(n), i();
259
- },
260
- get showToolbar() {
261
- return d();
262
- },
263
- set showToolbar(n = !0) {
264
- d(n), i();
265
- },
266
- get onnext() {
267
- return u();
268
- },
269
- set onnext(n = void 0) {
270
- u(n), i();
271
- },
272
- get onprevious() {
273
- return b();
274
- },
275
- set onprevious(n = void 0) {
276
- b(n), i();
277
- }
278
- };
279
- return J(x, {
280
- get composition() {
281
- return c();
282
- },
283
- get env() {
284
- return p();
285
- },
286
- get toolbarPosition() {
287
- return l();
288
- },
289
- get showToolbar() {
290
- return d();
291
- },
292
- get onnext() {
293
- return u();
294
- },
295
- get onprevious() {
296
- return b();
297
- }
298
- }), R(h);
299
- }
300
- customElements.define("pie-item-mode-layout", z(
301
- ye,
302
- {
303
- composition: { type: "Object" },
304
- env: { type: "Object" },
305
- toolbarPosition: { attribute: "toolbar-position", type: "String" },
306
- showToolbar: { attribute: "show-toolbar", type: "Boolean" },
307
- onnext: { type: "Object" },
308
- onprevious: { type: "Object" }
309
- },
310
- [],
311
- [],
312
- { mode: "open" }
313
- ));
314
- export {
315
- ye as default
316
- };
@@ -1,246 +0,0 @@
1
- import { p as V, a as Y, b as y, u as ue, g as t, s as w, f as b, i as C, c as R, d as L, e as H, h as ve, t as k, j as U, k as _, l as Z, m as r, n as u, o as h, r as m, q as he, v as T, w as ge, x as _e, y as $, z as G, A as me, B as J } from "./pie-section-player-DJ5NcwdT.js";
2
- import { I as Q } from "./ItemRenderer-MsjF_Beu.js";
3
- var be = b("<pie-section-tools-toolbar></pie-section-tools-toolbar>", 2), fe = b('<div class="pie-section-player__passage-wrapper svelte-14py6x8"><!></div>'), xe = b('<aside aria-label="Reading passages"></aside> <button type="button" aria-label="Resize panels"><span class="pie-section-player__split-divider-handle svelte-14py6x8"></span></button>', 1), we = b('<div class="pie-section-player__item-wrapper svelte-14py6x8"><!></div>'), ke = b("<pie-section-tools-toolbar></pie-section-tools-toolbar>", 2), Te = b('<div><!> <div><!> <main aria-label="Assessment items"></main></div> <!></div>');
4
- const Pe = {
5
- hash: "svelte-14py6x8",
6
- code: `.pie-section-player__layout-shell.svelte-14py6x8 {display:flex;width:100%;height:100%;min-height:0;overflow:hidden;}.pie-section-player__layout-shell--top.svelte-14py6x8,
7
- .pie-section-player__layout-shell--bottom.svelte-14py6x8,
8
- .pie-section-player__layout-shell--none.svelte-14py6x8 {flex-direction:column;}.pie-section-player__layout-shell--left.svelte-14py6x8,
9
- .pie-section-player__layout-shell--right.svelte-14py6x8 {flex-direction:row;}.pie-section-player__split-panel-layout.svelte-14py6x8 {display:grid;grid-template-rows:minmax(0, 1fr);padding:1rem;height:100%;flex:1;max-height:100%;min-height:0;overflow:hidden;gap:0;}.pie-section-player__split-panel-layout--no-passages.svelte-14py6x8 {padding:1rem;}.pie-section-player__split-panel-layout--no-passages.svelte-14py6x8 .pie-section-player__items-panel:where(.svelte-14py6x8) {padding:0;}.pie-section-player__passages-panel.svelte-14py6x8,
10
- .pie-section-player__items-panel.svelte-14py6x8 {height:100%;max-height:100%;overflow-y:auto;overflow-x:hidden;overscroll-behavior:contain;min-height:0;min-width:0;
11
- /* Firefox auto-hide scrollbar */scrollbar-width:auto;scrollbar-color:transparent transparent;}.pie-section-player__panel--scrolling.svelte-14py6x8 {scrollbar-color:var(--pie-blue-grey-300, #c1c1c1) var(--pie-secondary-background, #f1f1f1);}.pie-section-player__split-divider.svelte-14py6x8 {
12
- /* Reset button defaults so it looks like a divider strip */border:none;padding:0;margin:0;font:inherit;
13
- /* Fill grid cell height so the handle is vertically centered in the visible area */align-self:stretch;height:100%;min-height:0;position:relative;cursor:col-resize;background:var(--pie-secondary-background, #f3f4f6);display:flex;align-items:center;justify-content:center;user-select:none;touch-action:none;transition:background 0.2s ease;}.pie-section-player__split-divider.svelte-14py6x8:hover {background:var(--pie-border-light, #e5e7eb);}.pie-section-player__split-divider.svelte-14py6x8:focus {outline:2px solid var(--pie-focus-checked-border, #1976d2);outline-offset:-2px;}.pie-section-player__split-divider-handle.svelte-14py6x8 {
14
- /* Absolutely centered in the divider button (matches develop behavior) */position:absolute;inset:0;margin:auto;width:6px;height:60px;background:var(--pie-blue-grey-600, #9ca3af);border-radius:3px;transition:all 0.2s ease;pointer-events:none;}.pie-section-player__split-divider-handle.svelte-14py6x8::before {content:'';position:absolute;top:50%;left:50%;transform:translate(-50%, -50%);width:2px;height:20px;background:var(--pie-white, white);border-radius:1px;opacity:0.8;}.pie-section-player__split-divider.svelte-14py6x8:hover .pie-section-player__split-divider-handle:where(.svelte-14py6x8),
15
- .pie-section-player__split-divider.svelte-14py6x8:focus .pie-section-player__split-divider-handle:where(.svelte-14py6x8),
16
- .pie-section-player__split-divider--dragging.svelte-14py6x8 .pie-section-player__split-divider-handle:where(.svelte-14py6x8) {background:var(--pie-primary, #1976d2);height:80px;box-shadow:0 2px 8px rgba(25, 118, 210, 0.3);}.pie-section-player__split-divider--dragging.svelte-14py6x8 {background:var(--pie-primary-light, #dbeafe);}.pie-section-player__passages-panel.svelte-14py6x8 {display:flex;flex-direction:column;gap:1.5rem;}.pie-section-player__items-panel.svelte-14py6x8 {display:flex;flex-direction:column;gap:1.5rem;}.pie-section-player__item-wrapper.svelte-14py6x8 {flex-shrink:0;}.pie-section-player__passage-wrapper.svelte-14py6x8 {flex-shrink:0;}.pie-section-player__item-wrapper.svelte-14py6x8,
17
- .pie-section-player__passage-wrapper.svelte-14py6x8 {padding:0.25rem;background:var(--pie-white, white);border:1px solid var(--pie-border-light, #e5e7eb);border-radius:6px;}
18
-
19
- /* Mobile/Narrow: Fall back to vertical layout */
20
- @media (max-width: 768px) {.pie-section-player__split-panel-layout.svelte-14py6x8 {grid-template-columns:1fr !important;gap:1rem;min-height:auto;padding:0.5rem;}.pie-section-player__split-divider.svelte-14py6x8 {display:none;}.pie-section-player__passages-panel.svelte-14py6x8,
21
- .pie-section-player__items-panel.svelte-14py6x8 {height:auto;max-height:none;overflow-y:visible;}.pie-section-player__items-panel.svelte-14py6x8 {gap:1rem;}
22
- }
23
-
24
- /* Hide scrollbar by default - WebKit (Chrome, Safari, Edge) */.pie-section-player__passages-panel.svelte-14py6x8::-webkit-scrollbar,
25
- .pie-section-player__items-panel.svelte-14py6x8::-webkit-scrollbar {width:0px;background:transparent;}
26
-
27
- /* Show scrollbar while scrolling */.pie-section-player__panel--scrolling.svelte-14py6x8::-webkit-scrollbar {width:8px;}.pie-section-player__panel--scrolling.svelte-14py6x8::-webkit-scrollbar-track {background:var(--pie-secondary-background, #f1f1f1);border-radius:4px;}.pie-section-player__panel--scrolling.svelte-14py6x8::-webkit-scrollbar-thumb {background:var(--pie-blue-grey-300, #c1c1c1);border-radius:4px;}.pie-section-player__panel--scrolling.svelte-14py6x8::-webkit-scrollbar-thumb:hover {background:var(--pie-blue-grey-600, #a1a1a1);}`
28
- };
29
- function ee(f, a) {
30
- V(a, !0), Y(f, Pe);
31
- let n = y(a, "composition", 7), d = y(a, "env", 23, () => ({ mode: "gather", role: "student" })), s = y(a, "toolbarPosition", 7, "right"), v = y(a, "showToolbar", 7, !0), p = w(
32
- 50
33
- // percentage
34
- ), o = w(!1), P = w(null), M = w(!1), B = w(!1), D = null, I = null;
35
- function te(e) {
36
- e.preventDefault(), r(o, !0), document.body.style.cursor = "col-resize", document.body.style.userSelect = "none";
37
- }
38
- function z(e) {
39
- if (!t(o) || !t(P)) return;
40
- const i = t(P).getBoundingClientRect(), l = (e.clientX - i.left) / i.width * 100;
41
- l >= 20 && l <= 80 && r(p, l);
42
- }
43
- function K() {
44
- t(o) && (r(o, !1), document.body.style.cursor = "", document.body.style.userSelect = "");
45
- }
46
- function ie(e) {
47
- e.key === "ArrowLeft" ? (e.preventDefault(), r(p, Math.max(20, t(p) - 5), !0)) : e.key === "ArrowRight" && (e.preventDefault(), r(p, Math.min(80, t(p) + 5), !0));
48
- }
49
- function F(e) {
50
- e === "passages" ? (r(M, !0), D && clearTimeout(D), D = setTimeout(
51
- () => {
52
- r(M, !1);
53
- },
54
- 700
55
- )) : (r(B, !0), I && clearTimeout(I), I = setTimeout(
56
- () => {
57
- r(B, !1);
58
- },
59
- 700
60
- ));
61
- }
62
- ue(() => {
63
- if (t(o))
64
- return window.addEventListener("mousemove", z), window.addEventListener("mouseup", K), () => {
65
- window.removeEventListener("mousemove", z), window.removeEventListener("mouseup", K);
66
- };
67
- });
68
- let N = h(() => n()?.passages || []), oe = h(() => n()?.items || []), se = h(() => n()?.itemSessionsByItemId || {}), j = h(() => t(N).length > 0), W = h(() => v() && s() !== "none"), X = h(() => s() === "top" || s() === "left");
69
- var le = {
70
- get composition() {
71
- return n();
72
- },
73
- set composition(e) {
74
- n(e), u();
75
- },
76
- get env() {
77
- return d();
78
- },
79
- set env(e = { mode: "gather", role: "student" }) {
80
- d(e), u();
81
- },
82
- get toolbarPosition() {
83
- return s();
84
- },
85
- set toolbarPosition(e = "right") {
86
- s(e), u();
87
- },
88
- get showToolbar() {
89
- return v();
90
- },
91
- set showToolbar(e = !0) {
92
- v(e), u();
93
- }
94
- }, S = Te(), O = L(S);
95
- {
96
- var ae = (e) => {
97
- var i = be();
98
- k(() => G(i, "position", s())), _(e, i);
99
- };
100
- C(O, (e) => {
101
- t(W) && t(X) && e(ae);
102
- });
103
- }
104
- var g = R(O, 2), q = L(g);
105
- {
106
- var re = (e) => {
107
- var i = xe(), c = me(i);
108
- H(c, 21, () => t(N), (x) => x.id, (x, de) => {
109
- var A = fe(), ce = L(A);
110
- {
111
- let ye = h(() => ({ mode: "view", role: d().role }));
112
- Q(ce, {
113
- get item() {
114
- return t(de);
115
- },
116
- contentKind: "rubric-block-stimulus",
117
- get env() {
118
- return t(ye);
119
- },
120
- customClassName: "pie-section-player__passage-item"
121
- });
122
- }
123
- m(A), _(x, A);
124
- }), m(c);
125
- var l = R(c, 2);
126
- k(() => {
127
- T(c, 1, `pie-section-player__passages-panel ${t(M) ? "pie-section-player__panel--scrolling" : ""}`, "svelte-14py6x8"), T(l, 1, `pie-section-player__split-divider ${t(o) ? "pie-section-player__split-divider--dragging" : ""}`, "svelte-14py6x8");
128
- }), U("scroll", c, () => F("passages")), J("mousedown", l, te), J("keydown", l, ie), _(e, i);
129
- };
130
- C(q, (e) => {
131
- t(j) && e(re);
132
- });
133
- }
134
- var E = R(q, 2);
135
- H(E, 23, () => t(oe), (e, i) => e.id || i, (e, i, c) => {
136
- var l = we(), x = L(l);
137
- Q(x, {
138
- get item() {
139
- return t(i);
140
- },
141
- contentKind: "assessment-item",
142
- get env() {
143
- return d();
144
- },
145
- get session() {
146
- return t(se)[t(i).id || ""];
147
- },
148
- customClassName: "pie-section-player__item-content"
149
- }), m(l), k(() => he(l, "data-item-index", t(c))), _(e, l);
150
- }), m(E), m(g), ve(g, (e) => r(P, e), () => t(P));
151
- var ne = R(g, 2);
152
- {
153
- var pe = (e) => {
154
- var i = ke();
155
- k(() => G(i, "position", s())), _(e, i);
156
- };
157
- C(ne, (e) => {
158
- t(W) && !t(X) && e(pe);
159
- });
160
- }
161
- return m(S), k(() => {
162
- T(S, 1, `pie-section-player__layout-shell pie-section-player__layout-shell--${s()}`, "svelte-14py6x8"), T(
163
- g,
164
- 1,
165
- `pie-section-player__split-panel-layout ${t(j) ? "" : "pie-section-player__split-panel-layout--no-passages"}`,
166
- "svelte-14py6x8"
167
- ), ge(g, t(j) ? `grid-template-columns: ${t(p)}% 0.5rem ${100 - t(p) - 0.5}%` : "grid-template-columns: 1fr"), T(E, 1, `pie-section-player__items-panel ${t(B) ? "pie-section-player__panel--scrolling" : ""}`, "svelte-14py6x8");
168
- }), U("scroll", E, () => F("items")), _(f, S), Z(le);
169
- }
170
- _e(["mousedown", "keydown"]);
171
- $(
172
- ee,
173
- {
174
- composition: {},
175
- env: {},
176
- toolbarPosition: {},
177
- showToolbar: {}
178
- },
179
- [],
180
- [],
181
- { mode: "open" }
182
- );
183
- const Se = {
184
- hash: "svelte-1x7cfjp",
185
- code: `
186
- /* Ensure the custom-element wrapper is a constrained block container. */pie-split-panel-layout {display:block;width:100%;height:100%;min-height:0;max-height:100%;overflow:hidden;}:host {display:block;width:100%;height:100%;min-height:0;max-height:100%;overflow:hidden;}`
187
- };
188
- function Ee(f, a) {
189
- V(a, !0), Y(f, Se);
190
- let n = y(a, "composition", 7), d = y(a, "env", 23, () => ({ mode: "gather", role: "student" })), s = y(a, "toolbarPosition", 7, "right"), v = y(a, "showToolbar", 7, !0);
191
- var p = {
192
- get composition() {
193
- return n();
194
- },
195
- set composition(o) {
196
- n(o), u();
197
- },
198
- get env() {
199
- return d();
200
- },
201
- set env(o = { mode: "gather", role: "student" }) {
202
- d(o), u();
203
- },
204
- get toolbarPosition() {
205
- return s();
206
- },
207
- set toolbarPosition(o = "right") {
208
- s(o), u();
209
- },
210
- get showToolbar() {
211
- return v();
212
- },
213
- set showToolbar(o = !0) {
214
- v(o), u();
215
- }
216
- };
217
- return ee(f, {
218
- get composition() {
219
- return n();
220
- },
221
- get env() {
222
- return d();
223
- },
224
- get toolbarPosition() {
225
- return s();
226
- },
227
- get showToolbar() {
228
- return v();
229
- }
230
- }), Z(p);
231
- }
232
- customElements.define("pie-split-panel-layout", $(
233
- Ee,
234
- {
235
- composition: { type: "Object" },
236
- env: { type: "Object" },
237
- toolbarPosition: { attribute: "toolbar-position", type: "String" },
238
- showToolbar: { attribute: "show-toolbar", type: "Boolean" }
239
- },
240
- [],
241
- [],
242
- { mode: "open" }
243
- ));
244
- export {
245
- Ee as default
246
- };