@redvars/peacock 4.0.0 → 4.2.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/dist/{BaseField-CAog9TIc.js → BaseField-_unSNU5x.js} +43 -4
- package/dist/BaseField-_unSNU5x.js.map +1 -0
- package/dist/{BaseInput-CcMfg1Y2.js → BaseInput-DtZH0fPJ.js} +7 -4
- package/dist/BaseInput-DtZH0fPJ.js.map +1 -0
- package/dist/accordion.js.map +1 -1
- package/dist/ai-badge.js +32 -6
- package/dist/ai-badge.js.map +1 -1
- package/dist/ai-summary.js +2 -2
- package/dist/alert.js +2 -2
- package/dist/anchor-nav.js +2 -2
- package/dist/app-shell.js +2 -2
- package/dist/assistant-panel.js +2 -2
- package/dist/assistant-step.js +2 -2
- package/dist/assistant-steps.js +2 -2
- package/dist/avatar-group.js +2 -2
- package/dist/banner.js +2 -2
- package/dist/{base-button-Do2TUy8M.js → base-button-BJMGMcMv.js} +3 -1
- package/dist/base-button-BJMGMcMv.js.map +1 -0
- package/dist/{base-progress-BiLlZVHJ.js → base-progress-D7Nmfh1s.js} +4 -2
- package/dist/base-progress-D7Nmfh1s.js.map +1 -0
- package/dist/bottom-sheet.js +2 -2
- package/dist/breadcrumb.js +2 -2
- package/dist/button-group.js +4 -4
- package/dist/button.js +14 -8
- package/dist/button.js.map +1 -1
- package/dist/calendar.js +2 -2
- package/dist/canvas-base-CWQ4rQ2s.js +788 -0
- package/dist/canvas-base-CWQ4rQ2s.js.map +1 -0
- package/dist/canvas-link-CtgsALq4.js +54 -0
- package/dist/canvas-link-CtgsALq4.js.map +1 -0
- package/dist/{cartesian-chart-C-f1frt0.js → cartesian-chart-CS5yRLfE.js} +3 -2
- package/dist/cartesian-chart-CS5yRLfE.js.map +1 -0
- package/dist/{cb-group-base-DeuCVx3a.js → cb-group-base-CO30uFQZ.js} +2 -2
- package/dist/{cb-group-base-DeuCVx3a.js.map → cb-group-base-CO30uFQZ.js.map} +1 -1
- package/dist/cb-group.js +3 -3
- package/dist/cb-rule.js +3 -3
- package/dist/chart-area.js +5 -4
- package/dist/chart-area.js.map +1 -1
- package/dist/chart-bar.js +5 -4
- package/dist/chart-bar.js.map +1 -1
- package/dist/chart-base-C_XKVyhf.js +833 -0
- package/dist/chart-base-C_XKVyhf.js.map +1 -0
- package/dist/chart-doughnut.js +4 -3
- package/dist/chart-doughnut.js.map +1 -1
- package/dist/chart-line.js +5 -4
- package/dist/chart-line.js.map +1 -1
- package/dist/chart-pie.js +4 -3
- package/dist/chart-pie.js.map +1 -1
- package/dist/chat-event.js +152 -0
- package/dist/chat-event.js.map +1 -0
- package/dist/chat-message.js +195 -19
- package/dist/chat-message.js.map +1 -1
- package/dist/chat-thread.js +26 -9
- package/dist/chat-thread.js.map +1 -1
- package/dist/checkbox-group.js +5 -5
- package/dist/checkbox.js +5 -5
- package/dist/chip-set.js +4 -4
- package/dist/chip.js +4 -4
- package/dist/circular-progress.js +3 -3
- package/dist/citation.js +2 -2
- package/dist/code-editor.js +6 -5
- package/dist/code-editor.js.map +1 -1
- package/dist/code-highlighter.js +2 -2
- package/dist/color-field.js +6 -6
- package/dist/color-picker.js +2 -2
- package/dist/command-palette.js +2 -2
- package/dist/comment-composer.js +6 -6
- package/dist/condition-builder.js +3 -3
- package/dist/confirm-dialog.js +2 -2
- package/dist/copy-button.js +2 -2
- package/dist/currency-field.js +6 -6
- package/dist/custom-elements-jsdocs.json +2330 -397
- package/dist/custom-elements.json +20464 -542
- package/dist/date-field.js +7 -7
- package/dist/date-picker.js +4 -2
- package/dist/date-picker.js.map +1 -1
- package/dist/date-range-field.js +7 -7
- package/dist/datetime-field.js +7 -7
- package/dist/dependency-map-layout-5KUueabk.js +1390 -0
- package/dist/dependency-map-layout-5KUueabk.js.map +1 -0
- package/dist/dependency-map.js +1605 -0
- package/dist/dependency-map.js.map +1 -0
- package/dist/description-item.js +2 -2
- package/dist/description-list.js +2 -2
- package/dist/diagram-Va096vj9.js +2029 -0
- package/dist/diagram-Va096vj9.js.map +1 -0
- package/dist/diagram-controls.js +345 -0
- package/dist/diagram-controls.js.map +1 -0
- package/dist/diagram-minimap.js +216 -0
- package/dist/diagram-minimap.js.map +1 -0
- package/dist/diagram.js +20 -0
- package/dist/diagram.js.map +1 -0
- package/dist/diff-viewer.js +2 -2
- package/dist/discussion-activity.js +4 -4
- package/dist/discussion-comment.js +4 -4
- package/dist/{discussion-time-BegaYfhf.js → discussion-time-DqykqvNy.js} +2 -2
- package/dist/{discussion-time-BegaYfhf.js.map → discussion-time-DqykqvNy.js.map} +1 -1
- package/dist/discussion.js +8 -8
- package/dist/{document-editor-BO7QPbO5.js → document-editor-Dc8JeFVB.js} +2 -2
- package/dist/{document-editor-BO7QPbO5.js.map → document-editor-Dc8JeFVB.js.map} +1 -1
- package/dist/document-editor.js +3 -3
- package/dist/draft-card.js +14 -4
- package/dist/draft-card.js.map +1 -1
- package/dist/dropdown-button.js +3 -2
- package/dist/dropdown-button.js.map +1 -1
- package/dist/erd.js +2021 -0
- package/dist/erd.js.map +1 -0
- package/dist/fab.js +4 -4
- package/dist/field.js +257 -43
- package/dist/field.js.map +1 -1
- package/dist/file-upload.js +38 -16
- package/dist/file-upload.js.map +1 -1
- package/dist/filter-bar.js +2 -2
- package/dist/flow.js +27 -970
- package/dist/flow.js.map +1 -1
- package/dist/focus-ring.js +2 -0
- package/dist/focus-ring.js.map +1 -1
- package/dist/{form-associated-D3Tn33s_.js → form-associated-BHbg72PG.js} +3 -1
- package/dist/{form-associated-D3Tn33s_.js.map → form-associated-BHbg72PG.js.map} +1 -1
- package/dist/{form-submitter-DWwv6K9-.js → form-submitter-beG1CXAn.js} +7 -1
- package/dist/{form-submitter-DWwv6K9-.js.map → form-submitter-beG1CXAn.js.map} +1 -1
- package/dist/form.js +3 -3
- package/dist/{generative-view-DmtpDobn.js → generative-view-BKlcuujw.js} +13 -13
- package/dist/generative-view-BKlcuujw.js.map +1 -0
- package/dist/generative-view.js +3 -3
- package/dist/geometry-INg82Lxq.js +305 -0
- package/dist/geometry-INg82Lxq.js.map +1 -0
- package/dist/history-YbTSQZHj.js +45 -0
- package/dist/history-YbTSQZHj.js.map +1 -0
- package/dist/host-CZK7xhzh.js +40 -0
- package/dist/host-CZK7xhzh.js.map +1 -0
- package/dist/html-editor.js +6 -6
- package/dist/{hyperlink-DhE9RlVS.js → hyperlink-DycWPKwU.js} +10 -1
- package/dist/hyperlink-DycWPKwU.js.map +1 -0
- package/dist/{i18n-controller-urcQKYGe.js → i18n-controller-DJHsE1YH.js} +2 -2
- package/dist/{i18n-controller-urcQKYGe.js.map → i18n-controller-DJHsE1YH.js.map} +1 -1
- package/dist/icon-button.js +11 -9
- package/dist/icon-button.js.map +1 -1
- package/dist/image.js +2 -2
- package/dist/index.js +42 -22
- package/dist/index.js.map +1 -1
- package/dist/inline-edit.js +2 -2
- package/dist/input.js +5 -5
- package/dist/json-viewer.js +2 -2
- package/dist/kanban.js +2 -2
- package/dist/kbd.js +2 -2
- package/dist/linear-progress.js +3 -3
- package/dist/link-button.js +9 -7
- package/dist/link-button.js.map +1 -1
- package/dist/list-item.js +2 -2
- package/dist/list.js +2 -2
- package/dist/listbox.js +4 -4
- package/dist/loader-full.js +17 -16
- package/dist/loader-full.js.map +1 -1
- package/dist/loader.js +51 -18
- package/dist/loader.js.map +1 -1
- package/dist/markdown-editor.js +6 -6
- package/dist/markers-BFmh1OCz.js +46 -0
- package/dist/markers-BFmh1OCz.js.map +1 -0
- package/dist/measure-controller-Dmc5hZKg.js +89 -0
- package/dist/measure-controller-Dmc5hZKg.js.map +1 -0
- package/dist/mention-input.js +7 -6
- package/dist/mention-input.js.map +1 -1
- package/dist/menu-item.js +3 -2
- package/dist/menu-item.js.map +1 -1
- package/dist/{menu-trigger-controller-DyLpTxM7.js → menu-trigger-controller-CEJq1ugC.js} +11 -14
- package/dist/menu-trigger-controller-CEJq1ugC.js.map +1 -0
- package/dist/menu.js +2 -2
- package/dist/modal.js +2 -2
- package/dist/navigation-bar.js +2 -2
- package/dist/navigation-drawer.js +2 -2
- package/dist/navigation-rail.js +2 -2
- package/dist/notification-center.js +3 -3
- package/dist/number-field.js +7 -6
- package/dist/number-field.js.map +1 -1
- package/dist/option.js +2 -2
- package/dist/page-header.js +2 -2
- package/dist/pagination.js +2 -2
- package/dist/password-field.js +6 -6
- package/dist/password-rules.js +2 -2
- package/dist/phone-field.js +6 -6
- package/dist/{picker-field-B4DtcJfL.js → picker-field-CUI05sWc.js} +3 -3
- package/dist/{picker-field-B4DtcJfL.js.map → picker-field-CUI05sWc.js.map} +1 -1
- package/dist/pin-input.js +6 -6
- package/dist/presence-indicator.js +2 -2
- package/dist/prompt-input.js +6 -6
- package/dist/radio-group.js +2 -1
- package/dist/radio-group.js.map +1 -1
- package/dist/radio.js +6 -6
- package/dist/radio.js.map +1 -1
- package/dist/rating.js +6 -5
- package/dist/rating.js.map +1 -1
- package/dist/redvars-loader.js +2 -2
- package/dist/{relative-time-BVQXLuHm.js → relative-time-BNxqvEbg.js} +13 -2
- package/dist/relative-time-BNxqvEbg.js.map +1 -0
- package/dist/relative-time.js +3 -3
- package/dist/resizable-panels.js +2 -2
- package/dist/{rich-text-input-DLICqof1.js → rich-text-input-N_hqnXej.js} +3 -3
- package/dist/{rich-text-input-DLICqof1.js.map → rich-text-input-N_hqnXej.js.map} +1 -1
- package/dist/ripple.js +2 -0
- package/dist/ripple.js.map +1 -1
- package/dist/{schema-hMt-NRLk.js → schema-Dy0z-80u.js} +2 -2
- package/dist/{schema-hMt-NRLk.js.map → schema-Dy0z-80u.js.map} +1 -1
- package/dist/search.js +5 -5
- package/dist/segmented-button-group.js +1 -1
- package/dist/select.js +8 -8
- package/dist/side-sheet.js +2 -2
- package/dist/signature-pad.js +6 -5
- package/dist/signature-pad.js.map +1 -1
- package/dist/slider.js +6 -5
- package/dist/slider.js.map +1 -1
- package/dist/snackbar.js +2 -2
- package/dist/sparkline.js +2 -2
- package/dist/split-button.js +109 -21
- package/dist/split-button.js.map +1 -1
- package/dist/src/__internal/ai/suggestion-controller.d.ts +2 -0
- package/dist/src/__internal/diagram/canvas-base.d.ts +105 -0
- package/dist/src/__internal/diagram/canvas-link.d.ts +21 -0
- package/dist/src/__internal/diagram/geometry.d.ts +49 -0
- package/dist/src/__internal/diagram/history.d.ts +17 -0
- package/dist/src/__internal/diagram/host.d.ts +45 -0
- package/dist/src/__internal/diagram/markers.d.ts +16 -0
- package/dist/src/__internal/diagram/measure-controller.d.ts +32 -0
- package/dist/src/__internal/diagram/motion.d.ts +22 -0
- package/dist/src/__internal/diagram/selection.d.ts +20 -0
- package/dist/src/__internal/diagram/types.d.ts +39 -0
- package/dist/src/__internal/diagram/viewport-controller.d.ts +89 -0
- package/dist/src/__internal/i18n/strings.d.ts +155 -0
- package/dist/src/__internal/menu-trigger-controller.d.ts +11 -8
- package/dist/src/__internal/toggle-base.d.ts +8 -0
- package/dist/src/__internal/utils/deprecate.d.ts +3 -3
- package/dist/src/__internal/utils/relative-time.d.ts +5 -0
- package/dist/src/accordion/accordion.d.ts +1 -0
- package/dist/src/ai-badge/ai-badge.d.ts +8 -0
- package/dist/src/button/button/button.d.ts +4 -0
- package/dist/src/chat-message/chat-message.d.ts +51 -10
- package/dist/src/chat-message/index.d.ts +1 -1
- package/dist/src/chat-thread/chat-event.d.ts +37 -0
- package/dist/src/chat-thread/chat-thread.d.ts +7 -4
- package/dist/src/chat-thread/index.d.ts +1 -0
- package/dist/src/code-editor/code-editor.d.ts +1 -0
- package/dist/src/date-picker/date-picker.d.ts +2 -0
- package/dist/src/dependency-map/dependency-map-layout.d.ts +48 -0
- package/dist/src/dependency-map/dependency-map.d.ts +241 -0
- package/dist/src/dependency-map/index.d.ts +2 -0
- package/dist/src/diagram/diagram.d.ts +300 -0
- package/dist/src/diagram/flow.d.ts +53 -0
- package/dist/src/diagram/index.d.ts +4 -0
- package/dist/src/diagram-controls/diagram-controls.d.ts +46 -0
- package/dist/src/diagram-controls/index.d.ts +1 -0
- package/dist/src/diagram-minimap/diagram-minimap.d.ts +39 -0
- package/dist/src/diagram-minimap/index.d.ts +1 -0
- package/dist/src/erd/erd-layout.d.ts +27 -0
- package/dist/src/erd/erd.d.ts +266 -0
- package/dist/src/erd/index.d.ts +2 -0
- package/dist/src/field/field.d.ts +38 -1
- package/dist/src/file-upload/file-upload.d.ts +3 -1
- package/dist/src/focus-ring/focus-ring.d.ts +2 -0
- package/dist/src/index.d.ts +17 -4
- package/dist/src/input/BaseField.d.ts +15 -1
- package/dist/src/input/BaseInput.d.ts +4 -0
- package/dist/src/menu/menu-item/menu-item.d.ts +1 -0
- package/dist/src/number-field/number-field.d.ts +4 -0
- package/dist/src/progress/base-progress.d.ts +3 -0
- package/dist/src/radio/radio-group.d.ts +1 -0
- package/dist/src/rating/rating.d.ts +1 -0
- package/dist/src/ripple/ripple.d.ts +2 -0
- package/dist/src/signature-pad/signature-pad.d.ts +1 -0
- package/dist/src/slider/slider.d.ts +1 -0
- package/dist/src/split-button/split-button.d.ts +7 -2
- package/dist/src/switch/switch.d.ts +1 -0
- package/dist/src/tabs/tab.d.ts +2 -0
- package/dist/src/tabs/tabs.d.ts +1 -0
- package/dist/src/textarea/textarea.d.ts +3 -0
- package/dist/src/time-picker/time-picker.d.ts +2 -0
- package/dist/src/transfer-list/transfer-list.d.ts +1 -0
- package/dist/src/tree-chart/index.d.ts +2 -0
- package/dist/src/tree-chart/tree-chart-layout.d.ts +49 -0
- package/dist/src/tree-chart/tree-chart.d.ts +221 -0
- package/dist/src/workflow/index.d.ts +2 -0
- package/dist/src/workflow/workflow-format.d.ts +5 -0
- package/dist/src/workflow/workflow-model.d.ts +194 -0
- package/dist/src/workflow/workflow.d.ts +313 -0
- package/dist/src/workflow-timeline/index.d.ts +1 -0
- package/dist/src/workflow-timeline/workflow-timeline.d.ts +41 -0
- package/dist/stat.js +2 -2
- package/dist/status-indicator.js +2 -2
- package/dist/step.js +2 -2
- package/dist/stepper.js +2 -2
- package/dist/{strings-DmbqMTfs.js → strings-DnYjGbbc.js} +169 -1
- package/dist/{strings-DmbqMTfs.js.map → strings-DnYjGbbc.js.map} +1 -1
- package/dist/sub-menu.js +2 -2
- package/dist/{suggestion-controller-CW17adxd.js → suggestion-controller-7YRQqkaI.js} +3 -1
- package/dist/{suggestion-controller-CW17adxd.js.map → suggestion-controller-7YRQqkaI.js.map} +1 -1
- package/dist/svg.js +2 -2
- package/dist/switch.js +6 -5
- package/dist/switch.js.map +1 -1
- package/dist/tab.js +1 -0
- package/dist/tab.js.map +1 -1
- package/dist/table.js +50 -11
- package/dist/table.js.map +1 -1
- package/dist/tabs.js +1 -0
- package/dist/tabs.js.map +1 -1
- package/dist/test/diagram-controls.test.d.ts +1 -0
- package/dist/test/diagram-geometry.test.d.ts +1 -0
- package/dist/test/diagram.test.d.ts +1 -0
- package/dist/test/erd.test.d.ts +1 -0
- package/dist/test/toggle-label.test.d.ts +1 -0
- package/dist/test/tree-chart.test.d.ts +1 -0
- package/dist/test/workflow-debug.test.d.ts +1 -0
- package/dist/test/workflow.test.d.ts +1 -0
- package/dist/textarea.js +13 -6
- package/dist/textarea.js.map +1 -1
- package/dist/time-field.js +7 -7
- package/dist/time-picker.js +4 -2
- package/dist/time-picker.js.map +1 -1
- package/dist/timeline-item.js +2 -2
- package/dist/timeline.js +2 -2
- package/dist/{toggle-base-BQO5pjrU.js → toggle-base-CXmFSp3b.js} +19 -3
- package/dist/toggle-base-CXmFSp3b.js.map +1 -0
- package/dist/tour.js +2 -2
- package/dist/transfer-list.js +6 -5
- package/dist/transfer-list.js.map +1 -1
- package/dist/{chart-base-B-gOg2Di.js → transform-CxeQFXXB.js} +9 -839
- package/dist/transform-CxeQFXXB.js.map +1 -0
- package/dist/tree-chart.js +1986 -0
- package/dist/tree-chart.js.map +1 -0
- package/dist/tree-item.js +2 -2
- package/dist/tree.js +2 -2
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/dist/typing-indicator.js +2 -2
- package/dist/url-field.js +6 -6
- package/dist/user-menu.js +3 -3
- package/dist/virtual-list.js +2 -2
- package/dist/workflow-format-BsyveyeC.js +34 -0
- package/dist/workflow-format-BsyveyeC.js.map +1 -0
- package/dist/workflow-model-CauduOG2.js +330 -0
- package/dist/workflow-model-CauduOG2.js.map +1 -0
- package/dist/workflow-timeline.js +354 -0
- package/dist/workflow-timeline.js.map +1 -0
- package/dist/workflow.js +3337 -0
- package/dist/workflow.js.map +1 -0
- package/dist/workspace-switcher.js +3 -3
- package/package.json +1 -1
- package/readme.md +44 -2
- package/src/LoaderUtils.ts +9 -2
- package/src/__internal/ai/suggestion-controller.ts +3 -1
- package/src/__internal/diagram/canvas-base.ts +410 -0
- package/src/__internal/diagram/canvas-link.ts +66 -0
- package/src/__internal/diagram/geometry.ts +372 -0
- package/src/__internal/diagram/history.ts +49 -0
- package/src/__internal/diagram/host.ts +76 -0
- package/src/__internal/diagram/markers.ts +56 -0
- package/src/__internal/diagram/measure-controller.ts +104 -0
- package/src/__internal/diagram/motion.ts +89 -0
- package/src/__internal/diagram/selection.ts +69 -0
- package/src/__internal/diagram/types.ts +56 -0
- package/src/__internal/diagram/viewport-controller.ts +494 -0
- package/src/__internal/i18n/strings.ts +207 -0
- package/src/__internal/menu-trigger-controller.ts +11 -15
- package/src/__internal/mixins/field.ts +3 -0
- package/src/__internal/mixins/form-associated.ts +2 -0
- package/src/__internal/mixins/form-submitter.ts +6 -0
- package/src/__internal/mixins/hyperlink.ts +10 -0
- package/src/__internal/toggle-base.ts +16 -0
- package/src/__internal/utils/deprecate.ts +5 -4
- package/src/__internal/utils/relative-time.ts +20 -0
- package/src/accordion/accordion.ts +1 -0
- package/src/ai-badge/ai-badge.scss +8 -0
- package/src/ai-badge/ai-badge.ts +21 -4
- package/src/button/base-button/base-button.ts +2 -0
- package/src/button/button/button-base.scss +9 -2
- package/src/button/button/button-layers.scss +3 -1
- package/src/button/button/button.ts +4 -0
- package/src/chat-message/chat-message.scss +72 -0
- package/src/chat-message/chat-message.ts +137 -18
- package/src/chat-message/index.ts +1 -0
- package/src/chat-thread/chat-event.scss +36 -0
- package/src/chat-thread/chat-event.ts +79 -0
- package/src/chat-thread/chat-thread.scss +4 -1
- package/src/chat-thread/chat-thread.ts +22 -6
- package/src/chat-thread/index.ts +1 -0
- package/src/code-editor/code-editor.ts +1 -0
- package/src/date-picker/date-picker.ts +2 -0
- package/src/dependency-map/dependency-map-layout.ts +505 -0
- package/src/dependency-map/dependency-map.scss +626 -0
- package/src/dependency-map/dependency-map.ts +1280 -0
- package/src/dependency-map/index.ts +16 -0
- package/src/diagram/diagram.scss +513 -0
- package/src/diagram/diagram.ts +1852 -0
- package/src/diagram/flow.ts +81 -0
- package/src/diagram/index.ts +44 -0
- package/src/diagram-controls/diagram-controls.scss +68 -0
- package/src/diagram-controls/diagram-controls.ts +255 -0
- package/src/diagram-controls/index.ts +1 -0
- package/src/diagram-minimap/diagram-minimap.scss +41 -0
- package/src/diagram-minimap/diagram-minimap.ts +149 -0
- package/src/diagram-minimap/index.ts +1 -0
- package/src/draft-card/draft-card.scss +16 -2
- package/src/dropdown-button/dropdown-button.ts +2 -1
- package/src/erd/erd-layout.ts +92 -0
- package/src/erd/erd.scss +636 -0
- package/src/erd/erd.ts +1728 -0
- package/src/erd/index.ts +17 -0
- package/src/field/field.scss +197 -23
- package/src/field/field.ts +109 -16
- package/src/file-upload/file-upload.scss +37 -10
- package/src/file-upload/file-upload.ts +3 -1
- package/src/focus-ring/focus-ring.ts +2 -0
- package/src/generative-view/catalog.generated.ts +12 -11
- package/src/index.ts +123 -3
- package/src/input/BaseField.ts +45 -2
- package/src/input/BaseInput.ts +4 -1
- package/src/loader.ts +29 -0
- package/src/mention-input/mention-input.scss +2 -0
- package/src/menu/menu-item/menu-item.ts +1 -0
- package/src/number-field/number-field.ts +4 -0
- package/src/progress/base-progress.ts +3 -0
- package/src/radio/radio-group.ts +1 -0
- package/src/radio/radio.ts +1 -1
- package/src/rating/rating.ts +1 -0
- package/src/ripple/ripple.ts +2 -0
- package/src/signature-pad/signature-pad.ts +1 -0
- package/src/slider/slider.ts +1 -0
- package/src/split-button/split-button-colors.scss +9 -0
- package/src/split-button/split-button-sizes.scss +32 -5
- package/src/split-button/split-button.scss +61 -8
- package/src/split-button/split-button.ts +15 -8
- package/src/switch/switch.ts +1 -0
- package/src/table/table.scss +57 -9
- package/src/table/table.ts +3 -1
- package/src/tabs/tab.ts +2 -0
- package/src/tabs/tabs.ts +1 -0
- package/src/textarea/textarea.scss +2 -0
- package/src/textarea/textarea.ts +8 -0
- package/src/time-picker/time-picker.ts +2 -0
- package/src/transfer-list/transfer-list.ts +1 -0
- package/src/tree-chart/index.ts +13 -0
- package/src/tree-chart/tree-chart-layout.ts +185 -0
- package/src/tree-chart/tree-chart.scss +377 -0
- package/src/tree-chart/tree-chart.ts +1170 -0
- package/src/workflow/index.ts +35 -0
- package/src/workflow/workflow-format.ts +29 -0
- package/src/workflow/workflow-model.ts +583 -0
- package/src/workflow/workflow.scss +1164 -0
- package/src/workflow/workflow.ts +2674 -0
- package/src/workflow-timeline/index.ts +1 -0
- package/src/workflow-timeline/workflow-timeline.scss +128 -0
- package/src/workflow-timeline/workflow-timeline.ts +238 -0
- package/dist/BaseField-CAog9TIc.js.map +0 -1
- package/dist/BaseInput-CcMfg1Y2.js.map +0 -1
- package/dist/base-button-Do2TUy8M.js.map +0 -1
- package/dist/base-progress-BiLlZVHJ.js.map +0 -1
- package/dist/cartesian-chart-C-f1frt0.js.map +0 -1
- package/dist/chart-base-B-gOg2Di.js.map +0 -1
- package/dist/generative-view-DmtpDobn.js.map +0 -1
- package/dist/hyperlink-DhE9RlVS.js.map +0 -1
- package/dist/menu-trigger-controller-DyLpTxM7.js.map +0 -1
- package/dist/relative-time-BVQXLuHm.js.map +0 -1
- package/dist/src/flow/flow.d.ts +0 -178
- package/dist/src/flow/index.d.ts +0 -2
- package/dist/toggle-base-BQO5pjrU.js.map +0 -1
- package/src/button/button-group/readme.md +0 -23
- package/src/flow/flow.scss +0 -215
- package/src/flow/flow.ts +0 -958
- package/src/flow/index.ts +0 -10
- /package/dist/test/{flow.test.d.ts → dependency-map.test.d.ts} +0 -0
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
import IndividualComponent from '@/IndividualComponent.js';
|
|
2
|
+
import { deprecate } from '@/__internal/utils/deprecate.js';
|
|
3
|
+
import { Diagram } from './diagram.js';
|
|
4
|
+
import type {
|
|
5
|
+
DiagramChangeDetail,
|
|
6
|
+
DiagramChangeReason,
|
|
7
|
+
DiagramConnectDetail,
|
|
8
|
+
DiagramConnector,
|
|
9
|
+
DiagramDeleteDetail,
|
|
10
|
+
DiagramEdge,
|
|
11
|
+
DiagramEdgeType,
|
|
12
|
+
DiagramHandlePosition,
|
|
13
|
+
DiagramIntent,
|
|
14
|
+
DiagramMarker,
|
|
15
|
+
DiagramNode,
|
|
16
|
+
DiagramNodeMoveDetail,
|
|
17
|
+
DiagramPoint,
|
|
18
|
+
DiagramPort,
|
|
19
|
+
DiagramSelectDetail,
|
|
20
|
+
DiagramStartPosition,
|
|
21
|
+
DiagramStrokeVariant,
|
|
22
|
+
DiagramView,
|
|
23
|
+
DiagramViewportDetail,
|
|
24
|
+
} from './diagram.js';
|
|
25
|
+
|
|
26
|
+
/**
|
|
27
|
+
* The deprecated name of the diagram canvas: `wc-flow` before 4.0, now `wc-diagram`. It works
|
|
28
|
+
* like `wc-diagram` and warns once on the console. Removed in 5.0.
|
|
29
|
+
*
|
|
30
|
+
* It has no tag in its JSDoc on purpose, so the custom elements manifest, the docs and the
|
|
31
|
+
* React, Vue and Angular bindings list only `wc-diagram`. Its own module (`dist/flow.js`) keeps
|
|
32
|
+
* the lazy loader's one-element-per-module rule.
|
|
33
|
+
*
|
|
34
|
+
* @deprecated Use `Diagram` (`wc-diagram`).
|
|
35
|
+
*/
|
|
36
|
+
@IndividualComponent
|
|
37
|
+
export class Flow extends Diagram {
|
|
38
|
+
override connectedCallback() {
|
|
39
|
+
super.connectedCallback();
|
|
40
|
+
deprecate('wc-flow', 'the `wc-flow` tag', '`wc-diagram`');
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
/** @deprecated Use `DiagramStrokeVariant`. */
|
|
45
|
+
export type FlowStrokeVariant = DiagramStrokeVariant;
|
|
46
|
+
/** @deprecated Use `DiagramHandlePosition`. */
|
|
47
|
+
export type FlowHandlePosition = DiagramHandlePosition;
|
|
48
|
+
/** @deprecated Use `DiagramEdgeType`. */
|
|
49
|
+
export type FlowEdgeType = DiagramEdgeType;
|
|
50
|
+
/** @deprecated Use `DiagramMarker`. */
|
|
51
|
+
export type FlowMarker = DiagramMarker;
|
|
52
|
+
/** @deprecated Use `DiagramIntent`. */
|
|
53
|
+
export type FlowIntent = DiagramIntent;
|
|
54
|
+
/** @deprecated Use `DiagramConnector`. */
|
|
55
|
+
export type FlowConnector = DiagramConnector;
|
|
56
|
+
/** @deprecated Use `DiagramStartPosition`. */
|
|
57
|
+
export type FlowStartPosition = DiagramStartPosition;
|
|
58
|
+
/** @deprecated Use `DiagramPoint`. */
|
|
59
|
+
export type FlowPoint = DiagramPoint;
|
|
60
|
+
/** @deprecated Use `DiagramView`. */
|
|
61
|
+
export type FlowView = DiagramView;
|
|
62
|
+
/** @deprecated Use `DiagramPort`. */
|
|
63
|
+
export type FlowPort = DiagramPort;
|
|
64
|
+
/** @deprecated Use `DiagramNode`. */
|
|
65
|
+
export type FlowNode = DiagramNode;
|
|
66
|
+
/** @deprecated Use `DiagramEdge`. */
|
|
67
|
+
export type FlowEdge = DiagramEdge;
|
|
68
|
+
/** @deprecated Use `DiagramNodeMoveDetail`. */
|
|
69
|
+
export type FlowNodeMoveDetail = DiagramNodeMoveDetail;
|
|
70
|
+
/** @deprecated Use `DiagramSelectDetail`. */
|
|
71
|
+
export type FlowSelectDetail = DiagramSelectDetail;
|
|
72
|
+
/** @deprecated Use `DiagramConnectDetail`. */
|
|
73
|
+
export type FlowConnectDetail = DiagramConnectDetail;
|
|
74
|
+
/** @deprecated Use `DiagramChangeReason`. */
|
|
75
|
+
export type FlowChangeReason = DiagramChangeReason;
|
|
76
|
+
/** @deprecated Use `DiagramChangeDetail`. */
|
|
77
|
+
export type FlowChangeDetail = DiagramChangeDetail;
|
|
78
|
+
/** @deprecated Use `DiagramDeleteDetail`. */
|
|
79
|
+
export type FlowDeleteDetail = DiagramDeleteDetail;
|
|
80
|
+
/** @deprecated Use `DiagramViewportDetail`. */
|
|
81
|
+
export type FlowViewportDetail = DiagramViewportDetail;
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
export { Diagram } from './diagram.js';
|
|
2
|
+
export type {
|
|
3
|
+
DiagramChangeDetail,
|
|
4
|
+
DiagramChangeReason,
|
|
5
|
+
DiagramConnectDetail,
|
|
6
|
+
DiagramConnector,
|
|
7
|
+
DiagramDeleteDetail,
|
|
8
|
+
DiagramEdge,
|
|
9
|
+
DiagramEdgeType,
|
|
10
|
+
DiagramHandlePosition,
|
|
11
|
+
DiagramIntent,
|
|
12
|
+
DiagramMarker,
|
|
13
|
+
DiagramNode,
|
|
14
|
+
DiagramNodeMoveDetail,
|
|
15
|
+
DiagramPoint,
|
|
16
|
+
DiagramPort,
|
|
17
|
+
DiagramSelectDetail,
|
|
18
|
+
DiagramStartPosition,
|
|
19
|
+
DiagramStrokeVariant,
|
|
20
|
+
DiagramView,
|
|
21
|
+
DiagramViewportDetail,
|
|
22
|
+
} from './diagram.js';
|
|
23
|
+
// Deprecated: wc-flow is the old name of wc-diagram, kept until 5.0.
|
|
24
|
+
export { Flow } from './flow.js';
|
|
25
|
+
export type {
|
|
26
|
+
FlowChangeDetail,
|
|
27
|
+
FlowChangeReason,
|
|
28
|
+
FlowConnectDetail,
|
|
29
|
+
FlowConnector,
|
|
30
|
+
FlowDeleteDetail,
|
|
31
|
+
FlowEdge,
|
|
32
|
+
FlowEdgeType,
|
|
33
|
+
FlowHandlePosition,
|
|
34
|
+
FlowIntent,
|
|
35
|
+
FlowMarker,
|
|
36
|
+
FlowNode,
|
|
37
|
+
FlowNodeMoveDetail,
|
|
38
|
+
FlowPort,
|
|
39
|
+
FlowSelectDetail,
|
|
40
|
+
FlowStartPosition,
|
|
41
|
+
FlowStrokeVariant,
|
|
42
|
+
FlowView,
|
|
43
|
+
FlowViewportDetail,
|
|
44
|
+
} from './flow.js';
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
@use '../../scss/mixin';
|
|
2
|
+
|
|
3
|
+
@include mixin.base-styles;
|
|
4
|
+
|
|
5
|
+
:host {
|
|
6
|
+
display: inline-block;
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
.bar {
|
|
10
|
+
display: flex;
|
|
11
|
+
align-items: center;
|
|
12
|
+
gap: 2px;
|
|
13
|
+
padding: 4px;
|
|
14
|
+
background: var(--color-surface-container-lowest);
|
|
15
|
+
border: 1px solid var(--color-outline-variant);
|
|
16
|
+
border-radius: var(--shape-corner-full);
|
|
17
|
+
box-shadow: var(--elevation-level2);
|
|
18
|
+
|
|
19
|
+
&.vertical {
|
|
20
|
+
flex-direction: column;
|
|
21
|
+
border-radius: var(--shape-corner-extra-large);
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
.zoom-level {
|
|
26
|
+
@include mixin.reset-button-styles;
|
|
27
|
+
|
|
28
|
+
min-inline-size: 52px;
|
|
29
|
+
block-size: 32px;
|
|
30
|
+
padding: 0 6px;
|
|
31
|
+
font-size: 12px;
|
|
32
|
+
font-weight: 500;
|
|
33
|
+
font-variant-numeric: tabular-nums;
|
|
34
|
+
color: var(--color-on-surface-variant);
|
|
35
|
+
border-radius: var(--shape-corner-full);
|
|
36
|
+
cursor: pointer;
|
|
37
|
+
|
|
38
|
+
&:hover {
|
|
39
|
+
background: color-mix(in srgb, var(--color-on-surface) 8%, transparent);
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
&:focus-visible {
|
|
43
|
+
outline: 2px solid var(--color-primary);
|
|
44
|
+
outline-offset: 1px;
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
.separator {
|
|
49
|
+
inline-size: 1px;
|
|
50
|
+
block-size: 20px;
|
|
51
|
+
margin: 0 4px;
|
|
52
|
+
background: var(--color-outline-variant);
|
|
53
|
+
|
|
54
|
+
.vertical & {
|
|
55
|
+
inline-size: 20px;
|
|
56
|
+
block-size: 1px;
|
|
57
|
+
margin: 4px 0;
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
// In a narrow canvas (see `container-name: diagram` in wc-diagram), keep zoom, fit and home only.
|
|
62
|
+
// Keyboard shortcuts still undo, redo and reset the zoom.
|
|
63
|
+
@container diagram (max-width: 480px) {
|
|
64
|
+
.bar:not(.vertical) .zoom-level,
|
|
65
|
+
.bar:not(.vertical) .history {
|
|
66
|
+
display: none;
|
|
67
|
+
}
|
|
68
|
+
}
|
|
@@ -0,0 +1,255 @@
|
|
|
1
|
+
import { html, LitElement, nothing } from 'lit';
|
|
2
|
+
import { property, query, state } from 'lit/decorators.js';
|
|
3
|
+
import { classMap } from 'lit/directives/class-map.js';
|
|
4
|
+
import IndividualComponent from '@/IndividualComponent.js';
|
|
5
|
+
import { I18nController } from '@/__internal/i18n/i18n-controller.js';
|
|
6
|
+
import { RovingFocusController } from '@/__internal/controllers/roving-focus-controller.js';
|
|
7
|
+
import { DiagramCanvasLink } from '@/__internal/diagram/canvas-link.js';
|
|
8
|
+
import type { Menu } from '@/menu/menu/menu.js';
|
|
9
|
+
import styles from './diagram-controls.scss';
|
|
10
|
+
|
|
11
|
+
/** Zoom levels offered in the zoom menu. */
|
|
12
|
+
const ZOOM_PRESETS = [0.5, 1, 2];
|
|
13
|
+
|
|
14
|
+
/**
|
|
15
|
+
* @label Diagram controls
|
|
16
|
+
* @tag wc-diagram-controls
|
|
17
|
+
* @rawTag diagram-controls
|
|
18
|
+
* @summary Zoom, fit, back-to-start and undo buttons for a diagram canvas such as `wc-diagram`.
|
|
19
|
+
*
|
|
20
|
+
* @overview
|
|
21
|
+
* <p>Put it in a canvas's <code>controls</code> slot, or anywhere on the page with <code>for</code> set
|
|
22
|
+
* to the canvas's id. It shows zoom out, the zoom level, zoom in, fit to content and back to start;
|
|
23
|
+
* undo and redo join them when the canvas is <code>editable</code>. The zoom level opens a menu with
|
|
24
|
+
* 50%, 100%, 200%, fit, zoom to selection and back to start.</p>
|
|
25
|
+
* <p>It is a <code>toolbar</code>: Tab reaches it once and the arrow keys move between its buttons.</p>
|
|
26
|
+
*
|
|
27
|
+
* @example
|
|
28
|
+
* ```html
|
|
29
|
+
* <wc-diagram style="height: 400px">
|
|
30
|
+
* <wc-diagram-controls slot="controls"></wc-diagram-controls>
|
|
31
|
+
* </wc-diagram>
|
|
32
|
+
* ```
|
|
33
|
+
* @tags data
|
|
34
|
+
*/
|
|
35
|
+
@IndividualComponent
|
|
36
|
+
export class DiagramControls extends LitElement {
|
|
37
|
+
// ── Static
|
|
38
|
+
|
|
39
|
+
static styles = [styles];
|
|
40
|
+
|
|
41
|
+
// ── Properties
|
|
42
|
+
|
|
43
|
+
/** Id of the canvas to control, when the controls are not inside it. */
|
|
44
|
+
@property({ type: String })
|
|
45
|
+
for = '';
|
|
46
|
+
|
|
47
|
+
/** Lays the buttons out in a row or a column. */
|
|
48
|
+
@property({ type: String, reflect: true })
|
|
49
|
+
orientation: 'horizontal' | 'vertical' = 'horizontal';
|
|
50
|
+
|
|
51
|
+
/** Leaves out undo and redo even when the canvas is editable. */
|
|
52
|
+
@property({ type: Boolean, attribute: 'hide-history' })
|
|
53
|
+
hideHistory = false;
|
|
54
|
+
|
|
55
|
+
// ── State
|
|
56
|
+
|
|
57
|
+
@state()
|
|
58
|
+
private _zoom = 1;
|
|
59
|
+
|
|
60
|
+
@state()
|
|
61
|
+
private _canUndo = false;
|
|
62
|
+
|
|
63
|
+
@state()
|
|
64
|
+
private _canRedo = false;
|
|
65
|
+
|
|
66
|
+
@state()
|
|
67
|
+
private _editable = false;
|
|
68
|
+
|
|
69
|
+
// ── Private fields
|
|
70
|
+
|
|
71
|
+
@query('wc-menu')
|
|
72
|
+
private readonly _menu?: Menu;
|
|
73
|
+
|
|
74
|
+
@query('.zoom-level')
|
|
75
|
+
private readonly _zoomButton?: HTMLElement;
|
|
76
|
+
|
|
77
|
+
private readonly i18n = new I18nController(this);
|
|
78
|
+
|
|
79
|
+
private readonly roving = new RovingFocusController(this, {
|
|
80
|
+
items: () =>
|
|
81
|
+
Array.from(
|
|
82
|
+
this.renderRoot.querySelectorAll<HTMLElement>(
|
|
83
|
+
'.bar > wc-icon-button:not([disabled]), .bar > .zoom-level',
|
|
84
|
+
),
|
|
85
|
+
),
|
|
86
|
+
orientation: () => this.orientation,
|
|
87
|
+
});
|
|
88
|
+
|
|
89
|
+
private readonly link = new DiagramCanvasLink(this, {
|
|
90
|
+
forId: () => this.for,
|
|
91
|
+
onSync: () => this.sync(),
|
|
92
|
+
});
|
|
93
|
+
|
|
94
|
+
// ── Lifecycle
|
|
95
|
+
|
|
96
|
+
protected updated(changed: Map<string, unknown>) {
|
|
97
|
+
if (changed.has('for') && changed.get('for') !== undefined)
|
|
98
|
+
this.link.attach();
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
// ── Private methods
|
|
102
|
+
|
|
103
|
+
private sync() {
|
|
104
|
+
const c = this.link.canvas;
|
|
105
|
+
if (!c) return;
|
|
106
|
+
this._zoom = c.view.zoom;
|
|
107
|
+
this._canUndo = c.canUndo;
|
|
108
|
+
this._canRedo = c.canRedo;
|
|
109
|
+
this._editable = c.editable;
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
private percent(value: number) {
|
|
113
|
+
return new Intl.NumberFormat(this.i18n.locale, {
|
|
114
|
+
style: 'percent',
|
|
115
|
+
maximumFractionDigits: 0,
|
|
116
|
+
}).format(value);
|
|
117
|
+
}
|
|
118
|
+
|
|
119
|
+
private openMenu() {
|
|
120
|
+
const menu = this._menu;
|
|
121
|
+
if (!menu || !this._zoomButton) return;
|
|
122
|
+
if (menu.open) {
|
|
123
|
+
menu.close();
|
|
124
|
+
return;
|
|
125
|
+
}
|
|
126
|
+
menu.anchorElement = this._zoomButton;
|
|
127
|
+
menu.show('first');
|
|
128
|
+
}
|
|
129
|
+
|
|
130
|
+
private onMenuActivate = (event: Event) => {
|
|
131
|
+
const item = (
|
|
132
|
+
event as CustomEvent<{ item: HTMLElement & { value: string } }>
|
|
133
|
+
).detail?.item;
|
|
134
|
+
const c = this.link.canvas;
|
|
135
|
+
if (!item || !c) return;
|
|
136
|
+
const { value } = item;
|
|
137
|
+
if (value === 'fit') c.fit();
|
|
138
|
+
else if (value === 'selection') c.zoomToSelection();
|
|
139
|
+
else if (value === 'home') c.home();
|
|
140
|
+
else c.zoomTo(Number(value));
|
|
141
|
+
};
|
|
142
|
+
|
|
143
|
+
// ── Render
|
|
144
|
+
|
|
145
|
+
protected render() {
|
|
146
|
+
const c = this.link.canvas;
|
|
147
|
+
const showHistory = this._editable && !this.hideHistory;
|
|
148
|
+
const level = this.percent(this._zoom);
|
|
149
|
+
return html`
|
|
150
|
+
<div
|
|
151
|
+
class=${classMap({
|
|
152
|
+
bar: true,
|
|
153
|
+
vertical: this.orientation === 'vertical',
|
|
154
|
+
})}
|
|
155
|
+
role="toolbar"
|
|
156
|
+
aria-label=${this.i18n.t('diagramControls')}
|
|
157
|
+
aria-orientation=${this.orientation}
|
|
158
|
+
@keydown=${this.roving.handleKeyDown}
|
|
159
|
+
@focusin=${this.roving.handleFocusIn}
|
|
160
|
+
>
|
|
161
|
+
<wc-icon-button
|
|
162
|
+
variant="text"
|
|
163
|
+
shape="round"
|
|
164
|
+
aria-label=${this.i18n.t('diagramZoomOut')}
|
|
165
|
+
tooltip=${this.i18n.t('diagramZoomOut')}
|
|
166
|
+
@click=${() => c?.zoomOut()}
|
|
167
|
+
><wc-icon name="remove"></wc-icon
|
|
168
|
+
></wc-icon-button>
|
|
169
|
+
<button
|
|
170
|
+
class="zoom-level"
|
|
171
|
+
type="button"
|
|
172
|
+
aria-haspopup="menu"
|
|
173
|
+
aria-label=${this.i18n.t('diagramZoomLevel')(level)}
|
|
174
|
+
@click=${() => this.openMenu()}
|
|
175
|
+
>
|
|
176
|
+
${level}
|
|
177
|
+
</button>
|
|
178
|
+
<wc-icon-button
|
|
179
|
+
variant="text"
|
|
180
|
+
shape="round"
|
|
181
|
+
aria-label=${this.i18n.t('diagramZoomIn')}
|
|
182
|
+
tooltip=${this.i18n.t('diagramZoomIn')}
|
|
183
|
+
@click=${() => c?.zoomIn()}
|
|
184
|
+
><wc-icon name="add"></wc-icon
|
|
185
|
+
></wc-icon-button>
|
|
186
|
+
<wc-icon-button
|
|
187
|
+
variant="text"
|
|
188
|
+
shape="round"
|
|
189
|
+
aria-label=${this.i18n.t('diagramFit')}
|
|
190
|
+
tooltip=${this.i18n.t('diagramFit')}
|
|
191
|
+
@click=${() => c?.fit()}
|
|
192
|
+
><wc-icon name="fit_screen"></wc-icon
|
|
193
|
+
></wc-icon-button>
|
|
194
|
+
<wc-icon-button
|
|
195
|
+
variant="text"
|
|
196
|
+
shape="round"
|
|
197
|
+
aria-label=${this.i18n.t('diagramBackToStart')}
|
|
198
|
+
tooltip=${this.i18n.t('diagramBackToStart')}
|
|
199
|
+
@click=${() => c?.home()}
|
|
200
|
+
><wc-icon name="home"></wc-icon
|
|
201
|
+
></wc-icon-button>
|
|
202
|
+
${showHistory
|
|
203
|
+
? html`<span class="separator history" role="separator"></span>
|
|
204
|
+
<wc-icon-button
|
|
205
|
+
class="history"
|
|
206
|
+
variant="text"
|
|
207
|
+
shape="round"
|
|
208
|
+
aria-label=${this.i18n.t('diagramUndo')}
|
|
209
|
+
tooltip=${this.i18n.t('diagramUndo')}
|
|
210
|
+
?disabled=${!this._canUndo}
|
|
211
|
+
@click=${() => c?.undo()}
|
|
212
|
+
><wc-icon name="undo"></wc-icon
|
|
213
|
+
></wc-icon-button>
|
|
214
|
+
<wc-icon-button
|
|
215
|
+
class="history"
|
|
216
|
+
variant="text"
|
|
217
|
+
shape="round"
|
|
218
|
+
aria-label=${this.i18n.t('diagramRedo')}
|
|
219
|
+
tooltip=${this.i18n.t('diagramRedo')}
|
|
220
|
+
?disabled=${!this._canRedo}
|
|
221
|
+
@click=${() => c?.redo()}
|
|
222
|
+
><wc-icon name="redo"></wc-icon
|
|
223
|
+
></wc-icon-button>`
|
|
224
|
+
: nothing}
|
|
225
|
+
</div>
|
|
226
|
+
<wc-menu placement="top-start" @menu-item-activate=${this.onMenuActivate}>
|
|
227
|
+
${ZOOM_PRESETS.map(
|
|
228
|
+
z =>
|
|
229
|
+
html`<wc-menu-item value=${String(z)}
|
|
230
|
+
>${this.percent(z)}</wc-menu-item
|
|
231
|
+
>`,
|
|
232
|
+
)}
|
|
233
|
+
<wc-divider></wc-divider>
|
|
234
|
+
<wc-menu-item value="fit">
|
|
235
|
+
<wc-icon slot="start" name="fit_screen"></wc-icon>${this.i18n.t(
|
|
236
|
+
'diagramFit',
|
|
237
|
+
)}
|
|
238
|
+
<span slot="trailing-supporting-text">Shift+1</span>
|
|
239
|
+
</wc-menu-item>
|
|
240
|
+
<wc-menu-item value="selection">
|
|
241
|
+
<wc-icon slot="start" name="select"></wc-icon>${this.i18n.t(
|
|
242
|
+
'diagramZoomToSelection',
|
|
243
|
+
)}
|
|
244
|
+
<span slot="trailing-supporting-text">Shift+2</span>
|
|
245
|
+
</wc-menu-item>
|
|
246
|
+
<wc-menu-item value="home">
|
|
247
|
+
<wc-icon slot="start" name="home"></wc-icon>${this.i18n.t(
|
|
248
|
+
'diagramBackToStart',
|
|
249
|
+
)}
|
|
250
|
+
<span slot="trailing-supporting-text">Home</span>
|
|
251
|
+
</wc-menu-item>
|
|
252
|
+
</wc-menu>
|
|
253
|
+
`;
|
|
254
|
+
}
|
|
255
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { DiagramControls } from './diagram-controls.js';
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
@use '../../scss/mixin';
|
|
2
|
+
|
|
3
|
+
@include mixin.base-styles;
|
|
4
|
+
|
|
5
|
+
:host {
|
|
6
|
+
display: block;
|
|
7
|
+
inline-size: var(--diagram-minimap-width, 200px);
|
|
8
|
+
block-size: var(--diagram-minimap-height, 132px);
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
.frame {
|
|
12
|
+
inline-size: 100%;
|
|
13
|
+
block-size: 100%;
|
|
14
|
+
overflow: hidden;
|
|
15
|
+
background: var(--color-surface-container-lowest);
|
|
16
|
+
border: 1px solid var(--color-outline-variant);
|
|
17
|
+
border-radius: var(--shape-corner-medium);
|
|
18
|
+
box-shadow: var(--elevation-level2);
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
svg {
|
|
22
|
+
display: block;
|
|
23
|
+
inline-size: 100%;
|
|
24
|
+
block-size: 100%;
|
|
25
|
+
cursor: pointer;
|
|
26
|
+
touch-action: none;
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
.item {
|
|
30
|
+
fill: var(--color-outline-variant);
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
.item.selected {
|
|
34
|
+
fill: var(--color-primary);
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
.view {
|
|
38
|
+
fill: color-mix(in srgb, var(--color-primary) 10%, transparent);
|
|
39
|
+
stroke: var(--color-primary);
|
|
40
|
+
stroke-width: 1.5;
|
|
41
|
+
}
|
|
@@ -0,0 +1,149 @@
|
|
|
1
|
+
import { html, LitElement, svg } from 'lit';
|
|
2
|
+
import { property, state } from 'lit/decorators.js';
|
|
3
|
+
import IndividualComponent from '@/IndividualComponent.js';
|
|
4
|
+
import { I18nController } from '@/__internal/i18n/i18n-controller.js';
|
|
5
|
+
import { DiagramCanvasLink } from '@/__internal/diagram/canvas-link.js';
|
|
6
|
+
import type { DiagramOverview } from '@/__internal/diagram/host.js';
|
|
7
|
+
import { boundsOf, inflateRect } from '@/__internal/diagram/geometry.js';
|
|
8
|
+
import styles from './diagram-minimap.scss';
|
|
9
|
+
|
|
10
|
+
/**
|
|
11
|
+
* @label Diagram minimap
|
|
12
|
+
* @tag wc-diagram-minimap
|
|
13
|
+
* @rawTag diagram-minimap
|
|
14
|
+
* @summary A small overview of a diagram canvas that shows where the view is and moves it.
|
|
15
|
+
*
|
|
16
|
+
* @overview
|
|
17
|
+
* <p>Put it in a canvas's <code>minimap</code> slot, or anywhere with <code>for</code> set to the
|
|
18
|
+
* canvas's id. It draws every node as a box and the part of the canvas in view as a rectangle,
|
|
19
|
+
* wherever the view has wandered. Click to fly there, or drag to move the view.</p>
|
|
20
|
+
* <p>The minimap is a pointer shortcut; keyboard users pan the canvas itself with the arrow keys.</p>
|
|
21
|
+
*
|
|
22
|
+
* @example
|
|
23
|
+
* ```html
|
|
24
|
+
* <wc-diagram style="height: 400px">
|
|
25
|
+
* <wc-diagram-minimap slot="minimap"></wc-diagram-minimap>
|
|
26
|
+
* </wc-diagram>
|
|
27
|
+
* ```
|
|
28
|
+
*
|
|
29
|
+
* @cssprop --diagram-minimap-width - Width. Defaults to 200px.
|
|
30
|
+
* @cssprop --diagram-minimap-height - Height. Defaults to 132px.
|
|
31
|
+
* @tags data
|
|
32
|
+
*/
|
|
33
|
+
@IndividualComponent
|
|
34
|
+
export class DiagramMinimap extends LitElement {
|
|
35
|
+
// ── Static
|
|
36
|
+
|
|
37
|
+
static styles = [styles];
|
|
38
|
+
|
|
39
|
+
// ── Properties
|
|
40
|
+
|
|
41
|
+
/** Id of the canvas to show, when the minimap is not inside it. */
|
|
42
|
+
@property({ type: String })
|
|
43
|
+
for = '';
|
|
44
|
+
|
|
45
|
+
// ── State
|
|
46
|
+
|
|
47
|
+
@state()
|
|
48
|
+
private _overview?: DiagramOverview;
|
|
49
|
+
|
|
50
|
+
// ── Private fields
|
|
51
|
+
|
|
52
|
+
private readonly i18n = new I18nController(this);
|
|
53
|
+
|
|
54
|
+
private readonly link = new DiagramCanvasLink(this, {
|
|
55
|
+
forId: () => this.for,
|
|
56
|
+
onSync: () => {
|
|
57
|
+
this._overview = this.link.canvas?._diagramOverview();
|
|
58
|
+
},
|
|
59
|
+
});
|
|
60
|
+
|
|
61
|
+
private drag?: { pointerId: number; svg: SVGSVGElement };
|
|
62
|
+
|
|
63
|
+
// ── Lifecycle
|
|
64
|
+
|
|
65
|
+
protected updated(changed: Map<string, unknown>) {
|
|
66
|
+
if (changed.has('for') && changed.get('for') !== undefined)
|
|
67
|
+
this.link.attach();
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
// ── Private methods
|
|
71
|
+
|
|
72
|
+
private toCanvas(svgEl: SVGSVGElement, clientX: number, clientY: number) {
|
|
73
|
+
const matrix = svgEl.getScreenCTM();
|
|
74
|
+
if (!matrix) return undefined;
|
|
75
|
+
const point = new DOMPoint(clientX, clientY).matrixTransform(
|
|
76
|
+
matrix.inverse(),
|
|
77
|
+
);
|
|
78
|
+
return { x: point.x, y: point.y };
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
private onPointerDown = (event: PointerEvent) => {
|
|
82
|
+
if (event.button !== 0) return;
|
|
83
|
+
const svgEl = event.currentTarget as SVGSVGElement;
|
|
84
|
+
const p = this.toCanvas(svgEl, event.clientX, event.clientY);
|
|
85
|
+
if (!p) return;
|
|
86
|
+
event.preventDefault();
|
|
87
|
+
this.link.canvas?.centerOn(p.x, p.y);
|
|
88
|
+
this.drag = { pointerId: event.pointerId, svg: svgEl };
|
|
89
|
+
try {
|
|
90
|
+
svgEl.setPointerCapture(event.pointerId);
|
|
91
|
+
} catch {
|
|
92
|
+
// Synthetic pointers cannot be captured.
|
|
93
|
+
}
|
|
94
|
+
};
|
|
95
|
+
|
|
96
|
+
private onPointerMove = (event: PointerEvent) => {
|
|
97
|
+
const { drag } = this;
|
|
98
|
+
if (!drag || event.pointerId !== drag.pointerId) return;
|
|
99
|
+
const p = this.toCanvas(drag.svg, event.clientX, event.clientY);
|
|
100
|
+
if (p) this.link.canvas?.centerOn(p.x, p.y, true);
|
|
101
|
+
};
|
|
102
|
+
|
|
103
|
+
private onPointerUp = (event: PointerEvent) => {
|
|
104
|
+
if (event.pointerId === this.drag?.pointerId) this.drag = undefined;
|
|
105
|
+
};
|
|
106
|
+
|
|
107
|
+
// ── Render
|
|
108
|
+
|
|
109
|
+
protected render() {
|
|
110
|
+
const o = this._overview;
|
|
111
|
+
const area = o ? boundsOf([...o.items, o.visible]) : undefined;
|
|
112
|
+
if (!o || !area) {
|
|
113
|
+
return html`<div
|
|
114
|
+
class="frame"
|
|
115
|
+
role="img"
|
|
116
|
+
aria-label=${this.i18n.t('diagramMinimap')}
|
|
117
|
+
></div>`;
|
|
118
|
+
}
|
|
119
|
+
const world = inflateRect(area, Math.max(area.width, area.height) * 0.04);
|
|
120
|
+
const v = o.visible;
|
|
121
|
+
return html`
|
|
122
|
+
<div class="frame">
|
|
123
|
+
<svg
|
|
124
|
+
viewBox="${world.x} ${world.y} ${world.width} ${world.height}"
|
|
125
|
+
preserveAspectRatio="xMidYMid meet"
|
|
126
|
+
role="img"
|
|
127
|
+
aria-label=${this.i18n.t('diagramMinimap')}
|
|
128
|
+
@pointerdown=${this.onPointerDown}
|
|
129
|
+
@pointermove=${this.onPointerMove}
|
|
130
|
+
@pointerup=${this.onPointerUp}
|
|
131
|
+
@pointercancel=${this.onPointerUp}
|
|
132
|
+
>
|
|
133
|
+
${o.items.map(
|
|
134
|
+
r =>
|
|
135
|
+
svg`<rect class=${r.selected ? 'item selected' : 'item'} x=${r.x} y=${r.y} width=${r.width} height=${r.height} rx=${Math.min(r.width, r.height) * 0.12}></rect>`,
|
|
136
|
+
)}
|
|
137
|
+
<rect
|
|
138
|
+
class="view"
|
|
139
|
+
x=${v.x}
|
|
140
|
+
y=${v.y}
|
|
141
|
+
width=${v.width}
|
|
142
|
+
height=${v.height}
|
|
143
|
+
vector-effect="non-scaling-stroke"
|
|
144
|
+
></rect>
|
|
145
|
+
</svg>
|
|
146
|
+
</div>
|
|
147
|
+
`;
|
|
148
|
+
}
|
|
149
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { DiagramMinimap } from './diagram-minimap.js';
|
|
@@ -7,6 +7,7 @@
|
|
|
7
7
|
}
|
|
8
8
|
|
|
9
9
|
.card {
|
|
10
|
+
container: draft-card / inline-size;
|
|
10
11
|
overflow: hidden;
|
|
11
12
|
background: var(--color-surface);
|
|
12
13
|
border: 1px solid var(--color-outline-variant);
|
|
@@ -62,6 +63,14 @@
|
|
|
62
63
|
padding: var(--spacing-075, 0.375rem) var(--spacing-200, 1rem);
|
|
63
64
|
}
|
|
64
65
|
|
|
66
|
+
// In a narrow card, such as a thread on a phone, each label sits above its value.
|
|
67
|
+
@container draft-card (inline-size < 26rem) {
|
|
68
|
+
.field {
|
|
69
|
+
grid-template-columns: minmax(0, 1fr);
|
|
70
|
+
gap: 0;
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
|
|
65
74
|
dt {
|
|
66
75
|
color: var(--color-on-surface-variant);
|
|
67
76
|
}
|
|
@@ -112,10 +121,15 @@ dd {
|
|
|
112
121
|
}
|
|
113
122
|
}
|
|
114
123
|
|
|
124
|
+
// Done is a quiet record of what happened, not an alert: the check carries the color.
|
|
115
125
|
.done {
|
|
116
|
-
color: var(--color-on-
|
|
117
|
-
background: var(--color-
|
|
126
|
+
color: var(--color-on-surface);
|
|
127
|
+
background: var(--color-surface-container-low);
|
|
118
128
|
font-weight: 500;
|
|
129
|
+
|
|
130
|
+
wc-icon {
|
|
131
|
+
--icon-color: var(--color-success);
|
|
132
|
+
}
|
|
119
133
|
}
|
|
120
134
|
|
|
121
135
|
.done-text {
|
|
@@ -128,7 +128,8 @@ export class DropdownButton extends LitElement {
|
|
|
128
128
|
color=${this.color}
|
|
129
129
|
trailing-icon
|
|
130
130
|
?disabled=${this.disabled}
|
|
131
|
-
|
|
131
|
+
aria-haspopup="menu"
|
|
132
|
+
aria-expanded=${String(this._trigger.open)}
|
|
132
133
|
@click=${this._trigger.handleTriggerClick}
|
|
133
134
|
@keydown=${this._trigger.handleTriggerKeyDown}
|
|
134
135
|
>
|