@allyhub/sdk 0.16.0 → 0.17.1

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.
Files changed (73) hide show
  1. package/CHANGELOG.md +13 -0
  2. package/dist/node_modules/@allyhub/audio/dist/index.d.ts +1 -0
  3. package/dist/node_modules/@allyhub/audio/dist/index.js +1 -1
  4. package/dist/node_modules/@allyhub/audio/dist/place.d.ts +26 -0
  5. package/dist/node_modules/@allyhub/audio/dist/place.js +2 -0
  6. package/dist/node_modules/@allyhub/audio/package.json +1 -1
  7. package/dist/node_modules/@allyhub/chart/package.json +1 -1
  8. package/dist/node_modules/@allyhub/diagnostics/package.json +1 -1
  9. package/dist/node_modules/@allyhub/formats/dist/data/slides.d.ts +15 -3
  10. package/dist/node_modules/@allyhub/formats/dist/data/slides.js +1 -1
  11. package/dist/node_modules/@allyhub/formats/dist/items.d.ts +40 -7
  12. package/dist/node_modules/@allyhub/formats/dist/items.js +1 -1
  13. package/dist/node_modules/@allyhub/formats/dist/schemas.d.ts +4 -0
  14. package/dist/node_modules/@allyhub/formats/package.json +1 -1
  15. package/dist/node_modules/@allyhub/image-draw/dist/stage.js +1 -1
  16. package/dist/node_modules/@allyhub/image-draw/package.json +1 -1
  17. package/dist/node_modules/@allyhub/image-measure/package.json +1 -1
  18. package/dist/node_modules/@allyhub/image-sdk/package.json +1 -1
  19. package/dist/node_modules/@allyhub/measure/package.json +1 -1
  20. package/dist/node_modules/@allyhub/ooxml/package.json +1 -1
  21. package/dist/node_modules/@allyhub/piece/dist/layer.d.ts +15 -0
  22. package/dist/node_modules/@allyhub/piece/dist/page/index.d.ts +1 -0
  23. package/dist/node_modules/@allyhub/piece/dist/page/index.js +1 -1
  24. package/dist/node_modules/@allyhub/piece/dist/page/runtimes.d.ts +9 -0
  25. package/dist/node_modules/@allyhub/piece/dist/page/runtimes.js +2 -0
  26. package/dist/node_modules/@allyhub/piece/dist/source.d.ts +51 -10
  27. package/dist/node_modules/@allyhub/piece/dist/source.js +1 -1
  28. package/dist/node_modules/@allyhub/piece/package.json +1 -1
  29. package/dist/node_modules/@allyhub/protocol/dist/account.d.ts +0 -6
  30. package/dist/node_modules/@allyhub/protocol/dist/account.js +1 -1
  31. package/dist/node_modules/@allyhub/protocol/dist/events.d.ts +39 -0
  32. package/dist/node_modules/@allyhub/protocol/dist/events.js +1 -1
  33. package/dist/node_modules/@allyhub/protocol/dist/frame.d.ts +3 -0
  34. package/dist/node_modules/@allyhub/protocol/dist/frame.js +1 -1
  35. package/dist/node_modules/@allyhub/protocol/dist/kinds.d.ts +30 -0
  36. package/dist/node_modules/@allyhub/protocol/dist/kinds.js +1 -1
  37. package/dist/node_modules/@allyhub/protocol/dist/tools.d.ts +6 -0
  38. package/dist/node_modules/@allyhub/protocol/dist/tools.js +1 -1
  39. package/dist/node_modules/@allyhub/protocol/package.json +1 -1
  40. package/dist/node_modules/@allyhub/runtimes/package.json +1 -1
  41. package/dist/node_modules/@allyhub/scenery/package.json +1 -1
  42. package/dist/node_modules/@allyhub/sheet/dist/calc/coerce.js +1 -1
  43. package/dist/node_modules/@allyhub/sheet/dist/calc/engine.d.ts +12 -0
  44. package/dist/node_modules/@allyhub/sheet/dist/calc/engine.js +1 -1
  45. package/dist/node_modules/@allyhub/sheet/dist/calc/functions/criteria.js +1 -1
  46. package/dist/node_modules/@allyhub/sheet/dist/calc/functions/date.js +1 -1
  47. package/dist/node_modules/@allyhub/sheet/dist/calc/functions/dynamic.js +1 -1
  48. package/dist/node_modules/@allyhub/sheet/dist/calc/functions/info.js +1 -1
  49. package/dist/node_modules/@allyhub/sheet/dist/calc/functions/logical.js +1 -1
  50. package/dist/node_modules/@allyhub/sheet/dist/calc/functions/lookup.js +1 -1
  51. package/dist/node_modules/@allyhub/sheet/dist/calc/functions/text.js +1 -1
  52. package/dist/node_modules/@allyhub/sheet/dist/formula/parse.js +1 -1
  53. package/dist/node_modules/@allyhub/sheet/dist/xlsx/charts.d.ts +1 -1
  54. package/dist/node_modules/@allyhub/sheet/dist/xlsx/charts.js +1 -1
  55. package/dist/node_modules/@allyhub/sheet/dist/xlsx/import.js +1 -1
  56. package/dist/node_modules/@allyhub/sheet/dist/xlsx/read.js +2 -2
  57. package/dist/node_modules/@allyhub/sheet/dist/xlsx/write.js +1 -1
  58. package/dist/node_modules/@allyhub/sheet/package.json +1 -1
  59. package/dist/node_modules/@allyhub/slides-core/dist/animation.d.ts +10 -0
  60. package/dist/node_modules/@allyhub/slides-core/dist/animation.js +1 -1
  61. package/dist/node_modules/@allyhub/slides-core/dist/api.js +1 -1
  62. package/dist/node_modules/@allyhub/slides-core/dist/components.js +1 -1
  63. package/dist/node_modules/@allyhub/slides-core/dist/model.d.ts +3 -1
  64. package/dist/node_modules/@allyhub/slides-core/dist/resolve.d.ts +5 -0
  65. package/dist/node_modules/@allyhub/slides-core/dist/resolve.js +1 -1
  66. package/dist/node_modules/@allyhub/slides-core/package.json +1 -1
  67. package/dist/node_modules/@allyhub/video-core/package.json +1 -1
  68. package/dist/node_modules/@allyhub/video-sdk/dist/free.d.ts +1 -1
  69. package/dist/node_modules/@allyhub/video-sdk/package.json +1 -1
  70. package/docs/docs.md +11 -0
  71. package/docs/layers.md +2 -0
  72. package/docs/slides.md +1 -1
  73. package/package.json +1 -1
package/CHANGELOG.md CHANGED
@@ -2,6 +2,19 @@
2
2
 
3
3
  Feature highlights from each AllyHub release.
4
4
 
5
+ ## 0.17.1
6
+
7
+ - **Projects made by an older AllyHub open in a newer one** at once, with nothing to download for the version they were made with.
8
+ - **A new account starts in AllyHub in the Cloud**, where the agent welcomes you in your language with examples to start from.
9
+
10
+ ## 0.17.0
11
+
12
+ - **Turn into.** Beside Download, make another kind of what is on show, such as a deck into a video, and say how in your own words before you send it.
13
+ - **One piece can use another.** A sheet's table in a deck or a doc, a video on a slide, a deck in a video: change the source and every piece that uses it follows.
14
+ - **Your own Claude Code and Codex, whatever their version.** Studio uses the newest one on your Mac.
15
+ - **Conversation titles are your words**, never what Studio adds for the agent.
16
+ - **Projects are deleted in the sidebar alone.** Cloud storage in Settings shows what takes room and clears what is no longer in use.
17
+
5
18
  ## 0.16.0
6
19
 
7
20
  - **One Studio on your Mac and in the cloud.** The app opens the same Studio as AllyHub in the cloud, with your projects and conversations as they were.
@@ -1,4 +1,5 @@
1
1
  export { SAMPLE_RATE, type FootageClip, type GainPoint, type MixPlan, type MusicPlay, type MusicSegment, type PartSpan, type Segment, type SfxPlay, type SpeechClip, type Stereo, type VoicePlan, } from "./plan.js";
2
+ export { mergePlans, placePlan, type PlacedSound } from "./place.js";
2
3
  export { addEnvelopes, duckEnvelope, equalPower, gainAt, speechEnvelope, speechSpans, type Span, } from "./envelope.js";
3
4
  export { clipSource, decodeKey, decodings, speechHow, type DecodeAs, type SoundOf, } from "./decode.js";
4
5
  export { renderMix, playSfx, type RenderOptions } from "./render.js";
@@ -1,2 +1,2 @@
1
1
  /*! AllyHub. Copyright (c) 2026 AllyHub, Inc. All rights reserved. Use is subject to LICENSE.md. */
