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

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
@@ -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__default.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.24",
4
4
  "description": "",
5
5
  "main": "./es/index.cjs.js",
6
6
  "module": "./es/index.es.js",