@tachybase/plugin-block-map 0.23.8

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 (91) hide show
  1. package/.turbo/turbo-build.log +14 -0
  2. package/LICENSE +201 -0
  3. package/README.md +13 -0
  4. package/README.zh-CN.md +13 -0
  5. package/client.d.ts +2 -0
  6. package/client.js +1 -0
  7. package/dist/client/block/MapActionInitializers.d.ts +2 -0
  8. package/dist/client/block/MapBlock.Settings.d.ts +2 -0
  9. package/dist/client/block/MapBlock.d.ts +2 -0
  10. package/dist/client/block/MapBlockDesigner.d.ts +2 -0
  11. package/dist/client/block/MapBlockInitializer.d.ts +2 -0
  12. package/dist/client/block/MapBlockProvider.d.ts +5 -0
  13. package/dist/client/block/createMapBlockUISchema.d.ts +6 -0
  14. package/dist/client/block/index.d.ts +2 -0
  15. package/dist/client/block/utils.d.ts +1 -0
  16. package/dist/client/components/AMap/Block.d.ts +2 -0
  17. package/dist/client/components/AMap/Map.d.ts +39 -0
  18. package/dist/client/components/AMap/Search.d.ts +7 -0
  19. package/dist/client/components/AMap/index.d.ts +2 -0
  20. package/dist/client/components/Configuration.d.ts +2 -0
  21. package/dist/client/components/Designer.d.ts +3 -0
  22. package/dist/client/components/GoogleMaps/Block.d.ts +2 -0
  23. package/dist/client/components/GoogleMaps/Map.d.ts +30 -0
  24. package/dist/client/components/GoogleMaps/Search.d.ts +7 -0
  25. package/dist/client/components/GoogleMaps/index.d.ts +2 -0
  26. package/dist/client/components/GoogleMaps/utils.d.ts +5 -0
  27. package/dist/client/components/Map.d.ts +8 -0
  28. package/dist/client/components/MapBlock.d.ts +2 -0
  29. package/dist/client/components/MapComponent.d.ts +2 -0
  30. package/dist/client/components/ReadPretty.d.ts +3 -0
  31. package/dist/client/components/index.d.ts +6 -0
  32. package/dist/client/constants.d.ts +6 -0
  33. package/dist/client/fields/circle.d.ts +20 -0
  34. package/dist/client/fields/index.d.ts +2 -0
  35. package/dist/client/fields/lineString.d.ts +20 -0
  36. package/dist/client/fields/point.d.ts +20 -0
  37. package/dist/client/fields/polygon.d.ts +20 -0
  38. package/dist/client/fields/schema.d.ts +43 -0
  39. package/dist/client/hooks/index.d.ts +1 -0
  40. package/dist/client/hooks/useMapConfiguration.d.ts +3 -0
  41. package/dist/client/index.d.ts +5 -0
  42. package/dist/client/index.js +98 -0
  43. package/dist/client/locale/index.d.ts +4 -0
  44. package/dist/client/types.d.ts +1 -0
  45. package/dist/client/utils.d.ts +1 -0
  46. package/dist/externalVersion.js +14 -0
  47. package/dist/index.d.ts +2 -0
  48. package/dist/index.js +39 -0
  49. package/dist/locale/en-US.json +51 -0
  50. package/dist/locale/ko_KR.json +51 -0
  51. package/dist/locale/pt-BR.json +45 -0
  52. package/dist/locale/zh-CN.json +51 -0
  53. package/dist/server/actions/index.d.ts +3 -0
  54. package/dist/server/actions/index.js +65 -0
  55. package/dist/server/collections/mapConfiguration.d.ts +2 -0
  56. package/dist/server/collections/mapConfiguration.js +51 -0
  57. package/dist/server/constants.d.ts +1 -0
  58. package/dist/server/constants.js +27 -0
  59. package/dist/server/fields/circle.d.ts +12 -0
  60. package/dist/server/fields/circle.js +67 -0
  61. package/dist/server/fields/index.d.ts +4 -0
  62. package/dist/server/fields/index.js +27 -0
  63. package/dist/server/fields/lineString.d.ts +12 -0
  64. package/dist/server/fields/lineString.js +74 -0
  65. package/dist/server/fields/point.d.ts +12 -0
  66. package/dist/server/fields/point.js +77 -0
  67. package/dist/server/fields/polygon.d.ts +12 -0
  68. package/dist/server/fields/polygon.js +73 -0
  69. package/dist/server/helpers/index.d.ts +6 -0
  70. package/dist/server/helpers/index.js +56 -0
  71. package/dist/server/index.d.ts +1 -0
  72. package/dist/server/index.js +33 -0
  73. package/dist/server/plugin.d.ts +11 -0
  74. package/dist/server/plugin.js +86 -0
  75. package/dist/server/value-parsers/index.d.ts +13 -0
  76. package/dist/server/value-parsers/index.js +77 -0
  77. package/dist/swagger/index.d.ts +77 -0
  78. package/dist/swagger/index.js +100 -0
  79. package/docs/en-US/changelog.md +1 -0
  80. package/docs/en-US/index.md +1 -0
  81. package/docs/en-US/installation.md +1 -0
  82. package/docs/en-US/tabs.json +18 -0
  83. package/docs/en-US/usage.md +1 -0
  84. package/docs/zh-CN/changelog.md +1 -0
  85. package/docs/zh-CN/index.md +1 -0
  86. package/docs/zh-CN/installation.md +1 -0
  87. package/docs/zh-CN/tabs.json +18 -0
  88. package/docs/zh-CN/usage.md +1 -0
  89. package/package.json +42 -0
  90. package/server.d.ts +2 -0
  91. package/server.js +1 -0
