@pie-players/pie-section-player 1.0.0-beta.0 → 1.0.0-beta.2
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 +16 -3
- package/dist/browser/assets/{evaluation-worker-0xRDVTJx.js → evaluation-worker-B336Lsun.js} +48398 -46681
- package/dist/browser/chunks/calculator-element-271c142f.js +4 -4
- package/dist/browser/chunks/dist-41b39e7f.js +1 -1
- package/dist/browser/chunks/dist-ca9b9622.js +1 -1
- package/dist/browser/chunks/math-rendering-ready-9a0fd90a.js +1 -1
- package/dist/browser/chunks/mathjax-BKrHE4xs-3ca05bf6.js +1 -1
- package/dist/browser/chunks/{runtime-YFqnU6ic-d5c0cb49.js → runtime-BCz9m_IT-7b48a036.js} +305 -292
- package/dist/browser/chunks/tool-annotation-toolbar-997438b4.js +5 -5
- package/dist/browser/chunks/tool-answer-eliminator-35483abd.js +5 -5
- package/dist/browser/chunks/tool-color-scheme-b7de5cdf.js +5 -5
- package/dist/browser/chunks/tool-dictionary-cecff3b4.js +3 -3
- package/dist/browser/chunks/tool-graph-cb0338e8.js +4 -4
- package/dist/browser/chunks/tool-line-reader-f8ef3c6a.js +3 -3
- package/dist/browser/chunks/tool-periodic-table-43b133b8.js +4 -4
- package/dist/browser/chunks/tool-picture-dictionary-33721e91.js +3 -3
- package/dist/browser/chunks/tool-protractor-23f77028.js +6 -6
- package/dist/browser/chunks/tool-ruler-1d9a03a6.js +6 -6
- package/dist/browser/chunks/tool-tts-inline-98c2ce7a.js +4 -4
- package/dist/browser/chunks/versioned-tag-54a76be9.js +1 -1
- package/dist/browser/pie-section-player.js +57 -44
- package/dist/components/shared/card-title.d.ts +18 -0
- package/dist/contracts/card-title-formatters.d.ts +8 -1
- package/dist/pie-section-player.js +10123 -9887
- package/package.json +10 -10
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { SectionPlayerCardTitleContext, SectionPlayerCardTitleFormatter } from '../../contracts/card-title-formatters.js';
|
|
2
|
+
export type ResolvedCardTitle = {
|
|
3
|
+
text: string;
|
|
4
|
+
visible: boolean;
|
|
5
|
+
};
|
|
6
|
+
/**
|
|
7
|
+
* The title a card renders for a host's `hooks.cardTitleFormatter` return.
|
|
8
|
+
*
|
|
9
|
+
* Hiding takes an explicit `{ visible: false }`, the shape a tool context
|
|
10
|
+
* resolver hides a tool with, because `null`, `undefined` and an empty string
|
|
11
|
+
* already mean "keep the default": a host computing its title from data it may
|
|
12
|
+
* lack returns one of them, and that host must keep getting "Question N".
|
|
13
|
+
*
|
|
14
|
+
* A hidden title keeps its text. The heading stays in the outline, visually
|
|
15
|
+
* hidden: it is the card's name for assistive technology, and item content
|
|
16
|
+
* nests its own headings one level below it.
|
|
17
|
+
*/
|
|
18
|
+
export declare function resolveCardTitle(formatter: SectionPlayerCardTitleFormatter | null | undefined, context: SectionPlayerCardTitleContext): ResolvedCardTitle;
|
|
@@ -13,4 +13,11 @@ export type SectionPlayerPassageTitleContext = {
|
|
|
13
13
|
defaultTitle: string;
|
|
14
14
|
};
|
|
15
15
|
export type SectionPlayerCardTitleContext = SectionPlayerItemTitleContext | SectionPlayerPassageTitleContext;
|
|
16
|
-
|
|
16
|
+
/**
|
|
17
|
+
* A non-empty string becomes the card's title. `{ visible: false }` hides it
|
|
18
|
+
* visually; the heading stays, carrying `defaultTitle`. Anything else, a throw
|
|
19
|
+
* included, keeps `defaultTitle`.
|
|
20
|
+
*/
|
|
21
|
+
export type SectionPlayerCardTitleFormatter = (context: SectionPlayerCardTitleContext) => string | {
|
|
22
|
+
visible: false;
|
|
23
|
+
} | null | undefined;
|