@diegopluna/narvi 0.3.1 → 0.3.3
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/components/activity/ActivityIcon.svelte +54 -0
- package/dist/components/activity/ActivityIcon.svelte.d.ts +24 -0
- package/dist/components/activity/ActivityStep.svelte +47 -13
- package/dist/components/activity/ActivityStep.svelte.d.ts +13 -4
- package/dist/components/activity/ActivityThought.svelte +24 -5
- package/dist/components/activity/ActivityThought.svelte.d.ts +12 -2
- package/dist/components/activity/index.d.ts +3 -1
- package/dist/components/activity/index.js +2 -1
- package/dist/components/app-shell/AppShellHeader.svelte +18 -4
- package/dist/components/app-shell/AppShellHeader.svelte.d.ts +5 -0
- package/dist/components/app-shell/AppShellMain.svelte +5 -1
- package/dist/components/approval/Approval.svelte +14 -1
- package/dist/components/approval/Approval.svelte.d.ts +5 -0
- package/dist/components/badge/Badge.svelte +19 -2
- package/dist/components/badge/Badge.svelte.d.ts +4 -1
- package/dist/components/button/Button.svelte +63 -13
- package/dist/components/composer/ComposerModelPicker.svelte +80 -13
- package/dist/components/composer/ComposerModelPicker.svelte.d.ts +23 -6
- package/dist/components/composer/ComposerRoot.svelte +51 -12
- package/dist/components/composer/ComposerRoot.svelte.d.ts +16 -0
- package/dist/components/composer/ComposerSubmit.svelte +19 -5
- package/dist/components/composer/ComposerSubmit.svelte.d.ts +3 -1
- package/dist/components/composer/ComposerToggle.svelte +18 -4
- package/dist/components/composer/ComposerToggle.svelte.d.ts +2 -0
- package/dist/components/composer/ComposerTray.svelte +17 -3
- package/dist/components/composer/ComposerTray.svelte.d.ts +5 -0
- package/dist/components/composer/context.d.ts +4 -1
- package/dist/components/dialog/DialogContent.svelte +22 -12
- package/dist/components/dialog/DialogContent.svelte.d.ts +10 -0
- package/dist/components/divider/Divider.svelte +56 -14
- package/dist/components/divider/Divider.svelte.d.ts +13 -3
- package/dist/components/empty-state/EmptyState.svelte +12 -2
- package/dist/components/empty-state/EmptyState.svelte.d.ts +6 -0
- package/dist/components/heading/Heading.svelte +15 -0
- package/dist/components/heading/Heading.svelte.d.ts +6 -0
- package/dist/components/hover-card/HoverCardContent.svelte +19 -3
- package/dist/components/hover-card/HoverCardContent.svelte.d.ts +8 -0
- package/dist/components/input/Input.svelte +13 -3
- package/dist/components/input/Input.svelte.d.ts +10 -2
- package/dist/components/markdown/Markdown.svelte +22 -2
- package/dist/components/markdown/MarkdownDiagram.svelte +33 -2
- package/dist/components/markdown/MarkdownFile.svelte +56 -10
- package/dist/components/markdown/MarkdownMath.svelte +6 -0
- package/dist/components/markdown/MarkdownTable.svelte +3 -4
- package/dist/components/markdown/context.d.ts +6 -0
- package/dist/components/markdown/labels.d.ts +7 -0
- package/dist/components/markdown/labels.js +2 -0
- package/dist/components/menu/ContextMenuTrigger.svelte +14 -2
- package/dist/components/menu/ContextMenuTrigger.svelte.d.ts +10 -0
- package/dist/components/menu/MenuCheckboxItem.svelte +50 -7
- package/dist/components/menu/MenuCheckboxItem.svelte.d.ts +16 -0
- package/dist/components/menu/MenuContent.svelte +10 -2
- package/dist/components/menu/MenuContent.svelte.d.ts +10 -0
- package/dist/components/menu/MenuGroup.svelte +16 -0
- package/dist/components/menu/MenuGroup.svelte.d.ts +6 -0
- package/dist/components/menu/MenuItem.svelte +17 -2
- package/dist/components/menu/MenuItem.svelte.d.ts +8 -0
- package/dist/components/menu/MenuLabel.svelte +22 -8
- package/dist/components/menu/MenuRadioGroup.svelte +16 -0
- package/dist/components/menu/MenuRadioGroup.svelte.d.ts +6 -0
- package/dist/components/menu/MenuSubContent.svelte +10 -2
- package/dist/components/menu/MenuSubContent.svelte.d.ts +10 -0
- package/dist/components/menu/MenuSubTrigger.svelte +19 -2
- package/dist/components/menu/MenuSubTrigger.svelte.d.ts +6 -0
- package/dist/components/menu/group.d.ts +2 -0
- package/dist/components/menu/group.js +9 -0
- package/dist/components/menu/index.d.ts +4 -2
- package/dist/components/menu/index.js +2 -2
- package/dist/components/message/MessageBubble.svelte +40 -0
- package/dist/components/message/MessageBubble.svelte.d.ts +12 -0
- package/dist/components/message/MessageContent.svelte +23 -14
- package/dist/components/message/MessageContent.svelte.d.ts +6 -0
- package/dist/components/message/MessageCopy.svelte +27 -15
- package/dist/components/message/MessageCopy.svelte.d.ts +9 -2
- package/dist/components/message/MessageRoot.svelte +20 -3
- package/dist/components/message/MessageRoot.svelte.d.ts +6 -0
- package/dist/components/message/context.d.ts +2 -0
- package/dist/components/message/index.d.ts +4 -1
- package/dist/components/message/index.js +3 -2
- package/dist/components/message/styles.d.ts +30 -0
- package/dist/components/message/styles.js +24 -0
- package/dist/components/notice/Notice.svelte +3 -3
- package/dist/components/popover/PopoverContent.svelte +27 -3
- package/dist/components/popover/PopoverContent.svelte.d.ts +18 -0
- package/dist/components/questionnaire/Questionnaire.svelte +103 -19
- package/dist/components/questionnaire/Questionnaire.svelte.d.ts +13 -1
- package/dist/components/queued-message/QueuedMessage.svelte +44 -6
- package/dist/components/queued-message/QueuedMessage.svelte.d.ts +12 -1
- package/dist/components/select/Select.svelte +18 -2
- package/dist/components/select/Select.svelte.d.ts +7 -0
- package/dist/components/sidebar/SidebarContent.svelte +59 -13
- package/dist/components/sidebar/SidebarContent.svelte.d.ts +6 -0
- package/dist/components/sidebar/SidebarFolder.svelte +29 -2
- package/dist/components/sidebar/SidebarGroup.svelte +50 -7
- package/dist/components/sidebar/SidebarGroup.svelte.d.ts +10 -1
- package/dist/components/sidebar/SidebarItem.svelte +136 -21
- package/dist/components/sidebar/SidebarItem.svelte.d.ts +22 -2
- package/dist/components/sidebar/SidebarSwitcher.svelte +18 -2
- package/dist/components/sidebar/SidebarSwitcher.svelte.d.ts +2 -0
- package/dist/components/sidebar/fold.d.ts +12 -0
- package/dist/components/sidebar/fold.js +8 -0
- package/dist/components/status-indicator/StatusDot.svelte +90 -0
- package/dist/components/status-indicator/StatusDot.svelte.d.ts +18 -0
- package/dist/components/toast/Toaster.svelte +1 -1
- package/dist/components/toggle/Toggle.svelte +12 -2
- package/dist/components/toggle/Toggle.svelte.d.ts +11 -1
- package/dist/components/toggle-group/ToggleGroupItem.svelte +10 -1
- package/dist/components/toggle-group/ToggleGroupRoot.svelte +7 -1
- package/dist/components/toggle-group/ToggleGroupRoot.svelte.d.ts +3 -1
- package/dist/components/toggle-group/context.d.ts +2 -1
- package/dist/components/tooltip/TooltipContent.svelte +13 -1
- package/dist/components/tooltip/TooltipContent.svelte.d.ts +10 -0
- package/dist/components/work-fold/WorkFold.svelte +13 -4
- package/dist/components/work-fold/WorkFold.svelte.d.ts +2 -1
- package/dist/focus-ring.d.ts +29 -0
- package/dist/focus-ring.js +42 -0
- package/dist/index.d.ts +9 -6
- package/dist/index.js +8 -2
- package/dist/internal/Collapse.svelte +15 -2
- package/dist/internal/Glyph.svelte +28 -0
- package/dist/internal/Glyph.svelte.d.ts +5 -0
- package/dist/internal/Tile.svelte +3 -2
- package/dist/internal/layer.d.ts +23 -0
- package/dist/internal/layer.js +19 -0
- package/dist/internal/toggle.d.ts +8 -1
- package/dist/internal/toggle.js +20 -2
- package/dist/markdown/file-paths.d.ts +7 -0
- package/dist/markdown/file-paths.js +29 -0
- package/dist/markdown/files.d.ts +22 -2
- package/dist/markdown/files.js +45 -14
- package/dist/tokens.stylex.d.ts +3 -0
- package/dist/tokens.stylex.js +5 -1
- package/package.json +1 -1
- package/skills/building-ui/SKILL.md +87 -8
- package/skills/building-ui/references/components.md +39 -38
- package/skills/markdown/SKILL.md +22 -6
- package/skills/setup/SKILL.md +1 -1
- package/skills/styling/SKILL.md +10 -3
- package/skills/theming/SKILL.md +11 -4
|
@@ -32,13 +32,13 @@ component: import the namespace (`Dialog`) and use `Dialog.Root`. Docs and live
|
|
|
32
32
|
| `Field` | Label, help text and error around one control | `field` |
|
|
33
33
|
| `Input` | One line of text | `input` |
|
|
34
34
|
| `Textarea` | Several lines of text | `textarea` |
|
|
35
|
-
| `Select` | One choice from a short list (`options: { value, label, icon?, group? }[]`, `align`)
|
|
35
|
+
| `Select` | One choice from a short list (`options: { value, label, icon?, group? }[]`, `align`, `optionIcon`) | `select` |
|
|
36
36
|
| `Checkbox` | An option on or off, or several from a list | `checkbox` |
|
|
37
37
|
| `ChoiceCards` | One choice among a few, each a card with a title and a line of detail | `choice-cards` |
|
|
38
38
|
| `Switch` | A setting that takes effect at once | `switch` |
|
|
39
39
|
| `SegmentedControl` | One of a few options, all visible (`options: { value, label, title? }[]`) | `segmented-control` |
|
|
40
40
|
| `Slider` | A value or a range along a track | `slider` |
|
|
41
|
-
| `Toggle` | A button that stays pressed
|
|
41
|
+
| `Toggle` | A button that stays pressed (`tone`: `accent`, or `neutral` for toolbar icons) | `toggle` |
|
|
42
42
|
| `ToggleGroup.Root`, `.Item` | Toggles that belong together: one pressed, or any number | `toggle-group` |
|
|
43
43
|
| `SettingsGroup` | A titled group of settings: a heading, an action, the rows on one card | `settings-group` |
|
|
44
44
|
| `SettingsRow` | One setting: what it is, beside its control | `settings-row` |
|
|
@@ -50,42 +50,43 @@ component: import the namespace (`Dialog`) and use `Dialog.Root`. Docs and live
|
|
|
50
50
|
|
|
51
51
|
| Component | Use it for | Docs slug |
|
|
52
52
|
| --------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------- | ------------- |
|
|
53
|
-
| `Dialog.Root`, `.Trigger`, `.Content` (`size`, `side`), `.Header`, `.Title`, `.Description`, `.Body`, `.Footer`, `.Close`
|
|
53
|
+
| `Dialog.Root`, `.Trigger`, `.Content` (`size`, `side`, `as`), `.Header`, `.Title`, `.Description`, `.Body`, `.Footer`, `.Close` | A focused task over the page | `dialog` |
|
|
54
54
|
| `ConfirmDialog` | A confirmation for an action that matters | `dialog` |
|
|
55
55
|
| `Sheet.Root`, `.Trigger`, `.Content` (`side`, `size`, `focusOnOpen`), `.Header`, `.Title`, `.Description`, `.Body`, `.Footer`, `.Close` | A panel that slides in from an edge | `sheet` |
|
|
56
|
-
| `Popover.Root`, `.Trigger`, `.Content`, `.Close`
|
|
57
|
-
| `HoverCard.Root`, `.Trigger`, `.Content`
|
|
56
|
+
| `Popover.Root`, `.Trigger`, `.Content` (`padding`, `layout`, `width`), `.Close` | Content anchored to the control that opened it | `popover` |
|
|
57
|
+
| `HoverCard.Root`, `.Trigger`, `.Content` (`layout`, `padding`) | A preview while the pointer rests on a link or chip | `hover-card` |
|
|
58
58
|
| `Menu.Root`, `.Trigger`, `.Content`, `.Item`, `.CheckboxItem`, `.RadioGroup`, `.RadioItem`, `.Group`, `.Label`, `.Separator`, `.Sub` | Actions and choices from a button | `menu` |
|
|
59
59
|
| `ContextMenu.Root`, `.Trigger`, `.Content`, filled with `Menu` items | The same, from a right-click | `menu` |
|
|
60
60
|
| `Command.Dialog`, `.Root`, `.Input`, `.List`, `.Group`, `.Item`, `.Empty`, `.Separator`, `.Footer` | A search field over everything the app can do (⌘K) | `command` |
|
|
61
|
-
| `Tooltip.Provider`, `.Root`, `.Trigger`, `.Content` (`shortcut`)
|
|
61
|
+
| `Tooltip.Provider`, `.Root`, `.Trigger`, `.Content` (`shortcut`, `layout`) | A control's name and its keys. Needs the Provider | `tooltip` |
|
|
62
62
|
| `Collapsible.Root`, `.Trigger`, `.Content` | A region the person can fold away | `collapsible` |
|
|
63
63
|
|
|
64
64
|
## Feedback and status
|
|
65
65
|
|
|
66
|
-
| Component | Use it for
|
|
67
|
-
| ------------------------------------ |
|
|
68
|
-
| `Toaster`, `toast()` | Short notes about something that happened; one Toaster at the root
|
|
69
|
-
| `Notice` | A note in place: what is happening or went wrong, and what to do
|
|
70
|
-
| `EmptyState` | An empty place: what it is for and how to fill it (`title`, `description`, `media`, `actions`) | `empty-state` |
|
|
71
|
-
| `Badge` | A status, category or count (`tone`)
|
|
72
|
-
| `StatusIndicator` | Where a run, thread or machine stands, by shape and colour
|
|
73
|
-
| `
|
|
74
|
-
| `
|
|
75
|
-
| `
|
|
76
|
-
| `
|
|
77
|
-
| `
|
|
78
|
-
| `
|
|
79
|
-
| `
|
|
66
|
+
| Component | Use it for | Docs slug |
|
|
67
|
+
| ------------------------------------ | ------------------------------------------------------------------------------------------------------- | ------------------ |
|
|
68
|
+
| `Toaster`, `toast()` | Short notes about something that happened; one Toaster at the root | `toast` |
|
|
69
|
+
| `Notice` | A note in place: what is happening or went wrong, and what to do | `notice` |
|
|
70
|
+
| `EmptyState` | An empty place: what it is for and how to fill it (`title`, `level`, `description`, `media`, `actions`) | `empty-state` |
|
|
71
|
+
| `Badge` | A status, category or count (`tone`, `info` among them) | `badge` |
|
|
72
|
+
| `StatusIndicator` | Where a run, thread or machine stands, by shape and colour | `status-indicator` |
|
|
73
|
+
| `StatusDot` | A small dot of status colour (`tone`, `shape`), beside a name or on a mark | `status-indicator` |
|
|
74
|
+
| `Progress` | How far along a task is | `progress` |
|
|
75
|
+
| `Spinner` | Something in progress | `spinner` |
|
|
76
|
+
| `Skeleton` | A stand-in for content on its way | `skeleton` |
|
|
77
|
+
| `Shimmer` | Text that says work is under way | `shimmer` |
|
|
78
|
+
| `RollingText` | A phrase that rolls to its next value ("Reading…", "Running…") | none |
|
|
79
|
+
| `Announcer` | Says a short message to screen readers without showing anything | `announcer` |
|
|
80
|
+
| `Avatar.Root`, `.Image`, `.Fallback` | A person: a picture, or initials | `avatar` |
|
|
80
81
|
|
|
81
82
|
## App shell
|
|
82
83
|
|
|
83
|
-
| Component
|
|
84
|
-
|
|
|
85
|
-
| `AppShell.Root` (`bind:sidebarOpen`, `windowInset`), `.Bar` (`center`, `end` snippets), `.Rail`, `.Panes`, `.Sheet` (`flush`), `.Sidebar`, `.Main`, `.Header` (`drag`), `.Panel` (`bind:width`), `.Toggle` (`when`)
|
|
86
|
-
| `Sidebar.Root` (`label`), `.Header` (`drag`), `.Content` (`label`), `.Group`, `.Folder` (`bind:open`, `leading`, `trailing` snippets), `.Item` (`current`, `as`, `leading`, `trailing`, `meta`, `actions` snippets), `.Switcher` (`leading`), `.Footer` | A column of rows, in groups and folders. `Root` is for one on its own; in an app shell the same parts go in `AppShell.Sidebar` | `sidebar` |
|
|
87
|
-
| `Rail.Root` (`label`), `.Item` (`label`, `href`, `current`, `badge`, `badgeTone`, `shortcut`), `.Separator`, `.Spacer`
|
|
88
|
-
| `ResizeHandle`
|
|
84
|
+
| Component | Use it for | Docs slug |
|
|
85
|
+
| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------ | ----------- |
|
|
86
|
+
| `AppShell.Root` (`bind:sidebarOpen`, `windowInset`), `.Bar` (`center`, `end` snippets), `.Rail`, `.Panes`, `.Sheet` (`flush`), `.Sidebar`, `.Main`, `.Header` (`drag`), `.Panel` (`bind:width`), `.Toggle` (`when`) | The window: its bar, a rail, and one sheet for the sidebar, the page and a side panel | `app-shell` |
|
|
87
|
+
| `Sidebar.Root` (`label`), `.Header` (`drag`), `.Content` (`label`, `pinned` snippet), `.Group` (`label`, `collapsible`, `keepCurrent`, `actions`), `.Folder` (`bind:open`, `leading`, `trailing` snippets), `.Item` (`current`, `picked`, `disabled`, `as`, `itemProps`, `leading`, `trailing`, `meta`, `actions` snippets), `.Switcher` (`leading`, `aside`), `.Footer` | A column of rows, in groups and folders. `Root` is for one on its own; in an app shell the same parts go in `AppShell.Sidebar` | `sidebar` |
|
|
88
|
+
| `Rail.Root` (`label`), `.Item` (`label`, `href`, `current`, `badge`, `badgeTone`, `shortcut`), `.Separator`, `.Spacer` | A narrow strip of places to go: workspaces, settings. On its own beside a page, or in `AppShell.Rail` | `rail` |
|
|
89
|
+
| `ResizeHandle` | A draggable edge between two areas | none |
|
|
89
90
|
|
|
90
91
|
`AppShell.Bar`, `AppShell.Rail` and `AppShell.Sheet` are direct children of `AppShell.Root`; the
|
|
91
92
|
sidebar, the page and the panel go inside the sheet. The bar is where macOS's traffic lights sit
|
|
@@ -150,14 +151,14 @@ first. Don't use a rail without a bar in a window that has traffic lights: they
|
|
|
150
151
|
|
|
151
152
|
## AI chat
|
|
152
153
|
|
|
153
|
-
| Component
|
|
154
|
-
|
|
|
155
|
-
| `Conversation.Root`, `.Content`, `.ScrollButton`, `.Empty`
|
|
156
|
-
| `Message.Root` (`from`, `streaming`), `.Header`, `.Pending`, `.Content`, `.Actions`, `.Action`, `.Copy`
|
|
157
|
-
| `Reasoning.Root` (`streaming`), `.Trigger`, `.Content`
|
|
158
|
-
| `Tool.Root` (`name`, `state`), `.Trigger`, `.Content`, `.Input`, `.Output`
|
|
159
|
-
| `Composer.Tray` (`pending` snippet), `.Root` (`bind:value`, `status`, `onsubmit`, `onstop`), `.Textarea`, `.Toolbar`, `.Attachments`, `.AttachButton`, `.Toggle`, `.ModelPicker`, `.Submit` | Where the person writes to the model | `composer` |
|
|
160
|
-
| `Suggestions.Root`, `.Item`
|
|
154
|
+
| Component | Use it for | Docs slug |
|
|
155
|
+
| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------ | -------------- |
|
|
156
|
+
| `Conversation.Root`, `.Content`, `.ScrollButton`, `.Empty` | The scrolling log; keeps the newest in view while it streams | `conversation` |
|
|
157
|
+
| `Message.Root` (`from`, `streaming`, `textSize`), `.Header`, `.Pending`, `.Content` (`bubble`), `.Bubble`, `.Actions`, `.Action`, `.Copy`, `.Time` | One turn, from the person or the model | `message` |
|
|
158
|
+
| `Reasoning.Root` (`streaming`), `.Trigger`, `.Content` | The model's thinking, folded once done | `reasoning` |
|
|
159
|
+
| `Tool.Root` (`name`, `state`), `.Trigger`, `.Content`, `.Input`, `.Output` | A tool call: what it asked, how it went, what came back | `tool` |
|
|
160
|
+
| `Composer.Tray` (`pending` snippet, `waiting`), `.Root` (`bind:value`, `status`, `sending`, `hasContent`, `onsubmit`, `onstop`, `onfiles`), `.Textarea`, `.Toolbar`, `.Attachments`, `.AttachButton`, `.Toggle`, `.ModelPicker`, `.Submit` | Where the person writes to the model | `composer` |
|
|
161
|
+
| `Suggestions.Root`, `.Item` | Prompts to start from | `suggestions` |
|
|
161
162
|
|
|
162
163
|
```svelte
|
|
163
164
|
<Conversation.Root>
|
|
@@ -192,14 +193,14 @@ Docs slug: `agent-timeline`.
|
|
|
192
193
|
|
|
193
194
|
| Component | Use it for |
|
|
194
195
|
| ---------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
195
|
-
| `Activity.Root`, `.Trigger`, `.Content`, `.Step`, `.Thought`
|
|
196
|
+
| `Activity.Root`, `.Trigger`, `.Content`, `.Step`, `.Thought`, `.Icon` | A stretch of work: says what the agent is doing, then what it did. `.Icon` starts a row of your own |
|
|
196
197
|
| `WorkFold` | Folds a finished turn's work behind "Worked for 2m 5s" |
|
|
197
198
|
| `Plan` (`steps: { label, status }[]`) | What the agent means to do, ticked off as it goes |
|
|
198
199
|
| `Approval` | The agent asks before acting; folds into the decision once answered. A choice's `shortcut` (`mod+enter`, `mod+backspace`, `enter`, `escape`) shows on its button and makes it |
|
|
199
|
-
| `Questionnaire` | Questions one at a time, with keys 1–9 to pick and ⌘Enter to send
|
|
200
|
-
| `QueuedMessage` | A message sent while the agent was still working, waiting its turn
|
|
200
|
+
| `Questionnaire` | Questions one at a time, with keys 1–9 to pick and ⌘Enter to send once all are answered; `secret` answers; `busy` |
|
|
201
|
+
| `QueuedMessage` | A message sent while the agent was still working, waiting its turn (`attachments`, `disabled`) |
|
|
201
202
|
| `ChangesSummary` (`ChangedFile[]`), `ChangeStats` (`additions`, `deletions`) | What a turn changed, and +12 −3 counts |
|
|
202
|
-
| `Divider` (`label`)
|
|
203
|
+
| `Divider` (`label`, or children; `role`) | A labelled break in a timeline: a new day, "Context compacted" |
|
|
203
204
|
|
|
204
205
|
## Utilities
|
|
205
206
|
|
package/skills/markdown/SKILL.md
CHANGED
|
@@ -12,7 +12,7 @@ metadata:
|
|
|
12
12
|
patching the DOM, and decide which links and images text from a model may load.
|
|
13
13
|
type: core
|
|
14
14
|
library: '@diegopluna/narvi'
|
|
15
|
-
library_version: '0.3.
|
|
15
|
+
library_version: '0.3.3'
|
|
16
16
|
requires:
|
|
17
17
|
- setup
|
|
18
18
|
sources:
|
|
@@ -168,7 +168,13 @@ needs the component's state. Never write a new array in the markup:
|
|
|
168
168
|
dollar sign is always text.
|
|
169
169
|
- **`diagrams()`** draws a fenced `mermaid` block as a diagram, with Pele, in Narvi's colours.
|
|
170
170
|
It draws once the fence closes, offers the code and a full-size view that pans and zooms,
|
|
171
|
-
and says why when a diagram can't be drawn.
|
|
171
|
+
and says why when a diagram can't be drawn. The picture is an image named by its source's
|
|
172
|
+
`accTitle`, or by the words in it ("Diagram: Lexer, Parser", `labels.diagramPicture`). A
|
|
173
|
+
failure is read out through the reply's one status region, which every copy button shares:
|
|
174
|
+
a reply holds one `role="status"`, not one per code block, table and diagram.
|
|
175
|
+
- A formula's TeX is not on the page twice: KaTeX's hidden annotation is left out of its
|
|
176
|
+
MathML, so the page's find and a test's `getByText` see only what shows. A copy still takes
|
|
177
|
+
the TeX (from `data-markdown-copy`).
|
|
172
178
|
|
|
173
179
|
Two more are for replies from coding agents:
|
|
174
180
|
|
|
@@ -183,7 +189,9 @@ export const plugins = [
|
|
|
183
189
|
files({
|
|
184
190
|
// Says which paths are real files, and returns them as the app wants them
|
|
185
191
|
resolve: (path) => tree.find(path),
|
|
186
|
-
open: (file) => editor.open(file.path, file.line)
|
|
192
|
+
open: (file) => editor.open(file.path, file.line),
|
|
193
|
+
// Optional: the app's own icons; null keeps Narvi's icon for the kind
|
|
194
|
+
icon: (file) => (file.kind === 'code' ? { url: '/icons/code.svg', color: '#3178c6' } : null)
|
|
187
195
|
}),
|
|
188
196
|
// No image loads unasked unless `allow` says so
|
|
189
197
|
images({ allow: (url) => url.startsWith('https://cdn.example.com/') })
|
|
@@ -193,9 +201,10 @@ export const plugins = [
|
|
|
193
201
|
- **`files()`** turns inline code that names a file into a chip: `src/app.ts`,
|
|
194
202
|
`src/app.ts:42`, `src/app.ts:42:7`, `src/app.ts:42-50` and `src/app.ts#L42-L50`. A Markdown
|
|
195
203
|
link whose address is a file path, with or without a `#L10` fragment, becomes a chip too.
|
|
196
|
-
It keeps the link's words when they're
|
|
197
|
-
words that name another file,
|
|
198
|
-
|
|
204
|
+
It keeps the link's words when they're plain words ("here", "the config") or name that file;
|
|
205
|
+
words that could name another file (a path, a name with an extension, a dotfile, one with an
|
|
206
|
+
underscore such as `id_rsa`, or `README`, `LICENSE`, `Makefile`) are replaced by the real
|
|
207
|
+
name, so a chip can't claim to be a file it isn't. A chip made from code shows the file's name and the place in it (`app.ts:42`),
|
|
199
208
|
and has the whole path as its title. A path that leaves the project (`../x`, `~/x`) is shown
|
|
200
209
|
whole. Network shares, paths that start with `-`, and paths with invisible characters never
|
|
201
210
|
become chips. With `open` it's a button that calls
|
|
@@ -205,6 +214,13 @@ export const plugins = [
|
|
|
205
214
|
what it returns becomes `file.path`.
|
|
206
215
|
Without `resolve`, only text that looks like a path becomes a chip: "and/or", `v1.2.3` and
|
|
207
216
|
`github.com/owner/repo` don't.
|
|
217
|
+
Each chip has an icon for its kind (`fileKind`): a folder (a path written or resolved with a
|
|
218
|
+
slash at its end, `src/lib/`), code, an image, text, data, or any other file. `icon(file)`,
|
|
219
|
+
given the file and its `kind`, returns the app's own: `{ url, color? }`, an SVG drawn as a
|
|
220
|
+
mask in `color` (any CSS colour, `light-dark()` too). Don't draw the `file` node with a
|
|
221
|
+
component of your own for its icon: a finished reply is then built from parts instead of
|
|
222
|
+
written as markup, which is slower to show. A plugin that does take the node over can keep
|
|
223
|
+
the fast path by giving `static.file` too.
|
|
208
224
|
- **`images()`** holds an image the app hasn't allowed: it shows as a button that names the
|
|
209
225
|
image's host, and loads when pressed. By default no image loads unasked, not even one from
|
|
210
226
|
the app's own site, since that's a request with the person's cookies. To let the app's own
|
package/skills/setup/SKILL.md
CHANGED
package/skills/styling/SKILL.md
CHANGED
|
@@ -12,7 +12,7 @@ metadata:
|
|
|
12
12
|
hover, motion and forced-colour preferences.
|
|
13
13
|
type: core
|
|
14
14
|
library: '@diegopluna/narvi'
|
|
15
|
-
library_version: '0.3.
|
|
15
|
+
library_version: '0.3.3'
|
|
16
16
|
requires:
|
|
17
17
|
- setup
|
|
18
18
|
sources:
|
|
@@ -73,8 +73,10 @@ package root) breaks them.
|
|
|
73
73
|
surface it rests on, and no heavier), `borderControlHover`. Shade: `shadow` (the
|
|
74
74
|
one drop, under what floats over the page) and `scrim` (behind a dialog). Text: `text`,
|
|
75
75
|
`textMuted`, `textSubtle`. The accent, which marks state: `accent`, `accentVivid`, `onAccent`,
|
|
76
|
-
`accentSoft`, `focusRing`, `focusHalo`. Status: `success`, `warning`, `danger`,
|
|
77
|
-
|
|
76
|
+
`accentSoft`, `focusRing`, `focusHalo`. Status: `success`, `warning`, `danger`, `info` (what
|
|
77
|
+
is only to be known, such as a note or a review comment: a blue of its own that stays blue
|
|
78
|
+
whatever accent a preset picks), and their `…Soft` (fills) and `…Text` (text on a soft fill)
|
|
79
|
+
variants. Don't use `accent` for an info note, and don't use `info` for focus or selection. Syntax: `codeKey`, `codeString`,
|
|
78
80
|
`codeNumber`, `codeLiteral`, `codePunct`. The primary button: `primary`, `onPrimary`. The
|
|
79
81
|
thumb of a switch or slider: `thumb`.
|
|
80
82
|
- `space`: a 4px scale from `x1` (4px) to `x16` (64px), with `x1_5` (6px) between an icon and
|
|
@@ -92,6 +94,11 @@ package root) breaks them.
|
|
|
92
94
|
`stylex.attrs(typography.caption, styles.count)`.
|
|
93
95
|
- `visuallyHidden` (from the package root) hides an element from sight and keeps it for
|
|
94
96
|
assistive technology: `stylex.attrs(visuallyHidden)`. Don't write your own.
|
|
97
|
+
- `focusRing` (from the package root) is focus as Narvi's parts show it. `focusRing.ring` goes on
|
|
98
|
+
a control of your own: a 2px ring in the accent, 2px out, from the keyboard, and an edge in
|
|
99
|
+
forced colours. `focusRing.frame` goes on a box around a field of your own, such as an editor:
|
|
100
|
+
its hairline takes the ring and halo while the field inside is typed into, as a text field's
|
|
101
|
+
does. Don't redraw either with `:focus-visible` styles of your own.
|
|
95
102
|
- `play.whileVisible`: the `animationPlayState` for an animation that never ends. Attach
|
|
96
103
|
`whileVisible` (from the package root) to its element and it runs only while it can be seen.
|
|
97
104
|
Step such an animation (`steps(30)` over two seconds) so it costs a few frames a second.
|
package/skills/theming/SKILL.md
CHANGED
|
@@ -11,7 +11,7 @@ metadata:
|
|
|
11
11
|
menus and dialogs, and resolve token colours for drawing code that cannot read CSS variables.
|
|
12
12
|
type: core
|
|
13
13
|
library: '@diegopluna/narvi'
|
|
14
|
-
library_version: '0.3.
|
|
14
|
+
library_version: '0.3.3'
|
|
15
15
|
requires:
|
|
16
16
|
- setup
|
|
17
17
|
sources:
|
|
@@ -153,6 +153,7 @@ const accent = 'var(--app-accent, light-dark(#0164cf, #72acfe))';
|
|
|
153
153
|
const success = 'var(--app-success, light-dark(#007835, #37d16c))';
|
|
154
154
|
const warning = 'var(--app-warning, light-dark(#8b6001, #f5af20))';
|
|
155
155
|
const danger = 'var(--app-danger, light-dark(#c92228, #ff7a70))';
|
|
156
|
+
const info = 'var(--app-info, light-dark(#0164cf, #72acfe))';
|
|
156
157
|
|
|
157
158
|
export const runtimeTheme = stylex.createTheme(colors, {
|
|
158
159
|
bg,
|
|
@@ -184,12 +185,15 @@ export const runtimeTheme = stylex.createTheme(colors, {
|
|
|
184
185
|
success,
|
|
185
186
|
warning,
|
|
186
187
|
danger,
|
|
188
|
+
info,
|
|
187
189
|
successSoft: `color-mix(in oklab, ${success} 14%, transparent)`,
|
|
188
190
|
warningSoft: `color-mix(in oklab, ${warning} 14%, transparent)`,
|
|
189
191
|
dangerSoft: `color-mix(in oklab, ${danger} 14%, transparent)`,
|
|
192
|
+
infoSoft: `color-mix(in oklab, ${info} 14%, transparent)`,
|
|
190
193
|
successText: `color-mix(in oklab, ${success} 70%, ${text})`,
|
|
191
194
|
warningText: `color-mix(in oklab, ${warning} 70%, ${text})`,
|
|
192
|
-
dangerText: `color-mix(in oklab, ${danger} 70%, ${text})
|
|
195
|
+
dangerText: `color-mix(in oklab, ${danger} 70%, ${text})`,
|
|
196
|
+
infoText: `color-mix(in oklab, ${info} 70%, ${text})`
|
|
193
197
|
});
|
|
194
198
|
```
|
|
195
199
|
|
|
@@ -255,8 +259,11 @@ scheme changes (`matchMedia('(prefers-color-scheme: dark)')`, or your toggle).
|
|
|
255
259
|
`bgWindow` is `bg` a shade deeper. Change the neutrals and these keep
|
|
256
260
|
the old tint unless they are overridden as well. A preset from narvi.dpeter.dev/create does it.
|
|
257
261
|
- **MEDIUM: using the accent for decoration.** `accent` means "state": focus, selection, progress,
|
|
258
|
-
something live. Status uses `success`, `warning` and `
|
|
259
|
-
`accent` makes the state colour stop meaning anything.
|
|
262
|
+
something live. Status uses `success`, `warning`, `danger` and `info`. Painting headings or
|
|
263
|
+
icons in `accent` makes the state colour stop meaning anything.
|
|
264
|
+
- **MEDIUM: a theme that sets the statuses but not `info`.** `info`, `infoSoft` and `infoText`
|
|
265
|
+
are tokens too: leave them out and an info Notice, toast or Badge keeps Narvi's
|
|
266
|
+
blue beside your own statuses.
|
|
260
267
|
- **MEDIUM: overriding `bg` or `text` without the root.** `base.css` paints `:root` with copies
|
|
261
268
|
of those two. Set the root's `background-color` and `color` to match your override.
|
|
262
269
|
- **HIGH: a variable without a fallback.** `accent: 'var(--app-accent)'` makes the token invalid
|