@lvce-editor/main-area-worker 8.10.0 → 8.11.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/mainAreaWorkerMain.js +12 -13
- package/package.json +1 -1
|
@@ -3191,8 +3191,8 @@ const parse = sashId => {
|
|
|
3191
3191
|
if (!beforeRaw || !afterRaw) {
|
|
3192
3192
|
return undefined;
|
|
3193
3193
|
}
|
|
3194
|
-
const beforeGroupId = Number.
|
|
3195
|
-
const afterGroupId = Number.
|
|
3194
|
+
const beforeGroupId = Number.parseFloat(beforeRaw);
|
|
3195
|
+
const afterGroupId = Number.parseFloat(afterRaw);
|
|
3196
3196
|
if (!Number.isFinite(beforeGroupId) || !Number.isFinite(afterGroupId)) {
|
|
3197
3197
|
return undefined;
|
|
3198
3198
|
}
|
|
@@ -4371,8 +4371,6 @@ const renderSash = (direction, sashId, style) => {
|
|
|
4371
4371
|
className: direction === 'horizontal' ? 'Sash SashVertical' : 'Sash SashHorizontal',
|
|
4372
4372
|
'data-sashId': sashId,
|
|
4373
4373
|
onPointerDown: HandleSashPointerDown,
|
|
4374
|
-
onPointerMove: HandleSashPointerMove,
|
|
4375
|
-
onPointerUp: HandleSashPointerUp,
|
|
4376
4374
|
style,
|
|
4377
4375
|
type: Div
|
|
4378
4376
|
}];
|
|
@@ -4387,18 +4385,19 @@ const renderSingleEditorGroup = (layout, splitButtonEnabled, sizeProperty) => {
|
|
|
4387
4385
|
};
|
|
4388
4386
|
|
|
4389
4387
|
const getMainAreaVirtualDom = (layout, splitButtonEnabled = false) => {
|
|
4390
|
-
const
|
|
4391
|
-
|
|
4388
|
+
const {
|
|
4389
|
+
direction,
|
|
4390
|
+
groups
|
|
4391
|
+
} = layout;
|
|
4392
|
+
const sizeProperty = direction === 'vertical' ? 'height' : 'width';
|
|
4393
|
+
if (groups.length === 1) {
|
|
4392
4394
|
return renderSingleEditorGroup(layout, splitButtonEnabled, sizeProperty);
|
|
4393
4395
|
}
|
|
4394
4396
|
const children = [];
|
|
4395
|
-
const isSplit =
|
|
4396
|
-
const directionClassName = isSplit ?
|
|
4397
|
+
const isSplit = groups.length > 1;
|
|
4398
|
+
const directionClassName = isSplit ? direction === 'horizontal' ? EditorGroupsVertical : EditorGroupsHorizontal : '';
|
|
4397
4399
|
const editorGroupsContainerClassName = directionClassName ? `${EDITOR_GROUPS_CONTAINER} ${directionClassName}` : EDITOR_GROUPS_CONTAINER;
|
|
4398
4400
|
let sashOffset = 0;
|
|
4399
|
-
const {
|
|
4400
|
-
groups
|
|
4401
|
-
} = layout;
|
|
4402
4401
|
for (let i = 0; i < groups.length; i++) {
|
|
4403
4402
|
sashOffset += groups[i].size;
|
|
4404
4403
|
if (i > 0) {
|
|
@@ -4406,8 +4405,8 @@ const getMainAreaVirtualDom = (layout, splitButtonEnabled = false) => {
|
|
|
4406
4405
|
const beforeGroupId = groups[i - 1].id;
|
|
4407
4406
|
const afterGroupId = groups[i].id;
|
|
4408
4407
|
const sashId = create(beforeGroupId, afterGroupId);
|
|
4409
|
-
const style =
|
|
4410
|
-
children.push(...renderSash(
|
|
4408
|
+
const style = direction === 'horizontal' ? `left:${sashOffset - groups[i].size}%;` : `top:${sashOffset - groups[i].size}%;`;
|
|
4409
|
+
children.push(...renderSash(direction, sashId, style));
|
|
4411
4410
|
}
|
|
4412
4411
|
children.push(...renderEditorGroup(groups[i], i, splitButtonEnabled, sizeProperty));
|
|
4413
4412
|
}
|