@heycar/heycars-map 0.8.1 → 0.8.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.cjs CHANGED
@@ -9,7 +9,7 @@ Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
9
9
  const Vue = require("vue");
10
10
  const style = "";
11
11
  const name = "@heycar/heycars-map";
12
- const version = "0.8.1";
12
+ const version = "0.8.2";
13
13
  const type = "module";
14
14
  const scripts = {
15
15
  dev: "vite -c vite.config.dev.ts",
@@ -3508,7 +3508,7 @@ function compatibaleAddEventListenerDeviceOrientation(handler) {
3508
3508
  addEventListener("touchend", handleTouchEnd);
3509
3509
  return;
3510
3510
  }
3511
- if (typeof DeviceOrientationEvent === "undefined") {
3511
+ if (typeof DeviceOrientationEvent.requestPermission !== "function") {
3512
3512
  console.warn("My Warning: ios not support DeviceOrientationEvent");
3513
3513
  return;
3514
3514
  }
@@ -6466,6 +6466,14 @@ const BusinessRecomendPlaceMap = defineLagecySetup(function BusinessRecomendPlac
6466
6466
  });
6467
6467
  }
6468
6468
  });
6469
+ Vue.watchEffect(() => {
6470
+ mapContext.onChangeCenterPlace({
6471
+ ...centerPlace
6472
+ });
6473
+ });
6474
+ Vue.watchEffect(() => {
6475
+ mapContext.onChangeRecomendPlaces([...placeCandidates.value]);
6476
+ });
6469
6477
  return () => {
6470
6478
  var _a2, _b2;
6471
6479
  const {
@@ -6473,6 +6481,7 @@ const BusinessRecomendPlaceMap = defineLagecySetup(function BusinessRecomendPlac
6473
6481
  recomendDescription,
6474
6482
  unavailableTitle
6475
6483
  } = props;
6484
+ console.log("centerPlace = ", JSON.stringify(centerPlace));
6476
6485
  const title = geoLoading.value ? geoLoadingTitle2 : !availableRef.value ? unavailableTitle : centerPlace.displayName;
6477
6486
  const description = !availableRef.value ? void 0 : isElectedRef.value ? recomendDescription : void 0;
6478
6487
  return Vue.h(HeycarMap, {
@@ -6685,6 +6694,14 @@ const BusinessReselectPlaceMap = defineLagecySetup(function BusinessReselectPlac
6685
6694
  }
6686
6695
  });
6687
6696
  watchPostEffectOnce(() => updatePlaceCandidates(defaultPlace));
6697
+ Vue.watchEffect(() => {
6698
+ mapContext.onChangeCenterPlace({
6699
+ ...centerPlace
6700
+ });
6701
+ });
6702
+ Vue.watchEffect(() => {
6703
+ mapContext.onChangeRecomendPlaces([...placeCandidates.value]);
6704
+ });
6688
6705
  return () => {
6689
6706
  var _a, _b;
6690
6707
  const {
@@ -7860,6 +7877,12 @@ const useBusinessRecomendPlaceMap = () => {
7860
7877
  },
7861
7878
  setCenterPlaceByUserSpecifiedInZone: () => {
7862
7879
  throw new Error("MyError: setCenterPlaceByUserSpecifiedInZone used before assigned");
7880
+ },
7881
+ onChangeCenterPlace: (place) => {
7882
+ Object.assign(centerPlace, { ...place });
7883
+ },
7884
+ onChangeRecomendPlaces: (places) => {
7885
+ placeCandidates.value = [...places];
7863
7886
  }
7864
7887
  };
7865
7888
  return {
package/dist/index.js CHANGED
@@ -7,7 +7,7 @@ var __publicField = (obj, key, value) => {
7
7
  import Vue, { defineComponent, h, computed, inject, provide, watch, onMounted, onUnmounted, watchPostEffect, shallowRef, ref, watchEffect, reactive, toRefs, toRef } from "vue";
8
8
  const style = "";
9
9
  const name = "@heycar/heycars-map";
10
- const version = "0.8.1";
10
+ const version = "0.8.2";
11
11
  const type = "module";
12
12
  const scripts = {
13
13
  dev: "vite -c vite.config.dev.ts",
@@ -3506,7 +3506,7 @@ function compatibaleAddEventListenerDeviceOrientation(handler) {
3506
3506
  addEventListener("touchend", handleTouchEnd);
3507
3507
  return;
3508
3508
  }
3509
- if (typeof DeviceOrientationEvent === "undefined") {
3509
+ if (typeof DeviceOrientationEvent.requestPermission !== "function") {
3510
3510
  console.warn("My Warning: ios not support DeviceOrientationEvent");
3511
3511
  return;
3512
3512
  }
@@ -6464,6 +6464,14 @@ const BusinessRecomendPlaceMap = defineLagecySetup(function BusinessRecomendPlac
6464
6464
  });
6465
6465
  }
6466
6466
  });
6467
+ watchEffect(() => {
6468
+ mapContext.onChangeCenterPlace({
6469
+ ...centerPlace
6470
+ });
6471
+ });
6472
+ watchEffect(() => {
6473
+ mapContext.onChangeRecomendPlaces([...placeCandidates.value]);
6474
+ });
6467
6475
  return () => {
6468
6476
  var _a2, _b2;
6469
6477
  const {
@@ -6471,6 +6479,7 @@ const BusinessRecomendPlaceMap = defineLagecySetup(function BusinessRecomendPlac
6471
6479
  recomendDescription,
6472
6480
  unavailableTitle
6473
6481
  } = props;
6482
+ console.log("centerPlace = ", JSON.stringify(centerPlace));
6474
6483
  const title = geoLoading.value ? geoLoadingTitle2 : !availableRef.value ? unavailableTitle : centerPlace.displayName;
6475
6484
  const description = !availableRef.value ? void 0 : isElectedRef.value ? recomendDescription : void 0;
6476
6485
  return h(HeycarMap, {
@@ -6683,6 +6692,14 @@ const BusinessReselectPlaceMap = defineLagecySetup(function BusinessReselectPlac
6683
6692
  }
6684
6693
  });
6685
6694
  watchPostEffectOnce(() => updatePlaceCandidates(defaultPlace));
6695
+ watchEffect(() => {
6696
+ mapContext.onChangeCenterPlace({
6697
+ ...centerPlace
6698
+ });
6699
+ });
6700
+ watchEffect(() => {
6701
+ mapContext.onChangeRecomendPlaces([...placeCandidates.value]);
6702
+ });
6686
6703
  return () => {
6687
6704
  var _a, _b;
6688
6705
  const {
@@ -7858,6 +7875,12 @@ const useBusinessRecomendPlaceMap = () => {
7858
7875
  },
7859
7876
  setCenterPlaceByUserSpecifiedInZone: () => {
7860
7877
  throw new Error("MyError: setCenterPlaceByUserSpecifiedInZone used before assigned");
7878
+ },
7879
+ onChangeCenterPlace: (place) => {
7880
+ Object.assign(centerPlace, { ...place });
7881
+ },
7882
+ onChangeRecomendPlaces: (places) => {
7883
+ placeCandidates.value = [...places];
7861
7884
  }
7862
7885
  };
7863
7886
  return {
@@ -7,6 +7,8 @@ export interface BusinessRecomendPlaceContext {
7
7
  panToGeoPositionByRecomend: (value: Point) => void;
8
8
  setCenterPlaceByUserSpecified: (value: Place) => void;
9
9
  setCenterPlaceByUserSpecifiedInZone: (value: SetCenterPlaceByUserSpecifiedInZoneProps) => void;
10
+ onChangeCenterPlace: (value: Place) => void;
11
+ onChangeRecomendPlaces: (value: Place[]) => void;
10
12
  }
11
13
  export declare const useBusinessRecomendPlaceMap: () => {
12
14
  mapContext: BusinessRecomendPlaceContext;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@heycar/heycars-map",
3
- "version": "0.8.1",
3
+ "version": "0.8.2",
4
4
  "type": "module",
5
5
  "scripts": {
6
6
  "dev": "vite -c vite.config.dev.ts",