Skip to content

Commit

Permalink
chore: update to 0.5.3
Browse files Browse the repository at this point in the history
  • Loading branch information
hexf00 committed Jan 4, 2025
1 parent 8d6dcf0 commit adb4a66
Show file tree
Hide file tree
Showing 30 changed files with 1,681 additions and 1,002 deletions.
4 changes: 2 additions & 2 deletions common/shared/prepare/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ export function createLocalesFiles() {
fs.ensureDirSync(path.resolve(__dirname, 'src/locales'));

LOCLAES_MAP.forEach((localeKey) => {
let content = `import { Tools } from '@univerjs/core';\n\n`;
let content = `import { merge } from '@univerjs/core';\n\n`;
const depsSet = new Set<string>();
Object.keys(pkg.dependencies).forEach((key) => {
if (key.startsWith('@univerjs')) {
Expand All @@ -48,7 +48,7 @@ export function createLocalesFiles() {
content += `import ${convertImportNameFromPackageName(key)} from '${key}/locale/${localeKey}';\n`;
});

content += `\nexport default Tools.deepMerge(\n {},\n`;
content += `\nexport default merge(\n {},\n`;

depsSet.forEach((key) => {
content += ` ${convertImportNameFromPackageName(key)},\n`;
Expand Down
159 changes: 159 additions & 0 deletions examples-umd/sheets-collaboration.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,159 @@
<!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Univer Sheets Collaboration UMD</title>
<script src="https://unpkg.com/react@18/umd/react.production.min.js"></script>
<script src="https://unpkg.com/react-dom@18/umd/react-dom.production.min.js"></script>
<script src="https://unpkg.com/rxjs@7/dist/bundles/rxjs.umd.min.js"></script>
<script src="https://unpkg.com/vue@3/dist/vue.global.prod.js"></script>

<script src="/packages/presets/lib/umd/index.js"></script>

<script src="/packages/preset-sheets-core/lib/umd/index.js"></script>
<script src="/packages/preset-sheets-core/lib/umd/locales/en-US.js"></script>
<link rel="stylesheet" href="/packages/presets/lib/styles/preset-sheets-core.css" />

<script src="/packages/preset-sheets-drawing/lib/umd/index.js"></script>
<script src="/packages/preset-sheets-drawing/lib/umd/locales/en-US.js"></script>
<link rel="stylesheet" href="/packages/presets/lib/styles/preset-sheets-drawing.css" />

<script src="/packages/preset-sheets-advanced/lib/umd/index.js"></script>
<script src="/packages/preset-sheets-advanced/lib/umd/locales/en-US.js"></script>
<link rel="stylesheet" href="/packages/presets/lib/styles/preset-sheets-advanced.css" />

<script src="/packages/preset-sheets-data-validation/lib/umd/index.js"></script>
<script src="/packages/preset-sheets-data-validation/lib/umd/locales/en-US.js"></script>
<link rel="stylesheet" href="/packages/presets/lib/styles/preset-sheets-data-validation.css" />

<script src="/packages/preset-sheets-hyper-link/lib/umd/index.js"></script>
<script src="/packages/preset-sheets-hyper-link/lib/umd/locales/en-US.js"></script>
<link rel="stylesheet" href="/packages/presets/lib/styles/preset-sheets-hyper-link.css" />

<script src="/packages/preset-sheets-conditional-formatting/lib/umd/index.js"></script>
<script src="/packages/preset-sheets-conditional-formatting/lib/umd/locales/en-US.js"></script>
<link rel="stylesheet" href="/packages/presets/lib/styles/preset-sheets-conditional-formatting.css" />

<script src="/packages/preset-sheets-thread-comment/lib/umd/index.js"></script>
<script src="/packages/preset-sheets-thread-comment/lib/umd/locales/en-US.js"></script>
<link rel="stylesheet" href="/packages/presets/lib/styles/preset-sheets-thread-comment.css" />

<script src="/packages/preset-sheets-filter/lib/umd/index.js"></script>
<script src="/packages/preset-sheets-filter/lib/umd/locales/en-US.js"></script>
<link rel="stylesheet" href="/packages/presets/lib/styles/preset-sheets-filter.css" />

<script src="/packages/preset-sheets-find-replace/lib/umd/index.js"></script>
<script src="/packages/preset-sheets-find-replace/lib/umd/locales/en-US.js"></script>
<link rel="stylesheet" href="/packages/presets/lib/styles/preset-sheets-find-replace.css" />

<script src="/packages/preset-sheets-sort/lib/umd/index.js"></script>
<script src="/packages/preset-sheets-sort/lib/umd/locales/en-US.js"></script>
<link rel="stylesheet" href="/packages/presets/lib/styles/preset-sheets-sort.css" />

<!-- 打开就卡死 -->
<script src="/packages/preset-sheets-collaboration/lib/umd/index.js"></script>
<script src="/packages/preset-sheets-collaboration/lib/umd/locales/en-US.js"></script>
<link rel="stylesheet" href="/packages/presets/lib/styles/preset-sheets-collaboration.css" />

<style>
html,
body,
#app {
margin: 0;
padding: 0;
width: 100vw;
height: 100vh;
}
</style>
</head>

<body>
<div id="app"></div>

<script>
const { createUniver, LocaleType, merge, defaultTheme } = UniverPresets;
const { UniverSheetsCorePreset } = UniverPresetSheetsCore;
const { UniverSheetsAdvancedPreset } = UniverPresetSheetsAdvanced;
const { UniverSheetsCollaborationPreset } = UniverPresetSheetsCollaboration;

const { UniverSheetsThreadCommentPreset } = UniverPresetSheetsThreadComment;
const { UniverSheetsConditionalFormattingPreset } = UniverPresetSheetsConditionalFormatting;
const { UniverSheetsDataValidationPreset } = UniverPresetSheetsDataValidation;
const { UniverSheetsDrawingPreset } = UniverPresetSheetsDrawing;
const { UniverSheetsFilterPreset } = UniverPresetSheetsFilter;
const { UniverSheetsFindReplacePreset } = UniverPresetSheetsFindReplace;
const { UniverSheetsSortPreset } = UniverPresetSheetsSort;
const { UniverSheetsHyperLinkPreset } = UniverPresetSheetsHyperLink;

const { UniverInstanceType } = window.UniverCore;

const UNIVER_SERVER_ENDPOINT = 'https://dev.univer.plus';

const collaboration = true;

const { univerAPI, univer } = createUniver({
locale: LocaleType.EN_US,
locales: {
[LocaleType.EN_US]: merge(
{},
UniverPresetSheetsCoreEnUS,
UniverPresetSheetsAdvancedEnUS,
UniverPresetSheetsCollaborationEnUS,
UniverPresetSheetsThreadCommentEnUS,
UniverPresetSheetsConditionalFormattingEnUS,
UniverPresetSheetsDataValidationEnUS,
UniverPresetSheetsDrawingEnUS,
UniverPresetSheetsFilterEnUS,
UniverPresetSheetsFindReplaceEnUS,
UniverPresetSheetsHyperLinkEnUS,
UniverPresetSheetsSortEnUS,
// UniverPresetSheetsZenEditorEnUS,
),
},
collaboration,
// logLevel: LogLevel.VERBOSE,
theme: defaultTheme,
presets: [
UniverSheetsCorePreset({
container: 'app',
header: true,
footer: true,
// workerURL: new Worker(new URL(workerURL, import.meta.url), {
// type: 'module',
// }),
}),
UniverSheetsDrawingPreset({
collaboration,
}),
UniverSheetsAdvancedPreset({
useWorker: true,
// if univer page is not in the same domain as the server, you need to set the following parameters
UNIVER_SERVER_ENDPOINT,
// if you want to use the no-limit business feature, you can get 30-day trial license from https://univer.ai/pro/license
// eslint-disable-next-line node/prefer-global/process
// license: 'your license.txt',
}),

UniverSheetsHyperLinkPreset(),
UniverSheetsDataValidationPreset(),
UniverSheetsThreadCommentPreset({
collaboration,
}),
UniverSheetsConditionalFormattingPreset(),
UniverSheetsFilterPreset(),
UniverSheetsFindReplacePreset(),
UniverSheetsSortPreset(),

UniverSheetsCollaborationPreset(),
],
plugins: [
// UniverSheetsCrosshairHighlightPlugin,
// UniverSheetsZenEditorPlugin,
],
});

const injector = univer.__getInjector();
</script>
</body>
</html>
49 changes: 49 additions & 0 deletions examples-umd/sheets-core.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
<!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Univer Sheets Core UMD</title>
<script src="https://unpkg.com/react@18/umd/react.production.min.js"></script>
<script src="https://unpkg.com/react-dom@18/umd/react-dom.production.min.js"></script>
<script src="https://unpkg.com/rxjs@7/dist/bundles/rxjs.umd.min.js"></script>
<script src="https://unpkg.com/vue@3/dist/vue.global.prod.js"></script>

<script src="/packages/presets/lib/umd/index.js"></script>

<script src="/packages/preset-sheets-core/lib/umd/index.js"></script>
<script src="/packages/preset-sheets-core/lib/umd/locales/en-US.js"></script>
<link rel="stylesheet" href="/packages/presets/lib/styles/preset-sheets-core.css" />

<style>
html,
body,
#app {
margin: 0;
padding: 0;
width: 100vw;
height: 100vh;
}
</style>
</head>

<body>
<div id="app"></div>

<script>
const { createUniver, LocaleType, merge, defaultTheme } = UniverPresets;
const { UniverSheetsCorePreset } = UniverPresetSheetsCore;

const { univerAPI } = createUniver({
locale: LocaleType.ZH_CN,
locales: {
zhCN: merge({}, UniverPresetSheetsCoreEnUS),
},
theme: defaultTheme,
presets: [UniverSheetsCorePreset()],
});

univerAPI.createUniverSheet({ name: 'Test Sheet' });
</script>
</body>
</html>
2 changes: 1 addition & 1 deletion examples/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
},
"dependencies": {
"@univerjs/presets": "workspace:*",
"@univerjs/sheets-zen-editor": "0.5.2",
"@univerjs/sheets-zen-editor": "0.5.3",
"clsx": "^2.1.1",
"monaco-editor": "0.52.0",
"react": "18.3.1",
Expand Down
4 changes: 2 additions & 2 deletions examples/src/docs-collaboration/main.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { createUniver, defaultTheme, LocaleType, Tools } from '@univerjs/presets';
import { createUniver, defaultTheme, LocaleType, merge } from '@univerjs/presets';

import { UniverDocsCollaborationPreset } from '@univerjs/presets/preset-docs-collaboration';
import docsCollaborationZhCN from '@univerjs/presets/preset-docs-collaboration/locales/zh-CN';
Expand All @@ -12,7 +12,7 @@ import '@univerjs/presets/lib/styles/preset-docs-collaboration.css';
createUniver({
locale: LocaleType.ZH_CN,
locales: {
zhCN: Tools.deepMerge(
zhCN: merge(
{},
docsCoreZhCN,
docsCollaborationZhCN,
Expand Down
4 changes: 2 additions & 2 deletions examples/src/sheets-advanced/main.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { createUniver, defaultTheme, LocaleType, Tools } from '@univerjs/presets';
import { createUniver, defaultTheme, LocaleType, merge } from '@univerjs/presets';

import { UniverSheetsAdvancedPreset } from '@univerjs/presets/preset-sheets-advanced';
import sheetsAdvancedZhCN from '@univerjs/presets/preset-sheets-advanced/locales/zh-CN';
Expand Down Expand Up @@ -27,7 +27,7 @@ import '@univerjs/presets/lib/styles/preset-sheets-data-validation.css';
const { univerAPI } = createUniver({
locale: LocaleType.ZH_CN,
locales: {
zhCN: Tools.deepMerge(
zhCN: merge(
{},
sheetsCoreZhCN,
sheetsAdvancedZhCN,
Expand Down
4 changes: 2 additions & 2 deletions examples/src/sheets-collaboration-with-worker/main.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { createUniver, defaultTheme, LocaleType, Tools } from '@univerjs/presets';
import { createUniver, defaultTheme, LocaleType, merge } from '@univerjs/presets';

import { UniverSheetsAdvancedPreset } from '@univerjs/presets/preset-sheets-advanced';
import sheetsAdvancedZhCN from '@univerjs/presets/preset-sheets-advanced/locales/zh-CN';
Expand All @@ -20,7 +20,7 @@ import '@univerjs/presets/lib/styles/preset-sheets-collaboration.css';
createUniver({
locale: LocaleType.ZH_CN,
locales: {
zhCN: Tools.deepMerge(
zhCN: merge(
{},
sheetsCoreZhCN,
sheetsAdvancedZhCN,
Expand Down
4 changes: 2 additions & 2 deletions examples/src/sheets-collaboration-with-worker/worker.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { createUniver, LocaleType, Tools } from '@univerjs/presets';
import { createUniver, LocaleType, merge } from '@univerjs/presets';
import sheetsAdvancedZhCN from '@univerjs/presets/preset-sheets-advanced/locales/zh-CN';
import { UniverSheetsAdvancedWorkerPreset } from '@univerjs/presets/preset-sheets-advanced/worker';
import sheetsCoreZhCN from '@univerjs/presets/preset-sheets-core/locales/zh-CN';
Expand All @@ -7,7 +7,7 @@ import { UniverSheetsCoreWorkerPreset } from '@univerjs/presets/preset-sheets-co
createUniver({
locale: LocaleType.ZH_CN,
locales: {
zhCN: Tools.deepMerge(
zhCN: merge(
{},
sheetsCoreZhCN,
sheetsAdvancedZhCN,
Expand Down
4 changes: 2 additions & 2 deletions examples/src/sheets-collaboration/main.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { createUniver, defaultTheme, LocaleType, Tools } from '@univerjs/presets';
import { createUniver, defaultTheme, LocaleType, merge } from '@univerjs/presets';

import { UniverSheetsAdvancedPreset } from '@univerjs/presets/preset-sheets-advanced';
import sheetsAdvancedZhCN from '@univerjs/presets/preset-sheets-advanced/locales/zh-CN';
Expand All @@ -24,7 +24,7 @@ import '@univerjs/presets/lib/styles/preset-sheets-drawing.css';
createUniver({
locale: LocaleType.ZH_CN,
locales: {
zhCN: Tools.deepMerge(
zhCN: merge(
{},
sheetsCoreZhCN,
sheetsAdvancedZhCN,
Expand Down
4 changes: 2 additions & 2 deletions examples/src/sheets-core/main.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { createUniver, defaultTheme, LocaleType, Tools } from '@univerjs/presets';
import { createUniver, defaultTheme, LocaleType, merge } from '@univerjs/presets';

import { UniverSheetsCorePreset } from '@univerjs/presets/preset-sheets-core';
import sheetsCoreZhCN from '@univerjs/presets/preset-sheets-core/locales/zh-CN';
Expand All @@ -12,7 +12,7 @@ import '@univerjs/sheets-zen-editor/lib/index.css';
const { univerAPI } = createUniver({
locale: LocaleType.ZH_CN,
locales: {
zhCN: Tools.deepMerge(
zhCN: merge(
{},
sheetsCoreZhCN,
sheetsZenEditorZhCN,
Expand Down
4 changes: 2 additions & 2 deletions examples/src/sheets-rich-feature/main.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { createUniver, defaultTheme, LocaleType, Tools } from '@univerjs/presets';
import { createUniver, defaultTheme, LocaleType, merge } from '@univerjs/presets';

import { UniverSheetsConditionalFormattingPreset } from '@univerjs/presets/preset-sheets-conditional-formatting';
import sheetsConditionalFormattingZhCN from '@univerjs/presets/preset-sheets-conditional-formatting/locales/zh-CN';
Expand Down Expand Up @@ -40,7 +40,7 @@ import '@univerjs/sheets-zen-editor/lib/index.css';
const { univerAPI } = createUniver({
locale: LocaleType.ZH_CN,
locales: {
zhCN: Tools.deepMerge(
zhCN: merge(
{},
sheetsCoreZhCN,
sheetsZenEditorZhCN,
Expand Down
8 changes: 4 additions & 4 deletions packages/preset-docs-collaboration/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -68,13 +68,13 @@
"rxjs": ">=7.0.0"
},
"dependencies": {
"@univerjs-pro/collaboration": "0.5.2",
"@univerjs-pro/collaboration-client": "0.5.2",
"@univerjs-pro/collaboration-client-ui": "0.5.2"
"@univerjs-pro/collaboration": "0.5.3",
"@univerjs-pro/collaboration-client": "0.5.3",
"@univerjs-pro/collaboration-client-ui": "0.5.3"
},
"devDependencies": {
"@univerjs-infra/shared": "workspace:*",
"@univerjs/core": "0.5.2",
"@univerjs/core": "0.5.3",
"typescript": "^5.7.2"
}
}
14 changes: 7 additions & 7 deletions packages/preset-docs-core/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -68,16 +68,16 @@
"rxjs": ">=7.0.0"
},
"dependencies": {
"@univerjs/design": "0.5.2",
"@univerjs/docs": "0.5.2",
"@univerjs/docs-ui": "0.5.2",
"@univerjs/engine-formula": "0.5.2",
"@univerjs/engine-render": "0.5.2",
"@univerjs/ui": "0.5.2"
"@univerjs/design": "0.5.3",
"@univerjs/docs": "0.5.3",
"@univerjs/docs-ui": "0.5.3",
"@univerjs/engine-formula": "0.5.3",
"@univerjs/engine-render": "0.5.3",
"@univerjs/ui": "0.5.3"
},
"devDependencies": {
"@univerjs-infra/shared": "workspace:*",
"@univerjs/core": "0.5.2",
"@univerjs/core": "0.5.3",
"typescript": "^5.7.2"
}
}
Loading

0 comments on commit adb4a66

Please sign in to comment.