@cniot/android-pda-components 2.0.0-beta.22 → 2.0.0-beta.23

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/es/index.es.js CHANGED
@@ -7,7 +7,7 @@ var __publicField = (obj, key, value) => {
7
7
  var _a;
8
8
  import * as React$1 from "react";
9
9
  import React__default, { useState as useState$1, useEffect as useEffect$1, forwardRef, useImperativeHandle, createRef, useRef, Component, cloneElement, useCallback, useContext, useMemo, useLayoutEffect as useLayoutEffect$2, memo, version as version$1, isValidElement, createContext } from "react";
10
- import * as ReactDOM from "react-dom";
10
+ import * as ReactDOM$1 from "react-dom";
11
11
  import ReactDOM__default, { unstable_batchedUpdates, createPortal } from "react-dom";
12
12
  var global$2 = "";
13
13
  window.PDA_IMAGE_PATH = window.PDA_IMAGE_PATH ? window.PDA_IMAGE_PATH : "https://img.alicdn.com/imgextra/i3/";
@@ -13291,7 +13291,7 @@ const SafeArea$1 = (props) => {
13291
13291
  }));
13292
13292
  };
13293
13293
  var SafeArea = SafeArea$1;
13294
- const fullClone = Object.assign({}, ReactDOM);
13294
+ const fullClone = Object.assign({}, ReactDOM$1);
13295
13295
  const {
13296
13296
  version,
13297
13297
  render: reactRender,
@@ -18927,12 +18927,12 @@ function Toast(props) {
18927
18927
  }) : message
18928
18928
  })
18929
18929
  }), /* @__PURE__ */ React__default.createElement("audio", {
18930
- src: ROUND_MAP.get(level),
18930
+ src: ROUND_MAP$1.get(level),
18931
18931
  autoPlay: true,
18932
18932
  key: (_a2 = props == null ? void 0 : props.action) == null ? void 0 : _a2.sequence
18933
18933
  }));
18934
18934
  }
18935
- const ROUND_MAP = /* @__PURE__ */ new Map([
18935
+ const ROUND_MAP$1 = /* @__PURE__ */ new Map([
18936
18936
  ["success", success],
18937
18937
  ["error", error],
18938
18938
  ["warning", warning]
@@ -19096,22 +19096,27 @@ function Prompt(props) {
19096
19096
  }, [onNext]);
19097
19097
  return null;
19098
19098
  }
19099
- function PlaySound({ data, service, action }) {
19100
- const { sound } = data;
19101
- if (window.WindVane) {
19102
- var params = {
19103
- domain: "audio",
19104
- method: "playSound",
19105
- params: { sound }
19106
- };
19107
- WindVane.call(
19108
- "WindvanePlugin",
19109
- "invoke",
19110
- JSON.stringify(params)
19111
- );
19112
- }
19113
- service.onNext({});
19114
- return null;
19099
+ const ROUND_MAP = /* @__PURE__ */ new Map([
19100
+ ["success", success],
19101
+ ["error", error],
19102
+ ["warning", warning]
19103
+ ]);
19104
+ function PlaySound(props) {
19105
+ const level = (typeof props === "string" ? props : props == null ? void 0 : props.level) || "success";
19106
+ let playSoundRoot = document.getElementById("op-pda-active-play-sound-root");
19107
+ if (!playSoundRoot) {
19108
+ playSoundRoot = document.createElement("div");
19109
+ playSoundRoot.id = "op-pda-active-play-sound-root";
19110
+ document.body.appendChild(playSoundRoot);
19111
+ }
19112
+ ReactDOM.render(
19113
+ /* @__PURE__ */ React__default.createElement("audio", {
19114
+ src: ROUND_MAP.get(level),
19115
+ autoPlay: true,
19116
+ key: Math.random()
19117
+ }),
19118
+ playSoundRoot
19119
+ );
19115
19120
  }
19116
19121
  function Debug() {
19117
19122
  console.warn('Please stop using "Debug" Components');
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cniot/android-pda-components",
3
- "version": "2.0.0-beta.22",
3
+ "version": "2.0.0-beta.23",
4
4
  "description": "",
5
5
  "main": "./es/index.cjs.js",
6
6
  "module": "./es/index.es.js",