@hprint/print 0.0.2 → 0.0.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/package.json +4 -4
  2. package/src/index.ts +27 -27
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@hprint/print",
3
- "version": "0.0.2",
3
+ "version": "0.0.3",
4
4
  "description": "",
5
5
  "main": "./dist/index.js",
6
6
  "module": "./dist/index.mjs",
@@ -13,9 +13,9 @@
13
13
  }
14
14
  },
15
15
  "dependencies": {
16
- "@hprint/shared": "0.0.2",
17
- "@hprint/core": "0.0.2",
18
- "@hprint/plugins": "0.0.2"
16
+ "@hprint/shared": "0.0.3",
17
+ "@hprint/core": "0.0.3",
18
+ "@hprint/plugins": "0.0.3"
19
19
  },
20
20
  "keywords": [],
21
21
  "author": "george-hong",
package/src/index.ts CHANGED
@@ -1,28 +1,28 @@
1
- import Editor, { IPluginOption } from '@hprint/core';
2
- import { pluginsList, SelectEvent, SelectMode } from '@hprint/plugins';
3
- import { fabric, LengthConvert } from '@hprint/shared';
4
-
5
- const usePlugins = (editor: Editor, options?: {
6
- excludes: string[]
7
- options: Record<string, IPluginOption>
8
- }) => {
9
- const excludesMap = options?.excludes?.reduce((total, cur) => {
10
- total[cur] = 1;
11
- return total;
12
- }, {} as Record<string, 1>) || {};
13
- pluginsList.forEach((plugin) => {
14
- // 排除部分插件
15
- if (excludesMap[plugin.pluginName]) return;
16
- editor.use(plugin, options?.options?.[plugin.pluginName])
17
- });
18
- };
19
-
20
- export {
21
- usePlugins,
22
- fabric,
23
- Editor,
24
- LengthConvert,
25
- // plugin packages
26
- SelectEvent,
27
- SelectMode
1
+ import Editor, { IPluginOption } from '@hprint/core';
2
+ import { pluginsList, SelectEvent, SelectMode } from '@hprint/plugins';
3
+ import { fabric, LengthConvert } from '@hprint/shared';
4
+
5
+ const usePlugins = (editor: Editor, options?: {
6
+ excludes: string[]
7
+ options: Record<string, IPluginOption>
8
+ }) => {
9
+ const excludesMap = options?.excludes?.reduce((total, cur) => {
10
+ total[cur] = 1;
11
+ return total;
12
+ }, {} as Record<string, 1>) || {};
13
+ pluginsList.forEach((plugin) => {
14
+ // 排除部分插件
15
+ if (excludesMap[plugin.pluginName]) return;
16
+ editor.use(plugin, options?.options?.[plugin.pluginName])
17
+ });
18
+ };
19
+
20
+ export {
21
+ usePlugins,
22
+ fabric,
23
+ Editor,
24
+ LengthConvert,
25
+ // plugin packages
26
+ SelectEvent,
27
+ SelectMode
28
28
  };