@asanchez-sa/abby 0.0.0-stage → 0.1.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/README.md +217 -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 +336 -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 +683 -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,683 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { cnState } from "../../../utilities/cn/index.js";
|
|
3
|
+
import { Button } from "../../button/button.js";
|
|
4
|
+
import { Icon } from "../../icon/icon.js";
|
|
5
|
+
import { Input } from "../../input/input.js";
|
|
6
|
+
import { Menu, MenuContent, MenuItemIcon, MenuItemIndicator, MenuRadioGroup, MenuRadioItem, MenuTrigger } from "../../menu/menu.js";
|
|
7
|
+
import { Popover, PopoverContent, PopoverTrigger } from "../../popover/popover.js";
|
|
8
|
+
import { Select, SelectContent, SelectTrigger } from "../../select/select.js";
|
|
9
|
+
import { Toggle, ToggleIcon } from "../../toggle/toggle.js";
|
|
10
|
+
import { Toolbar, ToolbarButton, ToolbarCaret, ToolbarSeparator } from "../../toolbar/toolbar.js";
|
|
11
|
+
import { NoteEditorContext, asOneStep, focusEditor, selectionStore, setBlockType } from "../editor.js";
|
|
12
|
+
import { blockIdAt } from "../people.js";
|
|
13
|
+
import { c } from "react/compiler-runtime";
|
|
14
|
+
import { use, useState, useSyncExternalStore } from "react";
|
|
15
|
+
import { Fragment as Fragment$1, jsx, jsxs } from "react/jsx-runtime";
|
|
16
|
+
import { CheckListIcon, CodeIcon, Comment01Icon, LeftToRightListBulletIcon, LeftToRightListNumberIcon, Link01Icon, QuoteDownIcon, TextBoldIcon, TextItalicIcon, TextStrikethroughIcon, TextUnderlineIcon } from "@hugeicons/core-free-icons";
|
|
17
|
+
import { posToDOMRect } from "@tiptap/core";
|
|
18
|
+
import { TextSelection } from "@tiptap/pm/state";
|
|
19
|
+
// src/components/note-editor/parts/toolbar.tsx
|
|
20
|
+
const defaultLabels = {
|
|
21
|
+
panel: "Selected text",
|
|
22
|
+
toolbar: "Format",
|
|
23
|
+
blockType: "Block type",
|
|
24
|
+
bold: "Bold",
|
|
25
|
+
italic: "Italic",
|
|
26
|
+
underline: "Underline",
|
|
27
|
+
strike: "Strikethrough",
|
|
28
|
+
code: "Inline code",
|
|
29
|
+
quote: "Quote",
|
|
30
|
+
link: "Link",
|
|
31
|
+
linkAddress: "Link address",
|
|
32
|
+
applyLink: "Apply",
|
|
33
|
+
removeLink: "Remove link",
|
|
34
|
+
list: "List",
|
|
35
|
+
comment: "Comment",
|
|
36
|
+
blocks: {
|
|
37
|
+
paragraph: "Text",
|
|
38
|
+
"heading-1": "Heading 1",
|
|
39
|
+
"heading-2": "Heading 2",
|
|
40
|
+
"heading-3": "Heading 3",
|
|
41
|
+
bulleted: "Bulleted list",
|
|
42
|
+
numbered: "Numbered list",
|
|
43
|
+
todo: "To-do list",
|
|
44
|
+
quote: "Quote",
|
|
45
|
+
code: "Code"
|
|
46
|
+
}
|
|
47
|
+
};
|
|
48
|
+
const marks = [
|
|
49
|
+
{
|
|
50
|
+
mark: "bold",
|
|
51
|
+
icon: TextBoldIcon
|
|
52
|
+
},
|
|
53
|
+
{
|
|
54
|
+
mark: "italic",
|
|
55
|
+
icon: TextItalicIcon
|
|
56
|
+
},
|
|
57
|
+
{
|
|
58
|
+
mark: "underline",
|
|
59
|
+
icon: TextUnderlineIcon
|
|
60
|
+
},
|
|
61
|
+
{
|
|
62
|
+
mark: "strike",
|
|
63
|
+
icon: TextStrikethroughIcon
|
|
64
|
+
}
|
|
65
|
+
];
|
|
66
|
+
const lists = [
|
|
67
|
+
{
|
|
68
|
+
type: "bulleted",
|
|
69
|
+
icon: LeftToRightListBulletIcon
|
|
70
|
+
},
|
|
71
|
+
{
|
|
72
|
+
type: "numbered",
|
|
73
|
+
icon: LeftToRightListNumberIcon
|
|
74
|
+
},
|
|
75
|
+
{
|
|
76
|
+
type: "todo",
|
|
77
|
+
icon: CheckListIcon
|
|
78
|
+
}
|
|
79
|
+
];
|
|
80
|
+
function toggleMark(editor, mark) {
|
|
81
|
+
return asOneStep(editor, () => toggleMarkNow(editor, mark));
|
|
82
|
+
}
|
|
83
|
+
function toggleMarkNow(editor, mark) {
|
|
84
|
+
const chain = editor.chain();
|
|
85
|
+
switch (mark) {
|
|
86
|
+
case "bold": return chain.toggleBold().run();
|
|
87
|
+
case "italic": return chain.toggleItalic().run();
|
|
88
|
+
case "underline": return chain.toggleUnderline().run();
|
|
89
|
+
case "strike": return chain.toggleStrike().run();
|
|
90
|
+
case "code": return chain.toggleCode().run();
|
|
91
|
+
}
|
|
92
|
+
}
|
|
93
|
+
const noSubscription = () => () => {};
|
|
94
|
+
/** The selection's snapshot, or null before the editor exists. */
|
|
95
|
+
function useSelection(editor) {
|
|
96
|
+
const $ = c(4);
|
|
97
|
+
let t0;
|
|
98
|
+
if ($[0] !== editor) {
|
|
99
|
+
t0 = editor ? selectionStore(editor) : null;
|
|
100
|
+
$[0] = editor;
|
|
101
|
+
$[1] = t0;
|
|
102
|
+
} else t0 = $[1];
|
|
103
|
+
const store = t0;
|
|
104
|
+
let t1;
|
|
105
|
+
if ($[2] !== store) {
|
|
106
|
+
t1 = () => store?.get() ?? null;
|
|
107
|
+
$[2] = store;
|
|
108
|
+
$[3] = t1;
|
|
109
|
+
} else t1 = $[3];
|
|
110
|
+
return useSyncExternalStore(store ? store.subscribe : noSubscription, t1, _temp);
|
|
111
|
+
}
|
|
112
|
+
function _temp() {
|
|
113
|
+
return null;
|
|
114
|
+
}
|
|
115
|
+
const itemClasses = "h-(--toolbar-item) min-w-(--toolbar-item) rounded-(--toolbar-radius) px-0 [&_[data-slot=icon]]:size-(--toolbar-icon)";
|
|
116
|
+
const keepFocus = (event) => event.preventDefault();
|
|
117
|
+
/**
|
|
118
|
+
* Floats over selected text with the block's type, bold, italic, underline,
|
|
119
|
+
* strikethrough, a quote, inline code, a link and the lists. Alt+F10 moves
|
|
120
|
+
* focus into it from the note, and Escape hides it until the selection changes.
|
|
121
|
+
*/
|
|
122
|
+
function NoteEditorToolbar(t0) {
|
|
123
|
+
const $ = c(132);
|
|
124
|
+
let children;
|
|
125
|
+
let className;
|
|
126
|
+
let own;
|
|
127
|
+
let props;
|
|
128
|
+
if ($[0] !== t0) {
|
|
129
|
+
({labels: own, className, children, ...props} = t0);
|
|
130
|
+
$[0] = t0;
|
|
131
|
+
$[1] = children;
|
|
132
|
+
$[2] = className;
|
|
133
|
+
$[3] = own;
|
|
134
|
+
$[4] = props;
|
|
135
|
+
} else {
|
|
136
|
+
children = $[1];
|
|
137
|
+
className = $[2];
|
|
138
|
+
own = $[3];
|
|
139
|
+
props = $[4];
|
|
140
|
+
}
|
|
141
|
+
const t1 = own?.blocks;
|
|
142
|
+
let t2;
|
|
143
|
+
if ($[5] !== t1) {
|
|
144
|
+
t2 = {
|
|
145
|
+
...defaultLabels.blocks,
|
|
146
|
+
...t1
|
|
147
|
+
};
|
|
148
|
+
$[5] = t1;
|
|
149
|
+
$[6] = t2;
|
|
150
|
+
} else t2 = $[6];
|
|
151
|
+
let t3;
|
|
152
|
+
if ($[7] !== own || $[8] !== t2) {
|
|
153
|
+
t3 = {
|
|
154
|
+
...defaultLabels,
|
|
155
|
+
...own,
|
|
156
|
+
blocks: t2
|
|
157
|
+
};
|
|
158
|
+
$[7] = own;
|
|
159
|
+
$[8] = t2;
|
|
160
|
+
$[9] = t3;
|
|
161
|
+
} else t3 = $[9];
|
|
162
|
+
const labels = t3;
|
|
163
|
+
const context = use(NoteEditorContext);
|
|
164
|
+
const editor = context?.editor ?? null;
|
|
165
|
+
const onComment = context?.onComment;
|
|
166
|
+
const selection = useSelection(editor);
|
|
167
|
+
const [within, setWithin] = useState(false);
|
|
168
|
+
const [dismissed, setDismissed] = useState(null);
|
|
169
|
+
const [linkOpen, setLinkOpen] = useState(false);
|
|
170
|
+
const key = selection ? `${selection.from}:${selection.to}` : "";
|
|
171
|
+
const open = !!editor && !!selection?.formattable && (selection.focused || within || linkOpen) && dismissed !== key;
|
|
172
|
+
let t4;
|
|
173
|
+
if ($[10] !== editor) {
|
|
174
|
+
t4 = { getBoundingClientRect: () => {
|
|
175
|
+
if (!editor || editor.isDestroyed) return new DOMRect();
|
|
176
|
+
const { from, to } = editor.state.selection;
|
|
177
|
+
return posToDOMRect(editor.view, from, to);
|
|
178
|
+
} };
|
|
179
|
+
$[10] = editor;
|
|
180
|
+
$[11] = t4;
|
|
181
|
+
} else t4 = $[11];
|
|
182
|
+
const anchor = t4;
|
|
183
|
+
let t5;
|
|
184
|
+
if ($[12] !== editor) {
|
|
185
|
+
t5 = (toolbar) => {
|
|
186
|
+
if (!toolbar || !editor) return;
|
|
187
|
+
const dom = editor.view.dom;
|
|
188
|
+
const onKeyDown = (event) => {
|
|
189
|
+
if (event.key !== "F10" || !event.altKey) return;
|
|
190
|
+
event.preventDefault();
|
|
191
|
+
toolbar.querySelector("button:not([disabled]), [tabindex='0']")?.focus();
|
|
192
|
+
};
|
|
193
|
+
dom.addEventListener("keydown", onKeyDown);
|
|
194
|
+
return () => dom.removeEventListener("keydown", onKeyDown);
|
|
195
|
+
};
|
|
196
|
+
$[12] = editor;
|
|
197
|
+
$[13] = t5;
|
|
198
|
+
} else t5 = $[13];
|
|
199
|
+
const reach = t5;
|
|
200
|
+
let t6;
|
|
201
|
+
if ($[14] !== labels.blocks) {
|
|
202
|
+
t6 = Object.entries(labels.blocks).map(_temp2);
|
|
203
|
+
$[14] = labels.blocks;
|
|
204
|
+
$[15] = t6;
|
|
205
|
+
} else t6 = $[15];
|
|
206
|
+
const blockItems = t6;
|
|
207
|
+
let t7;
|
|
208
|
+
if ($[16] !== selection) {
|
|
209
|
+
t7 = selection && lists.some((t8) => {
|
|
210
|
+
const { type } = t8;
|
|
211
|
+
return type === selection.block;
|
|
212
|
+
}) ? selection.block : "";
|
|
213
|
+
$[16] = selection;
|
|
214
|
+
$[17] = t7;
|
|
215
|
+
} else t7 = $[17];
|
|
216
|
+
const list = t7;
|
|
217
|
+
let t8;
|
|
218
|
+
if ($[18] !== editor) {
|
|
219
|
+
t8 = (href) => {
|
|
220
|
+
if (!editor) return;
|
|
221
|
+
focusEditor(editor);
|
|
222
|
+
const chain = editor.chain().extendMarkRange("link");
|
|
223
|
+
if (href.trim()) chain.setLink({ href: href.trim() }).run();
|
|
224
|
+
else chain.unsetLink().run();
|
|
225
|
+
setLinkOpen(false);
|
|
226
|
+
};
|
|
227
|
+
$[18] = editor;
|
|
228
|
+
$[19] = t8;
|
|
229
|
+
} else t8 = $[19];
|
|
230
|
+
const applyLink = t8;
|
|
231
|
+
let t9;
|
|
232
|
+
if ($[20] !== editor) {
|
|
233
|
+
t9 = !!editor && !editor.isDestroyed && editor.state.selection.$from.sameParent(editor.state.selection.$to);
|
|
234
|
+
$[20] = editor;
|
|
235
|
+
$[21] = t9;
|
|
236
|
+
} else t9 = $[21];
|
|
237
|
+
const commentable = t9;
|
|
238
|
+
let t10;
|
|
239
|
+
if ($[22] !== editor || $[23] !== onComment) {
|
|
240
|
+
t10 = () => {
|
|
241
|
+
if (!editor || editor.isDestroyed || !onComment) return;
|
|
242
|
+
const { state } = editor;
|
|
243
|
+
const { from: from_0, to: to_0, $from, $to } = state.selection;
|
|
244
|
+
if (from_0 === to_0 || !$from.sameParent($to)) return;
|
|
245
|
+
const blockId = blockIdAt(state, from_0);
|
|
246
|
+
if (!blockId) return;
|
|
247
|
+
onComment({
|
|
248
|
+
blockId,
|
|
249
|
+
quote: state.doc.textBetween(from_0, to_0, "\n", _temp3)
|
|
250
|
+
}, { source: "person" });
|
|
251
|
+
focusEditor(editor);
|
|
252
|
+
editor.view.dispatch(state.tr.setSelection(TextSelection.create(state.doc, to_0)));
|
|
253
|
+
};
|
|
254
|
+
$[22] = editor;
|
|
255
|
+
$[23] = onComment;
|
|
256
|
+
$[24] = t10;
|
|
257
|
+
} else t10 = $[24];
|
|
258
|
+
const comment = t10;
|
|
259
|
+
let t11;
|
|
260
|
+
if ($[25] !== editor || $[26] !== key) {
|
|
261
|
+
t11 = (next, details) => {
|
|
262
|
+
if (next || details.reason !== "escape-key") return;
|
|
263
|
+
setDismissed(key);
|
|
264
|
+
setWithin(false);
|
|
265
|
+
if (editor) focusEditor(editor);
|
|
266
|
+
};
|
|
267
|
+
$[25] = editor;
|
|
268
|
+
$[26] = key;
|
|
269
|
+
$[27] = t11;
|
|
270
|
+
} else t11 = $[27];
|
|
271
|
+
const t12 = labels.panel;
|
|
272
|
+
let t13;
|
|
273
|
+
if ($[28] !== className) {
|
|
274
|
+
t13 = cnState("data-[presentation=popover]:w-auto data-[presentation=popover]:rounded-xl data-[presentation=popover]:p-0", className);
|
|
275
|
+
$[28] = className;
|
|
276
|
+
$[29] = t13;
|
|
277
|
+
} else t13 = $[29];
|
|
278
|
+
let t14;
|
|
279
|
+
let t15;
|
|
280
|
+
if ($[30] === Symbol.for("react.memo_cache_sentinel")) {
|
|
281
|
+
t14 = () => setWithin(true);
|
|
282
|
+
t15 = (event_0) => {
|
|
283
|
+
if (!event_0.currentTarget.contains(event_0.relatedTarget)) setWithin(false);
|
|
284
|
+
};
|
|
285
|
+
$[30] = t14;
|
|
286
|
+
$[31] = t15;
|
|
287
|
+
} else {
|
|
288
|
+
t14 = $[30];
|
|
289
|
+
t15 = $[31];
|
|
290
|
+
}
|
|
291
|
+
const t16 = labels.toolbar;
|
|
292
|
+
const t17 = selection?.block === "divider" ? null : selection?.block ?? null;
|
|
293
|
+
let t18;
|
|
294
|
+
if ($[32] !== editor) {
|
|
295
|
+
t18 = (type_0) => {
|
|
296
|
+
if (editor && typeof type_0 === "string") setBlockType(editor, type_0, void 0, false);
|
|
297
|
+
};
|
|
298
|
+
$[32] = editor;
|
|
299
|
+
$[33] = t18;
|
|
300
|
+
} else t18 = $[33];
|
|
301
|
+
let t19;
|
|
302
|
+
if ($[34] === Symbol.for("react.memo_cache_sentinel")) {
|
|
303
|
+
t19 = /* @__PURE__ */ jsx(SelectTrigger, { className: "w-auto gap-1.5 border-transparent bg-transparent px-2 hover:bg-accent dark:bg-transparent" });
|
|
304
|
+
$[34] = t19;
|
|
305
|
+
} else t19 = $[34];
|
|
306
|
+
let t20;
|
|
307
|
+
if ($[35] !== labels.blockType) {
|
|
308
|
+
t20 = /* @__PURE__ */ jsx(ToolbarButton, {
|
|
309
|
+
render: t19,
|
|
310
|
+
"aria-label": labels.blockType
|
|
311
|
+
});
|
|
312
|
+
$[35] = labels.blockType;
|
|
313
|
+
$[36] = t20;
|
|
314
|
+
} else t20 = $[36];
|
|
315
|
+
let t21;
|
|
316
|
+
if ($[37] === Symbol.for("react.memo_cache_sentinel")) {
|
|
317
|
+
t21 = /* @__PURE__ */ jsx(SelectContent, {});
|
|
318
|
+
$[37] = t21;
|
|
319
|
+
} else t21 = $[37];
|
|
320
|
+
let t22;
|
|
321
|
+
if ($[38] !== blockItems || $[39] !== t17 || $[40] !== t18 || $[41] !== t20) {
|
|
322
|
+
t22 = /* @__PURE__ */ jsxs(Select, {
|
|
323
|
+
items: blockItems,
|
|
324
|
+
value: t17,
|
|
325
|
+
onValueChange: t18,
|
|
326
|
+
children: [t20, t21]
|
|
327
|
+
});
|
|
328
|
+
$[38] = blockItems;
|
|
329
|
+
$[39] = t17;
|
|
330
|
+
$[40] = t18;
|
|
331
|
+
$[41] = t20;
|
|
332
|
+
$[42] = t22;
|
|
333
|
+
} else t22 = $[42];
|
|
334
|
+
let t23;
|
|
335
|
+
if ($[43] === Symbol.for("react.memo_cache_sentinel")) {
|
|
336
|
+
t23 = /* @__PURE__ */ jsx(ToolbarSeparator, {});
|
|
337
|
+
$[43] = t23;
|
|
338
|
+
} else t23 = $[43];
|
|
339
|
+
let t24;
|
|
340
|
+
if ($[44] !== editor || $[45] !== labels || $[46] !== selection?.marks) {
|
|
341
|
+
t24 = marks.map((t25) => {
|
|
342
|
+
const { mark, icon } = t25;
|
|
343
|
+
return /* @__PURE__ */ jsx(Toggle, {
|
|
344
|
+
"aria-label": labels[mark],
|
|
345
|
+
pressed: !!selection?.marks[mark],
|
|
346
|
+
onPressedChange: () => editor && toggleMark(editor, mark),
|
|
347
|
+
onMouseDown: keepFocus,
|
|
348
|
+
className: itemClasses,
|
|
349
|
+
children: /* @__PURE__ */ jsx(ToggleIcon, { children: /* @__PURE__ */ jsx(Icon, { icon }) })
|
|
350
|
+
}, mark);
|
|
351
|
+
});
|
|
352
|
+
$[44] = editor;
|
|
353
|
+
$[45] = labels;
|
|
354
|
+
$[46] = selection?.marks;
|
|
355
|
+
$[47] = t24;
|
|
356
|
+
} else t24 = $[47];
|
|
357
|
+
const t25 = selection?.block === "quote";
|
|
358
|
+
let t26;
|
|
359
|
+
if ($[48] !== editor) {
|
|
360
|
+
t26 = (pressed) => editor && setBlockType(editor, pressed ? "quote" : "paragraph", void 0, false);
|
|
361
|
+
$[48] = editor;
|
|
362
|
+
$[49] = t26;
|
|
363
|
+
} else t26 = $[49];
|
|
364
|
+
let t27;
|
|
365
|
+
if ($[50] === Symbol.for("react.memo_cache_sentinel")) {
|
|
366
|
+
t27 = /* @__PURE__ */ jsx(ToggleIcon, { children: /* @__PURE__ */ jsx(Icon, { icon: QuoteDownIcon }) });
|
|
367
|
+
$[50] = t27;
|
|
368
|
+
} else t27 = $[50];
|
|
369
|
+
let t28;
|
|
370
|
+
if ($[51] !== labels.quote || $[52] !== t25 || $[53] !== t26) {
|
|
371
|
+
t28 = /* @__PURE__ */ jsx(Toggle, {
|
|
372
|
+
"aria-label": labels.quote,
|
|
373
|
+
pressed: t25,
|
|
374
|
+
onPressedChange: t26,
|
|
375
|
+
onMouseDown: keepFocus,
|
|
376
|
+
className: itemClasses,
|
|
377
|
+
children: t27
|
|
378
|
+
});
|
|
379
|
+
$[51] = labels.quote;
|
|
380
|
+
$[52] = t25;
|
|
381
|
+
$[53] = t26;
|
|
382
|
+
$[54] = t28;
|
|
383
|
+
} else t28 = $[54];
|
|
384
|
+
const t29 = !!selection?.marks.code;
|
|
385
|
+
let t30;
|
|
386
|
+
if ($[55] !== editor) {
|
|
387
|
+
t30 = () => editor && toggleMark(editor, "code");
|
|
388
|
+
$[55] = editor;
|
|
389
|
+
$[56] = t30;
|
|
390
|
+
} else t30 = $[56];
|
|
391
|
+
let t31;
|
|
392
|
+
if ($[57] === Symbol.for("react.memo_cache_sentinel")) {
|
|
393
|
+
t31 = /* @__PURE__ */ jsx(ToggleIcon, { children: /* @__PURE__ */ jsx(Icon, { icon: CodeIcon }) });
|
|
394
|
+
$[57] = t31;
|
|
395
|
+
} else t31 = $[57];
|
|
396
|
+
let t32;
|
|
397
|
+
if ($[58] !== labels.code || $[59] !== t29 || $[60] !== t30) {
|
|
398
|
+
t32 = /* @__PURE__ */ jsx(Toggle, {
|
|
399
|
+
"aria-label": labels.code,
|
|
400
|
+
pressed: t29,
|
|
401
|
+
onPressedChange: t30,
|
|
402
|
+
onMouseDown: keepFocus,
|
|
403
|
+
className: itemClasses,
|
|
404
|
+
children: t31
|
|
405
|
+
});
|
|
406
|
+
$[58] = labels.code;
|
|
407
|
+
$[59] = t29;
|
|
408
|
+
$[60] = t30;
|
|
409
|
+
$[61] = t32;
|
|
410
|
+
} else t32 = $[61];
|
|
411
|
+
let t33;
|
|
412
|
+
let t34;
|
|
413
|
+
if ($[62] === Symbol.for("react.memo_cache_sentinel")) {
|
|
414
|
+
t33 = /* @__PURE__ */ jsx(PopoverTrigger, {});
|
|
415
|
+
t34 = /* @__PURE__ */ jsx(Icon, { icon: Link01Icon });
|
|
416
|
+
$[62] = t33;
|
|
417
|
+
$[63] = t34;
|
|
418
|
+
} else {
|
|
419
|
+
t33 = $[62];
|
|
420
|
+
t34 = $[63];
|
|
421
|
+
}
|
|
422
|
+
let t35;
|
|
423
|
+
if ($[64] !== labels.link) {
|
|
424
|
+
t35 = /* @__PURE__ */ jsx(ToolbarButton, {
|
|
425
|
+
variant: "ghost",
|
|
426
|
+
label: labels.link,
|
|
427
|
+
render: t33,
|
|
428
|
+
children: t34
|
|
429
|
+
});
|
|
430
|
+
$[64] = labels.link;
|
|
431
|
+
$[65] = t35;
|
|
432
|
+
} else t35 = $[65];
|
|
433
|
+
let t36;
|
|
434
|
+
if ($[66] !== applyLink) {
|
|
435
|
+
t36 = (event_1) => {
|
|
436
|
+
event_1.preventDefault();
|
|
437
|
+
const field = new FormData(event_1.currentTarget).get("href");
|
|
438
|
+
applyLink(typeof field === "string" ? field : "");
|
|
439
|
+
};
|
|
440
|
+
$[66] = applyLink;
|
|
441
|
+
$[67] = t36;
|
|
442
|
+
} else t36 = $[67];
|
|
443
|
+
const t37 = selection?.link ?? "";
|
|
444
|
+
let t38;
|
|
445
|
+
if ($[68] !== labels.linkAddress || $[69] !== t37) {
|
|
446
|
+
t38 = /* @__PURE__ */ jsx(Input, {
|
|
447
|
+
name: "href",
|
|
448
|
+
"aria-label": labels.linkAddress,
|
|
449
|
+
defaultValue: t37,
|
|
450
|
+
placeholder: "https://",
|
|
451
|
+
autoFocus: true
|
|
452
|
+
});
|
|
453
|
+
$[68] = labels.linkAddress;
|
|
454
|
+
$[69] = t37;
|
|
455
|
+
$[70] = t38;
|
|
456
|
+
} else t38 = $[70];
|
|
457
|
+
let t39;
|
|
458
|
+
if ($[71] !== labels.applyLink) {
|
|
459
|
+
t39 = /* @__PURE__ */ jsx(Button, {
|
|
460
|
+
type: "submit",
|
|
461
|
+
children: labels.applyLink
|
|
462
|
+
});
|
|
463
|
+
$[71] = labels.applyLink;
|
|
464
|
+
$[72] = t39;
|
|
465
|
+
} else t39 = $[72];
|
|
466
|
+
let t40;
|
|
467
|
+
if ($[73] !== t36 || $[74] !== t38 || $[75] !== t39) {
|
|
468
|
+
t40 = /* @__PURE__ */ jsxs("form", {
|
|
469
|
+
className: "flex gap-2",
|
|
470
|
+
onSubmit: t36,
|
|
471
|
+
children: [t38, t39]
|
|
472
|
+
});
|
|
473
|
+
$[73] = t36;
|
|
474
|
+
$[74] = t38;
|
|
475
|
+
$[75] = t39;
|
|
476
|
+
$[76] = t40;
|
|
477
|
+
} else t40 = $[76];
|
|
478
|
+
let t41;
|
|
479
|
+
if ($[77] !== applyLink || $[78] !== labels.removeLink || $[79] !== selection?.link) {
|
|
480
|
+
t41 = selection?.link && /* @__PURE__ */ jsx(Button, {
|
|
481
|
+
variant: "ghost",
|
|
482
|
+
onClick: () => applyLink(""),
|
|
483
|
+
children: labels.removeLink
|
|
484
|
+
});
|
|
485
|
+
$[77] = applyLink;
|
|
486
|
+
$[78] = labels.removeLink;
|
|
487
|
+
$[79] = selection?.link;
|
|
488
|
+
$[80] = t41;
|
|
489
|
+
} else t41 = $[80];
|
|
490
|
+
let t42;
|
|
491
|
+
if ($[81] !== t40 || $[82] !== t41) {
|
|
492
|
+
t42 = /* @__PURE__ */ jsxs(PopoverContent, {
|
|
493
|
+
side: "bottom",
|
|
494
|
+
sideOffset: 8,
|
|
495
|
+
children: [t40, t41]
|
|
496
|
+
});
|
|
497
|
+
$[81] = t40;
|
|
498
|
+
$[82] = t41;
|
|
499
|
+
$[83] = t42;
|
|
500
|
+
} else t42 = $[83];
|
|
501
|
+
let t43;
|
|
502
|
+
if ($[84] !== linkOpen || $[85] !== t35 || $[86] !== t42) {
|
|
503
|
+
t43 = /* @__PURE__ */ jsxs(Popover, {
|
|
504
|
+
open: linkOpen,
|
|
505
|
+
onOpenChange: setLinkOpen,
|
|
506
|
+
children: [t35, t42]
|
|
507
|
+
});
|
|
508
|
+
$[84] = linkOpen;
|
|
509
|
+
$[85] = t35;
|
|
510
|
+
$[86] = t42;
|
|
511
|
+
$[87] = t43;
|
|
512
|
+
} else t43 = $[87];
|
|
513
|
+
let t44;
|
|
514
|
+
let t45;
|
|
515
|
+
let t46;
|
|
516
|
+
if ($[88] === Symbol.for("react.memo_cache_sentinel")) {
|
|
517
|
+
t44 = /* @__PURE__ */ jsx(MenuTrigger, {});
|
|
518
|
+
t45 = /* @__PURE__ */ jsx(Icon, { icon: LeftToRightListBulletIcon });
|
|
519
|
+
t46 = /* @__PURE__ */ jsx(ToolbarCaret, {});
|
|
520
|
+
$[88] = t44;
|
|
521
|
+
$[89] = t45;
|
|
522
|
+
$[90] = t46;
|
|
523
|
+
} else {
|
|
524
|
+
t44 = $[88];
|
|
525
|
+
t45 = $[89];
|
|
526
|
+
t46 = $[90];
|
|
527
|
+
}
|
|
528
|
+
let t47;
|
|
529
|
+
if ($[91] !== labels.list) {
|
|
530
|
+
t47 = /* @__PURE__ */ jsxs(ToolbarButton, {
|
|
531
|
+
variant: "ghost",
|
|
532
|
+
label: labels.list,
|
|
533
|
+
render: t44,
|
|
534
|
+
children: [t45, t46]
|
|
535
|
+
});
|
|
536
|
+
$[91] = labels.list;
|
|
537
|
+
$[92] = t47;
|
|
538
|
+
} else t47 = $[92];
|
|
539
|
+
let t48;
|
|
540
|
+
if ($[93] !== editor) {
|
|
541
|
+
t48 = (type_1) => editor && setBlockType(editor, type_1, void 0, false);
|
|
542
|
+
$[93] = editor;
|
|
543
|
+
$[94] = t48;
|
|
544
|
+
} else t48 = $[94];
|
|
545
|
+
let t49;
|
|
546
|
+
if ($[95] !== labels.blocks) {
|
|
547
|
+
t49 = lists.map((t50) => {
|
|
548
|
+
const { type: type_2, icon: icon_0 } = t50;
|
|
549
|
+
return /* @__PURE__ */ jsxs(MenuRadioItem, {
|
|
550
|
+
value: type_2,
|
|
551
|
+
children: [
|
|
552
|
+
/* @__PURE__ */ jsx(MenuItemIcon, { children: /* @__PURE__ */ jsx(Icon, { icon: icon_0 }) }),
|
|
553
|
+
labels.blocks[type_2],
|
|
554
|
+
/* @__PURE__ */ jsx(MenuItemIndicator, {})
|
|
555
|
+
]
|
|
556
|
+
}, type_2);
|
|
557
|
+
});
|
|
558
|
+
$[95] = labels.blocks;
|
|
559
|
+
$[96] = t49;
|
|
560
|
+
} else t49 = $[96];
|
|
561
|
+
let t50;
|
|
562
|
+
if ($[97] !== list || $[98] !== t48 || $[99] !== t49) {
|
|
563
|
+
t50 = /* @__PURE__ */ jsx(MenuContent, {
|
|
564
|
+
align: "start",
|
|
565
|
+
children: /* @__PURE__ */ jsx(MenuRadioGroup, {
|
|
566
|
+
value: list,
|
|
567
|
+
onValueChange: t48,
|
|
568
|
+
children: t49
|
|
569
|
+
})
|
|
570
|
+
});
|
|
571
|
+
$[97] = list;
|
|
572
|
+
$[98] = t48;
|
|
573
|
+
$[99] = t49;
|
|
574
|
+
$[100] = t50;
|
|
575
|
+
} else t50 = $[100];
|
|
576
|
+
let t51;
|
|
577
|
+
if ($[101] !== t47 || $[102] !== t50) {
|
|
578
|
+
t51 = /* @__PURE__ */ jsxs(Menu, { children: [t47, t50] });
|
|
579
|
+
$[101] = t47;
|
|
580
|
+
$[102] = t50;
|
|
581
|
+
$[103] = t51;
|
|
582
|
+
} else t51 = $[103];
|
|
583
|
+
let t52;
|
|
584
|
+
if ($[104] !== comment || $[105] !== commentable || $[106] !== labels.comment || $[107] !== onComment) {
|
|
585
|
+
t52 = onComment && /* @__PURE__ */ jsx(ToolbarButton, {
|
|
586
|
+
variant: "ghost",
|
|
587
|
+
label: labels.comment,
|
|
588
|
+
disabled: !commentable,
|
|
589
|
+
onMouseDown: keepFocus,
|
|
590
|
+
onClick: comment,
|
|
591
|
+
children: /* @__PURE__ */ jsx(Icon, { icon: Comment01Icon })
|
|
592
|
+
});
|
|
593
|
+
$[104] = comment;
|
|
594
|
+
$[105] = commentable;
|
|
595
|
+
$[106] = labels.comment;
|
|
596
|
+
$[107] = onComment;
|
|
597
|
+
$[108] = t52;
|
|
598
|
+
} else t52 = $[108];
|
|
599
|
+
let t53;
|
|
600
|
+
if ($[109] !== children) {
|
|
601
|
+
t53 = children && /* @__PURE__ */ jsxs(Fragment$1, { children: [/* @__PURE__ */ jsx(ToolbarSeparator, {}), children] });
|
|
602
|
+
$[109] = children;
|
|
603
|
+
$[110] = t53;
|
|
604
|
+
} else t53 = $[110];
|
|
605
|
+
let t54;
|
|
606
|
+
if ($[111] !== labels.toolbar || $[112] !== reach || $[113] !== t22 || $[114] !== t24 || $[115] !== t28 || $[116] !== t32 || $[117] !== t43 || $[118] !== t51 || $[119] !== t52 || $[120] !== t53) {
|
|
607
|
+
t54 = /* @__PURE__ */ jsxs(Toolbar, {
|
|
608
|
+
ref: reach,
|
|
609
|
+
variant: "floating",
|
|
610
|
+
size: "md",
|
|
611
|
+
"aria-label": t16,
|
|
612
|
+
className: "shadow-none ring-0 [--toolbar-radius:var(--radius-md)] [&>button]:rounded-(--toolbar-radius)",
|
|
613
|
+
children: [
|
|
614
|
+
t22,
|
|
615
|
+
t23,
|
|
616
|
+
t24,
|
|
617
|
+
t28,
|
|
618
|
+
t32,
|
|
619
|
+
t43,
|
|
620
|
+
t51,
|
|
621
|
+
t52,
|
|
622
|
+
t53
|
|
623
|
+
]
|
|
624
|
+
});
|
|
625
|
+
$[111] = labels.toolbar;
|
|
626
|
+
$[112] = reach;
|
|
627
|
+
$[113] = t22;
|
|
628
|
+
$[114] = t24;
|
|
629
|
+
$[115] = t28;
|
|
630
|
+
$[116] = t32;
|
|
631
|
+
$[117] = t43;
|
|
632
|
+
$[118] = t51;
|
|
633
|
+
$[119] = t52;
|
|
634
|
+
$[120] = t53;
|
|
635
|
+
$[121] = t54;
|
|
636
|
+
} else t54 = $[121];
|
|
637
|
+
let t55;
|
|
638
|
+
if ($[122] !== anchor || $[123] !== labels.panel || $[124] !== props || $[125] !== t13 || $[126] !== t54) {
|
|
639
|
+
t55 = /* @__PURE__ */ jsx(PopoverContent, {
|
|
640
|
+
"aria-label": t12,
|
|
641
|
+
anchor,
|
|
642
|
+
initialFocus: "none",
|
|
643
|
+
finalFocus: "none",
|
|
644
|
+
side: "top",
|
|
645
|
+
sideOffset: 8,
|
|
646
|
+
className: t13,
|
|
647
|
+
onFocus: t14,
|
|
648
|
+
onBlur: t15,
|
|
649
|
+
...props,
|
|
650
|
+
children: t54
|
|
651
|
+
});
|
|
652
|
+
$[122] = anchor;
|
|
653
|
+
$[123] = labels.panel;
|
|
654
|
+
$[124] = props;
|
|
655
|
+
$[125] = t13;
|
|
656
|
+
$[126] = t54;
|
|
657
|
+
$[127] = t55;
|
|
658
|
+
} else t55 = $[127];
|
|
659
|
+
let t56;
|
|
660
|
+
if ($[128] !== open || $[129] !== t11 || $[130] !== t55) {
|
|
661
|
+
t56 = /* @__PURE__ */ jsx(Popover, {
|
|
662
|
+
open,
|
|
663
|
+
onOpenChange: t11,
|
|
664
|
+
children: t55
|
|
665
|
+
});
|
|
666
|
+
$[128] = open;
|
|
667
|
+
$[129] = t11;
|
|
668
|
+
$[130] = t55;
|
|
669
|
+
$[131] = t56;
|
|
670
|
+
} else t56 = $[131];
|
|
671
|
+
return t56;
|
|
672
|
+
}
|
|
673
|
+
function _temp3() {
|
|
674
|
+
return "";
|
|
675
|
+
}
|
|
676
|
+
function _temp2(t0) {
|
|
677
|
+
const [value, label] = t0;
|
|
678
|
+
return {
|
|
679
|
+
value,
|
|
680
|
+
label
|
|
681
|
+
};
|
|
682
|
+
}
|
|
683
|
+
export { NoteEditorToolbar };
|