@nocobase/plugin-map 2.1.0-beta.9 → 2.2.0-beta.1

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 (71) hide show
  1. package/client-v2.d.ts +2 -0
  2. package/client-v2.js +1 -0
  3. package/dist/client/694.c68fa63538a70259.js +10 -0
  4. package/dist/client/720.f7ca9eb1235e7ba8.js +10 -0
  5. package/dist/client/components/GoogleMaps/Map.d.ts +2 -1
  6. package/dist/client/googleMapsDrawingManager.d.ts +34 -0
  7. package/dist/client/hooks/useMapConfig.d.ts +2 -2
  8. package/dist/client/hooks/useMapConfiguration.d.ts +1 -0
  9. package/dist/client/index.js +1 -1
  10. package/dist/client/types.d.ts +1 -1
  11. package/dist/client/utils.d.ts +1 -3
  12. package/dist/client-v2/577.e1fcc82fab0ef39b.js +10 -0
  13. package/dist/client-v2/641.ef67f0b66b92ff21.js +10 -0
  14. package/dist/client-v2/694.5f486a695fdeb42a.js +10 -0
  15. package/dist/client-v2/720.6ede563c5d95f038.js +10 -0
  16. package/dist/client-v2/872.53cbb217b7708463.js +10 -0
  17. package/dist/{client/models/MapBlockComponent.d.ts → client-v2/constants.d.ts} +4 -2
  18. package/dist/client-v2/fields/circle.d.ts +26 -0
  19. package/dist/client-v2/fields/index.d.ts +14 -0
  20. package/dist/client-v2/fields/lineString.d.ts +26 -0
  21. package/dist/client-v2/fields/point.d.ts +26 -0
  22. package/dist/client-v2/fields/polygon.d.ts +26 -0
  23. package/dist/client-v2/fields/schema.d.ts +27 -0
  24. package/dist/client-v2/hooks/index.d.ts +9 -0
  25. package/dist/client-v2/hooks/useMapConfig.d.ts +11 -0
  26. package/dist/client-v2/index.d.ts +9 -0
  27. package/dist/client-v2/index.js +10 -0
  28. package/dist/client-v2/locale.d.ts +11 -0
  29. package/dist/client-v2/models/MapActionGroupModel.d.ts +14 -0
  30. package/dist/client-v2/models/MapBlockComponent.d.ts +12 -0
  31. package/dist/{client → client-v2}/models/MapBlockModel.d.ts +14 -2
  32. package/dist/{client → client-v2}/models/components/AMap/Map.d.ts +1 -1
  33. package/dist/{client → client-v2}/models/components/GoogleMaps/Map.d.ts +41 -3
  34. package/dist/{client → client-v2}/models/fieldModels/DisplayMapFieldModel.d.ts +4 -1
  35. package/dist/{client → client-v2}/models/fieldModels/MapFieldModel.d.ts +1 -1
  36. package/dist/{client/models/components → client-v2/pages}/Configuration.d.ts +2 -1
  37. package/dist/client-v2/plugin.d.ts +13 -0
  38. package/dist/externalVersion.js +8 -8
  39. package/dist/server/collections/mapConfiguration.js +1 -0
  40. package/dist/{client/models/MapActionGroupModel.d.ts → shared/configuration.d.ts} +2 -3
  41. package/dist/shared/configuration.js +39 -0
  42. package/dist/shared/constants.d.ts +10 -0
  43. package/dist/shared/constants.js +43 -0
  44. package/dist/shared/theme.d.ts +10 -0
  45. package/dist/shared/theme.js +39 -0
  46. package/dist/shared/types.d.ts +9 -0
  47. package/dist/shared/types.js +24 -0
  48. package/dist/shared/utils.d.ts +13 -0
  49. package/dist/shared/utils.js +98 -0
  50. package/package.json +4 -2
  51. package/dist/client/models/components/Map.d.ts +0 -13
  52. package/dist/client/models/components/MapComponent.d.ts +0 -10
  53. package/dist/client/models/components/index.d.ts +0 -13
  54. /package/dist/{client → client-v2}/models/MapComponent.d.ts +0 -0
  55. /package/dist/{client → client-v2}/models/components/AMap/Block.d.ts +0 -0
  56. /package/dist/{client → client-v2}/models/components/AMap/Search.d.ts +0 -0
  57. /package/dist/{client → client-v2}/models/components/AMap/index.d.ts +0 -0
  58. /package/dist/{client → client-v2}/models/components/GoogleMaps/Block.d.ts +0 -0
  59. /package/dist/{client → client-v2}/models/components/GoogleMaps/Search.d.ts +0 -0
  60. /package/dist/{client → client-v2}/models/components/GoogleMaps/index.d.ts +0 -0
  61. /package/dist/{client → client-v2}/models/components/GoogleMaps/utils.d.ts +0 -0
  62. /package/dist/{client → client-v2}/models/fieldModels/CircleFieldModel.d.ts +0 -0
  63. /package/dist/{client → client-v2}/models/fieldModels/DisplayCircleFieldModel.d.ts +0 -0
  64. /package/dist/{client → client-v2}/models/fieldModels/DisplayLineStringFieldModel.d.ts +0 -0
  65. /package/dist/{client → client-v2}/models/fieldModels/DisplayPointFieldModel.d.ts +0 -0
  66. /package/dist/{client → client-v2}/models/fieldModels/DisplayPolygonFieldModel.d.ts +0 -0
  67. /package/dist/{client → client-v2}/models/fieldModels/LineStringFieldModel.d.ts +0 -0
  68. /package/dist/{client → client-v2}/models/fieldModels/PointFieldModel.d.ts +0 -0
  69. /package/dist/{client → client-v2}/models/fieldModels/PolygonFieldModel.d.ts +0 -0
  70. /package/dist/{client → client-v2}/models/fieldModels/index.d.ts +0 -0
  71. /package/dist/{client → client-v2}/models/fieldModels/setDefaultZoomLevel.d.ts +0 -0
