vue-openlayers-plugin 1.2.1 → 1.2.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.
- package/lib/{BasemapPanel-aa284bf3.mjs → BasemapPanel-be1d9cda.mjs} +1 -1
- package/lib/{CoordinateLocationDialog-6c0a6b23.mjs → CoordinateLocationDialog-327017db.mjs} +1 -1
- package/lib/{MapPrintDialog-2e5a22e7.mjs → FilterPanel-fe05a0c3.mjs} +1 -1
- package/lib/{FilterPanel-b91325ac.mjs → LayerPanel-ee56d110.mjs} +1 -1
- package/lib/{LayerPanel-88983648.mjs → MapPrintDialog-8f85faf6.mjs} +1 -1
- package/lib/{MeasurementDialog-ebda57e6.mjs → MeasurementDialog-ad41276e.mjs} +1 -1
- package/lib/{MyMarkersDialog-1f851036.mjs → MyMarkersDialog-f58c3d82.mjs} +1 -1
- package/lib/{QuadCompareDialog-8f624242.mjs → QuadCompareDialog-77717fa0.mjs} +1 -1
- package/lib/{RegionNavigationDialog-549597e1.mjs → RegionNavigationDialog-7f57b172.mjs} +1 -1
- package/lib/{SplitCompareDialog-9bcce145.mjs → SplitCompareDialog-e0053f70.mjs} +1 -1
- package/lib/{SwipeCompareDialog-374b9865.mjs → SwipeCompareDialog-b8a6fb38.mjs} +1 -1
- package/lib/{ViewBookmarksDialog-10b5fe14.mjs → ViewBookmarksDialog-2606fd88.mjs} +1 -1
- package/lib/{index-b9d6884a.mjs → index-9f3d290c.mjs} +1 -1
- package/lib/{index-e8d5fc75.mjs → index-ea6e6f60.mjs} +130 -56
- package/lib/{index.es-ff0f4147.mjs → index.es-c30abac9.mjs} +1 -1
- package/lib/index.esm.js +1 -1
- package/lib/index.umd.js +118 -44
- package/lib/style.css +26 -26
- package/package.json +2 -9
- package/types/components/OlControlPanel.vue.d.ts +3 -1
- package/types/components/OlControlPanel.vue.d.ts.map +1 -1
- package/types/components/OlDialogs/LayerPanel.vue.d.ts +12 -0
- package/types/components/OlDialogs/LayerPanel.vue.d.ts.map +1 -1
- package/types/components/OlMap.vue.d.ts +27 -1
- package/types/components/OlMap.vue.d.ts.map +1 -1
- package/types/core/MapManager.d.ts +5 -0
- package/types/core/MapManager.d.ts.map +1 -1
- package/types/index.d.ts +27 -42
- package/types/index.d.ts.map +1 -0
- package/types/lowcode-entry.d.ts +29 -0
- package/types/lowcode-entry.d.ts.map +1 -1
- package/types/types/map.d.ts +11 -0
- package/types/types/map.d.ts.map +1 -1
- package/lib//346/240/207/345/207/206 +0 -159
- package/types/tsconfig.tsbuildinfo +0 -1
|
@@ -1,159 +0,0 @@
|
|
|
1
|
-
代码依据:
|
|
2
|
-
|
|
3
|
-
- component.json 结构/约束校验(最全): componentRegistry/index.vue
|
|
4
|
-
- 上传组件包时的强约束(更严格): developer.js
|
|
5
|
-
- 右侧属性面板支持的 properties 字段(真正会生效的子集): PropsForm.vue
|
|
6
|
-
- 远程组件动态加载契约(libraryName/window 暴露等): remoteLoader.ts
|
|
7
|
-
## 0) 组件包交付物(必须)
|
|
8
|
-
一个可安装组件包(zip 或目录)至少包含:
|
|
9
|
-
|
|
10
|
-
- component.json (必须,放在包根目录;上传时会从 zip 里读取/校验)
|
|
11
|
-
- runtime.entry 指向的入口脚本(必须存在于包内,且路径匹配)
|
|
12
|
-
- 可选: runtime.style 样式文件、 designer.thumbnail/preview 资源
|
|
13
|
-
上传端会在 zip 内查找 component.json 并 JSON.parse,然后校验必填字段与入口文件存在性: developer.js
|
|
14
|
-
|
|
15
|
-
## 1) component.json 顶层 Schema(最详细字段表)
|
|
16
|
-
### 1.1 顶层字段
|
|
17
|
-
字段 必填 类型 说明 specVersion 是 string 组件协议版本,例如 "1.0.0" ;会做 semver 对比与兼容提示 meta 是 object 基础信息(ID/名称/版本/分类等) runtime 是 object 运行时加载与依赖声明 properties 是 object 组件属性定义(JSON Schema 子集,驱动右侧属性面板) designer 否 object 设计器侧展示与默认配置(宽高/缩略图/默认 props 等) events 否 array 组件可对外触发的事件声明(用于交互编排) actions 否 array 组件可被平台调用的动作声明(能力/方法) dataSchema 否 object 数据结构描述(JSON Schema,当前主要用于文档/校验) styleSchema 否 object 样式结构描述(JSON Schema,当前主要用于文档/校验) i18n 否 object 多语言字典(object)
|
|
18
|
-
|
|
19
|
-
## 2) meta(基础信息)字段约定
|
|
20
|
-
### 2.1 meta 必填
|
|
21
|
-
- meta.id: string
|
|
22
|
-
- 必须为反向域名风格 :如 com.company.widgetName
|
|
23
|
-
- 校验正则在注册中心里写死(反向域名 like): componentRegistry/index.vue
|
|
24
|
-
- meta.name: string :组件展示名
|
|
25
|
-
- meta.version: string : semver ,如 1.0.0 / 1.0.0-beta.1
|
|
26
|
-
- meta.category: string :分类(用于组件库分组/检索)
|
|
27
|
-
### 2.2 meta 可选
|
|
28
|
-
- meta.description/author/homepage/license/icon: string
|
|
29
|
-
- meta.keywords: string[] (建议 ≤ 20,且不重复)
|
|
30
|
-
- meta.tags: string[] (建议 ≤ 20,且不重复)
|
|
31
|
-
## 3) runtime(运行时加载与依赖)字段约定
|
|
32
|
-
### 3.1 runtime 必填
|
|
33
|
-
- runtime.entry: string
|
|
34
|
-
- 资源引用:URL 或相对路径(如 ./dist/index.js )
|
|
35
|
-
- 注册中心要求是 URL/相对路径,建议 .js/.mjs : componentRegistry/index.vue
|
|
36
|
-
- runtime.type: "umd" | "esm" | "iife"
|
|
37
|
-
- 注意:上传流程更严格 :当前上传校验只接受 iife : developer.js
|
|
38
|
-
- runtime.factory: string
|
|
39
|
-
- 必须是合法 JS 标识符(例如 createComponent ): componentRegistry/index.vue
|
|
40
|
-
### 3.2 runtime 条件必填
|
|
41
|
-
- runtime.library: string
|
|
42
|
-
- umd/iife 下必填(esm 下通常不需要): componentRegistry/index.vue
|
|
43
|
-
- 运行时会通过 window[libraryName] 获取组件导出(script tag fallback): remoteLoader.ts
|
|
44
|
-
### 3.3 runtime 可选
|
|
45
|
-
- runtime.style: string :css 路径或 URL(建议 .css )
|
|
46
|
-
- runtime.dependencies: Record<string,string>
|
|
47
|
-
- 额外依赖映射,值可以是 .js 或 .css ,运行时会动态插入 script/link: remoteLoader.ts
|
|
48
|
-
- runtime.externals: Record<string,string>
|
|
49
|
-
- 外部依赖全局变量映射,例如: { "vue":"Vue", "element-plus":"ElementPlus", "echarts":"echarts" }
|
|
50
|
-
- runtime.buildMode: "vite" | "copy"
|
|
51
|
-
- 当前上传流程校验该字段(用于打包策略描述): developer.js
|
|
52
|
-
## 4) properties(组件属性 Schema)——“最关键 & 最容易踩坑”的部分
|
|
53
|
-
你可以把 properties 理解为: 右侧属性面板“动态表单”的协议 。当前实现不是完整 JSON Schema 引擎,只支持一小部分关键字(写其他的不会报错,但不会生效)。
|
|
54
|
-
|
|
55
|
-
### 4.1 properties 根对象(必须)
|
|
56
|
-
```
|
|
57
|
-
{
|
|
58
|
-
"type": "object",
|
|
59
|
-
"properties": {
|
|
60
|
-
"fieldA": { "...FieldSchema" :
|
|
61
|
-
true }
|
|
62
|
-
}
|
|
63
|
-
}
|
|
64
|
-
```
|
|
65
|
-
- PropsForm 会直接遍历 schema.properties 渲染字段: PropsForm.vue
|
|
66
|
-
### 4.2 FieldSchema(单字段)真正生效的字段
|
|
67
|
-
字段 类型 是否生效 说明 type string 是 控件类型判断(string/number/integer/boolean/object/array) title string 是 表单 label(不写则用 key) description string 是 字段下帮助文案 enum any[] 是 下拉选择(label/value 直接用枚举值本身) format string 部分 仅支持: json / color / textarea
|
|
68
|
-
|
|
69
|
-
### 4.3 控件映射(按优先级,完全按代码)
|
|
70
|
-
1. JSON 编辑器 : format === "json" 或 type === "object" 或 type === "array"
|
|
71
|
-
2. 下拉选择 : enum 存在
|
|
72
|
-
3. 颜色 : format === "color" 或字段 key 命中 /color|background/i (隐式规则)
|
|
73
|
-
4. 数字 : type === "number" | "integer"
|
|
74
|
-
5. 布尔 : type === "boolean"
|
|
75
|
-
6. 多行文本 : type === "string" && format === "textarea"
|
|
76
|
-
7. 默认输入框 :兜底
|
|
77
|
-
对应源码一眼就能对照: PropsForm.vue
|
|
78
|
-
|
|
79
|
-
### 4.4 当前“不支持/不会生效”的常见 Schema 关键字(写了也没用)
|
|
80
|
-
default / required / minimum / maximum / minLength / pattern / items / oneOf / anyOf / allOf / $ref / ui:* / x-* 等——PropsForm 都不会读取。
|
|
81
|
-
|
|
82
|
-
## 5) designer(设计器侧信息)字段约定(可选但强烈建议)
|
|
83
|
-
- designer.thumbnail: string :组件库缩略图
|
|
84
|
-
- designer.preview: string :预览资源(视频/图片)
|
|
85
|
-
- designer.width/height/minWidth/minHeight/maxWidth/maxHeight: number (正数校验)
|
|
86
|
-
- designer.aspectRatio: number | "W:H" (例如 "16:9" ,会做一致性 warning)
|
|
87
|
-
- designer.defaultProps: object :新建节点时 props 初始值(会按 properties 做一次值校验提示)
|
|
88
|
-
- designer.plugins: Record<string,string> :设计器插件映射(包名 -> 版本/地址)
|
|
89
|
-
字段校验见: componentRegistry/index.vue
|
|
90
|
-
|
|
91
|
-
## 6) events / actions(交互与能力)字段约定
|
|
92
|
-
### 6.1 events(可选)
|
|
93
|
-
- events: Array<{ name: string; title?: string; description?: string; schema?: object }>
|
|
94
|
-
- name 不能重复(会报错): componentRegistry/index.vue
|
|
95
|
-
### 6.2 actions(可选)
|
|
96
|
-
- actions: Array<{ name: string; title?: string; description?: string; parameters?: object }>
|
|
97
|
-
- name 不能重复(会报错): componentRegistry/index.vue
|
|
98
|
-
## 7) 一份“可直接用”的最小完整模板(iife 兼容上传流程)
|
|
99
|
-
```
|
|
100
|
-
{
|
|
101
|
-
"specVersion": "1.0.0",
|
|
102
|
-
"meta": {
|
|
103
|
-
"id": "com.company.widget",
|
|
104
|
-
"name": "示例组件",
|
|
105
|
-
"version": "1.0.0",
|
|
106
|
-
"category": "custom",
|
|
107
|
-
"description": "组件简介",
|
|
108
|
-
"tags": ["demo"],
|
|
109
|
-
"keywords": ["example"]
|
|
110
|
-
},
|
|
111
|
-
"runtime": {
|
|
112
|
-
"entry": "./dist/index.js",
|
|
113
|
-
"style": "./dist/style.css",
|
|
114
|
-
"type": "iife",
|
|
115
|
-
"library": "MyWidget",
|
|
116
|
-
"factory": "createComponent",
|
|
117
|
-
"externals": {
|
|
118
|
-
"vue": "Vue",
|
|
119
|
-
"element-plus": "ElementPlus",
|
|
120
|
-
"echarts": "echarts"
|
|
121
|
-
},
|
|
122
|
-
"dependencies": {}
|
|
123
|
-
},
|
|
124
|
-
"designer": {
|
|
125
|
-
"thumbnail": "./assets/
|
|
126
|
-
thumbnail.png",
|
|
127
|
-
"width": 600,
|
|
128
|
-
"height": 300,
|
|
129
|
-
"defaultProps": {}
|
|
130
|
-
},
|
|
131
|
-
"properties": {
|
|
132
|
-
"type": "object",
|
|
133
|
-
"properties": {
|
|
134
|
-
"title": { "type": "string",
|
|
135
|
-
"title": "标题",
|
|
136
|
-
"description": "显示标题" },
|
|
137
|
-
"count": { "type": "number",
|
|
138
|
-
"title": "数值" },
|
|
139
|
-
"themeColor": { "type":
|
|
140
|
-
"string", "title": "主题色",
|
|
141
|
-
"format": "color" },
|
|
142
|
-
"option": { "type": "object",
|
|
143
|
-
"title": "配置", "format":
|
|
144
|
-
"json", "description": "JSON
|
|
145
|
-
配置" },
|
|
146
|
-
"desc": { "type": "string",
|
|
147
|
-
"title": "说明", "format":
|
|
148
|
-
"textarea" },
|
|
149
|
-
"mode": { "type": "string",
|
|
150
|
-
"title": "模式", "enum":
|
|
151
|
-
["A", "B", "C"] }
|
|
152
|
-
}
|
|
153
|
-
},
|
|
154
|
-
"events": [{ "name": "click",
|
|
155
|
-
"title": "点击" }],
|
|
156
|
-
"actions": [{ "name": "refresh",
|
|
157
|
-
"title": "刷新" }]
|
|
158
|
-
}
|
|
159
|
-
```
|