@pie-players/pie-section-player 0.3.27 → 0.3.29
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 +11 -8
- package/dist/chunks/tool-annotation-toolbar-db5bfbec.js +1 -6
- package/dist/contracts/host-hooks.d.ts +5 -0
- package/dist/contracts/host-hooks.d.ts.map +1 -0
- package/dist/contracts/layout-contract.d.ts +1 -1
- package/dist/contracts/layout-contract.d.ts.map +1 -1
- package/dist/pie-section-player.d.ts +1 -0
- package/dist/pie-section-player.d.ts.map +1 -1
- package/dist/pie-section-player.js +2757 -2703
- package/package.json +14 -10
package/README.md
CHANGED
|
@@ -61,13 +61,13 @@ Both layout elements support:
|
|
|
61
61
|
- `toolbar-position` (string): `top|right|bottom|left|none`
|
|
62
62
|
- `narrow-layout-breakpoint` (number, optional): viewport width in px below which the layout collapses (split pane: single column; vertical: toolbar moves to top). Clamped to 400–2000; default 1100.
|
|
63
63
|
- `show-toolbar` (boolean-like): accepts `true/false` and common string forms (`"true"`, `"false"`, `"1"`, `"0"`, `"yes"`, `"no"`)
|
|
64
|
-
- Host extension props (JS properties only): `toolRegistry`, `sectionHostButtons`, `itemHostButtons`, `passageHostButtons`, `
|
|
64
|
+
- Host extension props (JS properties only): `toolRegistry`, `sectionHostButtons`, `itemHostButtons`, `passageHostButtons`, `hooks`
|
|
65
65
|
|
|
66
66
|
When viewport width is within the collapsed range (~1100px and below), inline section
|
|
67
67
|
toolbar positions (`left`/`right`) normalize to `top` so controls remain horizontally
|
|
68
68
|
laid out and easier to access.
|
|
69
69
|
|
|
70
|
-
`cardTitleFormatter` remains active across responsive splitpane transitions (split -> stacked and stacked -> split), because title rendering is provided through shared card context rather than layout-specific state.
|
|
70
|
+
`hooks.cardTitleFormatter` remains active across responsive splitpane transitions (split -> stacked and stacked -> split), because title rendering is provided through shared card context rather than layout-specific state.
|
|
71
71
|
|
|
72
72
|
### API direction: CE defaults first, JS customization for advanced cases
|
|
73
73
|
|
|
@@ -82,17 +82,19 @@ The intended usage model is:
|
|
|
82
82
|
- Apply custom policy/gating in host code (for example, domain-specific `canNext` based on controller events like `section-items-complete-changed`)
|
|
83
83
|
- Compose forward/backward eligibility in host code using `selectNavigation()` + host state; there is intentionally no separate parallel CE gating API for this
|
|
84
84
|
- Inject custom toolbar tooling with `toolRegistry` and optional host button arrays (`sectionHostButtons`, `itemHostButtons`, `passageHostButtons`)
|
|
85
|
-
-
|
|
85
|
+
- Register host callbacks via `hooks` (for example `hooks.cardTitleFormatter`)
|
|
86
86
|
|
|
87
87
|
Example:
|
|
88
88
|
|
|
89
89
|
```ts
|
|
90
90
|
const host = document.querySelector("pie-section-player-splitpane") as any;
|
|
91
|
-
host.
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
91
|
+
host.hooks = {
|
|
92
|
+
cardTitleFormatter: (context: any) => {
|
|
93
|
+
if (context.kind === "item") {
|
|
94
|
+
return `Question ${context.itemIndex + 1}: ${context.item?.name || context.defaultTitle}`;
|
|
95
|
+
}
|
|
96
|
+
return context.passage?.name || context.defaultTitle;
|
|
97
|
+
},
|
|
96
98
|
};
|
|
97
99
|
```
|
|
98
100
|
|
|
@@ -348,6 +350,7 @@ Published exports are intentionally minimal:
|
|
|
348
350
|
- `@pie-players/pie-section-player/contracts/public-events`
|
|
349
351
|
- `@pie-players/pie-section-player/contracts/runtime-host-contract`
|
|
350
352
|
- `@pie-players/pie-section-player/contracts/layout-parity-metadata`
|
|
353
|
+
- `@pie-players/pie-section-player/contracts/host-hooks`
|
|
351
354
|
- `@pie-players/pie-section-player/policies`
|
|
352
355
|
|
|
353
356
|
## Development
|
|
@@ -3098,12 +3098,7 @@ var ll = class {
|
|
|
3098
3098
|
},
|
|
3099
3099
|
lazy: !0
|
|
3100
3100
|
},
|
|
3101
|
-
supportedLevels: [
|
|
3102
|
-
"section",
|
|
3103
|
-
"item",
|
|
3104
|
-
"passage",
|
|
3105
|
-
"rubric"
|
|
3106
|
-
],
|
|
3101
|
+
supportedLevels: ["item", "passage"],
|
|
3107
3102
|
pnpSupportIds: [
|
|
3108
3103
|
"textToSpeech",
|
|
3109
3104
|
"readAloud",
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"host-hooks.d.ts","sourceRoot":"","sources":["../../src/contracts/host-hooks.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,+BAA+B,EAAE,MAAM,4BAA4B,CAAC;AAElF,MAAM,MAAM,sBAAsB,GAAG;IACpC,kBAAkB,CAAC,EAAE,+BAA+B,CAAC;CACrD,CAAC"}
|
|
@@ -2,7 +2,7 @@ import { SectionPlayerPublicEventName } from './public-events.js';
|
|
|
2
2
|
export type SectionPlayerLayoutName = "splitpane" | "vertical";
|
|
3
3
|
export type SectionPlayerLayoutCapability = "items-pane" | "passages-pane" | "section-toolbar" | "item-toolbar" | "passage-toolbar" | "readiness-events" | "navigation-events";
|
|
4
4
|
export type SectionPlayerBasicPropName = "assessmentId" | "section" | "sectionId" | "attemptId" | "debug" | "showToolbar" | "toolbarPosition" | "narrowLayoutBreakpoint" | "enabledTools" | "itemToolbarTools" | "passageToolbarTools";
|
|
5
|
-
export type SectionPlayerAdvancedPropName = "runtime" | "playerType" | "player" | "lazyInit" | "tools" | "accessibility" | "coordinator" | "createSectionController" | "isolation" | "env" | "iifeBundleHost" | "toolRegistry" | "sectionHostButtons" | "itemHostButtons" | "passageHostButtons" | "
|
|
5
|
+
export type SectionPlayerAdvancedPropName = "runtime" | "playerType" | "player" | "lazyInit" | "tools" | "accessibility" | "coordinator" | "createSectionController" | "isolation" | "env" | "iifeBundleHost" | "toolRegistry" | "sectionHostButtons" | "itemHostButtons" | "passageHostButtons" | "hooks";
|
|
6
6
|
export type SectionPlayerLayoutPropName = SectionPlayerBasicPropName | SectionPlayerAdvancedPropName;
|
|
7
7
|
export type SectionPlayerLayoutCommandName = "getSnapshot" | "selectComposition" | "selectNavigation" | "selectReadiness" | "navigateTo" | "navigateNext" | "navigatePrevious" | "getSectionController" | "waitForSectionController";
|
|
8
8
|
export type SectionPlayerLayoutContract = {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"layout-contract.d.ts","sourceRoot":"","sources":["../../src/contracts/layout-contract.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,4BAA4B,EAAE,MAAM,oBAAoB,CAAC;AAEvE,MAAM,MAAM,uBAAuB,GAAG,WAAW,GAAG,UAAU,CAAC;AAE/D,MAAM,MAAM,6BAA6B,GACtC,YAAY,GACZ,eAAe,GACf,iBAAiB,GACjB,cAAc,GACd,iBAAiB,GACjB,kBAAkB,GAClB,mBAAmB,CAAC;AAEvB,MAAM,MAAM,0BAA0B,GACnC,cAAc,GACd,SAAS,GACT,WAAW,GACX,WAAW,GACX,OAAO,GACP,aAAa,GACb,iBAAiB,GACjB,wBAAwB,GACxB,cAAc,GACd,kBAAkB,GAClB,qBAAqB,CAAC;AAEzB,MAAM,MAAM,6BAA6B,GACtC,SAAS,GACT,YAAY,GACZ,QAAQ,GACR,UAAU,GACV,OAAO,GACP,eAAe,GACf,aAAa,GACb,yBAAyB,GACzB,WAAW,GACX,KAAK,GACL,gBAAgB,GAChB,cAAc,GACd,oBAAoB,GACpB,iBAAiB,GACjB,oBAAoB,GACpB,
|
|
1
|
+
{"version":3,"file":"layout-contract.d.ts","sourceRoot":"","sources":["../../src/contracts/layout-contract.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,4BAA4B,EAAE,MAAM,oBAAoB,CAAC;AAEvE,MAAM,MAAM,uBAAuB,GAAG,WAAW,GAAG,UAAU,CAAC;AAE/D,MAAM,MAAM,6BAA6B,GACtC,YAAY,GACZ,eAAe,GACf,iBAAiB,GACjB,cAAc,GACd,iBAAiB,GACjB,kBAAkB,GAClB,mBAAmB,CAAC;AAEvB,MAAM,MAAM,0BAA0B,GACnC,cAAc,GACd,SAAS,GACT,WAAW,GACX,WAAW,GACX,OAAO,GACP,aAAa,GACb,iBAAiB,GACjB,wBAAwB,GACxB,cAAc,GACd,kBAAkB,GAClB,qBAAqB,CAAC;AAEzB,MAAM,MAAM,6BAA6B,GACtC,SAAS,GACT,YAAY,GACZ,QAAQ,GACR,UAAU,GACV,OAAO,GACP,eAAe,GACf,aAAa,GACb,yBAAyB,GACzB,WAAW,GACX,KAAK,GACL,gBAAgB,GAChB,cAAc,GACd,oBAAoB,GACpB,iBAAiB,GACjB,oBAAoB,GACpB,OAAO,CAAC;AAEX,MAAM,MAAM,2BAA2B,GACpC,0BAA0B,GAC1B,6BAA6B,CAAC;AAEjC,MAAM,MAAM,8BAA8B,GACvC,aAAa,GACb,mBAAmB,GACnB,kBAAkB,GAClB,iBAAiB,GACjB,YAAY,GACZ,cAAc,GACd,kBAAkB,GAClB,sBAAsB,GACtB,0BAA0B,CAAC;AAE9B,MAAM,MAAM,2BAA2B,GAAG;IACzC,OAAO,EAAE,CAAC,CAAC;IACX,MAAM,EAAE,uBAAuB,CAAC;IAChC,KAAK,EAAE,SAAS,2BAA2B,EAAE,CAAC;IAC9C,qBAAqB,EAAE,SAAS,0BAA0B,EAAE,CAAC;IAC7D,wBAAwB,EAAE,SAAS,6BAA6B,EAAE,CAAC;IACnE,MAAM,EAAE,SAAS,4BAA4B,EAAE,CAAC;IAChD,QAAQ,EAAE,SAAS,8BAA8B,EAAE,CAAC;IACpD,YAAY,EAAE,SAAS,6BAA6B,EAAE,CAAC;CACvD,CAAC"}
|
|
@@ -6,4 +6,5 @@ export { SPLITPANE_LAYOUT_CONTRACT, VERTICAL_LAYOUT_CONTRACT, } from './contract
|
|
|
6
6
|
export type { ReadinessPolicyAdapter, SectionPlayerPolicies, SectionPlayerReadinessPolicy, SectionPlayerPreloadPolicy, SectionPlayerFocusPolicy, SectionPlayerTelemetryPolicy, } from './policies/types.js';
|
|
7
7
|
export { DEFAULT_SECTION_PLAYER_POLICIES } from './policies/index.js';
|
|
8
8
|
export type { SectionPlayerCardTitleContext, SectionPlayerCardTitleFormatter, SectionPlayerItemTitleContext, SectionPlayerPassageTitleContext, } from './contracts/card-title-formatters.js';
|
|
9
|
+
export type { SectionPlayerHostHooks } from './contracts/host-hooks.js';
|
|
9
10
|
//# sourceMappingURL=pie-section-player.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"pie-section-player.d.ts","sourceRoot":"","sources":["../src/pie-section-player.ts"],"names":[],"mappings":"AAAA,OAAO,+CAA+C,CAAC;AACvD,OAAO,8CAA8C,CAAC;AACtD,OAAO,+CAA+C,CAAC;AACvD,OAAO,kDAAkD,CAAC;AAC1D,OAAO,gDAAgD,CAAC;AACxD,OAAO,mDAAmD,CAAC;AAC3D,OAAO,2CAA2C,CAAC;AACnD,OAAO,iDAAiD,CAAC;AAEzD,YAAY,EACX,2BAA2B,EAC3B,uBAAuB,EACvB,6BAA6B,EAC7B,0BAA0B,EAC1B,6BAA6B,EAC7B,2BAA2B,EAC3B,8BAA8B,GAC9B,MAAM,gCAAgC,CAAC;AACxC,YAAY,EACX,4BAA4B,EAC5B,2BAA2B,EAC3B,kCAAkC,EAClC,kCAAkC,GAClC,MAAM,8BAA8B,CAAC;AACtC,OAAO,EAAE,4BAA4B,EAAE,MAAM,8BAA8B,CAAC;AAC5E,YAAY,EACX,gCAAgC,EAChC,+BAA+B,EAC/B,qBAAqB,GACrB,MAAM,sCAAsC,CAAC;AAC9C,OAAO,EACN,yBAAyB,EACzB,wBAAwB,GACxB,MAAM,uCAAuC,CAAC;AAC/C,YAAY,EACX,sBAAsB,EACtB,qBAAqB,EACrB,4BAA4B,EAC5B,0BAA0B,EAC1B,wBAAwB,EACxB,4BAA4B,GAC5B,MAAM,qBAAqB,CAAC;AAC7B,OAAO,EAAE,+BAA+B,EAAE,MAAM,qBAAqB,CAAC;AACtE,YAAY,EACX,6BAA6B,EAC7B,+BAA+B,EAC/B,6BAA6B,EAC7B,gCAAgC,GAChC,MAAM,sCAAsC,CAAC"}
|
|
1
|
+
{"version":3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