Skip to content

Commit

Permalink
fix: uniscript entry is displayed in zen mode (#1842)
Browse files Browse the repository at this point in the history
* fix: uniscript entry is displayed in zen mode

* refactor: update demo data
  • Loading branch information
Jocs committed Apr 10, 2024
1 parent 55e0869 commit 337af7d
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 11 deletions.
19 changes: 12 additions & 7 deletions examples/src/data/docs/default-document-data-en.ts
Expand Up @@ -25,6 +25,7 @@ import {
SectionType,
WrapTextType,
} from '@univerjs/core';
import { ptToPixel } from '@univerjs/engine-render';

export const DEFAULT_DOCUMENT_DATA_EN: IDocumentData = {
id: 'd',
Expand Down Expand Up @@ -399,7 +400,7 @@ export const DEFAULT_DOCUMENT_DATA_EN: IDocumentData = {
startIndex: 2629,
columnProperties: [
{
width: 200,
width: 300,
paddingEnd: 5,
},
],
Expand All @@ -418,13 +419,17 @@ export const DEFAULT_DOCUMENT_DATA_EN: IDocumentData = {
},
documentStyle: {
pageSize: {
width: 594.3,
height: 840.51,
width: ptToPixel(595),
height: ptToPixel(842),
},
marginTop: ptToPixel(50),
marginBottom: ptToPixel(50),
marginRight: ptToPixel(50),
marginLeft: ptToPixel(50),
renderConfig: {
vertexAngle: 0,
centerAngle: 0,
},
marginTop: 72,
marginBottom: 72,
marginRight: 90,
marginLeft: 90,
// gridType: GridType.LINES_AND_CHARS,
// linePitch: 24,
// charSpace: 12,
Expand Down
4 changes: 2 additions & 2 deletions examples/src/docs/main.ts
Expand Up @@ -23,7 +23,7 @@ import { UniverRenderEnginePlugin } from '@univerjs/engine-render';
import { UniverUIPlugin } from '@univerjs/ui';

import { UniverFormulaEnginePlugin } from '@univerjs/engine-formula';
import { DEFAULT_DOCUMENT_DATA_CN } from '../data';
import { DEFAULT_DOCUMENT_DATA_EN } from '../data';
import { DebuggerPlugin } from '../plugins/debugger';
import { locales } from './locales';

Expand Down Expand Up @@ -61,7 +61,7 @@ univer.registerPlugin(UniverDocsUIPlugin, {
},
});

univer.createUniverDoc(DEFAULT_DOCUMENT_DATA_CN);
univer.createUniverDoc(DEFAULT_DOCUMENT_DATA_EN);

// use for console test
declare global {
Expand Down
5 changes: 3 additions & 2 deletions packages/uniscript/src/controllers/menu.ts
Expand Up @@ -15,9 +15,10 @@
*/

import type { IMenuButtonItem } from '@univerjs/ui';
import { MenuItemType, MenuPosition } from '@univerjs/ui';
import { getMenuHiddenObservable, MenuItemType, MenuPosition } from '@univerjs/ui';
import type { IAccessor } from '@wendellhu/redi';

import { UniverInstanceType } from '@univerjs/core';
import { ToggleScriptPanelOperation } from '../commands/operations/panel.operation';

export function UniscriptMenuItemFactory(accessor: IAccessor): IMenuButtonItem {
Expand All @@ -29,7 +30,7 @@ export function UniscriptMenuItemFactory(accessor: IAccessor): IMenuButtonItem {
type: MenuItemType.BUTTON,
positions: [MenuPosition.TOOLBAR_START],
// FIXME hidden$ and disabled$ are not correctly in doc
// hidden$: getMenuHiddenObservable(accessor, UniverInstanceType.SHEET),
hidden$: getMenuHiddenObservable(accessor, UniverInstanceType.SHEET),
// disabled$: getCurrentSheetDisabled$(accessor),
};
}

0 comments on commit 337af7d

Please sign in to comment.