Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(sheet): editor shortcuts #332

Merged
merged 42 commits into from
Oct 27, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
42 commits
Select commit Hold shift + click to select a range
911ac51
refactor(sheet): sheet selection and theme
DR-Univer Oct 24, 2023
a363c61
refactor(sheet): sheet selection and theme
DR-Univer Oct 24, 2023
262061b
fix(sheet): conflict
DR-Univer Oct 24, 2023
0c3ecc3
fix(sheet): import error
DR-Univer Oct 24, 2023
5d4113a
fix(sheet): import error
DR-Univer Oct 24, 2023
2794d64
fix(sheet): test error
DR-Univer Oct 24, 2023
7748137
feat(sheet): editor shortcuts
DR-Univer Oct 26, 2023
686541a
fix(ui-sheets): fix potential null subscription handling (#333)
jikkai Oct 27, 2023
5ead17e
chore: upgrade dependencies (#327)
jikkai Oct 27, 2023
bc362ae
feat: refactor `ColorPicker` (#329)
jikkai Oct 27, 2023
53907ad
fix(sheet): render refresh
DR-Univer Oct 27, 2023
6decc81
fix(sheet): code review fix
DR-Univer Oct 27, 2023
b6bbda4
refactor(sheet): sheet selection and theme
DR-Univer Oct 24, 2023
59b0f26
fix(sheet): import error
DR-Univer Oct 24, 2023
e51200b
feat(sheet): editor shortcuts
DR-Univer Oct 26, 2023
3710e69
fix(sheet): render refresh
DR-Univer Oct 27, 2023
ce6137f
fix(sheet): code review fix
DR-Univer Oct 27, 2023
b4c4719
fix(sheet): conflict
DR-Univer Oct 27, 2023
bba7631
fix(sheet): ts check
DR-Univer Oct 27, 2023
84d11d1
fix(sheet): test fix
DR-Univer Oct 27, 2023
c1685de
fix(sheet): expand method
DR-Univer Oct 27, 2023
6d41329
fix(sheet): expand error
DR-Univer Oct 27, 2023
5189c13
feat(design): create `design` repo for developing UI components (#335)
jikkai Oct 27, 2023
bc028b7
fix(sheet): type error
DR-Univer Oct 27, 2023
99a43bb
fix(sheet): uppercase letters
DR-Univer Oct 27, 2023
9e67e0a
refactor(sheet): sheet selection and theme
DR-Univer Oct 24, 2023
4ccd9fc
fix(sheet): import error
DR-Univer Oct 24, 2023
7a057da
feat(sheet): editor shortcuts
DR-Univer Oct 26, 2023
ee3219d
fix(sheet): render refresh
DR-Univer Oct 27, 2023
bf4ea52
fix(sheet): code review fix
DR-Univer Oct 27, 2023
058b724
refactor(sheet): sheet selection and theme
DR-Univer Oct 24, 2023
9f2baaa
refactor(sheet): sheet selection and theme
DR-Univer Oct 24, 2023
bfd66e8
fix(sheet): import error
DR-Univer Oct 24, 2023
6597a50
feat(sheet): editor shortcuts
DR-Univer Oct 26, 2023
c6a2cd6
fix(sheet): render refresh
DR-Univer Oct 27, 2023
8d3c79b
fix(sheet): code review fix
DR-Univer Oct 27, 2023
c5a2240
fix(sheet): ts check
DR-Univer Oct 27, 2023
9908a07
fix(sheet): test fix
DR-Univer Oct 27, 2023
fde0338
fix(sheet): expand method
DR-Univer Oct 27, 2023
d574ebf
fix(sheet): expand error
DR-Univer Oct 27, 2023
8735506
fix(sheet): type error
DR-Univer Oct 27, 2023
3a6bb62
fix(sheet): conflict
DR-Univer Oct 27, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 13 additions & 12 deletions examples/univer-doc-ts/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,27 +21,28 @@
"dev:demo": "node ./esbuild.config.mjs --watch"
},
"dependencies": {
"@univerjs/base-docs": "workspace:^0.0.1",
"@univerjs/base-render": "workspace:^0.0.1",
"@univerjs/base-ui": "workspace:^0.0.1",
"@univerjs/common-plugin-data": "workspace:^0.0.1",
"@univerjs/core": "workspace:^0.0.1",
"@univerjs/ui-plugin-docs": "workspace:^0.0.1",
"@univerjs/base-docs": "workspace:*",
"@univerjs/base-render": "workspace:*",
"@univerjs/base-ui": "workspace:*",
"@univerjs/common-plugin-data": "workspace:*",
"@univerjs/core": "workspace:*",
"@univerjs/design": "workspace:*",
"@univerjs/ui-plugin-docs": "workspace:*",
"react": "^18.2.0",
"react-dom": "^18.2.0"
},
"devDependencies": {
"@types/node": "^18.14.0",
"@types/react": "^18.2.22",
"@types/react-dom": "^18.2.7",
"@vitest/coverage-v8": "^0.34.5",
"esbuild": "^0.19.3",
"@types/node": "^20.8.9",
"@types/react": "^18.2.33",
"@types/react-dom": "^18.2.14",
"@vitest/coverage-v8": "^0.34.6",
"esbuild": "^0.19.5",
"esbuild-plugin-clean": "^1.0.1",
"esbuild-plugin-copy": "^2.1.1",
"esbuild-style-plugin": "^1.6.2",
"less": "^4.2.0",
"minimist": "^1.2.8",
"ts-node": "^10.9.1",
"vitest": "^0.34.5"
"vitest": "^0.34.6"
}
}
3 changes: 2 additions & 1 deletion examples/univer-doc-ts/src/main.tsx
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
import { DocPlugin } from '@univerjs/base-docs';
import { RenderEngine } from '@univerjs/base-render';
import { greenTheme, UIPlugin } from '@univerjs/base-ui';
import { UIPlugin } from '@univerjs/base-ui';
import { DEFAULT_DOCUMENT_DATA_EN } from '@univerjs/common-plugin-data';
import { LocaleType, Univer } from '@univerjs/core';
import { greenTheme } from '@univerjs/design';
import { DocUIPlugin } from '@univerjs/ui-plugin-docs';

// univer
Expand Down
39 changes: 20 additions & 19 deletions examples/univer-sheet-ts/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,29 +15,30 @@
"dev:demo": "node ./esbuild.config.mjs --watch"
},
"dependencies": {
"@univerjs/base-docs": "workspace:^0.0.1",
"@univerjs/base-render": "workspace:^0.0.1",
"@univerjs/base-sheets": "workspace:^0.0.1",
"@univerjs/base-ui": "workspace:^0.0.1",
"@univerjs/common-plugin-data": "workspace:^0.0.1",
"@univerjs/core": "workspace:^0.0.1",
"@univerjs/sheets-plugin-debugger": "workspace:^0.0.1",
"@univerjs/sheets-plugin-find": "workspace:^0.0.1",
"@univerjs/sheets-plugin-formula": "workspace:^0.0.1",
"@univerjs/sheets-plugin-image": "workspace:^0.0.1",
"@univerjs/sheets-plugin-import-xlsx": "workspace:^0.0.1",
"@univerjs/sheets-plugin-numfmt": "workspace:^0.0.1",
"@univerjs/ui-plugin-docs": "workspace:^0.0.1",
"@univerjs/ui-plugin-sheets": "workspace:^0.0.1",
"@univerjs/base-docs": "workspace:*",
"@univerjs/base-render": "workspace:*",
"@univerjs/base-sheets": "workspace:*",
"@univerjs/base-ui": "workspace:*",
"@univerjs/common-plugin-data": "workspace:*",
"@univerjs/core": "workspace:*",
"@univerjs/design": "workspace:*",
"@univerjs/sheets-plugin-debugger": "workspace:*",
"@univerjs/sheets-plugin-find": "workspace:*",
"@univerjs/sheets-plugin-formula": "workspace:*",
"@univerjs/sheets-plugin-image": "workspace:*",
"@univerjs/sheets-plugin-import-xlsx": "workspace:*",
"@univerjs/sheets-plugin-numfmt": "workspace:*",
"@univerjs/ui-plugin-docs": "workspace:*",
"@univerjs/ui-plugin-sheets": "workspace:*",
"react": "^18.2.0",
"react-dom": "^18.2.0"
},
"devDependencies": {
"@types/node": "^18.14.0",
"@types/react": "^18.2.22",
"@types/react-dom": "^18.2.7",
"@vitest/coverage-v8": "^0.34.5",
"esbuild": "^0.19.3",
"@types/node": "^20.8.9",
"@types/react": "^18.2.33",
"@types/react-dom": "^18.2.14",
"@vitest/coverage-v8": "^0.34.6",
"esbuild": "^0.19.5",
"esbuild-plugin-clean": "^1.0.1",
"esbuild-plugin-copy": "^2.1.1",
"esbuild-style-plugin": "^1.6.2",
Expand Down
3 changes: 2 additions & 1 deletion examples/univer-sheet-ts/src/main.tsx
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
import { DocPlugin } from '@univerjs/base-docs';
import { RenderEngine } from '@univerjs/base-render';
import { SheetPlugin } from '@univerjs/base-sheets';
import { greenTheme, UIPlugin } from '@univerjs/base-ui';
import { UIPlugin } from '@univerjs/base-ui';
import { DEFAULT_WORKBOOK_DATA_DEMO } from '@univerjs/common-plugin-data';
import { LocaleType, Univer } from '@univerjs/core';
import { greenTheme } from '@univerjs/design';
import { DebuggerPlugin } from '@univerjs/sheets-plugin-debugger';
// import { FindPlugin } from '@univerjs/sheets-plugin-find';
// import { DEFAULT_FORMULA_DATA_DEMO, FormulaPlugin } from '@univerjs/sheets-plugin-formula';
Expand Down
25 changes: 13 additions & 12 deletions examples/univer-slide-ts/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,27 +18,28 @@
"dev:demo": "node ./esbuild.config.mjs --watch"
},
"dependencies": {
"@univerjs/base-render": "workspace:^0.0.1",
"@univerjs/base-slides": "workspace:^0.0.1",
"@univerjs/base-ui": "workspace:^0.0.1",
"@univerjs/common-plugin-data": "workspace:^0.0.1",
"@univerjs/core": "workspace:^0.0.1",
"@univerjs/ui-plugin-slides": "workspace:^0.0.1",
"@univerjs/base-render": "workspace:*",
"@univerjs/base-slides": "workspace:*",
"@univerjs/base-ui": "workspace:*",
"@univerjs/common-plugin-data": "workspace:*",
"@univerjs/core": "workspace:*",
"@univerjs/design": "workspace:*",
"@univerjs/ui-plugin-slides": "workspace:*",
"react": "^18.2.0",
"react-dom": "^18.2.0"
},
"devDependencies": {
"@types/node": "^18.14.0",
"@types/react": "^18.2.22",
"@types/react-dom": "^18.2.7",
"@vitest/coverage-v8": "^0.34.5",
"esbuild": "^0.19.3",
"@types/node": "^20.8.9",
"@types/react": "^18.2.33",
"@types/react-dom": "^18.2.14",
"@vitest/coverage-v8": "^0.34.6",
"esbuild": "^0.19.5",
"esbuild-plugin-clean": "^1.0.1",
"esbuild-plugin-copy": "^2.1.1",
"esbuild-style-plugin": "^1.6.2",
"less": "^4.2.0",
"minimist": "^1.2.8",
"ts-node": "^10.9.1",
"vitest": "^0.34.5"
"vitest": "^0.34.6"
}
}
3 changes: 2 additions & 1 deletion examples/univer-slide-ts/src/main.tsx
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
import { RenderEngine } from '@univerjs/base-render';
import { SlidePlugin } from '@univerjs/base-slides';
import { greenTheme, UIPlugin } from '@univerjs/base-ui';
import { UIPlugin } from '@univerjs/base-ui';
import { DEFAULT_SLIDE_DATA } from '@univerjs/common-plugin-data';
import { LocaleType, Univer } from '@univerjs/core';
import { greenTheme } from '@univerjs/design';
import { SlideUIPlugin } from '@univerjs/ui-plugin-slides';

