@iksnerd/blazon 0.0.0-stage → 0.1.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 (503) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +264 -2
  3. package/THIRD-PARTY-NOTICES.md +60 -0
  4. package/bin/blazon.js +4 -0
  5. package/dist/builder/site-builder.d.ts +10 -0
  6. package/dist/builder/site-builder.d.ts.map +1 -0
  7. package/dist/chunks/site-builder-vpzUWoiA.js +13777 -0
  8. package/dist/cli/commands/approvals.d.ts +8 -0
  9. package/dist/cli/commands/approvals.d.ts.map +1 -0
  10. package/dist/cli/commands/build.d.ts +8 -0
  11. package/dist/cli/commands/build.d.ts.map +1 -0
  12. package/dist/cli/commands/check.d.ts +33 -0
  13. package/dist/cli/commands/check.d.ts.map +1 -0
  14. package/dist/cli/commands/cwd.d.ts +14 -0
  15. package/dist/cli/commands/cwd.d.ts.map +1 -0
  16. package/dist/cli/commands/dev.d.ts +5 -0
  17. package/dist/cli/commands/dev.d.ts.map +1 -0
  18. package/dist/cli/commands/doctor.d.ts +34 -0
  19. package/dist/cli/commands/doctor.d.ts.map +1 -0
  20. package/dist/cli/commands/drift.d.ts +11 -0
  21. package/dist/cli/commands/drift.d.ts.map +1 -0
  22. package/dist/cli/commands/explain.d.ts +5 -0
  23. package/dist/cli/commands/explain.d.ts.map +1 -0
  24. package/dist/cli/commands/init.d.ts +46 -0
  25. package/dist/cli/commands/init.d.ts.map +1 -0
  26. package/dist/cli/commands/mcp-check.d.ts +57 -0
  27. package/dist/cli/commands/mcp-check.d.ts.map +1 -0
  28. package/dist/cli/commands/mcp.d.ts +13 -0
  29. package/dist/cli/commands/mcp.d.ts.map +1 -0
  30. package/dist/cli/commands/pin.d.ts +7 -0
  31. package/dist/cli/commands/pin.d.ts.map +1 -0
  32. package/dist/cli/commands/plugin.d.ts +32 -0
  33. package/dist/cli/commands/plugin.d.ts.map +1 -0
  34. package/dist/cli/commands/preview.d.ts +5 -0
  35. package/dist/cli/commands/preview.d.ts.map +1 -0
  36. package/dist/cli/commands/tokens.d.ts +5 -0
  37. package/dist/cli/commands/tokens.d.ts.map +1 -0
  38. package/dist/cli/errors.d.ts +53 -0
  39. package/dist/cli/errors.d.ts.map +1 -0
  40. package/dist/cli/handlers/brand.d.ts +7 -0
  41. package/dist/cli/handlers/brand.d.ts.map +1 -0
  42. package/dist/cli/handlers/can.d.ts +7 -0
  43. package/dist/cli/handlers/can.d.ts.map +1 -0
  44. package/dist/cli/handlers/fonts.d.ts +4 -0
  45. package/dist/cli/handlers/fonts.d.ts.map +1 -0
  46. package/dist/cli/handlers/get.d.ts +7 -0
  47. package/dist/cli/handlers/get.d.ts.map +1 -0
  48. package/dist/cli/handlers/index.d.ts +8 -0
  49. package/dist/cli/handlers/index.d.ts.map +1 -0
  50. package/dist/cli/handlers/list.d.ts +7 -0
  51. package/dist/cli/handlers/list.d.ts.map +1 -0
  52. package/dist/cli/handlers/logo.d.ts +4 -0
  53. package/dist/cli/handlers/logo.d.ts.map +1 -0
  54. package/dist/cli/handlers/rules.d.ts +10 -0
  55. package/dist/cli/handlers/rules.d.ts.map +1 -0
  56. package/dist/cli/handlers/types.d.ts +17 -0
  57. package/dist/cli/handlers/types.d.ts.map +1 -0
  58. package/dist/cli/help.d.ts +18 -0
  59. package/dist/cli/help.d.ts.map +1 -0
  60. package/dist/cli/index.d.ts +2 -0
  61. package/dist/cli/index.d.ts.map +1 -0
  62. package/dist/cli/index.js +3850 -0
  63. package/dist/cli/init-flow.d.ts +24 -0
  64. package/dist/cli/init-flow.d.ts.map +1 -0
  65. package/dist/cli/init-ui.d.ts +20 -0
  66. package/dist/cli/init-ui.d.ts.map +1 -0
  67. package/dist/cli/json.d.ts +18 -0
  68. package/dist/cli/json.d.ts.map +1 -0
  69. package/dist/cli/operations.d.ts +11 -0
  70. package/dist/cli/operations.d.ts.map +1 -0
  71. package/dist/cli/options.d.ts +8 -0
  72. package/dist/cli/options.d.ts.map +1 -0
  73. package/dist/cli/project.d.ts +8 -0
  74. package/dist/cli/project.d.ts.map +1 -0
  75. package/dist/cli/read.d.ts +13 -0
  76. package/dist/cli/read.d.ts.map +1 -0
  77. package/dist/cli/where.d.ts +10 -0
  78. package/dist/cli/where.d.ts.map +1 -0
  79. package/dist/core/assets/categories.d.ts +47 -0
  80. package/dist/core/assets/categories.d.ts.map +1 -0
  81. package/dist/core/assets/fields.d.ts +12 -0
  82. package/dist/core/assets/fields.d.ts.map +1 -0
  83. package/dist/core/assets/image-size.d.ts +10 -0
  84. package/dist/core/assets/image-size.d.ts.map +1 -0
  85. package/dist/core/assets/measure.d.ts +22 -0
  86. package/dist/core/assets/measure.d.ts.map +1 -0
  87. package/dist/core/assets/scanner.d.ts +26 -0
  88. package/dist/core/assets/scanner.d.ts.map +1 -0
  89. package/dist/core/assets/sidecar.d.ts +22 -0
  90. package/dist/core/assets/sidecar.d.ts.map +1 -0
  91. package/dist/core/blazon-pin.d.ts +36 -0
  92. package/dist/core/blazon-pin.d.ts.map +1 -0
  93. package/dist/core/brand/export.d.ts +128 -0
  94. package/dist/core/brand/export.d.ts.map +1 -0
  95. package/dist/core/brand/schema.d.ts +1000 -0
  96. package/dist/core/brand/schema.d.ts.map +1 -0
  97. package/dist/core/brand-theme.d.ts +16 -0
  98. package/dist/core/brand-theme.d.ts.map +1 -0
  99. package/dist/core/checker/approvals.d.ts +15 -0
  100. package/dist/core/checker/approvals.d.ts.map +1 -0
  101. package/dist/core/checker/cascade.d.ts +8 -0
  102. package/dist/core/checker/cascade.d.ts.map +1 -0
  103. package/dist/core/checker/catalogue.d.ts +593 -0
  104. package/dist/core/checker/catalogue.d.ts.map +1 -0
  105. package/dist/core/checker/contrast.d.ts +30 -0
  106. package/dist/core/checker/contrast.d.ts.map +1 -0
  107. package/dist/core/checker/duplicates.d.ts +3 -0
  108. package/dist/core/checker/duplicates.d.ts.map +1 -0
  109. package/dist/core/checker/fixes.d.ts +6 -0
  110. package/dist/core/checker/fixes.d.ts.map +1 -0
  111. package/dist/core/checker/font-meta.d.ts +8 -0
  112. package/dist/core/checker/font-meta.d.ts.map +1 -0
  113. package/dist/core/checker/index.d.ts +23 -0
  114. package/dist/core/checker/index.d.ts.map +1 -0
  115. package/dist/core/checker/location.d.ts +7 -0
  116. package/dist/core/checker/location.d.ts.map +1 -0
  117. package/dist/core/checker/logo-rules.d.ts +19 -0
  118. package/dist/core/checker/logo-rules.d.ts.map +1 -0
  119. package/dist/core/checker/logo-surfaces.d.ts +7 -0
  120. package/dist/core/checker/logo-surfaces.d.ts.map +1 -0
  121. package/dist/core/checker/page-tokens.d.ts +5 -0
  122. package/dist/core/checker/page-tokens.d.ts.map +1 -0
  123. package/dist/core/checker/print.d.ts +9 -0
  124. package/dist/core/checker/print.d.ts.map +1 -0
  125. package/dist/core/checker/proportion.d.ts +3 -0
  126. package/dist/core/checker/proportion.d.ts.map +1 -0
  127. package/dist/core/checker/review.d.ts +40 -0
  128. package/dist/core/checker/review.d.ts.map +1 -0
  129. package/dist/core/checker/source.d.ts +4 -0
  130. package/dist/core/checker/source.d.ts.map +1 -0
  131. package/dist/core/checker/spdx.d.ts +8 -0
  132. package/dist/core/checker/spdx.d.ts.map +1 -0
  133. package/dist/core/checker/tier.d.ts +3 -0
  134. package/dist/core/checker/tier.d.ts.map +1 -0
  135. package/dist/core/checker/usage.d.ts +4 -0
  136. package/dist/core/checker/usage.d.ts.map +1 -0
  137. package/dist/core/checker/variables.d.ts +8 -0
  138. package/dist/core/checker/variables.d.ts.map +1 -0
  139. package/dist/core/colors.d.ts +10 -0
  140. package/dist/core/colors.d.ts.map +1 -0
  141. package/dist/core/config/defaults.d.ts +3 -0
  142. package/dist/core/config/defaults.d.ts.map +1 -0
  143. package/dist/core/config/index.d.ts +15 -0
  144. package/dist/core/config/index.d.ts.map +1 -0
  145. package/dist/core/config/validate.d.ts +21 -0
  146. package/dist/core/config/validate.d.ts.map +1 -0
  147. package/dist/core/config/vocabulary.d.ts +10 -0
  148. package/dist/core/config/vocabulary.d.ts.map +1 -0
  149. package/dist/core/confine.d.ts +25 -0
  150. package/dist/core/confine.d.ts.map +1 -0
  151. package/dist/core/docs/directives.d.ts +152 -0
  152. package/dist/core/docs/directives.d.ts.map +1 -0
  153. package/dist/core/docs/parser.d.ts +7 -0
  154. package/dist/core/docs/parser.d.ts.map +1 -0
  155. package/dist/core/docs/sections.d.ts +11 -0
  156. package/dist/core/docs/sections.d.ts.map +1 -0
  157. package/dist/core/drift/compare.d.ts +30 -0
  158. package/dist/core/drift/compare.d.ts.map +1 -0
  159. package/dist/core/drift/read.d.ts +22 -0
  160. package/dist/core/drift/read.d.ts.map +1 -0
  161. package/dist/core/email-signature.d.ts +35 -0
  162. package/dist/core/email-signature.d.ts.map +1 -0
  163. package/dist/core/emit.d.ts +22 -0
  164. package/dist/core/emit.d.ts.map +1 -0
  165. package/dist/core/fonts.d.ts +43 -0
  166. package/dist/core/fonts.d.ts.map +1 -0
  167. package/dist/core/icons/icon-sets.d.ts +22 -0
  168. package/dist/core/icons/icon-sets.d.ts.map +1 -0
  169. package/dist/core/index.d.ts +9 -0
  170. package/dist/core/index.d.ts.map +1 -0
  171. package/dist/core/init/answers.d.ts +45 -0
  172. package/dist/core/init/answers.d.ts.map +1 -0
  173. package/dist/core/init/from-site/apply.d.ts +7 -0
  174. package/dist/core/init/from-site/apply.d.ts.map +1 -0
  175. package/dist/core/init/from-site/clean-colors.d.ts +21 -0
  176. package/dist/core/init/from-site/clean-colors.d.ts.map +1 -0
  177. package/dist/core/init/from-site/colors.d.ts +10 -0
  178. package/dist/core/init/from-site/colors.d.ts.map +1 -0
  179. package/dist/core/init/from-site/context.d.ts +24 -0
  180. package/dist/core/init/from-site/context.d.ts.map +1 -0
  181. package/dist/core/init/from-site/fonts.d.ts +10 -0
  182. package/dist/core/init/from-site/fonts.d.ts.map +1 -0
  183. package/dist/core/init/from-site/html.d.ts +10 -0
  184. package/dist/core/init/from-site/html.d.ts.map +1 -0
  185. package/dist/core/init/from-site/index.d.ts +6 -0
  186. package/dist/core/init/from-site/index.d.ts.map +1 -0
  187. package/dist/core/init/from-site/inspect.d.ts +4 -0
  188. package/dist/core/init/from-site/inspect.d.ts.map +1 -0
  189. package/dist/core/init/from-site/logo.d.ts +20 -0
  190. package/dist/core/init/from-site/logo.d.ts.map +1 -0
  191. package/dist/core/init/from-site/sections/colors.d.ts +4 -0
  192. package/dist/core/init/from-site/sections/colors.d.ts.map +1 -0
  193. package/dist/core/init/from-site/sections/config.d.ts +10 -0
  194. package/dist/core/init/from-site/sections/config.d.ts.map +1 -0
  195. package/dist/core/init/from-site/sections/directives.d.ts +3 -0
  196. package/dist/core/init/from-site/sections/directives.d.ts.map +1 -0
  197. package/dist/core/init/from-site/sections/fonts.d.ts +8 -0
  198. package/dist/core/init/from-site/sections/fonts.d.ts.map +1 -0
  199. package/dist/core/init/from-site/sections/intro.d.ts +4 -0
  200. package/dist/core/init/from-site/sections/intro.d.ts.map +1 -0
  201. package/dist/core/init/from-site/sections/logo.d.ts +9 -0
  202. package/dist/core/init/from-site/sections/logo.d.ts.map +1 -0
  203. package/dist/core/init/from-site/sections/placeholder.d.ts +5 -0
  204. package/dist/core/init/from-site/sections/placeholder.d.ts.map +1 -0
  205. package/dist/core/init/from-site/tree.d.ts +14 -0
  206. package/dist/core/init/from-site/tree.d.ts.map +1 -0
  207. package/dist/core/init/from-site/types.d.ts +37 -0
  208. package/dist/core/init/from-site/types.d.ts.map +1 -0
  209. package/dist/core/init/palette.d.ts +34 -0
  210. package/dist/core/init/palette.d.ts.map +1 -0
  211. package/dist/core/init/prompts.d.ts +78 -0
  212. package/dist/core/init/prompts.d.ts.map +1 -0
  213. package/dist/core/init/shared/google-fonts.d.ts +4 -0
  214. package/dist/core/init/shared/google-fonts.d.ts.map +1 -0
  215. package/dist/core/init/shared/hex.d.ts +6 -0
  216. package/dist/core/init/shared/hex.d.ts.map +1 -0
  217. package/dist/core/init/shared/svg.d.ts +3 -0
  218. package/dist/core/init/shared/svg.d.ts.map +1 -0
  219. package/dist/core/init/vocabulary.d.ts +42 -0
  220. package/dist/core/init/vocabulary.d.ts.map +1 -0
  221. package/dist/core/inputs.d.ts +25 -0
  222. package/dist/core/inputs.d.ts.map +1 -0
  223. package/dist/core/logo/lockup.d.ts +54 -0
  224. package/dist/core/logo/lockup.d.ts.map +1 -0
  225. package/dist/core/logo.d.ts +23 -0
  226. package/dist/core/logo.d.ts.map +1 -0
  227. package/dist/core/mcp-config.d.ts +65 -0
  228. package/dist/core/mcp-config.d.ts.map +1 -0
  229. package/dist/core/operations/check.d.ts +8 -0
  230. package/dist/core/operations/check.d.ts.map +1 -0
  231. package/dist/core/operations/index.d.ts +7 -0
  232. package/dist/core/operations/index.d.ts.map +1 -0
  233. package/dist/core/operations/limits.d.ts +6 -0
  234. package/dist/core/operations/limits.d.ts.map +1 -0
  235. package/dist/core/operations/list.d.ts +8 -0
  236. package/dist/core/operations/list.d.ts.map +1 -0
  237. package/dist/core/operations/project.d.ts +10 -0
  238. package/dist/core/operations/project.d.ts.map +1 -0
  239. package/dist/core/operations/types.d.ts +96 -0
  240. package/dist/core/operations/types.d.ts.map +1 -0
  241. package/dist/core/operations/validate.d.ts +4 -0
  242. package/dist/core/operations/validate.d.ts.map +1 -0
  243. package/dist/core/order.d.ts +9 -0
  244. package/dist/core/order.d.ts.map +1 -0
  245. package/dist/core/outputs.d.ts +22 -0
  246. package/dist/core/outputs.d.ts.map +1 -0
  247. package/dist/core/package-name.d.ts +3 -0
  248. package/dist/core/package-name.d.ts.map +1 -0
  249. package/dist/core/package-root.d.ts +3 -0
  250. package/dist/core/package-root.d.ts.map +1 -0
  251. package/dist/core/plugin-name.d.ts +27 -0
  252. package/dist/core/plugin-name.d.ts.map +1 -0
  253. package/dist/core/preflight.d.ts +10 -0
  254. package/dist/core/preflight.d.ts.map +1 -0
  255. package/dist/core/read/can.d.ts +44 -0
  256. package/dist/core/read/can.d.ts.map +1 -0
  257. package/dist/core/read/fonts.d.ts +47 -0
  258. package/dist/core/read/fonts.d.ts.map +1 -0
  259. package/dist/core/read/index.d.ts +8 -0
  260. package/dist/core/read/index.d.ts.map +1 -0
  261. package/dist/core/read/list.d.ts +28 -0
  262. package/dist/core/read/list.d.ts.map +1 -0
  263. package/dist/core/read/logo.d.ts +34 -0
  264. package/dist/core/read/logo.d.ts.map +1 -0
  265. package/dist/core/read/lookup.d.ts +9 -0
  266. package/dist/core/read/lookup.d.ts.map +1 -0
  267. package/dist/core/read/rules.d.ts +80 -0
  268. package/dist/core/read/rules.d.ts.map +1 -0
  269. package/dist/core/read/token.d.ts +46 -0
  270. package/dist/core/read/token.d.ts.map +1 -0
  271. package/dist/core/shipped-names.d.ts +9 -0
  272. package/dist/core/shipped-names.d.ts.map +1 -0
  273. package/dist/core/starter.d.ts +31 -0
  274. package/dist/core/starter.d.ts.map +1 -0
  275. package/dist/core/suggest.d.ts +7 -0
  276. package/dist/core/suggest.d.ts.map +1 -0
  277. package/dist/core/tokens/alias.d.ts +18 -0
  278. package/dist/core/tokens/alias.d.ts.map +1 -0
  279. package/dist/core/tokens/contexts.d.ts +10 -0
  280. package/dist/core/tokens/contexts.d.ts.map +1 -0
  281. package/dist/core/tokens/formatters/css.d.ts +15 -0
  282. package/dist/core/tokens/formatters/css.d.ts.map +1 -0
  283. package/dist/core/tokens/formatters/json.d.ts +4 -0
  284. package/dist/core/tokens/formatters/json.d.ts.map +1 -0
  285. package/dist/core/tokens/formatters/tailwind.d.ts +37 -0
  286. package/dist/core/tokens/formatters/tailwind.d.ts.map +1 -0
  287. package/dist/core/tokens/formatters/ts.d.ts +6 -0
  288. package/dist/core/tokens/formatters/ts.d.ts.map +1 -0
  289. package/dist/core/tokens/groups.d.ts +44 -0
  290. package/dist/core/tokens/groups.d.ts.map +1 -0
  291. package/dist/core/tokens/key-lines.d.ts +8 -0
  292. package/dist/core/tokens/key-lines.d.ts.map +1 -0
  293. package/dist/core/tokens/load.d.ts +12 -0
  294. package/dist/core/tokens/load.d.ts.map +1 -0
  295. package/dist/core/tokens/merge.d.ts +17 -0
  296. package/dist/core/tokens/merge.d.ts.map +1 -0
  297. package/dist/core/tokens/names.d.ts +5 -0
  298. package/dist/core/tokens/names.d.ts.map +1 -0
  299. package/dist/core/tokens/resolve.d.ts +8 -0
  300. package/dist/core/tokens/resolve.d.ts.map +1 -0
  301. package/dist/core/tokens/resolver/compile.d.ts +17 -0
  302. package/dist/core/tokens/resolver/compile.d.ts.map +1 -0
  303. package/dist/core/tokens/resolver/inputs.d.ts +7 -0
  304. package/dist/core/tokens/resolver/inputs.d.ts.map +1 -0
  305. package/dist/core/tokens/resolver/parse.d.ts +34 -0
  306. package/dist/core/tokens/resolver/parse.d.ts.map +1 -0
  307. package/dist/core/tokens/resolver/sources.d.ts +17 -0
  308. package/dist/core/tokens/resolver/sources.d.ts.map +1 -0
  309. package/dist/core/tokens/shadcn.d.ts +43 -0
  310. package/dist/core/tokens/shadcn.d.ts.map +1 -0
  311. package/dist/core/tokens/theme.d.ts +17 -0
  312. package/dist/core/tokens/theme.d.ts.map +1 -0
  313. package/dist/core/tokens/values/color.d.ts +2 -0
  314. package/dist/core/tokens/values/color.d.ts.map +1 -0
  315. package/dist/core/tokens/values/composite.d.ts +7 -0
  316. package/dist/core/tokens/values/composite.d.ts.map +1 -0
  317. package/dist/core/tokens/values/font.d.ts +3 -0
  318. package/dist/core/tokens/values/font.d.ts.map +1 -0
  319. package/dist/core/tokens/values/index.d.ts +9 -0
  320. package/dist/core/tokens/values/index.d.ts.map +1 -0
  321. package/dist/core/tokens/values/shared.d.ts +5 -0
  322. package/dist/core/tokens/values/shared.d.ts.map +1 -0
  323. package/dist/core/tokens/values/simple.d.ts +3 -0
  324. package/dist/core/tokens/values/simple.d.ts.map +1 -0
  325. package/dist/core/tokens/values/units.d.ts +3 -0
  326. package/dist/core/tokens/values/units.d.ts.map +1 -0
  327. package/dist/core/tokens/walk.d.ts +30 -0
  328. package/dist/core/tokens/walk.d.ts.map +1 -0
  329. package/dist/core/version.d.ts +3 -0
  330. package/dist/core/version.d.ts.map +1 -0
  331. package/dist/index.d.ts +27 -0
  332. package/dist/index.d.ts.map +1 -0
  333. package/dist/index.js +40 -0
  334. package/dist/plugins/host/admit.d.ts +35 -0
  335. package/dist/plugins/host/admit.d.ts.map +1 -0
  336. package/dist/plugins/host/call.d.ts +59 -0
  337. package/dist/plugins/host/call.d.ts.map +1 -0
  338. package/dist/plugins/host/check.d.ts +54 -0
  339. package/dist/plugins/host/check.d.ts.map +1 -0
  340. package/dist/plugins/host/scrub.d.ts +17 -0
  341. package/dist/plugins/host/scrub.d.ts.map +1 -0
  342. package/dist/plugins/index.d.ts +14 -0
  343. package/dist/plugins/index.d.ts.map +1 -0
  344. package/dist/plugins/pins/interpreter.d.ts +49 -0
  345. package/dist/plugins/pins/interpreter.d.ts.map +1 -0
  346. package/dist/plugins/pins/lock.d.ts +47 -0
  347. package/dist/plugins/pins/lock.d.ts.map +1 -0
  348. package/dist/plugins/pins/pin.d.ts +65 -0
  349. package/dist/plugins/pins/pin.d.ts.map +1 -0
  350. package/dist/plugins/pins/shipped.d.ts +40 -0
  351. package/dist/plugins/pins/shipped.d.ts.map +1 -0
  352. package/dist/plugins/roles/breaker.d.ts +18 -0
  353. package/dist/plugins/roles/breaker.d.ts.map +1 -0
  354. package/dist/plugins/roles/check-cases.d.ts +4 -0
  355. package/dist/plugins/roles/check-cases.d.ts.map +1 -0
  356. package/dist/plugins/roles/dev.d.ts +35 -0
  357. package/dist/plugins/roles/dev.d.ts.map +1 -0
  358. package/dist/plugins/roles/fixes.d.ts +24 -0
  359. package/dist/plugins/roles/fixes.d.ts.map +1 -0
  360. package/dist/plugins/roles/gate.d.ts +26 -0
  361. package/dist/plugins/roles/gate.d.ts.map +1 -0
  362. package/dist/plugins/roles/integrate.d.ts +12 -0
  363. package/dist/plugins/roles/integrate.d.ts.map +1 -0
  364. package/dist/plugins/roles/roles.d.ts +69 -0
  365. package/dist/plugins/roles/roles.d.ts.map +1 -0
  366. package/dist/plugins/wire/environment.d.ts +9 -0
  367. package/dist/plugins/wire/environment.d.ts.map +1 -0
  368. package/dist/plugins/wire/forms.d.ts +13 -0
  369. package/dist/plugins/wire/forms.d.ts.map +1 -0
  370. package/dist/plugins/wire/limits.d.ts +11 -0
  371. package/dist/plugins/wire/limits.d.ts.map +1 -0
  372. package/dist/plugins/wire/manifest.d.ts +31 -0
  373. package/dist/plugins/wire/manifest.d.ts.map +1 -0
  374. package/dist/plugins/wire/profile.d.ts +36 -0
  375. package/dist/plugins/wire/profile.d.ts.map +1 -0
  376. package/dist/plugins/wire/text.d.ts +14 -0
  377. package/dist/plugins/wire/text.d.ts.map +1 -0
  378. package/dist/server/assets.d.ts +13 -0
  379. package/dist/server/assets.d.ts.map +1 -0
  380. package/dist/server/coalesce.d.ts +12 -0
  381. package/dist/server/coalesce.d.ts.map +1 -0
  382. package/dist/server/data-script.d.ts +8 -0
  383. package/dist/server/data-script.d.ts.map +1 -0
  384. package/dist/server/dev-server.d.ts +34 -0
  385. package/dist/server/dev-server.d.ts.map +1 -0
  386. package/dist/server/editor-guard.d.ts +13 -0
  387. package/dist/server/editor-guard.d.ts.map +1 -0
  388. package/dist/server/error-reporter.d.ts +11 -0
  389. package/dist/server/error-reporter.d.ts.map +1 -0
  390. package/dist/server/icon-sets.d.ts +9 -0
  391. package/dist/server/icon-sets.d.ts.map +1 -0
  392. package/dist/server/plugin.d.ts +4 -0
  393. package/dist/server/plugin.d.ts.map +1 -0
  394. package/dist/server/preview-guard.d.ts +11 -0
  395. package/dist/server/preview-guard.d.ts.map +1 -0
  396. package/dist/types/assets.d.ts +130 -0
  397. package/dist/types/assets.d.ts.map +1 -0
  398. package/dist/types/catalog.d.ts +95 -0
  399. package/dist/types/catalog.d.ts.map +1 -0
  400. package/dist/types/config.d.ts +97 -0
  401. package/dist/types/config.d.ts.map +1 -0
  402. package/dist/types/data.d.ts +38 -0
  403. package/dist/types/data.d.ts.map +1 -0
  404. package/dist/types/docs.d.ts +47 -0
  405. package/dist/types/docs.d.ts.map +1 -0
  406. package/dist/types/findings.d.ts +18 -0
  407. package/dist/types/findings.d.ts.map +1 -0
  408. package/dist/types/index.d.ts +13 -0
  409. package/dist/types/index.d.ts.map +1 -0
  410. package/dist/types/parsed.d.ts +86 -0
  411. package/dist/types/parsed.d.ts.map +1 -0
  412. package/dist/types/theme.d.ts +19 -0
  413. package/dist/types/theme.d.ts.map +1 -0
  414. package/dist/types/tokens.d.ts +101 -0
  415. package/dist/types/tokens.d.ts.map +1 -0
  416. package/dist/ui/assets/geist-OFL.txt +93 -0
  417. package/dist/ui/assets/geist-cyrillic-ext-wght-normal-DjL33-gN.woff2 +0 -0
  418. package/dist/ui/assets/geist-cyrillic-wght-normal-BEAKL7Jp.woff2 +0 -0
  419. package/dist/ui/assets/geist-latin-ext-wght-normal-DC-KSUi6.woff2 +0 -0
  420. package/dist/ui/assets/geist-latin-wght-normal-BgDaEnEv.woff2 +0 -0
  421. package/dist/ui/assets/geist-vietnamese-wght-normal-6IgcOCM7.woff2 +0 -0
  422. package/dist/ui/assets/index-BdbihVvH.js +77 -0
  423. package/dist/ui/assets/index-DluSqfla.css +2 -0
  424. package/dist/ui/index.html +14 -0
  425. package/package.json +151 -4
  426. package/plugins/blazon.brand-deck/README.md +38 -0
  427. package/plugins/blazon.brand-deck/bin/blazon-blazon.brand-deck./360/237/224/214 +2695 -0
  428. package/plugins/blazon.brand-deck/package.json +3 -0
  429. package/plugins/blazon.copy/README.md +29 -0
  430. package/plugins/blazon.copy/bin/blazon-blazon.copy./360/237/224/214 +438 -0
  431. package/plugins/blazon.copy/package.json +3 -0
  432. package/plugins/blazon.favicons/README.md +13 -0
  433. package/plugins/blazon.favicons/bin/blazon-blazon.favicons./360/237/224/214 +8816 -0
  434. package/plugins/blazon.favicons/package.json +3 -0
  435. package/plugins/blazon.logo-geometry/README.md +5 -0
  436. package/plugins/blazon.logo-geometry/bin/blazon-blazon.logo-geometry./360/237/224/214 +1522 -0
  437. package/plugins/blazon.logo-geometry/package.json +3 -0
  438. package/plugins/blazon.logo-kit/README.md +5 -0
  439. package/plugins/blazon.logo-kit/bin/blazon-blazon.logo-kit./360/237/224/214 +617 -0
  440. package/plugins/blazon.logo-kit/package.json +3 -0
  441. package/plugins/blazon.office-template/README.md +29 -0
  442. package/plugins/blazon.office-template/bin/blazon-blazon.office-template./360/237/224/214 +1788 -0
  443. package/plugins/blazon.office-template/package.json +3 -0
  444. package/plugins/blazon.platform-tokens/README.md +22 -0
  445. package/plugins/blazon.platform-tokens/bin/blazon-blazon.platform-tokens./360/237/224/214 +8418 -0
  446. package/plugins/blazon.platform-tokens/package.json +3 -0
  447. package/plugins/blazon.press-kit/README.md +17 -0
  448. package/plugins/blazon.press-kit/bin/blazon-blazon.press-kit./360/237/224/214 +897 -0
  449. package/plugins/blazon.press-kit/package.json +3 -0
  450. package/plugins/blazon.print-book/README.md +38 -0
  451. package/plugins/blazon.print-book/bin/blazon-blazon.print-book./360/237/224/214 +9262 -0
  452. package/plugins/blazon.print-book/package.json +3 -0
  453. package/plugins/blazon.social-cards/README.md +5 -0
  454. package/plugins/blazon.social-cards/bin/blazon-blazon.social-cards./360/237/224/214 +1165 -0
  455. package/plugins/blazon.social-cards/package.json +3 -0
  456. package/plugins/shipped.lock +75 -0
  457. package/template/AGENTS.md +55 -0
  458. package/template/CLAUDE.md +1 -0
  459. package/template/assets/backgrounds/aurora.json +5 -0
  460. package/template/assets/backgrounds/aurora.svg +39 -0
  461. package/template/assets/construction/blazon-mark.json +9 -0
  462. package/template/assets/construction/blazon-mark.svg +54 -0
  463. package/template/assets/icons/arrow-right.json +5 -0
  464. package/template/assets/icons/arrow-right.svg +1 -0
  465. package/template/assets/icons/check.json +5 -0
  466. package/template/assets/icons/check.svg +1 -0
  467. package/template/assets/icons/download.json +5 -0
  468. package/template/assets/icons/download.svg +1 -0
  469. package/template/assets/icons/file.json +5 -0
  470. package/template/assets/icons/file.svg +1 -0
  471. package/template/assets/icons/token.json +5 -0
  472. package/template/assets/icons/token.svg +1 -0
  473. package/template/assets/icons/warning.json +5 -0
  474. package/template/assets/icons/warning.svg +1 -0
  475. package/template/assets/logos/blazon-bone.json +6 -0
  476. package/template/assets/logos/blazon-bone.svg +1 -0
  477. package/template/assets/logos/blazon-graphite.json +6 -0
  478. package/template/assets/logos/blazon-graphite.svg +1 -0
  479. package/template/assets/logos/blazon-mark.json +6 -0
  480. package/template/assets/logos/blazon-mark.svg +1 -0
  481. package/template/blazon.json +104 -0
  482. package/template/blazon.resolver.json +46 -0
  483. package/template/docs/01-principles.md +47 -0
  484. package/template/docs/02-logo.md +43 -0
  485. package/template/docs/03-color.md +79 -0
  486. package/template/docs/04-type.md +36 -0
  487. package/template/docs/05-form.md +80 -0
  488. package/template/docs/06-layout.md +28 -0
  489. package/template/docs/07-icons.md +22 -0
  490. package/template/docs/08-diagrams.md +20 -0
  491. package/template/docs/09-social.md +21 -0
  492. package/template/docs/10-applications.md +20 -0
  493. package/template/docs/11-voice.md +74 -0
  494. package/template/docs/12-web.md +167 -0
  495. package/template/fonts/IBMPlexMono-Regular-latin.woff2 +0 -0
  496. package/template/fonts/IBMPlexMono-SemiBold-latin.woff2 +0 -0
  497. package/template/fonts/OFL.txt +93 -0
  498. package/template/tokens/colors.json +257 -0
  499. package/template/tokens/form.json +199 -0
  500. package/template/tokens/social.json +26 -0
  501. package/template/tokens/spacing.json +65 -0
  502. package/template/tokens/theme/dark.json +121 -0
  503. package/template/tokens/typography.json +233 -0
