@erclx/canon 5.52.0 → 5.53.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 (127) hide show
  1. package/CHANGELOG.md +7 -0
  2. package/README.md +1 -4
  3. package/claude/.claude-plugin/plugin.json +1 -1
  4. package/claude/skills/canon-cli/SKILL.md +0 -3
  5. package/claude/skills/context-fold/REQUIREMENT.md +0 -1
  6. package/claude/skills/design-taste/references/kinds.md +0 -1
  7. package/claude/skills/draw-figure/REQUIREMENT.md +2 -3
  8. package/claude/skills/draw-figure/SKILL.md +4 -5
  9. package/claude/skills/draw-figure/references/figures.md +0 -1
  10. package/claude/skills/draw-figure/references/hand-drawn.md +1 -1
  11. package/claude/skills/pick-by-eye/REQUIREMENT.md +0 -1
  12. package/claude/skills/pick-by-eye/SKILL.md +1 -1
  13. package/claude/skills/teach-craft/REQUIREMENT.md +30 -0
  14. package/claude/skills/teach-craft/SKILL.md +39 -0
  15. package/claude/skills/teach-craft/references/lesson-craft.md +52 -0
  16. package/claude/skills/{teach-workspace → teach-craft}/references/pedagogy.md +12 -4
  17. package/docs/agents/audits.md +0 -1
  18. package/docs/target/migrations.md +10 -1
  19. package/docs/workflow/parallel-features.md +1 -1
  20. package/docs/workflow/skill-map-on-request.md +10 -22
  21. package/docs/workflow/skill-map.md +12 -14
  22. package/package.json +1 -4
  23. package/scripts/core/regen-web-previews.ts +2 -67
  24. package/src/audits/catalog.ts +0 -1
  25. package/src/browser/engine.ts +3 -6
  26. package/src/capture/render.ts +1 -1
  27. package/src/claude/cases/authoring.ts +0 -12
  28. package/src/claude/cases/misc.ts +0 -17
  29. package/src/claude/cases/workflow.ts +2 -38
  30. package/src/claude/skills-audit.ts +0 -1
  31. package/src/cli/help.ts +0 -7
  32. package/src/cli.ts +0 -6
  33. package/src/commands/records.ts +0 -1
  34. package/src/commands/serve.ts +2 -2
  35. package/src/design/components.ts +8 -1514
  36. package/src/design/css.ts +5 -6
  37. package/src/design/fonts.ts +3 -5
  38. package/src/driver/drive.ts +3 -4
  39. package/src/driver/steps.ts +2 -5
  40. package/src/inventory/walk.ts +1 -1
  41. package/src/markdown/scope.ts +4 -31
  42. package/src/records/validate.ts +4 -176
  43. package/src/sandbox/equivalence.ts +0 -5
  44. package/claude/skills/draft-and-pick/REQUIREMENT.md +0 -26
  45. package/claude/skills/draft-and-pick/SKILL.md +0 -11
  46. package/claude/skills/draft-doc/REQUIREMENT.md +0 -26
  47. package/claude/skills/draft-doc/SKILL.md +0 -11
  48. package/claude/skills/draft-figure/REQUIREMENT.md +0 -26
  49. package/claude/skills/draft-figure/SKILL.md +0 -11
  50. package/claude/skills/draft-identity/REQUIREMENT.md +0 -26
  51. package/claude/skills/draft-identity/SKILL.md +0 -11
  52. package/claude/skills/draft-ready/REQUIREMENT.md +0 -26
  53. package/claude/skills/draft-ready/SKILL.md +0 -11
  54. package/claude/skills/draft-screencast/REQUIREMENT.md +0 -26
  55. package/claude/skills/draft-screencast/SKILL.md +0 -11
  56. package/claude/skills/draft-slides/REQUIREMENT.md +0 -26
  57. package/claude/skills/draft-slides/SKILL.md +0 -11
  58. package/claude/skills/make-deck/REQUIREMENT.md +0 -36
  59. package/claude/skills/make-deck/SKILL.md +0 -80
  60. package/claude/skills/make-deck/references/deck.md +0 -183
  61. package/claude/skills/read-frames/REQUIREMENT.md +0 -30
  62. package/claude/skills/read-frames/SKILL.md +0 -55
  63. package/claude/skills/record-screencast/REQUIREMENT.md +0 -35
  64. package/claude/skills/record-screencast/SKILL.md +0 -99
  65. package/claude/skills/script-screencast/REQUIREMENT.md +0 -34
  66. package/claude/skills/script-screencast/SKILL.md +0 -70
  67. package/claude/skills/script-screencast/references/beats-template.md +0 -119
  68. package/claude/skills/teach-workspace/REQUIREMENT.md +0 -34
  69. package/claude/skills/teach-workspace/SKILL.md +0 -196
  70. package/claude/skills/teach-workspace/references/glossary.md +0 -90
  71. package/claude/skills/teach-workspace/references/lesson-build.md +0 -106
  72. package/claude/skills/teach-workspace/references/lesson-craft.md +0 -135
  73. package/claude/skills/teach-workspace/references/promotion-fold.md +0 -35
  74. package/claude/skills/teach-workspace/references/promotion.md +0 -116
  75. package/claude/skills/teach-workspace/references/revisit.md +0 -28
  76. package/claude/skills/teach-workspace/references/teach.md +0 -211
  77. package/claude/skills/video-craft/REQUIREMENT.md +0 -35
  78. package/claude/skills/video-craft/SKILL.md +0 -96
  79. package/claude/skills/video-craft/references/adopted.md +0 -110
  80. package/src/commands/demo.ts +0 -542
  81. package/src/commands/slides.ts +0 -184
  82. package/src/commands/teach.ts +0 -1401
  83. package/src/demo/beats.ts +0 -135
  84. package/src/demo/compile.ts +0 -350
  85. package/src/demo/container.ts +0 -219
  86. package/src/demo/cursors.ts +0 -55
  87. package/src/demo/drive.ts +0 -442
  88. package/src/demo/pointer.ts +0 -178
  89. package/src/demo/theme.ts +0 -112
  90. package/src/demo/timeline.ts +0 -64
  91. package/src/slides/convert/chart.ts +0 -165
  92. package/src/slides/convert/deck.ts +0 -244
  93. package/src/slides/convert/export.ts +0 -567
  94. package/src/slides/convert/master.ts +0 -198
  95. package/src/slides/convert/shapes.ts +0 -804
  96. package/src/slides/convert/svg.ts +0 -38
  97. package/src/slides/convert/walk.ts +0 -671
  98. package/src/slides/decks.ts +0 -110
  99. package/src/slides/open.ts +0 -18
  100. package/src/slides/package/fonts.ts +0 -301
  101. package/src/slides/package/motion.ts +0 -316
  102. package/src/slides/package/test-face.ts +0 -113
  103. package/src/teach/browser/compile.ts +0 -44
  104. package/src/teach/browser/dismiss.ts +0 -76
  105. package/src/teach/browser/focus-line.ts +0 -19
  106. package/src/teach/browser/glossary-filter.ts +0 -44
  107. package/src/teach/browser/head.ts +0 -30
  108. package/src/teach/browser/quiz.ts +0 -19
  109. package/src/teach/browser/reload.ts +0 -9
  110. package/src/teach/browser/sidebar.ts +0 -233
  111. package/src/teach/browser/theme.ts +0 -18
  112. package/src/teach/components/code.tsx +0 -24
  113. package/src/teach/components/heading.tsx +0 -11
  114. package/src/teach/components/list.tsx +0 -17
  115. package/src/teach/components/paragraph.tsx +0 -29
  116. package/src/teach/components/refs.tsx +0 -28
  117. package/src/teach/cross-references.ts +0 -78
  118. package/src/teach/fonts.ts +0 -16
  119. package/src/teach/highlight.ts +0 -71
  120. package/src/teach/html/jsx-dev-runtime.ts +0 -13
  121. package/src/teach/html/jsx-runtime.ts +0 -113
  122. package/src/teach/html/raw.ts +0 -28
  123. package/src/teach/lesson.ts +0 -178
  124. package/src/teach/nav.ts +0 -1337
  125. package/src/teach/render.ts +0 -240
  126. package/src/teach/workspace.ts +0 -1164
  127. package/src/teach/write-if-changed.ts +0 -17
