@panelwave/player 1.3.0 → 1.5.0
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/index.d.ts
CHANGED
|
@@ -401,10 +401,12 @@ interface BalloonConfig {
|
|
|
401
401
|
balloonType: BalloonType;
|
|
402
402
|
/** 0-1 (0=rectangle, 1=ellipse) */
|
|
403
403
|
cornerRadius: number;
|
|
404
|
-
/**
|
|
404
|
+
/** Authored width in px — the floor; with textFit 'grow' the body grows for longer text */
|
|
405
405
|
maxWidth: number;
|
|
406
|
-
/**
|
|
406
|
+
/** Authored height in px — the floor; with textFit 'grow' the body grows for longer text */
|
|
407
407
|
maxHeight: number;
|
|
408
|
+
/** grow (default): the balloon grows when the text needs more room; fixed: keeps the authored size (schema 1.8.0) */
|
|
409
|
+
textFit?: 'grow' | 'fixed';
|
|
408
410
|
/** CSS font-family */
|
|
409
411
|
fontFamily: string;
|
|
410
412
|
/** Pixels */
|
|
@@ -5340,6 +5342,16 @@ declare function balloonConfigToTailOptions(config: BalloonConfig): {
|
|
|
5340
5342
|
curveAmount: number;
|
|
5341
5343
|
} | null;
|
|
5342
5344
|
|
|
5345
|
+
/**
|
|
5346
|
+
* How a balloon treats text that needs more room than its authored size
|
|
5347
|
+
* (`maxWidth × maxHeight`, schema 1.8 `BalloonConfig.textFit`):
|
|
5348
|
+
* - `grow` (default): the balloon grows beyond the authored size until the
|
|
5349
|
+
* text fits — proportionally first (the shape keeps its aspect ratio), then
|
|
5350
|
+
* in height; see {@link BALLOON_GROWTH_MAX}.
|
|
5351
|
+
* - `fixed`: the balloon keeps its authored size and the text spills over the
|
|
5352
|
+
* edges (pre-1.8 behaviour); `textOverflows` reports it.
|
|
5353
|
+
*/
|
|
5354
|
+
type BalloonTextFit = 'grow' | 'fixed';
|
|
5343
5355
|
interface BalloonPadding {
|
|
5344
5356
|
top: number;
|
|
5345
5357
|
right: number;
|
|
@@ -5347,8 +5359,12 @@ interface BalloonPadding {
|
|
|
5347
5359
|
left: number;
|
|
5348
5360
|
}
|
|
5349
5361
|
interface BalloonOptions {
|
|
5362
|
+
/** Authored width in px; 0 = natural width. With textFit 'grow' the body may become wider. */
|
|
5350
5363
|
maxWidth: number;
|
|
5364
|
+
/** Authored height in px; 0 = natural height. With textFit 'grow' the body may become taller. */
|
|
5351
5365
|
maxHeight: number;
|
|
5366
|
+
/** What happens when the text needs more room than the authored size (default 'grow'). */
|
|
5367
|
+
textFit: BalloonTextFit;
|
|
5352
5368
|
padding: BalloonPadding;
|
|
5353
5369
|
strokeWidth: number;
|
|
5354
5370
|
strokeColor: string;
|
|
@@ -5390,10 +5406,19 @@ interface CutOptions {
|
|
|
5390
5406
|
bottom?: boolean;
|
|
5391
5407
|
}
|
|
5392
5408
|
interface BalloonRenderResult {
|
|
5409
|
+
/** Rendered body width (the authored width, or more when the balloon grew). */
|
|
5393
5410
|
width: number;
|
|
5411
|
+
/** Rendered body height (the authored height, or more when the balloon grew). */
|
|
5394
5412
|
height: number;
|
|
5413
|
+
/** The authored body size the growth started from (maxWidth/maxHeight, or the natural size for 0). */
|
|
5414
|
+
authoredWidth: number;
|
|
5415
|
+
authoredHeight: number;
|
|
5416
|
+
/** True when the body is larger than the authored size because the text needed more room. */
|
|
5417
|
+
grown: boolean;
|
|
5418
|
+
/** Proportional growth factor applied to the authored size (1 when not grown). */
|
|
5419
|
+
growth: number;
|
|
5395
5420
|
svg: SVGSVGElement;
|
|
5396
|
-
/** True when the text needs more height than
|
|
5421
|
+
/** True when the text needs more height than the body gives it (textFit 'fixed' only). */
|
|
5397
5422
|
textOverflows: boolean;
|
|
5398
5423
|
balloon: ComicBalloon;
|
|
5399
5424
|
update: (newText?: string, newTailOptions?: TailOptions | null) => BalloonRenderResult;
|
|
@@ -7543,6 +7568,14 @@ declare class SpeechBubblesComponent implements OnChanges, AfterViewInit, OnDest
|
|
|
7543
7568
|
}>;
|
|
7544
7569
|
/** Rendered balloon containers, keyed by bubble ID */
|
|
7545
7570
|
private renderedBalloons;
|
|
7571
|
+
/**
|
|
7572
|
+
* Font specs ("15px 'Ames Italic', sans-serif") whose loading this overlay
|
|
7573
|
+
* already requested. Web fonts load lazily on first use, so the first
|
|
7574
|
+
* render may have measured with a fallback face while document.fonts.ready
|
|
7575
|
+
* had long resolved (no font was in flight yet). Each new spec is loaded
|
|
7576
|
+
* explicitly and the balloons re-render once it arrives.
|
|
7577
|
+
*/
|
|
7578
|
+
private fontsRequested;
|
|
7546
7579
|
/** ResizeObserver for container size tracking */
|
|
7547
7580
|
private resizeObserver;
|
|
7548
7581
|
private initialized;
|
|
@@ -7573,6 +7606,12 @@ declare class SpeechBubblesComponent implements OnChanges, AfterViewInit, OnDest
|
|
|
7573
7606
|
* Render all speech balloons into the DOM
|
|
7574
7607
|
*/
|
|
7575
7608
|
renderAllBalloons(): void;
|
|
7609
|
+
/**
|
|
7610
|
+
* Request every font spec the balloons use that was not requested before;
|
|
7611
|
+
* re-render once a face that was not yet available arrives, so balloons
|
|
7612
|
+
* measured with a fallback face are laid out again with the real one.
|
|
7613
|
+
*/
|
|
7614
|
+
private ensureFontsLoaded;
|
|
7576
7615
|
/**
|
|
7577
7616
|
* Handle bubble click (called from template for any fallback interaction)
|
|
7578
7617
|
*/
|
|
@@ -7598,6 +7637,11 @@ declare class HotspotsOverlayComponent implements OnChanges {
|
|
|
7598
7637
|
* Hotspots of the current panel (manifest shape)
|
|
7599
7638
|
*/
|
|
7600
7639
|
hotspots: Hotspot[];
|
|
7640
|
+
/**
|
|
7641
|
+
* The panel's speech bubbles: a choice hotspot whose label is already
|
|
7642
|
+
* lettered as a bubble keeps its invisible area under `display: auto`.
|
|
7643
|
+
*/
|
|
7644
|
+
bubbles: SpeechBubble[];
|
|
7601
7645
|
/**
|
|
7602
7646
|
* Current locale for label resolution
|
|
7603
7647
|
*/
|
|
@@ -7687,7 +7731,7 @@ declare class HotspotsOverlayComponent implements OnChanges {
|
|
|
7687
7731
|
private centroidOf;
|
|
7688
7732
|
private clamp01;
|
|
7689
7733
|
static ɵfac: i0.ɵɵFactoryDeclaration<HotspotsOverlayComponent, never>;
|
|
7690
|
-
static ɵcmp: i0.ɵɵComponentDeclaration<HotspotsOverlayComponent, "pw-hotspots-overlay", never, { "hotspots": { "alias": "hotspots"; "required": false; }; "locale": { "alias": "locale"; "required": false; }; "containerWidth": { "alias": "containerWidth"; "required": false; }; "containerHeight": { "alias": "containerHeight"; "required": false; }; "context": { "alias": "context"; "required": false; }; "interactive": { "alias": "interactive"; "required": false; }; "showIndicators": { "alias": "showIndicators"; "required": false; }; }, { "hotspotActivate": "hotspotActivate"; }, never, never, true, never>;
|
|
7734
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<HotspotsOverlayComponent, "pw-hotspots-overlay", never, { "hotspots": { "alias": "hotspots"; "required": false; }; "bubbles": { "alias": "bubbles"; "required": false; }; "locale": { "alias": "locale"; "required": false; }; "containerWidth": { "alias": "containerWidth"; "required": false; }; "containerHeight": { "alias": "containerHeight"; "required": false; }; "context": { "alias": "context"; "required": false; }; "interactive": { "alias": "interactive"; "required": false; }; "showIndicators": { "alias": "showIndicators"; "required": false; }; }, { "hotspotActivate": "hotspotActivate"; }, never, never, true, never>;
|
|
7691
7735
|
}
|
|
7692
7736
|
|
|
7693
7737
|
/**
|
package/package.json
CHANGED
|
@@ -25,9 +25,9 @@ License text: https://openfontlicense.org/open-font-license-official-text/
|
|
|
25
25
|
|
|
26
26
|
## Deliberately NOT included
|
|
27
27
|
|
|
28
|
-
**Ames Pro** (`amespro-*`, by
|
|
28
|
+
**Ames Pro** (`amespro-*`, by Purastik Graphics) is a **commercial** font and
|
|
29
29
|
is not part of this MIT-licensed package (the files are gitignored). Host
|
|
30
|
-
applications that use it must license it from https://
|
|
30
|
+
applications that use it must license it (web-font license) from https://www.fontspring.com/fonts/purastik-graphics/ames-pro and provide
|
|
31
31
|
their own `@font-face` declarations for `'Ames Italic'`, `'Ames Bold Italic'`
|
|
32
32
|
and `'Ames Regular'`. The player's default font stack falls back to Comic Neue
|
|
33
33
|
when Ames is unavailable.
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
* All families here are open-licensed (SIL OFL 1.1, from Google Fonts) and
|
|
5
5
|
* ship with the @panelwave/player package — see LICENSES.md in this folder.
|
|
6
6
|
*
|
|
7
|
-
* The Ames Pro family (
|
|
7
|
+
* The Ames Pro family (Purastik Graphics, commercial) is deliberately NOT included —
|
|
8
8
|
* neither here nor in works exported from the PanelWave CMS. PanelWave's own
|
|
9
9
|
* players (CMS preview, read.panelwave.org) load it under PanelWave's
|
|
10
10
|
* license, which covers PanelWave's domains only. Self-hosting a work whose
|