@brett_lamy/ui 2.0.0 → 3.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +4 -4
- 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 +300 -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 +24 -47
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +91 -20350
- package/dist/lib/container.d.ts.map +1 -1
- package/dist/lib/container.js +49 -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/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 +4 -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,300 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { cn as e } from "../lib/utils.js";
|
|
3
|
+
import * as t from "react";
|
|
4
|
+
import { jsx as n, jsxs as r } from "react/jsx-runtime";
|
|
5
|
+
import { cva as i } from "class-variance-authority";
|
|
6
|
+
import { GitbookEditor as a } from "@brett_lamy/docstream-editor/editor";
|
|
7
|
+
import { astToTiptap as o } from "@brett_lamy/docstream-editor/convert";
|
|
8
|
+
import { parseMarkdown as s } from "@brett_lamy/docstream/gitbook";
|
|
9
|
+
//#region src/components/markdown-editor.tsx
|
|
10
|
+
var c = [
|
|
11
|
+
/^\s{0,3}#{1,6}\s/m,
|
|
12
|
+
/^\s*(?:[-*+]|\d+[.)])\s/m,
|
|
13
|
+
/^\s*>\s/m,
|
|
14
|
+
/```/,
|
|
15
|
+
/\{%\s*[a-z-]+/,
|
|
16
|
+
/\*\*[^*\n]+\*\*|__[^_\n]+__/,
|
|
17
|
+
/`[^`\n]+`/,
|
|
18
|
+
/\[[^\]\n]+\]\([^)\s]+\)/,
|
|
19
|
+
/^\s*\|.+\|\s*$/m,
|
|
20
|
+
/^\s*(?:---|\*\*\*)\s*$/m
|
|
21
|
+
];
|
|
22
|
+
function l(e) {
|
|
23
|
+
return c.some((t) => t.test(e));
|
|
24
|
+
}
|
|
25
|
+
function u(e, t) {
|
|
26
|
+
let n = o(s(t));
|
|
27
|
+
return n.content?.length ? (e.commands.insertContent(n.content), !0) : !1;
|
|
28
|
+
}
|
|
29
|
+
var d = i([
|
|
30
|
+
"bl-mde group/mde relative box-border flex w-full min-w-0 flex-col text-left [font-family:inherit] text-foreground",
|
|
31
|
+
"transition-[box-shadow,background-color] duration-spring-snappy ease-spring-snappy",
|
|
32
|
+
"data-disabled:cursor-not-allowed data-disabled:opacity-50"
|
|
33
|
+
], {
|
|
34
|
+
variants: {
|
|
35
|
+
variant: {
|
|
36
|
+
default: "rounded-ctl bg-input focus-within:bg-transparent focus-within:shadow-[inset_0_0_0_1.5px_var(--primary)] data-readonly:focus-within:bg-input data-readonly:focus-within:shadow-none data-invalid:shadow-[inset_0_0_0_1.5px_var(--destructive)]",
|
|
37
|
+
ghost: "rounded-none bg-transparent",
|
|
38
|
+
card: "rounded-card bg-card shadow-[0_0_0_1px_var(--border),0_1px_2px_--alpha(black/4%)] focus-within:shadow-[0_0_0_1.5px_var(--primary),0_1px_2px_--alpha(black/4%)] data-readonly:focus-within:shadow-[0_0_0_1px_var(--border),0_1px_2px_--alpha(black/4%)] data-invalid:shadow-[0_0_0_1.5px_var(--destructive)]"
|
|
39
|
+
},
|
|
40
|
+
size: {
|
|
41
|
+
sm: "bl-mde-sm",
|
|
42
|
+
default: "bl-mde-md",
|
|
43
|
+
lg: "bl-mde-lg"
|
|
44
|
+
}
|
|
45
|
+
},
|
|
46
|
+
defaultVariants: {
|
|
47
|
+
variant: "default",
|
|
48
|
+
size: "default"
|
|
49
|
+
}
|
|
50
|
+
}), f = {
|
|
51
|
+
heading: ".ProseMirror > :is(h1,h2,h3,h4,h5,h6):not(:first-child)",
|
|
52
|
+
paragraph: ".ProseMirror p",
|
|
53
|
+
list: ".ProseMirror :is(ul:not([data-type=\"taskList\"]), ol)",
|
|
54
|
+
checklist: ".ProseMirror ul[data-type=\"taskList\"]",
|
|
55
|
+
checklistItem: ".ProseMirror ul[data-type=\"taskList\"] > li",
|
|
56
|
+
checkbox: ".ProseMirror ul[data-type=\"taskList\"] > li > label input[type=\"checkbox\"]",
|
|
57
|
+
table: ".ProseMirror table",
|
|
58
|
+
tableHeader: ".ProseMirror th",
|
|
59
|
+
tableCell: ".ProseMirror td",
|
|
60
|
+
blockquote: ".ProseMirror blockquote",
|
|
61
|
+
codeBlock: ".ProseMirror pre",
|
|
62
|
+
link: ".ProseMirror a",
|
|
63
|
+
toolbar: ".gb-toolbar"
|
|
64
|
+
}, p = (e) => e ? e.split(/\s+/).filter(Boolean) : [];
|
|
65
|
+
function m(e, t, n) {
|
|
66
|
+
let r = e.view, i = r.dom, a = i.closest(".gb") ?? i.parentElement;
|
|
67
|
+
if (!a) return;
|
|
68
|
+
let o = /* @__PURE__ */ new Map(), s = (e, t) => {
|
|
69
|
+
let n = p(t);
|
|
70
|
+
!e || !n.length || o.set(e, [...o.get(e) ?? [], ...n]);
|
|
71
|
+
};
|
|
72
|
+
s(a, t.editor), s(i, t.content), s(i.firstElementChild, t.title);
|
|
73
|
+
for (let [e, n] of Object.entries(f)) {
|
|
74
|
+
let r = t[e];
|
|
75
|
+
r && a.querySelectorAll(n).forEach((e) => s(e, r));
|
|
76
|
+
}
|
|
77
|
+
let c = (e, t) => (e ?? []).join(" ") === (t ?? []).join(" "), l = n.size !== o.size;
|
|
78
|
+
if (!l) {
|
|
79
|
+
for (let [e, t] of o) if (!c(n.get(e), t) || !t.every((t) => e.classList.contains(t))) {
|
|
80
|
+
l = !0;
|
|
81
|
+
break;
|
|
82
|
+
}
|
|
83
|
+
}
|
|
84
|
+
if (l) {
|
|
85
|
+
r.domObserver?.stop();
|
|
86
|
+
try {
|
|
87
|
+
for (let [e, t] of n) o.has(e) || e.classList.remove(...t);
|
|
88
|
+
for (let [e, t] of o) {
|
|
89
|
+
let r = n.get(e);
|
|
90
|
+
r && e.classList.remove(...r.filter((e) => !t.includes(e))), e.classList.add(...t);
|
|
91
|
+
}
|
|
92
|
+
} finally {
|
|
93
|
+
r.domObserver?.start();
|
|
94
|
+
}
|
|
95
|
+
n.clear();
|
|
96
|
+
for (let [e, t] of o) n.set(e, t);
|
|
97
|
+
}
|
|
98
|
+
}
|
|
99
|
+
var h = (e) => typeof e == "number" ? `${e}px` : e, g = [
|
|
100
|
+
"--popover",
|
|
101
|
+
"--popover-foreground",
|
|
102
|
+
"--card",
|
|
103
|
+
"--card-foreground",
|
|
104
|
+
"--foreground",
|
|
105
|
+
"--border",
|
|
106
|
+
"--muted",
|
|
107
|
+
"--muted-foreground",
|
|
108
|
+
"--accent",
|
|
109
|
+
"--accent-foreground",
|
|
110
|
+
"--primary"
|
|
111
|
+
];
|
|
112
|
+
function _(e) {
|
|
113
|
+
t.useEffect(() => {
|
|
114
|
+
if (typeof MutationObserver > "u") return;
|
|
115
|
+
let t = new MutationObserver((t) => {
|
|
116
|
+
let n = e.current;
|
|
117
|
+
if (!n || !(n.matches(":focus-within") || n.matches(":hover"))) return;
|
|
118
|
+
let r = getComputedStyle(n);
|
|
119
|
+
for (let e of t) e.addedNodes.forEach((e) => {
|
|
120
|
+
if (!(!(e instanceof HTMLElement) || !e.matches(".react-renderer, .gb-attachment-card"))) {
|
|
121
|
+
for (let t of g) e.style.setProperty(t, r.getPropertyValue(t));
|
|
122
|
+
e.style.colorScheme = r.colorScheme, e.dataset.scheme = /dark/.test(r.colorScheme) && !/light/.test(r.colorScheme) ? "dark" : "light", e.style.fontFamily = r.fontFamily, e.dataset.markdownEditorPortal = "";
|
|
123
|
+
}
|
|
124
|
+
});
|
|
125
|
+
});
|
|
126
|
+
return t.observe(document.body, { childList: !0 }), () => t.disconnect();
|
|
127
|
+
}, [e]);
|
|
128
|
+
}
|
|
129
|
+
var v = t.forwardRef(function({ value: i, defaultValue: c = "", onValueChange: f, onSubmit: p, placeholder: g, readOnly: v = !1, disabled: y = !1, invalid: b = !1, autoFocus: ee = !1, toolbar: x = !1, slashMenu: te = !0, references: ne = !1, pasteMarkdown: S = !0, imagePaste: C = "inline", attachments: w, onAttachmentAdd: T, onAttachmentRemove: E, onAttachmentOpen: D, onKeyDown: O, onPaste: k, onFocus: A, onBlur: j, onEditorReady: M, minHeight: N, maxHeight: P, name: F, id: I, "aria-label": L, "aria-labelledby": R, "aria-describedby": z, variant: B, size: re, className: V, contentClassName: H, classNames: U, style: ie }, ae) {
|
|
130
|
+
let W = i !== void 0, [G, K] = t.useState(c), q = W ? i : G, [J, oe] = t.useState(null), Y = t.useRef(null), X = !v && !y, Z = t.useRef({
|
|
131
|
+
markdown: q,
|
|
132
|
+
onValueChange: f,
|
|
133
|
+
onSubmit: p,
|
|
134
|
+
onKeyDown: O,
|
|
135
|
+
onPaste: k,
|
|
136
|
+
pasteMarkdown: S,
|
|
137
|
+
onReady: M,
|
|
138
|
+
controlled: W
|
|
139
|
+
});
|
|
140
|
+
Z.current = {
|
|
141
|
+
markdown: q,
|
|
142
|
+
onValueChange: f,
|
|
143
|
+
onSubmit: p,
|
|
144
|
+
onKeyDown: O,
|
|
145
|
+
onPaste: k,
|
|
146
|
+
pasteMarkdown: S,
|
|
147
|
+
onReady: M,
|
|
148
|
+
controlled: W
|
|
149
|
+
};
|
|
150
|
+
let se = t.useCallback((e) => {
|
|
151
|
+
Z.current.markdown = e, Z.current.controlled || K(e), Z.current.onValueChange?.(e);
|
|
152
|
+
}, []), Q = t.useCallback((e) => Z.current.onKeyDown?.(e) ? !0 : e.key === "Enter" && (e.metaKey || e.ctrlKey) && Z.current.onSubmit ? (Z.current.onSubmit(Z.current.markdown), !0) : !1, []), $ = t.useRef(null), ce = t.useCallback((e) => {
|
|
153
|
+
if (Z.current.onPaste?.(e)) return !0;
|
|
154
|
+
let t = $.current;
|
|
155
|
+
if (!Z.current.pasteMarkdown || !t) return !1;
|
|
156
|
+
let n = e.clipboardData;
|
|
157
|
+
if (n && Array.from(n.files ?? []).some((e) => e.type.startsWith("image/")) || t.state.selection.$from.parent.type.spec.code) return !1;
|
|
158
|
+
let r = n?.getData("text/plain") ?? "";
|
|
159
|
+
return l(r) ? u(t, r) : !1;
|
|
160
|
+
}, []), le = t.useCallback((e) => {
|
|
161
|
+
$.current = e, oe(e), Z.current.onReady?.(e);
|
|
162
|
+
}, []);
|
|
163
|
+
t.useEffect(() => {
|
|
164
|
+
J && !J.isDestroyed && J.isEditable !== X && J.setEditable(X, !1);
|
|
165
|
+
}, [J, X]), t.useEffect(() => {
|
|
166
|
+
let e = J?.view.dom;
|
|
167
|
+
if (!e) return;
|
|
168
|
+
let t = {
|
|
169
|
+
id: I,
|
|
170
|
+
"aria-label": L,
|
|
171
|
+
"aria-labelledby": R,
|
|
172
|
+
"aria-describedby": z,
|
|
173
|
+
"aria-invalid": b ? "true" : void 0,
|
|
174
|
+
"aria-readonly": v ? "true" : void 0,
|
|
175
|
+
"aria-disabled": y ? "true" : void 0,
|
|
176
|
+
"aria-placeholder": g
|
|
177
|
+
};
|
|
178
|
+
for (let [n, r] of Object.entries(t)) r === void 0 ? e.removeAttribute(n) : e.setAttribute(n, r);
|
|
179
|
+
}, [
|
|
180
|
+
J,
|
|
181
|
+
I,
|
|
182
|
+
L,
|
|
183
|
+
R,
|
|
184
|
+
z,
|
|
185
|
+
b,
|
|
186
|
+
v,
|
|
187
|
+
y,
|
|
188
|
+
g
|
|
189
|
+
]), t.useEffect(() => {
|
|
190
|
+
if (!J) return;
|
|
191
|
+
let e = () => A?.(), t = () => j?.();
|
|
192
|
+
return J.on("focus", e), J.on("blur", t), () => {
|
|
193
|
+
J.off("focus", e), J.off("blur", t);
|
|
194
|
+
};
|
|
195
|
+
}, [
|
|
196
|
+
J,
|
|
197
|
+
A,
|
|
198
|
+
j
|
|
199
|
+
]), t.useImperativeHandle(ae, () => ({
|
|
200
|
+
get editor() {
|
|
201
|
+
return $.current;
|
|
202
|
+
},
|
|
203
|
+
get commands() {
|
|
204
|
+
return $.current?.commands ?? null;
|
|
205
|
+
},
|
|
206
|
+
chain: () => $.current?.chain().focus() ?? null,
|
|
207
|
+
focus: (e = "end") => {
|
|
208
|
+
$.current?.commands.focus(e);
|
|
209
|
+
},
|
|
210
|
+
blur: () => {
|
|
211
|
+
$.current?.commands.blur();
|
|
212
|
+
},
|
|
213
|
+
getMarkdown: () => Z.current.markdown,
|
|
214
|
+
setMarkdown: (e) => {
|
|
215
|
+
let t = $.current;
|
|
216
|
+
t && t.commands.setContent(o(s(e)), { emitUpdate: !0 });
|
|
217
|
+
},
|
|
218
|
+
insertMarkdown: (e) => {
|
|
219
|
+
let t = $.current;
|
|
220
|
+
t && (t.commands.focus(), u(t, e));
|
|
221
|
+
},
|
|
222
|
+
clear: () => {
|
|
223
|
+
$.current?.commands.clearContent(!0);
|
|
224
|
+
},
|
|
225
|
+
isEmpty: () => $.current?.isEmpty ?? !Z.current.markdown.trim()
|
|
226
|
+
}), []), _(Y);
|
|
227
|
+
let ue = JSON.stringify([H, U ?? null]);
|
|
228
|
+
return t.useEffect(() => {
|
|
229
|
+
if (!J) return;
|
|
230
|
+
let t = {
|
|
231
|
+
...U,
|
|
232
|
+
content: e(U?.content, H) || void 0
|
|
233
|
+
}, n = /* @__PURE__ */ new Map(), r = () => {
|
|
234
|
+
J.isDestroyed || m(J, t, n);
|
|
235
|
+
};
|
|
236
|
+
r();
|
|
237
|
+
let i, a = () => {
|
|
238
|
+
clearTimeout(i), i = setTimeout(r, 16);
|
|
239
|
+
}, o = () => {
|
|
240
|
+
r(), a();
|
|
241
|
+
};
|
|
242
|
+
J.on("transaction", o);
|
|
243
|
+
let s = J.view.dom.closest(".gb") ?? J.view.dom, c = typeof MutationObserver > "u" ? null : new MutationObserver(() => {
|
|
244
|
+
r(), a();
|
|
245
|
+
});
|
|
246
|
+
return c?.observe(s, {
|
|
247
|
+
childList: !0,
|
|
248
|
+
subtree: !0
|
|
249
|
+
}), () => {
|
|
250
|
+
J.off("transaction", o), c?.disconnect(), clearTimeout(i), !J.isDestroyed && m(J, {}, n);
|
|
251
|
+
};
|
|
252
|
+
}, [J, ue]), /* @__PURE__ */ r("div", {
|
|
253
|
+
ref: Y,
|
|
254
|
+
"data-slot": "markdown-editor",
|
|
255
|
+
"data-variant": B ?? "default",
|
|
256
|
+
"data-readonly": v || void 0,
|
|
257
|
+
"data-disabled": y || void 0,
|
|
258
|
+
"data-invalid": b || void 0,
|
|
259
|
+
"data-toolbar": x && X || void 0,
|
|
260
|
+
className: e(d({
|
|
261
|
+
variant: B,
|
|
262
|
+
size: re
|
|
263
|
+
}), V),
|
|
264
|
+
style: {
|
|
265
|
+
...N === void 0 ? {} : { "--mde-min-h": h(N) },
|
|
266
|
+
...P === void 0 ? {} : { "--mde-max-h": h(P) },
|
|
267
|
+
...ie
|
|
268
|
+
},
|
|
269
|
+
onPointerDown: (e) => {
|
|
270
|
+
let t = e.target;
|
|
271
|
+
X && (t === e.currentTarget || t.matches(".gb-content, .bl-mde-doc")) && (e.preventDefault(), $.current?.commands.focus("end"));
|
|
272
|
+
},
|
|
273
|
+
children: [/* @__PURE__ */ n(a, {
|
|
274
|
+
markdown: q,
|
|
275
|
+
onChange: se,
|
|
276
|
+
toolbar: x && X,
|
|
277
|
+
slashMenu: te,
|
|
278
|
+
references: ne,
|
|
279
|
+
editable: X,
|
|
280
|
+
...g === void 0 ? {} : { placeholder: g },
|
|
281
|
+
autofocus: ee,
|
|
282
|
+
className: "bl-mde-doc",
|
|
283
|
+
onKeyDown: Q,
|
|
284
|
+
onPaste: ce,
|
|
285
|
+
imagePaste: C,
|
|
286
|
+
...w ? { attachments: w } : {},
|
|
287
|
+
...T ? { onAttachmentAdd: T } : {},
|
|
288
|
+
...E ? { onAttachmentRemove: E } : {},
|
|
289
|
+
...D ? { onAttachmentOpen: D } : {},
|
|
290
|
+
onEditorReady: le
|
|
291
|
+
}), F === void 0 ? null : /* @__PURE__ */ n("input", {
|
|
292
|
+
type: "hidden",
|
|
293
|
+
name: F,
|
|
294
|
+
value: q,
|
|
295
|
+
disabled: y
|
|
296
|
+
})]
|
|
297
|
+
});
|
|
298
|
+
});
|
|
299
|
+
//#endregion
|
|
300
|
+
export { v as MarkdownEditor, u as insertMarkdown, l as looksLikeMarkdown, d as markdownEditorVariants };
|
|
@@ -23,4 +23,4 @@ export interface MarkdownViewProps {
|
|
|
23
23
|
style?: React.CSSProperties;
|
|
24
24
|
}
|
|
25
25
|
export declare function MarkdownView({ markdown, streaming, onReferenceClick, renderReference, className, style }: MarkdownViewProps): import("react/jsx-runtime").JSX.Element;
|
|
26
|
-
//# sourceMappingURL=markdown.d.ts.map
|
|
26
|
+
//# sourceMappingURL=markdown-view.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"markdown-view.d.ts","sourceRoot":"","sources":["../../src/components/markdown-view.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAE/B,OAAO,EAAE,mBAAmB,EAAE,KAAK,wBAAwB,EAAE,MAAM,iCAAiC,CAAC;AACrG,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,+BAA+B,CAAC;AACnE,OAAO,kCAAkC,CAAC;AAI1C,OAAO,EAAE,mBAAmB,EAAE,CAAC;AAC/B,YAAY,EAAE,wBAAwB,EAAE,aAAa,EAAE,CAAC;AA+CxD,wBAAgB,QAAQ,CAAC,GAAG,EAAE,MAAM,GAAG,KAAK,CAAC,SAAS,EAAE,CAiCvD;AAED,wBAAgB,KAAK,CAAC,EAAE,IAAI,EAAE,IAAI,EAAE,EAAE;IAAE,IAAI,EAAE,MAAM,CAAC;IAAC,IAAI,CAAC,EAAE,MAAM,CAAA;CAAE,2CAOpE;AAED,wBAAgB,IAAI,CAAC,EAAE,EAAE,EAAE,EAAE;IAAE,EAAE,CAAC,EAAE,MAAM,CAAA;CAAE,2CAoF3C;AAED,MAAM,WAAW,iBAAiB;IAChC,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,mFAAmF;IACnF,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,iEAAiE;IACjE,gBAAgB,CAAC,EAAE,CAAC,GAAG,EAAE,aAAa,KAAK,IAAI,CAAC;IAChD,8EAA8E;IAC9E,eAAe,CAAC,EAAE,CAAC,GAAG,EAAE,aAAa,KAAK,KAAK,CAAC,SAAS,GAAG,IAAI,CAAC;IACjE,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,KAAK,CAAC,EAAE,KAAK,CAAC,aAAa,CAAC;CAC7B;AACD,wBAAgB,YAAY,CAAC,EAAE,QAAQ,EAAE,SAAS,EAAE,gBAAgB,EAAE,eAAe,EAAE,SAAS,EAAE,KAAK,EAAE,EAAE,iBAAiB,2CAe3H"}
|
|
@@ -0,0 +1,129 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { cn as e } from "../lib/utils.js";
|
|
3
|
+
import * as t from "react";
|
|
4
|
+
import { jsx as n, jsxs as r } from "react/jsx-runtime";
|
|
5
|
+
import { GitbookStreamdown as i } from "@brett_lamy/docstream/streamdown";
|
|
6
|
+
import { DocstreamRefContext as a } from "@brett_lamy/docstream/reference";
|
|
7
|
+
import "@brett_lamy/docstream/styles.css";
|
|
8
|
+
//#region src/components/markdown-view.tsx
|
|
9
|
+
function o(e) {
|
|
10
|
+
let t = [], r = 0, i = /(`[^`]+`)|(\*\*[^*]+\*\*)|(\*[^*]+\*)|(~~[^~]+~~)|(\[[^\]]+\]\([^)]+\))/g, a = 0, s;
|
|
11
|
+
for (; s = i.exec(e);) {
|
|
12
|
+
s.index > a && t.push(e.slice(a, s.index));
|
|
13
|
+
let i = s[0];
|
|
14
|
+
if (i[0] === "`") t.push(/* @__PURE__ */ n("code", { children: i.slice(1, -1) }, r++));
|
|
15
|
+
else if (i.startsWith("**")) t.push(/* @__PURE__ */ n("strong", { children: o(i.slice(2, -2)) }, r++));
|
|
16
|
+
else if (i.startsWith("~~")) t.push(/* @__PURE__ */ n("s", { children: i.slice(2, -2) }, r++));
|
|
17
|
+
else if (i[0] === "*") t.push(/* @__PURE__ */ n("em", { children: o(i.slice(1, -1)) }, r++));
|
|
18
|
+
else {
|
|
19
|
+
let e = i.match(/^\[([^\]]+)\]\(([^)]+)\)$/);
|
|
20
|
+
e && t.push(/* @__PURE__ */ n("a", {
|
|
21
|
+
href: e[2],
|
|
22
|
+
target: "_blank",
|
|
23
|
+
rel: "noreferrer",
|
|
24
|
+
children: o(e[1])
|
|
25
|
+
}, r++));
|
|
26
|
+
}
|
|
27
|
+
a = s.index + i.length;
|
|
28
|
+
}
|
|
29
|
+
return a < e.length && t.push(e.slice(a)), t;
|
|
30
|
+
}
|
|
31
|
+
var s = {
|
|
32
|
+
kw: "wb-tok-keyword",
|
|
33
|
+
str: "wb-tok-string",
|
|
34
|
+
num: "wb-tok-number",
|
|
35
|
+
com: "wb-tok-comment",
|
|
36
|
+
fn: "wb-tok-function",
|
|
37
|
+
tag: "wb-tok-constant",
|
|
38
|
+
attr: "wb-tok-type",
|
|
39
|
+
punc: "wb-tok-operator",
|
|
40
|
+
id: "wb-tok-text"
|
|
41
|
+
}, c = new Set("import export from const let var function return if else for while switch case default new class extends super this typeof instanceof in of try catch finally throw await async yield break continue null undefined true false void delete static get set".split(" "));
|
|
42
|
+
function l(e) {
|
|
43
|
+
let t = /(\/\/[^\n]*)|(\/\*[\s\S]*?\*\/)|("(?:[^"\\]|\\.)*"|'(?:[^'\\]|\\.)*'|`(?:[^`\\]|\\.)*`)|(\b\d+(?:\.\d+)?\b)|(<\/?)([A-Za-z][\w.]*)|([A-Za-z_$][\w$]*)|([{}()[\];,.<>=+\-*/!&|?:]+)/g, r = [], i = 0, a, o = 0, l = (e, t) => r.push(t ? /* @__PURE__ */ n("span", {
|
|
44
|
+
className: t,
|
|
45
|
+
children: e
|
|
46
|
+
}, o++) : e);
|
|
47
|
+
for (; a = t.exec(e);) {
|
|
48
|
+
if (a.index > i && l(e.slice(i, a.index)), a[1] || a[2]) l(a[0], s.com);
|
|
49
|
+
else if (a[3]) l(a[0], s.str);
|
|
50
|
+
else if (a[4]) l(a[0], s.num);
|
|
51
|
+
else if (a[5]) l(a[5], s.punc), l(a[6], a[6][0] === a[6][0].toUpperCase() ? s.attr : s.tag);
|
|
52
|
+
else if (a[7]) {
|
|
53
|
+
let n = a[7], r = e.slice(t.lastIndex).match(/^\s*\(/);
|
|
54
|
+
l(n, c.has(n) ? s.kw : r ? s.fn : /^[A-Z]/.test(n) ? s.attr : s.id);
|
|
55
|
+
} else a[8] && l(a[0], s.punc);
|
|
56
|
+
i = t.lastIndex;
|
|
57
|
+
}
|
|
58
|
+
return i < e.length && l(e.slice(i)), r;
|
|
59
|
+
}
|
|
60
|
+
function u({ code: e, lang: t }) {
|
|
61
|
+
let r = t && !/^(jsx?|tsx?|js|ts|javascript|typescript|html|xml|svg)$/i.test(t);
|
|
62
|
+
return /* @__PURE__ */ n("pre", {
|
|
63
|
+
"data-lang": t,
|
|
64
|
+
children: /* @__PURE__ */ n("code", { children: r ? e : l(e) })
|
|
65
|
+
});
|
|
66
|
+
}
|
|
67
|
+
function d({ md: e }) {
|
|
68
|
+
let i = (e || "").split("\n"), a = [], s = 0, c = 0;
|
|
69
|
+
for (; s < i.length;) {
|
|
70
|
+
let e = i[s];
|
|
71
|
+
if (/^```/.test(e)) {
|
|
72
|
+
let t = e.slice(3).trim(), r = [];
|
|
73
|
+
for (s++; s < i.length && !/^```/.test(i[s]);) r.push(i[s++]);
|
|
74
|
+
s++, a.push(/* @__PURE__ */ n(u, {
|
|
75
|
+
code: r.join("\n"),
|
|
76
|
+
lang: t
|
|
77
|
+
}, c++));
|
|
78
|
+
} else if (/^#{1,4} /.test(e)) {
|
|
79
|
+
let n = e.match(/^#+/), r = [
|
|
80
|
+
"h1",
|
|
81
|
+
"h2",
|
|
82
|
+
"h3",
|
|
83
|
+
"h4"
|
|
84
|
+
][(n ? n[0].length : 1) - 1];
|
|
85
|
+
a.push(t.createElement(r, { key: c++ }, o(e.replace(/^#+ /, "")))), s++;
|
|
86
|
+
} else if (/^\s*([-*]|\d+\.) /.test(e)) {
|
|
87
|
+
let r = /^\s*\d+\./.test(e), l = [];
|
|
88
|
+
for (; s < i.length && /^\s*([-*]|\d+\.) /.test(i[s]);) l.push(i[s++].replace(/^\s*([-*]|\d+\.) /, ""));
|
|
89
|
+
a.push(t.createElement(r ? "ol" : "ul", { key: c++ }, l.map((e, t) => /* @__PURE__ */ n("li", { children: o(e) }, t))));
|
|
90
|
+
} else if (/^\|/.test(e)) {
|
|
91
|
+
let e = [];
|
|
92
|
+
for (; s < i.length && /^\|/.test(i[s]);) e.push(i[s++].replace(/^\||\|$/g, "").split("|").map((e) => e.trim()));
|
|
93
|
+
let t = e.filter((e) => !e.every((e) => /^:?-{2,}:?$/.test(e)));
|
|
94
|
+
a.push(/* @__PURE__ */ r("table", { children: [/* @__PURE__ */ n("thead", { children: /* @__PURE__ */ n("tr", { children: t[0].map((e, t) => /* @__PURE__ */ n("th", { children: o(e) }, t)) }) }), /* @__PURE__ */ n("tbody", { children: t.slice(1).map((e, t) => /* @__PURE__ */ n("tr", { children: e.map((e, t) => /* @__PURE__ */ n("td", { children: o(e) }, t)) }, t)) })] }, c++));
|
|
95
|
+
} else if (/^\s*>/.test(e)) {
|
|
96
|
+
let e = [];
|
|
97
|
+
for (; s < i.length && /^\s*>/.test(i[s]);) e.push(i[s++].replace(/^\s*> ?/, ""));
|
|
98
|
+
a.push(/* @__PURE__ */ n("blockquote", { children: e.map((e, t) => /* @__PURE__ */ n("p", { children: o(e) }, t)) }, c++));
|
|
99
|
+
} else if (/^\s*(---|\*\*\*)\s*$/.test(e)) a.push(/* @__PURE__ */ n("hr", {}, c++)), s++;
|
|
100
|
+
else if (!e.trim()) s++;
|
|
101
|
+
else {
|
|
102
|
+
let e = [];
|
|
103
|
+
for (; s < i.length && i[s].trim() && !/^(```|#{1,4} |\||\s*>|\s*([-*]|\d+\.) )/.test(i[s]) && !/^\s*(---|\*\*\*)\s*$/.test(i[s]);) e.push(i[s++]);
|
|
104
|
+
a.push(/* @__PURE__ */ n("p", { children: o(e.join(" ")) }, c++));
|
|
105
|
+
}
|
|
106
|
+
}
|
|
107
|
+
return /* @__PURE__ */ n(t.Fragment, { children: a });
|
|
108
|
+
}
|
|
109
|
+
function f({ markdown: r, streaming: o, onReferenceClick: s, renderReference: c, className: l, style: u }) {
|
|
110
|
+
let d = t.useMemo(() => ({
|
|
111
|
+
...s ? { onReferenceClick: s } : {},
|
|
112
|
+
...c ? { renderReference: c } : {}
|
|
113
|
+
}), [s, c]), f = /* @__PURE__ */ n("div", {
|
|
114
|
+
"data-slot": "markdown-view",
|
|
115
|
+
"data-renderer": "docstream",
|
|
116
|
+
className: e("wb-md", l),
|
|
117
|
+
style: u,
|
|
118
|
+
children: /* @__PURE__ */ n(i, {
|
|
119
|
+
markdown: r ?? "",
|
|
120
|
+
isStreaming: o
|
|
121
|
+
})
|
|
122
|
+
});
|
|
123
|
+
return !s && !c ? f : /* @__PURE__ */ n(a.Provider, {
|
|
124
|
+
value: d,
|
|
125
|
+
children: f
|
|
126
|
+
});
|
|
127
|
+
}
|
|
128
|
+
//#endregion
|
|
129
|
+
export { a as DocstreamRefContext, d as FbMd, u as HlPre, f as MarkdownView, l as hlTokens };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"measure-h.d.ts","sourceRoot":"","sources":["../../src/components/measure-h.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"measure-h.d.ts","sourceRoot":"","sources":["../../src/components/measure-h.tsx"],"names":[],"mappings":"AACA,OAAO,EAA2B,KAAK,SAAS,EAAE,MAAM,OAAO,CAAC;AAEhE,gFAAgF;AAChF,wBAAgB,QAAQ,CAAC,EAAE,GAAG,EAAE,QAAQ,EAAE,EAAE;IAAE,GAAG,EAAE,CAAC,CAAC,EAAE,MAAM,KAAK,IAAI,CAAC;IAAC,QAAQ,CAAC,EAAE,SAAS,CAAA;CAAE,2CAW7F"}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { useLayoutEffect as e, useRef as t } from "react";
|
|
3
|
+
import { jsx as n } from "react/jsx-runtime";
|
|
4
|
+
//#region src/components/measure-h.tsx
|
|
5
|
+
function r({ onH: r, children: i }) {
|
|
6
|
+
let a = t(null);
|
|
7
|
+
return e(() => {
|
|
8
|
+
let e = a.current;
|
|
9
|
+
if (!e || (r(e.offsetHeight), typeof ResizeObserver > "u")) return;
|
|
10
|
+
let t = new ResizeObserver(() => {
|
|
11
|
+
a.current && r(a.current.offsetHeight);
|
|
12
|
+
});
|
|
13
|
+
return t.observe(e), () => t.disconnect();
|
|
14
|
+
}, [i]), /* @__PURE__ */ n("div", {
|
|
15
|
+
ref: a,
|
|
16
|
+
children: i
|
|
17
|
+
});
|
|
18
|
+
}
|
|
19
|
+
//#endregion
|
|
20
|
+
export { r as MeasureH };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"message-scroller.d.ts","sourceRoot":"","sources":["../../src/components/message-scroller.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAW/B,MAAM,WAAW,mBAAmB;IAClC,EAAE,EAAE,MAAM,CAAC;IACX,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,IAAI,EAAE,KAAK,CAAC,SAAS,CAAC;CACvB;AACD,MAAM,WAAW,oBAAoB;IACnC,KAAK,EAAE,mBAAmB,EAAE,CAAC;IAC7B,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,SAAS,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAC1B,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,KAAK,CAAC,EAAE,KAAK,CAAC,aAAa,CAAC;CAC7B;AACD,wBAAgB,eAAe,CAAC,EAAE,KAAK,EAAE,SAAS,EAAE,SAAS,EAAE,IAAI,EAAE,QAAQ,EAAE,SAAS,EAAE,KAAK,EAAE,EAAE,oBAAoB,2CA6QtH"}
|