@foundbyte/uni-libs 1.0.4-alpha.1 → 1.0.5

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.
@@ -1,11 +1,8 @@
1
- import { __toESM } from "../../_virtual/rolldown_runtime.js";
2
1
  import { EAppEnv } from "../../enums/environment/index.js";
3
- import { require_objectSpread2 } from "../../node_modules/.pnpm/@oxc-project_runtime@0.72.3/node_modules/@oxc-project/runtime/src/helpers/objectSpread2.js";
4
2
  import app_hwtest_default from "./app.hwtest.js";
5
3
  import app_prod_default from "./app.prod.js";
6
4
 
7
5
  //#region src/configs/app/index.ts
8
- var import_objectSpread2 = __toESM(require_objectSpread2(), 1);
9
6
  /**
10
7
  * 获取App配置信息
11
8
  * @param appEnv
@@ -20,12 +17,15 @@ function getAppConfig(appEnv) {
20
17
  config = app_prod_default;
21
18
  break;
22
19
  }
23
- return (0, import_objectSpread2.default)({ domain: {
24
- shopping: "",
25
- food: "",
26
- onebuygz: "",
27
- movie: ""
28
- } }, config);
20
+ return {
21
+ domain: {
22
+ shopping: "",
23
+ food: "",
24
+ onebuygz: "",
25
+ movie: ""
26
+ },
27
+ ...config
28
+ };
29
29
  }
30
30
 
31
31
  //#endregion
package/es/entry.js CHANGED
@@ -1,25 +1,21 @@
1
- import { __toESM } from "./_virtual/rolldown_runtime.js";
2
1
  import { EAppEnv } from "./enums/environment/index.js";
3
2
  import { ECaller } from "./enums/sdk/index.js";
4
- import { require_defineProperty } from "./node_modules/.pnpm/@oxc-project_runtime@0.72.3/node_modules/@oxc-project/runtime/src/helpers/defineProperty.js";
5
- import { require_objectSpread2 } from "./node_modules/.pnpm/@oxc-project_runtime@0.72.3/node_modules/@oxc-project/runtime/src/helpers/objectSpread2.js";
6
3
  import { getAppConfig } from "./configs/app/index.js";
7
4
  import { GoodsService } from "./services/goods/service.js";
8
5
 
9
6
  //#region src/entry.ts
10
- var import_defineProperty = __toESM(require_defineProperty());
11
- var import_objectSpread2 = __toESM(require_objectSpread2());
12
7
  /**
13
8
  * 一码游SDK
14
9
  */
