preview-artifact 0.1.0 → 0.1.1
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 +51 -23
- package/bin/preview-artifact.js +28 -11
- package/dist/assets/{arc-CJ3_-PAT.js → arc-BURSTmp3.js} +1 -1
- package/dist/assets/architecture-7EHR7CIX-vMwo1MDy.js +1 -0
- package/dist/assets/{architectureDiagram-3BPJPVTR--rREWXNq.js → architectureDiagram-3BPJPVTR-BgumLTXX.js} +1 -1
- package/dist/assets/{blockDiagram-GPEHLZMM-BV1c1Mfq.js → blockDiagram-GPEHLZMM-DZIqZdUb.js} +1 -1
- package/dist/assets/{c4Diagram-AAUBKEIU-Bc6XHTqW.js → c4Diagram-AAUBKEIU-LCHgN1jn.js} +1 -1
- package/dist/assets/channel-CxSUoqXK.js +1 -0
- package/dist/assets/{chunk-2J33WTMH-eTp7ioqm.js → chunk-2J33WTMH-DvEeoM9J.js} +1 -1
- package/dist/assets/{chunk-4BX2VUAB-DeAmcro3.js → chunk-4BX2VUAB-CYSoYAWK.js} +1 -1
- package/dist/assets/{chunk-55IACEB6-fvzFs169.js → chunk-55IACEB6-BRb7E5Qi.js} +1 -1
- package/dist/assets/{chunk-727SXJPM-BWnGyv0z.js → chunk-727SXJPM-B6j5-ndb.js} +1 -1
- package/dist/assets/{chunk-AQP2D5EJ-DpWR_SeI.js → chunk-AQP2D5EJ-CjQmIT1k.js} +1 -1
- package/dist/assets/{chunk-FMBD7UC4-DMyBW8iC.js → chunk-FMBD7UC4-CRSfU6H4.js} +1 -1
- package/dist/assets/{chunk-ND2GUHAM-BWO3mIks.js → chunk-ND2GUHAM-CA0wzQhE.js} +1 -1
- package/dist/assets/chunk-QZHKN3VN-qjaIE4NP.js +1 -0
- package/dist/assets/classDiagram-4FO5ZUOK-tEqL1CeM.js +1 -0
- package/dist/assets/classDiagram-v2-Q7XG4LA2-tEqL1CeM.js +1 -0
- package/dist/assets/{cose-bilkent-S5V4N54A-C0oZ9Wdh.js → cose-bilkent-S5V4N54A-BUHtitPb.js} +1 -1
- package/dist/assets/{dagre-DjzBNxbY.js → dagre-7vyoWyN2.js} +1 -1
- package/dist/assets/{dagre-BM42HDAG-8yabnAvH.js → dagre-BM42HDAG-BUTV0k5t.js} +1 -1
- package/dist/assets/{diagram-2AECGRRQ-8ounJ_ea.js → diagram-2AECGRRQ-voc56b5-.js} +1 -1
- package/dist/assets/{diagram-5GNKFQAL-Dis8fSWn.js → diagram-5GNKFQAL-C7HSNbqS.js} +1 -1
- package/dist/assets/{diagram-KO2AKTUF-C6EHdpm4.js → diagram-KO2AKTUF-CT_9xb24.js} +1 -1
- package/dist/assets/{diagram-LMA3HP47-DNFfc6f_.js → diagram-LMA3HP47-DrHSwoeD.js} +1 -1
- package/dist/assets/{diagram-OG6HWLK6-T3xi-usC.js → diagram-OG6HWLK6-BlSHz05Y.js} +1 -1
- package/dist/assets/{dist-D9o03QzN.js → dist-0d-akqae.js} +1 -1
- package/dist/assets/{dist-BzXJV1j0.js → dist-B2HVEpJX.js} +1 -1
- package/dist/assets/{dist-DbgoG8p0.js → dist-B7_xrEdo.js} +1 -1
- package/dist/assets/{dist-C4F0WDhe.js → dist-B9KjjRWM.js} +1 -1
- package/dist/assets/{dist-Dx7RIjDF.js → dist-BPuA80LW.js} +1 -1
- package/dist/assets/{dist-CxkjL8u9.js → dist-BmnAXazp.js} +1 -1
- package/dist/assets/{dist-CEGhJ1xl.js → dist-CA3Pk7v2.js} +1 -1
- package/dist/assets/{dist-r1yFQKfc.js → dist-CFQxyybE.js} +1 -1
- package/dist/assets/{dist-CF78u7GS.js → dist-CtSpiN1s.js} +1 -1
- package/dist/assets/{dist-CMxhtH1e.js → dist-Cwfv_tyI.js} +1 -1
- package/dist/assets/{dist-CO6gjtrq.js → dist-Cz05ErgZ.js} +1 -1
- package/dist/assets/{dist-CN0qWAiT.js → dist-D7NejwjW.js} +1 -1
- package/dist/assets/{dist-DVp3z0N1.js → dist-DKqiadCC.js} +1 -1
- package/dist/assets/{dist-CwfCEqoZ.js → dist-D_laSL_U.js} +1 -1
- package/dist/assets/{dist-BBZDeMcg.js → dist-Dg8qYpln.js} +1 -1
- package/dist/assets/{dist-D3Gxtn_g.js → dist-Dk3xCloY.js} +1 -1
- package/dist/assets/{dist-BaQ073UB.js → dist-DrNtdG-E.js} +1 -1
- package/dist/assets/{dist-BQ3j-7m-.js → dist-_PpeBmXb.js} +1 -1
- package/dist/assets/{dist-DUVOpSfr.js → dist-fwzYOjXD.js} +1 -1
- package/dist/assets/{dist-Bat5IVRd.js → dist-hkW4HGTf.js} +1 -1
- package/dist/assets/{dist-hHJOGFR3.js → dist-uNrLmmfA.js} +1 -1
- package/dist/assets/{dist-3LHbYvzB.js → dist-vmhdhx9-.js} +1 -1
- package/dist/assets/{erDiagram-TEJ5UH35-DmLQldz3.js → erDiagram-TEJ5UH35-BdUg-F90.js} +1 -1
- package/dist/assets/eventmodeling-FCH6USID-CarTby87.js +1 -0
- package/dist/assets/{flowDiagram-I6XJVG4X-DVUVTV7y.js → flowDiagram-I6XJVG4X-5hDnkzmr.js} +1 -1
- package/dist/assets/{ganttDiagram-6RSMTGT7-B29Uh60s.js → ganttDiagram-6RSMTGT7-DBd6oZBy.js} +1 -1
- package/dist/assets/gitGraph-WXDBUCRP-DQQMJkO5.js +1 -0
- package/dist/assets/{gitGraphDiagram-PVQCEYII-smrXHnBr.js → gitGraphDiagram-PVQCEYII-jpG4B7NZ.js} +1 -1
- package/dist/assets/{graphlib-DpLcPBYV.js → graphlib-BhyPxx7t.js} +1 -1
- package/dist/assets/{index-nBHjSfNd.css → index-7fg9xGWU.css} +1 -1
- package/dist/assets/{index-Czi2sVlL.js → index-D3M38wf4.js} +202 -202
- package/dist/assets/info-J43DQDTF-BLewHZ0P.js +1 -0
- package/dist/assets/{infoDiagram-5YYISTIA-B1Gf8Uv-.js → infoDiagram-5YYISTIA-14qdu6o4.js} +1 -1
- package/dist/assets/{ishikawaDiagram-YF4QCWOH-D02jcukO.js → ishikawaDiagram-YF4QCWOH-k9M2sROT.js} +1 -1
- package/dist/assets/{journeyDiagram-JHISSGLW-B2VXi2OP.js → journeyDiagram-JHISSGLW-B2Z9trvc.js} +1 -1
- package/dist/assets/{kanban-definition-UN3LZRKU-2-V_ZAd5.js → kanban-definition-UN3LZRKU-DPaaxbtF.js} +1 -1
- package/dist/assets/{linear-BEHGKHxt.js → linear-CPH32Ioh.js} +1 -1
- package/dist/assets/{mermaid-parser.core-DedvXRIg.js → mermaid-parser.core-E4GbSOma.js} +2 -2
- package/dist/assets/{mindmap-definition-RKZ34NQL-CmE26Ash.js → mindmap-definition-RKZ34NQL-CtNQ-qFb.js} +1 -1
- package/dist/assets/packet-YPE3B663-DBVABQ0X.js +1 -0
- package/dist/assets/pie-LRSECV5Y-Cc2CPikn.js +1 -0
- package/dist/assets/{pieDiagram-4H26LBE5-DA8Tc6HA.js → pieDiagram-4H26LBE5-C-r-uEXr.js} +1 -1
- package/dist/assets/{quadrantDiagram-W4KKPZXB-Kkoca0z9.js → quadrantDiagram-W4KKPZXB-DtbLg6VZ.js} +1 -1
- package/dist/assets/radar-GUYGQ44K-DebC3Kbw.js +1 -0
- package/dist/assets/{requirementDiagram-4Y6WPE33-lfBTeFxy.js → requirementDiagram-4Y6WPE33-j3kBTdyC.js} +1 -1
- package/dist/assets/{sankeyDiagram-5OEKKPKP-I9io9g_r.js → sankeyDiagram-5OEKKPKP-BglSwOKH.js} +1 -1
- package/dist/assets/{sequenceDiagram-3UESZ5HK-DctmO3Ji.js → sequenceDiagram-3UESZ5HK-_USq3wx4.js} +1 -1
- package/dist/assets/{stateDiagram-AJRCARHV-C5Nx7EBG.js → stateDiagram-AJRCARHV-dQ9LsVy-.js} +1 -1
- package/dist/assets/stateDiagram-v2-BHNVJYJU-DC6g--EQ.js +1 -0
- package/dist/assets/{timeline-definition-PNZ67QCA-Dg9cWzqH.js → timeline-definition-PNZ67QCA-CNRy3iur.js} +1 -1
- package/dist/assets/treeView-BLDUP644-BgNRg2b1.js +1 -0
- package/dist/assets/treemap-LRROVOQU-Bg67wSlB.js +1 -0
- package/dist/assets/{vennDiagram-CIIHVFJN-Cq75Ue3t.js → vennDiagram-CIIHVFJN-kg3yNHOS.js} +1 -1
- package/dist/assets/wardley-L42UT6IY-C2sV-5KB.js +1 -0
- package/dist/assets/{wardleyDiagram-YWT4CUSO-DDjtFIKf.js → wardleyDiagram-YWT4CUSO-kTnm6q2P.js} +1 -1
- package/dist/assets/{xychartDiagram-2RQKCTM6-xtq4jnQX.js → xychartDiagram-2RQKCTM6-Bswc68Nb.js} +1 -1
- package/dist/index.html +2 -2
- package/package.json +1 -1
- package/server/index.mjs +64 -1
- package/dist/assets/architecture-7EHR7CIX-Z0xF5NqR.js +0 -1
- package/dist/assets/channel-Bj7QtUIY.js +0 -1
- package/dist/assets/chunk-QZHKN3VN-BZ-TNixB.js +0 -1
- package/dist/assets/classDiagram-4FO5ZUOK-DfFXNbKt.js +0 -1
- package/dist/assets/classDiagram-v2-Q7XG4LA2-DfFXNbKt.js +0 -1
- package/dist/assets/eventmodeling-FCH6USID-CjbfWKFY.js +0 -1
- package/dist/assets/gitGraph-WXDBUCRP-UjXKP53I.js +0 -1
- package/dist/assets/info-J43DQDTF-D0rV5uTf.js +0 -1
- package/dist/assets/packet-YPE3B663-BgNtBtap.js +0 -1
- package/dist/assets/pie-LRSECV5Y-BtNYo6fY.js +0 -1
- package/dist/assets/radar-GUYGQ44K-CT8UiwEf.js +0 -1
- package/dist/assets/stateDiagram-v2-BHNVJYJU-MxkuKT7f.js +0 -1
- package/dist/assets/treeView-BLDUP644-DwODQHAM.js +0 -1
- package/dist/assets/treemap-LRROVOQU-D1GWl9XK.js +0 -1
- package/dist/assets/wardley-L42UT6IY-C--1EU_5.js +0 -1
package/README.md
CHANGED
|
@@ -1,10 +1,14 @@
|
|
|
1
|
-
#
|
|
1
|
+
# Pretifact
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
reports, papers) in the browser —
|
|
5
|
-
save back to disk, and live-reload**
|
|
3
|
+
**Pretifact** (the `preview-artifact` npm package) opens the artifacts your coding
|
|
4
|
+
agents produce (plans, design docs, audit reports, papers) in the browser —
|
|
5
|
+
**read them beautifully, edit them in place, save back to disk, and live-reload**
|
|
6
|
+
when an agent rewrites the file.
|
|
6
7
|
|
|
7
|
-
|
|
8
|
+

