@lvce-editor/editor-worker 3.1.0 → 3.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/editorWorkerMain.js +21 -8
- package/package.json +1 -1
package/dist/editorWorkerMain.js
CHANGED
|
@@ -116,6 +116,8 @@ const ColorPickerLight = 'ColorPickerLight';
|
|
|
116
116
|
const ColorPickerRectangle = 'ColorPickerRectangle';
|
|
117
117
|
const ColorPickerSlider = 'ColorPickerSlider';
|
|
118
118
|
const ColorPickerSliderThumb = 'ColorPickerSliderThumb';
|
|
119
|
+
const CompletionDetailCloseButton = 'CompletionDetailCloseButton';
|
|
120
|
+
const CompletionDetailContent = 'CompletionDetailContent';
|
|
119
121
|
const Diagnostic = 'Diagnostic';
|
|
120
122
|
const EditorCompletionItem = 'EditorCompletionItem';
|
|
121
123
|
const EditorCompletionItemDeprecated = 'EditorCompletionItemDeprecated';
|
|
@@ -131,11 +133,14 @@ const HoverEditorRow = 'HoverEditorRow';
|
|
|
131
133
|
const HoverProblem = 'HoverProblem';
|
|
132
134
|
const HoverProblemDetail = 'HoverProblemDetail';
|
|
133
135
|
const HoverProblemMessage = 'HoverProblemMessage';
|
|
136
|
+
const IconClose = 'IconClose';
|
|
134
137
|
const Label = 'Label';
|
|
138
|
+
const MaskIcon = 'MaskIcon';
|
|
135
139
|
const Viewlet = 'Viewlet';
|
|
136
140
|
|
|
137
141
|
const HandlePointerDown = 'handlePointerDown';
|
|
138
142
|
const HandleSashPointerDown = 'handleSashPointerDown';
|
|
143
|
+
const HandleClose = 'handleClose';
|
|
139
144
|
|
|
140
145
|
const mergeClassNames = (...classNames) => {
|
|
141
146
|
return classNames.filter(Boolean).join(' ');
|
|
@@ -6791,9 +6796,6 @@ const openDetails = editor => {
|
|
|
6791
6796
|
return editor;
|
|
6792
6797
|
}
|
|
6793
6798
|
const widget = create();
|
|
6794
|
-
console.log({
|
|
6795
|
-
child
|
|
6796
|
-
});
|
|
6797
6799
|
const newestState = {
|
|
6798
6800
|
...widget.newState,
|
|
6799
6801
|
content: 'abc',
|
|
@@ -8539,14 +8541,20 @@ const EditorCompletionWidget = {
|
|
|
8539
8541
|
const getCompletionDetailVirtualDom = content => {
|
|
8540
8542
|
const dom = [{
|
|
8541
8543
|
type: Div,
|
|
8544
|
+
className: 'Viewlet EditorCompletionDetails',
|
|
8542
8545
|
childCount: 2
|
|
8543
8546
|
}, {
|
|
8544
8547
|
type: Div,
|
|
8545
|
-
className:
|
|
8548
|
+
className: CompletionDetailContent,
|
|
8546
8549
|
childCount: 1
|
|
8547
8550
|
}, text(content), {
|
|
8548
8551
|
type: Div,
|
|
8549
|
-
className:
|
|
8552
|
+
className: CompletionDetailCloseButton,
|
|
8553
|
+
onClick: HandleClose,
|
|
8554
|
+
childCount: 1
|
|
8555
|
+
}, {
|
|
8556
|
+
type: Div,
|
|
8557
|
+
className: `${MaskIcon} ${IconClose}`,
|
|
8550
8558
|
childCount: 0
|
|
8551
8559
|
}];
|
|
8552
8560
|
return dom;
|
|
@@ -8558,7 +8566,7 @@ const renderContent = {
|
|
|
8558
8566
|
},
|
|
8559
8567
|
apply(oldState, newState) {
|
|
8560
8568
|
const dom = getCompletionDetailVirtualDom(newState.content);
|
|
8561
|
-
return ['
|
|
8569
|
+
return ['Viewlet.setDom2', newState.uid, dom];
|
|
8562
8570
|
}
|
|
8563
8571
|
};
|
|
8564
8572
|
const renderBounds = {
|
|
@@ -8591,7 +8599,11 @@ const render$1 = (oldState, newState) => {
|
|
|
8591
8599
|
const wrappedCommands = [];
|
|
8592
8600
|
const uid = newState.uid;
|
|
8593
8601
|
for (const command of commands) {
|
|
8594
|
-
|
|
8602
|
+
if (command[0] === 'Viewlet.setDom2') {
|
|
8603
|
+
wrappedCommands.push(command);
|
|
8604
|
+
} else {
|
|
8605
|
+
wrappedCommands.push(['Viewlet.send', uid, ...command]);
|
|
8606
|
+
}
|
|
8595
8607
|
}
|
|
8596
8608
|
return wrappedCommands;
|
|
8597
8609
|
};
|
|
@@ -8602,8 +8614,9 @@ const add = widget => {
|
|
|
8602
8614
|
// that doesn't collide with ids created in renderer worker?
|
|
8603
8615
|
const uid = widget.newState.uid;
|
|
8604
8616
|
const allCommands = [];
|
|
8605
|
-
allCommands.push(['Viewlet.
|
|
8617
|
+
allCommands.push(['Viewlet.createFunctionalRoot', id, uid]);
|
|
8606
8618
|
allCommands.push(...commands);
|
|
8619
|
+
allCommands.push(['Viewlet.send', uid, 'appendWidget']);
|
|
8607
8620
|
return allCommands;
|
|
8608
8621
|
};
|
|
8609
8622
|
const remove = widget => {
|