@sciflow/editor-start 0.0.1-beta → 0.0.1-beta2
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 +34 -0
- package/dist/bundle/sciflow-editor.css +1 -1
- package/dist/bundle/sciflow-editor.js +7643 -5555
- package/dist/index.d.ts +1 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1 -1
- package/dist/lib/citation-source-adapter.d.ts +22 -2
- package/dist/lib/citation-source-adapter.d.ts.map +1 -1
- package/dist/lib/citation-source-adapter.js +104 -48
- package/dist/lib/drag-preview.d.ts +13 -0
- package/dist/lib/drag-preview.d.ts.map +1 -0
- package/dist/lib/drag-preview.js +36 -0
- package/dist/lib/editor-element.d.ts +16 -1
- package/dist/lib/editor-element.d.ts.map +1 -1
- package/dist/lib/editor-element.js +107 -30
- package/dist/lib/format-bar.d.ts +7 -0
- package/dist/lib/format-bar.d.ts.map +1 -1
- package/dist/lib/format-bar.js +79 -10
- package/dist/lib/outline.d.ts +10 -5
- package/dist/lib/outline.d.ts.map +1 -1
- package/dist/lib/outline.js +112 -1
- package/dist/lib/reference-list.d.ts.map +1 -1
- package/dist/lib/reference-list.js +2 -0
- package/dist/lib/selection-editor.d.ts +67 -5
- package/dist/lib/selection-editor.d.ts.map +1 -1
- package/dist/lib/selection-editor.js +1060 -125
- package/dist/lib/selection-transform-registry.d.ts +16 -0
- package/dist/lib/selection-transform-registry.d.ts.map +1 -0
- package/dist/lib/selection-transform-registry.js +24 -0
- package/dist/lib/selection-ui-renderer.d.ts +21 -0
- package/dist/lib/selection-ui-renderer.d.ts.map +1 -0
- package/dist/lib/selection-ui-renderer.js +244 -0
- package/dist/lib/selection-widget-host.d.ts +67 -0
- package/dist/lib/selection-widget-host.d.ts.map +1 -0
- package/dist/lib/selection-widget-host.js +151 -0
- package/dist/lib/selection-widget-registry.d.ts +16 -0
- package/dist/lib/selection-widget-registry.d.ts.map +1 -0
- package/dist/lib/selection-widget-registry.js +30 -0
- package/dist/lib/test-fixtures/soak-documents.d.ts +13 -0
- package/dist/lib/test-fixtures/soak-documents.d.ts.map +1 -0
- package/dist/lib/test-fixtures/soak-documents.js +69 -0
- package/dist/tsconfig.lib.tsbuildinfo +1 -1
- package/package.json +9 -5
package/README.md
CHANGED
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
# @sciflow/editor-start
|
|
2
2
|
|
|
3
|
+
Documentation: [docs.sciflow.org](https://docs.sciflow.org)
|
|
4
|
+
|
|
3
5
|
Lit-based wrapper around the SciFlow ProseMirror schema. It loads all the packages required to get started with a basic editor.
|
|
4
6
|
|
|
5
7
|
## Building
|
|
@@ -38,6 +40,10 @@ Companion elements for sidebars—`<sciflow-selection-editor>` and `<sciflow-ref
|
|
|
38
40
|
|
|
39
41
|
`editor-change` events include `{ doc, operations, files, references }`, where `files` mirrors uploaded assets (full URLs plus optional previews) maintained by the figure feature.
|
|
40
42
|
|
|
43
|
+
## Developer docs
|
|
44
|
+
|
|
45
|
+
- Selection editor internals (selection interaction, property editing, JSON schema): `docs/selection-editor.md`
|
|
46
|
+
|
|
41
47
|
### Custom shadow-root styles
|
|
42
48
|
|
|
43
49
|
Inject CSS directly into the editor's shadow root to override the built-in ProseMirror styles without touching global stylesheets. Styles can be set before or after initialization:
|
|
@@ -117,6 +123,25 @@ Properties and behaviours:
|
|
|
117
123
|
- `mimeType` should be set for anything besides CSL JSON; default is `application/vnd.citationstyles.csl+json`. Use `application/vnd.openalex+json` for OpenAlex or your own type for custom payloads.
|
|
118
124
|
- Dragging an item sets `application/json`, `application/x-sciflow-reference`, and `text/plain` payloads for integrations.
|
|
119
125
|
|
|
126
|
+
### Math (equations)
|
|
127
|
+
|
|
128
|
+
When the **math** feature is enabled (it is included in the default feature list), users can insert and edit TeX equations. Equations are rendered as SVG in the editor using MathJax 4.
|
|
129
|
+
|
|
130
|
+
- **Loading MathJax:** The host page must load the MathJax 4 `tex-svg` component before equations will render, e.g.
|
|
131
|
+
`<script defer src="https://cdn.jsdelivr.net/npm/mathjax@4/tex-svg.js"></script>`
|
|
132
|
+
If MathJax is not loaded, math nodes show a short message and the raw TeX; the document still saves and loads correctly.
|
|
133
|
+
- **Editing:** Select a math node in the editor; the selection sidebar shows a **math** panel with TeX source, inline/display style, optional label, live preview, and **Apply** / **Escape** (cancel). Use **Ctrl+Enter** (or **Cmd+Enter**) to apply changes and **Escape** to cancel.
|
|
134
|
+
- **Errors and warnings:** Invalid TeX shows an error message in the node view and in the sidebar preview. MathJax errors and warnings are always shown when they occur so users can fix equations.
|
|
135
|
+
|
|
136
|
+
The format bar shows an **Insert equation** button when the math feature is active.
|
|
137
|
+
|
|
138
|
+
### Footnotes
|
|
139
|
+
|
|
140
|
+
The **footnote** feature is also included in the default feature list.
|
|
141
|
+
|
|
142
|
+
- The format bar shows an **Insert footnote** button when the feature is active.
|
|
143
|
+
- Running `insertFootnote` with a text selection moves the selected text into the new footnote body.
|
|
144
|
+
|
|
120
145
|
## Demo
|
|
121
146
|
|
|
122
147
|
- `npx nx run @sciflow/editor-start:demo` — runs `vite build --watch` to keep the ES module bundle up to date **and** serves the demo via `vite dev`. The demo always loads `dist/bundle/sciflow-editor.js`, so the behaviour matches what you ship to consumers.
|
|
@@ -128,3 +153,12 @@ When you need to hand the demo to someone without repository access:
|
|
|
128
153
|
1. Run `npx nx bundle @sciflow/editor-start` to refresh `dist/bundle/`.
|
|
129
154
|
2. Zip `packages/editor/start/demo/` together with `packages/editor/start/dist/bundle/`.
|
|
130
155
|
3. They can unpack the archive and open `demo/index.html` (or serve the folder with any static server) to explore the integration.
|
|
156
|
+
|
|
157
|
+
## Production deployment notes (Lit)
|
|
158
|
+
|
|
159
|
+
When serving the demo or a host app in production, apply the same deployment hardening recommended by Lit:
|
|
160
|
+
|
|
161
|
+
- Enable text compression at the server/CDN layer (gzip or brotli).
|
|
162
|
+
- Use cache-busting/fingerprinted URLs where feasible in the host application.
|
|
163
|
+
- Keep JavaScript minification enabled (the Vite production build already does this).
|
|
164
|
+
- The bundle is built with Vite (esbuild minification).
|
|
@@ -1 +1 @@
|
|
|
1
|
-
:host{display:block;color-scheme:light dark;font-family:var(--sciflow-editor-font-family, system-ui, sans-serif);color:var(--sciflow-editor-color, #0f172a);--sciflow-editor-background: #ffffff;--sciflow-editor-border: rgba(15, 23, 42, .14);--sciflow-editor-border-active: #2563eb;--sciflow-editor-focus-ring: rgba(37, 99, 235, .25);--sciflow-editor-citation-bg: rgba(15, 23, 42, .05);--sciflow-editor-citation-color: inherit}.editor{border:1px solid var(--sciflow-editor-border);border-radius:8px;padding:12px;min-height:200px;box-sizing:border-box;background:var(--sciflow-editor-background, #fff)}.editor:focus-within{border-color:var(--sciflow-editor-border-active);box-shadow:0 0 0 2px var(--sciflow-editor-focus-ring)}.ProseMirror{position:relative;word-wrap:break-word;white-space:pre-wrap;white-space:break-spaces;-webkit-font-variant-ligatures:none;font-variant-ligatures:none;font-feature-settings:"liga" 0;font-weight:lighter;outline:none;min-height:inherit;padding:.5rem 4rem .5rem 2.5rem;color:inherit}.ProseMirror{line-height:1.6}.ProseMirror p{margin:0 0 .75rem}.ProseMirror h1,.ProseMirror h2,.ProseMirror h3,.ProseMirror h4,.ProseMirror h5,.ProseMirror h6{margin:1.25rem 0 .5rem;line-height:1.2}.ProseMirror table{width:100%;border-collapse:collapse;border-spacing:0;margin:1rem 0}.ProseMirror th,.ProseMirror td{padding:.5rem .75rem;border:1px solid color-mix(in srgb,currentColor 18%,transparent);vertical-align:top}.ProseMirror p:only-child:last-child,.ProseMirror table p{margin:0}.ProseMirror img{max-width:100%;height:auto}.ProseMirror pre{white-space:pre-wrap}.ProseMirror cite{background:var(--sciflow-editor-citation-bg);color:var(--sciflow-editor-citation-color);padding:.1rem .35rem;border-radius:4px}.ProseMirror img{max-width:40vw}.ProseMirror h1:before{content:"h1";opacity:.5;font-size:.8rem;position:absolute;left:0;transform:translateY(50%);padding-right:.5rem}.ProseMirror h1{font-size:1.5rem;padding-top:1em;font-weight:400}.ProseMirror h2{font-size:1.3em}.ProseMirror h2:before{content:"h2";opacity:.5;font-size:.8rem;padding-right:.5rem;position:absolute;left:0;transform:translateY(50%)}.ProseMirror h3{font-size:1.15em}.ProseMirror h3:before{content:"h3";opacity:.5;font-size:.8rem;padding-right:.5rem;position:absolute;left:0;transform:translateY(50%)}.ProseMirror section{margin-top:2.5rem}.ProseMirror section:first-child{margin-top:.5rem}.ProseMirror h2{font-size:1.25rem;font-weight:400}.ProseMirror h3,.ProseMirror h4,.ProseMirror h5,.ProseMirror h6{font-weight:400;font-size:1.05rem}.ProseMirror li{position:relative}.ProseMirror-hideselection *::selection{background:transparent}.ProseMirror-hideselection *::-moz-selection{background:transparent}.ProseMirror-hideselection{caret-color:transparent}.ProseMirror [draggable][contenteditable=false]{-webkit-user-select:text;user-select:text}.ProseMirror-selectednode{outline:2px solid #8cf}li.ProseMirror-selectednode{outline:none}li.ProseMirror-selectednode:after{content:"";position:absolute;inset:-2px -2px -2px -32px;border:2px solid #8cf;pointer-events:none}img.ProseMirror-separator{display:inline!important;border:none!important;margin:0!important}@media (prefers-color-scheme: dark){:host{color:var(--sciflow-editor-color, #e2e8f0);--sciflow-editor-background: #0f172a;--sciflow-editor-border: rgba(148, 163, 184, .35);--sciflow-editor-border-active: #3b82f6;--sciflow-editor-focus-ring: rgba(59, 130, 246, .35);--sciflow-editor-citation-bg: rgba(148, 163, 184, .2);--sciflow-editor-citation-color: #e2e8f0}.ProseMirror h1,.ProseMirror h2,.ProseMirror h3,.ProseMirror h4,.ProseMirror h5,.ProseMirror h6{color:inherit}.ProseMirror-selectednode{outline-color:#60a5facc}}:host{display:inline-flex;gap:8px;align-items:flex-start;color-scheme:light dark;border:1px solid var(--sciflow-formatbar-border, rgba(15, 23, 42, .05));border-radius:8px;padding:4px;background:var(--sciflow-formatbar-background, #f8fafc);box-shadow:var(--sciflow-formatbar-shadow, none);font-family:inherit}.style-select{display:inline-flex;align-items:center;min-height:36px;border:none;border-radius:6px;background:var(--sciflow-formatbar-select-background, white);color:var(--sciflow-formatbar-select-color, #1f2937);font:inherit;padding:0 12px;cursor:pointer;transition:border-color .15s ease,box-shadow .15s ease}.style-select:focus-visible{outline:2px solid var(--sciflow-formatbar-select-focus, rgba(37, 99, 235, .4));outline-offset:1px}.style-select:disabled{cursor:not-allowed;color:var(--sciflow-formatbar-button-disabled, rgba(15, 23, 42, .38));border-color:var(--sciflow-formatbar-select-border-disabled, rgba(15, 23, 42, .12));background:var(--sciflow-formatbar-select-background-disabled, #f1f5f9)}button{appearance:none;border:none;background:transparent;border-radius:6px;padding:6px;font:inherit;line-height:1;cursor:pointer;color:var(--sciflow-formatbar-button-color, #1f2937);transition:background .15s ease,color .15s ease;display:inline-flex;align-items:center;justify-content:center;min-width:36px;min-height:36px}button:hover:not(:disabled),button:focus-visible:not(:disabled){background:var(--sciflow-formatbar-button-hover, rgba(37, 99, 235, .12));outline:none}button:disabled{cursor:not-allowed;color:var(--sciflow-formatbar-button-disabled, rgba(15, 23, 42, .38))}button.active{background:var(--sciflow-formatbar-button-active-background, rgba(37, 99, 235, .12));color:var(--sciflow-formatbar-button-active, #1d4ed8)}button[data-tooltip]{position:relative}button[data-tooltip]:after{content:attr(data-tooltip);position:absolute;bottom:calc(100% + 6px);left:50%;transform:translate(-50%);background:#0f172ae6;color:#fff;padding:6px 8px;border-radius:6px;font-size:12px;line-height:1.2;white-space:nowrap;opacity:0;pointer-events:none;transition:opacity .15s ease;z-index:2}button[data-tooltip]:hover:after,button[data-tooltip]:focus-visible:after{opacity:1}.material-symbols-rounded{font-family:Material Symbols Rounded;font-variation-settings:"FILL" var(--sciflow-formatbar-button-fill, 0),"wght" var(--sciflow-formatbar-button-weight, 400),"GRAD" 0,"opsz" 24;font-size:20px;line-height:1}.command-rows{display:flex;flex-direction:column;gap:4px}.command-row{display:flex;flex-wrap:wrap;gap:4px;align-items:center}.command-row.table-row{border-top:1px solid var(--sciflow-formatbar-border, rgba(15, 23, 42, .12));padding-top:4px;margin-top:2px}@media (prefers-color-scheme: dark){:host{--sciflow-formatbar-border: rgba(148, 163, 184, .3);--sciflow-formatbar-background: rgba(15, 23, 42, .65);--sciflow-formatbar-shadow: none;--sciflow-formatbar-select-background: rgba(30, 41, 59, .8);--sciflow-formatbar-select-color: #e2e8f0;--sciflow-formatbar-button-color: #e2e8f0;--sciflow-formatbar-button-hover: rgba(59, 130, 246, .25);--sciflow-formatbar-button-active-background: rgba(96, 165, 250, .2);--sciflow-formatbar-button-active: #93c5fd;--sciflow-formatbar-button-disabled: rgba(148, 163, 184, .45);--sciflow-formatbar-select-background-disabled: rgba(30, 41, 59, .6)}}:host{display:block;color:inherit;font:inherit}:host([hidden]){display:none}.outline-list{list-style:none;padding:0;margin:0;display:grid;gap:.6rem}.outline-item{padding:.35rem .5rem .35rem .75rem;border-left:2px solid rgba(37,99,235,.18);border-radius:8px;display:grid;gap:.15rem;transition:background .16s ease,border-color .16s ease,color .16s ease}.outline-item[role=button]{cursor:pointer}.outline-item[role=button]:hover{background:color-mix(in srgb,rgba(37,99,235,.12) 60%,transparent);border-left-color:#2563eb73}.outline-item:focus-visible{outline:2px solid #2563eb;outline-offset:2px}.outline-item--active{background:color-mix(in srgb,rgba(37,99,235,.14) 70%,transparent);border-left-color:#2563ebbf}.outline-text{font-weight:600;color:color-mix(in srgb,canvastext 85%,#0f172a 10%)}.outline-meta{font-size:.78rem;color:color-mix(in srgb,canvastext 60%,#0f172a 15%);display:inline-flex;align-items:center;gap:.35rem;flex-wrap:wrap}.outline-id{background:#2563eb14;color:inherit;border-radius:4px;padding:.12em .4em;font-size:.9em}.outline-item.level-2{padding-left:1.5rem;border-left-style:dotted}.outline-item.level-3{padding-left:2.25rem;border-left-style:dotted;border-left-color:#2563eb1f}.outline-placeholder{color:color-mix(in srgb,canvastext 60%,#0f172a 10%);padding-left:.25rem}:host{display:block;color-scheme:light dark;font-family:inherit}.reference-list{list-style:none;margin:0;padding:0;display:grid;gap:.6rem}.reference-item{display:grid;grid-template-columns:1fr auto;gap:.35rem;padding:.65rem .75rem;border:1px dashed color-mix(in srgb,canvastext 8%,transparent);border-radius:12px;background:color-mix(in srgb,canvas 96%,white 6%);box-shadow:0 6px 14px #0f172a0f;transition:transform .12s ease,box-shadow .12s ease,border-color .16s ease,background .16s ease;cursor:grab}.reference-item:active{cursor:grabbing}.reference-item:hover{transform:translateY(-1px);border-color:color-mix(in srgb,canvastext 16%,transparent);box-shadow:0 10px 24px #0f172a14}.reference-text{line-height:1.2;color:color-mix(in srgb,canvastext 90%,transparent);font-size:.8rem}.reference-meta{display:inline-flex;align-items:center;gap:.35rem}.reference-id{font-size:.8em;background:color-mix(in srgb,#2563eb 12%,transparent);border:1px solid color-mix(in srgb,#2563eb 18%,transparent);border-radius:999px;padding:.12em .55em;color:color-mix(in srgb,canvastext 80%,transparent);letter-spacing:.01em}.reference-drag{font-size:.7em;text-transform:uppercase;letter-spacing:.04em;color:color-mix(in srgb,canvastext 60%,transparent);background:color-mix(in srgb,canvas 92%,transparent);border:1px dashed color-mix(in srgb,canvastext 18%,transparent);border-radius:8px;padding:.2em .5em}.reference-highlight{border-color:color-mix(in srgb,#2563eb 45%,transparent);background:color-mix(in srgb,#eff6ff 70%,canvas 30%);box-shadow:0 10px 26px #2563eb26}.reference-empty{color:color-mix(in srgb,canvastext 70%,transparent);font-style:italic;border:1px dashed color-mix(in srgb,canvastext 14%,transparent);border-radius:10px;padding:.75rem;text-align:center}@media (prefers-color-scheme: dark){.reference-item{background:color-mix(in srgb,canvas 85%,#0f172a 20%);border-color:color-mix(in srgb,canvastext 22%,transparent);box-shadow:none}.reference-item:hover{border-color:color-mix(in srgb,canvastext 32%,transparent);box-shadow:0 8px 18px #0000004d}.reference-highlight{background:color-mix(in srgb,#1d4ed8 35%,canvas 65%)}.reference-id{background:color-mix(in srgb,#1d4ed8 22%,transparent);border-color:color-mix(in srgb,#1d4ed8 32%,transparent);color:color-mix(in srgb,canvastext 86%,transparent)}.reference-drag{background:color-mix(in srgb,canvas 75%,transparent);border-color:color-mix(in srgb,canvastext 24%,transparent)}}:host{display:block;color-scheme:light dark}.selection-editor-container{display:grid;gap:.75rem}.selection-editor-placeholder{margin:0;font-size:.85rem;color:color-mix(in srgb,canvastext 60%,transparent);font-style:italic}.selection-editor-field{display:grid;gap:.3rem}.selection-editor-label{font-size:.8rem;font-weight:600;color:color-mix(in srgb,canvastext 75%,transparent);text-transform:uppercase;letter-spacing:.03em}.selection-editor-value{font-family:SFMono-Regular,Consolas,Liberation Mono,Menlo,monospace;font-size:.85rem;background:#2563eb14;border-radius:4px;padding:.2rem .45rem;display:inline-block}.selection-editor-input{font-family:SFMono-Regular,Consolas,Liberation Mono,Menlo,monospace;font-size:.85rem;background:color-mix(in srgb,canvas 98%,white 2%);border:1px solid rgba(15,23,42,.16);border-radius:6px;padding:.4rem .6rem;max-width:calc(100% - .5rem);width:auto;min-width:0;color:color-mix(in srgb,canvastext 90%,transparent);transition:border-color .16s ease,background .16s ease}.selection-editor-input:focus{outline:none;border-color:#2563eb;background:color-mix(in srgb,canvas 99%,white 1%)}.selection-editor-input::placeholder{color:color-mix(in srgb,canvastext 50%,transparent);font-style:italic}.selection-editor-attrs{display:grid;gap:.6rem}.selection-editor-attr-field{display:grid;gap:.3rem}.selection-editor-attr-label{font-size:.75rem;font-weight:500;color:color-mix(in srgb,canvastext 70%,transparent);font-family:SFMono-Regular,Consolas,Liberation Mono,Menlo,monospace}.citation-source-adapter-root{display:flex;flex-direction:column;gap:.5rem}.citation-source-item{display:grid;grid-template-columns:minmax(9rem,1fr) minmax(9rem,1fr);gap:.35rem .75rem;padding:.5rem .6rem;margin-bottom:.5rem;background:color-mix(in srgb,canvas 96%,white 4%);border:1px solid rgba(15,23,42,.12);border-radius:6px;align-items:start}.citation-source-item:last-of-type{margin-bottom:0}.citation-source-field{display:flex;flex-direction:column;gap:.2rem;min-width:0}.citation-source-field .selection-editor-attr-label{font-size:.7rem}.citation-source-field .selection-editor-input{width:100%;padding:.25rem .4rem;font-size:.8rem;box-sizing:border-box}.citation-source-field input[type=checkbox]{width:auto;margin:0;align-self:flex-start}.citation-source-add,.citation-source-remove{font-size:.7rem;padding:.2rem .4rem;border-radius:4px;border:1px solid rgba(15,23,42,.2);background:color-mix(in srgb,canvas 95%,white 5%);cursor:pointer;margin-top:.15rem}.citation-source-add:hover,.citation-source-remove:hover{background:color-mix(in srgb,canvas 90%,white 10%)}.citation-source-add{margin-top:.25rem}
|
|
1
|
+
:host{display:block;color-scheme:light dark;font-family:var(--sciflow-editor-font-family, system-ui, sans-serif);color:var(--sciflow-editor-color, #0f172a);--sciflow-editor-background: #ffffff;--sciflow-editor-border: rgba(15, 23, 42, .14);--sciflow-editor-border-active: #2563eb;--sciflow-editor-focus-ring: rgba(37, 99, 235, .25);--sciflow-editor-citation-bg: rgba(15, 23, 42, .05);--sciflow-editor-citation-color: inherit;--sciflow-editor-selectednode: rgba(148, 163, 184, .6);--sciflow-editor-footnote-bg: rgba(15, 23, 42, .04)}.editor{border:1px solid var(--sciflow-editor-border);border-radius:0;padding:12px;min-height:200px;box-sizing:border-box;background:var(--sciflow-editor-background, #fff)}.editor:focus-within{border-color:var(--sciflow-editor-selectednode, var(--sciflow-editor-border-active));box-shadow:0 0 0 2px var(--sciflow-editor-selectednode, var(--sciflow-editor-focus-ring))}.ProseMirror{position:relative;word-wrap:break-word;white-space:pre-wrap;white-space:break-spaces;-webkit-font-variant-ligatures:none;font-variant-ligatures:none;font-feature-settings:"liga" 0;font-weight:lighter;outline:none;min-height:inherit;padding:calc(.75rem + 1.5em) 4rem .5rem 3.5rem;color:inherit;font-size:1rem;counter-reset:sciflow-footnote}.ProseMirror{line-height:1.6}.ProseMirror p{margin:0 0 .75rem}.ProseMirror h1,.ProseMirror h2,.ProseMirror h3,.ProseMirror h4,.ProseMirror h5,.ProseMirror h6{margin:1.25rem 0 .5rem;line-height:1.2;position:relative}.ProseMirror>h1:first-child,.ProseMirror>h2:first-child,.ProseMirror>h3:first-child,.ProseMirror>h4:first-child,.ProseMirror>h5:first-child,.ProseMirror>h6:first-child{margin-top:0}.ProseMirror table{width:100%;border-collapse:collapse;border-spacing:0;margin:1rem 0}.ProseMirror th,.ProseMirror td{padding:.5rem .75rem;border:1px solid color-mix(in srgb,currentColor 18%,transparent);vertical-align:top;box-sizing:border-box;position:relative}.ProseMirror .tableWrapper{overflow-x:auto}.ProseMirror td:not([data-colwidth]):not(.column-resize-dragging),.ProseMirror th:not([data-colwidth]):not(.column-resize-dragging){min-width:var(--default-cell-min-width, 80px)}.ProseMirror .column-resize-handle{position:absolute;right:-2px;top:0;bottom:0;width:4px;z-index:20;background-color:#adf;pointer-events:none}.ProseMirror.resize-cursor{cursor:ew-resize;cursor:col-resize}.ProseMirror .selectedCell:after{z-index:2;position:absolute;content:"";inset:0;background:#c8c8ff66;pointer-events:none}.ProseMirror p:only-child:last-child,.ProseMirror table p{margin:0}.ProseMirror img{max-width:100%;height:auto}.ProseMirror pre{white-space:pre-wrap}.ProseMirror cite{background:var(--sciflow-editor-citation-bg);color:var(--sciflow-editor-citation-color);padding:.1rem .35rem;border-radius:4px}.ProseMirror a[data-type=xref]{background:var(--sciflow-editor-citation-bg);color:var(--sciflow-editor-citation-color);padding:.1rem .35rem;border-radius:4px;text-decoration:none}.ProseMirror a[data-type=xref]:hover{text-decoration:underline}.ProseMirror img{max-width:40vw}.ProseMirror h1:before{content:"#";opacity:.5;font-size:.8rem;position:absolute;left:-2.5rem;top:60%;transform:translateY(-50%);padding-right:.5rem}.ProseMirror h1{font-size:1.33em;padding-top:.35em;font-weight:400}.ProseMirror h2{font-size:1.22em}.ProseMirror h2:before{content:"##";opacity:.5;font-size:.8rem;padding-right:.5rem;position:absolute;left:-2.5rem;top:50%;transform:translateY(-50%)}.ProseMirror h3:before{content:"###";opacity:.5;font-size:.8rem;padding-right:.5rem;position:absolute;left:-2.5rem;top:50%;transform:translateY(-50%)}.ProseMirror section{margin-top:2.5rem}.ProseMirror section:first-child{margin-top:.5rem}.ProseMirror h2{font-weight:400}.ProseMirror h3{font-size:1.17em;font-weight:400}.ProseMirror h4{font-size:1.11em;font-weight:400}.ProseMirror h5{font-size:1.06em;font-weight:400}.ProseMirror h6{font-size:1em;font-weight:700}.ProseMirror li{position:relative}.ProseMirror-hideselection *::selection{background:transparent}.ProseMirror-hideselection *::-moz-selection{background:transparent}.ProseMirror-hideselection{caret-color:transparent}.ProseMirror [draggable][contenteditable=false]{-webkit-user-select:text;user-select:text}.ProseMirror-selectednode{outline:2px solid var(--sciflow-editor-selectednode, var(--sciflow-editor-border-active, #2563eb));outline-offset:1px}cite.ProseMirror-selectednode{outline:none;box-shadow:0 0 0 2px var(--sciflow-editor-border-active, #2563eb)}span[data-type=footnote].ProseMirror-selectednode{outline:none;box-shadow:none}span[data-type=footnote].ProseMirror-selectednode .sciflow-footnote-body{border-color:var(--sciflow-editor-border-active, #2563eb)}a[data-type=xref].ProseMirror-selectednode{outline:none;box-shadow:0 0 0 2px var(--sciflow-editor-selectednode, var(--sciflow-editor-border-active, #2563eb))}li.ProseMirror-selectednode{outline:none}li.ProseMirror-selectednode:after{content:"";position:absolute;inset:-2px -2px -2px -32px;border:2px solid var(--sciflow-editor-selectednode, var(--sciflow-editor-border-active, #2563eb));pointer-events:none}img.ProseMirror-separator{display:inline!important;border:none!important;margin:0!important}@media(prefers-color-scheme:dark){:host{color:var(--sciflow-editor-color, #e2e8f0);--sciflow-editor-background: #0f172a;--sciflow-editor-border: rgba(148, 163, 184, .35);--sciflow-editor-border-active: #3b82f6;--sciflow-editor-focus-ring: rgba(59, 130, 246, .35);--sciflow-editor-citation-bg: rgba(148, 163, 184, .2);--sciflow-editor-citation-color: #e2e8f0;--sciflow-editor-footnote-bg: rgba(148, 163, 184, .12)}.ProseMirror h1,.ProseMirror h2,.ProseMirror h3,.ProseMirror h4,.ProseMirror h5,.ProseMirror h6{color:inherit}:host{--sciflow-editor-selectednode: rgba(148, 163, 184, .6)}.ProseMirror-selectednode{outline-color:var(--sciflow-editor-selectednode)}a[data-type=xref].ProseMirror-selectednode{box-shadow:0 0 0 2px var(--sciflow-editor-selectednode)}}:host{display:inline-flex;gap:6px;align-items:center;color-scheme:light dark;border:1px solid var(--sciflow-formatbar-border, rgba(15, 23, 42, .05));border-radius:6px;padding:3px;background:var(--sciflow-formatbar-background, #f8fafc);box-shadow:var(--sciflow-formatbar-shadow, none);font-family:inherit;font-size:.8rem;overflow:visible}.style-select{display:inline-flex;align-items:center;min-height:30px;border:none;border-radius:5px;background:var(--sciflow-formatbar-select-background, white);color:var(--sciflow-formatbar-select-color, #1f2937);font:inherit;padding:0 8px;cursor:pointer;transition:border-color .15s ease,box-shadow .15s ease}.style-select:focus-visible{outline:2px solid var(--sciflow-formatbar-select-focus, rgba(37, 99, 235, .4));outline-offset:1px}.style-select:disabled{cursor:not-allowed;color:var(--sciflow-formatbar-button-disabled, rgba(15, 23, 42, .38));border-color:var(--sciflow-formatbar-select-border-disabled, rgba(15, 23, 42, .12));background:var(--sciflow-formatbar-select-background-disabled, #f1f5f9)}.history-commands{display:inline-flex;align-items:center;gap:2px;margin-left:3px;padding-left:3px;border-left:1px solid var(--sciflow-formatbar-border, rgba(15, 23, 42, .12))}button{appearance:none;border:none;background:transparent;border-radius:5px;padding:5px;font:inherit;line-height:1;cursor:pointer;color:var(--sciflow-formatbar-button-color, #1f2937);transition:background .15s ease,color .15s ease;display:inline-flex;align-items:center;justify-content:center;min-width:30px;min-height:30px}button:hover:not(:disabled),button:focus-visible:not(:disabled){background:var(--sciflow-formatbar-button-hover, rgba(37, 99, 235, .12));outline:none}button:disabled{cursor:not-allowed;color:var(--sciflow-formatbar-button-disabled, rgba(15, 23, 42, .38))}button.active{background:var(--sciflow-formatbar-button-active-background, rgba(37, 99, 235, .12));color:var(--sciflow-formatbar-button-active, #1d4ed8)}button[data-tooltip]{position:relative;z-index:0}button[data-tooltip]:hover,button[data-tooltip]:focus-visible{z-index:1}button[data-tooltip]:after{content:attr(data-tooltip);position:absolute;top:calc(100% + 6px);left:50%;transform:translate(-50%);background:#0f172ae6;color:#fff;padding:5px 6px;border-radius:5px;font-size:11px;line-height:1.2;white-space:nowrap;opacity:0;pointer-events:none;transition:opacity .15s ease;z-index:10}button[data-tooltip]:hover:after,button[data-tooltip]:focus-visible:after{opacity:1}.material-symbols-rounded{font-family:Material Symbols Rounded;font-variation-settings:"FILL" var(--sciflow-formatbar-button-fill, 0),"wght" var(--sciflow-formatbar-button-weight, 400),"GRAD" 0,"opsz" 20;font-size:18px;line-height:1}.command-rows{display:flex;flex-direction:column;gap:2px;align-items:center}.command-row{display:flex;flex-wrap:wrap;gap:2px;align-items:center}.command-row--primary{width:100%;justify-content:flex-start}@keyframes format-bar-row-in{0%{opacity:0;transform:translateY(-4px)}to{opacity:1;transform:translateY(0)}}.table-commands{display:inline-flex;flex-wrap:wrap;gap:2px;align-items:center}.table-commands.table-tools-expanded{animation:format-bar-row-in .22s ease-out}.table-commands--with-separator{margin-left:3px;padding-left:3px;border-left:1px solid var(--sciflow-formatbar-border, rgba(15, 23, 42, .12))}.command-rows--table-expanded .command-row--primary,.command-row--table{justify-content:center}.command-row--table{width:100%}@media(prefers-color-scheme:dark){:host{--sciflow-formatbar-border: rgba(148, 163, 184, .3);--sciflow-formatbar-background: rgba(15, 23, 42, .65);--sciflow-formatbar-shadow: none;--sciflow-formatbar-select-background: rgba(30, 41, 59, .8);--sciflow-formatbar-select-color: #e2e8f0;--sciflow-formatbar-button-color: #e2e8f0;--sciflow-formatbar-button-hover: rgba(59, 130, 246, .25);--sciflow-formatbar-button-active-background: rgba(96, 165, 250, .2);--sciflow-formatbar-button-active: #93c5fd;--sciflow-formatbar-button-disabled: rgba(148, 163, 184, .45);--sciflow-formatbar-select-background-disabled: rgba(30, 41, 59, .6)}}:host{display:block;color:inherit;font:inherit}:host([hidden]){display:none}.outline-list{list-style:none;padding:0;margin:0;display:grid;gap:.6rem}.outline-item{padding:.35rem .5rem .35rem .75rem;border-left:2px solid rgba(37,99,235,.18);border-radius:8px;display:grid;gap:.15rem;transition:background .16s ease,border-color .16s ease,color .16s ease}.outline-item[role=button]{cursor:pointer}.outline-item[role=button]:hover{background:color-mix(in srgb,rgba(37,99,235,.12) 60%,transparent);border-left-color:#2563eb73}.outline-item:focus-visible{outline:2px solid #2563eb;outline-offset:2px}.outline-item--active{background:color-mix(in srgb,rgba(37,99,235,.14) 70%,transparent);border-left-color:#2563ebbf}.outline-text{font-weight:600;color:color-mix(in srgb,canvastext 85%,#0f172a 10%)}.outline-meta{font-size:.78rem;color:color-mix(in srgb,canvastext 60%,#0f172a 15%);display:inline-flex;align-items:center;gap:.35rem;flex-wrap:wrap}.outline-id{background:#2563eb14;color:inherit;border-radius:4px;padding:.12em .4em;font-size:.9em}.outline-item.level-2{padding-left:1.5rem;border-left-style:dotted}.outline-item.level-3{padding-left:2.25rem;border-left-style:dotted;border-left-color:#2563eb1f}.outline-placeholder{color:color-mix(in srgb,canvastext 60%,#0f172a 10%);padding-left:.25rem}.outline-drag{font-size:.7rem;opacity:.6;text-transform:uppercase;-webkit-user-select:none;user-select:none}.outline-item[draggable=true]{cursor:grab}.outline-item[draggable=true]:active{cursor:grabbing}.outline-item--figure{border-left-color:#22c55e4d}:host{display:block;color-scheme:light dark;font-family:inherit}.reference-list{list-style:none;margin:0;padding:0;display:grid;gap:.6rem}.reference-item{display:grid;grid-template-columns:1fr auto;gap:.35rem;padding:.65rem .75rem;border:1px dashed color-mix(in srgb,canvastext 8%,transparent);border-radius:12px;background:color-mix(in srgb,canvas 96%,white 6%);box-shadow:0 6px 14px #0f172a0f;transition:transform .12s ease,box-shadow .12s ease,border-color .16s ease,background .16s ease;cursor:grab}.reference-item:active{cursor:grabbing}.reference-item:hover{transform:translateY(-1px);border-color:color-mix(in srgb,canvastext 16%,transparent);box-shadow:0 10px 24px #0f172a14}.reference-text{line-height:1.2;color:color-mix(in srgb,canvastext 90%,transparent);font-size:.8rem}.reference-meta{display:inline-flex;align-items:center;gap:.35rem}.reference-id{font-size:.8em;background:color-mix(in srgb,#2563eb 12%,transparent);border:1px solid color-mix(in srgb,#2563eb 18%,transparent);border-radius:999px;padding:.12em .55em;color:color-mix(in srgb,canvastext 80%,transparent);letter-spacing:.01em}.reference-drag{font-size:.7em;text-transform:uppercase;letter-spacing:.04em;color:color-mix(in srgb,canvastext 60%,transparent);background:color-mix(in srgb,canvas 92%,transparent);border:1px dashed color-mix(in srgb,canvastext 18%,transparent);border-radius:8px;padding:.2em .5em}.reference-highlight{border-color:color-mix(in srgb,#2563eb 45%,transparent);background:color-mix(in srgb,#eff6ff 70%,canvas 30%);box-shadow:0 10px 26px #2563eb26}.reference-empty{color:color-mix(in srgb,canvastext 70%,transparent);font-style:italic;border:1px dashed color-mix(in srgb,canvastext 14%,transparent);border-radius:10px;padding:.75rem;text-align:center}@media(prefers-color-scheme:dark){.reference-item{background:color-mix(in srgb,canvas 85%,#0f172a 20%);border-color:color-mix(in srgb,canvastext 22%,transparent);box-shadow:none}.reference-item:hover{border-color:color-mix(in srgb,canvastext 32%,transparent);box-shadow:0 8px 18px #0000004d}.reference-highlight{background:color-mix(in srgb,#1d4ed8 35%,canvas 65%)}.reference-id{background:color-mix(in srgb,#1d4ed8 22%,transparent);border-color:color-mix(in srgb,#1d4ed8 32%,transparent);color:color-mix(in srgb,canvastext 86%,transparent)}.reference-drag{background:color-mix(in srgb,canvas 75%,transparent);border-color:color-mix(in srgb,canvastext 24%,transparent)}}:host{display:block;color-scheme:light dark}.selection-editor-container{display:grid;gap:.75rem}.selection-editor-placeholder{margin:0;font-size:.85rem;color:color-mix(in srgb,canvastext 60%,transparent);font-style:italic}.selection-editor-field{display:grid;gap:.3rem}.selection-editor-controls{display:flex;justify-content:flex-end;align-items:center;gap:.5rem}.selection-editor-label{font-size:.8rem;font-weight:600;color:color-mix(in srgb,canvastext 75%,transparent);text-transform:uppercase;letter-spacing:.03em}.selection-editor-value{font-family:SFMono-Regular,Consolas,Liberation Mono,Menlo,monospace;font-size:.85rem;background:#2563eb14;border-radius:4px;padding:.2rem .45rem;display:inline-block}.selection-editor-input{font-family:SFMono-Regular,Consolas,Liberation Mono,Menlo,monospace;font-size:.85rem;background:color-mix(in srgb,canvas 98%,white 2%);border:1px solid rgba(15,23,42,.16);border-radius:6px;padding:.4rem .6rem;max-width:calc(100% - .5rem);width:auto;min-width:0;color:color-mix(in srgb,canvastext 90%,transparent);transition:border-color .16s ease,background .16s ease}.selection-editor-input:focus{outline:none;border-color:#2563eb;background:color-mix(in srgb,canvas 99%,white 1%)}.selection-editor-input:has(.ProseMirror){border-width:2px;border-color:light-dark(#2563eb,#3b82f6)}.selection-editor-input::placeholder{color:color-mix(in srgb,canvastext 50%,transparent);font-style:italic}.selection-editor-attrs{display:grid;gap:.6rem}.selection-editor-details{margin-top:.5rem;border:none}.selection-editor-details-summary{font-size:.8rem;font-weight:500;color:color-mix(in srgb,canvastext 65%,transparent);cursor:pointer;list-style:none;-webkit-user-select:none;user-select:none}.selection-editor-details-summary::-webkit-details-marker{display:none}.selection-editor-details-summary:before{content:"▸ ";display:inline-block;margin-right:.25rem;transition:transform .15s ease}.selection-editor-details[open] .selection-editor-details-summary:before{transform:rotate(90deg)}.selection-editor-details-body{display:grid;gap:.6rem;margin-top:.6rem;padding-left:.25rem}.selection-editor-attr-field{display:grid;gap:.3rem}.selection-editor-attr-label{font-size:.75rem;font-weight:500;color:color-mix(in srgb,canvastext 70%,transparent);font-family:SFMono-Regular,Consolas,Liberation Mono,Menlo,monospace}.citation-source-adapter-root{display:flex;flex-direction:column;gap:.75rem}.citation-source-item{display:flex;flex-direction:column;gap:.75rem;padding:.75rem .85rem;margin-bottom:.5rem;background:color-mix(in srgb,canvas 96%,white 4%);border:1px solid rgba(15,23,42,.12);border-radius:6px}.citation-source-item:last-of-type{margin-bottom:0}.citation-source-details{margin-top:.25rem;border:none}.citation-source-details-summary{font-size:.8rem;font-weight:500;color:color-mix(in srgb,canvastext 65%,transparent);cursor:pointer;list-style:none;-webkit-user-select:none;user-select:none}.citation-source-details-summary::-webkit-details-marker{display:none}.citation-source-details-summary:before{content:"▸ ";display:inline-block;margin-right:.25rem;transition:transform .15s ease}.citation-source-details[open] .citation-source-details-summary:before{transform:rotate(90deg)}.citation-source-details-body{display:flex;flex-direction:column;gap:.75rem;margin-top:.6rem;padding-left:.25rem}.citation-source-field{display:flex;flex-direction:column;gap:.35rem;min-width:0}.citation-source-field--checkbox{flex-direction:row;align-items:center;gap:.5rem}.citation-source-field--checkbox .selection-editor-attr-label{flex:0 0 auto}.citation-source-field .selection-editor-attr-label{font-size:.8rem;white-space:nowrap;overflow:visible}.citation-source-field .selection-editor-input{width:100%;min-height:2.25rem;padding:.45rem .65rem;font-size:.9rem;box-sizing:border-box}.citation-source-field--checkbox .selection-editor-input{width:auto;min-height:auto;margin:0;flex-shrink:0}.citation-source-field input[type=checkbox]{width:1.125rem;height:1.125rem;margin:0;cursor:pointer}.citation-source-add,.citation-source-remove{font-size:.7rem;padding:.2rem .4rem;border-radius:4px;border:1px solid rgba(15,23,42,.2);background:color-mix(in srgb,canvas 95%,white 5%);cursor:pointer;margin-top:.15rem}.citation-source-add:hover,.citation-source-remove:hover{background:color-mix(in srgb,canvas 90%,white 10%)}.citation-source-add{margin-top:.25rem}.selection-editor-textarea{font-family:SFMono-Regular,Consolas,Liberation Mono,Menlo,monospace;font-size:.85rem;background:color-mix(in srgb,canvas 98%,white 2%);border:1px solid rgba(15,23,42,.16);border-radius:6px;padding:.4rem .6rem;width:100%;min-height:5rem;resize:vertical;color:color-mix(in srgb,canvastext 90%,transparent);box-sizing:border-box}.selection-editor-textarea:focus{outline:none;border-color:#2563eb}.selection-editor-math-preview{min-height:2.5rem;padding:.5rem;background:color-mix(in srgb,canvas 96%,white 4%);border:1px solid rgba(15,23,42,.12);border-radius:6px;overflow:auto}.selection-editor-math-preview:empty:before{content:"Preview updates as you type";font-style:italic;color:color-mix(in srgb,canvastext 50%,transparent)}.selection-editor-math-error{margin:.35rem 0 0;font-size:.8rem;color:#b91c1c;font-family:ui-monospace,monospace}.selection-editor-math-warnings{margin:.35rem 0 0;font-size:.8rem;color:color-mix(in srgb,canvastext 65%,transparent)}.selection-editor-math-actions{display:flex;flex-wrap:wrap;align-items:center;gap:.5rem}.selection-editor-button{font-size:.85rem;padding:.4rem .75rem;border-radius:6px;border:1px solid rgba(15,23,42,.2);background:color-mix(in srgb,canvas 95%,white 5%);cursor:pointer;color:inherit}.selection-editor-button--secondary{font-size:.75rem;padding:.25rem .55rem}.selection-editor-button:hover{background:color-mix(in srgb,canvas 90%,white 10%)}.selection-editor-button--primary{background:#2563eb;border-color:#2563eb;color:#fff}.selection-editor-button--primary:hover{background:#1d4ed8}.selection-editor-actions{display:flex;flex-wrap:wrap;align-items:center;gap:.5rem;margin-top:.25rem}.selection-editor-hint,.selection-editor-math-hint{font-size:.75rem;color:color-mix(in srgb,canvastext 55%,transparent)}.selection-editor-math-docs{margin:.5rem 0 0;font-size:.75rem}.selection-editor-math-docs-link{color:color-mix(in srgb,canvastext 60%,transparent);text-decoration:none}.selection-editor-math-docs-link:hover{text-decoration:underline}.selection-editor-citation .selection-editor-citation-content{width:100%;box-sizing:border-box}.selection-editor-citation .selection-editor-field{gap:.4rem}.selection-editor-citation-pm{min-height:2.75rem}.selection-editor-citation-pm .ProseMirror{min-height:2.25rem;padding:.5rem .7rem;font-size:.9rem;outline:none}.selection-editor-citation-pm .ProseMirror p{margin:0}.selection-editor-citation-actions{display:flex;flex-wrap:wrap;align-items:center;gap:.5rem}.selection-editor-citation-hint{font-size:.75rem;color:color-mix(in srgb,canvastext 55%,transparent)}@media(prefers-color-scheme:dark){.selection-editor-value{background:#3b82f633}.selection-editor-input{background:color-mix(in srgb,canvas 94%,black 6%);border-color:#94a3b859}.selection-editor-input:focus{background:color-mix(in srgb,canvas 92%,black 8%)}.selection-editor-textarea{background:color-mix(in srgb,canvas 94%,black 6%);border-color:#94a3b859}.citation-source-item{background:color-mix(in srgb,canvas 94%,black 6%);border-color:#94a3b84d}.citation-source-add,.citation-source-remove,.selection-editor-button{border-color:#94a3b859;background:color-mix(in srgb,canvas 90%,black 10%)}.citation-source-add:hover,.citation-source-remove:hover,.selection-editor-button:hover{background:color-mix(in srgb,canvas 85%,black 15%)}.selection-editor-math-preview{background:color-mix(in srgb,canvas 94%,black 6%);border-color:#94a3b84d}.selection-editor-math-error{color:#fca5a5}}
|