@tumaet/apollon 5.0.0 → 5.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.
- package/README.md +30 -3
- package/dist/assets/style.css +1 -1
- package/dist/export.d.ts +6 -3
- package/dist/export.js +82 -81
- package/dist/exportStyles-BGzJJ5bi.js +5 -0
- package/dist/index.d.ts +453 -35
- package/dist/index.js +8815 -7369
- package/dist/internals.d.ts +250 -5
- package/dist/internals.js +3 -3
- package/dist/{versionConverter-C-s36Ory.js → yjsSync-BeQGvR_C.js} +572 -560
- package/package.json +13 -5
- package/dist/exportStyles-ob7cmOn_.js +0 -5
package/README.md
CHANGED
|
@@ -23,7 +23,8 @@ Apollon is the modeling editor behind [Artemis](https://artemis.tum.de/), TUM's
|
|
|
23
23
|
- **Framework-agnostic**: one imperative API for Angular, Vue, Svelte, and vanilla JS, plus a React component, hooks, and provider.
|
|
24
24
|
- **Real-time collaboration**: opt-in multi-user editing over [Yjs](https://yjs.dev/), with any transport you like (WebSocket, WebRTC, BroadcastChannel).
|
|
25
25
|
- **Export**: SVG and JSON are built in. Generate PNG and PDF from the SVG (see [Export](#export)).
|
|
26
|
-
- **Canvas overlays**: inject your own toolbars, banners, and rails into the editor canvas
|
|
26
|
+
- **Canvas overlays**: inject your own toolbars, banners, and rails into the editor canvas; Apollon measures reserving controls and places them with the built-in chrome — `<ApollonControl>` (React) or `addControl` / `getRegionElement` (any framework). See [Overlay controls](https://ls1intum.github.io/Apollon/library/api/overlay-controls).
|
|
27
|
+
- **Internationalization**: override the editor UI strings exposed in `ApollonLabels` (tooltips, aria-labels, edit/assessment popovers) via `labels` / `setLabels` / `useLabels`. See [i18n](https://ls1intum.github.io/Apollon/library/api/overlay-controls#i18n).
|
|
27
28
|
- **Assessment mode**: attach scores and feedback to elements. This is the grading workflow Artemis uses.
|
|
28
29
|
- **TypeScript**: type definitions are included.
|
|
29
30
|
|
|
@@ -167,11 +168,11 @@ export class DiagramEditorComponent {
|
|
|
167
168
|
`yjs` and `y-protocols` are required peers, but on the CDN path esm.sh resolves and serves them from the import URL automatically — there is nothing extra to load. (With a bundler you install the peers yourself.)
|
|
168
169
|
|
|
169
170
|
```html
|
|
170
|
-
<link rel="stylesheet" href="https://esm.sh/@tumaet/apollon@5.
|
|
171
|
+
<link rel="stylesheet" href="https://esm.sh/@tumaet/apollon@5.1.0/style.css" />
|
|
171
172
|
<div id="apollon" style="width: 100%; height: 600px"></div>
|
|
172
173
|
|
|
173
174
|
<script type="module">
|
|
174
|
-
import { ApollonEditor } from "https://esm.sh/@tumaet/apollon@5.
|
|
175
|
+
import { ApollonEditor } from "https://esm.sh/@tumaet/apollon@5.1.0"
|
|
175
176
|
|
|
176
177
|
const saved = localStorage.getItem("diagram")
|
|
177
178
|
const editor = new ApollonEditor(document.getElementById("apollon"), {
|
|
@@ -227,9 +228,35 @@ Any Yjs-compatible transport works: `y-websocket`, `y-webrtc`, BroadcastChannel,
|
|
|
227
228
|
|
|
228
229
|
See [Export](https://ls1intum.github.io/Apollon/library/api/export) for the full `ExportOptions`.
|
|
229
230
|
|
|
231
|
+
## Theming
|
|
232
|
+
|
|
233
|
+
Theme the editor through the `--apollon-*` CSS custom properties (typed via
|
|
234
|
+
`createApollonTheme`) plus a `data-theme` light/dark switch — framework-agnostic,
|
|
235
|
+
Tailwind-free. A first rebrand is three tokens: `primary`, `background`,
|
|
236
|
+
`foreground`.
|
|
237
|
+
|
|
238
|
+
```tsx
|
|
239
|
+
import { Apollon, createApollonTheme } from "@tumaet/apollon"
|
|
240
|
+
|
|
241
|
+
declare const dark: boolean // your app's light/dark state
|
|
242
|
+
;<Apollon
|
|
243
|
+
style={{ height: "80vh" }}
|
|
244
|
+
theme={createApollonTheme({
|
|
245
|
+
primary: "#ff5722",
|
|
246
|
+
background: "#fff",
|
|
247
|
+
foreground: "#1a1a1a",
|
|
248
|
+
})}
|
|
249
|
+
dataTheme={dark ? "dark" : undefined}
|
|
250
|
+
/>
|
|
251
|
+
```
|
|
252
|
+
|
|
253
|
+
See [Theming](https://ls1intum.github.io/Apollon/library/theming) (or
|
|
254
|
+
[`THEMING.md`](./THEMING.md)) for the full contract, dark mode, and host patterns.
|
|
255
|
+
|
|
230
256
|
## Documentation
|
|
231
257
|
|
|
232
258
|
- [Library overview](https://ls1intum.github.io/Apollon/library/): install, quickstart, embedding
|
|
259
|
+
- [Theming](https://ls1intum.github.io/Apollon/library/theming): the `--apollon-*` contract, `createApollonTheme`, light/dark
|
|
233
260
|
- [API reference](https://ls1intum.github.io/Apollon/library/api): the full `ApollonEditor` and `<Apollon>` surface
|
|
234
261
|
- [Troubleshooting](https://ls1intum.github.io/Apollon/library/troubleshooting): blank canvas, SSR, duplicate React, and other gotchas
|
|
235
262
|
|