Repository navigation
Expand file tree
/
Copy pathindex.html
More file actions
339 lines (328 loc) · 29.9 KB
/
Copy pathindex.html
File metadata and controls
339 lines (328 loc) · 29.9 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta http-equiv="Content-Security-Policy" content="default-src 'self'; script-src 'self' 'sha256-K3HCnFVFG29S7OHrJeVzBz67oJbUgUm550MGI3sGEkY=' 'sha256-PPkMX/tejPJwisJkjWj2oMLfVD2FLfTUEEhkoFa9l0c=' 'sha256-5Fyyu4EQ+hN/OZPycG/hMfGMdvxgomTuJGfpaEEV15U='; style-src 'self' 'unsafe-inline'; img-src 'self' data: blob:; font-src 'self'; connect-src 'self' data:; object-src 'none'; base-uri 'self'; form-action 'none'">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>Nexus - Drupal content-model diagrams</title>
<link rel="icon" href="assets/favicon.svg" type="image/svg+xml">
<link rel="stylesheet" href="assets/vendor/shoelace/themes/light.css">
<link rel="stylesheet" href="assets/vendor/shoelace/themes/dark.css">
<link rel="stylesheet" href="src/styles.css">
<link rel="modulepreload" href="src/doc-link.js">
<link rel="modulepreload" href="src/dom.js">
<link rel="modulepreload" href="src/entity-types.js">
<link rel="modulepreload" href="src/icons.js">
<link rel="modulepreload" href="src/names.js">
<link rel="modulepreload" href="src/template-download.js">
<link rel="modulepreload" href="src/template-list.js">
<link rel="modulepreload" href="src/templates.js">
<link rel="modulepreload" href="src/version.js">
<script>
// Apply the theme before the first paint, since src/app.js runs only after
// the deferred vendor scripts. initTheme() reads the class back.
try {
const saved = window.localStorage.getItem('nexusTheme');
const dark = saved ? saved === 'dark' : window.matchMedia('(prefers-color-scheme: dark)').matches;
document.documentElement.classList.toggle('sl-theme-dark', dark);
} catch {
// Storage may be unavailable; the page stays in the light theme.
}
</script>
<script type="importmap">
{
"imports": {
"preact": "./assets/vendor/preact.module.js",
"preact/hooks": "./assets/vendor/hooks.module.js",
"htm": "./assets/vendor/htm.module.js"
}
}
</script>
<script type="module">
// Pin Shoelace's base path to an absolute URL before the autoloader runs,
// so it resolves at the domain root or a subpath (GitHub Pages).
// Left unset, it builds a bare import specifier from its script src that
// never resolves, so no component upgrades.
import { setBasePath } from './assets/vendor/shoelace/utilities/base-path.js';
setBasePath(new URL('assets/vendor/shoelace', document.baseURI).href);
</script>
<script type="module" src="assets/vendor/shoelace/shoelace-autoloader.js"></script>
<script type="module" src="src/boot.js"></script>
</head>
<body>
<header class="toolbar">
<div class="toolbar__brandline">
<div class="toolbar__actions">
<span class="toolbar__brand" data-icon="nexus">Nexus</span>
<sl-input id="diagram-title" class="toolbar__title" size="small" placeholder="Untitled content model" title="Rename this content model - used for the saved file names" aria-label="Content model name"></sl-input>
</div>
<div class="toolbar__actions">
<sl-button id="help-toggle" class="toolbar__button toolbar__button--icon" size="small" data-icon="help-circle" data-shortcut="?" title="Toggle the Help panel: the Nexus user manual" aria-label="Help"></sl-button>
<sl-button id="github-link" class="toolbar__button toolbar__button--icon" size="small" href="https://github.com/drevops/nexus" target="_blank" rel="noopener" data-icon="github" title="View Nexus on GitHub" aria-label="View Nexus on GitHub"></sl-button>
<sl-button id="theme-toggle" class="toolbar__button toolbar__button--icon" size="small" data-icon="moon" data-theme-toggle data-shortcut="D" title="Toggle light / dark theme" aria-label="Toggle theme"></sl-button>
<sl-button id="settings-toggle" class="toolbar__button toolbar__button--icon" size="small" data-icon="settings" data-shortcut="," title="Open the settings" aria-label="Settings"></sl-button>
</div>
</div>
<div class="toolbar__tools">
<div class="toolbar__section">
<sl-button id="doc-new" class="toolbar__button" size="small" data-icon="file-plus" data-shortcut="Alt+N" title="Start a new empty content model">New</sl-button>
<sl-button-group id="open-group" class="toolbar__group" label="Open">
<sl-button id="doc-open-btn" class="toolbar__button" size="small" data-icon="folder-open" data-shortcut="Mod+O" title="Open a saved Nexus diagram (.nexus.json)">Open</sl-button>
<sl-dropdown id="open-dropdown" placement="bottom-end" hoist>
<sl-button id="open-choose" slot="trigger" class="toolbar__button" size="small" caret data-shortcut="Shift+O" title="Open a config folder, a template or a diagram from an AI agent" aria-label="Choose what to open"></sl-button>
<sl-menu id="open-menu">
<sl-menu-item value="document" title="Open a saved Nexus diagram (.nexus.json)"><span slot="prefix" data-icon="folder-open"></span>Saved diagram…</sl-menu-item>
<sl-menu-item value="import" title="Import a Drupal config folder or start from a template"><span slot="prefix" data-icon="folder-input"></span>Config folder or template…</sl-menu-item>
<sl-menu-item value="csv" title="Import a content model from a CSV file with 1 row per field"><span slot="prefix" data-icon="table"></span>CSV file…</sl-menu-item>
<sl-menu-item value="csv-template" title="Download a CSV template to fill in and import with CSV file…"><span slot="prefix" data-icon="file-down"></span>CSV template</sl-menu-item>
<sl-menu-item value="ai" title="Create a diagram with an AI agent from a screenshot, spreadsheet or spec"><span slot="prefix" data-icon="sparkles"></span>Create with AI…</sl-menu-item>
<sl-divider></sl-divider>
<sl-menu-item id="compare-with" title="Compare this diagram with another version of its content model"><span slot="prefix" data-icon="git-compare"></span>Compare with
<sl-menu slot="submenu">
<sl-menu-item value="compare-document" title="Compare this diagram with a saved Nexus diagram (.nexus.json)"><span slot="prefix" data-icon="folder-open"></span>Saved diagram…</sl-menu-item>
<sl-menu-item value="compare-folder" title="Compare this diagram with a Drupal config folder"><span slot="prefix" data-icon="folder-input"></span>Config folder…</sl-menu-item>
</sl-menu>
</sl-menu-item>
</sl-menu>
</sl-dropdown>
</sl-button-group>
<sl-button-group id="save-group" class="toolbar__group" label="Save">
<sl-button id="doc-save" class="toolbar__button" size="small" data-icon="download" data-shortcut="Mod+S" title="Save this diagram as a Nexus document (.nexus.json)">Save</sl-button>
<sl-dropdown id="save-dropdown" placement="bottom-end" hoist>
<sl-button id="save-choose" slot="trigger" class="toolbar__button" size="small" caret data-shortcut="Mod+Shift+S" title="Save the diagram in another format: CSV, DOT, HTML, Markdown, Mermaid, PNG or SVG, or copy a link to it" aria-label="Save as"></sl-button>
<sl-menu id="save-menu">
<sl-menu-label>Save as</sl-menu-label>
<sl-divider id="save-divider"></sl-divider>
<sl-menu-item value="link" title="Copy a link that opens this diagram, with the diagram inside the link"><span slot="prefix" data-icon="link"></span>Copy link</sl-menu-item>
</sl-menu>
</sl-dropdown>
</sl-button-group>
</div>
<div class="toolbar__section">
<sl-button-group class="toolbar__group" label="Undo">
<sl-button id="undo" class="toolbar__button toolbar__button--icon" size="small" data-icon="undo-2" data-shortcut="Mod+Z" data-shortcut-repeat title="Nothing to undo" aria-label="Undo" disabled></sl-button>
<sl-button id="redo" class="toolbar__button toolbar__button--icon" size="small" data-icon="redo-2" data-shortcut="Mod+Shift+Z Ctrl+Y" data-shortcut-repeat title="Nothing to redo" aria-label="Redo" disabled></sl-button>
</sl-button-group>
</div>
<div class="toolbar__section">
<sl-button-group class="toolbar__group" label="Mode">
<sl-button id="mode-view" class="toolbar__button is-active" size="small" data-icon="eye" data-shortcut="V" title="View mode: explore the diagram">View</sl-button>
<sl-button id="mode-build" class="toolbar__button" size="small" data-icon="pencil" data-shortcut="E" title="Edit mode: add and change entities and fields">Edit</sl-button>
</sl-button-group>
</div>
<div class="toolbar__section">
<div class="toolbar__find" role="search">
<sl-input id="search" class="toolbar__search" size="small" type="search" placeholder="Find entity…" autocomplete="off" clearable data-shortcut="/" title="Type an entity name and press Enter or the search button"></sl-input>
<sl-button id="search-btn" class="toolbar__button toolbar__button--icon" size="small" data-icon="search" title="Find the entity and zoom to it" aria-label="Search"></sl-button>
</div>
</div>
<div class="toolbar__section">
<sl-button-group class="toolbar__group" label="Layout">
<sl-button id="layout-run" class="toolbar__button" size="small" data-icon="layout" data-shortcut="L" title="Stack the entities in columns that fill the screen"><span class="layout-label">Layout: Columns</span></sl-button>
<sl-dropdown placement="bottom-end" hoist>
<sl-button id="layout-choose" slot="trigger" class="toolbar__button" size="small" caret data-shortcut="Shift+L" title="Choose a layout" aria-label="Choose a layout"></sl-button>
<sl-menu id="layout-menu"></sl-menu>
</sl-dropdown>
<sl-button id="tidy" class="toolbar__button" size="small" data-icon="tidy" data-shortcut="T" title="Tidy up: straighten each entity, keeping its fields in their order, and line the entities up in columns near where they are">Tidy up</sl-button>
</sl-button-group>
<sl-dropdown id="lines-dropdown" placement="bottom-end" hoist>
<sl-button id="lines-choose" slot="trigger" class="toolbar__button" size="small" caret data-icon="spline" data-shortcut="Alt+L" title="Draw lines at right angles, each turning halfway to its target"><span class="lines-label">Lines: Right-angled</span></sl-button>
<sl-menu id="lines-menu"></sl-menu>
</sl-dropdown>
</div>
<div class="toolbar__section">
<sl-button-group class="toolbar__group" label="Panels">
<sl-button id="entities-toggle" class="toolbar__button" size="small" data-icon="box" data-shortcut="1" title="Toggle the entities panel">Entities</sl-button>
<sl-button id="table-toggle" class="toolbar__button" size="small" data-icon="table" data-shortcut="2" title="Toggle the fields panel: every field in a table">Fields</sl-button>
<sl-button id="legend-toggle" class="toolbar__button" size="small" data-icon="info" data-shortcut="3" title="Toggle the legend panel">Legend</sl-button>
<sl-button id="history-toggle" class="toolbar__button" size="small" data-icon="history" data-shortcut="4" title="Toggle the history panel: every version of this diagram">History</sl-button>
<sl-button id="checks-toggle" class="toolbar__button" size="small" data-icon="list-checks" data-shortcut="5" title="Toggle the checks panel: problems in this model">Checks<span class="checks-badge" slot="suffix" hidden></span></sl-button>
<sl-button id="changes-toggle" class="toolbar__button" size="small" data-icon="git-compare" data-shortcut="6" title="Toggle the changes panel: what the compared model adds, removes and changes" hidden>Changes<span class="changes-badge" slot="suffix"></span></sl-button>
</sl-button-group>
</div>
</div>
<div id="build-tools" class="toolbar__palette" hidden>
<span class="toolbar__palette-label">Add:</span>
<button id="add-node" class="toolbar__button palette__btn" type="button" data-add-entity="node" data-shortcut="Shift+C" title="Add a content type"><span class="palette__symbol" aria-hidden="true"></span>Content</button>
<button id="add-taxonomy_term" class="toolbar__button palette__btn" type="button" data-add-entity="taxonomy_term" data-shortcut="Shift+V" title="Add a vocabulary"><span class="palette__symbol" aria-hidden="true"></span>Vocab</button>
<button id="add-media" class="toolbar__button palette__btn" type="button" data-add-entity="media" data-shortcut="Shift+M" title="Add a media type"><span class="palette__symbol" aria-hidden="true"></span>Media</button>
<button id="add-paragraph" class="toolbar__button palette__btn" type="button" data-add-entity="paragraph" data-shortcut="Shift+P" title="Add a paragraph type"><span class="palette__symbol" aria-hidden="true"></span>Para</button>
<button id="add-block_content" class="toolbar__button palette__btn" type="button" data-add-entity="block_content" data-shortcut="Shift+B" title="Add a block type"><span class="palette__symbol" aria-hidden="true"></span>Block</button>
<button id="add-user" class="toolbar__button palette__btn" type="button" data-add-entity="user" data-shortcut="Shift+U" title="Add a user reference"><span class="palette__symbol" aria-hidden="true"></span>User</button>
<button id="add-external" class="toolbar__button palette__btn" type="button" data-add-entity="external" data-shortcut="Shift+X" title="Add an external entity"><span class="palette__symbol" aria-hidden="true"></span>External</button>
<span class="toolbar__palette-sep"></span>
<button id="add-field" class="toolbar__button" type="button" data-icon="single" data-shortcut="Shift+F" title="Add a field to an entity">Field</button>
<button id="add-event" class="toolbar__button" type="button" data-add-note="event" data-icon="diamond" data-shortcut="Shift+E" title="Place an event note on the canvas">Event</button>
<button id="add-api" class="toolbar__button" type="button" data-add-note="api" data-icon="hexagon" data-shortcut="Shift+A" title="Place an API note on the canvas">API</button>
<button id="add-callback" class="toolbar__button" type="button" data-add-note="callback" data-icon="callback" data-shortcut="Shift+K" title="Place a callback note on the canvas">Callback</button>
<button id="add-note" class="toolbar__button" type="button" data-add-note="note" data-icon="sticky-note" data-shortcut="Shift+N" title="Place a note with Markdown text on the canvas">Note</button>
<span class="toolbar__palette-sep"></span>
<button id="connect-toggle" class="toolbar__button" type="button" data-icon="link" data-shortcut="C" title="Drag from a field to a target entity to create a reference">Connect</button>
<button id="delete-selection" class="toolbar__button" type="button" data-icon="trash" data-shortcut="Delete Backspace" title="Delete the selected entities, fields and annotations" aria-label="Delete" disabled></button>
</div>
</header>
<main class="stage" id="stage-root"></main>
<footer id="statusbar" class="statusbar">
<div class="statusbar__display" role="group" aria-label="Display">
<sl-button-group id="detail-levels" class="statusbar__level" label="Detail level" data-shortcut="F" title="Switch to the next detail level: Entities"></sl-button-group>
<sl-switch id="proxy-toggle" size="small" data-shortcut="P" title="Show references as semi-opaque proxies instead of long edges">Proxies</sl-switch>
<sl-switch id="machine-names" size="small" data-shortcut="M" title="Show or hide machine names under each symbol">Machine names</sl-switch>
</div>
<div id="explore-bar" class="statusbar__explore" role="group" aria-label="Explore view" hidden>
<span class="statusbar__explore-label">Exploring <strong id="explore-entity" class="statusbar__explore-entity"></strong></span>
<sl-select id="explore-depth" class="statusbar__explore-depth" size="small" placement="top" hoist title="How many references away to show" aria-label="Depth"></sl-select>
<sl-radio-group id="explore-direction" class="statusbar__explore-direction" size="small" title="Which way to follow references" aria-label="Direction"></sl-radio-group>
<sl-button id="explore-clear" class="toolbar__button" size="small" data-icon="x" title="Clear the explore view and show the whole diagram where it was">Clear</sl-button>
</div>
<span id="statusbar-hint" class="statusbar__hint is-tips">F1 shows keyboard shortcuts · Click a node to focus · Right-drag to pan · Right-click an entity to isolate or explore it · Double-click a node to edit it · In Edit, drag to select & move</span>
<div class="statusbar__zoom">
<sl-button id="reset" class="toolbar__button toolbar__button--icon" size="small" data-icon="rotate-ccw" data-shortcut="0 Mod+0" title="Clear focus and reset the zoom to 100%" aria-label="Reset view"></sl-button>
<sl-button id="fit" class="toolbar__button toolbar__button--icon" size="small" data-icon="fit" data-shortcut="Shift+1" title="Fit the whole diagram in view" aria-label="Fit to view"></sl-button>
<sl-button id="zoom-out" class="toolbar__button toolbar__button--icon" size="small" data-icon="zoom-out" data-shortcut="- Mod+- Mod+_" data-shortcut-repeat title="Zoom out"></sl-button>
<sl-button id="zoom-in" class="toolbar__button toolbar__button--icon" size="small" data-icon="zoom-in" data-shortcut="Plus = Mod+Plus Mod+=" data-shortcut-repeat title="Zoom in"></sl-button>
<sl-dropdown class="statusbar__zoomlevel" placement="top-end" hoist>
<sl-button id="zoom-level" slot="trigger" class="toolbar__button" size="small" caret data-shortcut="Z" title="Set the zoom level">100%</sl-button>
<sl-menu id="zoom-menu">
<sl-menu-item value="fit" title="Fit the whole diagram in view">Fit</sl-menu-item>
<sl-menu-item value="0.25" title="Zoom to 25%">25%</sl-menu-item>
<sl-menu-item value="0.5" title="Zoom to 50%">50%</sl-menu-item>
<sl-menu-item value="0.75" title="Zoom to 75%">75%</sl-menu-item>
<sl-menu-item value="1" title="Zoom to 100%">100%</sl-menu-item>
<sl-menu-item value="1.5" title="Zoom to 150%">150%</sl-menu-item>
<sl-menu-item value="2" title="Zoom to 200%">200%</sl-menu-item>
<sl-menu-item value="3" title="Zoom to 300%">300%</sl-menu-item>
</sl-menu>
</sl-dropdown>
</div>
</footer>
<!-- Outside the toolbar, which is inert while the landing screen is open. -->
<input id="doc-open" class="visually-hidden" type="file" accept=".json,application/json" tabindex="-1">
<input id="csv-open" class="visually-hidden" type="file" accept=".csv,text/csv" tabindex="-1">
<input id="compare-doc" class="visually-hidden" type="file" accept=".json,application/json" tabindex="-1">
<input id="compare-folder" class="visually-hidden" type="file" webkitdirectory directory multiple tabindex="-1">
<!-- Hidden until src/boot.js has drawn it, inert and busy until src/app.js has
wired its controls. -->
<div id="landing" class="landing" inert aria-busy="true">
<div class="landing__card">
<div class="landing__body">
<div class="landing__corner">
<sl-button id="landing-theme" class="toolbar__button toolbar__button--icon" size="small" data-icon="moon" data-theme-toggle data-shortcut="D" title="Toggle light / dark theme" aria-label="Toggle theme"></sl-button>
<sl-button id="landing-cancel" class="toolbar__button toolbar__button--icon" size="small" data-icon="x" data-shortcut="Escape" title="Close this screen and keep the current diagram" aria-label="Close" hidden></sl-button>
</div>
<div class="landing__header">
<span class="landing__mark" data-icon="nexus"></span>
<h1 class="landing__logo">Nexus</h1>
<p class="landing__version" id="landing-version" data-version>dev</p>
<p class="landing__tag">Draw a Drupal site's content model from its exported configuration - entirely in your browser.</p>
</div>
<div class="landing__columns">
<section aria-labelledby="landing-own-heading">
<h2 id="landing-own-heading" class="landing__heading">Your configuration</h2>
<div id="dropzone" class="dropzone">
<span class="dropzone__glyph" data-icon="folder-input"></span>
<p class="dropzone__hint">Drop a Drupal <strong>config</strong> folder here, or choose one.</p>
<sl-button id="folder-btn" variant="primary" data-icon="folder-input" data-shortcut="Alt+I" title="Import a Drupal config folder">Choose a config folder</sl-button>
<input id="folder-input" class="visually-hidden" type="file" webkitdirectory directory multiple tabindex="-1">
<p class="dropzone__privacy">Your files never leave this page.</p>
<p class="landing__note">Point at an exported config sync directory (the folder of <code>*.yml</code> files) or a module's <code>config/install</code>. Add an <a href="https://github.com/drevops/nexus/blob/main/docs/annotations.md" target="_blank" rel="noopener" title="Read how to write an annotation overlay"><code>annotations.yml</code></a> to overlay events, APIs and callbacks.</p>
</div>
<div class="landing__actions">
<sl-button id="landing-open" data-icon="folder-open" data-shortcut="Mod+O" title="Open a saved Nexus diagram (.nexus.json)">Open a saved diagram</sl-button>
<sl-button id="new-btn" data-icon="file-plus" data-shortcut="Alt+N" title="Start a new empty content model">Start from scratch</sl-button>
<sl-button id="landing-ai" class="landing__ai" data-icon="sparkles" data-shortcut="Alt+A" title="Create a diagram with an AI agent from a screenshot, spreadsheet or spec">Create with AI</sl-button>
</div>
</section>
<section aria-labelledby="landing-templates-heading">
<h2 id="landing-templates-heading" class="landing__heading">Start from a template</h2>
<div id="template-list" class="template-list"></div>
<p class="landing__more">Missing a theme or distribution? <a href="https://github.com/drevops/nexus/issues" target="_blank" rel="noopener" title="Open an issue on GitHub to suggest a template">Suggest a template</a>.</p>
</section>
</div>
<sl-alert id="landing-error" class="landing__error" variant="danger" closable><span id="landing-error-text"></span></sl-alert>
</div>
</div>
</div>
<div id="loader" class="loader" hidden>
<sl-spinner class="loader__spinner"></sl-spinner>
<p id="loader-text" class="loader__text">Loading…</p>
</div>
<div id="shortcut-hints" class="shortcut-hints" aria-hidden="true" hidden></div>
<sl-dialog id="about-dialog" class="about-dialog">
<span slot="label" class="dialog__label" data-icon="nexus">About Nexus</span>
<div class="about">
<p>Nexus is a content-model visual builder. It reconstructs a Drupal site's content model - its entities, fields and relationships - from exported configuration, and lets you explore and edit it as an interactive diagram.</p>
<p>Press F1 to label every button with its keyboard shortcut.</p>
<p>Everything runs in your browser. Any configuration you import and every diagram you build are kept in this browser only - there is no backend, and nothing you provide is uploaded to or processed by any server.</p>
<p>Nexus is provided as is, without warranty of any kind. The authors accept no responsibility or liability for any data you load into it or create with it - even though that data never leaves your browser.</p>
<p>Nexus is open source - browse the code, report issues or contribute on <a id="about-repo" href="https://github.com/drevops/nexus" target="_blank" rel="noopener" title="Open the Nexus repository on GitHub">GitHub</a>.</p>
<p>Nexus is free software, released under the <a id="about-license" href="https://github.com/drevops/nexus/blob/main/LICENSE" target="_blank" rel="noopener" title="Read the licence">GNU General Public License, version 2 or later</a> (GPL-2.0-or-later).</p>
<p class="about__version">Version <span id="about-version" data-version>dev</span></p>
</div>
<sl-button id="about-close" slot="footer" variant="primary" title="Close the About box">Close</sl-button>
</sl-dialog>
<sl-dialog id="ai-dialog" class="ai-dialog">
<span slot="label" class="dialog__label" data-icon="sparkles">Create with AI</span>
<button class="dialog__help" slot="header-actions" type="button" data-icon="help-circle" title="Read about Create with AI in the Help panel" aria-label="Help on Create with AI"></button>
<div class="ai">
<p class="ai__intro">Give an AI agent a screenshot, a spreadsheet, a spec or a list of content types, and it writes a Nexus diagram by following the <code>create-nexus-diagram</code> skill. Pick how to hand the skill over, then paste what the agent writes back below.</p>
<sl-tab-group id="ai-tabs" class="ai__tabs">
<sl-tab id="ai-tab-prompt" slot="nav" panel="prompt" title="A prompt for an agent that can read web pages">Prompt</sl-tab>
<sl-tab id="ai-tab-skill" slot="nav" panel="skill" title="The whole skill, for a chat that can't read web pages">Skill</sl-tab>
<sl-tab id="ai-tab-install" slot="nav" panel="install" title="A command that adds the skill to your project">Install</sl-tab>
<sl-tab-panel name="prompt">
<p class="ai__hint">For an agent that can read web pages, such as Claude Code, Codex or Cursor. Copy the prompt, then describe the content model or attach the source.</p>
<pre id="ai-prompt" class="ai__code"></pre>
<div class="ai__actions">
<sl-button id="ai-copy-prompt" size="small" data-icon="copy" data-copy="ai-prompt" title="Copy the prompt to the clipboard"><span class="ai__copy-label">Copy prompt</span></sl-button>
</div>
</sl-tab-panel>
<sl-tab-panel name="skill">
<p class="ai__hint">For a chat that can't read web pages. Paste the whole skill first, then your source.</p>
<pre id="ai-skill" class="ai__code ai__code--long">Loading the skill…</pre>
<div class="ai__actions">
<sl-button id="ai-copy-skill" size="small" data-icon="copy" data-copy="ai-skill" title="Copy the whole skill to the clipboard" disabled><span class="ai__copy-label">Copy skill</span></sl-button>
<sl-button id="ai-download-skill" size="small" data-icon="download" href="skills/create-nexus-diagram/SKILL.md" download="SKILL.md" title="Download the skill as SKILL.md">Download SKILL.md</sl-button>
</div>
</sl-tab-panel>
<sl-tab-panel name="install">
<p class="ai__hint">Keeps the skill in your project, so your agent uses it whenever you ask for a Nexus diagram. Run it in the project's root. It writes to <code>.claude/skills</code> for Claude Code; other agents read the same file from their own skills folder.</p>
<pre id="ai-install" class="ai__code"></pre>
<div class="ai__actions">
<sl-button id="ai-copy-install" size="small" data-icon="copy" data-copy="ai-install" title="Copy the command to the clipboard"><span class="ai__copy-label">Copy command</span></sl-button>
</div>
</sl-tab-panel>
</sl-tab-group>
<sl-textarea id="ai-paste" class="ai__paste" label="Paste the diagram" rows="4" resize="vertical" placeholder="Paste the .nexus.json document, or the agent's whole reply" title="Paste the document the agent wrote, or its whole reply with the document in a code block"></sl-textarea>
<sl-alert id="ai-error" class="ai__error" variant="danger"><span id="ai-error-text"></span></sl-alert>
</div>
<sl-button id="ai-close" slot="footer" title="Close this dialog">Close</sl-button>
<sl-button id="ai-open" slot="footer" variant="primary" data-icon="folder-open" title="Open the pasted document as the diagram">Open diagram</sl-button>
</sl-dialog>
<sl-dialog id="settings" class="settings-dialog">
<span slot="label" class="dialog__label" data-icon="settings">Settings</span>
<button class="dialog__help" slot="header-actions" type="button" data-icon="help-circle" title="Read about the settings in the Help panel" aria-label="Help on Settings"></button>
<div id="settings-body" class="settings-dialog__body"></div>
<p slot="footer" class="settings-dialog__note">Saved to this browser and reused across diagrams.</p>
<sl-button id="settings-reset" slot="footer" class="settings-reset" size="small" data-icon="rotate-ccw" title="Restore the default colours, symbols, new diagram settings, mode frame, hover highlight, Markdown export and checks">Reset all to defaults</sl-button>
<sl-button id="settings-close" slot="footer" size="small" variant="primary" title="Close the settings">Done</sl-button>
</sl-dialog>
<sl-dialog id="link-dialog" class="link-dialog">
<span slot="label" class="dialog__label" data-icon="link">Copy link</span>
<button class="dialog__help" slot="header-actions" type="button" data-icon="help-circle" title="Read about shared links in the Help panel" aria-label="Help on shared links"></button>
<div class="link">
<p id="link-text" class="link__text"></p>
<sl-input id="link-url" class="link__url" size="small" readonly title="The link to this diagram" aria-label="Link to this diagram"></sl-input>
<p class="link__docs"><a id="link-protection" href="docs/sharing.md#link-protection" data-help-page="sharing" data-help-anchor="link-protection" title="Read in the Help panel how Nexus checks a link for damage and keeps its content from running code">How links are protected</a> · <a id="link-limits" href="docs/sharing.md#link-limits" data-help-page="sharing" data-help-anchor="link-limits" title="Read in the Help panel how long a link can be and how much diagram it holds">Link limits</a></p>
</div>
<sl-button id="link-close" slot="footer" title="Close this dialog">Close</sl-button>
<sl-button id="link-copy" slot="footer" variant="primary" data-icon="copy" title="Copy the link to the clipboard">Copy link</sl-button>
<sl-button id="link-save" slot="footer" variant="primary" data-icon="download" title="Save this diagram as a Nexus document (.nexus.json)">Save .nexus.json</sl-button>
</sl-dialog>
<script src="assets/vendor/cytoscape.min.js" defer></script>
<script src="assets/vendor/dagre.min.js" defer></script>
<script src="assets/vendor/cytoscape-dagre.js" defer></script>
<script src="assets/vendor/cytoscape-svg.js" defer></script>
<script src="assets/vendor/js-yaml.min.js" defer></script>
<script type="module" src="src/app.js"></script>
</body>
</html>