@erclx/canon 5.53.0 → 5.54.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 (94) hide show
  1. package/CHANGELOG.md +10 -0
  2. package/README.md +10 -9
  3. package/claude/.claude-plugin/plugin.json +1 -1
  4. package/claude/skills/canon-cli/SKILL.md +5 -5
  5. package/claude/skills/design-identity/REQUIREMENT.md +2 -2
  6. package/claude/skills/design-identity/SKILL.md +6 -6
  7. package/claude/skills/design-record/REQUIREMENT.md +2 -2
  8. package/claude/skills/design-record/SKILL.md +4 -4
  9. package/claude/skills/design-record/references/folder.md +1 -1
  10. package/claude/skills/design-taste/REQUIREMENT.md +1 -1
  11. package/claude/skills/draw-figure/REQUIREMENT.md +1 -1
  12. package/claude/skills/draw-figure/SKILL.md +1 -1
  13. package/claude/skills/pick-by-eye/REQUIREMENT.md +4 -4
  14. package/claude/skills/pick-by-eye/SKILL.md +34 -41
  15. package/claude/skills/pick-by-eye/references/board.md +42 -0
  16. package/claude/skills/pick-by-eye/references/live-arms.md +3 -3
  17. package/claude/skills/plan-groundwork/SKILL.md +1 -1
  18. package/claude/skills/teach-craft/REQUIREMENT.md +1 -1
  19. package/claude/skills/teach-craft/SKILL.md +32 -1
  20. package/claude/skills/teach-craft/references/adopted.md +113 -0
  21. package/claude/skills/teach-craft/references/lesson-craft.md +10 -2
  22. package/claude/skills/teach-craft/references/pedagogy.md +29 -2
  23. package/docs/agents/install-and-sync.md +0 -8
  24. package/docs/target/migrations.md +8 -3
  25. package/docs/target/projects.md +1 -1
  26. package/docs/workflow/skill-map.md +0 -1
  27. package/docs/workflow/visual-design-workflow.md +1 -4
  28. package/governance/detect.toml +1 -6
  29. package/governance/renames.toml +0 -1
  30. package/package.json +2 -5
  31. package/src/claude/cases/misc.ts +0 -5
  32. package/src/claude/skills-audit.ts +1 -0
  33. package/src/cli/help.ts +0 -3
  34. package/src/cli.ts +0 -2
  35. package/src/commands/design.ts +16 -315
  36. package/src/commands/sync.ts +4 -5
  37. package/src/design/regen.ts +5 -32
  38. package/src/design/render.ts +1 -1
  39. package/src/design/tokens.ts +3 -2
  40. package/src/gate/stages.ts +4 -10
  41. package/src/gov/audit.ts +1 -6
  42. package/src/markdown/scope.ts +2 -4
  43. package/src/shipped/references.ts +1 -2
  44. package/src/sync/check.ts +4 -29
  45. package/src/sync/stamp.ts +6 -6
  46. package/src/sync/target.ts +1 -4
  47. package/tooling/claude/reference.md +1 -1
  48. package/tooling/claude/seeds/canon/DESIGN.md +1 -1
  49. package/claude/skills/canvas-board/REQUIREMENT.md +0 -35
  50. package/claude/skills/canvas-board/SKILL.md +0 -143
  51. package/claude/skills/canvas-board/references/canvas.md +0 -170
  52. package/governance/rules/ui/canvas.md +0 -13
  53. package/src/canvas/address.ts +0 -227
  54. package/src/canvas/arrange.ts +0 -66
  55. package/src/canvas/capture.ts +0 -391
  56. package/src/canvas/client/app.tsx +0 -188
  57. package/src/canvas/client/inspector/align-grid.tsx +0 -162
  58. package/src/canvas/client/inspector/color-field.tsx +0 -398
  59. package/src/canvas/client/inspector/color-inputs.tsx +0 -139
  60. package/src/canvas/client/inspector/color-picker.tsx +0 -668
  61. package/src/canvas/client/inspector/color-space.ts +0 -240
  62. package/src/canvas/client/inspector/field.tsx +0 -263
  63. package/src/canvas/client/inspector/fields.css +0 -763
  64. package/src/canvas/client/inspector/section.tsx +0 -27
  65. package/src/canvas/client/inspector/size-field.tsx +0 -69
  66. package/src/canvas/client/inspector/token-select.tsx +0 -109
  67. package/src/canvas/client/inspector/values.ts +0 -297
  68. package/src/canvas/client/inspector.tsx +0 -692
  69. package/src/canvas/client/keys.ts +0 -71
  70. package/src/canvas/client/layers.tsx +0 -118
  71. package/src/canvas/client/main.tsx +0 -71
  72. package/src/canvas/client/pages-panel.tsx +0 -212
  73. package/src/canvas/client/panel-handle.tsx +0 -90
  74. package/src/canvas/client/selection.tsx +0 -199
  75. package/src/canvas/client/shell.css +0 -762
  76. package/src/canvas/client/state.ts +0 -792
  77. package/src/canvas/client/surface.tsx +0 -803
  78. package/src/canvas/client/theme-panel.tsx +0 -55
  79. package/src/canvas/client/tools.tsx +0 -153
  80. package/src/canvas/content.ts +0 -781
  81. package/src/canvas/edit.ts +0 -575
  82. package/src/canvas/editing.ts +0 -203
  83. package/src/canvas/fit.ts +0 -238
  84. package/src/canvas/global.d.ts +0 -15
  85. package/src/canvas/history.ts +0 -116
  86. package/src/canvas/index.html +0 -20
  87. package/src/canvas/server.ts +0 -766
  88. package/src/canvas/tokens.ts +0 -221
  89. package/src/commands/canvas.ts +0 -1097
  90. package/src/design/adapter.ts +0 -59
  91. package/src/design/base.css +0 -203
  92. package/src/design/brand-favicon.ts +0 -18
  93. package/src/design/neutral.ts +0 -127
  94. package/src/design/project-fonts.ts +0 -392