15
10
  var OneTravelSDK = class {
11
+ sdkConfig;
12
+ goodsService;
16
13
  constructor(config) {
17
- (0, import_defineProperty.default)(this, "sdkConfig", void 0);
18
- (0, import_defineProperty.default)(this, "goodsService", void 0);
19
- const value = (0, import_objectSpread2.default)((0, import_objectSpread2.default)({}, {
14
+ const value = {
20
15
  appEnv: EAppEnv.prod,
21
- caller: ECaller.web
22
- }), config || {});
16
+ caller: ECaller.web,
17
+ ...config || {}
18
+ };
23
19
  this.sdkConfig = value;
24
20
  this.goodsService = new GoodsService({ sdkConfig: value });
25
21
  }
@@ -1,4 +1,3 @@
1
- import { __toESM } from "../../_virtual/rolldown_runtime.js";
2
1
  import { routePrefix } from "../../constants/routes/index.js";
3
2
  import { EBusinessLine, ESubBizType } from "../../enums/business-line/index.js";
4
3
  import { ECaller } from "../../enums/sdk/index.js";
@@ -8,143 +7,118 @@ import { EHotelType } from "../../enums/sub/hotel/index.js";
8
7
  import { getWebviewPage } from "../../utils/pages/webview/index.js";
9
8
  import { getFoodPackagePage, getFoodStorePage } from "../../utils/pages/food/index.js";
10
9
  import { getMoviePage } from "../../utils/pages/movie/index.js";
11
- import { require_defineProperty } from "../../node_modules/.pnpm/@oxc-project_runtime@0.72.3/node_modules/@oxc-project/runtime/src/helpers/defineProperty.js";
12
10
  import { navigateTo } from "../../utils/web-view/index.js";
13
11
  import { getAppConfig } from "../../configs/app/index.js";
14
12
 
15
13
  //#region src/services/goods/service.ts
16
- var import_defineProperty = __toESM(require_defineProperty(), 1);
17
14
  var GoodsService = class {
15
+ goodsServiceConfig;
18
16
  constructor(config) {
19
- (0, import_defineProperty.default)(this, "goodsServiceConfig", void 0);
20
- (0, import_defineProperty.default)(
21
- this,
22
- /**
23
- * 跳转商品详情页面
24
- * @param item 商品数据
25
- */
26
- "jumpToProductDetailPage",
27
- (item) => {
28
- var _item$common, _item$common2, _item$common3, _item$common4, _item$common5;
29
- const configOptions = this.goodsServiceConfig.sdkConfig;
30
- const appConfig = getAppConfig(configOptions.appEnv);
31
- let page = "";
32
- const businessLine = (item === null || item === void 0 ? void 0 : item.businessLine) || (item === null || item === void 0 || (_item$common = item.common) === null || _item$common === void 0 ? void 0 : _item$common.bizType) || (item === null || item === void 0 || (_item$common2 = item.common) === null || _item$common2 === void 0 ? void 0 : _item$common2.linkBusinessLine) || (item === null || item === void 0 || (_item$common3 = item.common) === null || _item$common3 === void 0 ? void 0 : _item$common3.businessType);
33
- const extInfo = (item === null || item === void 0 || (_item$common4 = item.common) === null || _item$common4 === void 0 ? void 0 : _item$common4.extInfoMap) || (item === null || item === void 0 || (_item$common5 = item.common) === null || _item$common5 === void 0 ? void 0 : _item$common5.extInfo);
34
- switch (businessLine) {
35
- case EBusinessLine.Scenic:
36
- var _item$scenic, _item$common6, _item$common7, _item$scenic2, _item$common8, _item$scenic3;
37
- const scenicId = (item === null || item === void 0 || (_item$scenic = item.scenic) === null || _item$scenic === void 0 ? void 0 : _item$scenic.id) || (item === null || item === void 0 || (_item$common6 = item.common) === null || _item$common6 === void 0 ? void 0 : _item$common6.spuId) || (item === null || item === void 0 || (_item$common7 = item.common) === null || _item$common7 === void 0 ? void 0 : _item$common7.id) || "";
38
- const scenicReservationId = (item === null || item === void 0 || (_item$scenic2 = item.scenic) === null || _item$scenic2 === void 0 ? void 0 : _item$scenic2.reservationId) || (extInfo === null || extInfo === void 0 ? void 0 : extInfo.reservationId) || (item === null || item === void 0 || (_item$common8 = item.common) === null || _item$common8 === void 0 ? void 0 : _item$common8.reservationId) || "";
39
- const scenicIsOld = (item === null || item === void 0 || (_item$scenic3 = item.scenic) === null || _item$scenic3 === void 0 ? void 0 : _item$scenic3.isOld) || (extInfo === null || extInfo === void 0 ? void 0 : extInfo.isOld);
40
- page = `${routePrefix.ticket}/detail/index?scenicId=${scenicId}&reservationId=${scenicReservationId}&isOld=${scenicIsOld}`;
41
- break;
42
- case EBusinessLine.Hotel:
43
- var _item$hotel, _item$common9;
44
- const hotelId = (item === null || item === void 0 || (_item$hotel = item.hotel) === null || _item$hotel === void 0 ? void 0 : _item$hotel.id) || (extInfo === null || extInfo === void 0 ? void 0 : extInfo.storeId) || (item === null || item === void 0 || (_item$common9 = item.common) === null || _item$common9 === void 0 ? void 0 : _item$common9.storeId) || "";
45
- page = `${routePrefix.hotel}/home/details/index?id=${hotelId}`;
46
- break;
47
- case EBusinessLine.Homestay:
48
- var _item$homestay, _item$common10;
49
- const homestayType = (item === null || item === void 0 || (_item$homestay = item.homestay) === null || _item$homestay === void 0 ? void 0 : _item$homestay.type) || (extInfo === null || extInfo === void 0 ? void 0 : extInfo.type) || (item === null || item === void 0 || (_item$common10 = item.common) === null || _item$common10 === void 0 ? void 0 : _item$common10.type) || "";
50
- if (homestayType === EHotelType.hotel) {
51
- var _item$homestay2, _item$common11;
52
- /** 酒店 (天下房仓酒店详情页) */
53
- const id = (item === null || item === void 0 || (_item$homestay2 = item.homestay) === null || _item$homestay2 === void 0 ? void 0 : _item$homestay2.id) || (extInfo === null || extInfo === void 0 ? void 0 : extInfo.storeId) || (item === null || item === void 0 || (_item$common11 = item.common) === null || _item$common11 === void 0 ? void 0 : _item$common11.storeId) || "";
54
- page = `${routePrefix.hotel}/home/details/index?id=${id}`;
55
- } else {
56
- var _item$homestay3, _item$homestay4, _item$common12, _item$common13;
57
- const subBizType = (item === null || item === void 0 || (_item$homestay3 = item.homestay) === null || _item$homestay3 === void 0 ? void 0 : _item$homestay3.subBizType) || (extInfo === null || extInfo === void 0 ? void 0 : extInfo.subBizType);
58
- const id = (item === null || item === void 0 || (_item$homestay4 = item.homestay) === null || _item$homestay4 === void 0 ? void 0 : _item$homestay4.id) || (item === null || item === void 0 || (_item$common12 = item.common) === null || _item$common12 === void 0 ? void 0 : _item$common12.spuId) || (item === null || item === void 0 || (_item$common13 = item.common) === null || _item$common13 === void 0 ? void 0 : _item$common13.id) || "";
59
- /** 民宿 */
60
- if (`${subBizType}` === `${ESubBizType.HomestayHotel}`) page = `${routePrefix.hotel}/home/details/index?id=${id}`;
61
- else if (`${subBizType}` === `${ESubBizType.HomestayHot}`) page = `${routePrefix.hotel}/home/hot-sale-details/index?id=${id}`;
62
- else page = `${routePrefix.hotel}/home/pms-details/index?id=${id}`;
63
- }
64
- break;
65
- case EBusinessLine.Route:
66
- var _item$route, _item$common14, _item$common15;
67
- const routeId = (item === null || item === void 0 || (_item$route = item.route) === null || _item$route === void 0 ? void 0 : _item$route.id) || (item === null || item === void 0 || (_item$common14 = item.common) === null || _item$common14 === void 0 ? void 0 : _item$common14.spuId) || (item === null || item === void 0 || (_item$common15 = item.common) === null || _item$common15 === void 0 ? void 0 : _item$common15.id);
68
- page = `${routePrefix.road}/product-detail/index?id=${routeId}`;
69
- break;
70
- case EBusinessLine.Travel:
71
- var _item$travel, _item$common16, _item$common17;
72
- const travelId = (item === null || item === void 0 || (_item$travel = item.travel) === null || _item$travel === void 0 ? void 0 : _item$travel.id) || (item === null || item === void 0 || (_item$common16 = item.common) === null || _item$common16 === void 0 ? void 0 : _item$common16.spuId) || (item === null || item === void 0 || (_item$common17 = item.common) === null || _item$common17 === void 0 ? void 0 : _item$common17.id);
73
- page = `${routePrefix.travel}/charter/detail?routeId=${travelId}`;
74
- break;
75
- case EBusinessLine.Buy:
76
- var _item$buy, _item$common18, _item$common19;
77
- const buySpuId = (item === null || item === void 0 || (_item$buy = item.buy) === null || _item$buy === void 0 ? void 0 : _item$buy.spuId) || (item === null || item === void 0 || (_item$common18 = item.common) === null || _item$common18 === void 0 ? void 0 : _item$common18.spuId) || (item === null || item === void 0 || (_item$common19 = item.common) === null || _item$common19 === void 0 ? void 0 : _item$common19.id);
78
- page = getWebviewPage({ url: appConfig.domain.shopping + `goods?itemId=${buySpuId}` });
79
- break;
80
- case EBusinessLine.Onebuygz:
81
- var _item$onebuygz, _item$common20, _item$common21, _item$onebuygz2, _item$common22;
82
- const onebuySpuId = (item === null || item === void 0 || (_item$onebuygz = item.onebuygz) === null || _item$onebuygz === void 0 ? void 0 : _item$onebuygz.spuId) || (item === null || item === void 0 || (_item$common20 = item.common) === null || _item$common20 === void 0 ? void 0 : _item$common20.spuId) || (item === null || item === void 0 || (_item$common21 = item.common) === null || _item$common21 === void 0 ? void 0 : _item$common21.id);
83
- const onebuySkuId = (item === null || item === void 0 || (_item$onebuygz2 = item.onebuygz) === null || _item$onebuygz2 === void 0 ? void 0 : _item$onebuygz2.skuId) || (item === null || item === void 0 || (_item$common22 = item.common) === null || _item$common22 === void 0 ? void 0 : _item$common22.skuId);
84
- page = getWebviewPage({ url: appConfig.domain.onebuygz + `pages/commodity-detail/index?itemId=${onebuySpuId}&skuId=${onebuySkuId}` });
85
- break;
86
- case EBusinessLine.Foods:
87
- var _item$food, _item$food2, _item$common23, _item$food3, _item$common24, _item$common25, _item$food4;
88
- const moduleType = (item === null || item === void 0 || (_item$food = item.food) === null || _item$food === void 0 ? void 0 : _item$food.moduleType) || (extInfo === null || extInfo === void 0 ? void 0 : extInfo.moduleType);
89
- const storeId = (item === null || item === void 0 || (_item$food2 = item.food) === null || _item$food2 === void 0 ? void 0 : _item$food2.storeId) || (extInfo === null || extInfo === void 0 ? void 0 : extInfo.storeId) || (item === null || item === void 0 || (_item$common23 = item.common) === null || _item$common23 === void 0 ? void 0 : _item$common23.storeId) || "";
90
- const spuId = (item === null || item === void 0 || (_item$food3 = item.food) === null || _item$food3 === void 0 ? void 0 : _item$food3.spuId) || (item === null || item === void 0 || (_item$common24 = item.common) === null || _item$common24 === void 0 ? void 0 : _item$common24.spuId) || (item === null || item === void 0 || (_item$common25 = item.common) === null || _item$common25 === void 0 ? void 0 : _item$common25.id) || "";
91
- const storePrecedentType = (item === null || item === void 0 || (_item$food4 = item.food) === null || _item$food4 === void 0 ? void 0 : _item$food4.storePrecedentType) || (extInfo === null || extInfo === void 0 ? void 0 : extInfo.storePrecedentType) || void 0;
92
- if (moduleType === EFoodsModuleType.store)
93
- /** 收藏跳店铺 */
94
- page = getWebviewPage({ url: getFoodStorePage(appConfig.domain.food, storeId) });
95
- else
96
- /** 跳转套餐 */
97
- page = getWebviewPage({ url: getFoodPackagePage(appConfig.domain.food, storeId, spuId, storePrecedentType) });
98
- break;
99
- case EBusinessLine.Entertainment:
100
- var _item$entertainment, _item$common26, _item$common27, _item$entertainment2, _item$common28, _item$entertainment3, _item$entertainment4, _item$common29, _item$entertainment5, _item$common30;
101
- const entertainmentId = (item === null || item === void 0 || (_item$entertainment = item.entertainment) === null || _item$entertainment === void 0 ? void 0 : _item$entertainment.id) || (item === null || item === void 0 || (_item$common26 = item.common) === null || _item$common26 === void 0 ? void 0 : _item$common26.spuId) || (item === null || item === void 0 || (_item$common27 = item.common) === null || _item$common27 === void 0 ? void 0 : _item$common27.id);
102
- const entertainmentStoreId = (item === null || item === void 0 || (_item$entertainment2 = item.entertainment) === null || _item$entertainment2 === void 0 ? void 0 : _item$entertainment2.storeId) || (extInfo === null || extInfo === void 0 ? void 0 : extInfo.storeId) || (item === null || item === void 0 || (_item$common28 = item.common) === null || _item$common28 === void 0 ? void 0 : _item$common28.storeId) || "";
103
- const entertainmentSubBizType = (item === null || item === void 0 || (_item$entertainment3 = item.entertainment) === null || _item$entertainment3 === void 0 ? void 0 : _item$entertainment3.subBizType) || (extInfo === null || extInfo === void 0 ? void 0 : extInfo.subBizType);
104
- const entertainmentType = (item === null || item === void 0 || (_item$entertainment4 = item.entertainment) === null || _item$entertainment4 === void 0 ? void 0 : _item$entertainment4.type) || (extInfo === null || extInfo === void 0 ? void 0 : extInfo.type) || (item === null || item === void 0 || (_item$common29 = item.common) === null || _item$common29 === void 0 ? void 0 : _item$common29.type);
105
- const entertainmentReservationId = (item === null || item === void 0 || (_item$entertainment5 = item.entertainment) === null || _item$entertainment5 === void 0 ? void 0 : _item$entertainment5.reservationId) || (extInfo === null || extInfo === void 0 ? void 0 : extInfo.reservationId) || (item === null || item === void 0 || (_item$common30 = item.common) === null || _item$common30 === void 0 ? void 0 : _item$common30.reservationId);
106
- if (`${entertainmentType}` === EVenueSimpleTypes.Activity || `${entertainmentSubBizType}` === `${ESubBizType.EntertainmentPerform}`) page = `${routePrefix.enjoy}/g-activity/detail?id=` + entertainmentId + "&mchId=" + entertainmentStoreId;
107
- else page = `${routePrefix.enjoy}/g-venue/detail?id=${entertainmentId}&reservationId=${entertainmentReservationId}`;
108
- break;
109
- case EBusinessLine.Movie:
110
- var _item$movie;
111
- let movieId = (item === null || item === void 0 || (_item$movie = item.movie) === null || _item$movie === void 0 ? void 0 : _item$movie.id) || "";
112
- try {
113
- var _JSON$parse;
114
- movieId = ((_JSON$parse = JSON.parse((extInfo === null || extInfo === void 0 ? void 0 : extInfo.extInfo) || "{}")) === null || _JSON$parse === void 0 ? void 0 : _JSON$parse.thirdMovieId) || "";
115
- } catch (_unused) {}
116
- page = getMoviePage(appConfig.domain.movie, movieId);
117
- break;
118
- case EBusinessLine.Strategy:
119
- var _item$strategy, _item$common31, _item$common32;
120
- const strategyId = (item === null || item === void 0 || (_item$strategy = item.strategy) === null || _item$strategy === void 0 ? void 0 : _item$strategy.id) || (item === null || item === void 0 || (_item$common31 = item.common) === null || _item$common31 === void 0 ? void 0 : _item$common31.spuId) || (item === null || item === void 0 || (_item$common32 = item.common) === null || _item$common32 === void 0 ? void 0 : _item$common32.id);
121
- page = `${routePrefix.strategy}/strategy-detail/index?id=` + strategyId;
122
- break;
123
- case EBusinessLine.Recommend:
124
- var _item$recommend, _item$common33, _item$common34, _item$recommend2;
125
- const recommendId = (item === null || item === void 0 || (_item$recommend = item.recommend) === null || _item$recommend === void 0 ? void 0 : _item$recommend.id) || (item === null || item === void 0 || (_item$common33 = item.common) === null || _item$common33 === void 0 ? void 0 : _item$common33.spuId) || (item === null || item === void 0 || (_item$common34 = item.common) === null || _item$common34 === void 0 ? void 0 : _item$common34.id);
126
- const recommendMoreParameter = (item === null || item === void 0 || (_item$recommend2 = item.recommend) === null || _item$recommend2 === void 0 ? void 0 : _item$recommend2.moreParameter) || (extInfo === null || extInfo === void 0 ? void 0 : extInfo.moreParameter) || "";
127
- page = `${routePrefix.show}/details/index?id=${recommendId}${recommendMoreParameter}`;
128
- break;
129
- case EBusinessLine.SoundGuizhou:
130
- var _item$soundGuizhou, _item$common35, _item$common36;
131
- const soundGuizhouId = (item === null || item === void 0 || (_item$soundGuizhou = item.soundGuizhou) === null || _item$soundGuizhou === void 0 ? void 0 : _item$soundGuizhou.id) || (item === null || item === void 0 || (_item$common35 = item.common) === null || _item$common35 === void 0 ? void 0 : _item$common35.spuId) || (item === null || item === void 0 || (_item$common36 = item.common) === null || _item$common36 === void 0 ? void 0 : _item$common36.id);
132
- page = `${routePrefix.soundGuizhou}/detail?audioLibId=${soundGuizhouId}`;
133
- break;
134
- case EBusinessLine.ExcitingVideo:
135
- var _item$excitingVideo, _item$common37, _item$common38;
136
- const excitingVideoId = (item === null || item === void 0 || (_item$excitingVideo = item.excitingVideo) === null || _item$excitingVideo === void 0 ? void 0 : _item$excitingVideo.id) || (item === null || item === void 0 || (_item$common37 = item.common) === null || _item$common37 === void 0 ? void 0 : _item$common37.spuId) || (item === null || item === void 0 || (_item$common38 = item.common) === null || _item$common38 === void 0 ? void 0 : _item$common38.id);
137
- page = `${routePrefix.living}/wonderful-video/index?vid=${excitingVideoId}`;
138
- break;
139
- default: break;
140
- }
141
- if (!page) return;
142
- if (configOptions.caller === ECaller.web) navigateTo({ src: page });
143
- else if (configOptions.caller === ECaller.host) uni.navigateTo({ url: page });
144
- }
145
- );
146
17
  this.goodsServiceConfig = config;
147
18
  }
19
+ /**
20
+ * 跳转商品详情页面
21
+ * @param item 商品数据
22
+ */
23
+ jumpToProductDetailPage = (item) => {
24
+ const configOptions = this.goodsServiceConfig.sdkConfig;
25
+ const appConfig = getAppConfig(configOptions.appEnv);
26
+ let page = "";
27
+ const businessLine = item?.businessLine || item?.common?.bizType || item?.common?.linkBusinessLine || item?.common?.businessType;
28
+ const extInfo = item?.common?.extInfoMap || item?.common?.extInfo;
29
+ switch (businessLine) {
30
+ case EBusinessLine.Scenic:
31
+ const scenicId = item?.scenic?.id || item?.common?.spuId || item?.common?.id || "";
32
+ const scenicReservationId = item?.scenic?.reservationId || extInfo?.reservationId || item?.common?.reservationId || "";
33
+ const scenicIsOld = item?.scenic?.isOld || extInfo?.isOld;
34
+ page = `${routePrefix.ticket}/detail/index?scenicId=${scenicId}&reservationId=${scenicReservationId}&isOld=${scenicIsOld}`;
35
+ break;
36
+ case EBusinessLine.Hotel:
37
+ const hotelId = item?.hotel?.id || extInfo?.storeId || item?.common?.storeId || "";
38
+ page = `${routePrefix.hotel}/home/details/index?id=${hotelId}`;
39
+ break;
40
+ case EBusinessLine.Homestay:
41
+ if ((item?.homestay?.type || extInfo?.type || item?.common?.type || "") === EHotelType.hotel) {
42
+ /** 酒店 (天下房仓酒店详情页) */
43
+ const id = item?.homestay?.id || extInfo?.storeId || item?.common?.storeId || "";
44
+ page = `${routePrefix.hotel}/home/details/index?id=${id}`;
45
+ } else {
46
+ const subBizType = item?.homestay?.subBizType || extInfo?.subBizType;
47
+ const id = item?.homestay?.id || item?.common?.spuId || item?.common?.id || "";
48
+ /** 民宿 */
49
+ if (`${subBizType}` === `${ESubBizType.HomestayHotel}`) page = `${routePrefix.hotel}/home/details/index?id=${id}`;
50
+ else if (`${subBizType}` === `${ESubBizType.HomestayHot}`) page = `${routePrefix.hotel}/home/hot-sale-details/index?id=${id}`;
51
+ else page = `${routePrefix.hotel}/home/pms-details/index?id=${id}`;
52
+ }
53
+ break;
54
+ case EBusinessLine.Route:
55
+ const routeId = item?.route?.id || item?.common?.spuId || item?.common?.id;
56
+ page = `${routePrefix.road}/product-detail/index?id=${routeId}`;
57
+ break;
58
+ case EBusinessLine.Travel:
59
+ const travelId = item?.travel?.id || item?.common?.spuId || item?.common?.id;
60
+ page = `${routePrefix.travel}/charter/detail?routeId=${travelId}`;
61
+ break;
62
+ case EBusinessLine.Buy:
63
+ const buySpuId = item?.buy?.spuId || item?.common?.spuId || item?.common?.id;
64
+ page = getWebviewPage({ url: appConfig.domain.shopping + `goods?itemId=${buySpuId}` });
65
+ break;
66
+ case EBusinessLine.Onebuygz:
67
+ const onebuySpuId = item?.onebuygz?.spuId || item?.common?.spuId || item?.common?.id;
68
+ const onebuySkuId = item?.onebuygz?.skuId || item?.common?.skuId;
69
+ page = getWebviewPage({ url: appConfig.domain.onebuygz + `pages/commodity-detail/index?itemId=${onebuySpuId}&skuId=${onebuySkuId}` });
70
+ break;
71
+ case EBusinessLine.Foods:
72
+ const moduleType = item?.food?.moduleType || extInfo?.moduleType;
73
+ const storeId = item?.food?.storeId || extInfo?.storeId || item?.common?.storeId || "";
74
+ const spuId = item?.food?.spuId || item?.common?.spuId || item?.common?.id || "";
75
+ const storePrecedentType = item?.food?.storePrecedentType || extInfo?.storePrecedentType || void 0;
76
+ if (moduleType === EFoodsModuleType.store)
77
+ /** 收藏跳店铺 */
78
+ page = getWebviewPage({ url: getFoodStorePage(appConfig.domain.food, storeId) });
79
+ else
80
+ /** 跳转套餐 */
81
+ page = getWebviewPage({ url: getFoodPackagePage(appConfig.domain.food, storeId, spuId, storePrecedentType) });
82
+ break;
83
+ case EBusinessLine.Entertainment:
84
+ const entertainmentId = item?.entertainment?.id || item?.common?.spuId || item?.common?.id;
85
+ const entertainmentStoreId = item?.entertainment?.storeId || extInfo?.storeId || item?.common?.storeId || "";
86
+ const entertainmentSubBizType = item?.entertainment?.subBizType || extInfo?.subBizType;
87
+ const entertainmentType = item?.entertainment?.type || extInfo?.type || item?.common?.type;
88
+ const entertainmentReservationId = item?.entertainment?.reservationId || extInfo?.reservationId || item?.common?.reservationId;
89
+ if (`${entertainmentType}` === EVenueSimpleTypes.Activity || `${entertainmentSubBizType}` === `${ESubBizType.EntertainmentPerform}`) page = `${routePrefix.enjoy}/g-activity/detail?id=` + entertainmentId + "&mchId=" + entertainmentStoreId;
90
+ else page = `${routePrefix.enjoy}/g-venue/detail?id=${entertainmentId}&reservationId=${entertainmentReservationId}`;
91
+ break;
92
+ case EBusinessLine.Movie:
93
+ let movieId = item?.movie?.id || "";
94
+ try {
95
+ movieId = JSON.parse(extInfo?.extInfo || "{}")?.thirdMovieId || "";
96
+ } catch {}
97
+ page = getMoviePage(appConfig.domain.movie, movieId);
98
+ break;
99
+ case EBusinessLine.Strategy:
100
+ const strategyId = item?.strategy?.id || item?.common?.spuId || item?.common?.id;
101
+ page = `${routePrefix.strategy}/strategy-detail/index?id=` + strategyId;
102
+ break;
103
+ case EBusinessLine.Recommend:
104
+ const recommendId = item?.recommend?.id || item?.common?.spuId || item?.common?.id;
105
+ const recommendMoreParameter = item?.recommend?.moreParameter || extInfo?.moreParameter || "";
106
+ page = `${routePrefix.show}/details/index?id=${recommendId}${recommendMoreParameter}`;
107
+ break;
108
+ case EBusinessLine.SoundGuizhou:
109
+ const soundGuizhouId = item?.soundGuizhou?.id || item?.common?.spuId || item?.common?.id;
110
+ page = `${routePrefix.soundGuizhou}/detail?audioLibId=${soundGuizhouId}`;
111
+ break;
112
+ case EBusinessLine.ExcitingVideo:
113
+ const excitingVideoId = item?.excitingVideo?.id || item?.common?.spuId || item?.common?.id;
114
+ page = `${routePrefix.living}/wonderful-video/index?vid=${excitingVideoId}`;
115
+ break;
116
+ default: break;
117
+ }
118
+ if (!page) return;
119
+ if (configOptions.caller === ECaller.web) navigateTo({ src: page });
120
+ else if (configOptions.caller === ECaller.host) uni.navigateTo({ url: page });
121
+ };
148
122
  };
149
123
 
150
124
  //#endregion
@@ -1,121 +1,121 @@
1
- import { EBusinessLine, ESubBizType } from "../../enums/business-line/index.js";
2
- import { EFoodPackageType, EFoodsModuleType } from "../../enums/sub/foods/index.js";
1
+ import { EBusinessLine, ESubBizType } from '../../enums/business-line/index.js'
2
+ import { EFoodPackageType, EFoodsModuleType } from '../../enums/sub/foods/index.js'
3
3
 
4
- //#region src/services/goods/type.d.ts
4
+ // #region src/services/goods/type.d.ts
5
5
  type IJumpProductDetailItemCommonExtInfo = {
6
- reservationId?: string;
7
- type?: 'hotel' | '1' | '3';
8
- storeId?: string;
9
- subBizType?: ESubBizType;
6
+ reservationId?: string
7
+ type?: 'hotel' | '1' | '3'
8
+ storeId?: string
9
+ subBizType?: ESubBizType
10
10
  /** ********** 景区相关字段 ************/
11
- isOld?: number;
11
+ isOld?: number
12
12
  /** ********** 景区相关字段 ************/
13
13
  /** ********** 美食相关字段 ************/
14
- storePrecedentType?: EFoodPackageType;
15
- moduleType?: EFoodsModuleType;
14
+ storePrecedentType?: EFoodPackageType
15
+ moduleType?: EFoodsModuleType
16
16
  /** ********** 美食相关字段 ************/
17
17
  /** ********** 种草相关字段 ************/
18
- moreParameter?: string;
18
+ moreParameter?: string
19
19
  /** ********** 种草相关字段 ************/
20
20
  /** ********** 电影相关字段 ************/
21
- extInfo: string;
22
- };
21
+ extInfo: string
22
+ }
23
23
  /**
24
24
  * 商品数据
25
25
  */
