snice 4.9.0 → 4.10.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/adapters/react/app-tiles.d.ts +28 -0
- package/adapters/react/app-tiles.d.ts.map +1 -0
- package/adapters/react/app-tiles.js +24 -0
- package/adapters/react/app-tiles.js.map +1 -0
- package/adapters/react/app-tiles.tsx +36 -0
- package/adapters/react/book.d.ts +28 -0
- package/adapters/react/book.d.ts.map +1 -0
- package/adapters/react/book.js +24 -0
- package/adapters/react/book.js.map +1 -0
- package/adapters/react/book.tsx +36 -0
- package/adapters/react/comments.d.ts +29 -0
- package/adapters/react/comments.d.ts.map +1 -0
- package/adapters/react/comments.js +24 -0
- package/adapters/react/comments.js.map +1 -0
- package/adapters/react/comments.tsx +37 -0
- package/adapters/react/components.d.ts +52 -0
- package/adapters/react/components.d.ts.map +1 -1
- package/adapters/react/components.js +26 -0
- package/adapters/react/components.js.map +1 -1
- package/adapters/react/components.ts +52 -0
- package/adapters/react/countdown.d.ts +31 -0
- package/adapters/react/countdown.d.ts.map +1 -0
- package/adapters/react/countdown.js +24 -0
- package/adapters/react/countdown.js.map +1 -0
- package/adapters/react/countdown.tsx +39 -0
- package/adapters/react/cropper.d.ts +29 -0
- package/adapters/react/cropper.d.ts.map +1 -0
- package/adapters/react/cropper.js +24 -0
- package/adapters/react/cropper.js.map +1 -0
- package/adapters/react/cropper.tsx +37 -0
- package/adapters/react/diff.d.ts +31 -0
- package/adapters/react/diff.d.ts.map +1 -0
- package/adapters/react/diff.js +24 -0
- package/adapters/react/diff.js.map +1 -0
- package/adapters/react/diff.tsx +39 -0
- package/adapters/react/flip-card.d.ts +28 -0
- package/adapters/react/flip-card.d.ts.map +1 -0
- package/adapters/react/flip-card.js +24 -0
- package/adapters/react/flip-card.js.map +1 -0
- package/adapters/react/flip-card.tsx +36 -0
- package/adapters/react/flow.d.ts +32 -0
- package/adapters/react/flow.d.ts.map +1 -0
- package/adapters/react/flow.js +24 -0
- package/adapters/react/flow.js.map +1 -0
- package/adapters/react/flow.tsx +40 -0
- package/adapters/react/gantt.d.ts +27 -0
- package/adapters/react/gantt.d.ts.map +1 -0
- package/adapters/react/gantt.js +24 -0
- package/adapters/react/gantt.js.map +1 -0
- package/adapters/react/gantt.tsx +35 -0
- package/adapters/react/map.d.ts +30 -0
- package/adapters/react/map.d.ts.map +1 -0
- package/adapters/react/map.js +24 -0
- package/adapters/react/map.js.map +1 -0
- package/adapters/react/map.tsx +38 -0
- package/adapters/react/markdown.d.ts +26 -0
- package/adapters/react/markdown.d.ts.map +1 -0
- package/adapters/react/markdown.js +24 -0
- package/adapters/react/markdown.js.map +1 -0
- package/adapters/react/markdown.tsx +34 -0
- package/adapters/react/notification-center.d.ts +26 -0
- package/adapters/react/notification-center.d.ts.map +1 -0
- package/adapters/react/notification-center.js +24 -0
- package/adapters/react/notification-center.js.map +1 -0
- package/adapters/react/notification-center.tsx +34 -0
- package/adapters/react/org-chart.d.ts +28 -0
- package/adapters/react/org-chart.d.ts.map +1 -0
- package/adapters/react/org-chart.js +24 -0
- package/adapters/react/org-chart.js.map +1 -0
- package/adapters/react/org-chart.tsx +36 -0
- package/adapters/react/pdf-viewer.d.ts +28 -0
- package/adapters/react/pdf-viewer.d.ts.map +1 -0
- package/adapters/react/pdf-viewer.js +24 -0
- package/adapters/react/pdf-viewer.js.map +1 -0
- package/adapters/react/pdf-viewer.tsx +36 -0
- package/adapters/react/podcast-player.d.ts +40 -0
- package/adapters/react/podcast-player.d.ts.map +1 -0
- package/adapters/react/podcast-player.js +24 -0
- package/adapters/react/podcast-player.js.map +1 -0
- package/adapters/react/podcast-player.tsx +48 -0
- package/adapters/react/pricing-table.d.ts +27 -0
- package/adapters/react/pricing-table.d.ts.map +1 -0
- package/adapters/react/pricing-table.js +24 -0
- package/adapters/react/pricing-table.js.map +1 -0
- package/adapters/react/pricing-table.tsx +35 -0
- package/adapters/react/rating.d.ts +30 -0
- package/adapters/react/rating.d.ts.map +1 -0
- package/adapters/react/rating.js +24 -0
- package/adapters/react/rating.js.map +1 -0
- package/adapters/react/rating.tsx +38 -0
- package/adapters/react/recipe.d.ts +43 -0
- package/adapters/react/recipe.d.ts.map +1 -0
- package/adapters/react/recipe.js +24 -0
- package/adapters/react/recipe.js.map +1 -0
- package/adapters/react/recipe.tsx +51 -0
- package/adapters/react/sortable.d.ts +28 -0
- package/adapters/react/sortable.d.ts.map +1 -0
- package/adapters/react/sortable.js +24 -0
- package/adapters/react/sortable.js.map +1 -0
- package/adapters/react/sortable.tsx +36 -0
- package/adapters/react/spotlight.d.ts +27 -0
- package/adapters/react/spotlight.d.ts.map +1 -0
- package/adapters/react/spotlight.js +24 -0
- package/adapters/react/spotlight.js.map +1 -0
- package/adapters/react/spotlight.tsx +35 -0
- package/adapters/react/spreadsheet.d.ts +27 -0
- package/adapters/react/spreadsheet.d.ts.map +1 -0
- package/adapters/react/spreadsheet.js +24 -0
- package/adapters/react/spreadsheet.js.map +1 -0
- package/adapters/react/spreadsheet.tsx +35 -0
- package/adapters/react/tag-input.d.ts +33 -0
- package/adapters/react/tag-input.d.ts.map +1 -0
- package/adapters/react/tag-input.js +24 -0
- package/adapters/react/tag-input.js.map +1 -0
- package/adapters/react/tag-input.tsx +41 -0
- package/adapters/react/testimonial.d.ts +31 -0
- package/adapters/react/testimonial.d.ts.map +1 -0
- package/adapters/react/testimonial.js +24 -0
- package/adapters/react/testimonial.js.map +1 -0
- package/adapters/react/testimonial.tsx +39 -0
- package/adapters/react/video-player.d.ts +34 -0
- package/adapters/react/video-player.d.ts.map +1 -0
- package/adapters/react/video-player.js +24 -0
- package/adapters/react/video-player.js.map +1 -0
- package/adapters/react/video-player.tsx +42 -0
- package/adapters/react/waterfall.d.ts +29 -0
- package/adapters/react/waterfall.d.ts.map +1 -0
- package/adapters/react/waterfall.js +24 -0
- package/adapters/react/waterfall.js.map +1 -0
- package/adapters/react/waterfall.tsx +37 -0
- package/adapters/react/weather.d.ts +27 -0
- package/adapters/react/weather.d.ts.map +1 -0
- package/adapters/react/weather.js +24 -0
- package/adapters/react/weather.js.map +1 -0
- package/adapters/react/weather.tsx +35 -0
- package/dist/cdn/accordion/snice-accordion.js +1 -1
- package/dist/cdn/accordion/snice-accordion.min.js +1 -1
- package/dist/cdn/alert/snice-alert.js +1 -1
- package/dist/cdn/alert/snice-alert.min.js +1 -1
- package/dist/cdn/app-tiles/README.md +27 -0
- package/dist/cdn/app-tiles/snice-app-tiles.js +333 -0
- package/dist/cdn/app-tiles/snice-app-tiles.js.map +1 -0
- package/dist/cdn/app-tiles/snice-app-tiles.min.js +11 -0
- package/dist/cdn/app-tiles/snice-app-tiles.min.js.map +1 -0
- package/dist/cdn/audio-recorder/snice-audio-recorder.js +1 -1
- package/dist/cdn/audio-recorder/snice-audio-recorder.min.js +1 -1
- package/dist/cdn/avatar/snice-avatar.js +1 -1
- package/dist/cdn/avatar/snice-avatar.min.js +1 -1
- package/dist/cdn/badge/snice-badge.js +1 -1
- package/dist/cdn/badge/snice-badge.min.js +1 -1
- package/dist/cdn/banner/snice-banner.js +1 -1
- package/dist/cdn/banner/snice-banner.min.js +1 -1
- package/dist/cdn/book/README.md +27 -0
- package/dist/cdn/book/snice-book.js +353 -0
- package/dist/cdn/book/snice-book.js.map +1 -0
- package/dist/cdn/book/snice-book.min.js +13 -0
- package/dist/cdn/book/snice-book.min.js.map +1 -0
- package/dist/cdn/breadcrumbs/snice-breadcrumbs.js +1 -1
- package/dist/cdn/breadcrumbs/snice-breadcrumbs.min.js +1 -1
- package/dist/cdn/button/snice-button.js +1 -1
- package/dist/cdn/button/snice-button.min.js +1 -1
- package/dist/cdn/calendar/snice-calendar.js +1 -1
- package/dist/cdn/calendar/snice-calendar.min.js +1 -1
- package/dist/cdn/camera/snice-camera.js +1 -1
- package/dist/cdn/camera/snice-camera.min.js +1 -1
- package/dist/cdn/camera-annotate/snice-camera-annotate.js +1 -1
- package/dist/cdn/camera-annotate/snice-camera-annotate.min.js +1 -1
- package/dist/cdn/candlestick/snice-candlestick.js +1 -1
- package/dist/cdn/candlestick/snice-candlestick.min.js +1 -1
- package/dist/cdn/card/snice-card.js +1 -1
- package/dist/cdn/card/snice-card.min.js +1 -1
- package/dist/cdn/carousel/snice-carousel.js +1 -1
- package/dist/cdn/carousel/snice-carousel.min.js +1 -1
- package/dist/cdn/chart/snice-chart.js +1 -1
- package/dist/cdn/chart/snice-chart.min.js +1 -1
- package/dist/cdn/chat/snice-chat.js +1 -1
- package/dist/cdn/chat/snice-chat.min.js +1 -1
- package/dist/cdn/checkbox/snice-checkbox.js +1 -1
- package/dist/cdn/checkbox/snice-checkbox.min.js +1 -1
- package/dist/cdn/chip/snice-chip.js +1 -1
- package/dist/cdn/chip/snice-chip.min.js +1 -1
- package/dist/cdn/code-block/snice-code-block.js +1 -1
- package/dist/cdn/code-block/snice-code-block.min.js +1 -1
- package/dist/cdn/color-display/snice-color-display.js +1 -1
- package/dist/cdn/color-display/snice-color-display.min.js +1 -1
- package/dist/cdn/color-picker/snice-color-picker.js +1 -1
- package/dist/cdn/color-picker/snice-color-picker.min.js +1 -1
- package/dist/cdn/command-palette/snice-command-palette.js +1 -1
- package/dist/cdn/command-palette/snice-command-palette.min.js +1 -1
- package/dist/cdn/comments/README.md +27 -0
- package/dist/cdn/comments/snice-comments.js +544 -0
- package/dist/cdn/comments/snice-comments.js.map +1 -0
- package/dist/cdn/comments/snice-comments.min.js +100 -0
- package/dist/cdn/comments/snice-comments.min.js.map +1 -0
- package/dist/cdn/countdown/README.md +27 -0
- package/dist/cdn/countdown/snice-countdown.js +235 -0
- package/dist/cdn/countdown/snice-countdown.js.map +1 -0
- package/dist/cdn/countdown/snice-countdown.min.js +14 -0
- package/dist/cdn/countdown/snice-countdown.min.js.map +1 -0
- package/dist/cdn/cropper/README.md +27 -0
- package/dist/cdn/cropper/snice-cropper.js +352 -0
- package/dist/cdn/cropper/snice-cropper.js.map +1 -0
- package/dist/cdn/cropper/snice-cropper.min.js +25 -0
- package/dist/cdn/cropper/snice-cropper.min.js.map +1 -0
- package/dist/cdn/date-picker/snice-date-picker.js +1 -1
- package/dist/cdn/date-picker/snice-date-picker.min.js +1 -1
- package/dist/cdn/diff/README.md +27 -0
- package/dist/cdn/diff/snice-diff.js +441 -0
- package/dist/cdn/diff/snice-diff.js.map +1 -0
- package/dist/cdn/diff/snice-diff.min.js +54 -0
- package/dist/cdn/diff/snice-diff.min.js.map +1 -0
- package/dist/cdn/divider/snice-divider.js +1 -1
- package/dist/cdn/divider/snice-divider.min.js +1 -1
- package/dist/cdn/doc/snice-doc.js +1 -1
- package/dist/cdn/doc/snice-doc.min.js +1 -1
- package/dist/cdn/draw/snice-draw.js +1 -1
- package/dist/cdn/draw/snice-draw.min.js +1 -1
- package/dist/cdn/drawer/snice-drawer.js +1 -1
- package/dist/cdn/drawer/snice-drawer.min.js +1 -1
- package/dist/cdn/empty-state/snice-empty-state.js +1 -1
- package/dist/cdn/empty-state/snice-empty-state.min.js +1 -1
- package/dist/cdn/file-gallery/snice-file-gallery.js +1 -1
- package/dist/cdn/file-gallery/snice-file-gallery.min.js +1 -1
- package/dist/cdn/file-upload/snice-file-upload.js +1 -1
- package/dist/cdn/file-upload/snice-file-upload.min.js +1 -1
- package/dist/cdn/flip-card/README.md +27 -0
- package/dist/cdn/flip-card/snice-flip-card.js +183 -0
- package/dist/cdn/flip-card/snice-flip-card.js.map +1 -0
- package/dist/cdn/flip-card/snice-flip-card.min.js +22 -0
- package/dist/cdn/flip-card/snice-flip-card.min.js.map +1 -0
- package/dist/cdn/flow/README.md +27 -0
- package/dist/cdn/flow/snice-flow.js +822 -0
- package/dist/cdn/flow/snice-flow.js.map +1 -0
- package/dist/cdn/flow/snice-flow.min.js +17 -0
- package/dist/cdn/flow/snice-flow.min.js.map +1 -0
- package/dist/cdn/funnel/snice-funnel.js +1 -1
- package/dist/cdn/funnel/snice-funnel.min.js +1 -1
- package/dist/cdn/gantt/README.md +27 -0
- package/dist/cdn/gantt/snice-gantt.js +436 -0
- package/dist/cdn/gantt/snice-gantt.js.map +1 -0
- package/dist/cdn/gantt/snice-gantt.min.js +60 -0
- package/dist/cdn/gantt/snice-gantt.min.js.map +1 -0
- package/dist/cdn/gauge/snice-gauge.js +1 -1
- package/dist/cdn/gauge/snice-gauge.min.js +1 -1
- package/dist/cdn/heatmap/snice-heatmap.js +1 -1
- package/dist/cdn/heatmap/snice-heatmap.min.js +1 -1
- package/dist/cdn/image/snice-image.js +1 -1
- package/dist/cdn/image/snice-image.min.js +1 -1
- package/dist/cdn/input/snice-input.js +1 -1
- package/dist/cdn/input/snice-input.min.js +1 -1
- package/dist/cdn/kanban/snice-kanban.js +1 -1
- package/dist/cdn/kanban/snice-kanban.min.js +1 -1
- package/dist/cdn/kpi/snice-kpi.js +1 -1
- package/dist/cdn/kpi/snice-kpi.min.js +1 -1
- package/dist/cdn/layout/snice-layout.js +1 -1
- package/dist/cdn/layout/snice-layout.min.js +1 -1
- package/dist/cdn/link/snice-link.js +1 -1
- package/dist/cdn/link/snice-link.min.js +1 -1
- package/dist/cdn/link-preview/snice-link-preview.js +1 -1
- package/dist/cdn/link-preview/snice-link-preview.min.js +1 -1
- package/dist/cdn/list/snice-list.js +1 -1
- package/dist/cdn/list/snice-list.min.js +1 -1
- package/dist/cdn/location/snice-location.js +1 -1
- package/dist/cdn/location/snice-location.min.js +1 -1
- package/dist/cdn/login/snice-login.js +1 -1
- package/dist/cdn/login/snice-login.min.js +1 -1
- package/dist/cdn/map/README.md +27 -0
- package/dist/cdn/map/snice-map.js +415 -0
- package/dist/cdn/map/snice-map.js.map +1 -0
- package/dist/cdn/map/snice-map.min.js +52 -0
- package/dist/cdn/map/snice-map.min.js.map +1 -0
- package/dist/cdn/markdown/README.md +27 -0
- package/dist/cdn/markdown/snice-markdown.js +317 -0
- package/dist/cdn/markdown/snice-markdown.js.map +1 -0
- package/dist/cdn/markdown/snice-markdown.min.js +11 -0
- package/dist/cdn/markdown/snice-markdown.min.js.map +1 -0
- package/dist/cdn/masonry/snice-masonry.js +1 -1
- package/dist/cdn/masonry/snice-masonry.min.js +1 -1
- package/dist/cdn/menu/snice-menu.js +1 -1
- package/dist/cdn/menu/snice-menu.min.js +1 -1
- package/dist/cdn/modal/snice-modal.js +1 -1
- package/dist/cdn/modal/snice-modal.min.js +1 -1
- package/dist/cdn/music-player/snice-music-player.js +1 -1
- package/dist/cdn/music-player/snice-music-player.min.js +1 -1
- package/dist/cdn/nav/snice-nav.js +1 -1
- package/dist/cdn/nav/snice-nav.min.js +1 -1
- package/dist/cdn/network-graph/snice-network-graph.js +1 -1
- package/dist/cdn/network-graph/snice-network-graph.min.js +1 -1
- package/dist/cdn/notification-center/README.md +27 -0
- package/dist/cdn/notification-center/snice-notification-center.js +204 -0
- package/dist/cdn/notification-center/snice-notification-center.js.map +1 -0
- package/dist/cdn/notification-center/snice-notification-center.min.js +33 -0
- package/dist/cdn/notification-center/snice-notification-center.min.js.map +1 -0
- package/dist/cdn/org-chart/README.md +27 -0
- package/dist/cdn/org-chart/snice-org-chart.js +294 -0
- package/dist/cdn/org-chart/snice-org-chart.js.map +1 -0
- package/dist/cdn/org-chart/snice-org-chart.min.js +32 -0
- package/dist/cdn/org-chart/snice-org-chart.min.js.map +1 -0
- package/dist/cdn/pagination/snice-pagination.js +1 -1
- package/dist/cdn/pagination/snice-pagination.min.js +1 -1
- package/dist/cdn/paint/snice-paint.js +1 -1
- package/dist/cdn/paint/snice-paint.min.js +1 -1
- package/dist/cdn/pdf-viewer/README.md +27 -0
- package/dist/cdn/pdf-viewer/snice-pdf-viewer.js +594 -0
- package/dist/cdn/pdf-viewer/snice-pdf-viewer.js.map +1 -0
- package/dist/cdn/pdf-viewer/snice-pdf-viewer.min.js +88 -0
- package/dist/cdn/pdf-viewer/snice-pdf-viewer.min.js.map +1 -0
- package/dist/cdn/podcast-player/README.md +27 -0
- package/dist/cdn/podcast-player/snice-podcast-player.js +835 -0
- package/dist/cdn/podcast-player/snice-podcast-player.js.map +1 -0
- package/dist/cdn/podcast-player/snice-podcast-player.min.js +209 -0
- package/dist/cdn/podcast-player/snice-podcast-player.min.js.map +1 -0
- package/dist/cdn/pricing-table/README.md +27 -0
- package/dist/cdn/pricing-table/snice-pricing-table.js +491 -0
- package/dist/cdn/pricing-table/snice-pricing-table.js.map +1 -0
- package/dist/cdn/pricing-table/snice-pricing-table.min.js +141 -0
- package/dist/cdn/pricing-table/snice-pricing-table.min.js.map +1 -0
- package/dist/cdn/progress/snice-progress.js +1 -1
- package/dist/cdn/progress/snice-progress.min.js +1 -1
- package/dist/cdn/qr-code/snice-qr-code.js +1 -1
- package/dist/cdn/qr-code/snice-qr-code.min.js +1 -1
- package/dist/cdn/qr-reader/snice-qr-reader.js +1 -1
- package/dist/cdn/qr-reader/snice-qr-reader.min.js +1 -1
- package/dist/cdn/radio/snice-radio.js +1 -1
- package/dist/cdn/radio/snice-radio.min.js +1 -1
- package/dist/cdn/rating/README.md +27 -0
- package/dist/cdn/rating/snice-rating.js +210 -0
- package/dist/cdn/rating/snice-rating.js.map +1 -0
- package/dist/cdn/rating/snice-rating.min.js +25 -0
- package/dist/cdn/rating/snice-rating.min.js.map +1 -0
- package/dist/cdn/recipe/README.md +27 -0
- package/dist/cdn/recipe/snice-recipe.js +619 -0
- package/dist/cdn/recipe/snice-recipe.js.map +1 -0
- package/dist/cdn/recipe/snice-recipe.min.js +185 -0
- package/dist/cdn/recipe/snice-recipe.min.js.map +1 -0
- package/dist/cdn/runtime/snice-runtime.esm.js +3 -3
- package/dist/cdn/runtime/snice-runtime.esm.js.map +1 -1
- package/dist/cdn/runtime/snice-runtime.esm.min.js +3 -3
- package/dist/cdn/runtime/snice-runtime.esm.min.js.map +1 -1
- package/dist/cdn/runtime/snice-runtime.js +3 -3
- package/dist/cdn/runtime/snice-runtime.js.map +1 -1
- package/dist/cdn/runtime/snice-runtime.min.js +3 -3
- package/dist/cdn/runtime/snice-runtime.min.js.map +1 -1
- package/dist/cdn/sankey/snice-sankey.js +1 -1
- package/dist/cdn/sankey/snice-sankey.min.js +1 -1
- package/dist/cdn/select/snice-select.js +1 -1
- package/dist/cdn/select/snice-select.min.js +1 -1
- package/dist/cdn/skeleton/snice-skeleton.js +1 -1
- package/dist/cdn/skeleton/snice-skeleton.min.js +1 -1
- package/dist/cdn/slider/snice-slider.js +1 -1
- package/dist/cdn/slider/snice-slider.min.js +1 -1
- package/dist/cdn/sortable/README.md +27 -0
- package/dist/cdn/sortable/snice-sortable.js +254 -0
- package/dist/cdn/sortable/snice-sortable.js.map +1 -0
- package/dist/cdn/sortable/snice-sortable.min.js +12 -0
- package/dist/cdn/sortable/snice-sortable.min.js.map +1 -0
- package/dist/cdn/sparkline/snice-sparkline.js +1 -1
- package/dist/cdn/sparkline/snice-sparkline.min.js +1 -1
- package/dist/cdn/spinner/snice-spinner.js +1 -1
- package/dist/cdn/spinner/snice-spinner.min.js +1 -1
- package/dist/cdn/split-pane/snice-split-pane.js +1 -1
- package/dist/cdn/split-pane/snice-split-pane.min.js +1 -1
- package/dist/cdn/spotlight/README.md +27 -0
- package/dist/cdn/spotlight/snice-spotlight.js +397 -0
- package/dist/cdn/spotlight/snice-spotlight.js.map +1 -0
- package/dist/cdn/spotlight/snice-spotlight.min.js +8 -0
- package/dist/cdn/spotlight/snice-spotlight.min.js.map +1 -0
- package/dist/cdn/spreadsheet/README.md +27 -0
- package/dist/cdn/spreadsheet/snice-spreadsheet.js +1171 -0
- package/dist/cdn/spreadsheet/snice-spreadsheet.js.map +1 -0
- package/dist/cdn/spreadsheet/snice-spreadsheet.min.js +30 -0
- package/dist/cdn/spreadsheet/snice-spreadsheet.min.js.map +1 -0
- package/dist/cdn/stepper/snice-stepper.js +1 -1
- package/dist/cdn/stepper/snice-stepper.min.js +1 -1
- package/dist/cdn/switch/snice-switch.js +1 -1
- package/dist/cdn/switch/snice-switch.min.js +1 -1
- package/dist/cdn/table/snice-table.js +1 -1
- package/dist/cdn/table/snice-table.min.js +1 -1
- package/dist/cdn/tabs/snice-tabs.js +1 -1
- package/dist/cdn/tabs/snice-tabs.min.js +1 -1
- package/dist/cdn/tag-input/README.md +27 -0
- package/dist/cdn/tag-input/snice-tag-input.js +387 -0
- package/dist/cdn/tag-input/snice-tag-input.js.map +1 -0
- package/dist/cdn/tag-input/snice-tag-input.min.js +65 -0
- package/dist/cdn/tag-input/snice-tag-input.min.js.map +1 -0
- package/dist/cdn/terminal/snice-terminal.js +1 -1
- package/dist/cdn/terminal/snice-terminal.min.js +1 -1
- package/dist/cdn/testimonial/README.md +27 -0
- package/dist/cdn/testimonial/snice-testimonial.js +187 -0
- package/dist/cdn/testimonial/snice-testimonial.js.map +1 -0
- package/dist/cdn/testimonial/snice-testimonial.min.js +21 -0
- package/dist/cdn/testimonial/snice-testimonial.min.js.map +1 -0
- package/dist/cdn/textarea/snice-textarea.js +1 -1
- package/dist/cdn/textarea/snice-textarea.min.js +1 -1
- package/dist/cdn/time-range-picker/snice-time-range-picker.js +1 -1
- package/dist/cdn/time-range-picker/snice-time-range-picker.min.js +1 -1
- package/dist/cdn/timeline/snice-timeline.js +1 -1
- package/dist/cdn/timeline/snice-timeline.min.js +1 -1
- package/dist/cdn/timer/snice-timer.js +1 -1
- package/dist/cdn/timer/snice-timer.min.js +1 -1
- package/dist/cdn/toast/snice-toast.js +1 -1
- package/dist/cdn/toast/snice-toast.min.js +1 -1
- package/dist/cdn/tooltip/snice-tooltip.js +1 -1
- package/dist/cdn/tooltip/snice-tooltip.min.js +1 -1
- package/dist/cdn/tree/snice-tree.js +1 -1
- package/dist/cdn/tree/snice-tree.min.js +1 -1
- package/dist/cdn/treemap/snice-treemap.js +1 -1
- package/dist/cdn/treemap/snice-treemap.min.js +1 -1
- package/dist/cdn/video-player/README.md +27 -0
- package/dist/cdn/video-player/snice-video-player.js +721 -0
- package/dist/cdn/video-player/snice-video-player.js.map +1 -0
- package/dist/cdn/video-player/snice-video-player.min.js +153 -0
- package/dist/cdn/video-player/snice-video-player.min.js.map +1 -0
- package/dist/cdn/virtual-scroller/snice-virtual-scroller.js +1 -1
- package/dist/cdn/virtual-scroller/snice-virtual-scroller.min.js +1 -1
- package/dist/cdn/waterfall/README.md +27 -0
- package/dist/cdn/waterfall/snice-waterfall.js +292 -0
- package/dist/cdn/waterfall/snice-waterfall.js.map +1 -0
- package/dist/cdn/waterfall/snice-waterfall.min.js +12 -0
- package/dist/cdn/waterfall/snice-waterfall.min.js.map +1 -0
- package/dist/cdn/weather/README.md +27 -0
- package/dist/cdn/weather/snice-weather.js +194 -0
- package/dist/cdn/weather/snice-weather.js.map +1 -0
- package/dist/cdn/weather/snice-weather.min.js +42 -0
- package/dist/cdn/weather/snice-weather.min.js.map +1 -0
- package/dist/components/app-tiles/snice-app-tiles.d.ts +36 -0
- package/dist/components/app-tiles/snice-app-tiles.js +265 -0
- package/dist/components/app-tiles/snice-app-tiles.js.map +1 -0
- package/dist/components/app-tiles/snice-app-tiles.types.d.ts +22 -0
- package/dist/components/book/snice-book.d.ts +46 -0
- package/dist/components/book/snice-book.js +285 -0
- package/dist/components/book/snice-book.js.map +1 -0
- package/dist/components/book/snice-book.types.d.ts +21 -0
- package/dist/components/comments/snice-comments.d.ts +62 -0
- package/dist/components/comments/snice-comments.js +476 -0
- package/dist/components/comments/snice-comments.js.map +1 -0
- package/dist/components/comments/snice-comments.types.d.ts +64 -0
- package/dist/components/countdown/snice-countdown.d.ts +21 -0
- package/dist/components/countdown/snice-countdown.js +168 -0
- package/dist/components/countdown/snice-countdown.js.map +1 -0
- package/dist/components/countdown/snice-countdown.types.d.ts +18 -0
- package/dist/components/cropper/snice-cropper.d.ts +32 -0
- package/dist/components/cropper/snice-cropper.js +285 -0
- package/dist/components/cropper/snice-cropper.js.map +1 -0
- package/dist/components/cropper/snice-cropper.types.d.ts +26 -0
- package/dist/components/diff/snice-diff.d.ts +32 -0
- package/dist/components/diff/snice-diff.js +374 -0
- package/dist/components/diff/snice-diff.js.map +1 -0
- package/dist/components/diff/snice-diff.types.d.ts +26 -0
- package/dist/components/flip-card/snice-flip-card.d.ts +15 -0
- package/dist/components/flip-card/snice-flip-card.js +116 -0
- package/dist/components/flip-card/snice-flip-card.js.map +1 -0
- package/dist/components/flip-card/snice-flip-card.types.d.ts +16 -0
- package/dist/components/flow/snice-flow.d.ts +91 -0
- package/dist/components/flow/snice-flow.js +755 -0
- package/dist/components/flow/snice-flow.js.map +1 -0
- package/dist/components/flow/snice-flow.types.d.ts +64 -0
- package/dist/components/gantt/snice-gantt.d.ts +34 -0
- package/dist/components/gantt/snice-gantt.js +369 -0
- package/dist/components/gantt/snice-gantt.js.map +1 -0
- package/dist/components/gantt/snice-gantt.types.d.ts +37 -0
- package/dist/components/map/snice-map.d.ts +44 -0
- package/dist/components/map/snice-map.js +348 -0
- package/dist/components/map/snice-map.js.map +1 -0
- package/dist/components/map/snice-map.types.d.ts +41 -0
- package/dist/components/markdown/snice-markdown.d.ts +24 -0
- package/dist/components/markdown/snice-markdown.js +250 -0
- package/dist/components/markdown/snice-markdown.js.map +1 -0
- package/dist/components/markdown/snice-markdown.types.d.ts +16 -0
- package/dist/components/notification-center/snice-notification-center.d.ts +18 -0
- package/dist/components/notification-center/snice-notification-center.js +137 -0
- package/dist/components/notification-center/snice-notification-center.js.map +1 -0
- package/dist/components/notification-center/snice-notification-center.types.d.ts +24 -0
- package/dist/components/org-chart/snice-org-chart.d.ts +28 -0
- package/dist/components/org-chart/snice-org-chart.js +227 -0
- package/dist/components/org-chart/snice-org-chart.js.map +1 -0
- package/dist/components/org-chart/snice-org-chart.types.d.ts +28 -0
- package/dist/components/pdf-viewer/pdf.min.mjs +21 -0
- package/dist/components/pdf-viewer/pdf.worker.min.mjs +21 -0
- package/dist/components/pdf-viewer/snice-pdf-viewer.d.ts +59 -0
- package/dist/components/pdf-viewer/snice-pdf-viewer.js +527 -0
- package/dist/components/pdf-viewer/snice-pdf-viewer.js.map +1 -0
- package/dist/components/pdf-viewer/snice-pdf-viewer.types.d.ts +25 -0
- package/dist/components/podcast-player/snice-podcast-player.d.ts +72 -0
- package/dist/components/podcast-player/snice-podcast-player.js +768 -0
- package/dist/components/podcast-player/snice-podcast-player.js.map +1 -0
- package/dist/components/podcast-player/snice-podcast-player.types.d.ts +79 -0
- package/dist/components/pricing-table/snice-pricing-table.d.ts +51 -0
- package/dist/components/pricing-table/snice-pricing-table.js +422 -0
- package/dist/components/pricing-table/snice-pricing-table.js.map +1 -0
- package/dist/components/pricing-table/snice-pricing-table.types.d.ts +49 -0
- package/dist/components/rating/snice-rating.d.ts +15 -0
- package/dist/components/rating/snice-rating.js +143 -0
- package/dist/components/rating/snice-rating.js.map +1 -0
- package/dist/components/rating/snice-rating.types.d.ts +15 -0
- package/dist/components/recipe/snice-recipe.d.ts +53 -0
- package/dist/components/recipe/snice-recipe.js +552 -0
- package/dist/components/recipe/snice-recipe.js.map +1 -0
- package/dist/components/recipe/snice-recipe.types.d.ts +56 -0
- package/dist/components/sortable/snice-sortable.d.ts +24 -0
- package/dist/components/sortable/snice-sortable.js +187 -0
- package/dist/components/sortable/snice-sortable.js.map +1 -0
- package/dist/components/sortable/snice-sortable.types.d.ts +20 -0
- package/dist/components/spotlight/snice-spotlight.d.ts +42 -0
- package/dist/components/spotlight/snice-spotlight.js +330 -0
- package/dist/components/spotlight/snice-spotlight.js.map +1 -0
- package/dist/components/spotlight/snice-spotlight.types.d.ts +26 -0
- package/dist/components/spreadsheet/snice-spreadsheet.d.ts +102 -0
- package/dist/components/spreadsheet/snice-spreadsheet.js +1104 -0
- package/dist/components/spreadsheet/snice-spreadsheet.js.map +1 -0
- package/dist/components/spreadsheet/snice-spreadsheet.types.d.ts +54 -0
- package/dist/components/tag-input/snice-tag-input.d.ts +40 -0
- package/dist/components/tag-input/snice-tag-input.js +320 -0
- package/dist/components/tag-input/snice-tag-input.js.map +1 -0
- package/dist/components/tag-input/snice-tag-input.types.d.ts +29 -0
- package/dist/components/testimonial/snice-testimonial.d.ts +15 -0
- package/dist/components/testimonial/snice-testimonial.js +120 -0
- package/dist/components/testimonial/snice-testimonial.js.map +1 -0
- package/dist/components/testimonial/snice-testimonial.types.d.ts +10 -0
- package/dist/components/video-player/snice-video-player.d.ts +78 -0
- package/dist/components/video-player/snice-video-player.js +654 -0
- package/dist/components/video-player/snice-video-player.js.map +1 -0
- package/dist/components/video-player/snice-video-player.types.d.ts +47 -0
- package/dist/components/waterfall/snice-waterfall.d.ts +30 -0
- package/dist/components/waterfall/snice-waterfall.js +225 -0
- package/dist/components/waterfall/snice-waterfall.js.map +1 -0
- package/dist/components/waterfall/snice-waterfall.types.d.ts +23 -0
- package/dist/components/weather/snice-weather.d.ts +10 -0
- package/dist/components/weather/snice-weather.js +127 -0
- package/dist/components/weather/snice-weather.js.map +1 -0
- package/dist/components/weather/snice-weather.types.d.ts +22 -0
- package/dist/index.cjs +1 -1
- package/dist/index.esm.js +1 -1
- package/dist/index.iife.js +1 -1
- package/dist/symbols.cjs +1 -1
- package/dist/symbols.esm.js +1 -1
- package/dist/transitions.cjs +1 -1
- package/dist/transitions.esm.js +1 -1
- package/docs/ai/DEVELOPMENT.md +1 -1
- package/docs/ai/api.md +6 -3
- package/docs/ai/components/accordion.md +0 -34
- package/docs/ai/components/app-tiles.md +77 -0
- package/docs/ai/components/audio-recorder.md +2 -0
- package/docs/ai/components/badge.md +7 -0
- package/docs/ai/components/book.md +78 -0
- package/docs/ai/components/button.md +5 -0
- package/docs/ai/components/chart.md +0 -24
- package/docs/ai/components/chat.md +7 -95
- package/docs/ai/components/code-block.md +3 -82
- package/docs/ai/components/color-display.md +3 -3
- package/docs/ai/components/color-picker.md +4 -4
- package/docs/ai/components/comments.md +75 -0
- package/docs/ai/components/countdown.md +54 -0
- package/docs/ai/components/cropper.md +57 -0
- package/docs/ai/components/date-picker.md +15 -9
- package/docs/ai/components/diff.md +66 -0
- package/docs/ai/components/divider.md +1 -1
- package/docs/ai/components/draw.md +5 -5
- package/docs/ai/components/drawer.md +5 -5
- package/docs/ai/components/empty-state.md +2 -2
- package/docs/ai/components/file-gallery.md +16 -87
- package/docs/ai/components/file-upload.md +6 -6
- package/docs/ai/components/flip-card.md +52 -0
- package/docs/ai/components/flow.md +104 -0
- package/docs/ai/components/funnel.md +3 -3
- package/docs/ai/components/gantt.md +63 -0
- package/docs/ai/components/gauge.md +1 -1
- package/docs/ai/components/heatmap.md +5 -5
- package/docs/ai/components/input.md +20 -18
- package/docs/ai/components/kanban.md +2 -2
- package/docs/ai/components/kpi.md +4 -53
- package/docs/ai/components/layout.md +10 -235
- package/docs/ai/components/link-preview.md +20 -29
- package/docs/ai/components/link.md +27 -47
- package/docs/ai/components/list.md +51 -31
- package/docs/ai/components/location.md +15 -27
- package/docs/ai/components/login.md +43 -94
- package/docs/ai/components/map.md +72 -0
- package/docs/ai/components/markdown.md +63 -0
- package/docs/ai/components/masonry.md +10 -6
- package/docs/ai/components/menu.md +40 -72
- package/docs/ai/components/modal.md +25 -42
- package/docs/ai/components/music-player.md +37 -89
- package/docs/ai/components/nav.md +25 -39
- package/docs/ai/components/network-graph.md +39 -43
- package/docs/ai/components/notification-center.md +79 -0
- package/docs/ai/components/org-chart.md +62 -0
- package/docs/ai/components/pagination.md +16 -18
- package/docs/ai/components/pdf-viewer.md +57 -0
- package/docs/ai/components/podcast-player.md +94 -0
- package/docs/ai/components/pricing-table.md +87 -0
- package/docs/ai/components/progress.md +23 -39
- package/docs/ai/components/qr-code.md +37 -84
- package/docs/ai/components/qr-reader.md +51 -61
- package/docs/ai/components/radio.md +27 -39
- package/docs/ai/components/rating.md +56 -0
- package/docs/ai/components/recipe.md +90 -0
- package/docs/ai/components/skeleton.md +0 -8
- package/docs/ai/components/slider.md +10 -50
- package/docs/ai/components/sortable.md +57 -0
- package/docs/ai/components/sparkline.md +26 -152
- package/docs/ai/components/spinner.md +0 -21
- package/docs/ai/components/split-pane.md +16 -38
- package/docs/ai/components/spotlight.md +61 -0
- package/docs/ai/components/spreadsheet.md +138 -0
- package/docs/ai/components/stepper.md +37 -183
- package/docs/ai/components/switch.md +28 -35
- package/docs/ai/components/table.md +43 -172
- package/docs/ai/components/tabs.md +31 -52
- package/docs/ai/components/tag-input.md +70 -0
- package/docs/ai/components/terminal.md +34 -116
- package/docs/ai/components/testimonial.md +56 -0
- package/docs/ai/components/textarea.md +11 -43
- package/docs/ai/components/theme.md +120 -0
- package/docs/ai/components/time-range-picker.md +17 -49
- package/docs/ai/components/timeline.md +7 -46
- package/docs/ai/components/timer.md +41 -37
- package/docs/ai/components/toast.md +19 -90
- package/docs/ai/components/tooltip.md +17 -104
- package/docs/ai/components/tree.md +38 -162
- package/docs/ai/components/treemap.md +23 -44
- package/docs/ai/components/video-player.md +91 -0
- package/docs/ai/components/virtual-scroller.md +23 -46
- package/docs/ai/components/waterfall.md +56 -0
- package/docs/ai/components/weather.md +78 -0
- package/docs/ai/decorators.md +25 -3
- package/docs/ai/patterns.md +17 -1
- package/docs/components/accordion.md +8 -6
- package/docs/components/alert.md +2 -0
- package/docs/components/app-tiles.md +162 -0
- package/docs/components/audio-recorder.md +6 -0
- package/docs/components/avatar.md +225 -0
- package/docs/components/badge.md +2 -0
- package/docs/components/banner.md +2 -0
- package/docs/components/book.md +184 -0
- package/docs/components/breadcrumbs.md +2 -0
- package/docs/components/button.md +15 -0
- package/docs/components/calendar.md +2 -0
- package/docs/components/camera-annotate.md +2 -0
- package/docs/components/camera.md +2 -0
- package/docs/components/candlestick.md +2 -0
- package/docs/components/card.md +2 -0
- package/docs/components/carousel.md +205 -36
- package/docs/components/chart.md +2 -0
- package/docs/components/chat.md +2 -0
- package/docs/components/checkbox.md +2 -0
- package/docs/components/chip.md +2 -0
- package/docs/components/code-block.md +2 -0
- package/docs/components/color-display.md +2 -0
- package/docs/components/color-picker.md +6 -4
- package/docs/components/command-palette.md +2 -0
- package/docs/components/comments.md +235 -0
- package/docs/components/countdown.md +121 -0
- package/docs/components/cropper.md +152 -0
- package/docs/components/date-picker.md +201 -0
- package/docs/components/diff.md +177 -0
- package/docs/components/divider.md +132 -0
- package/docs/components/doc.md +2 -0
- package/docs/components/draw.md +2 -0
- package/docs/components/drawer.md +2 -0
- package/docs/components/empty-state.md +2 -0
- package/docs/components/file-gallery.md +2 -0
- package/docs/components/file-upload.md +2 -0
- package/docs/components/flip-card.md +169 -0
- package/docs/components/flow.md +208 -0
- package/docs/components/funnel.md +2 -0
- package/docs/components/gantt.md +187 -0
- package/docs/components/gauge.md +2 -0
- package/docs/components/heatmap.md +2 -0
- package/docs/components/image.md +2 -0
- package/docs/components/input.md +242 -0
- package/docs/components/kanban.md +2 -0
- package/docs/components/kpi.md +2 -0
- package/docs/components/layout.md +84 -0
- package/docs/components/link-preview.md +66 -92
- package/docs/components/link.md +73 -157
- package/docs/components/list.md +140 -44
- package/docs/components/location.md +96 -283
- package/docs/components/login.md +131 -498
- package/docs/components/map.md +203 -0
- package/docs/components/markdown.md +220 -0
- package/docs/components/masonry.md +57 -102
- package/docs/components/menu.md +87 -494
- package/docs/components/modal.md +83 -436
- package/docs/components/music-player.md +116 -221
- package/docs/components/nav.md +107 -170
- package/docs/components/network-graph.md +83 -111
- package/docs/components/notification-center.md +256 -0
- package/docs/components/org-chart.md +275 -0
- package/docs/components/pagination.md +75 -218
- package/docs/components/paint.md +108 -73
- package/docs/components/pdf-viewer.md +204 -0
- package/docs/components/podcast-player.md +277 -0
- package/docs/components/pricing-table.md +249 -0
- package/docs/components/progress.md +169 -0
- package/docs/components/qr-code.md +95 -378
- package/docs/components/qr-reader.md +83 -258
- package/docs/components/radio.md +151 -0
- package/docs/components/rating.md +154 -0
- package/docs/components/recipe.md +323 -0
- package/docs/components/sankey.md +84 -107
- package/docs/components/select.md +114 -485
- package/docs/components/skeleton.md +96 -0
- package/docs/components/slider.md +92 -235
- package/docs/components/sortable.md +267 -0
- package/docs/components/sparkline.md +76 -222
- package/docs/components/spinner.md +37 -18
- package/docs/components/split-pane.md +62 -226
- package/docs/components/spotlight.md +240 -0
- package/docs/components/spreadsheet.md +405 -0
- package/docs/components/stepper.md +72 -306
- package/docs/components/switch.md +69 -293
- package/docs/components/table.md +250 -0
- package/docs/components/tabs.md +92 -471
- package/docs/components/tag-input.md +257 -0
- package/docs/components/terminal.md +87 -391
- package/docs/components/testimonial.md +185 -0
- package/docs/components/textarea.md +96 -181
- package/docs/components/theme.md +216 -0
- package/docs/components/time-range-picker.md +99 -151
- package/docs/components/timeline.md +67 -115
- package/docs/components/timer.md +44 -86
- package/docs/components/toast.md +93 -432
- package/docs/components/tooltip.md +75 -419
- package/docs/components/tree.md +110 -436
- package/docs/components/treemap.md +86 -129
- package/docs/components/video-player.md +336 -0
- package/docs/components/virtual-scroller.md +86 -226
- package/docs/components/waterfall.md +217 -0
- package/docs/components/weather.md +239 -0
- package/package.json +1 -1
- package/docs/ai/components/popover.md +0 -70
- package/docs/components/popover.md +0 -333
|
@@ -0,0 +1,822 @@
|
|
|
1
|
+
/*!
|
|
2
|
+
* snice v4.9.0
|
|
3
|
+
* Imperative TypeScript framework for building vanilla web components with decorators, differential rendering, routing, and controllers. No virtual DOM, no build complexity.
|
|
4
|
+
* (c) 2024
|
|
5
|
+
* Released under the MIT License.
|
|
6
|
+
*/
|
|
7
|
+
if(typeof globalThis.Snice==="undefined"){console.warn("[snice] snice-runtime.min.js must be loaded before snice-flow.min.js");}
|
|
8
|
+
var SniceFlow = (function (exports, snice) {
|
|
9
|
+
'use strict';
|
|
10
|
+
|
|
11
|
+
/******************************************************************************
|
|
12
|
+
Copyright (c) Microsoft Corporation.
|
|
13
|
+
|
|
14
|
+
Permission to use, copy, modify, and/or distribute this software for any
|
|
15
|
+
purpose with or without fee is hereby granted.
|
|
16
|
+
|
|
17
|
+
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
|
|
18
|
+
REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
|
|
19
|
+
AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
|
|
20
|
+
INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
|
|
21
|
+
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
|
|
22
|
+
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
|
|
23
|
+
PERFORMANCE OF THIS SOFTWARE.
|
|
24
|
+
***************************************************************************** */
|
|
25
|
+
/* global Reflect, Promise, SuppressedError, Symbol, Iterator */
|
|
26
|
+
|
|
27
|
+
|
|
28
|
+
function __esDecorate(ctor, descriptorIn, decorators, contextIn, initializers, extraInitializers) {
|
|
29
|
+
function accept(f) { if (f !== void 0 && typeof f !== "function") throw new TypeError("Function expected"); return f; }
|
|
30
|
+
var kind = contextIn.kind, key = kind === "getter" ? "get" : kind === "setter" ? "set" : "value";
|
|
31
|
+
var target = !descriptorIn && ctor ? contextIn["static"] ? ctor : ctor.prototype : null;
|
|
32
|
+
var descriptor = descriptorIn || (target ? Object.getOwnPropertyDescriptor(target, contextIn.name) : {});
|
|
33
|
+
var _, done = false;
|
|
34
|
+
for (var i = decorators.length - 1; i >= 0; i--) {
|
|
35
|
+
var context = {};
|
|
36
|
+
for (var p in contextIn) context[p] = p === "access" ? {} : contextIn[p];
|
|
37
|
+
for (var p in contextIn.access) context.access[p] = contextIn.access[p];
|
|
38
|
+
context.addInitializer = function (f) { if (done) throw new TypeError("Cannot add initializers after decoration has completed"); extraInitializers.push(accept(f || null)); };
|
|
39
|
+
var result = (0, decorators[i])(kind === "accessor" ? { get: descriptor.get, set: descriptor.set } : descriptor[key], context);
|
|
40
|
+
if (kind === "accessor") {
|
|
41
|
+
if (result === void 0) continue;
|
|
42
|
+
if (result === null || typeof result !== "object") throw new TypeError("Object expected");
|
|
43
|
+
if (_ = accept(result.get)) descriptor.get = _;
|
|
44
|
+
if (_ = accept(result.set)) descriptor.set = _;
|
|
45
|
+
if (_ = accept(result.init)) initializers.unshift(_);
|
|
46
|
+
}
|
|
47
|
+
else if (_ = accept(result)) {
|
|
48
|
+
if (kind === "field") initializers.unshift(_);
|
|
49
|
+
else descriptor[key] = _;
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
if (target) Object.defineProperty(target, contextIn.name, descriptor);
|
|
53
|
+
done = true;
|
|
54
|
+
}
|
|
55
|
+
function __runInitializers(thisArg, initializers, value) {
|
|
56
|
+
var useValue = arguments.length > 2;
|
|
57
|
+
for (var i = 0; i < initializers.length; i++) {
|
|
58
|
+
value = useValue ? initializers[i].call(thisArg, value) : initializers[i].call(thisArg);
|
|
59
|
+
}
|
|
60
|
+
return useValue ? value : void 0;
|
|
61
|
+
}
|
|
62
|
+
typeof SuppressedError === "function" ? SuppressedError : function (error, suppressed, message) {
|
|
63
|
+
var e = new Error(message);
|
|
64
|
+
return e.name = "SuppressedError", e.error = error, e.suppressed = suppressed, e;
|
|
65
|
+
};
|
|
66
|
+
|
|
67
|
+
var cssContent = ":host{display:block;font-family:var(--snice-font-family, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif);contain:layout style paint;width:100%}.flow{position:relative;width:100%;height:100%;min-height:25rem;overflow:hidden;background:var(--snice-color-background,rgb(255 255 255));border:1px solid var(--snice-color-border,rgb(226 226 226));border-radius:4px}.flow__grid{position:absolute;inset:0;pointer-events:none}.flow__svg{display:block;width:100%;height:100%;cursor:grab;position:absolute;inset:0}.flow__svg:active{cursor:grabbing}.flow__edge{fill:none;stroke:var(--snice-color-border,rgb(226 226 226));stroke-width:2px;cursor:pointer;transition:stroke var(--snice-transition-fast, 150ms) ease}.flow__edge:hover{stroke:var(--snice-color-primary,rgb(37 99 235));stroke-width:3px}.flow__edge--selected{stroke:var(--snice-color-primary,rgb(37 99 235));stroke-width:2px}.flow__edge--animated{stroke-dasharray:5 5;animation:.5s linear infinite flow-dash}@keyframes flow-dash{to{stroke-dashoffset:-10}}.flow__edge-label{font-size:.6875rem;fill:var(--snice-color-text-secondary,rgb(82 82 82));text-anchor:middle;pointer-events:none;dominant-baseline:central}.flow__arrow{fill:var(--snice-color-border,rgb(226 226 226))}.flow__edge-preview{fill:none;stroke:var(--snice-color-primary,rgb(37 99 235));stroke-width:2px;stroke-dasharray:6 3;pointer-events:none}.flow__nodes{position:absolute;inset:0;pointer-events:none}.flow__node{position:absolute;pointer-events:auto;background:var(--snice-color-background-element,rgb(252 251 249));border:1px solid var(--snice-color-border,rgb(226 226 226));border-radius:4px;min-width:8.75rem;box-shadow:var(--snice-shadow-sm,0 1px 3px 0 rgb(0 0 0 / .1),0 1px 2px -1px rgb(0 0 0 / .1));user-select:none;cursor:grab;transition:box-shadow var(--snice-transition-fast, 150ms) ease,border-color var(--snice-transition-fast, 150ms) ease}.flow__node:hover{box-shadow:var(--snice-shadow-md,0 4px 6px -1px rgb(0 0 0 / .1),0 2px 4px -2px rgb(0 0 0 / .1))}.flow__node--selected{border-color:var(--snice-color-primary,rgb(37 99 235));box-shadow:0 0 0 2px var(--snice-focus-ring-color,rgb(59 130 246 / .5))}.flow__node--dragging{cursor:grabbing;z-index:10;box-shadow:var(--snice-shadow-lg,0 10px 15px -3px rgb(0 0 0 / .1),0 4px 6px -4px rgb(0 0 0 / .1))}.flow__node-header{padding:var(--snice-spacing-2xs,.25rem) var(--snice-spacing-xs,.5rem);border-bottom:1px solid var(--snice-color-border,rgb(226 226 226));font-size:.75rem;font-weight:var(--snice-font-weight-semibold,600);color:var(--snice-color-text,rgb(23 23 23));border-radius:3px 3px 0 0;display:flex;align-items:center;gap:var(--snice-spacing-2xs,.25rem)}.flow__node-type{font-size:.625rem;color:var(--snice-color-text-tertiary,rgb(115 115 115));font-weight:var(--snice-font-weight-medium,500);text-transform:uppercase;letter-spacing:.05em}.flow__node-body{padding:var(--snice-spacing-2xs,.25rem) 0;display:flex;justify-content:space-between;gap:var(--snice-spacing-xs,.5rem)}.flow__node-inputs,.flow__node-outputs{display:flex;flex-direction:column;gap:var(--snice-spacing-3xs,.125rem)}.flow__node-outputs{align-items:flex-end}.flow__port{display:flex;align-items:center;gap:var(--snice-spacing-2xs,.25rem);padding:var(--snice-spacing-3xs,.125rem) var(--snice-spacing-xs,.5rem);font-size:.6875rem;color:var(--snice-color-text-secondary,rgb(82 82 82));cursor:crosshair;position:relative}.flow__port-dot{width:.625rem;height:.625rem;border-radius:50%;background:var(--snice-color-border,rgb(226 226 226));border:2px solid var(--snice-color-background,rgb(255 255 255));box-shadow:0 0 0 1px var(--snice-color-border,rgb(226 226 226));transition:background var(--snice-transition-fast, 150ms) ease,transform var(--snice-transition-fast, 150ms) ease;flex-shrink:0}.flow__port:hover .flow__port-dot{background:var(--snice-color-primary,rgb(37 99 235));transform:scale(1.3);box-shadow:0 0 0 1px var(--snice-color-primary,rgb(37 99 235))}.flow__port--connected .flow__port-dot{background:var(--snice-color-primary,rgb(37 99 235));box-shadow:0 0 0 1px var(--snice-color-primary,rgb(37 99 235))}.flow__port--output{flex-direction:row-reverse}.flow__minimap{position:absolute;bottom:var(--snice-spacing-xs,.5rem);right:var(--snice-spacing-xs,.5rem);width:9.375rem;height:6.25rem;background:var(--snice-color-background,rgb(255 255 255));border:1px solid var(--snice-color-border,rgb(226 226 226));border-radius:4px;overflow:hidden;box-shadow:var(--snice-shadow-sm,0 1px 3px 0 rgb(0 0 0 / .1),0 1px 2px -1px rgb(0 0 0 / .1));opacity:.9;z-index:20}.flow__minimap-svg{display:block;width:100%;height:100%}.flow__minimap-node{fill:var(--snice-color-primary,rgb(37 99 235));opacity:.6}.flow__minimap-edge{stroke:var(--snice-color-border,rgb(226 226 226));stroke-width:1px;fill:none}.flow__minimap-viewport{fill:var(--snice-color-primary,rgb(37 99 235));fill-opacity:0.08;stroke:var(--snice-color-primary,rgb(37 99 235));stroke-width:1px}";
|
|
68
|
+
|
|
69
|
+
const DEFAULT_NODE_WIDTH = 160;
|
|
70
|
+
const DEFAULT_NODE_HEIGHT = 80;
|
|
71
|
+
let SniceFlow = (() => {
|
|
72
|
+
let _classDecorators = [snice.element('snice-flow')];
|
|
73
|
+
let _classDescriptor;
|
|
74
|
+
let _classExtraInitializers = [];
|
|
75
|
+
let _classThis;
|
|
76
|
+
let _classSuper = HTMLElement;
|
|
77
|
+
let _instanceExtraInitializers = [];
|
|
78
|
+
let _nodes_decorators;
|
|
79
|
+
let _nodes_initializers = [];
|
|
80
|
+
let _nodes_extraInitializers = [];
|
|
81
|
+
let _edges_decorators;
|
|
82
|
+
let _edges_initializers = [];
|
|
83
|
+
let _edges_extraInitializers = [];
|
|
84
|
+
let _snapToGrid_decorators;
|
|
85
|
+
let _snapToGrid_initializers = [];
|
|
86
|
+
let _snapToGrid_extraInitializers = [];
|
|
87
|
+
let _gridSize_decorators;
|
|
88
|
+
let _gridSize_initializers = [];
|
|
89
|
+
let _gridSize_extraInitializers = [];
|
|
90
|
+
let _zoomEnabled_decorators;
|
|
91
|
+
let _zoomEnabled_initializers = [];
|
|
92
|
+
let _zoomEnabled_extraInitializers = [];
|
|
93
|
+
let _panEnabled_decorators;
|
|
94
|
+
let _panEnabled_initializers = [];
|
|
95
|
+
let _panEnabled_extraInitializers = [];
|
|
96
|
+
let _minimap_decorators;
|
|
97
|
+
let _minimap_initializers = [];
|
|
98
|
+
let _minimap_extraInitializers = [];
|
|
99
|
+
let _editable_decorators;
|
|
100
|
+
let _editable_initializers = [];
|
|
101
|
+
let _editable_extraInitializers = [];
|
|
102
|
+
let _containerEl_decorators;
|
|
103
|
+
let _containerEl_initializers = [];
|
|
104
|
+
let _containerEl_extraInitializers = [];
|
|
105
|
+
let _svgEl_decorators;
|
|
106
|
+
let _svgEl_initializers = [];
|
|
107
|
+
let _svgEl_extraInitializers = [];
|
|
108
|
+
let _nodesContainerEl_decorators;
|
|
109
|
+
let _nodesContainerEl_initializers = [];
|
|
110
|
+
let _nodesContainerEl_extraInitializers = [];
|
|
111
|
+
let _minimapSvgEl_decorators;
|
|
112
|
+
let _minimapSvgEl_initializers = [];
|
|
113
|
+
let _minimapSvgEl_extraInitializers = [];
|
|
114
|
+
let _emitNodeDrag_decorators;
|
|
115
|
+
let _emitNodeSelect_decorators;
|
|
116
|
+
let _emitEdgeConnect_decorators;
|
|
117
|
+
let _emitEdgeDisconnect_decorators;
|
|
118
|
+
let _emitCanvasClick_decorators;
|
|
119
|
+
let _init_decorators;
|
|
120
|
+
let _onNodesChange_decorators;
|
|
121
|
+
let _onEdgesChange_decorators;
|
|
122
|
+
let _onMinimapChange_decorators;
|
|
123
|
+
let _cleanup_decorators;
|
|
124
|
+
let _renderContent_decorators;
|
|
125
|
+
let _componentStyles_decorators;
|
|
126
|
+
(class extends _classSuper {
|
|
127
|
+
static { _classThis = this; }
|
|
128
|
+
constructor() {
|
|
129
|
+
super(...arguments);
|
|
130
|
+
this.nodes = (__runInitializers(this, _instanceExtraInitializers), __runInitializers(this, _nodes_initializers, []));
|
|
131
|
+
this.edges = (__runInitializers(this, _nodes_extraInitializers), __runInitializers(this, _edges_initializers, []));
|
|
132
|
+
this.snapToGrid = (__runInitializers(this, _edges_extraInitializers), __runInitializers(this, _snapToGrid_initializers, true));
|
|
133
|
+
this.gridSize = (__runInitializers(this, _snapToGrid_extraInitializers), __runInitializers(this, _gridSize_initializers, 20));
|
|
134
|
+
this.zoomEnabled = (__runInitializers(this, _gridSize_extraInitializers), __runInitializers(this, _zoomEnabled_initializers, true));
|
|
135
|
+
this.panEnabled = (__runInitializers(this, _zoomEnabled_extraInitializers), __runInitializers(this, _panEnabled_initializers, true));
|
|
136
|
+
this.minimap = (__runInitializers(this, _panEnabled_extraInitializers), __runInitializers(this, _minimap_initializers, true));
|
|
137
|
+
this.editable = (__runInitializers(this, _minimap_extraInitializers), __runInitializers(this, _editable_initializers, true));
|
|
138
|
+
this.containerEl = (__runInitializers(this, _editable_extraInitializers), __runInitializers(this, _containerEl_initializers, void 0));
|
|
139
|
+
this.svgEl = (__runInitializers(this, _containerEl_extraInitializers), __runInitializers(this, _svgEl_initializers, void 0));
|
|
140
|
+
this.nodesContainerEl = (__runInitializers(this, _svgEl_extraInitializers), __runInitializers(this, _nodesContainerEl_initializers, void 0));
|
|
141
|
+
this.minimapSvgEl = (__runInitializers(this, _nodesContainerEl_extraInitializers), __runInitializers(this, _minimapSvgEl_initializers, void 0));
|
|
142
|
+
// SVG groups (created manually for SVG namespace)
|
|
143
|
+
this.transformGroupEl = __runInitializers(this, _minimapSvgEl_extraInitializers);
|
|
144
|
+
// Transform state
|
|
145
|
+
this.zoomScale = 1;
|
|
146
|
+
this.panX = 0;
|
|
147
|
+
this.panY = 0;
|
|
148
|
+
// Drag state
|
|
149
|
+
this.dragNode = null;
|
|
150
|
+
this.dragOffsetX = 0;
|
|
151
|
+
this.dragOffsetY = 0;
|
|
152
|
+
// Pan state
|
|
153
|
+
this.isPanning = false;
|
|
154
|
+
this.panStartX = 0;
|
|
155
|
+
this.panStartY = 0;
|
|
156
|
+
this.panStartPanX = 0;
|
|
157
|
+
this.panStartPanY = 0;
|
|
158
|
+
// Edge drawing state
|
|
159
|
+
this.drawingEdge = false;
|
|
160
|
+
this.drawSourceNodeId = '';
|
|
161
|
+
this.drawSourcePortId = '';
|
|
162
|
+
this.drawSourceIsOutput = true;
|
|
163
|
+
this.drawEndX = 0;
|
|
164
|
+
this.drawEndY = 0;
|
|
165
|
+
// Selection
|
|
166
|
+
this.selectedNodeId = '';
|
|
167
|
+
this.selectedEdgeId = '';
|
|
168
|
+
// Sizing
|
|
169
|
+
this.containerWidth = 800;
|
|
170
|
+
this.containerHeight = 500;
|
|
171
|
+
this.resizeObserver = null;
|
|
172
|
+
// Bound handlers
|
|
173
|
+
this.boundMouseMove = this.handleMouseMove.bind(this);
|
|
174
|
+
this.boundMouseUp = this.handleMouseUp.bind(this);
|
|
175
|
+
this.initialized = false;
|
|
176
|
+
this.listenersAttached = false;
|
|
177
|
+
}
|
|
178
|
+
static {
|
|
179
|
+
const _metadata = typeof Symbol === "function" && Symbol.metadata ? Object.create(_classSuper[Symbol.metadata] ?? null) : void 0;
|
|
180
|
+
_nodes_decorators = [snice.property({ type: Array, attribute: false })];
|
|
181
|
+
_edges_decorators = [snice.property({ type: Array, attribute: false })];
|
|
182
|
+
_snapToGrid_decorators = [snice.property({ type: Boolean, attribute: 'snap-to-grid' })];
|
|
183
|
+
_gridSize_decorators = [snice.property({ type: Number, attribute: 'grid-size' })];
|
|
184
|
+
_zoomEnabled_decorators = [snice.property({ type: Boolean, attribute: 'zoom-enabled' })];
|
|
185
|
+
_panEnabled_decorators = [snice.property({ type: Boolean, attribute: 'pan-enabled' })];
|
|
186
|
+
_minimap_decorators = [snice.property({ type: Boolean })];
|
|
187
|
+
_editable_decorators = [snice.property({ type: Boolean })];
|
|
188
|
+
_containerEl_decorators = [snice.query('.flow')];
|
|
189
|
+
_svgEl_decorators = [snice.query('.flow__svg')];
|
|
190
|
+
_nodesContainerEl_decorators = [snice.query('.flow__nodes')];
|
|
191
|
+
_minimapSvgEl_decorators = [snice.query('.flow__minimap-svg')];
|
|
192
|
+
_emitNodeDrag_decorators = [snice.dispatch('node-drag', { bubbles: true, composed: true })];
|
|
193
|
+
_emitNodeSelect_decorators = [snice.dispatch('node-select', { bubbles: true, composed: true })];
|
|
194
|
+
_emitEdgeConnect_decorators = [snice.dispatch('edge-connect', { bubbles: true, composed: true })];
|
|
195
|
+
_emitEdgeDisconnect_decorators = [snice.dispatch('edge-disconnect', { bubbles: true, composed: true })];
|
|
196
|
+
_emitCanvasClick_decorators = [snice.dispatch('canvas-click', { bubbles: true, composed: true })];
|
|
197
|
+
_init_decorators = [snice.ready()];
|
|
198
|
+
_onNodesChange_decorators = [snice.watch('nodes')];
|
|
199
|
+
_onEdgesChange_decorators = [snice.watch('edges')];
|
|
200
|
+
_onMinimapChange_decorators = [snice.watch('minimap')];
|
|
201
|
+
_cleanup_decorators = [snice.dispose()];
|
|
202
|
+
_renderContent_decorators = [snice.render({ once: true })];
|
|
203
|
+
_componentStyles_decorators = [snice.styles()];
|
|
204
|
+
__esDecorate(this, null, _emitNodeDrag_decorators, { kind: "method", name: "emitNodeDrag", static: false, private: false, access: { has: obj => "emitNodeDrag" in obj, get: obj => obj.emitNodeDrag }, metadata: _metadata }, null, _instanceExtraInitializers);
|
|
205
|
+
__esDecorate(this, null, _emitNodeSelect_decorators, { kind: "method", name: "emitNodeSelect", static: false, private: false, access: { has: obj => "emitNodeSelect" in obj, get: obj => obj.emitNodeSelect }, metadata: _metadata }, null, _instanceExtraInitializers);
|
|
206
|
+
__esDecorate(this, null, _emitEdgeConnect_decorators, { kind: "method", name: "emitEdgeConnect", static: false, private: false, access: { has: obj => "emitEdgeConnect" in obj, get: obj => obj.emitEdgeConnect }, metadata: _metadata }, null, _instanceExtraInitializers);
|
|
207
|
+
__esDecorate(this, null, _emitEdgeDisconnect_decorators, { kind: "method", name: "emitEdgeDisconnect", static: false, private: false, access: { has: obj => "emitEdgeDisconnect" in obj, get: obj => obj.emitEdgeDisconnect }, metadata: _metadata }, null, _instanceExtraInitializers);
|
|
208
|
+
__esDecorate(this, null, _emitCanvasClick_decorators, { kind: "method", name: "emitCanvasClick", static: false, private: false, access: { has: obj => "emitCanvasClick" in obj, get: obj => obj.emitCanvasClick }, metadata: _metadata }, null, _instanceExtraInitializers);
|
|
209
|
+
__esDecorate(this, null, _init_decorators, { kind: "method", name: "init", static: false, private: false, access: { has: obj => "init" in obj, get: obj => obj.init }, metadata: _metadata }, null, _instanceExtraInitializers);
|
|
210
|
+
__esDecorate(this, null, _onNodesChange_decorators, { kind: "method", name: "onNodesChange", static: false, private: false, access: { has: obj => "onNodesChange" in obj, get: obj => obj.onNodesChange }, metadata: _metadata }, null, _instanceExtraInitializers);
|
|
211
|
+
__esDecorate(this, null, _onEdgesChange_decorators, { kind: "method", name: "onEdgesChange", static: false, private: false, access: { has: obj => "onEdgesChange" in obj, get: obj => obj.onEdgesChange }, metadata: _metadata }, null, _instanceExtraInitializers);
|
|
212
|
+
__esDecorate(this, null, _onMinimapChange_decorators, { kind: "method", name: "onMinimapChange", static: false, private: false, access: { has: obj => "onMinimapChange" in obj, get: obj => obj.onMinimapChange }, metadata: _metadata }, null, _instanceExtraInitializers);
|
|
213
|
+
__esDecorate(this, null, _cleanup_decorators, { kind: "method", name: "cleanup", static: false, private: false, access: { has: obj => "cleanup" in obj, get: obj => obj.cleanup }, metadata: _metadata }, null, _instanceExtraInitializers);
|
|
214
|
+
__esDecorate(this, null, _renderContent_decorators, { kind: "method", name: "renderContent", static: false, private: false, access: { has: obj => "renderContent" in obj, get: obj => obj.renderContent }, metadata: _metadata }, null, _instanceExtraInitializers);
|
|
215
|
+
__esDecorate(this, null, _componentStyles_decorators, { kind: "method", name: "componentStyles", static: false, private: false, access: { has: obj => "componentStyles" in obj, get: obj => obj.componentStyles }, metadata: _metadata }, null, _instanceExtraInitializers);
|
|
216
|
+
__esDecorate(null, null, _nodes_decorators, { kind: "field", name: "nodes", static: false, private: false, access: { has: obj => "nodes" in obj, get: obj => obj.nodes, set: (obj, value) => { obj.nodes = value; } }, metadata: _metadata }, _nodes_initializers, _nodes_extraInitializers);
|
|
217
|
+
__esDecorate(null, null, _edges_decorators, { kind: "field", name: "edges", static: false, private: false, access: { has: obj => "edges" in obj, get: obj => obj.edges, set: (obj, value) => { obj.edges = value; } }, metadata: _metadata }, _edges_initializers, _edges_extraInitializers);
|
|
218
|
+
__esDecorate(null, null, _snapToGrid_decorators, { kind: "field", name: "snapToGrid", static: false, private: false, access: { has: obj => "snapToGrid" in obj, get: obj => obj.snapToGrid, set: (obj, value) => { obj.snapToGrid = value; } }, metadata: _metadata }, _snapToGrid_initializers, _snapToGrid_extraInitializers);
|
|
219
|
+
__esDecorate(null, null, _gridSize_decorators, { kind: "field", name: "gridSize", static: false, private: false, access: { has: obj => "gridSize" in obj, get: obj => obj.gridSize, set: (obj, value) => { obj.gridSize = value; } }, metadata: _metadata }, _gridSize_initializers, _gridSize_extraInitializers);
|
|
220
|
+
__esDecorate(null, null, _zoomEnabled_decorators, { kind: "field", name: "zoomEnabled", static: false, private: false, access: { has: obj => "zoomEnabled" in obj, get: obj => obj.zoomEnabled, set: (obj, value) => { obj.zoomEnabled = value; } }, metadata: _metadata }, _zoomEnabled_initializers, _zoomEnabled_extraInitializers);
|
|
221
|
+
__esDecorate(null, null, _panEnabled_decorators, { kind: "field", name: "panEnabled", static: false, private: false, access: { has: obj => "panEnabled" in obj, get: obj => obj.panEnabled, set: (obj, value) => { obj.panEnabled = value; } }, metadata: _metadata }, _panEnabled_initializers, _panEnabled_extraInitializers);
|
|
222
|
+
__esDecorate(null, null, _minimap_decorators, { kind: "field", name: "minimap", static: false, private: false, access: { has: obj => "minimap" in obj, get: obj => obj.minimap, set: (obj, value) => { obj.minimap = value; } }, metadata: _metadata }, _minimap_initializers, _minimap_extraInitializers);
|
|
223
|
+
__esDecorate(null, null, _editable_decorators, { kind: "field", name: "editable", static: false, private: false, access: { has: obj => "editable" in obj, get: obj => obj.editable, set: (obj, value) => { obj.editable = value; } }, metadata: _metadata }, _editable_initializers, _editable_extraInitializers);
|
|
224
|
+
__esDecorate(null, null, _containerEl_decorators, { kind: "field", name: "containerEl", static: false, private: false, access: { has: obj => "containerEl" in obj, get: obj => obj.containerEl, set: (obj, value) => { obj.containerEl = value; } }, metadata: _metadata }, _containerEl_initializers, _containerEl_extraInitializers);
|
|
225
|
+
__esDecorate(null, null, _svgEl_decorators, { kind: "field", name: "svgEl", static: false, private: false, access: { has: obj => "svgEl" in obj, get: obj => obj.svgEl, set: (obj, value) => { obj.svgEl = value; } }, metadata: _metadata }, _svgEl_initializers, _svgEl_extraInitializers);
|
|
226
|
+
__esDecorate(null, null, _nodesContainerEl_decorators, { kind: "field", name: "nodesContainerEl", static: false, private: false, access: { has: obj => "nodesContainerEl" in obj, get: obj => obj.nodesContainerEl, set: (obj, value) => { obj.nodesContainerEl = value; } }, metadata: _metadata }, _nodesContainerEl_initializers, _nodesContainerEl_extraInitializers);
|
|
227
|
+
__esDecorate(null, null, _minimapSvgEl_decorators, { kind: "field", name: "minimapSvgEl", static: false, private: false, access: { has: obj => "minimapSvgEl" in obj, get: obj => obj.minimapSvgEl, set: (obj, value) => { obj.minimapSvgEl = value; } }, metadata: _metadata }, _minimapSvgEl_initializers, _minimapSvgEl_extraInitializers);
|
|
228
|
+
__esDecorate(null, _classDescriptor = { value: _classThis }, _classDecorators, { kind: "class", name: _classThis.name, metadata: _metadata }, null, _classExtraInitializers);
|
|
229
|
+
_classThis = _classDescriptor.value;
|
|
230
|
+
if (_metadata) Object.defineProperty(_classThis, Symbol.metadata, { enumerable: true, configurable: true, writable: true, value: _metadata });
|
|
231
|
+
__runInitializers(_classThis, _classExtraInitializers);
|
|
232
|
+
}
|
|
233
|
+
emitNodeDrag(node, x, y) {
|
|
234
|
+
return { node, x, y };
|
|
235
|
+
}
|
|
236
|
+
emitNodeSelect(node) {
|
|
237
|
+
return { node };
|
|
238
|
+
}
|
|
239
|
+
emitEdgeConnect(edge) {
|
|
240
|
+
return { edge };
|
|
241
|
+
}
|
|
242
|
+
emitEdgeDisconnect(edge) {
|
|
243
|
+
return { edge };
|
|
244
|
+
}
|
|
245
|
+
emitCanvasClick(x, y) {
|
|
246
|
+
return { x, y };
|
|
247
|
+
}
|
|
248
|
+
init() {
|
|
249
|
+
this.resizeObserver = new ResizeObserver(entries => {
|
|
250
|
+
for (const entry of entries) {
|
|
251
|
+
this.containerWidth = entry.contentRect.width || 800;
|
|
252
|
+
this.containerHeight = entry.contentRect.height || 500;
|
|
253
|
+
if (this.initialized)
|
|
254
|
+
this.rebuild();
|
|
255
|
+
}
|
|
256
|
+
});
|
|
257
|
+
this.resizeObserver.observe(this);
|
|
258
|
+
requestAnimationFrame(() => {
|
|
259
|
+
this.ensureSvgSetup();
|
|
260
|
+
this.attachListeners();
|
|
261
|
+
this.initialized = true;
|
|
262
|
+
this.rebuild();
|
|
263
|
+
});
|
|
264
|
+
}
|
|
265
|
+
onNodesChange() {
|
|
266
|
+
if (this.initialized)
|
|
267
|
+
this.rebuild();
|
|
268
|
+
}
|
|
269
|
+
onEdgesChange() {
|
|
270
|
+
if (this.initialized)
|
|
271
|
+
this.rebuild();
|
|
272
|
+
}
|
|
273
|
+
onMinimapChange() {
|
|
274
|
+
if (this.initialized)
|
|
275
|
+
this.updateMinimap();
|
|
276
|
+
}
|
|
277
|
+
cleanup() {
|
|
278
|
+
document.removeEventListener('mousemove', this.boundMouseMove);
|
|
279
|
+
document.removeEventListener('mouseup', this.boundMouseUp);
|
|
280
|
+
if (this.resizeObserver) {
|
|
281
|
+
this.resizeObserver.disconnect();
|
|
282
|
+
this.resizeObserver = null;
|
|
283
|
+
}
|
|
284
|
+
}
|
|
285
|
+
// --- Public API ---
|
|
286
|
+
addNode(node) {
|
|
287
|
+
this.nodes = [...this.nodes, node];
|
|
288
|
+
}
|
|
289
|
+
removeNode(id) {
|
|
290
|
+
this.nodes = this.nodes.filter(n => n.id !== id);
|
|
291
|
+
this.edges = this.edges.filter(e => e.source !== id && e.target !== id);
|
|
292
|
+
if (this.selectedNodeId === id) {
|
|
293
|
+
this.selectedNodeId = '';
|
|
294
|
+
this.emitNodeSelect(null);
|
|
295
|
+
}
|
|
296
|
+
}
|
|
297
|
+
addEdge(edge) {
|
|
298
|
+
this.edges = [...this.edges, edge];
|
|
299
|
+
}
|
|
300
|
+
removeEdge(id) {
|
|
301
|
+
const edge = this.edges.find(e => e.id === id);
|
|
302
|
+
this.edges = this.edges.filter(e => e.id !== id);
|
|
303
|
+
if (edge)
|
|
304
|
+
this.emitEdgeDisconnect(edge);
|
|
305
|
+
}
|
|
306
|
+
fitView() {
|
|
307
|
+
if (this.nodes.length === 0)
|
|
308
|
+
return;
|
|
309
|
+
let minX = Infinity, minY = Infinity, maxX = -Infinity, maxY = -Infinity;
|
|
310
|
+
for (const node of this.nodes) {
|
|
311
|
+
const w = node.width || DEFAULT_NODE_WIDTH;
|
|
312
|
+
const h = node.height || DEFAULT_NODE_HEIGHT;
|
|
313
|
+
minX = Math.min(minX, node.x);
|
|
314
|
+
minY = Math.min(minY, node.y);
|
|
315
|
+
maxX = Math.max(maxX, node.x + w);
|
|
316
|
+
maxY = Math.max(maxY, node.y + h);
|
|
317
|
+
}
|
|
318
|
+
const padding = 40;
|
|
319
|
+
const contentW = maxX - minX + padding * 2;
|
|
320
|
+
const contentH = maxY - minY + padding * 2;
|
|
321
|
+
const scaleX = this.containerWidth / contentW;
|
|
322
|
+
const scaleY = this.containerHeight / contentH;
|
|
323
|
+
this.zoomScale = Math.min(scaleX, scaleY, 1.5);
|
|
324
|
+
this.panX = (this.containerWidth - contentW * this.zoomScale) / 2 - minX * this.zoomScale + padding * this.zoomScale;
|
|
325
|
+
this.panY = (this.containerHeight - contentH * this.zoomScale) / 2 - minY * this.zoomScale + padding * this.zoomScale;
|
|
326
|
+
this.rebuild();
|
|
327
|
+
}
|
|
328
|
+
// --- SVG Setup ---
|
|
329
|
+
ensureSvgSetup() {
|
|
330
|
+
if (this.edgesGroupEl && this.transformGroupEl)
|
|
331
|
+
return true;
|
|
332
|
+
const svg = this.svgEl;
|
|
333
|
+
if (!svg)
|
|
334
|
+
return false;
|
|
335
|
+
const ns = 'http://www.w3.org/2000/svg';
|
|
336
|
+
// Defs for arrow marker
|
|
337
|
+
this.defsEl = document.createElementNS(ns, 'defs');
|
|
338
|
+
const marker = document.createElementNS(ns, 'marker');
|
|
339
|
+
marker.setAttribute('id', 'flow-arrow');
|
|
340
|
+
marker.setAttribute('viewBox', '0 0 10 10');
|
|
341
|
+
marker.setAttribute('refX', '10');
|
|
342
|
+
marker.setAttribute('refY', '5');
|
|
343
|
+
marker.setAttribute('markerWidth', '8');
|
|
344
|
+
marker.setAttribute('markerHeight', '8');
|
|
345
|
+
marker.setAttribute('orient', 'auto-start-reverse');
|
|
346
|
+
const path = document.createElementNS(ns, 'path');
|
|
347
|
+
path.setAttribute('d', 'M 0 0 L 10 5 L 0 10 z');
|
|
348
|
+
path.setAttribute('class', 'flow__arrow');
|
|
349
|
+
marker.appendChild(path);
|
|
350
|
+
this.defsEl.appendChild(marker);
|
|
351
|
+
svg.appendChild(this.defsEl);
|
|
352
|
+
// Transform group
|
|
353
|
+
this.transformGroupEl = document.createElementNS(ns, 'g');
|
|
354
|
+
this.edgesGroupEl = document.createElementNS(ns, 'g');
|
|
355
|
+
this.previewGroupEl = document.createElementNS(ns, 'g');
|
|
356
|
+
this.transformGroupEl.appendChild(this.edgesGroupEl);
|
|
357
|
+
this.transformGroupEl.appendChild(this.previewGroupEl);
|
|
358
|
+
svg.appendChild(this.transformGroupEl);
|
|
359
|
+
return true;
|
|
360
|
+
}
|
|
361
|
+
attachListeners() {
|
|
362
|
+
if (this.listenersAttached)
|
|
363
|
+
return;
|
|
364
|
+
const svg = this.svgEl;
|
|
365
|
+
if (!svg)
|
|
366
|
+
return;
|
|
367
|
+
this.listenersAttached = true;
|
|
368
|
+
svg.addEventListener('mousedown', (e) => this.handleSvgMouseDown(e));
|
|
369
|
+
svg.addEventListener('wheel', (e) => this.handleWheel(e), { passive: false });
|
|
370
|
+
svg.addEventListener('click', (e) => {
|
|
371
|
+
// Only fire canvas click if clicking on the SVG background
|
|
372
|
+
if (e.target === svg || e.target.closest('.flow__svg') === svg && !e.target.closest('.flow__edge')) {
|
|
373
|
+
const pos = this.screenToCanvas(e.clientX, e.clientY);
|
|
374
|
+
this.selectedNodeId = '';
|
|
375
|
+
this.selectedEdgeId = '';
|
|
376
|
+
this.emitNodeSelect(null);
|
|
377
|
+
this.emitCanvasClick(pos.x, pos.y);
|
|
378
|
+
this.rebuild();
|
|
379
|
+
}
|
|
380
|
+
});
|
|
381
|
+
// Edge click
|
|
382
|
+
svg.addEventListener('click', (e) => {
|
|
383
|
+
const edgePath = e.target.closest('.flow__edge');
|
|
384
|
+
if (edgePath) {
|
|
385
|
+
e.stopPropagation();
|
|
386
|
+
const edgeId = edgePath.getAttribute('data-edge-id');
|
|
387
|
+
if (edgeId) {
|
|
388
|
+
this.selectedEdgeId = edgeId;
|
|
389
|
+
this.selectedNodeId = '';
|
|
390
|
+
this.rebuild();
|
|
391
|
+
}
|
|
392
|
+
}
|
|
393
|
+
});
|
|
394
|
+
}
|
|
395
|
+
// --- Coordinate transforms ---
|
|
396
|
+
screenToCanvas(sx, sy) {
|
|
397
|
+
const svg = this.svgEl;
|
|
398
|
+
if (!svg)
|
|
399
|
+
return { x: sx, y: sy };
|
|
400
|
+
const rect = svg.getBoundingClientRect();
|
|
401
|
+
return {
|
|
402
|
+
x: (sx - rect.left - this.panX) / this.zoomScale,
|
|
403
|
+
y: (sy - rect.top - this.panY) / this.zoomScale,
|
|
404
|
+
};
|
|
405
|
+
}
|
|
406
|
+
snap(v) {
|
|
407
|
+
if (!this.snapToGrid)
|
|
408
|
+
return v;
|
|
409
|
+
return Math.round(v / this.gridSize) * this.gridSize;
|
|
410
|
+
}
|
|
411
|
+
// --- Port positions ---
|
|
412
|
+
getPortPosition(nodeId, portId, isOutput) {
|
|
413
|
+
const node = this.nodes.find(n => n.id === nodeId);
|
|
414
|
+
if (!node)
|
|
415
|
+
return { x: 0, y: 0 };
|
|
416
|
+
const w = node.width || DEFAULT_NODE_WIDTH;
|
|
417
|
+
const h = node.height || DEFAULT_NODE_HEIGHT;
|
|
418
|
+
const ports = isOutput ? (node.outputs || []) : (node.inputs || []);
|
|
419
|
+
const idx = ports.findIndex(p => p.id === portId);
|
|
420
|
+
if (idx === -1)
|
|
421
|
+
return { x: node.x, y: node.y };
|
|
422
|
+
const headerHeight = 28;
|
|
423
|
+
const portAreaHeight = h - headerHeight;
|
|
424
|
+
const portSpacing = ports.length > 1 ? portAreaHeight / (ports.length + 1) : portAreaHeight / 2;
|
|
425
|
+
const yOffset = headerHeight + portSpacing * (idx + 1);
|
|
426
|
+
return {
|
|
427
|
+
x: isOutput ? node.x + w : node.x,
|
|
428
|
+
y: node.y + yOffset,
|
|
429
|
+
};
|
|
430
|
+
}
|
|
431
|
+
findNearestPort(x, y, needOutput) {
|
|
432
|
+
let best = null;
|
|
433
|
+
let bestDist = 20; // max distance threshold
|
|
434
|
+
for (const node of this.nodes) {
|
|
435
|
+
const ports = needOutput ? (node.outputs || []) : (node.inputs || []);
|
|
436
|
+
for (const port of ports) {
|
|
437
|
+
const pos = this.getPortPosition(node.id, port.id, needOutput);
|
|
438
|
+
const dx = pos.x - x;
|
|
439
|
+
const dy = pos.y - y;
|
|
440
|
+
const dist = Math.sqrt(dx * dx + dy * dy);
|
|
441
|
+
if (dist < bestDist) {
|
|
442
|
+
bestDist = dist;
|
|
443
|
+
best = { nodeId: node.id, portId: port.id };
|
|
444
|
+
}
|
|
445
|
+
}
|
|
446
|
+
}
|
|
447
|
+
return best;
|
|
448
|
+
}
|
|
449
|
+
// --- Mouse handling ---
|
|
450
|
+
handleSvgMouseDown(e) {
|
|
451
|
+
if (e.button !== 0)
|
|
452
|
+
return;
|
|
453
|
+
// Background pan
|
|
454
|
+
if (this.panEnabled) {
|
|
455
|
+
e.preventDefault();
|
|
456
|
+
this.isPanning = true;
|
|
457
|
+
this.panStartX = e.clientX;
|
|
458
|
+
this.panStartY = e.clientY;
|
|
459
|
+
this.panStartPanX = this.panX;
|
|
460
|
+
this.panStartPanY = this.panY;
|
|
461
|
+
document.addEventListener('mousemove', this.boundMouseMove);
|
|
462
|
+
document.addEventListener('mouseup', this.boundMouseUp);
|
|
463
|
+
}
|
|
464
|
+
}
|
|
465
|
+
handleNodeMouseDown(e, nodeId) {
|
|
466
|
+
e.preventDefault();
|
|
467
|
+
e.stopPropagation();
|
|
468
|
+
const node = this.nodes.find(n => n.id === nodeId);
|
|
469
|
+
if (!node)
|
|
470
|
+
return;
|
|
471
|
+
// Select node
|
|
472
|
+
this.selectedNodeId = nodeId;
|
|
473
|
+
this.selectedEdgeId = '';
|
|
474
|
+
this.emitNodeSelect(node);
|
|
475
|
+
// Start drag
|
|
476
|
+
this.dragNode = node;
|
|
477
|
+
const pos = this.screenToCanvas(e.clientX, e.clientY);
|
|
478
|
+
this.dragOffsetX = pos.x - node.x;
|
|
479
|
+
this.dragOffsetY = pos.y - node.y;
|
|
480
|
+
document.addEventListener('mousemove', this.boundMouseMove);
|
|
481
|
+
document.addEventListener('mouseup', this.boundMouseUp);
|
|
482
|
+
this.rebuild();
|
|
483
|
+
}
|
|
484
|
+
handlePortMouseDown(e, nodeId, portId, isOutput) {
|
|
485
|
+
if (!this.editable)
|
|
486
|
+
return;
|
|
487
|
+
e.preventDefault();
|
|
488
|
+
e.stopPropagation();
|
|
489
|
+
this.drawingEdge = true;
|
|
490
|
+
this.drawSourceNodeId = nodeId;
|
|
491
|
+
this.drawSourcePortId = portId;
|
|
492
|
+
this.drawSourceIsOutput = isOutput;
|
|
493
|
+
const pos = this.screenToCanvas(e.clientX, e.clientY);
|
|
494
|
+
this.drawEndX = pos.x;
|
|
495
|
+
this.drawEndY = pos.y;
|
|
496
|
+
document.addEventListener('mousemove', this.boundMouseMove);
|
|
497
|
+
document.addEventListener('mouseup', this.boundMouseUp);
|
|
498
|
+
}
|
|
499
|
+
handleMouseMove(e) {
|
|
500
|
+
if (this.dragNode) {
|
|
501
|
+
const pos = this.screenToCanvas(e.clientX, e.clientY);
|
|
502
|
+
const newX = this.snap(pos.x - this.dragOffsetX);
|
|
503
|
+
const newY = this.snap(pos.y - this.dragOffsetY);
|
|
504
|
+
this.dragNode.x = newX;
|
|
505
|
+
this.dragNode.y = newY;
|
|
506
|
+
this.emitNodeDrag(this.dragNode, newX, newY);
|
|
507
|
+
this.rebuild();
|
|
508
|
+
}
|
|
509
|
+
else if (this.drawingEdge) {
|
|
510
|
+
const pos = this.screenToCanvas(e.clientX, e.clientY);
|
|
511
|
+
this.drawEndX = pos.x;
|
|
512
|
+
this.drawEndY = pos.y;
|
|
513
|
+
this.updateEdgePreview();
|
|
514
|
+
}
|
|
515
|
+
else if (this.isPanning) {
|
|
516
|
+
const dx = e.clientX - this.panStartX;
|
|
517
|
+
const dy = e.clientY - this.panStartY;
|
|
518
|
+
this.panX = this.panStartPanX + dx;
|
|
519
|
+
this.panY = this.panStartPanY + dy;
|
|
520
|
+
this.rebuild();
|
|
521
|
+
}
|
|
522
|
+
}
|
|
523
|
+
handleMouseUp(e) {
|
|
524
|
+
if (this.drawingEdge) {
|
|
525
|
+
this.finishEdgeDraw(e);
|
|
526
|
+
}
|
|
527
|
+
this.dragNode = null;
|
|
528
|
+
this.isPanning = false;
|
|
529
|
+
this.drawingEdge = false;
|
|
530
|
+
document.removeEventListener('mousemove', this.boundMouseMove);
|
|
531
|
+
document.removeEventListener('mouseup', this.boundMouseUp);
|
|
532
|
+
this.clearEdgePreview();
|
|
533
|
+
this.rebuild();
|
|
534
|
+
}
|
|
535
|
+
finishEdgeDraw(e) {
|
|
536
|
+
const pos = this.screenToCanvas(e.clientX, e.clientY);
|
|
537
|
+
// If started from output, find nearest input; vice versa
|
|
538
|
+
const needOutput = !this.drawSourceIsOutput;
|
|
539
|
+
const target = this.findNearestPort(pos.x, pos.y, needOutput);
|
|
540
|
+
if (target && target.nodeId !== this.drawSourceNodeId) {
|
|
541
|
+
const sourceNodeId = this.drawSourceIsOutput ? this.drawSourceNodeId : target.nodeId;
|
|
542
|
+
const sourcePortId = this.drawSourceIsOutput ? this.drawSourcePortId : target.portId;
|
|
543
|
+
const targetNodeId = this.drawSourceIsOutput ? target.nodeId : this.drawSourceNodeId;
|
|
544
|
+
const targetPortId = this.drawSourceIsOutput ? target.portId : this.drawSourcePortId;
|
|
545
|
+
// Check for duplicate
|
|
546
|
+
const exists = this.edges.some(e => e.source === sourceNodeId && e.target === targetNodeId &&
|
|
547
|
+
e.sourcePort === sourcePortId && e.targetPort === targetPortId);
|
|
548
|
+
if (!exists) {
|
|
549
|
+
const newEdge = {
|
|
550
|
+
id: `edge-${Date.now()}-${Math.random().toString(36).slice(2, 8)}`,
|
|
551
|
+
source: sourceNodeId,
|
|
552
|
+
target: targetNodeId,
|
|
553
|
+
sourcePort: sourcePortId,
|
|
554
|
+
targetPort: targetPortId,
|
|
555
|
+
};
|
|
556
|
+
this.edges = [...this.edges, newEdge];
|
|
557
|
+
this.emitEdgeConnect(newEdge);
|
|
558
|
+
}
|
|
559
|
+
}
|
|
560
|
+
}
|
|
561
|
+
handleWheel(e) {
|
|
562
|
+
if (!this.zoomEnabled)
|
|
563
|
+
return;
|
|
564
|
+
e.preventDefault();
|
|
565
|
+
const svg = this.svgEl;
|
|
566
|
+
if (!svg)
|
|
567
|
+
return;
|
|
568
|
+
const rect = svg.getBoundingClientRect();
|
|
569
|
+
const mouseX = e.clientX - rect.left;
|
|
570
|
+
const mouseY = e.clientY - rect.top;
|
|
571
|
+
const delta = e.deltaY > 0 ? 0.9 : 1.1;
|
|
572
|
+
const newScale = Math.max(0.2, Math.min(4, this.zoomScale * delta));
|
|
573
|
+
this.panX = mouseX - (mouseX - this.panX) * (newScale / this.zoomScale);
|
|
574
|
+
this.panY = mouseY - (mouseY - this.panY) * (newScale / this.zoomScale);
|
|
575
|
+
this.zoomScale = newScale;
|
|
576
|
+
this.rebuild();
|
|
577
|
+
}
|
|
578
|
+
// --- Bezier curves ---
|
|
579
|
+
bezierPath(x1, y1, x2, y2) {
|
|
580
|
+
const dx = Math.abs(x2 - x1) * 0.5;
|
|
581
|
+
const cp1x = x1 + dx;
|
|
582
|
+
const cp1y = y1;
|
|
583
|
+
const cp2x = x2 - dx;
|
|
584
|
+
const cp2y = y2;
|
|
585
|
+
return `M ${x1} ${y1} C ${cp1x} ${cp1y}, ${cp2x} ${cp2y}, ${x2} ${y2}`;
|
|
586
|
+
}
|
|
587
|
+
// --- Edge preview ---
|
|
588
|
+
updateEdgePreview() {
|
|
589
|
+
if (!this.previewGroupEl)
|
|
590
|
+
return;
|
|
591
|
+
const sourcePos = this.getPortPosition(this.drawSourceNodeId, this.drawSourcePortId, this.drawSourceIsOutput);
|
|
592
|
+
let x1, y1, x2, y2;
|
|
593
|
+
if (this.drawSourceIsOutput) {
|
|
594
|
+
x1 = sourcePos.x;
|
|
595
|
+
y1 = sourcePos.y;
|
|
596
|
+
x2 = this.drawEndX;
|
|
597
|
+
y2 = this.drawEndY;
|
|
598
|
+
}
|
|
599
|
+
else {
|
|
600
|
+
x1 = this.drawEndX;
|
|
601
|
+
y1 = this.drawEndY;
|
|
602
|
+
x2 = sourcePos.x;
|
|
603
|
+
y2 = sourcePos.y;
|
|
604
|
+
}
|
|
605
|
+
const d = this.bezierPath(x1, y1, x2, y2);
|
|
606
|
+
this.previewGroupEl.innerHTML = `<path class="flow__edge-preview" d="${d}" />`;
|
|
607
|
+
}
|
|
608
|
+
clearEdgePreview() {
|
|
609
|
+
if (this.previewGroupEl) {
|
|
610
|
+
this.previewGroupEl.innerHTML = '';
|
|
611
|
+
}
|
|
612
|
+
}
|
|
613
|
+
// --- Grid pattern ---
|
|
614
|
+
gridPatternSvg() {
|
|
615
|
+
const g = this.gridSize;
|
|
616
|
+
return `<svg width="100%" height="100%" xmlns="http://www.w3.org/2000/svg"><defs><pattern id="flow-grid-small" width="${g}" height="${g}" patternUnits="userSpaceOnUse" patternTransform="translate(${this.panX % (g * this.zoomScale)}, ${this.panY % (g * this.zoomScale)}) scale(${this.zoomScale})"><circle cx="${g / 2}" cy="${g / 2}" r="0.5" fill="var(--snice-color-text-tertiary, rgb(115 115 115))" opacity="0.3"/></pattern></defs><rect width="100%" height="100%" fill="url(#flow-grid-small)"/></svg>`;
|
|
617
|
+
}
|
|
618
|
+
// --- Rebuild ---
|
|
619
|
+
rebuild() {
|
|
620
|
+
this.ensureSvgSetup();
|
|
621
|
+
this.attachListeners();
|
|
622
|
+
this.rebuildTransform();
|
|
623
|
+
this.rebuildEdges();
|
|
624
|
+
this.rebuildNodes();
|
|
625
|
+
this.updateGrid();
|
|
626
|
+
this.updateMinimap();
|
|
627
|
+
}
|
|
628
|
+
rebuildTransform() {
|
|
629
|
+
if (this.transformGroupEl) {
|
|
630
|
+
this.transformGroupEl.setAttribute('transform', `translate(${this.panX}, ${this.panY}) scale(${this.zoomScale})`);
|
|
631
|
+
}
|
|
632
|
+
}
|
|
633
|
+
rebuildEdges() {
|
|
634
|
+
if (!this.edgesGroupEl)
|
|
635
|
+
return;
|
|
636
|
+
let parts = '';
|
|
637
|
+
for (const edge of this.edges) {
|
|
638
|
+
const sourcePort = edge.sourcePort || (this.nodes.find(n => n.id === edge.source)?.outputs?.[0]?.id || '');
|
|
639
|
+
const targetPort = edge.targetPort || (this.nodes.find(n => n.id === edge.target)?.inputs?.[0]?.id || '');
|
|
640
|
+
const p1 = this.getPortPosition(edge.source, sourcePort, true);
|
|
641
|
+
const p2 = this.getPortPosition(edge.target, targetPort, false);
|
|
642
|
+
const d = this.bezierPath(p1.x, p1.y, p2.x, p2.y);
|
|
643
|
+
const cls = ['flow__edge'];
|
|
644
|
+
if (edge.id === this.selectedEdgeId)
|
|
645
|
+
cls.push('flow__edge--selected');
|
|
646
|
+
if (edge.animated)
|
|
647
|
+
cls.push('flow__edge--animated');
|
|
648
|
+
const colorAttr = edge.color ? ` stroke="${edge.color}"` : '';
|
|
649
|
+
parts += `<path class="${cls.join(' ')}" d="${d}" data-edge-id="${edge.id}" marker-end="url(#flow-arrow)"${colorAttr} />`;
|
|
650
|
+
if (edge.label) {
|
|
651
|
+
const mx = (p1.x + p2.x) / 2;
|
|
652
|
+
const my = (p1.y + p2.y) / 2;
|
|
653
|
+
parts += `<text class="flow__edge-label" x="${mx}" y="${my - 8}">${edge.label}</text>`;
|
|
654
|
+
}
|
|
655
|
+
}
|
|
656
|
+
this.edgesGroupEl.innerHTML = parts;
|
|
657
|
+
}
|
|
658
|
+
rebuildNodes() {
|
|
659
|
+
const container = this.nodesContainerEl;
|
|
660
|
+
if (!container)
|
|
661
|
+
return;
|
|
662
|
+
let nodesHtml = '';
|
|
663
|
+
for (const node of this.nodes) {
|
|
664
|
+
const w = node.width || DEFAULT_NODE_WIDTH;
|
|
665
|
+
const h = node.height || DEFAULT_NODE_HEIGHT;
|
|
666
|
+
const x = node.x * this.zoomScale + this.panX;
|
|
667
|
+
const y = node.y * this.zoomScale + this.panY;
|
|
668
|
+
const scaledW = w * this.zoomScale;
|
|
669
|
+
h * this.zoomScale;
|
|
670
|
+
const cls = ['flow__node'];
|
|
671
|
+
if (node.id === this.selectedNodeId)
|
|
672
|
+
cls.push('flow__node--selected');
|
|
673
|
+
if (this.dragNode && this.dragNode.id === node.id)
|
|
674
|
+
cls.push('flow__node--dragging');
|
|
675
|
+
const headerBg = node.color ? `background:${node.color};color:white;` : '';
|
|
676
|
+
nodesHtml += `<div class="${cls.join(' ')}" data-node-id="${node.id}" style="left:${x}px;top:${y}px;width:${scaledW}px;transform-origin:top left;transform:scale(1);">`;
|
|
677
|
+
nodesHtml += `<div class="flow__node-header" style="${headerBg}">`;
|
|
678
|
+
if (node.type)
|
|
679
|
+
nodesHtml += `<span class="flow__node-type">${node.type}</span>`;
|
|
680
|
+
nodesHtml += `<span>${node.label || node.id}</span>`;
|
|
681
|
+
nodesHtml += `</div>`;
|
|
682
|
+
nodesHtml += `<div class="flow__node-body">`;
|
|
683
|
+
// Inputs
|
|
684
|
+
const inputs = node.inputs || [];
|
|
685
|
+
if (inputs.length > 0) {
|
|
686
|
+
nodesHtml += `<div class="flow__node-inputs">`;
|
|
687
|
+
for (const port of inputs) {
|
|
688
|
+
const connected = this.isPortConnected(node.id, port.id, false);
|
|
689
|
+
const pcls = ['flow__port', connected ? 'flow__port--connected' : ''].filter(Boolean).join(' ');
|
|
690
|
+
nodesHtml += `<div class="${pcls}" data-port-id="${port.id}" data-port-type="input" data-node-id="${node.id}">`;
|
|
691
|
+
nodesHtml += `<span class="flow__port-dot"></span>`;
|
|
692
|
+
if (port.label)
|
|
693
|
+
nodesHtml += `<span>${port.label}</span>`;
|
|
694
|
+
nodesHtml += `</div>`;
|
|
695
|
+
}
|
|
696
|
+
nodesHtml += `</div>`;
|
|
697
|
+
}
|
|
698
|
+
// Outputs
|
|
699
|
+
const outputs = node.outputs || [];
|
|
700
|
+
if (outputs.length > 0) {
|
|
701
|
+
nodesHtml += `<div class="flow__node-outputs">`;
|
|
702
|
+
for (const port of outputs) {
|
|
703
|
+
const connected = this.isPortConnected(node.id, port.id, true);
|
|
704
|
+
const pcls = ['flow__port', 'flow__port--output', connected ? 'flow__port--connected' : ''].filter(Boolean).join(' ');
|
|
705
|
+
nodesHtml += `<div class="${pcls}" data-port-id="${port.id}" data-port-type="output" data-node-id="${node.id}">`;
|
|
706
|
+
if (port.label)
|
|
707
|
+
nodesHtml += `<span>${port.label}</span>`;
|
|
708
|
+
nodesHtml += `<span class="flow__port-dot"></span>`;
|
|
709
|
+
nodesHtml += `</div>`;
|
|
710
|
+
}
|
|
711
|
+
nodesHtml += `</div>`;
|
|
712
|
+
}
|
|
713
|
+
nodesHtml += `</div></div>`;
|
|
714
|
+
}
|
|
715
|
+
container.innerHTML = nodesHtml;
|
|
716
|
+
// Attach event listeners to nodes and ports
|
|
717
|
+
const nodeEls = container.querySelectorAll('.flow__node');
|
|
718
|
+
nodeEls.forEach(el => {
|
|
719
|
+
const nodeId = el.getAttribute('data-node-id');
|
|
720
|
+
el.addEventListener('mousedown', (e) => this.handleNodeMouseDown(e, nodeId));
|
|
721
|
+
});
|
|
722
|
+
const portEls = container.querySelectorAll('.flow__port');
|
|
723
|
+
portEls.forEach(el => {
|
|
724
|
+
const portId = el.getAttribute('data-port-id');
|
|
725
|
+
const nodeId = el.getAttribute('data-node-id');
|
|
726
|
+
const isOutput = el.getAttribute('data-port-type') === 'output';
|
|
727
|
+
el.addEventListener('mousedown', (e) => this.handlePortMouseDown(e, nodeId, portId, isOutput));
|
|
728
|
+
});
|
|
729
|
+
}
|
|
730
|
+
isPortConnected(nodeId, portId, isOutput) {
|
|
731
|
+
return this.edges.some(e => {
|
|
732
|
+
if (isOutput) {
|
|
733
|
+
return e.source === nodeId && (e.sourcePort === portId || (!e.sourcePort && portId === this.nodes.find(n => n.id === nodeId)?.outputs?.[0]?.id));
|
|
734
|
+
}
|
|
735
|
+
return e.target === nodeId && (e.targetPort === portId || (!e.targetPort && portId === this.nodes.find(n => n.id === nodeId)?.inputs?.[0]?.id));
|
|
736
|
+
});
|
|
737
|
+
}
|
|
738
|
+
updateGrid() {
|
|
739
|
+
const gridEl = this.containerEl?.querySelector('.flow__grid');
|
|
740
|
+
if (!gridEl)
|
|
741
|
+
return;
|
|
742
|
+
if (this.snapToGrid) {
|
|
743
|
+
gridEl.innerHTML = this.gridPatternSvg();
|
|
744
|
+
gridEl.style.display = '';
|
|
745
|
+
}
|
|
746
|
+
else {
|
|
747
|
+
gridEl.style.display = 'none';
|
|
748
|
+
}
|
|
749
|
+
}
|
|
750
|
+
updateMinimap() {
|
|
751
|
+
const svg = this.minimapSvgEl;
|
|
752
|
+
if (!svg || !this.minimap)
|
|
753
|
+
return;
|
|
754
|
+
if (this.nodes.length === 0) {
|
|
755
|
+
svg.innerHTML = '';
|
|
756
|
+
return;
|
|
757
|
+
}
|
|
758
|
+
// Calculate bounds
|
|
759
|
+
let minX = Infinity, minY = Infinity, maxX = -Infinity, maxY = -Infinity;
|
|
760
|
+
for (const node of this.nodes) {
|
|
761
|
+
const w = node.width || DEFAULT_NODE_WIDTH;
|
|
762
|
+
const h = node.height || DEFAULT_NODE_HEIGHT;
|
|
763
|
+
minX = Math.min(minX, node.x);
|
|
764
|
+
minY = Math.min(minY, node.y);
|
|
765
|
+
maxX = Math.max(maxX, node.x + w);
|
|
766
|
+
maxY = Math.max(maxY, node.y + h);
|
|
767
|
+
}
|
|
768
|
+
const pad = 40;
|
|
769
|
+
minX -= pad;
|
|
770
|
+
minY -= pad;
|
|
771
|
+
maxX += pad;
|
|
772
|
+
maxY += pad;
|
|
773
|
+
const vb = `${minX} ${minY} ${maxX - minX} ${maxY - minY}`;
|
|
774
|
+
svg.setAttribute('viewBox', vb);
|
|
775
|
+
let parts = '';
|
|
776
|
+
// Edges
|
|
777
|
+
for (const edge of this.edges) {
|
|
778
|
+
const sourcePort = edge.sourcePort || (this.nodes.find(n => n.id === edge.source)?.outputs?.[0]?.id || '');
|
|
779
|
+
const targetPort = edge.targetPort || (this.nodes.find(n => n.id === edge.target)?.inputs?.[0]?.id || '');
|
|
780
|
+
const p1 = this.getPortPosition(edge.source, sourcePort, true);
|
|
781
|
+
const p2 = this.getPortPosition(edge.target, targetPort, false);
|
|
782
|
+
parts += `<line class="flow__minimap-edge" x1="${p1.x}" y1="${p1.y}" x2="${p2.x}" y2="${p2.y}" />`;
|
|
783
|
+
}
|
|
784
|
+
// Nodes
|
|
785
|
+
for (const node of this.nodes) {
|
|
786
|
+
const w = node.width || DEFAULT_NODE_WIDTH;
|
|
787
|
+
const h = node.height || DEFAULT_NODE_HEIGHT;
|
|
788
|
+
parts += `<rect class="flow__minimap-node" x="${node.x}" y="${node.y}" width="${w}" height="${h}" rx="2" />`;
|
|
789
|
+
}
|
|
790
|
+
// Viewport indicator
|
|
791
|
+
const vpX = -this.panX / this.zoomScale;
|
|
792
|
+
const vpY = -this.panY / this.zoomScale;
|
|
793
|
+
const vpW = this.containerWidth / this.zoomScale;
|
|
794
|
+
const vpH = this.containerHeight / this.zoomScale;
|
|
795
|
+
parts += `<rect class="flow__minimap-viewport" x="${vpX}" y="${vpY}" width="${vpW}" height="${vpH}" />`;
|
|
796
|
+
svg.innerHTML = parts;
|
|
797
|
+
}
|
|
798
|
+
renderContent() {
|
|
799
|
+
return snice.html /*html*/ `
|
|
800
|
+
<div class="flow">
|
|
801
|
+
<div class="flow__grid"></div>
|
|
802
|
+
<svg class="flow__svg"></svg>
|
|
803
|
+
<div class="flow__nodes"></div>
|
|
804
|
+
<div class="flow__minimap" style="${this.minimap ? '' : 'display:none'}">
|
|
805
|
+
<svg class="flow__minimap-svg"></svg>
|
|
806
|
+
</div>
|
|
807
|
+
</div>
|
|
808
|
+
`;
|
|
809
|
+
}
|
|
810
|
+
componentStyles() {
|
|
811
|
+
return snice.css /*css*/ `${cssContent}`;
|
|
812
|
+
}
|
|
813
|
+
});
|
|
814
|
+
return _classThis;
|
|
815
|
+
})();
|
|
816
|
+
|
|
817
|
+
exports.SniceFlow = SniceFlow;
|
|
818
|
+
|
|
819
|
+
return exports;
|
|
820
|
+
|
|
821
|
+
})({}, Snice);
|
|
822
|
+
//# sourceMappingURL=snice-flow.js.map
|