pele-animate 0.13.0 → 0.15.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 +69 -89
- package/docs/accessibility.md +20 -0
- package/docs/agents.md +63 -0
- package/docs/api.md +50 -0
- package/docs/compatibility.md +33 -0
- package/docs/contributing.md +25 -0
- package/docs/custom-icons.md +39 -0
- package/docs/diagram-types.md +43 -0
- package/docs/faq.md +30 -0
- package/docs/getting-started.md +70 -0
- package/docs/how-it-works.md +44 -0
- package/docs/icons.md +84 -0
- package/docs/migrating.md +58 -0
- package/docs/recipes.md +80 -0
- package/docs/security.md +19 -0
- package/docs/step-order.md +75 -0
- package/docs/theming.md +48 -0
- package/package.json +10 -7
- package/pele-animate.js +20 -0
- package/skills/diagram-step-order/SKILL.md +43 -0
- package/skills/diagram-step-order/steps.js +15 -0
- package/skills/pele-animate/SKILL.md +131 -0
- package/skills/pele-animate/references/categories.md +42 -0
- package/skills/pele-animate/verify.js +14 -0
- package/types/glyphs.d.ts +13 -0
- package/types/index.d.ts +35 -0
- package/types/preset-doverunner.d.ts +1 -0
- package/types/tabler-pack.d.ts +2 -0
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
# Tabler categories (generated by scripts/build-tabler.mjs; Tabler Icons 3.49.0, MIT)
|
|
2
|
+
|
|
3
|
+
Import `pele-animate/tabler/<category>`. Names below are a sample; the full list is the object keys in `node_modules/pele-animate/tabler/<category>.js`.
|
|
4
|
+
|
|
5
|
+
| Category | Icons | Sample names |
|
|
6
|
+
|---|---|---|
|
|
7
|
+
| `system` | 784 | ad-circle-off, calendar-exclamation, dental-broken, filter-question, loader-2, pointer-cancel, shield-cog, tip-jar-euro |
|
|
8
|
+
| `devices` | 363 | access-point-off, browser-off, device-desktop-question, device-ipad-horizontal-cog, device-mobile-pin, device-usb, devices-star, power |
|
|
9
|
+
| `design` | 350 | ad-2, bounce-left, color-picker-off, droplet-star, inner-shadow-top-right, layout-grid, pencil-minus, sparkles-2-off |
|
|
10
|
+
| `arrows` | 333 | arrow-autofit-content, arrow-big-up, arrow-merge-alt-right, arrow-sharp-turn-right, arrows-move-vertical, chevrons-down, corner-up-left-double, square-chevrons-left |
|
|
11
|
+
| `map` | 263 | air-traffic-control, flag-pause, location-pin, map-pin-down, medical-cross, pennant-2, sign-left, world-heart |
|
|
12
|
+
| `document` | 209 | archive-off, clipboard-copy, file-cv, file-orientation, file-type-csv, file-zip, folder-stats, receipt-off |
|
|
13
|
+
| `text` | 194 | a-b-2, align-right-2, baseline-density-medium, copy-x, italic-off, overline, sort-ascending, text-regex-plus |
|
|
14
|
+
| `shapes` | 187 | border-corner-ios, circle-minus-2, cylinder-off, heart-plus, hexagonal-prism, pentagon-off, sphere-plus, square-rounded-minus |
|
|
15
|
+
| `media` | 160 | album-off, camera-plus, headset-off, music-cog, photo-cancel, photo-spark, playlist, rewind-forward-50 |
|
|
16
|
+
| `e-commerce` | 155 | backpack-off, basket-star, cash-plus, credit-card, package, shopping-bag-exclamation, shopping-cart-pause, tags-off |
|
|
17
|
+
| `communication` | 121 | address-book-off, mail-down, mail-up, message-2-off, message-check, message-circle-search, message-minus, messages-off |
|
|
18
|
+
| `food` | 96 | apple, bowl, carrot-off, cup, glass-off, lollipop-off, milkshake, salad |
|
|
19
|
+
| `buildings` | 95 | armchair-2-off, building-bridge, building-factory-2, building-stadium, home-2, home-hand, home-share, podium |
|
|
20
|
+
| `vehicles` | 90 | aerial-lift, camper, car-off, engine, motorbike, sailboat-off, steering-wheel, wheelchair |
|
|
21
|
+
| `math` | 88 | abacus-off, decimal, math-1-divide-3, math-integral, math-sin, math-xy, parentheses-off, sum |
|
|
22
|
+
| `health` | 87 | accessible-off, cane, dna-2, eye-table, flask-2, hospital-circle, pill-off, stethoscope |
|
|
23
|
+
| `sport` | 76 | acrobatic, barbell-off, cliff-jumping, hula-hoop, olympics, rugby, soccer-field, trekking |
|
|
24
|
+
| `currencies` | 76 | currency-afghani, currency-dollar-canadian, currency-euro, currency-krone-danish, currency-nano, currency-riyal, currency-tether, taiwan-dollar |
|
|
25
|
+
| `development` | 63 | a-b, api-book, auth-2fa, firewall-check, package-import, scan-traces, thinking-high, timeline-event |
|
|
26
|
+
| `weather` | 61 | cloud-bolt, cloud-fog, cloud-rain, cloud, moon-off, storm, sunset-2, tornado |
|
|
27
|
+
| `photography` | 52 | aperture-off, brightness-up, contrast, exposure, lens-convex, panorama-vertical-off, photo-sensor-3, shadow |
|
|
28
|
+
| `mood` | 52 | mood-angry, mood-confused, mood-heart, mood-nerd, mood-sad-2, mood-silence, mood-tongue-wink-2, mood-wrrr |
|
|
29
|
+
| `nature` | 50 | acorn, butterfly, clover-2, flame-off, leaf-maple, orbit-vertical, ripple-off, wind-electricity |
|
|
30
|
+
| `games` | 48 | archery-arrow, dice-5, ghost, pick, play-card-5, play-card-j, poker-chip, roulette |
|
|
31
|
+
| `computers` | 44 | binary-off, error-404-off, http-get-off, http-patch-off, http-que-off, network, topology-ring-3, topology-star-ring |
|
|
32
|
+
| `database` | 42 | column-insert-left, database-exclamation, database-off, database, row-remove, table-export, table-plus |
|
|
33
|
+
| `laundry` | 40 | bleach-chlorine, ironing-2, ironing, wash-dry-dip, wash-dry-p, wash-dryclean, wash-press, wash-temperature-5 |
|
|
34
|
+
| `charts` | 39 | chart-arcs-3, chart-arrows, chart-candle, chart-donut-2, chart-dots-3, chart-infographic, chart-pie-off, chart-scatter-3d |
|
|
35
|
+
| `symbols` | 37 | ankh, command-off, copyright-off, mars, peace, rating-16-plus, registered, venus |
|
|
36
|
+
| `badges` | 22 | award-off, badge-3d, badge-5k, badge-ad, badge-hd, badge-tm, badge-wc, badges |
|
|
37
|
+
| `electrical` | 19 | circuit-ammeter, circuit-capacitor-polarized, circuit-cell, circuit-diode, circuit-inductor, circuit-resistor, circuit-voltmeter |
|
|
38
|
+
| `animals` | 18 | bat, dog, fish-hook-off, fish, paw-off, pig-off |
|
|
39
|
+
| `gestures` | 17 | hand-click-off, hand-finger-left, hand-finger, hand-love-you, hand-off, hand-three-fingers |
|
|
40
|
+
| `version-control` | 16 | git-branch-check, git-branch-x, git-cherry-pick, git-compare, git-merge-queue, git-pull-request-closed, git-pull-request-draft, git-pull-request-unlisted |
|
|
41
|
+
| `extensions` | 13 | bmp, gif, jpg, pdf, sql, toml, zip |
|
|
42
|
+
| `logic` | 8 | logic-and, logic-buffer, logic-nand, logic-nor, logic-not, logic-or, logic-xnor, logic-xor |
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
// Evaluate in the page (e.g. `agent-browser eval "$(cat verify.js)"` or Playwright page.evaluate): did pele-animate render?
|
|
2
|
+
// Expect: diagrams = how many you added, every steps entry > 0, emptyIcons = [], and no name in `fallbackIcons` you meant to be real.
|
|
3
|
+
(() => {
|
|
4
|
+
const svgs = [...document.querySelectorAll('.pa-scene svg.pele')];
|
|
5
|
+
const icons = [...document.querySelectorAll('.pa-scene svg.pele-icon[data-icon]')];
|
|
6
|
+
// An unregistered name renders pele-animate's neutral rounded square: one <rect x="4" y="4" ...> and nothing else.
|
|
7
|
+
const fallback = (i) => /^<g[^>]*><rect x="4" y="4" width="16" height="16" rx="4"(\/>|><\/rect>)<\/g>$/.test(i.innerHTML.trim());
|
|
8
|
+
return JSON.stringify({
|
|
9
|
+
diagrams: svgs.length,
|
|
10
|
+
steps: svgs.map((s) => s.paSteps?.length ?? 0),
|
|
11
|
+
emptyIcons: icons.filter((i) => !i.innerHTML.trim()).map((i) => i.dataset.icon),
|
|
12
|
+
fallbackIcons: icons.filter(fallback).map((i) => i.dataset.icon),
|
|
13
|
+
});
|
|
14
|
+
})()
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
/** Theme colors the illustrated glyphs use: CSS variables with fallbacks. */
|
|
2
|
+
export const S: string;
|
|
3
|
+
export const L: string;
|
|
4
|
+
export const W: string;
|
|
5
|
+
|
|
6
|
+
/** Register glyphs: `{ name: '<inner markup of a 24x24 svg>' }`. Default stroke width 1.1. */
|
|
7
|
+
export function registerGlyphs(pack: Record<string, string>, strokeWidth?: number): void;
|
|
8
|
+
|
|
9
|
+
/** Register Tabler-style outline icons; stroke width follows the `--pa-stroke` CSS variable (fallback `strokeWidth`, default 1.5). */
|
|
10
|
+
export function registerTabler(pack: Record<string, string>, strokeWidth?: number): void;
|
|
11
|
+
|
|
12
|
+
/** Pele `icons` resolver. Unknown names return a neutral rounded square. */
|
|
13
|
+
export function icons(name: string): string;
|
package/types/index.d.ts
ADDED
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
export interface AnimateOptions {
|
|
2
|
+
/** Element that triggers the hover token animation. Default: the svg itself. */
|
|
3
|
+
hover?: Element;
|
|
4
|
+
/** The Mermaid source, read for `%% pa:` pins. */
|
|
5
|
+
source?: string;
|
|
6
|
+
}
|
|
7
|
+
|
|
8
|
+
export interface WatchOptions {
|
|
9
|
+
/** `false` keeps the old click-to-replay instead of step mode. Default `true`. */
|
|
10
|
+
controls?: boolean;
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
/** One step: the elements that appear and, for each, the parts that pop in. */
|
|
14
|
+
export type PaStep = Array<[element: Element, parts: Element[]]>;
|
|
15
|
+
|
|
16
|
+
declare global {
|
|
17
|
+
interface SVGSVGElement {
|
|
18
|
+
/** Set by `animate()`: one array per step. */
|
|
19
|
+
paSteps?: PaStep[];
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
/** Read the `%% pa:` pins: node id, or `'X>Y'` for an edge, to a 0-based step. */
|
|
24
|
+
export function parseOrder(source?: string): Map<string, number>;
|
|
25
|
+
|
|
26
|
+
/** Animate one rendered Pele svg (flowchart or sequence diagram). */
|
|
27
|
+
export function animate(svg: SVGSVGElement, options?: AnimateOptions): void;
|
|
28
|
+
|
|
29
|
+
/** Animate every svg Pele renders into `container`, re-applying after Pele re-lays-out on resize. */
|
|
30
|
+
/** Pad icon-node labels narrower than `h` so Pele's layout box is at least as wide as the drawn icon. Use as `mount(el, prepare(src), { icons })`; pass the original `src` to `watch()`. */
|
|
31
|
+
export function prepare(source?: string): string;
|
|
32
|
+
export function watch(container: HTMLElement, source?: string, options?: WatchOptions): void;
|
|
33
|
+
|
|
34
|
+
/** Play the intro again. */
|
|
35
|
+
export function replay(svg: SVGSVGElement | null | undefined): void;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|