26
26
  type IJumpProductDetailItem = {
27
27
  /** 业务线(如果是common字段,则不用传,没有common必传) */
28
- businessLine?: EBusinessLine;
28
+ businessLine?: EBusinessLine
29
29
  /** 通用数据-(包含装修数据文本导航、商品组件) */
30
30
  common?: {
31
31
  /** 业务线字段(可能是三个中的一个) */
32
- bizType?: EBusinessLine;
33
- linkBusinessLine?: EBusinessLine;
34
- businessType?: EBusinessLine;
32
+ bizType?: EBusinessLine
33
+ linkBusinessLine?: EBusinessLine
34
+ businessType?: EBusinessLine
35
35
  /** skuId 字段 */
36
- skuId: string;
36
+ skuId: string
37
37
  /** spuId */
38
- spuId: string;
38
+ spuId: string
39
39
  /** ****** 收藏、搜索等(优先取扩展字段里面的) ********/
40
- id?: string;
41
- storeId?: string;
42
- type?: 'hotel' | '1' | '3';
43
- reservationId?: string;
40
+ id?: string
41
+ storeId?: string
42
+ type?: 'hotel' | '1' | '3'
43
+ reservationId?: string
44
44
  /** ****** 收藏、搜索等 ********/
45
45
  /** 扩展字段 */
46
- extInfo?: IJumpProductDetailItemCommonExtInfo;
46
+ extInfo?: IJumpProductDetailItemCommonExtInfo
47
47
  /** 扩展字段 */
48
- extInfoMap?: IJumpProductDetailItemCommonExtInfo;
49
- };
48
+ extInfoMap?: IJumpProductDetailItemCommonExtInfo
49
+ }
50
50
  /** 景区门票 */
