@xiaou66/picture-plugin 0.0.3 → 0.0.5

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.
@@ -1 +1 @@
1
- {"version":3,"file":"index.cjs.js","sources":["../src/storage/StoragePlugInConfig.ts"],"sourcesContent":["export interface StorageUIConfig {\n /**\n * 提示\n */\n tips: string,\n\n /**\n * 表单\n */\n forms: any;\n}\n\nexport interface StoragePlugInConfig {\n /**\n * 插件 code 全局唯一\n */\n pluginCode: string;\n /**\n * 插件名称\n */\n pluginName: string;\n\n /**\n * 插件版本\n */\n pluginVersion: string;\n\n /**\n * 插件作者\n */\n pluginAuthor: string;\n\n /**\n * 插件描述\n */\n pluginDesc: string;\n\n /**\n * 插件类型\n */\n plugInType: 'storage';\n\n /**\n * 插件 logo\n */\n plugInLogo: string;\n\n /**\n * 配置 ui\n */\n uiConfig?: StorageUIConfig;\n}\n\n/**\n * 场景插件配置\n * @param config\n */\nexport function createStoragePlugInConfig(config: Omit<StoragePlugInConfig, 'plugInType'>): StoragePlugInConfig {\n return {\n ...config,\n plugInType: 'storage',\n };\n}\n"],"names":["createStoragePlugInConfig","config"],"mappings":"gFAyDO,SAASA,EAA0BC,EAAsE,CACvG,MAAA,CACL,GAAGA,EACH,WAAY,SACd,CACF"}
1
+ {"version":3,"file":"index.cjs.js","sources":["../src/storage/StoragePlugInConfig.ts"],"sourcesContent":["export interface StorageUIFormElement {\n type: 'input';\n\n formItem: {\n rules?: Record<string, any>;\n field: string;\n label: string;\n },\n\n /**\n * 元素属性值\n */\n elementProperty: Record<string, any>;\n}\n\nexport interface StorageUIConfig {\n /**\n * 提示\n */\n tips: string,\n\n /**\n * 表单\n */\n forms: StorageUIFormElement[];\n}\n\nexport interface StoragePlugInConfig {\n /**\n * 插件 code 全局唯一\n */\n pluginCode: string;\n /**\n * 插件名称\n */\n pluginName: string;\n\n /**\n * 插件版本\n */\n pluginVersion: string;\n\n /**\n * 插件作者\n */\n pluginAuthor: string;\n\n /**\n * 插件描述\n */\n pluginDesc: string;\n\n /**\n * 插件类型\n */\n plugInType: 'storage';\n\n /**\n * 插件 logo\n */\n plugInLogo: string;\n\n /**\n * 配置 ui\n */\n uiConfig?: StorageUIConfig;\n}\n\n/**\n * 场景插件配置\n * @param config\n */\nexport function createStoragePlugInConfig(config: Omit<StoragePlugInConfig, 'plugInType'>): StoragePlugInConfig {\n return {\n ...config,\n plugInType: 'storage',\n };\n}\n"],"names":["createStoragePlugInConfig","config"],"mappings":"gFAwEO,SAASA,EAA0BC,EAAsE,CACvG,MAAA,CACL,GAAGA,EACH,WAAY,SACd,CACF"}
@@ -1 +1 @@
1
- {"version":3,"file":"index.es.js","sources":["../src/storage/StoragePlugInConfig.ts"],"sourcesContent":["export interface StorageUIConfig {\n /**\n * 提示\n */\n tips: string,\n\n /**\n * 表单\n */\n forms: any;\n}\n\nexport interface StoragePlugInConfig {\n /**\n * 插件 code 全局唯一\n */\n pluginCode: string;\n /**\n * 插件名称\n */\n pluginName: string;\n\n /**\n * 插件版本\n */\n pluginVersion: string;\n\n /**\n * 插件作者\n */\n pluginAuthor: string;\n\n /**\n * 插件描述\n */\n pluginDesc: string;\n\n /**\n * 插件类型\n */\n plugInType: 'storage';\n\n /**\n * 插件 logo\n */\n plugInLogo: string;\n\n /**\n * 配置 ui\n */\n uiConfig?: StorageUIConfig;\n}\n\n/**\n * 场景插件配置\n * @param config\n */\nexport function createStoragePlugInConfig(config: Omit<StoragePlugInConfig, 'plugInType'>): StoragePlugInConfig {\n return {\n ...config,\n plugInType: 'storage',\n };\n}\n"],"names":["createStoragePlugInConfig","config"],"mappings":"AAyDO,SAASA,EAA0BC,GAAsE;AACvG,SAAA;AAAA,IACL,GAAGA;AAAA,IACH,YAAY;AAAA,EACd;AACF;"}
1
+ {"version":3,"file":"index.es.js","sources":["../src/storage/StoragePlugInConfig.ts"],"sourcesContent":["export interface StorageUIFormElement {\n type: 'input';\n\n formItem: {\n rules?: Record<string, any>;\n field: string;\n label: string;\n },\n\n /**\n * 元素属性值\n */\n elementProperty: Record<string, any>;\n}\n\nexport interface StorageUIConfig {\n /**\n * 提示\n */\n tips: string,\n\n /**\n * 表单\n */\n forms: StorageUIFormElement[];\n}\n\nexport interface StoragePlugInConfig {\n /**\n * 插件 code 全局唯一\n */\n pluginCode: string;\n /**\n * 插件名称\n */\n pluginName: string;\n\n /**\n * 插件版本\n */\n pluginVersion: string;\n\n /**\n * 插件作者\n */\n pluginAuthor: string;\n\n /**\n * 插件描述\n */\n pluginDesc: string;\n\n /**\n * 插件类型\n */\n plugInType: 'storage';\n\n /**\n * 插件 logo\n */\n plugInLogo: string;\n\n /**\n * 配置 ui\n */\n uiConfig?: StorageUIConfig;\n}\n\n/**\n * 场景插件配置\n * @param config\n */\nexport function createStoragePlugInConfig(config: Omit<StoragePlugInConfig, 'plugInType'>): StoragePlugInConfig {\n return {\n ...config,\n plugInType: 'storage',\n };\n}\n"],"names":["createStoragePlugInConfig","config"],"mappings":"AAwEO,SAASA,EAA0BC,GAAsE;AACvG,SAAA;AAAA,IACL,GAAGA;AAAA,IACH,YAAY;AAAA,EACd;AACF;"}
@@ -1,4 +1,4 @@
1
- export interface IUploadResult {
1
+ export interface IUploadFileResult {
2
2
  /**
3
3
  * 上传后文件访问地址
4
4
  */
@@ -8,20 +8,44 @@ export interface IUploadResult {
8
8
  */
9
9
  extra: any;
10
10
  }
11
+ export interface IUploadFileParams {
12
+ /**
13
+ * 上传 id
14
+ */
15
+ readonly id: string;
16
+ /**
17
+ * 文件路径
18
+ */
19
+ readonly filePath: string;
20
+ /**
21
+ * 文件名称
22
+ */
23
+ readonly fileName: string;
24
+ /**
25
+ * 文件大小
26
+ */
27
+ readonly fileSize: number;
28
+ /**
29
+ * 文件
30
+ */
31
+ readonly file: File;
32
+ }
11
33
  /**
12
34
  * 插件接口
13
35
  */
14
- export interface IStoragePlugIn {
36
+ export interface IStoragePlugIn<C = any> {
15
37
  /**
16
- * 插件
38
+ * 插件初始化调用
17
39
  */
18
40
  init(): void;
19
41
  /**
20
42
  * 上传文件
43
+ * @param params 参数
44
+ * @param config 配置文件
21
45
  */
22
- uploadFile(): IUploadResult;
46
+ uploadFile(params: IUploadFileParams, config: C): IUploadFileResult;
23
47
  /**
24
- * 插件对象销毁
48
+ * 插件销毁调用
25
49
  */
26
50
  destroy(): void;
27
51
  }
@@ -1,3 +1,15 @@
1
+ export interface StorageUIFormElement {
2
+ type: 'input';
3
+ formItem: {
4
+ rules?: Record<string, any>;
5
+ field: string;
6
+ label: string;
7
+ };
8
+ /**
9
+ * 元素属性值
10
+ */
11
+ elementProperty: Record<string, any>;
12
+ }
1
13
  export interface StorageUIConfig {
2
14
  /**
3
15
  * 提示
@@ -6,7 +18,7 @@ export interface StorageUIConfig {
6
18
  /**
7
19
  * 表单
8
20
  */
9
- forms: any;
21
+ forms: StorageUIFormElement[];
10
22
  }
11
23
  export interface StoragePlugInConfig {
12
24
  /**
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@xiaou66/picture-plugin",
3
- "version": "0.0.3",
3
+ "version": "0.0.5",
4
4
  "description": "Picture bed plugin system",
5
5
  "main": "./dist/index.cjs.js",
6
6
  "module": "./dist/index.es.js",
@@ -14,7 +14,8 @@
14
14
  "scripts": {
15
15
  "build": "vite build",
16
16
  "dev": "vite",
17
- "prepare": "npm run build"
17
+ "prepare": "npm run build",
18
+ "publish": "npm publish"
18
19
  },
19
20
  "author": "xiaou",
20
21
  "license": "ISC",