@allyhub/sdk 0.3.0 → 0.4.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/dist/free.d.ts +2 -2
- package/dist/index.d.ts +2 -9
- package/dist/index.js +1 -1
- package/dist/module.d.ts +2 -3
- package/dist/module.js +1 -1
- package/dist/parts.d.ts +2 -2
- package/dist/piece.d.ts +7 -32
- package/dist/piece.js +1 -1
- package/dist/props.d.ts +53 -10
- package/dist/slides.d.ts +8 -0
- package/dist/slides.js +2 -0
- package/docs/README.md +1 -1
- package/docs/batches.md +2 -2
- package/docs/defaults.md +106 -3
- package/docs/docs.md +1 -1
- package/docs/project.md +5 -5
- package/docs/sheets.md +1 -1
- package/docs/slides.md +182 -80
- package/node_modules/@allyhub-next/audio/package.json +1 -1
- package/node_modules/@allyhub-next/formats/dist/data/script.d.ts +22 -0
- package/node_modules/@allyhub-next/formats/dist/data/script.js +1 -1
- package/node_modules/@allyhub-next/formats/dist/data/slides.d.ts +1494 -0
- package/node_modules/@allyhub-next/formats/dist/data/slides.js +2 -0
- package/node_modules/@allyhub-next/formats/dist/index.d.ts +2 -0
- package/node_modules/@allyhub-next/formats/dist/index.js +1 -1
- package/node_modules/@allyhub-next/formats/dist/items.d.ts +21 -0
- package/node_modules/@allyhub-next/formats/dist/items.js +1 -1
- package/node_modules/@allyhub-next/formats/dist/note-shape.d.ts +39 -0
- package/node_modules/@allyhub-next/formats/dist/note-shape.js +2 -0
- package/node_modules/@allyhub-next/formats/dist/schemas.d.ts +418 -0
- package/node_modules/@allyhub-next/formats/dist/schemas.js +1 -1
- package/node_modules/@allyhub-next/formats/package.json +1 -1
- package/node_modules/@allyhub-next/protocol/dist/app.d.ts +0 -64
- package/node_modules/@allyhub-next/protocol/dist/app.js +1 -1
- package/node_modules/@allyhub-next/protocol/dist/auth.d.ts +0 -17
- package/node_modules/@allyhub-next/protocol/dist/auth.js +1 -1
- package/node_modules/@allyhub-next/protocol/dist/cli.d.ts +0 -4
- package/node_modules/@allyhub-next/protocol/dist/cli.js +1 -1
- package/node_modules/@allyhub-next/protocol/dist/editor.d.ts +9 -26
- package/node_modules/@allyhub-next/protocol/dist/editor.js +1 -1
- package/node_modules/@allyhub-next/protocol/dist/index.d.ts +1 -0
- package/node_modules/@allyhub-next/protocol/dist/index.js +1 -1
- package/node_modules/@allyhub-next/protocol/dist/notes.d.ts +163 -0
- package/node_modules/@allyhub-next/protocol/dist/notes.js +2 -0
- package/node_modules/@allyhub-next/protocol/dist/registry.d.ts +1 -1
- package/node_modules/@allyhub-next/protocol/dist/runtimes.d.ts +3 -0
- package/node_modules/@allyhub-next/protocol/dist/runtimes.js +1 -1
- package/node_modules/@allyhub-next/protocol/dist/tools.d.ts +37 -0
- package/node_modules/@allyhub-next/protocol/dist/tools.js +1 -1
- package/node_modules/@allyhub-next/protocol/package.json +1 -1
- package/node_modules/@allyhub-next/runtimes/dist/errors.d.ts +5 -1
- package/node_modules/@allyhub-next/runtimes/dist/index.d.ts +1 -0
- package/node_modules/@allyhub-next/runtimes/dist/index.js +1 -1
- package/node_modules/@allyhub-next/runtimes/dist/node-program.d.ts +3 -0
- package/node_modules/@allyhub-next/runtimes/dist/node-program.js +2 -0
- package/node_modules/@allyhub-next/runtimes/dist/packages.d.ts +65 -0
- package/node_modules/@allyhub-next/runtimes/dist/packages.js +4 -0
- package/node_modules/@allyhub-next/runtimes/dist/runtimes.js +2 -2
- package/node_modules/@allyhub-next/runtimes/dist/unpack.d.ts +7 -0
- package/node_modules/@allyhub-next/runtimes/dist/unpack.js +1 -1
- package/node_modules/@allyhub-next/runtimes/package.json +5 -1
- package/node_modules/@allyhub-next/runtimes/pins/docx/package-lock.json +67 -0
- package/node_modules/@allyhub-next/runtimes/pins/docx/package.json +9 -0
- package/node_modules/@allyhub-next/runtimes/pins/exceljs/package-lock.json +2533 -0
- package/node_modules/@allyhub-next/runtimes/pins/exceljs/package.json +8 -0
- package/node_modules/@allyhub-next/runtimes/pins/gltf-tools/package-lock.json +753 -0
- package/node_modules/@allyhub-next/runtimes/pins/gltf-tools/package.json +14 -0
- package/node_modules/@allyhub-next/runtimes/pins/manifold-3d/package-lock.json +950 -0
- package/node_modules/@allyhub-next/runtimes/pins/manifold-3d/package.json +8 -0
- package/node_modules/@allyhub-next/runtimes/pins/onnxruntime-node/package-lock.json +227 -0
- package/node_modules/@allyhub-next/runtimes/pins/onnxruntime-node/package.json +8 -0
- package/node_modules/@allyhub-next/runtimes/pins/sherpa-onnx-node/package-lock.json +105 -0
- package/node_modules/@allyhub-next/runtimes/pins/sherpa-onnx-node/package.json +8 -0
- package/node_modules/@allyhub-next/runtimes/pins/tesseract.js/package-lock.json +128 -0
- package/node_modules/@allyhub-next/runtimes/pins/tesseract.js/package.json +9 -0
- package/node_modules/@allyhub-next/runtimes/schemas/runtimes.schema.json +5 -24
- package/node_modules/@allyhub-next/scenery/package.json +1 -1
- package/node_modules/@allyhub-next/slides-core/LICENSE +241 -0
- package/node_modules/@allyhub-next/slides-core/dist/animation.d.ts +129 -0
- package/node_modules/@allyhub-next/slides-core/dist/animation.js +2 -0
- package/node_modules/@allyhub-next/slides-core/dist/api.d.ts +649 -0
- package/node_modules/@allyhub-next/slides-core/dist/api.js +4 -0
- package/node_modules/@allyhub-next/slides-core/dist/capabilities.d.ts +18 -0
- package/node_modules/@allyhub-next/slides-core/dist/capabilities.js +2 -0
- package/node_modules/@allyhub-next/slides-core/dist/chart-api.d.ts +165 -0
- package/node_modules/@allyhub-next/slides-core/dist/chart-api.js +2 -0
- package/node_modules/@allyhub-next/slides-core/dist/chart-file.d.ts +11 -0
- package/node_modules/@allyhub-next/slides-core/dist/chart-file.js +2 -0
- package/node_modules/@allyhub-next/slides-core/dist/chart.d.ts +184 -0
- package/node_modules/@allyhub-next/slides-core/dist/chart.js +2 -0
- package/node_modules/@allyhub-next/slides-core/dist/check.d.ts +7 -0
- package/node_modules/@allyhub-next/slides-core/dist/check.js +2 -0
- package/node_modules/@allyhub-next/slides-core/dist/enums.d.ts +146 -0
- package/node_modules/@allyhub-next/slides-core/dist/enums.js +2 -0
- package/node_modules/@allyhub-next/slides-core/dist/file.d.ts +109 -0
- package/node_modules/@allyhub-next/slides-core/dist/file.js +4 -0
- package/node_modules/@allyhub-next/slides-core/dist/index.d.ts +21 -0
- package/node_modules/@allyhub-next/slides-core/dist/index.js +2 -0
- package/node_modules/@allyhub-next/slides-core/dist/measure.d.ts +34 -0
- package/node_modules/@allyhub-next/slides-core/dist/measure.js +2 -0
- package/node_modules/@allyhub-next/slides-core/dist/model.d.ts +278 -0
- package/node_modules/@allyhub-next/slides-core/dist/model.js +2 -0
- package/node_modules/@allyhub-next/slides-core/dist/office.d.ts +58 -0
- package/node_modules/@allyhub-next/slides-core/dist/office.js +2 -0
- package/node_modules/@allyhub-next/slides-core/dist/path.d.ts +6 -0
- package/node_modules/@allyhub-next/slides-core/dist/path.js +2 -0
- package/node_modules/@allyhub-next/slides-core/dist/placeholders.d.ts +7 -0
- package/node_modules/@allyhub-next/slides-core/dist/placeholders.js +2 -0
- package/node_modules/@allyhub-next/slides-core/dist/resolve.d.ts +181 -0
- package/node_modules/@allyhub-next/slides-core/dist/resolve.js +2 -0
- package/node_modules/@allyhub-next/slides-core/dist/script.d.ts +43 -0
- package/node_modules/@allyhub-next/slides-core/dist/script.js +3 -0
- package/node_modules/@allyhub-next/slides-core/dist/stage.d.ts +63 -0
- package/node_modules/@allyhub-next/slides-core/dist/stage.js +2 -0
- package/node_modules/@allyhub-next/slides-core/dist/strict.d.ts +23 -0
- package/node_modules/@allyhub-next/slides-core/dist/strict.js +2 -0
- package/node_modules/@allyhub-next/slides-core/dist/theme.d.ts +72 -0
- package/node_modules/@allyhub-next/slides-core/dist/theme.js +2 -0
- package/node_modules/@allyhub-next/slides-core/dist/units.d.ts +35 -0
- package/node_modules/@allyhub-next/slides-core/dist/units.js +2 -0
- package/node_modules/@allyhub-next/slides-core/package.json +14 -0
- package/node_modules/@allyhub-next/video-core/dist/export.d.ts +6 -5
- package/node_modules/@allyhub-next/video-core/dist/export.js +1 -1
- package/node_modules/@allyhub-next/video-core/dist/fact.d.ts +173 -4
- package/node_modules/@allyhub-next/video-core/dist/fact.js +1 -1
- package/node_modules/@allyhub-next/video-core/dist/formats.d.ts +6 -13
- package/node_modules/@allyhub-next/video-core/dist/formats.js +1 -1
- package/node_modules/@allyhub-next/video-core/dist/index.d.ts +0 -1
- package/node_modules/@allyhub-next/video-core/dist/index.js +1 -1
- package/node_modules/@allyhub-next/video-core/dist/measure.d.ts +83 -0
- package/node_modules/@allyhub-next/video-core/dist/piece.d.ts +8 -9
- package/node_modules/@allyhub-next/video-core/dist/piece.js +1 -1
- package/node_modules/@allyhub-next/video-core/dist/problem.d.ts +5 -1
- package/node_modules/@allyhub-next/video-core/dist/problem.js +1 -1
- package/node_modules/@allyhub-next/video-core/dist/schema.d.ts +0 -2
- package/node_modules/@allyhub-next/video-core/dist/script-edit.d.ts +4 -0
- package/node_modules/@allyhub-next/video-core/dist/script.d.ts +8 -0
- package/node_modules/@allyhub-next/video-core/dist/script.js +1 -1
- package/node_modules/@allyhub-next/video-core/dist/timeline.d.ts +34 -1
- package/node_modules/@allyhub-next/video-core/package.json +1 -1
- package/package.json +15 -8
- package/node_modules/@allyhub-next/video-core/dist/slides.d.ts +0 -37
- package/node_modules/@allyhub-next/video-core/dist/slides.js +0 -2
|
@@ -59,7 +59,7 @@ export interface GeneratedUse {
|
|
|
59
59
|
* shows), during the part at most.
|
|
60
60
|
*/
|
|
61
61
|
as: "footage" | "speech" | "music" | "sound" | "read";
|
|
62
|
-
/** Film seconds it shows or plays from and until; absent on a
|
|
62
|
+
/** Film seconds it shows or plays from and until; absent on a deck, or outside any part. */
|
|
63
63
|
start?: number;
|
|
64
64
|
end?: number;
|
|
65
65
|
}
|
|
@@ -75,11 +75,11 @@ export interface GeneratedFile {
|
|
|
75
75
|
/** Its record's sha256 is not the file's (the gen-mismatch fact). */
|
|
76
76
|
mismatch?: true;
|
|
77
77
|
uses: GeneratedUse[];
|
|
78
|
-
/** Film seconds during which it shows or plays, overlapping uses counted once; absent on a
|
|
78
|
+
/** Film seconds during which it shows or plays, overlapping uses counted once; absent on a deck. */
|
|
79
79
|
seconds?: number;
|
|
80
80
|
}
|
|
81
81
|
/** What each kind of fact measures. */
|
|
82
|
-
export interface FactData {
|
|
82
|
+
export interface FactData extends DeckFactData {
|
|
83
83
|
/** Two text blocks of different layers drawn over each other. */
|
|
84
84
|
"text-overlap": {
|
|
85
85
|
a: MeasuredText;
|
|
@@ -501,7 +501,7 @@ export interface FactData {
|
|
|
501
501
|
*/
|
|
502
502
|
"generated-media": {
|
|
503
503
|
files: GeneratedFile[];
|
|
504
|
-
/** The video's length, seconds; absent on a
|
|
504
|
+
/** The video's length, seconds; absent on a deck. */
|
|
505
505
|
duration?: number;
|
|
506
506
|
/** The combo was put together from its parts, not loaded. */
|
|
507
507
|
estimated?: true;
|
|
@@ -888,6 +888,175 @@ export interface SceneryRange {
|
|
|
888
888
|
most: number;
|
|
889
889
|
mostAt: number;
|
|
890
890
|
}
|
|
891
|
+
/** An edge of a box and how far past a line it is, in pixels. */
|
|
892
|
+
export interface EdgePast {
|
|
893
|
+
side: "top" | "bottom" | "left" | "right";
|
|
894
|
+
px: number;
|
|
895
|
+
}
|
|
896
|
+
/** Facts of a deck: what is measured of each slide as drawn (`deckFacts`, @allyhub-next/slides-core). */
|
|
897
|
+
export interface DeckFactData {
|
|
898
|
+
/** A shape's text past its box, by its lines' glyphs. */
|
|
899
|
+
"text-overflow": {
|
|
900
|
+
shape: string;
|
|
901
|
+
text: string;
|
|
902
|
+
box: Box;
|
|
903
|
+
glyphs: Box;
|
|
904
|
+
edges: EdgePast[];
|
|
905
|
+
/** Its lines, and those past the box. */
|
|
906
|
+
lines: number;
|
|
907
|
+
past: number;
|
|
908
|
+
/** The share autofit shrank it to, when it did and it still does not fit. */
|
|
909
|
+
scale?: number;
|
|
910
|
+
};
|
|
911
|
+
/** A shape partly or wholly past the slide's edge. */
|
|
912
|
+
"shape-off-slide": {
|
|
913
|
+
shape: string;
|
|
914
|
+
box: Box;
|
|
915
|
+
edges: EdgePast[];
|
|
916
|
+
/** Its area past the edge, as a share of its own (0–1). */
|
|
917
|
+
share: number;
|
|
918
|
+
};
|
|
919
|
+
/**
|
|
920
|
+
* Two shapes of a slide over each other, not a master's or a layout's own
|
|
921
|
+
* under another: what shows of each, its box when it is filled or a
|
|
922
|
+
* picture, else its text's glyphs.
|
|
923
|
+
*/
|
|
924
|
+
"shape-overlap": {
|
|
925
|
+
a: string;
|
|
926
|
+
b: string;
|
|
927
|
+
/** Pixels both cover, and that as a share of the smaller (0–1). */
|
|
928
|
+
area: number;
|
|
929
|
+
share: number;
|
|
930
|
+
};
|
|
931
|
+
/** Edges or centres of two shapes, or of a shape and the slide, nearly in line and not. */
|
|
932
|
+
"near-alignment": {
|
|
933
|
+
a: string;
|
|
934
|
+
/** Another shape, or "slide" for the slide's centre. */
|
|
935
|
+
b: string;
|
|
936
|
+
line: "left" | "right" | "top" | "bottom" | "centre-x" | "centre-y";
|
|
937
|
+
/** How far apart, in points. */
|
|
938
|
+
gap: number;
|
|
939
|
+
options: {
|
|
940
|
+
within: number;
|
|
941
|
+
aligned: number;
|
|
942
|
+
};
|
|
943
|
+
};
|
|
944
|
+
/** A shape of one name at different places on slides of one layout. */
|
|
945
|
+
"placement-drift": {
|
|
946
|
+
layout: string;
|
|
947
|
+
shape: string;
|
|
948
|
+
/** Each place, in points, with the slides it is at. */
|
|
949
|
+
places: {
|
|
950
|
+
frame: Box;
|
|
951
|
+
slides: string[];
|
|
952
|
+
}[];
|
|
953
|
+
options: {
|
|
954
|
+
drift: number;
|
|
955
|
+
};
|
|
956
|
+
};
|
|
957
|
+
/** The sizes and weights the deck's text uses, and on how many slides. */
|
|
958
|
+
"type-in-use": {
|
|
959
|
+
type: {
|
|
960
|
+
size: number;
|
|
961
|
+
weight: number;
|
|
962
|
+
slides: number;
|
|
963
|
+
shapes: number;
|
|
964
|
+
}[];
|
|
965
|
+
/** The smallest size, in points. */
|
|
966
|
+
smallest: number;
|
|
967
|
+
};
|
|
968
|
+
/** A text's size as read: on the slide, on a screen from the farthest seat, on a phone. */
|
|
969
|
+
"read-size": {
|
|
970
|
+
shape: string;
|
|
971
|
+
text: string;
|
|
972
|
+
/** Its smallest size and lowercase x's height, in points on the slide. */
|
|
973
|
+
size: number;
|
|
974
|
+
xHeight?: number;
|
|
975
|
+
/**
|
|
976
|
+
* On a room's screen, when one is given: its lowercase x (`by: "x"`), or for text with
|
|
977
|
+
* no lowercase Latin letter (CJK) its em (`by: "em"`), in millimetres,
|
|
978
|
+
* and the angle that makes at the farthest seat, in minutes of arc.
|
|
979
|
+
*/
|
|
980
|
+
screen?: {
|
|
981
|
+
by: "x" | "em";
|
|
982
|
+
mm: number;
|
|
983
|
+
arcmin: number;
|
|
984
|
+
};
|
|
985
|
+
/** Its size in points on the phone of `options.phone`, the slide fitted inside it. */
|
|
986
|
+
phone: number;
|
|
987
|
+
options: {
|
|
988
|
+
room?: {
|
|
989
|
+
screen: number;
|
|
990
|
+
distance: number;
|
|
991
|
+
};
|
|
992
|
+
phone: [number, number];
|
|
993
|
+
};
|
|
994
|
+
};
|
|
995
|
+
/** Words, lines and texts on a slide. */
|
|
996
|
+
"words-on-slide": {
|
|
997
|
+
words: number;
|
|
998
|
+
lines: number;
|
|
999
|
+
texts: number;
|
|
1000
|
+
};
|
|
1001
|
+
/** A picture drawn larger than its pixels, or stretched. */
|
|
1002
|
+
"picture-resolution": {
|
|
1003
|
+
shape: string;
|
|
1004
|
+
source: [number, number];
|
|
1005
|
+
shown: [number, number];
|
|
1006
|
+
box: Box;
|
|
1007
|
+
/** Slide pixels per source pixel, the larger of the two directions (over 1: enlarged). */
|
|
1008
|
+
scale: number;
|
|
1009
|
+
/** Source pixels per inch of the slide, the smaller of the two directions. */
|
|
1010
|
+
ppi: number;
|
|
1011
|
+
/** How much wider than its pixels it is drawn, against how much taller, less 1 (0: not stretched). */
|
|
1012
|
+
stretch: number;
|
|
1013
|
+
};
|
|
1014
|
+
/** A shape another covers whole. */
|
|
1015
|
+
/** Covered whole at every step that shows it (`by`), or shown by no step. */
|
|
1016
|
+
"shape-hidden": {
|
|
1017
|
+
shape: string;
|
|
1018
|
+
by?: string;
|
|
1019
|
+
never?: true;
|
|
1020
|
+
};
|
|
1021
|
+
/** A table's rows its words made taller than they are set, in points, which moves all that is under them. */
|
|
1022
|
+
"chart-data": {
|
|
1023
|
+
shape: string;
|
|
1024
|
+
type: string;
|
|
1025
|
+
categories: number;
|
|
1026
|
+
series: number;
|
|
1027
|
+
/** The smallest and largest number it shows; absent when it shows none. */
|
|
1028
|
+
low?: number;
|
|
1029
|
+
high?: number;
|
|
1030
|
+
/** The project file its numbers came from; absent: written in slides.yaml or the code. */
|
|
1031
|
+
source?: string;
|
|
1032
|
+
};
|
|
1033
|
+
"table-grown": {
|
|
1034
|
+
shape: string;
|
|
1035
|
+
/** Its height as set and as drawn. */
|
|
1036
|
+
set: number;
|
|
1037
|
+
drawn: number;
|
|
1038
|
+
rows: {
|
|
1039
|
+
row: number;
|
|
1040
|
+
set: number;
|
|
1041
|
+
drawn: number;
|
|
1042
|
+
}[];
|
|
1043
|
+
};
|
|
1044
|
+
/**
|
|
1045
|
+
* The fonts a deck's PowerPoint file names, and whether each is one
|
|
1046
|
+
* every PowerPoint, Keynote and Google Slides has (`options.standard`):
|
|
1047
|
+
* one that is not is replaced where the file is opened without it.
|
|
1048
|
+
*/
|
|
1049
|
+
"deck-fonts": {
|
|
1050
|
+
fonts: {
|
|
1051
|
+
name: string;
|
|
1052
|
+
where: "theme" | "text";
|
|
1053
|
+
standard: boolean;
|
|
1054
|
+
}[];
|
|
1055
|
+
options: {
|
|
1056
|
+
standard: string[];
|
|
1057
|
+
};
|
|
1058
|
+
};
|
|
1059
|
+
}
|
|
891
1060
|
/** Where a scenery fact is from: the scenery layer (its name), and its window on its part's clock, s. */
|
|
892
1061
|
export interface SceneryFactPlace {
|
|
893
1062
|
layer: string;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/*! AllyHub. Copyright (c) 2026 AllyHub, Inc. All rights reserved. Use is subject to LICENSE.md. */
|
|
2
|
-
import{READ_DEFAULTS as
|
|
2
|
+
import{READ_DEFAULTS as c,boxRows as f,contentBox as l,freeBands as d,unionSpans as u,wordsAtOnce as p}from"./measure.js";export const FACT_KINDS={"text-speaker":"Text over the speaker's face box or person matte","text-off-frame":"Text the frame's edges cut: its glyphs outside the frame, in pixels and as a share","text-contrast":"Text against the pixels behind its glyphs: WCAG contrast ratios, the lowest, a low percentile and the median","text-covered":"Text in the area a platform's interface covers","text-overlap":"Text over text of another layer","text-overlap-own":"Text over text of the same layer","text-outside":"Text reaching outside a box it is drawn inside (a background, border or shadow)","text-time":"How long each text shows whole, against its words, and how large it is on a phone, with its lowercase letters' height","words-on-screen":"Words whole on screen at once in each part: the most, and every change","footage-scale":"Footage enlargement: output pixels per source pixel, largest and smallest","free-bands":"Bands of the frame inside the covered edges that the speaker's face box or person matte leaves free","graphics-under-footage":"Graphic layers drawn under footage (listed before it), and how much of the frame the footage covers","flat-frames":"Runs of nearly flat frames unlike the picture around them","still-picture":"Stretches where the picture holds: how long, and how much changed in them","cut-seam":"How things move either side of each join: direction, speed and the change across; things named alike on both sides",flash:"Frames unlike both the frame before and the frame after: a flash, a blank frame, a layer for one frame","music-length":"Music length against video length","join-loudness":"Speech loudness either side of a join, or why it was not measured","matrix-coverage":"Matrix: combos asked for, possible and chosen, per candidate","generated-media":"Generated media (files with a .gen.json record) shown or played, and when","gen-mismatch":"A .gen.json record whose sha256 is not its file's, or that cannot be read",fallback:"Drawn or timed a fallback way: a face track, matte, take or music tempo missing","scenery-contact":"3D scenery: named objects that touch or cross, with the shared area, the crossing's length, how deep at least, the lift that clears them and the shared volume","scenery-support":"3D scenery: what each named object rests on, the gap below or how far it is sunk, its footprint in contact and its centre of mass against the contact","scenery-bake":"3D scenery: whether a scenery layer's scenery was drawn with its bake laid; when not, the scene's digest looked for, whether it was baked before (out of date) or never, and the command that makes it","mesh-health":"3D scenery: named objects whose surface is open, non-manifold, degenerate or crosses itself","camera-clearance":"3D scenery: a scenery layer's camera near a surface, inside an object, or cutting geometry with its near plane","camera-motion":"3D scenery: a scenery layer's camera motion in its own frame: peaks of truck, pedestal, dolly, pan, tilt, roll, zoom, speed, acceleration and jerk, smoothness, the largest step","scenery-screen":"3D scenery: a screen in a scenery layer: when it is on the frame, its share, how much its content is enlarged or shrunk, its angle to the view, how much is hidden in front of it, how blurred with an aperture, where it is drawn and at what scale, its smallest text on the frame as drawn and the speed of each stretch between cues","scenery-screen-fidelity":"3D scenery: a screen drawn in the scenery against its own element drawn flat: the colour difference, the share of pixels that differ, the regions where they differ and the elements in them the scenery's picture is known to draw otherwise","text-overflow":"A deck: a shape's text past its box, by its lines' glyphs: how far, and the lines past it","shape-off-slide":"A deck: a shape partly or wholly past the slide's edge, and the share of it outside","shape-overlap":"A deck: two shapes of a slide over each other (not a master's or a layout's own under another), and by how much","near-alignment":"A deck: edges and centres of two shapes, or of a shape and the slide, nearly in line and not, in points","placement-drift":"A deck: a shape of one name at different places on slides of one layout","type-in-use":"A deck: the text sizes and weights it uses, on how many slides each, and the smallest","read-size":"A deck: each text's size on the slide, on a phone, and with --room on a room's screen and at its farthest seat","words-on-slide":"A deck: words, lines and texts on each slide","picture-resolution":"A deck: a picture drawn larger than its pixels, its pixels per inch, and how much it is stretched","shape-hidden":"A deck: a shape another covers whole at every build, or an animation that never shows its shape","chart-data":"A chart's numbers: how many, how far they run, and the file they came from","table-grown":"A deck: a table's rows its words made taller than they are set","deck-fonts":"A deck: the fonts its PowerPoint file names, and whether each is one every PowerPoint, Keynote and Google Slides has","cut-in-word":"A part playing a stretch of a video item cut inside one of its words"};export function isFactKind(e){return Object.hasOwn(FACT_KINDS,e)}export function fact(e,a,o){return{kind:e,...a,data:o}}export function factsOf(e,a){return e.filter(o=>o.kind===a)}export function countFacts(e){const a={};for(const o of e)a[o.kind]=(a[o.kind]??0)+1;return a}export function filterFacts(e,a){return e.filter(o=>!(a.kinds?.length&&!a.kinds.includes(o.kind)||a.part!==void 0&&o.part!==a.part||(a.from!==void 0||a.to!==void 0)&&(o.t===void 0||a.from!==void 0&&o.t<a.from-1e-6||a.to!==void 0&&o.t>a.to+1e-6)))}export function freeBandsData(e){const a=l(e.width,e.height,e.safe),o=(r,s)=>{const n=u(s.flat());return{files:r,seen:s.filter(h=>h.length>0).length,rows:n,bands:d(a,n)}},i="missing"in e.face?e.face:{...o(e.face.files,e.face.boxes.map(r=>{const s=r?f(r,a.x):void 0;return s?[s]:[]})),...e.face.speaker===void 0?{}:{speaker:e.face.speaker}},t="missing"in e.person?e.person:o(e.person.files,e.person.rows);return{frame:[e.width,e.height],covered:e.safe,content:a,...e.profile?{profile:e.profile}:{},moments:e.moments,face:i,person:t,bands:d(a,[..."rows"in i?i.rows:[],..."rows"in t?t.rows:[]])}}export function layoutFacts(e,a,o){const i=[];for(const t of e.moments){const r={...a,part:t.part,t:t.t};for(const s of t.overlaps){const n=t.texts[s.a],h=t.texts[s.b];!n||!h||i.push(fact("text-overlap",r,{a:n,b:h,area:s.area,share:s.share}))}for(const s of t.ownOverlaps){const n=t.texts[s.a],h=t.texts[s.b];!n||!h||i.push(fact("text-overlap-own",r,{a:n,b:h,area:s.area,share:s.share}))}for(const s of t.outside){const n=t.texts[s.text];n&&i.push(fact("text-outside",r,{text:n,container:s.container,edges:s.edges}))}for(const s of t.faceOverlaps){const n=t.texts[s.text];!n||!t.face||i.push(fact("text-speaker",r,{text:n,face:{box:t.face,area:s.area,ofText:s.ofText,ofFace:s.ofFace}}))}for(const s of t.offFrame){const n=t.texts[s.text];n&&i.push(fact("text-off-frame",r,{text:n,frame:[e.width,e.height],edges:s.edges,outside:s.outside,share:s.share,glyphs:s.glyphs}))}for(const s of t.safeOverlaps){const n=t.texts[s.text];n&&i.push(fact("text-covered",r,{text:n,frame:[e.width,e.height],covered:e.safe,...o?{profile:o}:{},edges:s.edges}))}}for(const t of e.reading?.texts??[])i.push(fact("text-time",{...a,part:t.part,t:t.first},{text:t.text,words:t.words,chars:t.chars,seconds:t.seconds,spans:t.spans,onScreen:t.onScreen,...t.size?{size:t.size}:{},options:e.reading?.options??c}));for(const t of p(e.reading?.texts??[])){const{part:r,...s}=t;i.push(fact("words-on-screen",{...a,part:r,t:t.from},{...s,options:e.reading?.options??c}))}for(const t of e.footage){const{part:r,...s}=t;i.push(fact("footage-scale",{...a,part:r,t:t.max.t},s))}return i}
|
|
@@ -169,20 +169,15 @@ export declare function fpsRational(fps: number): {
|
|
|
169
169
|
export declare function toFrame(t: number, fps?: number): number;
|
|
170
170
|
/** Rounds a time to the nearest frame boundary. */
|
|
171
171
|
export declare function roundToFrame(t: number, fps?: number): number;
|
|
172
|
-
/** Document formats a paged output can have besides the four presets. */
|
|
173
|
-
export declare const PAGE_FORMATS: readonly ["a4", "letter"];
|
|
174
|
-
export type PageFormat = (typeof PAGE_FORMATS)[number];
|
|
175
172
|
/**
|
|
176
|
-
* A format: one of the four presets, a
|
|
173
|
+
* A format: one of the four presets, a platform profile, or `WxH` in
|
|
177
174
|
* pixels (each side 64–8192), e.g. "1200x630". Presets win: "16x9" is
|
|
178
175
|
* the 1920×1080 frame, not 16 by 9 pixels.
|
|
179
176
|
*/
|
|
180
|
-
export type Format = Preset | Profile |
|
|
181
|
-
/** Pixels per inch of the document formats: print quality for PNGs and slides. */
|
|
182
|
-
export declare const PAGE_DPI = 150;
|
|
177
|
+
export type Format = Preset | Profile | `${number}x${number}`;
|
|
183
178
|
/**
|
|
184
|
-
* A format with some of its numbers changed, in `formats`
|
|
185
|
-
*
|
|
179
|
+
* A format with some of its numbers changed, in `formats` in place of
|
|
180
|
+
* its name: its covered edges (`safe`, any
|
|
186
181
|
* format), and a platform profile's longest length (`maxDuration`,
|
|
187
182
|
* AK-F001) and mastering loudness (`loudness`, LUFS). Its name stays the
|
|
188
183
|
* format's own (`format`): combos, file names and --format use it, so a
|
|
@@ -230,11 +225,9 @@ export declare function isVideoFormat(v: unknown): v is VideoFormat;
|
|
|
230
225
|
export declare function isFormat(v: unknown): v is Format;
|
|
231
226
|
/** The formats a video can have, in words (for errors and help). */
|
|
232
227
|
export declare const VIDEO_FORMAT_HELP: string;
|
|
233
|
-
/** The formats a paged output can have, in words (for errors and help). */
|
|
234
|
-
export declare const FORMAT_HELP: string;
|
|
235
228
|
/**
|
|
236
|
-
* The paper a format prints on (CSS `@page size`):
|
|
237
|
-
*
|
|
229
|
+
* The paper a format prints on (CSS `@page size`): its pixels (96 per
|
|
230
|
+
* inch, as Chrome prints). A deck's timeline says its own (`paper`).
|
|
238
231
|
*/
|
|
239
232
|
export declare function paperOf(format: string): string;
|
|
240
233
|
//# sourceMappingURL=formats.d.ts.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/*! AllyHub. Copyright (c) 2026 AllyHub, Inc. All rights reserved. Use is subject to LICENSE.md. */
|
|
2
|
-
export const PRESETS=["16x9","9x16","1x1","4x5"];export function isPreset(e){return typeof e=="string"&&PRESETS.includes(e)}const f={"16x9":{width:1920,height:1080,orient:"landscape",safe:{top:60,bottom:90,left:80,right:80}},"9x16":{width:1080,height:1920,orient:"portrait",safe:{top:150,bottom:400,left:40,right:140}},"1x1":{width:1080,height:1080,orient:"square",safe:{top:50,bottom:90,left:40,right:40}},"4x5":{width:1080,height:1350,orient:"portrait",safe:{top:60,bottom:120,left:40,right:40}}};export function contentEdges(e,t={}){const{width:
|
|
2
|
+
export const PRESETS=["16x9","9x16","1x1","4x5"];export function isPreset(e){return typeof e=="string"&&PRESETS.includes(e)}const f={"16x9":{width:1920,height:1080,orient:"landscape",safe:{top:60,bottom:90,left:80,right:80}},"9x16":{width:1080,height:1920,orient:"portrait",safe:{top:150,bottom:400,left:40,right:140}},"1x1":{width:1080,height:1080,orient:"square",safe:{top:50,bottom:90,left:40,right:40}},"4x5":{width:1080,height:1350,orient:"portrait",safe:{top:60,bottom:120,left:40,right:40}}};export function contentEdges(e,t={}){const{width:n,height:i,orient:o,safe:r}=e,s=Math.min(n,i)/1080,m=t.margin??(o==="landscape"?120:84)*s,a=Math.max(m,r.left,r.right),p=Math.max(a,r.top+(t.topGap??30*s)),l=i-Math.max(a,r.bottom+(t.bottomGap??20*s));return{k:s,pad:a,top:p,bottom:l,left:a,right:n-a}}export function presetInfo(e){return f[e]}export const PROFILES=["tiktok","reels","shorts","meta-feed","amazon","linkedin"];export function isProfile(e){return typeof e=="string"&&PROFILES.includes(e)}const d={tiktok:{name:"tiktok",label:"TikTok",width:1080,height:1920,safe:{top:240,bottom:660,left:120,right:180},maxDuration:600,loudness:-14,file:{container:"mp4",video:"h264",audio:"aac",cover:{width:1080,height:1920},maxBytes:5e8,encode:{crf:20,maxKbps:6e3}},served:{video:{codec:"h264",profile:"high",kbps:900,width:720,height:1280,fps:30,preset:"slow"},audio:{codec:"he-aac-v2",kbps:32,rate:44100,channels:2}}},reels:{name:"reels",label:"Instagram Reels",width:1080,height:1920,safe:{top:269,bottom:672,left:65,right:65},maxDuration:180,loudness:-14,file:{container:"mp4",video:"h264",audio:"aac",cover:{width:1080,height:1920},maxBytes:4e9,encode:{crf:20,maxKbps:6e3}}},shorts:{name:"shorts",label:"YouTube Shorts",width:1080,height:1920,safe:{top:288,bottom:672,left:48,right:192},maxDuration:180,loudness:-14,file:{container:"mp4",video:"h264",audio:"aac",cover:{width:1080,height:1920},maxBytes:256e9,encode:{crf:20,maxKbps:8e3}}},"meta-feed":{name:"meta-feed",label:"Facebook and Instagram feed",width:1080,height:1350,safe:{top:60,bottom:120,left:40,right:40},maxDuration:14460,loudness:-14,file:{container:"mp4",video:"h264",audio:"aac",cover:{width:1080,height:1350},maxBytes:4e9,encode:{crf:20,maxKbps:6e3}}},amazon:{name:"amazon",label:"Amazon Sponsored Brands video",width:1920,height:1080,safe:{top:60,bottom:90,left:80,right:80},maxDuration:45,loudness:-14,file:{container:"mp4",video:"h264",audio:"aac",cover:{width:1920,height:1080},maxBytes:5e8,encode:{crf:20,maxKbps:8e3}}},linkedin:{name:"linkedin",label:"LinkedIn",width:1080,height:1080,safe:{top:50,bottom:90,left:40,right:40},maxDuration:1800,loudness:-14,file:{container:"mp4",video:"h264",audio:"aac",cover:{width:1080,height:1080},maxBytes:2e8,encode:{crf:20,maxKbps:6e3}}}};export function profileInfo(e){return d[e]}export function profileOf(e){return isProfile(e)?d[e]:void 0}export const FPS=30,LOAD_LIMIT=10,SEEK_LIMIT=30,LOAD_WAITS=4,MAX_FPS=120;const u=[24,30,48,60,120];export const FPS_HELP="a whole number from 1 to 120, or an NTSC rate: 23.976, 29.97, 47.952, 59.94 or 119.88 (also written 24000/1001, 30000/1001 …)";export function parseFps(e){if(typeof e=="number"){if(!Number.isFinite(e))return;if(Number.isInteger(e))return e>=1&&e<=MAX_FPS?e:void 0;for(const i of u){const o=i*1e3/1001;if(Math.abs(e-o)<.005)return o}return}if(typeof e!="string")return;const t=e.trim(),n=/^(\d+)\s*\/\s*(\d+)$/.exec(t);if(n){const i=Number(n[1]),o=Number(n[2]);return o===1?parseFps(i):o===1001&&u.some(r=>r*1e3===i)?i/o:void 0}return t!==""&&Number.isFinite(Number(t))?parseFps(Number(t)):void 0}export function fpsRational(e){for(const n of u)if(Math.abs(e-n*1e3/1001)<1e-9)return{num:n*1e3,den:1001,text:`${String(n*1e3)}/1001`};const t=Math.round(e);return{num:t,den:1,text:String(t)}}export function toFrame(e,t=FPS){return Math.floor(e*t+1e-9)/t}export function roundToFrame(e,t=FPS){return Math.round(e*t)/t}const x=/^([1-9]\d{1,3})x([1-9]\d{1,3})$/,g={top:0,bottom:0,left:0,right:0},h=(e,t)=>e>t?"landscape":e<t?"portrait":"square";export function formatName(e){return typeof e=="string"?e:e.format}export function formatEntry(e,t){return e.find(n=>formatName(n)===t)}function b(e,t){const n={...e.safe,...c(t.safe??{})},i=e.profile;return{...e,safe:n,...i?{profile:{...i,safe:n,...t.maxDuration===void 0?{}:{maxDuration:t.maxDuration},...t.loudness===void 0?{}:{loudness:t.loudness}}}:{}}}function c(e){return Object.fromEntries(Object.entries(e).filter(([,t])=>t!==void 0))}export function formatSpecProblem(e){const t=formatInfo(e.format);if(!t)return;const n={...t.safe,...c(e.safe??{})};for(const[i,o]of Object.entries(e.safe??{}))if(o!==void 0&&(!Number.isInteger(o)||o<0))return`safe.${i} is ${String(o)}: covered edges are whole pixels from 0`;if(n.left+n.right>=t.width||n.top+n.bottom>=t.height)return`safe leaves nothing of the ${String(t.width)}×${String(t.height)} frame uncovered`;if(!t.profile&&(e.maxDuration!==void 0||e.loudness!==void 0))return`${e.format} is not a platform profile (${PROFILES.join(", ")}): maxDuration and loudness belong to one; a video's own limit is video(…, { maxDuration }) and its loudness video(…, { master })`}export function formatInfo(e){if(typeof e!="string"){const o=formatInfo(e.format);return o&&b(o,e)}if(isPreset(e))return f[e];if(isProfile(e)){const o=d[e];return{width:o.width,height:o.height,orient:h(o.width,o.height),safe:o.safe,profile:o}}const t=x.exec(e);if(!t)return;const n=Number(t[1]),i=Number(t[2]);if(!(n<64||i<64||n>8192||i>8192))return{width:n,height:i,orient:h(n,i),safe:g}}export function isVideoFormat(e){if(isPreset(e)||isProfile(e))return!0;if(typeof e!="string")return!1;const t=formatInfo(e);return t!==void 0&&t.width%2===0&&t.height%2===0}export function isFormat(e){return typeof e=="string"&&formatInfo(e)!==void 0}export const VIDEO_FORMAT_HELP=`one of ${PRESETS.join(", ")}, a platform profile (${PROFILES.join(", ")}), or WIDTHxHEIGHT in pixels with even sides from 64 to 8192, such as 1280x720`;export function paperOf(e){const t=formatInfo(e)??f["16x9"];return`${String(t.width)}px ${String(t.height)}px`}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/*! AllyHub. Copyright (c) 2026 AllyHub, Inc. All rights reserved. Use is subject to LICENSE.md. */
|
|
2
|
-
export*from"./piece.js";export*from"./
|
|
2
|
+
export*from"./piece.js";export*from"./timeline.js";export*from"./look.js";export*from"./formats.js";export*from"./placement.js";export*from"./media.js";export*from"./gen.js";export*from"./messages.js";export*from"./script.js";export*from"./anchors.js";export*from"./marks.js";export*from"./script-edit.js";export*from"./edit.js";export*from"./timing.js";export*from"./music.js";export*from"./words.js";export*from"./speech.js";export*from"./edits.js";export*from"./voice.js";export*from"./transcript.js";export*from"./cut-report.js";export*from"./captions.js";export*from"./transition.js";export*from"./motion.js";export*from"./footage-motion.js";export*from"./backdrop.js";export*from"./measure.js";export*from"./seams.js";export*from"./contrast.js";export*from"./matrix.js";export*from"./problem.js";export*from"./fact.js";export*from"./console.js";export*from"./export.js";export*from"./schema.js";export*from"./audio-types.js";export*from"./render-types.js";export*from"./sound-under.js";
|
|
@@ -212,9 +212,92 @@ export interface TextSize {
|
|
|
212
212
|
phone: number;
|
|
213
213
|
};
|
|
214
214
|
}
|
|
215
|
+
/** A text of a deck's shape as drawn. */
|
|
216
|
+
export interface DeckTextLayout {
|
|
217
|
+
text: string;
|
|
218
|
+
words: number;
|
|
219
|
+
/** Its lines as drawn, a box of each one's glyphs, in the slide's pixels. */
|
|
220
|
+
lines: Box[];
|
|
221
|
+
/** All of its glyphs; null when none shows. */
|
|
222
|
+
glyphs: Box | null;
|
|
223
|
+
/** The sizes and weights it is drawn at, each once: size and lowercase x's height in points. */
|
|
224
|
+
type: {
|
|
225
|
+
size: number;
|
|
226
|
+
weight: number;
|
|
227
|
+
xHeight?: number;
|
|
228
|
+
}[];
|
|
229
|
+
/** The share autofit shrank it to, when it did. */
|
|
230
|
+
scale?: number;
|
|
231
|
+
/** Its first paragraph's alignment: the line it is aligned by. */
|
|
232
|
+
align?: "l" | "ctr" | "r" | "just";
|
|
233
|
+
}
|
|
234
|
+
/** A deck's shape as drawn on its slide. */
|
|
235
|
+
export interface DeckShapeLayout {
|
|
236
|
+
name: string;
|
|
237
|
+
/** placeholder, textbox, picture, movie, autoshape, line, component. */
|
|
238
|
+
kind: string;
|
|
239
|
+
/** Where it comes from: its master's or layout's own, or the slide's (placeholders are the slide's). */
|
|
240
|
+
level: "master" | "layout" | "slide";
|
|
241
|
+
placeholder?: string;
|
|
242
|
+
/** Its frame as set, in the slide's pixels. */
|
|
243
|
+
frame: Box;
|
|
244
|
+
/** Its box as drawn (a shape that fits its text has grown to it). */
|
|
245
|
+
box: Box;
|
|
246
|
+
/** It hides what is under it: filled, a picture, a movie. */
|
|
247
|
+
opaque: boolean;
|
|
248
|
+
/** Not drawn at this moment: its entrance is to come, or its exit has been. */
|
|
249
|
+
hidden?: boolean;
|
|
250
|
+
text?: DeckTextLayout;
|
|
251
|
+
/** A table's rows, each as tall as it is set and as it is drawn, in the slide's pixels. */
|
|
252
|
+
rows?: {
|
|
253
|
+
set: number;
|
|
254
|
+
drawn: number;
|
|
255
|
+
}[];
|
|
256
|
+
/** A chart's numbers: how many, how far they run, and the project file they came from. */
|
|
257
|
+
chart?: {
|
|
258
|
+
type: string;
|
|
259
|
+
categories: number;
|
|
260
|
+
series: number;
|
|
261
|
+
low?: number;
|
|
262
|
+
high?: number;
|
|
263
|
+
source?: string;
|
|
264
|
+
};
|
|
265
|
+
picture?: {
|
|
266
|
+
/** The file's own pixels. */
|
|
267
|
+
source: [width: number, height: number];
|
|
268
|
+
/** The part of them shown (its crop). */
|
|
269
|
+
shown: [width: number, height: number];
|
|
270
|
+
};
|
|
271
|
+
}
|
|
272
|
+
/** A deck's slide as drawn at a still: one of its steps'. */
|
|
273
|
+
export interface DeckSlideLayout {
|
|
274
|
+
slide: string;
|
|
275
|
+
/** How many steps the slide has, so that all of them measured can be told. */
|
|
276
|
+
steps?: number;
|
|
277
|
+
/** Its still, in the deck's seconds. */
|
|
278
|
+
t: number;
|
|
279
|
+
layout: string;
|
|
280
|
+
hidden: boolean;
|
|
281
|
+
notes?: string;
|
|
282
|
+
/** Back to front, as drawn; an empty placeholder is not drawn. */
|
|
283
|
+
shapes: DeckShapeLayout[];
|
|
284
|
+
}
|
|
285
|
+
/** A deck as drawn, measured for its facts. */
|
|
286
|
+
export interface DeckLayout {
|
|
287
|
+
/** The slide's pixels per point. */
|
|
288
|
+
pxPerPt: number;
|
|
289
|
+
/** The fonts its PowerPoint file names: its theme's, and those its text names itself. */
|
|
290
|
+
fonts?: {
|
|
291
|
+
name: string;
|
|
292
|
+
where: "theme" | "text";
|
|
293
|
+
}[];
|
|
294
|
+
slides: DeckSlideLayout[];
|
|
295
|
+
}
|
|
215
296
|
export interface LayoutReport {
|
|
216
297
|
width: number;
|
|
217
298
|
height: number;
|
|
299
|
+
/** A deck's slides as drawn (a deck's measure() only). */
|
|
300
|
+
deck?: DeckLayout;
|
|
218
301
|
/** The format's covered edges, in pixels. */
|
|
219
302
|
safe: SafeZone;
|
|
220
303
|
moments: LayoutMoment[];
|
|
@@ -8,7 +8,6 @@ import type { Ease } from "./motion.js";
|
|
|
8
8
|
import type { MusicStretch, MusicTime } from "./music.js";
|
|
9
9
|
import type { PixelRect } from "./timeline.js";
|
|
10
10
|
import type { TransitionInput } from "./transition.js";
|
|
11
|
-
import type { PagedOutput, PagedPiece } from "./slides.js";
|
|
12
11
|
/** Marks a piece made by video() or slides(). */
|
|
13
12
|
export declare const PIECE_BRAND = "__allyhubPiece";
|
|
14
13
|
/** Marks a part made by part(), so the runtime can tell parts from other values. */
|
|
@@ -19,8 +18,8 @@ export declare const LAYER_BRAND = "__allyhubLayer";
|
|
|
19
18
|
export declare const SPEECH_BRAND = "__allyhubSpeech";
|
|
20
19
|
/** Marks a media value (an import or ctx.asset), whose url the runtime resolves. */
|
|
21
20
|
export declare const MEDIA_BRAND = "__allyhubMedia";
|
|
22
|
-
/** The
|
|
23
|
-
export declare const OUTPUT_KINDS: readonly ["video"
|
|
21
|
+
/** The output kinds of a piece: a video (a deck is @allyhub-next/slides-core's). */
|
|
22
|
+
export declare const OUTPUT_KINDS: readonly ["video"];
|
|
24
23
|
export type OutputKind = (typeof OUTPUT_KINDS)[number];
|
|
25
24
|
/**
|
|
26
25
|
* A moment in a part: a word of its speech ("inbox"), the nth time it is
|
|
@@ -141,7 +140,7 @@ export interface EmbeddedVideo {
|
|
|
141
140
|
}
|
|
142
141
|
export interface StageContext {
|
|
143
142
|
look: Look;
|
|
144
|
-
/** The format being drawn, e.g. "9x16"
|
|
143
|
+
/** The format being drawn, e.g. "9x16". */
|
|
145
144
|
format: Format;
|
|
146
145
|
/** Its pixels, orientation and platform safe zone. */
|
|
147
146
|
dims: SizeInfo;
|
|
@@ -1074,7 +1073,7 @@ export interface VideoPiece extends PieceCommon, VideoOptions {
|
|
|
1074
1073
|
parts(ctx: PieceContext): PartSpec[] | Promise<PartSpec[]>;
|
|
1075
1074
|
}
|
|
1076
1075
|
/** One deliverable: a video or a deck. Another one is an item of its own. */
|
|
1077
|
-
export type PieceDefinition = VideoPiece
|
|
1076
|
+
export type PieceDefinition = VideoPiece;
|
|
1078
1077
|
export declare function isPieceDefinition(v: unknown): v is PieceDefinition;
|
|
1079
1078
|
/**
|
|
1080
1079
|
* A piece's output as the build and the runtime handle it: its kind, the
|
|
@@ -1086,18 +1085,18 @@ export interface OutputDefinition<K extends OutputKind = OutputKind> {
|
|
|
1086
1085
|
build(ctx: PieceContext): unknown;
|
|
1087
1086
|
options: object;
|
|
1088
1087
|
}
|
|
1089
|
-
export interface VideoOutput extends OutputDefinition
|
|
1088
|
+
export interface VideoOutput extends OutputDefinition {
|
|
1090
1089
|
build: VideoBuild;
|
|
1091
1090
|
options: VideoOptions;
|
|
1092
1091
|
}
|
|
1093
1092
|
/**
|
|
1094
1093
|
* The name of a piece's one output: its item's kind, as its entry file is
|
|
1095
|
-
* named (video, slides)
|
|
1094
|
+
* named (video, slides).
|
|
1096
1095
|
*/
|
|
1097
1096
|
export declare const outputName: (kind: OutputKind) => string;
|
|
1098
1097
|
/** A piece's one output: its kind, its build function and its options. */
|
|
1099
|
-
export declare function outputOf(def: PieceDefinition): VideoOutput
|
|
1100
|
-
/** The function that makes a
|
|
1098
|
+
export declare function outputOf(def: PieceDefinition): VideoOutput;
|
|
1099
|
+
/** The function that makes a video's parts. */
|
|
1101
1100
|
export declare const buildOf: (def: PieceDefinition) => unknown;
|
|
1102
1101
|
/**
|
|
1103
1102
|
* Whether a piece is the one a command names, or under it as a folder of
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/*! AllyHub. Copyright (c) 2026 AllyHub, Inc. All rights reserved. Use is subject to LICENSE.md. */
|
|
2
|
-
import{ANCHOR_NAME as o}from"./anchors.js";export const PIECE_BRAND="__allyhubPiece",PART_BRAND="__allyhubPart",LAYER_BRAND="__allyhubLayer",SPEECH_BRAND="__allyhubSpeech",MEDIA_BRAND="__allyhubMedia",OUTPUT_KINDS=["video"
|
|
2
|
+
import{ANCHOR_NAME as o}from"./anchors.js";export const PIECE_BRAND="__allyhubPiece",PART_BRAND="__allyhubPart",LAYER_BRAND="__allyhubLayer",SPEECH_BRAND="__allyhubSpeech",MEDIA_BRAND="__allyhubMedia",OUTPUT_KINDS=["video"];export function partAnchorsProblem(t){if(typeof t!="object"||t===null||Array.isArray(t))return"is { name: seconds } or { name: [from, to] }";const e=r=>typeof r=="number"&&Number.isFinite(r)&&r>=0;for(const[r,n]of Object.entries(t)){if(!o.test(r))return`"${r}" is not a name of letters, digits, _ and -`;if(!(Array.isArray(n)?n.length===2&&e(n[0])&&e(n[1])&&n[1]>=n[0]:e(n)))return`.${r} is seconds from the part's start, or [from, to] with to not before from (not ${JSON.stringify(n)})`}}export function partAnchorList(t){return Object.entries(t??{}).map(([e,r])=>typeof r=="number"?{name:e,at:r}:{name:e,at:r[0],end:r[1]})}export const SPEECH_SPEED={min:.5,max:2};export function speechSpeedProblem(t){return typeof t=="number"&&Number.isFinite(t)&&t>=SPEECH_SPEED.min&&t<=SPEECH_SPEED.max?void 0:`speed is how many times as fast it plays, from ${String(SPEECH_SPEED.min)} to ${String(SPEECH_SPEED.max)} (1 as recorded), not ${typeof t=="number"?String(t):JSON.stringify(t)}`}export function isSpeechSpec(t){return typeof t=="object"&&t!==null&&SPEECH_BRAND in t}export const ORIENT_KEYS=["landscape","portrait","square","default"];export function isPerOrient(t){return typeof t=="object"&&t!==null&&!Array.isArray(t)}export function forOrient(t,e){return isPerOrient(t)?t[e]??t.default:t}export function isLayerSpec(t){return typeof t=="object"&&t!==null&&LAYER_BRAND in t}export function isPartSpec(t){return typeof t=="object"&&t!==null&&PART_BRAND in t}export const PART_DEFAULTS={dur:4,lead:.2,tail:.3};export function partDefaults(...t){const e={...PART_DEFAULTS};for(const r of t)r?.dur!==void 0&&(e.dur=r.dur),r?.lead!==void 0&&(e.lead=r.lead),r?.tail!==void 0&&(e.tail=r.tail);return e}export function isPieceDefinition(t){return typeof t=="object"&&t!==null&&PIECE_BRAND in t}export const outputName=t=>t;export function outputOf(t){const e={};for(const[r,n]of Object.entries(t))i.has(r)||(e[r]=n);return{kind:"video",build:t.parts,options:e}}const i=new Set([PIECE_BRAND,"kind","parts","id","base","title","format","matrix","meta","written"]);export const buildOf=t=>t.parts,pieceIn=(t,e)=>t===e||t.startsWith(`${e}/`);export function pieceName(t){let e=t.replaceAll("\\","/").replace(/^\.\//u,"").replace(/\/+$/u,"");return e=e.replace(/\/(?:video|slides)\.(?:ts|tsx|js|jsx|mts|mjs)$/u,""),e}export const pieceNamed=(t,e)=>{const r=pieceName(e);return pieceIn(t.id,r)||t.path!==void 0&&pieceIn(t.path,r)},pieceIs=(t,e)=>{const r=pieceName(e);return t.id===r||t.path===r};export function messagePrefix(t){return t.replace(/\//g,".")}export const LAYER_OFF="data-ak-off";export function showLayer(t,e){t.toggleAttribute(LAYER_OFF,!e)}export function layerShown(t){return!t.hasAttribute(LAYER_OFF)}export function addLayerRule(t){if(t.adoptedStyleSheets.some(r=>r.allyhubLayers))return;const e=new CSSStyleSheet;e.replaceSync(`[${LAYER_OFF}] { display: none !important; }`),Object.assign(e,{allyhubLayers:!0}),t.adoptedStyleSheets=[...t.adoptedStyleSheets,e]}
|
|
@@ -65,6 +65,10 @@ export declare const RULES: {
|
|
|
65
65
|
readonly level: "error";
|
|
66
66
|
readonly rule: "A video item reaches itself through the videos it shows (a screen, a video take, a footage of a video item)";
|
|
67
67
|
};
|
|
68
|
+
readonly "AK-M011": {
|
|
69
|
+
readonly level: "error";
|
|
70
|
+
readonly rule: "A deck's slides.yaml does not match the format, or names a layout, a prop, a file or a video item the deck does not have";
|
|
71
|
+
};
|
|
68
72
|
readonly "AK-B001": {
|
|
69
73
|
readonly level: "error";
|
|
70
74
|
readonly rule: "Two pieces have the same id";
|
|
@@ -183,7 +187,7 @@ export declare const RULES: {
|
|
|
183
187
|
};
|
|
184
188
|
readonly "AK-G001": {
|
|
185
189
|
readonly level: "error";
|
|
186
|
-
readonly rule: "Unknown format: not one of the four presets
|
|
190
|
+
readonly rule: "Unknown format: not one of the four presets, a platform profile or WIDTHxHEIGHT with even sides";
|
|
187
191
|
};
|
|
188
192
|
readonly "AK-X001": {
|
|
189
193
|
readonly level: "error";
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/*! AllyHub. Copyright (c) 2026 AllyHub, Inc. All rights reserved. Use is subject to LICENSE.md. */
|
|
2
|
-
export const RULES={"AK-M001":{level:"error",rule:"The fields of video(), slides() or defineComponent do not match the format"},"AK-M002":{level:"error",rule:"A piece is not the entry file of an item folder"},"AK-M003":{level:"error",rule:"An item's entry file does not match its folder or its kind"},"AK-M004":{level:"error",rule:"The project has no pieces"},"AK-M006":{level:"error",rule:"A messages file does not match the format"},"AK-M007":{level:"error",rule:"A script file does not match the format"},"AK-M008":{level:"error",rule:"A doc's file is not MDX, holds what a doc does not draw, or is not an item of its own"},"AK-M009":{level:"error",rule:"A sheet cannot be read as it says: its file is not CSV a sheet can read, a value is not its column's type, or its spec does not match the format"},"AK-M010":{level:"error",rule:"A video item reaches itself through the videos it shows (a screen, a video take, a footage of a video item)"},"AK-B001":{level:"error",rule:"Two pieces have the same id"},"AK-B003":{level:"error",rule:"The build made a network request"},"AK-B004":{level:"error",rule:"The build timed out, or its result is over the size limit"},"AK-B005":{level:"error",rule:"An import of a file outside the project, or of a package not declared in package.json"},"AK-B006":{level:"error",rule:"An import of an @allyhub/sdk entry point that does not exist"},"AK-B008":{level:"error",rule:"The project's @allyhub/sdk is another version than the allyhub that builds it"},"AK-B009":{level:"error",rule:"The project's package.json declares AllyHub, but its packages are not installed"},"AK-B010":{level:"error",rule:"A 3D model does not build"},"AK-K001":{level:"error",rule:"Two parts have the same key"},"AK-K003":{level:"error",rule:"The output has no parts"},"AK-D002":{level:"error",rule:"The same frame has different pixels when drawn in order and out of order"},"AK-N003":{level:"error",rule:"The sandbox blocked a request at run time"},"AK-S001":{level:"error",rule:"The code reads a key that is missing in the default language too"},"AK-T001":{level:"error",rule:"A take has no word times beside it (<name>.words.json)"},"AK-T002":{level:"error",rule:"A say part has no generated file for its text, voice and tool"},"AK-T003":{level:"error",rule:"A take's range phrase, or the line a part is saying, is not found in the take"},"AK-T004":{level:"error",rule:"A word reference is not in its part's words, or an anchor is not in its line"},"AK-T005":{level:"error",rule:"A take's edits file is missing or does not match the format, or an edit's words are no longer in the take"},"AK-T006":{level:"error",rule:"A take's range phrase, or the line a part is saying, is said in words the take's edits remove"},"AK-T007":{level:"error",rule:"A part says a line its generated voice was not made from"},"AK-F001":{level:"error",rule:"The video is longer than its platform profile takes"},"AK-A001":{level:"error",rule:"A referenced media or data file does not exist"},"AK-A003":{level:"error",rule:"Wrong media type"},"AK-A005":{level:"error",rule:"A layer draws a picture that does not load: its source is not a file the stage serves, or not a picture"},"AK-P002":{level:"error",rule:"Loading took longer than the piece's loadLimit (default 10 seconds)"},"AK-P003":{level:"error",rule:"A moment did not finish drawing within the piece's seekLimit (default 30 seconds): work a layer waits for (ctx.wait) or a picture it shows never settled"},"AK-R001":{level:"error",rule:"An unhandled exception was thrown at run time"},"AK-R003":{level:"error",rule:"The page was changed outside the stage"},"AK-R004":{level:"error",rule:"The code sets a style value the browser does not accept, so the style does not apply"},"AK-G001":{level:"error",rule:"Unknown format: not one of the four presets
|
|
2
|
+
export const RULES={"AK-M001":{level:"error",rule:"The fields of video(), slides() or defineComponent do not match the format"},"AK-M002":{level:"error",rule:"A piece is not the entry file of an item folder"},"AK-M003":{level:"error",rule:"An item's entry file does not match its folder or its kind"},"AK-M004":{level:"error",rule:"The project has no pieces"},"AK-M006":{level:"error",rule:"A messages file does not match the format"},"AK-M007":{level:"error",rule:"A script file does not match the format"},"AK-M008":{level:"error",rule:"A doc's file is not MDX, holds what a doc does not draw, or is not an item of its own"},"AK-M009":{level:"error",rule:"A sheet cannot be read as it says: its file is not CSV a sheet can read, a value is not its column's type, or its spec does not match the format"},"AK-M010":{level:"error",rule:"A video item reaches itself through the videos it shows (a screen, a video take, a footage of a video item)"},"AK-M011":{level:"error",rule:"A deck's slides.yaml does not match the format, or names a layout, a prop, a file or a video item the deck does not have"},"AK-B001":{level:"error",rule:"Two pieces have the same id"},"AK-B003":{level:"error",rule:"The build made a network request"},"AK-B004":{level:"error",rule:"The build timed out, or its result is over the size limit"},"AK-B005":{level:"error",rule:"An import of a file outside the project, or of a package not declared in package.json"},"AK-B006":{level:"error",rule:"An import of an @allyhub/sdk entry point that does not exist"},"AK-B008":{level:"error",rule:"The project's @allyhub/sdk is another version than the allyhub that builds it"},"AK-B009":{level:"error",rule:"The project's package.json declares AllyHub, but its packages are not installed"},"AK-B010":{level:"error",rule:"A 3D model does not build"},"AK-K001":{level:"error",rule:"Two parts have the same key"},"AK-K003":{level:"error",rule:"The output has no parts"},"AK-D002":{level:"error",rule:"The same frame has different pixels when drawn in order and out of order"},"AK-N003":{level:"error",rule:"The sandbox blocked a request at run time"},"AK-S001":{level:"error",rule:"The code reads a key that is missing in the default language too"},"AK-T001":{level:"error",rule:"A take has no word times beside it (<name>.words.json)"},"AK-T002":{level:"error",rule:"A say part has no generated file for its text, voice and tool"},"AK-T003":{level:"error",rule:"A take's range phrase, or the line a part is saying, is not found in the take"},"AK-T004":{level:"error",rule:"A word reference is not in its part's words, or an anchor is not in its line"},"AK-T005":{level:"error",rule:"A take's edits file is missing or does not match the format, or an edit's words are no longer in the take"},"AK-T006":{level:"error",rule:"A take's range phrase, or the line a part is saying, is said in words the take's edits remove"},"AK-T007":{level:"error",rule:"A part says a line its generated voice was not made from"},"AK-F001":{level:"error",rule:"The video is longer than its platform profile takes"},"AK-A001":{level:"error",rule:"A referenced media or data file does not exist"},"AK-A003":{level:"error",rule:"Wrong media type"},"AK-A005":{level:"error",rule:"A layer draws a picture that does not load: its source is not a file the stage serves, or not a picture"},"AK-P002":{level:"error",rule:"Loading took longer than the piece's loadLimit (default 10 seconds)"},"AK-P003":{level:"error",rule:"A moment did not finish drawing within the piece's seekLimit (default 30 seconds): work a layer waits for (ctx.wait) or a picture it shows never settled"},"AK-R001":{level:"error",rule:"An unhandled exception was thrown at run time"},"AK-R003":{level:"error",rule:"The page was changed outside the stage"},"AK-R004":{level:"error",rule:"The code sets a style value the browser does not accept, so the style does not apply"},"AK-G001":{level:"error",rule:"Unknown format: not one of the four presets, a platform profile or WIDTHxHEIGHT with even sides"},"AK-X001":{level:"error",rule:"The matrix's slots, structures, rules or combos name something that does not exist, or a combo lacks a slot of its structure"},"AK-X002":{level:"error",rule:"The matrix's rules leave no combination to make, or rule out a combo matrix.combos names"},"AK-X004":{level:"error",rule:"Two chosen combos are the same, or more alike than the matrix's differ allows"},"AK-X005":{level:"error",rule:"A part reads another slot's pick, so one render of it cannot serve every combo"},"AK-X006":{level:"error",rule:"A combo is longer than its output's maxDuration"},"AK-W001":{level:"error",rule:"A scenery does not build: its module's export is not a scenery, its build throws or does not finish, or its update throws"},"AK-W002":{level:"error",rule:"WebGL cannot be made or is lost, or draws on something other than SwiftShader where the CPU was asked for (--cpu, ALLYHUB_GPU=0, or the default off macOS)"},"AK-W003":{level:"error",rule:"A model, texture, environment or splat file does not load, names a file that is not there, or needs a decoder AllyHub does not lend"},"AK-W004":{level:"error",rule:"A camera cannot be drawn: a number that is not finite, a target at its position, a view along its up, a field of view outside (0°, 180°), or near and far planes out of order"},"AK-W005":{level:"error",rule:"A name a camera, a move or a measurement refers to names no object in the scenery, or names two"},"AK-W006":{level:"error",rule:"A material's shader does not compile or link on this renderer, or needs more texture units than the renderer has, so what uses it draws nothing (warn: more than the 16 a GPU may have)"},"AK-W008":{level:"error",rule:"A screen drawn in the scenery cannot show its element as it is: an element of it is in the browser's top layer (a modal dialog, a popover), planes of a preserve-3d context overlap, its element is larger than the largest texture, or its picture could not be copied"},"AK-S002":{level:"warn",rule:"Missing translation"},"AK-L002":{level:"warn",rule:"Text overflows the frame or is clipped"},"AK-L003":{level:"warn",rule:"Missing glyphs"},"AK-L006":{level:"warn",rule:"Text is drawn in a fallback font, or in a bold or italic the font does not have"},"AK-W007":{level:"warn",rule:"A screen asked to be drawn in the scenery is drawn over it, unlit and untoned: this browser cannot draw an element into a canvas (Chrome's HTML-in-Canvas), or ALLYHUB_HTML_IN_CANVAS=0"}};export function problem(e,r,o={}){const{level:t,...l}=o;return{code:e,level:t??RULES[e].level,message:r,...l}}export function countLevels(e){let r=0,o=0;for(const t of e)t.level==="error"?r++:o++;return{errors:r,warnings:o}}
|
|
@@ -206,7 +206,6 @@ export type VideoOptionsMeta = z.infer<typeof VideoOptionsMeta>;
|
|
|
206
206
|
export declare const OutputMeta: z.ZodObject<{
|
|
207
207
|
kind: z.ZodEnum<{
|
|
208
208
|
video: "video";
|
|
209
|
-
paged: "paged";
|
|
210
209
|
}>;
|
|
211
210
|
options: z.ZodRecord<z.ZodString, z.ZodUnknown>;
|
|
212
211
|
}, z.core.$strict>;
|
|
@@ -252,7 +251,6 @@ export declare const PieceMeta: z.ZodObject<{
|
|
|
252
251
|
outputs: z.ZodRecord<z.ZodString, z.ZodObject<{
|
|
253
252
|
kind: z.ZodEnum<{
|
|
254
253
|
video: "video";
|
|
255
|
-
paged: "paged";
|
|
256
254
|
}>;
|
|
257
255
|
options: z.ZodRecord<z.ZodString, z.ZodUnknown>;
|
|
258
256
|
}, z.core.$strict>>;
|
|
@@ -62,6 +62,7 @@ export declare const draftEdit: {
|
|
|
62
62
|
parts: ScriptPart[];
|
|
63
63
|
title?: string;
|
|
64
64
|
text?: Record<string, ScriptText>;
|
|
65
|
+
slides?: import("./script.js").ScriptSlide[];
|
|
65
66
|
};
|
|
66
67
|
id: string;
|
|
67
68
|
};
|
|
@@ -84,6 +85,7 @@ export declare const draftEdit: {
|
|
|
84
85
|
parts: ScriptPart[];
|
|
85
86
|
title?: string;
|
|
86
87
|
text?: Record<string, ScriptText>;
|
|
88
|
+
slides?: import("./script.js").ScriptSlide[];
|
|
87
89
|
};
|
|
88
90
|
caret: undefined;
|
|
89
91
|
};
|
|
@@ -99,6 +101,7 @@ export declare const draftEdit: {
|
|
|
99
101
|
parts: ScriptPart[];
|
|
100
102
|
title?: string;
|
|
101
103
|
text?: Record<string, ScriptText>;
|
|
104
|
+
slides?: import("./script.js").ScriptSlide[];
|
|
102
105
|
};
|
|
103
106
|
caret: {
|
|
104
107
|
id: string;
|
|
@@ -119,6 +122,7 @@ export declare const draftEdit: {
|
|
|
119
122
|
parts: ScriptPart[];
|
|
120
123
|
title?: string;
|
|
121
124
|
text?: Record<string, ScriptText>;
|
|
125
|
+
slides?: import("./script.js").ScriptSlide[];
|
|
122
126
|
};
|
|
123
127
|
id: string;
|
|
124
128
|
};
|