51
51
  scenic?: {
52
- id: string;
53
- reservationId?: string;
54
- isOld?: number;
55
- };
52
+ id: string
53
+ reservationId?: string
54
+ isOld?: number
55
+ }
56
56
  /** 酒店 */
57
57
  hotel?: {
58
- id: string;
59
- };
58
+ id: string
59
+ }
60
60
  /** 名宿 */
61
61
  homestay?: {
62
- id: string;
63
- type?: 'hotel';
64
- subBizType?: ESubBizType;
65
- };
62
+ id: string
63
+ type?: 'hotel'
64
+ subBizType?: ESubBizType
65
+ }
66
66
  /** 路线/定制 */
67
67
  route?: {
68
- id: string;
69
- };
68
+ id: string
69
+ }
70
70
  /** 出行 */
71
71
  travel?: {
72
- id: string;
73
- };
72
+ id: string
73
+ }
74
74
  /** 购物 */
75
75
  buy?: {
76
- spuId: string;
77
- };
76
+ spuId: string
77
+ }
78
78
  /** 购物(新) */
79
79
  onebuygz?: {
80
- spuId: string;
81
- skuId: string;
82
- };
80
+ spuId: string
81
+ skuId: string
82
+ }
83
83
  /** 美食 */
84
84
  food?: {
85
- storeId: string;
86
- spuId?: string;
87
- moduleType?: EFoodsModuleType;
88
- storePrecedentType?: EFoodPackageType;
89
- };
85
+ storeId: string
86
+ spuId?: string
87
+ moduleType?: EFoodsModuleType
88
+ storePrecedentType?: EFoodPackageType
89
+ }
90
90
  /** 电影 */
