@brett_lamy/ui 2.0.0 → 3.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 +12 -5
- package/dist/components/adaptive-pane.d.ts.map +1 -1
- package/dist/components/adaptive-pane.js +30 -0
- package/dist/components/animated-height.d.ts.map +1 -1
- package/dist/components/animated-height.js +82 -0
- package/dist/{templates → components}/artifact-chat-container.d.ts +12 -5
- package/dist/components/artifact-chat-container.d.ts.map +1 -0
- package/dist/components/artifact-chat-container.js +200 -0
- package/dist/components/avatar.js +26 -0
- package/dist/components/badge.js +24 -0
- package/dist/components/button.d.ts.map +1 -1
- package/dist/components/button.js +46 -0
- package/dist/components/card.js +56 -0
- package/dist/components/celebrate.d.ts.map +1 -1
- package/dist/components/celebrate.js +142 -0
- package/dist/components/chat-column.d.ts.map +1 -0
- package/dist/components/chat-column.js +26 -0
- package/dist/components/checkbox.d.ts +2 -2
- package/dist/components/checkbox.d.ts.map +1 -1
- package/dist/components/checkbox.js +55 -0
- package/dist/components/combobox.d.ts +1 -1
- package/dist/components/combobox.d.ts.map +1 -1
- package/dist/components/combobox.js +65 -0
- package/dist/components/command-menu.d.ts.map +1 -1
- package/dist/components/command-menu.js +906 -0
- package/dist/components/composer/annotator.d.ts.map +1 -0
- package/dist/components/composer/annotator.js +17 -0
- package/dist/components/composer/composer-files.d.ts.map +1 -0
- package/dist/components/composer/composer-files.js +91 -0
- package/dist/components/{workbench/wb-popover.d.ts → composer/composer-popover.d.ts} +1 -1
- package/dist/components/composer/composer-popover.d.ts.map +1 -0
- package/dist/components/composer/composer-popover.js +29 -0
- package/dist/components/{workbench → composer}/composer.d.ts +3 -3
- package/dist/components/composer/composer.d.ts.map +1 -0
- package/dist/components/composer/composer.js +1633 -0
- package/dist/components/{workbench/chat.d.ts → conversation.d.ts} +2 -2
- package/dist/components/conversation.d.ts.map +1 -0
- package/dist/components/conversation.js +357 -0
- package/dist/components/credenza.d.ts.map +1 -1
- package/dist/components/credenza.js +294 -0
- package/dist/components/dialog.d.ts +2 -2
- package/dist/components/dialog.d.ts.map +1 -1
- package/dist/components/dialog.js +125 -0
- package/dist/components/disclosure.d.ts.map +1 -1
- package/dist/components/disclosure.js +59 -0
- package/dist/components/dropdown-menu.d.ts +1 -1
- package/dist/components/dropdown-menu.d.ts.map +1 -1
- package/dist/components/dropdown-menu.js +114 -0
- package/dist/components/edge-drawer.js +73 -0
- package/dist/components/edit-bar.d.ts.map +1 -1
- package/dist/components/edit-bar.js +33 -0
- package/dist/components/{chat/floating-chat.d.ts → floating-chat.d.ts} +8 -4
- package/dist/components/floating-chat.d.ts.map +1 -0
- package/dist/components/floating-chat.js +288 -0
- package/dist/components/{chat/floating-sheet.d.ts → floating-sheet.d.ts} +5 -5
- package/dist/components/floating-sheet.d.ts.map +1 -0
- package/dist/components/floating-sheet.js +252 -0
- package/dist/components/form.d.ts.map +1 -1
- package/dist/components/form.js +32 -0
- package/dist/{lib/workbench/icons.d.ts → components/icon-button.d.ts} +5 -5
- package/dist/components/icon-button.d.ts.map +1 -0
- package/dist/components/icon-button.js +31 -0
- package/dist/components/icon-swap.d.ts.map +1 -1
- package/dist/components/icon-swap.js +80 -0
- package/dist/components/index-bar.d.ts +14 -1
- package/dist/components/index-bar.d.ts.map +1 -1
- package/dist/components/index-bar.js +249 -0
- package/dist/components/input.d.ts.map +1 -1
- package/dist/components/input.js +30 -0
- package/dist/components/kbd.d.ts.map +1 -1
- package/dist/components/kbd.js +21 -0
- package/dist/components/label.d.ts.map +1 -1
- package/dist/components/label.js +22 -0
- package/dist/components/list-box.d.ts +1 -3
- package/dist/components/list-box.d.ts.map +1 -1
- package/dist/components/list-box.js +104 -0
- package/dist/components/list.d.ts.map +1 -1
- package/dist/components/list.js +491 -0
- package/dist/components/markdown-editor.d.ts.map +1 -1
- package/dist/components/markdown-editor.js +322 -0
- package/dist/components/{workbench/markdown.d.ts → markdown-view.d.ts} +1 -1
- package/dist/components/markdown-view.d.ts.map +1 -0
- package/dist/components/markdown-view.js +129 -0
- package/dist/components/measure-h.d.ts.map +1 -1
- package/dist/components/measure-h.js +20 -0
- package/dist/components/message-scroller.d.ts.map +1 -0
- package/dist/components/message-scroller.js +247 -0
- package/dist/components/morph.d.ts.map +1 -1
- package/dist/components/morph.js +89 -0
- package/dist/components/navigation-stack.d.ts +14 -0
- package/dist/components/navigation-stack.d.ts.map +1 -1
- package/dist/components/navigation-stack.js +506 -0
- package/dist/components/now-playing-bars.js +38 -0
- package/dist/components/number-morph.d.ts.map +1 -1
- package/dist/components/number-morph.js +123 -0
- package/dist/components/pencilkit/constants.d.ts.map +1 -0
- package/dist/components/pencilkit/constants.js +63 -0
- package/dist/components/pencilkit/pencil-canvas.d.ts +1 -1
- package/dist/components/pencilkit/pencil-canvas.d.ts.map +1 -1
- package/dist/components/pencilkit/pencil-canvas.js +105 -0
- package/dist/components/pencilkit/pencil-toolbar.d.ts +2 -2
- package/dist/components/pencilkit/pencil-toolbar.d.ts.map +1 -1
- package/dist/components/pencilkit/pencil-toolbar.js +186 -0
- package/dist/components/pencilkit/pencilkit-annotator.d.ts +1 -1
- package/dist/components/pencilkit/pencilkit-annotator.d.ts.map +1 -1
- package/dist/components/pencilkit/pencilkit-annotator.js +44 -0
- package/dist/components/pencilkit/stroke-path.d.ts +1 -1
- package/dist/components/pencilkit/stroke-path.d.ts.map +1 -1
- package/dist/components/pencilkit/stroke-path.js +44 -0
- package/dist/components/pencilkit/use-pencil-history.d.ts +2 -2
- package/dist/components/pencilkit/use-pencil-history.d.ts.map +1 -1
- package/dist/components/pencilkit/use-pencil-history.js +25 -0
- package/dist/components/plain-button.d.ts +10 -0
- package/dist/components/plain-button.d.ts.map +1 -0
- package/dist/components/plain-button.js +23 -0
- package/dist/components/popover.d.ts +1 -1
- package/dist/components/popover.d.ts.map +1 -1
- package/dist/components/popover.js +36 -0
- package/dist/components/progress-ring.d.ts.map +1 -1
- package/dist/components/progress-ring.js +195 -0
- package/dist/components/progress-stepper.d.ts.map +1 -0
- package/dist/components/progress-stepper.js +62 -0
- package/dist/components/progress.d.ts.map +1 -1
- package/dist/components/progress.js +54 -0
- package/dist/components/qr-svg.d.ts.map +1 -1
- package/dist/components/qr-svg.js +74 -0
- package/dist/components/radio-group.d.ts +1 -1
- package/dist/components/radio-group.d.ts.map +1 -1
- package/dist/components/radio-group.js +41 -0
- package/dist/components/replay-preview.d.ts +4 -0
- package/dist/components/replay-preview.d.ts.map +1 -0
- package/dist/components/replay-preview.js +3 -0
- package/dist/components/scroll-area.js +23 -0
- package/dist/components/search-field.d.ts.map +1 -1
- package/dist/components/search-field.js +44 -0
- package/dist/components/segmented.d.ts +1 -1
- package/dist/components/segmented.d.ts.map +1 -1
- package/dist/components/segmented.js +32 -0
- package/dist/components/select.d.ts +1 -1
- package/dist/components/select.d.ts.map +1 -1
- package/dist/components/select.js +93 -0
- package/dist/components/separator.d.ts.map +1 -1
- package/dist/components/separator.js +40 -0
- package/dist/components/sheet.d.ts.map +1 -1
- package/dist/components/sheet.js +55 -0
- package/dist/components/side-drawer.d.ts +10 -1
- package/dist/components/side-drawer.d.ts.map +1 -1
- package/dist/components/side-drawer.js +247 -0
- package/dist/components/sidebar.d.ts.map +1 -1
- package/dist/components/sidebar.js +282 -0
- package/dist/components/skeleton.js +48 -0
- package/dist/components/slider.d.ts +1 -1
- package/dist/components/slider.d.ts.map +1 -1
- package/dist/components/slider.js +98 -0
- package/dist/components/snap-sheet.d.ts.map +1 -0
- package/dist/components/snap-sheet.js +100 -0
- package/dist/components/spinner.js +35 -0
- package/dist/components/split-view.d.ts.map +1 -1
- package/dist/components/split-view.js +1060 -0
- package/dist/components/switch.d.ts.map +1 -1
- package/dist/components/switch.js +27 -0
- package/dist/components/syntax-highlighting.d.ts.map +1 -1
- package/dist/components/syntax-highlighting.js +293 -0
- package/dist/components/tab-bar.js +28 -0
- package/dist/components/tab-view.d.ts +1 -1
- package/dist/components/tab-view.d.ts.map +1 -1
- package/dist/components/tab-view.js +307 -0
- package/dist/components/tabs.d.ts +1 -1
- package/dist/components/tabs.d.ts.map +1 -1
- package/dist/components/tabs.js +86 -0
- package/dist/components/text-field.d.ts.map +1 -1
- package/dist/components/text-field.js +29 -0
- package/dist/components/text-morph.d.ts.map +1 -1
- package/dist/components/text-morph.js +131 -0
- package/dist/components/textarea.d.ts.map +1 -1
- package/dist/components/textarea.js +30 -0
- package/dist/components/toast.d.ts +0 -2
- package/dist/components/toast.d.ts.map +1 -1
- package/dist/components/toast.js +302 -0
- package/dist/components/toggle-group.d.ts +1 -1
- package/dist/components/toggle-group.d.ts.map +1 -1
- package/dist/components/toggle-group.js +48 -0
- package/dist/components/toggle.d.ts +1 -1
- package/dist/components/toggle.d.ts.map +1 -1
- package/dist/components/toggle.js +42 -0
- package/dist/components/tooltip.d.ts +1 -1
- package/dist/components/tooltip.d.ts.map +1 -1
- package/dist/components/tooltip.js +42 -0
- package/dist/{lib/workbench/theme.d.ts → components/workbench-theme.d.ts} +2 -2
- package/dist/components/workbench-theme.d.ts.map +1 -0
- package/dist/components/workbench-theme.js +34 -0
- package/dist/index.css +1 -1
- package/dist/index.d.ts +29 -47
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +94 -20350
- package/dist/lib/append-stream.d.ts +43 -0
- package/dist/lib/append-stream.d.ts.map +1 -0
- package/dist/lib/append-stream.js +128 -0
- package/dist/lib/container.d.ts.map +1 -1
- package/dist/lib/container.js +49 -0
- package/dist/lib/durable-streams.d.ts +102 -0
- package/dist/lib/durable-streams.d.ts.map +1 -0
- package/dist/lib/durable-streams.js +280 -0
- package/dist/lib/icon-shapes/chat.js +13 -0
- package/dist/lib/icon-shapes/pencilkit.js +20 -0
- package/dist/lib/icon-shapes/workbench.js +47 -0
- package/dist/lib/icon.d.ts +1 -1
- package/dist/lib/icon.d.ts.map +1 -1
- package/dist/lib/icon.js +1774 -0
- package/dist/lib/motion.d.ts +16 -0
- package/dist/lib/motion.d.ts.map +1 -1
- package/dist/lib/motion.js +104 -0
- package/dist/lib/{chat/persistent-host.d.ts → persistent-host.d.ts} +1 -1
- package/dist/lib/persistent-host.d.ts.map +1 -0
- package/dist/lib/persistent-host.js +41 -0
- package/dist/lib/primitives.js +8 -0
- package/dist/lib/qr.js +552 -0
- package/dist/lib/row-label.d.ts.map +1 -1
- package/dist/lib/row-label.js +10 -0
- package/dist/lib/session-recorder.d.ts +87 -0
- package/dist/lib/session-recorder.d.ts.map +1 -0
- package/dist/lib/session-recorder.js +257 -0
- package/dist/lib/sheet-drag.d.ts +1 -1
- package/dist/lib/sheet-drag.d.ts.map +1 -1
- package/dist/lib/sheet-drag.js +128 -0
- package/dist/lib/syntax.js +204 -0
- package/dist/lib/theme.d.ts +33 -8
- package/dist/lib/theme.d.ts.map +1 -1
- package/dist/lib/theme.js +138 -0
- package/dist/lib/tokens.generated.d.ts +16 -0
- package/dist/lib/tokens.generated.d.ts.map +1 -0
- package/dist/lib/tokens.generated.js +22 -0
- package/dist/lib/utils.d.ts +5 -0
- package/dist/lib/utils.d.ts.map +1 -1
- package/dist/lib/utils.js +18 -0
- package/dist/theme.css +0 -60
- package/package.json +5 -7
- package/dist/components/adaptive-pane.stories.d.ts +0 -7
- package/dist/components/adaptive-pane.stories.d.ts.map +0 -1
- package/dist/components/avatar.stories.d.ts +0 -9
- package/dist/components/avatar.stories.d.ts.map +0 -1
- package/dist/components/badge.stories.d.ts +0 -9
- package/dist/components/badge.stories.d.ts.map +0 -1
- package/dist/components/button.stories.d.ts +0 -11
- package/dist/components/button.stories.d.ts.map +0 -1
- package/dist/components/card.stories.d.ts +0 -9
- package/dist/components/card.stories.d.ts.map +0 -1
- package/dist/components/chat/chat-column.d.ts.map +0 -1
- package/dist/components/chat/chat-column.stories.d.ts +0 -9
- package/dist/components/chat/chat-column.stories.d.ts.map +0 -1
- package/dist/components/chat/floating-chat.d.ts.map +0 -1
- package/dist/components/chat/floating-chat.stories.d.ts +0 -17
- package/dist/components/chat/floating-chat.stories.d.ts.map +0 -1
- package/dist/components/chat/floating-sheet.d.ts.map +0 -1
- package/dist/components/chat/floating-sheet.stories.d.ts +0 -22
- package/dist/components/chat/floating-sheet.stories.d.ts.map +0 -1
- package/dist/components/chat/progress-stepper.d.ts.map +0 -1
- package/dist/components/checkbox.stories.d.ts +0 -11
- package/dist/components/checkbox.stories.d.ts.map +0 -1
- package/dist/components/combobox.stories.d.ts +0 -10
- package/dist/components/combobox.stories.d.ts.map +0 -1
- package/dist/components/command-menu.stories.d.ts +0 -17
- package/dist/components/command-menu.stories.d.ts.map +0 -1
- package/dist/components/credenza.stories.d.ts +0 -8
- package/dist/components/credenza.stories.d.ts.map +0 -1
- package/dist/components/dialog.stories.d.ts +0 -12
- package/dist/components/dialog.stories.d.ts.map +0 -1
- package/dist/components/disclosure.stories.d.ts +0 -10
- package/dist/components/disclosure.stories.d.ts.map +0 -1
- package/dist/components/dropdown-menu.stories.d.ts +0 -11
- package/dist/components/dropdown-menu.stories.d.ts.map +0 -1
- package/dist/components/edge-drawer.stories.d.ts +0 -8
- package/dist/components/edge-drawer.stories.d.ts.map +0 -1
- package/dist/components/edit-bar.stories.d.ts +0 -10
- package/dist/components/edit-bar.stories.d.ts.map +0 -1
- package/dist/components/form.stories.d.ts +0 -9
- package/dist/components/form.stories.d.ts.map +0 -1
- package/dist/components/haptic-indicator.d.ts +0 -11
- package/dist/components/haptic-indicator.d.ts.map +0 -1
- package/dist/components/haptic-indicator.stories.d.ts +0 -8
- package/dist/components/haptic-indicator.stories.d.ts.map +0 -1
- package/dist/components/index-bar.stories.d.ts +0 -12
- package/dist/components/index-bar.stories.d.ts.map +0 -1
- package/dist/components/input.stories.d.ts +0 -10
- package/dist/components/input.stories.d.ts.map +0 -1
- package/dist/components/kbd.stories.d.ts +0 -9
- package/dist/components/kbd.stories.d.ts.map +0 -1
- package/dist/components/label.stories.d.ts +0 -8
- package/dist/components/label.stories.d.ts.map +0 -1
- package/dist/components/list-box.stories.d.ts +0 -9
- package/dist/components/list-box.stories.d.ts.map +0 -1
- package/dist/components/list-row.stories.d.ts +0 -24
- package/dist/components/list-row.stories.d.ts.map +0 -1
- package/dist/components/list.stories.d.ts +0 -27
- package/dist/components/list.stories.d.ts.map +0 -1
- package/dist/components/markdown-editor.stories.d.ts +0 -17
- package/dist/components/markdown-editor.stories.d.ts.map +0 -1
- package/dist/components/morph.stories.d.ts +0 -14
- package/dist/components/morph.stories.d.ts.map +0 -1
- package/dist/components/motion.stories.d.ts +0 -15
- package/dist/components/motion.stories.d.ts.map +0 -1
- package/dist/components/navigation-stack.stories.d.ts +0 -31
- package/dist/components/navigation-stack.stories.d.ts.map +0 -1
- package/dist/components/now-playing-bars.stories.d.ts +0 -12
- package/dist/components/now-playing-bars.stories.d.ts.map +0 -1
- package/dist/components/pencilkit/pencil-canvas.stories.d.ts +0 -18
- package/dist/components/pencilkit/pencil-canvas.stories.d.ts.map +0 -1
- package/dist/components/pencilkit/pencil-toolbar.stories.d.ts +0 -10
- package/dist/components/pencilkit/pencil-toolbar.stories.d.ts.map +0 -1
- package/dist/components/popover.stories.d.ts +0 -9
- package/dist/components/popover.stories.d.ts.map +0 -1
- package/dist/components/progress-ring.stories.d.ts +0 -15
- package/dist/components/progress-ring.stories.d.ts.map +0 -1
- package/dist/components/progress.stories.d.ts +0 -10
- package/dist/components/progress.stories.d.ts.map +0 -1
- package/dist/components/qr-svg.stories.d.ts +0 -16
- package/dist/components/qr-svg.stories.d.ts.map +0 -1
- package/dist/components/radio-group.stories.d.ts +0 -10
- package/dist/components/radio-group.stories.d.ts.map +0 -1
- package/dist/components/scroll-area.stories.d.ts +0 -8
- package/dist/components/scroll-area.stories.d.ts.map +0 -1
- package/dist/components/search-field.stories.d.ts +0 -10
- package/dist/components/search-field.stories.d.ts.map +0 -1
- package/dist/components/segmented.stories.d.ts +0 -8
- package/dist/components/segmented.stories.d.ts.map +0 -1
- package/dist/components/select.stories.d.ts +0 -12
- package/dist/components/select.stories.d.ts.map +0 -1
- package/dist/components/separator.stories.d.ts +0 -9
- package/dist/components/separator.stories.d.ts.map +0 -1
- package/dist/components/sheet.stories.d.ts +0 -12
- package/dist/components/sheet.stories.d.ts.map +0 -1
- package/dist/components/side-drawer.stories.d.ts +0 -8
- package/dist/components/side-drawer.stories.d.ts.map +0 -1
- package/dist/components/sidebar.stories.d.ts +0 -10
- package/dist/components/sidebar.stories.d.ts.map +0 -1
- package/dist/components/skeleton.stories.d.ts +0 -11
- package/dist/components/skeleton.stories.d.ts.map +0 -1
- package/dist/components/slider.stories.d.ts +0 -12
- package/dist/components/slider.stories.d.ts.map +0 -1
- package/dist/components/spinner.stories.d.ts +0 -9
- package/dist/components/spinner.stories.d.ts.map +0 -1
- package/dist/components/split-view.stories.d.ts +0 -58
- package/dist/components/split-view.stories.d.ts.map +0 -1
- package/dist/components/switch.stories.d.ts +0 -9
- package/dist/components/switch.stories.d.ts.map +0 -1
- package/dist/components/syntax-highlighting.stories.d.ts +0 -18
- package/dist/components/syntax-highlighting.stories.d.ts.map +0 -1
- package/dist/components/tab-bar.stories.d.ts +0 -8
- package/dist/components/tab-bar.stories.d.ts.map +0 -1
- package/dist/components/tab-view.stories.d.ts +0 -37
- package/dist/components/tab-view.stories.d.ts.map +0 -1
- package/dist/components/tabs.stories.d.ts +0 -9
- package/dist/components/tabs.stories.d.ts.map +0 -1
- package/dist/components/text-field.stories.d.ts +0 -9
- package/dist/components/text-field.stories.d.ts.map +0 -1
- package/dist/components/toast.stories.d.ts +0 -13
- package/dist/components/toast.stories.d.ts.map +0 -1
- package/dist/components/toggle-group.stories.d.ts +0 -10
- package/dist/components/toggle-group.stories.d.ts.map +0 -1
- package/dist/components/toggle.stories.d.ts +0 -9
- package/dist/components/toggle.stories.d.ts.map +0 -1
- package/dist/components/tooltip.stories.d.ts +0 -11
- package/dist/components/tooltip.stories.d.ts.map +0 -1
- package/dist/components/workbench/annotator.d.ts.map +0 -1
- package/dist/components/workbench/chat.d.ts.map +0 -1
- package/dist/components/workbench/chat.stories.d.ts +0 -13
- package/dist/components/workbench/chat.stories.d.ts.map +0 -1
- package/dist/components/workbench/composer-files.d.ts.map +0 -1
- package/dist/components/workbench/composer.d.ts.map +0 -1
- package/dist/components/workbench/composer.stories.d.ts +0 -35
- package/dist/components/workbench/composer.stories.d.ts.map +0 -1
- package/dist/components/workbench/fixtures.d.ts +0 -38
- package/dist/components/workbench/fixtures.d.ts.map +0 -1
- package/dist/components/workbench/markdown.d.ts.map +0 -1
- package/dist/components/workbench/message-scroller.d.ts.map +0 -1
- package/dist/components/workbench/message-scroller.stories.d.ts +0 -9
- package/dist/components/workbench/message-scroller.stories.d.ts.map +0 -1
- package/dist/components/workbench/model-picker.d.ts +0 -29
- package/dist/components/workbench/model-picker.d.ts.map +0 -1
- package/dist/components/workbench/models.d.ts +0 -32
- package/dist/components/workbench/models.d.ts.map +0 -1
- package/dist/components/workbench/snap-sheet.d.ts.map +0 -1
- package/dist/components/workbench/snap-sheet.stories.d.ts +0 -8
- package/dist/components/workbench/snap-sheet.stories.d.ts.map +0 -1
- package/dist/components/workbench/surfaces.d.ts +0 -67
- package/dist/components/workbench/surfaces.d.ts.map +0 -1
- package/dist/components/workbench/surfaces.stories.d.ts +0 -15
- package/dist/components/workbench/surfaces.stories.d.ts.map +0 -1
- package/dist/components/workbench/terminal.d.ts +0 -51
- package/dist/components/workbench/terminal.d.ts.map +0 -1
- package/dist/components/workbench/terminal.stories.d.ts +0 -8
- package/dist/components/workbench/terminal.stories.d.ts.map +0 -1
- package/dist/components/workbench/wb-popover.d.ts.map +0 -1
- package/dist/components/workbench/workbench-composer.d.ts +0 -26
- package/dist/components/workbench/workbench-composer.d.ts.map +0 -1
- package/dist/demos/delivery/delivery-tracking-demo.d.ts +0 -41
- package/dist/demos/delivery/delivery-tracking-demo.d.ts.map +0 -1
- package/dist/demos/delivery/delivery-tracking-demo.stories.d.ts +0 -13
- package/dist/demos/delivery/delivery-tracking-demo.stories.d.ts.map +0 -1
- package/dist/demos/haptics-playground.d.ts +0 -18
- package/dist/demos/haptics-playground.d.ts.map +0 -1
- package/dist/demos/haptics-playground.stories.d.ts +0 -8
- package/dist/demos/haptics-playground.stories.d.ts.map +0 -1
- package/dist/demos/map-chat/geo.d.ts +0 -46
- package/dist/demos/map-chat/geo.d.ts.map +0 -1
- package/dist/demos/map-chat/map-agent.d.ts +0 -48
- package/dist/demos/map-chat/map-agent.d.ts.map +0 -1
- package/dist/demos/map-chat/map-chat-demo.d.ts +0 -19
- package/dist/demos/map-chat/map-chat-demo.d.ts.map +0 -1
- package/dist/demos/map-chat/map-chat-demo.stories.d.ts +0 -16
- package/dist/demos/map-chat/map-chat-demo.stories.d.ts.map +0 -1
- package/dist/demos/map-chat/map-icons.d.ts +0 -44
- package/dist/demos/map-chat/map-icons.d.ts.map +0 -1
- package/dist/demos/map-chat/places.d.ts +0 -29
- package/dist/demos/map-chat/places.d.ts.map +0 -1
- package/dist/demos/map-chat/tile-map.d.ts +0 -108
- package/dist/demos/map-chat/tile-map.d.ts.map +0 -1
- package/dist/demos/pencilkit/demo-strokes.d.ts +0 -4
- package/dist/demos/pencilkit/demo-strokes.d.ts.map +0 -1
- package/dist/demos/pencilkit/pencilkit-demo.d.ts +0 -17
- package/dist/demos/pencilkit/pencilkit-demo.d.ts.map +0 -1
- package/dist/demos/pencilkit/pencilkit-demo.stories.d.ts +0 -11
- package/dist/demos/pencilkit/pencilkit-demo.stories.d.ts.map +0 -1
- package/dist/demos/sidebar-demo.d.ts +0 -6
- package/dist/demos/sidebar-demo.d.ts.map +0 -1
- package/dist/demos/split-view-demos.d.ts +0 -50
- package/dist/demos/split-view-demos.d.ts.map +0 -1
- package/dist/lib/chat/chat-shell-context.d.ts +0 -20
- package/dist/lib/chat/chat-shell-context.d.ts.map +0 -1
- package/dist/lib/chat/persistent-host.d.ts.map +0 -1
- package/dist/lib/haptics.d.ts +0 -27
- package/dist/lib/haptics.d.ts.map +0 -1
- package/dist/lib/icon.stories.d.ts +0 -15
- package/dist/lib/icon.stories.d.ts.map +0 -1
- package/dist/lib/pencilkit/constants.d.ts.map +0 -1
- package/dist/lib/workbench/haptics.d.ts +0 -3
- package/dist/lib/workbench/haptics.d.ts.map +0 -1
- package/dist/lib/workbench/icons.d.ts.map +0 -1
- package/dist/lib/workbench/motion.d.ts +0 -19
- package/dist/lib/workbench/motion.d.ts.map +0 -1
- package/dist/lib/workbench/press.d.ts +0 -10
- package/dist/lib/workbench/press.d.ts.map +0 -1
- package/dist/lib/workbench/theme.d.ts.map +0 -1
- package/dist/lib/workbench/util.d.ts +0 -8
- package/dist/lib/workbench/util.d.ts.map +0 -1
- package/dist/stories/frame.d.ts +0 -16
- package/dist/stories/frame.d.ts.map +0 -1
- package/dist/stories/primitive-frame.d.ts +0 -20
- package/dist/stories/primitive-frame.d.ts.map +0 -1
- package/dist/templates/artifact-chat-container.d.ts.map +0 -1
- package/dist/templates/artifact-chat-container.stories.d.ts +0 -24
- package/dist/templates/artifact-chat-container.stories.d.ts.map +0 -1
- package/dist/templates/chat-shell.d.ts +0 -87
- package/dist/templates/chat-shell.d.ts.map +0 -1
- package/dist/templates/workbench-shell.d.ts +0 -177
- package/dist/templates/workbench-shell.d.ts.map +0 -1
- package/dist/templates/workbench-shell.stories.d.ts +0 -17
- package/dist/templates/workbench-shell.stories.d.ts.map +0 -1
- /package/dist/components/{chat/chat-column.d.ts → chat-column.d.ts} +0 -0
- /package/dist/components/{workbench → composer}/annotator.d.ts +0 -0
- /package/dist/components/{workbench → composer}/composer-files.d.ts +0 -0
- /package/dist/components/{workbench/message-scroller.d.ts → message-scroller.d.ts} +0 -0
- /package/dist/{lib → components}/pencilkit/constants.d.ts +0 -0
- /package/dist/components/{chat/progress-stepper.d.ts → progress-stepper.d.ts} +0 -0
- /package/dist/components/{workbench/snap-sheet.d.ts → snap-sheet.d.ts} +0 -0
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
//#region src/components/pencilkit/constants.ts
|
|
2
|
+
var e = {
|
|
3
|
+
pen: {
|
|
4
|
+
opt: {
|
|
5
|
+
size: 7,
|
|
6
|
+
thinning: .62,
|
|
7
|
+
smoothing: .5,
|
|
8
|
+
streamline: .42
|
|
9
|
+
},
|
|
10
|
+
alpha: 1
|
|
11
|
+
},
|
|
12
|
+
marker: {
|
|
13
|
+
opt: {
|
|
14
|
+
size: 20,
|
|
15
|
+
thinning: .06,
|
|
16
|
+
smoothing: .55,
|
|
17
|
+
streamline: .5
|
|
18
|
+
},
|
|
19
|
+
alpha: .5
|
|
20
|
+
},
|
|
21
|
+
pencil: {
|
|
22
|
+
opt: {
|
|
23
|
+
size: 4.5,
|
|
24
|
+
thinning: .72,
|
|
25
|
+
smoothing: .42,
|
|
26
|
+
streamline: .34,
|
|
27
|
+
start: { taper: 22 },
|
|
28
|
+
end: { taper: 22 }
|
|
29
|
+
},
|
|
30
|
+
alpha: .92
|
|
31
|
+
}
|
|
32
|
+
}, t = [
|
|
33
|
+
"#1C1C1E",
|
|
34
|
+
"#F2F2F7",
|
|
35
|
+
"#0A84FF",
|
|
36
|
+
"#30D158",
|
|
37
|
+
"#FFD60A",
|
|
38
|
+
"#FF375F"
|
|
39
|
+
], n = [
|
|
40
|
+
{
|
|
41
|
+
m: .6,
|
|
42
|
+
d: 3
|
|
43
|
+
},
|
|
44
|
+
{
|
|
45
|
+
m: 1,
|
|
46
|
+
d: 5
|
|
47
|
+
},
|
|
48
|
+
{
|
|
49
|
+
m: 1.7,
|
|
50
|
+
d: 8
|
|
51
|
+
},
|
|
52
|
+
{
|
|
53
|
+
m: 2.6,
|
|
54
|
+
d: 11
|
|
55
|
+
}
|
|
56
|
+
], r = {
|
|
57
|
+
pen: "pencil-tip",
|
|
58
|
+
marker: "highlighter",
|
|
59
|
+
pencil: "pencil-sketch",
|
|
60
|
+
eraser: "eraser"
|
|
61
|
+
};
|
|
62
|
+
//#endregion
|
|
63
|
+
export { t as PK_INKS, e as PK_TOOLS, r as PK_TOOL_ICONS, n as PK_W };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { PencilStroke, PencilTool } from '
|
|
1
|
+
import { PencilStroke, PencilTool } from './constants';
|
|
2
2
|
import * as React from 'react';
|
|
3
3
|
export type PencilStrokesChangeSource = 'draw' | 'erase';
|
|
4
4
|
export interface PencilCanvasProps extends Omit<React.HTMLAttributes<HTMLDivElement>, 'onChange'> {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"pencil-canvas.d.ts","sourceRoot":"","sources":["../../../src/components/pencilkit/pencil-canvas.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"pencil-canvas.d.ts","sourceRoot":"","sources":["../../../src/components/pencilkit/pencil-canvas.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAG/B,OAAO,EAKL,KAAK,YAAY,EACjB,KAAK,UAAU,EAChB,MAAM,qCAAqC,CAAC;AAG7C,MAAM,MAAM,yBAAyB,GAAG,MAAM,GAAG,OAAO,CAAC;AAEzD,MAAM,WAAW,iBAAkB,SAAQ,IAAI,CAAC,KAAK,CAAC,cAAc,CAAC,cAAc,CAAC,EAAE,UAAU,CAAC;IAC/F,kCAAkC;IAClC,IAAI,CAAC,EAAE,UAAU,CAAC;IAClB,qDAAqD;IACrD,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,+DAA+D;IAC/D,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,iDAAiD;IACjD,OAAO,CAAC,EAAE,YAAY,EAAE,CAAC;IACzB,yCAAyC;IACzC,cAAc,CAAC,EAAE,YAAY,EAAE,CAAC;IAChC,eAAe,CAAC,EAAE,CAAC,OAAO,EAAE,YAAY,EAAE,EAAE,MAAM,EAAE,yBAAyB,KAAK,IAAI,CAAC;IACvF,4EAA4E;IAC5E,IAAI,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IACvB,uFAAuF;IACvF,MAAM,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IACzB,4FAA4F;IAC5F,KAAK,CAAC,EAAE,OAAO,CAAC;CACjB;AAED,wBAAgB,YAAY,CAAC,EAC3B,IAAY,EACZ,GAAgB,EAChB,KAAS,EACT,OAAO,EAAE,WAAW,EACpB,cAAc,EACd,eAAe,EACf,IAAI,EACJ,MAAM,EACN,KAAa,EACb,SAAS,EACT,KAAK,EACL,QAAQ,EACR,GAAG,IAAI,EACR,EAAE,iBAAiB,2CAsHnB"}
|
|
@@ -0,0 +1,105 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { cn as e } from "../../lib/utils.js";
|
|
3
|
+
import { PK_INKS as t, PK_TOOLS as n } from "./constants.js";
|
|
4
|
+
import { MemoStroke as r, StrokePath as i } from "./stroke-path.js";
|
|
5
|
+
import { useRef as a, useState as o } from "react";
|
|
6
|
+
import { jsx as s, jsxs as c } from "react/jsx-runtime";
|
|
7
|
+
//#region src/components/pencilkit/pencil-canvas.tsx
|
|
8
|
+
function l({ tool: l = "pen", ink: u = t[0], width: d = 1, strokes: f, defaultStrokes: p, onStrokesChange: m, hint: h, status: g, plain: _ = !1, className: v, style: y, children: b, ...x }) {
|
|
9
|
+
let S = f !== void 0, [C, w] = o(p || []), T = S ? f : C, E = a(T);
|
|
10
|
+
E.current = T;
|
|
11
|
+
let [, D] = o(0), O = a(null), k = a(null), A = a(!1), j = (e, t) => {
|
|
12
|
+
let n = e(E.current);
|
|
13
|
+
n !== E.current && (E.current = n, S || w(n), m && m(n, t));
|
|
14
|
+
}, M = (e) => {
|
|
15
|
+
let t = k.current.getBoundingClientRect();
|
|
16
|
+
return [
|
|
17
|
+
e.clientX - t.left,
|
|
18
|
+
e.clientY - t.top,
|
|
19
|
+
e.pressure > 0 ? e.pressure : .5
|
|
20
|
+
];
|
|
21
|
+
}, N = (e) => {
|
|
22
|
+
let t = M(e), r = t[0], i = t[1];
|
|
23
|
+
j((e) => e.filter((e) => {
|
|
24
|
+
let t = 12 + n[e.tool].opt.size * e.w / 2;
|
|
25
|
+
for (let n = 0; n < e.points.length; n += 2) {
|
|
26
|
+
let a = e.points[n][0] - r, o = e.points[n][1] - i;
|
|
27
|
+
if (a * a + o * o < t * t) return !1;
|
|
28
|
+
}
|
|
29
|
+
return !0;
|
|
30
|
+
}), "erase");
|
|
31
|
+
}, P = (e) => {
|
|
32
|
+
if (e.pointerType !== "mouse" || e.button === 0) {
|
|
33
|
+
if (e.currentTarget.setPointerCapture(e.pointerId), l === "eraser") {
|
|
34
|
+
A.current = !0, N(e);
|
|
35
|
+
return;
|
|
36
|
+
}
|
|
37
|
+
O.current = {
|
|
38
|
+
tool: l,
|
|
39
|
+
color: u,
|
|
40
|
+
w: d,
|
|
41
|
+
pen: e.pointerType === "pen",
|
|
42
|
+
points: [M(e)],
|
|
43
|
+
done: !1
|
|
44
|
+
}, D((e) => e + 1);
|
|
45
|
+
}
|
|
46
|
+
}, F = (e) => {
|
|
47
|
+
if (l === "eraser") {
|
|
48
|
+
A.current && N(e);
|
|
49
|
+
return;
|
|
50
|
+
}
|
|
51
|
+
let t = O.current;
|
|
52
|
+
if (!t) return;
|
|
53
|
+
let n = e.nativeEvent, r = n && n.getCoalescedEvents ? n.getCoalescedEvents() : [e];
|
|
54
|
+
for (let e of r) t.points.push(M(e));
|
|
55
|
+
D((e) => e + 1);
|
|
56
|
+
}, I = () => {
|
|
57
|
+
if (l === "eraser") {
|
|
58
|
+
A.current = !1;
|
|
59
|
+
return;
|
|
60
|
+
}
|
|
61
|
+
let e = O.current;
|
|
62
|
+
O.current = null, e && e.points.length > 1 ? (e.done = !0, j((t) => [...t, e], "draw")) : D((e) => e + 1);
|
|
63
|
+
};
|
|
64
|
+
return /* @__PURE__ */ c("div", {
|
|
65
|
+
ref: k,
|
|
66
|
+
"data-slot": "pencil-canvas",
|
|
67
|
+
onPointerDown: P,
|
|
68
|
+
onPointerMove: F,
|
|
69
|
+
onPointerUp: I,
|
|
70
|
+
onPointerCancel: I,
|
|
71
|
+
className: e("absolute inset-0 cursor-crosshair touch-none", v),
|
|
72
|
+
style: y,
|
|
73
|
+
...x,
|
|
74
|
+
children: [
|
|
75
|
+
/* @__PURE__ */ c("svg", {
|
|
76
|
+
width: "100%",
|
|
77
|
+
height: "100%",
|
|
78
|
+
className: "absolute inset-0 block",
|
|
79
|
+
children: [T.map((e, t) => /* @__PURE__ */ s(r, {
|
|
80
|
+
st: e,
|
|
81
|
+
pf: !_
|
|
82
|
+
}, t)), O.current ? /* @__PURE__ */ s(i, {
|
|
83
|
+
st: O.current,
|
|
84
|
+
pf: !_
|
|
85
|
+
}) : null]
|
|
86
|
+
}),
|
|
87
|
+
h && !T.length && !O.current ? /* @__PURE__ */ s("div", {
|
|
88
|
+
"data-slot": "pencil-canvas-hint",
|
|
89
|
+
className: "pointer-events-none absolute inset-x-0 top-0 bottom-[90px] grid place-items-center",
|
|
90
|
+
children: /* @__PURE__ */ s("div", {
|
|
91
|
+
className: "text-center text-tertiary-foreground",
|
|
92
|
+
children: h
|
|
93
|
+
})
|
|
94
|
+
}) : null,
|
|
95
|
+
g == null ? null : /* @__PURE__ */ s("div", {
|
|
96
|
+
"data-slot": "pencil-canvas-status",
|
|
97
|
+
className: "pointer-events-none absolute top-2.5 right-3 font-mono text-[10.5px] text-tertiary-foreground",
|
|
98
|
+
children: g
|
|
99
|
+
}),
|
|
100
|
+
b
|
|
101
|
+
]
|
|
102
|
+
});
|
|
103
|
+
}
|
|
104
|
+
//#endregion
|
|
105
|
+
export { l as PencilCanvas };
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { VariantProps } from 'class-variance-authority';
|
|
2
|
-
import { PencilTool } from '
|
|
2
|
+
import { PencilTool } from './constants';
|
|
3
3
|
import { IconName } from '../../lib/icon';
|
|
4
|
-
import { ButtonProps } from '
|
|
4
|
+
import { PlainButtonProps as ButtonProps } from '../plain-button';
|
|
5
5
|
import * as React from 'react';
|
|
6
6
|
/** The 38×34 icon button: tinted while `active` (or selected, inside a picker), dimmed while disabled. */
|
|
7
7
|
export declare const pencilToolButtonVariants: (props?: ({
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"pencil-toolbar.d.ts","sourceRoot":"","sources":["../../../src/components/pencilkit/pencil-toolbar.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"pencil-toolbar.d.ts","sourceRoot":"","sources":["../../../src/components/pencilkit/pencil-toolbar.tsx"],"names":[],"mappings":"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"}
|
|
@@ -0,0 +1,186 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { cn as e } from "../../lib/utils.js";
|
|
3
|
+
import { Icon as t } from "../../lib/icon.js";
|
|
4
|
+
import { PlainButton as n, PlainToggleButton as r } from "../plain-button.js";
|
|
5
|
+
import { PK_INKS as i, PK_TOOL_ICONS as a, PK_W as o } from "./constants.js";
|
|
6
|
+
import * as s from "react";
|
|
7
|
+
import { jsx as c, jsxs as l } from "react/jsx-runtime";
|
|
8
|
+
import { ToggleButtonGroup as u, composeRenderProps as d } from "react-aria-components";
|
|
9
|
+
import { cva as f } from "class-variance-authority";
|
|
10
|
+
//#region src/components/pencilkit/pencil-toolbar.tsx
|
|
11
|
+
var p = f("grid h-[34px] w-[38px] cursor-pointer place-items-center rounded-[9px] border-0 p-0 data-disabled:cursor-default data-disabled:opacity-[.32]", {
|
|
12
|
+
variants: { active: {
|
|
13
|
+
true: "bg-primary text-primary-foreground",
|
|
14
|
+
false: "bg-transparent text-muted-foreground data-selected:bg-primary data-selected:text-primary-foreground"
|
|
15
|
+
} },
|
|
16
|
+
defaultVariants: { active: !1 }
|
|
17
|
+
});
|
|
18
|
+
function m({ icon: t, active: r, label: i, disabled: a, isDisabled: o, className: s, ...l }) {
|
|
19
|
+
return /* @__PURE__ */ c(n, {
|
|
20
|
+
"data-slot": "pencil-tool-button",
|
|
21
|
+
isDisabled: o ?? a,
|
|
22
|
+
"aria-label": i || t,
|
|
23
|
+
title: i || t,
|
|
24
|
+
className: d(s, (t) => e(p({ active: !!r }), t)),
|
|
25
|
+
...l,
|
|
26
|
+
children: /* @__PURE__ */ c(h, { name: t })
|
|
27
|
+
});
|
|
28
|
+
}
|
|
29
|
+
function h({ name: e }) {
|
|
30
|
+
return /* @__PURE__ */ c(t, {
|
|
31
|
+
name: e,
|
|
32
|
+
size: 19,
|
|
33
|
+
sw: 1.7
|
|
34
|
+
});
|
|
35
|
+
}
|
|
36
|
+
function g({ className: t, style: n, children: r, ...i }) {
|
|
37
|
+
let a = s.useRef(null), [o, u] = s.useState({
|
|
38
|
+
l: !1,
|
|
39
|
+
r: !1
|
|
40
|
+
}), d = s.useCallback(() => {
|
|
41
|
+
let e = a.current;
|
|
42
|
+
if (!e) return;
|
|
43
|
+
let t = e.scrollLeft > 1, n = e.scrollLeft + e.clientWidth < e.scrollWidth - 1;
|
|
44
|
+
u((e) => e.l === t && e.r === n ? e : {
|
|
45
|
+
l: t,
|
|
46
|
+
r: n
|
|
47
|
+
});
|
|
48
|
+
}, []);
|
|
49
|
+
s.useLayoutEffect(() => {
|
|
50
|
+
let e = a.current;
|
|
51
|
+
if (!e) return;
|
|
52
|
+
d();
|
|
53
|
+
let t = new ResizeObserver(d);
|
|
54
|
+
t.observe(e);
|
|
55
|
+
for (let n of e.children) t.observe(n);
|
|
56
|
+
return () => t.disconnect();
|
|
57
|
+
}, [d, r]);
|
|
58
|
+
let f = s.Children.toArray(r), p = f.filter((e) => s.isValidElement(e) && e.type === x), m = p.length < f.length ? p : [], h = m.length ? f.filter((e) => !m.includes(e)) : f, g = o.l || o.r, _ = g ? `linear-gradient(to right, ${o.l ? "transparent, black 22px" : "black"}, ${o.r ? "black calc(100% - 22px), transparent" : "black"})` : void 0;
|
|
59
|
+
return /* @__PURE__ */ l("div", {
|
|
60
|
+
"data-slot": "pencil-toolbar",
|
|
61
|
+
"data-overflowing": g ? "" : void 0,
|
|
62
|
+
onPointerDown: (e) => e.stopPropagation(),
|
|
63
|
+
className: e("absolute inset-x-2.5 bottom-3.5 mx-auto box-border flex w-fit max-w-[calc(100%-20px)] cursor-default overflow-hidden rounded-2xl border border-border bg-card shadow-[0_10px_34px_black] shadow-black/24", t),
|
|
64
|
+
style: n,
|
|
65
|
+
...i,
|
|
66
|
+
children: [/* @__PURE__ */ c("div", {
|
|
67
|
+
ref: a,
|
|
68
|
+
"data-slot": "pencil-toolbar-row",
|
|
69
|
+
onScroll: d,
|
|
70
|
+
className: e("flex min-w-0 flex-1 touch-pan-x items-center gap-2.5 overflow-x-auto overscroll-x-contain py-[9px] pl-3 [scrollbar-width:none] *:shrink-0 [&::-webkit-scrollbar]:hidden", m.length ? "pr-0" : "pr-3"),
|
|
71
|
+
style: {
|
|
72
|
+
maskImage: _,
|
|
73
|
+
WebkitMaskImage: _
|
|
74
|
+
},
|
|
75
|
+
children: h
|
|
76
|
+
}), m.length ? /* @__PURE__ */ c("div", {
|
|
77
|
+
"data-slot": "pencil-toolbar-pinned",
|
|
78
|
+
className: "flex shrink-0 items-center gap-2.5 py-[9px] pr-3 pl-2.5",
|
|
79
|
+
children: m
|
|
80
|
+
}) : null]
|
|
81
|
+
});
|
|
82
|
+
}
|
|
83
|
+
function _({ className: t, style: n, ...r }) {
|
|
84
|
+
return /* @__PURE__ */ c("span", {
|
|
85
|
+
"data-slot": "pencil-toolbar-divider",
|
|
86
|
+
className: e("w-px self-stretch bg-border", t),
|
|
87
|
+
style: n,
|
|
88
|
+
...r
|
|
89
|
+
});
|
|
90
|
+
}
|
|
91
|
+
function v({ value: t, onChange: n, tools: i = [
|
|
92
|
+
"pen",
|
|
93
|
+
"marker",
|
|
94
|
+
"pencil",
|
|
95
|
+
"eraser"
|
|
96
|
+
], className: o, style: s, ...l }) {
|
|
97
|
+
return /* @__PURE__ */ c(u, {
|
|
98
|
+
"data-slot": "pencil-tool-picker",
|
|
99
|
+
"aria-label": "Tool",
|
|
100
|
+
selectionMode: "single",
|
|
101
|
+
selectedKeys: [t],
|
|
102
|
+
className: e("flex gap-0.5", o),
|
|
103
|
+
style: s,
|
|
104
|
+
...l,
|
|
105
|
+
children: i.map((e) => /* @__PURE__ */ c(r, {
|
|
106
|
+
id: e,
|
|
107
|
+
"aria-label": e,
|
|
108
|
+
title: e,
|
|
109
|
+
className: p(),
|
|
110
|
+
onPress: () => n?.(e),
|
|
111
|
+
children: /* @__PURE__ */ c(h, { name: a[e] })
|
|
112
|
+
}, e))
|
|
113
|
+
});
|
|
114
|
+
}
|
|
115
|
+
function y({ value: t, onChange: n, inks: a = i, className: o, style: s, ...l }) {
|
|
116
|
+
return /* @__PURE__ */ c(u, {
|
|
117
|
+
"data-slot": "pencil-ink-picker",
|
|
118
|
+
"aria-label": "Ink",
|
|
119
|
+
selectionMode: "single",
|
|
120
|
+
selectedKeys: [String(t)],
|
|
121
|
+
className: e("flex items-center gap-[7px]", o),
|
|
122
|
+
style: s,
|
|
123
|
+
...l,
|
|
124
|
+
children: a.map((t, a) => /* @__PURE__ */ c(r, {
|
|
125
|
+
id: String(a),
|
|
126
|
+
"aria-label": "Ink " + t,
|
|
127
|
+
title: t,
|
|
128
|
+
className: e("size-[21px] cursor-pointer rounded-[50%] border bg-(color:--ink) p-0 outline-offset-2 outline-none data-selected:outline-[2.5px] data-selected:outline-primary data-selected:outline-solid", t === i[1] ? "border-black/20" : "border-black/8"),
|
|
129
|
+
style: { "--ink": t },
|
|
130
|
+
onPress: () => n?.(a)
|
|
131
|
+
}, t))
|
|
132
|
+
});
|
|
133
|
+
}
|
|
134
|
+
function b({ value: t, onChange: n, widths: i = o, className: a, style: s, ...l }) {
|
|
135
|
+
return /* @__PURE__ */ c(u, {
|
|
136
|
+
"data-slot": "pencil-width-picker",
|
|
137
|
+
"aria-label": "Width",
|
|
138
|
+
selectionMode: "single",
|
|
139
|
+
selectedKeys: [String(t)],
|
|
140
|
+
className: e("flex items-center gap-1", a),
|
|
141
|
+
style: s,
|
|
142
|
+
...l,
|
|
143
|
+
children: i.map((e, t) => /* @__PURE__ */ c(r, {
|
|
144
|
+
id: String(t),
|
|
145
|
+
"aria-label": "Width " + (t + 1),
|
|
146
|
+
className: "grid size-7 cursor-pointer place-items-center rounded-lg border-0 bg-transparent p-0 data-selected:bg-secondary-strong",
|
|
147
|
+
onPress: () => n?.(t),
|
|
148
|
+
children: /* @__PURE__ */ c("span", {
|
|
149
|
+
className: "block size-(--dot) rounded-[50%] bg-foreground",
|
|
150
|
+
style: { "--dot": e.d + "px" }
|
|
151
|
+
})
|
|
152
|
+
}, t))
|
|
153
|
+
});
|
|
154
|
+
}
|
|
155
|
+
function x({ onUndo: t, onRedo: n, onClear: r, canUndo: i, canRedo: a, canClear: o, className: s, style: u, ...d }) {
|
|
156
|
+
return /* @__PURE__ */ l("div", {
|
|
157
|
+
"data-slot": "pencil-actions",
|
|
158
|
+
role: "group",
|
|
159
|
+
"aria-label": "History",
|
|
160
|
+
className: e("flex gap-0.5", s),
|
|
161
|
+
style: u,
|
|
162
|
+
...d,
|
|
163
|
+
children: [
|
|
164
|
+
/* @__PURE__ */ c(m, {
|
|
165
|
+
icon: "arrow-uturn-backward",
|
|
166
|
+
onPress: t,
|
|
167
|
+
disabled: !i,
|
|
168
|
+
label: "Undo"
|
|
169
|
+
}),
|
|
170
|
+
/* @__PURE__ */ c(m, {
|
|
171
|
+
icon: "arrow-uturn-forward",
|
|
172
|
+
onPress: n,
|
|
173
|
+
disabled: !a,
|
|
174
|
+
label: "Redo"
|
|
175
|
+
}),
|
|
176
|
+
/* @__PURE__ */ c(m, {
|
|
177
|
+
icon: "trash-slim",
|
|
178
|
+
onPress: r,
|
|
179
|
+
disabled: !(o ?? i),
|
|
180
|
+
label: "Clear"
|
|
181
|
+
})
|
|
182
|
+
]
|
|
183
|
+
});
|
|
184
|
+
}
|
|
185
|
+
//#endregion
|
|
186
|
+
export { y as InkPicker, x as PencilActions, m as PencilToolButton, g as PencilToolbar, _ as PencilToolbarDivider, v as ToolPicker, b as WidthPicker, p as pencilToolButtonVariants };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { ComposerAnnotatorProps } from '../
|
|
1
|
+
import { ComposerAnnotatorProps } from '../composer/annotator';
|
|
2
2
|
/**
|
|
3
3
|
* The Composer's default image annotator, on PencilKit: a canvas over the image, and the tool / ink / undo bar
|
|
4
4
|
* under it so it never covers the image. Save flattens the strokes into the image. Every Composer and
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"pencilkit-annotator.d.ts","sourceRoot":"","sources":["../../../src/components/pencilkit/pencilkit-annotator.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"pencilkit-annotator.d.ts","sourceRoot":"","sources":["../../../src/components/pencilkit/pencilkit-annotator.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,oCAAoC,CAAC;AAMjF;;;;GAIG;AACH,wBAAgB,kBAAkB,CAAC,EAAE,QAAQ,EAAE,EAAE,sBAAsB,6BAuBtE"}
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { PK_INKS as e } from "./constants.js";
|
|
3
|
+
import { PencilCanvas as t } from "./pencil-canvas.js";
|
|
4
|
+
import { InkPicker as n, PencilActions as r, PencilToolbar as i, PencilToolbarDivider as a, ToolPicker as o } from "./pencil-toolbar.js";
|
|
5
|
+
import { usePencilHistory as s } from "./use-pencil-history.js";
|
|
6
|
+
import { useState as c } from "react";
|
|
7
|
+
import { jsx as l, jsxs as u } from "react/jsx-runtime";
|
|
8
|
+
//#region src/components/pencilkit/pencilkit-annotator.tsx
|
|
9
|
+
function d({ children: d }) {
|
|
10
|
+
let [f, p] = c("pen"), [m, h] = c(5), g = s();
|
|
11
|
+
return d({
|
|
12
|
+
title: "Annotate — PencilKit strokes flatten into the image on save",
|
|
13
|
+
canvas: /* @__PURE__ */ l(t, {
|
|
14
|
+
tool: f,
|
|
15
|
+
ink: e[m],
|
|
16
|
+
strokes: g.strokes,
|
|
17
|
+
onStrokesChange: g.onStrokesChange
|
|
18
|
+
}),
|
|
19
|
+
toolbar: /* @__PURE__ */ u(i, {
|
|
20
|
+
className: "relative bottom-auto left-auto mx-auto translate-x-0 shadow-none",
|
|
21
|
+
children: [
|
|
22
|
+
/* @__PURE__ */ l(o, {
|
|
23
|
+
value: f,
|
|
24
|
+
onChange: p
|
|
25
|
+
}),
|
|
26
|
+
/* @__PURE__ */ l(a, {}),
|
|
27
|
+
/* @__PURE__ */ l(n, {
|
|
28
|
+
value: m,
|
|
29
|
+
onChange: h
|
|
30
|
+
}),
|
|
31
|
+
/* @__PURE__ */ l(a, {}),
|
|
32
|
+
/* @__PURE__ */ l(r, {
|
|
33
|
+
onUndo: g.undo,
|
|
34
|
+
onRedo: g.redo,
|
|
35
|
+
onClear: g.clear,
|
|
36
|
+
canUndo: g.canUndo,
|
|
37
|
+
canRedo: g.canRedo
|
|
38
|
+
})
|
|
39
|
+
]
|
|
40
|
+
})
|
|
41
|
+
});
|
|
42
|
+
}
|
|
43
|
+
//#endregion
|
|
44
|
+
export { d as PencilKitAnnotator };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"stroke-path.d.ts","sourceRoot":"","sources":["../../../src/components/pencilkit/stroke-path.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"stroke-path.d.ts","sourceRoot":"","sources":["../../../src/components/pencilkit/stroke-path.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAE/B,OAAO,EAAY,KAAK,YAAY,EAAE,MAAM,qCAAqC,CAAC;AAElF,wBAAgB,WAAW,CAAC,GAAG,EAAE,MAAM,EAAE,EAAE,GAAG,MAAM,CAWnD;AAED,MAAM,WAAW,eAAe;IAC9B,EAAE,EAAE,YAAY,CAAC;IACjB,wFAAwF;IACxF,EAAE,CAAC,EAAE,OAAO,CAAC;CACd;AAED,wBAAgB,UAAU,CAAC,EAAE,EAAE,EAAE,EAAS,EAAE,EAAE,eAAe,2CAuB5D;AAED,eAAO,MAAM,UAAU,8CAAyB,CAAC"}
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { PK_TOOLS as e } from "./constants.js";
|
|
3
|
+
import * as t from "react";
|
|
4
|
+
import { jsx as n } from "react/jsx-runtime";
|
|
5
|
+
import { getStroke as r } from "perfect-freehand";
|
|
6
|
+
//#region src/components/pencilkit/stroke-path.tsx
|
|
7
|
+
function i(e) {
|
|
8
|
+
if (!e || e.length < 3) return "";
|
|
9
|
+
let t = "M" + e[0][0].toFixed(2) + " " + e[0][1].toFixed(2) + "Q";
|
|
10
|
+
for (let n = 0; n < e.length; n++) {
|
|
11
|
+
let r = e[n], i = e[(n + 1) % e.length];
|
|
12
|
+
t += r[0].toFixed(2) + " " + r[1].toFixed(2) + " " + ((r[0] + i[0]) / 2).toFixed(2) + " " + ((r[1] + i[1]) / 2).toFixed(2) + " ";
|
|
13
|
+
}
|
|
14
|
+
return t + "Z";
|
|
15
|
+
}
|
|
16
|
+
function a({ st: t, pf: a = !0 }) {
|
|
17
|
+
let o = e[t.tool];
|
|
18
|
+
if (a) {
|
|
19
|
+
let e = r(t.points, {
|
|
20
|
+
...o.opt,
|
|
21
|
+
size: o.opt.size * t.w,
|
|
22
|
+
simulatePressure: !t.pen,
|
|
23
|
+
last: !!t.done
|
|
24
|
+
});
|
|
25
|
+
return /* @__PURE__ */ n("path", {
|
|
26
|
+
d: i(e),
|
|
27
|
+
fill: t.color,
|
|
28
|
+
fillOpacity: o.alpha
|
|
29
|
+
});
|
|
30
|
+
}
|
|
31
|
+
let s = t.points.map((e, t) => (t ? "L" : "M") + e[0].toFixed(1) + " " + e[1].toFixed(1)).join("");
|
|
32
|
+
return /* @__PURE__ */ n("path", {
|
|
33
|
+
d: s,
|
|
34
|
+
fill: "none",
|
|
35
|
+
stroke: t.color,
|
|
36
|
+
strokeOpacity: o.alpha,
|
|
37
|
+
strokeWidth: o.opt.size * t.w,
|
|
38
|
+
strokeLinecap: "round",
|
|
39
|
+
strokeLinejoin: "round"
|
|
40
|
+
});
|
|
41
|
+
}
|
|
42
|
+
var o = t.memo(a);
|
|
43
|
+
//#endregion
|
|
44
|
+
export { o as MemoStroke, a as StrokePath, i as outlinePath };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { PencilStroke } from '
|
|
1
|
+
import { PencilStroke } from './constants';
|
|
2
2
|
import { PencilStrokesChangeSource } from './pencil-canvas';
|
|
3
3
|
export interface PencilHistory {
|
|
4
4
|
strokes: PencilStroke[];
|
|
@@ -10,6 +10,6 @@ export interface PencilHistory {
|
|
|
10
10
|
canUndo: boolean;
|
|
11
11
|
canRedo: boolean;
|
|
12
12
|
}
|
|
13
|
-
/** Undo / redo / clear stack for PencilCanvas strokes
|
|
13
|
+
/** Undo / redo / clear stack for PencilCanvas strokes. */
|
|
14
14
|
export declare function usePencilHistory(initial?: PencilStroke[]): PencilHistory;
|
|
15
15
|
//# sourceMappingURL=use-pencil-history.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"use-pencil-history.d.ts","sourceRoot":"","sources":["../../../src/components/pencilkit/use-pencil-history.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM
|
|
1
|
+
{"version":3,"file":"use-pencil-history.d.ts","sourceRoot":"","sources":["../../../src/components/pencilkit/use-pencil-history.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,qCAAqC,CAAC;AACxE,OAAO,KAAK,EAAE,yBAAyB,EAAE,MAAM,yCAAyC,CAAC;AAEzF,MAAM,WAAW,aAAa;IAC5B,OAAO,EAAE,YAAY,EAAE,CAAC;IACxB,sFAAsF;IACtF,eAAe,EAAE,CAAC,IAAI,EAAE,YAAY,EAAE,EAAE,MAAM,EAAE,yBAAyB,KAAK,IAAI,CAAC;IACnF,IAAI,EAAE,MAAM,IAAI,CAAC;IACjB,IAAI,EAAE,MAAM,IAAI,CAAC;IACjB,KAAK,EAAE,MAAM,IAAI,CAAC;IAClB,OAAO,EAAE,OAAO,CAAC;IACjB,OAAO,EAAE,OAAO,CAAC;CAClB;AAED,0DAA0D;AAC1D,wBAAgB,gBAAgB,CAAC,OAAO,GAAE,YAAY,EAAO,GAAG,aAAa,CAyB5E"}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { useState as e } from "react";
|
|
3
|
+
//#region src/components/pencilkit/use-pencil-history.ts
|
|
4
|
+
function t(t = []) {
|
|
5
|
+
let [n, r] = e(t), [i, a] = e([]);
|
|
6
|
+
return {
|
|
7
|
+
strokes: n,
|
|
8
|
+
onStrokesChange: (e, t) => {
|
|
9
|
+
r(e), t === "draw" && a([]);
|
|
10
|
+
},
|
|
11
|
+
undo: () => {
|
|
12
|
+
n.length && (a([...i, n[n.length - 1]]), r(n.slice(0, -1)));
|
|
13
|
+
},
|
|
14
|
+
redo: () => {
|
|
15
|
+
i.length && (r([...n, i[i.length - 1]]), a(i.slice(0, -1)));
|
|
16
|
+
},
|
|
17
|
+
clear: () => {
|
|
18
|
+
n.length && (r([]), a([]));
|
|
19
|
+
},
|
|
20
|
+
canUndo: n.length > 0,
|
|
21
|
+
canRedo: i.length > 0
|
|
22
|
+
};
|
|
23
|
+
}
|
|
24
|
+
//#endregion
|
|
25
|
+
export { t as usePencilHistory };
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { ButtonProps as AriaButtonProps, ToggleButtonProps as AriaToggleButtonProps } from 'react-aria-components';
|
|
2
|
+
export interface PlainButtonProps extends Omit<AriaButtonProps, 'render'> {
|
|
3
|
+
title?: string;
|
|
4
|
+
}
|
|
5
|
+
export declare function PlainButton({ title, ...props }: PlainButtonProps): import("react/jsx-runtime").JSX.Element;
|
|
6
|
+
export interface PlainToggleButtonProps extends Omit<AriaToggleButtonProps, 'render'> {
|
|
7
|
+
title?: string;
|
|
8
|
+
}
|
|
9
|
+
export declare function PlainToggleButton({ title, ...props }: PlainToggleButtonProps): import("react/jsx-runtime").JSX.Element;
|
|
10
|
+
//# sourceMappingURL=plain-button.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"plain-button.d.ts","sourceRoot":"","sources":["../../src/components/plain-button.tsx"],"names":[],"mappings":"AAEA,OAAO,EAGL,KAAK,WAAW,IAAI,eAAe,EACnC,KAAK,iBAAiB,IAAI,qBAAqB,EAChD,MAAM,uBAAuB,CAAC;AAQ/B,MAAM,WAAW,gBAAiB,SAAQ,IAAI,CAAC,eAAe,EAAE,QAAQ,CAAC;IACvE,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB;AACD,wBAAgB,WAAW,CAAC,EAAE,KAAK,EAAE,GAAG,KAAK,EAAE,EAAE,gBAAgB,2CAEhE;AAED,MAAM,WAAW,sBAAuB,SAAQ,IAAI,CAAC,qBAAqB,EAAE,QAAQ,CAAC;IACnF,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB;AACD,wBAAgB,iBAAiB,CAAC,EAAE,KAAK,EAAE,GAAG,KAAK,EAAE,EAAE,sBAAsB,2CAE5E"}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import "react";
|
|
3
|
+
import { jsx as e } from "react/jsx-runtime";
|
|
4
|
+
import { Button as t, ToggleButton as n } from "react-aria-components";
|
|
5
|
+
//#region src/components/plain-button.tsx
|
|
6
|
+
var r = (t) => t ? { render: (n) => /* @__PURE__ */ e("button", {
|
|
7
|
+
...n,
|
|
8
|
+
title: t
|
|
9
|
+
}) } : {};
|
|
10
|
+
function i({ title: n, ...i }) {
|
|
11
|
+
return /* @__PURE__ */ e(t, {
|
|
12
|
+
...i,
|
|
13
|
+
...r(n)
|
|
14
|
+
});
|
|
15
|
+
}
|
|
16
|
+
function a({ title: t, ...i }) {
|
|
17
|
+
return /* @__PURE__ */ e(n, {
|
|
18
|
+
...i,
|
|
19
|
+
...r(t)
|
|
20
|
+
});
|
|
21
|
+
}
|
|
22
|
+
//#endregion
|
|
23
|
+
export { i as PlainButton, a as PlainToggleButton };
|
|
@@ -4,7 +4,7 @@ export declare const PopoverTrigger: typeof DialogTrigger;
|
|
|
4
4
|
export interface PopoverProps extends AriaPopoverProps {
|
|
5
5
|
}
|
|
6
6
|
/** The styled floating surface. Select, ComboBox and DropdownMenu render their lists inside it. */
|
|
7
|
-
export declare function Popover({ className, offset, ...props }: PopoverProps): import("react/jsx-runtime").JSX.Element;
|
|
7
|
+
export declare function Popover({ className, style, offset, ...props }: PopoverProps): import("react/jsx-runtime").JSX.Element;
|
|
8
8
|
export interface PopoverContentProps extends Omit<PopoverProps, 'children'> {
|
|
9
9
|
children?: AriaDialogProps['children'];
|
|
10
10
|
/** Accessible name when the content has no heading. */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"popover.d.ts","sourceRoot":"","sources":["../../src/components/popover.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"popover.d.ts","sourceRoot":"","sources":["../../src/components/popover.tsx"],"names":[],"mappings":"AACA,OAAO,EACiB,KAAK,WAAW,IAAI,eAAe,EACzD,aAAa,EACW,KAAK,YAAY,IAAI,gBAAgB,EAE9D,MAAM,uBAAuB,CAAC;AAY/B,wEAAwE;AACxE,eAAO,MAAM,cAAc,sBAAgB,CAAC;AAE5C,MAAM,WAAW,YAAa,SAAQ,gBAAgB;CAAG;AAEzD,mGAAmG;AACnG,wBAAgB,OAAO,CAAC,EAAE,SAAS,EAAE,KAAK,EAAE,MAAU,EAAE,GAAG,KAAK,EAAE,EAAE,YAAY,2CAY/E;AAED,MAAM,WAAW,mBAAoB,SAAQ,IAAI,CAAC,YAAY,EAAE,UAAU,CAAC;IACzE,QAAQ,CAAC,EAAE,eAAe,CAAC,UAAU,CAAC,CAAC;IACvC,uDAAuD;IACvD,YAAY,CAAC,EAAE,MAAM,CAAC;CACvB;AAED,+EAA+E;AAC/E,wBAAgB,cAAc,CAAC,EAAE,SAAS,EAAE,QAAQ,EAAE,YAAY,EAAE,SAAS,EAAE,GAAG,KAAK,EAAE,EAAE,mBAAmB,2CAQ7G"}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { cn as e } from "../lib/utils.js";
|
|
3
|
+
import { useThemeScopeProps as t } from "../lib/theme.js";
|
|
4
|
+
import { overlayZ as n, popoverMotion as r, popoverSurface as i } from "../lib/primitives.js";
|
|
5
|
+
import { jsx as a } from "react/jsx-runtime";
|
|
6
|
+
import { Dialog as o, DialogTrigger as s, Popover as c, composeRenderProps as l } from "react-aria-components";
|
|
7
|
+
//#region src/components/popover.tsx
|
|
8
|
+
var u = s;
|
|
9
|
+
function d({ className: o, style: s, offset: u = 8, ...d }) {
|
|
10
|
+
let f = t();
|
|
11
|
+
return /* @__PURE__ */ a(c, {
|
|
12
|
+
"data-slot": "popover",
|
|
13
|
+
"data-theme-scope": f["data-theme-scope"],
|
|
14
|
+
offset: u,
|
|
15
|
+
className: l(o, (t) => e(i, r, n, "min-w-(--trigger-width)", f.className, t)),
|
|
16
|
+
style: l(s, (e) => ({
|
|
17
|
+
...f.style,
|
|
18
|
+
...e
|
|
19
|
+
})),
|
|
20
|
+
...d
|
|
21
|
+
});
|
|
22
|
+
}
|
|
23
|
+
function f({ className: t, children: n, "aria-label": r, ...i }) {
|
|
24
|
+
return /* @__PURE__ */ a(d, {
|
|
25
|
+
className: l(t, (t) => e("w-72 min-w-0", t)),
|
|
26
|
+
...i,
|
|
27
|
+
children: /* @__PURE__ */ a(o, {
|
|
28
|
+
"data-slot": "popover-content",
|
|
29
|
+
"aria-label": r,
|
|
30
|
+
className: "p-4 outline-none",
|
|
31
|
+
children: n
|
|
32
|
+
})
|
|
33
|
+
});
|
|
34
|
+
}
|
|
35
|
+
//#endregion
|
|
36
|
+
export { d as Popover, f as PopoverContent, u as PopoverTrigger };
|