// univer
Expand Down
20 changes: 10 additions & 10 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,28 +25,28 @@
"license": "MIT",
"devDependencies": {
"@changesets/cli": "^2.26.2",
"@commitlint/cli": "^17.7.1",
"@commitlint/config-conventional": "^17.7.0",
"@types/node": "^18.14.0",
"@typescript-eslint/eslint-plugin": "^6.6.0",
"@typescript-eslint/parser": "^6.6.0",
"esbuild": "^0.19.3",
"@commitlint/cli": "^18.1.0",
"@commitlint/config-conventional": "^18.1.0",
"@types/node": "^20.8.9",
"@typescript-eslint/eslint-plugin": "^6.9.0",
"@typescript-eslint/parser": "^6.9.0",
"esbuild": "^0.19.5",
"esbuild-plugin-clean": "^1.0.1",
"esbuild-style-plugin": "^1.6.2",
"eslint": "^8.50.0",
"eslint": "^8.52.0",
"eslint-config-airbnb-base": "^15.0.0",
"eslint-config-airbnb-typescript": "^17.1.0",
"eslint-config-prettier": "^9.0.0",
"eslint-import-resolver-typescript": "^3.6.1",
"eslint-plugin-import-newlines": "^1.3.4",
"eslint-plugin-prettier": "^5.0.0",
"eslint-plugin-prettier": "^5.0.1",
"eslint-plugin-simple-import-sort": "^10.0.0",
"eslint-plugin-unused-imports": "^3.0.0",
"husky": "^8.0.3",
"lint-staged": "^14.0.1",
"lint-staged": "^15.0.2",
"prettier": "^3.0.3",
"ts-node": "^10.9.1",
"turbo": "^1.10.14",
"turbo": "^1.10.16",
"typescript": "^5.2.2"
},
"lint-staged": {
Expand Down
20 changes: 8 additions & 12 deletions packages/base-docs/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -37,23 +37,19 @@
"test": "vitest run"
},
"dependencies": {
"@univerjs/base-render": "workspace:^0.0.1",
"@univerjs/base-sheets": "workspace:^0.0.1",
"@univerjs/base-ui": "workspace:^0.0.1",
"@univerjs/common-plugin-data": "workspace:^0.0.1",
"@univerjs/core": "workspace:^0.0.1",
"@univerjs/base-render": "workspace:*",
"@univerjs/base-sheets": "workspace:*",
"@univerjs/base-ui": "workspace:*",
"@univerjs/common-plugin-data": "workspace:*",
"@univerjs/core": "workspace:*",
"@wendellhu/redi": "^0.12.8",
"react": "^18.2.0",
"react-dom": "^18.2.0",
"rxjs": "^7.8.1"
},
"devDependencies": {
"@types/node": "^18.14.0",
"@types/react": "^18.2.22",
"@types/react-dom": "^18.2.7",
"@vitest/coverage-v8": "^0.34.5",
"@types/node": "^20.8.9",
"@vitest/coverage-v8": "^0.34.6",
"less": "^4.2.0",
"ts-node": "^10.9.1",
"vitest": "^0.34.5"
"vitest": "^0.34.6"
}
}
4 changes: 2 additions & 2 deletions packages/base-docs/src/Controller/doc-render.controller.ts
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@
return;
}

