@allyhub/sdk 0.9.0 → 0.11.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.
Files changed (148) hide show
  1. package/CHANGELOG.md +16 -0
  2. package/dist/node_modules/@allyhub/audio/package.json +1 -1
  3. package/dist/node_modules/@allyhub/chart/dist/chart-xml.d.ts +3 -0
  4. package/dist/node_modules/@allyhub/chart/dist/chart-xml.js +2 -2
  5. package/dist/node_modules/@allyhub/chart/dist/chart.d.ts +22 -0
  6. package/dist/node_modules/@allyhub/chart/dist/chart.js +1 -1
  7. package/dist/node_modules/@allyhub/chart/package.json +1 -1
  8. package/dist/node_modules/@allyhub/diagnostics/dist/problem.d.ts +7 -0
  9. package/dist/node_modules/@allyhub/diagnostics/package.json +1 -1
  10. package/dist/node_modules/@allyhub/formats/dist/data/faces.d.ts +1 -1
  11. package/dist/node_modules/@allyhub/formats/dist/data/sheet.d.ts +87 -1
  12. package/dist/node_modules/@allyhub/formats/dist/data/sheet.js +1 -1
  13. package/dist/node_modules/@allyhub/formats/dist/data/slides.d.ts +89 -0
  14. package/dist/node_modules/@allyhub/formats/dist/data/slides.js +1 -1
  15. package/dist/node_modules/@allyhub/formats/dist/note-shape.d.ts +20 -0
  16. package/dist/node_modules/@allyhub/formats/dist/note-shape.js +1 -1
  17. package/dist/node_modules/@allyhub/formats/dist/schemas.d.ts +50 -0
  18. package/dist/node_modules/@allyhub/formats/package.json +1 -1
  19. package/dist/node_modules/@allyhub/image-draw/package.json +1 -1
  20. package/dist/node_modules/@allyhub/image-measure/package.json +1 -1
  21. package/dist/node_modules/@allyhub/image-sdk/dist/index.d.ts +1 -1
  22. package/dist/node_modules/@allyhub/image-sdk/package.json +1 -1
  23. package/dist/node_modules/@allyhub/measure/package.json +1 -1
  24. package/dist/node_modules/@allyhub/ooxml/dist/geometry/index.js +1 -1
  25. package/dist/node_modules/@allyhub/ooxml/package.json +1 -1
  26. package/dist/node_modules/@allyhub/piece/dist/layer.d.ts +2 -0
  27. package/dist/node_modules/@allyhub/piece/dist/layout.d.ts +16 -0
  28. package/dist/node_modules/@allyhub/piece/dist/page/index.d.ts +1 -1
  29. package/dist/node_modules/@allyhub/piece/dist/page/index.js +1 -1
  30. package/dist/node_modules/@allyhub/piece/dist/page/locate.d.ts +14 -1
  31. package/dist/node_modules/@allyhub/piece/dist/page/locate.js +1 -1
  32. package/dist/node_modules/@allyhub/piece/dist/stage.d.ts +18 -0
  33. package/dist/node_modules/@allyhub/piece/package.json +1 -1
  34. package/dist/node_modules/@allyhub/protocol/dist/account.d.ts +140 -0
  35. package/dist/node_modules/@allyhub/protocol/dist/account.js +1 -1
  36. package/dist/node_modules/@allyhub/protocol/dist/auth.d.ts +19 -1
  37. package/dist/node_modules/@allyhub/protocol/dist/auth.js +1 -1
  38. package/dist/node_modules/@allyhub/protocol/dist/cloud.d.ts +157 -0
  39. package/dist/node_modules/@allyhub/protocol/dist/cloud.js +1 -1
  40. package/dist/node_modules/@allyhub/protocol/dist/editor.d.ts +10 -2
  41. package/dist/node_modules/@allyhub/protocol/dist/editor.js +1 -1
  42. package/dist/node_modules/@allyhub/protocol/dist/frame.d.ts +101 -186
  43. package/dist/node_modules/@allyhub/protocol/dist/frame.js +1 -1
  44. package/dist/node_modules/@allyhub/protocol/dist/mail.d.ts +1 -0
  45. package/dist/node_modules/@allyhub/protocol/dist/mail.js +1 -1
  46. package/dist/node_modules/@allyhub/protocol/dist/notes.d.ts +92 -94
  47. package/dist/node_modules/@allyhub/protocol/dist/notes.js +1 -1
  48. package/dist/node_modules/@allyhub/protocol/dist/snapshots.d.ts +17 -0
  49. package/dist/node_modules/@allyhub/protocol/dist/snapshots.js +1 -1
  50. package/dist/node_modules/@allyhub/protocol/dist/teams.d.ts +7 -0
  51. package/dist/node_modules/@allyhub/protocol/dist/teams.js +1 -1
  52. package/dist/node_modules/@allyhub/protocol/dist/tools.d.ts +15 -3
  53. package/dist/node_modules/@allyhub/protocol/dist/tools.js +1 -1
  54. package/dist/node_modules/@allyhub/protocol/package.json +1 -1
  55. package/dist/node_modules/@allyhub/runtimes/package.json +1 -1
  56. package/dist/node_modules/@allyhub/scenery/dist/index.d.ts +2 -2
  57. package/dist/node_modules/@allyhub/scenery/dist/index.js +1 -1
  58. package/dist/node_modules/@allyhub/scenery/dist/moire.d.ts +45 -5
  59. package/dist/node_modules/@allyhub/scenery/dist/moire.js +2 -2
  60. package/dist/node_modules/@allyhub/scenery/dist/phone.d.ts +4 -3
  61. package/dist/node_modules/@allyhub/scenery/dist/phone.js +1 -1
  62. package/dist/node_modules/@allyhub/scenery/package.json +1 -1
  63. package/dist/node_modules/@allyhub/sheet/dist/calc/coerce.js +1 -1
  64. package/dist/node_modules/@allyhub/sheet/dist/calc/engine.d.ts +70 -0
  65. package/dist/node_modules/@allyhub/sheet/dist/calc/engine.js +1 -1
  66. package/dist/node_modules/@allyhub/sheet/dist/calc/functions/criteria.d.ts +6 -0
  67. package/dist/node_modules/@allyhub/sheet/dist/calc/functions/criteria.js +1 -1
  68. package/dist/node_modules/@allyhub/sheet/dist/calc/functions/date.js +1 -1
  69. package/dist/node_modules/@allyhub/sheet/dist/calc/functions/define.d.ts +3 -1
  70. package/dist/node_modules/@allyhub/sheet/dist/calc/functions/define.js +1 -1
  71. package/dist/node_modules/@allyhub/sheet/dist/calc/functions/info.js +1 -1
  72. package/dist/node_modules/@allyhub/sheet/dist/calc/functions/kernels.js +1 -1
  73. package/dist/node_modules/@allyhub/sheet/dist/calc/functions/lookup.js +1 -1
  74. package/dist/node_modules/@allyhub/sheet/dist/calc/functions/maths.js +1 -1
  75. package/dist/node_modules/@allyhub/sheet/dist/calc/functions/text.js +1 -1
  76. package/dist/node_modules/@allyhub/sheet/dist/calc/indexes.d.ts +9 -0
  77. package/dist/node_modules/@allyhub/sheet/dist/calc/indexes.js +1 -1
  78. package/dist/node_modules/@allyhub/sheet/dist/calc/types.d.ts +6 -0
  79. package/dist/node_modules/@allyhub/sheet/dist/calc/types.js +1 -1
  80. package/dist/node_modules/@allyhub/sheet/dist/chart.d.ts +9 -0
  81. package/dist/node_modules/@allyhub/sheet/dist/chart.js +1 -1
  82. package/dist/node_modules/@allyhub/sheet/dist/export.d.ts +0 -8
  83. package/dist/node_modules/@allyhub/sheet/dist/export.js +2 -4
  84. package/dist/node_modules/@allyhub/sheet/dist/formula/ast.d.ts +12 -1
  85. package/dist/node_modules/@allyhub/sheet/dist/formula/move.d.ts +5 -1
  86. package/dist/node_modules/@allyhub/sheet/dist/formula/move.js +1 -1
  87. package/dist/node_modules/@allyhub/sheet/dist/formula/parse.js +1 -1
  88. package/dist/node_modules/@allyhub/sheet/dist/formula/print.js +1 -1
  89. package/dist/node_modules/@allyhub/sheet/dist/index.d.ts +3 -2
  90. package/dist/node_modules/@allyhub/sheet/dist/index.js +1 -1
  91. package/dist/node_modules/@allyhub/sheet/dist/inspect.d.ts +12 -2
  92. package/dist/node_modules/@allyhub/sheet/dist/inspect.js +1 -1
  93. package/dist/node_modules/@allyhub/sheet/dist/printed.d.ts +19 -0
  94. package/dist/node_modules/@allyhub/sheet/dist/printed.js +2 -0
  95. package/dist/node_modules/@allyhub/sheet/dist/values.d.ts +2 -0
  96. package/dist/node_modules/@allyhub/sheet/dist/values.js +1 -1
  97. package/dist/node_modules/@allyhub/sheet/dist/workbook.d.ts +2 -0
  98. package/dist/node_modules/@allyhub/sheet/dist/workbook.js +1 -1
  99. package/dist/node_modules/@allyhub/sheet/dist/write.js +15 -15
  100. package/dist/node_modules/@allyhub/sheet/dist/xlsx/charts.d.ts +6 -2
  101. package/dist/node_modules/@allyhub/sheet/dist/xlsx/charts.js +1 -1
  102. package/dist/node_modules/@allyhub/sheet/dist/xlsx/formula.js +2 -2
  103. package/dist/node_modules/@allyhub/sheet/dist/xlsx/import.d.ts +0 -1
  104. package/dist/node_modules/@allyhub/sheet/dist/xlsx/import.js +1 -1
  105. package/dist/node_modules/@allyhub/sheet/dist/xlsx/read.d.ts +3 -1
  106. package/dist/node_modules/@allyhub/sheet/dist/xlsx/read.js +2 -2
  107. package/dist/node_modules/@allyhub/sheet/dist/xlsx/sax.d.ts +7 -1
  108. package/dist/node_modules/@allyhub/sheet/dist/xlsx/sax.js +3 -1
  109. package/dist/node_modules/@allyhub/sheet/dist/xlsx/styles.d.ts +6 -0
  110. package/dist/node_modules/@allyhub/sheet/dist/xlsx/styles.js +1 -1
  111. package/dist/node_modules/@allyhub/sheet/dist/xlsx/write.d.ts +1 -1
  112. package/dist/node_modules/@allyhub/sheet/dist/xlsx/write.js +1 -1
  113. package/dist/node_modules/@allyhub/sheet/dist/xlsx/xml.d.ts +12 -1
  114. package/dist/node_modules/@allyhub/sheet/dist/xlsx/xml.js +3 -2
  115. package/dist/node_modules/@allyhub/sheet/package.json +1 -1
  116. package/dist/node_modules/@allyhub/slides-core/dist/api.d.ts +57 -7
  117. package/dist/node_modules/@allyhub/slides-core/dist/api.js +2 -2
  118. package/dist/node_modules/@allyhub/slides-core/dist/capabilities.js +1 -1
  119. package/dist/node_modules/@allyhub/slides-core/dist/enums.d.ts +24 -0
  120. package/dist/node_modules/@allyhub/slides-core/dist/enums.js +1 -1
  121. package/dist/node_modules/@allyhub/slides-core/dist/fact.d.ts +15 -0
  122. package/dist/node_modules/@allyhub/slides-core/dist/measure.js +1 -1
  123. package/dist/node_modules/@allyhub/slides-core/dist/model.d.ts +6 -2
  124. package/dist/node_modules/@allyhub/slides-core/dist/resolve.d.ts +3 -1
  125. package/dist/node_modules/@allyhub/slides-core/dist/resolve.js +1 -1
  126. package/dist/node_modules/@allyhub/slides-core/dist/sdk.d.ts +1 -1
  127. package/dist/node_modules/@allyhub/slides-core/dist/sdk.js +1 -1
  128. package/dist/node_modules/@allyhub/slides-core/package.json +1 -1
  129. package/dist/node_modules/@allyhub/video-core/dist/piece.d.ts +2 -2
  130. package/dist/node_modules/@allyhub/video-core/dist/schema.d.ts +2 -2
  131. package/dist/node_modules/@allyhub/video-core/dist/schema.js +1 -1
  132. package/dist/node_modules/@allyhub/video-core/package.json +1 -1
  133. package/dist/node_modules/@allyhub/video-sdk/dist/phone.d.ts +12 -5
  134. package/dist/node_modules/@allyhub/video-sdk/dist/phone.js +1 -1
  135. package/dist/node_modules/@allyhub/video-sdk/package.json +1 -1
  136. package/docs/README.md +4 -0
  137. package/docs/canvas.md +28 -0
  138. package/docs/defaults.md +30 -4
  139. package/docs/docs.md +10 -10
  140. package/docs/image.md +3 -3
  141. package/docs/linkedin.md +96 -0
  142. package/docs/reports.md +89 -0
  143. package/docs/scenery.md +3 -4
  144. package/docs/sheets.md +23 -6
  145. package/docs/slides.md +50 -4
  146. package/docs/speech.md +1 -1
  147. package/docs/x.md +73 -0
  148. package/package.json +1 -1
