paintress 0.6.0 → 0.7.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 +53 -14
- package/README.zh-CN.md +54 -13
- package/dist/cli.js +492 -31
- package/dist/index.js +1 -1
- package/dist/mcp/server.js +1 -1
- package/dist/{render-BSf62388.js → render-DWs1iQ0v.js} +878 -56
- package/dist/server-DBRmwE_v.js +3462 -0
- package/package.json +1 -1
- package/skills/paintress/SKILL.md +37 -24
- package/ui/dist/assets/index-CSUM68ms.js +8 -0
- package/ui/dist/assets/{index-BFcvu7wr.css → index-CXBgFia_.css} +1 -1
- package/ui/dist/index.html +2 -2
- package/dist/server-DZRNNWac.js +0 -1599
- package/ui/dist/assets/index-CEhK1JXE.js +0 -8
package/package.json
CHANGED
|
@@ -22,19 +22,23 @@ If either prints something, **do not install again**. Use the existing binary. `
|
|
|
22
22
|
|
|
23
23
|
## Start the viewer before you draw
|
|
24
24
|
|
|
25
|
-
**Drawing means someone is watching.** Before the first write of a drawing session (creating, editing or showing a design),
|
|
25
|
+
**Drawing means someone is watching.** Before the first write of a drawing session (creating, editing or showing a design), run:
|
|
26
26
|
|
|
27
|
-
|
|
28
|
-
|
|
27
|
+
```bash
|
|
28
|
+
paintress web
|
|
29
|
+
```
|
|
30
|
+
|
|
31
|
+
That is the whole step. It ensures the viewer is running, opens the window itself, prints `pid` / `port` / `http` and returns — so it is safe to run before every session, and there is never a second process. Do not open a browser yourself and do not narrate the command: the window is its own business.
|
|
29
32
|
|
|
30
|
-
|
|
33
|
+
MCP: `paintress_viewer` does the same and hands back the URL.
|
|
31
34
|
|
|
32
35
|
## Tools
|
|
33
36
|
|
|
34
37
|
| Tool | What it does |
|
|
35
38
|
| --- | --- |
|
|
36
|
-
| `paintress_viewer` | **ensure the viewer is up** and register the project; idempotent
|
|
39
|
+
| `paintress_viewer` | **ensure the viewer is up** and register the project; idempotent; returns the project root and the two design-system files |
|
|
37
40
|
| `paintress_new` | **create a design file.** Writes a valid document with one empty board; returns the `boardId`. Refuses to overwrite; a `path` without an extension gets the default one |
|
|
41
|
+
| `paintress_convert` | convert a `.pen` file to `.ptr` (fresh `fileToken` + metadata; source untouched; refuses to overwrite) |
|
|
38
42
|
| `paintress_doc_info` | document summary: version, format flavor, node counts, variables, top-level nodes |
|
|
39
43
|
| `paintress_query` | find nodes by type / name (exact or regex) / id / reusable |
|
|
40
44
|
| `paintress_get` | fetch one node's subtree; `depth` controls how far down |
|
|
@@ -45,34 +49,47 @@ Both are **idempotent**: if a viewer is already up they reuse it and start nothi
|
|
|
45
49
|
| `paintress_batch` | several operations in one call |
|
|
46
50
|
| `paintress_validate` | check the document against the format spec |
|
|
47
51
|
| `paintress_render` | write the canvas as a standalone HTML file |
|
|
48
|
-
| `paintress_screenshot` | render to PNG (headless Chromium); pass `board` (id or name) to capture one board
|
|
52
|
+
| `paintress_screenshot` | render to PNG (headless Chromium); `scale` is 0.2–2 (default **0.8** for agent review), 1x = design pixels, either edge capped to 8192px proportionally; pass `board` (id or name) to capture one board |
|
|
49
53
|
| `paintress_marks` | read the user's click markers (`#1 → node id`) |
|
|
50
|
-
| `paintress_preset` | project
|
|
54
|
+
| `paintress_preset` | project tokens (colors / radii / spacing / font sizes / families) and preset groups: `list`, `set`, `remove`, `seed`, `set-group`, `remove-group` |
|
|
55
|
+
| `paintress_font` | project font registry: `list`, `add`, `remove`, `default` |
|
|
56
|
+
| `paintress_audit` | read-only design-system audit: literal values that could be tokens, orphan tokens, unused or dangling preset groups |
|
|
57
|
+
| `paintress_establish` | propose tokens / preset groups from repeated literals; dry-run by default, `apply: true` writes |
|
|
58
|
+
| `paintress_adjust` | preview the affected nodes of a token or group edit; dry-run by default, `apply: true` writes only `__preset.ptr` |
|
|
51
59
|
| `paintress_component` | project component library: `list` reusable components, `insert` one as a copy |
|
|
60
|
+
| `paintress_project` | project root + `__preset.ptr` / `__components.ptr`: returns paths, creates them if missing, reports nested duplicates |
|
|
52
61
|
|
|
53
62
|
## Design system: presets and components
|
|
54
63
|
|
|
55
64
|
Two project-level files keep a design consistent. Both are created automatically when the project is registered; the human never has to manage them.
|
|
56
65
|
|
|
57
|
-
**Presets (`__preset.ptr`) — colors
|
|
58
|
-
- Before the first shape of a session, call `paintress_preset` with `action: "list"`. If it is empty,
|
|
66
|
+
**Presets (`__preset.ptr`) — colors, corner radii, spacing and font values live in one place.**
|
|
67
|
+
- Before the first shape of a session, call `paintress_preset` with `action: "list"`. If it is empty, `action: "seed"` (dry-run first) writes a coherent scale — 27 tokens, 6 preset groups and the two web fonts; or register values yourself with `action: "set"` (`type: "color"`, `"radius"`, `"spacing"`, `"fontSize"` or `"font"`).
|
|
59
68
|
- In the design, **always reference a preset** (`"fill": "$color-brand"`), never paste a raw hex or radius when a preset exists. Raw values are how the design drifts.
|
|
69
|
+
- A preset group applies a set of token references to one node type (`action: "set-group"`, with `target` and `props`); a node opts in with `"preset": "<group>"`. Its own explicit properties still win.
|
|
70
|
+
- Use `paintress_audit` to find drift. `paintress_establish` and `paintress_adjust` are dry-run by default; inspect the proposed changes before passing `apply: true`.
|
|
60
71
|
- The human tunes preset values in the viewer and the canvas updates instantly. Do not overwrite a preset value unless asked — that is their knob.
|
|
61
72
|
|
|
62
73
|
**Components (`__components.ptr`) — look before you build.**
|
|
63
74
|
- Before drawing a button, card, input, etc., call `paintress_component` with `action: "list"`.
|
|
64
75
|
- If one fits, `action: "insert"` copies it into the design with fresh ids (a copy, not a live link) — then adjust the copy.
|
|
65
|
-
- After
|
|
76
|
+
- After the same shape appears a second time, register it: `action: "add"` with the node id. It copies the subtree into the component library with fresh ids and strips nested `reusable` flags. Never rebuild a component that already exists.
|
|
77
|
+
|
|
78
|
+
**Fonts (`x-paintress.fonts` in `__preset.ptr`) — every family needs a source and a preview.**
|
|
79
|
+
- `paintress_font` `action: "list"` first. Register with `action: "add"`: `kind` is `web` (a CSS URL), `css` (a project CSS file), `file` (one font file), `system`, or `bundle`.
|
|
80
|
+
- `system` and `bundle` **must** have `preview` — the family the canvas shows when the real one cannot be loaded. `css`/`file` paths are project-relative and must exist; `web` sources are CSS URLs.
|
|
81
|
+
- `default` sets the font used by text nodes without a `fontFamily`. Those nodes are a gap: every read (`doc_info`, `validate`, `get`, write hints) reports them. Close the gap instead of shipping text that relies on the fallback.
|
|
82
|
+
- Do not paste a family that has no registry entry; `validate` reports it as unregistered.
|
|
66
83
|
|
|
67
84
|
## Working rules
|
|
68
85
|
|
|
69
|
-
1. **Viewer first.**
|
|
86
|
+
1. **Viewer first.** Run `paintress web` before the first write — see above. It is idempotent, so there is no reason to skip it.
|
|
70
87
|
2. **Nothing to edit? Create it.** `paintress_new` is the only way to make a file; there is no "empty document" state to work around, and no need to hand-write JSON.
|
|
71
88
|
3. **Query before you edit.** Node ids come from the file; never invent them.
|
|
72
|
-
4. **`#N` means a marker.** When the user writes `#1`, call `paintress_marks
|
|
89
|
+
4. **`#N` means a marker.** When the user writes `#1`, call `paintress_marks`: it returns `#N -> { project, file, nodeId }`, so you can act on exactly one node in one file (`paintress_update` with that `path` and `id`). Markers are per viewer session and vanish when the viewer exits.
|
|
73
90
|
5. **Top-level nodes are boards.** Use `paintress_doc_info` to list them before guessing what "the second screen" means.
|
|
74
91
|
6. **After a batch, validate.** `paintress_validate` catches structural mistakes before the user opens the file.
|
|
75
|
-
7. **Presets before pixels, components before building.** See above: colors and radii go through `paintress_preset`,
|
|
92
|
+
7. **Presets before pixels, components before building, fonts before text.** See above: colors and radii go through `paintress_preset`, the component library is checked before anything new is drawn, and text nodes get a registered font (the default is a reported gap, not a result).
|
|
76
93
|
8. **Screenshots are for you.** `paintress_screenshot` is how you look at the design; the HTML viewer is for the human. When a document has several boards, pass `board` to get just that page — an ambiguous name errors out and lists the candidates rather than guessing.
|
|
77
94
|
|
|
78
95
|
## Node fields worth knowing
|
|
@@ -81,23 +98,19 @@ Two project-level files keep a design consistent. Both are created automatically
|
|
|
81
98
|
|
|
82
99
|
## Viewer
|
|
83
100
|
|
|
84
|
-
The
|
|
101
|
+
The viewer is a separate process; `paintress web` starts it or reuses it, and returns either way (add `--foreground` only when you want its log in your shell).
|
|
85
102
|
|
|
86
103
|
```bash
|
|
87
|
-
paintress web
|
|
88
|
-
paintress watch <name> <dir> # register a directory
|
|
104
|
+
paintress web
|
|
105
|
+
paintress watch <name> <dir> # register a directory that lives outside the project
|
|
89
106
|
```
|
|
90
107
|
|
|
91
|
-
|
|
108
|
+
- project list: `http://localhost:3316/`
|
|
109
|
+
- one document: `http://localhost:3316/<name>?file=<relative/path>`
|
|
92
110
|
|
|
93
111
|
## Bind the project yourself — do not wait to be asked
|
|
94
112
|
|
|
95
|
-
When the user refers to a design, asks to see one, or asks to draw something in this project, **you** make it viewable
|
|
96
|
-
|
|
97
|
-
- viewer: `http://localhost:3316/`
|
|
98
|
-
- deep link to a file: `http://localhost:3316/<name>?file=<relative/path>` (e.g. `http://localhost:3316/acme/shop?file=design/main.pen`)
|
|
99
|
-
|
|
100
|
-
Starting the viewer for the first time opens the browser on the agent's own project; you do not have to tell the user to visit anything.
|
|
113
|
+
When the user refers to a design, asks to see one, or asks to draw something in this project, **you** make it viewable: `paintress web` is the whole call. The MCP server also auto-registers the working directory at startup and re-checks it before every write (its name is the last two path segments, slash included, e.g. `acme/shop`), so the common case needs nothing else.
|
|
101
114
|
|
|
102
115
|
If the design lives elsewhere (a design file outside the working directory, or a second project), bind it yourself:
|
|
103
116
|
|
|
@@ -105,4 +118,4 @@ If the design lives elsewhere (a design file outside the working directory, or a
|
|
|
105
118
|
paintress watch <name> <dir> [--depth 1..6]
|
|
106
119
|
```
|
|
107
120
|
|
|
108
|
-
Prefer the
|
|
121
|
+
Prefer the auto-derived name when it applies, so the URL stays stable. Never ask the user to run `watch`; the project list in any open viewer window refreshes on its own once the registration lands.
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
(function(){let e=document.createElement(`link`).relList;if(e&&e.supports&&e.supports(`modulepreload`))return;for(let e of document.querySelectorAll(`link[rel="modulepreload"]`))n(e);new MutationObserver(e=>{for(let t of e)if(t.type===`childList`)for(let e of t.addedNodes)e.tagName===`LINK`&&e.rel===`modulepreload`&&n(e)}).observe(document,{childList:!0,subtree:!0});function t(e){let t={};return e.integrity&&(t.integrity=e.integrity),e.referrerPolicy&&(t.referrerPolicy=e.referrerPolicy),t.credentials=e.crossOrigin===`use-credentials`?`include`:e.crossOrigin===`anonymous`?`omit`:`same-origin`,t}function n(e){if(e.ep)return;e.ep=!0;let n=t(e);fetch(e.href,n)}})();var e={context:void 0,registry:void 0,effects:void 0,done:!1,getContextId(){return t(this.context.count)},getNextContextId(){return t(this.context.count++)}};function t(t){let n=String(t),r=n.length-1;return e.context.id+(r?String.fromCharCode(96+r):``)+n}function n(t){e.context=t}var r=(e,t)=>e===t,i=Symbol(`solid-proxy`),a=typeof Proxy==`function`,o=Symbol(`solid-track`),s={equals:r},c=null,l=ue,u=1,d=2,f={owned:null,cleanups:null,context:null,owner:null},p=null,m=null,h=null,g=null,_=null,v=0;function y(e,t){let n=h,r=p,i=e.length===0,a=t===void 0?r:t,o=i?f:{owned:null,cleanups:null,context:a?a.context:null,owner:a},s=i?e:()=>e(b(o));p=o,h=null;try{return k(s,!0)}finally{h=n,p=r}}function b(e){return()=>T(()=>M(e))}function x(e,t){t=t?Object.assign({},s,t):s;let n={value:e,observers:null,observerSlots:null,comparator:t.equals||void 0};return[ie.bind(n),e=>(typeof e==`function`&&(e=m&&m.running&&m.sources.has(n)?e(n.tValue):e(n.value)),ae(n,e))]}function S(e,t,n){oe(ce(e,t,!1,u))}function C(e,t,n){l=j;let r=ce(e,t,!1,u),i=re&&ne(re);i&&(r.suspense=i),n&&n.render||(r.user=!0),_?_.push(r):oe(r)}function w(e,t,n){n=n?Object.assign({},s,n):s;let r=ce(e,t,!0,0);return r.observers=null,r.observerSlots=null,r.comparator=n.equals||void 0,oe(r),ie.bind(r)}function T(e){if(h===null)return e();let t=h;h=null;try{return e()}finally{h=t}}function E(e,t,n){let r=Array.isArray(e),i,a=n&&n.defer;return n=>{let o;if(r){o=Array(e.length);for(let t=0;t<e.length;t++)o[t]=e[t]()}else o=e();if(a)return a=!1,n;let s=T(()=>t(o,i,n));return i=o,s}}function D(e){C(()=>T(e))}function O(e){return p===null||(p.cleanups===null?p.cleanups=[e]:p.cleanups.push(e)),e}var[ee,te]=x(!1);function ne(e){let t;return p&&p.context&&(t=p.context[e.id])!==void 0?t:e.defaultValue}var re;function ie(){let e=m&&m.running;if(this.sources&&(e?this.tState:this.state)){if((e?this.tState:this.state)===u)oe(this);else{let e=g;g=null,k(()=>de(this),!1),g=e}}if(h){let e=this.observers;if(!e||e[e.length-1]!==h){let t=e?e.length:0;h.sources?(h.sources.push(this),h.sourceSlots.push(t)):(h.sources=[this],h.sourceSlots=[t]),e?(e.push(h),this.observerSlots.push(h.sources.length-1)):(this.observers=[h],this.observerSlots=[h.sources.length-1])}}return e&&m.sources.has(this)?this.tValue:this.value}function ae(e,t,n){let r=m&&m.running&&m.sources.has(e)?e.tValue:e.value;if(!e.comparator||!e.comparator(r,t)){if(m){let r=m.running;(r||!n&&m.sources.has(e))&&(m.sources.add(e),e.tValue=t),r||(e.value=t)}else e.value=t;e.observers&&e.observers.length&&k(()=>{for(let t=0;t<e.observers.length;t+=1){let n=e.observers[t],r=m&&m.running;r&&m.disposed.has(n)||((r?!n.tState:!n.state)&&(n.pure?g.push(n):_.push(n),n.observers&&fe(n)),r?n.tState=u:n.state=u)}if(g.length>1e6)throw g=[],Error()},!1)}return t}function oe(e){if(!e.fn)return;M(e);let t=v;se(e,m&&m.running&&m.sources.has(e)?e.tValue:e.value,t),m&&!m.running&&m.sources.has(e)&&queueMicrotask(()=>{k(()=>{m&&(m.running=!0),h=p=e,se(e,e.tValue,t),h=p=null},!1)})}function se(e,t,n){let r,i=p,a=h;h=p=e;try{r=e.fn(t)}catch(t){return e.pure&&(m&&m.running?(e.tState=u,e.tOwned&&e.tOwned.forEach(M),e.tOwned=void 0):(e.state=u,e.owned&&e.owned.forEach(M),e.owned=null)),e.updatedAt=n+1,ge(t)}finally{h=a,p=i}(!e.updatedAt||e.updatedAt<=n)&&(e.updatedAt!=null&&`observers`in e?ae(e,r,!0):m&&m.running&&e.pure?(m.sources.has(e)||(e.value=r),m.sources.add(e),e.tValue=r):e.value=r,e.updatedAt=n)}function ce(e,t,n,r=u,i){let a={fn:e,state:r,updatedAt:null,owned:null,sources:null,sourceSlots:null,cleanups:null,value:t,owner:p,context:p?p.context:null,pure:n};return m&&m.running&&(a.state=0,a.tState=r),p===null||p!==f&&(m&&m.running&&p.pure?p.tOwned?p.tOwned.push(a):p.tOwned=[a]:p.owned?p.owned.push(a):p.owned=[a]),a}function le(e){let t=m&&m.running;if((t?e.tState:e.state)===0)return;if((t?e.tState:e.state)===d)return de(e);if(e.suspense&&T(e.suspense.inFallback))return e.suspense.effects.push(e);let n=[e];for(;(e=e.owner)&&(!e.updatedAt||e.updatedAt<v);){if(t&&m.disposed.has(e))return;(t?e.tState:e.state)&&n.push(e)}for(let r=n.length-1;r>=0;r--){if(e=n[r],t){let t=e,i=n[r+1];for(;(t=t.owner)&&t!==i;)if(m.disposed.has(t))return}if((t?e.tState:e.state)===u)oe(e);else if((t?e.tState:e.state)===d){let t=g;g=null,k(()=>de(e,n[0]),!1),g=t}}}function k(e,t){if(g)return e();let n=!1;t||(g=[]),_?n=!0:_=[],v++;try{let t=e();return A(n),t}catch(e){n||(_=null),g=null,ge(e)}}function A(e){if(g&&=(ue(g),null),e)return;let t;if(m){if(!m.promises.size&&!m.queue.size){let e=m.sources,n=m.disposed;_.push.apply(_,m.effects),t=m.resolve;for(let e of _)`tState`in e&&(e.state=e.tState),delete e.tState;m=null,k(()=>{for(let e of n)M(e);for(let t of e){if(t.value=t.tValue,t.owned)for(let e=0,n=t.owned.length;e<n;e++)M(t.owned[e]);t.tOwned&&(t.owned=t.tOwned),delete t.tValue,delete t.tOwned,t.tState=0}te(!1)},!1)}else if(m.running){m.running=!1,m.effects.push.apply(m.effects,_),_=null,te(!0);return}}let n=_;_=null,n.length&&k(()=>l(n),!1),t&&t()}function ue(e){for(let t=0;t<e.length;t++)le(e[t])}function j(t){let r,i=0;for(r=0;r<t.length;r++){let e=t[r];e.user?t[i++]=e:le(e)}if(e.context){if(e.count){e.effects||=[],e.effects.push(...t.slice(0,i));return}n()}for(e.effects&&(e.done||!e.count)&&(t=[...e.effects,...t],i+=e.effects.length,delete e.effects),r=0;r<i;r++)le(t[r])}function de(e,t){let n=m&&m.running;n?e.tState=0:e.state=0;for(let r=0;r<e.sources.length;r+=1){let i=e.sources[r];if(i.sources){let e=n?i.tState:i.state;e===u?i!==t&&(!i.updatedAt||i.updatedAt<v)&&le(i):e===d&&de(i,t)}}}function fe(e){let t=m&&m.running;for(let n=0;n<e.observers.length;n+=1){let r=e.observers[n];(t?!r.tState:!r.state)&&(t?r.tState=d:r.state=d,r.pure?g.push(r):_.push(r),r.observers&&fe(r))}}function M(e){let t;if(e.sources)for(;e.sources.length;){let t=e.sources.pop(),n=e.sourceSlots.pop(),r=t.observers;if(r&&r.length){let e=r.pop(),i=t.observerSlots.pop();n<r.length&&(e.sourceSlots[i]=n,r[n]=e,t.observerSlots[n]=i)}}if(e.tOwned){for(t=e.tOwned.length-1;t>=0;t--)M(e.tOwned[t]);delete e.tOwned}if(m&&m.running&&e.pure)pe(e,!0);else if(e.owned){for(t=e.owned.length-1;t>=0;t--)M(e.owned[t]);e.owned=null}if(e.cleanups){for(t=e.cleanups.length-1;t>=0;t--)e.cleanups[t]();e.cleanups=null}m&&m.running?e.tState=0:e.state=0}function pe(e,t){if(t||(e.tState=0,m.disposed.add(e)),e.owned)for(let t=0;t<e.owned.length;t++)pe(e.owned[t])}function me(e){return e instanceof Error?e:Error(typeof e==`string`?e:`Unknown error`,{cause:e})}function he(e,t,n){try{for(let n of t)n(e)}catch(e){ge(e,n&&n.owner||null)}}function ge(e,t=p){let n=c&&t&&t.context&&t.context[c],r=me(e);if(!n)throw r;_?_.push({fn(){he(r,n,t)},state:u}):he(r,n,t)}var N=Symbol(`fallback`);function _e(e){for(let t=0;t<e.length;t++)e[t]()}function ve(e,t,n={}){let r=[],i=[],a=[],s=0,c=t.length>1?[]:null;return O(()=>_e(a)),()=>{let l=e()||[],u=l.length,d,f;return l[o],T(()=>{let e,t,o,m,h,g,_,v,b;if(u===0)s!==0&&(_e(a),a=[],r=[],i=[],s=0,c&&=[]),n.fallback&&(r=[N],i[0]=y(e=>(a[0]=e,n.fallback())),s=1);else if(s===0){for(i=Array(u),f=0;f<u;f++)r[f]=l[f],i[f]=y(p);s=u}else{for(o=Array(u),m=Array(u),c&&(h=Array(u)),g=0,_=Math.min(s,u);g<_&&r[g]===l[g];g++);for(_=s-1,v=u-1;_>=g&&v>=g&&r[_]===l[v];_--,v--)o[v]=i[_],m[v]=a[_],c&&(h[v]=c[_]);for(e=new Map,t=Array(v+1),f=v;f>=g;f--)b=l[f],d=e.get(b),t[f]=d===void 0?-1:d,e.set(b,f);for(d=g;d<=_;d++)b=r[d],f=e.get(b),f!==void 0&&f!==-1?(o[f]=i[d],m[f]=a[d],c&&(h[f]=c[d]),f=t[f],e.set(b,f)):a[d]();for(f=g;f<u;f++)f in o?(i[f]=o[f],a[f]=m[f],c&&(c[f]=h[f],c[f](f))):i[f]=y(p);i=i.slice(0,s=u),r=l.slice(0)}return i});function p(e){if(a[f]=e,c){let[e,n]=x(f);return c[f]=n,t(l[f],e)}return t(l[f])}}}function P(e,t){return T(()=>e(t||{}))}function F(){return!0}var ye={get(e,t,n){return t===i?n:e.get(t)},has(e,t){return t===i||e.has(t)},set:F,deleteProperty:F,getOwnPropertyDescriptor(e,t){return{configurable:!0,enumerable:!0,get(){return e.get(t)},set:F,deleteProperty:F}},ownKeys(e){return e.keys()}};function be(e){return(e=typeof e==`function`?e():e)?e:{}}function xe(){for(let e=0,t=this.length;e<t;++e){let t=this[e]();if(t!==void 0)return t}}function Se(...e){let t=!1;for(let n=0;n<e.length;n++){let r=e[n];t||=!!r&&i in r,e[n]=typeof r==`function`?(t=!0,w(r)):r}if(a&&t)return new Proxy({get(t){for(let n=e.length-1;n>=0;n--){let r=be(e[n])[t];if(r!==void 0)return r}},has(t){for(let n=e.length-1;n>=0;n--)if(t in be(e[n]))return!0;return!1},keys(){let t=[];for(let n=0;n<e.length;n++)t.push(...Object.keys(be(e[n])));return[...new Set(t)]}},ye);let n={},r=Object.create(null);for(let t=e.length-1;t>=0;t--){let i=e[t];if(!i)continue;let a=Object.getOwnPropertyNames(i);for(let e=a.length-1;e>=0;e--){let t=a[e];if(t===`__proto__`||t===`constructor`)continue;let o=Object.getOwnPropertyDescriptor(i,t);if(!r[t])r[t]=o.get?{enumerable:!0,configurable:!0,get:xe.bind(n[t]=[o.get.bind(i)])}:o.value===void 0?void 0:o;else{let e=n[t];e&&(o.get?e.push(o.get.bind(i)):o.value!==void 0&&e.push(()=>o.value))}}}let o={},s=Object.keys(r);for(let e=s.length-1;e>=0;e--){let t=s[e],n=r[t];n&&n.get?Object.defineProperty(o,t,n):o[t]=n?n.value:void 0}return o}var Ce=e=>`Stale read from <${e}>.`;function I(e){let t=`fallback`in e&&{fallback:()=>e.fallback};return w(ve(()=>e.each,e.children,t||void 0))}function L(e){let t=e.keyed,n=w(()=>e.when,void 0,void 0),r=t?n:w(n,void 0,{equals:(e,t)=>!e==!t});return w(()=>{let i=r();if(i){let a=e.children;return typeof a==`function`&&a.length>0?T(()=>a(t?i:()=>{if(!T(r))throw Ce(`Show`);return n()})):a}return e.fallback},void 0,void 0)}var we=new Set([`className`,`value`,`readOnly`,`noValidate`,`formNoValidate`,`isMap`,`noModule`,`playsInline`,`adAuctionHeaders`,`allowFullscreen`,`browsingTopics`,`defaultChecked`,`defaultMuted`,`defaultSelected`,`disablePictureInPicture`,`disableRemotePlayback`,`preservesPitch`,`shadowRootClonable`,`shadowRootCustomElementRegistry`,`shadowRootDelegatesFocus`,`shadowRootSerializable`,`sharedStorageWritable`,...`allowfullscreen.async.alpha.autofocus.autoplay.checked.controls.default.disabled.formnovalidate.hidden.indeterminate.inert.ismap.loop.multiple.muted.nomodule.novalidate.open.playsinline.readonly.required.reversed.seamless.selected.adauctionheaders.browsingtopics.credentialless.defaultchecked.defaultmuted.defaultselected.defer.disablepictureinpicture.disableremoteplayback.preservespitch.shadowrootclonable.shadowrootcustomelementregistry.shadowrootdelegatesfocus.shadowrootserializable.sharedstoragewritable`.split(`.`)]),R=new Set([`innerHTML`,`textContent`,`innerText`,`children`]),z=Object.assign(Object.create(null),{className:`class`,htmlFor:`for`}),Te=Object.assign(Object.create(null),{class:`className`,novalidate:{$:`noValidate`,FORM:1},formnovalidate:{$:`formNoValidate`,BUTTON:1,INPUT:1},ismap:{$:`isMap`,IMG:1},nomodule:{$:`noModule`,SCRIPT:1},playsinline:{$:`playsInline`,VIDEO:1},readonly:{$:`readOnly`,INPUT:1,TEXTAREA:1},adauctionheaders:{$:`adAuctionHeaders`,IFRAME:1},allowfullscreen:{$:`allowFullscreen`,IFRAME:1},browsingtopics:{$:`browsingTopics`,IMG:1},defaultchecked:{$:`defaultChecked`,INPUT:1},defaultmuted:{$:`defaultMuted`,AUDIO:1,VIDEO:1},defaultselected:{$:`defaultSelected`,OPTION:1},disablepictureinpicture:{$:`disablePictureInPicture`,VIDEO:1},disableremoteplayback:{$:`disableRemotePlayback`,AUDIO:1,VIDEO:1},preservespitch:{$:`preservesPitch`,AUDIO:1,VIDEO:1},shadowrootclonable:{$:`shadowRootClonable`,TEMPLATE:1},shadowrootdelegatesfocus:{$:`shadowRootDelegatesFocus`,TEMPLATE:1},shadowrootserializable:{$:`shadowRootSerializable`,TEMPLATE:1},sharedstoragewritable:{$:`sharedStorageWritable`,IFRAME:1,IMG:1}});function Ee(e,t){let n=Te[e];return typeof n==`object`?n[t]?n.$:void 0:n}var De=new Set([`beforeinput`,`click`,`dblclick`,`contextmenu`,`focusin`,`focusout`,`input`,`keydown`,`keyup`,`mousedown`,`mousemove`,`mouseout`,`mouseover`,`mouseup`,`pointerdown`,`pointermove`,`pointerout`,`pointerover`,`pointerup`,`touchend`,`touchmove`,`touchstart`]),Oe={xlink:`http://www.w3.org/1999/xlink`,xml:`http://www.w3.org/XML/1998/namespace`},B=e=>w(()=>e());function ke(e,t,n){let r=n.length,i=t.length,a=r,o=0,s=0,c=t[i-1].nextSibling,l=null;for(;o<i||s<a;)if(t[o]===n[s])o++,s++;else{for(;t[i-1]===n[a-1];)i--,a--;if(i===o){let t=a<r?s?n[s-1].nextSibling:n[a-s]:c;for(;s<a;)e.insertBefore(n[s++],t)}else if(a===s)for(;o<i;)l&&l.has(t[o])||t[o].remove(),o++;else if(t[o]===n[a-1]&&n[s]===t[i-1]){let r=t[--i].nextSibling;e.insertBefore(n[s++],t[o++].nextSibling),e.insertBefore(n[--a],r),t[i]=n[a]}else{if(!l){l=new Map;let e=s;for(;e<a;)l.set(n[e],e++)}let r=l.get(t[o]);if(r!=null){if(s<r&&r<a){let c=o,u=1,d;for(;++c<i&&c<a&&(d=l.get(t[c]))!=null&&d===r+u;)u++;if(u>r-s){let i=t[o];for(;s<r;)e.insertBefore(n[s++],i)}else e.replaceChild(n[s++],t[o++])}else o++}else t[o++].remove()}}}var Ae=`_$DX_DELEGATE`;function je(e,t,n,r={}){let i;return y(r=>{i=r,t===document?e():K(t,e(),!n&&t.firstChild?null:void 0,n)},r.owner),()=>{i(),t.textContent=``}}function V(e,t,n,r){let i,a=()=>{let t=r?document.createElementNS(`http://www.w3.org/1998/Math/MathML`,`template`):document.createElement(`template`);return t.innerHTML=e,n?t.content.firstChild.firstChild:r?t.firstChild:t.content.firstChild},o=t?()=>T(()=>document.importNode(i||=a(),!0)):()=>(i||=a()).cloneNode(!0);return o.cloneNode=o,o}function H(e,t=window.document){let n=t[Ae]||(t[Ae]=new Set);for(let r=0,i=e.length;r<i;r++){let i=e[r];n.has(i)||(n.add(i),t.addEventListener(i,Ue))}}function U(e,t,n){q(e)||(n==null?e.removeAttribute(t):e.setAttribute(t,n))}function Me(e,t,n,r){q(e)||(r==null?e.removeAttributeNS(t,n):e.setAttributeNS(t,n,r))}function Ne(e,t,n){q(e)||(n?e.setAttribute(t,``):e.removeAttribute(t))}function W(e,t){q(e)||(t==null?e.removeAttribute(`class`):e.className=t)}function Pe(e,t,n,r){if(r)Array.isArray(n)?(e[`$$${t}`]=n[0],e[`$$${t}Data`]=n[1]):e[`$$${t}`]=n;else if(Array.isArray(n)){let r=n[0];e.addEventListener(t,n[0]=t=>r.call(e,n[1],t))}else e.addEventListener(t,n,typeof n!=`function`&&n)}function Fe(e,t,n={}){let r=Object.keys(t||{}),i=Object.keys(n),a,o;for(a=0,o=i.length;a<o;a++){let r=i[a];r&&r!==`undefined`&&!t[r]&&(Ve(e,r,!1),delete n[r])}for(a=0,o=r.length;a<o;a++){let i=r[a],o=!!t[i];i&&i!==`undefined`&&n[i]!==o&&o&&(Ve(e,i,!0),n[i]=o)}return n}function Ie(e,t,n){if(!t)return n?U(e,`style`):t;let r=e.style;if(typeof t==`string`)return r.cssText=t;typeof n==`string`&&(r.cssText=n=void 0),n||={},t||={};let i,a;for(a in n)t[a]??r.removeProperty(a),delete n[a];for(a in t)i=t[a],i!==n[a]&&(r.setProperty(a,i),n[a]=i);return n}function Le(e,t,n){n==null?e.style.removeProperty(t):e.style.setProperty(t,n)}function Re(e,t={},n,r){let i={};return r||S(()=>i.children=J(e,t.children,i.children)),S(()=>typeof t.ref==`function`&&G(t.ref,e)),S(()=>ze(e,t,n,!0,i,!0)),i}function G(e,t,n){return T(()=>e(t,n))}function K(e,t,n,r){if(n!==void 0&&!r&&(r=[]),typeof t!=`function`)return J(e,t,r,n);S(r=>J(e,t(),r,n),r)}function ze(e,t,n,r,i={},a=!1){t||={};for(let r in i)if(!(r in t)){if(r===`children`)continue;i[r]=He(e,r,null,i[r],n,a,t)}for(let o in t){if(o===`children`){r||J(e,t.children);continue}let s=t[o];i[o]=He(e,o,s,i[o],n,a,t)}}function q(t){return!!e.context&&!e.done&&(!t||t.isConnected)}function Be(e){return e.toLowerCase().replace(/-([a-z])/g,(e,t)=>t.toUpperCase())}function Ve(e,t,n){let r=t.trim().split(/\s+/);for(let t=0,i=r.length;t<i;t++)e.classList.toggle(r[t],n)}function He(e,t,n,r,i,a,o){let s,c,l,u,d;if(t===`style`)return Ie(e,n,r);if(t===`classList`)return Fe(e,n,r);if(n===r)return r;if(t===`ref`)a||n(e);else if(t.slice(0,3)===`on:`){let i=t.slice(3);r&&e.removeEventListener(i,r,typeof r!=`function`&&r),n&&e.addEventListener(i,n,typeof n!=`function`&&n)}else if(t.slice(0,10)===`oncapture:`){let i=t.slice(10);r&&e.removeEventListener(i,r,!0),n&&e.addEventListener(i,n,!0)}else if(t.slice(0,2)===`on`){let i=t.slice(2).toLowerCase(),a=De.has(i);if(!a&&r){let t=Array.isArray(r)?r[0]:r;e.removeEventListener(i,t)}(a||n)&&(Pe(e,i,n,a),a&&H([i]))}else if(t.slice(0,5)===`attr:`)U(e,t.slice(5),n);else if(t.slice(0,5)===`bool:`)Ne(e,t.slice(5),n);else if((d=t.slice(0,5)===`prop:`)||(l=R.has(t))||!i&&((u=Ee(t,e.tagName))||(c=we.has(t)))||(s=e.nodeName.includes(`-`)||`is`in o)){if(d)t=t.slice(5),c=!0;else if(q(e))return n;t===`class`||t===`className`?W(e,n):s&&!c&&!l?e[Be(t)]=n:(t===`value`||t===`defaultValue`)&&(e.nodeName===`INPUT`||e.nodeName===`TEXTAREA`)?e[u||t]=n??``:e[u||t]=n}else{let r=i&&t.indexOf(`:`)>-1&&Oe[t.split(`:`)[0]];r?Me(e,r,t,n):U(e,z[t]||t,n)}return n}function Ue(t){if(e.registry&&e.events&&e.events.find(([e,n])=>n===t))return;let n=t.target,r=`$$${t.type}`,i=t.target,a=t.currentTarget,o=e=>Object.defineProperty(t,"target",{configurable:!0,value:e}),s=()=>{let e=n[r];if(e&&!n.disabled){let i=n[`${r}Data`];if(i===void 0?e.call(n,t):e.call(n,i,t),t.cancelBubble)return}return n.host&&typeof n.host!=`string`&&!n.host._$host&&n.contains(t.target)&&o(n.host),!0},c=()=>{for(;s()&&(n=n._$host||n.parentNode||n.host););};Object.defineProperty(t,"currentTarget",{configurable:!0,get(){return n||document}}),e.registry&&!e.done&&(e.done=_$HY.done=!0);try{if(t.composedPath){let e=t.composedPath();o(e[0]);for(let t=0;t<e.length-2&&(n=e[t],s());t++){if(n._$host){n=n._$host,c();break}if(n.parentNode===a)break}}else c();o(i)}finally{t=n=null}}function J(e,t,n,r,i){let a=q(e);if(a){!n&&(n=[...e.childNodes]);let t=[];for(let e=0;e<n.length;e++){let r=n[e];r.nodeType===8&&r.data.slice(0,2)===`!$`?r.remove():t.push(r)}n=t}for(;typeof n==`function`;)n=n();if(t===n)return n;let o=typeof t,s=r!==void 0;if(e=s&&n[0]&&n[0].parentNode||e,o===`string`||o===`number`){if(a||o===`number`&&(t=t.toString(),t===n))return n;if(s){let i=n[0];i&&i.nodeType===3?i.data!==t&&(i.data=t):i=document.createTextNode(t),n=Y(e,n,r,i)}else n=n!==``&&typeof n==`string`?e.firstChild.data=t:e.textContent=t}else if(t==null||o===`boolean`){if(a)return n;n=Y(e,n,r)}else if(o===`function`)return S(()=>{let i=t();for(;typeof i==`function`;)i=i();n=J(e,i,n,r)}),()=>n;else if(Array.isArray(t)){let o=[],c=n&&Array.isArray(n);if(We(o,t,n,i))return S(()=>n=J(e,o,n,r,!0)),()=>n;if(a){if(!o.length)return n;if(r===void 0)return n=[...e.childNodes];let t=o[0];if(t.parentNode!==e)return n;let i=[t];for(;(t=t.nextSibling)!==r;)i.push(t);return n=i}if(o.length===0){if(n=Y(e,n,r),s)return n}else c?n.length===0?Ge(e,o,r):ke(e,n,o):(n&&Y(e),Ge(e,o));n=o}else if(t.nodeType){if(a&&t.parentNode)return n=s?[t]:t;if(Array.isArray(n)){if(s)return n=Y(e,n,r,t);Y(e,n,null,t)}else n==null||n===``||!e.firstChild?e.appendChild(t):e.replaceChild(t,e.firstChild);n=t}return n}function We(e,t,n,r){let i=!1;for(let a=0,o=t.length;a<o;a++){let o=t[a],s=n&&n[e.length],c;if(o!=null&&o!==!0&&o!==!1){if((c=typeof o)==`object`&&o.nodeType)e.push(o);else if(Array.isArray(o))i=We(e,o,s)||i;else if(c===`function`){if(r){for(;typeof o==`function`;)o=o();i=We(e,Array.isArray(o)?o:[o],Array.isArray(s)?s:[s])||i}else e.push(o),i=!0}else{let t=String(o);s&&s.nodeType===3&&s.data===t?e.push(s):e.push(document.createTextNode(t))}}}return i}function Ge(e,t,n=null){for(let r=0,i=t.length;r<i;r++)e.insertBefore(t[r],n)}function Y(e,t,n,r){if(n===void 0)return e.textContent=``;let i=r||document.createTextNode(``);if(t.length){let r=!1;for(let a=t.length-1;a>=0;a--){let o=t[a];if(i!==o){let t=o.parentNode===e;!r&&!a?t?e.replaceChild(i,o):e.insertBefore(i,n):t&&o.remove()}else r=!0}}else e.insertBefore(i,n);return[i]}async function X(e){let t=await fetch(e,{headers:{accept:`application/json`}});if(!t.ok){let e=await t.text().catch(()=>``);throw Error(`HTTP ${t.status}${e?`: ${e.slice(0,200)}`:``}`)}return await t.json()}function Ke(){return X(`/api/projects`)}function qe(){return X(`/api/version`)}function Je(e,t,n){return X(`/api/node?project=${encodeURIComponent(e)}&path=${encodeURIComponent(t)}&id=${encodeURIComponent(n)}`)}function Ye(e){return X(`/api/projects/${encodeURIComponent(e)}/files`)}function Xe(e,t){return`/render/${encodeURIComponent(e)}/${t.split(`/`).map(encodeURIComponent).join(`/`)}?embed=1`}function Ze(e,t,n,r){return`/api/export?${new URLSearchParams({project:e,path:t,board:n,scale:String(r)}).toString()}`}function Qe(e,t){return`/events?project=${encodeURIComponent(e)}&path=${encodeURIComponent(t)}`}function $e(){return`/events`}function et(e){return X(`/api/marks?project=${encodeURIComponent(e)}`)}async function tt(e){let t=await fetch(`/api/marks`,{method:`POST`,headers:{"content-type":`application/json`},body:JSON.stringify(e)});if(!t.ok)throw Error(`HTTP ${t.status}`);let n=await t.json();if(!n.ok)throw Error(n.error??`添加标记失败`);return n.mark}async function nt(e){let t=await fetch(`/api/marks?project=${encodeURIComponent(e)}`,{method:`DELETE`});if(!t.ok)throw Error(`HTTP ${t.status}`);return(await t.json()).cleared}var Z={"x-paintress":`1`};async function rt(e){let t=await fetch(`/api/projects/${encodeURIComponent(e)}`,{method:`DELETE`,headers:Z}),n=await t.json();if(!t.ok||!n.ok)throw Error(n.error??`HTTP ${t.status}`);return n.unwatched===!0}async function it(){let e=await fetch(`/api/shutdown`,{method:`POST`,headers:Z}),t=await e.json();if(!e.ok||!t.ok)throw Error(t.error??`HTTP ${e.status}`);return t.connections??0}function at(e,t){return X(`/api/changes?project=${encodeURIComponent(e)}&path=${encodeURIComponent(t)}`)}function ot(e,t){return X(`/api/notes?project=${encodeURIComponent(e)}&path=${encodeURIComponent(t)}`)}function st(e){return X(`/api/presets?project=${encodeURIComponent(e)}`)}async function ct(e,t,n){let r=await fetch(`/api/presets`,{method:`PUT`,headers:{"content-type":`application/json`,...Z},body:JSON.stringify({project:e,key:t,value:n})}),i=await r.json();if(!r.ok||!i.ok)throw Error(i.error??`HTTP ${r.status}`);return i}function lt(e){return X(`/api/components?project=${encodeURIComponent(e)}`)}function ut(e,t){return`/render-component?project=${encodeURIComponent(e)}&id=${encodeURIComponent(t)}`}var dt=V(`<div class=modal-actions>`),Q=V(`<div class=modal-backdrop><div role=dialog aria-modal=true><h3>`),ft=V(`<p class=modal-body>`),pt=V(`<button class=ghost>`),mt=V(`<button class="ghost danger">`);function ht(e){C(()=>{e.open&&queueMicrotask(()=>{(e.initialFocus?.()??document.querySelector(`.modal-actions button`))?.focus()})});let t=t=>{t.key===`Escape`&&(t.preventDefault(),e.onClose())};return P(L,{get when(){return e.open},get children(){var n=Q(),r=n.firstChild,i=r.firstChild;return n.$$mousedown=t=>{t.target===t.currentTarget&&e.onClose()},r.$$keydown=t,K(i,()=>e.title),K(r,()=>e.children,null),K(r,P(L,{get when(){return e.actions},get children(){var t=dt();return K(t,()=>e.actions),t}}),null),S(t=>{var n=`modal${e.class!==void 0&&e.class!==``?` ${e.class}`:``}`,i=e.title;return n!==t.e&&W(r,t.e=n),i!==t.t&&U(r,`aria-label`,t.t=i),t},{e:void 0,t:void 0}),n}})}function gt(e){let t;return P(ht,{get open(){return e.open},get title(){return e.title},get onClose(){return e.onCancel},initialFocus:()=>t,get actions(){return[(()=>{var t=pt();return t.$$click=()=>e.onCancel(),K(t,()=>e.cancelLabel),t})(),(()=>{var n=mt();return n.$$click=()=>e.onConfirm(),G(e=>{t=e},n),K(n,()=>e.confirmLabel),n})()]},get children(){var t=ft();return K(t,()=>e.body),t}})}H([`mousedown`,`keydown`,`click`]);function _t(e){let t=e.trim().replace(/^v/i,``),n=t.indexOf(`-`);return{nums:(n>=0?t.slice(0,n):t).split(`.`).map(e=>{let t=Number.parseInt(e,10);return Number.isFinite(t)?t:0}),prerelease:n>=0}}function vt(e,t){let n=_t(e),r=_t(t),i=Math.max(n.nums.length,r.nums.length);for(let e=0;e<i;e+=1){let t=n.nums[e]??0,i=r.nums[e]??0;if(t!==i)return t>i?1:-1}return n.prerelease===r.prerelease?0:n.prerelease?-1:1}function yt(e,t){return vt(e,t)>0}var bt=.1,xt=.02;function St(e,t){return t===0||Math.abs(e)>=Math.abs(t)?null:t>0?-1:1}function Ct(e,t=bt){return Math.min(4,Math.max(t,e))}function wt(e,t,n,r,i=bt){let a=Ct(e.z*t,i);if(a===e.z)return e;let o=a/e.z;return{z:a,tx:n-(n-e.tx)*o,ty:r-(r-e.ty)*o}}function Tt(e,t,n,r=bt){return wt(e,Ct(t,r)/e.z,n.width/2,n.height/2,r)}function Et(e,t,n=24){let r=Math.max(1,e.w),i=Math.max(1,e.h),a=Math.max(1,t.width-n*2),o=Math.max(1,t.height-n*2),s=Ct(Math.min(a/r,o/i),xt);return{z:s,tx:(t.width-r*s)/2-e.x*s,ty:(t.height-i*s)/2-e.y*s}}function Dt(e,t,n){return{z:e.z,tx:e.tx+t,ty:e.ty+n}}function Ot(e){return`translate(${e.tx}px, ${e.ty}px) scale(${e.z})`}function kt(e){if(e===null||e===``)return null;let t;try{t=JSON.parse(e)}catch{return null}if(typeof t!=`object`||!t)return null;let{z:n,tx:r,ty:i}=t;return typeof n!=`number`||typeof r!=`number`||typeof i!=`number`||!Number.isFinite(n)||!Number.isFinite(r)||!Number.isFinite(i)||n<=0?null:{z:Ct(n,xt),tx:r,ty:i}}var At=3,jt=.0015;function Mt({doc:e,onChange:t,onLevelStep:n,onQuickSwitch:r}){let i=e.querySelector(`.ptr-canvas`);if(i===null)return null;let a=i;a.style.transformOrigin=`0 0`;let o={z:1,tx:0,ty:0},s=!1,c=!1,l=!1,u=null,d=()=>({width:e.documentElement.clientWidth||1,height:e.documentElement.clientHeight||1});function f(){a.style.transform=Ot(o),t?.(o)}function p(e){o=e,f()}function m(){a.style.transition=``}function h(e){a.style.transition=`transform 180ms ease-out`,p(e),setTimeout(m,220)}function g(t){e.documentElement.style.cursor=t}function _(e){if(e.preventDefault(),e.altKey&&n!==void 0){let t=St(e.deltaX,e.deltaY);t!==null&&n(t,{x:e.clientX,y:e.clientY});return}m();let t=1;e.deltaMode===1?t=16:e.deltaMode===2&&(t=d().height);let r=o.z<.1?xt:bt;p(wt(o,Math.exp(-e.deltaY*t*jt),e.clientX,e.clientY,r))}function v(t){return t.button===1?!0:t.button===0?s?!0:t.target===a||t.target===e.body||t.target===e.documentElement:!1}function y(e){v(e)&&(e.preventDefault(),u={lastX:e.clientX,lastY:e.clientY,startX:e.clientX,startY:e.clientY},c=!1)}function b(t){if(!u)return;if(!c){if(Math.hypot(t.clientX-u.startX,t.clientY-u.startY)<At)return;c=!0,m(),e.body.style.userSelect=`none`,g(`grabbing`)}let n=t.clientX-u.lastX,r=t.clientY-u.lastY;u.lastX=t.clientX,u.lastY=t.clientY,p(Dt(o,n,r))}function x(){u&&(u=null,c&&(c=!1,l=!0,e.body.style.userSelect=``,g(s?`grab`:``)))}function S(e){s!==e&&(s=e,c||g(e?`grab`:``))}function C(e){if((e.ctrlKey||e.metaKey)&&e.key.toLowerCase()===`k`&&r!==void 0)e.preventDefault(),r();else if(e.key===` `&&!e.metaKey&&!e.ctrlKey&&!e.altKey){let t=e.target,n=t?.tagName??``;if(n===`INPUT`||n===`TEXTAREA`||t?.isContentEditable===!0)return;S(!0),e.preventDefault()}else E(e)&&e.preventDefault()}function w(e){e.key===` `&&S(!1)}function T(){S(!1),x()}function E(e){return(e.ctrlKey||e.metaKey)&&(e.key===`0`||e.key===`)`||e.code===`Digit0`||e.code===`Numpad0`)?(p(Tt(o,1,d())),!0):e.shiftKey&&!e.ctrlKey&&!e.metaKey&&(e.key===`!`||e.code===`Digit1`)?(D(),!0):!1}function D(){p(Et({x:0,y:0,w:a.offsetWidth,h:a.offsetHeight},d()))}function O(e){let t=d();h({z:o.z,tx:t.width/2-(e.x+e.w/2)*o.z,ty:t.height/2-(e.y+e.h/2)*o.z})}return e.addEventListener(`wheel`,_,{passive:!1}),e.addEventListener(`mousedown`,y,!0),e.addEventListener(`mousemove`,b,!0),e.addEventListener(`mouseup`,x,!0),e.addEventListener(`keydown`,C),e.addEventListener(`keyup`,w),e.defaultView?.addEventListener(`blur`,T),{get:()=>o,set:p,fitAll:D,centerOn:O,focusBox:e=>h(Et(e,d())),zoomToPercent:e=>p(Tt(o,e,d())),consumeDragClick:()=>{let e=l;return l=!1,e},handleKey:E,setSpace:S,destroy:()=>{e.removeEventListener(`wheel`,_),e.removeEventListener(`mousedown`,y,!0),e.removeEventListener(`mousemove`,b,!0),e.removeEventListener(`mouseup`,x,!0),e.removeEventListener(`keydown`,C),e.removeEventListener(`keyup`,w),e.defaultView?.removeEventListener(`blur`,T)}}}var Nt=`[data-ptr-selected]{outline:2px solid #908030 !important;outline-offset:-2px;}
|
|
2
|
+
[data-ptr-hover]:not([data-ptr-selected]){outline:1px dashed rgba(144,128,48,.55) !important;outline-offset:-2px;}
|
|
3
|
+
[data-ptr-changed]{box-shadow:inset 0 0 0 2px rgba(144,128,48,1);animation:ptr-pulse 2s ease-in-out infinite;}
|
|
4
|
+
@keyframes ptr-pulse{0%,100%{box-shadow:inset 0 0 0 2px rgba(144,128,48,1)}50%{box-shadow:inset 0 0 0 2px rgba(144,128,48,.25)}}
|
|
5
|
+
@media (prefers-reduced-motion: reduce){[data-ptr-changed]{animation:none !important;}}
|
|
6
|
+
html{cursor:default;}
|
|
7
|
+
html,body{overflow:hidden;}
|
|
8
|
+
html,body{background:var(--ptr-canvas-bg,#ffffff);}`,Pt=V(`<div class=canvas-bg role=group>`),Ft=V(`<button type=button class=canvas-bg-opt><span class=canvas-bg-dot aria-hidden=true>`),It=[`light`,`gray`,`dark`],Lt={light:`#ffffff`,gray:`#d2cec7`,dark:`#242b36`},Rt=`paintress:canvas-bg`;function zt(e){return It.includes(e)}function Bt(){try{let e=localStorage.getItem(Rt);if(zt(e))return e}catch{}return`light`}function Vt(e){try{localStorage.setItem(Rt,e)}catch{}}var Ht={light:`Light`,gray:`Gray`,dark:`Dark`};function Ut(e){return(()=>{var t=Pt();return K(t,()=>It.map(t=>(()=>{var n=Ft(),r=n.firstChild;return n.$$click=()=>e.onChange(t),K(n,()=>Ht[t],null),S(i=>{var a=e.value===t,o=e.value===t,s=Lt[t];return a!==i.e&&n.classList.toggle(`active`,i.e=a),o!==i.t&&U(n,`aria-pressed`,i.t=o),s!==i.a&&Le(r,`--dot`,i.a=s),i},{e:void 0,t:void 0,a:void 0}),n})())),S(n=>{var r=e.label,i=e.label;return r!==n.e&&U(t,`aria-label`,n.e=r),i!==n.t&&U(t,`title`,n.t=i),n},{e:void 0,t:void 0}),t})()}H([`click`]);var Wt={zh:{projects:`项目`,noProjects:`还没有注册项目`,projectFiles:e=>`${e} 个设计稿`,designs:`设计稿`,depth:`depth`,noFiles:`没有 .ptr / .pen 文件`,marks:`标记`,clear:`清空`,liveReload:`实时刷新`,refreshList:`刷新列表`,pickProject:`从左侧选择项目`,pickFile:`从左侧选择一个设计稿`,fit:`适应`,fitTitle:`适应窗口(Shift+1)`,actualSize:`1:1`,actualSizeTitle:`100%(Ctrl/Cmd+0)`,rerender:`重新渲染`,allBoards:`全部`,canvasBackground:`画布背景`,language:`界面语言`,unwatch:`解绑`,unwatchTitle:`解绑项目`,unwatchBody:e=>`「${e}」将从项目列表中移除。设计稿文件不受影响;agent 下次启动会自动重新注册。`,closeServer:`关闭服务器`,closeServerTitle:`关闭 web 进程`,closeServerBody:(e,t)=>`将断开 ${t} 个长连接并停止进程 pid ${e}。之后可用 paintress web 重新启动。`,cancel:`取消`,serverClosed:`服务已关闭`,serverClosedHint:`可以关闭此页面;需要时重新启动 paintress web。`,updateAvailable:(e,t)=>`新版 v${e}(当前 v${t})`,updateTitle:`有新版本`,updatePrompt:`把 paintress 升级到最新版:npm install -g paintress@latest,完成后重启 MCP 会话。`,updateSteps:`把上面这句话交给你的 AI 即可;或自己在终端执行那条命令。`,updateRepo:`GitHub`,copy:`复制`,copied:`已复制`,close:`关闭`,versionTitle:`版本`,agentOnline:`agent 已接入`,fontBadge:(e,t)=>`字体 ${e}/${t}`,fontMissing:e=>`字体缺失:${e}(已用替代字体)`,fontTitle:e=>`${e} 个字体已加载`,exportFrame:`导出 PNG`,exportScale:`倍率`,quickSwitch:`切换设计稿`,quickSwitchPlaceholder:`输入文件名过滤…`,quickSwitchEmpty:`没有匹配的设计稿`,quickSwitchHint:`↑↓ 选择 · Enter 打开 · Esc 关闭`,inspector:`属性`,inspectorEmpty:`选中画布里的一个节点,这里显示它的属性。`,inspectorGroups:{identity:`标识`,geometry:`几何`,layout:`布局`,appearance:`外观`,text:`文本`,other:`其它`},inspectorDescendants:e=>`ref 覆写了 ${e} 个后代`,noActiveProjects:`无激活项目`,closingIn:e=>`窗口将在 ${e} 秒后关闭`,closingAuto:`窗口会自动关闭,不用手动操作。`,closingWaitAgent:`窗口会自动关闭,agent 接入即取消。`,closeBlockedHint:`浏览器不允许自动关闭,请手动关掉这个标签。`,waitingForAgent:`等待 agent 接入 —— 在项目里让 AI 操作设计稿,这里会自动出现。`,notes:`笔记`,notesTitle:`设计笔记`,canvasTools:`画布工具`,presets:`预设`,components:`组件`,closePanel:`关闭`,presetEmpty:`还没有预设。让 agent 先把颜色和倒角定下来。`,presetHint:`改一个值,画布立刻更新。`,presetColor:`颜色`,presetSpacing:`间距`,presetFont:`字体`,presetGroups:`预设组(谱式)`,presetGroupsEmpty:`还没有预设组;让 agent 用 preset 把一组属性框起来。`,presetRadius:`倒角`,presetFontSize:`字号`,componentsEmpty:`还没有组件。让 agent 把做好的组件登记进组件库。`,componentsHint:`画新组件之前,先看这里有没有能复用的。`,componentsCount:e=>`${e} 个组件`},en:{projects:`Projects`,noProjects:`No projects registered yet`,projectFiles:e=>`${e} design${e===1?``:`s`}`,designs:`Designs`,depth:`depth`,noFiles:`No .ptr / .pen files`,marks:`Marks`,clear:`Clear`,liveReload:`Live reload`,refreshList:`Refresh`,pickProject:`Pick a project on the left`,pickFile:`Pick a design on the left`,fit:`Fit`,fitTitle:`Fit to window (Shift+1)`,actualSize:`1:1`,actualSizeTitle:`100% (Ctrl/Cmd+0)`,rerender:`Re-render`,allBoards:`All`,canvasBackground:`Canvas background`,language:`Language`,unwatch:`Unbind`,unwatchTitle:`Unbind project`,unwatchBody:e=>`“${e}” will be removed from the project list. Design files are untouched; the agent re-registers it on next start.`,closeServer:`Stop server`,closeServerTitle:`Stop web process`,closeServerBody:(e,t)=>`This drops ${t} live connection${t===1?``:`s`} and stops process pid ${e}. Restart later with paintress web.`,cancel:`Cancel`,serverClosed:`Server stopped`,serverClosedHint:`You can close this page; run paintress web to start it again.`,updateAvailable:(e,t)=>`v${e} available (running v${t})`,updateTitle:`Update available`,updatePrompt:`Upgrade paintress to the latest version: npm install -g paintress@latest, then restart the MCP session.`,updateSteps:`Hand that line to your AI, or run the command yourself in a terminal.`,updateRepo:`GitHub`,copy:`Copy`,copied:`Copied`,close:`Close`,versionTitle:`Version`,agentOnline:`Agent attached`,fontBadge:(e,t)=>`Fonts ${e}/${t}`,fontMissing:e=>`Missing fonts: ${e} (substituted)`,fontTitle:e=>`${e} fonts loaded`,exportFrame:`Export PNG`,exportScale:`Scale`,quickSwitch:`Switch file`,quickSwitchPlaceholder:`Type to filter files…`,quickSwitchEmpty:`No matching design files`,quickSwitchHint:`↑↓ choose · Enter open · Esc close`,inspector:`Properties`,inspectorEmpty:`Select a node on the canvas to see its properties.`,inspectorGroups:{identity:`Identity`,geometry:`Geometry`,layout:`Layout`,appearance:`Appearance`,text:`Text`,other:`Other`},inspectorDescendants:e=>`overrides ${e} descendant${e===1?``:`s`}`,noActiveProjects:`No active projects`,closingIn:e=>`This window closes in ${e}s`,closingAuto:`This window closes itself — no need to do anything.`,closingWaitAgent:`This window closes itself; an agent reattaching cancels it.`,closeBlockedHint:`The browser blocked the automatic close — please close this tab manually.`,waitingForAgent:`Waiting for an agent — ask your AI to touch a design and it shows up here automatically.`,notes:`Notes`,notesTitle:`Design notes`,canvasTools:`Canvas tools`,presets:`Presets`,components:`Components`,closePanel:`Close`,presetEmpty:`No presets yet. Ask the agent to fix colors and corner radii first.`,presetHint:`Change a value and the canvas updates immediately.`,presetColor:`Colors`,presetSpacing:`Spacing`,presetFont:`Fonts`,presetGroups:`Preset groups`,presetGroupsEmpty:`No preset groups yet — ask the agent to define one.`,presetRadius:`Corner radius`,presetFontSize:`Font size`,componentsEmpty:`No components yet. Ask the agent to register the ones it built.`,componentsHint:`Check here before building a new component.`,componentsCount:e=>`${e} component${e===1?``:`s`}`}};function Gt(e){return Wt[e]}function Kt(e){return(e?.languages?.[0]??e?.language??``).toLowerCase().startsWith(`zh`)?`zh`:`en`}var qt=`paintress:lang`;function Jt(e){return e===`zh`||e===`en`}function Yt(){try{let e=localStorage.getItem(qt);if(Jt(e))return e}catch{}return Kt(typeof navigator>`u`?void 0:navigator)}function Xt(e){try{localStorage.setItem(qt,e)}catch{}}var $=V(`<aside><header class=panel-head><h2></h2><button class="ghost tiny panel-close">✕</button></header><div class=panel-body>`);function Zt(e){let t=()=>[`panel`,e.floating===!0?`panel-float`:``,e.class??``].filter(e=>e!==``).join(` `);return(()=>{var n=$(),r=n.firstChild,i=r.firstChild,a=i.nextSibling,o=r.nextSibling;return K(i,()=>e.title),Pe(a,`click`,e.onClose,!0),K(o,()=>e.children),S(r=>{var i=t(),o=e.closeLabel,s=e.closeLabel;return i!==r.e&&W(n,r.e=i),o!==r.t&&U(a,`title`,r.t=o),s!==r.a&&U(a,`aria-label`,r.a=s),r},{e:void 0,t:void 0,a:void 0}),n})()}H([`click`]);var Qt=`modulepreload`,$t=function(e){return`/`+e},en={},tn=function(e){return e.pathname.endsWith(`.css`)},nn=function(e,t,n){if(t in e)return e[t];let r=n();if(!r){e[t]=void 0;return}let i=r.then(()=>{e[t]=void 0},n=>{throw e[t]=void 0,n});return e[t]=i,i},rn=function(e,t,n){let r=Promise.resolve();if(t&&t.length>0){let e,i=document.querySelector(`meta[property=csp-nonce]`),a=i?.nonce||i?.getAttribute(`nonce`);function o(e){return Promise.all(e.map(e=>Promise.resolve(e).then(e=>({status:`fulfilled`,value:e}),e=>({status:`rejected`,reason:e}))))}function s(e){return import.meta.resolve?new URL(import.meta.resolve(e)):new URL(e,import.meta.url)}r=o(t.map(t=>{t=$t(t,n);let r=s(t),i=tn(r);return nn(en,r.href,()=>{if(e===void 0){e={all:new Set,styles:new Set};let t=document.getElementsByTagName(`link`);for(let n=t.length-1;n>=0;n--){let r=t[n];e.all.add(r.href),r.rel===`stylesheet`&&e.styles.add(r.href)}}if((i?e.styles:e.all).has(r.href))return;let t=document.createElement(`link`);if(t.rel=i?`stylesheet`:Qt,i||(t.as=`script`),t.crossOrigin=``,t.href=r.href,a&&t.setAttribute(`nonce`,a),document.head.appendChild(t),i)return new Promise((e,n)=>{let i=a=>{t.removeEventListener(`load`,i),t.removeEventListener(`error`,i),a.type===`error`?n(Error(`Unable to preload CSS for ${r}`)):e(a)};t.addEventListener(`load`,i),t.addEventListener(`error`,i)})})}).filter(e=>e!==void 0))}function i(e){let t=new Event(`vite:preloadError`,{cancelable:!0});if(t.payload=e,window.dispatchEvent(t),!t.defaultPrevented)throw e}return r.then(t=>{for(let e of t||[])e.status===`rejected`&&i(e.reason);return e().catch(i)})},an=null;function on(){return an??=rn(()=>import(`./marked.esm-DZCVybOJ.js`),[]),an}var sn=/^(https?:\/\/|mailto:|#|\/)/i;function cn(e){return e.replace(/&/g,`&`).replace(/</g,`<`).replace(/>/g,`>`).replace(/"/g,`"`)}function ln(e){return cn(e).replace(/'/g,`'`)}async function un(e){let{Marked:t}=await on(),n=new t({gfm:!0,breaks:!1});return n.use({renderer:{html(e){return cn(e.text)},link(e){let t=sn.test(e.href)?e.href:`#`,n=e.title!==null&&e.title!==void 0?` title="${ln(e.title)}"`:``,r=this.parser.parseInline(e.tokens);return`<a href="${ln(t)}"${n} target="_blank" rel="noreferrer noopener">${r}</a>`},image(e){let t=sn.test(e.href)?e.href:``;if(t===``)return cn(e.text??``);let n=e.title!==null&&e.title!==void 0?` title="${ln(e.title)}"`:``;return`<img src="${ln(t)}" alt="${ln(e.text??``)}"${n} loading="lazy">`}},walkTokens(e){e.type!==`link`&&e.type!==`image`||sn.test(e.href)||(e.href=``)}}),n.parse(e,{async:!1})}var dn=V(`<div class=markdown>`),fn=V(`<p class=panel-error>`);function pn(e){let[t,n]=x(``),[r,i]=x(null);return C(E(()=>e.markdown,e=>{if(e===null){n(``),i(null);return}let t=!1;un(e).then(e=>{t||(n(e),i(null))}).catch(e=>{t||i(e instanceof Error?e.message:String(e))}),O(()=>{t=!0})})),P(Zt,{get title(){return e.title},get closeLabel(){return e.closeLabel},get onClose(){return e.onClose},class:`notes-panel`,get children(){return P(L,{get when(){return r()??e.error},get fallback(){return(()=>{var e=dn();return S(()=>e.innerHTML=t()),e})()},children:e=>(()=>{var t=fn();return K(t,e),t})()})}})}var mn=V(`<input class=preset-swatch type=color>`),hn=V(`<li class=preset-row><span class=preset-name></span><input class=preset-value>`),gn=V(`<h3 class=panel-group>`),_n=V(`<ul class=preset-group-list>`),vn=V(`<p class=panel-empty>`),yn=V(`<p class=panel-hint>`),bn=V(`<ul class=preset-list>`),xn=V(`<li class=preset-group><div class=preset-group-head><code></code><span class=hint></span></div><div class=preset-group-props>`),Sn=V(`<span class=preset-group-prop><span class=preset-group-key></span><code>`);function Cn(e){let t=e.trim();return/^#[0-9a-fA-F]{3}$/.test(t)?`#${t[1]}${t[1]}${t[2]}${t[2]}${t[3]}${t[3]}`.toUpperCase():/^#[0-9a-fA-F]{6,8}$/.test(t)?t.slice(0,7).toUpperCase():`#000000`}var wn=[{type:`color`,key:`color`},{type:`radius`,key:`radius`},{type:`spacing`,key:`spacing`},{type:`fontSize`,key:`fontSize`},{type:`font`,key:`font`}];function Tn(e){let[t,n]=x({}),r=e=>t()[e.key]??e.value,i=t=>e.items.filter(e=>e.type===t);function a(e,t){n(n=>({...n,[e]:t}))}function o(t){let i=r(t).trim();i===``||i===t.value||e.onSet(t.key,i),n(e=>{let n={...e};return delete n[t.key],n})}let s=e=>t=>{t.key===`Enter`&&o(e),t.key===`Escape`&&n({})},c=t=>(()=>{var n=hn(),i=n.firstChild,c=i.nextSibling;return K(i,()=>t.name),K(n,P(L,{get when(){return t.type===`color`},get children(){var n=mn();return n.addEventListener(`change`,e=>{a(t.key,e.currentTarget.value.toUpperCase()),o(t)}),n.$$input=e=>a(t.key,e.currentTarget.value.toUpperCase()),S(()=>U(n,`aria-label`,`${t.name} ${e.labels.color}`)),S(()=>n.value=Cn(r(t))),n}}),c),Re(c,Se({get type(){return t.type===`radius`||t.type===`spacing`||t.type===`fontSize`?`number`:`text`}},()=>t.type===`radius`||t.type===`spacing`||t.type===`fontSize`?{min:`0`,step:t.type===`spacing`?`0.5`:`1`}:{spellcheck:!1},{get value(){return r(t)},get"aria-label"(){return`${t.name} ${e.labels[t.type]}`},onInput:e=>a(t.key,e.currentTarget.value),onBlur:()=>o(t),get onKeyDown(){return s(t)}}),!1,!1),S(()=>U(i,`title`,t.key)),n})(),l=()=>Object.entries(e.groups);return P(Zt,{get title(){return e.labels.title},get closeLabel(){return e.labels.close},get onClose(){return e.onClose},floating:!0,class:`preset-panel`,get children(){return P(L,{get when(){return e.items.length>0||l().length>0},get fallback(){return[(()=>{var t=vn();return K(t,()=>e.labels.empty),t})(),(()=>{var t=yn();return K(t,()=>e.labels.hint),t})()]},get children(){return[P(I,{each:wn,children:t=>P(L,{get when(){return i(t.type).length>0},get children(){return[(()=>{var n=gn();return K(n,()=>e.labels[t.key]),n})(),(()=>{var e=bn();return K(e,P(I,{get each(){return i(t.type)},children:e=>c(e)})),e})()]}})}),P(L,{get when(){return l().length>0},get fallback(){return(()=>{var t=yn();return K(t,()=>e.labels.groupsEmpty),t})()},get children(){return[(()=>{var t=gn();return K(t,()=>e.labels.groups),t})(),(()=>{var e=_n();return K(e,P(I,{get each(){return l()},children:([e,t])=>(()=>{var n=xn(),r=n.firstChild,i=r.firstChild,a=i.nextSibling,o=r.nextSibling;return K(i,e),K(a,()=>t.target),K(o,P(I,{get each(){return Object.entries(t.props)},children:([e,t])=>(()=>{var n=Sn(),r=n.firstChild,i=r.nextSibling;return K(r,e),K(i,t),n})()})),n})()})),e})()]}})]}})}})}H([`input`]);var En=V(`<figure class=tile><div class=tile-frame><iframe loading=lazy scrolling=no sandbox=allow-same-origin></iframe></div><figcaption>`,!0,!1,!1),Dn=V(`<p class=panel-hint>`),On=V(`<div class=tiles>`),kn=V(`<p class=panel-empty>`);function An(e){let t=()=>Math.max(1,e.item.width??120),n=()=>Math.max(1,e.item.height??40),r=()=>Math.min(1,120/Math.max(t(),n()));return(()=>{var i=En(),a=i.firstChild,o=a.firstChild,s=a.nextSibling;return K(s,()=>e.item.name),S(i=>{var a=ut(e.project,e.item.id),c=e.item.name,l=`${t()}px`,u=`${n()}px`,d=`translate(-50%, -50%) scale(${r()})`,f=e.item.name;return a!==i.e&&U(o,`src`,i.e=a),c!==i.t&&U(o,`title`,i.t=c),l!==i.a&&Le(o,`width`,i.a=l),u!==i.o&&Le(o,`height`,i.o=u),d!==i.i&&Le(o,`transform`,i.i=d),f!==i.n&&U(s,`title`,i.n=f),i},{e:void 0,t:void 0,a:void 0,o:void 0,i:void 0,n:void 0}),i})()}function jn(e){return P(Zt,{get title(){return e.labels.title},get closeLabel(){return e.labels.close},get onClose(){return e.onClose},floating:!0,class:`components-panel`,get children(){return P(L,{get when(){return e.items.length>0},get fallback(){return[(()=>{var t=kn();return K(t,()=>e.labels.empty),t})(),(()=>{var t=Dn();return K(t,()=>e.labels.hint),t})()]},get children(){return[(()=>{var t=Dn();return K(t,()=>e.labels.count(e.items.length)),t})(),(()=>{var t=On();return K(t,P(I,{get each(){return e.items},children:t=>P(An,{item:t,get project(){return e.project}})})),t})()]}})}})}var Mn=V(`<svg width=18 height=18 viewBox="0 0 24 24"fill=none stroke=currentColor stroke-width=1.6 stroke-linecap=round stroke-linejoin=round aria-hidden=true><rect x=3 y=3 width=18 height=18 rx=4></rect><circle cx=8.5 cy=9 r=1.3 fill=currentColor stroke=none></circle><circle cx=15.5 cy=9 r=1.3 fill=currentColor stroke=none></circle><circle cx=8.5 cy=15 r=1.3 fill=currentColor stroke=none></circle><circle cx=15.5 cy=15 r=1.3 fill=currentColor stroke=none>`),Nn=V(`<svg width=18 height=18 viewBox="0 0 24 24"fill=none stroke=currentColor stroke-width=1.6 stroke-linecap=round stroke-linejoin=round aria-hidden=true><rect x=3 y=3 width=18 height=18 rx=4 stroke-dasharray="2 3"></rect><path d="M9 9h6v6H9z">`),Pn=V(`<svg width=18 height=18 viewBox="0 0 24 24"fill=none stroke=currentColor stroke-width=1.6 stroke-linecap=round stroke-linejoin=round aria-hidden=true><rect x=3 y=3 width=7.5 height=7.5 rx=2></rect><rect x=13.5 y=3 width=7.5 height=7.5 rx=2></rect><rect x=3 y=13.5 width=7.5 height=7.5 rx=2></rect><rect x=13.5 y=13.5 width=7.5 height=7.5 rx=2>`),Fn=V(`<div class=tool-rail role=toolbar>`),In=V(`<button class=rail-btn>`);function Ln(){return Mn()}function Rn(){return Nn()}function zn(){return Pn()}function Bn(e){return(()=>{var t=Fn();return K(t,P(I,{get each(){return e.items},children:t=>(()=>{var n=In();return n.$$click=()=>e.onToggle(t.id),K(n,(()=>{var e=B(()=>t.icon===`preset`);return()=>e()?P(Ln,{}):B(()=>t.icon===`inspect`)()?P(Rn,{}):P(zn,{})})()),S(r=>{var i=e.active===t.id,a=t.label,o=t.label,s=e.active===t.id;return i!==r.e&&n.classList.toggle(`active`,r.e=i),a!==r.t&&U(n,`title`,r.t=a),o!==r.a&&U(n,`aria-label`,r.a=o),s!==r.o&&U(n,`aria-pressed`,r.o=s),r},{e:void 0,t:void 0,a:void 0,o:void 0}),n})()})),S(()=>U(t,`aria-label`,e.label)),t})()}H([`click`]);var Vn=V(`<p class=insp-note>`),Hn=V(`<p class=empty>`),Un=V(`<section class=insp-group><h3>`),Wn=V(`<span class=insp-swatch aria-hidden=true>`),Gn=V(`<span class=insp-resolved>→ `),Kn=V(`<div class=insp-row><span class=insp-key></span><span class=insp-val><code>`),qn=[{key:`identity`,fields:[`id`,`type`,`name`,`reusable`,`preset`,`ref`,`metadata`]},{key:`geometry`,fields:[`x`,`y`,`width`,`height`,`rotation`,`opacity`,`flipX`,`flipY`]},{key:`layout`,fields:[`layout`,`gap`,`padding`,`justifyContent`,`alignItems`,`layoutPosition`,`clip`,`textGrowth`]},{key:`appearance`,fields:[`fill`,`stroke`,`strokeWidth`,`strokeAlignment`,`cornerRadius`,`effect`,`blendMode`]},{key:`text`,fields:[`content`,`fontFamily`,`fontSize`,`fontWeight`,`lineHeight`,`letterSpacing`,`textAlign`]}],Jn=120,Yn=/^#(?:[0-9a-fA-F]{3}|[0-9a-fA-F]{6}|[0-9a-fA-F]{8})$/;function Xn(e,t){if(e==null)return null;if(typeof e==`string`){if(e.startsWith(`$`)){let n=t[e.slice(1)];return n===void 0?{text:e}:{text:e,resolved:n,...Yn.test(n)?{swatch:n}:{}}}return Yn.test(e)?{text:e,swatch:e}:{text:e}}if(typeof e==`number`||typeof e==`boolean`)return{text:String(e)};let n;try{n=JSON.stringify(e)}catch{n=String(e)}return{text:n.length>Jn?`${n.slice(0,Jn)}…`:n}}function Zn(e,t,n){let r=[];for(let t of n){let n=e[t];n!==void 0&&r.push([t,n])}if(t===`other`){let t=new Set(qn.flatMap(e=>e.fields));for(let[n,i]of Object.entries(e))t.has(n)||n===`children`||r.push([n,i])}return r}function Qn(e){let t=e?.descendants;return Array.isArray(t)?t.length:typeof t==`object`&&t?Object.keys(t).length:0}function $n(e){let t=()=>e.node;return P(Zt,{get title(){return e.labels.title},get closeLabel(){return e.labels.close},get onClose(){return e.onClose},floating:!0,class:`inspector-panel`,get children(){return P(L,{get when(){return t()!==null},get fallback(){return(()=>{var t=Hn();return K(t,()=>e.labels.empty),t})()},get children(){return[P(L,{get when(){return Qn(t())>0},get children(){var n=Vn();return K(n,()=>e.labels.descendants(Qn(t()))),n}}),P(I,{each:qn,children:n=>{let r=()=>Zn(t()??{},n.key,n.fields);return P(L,{get when(){return r().length>0},get children(){var t=Un(),i=t.firstChild;return K(i,()=>e.labels.groups[n.key]),K(t,P(I,{get each(){return r()},children:([t,n])=>{let r=Xn(n,e.vars);return P(L,{when:r!==null,get children(){var e=Kn(),n=e.firstChild,i=n.nextSibling,a=i.firstChild;return K(n,t),K(i,P(L,{get when(){return r.swatch},get children(){var e=Wn();return S(t=>Le(e,`background`,r.swatch)),e}}),a),K(a,()=>r.text),K(i,P(L,{get when(){return r.resolved!==void 0},get children(){var e=Gn();return e.firstChild,K(e,()=>r.resolved,null),e}}),null),e}})}}),null),t}})}})]}})}})}var er=V(`<ul class=qs-list>`),tr=V(`<div class=qs-body><input class=qs-input type=text><p class=qs-hint>`),nr=V(`<p class=qs-empty>`),rr=V(`<span class=qs-dir>`),ir=V(`<li><button type=button class=qs-item><span class=qs-name>`);function ar(e){let t=e.lastIndexOf(`/`);return t<0?{dir:``,name:e}:{dir:e.slice(0,t+1),name:e.slice(t+1)}}function or(e){let[t,n]=x(``),[r,i]=x(0),a,o,s=w(()=>{let n=t().trim().toLowerCase(),r=e.files;return n===``?r:r.filter(e=>e.toLowerCase().includes(n))});C(()=>{if(!e.open)return;n(``);let t=e.current===null?0:Math.max(0,e.files.indexOf(e.current));i(t),queueMicrotask(()=>a?.select())}),C(()=>{r(),queueMicrotask(()=>o?.querySelector(`.qs-item.active`)?.scrollIntoView({block:`nearest`}))});function c(t){t!==void 0&&e.onPick(t)}function l(e){let t=s();if(e.key===`ArrowDown`)e.preventDefault(),i(e=>t.length===0?0:(e+1)%t.length);else if(e.key===`ArrowUp`)e.preventDefault(),i(e=>t.length===0?0:(e-1+t.length)%t.length);else if(e.key===`Enter`){if(e.isComposing)return;e.preventDefault(),c(t[r()])}}return P(ht,{get open(){return e.open},get title(){return e.labels.title},get onClose(){return e.onClose},initialFocus:()=>a,class:`quick-switch-modal`,get children(){var u=tr(),d=u.firstChild,f=d.nextSibling;return u.$$keydown=l,d.$$input=e=>{n(e.currentTarget.value),i(0)},G(e=>{a=e},d),K(u,P(L,{get when(){return s().length>0},get fallback(){return(()=>{var t=nr();return K(t,()=>e.labels.empty),t})()},get children(){var t=er();return G(e=>{o=e},t),K(t,P(I,{get each(){return s()},children:(t,n)=>{let a=ar(t);return(()=>{var o=ir(),s=o.firstChild,l=s.firstChild;return s.$$click=()=>c(t),s.addEventListener(`mouseenter`,()=>i(n())),K(s,P(L,{get when(){return a.dir!==``},get children(){var e=rr();return K(e,()=>a.dir),e}}),l),K(l,()=>a.name),S(i=>{var a=n()===r(),o=t===e.current;return a!==i.e&&s.classList.toggle(`active`,i.e=a),o!==i.t&&s.classList.toggle(`current`,i.t=o),i},{e:void 0,t:void 0}),o})()}})),t}}),f),K(f,()=>e.labels.hint),S(t=>{var n=e.labels.placeholder,r=e.labels.placeholder;return n!==t.e&&U(d,`placeholder`,t.e=n),r!==t.t&&U(d,`aria-label`,t.t=r),t},{e:void 0,t:void 0}),S(()=>d.value=t()),u}})}H([`keydown`,`input`,`click`]);var sr=V(`<button class="badge badge-stack"><span>v</span><span class=badge-new>v`),cr=V(`<ul class=list>`),lr=V(`<section class="section files"><h2> <span class=hint> `),ur=V(`<section class="section marks"><h2><button class="ghost tiny"></button></h2><ul class=list>`),dr=V(`<span class=hint>pid `),fr=V(`<div class=error>`),pr=V(`<code>`),mr=V(`<span class=sep>/`),hr=V(`<button class="ghost tiny qs-trigger">`),gr=V(`<span class="hint zoom">%`),_r=V(`<button class="ghost tiny">`),vr=V(`<button class=ghost>`),yr=V(`<span class=tool-sep>`),br=V(`<div class=boardbar-export><span class=hint></span><select class="ghost tiny export-scale"><option value=0.5>0.5x</option><option value=1>1x</option><option value=2>2x</option></select><button class="ghost tiny">`),xr=V(`<div class=boardbar><button class=board></button><div class=boardbar-scroll>`),Sr=V(`<button class=notes-toggle><svg width=14 height=14 viewBox="0 0 24 24"fill=none stroke=currentColor stroke-width=1.6 stroke-linecap=round stroke-linejoin=round aria-hidden=true><path d="M14 3H7a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h10a2 2 0 0 0 2-2V8z"></path><path d="M14 3v5h5"></path><path d="M9 13h6M9 17h4">`),Cr=V(`<div class=canvas-row><div class=canvas-wrap><iframe class=preview title="design preview"sandbox="allow-same-origin allow-scripts">`),wr=V(`<div class="modal-backdrop countdown-backdrop"><div class="modal countdown closed"role=status><h3></h3><p class=modal-body>`),Tr=V(`<div class="modal-backdrop countdown-backdrop"><div class="modal countdown"role=status aria-labelledby=countdown-title><div class=countdown-ring aria-hidden=true><svg viewBox="0 0 68 68"><circle class=countdown-ring-track cx=34 cy=34 r=30></circle><circle class=countdown-ring-fill cx=34 cy=34 r=30></circle></svg><span class=countdown-num></span></div><h3 id=countdown-title></h3><p class=modal-body></p><p class=sr-only aria-live=polite>`),Er=V(`<p class=modal-body>`),Dr=V(`<pre class=prompt>`),Or=V(`<div class=app><aside class=sidebar><header class=sidebar-head><img class=brand-mark src=/logo.svg alt><h1>paintress</h1></header><section class=section><h2></h2></section><footer class=sidebar-foot><label class=toggle><input type=checkbox></label><button class=ghost></button><button class=ghost></button></footer></aside><main class=stage><div class=toolbar><div class=crumbs></div><div class=tools><div class=lang-switch role=group><button class=lang-opt>中</button><button class=lang-opt>EN`),kr=V(`<span class=badge>v`),Ar=V(`<span class=badge>`),jr=V(`<p class=empty><br><code>paintress watch <name> <dir>`),Mr=V(`<li class=row><button class=item><span class=item-name></span><span class=item-meta></span></button><button class=row-action>×`),Nr=V(`<span class=dot>`),Pr=V(`<p class=empty>`),Fr=V(`<li><button class=item><span class=item-name>`),Ir=V(`<li><button class=item><span class=item-name><b class=mark-no>#</b> </span><span class=item-meta>`),Lr=V(`<button class=crumb>`),Rr=V(`<p>`),zr=V(`<div class=placeholder>`),Br=V(`<button class=board><span class=board-name></span><span class=board-size>×`),Vr=V(`<a class=ghost href=https://github.com/aliciai-dev/paintress target=_blank rel=noreferrer>`);function Hr(){try{let e=localStorage.getItem(`paintress:export-scale`),t=e===null?1:Number(e);return t===2||t===1||t===.5?t:1}catch{return 1}}function Ur(e){try{localStorage.setItem(`paintress:export-scale`,String(e))}catch{}}var Wr=10,Gr=2*Math.PI*30;function Kr(e,t){let n=e.split(`/`).filter(e=>e!==``);for(let e=Math.min(3,n.length);e>=1;e--){let r=n.slice(0,e).map(e=>decodeURIComponent(e)).join(`/`);if(t.some(e=>e.name===r))return r}return null}function qr(e,t){let n=`/${e.split(`/`).filter(e=>e!==``).map(encodeURIComponent).join(`/`)}`;return t===null?n:`${n}?file=${t.split(`/`).map(encodeURIComponent).join(`/`)}`}function Jr(e){return typeof CSS<`u`&&typeof CSS.escape==`function`?CSS.escape(e):e.replace(/["\\]/g,`\\$&`)}function Yr(){let[e,t]=x([]),[n,r]=x([]),[i,a]=x(null),[o,s]=x([]),[c,l]=x(null),[u,d]=x(null);C(E(c,()=>d(null))),D(()=>{let e=e=>{let t=e.data;typeof t==`object`&&t&&t.type===`paintress-fonts`&&d({checked:Array.isArray(t.checked)?t.checked.map(String):[],missing:Array.isArray(t.missing)?t.missing.map(String):[]})};window.addEventListener(`message`,e),O(()=>window.removeEventListener(`message`,e))});let[f,p]=x([]),[m,h]=x(null),[g,_]=x([]),[v,y]=x(null),[b,w]=x({}),[T,ee]=x(0),[te,ne]=x(!0),[re,ie]=x(``),[ae,oe]=x([]),[se,ce]=x(null),[le,k]=x(1),[A,ue]=x(Yt()),[j,de]=x(Bt()),[fe,M]=x(null),[pe,me]=x(!1),[he,ge]=x(Hr()),[N,_e]=x(!1),[ve,F]=x(!1),[ye,be]=x(!1),[xe,Se]=x(null),[Ce,we]=x(null),[R,z]=x(null),[Te,Ee]=x(null),[De,Oe]=x({}),ke=!1,[Ae,je]=x([]),[V,H]=x({}),[Me,Ne]=x([]),[W,Pe]=x(null),[Fe,Ie]=x(`idle`),[Re,ze]=x(!1),q=!1,[Be,Ve]=x(!1),[He,Ue]=x(!1),J=()=>Gt(A()),We=()=>[{id:`inspect`,label:J().inspector,icon:`inspect`},{id:`presets`,label:J().presets,icon:`preset`},{id:`components`,label:J().components,icon:`component`}],Ge,Y,X,Z=null,ut;function dt(e){e.classList.toggle(`overflow`,e.scrollWidth>e.clientWidth+1)}function Q(){let e=i(),t=c();history.replaceState(null,``,e===null?`/`:qr(e,t))}let ft;function pt(e){let t=n(),i=new Map(t.map(e=>[e.name,e])),a=new Set(e.map(e=>e.name)),o=[];for(let t of e){let e=i.get(t.name),n=e!==void 0&&e.leaving!==!0&&e.fileCount===t.fileCount&&e.agentConns===t.agentConns&&e.depth===t.depth&&e.label===t.label&&e.root===t.root;o.push(n?e:{...t})}let s=!1;for(let e of t)e.leaving===!0?a.has(e.name)||(o.push(e),s=!0):a.has(e.name)||(o.push({...e,leaving:!0}),s=!0);r(o),s&&(clearTimeout(ft),ft=setTimeout(()=>r(e=>e.filter(e=>e.leaving!==!0)),240)),e.length>0&&(q=!0)}async function mt(){try{let e=await Ke();t(e.projects),pt(e.projects),w({pid:e.pid,version:e.version,latest:e.latest??null,connections:e.connections}),y(null)}catch(e){y(e instanceof Error?e.message:String(e))}}async function _t(){try{let e=await qe();w({pid:e.pid,version:e.version,latest:e.latest??null,connections:e.connections})}catch{}}async function vt(e){try{p((await et(e)).marks)}catch{p([])}}async function bt(e){a(e),l(null),h(null),_([]);try{let t=await Ye(e);s(t.files),y(null)}catch(e){s([]),y(e instanceof Error?e.message:String(e))}vt(e),Q()}async function xt(){await mt();let t=i();if(t!==null){if(!e().some(e=>e.name===t))a(null),l(null),s([]),h(null),_([]),Q();else{try{let n=await Ye(t),r=o();s(n.files);let i=c();if(i===null){let i=n.files.filter(e=>!r.includes(e));i.length>0&&e().some(e=>e.name===t)&&St(i[0])}else n.files.includes(i)||(l(null),h(null),_([]),Q())}catch{}vt(t)}}}function St(e){l(e),h(null),_([]),F(!1),Q()}async function Ct(e,t){try{let n=await ot(e,t);be(n.exists),Se(n.markdown??null),we(null),n.exists||F(!1)}catch(e){be(!1),Se(null),we(e instanceof Error?e.message:String(e))}}async function wt(e){try{let t=await st(e);je(t.items),H(t.groups??{})}catch(e){y(e instanceof Error?e.message:String(e))}}async function Tt(e){try{Ne((await lt(e)).items)}catch(e){y(e instanceof Error?e.message:String(e))}}async function Et(e,t){let n=i();if(n!==null)try{let r=await ct(n,e,t);je(r.items),H(r.groups??{}),ee(e=>e+1),y(null)}catch(e){y(e instanceof Error?e.message:String(e)),wt(n)}}function Dt(e){let t=R()===e,n=t?null:e;z(n),e===`inspect`&&t&&(ke=!0);let r=i();r!==null&&(n===`presets`&&wt(r),n===`components`&&Tt(r))}async function Ot(e,t,n){try{let r=await Je(e,t,n);if(m()!==n)return;Ee(r.node),Oe(r.vars),!ke&&R()===null&&z(`inspect`)}catch(e){if(m()!==n)return;Ee(null),y(e instanceof Error?e.message:String(e))}}C(E(m,e=>{let t=i(),n=c();e===null||t===null||n===null?(Ee(null),R()===`inspect`&&z(null)):Ot(t,n,e)}));function At(){let e=b().latest??null,t=b().version??null;return e===null||t===null?null:yt(e,t)?e:null}async function jt(){try{await navigator.clipboard.writeText(J().updatePrompt),Ue(!0),setTimeout(()=>Ue(!1),1500)}catch{}}function Pt(e){M({kind:`unwatch`,name:e})}function Ft(){M({kind:`shutdown`}),_t()}function It(){let e=fe();return e===null?{title:``,body:``,confirm:``}:e.kind===`unwatch`?{title:J().unwatchTitle,body:J().unwatchBody(e.name),confirm:J().unwatch}:{title:J().closeServerTitle,body:J().closeServerBody(b().pid??0,b().connections??0),confirm:J().closeServer}}async function Rt(){let e=fe();if(M(null),e!==null)try{e.kind===`unwatch`?(await rt(e.name),await xt()):(await it(),qt(`closed`))}catch(e){y(e instanceof Error?e.message:String(e))}}D(()=>{let n=new EventSource($e());n.addEventListener(`projects`,e=>{let n=e.data,r=null;try{let e=JSON.parse(n);Array.isArray(e.projects)&&(r=e.projects)}catch{}if(r!==null){t(r),pt(r);let e=i();e!==null&&!r.some(t=>t.name===e)?(a(null),l(null),s([]),h(null),_([]),Q()):xt()}else xt()}),n.addEventListener(`shutdown`,()=>qt(`closed`)),O(()=>n.close());let r=setTimeout(()=>{N()||_t()},4e3),c=setInterval(()=>{N()||_t()},6e4);O(()=>{clearTimeout(r),clearInterval(c)});let u=e=>{let t=e.target;return t?.tagName===`INPUT`||t?.tagName===`TEXTAREA`||t?.isContentEditable===!0},d=e=>{if(!u(e)){if((e.ctrlKey||e.metaKey)&&e.key.toLowerCase()===`k`)i()!==null&&o().length>0&&(e.preventDefault(),me(!0));else{if(e.key===`Escape`){if(R()!==null){z(null),e.preventDefault();return}if(ve()){F(!1),e.preventDefault();return}}e.key===` `&&!e.ctrlKey&&!e.metaKey&&!e.altKey?(Z?.setSpace(!0),e.preventDefault()):Z?.handleKey(e)===!0&&e.preventDefault()}}},f=e=>{e.key===` `&&Z?.setSpace(!1)};window.addEventListener(`keydown`,d),window.addEventListener(`keyup`,f),O(()=>{window.removeEventListener(`keydown`,d),window.removeEventListener(`keyup`,f)});let p=e=>{let t=X;if(t===void 0)return;let n=e.target;if(n===null||!t.contains(n))return;let r=e.deltaY===0?e.deltaX:e.deltaY;if(r===0)return;let i=t.scrollWidth-t.clientWidth;i<=0||(e.preventDefault(),t.scrollLeft=Math.max(0,Math.min(i,t.scrollLeft+r)))};window.addEventListener(`wheel`,p,{passive:!1}),O(()=>window.removeEventListener(`wheel`,p));let m=new URLSearchParams(location.search);(async()=>{await mt();let t=Kr(location.pathname,e()),n=m.get(`project`),r=t??(n!==null&&e().some(e=>e.name===n)?n:null);if(r!==null){await bt(r);let e=m.get(`file`);e?St(e):Q()}})()});let zt,Ht;O(()=>{clearInterval(zt),clearTimeout(Ht)});function Wt(){clearInterval(zt),zt=void 0,Pe(null)}function Kt(){Wt(),clearTimeout(Ht),_e(!1),ze(!1)}function qt(e){N()||(W()===null?(Ie(e),ze(!1),Pe(Wr),clearInterval(zt),zt=setInterval(()=>{let e=(W()??0)-1;e<=0?Jt():Pe(e)},1e3)):e===`closed`&&Ie(`closed`))}async function Jt(){let e=Fe();if(Wt(),e===`idle`)try{await it()}catch{}_e(!0),window.close(),Ht=setTimeout(()=>{N()&&ze(!0)},600)}C(E(()=>e().length,e=>{e>0?(W()!==null||N())&&Kt():q&&qt(`idle`)}));let $=()=>Ge?.contentDocument??null;function Zt(){let e=$();if(!e||e.getElementById(`ptr-style`))return;let t=e.createElement(`style`);t.id=`ptr-style`,t.textContent=Nt,e.head.appendChild(t)}function Qt(){let e=$();if(!e)return;for(let t of e.querySelectorAll(`[data-ptr-selected]`))t.removeAttribute(`data-ptr-selected`);let t=m();t&&e.querySelector(`[data-node-id="${Jr(t)}"]`)?.setAttribute(`data-ptr-selected`,``)}function $t(e){return e.parentElement?.closest(`[data-node-id]`)??null}function en(e){return e.querySelector(`:scope > [data-node-id]`)}function tn(e){if(Z?.consumeDragClick()===!0){e.preventDefault(),e.stopPropagation();return}let t=e.target?.closest(`[data-node-id]`);t?(e.preventDefault(),e.stopPropagation(),hn(e.altKey?$t(t)??t:t)):(h(null),_([]),Qt())}function nn(e,t){let n=$();if(!n)return;let r=m(),i=r===null?null:n.querySelector(`[data-node-id="${Jr(r)}"]`);if(i===null){let e=(n.elementFromPoint(t.x,t.y)?.closest(`[data-node-id]`))?.dataset.nodeId;e!==void 0&&gn(e);return}let a=(e===1?$t(i):en(i))?.dataset.nodeId;a!==void 0&&gn(a)}function rn(e){let t=$();if(t){for(let e of t.querySelectorAll(`[data-ptr-hover]`))e.removeAttribute(`data-ptr-hover`);(e.target?.closest(`[data-node-id]`))?.setAttribute(`data-ptr-hover`,``)}}async function an(){let e=i(),t=c();if(e&&t)try{let n=await at(e,t);if(!n.ok||n.ids.length===0)return;let r=$();if(!r)return;for(let e of n.ids)r.querySelector(`[data-node-id="${Jr(e)}"]`)?.setAttribute(`data-ptr-changed`,``)}catch{}}function on(){let e=$();if(!e)return[];let t=e.querySelector(`.ptr-canvas`)?.getBoundingClientRect(),n=Z?.get().z??1;return Array.from(e.querySelectorAll(`[data-board]`)).map(e=>{let r=e.dataset,i=t===void 0?null:e.getBoundingClientRect(),a=i!==null&&n>0?{x:(i.left-t.left)/n,y:(i.top-t.top)/n,w:i.width/n,h:i.height/n}:null;return{id:r.nodeId??``,...r.boardName===void 0?{}:{name:r.boardName},x:a?.x??Number(r.boardX??0),y:a?.y??Number(r.boardY??0),w:a!==null&&a.w>0?a.w:Number(r.boardW??0),h:a!==null&&a.h>0?a.h:Number(r.boardH??0)}})}function sn(){let e=i(),t=c();return e&&t?`paintress:viewport:${e}/${t}`:null}function cn(e){let t=sn();t!==null&&(clearTimeout(ut),ut=setTimeout(()=>{try{localStorage.setItem(t,JSON.stringify(e))}catch{}},300))}function ln(){let e=$();e&&(yn=!0,Zt(),vn(),Z?.destroy(),Z=Mt({doc:e,onChange:e=>{k(e.z),cn(e)},onLevelStep:nn,onQuickSwitch:()=>me(!0)}),oe(on()),ce(null),un(),e.addEventListener(`click`,tn,!0),e.addEventListener(`mousemove`,rn,!0),Qt(),an())}function un(){if(!Z)return;let e=sn(),t=e===null?null:localStorage.getItem(e),n=t===null?null:kt(t);n===null?Z.fitAll():Z.set(n)}function dn(){let e=i(),t=c(),n=se();e!==null&&t!==null&&n!==null&&(window.location.href=Ze(e,t,n,he()))}function fn(e){if(ce(e),!Z)return;if(e===null){Z.fitAll();return}let t=ae().find(t=>t.id===e);t&&Z.focusBox({x:t.x,y:t.y,w:t.w,h:t.h})}function mn(e){let t=[],n=e;for(;n;){let e=n.closest(`[data-node-id]`);if(!e)break;let r=e;t.unshift({id:r.dataset.nodeId??``,type:r.dataset.nodeType??`?`,name:r.dataset.nodeName}),n=e.parentElement}return t}async function hn(e){let t=e.dataset.nodeId??``;if(t===``)return;let n=mn(e);h(t),_(n),Qt();let r=i();if(r)try{let i=c();await tt({project:r,nodeId:t,...i===null?{}:{file:i},...e.dataset.nodeName===void 0?{}:{name:e.dataset.nodeName},...e.dataset.nodeType===void 0?{}:{type:e.dataset.nodeType},path:n.map(e=>e.name??e.type).join(` / `)}),p((await et(r)).marks),y(null)}catch(e){y(e instanceof Error?e.message:String(e))}}function gn(e){h(e),Qt();let t=$(),n=t?.querySelector(`[data-node-id="${Jr(e)}"]`);if(!n||!t){_([]);return}_(mn(n));let r=t.querySelector(`.ptr-canvas`);if(!r||!Z){n.scrollIntoView({block:`center`});return}let i=n.getBoundingClientRect(),a=r.getBoundingClientRect(),o=Z.get().z;Z.centerOn({x:(i.left-a.left)/o,y:(i.top-a.top)/o,w:i.width/o,h:i.height/o})}async function _n(){let e=i();if(e)try{await nt(e),p([]),h(null),_([]),Qt()}catch(e){y(e instanceof Error?e.message:String(e))}}C(()=>{let e=A();document.documentElement.lang=e===`zh`?`zh-CN`:`en`,Xt(e)});function vn(){if(Y!==void 0){if(c()===null)Y.style.removeProperty(`--canvas-bg`),Y.removeAttribute(`data-canvas-bg`);else{let e=Lt[j()];Y.style.setProperty(`--canvas-bg`,e),Y.setAttribute(`data-canvas-bg`,j())}$()?.documentElement.style.setProperty(`--ptr-canvas-bg`,Lt[j()])}}C(()=>{j(),Vt(j()),vn()});let yn=!1;function bn(e){if(e===``||!yn){ie(e),e===``&&(yn=!1);return}let t=Ge?.contentWindow;if(t==null)ie(e);else try{t.location.replace(e)}catch{ie(e)}}C(E([i,c,T],()=>{let e=i(),t=c();bn(e!==null&&t!==null?`${Xe(e,t)}&r=${T()}`:``),vn()})),C(E([i,c],()=>{be(!1),Se(null),we(null);let e=i(),t=c();e!==null&&t!==null&&Ct(e,t)}));let xn=null;return C(E([i,c,te],()=>{xn?.close(),xn=null;let e=i(),t=c();te()&&e&&t&&(xn=new EventSource(Qe(e,t)),xn.addEventListener(`change`,()=>{ee(e=>e+1),Ct(e,t),R()===`presets`&&wt(e),R()===`components`&&Tt(e);let n=m();R()===`inspect`&&n!==null&&Ot(e,t,n)}))})),O(()=>xn?.close()),(()=>{var t=Or(),r=t.firstChild,a=r.firstChild;a.firstChild.nextSibling;var s=a.nextSibling,l=s.firstChild,d=s.nextSibling,p=d.firstChild,h=p.firstChild,_=p.nextSibling,y=_.nextSibling,x=r.nextSibling,C=x.firstChild,w=C.firstChild,T=w.nextSibling,E=T.firstChild,D=E.firstChild,O=D.nextSibling;return K(a,P(L,{get when(){return b().version},get children(){return P(L,{get when(){return At()},get fallback(){return(()=>{var e=kr();return e.firstChild,K(e,()=>b().version,null),S(()=>U(e,`title`,J().versionTitle)),e})()},get children(){var e=sr(),t=e.firstChild;t.firstChild;var n=t.nextSibling;return n.firstChild,e.$$click=()=>Ve(!0),K(t,()=>b().version,null),K(n,At,null),S(()=>U(e,`title`,J().updateTitle)),e}})}}),null),K(a,P(L,{get when(){return u()},children:e=>(()=>{var t=Ar();return K(t,()=>J().fontBadge(e().checked.length-e().missing.length,e().checked.length)),S(n=>{var r=e().missing.length>0,i=e().missing.length>0?J().fontMissing(e().missing.join(`、`)):J().fontTitle(e().checked.length);return r!==n.e&&t.classList.toggle(`badge-warn`,n.e=r),i!==n.t&&U(t,`title`,n.t=i),n},{e:void 0,t:void 0}),t})()}),null),K(l,()=>J().projects),K(s,P(L,{get when(){return n().length>0},get fallback(){return(()=>{var e=jr(),t=e.firstChild;return K(e,()=>J().waitingForAgent,t),e})()},get children(){var e=cr();return K(e,P(I,{get each(){return n()},children:e=>(()=>{var t=Mr(),n=t.firstChild,r=n.firstChild,a=r.nextSibling,o=n.nextSibling;return n.$$click=()=>void bt(e.name),K(r,()=>e.label??e.name),K(a,()=>J().projectFiles(e.fileCount),null),K(a,(()=>{var t=B(()=>e.agentConns>0);return()=>t()?(()=>{var e=Nr();return S(()=>U(e,`title`,J().agentOnline)),e})():null})(),null),o.$$click=()=>Pt(e.name),S(r=>{var a=e.leaving===!0,s=i()===e.name,c=J().unwatch,l=`${J().unwatch} ${e.name}`;return a!==r.e&&t.classList.toggle(`leaving`,r.e=a),s!==r.t&&n.classList.toggle(`active`,r.t=s),c!==r.a&&U(o,`title`,r.a=c),l!==r.o&&U(o,`aria-label`,r.o=l),r},{e:void 0,t:void 0,a:void 0,o:void 0}),t})()})),e}}),null),K(r,P(L,{get when(){return i()},get children(){var t=lr(),n=t.firstChild,r=n.firstChild,a=r.nextSibling,s=a.firstChild;return K(n,()=>J().designs,r),K(a,()=>J().depth,s),K(a,()=>e().find(e=>e.name===i())?.depth??`-`,null),K(t,P(L,{get when(){return o().length>0},get fallback(){return(()=>{var e=Pr();return K(e,()=>J().noFiles),e})()},get children(){var e=cr();return K(e,P(I,{get each(){return o()},children:e=>(()=>{var t=Fr(),n=t.firstChild,r=n.firstChild;return n.$$click=()=>St(e),K(r,e),S(()=>n.classList.toggle(`active`,c()===e)),t})()})),e}}),null),t}}),d),K(r,P(L,{get when(){return f().length>0},get children(){var e=ur(),t=e.firstChild,n=t.firstChild,r=t.nextSibling;return K(t,()=>J().marks,n),n.$$click=()=>void _n(),K(n,()=>J().clear),K(r,P(I,{get each(){return f()},children:e=>(()=>{var t=Ir(),n=t.firstChild,r=n.firstChild,i=r.firstChild;i.firstChild,i.nextSibling;var a=r.nextSibling;return n.$$click=()=>{e.file!==void 0&&e.file!==c()?St(e.file):gn(e.nodeId)},K(i,()=>e.shortId,null),K(r,()=>e.name??e.nodeId,null),K(a,(()=>{var t=B(()=>e.file!==void 0&&e.file!==c());return()=>t()?`${e.file} · `:``})(),null),K(a,()=>e.path,null),S(()=>n.classList.toggle(`active`,m()===e.nodeId)),t})()})),e}}),d),h.addEventListener(`change`,e=>ne(e.currentTarget.checked)),K(p,()=>J().liveReload,null),_.$$click=()=>void mt(),K(_,()=>J().refreshList),y.$$click=()=>Ft(),K(y,()=>J().closeServer),K(d,P(L,{get when(){return b().pid},get children(){var e=dr();return e.firstChild,K(e,()=>b().pid,null),e}}),null),G(e=>{Y=e},x),K(x,P(L,{get when(){return v()},get children(){var e=fr();return K(e,v),e}}),C),K(w,P(L,{get when(){return g().length===0},get fallback(){return P(I,{get each(){return g()},children:(e,t)=>[P(L,{get when(){return t()>0},get children(){return mr()}}),(()=>{var t=Lr();return t.$$click=()=>gn(e.id),K(t,()=>e.name??e.type),S(()=>t.classList.toggle(`active`,m()===e.id)),t})()]})},get children(){return P(L,{get when(){return B(()=>i()!==null)()&&c()!==null},get children(){return[(()=>{var t=pr();return K(t,()=>e().find(e=>e.name===i())?.label??i()),t})(),mr(),(()=>{var e=pr();return K(e,c),e})()]}})}})),K(T,P(L,{get when(){return B(()=>i()!==null)()&&c()!==null},get children(){return[(()=>{var e=hr();return e.$$click=()=>me(!0),K(e,()=>J().quickSwitch),S(()=>U(e,`title`,`${J().quickSwitch}(Ctrl/Cmd+K)`)),e})(),(()=>{var e=gr(),t=e.firstChild;return K(e,()=>Math.round(le()*100),t),e})(),(()=>{var e=_r();return e.$$click=()=>Z?.fitAll(),K(e,()=>J().fit),S(()=>U(e,`title`,J().fitTitle)),e})(),(()=>{var e=_r();return e.$$click=()=>Z?.zoomToPercent(1),K(e,()=>J().actualSize),S(()=>U(e,`title`,J().actualSizeTitle)),e})(),(()=>{var e=vr();return e.$$click=()=>ee(e=>e+1),K(e,()=>J().rerender),e})(),yr()]}}),E),K(T,P(Ut,{get value(){return j()},onChange:de,get label(){return J().canvasBackground}}),E),D.$$click=()=>ue(`zh`),O.$$click=()=>ue(`en`),K(x,P(L,{get when(){return B(()=>i()!==null)()&&c()!==null},get fallback(){return(()=>{var e=zr();return K(e,P(L,{get when(){return i()},get fallback(){return(()=>{var e=Rr();return K(e,()=>J().pickProject),e})()},get children(){var e=Rr();return K(e,()=>J().pickFile),e}})),e})()},get children(){return[P(L,{get when(){return ae().length>1},get children(){var e=xr(),t=e.firstChild,n=t.nextSibling;return t.$$click=()=>fn(null),K(t,()=>J().allBoards),G(e=>{X=e},n),K(n,P(I,{get each(){return ae()},children:e=>(()=>{var t=Br(),n=t.firstChild,r=n.nextSibling,i=r.firstChild;return t.$$click=()=>fn(e.id),G(e=>queueMicrotask(()=>dt(e)),n),K(n,()=>e.name??`#${e.id}`),K(r,()=>Math.round(e.w),i),K(r,()=>Math.round(e.h),null),S(()=>t.classList.toggle(`active`,se()===e.id)),t})()})),K(e,P(L,{get when(){return se()!==null},get children(){var e=br(),t=e.firstChild,n=t.nextSibling,r=n.nextSibling;return K(t,()=>J().exportScale),n.addEventListener(`change`,e=>{let t=Number(e.currentTarget.value);ge(t),Ur(t)}),r.$$click=()=>dn(),K(r,()=>J().exportFrame),S(()=>U(n,`aria-label`,J().exportScale)),S(()=>n.value=String(he())),e}}),null),S(()=>t.classList.toggle(`active`,se()===null)),e}}),(()=>{var e=Cr(),t=e.firstChild,n=t.firstChild;return K(e,P(L,{get when(){return ve()},get children(){return P(pn,{get title(){return J().notesTitle},get closeLabel(){return J().closePanel},get markdown(){return xe()},get error(){return Ce()},onClose:()=>F(!1)})}}),t),n.addEventListener(`load`,ln),G(e=>{Ge=e},n),K(t,P(L,{get when(){return B(()=>!!ye())()&&!ve()},get children(){var e=Sr();return e.firstChild,e.$$click=()=>F(!0),K(e,()=>J().notes,null),S(()=>U(e,`title`,J().notesTitle)),e}}),null),K(t,P(Bn,{get items(){return We()},get active(){return R()},onToggle:Dt,get label(){return J().canvasTools}}),null),K(t,P(L,{get when(){return R()===`presets`},get children(){return P(Tn,{get items(){return Ae()},get groups(){return V()},get labels(){return{title:J().presets,close:J().closePanel,empty:J().presetEmpty,hint:J().presetHint,color:J().presetColor,radius:J().presetRadius,spacing:J().presetSpacing,fontSize:J().presetFontSize,font:J().presetFont,groups:J().presetGroups,groupsEmpty:J().presetGroupsEmpty}},onClose:()=>z(null),onSet:(e,t)=>void Et(e,t)})}}),null),K(t,P(L,{get when(){return R()===`inspect`},get children(){return P($n,{get node(){return Te()},get vars(){return De()},get labels(){return{title:J().inspector,close:J().closePanel,empty:J().inspectorEmpty,groups:J().inspectorGroups,descendants:J().inspectorDescendants}},onClose:()=>{ke=!0,z(null)}})}}),null),K(t,P(L,{get when(){return R()===`components`},get children(){return P(jn,{get items(){return Me()},get project(){return i()??``},get labels(){return{title:J().components,close:J().closePanel,empty:J().componentsEmpty,hint:J().componentsHint,count:J().componentsCount}},onClose:()=>z(null)})}}),null),S(()=>U(n,`src`,re())),e})()]}}),null),K(t,P(or,{get open(){return pe()},get files(){return o()},get current(){return c()},get labels(){return{title:J().quickSwitch,placeholder:J().quickSwitchPlaceholder,empty:J().quickSwitchEmpty,hint:J().quickSwitchHint}},onPick:e=>{me(!1),St(e)},onClose:()=>me(!1)}),null),K(t,P(gt,{get open(){return fe()!==null},get title(){return It().title},get body(){return It().body},get confirmLabel(){return It().confirm},get cancelLabel(){return J().cancel},onConfirm:()=>void Rt(),onCancel:()=>M(null)}),null),K(t,P(L,{get when(){return N()},get children(){var e=wr(),t=e.firstChild.firstChild,n=t.nextSibling;return K(t,()=>J().serverClosed),K(n,(()=>{var e=B(()=>!!Re());return()=>e()?J().closeBlockedHint:J().serverClosedHint})()),e}}),null),K(t,P(L,{get when(){return B(()=>W()!==null)()&&!N()},get children(){var e=Tr(),t=e.firstChild,n=t.firstChild,r=n.firstChild,i=r.firstChild.nextSibling,a=r.nextSibling,o=n.nextSibling,s=o.nextSibling,c=s.nextSibling;return K(a,()=>W()??0),K(o,(()=>{var e=B(()=>Fe()===`closed`);return()=>e()?J().serverClosed:J().noActiveProjects})()),K(s,(()=>{var e=B(()=>Fe()===`closed`);return()=>e()?J().closingAuto:J().closingWaitAgent})()),K(c,()=>J().closingIn(W()??0)),S(e=>{var n=(W()??0)<=3,r=(Gr*(1-(W()??0)/Wr)).toFixed(1);return n!==e.e&&t.classList.toggle(`urgent`,e.e=n),r!==e.t&&Le(i,`stroke-dashoffset`,e.t=r),e},{e:void 0,t:void 0}),e}}),null),K(t,P(ht,{get open(){return Be()},get title(){return J().updateTitle},onClose:()=>Ve(!1),get actions(){return[(()=>{var e=Vr();return K(e,()=>J().updateRepo),e})(),(()=>{var e=vr();return e.$$click=()=>Ve(!1),K(e,()=>J().close),e})()]},get children(){return[(()=>{var e=Er();return K(e,()=>J().updateAvailable(At()??``,b().version??``)),e})(),(()=>{var e=Dr();return K(e,()=>J().updatePrompt),e})(),(()=>{var e=_r();return e.$$click=()=>void jt(),K(e,(()=>{var e=B(()=>!!He());return()=>e()?J().copied:J().copy})()),e})(),(()=>{var e=Er();return K(e,()=>J().updateSteps),e})()]}}),null),S(e=>{var t=J().language,n=J().language,r=A()===`zh`,i=A()===`zh`,a=A()===`en`,o=A()===`en`;return t!==e.e&&U(E,`aria-label`,e.e=t),n!==e.t&&U(E,`title`,e.t=n),r!==e.a&&D.classList.toggle(`active`,e.a=r),i!==e.o&&U(D,`aria-pressed`,e.o=i),a!==e.i&&O.classList.toggle(`active`,e.i=a),o!==e.n&&U(O,`aria-pressed`,e.n=o),e},{e:void 0,t:void 0,a:void 0,o:void 0,i:void 0,n:void 0}),S(()=>h.checked=te()),t})()}H([`click`]);var Xr=document.getElementById(`root`);if(!Xr)throw Error(`缺少 #root 容器`);je(()=>P(Yr,{}),Xr);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
:root{--bg:#f6f1ea;--panel:#fffcf8;--border:#e6ded2;--text:#1f2a37;--muted:#7a7166;--accent:#205080;--accent-soft:#20508014;--gold:#908030;--gold-soft:#90803073;--radius:8px}*{box-sizing:border-box;margin:0;padding:0}html,body,#root{height:100%}body{color:var(--text);background:var(--bg);-webkit-font-smoothing:antialiased;font:14px/1.55 system-ui,-apple-system,Segoe UI,Noto Sans SC,sans-serif}.app{grid-template-columns:280px 1fr;height:100%;display:grid}.sidebar{background:var(--panel);border-right:1px solid var(--border);flex-direction:column;min-height:0;display:flex}.sidebar-head{border-bottom:1px solid var(--border);align-items:center;gap:8px;padding:16px 16px 12px;display:flex}.sidebar-head h1{letter-spacing:-.01em;color:var(--accent);font-size:15px;font-weight:650}.badge{color:var(--muted);background:var(--bg);border-radius:999px;padding:1px 6px;font-size:11px}.badge-stack{font:inherit;cursor:pointer;border:1px solid #0000;flex-direction:column;align-items:flex-start;gap:1px;font-size:11px;line-height:1.2;display:inline-flex}.badge-stack:hover{border-color:#b4402a59}.badge-new{color:#b4402a;font-weight:700}.prompt{background:var(--bg);border:1px solid var(--border);font:inherit;white-space:pre-wrap;word-break:break-word;-webkit-user-select:all;user-select:all;border-radius:6px;margin:10px 0 8px;padding:8px 10px;font-size:12px;line-height:1.6}a.ghost{text-decoration:none;display:inline-block}.section{min-height:0;padding:12px 8px 4px;overflow-y:auto}.section.files{border-top:1px solid var(--border);flex:1;padding-top:12px}.section h2{text-transform:uppercase;letter-spacing:.06em;color:var(--muted);justify-content:space-between;gap:8px;padding:0 8px 8px;font-size:11px;font-weight:600;display:flex}.hint{color:var(--muted);text-transform:none;letter-spacing:0;font-size:11px;font-weight:400}.list{list-style:none}.item{text-align:left;cursor:pointer;width:100%;font:inherit;color:inherit;background:0 0;border:0;border-radius:6px;flex-direction:column;gap:1px;padding:7px 8px;display:flex}.item:hover{background:var(--bg)}.item.active{background:var(--accent-soft);color:var(--accent)}.item-name{text-overflow:ellipsis;white-space:nowrap;font-size:13px;overflow:hidden}.item-meta{color:var(--muted);font-size:11px}.item.active .item-meta{color:var(--accent);opacity:.75}.empty{color:var(--muted);padding:4px 8px 12px;font-size:12px;line-height:1.7}.empty code{background:var(--bg);border:1px solid var(--border);border-radius:4px;padding:1px 5px;font-size:11px}.sidebar-foot{border-top:1px solid var(--border);color:var(--muted);flex-wrap:wrap;align-items:center;gap:8px;padding:10px 16px;font-size:12px;display:flex}.toggle{cursor:pointer;align-items:center;gap:5px;display:inline-flex}.ghost{background:var(--bg);border:1px solid var(--border);font:inherit;color:var(--text);cursor:pointer;border-radius:6px;padding:3px 9px;font-size:12px}.ghost:hover{border-color:var(--accent);color:var(--accent)}.stage{background:var(--canvas-bg,var(--bg));flex-direction:column;min-width:0;min-height:0;display:flex}.toolbar{border-bottom:1px solid var(--border);background:var(--panel);justify-content:space-between;align-items:center;gap:12px;padding:8px 14px;display:flex}.toolbar code{color:var(--muted);text-overflow:ellipsis;white-space:nowrap;font-size:12px;overflow:hidden}.preview{border:1px solid var(--border);background:var(--canvas-bg,#fff);border-radius:10px;flex:1;width:calc(100% - 24px);min-height:0;margin:12px;box-shadow:0 1px 2px #1f2a370d,0 8px 24px #1f2a370d}.stage[data-canvas-bg=dark] .preview{border-color:#ffffff1f;box-shadow:0 1px 2px #00000059,0 10px 30px #00000052}.placeholder{color:var(--muted);flex:1;place-items:center;display:grid}.error{border-radius:var(--radius);color:#b91c1c;white-space:pre-wrap;background:#fef2f2;border:1px solid #fecaca;margin:12px;padding:10px 12px;font-size:12px}.section.marks{border-top:1px solid var(--border);flex:0 auto;max-height:34vh}.mark-no{background:var(--accent-soft);min-width:20px;color:var(--accent);font-variant-numeric:tabular-nums;border-radius:4px;margin-right:4px;padding:0 4px;font-size:11px;display:inline-block}.item.active .mark-no{background:#fff}.ghost.tiny{text-transform:none;letter-spacing:0;padding:1px 6px;font-size:11px}.crumbs{flex-wrap:wrap;align-items:center;gap:3px;min-width:0;display:flex;overflow:hidden}.crumbs code{color:var(--muted);text-overflow:ellipsis;white-space:nowrap;font-size:12px;overflow:hidden}.crumb{font:inherit;color:var(--muted);cursor:pointer;text-overflow:ellipsis;white-space:nowrap;background:0 0;border:0;border-radius:4px;max-width:220px;padding:2px 5px;font-size:12px;overflow:hidden}.crumb:hover{background:var(--bg);color:var(--text)}.crumb.active{color:var(--accent);background:var(--accent-soft)}.sep{color:var(--border);font-size:11px}.brand-mark{flex:none;width:auto;height:32px}.canvas-bg{border:1px solid var(--border);background:var(--bg);-webkit-user-select:none;user-select:none;border-radius:6px;flex:none;align-items:stretch;display:inline-flex;overflow:hidden}.canvas-bg-opt{border:0;border-left:1px solid var(--border);font:inherit;color:var(--muted);cursor:pointer;background:0 0;align-items:center;gap:5px;padding:3px 8px;font-size:11px;line-height:16px;display:inline-flex}.canvas-bg-opt:first-child{border-left:0}.canvas-bg-opt:hover{color:var(--text);background:#2050800f}.canvas-bg-opt.active{background:var(--accent-soft);color:var(--accent);font-weight:600}.canvas-bg-opt:focus-visible{outline:2px solid var(--accent);outline-offset:-2px}.canvas-bg-dot{background:var(--dot,#fff);border-radius:50%;flex:none;width:9px;height:9px;box-shadow:0 0 0 1px #1f2a3733}.lang-switch{border:1px solid var(--border);background:var(--bg);border-radius:6px;flex:none;align-items:stretch;margin-left:4px;display:inline-flex;overflow:hidden}.lang-opt{border:0;border-left:1px solid var(--border);font:inherit;color:var(--muted);cursor:pointer;background:0 0;padding:3px 8px;font-size:11px;line-height:16px}.lang-opt:first-child{border-left:0}.lang-opt:hover{color:var(--text);background:#2050800f}.lang-opt.active{background:var(--accent-soft);color:var(--accent);font-weight:600}.tool-sep{background:var(--border);flex:none;width:1px;height:18px;margin:0 2px}.tools{flex:none;align-items:center;gap:6px;display:flex}.zoom{font-variant-numeric:tabular-nums;text-align:right;min-width:40px}.boardbar{border-bottom:1px solid var(--border);background:var(--panel);align-items:center;gap:6px;padding:6px 14px;display:flex}.boardbar-scroll{scrollbar-width:thin;flex:auto;align-items:center;gap:6px;min-width:0;padding:1px 1px 2px;display:flex;overflow:auto hidden}.board{background:var(--bg);border:1px solid var(--border);max-width:220px;font:inherit;color:var(--text);cursor:pointer;border-radius:6px;flex:none;align-items:baseline;gap:6px;padding:3px 9px;font-size:12px;display:inline-flex}.board-name{white-space:nowrap;flex:0 auto;max-width:132px;overflow:hidden}.board-name.overflow{-webkit-mask-image:linear-gradient(90deg,#000 calc(100% - 10px),#0000);mask-image:linear-gradient(90deg,#000 calc(100% - 10px),#0000)}.boardbar{scrollbar-width:thin;scroll-padding-left:48px}.boardbar>.board:first-child{z-index:1;background:var(--bg);position:sticky;left:0;box-shadow:6px 0 8px -6px #1f2a372e}.boardbar>.board:first-child.active{background:var(--accent-soft)}.board:hover{border-color:var(--accent);color:var(--accent)}.board.active{background:var(--accent-soft);border-color:var(--accent);color:var(--accent)}.board-size{color:var(--muted);font-variant-numeric:tabular-nums;font-size:10px}.board.active .board-size{color:var(--accent);opacity:.75}.row{align-items:center;display:flex;position:relative}.row .item{flex:1;min-width:0}.row-action{background:var(--panel);width:20px;height:20px;color:var(--muted);font:inherit;cursor:pointer;opacity:0;border:1px solid #0000;border-radius:5px;place-items:center;padding:0;font-size:13px;line-height:1;transition:opacity .12s;display:grid;position:absolute;top:50%;right:4px;transform:translateY(-50%)}.row:hover .row-action,.row-action:focus-visible{opacity:1}.row-action:hover{color:#a33;border-color:#aa333359}@media (hover:none){.row-action{opacity:1}}.modal-backdrop{z-index:50;background:#1f2a3747;place-items:center;display:grid;position:fixed;inset:0}.modal{background:var(--panel);border:1px solid var(--border);border-radius:10px;width:min(380px,100vw - 32px);padding:16px 18px 14px;box-shadow:0 12px 40px #1f2a372e}.modal h3{color:var(--accent);margin-bottom:6px;font-size:14px;font-weight:650}.modal-body{color:var(--muted);font-size:12.5px;line-height:1.65}.modal-actions{justify-content:flex-end;gap:8px;margin-top:14px;display:flex}.ghost.danger{color:#a33}.ghost.danger:hover,.ghost.danger:focus-visible{color:#a33;background:#aa33330f;border-color:#a33}.row{animation:.22s cubic-bezier(.22,.61,.36,1) both row-in}.row.leaving{pointer-events:none;animation:.24s cubic-bezier(.4,0,1,1) both row-out;overflow:hidden}@keyframes row-in{0%{opacity:0;transform:translateY(-4px)}to{opacity:1;transform:none}}@keyframes row-out{0%{opacity:1;max-height:60px}to{opacity:0;max-height:0;transform:translate(-6px)}}@media (prefers-reduced-motion:reduce){.row,.row.leaving{animation:none}}.dot{vertical-align:middle;background:#4c9a6a;border-radius:50%;width:5px;height:5px;margin-left:6px;display:inline-block}.countdown-backdrop{-webkit-backdrop-filter:blur(1.5px);backdrop-filter:blur(1.5px);background:#1f2a376b}.countdown{text-align:center;width:min(320px,100vw - 32px);padding:20px 20px 18px}.countdown h3{letter-spacing:.02em;font-size:13px}.countdown .modal-body{font-variant-numeric:tabular-nums;margin-top:2px}.countdown-track{background:var(--border);border-radius:999px;height:3px;margin-top:14px;overflow:hidden}.countdown-fill{height:100%;width:var(--left,100%);background:var(--accent);border-radius:inherit;transition:width 1s linear;display:block}.canvas-row{flex:1;align-items:stretch;gap:12px;min-width:0;min-height:0;padding:12px;display:flex}.canvas-wrap{flex:1;min-width:0;min-height:0;display:flex;position:relative}.canvas-wrap .preview{width:100%;height:100%;min-height:0;margin:0}.panel{background:var(--panel);border:1px solid var(--border);border-radius:10px;flex-direction:column;min-height:0;display:flex;box-shadow:0 1px 2px #1f2a370d,0 8px 24px #1f2a370d}.notes-panel{flex:0 0 380px;width:380px}.panel-float{z-index:3;width:320px;max-height:100%;animation:.14s ease-out panel-in;position:absolute;top:0;right:60px}.preset-panel{width:320px}.components-panel{width:420px;max-width:calc(100vw - 360px)}@keyframes panel-in{0%{opacity:0;transform:translate(8px)}to{opacity:1;transform:translate(0)}}@media (prefers-reduced-motion:reduce){.panel-float{animation:none}}.panel-head{border-bottom:1px solid var(--border);justify-content:space-between;align-items:center;gap:8px;padding:8px 10px 8px 14px;display:flex}.panel-head h2{font-size:13px;font-weight:600}.panel-close{line-height:1}.panel-body{scrollbar-width:thin;flex:1;min-height:0;padding:12px 14px 16px;overflow:auto}.panel-empty{color:var(--muted);font-size:12px}.panel-hint{color:var(--muted);margin-top:6px;font-size:12px}.panel-error{color:#b91c1c;white-space:pre-wrap;font-size:12px}.panel-group{letter-spacing:.04em;text-transform:uppercase;color:var(--muted);margin:10px 0 6px;font-size:11px;font-weight:600}.panel-group:first-child{margin-top:0}.markdown{overflow-wrap:anywhere;font-size:13px;line-height:1.7}.markdown>*+*{margin-top:.7em}.markdown h1,.markdown h2,.markdown h3,.markdown h4{margin-top:1.1em;line-height:1.35}.markdown h1{font-size:17px}.markdown h2{font-size:15px}.markdown h3{font-size:13.5px}.markdown ul,.markdown ol{padding-left:1.3em}.markdown code{background:var(--bg);border:1px solid var(--border);border-radius:4px;padding:0 4px;font-size:12px}.markdown pre{background:var(--bg);border:1px solid var(--border);border-radius:8px;padding:10px 12px;overflow:auto}.markdown pre code{background:0 0;border:0;padding:0}.markdown blockquote{border-left:2px solid var(--border);color:var(--muted);padding-left:10px}.markdown table{border-collapse:collapse;font-size:12px}.markdown th,.markdown td{border:1px solid var(--border);text-align:left;padding:3px 8px}.markdown a{color:var(--accent)}.markdown img{max-width:100%}.notes-toggle{z-index:3;border:1px solid var(--border);background:var(--panel);color:var(--text);font:inherit;cursor:pointer;border-radius:8px;align-items:center;gap:6px;padding:5px 10px;font-size:12px;display:inline-flex;position:absolute;top:10px;left:10px;box-shadow:0 1px 2px #1f2a3714}.notes-toggle:hover{border-color:var(--accent);color:var(--accent)}.tool-rail{z-index:4;border:1px solid var(--border);background:var(--panel);border-radius:10px;flex-direction:column;gap:4px;padding:4px;display:flex;position:absolute;top:10px;right:10px;box-shadow:0 1px 2px #1f2a3714}.rail-btn{width:34px;height:34px;color:var(--muted);cursor:pointer;background:0 0;border:0;border-radius:7px;place-items:center;display:grid}.rail-btn:hover,.rail-btn.active{background:var(--accent-soft);color:var(--accent)}.rail-btn:focus-visible{outline:2px solid var(--accent);outline-offset:1px}.preset-list{flex-direction:column;gap:6px;list-style:none;display:flex}.preset-row{align-items:center;gap:8px;display:flex}.preset-name{text-overflow:ellipsis;white-space:nowrap;flex:1;min-width:0;font-size:12px;overflow:hidden}.preset-swatch{border:1px solid var(--border);cursor:pointer;background:0 0;border-radius:5px;flex:none;width:26px;height:22px;padding:0}.preset-value{border:1px solid var(--border);background:var(--bg);width:92px;color:var(--text);font:inherit;font-variant-numeric:tabular-nums;border-radius:5px;flex:none;padding:2px 6px;font-size:12px}.preset-value:focus,.preset-swatch:focus{outline:2px solid var(--accent);outline-offset:1px}.tiles{flex-wrap:wrap;gap:10px;margin-top:10px;display:flex}.tile{flex-direction:column;gap:4px;width:148px;display:flex}.tile-frame{border:1px solid var(--border);background:var(--bg);border-radius:10px;width:148px;height:148px;position:relative;overflow:hidden}.tile-frame iframe{transform-origin:50%;background:0 0;border:0;position:absolute;top:50%;left:50%}.tile figcaption{color:var(--muted);text-overflow:ellipsis;white-space:nowrap;font-size:11px;overflow:hidden}
|
|
1
|
+
:root{--bg:#f6f1ea;--panel:#fffcf8;--border:#e6ded2;--text:#1f2a37;--muted:#7a7166;--accent:#205080;--accent-soft:#20508014;--gold:#908030;--gold-soft:#90803073;--radius:8px}*{box-sizing:border-box;margin:0;padding:0}html,body,#root{height:100%}body{color:var(--text);background:var(--bg);-webkit-font-smoothing:antialiased;font:14px/1.55 system-ui,-apple-system,Segoe UI,Noto Sans SC,sans-serif}.app{grid-template-columns:280px 1fr;height:100%;display:grid}.sidebar{background:var(--panel);border-right:1px solid var(--border);flex-direction:column;min-height:0;display:flex}.sidebar-head{border-bottom:1px solid var(--border);align-items:center;gap:8px;padding:16px 16px 12px;display:flex}.sidebar-head h1{letter-spacing:-.01em;color:var(--accent);font-size:15px;font-weight:650}.badge{color:var(--muted);background:var(--bg);border-radius:999px;padding:1px 6px;font-size:11px}.badge-stack{font:inherit;cursor:pointer;border:1px solid #0000;flex-direction:column;align-items:flex-start;gap:1px;font-size:11px;line-height:1.2;display:inline-flex}.badge-stack:hover{border-color:#b4402a59}.badge-new{color:#b4402a;font-weight:700}.prompt{background:var(--bg);border:1px solid var(--border);font:inherit;white-space:pre-wrap;word-break:break-word;-webkit-user-select:all;user-select:all;border-radius:6px;margin:10px 0 8px;padding:8px 10px;font-size:12px;line-height:1.6}a.ghost{text-decoration:none;display:inline-block}.section{min-height:0;padding:12px 8px 4px;overflow-y:auto}.section.files{border-top:1px solid var(--border);flex:1;padding-top:12px}.section h2{text-transform:uppercase;letter-spacing:.06em;color:var(--muted);justify-content:space-between;gap:8px;padding:0 8px 8px;font-size:11px;font-weight:600;display:flex}.hint{color:var(--muted);text-transform:none;letter-spacing:0;font-size:11px;font-weight:400}.list{list-style:none}.item{text-align:left;cursor:pointer;width:100%;font:inherit;color:inherit;background:0 0;border:0;border-radius:6px;flex-direction:column;gap:1px;padding:7px 8px;display:flex}.item:hover{background:var(--bg)}.item.active{background:var(--accent-soft);color:var(--accent)}.item-name{text-overflow:ellipsis;white-space:nowrap;font-size:13px;overflow:hidden}.item-meta{color:var(--muted);font-size:11px}.item.active .item-meta{color:var(--accent);opacity:.75}.empty{color:var(--muted);padding:4px 8px 12px;font-size:12px;line-height:1.7}.empty code{background:var(--bg);border:1px solid var(--border);border-radius:4px;padding:1px 5px;font-size:11px}.sidebar-foot{border-top:1px solid var(--border);color:var(--muted);flex-wrap:wrap;align-items:center;gap:8px;padding:10px 16px;font-size:12px;display:flex}.toggle{cursor:pointer;align-items:center;gap:5px;display:inline-flex}.ghost{background:var(--bg);border:1px solid var(--border);font:inherit;color:var(--text);cursor:pointer;border-radius:6px;padding:3px 9px;font-size:12px}.ghost:hover{border-color:var(--accent);color:var(--accent)}.stage{background:var(--canvas-bg,var(--bg));flex-direction:column;min-width:0;min-height:0;display:flex}.toolbar{border-bottom:1px solid var(--border);background:var(--panel);justify-content:space-between;align-items:center;gap:12px;padding:8px 14px;display:flex}.toolbar code{color:var(--muted);text-overflow:ellipsis;white-space:nowrap;font-size:12px;overflow:hidden}.preview{border:1px solid var(--border);background:var(--canvas-bg,#fff);border-radius:10px;flex:1;width:calc(100% - 24px);min-height:0;margin:12px;box-shadow:0 1px 2px #1f2a370d,0 8px 24px #1f2a370d}.stage[data-canvas-bg=dark] .preview{border-color:#ffffff1f;box-shadow:0 1px 2px #00000059,0 10px 30px #00000052}.placeholder{color:var(--muted);flex:1;place-items:center;display:grid}.error{border-radius:var(--radius);color:#b91c1c;white-space:pre-wrap;background:#fef2f2;border:1px solid #fecaca;margin:12px;padding:10px 12px;font-size:12px}.section.marks{border-top:1px solid var(--border);flex:0 auto;max-height:34vh}.mark-no{background:var(--accent-soft);min-width:20px;color:var(--accent);font-variant-numeric:tabular-nums;border-radius:4px;margin-right:4px;padding:0 4px;font-size:11px;display:inline-block}.item.active .mark-no{background:#fff}.ghost.tiny{text-transform:none;letter-spacing:0;padding:1px 6px;font-size:11px}.crumbs{flex-wrap:wrap;align-items:center;gap:3px;min-width:0;display:flex;overflow:hidden}.crumbs code{color:var(--muted);text-overflow:ellipsis;white-space:nowrap;font-size:12px;overflow:hidden}.crumb{font:inherit;color:var(--muted);cursor:pointer;text-overflow:ellipsis;white-space:nowrap;background:0 0;border:0;border-radius:4px;max-width:220px;padding:2px 5px;font-size:12px;overflow:hidden}.crumb:hover{background:var(--bg);color:var(--text)}.crumb.active{color:var(--accent);background:var(--accent-soft)}.sep{color:var(--border);font-size:11px}.brand-mark{flex:none;width:auto;height:32px}.canvas-bg{border:1px solid var(--border);background:var(--bg);-webkit-user-select:none;user-select:none;border-radius:6px;flex:none;align-items:stretch;display:inline-flex;overflow:hidden}.canvas-bg-opt{border:0;border-left:1px solid var(--border);font:inherit;color:var(--muted);cursor:pointer;background:0 0;align-items:center;gap:5px;padding:3px 8px;font-size:11px;line-height:16px;display:inline-flex}.canvas-bg-opt:first-child{border-left:0}.canvas-bg-opt:hover{color:var(--text);background:#2050800f}.canvas-bg-opt.active{background:var(--accent-soft);color:var(--accent);font-weight:600}.canvas-bg-opt:focus-visible{outline:2px solid var(--accent);outline-offset:-2px}.canvas-bg-dot{background:var(--dot,#fff);border-radius:50%;flex:none;width:9px;height:9px;box-shadow:0 0 0 1px #1f2a3733}.lang-switch{border:1px solid var(--border);background:var(--bg);border-radius:6px;flex:none;align-items:stretch;margin-left:4px;display:inline-flex;overflow:hidden}.lang-opt{border:0;border-left:1px solid var(--border);font:inherit;color:var(--muted);cursor:pointer;background:0 0;padding:3px 8px;font-size:11px;line-height:16px}.lang-opt:first-child{border-left:0}.lang-opt:hover{color:var(--text);background:#2050800f}.lang-opt.active{background:var(--accent-soft);color:var(--accent);font-weight:600}.tool-sep{background:var(--border);flex:none;width:1px;height:18px;margin:0 2px}.tools{flex:none;align-items:center;gap:6px;display:flex}.zoom{font-variant-numeric:tabular-nums;text-align:right;min-width:40px}.boardbar{border-bottom:1px solid var(--border);background:var(--panel);align-items:center;gap:6px;padding:6px 14px;display:flex}.boardbar-scroll{scrollbar-width:thin;flex:auto;align-items:center;gap:6px;min-width:0;padding:1px 1px 2px;display:flex;overflow:auto hidden}.board{background:var(--bg);border:1px solid var(--border);max-width:220px;font:inherit;color:var(--text);cursor:pointer;border-radius:6px;flex:none;align-items:baseline;gap:6px;padding:3px 9px;font-size:12px;display:inline-flex}.board-name{white-space:nowrap;flex:0 auto;max-width:132px;overflow:hidden}.board-name.overflow{-webkit-mask-image:linear-gradient(90deg,#000 calc(100% - 10px),#0000);mask-image:linear-gradient(90deg,#000 calc(100% - 10px),#0000)}.boardbar{scrollbar-width:thin;scroll-padding-left:48px}.boardbar>.board:first-child{z-index:1;background:var(--bg);position:sticky;left:0;box-shadow:6px 0 8px -6px #1f2a372e}.boardbar>.board:first-child.active{background:var(--accent-soft)}.board:hover{border-color:var(--accent);color:var(--accent)}.board.active{background:var(--accent-soft);border-color:var(--accent);color:var(--accent)}.board-size{color:var(--muted);font-variant-numeric:tabular-nums;font-size:10px}.board.active .board-size{color:var(--accent);opacity:.75}.row{align-items:center;display:flex;position:relative}.row .item{flex:1;min-width:0}.row-action{background:var(--panel);width:20px;height:20px;color:var(--muted);font:inherit;cursor:pointer;opacity:0;border:1px solid #0000;border-radius:5px;place-items:center;padding:0;font-size:13px;line-height:1;transition:opacity .12s;display:grid;position:absolute;top:50%;right:4px;transform:translateY(-50%)}.row:hover .row-action,.row-action:focus-visible{opacity:1}.row-action:hover{color:#a33;border-color:#aa333359}@media (hover:none){.row-action{opacity:1}}.modal-backdrop{z-index:50;background:#1f2a3747;place-items:center;display:grid;position:fixed;inset:0}.modal{background:var(--panel);border:1px solid var(--border);border-radius:10px;width:min(380px,100vw - 32px);padding:16px 18px 14px;box-shadow:0 12px 40px #1f2a372e}.modal h3{color:var(--accent);margin-bottom:6px;font-size:14px;font-weight:650}.modal-body{color:var(--muted);font-size:12.5px;line-height:1.65}.modal-actions{justify-content:flex-end;gap:8px;margin-top:14px;display:flex}.ghost.danger{color:#a33}.ghost.danger:hover,.ghost.danger:focus-visible{color:#a33;background:#aa33330f;border-color:#a33}.row{animation:.22s cubic-bezier(.22,.61,.36,1) both row-in}.row.leaving{pointer-events:none;animation:.24s cubic-bezier(.4,0,1,1) both row-out;overflow:hidden}@keyframes row-in{0%{opacity:0;transform:translateY(-4px)}to{opacity:1;transform:none}}@keyframes row-out{0%{opacity:1;max-height:60px}to{opacity:0;max-height:0;transform:translate(-6px)}}@media (prefers-reduced-motion:reduce){.row,.row.leaving{animation:none}}.dot{vertical-align:middle;background:#4c9a6a;border-radius:50%;width:5px;height:5px;margin-left:6px;display:inline-block}.countdown-backdrop{-webkit-backdrop-filter:blur(2px);backdrop-filter:blur(2px);background:#1f2a3766}.countdown{text-align:center;border-radius:12px;width:min(304px,100vw - 32px);padding:22px 22px 20px;animation:.22s cubic-bezier(.22,.61,.36,1) both countdown-in;position:relative;overflow:hidden}.countdown:before{content:"";background:linear-gradient(90deg, var(--accent), var(--gold));opacity:.9;height:2px;position:absolute;inset:0 0 auto}.countdown-ring{width:72px;height:72px;margin:2px auto 10px;position:relative}.countdown-ring svg{width:100%;height:100%;transform:rotate(-90deg)}.countdown-ring circle{fill:none;stroke-width:3px}.countdown-ring-track{stroke:var(--border)}.countdown-ring-fill{stroke:var(--accent);stroke-linecap:round;stroke-dasharray:188.5;transition:stroke-dashoffset 1s linear}.countdown-num{letter-spacing:-.01em;color:var(--accent);font-variant-numeric:tabular-nums;place-items:center;font-size:21px;font-weight:650;display:grid;position:absolute;inset:0}.countdown h3{letter-spacing:.02em;margin-bottom:3px;font-size:13px;font-weight:650}.countdown .modal-body{font-size:12.5px}.countdown.urgent .countdown-ring-fill{stroke:var(--gold)}.countdown.urgent .countdown-num{color:var(--gold)}.countdown.closed{padding:22px}@keyframes countdown-in{0%{opacity:0;transform:translateY(6px)}to{opacity:1;transform:none}}@media (prefers-reduced-motion:reduce){.countdown{animation:none}.countdown-ring-fill{transition:none}}.sr-only{clip:rect(0 0 0 0);white-space:nowrap;border:0;width:1px;height:1px;margin:-1px;padding:0;position:absolute;overflow:hidden}.canvas-row{flex:1;align-items:stretch;gap:12px;min-width:0;min-height:0;padding:12px;display:flex}.canvas-wrap{flex:1;min-width:0;min-height:0;display:flex;position:relative}.canvas-wrap .preview{width:100%;height:100%;min-height:0;margin:0}.panel{background:var(--panel);border:1px solid var(--border);border-radius:10px;flex-direction:column;min-height:0;display:flex;box-shadow:0 1px 2px #1f2a370d,0 8px 24px #1f2a370d}.notes-panel{flex:0 0 380px;width:380px}.panel-float{z-index:3;width:320px;max-height:100%;animation:.14s ease-out panel-in;position:absolute;top:0;right:60px}.preset-panel{width:320px}.components-panel{width:420px;max-width:calc(100vw - 360px)}@keyframes panel-in{0%{opacity:0;transform:translate(8px)}to{opacity:1;transform:translate(0)}}@media (prefers-reduced-motion:reduce){.panel-float{animation:none}}.panel-head{border-bottom:1px solid var(--border);justify-content:space-between;align-items:center;gap:8px;padding:8px 10px 8px 14px;display:flex}.panel-head h2{font-size:13px;font-weight:600}.panel-close{line-height:1}.panel-body{scrollbar-width:thin;flex:1;min-height:0;padding:12px 14px 16px;overflow:auto}.panel-empty{color:var(--muted);font-size:12px}.inspector-panel{width:340px;max-width:calc(100vw - 360px)}.insp-group{padding:2px 0 10px}.insp-group+.insp-group{border-top:1px solid var(--border);padding-top:10px}.insp-group h3{letter-spacing:.08em;text-transform:uppercase;color:var(--muted);margin-bottom:5px;font-size:10.5px;font-weight:600}.insp-row{grid-template-columns:96px minmax(0,1fr);align-items:baseline;gap:8px;padding:1px 0;font-size:12px;display:grid}.insp-key{color:var(--muted);text-overflow:ellipsis;white-space:nowrap;overflow:hidden}.insp-val{align-items:baseline;gap:6px;min-width:0;display:flex}.insp-val code{color:var(--text);overflow-wrap:anywhere;font:11.5px/1.45 ui-monospace,SFMono-Regular,Menlo,Consolas,monospace}.insp-swatch{border:1px solid #1f2a3729;border-radius:3px;flex:none;width:11px;height:11px;transform:translateY(1px)}.insp-resolved{color:var(--muted);font-size:11.5px}.insp-note{color:var(--muted);margin-bottom:8px;font-size:11.5px}.quick-switch-modal{width:min(460px,100vw - 32px)}.qs-input{width:100%;font:inherit;color:var(--text);background:var(--bg);border:1px solid var(--border);border-radius:6px;outline:none;margin:4px 0 8px;padding:7px 10px;font-size:13px}.qs-input:focus{border-color:var(--accent);box-shadow:0 0 0 3px var(--accent-soft)}.qs-list{scrollbar-width:thin;max-height:300px;list-style:none;overflow:auto}.qs-item{width:100%;font:inherit;color:var(--text);text-align:left;cursor:pointer;background:0 0;border:0;border-radius:6px;align-items:baseline;gap:2px;padding:6px 8px;font-size:12.5px;display:flex}.qs-item.active{background:var(--accent-soft)}.qs-item.current .qs-name{font-weight:650}.qs-dir{color:var(--muted);font-size:11.5px}.qs-name{overflow-wrap:anywhere}.qs-empty{color:var(--muted);padding:10px 2px;font-size:12px}.qs-hint{color:var(--muted);margin-top:8px;font-size:11.5px}.boardbar-export{flex:none;align-items:center;gap:6px;margin-left:auto;padding-left:10px;display:flex}.export-scale{padding:2px 6px}.panel-hint{color:var(--muted);margin-top:6px;font-size:12px}.panel-error{color:#b91c1c;white-space:pre-wrap;font-size:12px}.panel-group{letter-spacing:.04em;text-transform:uppercase;color:var(--muted);margin:10px 0 6px;font-size:11px;font-weight:600}.panel-group:first-child{margin-top:0}.markdown{overflow-wrap:anywhere;font-size:13px;line-height:1.7}.markdown>*+*{margin-top:.7em}.markdown h1,.markdown h2,.markdown h3,.markdown h4{margin-top:1.1em;line-height:1.35}.markdown h1{font-size:17px}.markdown h2{font-size:15px}.markdown h3{font-size:13.5px}.markdown ul,.markdown ol{padding-left:1.3em}.markdown code{background:var(--bg);border:1px solid var(--border);border-radius:4px;padding:0 4px;font-size:12px}.markdown pre{background:var(--bg);border:1px solid var(--border);border-radius:8px;padding:10px 12px;overflow:auto}.markdown pre code{background:0 0;border:0;padding:0}.markdown blockquote{border-left:2px solid var(--border);color:var(--muted);padding-left:10px}.markdown table{border-collapse:collapse;font-size:12px}.markdown th,.markdown td{border:1px solid var(--border);text-align:left;padding:3px 8px}.markdown a{color:var(--accent)}.markdown img{max-width:100%}.notes-toggle{z-index:3;border:1px solid var(--border);background:var(--panel);color:var(--text);font:inherit;cursor:pointer;border-radius:8px;align-items:center;gap:6px;padding:5px 10px;font-size:12px;display:inline-flex;position:absolute;top:10px;left:10px;box-shadow:0 1px 2px #1f2a3714}.notes-toggle:hover{border-color:var(--accent);color:var(--accent)}.tool-rail{z-index:4;border:1px solid var(--border);background:var(--panel);border-radius:10px;flex-direction:column;gap:4px;padding:4px;display:flex;position:absolute;top:10px;right:10px;box-shadow:0 1px 2px #1f2a3714}.rail-btn{width:34px;height:34px;color:var(--muted);cursor:pointer;background:0 0;border:0;border-radius:7px;place-items:center;display:grid}.rail-btn:hover,.rail-btn.active{background:var(--accent-soft);color:var(--accent)}.rail-btn:focus-visible{outline:2px solid var(--accent);outline-offset:1px}.preset-list{flex-direction:column;gap:6px;list-style:none;display:flex}.preset-row{align-items:center;gap:8px;display:flex}.preset-name{text-overflow:ellipsis;white-space:nowrap;flex:1;min-width:0;font-size:12px;overflow:hidden}.preset-swatch{border:1px solid var(--border);cursor:pointer;background:0 0;border-radius:5px;flex:none;width:26px;height:22px;padding:0}.preset-value{border:1px solid var(--border);background:var(--bg);width:92px;color:var(--text);font:inherit;font-variant-numeric:tabular-nums;border-radius:5px;flex:none;padding:2px 6px;font-size:12px}.preset-value:focus,.preset-swatch:focus{outline:2px solid var(--accent);outline-offset:1px}.preset-group-list{flex-direction:column;gap:6px;margin-top:6px;list-style:none;display:flex}.preset-group{background:var(--bg);border:1px solid var(--border);border-radius:8px;padding:7px 9px}.preset-group-head{justify-content:space-between;align-items:baseline;gap:8px;font-size:12px;display:flex}.preset-group-head code{color:var(--text);font:11.5px/1.4 ui-monospace,SFMono-Regular,Menlo,Consolas,monospace}.preset-group-props{flex-direction:column;gap:2px;margin-top:5px;display:flex}.preset-group-prop{align-items:baseline;gap:8px;font-size:11.5px;display:flex}.preset-group-key{min-width:72px;color:var(--muted)}.preset-group-prop code{color:var(--text);overflow-wrap:anywhere;font:11px/1.4 ui-monospace,SFMono-Regular,Menlo,Consolas,monospace}.tiles{flex-wrap:wrap;gap:10px;margin-top:10px;display:flex}.tile{flex-direction:column;gap:4px;width:148px;display:flex}.tile-frame{border:1px solid var(--border);background:var(--bg);border-radius:10px;width:148px;height:148px;position:relative;overflow:hidden}.tile-frame iframe{transform-origin:50%;background:0 0;border:0;position:absolute;top:50%;left:50%}.tile figcaption{color:var(--muted);text-overflow:ellipsis;white-space:nowrap;font-size:11px;overflow:hidden}
|
package/ui/dist/index.html
CHANGED
|
@@ -4,8 +4,8 @@
|
|
|
4
4
|
<meta charset="UTF-8" />
|
|
5
5
|
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
|
6
6
|
<title>paintress</title>
|
|
7
|
-
<script type="module" crossorigin src="/assets/index-
|
|
8
|
-
<link rel="stylesheet" crossorigin href="/assets/index-
|
|
7
|
+
<script type="module" crossorigin src="/assets/index-CSUM68ms.js"></script>
|
|
8
|
+
<link rel="stylesheet" crossorigin href="/assets/index-CXBgFia_.css">
|
|
9
9
|
</head>
|
|
10
10
|
<body>
|
|
11
11
|
<div id="root"></div>
|