@xiaou66/picture-types 0.0.4 → 0.0.6

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.
package/dist/index.d.ts CHANGED
@@ -1,9 +1,2 @@
1
- /**
2
- * 类型定义包入口
3
- */
4
- export * from './File';
5
- export * from './Common';
6
- export * from './Store';
7
- export * from './Plugin';
8
- export * from './Storage';
9
- export * from './Flow';
1
+ export * from './src/index'
2
+ export {}
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1 @@
1
+ export {};
@@ -1,7 +1,8 @@
1
1
  import { AsyncComponentLoader } from 'vue';
2
- import { PluginInfo } from './Plugin';
2
+ import { PluginConfig, PluginInfo } from './Plugin';
3
3
  import { FileUpdateInfoItem } from './File';
4
4
  import { FileLibraryItem, SceneInfoItem } from './Store';
5
+ import { UITemplateConfig } from './UITemplate';
5
6
  /**
6
7
  * 流程节点
7
8
  */
@@ -34,7 +35,7 @@ export interface FlowProvide {
34
35
  removeNode: (id: string) => void;
35
36
  updateNodeField: (id: string, field: string, value: any) => void;
36
37
  updateNode: (id: string, nodeData: Record<string, any>) => void;
37
- createNode: (node: FlowNodePlugin) => void;
38
+ createNode: (node: FlowNodePluginConfig) => void;
38
39
  }
39
40
  /**
40
41
  * 流程节点分组类型
@@ -59,14 +60,13 @@ export interface FlowNodePluginInfo extends PluginInfo {
59
60
  /**
60
61
  * 流程节点插件
61
62
  */
62
- export interface FlowNodePlugin {
63
+ export interface FlowNodePluginConfig extends PluginConfig<FlowNodePluginInfo> {
63
64
  /**
64
- * 无需配置可以直接使用
65
+ * 配置 ui, 与 {@link uiConfigComponent} 属性二选一
65
66
  */
66
- noConfig?: boolean;
67
- pluginInfo: FlowNodePluginInfo;
67
+ uiConfig?: UITemplateConfig;
68
68
  /**
69
- * 自定义配置 UI
69
+ * 自定义配置 UI, 与 {@link uiConfig} 属性二选一
70
70
  */
71
71
  uiConfigComponent?: AsyncComponentLoader;
72
72
  }
@@ -83,7 +83,6 @@ export interface IFlowContext {
83
83
  * 流程节点动作
84
84
  */
85
85
  export interface IFlowNodeActions<T> {
86
- code: string;
87
86
  execute?: (flow: IFlowItem, flowData: IFlowNode<T>, data: IFlowContext) => Promise<void>;
88
87
  onSaveData?: (flow: IFlowItem, flowData: IFlowNode<T>) => void;
89
88
  onDestroy?: (flow: IFlowItem, flowData: IFlowNode<T>) => void;
@@ -50,5 +50,8 @@ export interface PluginConfig<T extends PluginInfo = PluginInfo> {
50
50
  * 无需配置可以直接使用
51
51
  */
52
52
  noConfig?: boolean;
53
+ /**
54
+ * 插件配置
55
+ */
53
56
  pluginInfo: T;
54
57
  }
@@ -1,5 +1,6 @@
1
1
  import { AsyncComponentLoader, AsyncComponentOptions } from 'vue';
2
2
  import { PluginInfo, PluginConfig } from './Plugin';
3
+ import { UITemplateConfig } from './UITemplate';
3
4
  /**
4
5
  * 上传文件结果
5
6
  */
@@ -114,6 +115,9 @@ export interface StorageUIConfig {
114
115
  export interface StoragePluginInfo extends PluginInfo {
115
116
  /**
116
117
  * 插件分组
118
+ * cloudVendor 云厂商
119
+ * self 自建
120
+ * other 其他
117
121
  */
118
122
  pluginGroup: 'cloudVendor' | 'self' | 'other';
119
123
  }
@@ -124,5 +128,5 @@ export interface StoragePluginConfig extends PluginConfig<StoragePluginInfo> {
124
128
  /**
125
129
  * 配置 ui
126
130
  */
127
- uiConfig?: StorageUIConfig;
131
+ uiConfig?: UITemplateConfig;
128
132
  }
@@ -0,0 +1,45 @@
1
+ import { AsyncComponentLoader, AsyncComponentOptions } from 'vue';
2
+ export type DynamicFormItemType = 'input' | 'input-format' | 'radio-group' | 'switch' | 'input-button' | 'select' | 'custom';
3
+ /**
4
+ * 动态表单项
5
+ */
6
+ export interface DynamicFormItem {
7
+ /**
8
+ * 表单项类型
9
+ */
10
+ type: DynamicFormItemType;
11
+ /**
12
+ * 自定义表单组件
13
+ */
14
+ customComponent?: AsyncComponentLoader | AsyncComponentOptions;
15
+ /**
16
+ * 表单项基本属性值
17
+ */
18
+ formItem: {
19
+ rules?: Record<string, any>;
20
+ name: string;
21
+ label: string;
22
+ [key: string]: any;
23
+ };
24
+ /**
25
+ * 元素属性值
26
+ */
27
+ elementProperty: Record<string, any>;
28
+ /**
29
+ * 元素事件
30
+ */
31
+ elementEvent?: Record<string, any>;
32
+ }
33
+ /**
34
+ * 动态表单配置
35
+ */
36
+ export interface UITemplateConfig {
37
+ /**
38
+ * 提示
39
+ */
40
+ tips: string;
41
+ /**
42
+ * 表单
43
+ */
44
+ forms: DynamicFormItem[];
45
+ }
@@ -0,0 +1,10 @@
1
+ /**
2
+ * 类型定义包入口
3
+ */
4
+ export * from './File';
5
+ export * from './Common';
6
+ export * from './Store';
7
+ export * from './Plugin';
8
+ export * from './Storage';
9
+ export * from './Flow';
10
+ export * from './UITemplate';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@xiaou66/picture-types",
3
- "version": "0.0.4",
3
+ "version": "0.0.6",
4
4
  "description": "Picture bed plugin system",
5
5
  "main": "./dist/index.cjs.js",
6
6
  "module": "./dist/index.es.js",
@@ -15,11 +15,15 @@
15
15
  "build": "vite build",
16
16
  "dev": "vite",
17
17
  "prepare": "npm run build",
18
- "publish": "npm publish"
18
+ "prepublishOnly": "tsx scripts/set-publish-types.ts",
19
+ "postpublish": "tsx scripts/set-dev-types.ts",
20
+ "release": "npm publish"
19
21
  },
20
22
  "author": "xiaou",
21
23
  "license": "ISC",
22
24
  "devDependencies": {
25
+ "@types/node": "^22.17.1",
26
+ "tsx": "^4.21.0",
23
27
  "typescript": "^5.0.0",
24
28
  "vite": "npm:rolldown-vite@^7.2.11",
25
29
  "vite-plugin-dts": "^4.5.0",
File without changes
File without changes
File without changes