@@ -0,0 +1,3 @@
1
+ {
2
+ "type": "commonjs"
3
+ }
@@ -0,0 +1,5 @@
1
+ # blazon.logo-kit
2
+
3
+ The plugin blazon ships to draw the files a brand's logo rules describe: a lockup of the logo beside each partner's, and a sheet that shows the logo's clear space. It fills the `build` role. The SVG needs only Node; the PNG needs Node and a Chrome (`BLAZON_CHROME` names one, else the Google Chrome installed on the computer).
4
+
5
+ The source is `src/shipped/logo-kit/`, and `npm run build` (`npm run build:plugins`) bundles it, with the blazon code it uses, into `bin/blazon-blazon.logo-kit.🔌`, the one file that holds the plugin's code and that `plugins/shipped.lock` pins. The program loads `playwright-core` from `node_modules` when it runs; that is outside the pin. The layout of a lockup is `src/core/logo/lockup.ts`, the one the brand book's own figure uses. The manual's plugins chapter says what to put in the config and what the plugin writes.
@@ -0,0 +1,617 @@
1
+ #!/usr/bin/env node
2
+ var __create = Object.create;
3
+ var __defProp = Object.defineProperty;
4
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
5
+ var __getOwnPropNames = Object.getOwnPropertyNames;
6
+ var __getProtoOf = Object.getPrototypeOf;
7
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
8
+ var __copyProps = (to, from, except, desc) => {
9
+ if (from && typeof from === "object" || typeof from === "function") for (var keys = __getOwnPropNames(from), i = 0, n = keys.length, key; i < n; i++) {
10
+ key = keys[i];
11
+ if (!__hasOwnProp.call(to, key) && key !== except) __defProp(to, key, {
12
+ get: ((k) => from[k]).bind(null, key),
13
+ enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
14
+ });
15
+ }
16
+ return to;
17
+ };
18
+ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(isNodeMode || !mod || !mod.__esModule || !__hasOwnProp.call(mod, "default") ? __defProp(target, "default", {
19
+ value: mod,
20
+ enumerable: true
21
+ }) : target, mod));
22
+ let node_fs = require("node:fs");
23
+ node_fs = __toESM(node_fs, 1);
24
+ let node_path = require("node:path");
25
+ node_path = __toESM(node_path, 1);
26
+ let playwright_core = require("playwright-core");
27
+ /** What the findings may take on the wire, in bytes. The limit is 65,536; the rest is the envelope, the summary finding and a newline, with room to spare. */
28
+ var FINDINGS_BUDGET = 6e4;
29
+ var RANK = {
30
+ error: 0,
31
+ warning: 1,
32
+ info: 2
33
+ };
34
+ var rank = (severity) => RANK[severity] ?? 3;
35
+ var wire = (finding) => Buffer.byteLength(JSON.stringify(finding), "utf-8") + 1;
36
+ /**
37
+ * The findings as they are when they fit. When they do not, the first ones that fit, errors before warnings before notes and each
38
+ * group in the order it was found, then one `<name>/findings-left-out` warning that says how many are not shown. The summary is a
39
+ * warning so that it never hides that there were errors: the errors come first, and a run with any error is already failed.
40
+ */
41
+ function boundFindings(findings, name) {
42
+ let size = 0;
43
+ for (const finding of findings) size += wire(finding);
44
+ if (size <= 6e4) return findings;
45
+ const ordered = [...findings].sort((a, b) => rank(a.severity) - rank(b.severity));
46
+ const kept = [];
47
+ size = 0;
48
+ for (const finding of ordered) {
49
+ if (size + wire(finding) > 6e4) break;
50
+ size += wire(finding);
51
+ kept.push(finding);
52
+ }
53
+ const left = ordered.length - kept.length;
54
+ kept.push({
55
+ code: `${name}/findings-left-out`,
56
+ severity: "warning",
57
+ path: "findings",
58
+ message: `${left} more findings are not shown, because the answer would not fit the ${FINDINGS_BUDGET.toLocaleString("en-US")} bytes a plugin may print; fix the ones above and run again`
59
+ });
60
+ return kept;
61
+ }
62
+ /** The plugin cannot do what it was asked; the message is the reason blazon shows. */
63
+ var Cannot = class extends Error {};
64
+ /** The builder of a plugin's findings: `findingFor(NAME)('code', severity, path, message)` is a finding coded `NAME/code`. */
65
+ var findingFor = (name) => (code, severity, path, message) => ({
66
+ code: `${name}/${code}`,
67
+ severity,
68
+ path,
69
+ message
70
+ });
71
+ var isObject = (value) => typeof value === "object" && value !== null && !Array.isArray(value);
72
+ /** The brand.json a plugin reads: the object when its format and version are the ones this reader understands, Cannot otherwise (RFC 0001: a reader checks both before it interprets anything). */
73
+ function requireBrand(raw) {
74
+ const shown = (value) => JSON.stringify(value) ?? "nothing";
75
+ if (!isObject(raw) || raw.format !== "blazon-brand") throw new Cannot(`the brand in the request is not a blazon brand: its format is ${shown(isObject(raw) ? raw.format : void 0)}, not "blazon-brand"`);
76
+ if (raw.version !== 1) throw new Cannot(`the brand in the request is version ${shown(raw.version)}; this reader understands version 1`);
77
+ return raw;
78
+ }
79
+ /** The request as an object of version 1, or Cannot with the reason. Its role and folders are for the plugin to check. */
80
+ function readRequest(text) {
81
+ let request;
82
+ try {
83
+ request = JSON.parse(text);
84
+ } catch {
85
+ throw new Cannot("the request is not JSON");
86
+ }
87
+ if (!isObject(request)) throw new Cannot("the request is not a JSON object");
88
+ if (request.v !== 1) throw new Cannot(`the request is version ${JSON.stringify(request.v)}; this plugin speaks version 1`);
89
+ return request;
90
+ }
91
+ /** The build request in `text`, or Cannot with the reason: version 1, the build role, a site_dir with an index.html and an out_dir that is a folder. The brand and options are not checked here. */
92
+ function buildJob(text) {
93
+ const request = readRequest(text);
94
+ if (request.type !== "build") throw new Cannot(`the request is for the ${String(request.type)} role; this plugin is a build plugin`);
95
+ const { site_dir: siteDir, out_dir: outDir } = request;
96
+ if (typeof siteDir !== "string" || !node_fs.default.existsSync(node_path.default.join(siteDir, "index.html"))) throw new Cannot("site_dir has no index.html");
97
+ if (typeof outDir !== "string" || !node_fs.default.statSync(outDir, { throwIfNoEntry: false })?.isDirectory()) throw new Cannot("out_dir is not a folder");
98
+ return {
99
+ siteDir,
100
+ outDir,
101
+ brand: request.brand ?? {},
102
+ options: request.options ?? {}
103
+ };
104
+ }
105
+ /**
106
+ * The entry: `--blazon-manifest` prints the manifest; otherwise one request on standard input gets the answer of `build` as
107
+ * JSON, or exit 2 with the reason as the first line of standard output. `failure` starts the reason for an error that is
108
+ * not a Cannot. `name` is the plugin's, for the summary when the findings are bounded to what a call may print (bound.ts). Returns the exit status.
109
+ */
110
+ async function runPlugin(argv, manifest, build, failure, name) {
111
+ if (argv[0] === "--blazon-manifest") {
112
+ process.stdout.write(`${JSON.stringify(manifest)}\n`);
113
+ return 0;
114
+ }
115
+ try {
116
+ const answer = await build(node_fs.default.readFileSync(0, "utf-8"));
117
+ const bounded = isObject(answer) && Array.isArray(answer.findings) ? {
118
+ ...answer,
119
+ findings: boundFindings(answer.findings, name)
120
+ } : answer;
121
+ process.stdout.write(`${JSON.stringify(bounded)}\n`);
122
+ return 0;
123
+ } catch (error) {
124
+ const reason = error instanceof Cannot ? error.message : `${failure}: ${String(error.message ?? error).split("\n")[0].slice(0, 500)}`;
125
+ process.stdout.write(`${reason}\n`);
126
+ return 2;
127
+ }
128
+ }
129
+ var INSTALL_HINT = "install Google Chrome, or set BLAZON_CHROME to a Chrome or Chromium program";
130
+ /**
131
+ * The browser: the program BLAZON_CHROME names, else the Google Chrome installed on this computer. It never downloads one.
132
+ * `what` completes "no browser to ...", such as "print with".
133
+ */
134
+ async function launchChrome(env, what) {
135
+ const named = env.BLAZON_CHROME;
136
+ if (named) {
137
+ if (!isProgram(named)) throw new Cannot(`no browser to ${what}: BLAZON_CHROME names ${named}, which is not a program; ${INSTALL_HINT}`);
138
+ return playwright_core.chromium.launch({ executablePath: named });
139
+ }
140
+ try {
141
+ return await playwright_core.chromium.launch({ channel: "chrome" });
142
+ } catch {
143
+ throw new Cannot(`no browser to ${what}: ${INSTALL_HINT}`);
144
+ }
145
+ }
146
+ function isProgram(file) {
147
+ try {
148
+ node_fs.default.accessSync(file, node_fs.default.constants.X_OK);
149
+ return node_fs.default.statSync(file).isFile();
150
+ } catch {
151
+ return false;
152
+ }
153
+ }
154
+ /** The file at `file` in the built site, or undefined when it is not there or leaves the site by a path or a link */
155
+ function siteFile(siteDir, file) {
156
+ const root = node_fs.default.realpathSync(siteDir);
157
+ const full = node_path.default.resolve(root, file);
158
+ if (!full.startsWith(root + node_path.default.sep) || !node_fs.default.existsSync(full) || !node_fs.default.statSync(full).isFile()) return void 0;
159
+ const real = node_fs.default.realpathSync(full);
160
+ return real.startsWith(root + node_path.default.sep) ? node_fs.default.readFileSync(real) : void 0;
161
+ }
162
+ /** A rem is read as 16px: a sidecar states no root size, and the browser default is the only honest guess. */
163
+ var REM_PX = 16;
164
+ var dimensionToPx = (d) => d.unit === "rem" ? d.value * REM_PX : d.value;
165
+ /** True for a multiple of the artwork's unit, as opposed to a dimension. */
166
+ function isUnits(measure) {
167
+ return "units" in measure;
168
+ }
169
+ /**
170
+ * A measure in the artwork's own pixels. A multiple needs the sidecar's `unit`; without one it has no
171
+ * size, which the sidecar check reports before anything draws it.
172
+ */
173
+ function measurePx(measure, meta) {
174
+ if (!isUnits(measure)) return dimensionToPx(measure);
175
+ return meta.unit ? measure.units * dimensionToPx(meta.unit) : void 0;
176
+ }
177
+ /** The artwork's own pixel size: a raster file's, an SVG's width and height, or its viewBox. Undefined when unknown. */
178
+ function artworkSize(asset) {
179
+ const width = Number(asset.width);
180
+ const height = Number(asset.height);
181
+ if (width > 0 && height > 0) return {
182
+ width,
183
+ height
184
+ };
185
+ const box = asset.viewBox?.trim().split(/[\s,]+/).map(Number);
186
+ if (box && box.length === 4 && box[2] > 0 && box[3] > 0) return {
187
+ width: box[2],
188
+ height: box[3]
189
+ };
190
+ }
191
+ /** A non-empty string (not only whitespace), or undefined. */
192
+ var text = (value) => typeof value === "string" && value.trim() !== "" ? value : void 0;
193
+ /** An asset's id, file, format and category (the first segment of the id when the entry has none); undefined when the entry lacks one of the first three. */
194
+ function readBaseAsset(raw) {
195
+ if (!isObject(raw)) return void 0;
196
+ const [id, file, format] = [
197
+ text(raw.id),
198
+ text(raw.file),
199
+ text(raw.format)
200
+ ];
201
+ if (!id || !file || !format) return void 0;
202
+ return {
203
+ id,
204
+ file,
205
+ format,
206
+ category: text(raw.category) ?? id.split("/")[0]
207
+ };
208
+ }
209
+ /** An asset's sidecar rules: its `meta` object, or an empty one. */
210
+ var readMeta = (raw) => isObject(raw.meta) ? raw.meta : {};
211
+ function readBrand(brand) {
212
+ const root = requireBrand(brand);
213
+ const assets = /* @__PURE__ */ new Map();
214
+ for (const raw of Array.isArray(root.assets) ? root.assets : []) {
215
+ if (!isObject(raw)) continue;
216
+ const base = readBaseAsset(raw);
217
+ if (!base) continue;
218
+ const { id, file, format, category } = base;
219
+ const size = artworkSize({
220
+ width: raw.width,
221
+ height: raw.height,
222
+ viewBox: text(raw.viewBox)
223
+ });
224
+ assets.set(id, {
225
+ id,
226
+ name: text(raw.name) ?? id.split("/").pop(),
227
+ category,
228
+ file,
229
+ format,
230
+ ...size && { size },
231
+ meta: readMeta(raw)
232
+ });
233
+ }
234
+ return { assets };
235
+ }
236
+ /** The divider's weight: a brand states where the line goes and how tall it is, rarely how thick. It is 1% of the logo's height, 1px at least. */
237
+ var dividerStroke = (logoHeight) => Math.max(1, logoHeight / 100);
238
+ /**
239
+ * The logo and a partner's side by side, divided by a vertical line, on one baseline. The gap on each side of the line and the line's
240
+ * height come from the rule; the line is centered on the row. The partner is as tall as the rule's `partnerHeight`, or as tall as the
241
+ * logo when it states none. Undefined when the logo states no partnership.
242
+ */
243
+ function planPartnership(logo, partner) {
244
+ const rule = logo.meta.partnership;
245
+ if (!rule) return void 0;
246
+ const gap = measurePx(rule.gap, logo.meta) ?? 0;
247
+ const dividerHeight = rule.dividerHeight ? measurePx(rule.dividerHeight, logo.meta) ?? logo.size.height : 0;
248
+ const partnerHeight = rule.partnerHeight && measurePx(rule.partnerHeight, logo.meta) || logo.size.height;
249
+ const partnerWidth = partner.size.width * partnerHeight / partner.size.height;
250
+ const height = Math.max(logo.size.height, dividerHeight, partnerHeight);
251
+ const stroke = rule.dividerHeight ? dividerStroke(logo.size.height) : 0;
252
+ const partnerX = rule.dividerHeight ? logo.size.width + gap + stroke + gap : logo.size.width + gap;
253
+ const dividerX = logo.size.width + gap + stroke / 2;
254
+ return {
255
+ width: partnerX + partnerWidth,
256
+ height,
257
+ logo: {
258
+ x: 0,
259
+ y: height - logo.size.height,
260
+ ...logo.size
261
+ },
262
+ partner: {
263
+ x: partnerX,
264
+ y: height - partnerHeight,
265
+ width: partnerWidth,
266
+ height: partnerHeight
267
+ },
268
+ ...rule.dividerHeight && { divider: {
269
+ x: dividerX,
270
+ y1: (height - dividerHeight) / 2,
271
+ y2: (height + dividerHeight) / 2,
272
+ stroke
273
+ } }
274
+ };
275
+ }
276
+ /**
277
+ * The logo and the artwork of a program it runs. Beside, the mark sits one gap to the right and both stand on one baseline; below, the
278
+ * mark sits one gap under the logo with their left edges aligned. The mark is as tall as `markHeight`, or as tall as the logo when the
279
+ * rule states none. Undefined when the logo states no initiative.
280
+ */
281
+ function planInitiative(logo, mark) {
282
+ const rule = logo.meta.initiative;
283
+ if (!rule) return void 0;
284
+ const gap = measurePx(rule.gap, logo.meta) ?? 0;
285
+ const markHeight = rule.markHeight && measurePx(rule.markHeight, logo.meta) || logo.size.height;
286
+ const markWidth = mark.size.width * markHeight / mark.size.height;
287
+ if (rule.position === "below") return {
288
+ width: Math.max(logo.size.width, markWidth),
289
+ height: logo.size.height + gap + markHeight,
290
+ logo: {
291
+ x: 0,
292
+ y: 0,
293
+ ...logo.size
294
+ },
295
+ mark: {
296
+ x: 0,
297
+ y: logo.size.height + gap,
298
+ width: markWidth,
299
+ height: markHeight
300
+ }
301
+ };
302
+ const height = Math.max(logo.size.height, markHeight);
303
+ return {
304
+ width: logo.size.width + gap + markWidth,
305
+ height,
306
+ logo: {
307
+ x: 0,
308
+ y: height - logo.size.height,
309
+ ...logo.size
310
+ },
311
+ mark: {
312
+ x: logo.size.width + gap,
313
+ y: height - markHeight,
314
+ width: markWidth,
315
+ height: markHeight
316
+ }
317
+ };
318
+ }
319
+ /** The plugin's name, which blazon's config names it by, and the prefix of its finding codes */
320
+ var NAME = "blazon.logo-kit";
321
+ var MANIFEST = {
322
+ v: 2,
323
+ roles: ["build"],
324
+ title: "Logo kit",
325
+ description: "Draws the brand's partnership lockups and clear-space sheets from the rules in the logo sidecars, as SVG and PNG.",
326
+ version: "1.0.0",
327
+ timeout_ms: 6e4,
328
+ env: [
329
+ "BLAZON_CHROME",
330
+ "HOME",
331
+ "TMPDIR"
332
+ ]
333
+ };
334
+ /** The job a build request asks for, or Cannot with the reason. The options are checked later, and wrong ones are findings. */
335
+ function jobFor(text) {
336
+ return buildJob(text);
337
+ }
338
+ var KEYS = [
339
+ "logos",
340
+ "partners",
341
+ "formats",
342
+ "scale"
343
+ ];
344
+ var FORMATS = ["svg", "png"];
345
+ var finding = findingFor(NAME);
346
+ var invalid = (message) => finding("option-invalid", "error", "options", message);
347
+ /**
348
+ * The options as the kit uses them, and a `option-invalid` finding for each thing wrong. Nothing here throws: the options are the
349
+ * person's, not the request's. A wrong option is left at its default and the rest is drawn.
350
+ */
351
+ function parseOptions(raw, known) {
352
+ const findings = [];
353
+ const options = {
354
+ formats: ["svg", "png"],
355
+ scale: 1
356
+ };
357
+ if (!isObject(raw)) return {
358
+ options,
359
+ findings: [invalid("options must be an object")]
360
+ };
361
+ for (const key of Object.keys(raw)) if (!KEYS.includes(key)) findings.push(invalid(`unknown option "${key}"; the options are ${KEYS.join(", ")}`));
362
+ const ids = (key) => {
363
+ const value = raw[key];
364
+ if (value === void 0) return;
365
+ if (!Array.isArray(value) || value.some((item) => typeof item !== "string")) return void findings.push(invalid(`${key} must be a list of asset ids`));
366
+ const missing = value.filter((id) => !known.has(id));
367
+ if (missing.length > 0) findings.push(invalid(`${key} names ${missing.map((id) => JSON.stringify(id)).join(", ")}, which the brand has no asset for`));
368
+ options[key] = value.filter((id) => known.has(id));
369
+ };
370
+ ids("logos");
371
+ ids("partners");
372
+ if (raw.formats !== void 0) {
373
+ const formats = raw.formats;
374
+ if (!Array.isArray(formats) || formats.length === 0 || formats.some((format) => !FORMATS.includes(format))) findings.push(invalid("formats must be a non-empty list of svg and png"));
375
+ else options.formats = [...new Set(formats)];
376
+ }
377
+ if (raw.scale !== void 0) {
378
+ if (raw.scale !== 1 && raw.scale !== 2) findings.push(invalid("scale must be 1 or 2"));
379
+ else options.scale = raw.scale;
380
+ }
381
+ return {
382
+ options,
383
+ findings
384
+ };
385
+ }
386
+ /** An asset id as a file name part: nothing but letters, digits, dots, hyphens and underscores, so a name cannot leave out_dir. */
387
+ var fileName = (id) => id.replace(/[^A-Za-z0-9._]+/g, "-").replace(/^[-.]+/, "") || "asset";
388
+ function planPieces(brand, options) {
389
+ const findings = [];
390
+ const pieces = [];
391
+ const inCategory = (category) => [...brand.assets.values()].filter((asset) => asset.category === category).map((asset) => asset.id);
392
+ const named = options.logos !== void 0;
393
+ const logos = options.logos ?? inCategory("logos");
394
+ const partners = options.partners ?? inCategory("partners");
395
+ for (const id of logos) {
396
+ const logo = brand.assets.get(id);
397
+ if (!logo.size) {
398
+ findings.push(finding("no-size", "warning", logo.id, `${logo.id} has no width and height in its file, so a lockup cannot be laid out`));
399
+ continue;
400
+ }
401
+ const size = logo.size;
402
+ if (logo.meta.partnership) for (const partnerId of partners) {
403
+ const partner = brand.assets.get(partnerId);
404
+ if (!partner.size) {
405
+ findings.push(finding("no-size", "warning", partner.id, `${partner.id} has no width and height in its file, so a lockup cannot be laid out`));
406
+ continue;
407
+ }
408
+ const layout = planPartnership({
409
+ size,
410
+ meta: logo.meta
411
+ }, { size: partner.size });
412
+ pieces.push({
413
+ kind: "partnership",
414
+ stem: `partnership-${fileName(logo.id)}--${fileName(partner.id)}`,
415
+ logo,
416
+ partner,
417
+ layout
418
+ });
419
+ }
420
+ else if (named && partners.length > 0) findings.push(finding("no-partnership-rule", "warning", logo.id, `${logo.id} states no partnership in its sidecar, so no lockup is drawn for it`));
421
+ const initiative = logo.meta.initiative;
422
+ if (initiative) {
423
+ const mark = brand.assets.get(initiative.mark);
424
+ if (!mark) findings.push(finding("initiative-mark-missing", "warning", logo.id, `${logo.id} names ${initiative.mark} as its initiative mark, which the brand has no asset for`));
425
+ else if (!mark.size) findings.push(finding("no-size", "warning", mark.id, `${mark.id} has no width and height in its file, so a lockup cannot be laid out`));
426
+ else {
427
+ const layout = planInitiative({
428
+ size,
429
+ meta: logo.meta
430
+ }, { size: mark.size });
431
+ pieces.push({
432
+ kind: "initiative",
433
+ stem: `initiative-${fileName(logo.id)}--${fileName(mark.id)}`,
434
+ logo,
435
+ mark,
436
+ name: initiative.name,
437
+ layout
438
+ });
439
+ }
440
+ }
441
+ const space = logo.meta.clearSpace ? measurePx(logo.meta.clearSpace, logo.meta) : void 0;
442
+ if (space !== void 0 && space > 0) pieces.push({
443
+ kind: "clear-space",
444
+ stem: `clear-space-${fileName(logo.id)}`,
445
+ logo,
446
+ size,
447
+ space
448
+ });
449
+ else if (named) findings.push(finding("no-clear-space", "warning", logo.id, `${logo.id} states no clear space in its sidecar, so no sheet is drawn for it`));
450
+ }
451
+ if (pieces.length === 0) findings.push(finding("nothing-to-draw", "warning", "options", "no logo states a partnership, an initiative or a clear space in its sidecar (or none could be laid out), so the kit is empty"));
452
+ return {
453
+ pieces,
454
+ findings
455
+ };
456
+ }
457
+ /** The longest side a PNG is drawn at: a larger artwork is drawn smaller (an SVG scales), so no page asks the browser for a huge canvas. */
458
+ var MAX_SIDE = 4096;
459
+ /**
460
+ * The SVG as a PNG, on no background, at `scale` times the artwork's size, never more than MAX_SIDE on the longer side. The page is a
461
+ * local string with no network. It waits for the picture to decode and for two frames, so the same SVG is the same bytes every time.
462
+ */
463
+ async function svgToPng(browser, svg, size, scale) {
464
+ const fit = Math.min(1, MAX_SIDE / Math.max(size.width * scale, size.height * scale));
465
+ const width = Math.max(1, Math.round(size.width * fit));
466
+ const height = Math.max(1, Math.round(size.height * fit));
467
+ const page = await browser.newPage({
468
+ viewport: {
469
+ width,
470
+ height
471
+ },
472
+ deviceScaleFactor: scale
473
+ });
474
+ try {
475
+ await page.route("**/*", (route) => route.abort());
476
+ const source = `data:image/svg+xml;base64,${Buffer.from(svg).toString("base64")}`;
477
+ await page.setContent(`<!doctype html><meta charset="utf-8"><style>html,body{margin:0;background:transparent}img{display:block}</style><img width="${width}" height="${height}" src="${source}">`);
478
+ await page.evaluate(async () => {
479
+ await Promise.all([...document.images].map((image) => image.decode()));
480
+ await new Promise((done) => requestAnimationFrame(() => requestAnimationFrame(() => done())));
481
+ });
482
+ return await page.screenshot({
483
+ type: "png",
484
+ omitBackground: true,
485
+ clip: {
486
+ x: 0,
487
+ y: 0,
488
+ width,
489
+ height
490
+ }
491
+ });
492
+ } finally {
493
+ await page.close();
494
+ }
495
+ }
496
+ var num = (value) => String(Number(value.toFixed(4)));
497
+ var escape = (text) => text.replace(/&/g, "&amp;").replace(/</g, "&lt;").replace(/>/g, "&gt;").replace(/"/g, "&quot;");
498
+ var title = (text) => `<title>${escape(text)}</title>`;
499
+ /** What the divider and the band are drawn in, from what the sidecar says the logo is made for. */
500
+ function inkOf(piece) {
501
+ const { ink, background } = piece.logo.meta;
502
+ return ink && /^#[0-9a-f]{3,8}$/i.test(ink.trim()) ? ink.trim() : background === "dark" ? "#FFFFFF" : "#000000";
503
+ }
504
+ /** The logo, a divider and the partner on one baseline, on no background: a file for placing on a surface. */
505
+ function partnershipSvg(piece, href) {
506
+ const { layout, logo, partner } = piece;
507
+ const box = (b, source) => `<image href="${source}" x="${num(b.x)}" y="${num(b.y)}" width="${num(b.width)}" height="${num(b.height)}"/>`;
508
+ const divider = layout.divider ? `<line x1="${num(layout.divider.x)}" x2="${num(layout.divider.x)}" y1="${num(layout.divider.y1)}" y2="${num(layout.divider.y2)}" stroke="${inkOf(piece)}" stroke-width="${num(layout.divider.stroke)}"/>` : "";
509
+ const label = `${logo.id} and ${partner.id}`;
510
+ return `<svg xmlns="http://www.w3.org/2000/svg" width="${num(layout.width)}" height="${num(layout.height)}" viewBox="0 0 ${num(layout.width)} ${num(layout.height)}" role="img" aria-label="${escape(label)}">${title(label)}${box(layout.logo, href.logo)}${divider}${box(layout.partner, href.partner)}</svg>\n`;
511
+ }
512
+ /** The logo and the mark of its program, beside or under it, on no background. */
513
+ function initiativeSvg(piece, href) {
514
+ const { layout, logo, name } = piece;
515
+ const box = (b, source) => `<image href="${source}" x="${num(b.x)}" y="${num(b.y)}" width="${num(b.width)}" height="${num(b.height)}"/>`;
516
+ const label = `${logo.id}, ${name}`;
517
+ return `<svg xmlns="http://www.w3.org/2000/svg" width="${num(layout.width)}" height="${num(layout.height)}" viewBox="0 0 ${num(layout.width)} ${num(layout.height)}" role="img" aria-label="${escape(label)}">${title(label)}${box(layout.logo, href.logo)}${box(layout.mark, href.mark)}</svg>\n`;
518
+ }
519
+ /** The logo inside a hatched, dashed band the width of its clear space, on the surface it is made for. */
520
+ function clearSpaceSvg(piece, href) {
521
+ const { size, space, logo } = piece;
522
+ const width = size.width + 2 * space;
523
+ const height = size.height + 2 * space;
524
+ const surface = logo.meta.background === "dark" ? "#000000" : "#FFFFFF";
525
+ const ink = inkOf(piece);
526
+ const stroke = Math.max(1, size.height / 200);
527
+ const label = `${logo.id}: clear space`;
528
+ return [
529
+ `<svg xmlns="http://www.w3.org/2000/svg" width="${num(width)}" height="${num(height)}" viewBox="0 0 ${num(width)} ${num(height)}" role="img" aria-label="${escape(label)}">`,
530
+ title(label),
531
+ `<defs><pattern id="band" width="${num(stroke * 8)}" height="${num(stroke * 8)}" patternUnits="userSpaceOnUse" patternTransform="rotate(45)"><line x1="0" y1="0" x2="0" y2="${num(stroke * 8)}" stroke="${ink}" stroke-opacity="0.25" stroke-width="${num(stroke)}"/></pattern></defs>`,
532
+ `<rect width="${num(width)}" height="${num(height)}" fill="${surface}"/>`,
533
+ `<path fill-rule="evenodd" fill="url(#band)" d="M0 0H${num(width)}V${num(height)}H0Z M${num(space)} ${num(space)}V${num(space + size.height)}H${num(space + size.width)}V${num(space)}Z"/>`,
534
+ `<rect x="${num(space)}" y="${num(space)}" width="${num(size.width)}" height="${num(size.height)}" fill="none" stroke="${ink}" stroke-width="${num(stroke)}" stroke-dasharray="${num(stroke * 6)} ${num(stroke * 4)}"/>`,
535
+ `<image href="${href}" x="${num(space)}" y="${num(space)}" width="${num(size.width)}" height="${num(size.height)}"/>`,
536
+ `</svg>\n`
537
+ ].join("");
538
+ }
539
+ var MEDIA = {
540
+ svg: "image/svg+xml",
541
+ png: "image/png",
542
+ jpg: "image/jpeg",
543
+ gif: "image/gif",
544
+ webp: "image/webp",
545
+ avif: "image/avif"
546
+ };
547
+ /** The asset's file as a data: address, or undefined when it is not in the site, or leaves it. */
548
+ function dataAddress(siteDir, asset) {
549
+ const data = siteFile(siteDir, asset.file);
550
+ return data && `data:${MEDIA[asset.format] ?? "application/octet-stream"};base64,${data.toString("base64")}`;
551
+ }
552
+ async function build(text) {
553
+ const job = jobFor(text);
554
+ const brand = readBrand(job.brand);
555
+ const { options, findings } = parseOptions(job.options, new Set(brand.assets.keys()));
556
+ const planned = planPieces(brand, options);
557
+ findings.push(...planned.findings);
558
+ const drawn = [];
559
+ const missing = /* @__PURE__ */ new Set();
560
+ const address = (asset) => {
561
+ const found = dataAddress(job.siteDir, asset);
562
+ if (!found && !missing.has(asset.id)) {
563
+ missing.add(asset.id);
564
+ findings.push(finding("file-missing", "error", asset.id, `${asset.id} is not in the built site at ${asset.file}`));
565
+ }
566
+ return found;
567
+ };
568
+ for (const piece of planned.pieces) if (piece.kind === "partnership") {
569
+ const [logo, partner] = [address(piece.logo), address(piece.partner)];
570
+ if (logo && partner) drawn.push({
571
+ stem: piece.stem,
572
+ svg: partnershipSvg(piece, {
573
+ logo,
574
+ partner
575
+ }),
576
+ size: piece.layout
577
+ });
578
+ } else if (piece.kind === "initiative") {
579
+ const [logo, mark] = [address(piece.logo), address(piece.mark)];
580
+ if (logo && mark) drawn.push({
581
+ stem: piece.stem,
582
+ svg: initiativeSvg(piece, {
583
+ logo,
584
+ mark
585
+ }),
586
+ size: piece.layout
587
+ });
588
+ } else {
589
+ const logo = address(piece.logo);
590
+ if (logo) drawn.push({
591
+ stem: piece.stem,
592
+ svg: clearSpaceSvg(piece, logo),
593
+ size: {
594
+ width: piece.size.width + 2 * piece.space,
595
+ height: piece.size.height + 2 * piece.space
596
+ }
597
+ });
598
+ }
599
+ const files = /* @__PURE__ */ new Map();
600
+ if (options.formats.includes("svg")) for (const item of drawn) files.set(`${item.stem}.svg`, item.svg);
601
+ if (options.formats.includes("png") && drawn.length > 0) {
602
+ const browser = await launchChrome(process.env, "draw the kit with");
603
+ try {
604
+ for (const item of drawn) {
605
+ files.set(`${item.stem}.png`, await svgToPng(browser, item.svg, item.size, 1));
606
+ if (options.scale === 2) files.set(`${item.stem}@2x.png`, await svgToPng(browser, item.svg, item.size, 2));
607
+ }
608
+ } finally {
609
+ await browser.close();
610
+ }
611
+ }
612
+ for (const [name, data] of files) node_fs.default.writeFileSync(node_path.default.join(job.outDir, name), data);
613
+ return { findings };
614
+ }
615
+ runPlugin(process.argv.slice(2), MANIFEST, build, "the browser could not draw the kit", NAME).then((code) => {
616
+ process.exitCode = code;
617
+ });
@@ -0,0 +1,3 @@
1
+ {
2
+ "type": "commonjs"
3
+ }
@@ -0,0 +1,29 @@
1
+ # blazon.office-template
2
+
3
+ The plugin blazon ships to write an editable PowerPoint template from a brand: a theme with the brand's colors and fonts, a slide master, and five layouts (Cover, Section divider, Title and content, Two columns, Closing) with the logo placed as its sidecar says. It fills the `build` role and needs only Node: no browser.
4
+
5
+ The source is `src/shipped/office-template/`, and `npm run build` (`npm run build:plugins`) bundles it, with the blazon code it uses, into `bin/blazon-blazon.office-template.🔌`, the one file that holds the plugin's code and that `plugins/shipped.lock` pins. It loads nothing from `node_modules`, so the pin covers all the code it runs, apart from Node itself. The manual's plugins chapter says what to put in the config and what the plugin writes.
6
+
7
+ ## What goes where
8
+
9
+ | Theme slot | From the brand |
10
+ |---|---|
11
+ | `dk1`, `lt1` | The `text` and `background` roles, the darker in `dk1`. A dark brand has its background in `dk1`, and the master's color map says so |
12
+ | `dk2`, `lt2` | The `inverse` and `canvas` roles, the darker in `dk2` |
13
+ | `accent1` | The `accent` role |
14
+ | `accent2` to `accent6` | The `accents` option, then `muted`, `border`, then the brand's color tokens that are not aliases, in token order, then tints of the accent. A color the theme already has is skipped |
15
+ | `hlink`, `folHlink` | The accent, and `muted` |
16
+ | Heading font (major) | The first named family of `fontDisplay` |
17
+ | Body font (minor) | The first named family of `fontBody` |
18
+
19
+ The Cover, Section divider and Closing layouts sit on the `inverse` surface, the others on the background. A logo made for dark surfaces goes where the surface is dark, and a logo made for light surfaces where it is light; a logo is made for what its sidecar `background` says, else for what `logo.onLight` and `logo.onDark` in brand.json make it.
20
+
21
+ The logo is drawn at 1.3 inches wide on the master, 2.4 on the Cover and 2 on the Section divider and Closing layouts, held between the sidecar's `minSize` and `maxSize`. Its `clearSpace` is kept free on every side: no placeholder reaches into it. A plain SVG logo is written as PowerPoint shapes, so it is vector in every program and can be edited; any other SVG is embedded as the SVG, which PowerPoint 2016 and later draws.
22
+
23
+ ## Title style
24
+
25
+ The master's title line spacing and the titles' character spacing come from the brand's typography tokens: one non-alias style set in the heading font gives its `lineHeight` and, in `em`, its `letterSpacing`: the style whose path ends in `.display`, else one ending in `.h1`, else the largest; of several with the same name, the largest. Without one, titles use a line height of 1.1 and no tracking.
26
+
27
+ ## In Keynote
28
+
29
+ Keynote opens both files. The layouts arrive as Keynote master slides with the same names, with their placeholders and their backgrounds, and the logo as a group on each master. The colors show as drawn; the theme's palette is not something the Keynote scripting interface shows, so whether its color picker offers the twelve theme colors is not checked. Keynote has no theme fonts, and text in a font the computer lacks is set in Helvetica. This plugin writes PowerPoint files only; saving a Keynote file from the opened template is Keynote's job.