@allyhub/sdk 0.5.0 → 0.7.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/define.d.ts +4 -0
- package/dist/define.js +1 -1
- package/dist/node_modules/@allyhub-next/audio/dist/node/index.d.ts +1 -1
- package/dist/node_modules/@allyhub-next/audio/dist/node/index.js +1 -1
- package/dist/node_modules/@allyhub-next/audio/dist/node/master.d.ts +4 -0
- package/dist/node_modules/@allyhub-next/audio/dist/node/master.js +1 -1
- package/dist/node_modules/@allyhub-next/audio/package.json +1 -1
- package/dist/node_modules/@allyhub-next/chart/dist/chart-xml.js +2 -2
- package/dist/node_modules/@allyhub-next/chart/dist/chart.d.ts +14 -5
- package/dist/node_modules/@allyhub-next/chart/dist/chart.js +1 -1
- package/dist/node_modules/@allyhub-next/chart/package.json +1 -1
- package/dist/node_modules/@allyhub-next/formats/dist/data/deck-code.d.ts +205 -0
- package/dist/node_modules/@allyhub-next/formats/dist/data/deck-code.js +2 -0
- package/dist/node_modules/@allyhub-next/formats/dist/data/script.d.ts +4 -1
- package/dist/node_modules/@allyhub-next/formats/dist/data/script.js +1 -1
- package/dist/node_modules/@allyhub-next/formats/dist/data/sheet.d.ts +248 -18
- package/dist/node_modules/@allyhub-next/formats/dist/data/sheet.js +1 -1
- package/dist/node_modules/@allyhub-next/formats/dist/data/slides.d.ts +1114 -91
- package/dist/node_modules/@allyhub-next/formats/dist/data/slides.js +1 -1
- package/dist/node_modules/@allyhub-next/formats/dist/data/website.d.ts +20 -0
- package/dist/node_modules/@allyhub-next/formats/dist/data/website.js +2 -0
- package/dist/node_modules/@allyhub-next/formats/dist/index.d.ts +4 -0
- package/dist/node_modules/@allyhub-next/formats/dist/index.js +1 -1
- package/dist/node_modules/@allyhub-next/formats/dist/items.d.ts +1 -1
- package/dist/node_modules/@allyhub-next/formats/dist/items.js +1 -1
- package/dist/node_modules/@allyhub-next/formats/dist/media-type.d.ts +3 -0
- package/dist/node_modules/@allyhub-next/formats/dist/media-type.js +2 -0
- package/dist/node_modules/@allyhub-next/formats/dist/schemas.d.ts +625 -30
- package/dist/node_modules/@allyhub-next/formats/dist/schemas.js +1 -1
- package/dist/node_modules/@allyhub-next/formats/dist/strict.d.ts +2 -0
- package/dist/node_modules/@allyhub-next/formats/dist/strict.js +1 -1
- package/dist/node_modules/@allyhub-next/formats/dist/zip.d.ts +17 -0
- package/dist/node_modules/@allyhub-next/formats/dist/zip.js +2 -0
- package/dist/node_modules/@allyhub-next/formats/package.json +2 -1
- package/dist/node_modules/@allyhub-next/ooxml/LICENSE +241 -0
- package/dist/node_modules/@allyhub-next/ooxml/dist/brightness.d.ts +31 -0
- package/dist/node_modules/@allyhub-next/ooxml/dist/brightness.js +2 -0
- package/dist/node_modules/@allyhub-next/ooxml/dist/color.d.ts +33 -0
- package/dist/node_modules/@allyhub-next/ooxml/dist/color.js +2 -0
- package/dist/node_modules/@allyhub-next/ooxml/dist/enums.d.ts +13 -0
- package/dist/node_modules/@allyhub-next/ooxml/dist/enums.js +2 -0
- package/dist/node_modules/@allyhub-next/ooxml/dist/ext.d.ts +79 -0
- package/dist/node_modules/@allyhub-next/ooxml/dist/ext.js +2 -0
- package/dist/node_modules/@allyhub-next/ooxml/dist/generated/enums.d.ts +132 -0
- package/dist/node_modules/@allyhub-next/ooxml/dist/generated/enums.js +2 -0
- package/dist/node_modules/@allyhub-next/ooxml/dist/generated/presets.d.ts +28 -0
- package/dist/node_modules/@allyhub-next/ooxml/dist/generated/presets.js +2 -0
- package/dist/node_modules/@allyhub-next/ooxml/dist/generated/spec.d.ts +4708 -0
- package/dist/node_modules/@allyhub-next/ooxml/dist/generated/spec.js +2 -0
- package/dist/node_modules/@allyhub-next/ooxml/dist/geometry/index.d.ts +57 -0
- package/dist/node_modules/@allyhub-next/ooxml/dist/geometry/index.js +2 -0
- package/dist/node_modules/@allyhub-next/ooxml/dist/index.d.ts +10 -0
- package/dist/node_modules/@allyhub-next/ooxml/dist/index.js +2 -0
- package/dist/node_modules/@allyhub-next/ooxml/dist/mce.d.ts +12 -0
- package/dist/node_modules/@allyhub-next/ooxml/dist/mce.js +2 -0
- package/dist/node_modules/@allyhub-next/ooxml/dist/node.d.ts +111 -0
- package/dist/node_modules/@allyhub-next/ooxml/dist/node.js +2 -0
- package/dist/node_modules/@allyhub-next/ooxml/dist/ns.d.ts +45 -0
- package/dist/node_modules/@allyhub-next/ooxml/dist/ns.js +2 -0
- package/dist/node_modules/@allyhub-next/ooxml/dist/opc.d.ts +48 -0
- package/dist/node_modules/@allyhub-next/ooxml/dist/opc.js +2 -0
- package/dist/node_modules/@allyhub-next/ooxml/dist/report.d.ts +45 -0
- package/dist/node_modules/@allyhub-next/ooxml/dist/report.js +2 -0
- package/dist/node_modules/@allyhub-next/ooxml/dist/xml.d.ts +28 -0
- package/dist/node_modules/@allyhub-next/ooxml/dist/xml.js +2 -0
- package/dist/node_modules/@allyhub-next/ooxml/package.json +26 -0
- package/dist/node_modules/@allyhub-next/protocol/dist/account.d.ts +338 -0
- package/dist/node_modules/@allyhub-next/protocol/dist/account.js +2 -0
- package/dist/node_modules/@allyhub-next/protocol/dist/auth.d.ts +12 -13
- package/dist/node_modules/@allyhub-next/protocol/dist/auth.js +1 -1
- package/dist/node_modules/@allyhub-next/protocol/dist/blobs.d.ts +35 -0
- package/dist/node_modules/@allyhub-next/protocol/dist/blobs.js +2 -0
- package/dist/node_modules/@allyhub-next/protocol/dist/cloud.d.ts +101 -32
- package/dist/node_modules/@allyhub-next/protocol/dist/cloud.js +1 -1
- package/dist/node_modules/@allyhub-next/protocol/dist/editor.d.ts +89 -5
- package/dist/node_modules/@allyhub-next/protocol/dist/editor.js +1 -1
- package/dist/node_modules/@allyhub-next/protocol/dist/files.d.ts +2 -2
- package/dist/node_modules/@allyhub-next/protocol/dist/index.d.ts +6 -0
- package/dist/node_modules/@allyhub-next/protocol/dist/index.js +1 -1
- package/dist/node_modules/@allyhub-next/protocol/dist/notes.d.ts +23 -0
- package/dist/node_modules/@allyhub-next/protocol/dist/notes.js +1 -1
- package/dist/node_modules/@allyhub-next/protocol/dist/open.d.ts +13 -0
- package/dist/node_modules/@allyhub-next/protocol/dist/open.js +2 -0
- package/dist/node_modules/@allyhub-next/protocol/dist/registry.d.ts +73 -59
- package/dist/node_modules/@allyhub-next/protocol/dist/registry.js +1 -1
- package/dist/node_modules/@allyhub-next/protocol/dist/routes.d.ts +1 -1
- package/dist/node_modules/@allyhub-next/protocol/dist/routes.js +1 -1
- package/dist/node_modules/@allyhub-next/protocol/dist/shares.d.ts +115 -0
- package/dist/node_modules/@allyhub-next/protocol/dist/shares.js +2 -0
- package/dist/node_modules/@allyhub-next/protocol/dist/sites.d.ts +293 -0
- package/dist/node_modules/@allyhub-next/protocol/dist/sites.js +2 -0
- package/dist/node_modules/@allyhub-next/protocol/dist/snapshots.d.ts +377 -0
- package/dist/node_modules/@allyhub-next/protocol/dist/snapshots.js +2 -0
- package/dist/node_modules/@allyhub-next/protocol/dist/teams.d.ts +27 -9
- package/dist/node_modules/@allyhub-next/protocol/dist/teams.js +1 -1
- package/dist/node_modules/@allyhub-next/protocol/dist/tools.d.ts +53 -14
- package/dist/node_modules/@allyhub-next/protocol/dist/tools.js +1 -1
- package/dist/node_modules/@allyhub-next/protocol/package.json +2 -1
- package/dist/node_modules/@allyhub-next/runtimes/package.json +1 -1
- package/dist/node_modules/@allyhub-next/runtimes/schemas/runtimes.schema.json +25 -5
- package/dist/node_modules/@allyhub-next/scenery/package.json +1 -1
- package/dist/node_modules/@allyhub-next/sheet/dist/api/capabilities.js +1 -1
- package/dist/node_modules/@allyhub-next/sheet/dist/api/index.d.ts +1 -0
- package/dist/node_modules/@allyhub-next/sheet/dist/api/index.js +1 -1
- package/dist/node_modules/@allyhub-next/sheet/dist/api/page.d.ts +83 -0
- package/dist/node_modules/@allyhub-next/sheet/dist/api/page.js +2 -0
- package/dist/node_modules/@allyhub-next/sheet/dist/api/workbook.d.ts +40 -1
- package/dist/node_modules/@allyhub-next/sheet/dist/api/workbook.js +1 -1
- package/dist/node_modules/@allyhub-next/sheet/dist/calc/analyse.d.ts +9 -3
- package/dist/node_modules/@allyhub-next/sheet/dist/calc/analyse.js +1 -1
- package/dist/node_modules/@allyhub-next/sheet/dist/calc/coerce.d.ts +5 -1
- package/dist/node_modules/@allyhub-next/sheet/dist/calc/coerce.js +1 -1
- package/dist/node_modules/@allyhub-next/sheet/dist/calc/engine.d.ts +60 -13
- package/dist/node_modules/@allyhub-next/sheet/dist/calc/engine.js +1 -1
- package/dist/node_modules/@allyhub-next/sheet/dist/calc/functions/aggregate.js +1 -1
- package/dist/node_modules/@allyhub-next/sheet/dist/calc/functions/convert.d.ts +4 -0
- package/dist/node_modules/@allyhub-next/sheet/dist/calc/functions/convert.js +2 -0
- package/dist/node_modules/@allyhub-next/sheet/dist/calc/functions/criteria.js +1 -1
- package/dist/node_modules/@allyhub-next/sheet/dist/calc/functions/database.js +1 -1
- package/dist/node_modules/@allyhub-next/sheet/dist/calc/functions/date.js +1 -1
- package/dist/node_modules/@allyhub-next/sheet/dist/calc/functions/define.d.ts +27 -1
- package/dist/node_modules/@allyhub-next/sheet/dist/calc/functions/define.js +1 -1
- package/dist/node_modules/@allyhub-next/sheet/dist/calc/functions/delimiters.d.ts +16 -0
- package/dist/node_modules/@allyhub-next/sheet/dist/calc/functions/delimiters.js +2 -0
- package/dist/node_modules/@allyhub-next/sheet/dist/calc/functions/dynamic.d.ts +18 -1
- package/dist/node_modules/@allyhub-next/sheet/dist/calc/functions/dynamic.js +1 -1
- package/dist/node_modules/@allyhub-next/sheet/dist/calc/functions/finance.js +1 -1
- package/dist/node_modules/@allyhub-next/sheet/dist/calc/functions/index.d.ts +2 -0
- package/dist/node_modules/@allyhub-next/sheet/dist/calc/functions/index.js +1 -1
- package/dist/node_modules/@allyhub-next/sheet/dist/calc/functions/info.js +1 -1
- package/dist/node_modules/@allyhub-next/sheet/dist/calc/functions/kernels.js +1 -1
- package/dist/node_modules/@allyhub-next/sheet/dist/calc/functions/logical.js +1 -1
- package/dist/node_modules/@allyhub-next/sheet/dist/calc/functions/lookup.js +1 -1
- package/dist/node_modules/@allyhub-next/sheet/dist/calc/functions/maths.js +1 -1
- package/dist/node_modules/@allyhub-next/sheet/dist/calc/functions/modern.d.ts +2 -0
- package/dist/node_modules/@allyhub-next/sheet/dist/calc/functions/modern.js +2 -0
- package/dist/node_modules/@allyhub-next/sheet/dist/calc/functions/text.js +1 -1
- package/dist/node_modules/@allyhub-next/sheet/dist/calc/graph.d.ts +38 -0
- package/dist/node_modules/@allyhub-next/sheet/dist/calc/graph.js +2 -0
- package/dist/node_modules/@allyhub-next/sheet/dist/calc/indexes.d.ts +19 -0
- package/dist/node_modules/@allyhub-next/sheet/dist/calc/indexes.js +2 -0
- package/dist/node_modules/@allyhub-next/sheet/dist/calc/remote.d.ts +49 -0
- package/dist/node_modules/@allyhub-next/sheet/dist/calc/remote.js +2 -0
- package/dist/node_modules/@allyhub-next/sheet/dist/calc/server.d.ts +82 -0
- package/dist/node_modules/@allyhub-next/sheet/dist/calc/server.js +2 -0
- package/dist/node_modules/@allyhub-next/sheet/dist/calc/types.d.ts +6 -1
- package/dist/node_modules/@allyhub-next/sheet/dist/calc/types.js +1 -1
- package/dist/node_modules/@allyhub-next/sheet/dist/chart.js +1 -1
- package/dist/node_modules/@allyhub-next/sheet/dist/check.js +1 -1
- package/dist/node_modules/@allyhub-next/sheet/dist/diff.d.ts +15 -0
- package/dist/node_modules/@allyhub-next/sheet/dist/diff.js +1 -1
- package/dist/node_modules/@allyhub-next/sheet/dist/export.d.ts +29 -8
- package/dist/node_modules/@allyhub-next/sheet/dist/export.js +3 -4
- package/dist/node_modules/@allyhub-next/sheet/dist/file.js +2 -2
- package/dist/node_modules/@allyhub-next/sheet/dist/format.d.ts +8 -2
- package/dist/node_modules/@allyhub-next/sheet/dist/format.js +1 -1
- package/dist/node_modules/@allyhub-next/sheet/dist/html.d.ts +52 -4
- package/dist/node_modules/@allyhub-next/sheet/dist/html.js +43 -11
- package/dist/node_modules/@allyhub-next/sheet/dist/index.d.ts +7 -3
- package/dist/node_modules/@allyhub-next/sheet/dist/index.js +1 -1
- package/dist/node_modules/@allyhub-next/sheet/dist/inspect.js +1 -1
- package/dist/node_modules/@allyhub-next/sheet/dist/paginate.d.ts +98 -0
- package/dist/node_modules/@allyhub-next/sheet/dist/paginate.js +2 -0
- package/dist/node_modules/@allyhub-next/sheet/dist/structure.js +1 -1
- package/dist/node_modules/@allyhub-next/sheet/dist/table-style.d.ts +32 -0
- package/dist/node_modules/@allyhub-next/sheet/dist/table-style.js +2 -0
- package/dist/node_modules/@allyhub-next/sheet/dist/table-styles.d.ts +3 -0
- package/dist/node_modules/@allyhub-next/sheet/dist/table-styles.js +2 -0
- package/dist/node_modules/@allyhub-next/sheet/dist/values.js +1 -1
- package/dist/node_modules/@allyhub-next/sheet/dist/workbook.d.ts +10 -1
- package/dist/node_modules/@allyhub-next/sheet/dist/workbook.js +1 -1
- package/dist/node_modules/@allyhub-next/sheet/dist/xlsx/charts.d.ts +12 -1
- package/dist/node_modules/@allyhub-next/sheet/dist/xlsx/charts.js +1 -1
- package/dist/node_modules/@allyhub-next/sheet/dist/xlsx/formula.d.ts +14 -4
- package/dist/node_modules/@allyhub-next/sheet/dist/xlsx/formula.js +2 -2
- package/dist/node_modules/@allyhub-next/sheet/dist/xlsx/functions.d.ts +11 -1
- package/dist/node_modules/@allyhub-next/sheet/dist/xlsx/functions.js +36 -16
- package/dist/node_modules/@allyhub-next/sheet/dist/xlsx/import.d.ts +6 -1
- package/dist/node_modules/@allyhub-next/sheet/dist/xlsx/import.js +1 -1
- package/dist/node_modules/@allyhub-next/sheet/dist/xlsx/read.d.ts +44 -2
- package/dist/node_modules/@allyhub-next/sheet/dist/xlsx/read.js +2 -1
- package/dist/node_modules/@allyhub-next/sheet/dist/xlsx/sax.d.ts +23 -0
- package/dist/node_modules/@allyhub-next/sheet/dist/xlsx/sax.js +2 -0
- package/dist/node_modules/@allyhub-next/sheet/dist/xlsx/styles.d.ts +2 -0
- package/dist/node_modules/@allyhub-next/sheet/dist/xlsx/styles.js +1 -1
- package/dist/node_modules/@allyhub-next/sheet/dist/xlsx/write.d.ts +6 -0
- package/dist/node_modules/@allyhub-next/sheet/dist/xlsx/write.js +1 -1
- package/dist/node_modules/@allyhub-next/sheet/dist/xlsx/zip.d.ts +40 -0
- package/dist/node_modules/@allyhub-next/sheet/dist/xlsx/zip.js +2 -0
- package/dist/node_modules/@allyhub-next/sheet/package.json +1 -1
- package/dist/node_modules/@allyhub-next/slides-core/dist/animation.js +1 -1
- package/dist/node_modules/@allyhub-next/slides-core/dist/api.d.ts +121 -44
- package/dist/node_modules/@allyhub-next/slides-core/dist/api.js +2 -2
- package/dist/node_modules/@allyhub-next/slides-core/dist/capabilities.js +1 -1
- package/dist/node_modules/@allyhub-next/slides-core/dist/chart-api.d.ts +50 -13
- package/dist/node_modules/@allyhub-next/slides-core/dist/chart-api.js +1 -1
- package/dist/node_modules/@allyhub-next/slides-core/dist/chart-file.js +1 -1
- package/dist/node_modules/@allyhub-next/slides-core/dist/check.js +1 -1
- package/dist/node_modules/@allyhub-next/slides-core/dist/code.d.ts +33 -0
- package/dist/node_modules/@allyhub-next/slides-core/dist/code.js +2 -0
- package/dist/node_modules/@allyhub-next/slides-core/dist/components.d.ts +31 -0
- package/dist/node_modules/@allyhub-next/slides-core/dist/components.js +2 -0
- package/dist/node_modules/@allyhub-next/slides-core/dist/enums.d.ts +188 -5
- package/dist/node_modules/@allyhub-next/slides-core/dist/enums.js +1 -1
- package/dist/node_modules/@allyhub-next/slides-core/dist/file.d.ts +43 -21
- package/dist/node_modules/@allyhub-next/slides-core/dist/file.js +3 -3
- package/dist/node_modules/@allyhub-next/slides-core/dist/identity.d.ts +17 -0
- package/dist/node_modules/@allyhub-next/slides-core/dist/identity.js +2 -0
- package/dist/node_modules/@allyhub-next/slides-core/dist/index.d.ts +5 -0
- package/dist/node_modules/@allyhub-next/slides-core/dist/index.js +1 -1
- package/dist/node_modules/@allyhub-next/slides-core/dist/lang.d.ts +6 -0
- package/dist/node_modules/@allyhub-next/slides-core/dist/lang.js +2 -0
- package/dist/node_modules/@allyhub-next/slides-core/dist/measure.js +1 -1
- package/dist/node_modules/@allyhub-next/slides-core/dist/merge.d.ts +58 -0
- package/dist/node_modules/@allyhub-next/slides-core/dist/merge.js +2 -0
- package/dist/node_modules/@allyhub-next/slides-core/dist/model.d.ts +38 -4
- package/dist/node_modules/@allyhub-next/slides-core/dist/office.d.ts +27 -1
- package/dist/node_modules/@allyhub-next/slides-core/dist/office.js +1 -1
- package/dist/node_modules/@allyhub-next/slides-core/dist/resolve.d.ts +26 -5
- package/dist/node_modules/@allyhub-next/slides-core/dist/resolve.js +1 -1
- package/dist/node_modules/@allyhub-next/slides-core/dist/script.d.ts +18 -16
- package/dist/node_modules/@allyhub-next/slides-core/dist/script.js +2 -2
- package/dist/node_modules/@allyhub-next/slides-core/dist/stage.d.ts +51 -53
- package/dist/node_modules/@allyhub-next/slides-core/dist/strict.js +1 -1
- package/dist/node_modules/@allyhub-next/slides-core/dist/units.d.ts +27 -0
- package/dist/node_modules/@allyhub-next/slides-core/dist/units.js +1 -1
- package/dist/node_modules/@allyhub-next/slides-core/dist/values.d.ts +7 -0
- package/dist/node_modules/@allyhub-next/slides-core/dist/values.js +2 -0
- package/dist/node_modules/@allyhub-next/slides-core/package.json +1 -1
- package/dist/node_modules/@allyhub-next/video-core/dist/captions.js +6 -6
- package/dist/node_modules/@allyhub-next/video-core/dist/fact.d.ts +47 -8
- package/dist/node_modules/@allyhub-next/video-core/dist/fact.js +1 -1
- package/dist/node_modules/@allyhub-next/video-core/dist/index.d.ts +1 -0
- package/dist/node_modules/@allyhub-next/video-core/dist/index.js +1 -1
- package/dist/node_modules/@allyhub-next/video-core/dist/marks.d.ts +14 -0
- package/dist/node_modules/@allyhub-next/video-core/dist/marks.js +1 -1
- package/dist/node_modules/@allyhub-next/video-core/dist/music.d.ts +2 -1
- package/dist/node_modules/@allyhub-next/video-core/dist/piece.d.ts +11 -2
- package/dist/node_modules/@allyhub-next/video-core/dist/problem.d.ts +4 -0
- package/dist/node_modules/@allyhub-next/video-core/dist/problem.js +1 -1
- package/dist/node_modules/@allyhub-next/video-core/dist/schema.d.ts +2 -2
- package/dist/node_modules/@allyhub-next/video-core/dist/schema.js +1 -1
- package/dist/node_modules/@allyhub-next/video-core/dist/script.d.ts +2 -1
- package/dist/node_modules/@allyhub-next/video-core/dist/script.js +1 -1
- package/dist/node_modules/@allyhub-next/video-core/dist/source.d.ts +7 -0
- package/dist/node_modules/@allyhub-next/video-core/dist/source.js +2 -0
- package/dist/node_modules/@allyhub-next/video-core/dist/timeline.d.ts +10 -33
- package/dist/node_modules/@allyhub-next/video-core/package.json +1 -1
- package/dist/sheets.d.ts +1 -1
- package/dist/sheets.js +1 -1
- package/dist/slides.d.ts +3 -1
- package/dist/slides.js +1 -1
- package/docs/README.md +1 -0
- package/docs/contract.md +1 -1
- package/docs/defaults.md +25 -2
- package/docs/layers.md +1 -1
- package/docs/project.md +3 -1
- package/docs/sheets.md +29 -3
- package/docs/slides.md +18 -14
- package/docs/sound.md +1 -1
- package/docs/websites.md +57 -0
- package/package.json +3 -1
|
@@ -17,6 +17,20 @@ export declare const hasMarks: (text: string) => boolean;
|
|
|
17
17
|
* marks on them. A line without marks comes back as it is.
|
|
18
18
|
*/
|
|
19
19
|
export declare function readMarks(text: string): MarkedText;
|
|
20
|
+
/** A stretch of text and the marks on it, for writeMarks(). */
|
|
21
|
+
export interface MarkedRun {
|
|
22
|
+
text: string;
|
|
23
|
+
strong?: boolean;
|
|
24
|
+
em?: boolean;
|
|
25
|
+
strike?: boolean;
|
|
26
|
+
code?: boolean;
|
|
27
|
+
}
|
|
28
|
+
/**
|
|
29
|
+
* Runs written with marks, readMarks()'s inverse: runs alike are joined, a
|
|
30
|
+
* run's spaces at its ends go outside its delimiters (`**Bold** `), and the
|
|
31
|
+
* characters marks are written with are escaped where they are text.
|
|
32
|
+
*/
|
|
33
|
+
export declare function writeMarks(runs: readonly MarkedRun[]): string;
|
|
20
34
|
/** A line's characters, without its marks' delimiters. */
|
|
21
35
|
export declare const withoutMarks: (text: string) => string;
|
|
22
36
|
/** A stretch of a text with the same marks all through it. */
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/*! AllyHub. Copyright (c) 2026 AllyHub, Inc. All rights reserved. Use is subject to LICENSE.md. */
|
|
2
|
-
const
|
|
2
|
+
const g=/\\([\\*~`])|\*+|~~|`/g,k=/\s/u;function p(c){const f=[];let r=0;for(const n of c.matchAll(g)){if(n.index>r&&f.push({kind:"text",text:c.slice(r,n.index)}),r=n.index+n[0].length,n[1]!==void 0){f.push({kind:"escape",text:n[1]});continue}if(n[0]==="`"){f.push({kind:"tick"});continue}const e=c[n.index-1],o=c[r];f.push({kind:"run",char:n[0][0]??"*",length:n[0].length,left:n[0].length,opens:o!==void 0&&!k.test(o),closes:e!==void 0&&!k.test(e),closing:[],opening:[],closingIds:[]})}return r<c.length&&f.push({kind:"text",text:c.slice(r)}),f}export const hasMarks=c=>/[*~`\\]/.test(c);function x(c,f,r,n){const e=[];for(let o=f;o<r;o++){const i=c[o];if(i?.kind==="run"){if(i.closes)for(let l=e.length-1;l>=0&&i.left>0;l--){const s=e[l]??-1,t=c[s];if(t?.char!==i.char||t.left===0||i.char==="*"&&(t.closes||i.opens)&&(t.length+i.length)%3===0&&!(t.length%3===0&&i.length%3===0))continue;const u=i.char==="~"||i.left>=2&&t.left>=2?2:1;if(i.char==="~"&&(i.left<2||t.left<2))continue;const a=i.char==="~"?"strike":u===2?"strong":"em",d=n();t.opening.push({kind:a,id:d}),i.closing.push(a),i.closingIds.push(d),t.left-=u,i.left-=u,e.length=t.left>0?l+1:l,l=e.length}i.left>0&&i.opens&&e.push(o)}}}export function readMarks(c){if(!hasMarks(c))return{text:c,marks:[]};const f=p(c);for(let s=0;s<f.length;s++){const t=f[s];if(t?.kind!=="tick")continue;const u=f.findIndex((a,d)=>d>s&&a.kind==="tick");u<0||(t.pair=u,s=u)}let r=0;const n=()=>r++;let e=0;for(let s=0;s<=f.length;s++){const t=f[s];(t===void 0||t.kind==="tick"&&t.pair!==void 0)&&(x(f,e,s,n),t?.kind==="tick"&&t.pair!==void 0&&(s=t.pair,e=s+1))}let o="";const i=[],l=new Map;for(let s=0;s<f.length;s++){const t=f[s];if(t){if(t.kind==="text"||t.kind==="escape"){o+=t.text;continue}if(t.kind==="tick"){if(t.pair===void 0){o+="`";continue}const u=o.length;for(let a=s+1;a<t.pair;a++){const d=f[a];d&&(o+=d.kind==="escape"?`\\${d.text}`:d.kind==="text"?d.text:d.kind==="tick"?"`":d.char.repeat(d.length))}o.length>u&&i.push({at:u,end:o.length,kind:"code"}),s=t.pair;continue}t.closingIds.forEach((u,a)=>{const d=l.get(u),h=t.closing[a];d!==void 0&&h!==void 0&&o.length>d&&i.push({at:d,end:o.length,kind:h})}),o+=t.char.repeat(t.left);for(const u of t.opening)l.set(u.id,o.length)}}return i.sort((s,t)=>s.at-t.at||t.end-s.end),{text:o,marks:i}}export function writeMarks(c){const f=(n,e)=>(n.strong??!1)===(e.strong??!1)&&(n.em??!1)===(e.em??!1)&&(n.strike??!1)===(e.strike??!1)&&(n.code??!1)===(e.code??!1),r=[];for(const n of c){if(n.text==="")continue;const e=r.at(-1);e&&f(e,n)?e.text+=n.text:r.push({...n})}return r.map(n=>{const[,e="",o="",i=""]=/^(\s*)([\s\S]*?)(\s*)$/u.exec(n.text)??[];if(o==="")return n.text;if(n.code&&!o.includes("`"))return`${e}\`${o}\`${i}`;let l=o.replace(/[\\*~`]/gu,s=>`\\${s}`);return n.strike&&(l=`~~${l}~~`),n.em&&(l=`*${l}*`),n.strong&&(l=`**${l}**`),`${e}${l}${i}`}).join("")}export const withoutMarks=c=>readMarks(c).text;const $=["strong","em","strike","code"];export function markRuns(c,f=[]){const r=[...new Set([0,c.length,...f.flatMap(e=>[e.at,e.end])])].filter(e=>e>=0&&e<=c.length).sort((e,o)=>e-o),n=[];return r.forEach((e,o)=>{const i=r[o+1];if(i===void 0||i<=e)return;const l=f.filter(s=>s.at<=e&&i<=s.end);n.push({text:c.slice(e,i),kinds:$.filter(s=>l.some(t=>t.kind===s))})}),n}
|
|
@@ -20,7 +20,8 @@ export type MusicTime = number | {
|
|
|
20
20
|
/** A stretch of the music's file, from `from` to `to`. */
|
|
21
21
|
export interface MusicStretch<T = MusicTime> {
|
|
22
22
|
from: T;
|
|
23
|
-
|
|
23
|
+
/** Where it ends; default the end of the file. */
|
|
24
|
+
to?: T;
|
|
24
25
|
}
|
|
25
26
|
/** The music's beat grid, in seconds of its file. */
|
|
26
27
|
export interface MusicGrid {
|
|
@@ -730,6 +730,14 @@ export interface GraphicLayer<P extends object = object> extends LayerTiming {
|
|
|
730
730
|
z?: "front" | "behind-person" | "overlay";
|
|
731
731
|
mount(el: HTMLElement, props: P, ctx: StageContext): void;
|
|
732
732
|
render(el: HTMLElement, t: number, props: P, ctx: StageContext): void;
|
|
733
|
+
/**
|
|
734
|
+
* Lets go of what mount made that the page does not free with `el` (a
|
|
735
|
+
* WebGL context, a worker, a timer): a deck mounts a slide's components
|
|
736
|
+
* when it is shown and unmounts them when it is let go, and mounts them
|
|
737
|
+
* again on a new element if it is shown again. State a layer carries from
|
|
738
|
+
* slide to slide is props, never what it kept from a mount.
|
|
739
|
+
*/
|
|
740
|
+
unmount?(el: HTMLElement, props: P, ctx: StageContext): void;
|
|
733
741
|
}
|
|
734
742
|
export type LayerSpec = FootageLayer | GraphicLayer;
|
|
735
743
|
export declare function isLayerSpec(v: unknown): v is LayerSpec;
|
|
@@ -848,8 +856,9 @@ export interface MusicOptions {
|
|
|
848
856
|
loop?: boolean | MusicStretch;
|
|
849
857
|
/**
|
|
850
858
|
* The stretches of the file to play, in order, back to back (`{ from,
|
|
851
|
-
* to }`, each a second of the file, `{ beat: n }` or `{ bar: n }
|
|
852
|
-
* bars 0 to 7 then 3 to 7 of a song that
|
|
859
|
+
* to }`, each a second of the file, `{ beat: n }` or `{ bar: n }`; no
|
|
860
|
+
* `to` runs to the file's end): bars 0 to 7 then 3 to 7 of a song that
|
|
861
|
+
* ends too soon. Each seam is
|
|
853
862
|
* crossed over `seam`; the film moves on by each stretch's exact length,
|
|
854
863
|
* so stretches cut on the beat keep the beat. Default: the file from
|
|
855
864
|
* `from` to its end.
|
|
@@ -73,6 +73,10 @@ export declare const RULES: {
|
|
|
73
73
|
readonly level: "error";
|
|
74
74
|
readonly rule: "A sheet's sheet.ts reads the clock or a random number, reaches outside the project, or does not make the same sheets twice";
|
|
75
75
|
};
|
|
76
|
+
readonly "AK-M013": {
|
|
77
|
+
readonly level: "error";
|
|
78
|
+
readonly rule: "A website's website.json is not JSON or does not match the format";
|
|
79
|
+
};
|
|
76
80
|
readonly "AK-B001": {
|
|
77
81
|
readonly level: "error";
|
|
78
82
|
readonly rule: "Two pieces have the same id";
|
|
@@ -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 is wrong whatever the taste: its files cannot be read, a formula does not parse or names what is not there, a reference is circular, or a check does not hold"},"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-M012":{level:"error",rule:"A sheet's sheet.ts reads the clock or a random number, reaches outside the project, or does not make the same sheets twice"},"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}}
|
|
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 is wrong whatever the taste: its files cannot be read, a formula does not parse or names what is not there, a reference is circular, or a check does not hold"},"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-M012":{level:"error",rule:"A sheet's sheet.ts reads the clock or a random number, reaches outside the project, or does not make the same sheets twice"},"AK-M013":{level:"error",rule:"A website's website.json is not JSON or does not match the format"},"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}}
|
|
@@ -104,11 +104,11 @@ export declare const VideoOptionsMeta: z.ZodObject<{
|
|
|
104
104
|
from: z.ZodOptional<z.ZodNumber>;
|
|
105
105
|
loop: z.ZodOptional<z.ZodUnion<readonly [z.ZodBoolean, z.ZodObject<{
|
|
106
106
|
from: z.ZodUnknown;
|
|
107
|
-
to: z.ZodUnknown
|
|
107
|
+
to: z.ZodOptional<z.ZodUnknown>;
|
|
108
108
|
}, z.core.$strict>]>>;
|
|
109
109
|
play: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
110
110
|
from: z.ZodUnknown;
|
|
111
|
-
to: z.ZodUnknown
|
|
111
|
+
to: z.ZodOptional<z.ZodUnknown>;
|
|
112
112
|
}, z.core.$strict>>>;
|
|
113
113
|
seam: z.ZodOptional<z.ZodNumber>;
|
|
114
114
|
meter: z.ZodOptional<z.ZodNumber>;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/*! AllyHub. Copyright (c) 2026 AllyHub, Inc. All rights reserved. Use is subject to LICENSE.md. */
|
|
2
|
-
import{z as t}from"zod";import{LOCALE as m}from"./messages.js";import{OUTPUT_KINDS as u}from"./piece.js";import{musicTimeProblem as b}from"./music.js";import{FPS_HELP as d,VIDEO_FORMAT_HELP as g,formatSpecProblem as f,isVideoFormat as h,parseFps as x}from"./formats.js";import{RESERVED_DIMS as l}from"./matrix.js";export const VideoFormatSchema=t.string().refine(h,{message:`unknown format (${g})`}),ComboSchema=t.record(t.string(),t.string()),ProblemSchema=t.strictObject({code:t.string().regex(/^AK-[A-Z]\d{3}$/),level:t.enum(["error","warn"]),message:t.string(),piece:t.string().optional(),output:t.string().optional(),combo:ComboSchema.optional(),format:t.string().optional(),part:t.string().optional(),t:t.number().optional(),page:t.number().int().nonnegative().optional(),where:t.strictObject({file:t.string().optional(),line:t.number().int().optional(),selector:t.string().optional(),bbox:t.tuple([t.number(),t.number(),t.number(),t.number()]).optional()}).optional()}),Locale=t.string().regex(m,"must be a lower-case locale such as en or zh-cn"),PieceId=t.string().regex(/^[a-z0-9][a-z0-9._-]*(\/[a-z0-9][a-z0-9._-]*)*$/,"id: lowercase letters, digits, . _ -, with / between levels"),DimName=t.string().regex(/^[a-z][a-zA-Z0-9_-]*$/,"dimension name: starts with a letter; letters, digits, _ and -"),DimValue=t.string().regex(/^[A-Za-z0-9][A-Za-z0-9._-]*$/,"dimension value: letters, digits, . _ -"),OutputName=t.string().regex(/^[A-Za-z][A-Za-z0-9_-]*$/,"output name: starts with a letter; letters, digits, _ and -"),DimsSchema=t.record(DimName,t.array(DimValue).min(1)).superRefine((o,e)=>{for(const[n,a]of Object.entries(o)){if(l.includes(n)){e.addIssue({code:"custom",path:[n],message:n==="size"||n==="format"?`${n} is not a dimension: a piece has one format, format: "9x16", and another format is a piece of its own`:`${n} cannot name a dimension: the preview's address uses it. Choose another name`});continue}if(new Set(a).size!==a.length&&e.addIssue({code:"custom",path:[n],message:"the same value is listed twice"}),n==="lang")for(const s of a)m.test(s)||e.addIssue({code:"custom",path:[n],message:`lang value ${s} must be a lowercase language tag, such as en or zh-cn`})}});const O=o=>l.includes(o)?`${o} cannot name a slot: the framework uses it. Choose another name`:void 0;export const CandidateSchema=t.union([DimValue,t.strictObject({name:DimValue,tags:t.array(t.string().regex(/^[A-Za-z0-9][A-Za-z0-9._:-]*$/)).optional()})]),SlotSchema=t.union([t.array(CandidateSchema).min(1),t.strictObject({pool:t.string().min(1),tags:t.array(t.string().min(1)).optional()})]);const j=t.union([t.string().min(1),t.array(t.string().min(1)).min(1)]),r=t.record(t.string(),j);export const MatrixSchema=t.strictObject({dims:DimsSchema.optional(),slots:t.record(DimName,SlotSchema).optional(),structures:t.record(DimValue,t.array(DimName).min(1)).optional(),combos:t.array(t.record(DimName,DimValue)).min(1).max(1e4).optional(),pick:t.number().int().min(1).max(1e4).optional(),seed:t.union([t.number(),t.string()]).optional(),differ:t.strictObject({slots:t.number().int().min(1).optional(),first:t.union([t.number().int().min(1),t.array(DimName).min(1)]).optional()}).optional(),rules:t.array(t.strictObject({if:r.optional(),require:r.optional(),exclude:r.optional()})).optional()}).superRefine((o,e)=>{for(const n of Object.keys(o.slots??{})){const a=O(n);a&&e.addIssue({code:"custom",path:["slots",n],message:a})}if(o.structures&&!o.slots&&e.addIssue({code:"custom",path:["structures"],message:"structures order slots: declare matrix.slots too"}),o.combos&&!o.slots&&e.addIssue({code:"custom",path:["combos"],message:"combos choose candidates of slots: declare matrix.slots too"}),o.combos)for(const n of["pick","seed"])o[n]!==void 0&&e.addIssue({code:"custom",path:[n],message:`combos names the combos to make, so nothing is sampled: remove ${n}, which only steers sampling`})}),FormatSpecSchema=t.strictObject({format:t.string().min(1),safe:t.strictObject({top:t.number().optional(),bottom:t.number().optional(),left:t.number().optional(),right:t.number().optional()}).optional(),maxDuration:t.number().positive().optional(),loudness:t.number().min(-70).max(0).optional()}).superRefine((o,e)=>{const n=f(o);n&&e.addIssue({code:"custom",message:n})}),FormatEntrySchema=t.union([t.string().min(1),FormatSpecSchema]);const i=t.number().min(-70).max(0),c=t.unknown().superRefine((o,e)=>{const n=b(o);n&&e.addIssue({code:"custom",message:n})}),p=t.strictObject({from:c,to:c}),S=t.union([t.number().min(0),t.string().min(1),t.strictObject({part:t.string().min(1),at:t.union([t.number(),t.string().min(1)])})]);export const PartDefaultsSchema=t.strictObject({dur:t.number().positive().max(3600).optional(),lead:t.number().min(0).max(60).optional(),tail:t.number().min(0).max(60).optional()}),VideoOptionsMeta=t.strictObject({music:t.strictObject({file:t.union([t.string().min(1),t.record(Locale,t.string().min(1))]).optional(),from:t.number().min(0).optional(),loop:t.union([t.boolean(),p]).optional(),play:t.array(p).min(1).optional(),seam:t.number().min(0).max(5).optional(),meter:t.number().int().min(1).max(32).optional(),downbeat:t.number().min(0).optional(),end:t.enum(["film","bar","beat"]).optional(),snap:t.boolean().optional(),bpm:t.number().min(20).max(400).optional(),gain:t.array(t.strictObject({at:S,db:t.number().min(-60).max(24)})).min(1).optional(),filter:t.string().min(1).optional(),eq:t.array(t.unknown()).optional(),compress:t.unknown().optional()}).optional(),mix:t.strictObject({speech:i.optional(),music:i.optional(),musicAlone:i.optional(),sfx:i.optional(),footage:i.optional(),footageUnderSpeech:i.optional(),duck:t.strictObject({db:t.number().min(-60).max(0).optional(),attack:t.number().min(0).max(10).optional(),release:t.number().min(0).max(10).optional(),hold:t.number().min(0).max(60).optional()}).optional(),musicFade:t.strictObject({in:t.number().min(0).max(60).optional(),out:t.number().min(0).max(60).optional()}).optional()}).optional(),mic:t.union([t.string().min(1),t.record(t.string(),t.unknown()),t.literal(!1)]).optional(),look:t.string().min(1).optional(),defaults:t.strictObject({part:PartDefaultsSchema.optional()}).optional(),covers:t.literal(!0).optional(),fps:t.union([t.number(),t.string()]).refine(o=>x(o)!==void 0,{error:`A frame rate is ${d}`}).optional(),transparent:t.boolean().optional(),maxDuration:t.number().positive().optional(),loadLimit:t.number().positive().optional(),seekLimit:t.number().positive().optional(),deliverable:t.boolean().optional(),master:t.union([i,t.literal(!1),t.strictObject({lufs:t.union([i,t.literal(!1)]).optional(),truePeak:t.number().min(-9).max(0).optional()})]).optional(),motionBlur:t.strictObject({samples:t.number().int().min(2).max(16),shutter:t.number().gt(0).max(1).optional()}).optional(),capture:t.strictObject({bloom:t.strictObject({threshold:t.number().optional(),radius:t.number().optional(),strength:t.number().optional()}).optional(),aberration:t.number().optional(),soften:t.number().optional(),vignette:t.number().optional(),exposure:t.strictObject({drift:t.number().optional(),period:t.number().optional()}).optional(),grain:t.strictObject({amount:t.number().optional(),size:t.number().optional(),shadows:t.number().optional(),highlights:t.number().optional(),chroma:t.number().optional(),chromaSize:t.number().optional(),static:t.boolean().optional()}).optional(),sharpen:t.number().optional()}).optional(),post:t.strictObject({filter:t.string().min(1).optional(),lut:t.string().regex(/\.cube$/i,"A LUT is a .cube file").optional()}).optional()}),OutputMeta=t.strictObject({kind:t.enum(u),options:t.record(t.string(),t.unknown())}),PieceMeta=t.strictObject({id:PieceId.optional(),title:t.union([t.string().min(1),t.record(Locale,t.string().min(1))]).optional(),format:FormatEntrySchema.optional(),matrix:MatrixSchema.optional(),meta:t.record(t.string(),t.unknown()).optional(),outputs:t.record(OutputName,OutputMeta).refine(o=>Object.keys(o).length>0,"outputs needs at least one output")}),LookConfigSchema=t.strictObject({color:t.strictObject({bg:t.string().min(1).optional(),fg:t.string().min(1).optional(),accent:t.string().min(1).optional(),muted:t.string().min(1).optional(),surface:t.string().min(1).optional()}).optional(),font:t.strictObject({display:t.string().min(1).optional(),body:t.string().min(1).optional(),mono:t.string().min(1).optional(),emoji:t.string().min(1).optional()}).optional(),motion:t.strictObject({beat:t.number().positive().optional()}).optional(),sfx:t.record(t.string().regex(/^[a-z][a-z0-9-]*$/,"a sound's name: lowercase letters, digits and -"),t.string().min(1).refine(o=>!o.startsWith("/")&&!o.split(/[\\/]/).includes(".."),"a sound is an audio file relative to the workspace's root")).optional()}),PropSchemaEntry=t.looseObject({type:t.enum(["text","time","asset","color","number","boolean","list","object"])}),ComponentEntry=t.strictObject({name:t.string(),label:t.union([t.string(),t.record(t.string(),t.string())]),file:t.string(),props:t.record(t.string(),PropSchemaEntry),examples:t.array(t.string()),hidden:t.boolean()}),VideoConfigSchema=t.object({look:LookConfigSchema.optional(),defaults:t.strictObject({format:VideoFormatSchema.optional(),part:PartDefaultsSchema.optional()}).optional()});
|
|
2
|
+
import{z as t}from"zod";import{LOCALE as m}from"./messages.js";import{OUTPUT_KINDS as u}from"./piece.js";import{musicTimeProblem as b}from"./music.js";import{FPS_HELP as d,VIDEO_FORMAT_HELP as g,formatSpecProblem as f,isVideoFormat as h,parseFps as x}from"./formats.js";import{RESERVED_DIMS as l}from"./matrix.js";export const VideoFormatSchema=t.string().refine(h,{message:`unknown format (${g})`}),ComboSchema=t.record(t.string(),t.string()),ProblemSchema=t.strictObject({code:t.string().regex(/^AK-[A-Z]\d{3}$/),level:t.enum(["error","warn"]),message:t.string(),piece:t.string().optional(),output:t.string().optional(),combo:ComboSchema.optional(),format:t.string().optional(),part:t.string().optional(),t:t.number().optional(),page:t.number().int().nonnegative().optional(),where:t.strictObject({file:t.string().optional(),line:t.number().int().optional(),selector:t.string().optional(),bbox:t.tuple([t.number(),t.number(),t.number(),t.number()]).optional()}).optional()}),Locale=t.string().regex(m,"must be a lower-case locale such as en or zh-cn"),PieceId=t.string().regex(/^[a-z0-9][a-z0-9._-]*(\/[a-z0-9][a-z0-9._-]*)*$/,"id: lowercase letters, digits, . _ -, with / between levels"),DimName=t.string().regex(/^[a-z][a-zA-Z0-9_-]*$/,"dimension name: starts with a letter; letters, digits, _ and -"),DimValue=t.string().regex(/^[A-Za-z0-9][A-Za-z0-9._-]*$/,"dimension value: letters, digits, . _ -"),OutputName=t.string().regex(/^[A-Za-z][A-Za-z0-9_-]*$/,"output name: starts with a letter; letters, digits, _ and -"),DimsSchema=t.record(DimName,t.array(DimValue).min(1)).superRefine((o,e)=>{for(const[n,a]of Object.entries(o)){if(l.includes(n)){e.addIssue({code:"custom",path:[n],message:n==="size"||n==="format"?`${n} is not a dimension: a piece has one format, format: "9x16", and another format is a piece of its own`:`${n} cannot name a dimension: the preview's address uses it. Choose another name`});continue}if(new Set(a).size!==a.length&&e.addIssue({code:"custom",path:[n],message:"the same value is listed twice"}),n==="lang")for(const s of a)m.test(s)||e.addIssue({code:"custom",path:[n],message:`lang value ${s} must be a lowercase language tag, such as en or zh-cn`})}});const O=o=>l.includes(o)?`${o} cannot name a slot: the framework uses it. Choose another name`:void 0;export const CandidateSchema=t.union([DimValue,t.strictObject({name:DimValue,tags:t.array(t.string().regex(/^[A-Za-z0-9][A-Za-z0-9._:-]*$/)).optional()})]),SlotSchema=t.union([t.array(CandidateSchema).min(1),t.strictObject({pool:t.string().min(1),tags:t.array(t.string().min(1)).optional()})]);const j=t.union([t.string().min(1),t.array(t.string().min(1)).min(1)]),r=t.record(t.string(),j);export const MatrixSchema=t.strictObject({dims:DimsSchema.optional(),slots:t.record(DimName,SlotSchema).optional(),structures:t.record(DimValue,t.array(DimName).min(1)).optional(),combos:t.array(t.record(DimName,DimValue)).min(1).max(1e4).optional(),pick:t.number().int().min(1).max(1e4).optional(),seed:t.union([t.number(),t.string()]).optional(),differ:t.strictObject({slots:t.number().int().min(1).optional(),first:t.union([t.number().int().min(1),t.array(DimName).min(1)]).optional()}).optional(),rules:t.array(t.strictObject({if:r.optional(),require:r.optional(),exclude:r.optional()})).optional()}).superRefine((o,e)=>{for(const n of Object.keys(o.slots??{})){const a=O(n);a&&e.addIssue({code:"custom",path:["slots",n],message:a})}if(o.structures&&!o.slots&&e.addIssue({code:"custom",path:["structures"],message:"structures order slots: declare matrix.slots too"}),o.combos&&!o.slots&&e.addIssue({code:"custom",path:["combos"],message:"combos choose candidates of slots: declare matrix.slots too"}),o.combos)for(const n of["pick","seed"])o[n]!==void 0&&e.addIssue({code:"custom",path:[n],message:`combos names the combos to make, so nothing is sampled: remove ${n}, which only steers sampling`})}),FormatSpecSchema=t.strictObject({format:t.string().min(1),safe:t.strictObject({top:t.number().optional(),bottom:t.number().optional(),left:t.number().optional(),right:t.number().optional()}).optional(),maxDuration:t.number().positive().optional(),loudness:t.number().min(-70).max(0).optional()}).superRefine((o,e)=>{const n=f(o);n&&e.addIssue({code:"custom",message:n})}),FormatEntrySchema=t.union([t.string().min(1),FormatSpecSchema]);const i=t.number().min(-70).max(0),c=t.unknown().superRefine((o,e)=>{const n=b(o);n&&e.addIssue({code:"custom",message:n})}),p=t.strictObject({from:c,to:c.optional()}),S=t.union([t.number().min(0),t.string().min(1),t.strictObject({part:t.string().min(1),at:t.union([t.number(),t.string().min(1)])})]);export const PartDefaultsSchema=t.strictObject({dur:t.number().positive().max(3600).optional(),lead:t.number().min(0).max(60).optional(),tail:t.number().min(0).max(60).optional()}),VideoOptionsMeta=t.strictObject({music:t.strictObject({file:t.union([t.string().min(1),t.record(Locale,t.string().min(1))]).optional(),from:t.number().min(0).optional(),loop:t.union([t.boolean(),p]).optional(),play:t.array(p).min(1).optional(),seam:t.number().min(0).max(5).optional(),meter:t.number().int().min(1).max(32).optional(),downbeat:t.number().min(0).optional(),end:t.enum(["film","bar","beat"]).optional(),snap:t.boolean().optional(),bpm:t.number().min(20).max(400).optional(),gain:t.array(t.strictObject({at:S,db:t.number().min(-60).max(24)})).min(1).optional(),filter:t.string().min(1).optional(),eq:t.array(t.unknown()).optional(),compress:t.unknown().optional()}).optional(),mix:t.strictObject({speech:i.optional(),music:i.optional(),musicAlone:i.optional(),sfx:i.optional(),footage:i.optional(),footageUnderSpeech:i.optional(),duck:t.strictObject({db:t.number().min(-60).max(0).optional(),attack:t.number().min(0).max(10).optional(),release:t.number().min(0).max(10).optional(),hold:t.number().min(0).max(60).optional()}).optional(),musicFade:t.strictObject({in:t.number().min(0).max(60).optional(),out:t.number().min(0).max(60).optional()}).optional()}).optional(),mic:t.union([t.string().min(1),t.record(t.string(),t.unknown()),t.literal(!1)]).optional(),look:t.string().min(1).optional(),defaults:t.strictObject({part:PartDefaultsSchema.optional()}).optional(),covers:t.literal(!0).optional(),fps:t.union([t.number(),t.string()]).refine(o=>x(o)!==void 0,{error:`A frame rate is ${d}`}).optional(),transparent:t.boolean().optional(),maxDuration:t.number().positive().optional(),loadLimit:t.number().positive().optional(),seekLimit:t.number().positive().optional(),deliverable:t.boolean().optional(),master:t.union([i,t.literal(!1),t.strictObject({lufs:t.union([i,t.literal(!1)]).optional(),truePeak:t.number().min(-9).max(0).optional()})]).optional(),motionBlur:t.strictObject({samples:t.number().int().min(2).max(16),shutter:t.number().gt(0).max(1).optional()}).optional(),capture:t.strictObject({bloom:t.strictObject({threshold:t.number().optional(),radius:t.number().optional(),strength:t.number().optional()}).optional(),aberration:t.number().optional(),soften:t.number().optional(),vignette:t.number().optional(),exposure:t.strictObject({drift:t.number().optional(),period:t.number().optional()}).optional(),grain:t.strictObject({amount:t.number().optional(),size:t.number().optional(),shadows:t.number().optional(),highlights:t.number().optional(),chroma:t.number().optional(),chromaSize:t.number().optional(),static:t.boolean().optional()}).optional(),sharpen:t.number().optional()}).optional(),post:t.strictObject({filter:t.string().min(1).optional(),lut:t.string().regex(/\.cube$/i,"A LUT is a .cube file").optional()}).optional()}),OutputMeta=t.strictObject({kind:t.enum(u),options:t.record(t.string(),t.unknown())}),PieceMeta=t.strictObject({id:PieceId.optional(),title:t.union([t.string().min(1),t.record(Locale,t.string().min(1))]).optional(),format:FormatEntrySchema.optional(),matrix:MatrixSchema.optional(),meta:t.record(t.string(),t.unknown()).optional(),outputs:t.record(OutputName,OutputMeta).refine(o=>Object.keys(o).length>0,"outputs needs at least one output")}),LookConfigSchema=t.strictObject({color:t.strictObject({bg:t.string().min(1).optional(),fg:t.string().min(1).optional(),accent:t.string().min(1).optional(),muted:t.string().min(1).optional(),surface:t.string().min(1).optional()}).optional(),font:t.strictObject({display:t.string().min(1).optional(),body:t.string().min(1).optional(),mono:t.string().min(1).optional(),emoji:t.string().min(1).optional()}).optional(),motion:t.strictObject({beat:t.number().positive().optional()}).optional(),sfx:t.record(t.string().regex(/^[a-z][a-z0-9-]*$/,"a sound's name: lowercase letters, digits and -"),t.string().min(1).refine(o=>!o.startsWith("/")&&!o.split(/[\\/]/).includes(".."),"a sound is an audio file relative to the workspace's root")).optional()}),PropSchemaEntry=t.looseObject({type:t.enum(["text","time","asset","color","number","boolean","list","object"])}),ComponentEntry=t.strictObject({name:t.string(),label:t.union([t.string(),t.record(t.string(),t.string())]),file:t.string(),props:t.record(t.string(),PropSchemaEntry),examples:t.array(t.string()),hidden:t.boolean()}),VideoConfigSchema=t.object({look:LookConfigSchema.optional(),defaults:t.strictObject({format:VideoFormatSchema.optional(),part:PartDefaultsSchema.optional()}).optional()});
|
|
@@ -15,10 +15,11 @@ export interface ScriptPart {
|
|
|
15
15
|
/** What it shows, by name. */
|
|
16
16
|
screen?: Record<string, ScriptText>;
|
|
17
17
|
}
|
|
18
|
-
/** A deck's slide in its script: its shapes' words by name, and its notes. */
|
|
18
|
+
/** A deck's slide in its script: its shapes' words by name, their alternative text, and its notes. */
|
|
19
19
|
export interface ScriptSlide {
|
|
20
20
|
id: string;
|
|
21
21
|
text?: Record<string, ScriptText>;
|
|
22
|
+
alt?: Record<string, string>;
|
|
22
23
|
notes?: string | VariantsMessage;
|
|
23
24
|
}
|
|
24
25
|
export interface ScriptFile {
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/*! AllyHub. Copyright (c) 2026 AllyHub, Inc. All rights reserved. Use is subject to LICENSE.md. */
|
|
2
|
-
import{hasAnchors as
|
|
2
|
+
import{hasAnchors as A,hasSpans as O,readAnchors as k,spokenLine as S}from"./anchors.js";import{isSpoken as g}from"./messages.js";export const SCRIPT_FILE=/^script\.([a-z]{2,3}(?:-[a-z0-9]{2,8})?)\.ya?ml$/;const $=/^[A-Za-z0-9_-]+$/,b=e=>typeof e=="object"&&e!==null&&!Array.isArray(e),E=e=>e.length===0?"(root)":e.map((r,s)=>typeof r=="number"?`[${String(r)}]`:`${s?".":""}${r}`).join("");function w(e){const r=d=>Array.isArray(d)&&d.every(o=>typeof o=="string"),s=e.match;if(!b(s)||!Object.values(s).every(d=>typeof d=="string"))return"match must map each case to its text";const u=e.declarations??[],m=e.selectors??[];if(!r(u)||!r(m))return"declarations and selectors must be lists of strings";const h=Object.keys(e).filter(d=>!["declarations","selectors","match"].includes(d));return h.length>0?`unknown key ${h.join(", ")}`:{declarations:u,selectors:m,match:s}}function _(e){if(typeof e=="string")return e;if(g(e))return Object.keys(e).length===2?e:"has more than display and speak";if(b(e)&&"match"in e)return w(e)}export function parseScript(e){const r=[],s=(t,n)=>{r.push(`${E(t)}: ${n}`)},u=(t,n)=>{const i=_(t);if(i===void 0||typeof i=="string"&&i!==t){s(n,typeof i=="string"?i:typeof t=="number"||typeof t=="boolean"?`${String(t)} is not text: put it in quotes`:"must be text, { display, speak }, or a plural or selection");return}return i},m=(t,n)=>{if(!b(t)){s(n,"must be names with their text");return}const i={};for(const[c,f]of Object.entries(t)){const y=h(f,[...n,c]);$.test(c)?y!==void 0&&(i[c]=y):s([...n,c],"a name has only letters, digits, _ and -")}return i},h=(t,n)=>{if(Array.isArray(t)){const i=t.map((c,f)=>h(c,[...n,f]));return i.every(c=>c!==void 0)?i:void 0}return b(t)&&!g(t)&&!("match"in t)?m(t,n):u(t,n)};if(e==null)return{script:{parts:[]}};if(!b(e))return{problems:["(root): must be title, text and parts"]};const d={parts:[]};for(const t of Object.keys(e))["title","text","parts","slides"].includes(t)||s([t],"unknown key: a script has title, text, parts and slides");if(e.title!==void 0&&(typeof e.title=="string"?d.title=e.title:s(["title"],"must be text")),e.text!==void 0){const t=m(e.text,["text"]);t&&(d.text=t)}const o=e.parts??[];if(!Array.isArray(o))s(["parts"],"must be a list of parts");else{const t=new Set;o.forEach((n,i)=>{const c=["parts",i];if(!b(n)){s(c,"must be a part: id, say, screen");return}for(const l of Object.keys(n))["id","say","screen"].includes(l)||s([...c,l],"unknown key: a part has id, say and screen");const f=n.id;if(typeof f!="string"||!$.test(f)){s([...c,"id"],"a part needs an id of letters, digits, _ and -");return}if(t.has(f)){s([...c,"id"],`two parts have the id ${f}`);return}t.add(f);const y={id:f};if(n.say!==void 0){const l=u(n.say,[...c,"say"]);if(g(l))s([...c,"say"],"is one line: write a piece that is shown one way and said another inside it, as <shown|said>");else if(l!==void 0){y.say=l;for(const x of z(l))s([...c,"say"],x)}}if(n.screen!==void 0){const l=m(n.screen,[...c,"screen"]);l&&(y.screen=l)}d.parts.push(y)})}const a=e.slides??[];if(!Array.isArray(a))s(["slides"],"must be a list of slides");else{const t=new Set,n=[];a.forEach((i,c)=>{const f=["slides",c];if(!b(i)){s(f,"must be a slide: id, text, alt, notes");return}for(const p of Object.keys(i))["id","text","alt","notes"].includes(p)||s([...f,p],"unknown key: a slide has id, text, alt and notes");const y=i.id;if(typeof y!="string"||!$.test(y)){s([...f,"id"],"a slide needs an id of letters, digits, _ and -");return}if(t.has(y)){s([...f,"id"],`two slides have the id ${y}`);return}t.add(y);const l={id:y};if(i.text!==void 0){const p=m(i.text,[...f,"text"]);p&&(l.text=p)}const x=i.alt;if(x!==void 0&&(b(x)&&Object.entries(x).every(([p,j])=>$.test(p)&&typeof j=="string")?l.alt=x:s([...f,"alt"],"is each shape's alternative text, by name")),i.notes!==void 0){const p=u(i.notes,[...f,"notes"]);typeof p=="string"||p!==void 0&&!g(p)?l.notes=p:p!==void 0&&s([...f,"notes"],"is text")}n.push(l)}),n.length>0&&(d.slides=n)}return r.length>0?{problems:r}:{script:d}}function z(e){return typeof e=="string"?k(e).problems:g(e)?[]:Object.values(e.match).some(r=>A(r)||O(r))?["a plural or a selection cannot have anchors or <shown|said>"]:[]}export function saidOf(e){if(typeof e!="string")return{value:e,anchors:[]};const r=k(e);if(r.spans.length===0)return{value:r.text,anchors:r.anchors};const s=S(r);return{value:{display:r.text,speak:s.text},anchors:r.anchors.map(u=>({name:u.name,at:s.at(u.at,!1),...u.end===void 0?{}:{end:s.at(u.end,!0)}}))}}const L=e=>typeof e=="string"||!Array.isArray(e)&&(g(e)||"match"in e);export function scriptKeys(e,r){const s=[],u=new Set,m=[],h=(o,a,t,n=[])=>{u.has(o)?m.push(o):(u.add(o),s.push({key:o,value:a,path:t,...n.length>0?{anchors:n}:{}}))},d=(o,a,t)=>{if(L(a))h(o,a,t);else if(Array.isArray(a))a.forEach((n,i)=>{d(`${o}.${String(i)}`,n,[...t,i])});else for(const[n,i]of Object.entries(a))d(`${o}.${n}`,i,[...t,n])};r.title!==void 0&&h(`${e}.title`,r.title,["title"]);for(const[o,a]of Object.entries(r.text??{}))d(`${e}.${o}`,a,["text",o]);return r.parts.forEach((o,a)=>{const t=`${e}.${o.id}`;if(o.say!==void 0){const n=saidOf(o.say);h(`${t}.say`,n.value,["parts",a,"say"],n.anchors)}for(const[n,i]of Object.entries(o.screen??{}))d(`${t}.${n}`,i,["parts",a,"screen",n])}),(r.slides??[]).forEach((o,a)=>{const t=`${e}.${o.id}`;for(const[n,i]of Object.entries(o.text??{}))d(`${t}.${n}`,i,["slides",a,"text",n]);o.notes!==void 0&&h(`${t}.notes`,o.notes,["slides",a,"notes"]);for(const[n,i]of Object.entries(o.alt??{}))h(`${t}.alt.${n}`,i,["slides",a,"alt",n])}),{keys:s,twice:m}}export function scriptMessages(e,r){return Object.fromEntries(scriptKeys(e,r).keys.map(s=>[s.key,s.value]))}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import type { MediaInfo } from "./media.js";
|
|
2
|
+
import type { BuildSource } from "./timeline.js";
|
|
3
|
+
/** A file's media, its addresses absolute against the tree's root. */
|
|
4
|
+
export declare function resolveMedia(media: Readonly<Record<string, MediaInfo>>, root: string | URL): Record<string, MediaInfo>;
|
|
5
|
+
/** A piece's source, its bundle's, styles' and media's addresses absolute against the tree's root. */
|
|
6
|
+
export declare function resolveSource(source: BuildSource, root: string | URL): BuildSource;
|
|
7
|
+
//# sourceMappingURL=source.d.ts.map
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
/*! AllyHub. Copyright (c) 2026 AllyHub, Inc. All rights reserved. Use is subject to LICENSE.md. */
|
|
2
|
+
const t=(e,n)=>e===""?e:new URL(e,n).href;export function resolveMedia(e,n){return Object.fromEntries(Object.entries(e).map(([i,d])=>[i,{...d,url:t(d.url,n),...d.matteUrl===void 0?{}:{matteUrl:t(d.matteUrl,n)},...d.denoisedUrl===void 0?{}:{denoisedUrl:t(d.denoisedUrl,n)}}]))}export function resolveSource(e,n){return{...e,module:t(e.module,n),...e.styles===void 0?{}:{styles:e.styles.map(i=>t(i,n))},media:resolveMedia(e.media,n)}}
|
|
@@ -15,8 +15,6 @@ export interface LoadOptions {
|
|
|
15
15
|
/** The combo: one value per dimension, e.g. { lang: "zh-cn" }. */
|
|
16
16
|
combo: Combo;
|
|
17
17
|
purpose: "play" | "render" | "check";
|
|
18
|
-
/** A deck drawn for its editor: an empty placeholder is drawn, to type into. */
|
|
19
|
-
editing?: boolean;
|
|
20
18
|
/**
|
|
21
19
|
* The most different console messages kept from piece code (see
|
|
22
20
|
* console.ts); default CONSOLE_LIMIT.
|
|
@@ -41,9 +39,14 @@ export interface BuildSource {
|
|
|
41
39
|
* piece says where it was written (`base`).
|
|
42
40
|
*/
|
|
43
41
|
file: string;
|
|
44
|
-
/**
|
|
42
|
+
/**
|
|
43
|
+
* The bundled piece module's address. A build writes it, and every
|
|
44
|
+
* address below, relative to the root of the tree the stage is served
|
|
45
|
+
* in (`build/pieces/…`, `media/…`); the stage resolves them
|
|
46
|
+
* (resolveSource), so one build is served anywhere.
|
|
47
|
+
*/
|
|
45
48
|
module: string;
|
|
46
|
-
/**
|
|
49
|
+
/** The stylesheets the bundle imports. */
|
|
47
50
|
styles?: string[];
|
|
48
51
|
/** The piece's dimensions, as the build resolved them (lang filled in). */
|
|
49
52
|
dims: Dims;
|
|
@@ -68,7 +71,7 @@ export interface BuildSource {
|
|
|
68
71
|
anchors?: Record<string, Record<string, TextAnchor[]>>;
|
|
69
72
|
/** The folder of the shared words (allyhub.config.ts's text); default assets/text. */
|
|
70
73
|
text?: string;
|
|
71
|
-
/** Repo path → media, with
|
|
74
|
+
/** Repo path → media, with its address. */
|
|
72
75
|
media: Record<string, MediaInfo>;
|
|
73
76
|
/** Repo path → data files (CSV, YAML, JSON) that ctx.data(path) reads. */
|
|
74
77
|
data?: Record<string, DataFile>;
|
|
@@ -78,6 +81,8 @@ export interface BuildSource {
|
|
|
78
81
|
partDefaults?: PartDefaults;
|
|
79
82
|
/** A deck's pages: its slides.yaml as the build read it (none when it has none, or it does not match the format). */
|
|
80
83
|
slides?: SlidesFile;
|
|
84
|
+
/** A deck's code as data, as the build ran it (slides-core's DeckCode): its generators' slides made in Node; without it the stage runs them. */
|
|
85
|
+
code?: unknown;
|
|
81
86
|
/**
|
|
82
87
|
* Every piece of the build by id, for a piece that shows another inside
|
|
83
88
|
* it (a scenery's screen): its file, dimensions, format and matrix.
|
|
@@ -92,34 +97,6 @@ export interface BuildSource {
|
|
|
92
97
|
};
|
|
93
98
|
}>;
|
|
94
99
|
}
|
|
95
|
-
/**
|
|
96
|
-
* stage/source.json in a build folder: what a host
|
|
97
|
-
* needs, besides the build's files, to hand load() a BuildSource for any
|
|
98
|
-
* piece of the build. Paths are relative to the build folder; the host
|
|
99
|
-
* adds URLs (media are fetched by sha256).
|
|
100
|
-
*/
|
|
101
|
-
export interface StageSource {
|
|
102
|
-
schema: 1;
|
|
103
|
-
/** The runtime's browser bundle the build was made with. */
|
|
104
|
-
runtime: string;
|
|
105
|
-
/** Locales, the default first. */
|
|
106
|
-
locales: string[];
|
|
107
|
-
pieces: Record<string, {
|
|
108
|
-
file: string;
|
|
109
|
-
module: string;
|
|
110
|
-
styles: string[];
|
|
111
|
-
dims: Dims;
|
|
112
|
-
matrix?: {
|
|
113
|
-
space: MatrixSpace;
|
|
114
|
-
rules: MatrixRule[];
|
|
115
|
-
};
|
|
116
|
-
format: string;
|
|
117
|
-
}>;
|
|
118
|
-
media: Record<string, Omit<MediaInfo, "url">>;
|
|
119
|
-
data: Record<string, DataFile>;
|
|
120
|
-
/** The project's looks (allyhub.config.ts `look`), when it sets one. */
|
|
121
|
-
looks?: Record<string, Look>;
|
|
122
|
-
}
|
|
123
100
|
/** Where a part's speech plays: film seconds, and the take's file and offset. */
|
|
124
101
|
export interface PartSpeech {
|
|
125
102
|
/** Film time the speech starts and ends. */
|
package/dist/sheets.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export { Alignment, AreaChart, AutoFilter, BLOCK_CELLS, BarChart, Border, CAPABILITIES, Cell, CellIsRule, ChartBase, Color, ColorScaleRule, ColumnDimension, ConditionalFormattingList, DataBarRule, DataLabelList, DataValidation, DataValidationList, DefinedName, DefinedNameDict, DifferentialStyle, DoughnutChart, Font, FormulaRule, GraphicalProperties, IconSetRule, Legend, LineChart, LineProperties, Marker, NumericAxis, PatternFill, PieChart, Reference, RowDimension, Rule, Scaling, ScatterChart, Series, Side, Table, TableList, TextAxis, Workbook, Worksheet, column_index_from_string, coordinate_to_tuple, get_column_letter, load_workbook, range_boundaries, workbook, type AlignmentOptions, type BarChartOptions, type BorderOptions, type CellIsRuleOptions, type CellValue, type SheetCodeBuild, type SheetCodeContext, type ChartData, type ColorScaleRuleOptions, type DataBarRuleOptions, type DataValidationOptions, type DifferentialStyleOptions, type FontOptions, type FormulaRuleOptions, type LoadOptions, type PatternFillOptions, type ReferenceOptions, type RuleOptions, type SeriesOptions, type SideOptions, type TableInput, type TableOptions, } from "@allyhub-next/sheet/api";
|
|
1
|
+
export { Alignment, AreaChart, AutoFilter, BLOCK_CELLS, BarChart, Comment, Image, PageMargins, PageSetup, Border, CAPABILITIES, Cell, CellIsRule, ChartBase, Color, ColorScaleRule, ColumnDimension, ConditionalFormattingList, DataBarRule, DataLabelList, DataValidation, DataValidationList, DefinedName, DefinedNameDict, DifferentialStyle, DoughnutChart, Font, FormulaRule, GraphicalProperties, IconSetRule, Legend, LineChart, LineProperties, Marker, NumericAxis, PatternFill, PieChart, Reference, RowDimension, Rule, Scaling, ScatterChart, Series, Side, Table, TableList, TextAxis, Workbook, Worksheet, column_index_from_string, coordinate_to_tuple, get_column_letter, load_workbook, range_boundaries, workbook, type AlignmentOptions, type BarChartOptions, type BorderOptions, type CellIsRuleOptions, type CellValue, type SheetCodeBuild, type SheetCodeContext, type ChartData, type ColorScaleRuleOptions, type DataBarRuleOptions, type DataValidationOptions, type DifferentialStyleOptions, type FontOptions, type FormulaRuleOptions, type LoadOptions, type PatternFillOptions, type ReferenceOptions, type RuleOptions, type SeriesOptions, type SideOptions, type TableInput, type TableOptions, } from "@allyhub-next/sheet/api";
|
|
2
2
|
//# sourceMappingURL=sheets.d.ts.map
|
package/dist/sheets.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/*! AllyHub. Copyright (c) 2026 AllyHub, Inc. All rights reserved. Use is subject to LICENSE.md. */
|
|
2
|
-
export{Alignment,AreaChart,AutoFilter,BLOCK_CELLS,BarChart,Border,CAPABILITIES,Cell,CellIsRule,ChartBase,Color,ColorScaleRule,ColumnDimension,ConditionalFormattingList,DataBarRule,DataLabelList,DataValidation,DataValidationList,DefinedName,DefinedNameDict,DifferentialStyle,DoughnutChart,Font,FormulaRule,GraphicalProperties,IconSetRule,Legend,LineChart,LineProperties,Marker,NumericAxis,PatternFill,PieChart,Reference,RowDimension,Rule,Scaling,ScatterChart,Series,Side,Table,TableList,TextAxis,Workbook,Worksheet,column_index_from_string,coordinate_to_tuple,get_column_letter,load_workbook,range_boundaries,workbook}from"@allyhub-next/sheet/api";
|
|
2
|
+
export{Alignment,AreaChart,AutoFilter,BLOCK_CELLS,BarChart,Comment,Image,PageMargins,PageSetup,Border,CAPABILITIES,Cell,CellIsRule,ChartBase,Color,ColorScaleRule,ColumnDimension,ConditionalFormattingList,DataBarRule,DataLabelList,DataValidation,DataValidationList,DefinedName,DefinedNameDict,DifferentialStyle,DoughnutChart,Font,FormulaRule,GraphicalProperties,IconSetRule,Legend,LineChart,LineProperties,Marker,NumericAxis,PatternFill,PieChart,Reference,RowDimension,Rule,Scaling,ScatterChart,Series,Side,Table,TableList,TextAxis,Workbook,Worksheet,column_index_from_string,coordinate_to_tuple,get_column_letter,load_workbook,range_boundaries,workbook}from"@allyhub-next/sheet/api";
|
package/dist/slides.d.ts
CHANGED
|
@@ -1,4 +1,6 @@
|
|
|
1
|
-
|
|
1
|
+
/** python-pptx's length functions: each gives a Length, a number of EMU that says itself in other units (`Pt(12).pt`, `.inches`, `.cm`, `.mm`, `.emu`). */
|
|
2
|
+
export declare const Emu: (n: number) => import("@allyhub-next/slides-core").LengthValue, Inches: (n: number) => import("@allyhub-next/slides-core").LengthValue, Pt: (n: number) => import("@allyhub-next/slides-core").LengthValue, Cm: (n: number) => import("@allyhub-next/slides-core").LengthValue, Mm: (n: number) => import("@allyhub-next/slides-core").LengthValue, Centipoints: (n: number) => import("@allyhub-next/slides-core").LengthValue;
|
|
3
|
+
export { RGBColor, MSO_ANCHOR, CategoryChartData, MSO_ARROWHEAD, XL_CHART_TYPE, XL_LABEL_POSITION, XL_LEGEND_POSITION, MSO_AUTO_SIZE, MSO_CONNECTOR, MSO_FILL, MSO_LINE, MSO_SHAPE, MSO_SHAPE_TYPE, MSO_THEME_COLOR, PP_ALIGN, PP_PLACEHOLDER, THEME_FONT, SLIDE_SIZES, presentationFor, isDeck, type Anchor, type AutoSize, type Background, type ColorFormat, type ComponentContext, type ComponentInput, type Deck, type FillFormat, type Font, type GeneratedSlide, type Generator, type Length, type LengthValue, type LineFormat, type ListLevel, type ListStyle, type Paragraph, type Placeholders, type PlaceholderType, type Presentation, type PresentationOptions, type PropSpec, type Run, type Shape, type ShapeCollection, type ShapeType, type SlideLayout, type SlideLayouts, type SlideMaster, type SlideMasters, type SlideSizeName, type TextFrame, type TextStyles, type ThemeInput, } from "@allyhub-next/slides-core";
|
|
2
4
|
/**
|
|
3
5
|
* A deck: the default export of an item's slides.ts. Its function makes
|
|
4
6
|
* the presentation's slide masters, layouts, components and generators;
|
package/dist/slides.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/*! AllyHub. Copyright (c) 2026 AllyHub, Inc. All rights reserved. Use is subject to LICENSE.md. */
|
|
2
|
-
import{presentationFor as O}from"@allyhub-next/slides-core";export{
|
|
2
|
+
import{LENGTH_UNITS as _,presentationFor as O}from"@allyhub-next/slides-core";export const{Emu,Inches,Pt,Cm,Mm,Centipoints}=_;export{RGBColor,MSO_ANCHOR,CategoryChartData,MSO_ARROWHEAD,XL_CHART_TYPE,XL_LABEL_POSITION,XL_LEGEND_POSITION,MSO_AUTO_SIZE,MSO_CONNECTOR,MSO_FILL,MSO_LINE,MSO_SHAPE,MSO_SHAPE_TYPE,MSO_THEME_COLOR,PP_ALIGN,PP_PLACEHOLDER,THEME_FONT,SLIDE_SIZES,presentationFor,isDeck}from"@allyhub-next/slides-core";export const presentation=O("");
|
package/docs/README.md
CHANGED
|
@@ -15,4 +15,5 @@ What a piece is written with, for the version of the SDK installed beside them.
|
|
|
15
15
|
- [modeling.md](modeling.md): a prop modelled in code with `@allyhub-next/model` and put in a scenery.
|
|
16
16
|
- [docs.md](docs.md): a doc, `doc.mdx`: its title, the Markdown and tags it reads, pictures and links, `comments.json`, check and render.
|
|
17
17
|
- [sheets.md](sheets.md): a sheet, a workbook as `sheet.yaml` and CSV: tables, formulas, names, checks, the openpyxl API (`@allyhub/sdk/sheets`), calc, trace and render.
|
|
18
|
+
- [websites.md](websites.md): a website, any web project with `website.json`: how Studio serves it while it is made (`PORT`, `HOST`, the preview hosts), a project's videos in its pages, its build.
|
|
18
19
|
- [defaults.md](defaults.md): every default of the piece API, generated from the code's constants, with the option that changes it.
|
package/docs/contract.md
CHANGED
|
@@ -5,7 +5,7 @@ What the build, the check and the render rely on. Everything else is the piece's
|
|
|
5
5
|
## A frame depends only on its time
|
|
6
6
|
|
|
7
7
|
- A piece is drawn in a page, a moment at a time, in any order: the check draws moments out of order and compares them with the same moments drawn in order (AK-D002), and the render draws parts on several pages at once and keeps what it drew in the part cache.
|
|
8
|
-
- A layer's `mount` lays it out once; its `render(el, t, …)` sets every property that moves from `t` alone ([layers.md](layers.md)). Nothing may carry state from one `render` call to the next.
|
|
8
|
+
- A layer's `mount` lays it out once; its `render(el, t, …)` sets every property that moves from `t` alone ([layers.md](layers.md)). Nothing may carry state from one `render` call to the next. A deck mounts a slide's components when the slide is shown and may let the slide go and mount them again later, on a new element: what `mount` made that the page does not free with the element (a WebGL context, a worker, a timer) is let go in `unmount(el, …)`, and nothing is carried from one mount to the next.
|
|
9
9
|
- Piece code sees the moment's clock, not the wall's: `Date`, `Date.now()` and `performance.now()` read the moment being drawn (time 0 is 2026-01-01T00:00:00Z); `Math.random()` and `crypto.getRandomValues()` are seeded by the piece's id, the combo, the part and the frame; `requestAnimationFrame` callbacks run at the moment; `setTimeout` and `setInterval` never fire. Use `rand(seed)` and the noise functions for randomness of your own.
|
|
10
10
|
- CSS animations and transitions run on the browser's clock: never let them drive the picture.
|
|
11
11
|
- Work a layer must finish before anything is drawn (a 3D scenery's build, a picture decoding) goes through `ctx.wait(promise)`. Loading may take `loadLimit` seconds (AK-P002), one moment `seekLimit` seconds (AK-P003) ([defaults.md](defaults.md)).
|
package/docs/defaults.md
CHANGED
|
@@ -103,7 +103,7 @@ A deck's theme fonts where its code sets none (`prs.theme.fonts`): standard font
|
|
|
103
103
|
|
|
104
104
|
### `OFFICE_TEXT_STYLES`
|
|
105
105
|
|
|
106
|
-
A new master's text styles (`master.text_styles`: `title_style`, `body_style`, `other_style`, nine levels each), as PowerPoint's Office master has them: a title's 44 pt in the theme's major font at 0.9 lines, a body's bulleted levels at 28, 24, 20 and 18 pt with their indents, other text 18 pt. Lengths are EMU (`Pt(44)` is 558800). A master's, a layout's or a placeholder's `list_style` sets its own.
|
|
106
|
+
A new master's text styles (`master.text_styles`: `title_style`, `body_style`, `other_style`, nine levels each), as PowerPoint's Office master has them: a title's 44 pt in the theme's major font at 0.9 lines, a body's bulleted levels at 28, 24, 20 and 18 pt with their indents, other text 18 pt. Lengths are EMU (`Pt(44)` is 558800). A master's, a layout's or a placeholder's `list_style` sets its own. A subtitle placeholder (`PP_PLACEHOLDER.SUBTITLE`) starts with Office's Title Slide levels over the body style: no bullet, each level 0.5 in from the last, no hanging indent; its `list_style` changes them.
|
|
107
107
|
|
|
108
108
|
| Key | Value |
|
|
109
109
|
| --- | --- |
|
|
@@ -161,19 +161,42 @@ A shape `add_shape` makes, as python-pptx makes it (the theme's styles it is dra
|
|
|
161
161
|
|
|
162
162
|
### `CONNECTOR_STYLE`
|
|
163
163
|
|
|
164
|
-
A
|
|
164
|
+
A connector `add_connector` makes (a straight line, an elbow, a curve), as python-pptx makes it: the theme's second line, 1 pt, in accent 1, with no fill and no text. A connector in `slides.yaml` (`geometry: line`, `straightConnector1`, `bentConnector2` to `5`, `curvedConnector2` to `5`) has it too. Its `line` changes it.
|
|
165
165
|
|
|
166
166
|
| Key | Value |
|
|
167
167
|
| --- | --- |
|
|
168
168
|
| `line` | `"accent1"` |
|
|
169
169
|
| `line_width` | `12700` |
|
|
170
170
|
|
|
171
|
+
### `SHADOW_DEFAULTS`
|
|
172
|
+
|
|
173
|
+
A shape's shadow where a `shadow` in `slides.yaml` or `shape.shadow` says nothing: `color`, `blur` and `distance` (EMU), `angle` (degrees clockwise from the right), `transparency` (a share).
|
|
174
|
+
|
|
175
|
+
| Key | Value |
|
|
176
|
+
| --- | --- |
|
|
177
|
+
| `color.rgb` | `"#000000"` |
|
|
178
|
+
| `blur` | `50800` |
|
|
179
|
+
| `distance` | `38100` |
|
|
180
|
+
| `angle` | `45` |
|
|
181
|
+
| `transparency` | `0.6` |
|
|
182
|
+
|
|
171
183
|
### `SLIDE_SECONDS`
|
|
172
184
|
|
|
173
185
|
A slide's window on the stage's clock, seconds: a still of it is drawn at its end, when what moves in its components has settled.
|
|
174
186
|
|
|
175
187
|
Value: `4`
|
|
176
188
|
|
|
189
|
+
## Importing
|
|
190
|
+
|
|
191
|
+
### `ZIP_LIMITS`
|
|
192
|
+
|
|
193
|
+
What a `.pptx` or `.xlsx` given to `allyhub slides import` or `allyhub sheet import` may unzip to, by what the file claims, before anything is inflated: its parts, and its bytes, which `--max-unzipped` sets in MB.
|
|
194
|
+
|
|
195
|
+
| Key | Value |
|
|
196
|
+
| --- | --- |
|
|
197
|
+
| `parts` | `10000` |
|
|
198
|
+
| `bytes` | `1610612736` |
|
|
199
|
+
|
|
177
200
|
## Parts and transitions
|
|
178
201
|
|
|
179
202
|
### `PART_DEFAULTS`
|
package/docs/layers.md
CHANGED
|
@@ -156,7 +156,7 @@ A prop declared `time()` (also inside `list()` and `object()`) is typed `Time` i
|
|
|
156
156
|
|
|
157
157
|
### What the contract relies on
|
|
158
158
|
|
|
159
|
-
- **The look by its variables**: colours and fonts as `var(--ak-color-*)` and `var(--ak-font-*)` ([video.md](video.md#the-look)) follow the project's look; a literal colour does not. A `color()` prop holds a look variable.
|
|
159
|
+
- **The look by its variables**: colours and fonts as `var(--ak-color-*)` and `var(--ak-font-*)` ([video.md](video.md#the-look)) follow the project's look; a literal colour does not. A `color()` prop holds a look variable. A deck's component follows the deck's theme with `var(--ak-theme-*)` ([slides.md](slides.md#components)).
|
|
160
160
|
- **Text as text**: the helpers set text as text nodes (`textContent`), so a string never becomes markup.
|
|
161
161
|
- **Every format**: lay out from `ctx.dims`, `ctx.content` or `layout(ctx)`, not by the format's name: a custom `WxH` has no preset's name, and a changed `safe` keeps the format's.
|
|
162
162
|
|
package/docs/project.md
CHANGED
|
@@ -70,7 +70,7 @@ An item is a folder with its entry file. The entry file's name says what the ite
|
|
|
70
70
|
| `model.ts` | A 3D model | `export default defineModel(build)` ([modeling.md](modeling.md)) |
|
|
71
71
|
| `doc.mdx` | A doc | The doc itself, MDX |
|
|
72
72
|
| `sheet.yaml` | A sheet | The workbook: its sheets, cells, formulas, formats, names and checks; `data/*.csv` beside it holds its tables' rows |
|
|
73
|
-
| `
|
|
73
|
+
| `website.json` | A website | How the web project in its folder is served, built and where the built site is ([websites.md](websites.md)) |
|
|
74
74
|
|
|
75
75
|
`video`, `slides`, `scenery` and `model` may end in `.ts`, `.tsx`, `.mts`, `.js`, `.jsx` or `.mjs`.
|
|
76
76
|
|
|
@@ -196,6 +196,8 @@ A key is segments of letters, digits, `_` and `-` joined by dots. A value is a s
|
|
|
196
196
|
|
|
197
197
|
A file is used by importing it, by a string path relative to the module that names it, or by `ctx.asset(path)` and `ctx.data(path)` for a path made at run time (relative to the piece's file).
|
|
198
198
|
|
|
199
|
+
A share of one item serves only what the item reaches: the files in its folder, what its code imports, what its slides show, and what a path named at run time read when the check last loaded it. A file outside its folder named only at run time is in its share once the check has run since.
|
|
200
|
+
|
|
199
201
|
```ts file=launch/plans/video.ts
|
|
200
202
|
import { custom, part, video } from "@allyhub/sdk";
|
|
201
203
|
|
package/docs/sheets.md
CHANGED
|
@@ -55,8 +55,8 @@ Its JSON Schema is `https://allyhub.com/schemas/sheet.schema.json`.
|
|
|
55
55
|
| Field | What |
|
|
56
56
|
| -------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
57
57
|
| `title` | The workbook's title |
|
|
58
|
-
| `names` | Defined names: a constant, or a place or formula after
|
|
59
|
-
| `sheets[]` | `name`, at most 31 characters, none of `\ / ? * [ ] :`; `hidden`; `freeze`, the first cell that scrolls; `gridlines: false`; `tab`, its tab's colour
|
|
58
|
+
| `names` | Defined names: a constant, or a place or formula after `=`; `hidden_names` lists those Excel's Name Manager does not show |
|
|
59
|
+
| `sheets[]` | `name`, at most 31 characters, none of `\ / ? * [ ] :`; `hidden`; `freeze`, the first cell that scrolls; `gridlines: false`; `tab`, its tab's colour; `names`, its own, read on it before the workbook's and from elsewhere as `Sheet!name` |
|
|
60
60
|
| `sheets[].tables[]` | `name`, `at` (its header's top left), `rows` (a CSV file from the sheet's folder), `key`, `style` (Excel's, `TableStyleMedium2` unless it says, `none` for none), `columns` (by name: `formula`, `format`, a look, `width`, `files`) |
|
|
61
61
|
| `sheets[].columns` | By letter: `width` in pixels, `hidden`, `format`, a look, `files` (see [Files in a cell](#files-in-a-cell)) |
|
|
62
62
|
| `sheets[].charts[]` | A chart over the cells: see [Charts](#charts) |
|
|
@@ -102,6 +102,32 @@ validations:
|
|
|
102
102
|
|
|
103
103
|
They are text, so a formula counts one with a wildcard, `=COUNTIF(D:D,"*vip*")`, or splits them, `=TEXTSPLIT(D2,", ")`. A person ticks them in the cell's dropdown and sees them as chips; a filter's list offers each, and keeps a row that holds any it ticks. In an `.xlsx` the cell keeps its text and the column a list, whose refusal is turned off as Excel's list takes one value: the render says so.
|
|
104
104
|
|
|
105
|
+
### For the file
|
|
106
|
+
|
|
107
|
+
A worksheet holds what Excel prints and shows around its cells. Each goes in the `.xlsx`. A PDF prints by `print` as Excel does; the grid and a PDF do not draw links, notes, pictures and outlines yet.
|
|
108
|
+
|
|
109
|
+
```yaml
|
|
110
|
+
sheets:
|
|
111
|
+
- name: Quote
|
|
112
|
+
print:
|
|
113
|
+
area: A1:G22
|
|
114
|
+
title_rows: "1:2" # and title_cols: A:B, repeated on every page
|
|
115
|
+
orientation: landscape
|
|
116
|
+
paper: a4 # letter, tabloid, ledger, legal, executive, a3, a4, a5, b4, b5
|
|
117
|
+
fit: { width: 1, height: 0 } # one page wide, as tall as it takes; or scale: 75 (percent)
|
|
118
|
+
breaks: { rows: [21] } # a page starts at row 21; cols: [E] too
|
|
119
|
+
margins: { left: 0.5, right: 0.5 } # inches
|
|
120
|
+
footer: { right: "Page &P of &N" } # Excel's codes; left, center, right
|
|
121
|
+
links: { B2: "https://example.com", B3: "#Terms!A1" }
|
|
122
|
+
notes: { C4: Agreed with Sam, C5: { text: Check, author: Finance } }
|
|
123
|
+
pictures:
|
|
124
|
+
- { file: files/logo.png, at: B1, x: 4, y: 4, height: 40 } # over the cells; pixels
|
|
125
|
+
rows: { 12: { level: 1 } } # grouped, 1 to 7; columns too
|
|
126
|
+
protect: true # Protect Sheet, with no password
|
|
127
|
+
```
|
|
128
|
+
|
|
129
|
+
In a script: `ws.page_setup.orientation`, `.paperSize`, `.fitToWidth`, `.fitToHeight`, `ws.page_margins.left`, `ws.print_area`, `ws.print_title_rows`, `ws.print_title_cols`, `ws.oddFooter.right.text`, `cell.hyperlink`, `cell.comment = new Comment("Check", "Finance")`, `ws.add_image(new Image("files/logo.png"), "B1")`, `ws.row_dimensions[12].outlineLevel`, `ws.protection.sheet`.
|
|
130
|
+
|
|
105
131
|
### Files in a cell
|
|
106
132
|
|
|
107
133
|
A column with `files` holds files, each named by its path from the sheet's folder:
|
|
@@ -370,7 +396,7 @@ A name of openpyxl's that is not held throws where it is used, naming what the c
|
|
|
370
396
|
**In.** `allyhub sheet import <file.xlsx>` reads a file whatever wrote it and writes what it means as short text: neighbours with one formula as one range key, a table as a table, a column of one formula as a calculated column, a large rectangle of typed cells as a CSV file, looks as rectangles. It prints:
|
|
371
397
|
|
|
372
398
|
- Excel's scenarios come in by the names of the cells they set; a cell with no name is said, and a `Base case` that holds what the cells hold is left out.
|
|
373
|
-
- `Not carried over:` VBA, pivot tables, a chart of a kind a sheet has none of (radar, stock, surface, bubble, 3-D, several kinds in one) or whose numbers are written in it,
|
|
399
|
+
- `Not carried over:` VBA, pivot tables, a chart of a kind a sheet has none of (radar, stock, surface, bubble, 3-D, several kinds in one) or whose numbers are written in it, shapes, links to other workbooks, a protection's password, page breaks, rich text (kept as text), filters by condition, kinds of rule the format has no place for, and so on, with where. Notes, links, pictures (in `files/`), outlines, Page Layout, protection, a sheet's own names and hidden names come in.
|
|
374
400
|
- A formula that cannot be computed here (a function the engine does not have, another workbook) keeps its value, listed with its cell and why. An array formula over several cells is its first cell's, and the others spill from it.
|
|
375
401
|
- `Computed here against the file:` every formula's result compared with the value the file holds, each difference with its cell (`--tolerance` is how close numbers must be, `--all` lists every one; a formula that reads the clock or a random number is not compared). JSON has every difference.
|
|
376
402
|
|