const { mainComponent, components, scene } = currentRender;

Check warning on line 56 in packages/base-docs/src/Controller/doc-render.controller.ts

View workflow job for this annotation

GitHub Actions / build

'components' is assigned a value but never used

Check warning on line 56 in packages/base-docs/src/Controller/doc-render.controller.ts

View workflow job for this annotation

GitHub Actions / build

'scene' is assigned a value but never used

const docsComponent = mainComponent as Documents;

Expand Down Expand Up @@ -88,15 +88,15 @@

if (engineWidth > docsWidth) {
docsLeft = engineWidth / 2 - docsWidth / 2;
sceneWidth = engineWidth - 30;
sceneWidth = engineWidth - 34;

Check warning on line 91 in packages/base-docs/src/Controller/doc-render.controller.ts

View workflow job for this annotation

GitHub Actions / build

No magic number: 34
} else {
docsLeft = pageMarginLeft;
sceneWidth = docsWidth + pageMarginLeft * 2;
}

if (engineHeight > docsHeight) {
docsTop = engineHeight / 2 - docsHeight / 2;
sceneHeight = engineHeight - 30;
sceneHeight = engineHeight - 34;

Check warning on line 99 in packages/base-docs/src/Controller/doc-render.controller.ts

View workflow job for this annotation

GitHub Actions / build

No magic number: 34
} else {
docsTop = pageMarginTop;
sceneHeight = docsHeight + pageMarginTop * 2;
Expand All @@ -106,7 +106,7 @@

// this.docsTop = docsTop;

scene.resize(sceneWidth, sceneHeight + 200);

Check warning on line 109 in packages/base-docs/src/Controller/doc-render.controller.ts

View workflow job for this annotation

GitHub Actions / build

No magic number: 200

docsComponent.translate(docsLeft, docsTop);

Expand All @@ -114,7 +114,7 @@
}