@@ -1,2 +1,2 @@
1
1
  /*! AllyHub. Copyright (c) 2026 AllyHub, Inc. All rights reserved. Use is subject to LICENSE.md. */
2
- import{colorOfFile as ee}from"@allyhub/formats";import{readMarks as _e,markRuns as be}from"@allyhub/piece";import{chartOfFile as ye}from"@allyhub/chart";import{AUTOSHAPE_STYLE as C,SHADOW_DEFAULTS as H,CONNECTOR_STYLE as ne,DRAWN_TEXTBOX_FRAME as te,TEXT_FALLBACK as ie,TEXT_INSETS as W,isConnectorGeometry as $e,placeholderFrame as xe,styleKindOf as we}from"./office.js";import{resolveAnimation as ke,resolveTransition as oe}from"./animation.js";import{glued as ve}from"./connect.js";import{pathSteps as Se}from"./path.js";import{masterPlaceholder as Ae}from"./placeholders.js";import{DECK_FONTS as Oe,OFFICE_THEME as Te,themeOver as je}from"./theme.js";import{Pt as O}from"./units.js";export function joinPath(i,t){if(t.startsWith("/"))return t.slice(1);const u=i===""?[]:i.split("/");for(const r of t.split("/"))r===""||r==="."||(r===".."?u.pop():u.push(r));return u.join("/")}const re={left:0,top:0,width:0,height:0},U=()=>Array.from({length:9},()=>({...ie,font:{...ie.font},margin_left:0}));export function levelsOver(i,...t){return i.map((u,r)=>{let o={...u,font:{...u.font}};for(const $ of t){const l=$?.[r];l&&(o={...o,...l.alignment===void 0?{}:{alignment:l.alignment},...l.line_spacing===void 0?{}:{line_spacing:l.line_spacing},...l.space_before===void 0?{}:{space_before:l.space_before},...l.space_after===void 0?{}:{space_after:l.space_after},...l.margin_left===void 0?{}:{margin_left:l.margin_left},...l.indent===void 0?{}:{indent:l.indent},font:{...o.font,...l.font}},l.numbered!==void 0&&(o.numbered=l.numbered,delete o.bullet),l.bullet===null?(delete o.bullet,delete o.numbered):l.bullet!==void 0?(delete o.numbered,o.bullet={char:l.bullet,...l.bullet_font===void 0?{}:{font:l.bullet_font}}):l.bullet_font!==void 0&&o.bullet&&(o.bullet={...o.bullet,font:l.bullet_font}))}return o})}function I(i,...t){const u=t.filter(o=>o!==void 0),r=o=>{for(let $=u.length-1;$>=0;$--){const l=u[$]?.[o];if(l!==void 0)return l}};return{vertical_anchor:r("vertical_anchor")??i.vertical_anchor,auto_size:r("auto_size")??i.auto_size,word_wrap:r("word_wrap")??i.word_wrap,margins:{left:r("margin_left")??W.left,top:r("margin_top")??W.top,right:r("margin_right")??W.right,bottom:r("margin_bottom")??W.bottom}}}const ae={vertical_anchor:"t",auto_size:"none",word_wrap:!0};export const plainLevels=i=>levelsOver(U(),i.text_styles.other);function V(i,t){return{...I(ae,t),levels:levelsOver(U(),i.text_styles.other,t.levels)}}function Ee(i,t,...u){return{...I(xe(t),...u),levels:levelsOver(U(),i.text_styles[we(t)],...u.map(r=>r?.levels))}}const Fe=Array.from({length:9},()=>({font:{color:C.font_color}})),de={vertical_anchor:C.vertical_anchor};function le(i,t){return{...I(ae,t),levels:levelsOver(U(),i.text_styles.other,Fe,t.levels)}}const X=i=>{const t={...i};return delete t.paragraphs,t},G=i=>({paragraphs:[],levels:[],...i}),z=i=>i==="none"?null:colorOfFile(i),Ne=/<span((?:\s+(?:color|font|size|bold|italic|underline|link|highlight|baseline|strike)="[^"\n]*")+)\s*>(.*?)<\/span>/gu,ze=/(color|font|size|bold|italic|underline|link|highlight|baseline|strike)="([^"\n]*)"/gu,K=57344,Me=256,se="",Ce=/[\ue000-\ue100]|[^\ue000-\ue100]+/gu;export const colorOfFile=i=>ee(i)??"dk1";function Z(i){const{shadow:t,gradient:u}=i;return{...i.fill_transparency===void 0?{}:{fill_transparency:i.fill_transparency},...u?{gradient:{angle:u.angle??0,stops:u.stops.map(r=>({at:r.at,color:colorOfFile(r.color),...r.transparency===void 0?{}:{transparency:r.transparency}}))}}:{},...t?{shadow:{color:t.color===void 0?H.color:colorOfFile(t.color),blur:t.blur===void 0?H.blur:O(t.blur),distance:t.distance===void 0?H.distance:O(t.distance),angle:t.angle??H.angle,transparency:t.transparency??H.transparency}}:{}}}function fe(i,t,u=[]){return{...i,rows:i.rows.map((r,o)=>({height:r.height,cells:r.cells.map($=>{const l=u[o];return{...$,text:{paragraphs:$.text.paragraphs,style:B({...V(t,$.text),auto_size:"shape"},l),own:X($.text),empty:!1},...l?{fileText:l}:{}}})}))}}function B(i,t){return t?{...i,...t.anchor===void 0?{}:{vertical_anchor:t.anchor},levels:i.levels.map(u=>{const r={...u.font,...t.size===void 0?{}:{size:O(t.size)},...t.bold===void 0?{}:{bold:t.bold},...t.italic===void 0?{}:{italic:t.italic},...t.underline===void 0?{}:{underline:t.underline},...t.strike===void 0?{}:{strike:t.strike},...t.font===void 0?{}:{name:t.font}};t.color!==void 0&&(r.color=colorOfFile(t.color));const o={...u,font:r,...t.align===void 0?{}:{alignment:t.align},...t.line_spacing===void 0?{}:{line_spacing:{lines:t.line_spacing}},...t.space_before===void 0?{}:{space_before:O(t.space_before)},...t.space_after===void 0?{}:{space_after:O(t.space_after)}};return t.numbered!==void 0?(o.numbered=t.numbered,delete o.bullet):t.bullet===!1?(delete o.bullet,delete o.numbered):t.bullet!==void 0&&(o.bullet={char:t.bullet},delete o.numbered),(t.numbered!==void 0||t.bullet!==void 0&&t.bullet!==!1)&&u.margin_left===0?{...o,margin_left:ue,indent:-ue}:o})}:i}function Pe(i,t){if(!t)return[...i];const u=t.numbered!==void 0||t.bullet!==void 0;return i.map(r=>{const o={...r};return t.align!==void 0&&delete o.alignment,t.line_spacing!==void 0&&delete o.line_spacing,t.space_before!==void 0&&delete o.space_before,t.space_after!==void 0&&delete o.space_after,u&&(delete o.bullet,delete o.bullet_font,delete o.numbered),o})}function Le(i){const t={};for(const[,u,r=""]of i.matchAll(ze))if(u==="font")t.name=r.trim();else if(u==="link")t.link=r.trim();else if(u==="highlight")t.highlight=r.trim().toUpperCase();else if(u==="bold")t.bold=r.trim()!=="false";else if(u==="italic")t.italic=r.trim()!=="false";else if(u==="strike")t.strike=r.trim()!=="false";else if(u==="underline")t.underline=r.trim()!=="false";else if(u==="size"){const o=Number(r);Number.isFinite(o)&&o>0&&(t.size=O(o))}else if(u==="baseline"){const o=Number(r);Number.isFinite(o)&&(t.baseline=o)}else{const o=ee(r.trim());o!==void 0&&(t.color=o)}return t}const ue=342900;export function paragraphsOfWords(i,t=0,u=Oe.code){return i===void 0?[]:typeof i=="string"?i.split(/\r?\n/u).map(r=>{const o=[],$=r.replace(Ne,(E,N,P)=>(o.push(Le(N)),`${String.fromCharCode(K+o.length-1)}${P}${se}`)),l=_e($);let F;const M=be(l.text,l.marks).flatMap(E=>{const N=E.kinds.includes("code"),P={...E.kinds.includes("strong")?{bold:!0}:{},...E.kinds.includes("em")?{italic:!0}:{},...N?{name:u}:{}};return[...E.text.matchAll(Ce)].flatMap(Y=>{const L=Y[0],R=L.charCodeAt(0);if(L===se)return F=void 0,[];if(R>=K&&R<K+Me)return F=o[R-K],[];const D={...F,...P};return[{text:L,...Object.keys(D).length>0?{font:D}:{},...N?{code:!0}:{}}]})});return{runs:M.length>0?M:[{text:""}],level:t}}):i.flatMap(r=>paragraphsOfWords(r,Array.isArray(r)?Math.min(t+1,8):t,u))}const ce=i=>({left:O(i.x),top:O(i.y),width:O(i.w),height:O(i.h)}),Re=new Set(["dt","ftr","sldNum"]),pe=i=>({...i.locked?{locked:!0}:{},...i.rotation===void 0||i.rotation===0?{}:{rotation:i.rotation},...i.flip_h||i.flip_v?{flip:{...i.flip_h?{h:!0}:{},...i.flip_v?{v:!0}:{}}}:{}});function he(i,t,u){if(!t)return;t.fill!==void 0&&(i.background=colorOfFile(t.fill));const r=t.gradient&&Z({gradient:t.gradient}).gradient;r&&(i.background_gradient=r),t.picture!==void 0&&(i.background_picture=joinPath(u,t.picture))}const me=i=>i===void 0?void 0:{left:i.left??0,top:i.top??0,right:i.right??0,bottom:i.bottom??0};export function resolveDeck(i){const{code:t,file:u,words:r,prefix:o,base:$}=i,l=[],F=je(i.theme??Te,t.theme),M=new Map;for(const e of t.masters)for(const n of e.layouts)M.set(n.name,{layout:n,master:e});const E=[],N=(e,n,a)=>({name:e.name,kind:e.kind,frame:{...e.frame??re},...e.flip?{flip:{...e.flip}}:{},...e.connect?{connect:{...e.connect.begin?{begin:{...e.connect.begin}}:{},...e.connect.end?{end:{...e.connect.end}}:{}}}:{},...e.rotation===void 0?{}:{rotation:e.rotation},level:n,...e.text?{text:{paragraphs:e.text.paragraphs,style:e.kind==="autoshape"?le(a,e.text):V(a,e.text),own:X(e.text),empty:!1}}:{},...e.fill===void 0?{}:{fill:e.fill},...e.fill_transparency===void 0?{}:{fill_transparency:e.fill_transparency},...e.gradient?{gradient:e.gradient}:{},...e.shadow?{shadow:e.shadow}:{},...e.line===void 0?{}:{line:e.line},...e.line_width===void 0?{}:{line_width:e.line_width},...e.line_dash===void 0?{}:{line_dash:e.line_dash},...e.line_begin===void 0?{}:{line_begin:e.line_begin},...e.line_end===void 0?{}:{line_end:e.line_end},...e.path?{path:e.path}:{},...e.table?{table:fe(e.table,a)}:{},...e.chart?{chart:e.chart}:{},...e.group===void 0?{}:{group:e.group},...e.geometry?{geometry:e.geometry}:{},...e.adjustments?{adjustments:[...e.adjustments]}:{},...e.media?{media:{path:joinPath(e.media.base,e.media.path),...e.media.poster===void 0?{}:{poster:e.media.poster}}}:{},...e.component?{component:{...e.component}}:{},sources:{frame:{from:n}}}),P=(e,n)=>{const a=e.placeholder?.type??"body",m=Ae(n,a),_=e.frame??m?.frame??re;return{name:e.name,kind:"placeholder",frame:{..._},level:"slide",...e.placeholder?{placeholder:{...e.placeholder}}:{},text:{paragraphs:[],style:Ee(n,a,m?.text,e.text),empty:!0},...e.fill===void 0?{}:{fill:e.fill},...e.line===void 0?{}:{line:e.line},sources:{frame:{from:e.frame||!m?"layout":"master"},text:{from:"layout"}}}},Y=(e,n,a,m)=>{const _=t.components[e];if(!_){l.push({...a,message:/\.[cm]?[jt]sx?(?:#|$)/u.test(e)?`${e} names no component: its module has no such export, or the export is not made with defineComponent.`:`There is no component ${e} in the deck's module (it has ${Object.keys(t.components).join(", ")||"none"}).`});return}for(const b of Object.keys(n??{}))Object.hasOwn(_.props,b)||l.push({...a,message:`Component ${e} has no prop ${b} a person sets (it has ${Object.keys(_.props).join(", ")||"none"}).`});return{name:e,props:{...n??{}},...m===void 0?{}:{dur:m}}},L=(e,n,a,m,_)=>{const b={slide:m,shape:e,path:a};if(!n.frame){l.push({...b,message:`Shape ${e} is the slide's own: it needs a frame { x, y, w, h } in points.`});return}const w=ce(n.frame),s={frame:{from:"slide",path:`${a}.frame`}},y={name:e,frame:w,level:"slide",...n.fill===void 0?{}:{fill:z(n.fill)},...Z(n),...n.line===void 0?{}:{line:z(n.line)},...n.line_dash===void 0?{}:{line_dash:n.line_dash},...n.line_begin===void 0?{}:{line_begin:n.line_begin},...n.line_end===void 0?{}:{line_end:n.line_end},...n.group===void 0?{}:{group:n.group},...pe(n)};if(n.textbox)return{...y,kind:"textbox",text:{paragraphs:paragraphsOfWords(r(`${o}.${m}.${e}`),0,F.fonts.code),style:B(V(_,G(te)),n.text),own:X(G(te)),empty:!1},...n.text?{fileText:{...n.text}}:{},sources:{...s,text:{from:"slide",path:`${a}.text`}}};if(n.picture!==void 0){const f=me(n.crop);return{...y,kind:"picture",media:{path:joinPath($,n.picture),...f?{crop:f}:{}},sources:{...s,media:{from:"slide",path:`${a}.picture`}}}}if(n.movie!==void 0)return{...y,kind:"movie",media:{path:joinPath($,n.movie),...n.poster===void 0?{}:{poster:n.poster}},sources:{...s,media:{from:"slide",path:`${a}.movie`}}};if(n.chart){const f=r(`${o}.${m}.${e}`),S=ye(n.chart,{title:typeof f=="string"?f:void 0,base:$,rows:g=>i.data?.(g),problem:g=>{l.push({...b,message:`Chart ${e}: ${g}`})}});return S?{...y,kind:"chart",chart:S,sources:s}:void 0}if(n.table){const f=n.table,S=w.width/f.columns.reduce((d,c)=>d+c,0),g=w.height/f.rows.reduce((d,c)=>d+c.height,0),v=r(`${o}.${m}.${e}`),T=Array.isArray(v)?v:[];return T.length>f.rows.length&&l.push({...b,message:`Table ${e} has ${String(f.rows.length)} rows and its words ${String(T.length)}.`}),{...y,kind:"table",table:fe({columns:f.columns.map(d=>Math.round(d*S)),rows:f.rows.map((d,c)=>{const p=T[c],x=Array.isArray(p)?p:p===void 0?[]:[p];return{height:Math.round(d.height*g),cells:f.columns.map((k,A)=>({text:{levels:[],paragraphs:paragraphsOfWords(x[A],0,F.fonts.code)},...d.fill===void 0?{}:{fill:colorOfFile(d.fill)},...d.line===void 0?{}:{borders:{bottom:{color:colorOfFile(d.line),width:O(1)}}}}))}})},_,f.rows.map(d=>d.text)),sources:s}}const h=n.path&&Se(n.path.d);if(n.path&&!h){l.push({...b,message:`Shape ${e}'s path starts with M and says only M, L, C and Z, absolute.`});return}if(n.geometry!==void 0||n.path&&h){const f=!n.path&&$e(n.geometry);return{...y,kind:"autoshape",...n.path&&h?{path:{w:n.path.w,h:n.path.h,steps:h}}:n.geometry===void 0?{}:{geometry:n.geometry,...n.adjustments?{adjustments:[...n.adjustments]}:{}},...f?{line:n.line===void 0?ne.line:z(n.line),line_width:n.line_width===void 0?ne.line_width:O(n.line_width)}:{fill:n.fill===void 0?C.fill:z(n.fill),line:n.line===void 0?C.line:z(n.line),line_width:n.line_width===void 0?C.line_width:O(n.line_width)},...n.text&&!f?{fileText:{...n.text}}:{},...f?{}:{text:{paragraphs:paragraphsOfWords(r(`${o}.${m}.${e}`)).map(S=>n.text?.align===void 0?{alignment:C.alignment,...S}:S),style:B(le(_,G(de)),n.text),own:X(G(de)),empty:!1}},sources:{...s,fill:{from:"slide",path:`${a}.fill`}}}}if(n.component!==void 0){const f=Y(n.component,n.props,b,n.dur);return f?{...y,kind:"component",component:f,sources:s}:void 0}},R=(e,n,a)=>{if(n.frame&&(e.frame=ce(n.frame),e.sources.frame={from:"slide",path:`${a}.frame`}),Object.assign(e,pe(n)),n.dur!==void 0&&e.component&&(e.component={...e.component,dur:n.dur}),n.text&&e.text&&(e.text.style=B(e.text.style,n.text),e.text.paragraphs=Pe(e.text.paragraphs,n.text),e.fileText={...n.text},e.sources.text={from:"slide",path:`${a}.text`}),n.line!==void 0&&(e.line=z(n.line),e.sources.line={from:"slide",path:`${a}.line`}),n.line_width!==void 0&&(e.line_width=O(n.line_width)),n.line_dash!==void 0&&(e.line_dash=n.line_dash),n.line_begin!==void 0&&(e.line_begin=n.line_begin),n.line_end!==void 0&&(e.line_end=n.line_end),n.fill!==void 0&&(e.fill=z(n.fill),e.sources.fill={from:"slide",path:`${a}.fill`}),Object.assign(e,Z(n)),(n.picture!==void 0||n.movie!==void 0)&&(e.placeholder?.type==="pic"||e.placeholder?.type==="media"||e.placeholder?.type==="obj")){const m=me(n.crop);e.kind=n.picture!==void 0?"picture":"movie",e.media={path:joinPath($,n.picture??n.movie??""),...m?{crop:m}:{},...n.poster===void 0?{}:{poster:n.poster}},e.sources.media={from:"slide",path:`${a}.${n.picture!==void 0?"picture":"movie"}`},delete e.text}},D=(e,n,a,m,_)=>{const b=M.get(n);if(!b){l.push({slide:e,path:`slides.${String(a)}.layout`,message:`Slide ${e} is on the layout "${n}", which the deck's module does not have (it has ${[...M.keys()].join(", ")||"none"}).`});return}const{layout:w,master:s}=b,y=[...(w.display_master_shapes===!1?[]:s.shapes).filter(f=>f.kind!=="placeholder").map(f=>N(f,"master",s)),...w.shapes.filter(f=>f.kind!=="placeholder").map(f=>N(f,"layout",s))],h=w.shapes.filter(f=>f.kind==="placeholder").map((f,S)=>({shape:P(f,s),order:S}));return{slide:{id:e,layout:w.name,master:s.name,hidden:m,background:w.background??s.background,shapes:y,animations:[],file:{index:a,..._===void 0?{}:{generate:_}}},placed:h,master:s}},q=(e,n,a)=>{if(!n)return;const m=w=>{const s=n[w];if(s===void 0)return e.connect?.[w];const y=s==="none"?void 0:a(s.shape);return s==="none"||y===void 0?void 0:{shape:y,site:s.site}},_=m("begin"),b=m("end");_||b?e.connect={..._?{begin:_}:{},...b?{end:b}:{}}:delete e.connect},J=(e,n,a,m,_,b,w,s,y,h=()=>{})=>{const f=new Set(a.map(d=>d.shape.name));let S=a.length;for(const[d,c]of Object.entries(m??{})){const p=b(d);if(p===void 0)continue;const x=`${_}.shapes.${d}`,k=c.textbox!==void 0||c.geometry!==void 0||c.path!==void 0||c.table!==void 0||c.chart!==void 0||c.component!==void 0||(c.picture!==void 0||c.movie!==void 0)&&!f.has(p),A=a.find(ge=>ge.shape.name===p);if(A&&!k){R(A.shape,c,x),q(A.shape,c.connect,b),A.shown=!0,c.z!==void 0&&(A.z=c.z);continue}if(A){l.push({slide:e.id,shape:p,path:x,message:`Slide ${e.id} has a ${A.shape.kind} ${p} already: a shape of its own needs another name.`});continue}if(!k){l.push({slide:e.id,shape:p,path:x,message:`Slide ${e.id} has no shape ${p} to change (its layout's placeholders and its own shapes are ${[...f].join(", ")||"none"}).`});continue}const j=L(p,c,x,e.id,n);j&&q(j,c.connect,b),j&&(a.push({shape:j,order:S++,...c.z===void 0?{}:{z:c.z}}),f.add(p))}const g=a.filter(d=>d.shown===!0||!Re.has(d.shape.placeholder?.type??"")||w(d.shape)!==void 0);a.splice(0,a.length,...g),a.sort((d,c)=>(d.z??0)-(c.z??0)||d.order-c.order);const v=new Map(a.flatMap((d,c)=>d.shape.group===void 0?[]:[[d.shape.group,c]])),T=a.flatMap((d,c)=>{const p=d.shape.group;return p===void 0?[d]:v.get(p)===c?a.filter(x=>x.shape.group===p):[]});a.splice(0,a.length,...T);for(const d of a){const c=h(d.shape);c!==void 0&&(d.shape.alt=c);const p=d.shape.text;if(d.shape.kind==="placeholder"&&p){const x=w(d.shape);p.paragraphs=paragraphsOfWords(x,0,F.fonts.code),p.empty=p.paragraphs.length===0||p.paragraphs.every(k=>k.runs.every(A=>A.text===""))}}e.shapes.push(...a.map(d=>d.shape));for(const d of e.shapes){const c=d.connect;if(!c)continue;const p=ve(d,x=>e.shapes.find(k=>k.name===x&&k.level===d.level&&k!==d));d.frame=p.frame,p.flip?d.flip=p.flip:delete d.flip;for(const x of p.lost){const k=c[x];k&&d.level==="slide"&&l.push({slide:e.id,shape:d.name,message:`Connector ${d.name}'s ${x} is glued to site ${String(k.site)} of ${k.shape}, which slide ${e.id} has not: it stays where it is.`})}}s!==void 0&&s.trim()!==""&&(e.notes=s);for(const[d,c]of(y??[]).entries()){const p=b(c.shape);if(p===void 0)continue;const x={slide:e.id,shape:p,path:`${_}.animations.${String(d)}`},k=e.shapes.find(j=>j.name===p&&j.level==="slide");if(!k){l.push({...x,message:`Slide ${e.id} has no shape ${p} to animate (it has ${e.shapes.filter(j=>j.level==="slide").map(j=>j.name).join(", ")}).`});continue}if(c.paragraph!==void 0&&c.paragraph>=(k.text?.paragraphs.length??0)){l.push({...x,message:`Shape ${p} has no paragraph ${String(c.paragraph)} to animate (it has ${String(k.text?.paragraphs.length??0)}).`});continue}const A=ke({...c,shape:p});A?e.animations.push(A):l.push({...x,message:`The animation of ${p} needs a path that starts with M and says only M, L and C, absolute.`})}},Q=new Set;return u.slides.forEach((e,n)=>{const a=`slides.${String(n)}`;if(e.layout!==void 0){const s=D(e.id,e.layout,n,e.hidden===!0);if(!s)return;const y=r(`${o}.${e.id}.notes`);e.transition&&(s.slide.transition=oe(e.transition)),e.advance_after!==void 0&&(s.slide.advance=e.advance_after),he(s.slide,e.background,$),J(s.slide,s.master,s.placed,e.shapes,a,h=>h,h=>r(`${o}.${e.id}.${h.name}`),typeof y=="string"?y:void 0,e.animations,h=>{const f=r(`${o}.${e.id}.alt.${h.name}`);return typeof f=="string"?f:void 0}),E.push(s.slide),Q.add(e.id);return}const m=e.generate??"",_=t.generators[m];if(_===void 0){l.push({slide:e.id,path:`${a}.generate`,message:`There is no generator ${m} in the deck's module (it has ${Object.keys(t.generators).join(", ")||"none"}).`});return}if(!Array.isArray(_)){l.push({slide:e.id,path:`${a}.generate`,message:`Generator ${m} threw: ${_.error}`,..._.stack===void 0?{}:{stack:_.stack}});return}const b=_,w=new Set(Array.isArray(e.hidden)?e.hidden:[]);for(const s of b){const y=`${e.id}/${s.id}`,h=D(y,s.layout,n,w.has(s.id),m);if(!h)continue;for(const g of s.shapes){const v=g.placeholder?h.placed.find(T=>T.shape.placeholder?.idx===g.placeholder?.idx):void 0;if(v)g.frame&&(v.shape.frame={...g.frame}),v.shape.sources.frame={from:"code"},v.shown=!0;else{const T=N(g,"layout",h.master);h.placed.push({shape:{...T,level:"slide",sources:{frame:{from:"code"}}},order:h.placed.length})}}const f=`${s.id}/`,S=s.transition??(s===b[0]?e.transition:void 0);he(h.slide,e.background,$),S&&(h.slide.transition=oe(S)),J(h.slide,h.master,h.placed,e.shapes,a,g=>g.startsWith(f)?g.slice(f.length):void 0,g=>{const v=g.placeholder===void 0?void 0:s.text[g.placeholder.idx];return v===void 0?void 0:v.map(T=>T.runs.map(d=>d.text).join(""))},s.notes,[...(s.animations??[]).map(g=>({...g,shape:`${f}${g.shape}`})),...e.animations??[]]);for(const g of h.slide.shapes){const v=g.placeholder===void 0?void 0:s.text[g.placeholder.idx];v&&g.text&&(g.text.paragraphs=v,g.text.empty=!1)}E.push(h.slide),Q.add(y)}for(const s of Object.keys(e.shapes??{})){const[y]=s.split("/");y!==void 0&&!b.some(h=>h.id===y)&&l.push({slide:e.id,path:`${a}.shapes.${s}`,message:`Generator ${m} makes no slide ${y}: ${s} changes nothing.`})}}),E.forEach((e,n)=>{for(const a of e.shapes)a.placeholder?.type==="sldNum"&&a.text&&(a.text.paragraphs=[{level:0,runs:[{text:String(n+1),field:"slidenum"}]}],a.text.empty=!1)}),{deck:{width:t.slide_width,height:t.slide_height,theme:F,slides:E},problems:l}}
2
+ import{colorOfFile as ee}from"@allyhub/formats";import{readMarks as _e,markRuns as be}from"@allyhub/piece";import{chartOfFile as ye}from"@allyhub/chart";import{AUTOSHAPE_STYLE as C,SHADOW_DEFAULTS as H,CONNECTOR_STYLE as ne,DRAWN_TEXTBOX_FRAME as te,TEXT_FALLBACK as ie,TEXT_INSETS as W,isConnectorGeometry as $e,placeholderFrame as xe,styleKindOf as we}from"./office.js";import{resolveAnimation as ke,resolveTransition as oe}from"./animation.js";import{glued as ve}from"./connect.js";import{pathSteps as Se}from"./path.js";import{masterPlaceholder as Ae}from"./placeholders.js";import{DECK_FONTS as Oe,OFFICE_THEME as ze,themeOver as Te}from"./theme.js";import{Pt as O}from"./units.js";export function joinPath(i,t){if(t.startsWith("/"))return t.slice(1);const u=[];for(const r of[...i.split("/"),...t.split("/")])r===""||r==="."||(r===".."?u.pop():u.push(r));return u.join("/")}const re={left:0,top:0,width:0,height:0},U=()=>Array.from({length:9},()=>({...ie,font:{...ie.font},margin_left:0}));export function levelsOver(i,...t){return i.map((u,r)=>{let o={...u,font:{...u.font}};for(const $ of t){const l=$?.[r];l&&(o={...o,...l.alignment===void 0?{}:{alignment:l.alignment},...l.line_spacing===void 0?{}:{line_spacing:l.line_spacing},...l.space_before===void 0?{}:{space_before:l.space_before},...l.space_after===void 0?{}:{space_after:l.space_after},...l.margin_left===void 0?{}:{margin_left:l.margin_left},...l.indent===void 0?{}:{indent:l.indent},font:{...o.font,...l.font}},l.numbered!==void 0&&(o.numbered=l.numbered,delete o.bullet),l.bullet===null?(delete o.bullet,delete o.numbered):l.bullet!==void 0?(delete o.numbered,o.bullet={char:l.bullet,...l.bullet_font===void 0?{}:{font:l.bullet_font}}):l.bullet_font!==void 0&&o.bullet&&(o.bullet={...o.bullet,font:l.bullet_font}))}return o})}function I(i,...t){const u=t.filter(o=>o!==void 0),r=o=>{for(let $=u.length-1;$>=0;$--){const l=u[$]?.[o];if(l!==void 0)return l}};return{vertical_anchor:r("vertical_anchor")??i.vertical_anchor,auto_size:r("auto_size")??i.auto_size,word_wrap:r("word_wrap")??i.word_wrap,margins:{left:r("margin_left")??W.left,top:r("margin_top")??W.top,right:r("margin_right")??W.right,bottom:r("margin_bottom")??W.bottom}}}const ae={vertical_anchor:"t",auto_size:"none",word_wrap:!0};export const plainLevels=i=>levelsOver(U(),i.text_styles.other);function V(i,t){return{...I(ae,t),levels:levelsOver(U(),i.text_styles.other,t.levels)}}function je(i,t,...u){return{...I(xe(t),...u),levels:levelsOver(U(),i.text_styles[we(t)],...u.map(r=>r?.levels))}}const Ee=Array.from({length:9},()=>({font:{color:C.font_color}})),de={vertical_anchor:C.vertical_anchor};function le(i,t){return{...I(ae,t),levels:levelsOver(U(),i.text_styles.other,Ee,t.levels)}}const X=i=>{const t={...i};return delete t.paragraphs,t},G=i=>({paragraphs:[],levels:[],...i}),N=i=>i==="none"?null:colorOfFile(i),Fe=/<span((?:\s+(?:color|font|size|bold|italic|underline|link|highlight|baseline|strike)="[^"\n]*")+)\s*>(.*?)<\/span>/gu,Ne=/(color|font|size|bold|italic|underline|link|highlight|baseline|strike)="([^"\n]*)"/gu,K=57344,Me=256,se="",Ce=/[\ue000-\ue100]|[^\ue000-\ue100]+/gu;export const colorOfFile=i=>ee(i)??"dk1";function Z(i){const{shadow:t,gradient:u}=i;return{...i.fill_transparency===void 0?{}:{fill_transparency:i.fill_transparency},...u?{gradient:{angle:u.angle??0,stops:u.stops.map(r=>({at:r.at,color:colorOfFile(r.color),...r.transparency===void 0?{}:{transparency:r.transparency}}))}}:{},...t?{shadow:{color:t.color===void 0?H.color:colorOfFile(t.color),blur:t.blur===void 0?H.blur:O(t.blur),distance:t.distance===void 0?H.distance:O(t.distance),angle:t.angle??H.angle,transparency:t.transparency??H.transparency}}:{}}}function fe(i,t,u=[]){return{...i,rows:i.rows.map((r,o)=>({height:r.height,cells:r.cells.map($=>{const l=u[o];return{...$,text:{paragraphs:$.text.paragraphs,style:B({...V(t,$.text),auto_size:"shape"},l),own:X($.text),empty:!1},...l?{fileText:l}:{}}})}))}}function B(i,t){return t?{...i,...t.anchor===void 0?{}:{vertical_anchor:t.anchor},levels:i.levels.map(u=>{const r={...u.font,...t.size===void 0?{}:{size:O(t.size)},...t.bold===void 0?{}:{bold:t.bold},...t.italic===void 0?{}:{italic:t.italic},...t.underline===void 0?{}:{underline:t.underline},...t.strike===void 0?{}:{strike:t.strike},...t.font===void 0?{}:{name:t.font}};t.color!==void 0&&(r.color=colorOfFile(t.color));const o={...u,font:r,...t.align===void 0?{}:{alignment:t.align},...t.line_spacing===void 0?{}:{line_spacing:{lines:t.line_spacing}},...t.space_before===void 0?{}:{space_before:O(t.space_before)},...t.space_after===void 0?{}:{space_after:O(t.space_after)}};return t.numbered!==void 0?(o.numbered=t.numbered,delete o.bullet):t.bullet===!1?(delete o.bullet,delete o.numbered):t.bullet!==void 0&&(o.bullet={char:t.bullet},delete o.numbered),(t.numbered!==void 0||t.bullet!==void 0&&t.bullet!==!1)&&u.margin_left===0?{...o,margin_left:ue,indent:-ue}:o})}:i}function Pe(i,t){if(!t)return[...i];const u=t.numbered!==void 0||t.bullet!==void 0;return i.map(r=>{const o={...r};return t.align!==void 0&&delete o.alignment,t.line_spacing!==void 0&&delete o.line_spacing,t.space_before!==void 0&&delete o.space_before,t.space_after!==void 0&&delete o.space_after,u&&(delete o.bullet,delete o.bullet_font,delete o.numbered),o})}function Le(i){const t={};for(const[,u,r=""]of i.matchAll(Ne))if(u==="font")t.name=r.trim();else if(u==="link")t.link=r.trim();else if(u==="highlight")t.highlight=r.trim().toUpperCase();else if(u==="bold")t.bold=r.trim()!=="false";else if(u==="italic")t.italic=r.trim()!=="false";else if(u==="strike")t.strike=r.trim()!=="false";else if(u==="underline")t.underline=r.trim()!=="false";else if(u==="size"){const o=Number(r);Number.isFinite(o)&&o>0&&(t.size=O(o))}else if(u==="baseline"){const o=Number(r);Number.isFinite(o)&&(t.baseline=o)}else{const o=ee(r.trim());o!==void 0&&(t.color=o)}return t}const ue=342900;export function paragraphsOfWords(i,t=0,u=Oe.code){return i===void 0?[]:typeof i=="string"?i.split(/\r?\n/u).map(r=>{const o=[],$=r.replace(Fe,(j,F,P)=>(o.push(Le(F)),`${String.fromCharCode(K+o.length-1)}${P}${se}`)),l=_e($);let E;const M=be(l.text,l.marks).flatMap(j=>{const F=j.kinds.includes("code"),P={...j.kinds.includes("strong")?{bold:!0}:{},...j.kinds.includes("em")?{italic:!0}:{},...F?{name:u}:{}};return[...j.text.matchAll(Ce)].flatMap(Y=>{const L=Y[0],R=L.charCodeAt(0);if(L===se)return E=void 0,[];if(R>=K&&R<K+Me)return E=o[R-K],[];const D={...E,...P};return[{text:L,...Object.keys(D).length>0?{font:D}:{},...F?{code:!0}:{}}]})});return{runs:M.length>0?M:[{text:""}],level:t}}):i.flatMap(r=>paragraphsOfWords(r,Array.isArray(r)?Math.min(t+1,8):t,u))}const ce=i=>({left:O(i.x),top:O(i.y),width:O(i.w),height:O(i.h)}),Re=new Set(["dt","ftr","sldNum"]),pe=i=>({...i.locked?{locked:!0}:{},...i.rotation===void 0||i.rotation===0?{}:{rotation:i.rotation},...i.flip_h||i.flip_v?{flip:{...i.flip_h?{h:!0}:{},...i.flip_v?{v:!0}:{}}}:{}});function he(i,t,u){if(!t)return;t.fill!==void 0&&(i.background=colorOfFile(t.fill));const r=t.gradient&&Z({gradient:t.gradient}).gradient;r&&(i.background_gradient=r),t.picture!==void 0&&(i.background_picture=joinPath(u,t.picture))}const me=i=>i===void 0?void 0:{left:i.left??0,top:i.top??0,right:i.right??0,bottom:i.bottom??0};export function resolveDeck(i){const{code:t,file:u,words:r,prefix:o,base:$}=i,l=[],E=Te(i.theme??ze,t.theme),M=new Map;for(const e of t.masters)for(const n of e.layouts)M.set(n.name,{layout:n,master:e});const j=[],F=(e,n,a)=>({name:e.name,kind:e.kind,frame:{...e.frame??re},...e.flip?{flip:{...e.flip}}:{},...e.connect?{connect:{...e.connect.begin?{begin:{...e.connect.begin}}:{},...e.connect.end?{end:{...e.connect.end}}:{}}}:{},...e.rotation===void 0?{}:{rotation:e.rotation},level:n,...e.text?{text:{paragraphs:e.text.paragraphs,style:e.kind==="autoshape"?le(a,e.text):V(a,e.text),own:X(e.text),empty:!1}}:{},...e.fill===void 0?{}:{fill:e.fill},...e.fill_transparency===void 0?{}:{fill_transparency:e.fill_transparency},...e.gradient?{gradient:e.gradient}:{},...e.shadow===void 0?{}:{shadow:e.shadow},...e.line===void 0?{}:{line:e.line},...e.line_width===void 0?{}:{line_width:e.line_width},...e.line_dash===void 0?{}:{line_dash:e.line_dash},...e.line_begin===void 0?{}:{line_begin:e.line_begin},...e.line_end===void 0?{}:{line_end:e.line_end},...e.line_begin_size===void 0?{}:{line_begin_size:e.line_begin_size},...e.line_end_size===void 0?{}:{line_end_size:e.line_end_size},...e.path?{path:e.path}:{},...e.table?{table:fe(e.table,a)}:{},...e.chart?{chart:e.chart}:{},...e.group===void 0?{}:{group:e.group},...e.geometry?{geometry:e.geometry}:{},...e.adjustments?{adjustments:[...e.adjustments]}:{},...e.media?{media:{path:joinPath(e.media.base,e.media.path),...e.media.poster===void 0?{}:{poster:e.media.poster}}}:{},...e.component?{component:{...e.component}}:{},sources:{frame:{from:n}}}),P=(e,n)=>{const a=e.placeholder?.type??"body",m=Ae(n,a),_=e.frame??m?.frame??re;return{name:e.name,kind:"placeholder",frame:{..._},level:"slide",...e.placeholder?{placeholder:{...e.placeholder}}:{},text:{paragraphs:[],style:je(n,a,m?.text,e.text),empty:!0},...e.fill===void 0?{}:{fill:e.fill},...e.line===void 0?{}:{line:e.line},sources:{frame:{from:e.frame||!m?"layout":"master"},text:{from:"layout"}}}},Y=(e,n,a,m)=>{const _=t.components[e];if(!_){l.push({...a,message:/\.[cm]?[jt]sx?(?:#|$)/u.test(e)?`${e} names no component: its module has no such export, or the export is not made with defineComponent.`:`There is no component ${e} in the deck's module (it has ${Object.keys(t.components).join(", ")||"none"}).`});return}for(const b of Object.keys(n??{}))Object.hasOwn(_.props,b)||l.push({...a,message:`Component ${e} has no prop ${b} a person sets (it has ${Object.keys(_.props).join(", ")||"none"}).`});return{name:e,props:{...n??{}},...m===void 0?{}:{dur:m}}},L=(e,n,a,m,_)=>{const b={slide:m,shape:e,path:a};if(!n.frame){l.push({...b,message:`Shape ${e} is the slide's own: it needs a frame { x, y, w, h } in points.`});return}const w=ce(n.frame),s={frame:{from:"slide",path:`${a}.frame`}},y={name:e,frame:w,level:"slide",...n.fill===void 0?{}:{fill:N(n.fill)},...Z(n),...n.line===void 0?{}:{line:N(n.line)},...n.line_dash===void 0?{}:{line_dash:n.line_dash},...n.line_begin===void 0?{}:{line_begin:n.line_begin},...n.line_end===void 0?{}:{line_end:n.line_end},...n.line_begin_size===void 0?{}:{line_begin_size:n.line_begin_size},...n.line_end_size===void 0?{}:{line_end_size:n.line_end_size},...n.group===void 0?{}:{group:n.group},...pe(n)};if(n.textbox)return{...y,kind:"textbox",text:{paragraphs:paragraphsOfWords(r(`${o}.${m}.${e}`),0,E.fonts.code),style:B(V(_,G(te)),n.text),own:X(G(te)),empty:!1},...n.text?{fileText:{...n.text}}:{},sources:{...s,text:{from:"slide",path:`${a}.text`}}};if(n.picture!==void 0){const f=me(n.crop);return{...y,kind:"picture",media:{path:joinPath($,n.picture),...f?{crop:f}:{}},sources:{...s,media:{from:"slide",path:`${a}.picture`}}}}if(n.movie!==void 0)return{...y,kind:"movie",media:{path:joinPath($,n.movie),...n.poster===void 0?{}:{poster:n.poster}},sources:{...s,media:{from:"slide",path:`${a}.movie`}}};if(n.chart){const f=r(`${o}.${m}.${e}`),S=ye(n.chart,{title:typeof f=="string"?f:void 0,base:$,rows:g=>i.data?.(g),problem:g=>{l.push({...b,message:`Chart ${e}: ${g}`})}});return S?{...y,kind:"chart",chart:S,sources:s}:void 0}if(n.table){const f=n.table,S=w.width/f.columns.reduce((d,c)=>d+c,0),g=w.height/f.rows.reduce((d,c)=>d+c.height,0),v=r(`${o}.${m}.${e}`),z=Array.isArray(v)?v:[];return z.length>f.rows.length&&l.push({...b,message:`Table ${e} has ${String(f.rows.length)} rows and its words ${String(z.length)}.`}),{...y,kind:"table",table:fe({columns:f.columns.map(d=>Math.round(d*S)),rows:f.rows.map((d,c)=>{const p=z[c],x=Array.isArray(p)?p:p===void 0?[]:[p];return{height:Math.round(d.height*g),cells:f.columns.map((k,A)=>({text:{levels:[],paragraphs:paragraphsOfWords(x[A],0,E.fonts.code)},...d.fill===void 0?{}:{fill:colorOfFile(d.fill)},...d.line===void 0?{}:{borders:{bottom:{color:colorOfFile(d.line),width:O(1)}}}}))}})},_,f.rows.map(d=>d.text)),sources:s}}const h=n.path&&Se(n.path.d);if(n.path&&!h){l.push({...b,message:`Shape ${e}'s path starts with M and says only M, L, C and Z, absolute.`});return}if(n.geometry!==void 0||n.path&&h){const f=!n.path&&$e(n.geometry);return{...y,kind:"autoshape",...n.path&&h?{path:{w:n.path.w,h:n.path.h,steps:h}}:n.geometry===void 0?{}:{geometry:n.geometry,...n.adjustments?{adjustments:[...n.adjustments]}:{}},...f?{line:n.line===void 0?ne.line:N(n.line),line_width:n.line_width===void 0?ne.line_width:O(n.line_width)}:{fill:n.fill===void 0?C.fill:N(n.fill),line:n.line===void 0?C.line:N(n.line),line_width:n.line_width===void 0?C.line_width:O(n.line_width)},...n.text&&!f?{fileText:{...n.text}}:{},...f?{}:{text:{paragraphs:paragraphsOfWords(r(`${o}.${m}.${e}`)).map(S=>n.text?.align===void 0?{alignment:C.alignment,...S}:S),style:B(le(_,G(de)),n.text),own:X(G(de)),empty:!1}},sources:{...s,fill:{from:"slide",path:`${a}.fill`}}}}if(n.component!==void 0){const f=Y(n.component,n.props,b,n.dur);return f?{...y,kind:"component",component:f,sources:s}:void 0}},R=(e,n,a)=>{if(n.frame&&(e.frame=ce(n.frame),e.sources.frame={from:"slide",path:`${a}.frame`}),Object.assign(e,pe(n)),n.dur!==void 0&&e.component&&(e.component={...e.component,dur:n.dur}),n.text&&e.text&&(e.text.style=B(e.text.style,n.text),e.text.paragraphs=Pe(e.text.paragraphs,n.text),e.fileText={...n.text},e.sources.text={from:"slide",path:`${a}.text`}),n.line!==void 0&&(e.line=N(n.line),e.sources.line={from:"slide",path:`${a}.line`}),n.line_width!==void 0&&(e.line_width=O(n.line_width)),n.line_dash!==void 0&&(e.line_dash=n.line_dash),n.line_begin!==void 0&&(e.line_begin=n.line_begin),n.line_end!==void 0&&(e.line_end=n.line_end),n.line_begin_size!==void 0&&(e.line_begin_size=n.line_begin_size),n.line_end_size!==void 0&&(e.line_end_size=n.line_end_size),n.fill!==void 0&&(e.fill=N(n.fill),e.sources.fill={from:"slide",path:`${a}.fill`}),Object.assign(e,Z(n)),(n.picture!==void 0||n.movie!==void 0)&&(e.placeholder?.type==="pic"||e.placeholder?.type==="media"||e.placeholder?.type==="obj")){const m=me(n.crop);e.kind=n.picture!==void 0?"picture":"movie",e.media={path:joinPath($,n.picture??n.movie??""),...m?{crop:m}:{},...n.poster===void 0?{}:{poster:n.poster}},e.sources.media={from:"slide",path:`${a}.${n.picture!==void 0?"picture":"movie"}`},delete e.text}},D=(e,n,a,m,_)=>{const b=M.get(n);if(!b){l.push({slide:e,path:`slides.${String(a)}.layout`,message:`Slide ${e} is on the layout "${n}", which the deck's module does not have (it has ${[...M.keys()].join(", ")||"none"}).`});return}const{layout:w,master:s}=b,y=[...(w.display_master_shapes===!1?[]:s.shapes).filter(f=>f.kind!=="placeholder").map(f=>F(f,"master",s)),...w.shapes.filter(f=>f.kind!=="placeholder").map(f=>F(f,"layout",s))],h=w.shapes.filter(f=>f.kind==="placeholder").map((f,S)=>({shape:P(f,s),order:S}));return{slide:{id:e,layout:w.name,master:s.name,hidden:m,background:w.background??s.background,shapes:y,animations:[],file:{index:a,..._===void 0?{}:{generate:_}}},placed:h,master:s}},q=(e,n,a)=>{if(!n)return;const m=w=>{const s=n[w];if(s===void 0)return e.connect?.[w];const y=s==="none"?void 0:a(s.shape);return s==="none"||y===void 0?void 0:{shape:y,site:s.site}},_=m("begin"),b=m("end");_||b?e.connect={..._?{begin:_}:{},...b?{end:b}:{}}:delete e.connect},J=(e,n,a,m,_,b,w,s,y,h=()=>{})=>{const f=new Set(a.map(d=>d.shape.name));let S=a.length;for(const[d,c]of Object.entries(m??{})){const p=b(d);if(p===void 0)continue;const x=`${_}.shapes.${d}`,k=c.textbox!==void 0||c.geometry!==void 0||c.path!==void 0||c.table!==void 0||c.chart!==void 0||c.component!==void 0||(c.picture!==void 0||c.movie!==void 0)&&!f.has(p),A=a.find(ge=>ge.shape.name===p);if(A&&!k){R(A.shape,c,x),q(A.shape,c.connect,b),A.shown=!0,c.z!==void 0&&(A.z=c.z);continue}if(A){l.push({slide:e.id,shape:p,path:x,message:`Slide ${e.id} has a ${A.shape.kind} ${p} already: a shape of its own needs another name.`});continue}if(!k){l.push({slide:e.id,shape:p,path:x,message:`Slide ${e.id} has no shape ${p} to change (its layout's placeholders and its own shapes are ${[...f].join(", ")||"none"}).`});continue}const T=L(p,c,x,e.id,n);T&&q(T,c.connect,b),T&&(a.push({shape:T,order:S++,...c.z===void 0?{}:{z:c.z}}),f.add(p))}const g=a.filter(d=>d.shown===!0||!Re.has(d.shape.placeholder?.type??"")||w(d.shape)!==void 0);a.splice(0,a.length,...g),a.sort((d,c)=>(d.z??0)-(c.z??0)||d.order-c.order);const v=new Map(a.flatMap((d,c)=>d.shape.group===void 0?[]:[[d.shape.group,c]])),z=a.flatMap((d,c)=>{const p=d.shape.group;return p===void 0?[d]:v.get(p)===c?a.filter(x=>x.shape.group===p):[]});a.splice(0,a.length,...z);for(const d of a){const c=h(d.shape);c!==void 0&&(d.shape.alt=c);const p=d.shape.text;if(d.shape.kind==="placeholder"&&p){const x=w(d.shape);p.paragraphs=paragraphsOfWords(x,0,E.fonts.code),p.empty=p.paragraphs.length===0||p.paragraphs.every(k=>k.runs.every(A=>A.text===""))}}e.shapes.push(...a.map(d=>d.shape));for(const d of e.shapes){const c=d.connect;if(!c)continue;const p=ve(d,x=>e.shapes.find(k=>k.name===x&&k.level===d.level&&k!==d));d.frame=p.frame,p.flip?d.flip=p.flip:delete d.flip;for(const x of p.lost){const k=c[x];k&&d.level==="slide"&&l.push({slide:e.id,shape:d.name,message:`Connector ${d.name}'s ${x} is glued to site ${String(k.site)} of ${k.shape}, which slide ${e.id} has not: it stays where it is.`})}}s!==void 0&&s.trim()!==""&&(e.notes=s);for(const[d,c]of(y??[]).entries()){const p=b(c.shape);if(p===void 0)continue;const x={slide:e.id,shape:p,path:`${_}.animations.${String(d)}`},k=e.shapes.find(T=>T.name===p&&T.level==="slide");if(!k){l.push({...x,message:`Slide ${e.id} has no shape ${p} to animate (it has ${e.shapes.filter(T=>T.level==="slide").map(T=>T.name).join(", ")}).`});continue}if(c.paragraph!==void 0&&c.paragraph>=(k.text?.paragraphs.length??0)){l.push({...x,message:`Shape ${p} has no paragraph ${String(c.paragraph)} to animate (it has ${String(k.text?.paragraphs.length??0)}).`});continue}const A=ke({...c,shape:p});A?e.animations.push(A):l.push({...x,message:`The animation of ${p} needs a path that starts with M and says only M, L and C, absolute.`})}},Q=new Set;return u.slides.forEach((e,n)=>{const a=`slides.${String(n)}`;if(e.layout!==void 0){const s=D(e.id,e.layout,n,e.hidden===!0);if(!s)return;const y=r(`${o}.${e.id}.notes`);e.transition&&(s.slide.transition=oe(e.transition)),e.advance_after!==void 0&&(s.slide.advance=e.advance_after),he(s.slide,e.background,$),J(s.slide,s.master,s.placed,e.shapes,a,h=>h,h=>r(`${o}.${e.id}.${h.name}`),typeof y=="string"?y:void 0,e.animations,h=>{const f=r(`${o}.${e.id}.alt.${h.name}`);return typeof f=="string"?f:void 0}),j.push(s.slide),Q.add(e.id);return}const m=e.generate??"",_=t.generators[m];if(_===void 0){l.push({slide:e.id,path:`${a}.generate`,message:`There is no generator ${m} in the deck's module (it has ${Object.keys(t.generators).join(", ")||"none"}).`});return}if(!Array.isArray(_)){l.push({slide:e.id,path:`${a}.generate`,message:`Generator ${m} threw: ${_.error}`,..._.stack===void 0?{}:{stack:_.stack}});return}const b=_,w=new Set(Array.isArray(e.hidden)?e.hidden:[]);for(const s of b){const y=`${e.id}/${s.id}`,h=D(y,s.layout,n,w.has(s.id),m);if(!h)continue;for(const g of s.shapes){const v=g.placeholder?h.placed.find(z=>z.shape.placeholder?.idx===g.placeholder?.idx):void 0;if(v)g.frame&&(v.shape.frame={...g.frame}),v.shape.sources.frame={from:"code"},v.shown=!0;else{const z=F(g,"layout",h.master);h.placed.push({shape:{...z,level:"slide",sources:{frame:{from:"code"}}},order:h.placed.length})}}const f=`${s.id}/`,S=s.transition??(s===b[0]?e.transition:void 0);he(h.slide,e.background,$),S&&(h.slide.transition=oe(S)),J(h.slide,h.master,h.placed,e.shapes,a,g=>g.startsWith(f)?g.slice(f.length):void 0,g=>{const v=g.placeholder===void 0?void 0:s.text[g.placeholder.idx];return v===void 0?void 0:v.map(z=>z.runs.map(d=>d.text).join(""))},s.notes,[...(s.animations??[]).map(g=>({...g,shape:`${f}${g.shape}`})),...e.animations??[]]);for(const g of h.slide.shapes){const v=g.placeholder===void 0?void 0:s.text[g.placeholder.idx];v&&g.text&&(g.text.paragraphs=v,g.text.empty=!1)}j.push(h.slide),Q.add(y)}for(const s of Object.keys(e.shapes??{})){const[y]=s.split("/");y!==void 0&&!b.some(h=>h.id===y)&&l.push({slide:e.id,path:`${a}.shapes.${s}`,message:`Generator ${m} makes no slide ${y}: ${s} changes nothing.`})}}),j.forEach((e,n)=>{for(const a of e.shapes)a.placeholder?.type==="sldNum"&&a.text&&(a.text.paragraphs=[{level:0,runs:[{text:String(n+1),field:"slidenum"}]}],a.text.empty=!1)}),{deck:{width:t.slide_width,height:t.slide_height,theme:E,slides:j},problems:l}}
@@ -1,7 +1,7 @@
1
1
  import { presentationFor } from "./index.js";
2
2
  /** 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`). */
3
3
  export declare const Emu: (n: number) => import("./units.js").LengthValue, Inches: (n: number) => import("./units.js").LengthValue, Pt: (n: number) => import("./units.js").LengthValue, Cm: (n: number) => import("./units.js").LengthValue, Mm: (n: number) => import("./units.js").LengthValue, Centipoints: (n: number) => import("./units.js").LengthValue;
4
- 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 "./index.js";
4
+ export { RGBColor, MSO_ANCHOR, CategoryChartData, MSO_ARROWHEAD, MSO_ARROWHEAD_SIZE, XL_CHART_TYPE, XL_LABEL_POSITION, XL_LEGEND_POSITION, MSO_AUTO_SIZE, MSO_CONNECTOR, MSO_FILL, MSO_LINE, MSO_LINE_DASH_STYLE, MSO_SHAPE, MSO_SHAPE_TYPE, MSO_THEME_COLOR, PP_ALIGN, PP_PARAGRAPH_ALIGNMENT, PP_PLACEHOLDER, THEME_FONT, SLIDE_SIZES, presentationFor, isDeck, type Anchor, type AutoSize, type Background, type Cell, type ColorFormat, type ComponentContext, type ComponentInput, type Deck, type FillFormat, type FreeformBuilder, type GradientStop, type GroupShape, 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 Table, type TextFrame, type TextStyles, type ThemeInput, } from "./index.js";
5
5
  /**
6
6
  * A deck: the default export of a deck's module. Its function makes
7
7
  * the presentation's slide masters, layouts, components and generators;
@@ -1,2 +1,2 @@
1
1
  /*! AllyHub. Copyright (c) 2026 AllyHub, Inc. All rights reserved. Use is subject to LICENSE.md. */
2
- import{LENGTH_UNITS as O,presentationFor as _}from"./index.js";export const{Emu,Inches,Pt,Cm,Mm,Centipoints}=O;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"./index.js";export const presentation=_(""),slidesFor=t=>({presentation:_(t.file)});
2
+ import{LENGTH_UNITS as O,presentationFor as _}from"./index.js";export const{Emu,Inches,Pt,Cm,Mm,Centipoints}=O;export{RGBColor,MSO_ANCHOR,CategoryChartData,MSO_ARROWHEAD,MSO_ARROWHEAD_SIZE,XL_CHART_TYPE,XL_LABEL_POSITION,XL_LEGEND_POSITION,MSO_AUTO_SIZE,MSO_CONNECTOR,MSO_FILL,MSO_LINE,MSO_LINE_DASH_STYLE,MSO_SHAPE,MSO_SHAPE_TYPE,MSO_THEME_COLOR,PP_ALIGN,PP_PARAGRAPH_ALIGNMENT,PP_PLACEHOLDER,THEME_FONT,SLIDE_SIZES,presentationFor,isDeck}from"./index.js";export const presentation=_(""),slidesFor=E=>({presentation:_(E.file)});
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@allyhub/slides-core",
3
- "version": "0.9.0",
3
+ "version": "0.11.0",
4
4
  "type": "module",
5
5
  "exports": {
6
6
  ".": {
@@ -618,8 +618,8 @@ export interface VideoOptions {
618
618
  * LOAD_WAITS (4) times as long.
619
619
  */
620
620
  seekLimit?: number;
621
- /** Motion blur: each frame blends moments across part of the frame's time. */
622
- motionBlur?: MotionBlur;
621
+ /** Motion blur: each frame blends moments across part of the frame's time; null (or absent) for none. */
622
+ motionBlur?: MotionBlur | null;
623
623
  /**
624
624
  * What a camera filming the picture does to it, before post: bloom,
625
625
  * chromatic aberration, vignetting, exposure breathing, grain and
@@ -164,10 +164,10 @@ export declare const VideoOptionsMeta: z.ZodObject<{
164
164
  lufs: z.ZodOptional<z.ZodUnion<readonly [z.ZodNumber, z.ZodLiteral<false>]>>;
165
165
  truePeak: z.ZodOptional<z.ZodNumber>;
166
166
  }, z.core.$strict>]>>;
167
- motionBlur: z.ZodOptional<z.ZodObject<{
167
+ motionBlur: z.ZodOptional<z.ZodNullable<z.ZodObject<{
168
168
  samples: z.ZodNumber;
169
169
  shutter: z.ZodOptional<z.ZodNumber>;
170
- }, z.core.$strict>>;
170
+ }, z.core.$strict>>>;
171
171
  capture: z.ZodOptional<z.ZodObject<{
172
172
  bloom: z.ZodOptional<z.ZodObject<{
173
173
  threshold: 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,FPS_HELP as u,VIDEO_FORMAT_HELP as b,formatSpecProblem as d,isVideoFormat as g,parseFps as f,RESERVED_DIMS as l}from"@allyhub/piece";import{OUTPUT_KINDS as h}from"./piece.js";import{musicTimeProblem as x}from"./music.js";export const VideoFormatSchema=t.string().refine(g,{message:`unknown format (${b})`}),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()}).superRefine((o,e)=>{const n=d(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=x(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=>f(o)!==void 0,{error:`A frame rate is ${u}`}).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(h),options:t.record(t.string(),t.unknown())}),PieceMeta=t.strictObject({id:PieceId.optional(),script:t.string().min(1).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,FPS_HELP as u,VIDEO_FORMAT_HELP as b,formatSpecProblem as d,isVideoFormat as g,parseFps as f,RESERVED_DIMS as l}from"@allyhub/piece";import{OUTPUT_KINDS as h}from"./piece.js";import{musicTimeProblem as x}from"./music.js";export const VideoFormatSchema=t.string().refine(g,{message:`unknown format (${b})`}),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()}).superRefine((o,e)=>{const n=d(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=x(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=>f(o)!==void 0,{error:`A frame rate is ${u}`}).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()}).nullable().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(h),options:t.record(t.string(),t.unknown())}),PieceMeta=t.strictObject({id:PieceId.optional(),script:t.string().min(1).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()});
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@allyhub/video-core",
3
- "version": "0.9.0",
3
+ "version": "0.11.0",
4
4
  "type": "module",
5
5
  "exports": {
6
6
  ".": {
@@ -5,17 +5,24 @@ export type { Deeper } from "@allyhub/scenery";
5
5
  export interface PhoneCamera extends SceneryPhone {
6
6
  /** video({ capture }): the marks on the picture it records. */
7
7
  capture: CaptureOptions;
8
- /** video({ motionBlur }): the shutter's blur of what moves (a scenery's camera too). */
9
- motionBlur: MotionBlur;
8
+ /**
9
+ * video({ motionBlur }): the shutter's blur of what moves (a scenery's
10
+ * camera too). null by default: each sample draws the frame again (8 cost
11
+ * a phone-filmed short about three times its render), and a hand-held
12
+ * phone's moves barely show it.
13
+ */
14
+ motionBlur: MotionBlur | null;
10
15
  }
11
16
  /**
12
17
  * A phone's main camera filming a screen or a room indoors, held in a
13
18
  * hand: a 26 mm lens on its 4:3 frame at f/8 equivalent (f/1.8 on its
14
19
  * small sensor), a 12 MP sensor, a hand whose tremor its stabiliser mostly
15
20
  * takes out, focus that hunts after a cut, a reframe or a jolt, exposure
16
- * that follows a new framing late; grain stronger in the shadows and a
17
- * little coloured, a soft lens and the phone's sharpening; a half-frame
18
- * shutter.
21
+ * that follows a new framing late; fine grain, a little coloured, as strong
22
+ * on a screen's white as in its middle tones (faded in the whites, a
23
+ * screen reads as paper), a lens a little soft and the phone's sharpening
24
+ * on it, so text is crisp as a phone's photo of a screen shows it; no motion
25
+ * blur. Measured against phone photos of a laptop's screen (2026-11).
19
26
  */
20
27
  export declare const PHONE_CAMERA: PhoneCamera;
21
28
  /**
@@ -1,2 +1,2 @@
1
1
  /*! AllyHub. Copyright (c) 2026 AllyHub, Inc. All rights reserved. Use is subject to LICENSE.md. */
2
- import{PHONE_CAMERA as u}from"@allyhub/scenery";export const PHONE_CAMERA={...u,capture:{soften:.4,grain:{amount:.02,size:1.5,shadows:2,highlights:.6,chroma:.4,chromaSize:3},sharpen:.25,vignette:.15,bloom:{threshold:.92,radius:14,strength:.15}},motionBlur:{samples:8,shutter:.5}};const i=t=>typeof t=="object"&&t!==null&&!Array.isArray(t);function s(t,r){if(!i(t)||!i(r))return r===void 0?t:r;const o={...t};for(const[n,e]of Object.entries(r))o[n]=e===void 0?t[n]:s(t[n],e);return o}export function phoneCamera(t={}){return s(PHONE_CAMERA,t)}
2
+ import{PHONE_CAMERA as s}from"@allyhub/scenery";export const PHONE_CAMERA={...s,capture:{soften:.3,grain:{amount:.013,size:.75,shadows:2,highlights:1,chroma:.4,chromaSize:3},sharpen:.9,vignette:.2,bloom:{threshold:.92,radius:14,strength:.15}},motionBlur:null};const i=t=>typeof t=="object"&&t!==null&&!Array.isArray(t);function u(t,n){if(!i(t)||!i(n))return n===void 0?t:n;const o={...t};for(const[r,e]of Object.entries(n))o[r]=e===void 0?t[r]:u(t[r],e);return o}export function phoneCamera(t={}){return u(PHONE_CAMERA,t)}
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@allyhub/video-sdk",
3
- "version": "0.9.0",
3
+ "version": "0.11.0",
4
4
  "type": "module",
5
5
  "exports": {
6
6
  ".": {
package/docs/README.md CHANGED
@@ -16,6 +16,10 @@ What a piece is written with, for the version of the SDK installed beside them.
16
16
  - [scenery.md](scenery.md): 3D sceneries: `defineScenery()`, cameras and their moves, the hand that holds one, the `scenery()` layer and its screens.
17
17
  - [modeling.md](modeling.md): a prop modelled in code with `@allyhub/model` and put in a scenery.
18
18
  - [docs.md](docs.md): a doc, one MDX file: its title, the Markdown and tags it reads, pictures and links, check and render.
19
+ - [reports.md](reports.md): a report, one HTML file written freely: what it loads from the project, how it is drawn, its check, frames and render, report styles.
19
20
  - [sheets.md](sheets.md): a sheet, a workbook as YAML and CSV: tables, formulas, names, checks, the openpyxl API (`@allyhub/sdk/sheets`), calc, trace and render.
21
+ - [canvas.md](canvas.md): a canvas, a JSON Canvas file laying a project's work out with notes, groups and edges.
22
+ - [x.md](x.md): an X post, thread or long post in POST /2/tweets's fields, and an X article in X's blocks: what X counts and refuses, and what they render to.
23
+ - [linkedin.md](linkedin.md): a LinkedIn post in the Posts API's fields (words, pictures, a video, a document or carousel, a poll, a link) and a LinkedIn article in LinkedIn's blocks: what LinkedIn counts and refuses, and what they render to.
20
24
  - [websites.md](websites.md): a website, any web project with its JSON file: how Studio serves it while it is made (`PORT`, `HOST`, the preview hosts), a project's videos in its pages, its build.
21
25
  - [defaults.md](defaults.md): every default of the piece API, generated from the code's constants, with the option that changes it.
package/docs/canvas.md ADDED
@@ -0,0 +1,28 @@
1
+ # Canvases
2
+
3
+ A canvas lays a project's work out to be seen together: items side by side, with notes, groups and edges. It draws nothing of its own and exports nothing. It is a `.canvas` file anywhere in the project, in [JSON Canvas 1.0](https://jsoncanvas.org) as Obsidian writes it, listed in `allyhub.yaml` with no `kind` (`- file: boards/launch.canvas`, [project.md](project.md#items)): its editor opens it by its name.
4
+
5
+ <!-- prettier-ignore -->
6
+ ```json
7
+ {
8
+ "nodes":[
9
+ {"id":"7d1f0c3a9b2e4f60","type":"group","label":"Share pictures","x":-40,"y":-80,"width":1360,"height":520},
10
+ {"id":"2b9e81c04d7f3a15","type":"file","file":"launch/og/og.ts","x":0,"y":0,"width":600,"height":340},
11
+ {"id":"c04d7f3a152b9e81","type":"text","text":"**Why this plate**: the river reads at 400 px.","x":640,"y":0,"width":320,"height":160,"color":"4"},
12
+ {"id":"9a6e2f10b3c84d57","type":"link","url":"https://example.com/launch","x":640,"y":200,"width":320,"height":120}
13
+ ],
14
+ "edges":[
15
+ {"id":"5e3a9c1d7b0f2846","fromNode":"c04d7f3a152b9e81","fromSide":"left","toNode":"2b9e81c04d7f3a15","toSide":"right","label":"chosen"}
16
+ ]
17
+ }
18
+ ```
19
+
20
+ - **Paths are from the project's folder**, wherever the canvas is.
21
+ - **A file node points at an item by its file**, as `allyhub.yaml` lists it (`launch/og/og.ts`); it shows the item's own preview, live: an image's boards, a deck's slide, a video's still, a doc's first words. Any other file (a picture, a clip, a sound) shows itself.
22
+ - **Nodes**: `text` (Markdown), `file`, `link` (`url`) and `group` (`label`), each with whole-pixel `x`, `y`, `width` and `height`; y grows down. The first node is drawn at the back, so a group comes before what it holds. A group holds the nodes whose boxes are inside its box.
23
+ - **Edges** join two nodes by id, from a side (`top`, `right`, `bottom`, `left`) to a side, with a `label`; `toEnd` is an arrow unless `"none"`.
24
+ - **Colours** are `"1"` red, `"2"` orange, `"3"` yellow, `"4"` green, `"5"` cyan, `"6"` purple, or a hex colour.
25
+ - **Ids** are unique across nodes and edges: 16 hex digits, as Obsidian makes them.
26
+ - **A person's changes** (moves, notes, edges) are written to the same file, which keeps the ids and the fields it does not know.
27
+
28
+ `allyhub check` reports a duplicate id, a file node at a missing file and an edge at a missing node (AK-C001 to AK-C004). `allyhub inspect canvas <file>` lists the nodes with their boxes and what they point at, what each group holds and each edge's ends.
package/docs/defaults.md CHANGED
@@ -268,6 +268,17 @@ A bar or column chart's bars: the gap between groups, % of a bar (Office's `gap_
268
268
  | `gap` | `80` |
269
269
  | `overlap` | `-8` |
270
270
 
271
+ ## Sheets
272
+
273
+ ### `ITERATION_DEFAULTS`
274
+
275
+ A sheet's iterative calculation, Excel's own limits: how many rounds at most, and the change under which it stops. The workbook file's `iteration: { max_iterations, max_change }`.
276
+
277
+ | Key | Value |
278
+ | --- | --- |
279
+ | `max_iterations` | `100` |
280
+ | `max_change` | `0.001` |
281
+
271
282
  ## Importing
272
283
 
273
284
  ### `ZIP_LIMITS`
@@ -580,6 +591,15 @@ How `allyhub render` and an editor's Export encode an mp4 when nothing chooses o
580
591
  | `height` | `1080` |
581
592
  | `fps` | `30` |
582
593
 
594
+ ### `GIF_ENCODE`
595
+
596
+ How `allyhub render` and an editor's Export make a GIF when nothing chooses otherwise: its width in pixels (its height in proportion) and its frames a second, each never more than the video's own. `--param gif-width`, `--param gif-fps` (0 for the video's own).
597
+
598
+ | Key | Value |
599
+ | --- | --- |
600
+ | `width` | `640` |
601
+ | `fps` | `15` |
602
+
583
603
  ### `MATTE_FEATHER`
584
604
 
585
605
  The softness of the person's edge, px at 1080p. `footage({ background: { feather } })`.
@@ -782,12 +802,11 @@ Value: `16384`
782
802
 
783
803
  ### `IMAGE_EXPORT_DEFAULTS`
784
804
 
785
- An image's files: JPEG's quality, and AVIF's (as libaom's constant quality, 63 − 0.63 × it), 0–100; a WebP without one keeps every pixel. `allyhub render --param quality=…`. A board's picture's pixels per board pixel, from 0.25 to 4: `--param scale=…`, or `width=…` / `height=…` in pixels.
805
+ An image's files: JPEG's quality, 0–100; a WebP without one keeps every pixel. `allyhub render --param quality=…`. A board's picture's pixels per board pixel, from 0.25 to 4: `--param scale=…`, or `width=…` / `height=…` in pixels.
786
806
 
787
807
  | Key | Value |
788
808
  | --- | --- |
789
809
  | `jpegQuality` | `90` |
790
- | `avifQuality` | `60` |
791
810
  | `scale` | `1` |
792
811
 
793
812
  ### `PSD_DEFAULTS`
@@ -896,7 +915,7 @@ A `scenery()` layer's drawing scale, its name and its depth of field's levels. `
896
915
 
897
916
  | Key | Value |
898
917
  | --- | --- |
899
- | `scale` | `0.5` |
918
+ | `scale` | `1` |
900
919
  | `name` | `"scenery"` |
901
920
  | `focusLevels` | `8` |
902
921
 
@@ -947,7 +966,13 @@ A phone's main camera held in a hand: its lens, sensor and hand. `phoneCamera(ch
947
966
  | `sensor.moire` | `1` |
948
967
  | `sensor.chroma` | `0.3` |
949
968
  | `sensor.distortion` | `-0.03` |
950
- | `sensor.grade.filter` | `"curves=all='0/0 0.2/0.07 0.5/0.38 0.78/0.82 1/1',eq=saturation=1.5,colortemperature=temperature=6000"` |
969
+ | `sensor.grade.room.curve` | `[[0,0],[0.25,0.21],[0.5,0.47],[0.75,0.78],[1,1]]` |
970
+ | `sensor.grade.room.saturation` | `1.08` |
971
+ | `sensor.grade.screen.curve` | `[[0,0],[0.36,0.1],[0.51,0.16],[0.67,0.46],[0.8,0.84],[1,1]]` |
972
+ | `sensor.grade.screen.saturation` | `1.25` |
973
+ | `sensor.grade.screen.hue` | `5` |
974
+ | `sensor.grade.screen.balance` | `[1,0.97,1]` |
975
+ | `sensor.grade.share` | `[0.5,0.8]` |
951
976
  | `hand.angle` | `0.25` |
952
977
  | `hand.roll` | `0.6` |
953
978
  | `hand.shift` | `0.001` |
@@ -1080,6 +1105,7 @@ A screen's physical pixels, which the sensor films. `screen(…, { pixels })`.
1080
1105
  | --- | --- |
1081
1106
  | `density` | `2` |
1082
1107
  | `rows` | `0.15` |
1108
+ | `mesh` | `0.09` |
1083
1109
 
1084
1110
  ### `SCREEN_LIGHT_DEFAULTS`
1085
1111
 
package/docs/docs.md CHANGED
@@ -28,7 +28,7 @@ It is the PDF's title, and the doc's name where people see it unless `allyhub.ya
28
28
 
29
29
  ## What a doc reads
30
30
 
31
- The file is MDX: Markdown with GFM tables, strike-through and task lists, plus tags and `import` lines. Bare addresses are not links (no autolinks): write `[text](https://…)`.
31
+ The file is MDX: Markdown with GFM tables, strike-through and task lists, plus tags and `import` lines. Bare addresses are not links (no autolinks): write `[text](https://…)`. `*`, `_`, `[` and `<` are Markdown's marks as CommonMark reads them: a blank to fill in written `[__]` twice in a paragraph makes the words between the two bold; write `\_\_` (or `[ ]`) for one.
32
32
 
33
33
  | Written | Block |
34
34
  | --- | --- |
@@ -39,7 +39,7 @@ The file is MDX: Markdown with GFM tables, strike-through and task lists, plus t
39
39
  | `- [ ] item`, `- [x] item` | task, unchecked or checked |
40
40
  | `> line` | quote |
41
41
  | A fenced code block | code, with its language; ```` ```math ```` and ```` ```mermaid ```` are drawn ([below](#equations-and-diagrams)) |
42
- | A GFM table | table, its first row the head, quiet over a stronger rule; a column whose cells are all numbers (`12%`, `$1,200`, `7.9×`, `29.8k`; a dash or `n/a` may stand for one) is set to the right, its head too (`numberColumns`); its columns share its width by their longest cell's characters, 6 to 36 and two more for its margins (`columnShares`), as Word's AutoFit to contents shares it, alike on paper and in Word |
42
+ | A GFM table | table, its first row the head, bold on its ground, the table between a strong rule over and under it and its rows apart by lines (a report's three rules); a head row whose cells are all empty is not drawn, the table then without a head; a column whose cells are all numbers (`12%`, `$1,200`, `7.9×`, `29.8k`; a dash or `n/a` may stand for one) is set to the right, its head too (`numberColumns`); its columns share its width as CSS 2.1's automatic table layout and Word's AutoFit to contents do (`columnShares`): each at least as wide as its longest word and its cell's margins, what is left by how much more each needs to hold its longest cell (6 to 36 characters) on a line, alike on paper and in Word |
43
43
  | `![alt](path "caption")` alone on a line | picture |
44
44
  | `---` | divider |
45
45
 
@@ -58,7 +58,7 @@ Tags with plain string attributes (`name="value"`, or the bare name for `toggle`
58
58
  | `<strong>` `<b>`, `<em>` `<i>`, `<del>` `<s>`, `<code>` | The marks `**`, `*`, `~~` and a backtick make, where Markdown's own would not read back. A doc reads `**` beside Chinese punctuation as a Chinese writer means it (`**“引号”**` is bold, as markdown-cjk-friendly reads it); other Markdown readers may not, and the editor writes a tag there |
59
59
  | `<br />` | Inside a line, a line break; on a line of its own, an empty paragraph |
60
60
  | `<Block align color bg toggle>` | One block's look. Inside it: the block, then the blocks under it. `align` is `center`, `right` or `justify`; `toggle` makes a heading or a line fold the blocks after it |
61
- | `<Callout icon color bg>` | A line set apart in a box with a sign before it (💡 when `icon` is absent). Inside it: the line, then the blocks under it |
61
+ | `<Callout icon color bg>` | A line set apart in a box, with `icon` before it when given (none when absent). Inside it: the line, then the blocks under it |
62
62
  | `<img src alt title width align id />` | A picture with a width in px or a place (`align`: `center` or `right`); `title` is its caption, `id` what a reference names it by. Without those, write `![alt](src)` |
63
63
  | `<Table widths head caption id>` around one GFM table | Column widths in px, comma-separated, an empty entry for a column that shares what is left by its content (`widths="120,,200"`); `head` is `row` (the default), `column`, `both` or `none`; `caption` is set over it, `id` is what a reference names it by |
64
64
  | `<Chart type …>` around one GFM table, or `<Chart type data … />` | A chart drawn from numbers ([below](#charts)) |
@@ -91,7 +91,7 @@ Folded under the heading.
91
91
 
92
92
  </Block>
93
93
 
94
- <Callout icon="⚠️" bg="yellow">
94
+ <Callout bg="yellow">
95
95
 
96
96
  Check the dates.
97
97
 
@@ -195,7 +195,7 @@ Where a page breaks is Chrome's and Word's, by the rules Word sets by default: a
195
195
 
196
196
  `<TableOfContents />` lists the doc's headings (its title left out) to the level its `levels` says, default 3, each a link to it, under its `title` (Word's TOC Heading, set as a heading 1 and listed nowhere): default "Contents", 目录 in a doc written in Chinese, `title=""` for none; on paper each with the page it is on after a line of dots, in Word as Word's own contents (its entries with the PDF's pages until Word's Update Table sets its own). The editor lists them, each a link.
197
197
 
198
- With `captions: numbered` in the front matter, a picture, a component or a chart with a caption (a chart's is its `title`) is numbered Figure 1, 2, 3, and a table with a `caption` Table 1, 2, 3; in a doc written in Chinese 图 1 and 表 1. A link with no words of its own to an `id` says the figure's or table's number, and to a heading's anchor (its words in lower case, spaces as hyphens, as GitHub writes them) its words:
198
+ Unless the front matter says `captions: plain`, a picture, a component or a chart with a caption (a chart's is its `title`, set under it as its caption on paper and in Word) is numbered Figure 1, 2, 3, and a table with a `caption` Table 1, 2, 3; in a doc written in Chinese 图 1 and 表 1. A link with no words of its own to an `id` says the figure's or table's number, and to a heading's anchor (its words in lower case, spaces as hyphens, as GitHub writes them) its words:
199
199
 
200
200
  ```mdx
201
201
  As [](#sales) shows, revenue doubled; [](#costs) lists the costs.
@@ -205,7 +205,7 @@ As [](#sales) shows, revenue doubled; [](#costs) lists the costs.
205
205
 
206
206
  ### Citations
207
207
 
208
- A citation is Pandoc's: `[@key]`, `[@a; @b]`, `[@key, p. 12]` in a line. Its sources are a CSL-JSON file (what Zotero, Mendeley and Pandoc export) the front matter's `bibliography` names, from the doc's folder. `<Bibliography />` on a line of its own is where they are listed; without it they are listed at the doc's end. `citation-style` is `apa` (the default: APA 7's author and year, `(Smith, 2019, p. 12)`, the list by author), `mla` (MLA 9's author and page, `(Smith 12)`, its Works Cited by author) or `gbt7714` (GB/T 7714's sources numbered in the order first cited, `[1]`, `[2-4]`). The list's heading is the doc's own (`## References`, `## Works Cited`). Only sources the doc cites are listed. The PDF, Word and Markdown set them as text; the editor shows each as it prints. A key the file does not hold, a file that is not there or not CSL-JSON, and citations with no `bibliography` are AK-M008.
208
+ A citation is Pandoc's: `[@key]`, `[@a; @b]`, `[@key, p. 12]` in a line. Its sources are a CSL-JSON file (what Zotero, Mendeley and Pandoc export) the front matter's `bibliography` names, from the doc's folder. `<Bibliography />` on a line of its own is where they are listed; without it they are listed at the doc's end. `citation-style` is `apa` (the default: APA 7's author and year, `(Smith, 2019, p. 12)`, the list by author), `mla` (MLA 9's author and page, `(Smith 12)`, its Works Cited by author) or `gbt7714` (GB/T 7714's sources numbered in the order first cited, `[1]`, `[2-4]`). The list's heading is the doc's own (`## References`, `## Works Cited`). Only sources the doc cites are listed. The PDF and Word set them as text; the editor shows each as it prints. A key the file does not hold, a file that is not there or not CSL-JSON, and citations with no `bibliography` are AK-M008.
209
209
 
210
210
  ### Equations and diagrams
211
211
 
@@ -241,7 +241,7 @@ A figure drawn by code is a component (`defineComponent`, [layers.md](layers.md#
241
241
  | `align` | `center` or `right` |
242
242
  | any other | A prop, read by its type: a `number()` from its digits, a `boolean()` from `true` or `false`, a `list()` or `object()` from JSON, anything else as written |
243
243
 
244
- It is drawn as a slide's component is, with the project's look (`var(--ak-color-*)`, `var(--ak-font-*)`, and the look's theme as `var(--ak-theme-*)`), its fonts and files. The editor draws it live, its props a field each when it is clicked; the PDF, Word, Markdown (`<name>.assets/`) and a read view show a still of it, drawn once and kept by what it shows. A wrong module, export or prop is AK-M008 at its line; an exception in its code is AK-R001.
244
+ It is drawn as a slide's component is, with the project's look (`var(--ak-color-*)`, `var(--ak-font-*)`, and the look's theme as `var(--ak-theme-*)`), its fonts and files. The editor draws it live, its props a field each when it is clicked; the PDF, Word and a read view show a still of it, drawn once and kept by what it shows. A wrong module, export or prop is AK-M008 at its line; an exception in its code is AK-R001.
245
245
 
246
246
  ### Kept as written
247
247
 
@@ -273,7 +273,7 @@ captions: numbered
273
273
 
274
274
  | Key | Means |
275
275
  | --- | --- |
276
- | `preset` | A convention that sets the keys below as it does; any key the doc writes wins over it. `report`: a report read on screen and on paper (the text 10.5 pt at 1.2 lines, 0.7 em after each paragraph, the title 24 pt, levels 1 and 2 at 18 and 14 pt with a hairline under them, level 3 at 11.5 pt), for figures (`<Stats>`), cards and tags. `apa`: APA 7's student paper (Letter at 1 in, Times 12 double-spaced, paragraphs set in 0.5 in with no space between them, the page number at the top right, the title and headings the text's size and bold, level 1 centred, levels 3 and 5 italic, APA citations). `mla`: MLA 9's paper (the same page; write the surname before the number: `header: { right: "Smith {page}" }`; the title centred and plain, MLA citations and Works Cited) |
276
+ | `preset` | A convention that sets the keys below as it does; any key the doc writes wins over it. `brief`: a brief read on screen and on paper (its earlier name `report` is read as it) (the text 10.5 pt at 1.2 lines, 0.7 em after each paragraph, the title 24 pt, levels 1 and 2 at 18 and 14 pt with a hairline under them, level 3 at 11.5 pt), for figures (`<Stats>`), cards and tags. `apa`: APA 7's student paper (Letter at 1 in, Times 12 double-spaced, paragraphs set in 0.5 in with no space between them, the page number at the top right, the title and headings the text's size and bold, level 1 centred, levels 3 and 5 italic, APA citations). `mla`: MLA 9's paper (the same page; write the surname before the number: `header: { right: "Smith {page}" }`; the title centred and plain, MLA citations and Works Cited). `memo`: Purdue OWL's memo (Letter at 1 in, Times 12 single-spaced, paragraphs flush left with a blank line between them, the title and headings the text's size and bold, the page number at the foot's centre; write the heading block, TO, FROM, DATE and SUBJECT, yourself). `business-letter`: Purdue OWL's block-format letter (the same page, no running head or foot and no page numbers; the date, inside address, salutation and closing are your paragraphs) |
277
277
  | `paper` | `Letter` (the default), `Legal`, `A4`, `A3`, `A5`, `B5`, or `[width, height]` in mm |
278
278
  | `orientation` | `portrait` (the default) or `landscape` |
279
279
  | `margins` | mm: one for all four, `[top and bottom, sides]`, or `[top, right, bottom, left]`; default 18 at the top and bottom, 20 at the sides |
@@ -286,7 +286,7 @@ captions: numbered
286
286
  | `grid` | Word's document grid: `{ chars: 28, lines: 22 }`, the line height and the spacing of characters made to fit the text area; headings are lines of it, and where a mark that may not start a line (,。、) would take the character before it down, the line's marks are set half wide at its end, as Word squeezes them, so a full line holds its characters |
287
287
  | `title`, `headings` | How the title and each heading level are set: `{ font, size, weight, align, italic, rule }` (`weight` is `normal` or `bold`, `align` `left`, `center` or `right`, `italic` `true` or `false`, `rule` `true` for a hairline under it, 3 pt below its text, as Word's paragraph border); `headings` by level, `2: { font: hei }` |
288
288
  | `header`, `footer` | What runs at the head and foot of every page: words (centred), `false`, or `{ left, center, right, outside, inside, font, size }` (`outside` is at the right of odd pages and the left of even ones). `{title}`, `{section}` (the top-level heading the page is in, as Word's STYLEREF finds it), `{page}` and `{pages}` stand for theirs. Default: no header, the title at the left of the foot and `{page} / {pages}` at its right. A page that opens with a cover has no header |
289
- | `captions` | `numbered`: figures and tables with a caption are numbered ([above](#contents-captions-and-references)); default `plain` |
289
+ | `captions` | `numbered` (the default): figures and tables with a caption are numbered ([above](#contents-captions-and-references)); `plain`: their captions stand without a number |
290
290
  | `bibliography`, `citation-style` | The sources the doc cites and how they are set ([above](#citations)) |
291
291
  | `accent` | A colour (the names above, or `#RRGGBB`): links, a quote's rule and a chart's first colour |
292
292
  | `cover` | A picture across the top of the page, as Notion's: its path from the doc's folder (it must be in the project, AK-M008), or an address. AllyHub's own covers, the editor's gallery: `allyhub doc cover list` names them, `allyhub doc cover set <doc> <name>` writes one beside the doc (`cover-<name>.svg`) and names it here. Edge to edge across the top, as Notion's: in the editor the page's width, about a third of the window high; on paper the first page's top, 64 mm high (`COVER_HEIGHT_MM`), with no margin around it; in Word the same band, floated at the page's corner; first in Markdown |
@@ -306,4 +306,4 @@ Without front matter the page is Letter, sans, with the default accent and no co
306
306
  - `allyhub check` reports AK-M008 for a doc whose file is not MDX, that holds what a doc does not draw (`{…}`, a tag inside a line other than the marks above, a wrong attribute or value), that shows a picture which is not in the project, that names a component which is not one or a prop it does not have, whose chart cannot be drawn from its numbers or whose equation is not TeX KaTeX reads, that cites a source its bibliography does not hold (or names a bibliography that is not CSL-JSON in the project); each problem has its file and line.
307
307
  - `allyhub inspect pages <doc>` measures its pages as `allyhub render` prints them, from the PDF itself, and says the facts with their raw numbers (mm on the paper, each block by its line in the doc's file): the space left at each page's foot, each block broken over pages with its lines (a table's rows) on each and whether its head repeats, a heading near a page's foot with the lines after it on its page, a paragraph's short last line, content past the column and what is cut at the paper's edge, a line that starts or ends with a mark Chinese type keeps off it, each numbered figure's page and the pages that name it, the text as a grid, and whether the contents' page numbers held. It draws the pages too, each block outlined and labelled by its line, the space at each foot shaded (`.allyhub/work/inspect/<place>/pages.webp`). They are facts, never problems: where a page breaks well is yours to judge. `--heading-lines` and `--short-line` say what is listed, `--all` lists every heading and last line.
308
308
  - `allyhub frames <doc>` draws its pages as `allyhub render` prints them, its components drawn first (the PDF printed and thrown away, each page drawn), tiled on one picture under `.allyhub/work/frames/<place>/`, and says how many pages there are and on what paper; `--page 2-3` draws those pages large. It is how to look at a doc and fit it to a length, and nothing is written to `.allyhub/out/`.
309
- - `allyhub render` prints each doc under `.allyhub/out/`, by its id, as `plan.pdf`; `--type png` writes a picture of the whole page (`plan.png`), `--type docx` a Word document (`plan.docx`: its text and its charts editable, a picture Word cannot show as a JPEG, an equation and a diagram as pictures), `--type md` plain Markdown (`plan.md`: what the doc says without what only a doc can say, a chart as its table of numbers), and `--type pdf,docx,png,md` all of them. A doc with a problem is not rendered: the command fails and says why. `allyhub help render` has every option.
309
+ - `allyhub render` prints each doc under `.allyhub/out/`, by its id, as `plan.pdf`; `--type png` writes a picture of the whole page (`plan.png`), `--type docx` a Word document (`plan.docx`: its text and its charts editable, a picture Word cannot show as a JPEG, an equation and a diagram as pictures), and `--type pdf,docx,png` all of them. There is no Markdown: the doc's MDX is its text. With a PDF or a Word document it says how the pages printed: how many, the share of each page's text area left empty at its foot, the blocks broken over pages (a Word document alone is printed once to measure it); `allyhub inspect pages` has every fact. A doc with a problem is not rendered: the command fails and says why. `allyhub help render` has every option.
package/docs/image.md CHANGED
@@ -59,7 +59,7 @@ A picture a board starts from is never changed: a pixel edit (a matte, a part re
59
59
  | `script` | a path with `{locale}` | none | Its script, from the module's folder, with `{locale}` once in its name for each language (`./friends.{locale}.yaml`) |
60
60
  | `matrix` | `Matrix` | the project's languages and its script's | Dimensions and slots, as a video's ([batches.md](batches.md)): each combo is a set of the boards |
61
61
  | `id`, `title`, `meta` | | its module's file without its extension; the script's `title` | As a video's |
62
- | `transparent` | `boolean` | `false` | No background: PNG, WebP and AVIF keep the alpha channel |
62
+ | `transparent` | `boolean` | `false` | No background: PNG and WebP keep the alpha channel |
63
63
 
64
64
  ## `board()`
65
65
 
@@ -141,9 +141,9 @@ An image's viewer shows every board of every version, each drawn live, to zoom,
141
141
  - `allyhub check` reports what cannot be drawn: a size that does not exist (AK-I001), a name used twice (AK-I002), a layer without a name (AK-I003), an image with no boards (AK-I005), what Chrome cannot draw exactly (AK-I007), and what any version reports: a picture that does not load (AK-A005), a fallback font (AK-L006), text the board's edge cuts (AK-L002), a board drawn differently in order and out of order (AK-D002).
142
142
  - `allyhub frames <image>` draws every board on one sheet, each named by its key and size; `--part <key>` one board at its own size.
143
143
  - `allyhub inspect <image>` gives `board` (each board's size and where it came from), `board-consistency` (a named layer's box, cap height and colour on every board that has it, and their spread, ΔE in OKLab), `picture-scale` (a picture's source pixels against the board pixels they fill), `overset` (a type layer's words its paragraph box does not hold: its lines and characters and those past the box's bottom, how far past; the box does not cut them, so this is a fact, not a rule), `generated`, `text-contrast` and the layout facts of one frame for each board.
144
- - `allyhub render <image>` makes a PNG a board (`<item>.<combo>/<key>.png`); `--type jpeg`, `webp` and `avif` the same in those; `pdf` one file, a page a board at its own size, its text as text; `zip` the set, each board a PNG. `--param quality=…` (0–100) sets JPEG, WebP and AVIF quality ([defaults.md](defaults.md)); `psd` a layered Photoshop file a board (below).
144
+ - `allyhub render <image>` makes a PNG a board (`<item>.<combo>/<key>.png`); `--type jpeg` and `webp` the same in those; `pdf` one file, a page a board at its own size, its text as text; `zip` the set, each board a PNG. `--param quality=…` (0–100) sets JPEG and WebP quality ([defaults.md](defaults.md)); `psd` a layered Photoshop file a board (below).
145
145
  - A board's picture larger or smaller than the board, its layout kept: `--param scale=2` (0.25 to 4), or `width=…` or `height=…` in pixels (the other side in proportion, a scale for each board). Chrome draws it at that scale, so type and shapes are sharp; a picture has only the pixels its file has (`picture-scale` in `allyhub inspect`). A picture is at most 16384 px a side. A board of another shape is another board, in the code.
146
- - `--param max-kb=…` keeps each board's JPEG, WebP or AVIF at most that many KB, at the best quality under it, which the render says (`chosen`); one that is over it at every quality, or a PNG over it (a PNG keeps every pixel), is not made, and the render says why.
146
+ - `--param max-kb=…` keeps each board's JPEG or WebP at most that many KB, at the best quality under it, which the render says (`chosen`); one that is over it at every quality, or a PNG over it (a PNG keeps every pixel), is not made, and the render says why.
147
147
 
148
148
  ## PSD: out and in
149
149