@deephaven/file-explorer 1.2.1-plotly-rc.3 → 1.3.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.
@@ -1 +1 @@
1
- {"version":3,"sourceRoot":"","sources":["../../../node_modules/@deephaven/components/scss/custom.scss","../../../node_modules/@deephaven/components/scss/bootstrap_overrides.scss","../src/FileList.scss","../../../node_modules/@deephaven/components/scss/new_variables.scss"],"names":[],"mappings":"AAAA;AC6LA;AC7KA;EACE;EACA;EACA;EACA;EACA;AA6FA;AAiCA;;AA5HA;EACE,aArBW;EAsBX;EACA,OAtBgB;EAuBhB;EACA;EACA;;AAGF;EACE;EACA;;AAGF;EACE;EACA,ODrBO;ECsBP;EACA;EACA;;AAEA;EACE,kBAtC0B;;AAyC5B;EACE,kBA1C0B;;AA6C5B;EAIE,OA3CqB;;AA+CzB;EACE;EACA;EACA;;AAGF;EACE,cC/DO;;ADmEP;EACE,kBA7DiB;;AAiEnB;EACE,kBArEkB;EAsElB,OAjEqB;;AAoErB;AAAA;EAEE;EACA;EACA;EACA;EACA,OAlFiB;EAmFjB,kBA9E2B;;AAgF7B;EACE;;AAEF;EACE;;AAKN;EACE;;AAGE;EACE;;AAIJ;AAAA;EAEE,OAhGwB;;AAsG1B;EACE,kBAzGe;EA0Gf,OAzGqB;;AA2GvB;EACE,kBAhHwB;EAiHxB,OA7GqB;;AAkHzB;EAEE;;AAKF;EACE;;AAIF;EACE;;AAEA;AAAA;EAEE;;;AAMN;EACE;EACA;EACA;;AAEA;EACE;EACA,YD5DW;EC6DX,ODzHS;EC0HT,eDJY","file":"FileList.css","sourcesContent":["/* stylelint-disable scss/at-import-no-partial-leading-underscore */\n// Consumers should be able to resolve bootstrap/ to node_modules/bootstrap\n\n//Make bootstrap functions available for use in overrides\n@import 'bootstrap/scss/_functions.scss';\n@import './bootstrap_overrides.scss';\n\n//_variable imports come after bootstrap default overrides,\n// makes all other variables and mixins from bootstrap available\n/// with just importing customer.scss\n@import 'bootstrap/scss/_variables.scss';\n@import 'bootstrap/scss/_mixins.scss';\n\n//New variables come after imports\n@import './new_variables.scss';\n@import './util.scss';\n","// Styling overrides for bootstrap\n@use 'sass:map';\n\n// Override / set color variables\n$red: var(--dh-color-visual-red);\n$orange: var(--dh-color-visual-orange);\n$yellow: var(--dh-color-visual-yellow);\n$green: var(--dh-color-visual-green);\n$blue: var(--dh-color-visual-blue);\n$purple: var(--dh-color-visual-purple);\n\n// Fallback colors are used if theme isn't loaded\n// this is required for error messages if the API doesn't load\n\n//Define our Gray scale\n$gray-100: var(--dh-color-gray-900, #fcfcfa);\n$gray-200: var(--dh-color-gray-800);\n$gray-300: var(--dh-color-gray-700);\n$gray-400: var(--dh-color-gray-600);\n$gray-500: var(--dh-color-gray-500);\n// intentional duplicate, scale doesn't line up otherwise\n// as we have gray-850 and spectrum doesn't and it is needed\n$gray-600: var(--dh-color-gray-500);\n$gray-700: var(--dh-color-gray-400);\n$gray-800: var(--dh-color-gray-300);\n$gray-850: var(--dh-color-gray-200);\n$gray-900: var(--dh-color-gray-75);\n$black: var(--dh-color-black, #1a171a);\n$white: var(--dh-color-white, #f0f0ee);\n\n//Define some UI colors\n$interfacegray: var(--dh-color-content-bg, #2d2a2e);\n$interfaceblue: var(--dh-color-accent-bg);\n$interfacewhite: $white;\n$interfaceblack: $black;\n$content-bg: var(--dh-color-content-bg, #2d2a2e);\n$background: var(--dh-color-bg, #1a171a);\n$foreground: var(--dh-color-fg, #f0f0ee);\n\n// Extend default Bootstrap $grays map\n$grays-custom: (\n '850': $gray-850,\n);\n$grays: () !default;\n$grays: map-merge($grays, $grays-custom);\n\n// Extend default Bootstrap $colors map\n$colors-custom: (\n 'black': $black,\n);\n$colors: () !default;\n$colors: map-merge($colors, $colors-custom);\n\n// Override default Bootstrap $theme-colors map by mapping each key to itself.\n// These will then be re-mapped inside of `button-outline-variant` and\n// `button-outline-variant` mixins in `bootstrap_override_mixins_buttons.scss`\n$theme-colors-self-map: ();\n@each $key\n in (\n 'primary',\n 'secondary',\n 'success',\n 'info',\n 'warning',\n 'danger',\n 'light',\n 'dark'\n )\n{\n $theme-colors-self-map: map.set($theme-colors-self-map, $key, $key);\n}\n$theme-colors: () !default;\n$theme-colors: map-merge($theme-colors, $theme-colors-self-map);\n\n// Used by bootstrap_override_mixins_buttons.scss to map Bootstrap colors to\n// DH semantic colors\n$bootstrap-dh-semantic-map: (\n 'primary': 'accent',\n 'secondary': 'neutral',\n 'success': 'positive',\n 'info': 'info',\n 'warning': 'notice',\n 'danger': 'negative',\n // We shouldn't be using these, but mapping so they work with our custom\n // `color-yiq` mixin. If we find a way to remove $light + $dark that are\n // defined in Bootstrap _variables.scss, we should remove these\n 'light': 'neutral',\n 'dark': 'neutral',\n);\n\n//Set default colors\n$body-bg: $black;\n$body-color: $interfacewhite;\n\n// Set brand colors\n$primary: var(--dh-color-accent-bg);\n$primary-hover: var(--dh-color-accent-hover-bg);\n$primary-dark: var(--dh-color-accent-down-bg);\n$secondary: var(--dh-color-neutral-bg);\n$secondary-hover: var(--dh-color-neutral-hover-bg);\n$success: $green;\n$info: $yellow;\n$warning: $orange;\n$danger: var(--dh-color-negative-bg);\n$danger-hover: var(--dh-color-negative-hover-bg);\n// We really don't want to use $light or $dark variables, but Bootstrap defines\n// them in _variables.scss. Explicitly setting them to ensure we are in control\n// of their values. If we can find a way to remove them, we should\n$light: var(--dh-color-gray-light);\n$dark: var(--dh-color-gray-dark);\n// Bootstrap doesn't define $mid, and we want to move away from this particular\n// semantic. Should be deleted by #1635\n$mid: var(--dh-color-gray-mid);\n\n$semantic-colors: (\n 'primary-hover': $primary-hover,\n 'primary-dark': $primary-dark,\n 'mid': $mid,\n 'content-bg': $interfacegray,\n 'background': $interfaceblack,\n 'foreground': $interfacewhite,\n 'secondary-hover': $secondary-hover,\n 'danger-hover': $danger-hover,\n);\n\n$component-active-bg: $primary;\n$theme-color-interval: 9%;\n$yiq-contrasted-threshold: 180;\n\n// Override fonts\n$font-family-sans-serif:\n 'Fira Sans',\n -apple-system,\n blinkmacsystemfont,\n 'Segoe UI',\n 'Roboto',\n 'Helvetica Neue',\n arial,\n sans-serif; //fira sans then native system ui fallbacks\n$font-family-monospace: 'Fira Mono', menlo, monaco, consolas, 'Liberation Mono',\n 'Courier New', monospace;\n$font-family-base: $font-family-sans-serif;\n\n$headings-font-weight: 400;\n\n//Text overides\n$text-muted: $gray-400;\n\n//Style Selection highlight color\n$text-select-color: var(--dh-color-text-highlight);\n\n//Grid variables, same value as default just making easily accessible\n$grid-gutter-width: 30px;\n\n//Visual Overrides\n$border-radius: 4px;\n$box-shadow: 0 0.1rem 1rem var(--dh-color-dropshadow);\n\n//Override Btn\n$btn-border-radius: 4rem;\n$btn-padding-x: 1.5rem;\n$btn-transition:\n color 0.12s ease-in-out,\n background-color 0.12s ease-in-out,\n border-color 0.12s ease-in-out,\n box-shadow 0.12s ease-in-out; //default 0.15 is too long\n$btn-border-width: 2px;\n$btn-font-weight: var(--spectrum-global-font-weight-bold);\n$btn-line-height: 1.3;\n\n//Override Inputs\n$input-bg: var(--dh-color-input-bg);\n$input-disabled-bg: var(--dh-color-input-disabled-bg);\n$input-color: var(--dh-color-input-fg);\n$input-border-color: var(--dh-color-input-border);\n$input-placeholder-color: var(--dh-color-input-placeholder);\n$input-focus-border-color: var(--dh-color-input-focus-border);\n\n$input-btn-focus-width: 0.2rem;\n$input-btn-focus-color: color-mix(\n in srgb,\n var(--dh-color-accent) 35%,\n transparent\n);\n$input-btn-focus-box-shadow: 0 0 0 $input-btn-focus-width $input-btn-focus-color;\n$input-btn-line-height: 1.3;\n// Bootstrap uses a calc expression to determine the input height (calc(line-height + 2*padding-y + border)).\n// The padding-y value has to be in rem to match units as it is a SASS calc.\n// Using 0.42145rem with 1.3 line height gets us to spectrum's 32px.\n/* stylelint-disable-next-line number-max-precision */\n$input-btn-padding-y: 0.42145rem;\n\n//checkbox\n$custom-control-indicator-bg: var(--dh-color-input-bg);\n$custom-control-indicator-border-color: var(--dh-color-input-border);\n$custom-checkbox-indicator-border-radius: 2px;\n$custom-control-indicator-border-width: 2px;\n$custom-control-indicator-active-bg: var(--dh-color-input-bg);\n$custom-control-indicator-active-border-color: var(--dh-color-input-fg);\n$custom-control-indicator-checked-bg: var(--dh-color-input-fg);\n$custom-control-indicator-checked-color: black; // used as mask fill color\n$custom-checkbox-indicator-indeterminate-bg: var(--dh-color-input-fg);\n$custom-control-indicator-bg-size: 75% 75%;\n$custom-control-indicator-disabled-bg: var(--dh-color-input-disabled-bg);\n$custom-control-indicator-checked-disabled-bg: var(\n --dh-color-input-disabled-bg\n);\n$custom-control-label-disabled-color: var(--dh-color-input-disabled-fg);\n\n// The $custom-select-indicator variable is used by Bootstrap to provide the\n// icon for the select dropdown. Inline svgs can't use CSS variables, so we hard\n// code the color to #929192 (the default value of --dh-color-gray-600). PR #1651\n// overrides this icon altogether for known dropdowns, so technically we may not\n// need this, but it's here in case there are any remaining instances.\n$custom-select-indicator-color: #929192;\n$custom-select-bg: var(--dh-color-selector-bg);\n$custom-select-bg-size: 16px 16px;\n//dhSort icon encoded\n$custom-select-indicator: str-replace(\n url(\"data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath fill='#{$custom-select-indicator-color}' d='M4 7l-.4-.8 4-3.7h.8l4 3.7-.4.8H4zm0 2l-.4.8 4 3.7h.8l4-3.7L12 9H4z'/%3E%3C/svg%3E\"),\n '#',\n '%23'\n);\n$custom-select-focus-box-shadow: $input-btn-focus-box-shadow;\n$custom-select-disabled-color: $gray-500;\n$custom-select-disabled-bg: $gray-800;\n\n//modal\n$modal-content-bg: $content-bg;\n$modal-content-border-width: 0;\n$modal-md: 550px;\n$close-color: var(--dh-color-text);\n$close-text-shadow: none;\n\n// Toast notification\n$toast-bg: var(--dh-color-accent-100);\n$toast-color: var(--dh-color-text);\n$toast-error-bg: var(--dh-color-negative-bg);\n$toast-error-color: var(--dh-color-text);\n\n//tooltips\n$tooltip-bg: var(--dh-color-tooltip-bg);\n$tooltip-color: var(--dh-color-tooltip-fg);\n$tooltip-box-shadow: 0 0.1rem 1.5rem 0.1rem var(--dh-color-tooltip-box-shadow);\n\n//drowdowns\n$dropdown-bg: $gray-600;\n$dropdown-link-color: $foreground;\n$dropdown-link-hover-color: $foreground;\n$dropdown-link-hover-bg: var(--dh-color-item-list-hover-bg);\n$dropdown-divider-bg: $gray-700;\n\n//context menus\n$contextmenu-bg: var(--dh-color-popover-bg);\n$contextmenu-color: var(--dh-color-text);\n$contextmenu-disabled-color: var(--dh-color-input-disabled-fg);\n$contextmenu-keyboard-selected-bg: var(--dh-color-keyboard-selected-bg);\n$contextmenu-selected-bg: var(--dh-color-item-list-hover-bg);\n$contextmenu-selected-color: var(--dh-color-item-list-selected-fg);\n\n//hr\n$hr-border-color: var(--dh-color-hr);\n\n//links\n$link-color: $gray-400;\n$link-hover-color: $foreground;\n\n//progress-bar\n$progress-bg: $gray-600;\n$progress-border-radius: 1rem;\n\n// Set global options\n$enable-shadows: false;\n$enable-gradients: false;\n$enable-print-styles: false; //I don't think anyone should expect to \"print\" this app.\n\n// Transition times\n$transition: 0.15s;\n$transition-mid: 0.2s;\n$transition-long: 0.3s;\n$transition-slow: 0.6s;\n\n//form-validation icon, uses vsWarning icon encoded here as svg\n$form-feedback-icon-invalid-color: $danger;\n$form-feedback-icon-invalid: str-replace(\n url(\"data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 16 16'%3E%3Cg fill='none'%3E%3Cg fill='#{$form-feedback-icon-invalid-color}'%3E%3Cpath d='M7.56 1h.88l6.54 12.26-.44.74H1.44L1 13.26 7.56 1zM8 2.28 2.28 13H13.7L8 2.28zM8.625 12v-1h-1.25v1h1.25zm-1.25-2V6h1.25v4h-1.25z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E \"),\n '#',\n '%23'\n);\n\n// This section of variables is not consumed directly by DH, but they need to be\n// defined for sass to compile _variables\n$table-dark-bg: $gray-800;\n$table-dark-accent-bg: var(--dh-color-highlight-hover);\n$table-dark-hover-bg: var(--dh-color-highlight-active);\n$table-dark-border-color: $gray-700;\n$popover-bg: var(--dh-color-tooltip-bg);\n$popover-border-color: var(--dh-color-overlay-modal-bg);\n$popover-header-bg: #000;\n$popover-arrow-outer-color: var(--dh-color-dropshadow);\n$custom-range-thumb-active-bg: var(--dh-color-accent-1100);\n","@import '@deephaven/components/scss/custom.scss';\n\n$depth-line-color: $gray-600;\n$depth-margin: 5px;\n$depth-indentation: 8px;\n$item-list-border-width: 1px;\n$item-list-color: $text-muted;\n$item-list-selected-nofocus-bg: var(--dh-color-item-list-selected-inactive-bg);\n$item-list-selected-bg: var(--dh-color-item-list-selected-bg);\n$item-list-selected-hover-bg: var(--dh-color-item-list-selected-hover-bg);\n$item-list-selection-border-color: var(--dh-color-item-list-selected-border);\n$item-list-focused-bg: var(--dh-color-item-list-selected-bg);\n$item-list-hover-bg: var(--dh-color-item-list-hover-bg);\n$item-list-selected-color: var(--dh-color-item-list-selected-fg);\n$item-list-drop-target-color: var(--dh-color-item-list-drop-target-fg);\n\n.file-list {\n position: absolute;\n top: 0;\n bottom: 0;\n left: 0;\n right: 0;\n\n .file-list-depth-line {\n margin-left: $depth-margin;\n padding-bottom: 2px;\n width: $depth-indentation;\n height: 100%;\n border-left: 1px solid $depth-line-color;\n box-sizing: content-box;\n }\n\n .item-list-scroll-pane {\n border: none;\n border-radius: 0;\n }\n\n .item-list-item {\n padding: 0 $input-btn-padding-x;\n color: $item-list-color;\n border: $item-list-border-width solid transparent; // we need a spacer border so stuff doesn't move on us when we apply a border-color\n -webkit-user-drag: none; // we need to disable webkit-user-drag or else Chrome switches to a Copy icon when dragging on Mac\n cursor: pointer;\n\n &.is-focused {\n background-color: $item-list-selected-nofocus-bg;\n }\n\n &.active {\n background-color: $item-list-selected-nofocus-bg;\n }\n\n &:focus,\n &.active,\n &:hover,\n &.is-focused {\n color: $item-list-selected-color;\n }\n }\n\n .truncation-wrapper {\n overflow-x: hidden;\n text-overflow: ellipsis;\n white-space: pre;\n }\n\n .item-icon {\n margin-right: $spacer-1;\n }\n\n &:focus-within {\n &.item-list-item.is-focused {\n background-color: $item-list-focused-bg;\n }\n\n //for selected items, apply border on left and right\n .item-list-item.active {\n background-color: $item-list-selected-bg;\n color: $item-list-selected-color;\n // because of border mitre, we use pseudo elements to act as borders\n // otherwise we get mitre gap beteween the borders\n ::before,\n ::after {\n content: '';\n position: absolute;\n top: -$item-list-border-width;\n bottom: -$item-list-border-width * 2; // times 2 the bottom border is actually the top of next item\n width: $item-list-border-width;\n background-color: $item-list-selection-border-color;\n }\n ::before {\n left: -$item-list-border-width;\n }\n ::after {\n right: -$item-list-border-width;\n }\n }\n }\n\n &.is-dragging {\n cursor: grabbing;\n\n .item-list-item {\n &.active {\n opacity: 0.5;\n }\n }\n\n .is-in-drop-target,\n .is-exact-drop-target {\n color: $item-list-drop-target-color;\n }\n }\n\n /* stylelint-disable no-descending-specificity */\n &:not(.is-dragging) {\n .item-list-item:hover {\n background-color: $item-list-hover-bg;\n color: $item-list-selected-color;\n }\n &:focus-within .item-list-item.active:hover {\n background-color: $item-list-selected-hover-bg;\n color: $item-list-selected-color;\n }\n }\n\n //apply border to top of the first item in the list if its selected, and the first selected after a non-selected item\n &:focus-within .item-list-item:not(.active) + .active,\n &:focus-within .item-list-item.active:first-of-type {\n border-top: $item-list-border-width solid $item-list-selection-border-color;\n }\n\n //there's no easy way to get the last select item in a grouping, so we apply the end border\n //to the TOP of the first non-selected item, ie. the previous selection group\n &:focus-within .item-list-item.active + .item-list-item:not(.active) {\n border-top: $item-list-border-width solid $item-list-selection-border-color;\n }\n\n //since there is no item after the last item in teh selection, we apply the border to the bottom of the last selected element\n &:focus-within .item-list-item.active:last-of-type {\n border-bottom: $item-list-border-width solid\n $item-list-selection-border-color;\n ::before,\n ::after {\n bottom: 0; // not times 2 because there is no next item\n }\n }\n /* stylelint-enable no-descending-specificity */\n}\n\n.file-list-dnd-placeholder {\n position: absolute;\n top: -100px;\n right: 0;\n\n .dnd-placeholder-content {\n padding: $spacer-1 $spacer-3;\n background: $primary-dark;\n color: $foreground;\n border-radius: $border-radius;\n }\n}\n","@use 'sass:math';\n\n//Set of spacer variables from the spacer map\n$spacer-0: map-get($spacers, 0); //0\n$spacer-1: map-get($spacers, 1);\n$spacer-2: map-get($spacers, 2);\n$spacer-3: map-get($spacers, 3);\n$spacer-4: map-get($spacers, 4);\n$spacer-5: map-get($spacers, 5);\n\n//Marching Ants for golden layout dropzone and drag and drop\n//top bottom, left right.\n//create 4 background images that are 50% color 1, 50% color 2 using graidents, two veritical, two horizontal\n//size them to ant-size and thickness\n//position those images along the egdes and make top/bottom repeat-x and left/right repeat-y\n//then offest each of those background positions by ant-size in animation to make them march.\n$ant-size: 8px;\n$ant-thickness: 1px;\n\n@mixin ants-base($color-1: black, $color-2: white) {\n background-image: linear-gradient(to right, $color-2 50%, $color-1 50%),\n linear-gradient(to right, $color-2 50%, $color-1 50%),\n linear-gradient(to bottom, $color-2 50%, $color-1 50%),\n linear-gradient(to bottom, $color-2 50%, $color-1 50%);\n background-size:\n $ant-size $ant-thickness,\n $ant-size $ant-thickness,\n $ant-thickness $ant-size,\n $ant-thickness $ant-size;\n background-position:\n 0 top,\n 0 bottom,\n left 0,\n right 0;\n background-repeat: repeat-x, repeat-x, repeat-y, repeat-y;\n animation: march 0.5s;\n animation-timing-function: linear;\n animation-iteration-count: infinite;\n}\n\n@mixin drag-stack($pseudo-element) {\n &::#{$pseudo-element} {\n content: ' ';\n background: $primary;\n box-shadow: $box-shadow;\n border-radius: $border-radius;\n position: absolute;\n height: 100%;\n width: 100%;\n @content;\n }\n}\n\n$focus-bg-transparency: 12%;\n$hover-bg-transparency: 14%;\n$active-bg-transparency: 28%;\n$exception-transparency: 28%;\n"]}
1
+ {"version":3,"sourceRoot":"","sources":["../../../node_modules/@deephaven/components/scss/custom.scss","../../../node_modules/@deephaven/components/scss/bootstrap_overrides.scss","../src/FileList.scss","../../../node_modules/@deephaven/components/scss/new_variables.scss"],"names":[],"mappings":"AAAA;AC6LA;AC7KA;EACE;EACA;EACA;EACA;EACA;AA6FA;AAiCA;;AA5HA;EACE,aArBW;EAsBX;EACA,OAtBgB;EAuBhB;EACA;EACA;;AAGF;EACE;EACA;;AAGF;EACE;EACA,ODrBO;ECsBP;EACA;EACA;;AAEA;EACE,kBAtC0B;;AAyC5B;EACE,kBA1C0B;;AA6C5B;EAIE,OA3CqB;;AA+CzB;EACE;EACA;EACA;;AAGF;EACE,cC/DO;;ADmEP;EACE,kBA7DiB;;AAiEnB;EACE,kBArEkB;EAsElB,OAjEqB;;AAoErB;AAAA;EAEE;EACA;EACA;EACA;EACA,OAlFiB;EAmFjB,kBA9E2B;;AAgF7B;EACE;;AAEF;EACE;;AAKN;EACE;;AAGE;EACE;;AAIJ;AAAA;EAEE,OAhGwB;;AAsG1B;EACE,kBAzGe;EA0Gf,OAzGqB;;AA2GvB;EACE,kBAhHwB;EAiHxB,OA7GqB;;AAkHzB;EAEE;;AAKF;EACE;;AAIF;EACE;;AAEA;AAAA;EAEE;;;AAMN;EACE;EACA;EACA;;AAEA;EACE;EACA,YD5DW;EC6DX,ODzHS;EC0HT,eDJY","file":"FileList.css","sourcesContent":["/* stylelint-disable scss/at-import-no-partial-leading-underscore */\n// Consumers should be able to resolve bootstrap/ to node_modules/bootstrap\n\n//Make bootstrap functions available for use in overrides\n@import 'bootstrap/scss/_functions.scss';\n@import './bootstrap_overrides.scss';\n\n//_variable imports come after bootstrap default overrides,\n// makes all other variables and mixins from bootstrap available\n/// with just importing customer.scss\n@import 'bootstrap/scss/_variables.scss';\n@import 'bootstrap/scss/_mixins.scss';\n\n//New variables come after imports\n@import './new_variables.scss';\n@import './util.scss';\n","// Styling overrides for bootstrap\n@use 'sass:map';\n\n// Override / set color variables\n$red: var(--dh-color-visual-red);\n$orange: var(--dh-color-visual-orange);\n$yellow: var(--dh-color-visual-yellow);\n$green: var(--dh-color-visual-green);\n$blue: var(--dh-color-visual-blue);\n$purple: var(--dh-color-visual-purple);\n\n// Fallback colors are used if theme isn't loaded\n// this is required for error messages if the API doesn't load\n\n//Define our Gray scale\n$gray-100: var(--dh-color-gray-900, #fcfcfa);\n$gray-200: var(--dh-color-gray-800);\n$gray-300: var(--dh-color-gray-700);\n$gray-400: var(--dh-color-gray-600);\n$gray-500: var(--dh-color-gray-500);\n// intentional duplicate, scale doesn't line up otherwise\n// as we have gray-850 and spectrum doesn't and it is needed\n$gray-600: var(--dh-color-gray-500);\n$gray-700: var(--dh-color-gray-400);\n$gray-800: var(--dh-color-gray-300);\n$gray-850: var(--dh-color-gray-200);\n$gray-900: var(--dh-color-gray-75);\n$black: var(--dh-color-black, #1a171a);\n$white: var(--dh-color-white, #f0f0ee);\n\n//Define some UI colors\n$interfacegray: var(--dh-color-content-bg, #2d2a2e);\n$interfaceblue: var(--dh-color-accent-bg);\n$interfacewhite: $white;\n$interfaceblack: $black;\n$content-bg: var(--dh-color-content-bg, #2d2a2e);\n$background: var(--dh-color-bg, #1a171a);\n$foreground: var(--dh-color-fg, #f0f0ee);\n\n// Extend default Bootstrap $grays map\n$grays-custom: (\n '850': $gray-850,\n);\n$grays: () !default;\n$grays: map-merge($grays, $grays-custom);\n\n// Extend default Bootstrap $colors map\n$colors-custom: (\n 'black': $black,\n);\n$colors: () !default;\n$colors: map-merge($colors, $colors-custom);\n\n// Override default Bootstrap $theme-colors map by mapping each key to itself.\n// These will then be re-mapped inside of `button-outline-variant` and\n// `button-outline-variant` mixins in `bootstrap_override_mixins_buttons.scss`\n$theme-colors-self-map: ();\n@each $key\n in (\n 'primary',\n 'secondary',\n 'success',\n 'info',\n 'warning',\n 'danger',\n 'light',\n 'dark'\n )\n{\n $theme-colors-self-map: map.set($theme-colors-self-map, $key, $key);\n}\n$theme-colors: () !default;\n$theme-colors: map-merge($theme-colors, $theme-colors-self-map);\n\n// Used by bootstrap_override_mixins_buttons.scss to map Bootstrap colors to\n// DH semantic colors\n$bootstrap-dh-semantic-map: (\n 'primary': 'accent',\n 'secondary': 'neutral',\n 'success': 'positive',\n 'info': 'info',\n 'warning': 'notice',\n 'danger': 'negative',\n // We shouldn't be using these, but mapping so they work with our custom\n // `color-yiq` mixin. If we find a way to remove $light + $dark that are\n // defined in Bootstrap _variables.scss, we should remove these\n 'light': 'neutral',\n 'dark': 'neutral',\n);\n\n//Set default colors\n$body-bg: $black;\n$body-color: $interfacewhite;\n\n// Set brand colors\n$primary: var(--dh-color-accent-bg);\n$primary-hover: var(--dh-color-accent-hover-bg);\n$primary-dark: var(--dh-color-accent-down-bg);\n$secondary: var(--dh-color-neutral-bg);\n$secondary-hover: var(--dh-color-neutral-hover-bg);\n$success: $green;\n$info: $yellow;\n$warning: $orange;\n$danger: var(--dh-color-negative-bg);\n$danger-hover: var(--dh-color-negative-hover-bg);\n// We really don't want to use $light or $dark variables, but Bootstrap defines\n// them in _variables.scss. Explicitly setting them to ensure we are in control\n// of their values. If we can find a way to remove them, we should\n$light: var(--dh-color-gray-light);\n$dark: var(--dh-color-gray-dark);\n// Bootstrap doesn't define $mid, and we want to move away from this particular\n// semantic. Should be deleted by #1635\n$mid: var(--dh-color-gray-mid);\n\n$semantic-colors: (\n 'primary-hover': $primary-hover,\n 'primary-dark': $primary-dark,\n 'mid': $mid,\n 'content-bg': $interfacegray,\n 'background': $interfaceblack,\n 'foreground': $interfacewhite,\n 'secondary-hover': $secondary-hover,\n 'danger-hover': $danger-hover,\n);\n\n$component-active-bg: $primary;\n$theme-color-interval: 9%;\n$yiq-contrasted-threshold: 180;\n\n// Override fonts\n$font-family-sans-serif:\n 'Fira Sans',\n -apple-system,\n blinkmacsystemfont,\n 'Segoe UI',\n 'Roboto',\n 'Helvetica Neue',\n arial,\n sans-serif; //fira sans then native system ui fallbacks\n$font-family-monospace: 'Fira Mono', menlo, monaco, consolas, 'Liberation Mono',\n 'Courier New', monospace;\n$font-family-base: $font-family-sans-serif;\n\n$headings-font-weight: 400;\n\n//Text overides\n$text-muted: $gray-400;\n\n//Style Selection highlight color\n$text-select-color: var(--dh-color-text-highlight);\n\n//Grid variables, same value as default just making easily accessible\n$grid-gutter-width: 30px;\n\n//Visual Overrides\n$border-radius: 4px;\n$box-shadow: 0 0.1rem 1rem var(--dh-color-dropshadow);\n\n//Override Btn\n$btn-border-radius: 4rem;\n$btn-padding-x: 1.5rem;\n$btn-transition:\n color 0.12s ease-in-out,\n background-color 0.12s ease-in-out,\n border-color 0.12s ease-in-out,\n box-shadow 0.12s ease-in-out; //default 0.15 is too long\n$btn-border-width: 2px;\n$btn-font-weight: var(--spectrum-global-font-weight-bold);\n$btn-line-height: 1.3;\n\n//Override Inputs\n$input-bg: var(--dh-color-input-bg);\n$input-disabled-bg: var(--dh-color-input-disabled-bg);\n$input-color: var(--dh-color-input-fg);\n$input-border-color: var(--dh-color-input-border);\n$input-placeholder-color: var(--dh-color-input-placeholder);\n$input-focus-border-color: var(--dh-color-input-focus-border);\n\n$input-btn-focus-width: 0.2rem;\n$input-btn-focus-color: color-mix(\n in srgb,\n var(--dh-color-accent) 35%,\n transparent\n);\n$input-btn-focus-box-shadow: 0 0 0 $input-btn-focus-width $input-btn-focus-color;\n$input-btn-line-height: 1.3;\n// Bootstrap uses a calc expression to determine the input height (calc(line-height + 2*padding-y + border)).\n// The padding-y value has to be in rem to match units as it is a SASS calc.\n// Using 0.42145rem with 1.3 line height gets us to spectrum's 32px.\n/* stylelint-disable-next-line number-max-precision */\n$input-btn-padding-y: 0.42145rem;\n\n//checkbox\n$custom-control-indicator-bg: var(--dh-color-input-bg);\n$custom-control-indicator-border-color: var(--dh-color-input-border);\n$custom-checkbox-indicator-border-radius: 2px;\n$custom-control-indicator-border-width: 2px;\n$custom-control-indicator-active-bg: var(--dh-color-input-bg);\n$custom-control-indicator-active-border-color: var(--dh-color-input-fg);\n$custom-control-indicator-checked-bg: var(--dh-color-input-fg);\n$custom-control-indicator-checked-color: black; // used as mask fill color\n$custom-checkbox-indicator-indeterminate-bg: var(--dh-color-input-fg);\n$custom-control-indicator-bg-size: 75% 75%;\n$custom-control-indicator-disabled-bg: var(--dh-color-input-disabled-bg);\n$custom-control-indicator-checked-disabled-bg: var(\n --dh-color-input-disabled-bg\n);\n$custom-control-label-disabled-color: var(--dh-color-input-disabled-fg);\n\n// The $custom-select-indicator variable is used by Bootstrap to provide the\n// icon for the select dropdown. Inline svgs can't use CSS variables, so we hard\n// code the color to #929192 (the default value of --dh-color-gray-600). PR #1651\n// overrides this icon altogether for known dropdowns, so technically we may not\n// need this, but it's here in case there are any remaining instances.\n$custom-select-indicator-color: #929192;\n$custom-select-bg: var(--dh-color-selector-bg);\n$custom-select-bg-size: 16px 16px;\n//dhSort icon encoded\n$custom-select-indicator: str-replace(\n url(\"data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath fill='#{$custom-select-indicator-color}' d='M4 7l-.4-.8 4-3.7h.8l4 3.7-.4.8H4zm0 2l-.4.8 4 3.7h.8l4-3.7L12 9H4z'/%3E%3C/svg%3E\"),\n '#',\n '%23'\n);\n$custom-select-focus-box-shadow: $input-btn-focus-box-shadow;\n$custom-select-disabled-color: $gray-500;\n$custom-select-disabled-bg: $gray-800;\n\n//modal\n$modal-content-bg: $content-bg;\n$modal-content-border-width: 0;\n$modal-md: 550px;\n$close-color: var(--dh-color-text);\n$close-text-shadow: none;\n\n// Toast notification\n$toast-bg: var(--dh-color-accent-100);\n$toast-color: var(--dh-color-text);\n$toast-error-bg: var(--dh-color-negative-bg);\n$toast-error-color: var(--dh-color-text);\n\n//tooltips\n$tooltip-bg: var(--dh-color-tooltip-bg);\n$tooltip-color: var(--dh-color-tooltip-fg);\n$tooltip-box-shadow: 0 0.1rem 1.5rem 0.1rem var(--dh-color-tooltip-box-shadow);\n\n//drowdowns\n$dropdown-bg: $gray-600;\n$dropdown-link-color: $foreground;\n$dropdown-link-hover-color: $foreground;\n$dropdown-link-hover-bg: var(--dh-color-item-list-hover-bg);\n$dropdown-divider-bg: $gray-700;\n\n//context menus\n$contextmenu-bg: var(--dh-color-popover-bg);\n$contextmenu-color: var(--dh-color-text);\n$contextmenu-disabled-color: var(--dh-color-text-disabled);\n$contextmenu-keyboard-selected-bg: var(--dh-color-keyboard-selected-bg);\n$contextmenu-selected-bg: var(--dh-color-item-list-hover-bg);\n$contextmenu-selected-color: var(--dh-color-item-list-selected-fg);\n\n//hr\n$hr-border-color: var(--dh-color-hr);\n\n//links\n$link-color: $gray-400;\n$link-hover-color: $foreground;\n\n//progress-bar\n$progress-bg: $gray-600;\n$progress-border-radius: 1rem;\n\n// Set global options\n$enable-shadows: false;\n$enable-gradients: false;\n$enable-print-styles: false; //I don't think anyone should expect to \"print\" this app.\n\n// Transition times\n$transition: 0.15s;\n$transition-mid: 0.2s;\n$transition-long: 0.3s;\n$transition-slow: 0.6s;\n\n//form-validation icon, uses vsWarning icon encoded here as svg\n$form-feedback-icon-invalid-color: $danger;\n$form-feedback-icon-invalid: str-replace(\n url(\"data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 16 16'%3E%3Cg fill='none'%3E%3Cg fill='#{$form-feedback-icon-invalid-color}'%3E%3Cpath d='M7.56 1h.88l6.54 12.26-.44.74H1.44L1 13.26 7.56 1zM8 2.28 2.28 13H13.7L8 2.28zM8.625 12v-1h-1.25v1h1.25zm-1.25-2V6h1.25v4h-1.25z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E \"),\n '#',\n '%23'\n);\n\n// This section of variables is not consumed directly by DH, but they need to be\n// defined for sass to compile _variables\n$table-dark-bg: $gray-800;\n$table-dark-accent-bg: var(--dh-color-highlight-hover);\n$table-dark-hover-bg: var(--dh-color-highlight-active);\n$table-dark-border-color: $gray-700;\n$popover-bg: var(--dh-color-tooltip-bg);\n$popover-border-color: var(--dh-color-overlay-modal-bg);\n$popover-header-bg: #000;\n$popover-arrow-outer-color: var(--dh-color-dropshadow);\n$custom-range-thumb-active-bg: var(--dh-color-accent-1100);\n","@import '@deephaven/components/scss/custom.scss';\n\n$depth-line-color: $gray-600;\n$depth-margin: 5px;\n$depth-indentation: 8px;\n$item-list-border-width: 1px;\n$item-list-color: $text-muted;\n$item-list-selected-nofocus-bg: var(--dh-color-item-list-selected-inactive-bg);\n$item-list-selected-bg: var(--dh-color-item-list-selected-bg);\n$item-list-selected-hover-bg: var(--dh-color-item-list-selected-hover-bg);\n$item-list-selection-border-color: var(--dh-color-item-list-selected-border);\n$item-list-focused-bg: var(--dh-color-item-list-selected-bg);\n$item-list-hover-bg: var(--dh-color-item-list-hover-bg);\n$item-list-selected-color: var(--dh-color-item-list-selected-fg);\n$item-list-drop-target-color: var(--dh-color-item-list-drop-target-fg);\n\n.file-list {\n position: absolute;\n top: 0;\n bottom: 0;\n left: 0;\n right: 0;\n\n .file-list-depth-line {\n margin-left: $depth-margin;\n padding-bottom: 2px;\n width: $depth-indentation;\n height: 100%;\n border-left: 1px solid $depth-line-color;\n box-sizing: content-box;\n }\n\n .item-list-scroll-pane {\n border: none;\n border-radius: 0;\n }\n\n .item-list-item {\n padding: 0 $input-btn-padding-x;\n color: $item-list-color;\n border: $item-list-border-width solid transparent; // we need a spacer border so stuff doesn't move on us when we apply a border-color\n -webkit-user-drag: none; // we need to disable webkit-user-drag or else Chrome switches to a Copy icon when dragging on Mac\n cursor: pointer;\n\n &.is-focused {\n background-color: $item-list-selected-nofocus-bg;\n }\n\n &.active {\n background-color: $item-list-selected-nofocus-bg;\n }\n\n &:focus,\n &.active,\n &:hover,\n &.is-focused {\n color: $item-list-selected-color;\n }\n }\n\n .truncation-wrapper {\n overflow-x: hidden;\n text-overflow: ellipsis;\n white-space: pre;\n }\n\n .item-icon {\n margin-right: $spacer-1;\n }\n\n &:focus-within {\n &.item-list-item.is-focused {\n background-color: $item-list-focused-bg;\n }\n\n //for selected items, apply border on left and right\n .item-list-item.active {\n background-color: $item-list-selected-bg;\n color: $item-list-selected-color;\n // because of border mitre, we use pseudo elements to act as borders\n // otherwise we get mitre gap beteween the borders\n ::before,\n ::after {\n content: '';\n position: absolute;\n top: -$item-list-border-width;\n bottom: -$item-list-border-width * 2; // times 2 the bottom border is actually the top of next item\n width: $item-list-border-width;\n background-color: $item-list-selection-border-color;\n }\n ::before {\n left: -$item-list-border-width;\n }\n ::after {\n right: -$item-list-border-width;\n }\n }\n }\n\n &.is-dragging {\n cursor: grabbing;\n\n .item-list-item {\n &.active {\n opacity: 0.5;\n }\n }\n\n .is-in-drop-target,\n .is-exact-drop-target {\n color: $item-list-drop-target-color;\n }\n }\n\n /* stylelint-disable no-descending-specificity */\n &:not(.is-dragging) {\n .item-list-item:hover {\n background-color: $item-list-hover-bg;\n color: $item-list-selected-color;\n }\n &:focus-within .item-list-item.active:hover {\n background-color: $item-list-selected-hover-bg;\n color: $item-list-selected-color;\n }\n }\n\n //apply border to top of the first item in the list if its selected, and the first selected after a non-selected item\n &:focus-within .item-list-item:not(.active) + .active,\n &:focus-within .item-list-item.active:first-of-type {\n border-top: $item-list-border-width solid $item-list-selection-border-color;\n }\n\n //there's no easy way to get the last select item in a grouping, so we apply the end border\n //to the TOP of the first non-selected item, ie. the previous selection group\n &:focus-within .item-list-item.active + .item-list-item:not(.active) {\n border-top: $item-list-border-width solid $item-list-selection-border-color;\n }\n\n //since there is no item after the last item in teh selection, we apply the border to the bottom of the last selected element\n &:focus-within .item-list-item.active:last-of-type {\n border-bottom: $item-list-border-width solid\n $item-list-selection-border-color;\n ::before,\n ::after {\n bottom: 0; // not times 2 because there is no next item\n }\n }\n /* stylelint-enable no-descending-specificity */\n}\n\n.file-list-dnd-placeholder {\n position: absolute;\n top: -100px;\n right: 0;\n\n .dnd-placeholder-content {\n padding: $spacer-1 $spacer-3;\n background: $primary-dark;\n color: $foreground;\n border-radius: $border-radius;\n }\n}\n","@use 'sass:math';\n\n//Set of spacer variables from the spacer map\n$spacer-0: map-get($spacers, 0); //0\n$spacer-1: map-get($spacers, 1);\n$spacer-2: map-get($spacers, 2);\n$spacer-3: map-get($spacers, 3);\n$spacer-4: map-get($spacers, 4);\n$spacer-5: map-get($spacers, 5);\n\n//Marching Ants for golden layout dropzone and drag and drop\n//top bottom, left right.\n//create 4 background images that are 50% color 1, 50% color 2 using graidents, two veritical, two horizontal\n//size them to ant-size and thickness\n//position those images along the egdes and make top/bottom repeat-x and left/right repeat-y\n//then offest each of those background positions by ant-size in animation to make them march.\n$ant-size: 8px;\n$ant-thickness: 1px;\n\n@mixin ants-base($color-1: black, $color-2: white) {\n background-image: linear-gradient(to right, $color-2 50%, $color-1 50%),\n linear-gradient(to right, $color-2 50%, $color-1 50%),\n linear-gradient(to bottom, $color-2 50%, $color-1 50%),\n linear-gradient(to bottom, $color-2 50%, $color-1 50%);\n background-size:\n $ant-size $ant-thickness,\n $ant-size $ant-thickness,\n $ant-thickness $ant-size,\n $ant-thickness $ant-size;\n background-position:\n 0 top,\n 0 bottom,\n left 0,\n right 0;\n background-repeat: repeat-x, repeat-x, repeat-y, repeat-y;\n animation: march 0.5s;\n animation-timing-function: linear;\n animation-iteration-count: infinite;\n}\n\n@mixin drag-stack($pseudo-element) {\n &::#{$pseudo-element} {\n content: ' ';\n background: $primary;\n box-shadow: $box-shadow;\n border-radius: $border-radius;\n position: absolute;\n height: 100%;\n width: 100%;\n @content;\n }\n}\n\n$focus-bg-transparency: 12%;\n$hover-bg-transparency: 14%;\n$active-bg-transparency: 28%;\n$exception-transparency: 28%;\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"FileList.js","names":["ItemList","Log","RangeUtils","classNames","React","useCallback","useEffect","useMemo","useRef","useState","isDirectory","DEFAULT_ROW_HEIGHT","getMoveOperation","FileListItem","jsx","_jsx","log","module","DRAG_HOVER_TIMEOUT","ITEM_LIST_CLASS_NAME","FileList","props","isMultiSelect","table","onFocusChange","undefined","onMove","onSelect","onSelectionChange","renderItem","rowHeight","overscanCount","DEFAULT_OVERSCAN","loadedViewport","setLoadedViewport","items","offset","itemCount","viewport","setViewport","top","bottom","dropTargetItem","setDropTargetItem","draggedItems","setDraggedItems","dragPlaceholder","setDragPlaceholder","selectedRanges","setSelectedRanges","focusedIndex","itemList","fileList","getItems","ranges","length","i","range","j","push","getItem","itemIndex","getDragPlaceholderText","count","index","item","filename","concat","dropItems","debug","files","targetPath","_itemList$current","current","focusItem","err","error","handleSelect","event","setExpanded","isExpanded","handleItemDragStart","e","_itemList$current2","_getDragPlaceholderTe","debug2","draggedRanges","isSelected","resetMouseState","newDragPlaceholder","document","createElement","dndPlaceholderContent","className","innerText","appendChild","body","dataTransfer","setDragImage","effectAllowed","handleItemDragOver","preventDefault","handleItemDragEnd","remove","handleItemDrop","handleItemDragExit","handleListDragOver","target","Element","classList","contains","type","basename","id","handleListDrop","handleSelectionChange","newSelectedRanges","force","arguments","selectedItems","handleFocusChange","focusIndex","focusedItem","handleViewportChange","isDropTargetValid","focusedPath","collapseAll","updateTableViewport","Math","max","setLoadedViewportAndReturnCleanup","listenerRemover","onUpdate","newViewport","map","_objectSpread","itemName","size","updateFocusAndSelection","expandFolderOnHover","timeout","setTimeout","clearTimeout","renderWrapper","itemProps","isDragInProgress","onDragStart","onDragEnd","onDragOver","onDragExit","onDrop","ref","children","onViewportChange","isDragSelect","isDeselectOnClick"],"sources":["../src/FileList.tsx"],"sourcesContent":["import { ItemList, type Range } from '@deephaven/components';\nimport Log from '@deephaven/log';\nimport { RangeUtils } from '@deephaven/utils';\nimport classNames from 'classnames';\nimport React, {\n useCallback,\n useEffect,\n useMemo,\n useRef,\n useState,\n} from 'react';\nimport {\n type FileStorageItem,\n type FileStorageTable,\n isDirectory,\n} from './FileStorage';\nimport './FileList.scss';\nimport { DEFAULT_ROW_HEIGHT, getMoveOperation } from './FileListUtils';\nimport { FileListItem, type FileListRenderItemProps } from './FileListItem';\n\nconst log = Log.module('FileList');\n\nexport type LoadedViewport = {\n items: FileStorageItem[];\n offset: number;\n itemCount: number;\n};\n\nexport type ListViewport = {\n top: number;\n bottom: number;\n};\n\nexport interface FileListProps {\n table: FileStorageTable;\n\n isMultiSelect?: boolean;\n focusedPath?: string;\n\n onFocusChange?: (focusedItem?: FileStorageItem) => void;\n onMove?: (files: FileStorageItem[], path: string) => void;\n onSelect: (file: FileStorageItem, event: React.SyntheticEvent) => void;\n onSelectionChange?: (selectedItems: FileStorageItem[]) => void;\n\n renderItem?: (props: FileListRenderItemProps) => JSX.Element;\n\n /** Height of each item in the list */\n rowHeight?: number;\n\n overscanCount?: number;\n}\n\n// How long you need to hover over a directory before it expands\nconst DRAG_HOVER_TIMEOUT = 500;\n\nconst ITEM_LIST_CLASS_NAME = 'item-list-scroll-pane';\n\n/**\n * Component that displays and allows interaction with the file system in the provided FileStorageTable.\n */\nexport function FileList(props: FileListProps): JSX.Element {\n const {\n isMultiSelect = false,\n table,\n onFocusChange = () => undefined,\n onMove,\n onSelect,\n onSelectionChange = () => undefined,\n renderItem = FileListItem,\n rowHeight = DEFAULT_ROW_HEIGHT,\n overscanCount = ItemList.DEFAULT_OVERSCAN,\n } = props;\n const [loadedViewport, setLoadedViewport] = useState<LoadedViewport>(() => ({\n items: [],\n offset: 0,\n itemCount: 0,\n }));\n const [viewport, setViewport] = useState<ListViewport>({\n top: 0,\n bottom: 0,\n });\n\n const [dropTargetItem, setDropTargetItem] = useState<FileStorageItem>();\n const [draggedItems, setDraggedItems] = useState<FileStorageItem[]>();\n const [dragPlaceholder, setDragPlaceholder] = useState<HTMLDivElement>();\n const [selectedRanges, setSelectedRanges] = useState([] as Range[]);\n\n const focusedIndex = useRef<number | null>();\n\n const itemList = useRef<ItemList<FileStorageItem>>(null);\n const fileList = useRef<HTMLDivElement>(null);\n\n const getItems = useCallback(\n (ranges: Range[]): FileStorageItem[] => {\n if (ranges.length === 0 || loadedViewport == null) {\n return [];\n }\n\n const items = [] as FileStorageItem[];\n for (let i = 0; i < ranges.length; i += 1) {\n const range = ranges[i];\n for (let j = range[0]; j <= range[1]; j += 1) {\n if (\n j >= loadedViewport.offset &&\n j < loadedViewport.offset + loadedViewport.items.length\n ) {\n items.push(loadedViewport.items[j - loadedViewport.offset]);\n }\n }\n }\n return items;\n },\n [loadedViewport]\n );\n\n const getItem = useCallback(\n (itemIndex: number): FileStorageItem | undefined => {\n const items = getItems([[itemIndex, itemIndex]]);\n if (items.length > 0) {\n return items[0];\n }\n },\n [getItems]\n );\n\n /**\n * Get the placeholder text to show when a drag operation is in progress\n */\n const getDragPlaceholderText = useCallback(() => {\n const count = RangeUtils.count(selectedRanges);\n if (count === 0) {\n return null;\n }\n\n if (count === 1) {\n const index = selectedRanges[0][0];\n const item = getItem(index);\n if (item != null) {\n return item.filename;\n }\n }\n return `${count} items`;\n }, [getItem, selectedRanges]);\n\n /**\n * Drop the currently dragged items at the currently set drop target.\n * If an itemIndex is provided, focus that index after the drop.\n */\n const dropItems = useCallback(\n (itemIndex?: number) => {\n if (!draggedItems || !dropTargetItem) {\n return;\n }\n\n log.debug('dropItems', draggedItems, 'to', itemIndex);\n\n try {\n const { files, targetPath } = getMoveOperation(\n draggedItems,\n dropTargetItem\n );\n onMove?.(files, targetPath);\n if (itemIndex != null) {\n setSelectedRanges([[itemIndex, itemIndex]]);\n itemList.current?.focusItem(itemIndex);\n }\n } catch (err) {\n log.error('Unable to complete move', err);\n }\n },\n [draggedItems, dropTargetItem, onMove]\n );\n\n const handleSelect = useCallback(\n (itemIndex: number, event: React.SyntheticEvent) => {\n const item = loadedViewport.items[itemIndex - loadedViewport.offset];\n if (item !== undefined) {\n log.debug('handleItemClick', item);\n\n onSelect(item, event);\n if (isDirectory(item)) {\n table?.setExpanded(item.filename, !item.isExpanded);\n }\n }\n },\n [loadedViewport, onSelect, table]\n );\n\n const handleItemDragStart = useCallback(\n (itemIndex: number, e: React.DragEvent<HTMLDivElement>) => {\n log.debug2('handleItemDragStart', itemIndex, selectedRanges);\n\n let draggedRanges = selectedRanges;\n if (!RangeUtils.isSelected(selectedRanges, itemIndex)) {\n draggedRanges = [[itemIndex, itemIndex]];\n setSelectedRanges(draggedRanges);\n }\n\n setDraggedItems(getItems(draggedRanges));\n\n // We need to reset reset the mouse state since we steal the drag\n itemList.current?.resetMouseState();\n\n const newDragPlaceholder = document.createElement('div');\n const dndPlaceholderContent = document.createElement('div');\n dndPlaceholderContent.className = 'dnd-placeholder-content';\n dndPlaceholderContent.innerText = getDragPlaceholderText() ?? '';\n newDragPlaceholder.appendChild(dndPlaceholderContent);\n newDragPlaceholder.className = 'file-list-dnd-placeholder';\n document.body.appendChild(newDragPlaceholder);\n e.dataTransfer.setDragImage(newDragPlaceholder, 0, 0);\n e.dataTransfer.effectAllowed = 'move';\n setDragPlaceholder(newDragPlaceholder);\n },\n [getDragPlaceholderText, getItems, selectedRanges]\n );\n\n const handleItemDragOver = useCallback(\n (itemIndex: number, e: React.DragEvent<HTMLDivElement>) => {\n e.preventDefault();\n\n log.debug2('handleItemDragOver', e);\n setDropTargetItem(getItem(itemIndex));\n },\n [getItem]\n );\n\n const handleItemDragEnd = useCallback(\n (itemIndex: number, e: React.DragEvent<HTMLDivElement>) => {\n log.debug('handleItemDragEnd', itemIndex);\n\n dragPlaceholder?.remove();\n\n // Drag end is triggered after drop\n // Also drop isn't triggered if drag end is outside of the list\n setDraggedItems(undefined);\n setDropTargetItem(undefined);\n setDragPlaceholder(undefined);\n },\n [dragPlaceholder]\n );\n\n const handleItemDrop = useCallback(\n (itemIndex: number, e: React.DragEvent<HTMLDivElement>) => {\n dropItems(itemIndex);\n },\n [dropItems]\n );\n\n const handleItemDragExit = useCallback(() => {\n log.debug2('handleItemDragExit');\n setDropTargetItem(undefined);\n }, []);\n\n const handleListDragOver = useCallback(\n (e: React.DragEvent<HTMLDivElement>) => {\n if (\n e.target instanceof Element &&\n e.target.classList.contains(ITEM_LIST_CLASS_NAME)\n ) {\n // Need to prevent default to enable drop\n // https://developer.mozilla.org/en-US/docs/Web/API/HTML_Drag_and_Drop_API/Drag_operations#droptargets\n e.preventDefault();\n\n log.debug2('handleListDragOver', e);\n setDropTargetItem({\n type: 'directory',\n filename: '/',\n basename: '/',\n id: '/',\n });\n }\n },\n []\n );\n\n const handleListDrop = useCallback(\n (e: React.DragEvent<HTMLDivElement>) => {\n if (\n e.target instanceof Element &&\n e.target.classList.contains(ITEM_LIST_CLASS_NAME)\n ) {\n log.debug('handleListDrop');\n dropItems();\n }\n },\n [dropItems]\n );\n\n const handleSelectionChange = useCallback(\n (newSelectedRanges, force = false) => {\n log.debug2('handleSelectionChange', newSelectedRanges);\n if (force === true || newSelectedRanges !== selectedRanges) {\n setSelectedRanges(newSelectedRanges);\n const selectedItems = getItems(newSelectedRanges);\n onSelectionChange(selectedItems);\n }\n },\n [getItems, onSelectionChange, selectedRanges]\n );\n\n const handleFocusChange = useCallback(\n focusIndex => {\n log.debug2('handleFocusChange', focusIndex);\n if (focusIndex != null) {\n const [focusedItem] = getItems([[focusIndex, focusIndex]]);\n onFocusChange(focusedItem);\n } else {\n onFocusChange();\n }\n focusedIndex.current = focusIndex;\n },\n [getItems, onFocusChange]\n );\n\n const handleViewportChange = useCallback(\n (top: number, bottom: number) => {\n log.debug('handleViewportChange', top, bottom);\n if (top !== viewport.top || bottom !== viewport.bottom) {\n setViewport({ top, bottom });\n }\n },\n [viewport]\n );\n\n const isDropTargetValid = useMemo(() => {\n if (!draggedItems || !dropTargetItem) {\n return false;\n }\n\n try {\n getMoveOperation(draggedItems, dropTargetItem);\n log.debug('handleValidateDropTarget true');\n return true;\n } catch (e) {\n log.debug('handleValidateDropTarget false');\n return false;\n }\n }, [draggedItems, dropTargetItem]);\n\n const { focusedPath } = props;\n useEffect(() => {\n if (focusedPath !== undefined) {\n if (focusedPath === '/') {\n table.collapseAll();\n } else {\n table.setExpanded(focusedPath, false);\n table.setExpanded(focusedPath, true);\n }\n }\n }, [table, focusedPath]);\n\n useEffect(\n function updateTableViewport() {\n log.debug('updating table viewport', viewport);\n table?.setViewport({\n top: Math.max(0, viewport.top - overscanCount),\n bottom: viewport.bottom + overscanCount,\n });\n },\n [overscanCount, table, viewport]\n );\n\n // Listen for table updates\n useEffect(\n function setLoadedViewportAndReturnCleanup() {\n const listenerRemover = table.onUpdate(newViewport => {\n setLoadedViewport({\n items: newViewport.items.map(item => ({\n ...item,\n itemName: item.basename,\n })),\n offset: newViewport.offset,\n itemCount: table.size,\n });\n });\n return () => {\n listenerRemover();\n };\n },\n [table]\n );\n\n // if the loadedViewport changes, re-fire the focused\n // item and the selected range items as they could have\n // been updated\n useEffect(\n function updateFocusAndSelection() {\n if (focusedIndex.current != null) {\n handleFocusChange(focusedIndex.current);\n }\n if (selectedRanges.length > 0) {\n // force the update, as the selected range may be the same\n // but the selected items may now be different\n handleSelectionChange(selectedRanges, true);\n }\n },\n [loadedViewport, handleFocusChange, handleSelectionChange, selectedRanges]\n );\n\n // Expand a folder if hovering over it\n useEffect(\n function expandFolderOnHover() {\n if (\n dropTargetItem != null &&\n isDirectory(dropTargetItem) &&\n dropTargetItem.filename !== '/'\n ) {\n const timeout = setTimeout(() => {\n if (!dropTargetItem.isExpanded) {\n table?.setExpanded(dropTargetItem.filename, true);\n }\n }, DRAG_HOVER_TIMEOUT);\n return () => clearTimeout(timeout);\n }\n },\n [dropTargetItem, table]\n );\n\n const renderWrapper = useCallback(\n itemProps =>\n renderItem({\n ...itemProps,\n isDragInProgress: draggedItems != null,\n dropTargetItem,\n draggedItems,\n isDropTargetValid,\n onDragStart: handleItemDragStart,\n onDragEnd: handleItemDragEnd,\n onDragOver: handleItemDragOver,\n onDragExit: handleItemDragExit,\n onDrop: handleItemDrop,\n }),\n [\n handleItemDragEnd,\n handleItemDragExit,\n handleItemDragOver,\n handleItemDragStart,\n handleItemDrop,\n draggedItems,\n dropTargetItem,\n isDropTargetValid,\n renderItem,\n ]\n );\n\n return (\n <div\n ref={fileList}\n className={classNames('file-list', {\n 'is-dragging': draggedItems != null,\n })}\n onDragOver={handleListDragOver}\n onDrop={handleListDrop}\n >\n <ItemList\n ref={itemList}\n items={loadedViewport.items}\n itemCount={loadedViewport.itemCount}\n offset={loadedViewport.offset}\n onFocusChange={handleFocusChange}\n onSelect={handleSelect}\n onSelectionChange={handleSelectionChange}\n onViewportChange={handleViewportChange}\n selectedRanges={selectedRanges}\n renderItem={renderWrapper}\n rowHeight={rowHeight}\n isMultiSelect={isMultiSelect}\n isDragSelect={false}\n isDeselectOnClick={false}\n />\n </div>\n );\n}\n\nexport default FileList;\n"],"mappings":";;;;;AAAA,SAASA,QAAQ,QAAoB,uBAAuB;AAC5D,OAAOC,GAAG,MAAM,gBAAgB;AAChC,SAASC,UAAU,QAAQ,kBAAkB;AAC7C,OAAOC,UAAU,MAAM,YAAY;AACnC,OAAOC,KAAK,IACVC,WAAW,EACXC,SAAS,EACTC,OAAO,EACPC,MAAM,EACNC,QAAQ,QACH,OAAO;AAAC,SAIbC,WAAW;AAAA;AAAA,SAGJC,kBAAkB,EAAEC,gBAAgB;AAAA,SACpCC,YAAY;AAAA,SAAAC,GAAA,IAAAC,IAAA;AAErB,IAAMC,GAAG,GAAGf,GAAG,CAACgB,MAAM,CAAC,UAAU,CAAC;AAgClC;AACA,IAAMC,kBAAkB,GAAG,GAAG;AAE9B,IAAMC,oBAAoB,GAAG,uBAAuB;;AAEpD;AACA;AACA;AACA,OAAO,SAASC,QAAQA,CAACC,KAAoB,EAAe;EAC1D,IAAM;IACJC,aAAa,GAAG,KAAK;IACrBC,KAAK;IACLC,aAAa,GAAGA,CAAA,KAAMC,SAAS;IAC/BC,MAAM;IACNC,QAAQ;IACRC,iBAAiB,GAAGA,CAAA,KAAMH,SAAS;IACnCI,UAAU,GAAGhB,YAAY;IACzBiB,SAAS,GAAGnB,kBAAkB;IAC9BoB,aAAa,GAAG/B,QAAQ,CAACgC;EAC3B,CAAC,GAAGX,KAAK;EACT,IAAM,CAACY,cAAc,EAAEC,iBAAiB,CAAC,GAAGzB,QAAQ,CAAiB,OAAO;IAC1E0B,KAAK,EAAE,EAAE;IACTC,MAAM,EAAE,CAAC;IACTC,SAAS,EAAE;EACb,CAAC,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AW,EAAE;MACjC,aAAa,EAAEyC,YAAY,IAAI;IACjC,CAAC,CAAE;IACHwG,UAAU,EAAE1C,kBAAmB;IAC/B4C,MAAM,EAAEpC,cAAe;IAAAsC,QAAA,eAEvBzI,IAAA,CAACf,QAAQ;MACPuJ,GAAG,EAAEpG,QAAS;MACdhB,KAAK,EAAEF,cAAc,CAACE,KAAM;MAC5BE,SAAS,EAAEJ,cAAc,CAACI,SAAU;MACpCD,MAAM,EAAEH,cAAc,CAACG,MAAO;MAC9BZ,aAAa,EAAEgG,iBAAkB;MACjC7F,QAAQ,EAAEkD,YAAa;MACvBjD,iBAAiB,EAAEuF,qBAAsB;MACzCsC,gBAAgB,EAAE9B,oBAAqB;MACvC3E,cAAc,EAAEA,cAAe;MAC/BnB,UAAU,EAAEkH,aAAc;MAC1BjH,SAAS,EAAEA,SAAU;MACrBR,aAAa,EAAEA,aAAc;MAC7BoI,YAAY,EAAE,KAAM;MACpBC,iBAAiB,EAAE;IAAM,CAC1B;EAAC,CACC,CAAC;AAEV;AAEA,eAAevI,QAAQ","ignoreList":[]}
1
+ {"version":3,"file":"FileList.js","names":["ItemList","Log","RangeUtils","classNames","React","useCallback","useEffect","useMemo","useRef","useState","isDirectory","DEFAULT_ROW_HEIGHT","getMoveOperation","FileListItem","jsx","_jsx","log","module","DRAG_HOVER_TIMEOUT","ITEM_LIST_CLASS_NAME","FileList","props","isMultiSelect","table","onFocusChange","undefined","onMove","onSelect","onSelectionChange","renderItem","rowHeight","overscanCount","DEFAULT_OVERSCAN","loadedViewport","setLoadedViewport","items","offset","itemCount","viewport","setViewport","top","bottom","dropTargetItem","setDropTargetItem","draggedItems","setDraggedItems","dragPlaceholder","setDragPlaceholder","selectedRanges","setSelectedRanges","focusedIndex","itemList","fileList","getItems","ranges","length","i","range","j","push","getItem","itemIndex","getDragPlaceholderText","count","index","item","filename","concat","dropItems","debug","files","targetPath","_itemList$current","current","focusItem","err","error","handleSelect","event","setExpanded","isExpanded","handleItemDragStart","e","_itemList$current2","_getDragPlaceholderTe","debug2","draggedRanges","isSelected","resetMouseState","newDragPlaceholder","document","createElement","dndPlaceholderContent","className","innerText","appendChild","body","dataTransfer","setDragImage","effectAllowed","handleItemDragOver","preventDefault","handleItemDragEnd","remove","handleItemDrop","handleItemDragExit","handleListDragOver","target","Element","classList","contains","type","basename","id","handleListDrop","handleSelectionChange","newSelectedRanges","force","arguments","selectedItems","handleFocusChange","focusIndex","focusedItem","handleViewportChange","isDropTargetValid","focusedPath","collapseAll","updateTableViewport","Math","max","setLoadedViewportAndReturnCleanup","listenerRemover","onUpdate","newViewport","map","_objectSpread","itemName","size","updateFocusAndSelection","expandFolderOnHover","timeout","setTimeout","clearTimeout","renderWrapper","itemProps","isDragInProgress","onDragStart","onDragEnd","onDragOver","onDragExit","onDrop","ref","children","onViewportChange","isDragSelect","isDeselectOnClick"],"sources":["../src/FileList.tsx"],"sourcesContent":["import { ItemList, type Range } from '@deephaven/components';\nimport Log from '@deephaven/log';\nimport { RangeUtils } from '@deephaven/utils';\nimport classNames from 'classnames';\nimport React, {\n useCallback,\n useEffect,\n useMemo,\n useRef,\n useState,\n} from 'react';\nimport {\n type FileStorageItem,\n type FileStorageTable,\n isDirectory,\n} from './FileStorage';\nimport './FileList.scss';\nimport { DEFAULT_ROW_HEIGHT, getMoveOperation } from './FileListUtils';\nimport { FileListItem, type FileListRenderItemProps } from './FileListItem';\n\nconst log = Log.module('FileList');\n\nexport type LoadedViewport = {\n items: FileStorageItem[];\n offset: number;\n itemCount: number;\n};\n\nexport type ListViewport = {\n top: number;\n bottom: number;\n};\n\nexport interface FileListProps {\n table: FileStorageTable;\n\n isMultiSelect?: boolean;\n focusedPath?: string;\n\n onFocusChange?: (focusedItem?: FileStorageItem) => void;\n onMove?: (files: FileStorageItem[], path: string) => void;\n onSelect: (file: FileStorageItem, event: React.SyntheticEvent) => void;\n onSelectionChange?: (selectedItems: FileStorageItem[]) => void;\n\n renderItem?: (props: FileListRenderItemProps) => JSX.Element;\n\n /** Height of each item in the list */\n rowHeight?: number;\n\n overscanCount?: number;\n}\n\n// How long you need to hover over a directory before it expands\nconst DRAG_HOVER_TIMEOUT = 500;\n\nconst ITEM_LIST_CLASS_NAME = 'item-list-scroll-pane';\n\n/**\n * Component that displays and allows interaction with the file system in the provided FileStorageTable.\n */\nexport function FileList(props: FileListProps): JSX.Element {\n const {\n isMultiSelect = false,\n table,\n onFocusChange = () => undefined,\n onMove,\n onSelect,\n onSelectionChange = () => undefined,\n renderItem = FileListItem,\n rowHeight = DEFAULT_ROW_HEIGHT,\n overscanCount = ItemList.DEFAULT_OVERSCAN,\n } = props;\n const [loadedViewport, setLoadedViewport] = useState<LoadedViewport>(() => ({\n items: [],\n offset: 0,\n itemCount: 0,\n }));\n const [viewport, setViewport] = useState<ListViewport>({\n top: 0,\n bottom: 0,\n });\n\n const [dropTargetItem, setDropTargetItem] = useState<FileStorageItem>();\n const [draggedItems, setDraggedItems] = useState<FileStorageItem[]>();\n const [dragPlaceholder, setDragPlaceholder] = useState<HTMLDivElement>();\n const [selectedRanges, setSelectedRanges] = useState([] as Range[]);\n\n const focusedIndex = useRef<number | null>();\n\n const itemList = useRef<ItemList<FileStorageItem>>(null);\n const fileList = useRef<HTMLDivElement>(null);\n\n const getItems = useCallback(\n (ranges: Range[]): FileStorageItem[] => {\n if (ranges.length === 0 || loadedViewport == null) {\n return [];\n }\n\n const items = [] as FileStorageItem[];\n for (let i = 0; i < ranges.length; i += 1) {\n const range = ranges[i];\n for (let j = range[0]; j <= range[1]; j += 1) {\n if (\n j >= loadedViewport.offset &&\n j < loadedViewport.offset + loadedViewport.items.length\n ) {\n items.push(loadedViewport.items[j - loadedViewport.offset]);\n }\n }\n }\n return items;\n },\n [loadedViewport]\n );\n\n const getItem = useCallback(\n (itemIndex: number): FileStorageItem | undefined => {\n const items = getItems([[itemIndex, itemIndex]]);\n if (items.length > 0) {\n return items[0];\n }\n },\n [getItems]\n );\n\n /**\n * Get the placeholder text to show when a drag operation is in progress\n */\n const getDragPlaceholderText = useCallback(() => {\n const count = RangeUtils.count(selectedRanges);\n if (count === 0) {\n return null;\n }\n\n if (count === 1) {\n const index = selectedRanges[0][0];\n const item = getItem(index);\n if (item != null) {\n return item.filename;\n }\n }\n return `${count} items`;\n }, [getItem, selectedRanges]);\n\n /**\n * Drop the currently dragged items at the currently set drop target.\n * If an itemIndex is provided, focus that index after the drop.\n */\n const dropItems = useCallback(\n (itemIndex?: number) => {\n if (!draggedItems || !dropTargetItem) {\n return;\n }\n\n log.debug('dropItems', draggedItems, 'to', itemIndex);\n\n try {\n const { files, targetPath } = getMoveOperation(\n draggedItems,\n dropTargetItem\n );\n onMove?.(files, targetPath);\n if (itemIndex != null) {\n setSelectedRanges([[itemIndex, itemIndex]]);\n itemList.current?.focusItem(itemIndex);\n }\n } catch (err) {\n log.error('Unable to complete move', err);\n }\n },\n [draggedItems, dropTargetItem, onMove]\n );\n\n const handleSelect = useCallback(\n (itemIndex: number, event: React.SyntheticEvent) => {\n const item = loadedViewport.items[itemIndex - loadedViewport.offset];\n if (item !== undefined) {\n log.debug('handleItemClick', item);\n\n onSelect(item, event);\n if (isDirectory(item)) {\n table?.setExpanded(item.filename, !item.isExpanded);\n }\n }\n },\n [loadedViewport, onSelect, table]\n );\n\n const handleItemDragStart = useCallback(\n (itemIndex: number, e: React.DragEvent<HTMLDivElement>) => {\n log.debug2('handleItemDragStart', itemIndex, selectedRanges);\n\n let draggedRanges = selectedRanges;\n if (!RangeUtils.isSelected(selectedRanges, itemIndex)) {\n draggedRanges = [[itemIndex, itemIndex]];\n setSelectedRanges(draggedRanges);\n }\n\n setDraggedItems(getItems(draggedRanges));\n\n // We need to reset reset the mouse state since we steal the drag\n itemList.current?.resetMouseState();\n\n const newDragPlaceholder = document.createElement('div');\n const dndPlaceholderContent = document.createElement('div');\n dndPlaceholderContent.className = 'dnd-placeholder-content';\n dndPlaceholderContent.innerText = getDragPlaceholderText() ?? '';\n newDragPlaceholder.appendChild(dndPlaceholderContent);\n newDragPlaceholder.className = 'file-list-dnd-placeholder';\n document.body.appendChild(newDragPlaceholder);\n e.dataTransfer.setDragImage(newDragPlaceholder, 0, 0);\n e.dataTransfer.effectAllowed = 'move';\n setDragPlaceholder(newDragPlaceholder);\n },\n [getDragPlaceholderText, getItems, selectedRanges]\n );\n\n const handleItemDragOver = useCallback(\n (itemIndex: number, e: React.DragEvent<HTMLDivElement>) => {\n e.preventDefault();\n\n log.debug2('handleItemDragOver', e);\n setDropTargetItem(getItem(itemIndex));\n },\n [getItem]\n );\n\n const handleItemDragEnd = useCallback(\n (itemIndex: number, e: React.DragEvent<HTMLDivElement>) => {\n log.debug('handleItemDragEnd', itemIndex);\n\n dragPlaceholder?.remove();\n\n // Drag end is triggered after drop\n // Also drop isn't triggered if drag end is outside of the list\n setDraggedItems(undefined);\n setDropTargetItem(undefined);\n setDragPlaceholder(undefined);\n },\n [dragPlaceholder]\n );\n\n const handleItemDrop = useCallback(\n (itemIndex: number, e: React.DragEvent<HTMLDivElement>) => {\n dropItems(itemIndex);\n },\n [dropItems]\n );\n\n const handleItemDragExit = useCallback(() => {\n log.debug2('handleItemDragExit');\n setDropTargetItem(undefined);\n }, []);\n\n const handleListDragOver = useCallback(\n (e: React.DragEvent<HTMLDivElement>) => {\n if (\n e.target instanceof Element &&\n e.target.classList.contains(ITEM_LIST_CLASS_NAME)\n ) {\n // Need to prevent default to enable drop\n // https://developer.mozilla.org/en-US/docs/Web/API/HTML_Drag_and_Drop_API/Drag_operations#droptargets\n e.preventDefault();\n\n log.debug2('handleListDragOver', e);\n setDropTargetItem({\n type: 'directory',\n filename: '/',\n basename: '/',\n id: '/',\n });\n }\n },\n []\n );\n\n const handleListDrop = useCallback(\n (e: React.DragEvent<HTMLDivElement>) => {\n if (\n e.target instanceof Element &&\n e.target.classList.contains(ITEM_LIST_CLASS_NAME)\n ) {\n log.debug('handleListDrop');\n dropItems();\n }\n },\n [dropItems]\n );\n\n const handleSelectionChange = useCallback(\n (newSelectedRanges, force = false) => {\n log.debug2('handleSelectionChange', newSelectedRanges);\n if (force === true || newSelectedRanges !== selectedRanges) {\n setSelectedRanges(newSelectedRanges);\n const selectedItems = getItems(newSelectedRanges);\n onSelectionChange(selectedItems);\n }\n },\n [getItems, onSelectionChange, selectedRanges]\n );\n\n const handleFocusChange = useCallback(\n focusIndex => {\n log.debug2('handleFocusChange', focusIndex);\n if (focusIndex != null) {\n const [focusedItem] = getItems([[focusIndex, focusIndex]]);\n onFocusChange(focusedItem);\n } else {\n onFocusChange();\n }\n focusedIndex.current = focusIndex;\n },\n [getItems, onFocusChange]\n );\n\n const handleViewportChange = useCallback(\n (top: number, bottom: number) => {\n log.debug('handleViewportChange', top, bottom);\n if (top !== viewport.top || bottom !== viewport.bottom) {\n setViewport({ top, bottom });\n }\n },\n [viewport]\n );\n\n const isDropTargetValid = useMemo(() => {\n if (!draggedItems || !dropTargetItem) {\n return false;\n }\n\n try {\n getMoveOperation(draggedItems, dropTargetItem);\n log.debug('handleValidateDropTarget true');\n return true;\n } catch (e) {\n log.debug('handleValidateDropTarget false');\n return false;\n }\n }, [draggedItems, dropTargetItem]);\n\n const { focusedPath } = props;\n useEffect(() => {\n if (focusedPath !== undefined) {\n if (focusedPath === '/') {\n table.collapseAll();\n } else {\n table.setExpanded(focusedPath, false);\n table.setExpanded(focusedPath, true);\n }\n }\n }, [table, focusedPath]);\n\n useEffect(\n function updateTableViewport() {\n log.debug('updating table viewport', viewport);\n table?.setViewport({\n top: Math.max(0, viewport.top - overscanCount),\n bottom: viewport.bottom + overscanCount,\n });\n },\n [overscanCount, table, viewport]\n );\n\n // Listen for table updates\n useEffect(\n function setLoadedViewportAndReturnCleanup() {\n const listenerRemover = table.onUpdate(newViewport => {\n setLoadedViewport({\n items: newViewport.items.map(item => ({\n ...item,\n itemName: item.basename,\n })),\n offset: newViewport.offset,\n itemCount: table.size,\n });\n });\n return () => {\n listenerRemover();\n };\n },\n [table]\n );\n\n // if the loadedViewport changes, re-fire the focused\n // item and the selected range items as they could have\n // been updated\n useEffect(\n function updateFocusAndSelection() {\n if (focusedIndex.current != null) {\n handleFocusChange(focusedIndex.current);\n }\n if (selectedRanges.length > 0) {\n // force the update, as the selected range may be the same\n // but the selected items may now be different\n handleSelectionChange(selectedRanges, true);\n }\n },\n [loadedViewport, handleFocusChange, handleSelectionChange, selectedRanges]\n );\n\n // Expand a folder if hovering over it\n useEffect(\n function expandFolderOnHover() {\n if (\n dropTargetItem != null &&\n isDirectory(dropTargetItem) &&\n dropTargetItem.filename !== '/'\n ) {\n const timeout = setTimeout(() => {\n if (!dropTargetItem.isExpanded) {\n table?.setExpanded(dropTargetItem.filename, true);\n }\n }, DRAG_HOVER_TIMEOUT);\n return () => clearTimeout(timeout);\n }\n },\n [dropTargetItem, table]\n );\n\n const renderWrapper = useCallback(\n itemProps =>\n renderItem({\n ...itemProps,\n isDragInProgress: draggedItems != null,\n dropTargetItem,\n draggedItems,\n isDropTargetValid,\n onDragStart: handleItemDragStart,\n onDragEnd: handleItemDragEnd,\n onDragOver: handleItemDragOver,\n onDragExit: handleItemDragExit,\n onDrop: handleItemDrop,\n }),\n [\n handleItemDragEnd,\n handleItemDragExit,\n handleItemDragOver,\n handleItemDragStart,\n handleItemDrop,\n draggedItems,\n dropTargetItem,\n isDropTargetValid,\n renderItem,\n ]\n );\n\n return (\n <div\n ref={fileList}\n className={classNames('file-list', {\n 'is-dragging': draggedItems != null,\n })}\n onDragOver={handleListDragOver}\n onDrop={handleListDrop}\n >\n <ItemList\n ref={itemList}\n items={loadedViewport.items}\n itemCount={loadedViewport.itemCount}\n offset={loadedViewport.offset}\n onFocusChange={handleFocusChange}\n onSelect={handleSelect}\n onSelectionChange={handleSelectionChange}\n onViewportChange={handleViewportChange}\n selectedRanges={selectedRanges}\n renderItem={renderWrapper}\n rowHeight={rowHeight}\n isMultiSelect={isMultiSelect}\n isDragSelect={false}\n isDeselectOnClick={false}\n />\n </div>\n );\n}\n\nexport default FileList;\n"],"mappings":";;;;;AAA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Ac,CAACI,SAAU;MACpCD,MAAM,EAAEH,cAAc,CAACG,MAAO;MAC9BZ,aAAa,EAAEgG,iBAAkB;MACjC7F,QAAQ,EAAEkD,YAAa;MACvBjD,iBAAiB,EAAEuF,qBAAsB;MACzCsC,gBAAgB,EAAE9B,oBAAqB;MACvC3E,cAAc,EAAEA,cAAe;MAC/BnB,UAAU,EAAEkH,aAAc;MAC1BjH,SAAS,EAAEA,SAAU;MACrBR,aAAa,EAAEA,aAAc;MAC7BoI,YAAY,EAAE,KAAM;MACpBC,iBAAiB,EAAE;IAAM,CAC1B;EAAC,CACC,CAAC;AAEV;AAEA,eAAevI,QAAQ"}
@@ -1 +1 @@
1
- {"version":3,"file":"FileListContainer.js","names":["ContextActions","assertNotNull","React","useCallback","useMemo","useState","FileList","FileListItem","DEFAULT_ROW_HEIGHT","isDirectory","SHORTCUTS","FileUtils","FileListItemEditor","jsx","_jsx","jsxs","_jsxs","FileListContainer","props","isMultiSelect","focusedPath","showContextMenu","onCreateFile","onCreateFolder","onCopy","onDelete","onMove","onRename","onSelect","onSelectionChange","table","rowHeight","validateRename","Promise","resolve","renameItem","setRenameItem","selectedItems","setSelectedItems","focusedItem","setFocusedItem","handleSelectionChange","newSelectedItems","handleFocusChange","newFocusedItem","handleCopyAction","handleDeleteAction","length","handleNewFileAction","handleNewFolderAction","getPath","filename","handleRenameAction","handleRenameCancel","undefined","handleRenameSubmit","newName","actions","result","push","title","description","action","group","groups","medium","low","disabled","shortcut","FILE_EXPLORER","DELETE","RENAME","validateRenameItem","renderItem","itemProps","item","_objectSpread","children","validate","onSubmit","onCancel","className","onFocusChange","displayName"],"sources":["../src/FileListContainer.tsx"],"sourcesContent":["import { type ContextAction, ContextActions } from '@deephaven/components';\nimport { assertNotNull } from '@deephaven/utils';\nimport React, { useCallback, useMemo, useState } from 'react';\nimport FileList from './FileList';\nimport { FileListItem, type FileListRenderItemProps } from './FileListItem';\nimport { DEFAULT_ROW_HEIGHT } from './FileListUtils';\nimport {\n type FileStorageItem,\n type FileStorageTable,\n isDirectory,\n} from './FileStorage';\nimport SHORTCUTS from './FileExplorerShortcuts';\nimport './FileExplorer.scss';\nimport FileUtils from './FileUtils';\nimport FileListItemEditor from './FileListItemEditor';\n\nexport interface FileListContainerProps {\n showContextMenu?: boolean;\n table: FileStorageTable;\n\n isMultiSelect?: boolean;\n focusedPath?: string;\n\n onCreateFile?: (path?: string) => void;\n onCreateFolder?: (path?: string) => void;\n onCopy?: (file: FileStorageItem) => void;\n onDelete?: (files: FileStorageItem[]) => void;\n onMove?: (files: FileStorageItem[], path: string) => void;\n onRename?: (file: FileStorageItem, newName: string) => void;\n onSelect: (file: FileStorageItem, event: React.SyntheticEvent) => void;\n validateRename?: (file: FileStorageItem, newName: string) => Promise<void>;\n onSelectionChange?: (selectedItems: FileStorageItem[]) => void;\n\n /** Height of each item in the list */\n rowHeight?: number;\n}\n\n/**\n * Component that displays and allows interaction with the file system in the provided FileStorage.\n */\nexport function FileListContainer(props: FileListContainerProps): JSX.Element {\n const {\n isMultiSelect = false,\n focusedPath,\n showContextMenu = false,\n onCreateFile,\n onCreateFolder,\n onCopy,\n onDelete,\n onMove,\n onRename,\n onSelect,\n onSelectionChange,\n table,\n rowHeight = DEFAULT_ROW_HEIGHT,\n validateRename = () => Promise.resolve(),\n } = props;\n const [renameItem, setRenameItem] = useState<FileStorageItem>();\n const [selectedItems, setSelectedItems] = useState([] as FileStorageItem[]);\n const [focusedItem, setFocusedItem] = useState<FileStorageItem>();\n\n const handleSelectionChange = useCallback(\n newSelectedItems => {\n setSelectedItems(newSelectedItems);\n onSelectionChange?.(newSelectedItems);\n },\n [onSelectionChange]\n );\n\n const handleFocusChange = useCallback(newFocusedItem => {\n setFocusedItem(newFocusedItem);\n }, []);\n\n const handleCopyAction = useCallback(() => {\n if (focusedItem) {\n onCopy?.(focusedItem);\n }\n }, [focusedItem, onCopy]);\n\n const handleDeleteAction = useCallback(() => {\n if (selectedItems.length > 0) {\n onDelete?.(selectedItems);\n }\n }, [onDelete, selectedItems]);\n\n const handleNewFileAction = useCallback(() => {\n onCreateFile?.();\n }, [onCreateFile]);\n\n const handleNewFolderAction = useCallback(() => {\n if (focusedItem) {\n onCreateFolder?.(FileUtils.getPath(focusedItem.filename));\n }\n }, [focusedItem, onCreateFolder]);\n\n const handleRenameAction = useCallback(() => {\n if (focusedItem) {\n setRenameItem(focusedItem);\n }\n }, [focusedItem]);\n\n const handleRenameCancel = useCallback((): void => {\n setRenameItem(undefined);\n }, []);\n\n const handleRenameSubmit = useCallback(\n (newName: string): void => {\n if (renameItem) {\n onRename?.(renameItem, newName);\n setRenameItem(undefined);\n }\n },\n [onRename, renameItem]\n );\n\n const actions = useMemo(() => {\n if (renameItem) {\n // While renaming, we don't want to enable any of the context actions or it may interfere with renaming input\n return [];\n }\n\n const result = [] as ContextAction[];\n if (onCreateFile) {\n result.push({\n title: 'New File',\n description: 'Create new file',\n action: handleNewFileAction,\n group: ContextActions.groups.medium,\n });\n }\n if (onCreateFolder) {\n result.push({\n title: 'New Folder',\n description: 'Create new folder',\n action: handleNewFolderAction,\n group: ContextActions.groups.medium,\n });\n }\n if (onCopy) {\n result.push({\n title: 'Copy File',\n description: 'Copy the selected file',\n action: handleCopyAction,\n group: ContextActions.groups.low,\n disabled: focusedItem == null || isDirectory(focusedItem),\n });\n }\n if (onDelete && selectedItems.length > 0) {\n result.push({\n title: 'Delete',\n description: 'Delete',\n shortcut: SHORTCUTS.FILE_EXPLORER.DELETE,\n action: handleDeleteAction,\n group: ContextActions.groups.low,\n });\n }\n if (onRename) {\n result.push({\n title: 'Rename',\n description: 'Rename',\n shortcut: SHORTCUTS.FILE_EXPLORER.RENAME,\n action: handleRenameAction,\n group: ContextActions.groups.low,\n disabled: focusedItem == null,\n });\n }\n return result;\n }, [\n handleCopyAction,\n handleDeleteAction,\n handleNewFileAction,\n handleNewFolderAction,\n handleRenameAction,\n focusedItem,\n onCopy,\n onCreateFile,\n onCreateFolder,\n onDelete,\n onRename,\n selectedItems,\n renameItem,\n ]);\n\n const validateRenameItem = useCallback(\n (newName: string): Promise<void> => {\n assertNotNull(renameItem);\n return validateRename(renameItem, newName);\n },\n [renameItem, validateRename]\n );\n\n const renderItem = useCallback(\n (itemProps: FileListRenderItemProps): JSX.Element => {\n const { item } = itemProps;\n if (renameItem && renameItem.filename === item.filename) {\n return (\n // eslint-disable-next-line react/jsx-props-no-spreading\n <FileListItem {...itemProps}>\n <FileListItemEditor\n item={item}\n validate={validateRenameItem}\n onSubmit={handleRenameSubmit}\n onCancel={handleRenameCancel}\n />\n </FileListItem>\n );\n }\n // eslint-disable-next-line react/jsx-props-no-spreading\n return <FileListItem {...itemProps} />;\n },\n [handleRenameCancel, handleRenameSubmit, renameItem, validateRenameItem]\n );\n\n return (\n <div className=\"file-list-container\">\n {table != null && (\n <FileList\n onMove={onMove}\n onSelect={onSelect}\n onSelectionChange={handleSelectionChange}\n onFocusChange={handleFocusChange}\n renderItem={renderItem}\n rowHeight={rowHeight}\n table={table}\n isMultiSelect={isMultiSelect}\n focusedPath={focusedPath}\n />\n )}\n {showContextMenu && <ContextActions actions={actions} />}\n </div>\n );\n}\n\nFileListContainer.displayName = 'FileListContainer';\n\nexport default FileListContainer;\n"],"mappings":";;;;;AAAA,SAA6BA,cAAc,QAAQ,uBAAuB;AAC1E,SAASC,aAAa,QAAQ,kBAAkB;AAChD,OAAOC,KAAK,IAAIC,WAAW,EAAEC,OAAO,EAAEC,QAAQ,QAAQ,OAAO;AAAC,OACvDC,QAAQ;AAAA,SACNC,YAAY;AAAA,SACZC,kBAAkB;AAAA,SAIzBC,WAAW;AAAA,OAENC,SAAS;AAAA;AAAA,OAETC,SAAS;AAAA,OACTC,kBAAkB;AAAA,SAAAC,GAAA,IAAAC,IAAA;AAAA,SAAAC,IAAA,IAAAC,KAAA;AAuBzB;AACA;AACA;AACA,OAAO,SAASC,iBAAiBA,CAACC,KAA6B,EAAe;EAC5E,IAAM;IACJC,aAAa,GAAG,KAAK;IACrBC,W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AEA,UAAW;MACvB1C,SAAS,EAAEA,SAAU;MACrBD,KAAK,EAAEA,KAAM;MACbX,aAAa,EAAEA,aAAc;MAC7BC,WAAW,EAAEA;IAAY,CAC1B,CACF,EACAC,eAAe,iBAAIP,IAAA,CAACd,cAAc;MAACyD,OAAO,EAAEA;IAAQ,CAAE,CAAC;EAAA,CACrD,CAAC;AAEV;AAEAxC,iBAAiB,CAACkE,WAAW,GAAG,mBAAmB;AAEnD,eAAelE,iBAAiB","ignoreList":[]}
1
+ {"version":3,"file":"FileListContainer.js","names":["ContextActions","assertNotNull","React","useCallback","useMemo","useState","FileList","FileListItem","DEFAULT_ROW_HEIGHT","isDirectory","SHORTCUTS","FileUtils","FileListItemEditor","jsx","_jsx","jsxs","_jsxs","FileListContainer","props","isMultiSelect","focusedPath","showContextMenu","onCreateFile","onCreateFolder","onCopy","onDelete","onMove","onRename","onSelect","onSelectionChange","table","rowHeight","validateRename","Promise","resolve","renameItem","setRenameItem","selectedItems","setSelectedItems","focusedItem","setFocusedItem","handleSelectionChange","newSelectedItems","handleFocusChange","newFocusedItem","handleCopyAction","handleDeleteAction","length","handleNewFileAction","handleNewFolderAction","getPath","filename","handleRenameAction","handleRenameCancel","undefined","handleRenameSubmit","newName","actions","result","push","title","description","action","group","groups","medium","low","disabled","shortcut","FILE_EXPLORER","DELETE","RENAME","validateRenameItem","renderItem","itemProps","item","_objectSpread","children","validate","onSubmit","onCancel","className","onFocusChange","displayName"],"sources":["../src/FileListContainer.tsx"],"sourcesContent":["import { type ContextAction, ContextActions } from '@deephaven/components';\nimport { assertNotNull } from '@deephaven/utils';\nimport React, { useCallback, useMemo, useState } from 'react';\nimport FileList from './FileList';\nimport { FileListItem, type FileListRenderItemProps } from './FileListItem';\nimport { DEFAULT_ROW_HEIGHT } from './FileListUtils';\nimport {\n type FileStorageItem,\n type FileStorageTable,\n isDirectory,\n} from './FileStorage';\nimport SHORTCUTS from './FileExplorerShortcuts';\nimport './FileExplorer.scss';\nimport FileUtils from './FileUtils';\nimport FileListItemEditor from './FileListItemEditor';\n\nexport interface FileListContainerProps {\n showContextMenu?: boolean;\n table: FileStorageTable;\n\n isMultiSelect?: boolean;\n focusedPath?: string;\n\n onCreateFile?: (path?: string) => void;\n onCreateFolder?: (path?: string) => void;\n onCopy?: (file: FileStorageItem) => void;\n onDelete?: (files: FileStorageItem[]) => void;\n onMove?: (files: FileStorageItem[], path: string) => void;\n onRename?: (file: FileStorageItem, newName: string) => void;\n onSelect: (file: FileStorageItem, event: React.SyntheticEvent) => void;\n validateRename?: (file: FileStorageItem, newName: string) => Promise<void>;\n onSelectionChange?: (selectedItems: FileStorageItem[]) => void;\n\n /** Height of each item in the list */\n rowHeight?: number;\n}\n\n/**\n * Component that displays and allows interaction with the file system in the provided FileStorage.\n */\nexport function FileListContainer(props: FileListContainerProps): JSX.Element {\n const {\n isMultiSelect = false,\n focusedPath,\n showContextMenu = false,\n onCreateFile,\n onCreateFolder,\n onCopy,\n onDelete,\n onMove,\n onRename,\n onSelect,\n onSelectionChange,\n table,\n rowHeight = DEFAULT_ROW_HEIGHT,\n validateRename = () => Promise.resolve(),\n } = props;\n const [renameItem, setRenameItem] = useState<FileStorageItem>();\n const [selectedItems, setSelectedItems] = useState([] as FileStorageItem[]);\n const [focusedItem, setFocusedItem] = useState<FileStorageItem>();\n\n const handleSelectionChange = useCallback(\n newSelectedItems => {\n setSelectedItems(newSelectedItems);\n onSelectionChange?.(newSelectedItems);\n },\n [onSelectionChange]\n );\n\n const handleFocusChange = useCallback(newFocusedItem => {\n setFocusedItem(newFocusedItem);\n }, []);\n\n const handleCopyAction = useCallback(() => {\n if (focusedItem) {\n onCopy?.(focusedItem);\n }\n }, [focusedItem, onCopy]);\n\n const handleDeleteAction = useCallback(() => {\n if (selectedItems.length > 0) {\n onDelete?.(selectedItems);\n }\n }, [onDelete, selectedItems]);\n\n const handleNewFileAction = useCallback(() => {\n onCreateFile?.();\n }, [onCreateFile]);\n\n const handleNewFolderAction = useCallback(() => {\n if (focusedItem) {\n onCreateFolder?.(FileUtils.getPath(focusedItem.filename));\n }\n }, [focusedItem, onCreateFolder]);\n\n const handleRenameAction = useCallback(() => {\n if (focusedItem) {\n setRenameItem(focusedItem);\n }\n }, [focusedItem]);\n\n const handleRenameCancel = useCallback((): void => {\n setRenameItem(undefined);\n }, []);\n\n const handleRenameSubmit = useCallback(\n (newName: string): void => {\n if (renameItem) {\n onRename?.(renameItem, newName);\n setRenameItem(undefined);\n }\n },\n [onRename, renameItem]\n );\n\n const actions = useMemo(() => {\n if (renameItem) {\n // While renaming, we don't want to enable any of the context actions or it may interfere with renaming input\n return [];\n }\n\n const result = [] as ContextAction[];\n if (onCreateFile) {\n result.push({\n title: 'New File',\n description: 'Create new file',\n action: handleNewFileAction,\n group: ContextActions.groups.medium,\n });\n }\n if (onCreateFolder) {\n result.push({\n title: 'New Folder',\n description: 'Create new folder',\n action: handleNewFolderAction,\n group: ContextActions.groups.medium,\n });\n }\n if (onCopy) {\n result.push({\n title: 'Copy File',\n description: 'Copy the selected file',\n action: handleCopyAction,\n group: ContextActions.groups.low,\n disabled: focusedItem == null || isDirectory(focusedItem),\n });\n }\n if (onDelete && selectedItems.length > 0) {\n result.push({\n title: 'Delete',\n description: 'Delete',\n shortcut: SHORTCUTS.FILE_EXPLORER.DELETE,\n action: handleDeleteAction,\n group: ContextActions.groups.low,\n });\n }\n if (onRename) {\n result.push({\n title: 'Rename',\n description: 'Rename',\n shortcut: SHORTCUTS.FILE_EXPLORER.RENAME,\n action: handleRenameAction,\n group: ContextActions.groups.low,\n disabled: focusedItem == null,\n });\n }\n return result;\n }, [\n handleCopyAction,\n handleDeleteAction,\n handleNewFileAction,\n handleNewFolderAction,\n handleRenameAction,\n focusedItem,\n onCopy,\n onCreateFile,\n onCreateFolder,\n onDelete,\n onRename,\n selectedItems,\n renameItem,\n ]);\n\n const validateRenameItem = useCallback(\n (newName: string): Promise<void> => {\n assertNotNull(renameItem);\n return validateRename(renameItem, newName);\n },\n [renameItem, validateRename]\n );\n\n const renderItem = useCallback(\n (itemProps: FileListRenderItemProps): JSX.Element => {\n const { item } = itemProps;\n if (renameItem && renameItem.filename === item.filename) {\n return (\n // eslint-disable-next-line react/jsx-props-no-spreading\n <FileListItem {...itemProps}>\n <FileListItemEditor\n item={item}\n validate={validateRenameItem}\n onSubmit={handleRenameSubmit}\n onCancel={handleRenameCancel}\n />\n </FileListItem>\n );\n }\n // eslint-disable-next-line react/jsx-props-no-spreading\n return <FileListItem {...itemProps} />;\n },\n [handleRenameCancel, handleRenameSubmit, renameItem, validateRenameItem]\n );\n\n return (\n <div className=\"file-list-container\">\n {table != null && (\n <FileList\n onMove={onMove}\n onSelect={onSelect}\n onSelectionChange={handleSelectionChange}\n onFocusChange={handleFocusChange}\n renderItem={renderItem}\n rowHeight={rowHeight}\n table={table}\n isMultiSelect={isMultiSelect}\n focusedPath={focusedPath}\n />\n )}\n {showContextMenu && <ContextActions actions={actions} />}\n </div>\n );\n}\n\nFileListContainer.displayName = 'FileListContainer';\n\nexport default FileListContainer;\n"],"mappings":";;;;;AAAA,SAA6BA,cAAc,QAAQ,uBAAuB;AAC1E,SAASC,aAAa,QAAQ,kBAAkB;AAChD,OAAOC,KAAK,IAAIC,WAAW,EAAEC,OAAO,EAAEC,QAAQ,QAAQ,OAAO;AAAC,OACvDC,QAAQ;AAAA,SACNC,YAAY;AAAA,SACZC,kBAAkB;AAAA,SAIzBC,WAAW;AAAA,OAENC,SAAS;AAAA;AAAA,OAETC,SAAS;AAAA,OACTC,kBAAkB;AAAA,SAAAC,GAAA,IAAAC,IAAA;AAAA,SAAAC,IAAA,IAAAC,KAAA;AAuBzB;AACA;AACA;AACA,OAAO,SAASC,iBAAiBA,CAACC,KAA6B,EAAe;EAC5E,IAAM;IACJC,aAAa,GAAG,KAAK;IACrBC,WAAW;IACXC,eAAe,GAAG,KAAK;IACvBC,YAAY;IACZC,cAAc;IACdC,MAAM;IACNC,QAAQ;IACRC,MAAM;IACNC,QAAQ;IAC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AEA;IAAY,CAC1B,CACF,EACAC,eAAe,iBAAIP,IAAA,CAACd,cAAc;MAACyD,OAAO,EAAEA;IAAQ,CAAE,CAAC;EAAA,CACrD,CAAC;AAEV;AAEAxC,iBAAiB,CAACkE,WAAW,GAAG,mBAAmB;AAEnD,eAAelE,iBAAiB"}
@@ -1 +1 @@
1
- {"version":3,"file":"FileListItem.js","names":["React","Tooltip","dhPython","vsCode","vsFolder","vsFolderOpened","FontAwesomeIcon","classNames","isDirectory","FileUtils","MIME_TYPE","getPathFromItem","jsx","_jsx","Fragment","_Fragment","jsxs","_jsxs","getItemIcon","item","isExpanded","mimeType","getMimeType","basename","PYTHON","FileListItem","props","_draggedItems$some","children","draggedItems","isDragInProgress","isDropTargetValid","isSelected","itemIndex","dropTargetItem","onDragStart","onDragOver","onDragEnd","onDrop","isDragged","some","draggedItem","id","itemPath","dropTargetPath","isExactDropTarget","isInDropTarget","isInvalidDropTarget","icon","depth","getDepth","filename","depthLines","Array","fill","map","value","index","className","e","draggable","role","fixedWidth"],"sources":["../src/FileListItem.tsx"],"sourcesContent":["import React from 'react';\nimport { Tooltip, type RenderItemProps } from '@deephaven/components';\nimport { dhPython, vsCode, vsFolder, vsFolderOpened } from '@deephaven/icons';\nimport { type IconDefinition } from '@fortawesome/fontawesome-svg-core';\nimport { FontAwesomeIcon } from '@fortawesome/react-fontawesome';\nimport classNames from 'classnames';\nimport { type FileStorageItem, isDirectory } from './FileStorage';\nimport './FileList.scss';\nimport FileUtils, { MIME_TYPE } from './FileUtils';\nimport { getPathFromItem } from './FileListUtils';\n\n/**\n * Get the icon definition for a file or folder item\n * @param item Item to get the icon for\n * @returns Icon definition to pass in the FontAwesomeIcon icon prop\n */\nfunction getItemIcon(item: FileStorageItem): IconDefinition {\n if (isDirectory(item)) {\n return item.isExpanded ? vsFolderOpened : vsFolder;\n }\n const mimeType = FileUtils.getMimeType(item.basename);\n switch (mimeType) {\n case MIME_TYPE.PYTHON:\n return dhPython;\n default:\n return vsCode;\n }\n}\n\nexport type FileListRenderItemProps = RenderItemProps<FileStorageItem> & {\n children?: JSX.Element;\n dropTargetItem?: FileStorageItem;\n draggedItems?: FileStorageItem[];\n isDragInProgress: boolean;\n isDropTargetValid: boolean;\n\n onDragStart: (index: number, e: React.DragEvent<HTMLDivElement>) => void;\n onDragOver: (index: number, e: React.DragEvent<HTMLDivElement>) => void;\n onDragEnd: (index: number, e: React.DragEvent<HTMLDivElement>) => void;\n onDrop: (index: number, e: React.DragEvent<HTMLDivElement>) => void;\n};\n\nexport function FileListItem(props: FileListRenderItemProps): JSX.Element {\n const {\n children,\n draggedItems,\n isDragInProgress,\n isDropTargetValid,\n isSelected,\n item,\n itemIndex,\n dropTargetItem,\n onDragStart,\n onDragOver,\n onDragEnd,\n onDrop,\n } = props;\n\n const isDragged =\n draggedItems?.some(draggedItem => draggedItem.id === item.id) ?? false;\n const itemPath = getPathFromItem(item);\n const dropTargetPath =\n isDragInProgress && dropTargetItem ? getPathFromItem(dropTargetItem) : null;\n\n const isExactDropTarget =\n isDragInProgress &&\n isDropTargetValid &&\n isDirectory(item) &&\n dropTargetPath === itemPath;\n const isInDropTarget =\n isDragInProgress && isDropTargetValid && dropTargetPath === itemPath;\n const isInvalidDropTarget =\n isDragInProgress && !isDropTargetValid && dropTargetPath === itemPath;\n\n const icon = getItemIcon(item);\n const depth = FileUtils.getDepth(item.filename);\n const depthLines = Array(depth)\n .fill(null)\n .map((value, index) => (\n // eslint-disable-next-line react/no-array-index-key\n <span className=\"file-list-depth-line\" key={index} />\n ));\n\n return (\n <div\n className={classNames(\n 'd-flex w-100 align-items-center',\n 'file-list-item',\n {\n 'is-dragged': isDragged,\n 'is-exact-drop-target': isExactDropTarget,\n 'is-in-drop-target': isInDropTarget,\n 'is-invalid-drop-target': isInvalidDropTarget,\n 'is-selected': isSelected,\n }\n )}\n onDragStart={e => onDragStart(itemIndex, e)}\n onDragOver={e => onDragOver(itemIndex, e)}\n onDragEnd={e => onDragEnd(itemIndex, e)}\n onDrop={e => onDrop(itemIndex, e)}\n draggable\n role=\"presentation\"\n aria-label={item.basename}\n >\n {depthLines}{' '}\n <FontAwesomeIcon icon={icon} className=\"item-icon\" fixedWidth />{' '}\n <span className=\"truncation-wrapper\">\n {children ?? (\n <>\n {item.basename}\n <Tooltip>{item.basename}</Tooltip>\n </>\n )}\n </span>\n </div>\n );\n}\n\nexport default FileListItem;\n"],"mappings":"AAAA,OAAOA,KAAK,MAAM,OAAO;AACzB,SAASC,OAAO,QAA8B,uBAAuB;AACrE,SAASC,QAAQ,EAAEC,MAAM,EAAEC,QAAQ,EAAEC,cAAc,QAAQ,kBAAkB;AAE7E,SAASC,eAAe,QAAQ,gCAAgC;AAChE,OAAOC,UAAU,MAAM,YAAY;AAAC,SACLC,WAAW;AAAA;AAAA,OAEnCC,SAAS,IAAIC,SAAS;AAAA,SACpBC,eAAe;AAExB;AACA;AACA;AACA;AACA;AAJA,SAAAC,GAAA,IAAAC,IAAA;AAAA,SAAAC,QAAA,IAAAC,SAAA;AAAA,SAAAC,IAAA,IAAAC,KAAA;AAKA,SAASC,WAAWA,CAACC,IAAqB,EAAkB;EAC1D,IAAIX,WAAW,CAACW,IAAI,CAAC,EAAE;IACrB,OAAOA,IAAI,CAACC,UAAU,GAAGf,cAAc,GAAGD,QAAQ;EACpD;EACA,IAAMiB,QAAQ,GAAGZ,SAAS,CAACa,WAAW,CAACH,IAAI,CAACI,QAAQ,CAAC;EACrD,QAAQF,QAAQ;IACd,KAAKX,SAAS,CAACc,MAAM;MACnB,OAAOtB,QAAQ;IACjB;MACE,OAAOC,MAAM;EACjB;AACF;AAeA,OAAO,SAASsB,YAAYA,CAACC,KAA8B,EAAe;EAAA,IAAAC,kBAAA;EACxE,IAAM;IACJC,QAAQ;IACRC,YAAY;IACZC,gBAAgB;IAChBC,iBAAiB;IACjBC,UAAU;IACVb,IAAI;IACJc,SAAS;IACTC,cAAc;IACdC,WAAW,EAAXA,YAAW;IACXC,UAAU,EAAVA,WAAU;I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AAmB;MAC7C,aAAa,EAAEf;IACjB,CACF,CAAE;IACFG,WAAW,EAAEwB,CAAC,IAAIxB,YAAW,CAACF,SAAS,EAAE0B,CAAC,CAAE;IAC5CvB,UAAU,EAAEuB,CAAC,IAAIvB,WAAU,CAACH,SAAS,EAAE0B,CAAC,CAAE;IAC1CtB,SAAS,EAAEsB,CAAC,IAAItB,UAAS,CAACJ,SAAS,EAAE0B,CAAC,CAAE;IACxCrB,MAAM,EAAEqB,CAAC,IAAIrB,OAAM,CAACL,SAAS,EAAE0B,CAAC,CAAE;IAClCC,SAAS;IACTC,IAAI,EAAC,cAAc;IACnB,cAAY1C,IAAI,CAACI,QAAS;IAAAK,QAAA,GAEzBwB,UAAU,EAAE,GAAG,eAChBvC,IAAA,CAACP,eAAe;MAAC0C,IAAI,EAAEA,IAAK;MAACU,SAAS,EAAC,WAAW;MAACI,UAAU;IAAA,CAAE,CAAC,EAAC,GAAG,eACpEjD,IAAA;MAAM6C,SAAS,EAAC,oBAAoB;MAAA9B,QAAA,EACjCA,QAAQ,aAARA,QAAQ,cAARA,QAAQ,gBACPX,KAAA,CAAAF,SAAA;QAAAa,QAAA,GACGT,IAAI,CAACI,QAAQ,eACdV,IAAA,CAACZ,OAAO;UAAA2B,QAAA,EAAET,IAAI,CAACI;QAAQ,CAAU,CAAC;MAAA,CAClC;IAAC,CAED,CAAC;EAAA,CACJ,CAAC;AAEV;AAEA,eAAeE,YAAY","ignoreList":[]}
1
+ {"version":3,"file":"FileListItem.js","names":["React","Tooltip","dhPython","vsCode","vsFolder","vsFolderOpened","FontAwesomeIcon","classNames","isDirectory","FileUtils","MIME_TYPE","getPathFromItem","jsx","_jsx","Fragment","_Fragment","jsxs","_jsxs","getItemIcon","item","isExpanded","mimeType","getMimeType","basename","PYTHON","FileListItem","props","_draggedItems$some","children","draggedItems","isDragInProgress","isDropTargetValid","isSelected","itemIndex","dropTargetItem","onDragStart","onDragOver","onDragEnd","onDrop","isDragged","some","draggedItem","id","itemPath","dropTargetPath","isExactDropTarget","isInDropTarget","isInvalidDropTarget","icon","depth","getDepth","filename","depthLines","Array","fill","map","value","index","className","e","draggable","role","fixedWidth"],"sources":["../src/FileListItem.tsx"],"sourcesContent":["import React from 'react';\nimport { Tooltip, type RenderItemProps } from '@deephaven/components';\nimport { dhPython, vsCode, vsFolder, vsFolderOpened } from '@deephaven/icons';\nimport { type IconDefinition } from '@fortawesome/fontawesome-svg-core';\nimport { FontAwesomeIcon } from '@fortawesome/react-fontawesome';\nimport classNames from 'classnames';\nimport { type FileStorageItem, isDirectory } from './FileStorage';\nimport './FileList.scss';\nimport FileUtils, { MIME_TYPE } from './FileUtils';\nimport { getPathFromItem } from './FileListUtils';\n\n/**\n * Get the icon definition for a file or folder item\n * @param item Item to get the icon for\n * @returns Icon definition to pass in the FontAwesomeIcon icon prop\n */\nfunction getItemIcon(item: FileStorageItem): IconDefinition {\n if (isDirectory(item)) {\n return item.isExpanded ? vsFolderOpened : vsFolder;\n }\n const mimeType = FileUtils.getMimeType(item.basename);\n switch (mimeType) {\n case MIME_TYPE.PYTHON:\n return dhPython;\n default:\n return vsCode;\n }\n}\n\nexport type FileListRenderItemProps = RenderItemProps<FileStorageItem> & {\n children?: JSX.Element;\n dropTargetItem?: FileStorageItem;\n draggedItems?: FileStorageItem[];\n isDragInProgress: boolean;\n isDropTargetValid: boolean;\n\n onDragStart: (index: number, e: React.DragEvent<HTMLDivElement>) => void;\n onDragOver: (index: number, e: React.DragEvent<HTMLDivElement>) => void;\n onDragEnd: (index: number, e: React.DragEvent<HTMLDivElement>) => void;\n onDrop: (index: number, e: React.DragEvent<HTMLDivElement>) => void;\n};\n\nexport function FileListItem(props: FileListRenderItemProps): JSX.Element {\n const {\n children,\n draggedItems,\n isDragInProgress,\n isDropTargetValid,\n isSelected,\n item,\n itemIndex,\n dropTargetItem,\n onDragStart,\n onDragOver,\n onDragEnd,\n onDrop,\n } = props;\n\n const isDragged =\n draggedItems?.some(draggedItem => draggedItem.id === item.id) ?? false;\n const itemPath = getPathFromItem(item);\n const dropTargetPath =\n isDragInProgress && dropTargetItem ? getPathFromItem(dropTargetItem) : null;\n\n const isExactDropTarget =\n isDragInProgress &&\n isDropTargetValid &&\n isDirectory(item) &&\n dropTargetPath === itemPath;\n const isInDropTarget =\n isDragInProgress && isDropTargetValid && dropTargetPath === itemPath;\n const isInvalidDropTarget =\n isDragInProgress && !isDropTargetValid && dropTargetPath === itemPath;\n\n const icon = getItemIcon(item);\n const depth = FileUtils.getDepth(item.filename);\n const depthLines = Array(depth)\n .fill(null)\n .map((value, index) => (\n // eslint-disable-next-line react/no-array-index-key\n <span className=\"file-list-depth-line\" key={index} />\n ));\n\n return (\n <div\n className={classNames(\n 'd-flex w-100 align-items-center',\n 'file-list-item',\n {\n 'is-dragged': isDragged,\n 'is-exact-drop-target': isExactDropTarget,\n 'is-in-drop-target': isInDropTarget,\n 'is-invalid-drop-target': isInvalidDropTarget,\n 'is-selected': isSelected,\n }\n )}\n onDragStart={e => onDragStart(itemIndex, e)}\n onDragOver={e => onDragOver(itemIndex, e)}\n onDragEnd={e => onDragEnd(itemIndex, e)}\n onDrop={e => onDrop(itemIndex, e)}\n draggable\n role=\"presentation\"\n aria-label={item.basename}\n >\n {depthLines}{' '}\n <FontAwesomeIcon icon={icon} className=\"item-icon\" fixedWidth />{' '}\n <span className=\"truncation-wrapper\">\n {children ?? (\n <>\n {item.basename}\n <Tooltip>{item.basename}</Tooltip>\n </>\n )}\n </span>\n </div>\n );\n}\n\nexport default FileListItem;\n"],"mappings":"AAAA,OAAOA,KAAK,MAAM,OAAO;AACzB,SAASC,OAAO,QAA8B,uBAAuB;AACrE,SAASC,QAAQ,EAAEC,MAAM,EAAEC,QAAQ,EAAEC,cAAc,QAAQ,kBAAkB;AAE7E,SAASC,eAAe,QAAQ,gCAAgC;AAChE,OAAOC,UAAU,MAAM,YAAY;AAAC,SACLC,WAAW;AAAA;AAAA,OAEnCC,SAAS,IAAIC,SAAS;AAAA,SACpBC,eAA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ACI,UAAU;IAAA,CAAE,CAAC,EAAC,GAAG,eACpEjD,IAAA;MAAM6C,SAAS,EAAC,oBAAoB;MAAA9B,QAAA,EACjCA,QAAQ,aAARA,QAAQ,cAARA,QAAQ,gBACPX,KAAA,CAAAF,SAAA;QAAAa,QAAA,GACGT,IAAI,CAACI,QAAQ,eACdV,IAAA,CAACZ,OAAO;UAAA2B,QAAA,EAAET,IAAI,CAACI;QAAQ,CAAU,CAAC;MAAA,CAClC;IAAC,CAED,CAAC;EAAA,CACJ,CAAC;AAEV;AAEA,eAAeE,YAAY"}
@@ -1 +1 @@
1
- {"version":3,"sourceRoot":"","sources":["../../../node_modules/@deephaven/components/scss/custom.scss","../../../node_modules/@deephaven/components/scss/bootstrap_overrides.scss","../src/FileListItemEditor.scss"],"names":[],"mappings":"AAAA;AC6LA;ACzLA;EACE;EACA;EACA;EACA;;AAEA;EACE;EACA;EACA;EACA,QAZoB;EAapB,aAboB;;AAepB;EACE;EACA;EAEA;;AAGJ;EACE,ODYS;ECXT,kBD6EK;EC5EL;EACA;EACA;EACA;EACA;EACA;EACA;EACA","file":"FileListItemEditor.css","sourcesContent":["/* stylelint-disable scss/at-import-no-partial-leading-underscore */\n// Consumers should be able to resolve bootstrap/ to node_modules/bootstrap\n\n//Make bootstrap functions available for use in overrides\n@import 'bootstrap/scss/_functions.scss';\n@import './bootstrap_overrides.scss';\n\n//_variable imports come after bootstrap default overrides,\n// makes all other variables and mixins from bootstrap available\n/// with just importing customer.scss\n@import 'bootstrap/scss/_variables.scss';\n@import 'bootstrap/scss/_mixins.scss';\n\n//New variables come after imports\n@import './new_variables.scss';\n@import './util.scss';\n","// Styling overrides for bootstrap\n@use 'sass:map';\n\n// Override / set color variables\n$red: var(--dh-color-visual-red);\n$orange: var(--dh-color-visual-orange);\n$yellow: var(--dh-color-visual-yellow);\n$green: var(--dh-color-visual-green);\n$blue: var(--dh-color-visual-blue);\n$purple: var(--dh-color-visual-purple);\n\n// Fallback colors are used if theme isn't loaded\n// this is required for error messages if the API doesn't load\n\n//Define our Gray scale\n$gray-100: var(--dh-color-gray-900, #fcfcfa);\n$gray-200: var(--dh-color-gray-800);\n$gray-300: var(--dh-color-gray-700);\n$gray-400: var(--dh-color-gray-600);\n$gray-500: var(--dh-color-gray-500);\n// intentional duplicate, scale doesn't line up otherwise\n// as we have gray-850 and spectrum doesn't and it is needed\n$gray-600: var(--dh-color-gray-500);\n$gray-700: var(--dh-color-gray-400);\n$gray-800: var(--dh-color-gray-300);\n$gray-850: var(--dh-color-gray-200);\n$gray-900: var(--dh-color-gray-75);\n$black: var(--dh-color-black, #1a171a);\n$white: var(--dh-color-white, #f0f0ee);\n\n//Define some UI colors\n$interfacegray: var(--dh-color-content-bg, #2d2a2e);\n$interfaceblue: var(--dh-color-accent-bg);\n$interfacewhite: $white;\n$interfaceblack: $black;\n$content-bg: var(--dh-color-content-bg, #2d2a2e);\n$background: var(--dh-color-bg, #1a171a);\n$foreground: var(--dh-color-fg, #f0f0ee);\n\n// Extend default Bootstrap $grays map\n$grays-custom: (\n '850': $gray-850,\n);\n$grays: () !default;\n$grays: map-merge($grays, $grays-custom);\n\n// Extend default Bootstrap $colors map\n$colors-custom: (\n 'black': $black,\n);\n$colors: () !default;\n$colors: map-merge($colors, $colors-custom);\n\n// Override default Bootstrap $theme-colors map by mapping each key to itself.\n// These will then be re-mapped inside of `button-outline-variant` and\n// `button-outline-variant` mixins in `bootstrap_override_mixins_buttons.scss`\n$theme-colors-self-map: ();\n@each $key\n in (\n 'primary',\n 'secondary',\n 'success',\n 'info',\n 'warning',\n 'danger',\n 'light',\n 'dark'\n )\n{\n $theme-colors-self-map: map.set($theme-colors-self-map, $key, $key);\n}\n$theme-colors: () !default;\n$theme-colors: map-merge($theme-colors, $theme-colors-self-map);\n\n// Used by bootstrap_override_mixins_buttons.scss to map Bootstrap colors to\n// DH semantic colors\n$bootstrap-dh-semantic-map: (\n 'primary': 'accent',\n 'secondary': 'neutral',\n 'success': 'positive',\n 'info': 'info',\n 'warning': 'notice',\n 'danger': 'negative',\n // We shouldn't be using these, but mapping so they work with our custom\n // `color-yiq` mixin. If we find a way to remove $light + $dark that are\n // defined in Bootstrap _variables.scss, we should remove these\n 'light': 'neutral',\n 'dark': 'neutral',\n);\n\n//Set default colors\n$body-bg: $black;\n$body-color: $interfacewhite;\n\n// Set brand colors\n$primary: var(--dh-color-accent-bg);\n$primary-hover: var(--dh-color-accent-hover-bg);\n$primary-dark: var(--dh-color-accent-down-bg);\n$secondary: var(--dh-color-neutral-bg);\n$secondary-hover: var(--dh-color-neutral-hover-bg);\n$success: $green;\n$info: $yellow;\n$warning: $orange;\n$danger: var(--dh-color-negative-bg);\n$danger-hover: var(--dh-color-negative-hover-bg);\n// We really don't want to use $light or $dark variables, but Bootstrap defines\n// them in _variables.scss. Explicitly setting them to ensure we are in control\n// of their values. If we can find a way to remove them, we should\n$light: var(--dh-color-gray-light);\n$dark: var(--dh-color-gray-dark);\n// Bootstrap doesn't define $mid, and we want to move away from this particular\n// semantic. Should be deleted by #1635\n$mid: var(--dh-color-gray-mid);\n\n$semantic-colors: (\n 'primary-hover': $primary-hover,\n 'primary-dark': $primary-dark,\n 'mid': $mid,\n 'content-bg': $interfacegray,\n 'background': $interfaceblack,\n 'foreground': $interfacewhite,\n 'secondary-hover': $secondary-hover,\n 'danger-hover': $danger-hover,\n);\n\n$component-active-bg: $primary;\n$theme-color-interval: 9%;\n$yiq-contrasted-threshold: 180;\n\n// Override fonts\n$font-family-sans-serif:\n 'Fira Sans',\n -apple-system,\n blinkmacsystemfont,\n 'Segoe UI',\n 'Roboto',\n 'Helvetica Neue',\n arial,\n sans-serif; //fira sans then native system ui fallbacks\n$font-family-monospace: 'Fira Mono', menlo, monaco, consolas, 'Liberation Mono',\n 'Courier New', monospace;\n$font-family-base: $font-family-sans-serif;\n\n$headings-font-weight: 400;\n\n//Text overides\n$text-muted: $gray-400;\n\n//Style Selection highlight color\n$text-select-color: var(--dh-color-text-highlight);\n\n//Grid variables, same value as default just making easily accessible\n$grid-gutter-width: 30px;\n\n//Visual Overrides\n$border-radius: 4px;\n$box-shadow: 0 0.1rem 1rem var(--dh-color-dropshadow);\n\n//Override Btn\n$btn-border-radius: 4rem;\n$btn-padding-x: 1.5rem;\n$btn-transition:\n color 0.12s ease-in-out,\n background-color 0.12s ease-in-out,\n border-color 0.12s ease-in-out,\n box-shadow 0.12s ease-in-out; //default 0.15 is too long\n$btn-border-width: 2px;\n$btn-font-weight: var(--spectrum-global-font-weight-bold);\n$btn-line-height: 1.3;\n\n//Override Inputs\n$input-bg: var(--dh-color-input-bg);\n$input-disabled-bg: var(--dh-color-input-disabled-bg);\n$input-color: var(--dh-color-input-fg);\n$input-border-color: var(--dh-color-input-border);\n$input-placeholder-color: var(--dh-color-input-placeholder);\n$input-focus-border-color: var(--dh-color-input-focus-border);\n\n$input-btn-focus-width: 0.2rem;\n$input-btn-focus-color: color-mix(\n in srgb,\n var(--dh-color-accent) 35%,\n transparent\n);\n$input-btn-focus-box-shadow: 0 0 0 $input-btn-focus-width $input-btn-focus-color;\n$input-btn-line-height: 1.3;\n// Bootstrap uses a calc expression to determine the input height (calc(line-height + 2*padding-y + border)).\n// The padding-y value has to be in rem to match units as it is a SASS calc.\n// Using 0.42145rem with 1.3 line height gets us to spectrum's 32px.\n/* stylelint-disable-next-line number-max-precision */\n$input-btn-padding-y: 0.42145rem;\n\n//checkbox\n$custom-control-indicator-bg: var(--dh-color-input-bg);\n$custom-control-indicator-border-color: var(--dh-color-input-border);\n$custom-checkbox-indicator-border-radius: 2px;\n$custom-control-indicator-border-width: 2px;\n$custom-control-indicator-active-bg: var(--dh-color-input-bg);\n$custom-control-indicator-active-border-color: var(--dh-color-input-fg);\n$custom-control-indicator-checked-bg: var(--dh-color-input-fg);\n$custom-control-indicator-checked-color: black; // used as mask fill color\n$custom-checkbox-indicator-indeterminate-bg: var(--dh-color-input-fg);\n$custom-control-indicator-bg-size: 75% 75%;\n$custom-control-indicator-disabled-bg: var(--dh-color-input-disabled-bg);\n$custom-control-indicator-checked-disabled-bg: var(\n --dh-color-input-disabled-bg\n);\n$custom-control-label-disabled-color: var(--dh-color-input-disabled-fg);\n\n// The $custom-select-indicator variable is used by Bootstrap to provide the\n// icon for the select dropdown. Inline svgs can't use CSS variables, so we hard\n// code the color to #929192 (the default value of --dh-color-gray-600). PR #1651\n// overrides this icon altogether for known dropdowns, so technically we may not\n// need this, but it's here in case there are any remaining instances.\n$custom-select-indicator-color: #929192;\n$custom-select-bg: var(--dh-color-selector-bg);\n$custom-select-bg-size: 16px 16px;\n//dhSort icon encoded\n$custom-select-indicator: str-replace(\n url(\"data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath fill='#{$custom-select-indicator-color}' d='M4 7l-.4-.8 4-3.7h.8l4 3.7-.4.8H4zm0 2l-.4.8 4 3.7h.8l4-3.7L12 9H4z'/%3E%3C/svg%3E\"),\n '#',\n '%23'\n);\n$custom-select-focus-box-shadow: $input-btn-focus-box-shadow;\n$custom-select-disabled-color: $gray-500;\n$custom-select-disabled-bg: $gray-800;\n\n//modal\n$modal-content-bg: $content-bg;\n$modal-content-border-width: 0;\n$modal-md: 550px;\n$close-color: var(--dh-color-text);\n$close-text-shadow: none;\n\n// Toast notification\n$toast-bg: var(--dh-color-accent-100);\n$toast-color: var(--dh-color-text);\n$toast-error-bg: var(--dh-color-negative-bg);\n$toast-error-color: var(--dh-color-text);\n\n//tooltips\n$tooltip-bg: var(--dh-color-tooltip-bg);\n$tooltip-color: var(--dh-color-tooltip-fg);\n$tooltip-box-shadow: 0 0.1rem 1.5rem 0.1rem var(--dh-color-tooltip-box-shadow);\n\n//drowdowns\n$dropdown-bg: $gray-600;\n$dropdown-link-color: $foreground;\n$dropdown-link-hover-color: $foreground;\n$dropdown-link-hover-bg: var(--dh-color-item-list-hover-bg);\n$dropdown-divider-bg: $gray-700;\n\n//context menus\n$contextmenu-bg: var(--dh-color-popover-bg);\n$contextmenu-color: var(--dh-color-text);\n$contextmenu-disabled-color: var(--dh-color-input-disabled-fg);\n$contextmenu-keyboard-selected-bg: var(--dh-color-keyboard-selected-bg);\n$contextmenu-selected-bg: var(--dh-color-item-list-hover-bg);\n$contextmenu-selected-color: var(--dh-color-item-list-selected-fg);\n\n//hr\n$hr-border-color: var(--dh-color-hr);\n\n//links\n$link-color: $gray-400;\n$link-hover-color: $foreground;\n\n//progress-bar\n$progress-bg: $gray-600;\n$progress-border-radius: 1rem;\n\n// Set global options\n$enable-shadows: false;\n$enable-gradients: false;\n$enable-print-styles: false; //I don't think anyone should expect to \"print\" this app.\n\n// Transition times\n$transition: 0.15s;\n$transition-mid: 0.2s;\n$transition-long: 0.3s;\n$transition-slow: 0.6s;\n\n//form-validation icon, uses vsWarning icon encoded here as svg\n$form-feedback-icon-invalid-color: $danger;\n$form-feedback-icon-invalid: str-replace(\n url(\"data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 16 16'%3E%3Cg fill='none'%3E%3Cg fill='#{$form-feedback-icon-invalid-color}'%3E%3Cpath d='M7.56 1h.88l6.54 12.26-.44.74H1.44L1 13.26 7.56 1zM8 2.28 2.28 13H13.7L8 2.28zM8.625 12v-1h-1.25v1h1.25zm-1.25-2V6h1.25v4h-1.25z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E \"),\n '#',\n '%23'\n);\n\n// This section of variables is not consumed directly by DH, but they need to be\n// defined for sass to compile _variables\n$table-dark-bg: $gray-800;\n$table-dark-accent-bg: var(--dh-color-highlight-hover);\n$table-dark-hover-bg: var(--dh-color-highlight-active);\n$table-dark-border-color: $gray-700;\n$popover-bg: var(--dh-color-tooltip-bg);\n$popover-border-color: var(--dh-color-overlay-modal-bg);\n$popover-header-bg: #000;\n$popover-arrow-outer-color: var(--dh-color-dropshadow);\n$custom-range-thumb-active-bg: var(--dh-color-accent-1100);\n","@import '@deephaven/components/scss/custom.scss';\n\n$item-list-item-height: 26px;\n\n.file-list-item-editor {\n z-index: 1;\n width: 100%;\n display: inline-block;\n position: relative;\n\n .file-list-item-editor-input {\n padding: 0;\n border: none;\n border-radius: 0;\n height: $item-list-item-height;\n line-height: $item-list-item-height;\n\n &.is-invalid {\n border-bottom-left-radius: 0;\n border-bottom-right-radius: 0;\n // Don't overlap the error icon\n padding-right: 2rem;\n }\n }\n .invalid-feedback {\n color: $foreground;\n background-color: $danger;\n font-size: 0.9rem;\n margin-top: 0;\n padding: $spacer-1 $spacer-2;\n border-bottom-left-radius: 4px;\n border-bottom-right-radius: 4px;\n position: absolute;\n top: 100%;\n left: 0;\n }\n}\n"]}
1
+ {"version":3,"sourceRoot":"","sources":["../../../node_modules/@deephaven/components/scss/custom.scss","../../../node_modules/@deephaven/components/scss/bootstrap_overrides.scss","../src/FileListItemEditor.scss"],"names":[],"mappings":"AAAA;AC6LA;ACzLA;EACE;EACA;EACA;EACA;;AAEA;EACE;EACA;EACA;EACA,QAZoB;EAapB,aAboB;;AAepB;EACE;EACA;EAEA;;AAGJ;EACE,ODYS;ECXT,kBD6EK;EC5EL;EACA;EACA;EACA;EACA;EACA;EACA;EACA","file":"FileListItemEditor.css","sourcesContent":["/* stylelint-disable scss/at-import-no-partial-leading-underscore */\n// Consumers should be able to resolve bootstrap/ to node_modules/bootstrap\n\n//Make bootstrap functions available for use in overrides\n@import 'bootstrap/scss/_functions.scss';\n@import './bootstrap_overrides.scss';\n\n//_variable imports come after bootstrap default overrides,\n// makes all other variables and mixins from bootstrap available\n/// with just importing customer.scss\n@import 'bootstrap/scss/_variables.scss';\n@import 'bootstrap/scss/_mixins.scss';\n\n//New variables come after imports\n@import './new_variables.scss';\n@import './util.scss';\n","// Styling overrides for bootstrap\n@use 'sass:map';\n\n// Override / set color variables\n$red: var(--dh-color-visual-red);\n$orange: var(--dh-color-visual-orange);\n$yellow: var(--dh-color-visual-yellow);\n$green: var(--dh-color-visual-green);\n$blue: var(--dh-color-visual-blue);\n$purple: var(--dh-color-visual-purple);\n\n// Fallback colors are used if theme isn't loaded\n// this is required for error messages if the API doesn't load\n\n//Define our Gray scale\n$gray-100: var(--dh-color-gray-900, #fcfcfa);\n$gray-200: var(--dh-color-gray-800);\n$gray-300: var(--dh-color-gray-700);\n$gray-400: var(--dh-color-gray-600);\n$gray-500: var(--dh-color-gray-500);\n// intentional duplicate, scale doesn't line up otherwise\n// as we have gray-850 and spectrum doesn't and it is needed\n$gray-600: var(--dh-color-gray-500);\n$gray-700: var(--dh-color-gray-400);\n$gray-800: var(--dh-color-gray-300);\n$gray-850: var(--dh-color-gray-200);\n$gray-900: var(--dh-color-gray-75);\n$black: var(--dh-color-black, #1a171a);\n$white: var(--dh-color-white, #f0f0ee);\n\n//Define some UI colors\n$interfacegray: var(--dh-color-content-bg, #2d2a2e);\n$interfaceblue: var(--dh-color-accent-bg);\n$interfacewhite: $white;\n$interfaceblack: $black;\n$content-bg: var(--dh-color-content-bg, #2d2a2e);\n$background: var(--dh-color-bg, #1a171a);\n$foreground: var(--dh-color-fg, #f0f0ee);\n\n// Extend default Bootstrap $grays map\n$grays-custom: (\n '850': $gray-850,\n);\n$grays: () !default;\n$grays: map-merge($grays, $grays-custom);\n\n// Extend default Bootstrap $colors map\n$colors-custom: (\n 'black': $black,\n);\n$colors: () !default;\n$colors: map-merge($colors, $colors-custom);\n\n// Override default Bootstrap $theme-colors map by mapping each key to itself.\n// These will then be re-mapped inside of `button-outline-variant` and\n// `button-outline-variant` mixins in `bootstrap_override_mixins_buttons.scss`\n$theme-colors-self-map: ();\n@each $key\n in (\n 'primary',\n 'secondary',\n 'success',\n 'info',\n 'warning',\n 'danger',\n 'light',\n 'dark'\n )\n{\n $theme-colors-self-map: map.set($theme-colors-self-map, $key, $key);\n}\n$theme-colors: () !default;\n$theme-colors: map-merge($theme-colors, $theme-colors-self-map);\n\n// Used by bootstrap_override_mixins_buttons.scss to map Bootstrap colors to\n// DH semantic colors\n$bootstrap-dh-semantic-map: (\n 'primary': 'accent',\n 'secondary': 'neutral',\n 'success': 'positive',\n 'info': 'info',\n 'warning': 'notice',\n 'danger': 'negative',\n // We shouldn't be using these, but mapping so they work with our custom\n // `color-yiq` mixin. If we find a way to remove $light + $dark that are\n // defined in Bootstrap _variables.scss, we should remove these\n 'light': 'neutral',\n 'dark': 'neutral',\n);\n\n//Set default colors\n$body-bg: $black;\n$body-color: $interfacewhite;\n\n// Set brand colors\n$primary: var(--dh-color-accent-bg);\n$primary-hover: var(--dh-color-accent-hover-bg);\n$primary-dark: var(--dh-color-accent-down-bg);\n$secondary: var(--dh-color-neutral-bg);\n$secondary-hover: var(--dh-color-neutral-hover-bg);\n$success: $green;\n$info: $yellow;\n$warning: $orange;\n$danger: var(--dh-color-negative-bg);\n$danger-hover: var(--dh-color-negative-hover-bg);\n// We really don't want to use $light or $dark variables, but Bootstrap defines\n// them in _variables.scss. Explicitly setting them to ensure we are in control\n// of their values. If we can find a way to remove them, we should\n$light: var(--dh-color-gray-light);\n$dark: var(--dh-color-gray-dark);\n// Bootstrap doesn't define $mid, and we want to move away from this particular\n// semantic. Should be deleted by #1635\n$mid: var(--dh-color-gray-mid);\n\n$semantic-colors: (\n 'primary-hover': $primary-hover,\n 'primary-dark': $primary-dark,\n 'mid': $mid,\n 'content-bg': $interfacegray,\n 'background': $interfaceblack,\n 'foreground': $interfacewhite,\n 'secondary-hover': $secondary-hover,\n 'danger-hover': $danger-hover,\n);\n\n$component-active-bg: $primary;\n$theme-color-interval: 9%;\n$yiq-contrasted-threshold: 180;\n\n// Override fonts\n$font-family-sans-serif:\n 'Fira Sans',\n -apple-system,\n blinkmacsystemfont,\n 'Segoe UI',\n 'Roboto',\n 'Helvetica Neue',\n arial,\n sans-serif; //fira sans then native system ui fallbacks\n$font-family-monospace: 'Fira Mono', menlo, monaco, consolas, 'Liberation Mono',\n 'Courier New', monospace;\n$font-family-base: $font-family-sans-serif;\n\n$headings-font-weight: 400;\n\n//Text overides\n$text-muted: $gray-400;\n\n//Style Selection highlight color\n$text-select-color: var(--dh-color-text-highlight);\n\n//Grid variables, same value as default just making easily accessible\n$grid-gutter-width: 30px;\n\n//Visual Overrides\n$border-radius: 4px;\n$box-shadow: 0 0.1rem 1rem var(--dh-color-dropshadow);\n\n//Override Btn\n$btn-border-radius: 4rem;\n$btn-padding-x: 1.5rem;\n$btn-transition:\n color 0.12s ease-in-out,\n background-color 0.12s ease-in-out,\n border-color 0.12s ease-in-out,\n box-shadow 0.12s ease-in-out; //default 0.15 is too long\n$btn-border-width: 2px;\n$btn-font-weight: var(--spectrum-global-font-weight-bold);\n$btn-line-height: 1.3;\n\n//Override Inputs\n$input-bg: var(--dh-color-input-bg);\n$input-disabled-bg: var(--dh-color-input-disabled-bg);\n$input-color: var(--dh-color-input-fg);\n$input-border-color: var(--dh-color-input-border);\n$input-placeholder-color: var(--dh-color-input-placeholder);\n$input-focus-border-color: var(--dh-color-input-focus-border);\n\n$input-btn-focus-width: 0.2rem;\n$input-btn-focus-color: color-mix(\n in srgb,\n var(--dh-color-accent) 35%,\n transparent\n);\n$input-btn-focus-box-shadow: 0 0 0 $input-btn-focus-width $input-btn-focus-color;\n$input-btn-line-height: 1.3;\n// Bootstrap uses a calc expression to determine the input height (calc(line-height + 2*padding-y + border)).\n// The padding-y value has to be in rem to match units as it is a SASS calc.\n// Using 0.42145rem with 1.3 line height gets us to spectrum's 32px.\n/* stylelint-disable-next-line number-max-precision */\n$input-btn-padding-y: 0.42145rem;\n\n//checkbox\n$custom-control-indicator-bg: var(--dh-color-input-bg);\n$custom-control-indicator-border-color: var(--dh-color-input-border);\n$custom-checkbox-indicator-border-radius: 2px;\n$custom-control-indicator-border-width: 2px;\n$custom-control-indicator-active-bg: var(--dh-color-input-bg);\n$custom-control-indicator-active-border-color: var(--dh-color-input-fg);\n$custom-control-indicator-checked-bg: var(--dh-color-input-fg);\n$custom-control-indicator-checked-color: black; // used as mask fill color\n$custom-checkbox-indicator-indeterminate-bg: var(--dh-color-input-fg);\n$custom-control-indicator-bg-size: 75% 75%;\n$custom-control-indicator-disabled-bg: var(--dh-color-input-disabled-bg);\n$custom-control-indicator-checked-disabled-bg: var(\n --dh-color-input-disabled-bg\n);\n$custom-control-label-disabled-color: var(--dh-color-input-disabled-fg);\n\n// The $custom-select-indicator variable is used by Bootstrap to provide the\n// icon for the select dropdown. Inline svgs can't use CSS variables, so we hard\n// code the color to #929192 (the default value of --dh-color-gray-600). PR #1651\n// overrides this icon altogether for known dropdowns, so technically we may not\n// need this, but it's here in case there are any remaining instances.\n$custom-select-indicator-color: #929192;\n$custom-select-bg: var(--dh-color-selector-bg);\n$custom-select-bg-size: 16px 16px;\n//dhSort icon encoded\n$custom-select-indicator: str-replace(\n url(\"data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath fill='#{$custom-select-indicator-color}' d='M4 7l-.4-.8 4-3.7h.8l4 3.7-.4.8H4zm0 2l-.4.8 4 3.7h.8l4-3.7L12 9H4z'/%3E%3C/svg%3E\"),\n '#',\n '%23'\n);\n$custom-select-focus-box-shadow: $input-btn-focus-box-shadow;\n$custom-select-disabled-color: $gray-500;\n$custom-select-disabled-bg: $gray-800;\n\n//modal\n$modal-content-bg: $content-bg;\n$modal-content-border-width: 0;\n$modal-md: 550px;\n$close-color: var(--dh-color-text);\n$close-text-shadow: none;\n\n// Toast notification\n$toast-bg: var(--dh-color-accent-100);\n$toast-color: var(--dh-color-text);\n$toast-error-bg: var(--dh-color-negative-bg);\n$toast-error-color: var(--dh-color-text);\n\n//tooltips\n$tooltip-bg: var(--dh-color-tooltip-bg);\n$tooltip-color: var(--dh-color-tooltip-fg);\n$tooltip-box-shadow: 0 0.1rem 1.5rem 0.1rem var(--dh-color-tooltip-box-shadow);\n\n//drowdowns\n$dropdown-bg: $gray-600;\n$dropdown-link-color: $foreground;\n$dropdown-link-hover-color: $foreground;\n$dropdown-link-hover-bg: var(--dh-color-item-list-hover-bg);\n$dropdown-divider-bg: $gray-700;\n\n//context menus\n$contextmenu-bg: var(--dh-color-popover-bg);\n$contextmenu-color: var(--dh-color-text);\n$contextmenu-disabled-color: var(--dh-color-text-disabled);\n$contextmenu-keyboard-selected-bg: var(--dh-color-keyboard-selected-bg);\n$contextmenu-selected-bg: var(--dh-color-item-list-hover-bg);\n$contextmenu-selected-color: var(--dh-color-item-list-selected-fg);\n\n//hr\n$hr-border-color: var(--dh-color-hr);\n\n//links\n$link-color: $gray-400;\n$link-hover-color: $foreground;\n\n//progress-bar\n$progress-bg: $gray-600;\n$progress-border-radius: 1rem;\n\n// Set global options\n$enable-shadows: false;\n$enable-gradients: false;\n$enable-print-styles: false; //I don't think anyone should expect to \"print\" this app.\n\n// Transition times\n$transition: 0.15s;\n$transition-mid: 0.2s;\n$transition-long: 0.3s;\n$transition-slow: 0.6s;\n\n//form-validation icon, uses vsWarning icon encoded here as svg\n$form-feedback-icon-invalid-color: $danger;\n$form-feedback-icon-invalid: str-replace(\n url(\"data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 16 16'%3E%3Cg fill='none'%3E%3Cg fill='#{$form-feedback-icon-invalid-color}'%3E%3Cpath d='M7.56 1h.88l6.54 12.26-.44.74H1.44L1 13.26 7.56 1zM8 2.28 2.28 13H13.7L8 2.28zM8.625 12v-1h-1.25v1h1.25zm-1.25-2V6h1.25v4h-1.25z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E \"),\n '#',\n '%23'\n);\n\n// This section of variables is not consumed directly by DH, but they need to be\n// defined for sass to compile _variables\n$table-dark-bg: $gray-800;\n$table-dark-accent-bg: var(--dh-color-highlight-hover);\n$table-dark-hover-bg: var(--dh-color-highlight-active);\n$table-dark-border-color: $gray-700;\n$popover-bg: var(--dh-color-tooltip-bg);\n$popover-border-color: var(--dh-color-overlay-modal-bg);\n$popover-header-bg: #000;\n$popover-arrow-outer-color: var(--dh-color-dropshadow);\n$custom-range-thumb-active-bg: var(--dh-color-accent-1100);\n","@import '@deephaven/components/scss/custom.scss';\n\n$item-list-item-height: 26px;\n\n.file-list-item-editor {\n z-index: 1;\n width: 100%;\n display: inline-block;\n position: relative;\n\n .file-list-item-editor-input {\n padding: 0;\n border: none;\n border-radius: 0;\n height: $item-list-item-height;\n line-height: $item-list-item-height;\n\n &.is-invalid {\n border-bottom-left-radius: 0;\n border-bottom-right-radius: 0;\n // Don't overlap the error icon\n padding-right: 2rem;\n }\n }\n .invalid-feedback {\n color: $foreground;\n background-color: $danger;\n font-size: 0.9rem;\n margin-top: 0;\n padding: $spacer-1 $spacer-2;\n border-bottom-left-radius: 4px;\n border-bottom-right-radius: 4px;\n position: absolute;\n top: 100%;\n left: 0;\n }\n}\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"FileListItemEditor.js","names":["React","useCallback","useEffect","useRef","useState","classNames","Log","PromiseUtils","jsx","_jsx","jsxs","_jsxs","log","module","DEFAULT_VALIDATE","Promise","resolve","FileListItemEditor","_ref","item","onCancel","onSubmit","validate","input","value","setValue","basename","validationError","setValidationError","validationPromise","setValidationPromise","focus","_input$current","current","stopPropagation","e","validateAndSubmit","then","catch","info","validateValueAndSetPromise","validatePromise","makeCancelable","undefined","isCanceled","cancel","selectRange","handleBlur","debug2","handleChange","newValue","target","handleKeyDown","key","className","children","type","ref","onBlur","onKeyDown","onChange","onClick","onDoubleClick","onMouseDown","concat"],"sources":["../src/FileListItemEditor.tsx"],"sourcesContent":["import React, {\n type ChangeEvent,\n type KeyboardEvent,\n type MouseEvent,\n useCallback,\n useEffect,\n useRef,\n useState,\n} from 'react';\nimport classNames from 'classnames';\nimport Log from '@deephaven/log';\nimport { PromiseUtils } from '@deephaven/utils';\nimport './FileListItemEditor.scss';\nimport { type FileStorageItem } from './FileStorage';\n\nconst log = Log.module('FileListItemEditor');\n\nexport interface FileListItemEditorProps {\n item: FileStorageItem;\n onCancel: () => void;\n onSubmit: (newName: string) => void;\n validate?: (newName: string) => Promise<void>;\n}\n\nconst DEFAULT_VALIDATE = (): Promise<void> => Promise.resolve();\n\nexport function FileListItemEditor({\n item,\n onCancel,\n onSubmit,\n validate = DEFAULT_VALIDATE,\n}: FileListItemEditorProps): JSX.Element {\n const input = useRef<HTMLInputElement>(null);\n const [value, setValue] = useState(item.basename);\n const [validationError, setValidationError] = useState<Error>();\n const [validationPromise, setValidationPromise] = useState<Promise<void>>(\n Promise.resolve()\n );\n\n const focus = useCallback(() => {\n input.current?.focus();\n // Select the proper range based on the type...\n }, [input]);\n\n const stopPropagation = useCallback(\n (e: MouseEvent) => e.stopPropagation(),\n []\n );\n\n const validateAndSubmit = useCallback(() => {\n validationPromise\n .then(() => {\n onSubmit(value);\n })\n .catch(e => log.info('Unable to validate name', e));\n }, [onSubmit, value, validationPromise]);\n\n useEffect(\n function validateValueAndSetPromise() {\n const validatePromise = PromiseUtils.makeCancelable(validate(value));\n validatePromise\n .then(() => setValidationError(undefined))\n .catch(e => {\n if (!PromiseUtils.isCanceled(e)) {\n setValidationError(e);\n }\n });\n setValidationPromise(validatePromise);\n return () => validatePromise.cancel();\n },\n [validate, value]\n );\n\n useEffect(\n function selectRange() {\n focus();\n },\n [focus]\n );\n\n const handleBlur = useCallback(() => {\n log.debug2('handleBlur');\n validateAndSubmit();\n }, [validateAndSubmit]);\n\n const handleChange = useCallback((e: ChangeEvent<HTMLInputElement>) => {\n const { value: newValue } = e.target;\n setValue(newValue);\n }, []);\n\n const handleKeyDown = useCallback(\n (e: KeyboardEvent) => {\n e.stopPropagation();\n\n const { key } = e;\n switch (key) {\n case 'Enter': {\n validateAndSubmit();\n break;\n }\n case 'Escape': {\n onCancel();\n break;\n }\n default:\n }\n },\n [onCancel, validateAndSubmit]\n );\n\n return (\n <div className=\"file-list-item-editor\">\n <input\n type=\"text\"\n className={classNames('form-control file-list-item-editor-input', {\n 'is-invalid': validationError,\n })}\n value={value}\n ref={input}\n onBlur={handleBlur}\n onKeyDown={handleKeyDown}\n onChange={handleChange}\n onClick={stopPropagation}\n onDoubleClick={stopPropagation}\n onMouseDown={stopPropagation}\n />\n\n {validationError && (\n <div className=\"invalid-feedback\">{`${validationError}`}</div>\n )}\n </div>\n );\n}\n\nexport default FileListItemEditor;\n"],"mappings":"AAAA,OAAOA,KAAK,IAIVC,WAAW,EACXC,SAAS,EACTC,MAAM,EACNC,QAAQ,QACH,OAAO;AACd,OAAOC,UAAU,MAAM,YAAY;AACnC,OAAOC,GAAG,MAAM,gBAAgB;AAChC,SAASC,YAAY,QAAQ,kBAAkB;AAAC;AAAA,SAAAC,GAAA,IAAAC,IAAA;AAAA,SAAAC,IAAA,IAAAC,KAAA;AAIhD,IAAMC,GAAG,GAAGN,GAAG,CAACO,MAAM,CAAC,oBAAoB,CAAC;AAS5C,IAAMC,gBAAgB,GAAGA,CAAA,KAAqBC,OAAO,CAACC,OAAO,CAAC,CAAC;AAE/D,OAAO,SAASC,kBAAkBA,CAAAC,IAAA,EAKO;EAAA,IALN;IACjCC,IAAI;IACJC,QAAQ;IACRC,QAAQ;IACRC,QAAQ,GAAGR;EACY,CAAC,GAAAI,IAAA;EACxB,IAAMK,KAAK,GAAGpB,MAAM,CAAmB,IAAI,CAAC;EAC5C,IAAM,CAACqB,KAAK,EAAEC,QAAQ,CAAC,GAAGrB,QAAQ,CAACe,IAAI,CAACO,QAAQ,CAAC;EACjD,IAAM,CAACC,eAAe,EAAEC,kBAAkB,CAAC,GAAGxB,QAAQ,CAAQ,CAAC;EAC/D,IAAM,CAACyB,iBAAiB,EAAEC,oBAAoB,CAAC,GAAG1B,QAAQ,CACxDW,OAAO,CAACC,OAAO,CAAC,CAClB,CAAC;EAED,IAAMe,KAAK,GAAG9B,WAAW,CAAC,MAAM;IAAA,IAAA+B,cAAA;IAC9B,CAAAA,cAAA,GAAAT,KAAK,CAACU,OAAO,cAAAD,cAAA,uBAAbA,cAAA,CAAeD,KAAK,CAAC,CAAC;IACtB;EACF,CAAC,EAAE,CAACR,KAAK,CAAC,CAAC;EAEX,IAAMW,eAAe,GAAGjC,WAAW,CAChCkC,CAAa,IAAKA,CAA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AC,CAACgB,MAAM;IACpC1B,QAAQ,CAACyB,QAAQ,CAAC;EACpB,CAAC,EAAE,EAAE,CAAC;EAEN,IAAME,aAAa,GAAGnD,WAAW,CAC9BkC,CAAgB,IAAK;IACpBA,CAAC,CAACD,eAAe,CAAC,CAAC;IAEnB,IAAM;MAAEmB;IAAI,CAAC,GAAGlB,CAAC;IACjB,QAAQkB,GAAG;MACT,KAAK,OAAO;QAAE;UACZjB,iBAAiB,CAAC,CAAC;UACnB;QACF;MACA,KAAK,QAAQ;QAAE;UACbhB,QAAQ,CAAC,CAAC;UACV;QACF;MACA;IACF;EACF,CAAC,EACD,CAACA,QAAQ,EAAEgB,iBAAiB,CAC9B,CAAC;EAED,oBACEzB,KAAA;IAAK2C,SAAS,EAAC,uBAAuB;IAAAC,QAAA,gBACpC9C,IAAA;MACE+C,IAAI,EAAC,MAAM;MACXF,SAAS,EAAEjD,UAAU,CAAC,0CAA0C,EAAE;QAChE,YAAY,EAAEsB;MAChB,CAAC,CAAE;MACHH,KAAK,EAAEA,KAAM;MACbiC,GAAG,EAAElC,KAAM;MACXmC,MAAM,EAAEX,UAAW;MACnBY,SAAS,EAAEP,aAAc;MACzBQ,QAAQ,EAAEX,YAAa;MACvBY,OAAO,EAAE3B,eAAgB;MACzB4B,aAAa,EAAE5B,eAAgB;MAC/B6B,WAAW,EAAE7B;IAAgB,CAC9B,CAAC,EAEDP,eAAe,iBACdlB,IAAA;MAAK6C,SAAS,EAAC,kBAAkB;MAAAC,QAAA,KAAAS,MAAA,CAAKrC,eAAe;IAAA,CAAQ,CAC9D;EAAA,CACE,CAAC;AAEV;AAEA,eAAeV,kBAAkB","ignoreList":[]}
1
+ {"version":3,"file":"FileListItemEditor.js","names":["React","useCallback","useEffect","useRef","useState","classNames","Log","PromiseUtils","jsx","_jsx","jsxs","_jsxs","log","module","DEFAULT_VALIDATE","Promise","resolve","FileListItemEditor","_ref","item","onCancel","onSubmit","validate","input","value","setValue","basename","validationError","setValidationError","validationPromise","setValidationPromise","focus","_input$current","current","stopPropagation","e","validateAndSubmit","then","catch","info","validateValueAndSetPromise","validatePromise","makeCancelable","undefined","isCanceled","cancel","selectRange","handleBlur","debug2","handleChange","newValue","target","handleKeyDown","key","className","children","type","ref","onBlur","onKeyDown","onChange","onClick","onDoubleClick","onMouseDown","concat"],"sources":["../src/FileListItemEditor.tsx"],"sourcesContent":["import React, {\n type ChangeEvent,\n type KeyboardEvent,\n type MouseEvent,\n useCallback,\n useEffect,\n useRef,\n useState,\n} from 'react';\nimport classNames from 'classnames';\nimport Log from '@deephaven/log';\nimport { PromiseUtils } from '@deephaven/utils';\nimport './FileListItemEditor.scss';\nimport { type FileStorageItem } from './FileStorage';\n\nconst log = Log.module('FileListItemEditor');\n\nexport interface FileListItemEditorProps {\n item: FileStorageItem;\n onCancel: () => void;\n onSubmit: (newName: string) => void;\n validate?: (newName: string) => Promise<void>;\n}\n\nconst DEFAULT_VALIDATE = (): Promise<void> => Promise.resolve();\n\nexport function FileListItemEditor({\n item,\n onCancel,\n onSubmit,\n validate = DEFAULT_VALIDATE,\n}: FileListItemEditorProps): JSX.Element {\n const input = useRef<HTMLInputElement>(null);\n const [value, setValue] = useState(item.basename);\n const [validationError, setValidationError] = useState<Error>();\n const [validationPromise, setValidationPromise] = useState<Promise<void>>(\n Promise.resolve()\n );\n\n const focus = useCallback(() => {\n input.current?.focus();\n // Select the proper range based on the type...\n }, [input]);\n\n const stopPropagation = useCallback(\n (e: MouseEvent) => e.stopPropagation(),\n []\n );\n\n const validateAndSubmit = useCallback(() => {\n validationPromise\n .then(() => {\n onSubmit(value);\n })\n .catch(e => log.info('Unable to validate name', e));\n }, [onSubmit, value, validationPromise]);\n\n useEffect(\n function validateValueAndSetPromise() {\n const validatePromise = PromiseUtils.makeCancelable(validate(value));\n validatePromise\n .then(() => setValidationError(undefined))\n .catch(e => {\n if (!PromiseUtils.isCanceled(e)) {\n setValidationError(e);\n }\n });\n setValidationPromise(validatePromise);\n return () => validatePromise.cancel();\n },\n [validate, value]\n );\n\n useEffect(\n function selectRange() {\n focus();\n },\n [focus]\n );\n\n const handleBlur = useCallback(() => {\n log.debug2('handleBlur');\n validateAndSubmit();\n }, [validateAndSubmit]);\n\n const handleChange = useCallback((e: ChangeEvent<HTMLInputElement>) => {\n const { value: newValue } = e.target;\n setValue(newValue);\n }, []);\n\n const handleKeyDown = useCallback(\n (e: KeyboardEvent) => {\n e.stopPropagation();\n\n const { key } = e;\n switch (key) {\n case 'Enter': {\n validateAndSubmit();\n break;\n }\n case 'Escape': {\n onCancel();\n break;\n }\n default:\n }\n },\n [onCancel, validateAndSubmit]\n );\n\n return (\n <div className=\"file-list-item-editor\">\n <input\n type=\"text\"\n className={classNames('form-control file-list-item-editor-input', {\n 'is-invalid': validationError,\n })}\n value={value}\n ref={input}\n onBlur={handleBlur}\n onKeyDown={handleKeyDown}\n onChange={handleChange}\n onClick={stopPropagation}\n onDoubleClick={stopPropagation}\n onMouseDown={stopPropagation}\n />\n\n {validationError && (\n <div className=\"invalid-feedback\">{`${validationError}`}</div>\n )}\n </div>\n );\n}\n\nexport default FileListItemEditor;\n"],"mappings":"AAAA,OAAOA,KAAK,IAIVC,WAAW,EACXC,SAAS,EACTC,MAAM,EACNC,QAAQ,QACH,OAAO;AACd,OAAOC,UAAU,MAAM,YAAY;AACnC,OAAOC,GAAG,MAAM,gBAAgB;AAChC,SAASC,YAAY,QAAQ,kBAAkB;AAAC;AAAA,SAAAC,GAAA,IAAAC,IAAA;AAAA,SAAAC,IAAA,IAAAC,KAAA;AAIhD,IAAMC,GAAG,GAAGN,GAAG,CAACO,MAAM,CAAC,oBAAoB,CAAC;AAS5C,IAAMC,gBAAgB,GAAGA,CAAA,KAAqBC,OAAO,CAACC,OAAO,CAAC,CAAC;AAE/D,OAAO,SAASC,kBAAkBA,CAAAC,IAAA,EAKO;EAAA,IALN;IACjCC,IAAI;IACJC,QAAQ;IACRC,QAAQ;IACRC,QAAQ,GAAGR;EACY,CAAC,GAAAI,IAA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AAK,EAAEA,KAAM;MACbiC,GAAG,EAAElC,KAAM;MACXmC,MAAM,EAAEX,UAAW;MACnBY,SAAS,EAAEP,aAAc;MACzBQ,QAAQ,EAAEX,YAAa;MACvBY,OAAO,EAAE3B,eAAgB;MACzB4B,aAAa,EAAE5B,eAAgB;MAC/B6B,WAAW,EAAE7B;IAAgB,CAC9B,CAAC,EAEDP,eAAe,iBACdlB,IAAA;MAAK6C,SAAS,EAAC,kBAAkB;MAAAC,QAAA,KAAAS,MAAA,CAAKrC,eAAe;IAAA,CAAQ,CAC9D;EAAA,CACE,CAAC;AAEV;AAEA,eAAeV,kBAAkB"}
@@ -1 +1 @@
1
- {"version":3,"file":"FileListUtils.js","names":["isDirectory","FileUtils","DEFAULT_ROW_HEIGHT","getPathFromItem","file","makePath","filename","getPath","getMoveOperation","draggedItems","targetItem","length","Error","targetPath","some","_ref","item","startsWith","files"],"sources":["../src/FileListUtils.ts"],"sourcesContent":["import { isDirectory } from './FileStorage';\nimport type { FileStorageItem } from './FileStorage';\nimport FileUtils from './FileUtils';\n\nexport const DEFAULT_ROW_HEIGHT = 26;\n\nexport function getPathFromItem(file: FileStorageItem): string {\n return isDirectory(file)\n ? FileUtils.makePath(file.filename)\n : FileUtils.getPath(file.filename);\n}\n\n/**\n * Get the move operation for the current selection and the given target. Throws if the operation is invalid.\n */\nexport function getMoveOperation(\n draggedItems: FileStorageItem[],\n targetItem: FileStorageItem\n): { files: FileStorageItem[]; targetPath: string } {\n if (draggedItems.length === 0 || targetItem == null) {\n throw new Error('No items to move');\n }\n\n const targetPath = getPathFromItem(targetItem);\n if (\n draggedItems.some(\n ({ filename }) => FileUtils.getPath(filename) === targetPath\n )\n ) {\n // Cannot drop if target is one of the dragged items is already in the target folder\n throw new Error('File already in the destination folder');\n }\n if (\n draggedItems.some(\n item =>\n isDirectory(item) &&\n targetPath.startsWith(FileUtils.makePath(item.filename))\n )\n ) {\n // Cannot drop if target is a child of one of the directories being moved\n throw new Error('Destination folder cannot be a child of a dragged folder');\n }\n return { files: draggedItems, targetPath };\n}\n"],"mappings":"SAASA,WAAW;AAAA,OAEbC,SAAS;AAEhB,OAAO,IAAMC,kBAAkB,GAAG,EAAE;AAEpC,OAAO,SAASC,eAAeA,CAACC,IAAqB,EAAU;EAC7D,OAAOJ,WAAW,CAACI,IAAI,CAAC,GACpBH,SAAS,CAACI,QAAQ,CAACD,IAAI,CAACE,QAAQ,CAAC,GACjCL,SAAS,CAACM,OAAO,CAACH,IAAI,CAACE,QAAQ,CAAC;AACtC;;AAEA;AACA;AACA;AACA,OAAO,SAASE,gBAAgBA,CAC9BC,YAA+B,EAC/BC,UAA2B,EACuB;EAClD,IAAID,YAAY,CAACE,MAAM,KAAK,CAAC,IAAID,UAAU,IAAI,IAAI,EAAE;IACnD,MAAM,IAAIE,KAAK,CAAC,kBAAkB,CAAC;EACrC;EAEA,IAAMC,UAAU,GAAGV,eAAe,CAACO,UAAU,CAAC;EAC9C,IACED,YAAY,CAACK,IAAI,CACfC,IAAA;IAAA,IAAC;MAAET;IAAS,CAAC,GAAAS,IAAA;IAAA,OAAKd,SAAS,CAACM,OAAO,CAACD,QAAQ,CAAC,KAAKO,UAAU;EAAA,CAC9D,CAAC,EACD;IACA;IACA,MAAM,IAAID,KAAK,CAAC,wCAAwC,CAAC;EAC3D;EACA,IACEH,YAAY,CAACK,IAAI,CACfE,IAAI,IACFhB,WAAW,CAACgB,IAAI,CAAC,IACjBH,UAAU,CAACI,UAAU,CAAChB,SAAS,CAACI,QAAQ,CAACW,IAAI,CAACV,QAAQ,CAAC,CAC3D,CAAC,EACD;IACA;IACA,MAAM,IAAIM,KAAK,CAAC,0DAA0D,CAAC;EAC7E;EACA,OAAO;IAAEM,KAAK,EAAET,YAAY;IAAEI;EAAW,CAAC;AAC5C","ignoreList":[]}
1
+ {"version":3,"file":"FileListUtils.js","names":["isDirectory","FileUtils","DEFAULT_ROW_HEIGHT","getPathFromItem","file","makePath","filename","getPath","getMoveOperation","draggedItems","targetItem","length","Error","targetPath","some","_ref","item","startsWith","files"],"sources":["../src/FileListUtils.ts"],"sourcesContent":["import { isDirectory } from './FileStorage';\nimport type { FileStorageItem } from './FileStorage';\nimport FileUtils from './FileUtils';\n\nexport const DEFAULT_ROW_HEIGHT = 26;\n\nexport function getPathFromItem(file: FileStorageItem): string {\n return isDirectory(file)\n ? FileUtils.makePath(file.filename)\n : FileUtils.getPath(file.filename);\n}\n\n/**\n * Get the move operation for the current selection and the given target. Throws if the operation is invalid.\n */\nexport function getMoveOperation(\n draggedItems: FileStorageItem[],\n targetItem: FileStorageItem\n): { files: FileStorageItem[]; targetPath: string } {\n if (draggedItems.length === 0 || targetItem == null) {\n throw new Error('No items to move');\n }\n\n const targetPath = getPathFromItem(targetItem);\n if (\n draggedItems.some(\n ({ filename }) => FileUtils.getPath(filename) === targetPath\n )\n ) {\n // Cannot drop if target is one of the dragged items is already in the target folder\n throw new Error('File already in the destination folder');\n }\n if (\n draggedItems.some(\n item =>\n isDirectory(item) &&\n targetPath.startsWith(FileUtils.makePath(item.filename))\n )\n ) {\n // Cannot drop if target is a child of one of the directories being moved\n throw new Error('Destination folder cannot be a child of a dragged folder');\n }\n return { files: draggedItems, targetPath };\n}\n"],"mappings":"SAASA,WAAW;AAAA,OAEbC,SAAS;AAEhB,OAAO,IAAMC,kBAAkB,GAAG,EAAE;AAEpC,OAAO,SAASC,eAAeA,CAACC,IAAqB,EAAU;EAC7D,OAAOJ,WAAW,CAACI,IAAI,CAAC,GACpBH,SAAS,CAACI,QAAQ,CAACD,IAAI,CAACE,QAAQ,CAAC,GACjCL,SAAS,CAACM,OAAO,CAACH,IAAI,CAACE,QAAQ,CAAC;AACtC;;AAEA;AACA;AACA;AACA,OAAO,SAASE,gBAAgBA,CAC9BC,YAA+B,EAC/BC,UAA2B,EACuB;EAClD,IAAID,YAAY,CAACE,MAAM,KAAK,CAAC,IAAID,UAAU,IAAI,IAAI,EAAE;IACnD,MAAM,IAAIE,KAAK,CAAC,kBAAkB,CAAC;EACrC;EAEA,IAAMC,UAAU,GAAGV,eAAe,CAACO,UAAU,CAAC;EAC9C,IACED,YAAY,CAACK,IAAI,CACfC,IAAA;IAAA,IAAC;MAAET;IAAS,CAAC,GAAAS,IAAA;IAAA,OAAKd,SAAS,CAACM,OAAO,CAACD,QAAQ,CAAC,KAAKO,UAAU;EAAA,CAC9D,CAAC,EACD;IACA;IACA,MAAM,IAAID,KAAK,CAAC,wCAAwC,CAAC;EAC3D;EACA,IACEH,YAAY,CAACK,IAAI,CACfE,IAAI,IACFhB,WAAW,CAACgB,IAAI,CAAC,IACjBH,UAAU,CAACI,UAAU,CAAChB,SAAS,CAACI,QAAQ,CAACW,IAAI,CAACV,QAAQ,CAAC,CAC3D,CAAC,EACD;IACA;IACA,MAAM,IAAIM,KAAK,CAAC,0DAA0D,CAAC;EAC7E;EACA,OAAO;IAAEM,KAAK,EAAET,YAAY;IAAEI;EAAW,CAAC;AAC5C"}
@@ -1 +1 @@
1
- {"version":3,"file":"FileNotFoundError.js","names":["FileNotFoundError","Error","constructor","_defineProperty"],"sources":["../src/FileNotFoundError.ts"],"sourcesContent":["class FileNotFoundError extends Error {\n constructor() {\n super('No file exists at the path specified');\n }\n\n isFileNotFound = true;\n}\n\nexport default FileNotFoundError;\n"],"mappings":";;;AAAA,MAAMA,iBAAiB,SAASC,KAAK,CAAC;EACpCC,WAAWA,CAAA,EAAG;IACZ,KAAK,CAAC,sCAAsC,CAAC;IAACC,eAAA,yBAG/B,IAAI;EAFrB;AAGF;AAEA,eAAeH,iBAAiB","ignoreList":[]}
1
+ {"version":3,"file":"FileNotFoundError.js","names":["FileNotFoundError","Error","constructor","_defineProperty"],"sources":["../src/FileNotFoundError.ts"],"sourcesContent":["class FileNotFoundError extends Error {\n constructor() {\n super('No file exists at the path specified');\n }\n\n isFileNotFound = true;\n}\n\nexport default FileNotFoundError;\n"],"mappings":";;;AAAA,MAAMA,iBAAiB,SAASC,KAAK,CAAC;EACpCC,WAAWA,CAAA,EAAG;IACZ,KAAK,CAAC,sCAAsC,CAAC;IAACC,eAAA,yBAG/B,IAAI;EAFrB;AAGF;AAEA,eAAeH,iBAAiB"}
@@ -1 +1 @@
1
- {"version":3,"file":"FileStorage.js","names":["isFileType","type","isDirectory","file"],"sources":["../src/FileStorage.ts"],"sourcesContent":["import { type StorageTable, type StorageItem } from '@deephaven/storage';\n\n/**\n * Basic metadata of the file\n */\nexport interface FileMetadata {\n /** Full path of the file */\n filename: string;\n\n /** Just the file name part of the file (no path) */\n basename: string;\n}\n\nexport type FileType = 'file' | 'directory';\n\nexport function isFileType(type: string): type is FileType {\n return type === 'file' || type === 'directory';\n}\n\nexport interface FileStorageItem extends StorageItem, FileMetadata {\n type: FileType;\n}\n\nexport interface DirectoryStorageItem extends FileStorageItem {\n type: 'directory';\n isExpanded: boolean;\n}\n\nexport function isDirectory(\n file: FileStorageItem\n): file is DirectoryStorageItem {\n return file.type === 'directory';\n}\n\n/**\n * A file including it's contents\n */\nexport interface File extends FileMetadata {\n content: string;\n}\n\nexport interface FileStorageTable extends StorageTable<FileStorageItem> {\n setSearch: (search: string) => void;\n\n /**\n * @param path The path to expand\n * @param expanded What expanded state to set\n */\n setExpanded: (path: string, expanded: boolean) => void;\n\n /**\n * Collapses all directories\n */\n collapseAll: () => void;\n}\n\n/**\n * FileStorage abstraction. Has methods for managing files, and for retrieving a table to browse files.\n */\nexport interface FileStorage {\n /**\n * Retrieve a table to view the file list\n */\n getTable: () => Promise<FileStorageTable>;\n\n /**\n * Save a file\n * @param file The file to save\n */\n saveFile: (file: File) => Promise<File>;\n\n /**\n * Load the contents of a file\n * @param name The file to load, including the full path\n */\n loadFile: (name: string) => Promise<File>;\n\n /**\n * Delete a file\n * @param name The full name of the file to delete\n */\n deleteFile: (name: string) => Promise<void>;\n\n /**\n * Move a file to a new location\n * @param name Source file name\n * @param newName The new file name, including path\n */\n moveFile: (name: string, newName: string) => Promise<void>;\n\n /**\n * Copy a file to a new location\n * @param name The name of the file to copy\n * @param newName The new file name, including path\n */\n copyFile: (name: string, newName: string) => Promise<void>;\n\n /**\n * Get the info for the file at the specified path.\n * If the file does not exists, rejects with a FileNotFoundError\n * @param name The file name to check, including path\n * @returns The FileStorageItem for the path specified, or reject with a FileNotFoundError if it does not exist.\n */\n info: (name: string) => Promise<FileStorageItem>;\n\n /**\n * Create the directory at the given path\n * @param name The full directory path\n */\n createDirectory: (name: string) => Promise<FileStorageItem>;\n}\n\nexport default FileStorage;\n"],"mappings":"AAEA;AACA;AACA;;AAWA,OAAO,SAASA,UAAUA,CAACC,IAAY,EAAoB;EACzD,OAAOA,IAAI,KAAK,MAAM,IAAIA,IAAI,KAAK,WAAW;AAChD;AAWA,OAAO,SAASC,WAAWA,CACzBC,IAAqB,EACS;EAC9B,OAAOA,IAAI,CAACF,IAAI,KAAK,WAAW;AAClC;;AAEA;AACA;AACA;;AAoBA;AACA;AACA","ignoreList":[]}
1
+ {"version":3,"file":"FileStorage.js","names":["isFileType","type","isDirectory","file"],"sources":["../src/FileStorage.ts"],"sourcesContent":["import { type StorageTable, type StorageItem } from '@deephaven/storage';\n\n/**\n * Basic metadata of the file\n */\nexport interface FileMetadata {\n /** Full path of the file */\n filename: string;\n\n /** Just the file name part of the file (no path) */\n basename: string;\n}\n\nexport type FileType = 'file' | 'directory';\n\nexport function isFileType(type: string): type is FileType {\n return type === 'file' || type === 'directory';\n}\n\nexport interface FileStorageItem extends StorageItem, FileMetadata {\n type: FileType;\n}\n\nexport interface DirectoryStorageItem extends FileStorageItem {\n type: 'directory';\n isExpanded: boolean;\n}\n\nexport function isDirectory(\n file: FileStorageItem\n): file is DirectoryStorageItem {\n return file.type === 'directory';\n}\n\n/**\n * A file including it's contents\n */\nexport interface File extends FileMetadata {\n content: string;\n}\n\nexport interface FileStorageTable extends StorageTable<FileStorageItem> {\n setSearch: (search: string) => void;\n\n /**\n * @param path The path to expand\n * @param expanded What expanded state to set\n */\n setExpanded: (path: string, expanded: boolean) => void;\n\n /**\n * Collapses all directories\n */\n collapseAll: () => void;\n}\n\n/**\n * FileStorage abstraction. Has methods for managing files, and for retrieving a table to browse files.\n */\nexport interface FileStorage {\n /**\n * Retrieve a table to view the file list\n */\n getTable: () => Promise<FileStorageTable>;\n\n /**\n * Save a file\n * @param file The file to save\n */\n saveFile: (file: File) => Promise<File>;\n\n /**\n * Load the contents of a file\n * @param name The file to load, including the full path\n */\n loadFile: (name: string) => Promise<File>;\n\n /**\n * Delete a file\n * @param name The full name of the file to delete\n */\n deleteFile: (name: string) => Promise<void>;\n\n /**\n * Move a file to a new location\n * @param name Source file name\n * @param newName The new file name, including path\n */\n moveFile: (name: string, newName: string) => Promise<void>;\n\n /**\n * Copy a file to a new location\n * @param name The name of the file to copy\n * @param newName The new file name, including path\n */\n copyFile: (name: string, newName: string) => Promise<void>;\n\n /**\n * Get the info for the file at the specified path.\n * If the file does not exists, rejects with a FileNotFoundError\n * @param name The file name to check, including path\n * @returns The FileStorageItem for the path specified, or reject with a FileNotFoundError if it does not exist.\n */\n info: (name: string) => Promise<FileStorageItem>;\n\n /**\n * Create the directory at the given path\n * @param name The full directory path\n */\n createDirectory: (name: string) => Promise<FileStorageItem>;\n}\n\nexport default FileStorage;\n"],"mappings":"AAEA;AACA;AACA;;AAWA,OAAO,SAASA,UAAUA,CAACC,IAAY,EAAoB;EACzD,OAAOA,IAAI,KAAK,MAAM,IAAIA,IAAI,KAAK,WAAW;AAChD;AAWA,OAAO,SAASC,WAAWA,CACzBC,IAAqB,EACS;EAC9B,OAAOA,IAAI,CAACF,IAAI,KAAK,WAAW;AAClC;;AAEA;AACA;AACA;;AAoBA;AACA;AACA"}
@@ -1 +1 @@
1
- {"version":3,"file":"FileTestUtils.js","names":["makeFileName","index","arguments","length","undefined","concat","makeDirName","makeFile","basename","path","filename","type","id","makeFiles","count","result","i","push","makeDirectory","isExpanded","makeDirectories","makeNested","directories","fileNum","map","directory","join"],"sources":["../src/FileTestUtils.ts"],"sourcesContent":["import type { DirectoryStorageItem, FileStorageItem } from './FileStorage';\n\n/**\n * Make a file name with prefix 'testfile'\n * @param index Number of the file\n * @returns A string with prefix 'testfile' followed by index\n */\nexport function makeFileName(index = 0): string {\n return `testfile${index}`;\n}\n\n/**\n * Make a directory name with prefix 'testdir'\n * @param index Number of the directory\n * @returns A string with prefix 'testdir' followed by index\n */\nexport function makeDirName(index = 0): string {\n return `testdir${index}`;\n}\n\n/**\n * Make a file object\n * @param basename The basename of the file\n * @param path The path of the file\n * @returns A FileStorageItem object\n */\nexport function makeFile(basename: string, path = '/'): FileStorageItem {\n const filename = `${path}${basename}`;\n return {\n basename,\n filename,\n type: 'file',\n id: filename,\n };\n}\n\n/**\n * Make files from 0 to and not including count\n * @param count The number of files to create (0 to count - 1). Defaults to 5\n * @returns An array of FileStorageItems\n */\nexport function makeFiles(count = 5): FileStorageItem[] {\n const result: FileStorageItem[] = [];\n for (let i = 0; i < count; i += 1) {\n result.push(makeFile(makeFileName(i)));\n }\n return result;\n}\n\n/**\n * Make a directory object\n * @param basename The basename of the directory\n * @param path The path of the directory\n * @returns A DirectoryStorageItem object\n */\nexport function makeDirectory(\n basename: string,\n path = '/'\n): DirectoryStorageItem {\n const filename = `${path}${basename}`;\n return {\n basename,\n filename,\n type: 'directory',\n id: filename,\n isExpanded: false,\n };\n}\n\n/**\n * Make directories from 0 to and not including count\n * @param count The number of directories to create (0 to count - 1). Defaults to 5\n * @returns An array of DirectoryStorageItems\n */\nexport function makeDirectories(count = 5): DirectoryStorageItem[] {\n const result: DirectoryStorageItem[] = [];\n for (let i = 0; i < count; i += 1) {\n result.push(makeDirectory(`testdir${i}`));\n }\n return result;\n}\n\n/**\n * Make a nested file\n * @param directories The nested directories in order\n * @param fileNum Number of the file\n * @returns A FileStorageItem\n */\nexport function makeNested(\n directories: number[],\n fileNum: number\n): FileStorageItem {\n const basename = `/${directories\n .map(directory => makeDirName(directory))\n .join('/')}/`;\n return makeFile(makeFileName(fileNum), basename);\n}\n\nexport default {\n makeFileName,\n makeFile,\n makeF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js","names":["makeFileName","index","arguments","length","undefined","concat","makeDirName","makeFile","basename","path","filename","type","id","makeFiles","count","result","i","push","makeDirectory","isExpanded","makeDirectories","makeNested","directories","fileNum","map","directory","join"],"sources":["../src/FileTestUtils.ts"],"sourcesContent":["import type { DirectoryStorageItem, FileStorageItem } from './FileStorage';\n\n/**\n * Make a file name with prefix 'testfile'\n * @param index Number of the file\n * @returns A string with prefix 'testfile' followed by index\n */\nexport function makeFileName(index = 0): string {\n return `testfile${index}`;\n}\n\n/**\n * Make a directory name with prefix 'testdir'\n * @param index Number of the directory\n * @returns A string with prefix 'testdir' followed by index\n */\nexport function makeDirName(index = 0): string {\n return `testdir${index}`;\n}\n\n/**\n * Make a file object\n * @param basename The basename of the file\n * @param path The path of the file\n * @returns A FileStorageItem object\n */\nexport function makeFile(basename: string, path = '/'): FileStorageItem {\n const filename = `${path}${basename}`;\n return {\n basename,\n filename,\n type: 'file',\n id: filename,\n };\n}\n\n/**\n * Make files from 0 to and not including count\n * @param count The number of files to create (0 to count - 1). Defaults to 5\n * @returns An array of FileStorageItems\n */\nexport function makeFiles(count = 5): FileStorageItem[] {\n const result: FileStorageItem[] = [];\n for (let i = 0; i < count; i += 1) {\n result.push(makeFile(makeFileName(i)));\n }\n return result;\n}\n\n/**\n * Make a directory object\n * @param basename The basename of the directory\n * @param path The path of the directory\n * @returns A DirectoryStorageItem object\n */\nexport function makeDirectory(\n basename: string,\n path = '/'\n): DirectoryStorageItem {\n const filename = `${path}${basename}`;\n return {\n basename,\n filename,\n type: 'directory',\n id: filename,\n isExpanded: false,\n };\n}\n\n/**\n * Make directories from 0 to and not including count\n * @param count The number of directories to create (0 to count - 1). Defaults to 5\n * @returns An array of DirectoryStorageItems\n */\nexport function makeDirectories(count = 5): DirectoryStorageItem[] {\n const result: DirectoryStorageItem[] = [];\n for (let i = 0; i < count; i += 1) {\n result.push(makeDirectory(`testdir${i}`));\n }\n return result;\n}\n\n/**\n * Make a nested file\n * @param directories The nested directories in order\n * @param fileNum Number of the file\n * @returns A FileStorageItem\n */\nexport function makeNested(\n directories: number[],\n fileNum: number\n): FileStorageItem {\n const basename = `/${directories\n .map(directory => makeDirName(directory))\n .join('/')}/`;\n return makeFile(makeFileName(fileNum), basename);\n}\n\nexport default {\n makeFileName,\n makeFile,\n makeFiles,\n makeDirName,\n makeDirectory,\n makeDirectories,\n makeNested,\n};\n"],"mappings":"AAEA;AACA;AACA;AACA;AACA;AACA,OAAO,SAASA,YAAYA,CAAA,EAAoB;EAAA,IAAnBC,KAAK,GAAAC,SAAA,CAAAC,MAAA,QAAAD,SAAA,QAAAE,SAAA,GAAAF,SAAA,MAAG,CAAC;EACpC,kBAAAG,MAAA,CAAkBJ,KAAK;AACzB;;AAEA;AACA;AACA;AACA;AACA;AACA,OAAO,SAASK,WAAWA,CAAA,EAAoB;EAAA,IAAnBL,KAAK,GAAAC,SAAA,CAAAC,MAAA,QAAAD,SAAA,QAAAE,SAAA,GAAAF,SAAA,MAAG,CAAC;EACnC,iBAAAG,MAAA,CAAiBJ,KAAK;AACxB;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,SAASM,QAAQA,CAACC,QAAgB,EAA+B;EAAA,IAA7BC,IAAI,GAAAP,SAAA,CAAAC,MAAA,QAAAD,SAAA,QAAAE,SAAA,GAAAF,SAAA,MAAG,GAAG;EACnD,IAAMQ,QAAQ,MAAAL,MAAA,CAAMI,IAAI,EAAAJ,MAAA,CAAGG,QAAQ,CAAE;EACrC,OAAO;IACLA,QAAQ;IACRE,QAAQ;IACRC,IAAI,EAAE,MAAM;IACZC,EAAE,EAAEF;EACN,CAAC;AACH;;AAEA;AACA;AACA;AACA;AACA;AACA,OAAO,SAASG,SAASA,CAAA,EAA+B;EAAA,IAA9BC,KAAK,GAAAZ,SAAA,CAAAC,MAAA,QAAAD,SAAA,QAAAE,SAAA,GAAAF,SAAA,MAAG,CAAC;EACjC,IAAMa,MAAyB,GAAG,EAAE;EACpC,KAAK,IAAIC,CAAC,GAAG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