@@ -1,198 +0,0 @@
1
- import type PptxGenJS from 'pptxgenjs'
2
- import {
3
- BAND_SLOTS,
4
- type Band,
5
- type BandSlot,
6
- type DeckConfig,
7
- } from '@/slides/convert/deck'
8
- import { fontFace } from '@/slides/convert/shapes'
9
-
10
- /**
11
- * The deck's master, built from the project's own tokens as the page computed
12
- * them rather than from the toolkit's design module. A slide that hides or
13
- * overrides a band takes a master without that band, so editing the footer
14
- * once in PowerPoint reaches every slide still on the master's own.
15
- */
16
-
17
- export interface DeckTheme {
18
- readonly background: string
19
- readonly ink: string
20
- readonly muted: string
21
- readonly accent: string
22
- readonly face: string
23
- }
24
-
25
- /** What the first slide computed, read in the page by `readTheme`. */
26
- export interface ThemeReading {
27
- /** Each role's `--color-*` value as hex, absent where none is declared. */
28
- readonly tokens: {
29
- readonly background?: string
30
- readonly text?: string
31
- readonly muted?: string
32
- readonly accent?: string
33
- }
34
- readonly body: { readonly background: string; readonly color: string }
35
- readonly fontFamily: string
36
- /** Every declared `--color-*` property in sheet order, for chart series. */
37
- readonly roles: readonly { readonly name: string; readonly hex: string }[]
38
- }
39
-
40
- export interface MasterBands {
41
- readonly header: boolean
42
- readonly footer: boolean
43
- }
44
-
45
- /** Intrinsic pixel size, which sets the mark's aspect inside its box. */
46
- export interface MarkSize {
47
- readonly width: number
48
- readonly height: number
49
- }
50
-
51
- const SLIDE_W = 13.333
52
- const MARGIN = 0.5
53
- const BAND_H = 0.4
54
- const HEADER_Y = 0.2
55
- const FOOTER_Y = 7.5 - 0.2 - BAND_H
56
- const SLOT_W = (SLIDE_W - 2 * MARGIN) / 3
57
- const NUMBER_W = 1
58
- const MARK_BOX = { w: 1.2, h: BAND_H }
59
- const BAND_PT = 10
60
-
61
- /**
62
- * A missing role falls back to what the slide's body computed, never to the
63
- * toolkit's palette, which would put Canon's colors on another project's deck.
64
- */
65
- export function deckTheme(reading: ThemeReading): {
66
- readonly theme: DeckTheme
67
- readonly notices: readonly string[]
68
- } {
69
- const { tokens, body } = reading
70
- const missing = (
71
- [
72
- ['background', tokens.background],
73
- ['text', tokens.text],
74
- ['muted', tokens.muted],
75
- ['accent', tokens.accent],
76
- ] as const
77
- )
78
- .filter(([, value]) => value === undefined)
79
- .map(([role]) => `--color-${role}`)
80
- return {
81
- theme: {
82
- background: tokens.background ?? body.background,
83
- ink: tokens.text ?? body.color,
84
- muted: tokens.muted ?? body.color,
85
- accent: tokens.accent ?? body.color,
86
- face: fontFace(reading.fontFamily),
87
- },
88
- notices:
89
- missing.length === 0
90
- ? []
91
- : [
92
- `no ${missing.join(' or ')} token, so the deck master takes the slide body ${missing.length === 1 ? 'color for it' : 'color for them'}`,
93
- ],
94
- }
95
- }
96
-
97
- export function masterName(bands: MasterBands): string {
98
- const parts = [bands.header && 'header', bands.footer && 'footer'].filter(
99
- Boolean,
100
- )
101
- return parts.length === 0 ? 'canon-bare' : `canon-${parts.join('-')}`
102
- }
103
-
104
- const SLOT_ALIGN: Record<BandSlot, PptxGenJS.HAlign> = {
105
- left: 'left',
106
- center: 'center',
107
- right: 'right',
108
- }
109
-
110
- /**
111
- * One text object per filled slot. The master draws these for a band it
112
- * carries, and a slide overriding a band draws its own through the same call.
113
- */
114
- export function bandTexts(
115
- band: Omit<Band, 'show'>,
116
- kind: 'header' | 'footer',
117
- theme: DeckTheme,
118
- options: { readonly hasMark?: boolean } = {},
119
- ): { readonly text: string; readonly options: PptxGenJS.TextPropsOptions }[] {
120
- return BAND_SLOTS.flatMap((slot, index) => {
121
- const text = band[slot]
122
- if (!text) return []
123
- const isMarkSlot = kind === 'header' && slot === 'right' && options.hasMark
124
- return [
125
- {
126
- text,
127
- options: {
128
- x: MARGIN + index * SLOT_W,
129
- y: kind === 'header' ? HEADER_Y : FOOTER_Y,
130
- w: SLOT_W - (isMarkSlot ? MARK_BOX.w + 0.1 : 0),
131
- h: BAND_H,
132
- margin: 0,
133
- align: SLOT_ALIGN[slot],
134
- valign: 'middle',
135
- fontFace: theme.face,
136
- fontSize: BAND_PT,
137
- color: kind === 'header' ? theme.ink : theme.muted,
138
- },
139
- },
140
- ]
141
- })
142
- }
143
-
144
- /** The right of the footer, which `deck.json` keeps free while numbers show. */
145
- export function slideNumberProps(theme: DeckTheme): PptxGenJS.SlideNumberProps {
146
- return {
147
- x: SLIDE_W - MARGIN - NUMBER_W,
148
- y: FOOTER_Y,
149
- w: NUMBER_W,
150
- h: BAND_H,
151
- margin: 0,
152
- align: 'right',
153
- valign: 'middle',
154
- fontFace: theme.face,
155
- fontSize: BAND_PT,
156
- color: theme.accent,
157
- }
158
- }
159
-
160
- // An SVG mark keeps the broken PNG fallback pptxgenjs writes, because the
161
- // screenshot patch in export.ts reaches slides and never layouts, so the mark
162
- // is a raster file.
163
- function markImage(path: string, size: MarkSize): PptxGenJS.ImageProps {
164
- const scale = Math.min(MARK_BOX.w / size.width, MARK_BOX.h / size.height)
165
- const w = Math.round(size.width * scale * 1000) / 1000
166
- const h = Math.round(size.height * scale * 1000) / 1000
167
- return { path, x: SLIDE_W - MARGIN - w, y: HEADER_Y, w, h }
168
- }
169
-
170
- export function buildMaster(
171
- deck: DeckConfig,
172
- theme: DeckTheme,
173
- bands: MasterBands,
174
- markSize: MarkSize = { width: 1, height: 1 },
175
- ): PptxGenJS.SlideMasterProps {
176
- const hasHeader = bands.header && deck.header.show
177
- const hasFooter = bands.footer && deck.footer.show
178
- const hasMark = deck.mark !== undefined
179
- const objects: NonNullable<PptxGenJS.SlideMasterProps['objects']> = [
180
- ...(deck.mark ? [{ image: markImage(deck.mark, markSize) }] : []),
181
- ...(hasHeader
182
- ? bandTexts(deck.header, 'header', theme, { hasMark }).map((text) => ({
183
- text,
184
- }))
185
- : []),
186
- ...(hasFooter
187
- ? bandTexts(deck.footer, 'footer', theme).map((text) => ({ text }))
188
- : []),
189
- ]
190
- return {
191
- title: masterName(bands),
192
- background: { color: theme.background },
193
- objects,
194
- ...(hasFooter && deck.slideNumbers
195
- ? { slideNumber: slideNumberProps(theme) }
196
- : {}),
197
- }
198
- }