|
|
9
|
+
|
|
10
|
+
Handles **Markdown** (`.md`), **LaTeX** (`.tex`), and **PDF** (`.pdf`), with a
|
|
11
|
+
light and dark theme.
|
|
8
12
|
|
|
9
13
|
Fully local. No cloud, no telemetry, no account.
|
|
10
14
|
|
|
@@ -14,10 +18,19 @@ preview-artifact open docs/plans/2026-05-31-some-design.md
|
|
|
14
18
|
|
|
15
19
|
## Screenshots
|
|
16
20
|
|
|
21
|
+
In the wild — an agent finishes a design doc and opens it in Pretifact:
|
|
22
|
+
|
|
23
|
+

|
|
24
|
+
|
|
17
25
|
Editorial read view — serif display type, warm paper, orange frame:
|
|
18
26
|
|
|
19
27
|

|
|
20
28
|
|
|
29
|
+
Side panel — open several artifacts at once and switch between them, plus
|
|
30
|
+
recently-opened history (collapsible, closed by default):
|
|
31
|
+
|
|
32
|
+

|
|
33
|
+
|
|
21
34
|
Rich markdown — images, headings, and a live mermaid diagram, GFM tables, task
|
|
22
35
|
lists and KaTeX math:
|
|
23
36
|
|
|
@@ -50,6 +63,9 @@ frontmatter, task lists — and deserve a real reading surface you can also edit
|
|
|
50
63
|
- **Edit mode** — Milkdown (ProseMirror) WYSIWYG that round-trips markdown
|
|
51
64
|
faithfully. YAML frontmatter is split into its own panel so the editor can
|
|
52
65
|
never corrupt it.
|
|
66
|
+
- **Side panel** — open several artifacts at once (`preview-artifact open a.md b.tex c.pdf`),
|
|
67
|
+
switch between them, and pick from recently-opened history. Updates live as the
|
|
68
|
+
agent opens more. Collapsible.
|
|
53
69
|
- **Save** — writes back to the same file. `Cmd/Ctrl+S`.
|
|
54
70
|
- **Live-reload** — a file watcher pushes external changes over a websocket; if
|
|
55
71
|
you have unsaved edits it asks before discarding them.
|
|
@@ -57,25 +73,22 @@ frontmatter, task lists — and deserve a real reading surface you can also edit
|
|
|
57
73
|
|
|
58
74
|
## Install
|
|
59
75
|
|
|
60
|
-
Requires Node ≥ 18.
|
|
61
|
-
globally (builds itself on install):
|
|
76
|
+
Requires Node ≥ 18.
|
|
62
77
|
|
|
63
78
|
```bash
|
|
64
|
-
# once published to npm:
|
|
65
79
|
npm install -g preview-artifact
|
|
66
|
-
|
|
67
|
-
# or straight from GitHub today:
|
|
68
|
-
npm install -g github:anup-a/preview-artifact
|
|
69
80
|
```
|
|
70
81
|
|
|
71
82
|
<details>
|
|
72
|
-
<summary>
|
|
83
|
+
<summary>Other ways to install</summary>
|
|
73
84
|
|
|
74
85
|
```bash
|
|
86
|
+
# latest from GitHub
|
|
87
|
+
npm install -g github:anup-a/preview-artifact
|
|
88
|
+
|
|
89
|
+
# local clone (for development) — npm install runs the build automatically
|
|
75
90
|
git clone https://github.com/anup-a/preview-artifact.git
|
|
76
|
-
cd preview-artifact
|
|
77
|
-
npm install # runs the build automatically (prepare script)
|
|
78
|
-
npm link # makes `preview-artifact` available globally
|
|
91
|
+
cd preview-artifact && npm install && npm link
|
|
79
92
|
```
|
|
80
93
|
</details>
|
|
81
94
|
|
|
@@ -83,8 +96,10 @@ npm link # makes `preview-artifact` available globally
|
|
|
83
96
|
|
|
84
97
|
```bash
|
|
85
98
|
preview-artifact open path/to/file.md # open in the browser
|
|
99
|
+
preview-artifact open a.md b.tex c.pdf # open several into the side panel
|
|
86
100
|
preview-artifact path/to/file.md # shorthand
|
|
87
101
|
preview-artifact open file.md --no-open # start server without launching a browser
|
|
102
|
+
preview-artifact stop # stop the daemon
|
|
88
103
|
preview-artifact --help
|
|
89
104
|
```
|
|
90
105
|
|
|
@@ -94,21 +109,34 @@ Use it from any project — it's not tied to any particular repo.
|
|
|
94
109
|
|
|
95
110
|
This tool is meant to be launched *by* your agent when it finishes writing an
|
|
96
111
|
artifact. The CLI self-daemonizes and returns immediately, so agents just run it
|
|
97
|
-
— no backgrounding needed.
|
|
98
|
-
|
|
112
|
+
— no backgrounding needed. It ships as a **skill** that the model auto-invokes
|
|
113
|
+
when you ask to preview something or after it writes a plan (no slash command to
|
|
114
|
+
remember). See [`AGENTS.md`](./AGENTS.md) for details.
|
|
99
115
|
|
|
100
|
-
|
|
116
|
+
> **CLI vs skill.** The `preview-artifact` **npm package is the actual program**
|
|
117
|
+
> (it runs the viewer). The **skill** is just instructions telling the agent when
|
|
118
|
+
> to run it — installing the skill alone is enough: on first use it runs
|
|
119
|
+
> `npm install -g preview-artifact` for you if the CLI is missing. Prefer the CLI
|
|
120
|
+
> directly? Just `npm install -g preview-artifact` and skip the skill.
|
|
101
121
|
|
|
102
|
-
|
|
103
|
-
|
|
122
|
+
### Claude Code (plugin — recommended)
|
|
123
|
+
|
|
124
|
+
Install the plugin from this repo's marketplace; it ships the skill, which then
|
|
125
|
+
auto-invokes:
|
|
104
126
|
|
|
105
127
|
```
|
|
106
128
|
/plugin marketplace add anup-a/preview-artifact
|
|
107
129
|
/plugin install preview-artifact@preview-artifact
|
|
108
130
|
```
|
|
109
131
|
|
|
110
|
-
|
|
111
|
-
|
|
132
|
+
### Other agents (skill)
|
|
133
|
+
|
|
134
|
+
Install the same [skill](./skills/preview-artifact/SKILL.md) into any agent
|
|
135
|
+
(Cursor, Aider, …) via the open [skills](https://skills.sh) CLI:
|
|
136
|
+
|
|
137
|
+
```bash
|
|
138
|
+
npx skills add anup-a/preview-artifact
|
|
139
|
+
```
|
|
112
140
|
|
|
113
141
|
### Codex (custom prompt)
|
|
114
142
|
|
|
@@ -130,7 +158,7 @@ preview-artifact open path/to/file.md # prints the URL, then returns
|
|
|
130
158
|
|
|
131
159
|
### If `preview-artifact` isn't on your agent's PATH
|
|
132
160
|
|
|
133
|
-
`npm
|
|
161
|
+
`npm install -g` puts the binary in npm's global bin. If your agent runs with a
|
|
134
162
|
minimal PATH and can't find it, add npm's global bin to PATH:
|
|
135
163
|
|
|
136
164
|
```bash
|
package/bin/preview-artifact.js
CHANGED
|
@@ -23,7 +23,7 @@ function usage(code = 0) {
|
|
|
23
23
|
console.log(`preview-artifact — read & edit agent artifacts in the browser
|
|
24
24
|
|
|
25
25
|
Usage:
|
|
26
|
-
preview-artifact open <file
|
|
26
|
+
preview-artifact open <file...> Open .md / .tex / .pdf file in the browser
|
|
27
27
|
preview-artifact <file> Shorthand for "open"
|
|
28
28
|
preview-artifact stop Stop the background daemon
|
|
29
29
|
|
|
@@ -91,16 +91,33 @@ async function stopDaemon() {
|
|
|
91
91
|
}
|
|
92
92
|
}
|
|
93
93
|
|
|
94
|
-
async function
|
|
95
|
-
const
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
94
|
+
async function openFiles(files, noOpen) {
|
|
95
|
+
const targets = [];
|
|
96
|
+
for (const f of files) {
|
|
97
|
+
const abs = path.resolve(process.cwd(), f);
|
|
98
|
+
if (!existsSync(abs)) {
|
|
99
|
+
console.error(`error: file not found: ${abs}`);
|
|
100
|
+
process.exit(1);
|
|
101
|
+
}
|
|
102
|
+
targets.push(abs);
|
|
99
103
|
}
|
|
100
104
|
const port = (await healthyPort()) ?? (await startDaemon());
|
|
101
|
-
|
|
102
|
-
|
|
105
|
+
|
|
106
|
+
// Register all artifacts so they appear in the panel.
|
|
107
|
+
await fetch(`http://127.0.0.1:${port}/api/register`, {
|
|
108
|
+
method: "POST",
|
|
109
|
+
headers: { "Content-Type": "application/json" },
|
|
110
|
+
body: JSON.stringify({ paths: targets }),
|
|
111
|
+
}).catch(() => {});
|
|
112
|
+
|
|
113
|
+
for (const t of targets) {
|
|
114
|
+
console.log(
|
|
115
|
+
`[preview-artifact] ${path.basename(t)} → http://127.0.0.1:${port}/?path=${encodeURIComponent(t)}`,
|
|
116
|
+
);
|
|
117
|
+
}
|
|
118
|
+
// Open a browser tab at the first artifact (the rest show in the panel).
|
|
103
119
|
if (!noOpen) {
|
|
120
|
+
const url = `http://127.0.0.1:${port}/?path=${encodeURIComponent(targets[0])}`;
|
|
104
121
|
await open(url).catch(() => console.log(`open your browser at ${url}`));
|
|
105
122
|
}
|
|
106
123
|
}
|
|
@@ -116,10 +133,10 @@ const positional = argv.filter((a) => !a.startsWith("-"));
|
|
|
116
133
|
if (positional[0] === "stop") {
|
|
117
134
|
await stopDaemon();
|
|
118
135
|
} else {
|
|
119
|
-
const
|
|
120
|
-
if (
|
|
136
|
+
const files = positional[0] === "open" ? positional.slice(1) : positional;
|
|
137
|
+
if (files.length === 0) {
|
|
121
138
|
console.error("error: no file specified\n");
|
|
122
139
|
usage(1);
|
|
123
140
|
}
|
|
124
|
-
await
|
|
141
|
+
await openFiles(files, noOpen);
|
|
125
142
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{At as e,Ct as t,Dt as n,Et as r,Mt as i,Ot as a,St as o,Tt as s,bt as c,jt as l,kt as u,vt as d,xt as f,yt as p}from"./index-
|
|
1
|
+
import{At as e,Ct as t,Dt as n,Et as r,Mt as i,Ot as a,St as o,Tt as s,bt as c,jt as l,kt as u,vt as d,xt as f,yt as p}from"./index-D3M38wf4.js";function m(e){return e.innerRadius}function h(e){return e.outerRadius}function g(e){return e.startAngle}function _(e){return e.endAngle}function v(e){return e&&e.padAngle}function y(e,t,n,r,i,a,o,s){var c=n-e,l=r-t,u=o-i,d=s-a,f=d*c-u*l;if(!(f*f<1e-12))return f=(u*(t-a)-d*(e-i))/f,[e+f*c,t+f*l]}function b(t,n,i,a,o,s,c){var l=t-i,u=n-a,d=(c?s:-s)/e(l*l+u*u),f=d*u,p=-d*l,m=t+f,h=n+p,g=i+f,_=a+p,v=(m+g)/2,y=(h+_)/2,b=g-m,x=_-h,S=b*b+x*x,C=o-s,w=m*_-g*h,T=(x<0?-1:1)*e(r(0,C*C*S-w*w)),E=(w*x-b*T)/S,D=(-w*b-x*T)/S,O=(w*x+b*T)/S,k=(-w*b+x*T)/S,A=E-v,j=D-y,M=O-v,N=k-y;return A*A+j*j>M*M+N*N&&(E=O,D=k),{cx:E,cy:D,x01:-f,y01:-p,x11:E*(o/C-1),y11:D*(o/C-1)}}function x(){var r=m,x=h,S=i(0),C=null,w=g,T=_,E=v,D=null,O=d(k);function k(){var i,d,m=+r.apply(this,arguments),h=+x.apply(this,arguments),g=w.apply(this,arguments)-s,_=T.apply(this,arguments)-s,v=p(_-g),k=_>g;if(D||=i=O(),h<m&&(d=h,h=m,m=d),!(h>1e-12))D.moveTo(0,0);else if(v>l-1e-12)D.moveTo(h*t(g),h*u(g)),D.arc(0,0,h,g,_,!k),m>1e-12&&(D.moveTo(m*t(_),m*u(_)),D.arc(0,0,m,_,g,k));else{var A=g,j=_,M=g,N=_,P=v,F=v,I=E.apply(this,arguments)/2,L=I>1e-12&&(C?+C.apply(this,arguments):e(m*m+h*h)),R=n(p(h-m)/2,+S.apply(this,arguments)),z=R,B=R,V,H;if(L>1e-12){var U=f(L/m*u(I)),W=f(L/h*u(I));(P-=U*2)>1e-12?(U*=k?1:-1,M+=U,N-=U):(P=0,M=N=(g+_)/2),(F-=W*2)>1e-12?(W*=k?1:-1,A+=W,j-=W):(F=0,A=j=(g+_)/2)}var G=h*t(A),K=h*u(A),q=m*t(N),J=m*u(N);if(R>1e-12){var Y=h*t(j),X=h*u(j),Z=m*t(M),Q=m*u(M),$;if(v<a)if($=y(G,K,Z,Q,Y,X,q,J)){var ee=G-$[0],te=K-$[1],ne=Y-$[0],re=X-$[1],ie=1/u(c((ee*ne+te*re)/(e(ee*ee+te*te)*e(ne*ne+re*re)))/2),ae=e($[0]*$[0]+$[1]*$[1]);z=n(R,(m-ae)/(ie-1)),B=n(R,(h-ae)/(ie+1))}else z=B=0}F>1e-12?B>1e-12?(V=b(Z,Q,G,K,h,B,k),H=b(Y,X,q,J,h,B,k),D.moveTo(V.cx+V.x01,V.cy+V.y01),B<R?D.arc(V.cx,V.cy,B,o(V.y01,V.x01),o(H.y01,H.x01),!k):(D.arc(V.cx,V.cy,B,o(V.y01,V.x01),o(V.y11,V.x11),!k),D.arc(0,0,h,o(V.cy+V.y11,V.cx+V.x11),o(H.cy+H.y11,H.cx+H.x11),!k),D.arc(H.cx,H.cy,B,o(H.y11,H.x11),o(H.y01,H.x01),!k))):(D.moveTo(G,K),D.arc(0,0,h,A,j,!k)):D.moveTo(G,K),!(m>1e-12)||!(P>1e-12)?D.lineTo(q,J):z>1e-12?(V=b(q,J,Y,X,m,-z,k),H=b(G,K,Z,Q,m,-z,k),D.lineTo(V.cx+V.x01,V.cy+V.y01),z<R?D.arc(V.cx,V.cy,z,o(V.y01,V.x01),o(H.y01,H.x01),!k):(D.arc(V.cx,V.cy,z,o(V.y01,V.x01),o(V.y11,V.x11),!k),D.arc(0,0,m,o(V.cy+V.y11,V.cx+V.x11),o(H.cy+H.y11,H.cx+H.x11),k),D.arc(H.cx,H.cy,z,o(H.y11,H.x11),o(H.y01,H.x01),!k))):D.arc(0,0,m,N,M,k)}if(D.closePath(),i)return D=null,i+``||null}return k.centroid=function(){var e=(+r.apply(this,arguments)+ +x.apply(this,arguments))/2,n=(+w.apply(this,arguments)+ +T.apply(this,arguments))/2-a/2;return[t(n)*e,u(n)*e]},k.innerRadius=function(e){return arguments.length?(r=typeof e==`function`?e:i(+e),k):r},k.outerRadius=function(e){return arguments.length?(x=typeof e==`function`?e:i(+e),k):x},k.cornerRadius=function(e){return arguments.length?(S=typeof e==`function`?e:i(+e),k):S},k.padRadius=function(e){return arguments.length?(C=e==null?null:typeof e==`function`?e:i(+e),k):C},k.startAngle=function(e){return arguments.length?(w=typeof e==`function`?e:i(+e),k):w},k.endAngle=function(e){return arguments.length?(T=typeof e==`function`?e:i(+e),k):T},k.padAngle=function(e){return arguments.length?(E=typeof e==`function`?e:i(+e),k):E},k.context=function(e){return arguments.length?(D=e??null,k):D},k}export{x as t};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{x as e}from"./mermaid-parser.core-E4GbSOma.js";export{e as createArchitectureServices};
|