2
- export{SAMPLE_RATE}from"./plan.js";export{addEnvelopes,duckEnvelope,equalPower,gainAt,speechEnvelope,speechSpans}from"./envelope.js";export{clipSource,decodeKey,decodings,speechHow}from"./decode.js";export{renderMix,playSfx}from"./render.js";export{playMusic}from"./music.js";export{hashSeed,SFX_HIT,synthSfx}from"./sfx.js";export{addSpeech,playVoice,sumSpeech,voiceGroups}from"./voice.js";export{limitPeaks,masterMix,previewMaster}from"./master.js";export{drySpeech,recordedSpeech}from"./recorded.js";export{db,levelCurve,silenceBands,soundAtCut,waveColumns}from"./at-cut.js";export{MASTER_DEFAULTS,MASTER_MECHANICS,MIX_DEFAULTS,resolveMaster,resolveMix}from"./levels.js";export{BAND_TYPES,bandAt,COMPRESS_DEFAULTS,shapeProblem,shapes,shapeSound,soundFilterProblem,soundLevel}from"./shape.js";export*from"./recording/index.js";export{biquad,biquadGain,BUTTERWORTH_Q,chainGain,fromDb,runBiquads,toDb}from"./recording/filters.js";export{convolve,fft,magnitudes,minimumPhase,nextPow2}from"./recording/fft.js";export{agc,compress,deess,gainComputer}from"./recording/dynamics.js";
2
+ export{SAMPLE_RATE}from"./plan.js";export{mergePlans,placePlan}from"./place.js";export{addEnvelopes,duckEnvelope,equalPower,gainAt,speechEnvelope,speechSpans}from"./envelope.js";export{clipSource,decodeKey,decodings,speechHow}from"./decode.js";export{renderMix,playSfx}from"./render.js";export{playMusic}from"./music.js";export{hashSeed,SFX_HIT,synthSfx}from"./sfx.js";export{addSpeech,playVoice,sumSpeech,voiceGroups}from"./voice.js";export{limitPeaks,masterMix,previewMaster}from"./master.js";export{drySpeech,recordedSpeech}from"./recorded.js";export{db,levelCurve,silenceBands,soundAtCut,waveColumns}from"./at-cut.js";export{MASTER_DEFAULTS,MASTER_MECHANICS,MIX_DEFAULTS,resolveMaster,resolveMix}from"./levels.js";export{BAND_TYPES,bandAt,COMPRESS_DEFAULTS,shapeProblem,shapes,shapeSound,soundFilterProblem,soundLevel}from"./shape.js";export*from"./recording/index.js";export{biquad,biquadGain,BUTTERWORTH_Q,chainGain,fromDb,runBiquads,toDb}from"./recording/filters.js";export{convolve,fft,magnitudes,minimumPhase,nextPow2}from"./recording/fft.js";export{agc,compress,deess,gainComputer}from"./recording/dynamics.js";
@@ -0,0 +1,26 @@
1
+ import type { MixPlan } from "./plan.js";
2
+ /** Where a film's sound plays inside another's. */
3
+ export interface PlacedSound {
4
+ /** The outer film's second it starts at. */
5
+ at: number;
6
+ /** Its own seconds it plays from and to (its trim); default all of it. */
7
+ begin?: number;
8
+ end?: number;
9
+ /** Played again from `begin` each time it reaches `end`, till `until`. */
10
+ loop?: boolean;
11
+ /** The outer film's second it stops at, wherever it is (the slide goes). */
12
+ until?: number;
13
+ }
14
+ /**
15
+ * A film's plan where it plays inside another: its stretch from `begin` to
16
+ * `end`, from the outer second `at`, again where it loops, never past
17
+ * `until`.
18
+ */
19
+ export declare function placePlan(plan: MixPlan, where: PlacedSound): MixPlan;
20
+ /**
21
+ * A film's plan with others' laid beside it: their speech, footage and
22
+ * sounds with its own; their music and voice where it has none (the
23
+ * first's), and its length the longest.
24
+ */
25
+ export declare function mergePlans(base: MixPlan, others: readonly MixPlan[]): MixPlan;
26
+ //# sourceMappingURL=place.d.ts.map
@@ -0,0 +1,2 @@
1
+ /*! AllyHub. Copyright (c) 2026 AllyHub, Inc. All rights reserved. Use is subject to LICENSE.md. */
2
+ function r(e,c,t,o){const i=Math.max(e.at,c),a=Math.min(e.at+e.dur,t);if(!(a<=i))return{...e,at:i+o,from:e.from+(i-e.at)*(e.speed??1),dur:a-i}}function f(e,c,t,o){const i=e.filter(a=>a.t<=c).at(-1);return[...i?[{t:c+o,db:i.db}]:[],...e.filter(a=>a.t>c&&a.t<t).map(a=>({t:a.t+o,db:a.db}))]}function m(e,c,t,o){const i=e.music&&{...e.music,segments:e.music.segments.flatMap(s=>{const n=r(s,c,t,o);return n?[n]:[]}),duck:f(e.music.duck,c,t,o),until:Math.min(e.music.until??e.duration,t)+o},a=(e.voice?.spans??[]).flatMap(s=>{const n=Math.max(s.start,c),u=Math.min(s.end,t);return u>n?[{...s,start:n+o,end:u+o}]:[]});return{duration:t+o,speech:e.speech.flatMap(s=>{const n=r(s,c,t,o);return n?[n]:[]}),footage:e.footage.flatMap(s=>{const n=r(s,c,t,o);return n?[{...n,...s.envelope?{envelope:f(s.envelope,c,t,o)}:{}}]:[]}),sfx:e.sfx.flatMap(s=>{if(s.at<c||s.at>=t)return[];const n=t-s.at;return[{...s,at:s.at+o,...s.file===void 0?{}:{length:Math.min(s.length??n,n)}}]}),...i&&i.segments.length>0?{music:i}:{},...e.speechGain?{speechGain:f(e.speechGain,c,t,o)}:{},...e.voice?{voice:{...e.voice,spans:a}}:{}}}export function placePlan(e,c){const t=Math.max(0,c.begin??0),o=Math.min(e.duration,c.end??e.duration),i=o-t,a=c.until??1/0,s=[];for(let n=c.at;i>0&&n<a&&(s.length===0||c.loop===!0);n+=i){const u=Math.min(o,t+(a-n));if(s.push(m(e,t,u,n-t)),s.length>=1e3)break}return mergePlans({duration:0,speech:[],footage:[],sfx:[]},s)}export function mergePlans(e,c){let t={...e};for(const o of c){const i=t.music??o.music,a=t.voice?o.voice?.seed===t.voice.seed?{...t.voice,spans:[...t.voice.spans,...o.voice.spans]}:t.voice:o.voice,s=t.speechGain&&o.speechGain?[...t.speechGain,...o.speechGain].sort((n,u)=>n.t-u.t):t.speechGain??o.speechGain;t={duration:Math.max(t.duration,o.duration),speech:[...t.speech,...o.speech],footage:[...t.footage,...o.footage],sfx:[...t.sfx,...o.sfx],...i?{music:i}:{},...s?{speechGain:s}:{},...a?{voice:a}:{}}}return t}
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@allyhub/audio",
3
- "version": "0.16.0",
3
+ "version": "0.17.1",
4
4
  "type": "module",
