konpeki 0.2.0 → 0.3.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.
- package/AGENTS.md +1 -1
- package/CONTRIBUTING.md +36 -0
- package/README.md +54 -18
- package/SECURITY.md +22 -0
- package/SETUP.md +112 -51
- package/composition/README.md +16 -3
- package/composition/compile.ts +1 -1
- package/composition/schema.json +9 -0
- package/composition/schema.ts +3 -1
- package/composition/types.ts +3 -1
- package/design/themes/README.md +25 -7
- package/design/themes/index.ts +15 -4
- package/docs/development.md +71 -11
- package/docs/workflow.md +11 -4
- package/index.html +17 -1
- package/package.json +8 -2
- package/plugin.json +22 -0
- package/public/og.png +0 -0
- package/runtime/konpeki.mjs +41 -13
- package/skills/konpeki/SKILL.md +186 -0
- package/skills/konpeki/assets/blank.json +23 -0
- package/skills/konpeki/scripts/ensure-runtime.mjs +69 -0
- package/skills/konpeki/scripts/prepare-document.mjs +40 -0
- package/slides/introducing-konpeki/PROMPT.md +21 -0
- package/slides/introducing-konpeki/README.md +52 -30
- package/slides/introducing-konpeki/SOURCE.md +16 -10
- package/slides/introducing-konpeki/author.ts +44 -42
- package/slides/introducing-konpeki/composition.json +135 -135
- package/src/app/App.tsx +87 -19
- package/src/components/Canvas.tsx +1 -1
- package/src/components/InspectorPanel.tsx +93 -40
- package/src/components/WorkspaceChrome.tsx +92 -5
- package/src/lib/storage.ts +38 -10
- package/src/main.tsx +3 -0
- package/src/styles/chrome.css +97 -25
- package/src/styles/feedback.css +20 -3
- package/src/styles/right-panel.css +28 -27
- package/src/styles/shell.css +60 -29
- package/.agents/skills/authoring-visuals/SKILL.md +0 -93
package/AGENTS.md
CHANGED
|
@@ -7,7 +7,7 @@ presents that same document.
|
|
|
7
7
|
## Choose the relevant guide
|
|
8
8
|
|
|
9
9
|
- First-time setup: [SETUP.md](SETUP.md).
|
|
10
|
-
-
|
|
10
|
+
- Opening the editor, creating or revising visuals: [Konpeki skill](skills/konpeki/SKILL.md)
|
|
11
11
|
and [AUTHORING.md](AUTHORING.md), which owns design and factual-fidelity rules.
|
|
12
12
|
- Changing the application: [development guidance](docs/development.md) and
|
|
13
13
|
the [composition contract](composition/README.md).
|
package/CONTRIBUTING.md
ADDED
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
# Contributing to Konpeki
|
|
2
|
+
|
|
3
|
+
Thanks for helping improve Konpeki. Bug reports, focused fixes and additions that
|
|
4
|
+
strengthen the shared human-agent canvas are welcome.
|
|
5
|
+
|
|
6
|
+
## Before opening a change
|
|
7
|
+
|
|
8
|
+
- Search existing issues before filing a new one.
|
|
9
|
+
- Use an issue to discuss large features or changes to the composition contract
|
|
10
|
+
before investing in an implementation.
|
|
11
|
+
- Do not include private compositions, credentials or proprietary source material
|
|
12
|
+
in issues, fixtures or screenshots.
|
|
13
|
+
- Report security concerns through the process in [SECURITY.md](SECURITY.md), not
|
|
14
|
+
through a public issue.
|
|
15
|
+
|
|
16
|
+
## Development
|
|
17
|
+
|
|
18
|
+
Follow [docs/development.md](docs/development.md) to install the pinned Node.js and
|
|
19
|
+
pnpm toolchain. Keep changes scoped and preserve existing composition compatibility
|
|
20
|
+
unless a contract change has been agreed in advance.
|
|
21
|
+
|
|
22
|
+
Before opening a pull request, run:
|
|
23
|
+
|
|
24
|
+
```sh
|
|
25
|
+
mise exec -- pnpm check
|
|
26
|
+
mise exec -- pnpm test
|
|
27
|
+
mise exec -- pnpm build
|
|
28
|
+
mise exec -- pnpm check:package
|
|
29
|
+
```
|
|
30
|
+
|
|
31
|
+
UI changes also require visual inspection using the relevant browser checks in
|
|
32
|
+
[docs/development.md](docs/development.md#verification). Include the affected
|
|
33
|
+
states and verification performed in the pull request description.
|
|
34
|
+
|
|
35
|
+
By submitting a contribution, you agree that it is licensed under the repository's
|
|
36
|
+
[Apache-2.0 license](LICENSE).
|
package/README.md
CHANGED
|
@@ -1,42 +1,77 @@
|
|
|
1
|
-

|
|
2
2
|
|
|
3
|
-
**
|
|
4
|
-
|
|
3
|
+
**Create clear visuals with your coding agent.** Konpeki is an opinionated design
|
|
4
|
+
framework for covers, social graphics, visual explanations and presentations.
|
|
5
5
|
|
|
6
6
|
Give your coding agent notes, source material and a brief. Konpeki provides the
|
|
7
|
-
|
|
8
|
-
|
|
7
|
+
canvas, design guidance, typography and semantic components for the intended
|
|
8
|
+
format and dimensions.
|
|
9
9
|
|
|
10
10
|
People and agents edit the same composition. Export a page as PNG, download its
|
|
11
11
|
editable JSON, or use **Present** for a chrome-free presentation.
|
|
12
12
|
|
|
13
|
-
##
|
|
13
|
+
## Use with your agent
|
|
14
14
|
|
|
15
15
|
Requires **Node.js 24+**, npm, a coding agent that can edit files and run commands,
|
|
16
16
|
and a browser.
|
|
17
17
|
|
|
18
|
-
|
|
19
|
-
|
|
18
|
+
Install the [Konpeki skill](skills/konpeki/) with your agent's
|
|
19
|
+
skill installer. Install the whole directory, including `scripts/` and `assets/`, not just
|
|
20
|
+
`SKILL.md`. For example, ask a Codex skill installer:
|
|
20
21
|
|
|
21
22
|
```text
|
|
22
|
-
|
|
23
|
-
and set up Konpeki in this workspace.
|
|
24
|
-
Turn these notes into a three-slide explanation for engineers. Make the request
|
|
25
|
-
flow and failure handling easy to follow. Preserve facts and caveats. Save editable composition
|
|
26
|
-
JSON, open the preview, then render, inspect and fix the result.
|
|
27
|
-
|
|
28
|
-
[Paste notes or provide source files.]
|
|
23
|
+
Install the konpeki skill from vcfgdev/konpeki, at skills/konpeki.
|
|
29
24
|
```
|
|
30
25
|
|
|
26
|
+
Then choose a mode, or just give it a brief:
|
|
27
|
+
|
|
28
|
+
| Workflow | Codex CLI / IDE | Claude Code standalone skill |
|
|
29
|
+
| --- | --- | --- |
|
|
30
|
+
| Open a blank or existing editor; no generation | `$konpeki init` | `/konpeki init` |
|
|
31
|
+
| Create, inspect and revise a visual | `$konpeki generate …` | `/konpeki generate …` |
|
|
32
|
+
|
|
33
|
+
`init` accepts a composition JSON path and preserves existing work. `generate`
|
|
34
|
+
uses the materials already in your conversation and prepares the runtime if
|
|
35
|
+
needed; there is no required init step. Plugin installations may namespace the
|
|
36
|
+
skill. Other hosts can select the skill or use natural language:
|
|
37
|
+
|
|
38
|
+
> Use Konpeki to turn these launch notes into a product announcement.
|
|
39
|
+
|
|
40
|
+
Or ask for an article cover, a social graphic, a chart, a diagram or a presentation.
|
|
41
|
+
Natural-language creation requests select `generate` automatically.
|
|
42
|
+
The skill reuses a compatible runtime or, with permission, installs the pinned
|
|
43
|
+
npm release in a user cache. It creates editable JSON in your workspace, opens
|
|
44
|
+
the preview and visually checks the result. You do not need to clone Konpeki,
|
|
45
|
+
edit a package manifest, or repeat your prompt in a blank canvas.
|
|
46
|
+
|
|
47
|
+
First-run installation, browser permissions and remote preview forwarding depend
|
|
48
|
+
on your agent host. If skills are unavailable, give the agent the public
|
|
49
|
+
[SETUP.md](https://raw.githubusercontent.com/vcfgdev/konpeki/main/SETUP.md) URL and
|
|
50
|
+
your brief together. The setup guide also covers the optional Codex plugin package.
|
|
51
|
+
|
|
31
52
|
Ask for revisions in the same conversation. Add “Stop after the outline for
|
|
32
53
|
approval” when you want a checkpoint. Supply a visual direction or leave it open;
|
|
33
54
|
[authoring modes](AUTHORING.md#authoring-mode) provide defaults without requiring
|
|
34
55
|
you to choose fonts, colors or layouts first.
|
|
35
56
|
|
|
36
|
-
|
|
37
|
-
|
|
57
|
+
Canvas review notes use **Build it** and an active agent listener, or the
|
|
58
|
+
button's copyable handoff to resume the agent. Opening the editor alone does not
|
|
59
|
+
connect or wake an agent. The skill modes are not terminal CLI subcommands.
|
|
60
|
+
|
|
61
|
+
## Try the editor in your browser
|
|
62
|
+
|
|
63
|
+
[Open the editable Konpeki example](https://vcfgdev.github.io/konpeki/?example=introducing-konpeki).
|
|
64
|
+
|
|
65
|
+
The browser-only playground lets you edit an example or start blank, keep a local
|
|
66
|
+
working copy, import/download editable JSON, export PNG and present. It requires
|
|
67
|
+
no account or AI service. Browser-local data is not cloud backup; download JSON
|
|
68
|
+
to keep or move your work. Continue with your coding agent using that file.
|
|
69
|
+
|
|
70
|
+
The [GitHub Pages playground](docs/development.md#github-pages) does not connect
|
|
71
|
+
to an agent or expose **Build it**. The agent-led workflow above is the route
|
|
72
|
+
from a prompt to a finished visual.
|
|
38
73
|
|
|
39
|
-
##
|
|
74
|
+
## Manual npm start
|
|
40
75
|
|
|
41
76
|
For a manual start, install [Konpeki from npm](https://www.npmjs.com/package/konpeki)
|
|
42
77
|
in your workspace (run `npm init -y` first in a new, empty directory):
|
|
@@ -60,6 +95,7 @@ authenticated preview mechanism rather than sharing a local address.
|
|
|
60
95
|
- [Canvas workflow](docs/workflow.md): page sizes, export and agent handoff.
|
|
61
96
|
- [Development](docs/development.md): architecture, demo hosting, packaging and checks.
|
|
62
97
|
- [Composition contract](composition/README.md) and [design resources](design/README.md).
|
|
98
|
+
- [Contributing](CONTRIBUTING.md) and [security policy](SECURITY.md).
|
|
63
99
|
|
|
64
100
|
Konpeki requires no account or hosted AI service. Your coding agent's pricing
|
|
65
101
|
and data handling still apply. Supply facts and approved assets; examples and
|
package/SECURITY.md
ADDED
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
# Security policy
|
|
2
|
+
|
|
3
|
+
## Supported versions
|
|
4
|
+
|
|
5
|
+
Konpeki is early-stage software. Security fixes are made against the latest npm
|
|
6
|
+
release and the `main` branch; older releases are not maintained separately.
|
|
7
|
+
|
|
8
|
+
## Reporting a vulnerability
|
|
9
|
+
|
|
10
|
+
Do not disclose a suspected vulnerability in a public issue. Use GitHub's
|
|
11
|
+
**Security → Report a vulnerability** flow to send the maintainers a private
|
|
12
|
+
report. Include the affected version, reproduction steps, impact and any suggested
|
|
13
|
+
mitigation. Please avoid accessing data that is not yours while investigating.
|
|
14
|
+
|
|
15
|
+
The maintainers will acknowledge the report, assess its impact and coordinate a
|
|
16
|
+
fix and disclosure. If private vulnerability reporting is unavailable, open an
|
|
17
|
+
issue containing no sensitive details and ask the maintainers for a private
|
|
18
|
+
reporting channel.
|
|
19
|
+
|
|
20
|
+
Konpeki's file-backed preview uses a session URL as a local authorization secret.
|
|
21
|
+
Do not publish that URL or its token, and expose remote previews only through an
|
|
22
|
+
authenticated tunnel or workspace portal.
|
package/SETUP.md
CHANGED
|
@@ -1,79 +1,133 @@
|
|
|
1
1
|
# Set up Konpeki for your coding agent
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
Install the `konpeki` skill once, then give your agent a creation brief:
|
|
4
4
|
|
|
5
5
|
```text
|
|
6
|
-
|
|
7
|
-
Use it to explain [source] to [audience], with the takeaway [idea].
|
|
8
|
-
Create [one visual / a short presentation]. Open the editable preview,
|
|
9
|
-
then render, inspect and fix the result.
|
|
6
|
+
Use Konpeki to turn these launch notes into a product announcement.
|
|
10
7
|
```
|
|
11
8
|
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
and
|
|
15
|
-
agent
|
|
9
|
+
Opening and inspecting the editable preview is part of the skill, not an extra
|
|
10
|
+
instruction the person has to remember. Covers, social graphics, charts,
|
|
11
|
+
diagrams and presentations use the same workflow. Keep the brief and revisions
|
|
12
|
+
in agent chat; the browser edits, reviews, presents and exports the document.
|
|
13
|
+
Konpeki supplies no hosted AI service or additional model subscription.
|
|
16
14
|
|
|
17
|
-
## 1.
|
|
15
|
+
## 1. Install the skill or plugin
|
|
18
16
|
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
17
|
+
Use the host's skill installer to install the complete
|
|
18
|
+
[`skills/konpeki`](skills/konpeki/) directory from
|
|
19
|
+
`vcfgdev/konpeki`. Keep its `scripts/` and `assets/` directories. In Codex, ask the skill installer:
|
|
20
|
+
|
|
21
|
+
```text
|
|
22
|
+
Install the konpeki skill from vcfgdev/konpeki, at skills/konpeki.
|
|
23
|
+
```
|
|
24
|
+
|
|
25
|
+
Other agents may use another installer or skill location. Follow their documented
|
|
26
|
+
mechanism; there is no universal slash command. If a host does not discover skills,
|
|
27
|
+
read the installed `SKILL.md` directly. Do not overwrite existing agent guidance.
|
|
28
|
+
|
|
29
|
+
If you previously installed `authoring-visuals`, replace that installed skill
|
|
30
|
+
with `konpeki` rather than keeping both copies. The runtime package is unchanged.
|
|
31
|
+
|
|
32
|
+
### Choose init or generate
|
|
33
|
+
|
|
34
|
+
| Mode | Codex CLI / IDE | Claude Code standalone skill |
|
|
35
|
+
| --- | --- | --- |
|
|
36
|
+
| Open the editor without generating | `$konpeki init [composition.json]` | `/konpeki init [composition.json]` |
|
|
37
|
+
| Create or revise from your materials | `$konpeki generate [brief]` | `/konpeki generate [brief]` |
|
|
38
|
+
|
|
39
|
+
`generate` automatically prepares the runtime when needed. It uses materials
|
|
40
|
+
already supplied in chat, referenced files and the current canvas; it does not
|
|
41
|
+
require `init` first or a repeated brief. Natural-language “Use Konpeki to…”
|
|
42
|
+
creation requests also select generate. Follow-up feedback continues the same
|
|
43
|
+
document without another command. Other GUIs may use skill selection, and plugin
|
|
44
|
+
installations may namespace the skill. These modes are not terminal subcommands.
|
|
45
|
+
|
|
46
|
+
For `init`, choose the supplied path or the document already active in the
|
|
47
|
+
conversation; otherwise use `slides/untitled/composition.json`. After resolving
|
|
48
|
+
the runtime below, run:
|
|
49
|
+
|
|
50
|
+
```sh
|
|
51
|
+
node "<installed-skill>/scripts/prepare-document.mjs" "<cli>" "<composition.json>"
|
|
52
|
+
node "<cli>" preview "<composition.json>"
|
|
53
|
+
```
|
|
54
|
+
|
|
55
|
+
The helper validates existing files without rewriting them. For a missing file,
|
|
56
|
+
it validates and writes the bundled blank document without overwriting a file
|
|
57
|
+
created concurrently. Invalid data is preserved, not replaced with a sample.
|
|
58
|
+
Reuse an already running preview for the same file. Open and verify its exact
|
|
59
|
+
session URL as described below, then stop: init does not generate or start a
|
|
60
|
+
review listener. The starter works with the pinned published runtime; it does
|
|
61
|
+
not import TypeScript from `node_modules` or require an unreleased `init` CLI.
|
|
62
|
+
|
|
63
|
+
### Optional Codex plugin packaging
|
|
64
|
+
|
|
65
|
+
The root `plugin.json` packages that same skill, without MCP servers, hooks or
|
|
66
|
+
credentials. `.agents/plugins/marketplace.json` exposes it as a repo marketplace.
|
|
67
|
+
On a compatible Codex client, add the repository marketplace with:
|
|
26
68
|
|
|
27
69
|
```sh
|
|
28
|
-
|
|
70
|
+
codex plugin marketplace add vcfgdev/konpeki
|
|
29
71
|
```
|
|
30
72
|
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
73
|
+
Then install Konpeki from that source in the desktop plugin directory and test it
|
|
74
|
+
in a new conversation. Install either the standalone skill or the plugin, not
|
|
75
|
+
both. This is repository distribution, not a listing in OpenAI's public directory.
|
|
76
|
+
It becomes available from the remote repository after these files are published.
|
|
77
|
+
Native Codex GUI installation needs a separate client smoke test; package checks
|
|
78
|
+
alone do not establish host compatibility.
|
|
37
79
|
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
80
|
+
## 2. Let the skill prepare the runtime
|
|
81
|
+
|
|
82
|
+
Check Node.js 24+, npm, command/file access and the host's browser capabilities.
|
|
83
|
+
Follow host approval and toolchain rules if prerequisites are missing.
|
|
84
|
+
|
|
85
|
+
From the user's document workspace, run:
|
|
86
|
+
|
|
87
|
+
```sh
|
|
88
|
+
node "<installed-skill>/scripts/ensure-runtime.mjs"
|
|
89
|
+
```
|
|
42
90
|
|
|
43
|
-
|
|
91
|
+
The script reuses a compatible workspace installation, surrounding Konpeki
|
|
92
|
+
checkout, or cached runtime. If none exists, obtain any required host approval
|
|
93
|
+
and rerun with `--install`. It installs the pinned `konpeki@0.3.0` release in a
|
|
94
|
+
user cache, without adding project dependencies or changing project guidance.
|
|
95
|
+
Missing/incompatible runtimes are never reported ready. The script prints JSON
|
|
96
|
+
with `root`, `cli` and `version`; installation diagnostics go to stderr.
|
|
44
97
|
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
98
|
+
Use the returned absolute `root` for resources and `cli` for commands. Do not rely
|
|
99
|
+
on repo-relative paths from a copied skill. Keep documents outside the runtime.
|
|
100
|
+
For manual project-local npm installation, see [Manual npm start](README.md#manual-npm-start).
|
|
101
|
+
Repository contributors instead use the [mise setup](docs/development.md); users
|
|
102
|
+
of the published package do not need mise.
|
|
49
103
|
|
|
50
|
-
|
|
51
|
-
a faithful result. Do not ask the person to re-enter their intent in the canvas.
|
|
52
|
-
Create a new document without overwriting an example or existing work. By default,
|
|
53
|
-
save it as `slides/<name>/composition.json` with its brief and source notes beside
|
|
54
|
-
it. If the user specifies another destination, pass that file's absolute path to
|
|
55
|
-
the CLI.
|
|
104
|
+
## 3. Generate, validate and open the visual
|
|
56
105
|
|
|
57
|
-
|
|
106
|
+
Follow the installed skill and the runtime's `AUTHORING.md`, composition contract
|
|
107
|
+
and design resources. Use the brief already supplied; ask only for information
|
|
108
|
+
needed for faithful work. Do not ask the person to repeat their prompt in the
|
|
109
|
+
canvas. Continue the current document when revising or following init. Save new
|
|
110
|
+
work to an unused `slides/<name>/composition.json`, with brief/source notes,
|
|
111
|
+
unless the person chooses another destination. Preserve existing documents.
|
|
58
112
|
|
|
59
|
-
For an installation check, validate the bundled
|
|
113
|
+
For an installation check, validate the bundled example:
|
|
60
114
|
|
|
61
115
|
```sh
|
|
62
|
-
|
|
116
|
+
node "<cli>" validate "<root>/slides/introducing-konpeki/composition.json"
|
|
63
117
|
```
|
|
64
118
|
|
|
65
119
|
After authoring the user's document:
|
|
66
120
|
|
|
67
121
|
```sh
|
|
68
|
-
|
|
69
|
-
|
|
122
|
+
node "<cli>" validate "slides/<name>/composition.json"
|
|
123
|
+
node "<cli>" preview "slides/<name>/composition.json"
|
|
70
124
|
```
|
|
71
125
|
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
126
|
+
Reuse an existing preview for that file when available. Keep the process running
|
|
127
|
+
using the host's supported service mechanism. Open the exact printed session URL
|
|
128
|
+
in the in-app browser when supported, otherwise the regular browser. Preserve its
|
|
129
|
+
query string and never publish its capability token. In remote workspaces, use
|
|
130
|
+
authenticated preview/port forwarding, not a remote loopback address.
|
|
77
131
|
|
|
78
132
|
Verify that the browser loads the intended document, then render, inspect and
|
|
79
133
|
repair the result as directed by the skill. The file-backed canvas saves browser
|
|
@@ -82,5 +136,12 @@ validation succeeds and the intended composition opens—not merely when a serve
|
|
|
82
136
|
process starts. If browser inspection is unavailable, report that limitation.
|
|
83
137
|
|
|
84
138
|
Return the document path, usable preview link and verification outcome. Continue
|
|
85
|
-
revisions in agent chat.
|
|
86
|
-
|
|
139
|
+
revisions in agent chat. For submitted canvas reviews, generate checks `request`,
|
|
140
|
+
claims a `submitted` request with `wait`, applies the notes against the latest
|
|
141
|
+
document, and acknowledges it with `finish` only after validation and inspection.
|
|
142
|
+
Coordinate ownership before resuming an already `working` request.
|
|
143
|
+
|
|
144
|
+
An ongoing listener runs only when explicitly requested and supported by the host.
|
|
145
|
+
Otherwise, use **Copy prompt** after **Build it**, or resume generate in agent chat.
|
|
146
|
+
The [canvas workflow](docs/workflow.md) describes this handoff; the button cannot
|
|
147
|
+
wake an idle agent, and an open preview is not a live agent connection.
|
package/composition/README.md
CHANGED
|
@@ -54,9 +54,22 @@ copy is needed.
|
|
|
54
54
|
`theme:background`, `theme:surface`, `theme:divider`, `theme:accent`,
|
|
55
55
|
`theme:on-accent`, and `theme:wash`. `font-family` accepts `theme:heading-font`
|
|
56
56
|
and `theme:body-font`. These resolve from the deck theme in every canvas view.
|
|
57
|
-
Use on-accent for text over an accent fill.
|
|
58
|
-
|
|
59
|
-
|
|
57
|
+
Use on-accent for text over an accent fill. `theme.typography` independently selects
|
|
58
|
+
`plex-sans` (IBM Plex Sans throughout), `noto-sans` (Noto Sans throughout),
|
|
59
|
+
`plex-serif` (IBM Plex Serif headings / IBM Plex Sans body), or `hanken-grotesk`
|
|
60
|
+
(Hanken Grotesk throughout). `theme.id` still selects the color palette and
|
|
61
|
+
`theme.mode` selects Paper or Night. For example:
|
|
62
|
+
|
|
63
|
+
```json
|
|
64
|
+
{ "id": "green", "mode": "paper", "typography": "noto-sans" }
|
|
65
|
+
```
|
|
66
|
+
|
|
67
|
+
Omitting typography preserves the legacy pairing: Precision uses Noto Sans;
|
|
68
|
+
Editorial uses Plex Serif headings and Plex Sans body; other palettes use Plex
|
|
69
|
+
Sans. When revising colors, retain the current typography explicitly so changing
|
|
70
|
+
the palette does not change fonts. The editor does this automatically. Older
|
|
71
|
+
runtimes that do not support `theme.typography` reject documents containing it;
|
|
72
|
+
use a compatible runtime rather than removing the field and changing appearance.
|
|
60
73
|
|
|
61
74
|
Literal values are fixed overrides. SVG conversion preserves literals; it never
|
|
62
75
|
guesses roles from colors. Legacy raw SVG stays inert, fixed artwork. In the
|
package/composition/compile.ts
CHANGED
|
@@ -213,7 +213,7 @@ Legacy Text-block purpose, treatment, layout and logical-order fields are guidan
|
|
|
213
213
|
Text-block role controls typography and semantic placement: title, subtitle, body, caption or footnote. Use title for the main takeaway and footnote for sources, scope and caveats.
|
|
214
214
|
Ordinary Text blocks store visible copy in content (plain text with newlines) and typography in textStyle (size in slide pixels, weight 400/500/600, lineHeight, ink/muted/accent color and heading/body font). Intent is separate agent guidance, never displayed copy. Revise content for manual and agent-authored text alike; do not replace ordinary text with customVisual. Custom vectors remain for genuinely custom artwork.
|
|
215
215
|
When a Text block records a logical order other than none, express that relationship in its text and shape arrangement: parallel, progressive, cyclical, general-to-specific or hierarchical.
|
|
216
|
-
Resolve authoring mode to ${document.authoringMode ?? "default"} and theme to ${document.theme?.id ?? "plex"} / ${document.theme?.mode ?? "paper"}. Theme and authoring mode are independent.
|
|
216
|
+
Resolve authoring mode to ${document.authoringMode ?? "default"} and theme to ${document.theme?.id ?? "plex"} / ${document.theme?.mode ?? "paper"}. Theme and authoring mode are independent.${document.theme?.typography ? ` Use typography ${document.theme.typography} independently of the color palette. plex-sans uses IBM Plex Sans throughout; noto-sans uses Noto Sans throughout; plex-serif uses IBM Plex Serif headings with IBM Plex Sans body; hanken-grotesk uses Hanken Grotesk throughout. Preserve this choice when changing colors.` : ""}
|
|
217
217
|
For editable vector interiors, bind fill/stroke/color to theme:ink, theme:muted, theme:background, theme:surface, theme:divider, theme:accent, theme:on-accent or theme:wash. Bind font-family to theme:heading-font or theme:body-font. Literal values remain fixed overrides; never infer theme roles from imported colors. Check text bounds after font changes; do not silently shrink or rearrange content.
|
|
218
218
|
Preserve the supplied slide order and slide names. Do not hide overflow, shrink required content, merge slides, or silently add slides. Report an overfull brief and ask for a scope decision. When rendering is requested, inspect and repair every slide at presentation and review sizes. Deliver the updated composition JSON, any requested editable render source, verified output and limitations.
|
|
219
219
|
|
package/composition/schema.json
CHANGED
package/composition/schema.ts
CHANGED
|
@@ -4,6 +4,7 @@ import {
|
|
|
4
4
|
compositionSchema,
|
|
5
5
|
themeIds,
|
|
6
6
|
themeModes,
|
|
7
|
+
typographyIds,
|
|
7
8
|
vectorElementKinds,
|
|
8
9
|
} from "./types.ts";
|
|
9
10
|
import { chartTemplates, diagramTypes } from "./visualizations.ts";
|
|
@@ -319,7 +320,8 @@ export const schema = {
|
|
|
319
320
|
theme: object({
|
|
320
321
|
id: enumeration(themeIds),
|
|
321
322
|
mode: enumeration(themeModes),
|
|
322
|
-
|
|
323
|
+
typography: enumeration(typographyIds),
|
|
324
|
+
}, ["id", "mode"]),
|
|
323
325
|
slides: array(
|
|
324
326
|
object(
|
|
325
327
|
{
|
package/composition/types.ts
CHANGED
|
@@ -25,6 +25,8 @@ export const themeIds = [
|
|
|
25
25
|
export type ThemeId = (typeof themeIds)[number];
|
|
26
26
|
export const themeModes = ["paper", "night"] as const;
|
|
27
27
|
export type ThemeMode = (typeof themeModes)[number];
|
|
28
|
+
export const typographyIds = ["plex-sans", "noto-sans", "plex-serif", "hanken-grotesk"] as const;
|
|
29
|
+
export type TypographyId = (typeof typographyIds)[number];
|
|
28
30
|
export type Rect = { x: number; y: number; width: number; height: number };
|
|
29
31
|
export type Alignment = "start" | "center" | "end";
|
|
30
32
|
export type TitleStyle = "plain" | "prominent";
|
|
@@ -262,6 +264,6 @@ export type CompositionDocument = {
|
|
|
262
264
|
schema: typeof compositionSchema;
|
|
263
265
|
title: string;
|
|
264
266
|
authoringMode?: AuthoringMode;
|
|
265
|
-
theme?: { id: ThemeId; mode: ThemeMode };
|
|
267
|
+
theme?: { id: ThemeId; mode: ThemeMode; typography?: TypographyId };
|
|
266
268
|
slides: CompositionSlide[];
|
|
267
269
|
};
|
package/design/themes/README.md
CHANGED
|
@@ -1,21 +1,39 @@
|
|
|
1
1
|
# Themes
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
Document appearance has independent **Typography**, **Color palette**, and
|
|
4
|
+
**Background** controls. These do not choose a layout or change font sizes.
|
|
4
5
|
|
|
5
6
|
Use [authoring guidance](../../AUTHORING.md#taste-and-creative-freedom) for theme
|
|
6
7
|
selection, font defaults and deck-wide consistency.
|
|
7
8
|
|
|
8
9
|
```ts
|
|
9
10
|
import { getTheme } from './design/themes/index.ts';
|
|
10
|
-
const theme = getTheme('
|
|
11
|
+
const theme = getTheme('Green', 'paper', 'noto-sans');
|
|
11
12
|
// theme.body, theme.headline, theme.typography, theme.palette
|
|
12
13
|
```
|
|
13
14
|
|
|
14
|
-
Eight
|
|
15
|
-
Yellow, Green and Graphite.
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
15
|
+
Eight palettes retain their existing names: Plex, Precision, Editorial,
|
|
16
|
+
Blue–cyan, Orange–coral, Yellow, Green and Graphite. Each supports Paper and Night.
|
|
17
|
+
Choose any palette with any of these typography presets:
|
|
18
|
+
|
|
19
|
+
| Typography ID | Headings | Body |
|
|
20
|
+
| --- | --- | --- |
|
|
21
|
+
| `plex-sans` | IBM Plex Sans | IBM Plex Sans |
|
|
22
|
+
| `noto-sans` | Noto Sans | Noto Sans |
|
|
23
|
+
| `plex-serif` | IBM Plex Serif | IBM Plex Sans |
|
|
24
|
+
| `hanken-grotesk` | Hanken Grotesk | Hanken Grotesk |
|
|
25
|
+
|
|
26
|
+
Composition JSON stores the optional choice in `theme.typography`, independently
|
|
27
|
+
of `theme.id` (palette) and `theme.mode` (background). Omitted typography preserves
|
|
28
|
+
legacy appearance: Precision uses Noto Sans, Editorial uses Plex Serif headings
|
|
29
|
+
with Plex Sans body, and all other palettes use Plex Sans. Changing the palette
|
|
30
|
+
in the editor records the current typography so colors no longer change fonts.
|
|
31
|
+
Two-argument `getTheme` callers retain those legacy pairings too.
|
|
32
|
+
|
|
33
|
+
Font loading remains the author's responsibility; load the required Fontsource
|
|
34
|
+
Latin weights before measuring or rendering text. Theme-linked native text and
|
|
35
|
+
vectors follow the selection; literal font/color overrides remain fixed.
|
|
36
|
+
Different fonts can change wrapping or overflow, so inspect the result.
|
|
19
37
|
|
|
20
38
|
Mineral and Botanical are light-only palette candidates in
|
|
21
39
|
[palettes/candidates.ts](../palettes/candidates.ts).
|
package/design/themes/index.ts
CHANGED
|
@@ -1,13 +1,24 @@
|
|
|
1
1
|
import { typography } from '../../lib/taste.ts';
|
|
2
2
|
import { paletteNames, resolvePalette, type PaletteName, type PaletteMode } from '../palettes/index.ts';
|
|
3
|
+
import type { TypographyId } from '../../composition/types.ts';
|
|
3
4
|
|
|
4
5
|
export const themeNames = paletteNames;
|
|
5
6
|
export type ThemeName = PaletteName;
|
|
6
7
|
export type ThemeMode = PaletteMode;
|
|
8
|
+
export const typographyLabels: Record<TypographyId, string> = {
|
|
9
|
+
'plex-sans': 'IBM Plex Sans',
|
|
10
|
+
'noto-sans': 'Noto Sans',
|
|
11
|
+
'plex-serif': 'Plex Serif + Plex Sans',
|
|
12
|
+
'hanken-grotesk': 'Hanken Grotesk',
|
|
13
|
+
};
|
|
7
14
|
|
|
8
15
|
// Themes combine typography with a palette; they do not choose a composition.
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
16
|
+
// Omitted typography retains the original pairing for older documents/callers.
|
|
17
|
+
export function getTheme(name: ThemeName, mode: ThemeMode,
|
|
18
|
+
typographyId: TypographyId = name === 'Precision' ? 'noto-sans' : name === 'Editorial' ? 'plex-serif' : 'plex-sans',
|
|
19
|
+
) {
|
|
20
|
+
const body = typographyId === 'noto-sans' ? '"Noto Sans", sans-serif'
|
|
21
|
+
: typographyId === 'hanken-grotesk' ? '"Hanken Grotesk", sans-serif' : typography.family;
|
|
22
|
+
const headline = typographyId === 'plex-serif' ? '"IBM Plex Serif", serif' : body;
|
|
23
|
+
return { name, typographyId, body, headline, typography: { ...typography, family: body }, palette: resolvePalette(name, mode) };
|
|
13
24
|
}
|