@@ -0,0 +1,10 @@
1
+ /**
2
+ * This file is part of the NocoBase (R) project.
3
+ * Copyright (c) 2020-2024 NocoBase Co., Ltd.
4
+ * Authors: NocoBase Team.
5
+ *
6
+ * This project is dual-licensed under AGPL-3.0 and NocoBase Commercial License.
7
+ * For more information, please refer to: https://www.nocobase.com/agreement.
8
+ */
9
+
10
+ !function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t(require("ahooks"),require("@emotion/css"),require("@nocobase/client-v2"),require("antd"),require("react"),require("@ant-design/icons"),require("@nocobase/flow-engine")):"function"==typeof define&&define.amd?define("@nocobase/plugin-map/client-v2",["ahooks","@emotion/css","@nocobase/client-v2","antd","react","@ant-design/icons","@nocobase/flow-engine"],t):"object"==typeof exports?exports["@nocobase/plugin-map/client-v2"]=t(require("ahooks"),require("@emotion/css"),require("@nocobase/client-v2"),require("antd"),require("react"),require("@ant-design/icons"),require("@nocobase/flow-engine")):e["@nocobase/plugin-map/client-v2"]=t(e.ahooks,e["@emotion/css"],e["@nocobase/client-v2"],e.antd,e.react,e["@ant-design/icons"],e["@nocobase/flow-engine"])}(self,function(e,t,n,r,o,i,c){return function(){"use strict";var u,a,l,f={488:function(e,t,n){n.d(t,{MZ:function(){return c},kj:function(){return u}});var r=n(694);function o(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter(function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable}))),r.forEach(function(t){var r;r=n[t],t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r})}return e}var i="@nocobase/plugin-map";function c(e,t){return(0,r.tExpr)(e,o({ns:[i,"client"]},t))}function u(){var e=(0,r.useFlowEngine)();return function(t,n){return e.context.t(t,o({ns:[i,"client"]},n))}}},375:function(e){e.exports=i},477:function(e){e.exports=t},485:function(e){e.exports=n},694:function(e){e.exports=c},625:function(t){t.exports=e},59:function(e){e.exports=r},155:function(e){e.exports=o}},p={};function s(e){var t=p[e];if(void 0!==t)return t.exports;var n=p[e]={exports:{}};return f[e].call(n.exports,n,n.exports,s),n.exports}s.m=f,s.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return s.d(t,{a:t}),t},s.d=function(e,t){for(var n in t)s.o(t,n)&&!s.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},s.f={},s.e=function(e){return Promise.all(Object.keys(s.f).reduce(function(t,n){return s.f[n](e,t),t},[]))},s.u=function(e){return""+e+"."+({577:"e1fcc82fab0ef39b",641:"ef67f0b66b92ff21",694:"5f486a695fdeb42a",720:"6ede563c5d95f038",872:"53cbb217b7708463"})[e]+".js"},s.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||Function("return this")()}catch(e){if("object"==typeof window)return window}}(),s.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},b={},s.l=function(e,t,n,r){if(b[e])return void b[e].push(t);if(void 0!==n)for(var o,i,c=document.getElementsByTagName("script"),u=0;u<c.length;u++){var a=c[u];if(a.getAttribute("src")==e||a.getAttribute("data-rspack")=="@nocobase/plugin-map/client-v2:"+n){o=a;break}}o||(i=!0,(o=document.createElement("script")).timeout=120,s.nc&&o.setAttribute("nonce",s.nc),o.setAttribute("data-rspack","@nocobase/plugin-map/client-v2:"+n),o.src=e),b[e]=[t];var l=function(t,n){o.onerror=o.onload=null,clearTimeout(f);var r=b[e];if(delete b[e],o.parentNode&&o.parentNode.removeChild(o),r&&r.forEach(function(e){return e(n)}),t)return t(n)},f=setTimeout(l.bind(null,void 0,{type:"timeout",target:o}),12e4);o.onerror=l.bind(null,o.onerror),o.onload=l.bind(null,o.onload),i&&document.head.appendChild(o)},s.r=function(e){"u">typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},s.g.importScripts&&(y=s.g.location+"");var b,y,d=s.g.document;if(!y&&d&&(d.currentScript&&"SCRIPT"===d.currentScript.tagName.toUpperCase()&&(y=d.currentScript.src),!y)){var h=d.getElementsByTagName("script");if(h.length)for(var v=h.length-1;v>-1&&(!y||!/^http(s?):/.test(y));)y=h[v--].src}if(!y)throw Error("Automatic publicPath is not supported in this browser");s.p=y.replace(/^blob:/,"").replace(/#.*$/,"").replace(/\?.*$/,"").replace(/\/[^\/]+$/,"/"),u={889:0},s.f.j=function(e,t){var n=s.o(u,e)?u[e]:void 0;if(0!==n)if(n)t.push(n[2]);else{var r=new Promise(function(t,r){n=u[e]=[t,r]});t.push(n[2]=r);var o=s.p+s.u(e),i=Error();s.l(o,function(t){if(s.o(u,e)&&(0!==(n=u[e])&&(u[e]=void 0),n)){var r=t&&("load"===t.type?"missing":t.type),o=t&&t.target&&t.target.src;i.message="Loading chunk "+e+" failed.\n("+r+": "+o+")",i.name="ChunkLoadError",i.type=r,i.request=o,n[1](i)}},"chunk-"+e,e)}},a=function(e,t){var n,r,o=t[0],i=t[1],c=t[2],a=0;if(o.some(function(e){return 0!==u[e]})){for(n in i)s.o(i,n)&&(s.m[n]=i[n]);c&&c(s)}for(e&&e(t);a<o.length;a++)r=o[a],s.o(u,r)&&u[r]&&u[r][0](),u[r]=0},(l=self.webpackChunk_nocobase_plugin_map_client_v2=self.webpackChunk_nocobase_plugin_map_client_v2||[]).forEach(a.bind(null,0)),l.push=a.bind(null,l.push.bind(l));var m={};return!function(){var e="",t="u">typeof document?document.currentScript:null;if(t&&t.src&&(e=t.src.replace(/^blob:/,"").replace(/#.*$/,"").replace(/\?.*$/,"").replace(/\/[^\/]+$/,"/")),!e){var n=window.__webpack_public_path__||"";n&&("/"!==n.charAt(n.length-1)&&(n+="/"),e=n+"static/plugins/@nocobase/plugin-map/dist/client-v2/")}if(!e){var r=window.__nocobase_modern_client_prefix__||"v",o="/"+(r=String(r).replace(/^\/+|\/+$/g,"")||"v")+"/";if(!(e=window.__nocobase_public_path__||"")&&window.location&&window.location.pathname){var i=window.location.pathname||"/",c=i.indexOf(o);e=c>=0?i.slice(0,c+1):"/"}e&&(e=e.replace(RegExp("/"+r+"/?$"),"/")),e||(e="/"),"/"!==e.charAt(e.length-1)&&(e+="/"),e+="static/plugins/@nocobase/plugin-map/dist/client-v2/"}s.p=e}(),!function(){s.r(m),s.d(m,{default:function(){return D}});var e=s(485),t=s(488),n=[{label:(0,t.MZ)("AMap"),value:"amap"},{label:(0,t.MZ)("Google Maps"),value:"google"}];function r(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function o(e){return(o=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function i(e,t){return(i=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function c(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(e){}return(c=function(){return!!e})()}var u=function(e){var u;if("function"!=typeof e&&null!==e)throw TypeError("Super expression must either be null or a function");function a(){var e,i,u;if(!(this instanceof a))throw TypeError("Cannot call a class as a function");return i=a,u=arguments,i=o(i),r(e=function(e,t){var n;if(t&&("object"==((n=t)&&"u">typeof Symbol&&n.constructor===Symbol?"symbol":typeof n)||"function"==typeof t))return t;if(void 0===e)throw ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(this,c()?Reflect.construct(i,u||[],o(this).constructor):i.apply(this,u)),"type","object"),r(e,"group","map"),r(e,"sortable",!0),r(e,"titleUsable",!1),r(e,"availableTypes",["json"]),r(e,"configure",{items:[{name:"uiSchema.x-component-props.mapType",title:(0,t.MZ)("Map type"),component:"Select",required:!0,disabled:function(e){return!e.context.createOnly},defaultValue:"amap",componentProps:{showSearch:!1,allowClear:!1},options:n}]}),e}return a.prototype=Object.create(e&&e.prototype,{constructor:{value:a,writable:!0,configurable:!0}}),e&&i(a,e),u=[{key:"createDefault",value:function(e){return{interface:e,type:e,uiSchema:{type:"void","x-component":"Map","x-component-designer":"Map.Designer","x-component-props":{}}}}}],function(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}(a.prototype,u),a}(e.CollectionFieldInterface);function a(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function l(e){return(l=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function f(e,t){return(f=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function p(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(e){}return(p=function(){return!!e})()}var b=function(e){if("function"!=typeof e&&null!==e)throw TypeError("Super expression must either be null or a function");function n(){var e,r,o;if(!(this instanceof n))throw TypeError("Cannot call a class as a function");return r=n,o=arguments,r=l(r),a(e=function(e,t){var n;if(t&&("object"==((n=t)&&"u">typeof Symbol&&n.constructor===Symbol?"symbol":typeof n)||"function"==typeof t))return t;if(void 0===e)throw ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(this,p()?Reflect.construct(r,o||[],l(this).constructor):r.apply(this,o)),"name","circle"),a(e,"order",3),a(e,"title",(0,t.MZ)("Circle")),a(e,"description",(0,t.MZ)("Circle")),a(e,"availableTypes",["circle","json"]),a(e,"default",e.createDefault("circle")),e}return n.prototype=Object.create(e&&e.prototype,{constructor:{value:n,writable:!0,configurable:!0}}),e&&f(n,e),n}(u);function y(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function d(e){return(d=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function h(e,t){return(h=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function v(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(e){}return(v=function(){return!!e})()}var g=function(e){if("function"!=typeof e&&null!==e)throw TypeError("Super expression must either be null or a function");function n(){var e,r,o;if(!(this instanceof n))throw TypeError("Cannot call a class as a function");return r=n,o=arguments,r=d(r),y(e=function(e,t){var n;if(t&&("object"==((n=t)&&"u">typeof Symbol&&n.constructor===Symbol?"symbol":typeof n)||"function"==typeof t))return t;if(void 0===e)throw ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(this,v()?Reflect.construct(r,o||[],d(this).constructor):r.apply(this,o)),"name","lineString"),y(e,"order",2),y(e,"title",(0,t.MZ)("Line")),y(e,"description",(0,t.MZ)("Line")),y(e,"availableTypes",["lineString","json"]),y(e,"default",e.createDefault("lineString")),e}return n.prototype=Object.create(e&&e.prototype,{constructor:{value:n,writable:!0,configurable:!0}}),e&&h(n,e),n}(u);function O(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function w(e){return(w=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function _(e,t){return(_=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function j(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(e){}return(j=function(){return!!e})()}function P(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function S(e){return(S=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function x(e,t){return(x=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function M(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(e){}return(M=function(){return!!e})()}var E=[function(e){if("function"!=typeof e&&null!==e)throw TypeError("Super expression must either be null or a function");function n(){var e,r,o;if(!(this instanceof n))throw TypeError("Cannot call a class as a function");return r=n,o=arguments,r=w(r),O(e=function(e,t){var n;if(t&&("object"==((n=t)&&"u">typeof Symbol&&n.constructor===Symbol?"symbol":typeof n)||"function"==typeof t))return t;if(void 0===e)throw ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(this,j()?Reflect.construct(r,o||[],w(this).constructor):r.apply(this,o)),"name","point"),O(e,"order",1),O(e,"title",(0,t.MZ)("Point")),O(e,"description",(0,t.MZ)("Point")),O(e,"availableTypes",["point","json"]),O(e,"default",e.createDefault("point")),e}return n.prototype=Object.create(e&&e.prototype,{constructor:{value:n,writable:!0,configurable:!0}}),e&&_(n,e),n}(u),g,b,function(e){if("function"!=typeof e&&null!==e)throw TypeError("Super expression must either be null or a function");function n(){var e,r,o;if(!(this instanceof n))throw TypeError("Cannot call a class as a function");return r=n,o=arguments,r=S(r),P(e=function(e,t){var n;if(t&&("object"==((n=t)&&"u">typeof Symbol&&n.constructor===Symbol?"symbol":typeof n)||"function"==typeof t))return t;if(void 0===e)throw ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(this,M()?Reflect.construct(r,o||[],S(this).constructor):r.apply(this,o)),"name","polygon"),P(e,"order",4),P(e,"title",(0,t.MZ)("Polygon")),P(e,"description",(0,t.MZ)("Polygon")),P(e,"availableTypes",["polygon","json"]),P(e,"default",e.createDefault("polygon")),e}return n.prototype=Object.create(e&&e.prototype,{constructor:{value:n,writable:!0,configurable:!0}}),e&&x(n,e),n}(u)];function k(e,t,n,r,o,i,c){try{var u=e[i](c),a=u.value}catch(e){n(e);return}u.done?t(a):Promise.resolve(a).then(r,o)}var T=(0,s(694).defineAction)({name:"setDefaultZoomLevel",title:(0,t.MZ)("Set default zoom level"),uiSchema:function(e){return"text"===e.model.props.displayStyle?null:{zoom:{title:(0,t.MZ)("Zoom"),"x-component":"NumberPicker","x-decorator":"FormItem","x-component-props":{precision:0}}}},defaultParams:{zoom:13},handler:function(e,t){var n;return(n=function(){return function(e,t){var n,r,o,i={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]},c=Object.create(("function"==typeof Iterator?Iterator:Object).prototype),u=Object.defineProperty;return u(c,"next",{value:a(0)}),u(c,"throw",{value:a(1)}),u(c,"return",{value:a(2)}),"function"==typeof Symbol&&u(c,Symbol.iterator,{value:function(){return this}}),c;function a(u){return function(a){var l=[u,a];if(n)throw TypeError("Generator is already executing.");for(;c&&(c=0,l[0]&&(i=0)),i;)try{if(n=1,r&&(o=2&l[0]?r.return:l[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,l[1])).done)return o;switch(r=0,o&&(l=[2&l[0],o.value]),l[0]){case 0:case 1:o=l;break;case 4:return i.label++,{value:l[1],done:!1};case 5:i.label++,r=l[1],l=[0];continue;case 7:l=i.ops.pop(),i.trys.pop();continue;default:if(!(o=(o=i.trys).length>0&&o[o.length-1])&&(6===l[0]||2===l[0])){i=0;continue}if(3===l[0]&&(!o||l[1]>o[0]&&l[1]<o[3])){i.label=l[1];break}if(6===l[0]&&i.label<o[1]){i.label=o[1],o=l;break}if(o&&i.label<o[2]){i.label=o[2],i.ops.push(l);break}o[2]&&i.ops.pop(),i.trys.pop();continue}l=t.call(e,i)}catch(e){l=[6,e],r=0}finally{n=o=0}if(5&l[0])throw l[1];return{value:l[0]?l[1]:void 0,done:!0}}}}(this,function(n){return e.model.setProps("zoom",t.zoom),[2]})},function(){var e=this,t=arguments;return new Promise(function(r,o){var i=n.apply(e,t);function c(e){k(i,r,o,c,u,"next",e)}function u(e){k(i,r,o,c,u,"throw",e)}c(void 0)})})()}});function R(e,t,n,r,o,i,c){try{var u=e[i](c),a=u.value}catch(e){n(e);return}u.done?t(a):Promise.resolve(a).then(r,o)}function C(e,t,n){return(C=B()?Reflect.construct:function(e,t,n){var r=[null];r.push.apply(r,t);var o=new(Function.bind.apply(e,r));return n&&F(o,n.prototype),o}).apply(null,arguments)}function Z(e){return(Z=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function F(e,t){return(F=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function q(e){var t="function"==typeof Map?new Map:void 0;return(q=function(e){if(null===e||-1===Function.toString.call(e).indexOf("[native code]"))return e;if("function"!=typeof e)throw TypeError("Super expression must either be null or a function");if(void 0!==t){if(t.has(e))return t.get(e);t.set(e,n)}function n(){return C(e,arguments,Z(this).constructor)}return n.prototype=Object.create(e.prototype,{constructor:{value:n,enumerable:!1,writable:!0,configurable:!0}}),F(n,e)})(e)}function B(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(e){}return(B=function(){return!!e})()}var D=function(e){var n;if("function"!=typeof e&&null!==e)throw TypeError("Super expression must either be null or a function");function r(){var e,t;if(!(this instanceof r))throw TypeError("Cannot call a class as a function");return e=r,t=arguments,e=Z(e),function(e,t){var n;if(t&&("object"==((n=t)&&"u">typeof Symbol&&n.constructor===Symbol?"symbol":typeof n)||"function"==typeof t))return t;if(void 0===e)throw ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(this,B()?Reflect.construct(e,t||[],Z(this).constructor):e.apply(this,t))}return r.prototype=Object.create(e&&e.prototype,{constructor:{value:r,writable:!0,configurable:!0}}),e&&F(r,e),n=[{key:"load",value:function(){var e;return(e=function(){return function(e,t){var n,r,o,i={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]},c=Object.create(("function"==typeof Iterator?Iterator:Object).prototype),u=Object.defineProperty;return u(c,"next",{value:a(0)}),u(c,"throw",{value:a(1)}),u(c,"return",{value:a(2)}),"function"==typeof Symbol&&u(c,Symbol.iterator,{value:function(){return this}}),c;function a(u){return function(a){var l=[u,a];if(n)throw TypeError("Generator is already executing.");for(;c&&(c=0,l[0]&&(i=0)),i;)try{if(n=1,r&&(o=2&l[0]?r.return:l[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,l[1])).done)return o;switch(r=0,o&&(l=[2&l[0],o.value]),l[0]){case 0:case 1:o=l;break;case 4:return i.label++,{value:l[1],done:!1};case 5:i.label++,r=l[1],l=[0];continue;case 7:l=i.ops.pop(),i.trys.pop();continue;default:if(!(o=(o=i.trys).length>0&&o[o.length-1])&&(6===l[0]||2===l[0])){i=0;continue}if(3===l[0]&&(!o||l[1]>o[0]&&l[1]<o[3])){i.label=l[1];break}if(6===l[0]&&i.label<o[1]){i.label=o[1],o=l;break}if(o&&i.label<o[2]){i.label=o[2],i.ops.push(l);break}o[2]&&i.ops.pop(),i.trys.pop();continue}l=t.call(e,i)}catch(e){l=[6,e],r=0}finally{n=o=0}if(5&l[0])throw l[1];return{value:l[0]?l[1]:void 0,done:!0}}}}(this,function(e){return this.app.addFieldInterfaces(E),this.app.addFieldInterfaceGroups({map:{label:(0,t.MZ)("Map-based geometry"),order:300}}),this.pluginSettingsManager.addMenuItem({key:"map",title:this.t("Map manager"),icon:"EnvironmentOutlined",aclSnippet:"pm.map.configuration"}),this.pluginSettingsManager.addPageTabItem({menuKey:"map",key:"index",title:this.t("Map manager"),componentLoader:function(){return s.e("872").then(s.bind(s,75))}}),this.flowEngine.registerActions({setDefaultZoomLevel:T}),this.flowEngine.registerModelLoaders({CircleFieldModel:{loader:function(){return Promise.all([s.e("641"),s.e("577")]).then(s.bind(s,128))}},DisplayCircleFieldModel:{loader:function(){return Promise.all([s.e("641"),s.e("577")]).then(s.bind(s,128))}},DisplayLineStringFieldModel:{loader:function(){return Promise.all([s.e("641"),s.e("577")]).then(s.bind(s,128))}},DisplayPointFieldModel:{loader:function(){return Promise.all([s.e("641"),s.e("577")]).then(s.bind(s,128))}},DisplayPolygonFieldModel:{loader:function(){return Promise.all([s.e("641"),s.e("577")]).then(s.bind(s,128))}},LineStringFieldModel:{loader:function(){return Promise.all([s.e("641"),s.e("577")]).then(s.bind(s,128))}},MapActionGroupModel:{loader:function(){return s.e("694").then(s.bind(s,709))}},MapBlockModel:{loader:function(){return Promise.all([s.e("641"),s.e("720")]).then(s.bind(s,883))}},MapFieldModel:{loader:function(){return Promise.all([s.e("641"),s.e("577")]).then(s.bind(s,128))}},PointFieldModel:{loader:function(){return Promise.all([s.e("641"),s.e("577")]).then(s.bind(s,128))}},PolygonFieldModel:{loader:function(){return Promise.all([s.e("641"),s.e("577")]).then(s.bind(s,128))}}}),[2]})},function(){var t=this,n=arguments;return new Promise(function(r,o){var i=e.apply(t,n);function c(e){R(i,r,o,c,u,"next",e)}function u(e){R(i,r,o,c,u,"throw",e)}c(void 0)})}).call(this)}}],function(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}(r.prototype,n),r}(q(e.Plugin))}(),m}()});
@@ -0,0 +1,11 @@
1
+ /**
2
+ * This file is part of the NocoBase (R) project.
3
+ * Copyright (c) 2020-2024 NocoBase Co., Ltd.
4
+ * Authors: NocoBase Team.
5
+ *
6
+ * This project is dual-licensed under AGPL-3.0 and NocoBase Commercial License.
7
+ * For more information, please refer to: https://www.nocobase.com/agreement.
8
+ */
9
+ export declare const NAMESPACE = "@nocobase/plugin-map";
10
+ export declare function tExpr(key: string, options?: Record<string, any>): string;
11
+ export declare function useT(): (key: string, options?: Record<string, any>) => string;
@@ -0,0 +1,14 @@
1
+ /**
2
+ * This file is part of the NocoBase (R) project.
3
+ * Copyright (c) 2020-2024 NocoBase Co., Ltd.
4
+ * Authors: NocoBase Team.
5
+ *
6
+ * This project is dual-licensed under AGPL-3.0 and NocoBase Commercial License.
7
+ * For more information, please refer to: https://www.nocobase.com/agreement.
8
+ */
9
+ import { ActionGroupModel } from '@nocobase/client-v2';
10
+ import { type FlowModelContext } from '@nocobase/flow-engine';
11
+ export declare const ALLOWED_MAP_ACTION_MODELS: string[];
12
+ export declare class MapActionGroupModel extends ActionGroupModel {
13
+ static defineChildren(ctx: FlowModelContext): Promise<any[]>;
14
+ }
@@ -0,0 +1,12 @@
1
+ /**
2
+ * This file is part of the NocoBase (R) project.
3
+ * Copyright (c) 2020-2024 NocoBase Co., Ltd.
4
+ * Authors: NocoBase Team.
5
+ *
6
+ * This project is dual-licensed under AGPL-3.0 and NocoBase Commercial License.
7
+ * For more information, please refer to: https://www.nocobase.com/agreement.
8
+ */
9
+ import React from 'react';
10
+ export declare const getMapFieldComponentProps: (collectionField: any) => any;
11
+ export declare const getMapFieldMapType: (collectionField: any) => any;
12
+ export declare const MapBlockComponent: React.FC<any>;
@@ -7,10 +7,22 @@
7
7
  * For more information, please refer to: https://www.nocobase.com/agreement.
8
8
  */
9
9
  import { MultiRecordResource } from '@nocobase/flow-engine';
10
- import { CollectionBlockModel } from '@nocobase/client';
10
+ import { CollectionBlockModel } from '@nocobase/client-v2';
11
11
  import React from 'react';
12
+ export declare const MAP_GEOMETRY_FIELD_TYPES: string[];
13
+ export declare const normalizeMapFieldPath: (mapField?: string[] | string) => string[];
14
+ export declare const applyMapBlockFieldParams: (model: {
15
+ setProps: (key: string, value: any) => void;
16
+ }, params: any) => void;
17
+ export declare const getMapBlockRuntimeProps: (model: MapBlockModel) => {
18
+ mapField: string[];
19
+ marker: any;
20
+ mapFieldCollectionField: import("@nocobase/flow-engine").CollectionField;
21
+ markerFieldCollectionField: import("@nocobase/flow-engine").CollectionField;
22
+ associationCollectionField: import("@nocobase/flow-engine").CollectionField;
23
+ };
12
24
  export declare class MapBlockModel extends CollectionBlockModel {
13
- static scene: import("@nocobase/client").BlockSceneType;
25
+ static scene: import("@nocobase/client-v2").BlockSceneType;
14
26
  selectedRecordKeys: any[];
15
27
  get resource(): MultiRecordResource<any>;
16
28
  onInit(options: any): void;
@@ -8,7 +8,7 @@
8
8
  */
9
9
  import '@amap/amap-jsapi-types';
10
10
  import React from 'react';
11
- import { MapEditorType } from '../../../types';
11
+ import { MapEditorType } from '../../../../shared/types';
12
12
  export interface AMapComponentProps {
13
13
  value?: any;
14
14
  onChange?: (value: number[]) => void;
@@ -8,9 +8,46 @@
8
8
  */
9
9
  /// <reference types="google.maps" />
10
10
  import React from 'react';
11
- import { MapEditorType } from '../../../types';
11
+ import { MapEditorType } from '../../../../shared/types';
12
12
  export type OverlayOptions = google.maps.PolygonOptions & google.maps.MarkerOptions & google.maps.PolylineOptions;
13
+ type GoogleMapsOverlay = google.maps.Marker | google.maps.Polygon | google.maps.Polyline | google.maps.Circle;
14
+ export type GoogleMapsDrawingMode = 'marker' | 'polygon' | 'polyline' | 'circle' | null;
15
+ type GoogleMapsOverlayCompleteEvent = {
16
+ type: Exclude<GoogleMapsDrawingMode, null>;
17
+ overlay: GoogleMapsOverlay;
18
+ };
19
+ type OverlayCompleteListener = (event: GoogleMapsOverlayCompleteEvent) => void;
13
20
  export declare const getDrawingMode: (type: MapEditorType) => "polygon" | "circle" | "marker" | "polyline";
21
+ export declare class GoogleMapsDrawingManager {
22
+ private readonly listeners;
23
+ private readonly mapListeners;
24
+ private readonly options;
25
+ private drawingMode;
26
+ private draftOverlay;
27
+ private draftPath;
28
+ private circleCenter;
29
+ constructor(options: OverlayOptions & {
30
+ drawingMode?: GoogleMapsDrawingMode;
31
+ map?: google.maps.Map;
32
+ });
33
+ addListener(eventName: 'overlaycomplete', listener: OverlayCompleteListener): {
34
+ remove: () => void;
35
+ };
36
+ setDrawingMode(mode: GoogleMapsDrawingMode): void;
37
+ unbindAll(): void;
38
+ private bindMapEvents;
39
+ private clearMapEvents;
40
+ private resetDraft;
41
+ private handleClick;
42
+ private handlePathClick;
43
+ private handleCircleClick;
44
+ private updatePreview;
45
+ private updatePath;
46
+ private updateCircle;
47
+ private completePathOverlay;
48
+ private completeCircleOverlay;
49
+ private emitComplete;
50
+ }
14
51
  export interface GoogleMapsCompProps {
15
52
  value?: any;
16
53
  onChange?: (value: number[]) => void;
@@ -31,10 +68,11 @@ export interface GoogleMapForwardedRefProps {
31
68
  setOverlay: (t: MapEditorType, v: any, o?: OverlayOptions) => google.maps.MVCObject;
32
69
  getOverlay: (t: MapEditorType, v: any, o?: OverlayOptions) => google.maps.MVCObject;
33
70
  setFitView: (overlays: google.maps.MVCObject[]) => void;
34
- createDraw: (onlyCreate?: boolean, additionalOptions?: OverlayOptions) => any;
71
+ createDraw: (onlyCreate?: boolean, additionalOptions?: OverlayOptions) => GoogleMapsDrawingManager;
35
72
  map: google.maps.Map;
36
73
  overlay: google.maps.MVCObject;
37
- drawingManager: google.maps.drawing.DrawingManager;
74
+ drawingManager: GoogleMapsDrawingManager;
38
75
  errMessage?: string;
39
76
  }
40
77
  export declare const GoogleMapsCom: React.ForwardRefExoticComponent<GoogleMapsCompProps & React.RefAttributes<GoogleMapForwardedRefProps>>;
78
+ export {};
@@ -7,9 +7,12 @@
7
7
  * For more information, please refer to: https://www.nocobase.com/agreement.
8
8
  */
9
9
  import React from 'react';
10
- import { DisplayTitleFieldModel } from '@nocobase/client';
10
+ import { DisplayTitleFieldModel } from '@nocobase/client-v2';
11
+ export declare const formatMapDisplayValue: (value: any) => any;
11
12
  export declare const PointReadPretty: (props: any) => any;
12
13
  export declare class DisplayMapFieldModel extends DisplayTitleFieldModel {
13
14
  getMapFieldType(): any;
15
+ render(): any;
16
+ renderInDisplayStyle(): React.JSX.Element;
14
17
  renderComponent(value: any): React.JSX.Element;
15
18
  }
@@ -1,4 +1,4 @@
1
- import { FieldModel } from '@nocobase/client';
1
+ import { FieldModel } from '@nocobase/client-v2';
2
2
  import React from 'react';
3
3
  export declare class MapFieldModel extends FieldModel {
4
4
  getMapFieldType(): any;
@@ -7,4 +7,5 @@
7
7
  * For more information, please refer to: https://www.nocobase.com/agreement.
8
8
  */
9
9
  import React from 'react';
10
- export declare const Configuration: () => React.JSX.Element;
10
+ declare const Configuration: () => React.JSX.Element;
11
+ export default Configuration;
@@ -0,0 +1,13 @@
1
+ /**
2
+ * This file is part of the NocoBase (R) project.
3
+ * Copyright (c) 2020-2024 NocoBase Co., Ltd.
4
+ * Authors: NocoBase Team.
5
+ *
6
+ * This project is dual-licensed under AGPL-3.0 and NocoBase Commercial License.
7
+ * For more information, please refer to: https://www.nocobase.com/agreement.
8
+ */
9
+ import { Plugin } from '@nocobase/client-v2';
10
+ export declare class PluginMapClient extends Plugin {
11
+ load(): Promise<void>;
12
+ }
13
+ export default PluginMapClient;
@@ -8,12 +8,14 @@
8
8
  */
9
9
 
10
10
  module.exports = {
11
- "@nocobase/client": "2.1.0-beta.9",
11
+ "@nocobase/client": "2.2.0-beta.1",
12
12
  "react": "18.2.0",
13
- "@nocobase/server": "2.1.0-beta.9",
14
- "@nocobase/test": "2.1.0-beta.9",
13
+ "@nocobase/flow-engine": "2.2.0-beta.1",
14
+ "@nocobase/client-v2": "2.2.0-beta.1",
15
+ "@nocobase/server": "2.2.0-beta.1",
16
+ "@nocobase/test": "2.2.0-beta.1",
15
17
  "@formily/react": "2.3.7",
16
- "lodash": "4.17.21",
18
+ "lodash": "4.18.1",
17
19
  "react-i18next": "11.18.6",
18
20
  "@ant-design/icons": "5.6.1",
19
21
  "@formily/antd-v5": "1.2.3",
@@ -21,9 +23,7 @@ module.exports = {
21
23
  "antd": "5.24.2",
22
24
  "@formily/shared": "2.3.7",
23
25
  "@formily/core": "2.3.7",
24
- "@nocobase/flow-engine": "2.1.0-beta.9",
25
- "@nocobase/plugin-action-bulk-update": "2.1.0-beta.9",
26
- "@nocobase/actions": "2.1.0-beta.9",
27
- "@nocobase/database": "2.1.0-beta.9",
26
+ "@nocobase/actions": "2.2.0-beta.1",
27
+ "@nocobase/database": "2.2.0-beta.1",
28
28
  "ahooks": "3.7.8"
29
29
  };
@@ -37,6 +37,7 @@ var mapConfiguration_default = (0, import_database.defineCollection)({
37
37
  },
38
38
  migrationRules: ["overwrite", "schema-only"],
39
39
  name: import_constants.MapConfigurationCollectionName,
40
+ dataCategory: "system",
40
41
  shared: true,
41
42
  fields: [
42
43
  {
@@ -6,6 +6,5 @@
6
6
  * This project is dual-licensed under AGPL-3.0 and NocoBase Commercial License.
7
7
  * For more information, please refer to: https://www.nocobase.com/agreement.
8
8
  */
9
- import { ActionGroupModel } from '@nocobase/client';
10
- export declare class MapActionGroupModel extends ActionGroupModel {
11
- }
9
+ export declare const MapConfigurationResourceKey = "map-configuration";
10
+ export declare const getSSKey: (type: string) => string;
@@ -0,0 +1,39 @@
1
+ /**
2
+ * This file is part of the NocoBase (R) project.
3
+ * Copyright (c) 2020-2024 NocoBase Co., Ltd.
4
+ * Authors: NocoBase Team.
5
+ *
6
+ * This project is dual-licensed under AGPL-3.0 and NocoBase Commercial License.
7
+ * For more information, please refer to: https://www.nocobase.com/agreement.
8
+ */
9
+
10
+ var __defProp = Object.defineProperty;
11
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
12
+ var __getOwnPropNames = Object.getOwnPropertyNames;
13
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
14
+ var __export = (target, all) => {
15
+ for (var name in all)
16
+ __defProp(target, name, { get: all[name], enumerable: true });
17
+ };
18
+ var __copyProps = (to, from, except, desc) => {
19
+ if (from && typeof from === "object" || typeof from === "function") {
20
+ for (let key of __getOwnPropNames(from))
21
+ if (!__hasOwnProp.call(to, key) && key !== except)
22
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
23
+ }
24
+ return to;
25
+ };
26
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
27
+ var configuration_exports = {};
28
+ __export(configuration_exports, {
29
+ MapConfigurationResourceKey: () => MapConfigurationResourceKey,
30
+ getSSKey: () => getSSKey
31
+ });
32
+ module.exports = __toCommonJS(configuration_exports);
33
+ const MapConfigurationResourceKey = "map-configuration";
34
+ const getSSKey = (type) => `NOCOBASE_PLUGIN_MAP_CONFIGURATION_${type}`;
35
+ // Annotate the CommonJS export names for ESM import in node:
36
+ 0 && (module.exports = {
37
+ MapConfigurationResourceKey,
38
+ getSSKey
39
+ });
@@ -0,0 +1,10 @@
1
+ /**
2
+ * This file is part of the NocoBase (R) project.
3
+ * Copyright (c) 2020-2024 NocoBase Co., Ltd.
4
+ * Authors: NocoBase Team.
5
+ *
6
+ * This project is dual-licensed under AGPL-3.0 and NocoBase Commercial License.
7
+ * For more information, please refer to: https://www.nocobase.com/agreement.
8
+ */
9
+ export declare const selectedImage: string;
10
+ export declare const defaultImage: string;
@@ -0,0 +1,43 @@
1
+ /**
2
+ * This file is part of the NocoBase (R) project.
3
+ * Copyright (c) 2020-2024 NocoBase Co., Ltd.
4
+ * Authors: NocoBase Team.
5
+ *
6
+ * This project is dual-licensed under AGPL-3.0 and NocoBase Commercial License.
7
+ * For more information, please refer to: https://www.nocobase.com/agreement.
8
+ */
9
+
10
+ var __defProp = Object.defineProperty;
11
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
12
+ var __getOwnPropNames = Object.getOwnPropertyNames;
13
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
14
+ var __export = (target, all) => {
15
+ for (var name in all)
16
+ __defProp(target, name, { get: all[name], enumerable: true });
17
+ };
18
+ var __copyProps = (to, from, except, desc) => {
19
+ if (from && typeof from === "object" || typeof from === "function") {
20
+ for (let key of __getOwnPropNames(from))
21
+ if (!__hasOwnProp.call(to, key) && key !== except)
22
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
23
+ }
24
+ return to;
25
+ };
26
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
27
+ var constants_exports = {};
28
+ __export(constants_exports, {
29
+ defaultImage: () => defaultImage,
30
+ selectedImage: () => selectedImage
31
+ });
32
+ module.exports = __toCommonJS(constants_exports);
33
+ var import_theme = require("./theme");
34
+ const markerSvg = (color) => `data:image/svg+xml;utf8,${encodeURIComponent(
35
+ `<svg xmlns="http://www.w3.org/2000/svg" width="38" height="63" viewBox="0 0 38 63"><path fill="${color}" d="M19 0C8.5 0 0 8.5 0 19c0 14.2 19 44 19 44s19-29.8 19-44C38 8.5 29.5 0 19 0Z"/><circle fill="white" cx="19" cy="19" r="8"/></svg>`
36
+ )}`;
37
+ const selectedImage = markerSvg(import_theme.mapSelectedColor);
38
+ const defaultImage = markerSvg(import_theme.mapActiveColor);
39
+ // Annotate the CommonJS export names for ESM import in node:
40
+ 0 && (module.exports = {
41
+ defaultImage,
42
+ selectedImage
43
+ });
@@ -0,0 +1,10 @@
1
+ /**
2
+ * This file is part of the NocoBase (R) project.
3
+ * Copyright (c) 2020-2024 NocoBase Co., Ltd.
4
+ * Authors: NocoBase Team.
5
+ *
6
+ * This project is dual-licensed under AGPL-3.0 and NocoBase Commercial License.
7
+ * For more information, please refer to: https://www.nocobase.com/agreement.
8
+ */
9
+ export declare const mapActiveColor = "#4e9bff";
10
+ export declare const mapSelectedColor = "#F18b62";
@@ -0,0 +1,39 @@
1
+ /**
2
+ * This file is part of the NocoBase (R) project.
3
+ * Copyright (c) 2020-2024 NocoBase Co., Ltd.
4
+ * Authors: NocoBase Team.
5
+ *
6
+ * This project is dual-licensed under AGPL-3.0 and NocoBase Commercial License.
7
+ * For more information, please refer to: https://www.nocobase.com/agreement.
8
+ */
9
+
10
+ var __defProp = Object.defineProperty;
11
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
12
+ var __getOwnPropNames = Object.getOwnPropertyNames;
13
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
14
+ var __export = (target, all) => {
15
+ for (var name in all)
16
+ __defProp(target, name, { get: all[name], enumerable: true });
17
+ };
18
+ var __copyProps = (to, from, except, desc) => {
19
+ if (from && typeof from === "object" || typeof from === "function") {
20
+ for (let key of __getOwnPropNames(from))
21
+ if (!__hasOwnProp.call(to, key) && key !== except)
22
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
23
+ }
24
+ return to;
25
+ };
26
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
27
+ var theme_exports = {};
28
+ __export(theme_exports, {
29
+ mapActiveColor: () => mapActiveColor,
30
+ mapSelectedColor: () => mapSelectedColor
31
+ });
32
+ module.exports = __toCommonJS(theme_exports);
33
+ const mapActiveColor = "#4e9bff";
34
+ const mapSelectedColor = "#F18b62";
35
+ // Annotate the CommonJS export names for ESM import in node:
36
+ 0 && (module.exports = {
37
+ mapActiveColor,
38
+ mapSelectedColor
39
+ });
@@ -0,0 +1,9 @@
1
+ /**
2
+ * This file is part of the NocoBase (R) project.
3
+ * Copyright (c) 2020-2024 NocoBase Co., Ltd.
4
+ * Authors: NocoBase Team.
5
+ *
6
+ * This project is dual-licensed under AGPL-3.0 and NocoBase Commercial License.
7
+ * For more information, please refer to: https://www.nocobase.com/agreement.
8
+ */
9
+ export type MapEditorType = 'point' | 'polygon' | 'lineString' | 'circle';
@@ -0,0 +1,24 @@
1
+ /**
2
+ * This file is part of the NocoBase (R) project.
3
+ * Copyright (c) 2020-2024 NocoBase Co., Ltd.
4
+ * Authors: NocoBase Team.
5
+ *
6
+ * This project is dual-licensed under AGPL-3.0 and NocoBase Commercial License.
7
+ * For more information, please refer to: https://www.nocobase.com/agreement.
8
+ */
9
+
10
+ var __defProp = Object.defineProperty;
11
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
12
+ var __getOwnPropNames = Object.getOwnPropertyNames;
13
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
14
+ var __copyProps = (to, from, except, desc) => {
15
+ if (from && typeof from === "object" || typeof from === "function") {
16
+ for (let key of __getOwnPropNames(from))
17
+ if (!__hasOwnProp.call(to, key) && key !== except)
18
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
19
+ }
20
+ return to;
21
+ };
22
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
23
+ var types_exports = {};
24
+ module.exports = __toCommonJS(types_exports);
@@ -0,0 +1,13 @@
1
+ /**
2
+ * This file is part of the NocoBase (R) project.
3
+ * Copyright (c) 2020-2024 NocoBase Co., Ltd.
4
+ * Authors: NocoBase Team.
5
+ *
6
+ * This project is dual-licensed under AGPL-3.0 and NocoBase Commercial License.
7
+ * For more information, please refer to: https://www.nocobase.com/agreement.
8
+ */
9
+ export declare const getSource: (data: Record<string, any>, fields?: string[], type?: string) => any;
10
+ export declare const runIdleTask: (callback: () => void) => void;
11
+ export declare const normalizeErrorMessage: (error: unknown, fallbackMessage: string) => string;
12
+ export declare const compileTemplate: (value: any, t?: (key: string, options?: any) => string) => any;
13
+ export declare const getLabelFormatValue: (uiSchema: any, value: any) => any;
@@ -0,0 +1,98 @@
1
+ /**
2
+ * This file is part of the NocoBase (R) project.
3
+ * Copyright (c) 2020-2024 NocoBase Co., Ltd.
4
+ * Authors: NocoBase Team.
5
+ *
6
+ * This project is dual-licensed under AGPL-3.0 and NocoBase Commercial License.
7
+ * For more information, please refer to: https://www.nocobase.com/agreement.
8
+ */
9
+
10
+ var __defProp = Object.defineProperty;
11
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
12
+ var __getOwnPropNames = Object.getOwnPropertyNames;
13
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
14
+ var __export = (target, all) => {
15
+ for (var name in all)
16
+ __defProp(target, name, { get: all[name], enumerable: true });
17
+ };
18
+ var __copyProps = (to, from, except, desc) => {
19
+ if (from && typeof from === "object" || typeof from === "function") {
20
+ for (let key of __getOwnPropNames(from))
21
+ if (!__hasOwnProp.call(to, key) && key !== except)
22
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
23
+ }
24
+ return to;
25
+ };
26
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
27
+ var utils_exports = {};
28
+ __export(utils_exports, {
29
+ compileTemplate: () => compileTemplate,
30
+ getLabelFormatValue: () => getLabelFormatValue,
31
+ getSource: () => getSource,
32
+ normalizeErrorMessage: () => normalizeErrorMessage,
33
+ runIdleTask: () => runIdleTask
34
+ });
35
+ module.exports = __toCommonJS(utils_exports);
36
+ const getSource = (data, fields, type) => {
37
+ const res = fields == null ? void 0 : fields.reduce((obj, field, index) => {
38
+ if (index === fields.length - 1 && (type === "o2m" || type === "m2m")) {
39
+ return obj == null ? void 0 : obj.map((item) => item[field]).filter((v) => v !== null && v !== void 0);
40
+ }
41
+ return obj == null ? void 0 : obj[field];
42
+ }, data);
43
+ return type === "o2m" || type === "m2m" ? res : [res];
44
+ };
45
+ const runIdleTask = (callback) => {
46
+ if (window.requestIdleCallback) {
47
+ window.requestIdleCallback(() => {
48
+ callback();
49
+ });
50
+ return;
51
+ }
52
+ window.setTimeout(callback, 1);
53
+ };
54
+ const normalizeErrorMessage = (error, fallbackMessage) => {
55
+ if (typeof error === "string") {
56
+ return error;
57
+ }
58
+ if (error instanceof Error && error.message) {
59
+ return error.message;
60
+ }
61
+ if (error && typeof error === "object" && "message" in error) {
62
+ const { message } = error;
63
+ if (typeof message === "string" && message) {
64
+ return message;
65
+ }
66
+ }
67
+ return fallbackMessage;
68
+ };
69
+ const compileTemplate = (value, t) => {
70
+ if (typeof value !== "string") {
71
+ return value;
72
+ }
73
+ return value.replace(/\{\{\s*t\(['"]([^'"]+)['"](?:,\s*([^}]+))?\)\s*\}\}/g, (_, key) => {
74
+ return t ? t(key) : key;
75
+ });
76
+ };
77
+ const getLabelFormatValue = (uiSchema, value) => {
78
+ var _a;
79
+ if (value == null) {
80
+ return value;
81
+ }
82
+ const enumOptions = (uiSchema == null ? void 0 : uiSchema.enum) || ((_a = uiSchema == null ? void 0 : uiSchema["x-component-props"]) == null ? void 0 : _a.options);
83
+ if (Array.isArray(enumOptions)) {
84
+ const matched = enumOptions.find((item) => (item == null ? void 0 : item.value) === value);
85
+ if (matched) {
86
+ return matched.label ?? matched.title ?? value;
87
+ }
88
+ }
89
+ return value;
90
+ };
91
+ // Annotate the CommonJS export names for ESM import in node:
92
+ 0 && (module.exports = {
93
+ compileTemplate,
94
+ getLabelFormatValue,
95
+ getSource,
96
+ normalizeErrorMessage,
97
+ runIdleTask
98
+ });
package/package.json CHANGED
@@ -3,7 +3,7 @@
3
3
  "displayName": "Block: Map",
4
4
  "displayName.ru-RU": "Блок: Карта",
5
5
  "displayName.zh-CN": "区块:地图",
6
- "version": "2.1.0-beta.9",
6
+ "version": "2.2.0-beta.1",
7
7
  "description": "Map block, support Gaode map and Google map, you can also extend more map types.",
8
8
  "description.ru-RU": "Блок карты, поддерживает карты Gaode и Google, можно расширить поддержку других типов карт.",
9
9
  "description.zh-CN": "地图区块,支持高德地图和 Google 地图,你也可以扩展更多地图类型。",
@@ -34,12 +34,14 @@
34
34
  "peerDependencies": {
35
35
  "@nocobase/actions": "2.x",
36
36
  "@nocobase/client": "2.x",
37
+ "@nocobase/client-v2": "2.x",
37
38
  "@nocobase/database": "2.x",
39
+ "@nocobase/plugin-action-bulk-update": "2.x",
38
40
  "@nocobase/server": "2.x",
39
41
  "@nocobase/test": "2.x",
40
42
  "@nocobase/utils": "2.x"
41
43
  },
42
- "gitHead": "c3a2875e4cbbb43b1f2361e6f9f5f84a7d3f3c3c",
44
+ "gitHead": "f82fa9d0c3aa8e00e53dd94e404a312483b4866b",
43
45
  "keywords": [
44
46
  "Blocks"
45
47
  ]
@@ -1,13 +0,0 @@
1
- /**
2
- * This file is part of the NocoBase (R) project.
3
- * Copyright (c) 2020-2024 NocoBase Co., Ltd.
4
- * Authors: NocoBase Team.
5
- *
6
- * This project is dual-licensed under AGPL-3.0 and NocoBase Commercial License.
7
- * For more information, please refer to: https://www.nocobase.com/agreement.
8
- */
9
- import React from 'react';
10
- import { AMapComponentProps } from './AMap';
11
- type MapProps = AMapComponentProps;
12
- declare const Map: (props: MapProps) => React.JSX.Element;
13
- export { Map };