5
5
  "exports": {
6
6
  ".": {
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@allyhub/chart",
3
- "version": "0.16.0",
3
+ "version": "0.17.1",
4
4
  "type": "module",
5
5
  "exports": {
6
6
  ".": {
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@allyhub/diagnostics",
3
- "version": "0.16.0",
3
+ "version": "0.17.1",
4
4
  "type": "module",
5
5
  "exports": {
6
6
  ".": {
@@ -982,8 +982,8 @@ export type PlaybackFile = z.infer<typeof PlaybackSchema>;
982
982
  /**
983
983
  * A shape on a slide, by its name. Without a kind it changes a shape the
984
984
  * slide has already (a layout's placeholder, a generator's shape); with
985
- * one (`textbox`, `picture`, `movie`, `geometry`, `component`) it is a
986
- * shape of the slide's own.
985
+ * one (`textbox`, `picture`, `movie`, `geometry`, `component`, `item`) it
986
+ * is a shape of the slide's own.
987
987
  */
988
988
  export declare const ShapeSchema: z.ZodObject<{
989
989
  frame: z.ZodOptional<z.ZodObject<{
@@ -1495,6 +1495,7 @@ export declare const ShapeSchema: z.ZodObject<{
1495
1495
  }, z.core.$strict>>;
1496
1496
  movie: z.ZodOptional<z.ZodString>;
1497
1497
  audio: z.ZodOptional<z.ZodString>;
1498
+ item: z.ZodOptional<z.ZodString>;
1498
1499
  poster: z.ZodOptional<z.ZodNumber>;
1499
1500
  playback: z.ZodOptional<z.ZodObject<{
1500
1501
  start: z.ZodOptional<z.ZodEnum<{
@@ -1895,6 +1896,9 @@ export declare const ShapeSchema: z.ZodObject<{
1895
1896
  rows: z.ZodOptional<z.ZodInt>;
1896
1897
  columns: z.ZodOptional<z.ZodInt>;
1897
1898
  }, z.core.$strip>>>;
1899
+ data: z.ZodOptional<z.ZodString>;
1900
+ fields: z.ZodOptional<z.ZodArray<z.ZodString>>;
1901
+ head: z.ZodOptional<z.ZodBoolean>;
1898
1902
  style: z.ZodOptional<z.ZodString>;
1899
1903
  first_row: z.ZodOptional<z.ZodBoolean>;
1900
1904
  last_row: z.ZodOptional<z.ZodBoolean>;
@@ -2205,7 +2209,7 @@ export declare function showJumpOf(link: string): ShowJump | undefined;
2205
2209
  /** A link's slide (`#<id>`), if it is one. */
2206
2210
  export declare const slideLinkOf: (link: string) => string | undefined;
2207
2211
  /** The kinds a shape of the slide's own is, by the field that makes it. */
2208
- export declare const SHAPE_KINDS: readonly ["textbox", "picture", "movie", "audio", "geometry", "path", "table", "chart", "component"];
2212
+ export declare const SHAPE_KINDS: readonly ["textbox", "picture", "movie", "audio", "geometry", "path", "table", "chart", "component", "item"];
2209
2213
  /** How a slide comes on from the one before, by PowerPoint's transitions. */
2210
2214
  export declare const SLIDE_TRANSITIONS: readonly ["fade", "push", "wipe", "split", "reveal", "cut", "cover", "uncover", "zoom", "morph"];
2211
2215
  export type SlideTransitionType = (typeof SLIDE_TRANSITIONS)[number];
@@ -2836,6 +2840,7 @@ export declare const SlideSchema: z.ZodObject<{
2836
2840
  }, z.core.$strict>>;
2837
2841
  movie: z.ZodOptional<z.ZodString>;
2838
2842
  audio: z.ZodOptional<z.ZodString>;
2843
+ item: z.ZodOptional<z.ZodString>;
2839
2844
  poster: z.ZodOptional<z.ZodNumber>;
2840
2845
  playback: z.ZodOptional<z.ZodObject<{
2841
2846
  start: z.ZodOptional<z.ZodEnum<{
@@ -3236,6 +3241,9 @@ export declare const SlideSchema: z.ZodObject<{
3236
3241
  rows: z.ZodOptional<z.ZodInt>;
3237
3242
  columns: z.ZodOptional<z.ZodInt>;
3238
3243
  }, z.core.$strip>>>;
3244
+ data: z.ZodOptional<z.ZodString>;
3245
+ fields: z.ZodOptional<z.ZodArray<z.ZodString>>;
3246
+ head: z.ZodOptional<z.ZodBoolean>;
3239
3247
  style: z.ZodOptional<z.ZodString>;
3240
3248
  first_row: z.ZodOptional<z.ZodBoolean>;
3241
3249
  last_row: z.ZodOptional<z.ZodBoolean>;
@@ -4216,6 +4224,7 @@ export declare const SlidesFileSchema: z.ZodObject<{
4216
4224
  }, z.core.$strict>>;
4217
4225
  movie: z.ZodOptional<z.ZodString>;
4218
4226
  audio: z.ZodOptional<z.ZodString>;
4227
+ item: z.ZodOptional<z.ZodString>;
4219
4228
  poster: z.ZodOptional<z.ZodNumber>;
4220
4229
  playback: z.ZodOptional<z.ZodObject<{
4221
4230
  start: z.ZodOptional<z.ZodEnum<{
@@ -4616,6 +4625,9 @@ export declare const SlidesFileSchema: z.ZodObject<{
4616
4625
  rows: z.ZodOptional<z.ZodInt>;
4617
4626
  columns: z.ZodOptional<z.ZodInt>;
4618
4627
  }, z.core.$strip>>>;
4628
+ data: z.ZodOptional<z.ZodString>;
4629
+ fields: z.ZodOptional<z.ZodArray<z.ZodString>>;
4630
+ head: z.ZodOptional<z.ZodBoolean>;
4619
4631
  style: z.ZodOptional<z.ZodString>;
4620
4632
  first_row: z.ZodOptional<z.ZodBoolean>;
4621
4633
  last_row: z.ZodOptional<z.ZodBoolean>;
@@ -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 o}from"zod";import{SCRIPT_NAME as _}from"./script.js";const h=o.string().regex(_,"A name is letters, digits, _ and -.");export const THEME_COLORS=["dk1","lt1","dk2","lt2","accent1","accent2","accent3","accent4","accent5","accent6","hlink","folHlink"],TEXT_ALIGNS=["l","ctr","r","just"],SHAPE_GEOMETRIES=["line","lineInv","triangle","rtTriangle","rect","diamond","parallelogram","trapezoid","nonIsoscelesTrapezoid","pentagon","hexagon","heptagon","octagon","decagon","dodecagon","star4","star5","star6","star7","star8","star10","star12","star16","star24","star32","roundRect","round1Rect","round2SameRect","round2DiagRect","snipRoundRect","snip1Rect","snip2SameRect","snip2DiagRect","plaque","ellipse","teardrop","homePlate","chevron","pieWedge","pie","blockArc","donut","noSmoking","rightArrow","leftArrow","upArrow","downArrow","stripedRightArrow","notchedRightArrow","bentUpArrow","leftRightArrow","upDownArrow","leftUpArrow","leftRightUpArrow","quadArrow","leftArrowCallout","rightArrowCallout","upArrowCallout","downArrowCallout","leftRightArrowCallout","upDownArrowCallout","quadArrowCallout","bentArrow","uturnArrow","circularArrow","leftCircularArrow","leftRightCircularArrow","curvedRightArrow","curvedLeftArrow","curvedUpArrow","curvedDownArrow","swooshArrow","cube","can","lightningBolt","heart","sun","moon","smileyFace","irregularSeal1","irregularSeal2","foldedCorner","bevel","frame","halfFrame","corner","diagStripe","chord","arc","leftBracket","rightBracket","leftBrace","rightBrace","bracketPair","bracePair","straightConnector1","bentConnector2","bentConnector3","bentConnector4","bentConnector5","curvedConnector2","curvedConnector3","curvedConnector4","curvedConnector5","callout1","callout2","callout3","accentCallout1","accentCallout2","accentCallout3","borderCallout1","borderCallout2","borderCallout3","accentBorderCallout1","accentBorderCallout2","accentBorderCallout3","wedgeRectCallout","wedgeRoundRectCallout","wedgeEllipseCallout","cloudCallout","cloud","ribbon","ribbon2","ellipseRibbon","ellipseRibbon2","leftRightRibbon","verticalScroll","horizontalScroll","wave","doubleWave","plus","flowChartProcess","flowChartDecision","flowChartInputOutput","flowChartPredefinedProcess","flowChartInternalStorage","flowChartDocument","flowChartMultidocument","flowChartTerminator","flowChartPreparation","flowChartManualInput","flowChartManualOperation","flowChartConnector","flowChartPunchedCard","flowChartPunchedTape","flowChartSummingJunction","flowChartOr","flowChartCollate","flowChartSort","flowChartExtract","flowChartMerge","flowChartOfflineStorage","flowChartOnlineStorage","flowChartMagneticTape","flowChartMagneticDisk","flowChartMagneticDrum","flowChartDisplay","flowChartDelay","flowChartAlternateProcess","flowChartOffpageConnector","actionButtonBlank","actionButtonHome","actionButtonHelp","actionButtonInformation","actionButtonForwardNext","actionButtonBackPrevious","actionButtonEnd","actionButtonBeginning","actionButtonReturn","actionButtonDocument","actionButtonSound","actionButtonMovie","gear6","gear9","funnel","mathPlus","mathMinus","mathMultiply","mathDivide","mathEqual","mathNotEqual","cornerTabs","squareTabs","plaqueTabs","chartX","chartStar","chartPlus"],ANIMATION_EFFECTS=["appear","fade","fly-in","float-in","split","wipe","zoom","disappear","fade-out","fly-out","float-out","split-out","wipe-out","zoom-out","pulse","grow-shrink","spin","transparency","path"],ANIMATE_TEXT=["word","letter"],ANIMATION_REPEATS=["until-next-click","until-end-of-slide"],ANIMATION_STARTS=["on-click","with-previous","after-previous"],ANIMATION_DIRECTIONS=["from-bottom","from-top","from-left","from-right","from-top-right","from-bottom-right","from-top-left","from-bottom-left","vertical-out","vertical-in","horizontal-out","horizontal-in","in","out","rotate","up","down","clockwise","counterclockwise","both","horizontal","vertical"],LINE_DASHES=["solid","sysDot","sysDash","dash","dashDot","lgDash","lgDashDot","lgDashDotDot","dot","sysDashDot","sysDashDotDot"],LINE_CAPS=["flat","rnd","sq"],LINE_JOINS=["round","bevel","miter"],LINE_COMPOUNDS=["sng","dbl","thickThin","thinThick","tri"],LINE_ENDS=["none","triangle","arrow","stealth","diamond","oval"],ARROW_SIZES=["sm","med","lg"],LineEndSizeSchema=o.strictObject({w:o.enum(ARROW_SIZES).optional(),len:o.enum(ARROW_SIZES).optional()}),FrameSchema=o.strictObject({x:o.number(),y:o.number(),w:o.number().nonnegative(),h:o.number().nonnegative()}),MAPPED_COLORS=["tx1","bg1","tx2","bg2"],COLOR_NAMES=[...THEME_COLORS,...MAPPED_COLORS],COLOR_TRANSFORMS=["tint","shade","lumMod","lumOff","lum","satMod","satOff","sat","hueMod","hueOff","hue","alpha","alphaMod","alphaOff"];const C=`(?:${COLOR_NAMES.join("|")})`,k=`(?:${COLOR_TRANSFORMS.join("|")}) -?\\d+(?:\\.\\d+)?(?:%|°)`,A=new RegExp(`^(${C}) (lighter|darker) (100(?:\\.0{1,3})?|[1-9]?\\d(?:\\.\\d{1,3})?)%$`,"u"),v=new RegExp(`^(${C}|#[0-9A-Fa-f]{6})((?: ${k})+)$`,"u"),O=/^#[0-9A-Fa-f]{6}$/u,g=t=>COLOR_NAMES.includes(t),E=t=>COLOR_TRANSFORMS.includes(t),y=new Set(["hue","hueOff"]);export function colorOfFile(t){if(g(t))return t;if(O.test(t))return{rgb:t.toUpperCase()};const e=v.exec(t);if(e){const[,l="",p=""]=e,m=[];for(const w of p.matchAll(/ (\w+) (-?[\d.]+)(%|°)/gu)){const[,u="",D="",x]=w;if(!E(u)||x==="°"!==y.has(u))return;const S=Number(D);m.push({name:u,value:x==="%"?Math.round(S*1e3)/1e5:S})}return g(l)?{theme_color:l,transforms:m}:{rgb:l.toUpperCase(),transforms:m}}const r=A.exec(t),[,n="",i,s=""]=r??[],a=Math.round(Number(s)*1e3);if(!(!r||!g(n)||a<=0||a>1e5))return{theme_color:n,brightness:(i==="lighter"?a:-a)/1e5}}const P=t=>y.has(t.name)?`${t.name} ${String(Math.round(t.value*1e3)/1e3)}°`:`${t.name} ${String(Math.round(t.value*1e5)/1e3)}%`;export function colorFile(t){if(typeof t=="string")return t;if("rgb"in t)return t.transforms&&t.transforms.length>0?`${t.rgb} ${t.transforms.map(P).join(" ")}`:t.rgb;if("transforms"in t)return t.transforms.length===0?t.theme_color:`${t.theme_color} ${t.transforms.map(P).join(" ")}`;const e=Math.round(Math.abs(t.brightness)*1e5)/1e3;return e===0?t.theme_color:`${t.theme_color} ${t.brightness>0?"lighter":"darker"} ${String(e)}%`}const d=`A colour is one of the theme's (${THEME_COLORS.join(", ")}) or the colour map's (${MAPPED_COLORS.join(", ")}), one of them lighter or darker by a share over 0 up to 100% ("accent1 lighter 40%", "dk1 darker 25%"), #RRGGBB, or one of them with DrawingML's transforms in order ("accent1 lumMod 75% lumOff 25%", "#4472C4 alpha 50%", "accent2 hueOff 30°": ${COLOR_TRANSFORMS.join(", ")}).`;export const ColorFileSchema=o.union([o.enum(COLOR_NAMES),o.string().regex(A,d),o.string().regex(O,d),o.string().regex(v,d)]).refine(t=>colorOfFile(t)!==void 0,d),NUMBERINGS=["alphaLcParenBoth","alphaUcParenBoth","alphaLcParenR","alphaUcParenR","alphaLcPeriod","alphaUcPeriod","arabicParenBoth","arabicParenR","arabicPeriod","arabicPlain","romanLcParenBoth","romanUcParenBoth","romanLcParenR","romanUcParenR","romanLcPeriod","romanUcPeriod","circleNumDbPlain","circleNumWdBlackPlain","circleNumWdWhitePlain","arabicDbPeriod","arabicDbPlain","ea1ChsPeriod","ea1ChsPlain","ea1ChtPeriod","ea1ChtPlain","ea1JpnChsDbPeriod","ea1JpnKorPlain","ea1JpnKorPeriod","arabic1Minus","arabic2Minus","hebrew2Minus","thaiAlphaPeriod","thaiAlphaParenR","thaiAlphaParenBoth","thaiNumPeriod","thaiNumParenR","thaiNumParenBoth","hindiAlphaPeriod","hindiNumPeriod","hindiNumParenR","hindiAlpha1Period"],UNDERLINES=["sng","dbl","heavy","dotted","dottedHeavy","dash","dashHeavy","dashLong","dashLongHeavy","dotDash","dotDashHeavy","dotDotDash","dotDotDashHeavy","wavy","wavyHeavy","wavyDbl","words"],STRIKES=["sngStrike","dblStrike"],CAPS=["all","small","none"],TEXT_ORIENTATIONS=["horz","vert","vert270","eaVert","wordArtVert","wordArtVertRtl","mongolianVert"],TEXT_ANCHORS=["t","ctr","b"],ParagraphSpaceSchema=o.union([o.number().min(0).max(1584),o.object({lines:o.number().min(0).max(100)})]),TextStyleSchema=o.strictObject({size:o.number().positive().max(4e3).optional(),bold:o.boolean().optional(),italic:o.boolean().optional(),underline:o.union([o.boolean(),o.enum(UNDERLINES)]).optional(),strike:o.union([o.boolean(),o.enum(STRIKES)]).optional(),caps:o.enum(CAPS).optional(),color:ColorFileSchema.optional(),font:o.string().min(1).optional(),align:o.enum(TEXT_ALIGNS).optional(),line_spacing:o.number().positive().max(10).optional(),space_before:ParagraphSpaceSchema.optional(),space_after:ParagraphSpaceSchema.optional(),anchor:o.enum(TEXT_ANCHORS).optional(),orientation:o.enum(TEXT_ORIENTATIONS).optional(),bullet:o.union([o.literal(!1),o.string().min(1).max(2)]).optional(),numbered:o.enum(NUMBERINGS).optional(),bullet_color:ColorFileSchema.optional(),bullet_size:o.number().min(.25).max(4).optional(),start_at:o.int().min(1).max(32767).optional()});const T=o.strictObject({left:o.number().lt(1).optional(),top:o.number().lt(1).optional(),right:o.number().lt(1).optional(),bottom:o.number().lt(1).optional()}).refine(t=>(t.left??0)+(t.right??0)<1,{message:"left and right together cut the whole picture away"}).refine(t=>(t.top??0)+(t.bottom??0)<1,{message:"top and bottom together cut the whole picture away"}),b=o.lazy(()=>o.union([o.string(),o.number(),o.boolean(),o.null(),o.array(b),o.record(o.string(),b)]));export const CHART_TYPES=["column-clustered","column-stacked","column-stacked-100","bar-clustered","bar-stacked","bar-stacked-100","line","line-markers","area","area-stacked","area-stacked-100","pie","doughnut"],SHEET_CHART_TYPES=[...CHART_TYPES,"scatter","scatter-lines","scatter-smooth"],CHART_LEGEND_POSITIONS=["bottom","top","left","right"],CHART_COMBINED_TYPES=["column-clustered","column-stacked","column-stacked-100","line","line-markers","area","area-stacked","area-stacked-100"];const f=o.strictObject({min:o.number().optional(),max:o.number().optional(),major:o.number().positive().optional(),gridlines:o.boolean().optional(),visible:o.boolean().optional(),format:o.string().min(1).optional(),reverse:o.boolean().optional(),gridline_color:ColorFileSchema.optional(),line_color:ColorFileSchema.optional()});export const ChartSchema=o.strictObject({type:o.enum(SHEET_CHART_TYPES),data:o.string().min(1).optional(),categories:o.union([o.string().min(1),o.array(o.string())]).optional(),series:o.array(o.union([o.string().min(1),o.strictObject({name:o.string().min(1),values:o.array(o.number().nullable()).optional(),x:o.array(o.number().nullable()).optional(),color:ColorFileSchema.optional(),format:o.string().min(1).optional(),smooth:o.boolean().optional(),line_width:o.number().positive().optional(),marker_size:o.number().int().min(2).max(72).optional(),type:o.enum(CHART_COMBINED_TYPES).optional(),secondary:o.boolean().optional()})])).min(1),legend:o.enum(CHART_LEGEND_POSITIONS).optional(),labels:o.union([o.boolean(),o.strictObject({value:o.boolean().optional(),percentage:o.boolean().optional(),category:o.boolean().optional(),series:o.boolean().optional(),format:o.string().min(1).optional(),position:o.enum(["outEnd","inEnd","ctr","inBase","t","b","l","r","bestFit"]).optional(),size:o.number().positive().optional(),color:ColorFileSchema.optional()})]).optional(),gap_width:o.number().min(0).max(500).optional(),overlap:o.number().min(-100).max(100).optional(),vary_by_categories:o.boolean().optional(),category_colors:o.array(ColorFileSchema).min(1).optional(),hole_size:o.number().min(10).max(90).optional(),value_axis:f.optional(),category_axis:f.optional(),secondary_axis:f.optional(),size:o.number().positive().optional(),title_size:o.number().positive().optional(),color:ColorFileSchema.optional()});const c=o.number().min(0).max(1);export const GRADIENT_PATHS=["circle","rect","shape"],GradientSchema=o.strictObject({angle:o.number().min(0).max(360).optional(),path:o.enum(GRADIENT_PATHS).optional(),focus:o.strictObject({left:o.number().optional(),top:o.number().optional(),right:o.number().optional(),bottom:o.number().optional()}).optional(),stops:o.array(o.strictObject({at:c,color:ColorFileSchema,transparency:c.optional()})).min(2).max(10)}),PATTERNS=["pct5","pct10","pct20","pct25","pct30","pct40","pct50","pct60","pct70","pct75","pct80","pct90","horz","vert","ltHorz","ltVert","dkHorz","dkVert","narHorz","narVert","dashHorz","dashVert","cross","dnDiag","upDiag","ltDnDiag","ltUpDiag","dkDnDiag","dkUpDiag","wdDnDiag","wdUpDiag","dashDnDiag","dashUpDiag","diagCross","smCheck","lgCheck","smGrid","lgGrid","dotGrid","smConfetti","lgConfetti","horzBrick","diagBrick","solidDmnd","openDmnd","dotDmnd","plaid","sphere","weave","divot","shingle","wave","trellis","zigZag"],PatternSchema=o.strictObject({preset:o.enum(PATTERNS),fg:ColorFileSchema.optional(),bg:ColorFileSchema.optional()}),TILE_ALIGNMENTS=["tl","t","tr","l","ctr","r","bl","b","br"],PictureFillSchema=o.strictObject({path:o.string().min(1),tile:o.strictObject({scale_x:o.number().positive().max(100).optional(),scale_y:o.number().positive().max(100).optional(),x:o.number().optional(),y:o.number().optional(),align:o.enum(TILE_ALIGNMENTS).optional()}).optional(),transparency:c.optional()}),BackgroundSchema=o.strictObject({fill:ColorFileSchema.optional(),gradient:GradientSchema.optional(),picture:o.string().min(1).optional()}).refine(t=>[t.fill,t.gradient,t.picture].filter(e=>e!==void 0).length===1,{message:"A background is a fill, a gradient or a picture: one of them."}),ShadowSchema=o.strictObject({color:ColorFileSchema.optional(),blur:o.number().min(0).max(100).optional(),distance:o.number().min(0).max(200).optional(),angle:o.number().min(0).max(360).optional(),transparency:c.optional()}),InnerShadowSchema=o.strictObject({color:ColorFileSchema.optional(),blur:o.number().min(0).max(100).optional(),distance:o.number().min(0).max(200).optional(),angle:o.number().min(0).max(360).optional(),transparency:c.optional()}),GlowSchema=o.strictObject({color:ColorFileSchema.optional(),size:o.number().min(0).max(150).optional(),transparency:c.optional()}),ReflectionSchema=o.strictObject({transparency:c.optional(),size:c.optional(),distance:o.number().min(0).max(100).optional(),blur:o.number().min(0).max(100).optional()});const R=o.union([o.strictObject({shape:o.string().min(1),site:o.int().min(0)}),o.literal("none")]);export const MergedCellsSchema=o.object({row:o.int().min(0),column:o.int().min(0),rows:o.int().min(1).optional(),columns:o.int().min(1).optional()});function N(t,e,r,n){const i=t.rows??1,s=t.columns??1;if(i*s<2)return"A merge takes two cells or more.";if(t.row+i>e||t.column+s>r)return`A merge from row ${String(t.row)}, column ${String(t.column)} goes past the table's ${String(e)} rows and ${String(r)} columns.`;for(let a=t.row;a<t.row+i;a++)for(let l=t.column;l<t.column+s;l++){const p=`${String(a)},${String(l)}`;if(n.has(p))return`Two merges take the cell at row ${String(a)}, column ${String(l)}.`;n.add(p)}}export const MEDIA_STARTS=["auto","on-click"],PlaybackSchema=o.strictObject({start:o.enum(MEDIA_STARTS).optional(),trim:o.strictObject({start:o.number().min(0).optional(),end:o.number().positive().optional()}).refine(t=>t.start===void 0||t.end===void 0||t.end>t.start,{message:"A trim ends after it starts."}).optional(),loop:o.boolean().optional(),volume:o.number().min(0).max(1).optional(),fullscreen:o.boolean().optional(),hide:o.boolean().optional()}),ShapeSchema=o.strictObject({frame:FrameSchema.optional(),rotation:o.number().min(0).lt(360).optional(),flip_h:o.literal(!0).optional(),flip_v:o.literal(!0).optional(),connect:o.strictObject({begin:R.optional(),end:R.optional()}).optional(),z:o.int().optional(),fill:o.union([ColorFileSchema,o.literal("none")]).optional(),fill_transparency:c.optional(),gradient:GradientSchema.optional(),pattern:PatternSchema.optional(),picture_fill:PictureFillSchema.optional(),shadow:ShadowSchema.optional(),inner_shadow:InnerShadowSchema.optional(),glow:GlowSchema.optional(),soft_edges:o.number().positive().max(100).optional(),reflection:ReflectionSchema.optional(),line:o.union([ColorFileSchema,o.literal("none")]).optional(),line_width:o.number().positive().max(1584).optional(),line_dash:o.enum(LINE_DASHES).optional(),line_cap:o.enum(LINE_CAPS).optional(),line_join:o.enum(LINE_JOINS).optional(),line_compound:o.enum(LINE_COMPOUNDS).optional(),line_begin:o.enum(LINE_ENDS).optional(),line_end:o.enum(LINE_ENDS).optional(),line_begin_size:LineEndSizeSchema.optional(),line_end_size:LineEndSizeSchema.optional(),text:TextStyleSchema.optional(),textbox:o.literal(!0).optional(),picture:o.string().min(1).optional(),crop:T.optional(),movie:o.string().min(1).optional(),audio:o.string().min(1).optional(),poster:o.number().min(0).optional(),playback:PlaybackSchema.optional(),geometry:o.enum(SHAPE_GEOMETRIES).optional(),adjustments:o.array(o.number()).max(8).optional(),path:o.strictObject({w:o.number().positive(),h:o.number().positive(),d:o.string().min(1)}).optional(),table:o.strictObject({columns:o.array(o.number().positive()).min(1),rows:o.array(o.strictObject({height:o.number().positive(),fill:ColorFileSchema.optional(),text:TextStyleSchema.optional(),line:ColorFileSchema.optional()})).min(1),merged:o.array(MergedCellsSchema).optional(),style:o.string().min(1).optional(),first_row:o.boolean().optional(),last_row:o.boolean().optional(),first_col:o.boolean().optional(),last_col:o.boolean().optional(),horz_banding:o.boolean().optional(),vert_banding:o.boolean().optional()}).superRefine((t,e)=>{const r=new Set;(t.merged??[]).forEach((n,i)=>{const s=N(n,t.rows.length,t.columns.length,r);s!==void 0&&e.addIssue({code:"custom",path:["merged",i],message:s})})}).optional(),chart:ChartSchema.optional(),link:o.string().trim().min(1).optional(),group:o.string().regex(/^[A-Za-z0-9_-]+(?:\/[A-Za-z0-9_-]+)*$/u,"A group is a name of letters, digits, _ and -; a group in a group is outer/inner.").optional(),locked:o.literal(!0).optional(),component:o.union([h,o.string().regex(/^[^#\s]+\.[cm]?[jt]sx?(?:#[A-Za-z_$][\w$]*)?$/u,"A component is a name the deck's module registers, or a module's path and export: ../ui.ts#Dialog.")]).optional(),props:o.record(o.string(),b).optional(),dur:o.number().positive().optional()}),groupLevels=t=>t.split("/").map((e,r,n)=>n.slice(0,r+1).join("/")),inGroup=(t,e)=>t!==void 0&&(t===e||t.startsWith(`${e}/`)),SHOW_JUMPS=["firstslide","lastslide","nextslide","previousslide","endshow"],showJumpLink=t=>`ppaction://hlinkshowjump?jump=${t}`;export function showJumpOf(t){const e=/^ppaction:\/\/hlinkshowjump\?jump=([a-z]+)$/u.exec(t);return SHOW_JUMPS.find(r=>r===e?.[1])}export const slideLinkOf=t=>t.startsWith("#")&&t.length>1?t.slice(1):void 0,SHAPE_KINDS=["textbox","picture","movie","audio","geometry","path","table","chart","component"],SLIDE_TRANSITIONS=["fade","push","wipe","split","reveal","cut","cover","uncover","zoom","morph"],TransitionSchema=o.strictObject({type:o.enum(SLIDE_TRANSITIONS),direction:o.enum(ANIMATION_DIRECTIONS).optional(),through_black:o.literal(!0).optional(),duration:o.number().min(0).optional()}),AnimationSchema=o.strictObject({shape:o.string().min(1),paragraph:o.int().min(0).optional(),effect:o.enum(ANIMATION_EFFECTS),direction:o.enum(ANIMATION_DIRECTIONS).optional(),amount:o.number().positive().max(36e3).optional(),start:o.enum(ANIMATION_STARTS).optional(),duration:o.number().min(0).optional(),delay:o.number().min(0).optional(),path:o.string().min(1).optional(),animate_text:o.enum(ANIMATE_TEXT).optional(),text_delay:o.number().min(0).max(100).optional(),repeat:o.union([o.number().min(1).max(1e4),o.enum(ANIMATION_REPEATS)]).optional(),rewind:o.literal(!0).optional()}),SlideSchema=o.strictObject({id:h,layout:o.string().min(1).optional(),generate:h.optional(),hidden:o.union([o.literal(!0),o.array(o.string())]).optional(),shapes:o.record(o.string().min(1),ShapeSchema).optional(),animations:o.array(AnimationSchema).optional(),transition:TransitionSchema.optional(),advance_after:o.number().min(0).max(86400).optional(),background:BackgroundSchema.optional(),section:o.string().trim().min(1).max(255).optional()}),SlidesFileSchema=o.strictObject({slides:o.array(SlideSchema).default([])}).superRefine((t,e)=>{const r=new Set;t.slides.forEach((n,i)=>{r.has(n.id)&&e.addIssue({code:"custom",path:["slides",i,"id"],message:`Two slides are "${n.id}".`}),r.add(n.id),(n.layout===void 0?0:1)+(n.generate===void 0?0:1)!==1&&e.addIssue({code:"custom",path:["slides",i],message:`Slide ${n.id} has a layout or a generator: one of them.`}),n.hidden!==void 0&&n.generate===void 0&&n.hidden!==!0&&e.addIssue({code:"custom",path:["slides",i,"hidden"],message:`Slide ${n.id} is hidden (true); a list of ids is a generated block's.`});for(const[a,l]of Object.entries(n.shapes??{})){const p=SHAPE_KINDS.filter(u=>l[u]!==void 0);p.length>1&&e.addIssue({code:"custom",path:["slides",i,"shapes",a],message:`Shape ${a} is one kind of shape, not ${p.join(" and ")}.`});const m=a.includes("/")?a.split("/"):[a];(!(m.length<=2&&m.every(u=>_.test(u)))||m.length===2&&n.generate===void 0)&&e.addIssue({code:"custom",path:["slides",i,"shapes",a],message:"A shape's name is letters, digits, _ and -; <slide>/<shape> only in a generated block."})}})});
2
+ import{z as o}from"zod";import{SCRIPT_NAME as _}from"./script.js";const h=o.string().regex(_,"A name is letters, digits, _ and -.");export const THEME_COLORS=["dk1","lt1","dk2","lt2","accent1","accent2","accent3","accent4","accent5","accent6","hlink","folHlink"],TEXT_ALIGNS=["l","ctr","r","just"],SHAPE_GEOMETRIES=["line","lineInv","triangle","rtTriangle","rect","diamond","parallelogram","trapezoid","nonIsoscelesTrapezoid","pentagon","hexagon","heptagon","octagon","decagon","dodecagon","star4","star5","star6","star7","star8","star10","star12","star16","star24","star32","roundRect","round1Rect","round2SameRect","round2DiagRect","snipRoundRect","snip1Rect","snip2SameRect","snip2DiagRect","plaque","ellipse","teardrop","homePlate","chevron","pieWedge","pie","blockArc","donut","noSmoking","rightArrow","leftArrow","upArrow","downArrow","stripedRightArrow","notchedRightArrow","bentUpArrow","leftRightArrow","upDownArrow","leftUpArrow","leftRightUpArrow","quadArrow","leftArrowCallout","rightArrowCallout","upArrowCallout","downArrowCallout","leftRightArrowCallout","upDownArrowCallout","quadArrowCallout","bentArrow","uturnArrow","circularArrow","leftCircularArrow","leftRightCircularArrow","curvedRightArrow","curvedLeftArrow","curvedUpArrow","curvedDownArrow","swooshArrow","cube","can","lightningBolt","heart","sun","moon","smileyFace","irregularSeal1","irregularSeal2","foldedCorner","bevel","frame","halfFrame","corner","diagStripe","chord","arc","leftBracket","rightBracket","leftBrace","rightBrace","bracketPair","bracePair","straightConnector1","bentConnector2","bentConnector3","bentConnector4","bentConnector5","curvedConnector2","curvedConnector3","curvedConnector4","curvedConnector5","callout1","callout2","callout3","accentCallout1","accentCallout2","accentCallout3","borderCallout1","borderCallout2","borderCallout3","accentBorderCallout1","accentBorderCallout2","accentBorderCallout3","wedgeRectCallout","wedgeRoundRectCallout","wedgeEllipseCallout","cloudCallout","cloud","ribbon","ribbon2","ellipseRibbon","ellipseRibbon2","leftRightRibbon","verticalScroll","horizontalScroll","wave","doubleWave","plus","flowChartProcess","flowChartDecision","flowChartInputOutput","flowChartPredefinedProcess","flowChartInternalStorage","flowChartDocument","flowChartMultidocument","flowChartTerminator","flowChartPreparation","flowChartManualInput","flowChartManualOperation","flowChartConnector","flowChartPunchedCard","flowChartPunchedTape","flowChartSummingJunction","flowChartOr","flowChartCollate","flowChartSort","flowChartExtract","flowChartMerge","flowChartOfflineStorage","flowChartOnlineStorage","flowChartMagneticTape","flowChartMagneticDisk","flowChartMagneticDrum","flowChartDisplay","flowChartDelay","flowChartAlternateProcess","flowChartOffpageConnector","actionButtonBlank","actionButtonHome","actionButtonHelp","actionButtonInformation","actionButtonForwardNext","actionButtonBackPrevious","actionButtonEnd","actionButtonBeginning","actionButtonReturn","actionButtonDocument","actionButtonSound","actionButtonMovie","gear6","gear9","funnel","mathPlus","mathMinus","mathMultiply","mathDivide","mathEqual","mathNotEqual","cornerTabs","squareTabs","plaqueTabs","chartX","chartStar","chartPlus"],ANIMATION_EFFECTS=["appear","fade","fly-in","float-in","split","wipe","zoom","disappear","fade-out","fly-out","float-out","split-out","wipe-out","zoom-out","pulse","grow-shrink","spin","transparency","path"],ANIMATE_TEXT=["word","letter"],ANIMATION_REPEATS=["until-next-click","until-end-of-slide"],ANIMATION_STARTS=["on-click","with-previous","after-previous"],ANIMATION_DIRECTIONS=["from-bottom","from-top","from-left","from-right","from-top-right","from-bottom-right","from-top-left","from-bottom-left","vertical-out","vertical-in","horizontal-out","horizontal-in","in","out","rotate","up","down","clockwise","counterclockwise","both","horizontal","vertical"],LINE_DASHES=["solid","sysDot","sysDash","dash","dashDot","lgDash","lgDashDot","lgDashDotDot","dot","sysDashDot","sysDashDotDot"],LINE_CAPS=["flat","rnd","sq"],LINE_JOINS=["round","bevel","miter"],LINE_COMPOUNDS=["sng","dbl","thickThin","thinThick","tri"],LINE_ENDS=["none","triangle","arrow","stealth","diamond","oval"],ARROW_SIZES=["sm","med","lg"],LineEndSizeSchema=o.strictObject({w:o.enum(ARROW_SIZES).optional(),len:o.enum(ARROW_SIZES).optional()}),FrameSchema=o.strictObject({x:o.number(),y:o.number(),w:o.number().nonnegative(),h:o.number().nonnegative()}),MAPPED_COLORS=["tx1","bg1","tx2","bg2"],COLOR_NAMES=[...THEME_COLORS,...MAPPED_COLORS],COLOR_TRANSFORMS=["tint","shade","lumMod","lumOff","lum","satMod","satOff","sat","hueMod","hueOff","hue","alpha","alphaMod","alphaOff"];const C=`(?:${COLOR_NAMES.join("|")})`,k=`(?:${COLOR_TRANSFORMS.join("|")}) -?\\d+(?:\\.\\d+)?(?:%|°)`,A=new RegExp(`^(${C}) (lighter|darker) (100(?:\\.0{1,3})?|[1-9]?\\d(?:\\.\\d{1,3})?)%$`,"u"),v=new RegExp(`^(${C}|#[0-9A-Fa-f]{6})((?: ${k})+)$`,"u"),O=/^#[0-9A-Fa-f]{6}$/u,g=t=>COLOR_NAMES.includes(t),E=t=>COLOR_TRANSFORMS.includes(t),y=new Set(["hue","hueOff"]);export function colorOfFile(t){if(g(t))return t;if(O.test(t))return{rgb:t.toUpperCase()};const e=v.exec(t);if(e){const[,l="",p=""]=e,m=[];for(const w of p.matchAll(/ (\w+) (-?[\d.]+)(%|°)/gu)){const[,u="",D="",x]=w;if(!E(u)||x==="°"!==y.has(u))return;const S=Number(D);m.push({name:u,value:x==="%"?Math.round(S*1e3)/1e5:S})}return g(l)?{theme_color:l,transforms:m}:{rgb:l.toUpperCase(),transforms:m}}const r=A.exec(t),[,n="",i,s=""]=r??[],a=Math.round(Number(s)*1e3);if(!(!r||!g(n)||a<=0||a>1e5))return{theme_color:n,brightness:(i==="lighter"?a:-a)/1e5}}const P=t=>y.has(t.name)?`${t.name} ${String(Math.round(t.value*1e3)/1e3)}°`:`${t.name} ${String(Math.round(t.value*1e5)/1e3)}%`;export function colorFile(t){if(typeof t=="string")return t;if("rgb"in t)return t.transforms&&t.transforms.length>0?`${t.rgb} ${t.transforms.map(P).join(" ")}`:t.rgb;if("transforms"in t)return t.transforms.length===0?t.theme_color:`${t.theme_color} ${t.transforms.map(P).join(" ")}`;const e=Math.round(Math.abs(t.brightness)*1e5)/1e3;return e===0?t.theme_color:`${t.theme_color} ${t.brightness>0?"lighter":"darker"} ${String(e)}%`}const d=`A colour is one of the theme's (${THEME_COLORS.join(", ")}) or the colour map's (${MAPPED_COLORS.join(", ")}), one of them lighter or darker by a share over 0 up to 100% ("accent1 lighter 40%", "dk1 darker 25%"), #RRGGBB, or one of them with DrawingML's transforms in order ("accent1 lumMod 75% lumOff 25%", "#4472C4 alpha 50%", "accent2 hueOff 30°": ${COLOR_TRANSFORMS.join(", ")}).`;export const ColorFileSchema=o.union([o.enum(COLOR_NAMES),o.string().regex(A,d),o.string().regex(O,d),o.string().regex(v,d)]).refine(t=>colorOfFile(t)!==void 0,d),NUMBERINGS=["alphaLcParenBoth","alphaUcParenBoth","alphaLcParenR","alphaUcParenR","alphaLcPeriod","alphaUcPeriod","arabicParenBoth","arabicParenR","arabicPeriod","arabicPlain","romanLcParenBoth","romanUcParenBoth","romanLcParenR","romanUcParenR","romanLcPeriod","romanUcPeriod","circleNumDbPlain","circleNumWdBlackPlain","circleNumWdWhitePlain","arabicDbPeriod","arabicDbPlain","ea1ChsPeriod","ea1ChsPlain","ea1ChtPeriod","ea1ChtPlain","ea1JpnChsDbPeriod","ea1JpnKorPlain","ea1JpnKorPeriod","arabic1Minus","arabic2Minus","hebrew2Minus","thaiAlphaPeriod","thaiAlphaParenR","thaiAlphaParenBoth","thaiNumPeriod","thaiNumParenR","thaiNumParenBoth","hindiAlphaPeriod","hindiNumPeriod","hindiNumParenR","hindiAlpha1Period"],UNDERLINES=["sng","dbl","heavy","dotted","dottedHeavy","dash","dashHeavy","dashLong","dashLongHeavy","dotDash","dotDashHeavy","dotDotDash","dotDotDashHeavy","wavy","wavyHeavy","wavyDbl","words"],STRIKES=["sngStrike","dblStrike"],CAPS=["all","small","none"],TEXT_ORIENTATIONS=["horz","vert","vert270","eaVert","wordArtVert","wordArtVertRtl","mongolianVert"],TEXT_ANCHORS=["t","ctr","b"],ParagraphSpaceSchema=o.union([o.number().min(0).max(1584),o.object({lines:o.number().min(0).max(100)})]),TextStyleSchema=o.strictObject({size:o.number().positive().max(4e3).optional(),bold:o.boolean().optional(),italic:o.boolean().optional(),underline:o.union([o.boolean(),o.enum(UNDERLINES)]).optional(),strike:o.union([o.boolean(),o.enum(STRIKES)]).optional(),caps:o.enum(CAPS).optional(),color:ColorFileSchema.optional(),font:o.string().min(1).optional(),align:o.enum(TEXT_ALIGNS).optional(),line_spacing:o.number().positive().max(10).optional(),space_before:ParagraphSpaceSchema.optional(),space_after:ParagraphSpaceSchema.optional(),anchor:o.enum(TEXT_ANCHORS).optional(),orientation:o.enum(TEXT_ORIENTATIONS).optional(),bullet:o.union([o.literal(!1),o.string().min(1).max(2)]).optional(),numbered:o.enum(NUMBERINGS).optional(),bullet_color:ColorFileSchema.optional(),bullet_size:o.number().min(.25).max(4).optional(),start_at:o.int().min(1).max(32767).optional()});const T=o.strictObject({left:o.number().lt(1).optional(),top:o.number().lt(1).optional(),right:o.number().lt(1).optional(),bottom:o.number().lt(1).optional()}).refine(t=>(t.left??0)+(t.right??0)<1,{message:"left and right together cut the whole picture away"}).refine(t=>(t.top??0)+(t.bottom??0)<1,{message:"top and bottom together cut the whole picture away"}),b=o.lazy(()=>o.union([o.string(),o.number(),o.boolean(),o.null(),o.array(b),o.record(o.string(),b)]));export const CHART_TYPES=["column-clustered","column-stacked","column-stacked-100","bar-clustered","bar-stacked","bar-stacked-100","line","line-markers","area","area-stacked","area-stacked-100","pie","doughnut"],SHEET_CHART_TYPES=[...CHART_TYPES,"scatter","scatter-lines","scatter-smooth"],CHART_LEGEND_POSITIONS=["bottom","top","left","right"],CHART_COMBINED_TYPES=["column-clustered","column-stacked","column-stacked-100","line","line-markers","area","area-stacked","area-stacked-100"];const f=o.strictObject({min:o.number().optional(),max:o.number().optional(),major:o.number().positive().optional(),gridlines:o.boolean().optional(),visible:o.boolean().optional(),format:o.string().min(1).optional(),reverse:o.boolean().optional(),gridline_color:ColorFileSchema.optional(),line_color:ColorFileSchema.optional()});export const ChartSchema=o.strictObject({type:o.enum(SHEET_CHART_TYPES),data:o.string().min(1).optional(),categories:o.union([o.string().min(1),o.array(o.string())]).optional(),series:o.array(o.union([o.string().min(1),o.strictObject({name:o.string().min(1),values:o.array(o.number().nullable()).optional(),x:o.array(o.number().nullable()).optional(),color:ColorFileSchema.optional(),format:o.string().min(1).optional(),smooth:o.boolean().optional(),line_width:o.number().positive().optional(),marker_size:o.number().int().min(2).max(72).optional(),type:o.enum(CHART_COMBINED_TYPES).optional(),secondary:o.boolean().optional()})])).min(1),legend:o.enum(CHART_LEGEND_POSITIONS).optional(),labels:o.union([o.boolean(),o.strictObject({value:o.boolean().optional(),percentage:o.boolean().optional(),category:o.boolean().optional(),series:o.boolean().optional(),format:o.string().min(1).optional(),position:o.enum(["outEnd","inEnd","ctr","inBase","t","b","l","r","bestFit"]).optional(),size:o.number().positive().optional(),color:ColorFileSchema.optional()})]).optional(),gap_width:o.number().min(0).max(500).optional(),overlap:o.number().min(-100).max(100).optional(),vary_by_categories:o.boolean().optional(),category_colors:o.array(ColorFileSchema).min(1).optional(),hole_size:o.number().min(10).max(90).optional(),value_axis:f.optional(),category_axis:f.optional(),secondary_axis:f.optional(),size:o.number().positive().optional(),title_size:o.number().positive().optional(),color:ColorFileSchema.optional()});const c=o.number().min(0).max(1);export const GRADIENT_PATHS=["circle","rect","shape"],GradientSchema=o.strictObject({angle:o.number().min(0).max(360).optional(),path:o.enum(GRADIENT_PATHS).optional(),focus:o.strictObject({left:o.number().optional(),top:o.number().optional(),right:o.number().optional(),bottom:o.number().optional()}).optional(),stops:o.array(o.strictObject({at:c,color:ColorFileSchema,transparency:c.optional()})).min(2).max(10)}),PATTERNS=["pct5","pct10","pct20","pct25","pct30","pct40","pct50","pct60","pct70","pct75","pct80","pct90","horz","vert","ltHorz","ltVert","dkHorz","dkVert","narHorz","narVert","dashHorz","dashVert","cross","dnDiag","upDiag","ltDnDiag","ltUpDiag","dkDnDiag","dkUpDiag","wdDnDiag","wdUpDiag","dashDnDiag","dashUpDiag","diagCross","smCheck","lgCheck","smGrid","lgGrid","dotGrid","smConfetti","lgConfetti","horzBrick","diagBrick","solidDmnd","openDmnd","dotDmnd","plaid","sphere","weave","divot","shingle","wave","trellis","zigZag"],PatternSchema=o.strictObject({preset:o.enum(PATTERNS),fg:ColorFileSchema.optional(),bg:ColorFileSchema.optional()}),TILE_ALIGNMENTS=["tl","t","tr","l","ctr","r","bl","b","br"],PictureFillSchema=o.strictObject({path:o.string().min(1),tile:o.strictObject({scale_x:o.number().positive().max(100).optional(),scale_y:o.number().positive().max(100).optional(),x:o.number().optional(),y:o.number().optional(),align:o.enum(TILE_ALIGNMENTS).optional()}).optional(),transparency:c.optional()}),BackgroundSchema=o.strictObject({fill:ColorFileSchema.optional(),gradient:GradientSchema.optional(),picture:o.string().min(1).optional()}).refine(t=>[t.fill,t.gradient,t.picture].filter(e=>e!==void 0).length===1,{message:"A background is a fill, a gradient or a picture: one of them."}),ShadowSchema=o.strictObject({color:ColorFileSchema.optional(),blur:o.number().min(0).max(100).optional(),distance:o.number().min(0).max(200).optional(),angle:o.number().min(0).max(360).optional(),transparency:c.optional()}),InnerShadowSchema=o.strictObject({color:ColorFileSchema.optional(),blur:o.number().min(0).max(100).optional(),distance:o.number().min(0).max(200).optional(),angle:o.number().min(0).max(360).optional(),transparency:c.optional()}),GlowSchema=o.strictObject({color:ColorFileSchema.optional(),size:o.number().min(0).max(150).optional(),transparency:c.optional()}),ReflectionSchema=o.strictObject({transparency:c.optional(),size:c.optional(),distance:o.number().min(0).max(100).optional(),blur:o.number().min(0).max(100).optional()});const R=o.union([o.strictObject({shape:o.string().min(1),site:o.int().min(0)}),o.literal("none")]);export const MergedCellsSchema=o.object({row:o.int().min(0),column:o.int().min(0),rows:o.int().min(1).optional(),columns:o.int().min(1).optional()});function N(t,e,r,n){const i=t.rows??1,s=t.columns??1;if(i*s<2)return"A merge takes two cells or more.";if(t.row+i>e||t.column+s>r)return`A merge from row ${String(t.row)}, column ${String(t.column)} goes past the table's ${String(e)} rows and ${String(r)} columns.`;for(let a=t.row;a<t.row+i;a++)for(let l=t.column;l<t.column+s;l++){const p=`${String(a)},${String(l)}`;if(n.has(p))return`Two merges take the cell at row ${String(a)}, column ${String(l)}.`;n.add(p)}}export const MEDIA_STARTS=["auto","on-click"],PlaybackSchema=o.strictObject({start:o.enum(MEDIA_STARTS).optional(),trim:o.strictObject({start:o.number().min(0).optional(),end:o.number().positive().optional()}).refine(t=>t.start===void 0||t.end===void 0||t.end>t.start,{message:"A trim ends after it starts."}).optional(),loop:o.boolean().optional(),volume:o.number().min(0).max(1).optional(),fullscreen:o.boolean().optional(),hide:o.boolean().optional()}),ShapeSchema=o.strictObject({frame:FrameSchema.optional(),rotation:o.number().min(0).lt(360).optional(),flip_h:o.literal(!0).optional(),flip_v:o.literal(!0).optional(),connect:o.strictObject({begin:R.optional(),end:R.optional()}).optional(),z:o.int().optional(),fill:o.union([ColorFileSchema,o.literal("none")]).optional(),fill_transparency:c.optional(),gradient:GradientSchema.optional(),pattern:PatternSchema.optional(),picture_fill:PictureFillSchema.optional(),shadow:ShadowSchema.optional(),inner_shadow:InnerShadowSchema.optional(),glow:GlowSchema.optional(),soft_edges:o.number().positive().max(100).optional(),reflection:ReflectionSchema.optional(),line:o.union([ColorFileSchema,o.literal("none")]).optional(),line_width:o.number().positive().max(1584).optional(),line_dash:o.enum(LINE_DASHES).optional(),line_cap:o.enum(LINE_CAPS).optional(),line_join:o.enum(LINE_JOINS).optional(),line_compound:o.enum(LINE_COMPOUNDS).optional(),line_begin:o.enum(LINE_ENDS).optional(),line_end:o.enum(LINE_ENDS).optional(),line_begin_size:LineEndSizeSchema.optional(),line_end_size:LineEndSizeSchema.optional(),text:TextStyleSchema.optional(),textbox:o.literal(!0).optional(),picture:o.string().min(1).optional(),crop:T.optional(),movie:o.string().min(1).optional(),audio:o.string().min(1).optional(),item:o.string().min(1).optional(),poster:o.number().min(0).optional(),playback:PlaybackSchema.optional(),geometry:o.enum(SHAPE_GEOMETRIES).optional(),adjustments:o.array(o.number()).max(8).optional(),path:o.strictObject({w:o.number().positive(),h:o.number().positive(),d:o.string().min(1)}).optional(),table:o.strictObject({columns:o.array(o.number().positive()).min(1),rows:o.array(o.strictObject({height:o.number().positive(),fill:ColorFileSchema.optional(),text:TextStyleSchema.optional(),line:ColorFileSchema.optional()})).min(1),merged:o.array(MergedCellsSchema).optional(),data:o.string().min(1).optional(),fields:o.array(o.string().min(1)).min(1).optional(),head:o.boolean().optional(),style:o.string().min(1).optional(),first_row:o.boolean().optional(),last_row:o.boolean().optional(),first_col:o.boolean().optional(),last_col:o.boolean().optional(),horz_banding:o.boolean().optional(),vert_banding:o.boolean().optional()}).superRefine((t,e)=>{const r=new Set;t.data===void 0&&(t.fields!==void 0||t.head!==void 0)&&e.addIssue({code:"custom",path:[t.fields===void 0?"head":"fields"],message:"fields and head say how a table shows its data: give it data."}),(t.merged??[]).forEach((n,i)=>{const s=N(n,t.rows.length,t.columns.length,r);s!==void 0&&e.addIssue({code:"custom",path:["merged",i],message:s})})}).optional(),chart:ChartSchema.optional(),link:o.string().trim().min(1).optional(),group:o.string().regex(/^[A-Za-z0-9_-]+(?:\/[A-Za-z0-9_-]+)*$/u,"A group is a name of letters, digits, _ and -; a group in a group is outer/inner.").optional(),locked:o.literal(!0).optional(),component:o.union([h,o.string().regex(/^[^#\s]+\.[cm]?[jt]sx?(?:#[A-Za-z_$][\w$]*)?$/u,"A component is a name the deck's module registers, or a module's path and export: ../ui.ts#Dialog.")]).optional(),props:o.record(o.string(),b).optional(),dur:o.number().positive().optional()}),groupLevels=t=>t.split("/").map((e,r,n)=>n.slice(0,r+1).join("/")),inGroup=(t,e)=>t!==void 0&&(t===e||t.startsWith(`${e}/`)),SHOW_JUMPS=["firstslide","lastslide","nextslide","previousslide","endshow"],showJumpLink=t=>`ppaction://hlinkshowjump?jump=${t}`;export function showJumpOf(t){const e=/^ppaction:\/\/hlinkshowjump\?jump=([a-z]+)$/u.exec(t);return SHOW_JUMPS.find(r=>r===e?.[1])}export const slideLinkOf=t=>t.startsWith("#")&&t.length>1?t.slice(1):void 0,SHAPE_KINDS=["textbox","picture","movie","audio","geometry","path","table","chart","component","item"],SLIDE_TRANSITIONS=["fade","push","wipe","split","reveal","cut","cover","uncover","zoom","morph"],TransitionSchema=o.strictObject({type:o.enum(SLIDE_TRANSITIONS),direction:o.enum(ANIMATION_DIRECTIONS).optional(),through_black:o.literal(!0).optional(),duration:o.number().min(0).optional()}),AnimationSchema=o.strictObject({shape:o.string().min(1),paragraph:o.int().min(0).optional(),effect:o.enum(ANIMATION_EFFECTS),direction:o.enum(ANIMATION_DIRECTIONS).optional(),amount:o.number().positive().max(36e3).optional(),start:o.enum(ANIMATION_STARTS).optional(),duration:o.number().min(0).optional(),delay:o.number().min(0).optional(),path:o.string().min(1).optional(),animate_text:o.enum(ANIMATE_TEXT).optional(),text_delay:o.number().min(0).max(100).optional(),repeat:o.union([o.number().min(1).max(1e4),o.enum(ANIMATION_REPEATS)]).optional(),rewind:o.literal(!0).optional()}),SlideSchema=o.strictObject({id:h,layout:o.string().min(1).optional(),generate:h.optional(),hidden:o.union([o.literal(!0),o.array(o.string())]).optional(),shapes:o.record(o.string().min(1),ShapeSchema).optional(),animations:o.array(AnimationSchema).optional(),transition:TransitionSchema.optional(),advance_after:o.number().min(0).max(86400).optional(),background:BackgroundSchema.optional(),section:o.string().trim().min(1).max(255).optional()}),SlidesFileSchema=o.strictObject({slides:o.array(SlideSchema).default([])}).superRefine((t,e)=>{const r=new Set;t.slides.forEach((n,i)=>{r.has(n.id)&&e.addIssue({code:"custom",path:["slides",i,"id"],message:`Two slides are "${n.id}".`}),r.add(n.id),(n.layout===void 0?0:1)+(n.generate===void 0?0:1)!==1&&e.addIssue({code:"custom",path:["slides",i],message:`Slide ${n.id} has a layout or a generator: one of them.`}),n.hidden!==void 0&&n.generate===void 0&&n.hidden!==!0&&e.addIssue({code:"custom",path:["slides",i,"hidden"],message:`Slide ${n.id} is hidden (true); a list of ids is a generated block's.`});for(const[a,l]of Object.entries(n.shapes??{})){const p=SHAPE_KINDS.filter(u=>l[u]!==void 0);p.length>1&&e.addIssue({code:"custom",path:["slides",i,"shapes",a],message:`Shape ${a} is one kind of shape, not ${p.join(" and ")}.`});const m=a.includes("/")?a.split("/"):[a];(!(m.length<=2&&m.every(u=>_.test(u)))||m.length===2&&n.generate===void 0)&&e.addIssue({code:"custom",path:["slides",i,"shapes",a],message:"A shape's name is letters, digits, _ and -; <slide>/<shape> only in a generated block."})}})});
@@ -68,6 +68,10 @@ export interface KindSpec {
68
68
  } | undefined;
69
69
  /** What a new item of it starts as (KindStarter); none for a kind a person does not make new. */
70
70
  readonly starter?: KindStarter | undefined;
71
+ /** Its place among the kinds where they are listed for people (its contribution's `shown.order`, lower first); none: after those that have one. */
72
+ readonly order?: number | undefined;
73
+ /** Turn into does not offer it (its contribution's `turnInto: false`); absent: it does, where a person makes it new. */
74
+ readonly turnInto?: false | undefined;
71
75
  /** Whether an item of it is shared alone: a read-only link to it, its view served from the project's snapshot. */
72
76
  readonly share?: boolean | undefined;
73
77
  /**
@@ -142,28 +146,51 @@ export interface Item {
142
146
  */
143
147
  files?: ItemFile[];
144
148
  /**
145
- * The other items' made files it uses (docs/design/x.md §2), as the
146
- * build resolved them once its kind read it; absent before, and for an
147
- * item that uses none.
149
+ * The other items it uses (docs/design/references.md): their data,
150
+ * their drawing live or their made files, as the build resolved them
151
+ * once its kind read it; absent before, and for an item that uses none.
148
152
  */
149
153
  uses?: ItemUse[];
150
154
  }
151
155
  /**
152
- * Another item's made file an item uses, resolved by the build: the
153
- * reference as its file writes it (`./hero.ts#main`), the item it names,
154
- * the part after `#` when there is one, and the type it is made as (the
155
- * first of the types the using kind takes that the used kind renders).
156
+ * The forms a use takes an item as besides a made file's type
157
+ * (docs/design/references.md §3.2): its values, which its kind lends
158
+ * (`data`), and its drawing by its own kind's runtime inside the using
159
+ * item's page (`live`). Any other form is a file type (`png`, `mp4`).
160
+ */
161
+ export declare const USE_FORMS: {
162
+ readonly data: "data";
163
+ readonly live: "live";
164
+ };
165
+ /** Whether a use's form is a made file's type, which an export makes, rather than `data` or `live`. */
166
+ export declare const isFileForm: (form: string) => boolean;
167
+ /**
168
+ * Another item an item uses, resolved by the build: the reference as its
169
+ * file writes it (`./hero.ts#main`), the item it names, the part after
170
+ * `#` when there is one, and the form it is taken as (the first of the
171
+ * forms the using kind takes that the used item gives). A form read here
172
+ * may be one a later version added: a reader skips one it does not know.
156
173
  */
157
174
  export interface ItemUse {
158
175
  /** The reference as written. */
159
176
  of: string;
160
177
  /** The file that writes it, a project path. */
161
178
  from: string;
179
+ /** Its line in that file, when its kind said it. */
180
+ line?: number | undefined;
162
181
  /** The used item's id. */
163
182
  item: string;
164
183
  /** The part after `#` (a board's key), when the reference names one. */
165
184
  part?: string | undefined;
185
+ /** The form it is taken as: `data`, `live` or a file type (USE_FORMS). */
166
186
  type: string;
187
+ /**
188
+ * Where `type` is `live`: the file type it is made as for a file that
189
+ * cannot hold it live (a deck's PowerPoint file), when both kinds have one.
190
+ */
191
+ file?: string | undefined;
192
+ /** The using item's types that hold `file` (`pptx`); absent, every type. */
193
+ madeFor?: string[] | undefined;
167
194
  /** What it is to the using item, in its kind's own words (`media`). */
168
195
  role?: string | undefined;
169
196
  }
@@ -279,4 +306,10 @@ export declare const isListedFile: (piece: Item | ListedFile) => piece is Listed
279
306
  * id is the problem.
280
307
  */
281
308
  export declare function itemsOf(work: WorkFile, kinds: KindTable, files?: ReadonlySet<string>, editors?: FileEditorTable): ItemScan;
309
+ /** What a data file's rows as shown are asked by, beside the rows themselves (DataFile.shown). */
310
+ export declare const SHOWN_DATA = "\0shown";
311
+ /** The path a reader asks a data file's rows as shown by. */
312
+ export declare const shownPath: (path: string) => string;
313
+ /** The data file a path asks the rows as shown of; undefined for a path that asks the rows. */
314
+ export declare const shownOf: (path: string) => string | undefined;
282
315
  //# sourceMappingURL=items.d.ts.map
@@ -1,2 +1,2 @@
1
1
  /*! AllyHub. Copyright (c) 2026 AllyHub, Inc. All rights reserved. Use is subject to LICENSE.md. */
2
- import{listedWork as g}from"./data/work.js";import{fileEditorIn as O}from"./files.js";import{baseOf as m,dirOf as k}from"./layout.js";export function pointEntriesIn(e,t,i){return e.find(n=>n.id===t)?.points?.[i]??[]}export const LOCALE_MARK="{locale}";export function listsFile(e,t){return e.some(i=>{const n=i.path.indexOf(LOCALE_MARK);if(n<0)return i.path===t;const r=i.path.slice(0,n),d=i.path.slice(n+LOCALE_MARK.length);return t.length>r.length+d.length&&t.startsWith(r)&&t.endsWith(d)})}export const itemFiles=e=>e.files??[{path:e.entry,role:"entry"}],itemIdOf=e=>{const t=m(e),i=t.lastIndexOf(".");return i<=0?e:e.slice(0,e.length-(t.length-i))},listedFileIdOf=e=>e,itemNameOf=(e,t)=>e.title??t??m(e.id);export function listedPieceByIdOrFormerId(e,t){const i=e.filter(n=>n.kind===void 0);return e.find(n=>n.id===t)??i.find(n=>n.entry===t)??i.find(n=>itemIdOf(n.entry)===t)}export const isListedFile=e=>"editor"in e;export function itemsOf(e,t,i,n){const r=[],d=[],u=new Map;for(const s of g(e)){const o=s.file.replace(/^\.\//u,""),f=s.kind;let l;if(f===void 0){if(n===void 0)continue;const c=O(n,o)?.id;if(c===void 0){r.push({code:"no-editor",file:o});continue}l={editor:c}}else if(t.some(c=>c.id===f))l={kind:f};else{r.push({code:"unknown-kind",kind:f,file:o});continue}if(i!==void 0&&!i.has(o)){r.push({code:"missing",file:o});continue}const h="kind"in l?itemIdOf(o):listedFileIdOf(o);u.set(h,[...u.get(h)??[],o]);const x={id:h,dir:k(o),entry:o,...s.title===void 0?{}:{title:s.title},groups:s.groups};d.push({...x,...l})}for(const[s,o]of u)o.length>1&&r.push({code:"same-id",id:s,files:o});const a=new Set,p=d.filter(s=>a.has(s.id)?!1:(a.add(s.id),!0));return{items:p.filter(s=>!isListedFile(s)),files:p.filter(isListedFile),listed:p,problems:r}}
2
+ import{listedWork as O}from"./data/work.js";import{fileEditorIn as g}from"./files.js";import{baseOf as m,dirOf as k}from"./layout.js";export function pointEntriesIn(t,e,i){return t.find(n=>n.id===e)?.points?.[i]??[]}export const USE_FORMS={data:"data",live:"live"},isFileForm=t=>t!==USE_FORMS.data&&t!==USE_FORMS.live,LOCALE_MARK="{locale}";export function listsFile(t,e){return t.some(i=>{const n=i.path.indexOf(LOCALE_MARK);if(n<0)return i.path===e;const r=i.path.slice(0,n),d=i.path.slice(n+LOCALE_MARK.length);return e.length>r.length+d.length&&e.startsWith(r)&&e.endsWith(d)})}export const itemFiles=t=>t.files??[{path:t.entry,role:"entry"}],itemIdOf=t=>{const e=m(t),i=e.lastIndexOf(".");return i<=0?t:t.slice(0,t.length-(e.length-i))},listedFileIdOf=t=>t,itemNameOf=(t,e)=>t.title??e??m(t.id);export function listedPieceByIdOrFormerId(t,e){const i=t.filter(n=>n.kind===void 0);return t.find(n=>n.id===e)??i.find(n=>n.entry===e)??i.find(n=>itemIdOf(n.entry)===e)}export const isListedFile=t=>"editor"in t;export function itemsOf(t,e,i,n){const r=[],d=[],u=new Map;for(const s of O(t)){const o=s.file.replace(/^\.\//u,""),l=s.kind;let c;if(l===void 0){if(n===void 0)continue;const f=g(n,o)?.id;if(f===void 0){r.push({code:"no-editor",file:o});continue}c={editor:f}}else if(e.some(f=>f.id===l))c={kind:l};else{r.push({code:"unknown-kind",kind:l,file:o});continue}if(i!==void 0&&!i.has(o)){r.push({code:"missing",file:o});continue}const a="kind"in c?itemIdOf(o):listedFileIdOf(o);u.set(a,[...u.get(a)??[],o]);const x={id:a,dir:k(o),entry:o,...s.title===void 0?{}:{title:s.title},groups:s.groups};d.push({...x,...c})}for(const[s,o]of u)o.length>1&&r.push({code:"same-id",id:s,files:o});const h=new Set,p=d.filter(s=>h.has(s.id)?!1:(h.add(s.id),!0));return{items:p.filter(s=>!isListedFile(s)),files:p.filter(isListedFile),listed:p,problems:r}}export const SHOWN_DATA="\0shown",shownPath=t=>`${t}${SHOWN_DATA}`,shownOf=t=>t.endsWith(SHOWN_DATA)?t.slice(0,-SHOWN_DATA.length):void 0;
@@ -2367,6 +2367,7 @@ export declare const DATA_FILES: {
2367
2367
  }, z.core.$strict>>;
2368
2368
  movie: z.ZodOptional<z.ZodString>;
2369
2369
  audio: z.ZodOptional<z.ZodString>;
2370
+ item: z.ZodOptional<z.ZodString>;
2370
2371
  poster: z.ZodOptional<z.ZodNumber>;
2371
2372
  playback: z.ZodOptional<z.ZodObject<{
2372
2373
  start: z.ZodOptional<z.ZodEnum<{
@@ -2767,6 +2768,9 @@ export declare const DATA_FILES: {
2767
2768
  rows: z.ZodOptional<z.ZodInt>;
2768
2769
  columns: z.ZodOptional<z.ZodInt>;
2769
2770
  }, z.core.$strip>>>;
2771
+ data: z.ZodOptional<z.ZodString>;
2772
+ fields: z.ZodOptional<z.ZodArray<z.ZodString>>;
2773
+ head: z.ZodOptional<z.ZodBoolean>;
2770
2774
  style: z.ZodOptional<z.ZodString>;
2771
2775
  first_row: z.ZodOptional<z.ZodBoolean>;
2772
2776
  last_row: z.ZodOptional<z.ZodBoolean>;
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@allyhub/formats",
3
- "version": "0.16.0",
3
+ "version": "0.17.1",
4
4
  "type": "module",
5
5
  "exports": {
6
6
  ".": {
@@ -1,2 +1,2 @@
1
1
  /*! AllyHub. Copyright (c) 2026 AllyHub, Inc. All rights reserved. Use is subject to LICENSE.md. */
2
- import{problem as $}from"@allyhub/diagnostics";import{addLayerRule as L,lookCss as P}from"@allyhub/piece";import{selectorOf as E}from"./inspect.js";import{pictureHint as x,pictureWaiter as A,watchPictures as H}from"./pictures.js";import{rejectedMessage as K,watchStyles as M}from"./styles.js";const p=c=>c.toString(16).padStart(2,"0");export function createStage(c,n){const{options:m,embed:g}=c,f=m.purpose==="check"&&!g,b=f?M():void 0,v=f?H(n):void 0,h=[],R=A(n,t=>{h.some(o=>o.el===t.el&&o.src===t.src)||h.push(t)}),y=new Set,S=t=>!n.contains(t.target)&&!(t.target instanceof HTMLElement&&t.target.dataset.akHolder===""),w=f?new MutationObserver(t=>{for(const o of t)S(o)&&y.add(o.target.nodeName.toLowerCase())}):void 0;let u=!1;const C=t=>{const o=document.createElement("div");o.style.color=t,n.append(o);const i=getComputedStyle(o).color;o.remove();const s=document.createElement("canvas");s.width=1,s.height=1;const a=s.getContext("2d",{willReadFrequently:!0});if(!a)return"#000000";a.fillStyle=i,a.fillRect(0,0,1,1);const[e=0,r=0,d=0,l=255]=a.getImageData(0,0,1,1).data;return`#${p(e)}${p(r)}${p(d)}${l===255?"":p(l)}`},O=()=>{w?.takeRecords().forEach(t=>{S(t)&&y.add(t.target.nodeName.toLowerCase())})};return{el:n,styles:b,picturesDrawn:R,get clear(){return u},async sweep(){await v?.sweep()},cssColor:C,takeOutside:O,dress(t){const{dims:o,look:i}=t;u=m.purpose==="render"&&!g||t.options.transparent===!0,n.replaceChildren(),L(n.ownerDocument),n.dataset.format=t.format,c.lang!==void 0&&(n.lang=c.lang),Object.assign(n.style,{position:"relative",width:`${String(o.width)}px`,height:`${String(o.height)}px`,overflow:"hidden",background:u?"transparent":"var(--ak-color-bg)",color:"var(--ak-color-fg)",fontFamily:"var(--ak-font-body)"});for(const[e,r]of Object.entries(P(i)))n.style.setProperty(e,r);const a=t.options.transparent===!0?"transparent":C("var(--ak-color-bg)");return u&&m.purpose!=="play"&&!g&&(document.documentElement.style.background="transparent",document.body.style.background="transparent"),w?.observe(document.documentElement,{subtree:!0,childList:!0,attributes:!0,characterData:!0}),a},problems(t){O();const o=[...y].map(e=>$("AK-R003",`Piece code changed <${e}> outside the stage. Draw only inside each layer's own element.`)),i=(b?.rejected()??[]).map(e=>{const r=e.el&&n.contains(e.el)?E(e.el,n):void 0;return $("AK-R004",K(e,r?` on ${r}`:""),{part:e.part,...r?{where:{selector:r}}:{}})}),s=v?.broken()??[],a=[...s,...h.filter(e=>!s.some(r=>r.el===e.el&&r.src===e.src))].map(e=>{const r=t.find(k=>k.el.contains(e.el)),d=r?.layers.find(k=>k.el.contains(e.el)),l=n.contains(e.el)?E(e.el,n):void 0,j=d?`${d.spec.component} (layer ${String(d.index+1)}) in part ${r?.part.key??""}`:r?`Part ${r.part.key}`:"The stage",D=e.via==="img"?`<img src="${e.src}">`:`a background image, url("${e.src}")`;return $("AK-A005",`${j} draws a picture that does not load: ${D}. ${x(e.src)}`,{...r?{part:r.part.key}:{},...l?{where:{selector:l}}:{}})});return[...o,...i,...a]},dispose(){w?.disconnect(),n.replaceChildren()}}}
2
+ import{problem as $}from"@allyhub/diagnostics";import{addLayerRule as L,lookCss as P}from"@allyhub/piece";import{selectorOf as E}from"./inspect.js";import{pictureHint as x,pictureWaiter as A,watchPictures as H}from"./pictures.js";import{rejectedMessage as K,watchStyles as M}from"./styles.js";const m=c=>c.toString(16).padStart(2,"0");export function createStage(c,n){const{options:u}=c,g=c.embed!==void 0||u.inside!==void 0,f=u.purpose==="check"&&!g,b=f?M():void 0,v=f?H(n):void 0,h=[],R=A(n,t=>{h.some(o=>o.el===t.el&&o.src===t.src)||h.push(t)}),y=new Set,S=t=>!n.contains(t.target)&&!(t.target instanceof HTMLElement&&t.target.dataset.akHolder===""),w=f?new MutationObserver(t=>{for(const o of t)S(o)&&y.add(o.target.nodeName.toLowerCase())}):void 0;let p=!1;const C=t=>{const o=document.createElement("div");o.style.color=t,n.append(o);const i=getComputedStyle(o).color;o.remove();const a=document.createElement("canvas");a.width=1,a.height=1;const s=a.getContext("2d",{willReadFrequently:!0});if(!s)return"#000000";s.fillStyle=i,s.fillRect(0,0,1,1);const[e=0,r=0,d=0,l=255]=s.getImageData(0,0,1,1).data;return`#${m(e)}${m(r)}${m(d)}${l===255?"":m(l)}`},O=()=>{w?.takeRecords().forEach(t=>{S(t)&&y.add(t.target.nodeName.toLowerCase())})};return{el:n,styles:b,picturesDrawn:R,get clear(){return p},async sweep(){await v?.sweep()},cssColor:C,takeOutside:O,dress(t){const{dims:o,look:i}=t;p=u.purpose==="render"&&!g||t.options.transparent===!0,n.replaceChildren(),L(n.ownerDocument),n.dataset.format=t.format,c.lang!==void 0&&(n.lang=c.lang),Object.assign(n.style,{position:"relative",width:`${String(o.width)}px`,height:`${String(o.height)}px`,overflow:"hidden",background:p?"transparent":"var(--ak-color-bg)",color:"var(--ak-color-fg)",fontFamily:"var(--ak-font-body)"});for(const[e,r]of Object.entries(P(i)))n.style.setProperty(e,r);const s=t.options.transparent===!0?"transparent":C("var(--ak-color-bg)");return p&&u.purpose!=="play"&&!g&&(document.documentElement.style.background="transparent",document.body.style.background="transparent"),w?.observe(document.documentElement,{subtree:!0,childList:!0,attributes:!0,characterData:!0}),s},problems(t){O();const o=[...y].map(e=>$("AK-R003",`Piece code changed <${e}> outside the stage. Draw only inside each layer's own element.`)),i=(b?.rejected()??[]).map(e=>{const r=e.el&&n.contains(e.el)?E(e.el,n):void 0;return $("AK-R004",K(e,r?` on ${r}`:""),{part:e.part,...r?{where:{selector:r}}:{}})}),a=v?.broken()??[],s=[...a,...h.filter(e=>!a.some(r=>r.el===e.el&&r.src===e.src))].map(e=>{const r=t.find(k=>k.el.contains(e.el)),d=r?.layers.find(k=>k.el.contains(e.el)),l=n.contains(e.el)?E(e.el,n):void 0,j=d?`${d.spec.component} (layer ${String(d.index+1)}) in part ${r?.part.key??""}`:r?`Part ${r.part.key}`:"The stage",D=e.via==="img"?`<img src="${e.src}">`:`a background image, url("${e.src}")`;return $("AK-A005",`${j} draws a picture that does not load: ${D}. ${x(e.src)}`,{...r?{part:r.part.key}:{},...l?{where:{selector:l}}:{}})});return[...o,...i,...s]},dispose(){w?.disconnect(),n.replaceChildren()}}}
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@allyhub/image-draw",
3
- "version": "0.16.0",
3
+ "version": "0.17.1",
4
4
  "type": "module",
5
5
  "exports": {
6
6
  "./*": {
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@allyhub/image-measure",
3
- "version": "0.16.0",
3
+ "version": "0.17.1",
4
4
  "type": "module",
5
5
  "exports": {
6
6
  "./*": {
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@allyhub/image-sdk",
3
- "version": "0.16.0",
3
+ "version": "0.17.1",
4
4
  "type": "module",
5
5
  "exports": {
6
6
  ".": {
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@allyhub/measure",
3
- "version": "0.16.0",
3
+ "version": "0.17.1",
4
4
  "type": "module",
5
5
  "exports": {
6
6
  ".": {
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@allyhub/ooxml",
3
- "version": "0.16.0",
3
+ "version": "0.17.1",
4
4
  "type": "module",
5
5
  "exports": {
6
6
  ".": {
@@ -42,6 +42,11 @@ export interface EmbeddedVideo {
42
42
  /** Its moment by a reference of its own (an anchor, "@click", or a part's key), in its seconds (momentOf). */
43
43
  at(ref: string): number;
44
44
  }
45
+ /** Another item drawn live in a layer's element (`ctx.item`): a video's handle, and its kind. */
46
+ export interface EmbeddedItem extends EmbeddedVideo {
47
+ /** Its kind (`slides`, `video`). */
48
+ kind: string;
49
+ }
45
50
  export interface StageContext {
46
51
  look: Look;
47
52
  /** The format being drawn, e.g. "9x16". */
@@ -198,6 +203,16 @@ export interface StageContext {
198
203
  * embed.
199
204
  */
200
205
  video?(piece: unknown, el: HTMLElement): Promise<EmbeddedVideo>;
206
+ /**
207
+ * Another item of the project drawn live in an element of this layer's
208
+ * (docs/design/references.md §3.5): what its module exports, imported
209
+ * (`import q3 from "../decks/q3"`), drawn by its own kind's runtime in
210
+ * its own format, in this video's language where it has it. A video is
211
+ * drawn as `video` draws it; a deck's moments are its slides and their
212
+ * builds (`at("pricing")`). What it reads counts as this video's.
213
+ * Absent where the host cannot embed.
214
+ */
215
+ item?(piece: unknown, el: HTMLElement): Promise<EmbeddedItem>;
201
216
  /**
202
217
  * Answers a question the host asks every layer of the output by name
203
218
  * (`LoadedOutput.ask`): a scenery's cuts, the world times of references,
@@ -1,3 +1,4 @@
1
1
  export { consoleAt, consoleAtAsync, consoleLog, consoleParts, installConsole, resetConsole, } from "./console.js";
2
2
  export { locateLayers, pickLayer } from "./locate.js";
3
+ export { registerRuntimes, runtimeOf, type ItemRuntime } from "./runtimes.js";
3
4
  //# sourceMappingURL=index.d.ts.map
@@ -1,2 +1,2 @@
1
1
  /*! AllyHub. Copyright (c) 2026 AllyHub, Inc. All rights reserved. Use is subject to LICENSE.md. */
2
- export{consoleAt,consoleAtAsync,consoleLog,consoleParts,installConsole,resetConsole}from"./console.js";export{locateLayers,pickLayer}from"./locate.js";
2
+ export{consoleAt,consoleAtAsync,consoleLog,consoleParts,installConsole,resetConsole}from"./console.js";export{locateLayers,pickLayer}from"./locate.js";export{registerRuntimes,runtimeOf}from"./runtimes.js";
@@ -0,0 +1,9 @@
1
+ import type { BuildSource, LoadOptions } from "../source.js";
2
+ import type { StageOutput } from "../stage.js";
3
+ /** What loads a source of a kind onto the stage: an output that answers the stage's bridge. */
4
+ export type ItemRuntime = (source: BuildSource, options: LoadOptions, el: HTMLElement) => Promise<StageOutput>;
5
+ /** The runtimes the stage page has, by kind: the stage page's, once, as it installs. */
6
+ export declare function registerRuntimes(runtimes: ReadonlyMap<string, ItemRuntime>): void;
7
+ /** The runtime of a kind, where the stage page has one. */
8
+ export declare function runtimeOf(kind: string): ItemRuntime | undefined;
9
+ //# sourceMappingURL=runtimes.d.ts.map
@@ -0,0 +1,2 @@
1
+ /*! AllyHub. Copyright (c) 2026 AllyHub, Inc. All rights reserved. Use is subject to LICENSE.md. */
2
+ let t=new Map;export function registerRuntimes(e){t=e}export function runtimeOf(e){return t.get(e)}