@ixfx/components 0.2.4 → 0.2.5
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/bundle/index.d.ts +130 -130
- package/bundle/index.d.ts.map +1 -1
- package/bundle/index.js +2196 -2196
- package/bundle/index.js.map +1 -1
- package/dist/ac-text.d.ts +97 -0
- package/dist/ac-text.d.ts.map +1 -0
- package/dist/ac-text.js +484 -0
- package/dist/ac-text.js.map +1 -0
- package/dist/{button/button-styles.js → button-DgKUzE5o.js} +49 -3
- package/dist/button-DgKUzE5o.js.map +1 -0
- package/dist/button.d.ts +21 -0
- package/dist/button.d.ts.map +1 -0
- package/dist/button.js +3 -0
- package/dist/checkbox.d.ts +27 -57
- package/dist/checkbox.d.ts.map +1 -1
- package/dist/checkbox.js +74 -88
- package/dist/checkbox.js.map +1 -1
- package/dist/chunk-pbuEa-1d.js +13 -0
- package/dist/colour-C3MQIjFJ-BJV-QC-3.js +4138 -0
- package/dist/colour-C3MQIjFJ-BJV-QC-3.js.map +1 -0
- package/dist/colour-picker-Bw-AZoWx.js +922 -0
- package/dist/colour-picker-Bw-AZoWx.js.map +1 -0
- package/dist/colour-picker.d.ts +2 -0
- package/dist/colour-picker.js +2 -0
- package/dist/crumbs.d.ts +92 -0
- package/dist/crumbs.d.ts.map +1 -0
- package/dist/crumbs.js +789 -0
- package/dist/crumbs.js.map +1 -0
- package/dist/data-display.d.ts +23 -18
- package/dist/data-display.d.ts.map +1 -1
- package/dist/data-display.js +82 -108
- package/dist/data-display.js.map +1 -1
- package/dist/decorate-BZbkqIhA.js +9 -0
- package/dist/defaults-FEZaGiYZ.js +38 -0
- package/dist/defaults-FEZaGiYZ.js.map +1 -0
- package/dist/dist-By5URG0Y.js +1290 -0
- package/dist/dist-By5URG0Y.js.map +1 -0
- package/dist/dist-D7kJgnSE.js +1039 -0
- package/dist/dist-D7kJgnSE.js.map +1 -0
- package/dist/editable-label.d.ts +71 -0
- package/dist/editable-label.d.ts.map +1 -0
- package/dist/editable-label.js +279 -0
- package/dist/editable-label.js.map +1 -0
- package/dist/hex-editor-Gib1Grg2.d.ts +131 -0
- package/dist/hex-editor-Gib1Grg2.d.ts.map +1 -0
- package/dist/hex-editor-Wd6ZtZA2.js +1147 -0
- package/dist/hex-editor-Wd6ZtZA2.js.map +1 -0
- package/dist/hex.d.ts +2 -0
- package/dist/hex.js +2 -0
- package/dist/highlight-CAjwQ4GE.js +50 -0
- package/dist/highlight-CAjwQ4GE.js.map +1 -0
- package/dist/icon-BR5aTIiP.js +100 -0
- package/dist/icon-BR5aTIiP.js.map +1 -0
- package/dist/icon-DQKdfR7U.d.ts +36 -0
- package/dist/icon-DQKdfR7U.d.ts.map +1 -0
- package/dist/icons.d.ts +3 -0
- package/dist/icons.js +9 -0
- package/dist/icons.js.map +1 -0
- package/dist/incr-search-BjCNClnC.js +311 -0
- package/dist/incr-search-BjCNClnC.js.map +1 -0
- package/dist/incr-search.d.ts +2 -0
- package/dist/incr-search.js +3 -0
- package/dist/index-B1hNR7Z9.d.ts +36 -0
- package/dist/index-B1hNR7Z9.d.ts.map +1 -0
- package/dist/index-C5dK8RZa.d.ts +23 -0
- package/dist/index-C5dK8RZa.d.ts.map +1 -0
- package/dist/index-C9iBN908.d.ts +160 -0
- package/dist/index-C9iBN908.d.ts.map +1 -0
- package/dist/index-CPVcTTXo.d.ts +396 -0
- package/dist/index-CPVcTTXo.d.ts.map +1 -0
- package/dist/index-CQxanqXF.d.ts +183 -0
- package/dist/index-CQxanqXF.d.ts.map +1 -0
- package/dist/index-CpbBI3n7.d.ts +1239 -0
- package/dist/index-CpbBI3n7.d.ts.map +1 -0
- package/dist/index.d.ts +422 -53
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +5729 -54
- package/dist/index.js.map +1 -1
- package/dist/interaction-CQDQJf2Q.js +1 -0
- package/dist/keyboard-De_vOHLg.js +20 -0
- package/dist/keyboard-De_vOHLg.js.map +1 -0
- package/dist/labelled-input-base-DS6-6C0r.js +155 -0
- package/dist/labelled-input-base-DS6-6C0r.js.map +1 -0
- package/dist/labelled-input-base-DnRh4reU.d.ts +43 -0
- package/dist/labelled-input-base-DnRh4reU.d.ts.map +1 -0
- package/dist/labelled-radial-input.d.ts +34 -0
- package/dist/labelled-radial-input.d.ts.map +1 -0
- package/dist/labelled-radial-input.js +188 -0
- package/dist/labelled-radial-input.js.map +1 -0
- package/dist/labelled-range-input.d.ts +2 -0
- package/dist/{labelled-range-input/labelled-range-input.js → labelled-range-input.js} +40 -45
- package/dist/labelled-range-input.js.map +1 -0
- package/dist/led.d.ts +21 -16
- package/dist/led.d.ts.map +1 -1
- package/dist/led.js +70 -78
- package/dist/led.js.map +1 -1
- package/dist/menu-BV6UFx_z.js +813 -0
- package/dist/menu-BV6UFx_z.js.map +1 -0
- package/dist/menu-item-Cikacp4F.d.ts +128 -0
- package/dist/menu-item-Cikacp4F.d.ts.map +1 -0
- package/dist/menu-item-DEzL_Yjk.js +766 -0
- package/dist/menu-item-DEzL_Yjk.js.map +1 -0
- package/dist/menu.d.ts +3 -0
- package/dist/menu.js +3 -0
- package/dist/miller.d.ts +324 -0
- package/dist/miller.d.ts.map +1 -0
- package/dist/miller.js +1343 -0
- package/dist/miller.js.map +1 -0
- package/dist/narrowed-text.d.ts +72 -0
- package/dist/narrowed-text.d.ts.map +1 -0
- package/dist/narrowed-text.js +571 -0
- package/dist/narrowed-text.js.map +1 -0
- package/dist/panel.d.ts +43 -0
- package/dist/panel.d.ts.map +1 -0
- package/dist/{panel/panel.js → panel.js} +82 -91
- package/dist/panel.js.map +1 -0
- package/dist/plots.d.ts +2 -0
- package/dist/plots.js +2 -0
- package/dist/polar-pad.d.ts +67 -0
- package/dist/polar-pad.d.ts.map +1 -0
- package/dist/polar-pad.js +537 -0
- package/dist/polar-pad.js.map +1 -0
- package/dist/popup-Ddx9LCzY.js +24 -0
- package/dist/popup-Ddx9LCzY.js.map +1 -0
- package/dist/prominence-CreDBdCs.js +98 -0
- package/dist/prominence-CreDBdCs.js.map +1 -0
- package/dist/radial-input-CNJ8asY2.js +849 -0
- package/dist/radial-input-CNJ8asY2.js.map +1 -0
- package/dist/radial-input-xSTd4kEz.d.ts +70 -0
- package/dist/radial-input-xSTd4kEz.d.ts.map +1 -0
- package/dist/radial-input.d.ts +2 -0
- package/dist/radial-input.js +2 -0
- package/dist/range-input.d.ts +43 -0
- package/dist/range-input.d.ts.map +1 -0
- package/dist/{range-input/range-input.js → range-input.js} +155 -168
- package/dist/range-input.js.map +1 -0
- package/dist/range.d.ts +28 -0
- package/dist/range.d.ts.map +1 -0
- package/dist/range.js +136 -0
- package/dist/range.js.map +1 -0
- package/dist/registry-CZEB1YI9.js +21 -0
- package/dist/registry-CZEB1YI9.js.map +1 -0
- package/dist/selecthorizontal.d.ts +13 -8
- package/dist/selecthorizontal.d.ts.map +1 -1
- package/dist/selecthorizontal.js +19 -23
- package/dist/selecthorizontal.js.map +1 -1
- package/dist/snap-container.d.ts +50 -0
- package/dist/snap-container.d.ts.map +1 -0
- package/dist/snap-container.js +297 -0
- package/dist/snap-container.js.map +1 -0
- package/dist/{split-layout/split-layout.d.ts → split-layout.d.ts} +30 -25
- package/dist/split-layout.d.ts.map +1 -0
- package/dist/split-layout.js +545 -0
- package/dist/split-layout.js.map +1 -0
- package/dist/style.css +133 -0
- package/dist/swipe.d.ts +48 -0
- package/dist/swipe.d.ts.map +1 -0
- package/dist/swipe.js +204 -0
- package/dist/swipe.js.map +1 -0
- package/dist/tab-list-CFF7uSYH.d.ts +66 -0
- package/dist/tab-list-CFF7uSYH.d.ts.map +1 -0
- package/dist/tabs.d.ts +2 -0
- package/dist/tabs.js +203 -0
- package/dist/tabs.js.map +1 -0
- package/dist/tickled-controller-Cq1Va0rR.d.ts +218 -0
- package/dist/tickled-controller-Cq1Va0rR.d.ts.map +1 -0
- package/dist/tickled-styles-Bg3QbcrD.js +327 -0
- package/dist/tickled-styles-Bg3QbcrD.js.map +1 -0
- package/dist/timeline-DBWJsSjd.js +1748 -0
- package/dist/timeline-DBWJsSjd.js.map +1 -0
- package/dist/timeline.d.ts +2 -0
- package/dist/timeline.js +2 -0
- package/dist/{styles/tooltip.js → tooltip-DMxmBNky.js} +6 -2
- package/dist/tooltip-DMxmBNky.js.map +1 -0
- package/dist/tooltip-kfUBWYVB.d.ts +26 -0
- package/dist/tooltip-kfUBWYVB.d.ts.map +1 -0
- package/dist/tree-component-CQpoPo4s.d.ts +326 -0
- package/dist/tree-component-CQpoPo4s.d.ts.map +1 -0
- package/dist/tree-data-model-DGvRVOFY.js +190 -0
- package/dist/tree-data-model-DGvRVOFY.js.map +1 -0
- package/dist/tree.d.ts +100 -0
- package/dist/tree.d.ts.map +1 -0
- package/dist/tree.js +1144 -0
- package/dist/tree.js.map +1 -0
- package/dist/types-BKaqnpwx.d.ts +8 -0
- package/dist/types-BKaqnpwx.d.ts.map +1 -0
- package/dist/xy-axis-BANbgrI5.js +6243 -0
- package/dist/xy-axis-BANbgrI5.js.map +1 -0
- package/dist/xy-axis-CIFok7MF.d.ts +141 -0
- package/dist/xy-axis-CIFok7MF.d.ts.map +1 -0
- package/dist/xy-pad.d.ts +74 -110
- package/dist/xy-pad.d.ts.map +1 -1
- package/dist/xy-pad.js +300 -320
- package/dist/xy-pad.js.map +1 -1
- package/package.json +10 -18
- package/dist/ac-text/ac-text.d.ts +0 -99
- package/dist/ac-text/ac-text.d.ts.map +0 -1
- package/dist/ac-text/ac-text.js +0 -571
- package/dist/ac-text/ac-text.js.map +0 -1
- package/dist/button/button-styles.d.ts +0 -2
- package/dist/button/button-styles.d.ts.map +0 -1
- package/dist/button/button-styles.js.map +0 -1
- package/dist/button/button.d.ts +0 -16
- package/dist/button/button.d.ts.map +0 -1
- package/dist/button/button.js +0 -58
- package/dist/button/button.js.map +0 -1
- package/dist/button/radio-group.d.ts +0 -44
- package/dist/button/radio-group.d.ts.map +0 -1
- package/dist/button/radio-group.js +0 -385
- package/dist/button/radio-group.js.map +0 -1
- package/dist/button/split-button.d.ts +0 -59
- package/dist/button/split-button.d.ts.map +0 -1
- package/dist/button/split-button.js +0 -480
- package/dist/button/split-button.js.map +0 -1
- package/dist/button/types.d.ts +0 -18
- package/dist/button/types.d.ts.map +0 -1
- package/dist/button/types.js +0 -2
- package/dist/button/types.js.map +0 -1
- package/dist/colour-picker/colour-picker-popup.d.ts +0 -102
- package/dist/colour-picker/colour-picker-popup.d.ts.map +0 -1
- package/dist/colour-picker/colour-picker-popup.js +0 -399
- package/dist/colour-picker/colour-picker-popup.js.map +0 -1
- package/dist/colour-picker/colour-picker.d.ts +0 -100
- package/dist/colour-picker/colour-picker.d.ts.map +0 -1
- package/dist/colour-picker/colour-picker.js +0 -567
- package/dist/colour-picker/colour-picker.js.map +0 -1
- package/dist/colour-picker/index.d.ts +0 -4
- package/dist/colour-picker/index.d.ts.map +0 -1
- package/dist/colour-picker/index.js +0 -3
- package/dist/colour-picker/index.js.map +0 -1
- package/dist/colour-picker/styles.d.ts +0 -2
- package/dist/colour-picker/styles.d.ts.map +0 -1
- package/dist/colour-picker/styles.js +0 -139
- package/dist/colour-picker/styles.js.map +0 -1
- package/dist/colour-picker/types.d.ts +0 -33
- package/dist/colour-picker/types.d.ts.map +0 -1
- package/dist/colour-picker/types.js +0 -2
- package/dist/colour-picker/types.js.map +0 -1
- package/dist/colour-picker/util.d.ts +0 -15
- package/dist/colour-picker/util.d.ts.map +0 -1
- package/dist/colour-picker/util.js +0 -35
- package/dist/colour-picker/util.js.map +0 -1
- package/dist/common/searchable.d.ts +0 -9
- package/dist/common/searchable.d.ts.map +0 -1
- package/dist/common/searchable.js +0 -9
- package/dist/common/searchable.js.map +0 -1
- package/dist/common/tree-component.d.ts +0 -172
- package/dist/common/tree-component.d.ts.map +0 -1
- package/dist/common/tree-component.js +0 -8
- package/dist/common/tree-component.js.map +0 -1
- package/dist/common/tree-data-model.d.ts +0 -100
- package/dist/common/tree-data-model.d.ts.map +0 -1
- package/dist/common/tree-data-model.js +0 -207
- package/dist/common/tree-data-model.js.map +0 -1
- package/dist/common/tree-item.d.ts +0 -7
- package/dist/common/tree-item.d.ts.map +0 -1
- package/dist/common/tree-item.js +0 -2
- package/dist/common/tree-item.js.map +0 -1
- package/dist/common/types.d.ts +0 -69
- package/dist/common/types.d.ts.map +0 -1
- package/dist/common/types.js +0 -6
- package/dist/common/types.js.map +0 -1
- package/dist/crumbs/crumb-navigation.d.ts +0 -96
- package/dist/crumbs/crumb-navigation.d.ts.map +0 -1
- package/dist/crumbs/crumb-navigation.js +0 -911
- package/dist/crumbs/crumb-navigation.js.map +0 -1
- package/dist/crumbs/crumb-path-controller.d.ts +0 -18
- package/dist/crumbs/crumb-path-controller.d.ts.map +0 -1
- package/dist/crumbs/crumb-path-controller.js +0 -81
- package/dist/crumbs/crumb-path-controller.js.map +0 -1
- package/dist/crumbs/crumb-path.d.ts +0 -65
- package/dist/crumbs/crumb-path.d.ts.map +0 -1
- package/dist/crumbs/crumb-path.js +0 -691
- package/dist/crumbs/crumb-path.js.map +0 -1
- package/dist/editable-label/editable-label.d.ts +0 -98
- package/dist/editable-label/editable-label.d.ts.map +0 -1
- package/dist/editable-label/editable-label.js +0 -348
- package/dist/editable-label/editable-label.js.map +0 -1
- package/dist/editable-label/editable-number.d.ts +0 -96
- package/dist/editable-label/editable-number.d.ts.map +0 -1
- package/dist/editable-label/editable-number.js +0 -702
- package/dist/editable-label/editable-number.js.map +0 -1
- package/dist/hex/colour.d.ts +0 -6
- package/dist/hex/colour.d.ts.map +0 -1
- package/dist/hex/colour.js +0 -33
- package/dist/hex/colour.js.map +0 -1
- package/dist/hex/data.d.ts +0 -18
- package/dist/hex/data.d.ts.map +0 -1
- package/dist/hex/data.js +0 -61
- package/dist/hex/data.js.map +0 -1
- package/dist/hex/diff.d.ts +0 -14
- package/dist/hex/diff.d.ts.map +0 -1
- package/dist/hex/diff.js +0 -31
- package/dist/hex/diff.js.map +0 -1
- package/dist/hex/hex-editor.d.ts +0 -101
- package/dist/hex/hex-editor.d.ts.map +0 -1
- package/dist/hex/hex-editor.js +0 -894
- package/dist/hex/hex-editor.js.map +0 -1
- package/dist/hex/selection.d.ts +0 -11
- package/dist/hex/selection.d.ts.map +0 -1
- package/dist/hex/selection.js +0 -218
- package/dist/hex/selection.js.map +0 -1
- package/dist/hex/types.d.ts +0 -34
- package/dist/hex/types.d.ts.map +0 -1
- package/dist/hex/types.js +0 -4
- package/dist/hex/types.js.map +0 -1
- package/dist/icons/defaults.d.ts +0 -27
- package/dist/icons/defaults.d.ts.map +0 -1
- package/dist/icons/defaults.js +0 -34
- package/dist/icons/defaults.js.map +0 -1
- package/dist/icons/icon.d.ts +0 -31
- package/dist/icons/icon.d.ts.map +0 -1
- package/dist/icons/icon.js +0 -125
- package/dist/icons/icon.js.map +0 -1
- package/dist/icons/index.d.ts +0 -5
- package/dist/icons/index.d.ts.map +0 -1
- package/dist/icons/index.js +0 -6
- package/dist/icons/index.js.map +0 -1
- package/dist/icons/registry.d.ts +0 -11
- package/dist/icons/registry.d.ts.map +0 -1
- package/dist/icons/registry.js +0 -17
- package/dist/icons/registry.js.map +0 -1
- package/dist/incr-search/ac-adapter.d.ts +0 -18
- package/dist/incr-search/ac-adapter.d.ts.map +0 -1
- package/dist/incr-search/ac-adapter.js +0 -29
- package/dist/incr-search/ac-adapter.js.map +0 -1
- package/dist/incr-search/controller-miller.d.ts +0 -9
- package/dist/incr-search/controller-miller.d.ts.map +0 -1
- package/dist/incr-search/controller-miller.js +0 -8
- package/dist/incr-search/controller-miller.js.map +0 -1
- package/dist/incr-search/controller-tree.d.ts +0 -55
- package/dist/incr-search/controller-tree.d.ts.map +0 -1
- package/dist/incr-search/controller-tree.js +0 -106
- package/dist/incr-search/controller-tree.js.map +0 -1
- package/dist/incr-search/element-search.d.ts +0 -15
- package/dist/incr-search/element-search.d.ts.map +0 -1
- package/dist/incr-search/element-search.js +0 -82
- package/dist/incr-search/element-search.js.map +0 -1
- package/dist/incr-search/fuzzy.d.ts +0 -3
- package/dist/incr-search/fuzzy.d.ts.map +0 -1
- package/dist/incr-search/fuzzy.js +0 -37
- package/dist/incr-search/fuzzy.js.map +0 -1
- package/dist/incr-search/highlight.d.ts +0 -5
- package/dist/incr-search/highlight.d.ts.map +0 -1
- package/dist/incr-search/highlight.js +0 -54
- package/dist/incr-search/highlight.js.map +0 -1
- package/dist/incr-search/incr-search.d.ts +0 -3
- package/dist/incr-search/incr-search.d.ts.map +0 -1
- package/dist/incr-search/incr-search.js +0 -73
- package/dist/incr-search/incr-search.js.map +0 -1
- package/dist/incr-search/index.d.ts +0 -12
- package/dist/incr-search/index.d.ts.map +0 -1
- package/dist/incr-search/index.js +0 -8
- package/dist/incr-search/index.js.map +0 -1
- package/dist/incr-search/types.d.ts +0 -59
- package/dist/incr-search/types.d.ts.map +0 -1
- package/dist/incr-search/types.js +0 -2
- package/dist/incr-search/types.js.map +0 -1
- package/dist/interaction/index.d.ts +0 -10
- package/dist/interaction/index.d.ts.map +0 -1
- package/dist/interaction/index.js +0 -10
- package/dist/interaction/index.js.map +0 -1
- package/dist/interaction/tickled-controller.d.ts +0 -186
- package/dist/interaction/tickled-controller.d.ts.map +0 -1
- package/dist/interaction/tickled-controller.js +0 -256
- package/dist/interaction/tickled-controller.js.map +0 -1
- package/dist/interaction/tickled-styles.d.ts +0 -53
- package/dist/interaction/tickled-styles.d.ts.map +0 -1
- package/dist/interaction/tickled-styles.js +0 -106
- package/dist/interaction/tickled-styles.js.map +0 -1
- package/dist/interaction/tree-keyboard-controller.d.ts +0 -30
- package/dist/interaction/tree-keyboard-controller.d.ts.map +0 -1
- package/dist/interaction/tree-keyboard-controller.js +0 -105
- package/dist/interaction/tree-keyboard-controller.js.map +0 -1
- package/dist/keyboard.d.ts +0 -16
- package/dist/keyboard.d.ts.map +0 -1
- package/dist/keyboard.js +0 -22
- package/dist/keyboard.js.map +0 -1
- package/dist/labelled-radial-input/index.d.ts +0 -2
- package/dist/labelled-radial-input/index.d.ts.map +0 -1
- package/dist/labelled-radial-input/index.js +0 -2
- package/dist/labelled-radial-input/index.js.map +0 -1
- package/dist/labelled-radial-input/labelled-radial-input.d.ts +0 -77
- package/dist/labelled-radial-input/labelled-radial-input.d.ts.map +0 -1
- package/dist/labelled-radial-input/labelled-radial-input.js +0 -214
- package/dist/labelled-radial-input/labelled-radial-input.js.map +0 -1
- package/dist/labelled-range-input/index.d.ts +0 -2
- package/dist/labelled-range-input/index.d.ts.map +0 -1
- package/dist/labelled-range-input/index.js +0 -2
- package/dist/labelled-range-input/index.js.map +0 -1
- package/dist/labelled-range-input/labelled-range-input.d.ts +0 -80
- package/dist/labelled-range-input/labelled-range-input.d.ts.map +0 -1
- package/dist/labelled-range-input/labelled-range-input.js.map +0 -1
- package/dist/menu/index.d.ts +0 -14
- package/dist/menu/index.d.ts.map +0 -1
- package/dist/menu/index.js +0 -13
- package/dist/menu/index.js.map +0 -1
- package/dist/menu/menu-bar.d.ts +0 -23
- package/dist/menu/menu-bar.d.ts.map +0 -1
- package/dist/menu/menu-bar.js +0 -110
- package/dist/menu/menu-bar.js.map +0 -1
- package/dist/menu/menu-check-item.d.ts +0 -33
- package/dist/menu/menu-check-item.d.ts.map +0 -1
- package/dist/menu/menu-check-item.js +0 -175
- package/dist/menu/menu-check-item.js.map +0 -1
- package/dist/menu/menu-command-controller.d.ts +0 -14
- package/dist/menu/menu-command-controller.d.ts.map +0 -1
- package/dist/menu/menu-command-controller.js +0 -22
- package/dist/menu/menu-command-controller.js.map +0 -1
- package/dist/menu/menu-container.d.ts +0 -36
- package/dist/menu/menu-container.d.ts.map +0 -1
- package/dist/menu/menu-container.js +0 -351
- package/dist/menu/menu-container.js.map +0 -1
- package/dist/menu/menu-from-tree.d.ts +0 -17
- package/dist/menu/menu-from-tree.d.ts.map +0 -1
- package/dist/menu/menu-from-tree.js +0 -103
- package/dist/menu/menu-from-tree.js.map +0 -1
- package/dist/menu/menu-header.d.ts +0 -12
- package/dist/menu/menu-header.d.ts.map +0 -1
- package/dist/menu/menu-header.js +0 -36
- package/dist/menu/menu-header.js.map +0 -1
- package/dist/menu/menu-item.d.ts +0 -41
- package/dist/menu/menu-item.d.ts.map +0 -1
- package/dist/menu/menu-item.js +0 -240
- package/dist/menu/menu-item.js.map +0 -1
- package/dist/menu/menu-radio-group.d.ts +0 -24
- package/dist/menu/menu-radio-group.d.ts.map +0 -1
- package/dist/menu/menu-radio-group.js +0 -71
- package/dist/menu/menu-radio-group.js.map +0 -1
- package/dist/menu/menu-radio-item.d.ts +0 -22
- package/dist/menu/menu-radio-item.d.ts.map +0 -1
- package/dist/menu/menu-radio-item.js +0 -116
- package/dist/menu/menu-radio-item.js.map +0 -1
- package/dist/menu/menu-separator.d.ts +0 -11
- package/dist/menu/menu-separator.d.ts.map +0 -1
- package/dist/menu/menu-separator.js +0 -29
- package/dist/menu/menu-separator.js.map +0 -1
- package/dist/menu/menu-sub-trigger.d.ts +0 -46
- package/dist/menu/menu-sub-trigger.d.ts.map +0 -1
- package/dist/menu/menu-sub-trigger.js +0 -302
- package/dist/menu/menu-sub-trigger.js.map +0 -1
- package/dist/menu/menu-trigger.d.ts +0 -57
- package/dist/menu/menu-trigger.d.ts.map +0 -1
- package/dist/menu/menu-trigger.js +0 -351
- package/dist/menu/menu-trigger.js.map +0 -1
- package/dist/miller/index.d.ts +0 -5
- package/dist/miller/index.d.ts.map +0 -1
- package/dist/miller/index.js +0 -5
- package/dist/miller/index.js.map +0 -1
- package/dist/miller/miller-base.d.ts +0 -184
- package/dist/miller/miller-base.d.ts.map +0 -1
- package/dist/miller/miller-base.js +0 -1249
- package/dist/miller/miller-base.js.map +0 -1
- package/dist/miller/miller-list.d.ts +0 -30
- package/dist/miller/miller-list.d.ts.map +0 -1
- package/dist/miller/miller-list.js +0 -192
- package/dist/miller/miller-list.js.map +0 -1
- package/dist/miller/miller-tree-controller.d.ts +0 -58
- package/dist/miller/miller-tree-controller.d.ts.map +0 -1
- package/dist/miller/miller-tree-controller.js +0 -134
- package/dist/miller/miller-tree-controller.js.map +0 -1
- package/dist/miller/types.d.ts +0 -63
- package/dist/miller/types.d.ts.map +0 -1
- package/dist/miller/types.js +0 -6
- package/dist/miller/types.js.map +0 -1
- package/dist/mixins/labelled-input-base.d.ts +0 -38
- package/dist/mixins/labelled-input-base.d.ts.map +0 -1
- package/dist/mixins/labelled-input-base.js +0 -171
- package/dist/mixins/labelled-input-base.js.map +0 -1
- package/dist/mixins/labelled-input-util.d.ts +0 -3
- package/dist/mixins/labelled-input-util.d.ts.map +0 -1
- package/dist/mixins/labelled-input-util.js +0 -10
- package/dist/mixins/labelled-input-util.js.map +0 -1
- package/dist/my-element.d.ts +0 -14
- package/dist/my-element.d.ts.map +0 -1
- package/dist/my-element.js +0 -44
- package/dist/my-element.js.map +0 -1
- package/dist/narrowed-text/index.d.ts +0 -3
- package/dist/narrowed-text/index.d.ts.map +0 -1
- package/dist/narrowed-text/index.js +0 -3
- package/dist/narrowed-text/index.js.map +0 -1
- package/dist/narrowed-text/narrowed-text.d.ts +0 -48
- package/dist/narrowed-text/narrowed-text.d.ts.map +0 -1
- package/dist/narrowed-text/narrowed-text.js +0 -668
- package/dist/narrowed-text/narrowed-text.js.map +0 -1
- package/dist/narrowed-text/types.d.ts +0 -20
- package/dist/narrowed-text/types.d.ts.map +0 -1
- package/dist/narrowed-text/types.js +0 -2
- package/dist/narrowed-text/types.js.map +0 -1
- package/dist/panel/panel-group.d.ts +0 -23
- package/dist/panel/panel-group.d.ts.map +0 -1
- package/dist/panel/panel-group.js +0 -109
- package/dist/panel/panel-group.js.map +0 -1
- package/dist/panel/panel.d.ts +0 -39
- package/dist/panel/panel.d.ts.map +0 -1
- package/dist/panel/panel.js.map +0 -1
- package/dist/plots/colour-map.d.ts +0 -31
- package/dist/plots/colour-map.d.ts.map +0 -1
- package/dist/plots/colour-map.js +0 -133
- package/dist/plots/colour-map.js.map +0 -1
- package/dist/plots/data.d.ts +0 -27
- package/dist/plots/data.d.ts.map +0 -1
- package/dist/plots/data.js +0 -47
- package/dist/plots/data.js.map +0 -1
- package/dist/plots/single-axis.d.ts +0 -41
- package/dist/plots/single-axis.d.ts.map +0 -1
- package/dist/plots/single-axis.js +0 -428
- package/dist/plots/single-axis.js.map +0 -1
- package/dist/plots/svg-utils.d.ts +0 -12
- package/dist/plots/svg-utils.d.ts.map +0 -1
- package/dist/plots/svg-utils.js +0 -64
- package/dist/plots/svg-utils.js.map +0 -1
- package/dist/plots/xy-axis.d.ts +0 -42
- package/dist/plots/xy-axis.d.ts.map +0 -1
- package/dist/plots/xy-axis.js +0 -307
- package/dist/plots/xy-axis.js.map +0 -1
- package/dist/polar-pad/polar-pad.d.ts +0 -132
- package/dist/polar-pad/polar-pad.d.ts.map +0 -1
- package/dist/polar-pad/polar-pad.js +0 -598
- package/dist/polar-pad/polar-pad.js.map +0 -1
- package/dist/radial-input/radial-input.d.ts +0 -45
- package/dist/radial-input/radial-input.d.ts.map +0 -1
- package/dist/radial-input/radial-input.js +0 -692
- package/dist/radial-input/radial-input.js.map +0 -1
- package/dist/radial-input/svg-utils.d.ts +0 -147
- package/dist/radial-input/svg-utils.d.ts.map +0 -1
- package/dist/radial-input/svg-utils.js +0 -346
- package/dist/radial-input/svg-utils.js.map +0 -1
- package/dist/radial-input/types.d.ts +0 -25
- package/dist/radial-input/types.d.ts.map +0 -1
- package/dist/radial-input/types.js +0 -5
- package/dist/radial-input/types.js.map +0 -1
- package/dist/range/range-multi.d.ts +0 -62
- package/dist/range/range-multi.d.ts.map +0 -1
- package/dist/range/range-multi.js +0 -652
- package/dist/range/range-multi.js.map +0 -1
- package/dist/range/range.d.ts +0 -23
- package/dist/range/range.d.ts.map +0 -1
- package/dist/range/range.js +0 -153
- package/dist/range/range.js.map +0 -1
- package/dist/range-input/index.d.ts +0 -2
- package/dist/range-input/index.d.ts.map +0 -1
- package/dist/range-input/index.js +0 -2
- package/dist/range-input/index.js.map +0 -1
- package/dist/range-input/range-input.d.ts +0 -92
- package/dist/range-input/range-input.d.ts.map +0 -1
- package/dist/range-input/range-input.js.map +0 -1
- package/dist/snap-container/snap-container.d.ts +0 -45
- package/dist/snap-container/snap-container.d.ts.map +0 -1
- package/dist/snap-container/snap-container.js +0 -352
- package/dist/snap-container/snap-container.js.map +0 -1
- package/dist/split-layout/split-layout.d.ts.map +0 -1
- package/dist/split-layout/split-layout.js +0 -674
- package/dist/split-layout/split-layout.js.map +0 -1
- package/dist/styles/popup.d.ts +0 -11
- package/dist/styles/popup.d.ts.map +0 -1
- package/dist/styles/popup.js +0 -20
- package/dist/styles/popup.js.map +0 -1
- package/dist/styles/prominence.d.ts +0 -58
- package/dist/styles/prominence.d.ts.map +0 -1
- package/dist/styles/prominence.js +0 -94
- package/dist/styles/prominence.js.map +0 -1
- package/dist/styles/tooltip.d.ts +0 -2
- package/dist/styles/tooltip.d.ts.map +0 -1
- package/dist/styles/tooltip.js.map +0 -1
- package/dist/svg-edit-label.d.ts +0 -2
- package/dist/svg-edit-label.d.ts.map +0 -1
- package/dist/svg-edit-label.js +0 -110
- package/dist/svg-edit-label.js.map +0 -1
- package/dist/swipe/index.d.ts +0 -2
- package/dist/swipe/index.d.ts.map +0 -1
- package/dist/swipe/index.js +0 -2
- package/dist/swipe/index.js.map +0 -1
- package/dist/swipe/swipe.d.ts +0 -65
- package/dist/swipe/swipe.d.ts.map +0 -1
- package/dist/swipe/swipe.js +0 -229
- package/dist/swipe/swipe.js.map +0 -1
- package/dist/tabs/tab-layout-item.d.ts +0 -10
- package/dist/tabs/tab-layout-item.d.ts.map +0 -1
- package/dist/tabs/tab-layout-item.js +0 -20
- package/dist/tabs/tab-layout-item.js.map +0 -1
- package/dist/tabs/tab-layout.d.ts +0 -10
- package/dist/tabs/tab-layout.d.ts.map +0 -1
- package/dist/tabs/tab-layout.js +0 -25
- package/dist/tabs/tab-layout.js.map +0 -1
- package/dist/tabs/tab-list-item.d.ts +0 -34
- package/dist/tabs/tab-list-item.d.ts.map +0 -1
- package/dist/tabs/tab-list-item.js +0 -195
- package/dist/tabs/tab-list-item.js.map +0 -1
- package/dist/tabs/tab-list.d.ts +0 -31
- package/dist/tabs/tab-list.d.ts.map +0 -1
- package/dist/tabs/tab-list.js +0 -257
- package/dist/tabs/tab-list.js.map +0 -1
- package/dist/tabs/tab-panel.d.ts +0 -11
- package/dist/tabs/tab-panel.d.ts.map +0 -1
- package/dist/tabs/tab-panel.js +0 -30
- package/dist/tabs/tab-panel.js.map +0 -1
- package/dist/tabs/tab-panels.d.ts +0 -30
- package/dist/tabs/tab-panels.d.ts.map +0 -1
- package/dist/tabs/tab-panels.js +0 -80
- package/dist/tabs/tab-panels.js.map +0 -1
- package/dist/timeline/index.d.ts +0 -9
- package/dist/timeline/index.d.ts.map +0 -1
- package/dist/timeline/index.js +0 -8
- package/dist/timeline/index.js.map +0 -1
- package/dist/timeline/timeline-controller.d.ts +0 -48
- package/dist/timeline/timeline-controller.d.ts.map +0 -1
- package/dist/timeline/timeline-controller.js +0 -81
- package/dist/timeline/timeline-controller.js.map +0 -1
- package/dist/timeline/timeline-draw.d.ts +0 -28
- package/dist/timeline/timeline-draw.d.ts.map +0 -1
- package/dist/timeline/timeline-draw.js +0 -330
- package/dist/timeline/timeline-draw.js.map +0 -1
- package/dist/timeline/timeline-element.d.ts +0 -140
- package/dist/timeline/timeline-element.d.ts.map +0 -1
- package/dist/timeline/timeline-element.js +0 -888
- package/dist/timeline/timeline-element.js.map +0 -1
- package/dist/timeline/timeline-interactions.d.ts +0 -40
- package/dist/timeline/timeline-interactions.d.ts.map +0 -1
- package/dist/timeline/timeline-interactions.js +0 -393
- package/dist/timeline/timeline-interactions.js.map +0 -1
- package/dist/timeline/timeline-styles.d.ts +0 -2
- package/dist/timeline/timeline-styles.d.ts.map +0 -1
- package/dist/timeline/timeline-styles.js +0 -153
- package/dist/timeline/timeline-styles.js.map +0 -1
- package/dist/timeline/timeline-track-tabs.d.ts +0 -30
- package/dist/timeline/timeline-track-tabs.d.ts.map +0 -1
- package/dist/timeline/timeline-track-tabs.js +0 -204
- package/dist/timeline/timeline-track-tabs.js.map +0 -1
- package/dist/timeline/types.d.ts +0 -144
- package/dist/timeline/types.d.ts.map +0 -1
- package/dist/timeline/types.js +0 -3
- package/dist/timeline/types.js.map +0 -1
- package/dist/tree/index.d.ts +0 -5
- package/dist/tree/index.d.ts.map +0 -1
- package/dist/tree/index.js +0 -5
- package/dist/tree/index.js.map +0 -1
- package/dist/tree/tree-base.d.ts +0 -70
- package/dist/tree/tree-base.d.ts.map +0 -1
- package/dist/tree/tree-base.js +0 -1028
- package/dist/tree/tree-base.js.map +0 -1
- package/dist/tree/tree-controller.d.ts +0 -14
- package/dist/tree/tree-controller.d.ts.map +0 -1
- package/dist/tree/tree-controller.js +0 -96
- package/dist/tree/tree-controller.js.map +0 -1
- package/dist/tree/tree-list.d.ts +0 -20
- package/dist/tree/tree-list.d.ts.map +0 -1
- package/dist/tree/tree-list.js +0 -174
- package/dist/tree/tree-list.js.map +0 -1
- package/dist/tree/types.d.ts +0 -14
- package/dist/tree/types.d.ts.map +0 -1
- package/dist/tree/types.js +0 -7
- package/dist/tree/types.js.map +0 -1
- package/dist/util/checkbox.d.ts +0 -2
- package/dist/util/checkbox.d.ts.map +0 -1
- package/dist/util/checkbox.js +0 -69
- package/dist/util/checkbox.js.map +0 -1
- package/dist/util/circle-arc.d.ts +0 -34
- package/dist/util/circle-arc.d.ts.map +0 -1
- package/dist/util/circle-arc.js +0 -85
- package/dist/util/circle-arc.js.map +0 -1
- package/dist/util/clamp.d.ts +0 -4
- package/dist/util/clamp.d.ts.map +0 -1
- package/dist/util/clamp.js +0 -23
- package/dist/util/clamp.js.map +0 -1
- package/dist/util/compare.d.ts +0 -53
- package/dist/util/compare.d.ts.map +0 -1
- package/dist/util/compare.js +0 -91
- package/dist/util/compare.js.map +0 -1
- package/dist/util/content-editable.d.ts +0 -2
- package/dist/util/content-editable.d.ts.map +0 -1
- package/dist/util/content-editable.js +0 -13
- package/dist/util/content-editable.js.map +0 -1
- package/dist/util/coordinates.d.ts +0 -3
- package/dist/util/coordinates.d.ts.map +0 -1
- package/dist/util/coordinates.js +0 -11
- package/dist/util/coordinates.js.map +0 -1
- package/dist/util/drag.d.ts +0 -16
- package/dist/util/drag.d.ts.map +0 -1
- package/dist/util/drag.js +0 -20
- package/dist/util/drag.js.map +0 -1
- package/dist/util/is-numeric.d.ts +0 -2
- package/dist/util/is-numeric.d.ts.map +0 -1
- package/dist/util/is-numeric.js +0 -9
- package/dist/util/is-numeric.js.map +0 -1
- package/dist/util/key-value.d.ts +0 -5
- package/dist/util/key-value.d.ts.map +0 -1
- package/dist/util/key-value.js +0 -29
- package/dist/util/key-value.js.map +0 -1
- package/dist/util/near.d.ts +0 -2
- package/dist/util/near.d.ts.map +0 -1
- package/dist/util/near.js +0 -6
- package/dist/util/near.js.map +0 -1
- package/dist/util/primitive-types.d.ts +0 -6
- package/dist/util/primitive-types.d.ts.map +0 -1
- package/dist/util/primitive-types.js +0 -2
- package/dist/util/primitive-types.js.map +0 -1
- package/dist/util/svg-editable-text.d.ts +0 -26
- package/dist/util/svg-editable-text.d.ts.map +0 -1
- package/dist/util/svg-editable-text.js +0 -119
- package/dist/util/svg-editable-text.js.map +0 -1
- package/dist/util/time.d.ts +0 -2
- package/dist/util/time.d.ts.map +0 -1
- package/dist/util/time.js +0 -2
- package/dist/util/time.js.map +0 -1
- package/dist/util/tooltip-controller.d.ts +0 -10
- package/dist/util/tooltip-controller.d.ts.map +0 -1
- package/dist/util/tooltip-controller.js +0 -237
- package/dist/util/tooltip-controller.js.map +0 -1
- package/dist/util/tooltip.d.ts +0 -21
- package/dist/util/tooltip.d.ts.map +0 -1
- package/dist/util/tooltip.js +0 -98
- package/dist/util/tooltip.js.map +0 -1
- package/dist/util/value-drag.d.ts +0 -33
- package/dist/util/value-drag.d.ts.map +0 -1
- package/dist/util/value-drag.js +0 -154
- package/dist/util/value-drag.js.map +0 -1
package/bundle/index.js
CHANGED
|
@@ -22503,2251 +22503,2251 @@ __decorate([n$2({
|
|
|
22503
22503
|
__decorate([n$2({ type: Number })], EditableNumber.prototype, "precision", void 0);
|
|
22504
22504
|
EditableNumber = __decorate([t$4(`ixfx-editable-number`)], EditableNumber);
|
|
22505
22505
|
//#endregion
|
|
22506
|
-
//#region
|
|
22507
|
-
const PI2 = Math.PI * 2;
|
|
22508
|
-
const MIDPOINT_ANGLE = -Math.PI / 2;
|
|
22509
|
-
/**
|
|
22510
|
-
* Convert polar coordinates (angle in radians, radius) to SVG Cartesian coordinates
|
|
22511
|
-
* @param angle - Angle in radians (0 = right/east, increases clockwise in SVG)
|
|
22512
|
-
* @param radius - Distance from center
|
|
22513
|
-
* @param center - Center point (default: {x: 50, y: 50})
|
|
22514
|
-
* @returns Point in SVG coordinates
|
|
22515
|
-
*/
|
|
22516
|
-
function polarToCartesian(angle, radius, center = {
|
|
22517
|
-
x: 50,
|
|
22518
|
-
y: 50
|
|
22519
|
-
}) {
|
|
22520
|
-
return {
|
|
22521
|
-
x: center.x + Math.cos(angle) * radius,
|
|
22522
|
-
y: center.y + Math.sin(angle) * radius
|
|
22523
|
-
};
|
|
22524
|
-
}
|
|
22525
|
-
/**
|
|
22526
|
-
* Calculate start and end angles for a flattened circle
|
|
22527
|
-
* @param flatten - How much of the circle to hide (0..1): 0 = full circle, 0.5 = half circle, 1 = no arc
|
|
22528
|
-
* @returns Start and end angles in radians
|
|
22529
|
-
*/
|
|
22530
|
-
function getFlattenedCircleAngles(flatten) {
|
|
22531
|
-
const halfArc = PI2 * (1 - flatten) / 2;
|
|
22532
|
-
const topAngle = -Math.PI / 2;
|
|
22533
|
-
const startAngle = topAngle - halfArc;
|
|
22534
|
-
const endAngle = topAngle + halfArc;
|
|
22535
|
-
return {
|
|
22536
|
-
startAngle,
|
|
22537
|
-
endAngle,
|
|
22538
|
-
totalArc: endAngle - startAngle
|
|
22539
|
-
};
|
|
22540
|
-
}
|
|
22506
|
+
//#region node_modules/.pnpm/lit-html@3.3.2/node_modules/lit-html/directive-helpers.js
|
|
22541
22507
|
/**
|
|
22542
|
-
*
|
|
22543
|
-
*
|
|
22544
|
-
*
|
|
22545
|
-
|
|
22546
|
-
|
|
22547
|
-
|
|
22548
|
-
|
|
22549
|
-
|
|
22550
|
-
|
|
22551
|
-
|
|
22552
|
-
|
|
22553
|
-
|
|
22554
|
-
|
|
22555
|
-
|
|
22508
|
+
* @license
|
|
22509
|
+
* Copyright 2020 Google LLC
|
|
22510
|
+
* SPDX-License-Identifier: BSD-3-Clause
|
|
22511
|
+
*/ const { I: t$1 } = j$1, i = (o) => o, s = () => document.createComment(""), v = (o, n, e) => {
|
|
22512
|
+
const l = o._$AA.parentNode, d = void 0 === n ? o._$AB : n._$AA;
|
|
22513
|
+
if (void 0 === e) e = new t$1(l.insertBefore(s(), d), l.insertBefore(s(), d), o, o.options);
|
|
22514
|
+
else {
|
|
22515
|
+
const t = e._$AB.nextSibling, n = e._$AM, c = n !== o;
|
|
22516
|
+
if (c) {
|
|
22517
|
+
let t;
|
|
22518
|
+
e._$AQ?.(o), e._$AM = o, void 0 !== e._$AP && (t = o._$AU) !== n._$AU && e._$AP(t);
|
|
22519
|
+
}
|
|
22520
|
+
if (t !== d || c) {
|
|
22521
|
+
let o = e._$AA;
|
|
22522
|
+
for (; o !== t;) {
|
|
22523
|
+
const t = i(o).nextSibling;
|
|
22524
|
+
i(l).insertBefore(o, d), o = t;
|
|
22525
|
+
}
|
|
22526
|
+
}
|
|
22556
22527
|
}
|
|
22557
|
-
|
|
22528
|
+
return e;
|
|
22529
|
+
}, u$1 = (o, t, i = o) => (o._$AI(t, i), o), m = {}, p = (o, t = m) => o._$AH = t, M = (o) => o._$AH, h = (o) => {
|
|
22530
|
+
o._$AR(), o._$AA.remove();
|
|
22531
|
+
};
|
|
22532
|
+
//#endregion
|
|
22533
|
+
//#region node_modules/.pnpm/lit-html@3.3.2/node_modules/lit-html/directives/repeat.js
|
|
22558
22534
|
/**
|
|
22559
|
-
*
|
|
22560
|
-
*
|
|
22561
|
-
*
|
|
22562
|
-
* @param flatten - Circle flattening amount (0..1)
|
|
22563
|
-
* @returns Start and end angles for the arc
|
|
22535
|
+
* @license
|
|
22536
|
+
* Copyright 2017 Google LLC
|
|
22537
|
+
* SPDX-License-Identifier: BSD-3-Clause
|
|
22564
22538
|
*/
|
|
22565
|
-
|
|
22566
|
-
const
|
|
22567
|
-
|
|
22568
|
-
|
|
22569
|
-
|
|
22570
|
-
|
|
22571
|
-
|
|
22572
|
-
|
|
22573
|
-
|
|
22574
|
-
|
|
22575
|
-
|
|
22576
|
-
|
|
22577
|
-
|
|
22578
|
-
|
|
22579
|
-
|
|
22580
|
-
|
|
22581
|
-
|
|
22582
|
-
endAngle: MIDPOINT_ANGLE
|
|
22539
|
+
const u = (e, s, t) => {
|
|
22540
|
+
const r = /* @__PURE__ */ new Map();
|
|
22541
|
+
for (let l = s; l <= t; l++) r.set(e[l], l);
|
|
22542
|
+
return r;
|
|
22543
|
+
}, c = e$3(class extends i$2 {
|
|
22544
|
+
constructor(e) {
|
|
22545
|
+
if (super(e), e.type !== t$2.CHILD) throw Error("repeat() can only be used in text expressions");
|
|
22546
|
+
}
|
|
22547
|
+
dt(e, s, t) {
|
|
22548
|
+
let r;
|
|
22549
|
+
void 0 === t ? t = s : void 0 !== s && (r = s);
|
|
22550
|
+
const l = [], o = [];
|
|
22551
|
+
let i = 0;
|
|
22552
|
+
for (const s of e) l[i] = r ? r(s, i) : i, o[i] = t(s, i), i++;
|
|
22553
|
+
return {
|
|
22554
|
+
values: o,
|
|
22555
|
+
keys: l
|
|
22583
22556
|
};
|
|
22584
|
-
|
|
22585
|
-
|
|
22586
|
-
|
|
22587
|
-
|
|
22588
|
-
|
|
22589
|
-
|
|
22557
|
+
}
|
|
22558
|
+
render(e, s, t) {
|
|
22559
|
+
return this.dt(e, s, t).values;
|
|
22560
|
+
}
|
|
22561
|
+
update(s, [t, r, c]) {
|
|
22562
|
+
const d = M(s), { values: p$3, keys: a } = this.dt(t, r, c);
|
|
22563
|
+
if (!Array.isArray(d)) return this.ut = a, p$3;
|
|
22564
|
+
const h$3 = this.ut ??= [], v$2 = [];
|
|
22565
|
+
let m, y, x = 0, j = d.length - 1, k = 0, w = p$3.length - 1;
|
|
22566
|
+
for (; x <= j && k <= w;) if (null === d[x]) x++;
|
|
22567
|
+
else if (null === d[j]) j--;
|
|
22568
|
+
else if (h$3[x] === a[k]) v$2[k] = u$1(d[x], p$3[k]), x++, k++;
|
|
22569
|
+
else if (h$3[j] === a[w]) v$2[w] = u$1(d[j], p$3[w]), j--, w--;
|
|
22570
|
+
else if (h$3[x] === a[w]) v$2[w] = u$1(d[x], p$3[w]), v(s, v$2[w + 1], d[x]), x++, w--;
|
|
22571
|
+
else if (h$3[j] === a[k]) v$2[k] = u$1(d[j], p$3[k]), v(s, d[x], d[j]), j--, k++;
|
|
22572
|
+
else if (void 0 === m && (m = u(a, k, w), y = u(h$3, x, j)), m.has(h$3[x])) if (m.has(h$3[j])) {
|
|
22573
|
+
const e = y.get(a[k]), t = void 0 !== e ? d[e] : null;
|
|
22574
|
+
if (null === t) {
|
|
22575
|
+
const e = v(s, d[x]);
|
|
22576
|
+
u$1(e, p$3[k]), v$2[k] = e;
|
|
22577
|
+
} else v$2[k] = u$1(t, p$3[k]), v(s, d[x], t), d[e] = null;
|
|
22578
|
+
k++;
|
|
22579
|
+
} else h(d[j]), j--;
|
|
22580
|
+
else h(d[x]), x++;
|
|
22581
|
+
for (; k <= w;) {
|
|
22582
|
+
const e = v(s, v$2[w + 1]);
|
|
22583
|
+
u$1(e, p$3[k]), v$2[k++] = e;
|
|
22590
22584
|
}
|
|
22591
|
-
|
|
22592
|
-
|
|
22593
|
-
|
|
22594
|
-
}
|
|
22585
|
+
for (; x <= j;) {
|
|
22586
|
+
const e = d[x++];
|
|
22587
|
+
null !== e && h(e);
|
|
22588
|
+
}
|
|
22589
|
+
return this.ut = a, p(s, v$2), E;
|
|
22595
22590
|
}
|
|
22596
|
-
}
|
|
22597
|
-
|
|
22598
|
-
|
|
22599
|
-
|
|
22600
|
-
|
|
22601
|
-
|
|
22602
|
-
|
|
22603
|
-
|
|
22604
|
-
|
|
22605
|
-
|
|
22606
|
-
|
|
22607
|
-
|
|
22608
|
-
|
|
22609
|
-
|
|
22610
|
-
|
|
22611
|
-
|
|
22612
|
-
|
|
22613
|
-
|
|
22614
|
-
if (
|
|
22615
|
-
|
|
22616
|
-
|
|
22617
|
-
|
|
22591
|
+
});
|
|
22592
|
+
//#endregion
|
|
22593
|
+
//#region src/hex/colour.ts
|
|
22594
|
+
const WHITESPACE_BYTES = new Set([
|
|
22595
|
+
9,
|
|
22596
|
+
10,
|
|
22597
|
+
11,
|
|
22598
|
+
12,
|
|
22599
|
+
13,
|
|
22600
|
+
32
|
|
22601
|
+
]);
|
|
22602
|
+
const isControlByte = (byte) => {
|
|
22603
|
+
return byte < 32 && byte !== 9 && byte !== 10 && byte !== 11 && byte !== 12 && byte !== 13;
|
|
22604
|
+
};
|
|
22605
|
+
const isPrintableAscii = (byte) => {
|
|
22606
|
+
return byte >= 32 && byte <= 126;
|
|
22607
|
+
};
|
|
22608
|
+
const getAsciiClass = (byte) => {
|
|
22609
|
+
if (byte === 0) return "byte-null";
|
|
22610
|
+
if (WHITESPACE_BYTES.has(byte)) return "byte-whitespace";
|
|
22611
|
+
if (isControlByte(byte)) return "byte-control";
|
|
22612
|
+
if (isPrintableAscii(byte)) return "byte-printable";
|
|
22613
|
+
return "byte-other";
|
|
22614
|
+
};
|
|
22615
|
+
const createShadeMap = (nullColour, maxColour, stepStart, stepEnd) => {
|
|
22616
|
+
const cssSteps = colour_exports.createSteps(stepStart, stepEnd, { steps: 16 }).map(colour_exports.toCssColour);
|
|
22617
|
+
return { forByte: (byte) => {
|
|
22618
|
+
if (byte === 0) return nullColour;
|
|
22619
|
+
if (byte === 255) return maxColour;
|
|
22620
|
+
return cssSteps[byte >> 4];
|
|
22621
|
+
} };
|
|
22622
|
+
};
|
|
22623
|
+
//#endregion
|
|
22624
|
+
//#region src/hex/data.ts
|
|
22625
|
+
const createHexStore = (data) => {
|
|
22618
22626
|
return {
|
|
22619
|
-
|
|
22620
|
-
|
|
22627
|
+
data: new Uint8Array(data),
|
|
22628
|
+
changeset: /* @__PURE__ */ new Set()
|
|
22621
22629
|
};
|
|
22622
|
-
}
|
|
22623
|
-
|
|
22624
|
-
|
|
22625
|
-
|
|
22626
|
-
|
|
22627
|
-
|
|
22628
|
-
|
|
22629
|
-
|
|
22630
|
-
|
|
22631
|
-
|
|
22632
|
-
|
|
22633
|
-
|
|
22634
|
-
|
|
22635
|
-
|
|
22636
|
-
|
|
22637
|
-
|
|
22638
|
-
|
|
22639
|
-
|
|
22640
|
-
|
|
22641
|
-
|
|
22642
|
-
|
|
22643
|
-
|
|
22644
|
-
const
|
|
22645
|
-
|
|
22646
|
-
|
|
22647
|
-
|
|
22648
|
-
|
|
22649
|
-
|
|
22650
|
-
|
|
22651
|
-
|
|
22652
|
-
|
|
22653
|
-
|
|
22654
|
-
|
|
22655
|
-
|
|
22656
|
-
|
|
22657
|
-
|
|
22658
|
-
|
|
22659
|
-
|
|
22660
|
-
|
|
22661
|
-
|
|
22662
|
-
|
|
22663
|
-
|
|
22664
|
-
|
|
22665
|
-
|
|
22666
|
-
|
|
22667
|
-
|
|
22668
|
-
|
|
22669
|
-
|
|
22670
|
-
|
|
22671
|
-
*/
|
|
22672
|
-
|
|
22673
|
-
|
|
22674
|
-
|
|
22675
|
-
|
|
22676
|
-
|
|
22677
|
-
|
|
22678
|
-
|
|
22679
|
-
|
|
22680
|
-
|
|
22681
|
-
|
|
22682
|
-
|
|
22683
|
-
|
|
22684
|
-
|
|
22685
|
-
|
|
22686
|
-
let actualStartAngle = startAngle;
|
|
22687
|
-
let actualEndAngle = endAngle;
|
|
22688
|
-
let actualClockwise = clockwise;
|
|
22689
|
-
if (!clockwise && arcLength > Math.PI) {
|
|
22690
|
-
actualStartAngle = endAngle;
|
|
22691
|
-
actualEndAngle = startAngle;
|
|
22692
|
-
actualClockwise = true;
|
|
22693
|
-
arcLength = PI2 - arcLength;
|
|
22694
|
-
}
|
|
22695
|
-
const start = polarToCartesian(actualStartAngle, radius, center);
|
|
22696
|
-
const end = polarToCartesian(actualEndAngle, radius, center);
|
|
22697
|
-
const largeArcFlag = arcLength > Math.PI ? 1 : 0;
|
|
22698
|
-
const sweepFlag = actualClockwise ? 1 : 0;
|
|
22699
|
-
return `M ${center.x},${center.y} L ${start.x},${start.y} A ${radius},${radius} 0 ${largeArcFlag} ${sweepFlag} ${end.x},${end.y} Z`;
|
|
22700
|
-
}
|
|
22701
|
-
/**
|
|
22702
|
-
* Get wedge angles based on value mode
|
|
22703
|
-
* @param relativeValue - Value in 0..1 range
|
|
22704
|
-
* @param valueMode - How to interpret the value
|
|
22705
|
-
* @param flatten - Circle flattening amount (0..1)
|
|
22706
|
-
* @returns Object with startAngle, endAngle, and clockwise flag
|
|
22707
|
-
*/
|
|
22708
|
-
function getWedgeAngles(relativeValue, valueMode, flatten) {
|
|
22709
|
-
const { startAngle, endAngle, totalArc } = getFlattenedCircleAngles(flatten);
|
|
22710
|
-
const valueAngle = valueToAngle(relativeValue, valueMode, flatten);
|
|
22711
|
-
switch (valueMode) {
|
|
22712
|
-
case "range": return {
|
|
22713
|
-
startAngle,
|
|
22714
|
-
endAngle: valueAngle,
|
|
22715
|
-
clockwise: true
|
|
22716
|
-
};
|
|
22717
|
-
case "bipolar": if (relativeValue < .5) return {
|
|
22718
|
-
startAngle: MIDPOINT_ANGLE,
|
|
22719
|
-
endAngle: valueAngle,
|
|
22720
|
-
clockwise: false
|
|
22721
|
-
};
|
|
22722
|
-
else return {
|
|
22723
|
-
startAngle: MIDPOINT_ANGLE,
|
|
22724
|
-
endAngle: valueAngle,
|
|
22725
|
-
clockwise: true
|
|
22726
|
-
};
|
|
22727
|
-
case "unipolar": {
|
|
22728
|
-
const halfSpread = relativeValue * totalArc / 2;
|
|
22729
|
-
return {
|
|
22730
|
-
startAngle: MIDPOINT_ANGLE - halfSpread,
|
|
22731
|
-
endAngle: MIDPOINT_ANGLE + halfSpread,
|
|
22732
|
-
clockwise: true
|
|
22733
|
-
};
|
|
22734
|
-
}
|
|
22735
|
-
default: return {
|
|
22736
|
-
startAngle,
|
|
22737
|
-
endAngle: startAngle,
|
|
22738
|
-
clockwise: true
|
|
22739
|
-
};
|
|
22740
|
-
}
|
|
22741
|
-
}
|
|
22742
|
-
/**
|
|
22743
|
-
* Get position for a marker (needle or dot) at a given value
|
|
22744
|
-
* @param relativeValue - Value in 0..1 range
|
|
22745
|
-
* @param valueMode - How to interpret the value
|
|
22746
|
-
* @param flatten - Circle flattening amount (0..1)
|
|
22747
|
-
* @param radius - Circle radius
|
|
22748
|
-
* @param center - Center point
|
|
22749
|
-
* @returns Angle in radians and position point
|
|
22750
|
-
*/
|
|
22751
|
-
function getMarkerPosition(relativeValue, valueMode, flatten, radius, center = {
|
|
22752
|
-
x: 50,
|
|
22753
|
-
y: 50
|
|
22754
|
-
}) {
|
|
22755
|
-
const angle = valueToAngle(relativeValue, valueMode, flatten);
|
|
22756
|
-
return {
|
|
22757
|
-
angle,
|
|
22758
|
-
position: polarToCartesian(angle, radius, center)
|
|
22759
|
-
};
|
|
22760
|
-
}
|
|
22761
|
-
/**
|
|
22762
|
-
* Get position for midpoint marker (used in bipolar/unipolar modes)
|
|
22763
|
-
* @param radius - Circle radius
|
|
22764
|
-
* @param center - Center point
|
|
22765
|
-
* @returns Position at top-center of circle
|
|
22766
|
-
*/
|
|
22767
|
-
function getMidpointPosition(radius, center = {
|
|
22768
|
-
x: 50,
|
|
22769
|
-
y: 50
|
|
22770
|
-
}) {
|
|
22630
|
+
};
|
|
22631
|
+
const readByte = (store, pos) => {
|
|
22632
|
+
return store.data[pos] ?? 0;
|
|
22633
|
+
};
|
|
22634
|
+
const length = (store) => {
|
|
22635
|
+
return store.data.length;
|
|
22636
|
+
};
|
|
22637
|
+
const clamp$1 = (value) => {
|
|
22638
|
+
return Math.max(0, Math.min(255, value));
|
|
22639
|
+
};
|
|
22640
|
+
const writeByte = (store, pos, value) => {
|
|
22641
|
+
const clampedValue = clamp$1(value);
|
|
22642
|
+
const before = store.data[pos];
|
|
22643
|
+
const diff = new Map([[pos, {
|
|
22644
|
+
before,
|
|
22645
|
+
after: clampedValue
|
|
22646
|
+
}]]);
|
|
22647
|
+
store.data[pos] = clampedValue;
|
|
22648
|
+
store.changeset.add(pos);
|
|
22649
|
+
return diff;
|
|
22650
|
+
};
|
|
22651
|
+
const writeBytes = (store, entries) => {
|
|
22652
|
+
const diff = /* @__PURE__ */ new Map();
|
|
22653
|
+
entries.forEach((value, pos) => {
|
|
22654
|
+
const clampedValue = clamp$1(value);
|
|
22655
|
+
const before = store.data[pos];
|
|
22656
|
+
diff.set(pos, {
|
|
22657
|
+
before,
|
|
22658
|
+
after: clampedValue
|
|
22659
|
+
});
|
|
22660
|
+
store.data[pos] = clampedValue;
|
|
22661
|
+
store.changeset.add(pos);
|
|
22662
|
+
});
|
|
22663
|
+
return diff;
|
|
22664
|
+
};
|
|
22665
|
+
const applyDiff = (store, diff) => {
|
|
22666
|
+
const reverse = /* @__PURE__ */ new Map();
|
|
22667
|
+
diff.forEach((entry, pos) => {
|
|
22668
|
+
const before = store.data[pos];
|
|
22669
|
+
reverse.set(pos, {
|
|
22670
|
+
before: entry.after,
|
|
22671
|
+
after: before
|
|
22672
|
+
});
|
|
22673
|
+
store.data[pos] = entry.after;
|
|
22674
|
+
store.changeset.add(pos);
|
|
22675
|
+
});
|
|
22676
|
+
return reverse;
|
|
22677
|
+
};
|
|
22678
|
+
const reverseDiff = (diff) => {
|
|
22679
|
+
const reversed = /* @__PURE__ */ new Map();
|
|
22680
|
+
diff.forEach((entry, pos) => {
|
|
22681
|
+
reversed.set(pos, {
|
|
22682
|
+
before: entry.after,
|
|
22683
|
+
after: entry.before
|
|
22684
|
+
});
|
|
22685
|
+
});
|
|
22686
|
+
return reversed;
|
|
22687
|
+
};
|
|
22688
|
+
const getChangeset = (store) => {
|
|
22689
|
+
return store.changeset;
|
|
22690
|
+
};
|
|
22691
|
+
//#endregion
|
|
22692
|
+
//#region src/hex/diff.ts
|
|
22693
|
+
const createUndoRedoStack = () => {
|
|
22771
22694
|
return {
|
|
22772
|
-
|
|
22773
|
-
|
|
22695
|
+
undos: [],
|
|
22696
|
+
redos: []
|
|
22774
22697
|
};
|
|
22775
|
-
}
|
|
22776
|
-
|
|
22777
|
-
|
|
22778
|
-
|
|
22779
|
-
|
|
22780
|
-
|
|
22781
|
-
|
|
22782
|
-
|
|
22783
|
-
|
|
22784
|
-
|
|
22785
|
-
|
|
22786
|
-
|
|
22787
|
-
|
|
22698
|
+
};
|
|
22699
|
+
const push = (stack, diff) => {
|
|
22700
|
+
stack.undos.push(diff);
|
|
22701
|
+
stack.redos = [];
|
|
22702
|
+
};
|
|
22703
|
+
const undo = (stack) => {
|
|
22704
|
+
const diff = stack.undos.pop();
|
|
22705
|
+
if (diff) stack.redos.push(diff);
|
|
22706
|
+
return diff;
|
|
22707
|
+
};
|
|
22708
|
+
const redo = (stack) => {
|
|
22709
|
+
const diff = stack.redos.pop();
|
|
22710
|
+
if (diff) stack.undos.push(diff);
|
|
22711
|
+
return diff;
|
|
22712
|
+
};
|
|
22788
22713
|
//#endregion
|
|
22789
|
-
//#region src/
|
|
22790
|
-
const
|
|
22791
|
-
|
|
22792
|
-
|
|
22714
|
+
//#region src/hex/selection.ts
|
|
22715
|
+
const bytesPerRow = (columns) => columns * 4;
|
|
22716
|
+
const min = (a, b) => a < b ? a : b;
|
|
22717
|
+
const max = (a, b) => a > b ? a : b;
|
|
22718
|
+
const clampPos = (pos, dataLength) => {
|
|
22719
|
+
return Math.max(0, Math.min(pos, dataLength - 1));
|
|
22793
22720
|
};
|
|
22794
|
-
|
|
22795
|
-
|
|
22796
|
-
|
|
22797
|
-
|
|
22721
|
+
const getSelectedPositions = (sel, columns) => {
|
|
22722
|
+
if (!sel) return [];
|
|
22723
|
+
const bpr = bytesPerRow(columns);
|
|
22724
|
+
if (sel.kind === "single") return [sel.pos];
|
|
22725
|
+
if (sel.kind === "contiguous") {
|
|
22726
|
+
const start = min(sel.start, sel.end);
|
|
22727
|
+
const end = max(sel.start, sel.end);
|
|
22728
|
+
const positions = [];
|
|
22729
|
+
for (let i = start; i <= end; i++) positions.push(i);
|
|
22730
|
+
return positions;
|
|
22798
22731
|
}
|
|
22799
|
-
|
|
22800
|
-
|
|
22732
|
+
if (sel.kind === "rectangular") {
|
|
22733
|
+
const positions = [];
|
|
22734
|
+
for (let row = 0; row < sel.height; row++) for (let col = 0; col < sel.width; col++) {
|
|
22735
|
+
const y = sel.y + row;
|
|
22736
|
+
const x = sel.x + col;
|
|
22737
|
+
const pos = y * bpr + x;
|
|
22738
|
+
positions.push(pos);
|
|
22739
|
+
}
|
|
22740
|
+
return positions;
|
|
22801
22741
|
}
|
|
22802
|
-
|
|
22803
|
-
|
|
22804
|
-
|
|
22805
|
-
|
|
22806
|
-
|
|
22807
|
-
|
|
22808
|
-
|
|
22809
|
-
|
|
22810
|
-
|
|
22811
|
-
|
|
22812
|
-
this.min = 0;
|
|
22813
|
-
this.max = 100;
|
|
22814
|
-
this.step = void 0;
|
|
22815
|
-
this.valueMode = `range`;
|
|
22816
|
-
this.flatten = .3;
|
|
22817
|
-
this.markerStyle = `needle`;
|
|
22818
|
-
this.wedge = false;
|
|
22819
|
-
this.disabled = false;
|
|
22820
|
-
this.#lanes = /* @__PURE__ */ new Map();
|
|
22821
|
-
this.#dragging = false;
|
|
22822
|
-
this.#dragStartY = 0;
|
|
22823
|
-
this.#valueAtDragStart = 0;
|
|
22824
|
-
this.#isUserInteraction = false;
|
|
22825
|
-
this.#onPointerDown = (event) => {
|
|
22826
|
-
if (this.disabled) return;
|
|
22827
|
-
event.preventDefault();
|
|
22828
|
-
const svg = this.renderRoot.querySelector(`svg`);
|
|
22829
|
-
svg?.focus();
|
|
22830
|
-
this.#dragging = true;
|
|
22831
|
-
this.#dragStartY = event.clientY;
|
|
22832
|
-
this.#valueAtDragStart = this.value;
|
|
22833
|
-
this.toggleAttribute(`dragging`, true);
|
|
22834
|
-
if (svg) svg.setPointerCapture(event.pointerId);
|
|
22835
|
-
window.addEventListener(`pointermove`, this.#onPointerMove);
|
|
22836
|
-
window.addEventListener(`pointerup`, this.#onPointerUp);
|
|
22837
|
-
window.addEventListener(`pointercancel`, this.#onPointerUp);
|
|
22838
|
-
};
|
|
22839
|
-
this.#onPointerMove = (event) => {
|
|
22840
|
-
if (!this.#dragging) return;
|
|
22841
|
-
event.preventDefault();
|
|
22842
|
-
const effectiveSensitivity = this.clientHeight * 2 * (event.shiftKey ? 10 : 1);
|
|
22843
|
-
const deltaValue = (this.#dragStartY - event.clientY) / effectiveSensitivity * (this.max - this.min);
|
|
22844
|
-
const relativeValue = scale(this.#valueAtDragStart + deltaValue, this.min, this.max, 0, 1);
|
|
22845
|
-
this.#setValueFromRelative(clamp$1(relativeValue, 0, 1), true);
|
|
22846
|
-
};
|
|
22847
|
-
this.#onPointerUp = () => {
|
|
22848
|
-
this.#dragging = false;
|
|
22849
|
-
this.toggleAttribute(`dragging`, false);
|
|
22850
|
-
const svg = this.renderRoot.querySelector(`svg`);
|
|
22851
|
-
if (svg && `hasPointerCapture` in svg && typeof svg.hasPointerCapture === `function`) {
|
|
22852
|
-
if (svg.hasPointerCapture(1)) svg.releasePointerCapture(1);
|
|
22853
|
-
}
|
|
22854
|
-
window.removeEventListener(`pointermove`, this.#onPointerMove);
|
|
22855
|
-
window.removeEventListener(`pointerup`, this.#onPointerUp);
|
|
22856
|
-
window.removeEventListener(`pointercancel`, this.#onPointerUp);
|
|
22857
|
-
};
|
|
22858
|
-
this.#onKeyDown = (event) => {
|
|
22859
|
-
if (this.disabled) return;
|
|
22860
|
-
const shiftDivisor = event.shiftKey ? 10 : 1;
|
|
22861
|
-
const range = this.max - this.min;
|
|
22862
|
-
const effectiveStep = resolveStep(range, this.stops, this.step) / shiftDivisor;
|
|
22863
|
-
let handled = false;
|
|
22864
|
-
switch (event.key) {
|
|
22865
|
-
case `ArrowUp`:
|
|
22866
|
-
case `ArrowRight`:
|
|
22867
|
-
this.#setValueFromRelative(this.#getRelativeValue() + effectiveStep / range, true);
|
|
22868
|
-
handled = true;
|
|
22869
|
-
break;
|
|
22870
|
-
case `ArrowDown`:
|
|
22871
|
-
case `ArrowLeft`:
|
|
22872
|
-
this.#setValueFromRelative(this.#getRelativeValue() - effectiveStep / range, true);
|
|
22873
|
-
handled = true;
|
|
22874
|
-
break;
|
|
22875
|
-
case `Home`:
|
|
22876
|
-
this.#setValueFromRelative(0, true);
|
|
22877
|
-
handled = true;
|
|
22878
|
-
break;
|
|
22879
|
-
case `End`:
|
|
22880
|
-
this.#setValueFromRelative(1, true);
|
|
22881
|
-
handled = true;
|
|
22882
|
-
break;
|
|
22883
|
-
}
|
|
22884
|
-
if (handled) event.preventDefault();
|
|
22885
|
-
};
|
|
22886
|
-
this.#lanes.set(`track`, {
|
|
22887
|
-
key: `track`,
|
|
22888
|
-
value: 1,
|
|
22889
|
-
type: `fixed`,
|
|
22890
|
-
offset: 0,
|
|
22891
|
-
width: .16
|
|
22892
|
-
});
|
|
22893
|
-
this.#lanes.set(`value`, {
|
|
22894
|
-
key: `value`,
|
|
22895
|
-
value: 0,
|
|
22896
|
-
type: `value`,
|
|
22897
|
-
offset: 0,
|
|
22898
|
-
width: .24
|
|
22899
|
-
});
|
|
22900
|
-
}
|
|
22901
|
-
addLane(key, options) {
|
|
22902
|
-
const relativeValue = this.#getRelativeValue();
|
|
22903
|
-
this.#lanes.set(key, {
|
|
22904
|
-
key,
|
|
22905
|
-
value: options?.value ?? relativeValue,
|
|
22906
|
-
type: options?.type ?? `value`,
|
|
22907
|
-
offset: options?.offset ?? 0,
|
|
22908
|
-
width: options?.width ?? .1
|
|
22909
|
-
});
|
|
22910
|
-
this.requestUpdate();
|
|
22911
|
-
}
|
|
22912
|
-
setLaneValue(key, value) {
|
|
22913
|
-
const lane = this.#lanes.get(key);
|
|
22914
|
-
if (lane) {
|
|
22915
|
-
lane.value = clamp$1(value, 0, 1);
|
|
22916
|
-
this.requestUpdate();
|
|
22917
|
-
}
|
|
22918
|
-
}
|
|
22919
|
-
removeLane(key) {
|
|
22920
|
-
this.#lanes.delete(key);
|
|
22921
|
-
this.requestUpdate();
|
|
22922
|
-
}
|
|
22923
|
-
getLanes() {
|
|
22924
|
-
return new Map(this.#lanes);
|
|
22925
|
-
}
|
|
22926
|
-
getLane(key) {
|
|
22927
|
-
return this.#lanes.get(key);
|
|
22742
|
+
return [];
|
|
22743
|
+
};
|
|
22744
|
+
const selectionContains = (sel, pos, columns) => {
|
|
22745
|
+
if (!sel) return false;
|
|
22746
|
+
const bpr = bytesPerRow(columns);
|
|
22747
|
+
if (sel.kind === "single") return pos === sel.pos;
|
|
22748
|
+
if (sel.kind === "contiguous") {
|
|
22749
|
+
const start = min(sel.start, sel.end);
|
|
22750
|
+
const end = max(sel.start, sel.end);
|
|
22751
|
+
return pos >= start && pos <= end;
|
|
22928
22752
|
}
|
|
22929
|
-
|
|
22930
|
-
|
|
22753
|
+
if (sel.kind === "rectangular") {
|
|
22754
|
+
const row = Math.floor(pos / bpr);
|
|
22755
|
+
const col = pos % bpr;
|
|
22756
|
+
const x = sel.x;
|
|
22757
|
+
const y = sel.y;
|
|
22758
|
+
const width = sel.width;
|
|
22759
|
+
const height = sel.height;
|
|
22760
|
+
return row >= y && row < y + height && col >= x && col < x + width;
|
|
22931
22761
|
}
|
|
22932
|
-
|
|
22933
|
-
|
|
22934
|
-
|
|
22762
|
+
return false;
|
|
22763
|
+
};
|
|
22764
|
+
const getCursorPos = (sel, dir, columns, dataLength) => {
|
|
22765
|
+
let currentPos;
|
|
22766
|
+
if (!sel) currentPos = 0;
|
|
22767
|
+
else if (sel.kind === "single") currentPos = sel.pos;
|
|
22768
|
+
else if (sel.kind === "contiguous") currentPos = max(sel.start, sel.end);
|
|
22769
|
+
else if (sel.kind === "rectangular") currentPos = sel.y * bytesPerRow(columns) + sel.x + sel.width - 1;
|
|
22770
|
+
else currentPos = 0;
|
|
22771
|
+
const bpr = bytesPerRow(columns);
|
|
22772
|
+
let newPos;
|
|
22773
|
+
switch (dir) {
|
|
22774
|
+
case "left":
|
|
22775
|
+
newPos = currentPos - 1;
|
|
22776
|
+
break;
|
|
22777
|
+
case "right":
|
|
22778
|
+
newPos = currentPos + 1;
|
|
22779
|
+
break;
|
|
22780
|
+
case "up":
|
|
22781
|
+
newPos = currentPos - bpr;
|
|
22782
|
+
break;
|
|
22783
|
+
case "down":
|
|
22784
|
+
newPos = currentPos + bpr;
|
|
22785
|
+
break;
|
|
22786
|
+
default: newPos = currentPos;
|
|
22935
22787
|
}
|
|
22936
|
-
|
|
22937
|
-
|
|
22938
|
-
|
|
22939
|
-
|
|
22940
|
-
|
|
22941
|
-
|
|
22788
|
+
return clampPos(newPos, dataLength);
|
|
22789
|
+
};
|
|
22790
|
+
const moveSelection = (sel, dir, columns, dataLength) => {
|
|
22791
|
+
return {
|
|
22792
|
+
kind: "single",
|
|
22793
|
+
pos: getCursorPos(sel, dir, columns, dataLength)
|
|
22794
|
+
};
|
|
22795
|
+
};
|
|
22796
|
+
const extendRectangular = (sel, dir, columns, _dataLength, anchorX = 0, anchorY = 0) => {
|
|
22797
|
+
const bpr = bytesPerRow(columns);
|
|
22798
|
+
let x;
|
|
22799
|
+
let y;
|
|
22800
|
+
let width;
|
|
22801
|
+
let height;
|
|
22802
|
+
if (!sel || sel.kind === "single") {
|
|
22803
|
+
const pos = sel?.kind === "single" ? sel.pos : 0;
|
|
22804
|
+
x = pos % bpr;
|
|
22805
|
+
y = Math.floor(pos / bpr);
|
|
22806
|
+
width = 1;
|
|
22807
|
+
height = 1;
|
|
22808
|
+
} else if (sel.kind === "contiguous") {
|
|
22809
|
+
const start = min(sel.start, sel.end);
|
|
22810
|
+
const end = max(sel.start, sel.end);
|
|
22811
|
+
x = start % bpr;
|
|
22812
|
+
y = Math.floor(start / bpr);
|
|
22813
|
+
width = end - start + 1;
|
|
22814
|
+
height = 1;
|
|
22815
|
+
} else if (sel.kind === "rectangular") {
|
|
22816
|
+
x = sel.x;
|
|
22817
|
+
y = sel.y;
|
|
22818
|
+
width = sel.width;
|
|
22819
|
+
height = sel.height;
|
|
22820
|
+
} else {
|
|
22821
|
+
x = 0;
|
|
22822
|
+
y = 0;
|
|
22823
|
+
width = 1;
|
|
22824
|
+
height = 1;
|
|
22942
22825
|
}
|
|
22943
|
-
|
|
22944
|
-
|
|
22945
|
-
|
|
22946
|
-
|
|
22947
|
-
|
|
22948
|
-
|
|
22949
|
-
|
|
22950
|
-
|
|
22951
|
-
|
|
22952
|
-
|
|
22953
|
-
|
|
22954
|
-
|
|
22955
|
-
|
|
22956
|
-
|
|
22957
|
-
|
|
22958
|
-
|
|
22959
|
-
|
|
22960
|
-
|
|
22961
|
-
|
|
22962
|
-
|
|
22963
|
-
|
|
22964
|
-
})
|
|
22965
|
-
|
|
22966
|
-
|
|
22826
|
+
const effectiveAnchorX = anchorX > 0 || sel?.kind === "rectangular" ? anchorX : x;
|
|
22827
|
+
const effectiveAnchorY = anchorY > 0 || sel?.kind === "rectangular" ? anchorY : y;
|
|
22828
|
+
switch (dir) {
|
|
22829
|
+
case "left":
|
|
22830
|
+
if (x > effectiveAnchorX) width -= 1;
|
|
22831
|
+
else if (x === effectiveAnchorX && width > 1) {
|
|
22832
|
+
x -= 1;
|
|
22833
|
+
width += 1;
|
|
22834
|
+
} else if (x > 0) {
|
|
22835
|
+
x -= 1;
|
|
22836
|
+
width += 1;
|
|
22837
|
+
}
|
|
22838
|
+
break;
|
|
22839
|
+
case "right":
|
|
22840
|
+
if (x + width < bpr) width += 1;
|
|
22841
|
+
break;
|
|
22842
|
+
case "up":
|
|
22843
|
+
if (y > effectiveAnchorY) height -= 1;
|
|
22844
|
+
else if (y === effectiveAnchorY && height > 1) {
|
|
22845
|
+
y -= 1;
|
|
22846
|
+
height += 1;
|
|
22847
|
+
} else if (y > 0) {
|
|
22848
|
+
y -= 1;
|
|
22849
|
+
height += 1;
|
|
22850
|
+
}
|
|
22851
|
+
break;
|
|
22852
|
+
case "down":
|
|
22853
|
+
height += 1;
|
|
22854
|
+
break;
|
|
22967
22855
|
}
|
|
22968
|
-
|
|
22969
|
-
|
|
22970
|
-
|
|
22971
|
-
|
|
22972
|
-
|
|
22973
|
-
|
|
22974
|
-
}
|
|
22975
|
-
|
|
22976
|
-
|
|
22977
|
-
|
|
22978
|
-
|
|
22979
|
-
|
|
22980
|
-
|
|
22981
|
-
|
|
22982
|
-
|
|
22983
|
-
|
|
22984
|
-
|
|
22985
|
-
|
|
22986
|
-
|
|
22987
|
-
|
|
22988
|
-
|
|
22989
|
-
|
|
22990
|
-
|
|
22991
|
-
|
|
22992
|
-
|
|
22993
|
-
|
|
22994
|
-
|
|
22995
|
-
|
|
22996
|
-
|
|
22997
|
-
|
|
22998
|
-
|
|
22999
|
-
|
|
23000
|
-
|
|
23001
|
-
|
|
23002
|
-
|
|
23003
|
-
|
|
23004
|
-
|
|
23005
|
-
|
|
23006
|
-
|
|
23007
|
-
|
|
23008
|
-
|
|
23009
|
-
|
|
23010
|
-
|
|
23011
|
-
|
|
23012
|
-
|
|
23013
|
-
|
|
23014
|
-
|
|
23015
|
-
|
|
23016
|
-
|
|
23017
|
-
|
|
23018
|
-
|
|
23019
|
-
|
|
23020
|
-
|
|
23021
|
-
|
|
23022
|
-
|
|
23023
|
-
|
|
23024
|
-
|
|
23025
|
-
|
|
23026
|
-
|
|
23027
|
-
|
|
23028
|
-
|
|
23029
|
-
|
|
23030
|
-
|
|
23031
|
-
const start = {
|
|
23032
|
-
x: CENTER.x + Math.cos(angle) * startRadius,
|
|
23033
|
-
y: CENTER.y + Math.sin(angle) * startRadius
|
|
22856
|
+
return {
|
|
22857
|
+
kind: "rectangular",
|
|
22858
|
+
x,
|
|
22859
|
+
y,
|
|
22860
|
+
width,
|
|
22861
|
+
height
|
|
22862
|
+
};
|
|
22863
|
+
};
|
|
22864
|
+
const selectionFromPointerRange = (start, end, mode, columns) => {
|
|
22865
|
+
const bpr = bytesPerRow(columns);
|
|
22866
|
+
if (mode === "contiguous") return {
|
|
22867
|
+
kind: "contiguous",
|
|
22868
|
+
start: min(start, end),
|
|
22869
|
+
end: max(start, end)
|
|
22870
|
+
};
|
|
22871
|
+
const startX = start % bpr;
|
|
22872
|
+
const startY = Math.floor(start / bpr);
|
|
22873
|
+
const endX = end % bpr;
|
|
22874
|
+
const endY = Math.floor(end / bpr);
|
|
22875
|
+
return {
|
|
22876
|
+
kind: "rectangular",
|
|
22877
|
+
x: min(startX, endX),
|
|
22878
|
+
y: min(startY, endY),
|
|
22879
|
+
width: Math.abs(endX - startX) + 1,
|
|
22880
|
+
height: Math.abs(endY - startY) + 1
|
|
22881
|
+
};
|
|
22882
|
+
};
|
|
22883
|
+
//#endregion
|
|
22884
|
+
//#region src/hex/hex-editor.ts
|
|
22885
|
+
let IxfxHexEditorElement = class IxfxHexEditorElement extends i$3 {
|
|
22886
|
+
constructor(..._args) {
|
|
22887
|
+
super(..._args);
|
|
22888
|
+
this.columns = 4;
|
|
22889
|
+
this.colourScheme = `ascii`;
|
|
22890
|
+
this.showChangeset = true;
|
|
22891
|
+
this.hideOffsetCol = false;
|
|
22892
|
+
this.hideHexCol = false;
|
|
22893
|
+
this.hideTextCol = false;
|
|
22894
|
+
this._selection = null;
|
|
22895
|
+
this._scrollTop = 0;
|
|
22896
|
+
this._editState = null;
|
|
22897
|
+
this._containerH = 0;
|
|
22898
|
+
this._shadeMap = null;
|
|
22899
|
+
this._focusSide = null;
|
|
22900
|
+
this._store = createHexStore(new Uint8Array(0));
|
|
22901
|
+
this._undoStack = createUndoRedoStack();
|
|
22902
|
+
this._copyBuffer = null;
|
|
22903
|
+
this._rowHeight = 24;
|
|
22904
|
+
this._dragStart = null;
|
|
22905
|
+
this._dragAnchor = null;
|
|
22906
|
+
this._rectAnchorX = 0;
|
|
22907
|
+
this._rectAnchorY = 0;
|
|
22908
|
+
this._rectAnchorXFromKeyboard = 0;
|
|
22909
|
+
this._rectAnchorYFromKeyboard = 0;
|
|
22910
|
+
this._initialSelectionPoint = 0;
|
|
22911
|
+
this._currentCursorPoint = 0;
|
|
22912
|
+
this._pointerMode = null;
|
|
22913
|
+
this._currentDragDiff = null;
|
|
22914
|
+
this._shiftClickTarget = null;
|
|
22915
|
+
this._onScroll = (e) => {
|
|
22916
|
+
const target = e.target;
|
|
22917
|
+
this._scrollTop = target.scrollTop;
|
|
22918
|
+
this.requestUpdate();
|
|
23034
22919
|
};
|
|
23035
|
-
|
|
23036
|
-
|
|
23037
|
-
|
|
22920
|
+
this._onKeyDown = (e) => {
|
|
22921
|
+
if ([
|
|
22922
|
+
`ArrowLeft`,
|
|
22923
|
+
`ArrowRight`,
|
|
22924
|
+
`ArrowUp`,
|
|
22925
|
+
`ArrowDown`
|
|
22926
|
+
].includes(e.key)) {
|
|
22927
|
+
e.preventDefault();
|
|
22928
|
+
e.stopPropagation();
|
|
22929
|
+
if (this._editState) this._editState = null;
|
|
22930
|
+
const dir = e.key.replace(`Arrow`, ``).toLowerCase();
|
|
22931
|
+
const dataLen = length(this._store);
|
|
22932
|
+
const bpr = bytesPerRow(this.columns);
|
|
22933
|
+
if (e.metaKey || e.ctrlKey) {
|
|
22934
|
+
if (!this._selection || this._selection.kind !== `rectangular`) {
|
|
22935
|
+
let startPos = 0;
|
|
22936
|
+
if (this._selection?.kind === `single`) startPos = this._selection.pos;
|
|
22937
|
+
else if (this._selection?.kind === `contiguous`) startPos = Math.min(this._selection.start, this._selection.end);
|
|
22938
|
+
this._rectAnchorXFromKeyboard = startPos % bpr;
|
|
22939
|
+
this._rectAnchorYFromKeyboard = Math.floor(startPos / bpr);
|
|
22940
|
+
this._selection = {
|
|
22941
|
+
kind: `rectangular`,
|
|
22942
|
+
x: this._rectAnchorXFromKeyboard,
|
|
22943
|
+
y: this._rectAnchorYFromKeyboard,
|
|
22944
|
+
width: 1,
|
|
22945
|
+
height: 1
|
|
22946
|
+
};
|
|
22947
|
+
}
|
|
22948
|
+
this._selection = extendRectangular(this._selection, dir, this.columns, dataLen, this._rectAnchorXFromKeyboard, this._rectAnchorYFromKeyboard);
|
|
22949
|
+
} else if (e.shiftKey) {
|
|
22950
|
+
if (!this._selection) {
|
|
22951
|
+
this._initialSelectionPoint = 0;
|
|
22952
|
+
this._currentCursorPoint = 0;
|
|
22953
|
+
} else if (this._selection.kind === `single`) {
|
|
22954
|
+
this._initialSelectionPoint = this._selection.pos;
|
|
22955
|
+
this._currentCursorPoint = this._selection.pos;
|
|
22956
|
+
} else if (this._selection.kind === `rectangular`) {
|
|
22957
|
+
const cursorPos = this._selection.y * bpr + this._selection.x;
|
|
22958
|
+
this._initialSelectionPoint = cursorPos;
|
|
22959
|
+
this._currentCursorPoint = cursorPos;
|
|
22960
|
+
}
|
|
22961
|
+
const newPos = getCursorPos(this._selection, dir, this.columns, dataLen);
|
|
22962
|
+
const start = Math.min(this._initialSelectionPoint, newPos);
|
|
22963
|
+
const end = Math.max(this._initialSelectionPoint, newPos);
|
|
22964
|
+
this._currentCursorPoint = newPos;
|
|
22965
|
+
this._selection = {
|
|
22966
|
+
kind: `contiguous`,
|
|
22967
|
+
start,
|
|
22968
|
+
end
|
|
22969
|
+
};
|
|
22970
|
+
} else {
|
|
22971
|
+
this._selection = moveSelection(this._selection, dir, this.columns, dataLen);
|
|
22972
|
+
const pos = getCursorPos(this._selection, dir, this.columns, dataLen);
|
|
22973
|
+
this._initialSelectionPoint = pos;
|
|
22974
|
+
this._currentCursorPoint = pos;
|
|
22975
|
+
}
|
|
22976
|
+
this._dispatchSelectEvent();
|
|
22977
|
+
this.requestUpdate();
|
|
22978
|
+
return;
|
|
22979
|
+
}
|
|
22980
|
+
if (e.key === `Tab`) {
|
|
22981
|
+
e.preventDefault();
|
|
22982
|
+
e.stopPropagation();
|
|
22983
|
+
if (this._editState) this._advanceCursor();
|
|
22984
|
+
else {
|
|
22985
|
+
const dataLen = length(this._store);
|
|
22986
|
+
this._selection = moveSelection(this._selection, `right`, this.columns, dataLen);
|
|
22987
|
+
this._dispatchSelectEvent();
|
|
22988
|
+
}
|
|
22989
|
+
this.requestUpdate();
|
|
22990
|
+
return;
|
|
22991
|
+
}
|
|
22992
|
+
if (e.key === `Escape`) {
|
|
22993
|
+
e.preventDefault();
|
|
22994
|
+
e.stopPropagation();
|
|
22995
|
+
if (this._editState) this._editState = null;
|
|
22996
|
+
else if (this._selection && this._selection.kind !== `single`) {
|
|
22997
|
+
const sel = this._selection;
|
|
22998
|
+
let firstPos = 0;
|
|
22999
|
+
if (sel.kind === `contiguous`) {
|
|
23000
|
+
const c = sel;
|
|
23001
|
+
firstPos = Math.min(c.start, c.end);
|
|
23002
|
+
}
|
|
23003
|
+
if (sel.kind === `rectangular`) {
|
|
23004
|
+
const r = sel;
|
|
23005
|
+
firstPos = r.y * bytesPerRow(this.columns) + r.x;
|
|
23006
|
+
}
|
|
23007
|
+
this._selection = {
|
|
23008
|
+
kind: `single`,
|
|
23009
|
+
pos: firstPos
|
|
23010
|
+
};
|
|
23011
|
+
this._dispatchSelectEvent();
|
|
23012
|
+
}
|
|
23013
|
+
this.requestUpdate();
|
|
23014
|
+
return;
|
|
23015
|
+
}
|
|
23016
|
+
if (this._editState) {
|
|
23017
|
+
e.stopPropagation();
|
|
23018
|
+
if (e.key === `Backspace`) {
|
|
23019
|
+
this._handleBackspace();
|
|
23020
|
+
return;
|
|
23021
|
+
}
|
|
23022
|
+
if (e.key === `Enter`) {
|
|
23023
|
+
if (this._editState.side === `hex` && this._editState.partial.startsWith(`.`)) this._commitDecimalValue();
|
|
23024
|
+
return;
|
|
23025
|
+
}
|
|
23026
|
+
if (e.key.length === 1) this._handleValueEntry(e.key);
|
|
23027
|
+
return;
|
|
23028
|
+
}
|
|
23029
|
+
if (this._selection && this._selection.kind === `single` && e.key.length === 1) {
|
|
23030
|
+
e.preventDefault();
|
|
23031
|
+
e.stopPropagation();
|
|
23032
|
+
const pos = this._selection.pos;
|
|
23033
|
+
const side = this._focusSide ?? `hex`;
|
|
23034
|
+
this._editState = {
|
|
23035
|
+
pos,
|
|
23036
|
+
side,
|
|
23037
|
+
partial: ``
|
|
23038
|
+
};
|
|
23039
|
+
this._handleValueEntry(e.key);
|
|
23040
|
+
}
|
|
23038
23041
|
};
|
|
23039
|
-
return `M ${start.x} ${start.y} L ${end.x} ${end.y}`;
|
|
23040
|
-
}
|
|
23041
|
-
#renderValueMarker(needlePath) {
|
|
23042
|
-
const { angle, position } = getMarkerPosition(this.#getRelativeValue(), this.valueMode, this.flatten, this.radius, CENTER);
|
|
23043
|
-
const markerOffset = this.#getCssVar(`--marker-offset`, 1);
|
|
23044
|
-
const markerBorderWidth = this.#getCssVar(`--marker-border-width`, 0);
|
|
23045
|
-
const effectiveStyle = this.#getEffectiveMarkerStyle();
|
|
23046
|
-
if (effectiveStyle === `dot`) {
|
|
23047
|
-
const r = this.#getCssVar(`--marker-thickness`, .15) * this.radius;
|
|
23048
|
-
const dotX = CENTER.x + (position.x - CENTER.x) * markerOffset;
|
|
23049
|
-
const dotY = CENTER.y + (position.y - CENTER.y) * markerOffset;
|
|
23050
|
-
if (markerBorderWidth > 0) return w`
|
|
23051
|
-
<g class="value-marker" part="value-marker">
|
|
23052
|
-
<use href="#dot-path" class="marker-border" />
|
|
23053
|
-
<use href="#dot-path" class="marker-fill" />
|
|
23054
|
-
</g>
|
|
23055
|
-
`;
|
|
23056
|
-
return w`
|
|
23057
|
-
<g class="value-marker" part="value-marker">
|
|
23058
|
-
<circle cx="${dotX}" cy="${dotY}" r="${r}" />
|
|
23059
|
-
</g>
|
|
23060
|
-
`;
|
|
23061
|
-
} else if (effectiveStyle === `needle`) {
|
|
23062
|
-
if (markerBorderWidth > 0 && needlePath) return w`
|
|
23063
|
-
<g class="value-marker" part="value-marker">
|
|
23064
|
-
<use href="#needle-path" class="marker-border" />
|
|
23065
|
-
<use href="#needle-path" class="marker-fill" />
|
|
23066
|
-
</g>
|
|
23067
|
-
`;
|
|
23068
|
-
const length = this.#getCssVar(`--marker-length`, .8);
|
|
23069
|
-
const offset = this.#getCssVar(`--marker-offset`, .2);
|
|
23070
|
-
return w`
|
|
23071
|
-
<g class="value-marker" part="value-marker">
|
|
23072
|
-
<path d="${this.#getNeedlePath(angle, length, offset)}" />
|
|
23073
|
-
</g>
|
|
23074
|
-
`;
|
|
23075
|
-
}
|
|
23076
|
-
}
|
|
23077
|
-
#renderMidpointMarker() {
|
|
23078
|
-
if (this.valueMode !== `bipolar` && this.valueMode !== `unipolar`) return w``;
|
|
23079
|
-
const { position } = getMidpointPosition(this.radius, CENTER);
|
|
23080
|
-
if (this.markerStyle === `dot`) {
|
|
23081
|
-
const size = this.#getCssVar(`--midpoint-thickness`, .08);
|
|
23082
|
-
return w`
|
|
23083
|
-
<g class="midpoint-marker" part="midpoint-marker">
|
|
23084
|
-
<circle
|
|
23085
|
-
cx="${position.x}"
|
|
23086
|
-
cy="${position.y}"
|
|
23087
|
-
r="${size * this.radius}"
|
|
23088
|
-
/>
|
|
23089
|
-
</g>
|
|
23090
|
-
`;
|
|
23091
|
-
} else {
|
|
23092
|
-
const length = this.#getCssVar(`--midpoint-length`, .15);
|
|
23093
|
-
const offset = this.#getCssVar(`--midpoint-offset`, .85);
|
|
23094
|
-
const angle = -Math.PI / 2;
|
|
23095
|
-
const startRadius = offset * this.radius;
|
|
23096
|
-
const endRadius = (offset + length) * this.radius;
|
|
23097
|
-
const start = {
|
|
23098
|
-
x: CENTER.x + Math.cos(angle) * startRadius,
|
|
23099
|
-
y: CENTER.y + Math.sin(angle) * startRadius
|
|
23100
|
-
};
|
|
23101
|
-
const end = {
|
|
23102
|
-
x: CENTER.x + Math.cos(angle) * endRadius,
|
|
23103
|
-
y: CENTER.y + Math.sin(angle) * endRadius
|
|
23104
|
-
};
|
|
23105
|
-
return w`
|
|
23106
|
-
<g class="midpoint-marker" part="midpoint-marker">
|
|
23107
|
-
<line
|
|
23108
|
-
x1="${start.x}"
|
|
23109
|
-
y1="${start.y}"
|
|
23110
|
-
x2="${end.x}"
|
|
23111
|
-
y2="${end.y}"
|
|
23112
|
-
/>
|
|
23113
|
-
</g>
|
|
23114
|
-
`;
|
|
23115
|
-
}
|
|
23116
|
-
}
|
|
23117
|
-
#getCssVar(name, defaultValue) {
|
|
23118
|
-
const style = getComputedStyle(this);
|
|
23119
|
-
const val = style.getPropertyValue(name).trim();
|
|
23120
|
-
if (!val) return defaultValue;
|
|
23121
|
-
if (val.includes(`calc(`)) {
|
|
23122
|
-
const valueRelative = style.getPropertyValue(`--value-relative`).trim();
|
|
23123
|
-
if (!valueRelative) {
|
|
23124
|
-
const parsed = Number.parseFloat(val.replace(/[^0-9.-]/g, ``));
|
|
23125
|
-
return Number.isNaN(parsed) ? defaultValue : parsed;
|
|
23126
|
-
}
|
|
23127
|
-
const evalStr = val.replace(/var\(--value-relative\)/g, valueRelative);
|
|
23128
|
-
try {
|
|
23129
|
-
const result = new Function(`return ${evalStr.replace(/calc\s*\(([^)]+)\)/g, `$1`)}`)();
|
|
23130
|
-
return typeof result === `number` && !Number.isNaN(result) ? result : defaultValue;
|
|
23131
|
-
} catch (e) {
|
|
23132
|
-
const parsed = Number.parseFloat(val.replace(/[^0-9.-]/g, ``));
|
|
23133
|
-
return Number.isNaN(parsed) ? defaultValue : parsed;
|
|
23134
|
-
}
|
|
23135
|
-
}
|
|
23136
|
-
const parsed = Number.parseFloat(val);
|
|
23137
|
-
return Number.isNaN(parsed) ? defaultValue : parsed;
|
|
23138
|
-
}
|
|
23139
|
-
willUpdate(changed) {
|
|
23140
|
-
super.willUpdate(changed);
|
|
23141
|
-
if (changed.has(`value`) || !this.hasUpdated) {
|
|
23142
|
-
const valueLane = this.#lanes.get(`value`);
|
|
23143
|
-
if (valueLane && valueLane.type === `value`) valueLane.value = this.#getRelativeValue();
|
|
23144
|
-
}
|
|
23145
|
-
}
|
|
23146
|
-
render() {
|
|
23147
|
-
const lanes = Array.from(this.#lanes.values());
|
|
23148
|
-
const { angle, position } = getMarkerPosition(this.#getRelativeValue(), this.valueMode, this.flatten, this.radius, CENTER);
|
|
23149
|
-
const needleLength = this.#getCssVar(`--marker-length`, .8);
|
|
23150
|
-
const needleOffset = this.#getCssVar(`--marker-offset`, .2);
|
|
23151
|
-
const markerBorderWidth = this.#getCssVar(`--marker-border-width`, 0);
|
|
23152
|
-
const needlePath = markerBorderWidth > 0 ? this.#getNeedlePath(angle, needleLength, needleOffset) : void 0;
|
|
23153
|
-
const dotR = this.#getCssVar(`--marker-thickness`, .15) * this.radius;
|
|
23154
|
-
const defs = [];
|
|
23155
|
-
if (needlePath) defs.push(w`<path id="needle-path" d="${needlePath}" />`);
|
|
23156
|
-
if (markerBorderWidth > 0) defs.push(w`<circle id="dot-path" cx="${position.x}" cy="${position.y}" r="${dotR}" />`);
|
|
23157
|
-
return b`
|
|
23158
|
-
<svg
|
|
23159
|
-
viewBox="0 0 100 100"
|
|
23160
|
-
preserveAspectRatio="xMidYMid meet"
|
|
23161
|
-
tabindex="${this.disabled ? -1 : 0}"
|
|
23162
|
-
@pointerdown="${this.#onPointerDown}"
|
|
23163
|
-
@keydown="${this.#onKeyDown}"
|
|
23164
|
-
style="cursor: ${this.#dragging ? `ns-resize` : `grab`}"
|
|
23165
|
-
>
|
|
23166
|
-
${defs.length > 0 ? w`<defs>${defs}</defs>` : ``}
|
|
23167
|
-
${this.#renderCircleFill()}
|
|
23168
|
-
${this.wedge ? this.#renderWedge() : ``}
|
|
23169
|
-
${this.#renderCircleBorder()}
|
|
23170
|
-
${lanes.map((lane) => this.#renderLane(lane))}
|
|
23171
|
-
${this.#renderMidpointMarker()}
|
|
23172
|
-
${this.#renderValueMarker(needlePath)}
|
|
23173
|
-
</svg>
|
|
23174
|
-
`;
|
|
23175
|
-
}
|
|
23176
|
-
updated(changed) {
|
|
23177
|
-
super.updated(changed);
|
|
23178
|
-
if (changed.has(`radius`)) this.style.setProperty(`--radius`, `${this.radius}%`);
|
|
23179
|
-
this.style.setProperty(`--value-relative`, this.#getRelativeValue().toString());
|
|
23180
|
-
if (changed.has(`flatten`)) {
|
|
23181
|
-
const markerThickness = this.#getCssVar(`--marker-thickness`, .15);
|
|
23182
|
-
const radius = this.#getCssVar(`--radius`, 45);
|
|
23183
|
-
const markerPadding = Math.round(markerThickness * radius) + 5;
|
|
23184
|
-
const viewBoxHeight = Math.round(100 * (1 - this.flatten)) + markerPadding;
|
|
23185
|
-
this.style.setProperty(`--dial-height`, `${viewBoxHeight}px`);
|
|
23186
|
-
const svg = this.renderRoot.querySelector(`svg`);
|
|
23187
|
-
if (svg) svg.setAttribute(`viewBox`, `0 0 100 ${viewBoxHeight}`);
|
|
23188
|
-
}
|
|
23189
|
-
}
|
|
23190
|
-
disconnectedCallback() {
|
|
23191
|
-
super.disconnectedCallback();
|
|
23192
|
-
if (this.#changeDebounceTimer !== void 0) clearTimeout(this.#changeDebounceTimer);
|
|
23193
|
-
this.#onPointerUp();
|
|
23194
|
-
}
|
|
23195
|
-
firstUpdated() {
|
|
23196
|
-
const markerThickness = this.#getCssVar(`--marker-thickness`, .15);
|
|
23197
|
-
const radius = this.#getCssVar(`--radius`, 45);
|
|
23198
|
-
const markerPadding = Math.round(markerThickness * radius);
|
|
23199
|
-
const viewBoxHeight = Math.round(100 * (1 - this.flatten)) + markerPadding;
|
|
23200
|
-
this.style.setProperty(`--dial-height`, `${viewBoxHeight}px`);
|
|
23201
|
-
const svg = this.renderRoot.querySelector(`svg`);
|
|
23202
|
-
if (svg) svg.setAttribute(`viewBox`, `0 0 100 ${viewBoxHeight}`);
|
|
23203
23042
|
}
|
|
23204
23043
|
static {
|
|
23205
|
-
this.styles =
|
|
23044
|
+
this.styles = i$6`
|
|
23206
23045
|
:host {
|
|
23207
|
-
|
|
23208
|
-
width:
|
|
23209
|
-
|
|
23210
|
-
|
|
23211
|
-
|
|
23212
|
-
tabindex: 0;
|
|
23046
|
+
--hex-row-height: 24px;
|
|
23047
|
+
--hex-offset-width: 8ch;
|
|
23048
|
+
--hex-font: monospace;
|
|
23049
|
+
--hex-font-size: 0.85rem;
|
|
23050
|
+
--hex-changed-weight: bold;
|
|
23213
23051
|
|
|
23214
|
-
|
|
23215
|
-
--
|
|
23052
|
+
--ascii-null: #808080;
|
|
23053
|
+
--ascii-printable: #4caf50;
|
|
23054
|
+
--ascii-whitespace: #ffffff;
|
|
23055
|
+
--ascii-control: #f48fb1;
|
|
23056
|
+
--ascii-other: #ffeb3b;
|
|
23216
23057
|
|
|
23217
|
-
|
|
23218
|
-
--
|
|
23219
|
-
--
|
|
23220
|
-
--
|
|
23058
|
+
--shade-null: #808080;
|
|
23059
|
+
--shade-max: #ffffff;
|
|
23060
|
+
--shade-step-start: #ff0000;
|
|
23061
|
+
--shade-step-end: #0000ff;
|
|
23062
|
+
|
|
23063
|
+
display: block;
|
|
23064
|
+
font-family: var(--hex-font);
|
|
23065
|
+
font-size: var(--hex-font-size);
|
|
23221
23066
|
}
|
|
23222
23067
|
|
|
23223
|
-
|
|
23224
|
-
|
|
23068
|
+
.hex-editor {
|
|
23069
|
+
display: flex;
|
|
23070
|
+
flex-direction: column;
|
|
23071
|
+
height: 300px;
|
|
23072
|
+
overflow: hidden;
|
|
23073
|
+
background: #1e1e1e;
|
|
23074
|
+
color: #e0e0e0;
|
|
23075
|
+
border: 1px solid #333;
|
|
23076
|
+
border-radius: 4px;
|
|
23225
23077
|
}
|
|
23226
23078
|
|
|
23227
|
-
|
|
23228
|
-
|
|
23229
|
-
|
|
23230
|
-
|
|
23079
|
+
.scroll-container {
|
|
23080
|
+
flex: 1;
|
|
23081
|
+
overflow-y: auto;
|
|
23082
|
+
position: relative;
|
|
23231
23083
|
}
|
|
23232
23084
|
|
|
23233
|
-
|
|
23234
|
-
|
|
23085
|
+
.header {
|
|
23086
|
+
display: flex;
|
|
23087
|
+
background: #2d2d2d;
|
|
23088
|
+
font-weight: bold;
|
|
23089
|
+
border-bottom: 1px solid #444;
|
|
23090
|
+
height: var(--hex-row-height);
|
|
23091
|
+
flex-shrink: 0;
|
|
23092
|
+
align-items: center;
|
|
23235
23093
|
}
|
|
23236
23094
|
|
|
23237
|
-
|
|
23238
|
-
|
|
23239
|
-
|
|
23095
|
+
.row {
|
|
23096
|
+
display: flex;
|
|
23097
|
+
height: var(--hex-row-height);
|
|
23098
|
+
align-items: center;
|
|
23240
23099
|
}
|
|
23241
23100
|
|
|
23242
|
-
.
|
|
23243
|
-
|
|
23244
|
-
stroke: var(--dial-border-color, var(--surface-4));
|
|
23245
|
-
stroke-width: var(--dial-border-width, 2px);
|
|
23246
|
-
stroke-linecap: round;
|
|
23247
|
-
vector-effect: non-scaling-stroke;
|
|
23101
|
+
.row:hover {
|
|
23102
|
+
background: rgba(255, 255, 255, 0.05);
|
|
23248
23103
|
}
|
|
23249
23104
|
|
|
23250
|
-
.
|
|
23251
|
-
|
|
23105
|
+
.offset-cell {
|
|
23106
|
+
width: var(--hex-offset-width);
|
|
23107
|
+
padding: 0 8px;
|
|
23108
|
+
text-align: right;
|
|
23109
|
+
color: #888;
|
|
23110
|
+
flex-shrink: 0;
|
|
23111
|
+
box-sizing: border-box;
|
|
23252
23112
|
}
|
|
23253
23113
|
|
|
23254
|
-
.
|
|
23255
|
-
|
|
23256
|
-
|
|
23257
|
-
|
|
23258
|
-
stroke-width: var(--wedge-border-width, 0);
|
|
23259
|
-
stroke-opacity: var(--wedge-border-opacity, 1);
|
|
23260
|
-
vector-effect: non-scaling-stroke;
|
|
23114
|
+
.col-group {
|
|
23115
|
+
display: inline-flex;
|
|
23116
|
+
gap: 4px;
|
|
23117
|
+
margin-right: 16px;
|
|
23261
23118
|
}
|
|
23262
23119
|
|
|
23263
|
-
.
|
|
23264
|
-
|
|
23265
|
-
|
|
23266
|
-
|
|
23267
|
-
|
|
23268
|
-
|
|
23120
|
+
.col-header {
|
|
23121
|
+
width: calc(8ch + 28px);
|
|
23122
|
+
padding: 0 8px;
|
|
23123
|
+
color: #555;
|
|
23124
|
+
text-align: right;
|
|
23125
|
+
flex-shrink: 0;
|
|
23126
|
+
box-sizing: border-box;
|
|
23269
23127
|
}
|
|
23270
23128
|
|
|
23271
|
-
.
|
|
23272
|
-
|
|
23129
|
+
.col-header.active {
|
|
23130
|
+
color: #aaa;
|
|
23273
23131
|
}
|
|
23274
23132
|
|
|
23275
|
-
.
|
|
23276
|
-
|
|
23133
|
+
.text-header {
|
|
23134
|
+
padding: 4px 8px;
|
|
23135
|
+
color: #555;
|
|
23136
|
+
width: calc(var(--columns, 4) * 4 * 1ch);
|
|
23137
|
+
box-sizing: border-box;
|
|
23138
|
+
flex-shrink: 0;
|
|
23277
23139
|
}
|
|
23278
23140
|
|
|
23279
|
-
.
|
|
23280
|
-
|
|
23141
|
+
.text-header.active {
|
|
23142
|
+
color: #aaa;
|
|
23281
23143
|
}
|
|
23282
23144
|
|
|
23283
|
-
.
|
|
23284
|
-
|
|
23285
|
-
|
|
23286
|
-
|
|
23287
|
-
|
|
23288
|
-
|
|
23289
|
-
|
|
23290
|
-
vector-effect: non-scaling-stroke;
|
|
23145
|
+
.hex-cell, .text-char {
|
|
23146
|
+
display: inline-block;
|
|
23147
|
+
width: 2ch;
|
|
23148
|
+
text-align: center;
|
|
23149
|
+
cursor: pointer;
|
|
23150
|
+
user-select: none;
|
|
23151
|
+
padding: 2px 0;
|
|
23291
23152
|
}
|
|
23292
23153
|
|
|
23293
|
-
.
|
|
23294
|
-
|
|
23295
|
-
stroke-width: calc((var(--marker-thickness, 0.15) + var(--marker-border-width, 0) * 2) * var(--radius, 45%));
|
|
23296
|
-
stroke-linecap: round;
|
|
23297
|
-
vector-effect: non-scaling-stroke;
|
|
23154
|
+
.hex-cell.selected, .text-char.selected {
|
|
23155
|
+
background: rgba(100, 149, 237, 0.4);
|
|
23298
23156
|
}
|
|
23299
23157
|
|
|
23300
|
-
.
|
|
23301
|
-
|
|
23158
|
+
.hex-cell.changed, .text-char.changed {
|
|
23159
|
+
font-weight: var(--hex-changed-weight);
|
|
23302
23160
|
}
|
|
23303
23161
|
|
|
23304
|
-
.
|
|
23305
|
-
|
|
23306
|
-
fill: var(--marker-color, var(--accent));
|
|
23162
|
+
.hex-cell.editing {
|
|
23163
|
+
background: rgba(255, 215, 0, 0.3);
|
|
23307
23164
|
}
|
|
23308
23165
|
|
|
23309
|
-
|
|
23310
|
-
|
|
23311
|
-
|
|
23312
|
-
|
|
23313
|
-
vector-effect: non-scaling-stroke;
|
|
23166
|
+
|
|
23167
|
+
.text-area {
|
|
23168
|
+
display: inline-flex;
|
|
23169
|
+
gap: 0;
|
|
23314
23170
|
}
|
|
23315
23171
|
|
|
23316
|
-
.
|
|
23317
|
-
|
|
23318
|
-
|
|
23319
|
-
stroke-width: var(--midpoint-border-width, 0);
|
|
23320
|
-
vector-effect: non-scaling-stroke;
|
|
23172
|
+
.text-char {
|
|
23173
|
+
width: 1ch;
|
|
23174
|
+
text-align: left;
|
|
23321
23175
|
}
|
|
23322
|
-
|
|
23176
|
+
|
|
23177
|
+
.byte-null { color: var(--ascii-null); }
|
|
23178
|
+
.byte-printable { color: var(--ascii-printable); }
|
|
23179
|
+
.byte-whitespace { color: var(--ascii-whitespace); }
|
|
23180
|
+
.byte-control { color: var(--ascii-control); }
|
|
23181
|
+
.byte-other { color: var(--ascii-other); }
|
|
23182
|
+
`;
|
|
23323
23183
|
}
|
|
23324
|
-
|
|
23325
|
-
|
|
23326
|
-
|
|
23327
|
-
|
|
23328
|
-
|
|
23329
|
-
|
|
23330
|
-
|
|
23331
|
-
__decorate([n$2({
|
|
23332
|
-
type: String,
|
|
23333
|
-
attribute: `value-mode`
|
|
23334
|
-
})], RadialInputElement.prototype, "valueMode", void 0);
|
|
23335
|
-
__decorate([n$2({ type: Number })], RadialInputElement.prototype, "flatten", void 0);
|
|
23336
|
-
__decorate([n$2({
|
|
23337
|
-
type: String,
|
|
23338
|
-
attribute: `marker-style`
|
|
23339
|
-
})], RadialInputElement.prototype, "markerStyle", void 0);
|
|
23340
|
-
__decorate([n$2({ type: Boolean })], RadialInputElement.prototype, "wedge", void 0);
|
|
23341
|
-
__decorate([n$2({
|
|
23342
|
-
type: Boolean,
|
|
23343
|
-
reflect: true
|
|
23344
|
-
})], RadialInputElement.prototype, "disabled", void 0);
|
|
23345
|
-
RadialInputElement = __decorate([t$4(`ixfx-radial-input`)], RadialInputElement);
|
|
23346
|
-
//#endregion
|
|
23347
|
-
//#region src/labelled-radial-input/labelled-radial-input.ts
|
|
23348
|
-
let LabelledRadialInput = class LabelledRadialInput extends LabelledInputBase {
|
|
23349
|
-
constructor(..._args) {
|
|
23350
|
-
super(..._args);
|
|
23351
|
-
this.inputSelector = `ixfx-radial-input`;
|
|
23352
|
-
this.max = 100;
|
|
23353
|
-
this.step = 1;
|
|
23354
|
-
this.radius = 45;
|
|
23355
|
-
this.flatten = .3;
|
|
23356
|
-
this.markerStyle = `needle`;
|
|
23357
|
-
this.wedge = false;
|
|
23358
|
-
this.valueMode = `range`;
|
|
23359
|
-
this.tooltip = false;
|
|
23360
|
-
this.flip = false;
|
|
23361
|
-
this.aspectRatioThreshold = 1.5;
|
|
23362
|
-
this._isWide = false;
|
|
23184
|
+
setData(data) {
|
|
23185
|
+
this._store = createHexStore(data);
|
|
23186
|
+
this._undoStack = createUndoRedoStack();
|
|
23187
|
+
this._selection = null;
|
|
23188
|
+
this._editState = null;
|
|
23189
|
+
this._scrollTop = 0;
|
|
23190
|
+
this.requestUpdate();
|
|
23363
23191
|
}
|
|
23364
|
-
|
|
23365
|
-
|
|
23366
|
-
if (
|
|
23367
|
-
|
|
23368
|
-
|
|
23192
|
+
undo() {
|
|
23193
|
+
const diff = undo(this._undoStack);
|
|
23194
|
+
if (!diff) return;
|
|
23195
|
+
const reverse = reverseDiff(diff);
|
|
23196
|
+
applyDiff(this._store, reverse);
|
|
23197
|
+
this.requestUpdate();
|
|
23198
|
+
}
|
|
23199
|
+
redo() {
|
|
23200
|
+
const diff = redo(this._undoStack);
|
|
23201
|
+
if (!diff) return;
|
|
23202
|
+
applyDiff(this._store, diff);
|
|
23203
|
+
this.requestUpdate();
|
|
23204
|
+
}
|
|
23205
|
+
recomputeColours() {
|
|
23206
|
+
const style = getComputedStyle(this);
|
|
23207
|
+
const nullC = style.getPropertyValue(`--shade-null`).trim() || `#808080`;
|
|
23208
|
+
const maxC = style.getPropertyValue(`--shade-max`).trim() || `#ffffff`;
|
|
23209
|
+
const stepStart = style.getPropertyValue(`--shade-step-start`).trim() || `#ff0000`;
|
|
23210
|
+
const stepEnd = style.getPropertyValue(`--shade-step-end`).trim() || `#0000ff`;
|
|
23211
|
+
this._shadeMap = createShadeMap(nullC, maxC, stepStart, stepEnd);
|
|
23212
|
+
this.requestUpdate();
|
|
23213
|
+
}
|
|
23214
|
+
*selectedBytes() {
|
|
23215
|
+
const positions = getSelectedPositions(this._selection, this.columns);
|
|
23216
|
+
for (let i = 0; i < positions.length; i++) {
|
|
23217
|
+
const pos = positions[i];
|
|
23218
|
+
yield {
|
|
23219
|
+
selection_index: i,
|
|
23220
|
+
array_index: pos,
|
|
23221
|
+
value: readByte(this._store, pos)
|
|
23222
|
+
};
|
|
23369
23223
|
}
|
|
23370
|
-
return this.max - this.min > 10 ? 0 : 2;
|
|
23371
23224
|
}
|
|
23372
|
-
|
|
23373
|
-
|
|
23374
|
-
const { width, height } = entries[0].contentRect;
|
|
23375
|
-
this._isWide = height > 0 && width / height >= this.aspectRatioThreshold;
|
|
23225
|
+
containsPosition(pos) {
|
|
23226
|
+
return selectionContains(this._selection, pos, this.columns);
|
|
23376
23227
|
}
|
|
23377
|
-
|
|
23378
|
-
|
|
23379
|
-
|
|
23380
|
-
|
|
23381
|
-
|
|
23382
|
-
|
|
23383
|
-
|
|
23384
|
-
no-drag
|
|
23385
|
-
.value=${String(this.value)}
|
|
23386
|
-
.min=${this.min}
|
|
23387
|
-
.max=${this.max}
|
|
23388
|
-
.step=${this.step}
|
|
23389
|
-
.dragSensitivity=${this.dragSensitivity}
|
|
23390
|
-
.precision=${this._getEffectivePrecision()}
|
|
23391
|
-
.displayText=${this.label}
|
|
23392
|
-
.displayTextLogic=${this._isDragging ? `hidden` : this.displayTextLogic}
|
|
23393
|
-
.formatter=${this._formatter}
|
|
23394
|
-
style="--label-min-width: var(--label-width, ${labelMinWidth}ch); --label-align: center;"
|
|
23395
|
-
@change=${this._handleNumberChange}
|
|
23396
|
-
></ixfx-editable-number>
|
|
23397
|
-
`;
|
|
23228
|
+
selectSingle(position) {
|
|
23229
|
+
this._selection = {
|
|
23230
|
+
kind: `single`,
|
|
23231
|
+
pos: position
|
|
23232
|
+
};
|
|
23233
|
+
this._dispatchSelectEvent();
|
|
23234
|
+
this.requestUpdate();
|
|
23398
23235
|
}
|
|
23399
|
-
|
|
23400
|
-
|
|
23401
|
-
|
|
23402
|
-
|
|
23403
|
-
|
|
23404
|
-
|
|
23405
|
-
|
|
23406
|
-
|
|
23407
|
-
.value=${this.value}
|
|
23408
|
-
.min=${this.min}
|
|
23409
|
-
.max=${this.max}
|
|
23410
|
-
.step=${this.step}
|
|
23411
|
-
.radius=${this.radius}
|
|
23412
|
-
.flatten=${this.flatten}
|
|
23413
|
-
.markerStyle=${this.markerStyle}
|
|
23414
|
-
?wedge=${this.wedge}
|
|
23415
|
-
.valueMode=${this.valueMode}
|
|
23416
|
-
data-tooltip-anchor="top"
|
|
23417
|
-
data-tooltip=${tooltipValue}
|
|
23418
|
-
data-tooltip-live=${showTooltip ? `input` : A}
|
|
23419
|
-
@input=${this._handleSliderInput}
|
|
23420
|
-
@change=${this._handleInputChange}
|
|
23421
|
-
></ixfx-radial-input>
|
|
23422
|
-
</div>
|
|
23423
|
-
`;
|
|
23236
|
+
selectContiguous(start, end) {
|
|
23237
|
+
this._selection = {
|
|
23238
|
+
kind: `contiguous`,
|
|
23239
|
+
start,
|
|
23240
|
+
end
|
|
23241
|
+
};
|
|
23242
|
+
this._dispatchSelectEvent();
|
|
23243
|
+
this.requestUpdate();
|
|
23424
23244
|
}
|
|
23425
|
-
|
|
23426
|
-
|
|
23427
|
-
|
|
23428
|
-
|
|
23429
|
-
|
|
23430
|
-
|
|
23245
|
+
selectRectangular(x, y, width, height) {
|
|
23246
|
+
this._selection = {
|
|
23247
|
+
kind: `rectangular`,
|
|
23248
|
+
x,
|
|
23249
|
+
y,
|
|
23250
|
+
width,
|
|
23251
|
+
height
|
|
23252
|
+
};
|
|
23253
|
+
this._dispatchSelectEvent();
|
|
23254
|
+
this.requestUpdate();
|
|
23431
23255
|
}
|
|
23432
|
-
|
|
23433
|
-
this.
|
|
23434
|
-
|
|
23435
|
-
|
|
23436
|
-
min-height: var(--min-height, 60px);
|
|
23437
|
-
min-width: var(--min-width, 60px);
|
|
23438
|
-
width: var(--width, auto);
|
|
23439
|
-
height: var(--height, auto);
|
|
23440
|
-
}
|
|
23441
|
-
|
|
23442
|
-
:host(:focus-within) {
|
|
23443
|
-
outline: 2px solid var(--accent);
|
|
23444
|
-
outline-offset: 2px;
|
|
23445
|
-
}
|
|
23446
|
-
|
|
23447
|
-
.wrap {
|
|
23448
|
-
display: flex;
|
|
23449
|
-
width: 100%;
|
|
23450
|
-
height: 100%;
|
|
23451
|
-
align-items: center;
|
|
23452
|
-
justify-content: center;
|
|
23453
|
-
flex-direction: var(--flow, column);
|
|
23454
|
-
}
|
|
23455
|
-
|
|
23456
|
-
ixfx-editable-number {
|
|
23457
|
-
flex-shrink: 0;
|
|
23458
|
-
--label-align: center;
|
|
23459
|
-
width: 100%;
|
|
23460
|
-
}
|
|
23461
|
-
|
|
23462
|
-
ixfx-radial-input {
|
|
23463
|
-
flex-shrink: 1;
|
|
23464
|
-
min-height: 0;
|
|
23465
|
-
min-width: 0;
|
|
23466
|
-
max-width: 100%;
|
|
23467
|
-
--radial-input-svg-focus-outline: none;
|
|
23468
|
-
--radial-input-svg-focus-outline-offset: 0;
|
|
23469
|
-
--prominence-tickled-opacity: 1;
|
|
23470
|
-
--prominence-tickled-saturate: 1;
|
|
23471
|
-
}
|
|
23472
|
-
|
|
23473
|
-
/* Wide layout (aspect ratio >= threshold): label to the left of dial */
|
|
23474
|
-
.wrap.wide {
|
|
23475
|
-
flex-direction: var(--flow, row);
|
|
23476
|
-
justify-content: space-evenly;
|
|
23477
|
-
}
|
|
23478
|
-
|
|
23479
|
-
.wrap.wide ixfx-editable-number {
|
|
23480
|
-
--label-align: left;
|
|
23481
|
-
width: var(--label-width, 5ch);
|
|
23482
|
-
}
|
|
23483
|
-
|
|
23484
|
-
.wrap.wide ixfx-radial-input {
|
|
23485
|
-
height: auto;
|
|
23486
|
-
max-width: none;
|
|
23487
|
-
}
|
|
23488
|
-
|
|
23489
|
-
/* Flip: label after dial (bottom in column, right in row) */
|
|
23490
|
-
.wrap.flip ixfx-editable-number {
|
|
23491
|
-
order: 1;
|
|
23492
|
-
}
|
|
23493
|
-
|
|
23494
|
-
/* Mini mode: dial fills the component */
|
|
23495
|
-
.wrap.mini {
|
|
23496
|
-
justify-content: center;
|
|
23497
|
-
gap: 0;
|
|
23498
|
-
}
|
|
23499
|
-
|
|
23500
|
-
.wrap.mini ixfx-radial-input {
|
|
23501
|
-
width: 100%;
|
|
23502
|
-
height: 100%;
|
|
23503
|
-
}
|
|
23504
|
-
`;
|
|
23256
|
+
clearSelection() {
|
|
23257
|
+
this._selection = null;
|
|
23258
|
+
this._dispatchSelectEvent();
|
|
23259
|
+
this.requestUpdate();
|
|
23505
23260
|
}
|
|
23506
|
-
|
|
23507
|
-
|
|
23508
|
-
|
|
23509
|
-
|
|
23510
|
-
|
|
23511
|
-
|
|
23512
|
-
|
|
23513
|
-
|
|
23514
|
-
|
|
23515
|
-
|
|
23516
|
-
|
|
23517
|
-
})], LabelledRadialInput.prototype, "valueMode", void 0);
|
|
23518
|
-
__decorate([n$2({ type: Boolean })], LabelledRadialInput.prototype, "tooltip", void 0);
|
|
23519
|
-
__decorate([n$2({ type: Boolean })], LabelledRadialInput.prototype, "flip", void 0);
|
|
23520
|
-
__decorate([n$2({
|
|
23521
|
-
type: Number,
|
|
23522
|
-
attribute: `aspect-ratio-threshold`
|
|
23523
|
-
})], LabelledRadialInput.prototype, "aspectRatioThreshold", void 0);
|
|
23524
|
-
__decorate([r$1()], LabelledRadialInput.prototype, "_isWide", void 0);
|
|
23525
|
-
LabelledRadialInput = __decorate([t$4(`ixfx-labelled-radial-input`)], LabelledRadialInput);
|
|
23526
|
-
//#endregion
|
|
23527
|
-
//#region node_modules/.pnpm/lit-html@3.3.2/node_modules/lit-html/directive-helpers.js
|
|
23528
|
-
/**
|
|
23529
|
-
* @license
|
|
23530
|
-
* Copyright 2020 Google LLC
|
|
23531
|
-
* SPDX-License-Identifier: BSD-3-Clause
|
|
23532
|
-
*/ const { I: t$1 } = j$1, i = (o) => o, s = () => document.createComment(""), v = (o, n, e) => {
|
|
23533
|
-
const l = o._$AA.parentNode, d = void 0 === n ? o._$AB : n._$AA;
|
|
23534
|
-
if (void 0 === e) e = new t$1(l.insertBefore(s(), d), l.insertBefore(s(), d), o, o.options);
|
|
23535
|
-
else {
|
|
23536
|
-
const t = e._$AB.nextSibling, n = e._$AM, c = n !== o;
|
|
23537
|
-
if (c) {
|
|
23538
|
-
let t;
|
|
23539
|
-
e._$AQ?.(o), e._$AM = o, void 0 !== e._$AP && (t = o._$AU) !== n._$AU && e._$AP(t);
|
|
23261
|
+
getSelection() {
|
|
23262
|
+
return this._selection;
|
|
23263
|
+
}
|
|
23264
|
+
firstUpdated() {
|
|
23265
|
+
const container = this.shadowRoot?.querySelector(`.scroll-container`);
|
|
23266
|
+
if (container) {
|
|
23267
|
+
new ResizeObserver((entries) => {
|
|
23268
|
+
this._containerH = entries[0].contentRect.height;
|
|
23269
|
+
this.requestUpdate();
|
|
23270
|
+
}).observe(container);
|
|
23271
|
+
this._containerH = container.clientHeight;
|
|
23540
23272
|
}
|
|
23541
|
-
|
|
23542
|
-
|
|
23543
|
-
|
|
23544
|
-
|
|
23545
|
-
|
|
23273
|
+
this.recomputeColours();
|
|
23274
|
+
}
|
|
23275
|
+
_onPointerDown(pos, side, e) {
|
|
23276
|
+
e.preventDefault();
|
|
23277
|
+
if (e.button !== 0) return;
|
|
23278
|
+
(this.shadowRoot?.querySelector(`.hex-editor`))?.focus();
|
|
23279
|
+
this._focusSide = side;
|
|
23280
|
+
e.target.setPointerCapture(e.pointerId);
|
|
23281
|
+
const bpr = bytesPerRow(this.columns);
|
|
23282
|
+
const startX = pos % bpr;
|
|
23283
|
+
const startY = Math.floor(pos / bpr);
|
|
23284
|
+
if (e.metaKey || e.ctrlKey) {
|
|
23285
|
+
this._pointerMode = `select-rect`;
|
|
23286
|
+
this._dragAnchor = pos;
|
|
23287
|
+
this._rectAnchorX = startX;
|
|
23288
|
+
this._rectAnchorY = startY;
|
|
23289
|
+
} else if (e.shiftKey) {
|
|
23290
|
+
this._pointerMode = `select-cont`;
|
|
23291
|
+
if (!this._selection || this._selection.kind !== `single`) this._dragAnchor = pos;
|
|
23292
|
+
else {
|
|
23293
|
+
this._dragAnchor = this._selection.pos;
|
|
23294
|
+
this._shiftClickTarget = pos;
|
|
23546
23295
|
}
|
|
23296
|
+
} else {
|
|
23297
|
+
this._pointerMode = `pending`;
|
|
23298
|
+
this._dragStart = {
|
|
23299
|
+
pos,
|
|
23300
|
+
startValue: readByte(this._store, pos),
|
|
23301
|
+
startY: e.clientY,
|
|
23302
|
+
startX: e.clientX
|
|
23303
|
+
};
|
|
23304
|
+
this._dragAnchor = pos;
|
|
23305
|
+
this._currentDragDiff = null;
|
|
23547
23306
|
}
|
|
23548
23307
|
}
|
|
23549
|
-
|
|
23550
|
-
|
|
23551
|
-
|
|
23552
|
-
|
|
23553
|
-
|
|
23554
|
-
|
|
23555
|
-
|
|
23556
|
-
* @license
|
|
23557
|
-
* Copyright 2017 Google LLC
|
|
23558
|
-
* SPDX-License-Identifier: BSD-3-Clause
|
|
23559
|
-
*/
|
|
23560
|
-
const u = (e, s, t) => {
|
|
23561
|
-
const r = /* @__PURE__ */ new Map();
|
|
23562
|
-
for (let l = s; l <= t; l++) r.set(e[l], l);
|
|
23563
|
-
return r;
|
|
23564
|
-
}, c = e$3(class extends i$2 {
|
|
23565
|
-
constructor(e) {
|
|
23566
|
-
if (super(e), e.type !== t$2.CHILD) throw Error("repeat() can only be used in text expressions");
|
|
23567
|
-
}
|
|
23568
|
-
dt(e, s, t) {
|
|
23569
|
-
let r;
|
|
23570
|
-
void 0 === t ? t = s : void 0 !== s && (r = s);
|
|
23571
|
-
const l = [], o = [];
|
|
23572
|
-
let i = 0;
|
|
23573
|
-
for (const s of e) l[i] = r ? r(s, i) : i, o[i] = t(s, i), i++;
|
|
23574
|
-
return {
|
|
23575
|
-
values: o,
|
|
23576
|
-
keys: l
|
|
23577
|
-
};
|
|
23578
|
-
}
|
|
23579
|
-
render(e, s, t) {
|
|
23580
|
-
return this.dt(e, s, t).values;
|
|
23581
|
-
}
|
|
23582
|
-
update(s, [t, r, c]) {
|
|
23583
|
-
const d = M(s), { values: p$3, keys: a } = this.dt(t, r, c);
|
|
23584
|
-
if (!Array.isArray(d)) return this.ut = a, p$3;
|
|
23585
|
-
const h$3 = this.ut ??= [], v$2 = [];
|
|
23586
|
-
let m, y, x = 0, j = d.length - 1, k = 0, w = p$3.length - 1;
|
|
23587
|
-
for (; x <= j && k <= w;) if (null === d[x]) x++;
|
|
23588
|
-
else if (null === d[j]) j--;
|
|
23589
|
-
else if (h$3[x] === a[k]) v$2[k] = u$1(d[x], p$3[k]), x++, k++;
|
|
23590
|
-
else if (h$3[j] === a[w]) v$2[w] = u$1(d[j], p$3[w]), j--, w--;
|
|
23591
|
-
else if (h$3[x] === a[w]) v$2[w] = u$1(d[x], p$3[w]), v(s, v$2[w + 1], d[x]), x++, w--;
|
|
23592
|
-
else if (h$3[j] === a[k]) v$2[k] = u$1(d[j], p$3[k]), v(s, d[x], d[j]), j--, k++;
|
|
23593
|
-
else if (void 0 === m && (m = u(a, k, w), y = u(h$3, x, j)), m.has(h$3[x])) if (m.has(h$3[j])) {
|
|
23594
|
-
const e = y.get(a[k]), t = void 0 !== e ? d[e] : null;
|
|
23595
|
-
if (null === t) {
|
|
23596
|
-
const e = v(s, d[x]);
|
|
23597
|
-
u$1(e, p$3[k]), v$2[k] = e;
|
|
23598
|
-
} else v$2[k] = u$1(t, p$3[k]), v(s, d[x], t), d[e] = null;
|
|
23599
|
-
k++;
|
|
23600
|
-
} else h(d[j]), j--;
|
|
23601
|
-
else h(d[x]), x++;
|
|
23602
|
-
for (; k <= w;) {
|
|
23603
|
-
const e = v(s, v$2[w + 1]);
|
|
23604
|
-
u$1(e, p$3[k]), v$2[k++] = e;
|
|
23308
|
+
_onPointerMove(pos, _side, e) {
|
|
23309
|
+
if (!this._dragStart) return;
|
|
23310
|
+
const dy = Math.abs(e.clientY - this._dragStart.startY);
|
|
23311
|
+
const dx = Math.abs(e.clientX - this._dragStart.startX);
|
|
23312
|
+
if (this._pointerMode === `pending` && dy > 4 && dy > dx) {
|
|
23313
|
+
this._pointerMode = `drag-value`;
|
|
23314
|
+
this._editState = null;
|
|
23605
23315
|
}
|
|
23606
|
-
|
|
23607
|
-
const
|
|
23608
|
-
|
|
23316
|
+
if (this._pointerMode === `drag-value`) {
|
|
23317
|
+
const delta = Math.round((e.clientY - this._dragStart.startY) / 4);
|
|
23318
|
+
const newValue = Math.max(0, Math.min(255, this._dragStart.startValue - delta));
|
|
23319
|
+
this._currentDragDiff = writeByte(this._store, pos, newValue);
|
|
23320
|
+
this.requestUpdate();
|
|
23321
|
+
}
|
|
23322
|
+
if (this._pointerMode === `select-cont`) {
|
|
23323
|
+
if (this._dragAnchor !== null) {
|
|
23324
|
+
const mode = `contiguous`;
|
|
23325
|
+
this._selection = selectionFromPointerRange(this._dragAnchor, pos, mode, this.columns);
|
|
23326
|
+
this._dispatchSelectEvent();
|
|
23327
|
+
}
|
|
23328
|
+
}
|
|
23329
|
+
if (this._pointerMode === `select-rect`) {
|
|
23330
|
+
const bpr = bytesPerRow(this.columns);
|
|
23331
|
+
const currentX = pos % bpr;
|
|
23332
|
+
const currentY = Math.floor(pos / bpr);
|
|
23333
|
+
const x = Math.min(this._rectAnchorX, currentX);
|
|
23334
|
+
const y = Math.min(this._rectAnchorY, currentY);
|
|
23335
|
+
const width = Math.abs(currentX - this._rectAnchorX) + 1;
|
|
23336
|
+
const height = Math.abs(currentY - this._rectAnchorY) + 1;
|
|
23337
|
+
this._selection = {
|
|
23338
|
+
kind: `rectangular`,
|
|
23339
|
+
x,
|
|
23340
|
+
y,
|
|
23341
|
+
width,
|
|
23342
|
+
height
|
|
23343
|
+
};
|
|
23344
|
+
this._dispatchSelectEvent();
|
|
23609
23345
|
}
|
|
23610
|
-
return this.ut = a, p(s, v$2), E;
|
|
23611
23346
|
}
|
|
23612
|
-
|
|
23613
|
-
|
|
23614
|
-
|
|
23615
|
-
|
|
23616
|
-
|
|
23617
|
-
|
|
23618
|
-
|
|
23619
|
-
|
|
23620
|
-
|
|
23621
|
-
|
|
23622
|
-
|
|
23623
|
-
|
|
23624
|
-
|
|
23625
|
-
};
|
|
23626
|
-
|
|
23627
|
-
return byte >= 32 && byte <= 126;
|
|
23628
|
-
};
|
|
23629
|
-
const getAsciiClass = (byte) => {
|
|
23630
|
-
if (byte === 0) return "byte-null";
|
|
23631
|
-
if (WHITESPACE_BYTES.has(byte)) return "byte-whitespace";
|
|
23632
|
-
if (isControlByte(byte)) return "byte-control";
|
|
23633
|
-
if (isPrintableAscii(byte)) return "byte-printable";
|
|
23634
|
-
return "byte-other";
|
|
23635
|
-
};
|
|
23636
|
-
const createShadeMap = (nullColour, maxColour, stepStart, stepEnd) => {
|
|
23637
|
-
const cssSteps = colour_exports.createSteps(stepStart, stepEnd, { steps: 16 }).map(colour_exports.toCssColour);
|
|
23638
|
-
return { forByte: (byte) => {
|
|
23639
|
-
if (byte === 0) return nullColour;
|
|
23640
|
-
if (byte === 255) return maxColour;
|
|
23641
|
-
return cssSteps[byte >> 4];
|
|
23642
|
-
} };
|
|
23643
|
-
};
|
|
23644
|
-
//#endregion
|
|
23645
|
-
//#region src/hex/data.ts
|
|
23646
|
-
const createHexStore = (data) => {
|
|
23647
|
-
return {
|
|
23648
|
-
data: new Uint8Array(data),
|
|
23649
|
-
changeset: /* @__PURE__ */ new Set()
|
|
23650
|
-
};
|
|
23651
|
-
};
|
|
23652
|
-
const readByte = (store, pos) => {
|
|
23653
|
-
return store.data[pos] ?? 0;
|
|
23654
|
-
};
|
|
23655
|
-
const length = (store) => {
|
|
23656
|
-
return store.data.length;
|
|
23657
|
-
};
|
|
23658
|
-
const clamp = (value) => {
|
|
23659
|
-
return Math.max(0, Math.min(255, value));
|
|
23660
|
-
};
|
|
23661
|
-
const writeByte = (store, pos, value) => {
|
|
23662
|
-
const clampedValue = clamp(value);
|
|
23663
|
-
const before = store.data[pos];
|
|
23664
|
-
const diff = new Map([[pos, {
|
|
23665
|
-
before,
|
|
23666
|
-
after: clampedValue
|
|
23667
|
-
}]]);
|
|
23668
|
-
store.data[pos] = clampedValue;
|
|
23669
|
-
store.changeset.add(pos);
|
|
23670
|
-
return diff;
|
|
23671
|
-
};
|
|
23672
|
-
const writeBytes = (store, entries) => {
|
|
23673
|
-
const diff = /* @__PURE__ */ new Map();
|
|
23674
|
-
entries.forEach((value, pos) => {
|
|
23675
|
-
const clampedValue = clamp(value);
|
|
23676
|
-
const before = store.data[pos];
|
|
23677
|
-
diff.set(pos, {
|
|
23678
|
-
before,
|
|
23679
|
-
after: clampedValue
|
|
23680
|
-
});
|
|
23681
|
-
store.data[pos] = clampedValue;
|
|
23682
|
-
store.changeset.add(pos);
|
|
23683
|
-
});
|
|
23684
|
-
return diff;
|
|
23685
|
-
};
|
|
23686
|
-
const applyDiff = (store, diff) => {
|
|
23687
|
-
const reverse = /* @__PURE__ */ new Map();
|
|
23688
|
-
diff.forEach((entry, pos) => {
|
|
23689
|
-
const before = store.data[pos];
|
|
23690
|
-
reverse.set(pos, {
|
|
23691
|
-
before: entry.after,
|
|
23692
|
-
after: before
|
|
23693
|
-
});
|
|
23694
|
-
store.data[pos] = entry.after;
|
|
23695
|
-
store.changeset.add(pos);
|
|
23696
|
-
});
|
|
23697
|
-
return reverse;
|
|
23698
|
-
};
|
|
23699
|
-
const reverseDiff = (diff) => {
|
|
23700
|
-
const reversed = /* @__PURE__ */ new Map();
|
|
23701
|
-
diff.forEach((entry, pos) => {
|
|
23702
|
-
reversed.set(pos, {
|
|
23703
|
-
before: entry.after,
|
|
23704
|
-
after: entry.before
|
|
23705
|
-
});
|
|
23706
|
-
});
|
|
23707
|
-
return reversed;
|
|
23708
|
-
};
|
|
23709
|
-
const getChangeset = (store) => {
|
|
23710
|
-
return store.changeset;
|
|
23711
|
-
};
|
|
23712
|
-
//#endregion
|
|
23713
|
-
//#region src/hex/diff.ts
|
|
23714
|
-
const createUndoRedoStack = () => {
|
|
23715
|
-
return {
|
|
23716
|
-
undos: [],
|
|
23717
|
-
redos: []
|
|
23718
|
-
};
|
|
23719
|
-
};
|
|
23720
|
-
const push = (stack, diff) => {
|
|
23721
|
-
stack.undos.push(diff);
|
|
23722
|
-
stack.redos = [];
|
|
23723
|
-
};
|
|
23724
|
-
const undo = (stack) => {
|
|
23725
|
-
const diff = stack.undos.pop();
|
|
23726
|
-
if (diff) stack.redos.push(diff);
|
|
23727
|
-
return diff;
|
|
23728
|
-
};
|
|
23729
|
-
const redo = (stack) => {
|
|
23730
|
-
const diff = stack.redos.pop();
|
|
23731
|
-
if (diff) stack.undos.push(diff);
|
|
23732
|
-
return diff;
|
|
23733
|
-
};
|
|
23734
|
-
//#endregion
|
|
23735
|
-
//#region src/hex/selection.ts
|
|
23736
|
-
const bytesPerRow = (columns) => columns * 4;
|
|
23737
|
-
const min = (a, b) => a < b ? a : b;
|
|
23738
|
-
const max = (a, b) => a > b ? a : b;
|
|
23739
|
-
const clampPos = (pos, dataLength) => {
|
|
23740
|
-
return Math.max(0, Math.min(pos, dataLength - 1));
|
|
23741
|
-
};
|
|
23742
|
-
const getSelectedPositions = (sel, columns) => {
|
|
23743
|
-
if (!sel) return [];
|
|
23744
|
-
const bpr = bytesPerRow(columns);
|
|
23745
|
-
if (sel.kind === "single") return [sel.pos];
|
|
23746
|
-
if (sel.kind === "contiguous") {
|
|
23747
|
-
const start = min(sel.start, sel.end);
|
|
23748
|
-
const end = max(sel.start, sel.end);
|
|
23749
|
-
const positions = [];
|
|
23750
|
-
for (let i = start; i <= end; i++) positions.push(i);
|
|
23751
|
-
return positions;
|
|
23752
|
-
}
|
|
23753
|
-
if (sel.kind === "rectangular") {
|
|
23754
|
-
const positions = [];
|
|
23755
|
-
for (let row = 0; row < sel.height; row++) for (let col = 0; col < sel.width; col++) {
|
|
23756
|
-
const y = sel.y + row;
|
|
23757
|
-
const x = sel.x + col;
|
|
23758
|
-
const pos = y * bpr + x;
|
|
23759
|
-
positions.push(pos);
|
|
23347
|
+
_onPointerUp(pos, side, e) {
|
|
23348
|
+
e.target.releasePointerCapture(e.pointerId);
|
|
23349
|
+
if (this._pointerMode === `pending`) {
|
|
23350
|
+
this._selection = {
|
|
23351
|
+
kind: `single`,
|
|
23352
|
+
pos
|
|
23353
|
+
};
|
|
23354
|
+
this._initialSelectionPoint = pos;
|
|
23355
|
+
this._currentCursorPoint = pos;
|
|
23356
|
+
this._editState = {
|
|
23357
|
+
pos,
|
|
23358
|
+
side,
|
|
23359
|
+
partial: ``
|
|
23360
|
+
};
|
|
23361
|
+
this._dispatchSelectEvent();
|
|
23760
23362
|
}
|
|
23761
|
-
|
|
23762
|
-
|
|
23763
|
-
|
|
23764
|
-
|
|
23765
|
-
|
|
23766
|
-
|
|
23767
|
-
|
|
23768
|
-
|
|
23769
|
-
|
|
23770
|
-
|
|
23771
|
-
|
|
23772
|
-
|
|
23773
|
-
|
|
23774
|
-
|
|
23775
|
-
|
|
23776
|
-
|
|
23777
|
-
|
|
23778
|
-
|
|
23779
|
-
|
|
23780
|
-
|
|
23781
|
-
|
|
23363
|
+
if (this._pointerMode === `select-cont`) {
|
|
23364
|
+
if (this._dragAnchor !== null && this._shiftClickTarget !== null) {
|
|
23365
|
+
this._selection = {
|
|
23366
|
+
kind: `contiguous`,
|
|
23367
|
+
start: this._dragAnchor,
|
|
23368
|
+
end: this._shiftClickTarget
|
|
23369
|
+
};
|
|
23370
|
+
this._initialSelectionPoint = Math.min(this._dragAnchor, this._shiftClickTarget);
|
|
23371
|
+
this._currentCursorPoint = Math.max(this._dragAnchor, this._shiftClickTarget);
|
|
23372
|
+
this._dispatchSelectEvent();
|
|
23373
|
+
} else if (this._dragAnchor !== null) {
|
|
23374
|
+
const mode = `contiguous`;
|
|
23375
|
+
this._selection = selectionFromPointerRange(this._dragAnchor, pos, mode, this.columns);
|
|
23376
|
+
this._initialSelectionPoint = this._dragAnchor;
|
|
23377
|
+
this._currentCursorPoint = pos;
|
|
23378
|
+
this._dispatchSelectEvent();
|
|
23379
|
+
}
|
|
23380
|
+
}
|
|
23381
|
+
if (this._pointerMode === `select-rect`) {
|
|
23382
|
+
const bpr = bytesPerRow(this.columns);
|
|
23383
|
+
const currentX = pos % bpr;
|
|
23384
|
+
const currentY = Math.floor(pos / bpr);
|
|
23385
|
+
const x = Math.min(this._rectAnchorX, currentX);
|
|
23386
|
+
const y = Math.min(this._rectAnchorY, currentY);
|
|
23387
|
+
const width = Math.abs(currentX - this._rectAnchorX) + 1;
|
|
23388
|
+
const height = Math.abs(currentY - this._rectAnchorY) + 1;
|
|
23389
|
+
this._selection = {
|
|
23390
|
+
kind: `rectangular`,
|
|
23391
|
+
x,
|
|
23392
|
+
y,
|
|
23393
|
+
width,
|
|
23394
|
+
height
|
|
23395
|
+
};
|
|
23396
|
+
this._dispatchSelectEvent();
|
|
23397
|
+
}
|
|
23398
|
+
if (this._pointerMode === `drag-value` && this._currentDragDiff) {
|
|
23399
|
+
push(this._undoStack, this._currentDragDiff);
|
|
23400
|
+
this._dispatchChangeEvent(this._currentDragDiff);
|
|
23401
|
+
}
|
|
23402
|
+
this._pointerMode = null;
|
|
23403
|
+
this._dragStart = null;
|
|
23404
|
+
this._dragAnchor = null;
|
|
23405
|
+
this._currentDragDiff = null;
|
|
23406
|
+
this._shiftClickTarget = null;
|
|
23782
23407
|
}
|
|
23783
|
-
|
|
23784
|
-
|
|
23785
|
-
|
|
23786
|
-
|
|
23787
|
-
|
|
23788
|
-
|
|
23789
|
-
|
|
23790
|
-
else if (sel.kind === "rectangular") currentPos = sel.y * bytesPerRow(columns) + sel.x + sel.width - 1;
|
|
23791
|
-
else currentPos = 0;
|
|
23792
|
-
const bpr = bytesPerRow(columns);
|
|
23793
|
-
let newPos;
|
|
23794
|
-
switch (dir) {
|
|
23795
|
-
case "left":
|
|
23796
|
-
newPos = currentPos - 1;
|
|
23797
|
-
break;
|
|
23798
|
-
case "right":
|
|
23799
|
-
newPos = currentPos + 1;
|
|
23800
|
-
break;
|
|
23801
|
-
case "up":
|
|
23802
|
-
newPos = currentPos - bpr;
|
|
23803
|
-
break;
|
|
23804
|
-
case "down":
|
|
23805
|
-
newPos = currentPos + bpr;
|
|
23806
|
-
break;
|
|
23807
|
-
default: newPos = currentPos;
|
|
23408
|
+
_handleBackspace() {
|
|
23409
|
+
if (!this._editState) return;
|
|
23410
|
+
this._editState = {
|
|
23411
|
+
...this._editState,
|
|
23412
|
+
partial: ``
|
|
23413
|
+
};
|
|
23414
|
+
this.requestUpdate();
|
|
23808
23415
|
}
|
|
23809
|
-
|
|
23810
|
-
|
|
23811
|
-
const
|
|
23812
|
-
|
|
23813
|
-
|
|
23814
|
-
|
|
23815
|
-
|
|
23816
|
-
|
|
23817
|
-
|
|
23818
|
-
|
|
23819
|
-
let x;
|
|
23820
|
-
let y;
|
|
23821
|
-
let width;
|
|
23822
|
-
let height;
|
|
23823
|
-
if (!sel || sel.kind === "single") {
|
|
23824
|
-
const pos = sel?.kind === "single" ? sel.pos : 0;
|
|
23825
|
-
x = pos % bpr;
|
|
23826
|
-
y = Math.floor(pos / bpr);
|
|
23827
|
-
width = 1;
|
|
23828
|
-
height = 1;
|
|
23829
|
-
} else if (sel.kind === "contiguous") {
|
|
23830
|
-
const start = min(sel.start, sel.end);
|
|
23831
|
-
const end = max(sel.start, sel.end);
|
|
23832
|
-
x = start % bpr;
|
|
23833
|
-
y = Math.floor(start / bpr);
|
|
23834
|
-
width = end - start + 1;
|
|
23835
|
-
height = 1;
|
|
23836
|
-
} else if (sel.kind === "rectangular") {
|
|
23837
|
-
x = sel.x;
|
|
23838
|
-
y = sel.y;
|
|
23839
|
-
width = sel.width;
|
|
23840
|
-
height = sel.height;
|
|
23841
|
-
} else {
|
|
23842
|
-
x = 0;
|
|
23843
|
-
y = 0;
|
|
23844
|
-
width = 1;
|
|
23845
|
-
height = 1;
|
|
23846
|
-
}
|
|
23847
|
-
const effectiveAnchorX = anchorX > 0 || sel?.kind === "rectangular" ? anchorX : x;
|
|
23848
|
-
const effectiveAnchorY = anchorY > 0 || sel?.kind === "rectangular" ? anchorY : y;
|
|
23849
|
-
switch (dir) {
|
|
23850
|
-
case "left":
|
|
23851
|
-
if (x > effectiveAnchorX) width -= 1;
|
|
23852
|
-
else if (x === effectiveAnchorX && width > 1) {
|
|
23853
|
-
x -= 1;
|
|
23854
|
-
width += 1;
|
|
23855
|
-
} else if (x > 0) {
|
|
23856
|
-
x -= 1;
|
|
23857
|
-
width += 1;
|
|
23858
|
-
}
|
|
23859
|
-
break;
|
|
23860
|
-
case "right":
|
|
23861
|
-
if (x + width < bpr) width += 1;
|
|
23862
|
-
break;
|
|
23863
|
-
case "up":
|
|
23864
|
-
if (y > effectiveAnchorY) height -= 1;
|
|
23865
|
-
else if (y === effectiveAnchorY && height > 1) {
|
|
23866
|
-
y -= 1;
|
|
23867
|
-
height += 1;
|
|
23868
|
-
} else if (y > 0) {
|
|
23869
|
-
y -= 1;
|
|
23870
|
-
height += 1;
|
|
23416
|
+
_handleValueEntry(key) {
|
|
23417
|
+
if (!this._editState) return;
|
|
23418
|
+
const { pos, side, partial } = this._editState;
|
|
23419
|
+
if (side === `text`) {
|
|
23420
|
+
if (key.length === 1 && key.charCodeAt(0) >= 32 && key.charCodeAt(0) <= 126) {
|
|
23421
|
+
const value = key.charCodeAt(0);
|
|
23422
|
+
const diff = writeByte(this._store, pos, value);
|
|
23423
|
+
push(this._undoStack, diff);
|
|
23424
|
+
this._dispatchChangeEvent(diff);
|
|
23425
|
+
this._advanceCursor();
|
|
23871
23426
|
}
|
|
23872
|
-
|
|
23873
|
-
|
|
23874
|
-
|
|
23875
|
-
|
|
23876
|
-
|
|
23877
|
-
|
|
23878
|
-
|
|
23879
|
-
x,
|
|
23880
|
-
y,
|
|
23881
|
-
width,
|
|
23882
|
-
height
|
|
23883
|
-
};
|
|
23884
|
-
};
|
|
23885
|
-
const selectionFromPointerRange = (start, end, mode, columns) => {
|
|
23886
|
-
const bpr = bytesPerRow(columns);
|
|
23887
|
-
if (mode === "contiguous") return {
|
|
23888
|
-
kind: "contiguous",
|
|
23889
|
-
start: min(start, end),
|
|
23890
|
-
end: max(start, end)
|
|
23891
|
-
};
|
|
23892
|
-
const startX = start % bpr;
|
|
23893
|
-
const startY = Math.floor(start / bpr);
|
|
23894
|
-
const endX = end % bpr;
|
|
23895
|
-
const endY = Math.floor(end / bpr);
|
|
23896
|
-
return {
|
|
23897
|
-
kind: "rectangular",
|
|
23898
|
-
x: min(startX, endX),
|
|
23899
|
-
y: min(startY, endY),
|
|
23900
|
-
width: Math.abs(endX - startX) + 1,
|
|
23901
|
-
height: Math.abs(endY - startY) + 1
|
|
23902
|
-
};
|
|
23903
|
-
};
|
|
23904
|
-
//#endregion
|
|
23905
|
-
//#region src/hex/hex-editor.ts
|
|
23906
|
-
let IxfxHexEditorElement = class IxfxHexEditorElement extends i$3 {
|
|
23907
|
-
constructor(..._args) {
|
|
23908
|
-
super(..._args);
|
|
23909
|
-
this.columns = 4;
|
|
23910
|
-
this.colourScheme = `ascii`;
|
|
23911
|
-
this.showChangeset = true;
|
|
23912
|
-
this.hideOffsetCol = false;
|
|
23913
|
-
this.hideHexCol = false;
|
|
23914
|
-
this.hideTextCol = false;
|
|
23915
|
-
this._selection = null;
|
|
23916
|
-
this._scrollTop = 0;
|
|
23917
|
-
this._editState = null;
|
|
23918
|
-
this._containerH = 0;
|
|
23919
|
-
this._shadeMap = null;
|
|
23920
|
-
this._focusSide = null;
|
|
23921
|
-
this._store = createHexStore(new Uint8Array(0));
|
|
23922
|
-
this._undoStack = createUndoRedoStack();
|
|
23923
|
-
this._copyBuffer = null;
|
|
23924
|
-
this._rowHeight = 24;
|
|
23925
|
-
this._dragStart = null;
|
|
23926
|
-
this._dragAnchor = null;
|
|
23927
|
-
this._rectAnchorX = 0;
|
|
23928
|
-
this._rectAnchorY = 0;
|
|
23929
|
-
this._rectAnchorXFromKeyboard = 0;
|
|
23930
|
-
this._rectAnchorYFromKeyboard = 0;
|
|
23931
|
-
this._initialSelectionPoint = 0;
|
|
23932
|
-
this._currentCursorPoint = 0;
|
|
23933
|
-
this._pointerMode = null;
|
|
23934
|
-
this._currentDragDiff = null;
|
|
23935
|
-
this._shiftClickTarget = null;
|
|
23936
|
-
this._onScroll = (e) => {
|
|
23937
|
-
const target = e.target;
|
|
23938
|
-
this._scrollTop = target.scrollTop;
|
|
23427
|
+
return;
|
|
23428
|
+
}
|
|
23429
|
+
if (partial === `` && key === `.`) {
|
|
23430
|
+
this._editState = {
|
|
23431
|
+
...this._editState,
|
|
23432
|
+
partial: `.`
|
|
23433
|
+
};
|
|
23939
23434
|
this.requestUpdate();
|
|
23940
|
-
|
|
23941
|
-
|
|
23942
|
-
|
|
23943
|
-
|
|
23944
|
-
|
|
23945
|
-
|
|
23946
|
-
|
|
23947
|
-
|
|
23948
|
-
|
|
23949
|
-
|
|
23950
|
-
if (this._editState) this._editState = null;
|
|
23951
|
-
const dir = e.key.replace(`Arrow`, ``).toLowerCase();
|
|
23952
|
-
const dataLen = length(this._store);
|
|
23953
|
-
const bpr = bytesPerRow(this.columns);
|
|
23954
|
-
if (e.metaKey || e.ctrlKey) {
|
|
23955
|
-
if (!this._selection || this._selection.kind !== `rectangular`) {
|
|
23956
|
-
let startPos = 0;
|
|
23957
|
-
if (this._selection?.kind === `single`) startPos = this._selection.pos;
|
|
23958
|
-
else if (this._selection?.kind === `contiguous`) startPos = Math.min(this._selection.start, this._selection.end);
|
|
23959
|
-
this._rectAnchorXFromKeyboard = startPos % bpr;
|
|
23960
|
-
this._rectAnchorYFromKeyboard = Math.floor(startPos / bpr);
|
|
23961
|
-
this._selection = {
|
|
23962
|
-
kind: `rectangular`,
|
|
23963
|
-
x: this._rectAnchorXFromKeyboard,
|
|
23964
|
-
y: this._rectAnchorYFromKeyboard,
|
|
23965
|
-
width: 1,
|
|
23966
|
-
height: 1
|
|
23967
|
-
};
|
|
23968
|
-
}
|
|
23969
|
-
this._selection = extendRectangular(this._selection, dir, this.columns, dataLen, this._rectAnchorXFromKeyboard, this._rectAnchorYFromKeyboard);
|
|
23970
|
-
} else if (e.shiftKey) {
|
|
23971
|
-
if (!this._selection) {
|
|
23972
|
-
this._initialSelectionPoint = 0;
|
|
23973
|
-
this._currentCursorPoint = 0;
|
|
23974
|
-
} else if (this._selection.kind === `single`) {
|
|
23975
|
-
this._initialSelectionPoint = this._selection.pos;
|
|
23976
|
-
this._currentCursorPoint = this._selection.pos;
|
|
23977
|
-
} else if (this._selection.kind === `rectangular`) {
|
|
23978
|
-
const cursorPos = this._selection.y * bpr + this._selection.x;
|
|
23979
|
-
this._initialSelectionPoint = cursorPos;
|
|
23980
|
-
this._currentCursorPoint = cursorPos;
|
|
23981
|
-
}
|
|
23982
|
-
const newPos = getCursorPos(this._selection, dir, this.columns, dataLen);
|
|
23983
|
-
const start = Math.min(this._initialSelectionPoint, newPos);
|
|
23984
|
-
const end = Math.max(this._initialSelectionPoint, newPos);
|
|
23985
|
-
this._currentCursorPoint = newPos;
|
|
23986
|
-
this._selection = {
|
|
23987
|
-
kind: `contiguous`,
|
|
23988
|
-
start,
|
|
23989
|
-
end
|
|
23990
|
-
};
|
|
23991
|
-
} else {
|
|
23992
|
-
this._selection = moveSelection(this._selection, dir, this.columns, dataLen);
|
|
23993
|
-
const pos = getCursorPos(this._selection, dir, this.columns, dataLen);
|
|
23994
|
-
this._initialSelectionPoint = pos;
|
|
23995
|
-
this._currentCursorPoint = pos;
|
|
23996
|
-
}
|
|
23997
|
-
this._dispatchSelectEvent();
|
|
23435
|
+
return;
|
|
23436
|
+
}
|
|
23437
|
+
if (partial.startsWith(`.`)) {
|
|
23438
|
+
if (/\d/.test(key)) {
|
|
23439
|
+
let newPartial = partial + key;
|
|
23440
|
+
if (Number(newPartial.slice(1)) > 255) newPartial = `.255`;
|
|
23441
|
+
this._editState = {
|
|
23442
|
+
...this._editState,
|
|
23443
|
+
partial: newPartial
|
|
23444
|
+
};
|
|
23998
23445
|
this.requestUpdate();
|
|
23999
|
-
return;
|
|
24000
23446
|
}
|
|
24001
|
-
|
|
24002
|
-
|
|
24003
|
-
|
|
24004
|
-
|
|
24005
|
-
|
|
24006
|
-
|
|
24007
|
-
|
|
24008
|
-
|
|
24009
|
-
|
|
24010
|
-
|
|
24011
|
-
|
|
23447
|
+
return;
|
|
23448
|
+
}
|
|
23449
|
+
if (`0123456789ABCDEFabcdef`.includes(key)) {
|
|
23450
|
+
const newPartial = (partial + key.toUpperCase()).slice(-2);
|
|
23451
|
+
this._editState = {
|
|
23452
|
+
...this._editState,
|
|
23453
|
+
partial: newPartial
|
|
23454
|
+
};
|
|
23455
|
+
this.requestUpdate();
|
|
23456
|
+
if (newPartial.length === 2) {
|
|
23457
|
+
const value = Number.parseInt(newPartial, 16);
|
|
23458
|
+
const diff = writeByte(this._store, pos, value);
|
|
23459
|
+
push(this._undoStack, diff);
|
|
23460
|
+
this._dispatchChangeEvent(diff);
|
|
23461
|
+
this._advanceCursor();
|
|
24012
23462
|
}
|
|
24013
|
-
|
|
24014
|
-
|
|
24015
|
-
|
|
24016
|
-
|
|
24017
|
-
|
|
24018
|
-
|
|
24019
|
-
|
|
24020
|
-
if (sel.kind === `contiguous`) {
|
|
24021
|
-
const c = sel;
|
|
24022
|
-
firstPos = Math.min(c.start, c.end);
|
|
24023
|
-
}
|
|
24024
|
-
if (sel.kind === `rectangular`) {
|
|
24025
|
-
const r = sel;
|
|
24026
|
-
firstPos = r.y * bytesPerRow(this.columns) + r.x;
|
|
24027
|
-
}
|
|
24028
|
-
this._selection = {
|
|
24029
|
-
kind: `single`,
|
|
24030
|
-
pos: firstPos
|
|
24031
|
-
};
|
|
24032
|
-
this._dispatchSelectEvent();
|
|
24033
|
-
}
|
|
24034
|
-
this.requestUpdate();
|
|
24035
|
-
return;
|
|
24036
|
-
}
|
|
24037
|
-
if (this._editState) {
|
|
24038
|
-
e.stopPropagation();
|
|
24039
|
-
if (e.key === `Backspace`) {
|
|
24040
|
-
this._handleBackspace();
|
|
24041
|
-
return;
|
|
24042
|
-
}
|
|
24043
|
-
if (e.key === `Enter`) {
|
|
24044
|
-
if (this._editState.side === `hex` && this._editState.partial.startsWith(`.`)) this._commitDecimalValue();
|
|
24045
|
-
return;
|
|
24046
|
-
}
|
|
24047
|
-
if (e.key.length === 1) this._handleValueEntry(e.key);
|
|
24048
|
-
return;
|
|
24049
|
-
}
|
|
24050
|
-
if (this._selection && this._selection.kind === `single` && e.key.length === 1) {
|
|
24051
|
-
e.preventDefault();
|
|
24052
|
-
e.stopPropagation();
|
|
24053
|
-
const pos = this._selection.pos;
|
|
24054
|
-
const side = this._focusSide ?? `hex`;
|
|
24055
|
-
this._editState = {
|
|
24056
|
-
pos,
|
|
24057
|
-
side,
|
|
24058
|
-
partial: ``
|
|
24059
|
-
};
|
|
24060
|
-
this._handleValueEntry(e.key);
|
|
24061
|
-
}
|
|
24062
|
-
};
|
|
23463
|
+
} else if (partial !== ``) {
|
|
23464
|
+
this._editState = {
|
|
23465
|
+
...this._editState,
|
|
23466
|
+
partial: ``
|
|
23467
|
+
};
|
|
23468
|
+
this.requestUpdate();
|
|
23469
|
+
}
|
|
24063
23470
|
}
|
|
24064
|
-
|
|
24065
|
-
this.
|
|
24066
|
-
|
|
24067
|
-
|
|
24068
|
-
|
|
24069
|
-
|
|
24070
|
-
|
|
24071
|
-
|
|
24072
|
-
|
|
24073
|
-
--ascii-null: #808080;
|
|
24074
|
-
--ascii-printable: #4caf50;
|
|
24075
|
-
--ascii-whitespace: #ffffff;
|
|
24076
|
-
--ascii-control: #f48fb1;
|
|
24077
|
-
--ascii-other: #ffeb3b;
|
|
24078
|
-
|
|
24079
|
-
--shade-null: #808080;
|
|
24080
|
-
--shade-max: #ffffff;
|
|
24081
|
-
--shade-step-start: #ff0000;
|
|
24082
|
-
--shade-step-end: #0000ff;
|
|
24083
|
-
|
|
24084
|
-
display: block;
|
|
24085
|
-
font-family: var(--hex-font);
|
|
24086
|
-
font-size: var(--hex-font-size);
|
|
24087
|
-
}
|
|
24088
|
-
|
|
24089
|
-
.hex-editor {
|
|
24090
|
-
display: flex;
|
|
24091
|
-
flex-direction: column;
|
|
24092
|
-
height: 300px;
|
|
24093
|
-
overflow: hidden;
|
|
24094
|
-
background: #1e1e1e;
|
|
24095
|
-
color: #e0e0e0;
|
|
24096
|
-
border: 1px solid #333;
|
|
24097
|
-
border-radius: 4px;
|
|
24098
|
-
}
|
|
24099
|
-
|
|
24100
|
-
.scroll-container {
|
|
24101
|
-
flex: 1;
|
|
24102
|
-
overflow-y: auto;
|
|
24103
|
-
position: relative;
|
|
24104
|
-
}
|
|
24105
|
-
|
|
24106
|
-
.header {
|
|
24107
|
-
display: flex;
|
|
24108
|
-
background: #2d2d2d;
|
|
24109
|
-
font-weight: bold;
|
|
24110
|
-
border-bottom: 1px solid #444;
|
|
24111
|
-
height: var(--hex-row-height);
|
|
24112
|
-
flex-shrink: 0;
|
|
24113
|
-
align-items: center;
|
|
24114
|
-
}
|
|
24115
|
-
|
|
24116
|
-
.row {
|
|
24117
|
-
display: flex;
|
|
24118
|
-
height: var(--hex-row-height);
|
|
24119
|
-
align-items: center;
|
|
24120
|
-
}
|
|
24121
|
-
|
|
24122
|
-
.row:hover {
|
|
24123
|
-
background: rgba(255, 255, 255, 0.05);
|
|
24124
|
-
}
|
|
24125
|
-
|
|
24126
|
-
.offset-cell {
|
|
24127
|
-
width: var(--hex-offset-width);
|
|
24128
|
-
padding: 0 8px;
|
|
24129
|
-
text-align: right;
|
|
24130
|
-
color: #888;
|
|
24131
|
-
flex-shrink: 0;
|
|
24132
|
-
box-sizing: border-box;
|
|
24133
|
-
}
|
|
24134
|
-
|
|
24135
|
-
.col-group {
|
|
24136
|
-
display: inline-flex;
|
|
24137
|
-
gap: 4px;
|
|
24138
|
-
margin-right: 16px;
|
|
24139
|
-
}
|
|
24140
|
-
|
|
24141
|
-
.col-header {
|
|
24142
|
-
width: calc(8ch + 28px);
|
|
24143
|
-
padding: 0 8px;
|
|
24144
|
-
color: #555;
|
|
24145
|
-
text-align: right;
|
|
24146
|
-
flex-shrink: 0;
|
|
24147
|
-
box-sizing: border-box;
|
|
24148
|
-
}
|
|
24149
|
-
|
|
24150
|
-
.col-header.active {
|
|
24151
|
-
color: #aaa;
|
|
24152
|
-
}
|
|
24153
|
-
|
|
24154
|
-
.text-header {
|
|
24155
|
-
padding: 4px 8px;
|
|
24156
|
-
color: #555;
|
|
24157
|
-
width: calc(var(--columns, 4) * 4 * 1ch);
|
|
24158
|
-
box-sizing: border-box;
|
|
24159
|
-
flex-shrink: 0;
|
|
24160
|
-
}
|
|
24161
|
-
|
|
24162
|
-
.text-header.active {
|
|
24163
|
-
color: #aaa;
|
|
24164
|
-
}
|
|
24165
|
-
|
|
24166
|
-
.hex-cell, .text-char {
|
|
24167
|
-
display: inline-block;
|
|
24168
|
-
width: 2ch;
|
|
24169
|
-
text-align: center;
|
|
24170
|
-
cursor: pointer;
|
|
24171
|
-
user-select: none;
|
|
24172
|
-
padding: 2px 0;
|
|
24173
|
-
}
|
|
24174
|
-
|
|
24175
|
-
.hex-cell.selected, .text-char.selected {
|
|
24176
|
-
background: rgba(100, 149, 237, 0.4);
|
|
24177
|
-
}
|
|
24178
|
-
|
|
24179
|
-
.hex-cell.changed, .text-char.changed {
|
|
24180
|
-
font-weight: var(--hex-changed-weight);
|
|
24181
|
-
}
|
|
24182
|
-
|
|
24183
|
-
.hex-cell.editing {
|
|
24184
|
-
background: rgba(255, 215, 0, 0.3);
|
|
24185
|
-
}
|
|
24186
|
-
|
|
24187
|
-
|
|
24188
|
-
.text-area {
|
|
24189
|
-
display: inline-flex;
|
|
24190
|
-
gap: 0;
|
|
24191
|
-
}
|
|
24192
|
-
|
|
24193
|
-
.text-char {
|
|
24194
|
-
width: 1ch;
|
|
24195
|
-
text-align: left;
|
|
24196
|
-
}
|
|
24197
|
-
|
|
24198
|
-
.byte-null { color: var(--ascii-null); }
|
|
24199
|
-
.byte-printable { color: var(--ascii-printable); }
|
|
24200
|
-
.byte-whitespace { color: var(--ascii-whitespace); }
|
|
24201
|
-
.byte-control { color: var(--ascii-control); }
|
|
24202
|
-
.byte-other { color: var(--ascii-other); }
|
|
24203
|
-
`;
|
|
23471
|
+
_commitDecimalValue() {
|
|
23472
|
+
if (!this._editState) return;
|
|
23473
|
+
const value = Number.parseInt(this._editState.partial.slice(1), 10);
|
|
23474
|
+
if (!isNaN(value)) {
|
|
23475
|
+
const diff = writeByte(this._store, this._editState.pos, value);
|
|
23476
|
+
push(this._undoStack, diff);
|
|
23477
|
+
this._dispatchChangeEvent(diff);
|
|
23478
|
+
this._advanceCursor();
|
|
23479
|
+
}
|
|
24204
23480
|
}
|
|
24205
|
-
|
|
24206
|
-
this.
|
|
24207
|
-
|
|
24208
|
-
this.
|
|
24209
|
-
this._editState =
|
|
24210
|
-
|
|
23481
|
+
_advanceCursor() {
|
|
23482
|
+
if (!this._editState) return;
|
|
23483
|
+
const dataLen = length(this._store);
|
|
23484
|
+
const newPos = clampPos(this._editState.pos + 1, dataLen);
|
|
23485
|
+
this._editState = {
|
|
23486
|
+
pos: newPos,
|
|
23487
|
+
side: this._editState.side,
|
|
23488
|
+
partial: ``
|
|
23489
|
+
};
|
|
23490
|
+
this._selection = {
|
|
23491
|
+
kind: `single`,
|
|
23492
|
+
pos: newPos
|
|
23493
|
+
};
|
|
24211
23494
|
this.requestUpdate();
|
|
24212
23495
|
}
|
|
24213
|
-
|
|
24214
|
-
|
|
24215
|
-
|
|
24216
|
-
|
|
24217
|
-
|
|
24218
|
-
|
|
23496
|
+
_dispatchChangeEvent(diff) {
|
|
23497
|
+
this.dispatchEvent(new CustomEvent(`hex-change`, {
|
|
23498
|
+
detail: { diff },
|
|
23499
|
+
bubbles: true,
|
|
23500
|
+
composed: true
|
|
23501
|
+
}));
|
|
23502
|
+
}
|
|
23503
|
+
_dispatchSelectEvent() {
|
|
23504
|
+
const sel = this._selection;
|
|
23505
|
+
let detail;
|
|
23506
|
+
if (!sel) detail = { type: `none` };
|
|
23507
|
+
else if (sel.kind === `single`) detail = {
|
|
23508
|
+
type: `single`,
|
|
23509
|
+
position: sel.pos
|
|
23510
|
+
};
|
|
23511
|
+
else if (sel.kind === `contiguous`) detail = {
|
|
23512
|
+
type: `contiguous`,
|
|
23513
|
+
start: sel.start,
|
|
23514
|
+
end: sel.end
|
|
23515
|
+
};
|
|
23516
|
+
else if (sel.kind === `rectangular`) detail = {
|
|
23517
|
+
type: `rectangular`,
|
|
23518
|
+
x: sel.x,
|
|
23519
|
+
y: sel.y,
|
|
23520
|
+
width: sel.width,
|
|
23521
|
+
height: sel.height
|
|
23522
|
+
};
|
|
23523
|
+
else detail = { type: `none` };
|
|
23524
|
+
this.dispatchEvent(new CustomEvent(`select`, {
|
|
23525
|
+
detail,
|
|
23526
|
+
bubbles: true,
|
|
23527
|
+
composed: true
|
|
23528
|
+
}));
|
|
23529
|
+
}
|
|
23530
|
+
_copy() {
|
|
23531
|
+
const positions = getSelectedPositions(this._selection, this.columns);
|
|
23532
|
+
if (positions.length === 0) return;
|
|
23533
|
+
const bytes = positions.map((p) => readByte(this._store, p));
|
|
23534
|
+
this._copyBuffer = new Uint8Array(bytes);
|
|
23535
|
+
const hexStr = bytes.map((b) => b.toString(16).padStart(2, `0`)).join(` `);
|
|
23536
|
+
navigator.clipboard?.writeText(hexStr).catch(() => {});
|
|
23537
|
+
}
|
|
23538
|
+
async _paste() {
|
|
23539
|
+
let bytes = null;
|
|
23540
|
+
try {
|
|
23541
|
+
const text = await navigator.clipboard?.readText();
|
|
23542
|
+
if (text) bytes = this._parseHexString(text);
|
|
23543
|
+
} catch {}
|
|
23544
|
+
if (!bytes && this._copyBuffer) bytes = Array.from(this._copyBuffer);
|
|
23545
|
+
if (!bytes || bytes.length === 0) return;
|
|
23546
|
+
if (!this._selection) return;
|
|
23547
|
+
const entries = /* @__PURE__ */ new Map();
|
|
23548
|
+
if (this._selection.kind === `single`) {
|
|
23549
|
+
const startPos = this._selection.pos;
|
|
23550
|
+
const dataLen = length(this._store);
|
|
23551
|
+
for (let i = 0; i < bytes.length && startPos + i < dataLen; i++) entries.set(startPos + i, bytes[i]);
|
|
23552
|
+
} else if (this._selection.kind === `contiguous`) {
|
|
23553
|
+
const startPos = Math.min(this._selection.start, this._selection.end);
|
|
23554
|
+
const available = Math.max(this._selection.start, this._selection.end) - startPos + 1;
|
|
23555
|
+
for (let i = 0; i < Math.min(bytes.length, available); i++) entries.set(startPos + i, bytes[i]);
|
|
23556
|
+
} else if (this._selection.kind === `rectangular`) {
|
|
23557
|
+
const { x, y, width, height } = this._selection;
|
|
23558
|
+
const bpr = bytesPerRow(this.columns);
|
|
23559
|
+
let byteIdx = 0;
|
|
23560
|
+
for (let row = 0; row < height && byteIdx < bytes.length; row++) for (let col = 0; col < width && byteIdx < bytes.length; col++) {
|
|
23561
|
+
const pos = (y + row) * bpr + x + col;
|
|
23562
|
+
entries.set(pos, bytes[byteIdx++]);
|
|
23563
|
+
}
|
|
23564
|
+
}
|
|
23565
|
+
if (entries.size > 0) {
|
|
23566
|
+
const diff = writeBytes(this._store, entries);
|
|
23567
|
+
push(this._undoStack, diff);
|
|
23568
|
+
this._dispatchChangeEvent(diff);
|
|
23569
|
+
this.requestUpdate();
|
|
23570
|
+
}
|
|
23571
|
+
}
|
|
23572
|
+
_parseHexString(text) {
|
|
23573
|
+
const bytes = [];
|
|
23574
|
+
const cleaned = text.replace(/[^0-9A-F]/gi, ` `).trim();
|
|
23575
|
+
if (!cleaned) return bytes;
|
|
23576
|
+
const parts = cleaned.split(/\s+/);
|
|
23577
|
+
for (const part of parts) if (part.length === 1) bytes.push(Number.parseInt(part + part, 16));
|
|
23578
|
+
else if (part.length === 2) bytes.push(Number.parseInt(part, 16));
|
|
23579
|
+
return bytes;
|
|
23580
|
+
}
|
|
23581
|
+
_getColHeaders() {
|
|
23582
|
+
const headers = [];
|
|
23583
|
+
for (let i = 0; i < this.columns; i++) {
|
|
23584
|
+
const offset = i * 4;
|
|
23585
|
+
headers.push(`+${offset.toString(16).toUpperCase()}`);
|
|
23586
|
+
}
|
|
23587
|
+
return headers;
|
|
23588
|
+
}
|
|
23589
|
+
_isRowShaded(pos) {
|
|
23590
|
+
const sel = this._selection;
|
|
23591
|
+
if (!sel || sel.kind !== `single`) return true;
|
|
23592
|
+
const bpr = bytesPerRow(this.columns);
|
|
23593
|
+
return Math.floor(pos / bpr) === Math.floor(sel.pos / bpr);
|
|
23594
|
+
}
|
|
23595
|
+
_isHexShaded(pos) {
|
|
23596
|
+
return this._isRowShaded(pos);
|
|
23597
|
+
}
|
|
23598
|
+
_isTextShaded(pos) {
|
|
23599
|
+
return this._isRowShaded(pos);
|
|
23600
|
+
}
|
|
23601
|
+
render() {
|
|
23602
|
+
const dataLen = length(this._store);
|
|
23603
|
+
const bpr = bytesPerRow(this.columns);
|
|
23604
|
+
const totalRows = Math.ceil(dataLen / bpr);
|
|
23605
|
+
const containerH = this._containerH > 0 ? this._containerH : 280;
|
|
23606
|
+
const startRow = Math.floor(this._scrollTop / this._rowHeight);
|
|
23607
|
+
const endRow = Math.min(startRow + Math.ceil(containerH / this._rowHeight) + 2, totalRows);
|
|
23608
|
+
const topSpacerHeight = startRow * this._rowHeight;
|
|
23609
|
+
const botSpacerHeight = (totalRows - endRow) * this._rowHeight;
|
|
23610
|
+
const changeset = getChangeset(this._store);
|
|
23611
|
+
const colHeaders = this._getColHeaders();
|
|
23612
|
+
const hexActive = this._focusSide === `hex` || this._focusSide === null;
|
|
23613
|
+
const textActive = this._focusSide === `text`;
|
|
23614
|
+
return b`
|
|
23615
|
+
<div class="hex-editor" tabindex="0" @keydown=${this._onKeyDown} @pointerleave=${() => {}}>
|
|
23616
|
+
<div class="header">
|
|
23617
|
+
${this.hideOffsetCol ? null : b`<span class="offset-cell">Offset</span>`}
|
|
23618
|
+
${this.hideHexCol ? null : c(colHeaders, (h) => b`<span class="col-header ${hexActive ? `active` : ``}">${h}</span>`)}
|
|
23619
|
+
${this.hideTextCol ? null : b`<span class="text-header ${textActive ? `active` : ``}">Text</span>`}
|
|
23620
|
+
</div>
|
|
23621
|
+
<div class="scroll-container" @scroll=${this._onScroll}>
|
|
23622
|
+
<div style="height: ${topSpacerHeight}px"></div>
|
|
23623
|
+
${c(Array.from({ length: endRow - startRow }, (_, i) => startRow + i), (rowIndex) => rowIndex, (rowIndex) => this._renderRow(rowIndex, changeset))}
|
|
23624
|
+
<div style="height: ${botSpacerHeight}px"></div>
|
|
23625
|
+
</div>
|
|
23626
|
+
</div>
|
|
23627
|
+
`;
|
|
23628
|
+
}
|
|
23629
|
+
_renderRow(rowIndex, changeset) {
|
|
23630
|
+
const bpr = bytesPerRow(this.columns);
|
|
23631
|
+
const offset = rowIndex * bpr;
|
|
23632
|
+
return b`
|
|
23633
|
+
<div class="row" data-row=${rowIndex}>
|
|
23634
|
+
${this.hideOffsetCol ? null : b`<span class="offset-cell">${offset.toString(16).toUpperCase().padStart(6, `0`)}</span>`}
|
|
23635
|
+
${this.hideHexCol ? null : c(Array.from({ length: this.columns }, (_, i) => i), (colIndex) => colIndex, (colIndex) => this._renderColumn(rowIndex, colIndex, changeset))}
|
|
23636
|
+
${this.hideTextCol ? null : b`
|
|
23637
|
+
<span class="text-area">
|
|
23638
|
+
${c(Array.from({ length: bpr }, (_, i) => i), (i) => i, (i) => this._renderTextChar(offset + i, changeset))}
|
|
23639
|
+
</span>
|
|
23640
|
+
`}
|
|
23641
|
+
</div>
|
|
23642
|
+
`;
|
|
23643
|
+
}
|
|
23644
|
+
_renderColumn(rowIndex, colIndex, changeset) {
|
|
23645
|
+
const basePos = rowIndex * bytesPerRow(this.columns) + colIndex * 4;
|
|
23646
|
+
return b`
|
|
23647
|
+
<span class="col-group">
|
|
23648
|
+
${[
|
|
23649
|
+
0,
|
|
23650
|
+
1,
|
|
23651
|
+
2,
|
|
23652
|
+
3
|
|
23653
|
+
].map((b) => this._renderHexCell(basePos + b, changeset))}
|
|
23654
|
+
</span>
|
|
23655
|
+
`;
|
|
23656
|
+
}
|
|
23657
|
+
_renderHexCell(pos, changeset) {
|
|
23658
|
+
if (pos >= length(this._store)) return b`<span class="hex-cell"></span>`;
|
|
23659
|
+
const byte = readByte(this._store, pos);
|
|
23660
|
+
const hexStr = byte.toString(16).toUpperCase().padStart(2, `0`);
|
|
23661
|
+
const isSelected = selectionContains(this._selection, pos, this.columns);
|
|
23662
|
+
const isChanged = this.showChangeset && changeset.has(pos);
|
|
23663
|
+
const isEditing = this._editState?.pos === pos;
|
|
23664
|
+
const classes = [`hex-cell`];
|
|
23665
|
+
if (isSelected) classes.push(`selected`);
|
|
23666
|
+
if (isChanged) classes.push(`changed`);
|
|
23667
|
+
if (isEditing) classes.push(`editing`);
|
|
23668
|
+
if (this._isHexShaded(pos)) classes.push(`shaded`);
|
|
23669
|
+
let displayText = hexStr;
|
|
23670
|
+
let colourStyle;
|
|
23671
|
+
if (isEditing && this._editState) displayText = this._editState.partial === `` ? hexStr : `${this._editState.partial}_`;
|
|
23672
|
+
if (this.colourScheme === `shade` && this._shadeMap) colourStyle = { color: this._shadeMap.forByte(byte) };
|
|
23673
|
+
else if (this.colourScheme === `ascii`) classes.push(getAsciiClass(byte));
|
|
23674
|
+
return b`
|
|
23675
|
+
<span
|
|
23676
|
+
class=${classes.join(` `)}
|
|
23677
|
+
style=${o$1(colourStyle || {})}
|
|
23678
|
+
@pointerdown=${(e) => this._onPointerDown(pos, `hex`, e)}
|
|
23679
|
+
@pointerup=${(e) => this._onPointerUp(pos, `hex`, e)}
|
|
23680
|
+
@pointermove=${(e) => this._onPointerMove(pos, `hex`, e)}
|
|
23681
|
+
>${displayText}</span>
|
|
23682
|
+
`;
|
|
23683
|
+
}
|
|
23684
|
+
_renderTextChar(pos, changeset) {
|
|
23685
|
+
if (pos >= length(this._store)) return b`<span class="text-char"></span>`;
|
|
23686
|
+
const byte = readByte(this._store, pos);
|
|
23687
|
+
const char = byte >= 32 && byte <= 126 ? String.fromCharCode(byte) : `.`;
|
|
23688
|
+
const isSelected = selectionContains(this._selection, pos, this.columns);
|
|
23689
|
+
const isChanged = this.showChangeset && changeset.has(pos);
|
|
23690
|
+
const classes = [`text-char`];
|
|
23691
|
+
if (isSelected) classes.push(`selected`);
|
|
23692
|
+
if (isChanged) classes.push(`changed`);
|
|
23693
|
+
if (this._isTextShaded(pos)) classes.push(`shaded`);
|
|
23694
|
+
let colourStyle;
|
|
23695
|
+
if (this.colourScheme === `shade` && this._shadeMap) colourStyle = { color: this._shadeMap.forByte(byte) };
|
|
23696
|
+
else if (this.colourScheme === `ascii`) classes.push(getAsciiClass(byte));
|
|
23697
|
+
return b`
|
|
23698
|
+
<span
|
|
23699
|
+
class=${classes.join(` `)}
|
|
23700
|
+
style=${o$1(colourStyle || {})}
|
|
23701
|
+
@pointerdown=${(e) => this._onPointerDown(pos, `text`, e)}
|
|
23702
|
+
@pointerup=${(e) => this._onPointerUp(pos, `text`, e)}
|
|
23703
|
+
@pointermove=${(e) => this._onPointerMove(pos, `text`, e)}
|
|
23704
|
+
>${char}</span>
|
|
23705
|
+
`;
|
|
23706
|
+
}
|
|
23707
|
+
};
|
|
23708
|
+
__decorate([n$2({ type: Number })], IxfxHexEditorElement.prototype, "columns", void 0);
|
|
23709
|
+
__decorate([n$2({ type: String })], IxfxHexEditorElement.prototype, "colourScheme", void 0);
|
|
23710
|
+
__decorate([n$2({ type: Boolean })], IxfxHexEditorElement.prototype, "showChangeset", void 0);
|
|
23711
|
+
__decorate([n$2({
|
|
23712
|
+
type: Boolean,
|
|
23713
|
+
attribute: `hide-offset-col`
|
|
23714
|
+
})], IxfxHexEditorElement.prototype, "hideOffsetCol", void 0);
|
|
23715
|
+
__decorate([n$2({
|
|
23716
|
+
type: Boolean,
|
|
23717
|
+
attribute: `hide-hex-col`
|
|
23718
|
+
})], IxfxHexEditorElement.prototype, "hideHexCol", void 0);
|
|
23719
|
+
__decorate([n$2({
|
|
23720
|
+
type: Boolean,
|
|
23721
|
+
attribute: `hide-text-col`
|
|
23722
|
+
})], IxfxHexEditorElement.prototype, "hideTextCol", void 0);
|
|
23723
|
+
__decorate([r$1()], IxfxHexEditorElement.prototype, "_selection", void 0);
|
|
23724
|
+
__decorate([r$1()], IxfxHexEditorElement.prototype, "_scrollTop", void 0);
|
|
23725
|
+
__decorate([r$1()], IxfxHexEditorElement.prototype, "_editState", void 0);
|
|
23726
|
+
__decorate([r$1()], IxfxHexEditorElement.prototype, "_containerH", void 0);
|
|
23727
|
+
__decorate([r$1()], IxfxHexEditorElement.prototype, "_shadeMap", void 0);
|
|
23728
|
+
__decorate([r$1()], IxfxHexEditorElement.prototype, "_focusSide", void 0);
|
|
23729
|
+
IxfxHexEditorElement = __decorate([t$4(`ixfx-hex-editor`)], IxfxHexEditorElement);
|
|
23730
|
+
//#endregion
|
|
23731
|
+
//#region src/radial-input/svg-utils.ts
|
|
23732
|
+
const PI2 = Math.PI * 2;
|
|
23733
|
+
const MIDPOINT_ANGLE = -Math.PI / 2;
|
|
23734
|
+
/**
|
|
23735
|
+
* Convert polar coordinates (angle in radians, radius) to SVG Cartesian coordinates
|
|
23736
|
+
* @param angle - Angle in radians (0 = right/east, increases clockwise in SVG)
|
|
23737
|
+
* @param radius - Distance from center
|
|
23738
|
+
* @param center - Center point (default: {x: 50, y: 50})
|
|
23739
|
+
* @returns Point in SVG coordinates
|
|
23740
|
+
*/
|
|
23741
|
+
function polarToCartesian(angle, radius, center = {
|
|
23742
|
+
x: 50,
|
|
23743
|
+
y: 50
|
|
23744
|
+
}) {
|
|
23745
|
+
return {
|
|
23746
|
+
x: center.x + Math.cos(angle) * radius,
|
|
23747
|
+
y: center.y + Math.sin(angle) * radius
|
|
23748
|
+
};
|
|
23749
|
+
}
|
|
23750
|
+
/**
|
|
23751
|
+
* Calculate start and end angles for a flattened circle
|
|
23752
|
+
* @param flatten - How much of the circle to hide (0..1): 0 = full circle, 0.5 = half circle, 1 = no arc
|
|
23753
|
+
* @returns Start and end angles in radians
|
|
23754
|
+
*/
|
|
23755
|
+
function getFlattenedCircleAngles(flatten) {
|
|
23756
|
+
const halfArc = PI2 * (1 - flatten) / 2;
|
|
23757
|
+
const topAngle = -Math.PI / 2;
|
|
23758
|
+
const startAngle = topAngle - halfArc;
|
|
23759
|
+
const endAngle = topAngle + halfArc;
|
|
23760
|
+
return {
|
|
23761
|
+
startAngle,
|
|
23762
|
+
endAngle,
|
|
23763
|
+
totalArc: endAngle - startAngle
|
|
23764
|
+
};
|
|
23765
|
+
}
|
|
23766
|
+
/**
|
|
23767
|
+
* Map a value (0..1) to an angle based on value mode
|
|
23768
|
+
* @param relativeValue - Value in 0..1 range
|
|
23769
|
+
* @param valueMode - How to interpret the value
|
|
23770
|
+
* @param flatten - Circle flattening amount (0..1)
|
|
23771
|
+
* @returns Angle in radians
|
|
23772
|
+
*/
|
|
23773
|
+
function valueToAngle(relativeValue, valueMode, flatten) {
|
|
23774
|
+
const { startAngle, endAngle, totalArc } = getFlattenedCircleAngles(flatten);
|
|
23775
|
+
switch (valueMode) {
|
|
23776
|
+
case "range": return startAngle + relativeValue * totalArc;
|
|
23777
|
+
case "bipolar": if (relativeValue <= .5) return startAngle + relativeValue / .5 * (MIDPOINT_ANGLE - startAngle);
|
|
23778
|
+
else return MIDPOINT_ANGLE + (relativeValue - .5) / .5 * (endAngle - MIDPOINT_ANGLE);
|
|
23779
|
+
case "unipolar": return MIDPOINT_ANGLE;
|
|
23780
|
+
default: return startAngle;
|
|
23781
|
+
}
|
|
23782
|
+
}
|
|
23783
|
+
/**
|
|
23784
|
+
* Get start and end angles for a value arc
|
|
23785
|
+
* @param relativeValue - Value in 0..1 range
|
|
23786
|
+
* @param valueMode - How to interpret the value
|
|
23787
|
+
* @param flatten - Circle flattening amount (0..1)
|
|
23788
|
+
* @returns Start and end angles for the arc
|
|
23789
|
+
*/
|
|
23790
|
+
function getValueArcAngles(relativeValue, valueMode, flatten) {
|
|
23791
|
+
const { startAngle, endAngle, totalArc } = getFlattenedCircleAngles(flatten);
|
|
23792
|
+
switch (valueMode) {
|
|
23793
|
+
case "range": return {
|
|
23794
|
+
startAngle,
|
|
23795
|
+
endAngle: startAngle + relativeValue * totalArc
|
|
23796
|
+
};
|
|
23797
|
+
case "bipolar": if (relativeValue < .5) return {
|
|
23798
|
+
startAngle: startAngle + relativeValue / .5 * (MIDPOINT_ANGLE - startAngle),
|
|
23799
|
+
endAngle: MIDPOINT_ANGLE
|
|
23800
|
+
};
|
|
23801
|
+
else if (relativeValue > .5) return {
|
|
23802
|
+
startAngle: MIDPOINT_ANGLE,
|
|
23803
|
+
endAngle: MIDPOINT_ANGLE + (relativeValue - .5) / .5 * (endAngle - MIDPOINT_ANGLE)
|
|
23804
|
+
};
|
|
23805
|
+
else return {
|
|
23806
|
+
startAngle: MIDPOINT_ANGLE,
|
|
23807
|
+
endAngle: MIDPOINT_ANGLE
|
|
23808
|
+
};
|
|
23809
|
+
case "unipolar": {
|
|
23810
|
+
const spreadAmount = relativeValue * totalArc / 2;
|
|
23811
|
+
return {
|
|
23812
|
+
startAngle: MIDPOINT_ANGLE - spreadAmount,
|
|
23813
|
+
endAngle: MIDPOINT_ANGLE + spreadAmount
|
|
23814
|
+
};
|
|
23815
|
+
}
|
|
23816
|
+
default: return {
|
|
23817
|
+
startAngle,
|
|
23818
|
+
endAngle: startAngle
|
|
23819
|
+
};
|
|
23820
|
+
}
|
|
23821
|
+
}
|
|
23822
|
+
/**
|
|
23823
|
+
* Get start and end angles for an anchored arc
|
|
23824
|
+
* Centered on current value position, extends equally in both directions
|
|
23825
|
+
* @param relativeValue - Current value position (0..1)
|
|
23826
|
+
* @param laneValue - Width of the arc (0..1, where 1 = full range)
|
|
23827
|
+
* @param valueMode - How to interpret the value
|
|
23828
|
+
* @param flatten - Circle flattening amount (0..1)
|
|
23829
|
+
* @returns Start and end angles for the arc
|
|
23830
|
+
*/
|
|
23831
|
+
function getAnchoredArcAngles(relativeValue, laneValue, valueMode, flatten) {
|
|
23832
|
+
const { startAngle, endAngle, totalArc } = getFlattenedCircleAngles(flatten);
|
|
23833
|
+
const centerAngle = valueToAngle(relativeValue, valueMode, flatten);
|
|
23834
|
+
const halfWidth = laneValue * totalArc / 2;
|
|
23835
|
+
let arcStart = centerAngle - halfWidth;
|
|
23836
|
+
let arcEnd = centerAngle + halfWidth;
|
|
23837
|
+
if (arcStart < startAngle) arcStart = startAngle;
|
|
23838
|
+
if (arcEnd > endAngle) arcEnd = endAngle;
|
|
23839
|
+
if (arcStart >= arcEnd) return {
|
|
23840
|
+
startAngle: centerAngle,
|
|
23841
|
+
endAngle: centerAngle
|
|
23842
|
+
};
|
|
23843
|
+
return {
|
|
23844
|
+
startAngle: arcStart,
|
|
23845
|
+
endAngle: arcEnd
|
|
23846
|
+
};
|
|
23847
|
+
}
|
|
23848
|
+
/**
|
|
23849
|
+
* Generate SVG path for an arc
|
|
23850
|
+
* @param startAngle - Start angle in radians
|
|
23851
|
+
* @param endAngle - End angle in radians
|
|
23852
|
+
* @param radius - Arc radius
|
|
23853
|
+
* @param center - Center point
|
|
23854
|
+
* @returns SVG path data string
|
|
23855
|
+
*/
|
|
23856
|
+
function generateArcPath(startAngle, endAngle, radius, center = {
|
|
23857
|
+
x: 50,
|
|
23858
|
+
y: 50
|
|
23859
|
+
}) {
|
|
23860
|
+
if (startAngle === endAngle) return "";
|
|
23861
|
+
let arcLength = endAngle - startAngle;
|
|
23862
|
+
if (arcLength < 0) arcLength += PI2;
|
|
23863
|
+
if (arcLength >= PI2 - .001) {
|
|
23864
|
+
const adjustedEnd = startAngle + PI2 - .001;
|
|
23865
|
+
const start = polarToCartesian(startAngle, radius, center);
|
|
23866
|
+
const end = polarToCartesian(adjustedEnd, radius, center);
|
|
23867
|
+
return `M ${start.x},${start.y} A ${radius},${radius} 0 1 1 ${end.x},${end.y}`;
|
|
24219
23868
|
}
|
|
24220
|
-
|
|
24221
|
-
|
|
24222
|
-
|
|
24223
|
-
|
|
24224
|
-
|
|
23869
|
+
const start = polarToCartesian(startAngle, radius, center);
|
|
23870
|
+
const end = polarToCartesian(endAngle, radius, center);
|
|
23871
|
+
const largeArcFlag = arcLength > Math.PI ? 1 : 0;
|
|
23872
|
+
return `M ${start.x},${start.y} A ${radius},${radius} 0 ${largeArcFlag} 1 ${end.x},${end.y}`;
|
|
23873
|
+
}
|
|
23874
|
+
/**
|
|
23875
|
+
* Generate SVG path for a full flattened circle border
|
|
23876
|
+
* @param radius - Circle radius
|
|
23877
|
+
* @param flatten - Flattening amount (0..1)
|
|
23878
|
+
* @param center - Center point
|
|
23879
|
+
* @returns SVG path data string
|
|
23880
|
+
*/
|
|
23881
|
+
function generateCircleBorderPath(radius, flatten, center = {
|
|
23882
|
+
x: 50,
|
|
23883
|
+
y: 50
|
|
23884
|
+
}) {
|
|
23885
|
+
const { startAngle, endAngle } = getFlattenedCircleAngles(flatten);
|
|
23886
|
+
return generateArcPath(startAngle, endAngle, radius, center);
|
|
23887
|
+
}
|
|
23888
|
+
/**
|
|
23889
|
+
* Generate SVG path data for a filled wedge (pie-slice) sector
|
|
23890
|
+
* @param startAngle - Start angle in radians
|
|
23891
|
+
* @param endAngle - End angle in radians
|
|
23892
|
+
* @param radius - Wedge radius (same as dial radius)
|
|
23893
|
+
* @param center - Center point
|
|
23894
|
+
* @param clockwise - Whether to draw arc clockwise (true) or counterclockwise (false)
|
|
23895
|
+
* @returns SVG path data string for filled wedge
|
|
23896
|
+
*/
|
|
23897
|
+
function generateWedgePath(startAngle, endAngle, radius, center = {
|
|
23898
|
+
x: 50,
|
|
23899
|
+
y: 50
|
|
23900
|
+
}, clockwise = true) {
|
|
23901
|
+
if (startAngle === endAngle) return "";
|
|
23902
|
+
let arcLength = endAngle - startAngle;
|
|
23903
|
+
if (arcLength < 0) arcLength += PI2;
|
|
23904
|
+
if (arcLength >= PI2 - .001) {
|
|
23905
|
+
const start = polarToCartesian(startAngle, radius, center);
|
|
23906
|
+
const adjEnd = polarToCartesian(startAngle + PI2 - .001, radius, center);
|
|
23907
|
+
const largeArcFlag = 1;
|
|
23908
|
+
const sweepFlag = clockwise ? 1 : 0;
|
|
23909
|
+
return `M ${center.x},${center.y} L ${start.x},${start.y} A ${radius},${radius} 0 ${largeArcFlag} ${sweepFlag} ${adjEnd.x},${adjEnd.y} Z`;
|
|
24225
23910
|
}
|
|
24226
|
-
|
|
24227
|
-
|
|
24228
|
-
|
|
24229
|
-
|
|
24230
|
-
|
|
24231
|
-
|
|
24232
|
-
|
|
24233
|
-
|
|
23911
|
+
let actualStartAngle = startAngle;
|
|
23912
|
+
let actualEndAngle = endAngle;
|
|
23913
|
+
let actualClockwise = clockwise;
|
|
23914
|
+
if (!clockwise && arcLength > Math.PI) {
|
|
23915
|
+
actualStartAngle = endAngle;
|
|
23916
|
+
actualEndAngle = startAngle;
|
|
23917
|
+
actualClockwise = true;
|
|
23918
|
+
arcLength = PI2 - arcLength;
|
|
24234
23919
|
}
|
|
24235
|
-
|
|
24236
|
-
|
|
24237
|
-
|
|
24238
|
-
|
|
24239
|
-
|
|
24240
|
-
|
|
24241
|
-
|
|
24242
|
-
|
|
23920
|
+
const start = polarToCartesian(actualStartAngle, radius, center);
|
|
23921
|
+
const end = polarToCartesian(actualEndAngle, radius, center);
|
|
23922
|
+
const largeArcFlag = arcLength > Math.PI ? 1 : 0;
|
|
23923
|
+
const sweepFlag = actualClockwise ? 1 : 0;
|
|
23924
|
+
return `M ${center.x},${center.y} L ${start.x},${start.y} A ${radius},${radius} 0 ${largeArcFlag} ${sweepFlag} ${end.x},${end.y} Z`;
|
|
23925
|
+
}
|
|
23926
|
+
/**
|
|
23927
|
+
* Get wedge angles based on value mode
|
|
23928
|
+
* @param relativeValue - Value in 0..1 range
|
|
23929
|
+
* @param valueMode - How to interpret the value
|
|
23930
|
+
* @param flatten - Circle flattening amount (0..1)
|
|
23931
|
+
* @returns Object with startAngle, endAngle, and clockwise flag
|
|
23932
|
+
*/
|
|
23933
|
+
function getWedgeAngles(relativeValue, valueMode, flatten) {
|
|
23934
|
+
const { startAngle, endAngle, totalArc } = getFlattenedCircleAngles(flatten);
|
|
23935
|
+
const valueAngle = valueToAngle(relativeValue, valueMode, flatten);
|
|
23936
|
+
switch (valueMode) {
|
|
23937
|
+
case "range": return {
|
|
23938
|
+
startAngle,
|
|
23939
|
+
endAngle: valueAngle,
|
|
23940
|
+
clockwise: true
|
|
23941
|
+
};
|
|
23942
|
+
case "bipolar": if (relativeValue < .5) return {
|
|
23943
|
+
startAngle: MIDPOINT_ANGLE,
|
|
23944
|
+
endAngle: valueAngle,
|
|
23945
|
+
clockwise: false
|
|
23946
|
+
};
|
|
23947
|
+
else return {
|
|
23948
|
+
startAngle: MIDPOINT_ANGLE,
|
|
23949
|
+
endAngle: valueAngle,
|
|
23950
|
+
clockwise: true
|
|
23951
|
+
};
|
|
23952
|
+
case "unipolar": {
|
|
23953
|
+
const halfSpread = relativeValue * totalArc / 2;
|
|
23954
|
+
return {
|
|
23955
|
+
startAngle: MIDPOINT_ANGLE - halfSpread,
|
|
23956
|
+
endAngle: MIDPOINT_ANGLE + halfSpread,
|
|
23957
|
+
clockwise: true
|
|
24243
23958
|
};
|
|
24244
23959
|
}
|
|
23960
|
+
default: return {
|
|
23961
|
+
startAngle,
|
|
23962
|
+
endAngle: startAngle,
|
|
23963
|
+
clockwise: true
|
|
23964
|
+
};
|
|
24245
23965
|
}
|
|
24246
|
-
|
|
24247
|
-
|
|
23966
|
+
}
|
|
23967
|
+
/**
|
|
23968
|
+
* Get position for a marker (needle or dot) at a given value
|
|
23969
|
+
* @param relativeValue - Value in 0..1 range
|
|
23970
|
+
* @param valueMode - How to interpret the value
|
|
23971
|
+
* @param flatten - Circle flattening amount (0..1)
|
|
23972
|
+
* @param radius - Circle radius
|
|
23973
|
+
* @param center - Center point
|
|
23974
|
+
* @returns Angle in radians and position point
|
|
23975
|
+
*/
|
|
23976
|
+
function getMarkerPosition(relativeValue, valueMode, flatten, radius, center = {
|
|
23977
|
+
x: 50,
|
|
23978
|
+
y: 50
|
|
23979
|
+
}) {
|
|
23980
|
+
const angle = valueToAngle(relativeValue, valueMode, flatten);
|
|
23981
|
+
return {
|
|
23982
|
+
angle,
|
|
23983
|
+
position: polarToCartesian(angle, radius, center)
|
|
23984
|
+
};
|
|
23985
|
+
}
|
|
23986
|
+
/**
|
|
23987
|
+
* Get position for midpoint marker (used in bipolar/unipolar modes)
|
|
23988
|
+
* @param radius - Circle radius
|
|
23989
|
+
* @param center - Center point
|
|
23990
|
+
* @returns Position at top-center of circle
|
|
23991
|
+
*/
|
|
23992
|
+
function getMidpointPosition(radius, center = {
|
|
23993
|
+
x: 50,
|
|
23994
|
+
y: 50
|
|
23995
|
+
}) {
|
|
23996
|
+
return {
|
|
23997
|
+
angle: MIDPOINT_ANGLE,
|
|
23998
|
+
position: polarToCartesian(MIDPOINT_ANGLE, radius, center)
|
|
23999
|
+
};
|
|
24000
|
+
}
|
|
24001
|
+
/**
|
|
24002
|
+
* Clamp a value between min and max
|
|
24003
|
+
*/
|
|
24004
|
+
function clamp(value, min, max) {
|
|
24005
|
+
return Math.min(Math.max(value, min), max);
|
|
24006
|
+
}
|
|
24007
|
+
/**
|
|
24008
|
+
* Scale a value from one range to another
|
|
24009
|
+
*/
|
|
24010
|
+
function scale(value, fromMin, fromMax, toMin, toMax) {
|
|
24011
|
+
return toMin + (value - fromMin) / (fromMax - fromMin) * (toMax - toMin);
|
|
24012
|
+
}
|
|
24013
|
+
//#endregion
|
|
24014
|
+
//#region src/radial-input/radial-input.ts
|
|
24015
|
+
const CENTER = {
|
|
24016
|
+
x: 50,
|
|
24017
|
+
y: 50
|
|
24018
|
+
};
|
|
24019
|
+
let RadialInputElement = class RadialInputElement extends i$3 {
|
|
24020
|
+
#_radius;
|
|
24021
|
+
get radius() {
|
|
24022
|
+
return this.#_radius;
|
|
24248
24023
|
}
|
|
24249
|
-
|
|
24250
|
-
this
|
|
24251
|
-
|
|
24252
|
-
|
|
24024
|
+
set radius(v) {
|
|
24025
|
+
this.#_radius = clamp(v, 10, 50);
|
|
24026
|
+
}
|
|
24027
|
+
#lanes;
|
|
24028
|
+
#dragging;
|
|
24029
|
+
#dragStartY;
|
|
24030
|
+
#valueAtDragStart;
|
|
24031
|
+
#changeDebounceTimer;
|
|
24032
|
+
#isUserInteraction;
|
|
24033
|
+
constructor() {
|
|
24034
|
+
super();
|
|
24035
|
+
this.#_radius = 45;
|
|
24036
|
+
this.value = 0;
|
|
24037
|
+
this.min = 0;
|
|
24038
|
+
this.max = 100;
|
|
24039
|
+
this.step = void 0;
|
|
24040
|
+
this.valueMode = `range`;
|
|
24041
|
+
this.flatten = .3;
|
|
24042
|
+
this.markerStyle = `needle`;
|
|
24043
|
+
this.wedge = false;
|
|
24044
|
+
this.disabled = false;
|
|
24045
|
+
this.#lanes = /* @__PURE__ */ new Map();
|
|
24046
|
+
this.#dragging = false;
|
|
24047
|
+
this.#dragStartY = 0;
|
|
24048
|
+
this.#valueAtDragStart = 0;
|
|
24049
|
+
this.#isUserInteraction = false;
|
|
24050
|
+
this.#onPointerDown = (event) => {
|
|
24051
|
+
if (this.disabled) return;
|
|
24052
|
+
event.preventDefault();
|
|
24053
|
+
const svg = this.renderRoot.querySelector(`svg`);
|
|
24054
|
+
svg?.focus();
|
|
24055
|
+
this.#dragging = true;
|
|
24056
|
+
this.#dragStartY = event.clientY;
|
|
24057
|
+
this.#valueAtDragStart = this.value;
|
|
24058
|
+
this.toggleAttribute(`dragging`, true);
|
|
24059
|
+
if (svg) svg.setPointerCapture(event.pointerId);
|
|
24060
|
+
window.addEventListener(`pointermove`, this.#onPointerMove);
|
|
24061
|
+
window.addEventListener(`pointerup`, this.#onPointerUp);
|
|
24062
|
+
window.addEventListener(`pointercancel`, this.#onPointerUp);
|
|
24253
24063
|
};
|
|
24254
|
-
this
|
|
24255
|
-
|
|
24256
|
-
|
|
24257
|
-
|
|
24258
|
-
|
|
24259
|
-
|
|
24260
|
-
|
|
24261
|
-
end
|
|
24064
|
+
this.#onPointerMove = (event) => {
|
|
24065
|
+
if (!this.#dragging) return;
|
|
24066
|
+
event.preventDefault();
|
|
24067
|
+
const effectiveSensitivity = this.clientHeight * 2 * (event.shiftKey ? 10 : 1);
|
|
24068
|
+
const deltaValue = (this.#dragStartY - event.clientY) / effectiveSensitivity * (this.max - this.min);
|
|
24069
|
+
const relativeValue = scale(this.#valueAtDragStart + deltaValue, this.min, this.max, 0, 1);
|
|
24070
|
+
this.#setValueFromRelative(clamp(relativeValue, 0, 1), true);
|
|
24262
24071
|
};
|
|
24263
|
-
this
|
|
24264
|
-
|
|
24265
|
-
|
|
24266
|
-
|
|
24267
|
-
|
|
24268
|
-
|
|
24269
|
-
|
|
24270
|
-
|
|
24271
|
-
|
|
24272
|
-
|
|
24072
|
+
this.#onPointerUp = () => {
|
|
24073
|
+
this.#dragging = false;
|
|
24074
|
+
this.toggleAttribute(`dragging`, false);
|
|
24075
|
+
const svg = this.renderRoot.querySelector(`svg`);
|
|
24076
|
+
if (svg && `hasPointerCapture` in svg && typeof svg.hasPointerCapture === `function`) {
|
|
24077
|
+
if (svg.hasPointerCapture(1)) svg.releasePointerCapture(1);
|
|
24078
|
+
}
|
|
24079
|
+
window.removeEventListener(`pointermove`, this.#onPointerMove);
|
|
24080
|
+
window.removeEventListener(`pointerup`, this.#onPointerUp);
|
|
24081
|
+
window.removeEventListener(`pointercancel`, this.#onPointerUp);
|
|
24273
24082
|
};
|
|
24274
|
-
this
|
|
24083
|
+
this.#onKeyDown = (event) => {
|
|
24084
|
+
if (this.disabled) return;
|
|
24085
|
+
const shiftDivisor = event.shiftKey ? 10 : 1;
|
|
24086
|
+
const range = this.max - this.min;
|
|
24087
|
+
const effectiveStep = resolveStep(range, this.stops, this.step) / shiftDivisor;
|
|
24088
|
+
let handled = false;
|
|
24089
|
+
switch (event.key) {
|
|
24090
|
+
case `ArrowUp`:
|
|
24091
|
+
case `ArrowRight`:
|
|
24092
|
+
this.#setValueFromRelative(this.#getRelativeValue() + effectiveStep / range, true);
|
|
24093
|
+
handled = true;
|
|
24094
|
+
break;
|
|
24095
|
+
case `ArrowDown`:
|
|
24096
|
+
case `ArrowLeft`:
|
|
24097
|
+
this.#setValueFromRelative(this.#getRelativeValue() - effectiveStep / range, true);
|
|
24098
|
+
handled = true;
|
|
24099
|
+
break;
|
|
24100
|
+
case `Home`:
|
|
24101
|
+
this.#setValueFromRelative(0, true);
|
|
24102
|
+
handled = true;
|
|
24103
|
+
break;
|
|
24104
|
+
case `End`:
|
|
24105
|
+
this.#setValueFromRelative(1, true);
|
|
24106
|
+
handled = true;
|
|
24107
|
+
break;
|
|
24108
|
+
}
|
|
24109
|
+
if (handled) event.preventDefault();
|
|
24110
|
+
};
|
|
24111
|
+
this.#lanes.set(`track`, {
|
|
24112
|
+
key: `track`,
|
|
24113
|
+
value: 1,
|
|
24114
|
+
type: `fixed`,
|
|
24115
|
+
offset: 0,
|
|
24116
|
+
width: .16
|
|
24117
|
+
});
|
|
24118
|
+
this.#lanes.set(`value`, {
|
|
24119
|
+
key: `value`,
|
|
24120
|
+
value: 0,
|
|
24121
|
+
type: `value`,
|
|
24122
|
+
offset: 0,
|
|
24123
|
+
width: .24
|
|
24124
|
+
});
|
|
24125
|
+
}
|
|
24126
|
+
addLane(key, options) {
|
|
24127
|
+
const relativeValue = this.#getRelativeValue();
|
|
24128
|
+
this.#lanes.set(key, {
|
|
24129
|
+
key,
|
|
24130
|
+
value: options?.value ?? relativeValue,
|
|
24131
|
+
type: options?.type ?? `value`,
|
|
24132
|
+
offset: options?.offset ?? 0,
|
|
24133
|
+
width: options?.width ?? .1
|
|
24134
|
+
});
|
|
24275
24135
|
this.requestUpdate();
|
|
24276
24136
|
}
|
|
24277
|
-
|
|
24278
|
-
|
|
24279
|
-
|
|
24137
|
+
setLaneValue(key, value) {
|
|
24138
|
+
const lane = this.#lanes.get(key);
|
|
24139
|
+
if (lane) {
|
|
24140
|
+
lane.value = clamp(value, 0, 1);
|
|
24141
|
+
this.requestUpdate();
|
|
24142
|
+
}
|
|
24143
|
+
}
|
|
24144
|
+
removeLane(key) {
|
|
24145
|
+
this.#lanes.delete(key);
|
|
24280
24146
|
this.requestUpdate();
|
|
24281
24147
|
}
|
|
24282
|
-
|
|
24283
|
-
return this
|
|
24148
|
+
getLanes() {
|
|
24149
|
+
return new Map(this.#lanes);
|
|
24284
24150
|
}
|
|
24285
|
-
|
|
24286
|
-
|
|
24287
|
-
if (container) {
|
|
24288
|
-
new ResizeObserver((entries) => {
|
|
24289
|
-
this._containerH = entries[0].contentRect.height;
|
|
24290
|
-
this.requestUpdate();
|
|
24291
|
-
}).observe(container);
|
|
24292
|
-
this._containerH = container.clientHeight;
|
|
24293
|
-
}
|
|
24294
|
-
this.recomputeColours();
|
|
24151
|
+
getLane(key) {
|
|
24152
|
+
return this.#lanes.get(key);
|
|
24295
24153
|
}
|
|
24296
|
-
|
|
24297
|
-
|
|
24298
|
-
if (e.button !== 0) return;
|
|
24299
|
-
(this.shadowRoot?.querySelector(`.hex-editor`))?.focus();
|
|
24300
|
-
this._focusSide = side;
|
|
24301
|
-
e.target.setPointerCapture(e.pointerId);
|
|
24302
|
-
const bpr = bytesPerRow(this.columns);
|
|
24303
|
-
const startX = pos % bpr;
|
|
24304
|
-
const startY = Math.floor(pos / bpr);
|
|
24305
|
-
if (e.metaKey || e.ctrlKey) {
|
|
24306
|
-
this._pointerMode = `select-rect`;
|
|
24307
|
-
this._dragAnchor = pos;
|
|
24308
|
-
this._rectAnchorX = startX;
|
|
24309
|
-
this._rectAnchorY = startY;
|
|
24310
|
-
} else if (e.shiftKey) {
|
|
24311
|
-
this._pointerMode = `select-cont`;
|
|
24312
|
-
if (!this._selection || this._selection.kind !== `single`) this._dragAnchor = pos;
|
|
24313
|
-
else {
|
|
24314
|
-
this._dragAnchor = this._selection.pos;
|
|
24315
|
-
this._shiftClickTarget = pos;
|
|
24316
|
-
}
|
|
24317
|
-
} else {
|
|
24318
|
-
this._pointerMode = `pending`;
|
|
24319
|
-
this._dragStart = {
|
|
24320
|
-
pos,
|
|
24321
|
-
startValue: readByte(this._store, pos),
|
|
24322
|
-
startY: e.clientY,
|
|
24323
|
-
startX: e.clientX
|
|
24324
|
-
};
|
|
24325
|
-
this._dragAnchor = pos;
|
|
24326
|
-
this._currentDragDiff = null;
|
|
24327
|
-
}
|
|
24154
|
+
#getRelativeValue() {
|
|
24155
|
+
return scale(this.value, this.min, this.max, 0, 1);
|
|
24328
24156
|
}
|
|
24329
|
-
|
|
24330
|
-
if (
|
|
24331
|
-
|
|
24332
|
-
const dx = Math.abs(e.clientX - this._dragStart.startX);
|
|
24333
|
-
if (this._pointerMode === `pending` && dy > 4 && dy > dx) {
|
|
24334
|
-
this._pointerMode = `drag-value`;
|
|
24335
|
-
this._editState = null;
|
|
24336
|
-
}
|
|
24337
|
-
if (this._pointerMode === `drag-value`) {
|
|
24338
|
-
const delta = Math.round((e.clientY - this._dragStart.startY) / 4);
|
|
24339
|
-
const newValue = Math.max(0, Math.min(255, this._dragStart.startValue - delta));
|
|
24340
|
-
this._currentDragDiff = writeByte(this._store, pos, newValue);
|
|
24341
|
-
this.requestUpdate();
|
|
24342
|
-
}
|
|
24343
|
-
if (this._pointerMode === `select-cont`) {
|
|
24344
|
-
if (this._dragAnchor !== null) {
|
|
24345
|
-
const mode = `contiguous`;
|
|
24346
|
-
this._selection = selectionFromPointerRange(this._dragAnchor, pos, mode, this.columns);
|
|
24347
|
-
this._dispatchSelectEvent();
|
|
24348
|
-
}
|
|
24349
|
-
}
|
|
24350
|
-
if (this._pointerMode === `select-rect`) {
|
|
24351
|
-
const bpr = bytesPerRow(this.columns);
|
|
24352
|
-
const currentX = pos % bpr;
|
|
24353
|
-
const currentY = Math.floor(pos / bpr);
|
|
24354
|
-
const x = Math.min(this._rectAnchorX, currentX);
|
|
24355
|
-
const y = Math.min(this._rectAnchorY, currentY);
|
|
24356
|
-
const width = Math.abs(currentX - this._rectAnchorX) + 1;
|
|
24357
|
-
const height = Math.abs(currentY - this._rectAnchorY) + 1;
|
|
24358
|
-
this._selection = {
|
|
24359
|
-
kind: `rectangular`,
|
|
24360
|
-
x,
|
|
24361
|
-
y,
|
|
24362
|
-
width,
|
|
24363
|
-
height
|
|
24364
|
-
};
|
|
24365
|
-
this._dispatchSelectEvent();
|
|
24366
|
-
}
|
|
24157
|
+
#getEffectiveMarkerStyle() {
|
|
24158
|
+
if (this.valueMode === `unipolar` && this.markerStyle === `needle`) return `none`;
|
|
24159
|
+
return this.markerStyle;
|
|
24367
24160
|
}
|
|
24368
|
-
|
|
24369
|
-
|
|
24370
|
-
|
|
24371
|
-
this.
|
|
24372
|
-
kind: `single`,
|
|
24373
|
-
pos
|
|
24374
|
-
};
|
|
24375
|
-
this._initialSelectionPoint = pos;
|
|
24376
|
-
this._currentCursorPoint = pos;
|
|
24377
|
-
this._editState = {
|
|
24378
|
-
pos,
|
|
24379
|
-
side,
|
|
24380
|
-
partial: ``
|
|
24381
|
-
};
|
|
24382
|
-
this._dispatchSelectEvent();
|
|
24383
|
-
}
|
|
24384
|
-
if (this._pointerMode === `select-cont`) {
|
|
24385
|
-
if (this._dragAnchor !== null && this._shiftClickTarget !== null) {
|
|
24386
|
-
this._selection = {
|
|
24387
|
-
kind: `contiguous`,
|
|
24388
|
-
start: this._dragAnchor,
|
|
24389
|
-
end: this._shiftClickTarget
|
|
24390
|
-
};
|
|
24391
|
-
this._initialSelectionPoint = Math.min(this._dragAnchor, this._shiftClickTarget);
|
|
24392
|
-
this._currentCursorPoint = Math.max(this._dragAnchor, this._shiftClickTarget);
|
|
24393
|
-
this._dispatchSelectEvent();
|
|
24394
|
-
} else if (this._dragAnchor !== null) {
|
|
24395
|
-
const mode = `contiguous`;
|
|
24396
|
-
this._selection = selectionFromPointerRange(this._dragAnchor, pos, mode, this.columns);
|
|
24397
|
-
this._initialSelectionPoint = this._dragAnchor;
|
|
24398
|
-
this._currentCursorPoint = pos;
|
|
24399
|
-
this._dispatchSelectEvent();
|
|
24400
|
-
}
|
|
24401
|
-
}
|
|
24402
|
-
if (this._pointerMode === `select-rect`) {
|
|
24403
|
-
const bpr = bytesPerRow(this.columns);
|
|
24404
|
-
const currentX = pos % bpr;
|
|
24405
|
-
const currentY = Math.floor(pos / bpr);
|
|
24406
|
-
const x = Math.min(this._rectAnchorX, currentX);
|
|
24407
|
-
const y = Math.min(this._rectAnchorY, currentY);
|
|
24408
|
-
const width = Math.abs(currentX - this._rectAnchorX) + 1;
|
|
24409
|
-
const height = Math.abs(currentY - this._rectAnchorY) + 1;
|
|
24410
|
-
this._selection = {
|
|
24411
|
-
kind: `rectangular`,
|
|
24412
|
-
x,
|
|
24413
|
-
y,
|
|
24414
|
-
width,
|
|
24415
|
-
height
|
|
24416
|
-
};
|
|
24417
|
-
this._dispatchSelectEvent();
|
|
24161
|
+
#quantise(value) {
|
|
24162
|
+
if (this.stops && this.stops > 1) {
|
|
24163
|
+
const step = (this.max - this.min) / this.stops;
|
|
24164
|
+
return Math.round((value - this.min) / step) * step + this.min;
|
|
24418
24165
|
}
|
|
24419
|
-
|
|
24420
|
-
|
|
24421
|
-
|
|
24166
|
+
return value;
|
|
24167
|
+
}
|
|
24168
|
+
#setValueFromRelative(relativeValue, isUserInteraction = false) {
|
|
24169
|
+
const newValue = scale(relativeValue, 0, 1, this.min, this.max);
|
|
24170
|
+
const clampedValue = this.#quantise(clamp(newValue, this.min, this.max));
|
|
24171
|
+
if (clampedValue === this.value) return;
|
|
24172
|
+
const previousValue = this.value;
|
|
24173
|
+
this.value = clampedValue;
|
|
24174
|
+
this.#isUserInteraction = isUserInteraction;
|
|
24175
|
+
const valueLane = this.#lanes.get(`value`);
|
|
24176
|
+
if (valueLane && valueLane.type === `value`) valueLane.value = this.#getRelativeValue();
|
|
24177
|
+
if (this.hasAttribute(`data-tooltip-live`)) {
|
|
24178
|
+
const percentage = Math.round(this.#getRelativeValue() * 100);
|
|
24179
|
+
this.setAttribute(`data-tooltip`, `${percentage}%`);
|
|
24422
24180
|
}
|
|
24423
|
-
|
|
24424
|
-
|
|
24425
|
-
|
|
24426
|
-
|
|
24427
|
-
|
|
24181
|
+
if (isUserInteraction) {
|
|
24182
|
+
this.dispatchEvent(new CustomEvent(`input`, {
|
|
24183
|
+
detail: {
|
|
24184
|
+
value: this.value,
|
|
24185
|
+
valueRelative: this.#getRelativeValue()
|
|
24186
|
+
},
|
|
24187
|
+
bubbles: true,
|
|
24188
|
+
composed: true
|
|
24189
|
+
}));
|
|
24190
|
+
this.#scheduleChangeEvent(previousValue);
|
|
24191
|
+
} else this.#fireChangeEvent(previousValue);
|
|
24428
24192
|
}
|
|
24429
|
-
|
|
24430
|
-
if (
|
|
24431
|
-
this
|
|
24432
|
-
|
|
24433
|
-
|
|
24193
|
+
#scheduleChangeEvent(previousValue) {
|
|
24194
|
+
if (this.#changeDebounceTimer !== void 0) clearTimeout(this.#changeDebounceTimer);
|
|
24195
|
+
this.#changeDebounceTimer = window.setTimeout(() => {
|
|
24196
|
+
this.#fireChangeEvent(previousValue);
|
|
24197
|
+
this.#changeDebounceTimer = void 0;
|
|
24198
|
+
}, 150);
|
|
24199
|
+
}
|
|
24200
|
+
#fireChangeEvent(previousValue) {
|
|
24201
|
+
this.dispatchEvent(new CustomEvent(`change`, {
|
|
24202
|
+
detail: {
|
|
24203
|
+
value: this.value,
|
|
24204
|
+
valueRelative: this.#getRelativeValue(),
|
|
24205
|
+
previousValue
|
|
24206
|
+
},
|
|
24207
|
+
bubbles: true,
|
|
24208
|
+
composed: true
|
|
24209
|
+
}));
|
|
24210
|
+
}
|
|
24211
|
+
#onPointerDown;
|
|
24212
|
+
#onPointerMove;
|
|
24213
|
+
#onPointerUp;
|
|
24214
|
+
#onKeyDown;
|
|
24215
|
+
#renderCircleBorder() {
|
|
24216
|
+
const path = generateCircleBorderPath(this.radius, this.flatten, CENTER);
|
|
24217
|
+
const borderWidth = this.#getCssVar(`--dial-border-width`, 2);
|
|
24218
|
+
return w`<path class="dial-border" d="${path}" fill="none" stroke="${getComputedStyle(this).getPropertyValue(`--dial-border-color`).trim() || `var(--surface-4)`}" stroke-width="${borderWidth}" stroke-linecap="round" vector-effect="non-scaling-stroke" />`;
|
|
24219
|
+
}
|
|
24220
|
+
#renderCircleFill() {
|
|
24221
|
+
return w`<path class="dial-fill" d="${generateCircleBorderPath(this.radius, this.flatten, CENTER)}" fill="${getComputedStyle(this).getPropertyValue(`--dial-fill`).trim() || `transparent`}" />`;
|
|
24222
|
+
}
|
|
24223
|
+
#renderWedge() {
|
|
24224
|
+
const { startAngle, endAngle, clockwise } = getWedgeAngles(this.#getRelativeValue(), this.valueMode, this.flatten);
|
|
24225
|
+
const path = generateWedgePath(startAngle, endAngle, this.radius, CENTER, clockwise);
|
|
24226
|
+
if (!path) return w``;
|
|
24227
|
+
return w`<path class="wedge" d="${path}" />`;
|
|
24228
|
+
}
|
|
24229
|
+
#renderLane(lane) {
|
|
24230
|
+
let arcPath = ``;
|
|
24231
|
+
if (lane.type === `fixed`) arcPath = generateCircleBorderPath(this.radius - lane.offset * this.radius, this.flatten, CENTER);
|
|
24232
|
+
else if (lane.type === `anchored`) {
|
|
24233
|
+
const { startAngle, endAngle } = getAnchoredArcAngles(this.#getRelativeValue(), lane.value, this.valueMode, this.flatten);
|
|
24234
|
+
arcPath = generateArcPath(startAngle, endAngle, this.radius - lane.offset * this.radius, CENTER);
|
|
24235
|
+
} else {
|
|
24236
|
+
const { startAngle, endAngle } = getValueArcAngles(lane.value, this.valueMode, this.flatten);
|
|
24237
|
+
arcPath = generateArcPath(startAngle, endAngle, this.radius - lane.offset * this.radius, CENTER);
|
|
24238
|
+
}
|
|
24239
|
+
if (!arcPath) return w``;
|
|
24240
|
+
return w`
|
|
24241
|
+
<path
|
|
24242
|
+
class="lane"
|
|
24243
|
+
data-lane-key="${lane.key}"
|
|
24244
|
+
part="lane lane-${lane.key}"
|
|
24245
|
+
d="${arcPath}"
|
|
24246
|
+
style="
|
|
24247
|
+
stroke-width: calc(var(--lane-${lane.key}-width, var(--lane-width)) * ${this.radius}%);
|
|
24248
|
+
stroke-linecap: round;
|
|
24249
|
+
"
|
|
24250
|
+
/>
|
|
24251
|
+
`;
|
|
24252
|
+
}
|
|
24253
|
+
#getNeedlePath(angle, length, offset) {
|
|
24254
|
+
const startRadius = offset * this.radius;
|
|
24255
|
+
const endRadius = length * this.radius;
|
|
24256
|
+
const start = {
|
|
24257
|
+
x: CENTER.x + Math.cos(angle) * startRadius,
|
|
24258
|
+
y: CENTER.y + Math.sin(angle) * startRadius
|
|
24434
24259
|
};
|
|
24435
|
-
|
|
24260
|
+
const end = {
|
|
24261
|
+
x: CENTER.x + Math.cos(angle) * endRadius,
|
|
24262
|
+
y: CENTER.y + Math.sin(angle) * endRadius
|
|
24263
|
+
};
|
|
24264
|
+
return `M ${start.x} ${start.y} L ${end.x} ${end.y}`;
|
|
24436
24265
|
}
|
|
24437
|
-
|
|
24438
|
-
|
|
24439
|
-
const
|
|
24440
|
-
|
|
24441
|
-
|
|
24442
|
-
|
|
24443
|
-
|
|
24444
|
-
|
|
24445
|
-
|
|
24446
|
-
|
|
24447
|
-
|
|
24448
|
-
|
|
24266
|
+
#renderValueMarker(needlePath) {
|
|
24267
|
+
const { angle, position } = getMarkerPosition(this.#getRelativeValue(), this.valueMode, this.flatten, this.radius, CENTER);
|
|
24268
|
+
const markerOffset = this.#getCssVar(`--marker-offset`, 1);
|
|
24269
|
+
const markerBorderWidth = this.#getCssVar(`--marker-border-width`, 0);
|
|
24270
|
+
const effectiveStyle = this.#getEffectiveMarkerStyle();
|
|
24271
|
+
if (effectiveStyle === `dot`) {
|
|
24272
|
+
const r = this.#getCssVar(`--marker-thickness`, .15) * this.radius;
|
|
24273
|
+
const dotX = CENTER.x + (position.x - CENTER.x) * markerOffset;
|
|
24274
|
+
const dotY = CENTER.y + (position.y - CENTER.y) * markerOffset;
|
|
24275
|
+
if (markerBorderWidth > 0) return w`
|
|
24276
|
+
<g class="value-marker" part="value-marker">
|
|
24277
|
+
<use href="#dot-path" class="marker-border" />
|
|
24278
|
+
<use href="#dot-path" class="marker-fill" />
|
|
24279
|
+
</g>
|
|
24280
|
+
`;
|
|
24281
|
+
return w`
|
|
24282
|
+
<g class="value-marker" part="value-marker">
|
|
24283
|
+
<circle cx="${dotX}" cy="${dotY}" r="${r}" />
|
|
24284
|
+
</g>
|
|
24285
|
+
`;
|
|
24286
|
+
} else if (effectiveStyle === `needle`) {
|
|
24287
|
+
if (markerBorderWidth > 0 && needlePath) return w`
|
|
24288
|
+
<g class="value-marker" part="value-marker">
|
|
24289
|
+
<use href="#needle-path" class="marker-border" />
|
|
24290
|
+
<use href="#needle-path" class="marker-fill" />
|
|
24291
|
+
</g>
|
|
24292
|
+
`;
|
|
24293
|
+
const length = this.#getCssVar(`--marker-length`, .8);
|
|
24294
|
+
const offset = this.#getCssVar(`--marker-offset`, .2);
|
|
24295
|
+
return w`
|
|
24296
|
+
<g class="value-marker" part="value-marker">
|
|
24297
|
+
<path d="${this.#getNeedlePath(angle, length, offset)}" />
|
|
24298
|
+
</g>
|
|
24299
|
+
`;
|
|
24449
24300
|
}
|
|
24450
|
-
|
|
24451
|
-
|
|
24452
|
-
|
|
24453
|
-
|
|
24301
|
+
}
|
|
24302
|
+
#renderMidpointMarker() {
|
|
24303
|
+
if (this.valueMode !== `bipolar` && this.valueMode !== `unipolar`) return w``;
|
|
24304
|
+
const { position } = getMidpointPosition(this.radius, CENTER);
|
|
24305
|
+
if (this.markerStyle === `dot`) {
|
|
24306
|
+
const size = this.#getCssVar(`--midpoint-thickness`, .08);
|
|
24307
|
+
return w`
|
|
24308
|
+
<g class="midpoint-marker" part="midpoint-marker">
|
|
24309
|
+
<circle
|
|
24310
|
+
cx="${position.x}"
|
|
24311
|
+
cy="${position.y}"
|
|
24312
|
+
r="${size * this.radius}"
|
|
24313
|
+
/>
|
|
24314
|
+
</g>
|
|
24315
|
+
`;
|
|
24316
|
+
} else {
|
|
24317
|
+
const length = this.#getCssVar(`--midpoint-length`, .15);
|
|
24318
|
+
const offset = this.#getCssVar(`--midpoint-offset`, .85);
|
|
24319
|
+
const angle = -Math.PI / 2;
|
|
24320
|
+
const startRadius = offset * this.radius;
|
|
24321
|
+
const endRadius = (offset + length) * this.radius;
|
|
24322
|
+
const start = {
|
|
24323
|
+
x: CENTER.x + Math.cos(angle) * startRadius,
|
|
24324
|
+
y: CENTER.y + Math.sin(angle) * startRadius
|
|
24454
24325
|
};
|
|
24455
|
-
|
|
24456
|
-
|
|
24326
|
+
const end = {
|
|
24327
|
+
x: CENTER.x + Math.cos(angle) * endRadius,
|
|
24328
|
+
y: CENTER.y + Math.sin(angle) * endRadius
|
|
24329
|
+
};
|
|
24330
|
+
return w`
|
|
24331
|
+
<g class="midpoint-marker" part="midpoint-marker">
|
|
24332
|
+
<line
|
|
24333
|
+
x1="${start.x}"
|
|
24334
|
+
y1="${start.y}"
|
|
24335
|
+
x2="${end.x}"
|
|
24336
|
+
y2="${end.y}"
|
|
24337
|
+
/>
|
|
24338
|
+
</g>
|
|
24339
|
+
`;
|
|
24457
24340
|
}
|
|
24458
|
-
|
|
24459
|
-
|
|
24460
|
-
|
|
24461
|
-
|
|
24462
|
-
|
|
24463
|
-
|
|
24464
|
-
|
|
24465
|
-
|
|
24466
|
-
|
|
24341
|
+
}
|
|
24342
|
+
#getCssVar(name, defaultValue) {
|
|
24343
|
+
const style = getComputedStyle(this);
|
|
24344
|
+
const val = style.getPropertyValue(name).trim();
|
|
24345
|
+
if (!val) return defaultValue;
|
|
24346
|
+
if (val.includes(`calc(`)) {
|
|
24347
|
+
const valueRelative = style.getPropertyValue(`--value-relative`).trim();
|
|
24348
|
+
if (!valueRelative) {
|
|
24349
|
+
const parsed = Number.parseFloat(val.replace(/[^0-9.-]/g, ``));
|
|
24350
|
+
return Number.isNaN(parsed) ? defaultValue : parsed;
|
|
24467
24351
|
}
|
|
24468
|
-
|
|
24469
|
-
|
|
24470
|
-
|
|
24471
|
-
|
|
24472
|
-
|
|
24473
|
-
|
|
24474
|
-
|
|
24475
|
-
};
|
|
24476
|
-
this.requestUpdate();
|
|
24477
|
-
if (newPartial.length === 2) {
|
|
24478
|
-
const value = Number.parseInt(newPartial, 16);
|
|
24479
|
-
const diff = writeByte(this._store, pos, value);
|
|
24480
|
-
push(this._undoStack, diff);
|
|
24481
|
-
this._dispatchChangeEvent(diff);
|
|
24482
|
-
this._advanceCursor();
|
|
24352
|
+
const evalStr = val.replace(/var\(--value-relative\)/g, valueRelative);
|
|
24353
|
+
try {
|
|
24354
|
+
const result = new Function(`return ${evalStr.replace(/calc\s*\(([^)]+)\)/g, `$1`)}`)();
|
|
24355
|
+
return typeof result === `number` && !Number.isNaN(result) ? result : defaultValue;
|
|
24356
|
+
} catch (e) {
|
|
24357
|
+
const parsed = Number.parseFloat(val.replace(/[^0-9.-]/g, ``));
|
|
24358
|
+
return Number.isNaN(parsed) ? defaultValue : parsed;
|
|
24483
24359
|
}
|
|
24484
|
-
} else if (partial !== ``) {
|
|
24485
|
-
this._editState = {
|
|
24486
|
-
...this._editState,
|
|
24487
|
-
partial: ``
|
|
24488
|
-
};
|
|
24489
|
-
this.requestUpdate();
|
|
24490
24360
|
}
|
|
24491
|
-
|
|
24492
|
-
|
|
24493
|
-
|
|
24494
|
-
|
|
24495
|
-
|
|
24496
|
-
|
|
24497
|
-
|
|
24498
|
-
this
|
|
24499
|
-
this._advanceCursor();
|
|
24361
|
+
const parsed = Number.parseFloat(val);
|
|
24362
|
+
return Number.isNaN(parsed) ? defaultValue : parsed;
|
|
24363
|
+
}
|
|
24364
|
+
willUpdate(changed) {
|
|
24365
|
+
super.willUpdate(changed);
|
|
24366
|
+
if (changed.has(`value`) || !this.hasUpdated) {
|
|
24367
|
+
const valueLane = this.#lanes.get(`value`);
|
|
24368
|
+
if (valueLane && valueLane.type === `value`) valueLane.value = this.#getRelativeValue();
|
|
24500
24369
|
}
|
|
24501
24370
|
}
|
|
24502
|
-
|
|
24503
|
-
|
|
24504
|
-
const
|
|
24505
|
-
const
|
|
24506
|
-
|
|
24507
|
-
|
|
24508
|
-
|
|
24509
|
-
|
|
24510
|
-
|
|
24511
|
-
|
|
24512
|
-
|
|
24513
|
-
|
|
24514
|
-
|
|
24515
|
-
|
|
24371
|
+
render() {
|
|
24372
|
+
const lanes = Array.from(this.#lanes.values());
|
|
24373
|
+
const { angle, position } = getMarkerPosition(this.#getRelativeValue(), this.valueMode, this.flatten, this.radius, CENTER);
|
|
24374
|
+
const needleLength = this.#getCssVar(`--marker-length`, .8);
|
|
24375
|
+
const needleOffset = this.#getCssVar(`--marker-offset`, .2);
|
|
24376
|
+
const markerBorderWidth = this.#getCssVar(`--marker-border-width`, 0);
|
|
24377
|
+
const needlePath = markerBorderWidth > 0 ? this.#getNeedlePath(angle, needleLength, needleOffset) : void 0;
|
|
24378
|
+
const dotR = this.#getCssVar(`--marker-thickness`, .15) * this.radius;
|
|
24379
|
+
const defs = [];
|
|
24380
|
+
if (needlePath) defs.push(w`<path id="needle-path" d="${needlePath}" />`);
|
|
24381
|
+
if (markerBorderWidth > 0) defs.push(w`<circle id="dot-path" cx="${position.x}" cy="${position.y}" r="${dotR}" />`);
|
|
24382
|
+
return b`
|
|
24383
|
+
<svg
|
|
24384
|
+
viewBox="0 0 100 100"
|
|
24385
|
+
preserveAspectRatio="xMidYMid meet"
|
|
24386
|
+
tabindex="${this.disabled ? -1 : 0}"
|
|
24387
|
+
@pointerdown="${this.#onPointerDown}"
|
|
24388
|
+
@keydown="${this.#onKeyDown}"
|
|
24389
|
+
style="cursor: ${this.#dragging ? `ns-resize` : `grab`}"
|
|
24390
|
+
>
|
|
24391
|
+
${defs.length > 0 ? w`<defs>${defs}</defs>` : ``}
|
|
24392
|
+
${this.#renderCircleFill()}
|
|
24393
|
+
${this.wedge ? this.#renderWedge() : ``}
|
|
24394
|
+
${this.#renderCircleBorder()}
|
|
24395
|
+
${lanes.map((lane) => this.#renderLane(lane))}
|
|
24396
|
+
${this.#renderMidpointMarker()}
|
|
24397
|
+
${this.#renderValueMarker(needlePath)}
|
|
24398
|
+
</svg>
|
|
24399
|
+
`;
|
|
24516
24400
|
}
|
|
24517
|
-
|
|
24518
|
-
|
|
24519
|
-
|
|
24520
|
-
|
|
24521
|
-
|
|
24522
|
-
|
|
24401
|
+
updated(changed) {
|
|
24402
|
+
super.updated(changed);
|
|
24403
|
+
if (changed.has(`radius`)) this.style.setProperty(`--radius`, `${this.radius}%`);
|
|
24404
|
+
this.style.setProperty(`--value-relative`, this.#getRelativeValue().toString());
|
|
24405
|
+
if (changed.has(`flatten`)) {
|
|
24406
|
+
const markerThickness = this.#getCssVar(`--marker-thickness`, .15);
|
|
24407
|
+
const radius = this.#getCssVar(`--radius`, 45);
|
|
24408
|
+
const markerPadding = Math.round(markerThickness * radius) + 5;
|
|
24409
|
+
const viewBoxHeight = Math.round(100 * (1 - this.flatten)) + markerPadding;
|
|
24410
|
+
this.style.setProperty(`--dial-height`, `${viewBoxHeight}px`);
|
|
24411
|
+
const svg = this.renderRoot.querySelector(`svg`);
|
|
24412
|
+
if (svg) svg.setAttribute(`viewBox`, `0 0 100 ${viewBoxHeight}`);
|
|
24413
|
+
}
|
|
24523
24414
|
}
|
|
24524
|
-
|
|
24525
|
-
|
|
24526
|
-
|
|
24527
|
-
|
|
24528
|
-
else if (sel.kind === `single`) detail = {
|
|
24529
|
-
type: `single`,
|
|
24530
|
-
position: sel.pos
|
|
24531
|
-
};
|
|
24532
|
-
else if (sel.kind === `contiguous`) detail = {
|
|
24533
|
-
type: `contiguous`,
|
|
24534
|
-
start: sel.start,
|
|
24535
|
-
end: sel.end
|
|
24536
|
-
};
|
|
24537
|
-
else if (sel.kind === `rectangular`) detail = {
|
|
24538
|
-
type: `rectangular`,
|
|
24539
|
-
x: sel.x,
|
|
24540
|
-
y: sel.y,
|
|
24541
|
-
width: sel.width,
|
|
24542
|
-
height: sel.height
|
|
24543
|
-
};
|
|
24544
|
-
else detail = { type: `none` };
|
|
24545
|
-
this.dispatchEvent(new CustomEvent(`select`, {
|
|
24546
|
-
detail,
|
|
24547
|
-
bubbles: true,
|
|
24548
|
-
composed: true
|
|
24549
|
-
}));
|
|
24415
|
+
disconnectedCallback() {
|
|
24416
|
+
super.disconnectedCallback();
|
|
24417
|
+
if (this.#changeDebounceTimer !== void 0) clearTimeout(this.#changeDebounceTimer);
|
|
24418
|
+
this.#onPointerUp();
|
|
24550
24419
|
}
|
|
24551
|
-
|
|
24552
|
-
const
|
|
24553
|
-
|
|
24554
|
-
const
|
|
24555
|
-
|
|
24556
|
-
|
|
24557
|
-
|
|
24420
|
+
firstUpdated() {
|
|
24421
|
+
const markerThickness = this.#getCssVar(`--marker-thickness`, .15);
|
|
24422
|
+
const radius = this.#getCssVar(`--radius`, 45);
|
|
24423
|
+
const markerPadding = Math.round(markerThickness * radius);
|
|
24424
|
+
const viewBoxHeight = Math.round(100 * (1 - this.flatten)) + markerPadding;
|
|
24425
|
+
this.style.setProperty(`--dial-height`, `${viewBoxHeight}px`);
|
|
24426
|
+
const svg = this.renderRoot.querySelector(`svg`);
|
|
24427
|
+
if (svg) svg.setAttribute(`viewBox`, `0 0 100 ${viewBoxHeight}`);
|
|
24558
24428
|
}
|
|
24559
|
-
|
|
24560
|
-
|
|
24561
|
-
|
|
24562
|
-
|
|
24563
|
-
|
|
24564
|
-
|
|
24565
|
-
|
|
24566
|
-
|
|
24567
|
-
|
|
24568
|
-
|
|
24569
|
-
|
|
24570
|
-
|
|
24571
|
-
|
|
24572
|
-
|
|
24573
|
-
|
|
24574
|
-
|
|
24575
|
-
|
|
24576
|
-
|
|
24577
|
-
|
|
24578
|
-
|
|
24579
|
-
|
|
24580
|
-
|
|
24581
|
-
|
|
24582
|
-
|
|
24583
|
-
|
|
24584
|
-
|
|
24585
|
-
|
|
24586
|
-
|
|
24587
|
-
|
|
24588
|
-
|
|
24589
|
-
|
|
24590
|
-
|
|
24591
|
-
|
|
24429
|
+
static {
|
|
24430
|
+
this.styles = [prominenceStyles, i$6`
|
|
24431
|
+
:host {
|
|
24432
|
+
display: inline-block;
|
|
24433
|
+
width: 100px;
|
|
24434
|
+
height: var(--dial-height, 100px);
|
|
24435
|
+
touch-action: none;
|
|
24436
|
+
user-select: none;
|
|
24437
|
+
tabindex: 0;
|
|
24438
|
+
|
|
24439
|
+
/* Dynamic value - set by JS */
|
|
24440
|
+
--value-relative: 0;
|
|
24441
|
+
|
|
24442
|
+
/* Lane widths (used in stroke-width calculations) */
|
|
24443
|
+
--lane-width: 0.16;
|
|
24444
|
+
--lane-track-width: 0.08;
|
|
24445
|
+
--lane-value-width: 0.12;
|
|
24446
|
+
}
|
|
24447
|
+
|
|
24448
|
+
:host([disabled]) {
|
|
24449
|
+
cursor: not-allowed;
|
|
24450
|
+
}
|
|
24451
|
+
|
|
24452
|
+
svg {
|
|
24453
|
+
width: 100%;
|
|
24454
|
+
height: 100%;
|
|
24455
|
+
outline: none;
|
|
24456
|
+
}
|
|
24457
|
+
|
|
24458
|
+
svg:active {
|
|
24459
|
+
cursor: grabbing;
|
|
24460
|
+
}
|
|
24461
|
+
|
|
24462
|
+
svg:focus-visible {
|
|
24463
|
+
outline: var(--radial-input-svg-focus-outline, 2px solid var(--accent));
|
|
24464
|
+
outline-offset: var(--radial-input-svg-focus-outline-offset, 2px);
|
|
24465
|
+
}
|
|
24466
|
+
|
|
24467
|
+
.dial-border {
|
|
24468
|
+
fill: none;
|
|
24469
|
+
stroke: var(--dial-border-color, var(--surface-4));
|
|
24470
|
+
stroke-width: var(--dial-border-width, 2px);
|
|
24471
|
+
stroke-linecap: round;
|
|
24472
|
+
vector-effect: non-scaling-stroke;
|
|
24473
|
+
}
|
|
24474
|
+
|
|
24475
|
+
.dial-fill {
|
|
24476
|
+
fill: var(--dial-fill, transparent);
|
|
24477
|
+
}
|
|
24478
|
+
|
|
24479
|
+
.wedge {
|
|
24480
|
+
fill: var(--wedge-fill, var(--accent));
|
|
24481
|
+
fill-opacity: var(--wedge-fill-opacity, 0.25);
|
|
24482
|
+
stroke: var(--wedge-border-color, var(--accent));
|
|
24483
|
+
stroke-width: var(--wedge-border-width, 0);
|
|
24484
|
+
stroke-opacity: var(--wedge-border-opacity, 1);
|
|
24485
|
+
vector-effect: non-scaling-stroke;
|
|
24486
|
+
}
|
|
24487
|
+
|
|
24488
|
+
.lane {
|
|
24489
|
+
fill: none;
|
|
24490
|
+
stroke-linecap: round;
|
|
24491
|
+
stroke-dasharray: var(--lane-dasharray, none);
|
|
24492
|
+
stroke-dashoffset: var(--lane-dashoffset, 0);
|
|
24493
|
+
vector-effect: non-scaling-stroke;
|
|
24494
|
+
}
|
|
24495
|
+
|
|
24496
|
+
.lane[data-lane-key='track'] {
|
|
24497
|
+
stroke: var(--lane-track-color, var(--surface-4));
|
|
24498
|
+
}
|
|
24499
|
+
|
|
24500
|
+
.lane[data-lane-key='value'] {
|
|
24501
|
+
stroke: var(--lane-value-color, var(--accent));
|
|
24502
|
+
}
|
|
24503
|
+
|
|
24504
|
+
.lane:not([data-lane-key='track']):not([data-lane-key='value']) {
|
|
24505
|
+
stroke: var(--lane-color, var(--accent));
|
|
24506
|
+
}
|
|
24507
|
+
|
|
24508
|
+
.value-marker path,
|
|
24509
|
+
.value-marker .marker-fill {
|
|
24510
|
+
stroke: var(--marker-color, var(--accent));
|
|
24511
|
+
stroke-width: calc(var(--marker-thickness, 0.15) * var(--radius, 45%));
|
|
24512
|
+
stroke-linecap: round;
|
|
24513
|
+
stroke-dasharray: var(--marker-dasharray, none);
|
|
24514
|
+
stroke-dashoffset: var(--marker-dashoffset, 0);
|
|
24515
|
+
vector-effect: non-scaling-stroke;
|
|
24516
|
+
}
|
|
24517
|
+
|
|
24518
|
+
.value-marker .marker-border {
|
|
24519
|
+
stroke: var(--marker-border-color, transparent);
|
|
24520
|
+
stroke-width: calc((var(--marker-thickness, 0.15) + var(--marker-border-width, 0) * 2) * var(--radius, 45%));
|
|
24521
|
+
stroke-linecap: round;
|
|
24522
|
+
vector-effect: non-scaling-stroke;
|
|
24523
|
+
}
|
|
24524
|
+
|
|
24525
|
+
.value-marker .marker-border {
|
|
24526
|
+
fill: none;
|
|
24527
|
+
}
|
|
24528
|
+
|
|
24529
|
+
.value-marker .marker-fill,
|
|
24530
|
+
.value-marker circle {
|
|
24531
|
+
fill: var(--marker-color, var(--accent));
|
|
24532
|
+
}
|
|
24533
|
+
|
|
24534
|
+
.midpoint-marker line {
|
|
24535
|
+
stroke: var(--midpoint-color, var(--surface-muted-text));
|
|
24536
|
+
stroke-width: var(--midpoint-thickness, 1px);
|
|
24537
|
+
stroke-linecap: round;
|
|
24538
|
+
vector-effect: non-scaling-stroke;
|
|
24539
|
+
}
|
|
24540
|
+
|
|
24541
|
+
.midpoint-marker circle {
|
|
24542
|
+
fill: var(--midpoint-color, var(--surface-muted-text));
|
|
24543
|
+
stroke: var(--midpoint-border-color, transparent);
|
|
24544
|
+
stroke-width: var(--midpoint-border-width, 0);
|
|
24545
|
+
vector-effect: non-scaling-stroke;
|
|
24546
|
+
}
|
|
24547
|
+
`];
|
|
24592
24548
|
}
|
|
24593
|
-
|
|
24594
|
-
|
|
24595
|
-
|
|
24596
|
-
|
|
24597
|
-
|
|
24598
|
-
|
|
24599
|
-
|
|
24600
|
-
|
|
24549
|
+
};
|
|
24550
|
+
__decorate([n$2({ type: Number })], RadialInputElement.prototype, "radius", null);
|
|
24551
|
+
__decorate([n$2({ type: Number })], RadialInputElement.prototype, "value", void 0);
|
|
24552
|
+
__decorate([n$2({ type: Number })], RadialInputElement.prototype, "min", void 0);
|
|
24553
|
+
__decorate([n$2({ type: Number })], RadialInputElement.prototype, "max", void 0);
|
|
24554
|
+
__decorate([n$2({ type: Number })], RadialInputElement.prototype, "step", void 0);
|
|
24555
|
+
__decorate([n$2({ type: Number })], RadialInputElement.prototype, "stops", void 0);
|
|
24556
|
+
__decorate([n$2({
|
|
24557
|
+
type: String,
|
|
24558
|
+
attribute: `value-mode`
|
|
24559
|
+
})], RadialInputElement.prototype, "valueMode", void 0);
|
|
24560
|
+
__decorate([n$2({ type: Number })], RadialInputElement.prototype, "flatten", void 0);
|
|
24561
|
+
__decorate([n$2({
|
|
24562
|
+
type: String,
|
|
24563
|
+
attribute: `marker-style`
|
|
24564
|
+
})], RadialInputElement.prototype, "markerStyle", void 0);
|
|
24565
|
+
__decorate([n$2({ type: Boolean })], RadialInputElement.prototype, "wedge", void 0);
|
|
24566
|
+
__decorate([n$2({
|
|
24567
|
+
type: Boolean,
|
|
24568
|
+
reflect: true
|
|
24569
|
+
})], RadialInputElement.prototype, "disabled", void 0);
|
|
24570
|
+
RadialInputElement = __decorate([t$4(`ixfx-radial-input`)], RadialInputElement);
|
|
24571
|
+
//#endregion
|
|
24572
|
+
//#region src/labelled-radial-input/labelled-radial-input.ts
|
|
24573
|
+
let LabelledRadialInput = class LabelledRadialInput extends LabelledInputBase {
|
|
24574
|
+
constructor(..._args) {
|
|
24575
|
+
super(..._args);
|
|
24576
|
+
this.inputSelector = `ixfx-radial-input`;
|
|
24577
|
+
this.max = 100;
|
|
24578
|
+
this.step = 1;
|
|
24579
|
+
this.radius = 45;
|
|
24580
|
+
this.flatten = .3;
|
|
24581
|
+
this.markerStyle = `needle`;
|
|
24582
|
+
this.wedge = false;
|
|
24583
|
+
this.valueMode = `range`;
|
|
24584
|
+
this.tooltip = false;
|
|
24585
|
+
this.flip = false;
|
|
24586
|
+
this.aspectRatioThreshold = 1.5;
|
|
24587
|
+
this._isWide = false;
|
|
24601
24588
|
}
|
|
24602
|
-
|
|
24603
|
-
|
|
24604
|
-
|
|
24605
|
-
const
|
|
24606
|
-
|
|
24589
|
+
_getEffectivePrecision() {
|
|
24590
|
+
if (this.hasAttribute(`precision`)) return this.precision;
|
|
24591
|
+
if (this.step !== void 0) {
|
|
24592
|
+
const decimalPart = String(this.step).split(`.`)[1];
|
|
24593
|
+
return decimalPart ? decimalPart.length : 0;
|
|
24607
24594
|
}
|
|
24608
|
-
return
|
|
24609
|
-
}
|
|
24610
|
-
_isRowShaded(pos) {
|
|
24611
|
-
const sel = this._selection;
|
|
24612
|
-
if (!sel || sel.kind !== `single`) return true;
|
|
24613
|
-
const bpr = bytesPerRow(this.columns);
|
|
24614
|
-
return Math.floor(pos / bpr) === Math.floor(sel.pos / bpr);
|
|
24615
|
-
}
|
|
24616
|
-
_isHexShaded(pos) {
|
|
24617
|
-
return this._isRowShaded(pos);
|
|
24595
|
+
return this.max - this.min > 10 ? 0 : 2;
|
|
24618
24596
|
}
|
|
24619
|
-
|
|
24620
|
-
|
|
24597
|
+
_handleResize(entries) {
|
|
24598
|
+
super._handleResize(entries);
|
|
24599
|
+
const { width, height } = entries[0].contentRect;
|
|
24600
|
+
this._isWide = height > 0 && width / height >= this.aspectRatioThreshold;
|
|
24621
24601
|
}
|
|
24622
|
-
|
|
24623
|
-
|
|
24624
|
-
const
|
|
24625
|
-
const totalRows = Math.ceil(dataLen / bpr);
|
|
24626
|
-
const containerH = this._containerH > 0 ? this._containerH : 280;
|
|
24627
|
-
const startRow = Math.floor(this._scrollTop / this._rowHeight);
|
|
24628
|
-
const endRow = Math.min(startRow + Math.ceil(containerH / this._rowHeight) + 2, totalRows);
|
|
24629
|
-
const topSpacerHeight = startRow * this._rowHeight;
|
|
24630
|
-
const botSpacerHeight = (totalRows - endRow) * this._rowHeight;
|
|
24631
|
-
const changeset = getChangeset(this._store);
|
|
24632
|
-
const colHeaders = this._getColHeaders();
|
|
24633
|
-
const hexActive = this._focusSide === `hex` || this._focusSide === null;
|
|
24634
|
-
const textActive = this._focusSide === `text`;
|
|
24602
|
+
_renderEditableNumber() {
|
|
24603
|
+
if (this._isMini) return A;
|
|
24604
|
+
const labelMinWidth = Math.max(this.label?.length ?? 0, 3) + 1;
|
|
24635
24605
|
return b`
|
|
24636
|
-
<
|
|
24637
|
-
|
|
24638
|
-
|
|
24639
|
-
|
|
24640
|
-
|
|
24641
|
-
|
|
24642
|
-
|
|
24643
|
-
|
|
24644
|
-
|
|
24645
|
-
|
|
24646
|
-
|
|
24647
|
-
|
|
24606
|
+
<ixfx-editable-number
|
|
24607
|
+
class="number"
|
|
24608
|
+
mode="label"
|
|
24609
|
+
no-drag
|
|
24610
|
+
.value=${String(this.value)}
|
|
24611
|
+
.min=${this.min}
|
|
24612
|
+
.max=${this.max}
|
|
24613
|
+
.step=${this.step}
|
|
24614
|
+
.dragSensitivity=${this.dragSensitivity}
|
|
24615
|
+
.precision=${this._getEffectivePrecision()}
|
|
24616
|
+
.displayText=${this.label}
|
|
24617
|
+
.displayTextLogic=${this._isDragging ? `hidden` : this.displayTextLogic}
|
|
24618
|
+
.formatter=${this._formatter}
|
|
24619
|
+
style="--label-min-width: var(--label-width, ${labelMinWidth}ch); --label-align: center;"
|
|
24620
|
+
@change=${this._handleNumberChange}
|
|
24621
|
+
></ixfx-editable-number>
|
|
24648
24622
|
`;
|
|
24649
24623
|
}
|
|
24650
|
-
|
|
24651
|
-
const
|
|
24652
|
-
const
|
|
24624
|
+
render() {
|
|
24625
|
+
const showTooltip = this.tooltip || this._isMini;
|
|
24626
|
+
const tooltipValue = this._getTooltipValue();
|
|
24653
24627
|
return b`
|
|
24654
|
-
<div class="
|
|
24655
|
-
${this.
|
|
24656
|
-
|
|
24657
|
-
|
|
24658
|
-
|
|
24659
|
-
|
|
24660
|
-
|
|
24661
|
-
|
|
24628
|
+
<div class="wrap ${this._isMini ? `mini` : ``} ${this._isWide ? `wide` : ``} ${this.flip ? `flip` : ``}">
|
|
24629
|
+
${this._renderEditableNumber()}
|
|
24630
|
+
<ixfx-radial-input
|
|
24631
|
+
class="dial"
|
|
24632
|
+
.value=${this.value}
|
|
24633
|
+
.min=${this.min}
|
|
24634
|
+
.max=${this.max}
|
|
24635
|
+
.step=${this.step}
|
|
24636
|
+
.radius=${this.radius}
|
|
24637
|
+
.flatten=${this.flatten}
|
|
24638
|
+
.markerStyle=${this.markerStyle}
|
|
24639
|
+
?wedge=${this.wedge}
|
|
24640
|
+
.valueMode=${this.valueMode}
|
|
24641
|
+
data-tooltip-anchor="top"
|
|
24642
|
+
data-tooltip=${tooltipValue}
|
|
24643
|
+
data-tooltip-live=${showTooltip ? `input` : A}
|
|
24644
|
+
@input=${this._handleSliderInput}
|
|
24645
|
+
@change=${this._handleInputChange}
|
|
24646
|
+
></ixfx-radial-input>
|
|
24662
24647
|
</div>
|
|
24663
24648
|
`;
|
|
24664
24649
|
}
|
|
24665
|
-
|
|
24666
|
-
const
|
|
24667
|
-
|
|
24668
|
-
|
|
24669
|
-
|
|
24670
|
-
|
|
24671
|
-
1,
|
|
24672
|
-
2,
|
|
24673
|
-
3
|
|
24674
|
-
].map((b) => this._renderHexCell(basePos + b, changeset))}
|
|
24675
|
-
</span>
|
|
24676
|
-
`;
|
|
24677
|
-
}
|
|
24678
|
-
_renderHexCell(pos, changeset) {
|
|
24679
|
-
if (pos >= length(this._store)) return b`<span class="hex-cell"></span>`;
|
|
24680
|
-
const byte = readByte(this._store, pos);
|
|
24681
|
-
const hexStr = byte.toString(16).toUpperCase().padStart(2, `0`);
|
|
24682
|
-
const isSelected = selectionContains(this._selection, pos, this.columns);
|
|
24683
|
-
const isChanged = this.showChangeset && changeset.has(pos);
|
|
24684
|
-
const isEditing = this._editState?.pos === pos;
|
|
24685
|
-
const classes = [`hex-cell`];
|
|
24686
|
-
if (isSelected) classes.push(`selected`);
|
|
24687
|
-
if (isChanged) classes.push(`changed`);
|
|
24688
|
-
if (isEditing) classes.push(`editing`);
|
|
24689
|
-
if (this._isHexShaded(pos)) classes.push(`shaded`);
|
|
24690
|
-
let displayText = hexStr;
|
|
24691
|
-
let colourStyle;
|
|
24692
|
-
if (isEditing && this._editState) displayText = this._editState.partial === `` ? hexStr : `${this._editState.partial}_`;
|
|
24693
|
-
if (this.colourScheme === `shade` && this._shadeMap) colourStyle = { color: this._shadeMap.forByte(byte) };
|
|
24694
|
-
else if (this.colourScheme === `ascii`) classes.push(getAsciiClass(byte));
|
|
24695
|
-
return b`
|
|
24696
|
-
<span
|
|
24697
|
-
class=${classes.join(` `)}
|
|
24698
|
-
style=${o$1(colourStyle || {})}
|
|
24699
|
-
@pointerdown=${(e) => this._onPointerDown(pos, `hex`, e)}
|
|
24700
|
-
@pointerup=${(e) => this._onPointerUp(pos, `hex`, e)}
|
|
24701
|
-
@pointermove=${(e) => this._onPointerMove(pos, `hex`, e)}
|
|
24702
|
-
>${displayText}</span>
|
|
24703
|
-
`;
|
|
24650
|
+
_getTooltipValue() {
|
|
24651
|
+
const range = this.max - this.min;
|
|
24652
|
+
const numValue = Number(this.value);
|
|
24653
|
+
if (this.min === 0 && this.max === 1) return `${Math.round(numValue * 100)}%`;
|
|
24654
|
+
if (range > 10) return String(Math.floor(numValue));
|
|
24655
|
+
return numValue.toFixed(2);
|
|
24704
24656
|
}
|
|
24705
|
-
|
|
24706
|
-
|
|
24707
|
-
|
|
24708
|
-
|
|
24709
|
-
|
|
24710
|
-
|
|
24711
|
-
|
|
24712
|
-
|
|
24713
|
-
|
|
24714
|
-
|
|
24715
|
-
|
|
24716
|
-
|
|
24717
|
-
|
|
24718
|
-
|
|
24719
|
-
|
|
24720
|
-
|
|
24721
|
-
|
|
24722
|
-
|
|
24723
|
-
|
|
24724
|
-
|
|
24725
|
-
|
|
24726
|
-
|
|
24657
|
+
static {
|
|
24658
|
+
this.styles = i$6`
|
|
24659
|
+
:host {
|
|
24660
|
+
display: block;
|
|
24661
|
+
min-height: var(--min-height, 60px);
|
|
24662
|
+
min-width: var(--min-width, 60px);
|
|
24663
|
+
width: var(--width, auto);
|
|
24664
|
+
height: var(--height, auto);
|
|
24665
|
+
}
|
|
24666
|
+
|
|
24667
|
+
:host(:focus-within) {
|
|
24668
|
+
outline: 2px solid var(--accent);
|
|
24669
|
+
outline-offset: 2px;
|
|
24670
|
+
}
|
|
24671
|
+
|
|
24672
|
+
.wrap {
|
|
24673
|
+
display: flex;
|
|
24674
|
+
width: 100%;
|
|
24675
|
+
height: 100%;
|
|
24676
|
+
align-items: center;
|
|
24677
|
+
justify-content: center;
|
|
24678
|
+
flex-direction: var(--flow, column);
|
|
24679
|
+
}
|
|
24680
|
+
|
|
24681
|
+
ixfx-editable-number {
|
|
24682
|
+
flex-shrink: 0;
|
|
24683
|
+
--label-align: center;
|
|
24684
|
+
width: 100%;
|
|
24685
|
+
}
|
|
24686
|
+
|
|
24687
|
+
ixfx-radial-input {
|
|
24688
|
+
flex-shrink: 1;
|
|
24689
|
+
min-height: 0;
|
|
24690
|
+
min-width: 0;
|
|
24691
|
+
max-width: 100%;
|
|
24692
|
+
--radial-input-svg-focus-outline: none;
|
|
24693
|
+
--radial-input-svg-focus-outline-offset: 0;
|
|
24694
|
+
--prominence-tickled-opacity: 1;
|
|
24695
|
+
--prominence-tickled-saturate: 1;
|
|
24696
|
+
}
|
|
24697
|
+
|
|
24698
|
+
/* Wide layout (aspect ratio >= threshold): label to the left of dial */
|
|
24699
|
+
.wrap.wide {
|
|
24700
|
+
flex-direction: var(--flow, row);
|
|
24701
|
+
justify-content: space-evenly;
|
|
24702
|
+
}
|
|
24703
|
+
|
|
24704
|
+
.wrap.wide ixfx-editable-number {
|
|
24705
|
+
--label-align: left;
|
|
24706
|
+
width: var(--label-width, 5ch);
|
|
24707
|
+
}
|
|
24708
|
+
|
|
24709
|
+
.wrap.wide ixfx-radial-input {
|
|
24710
|
+
height: auto;
|
|
24711
|
+
max-width: none;
|
|
24712
|
+
}
|
|
24713
|
+
|
|
24714
|
+
/* Flip: label after dial (bottom in column, right in row) */
|
|
24715
|
+
.wrap.flip ixfx-editable-number {
|
|
24716
|
+
order: 1;
|
|
24717
|
+
}
|
|
24718
|
+
|
|
24719
|
+
/* Mini mode: dial fills the component */
|
|
24720
|
+
.wrap.mini {
|
|
24721
|
+
justify-content: center;
|
|
24722
|
+
gap: 0;
|
|
24723
|
+
}
|
|
24724
|
+
|
|
24725
|
+
.wrap.mini ixfx-radial-input {
|
|
24726
|
+
width: 100%;
|
|
24727
|
+
height: 100%;
|
|
24728
|
+
}
|
|
24729
|
+
`;
|
|
24727
24730
|
}
|
|
24728
24731
|
};
|
|
24729
|
-
__decorate([n$2({ type: Number })],
|
|
24730
|
-
__decorate([n$2({ type:
|
|
24731
|
-
__decorate([n$2({ type: Boolean })], IxfxHexEditorElement.prototype, "showChangeset", void 0);
|
|
24732
|
+
__decorate([n$2({ type: Number })], LabelledRadialInput.prototype, "radius", void 0);
|
|
24733
|
+
__decorate([n$2({ type: Number })], LabelledRadialInput.prototype, "flatten", void 0);
|
|
24732
24734
|
__decorate([n$2({
|
|
24733
|
-
type:
|
|
24734
|
-
attribute: `
|
|
24735
|
-
})],
|
|
24735
|
+
type: String,
|
|
24736
|
+
attribute: `marker-style`
|
|
24737
|
+
})], LabelledRadialInput.prototype, "markerStyle", void 0);
|
|
24738
|
+
__decorate([n$2({ type: Boolean })], LabelledRadialInput.prototype, "wedge", void 0);
|
|
24736
24739
|
__decorate([n$2({
|
|
24737
|
-
type:
|
|
24738
|
-
attribute: `
|
|
24739
|
-
})],
|
|
24740
|
+
type: String,
|
|
24741
|
+
attribute: `value-mode`
|
|
24742
|
+
})], LabelledRadialInput.prototype, "valueMode", void 0);
|
|
24743
|
+
__decorate([n$2({ type: Boolean })], LabelledRadialInput.prototype, "tooltip", void 0);
|
|
24744
|
+
__decorate([n$2({ type: Boolean })], LabelledRadialInput.prototype, "flip", void 0);
|
|
24740
24745
|
__decorate([n$2({
|
|
24741
|
-
type:
|
|
24742
|
-
attribute: `
|
|
24743
|
-
})],
|
|
24744
|
-
__decorate([r$1()],
|
|
24745
|
-
__decorate([
|
|
24746
|
-
__decorate([r$1()], IxfxHexEditorElement.prototype, "_editState", void 0);
|
|
24747
|
-
__decorate([r$1()], IxfxHexEditorElement.prototype, "_containerH", void 0);
|
|
24748
|
-
__decorate([r$1()], IxfxHexEditorElement.prototype, "_shadeMap", void 0);
|
|
24749
|
-
__decorate([r$1()], IxfxHexEditorElement.prototype, "_focusSide", void 0);
|
|
24750
|
-
IxfxHexEditorElement = __decorate([t$4(`ixfx-hex-editor`)], IxfxHexEditorElement);
|
|
24746
|
+
type: Number,
|
|
24747
|
+
attribute: `aspect-ratio-threshold`
|
|
24748
|
+
})], LabelledRadialInput.prototype, "aspectRatioThreshold", void 0);
|
|
24749
|
+
__decorate([r$1()], LabelledRadialInput.prototype, "_isWide", void 0);
|
|
24750
|
+
LabelledRadialInput = __decorate([t$4(`ixfx-labelled-radial-input`)], LabelledRadialInput);
|
|
24751
24751
|
//#endregion
|
|
24752
24752
|
//#region src/led.ts
|
|
24753
24753
|
let LedElement = class LedElement extends i$3 {
|
|
@@ -26972,6 +26972,94 @@ var MillerTreeController = class {
|
|
|
26972
26972
|
}
|
|
26973
26973
|
};
|
|
26974
26974
|
//#endregion
|
|
26975
|
+
//#region src/panel/panel-group.ts
|
|
26976
|
+
let PanelGroupElement = class PanelGroupElement extends i$3 {
|
|
26977
|
+
constructor(..._args) {
|
|
26978
|
+
super(..._args);
|
|
26979
|
+
this.orientation = `horizontal`;
|
|
26980
|
+
this.variant = `titlebar`;
|
|
26981
|
+
this.toggleInteraction = `implicit`;
|
|
26982
|
+
this.allowMultiple = false;
|
|
26983
|
+
this.gap = `var(--space-m)`;
|
|
26984
|
+
}
|
|
26985
|
+
_onPanelToggle(e) {
|
|
26986
|
+
const panel = e.target;
|
|
26987
|
+
if (panel.collapsed) return;
|
|
26988
|
+
if (this.allowMultiple) return;
|
|
26989
|
+
for (const p of this._panels) if (p !== panel) p.collapsed = true;
|
|
26990
|
+
}
|
|
26991
|
+
firstUpdated() {
|
|
26992
|
+
this.updateComplete.then(() => {
|
|
26993
|
+
this._propagateAll();
|
|
26994
|
+
});
|
|
26995
|
+
}
|
|
26996
|
+
updated(changed) {
|
|
26997
|
+
super.updated(changed);
|
|
26998
|
+
if (changed.has(`variant`) || changed.has(`toggleInteraction`) || changed.has(`orientation`)) this.updateComplete.then(() => {
|
|
26999
|
+
this._propagateAll();
|
|
27000
|
+
});
|
|
27001
|
+
}
|
|
27002
|
+
_propagateAll() {
|
|
27003
|
+
const invertedOrientation = this.orientation === `horizontal` ? `vertical` : `horizontal`;
|
|
27004
|
+
for (const panel of this._panels) {
|
|
27005
|
+
panel.setAttribute(`variant`, this.variant);
|
|
27006
|
+
panel.setAttribute(`toggle-interaction`, this.toggleInteraction);
|
|
27007
|
+
panel.setAttribute(`orientation`, invertedOrientation);
|
|
27008
|
+
}
|
|
27009
|
+
}
|
|
27010
|
+
render() {
|
|
27011
|
+
return b`
|
|
27012
|
+
<slot
|
|
27013
|
+
@toggle=${this._onPanelToggle}
|
|
27014
|
+
></slot>
|
|
27015
|
+
`;
|
|
27016
|
+
}
|
|
27017
|
+
static {
|
|
27018
|
+
this.styles = i$6`
|
|
27019
|
+
:host {
|
|
27020
|
+
display: flex;
|
|
27021
|
+
flex-direction: column;
|
|
27022
|
+
gap: var(--group-gap, var(--space-m));
|
|
27023
|
+
}
|
|
27024
|
+
|
|
27025
|
+
:host([orientation="horizontal"]) {
|
|
27026
|
+
flex-direction: row;
|
|
27027
|
+
align-items: flex-start;
|
|
27028
|
+
flex-wrap: wrap;
|
|
27029
|
+
}
|
|
27030
|
+
|
|
27031
|
+
:host([orientation="vertical"]) {
|
|
27032
|
+
flex-direction: column;
|
|
27033
|
+
}
|
|
27034
|
+
|
|
27035
|
+
::slotted(ixfx-panel) {
|
|
27036
|
+
flex-shrink: 1;
|
|
27037
|
+
}
|
|
27038
|
+
|
|
27039
|
+
:host([orientation="horizontal"]) ::slotted(ixfx-panel) {
|
|
27040
|
+
flex-basis: content;
|
|
27041
|
+
min-width: 0;
|
|
27042
|
+
}
|
|
27043
|
+
`;
|
|
27044
|
+
}
|
|
27045
|
+
};
|
|
27046
|
+
__decorate([n$2({
|
|
27047
|
+
type: String,
|
|
27048
|
+
reflect: true
|
|
27049
|
+
})], PanelGroupElement.prototype, "orientation", void 0);
|
|
27050
|
+
__decorate([n$2({ type: String })], PanelGroupElement.prototype, "variant", void 0);
|
|
27051
|
+
__decorate([n$2({
|
|
27052
|
+
type: String,
|
|
27053
|
+
attribute: `toggle-interaction`
|
|
27054
|
+
})], PanelGroupElement.prototype, "toggleInteraction", void 0);
|
|
27055
|
+
__decorate([n$2({
|
|
27056
|
+
type: Boolean,
|
|
27057
|
+
attribute: `allow-multiple`
|
|
27058
|
+
})], PanelGroupElement.prototype, "allowMultiple", void 0);
|
|
27059
|
+
__decorate([n$2()], PanelGroupElement.prototype, "gap", void 0);
|
|
27060
|
+
__decorate([o$2({ slot: `` })], PanelGroupElement.prototype, "_panels", void 0);
|
|
27061
|
+
PanelGroupElement = __decorate([t$4(`ixfx-panel-group`)], PanelGroupElement);
|
|
27062
|
+
//#endregion
|
|
26975
27063
|
//#region src/panel/panel.ts
|
|
26976
27064
|
let PanelElement = class PanelElement extends i$3 {
|
|
26977
27065
|
constructor(..._args) {
|
|
@@ -27373,94 +27461,6 @@ __decorate([n$2({
|
|
|
27373
27461
|
__decorate([r$1()], PanelElement.prototype, "_isVertical", void 0);
|
|
27374
27462
|
PanelElement = __decorate([t$4(`ixfx-panel`)], PanelElement);
|
|
27375
27463
|
//#endregion
|
|
27376
|
-
//#region src/panel/panel-group.ts
|
|
27377
|
-
let PanelGroupElement = class PanelGroupElement extends i$3 {
|
|
27378
|
-
constructor(..._args) {
|
|
27379
|
-
super(..._args);
|
|
27380
|
-
this.orientation = `horizontal`;
|
|
27381
|
-
this.variant = `titlebar`;
|
|
27382
|
-
this.toggleInteraction = `implicit`;
|
|
27383
|
-
this.allowMultiple = false;
|
|
27384
|
-
this.gap = `var(--space-m)`;
|
|
27385
|
-
}
|
|
27386
|
-
_onPanelToggle(e) {
|
|
27387
|
-
const panel = e.target;
|
|
27388
|
-
if (panel.collapsed) return;
|
|
27389
|
-
if (this.allowMultiple) return;
|
|
27390
|
-
for (const p of this._panels) if (p !== panel) p.collapsed = true;
|
|
27391
|
-
}
|
|
27392
|
-
firstUpdated() {
|
|
27393
|
-
this.updateComplete.then(() => {
|
|
27394
|
-
this._propagateAll();
|
|
27395
|
-
});
|
|
27396
|
-
}
|
|
27397
|
-
updated(changed) {
|
|
27398
|
-
super.updated(changed);
|
|
27399
|
-
if (changed.has(`variant`) || changed.has(`toggleInteraction`) || changed.has(`orientation`)) this.updateComplete.then(() => {
|
|
27400
|
-
this._propagateAll();
|
|
27401
|
-
});
|
|
27402
|
-
}
|
|
27403
|
-
_propagateAll() {
|
|
27404
|
-
const invertedOrientation = this.orientation === `horizontal` ? `vertical` : `horizontal`;
|
|
27405
|
-
for (const panel of this._panels) {
|
|
27406
|
-
panel.setAttribute(`variant`, this.variant);
|
|
27407
|
-
panel.setAttribute(`toggle-interaction`, this.toggleInteraction);
|
|
27408
|
-
panel.setAttribute(`orientation`, invertedOrientation);
|
|
27409
|
-
}
|
|
27410
|
-
}
|
|
27411
|
-
render() {
|
|
27412
|
-
return b`
|
|
27413
|
-
<slot
|
|
27414
|
-
@toggle=${this._onPanelToggle}
|
|
27415
|
-
></slot>
|
|
27416
|
-
`;
|
|
27417
|
-
}
|
|
27418
|
-
static {
|
|
27419
|
-
this.styles = i$6`
|
|
27420
|
-
:host {
|
|
27421
|
-
display: flex;
|
|
27422
|
-
flex-direction: column;
|
|
27423
|
-
gap: var(--group-gap, var(--space-m));
|
|
27424
|
-
}
|
|
27425
|
-
|
|
27426
|
-
:host([orientation="horizontal"]) {
|
|
27427
|
-
flex-direction: row;
|
|
27428
|
-
align-items: flex-start;
|
|
27429
|
-
flex-wrap: wrap;
|
|
27430
|
-
}
|
|
27431
|
-
|
|
27432
|
-
:host([orientation="vertical"]) {
|
|
27433
|
-
flex-direction: column;
|
|
27434
|
-
}
|
|
27435
|
-
|
|
27436
|
-
::slotted(ixfx-panel) {
|
|
27437
|
-
flex-shrink: 1;
|
|
27438
|
-
}
|
|
27439
|
-
|
|
27440
|
-
:host([orientation="horizontal"]) ::slotted(ixfx-panel) {
|
|
27441
|
-
flex-basis: content;
|
|
27442
|
-
min-width: 0;
|
|
27443
|
-
}
|
|
27444
|
-
`;
|
|
27445
|
-
}
|
|
27446
|
-
};
|
|
27447
|
-
__decorate([n$2({
|
|
27448
|
-
type: String,
|
|
27449
|
-
reflect: true
|
|
27450
|
-
})], PanelGroupElement.prototype, "orientation", void 0);
|
|
27451
|
-
__decorate([n$2({ type: String })], PanelGroupElement.prototype, "variant", void 0);
|
|
27452
|
-
__decorate([n$2({
|
|
27453
|
-
type: String,
|
|
27454
|
-
attribute: `toggle-interaction`
|
|
27455
|
-
})], PanelGroupElement.prototype, "toggleInteraction", void 0);
|
|
27456
|
-
__decorate([n$2({
|
|
27457
|
-
type: Boolean,
|
|
27458
|
-
attribute: `allow-multiple`
|
|
27459
|
-
})], PanelGroupElement.prototype, "allowMultiple", void 0);
|
|
27460
|
-
__decorate([n$2()], PanelGroupElement.prototype, "gap", void 0);
|
|
27461
|
-
__decorate([o$2({ slot: `` })], PanelGroupElement.prototype, "_panels", void 0);
|
|
27462
|
-
PanelGroupElement = __decorate([t$4(`ixfx-panel-group`)], PanelGroupElement);
|
|
27463
|
-
//#endregion
|
|
27464
27464
|
//#region node_modules/.pnpm/@ixfx+modulation@0.56.12/node_modules/@ixfx/modulation/dist/chunk-pbuEa-1d.js
|
|
27465
27465
|
var __defProp = Object.defineProperty;
|
|
27466
27466
|
var __exportAll = (all, no_symbols) => {
|
|
@@ -31123,13 +31123,13 @@ let SplitLayoutElement = class SplitLayoutElement extends i$3 {
|
|
|
31123
31123
|
return slotA.assignedElements().find((el) => el.tagName === `IXFX-SPLIT-LAYOUT`);
|
|
31124
31124
|
}
|
|
31125
31125
|
#parseSizeAsFraction(size, total) {
|
|
31126
|
-
if (size.endsWith(`px`)) return parseFloat(size.replace(`px`, ``)) / total;
|
|
31127
|
-
else if (size.endsWith(`%`)) return parseFloat(size.replace(`%`, ``)) / 100;
|
|
31126
|
+
if (size.endsWith(`px`)) return Number.parseFloat(size.replace(`px`, ``)) / total;
|
|
31127
|
+
else if (size.endsWith(`%`)) return Number.parseFloat(size.replace(`%`, ``)) / 100;
|
|
31128
31128
|
return .5;
|
|
31129
31129
|
}
|
|
31130
31130
|
#parseSizeToPx(size, total) {
|
|
31131
|
-
if (size.endsWith(`px`)) return parseFloat(size.replace(`px`, ``));
|
|
31132
|
-
else if (size.endsWith(`%`)) return parseFloat(size.replace(`%`, ``)) / 100 * total;
|
|
31131
|
+
if (size.endsWith(`px`)) return Number.parseFloat(size.replace(`px`, ``));
|
|
31132
|
+
else if (size.endsWith(`%`)) return Number.parseFloat(size.replace(`%`, ``)) / 100 * total;
|
|
31133
31133
|
return null;
|
|
31134
31134
|
}
|
|
31135
31135
|
#applyConstraints(sizeA, sizeB, total) {
|
|
@@ -31171,14 +31171,14 @@ let SplitLayoutElement = class SplitLayoutElement extends i$3 {
|
|
|
31171
31171
|
if (minSize.length === 0) return null;
|
|
31172
31172
|
const px = this.#parseSizeToPx(minSize, total);
|
|
31173
31173
|
if (px !== null) return px / total;
|
|
31174
|
-
if (minSize.endsWith(`%`)) return parseFloat(minSize.replace(`%`, ``)) / 100;
|
|
31174
|
+
if (minSize.endsWith(`%`)) return Number.parseFloat(minSize.replace(`%`, ``)) / 100;
|
|
31175
31175
|
return null;
|
|
31176
31176
|
}
|
|
31177
31177
|
#maxSizeToFraction(maxSize, total) {
|
|
31178
31178
|
if (maxSize.length === 0) return null;
|
|
31179
31179
|
const px = this.#parseSizeToPx(maxSize, total);
|
|
31180
31180
|
if (px !== null) return px / total;
|
|
31181
|
-
if (maxSize.endsWith(`%`)) return parseFloat(maxSize.replace(`%`, ``)) / 100;
|
|
31181
|
+
if (maxSize.endsWith(`%`)) return Number.parseFloat(maxSize.replace(`%`, ``)) / 100;
|
|
31182
31182
|
return null;
|
|
31183
31183
|
}
|
|
31184
31184
|
#getIntersectionPoint() {
|