presenter 0.9.2 → 0.9.4
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/dist/export.js +1 -1
- package/dist/export.js.map +1 -1
- package/dist/export.mjs +18 -24
- package/dist/export.mjs.map +1 -1
- package/dist/presenter.js +5 -3
- package/dist/presenter.js.map +1 -1
- package/dist/presenter.mjs +877 -815
- package/dist/presenter.mjs.map +1 -1
- package/dist/renderer/browser-canvas/types/BrowserCanvasRendererState.d.ts +1 -0
- package/dist/renderer/browser-canvas/utils/accessibility/accessibleDescription.d.ts +5 -0
- package/dist/renderer/browser-canvas/utils/accessibility/accessibleDescription.test.d.ts +1 -0
- package/dist/renderer/browser-canvas/utils/text/getTextLayout.d.ts +4 -11
- package/dist/renderer/browser-canvas/utils/text/getTextUnitMeasurements.d.ts +9 -0
- package/dist/types/Slide.d.ts +2 -0
- package/dist/types/SlideObject.d.ts +2 -0
- package/package.json +2 -2
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { ShortcutState } from '../../../types/ShortcutState';
|
|
2
2
|
import { UnifiedImage } from './UnifiedImage';
|
|
3
3
|
export interface BrowserCanvasRendererState {
|
|
4
|
+
accessibleDescriptionElement: HTMLDivElement | null;
|
|
4
5
|
canvas: HTMLCanvasElement | null;
|
|
5
6
|
extrasContainer: SVGSVGElement | null;
|
|
6
7
|
mountedExtrasCleanups: (() => void)[];
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { Slide } from '../../../../types/Slide';
|
|
2
|
+
import { SlideObject } from '../../../../types/SlideObject';
|
|
3
|
+
export declare function createAccessibleDescriptionElement(presentationTitle: string): HTMLDivElement;
|
|
4
|
+
export declare function getAccessibleDescription(slide: Slide, objectState: Map<SlideObject, SlideObject>): string;
|
|
5
|
+
export declare function updateAccessibleDescription(element: HTMLElement, description: string): void;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -1,18 +1,11 @@
|
|
|
1
1
|
import { Size } from '../../../../types/Size';
|
|
2
2
|
import { TextUnitMeasurement } from './getTextUnitMeasurements';
|
|
3
|
-
export interface TextLineLayout extends Size {
|
|
4
|
-
readonly baselineY: number;
|
|
5
|
-
readonly bottom: number;
|
|
6
|
-
readonly lineAdvance: number;
|
|
7
|
-
readonly top: number;
|
|
8
|
-
}
|
|
9
|
-
export interface TextLayout {
|
|
10
|
-
readonly lines: readonly TextLineLayout[];
|
|
11
|
-
readonly size: Size;
|
|
12
|
-
}
|
|
13
3
|
/**
|
|
14
4
|
* Computes text block bounds and per-line baseline positions.
|
|
15
5
|
*
|
|
16
6
|
* Accepts as input per-line measurements for each text unit, plus a desired line spacing.
|
|
17
7
|
*/
|
|
18
|
-
export declare function getTextLayout(lineMeasurements: readonly (readonly TextUnitMeasurement[])[], lineSpacing?: number):
|
|
8
|
+
export declare function getTextLayout(lineMeasurements: readonly (readonly TextUnitMeasurement[])[], lineSpacing?: number): {
|
|
9
|
+
baselines: number[];
|
|
10
|
+
size: Size;
|
|
11
|
+
};
|
|
@@ -2,10 +2,19 @@ import { Size } from '../../../../types/Size';
|
|
|
2
2
|
import { TextStyle } from '../../../../types/TextStyle';
|
|
3
3
|
import { TextUnit } from '../../../../types/TextUnit';
|
|
4
4
|
import { UnifiedCanvasContext } from '../../types/UnifiedCanvasContext';
|
|
5
|
+
/**
|
|
6
|
+
* Font measurements for one styled text unit, in canvas pixels.
|
|
7
|
+
*
|
|
8
|
+
* The inherited `width` is the horizontal advance, while `height` is `top + bottom`.
|
|
9
|
+
*/
|
|
5
10
|
export interface TextUnitMeasurement extends Size {
|
|
11
|
+
/** Offset added to the line baseline when drawing; negative values move text upward. */
|
|
6
12
|
readonly baselineShift: number;
|
|
13
|
+
/** Distance from the line baseline to the bottom of the font bounds. */
|
|
7
14
|
readonly bottom: number;
|
|
15
|
+
/** Font size used to calculate the line box height. */
|
|
8
16
|
readonly lineAdvance: number;
|
|
17
|
+
/** Distance from the line baseline to the top of the font bounds. */
|
|
9
18
|
readonly top: number;
|
|
10
19
|
}
|
|
11
20
|
export declare function getTextUnitMeasurements(textUnits: TextUnit[][], style: TextStyle, ctx: UnifiedCanvasContext): TextUnitMeasurement[][];
|
package/dist/types/Slide.d.ts
CHANGED
|
@@ -5,6 +5,8 @@ export interface Slide {
|
|
|
5
5
|
readonly objects: SlideObject[];
|
|
6
6
|
readonly animations: SlideAnimation[];
|
|
7
7
|
readonly extras: SlideWebExtra[];
|
|
8
|
+
/** A screen-reader description of the slide. */
|
|
9
|
+
readonly description: string | null;
|
|
8
10
|
readonly isAllKey: boolean;
|
|
9
11
|
readonly isEndKey: boolean;
|
|
10
12
|
readonly isStartKey: boolean;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "presenter",
|
|
3
|
-
"version": "0.9.
|
|
3
|
+
"version": "0.9.4",
|
|
4
4
|
"description": "A JavaScript presentation library",
|
|
5
5
|
"main": "dist/presenter.js",
|
|
6
6
|
"types": "dist/index.d.ts",
|
|
@@ -63,7 +63,7 @@
|
|
|
63
63
|
"ts-jest": "^29.4.9",
|
|
64
64
|
"typescript": "^6.0.2",
|
|
65
65
|
"typescript-eslint": "^8.58.0",
|
|
66
|
-
"vite": "^6.
|
|
66
|
+
"vite": "^6.4.3",
|
|
67
67
|
"vite-plugin-dts": "^4.5.4"
|
|
68
68
|
},
|
|
69
69
|
"lint-staged": {
|