@mamba/pos
Advanced tools
Comparing version 0.0.2-alpha.7 to 1.0.0-prealpha.1
@@ -60,2 +60,13 @@ import { error, log } from '../../simulator/libs/utils.js'; | ||
function _getToneFrequency(tone, toneMap) { | ||
if (tone === toneMap.TONE1) return 1700; | ||
if (tone === toneMap.TONE2) return 1850; | ||
if (tone === toneMap.TONE3) return 2000; | ||
if (tone === toneMap.TONE4) return 2100; | ||
if (tone === toneMap.TONE5) return 2350; | ||
if (tone === toneMap.TONE6) return 2700; | ||
if (tone === toneMap.TONE7) return 2800; | ||
return null; | ||
} | ||
export function setup(System) { | ||
@@ -155,18 +166,2 @@ const localConfig = { | ||
/** | ||
* Gets the tone frequency according to the tone | ||
* @param {System.Tone} tone The tone to get the Frequency | ||
* @return {number} The frequency in Hz | ||
*/ | ||
System.getToneFrequency = tone => { | ||
if (tone === System.Tone.TONE1) return 1700; | ||
if (tone === System.Tone.TONE2) return 1850; | ||
if (tone === System.Tone.TONE3) return 2000; | ||
if (tone === System.Tone.TONE4) return 2100; | ||
if (tone === System.Tone.TONE5) return 2350; | ||
if (tone === System.Tone.TONE6) return 2700; | ||
if (tone === System.Tone.TONE7) return 2800; | ||
return null; | ||
}; | ||
/** | ||
* Performs a beep. Note that this function blocks the execution on the real device | ||
@@ -183,3 +178,3 @@ * until it's finished. If {@link tone} and {@link duration} are both undefined, the default beep | ||
) => { | ||
const toneFrequency = this.getToneFrequency(tone); | ||
const toneFrequency = _getToneFrequency(tone, System.Tone); | ||
@@ -193,3 +188,3 @@ if (!toneFrequency) { | ||
if (!__TEST__) { | ||
if (!__TEST__ && typeof window.AudioContext !== 'undefined') { | ||
doBeep(duration, toneFrequency); | ||
@@ -196,0 +191,0 @@ } |
{ | ||
"name": "@mamba/pos", | ||
"version": "0.0.2-alpha.7", | ||
"version": "1.0.0-prealpha.1", | ||
"description": "Mamba web environment wrapper and simulator", | ||
@@ -17,4 +17,4 @@ "author": "Stone Payments - Mamba Team", | ||
"dependencies": { | ||
"@mamba/switch": "^0.0.2-alpha.7" | ||
"@mamba/switch": "^1.0.0-prealpha.1" | ||
} | ||
} |
@@ -6,3 +6,3 @@ import { attachDrivers } from './main.js'; | ||
import * as App from '../../drivers/app/simulation.js'; | ||
import * as MbCookie from '../../drivers/cookie/simulation.js'; | ||
import * as Storage from '../../drivers/storage/simulation.js'; | ||
import * as Keyboard from '../../drivers/keyboard/simulation.js'; | ||
@@ -12,2 +12,3 @@ import * as MbMerchant from '../../drivers/merchant/simulation.js'; | ||
import * as System from '../../drivers/system/simulation.js'; | ||
import * as Card from '../../drivers/card/simulation.js'; | ||
@@ -22,3 +23,3 @@ import * as $Cancellation from '../../drivers/cancellation/simulation.js'; | ||
App, | ||
MbCookie, | ||
Storage, | ||
Keyboard, | ||
@@ -30,2 +31,3 @@ MbMerchant, | ||
$Cancellation, | ||
Card, | ||
}); |
import { log } from './utils.js'; | ||
export const SIGNALS = ['settingsChanged', 'print']; | ||
export const SIGNALS = ['settingsChanged', 'print', 'toggleCard']; | ||
@@ -5,0 +5,0 @@ /** Main driver for handling the POS Simulation */ |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
286901
53
1023
+ Added@mamba/switch@1.0.0-rc.29(transitive)
- Removed@mamba/switch@0.0.2-alpha.7(transitive)