@@ -0,0 +1,77 @@
1
+ var __defProp = Object.defineProperty;
2
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
3
+ var __getOwnPropNames = Object.getOwnPropertyNames;
4
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
5
+ var __export = (target, all) => {
6
+ for (var name in all)
7
+ __defProp(target, name, { get: all[name], enumerable: true });
8
+ };
9
+ var __copyProps = (to, from, except, desc) => {
10
+ if (from && typeof from === "object" || typeof from === "function") {
11
+ for (let key of __getOwnPropNames(from))
12
+ if (!__hasOwnProp.call(to, key) && key !== except)
13
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
14
+ }
15
+ return to;
16
+ };
17
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
18
+ var value_parsers_exports = {};
19
+ __export(value_parsers_exports, {
20
+ CircleValueParser: () => CircleValueParser,
21
+ LineStringValueParser: () => LineStringValueParser,
22
+ PointValueParser: () => PointValueParser,
23
+ PolygonValueParser: () => PolygonValueParser
24
+ });
25
+ module.exports = __toCommonJS(value_parsers_exports);
26
+ var import_database = require("@tachybase/database");
27
+ class PointValueParser extends import_database.BaseValueParser {
28
+ async setValue(value) {
29
+ if (Array.isArray(value)) {
30
+ this.value = value;
31
+ } else if (typeof value === "string") {
32
+ this.value = value.split(",");
33
+ } else {
34
+ this.errors.push("Value invalid");
35
+ }
36
+ }
37
+ }
38
+ class PolygonValueParser extends import_database.BaseValueParser {
39
+ async setValue(value) {
40
+ if (Array.isArray(value)) {
41
+ this.value = value;
42
+ } else if (typeof value === "string") {
43
+ this.value = value.substring(1, value.length - 1).split("),(").map((v) => v.split(","));
44
+ } else {
45
+ this.errors.push("Value invalid");
46
+ }
47
+ }
48
+ }
49
+ class LineStringValueParser extends import_database.BaseValueParser {
50
+ async setValue(value) {
51
+ if (Array.isArray(value)) {
52
+ this.value = value;
53
+ } else if (typeof value === "string") {
54
+ this.value = value.substring(1, value.length - 1).split("),(").map((v) => v.split(","));
55
+ } else {
56
+ this.errors.push("Value invalid");
57
+ }
58
+ }
59
+ }
60
+ class CircleValueParser extends import_database.BaseValueParser {
61
+ async setValue(value) {
62
+ if (Array.isArray(value)) {
63
+ this.value = value;
64
+ } else if (typeof value === "string") {
65
+ this.value = value.split(",");
66
+ } else {
67
+ this.errors.push("Value invalid");
68
+ }
69
+ }
70
+ }
71
+ // Annotate the CommonJS export names for ESM import in node:
72
+ 0 && (module.exports = {
73
+ CircleValueParser,
74
+ LineStringValueParser,
75
+ PointValueParser,
76
+ PolygonValueParser
77
+ });
@@ -0,0 +1,77 @@
1
+ declare const _default: {
2
+ info: {
3
+ title: string;
4
+ };
5
+ paths: {
6
+ '/map-configuration:get': {
7
+ get: {
8
+ description: string;
9
+ tags: string[];
10
+ parameters: {
11
+ name: string;
12
+ in: string;
13
+ description: string;
14
+ required: boolean;
15
+ schema: {
16
+ type: string;
17
+ default: string;
18
+ enum: string[];
19
+ };
20
+ }[];
21
+ responses: {
22
+ 200: {
23
+ description: string;
24
+ content: {
25
+ 'application/json': {
26
+ schema: {
27
+ $ref: string;
28
+ };
29
+ };
30
+ };
31
+ };
32
+ };
33
+ };
34
+ };
35
+ '/map-configuration:set': {
36
+ post: {
37
+ description: string;
38
+ tags: string[];
39
+ requestBody: {
40
+ content: {
41
+ 'application/json': {
42
+ schema: {
43
+ $ref: string;
44
+ };
45
+ };
46
+ };
47
+ };
48
+ responses: {
49
+ 200: {
50
+ description: string;
51
+ };
52
+ };
53
+ };
54
+ };
55
+ };
56
+ components: {
57
+ schemas: {
58
+ mapConfiguration: {
59
+ type: string;
60
+ properties: {
61
+ accessKey: {
62
+ type: string;
63
+ };
64
+ securityJsCode: {
65
+ type: string;
66
+ };
67
+ type: {
68
+ type: string;
69
+ default: string;
70
+ enum: string[];
71
+ };
72
+ };
73
+ };
74
+ };
75
+ };
76
+ };
77
+ export default _default;
@@ -0,0 +1,100 @@
1
+ var __defProp = Object.defineProperty;
2
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
3
+ var __getOwnPropNames = Object.getOwnPropertyNames;
4
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
5
+ var __export = (target, all) => {
6
+ for (var name in all)
7
+ __defProp(target, name, { get: all[name], enumerable: true });
8
+ };
9
+ var __copyProps = (to, from, except, desc) => {
10
+ if (from && typeof from === "object" || typeof from === "function") {
11
+ for (let key of __getOwnPropNames(from))
12
+ if (!__hasOwnProp.call(to, key) && key !== except)
13
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
14
+ }
15
+ return to;
16
+ };
17
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
18
+ var swagger_exports = {};
19
+ __export(swagger_exports, {
20
+ default: () => swagger_default
21
+ });
22
+ module.exports = __toCommonJS(swagger_exports);
23
+ var swagger_default = {
24
+ info: {
25
+ title: "TachyBase API - Map plugin"
26
+ },
27
+ paths: {
28
+ "/map-configuration:get": {
29
+ get: {
30
+ description: "Get map configuration",
31
+ tags: ["map-configuration"],
32
+ parameters: [
33
+ {
34
+ name: "type",
35
+ in: "query",
36
+ description: "Map type",
37
+ required: true,
38
+ schema: {
39
+ type: "string",
40
+ default: "amap",
41
+ enum: ["amap", "google"]
42
+ }
43
+ }
44
+ ],
45
+ responses: {
46
+ 200: {
47
+ description: "successful operation",
48
+ content: {
49
+ "application/json": {
50
+ schema: {
51
+ $ref: "#/components/schemas/mapConfiguration"
52
+ }
53
+ }
54
+ }
55
+ }
56
+ }
57
+ }
58
+ },
59
+ "/map-configuration:set": {
60
+ post: {
61
+ description: "\u8BBE\u7F6E\xB7\u5730\u56FE\u914D\u7F6E",
62
+ tags: ["map-configuration"],
63
+ requestBody: {
64
+ content: {
65
+ "application/json": {
66
+ schema: {
67
+ $ref: "#/components/schemas/mapConfiguration"
68
+ }
69
+ }
70
+ }
71
+ },
72
+ responses: {
73
+ 200: {
74
+ description: "ok"
75
+ }
76
+ }
77
+ }
78
+ }
79
+ },
80
+ components: {
81
+ schemas: {
82
+ mapConfiguration: {
83
+ type: "object",
84
+ properties: {
85
+ accessKey: {
86
+ type: "string"
87
+ },
88
+ securityJsCode: {
89
+ type: "string"
90
+ },
91
+ type: {
92
+ type: "string",
93
+ default: "amap",
94
+ enum: ["amap", "google"]
95
+ }
96
+ }
97
+ }
98
+ }
99
+ }
100
+ };
@@ -0,0 +1 @@
1
+ # Map Changelog
@@ -0,0 +1 @@
1
+ # Map overview
@@ -0,0 +1 @@
1
+ # Map Installation
@@ -0,0 +1,18 @@
1
+ [
2
+ {
3
+ "title": "Introduction",
4
+ "path": "index"
5
+ },
6
+ {
7
+ "title": "Installation",
8
+ "path": "installation"
9
+ },
10
+ {
11
+ "title": "Usage",
12
+ "path": "usage"
13
+ },
14
+ {
15
+ "title": "Changelog",
16
+ "path": "changelog"
17
+ }
18
+ ]
@@ -0,0 +1 @@
1
+ # Map Usage
@@ -0,0 +1 @@
1
+ # 地图更新日志
@@ -0,0 +1 @@
1
+ # 地图
@@ -0,0 +1 @@
1
+ # 地图安装方法
@@ -0,0 +1,18 @@
1
+ [
2
+ {
3
+ "title": "介绍",
4
+ "path": "index"
5
+ },
6
+ {
7
+ "title": "安装",
8
+ "path": "installation"
9
+ },
10
+ {
11
+ "title": "用法",
12
+ "path": "usage"
13
+ },
14
+ {
15
+ "title": "日志",
16
+ "path": "changelog"
17
+ }
18
+ ]
@@ -0,0 +1 @@
1
+ # 地图用法
package/package.json ADDED
@@ -0,0 +1,42 @@
1
+ {
2
+ "name": "@tachybase/plugin-block-map",
3
+ "displayName": "Block: Map",
4
+ "version": "0.23.8",
5
+ "description": "Map block, support Gaode map and Google map, you can also extend more map types.",
6
+ "keywords": [
7
+ "Blocks"
8
+ ],
9
+ "license": "Apache-2.0",
10
+ "main": "./dist/server/index.js",
11
+ "devDependencies": {
12
+ "@amap/amap-jsapi-loader": "^1.0.1",
13
+ "@amap/amap-jsapi-types": "^0.0.10",
14
+ "@ant-design/icons": "~5.3.7",
15
+ "@googlemaps/js-api-loader": "^1.16.8",
16
+ "@types/google.maps": "^3.58.1",
17
+ "@types/react": "^18.3.18",
18
+ "@types/react-dom": "^18.3.5",
19
+ "ahooks": "^3.8.4",
20
+ "antd": "5.22.5",
21
+ "lodash": "4.17.21",
22
+ "react": "~18.3.1",
23
+ "react-dom": "~18.3.1",
24
+ "react-i18next": "^15.2.0",
25
+ "react-router-dom": "6.28.1",
26
+ "@tachybase/components": "0.23.8",
27
+ "@tachybase/schema": "0.23.8"
28
+ },
29
+ "peerDependencies": {
30
+ "@tachybase/client": "0.23.8",
31
+ "@tachybase/test": "0.23.8",
32
+ "@tachybase/server": "0.23.8",
33
+ "@tachybase/utils": "0.23.8",
34
+ "@tachybase/database": "0.23.8",
35
+ "@tachybase/actions": "0.23.8"
36
+ },
37
+ "description.zh-CN": "地图卡片,支持高德地图和 Google 地图,你也可以扩展更多地图类型。",
38
+ "displayName.zh-CN": "卡片:地图",
39
+ "scripts": {
40
+ "build": "tachybase-build --no-dts @tachybase/plugin-block-map"
41
+ }
42
+ }
package/server.d.ts ADDED
@@ -0,0 +1,2 @@
1
+ export * from './dist/server';
2
+ export { default } from './dist/server';
package/server.js ADDED
@@ -0,0 +1 @@
1
+ module.exports = require('./dist/server/index.js');