@heycar/heycars-map 0.9.23-alpha4 → 0.9.23-alpha6

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/README.md CHANGED
@@ -190,6 +190,7 @@ export default defineComponent({
190
190
  recomendDescription={"您将在此处上车"}
191
191
  geoDefaultPosition={[139.777777, 35.777777]}
192
192
  mapContext={mapContext}
193
+ getAvailable={() => Promise.resolve(true)}
193
194
  getRecomendPlace={async ({ lng, lat }) => {
194
195
  // 向后端获取推荐点信息
195
196
  return {
@@ -325,6 +326,7 @@ export default defineComponent({
325
326
  name: "default place name",
326
327
  displayName: "default place display name",
327
328
  }}
329
+ getAvailable={() => Promise.resolve(true)}
328
330
  getRecomendPlace={async ({ lng, lat }) => {
329
331
  // 向后端获取推荐点信息
330
332
  return {
package/dist/index.cjs CHANGED
@@ -19,7 +19,7 @@ if (typeof GeolocationPositionError === "undefined") {
19
19
  };
20
20
  }
21
21
  const name = "@heycar/heycars-map";
22
- const version = "0.9.23-alpha4";
22
+ const version = "0.9.23-alpha6";
23
23
  const type = "module";
24
24
  const bin = {
25
25
  checkVersion: "./bin/checkVersion.js"
@@ -1514,6 +1514,7 @@ const language2vectorMapForeign = (lang) => {
1514
1514
  switch (lang) {
1515
1515
  case "en":
1516
1516
  return "style_en";
1517
+ case "zh-TW":
1517
1518
  case "zh":
1518
1519
  return "style_zh_cn";
1519
1520
  }
@@ -1784,11 +1785,6 @@ const createRunOnce = (fn) => {
1784
1785
  return result;
1785
1786
  };
1786
1787
  };
1787
- const createAsyncNoFailNonNullable = (fn, defaultValue) => {
1788
- return function noFailNoNullable(...args) {
1789
- return fn(...args).then((result) => result != null ? result : defaultValue).catch(() => defaultValue);
1790
- };
1791
- };
1792
1788
  const pipeTimeout = (fn, defaultValue, timeout) => {
1793
1789
  return function pipedTimeoutedFunction(...args) {
1794
1790
  return new Promise((resolve, reject) => {
@@ -4199,7 +4195,7 @@ const AStartEndPoint = defineSetup(function AStartEndPoint2(props, {
4199
4195
  type: type2,
4200
4196
  language
4201
4197
  } = props;
4202
- const icon = type2 === "start" ? language === "zh" ? imgStartPoint : imgStartPointEn : language === "zh" ? imgEndPoint : imgEndPointEn;
4198
+ const icon = type2 === "start" ? language === "zh" || language === "zh-TW" ? imgStartPoint : imgStartPointEn : language === "zh" || language === "zh-TW" ? imgEndPoint : imgEndPointEn;
4203
4199
  const descriptionRow = !description ? "" : decodeAsterisk(description).map((item) => item.type === "normal" ? item.value : `<span class="${pointInfoBoxEmphasize$1}">${item.value}</span>`).join("");
4204
4200
  if (!description && !title)
4205
4201
  return `<img class="AStartEndPoint ${pointIcon({
@@ -4267,7 +4263,7 @@ const GStartEndPoint = defineSetup(function GStartEndPoint2(props, {
4267
4263
  type: type2,
4268
4264
  language = "zh"
4269
4265
  } = props;
4270
- const icon = type2 === "start" ? language === "zh" ? imgStartPoint : imgStartPointEn : language === "zh" ? imgEndPoint : imgEndPointEn;
4266
+ const icon = type2 === "start" ? language === "zh" || language === "zh-TW" ? imgStartPoint : imgStartPointEn : language === "zh" || language === "zh-TW" ? imgEndPoint : imgEndPointEn;
4271
4267
  const descriptionRow = !description ? "" : decodeAsterisk(description).map((item) => item.type === "normal" ? item.value : `<span class="${pointInfoBoxEmphasize$1}">${item.value}</span>`).join("");
4272
4268
  if (!description && !title)
4273
4269
  return createDom("img", {
@@ -7282,6 +7278,19 @@ const useMapPlace = (props) => {
7282
7278
  const { supplier } = useMapSupplier();
7283
7279
  return supplier === "gmap" ? useGmapPlace(props) : useAmapPlace(props);
7284
7280
  };
7281
+ function mergeGetRecommendPlaceAndGetAvailable(getRecomendPlace, getAvailable, timeout) {
7282
+ return function mergedGetRecommendPlace(place, context2) {
7283
+ const available = true;
7284
+ return new Promise((resolve) => {
7285
+ getAvailable(place).then((value) => {
7286
+ if (!value)
7287
+ resolve({ available: false });
7288
+ });
7289
+ getRecomendPlace(place, context2).then((result) => resolve(result != null ? result : { available })).catch(() => resolve({ available }));
7290
+ setTimeout(() => resolve({ available }), timeout);
7291
+ });
7292
+ };
7293
+ }
7285
7294
  function findNearestPlace(place, candidates, distanceFn) {
7286
7295
  var _a;
7287
7296
  let shortestDistance = Infinity;
@@ -7298,6 +7307,7 @@ function findNearestPlace(place, candidates, distanceFn) {
7298
7307
  const useMapRecomendPlace = (props) => {
7299
7308
  const {
7300
7309
  defaultPoint,
7310
+ getAvailable,
7301
7311
  getRecomendPlace,
7302
7312
  getLimit,
7303
7313
  context: context2,
@@ -7323,9 +7333,9 @@ const useMapRecomendPlace = (props) => {
7323
7333
  displayName: ""
7324
7334
  });
7325
7335
  const isQueryingRef = Vue.ref(false);
7326
- const getRecomendPlaceNoFail = pipeTimeout(
7327
- createAsyncNoFailNonNullable(getRecomendPlace, {}),
7328
- { available: true },
7336
+ const getRecomendPlaceNoFail = mergeGetRecommendPlaceAndGetAvailable(
7337
+ getRecomendPlace,
7338
+ getAvailable,
7329
7339
  GET_RECOMMEND_PLACE_TIMEOUT
7330
7340
  );
7331
7341
  const findAttachedPlace = async (place) => {
@@ -8424,10 +8434,12 @@ const BusinessRecomendPlaceMap = defineLagecySetup(function BusinessRecomendPlac
8424
8434
  geoDefaultPosition,
8425
8435
  geoErrorOnceNotificationKey = `BusinessRecomendPlaceMap_${Date.now()}`,
8426
8436
  geoErrorOnceNotificationInterval = 0,
8437
+ getAvailable,
8427
8438
  getRecomendPlace,
8428
8439
  getDefaultCenterPlace,
8429
8440
  mapContext
8430
8441
  } = props;
8442
+ const pipedGetAvailable = pipeOnlyLastEffect(getAvailable);
8431
8443
  const pipedGetRecomendPlace = pipeOnlyLastEffect(getRecomendPlace);
8432
8444
  const {
8433
8445
  mapRef,
@@ -8576,6 +8588,7 @@ const BusinessRecomendPlaceMap = defineLagecySetup(function BusinessRecomendPlac
8576
8588
  emptyPlaceName: emptyTitle,
8577
8589
  queryingPlaceName: queryingTitle,
8578
8590
  context: centerSource,
8591
+ getAvailable: pipedGetAvailable,
8579
8592
  getRecomendPlace: pipedGetRecomendPlace,
8580
8593
  getLimit: (context2) => {
8581
8594
  const source = context2 == null ? void 0 : context2.source;
@@ -8690,7 +8703,7 @@ const BusinessRecomendPlaceMap = defineLagecySetup(function BusinessRecomendPlac
8690
8703
  }
8691
8704
  })]);
8692
8705
  };
8693
- }).props(["log", "geoLoadingTitle", "emptyTitle", "queryingTitle", "geoErrorOnceNotificationKey", "geoErrorOnceNotificationInterval", "unavailableTitle", "recomendDescription", "disableLocator", "fallback", "geoDefaultPosition", "getRecomendPlace", "getDefaultCenterPlace", "loading", "mapContext"]);
8706
+ }).props(["log", "geoLoadingTitle", "emptyTitle", "queryingTitle", "geoErrorOnceNotificationKey", "geoErrorOnceNotificationInterval", "unavailableTitle", "recomendDescription", "disableLocator", "fallback", "geoDefaultPosition", "getRecomendPlace", "getAvailable", "getDefaultCenterPlace", "loading", "mapContext"]);
8694
8707
  const emptyPlace = {
8695
8708
  lng: 0,
8696
8709
  lat: 0,
@@ -8706,6 +8719,7 @@ const BusinessReselectPlaceMap = defineLagecySetup(function BusinessReselectPlac
8706
8719
  queryingTitle,
8707
8720
  geoErrorOnceNotificationKey = `BusinessRecomendPlaceMap_${Date.now()}`,
8708
8721
  geoErrorOnceNotificationInterval = 0,
8722
+ getAvailable,
8709
8723
  getRecomendPlace,
8710
8724
  mapContext,
8711
8725
  disableLocator,
@@ -8713,6 +8727,7 @@ const BusinessReselectPlaceMap = defineLagecySetup(function BusinessReselectPlac
8713
8727
  ...emptyPlace
8714
8728
  }
8715
8729
  } = props;
8730
+ const pipedGetAvailable = pipeOnlyLastEffect(getAvailable);
8716
8731
  const pipedGetRecomendPlace = pipeOnlyLastEffect(getRecomendPlace);
8717
8732
  const {
8718
8733
  mapRef,
@@ -8795,6 +8810,10 @@ const BusinessReselectPlaceMap = defineLagecySetup(function BusinessReselectPlac
8795
8810
  geoLoading
8796
8811
  } = useGeoLocation({
8797
8812
  geoDefaultPosition: place2point(defaultPlace),
8813
+ onChange: (v) => {
8814
+ mapContext.geoPositionRef.value = v.position;
8815
+ emit("changeGeoLocation", v);
8816
+ },
8798
8817
  onError: (error) => {
8799
8818
  emit("geoError", error);
8800
8819
  emitGeoErrorOnce(error);
@@ -8831,6 +8850,7 @@ const BusinessReselectPlaceMap = defineLagecySetup(function BusinessReselectPlac
8831
8850
  emptyPlaceName: emptyTitle,
8832
8851
  queryingPlaceName: queryingTitle,
8833
8852
  context: centerSource,
8853
+ getAvailable: pipedGetAvailable,
8834
8854
  getRecomendPlace: pipedGetRecomendPlace,
8835
8855
  getLimit: (context2) => {
8836
8856
  const source = context2 == null ? void 0 : context2.source;
@@ -8942,7 +8962,7 @@ const BusinessReselectPlaceMap = defineLagecySetup(function BusinessReselectPlac
8942
8962
  }
8943
8963
  })]);
8944
8964
  };
8945
- }).props(["loading", "fallback", "log", "defaultPlace", "unavailableTitle", "emptyTitle", "queryingTitle", "recomendDescription", "geoErrorOnceNotificationKey", "geoErrorOnceNotificationInterval", "disableLocator", "disableLocatorPhoto", "getRecomendPlace", "mapContext"]);
8965
+ }).props(["loading", "fallback", "log", "defaultPlace", "unavailableTitle", "emptyTitle", "queryingTitle", "recomendDescription", "geoErrorOnceNotificationKey", "geoErrorOnceNotificationInterval", "disableLocator", "disableLocatorPhoto", "getAvailable", "getRecomendPlace", "mapContext"]);
8946
8966
  const assertPropNoEmptyArray = (list, funcName, propName) => {
8947
8967
  if (list.length > 0)
8948
8968
  return;
package/dist/index.js CHANGED
@@ -17,7 +17,7 @@ if (typeof GeolocationPositionError === "undefined") {
17
17
  };
18
18
  }
19
19
  const name = "@heycar/heycars-map";
20
- const version = "0.9.23-alpha4";
20
+ const version = "0.9.23-alpha6";
21
21
  const type = "module";
22
22
  const bin = {
23
23
  checkVersion: "./bin/checkVersion.js"
@@ -1512,6 +1512,7 @@ const language2vectorMapForeign = (lang) => {
1512
1512
  switch (lang) {
1513
1513
  case "en":
1514
1514
  return "style_en";
1515
+ case "zh-TW":
1515
1516
  case "zh":
1516
1517
  return "style_zh_cn";
1517
1518
  }
@@ -1782,11 +1783,6 @@ const createRunOnce = (fn) => {
1782
1783
  return result;
1783
1784
  };
1784
1785
  };
1785
- const createAsyncNoFailNonNullable = (fn, defaultValue) => {
1786
- return function noFailNoNullable(...args) {
1787
- return fn(...args).then((result) => result != null ? result : defaultValue).catch(() => defaultValue);
1788
- };
1789
- };
1790
1786
  const pipeTimeout = (fn, defaultValue, timeout) => {
1791
1787
  return function pipedTimeoutedFunction(...args) {
1792
1788
  return new Promise((resolve, reject) => {
@@ -4197,7 +4193,7 @@ const AStartEndPoint = defineSetup(function AStartEndPoint2(props, {
4197
4193
  type: type2,
4198
4194
  language
4199
4195
  } = props;
4200
- const icon = type2 === "start" ? language === "zh" ? imgStartPoint : imgStartPointEn : language === "zh" ? imgEndPoint : imgEndPointEn;
4196
+ const icon = type2 === "start" ? language === "zh" || language === "zh-TW" ? imgStartPoint : imgStartPointEn : language === "zh" || language === "zh-TW" ? imgEndPoint : imgEndPointEn;
4201
4197
  const descriptionRow = !description ? "" : decodeAsterisk(description).map((item) => item.type === "normal" ? item.value : `<span class="${pointInfoBoxEmphasize$1}">${item.value}</span>`).join("");
4202
4198
  if (!description && !title)
4203
4199
  return `<img class="AStartEndPoint ${pointIcon({
@@ -4265,7 +4261,7 @@ const GStartEndPoint = defineSetup(function GStartEndPoint2(props, {
4265
4261
  type: type2,
4266
4262
  language = "zh"
4267
4263
  } = props;
4268
- const icon = type2 === "start" ? language === "zh" ? imgStartPoint : imgStartPointEn : language === "zh" ? imgEndPoint : imgEndPointEn;
4264
+ const icon = type2 === "start" ? language === "zh" || language === "zh-TW" ? imgStartPoint : imgStartPointEn : language === "zh" || language === "zh-TW" ? imgEndPoint : imgEndPointEn;
4269
4265
  const descriptionRow = !description ? "" : decodeAsterisk(description).map((item) => item.type === "normal" ? item.value : `<span class="${pointInfoBoxEmphasize$1}">${item.value}</span>`).join("");
4270
4266
  if (!description && !title)
4271
4267
  return createDom("img", {
@@ -7280,6 +7276,19 @@ const useMapPlace = (props) => {
7280
7276
  const { supplier } = useMapSupplier();
7281
7277
  return supplier === "gmap" ? useGmapPlace(props) : useAmapPlace(props);
7282
7278
  };
7279
+ function mergeGetRecommendPlaceAndGetAvailable(getRecomendPlace, getAvailable, timeout) {
7280
+ return function mergedGetRecommendPlace(place, context2) {
7281
+ const available = true;
7282
+ return new Promise((resolve) => {
7283
+ getAvailable(place).then((value) => {
7284
+ if (!value)
7285
+ resolve({ available: false });
7286
+ });
7287
+ getRecomendPlace(place, context2).then((result) => resolve(result != null ? result : { available })).catch(() => resolve({ available }));
7288
+ setTimeout(() => resolve({ available }), timeout);
7289
+ });
7290
+ };
7291
+ }
7283
7292
  function findNearestPlace(place, candidates, distanceFn) {
7284
7293
  var _a;
7285
7294
  let shortestDistance = Infinity;
@@ -7296,6 +7305,7 @@ function findNearestPlace(place, candidates, distanceFn) {
7296
7305
  const useMapRecomendPlace = (props) => {
7297
7306
  const {
7298
7307
  defaultPoint,
7308
+ getAvailable,
7299
7309
  getRecomendPlace,
7300
7310
  getLimit,
7301
7311
  context: context2,
@@ -7321,9 +7331,9 @@ const useMapRecomendPlace = (props) => {
7321
7331
  displayName: ""
7322
7332
  });
7323
7333
  const isQueryingRef = ref(false);
7324
- const getRecomendPlaceNoFail = pipeTimeout(
7325
- createAsyncNoFailNonNullable(getRecomendPlace, {}),
7326
- { available: true },
7334
+ const getRecomendPlaceNoFail = mergeGetRecommendPlaceAndGetAvailable(
7335
+ getRecomendPlace,
7336
+ getAvailable,
7327
7337
  GET_RECOMMEND_PLACE_TIMEOUT
7328
7338
  );
7329
7339
  const findAttachedPlace = async (place) => {
@@ -8422,10 +8432,12 @@ const BusinessRecomendPlaceMap = defineLagecySetup(function BusinessRecomendPlac
8422
8432
  geoDefaultPosition,
8423
8433
  geoErrorOnceNotificationKey = `BusinessRecomendPlaceMap_${Date.now()}`,
8424
8434
  geoErrorOnceNotificationInterval = 0,
8435
+ getAvailable,
8425
8436
  getRecomendPlace,
8426
8437
  getDefaultCenterPlace,
8427
8438
  mapContext
8428
8439
  } = props;
8440
+ const pipedGetAvailable = pipeOnlyLastEffect(getAvailable);
8429
8441
  const pipedGetRecomendPlace = pipeOnlyLastEffect(getRecomendPlace);
8430
8442
  const {
8431
8443
  mapRef,
@@ -8574,6 +8586,7 @@ const BusinessRecomendPlaceMap = defineLagecySetup(function BusinessRecomendPlac
8574
8586
  emptyPlaceName: emptyTitle,
8575
8587
  queryingPlaceName: queryingTitle,
8576
8588
  context: centerSource,
8589
+ getAvailable: pipedGetAvailable,
8577
8590
  getRecomendPlace: pipedGetRecomendPlace,
8578
8591
  getLimit: (context2) => {
8579
8592
  const source = context2 == null ? void 0 : context2.source;
@@ -8688,7 +8701,7 @@ const BusinessRecomendPlaceMap = defineLagecySetup(function BusinessRecomendPlac
8688
8701
  }
8689
8702
  })]);
8690
8703
  };
8691
- }).props(["log", "geoLoadingTitle", "emptyTitle", "queryingTitle", "geoErrorOnceNotificationKey", "geoErrorOnceNotificationInterval", "unavailableTitle", "recomendDescription", "disableLocator", "fallback", "geoDefaultPosition", "getRecomendPlace", "getDefaultCenterPlace", "loading", "mapContext"]);
8704
+ }).props(["log", "geoLoadingTitle", "emptyTitle", "queryingTitle", "geoErrorOnceNotificationKey", "geoErrorOnceNotificationInterval", "unavailableTitle", "recomendDescription", "disableLocator", "fallback", "geoDefaultPosition", "getRecomendPlace", "getAvailable", "getDefaultCenterPlace", "loading", "mapContext"]);
8692
8705
  const emptyPlace = {
8693
8706
  lng: 0,
8694
8707
  lat: 0,
@@ -8704,6 +8717,7 @@ const BusinessReselectPlaceMap = defineLagecySetup(function BusinessReselectPlac
8704
8717
  queryingTitle,
8705
8718
  geoErrorOnceNotificationKey = `BusinessRecomendPlaceMap_${Date.now()}`,
8706
8719
  geoErrorOnceNotificationInterval = 0,
8720
+ getAvailable,
8707
8721
  getRecomendPlace,
8708
8722
  mapContext,
8709
8723
  disableLocator,
@@ -8711,6 +8725,7 @@ const BusinessReselectPlaceMap = defineLagecySetup(function BusinessReselectPlac
8711
8725
  ...emptyPlace
8712
8726
  }
8713
8727
  } = props;
8728
+ const pipedGetAvailable = pipeOnlyLastEffect(getAvailable);
8714
8729
  const pipedGetRecomendPlace = pipeOnlyLastEffect(getRecomendPlace);
8715
8730
  const {
8716
8731
  mapRef,
@@ -8793,6 +8808,10 @@ const BusinessReselectPlaceMap = defineLagecySetup(function BusinessReselectPlac
8793
8808
  geoLoading
8794
8809
  } = useGeoLocation({
8795
8810
  geoDefaultPosition: place2point(defaultPlace),
8811
+ onChange: (v) => {
8812
+ mapContext.geoPositionRef.value = v.position;
8813
+ emit("changeGeoLocation", v);
8814
+ },
8796
8815
  onError: (error) => {
8797
8816
  emit("geoError", error);
8798
8817
  emitGeoErrorOnce(error);
@@ -8829,6 +8848,7 @@ const BusinessReselectPlaceMap = defineLagecySetup(function BusinessReselectPlac
8829
8848
  emptyPlaceName: emptyTitle,
8830
8849
  queryingPlaceName: queryingTitle,
8831
8850
  context: centerSource,
8851
+ getAvailable: pipedGetAvailable,
8832
8852
  getRecomendPlace: pipedGetRecomendPlace,
8833
8853
  getLimit: (context2) => {
8834
8854
  const source = context2 == null ? void 0 : context2.source;
@@ -8940,7 +8960,7 @@ const BusinessReselectPlaceMap = defineLagecySetup(function BusinessReselectPlac
8940
8960
  }
8941
8961
  })]);
8942
8962
  };
8943
- }).props(["loading", "fallback", "log", "defaultPlace", "unavailableTitle", "emptyTitle", "queryingTitle", "recomendDescription", "geoErrorOnceNotificationKey", "geoErrorOnceNotificationInterval", "disableLocator", "disableLocatorPhoto", "getRecomendPlace", "mapContext"]);
8963
+ }).props(["loading", "fallback", "log", "defaultPlace", "unavailableTitle", "emptyTitle", "queryingTitle", "recomendDescription", "geoErrorOnceNotificationKey", "geoErrorOnceNotificationInterval", "disableLocator", "disableLocatorPhoto", "getAvailable", "getRecomendPlace", "mapContext"]);
8944
8964
  const assertPropNoEmptyArray = (list, funcName, propName) => {
8945
8965
  if (list.length > 0)
8946
8966
  return;
@@ -17,7 +17,7 @@ export declare const ZONE_ZOOM = 13.75;
17
17
  export interface CenterPlaceSource {
18
18
  source: "default" | "geo" | "drag" | "recomend" | "api";
19
19
  }
20
- export interface BusinessRecomendPlaceMapProps extends Omit<HeycarMapProps, "center" | "zoom" | "mapRef">, Pick<UseMapRecomendPlaceProps<CenterPlaceSource>, "getRecomendPlace"> {
20
+ export interface BusinessRecomendPlaceMapProps extends Omit<HeycarMapProps, "center" | "zoom" | "mapRef">, Pick<UseMapRecomendPlaceProps<CenterPlaceSource>, "getRecomendPlace" | "getAvailable"> {
21
21
  log?: boolean;
22
22
  geoLoadingTitle: string;
23
23
  unavailableTitle: string;
@@ -1,6 +1,6 @@
1
1
  import { type Place } from "../../types/interface";
2
2
  import { type BusinessRecomendPlaceMapProps } from "../BusinessRecomendPlaceMap";
3
- export interface BusinessReselectPlaceMapProps extends Pick<BusinessRecomendPlaceMapProps, "geoErrorOnceNotificationKey" | "geoErrorOnceNotificationInterval" | "loading" | "fallback" | "log" | "getRecomendPlace" | "unavailableTitle" | "emptyTitle" | "queryingTitle" | "recomendDescription" | "disableLocator" | "disableLocatorPhoto" | "mapContext" | "onChangePlace" | "onChangeRecomandPlace" | "onGeoError" | "onGeoErrorOnce" | "onClickLocatorText" | "onClickLocatorPhoto"> {
3
+ export interface BusinessReselectPlaceMapProps extends Pick<BusinessRecomendPlaceMapProps, "geoErrorOnceNotificationKey" | "geoErrorOnceNotificationInterval" | "loading" | "fallback" | "log" | "getAvailable" | "getRecomendPlace" | "unavailableTitle" | "emptyTitle" | "queryingTitle" | "recomendDescription" | "disableLocator" | "disableLocatorPhoto" | "mapContext" | "onChangeGeoLocation" | "onChangePlace" | "onChangeRecomandPlace" | "onGeoError" | "onGeoErrorOnce" | "onClickLocatorText" | "onClickLocatorPhoto"> {
4
4
  defaultPlace?: Place;
5
5
  }
6
- export declare const BusinessReselectPlaceMap: import("vue-demi").DefineComponent<import("vue/types/v3-component-props").ComponentObjectPropsOptions<BusinessReselectPlaceMapProps>, import("../../types/helper").Empty, import("../../types/helper").Empty, import("../../types/helper").Empty, import("../../types/helper").Empty, import("../../types/helper").Empty, import("../../types/helper").Empty, import("../../types/helper").EmitByProps<BusinessReselectPlaceMapProps, Required<BusinessReselectPlaceMapProps>>, "changePlace" | "changeRecomandPlace" | "geoError" | "geoErrorOnce" | "clickLocatorText" | "clickLocatorPhoto", BusinessReselectPlaceMapProps, {}>;
6
+ export declare const BusinessReselectPlaceMap: import("vue-demi").DefineComponent<import("vue/types/v3-component-props").ComponentObjectPropsOptions<BusinessReselectPlaceMapProps>, import("../../types/helper").Empty, import("../../types/helper").Empty, import("../../types/helper").Empty, import("../../types/helper").Empty, import("../../types/helper").Empty, import("../../types/helper").Empty, import("../../types/helper").EmitByProps<BusinessReselectPlaceMapProps, Required<BusinessReselectPlaceMapProps>>, "changePlace" | "changeGeoLocation" | "changeRecomandPlace" | "geoError" | "geoErrorOnce" | "clickLocatorText" | "clickLocatorPhoto", BusinessReselectPlaceMapProps, {}>;
@@ -1,7 +1,7 @@
1
1
  import type { GmapOverlay, MapRegisterOverlayProps } from "../../hooks/useOverlay";
2
- import type { Point } from "../../types/interface";
2
+ import type { Language, Point } from "../../types/interface";
3
3
  export interface StartEndPointProps<T> extends MapRegisterOverlayProps<T> {
4
- language: "en" | "zh";
4
+ language: Language;
5
5
  type: "start" | "end";
6
6
  position: [number, number];
7
7
  title?: string;
@@ -2,6 +2,7 @@ import { load as loadAmap } from "@amap/amap-jsapi-loader";
2
2
  import { LoaderOptions } from "@googlemaps/js-api-loader";
3
3
  import { Ref } from "vue-demi";
4
4
  import type { VueNode } from "../types/helper";
5
+ import type { Language } from "../types/interface";
5
6
  export declare const DEFAULT_AMAP_PLUGINS: AmapLoaderProps["plugins"];
6
7
  export declare const DEFAULT_GMAP_LIBRARIES: LoaderOptions["libraries"];
7
8
  export declare enum Status {
@@ -60,7 +61,7 @@ export interface UseMapLoaderProps {
60
61
  amapSecret?: string;
61
62
  amapServiceHost?: string;
62
63
  supplier: MapSupplier;
63
- language: "en" | "zh";
64
+ language: Language;
64
65
  onChange?: (status: Status) => any;
65
66
  }
66
67
  export declare const useMapLoader: (props: UseMapLoaderProps) => UseMapLoaderOutput;
@@ -12,6 +12,7 @@ export interface UseMapRecomendPlaceProps<C = Record<string, any>> {
12
12
  emptyPlaceName: string;
13
13
  queryingPlaceName: string;
14
14
  getLimit: (context?: C) => number;
15
+ getAvailable: (place: Place) => Promise<boolean>;
15
16
  getRecomendPlace: (place: Place, context?: C) => Promise<RecommendZonePlaces | undefined>;
16
17
  onChangePlace?: UseMapPlaceProps["onChange"];
17
18
  onQueryingPlace?: UseMapPlaceProps["onChange"];
@@ -1,6 +1,7 @@
1
1
  /// <reference types="google.maps" />
2
2
  import type { ShallowRef } from "vue-demi";
3
3
  import type { SafeAmap } from "../components/Amap/SafeAmap";
4
+ export type Language = "en" | "zh" | "zh-TW";
4
5
  export type Point = [number, number];
5
6
  export type AmapMap = SafeAmap;
6
7
  export type MapShallowRef<M = AmapMap | google.maps.Map> = ShallowRef<M | undefined>;
@@ -1,5 +1,5 @@
1
1
  /// <reference types="google.maps" />
2
- import type { Place, Point, RecommendZonePlaces, TrackPoint, Zone } from "../types/interface";
2
+ import type { Language, Place, Point, RecommendZonePlaces, TrackPoint, Zone } from "../types/interface";
3
3
  import type { AlipayMyGetLocationSuccessResponse } from "../types/my";
4
4
  import type { WxGetLocationSuccessResponse } from "../types/wx";
5
5
  import { BRWOSER_PLATFORM } from "./platform";
@@ -16,7 +16,7 @@ export declare const decodeAsterisk: (encodedValue: string) => AsteriskItem[];
16
16
  export declare const property2emitEventName: (propertyName: string) => string;
17
17
  export declare const property2mapEventName: (propertyName: string) => string;
18
18
  export type VectorMapForeign = "style_en" | "style_local" | "style_zh_cn";
19
- export declare const language2vectorMapForeign: (lang: "en" | "zh") => VectorMapForeign;
19
+ export declare const language2vectorMapForeign: (lang: Language) => VectorMapForeign;
20
20
  export declare const place2point: (place: Place) => Point;
21
21
  export declare const combineHandler: <P extends any[], R>(fn1: ((...args: P) => any) | undefined, fn2: (...args: P) => R) => (...args: P) => R;
22
22
  export declare const pipeAsync: <P extends any[]>(fn?: ((...args: P) => any) | undefined) => (...args: P) => void;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@heycar/heycars-map",
3
- "version": "0.9.23-alpha4",
3
+ "version": "0.9.23-alpha6",
4
4
  "type": "module",
5
5
  "bin": {
6
6
  "checkVersion": "./bin/checkVersion.js"
@@ -1,4 +0,0 @@
1
- export declare const useFirstWorkflowRecomendLoading: () => {
2
- isFirstWorkflowRecomendLoadingRef: import("vue-demi").Ref<boolean>;
3
- completeFirstWorkflowRecomend: () => void;
4
- };