snapshot of https://github.com/dream-num/univer.git (dev, 2026-09-16; blobs > 131072B omitted)
Some checks failed
📦 Build / build (push) Has been cancelled
🧪 CI Test / test shard (1/4) (push) Has been cancelled
🧪 CI Test / test shard (2/4) (push) Has been cancelled
🧪 CI Test / test shard (3/4) (push) Has been cancelled
🧪 CI Test / test shard (4/4) (push) Has been cancelled
🧪 CI Test / test (push) Has been cancelled
🧪 CI Test / eslint (push) Has been cancelled
🧪 CI Test / typecheck (push) Has been cancelled
🔫 Sync to Pro / dispatch-sync (push) Has been cancelled
🔮 Sync Mirror / sync (push) Has been cancelled
Some checks failed
📦 Build / build (push) Has been cancelled
🧪 CI Test / test shard (1/4) (push) Has been cancelled
🧪 CI Test / test shard (2/4) (push) Has been cancelled
🧪 CI Test / test shard (3/4) (push) Has been cancelled
🧪 CI Test / test shard (4/4) (push) Has been cancelled
🧪 CI Test / test (push) Has been cancelled
🧪 CI Test / eslint (push) Has been cancelled
🧪 CI Test / typecheck (push) Has been cancelled
🔫 Sync to Pro / dispatch-sync (push) Has been cancelled
🔮 Sync Mirror / sync (push) Has been cancelled
This commit is contained in:
38
presets/packages/preset-sheets-drawing/README.md
Normal file
38
presets/packages/preset-sheets-drawing/README.md
Normal file
@@ -0,0 +1,38 @@
|
||||
# @univerjs/preset-sheets-drawing
|
||||
|
||||
[](https://npmjs.com/package/@univerjs/preset-sheets-drawing)
|
||||
[](https://npmjs.com/package/@univerjs/preset-sheets-drawing)
|
||||
[](https://npmjs.com/package/@univerjs/preset-sheets-drawing)
|
||||
|
||||
`@univerjs/preset-sheets-drawing` provides a preset for drawing capabilities in Univer Sheets.
|
||||
|
||||
## Package Overview
|
||||
|
||||
| Package | CSS | Locales | Facade entry |
|
||||
| --------------------------------- | :-: | :-----: | :----------: |
|
||||
| `@univerjs/preset-sheets-drawing` | Yes | Yes | Yes |
|
||||
|
||||
## Installation
|
||||
|
||||
```sh
|
||||
pnpm add @univerjs/preset-sheets-drawing
|
||||
# or
|
||||
npm install @univerjs/preset-sheets-drawing
|
||||
```
|
||||
|
||||
Keep all `@univerjs/*` packages on the same version.
|
||||
|
||||
## Usage
|
||||
|
||||
```ts
|
||||
import { UniverSheetsDrawingPreset } from '@univerjs/preset-sheets-drawing';
|
||||
|
||||
// Use with createUniver:
|
||||
// createUniver({ presets: [UniverSheetsDrawingPreset()] });
|
||||
```
|
||||
|
||||
## Resources
|
||||
|
||||
- [Documentation](https://docs.univer.ai)
|
||||
- [NPM package](https://npmjs.com/package/@univerjs/preset-sheets-drawing)
|
||||
- [GitHub repository](https://github.com/dream-num/univer)
|
||||
88
presets/packages/preset-sheets-drawing/package.json
Normal file
88
presets/packages/preset-sheets-drawing/package.json
Normal file
@@ -0,0 +1,88 @@
|
||||
{
|
||||
"name": "@univerjs/preset-sheets-drawing",
|
||||
"version": "1.0.0-rc.0",
|
||||
"private": false,
|
||||
"description": "Preset for drawing capabilities in Univer Sheets.",
|
||||
"author": "DreamNum Co., Ltd. <developer@univer.ai>",
|
||||
"license": "Apache-2.0",
|
||||
"funding": {
|
||||
"type": "opencollective",
|
||||
"url": "https://opencollective.com/univer"
|
||||
},
|
||||
"homepage": "https://univer.ai",
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/dream-num/univer"
|
||||
},
|
||||
"bugs": {
|
||||
"url": "https://github.com/dream-num/univer/issues"
|
||||
},
|
||||
"keywords": [
|
||||
"univer",
|
||||
"univer-preset",
|
||||
"sheets",
|
||||
"drawing"
|
||||
],
|
||||
"sideEffects": [
|
||||
"*.css"
|
||||
],
|
||||
"exports": {
|
||||
".": "./src/index.ts",
|
||||
"./locales/*": "./src/locales/*.ts",
|
||||
"./lib/*": "./lib/*"
|
||||
},
|
||||
"publishConfig": {
|
||||
"access": "public",
|
||||
"main": "./lib/es/index.js",
|
||||
"module": "./lib/es/index.js",
|
||||
"exports": {
|
||||
".": {
|
||||
"import": "./lib/es/index.js",
|
||||
"require": "./lib/cjs/index.js",
|
||||
"types": "./lib/types/index.d.ts"
|
||||
},
|
||||
"./locales/*": {
|
||||
"import": "./lib/es/locales/*.js",
|
||||
"require": "./lib/cjs/locales/*.js",
|
||||
"types": "./lib/types/locales/*.d.ts"
|
||||
},
|
||||
"./lib/*": "./lib/*"
|
||||
}
|
||||
},
|
||||
"main": "./src/index.ts",
|
||||
"directories": {
|
||||
"lib": "lib"
|
||||
},
|
||||
"types": "./lib/types/index.d.ts",
|
||||
"files": [
|
||||
"lib"
|
||||
],
|
||||
"scripts": {
|
||||
"prepare": "univer-cli preset prepare",
|
||||
"build:bundle": "univer-cli preset build --cleanup",
|
||||
"build:types": "tsc -p tsconfig.node.json",
|
||||
"build": "pnpm run build:bundle && pnpm run build:types",
|
||||
"typecheck": "tsc --noEmit"
|
||||
},
|
||||
"peerDependencies": {
|
||||
"react": "^16.9.0 || ^17.0.0 || ^18.0.0 || ^19.0.0 || ^19.0.0-rc",
|
||||
"react-dom": "^16.9.0 || ^17.0.0 || ^18.0.0 || ^19.0.0 || ^19.0.0-rc",
|
||||
"rxjs": ">=7.0.0"
|
||||
},
|
||||
"dependencies": {
|
||||
"@univerjs/core": "workspace:*",
|
||||
"@univerjs/docs-drawing": "workspace:*",
|
||||
"@univerjs/drawing": "workspace:*",
|
||||
"@univerjs/drawing-ui": "workspace:*",
|
||||
"@univerjs/sheets-drawing": "workspace:*",
|
||||
"@univerjs/sheets-drawing-ui": "workspace:*"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@univerjs-infra/shared": "workspace:*",
|
||||
"@univerjs/presets": "workspace:*",
|
||||
"react": "18.3.1",
|
||||
"react-dom": "18.3.1",
|
||||
"rxjs": "^7.8.2",
|
||||
"typescript": "^6.0.3"
|
||||
}
|
||||
}
|
||||
17
presets/packages/preset-sheets-drawing/postcss.config.mjs
Normal file
17
presets/packages/preset-sheets-drawing/postcss.config.mjs
Normal file
@@ -0,0 +1,17 @@
|
||||
/**
|
||||
* Copyright 2023-present DreamNum Co., Ltd.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
export { default } from '@univerjs-infra/shared/postcss';
|
||||
22
presets/packages/preset-sheets-drawing/src/index.ts
Normal file
22
presets/packages/preset-sheets-drawing/src/index.ts
Normal file
@@ -0,0 +1,22 @@
|
||||
/**
|
||||
* Copyright 2023-present DreamNum Co., Ltd.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
export * from './preset';
|
||||
export * from '@univerjs/docs-drawing';
|
||||
export * from '@univerjs/drawing';
|
||||
export * from '@univerjs/drawing-ui';
|
||||
export * from '@univerjs/sheets-drawing';
|
||||
export * from '@univerjs/sheets-drawing-ui';
|
||||
51
presets/packages/preset-sheets-drawing/src/preset.ts
Normal file
51
presets/packages/preset-sheets-drawing/src/preset.ts
Normal file
@@ -0,0 +1,51 @@
|
||||
/**
|
||||
* Copyright 2023-present DreamNum Co., Ltd.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
import type { IUniverDrawingConfig } from '@univerjs/drawing';
|
||||
import type { IPreset } from '@univerjs/presets';
|
||||
import { IImageIoService } from '@univerjs/core';
|
||||
import { UniverDocsDrawingPlugin } from '@univerjs/docs-drawing';
|
||||
import { UniverDrawingPlugin } from '@univerjs/drawing';
|
||||
import { UniverDrawingUIPlugin } from '@univerjs/drawing-ui';
|
||||
import { UniverSheetsDrawingPlugin } from '@univerjs/sheets-drawing';
|
||||
import { UniverSheetsDrawingUIPlugin } from '@univerjs/sheets-drawing-ui';
|
||||
|
||||
import '@univerjs/sheets-drawing/facade';
|
||||
import '@univerjs/sheets-drawing-ui/facade';
|
||||
|
||||
export type * from '@univerjs/sheets-drawing-ui/facade';
|
||||
export type * from '@univerjs/sheets-drawing/facade';
|
||||
|
||||
export interface IUniverSheetsDrawingPresetConfig extends Pick<IUniverDrawingConfig, 'allowImageSize'> {
|
||||
collaboration?: boolean;
|
||||
}
|
||||
|
||||
export function UniverSheetsDrawingPreset(config: Partial<IUniverSheetsDrawingPresetConfig> = {}): IPreset {
|
||||
const { collaboration = false, allowImageSize } = config;
|
||||
|
||||
return {
|
||||
plugins: [
|
||||
[UniverDrawingPlugin, {
|
||||
override: collaboration ? [[IImageIoService, null]] : [],
|
||||
allowImageSize,
|
||||
}],
|
||||
UniverDocsDrawingPlugin,
|
||||
UniverDrawingUIPlugin,
|
||||
UniverSheetsDrawingPlugin,
|
||||
UniverSheetsDrawingUIPlugin,
|
||||
].filter((v) => !!v) as IPreset['plugins'],
|
||||
};
|
||||
};
|
||||
27
presets/packages/preset-sheets-drawing/tailwind.config.ts
Normal file
27
presets/packages/preset-sheets-drawing/tailwind.config.ts
Normal file
@@ -0,0 +1,27 @@
|
||||
/**
|
||||
* Copyright 2023-present DreamNum Co., Ltd.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
import type { Config } from 'tailwindcss';
|
||||
import preset, { createTailwindContent } from '@univerjs-infra/shared/tailwind';
|
||||
|
||||
const config: Config = {
|
||||
presets: [preset],
|
||||
content: createTailwindContent(import.meta.url, {
|
||||
includeStyleDependencies: true,
|
||||
}),
|
||||
};
|
||||
|
||||
export default config;
|
||||
8
presets/packages/preset-sheets-drawing/tsconfig.json
Normal file
8
presets/packages/preset-sheets-drawing/tsconfig.json
Normal file
@@ -0,0 +1,8 @@
|
||||
{
|
||||
"extends": "@univerjs-infra/shared/tsconfigs/base",
|
||||
"compilerOptions": {
|
||||
"rootDir": "src",
|
||||
"outDir": "lib/types"
|
||||
},
|
||||
"include": ["src", "../../common/shared/types/global.d.ts"]
|
||||
}
|
||||
18
presets/packages/preset-sheets-drawing/tsconfig.node.json
Normal file
18
presets/packages/preset-sheets-drawing/tsconfig.node.json
Normal file
@@ -0,0 +1,18 @@
|
||||
{
|
||||
"extends": "@univerjs-infra/shared/tsconfigs/node",
|
||||
"compilerOptions": {
|
||||
"rootDir": "src",
|
||||
"declaration": true,
|
||||
"emitDeclarationOnly": true,
|
||||
"noEmit": false,
|
||||
"outDir": "lib/types"
|
||||
},
|
||||
"include": [
|
||||
"src"
|
||||
],
|
||||
"exclude": [
|
||||
"src/**/__tests__/**",
|
||||
"src/**/*.spec.ts",
|
||||
"src/**/*.test.ts"
|
||||
]
|
||||
}
|
||||
Reference in New Issue
Block a user