Skip to content

Commit

Permalink
fix(examples): fix the broken uniscript demo
Browse files Browse the repository at this point in the history
  • Loading branch information
jikkai committed Feb 21, 2024
1 parent 6008ab3 commit 70c2a5c
Show file tree
Hide file tree
Showing 5 changed files with 4 additions and 9 deletions.
5 changes: 0 additions & 5 deletions common/shared/vite/auto-externalize-dependency-plugin.js
Original file line number Diff line number Diff line change
Expand Up @@ -37,11 +37,6 @@ exports.autoExternalizeDependency = function autoExternalizeDependency() {

globals[source] = convertLibNameFromPackageName(source);

return { id: source, external: true };
} else if (source.includes('monaco-editor')) {
externals.add('monaco-editor');
globals['monaco-editor'] = externalMap['monaco-editor'];

return { id: source, external: true };
}

Expand Down
2 changes: 1 addition & 1 deletion examples/src/uniscript/change-font-style.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
* limitations under the License.
*/

const activeSheet = univerAPI.getCurrentSheet().getActiveSheet();
const activeSheet = univerAPI.getActiveWorkbook().getActiveSheet();

// Set A1:B2 to bold
activeSheet.getRange(0, 0, 2, 2).setFontWeight('bold');
Expand Down
2 changes: 1 addition & 1 deletion examples/src/uniscript/china-id-validation.js
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ function validIDNum(szID) {

const redColor = 'rgb(240, 55, 31)';

const activeSheet = univerAPI.getCurrentSheet().getActiveSheet();
const activeSheet = univerAPI.getActiveWorkbook().getActiveSheet();
const range = activeSheet.getRange(1, 1, 50, 1);
const row = range.getRow();
const col = range.getColumn();
Expand Down
2 changes: 1 addition & 1 deletion examples/src/uniscript/draw-univer-logo.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@

/* eslint-disable */

const newSheet = univerAPI.getCurrentSheet().create('Draw Univer Logo', 80, 80);
const newSheet = univerAPI.getActiveWorkbook().create("Draw Univer Logo", 80, 80);
newSheet.setRowHeights(0, 80, 6);
newSheet.setColumnWidths(0, 80, 6);

Expand Down
2 changes: 1 addition & 1 deletion packages/uniscript/vite.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import createViteConfig from '@univerjs/shared/vite';
import pkg from './package.json';

export default ({ mode }) => createViteConfig({
resolve: {
test: {
alias: [
{
find: /^monaco-editor$/,
Expand Down

0 comments on commit 70c2a5c

Please sign in to comment.