@series-inc/venus-sdk 3.2.1-beta.0 → 3.3.0

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
@@ -46,9 +46,6 @@ var VenusMessageId = /* @__PURE__ */ ((VenusMessageId2) => {
46
46
  VenusMessageId2["IS_LOCAL_NOTIFICATIONS_ENABLED"] = "H5_IS_LOCAL_NOTIFICATIONS_ENABLED";
47
47
  VenusMessageId2["SET_LOCAL_NOTIFICATIONS_ENABLED"] = "H5_SET_LOCAL_NOTIFICATIONS_ENABLED";
48
48
  VenusMessageId2["TOAST"] = "H5_TOAST";
49
- VenusMessageId2["ALERT_DIALOG"] = "H5_ALERT_DIALOG";
50
- VenusMessageId2["CONFIRM_DIALOG"] = "H5_CONFIRM_DIALOG";
51
- VenusMessageId2["ACTION_SHEET_SHOW"] = "H5_ACTION_SHEET_SHOW";
52
49
  VenusMessageId2["REQUEST_SERVER_TIME"] = "H5_REQUEST_SERVER_TIME";
53
50
  VenusMessageId2["SHARE_LINK"] = "H5_SHARE_LINK";
54
51
  VenusMessageId2["CREATE_SHARE_QRCODE"] = "H5_CREATE_SHARE_QRCODE";
@@ -964,7 +961,7 @@ var MockCdnApi = class {
964
961
  const cleanSubPath = subPath.startsWith("/") ? subPath.slice(1) : subPath;
965
962
  const isLocalhost = typeof window !== "undefined" && (window.location.hostname === "localhost" || window.location.hostname === "127.0.0.1");
966
963
  if (isLocalhost && !this.forceRemoteCdn) {
967
- return `/${cleanSubPath}`;
964
+ return `cdn/${cleanSubPath}`;
968
965
  }
969
966
  const pathParts = cleanSubPath.split("/");
970
967
  const encodedParts = pathParts.map((part, index) => {
@@ -1929,40 +1926,6 @@ var RpcPopupsApi = class {
1929
1926
  __publicField(this, "rpcClient");
1930
1927
  this.rpcClient = rpcClient;
1931
1928
  }
1932
- async showActionSheet(items, options) {
1933
- const result = await this.rpcClient.call(
1934
- "H5_ACTION_SHEET_SHOW" /* ACTION_SHEET_SHOW */,
1935
- {
1936
- title: options?.title || "",
1937
- message: options?.message || "",
1938
- options: items,
1939
- cancelButtonText: options?.cancelButtonText || "Cancel"
1940
- }
1941
- );
1942
- return result;
1943
- }
1944
- async showAlert(title, message, options) {
1945
- const buttonText = options?.buttonText || "OK";
1946
- await this.rpcClient.call("H5_ALERT_DIALOG" /* ALERT_DIALOG */, {
1947
- title,
1948
- message,
1949
- buttonText
1950
- });
1951
- }
1952
- async showConfirm(title, message, options) {
1953
- const confirmText = options?.confirmText || "OK";
1954
- const cancelText = options?.cancelText || "Cancel";
1955
- const result = await this.rpcClient.call(
1956
- "H5_CONFIRM_DIALOG" /* CONFIRM_DIALOG */,
1957
- {
1958
- title,
1959
- message,
1960
- confirmText,
1961
- cancelText
1962
- }
1963
- );
1964
- return result;
1965
- }
1966
1929
  async showToast(message, options) {
1967
1930
  const duration = options?.duration ?? 3e3;
1968
1931
  const variant = options?.variant ?? "info";
@@ -1986,21 +1949,6 @@ var MockPopupsApi = class {
1986
1949
  __publicField(this, "overlay");
1987
1950
  this.overlay = override;
1988
1951
  }
1989
- showActionSheet(items, options) {
1990
- console.log(
1991
- `[Venus Mock] Show Action sheet, items: ${JSON.stringify(items, null, 2)}, options: ${JSON.stringify(options, null, 2)}`
1992
- );
1993
- return this.overlay.showActionSheet(items, options);
1994
- }
1995
- async showAlert(title, message, options) {
1996
- window.alert(`${title}
1997
- ${message}`);
1998
- }
1999
- async showConfirm(title, message, options) {
2000
- const result = window.confirm(`${title || "Confirm"}
2001
- ${message}`);
2002
- return result;
2003
- }
2004
1952
  async showToast(message, options) {
2005
1953
  const variant = options?.variant ?? "info";
2006
1954
  const duration = options?.duration ?? 3e3;
@@ -2027,41 +1975,6 @@ ${message}`);
2027
1975
 
2028
1976
  // src/popups/index.ts
2029
1977
  function initializePopups(venusApi, host) {
2030
- venusApi.showToast = async (input) => {
2031
- if (typeof input === "string") {
2032
- return await host.popups.showToast(input);
2033
- } else {
2034
- return await host.popups.showToast(input.message, {
2035
- duration: input.duration,
2036
- action: input.action,
2037
- variant: "success"
2038
- });
2039
- }
2040
- };
2041
- venusApi.showAlert = async (input) => {
2042
- await host.popups.showAlert(input.title, input.message, {
2043
- buttonText: input.buttonText
2044
- });
2045
- };
2046
- venusApi.showConfirm = async (input) => {
2047
- const confirmed = await host.popups.showConfirm(
2048
- input.title,
2049
- input.message,
2050
- {
2051
- confirmText: input.confirmText,
2052
- cancelText: input.cancelText
2053
- }
2054
- );
2055
- return confirmed;
2056
- };
2057
- venusApi.showActionSheet = async (input) => {
2058
- return await host.popups.showActionSheet(input.options, {
2059
- title: input.title,
2060
- message: input.message,
2061
- cancelButtonText: input.cancelButtonText,
2062
- disableCancel: input.disableCancel
2063
- });
2064
- };
2065
1978
  venusApi.popups = host.popups;
2066
1979
  }
2067
1980
 
@@ -3565,7 +3478,7 @@ function initializeTime(venusApi, host) {
3565
3478
  }
3566
3479
 
3567
3480
  // src/version.ts
3568
- var SDK_VERSION = "3.2.1-beta.0";
3481
+ var SDK_VERSION = "3.3.0";
3569
3482
 
3570
3483
  // src/shared-assets/base64Utils.ts
3571
3484
  function base64ToArrayBuffer(base64) {
@@ -5208,7 +5121,7 @@ var RemoteHost = class {
5208
5121
  5e3
5209
5122
  );
5210
5123
  transport.instanceId = response.instanceId;
5211
- this.log(`Remote Host Initialized with id: ${transport.instanceId}, response: ${JSON.stringify(response)}`);
5124
+ this.log(`Remote Host Initialized with id: ${transport.instanceId}`);
5212
5125
  const profile = response.profile;
5213
5126
  const sanitizedProfile = {
5214
5127
  id: profile.id,