91
91
  movie?: {
92
- id: string;
93
- };
92
+ id: string
93
+ }
94
94
  /** 文娱 */
95
95
  entertainment?: {
96
- id: string;
97
- type?: string;
98
- subBizType?: ESubBizType;
99
- storeId?: string;
100
- reservationId?: string;
101
- };
96
+ id: string
97
+ type?: string
98
+ subBizType?: ESubBizType
99
+ storeId?: string
100
+ reservationId?: string
101
+ }
102
102
  /** 攻略 */
103
103
  strategy?: {
104
- id: string;
105
- };
104
+ id: string
105
+ }
106
106
  /** 种草 */
107
107
  recommend?: {
108
- id: string;
109
- moreParameter?: string;
110
- };
108
+ id: string
109
+ moreParameter?: string
110
+ }
111
111
  /** 声入贵州 */
112
112
  soundGuizhou?: {
113
- id: string;
114
- };
113
+ id: string
114
+ }
115
115
  /** 精彩视频 */
116
116
  excitingVideo?: {
117
- id: string;
118
- };
119
- };
120
- //#endregion
121
- export { IJumpProductDetailItem };
117
+ id: string
118
+ }
119
+ }
120
+ // #endregion
121
+ export { IJumpProductDetailItem }
@@ -33,7 +33,7 @@ function getQueryParameters(url) {
33
33
  let value = decodeURIComponent(pair[1] || "");
34
34
  try {
35
35
  value = JSON.parse(value);
36
- } catch (_unused) {}
36
+ } catch {}
37
37
  params[key] = value;
38
38
  }
39
39
  }
@@ -62,7 +62,7 @@ const showAndroidTip = (options) => {
62
62
  const checkAndRequestNativeAppPermission = (options) => {
63
63
  const { type, success, fail } = options || {};
64
64
  if (isWeixinEnv() || isH5Env() || isHarmonyEnv() || isiOSEnv()) {
65
- success === null || success === void 0 || success();
65
+ success?.();
66
66
  return;
67
67
  }
68
68
  const ActivityCompat = plus.android.importClass("androidx.core.app.ActivityCompat");
@@ -77,19 +77,19 @@ const checkAndRequestNativeAppPermission = (options) => {
77
77
  }
78
78
  });
79
79
  if (!hasPermission) {
80
- success === null || success === void 0 || success();
80
+ success?.();
81
81
  return;
82
82
  }
83
83
  showAndroidTip(detail);
84
84
  plus.android.requestPermissions(detail.permissionId, function(resultObj) {
85
85
  if (resultObj.granted.length > 0) {
86
86
  closeAndroidTip();
87
- success === null || success === void 0 || success();
87
+ success?.();
88
88
  return;
89
89
  }
90
90
  if (resultObj.deniedPresent.length > 0) {
91
91
  closeAndroidTip();
92
- fail === null || fail === void 0 || fail();
92
+ fail?.();
93
93
  return;
94
94
  }
95
95
  if (resultObj.deniedAlways.length > 0) {
@@ -99,15 +99,15 @@ const checkAndRequestNativeAppPermission = (options) => {
99
99
  confirmText: "去设置",
100
100
  success: function(res) {
101
101
  closeAndroidTip();
102
- if (res.confirm) uni.openAppAuthorizeSetting({ success: () => fail === null || fail === void 0 ? void 0 : fail() });
103
- if (res.cancel) fail === null || fail === void 0 || fail();
102
+ if (res.confirm) uni.openAppAuthorizeSetting({ success: () => fail?.() });
103
+ if (res.cancel) fail?.();
104
104
  }
105
105
  });
106
106
  return;
107
107
  }
108
108
  }, function() {
109
109
  closeAndroidTip();
110
- fail === null || fail === void 0 || fail();
110
+ fail?.();
111
111
  });
