@asanchez-sa/abby 0.0.0-stage → 0.1.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +245 -2
- package/dist/_virtual/_rolldown/runtime.js +26 -0
- package/dist/agents/approvals.d.ts +46 -0
- package/dist/agents/approvals.js +58 -0
- package/dist/agents/changes.d.ts +21 -0
- package/dist/agents/changes.js +21 -0
- package/dist/agents/hooks.d.ts +20 -0
- package/dist/agents/hooks.js +58 -0
- package/dist/agents/index.d.ts +11 -0
- package/dist/agents/index.js +9 -0
- package/dist/agents/run-tool.d.ts +44 -0
- package/dist/agents/run-tool.js +79 -0
- package/dist/agents/ui-sdk.d.ts +5 -0
- package/dist/agents/ui-sdk.js +3 -0
- package/dist/behaviors/canvas/index.d.ts +2 -0
- package/dist/behaviors/canvas/index.js +1 -0
- package/dist/behaviors/canvas/ui-sdk.d.ts +2 -0
- package/dist/behaviors/canvas/ui-sdk.js +1 -0
- package/dist/behaviors/drag-and-drop/index.d.ts +2 -0
- package/dist/behaviors/drag-and-drop/index.js +1 -0
- package/dist/behaviors/drag-and-drop/ui-sdk.d.ts +2 -0
- package/dist/behaviors/drag-and-drop/ui-sdk.js +1 -0
- package/dist/behaviors/dragging/index.d.ts +2 -0
- package/dist/behaviors/dragging/index.js +1 -0
- package/dist/behaviors/dragging/ui-sdk.d.ts +2 -0
- package/dist/behaviors/dragging/ui-sdk.js +1 -0
- package/dist/behaviors/focus/index.d.ts +2 -0
- package/dist/behaviors/focus/index.js +1 -0
- package/dist/behaviors/focus/ui-sdk.d.ts +2 -0
- package/dist/behaviors/focus/ui-sdk.js +1 -0
- package/dist/behaviors/lists/index.d.ts +3 -0
- package/dist/behaviors/lists/index.js +3 -0
- package/dist/behaviors/lists/ui-sdk.d.ts +3 -0
- package/dist/behaviors/lists/ui-sdk.js +3 -0
- package/dist/behaviors/popups/index.d.ts +3 -0
- package/dist/behaviors/popups/index.js +3 -0
- package/dist/behaviors/popups/ui-sdk.d.ts +3 -0
- package/dist/behaviors/popups/ui-sdk.js +3 -0
- package/dist/behaviors/preferences/index.d.ts +3 -0
- package/dist/behaviors/preferences/index.js +3 -0
- package/dist/behaviors/preferences/ui-sdk.d.ts +3 -0
- package/dist/behaviors/preferences/ui-sdk.js +3 -0
- package/dist/behaviors/selection/index.d.ts +3 -0
- package/dist/behaviors/selection/index.js +3 -0
- package/dist/behaviors/selection/indicator.d.ts +13 -0
- package/dist/behaviors/selection/indicator.js +20 -0
- package/dist/behaviors/selection/ui-sdk.d.ts +2 -0
- package/dist/behaviors/selection/ui-sdk.js +1 -0
- package/dist/behaviors/transitions/index.d.ts +3 -0
- package/dist/behaviors/transitions/index.js +3 -0
- package/dist/behaviors/transitions/ui-sdk.d.ts +3 -0
- package/dist/behaviors/transitions/ui-sdk.js +3 -0
- package/dist/behaviors/trees/index.d.ts +2 -0
- package/dist/behaviors/trees/index.js +1 -0
- package/dist/behaviors/trees/ui-sdk.d.ts +2 -0
- package/dist/behaviors/trees/ui-sdk.js +1 -0
- package/dist/components/accordion/accordion.d.ts +13 -0
- package/dist/components/accordion/accordion.js +165 -0
- package/dist/components/alert/alert.d.ts +13 -0
- package/dist/components/alert/alert.js +131 -0
- package/dist/components/alert-dialog/alert-dialog.d.ts +15 -0
- package/dist/components/alert-dialog/alert-dialog.js +257 -0
- package/dist/components/aspect-ratio/aspect-ratio.d.ts +7 -0
- package/dist/components/aspect-ratio/aspect-ratio.js +57 -0
- package/dist/components/attachment/attachment.d.ts +48 -0
- package/dist/components/attachment/attachment.js +372 -0
- package/dist/components/autocomplete/autocomplete.d.ts +32 -0
- package/dist/components/autocomplete/autocomplete.js +466 -0
- package/dist/components/avatar/avatar.d.ts +6 -0
- package/dist/components/avatar/avatar.js +100 -0
- package/dist/components/avatar-group/avatar-group.d.ts +9 -0
- package/dist/components/avatar-group/avatar-group.js +75 -0
- package/dist/components/badge/badge.d.ts +15 -0
- package/dist/components/badge/badge.js +31 -0
- package/dist/components/breadcrumb/breadcrumb.d.ts +24 -0
- package/dist/components/breadcrumb/breadcrumb.js +279 -0
- package/dist/components/bubble/bubble.d.ts +26 -0
- package/dist/components/bubble/bubble.js +173 -0
- package/dist/components/button/button.d.ts +18 -0
- package/dist/components/button/button.js +91 -0
- package/dist/components/button-group/button-group.d.ts +15 -0
- package/dist/components/button-group/button-group.js +71 -0
- package/dist/components/calendar/calendar.d.ts +29 -0
- package/dist/components/calendar/calendar.js +453 -0
- package/dist/components/card/card.d.ts +14 -0
- package/dist/components/card/card.js +213 -0
- package/dist/components/carousel/carousel.d.ts +16 -0
- package/dist/components/carousel/carousel.js +364 -0
- package/dist/components/chain-of-thought/chain-of-thought.d.ts +72 -0
- package/dist/components/chain-of-thought/chain-of-thought.js +491 -0
- package/dist/components/chat/chat.d.ts +48 -0
- package/dist/components/chat/chat.js +207 -0
- package/dist/components/checkbox/checkbox.d.ts +10 -0
- package/dist/components/checkbox/checkbox.js +118 -0
- package/dist/components/checkpoint/checkpoint.d.ts +24 -0
- package/dist/components/checkpoint/checkpoint.js +178 -0
- package/dist/components/choice-cards/choice-cards.d.ts +38 -0
- package/dist/components/choice-cards/choice-cards.js +255 -0
- package/dist/components/code-block/code-block.d.ts +58 -0
- package/dist/components/code-block/code-block.js +506 -0
- package/dist/components/code-block/highlighter.js +96 -0
- package/dist/components/code-block/use-highlighted-code.d.ts +11 -0
- package/dist/components/code-block/use-highlighted-code.js +54 -0
- package/dist/components/collapsible/collapsible.d.ts +10 -0
- package/dist/components/collapsible/collapsible.js +92 -0
- package/dist/components/color-picker/color-picker.d.ts +17 -0
- package/dist/components/color-picker/color-picker.js +395 -0
- package/dist/components/combobox/combobox.d.ts +54 -0
- package/dist/components/combobox/combobox.js +683 -0
- package/dist/components/command/command.d.ts +23 -0
- package/dist/components/command/command.js +373 -0
- package/dist/components/command-dock/command-dock.d.ts +118 -0
- package/dist/components/command-dock/command-dock.js +944 -0
- package/dist/components/confirmation/confirmation.d.ts +58 -0
- package/dist/components/confirmation/confirmation.js +181 -0
- package/dist/components/context/context.d.ts +82 -0
- package/dist/components/context/context.js +490 -0
- package/dist/components/date-input/date-input.d.ts +16 -0
- package/dist/components/date-input/date-input.js +89 -0
- package/dist/components/date-picker/date-picker.d.ts +28 -0
- package/dist/components/date-picker/date-picker.js +361 -0
- package/dist/components/dialog/dialog.d.ts +14 -0
- package/dist/components/dialog/dialog.js +261 -0
- package/dist/components/drawer/drawer.d.ts +16 -0
- package/dist/components/drawer/drawer.js +309 -0
- package/dist/components/empty/empty.d.ts +18 -0
- package/dist/components/empty/empty.js +192 -0
- package/dist/components/field/field.d.ts +15 -0
- package/dist/components/field/field.js +261 -0
- package/dist/components/file-input/file-input.d.ts +12 -0
- package/dist/components/file-input/file-input.js +216 -0
- package/dist/components/file-tree/file-tree.d.ts +45 -0
- package/dist/components/file-tree/file-tree.js +283 -0
- package/dist/components/hover-card/hover-card.d.ts +10 -0
- package/dist/components/hover-card/hover-card.js +118 -0
- package/dist/components/icon/icon.d.ts +14 -0
- package/dist/components/icon/icon.js +60 -0
- package/dist/components/image-cropper/image-cropper.d.ts +15 -0
- package/dist/components/image-cropper/image-cropper.js +334 -0
- package/dist/components/inline-citation/inline-citation.d.ts +46 -0
- package/dist/components/inline-citation/inline-citation.js +269 -0
- package/dist/components/input/input.d.ts +9 -0
- package/dist/components/input/input.js +43 -0
- package/dist/components/input-group/input-group.d.ts +42 -0
- package/dist/components/input-group/input-group.js +192 -0
- package/dist/components/item/item.d.ts +32 -0
- package/dist/components/item/item.js +394 -0
- package/dist/components/kbd/kbd.d.ts +9 -0
- package/dist/components/kbd/kbd.js +75 -0
- package/dist/components/label/label.d.ts +6 -0
- package/dist/components/label/label.js +40 -0
- package/dist/components/link/link.d.ts +21 -0
- package/dist/components/link/link.js +126 -0
- package/dist/components/listbox/listbox.d.ts +20 -0
- package/dist/components/listbox/listbox.js +199 -0
- package/dist/components/marker/marker.d.ts +11 -0
- package/dist/components/marker/marker.js +88 -0
- package/dist/components/menu/menu.d.ts +38 -0
- package/dist/components/menu/menu.js +553 -0
- package/dist/components/menubar/menubar.d.ts +9 -0
- package/dist/components/menubar/menubar.js +47 -0
- package/dist/components/message/message.d.ts +44 -0
- package/dist/components/message/message.js +328 -0
- package/dist/components/message-scroller/message-scroller.d.ts +111 -0
- package/dist/components/message-scroller/message-scroller.js +957 -0
- package/dist/components/meter/meter.d.ts +8 -0
- package/dist/components/meter/meter.js +162 -0
- package/dist/components/model-selector/model-selector.d.ts +155 -0
- package/dist/components/model-selector/model-selector.js +905 -0
- package/dist/components/native-select/native-select.d.ts +27 -0
- package/dist/components/native-select/native-select.js +226 -0
- package/dist/components/navigation-menu/navigation-menu.d.ts +29 -0
- package/dist/components/navigation-menu/navigation-menu.js +318 -0
- package/dist/components/not-label.js +9 -0
- package/dist/components/note-editor/blocks.d.ts +22 -0
- package/dist/components/note-editor/blocks.js +245 -0
- package/dist/components/note-editor/diff.d.ts +19 -0
- package/dist/components/note-editor/diff.js +64 -0
- package/dist/components/note-editor/editor.js +249 -0
- package/dist/components/note-editor/note-editor.d.ts +109 -0
- package/dist/components/note-editor/note-editor.js +954 -0
- package/dist/components/note-editor/parts/comments.d.ts +24 -0
- package/dist/components/note-editor/parts/comments.js +337 -0
- package/dist/components/note-editor/parts/header.d.ts +25 -0
- package/dist/components/note-editor/parts/header.js +263 -0
- package/dist/components/note-editor/parts/history.d.ts +56 -0
- package/dist/components/note-editor/parts/history.js +409 -0
- package/dist/components/note-editor/parts/presence.d.ts +31 -0
- package/dist/components/note-editor/parts/presence.js +140 -0
- package/dist/components/note-editor/parts/suggestions.d.ts +45 -0
- package/dist/components/note-editor/parts/suggestions.js +316 -0
- package/dist/components/note-editor/parts/toolbar.d.ts +38 -0
- package/dist/components/note-editor/parts/toolbar.js +687 -0
- package/dist/components/note-editor/people.d.ts +84 -0
- package/dist/components/note-editor/people.js +276 -0
- package/dist/components/note-editor/person.d.ts +11 -0
- package/dist/components/note-editor/person.js +15 -0
- package/dist/components/note-place/note-place.d.ts +42 -0
- package/dist/components/note-place/note-place.js +256 -0
- package/dist/components/note-status/note-status.d.ts +59 -0
- package/dist/components/note-status/note-status.js +380 -0
- package/dist/components/number-input/number-input.d.ts +12 -0
- package/dist/components/number-input/number-input.js +252 -0
- package/dist/components/otp-input/otp-input.d.ts +12 -0
- package/dist/components/otp-input/otp-input.js +136 -0
- package/dist/components/pagination/pagination.d.ts +23 -0
- package/dist/components/pagination/pagination.js +218 -0
- package/dist/components/password-input/password-input.d.ts +11 -0
- package/dist/components/password-input/password-input.js +117 -0
- package/dist/components/plan/plan.d.ts +51 -0
- package/dist/components/plan/plan.js +320 -0
- package/dist/components/popover/popover.d.ts +16 -0
- package/dist/components/popover/popover.js +268 -0
- package/dist/components/preferences/preferences.d.ts +5 -0
- package/dist/components/preferences/preferences.js +18 -0
- package/dist/components/progress/progress.d.ts +8 -0
- package/dist/components/progress/progress.js +162 -0
- package/dist/components/prompt-input/prompt-input.d.ts +247 -0
- package/dist/components/prompt-input/prompt-input.js +1367 -0
- package/dist/components/questionnaire/questionnaire.d.ts +174 -0
- package/dist/components/questionnaire/questionnaire.js +1628 -0
- package/dist/components/queue/queue.d.ts +82 -0
- package/dist/components/queue/queue.js +471 -0
- package/dist/components/radio/radio.d.ts +7 -0
- package/dist/components/radio/radio.js +101 -0
- package/dist/components/rating/rating.d.ts +10 -0
- package/dist/components/rating/rating.js +95 -0
- package/dist/components/reasoning/reasoning.d.ts +50 -0
- package/dist/components/reasoning/reasoning.js +233 -0
- package/dist/components/resizable/resizable.d.ts +6 -0
- package/dist/components/resizable/resizable.js +100 -0
- package/dist/components/scroll-area/scroll-area.d.ts +17 -0
- package/dist/components/scroll-area/scroll-area.js +211 -0
- package/dist/components/segmented-control/segmented-control.d.ts +16 -0
- package/dist/components/segmented-control/segmented-control.js +142 -0
- package/dist/components/select/select.d.ts +43 -0
- package/dist/components/select/select.js +577 -0
- package/dist/components/separator/separator.d.ts +4 -0
- package/dist/components/separator/separator.js +38 -0
- package/dist/components/sheet/sheet.d.ts +24 -0
- package/dist/components/sheet/sheet.js +330 -0
- package/dist/components/sidebar/sidebar.d.ts +138 -0
- package/dist/components/sidebar/sidebar.js +1374 -0
- package/dist/components/skeleton/skeleton.d.ts +4 -0
- package/dist/components/skeleton/skeleton.js +40 -0
- package/dist/components/slider/slider.d.ts +9 -0
- package/dist/components/slider/slider.js +193 -0
- package/dist/components/sources/sources.d.ts +35 -0
- package/dist/components/sources/sources.js +209 -0
- package/dist/components/spinner/spinner.d.ts +11 -0
- package/dist/components/spinner/spinner.js +59 -0
- package/dist/components/stack-trace/parse-stack-trace.d.ts +21 -0
- package/dist/components/stack-trace/parse-stack-trace.js +61 -0
- package/dist/components/stack-trace/stack-trace.d.ts +79 -0
- package/dist/components/stack-trace/stack-trace.js +434 -0
- package/dist/components/subagent/subagent.d.ts +71 -0
- package/dist/components/subagent/subagent.js +450 -0
- package/dist/components/suggestion/suggestion.d.ts +21 -0
- package/dist/components/suggestion/suggestion.js +130 -0
- package/dist/components/switch/switch.d.ts +6 -0
- package/dist/components/switch/switch.js +70 -0
- package/dist/components/table/table.d.ts +19 -0
- package/dist/components/table/table.js +284 -0
- package/dist/components/table-of-contents/spy.js +84 -0
- package/dist/components/table-of-contents/table-of-contents.d.ts +92 -0
- package/dist/components/table-of-contents/table-of-contents.js +787 -0
- package/dist/components/tabs/tabs.d.ts +25 -0
- package/dist/components/tabs/tabs.js +273 -0
- package/dist/components/task/task.d.ts +40 -0
- package/dist/components/task/task.js +262 -0
- package/dist/components/terminal/terminal.d.ts +82 -0
- package/dist/components/terminal/terminal.js +457 -0
- package/dist/components/test-results/test-results.d.ts +127 -0
- package/dist/components/test-results/test-results.js +687 -0
- package/dist/components/textarea/textarea.d.ts +8 -0
- package/dist/components/textarea/textarea.js +43 -0
- package/dist/components/time-input/time-input.d.ts +7 -0
- package/dist/components/time-input/time-input.js +82 -0
- package/dist/components/timeline/timeline.d.ts +19 -0
- package/dist/components/timeline/timeline.js +247 -0
- package/dist/components/toast/toast.d.ts +12 -0
- package/dist/components/toast/toast.js +285 -0
- package/dist/components/toggle/toggle.d.ts +15 -0
- package/dist/components/toggle/toggle.js +137 -0
- package/dist/components/token-input/token-input.d.ts +7 -0
- package/dist/components/token-input/token-input.js +117 -0
- package/dist/components/tool/tool.d.ts +66 -0
- package/dist/components/tool/tool.js +413 -0
- package/dist/components/toolbar/toolbar.d.ts +91 -0
- package/dist/components/toolbar/toolbar.js +655 -0
- package/dist/components/tooltip/tooltip.d.ts +8 -0
- package/dist/components/tooltip/tooltip.js +97 -0
- package/dist/components/trace/trace.d.ts +31 -0
- package/dist/components/trace/trace.js +309 -0
- package/dist/components/tree/tree.d.ts +13 -0
- package/dist/components/tree/tree.js +258 -0
- package/dist/components/trigger-menu/trigger-menu.d.ts +30 -0
- package/dist/components/trigger-menu/trigger-menu.js +352 -0
- package/dist/components/usage/usage.d.ts +132 -0
- package/dist/components/usage/usage.js +1368 -0
- package/dist/components/waterfall/waterfall.d.ts +20 -0
- package/dist/components/waterfall/waterfall.js +360 -0
- package/dist/components/week-strip/week-strip.d.ts +177 -0
- package/dist/components/week-strip/week-strip.js +1081 -0
- package/dist/core/index.d.ts +7 -0
- package/dist/core/index.js +27 -0
- package/dist/core/ui-sdk.d.ts +3 -0
- package/dist/core/ui-sdk.js +3 -0
- package/dist/core/use-primitive-state.d.ts +14 -0
- package/dist/core/use-primitive-state.js +25 -0
- package/dist/styles/LICENSE-shadcn.md +21 -0
- package/dist/styles/color-scheme.css +32 -0
- package/dist/styles/components.css +303 -0
- package/dist/styles/index.css +41 -0
- package/dist/styles/tokens.css +474 -0
- package/dist/styles/typeset/shadcn.css +506 -0
- package/dist/styles/typeset.css +70 -0
- package/dist/styles/utilities.css +555 -0
- package/dist/tools/observe/index.d.ts +2 -0
- package/dist/tools/observe/index.js +3 -0
- package/dist/tools/observe/ui-sdk.d.ts +1 -0
- package/dist/tools/observe/ui-sdk.js +2 -0
- package/dist/tools/testing/check-agent.d.ts +28 -0
- package/dist/tools/testing/check-agent.js +42 -0
- package/dist/tools/testing/index.d.ts +4 -0
- package/dist/tools/testing/index.js +4 -0
- package/dist/tools/testing/ui-sdk.d.ts +1 -0
- package/dist/tools/testing/ui-sdk.js +2 -0
- package/dist/utilities/cn/index.d.ts +12 -0
- package/dist/utilities/cn/index.js +47 -0
- package/dist/utilities/color/index.d.ts +2 -0
- package/dist/utilities/color/index.js +3 -0
- package/dist/utilities/color/ui-sdk.d.ts +1 -0
- package/dist/utilities/color/ui-sdk.js +2 -0
- package/dist/utilities/date/index.d.ts +2 -0
- package/dist/utilities/date/index.js +6 -0
- package/dist/utilities/date/ui-sdk.d.ts +1 -0
- package/dist/utilities/date/ui-sdk.js +2 -0
- package/dist/utilities/image/index.d.ts +2 -0
- package/dist/utilities/image/index.js +3 -0
- package/dist/utilities/image/ui-sdk.d.ts +1 -0
- package/dist/utilities/image/ui-sdk.js +2 -0
- package/dist/utilities/mobile/index.d.ts +2 -0
- package/dist/utilities/mobile/index.js +1 -0
- package/dist/utilities/mobile/ui-sdk.d.ts +2 -0
- package/dist/utilities/mobile/ui-sdk.js +1 -0
- package/dist/utilities/number/index.d.ts +2 -0
- package/dist/utilities/number/index.js +3 -0
- package/dist/utilities/number/ui-sdk.d.ts +1 -0
- package/dist/utilities/number/ui-sdk.js +2 -0
- package/dist/utilities/platform/index.d.ts +3 -0
- package/dist/utilities/platform/index.js +14 -0
- package/dist/utilities/platform/ui-sdk.d.ts +3 -0
- package/dist/utilities/platform/ui-sdk.js +3 -0
- package/dist/utilities/storage/index.d.ts +2 -0
- package/dist/utilities/storage/index.js +1 -0
- package/dist/utilities/storage/ui-sdk.d.ts +2 -0
- package/dist/utilities/storage/ui-sdk.js +1 -0
- package/dist/utilities/text/index.d.ts +3 -0
- package/dist/utilities/text/index.js +3 -0
- package/dist/utilities/text/ui-sdk.d.ts +3 -0
- package/dist/utilities/text/ui-sdk.js +3 -0
- package/package.json +192 -4
- package/skills/agent-ready-ui/SKILL.md +229 -0
- package/skills/blocks/SKILL.md +262 -0
- package/skills/compose-screens/SKILL.md +354 -0
- package/skills/note-editor/SKILL.md +493 -0
- package/skills/note-status/SKILL.md +295 -0
- package/skills/setup/SKILL.md +136 -0
- package/skills/theming/SKILL.md +216 -0
- package/src/blocks/notes/adapters.ts +77 -0
- package/src/blocks/notes/data.ts +508 -0
- package/src/blocks/notes/notes-block.tsx +244 -0
- package/src/blocks/notes/parts/home.tsx +219 -0
- package/src/blocks/notes/parts/no-access.tsx +84 -0
- package/src/blocks/notes/parts/note-screen.tsx +412 -0
- package/src/blocks/notes/parts/notes-sidebar.tsx +277 -0
- package/src/blocks/notes/parts/panels.tsx +393 -0
- package/src/blocks/notes/parts/place.ts +15 -0
- package/src/blocks/notes/parts/review-dialog.tsx +159 -0
- package/src/blocks/notes/parts/share.tsx +172 -0
- package/src/blocks/notes/texts.ts +135 -0
- package/src/blocks/shell/adapters.ts +69 -0
- package/src/blocks/shell/data.ts +281 -0
- package/src/blocks/shell/parts/compose.tsx +292 -0
- package/src/blocks/shell/parts/home.tsx +203 -0
- package/src/blocks/shell/parts/marks.tsx +144 -0
- package/src/blocks/shell/parts/rail.tsx +166 -0
- package/src/blocks/shell/parts/rooms-column.tsx +326 -0
- package/src/blocks/shell/shell-block.tsx +210 -0
- package/src/blocks/shell/texts.ts +80 -0
|
@@ -0,0 +1,316 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { cn } from "../../../utilities/cn/index.js";
|
|
3
|
+
import { Button } from "../../button/button.js";
|
|
4
|
+
import { Icon } from "../../icon/icon.js";
|
|
5
|
+
import { NoteEditorContext } from "../editor.js";
|
|
6
|
+
import { blockText, suggestionHost } from "../people.js";
|
|
7
|
+
import { c } from "react/compiler-runtime";
|
|
8
|
+
import { use } from "react";
|
|
9
|
+
import { Fragment as Fragment$1, jsx, jsxs } from "react/jsx-runtime";
|
|
10
|
+
import { BotIcon, DatabaseIcon } from "@hugeicons/core-free-icons";
|
|
11
|
+
import { createPortal } from "react-dom";
|
|
12
|
+
// src/components/note-editor/parts/suggestions.tsx
|
|
13
|
+
const defaultLabels = {
|
|
14
|
+
accept: "Accept",
|
|
15
|
+
discard: "Discard",
|
|
16
|
+
redo: "Redo on the new text",
|
|
17
|
+
stale: "Out of date",
|
|
18
|
+
suggestion: (author, block) => `${author}'s suggestion on «${block}»`
|
|
19
|
+
};
|
|
20
|
+
const source = (pressed) => ({ source: pressed === "agent" ? "agent" : "person" });
|
|
21
|
+
/** The start of a block's text, to name a suggestion by. */
|
|
22
|
+
function blockExcerpt(editor, blockId) {
|
|
23
|
+
if (!editor || editor.isDestroyed) return blockId;
|
|
24
|
+
const text = blockText(editor.state.doc, blockId).replaceAll("\n", " ").trim();
|
|
25
|
+
if (!text) return blockId;
|
|
26
|
+
return text.length > 32 ? `${text.slice(0, 32).trimEnd()}…` : text;
|
|
27
|
+
}
|
|
28
|
+
/** The assistant's mark: a dark square with its violet dot. Its events in the history take it too. */
|
|
29
|
+
function NoteEditorAssistantMark(t0) {
|
|
30
|
+
const $ = c(9);
|
|
31
|
+
let className;
|
|
32
|
+
let props;
|
|
33
|
+
if ($[0] !== t0) {
|
|
34
|
+
({className, ...props} = t0);
|
|
35
|
+
$[0] = t0;
|
|
36
|
+
$[1] = className;
|
|
37
|
+
$[2] = props;
|
|
38
|
+
} else {
|
|
39
|
+
className = $[1];
|
|
40
|
+
props = $[2];
|
|
41
|
+
}
|
|
42
|
+
let t1;
|
|
43
|
+
if ($[3] !== className) {
|
|
44
|
+
t1 = cn("flex size-4 shrink-0 items-center justify-center rounded-xs bg-foreground", className);
|
|
45
|
+
$[3] = className;
|
|
46
|
+
$[4] = t1;
|
|
47
|
+
} else t1 = $[4];
|
|
48
|
+
let t2;
|
|
49
|
+
if ($[5] === Symbol.for("react.memo_cache_sentinel")) {
|
|
50
|
+
t2 = /* @__PURE__ */ jsx("span", { className: "size-1 rounded-full bg-assistant" });
|
|
51
|
+
$[5] = t2;
|
|
52
|
+
} else t2 = $[5];
|
|
53
|
+
let t3;
|
|
54
|
+
if ($[6] !== props || $[7] !== t1) {
|
|
55
|
+
t3 = /* @__PURE__ */ jsx("span", {
|
|
56
|
+
"aria-hidden": "true",
|
|
57
|
+
"data-slot": "note-editor-assistant-mark",
|
|
58
|
+
className: t1,
|
|
59
|
+
...props,
|
|
60
|
+
children: t2
|
|
61
|
+
});
|
|
62
|
+
$[6] = props;
|
|
63
|
+
$[7] = t1;
|
|
64
|
+
$[8] = t3;
|
|
65
|
+
} else t3 = $[8];
|
|
66
|
+
return t3;
|
|
67
|
+
}
|
|
68
|
+
/** The assistant's mark, or an agent's: its picture, or a quiet bot. */
|
|
69
|
+
function AuthorMark(t0) {
|
|
70
|
+
const $ = c(3);
|
|
71
|
+
const { author, kind } = t0;
|
|
72
|
+
if (kind === "assistant") {
|
|
73
|
+
let t1;
|
|
74
|
+
if ($[0] === Symbol.for("react.memo_cache_sentinel")) {
|
|
75
|
+
t1 = /* @__PURE__ */ jsx(NoteEditorAssistantMark, {});
|
|
76
|
+
$[0] = t1;
|
|
77
|
+
} else t1 = $[0];
|
|
78
|
+
return t1;
|
|
79
|
+
}
|
|
80
|
+
let t1;
|
|
81
|
+
if ($[1] !== author.image) {
|
|
82
|
+
t1 = /* @__PURE__ */ jsx("span", {
|
|
83
|
+
"aria-hidden": "true",
|
|
84
|
+
className: "flex size-4 shrink-0 items-center justify-center overflow-hidden rounded-xs border border-border bg-muted text-muted-foreground",
|
|
85
|
+
children: author.image ? /* @__PURE__ */ jsx("img", {
|
|
86
|
+
src: author.image,
|
|
87
|
+
alt: "",
|
|
88
|
+
className: "size-full object-cover"
|
|
89
|
+
}) : /* @__PURE__ */ jsx(Icon, {
|
|
90
|
+
icon: BotIcon,
|
|
91
|
+
className: "size-2.5"
|
|
92
|
+
})
|
|
93
|
+
});
|
|
94
|
+
$[1] = author.image;
|
|
95
|
+
$[2] = t1;
|
|
96
|
+
} else t1 = $[2];
|
|
97
|
+
return t1;
|
|
98
|
+
}
|
|
99
|
+
/**
|
|
100
|
+
* One suggestion: who wrote it and what it does, the text, what it read and
|
|
101
|
+
* Accept or Discard. `NoteEditorSuggestions` draws each one under its block;
|
|
102
|
+
* render this one yourself for a list beside the note.
|
|
103
|
+
*/
|
|
104
|
+
function NoteEditorSuggestion(t0) {
|
|
105
|
+
const $ = c(44);
|
|
106
|
+
let blockLabel;
|
|
107
|
+
let className;
|
|
108
|
+
let onAccept;
|
|
109
|
+
let onDiscard;
|
|
110
|
+
let onRedo;
|
|
111
|
+
let own;
|
|
112
|
+
let props;
|
|
113
|
+
let suggestion;
|
|
114
|
+
if ($[0] !== t0) {
|
|
115
|
+
({suggestion, onAccept, onDiscard, onRedo, labels: own, blockLabel, className, ...props} = t0);
|
|
116
|
+
$[0] = t0;
|
|
117
|
+
$[1] = blockLabel;
|
|
118
|
+
$[2] = className;
|
|
119
|
+
$[3] = onAccept;
|
|
120
|
+
$[4] = onDiscard;
|
|
121
|
+
$[5] = onRedo;
|
|
122
|
+
$[6] = own;
|
|
123
|
+
$[7] = props;
|
|
124
|
+
$[8] = suggestion;
|
|
125
|
+
} else {
|
|
126
|
+
blockLabel = $[1];
|
|
127
|
+
className = $[2];
|
|
128
|
+
onAccept = $[3];
|
|
129
|
+
onDiscard = $[4];
|
|
130
|
+
onRedo = $[5];
|
|
131
|
+
own = $[6];
|
|
132
|
+
props = $[7];
|
|
133
|
+
suggestion = $[8];
|
|
134
|
+
}
|
|
135
|
+
const labels = {
|
|
136
|
+
...defaultLabels,
|
|
137
|
+
...own
|
|
138
|
+
};
|
|
139
|
+
const context = use(NoteEditorContext);
|
|
140
|
+
const accept = onAccept ?? context?.onSuggestionAccept;
|
|
141
|
+
const discard = onDiscard ?? context?.onSuggestionDiscard;
|
|
142
|
+
const redo = onRedo ?? context?.onSuggestionRedo;
|
|
143
|
+
const kind = suggestion.kind ?? "agent";
|
|
144
|
+
const state = suggestion.state ?? "proposed";
|
|
145
|
+
const assistant = kind === "assistant";
|
|
146
|
+
let t1;
|
|
147
|
+
if ($[9] !== blockLabel || $[10] !== context?.editor || $[11] !== suggestion.blockId) {
|
|
148
|
+
t1 = blockLabel ?? blockExcerpt(context?.editor ?? null, suggestion.blockId);
|
|
149
|
+
$[9] = blockLabel;
|
|
150
|
+
$[10] = context?.editor;
|
|
151
|
+
$[11] = suggestion.blockId;
|
|
152
|
+
$[12] = t1;
|
|
153
|
+
} else t1 = $[12];
|
|
154
|
+
const name = labels.suggestion(suggestion.author.name, t1);
|
|
155
|
+
const t2 = assistant ? "rounded-e-xl border-s-2 border-assistant bg-assistant/6 py-3 ps-4 pe-3.5" : "rounded-xl border border-border bg-card px-4 py-3.5 text-card-foreground shadow-sm";
|
|
156
|
+
const t3 = state !== "proposed" && (assistant ? "border-dashed" : "border-dashed border-input shadow-none");
|
|
157
|
+
let t4;
|
|
158
|
+
if ($[13] !== className || $[14] !== t2 || $[15] !== t3) {
|
|
159
|
+
t4 = cn("flex flex-col gap-2.5 text-start", t2, t3, className);
|
|
160
|
+
$[13] = className;
|
|
161
|
+
$[14] = t2;
|
|
162
|
+
$[15] = t3;
|
|
163
|
+
$[16] = t4;
|
|
164
|
+
} else t4 = $[16];
|
|
165
|
+
let t5;
|
|
166
|
+
if ($[17] !== kind || $[18] !== suggestion.author) {
|
|
167
|
+
t5 = /* @__PURE__ */ jsx(AuthorMark, {
|
|
168
|
+
author: suggestion.author,
|
|
169
|
+
kind
|
|
170
|
+
});
|
|
171
|
+
$[17] = kind;
|
|
172
|
+
$[18] = suggestion.author;
|
|
173
|
+
$[19] = t5;
|
|
174
|
+
} else t5 = $[19];
|
|
175
|
+
const t6 = state === "stale" ? /* @__PURE__ */ jsxs("span", {
|
|
176
|
+
className: "min-w-0 text-subtle",
|
|
177
|
+
children: [labels.stale, suggestion.staleReason && ` · ${suggestion.staleReason}`]
|
|
178
|
+
}) : /* @__PURE__ */ jsxs("span", {
|
|
179
|
+
className: "min-w-0",
|
|
180
|
+
children: [/* @__PURE__ */ jsx("span", {
|
|
181
|
+
className: cn("font-medium", assistant ? "text-assistant" : "text-foreground"),
|
|
182
|
+
children: suggestion.author.name
|
|
183
|
+
}), suggestion.summary && /* @__PURE__ */ jsxs("span", {
|
|
184
|
+
className: assistant ? "text-muted-foreground" : "text-subtle",
|
|
185
|
+
children: [" ", suggestion.summary]
|
|
186
|
+
})]
|
|
187
|
+
});
|
|
188
|
+
let t7;
|
|
189
|
+
if ($[20] !== t5 || $[21] !== t6) {
|
|
190
|
+
t7 = /* @__PURE__ */ jsxs("div", {
|
|
191
|
+
className: "flex min-w-0 items-center gap-2 text-xs",
|
|
192
|
+
role: "status",
|
|
193
|
+
children: [t5, t6]
|
|
194
|
+
});
|
|
195
|
+
$[20] = t5;
|
|
196
|
+
$[21] = t6;
|
|
197
|
+
$[22] = t7;
|
|
198
|
+
} else t7 = $[22];
|
|
199
|
+
const t8 = state === "proposed" ? "text-foreground" : "text-muted-foreground";
|
|
200
|
+
let t9;
|
|
201
|
+
if ($[23] !== t8) {
|
|
202
|
+
t9 = cn("text-chat whitespace-pre-wrap", t8);
|
|
203
|
+
$[23] = t8;
|
|
204
|
+
$[24] = t9;
|
|
205
|
+
} else t9 = $[24];
|
|
206
|
+
let t10;
|
|
207
|
+
if ($[25] !== state) {
|
|
208
|
+
t10 = state === "writing" && /* @__PURE__ */ jsx("span", {
|
|
209
|
+
"aria-hidden": "true",
|
|
210
|
+
className: "ms-px inline-block h-5 w-0.5 translate-y-1 bg-foreground"
|
|
211
|
+
});
|
|
212
|
+
$[25] = state;
|
|
213
|
+
$[26] = t10;
|
|
214
|
+
} else t10 = $[26];
|
|
215
|
+
let t11;
|
|
216
|
+
if ($[27] !== suggestion.text || $[28] !== t10 || $[29] !== t9) {
|
|
217
|
+
t11 = /* @__PURE__ */ jsxs("p", {
|
|
218
|
+
className: t9,
|
|
219
|
+
children: [suggestion.text, t10]
|
|
220
|
+
});
|
|
221
|
+
$[27] = suggestion.text;
|
|
222
|
+
$[28] = t10;
|
|
223
|
+
$[29] = t9;
|
|
224
|
+
$[30] = t11;
|
|
225
|
+
} else t11 = $[30];
|
|
226
|
+
let t12;
|
|
227
|
+
if ($[31] !== state || $[32] !== suggestion.conflict) {
|
|
228
|
+
t12 = suggestion.conflict && state !== "writing" && /* @__PURE__ */ jsxs("p", {
|
|
229
|
+
className: "flex items-start gap-2 text-sm text-warning",
|
|
230
|
+
children: [/* @__PURE__ */ jsx("span", {
|
|
231
|
+
"aria-hidden": "true",
|
|
232
|
+
className: "mt-1.5 size-1.5 shrink-0 rounded-full bg-warning"
|
|
233
|
+
}), suggestion.conflict]
|
|
234
|
+
});
|
|
235
|
+
$[31] = state;
|
|
236
|
+
$[32] = suggestion.conflict;
|
|
237
|
+
$[33] = t12;
|
|
238
|
+
} else t12 = $[33];
|
|
239
|
+
const t13 = state !== "writing" && /* @__PURE__ */ jsxs("div", {
|
|
240
|
+
className: "flex flex-wrap items-center gap-2",
|
|
241
|
+
children: [
|
|
242
|
+
/* @__PURE__ */ jsx("p", {
|
|
243
|
+
className: cn("flex min-w-0 flex-1 items-center gap-1.5 text-xs", assistant ? "text-muted-foreground" : "text-subtle"),
|
|
244
|
+
children: suggestion.source && /* @__PURE__ */ jsxs(Fragment$1, { children: [/* @__PURE__ */ jsx(Icon, {
|
|
245
|
+
icon: DatabaseIcon,
|
|
246
|
+
className: "size-3"
|
|
247
|
+
}), suggestion.source] })
|
|
248
|
+
}),
|
|
249
|
+
state === "stale" && redo && /* @__PURE__ */ jsx(Button, {
|
|
250
|
+
variant: "outline",
|
|
251
|
+
size: "sm",
|
|
252
|
+
"aria-label": `${labels.redo}: ${name}`,
|
|
253
|
+
onClick: (_event, details) => redo(suggestion, source(details.source)),
|
|
254
|
+
children: labels.redo
|
|
255
|
+
}),
|
|
256
|
+
discard && /* @__PURE__ */ jsx(Button, {
|
|
257
|
+
variant: "outline",
|
|
258
|
+
size: "sm",
|
|
259
|
+
"aria-label": `${labels.discard}: ${name}`,
|
|
260
|
+
onClick: (_event_0, details_0) => discard(suggestion, source(details_0.source)),
|
|
261
|
+
children: labels.discard
|
|
262
|
+
}),
|
|
263
|
+
state === "proposed" && accept && /* @__PURE__ */ jsx(Button, {
|
|
264
|
+
variant: "outline",
|
|
265
|
+
size: "sm",
|
|
266
|
+
"aria-label": `${labels.accept}: ${name}`,
|
|
267
|
+
"data-agent-confirm": `${labels.accept}: ${name}`,
|
|
268
|
+
onClick: (_event_1, details_1) => accept(suggestion, source(details_1.source)),
|
|
269
|
+
children: labels.accept
|
|
270
|
+
})
|
|
271
|
+
]
|
|
272
|
+
});
|
|
273
|
+
let t14;
|
|
274
|
+
if ($[34] !== kind || $[35] !== name || $[36] !== props || $[37] !== state || $[38] !== t11 || $[39] !== t12 || $[40] !== t13 || $[41] !== t4 || $[42] !== t7) {
|
|
275
|
+
t14 = /* @__PURE__ */ jsxs("div", {
|
|
276
|
+
role: "group",
|
|
277
|
+
"aria-label": name,
|
|
278
|
+
"data-slot": "note-editor-suggestion",
|
|
279
|
+
"data-kind": kind,
|
|
280
|
+
"data-state": state,
|
|
281
|
+
className: t4,
|
|
282
|
+
...props,
|
|
283
|
+
children: [
|
|
284
|
+
t7,
|
|
285
|
+
t11,
|
|
286
|
+
t12,
|
|
287
|
+
t13
|
|
288
|
+
]
|
|
289
|
+
});
|
|
290
|
+
$[34] = kind;
|
|
291
|
+
$[35] = name;
|
|
292
|
+
$[36] = props;
|
|
293
|
+
$[37] = state;
|
|
294
|
+
$[38] = t11;
|
|
295
|
+
$[39] = t12;
|
|
296
|
+
$[40] = t13;
|
|
297
|
+
$[41] = t4;
|
|
298
|
+
$[42] = t7;
|
|
299
|
+
$[43] = t14;
|
|
300
|
+
} else t14 = $[43];
|
|
301
|
+
return t14;
|
|
302
|
+
}
|
|
303
|
+
/**
|
|
304
|
+
* Draws each of `NoteEditor`'s `suggestions` under its block. `NoteEditor`
|
|
305
|
+
* renders one when it has no children.
|
|
306
|
+
*/
|
|
307
|
+
function NoteEditorSuggestions(props) {
|
|
308
|
+
const context = use(NoteEditorContext);
|
|
309
|
+
const editor = context?.editor;
|
|
310
|
+
if (!editor || editor.isDestroyed) return null;
|
|
311
|
+
return (context.suggestions ?? []).map((suggestion) => createPortal(/* @__PURE__ */ jsx(NoteEditorSuggestion, {
|
|
312
|
+
suggestion,
|
|
313
|
+
...props
|
|
314
|
+
}), suggestionHost(editor.view, suggestion.id), suggestion.id));
|
|
315
|
+
}
|
|
316
|
+
export { NoteEditorAssistantMark, NoteEditorSuggestion, NoteEditorSuggestions };
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import { PopoverContent } from "../../popover/popover.js";
|
|
2
|
+
import { NoteBlockType } from "../blocks.js";
|
|
3
|
+
import { ComponentProps, ReactNode } from "react";
|
|
4
|
+
type NoteEditorToolbarLabels = {
|
|
5
|
+
/** The floating panel's accessible name, which an agent sees. */
|
|
6
|
+
panel: string;
|
|
7
|
+
/** The toolbar's accessible name. */
|
|
8
|
+
toolbar: string;
|
|
9
|
+
blockType: string;
|
|
10
|
+
bold: string;
|
|
11
|
+
italic: string;
|
|
12
|
+
underline: string;
|
|
13
|
+
strike: string;
|
|
14
|
+
code: string;
|
|
15
|
+
quote: string;
|
|
16
|
+
link: string;
|
|
17
|
+
linkAddress: string;
|
|
18
|
+
applyLink: string;
|
|
19
|
+
removeLink: string;
|
|
20
|
+
list: string;
|
|
21
|
+
/** Starts a thread on the selected text. Shown when `NoteEditor` has `onComment`. */
|
|
22
|
+
comment: string;
|
|
23
|
+
/** Each block type's name, in the block type's select and the list menu. */
|
|
24
|
+
blocks: Record<Exclude<NoteBlockType, "divider">, string>;
|
|
25
|
+
};
|
|
26
|
+
type NoteEditorToolbarProps = Omit<ComponentProps<typeof PopoverContent>, "children"> & {
|
|
27
|
+
/** Replaces any of the default names, to translate them. */
|
|
28
|
+
labels?: Partial<NoteEditorToolbarLabels>;
|
|
29
|
+
/** The app's own actions, after a separator, like "Ask the assistant". */
|
|
30
|
+
children?: ReactNode;
|
|
31
|
+
};
|
|
32
|
+
/**
|
|
33
|
+
* Floats over selected text with the block's type, bold, italic, underline,
|
|
34
|
+
* strikethrough, a quote, inline code, a link and the lists. Alt+F10 moves
|
|
35
|
+
* focus into it from the note, and Escape hides it until the selection changes.
|
|
36
|
+
*/
|
|
37
|
+
declare function NoteEditorToolbar({ labels: own, className, children, ...props }: NoteEditorToolbarProps): import("react").JSX.Element;
|
|
38
|
+
export { NoteEditorToolbar, type NoteEditorToolbarLabels, type NoteEditorToolbarProps };
|