@lvce-editor/main-area-worker 8.8.0 → 8.9.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.
@@ -3761,6 +3761,27 @@ const refresh = state => {
3761
3761
 
3762
3762
  const getCss = () => {
3763
3763
  const rules = [`.MainArea {
3764
+ }`, `.editor-groups-container {
3765
+ position: relative;
3766
+ }`, `.Sash {
3767
+ position: absolute;
3768
+ z-index: 1;
3769
+ }`, `.SashVertical {
3770
+ top: 0;
3771
+ bottom: 0;
3772
+ width: 0;
3773
+ cursor: col-resize;
3774
+ }`, `.SashVertical:hover {
3775
+ width: 4px;
3776
+ margin-left: -2px;
3777
+ }`, `.SashHorizontal {
3778
+ left: 0;
3779
+ right: 0;
3780
+ height: 0;
3781
+ cursor: row-resize;
3782
+ }`, `.SashHorizontal:hover {
3783
+ height: 4px;
3784
+ margin-top: -2px;
3764
3785
  }`];
3765
3786
  const css = rules.join('\n');
3766
3787
  return css;
@@ -4294,8 +4315,8 @@ const renderEmptyGroupCloseButton = (group, groupIndex) => {
4294
4315
  return [{
4295
4316
  childCount: 1,
4296
4317
  className: EmptyGroupCloseButton,
4297
- 'data-action': 'close-group',
4298
4318
  'data-groupId': String(group.id),
4319
+ name: 'close-group',
4299
4320
  onClick: HandleClickAction,
4300
4321
  title: closeEditorGroup(),
4301
4322
  type: Button$2
@@ -4331,14 +4352,15 @@ const renderEditorGroup = (group, groupIndex, splitButtonEnabled = false, sizePr
4331
4352
  }, ...renderEditor(activeTab)];
4332
4353
  };
4333
4354
 
4334
- const renderSash = (direction, sashId) => {
4355
+ const renderSash = (direction, sashId, style) => {
4335
4356
  return {
4336
4357
  childCount: 0,
4337
- className: direction === 'horizontal' ? 'SashVertical' : 'SashHorizontal',
4358
+ className: direction === 'horizontal' ? 'Sash SashVertical' : 'Sash SashHorizontal',
4338
4359
  'data-sashId': sashId,
4339
4360
  onPointerDown: HandleSashPointerDown,
4340
4361
  onPointerMove: HandleSashPointerMove,
4341
4362
  onPointerUp: HandleSashPointerUp,
4363
+ style,
4342
4364
  type: Div
4343
4365
  };
4344
4366
  };
@@ -4356,13 +4378,16 @@ const getMainAreaVirtualDom = (layout, splitButtonEnabled = false) => {
4356
4378
  const isSplit = layout.groups.length > 1;
4357
4379
  const directionClassName = isSplit ? layout.direction === 'horizontal' ? EditorGroupsVertical : EditorGroupsHorizontal : '';
4358
4380
  const editorGroupsContainerClassName = directionClassName ? `${EDITOR_GROUPS_CONTAINER} ${directionClassName}` : EDITOR_GROUPS_CONTAINER;
4381
+ let sashOffset = 0;
4359
4382
  for (let i = 0; i < layout.groups.length; i++) {
4383
+ sashOffset += layout.groups[i].size;
4360
4384
  if (i > 0) {
4361
4385
  // Insert sash between groups
4362
4386
  const beforeGroupId = layout.groups[i - 1].id;
4363
4387
  const afterGroupId = layout.groups[i].id;
4364
4388
  const sashId = create(beforeGroupId, afterGroupId);
4365
- children.push(renderSash(layout.direction, sashId));
4389
+ const style = layout.direction === 'horizontal' ? `left:${sashOffset - layout.groups[i].size}%;` : `top:${sashOffset - layout.groups[i].size}%;`;
4390
+ children.push(renderSash(layout.direction, sashId, style));
4366
4391
  }
4367
4392
  children.push(...renderEditorGroup(layout.groups[i], i, splitButtonEnabled, sizeProperty));
4368
4393
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lvce-editor/main-area-worker",
3
- "version": "8.8.0",
3
+ "version": "8.9.0",
4
4
  "description": "Main Area Worker",
5
5
  "repository": {
6
6
  "type": "git",