@@ -1,55 +0,0 @@
1
- /** @jsxImportSource preact */
2
- import type { JSX } from 'preact'
3
- import { tokens } from '@/canvas/client/state'
4
- import type { Token, TokenKind } from '@/canvas/tokens'
5
-
6
- const KIND_LABEL: Record<TokenKind, string> = {
7
- color: 'Color',
8
- spacing: 'Spacing',
9
- radius: 'Radius',
10
- 'font-family': 'Font family',
11
- 'font-size': 'Font size',
12
- other: 'Other',
13
- }
14
-
15
- /**
16
- * A swatch paints the value in the chrome's document, where the frame's own
17
- * custom properties are not defined, so a value still naming one shows none.
18
- */
19
- function Swatch({ token }: { readonly token: Token }): JSX.Element | null {
20
- const paint = token.resolved ?? token.value
21
- if (paint.includes('var(')) return null
22
- return (
23
- <span class="swatch" aria-hidden="true" style={{ background: paint }} />
24
- )
25
- }
26
-
27
- /** Read-only: the frames' tokens are edited in their stylesheet, not here. */
28
- export function ThemePanel(): JSX.Element {
29
- const groups = tokens.value?.groups ?? []
30
- return (
31
- <section aria-label="Theme">
32
- {groups.length === 0 ? (
33
- <p class="empty">
34
- No tokens resolve for this project, so there is nothing to list.{' '}
35
- {tokens.value?.notice ?? ''}
36
- </p>
37
- ) : (
38
- groups.map((group) => (
39
- <div key={group.kind}>
40
- <h2 class="section-label">{KIND_LABEL[group.kind]}</h2>
41
- <ul class="tokens" aria-label={`${KIND_LABEL[group.kind]} tokens`}>
42
- {group.tokens.map((token) => (
43
- <li key={token.name} class="token" title={token.value}>
44
- {group.kind === 'color' ? <Swatch token={token} /> : null}
45
- <span class="row-label">{token.name}</span>
46
- <span class="row-meta token-value">{token.value}</span>
47
- </li>
48
- ))}
49
- </ul>
50
- </div>
51
- ))
52
- )}
53
- </section>
54
- )
55
- }
@@ -1,153 +0,0 @@
1
- /** @jsxImportSource preact */
2
- import type { JSX } from 'preact'
3
- import {
4
- activeTool,
5
- history,
6
- panelsHidden,
7
- redo,
8
- shownTool,
9
- type Tool,
10
- togglePanels,
11
- undo,
12
- } from '@/canvas/client/state'
13
-
14
- interface ToolButton {
15
- readonly tool: Tool
16
- readonly name: string
17
- readonly key: string
18
- readonly icon: JSX.Element
19
- }
20
-
21
- const TOOLS: readonly ToolButton[] = [
22
- {
23
- tool: 'move',
24
- name: 'Move',
25
- key: 'V',
26
- icon: (
27
- <svg viewBox="0 0 16 16" aria-hidden="true">
28
- <path d="M3.5 2.5l9 4.2-3.9 1.2-1.4 3.8z" />
29
- </svg>
30
- ),
31
- },
32
- {
33
- tool: 'pan',
34
- name: 'Pan',
35
- key: 'H',
36
- icon: (
37
- <svg viewBox="0 0 16 16" aria-hidden="true">
38
- <path d="M5.5 8.5V4a1 1 0 0 1 2 0v3.5M7.5 7V2.8a1 1 0 0 1 2 0V7M9.5 7V3.6a1 1 0 0 1 2 0V8M11.5 7.5a1 1 0 0 1 2 0v2.2A4.8 4.8 0 0 1 8.7 14.5h-.6a4.3 4.3 0 0 1-3.2-1.4L2.6 10.6a1 1 0 0 1 1.5-1.4l1.4 1.3" />
39
- </svg>
40
- ),
41
- },
42
- ]
43
-
44
- interface HistoryButton {
45
- readonly name: 'Undo' | 'Redo'
46
- readonly shortcut: string
47
- readonly keys: string
48
- readonly run: () => Promise<void>
49
- readonly icon: JSX.Element
50
- }
51
-
52
- /** The modifier the platform names for undo, Cmd on macOS and Ctrl elsewhere. */
53
- const MOD = /Mac|iPhone|iPad/.test(globalThis.navigator?.platform ?? '')
54
- ? 'Cmd'
55
- : 'Ctrl'
56
-
57
- const HISTORY_BUTTONS: readonly HistoryButton[] = [
58
- {
59
- name: 'Undo',
60
- shortcut: `${MOD}+Z`,
61
- keys: 'Control+Z Meta+Z',
62
- run: () => undo(),
63
- icon: (
64
- <svg viewBox="0 0 16 16" aria-hidden="true">
65
- <path d="M5.5 3.5L2.5 6.5l3 3M2.5 6.5h7a4 4 0 0 1 0 8H7" />
66
- </svg>
67
- ),
68
- },
69
- {
70
- name: 'Redo',
71
- shortcut: `${MOD}+Shift+Z`,
72
- keys: 'Control+Shift+Z Meta+Shift+Z Control+Y',
73
- run: () => redo(),
74
- icon: (
75
- <svg viewBox="0 0 16 16" aria-hidden="true">
76
- <path d="M10.5 3.5l3 3-3 3M13.5 6.5h-7a4 4 0 0 0 0 8H9" />
77
- </svg>
78
- ),
79
- },
80
- ]
81
-
82
- /**
83
- * The tool strip floating at the surface's left edge, one button a tool, then
84
- * undo and redo, each disabled while the server holds nothing to step.
85
- */
86
- export function ToolStrip(): JSX.Element {
87
- const shown = shownTool.value
88
- const { canUndo, canRedo } = history.value
89
- return (
90
- <div
91
- class="tools"
92
- role="toolbar"
93
- aria-label="Tools"
94
- aria-orientation="vertical"
95
- >
96
- {TOOLS.map(({ tool, name, key, icon }) => (
97
- <button
98
- key={tool}
99
- type="button"
100
- class="tool-button"
101
- aria-label={`${name} (${key})`}
102
- aria-keyshortcuts={key}
103
- aria-pressed={shown === tool ? 'true' : 'false'}
104
- title={`${name} (${key})`}
105
- data-tool={tool}
106
- onClick={() => {
107
- activeTool.value = tool
108
- }}
109
- >
110
- {icon}
111
- </button>
112
- ))}
113
- <span class="tools-divider" aria-hidden="true" />
114
- {HISTORY_BUTTONS.map(({ name, shortcut, keys, run, icon }) => (
115
- <button
116
- key={name}
117
- type="button"
118
- class="tool-button"
119
- aria-label={`${name} (${shortcut})`}
120
- aria-keyshortcuts={keys}
121
- title={`${name} (${shortcut})`}
122
- disabled={name === 'Undo' ? !canUndo : !canRedo}
123
- onClick={() => void run()}
124
- >
125
- {icon}
126
- </button>
127
- ))}
128
- <span class="tools-divider" aria-hidden="true" />
129
- <PanelsButton />
130
- </div>
131
- )
132
- }
133
-
134
- /** Named by what a press does now, so the panels come back by mouse too. */
135
- function PanelsButton(): JSX.Element {
136
- const name = panelsHidden.value ? 'Show panels' : 'Hide panels'
137
- return (
138
- <button
139
- type="button"
140
- class="tool-button"
141
- aria-label={`${name} (\\)`}
142
- aria-keyshortcuts="\\"
143
- title={`${name} (\\)`}
144
- data-panels={panelsHidden.value ? 'hidden' : 'shown'}
145
- onClick={togglePanels}
146
- >
147
- <svg viewBox="0 0 16 16" aria-hidden="true">
148
- <rect x="2" y="3" width="12" height="10" rx="1.5" />
149
- {panelsHidden.value ? null : <path d="M5.5 3v10M10.5 3v10" />}
150
- </svg>
151
- </button>
152
- )
153
- }