@lvce-editor/explorer-view 3.17.0 → 3.18.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/explorerViewWorkerMain.js +55 -25
- package/package.json +1 -1
|
@@ -1137,13 +1137,13 @@ const Remove = 5;
|
|
|
1137
1137
|
|
|
1138
1138
|
const Text = 12;
|
|
1139
1139
|
|
|
1140
|
-
const
|
|
1140
|
+
const Button$3 = 'event.button';
|
|
1141
1141
|
const ClientX = 'event.clientX';
|
|
1142
1142
|
const ClientY = 'event.clientY';
|
|
1143
|
-
const
|
|
1143
|
+
const CtrlKey = 'event.ctrlKey';
|
|
1144
1144
|
const DeltaMode = 'event.deltaMode';
|
|
1145
1145
|
const DeltaY = 'event.deltaY';
|
|
1146
|
-
const
|
|
1146
|
+
const TargetValue = 'event.target.value';
|
|
1147
1147
|
|
|
1148
1148
|
const Enter = 3;
|
|
1149
1149
|
const Escape = 8;
|
|
@@ -1172,6 +1172,7 @@ const RendererWorker$1 = 1;
|
|
|
1172
1172
|
|
|
1173
1173
|
const FocusElementByName = 'Viewlet.focusElementByName';
|
|
1174
1174
|
const FocusSelector = 'Viewlet.focusSelector';
|
|
1175
|
+
const SetCss = 'Viewlet.setCss';
|
|
1175
1176
|
const SetFocusContext = 'Viewlet.setFocusContext';
|
|
1176
1177
|
|
|
1177
1178
|
const FocusExplorer = 13;
|
|
@@ -2700,7 +2701,8 @@ const create2 = (uid, uri, x, y, width, height, args, parentUid, platform = 0) =
|
|
|
2700
2701
|
cutItems: [],
|
|
2701
2702
|
isPointerDown: false,
|
|
2702
2703
|
pointerDownIndex: -1,
|
|
2703
|
-
sourceControlIgnoredUris: []
|
|
2704
|
+
sourceControlIgnoredUris: [],
|
|
2705
|
+
maxIndent: 0
|
|
2704
2706
|
};
|
|
2705
2707
|
set(uid, state, state);
|
|
2706
2708
|
};
|
|
@@ -2752,12 +2754,17 @@ const create = (id, uri, x, y, width, height, args, parentUid, platform = 0) =>
|
|
|
2752
2754
|
cutItems: [],
|
|
2753
2755
|
isPointerDown: false,
|
|
2754
2756
|
pointerDownIndex: -1,
|
|
2755
|
-
sourceControlIgnoredUris: []
|
|
2757
|
+
sourceControlIgnoredUris: [],
|
|
2758
|
+
maxIndent: 0
|
|
2756
2759
|
};
|
|
2757
2760
|
set(state.uid, state, state);
|
|
2758
2761
|
return state;
|
|
2759
2762
|
};
|
|
2760
2763
|
|
|
2764
|
+
const isEqual$6 = (oldState, newState) => {
|
|
2765
|
+
return oldState.scrollBarHeight === newState.scrollBarHeight && oldState.scrollBarActive === newState.scrollBarActive;
|
|
2766
|
+
};
|
|
2767
|
+
|
|
2761
2768
|
const isEqual$5 = (oldState, newState) => {
|
|
2762
2769
|
return oldState.isPointerDown || !newState.isPointerDown;
|
|
2763
2770
|
};
|
|
@@ -2780,6 +2787,7 @@ const RenderFocusContext = 7;
|
|
|
2780
2787
|
const RenderValue = 8;
|
|
2781
2788
|
const RenderSelection = 9;
|
|
2782
2789
|
const RenderDragData = 10;
|
|
2790
|
+
const RenderCss = 11;
|
|
2783
2791
|
|
|
2784
2792
|
const isEqual$1 = (oldState, newState) => {
|
|
2785
2793
|
if (newState.focus !== Input$1) {
|
|
@@ -2788,8 +2796,8 @@ const isEqual$1 = (oldState, newState) => {
|
|
|
2788
2796
|
return oldState.focus === Input$1 && newState.focus === Input$1 && oldState.editingValue === newState.editingValue;
|
|
2789
2797
|
};
|
|
2790
2798
|
|
|
2791
|
-
const modules = [isEqual$3, isEqual$4, isEqual$4, isEqual$1, isEqual$2, isEqual$5];
|
|
2792
|
-
const numbers = [RenderItems, RenderFocus, RenderFocusContext, RenderValue, RenderSelection, RenderDragData];
|
|
2799
|
+
const modules = [isEqual$3, isEqual$4, isEqual$4, isEqual$1, isEqual$2, isEqual$5, isEqual$6];
|
|
2800
|
+
const numbers = [RenderItems, RenderFocus, RenderFocusContext, RenderValue, RenderSelection, RenderDragData, RenderCss];
|
|
2793
2801
|
|
|
2794
2802
|
const diff = (oldState, newState) => {
|
|
2795
2803
|
const diffResult = [];
|
|
@@ -4993,7 +5001,8 @@ const loadContent = async (state, savedState) => {
|
|
|
4993
5001
|
pathSeparator,
|
|
4994
5002
|
excluded,
|
|
4995
5003
|
useChevrons,
|
|
4996
|
-
confirmDelete
|
|
5004
|
+
confirmDelete,
|
|
5005
|
+
maxIndent: 10
|
|
4997
5006
|
};
|
|
4998
5007
|
};
|
|
4999
5008
|
|
|
@@ -5307,6 +5316,30 @@ const renameDirent = state => {
|
|
|
5307
5316
|
};
|
|
5308
5317
|
};
|
|
5309
5318
|
|
|
5319
|
+
const defaultIndent$1 = 1;
|
|
5320
|
+
const getTreeItemIndent = depth => {
|
|
5321
|
+
return `${depth * defaultIndent$1}rem`;
|
|
5322
|
+
};
|
|
5323
|
+
|
|
5324
|
+
const renderCss = (oldState, newState) => {
|
|
5325
|
+
const {
|
|
5326
|
+
scrollBarHeight,
|
|
5327
|
+
uid,
|
|
5328
|
+
maxIndent
|
|
5329
|
+
} = newState;
|
|
5330
|
+
const rules = [`.Explorer {
|
|
5331
|
+
--ScrollBarThumbHeight: ${scrollBarHeight}px;
|
|
5332
|
+
`];
|
|
5333
|
+
for (let i = 0; i < maxIndent; i++) {
|
|
5334
|
+
const indent = getTreeItemIndent(i);
|
|
5335
|
+
rules.push(`.Indent-${i} {
|
|
5336
|
+
padding-left: ${indent}px;
|
|
5337
|
+
}`);
|
|
5338
|
+
}
|
|
5339
|
+
const css = rules.join('\n');
|
|
5340
|
+
return [SetCss, uid, css];
|
|
5341
|
+
};
|
|
5342
|
+
|
|
5310
5343
|
const getDragLabel = urls => {
|
|
5311
5344
|
if (urls.length === 1) {
|
|
5312
5345
|
return getBaseName('/', urls[0]);
|
|
@@ -5528,7 +5561,10 @@ const getInputClassName = hasEditingError => {
|
|
|
5528
5561
|
return ExplorerInputBox;
|
|
5529
5562
|
};
|
|
5530
5563
|
|
|
5531
|
-
const getInputDom = hasEditingError => {
|
|
5564
|
+
const getInputDom = (isEditing, hasEditingError) => {
|
|
5565
|
+
if (!isEditing) {
|
|
5566
|
+
return [];
|
|
5567
|
+
}
|
|
5532
5568
|
const ariaLabel = typeAFileName();
|
|
5533
5569
|
return [{
|
|
5534
5570
|
type: Input,
|
|
@@ -5551,7 +5587,10 @@ const label = {
|
|
|
5551
5587
|
className: Label,
|
|
5552
5588
|
childCount: 1
|
|
5553
5589
|
};
|
|
5554
|
-
const getLabelDom = (name, isDimmed) => {
|
|
5590
|
+
const getLabelDom = (isEditing, name, isDimmed) => {
|
|
5591
|
+
if (isEditing) {
|
|
5592
|
+
return [];
|
|
5593
|
+
}
|
|
5555
5594
|
if (isDimmed) {
|
|
5556
5595
|
return [{
|
|
5557
5596
|
type: Div,
|
|
@@ -5562,13 +5601,6 @@ const getLabelDom = (name, isDimmed) => {
|
|
|
5562
5601
|
return [label, text(name)];
|
|
5563
5602
|
};
|
|
5564
5603
|
|
|
5565
|
-
const getInputOrLabelDom = (isEditing, hasEditingError, name, isCut, isIgnored) => {
|
|
5566
|
-
if (isEditing) {
|
|
5567
|
-
return getInputDom(hasEditingError);
|
|
5568
|
-
}
|
|
5569
|
-
return getLabelDom(name, isCut || isIgnored);
|
|
5570
|
-
};
|
|
5571
|
-
|
|
5572
5604
|
const getExplorerItemVirtualDom = item => {
|
|
5573
5605
|
const {
|
|
5574
5606
|
ariaExpanded,
|
|
@@ -5605,7 +5637,7 @@ const getExplorerItemVirtualDom = item => {
|
|
|
5605
5637
|
ariaDescription: '',
|
|
5606
5638
|
id,
|
|
5607
5639
|
'data-index': index
|
|
5608
|
-
}, ...chevronDom, getFileIconVirtualDom(icon), ...
|
|
5640
|
+
}, ...chevronDom, getFileIconVirtualDom(icon), ...getInputDom(isEditing, hasEditingError), ...getLabelDom(isEditing, name, isCut || isIgnored)];
|
|
5609
5641
|
};
|
|
5610
5642
|
|
|
5611
5643
|
const getActiveDescendant = focusedIndex => {
|
|
@@ -5740,8 +5772,9 @@ const getExpandedType = type => {
|
|
|
5740
5772
|
}
|
|
5741
5773
|
};
|
|
5742
5774
|
|
|
5743
|
-
const getTreeItemClassName = (isSelected, isFocused, isDropping) => {
|
|
5775
|
+
const getTreeItemClassName = (isSelected, isFocused, isDropping, useChevrons, depth) => {
|
|
5744
5776
|
let className = TreeItem;
|
|
5777
|
+
className = mergeClassNames(className, `Indent-${depth}`);
|
|
5745
5778
|
if (isSelected || isFocused) {
|
|
5746
5779
|
className = mergeClassNames(className, TreeItemActive);
|
|
5747
5780
|
}
|
|
@@ -5751,11 +5784,6 @@ const getTreeItemClassName = (isSelected, isFocused, isDropping) => {
|
|
|
5751
5784
|
return className;
|
|
5752
5785
|
};
|
|
5753
5786
|
|
|
5754
|
-
const defaultIndent$1 = 1;
|
|
5755
|
-
const getTreeItemIndent = depth => {
|
|
5756
|
-
return `${depth * defaultIndent$1}rem`;
|
|
5757
|
-
};
|
|
5758
|
-
|
|
5759
5787
|
// TODO make all of these variable configurable
|
|
5760
5788
|
const defaultPaddingLeft = 4;
|
|
5761
5789
|
const defaultIndent = 8;
|
|
@@ -5792,7 +5820,7 @@ const getVisibleExplorerItems = (items, minLineY, maxLineY, focusedIndex, editin
|
|
|
5792
5820
|
const isCut = cutItems.includes(item.path);
|
|
5793
5821
|
const isDropping = dropTargets.includes(i);
|
|
5794
5822
|
const isIgnored = sourceControlIgnoredUris.includes(item.path);
|
|
5795
|
-
const className = getTreeItemClassName(isSelected, isFocused, isDropping); // TODO compute classname in dom function
|
|
5823
|
+
const className = getTreeItemClassName(isSelected, isFocused, isDropping, useChevrons, item.depth); // TODO compute classname in dom function
|
|
5796
5824
|
const expanded = getExpandedType(item.type);
|
|
5797
5825
|
const ariaExpanded = ariaExpandedValues[expanded];
|
|
5798
5826
|
const isEditing = i === editingIndex;
|
|
@@ -5886,6 +5914,8 @@ const getRenderer = diffType => {
|
|
|
5886
5914
|
return renderEditingSelection;
|
|
5887
5915
|
case RenderDragData:
|
|
5888
5916
|
return renderDragData;
|
|
5917
|
+
case RenderCss:
|
|
5918
|
+
return renderCss;
|
|
5889
5919
|
default:
|
|
5890
5920
|
throw new Error('unknown renderer');
|
|
5891
5921
|
}
|