112
112
  };
113
113
 
@@ -1,9 +1,6 @@
1
- import { __toESM } from "../../_virtual/rolldown_runtime.js";
2
1
  import { EUniPlatform } from "../../enums/platform/index.js";
3
- import { require_objectSpread2 } from "../../node_modules/.pnpm/@oxc-project_runtime@0.72.3/node_modules/@oxc-project/runtime/src/helpers/objectSpread2.js";
4
2
 
5
3
  //#region src/utils/uni-env/index.ts
6
- var import_objectSpread2 = __toESM(require_objectSpread2(), 1);
7
4
  /**
8
5
  * 是否是支付宝小程序
9
6
  * @returns
@@ -57,7 +54,10 @@ const isiOSEnv = () => {
57
54
  return false;
58
55
  };
59
56
  function getSystemInfoSync() {
60
- return (0, import_objectSpread2.default)((0, import_objectSpread2.default)({}, uni.getDeviceInfo()), uni.getWindowInfo());
57
+ return {
58
+ ...uni.getDeviceInfo(),
59
+ ...uni.getWindowInfo()
60
+ };
61
61
  }
62
62
 
63
63
  //#endregion
@@ -1,14 +1,6 @@
1
- import { __toESM } from "../../_virtual/rolldown_runtime.js";
2
- import { require_asyncToGenerator } from "../../node_modules/.pnpm/@oxc-project_runtime@0.72.3/node_modules/@oxc-project/runtime/src/helpers/asyncToGenerator.js";
3
- import { require_objectWithoutProperties } from "../../node_modules/.pnpm/@oxc-project_runtime@0.72.3/node_modules/@oxc-project/runtime/src/helpers/objectWithoutProperties.js";
4
- import { require_objectSpread2 } from "../../node_modules/.pnpm/@oxc-project_runtime@0.72.3/node_modules/@oxc-project/runtime/src/helpers/objectSpread2.js";
5
1
  import wx from "weixin-js-sdk";
6
2
 
7
3
  //#region src/utils/web-view/index.ts
8
- var import_asyncToGenerator = __toESM(require_asyncToGenerator(), 1);
9
- var import_objectWithoutProperties = __toESM(require_objectWithoutProperties(), 1);
10
- var import_objectSpread2 = __toESM(require_objectSpread2(), 1);
11
- const _excluded = ["shareUrl"];
12
4
  const userAgent = navigator.userAgent.toLowerCase();
13
5
  /** 判断是否是iOS还是安卓 */
14
6
  const isIOSOrAndroid = !userAgent.includes("miniprogram") && (userAgent.includes("android") || userAgent.includes("iphone") || userAgent.includes("ipad"));
