react-science 23.1.0 → 24.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/components/accordion/accordion_context.d.ts +1 -1
- package/lib/components/accordion/accordion_context.js +3 -3
- package/lib/components/accordion/accordion_context.js.map +1 -1
- package/lib/components/accordion/accordion_context_provider.d.ts.map +1 -1
- package/lib/components/accordion/accordion_context_provider.js +3 -3
- package/lib/components/accordion/accordion_context_provider.js.map +1 -1
- package/lib/components/accordion/accordion_hooks.js +3 -3
- package/lib/components/accordion/accordion_hooks.js.map +1 -1
- package/lib/components/button/Button.d.ts.map +1 -1
- package/lib/components/button/Button.js +3 -2
- package/lib/components/button/Button.js.map +1 -1
- package/lib/components/color-picker/react-color/ColorPicker.d.ts +2 -2
- package/lib/components/color-picker/react-color/ColorPicker.d.ts.map +1 -1
- package/lib/components/color-picker/react-color/ColorPicker.js +25 -22
- package/lib/components/color-picker/react-color/ColorPicker.js.map +1 -1
- package/lib/components/color-picker/react-color/common/Alpha.d.ts +1 -2
- package/lib/components/color-picker/react-color/common/Alpha.d.ts.map +1 -1
- package/lib/components/color-picker/react-color/common/Alpha.js +5 -6
- package/lib/components/color-picker/react-color/common/Alpha.js.map +1 -1
- package/lib/components/color-picker/react-color/common/CheckBoard.d.ts +1 -2
- package/lib/components/color-picker/react-color/common/CheckBoard.d.ts.map +1 -1
- package/lib/components/color-picker/react-color/common/CheckBoard.js +2 -3
- package/lib/components/color-picker/react-color/common/CheckBoard.js.map +1 -1
- package/lib/components/color-picker/react-color/common/EditableInput.d.ts.map +1 -1
- package/lib/components/color-picker/react-color/common/EditableInput.js +30 -26
- package/lib/components/color-picker/react-color/common/EditableInput.js.map +1 -1
- package/lib/components/color-picker/react-color/common/Hue.d.ts +1 -2
- package/lib/components/color-picker/react-color/common/Hue.d.ts.map +1 -1
- package/lib/components/color-picker/react-color/common/Hue.js +5 -6
- package/lib/components/color-picker/react-color/common/Hue.js.map +1 -1
- package/lib/components/color-picker/react-color/common/Saturation.d.ts +1 -2
- package/lib/components/color-picker/react-color/common/Saturation.d.ts.map +1 -1
- package/lib/components/color-picker/react-color/common/Saturation.js +6 -7
- package/lib/components/color-picker/react-color/common/Saturation.js.map +1 -1
- package/lib/components/color-picker/react-color/common/Swatch.d.ts.map +1 -1
- package/lib/components/color-picker/react-color/common/Swatch.js +10 -11
- package/lib/components/color-picker/react-color/common/Swatch.js.map +1 -1
- package/lib/components/color-picker/react-color/common/interaction.d.ts +1 -1
- package/lib/components/color-picker/react-color/common/interaction.d.ts.map +1 -1
- package/lib/components/color-picker/react-color/common/interaction.js +9 -9
- package/lib/components/color-picker/react-color/common/interaction.js.map +1 -1
- package/lib/components/color-picker/react-color/common/useOnChange.js +2 -2
- package/lib/components/color-picker/react-color/common/useOnChange.js.map +1 -1
- package/lib/components/color-picker/react-color/helpers/alpha.d.ts +1 -1
- package/lib/components/color-picker/react-color/helpers/alpha.d.ts.map +1 -1
- package/lib/components/color-picker/react-color/helpers/alpha.js +4 -5
- package/lib/components/color-picker/react-color/helpers/alpha.js.map +1 -1
- package/lib/components/color-picker/react-color/helpers/color.d.ts.map +1 -1
- package/lib/components/color-picker/react-color/helpers/color.js +15 -13
- package/lib/components/color-picker/react-color/helpers/color.js.map +1 -1
- package/lib/components/color-picker/react-color/helpers/hue.d.ts +1 -1
- package/lib/components/color-picker/react-color/helpers/hue.d.ts.map +1 -1
- package/lib/components/color-picker/react-color/helpers/hue.js +14 -23
- package/lib/components/color-picker/react-color/helpers/hue.js.map +1 -1
- package/lib/components/color-picker/react-color/helpers/saturation.d.ts +1 -1
- package/lib/components/color-picker/react-color/helpers/saturation.d.ts.map +1 -1
- package/lib/components/color-picker/react-color/helpers/saturation.js +3 -3
- package/lib/components/color-picker/react-color/helpers/saturation.js.map +1 -1
- package/lib/components/color-picker/react-color/sketch/SketchFields.d.ts +1 -1
- package/lib/components/color-picker/react-color/sketch/SketchFields.d.ts.map +1 -1
- package/lib/components/color-picker/react-color/sketch/SketchFields.js +6 -6
- package/lib/components/color-picker/react-color/sketch/SketchFields.js.map +1 -1
- package/lib/components/color-picker/react-color/sketch/SketchPresetColors.js +8 -8
- package/lib/components/color-picker/react-color/sketch/SketchPresetColors.js.map +1 -1
- package/lib/components/dialog/ConfirmDialog.js +2 -2
- package/lib/components/dialog/ConfirmDialog.js.map +1 -1
- package/lib/components/draggable/draggable.d.ts.map +1 -1
- package/lib/components/draggable/draggable.js +10 -9
- package/lib/components/draggable/draggable.js.map +1 -1
- package/lib/components/form/components/field_groups/svg_text_style.d.ts.map +1 -1
- package/lib/components/form/components/field_groups/svg_text_style.js +8 -8
- package/lib/components/form/components/field_groups/svg_text_style.js.map +1 -1
- package/lib/components/form/components/field_groups/svg_text_style.schema.js +1 -1
- package/lib/components/form/components/field_groups/svg_text_style.schema.js.map +1 -1
- package/lib/components/form/components/input/checkbox.js +3 -3
- package/lib/components/form/components/input/checkbox.js.map +1 -1
- package/lib/components/form/components/input/color_picker.js +1 -1
- package/lib/components/form/components/input/color_picker.js.map +1 -1
- package/lib/components/form/components/input/draggable_numeric_input.js +1 -1
- package/lib/components/form/components/input/draggable_numeric_input.js.map +1 -1
- package/lib/components/form/components/input/index.d.ts +1 -0
- package/lib/components/form/components/input/index.d.ts.map +1 -1
- package/lib/components/form/components/input/input.js +1 -1
- package/lib/components/form/components/input/input.js.map +1 -1
- package/lib/components/form/components/input/numeric_input.js +1 -1
- package/lib/components/form/components/input/numeric_input.js.map +1 -1
- package/lib/components/form/components/input/radio_group.js +1 -1
- package/lib/components/form/components/input/radio_group.js.map +1 -1
- package/lib/components/form/components/input/select.js +1 -1
- package/lib/components/form/components/input/select.js.map +1 -1
- package/lib/components/form/components/input/switch.js +1 -1
- package/lib/components/form/components/input/switch.js.map +1 -1
- package/lib/components/form/components/input/textarea.js +1 -1
- package/lib/components/form/components/input/textarea.js.map +1 -1
- package/lib/components/form/components/input_groups/form.js +2 -2
- package/lib/components/form/components/input_groups/form.js.map +1 -1
- package/lib/components/form/components/input_groups/form_context.d.ts +1 -1
- package/lib/components/form/components/input_groups/form_context.js +3 -3
- package/lib/components/form/components/input_groups/form_context.js.map +1 -1
- package/lib/components/form/components/layout/form.d.ts +1 -1
- package/lib/components/form/components/layout/form.d.ts.map +1 -1
- package/lib/components/form/components/layout/form.js +1 -4
- package/lib/components/form/components/layout/form.js.map +1 -1
- package/lib/components/form/utils/validators.d.ts +14 -8
- package/lib/components/form/utils/validators.d.ts.map +1 -1
- package/lib/components/form/utils/validators.js +11 -11
- package/lib/components/form/utils/validators.js.map +1 -1
- package/lib/components/fullscreen/fullscreen_context.d.ts +1 -1
- package/lib/components/fullscreen/fullscreen_context.js +3 -3
- package/lib/components/fullscreen/fullscreen_context.js.map +1 -1
- package/lib/components/fullscreen/fullscreen_context.provider.d.ts +1 -3
- package/lib/components/fullscreen/fullscreen_context.provider.d.ts.map +1 -1
- package/lib/components/fullscreen/fullscreen_context.provider.js +3 -3
- package/lib/components/fullscreen/fullscreen_context.provider.js.map +1 -1
- package/lib/components/hooks/useDoubleClick.js +8 -8
- package/lib/components/hooks/useDoubleClick.js.map +1 -1
- package/lib/components/hooks/useOnClickOutside.js +2 -2
- package/lib/components/hooks/useOnClickOutside.js.map +1 -1
- package/lib/components/hooks/useOnOff.d.ts +1 -1
- package/lib/components/hooks/useOnOff.d.ts.map +1 -1
- package/lib/components/hooks/useOnOff.js +5 -5
- package/lib/components/hooks/useOnOff.js.map +1 -1
- package/lib/components/hooks/useSelect.d.ts.map +1 -1
- package/lib/components/hooks/useSelect.js +4 -3
- package/lib/components/hooks/useSelect.js.map +1 -1
- package/lib/components/hooks/useToggle.d.ts +1 -1
- package/lib/components/hooks/useToggle.d.ts.map +1 -1
- package/lib/components/hooks/useToggle.js +2 -2
- package/lib/components/hooks/useToggle.js.map +1 -1
- package/lib/components/info-panel/InfoPanel.d.ts.map +1 -1
- package/lib/components/info-panel/InfoPanel.js +10 -13
- package/lib/components/info-panel/InfoPanel.js.map +1 -1
- package/lib/components/input/radio-button-group/RadioButtonGroup.d.ts.map +1 -1
- package/lib/components/input/radio-button-group/RadioButtonGroup.js +3 -2
- package/lib/components/input/radio-button-group/RadioButtonGroup.js.map +1 -1
- package/lib/components/logger/FifoLoggerDialog.d.ts.map +1 -1
- package/lib/components/logger/FifoLoggerDialog.js +3 -1
- package/lib/components/logger/FifoLoggerDialog.js.map +1 -1
- package/lib/components/logger/FifoLoggerProvider.d.ts.map +1 -1
- package/lib/components/logger/FifoLoggerProvider.js +2 -2
- package/lib/components/logger/FifoLoggerProvider.js.map +1 -1
- package/lib/components/logger/loggerContext.d.ts +1 -1
- package/lib/components/logger/loggerContext.js +1 -1
- package/lib/components/logger/useFifoLogger.d.ts.map +1 -1
- package/lib/components/logger/useFifoLogger.js +7 -5
- package/lib/components/logger/useFifoLogger.js.map +1 -1
- package/lib/components/root-layout/root_layout.d.ts.map +1 -1
- package/lib/components/root-layout/root_layout.js +5 -3
- package/lib/components/root-layout/root_layout.js.map +1 -1
- package/lib/components/root-layout/root_layout_context.d.ts +1 -1
- package/lib/components/root-layout/root_layout_context.js +3 -3
- package/lib/components/root-layout/root_layout_context.js.map +1 -1
- package/lib/components/root-layout/root_layout_context.provider.js +2 -2
- package/lib/components/root-layout/root_layout_context.provider.js.map +1 -1
- package/lib/components/selected-total/SelectedTotal.js +1 -1
- package/lib/components/selected-total/SelectedTotal.js.map +1 -1
- package/lib/components/split_pane/split_pane.d.ts.map +1 -1
- package/lib/components/split_pane/split_pane.js +14 -18
- package/lib/components/split_pane/split_pane.js.map +1 -1
- package/lib/components/split_pane/split_pane_helpers.js +1 -1
- package/lib/components/split_pane/split_pane_helpers.js.map +1 -1
- package/lib/components/split_pane/use_split_pane_size.d.ts.map +1 -1
- package/lib/components/split_pane/use_split_pane_size.js +4 -3
- package/lib/components/split_pane/use_split_pane_size.js.map +1 -1
- package/lib/components/table/default_table_cell.d.ts.map +1 -1
- package/lib/components/table/default_table_cell.js +6 -14
- package/lib/components/table/default_table_cell.js.map +1 -1
- package/lib/components/table/flash_row/flashed_row_context.d.ts +1 -1
- package/lib/components/table/flash_row/flashed_row_context.js +3 -3
- package/lib/components/table/flash_row/flashed_row_context.js.map +1 -1
- package/lib/components/table/flash_row/flashed_row_provider.d.ts.map +1 -1
- package/lib/components/table/flash_row/flashed_row_provider.js +5 -4
- package/lib/components/table/flash_row/flashed_row_provider.js.map +1 -1
- package/lib/components/table/flash_row/use_flash_row_effect.d.ts.map +1 -1
- package/lib/components/table/flash_row/use_flash_row_effect.js +6 -5
- package/lib/components/table/flash_row/use_flash_row_effect.js.map +1 -1
- package/lib/components/table/preview_table.js +2 -2
- package/lib/components/table/preview_table.js.map +1 -1
- package/lib/components/table/preview_table_context.d.ts +2 -2
- package/lib/components/table/preview_table_context.js +6 -6
- package/lib/components/table/preview_table_context.js.map +1 -1
- package/lib/components/table/reorder_rows/draggable_row_context.d.ts +4 -6
- package/lib/components/table/reorder_rows/draggable_row_context.d.ts.map +1 -1
- package/lib/components/table/reorder_rows/draggable_row_context.js +3 -3
- package/lib/components/table/reorder_rows/draggable_row_context.js.map +1 -1
- package/lib/components/table/reorder_rows/draggable_row_tr.d.ts.map +1 -1
- package/lib/components/table/reorder_rows/draggable_row_tr.js +4 -3
- package/lib/components/table/reorder_rows/draggable_row_tr.js.map +1 -1
- package/lib/components/table/reorder_rows/item_order_context.d.ts +2 -2
- package/lib/components/table/reorder_rows/item_order_context.d.ts.map +1 -1
- package/lib/components/table/reorder_rows/item_order_context.js +3 -3
- package/lib/components/table/reorder_rows/item_order_context.js.map +1 -1
- package/lib/components/table/reorder_rows/item_order_provider.d.ts.map +1 -1
- package/lib/components/table/reorder_rows/item_order_provider.js +2 -2
- package/lib/components/table/reorder_rows/item_order_provider.js.map +1 -1
- package/lib/components/table/reorder_rows/use_drop_monitor.d.ts +2 -2
- package/lib/components/table/reorder_rows/use_drop_monitor.d.ts.map +1 -1
- package/lib/components/table/reorder_rows/use_drop_monitor.js +4 -4
- package/lib/components/table/reorder_rows/use_drop_monitor.js.map +1 -1
- package/lib/components/table/table_body.d.ts.map +1 -1
- package/lib/components/table/table_body.js +10 -6
- package/lib/components/table/table_body.js.map +1 -1
- package/lib/components/table/table_features.js +7 -7
- package/lib/components/table/table_features.js.map +1 -1
- package/lib/components/table/table_header_cell.d.ts +1 -1
- package/lib/components/table/table_header_cell.d.ts.map +1 -1
- package/lib/components/table/table_root.d.ts +2 -2
- package/lib/components/table/table_root.d.ts.map +1 -1
- package/lib/components/table/table_root.js +12 -12
- package/lib/components/table/table_root.js.map +1 -1
- package/lib/components/table/table_utils.d.ts +1 -1
- package/lib/components/table/table_utils.d.ts.map +1 -1
- package/lib/components/table/table_utils.js.map +1 -1
- package/lib/components/table/use_table_columns.d.ts +2 -2
- package/lib/components/table/use_table_columns.d.ts.map +1 -1
- package/lib/components/table/use_table_columns.js +4 -4
- package/lib/components/table/use_table_columns.js.map +1 -1
- package/lib/components/table/use_table_scroll.d.ts.map +1 -1
- package/lib/components/table/use_table_scroll.js +13 -15
- package/lib/components/table/use_table_scroll.js.map +1 -1
- package/lib/components/toolbar/OverflowButton.js +5 -5
- package/lib/components/toolbar/OverflowButton.js.map +1 -1
- package/lib/components/toolbar/Toolbar.d.ts.map +1 -1
- package/lib/components/toolbar/Toolbar.js +5 -8
- package/lib/components/toolbar/Toolbar.js.map +1 -1
- package/lib/components/toolbar/TooltipHelpContent.d.ts.map +1 -1
- package/lib/components/toolbar/TooltipHelpContent.js +5 -2
- package/lib/components/toolbar/TooltipHelpContent.js.map +1 -1
- package/lib/components/toolbar/toolbarContext.d.ts +3 -3
- package/lib/components/toolbar/toolbarContext.d.ts.map +1 -1
- package/lib/components/toolbar/toolbarContext.js +4 -4
- package/lib/components/toolbar/toolbarContext.js.map +1 -1
- package/lib/components/toolbar/useCheckOverflow.d.ts.map +1 -1
- package/lib/components/toolbar/useCheckOverflow.js +1 -0
- package/lib/components/toolbar/useCheckOverflow.js.map +1 -1
- package/lib/components/utils/debounce.d.ts +1 -1
- package/lib/components/utils/debounce.d.ts.map +1 -1
- package/lib/components/utils/debounce.js +3 -3
- package/lib/components/utils/debounce.js.map +1 -1
- package/lib/components/utils/forward_all_props_except.d.ts +2 -0
- package/lib/components/utils/forward_all_props_except.d.ts.map +1 -0
- package/lib/components/utils/{shouldForwardPropExcept.js → forward_all_props_except.js} +2 -2
- package/lib/components/utils/forward_all_props_except.js.map +1 -0
- package/lib/components/utils/svg.d.ts.map +1 -1
- package/lib/components/utils/svg.js +12 -6
- package/lib/components/utils/svg.js.map +1 -1
- package/lib/components/utils/svg_path_builder.d.ts +8 -8
- package/lib/components/utils/svg_path_builder.d.ts.map +1 -1
- package/lib/components/utils/svg_path_builder.js +16 -14
- package/lib/components/utils/svg_path_builder.js.map +1 -1
- package/lib/components/utils/throttle.d.ts +1 -1
- package/lib/components/utils/throttle.d.ts.map +1 -1
- package/lib/components/utils/throttle.js +10 -9
- package/lib/components/utils/throttle.js.map +1 -1
- package/package.json +47 -47
- package/src/components/accordion/accordion_context.ts +3 -3
- package/src/components/accordion/accordion_context_provider.tsx +3 -7
- package/src/components/accordion/accordion_hooks.ts +3 -3
- package/src/components/button/Button.tsx +11 -2
- package/src/components/color-picker/react-color/ColorPicker.tsx +36 -30
- package/src/components/color-picker/react-color/common/Alpha.tsx +5 -7
- package/src/components/color-picker/react-color/common/CheckBoard.tsx +2 -4
- package/src/components/color-picker/react-color/common/EditableInput.tsx +35 -29
- package/src/components/color-picker/react-color/common/Hue.tsx +5 -7
- package/src/components/color-picker/react-color/common/Saturation.tsx +7 -9
- package/src/components/color-picker/react-color/common/Swatch.tsx +18 -9
- package/src/components/color-picker/react-color/common/interaction.tsx +12 -13
- package/src/components/color-picker/react-color/common/useOnChange.tsx +2 -2
- package/src/components/color-picker/react-color/helpers/alpha.ts +6 -5
- package/src/components/color-picker/react-color/helpers/color.ts +16 -13
- package/src/components/color-picker/react-color/helpers/hue.ts +16 -25
- package/src/components/color-picker/react-color/helpers/saturation.ts +5 -3
- package/src/components/color-picker/react-color/sketch/SketchFields.tsx +8 -8
- package/src/components/color-picker/react-color/sketch/SketchPresetColors.tsx +9 -9
- package/src/components/dialog/ConfirmDialog.tsx +2 -2
- package/src/components/draggable/draggable.tsx +20 -18
- package/src/components/form/components/field_groups/svg_text_style.schema.ts +1 -1
- package/src/components/form/components/field_groups/svg_text_style.tsx +17 -15
- package/src/components/form/components/input/checkbox.tsx +3 -3
- package/src/components/form/components/input/color_picker.tsx +1 -1
- package/src/components/form/components/input/draggable_numeric_input.tsx +1 -1
- package/src/components/form/components/input/index.ts +1 -0
- package/src/components/form/components/input/input.tsx +1 -1
- package/src/components/form/components/input/numeric_input.tsx +1 -1
- package/src/components/form/components/input/radio_group.tsx +1 -1
- package/src/components/form/components/input/select.tsx +1 -1
- package/src/components/form/components/input/switch.tsx +1 -1
- package/src/components/form/components/input/textarea.tsx +1 -1
- package/src/components/form/components/input_groups/form.tsx +3 -3
- package/src/components/form/components/input_groups/form_context.ts +3 -3
- package/src/components/form/components/layout/form.tsx +4 -6
- package/src/components/form/utils/validators.ts +29 -23
- package/src/components/fullscreen/fullscreen_context.provider.tsx +4 -9
- package/src/components/fullscreen/fullscreen_context.ts +3 -3
- package/src/components/hooks/useDoubleClick.ts +8 -8
- package/src/components/hooks/useOnClickOutside.ts +2 -2
- package/src/components/hooks/useOnOff.ts +5 -5
- package/src/components/hooks/useSelect.tsx +5 -3
- package/src/components/hooks/useToggle.ts +2 -2
- package/src/components/info-panel/InfoPanel.tsx +12 -16
- package/src/components/input/radio-button-group/RadioButtonGroup.tsx +5 -2
- package/src/components/logger/FifoLoggerDialog.tsx +1 -0
- package/src/components/logger/FifoLoggerProvider.tsx +2 -4
- package/src/components/logger/loggerContext.ts +1 -1
- package/src/components/logger/useFifoLogger.ts +7 -5
- package/src/components/root-layout/root_layout.tsx +6 -3
- package/src/components/root-layout/root_layout_context.provider.tsx +3 -3
- package/src/components/root-layout/root_layout_context.ts +3 -3
- package/src/components/selected-total/SelectedTotal.tsx +1 -1
- package/src/components/split_pane/split_pane.tsx +17 -20
- package/src/components/split_pane/split_pane_helpers.ts +1 -1
- package/src/components/split_pane/use_split_pane_size.tsx +4 -3
- package/src/components/table/default_table_cell.tsx +10 -11
- package/src/components/table/flash_row/flashed_row_context.ts +3 -3
- package/src/components/table/flash_row/flashed_row_provider.tsx +8 -6
- package/src/components/table/flash_row/use_flash_row_effect.ts +7 -5
- package/src/components/table/preview_table.tsx +3 -3
- package/src/components/table/preview_table_context.ts +6 -6
- package/src/components/table/reorder_rows/draggable_row_context.ts +6 -10
- package/src/components/table/reorder_rows/draggable_row_tr.tsx +11 -6
- package/src/components/table/reorder_rows/item_order_context.ts +4 -4
- package/src/components/table/reorder_rows/item_order_provider.tsx +2 -6
- package/src/components/table/reorder_rows/use_drop_monitor.ts +4 -4
- package/src/components/table/table_body.tsx +19 -5
- package/src/components/table/table_features.ts +12 -12
- package/src/components/table/table_root.tsx +20 -18
- package/src/components/table/table_utils.ts +4 -5
- package/src/components/table/use_table_columns.ts +7 -7
- package/src/components/table/use_table_scroll.ts +18 -21
- package/src/components/toolbar/OverflowButton.tsx +5 -5
- package/src/components/toolbar/Toolbar.tsx +8 -20
- package/src/components/toolbar/TooltipHelpContent.tsx +10 -5
- package/src/components/toolbar/toolbarContext.ts +5 -7
- package/src/components/toolbar/useCheckOverflow.tsx +1 -0
- package/src/components/utils/debounce.ts +5 -5
- package/src/components/utils/{shouldForwardPropExcept.ts → forward_all_props_except.ts} +1 -1
- package/src/components/utils/svg.ts +5 -2
- package/src/components/utils/svg_path_builder.ts +22 -19
- package/src/components/utils/throttle.ts +13 -11
- package/lib/components/utils/shouldForwardPropExcept.d.ts +0 -2
- package/lib/components/utils/shouldForwardPropExcept.d.ts.map +0 -1
- package/lib/components/utils/shouldForwardPropExcept.js.map +0 -1
|
@@ -8,7 +8,11 @@ import { assert } from '@zakodium/utils';
|
|
|
8
8
|
* @return The outerHTML of the SVG element.
|
|
9
9
|
*/
|
|
10
10
|
export function exportSVG(base, options = {}) {
|
|
11
|
-
const {
|
|
11
|
+
const {
|
|
12
|
+
// eslint-disable-next-line unicorn/no-non-function-verb-prefix
|
|
13
|
+
removeFromSelector,
|
|
14
|
+
// eslint-disable-next-line unicorn/no-non-function-verb-prefix
|
|
15
|
+
addBackground = false, backgroundColor = 'white', customMutations, } = options;
|
|
12
16
|
const svg = base.cloneNode(true);
|
|
13
17
|
// cleanup svg
|
|
14
18
|
if (removeFromSelector) {
|
|
@@ -18,10 +22,7 @@ export function exportSVG(base, options = {}) {
|
|
|
18
22
|
}
|
|
19
23
|
}
|
|
20
24
|
if (addBackground) {
|
|
21
|
-
const background = document.createElementNS(
|
|
22
|
-
// XML namespaces are immutable. This false-positive is fixed in eslint-plugin-unicorn v66.
|
|
23
|
-
// eslint-disable-next-line unicorn/prefer-https
|
|
24
|
-
'http://www.w3.org/2000/svg', 'rect');
|
|
25
|
+
const background = document.createElementNS('http://www.w3.org/2000/svg', 'rect');
|
|
25
26
|
background.setAttribute('x', '0');
|
|
26
27
|
background.setAttribute('y', '0');
|
|
27
28
|
background.setAttribute('width', '100%');
|
|
@@ -39,7 +40,11 @@ export function exportSVG(base, options = {}) {
|
|
|
39
40
|
* @param options
|
|
40
41
|
*/
|
|
41
42
|
export async function exportSVGAsPNG(base, options = {}) {
|
|
42
|
-
const {
|
|
43
|
+
const {
|
|
44
|
+
// eslint-disable-next-line unicorn/no-non-function-verb-prefix
|
|
45
|
+
removeFromSelector,
|
|
46
|
+
// eslint-disable-next-line unicorn/no-non-function-verb-prefix
|
|
47
|
+
addBackground = false, backgroundColor = 'white', customMutations, } = options;
|
|
43
48
|
const svg = exportSVG(base, {
|
|
44
49
|
removeFromSelector,
|
|
45
50
|
addBackground: false,
|
|
@@ -48,6 +53,7 @@ export async function exportSVGAsPNG(base, options = {}) {
|
|
|
48
53
|
const svgBlob = new Blob([svg], { type: 'image/svg+xml' });
|
|
49
54
|
const img = new Image();
|
|
50
55
|
img.src = URL.createObjectURL(svgBlob);
|
|
56
|
+
// eslint-disable-next-line unicorn/prefer-await
|
|
51
57
|
await img.decode().finally(() => URL.revokeObjectURL(img.src));
|
|
52
58
|
const canvas = new OffscreenCanvas(img.naturalWidth, img.naturalHeight);
|
|
53
59
|
const ctx = canvas.getContext('2d');
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"svg.js","sourceRoot":"","sources":["../../../src/components/utils/svg.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,iBAAiB,CAAC;AA+BzC;;;;;;;GAOG;AACH,MAAM,UAAU,SAAS,CACvB,IAAmB,EACnB,UAA4B,EAAE;IAE9B,MAAM,
|
|
1
|
+
{"version":3,"file":"svg.js","sourceRoot":"","sources":["../../../src/components/utils/svg.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,iBAAiB,CAAC;AA+BzC;;;;;;;GAOG;AACH,MAAM,UAAU,SAAS,CACvB,IAAmB,EACnB,UAA4B,EAAE;IAE9B,MAAM;IACJ,+DAA+D;IAC/D,kBAAkB;IAClB,+DAA+D;IAC/D,aAAa,GAAG,KAAK,EACrB,eAAe,GAAG,OAAO,EACzB,eAAe,GAChB,GAAG,OAAO,CAAC;IAEZ,MAAM,GAAG,GAAG,IAAI,CAAC,SAAS,CAAC,IAAI,CAAkB,CAAC;IAElD,cAAc;IACd,IAAI,kBAAkB,EAAE,CAAC;QACvB,MAAM,KAAK,GAAG,GAAG,CAAC,gBAAgB,CAAC,kBAAkB,CAAC,CAAC;QACvD,KAAK,MAAM,IAAI,IAAI,KAAK,EAAE,CAAC;YACzB,IAAI,CAAC,MAAM,EAAE,CAAC;QAChB,CAAC;IACH,CAAC;IAED,IAAI,aAAa,EAAE,CAAC;QAClB,MAAM,UAAU,GAAG,QAAQ,CAAC,eAAe,CACzC,4BAA4B,EAC5B,MAAM,CACP,CAAC;QACF,UAAU,CAAC,YAAY,CAAC,GAAG,EAAE,GAAG,CAAC,CAAC;QAClC,UAAU,CAAC,YAAY,CAAC,GAAG,EAAE,GAAG,CAAC,CAAC;QAClC,UAAU,CAAC,YAAY,CAAC,OAAO,EAAE,MAAM,CAAC,CAAC;QACzC,UAAU,CAAC,YAAY,CAAC,QAAQ,EAAE,MAAM,CAAC,CAAC;QAC1C,UAAU,CAAC,YAAY,CAAC,MAAM,EAAE,eAAe,CAAC,CAAC;QACjD,GAAG,CAAC,OAAO,CAAC,UAAU,CAAC,CAAC;IAC1B,CAAC;IAED,eAAe,EAAE,CAAC,GAAG,CAAC,CAAC;IAEvB,OAAO,GAAG,CAAC,SAAS,CAAC;AACvB,CAAC;AAED;;;;;GAKG;AACH,MAAM,CAAC,KAAK,UAAU,cAAc,CAClC,IAAmB,EACnB,UAA4B,EAAE;IAE9B,MAAM;IACJ,+DAA+D;IAC/D,kBAAkB;IAClB,+DAA+D;IAC/D,aAAa,GAAG,KAAK,EACrB,eAAe,GAAG,OAAO,EACzB,eAAe,GAChB,GAAG,OAAO,CAAC;IAEZ,MAAM,GAAG,GAAG,SAAS,CAAC,IAAI,EAAE;QAC1B,kBAAkB;QAClB,aAAa,EAAE,KAAK;QACpB,eAAe;KAChB,CAAC,CAAC;IACH,MAAM,OAAO,GAAG,IAAI,IAAI,CAAC,CAAC,GAAG,CAAC,EAAE,EAAE,IAAI,EAAE,eAAe,EAAE,CAAC,CAAC;IAE3D,MAAM,GAAG,GAAG,IAAI,KAAK,EAAE,CAAC;IACxB,GAAG,CAAC,GAAG,GAAG,GAAG,CAAC,eAAe,CAAC,OAAO,CAAC,CAAC;IACvC,gDAAgD;IAChD,MAAM,GAAG,CAAC,MAAM,EAAE,CAAC,OAAO,CAAC,GAAG,EAAE,CAAC,GAAG,CAAC,eAAe,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC,CAAC;IAE/D,MAAM,MAAM,GAAG,IAAI,eAAe,CAAC,GAAG,CAAC,YAAY,EAAE,GAAG,CAAC,aAAa,CAAC,CAAC;IACxE,MAAM,GAAG,GAAG,MAAM,CAAC,UAAU,CAAC,IAAI,CAAC,CAAC;IACpC,MAAM,CAAC,GAAG,CAAC,CAAC;IAEZ,IAAI,aAAa,EAAE,CAAC;QAClB,GAAG,CAAC,SAAS,GAAG,eAAe,CAAC;QAChC,GAAG,CAAC,QAAQ,CAAC,CAAC,EAAE,CAAC,EAAE,MAAM,CAAC,KAAK,EAAE,MAAM,CAAC,MAAM,CAAC,CAAC;IAClD,CAAC;IAED,GAAG,CAAC,SAAS,CAAC,GAAG,EAAE,CAAC,EAAE,CAAC,CAAC,CAAC;IAEzB,MAAM,GAAG,GAAG,MAAM,MAAM,CAAC,aAAa,CAAC,EAAE,IAAI,EAAE,WAAW,EAAE,CAAC,CAAC;IAC9D,OAAO,GAAG,CAAC;AACb,CAAC"}
|
|
@@ -14,6 +14,12 @@
|
|
|
14
14
|
*/
|
|
15
15
|
export declare class SVGPathBuilder {
|
|
16
16
|
#private;
|
|
17
|
+
/**
|
|
18
|
+
* Merge many path builders into a new single one.
|
|
19
|
+
*
|
|
20
|
+
* @param builders
|
|
21
|
+
*/
|
|
22
|
+
static concat(...builders: SVGPathBuilder[]): SVGPathBuilder;
|
|
17
23
|
clampValue: number | null;
|
|
18
24
|
/**
|
|
19
25
|
* @param clampValue - All `x` and `y` values passed to moveTo and lineTo commands
|
|
@@ -26,9 +32,9 @@ export declare class SVGPathBuilder {
|
|
|
26
32
|
/**
|
|
27
33
|
* Get a shallow copy of internal the buffer.
|
|
28
34
|
*
|
|
29
|
-
* @param
|
|
35
|
+
* @param sliceArguments
|
|
30
36
|
*/
|
|
31
|
-
getBufferSlice(...
|
|
37
|
+
getBufferSlice(...sliceArguments: [start?: number, end?: number]): string[];
|
|
32
38
|
/**
|
|
33
39
|
* Absolute move to
|
|
34
40
|
*
|
|
@@ -57,11 +63,5 @@ export declare class SVGPathBuilder {
|
|
|
57
63
|
* @param separator - default value is debug friendly (new-line + two spaces).
|
|
58
64
|
*/
|
|
59
65
|
toString(separator?: string): string;
|
|
60
|
-
/**
|
|
61
|
-
* Merge many path builders into a new single one.
|
|
62
|
-
*
|
|
63
|
-
* @param builders
|
|
64
|
-
*/
|
|
65
|
-
static concat(...builders: SVGPathBuilder[]): SVGPathBuilder;
|
|
66
66
|
}
|
|
67
67
|
//# sourceMappingURL=svg_path_builder.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"svg_path_builder.d.ts","sourceRoot":"","sources":["../../../src/components/utils/svg_path_builder.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"svg_path_builder.d.ts","sourceRoot":"","sources":["../../../src/components/utils/svg_path_builder.ts"],"names":[],"mappings":"AAMA;;;;;;;;;;;;;GAaG;AACH,qBAAa,cAAc;;IACzB;;;;OAIG;IACH,MAAM,CAAC,MAAM,CAAC,GAAG,QAAQ,EAAE,cAAc,EAAE,GAAG,cAAc;IAY5D,UAAU,EAAE,MAAM,GAAG,IAAI,CAAC;IAE1B;;;;;;OAMG;gBACS,UAAU,GAAE,MAAM,GAAG,IAA0B;IAqB3D;;;;OAIG;IACH,cAAc,CAAC,GAAG,cAAc,EAAE,CAAC,KAAK,CAAC,EAAE,MAAM,EAAE,GAAG,CAAC,EAAE,MAAM,CAAC;IAIhE;;;;;;OAMG;IACH,MAAM,CAAC,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,MAAM,GAAG,IAAI;IAQlC;;;;;;OAMG;IACH,MAAM,CAAC,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,MAAM,GAAG,IAAI;IAQlC;;;;OAIG;IACH,SAAS,IAAI,IAAI;IAOjB;;;;OAIG;IACH,QAAQ,CAAC,SAAS,SAAoB,GAAG,MAAM;CAGhD"}
|
|
@@ -1,4 +1,6 @@
|
|
|
1
|
-
/**
|
|
1
|
+
/**
|
|
2
|
+
* Better dom readability.
|
|
3
|
+
*/
|
|
2
4
|
const DEFAULT_SEPARATOR = '\n ';
|
|
3
5
|
const DEFAULT_CLAMP_VALUE = 1e5;
|
|
4
6
|
/**
|
|
@@ -16,6 +18,16 @@ const DEFAULT_CLAMP_VALUE = 1e5;
|
|
|
16
18
|
* @see https://developer.mozilla.org/en-US/docs/Web/SVG/Reference/Attribute/d
|
|
17
19
|
*/
|
|
18
20
|
export class SVGPathBuilder {
|
|
21
|
+
/**
|
|
22
|
+
* Merge many path builders into a new single one.
|
|
23
|
+
*
|
|
24
|
+
* @param builders
|
|
25
|
+
*/
|
|
26
|
+
static concat(...builders) {
|
|
27
|
+
const builder = new SVGPathBuilder();
|
|
28
|
+
builder.#buffer = builder.#buffer.concat(builders.flatMap((path) => path.getBufferSlice()));
|
|
29
|
+
return builder;
|
|
30
|
+
}
|
|
19
31
|
#buffer = [];
|
|
20
32
|
clampValue;
|
|
21
33
|
/**
|
|
@@ -49,10 +61,10 @@ export class SVGPathBuilder {
|
|
|
49
61
|
/**
|
|
50
62
|
* Get a shallow copy of internal the buffer.
|
|
51
63
|
*
|
|
52
|
-
* @param
|
|
64
|
+
* @param sliceArguments
|
|
53
65
|
*/
|
|
54
|
-
getBufferSlice(...
|
|
55
|
-
return this.#buffer.slice(...
|
|
66
|
+
getBufferSlice(...sliceArguments) {
|
|
67
|
+
return this.#buffer.slice(...sliceArguments);
|
|
56
68
|
}
|
|
57
69
|
/**
|
|
58
70
|
* Absolute move to
|
|
@@ -99,15 +111,5 @@ export class SVGPathBuilder {
|
|
|
99
111
|
toString(separator = DEFAULT_SEPARATOR) {
|
|
100
112
|
return this.#buffer.join(separator);
|
|
101
113
|
}
|
|
102
|
-
/**
|
|
103
|
-
* Merge many path builders into a new single one.
|
|
104
|
-
*
|
|
105
|
-
* @param builders
|
|
106
|
-
*/
|
|
107
|
-
static concat(...builders) {
|
|
108
|
-
const builder = new SVGPathBuilder();
|
|
109
|
-
builder.#buffer = builder.#buffer.concat(builders.flatMap((path) => path.getBufferSlice()));
|
|
110
|
-
return builder;
|
|
111
|
-
}
|
|
112
114
|
}
|
|
113
115
|
//# sourceMappingURL=svg_path_builder.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"svg_path_builder.js","sourceRoot":"","sources":["../../../src/components/utils/svg_path_builder.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"svg_path_builder.js","sourceRoot":"","sources":["../../../src/components/utils/svg_path_builder.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,MAAM,iBAAiB,GAAG,MAAM,CAAC;AACjC,MAAM,mBAAmB,GAAG,GAAG,CAAC;AAEhC;;;;;;;;;;;;;GAaG;AACH,MAAM,OAAO,cAAc;IACzB;;;;OAIG;IACH,MAAM,CAAC,MAAM,CAAC,GAAG,QAA0B;QACzC,MAAM,OAAO,GAAG,IAAI,cAAc,EAAE,CAAC;QAErC,OAAO,CAAC,OAAO,GAAG,OAAO,CAAC,OAAO,CAAC,MAAM,CACtC,QAAQ,CAAC,OAAO,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,CAAC,cAAc,EAAE,CAAC,CAClD,CAAC;QAEF,OAAO,OAAO,CAAC;IACjB,CAAC;IAED,OAAO,GAAa,EAAE,CAAC;IAEvB,UAAU,CAAgB;IAE1B;;;;;;OAMG;IACH,YAAY,aAA4B,mBAAmB;QACzD,IAAI,CAAC,UAAU,GAAG,UAAU,CAAC;IAC/B,CAAC;IAED,WAAW,CAAC,OAAe;QACzB,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;IAC7B,CAAC;IAED;;;;OAIG;IACH,MAAM,CAAC,KAAa;QAClB,MAAM,EAAE,GAAG,IAAI,CAAC,UAAU,CAAC;QAC3B,IAAI,EAAE,KAAK,IAAI;YAAE,OAAO,KAAK,CAAC;QAC9B,IAAI,KAAK,GAAG,CAAC,EAAE;YAAE,OAAO,CAAC,EAAE,CAAC;QAC5B,IAAI,KAAK,GAAG,EAAE;YAAE,OAAO,EAAE,CAAC;QAC1B,OAAO,KAAK,CAAC;IACf,CAAC;IAED;;;;OAIG;IACH,cAAc,CAAC,GAAG,cAA8C;QAC9D,OAAO,IAAI,CAAC,OAAO,CAAC,KAAK,CAAC,GAAG,cAAc,CAAC,CAAC;IAC/C,CAAC;IAED;;;;;;OAMG;IACH,MAAM,CAAC,CAAS,EAAE,CAAS;QACzB,CAAC,GAAG,IAAI,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC;QACnB,CAAC,GAAG,IAAI,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC;QACnB,IAAI,CAAC,WAAW,CAAC,KAAK,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;QAEhC,OAAO,IAAI,CAAC;IACd,CAAC;IAED;;;;;;OAMG;IACH,MAAM,CAAC,CAAS,EAAE,CAAS;QACzB,CAAC,GAAG,IAAI,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC;QACnB,CAAC,GAAG,IAAI,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC;QACnB,IAAI,CAAC,WAAW,CAAC,KAAK,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;QAEhC,OAAO,IAAI,CAAC;IACd,CAAC;IAED;;;;OAIG;IACH,SAAS;QACP,IAAI,IAAI,CAAC,OAAO,CAAC,MAAM,KAAK,CAAC;YAAE,OAAO,IAAI,CAAC;QAC3C,IAAI,CAAC,WAAW,CAAC,GAAG,CAAC,CAAC;QAEtB,OAAO,IAAI,CAAC;IACd,CAAC;IAED;;;;OAIG;IACH,QAAQ,CAAC,SAAS,GAAG,iBAAiB;QACpC,OAAO,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC;IACtC,CAAC;CACF"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export declare function throttle<T extends (...
|
|
1
|
+
export declare function throttle<T extends (...arguments_: any[]) => void>(function_: T, limit: number): T;
|
|
2
2
|
//# sourceMappingURL=throttle.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"throttle.d.ts","sourceRoot":"","sources":["../../../src/components/utils/throttle.ts"],"names":[],"mappings":"AAAA,wBAAgB,QAAQ,CAAC,CAAC,SAAS,CAAC,GAAG,
|
|
1
|
+
{"version":3,"file":"throttle.d.ts","sourceRoot":"","sources":["../../../src/components/utils/throttle.ts"],"names":[],"mappings":"AAAA,wBAAgB,QAAQ,CAAC,CAAC,SAAS,CAAC,GAAG,UAAU,EAAE,GAAG,EAAE,KAAK,IAAI,EAC/D,SAAS,EAAE,CAAC,EACZ,KAAK,EAAE,MAAM,GACZ,CAAC,CAiBH"}
|
|
@@ -1,13 +1,14 @@
|
|
|
1
|
-
export function throttle(
|
|
2
|
-
let
|
|
3
|
-
const fun = (...
|
|
4
|
-
if (
|
|
5
|
-
|
|
6
|
-
inThrottle = true;
|
|
7
|
-
setTimeout(() => {
|
|
8
|
-
inThrottle = false;
|
|
9
|
-
}, limit);
|
|
1
|
+
export function throttle(function_, limit) {
|
|
2
|
+
let isInThrottle;
|
|
3
|
+
const fun = (...arguments_) => {
|
|
4
|
+
if (isInThrottle) {
|
|
5
|
+
return;
|
|
10
6
|
}
|
|
7
|
+
function_.apply({}, arguments_);
|
|
8
|
+
isInThrottle = true;
|
|
9
|
+
setTimeout(() => {
|
|
10
|
+
isInThrottle = false;
|
|
11
|
+
}, limit);
|
|
11
12
|
};
|
|
12
13
|
return fun;
|
|
13
14
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"throttle.js","sourceRoot":"","sources":["../../../src/components/utils/throttle.ts"],"names":[],"mappings":"AAAA,MAAM,UAAU,QAAQ,CACtB,
|
|
1
|
+
{"version":3,"file":"throttle.js","sourceRoot":"","sources":["../../../src/components/utils/throttle.ts"],"names":[],"mappings":"AAAA,MAAM,UAAU,QAAQ,CACtB,SAAY,EACZ,KAAa;IAEb,IAAI,YAAqB,CAAC;IAE1B,MAAM,GAAG,GAAG,CAAC,GAAG,UAAiB,EAAE,EAAE;QACnC,IAAI,YAAY,EAAE,CAAC;YACjB,OAAO;QACT,CAAC;QAED,SAAS,CAAC,KAAK,CAAC,EAAE,EAAE,UAAU,CAAC,CAAC;QAChC,YAAY,GAAG,IAAI,CAAC;QAEpB,UAAU,CAAC,GAAG,EAAE;YACd,YAAY,GAAG,KAAK,CAAC;QACvB,CAAC,EAAE,KAAK,CAAC,CAAC;IACZ,CAAC,CAAC;IAEF,OAAO,GAAQ,CAAC;AAClB,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "react-science",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "24.0.0",
|
|
4
4
|
"description": "React components to build scientific applications UI",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"exports": {
|
|
@@ -23,7 +23,7 @@
|
|
|
23
23
|
"createData": "npm run prepack && node scripts/createData",
|
|
24
24
|
"dev": "echo Use npm run dev-app or npm run storybook && exit 1",
|
|
25
25
|
"dev-app": "vite --open /pages/demo.html",
|
|
26
|
-
"eslint": "eslint . --cache --max-warnings=
|
|
26
|
+
"eslint": "eslint . --cache --max-warnings=51",
|
|
27
27
|
"eslint-fix": "npm run eslint -- --fix",
|
|
28
28
|
"playwright": "npm run playwright-ct -- --project chromium && npm run playwright-e2e -- --project chromium",
|
|
29
29
|
"playwright-ct": "playwright test -c playwright-ct.config.mts",
|
|
@@ -48,87 +48,87 @@
|
|
|
48
48
|
},
|
|
49
49
|
"homepage": "https://github.com/zakodium-oss/react-science#readme",
|
|
50
50
|
"peerDependencies": {
|
|
51
|
-
"@blueprintjs/core": "^6.
|
|
52
|
-
"@blueprintjs/icons": "^6.
|
|
53
|
-
"@blueprintjs/select": "^6.3.
|
|
51
|
+
"@blueprintjs/core": "^6.20.0",
|
|
52
|
+
"@blueprintjs/icons": "^6.14.1",
|
|
53
|
+
"@blueprintjs/select": "^6.3.6",
|
|
54
54
|
"fifo-logger": "^2.0.1",
|
|
55
|
-
"react": "^
|
|
56
|
-
"react-dom": "^
|
|
55
|
+
"react": "^19.3.0",
|
|
56
|
+
"react-dom": "^19.3.0"
|
|
57
57
|
},
|
|
58
58
|
"dependencies": {
|
|
59
59
|
"@emotion/styled": "^11.14.1",
|
|
60
60
|
"@radix-ui/react-use-controllable-state": "^1.2.6",
|
|
61
|
-
"@tanstack/react-form": "^1.33.
|
|
61
|
+
"@tanstack/react-form": "^1.33.5",
|
|
62
62
|
"@tanstack/react-store": "^0.11.1",
|
|
63
|
-
"@tanstack/react-table": "^9.
|
|
64
|
-
"@tanstack/react-virtual": "^3.14.
|
|
65
|
-
"@zakodium/pdnd-esm": "^1.1.
|
|
63
|
+
"@tanstack/react-table": "^9.2.4",
|
|
64
|
+
"@tanstack/react-virtual": "^3.14.13",
|
|
65
|
+
"@zakodium/pdnd-esm": "^1.1.2",
|
|
66
66
|
"@zakodium/utils": "^0.5.1",
|
|
67
67
|
"d3-scale-chromatic": "^3.1.0",
|
|
68
68
|
"react-d3-utils": "^3.1.2",
|
|
69
|
-
"react-dropzone": "^20.1.
|
|
69
|
+
"react-dropzone": "^20.1.2",
|
|
70
70
|
"react-full-screen": "^1.1.1",
|
|
71
71
|
"react-icons": "^5.7.0",
|
|
72
72
|
"react-inspector": "^9.0.0",
|
|
73
73
|
"tinycolor2": "^1.6.0",
|
|
74
74
|
"ts-pattern": "^5.9.0",
|
|
75
|
-
"zod": "^4.
|
|
75
|
+
"zod": "^4.6.5"
|
|
76
76
|
},
|
|
77
77
|
"devDependencies": {
|
|
78
|
-
"@blueprintjs/core": "6.
|
|
79
|
-
"@blueprintjs/icons": "6.
|
|
80
|
-
"@blueprintjs/select": "6.3.
|
|
78
|
+
"@blueprintjs/core": "6.20.0",
|
|
79
|
+
"@blueprintjs/icons": "6.14.1",
|
|
80
|
+
"@blueprintjs/select": "6.3.6",
|
|
81
81
|
"@floating-ui/react": "^0.27.20",
|
|
82
|
-
"@playwright/experimental-ct-react": "
|
|
83
|
-
"@playwright/test": "
|
|
84
|
-
"@storybook/addon-docs": "^10.
|
|
85
|
-
"@storybook/react-vite": "^10.
|
|
86
|
-
"@tanstack/react-query": "^5.
|
|
82
|
+
"@playwright/experimental-ct-react": "1.62.1",
|
|
83
|
+
"@playwright/test": "1.62.1",
|
|
84
|
+
"@storybook/addon-docs": "^10.6.0",
|
|
85
|
+
"@storybook/react-vite": "^10.6.0",
|
|
86
|
+
"@tanstack/react-query": "^5.103.2",
|
|
87
87
|
"@types/babel__core": "^7.20.5",
|
|
88
88
|
"@types/d3-scale-chromatic": "^3.1.0",
|
|
89
|
-
"@types/node": "^26.2
|
|
90
|
-
"@types/react": "^
|
|
91
|
-
"@types/react-dom": "^
|
|
89
|
+
"@types/node": "^26.6.2",
|
|
90
|
+
"@types/react": "^19.3.0",
|
|
91
|
+
"@types/react-dom": "^19.3.0",
|
|
92
92
|
"@types/tinycolor2": "^1.4.6",
|
|
93
|
-
"@vitejs/plugin-react": "^6.
|
|
94
|
-
"@vitest/coverage-v8": "^
|
|
93
|
+
"@vitejs/plugin-react": "^6.1.1",
|
|
94
|
+
"@vitest/coverage-v8": "^5.0.1",
|
|
95
95
|
"@zakodium/tsconfig": "^1.0.5",
|
|
96
96
|
"biologic-converter": "^1.0.0",
|
|
97
|
-
"cheminfo-font": "^1.
|
|
98
|
-
"cheminfo-types": "^1.
|
|
97
|
+
"cheminfo-font": "^1.28.0",
|
|
98
|
+
"cheminfo-types": "^1.16.0",
|
|
99
99
|
"cross-env": "^10.1.0",
|
|
100
|
-
"eslint": "^
|
|
101
|
-
"eslint-config-zakodium": "^
|
|
102
|
-
"eslint-plugin-storybook": "^10.
|
|
100
|
+
"eslint": "^10.11.0",
|
|
101
|
+
"eslint-config-zakodium": "^21.0.0",
|
|
102
|
+
"eslint-plugin-storybook": "^10.6.0",
|
|
103
103
|
"fifo-logger": "2.0.1",
|
|
104
104
|
"filelist-utils": "^1.11.3",
|
|
105
|
-
"immer": "^11.1.
|
|
106
|
-
"jcampconverter": "^12.5.
|
|
107
|
-
"ml-gsd": "^14.
|
|
108
|
-
"ml-peak-shape-generator": "^5.
|
|
105
|
+
"immer": "^11.1.18",
|
|
106
|
+
"jcampconverter": "^12.5.7",
|
|
107
|
+
"ml-gsd": "^14.3.0",
|
|
108
|
+
"ml-peak-shape-generator": "^5.6.0",
|
|
109
109
|
"ml-signal-processing": "^2.2.2",
|
|
110
|
-
"ml-spectra-processing": "^14.
|
|
111
|
-
"ms-spectrum": "^3.12.
|
|
110
|
+
"ml-spectra-processing": "^14.35.1",
|
|
111
|
+
"ms-spectrum": "^3.12.1",
|
|
112
112
|
"netcdfjs": "^4.0.0",
|
|
113
113
|
"postcss-styled-syntax": "^0.7.2",
|
|
114
|
-
"prettier": "^3.9.
|
|
115
|
-
"react": "
|
|
116
|
-
"react-dom": "
|
|
117
|
-
"react-error-boundary": "^6.1.
|
|
114
|
+
"prettier": "^3.9.9",
|
|
115
|
+
"react": "19.3.0",
|
|
116
|
+
"react-dom": "19.3.0",
|
|
117
|
+
"react-error-boundary": "^6.1.6",
|
|
118
118
|
"react-kbs": "^3.1.0",
|
|
119
119
|
"react-ocl": "^8.7.2",
|
|
120
120
|
"react-plot": "^3.1.2",
|
|
121
121
|
"rimraf": "^6.1.3",
|
|
122
|
-
"spc-parser": "^2.1.
|
|
123
|
-
"storybook": "^10.
|
|
124
|
-
"stylelint": "^17.
|
|
122
|
+
"spc-parser": "^2.1.1",
|
|
123
|
+
"storybook": "^10.6.0",
|
|
124
|
+
"stylelint": "^17.15.0",
|
|
125
125
|
"stylelint-config-standard": "^40.0.0",
|
|
126
126
|
"typescript": "^6.0.3",
|
|
127
|
-
"vite": "^8.
|
|
128
|
-
"vitest": "^
|
|
127
|
+
"vite": "^8.3.0",
|
|
128
|
+
"vitest": "^5.0.1",
|
|
129
129
|
"wdf-parser": "^1.0.0"
|
|
130
130
|
},
|
|
131
131
|
"volta": {
|
|
132
|
-
"node": "24.
|
|
132
|
+
"node": "24.21.0"
|
|
133
133
|
}
|
|
134
134
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { createContext,
|
|
1
|
+
import { createContext, use, useEffect, useMemo } from 'react';
|
|
2
2
|
|
|
3
3
|
import type {
|
|
4
4
|
AccordionItemContextValue,
|
|
@@ -17,7 +17,7 @@ export type AccordionContextValue = [
|
|
|
17
17
|
change: (id: string, isOpen: boolean) => void;
|
|
18
18
|
},
|
|
19
19
|
];
|
|
20
|
-
export const
|
|
20
|
+
export const AccordionContext = createContext<AccordionContextValue | null>(
|
|
21
21
|
null,
|
|
22
22
|
);
|
|
23
23
|
|
|
@@ -25,7 +25,7 @@ export function useAccordionItemContext(
|
|
|
25
25
|
id: string,
|
|
26
26
|
setIsOpen: AccordionItemSetIsOpen,
|
|
27
27
|
): AccordionItemContextValue {
|
|
28
|
-
const context =
|
|
28
|
+
const context = use(AccordionContext);
|
|
29
29
|
|
|
30
30
|
if (!context) {
|
|
31
31
|
throw new Error('AccordionContext was not found');
|
|
@@ -3,7 +3,7 @@ import type { ReactNode } from 'react';
|
|
|
3
3
|
import { useMemo, useRef } from 'react';
|
|
4
4
|
|
|
5
5
|
import type { AccordionContextValue } from './accordion_context.js';
|
|
6
|
-
import {
|
|
6
|
+
import { AccordionContext } from './accordion_context.js';
|
|
7
7
|
import type { AccordionItemSetIsOpen } from './accordion_context_utils.js';
|
|
8
8
|
import { getAccordionRegister } from './accordion_context_utils.js';
|
|
9
9
|
|
|
@@ -27,7 +27,7 @@ export function AccordionProvider(props: AccordionProviderProps) {
|
|
|
27
27
|
},
|
|
28
28
|
closeAllExcept: (id: string) => {
|
|
29
29
|
assert(registerRef.current);
|
|
30
|
-
for (const [key, item] of registerRef.current
|
|
30
|
+
for (const [key, item] of registerRef.current) {
|
|
31
31
|
if (key === id) {
|
|
32
32
|
item.setIsOpen(true);
|
|
33
33
|
} else {
|
|
@@ -70,9 +70,5 @@ export function AccordionProvider(props: AccordionProviderProps) {
|
|
|
70
70
|
];
|
|
71
71
|
}, [unmountChildren, utils]);
|
|
72
72
|
|
|
73
|
-
return
|
|
74
|
-
<accordionContext.Provider value={contextValue}>
|
|
75
|
-
{children}
|
|
76
|
-
</accordionContext.Provider>
|
|
77
|
-
);
|
|
73
|
+
return <AccordionContext value={contextValue}>{children}</AccordionContext>;
|
|
78
74
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { use, useMemo } from 'react';
|
|
2
2
|
|
|
3
|
-
import {
|
|
3
|
+
import { AccordionContext } from './accordion_context.js';
|
|
4
4
|
|
|
5
5
|
export interface AccordionControls<T extends string = string> {
|
|
6
6
|
open: (id: T) => void;
|
|
@@ -12,7 +12,7 @@ export interface AccordionControls<T extends string = string> {
|
|
|
12
12
|
export function useAccordionControls<
|
|
13
13
|
T extends string = string,
|
|
14
14
|
>(): AccordionControls<T> {
|
|
15
|
-
const context =
|
|
15
|
+
const context = use(AccordionContext);
|
|
16
16
|
|
|
17
17
|
if (!context) {
|
|
18
18
|
throw new Error('AccordionContext was not found');
|
|
@@ -12,6 +12,7 @@ import {
|
|
|
12
12
|
Tooltip,
|
|
13
13
|
} from '@blueprintjs/core';
|
|
14
14
|
import styled from '@emotion/styled';
|
|
15
|
+
import type { Mandatory } from '@zakodium/utils';
|
|
15
16
|
import type { ReactNode } from 'react';
|
|
16
17
|
|
|
17
18
|
type BlueprintProps = {
|
|
@@ -77,8 +78,16 @@ const TooltipButton = styled(BlueprintButton, {
|
|
|
77
78
|
${(props) => buttonStyles(props)}
|
|
78
79
|
`;
|
|
79
80
|
|
|
81
|
+
const defaultTooltipProps: Mandatory<ButtonProps['tooltipProps']> = {};
|
|
82
|
+
|
|
80
83
|
export function Button(props: ButtonProps) {
|
|
81
|
-
const {
|
|
84
|
+
const {
|
|
85
|
+
tooltipProps = defaultTooltipProps,
|
|
86
|
+
children,
|
|
87
|
+
tag,
|
|
88
|
+
tagProps,
|
|
89
|
+
...buttonProps
|
|
90
|
+
} = props;
|
|
82
91
|
const {
|
|
83
92
|
fill,
|
|
84
93
|
content = '',
|
|
@@ -103,7 +112,7 @@ export function Button(props: ButtonProps) {
|
|
|
103
112
|
isIconButton={!children && !buttonProps.text}
|
|
104
113
|
isTagButton={Boolean(tag)}
|
|
105
114
|
>
|
|
106
|
-
{tag && (
|
|
115
|
+
{Boolean(tag) && (
|
|
107
116
|
<ButtonTag round intent="success" {...tagProps}>
|
|
108
117
|
{tag}
|
|
109
118
|
</ButtonTag>
|
|
@@ -43,12 +43,12 @@ export interface ColorPickerProps {
|
|
|
43
43
|
className?: string;
|
|
44
44
|
presetColors?: string[];
|
|
45
45
|
color?:
|
|
46
|
-
| {
|
|
47
|
-
hex: string;
|
|
48
|
-
}
|
|
49
46
|
| RGB
|
|
50
47
|
| HSL
|
|
51
|
-
| HSV
|
|
48
|
+
| HSV
|
|
49
|
+
| {
|
|
50
|
+
hex: string;
|
|
51
|
+
};
|
|
52
52
|
disableAlpha?: boolean;
|
|
53
53
|
onChange?: (props: ChangeCallbackProps, event?: Event) => void;
|
|
54
54
|
onChangeComplete?: (props: ChangeCallbackProps, event?: Event) => void;
|
|
@@ -76,7 +76,7 @@ const styles: Record<
|
|
|
76
76
|
Record<
|
|
77
77
|
'picker' | 'color' | 'activeColor' | 'alphaContainer',
|
|
78
78
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
79
|
-
(...
|
|
79
|
+
(...arguments_: any) => CSSProperties
|
|
80
80
|
> = {
|
|
81
81
|
picker: (width: number | string) => ({
|
|
82
82
|
width: typeof width === 'string' ? width : `${width}px`,
|
|
@@ -93,9 +93,9 @@ const styles: Record<
|
|
|
93
93
|
padding: '4px 0',
|
|
94
94
|
flex: '1',
|
|
95
95
|
},
|
|
96
|
-
color: (
|
|
96
|
+
color: (isAlphaDisabled: boolean) => ({
|
|
97
97
|
width: '24px',
|
|
98
|
-
height:
|
|
98
|
+
height: isAlphaDisabled ? '10px' : '24px',
|
|
99
99
|
position: 'relative',
|
|
100
100
|
marginTop: '4px',
|
|
101
101
|
marginLeft: '4px',
|
|
@@ -128,12 +128,12 @@ const styles: Record<
|
|
|
128
128
|
borderRadius: '2px',
|
|
129
129
|
boxShadow: 'inset 0 0 0 1px rgba(0,0,0,.15), inset 0 0 4px rgba(0,0,0,.25)',
|
|
130
130
|
},
|
|
131
|
-
alphaContainer: (
|
|
131
|
+
alphaContainer: (isAlphaDisabled: boolean) => ({
|
|
132
132
|
position: 'relative',
|
|
133
133
|
height: '10px',
|
|
134
134
|
marginTop: '4px',
|
|
135
135
|
overflow: 'hidden',
|
|
136
|
-
...(
|
|
136
|
+
...(isAlphaDisabled && { display: 'none' }),
|
|
137
137
|
}),
|
|
138
138
|
alphaElement: {
|
|
139
139
|
borderRadius: '2px',
|
|
@@ -141,6 +141,8 @@ const styles: Record<
|
|
|
141
141
|
},
|
|
142
142
|
};
|
|
143
143
|
|
|
144
|
+
const defaultStyle: CSSProperties = {};
|
|
145
|
+
|
|
144
146
|
export function ColorPicker(props: ColorPickerProps) {
|
|
145
147
|
const {
|
|
146
148
|
width = 200,
|
|
@@ -152,12 +154,12 @@ export function ColorPicker(props: ColorPickerProps) {
|
|
|
152
154
|
color = defaultColor,
|
|
153
155
|
onChangeComplete,
|
|
154
156
|
onBlur,
|
|
155
|
-
style =
|
|
157
|
+
style = defaultStyle,
|
|
156
158
|
} = props;
|
|
157
159
|
|
|
158
160
|
const debounceRef = useRef(
|
|
159
|
-
debounce((
|
|
160
|
-
|
|
161
|
+
debounce((function_: any, data: ChangeCallbackProps, event: Event) => {
|
|
162
|
+
function_(data, event);
|
|
161
163
|
}, 100),
|
|
162
164
|
);
|
|
163
165
|
|
|
@@ -172,18 +174,20 @@ export function ColorPicker(props: ColorPickerProps) {
|
|
|
172
174
|
const handleChange = useCallback<SketchFieldsProps['onChange']>(
|
|
173
175
|
(data, event) => {
|
|
174
176
|
const isValidColor = colorHelper.simpleCheckForValidColor(data);
|
|
175
|
-
if (isValidColor) {
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
177
|
+
if (!isValidColor) {
|
|
178
|
+
return;
|
|
179
|
+
}
|
|
180
|
+
|
|
181
|
+
const colors = colorHelper.toState(
|
|
182
|
+
data,
|
|
183
|
+
('h' in data && data.h) || state.oldHue,
|
|
184
|
+
);
|
|
185
|
+
setState(colors);
|
|
186
|
+
if (onChangeComplete) {
|
|
187
|
+
debounceRef.current(onChangeComplete, colors, event);
|
|
188
|
+
}
|
|
189
|
+
if (onChange) {
|
|
190
|
+
onChange(colors, event);
|
|
187
191
|
}
|
|
188
192
|
},
|
|
189
193
|
[debounceRef, onChange, onChangeComplete, state.oldHue],
|
|
@@ -192,11 +196,13 @@ export function ColorPicker(props: ColorPickerProps) {
|
|
|
192
196
|
const handleSwatchHover = useCallback(
|
|
193
197
|
(data: any, event: any) => {
|
|
194
198
|
const isValidColor = colorHelper.simpleCheckForValidColor(data);
|
|
195
|
-
if (isValidColor) {
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
199
|
+
if (!isValidColor) {
|
|
200
|
+
return;
|
|
201
|
+
}
|
|
202
|
+
|
|
203
|
+
const colors = colorHelper.toState(data, data.h || state.oldHue);
|
|
204
|
+
if (onSwatchHover) {
|
|
205
|
+
onSwatchHover(colors, event);
|
|
200
206
|
}
|
|
201
207
|
},
|
|
202
208
|
[onSwatchHover, state.oldHue],
|
|
@@ -249,7 +255,7 @@ export function ColorPicker(props: ColorPickerProps) {
|
|
|
249
255
|
/>
|
|
250
256
|
<SketchPresetColors
|
|
251
257
|
colors={presetColors}
|
|
252
|
-
onClick={(data,
|
|
258
|
+
onClick={(data, event) => handleChange(data, event)}
|
|
253
259
|
onSwatchHover={handleSwatchHover}
|
|
254
260
|
/>
|
|
255
261
|
</div>
|
|
@@ -75,19 +75,19 @@ const styles = {
|
|
|
75
75
|
},
|
|
76
76
|
};
|
|
77
77
|
|
|
78
|
-
|
|
78
|
+
export default function Alpha(props) {
|
|
79
79
|
const containerRef = useRef();
|
|
80
80
|
const handleChange = useCallback(
|
|
81
|
-
(
|
|
81
|
+
(event) => {
|
|
82
82
|
const change = alpha.calculateChange(
|
|
83
|
-
|
|
83
|
+
event,
|
|
84
84
|
props.hsl,
|
|
85
85
|
props.direction,
|
|
86
86
|
props.a,
|
|
87
87
|
containerRef.current,
|
|
88
88
|
);
|
|
89
89
|
if (change && typeof props.onChange === 'function') {
|
|
90
|
-
props.onChange(change,
|
|
90
|
+
props.onChange(change, event);
|
|
91
91
|
}
|
|
92
92
|
},
|
|
93
93
|
[props],
|
|
@@ -119,6 +119,4 @@ const Alpha = (props) => {
|
|
|
119
119
|
</div>
|
|
120
120
|
</div>
|
|
121
121
|
);
|
|
122
|
-
}
|
|
123
|
-
|
|
124
|
-
export default Alpha;
|
|
122
|
+
}
|
|
@@ -34,7 +34,7 @@ const styles = {
|
|
|
34
34
|
},
|
|
35
35
|
};
|
|
36
36
|
|
|
37
|
-
|
|
37
|
+
export default function CheckBoard(props) {
|
|
38
38
|
const { children } = props;
|
|
39
39
|
|
|
40
40
|
if (!isValidElement(children)) {
|
|
@@ -45,6 +45,4 @@ const CheckBoard = (props) => {
|
|
|
45
45
|
...children.props,
|
|
46
46
|
style: { ...children.props.style, ...styles.grid(props) },
|
|
47
47
|
});
|
|
48
|
-
}
|
|
49
|
-
|
|
50
|
-
export default CheckBoard;
|
|
48
|
+
}
|