@signal9/era-ui 12.1.2 → 13.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/dev/audit-overlay.svelte +1 -1
- package/dist/docs/css-utilities.js +6 -1
- package/dist/docs/notes.md +12 -11
- package/dist/era-ui.css +1 -1
- package/dist/generated-docs/badge.md +3 -0
- package/dist/generated-docs/button.md +4 -0
- package/dist/generated-docs/chip.md +3 -0
- package/dist/generated-docs/llms-full.txt +53 -31
- package/dist/generated-docs/llms.txt +1 -1
- package/dist/generated-docs/manifest.json +17 -17
- package/dist/generated-docs/notes.md +12 -11
- package/dist/generated-docs/utilities.json +10 -10
- package/dist/generated-docs/utilities.md +30 -19
- package/dist/os/index.d.ts +0 -1
- package/dist/os/index.js +0 -1
- package/dist/os/notification-center.svelte +1 -2
- package/dist/os/taskbar.svelte +2 -3
- package/dist/os/toaster.svelte +2 -3
- package/dist/styles/index.css +77 -12
- package/dist/styles/layers.css +48 -0
- package/dist/styles/surfaces/base.css +4 -2
- package/dist/styles/surfaces/glass.css +0 -13
- package/dist/theme/index.d.ts +87 -0
- package/dist/theme/index.js +86 -0
- package/dist/ui/alert-dialog/alert-dialog-content.svelte +2 -2
- package/dist/ui/alert-dialog/alert-dialog-overlay.svelte +1 -1
- package/dist/ui/badge/badge.svelte +14 -1
- package/dist/ui/badge/badge.svelte.d.ts +4 -0
- package/dist/ui/button/button.svelte +37 -7
- package/dist/ui/button/button.svelte.d.ts +6 -0
- package/dist/ui/chip/chip.svelte +14 -1
- package/dist/ui/chip/chip.svelte.d.ts +4 -0
- package/dist/ui/combobox/combobox-content.svelte +1 -1
- package/dist/ui/command-bar/command-bar.svelte +1 -1
- package/dist/ui/context-menu/context-menu-content.svelte +1 -1
- package/dist/ui/context-menu/context-menu-sub-content.svelte +1 -1
- package/dist/ui/date-picker/date-picker-content.svelte +1 -1
- package/dist/ui/date-range-picker/date-range-picker-content.svelte +1 -1
- package/dist/ui/dialog/dialog-content.svelte +1 -1
- package/dist/ui/dialog/dialog-overlay.svelte +5 -1
- package/dist/ui/dropdown-menu/dropdown-menu-content.svelte +1 -1
- package/dist/ui/dropdown-menu/dropdown-menu-sub-content.svelte +1 -1
- package/dist/ui/link-preview/link-preview-content.svelte +1 -1
- package/dist/ui/menubar/menubar-content.svelte +1 -1
- package/dist/ui/menubar/menubar-sub-content.svelte +1 -1
- package/dist/ui/popover/popover-content.svelte +1 -1
- package/dist/ui/select/select-content.svelte +1 -1
- package/dist/ui/sheet/sheet-content.svelte +1 -1
- package/dist/ui/sheet/sheet-content.svelte.d.ts +1 -1
- package/dist/ui/tooltip/tooltip-content.svelte +1 -1
- package/package.json +9 -12
- package/dist/apps/index.d.ts +0 -20
- package/dist/apps/index.js +0 -20
- package/dist/apps/llm-shell/index.d.ts +0 -2
- package/dist/apps/llm-shell/index.js +0 -1
- package/dist/apps/llm-shell/llm-shell.svelte +0 -334
- package/dist/apps/llm-shell/llm-shell.svelte.d.ts +0 -57
- package/dist/apps/llm-shell/llm-swarm.svelte +0 -79
- package/dist/apps/llm-shell/llm-swarm.svelte.d.ts +0 -25
- package/dist/apps/llm-shell/types.d.ts +0 -103
- package/dist/apps/llm-shell/types.js +0 -1
- package/dist/apps/notes/editor/bubble-menu.svelte.d.ts +0 -11
- package/dist/apps/notes/editor/bubble-menu.svelte.js +0 -165
- package/dist/apps/notes/editor/bubble-toolbar.svelte +0 -55
- package/dist/apps/notes/editor/bubble-toolbar.svelte.d.ts +0 -22
- package/dist/apps/notes/editor/extensions.d.ts +0 -18
- package/dist/apps/notes/editor/extensions.js +0 -88
- package/dist/apps/notes/editor/floating.d.ts +0 -25
- package/dist/apps/notes/editor/floating.js +0 -54
- package/dist/apps/notes/editor/link.d.ts +0 -9
- package/dist/apps/notes/editor/link.js +0 -22
- package/dist/apps/notes/editor/list-cleanup-rule.d.ts +0 -14
- package/dist/apps/notes/editor/list-cleanup-rule.js +0 -47
- package/dist/apps/notes/editor/slash-command.svelte.d.ts +0 -22
- package/dist/apps/notes/editor/slash-command.svelte.js +0 -215
- package/dist/apps/notes/editor/slash-menu.svelte +0 -82
- package/dist/apps/notes/editor/slash-menu.svelte.d.ts +0 -23
- package/dist/apps/notes/index.d.ts +0 -11
- package/dist/apps/notes/index.js +0 -13
- package/dist/apps/notes/markdown.d.ts +0 -12
- package/dist/apps/notes/markdown.js +0 -165
- package/dist/apps/notes/note-editor.svelte +0 -176
- package/dist/apps/notes/note-editor.svelte.d.ts +0 -36
- package/dist/apps/notes/notes-store.svelte.d.ts +0 -64
- package/dist/apps/notes/notes-store.svelte.js +0 -234
- package/dist/apps/notes/notes.svelte +0 -501
- package/dist/apps/notes/notes.svelte.d.ts +0 -53
- package/dist/apps/notes/tree.d.ts +0 -70
- package/dist/apps/notes/tree.js +0 -185
- package/dist/apps/notes/types.d.ts +0 -49
- package/dist/apps/notes/types.js +0 -11
- package/dist/os/layers.d.ts +0 -23
- package/dist/os/layers.js +0 -23
package/dist/apps/notes/tree.js
DELETED
|
@@ -1,185 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Notes tree index — a hierarchical table of contents built by walking a
|
|
3
|
-
* TipTap document's heading structure.
|
|
4
|
-
*
|
|
5
|
-
* This is the retrieval half of the app. Instead of embedding notes and
|
|
6
|
-
* hoping vector similarity lands on the right paragraph, a model is handed
|
|
7
|
-
* `treeToText(tree)` as a table of contents and reasons about which section to
|
|
8
|
-
* open — then `extractSection()` returns just that slice, structure intact
|
|
9
|
-
* (PageIndex-style reasoning-based retrieval).
|
|
10
|
-
*
|
|
11
|
-
* Nothing here touches the editor or the DOM: it operates on stored documents,
|
|
12
|
-
* so it is equally usable from a tool handler, a worker, or a build step.
|
|
13
|
-
*/
|
|
14
|
-
import { textContent, tiptapToMarkdown } from './markdown.js';
|
|
15
|
-
function countWords(text) {
|
|
16
|
-
return text.trim().split(/\s+/).filter(Boolean).length;
|
|
17
|
-
}
|
|
18
|
-
/** Build a tree for one note's document. */
|
|
19
|
-
export function buildNoteTree(noteId, title, doc) {
|
|
20
|
-
const root = { title, noteId, level: 1, wordCount: 0, children: [] };
|
|
21
|
-
if (!doc.content || doc.content.length === 0)
|
|
22
|
-
return root;
|
|
23
|
-
const stack = [root];
|
|
24
|
-
let currentText = '';
|
|
25
|
-
for (const node of doc.content) {
|
|
26
|
-
if (node.type === 'heading' && node.attrs?.level) {
|
|
27
|
-
// Text seen since the last heading belongs to the section we're leaving.
|
|
28
|
-
if (currentText.trim()) {
|
|
29
|
-
stack[stack.length - 1].wordCount += countWords(currentText);
|
|
30
|
-
currentText = '';
|
|
31
|
-
}
|
|
32
|
-
const headingLevel = node.attrs.level;
|
|
33
|
-
const treeLevel = headingLevel + 1; // note=1, H1=2, H2=3, H3=4
|
|
34
|
-
const headingNode = {
|
|
35
|
-
title: textContent(node),
|
|
36
|
-
headingId: node.attrs?.id ?? undefined,
|
|
37
|
-
level: treeLevel,
|
|
38
|
-
wordCount: 0,
|
|
39
|
-
children: []
|
|
40
|
-
};
|
|
41
|
-
// The parent is the deepest node still shallower than this heading.
|
|
42
|
-
while (stack.length > 1 && stack[stack.length - 1].level >= treeLevel) {
|
|
43
|
-
stack.pop();
|
|
44
|
-
}
|
|
45
|
-
stack[stack.length - 1].children.push(headingNode);
|
|
46
|
-
stack.push(headingNode);
|
|
47
|
-
}
|
|
48
|
-
else {
|
|
49
|
-
currentText += textContent(node) + ' ';
|
|
50
|
-
}
|
|
51
|
-
}
|
|
52
|
-
if (currentText.trim()) {
|
|
53
|
-
stack[stack.length - 1].wordCount += countWords(currentText);
|
|
54
|
-
}
|
|
55
|
-
// A note with no headings at all is one flat section.
|
|
56
|
-
if (root.children.length === 0 && root.wordCount === 0) {
|
|
57
|
-
root.wordCount = countWords(doc.content.map(textContent).join(' '));
|
|
58
|
-
}
|
|
59
|
-
return root;
|
|
60
|
-
}
|
|
61
|
-
/** Combine every note into one index tree. */
|
|
62
|
-
export function buildGlobalTree(notes) {
|
|
63
|
-
return {
|
|
64
|
-
title: 'Notes Index',
|
|
65
|
-
level: 0,
|
|
66
|
-
wordCount: 0,
|
|
67
|
-
children: notes.map((n) => buildNoteTree(n.id, n.title, n.content))
|
|
68
|
-
};
|
|
69
|
-
}
|
|
70
|
-
/** Node count below (and including) this node. */
|
|
71
|
-
export function countNodes(node) {
|
|
72
|
-
return 1 + node.children.reduce((sum, c) => sum + countNodes(c), 0);
|
|
73
|
-
}
|
|
74
|
-
/** Total words in this subtree. */
|
|
75
|
-
export function totalWords(node) {
|
|
76
|
-
return node.wordCount + node.children.reduce((sum, c) => sum + totalWords(c), 0);
|
|
77
|
-
}
|
|
78
|
-
/**
|
|
79
|
-
* Render the tree as YAML-shaped key/value text for a model to read.
|
|
80
|
-
*
|
|
81
|
-
* YAML-style indented pairs beat JSON on nested data in the 2025 retrieval
|
|
82
|
-
* benchmarks, and the labelled fields (`id`, `hid`) are copy-pasteable straight
|
|
83
|
-
* back into a `get(id)` / `extractSection(noteId, headingId)` call, which is
|
|
84
|
-
* the whole point of handing over a TOC.
|
|
85
|
-
*/
|
|
86
|
-
export function treeToText(tree) {
|
|
87
|
-
if (tree.children.length === 0)
|
|
88
|
-
return '(no notes)';
|
|
89
|
-
const blocks = [];
|
|
90
|
-
for (const note of tree.children) {
|
|
91
|
-
const noteWords = totalWords(note);
|
|
92
|
-
const lines = [
|
|
93
|
-
`- title: ${note.title || 'Untitled'}`,
|
|
94
|
-
` id: ${note.noteId ?? '?'}`,
|
|
95
|
-
` words: ${noteWords}`
|
|
96
|
-
];
|
|
97
|
-
if (note.children.length > 0) {
|
|
98
|
-
lines.push(' sections:');
|
|
99
|
-
renderSections(note.children, lines, 2);
|
|
100
|
-
}
|
|
101
|
-
blocks.push(lines.join('\n'));
|
|
102
|
-
}
|
|
103
|
-
return blocks.join('\n');
|
|
104
|
-
}
|
|
105
|
-
function renderSections(nodes, lines, depth) {
|
|
106
|
-
const indent = ' '.repeat(depth);
|
|
107
|
-
for (const node of nodes) {
|
|
108
|
-
const shortId = node.headingId ? node.headingId.slice(0, 8) : '';
|
|
109
|
-
lines.push(`${indent}- title: ${node.title || 'Untitled'}`);
|
|
110
|
-
if (shortId)
|
|
111
|
-
lines.push(`${indent} hid: ${shortId}`);
|
|
112
|
-
if (node.wordCount > 0)
|
|
113
|
-
lines.push(`${indent} words: ${node.wordCount}`);
|
|
114
|
-
if (node.children.length > 0) {
|
|
115
|
-
lines.push(`${indent} sections:`);
|
|
116
|
-
renderSections(node.children, lines, depth + 1);
|
|
117
|
-
}
|
|
118
|
-
}
|
|
119
|
-
}
|
|
120
|
-
function isHeading(node) {
|
|
121
|
-
return node.type === 'heading' && typeof node.attrs?.level === 'number';
|
|
122
|
-
}
|
|
123
|
-
function updateBreadcrumb(stack, title, level) {
|
|
124
|
-
while (stack.length > 1 && stack[stack.length - 1].level >= level) {
|
|
125
|
-
stack.pop();
|
|
126
|
-
}
|
|
127
|
-
stack.push({ title, level });
|
|
128
|
-
}
|
|
129
|
-
/**
|
|
130
|
-
* The raw nodes of one section: everything between the target heading and the
|
|
131
|
-
* next heading of the same or a higher level, plus the breadcrumb that led to
|
|
132
|
-
* it. Callers pick their own serialisation.
|
|
133
|
-
*/
|
|
134
|
-
export function extractSectionNodes(noteTitle, doc, targetHeadingId) {
|
|
135
|
-
if (!doc.content)
|
|
136
|
-
return null;
|
|
137
|
-
const headingStack = [{ title: noteTitle, level: 0 }];
|
|
138
|
-
let startIdx = -1;
|
|
139
|
-
let targetLevel = 0;
|
|
140
|
-
for (let i = 0; i < doc.content.length; i++) {
|
|
141
|
-
const node = doc.content[i];
|
|
142
|
-
if (!isHeading(node))
|
|
143
|
-
continue;
|
|
144
|
-
updateBreadcrumb(headingStack, textContent(node), node.attrs.level);
|
|
145
|
-
const headingId = node.attrs?.id;
|
|
146
|
-
if (!headingId)
|
|
147
|
-
continue;
|
|
148
|
-
// `treeToText` emits 8-char prefixes, so accept a prefix as well as the
|
|
149
|
-
// full id — otherwise a model copying from the TOC never matches.
|
|
150
|
-
if (headingId === targetHeadingId || headingId.startsWith(targetHeadingId)) {
|
|
151
|
-
startIdx = i + 1;
|
|
152
|
-
targetLevel = node.attrs.level;
|
|
153
|
-
break;
|
|
154
|
-
}
|
|
155
|
-
}
|
|
156
|
-
if (startIdx < 0)
|
|
157
|
-
return null;
|
|
158
|
-
const headingPath = headingStack.map((h) => h.title).join(' > ');
|
|
159
|
-
const nodes = [];
|
|
160
|
-
for (let i = startIdx; i < doc.content.length; i++) {
|
|
161
|
-
const node = doc.content[i];
|
|
162
|
-
if (isHeading(node) && node.attrs.level <= targetLevel)
|
|
163
|
-
break;
|
|
164
|
-
nodes.push(node);
|
|
165
|
-
}
|
|
166
|
-
return { headingPath, nodes };
|
|
167
|
-
}
|
|
168
|
-
/**
|
|
169
|
-
* One section, serialised to markdown.
|
|
170
|
-
*
|
|
171
|
-
* Markdown rather than flattened text on purpose: plain-text extraction garbles
|
|
172
|
-
* lists, tables, and code blocks, which is exactly the structure a model needs
|
|
173
|
-
* to answer from a retrieved section.
|
|
174
|
-
*/
|
|
175
|
-
export function extractSection(noteTitle, doc, targetHeadingId) {
|
|
176
|
-
const section = extractSectionNodes(noteTitle, doc, targetHeadingId);
|
|
177
|
-
if (!section)
|
|
178
|
-
return null;
|
|
179
|
-
const content = tiptapToMarkdown({ type: 'doc', content: section.nodes }).trim();
|
|
180
|
-
return {
|
|
181
|
-
headingPath: section.headingPath,
|
|
182
|
-
content,
|
|
183
|
-
wordCount: countWords(content)
|
|
184
|
-
};
|
|
185
|
-
}
|
|
@@ -1,49 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* The Notes document model.
|
|
3
|
-
*
|
|
4
|
-
* TipTap's own `JSONContent` is deliberately loose (every field optional), so
|
|
5
|
-
* the app carries its own narrowed shapes: a `doc` always has `content`, and a
|
|
6
|
-
* `Note` always has the fields the list and the editor read. Nothing here
|
|
7
|
-
* imports from `@tiptap/*` — the model is the persistence contract, and a
|
|
8
|
-
* consumer storing notes server-side should be able to type its API against it
|
|
9
|
-
* without pulling the editor in.
|
|
10
|
-
*/
|
|
11
|
-
export interface TiptapMark {
|
|
12
|
-
type: string;
|
|
13
|
-
attrs?: Record<string, unknown>;
|
|
14
|
-
}
|
|
15
|
-
export interface TiptapNode {
|
|
16
|
-
type: string;
|
|
17
|
-
attrs?: Record<string, unknown>;
|
|
18
|
-
marks?: TiptapMark[];
|
|
19
|
-
content?: TiptapNode[];
|
|
20
|
-
text?: string;
|
|
21
|
-
}
|
|
22
|
-
export interface TiptapDocument {
|
|
23
|
-
type: 'doc';
|
|
24
|
-
content: TiptapNode[];
|
|
25
|
-
}
|
|
26
|
-
export interface Note {
|
|
27
|
-
id: string;
|
|
28
|
-
title: string;
|
|
29
|
-
/** A single emoji/character shown in the list, or `null` for the default glyph. */
|
|
30
|
-
icon: string | null;
|
|
31
|
-
content: TiptapDocument;
|
|
32
|
-
/**
|
|
33
|
-
* Flattened text of `content`, refreshed on every write. Kept denormalised
|
|
34
|
-
* so filtering the list never has to walk every document's AST.
|
|
35
|
-
*/
|
|
36
|
-
plainText: string;
|
|
37
|
-
pinned: boolean;
|
|
38
|
-
/** Epoch milliseconds — JSON-safe, so a note survives a `structuredClone` or a
|
|
39
|
-
* `JSON.stringify` round-trip through storage without a revive step. */
|
|
40
|
-
createdAt: number;
|
|
41
|
-
updatedAt: number;
|
|
42
|
-
}
|
|
43
|
-
/** The projection the sidebar list renders — no document body. */
|
|
44
|
-
export type NoteListItem = Pick<Note, 'id' | 'title' | 'icon' | 'pinned' | 'updatedAt'>;
|
|
45
|
-
/** Fields a caller may hand to `NotesStore.create()`. */
|
|
46
|
-
export type NoteInit = Partial<Pick<Note, 'title' | 'icon' | 'content' | 'pinned'>>;
|
|
47
|
-
/** Fields `NotesStore.update()` accepts. */
|
|
48
|
-
export type NotePatch = Partial<Pick<Note, 'title' | 'icon' | 'content' | 'pinned'>>;
|
|
49
|
-
export declare const EMPTY_DOC: TiptapDocument;
|
package/dist/apps/notes/types.js
DELETED
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* The Notes document model.
|
|
3
|
-
*
|
|
4
|
-
* TipTap's own `JSONContent` is deliberately loose (every field optional), so
|
|
5
|
-
* the app carries its own narrowed shapes: a `doc` always has `content`, and a
|
|
6
|
-
* `Note` always has the fields the list and the editor read. Nothing here
|
|
7
|
-
* imports from `@tiptap/*` — the model is the persistence contract, and a
|
|
8
|
-
* consumer storing notes server-side should be able to type its API against it
|
|
9
|
-
* without pulling the editor in.
|
|
10
|
-
*/
|
|
11
|
-
export const EMPTY_DOC = { type: 'doc', content: [{ type: 'paragraph' }] };
|
package/dist/os/layers.d.ts
DELETED
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* The layer contract for the OS shell.
|
|
3
|
-
*
|
|
4
|
-
* The hard rule desktop UIs get wrong: a pane's z-index must NEVER be able to
|
|
5
|
-
* cover a menu, toast, or the taskbar's command dropdown. We guarantee that structurally rather
|
|
6
|
-
* than by juggling numbers — the `Desktop` surface is an isolated stacking
|
|
7
|
-
* context (`isolate`), so every pane's z-index (1..N, handed out by the
|
|
8
|
-
* PaneManager) is *contained* within it. OS chrome and portalled overlays
|
|
9
|
-
* render OUTSIDE that context, at the document root, so they always paint above
|
|
10
|
-
* the entire desktop no matter how high a pane's z climbs.
|
|
11
|
-
*
|
|
12
|
-
* These are the root-level tiers (all above the isolated desktop). bits-ui
|
|
13
|
-
* dialogs/menus/tooltips portal to <body> at z-50; the tiers below are chosen
|
|
14
|
-
* around that: chrome sits under menus, transient system UI sits over them.
|
|
15
|
-
*/
|
|
16
|
-
export declare const LAYER: {
|
|
17
|
-
/** Taskbar / dock — chrome, below menus so a taskbar dropdown (z-50) opens over it. */
|
|
18
|
-
readonly taskbar: "z-30";
|
|
19
|
-
/** Slide-over notification center — chrome, same band as the taskbar it hangs off. */
|
|
20
|
-
readonly notificationCenter: "z-40";
|
|
21
|
-
/** Toasts — above bits-ui overlays (z-50) so a notification is visible over a dialog. */
|
|
22
|
-
readonly toast: "z-[55]";
|
|
23
|
-
};
|
package/dist/os/layers.js
DELETED
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* The layer contract for the OS shell.
|
|
3
|
-
*
|
|
4
|
-
* The hard rule desktop UIs get wrong: a pane's z-index must NEVER be able to
|
|
5
|
-
* cover a menu, toast, or the taskbar's command dropdown. We guarantee that structurally rather
|
|
6
|
-
* than by juggling numbers — the `Desktop` surface is an isolated stacking
|
|
7
|
-
* context (`isolate`), so every pane's z-index (1..N, handed out by the
|
|
8
|
-
* PaneManager) is *contained* within it. OS chrome and portalled overlays
|
|
9
|
-
* render OUTSIDE that context, at the document root, so they always paint above
|
|
10
|
-
* the entire desktop no matter how high a pane's z climbs.
|
|
11
|
-
*
|
|
12
|
-
* These are the root-level tiers (all above the isolated desktop). bits-ui
|
|
13
|
-
* dialogs/menus/tooltips portal to <body> at z-50; the tiers below are chosen
|
|
14
|
-
* around that: chrome sits under menus, transient system UI sits over them.
|
|
15
|
-
*/
|
|
16
|
-
export const LAYER = {
|
|
17
|
-
/** Taskbar / dock — chrome, below menus so a taskbar dropdown (z-50) opens over it. */
|
|
18
|
-
taskbar: 'z-30',
|
|
19
|
-
/** Slide-over notification center — chrome, same band as the taskbar it hangs off. */
|
|
20
|
-
notificationCenter: 'z-40',
|
|
21
|
-
/** Toasts — above bits-ui overlays (z-50) so a notification is visible over a dialog. */
|
|
22
|
-
toast: 'z-[55]'
|
|
23
|
-
};
|