@@ -23,25 +15,14 @@ const isAndroid = !userAgent.includes("miniprogram") && userAgent.includes("andr
23
15
  /** 判断是否苹果APP */
24
16
  const isiOS = !userAgent.includes("miniprogram") && (userAgent.includes("iphone") || userAgent.includes("ipad"));
25
17
  let uni = {};
26
- function loadWebview() {
27
- return _loadWebview.apply(this, arguments);
28
- }
29
- function _loadWebview() {
30
- _loadWebview = (0, import_asyncToGenerator.default)(function* () {
31
- if (isIOSOrAndroid) {
32
- const res = yield import("../../assets/js/webview/uni.webview.1.5.6.js");
33
- uni = res.default;
34
- } else {
35
- const res = yield import("../../assets/js/webview/uni.webview.1.5.5.js");
36
- uni = res.default;
37
- }
38
- if (isAlipay) {
39
- const scriptTag = document.createElement("script");
40
- scriptTag.src = "https://appx/web-view.min.js";
41
- document.head.appendChild(scriptTag);
42
- }
43
- });
44
- return _loadWebview.apply(this, arguments);
18
+ async function loadWebview() {
19
+ if (isIOSOrAndroid) uni = (await import("../../assets/js/webview/uni.webview.1.5.6.js")).default;
20
+ else uni = (await import("../../assets/js/webview/uni.webview.1.5.5.js")).default;
21
+ if (isAlipay) {
22
+ const scriptTag = document.createElement("script");
23
+ scriptTag.src = "https://appx/web-view.min.js";
24
+ document.head.appendChild(scriptTag);
25
+ }
45
26
  }
46
27
  loadWebview();
47
28
  document.addEventListener("UniAppJSBridgeReady", function() {
@@ -64,11 +45,10 @@ const navigateTo = (parameters) => {
64
45
  const { src, params } = parameters;
65
46
  const url = `${src}${params ? `?${objectToQueryString(params)}` : ""}`;
66
47
  try {
67
- var _uni$webView, _uni$webView$navigate, _my;
68
- uni === null || uni === void 0 || (_uni$webView = uni.webView) === null || _uni$webView === void 0 || (_uni$webView$navigate = _uni$webView.navigateTo) === null || _uni$webView$navigate === void 0 || _uni$webView$navigate.call(_uni$webView, { url });
48
+ uni?.webView?.navigateTo?.({ url });
69
49
  /** 不兼容上面的方法会自动往下执行 */
70
50
  wx.miniProgram.navigateTo({ url });
71
- (_my = my) === null || _my === void 0 || _my.navigateTo({ url });
51
+ my?.navigateTo({ url });
72
52
  } catch (error) {
73
53
  console.error(error);
74
54
  }
@@ -81,11 +61,10 @@ const redirectTo = (parameters) => {
81
61
  const { src, params } = parameters;
82
62
  const url = `${src}${params ? `?${objectToQueryString(params)}` : ""}`;
83
63
  try {
84
- var _uni$webView2, _uni$webView2$redirec, _my2;
85
- uni === null || uni === void 0 || (_uni$webView2 = uni.webView) === null || _uni$webView2 === void 0 || (_uni$webView2$redirec = _uni$webView2.redirectTo) === null || _uni$webView2$redirec === void 0 || _uni$webView2$redirec.call(_uni$webView2, { url });
64
+ uni?.webView?.redirectTo?.({ url });
86
65
  /** 不兼容上面的方法会自动往下执行 */
87
66
  wx.miniProgram.redirectTo({ url });
88
- (_my2 = my) === null || _my2 === void 0 || _my2.redirectTo({ url });
67
+ my?.redirectTo({ url });
89
68
  } catch (error) {
90
69
  console.error(error);
91
70
  }
@@ -96,11 +75,10 @@ const redirectTo = (parameters) => {
96
75
  */
97
76
  const navigateBack = (parameters) => {
98
77
  try {
99
- var _uni$webView3, _uni$webView3$navigat, _my3;
100
- uni === null || uni === void 0 || (_uni$webView3 = uni.webView) === null || _uni$webView3 === void 0 || (_uni$webView3$navigat = _uni$webView3.navigateBack) === null || _uni$webView3$navigat === void 0 || _uni$webView3$navigat.call(_uni$webView3, parameters);
78
+ uni?.webView?.navigateBack?.(parameters);
101
79
  /** 不兼容上面的方法会自动往下执行 */
102
80
  wx.miniProgram.navigateBack(parameters);
103
- (_my3 = my) === null || _my3 === void 0 || _my3.navigateBack(parameters);
81
+ my?.navigateBack(parameters);
104
82
  } catch (error) {
105
83
  console.error(error);
106
84
  }
@@ -120,13 +98,11 @@ const postMessage = (data) => {
120
98
  }
121
99
  }
122
100
  try {
123
- var _uni$webView4, _my4;
124
- uni === null || uni === void 0 || (_uni$webView4 = uni.webView) === null || _uni$webView4 === void 0 || _uni$webView4.postMessage({ data });
101
+ uni?.webView?.postMessage({ data });
125
102
  wx.miniProgram.postMessage({ data });
126
- (_my4 = my) === null || _my4 === void 0 || _my4.postMessage({ data });
103
+ my?.postMessage({ data });
127
104
  } catch (error) {
128
- var _message;
129
- if (error === null || error === void 0 || (_message = error.message) === null || _message === void 0 ? void 0 : _message.includes("my is not defined")) return;
105
+ if (error?.message?.includes("my is not defined")) return;
130
106
  console.error(error);
131
107
  }
132
108
  };
@@ -135,11 +111,12 @@ const postMessage = (data) => {
135
111
  * @param data
136
112
  */
137
113
  const setShareParam = (data, businessType) => {
138
- const { shareUrl } = data, res = (0, import_objectWithoutProperties.default)(data, _excluded);
139
- const params = { data: (0, import_objectSpread2.default)((0, import_objectSpread2.default)({}, res), {}, {
114
+ const { shareUrl, ...res } = data;
115
+ const params = { data: {
116
+ ...res,
140
117
  businessType,
141
118
  shareUrl: encodeURIComponent(shareUrl || "")
142
- }) };
119
+ } };
143
120
  postMessage({
144
121
  type: EMessagesType.shareParam,
145
122
  params
@@ -159,11 +136,10 @@ const toPay = (data) => {
159
136
  });
160
137
  };
161
138
  function objectToQueryString(obj) {
162
- const params = Object.entries(obj).map(([key, value]) => {
139
+ return Object.entries(obj).map(([key, value]) => {
163
140
  if (Array.isArray(value)) return value.map((val) => `${encodeURI(key)}[]=${encodeURI(val)}`).join("&");
164
141
  return `${encodeURI(key)}=${encodeURI(value)}`;
165
- });
166
- return params.join("&");
142
+ }).join("&");
167
143
  }
168
144
 
169
145
  //#endregion
package/package.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "name": "@foundbyte/uni-libs",
3
3
  "description": "FoundByte Uni Libs",
4
4
  "author": "yangshuai <704807396@qq.com>",
5
- "version": "1.0.4-alpha.01",
5
+ "version": "1.0.5",
6
6
  "private": false,
7
7
  "type": "module",
8
8
  "main": "es/index.js",
@@ -18,7 +18,8 @@
18
18
  },
19
19
  "sideEffects": false,
20
20
  "dependencies": {
21
- "weixin-js-sdk": "^1.6.5"
21
+ "weixin-js-sdk": "^1.6.5",
22
+ "@foundbyte/uni-hooks": "^1.0.4"
22
23
  },
23
24
  "devDependencies": {
24
25
  "typescript": "~5.7.2",
@@ -1,27 +0,0 @@
1
- //#region rolldown:runtime
2
- var __create = Object.create;
3
- var __defProp = Object.defineProperty;
4
- var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
5
- var __getOwnPropNames = Object.getOwnPropertyNames;
6
- var __getProtoOf = Object.getPrototypeOf;
7
- var __hasOwnProp = Object.prototype.hasOwnProperty;
8
- var __commonJS = (cb, mod) => function() {
9
- return mod || (0, cb[__getOwnPropNames(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports;
10
- };
11
- var __copyProps = (to, from, except, desc) => {
12
- if (from && typeof from === "object" || typeof from === "function") for (var keys = __getOwnPropNames(from), i = 0, n = keys.length, key; i < n; i++) {
13
- key = keys[i];
14
- if (!__hasOwnProp.call(to, key) && key !== except) __defProp(to, key, {
15
- get: ((k) => from[k]).bind(null, key),
16
- enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
17
- });
18
- }
19
- return to;
20
- };
21
- var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", {
22
- value: mod,
23
- enumerable: true
24
- }) : target, mod));
25
-
26
- //#endregion
27
- export { __commonJS, __toESM };
@@ -1,34 +0,0 @@
1
- import { __commonJS } from "../../../../../../../../_virtual/rolldown_runtime.js";
2
-
3
- //#region ../../node_modules/.pnpm/@oxc-project+runtime@0.72.3/node_modules/@oxc-project/runtime/src/helpers/asyncToGenerator.js
4
- var require_asyncToGenerator = __commonJS({ "../../node_modules/.pnpm/@oxc-project+runtime@0.72.3/node_modules/@oxc-project/runtime/src/helpers/asyncToGenerator.js"(exports, module) {
5
- function asyncGeneratorStep(n, t, e, r, o, a, c) {
6
- try {
7
- var i = n[a](c), u = i.value;
8
- } catch (n$1) {
9
- return void e(n$1);
10
- }
11
- i.done ? t(u) : Promise.resolve(u).then(r, o);
12
- }
13
- function _asyncToGenerator(n) {
14
- return function() {
15
- var t = this, e = arguments;
16
- return new Promise(function(r, o) {
17
- var a = n.apply(t, e);
18
- function _next(n$1) {
19
- asyncGeneratorStep(a, r, o, _next, _throw, "next", n$1);
20
- }
21
- function _throw(n$1) {
22
- asyncGeneratorStep(a, r, o, _next, _throw, "throw", n$1);
23
- }
24
- _next(void 0);
25
- });
26
- };
27
- }
28
- module.exports = _asyncToGenerator, module.exports.__esModule = true, module.exports["default"] = module.exports;
29
- } });
30
-
31
- //#endregion
32
- export default require_asyncToGenerator();
33
-
34
- export { require_asyncToGenerator };
@@ -1,21 +0,0 @@
1
- import { __commonJS } from "../../../../../../../../_virtual/rolldown_runtime.js";
2
- import { require_toPropertyKey } from "./toPropertyKey.js";
3
-
4
- //#region ../../node_modules/.pnpm/@oxc-project+runtime@0.72.3/node_modules/@oxc-project/runtime/src/helpers/defineProperty.js
5
- var require_defineProperty = __commonJS({ "../../node_modules/.pnpm/@oxc-project+runtime@0.72.3/node_modules/@oxc-project/runtime/src/helpers/defineProperty.js"(exports, module) {
6
- var toPropertyKey = require_toPropertyKey();
7
- function _defineProperty(e, r, t) {
8
- return (r = toPropertyKey(r)) in e ? Object.defineProperty(e, r, {
9
- value: t,
10
- enumerable: !0,
11
- configurable: !0,
12
- writable: !0
13
- }) : e[r] = t, e;
14
- }
15
- module.exports = _defineProperty, module.exports.__esModule = true, module.exports["default"] = module.exports;
16
- } });
17
-
18
- //#endregion
19
- export default require_defineProperty();
20
-
21
- export { require_defineProperty };
@@ -1,34 +0,0 @@
1
- import { __commonJS } from "../../../../../../../../_virtual/rolldown_runtime.js";
2
- import { require_defineProperty } from "./defineProperty.js";
3
-
4
- //#region ../../node_modules/.pnpm/@oxc-project+runtime@0.72.3/node_modules/@oxc-project/runtime/src/helpers/objectSpread2.js
5
- var require_objectSpread2 = __commonJS({ "../../node_modules/.pnpm/@oxc-project+runtime@0.72.3/node_modules/@oxc-project/runtime/src/helpers/objectSpread2.js"(exports, module) {
6
- var defineProperty = require_defineProperty();
7
- function ownKeys(e, r) {
8
- var t = Object.keys(e);
9
- if (Object.getOwnPropertySymbols) {
10
- var o = Object.getOwnPropertySymbols(e);
11
- r && (o = o.filter(function(r$1) {
12
- return Object.getOwnPropertyDescriptor(e, r$1).enumerable;
13
- })), t.push.apply(t, o);
14
- }
15
- return t;
16
- }
17
- function _objectSpread2(e) {
18
- for (var r = 1; r < arguments.length; r++) {
19
- var t = null != arguments[r] ? arguments[r] : {};
20
- r % 2 ? ownKeys(Object(t), !0).forEach(function(r$1) {
21
- defineProperty(e, r$1, t[r$1]);
22
- }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function(r$1) {
23
- Object.defineProperty(e, r$1, Object.getOwnPropertyDescriptor(t, r$1));
24
- });
25
- }
26
- return e;
27
- }
28
- module.exports = _objectSpread2, module.exports.__esModule = true, module.exports["default"] = module.exports;
29
- } });
30
-
31
- //#endregion
32
- export default require_objectSpread2();
33
-
34
- export { require_objectSpread2 };
@@ -1,22 +0,0 @@
1
- import { __commonJS } from "../../../../../../../../_virtual/rolldown_runtime.js";
2
- import { require_objectWithoutPropertiesLoose } from "./objectWithoutPropertiesLoose.js";
3
-
4
- //#region ../../node_modules/.pnpm/@oxc-project+runtime@0.72.3/node_modules/@oxc-project/runtime/src/helpers/objectWithoutProperties.js
5
- var require_objectWithoutProperties = __commonJS({ "../../node_modules/.pnpm/@oxc-project+runtime@0.72.3/node_modules/@oxc-project/runtime/src/helpers/objectWithoutProperties.js"(exports, module) {
6
- var objectWithoutPropertiesLoose = require_objectWithoutPropertiesLoose();
7
- function _objectWithoutProperties(e, t) {
8
- if (null == e) return {};
9
- var o, r, i = objectWithoutPropertiesLoose(e, t);
10
- if (Object.getOwnPropertySymbols) {
11
- var s = Object.getOwnPropertySymbols(e);
12
- for (r = 0; r < s.length; r++) o = s[r], t.includes(o) || {}.propertyIsEnumerable.call(e, o) && (i[o] = e[o]);
13
- }
14
- return i;
15
- }
16
- module.exports = _objectWithoutProperties, module.exports.__esModule = true, module.exports["default"] = module.exports;
17
- } });
18
-
19
- //#endregion
20
- export default require_objectWithoutProperties();
21
-
22
- export { require_objectWithoutProperties };
@@ -1,20 +0,0 @@
1
- import { __commonJS } from "../../../../../../../../_virtual/rolldown_runtime.js";
2
-
3
- //#region ../../node_modules/.pnpm/@oxc-project+runtime@0.72.3/node_modules/@oxc-project/runtime/src/helpers/objectWithoutPropertiesLoose.js
4
- var require_objectWithoutPropertiesLoose = __commonJS({ "../../node_modules/.pnpm/@oxc-project+runtime@0.72.3/node_modules/@oxc-project/runtime/src/helpers/objectWithoutPropertiesLoose.js"(exports, module) {
5
- function _objectWithoutPropertiesLoose(r, e) {
6
- if (null == r) return {};
7
- var t = {};
8
- for (var n in r) if ({}.hasOwnProperty.call(r, n)) {
9
- if (e.includes(n)) continue;
10
- t[n] = r[n];
11
- }
12
- return t;
13
- }
14
- module.exports = _objectWithoutPropertiesLoose, module.exports.__esModule = true, module.exports["default"] = module.exports;
15
- } });
16
-
17
- //#endregion
18
- export default require_objectWithoutPropertiesLoose();
19
-
20
- export { require_objectWithoutPropertiesLoose };
@@ -1,23 +0,0 @@
1
- import { __commonJS } from "../../../../../../../../_virtual/rolldown_runtime.js";
2
- import { require_typeof } from "./typeof.js";
3
-
4
- //#region ../../node_modules/.pnpm/@oxc-project+runtime@0.72.3/node_modules/@oxc-project/runtime/src/helpers/toPrimitive.js
5
- var require_toPrimitive = __commonJS({ "../../node_modules/.pnpm/@oxc-project+runtime@0.72.3/node_modules/@oxc-project/runtime/src/helpers/toPrimitive.js"(exports, module) {
6
- var _typeof = require_typeof()["default"];
7
- function toPrimitive(t, r) {
8
- if ("object" != _typeof(t) || !t) return t;
9
- var e = t[Symbol.toPrimitive];
10
- if (void 0 !== e) {
11
- var i = e.call(t, r || "default");
12
- if ("object" != _typeof(i)) return i;
13
- throw new TypeError("@@toPrimitive must return a primitive value.");
14
- }
15
- return ("string" === r ? String : Number)(t);
16
- }
17
- module.exports = toPrimitive, module.exports.__esModule = true, module.exports["default"] = module.exports;
18
- } });
19
-
20
- //#endregion
21
- export default require_toPrimitive();
22
-
23
- export { require_toPrimitive };
@@ -1,19 +0,0 @@
1
- import { __commonJS } from "../../../../../../../../_virtual/rolldown_runtime.js";
2
- import { require_typeof } from "./typeof.js";
3
- import { require_toPrimitive } from "./toPrimitive.js";
4
-
5
- //#region ../../node_modules/.pnpm/@oxc-project+runtime@0.72.3/node_modules/@oxc-project/runtime/src/helpers/toPropertyKey.js
6
- var require_toPropertyKey = __commonJS({ "../../node_modules/.pnpm/@oxc-project+runtime@0.72.3/node_modules/@oxc-project/runtime/src/helpers/toPropertyKey.js"(exports, module) {
7
- var _typeof = require_typeof()["default"];
8
- var toPrimitive = require_toPrimitive();
9
- function toPropertyKey(t) {
10
- var i = toPrimitive(t, "string");
11
- return "symbol" == _typeof(i) ? i : i + "";
12
- }
13
- module.exports = toPropertyKey, module.exports.__esModule = true, module.exports["default"] = module.exports;
14
- } });
15
-
16
- //#endregion
17
- export default require_toPropertyKey();
18
-
19
- export { require_toPropertyKey };
@@ -1,19 +0,0 @@
1
- import { __commonJS } from "../../../../../../../../_virtual/rolldown_runtime.js";
2
-
3
- //#region ../../node_modules/.pnpm/@oxc-project+runtime@0.72.3/node_modules/@oxc-project/runtime/src/helpers/typeof.js
4
- var require_typeof = __commonJS({ "../../node_modules/.pnpm/@oxc-project+runtime@0.72.3/node_modules/@oxc-project/runtime/src/helpers/typeof.js"(exports, module) {
5
- function _typeof(o) {
6
- "@babel/helpers - typeof";
7
- return module.exports = _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(o$1) {
8
- return typeof o$1;
9
- } : function(o$1) {
10
- return o$1 && "function" == typeof Symbol && o$1.constructor === Symbol && o$1 !== Symbol.prototype ? "symbol" : typeof o$1;
11
- }, module.exports.__esModule = true, module.exports["default"] = module.exports, _typeof(o);
12
- }
13
- module.exports = _typeof, module.exports.__esModule = true, module.exports["default"] = module.exports;
14
- } });
15
-
16
- //#endregion
17
- export default require_typeof();
18
-
19
- export { require_typeof };