recalculateSizeBySkeleton(currentRender: IRender, skeleton: DocumentSkeleton) {
const { mainComponent, scene } = currentRender;

Check warning on line 117 in packages/base-docs/src/Controller/doc-render.controller.ts

View workflow job for this annotation

GitHub Actions / build

'scene' is assigned a value but never used

const docsComponent = mainComponent as Documents;

Expand Down
6 changes: 3 additions & 3 deletions packages/base-docs/src/Locale/en.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,9 @@ export default {
moreFormats: 'More formats',
font: 'Font',
fontSize: 'Font size',
bold: 'Bold (Ctrl+B)',
italic: 'Italic (Ctrl+I)',
strikethrough: 'Strikethrough (Alt+Shift+5)',
bold: 'Bold',
italic: 'Italic',
strikethrough: 'Strikethrough',
underline: 'Underline',
textColor: {
main: 'Text color',
Expand Down
6 changes: 3 additions & 3 deletions packages/base-docs/src/Locale/zh.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,9 @@ export default {
moreFormats: '更多格式',
font: '字体',
fontSize: '字号大小',
bold: '粗体 (Ctrl+B)',
italic: '斜体 (Ctrl+I)',
strikethrough: '删除线 (Alt+Shift+5)',
bold: '粗体',
italic: '斜体',
strikethrough: '删除线',
underline: '下划线',
textColor: {
main: '文本颜色',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,6 @@ export const MoveCursorOperation: IOperation<IMoveCursorOperationParams> = {
return false;
}

// const univerInstanceService = accessor.get(IUniverInstanceService);
// const inputController = accessor.get(InputController);

// inputController.moveCursor(univerInstanceService.getCurrentUniverDocInstance(), params.direction);

return true;
},
};
2 changes: 2 additions & 0 deletions packages/base-docs/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,12 @@ export {
type IUpdateCommandParams,
UpdateCommand,
} from './commands/commands/core-editing.command';
export { BreakLineCommand, DeleteLeftCommand } from './commands/commands/core-editing.command';
export {
type IRichTextEditingMutationParams,
RichTextEditingMutation,
} from './commands/mutations/core-editing.mutation';
export { MoveCursorOperation } from './commands/operations/cursor.operation';
export * from './DocPlugin';
export * from './Locale';
export { DocSkeletonManagerService } from './services/doc-skeleton-manager.service';
Expand Down
18 changes: 7 additions & 11 deletions packages/base-formula-engine/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -40,19 +40,15 @@
"esbuild": "node ./esbuild.config.mjs"
},
"dependencies": {
"@univerjs/core": "workspace:^0.0.1",
"@wendellhu/redi": "^0.12.8",
"react": "^18.2.0",
"react-dom": "^18.2.0"
"@univerjs/core": "workspace:*",
"@wendellhu/redi": "^0.12.8"
},
"devDependencies": {
"@types/node": "^18.14.0",
"@types/react": "^18.2.22",
"@types/react-dom": "^18.2.7",
"@vitest/coverage-v8": "^0.34.5",
"esbuild": "^0.19.3",
"@types/node": "^20.8.9",
"@vitest/coverage-v8": "^0.34.6",
"esbuild": "^0.19.5",
"less": "^4.2.0",
"ts-node": "^10.9.1",
"vitest": "^0.34.5"
"vitest": "^0.34.6"
}
}
}
14 changes: 5 additions & 9 deletions packages/base-numfmt-engine/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -40,18 +40,14 @@
"esbuild": "node ./esbuild.config.mjs"
},
"dependencies": {
"@univerjs/core": "workspace:^0.0.1",
"react": "^18.2.0",
"react-dom": "^18.2.0"
"@univerjs/core": "workspace:*"
},
"devDependencies": {
"@types/node": "^18.14.0",
"@types/react": "^18.2.22",
"@types/react-dom": "^18.2.7",
"@vitest/coverage-v8": "^0.34.5",
"esbuild": "^0.19.3",
"@types/node": "^20.8.9",
"@vitest/coverage-v8": "^0.34.6",
"esbuild": "^0.19.5",
"less": "^4.2.0",
"ts-node": "^10.9.1",
"vitest": "^0.34.5"
"vitest": "^0.34.6"
}
}
14 changes: 5 additions & 9 deletions packages/base-render/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -44,20 +44,16 @@
"esbuild": "node ./esbuild.config.mjs"
},
"dependencies": {
"@univerjs/core": "workspace:^0.0.1",
"@univerjs/core": "workspace:*",
"@wendellhu/redi": "^0.12.8",
"react": "^18.2.0",
"react-dom": "^18.2.0",
"rxjs": "^7.8.1"
},
"devDependencies": {
"@types/node": "^18.14.0",
"@types/react": "^18.2.22",
"@types/react-dom": "^18.2.7",
"@vitest/coverage-v8": "^0.34.5",
"esbuild": "^0.19.3",
"@types/node": "^20.8.9",
"@vitest/coverage-v8": "^0.34.6",
"esbuild": "^0.19.5",
"less": "^4.2.0",
"ts-node": "^10.9.1",
"vitest": "^0.34.5"
"vitest": "^0.34.6"
}
}
Loading
Loading