@magmamath/students-features 0.6.3-rc-4 → 0.6.3

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.
Files changed (85) hide show
  1. package/dist/commonjs/features/chatbot/model/ChatBotModel.js +3 -3
  2. package/dist/commonjs/features/chatbot/model/ChatBotModel.js.map +1 -1
  3. package/dist/commonjs/features/chatbot/model/ChatBoxTextManager.js +3 -1
  4. package/dist/commonjs/features/chatbot/model/ChatBoxTextManager.js.map +1 -1
  5. package/dist/commonjs/features/chatbot/model/DefaultMessageCreator.js +4 -2
  6. package/dist/commonjs/features/chatbot/model/DefaultMessageCreator.js.map +1 -1
  7. package/dist/commonjs/features/chatbot/model/constants.js.map +1 -1
  8. package/dist/commonjs/features/chatbot/model/translation.js +7 -0
  9. package/dist/commonjs/features/chatbot/model/translation.js.map +1 -1
  10. package/dist/commonjs/features/problemSelector/components/ProblemSelectorButton.js +9 -12
  11. package/dist/commonjs/features/problemSelector/components/ProblemSelectorButton.js.map +1 -1
  12. package/dist/commonjs/features/problemSelector/constants.js +6 -3
  13. package/dist/commonjs/features/problemSelector/constants.js.map +1 -1
  14. package/dist/commonjs/shared/icons/LockIcon.js +31 -0
  15. package/dist/commonjs/shared/icons/LockIcon.js.map +1 -0
  16. package/dist/commonjs/shared/translation/localization/en.json +2 -1
  17. package/dist/commonjs/shared/translation/localization/gb.json +2 -1
  18. package/dist/commonjs/shared/translation/localization/sw.json +2 -1
  19. package/dist/module/features/chatbot/model/ChatBotModel.js +3 -3
  20. package/dist/module/features/chatbot/model/ChatBotModel.js.map +1 -1
  21. package/dist/module/features/chatbot/model/ChatBoxTextManager.js +3 -1
  22. package/dist/module/features/chatbot/model/ChatBoxTextManager.js.map +1 -1
  23. package/dist/module/features/chatbot/model/DefaultMessageCreator.js +4 -2
  24. package/dist/module/features/chatbot/model/DefaultMessageCreator.js.map +1 -1
  25. package/dist/module/features/chatbot/model/constants.js.map +1 -1
  26. package/dist/module/features/chatbot/model/translation.js +7 -0
  27. package/dist/module/features/chatbot/model/translation.js.map +1 -1
  28. package/dist/module/features/problemSelector/components/ProblemSelectorButton.js +10 -13
  29. package/dist/module/features/problemSelector/components/ProblemSelectorButton.js.map +1 -1
  30. package/dist/module/features/problemSelector/constants.js +5 -2
  31. package/dist/module/features/problemSelector/constants.js.map +1 -1
  32. package/dist/module/shared/icons/LockIcon.js +23 -0
  33. package/dist/module/shared/icons/LockIcon.js.map +1 -0
  34. package/dist/module/shared/translation/localization/en.json +2 -1
  35. package/dist/module/shared/translation/localization/gb.json +2 -1
  36. package/dist/module/shared/translation/localization/sw.json +2 -1
  37. package/dist/typescript/commonjs/features/chatbot/model/ChatBoxTextManager.d.ts.map +1 -1
  38. package/dist/typescript/commonjs/features/chatbot/model/DefaultMessageCreator.d.ts +2 -1
  39. package/dist/typescript/commonjs/features/chatbot/model/DefaultMessageCreator.d.ts.map +1 -1
  40. package/dist/typescript/commonjs/features/chatbot/model/constants.d.ts.map +1 -1
  41. package/dist/typescript/commonjs/features/chatbot/model/translation.d.ts.map +1 -1
  42. package/dist/typescript/commonjs/features/problemSelector/components/ProblemSelectorButton.d.ts.map +1 -1
  43. package/dist/typescript/commonjs/features/problemSelector/constants.d.ts +5 -2
  44. package/dist/typescript/commonjs/features/problemSelector/constants.d.ts.map +1 -1
  45. package/dist/typescript/commonjs/shared/icons/LockIcon.d.ts +4 -0
  46. package/dist/typescript/commonjs/shared/icons/LockIcon.d.ts.map +1 -0
  47. package/dist/typescript/commonjs/shared/translation/constants.d.ts +3 -0
  48. package/dist/typescript/commonjs/shared/translation/constants.d.ts.map +1 -1
  49. package/dist/typescript/commonjs/shared/translation/model.d.ts +2 -0
  50. package/dist/typescript/commonjs/shared/translation/model.d.ts.map +1 -1
  51. package/dist/typescript/module/features/chatbot/model/ChatBoxTextManager.d.ts.map +1 -1
  52. package/dist/typescript/module/features/chatbot/model/DefaultMessageCreator.d.ts +2 -1
  53. package/dist/typescript/module/features/chatbot/model/DefaultMessageCreator.d.ts.map +1 -1
  54. package/dist/typescript/module/features/chatbot/model/constants.d.ts.map +1 -1
  55. package/dist/typescript/module/features/chatbot/model/translation.d.ts.map +1 -1
  56. package/dist/typescript/module/features/problemSelector/components/ProblemSelectorButton.d.ts.map +1 -1
  57. package/dist/typescript/module/features/problemSelector/constants.d.ts +5 -2
  58. package/dist/typescript/module/features/problemSelector/constants.d.ts.map +1 -1
  59. package/dist/typescript/module/shared/icons/LockIcon.d.ts +4 -0
  60. package/dist/typescript/module/shared/icons/LockIcon.d.ts.map +1 -0
  61. package/dist/typescript/module/shared/translation/constants.d.ts +3 -0
  62. package/dist/typescript/module/shared/translation/constants.d.ts.map +1 -1
  63. package/dist/typescript/module/shared/translation/model.d.ts +2 -0
  64. package/dist/typescript/module/shared/translation/model.d.ts.map +1 -1
  65. package/package.json +2 -2
  66. package/src/features/chatbot/model/ChatBotModel.ts +1 -1
  67. package/src/features/chatbot/model/ChatBoxTextManager.ts +3 -1
  68. package/src/features/chatbot/model/DefaultMessageCreator.ts +4 -2
  69. package/src/features/chatbot/model/constants.ts +0 -2
  70. package/src/features/chatbot/model/translation.ts +9 -0
  71. package/src/features/problemSelector/components/ProblemSelectorButton.tsx +10 -17
  72. package/src/features/problemSelector/constants.ts +2 -3
  73. package/src/shared/icons/LockIcon.tsx +16 -0
  74. package/src/shared/translation/localization/en.json +2 -1
  75. package/src/shared/translation/localization/gb.json +2 -1
  76. package/src/shared/translation/localization/sw.json +2 -1
  77. package/dist/commonjs/lib/helpers/os.js +0 -31
  78. package/dist/commonjs/lib/helpers/os.js.map +0 -1
  79. package/dist/module/lib/helpers/os.js +0 -26
  80. package/dist/module/lib/helpers/os.js.map +0 -1
  81. package/dist/typescript/commonjs/lib/helpers/os.d.ts +0 -13
  82. package/dist/typescript/commonjs/lib/helpers/os.d.ts.map +0 -1
  83. package/dist/typescript/module/lib/helpers/os.d.ts +0 -13
  84. package/dist/typescript/module/lib/helpers/os.d.ts.map +0 -1
  85. package/src/lib/helpers/os.ts +0 -26
@@ -129,6 +129,9 @@ export class ChatbotTranslation {
129
129
  textList: {
130
130
  messages: messages.map(({ message }) => message),
131
131
  defaultMessages: defaultMessages.map(({ message }) => message),
132
+ defaultMessagesOptions: defaultMessages.flatMap((message) =>
133
+ message.options.map((option) => option.text),
134
+ ),
132
135
  defaultOptions: defaultOptions.map(({ text }) => text),
133
136
  lastMessage: options.lastMessage || [],
134
137
  alternativesHints: options.alternatives?.hints || [],
@@ -139,6 +142,12 @@ export class ChatbotTranslation {
139
142
 
140
143
  translatedTextsList.defaultMessages.forEach((message, index) => {
141
144
  defaultMessages[index].translatedMessage = message
145
+ defaultMessages[index].options = defaultMessages[index].options.map((option) => {
146
+ return {
147
+ ...option,
148
+ translatedText: translatedTextsList.defaultMessagesOptions[index],
149
+ }
150
+ })
142
151
  })
143
152
  translatedTextsList.defaultOptions.forEach((message, index) => {
144
153
  defaultOptions[index].translatedText = message
@@ -7,12 +7,11 @@ import {
7
7
  ButtonSize,
8
8
  ButtonStates,
9
9
  ButtonVariant,
10
- FONT_FAMILY,
11
- LockIcon,
12
10
  Typography,
13
11
  } from '@magmamath/react-native-ui'
14
12
 
15
- import { BADGE_COORDINATES, BUTTON_BORDER_WIDTH, BUTTON_SIZE, COLOR_SCHEME_MAP } from '../constants'
13
+ import { BADGE_COORDINATES, BUTTON_SIZE, COLOR_SCHEME_MAP, ICON_SIZE } from '../constants'
14
+ import { LockIcon } from '../../../shared/icons/LockIcon'
16
15
 
17
16
  import { ProblemSelectorButtonProps } from '../types'
18
17
 
@@ -38,16 +37,15 @@ export const ProblemSelectorButton = ({
38
37
  disabled={locked}
39
38
  icon={
40
39
  locked ? (
41
- <LockIcon color={customColorScheme[ButtonStates.DISABLED]?.color} size="large" />
40
+ <LockIcon
41
+ height={ICON_SIZE.height}
42
+ width={ICON_SIZE.width}
43
+ color={customColorScheme[ButtonStates.DISABLED]?.color}
44
+ />
42
45
  ) : (
43
46
  <Typography
44
- variant="h3"
45
- style={[
46
- styles.buttonText,
47
- {
48
- color: customColorScheme[ButtonStates.DEFAULT]?.color,
49
- },
50
- ]}
47
+ variant="h2"
48
+ style={{ color: customColorScheme[ButtonStates.DEFAULT]?.color }}
51
49
  >
52
50
  {text ?? ''}
53
51
  </Typography>
@@ -78,11 +76,6 @@ const styles = StyleSheet.create({
78
76
  button: {
79
77
  width: BUTTON_SIZE,
80
78
  height: BUTTON_SIZE,
81
- borderWidth: BUTTON_BORDER_WIDTH,
82
- },
83
- buttonText: {
84
- textAlign: 'center',
85
- fontWeight: 400,
86
- fontFamily: FONT_FAMILY.buenosAires,
79
+ borderWidth: 2.75,
87
80
  },
88
81
  })
@@ -1,10 +1,9 @@
1
1
  import { ButtonColorPreset, ButtonStates, COLORS } from '@magmamath/react-native-ui'
2
-
3
2
  import { ProblemSelectorButtonState } from './types'
4
3
 
5
- export const BUTTON_SIZE = 49
6
- export const BUTTON_BORDER_WIDTH = 3
4
+ export const BUTTON_SIZE = 49.5
7
5
  export const BADGE_COORDINATES = { top: 4, right: 4 }
6
+ export const ICON_SIZE = { width: 23, height: 25 }
8
7
  export const PROBLEM_SELECTOR_CONTENT_WIDTH = 265
9
8
 
10
9
  export const PROBLEM_SELECTOR_BUTTON_STATE = {
@@ -0,0 +1,16 @@
1
+ import React from 'react'
2
+ import Svg, { Path, Rect } from 'react-native-svg'
3
+ import { COLORS } from '@magmamath/react-native-ui'
4
+
5
+ import { IconProps } from './icon.types'
6
+
7
+ export const LockIcon = ({ width = 23, height = 25, color = COLORS.NEUTRAL_6 }: IconProps) => (
8
+ <Svg width={width} height={height} viewBox="0.5 1 23 25" fill="none">
9
+ <Path
10
+ fillRule="evenodd"
11
+ clipRule="evenodd"
12
+ d="M4.183 8.91H3.44A2.578 2.578 0 00.862 11.49v11.068a2.578 2.578 0 002.578 2.578h17.12a2.578 2.578 0 002.578-2.578V11.49a2.578 2.578 0 00-2.578-2.578h-.743c-.119-1.421-.391-3.307-1.374-4.897C17.304 2.172 15.303.864 12 .864c-3.304 0-5.304 1.308-6.443 3.15-.983 1.59-1.255 3.476-1.374 4.897zm2.008 0h11.618c-.12-1.303-.369-2.714-1.067-3.844C16.002 3.87 14.68 2.864 12 2.864c-2.68 0-4.003 1.006-4.742 2.202-.699 1.13-.947 2.54-1.067 3.845zm-2.75 2H20.56c.319 0 .578.26.578.579v11.068c0 .32-.26.578-.578.578H3.44a.578.578 0 01-.578-.578V11.49c0-.32.26-.578.578-.578z"
13
+ fill={color}
14
+ />
15
+ </Svg>
16
+ )
@@ -13,8 +13,9 @@
13
13
  "time.yearsAgo": "years ago",
14
14
  "chat": {
15
15
  "anotherHint": "Give me another hint",
16
+ "giveHint": "Give me a hint",
16
17
  "answerAgain": "Answer again to get another hint!",
17
- "errorMessage": "Sorry, I can't help with this issue at the moment 😔.",
18
+ "errorMessage": "Something went wrong! Try again",
18
19
  "howCanIHelp": "Hi! Do you want help?",
19
20
  "showError": "Show error"
20
21
  }
@@ -13,8 +13,9 @@
13
13
  "time.yearsAgo": "years ago",
14
14
  "chat": {
15
15
  "anotherHint": "Give me another hint",
16
+ "giveHint": "Give me a hint",
16
17
  "answerAgain": "Answer again to get another hint!",
17
- "errorMessage": "Sorry, I can't help with this issue at the moment 😔.",
18
+ "errorMessage": "Something went wrong! Try again",
18
19
  "howCanIHelp": "Hi! Do you want help?",
19
20
  "showError": "Show error"
20
21
  }
@@ -13,8 +13,9 @@
13
13
  "time.yearsAgo": "år sedan",
14
14
  "chat": {
15
15
  "anotherHint": "Ge mig en ledtråd",
16
+ "giveHint": "Ge mig en ledtråd",
16
17
  "answerAgain": "Svara igen för att få en till ledtråd!",
17
- "errorMessage": "Tyvärr kan jag inte hjälpa dig just nu 😔.",
18
+ "errorMessage": "Något gick snett! Försök igen",
18
19
  "howCanIHelp": "Hej! Hur kan jag hjälpa dig?",
19
20
  "showError": "Visa fel"
20
21
  }
@@ -1,31 +0,0 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- exports.getOSFromUserAgent = exports.IS_WEB_WINDOWS = exports.DeviceOS = void 0;
7
- let DeviceOS = exports.DeviceOS = /*#__PURE__*/function (DeviceOS) {
8
- DeviceOS["Windows"] = "Windows";
9
- DeviceOS["macOS"] = "macOS";
10
- DeviceOS["UNIX"] = "UNIX";
11
- DeviceOS["Linux"] = "Linux";
12
- DeviceOS["iOS"] = "iOS";
13
- DeviceOS["Android"] = "Android";
14
- DeviceOS["ChromeOS"] = "ChromeOS";
15
- DeviceOS["UnknownOS"] = "Unknown OS";
16
- return DeviceOS;
17
- }({});
18
- const getOSFromUserAgent = () => {
19
- const userAgent = window.navigator.userAgent;
20
- if (userAgent.indexOf('CrOS') !== -1) return DeviceOS.ChromeOS;
21
- if (userAgent.indexOf('Win') !== -1) return DeviceOS.Windows;
22
- if (userAgent.indexOf('Mac') !== -1) return DeviceOS.macOS;
23
- if (userAgent.indexOf('X11') !== -1) return DeviceOS.UNIX;
24
- if (userAgent.indexOf('Linux') !== -1) return DeviceOS.Linux;
25
- if (userAgent.match(/i(Pod|Phone|Pad)/)) return DeviceOS.iOS;
26
- if (userAgent.indexOf('Android') !== -1) return DeviceOS.Android;
27
- return DeviceOS.UnknownOS;
28
- };
29
- exports.getOSFromUserAgent = getOSFromUserAgent;
30
- const IS_WEB_WINDOWS = exports.IS_WEB_WINDOWS = [DeviceOS.Windows].includes(getOSFromUserAgent());
31
- //# sourceMappingURL=os.js.map
@@ -1 +0,0 @@
1
- {"version":3,"names":["DeviceOS","exports","getOSFromUserAgent","userAgent","window","navigator","indexOf","ChromeOS","Windows","macOS","UNIX","Linux","match","iOS","Android","UnknownOS","IS_WEB_WINDOWS","includes"],"sourceRoot":"../../../../src","sources":["lib/helpers/os.ts"],"mappings":";;;;;;IAAYA,QAAQ,GAAAC,OAAA,CAAAD,QAAA,0BAARA,QAAQ;EAARA,QAAQ;EAARA,QAAQ;EAARA,QAAQ;EAARA,QAAQ;EAARA,QAAQ;EAARA,QAAQ;EAARA,QAAQ;EAARA,QAAQ;EAAA,OAARA,QAAQ;AAAA;AAWb,MAAME,kBAAkB,GAAGA,CAAA,KAAM;EACtC,MAAMC,SAAS,GAAGC,MAAM,CAACC,SAAS,CAACF,SAAS;EAE5C,IAAIA,SAAS,CAACG,OAAO,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC,EAAE,OAAON,QAAQ,CAACO,QAAQ;EAC9D,IAAIJ,SAAS,CAACG,OAAO,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC,EAAE,OAAON,QAAQ,CAACQ,OAAO;EAC5D,IAAIL,SAAS,CAACG,OAAO,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC,EAAE,OAAON,QAAQ,CAACS,KAAK;EAC1D,IAAIN,SAAS,CAACG,OAAO,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC,EAAE,OAAON,QAAQ,CAACU,IAAI;EACzD,IAAIP,SAAS,CAACG,OAAO,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC,EAAE,OAAON,QAAQ,CAACW,KAAK;EAC5D,IAAIR,SAAS,CAACS,KAAK,CAAC,kBAAkB,CAAC,EAAE,OAAOZ,QAAQ,CAACa,GAAG;EAC5D,IAAIV,SAAS,CAACG,OAAO,CAAC,SAAS,CAAC,KAAK,CAAC,CAAC,EAAE,OAAON,QAAQ,CAACc,OAAO;EAEhE,OAAOd,QAAQ,CAACe,SAAS;AAC3B,CAAC;AAAAd,OAAA,CAAAC,kBAAA,GAAAA,kBAAA;AAEM,MAAMc,cAAc,GAAAf,OAAA,CAAAe,cAAA,GAAG,CAAChB,QAAQ,CAACQ,OAAO,CAAC,CAACS,QAAQ,CAACf,kBAAkB,CAAC,CAAC,CAAC","ignoreList":[]}
@@ -1,26 +0,0 @@
1
- "use strict";
2
-
3
- export let DeviceOS = /*#__PURE__*/function (DeviceOS) {
4
- DeviceOS["Windows"] = "Windows";
5
- DeviceOS["macOS"] = "macOS";
6
- DeviceOS["UNIX"] = "UNIX";
7
- DeviceOS["Linux"] = "Linux";
8
- DeviceOS["iOS"] = "iOS";
9
- DeviceOS["Android"] = "Android";
10
- DeviceOS["ChromeOS"] = "ChromeOS";
11
- DeviceOS["UnknownOS"] = "Unknown OS";
12
- return DeviceOS;
13
- }({});
14
- export const getOSFromUserAgent = () => {
15
- const userAgent = window.navigator.userAgent;
16
- if (userAgent.indexOf('CrOS') !== -1) return DeviceOS.ChromeOS;
17
- if (userAgent.indexOf('Win') !== -1) return DeviceOS.Windows;
18
- if (userAgent.indexOf('Mac') !== -1) return DeviceOS.macOS;
19
- if (userAgent.indexOf('X11') !== -1) return DeviceOS.UNIX;
20
- if (userAgent.indexOf('Linux') !== -1) return DeviceOS.Linux;
21
- if (userAgent.match(/i(Pod|Phone|Pad)/)) return DeviceOS.iOS;
22
- if (userAgent.indexOf('Android') !== -1) return DeviceOS.Android;
23
- return DeviceOS.UnknownOS;
24
- };
25
- export const IS_WEB_WINDOWS = [DeviceOS.Windows].includes(getOSFromUserAgent());
26
- //# sourceMappingURL=os.js.map
@@ -1 +0,0 @@
1
- {"version":3,"names":["DeviceOS","getOSFromUserAgent","userAgent","window","navigator","indexOf","ChromeOS","Windows","macOS","UNIX","Linux","match","iOS","Android","UnknownOS","IS_WEB_WINDOWS","includes"],"sourceRoot":"../../../../src","sources":["lib/helpers/os.ts"],"mappings":";;AAAA,WAAYA,QAAQ,0BAARA,QAAQ;EAARA,QAAQ;EAARA,QAAQ;EAARA,QAAQ;EAARA,QAAQ;EAARA,QAAQ;EAARA,QAAQ;EAARA,QAAQ;EAARA,QAAQ;EAAA,OAARA,QAAQ;AAAA;AAWpB,OAAO,MAAMC,kBAAkB,GAAGA,CAAA,KAAM;EACtC,MAAMC,SAAS,GAAGC,MAAM,CAACC,SAAS,CAACF,SAAS;EAE5C,IAAIA,SAAS,CAACG,OAAO,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC,EAAE,OAAOL,QAAQ,CAACM,QAAQ;EAC9D,IAAIJ,SAAS,CAACG,OAAO,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC,EAAE,OAAOL,QAAQ,CAACO,OAAO;EAC5D,IAAIL,SAAS,CAACG,OAAO,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC,EAAE,OAAOL,QAAQ,CAACQ,KAAK;EAC1D,IAAIN,SAAS,CAACG,OAAO,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC,EAAE,OAAOL,QAAQ,CAACS,IAAI;EACzD,IAAIP,SAAS,CAACG,OAAO,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC,EAAE,OAAOL,QAAQ,CAACU,KAAK;EAC5D,IAAIR,SAAS,CAACS,KAAK,CAAC,kBAAkB,CAAC,EAAE,OAAOX,QAAQ,CAACY,GAAG;EAC5D,IAAIV,SAAS,CAACG,OAAO,CAAC,SAAS,CAAC,KAAK,CAAC,CAAC,EAAE,OAAOL,QAAQ,CAACa,OAAO;EAEhE,OAAOb,QAAQ,CAACc,SAAS;AAC3B,CAAC;AAED,OAAO,MAAMC,cAAc,GAAG,CAACf,QAAQ,CAACO,OAAO,CAAC,CAACS,QAAQ,CAACf,kBAAkB,CAAC,CAAC,CAAC","ignoreList":[]}
@@ -1,13 +0,0 @@
1
- export declare enum DeviceOS {
2
- Windows = "Windows",
3
- macOS = "macOS",
4
- UNIX = "UNIX",
5
- Linux = "Linux",
6
- iOS = "iOS",
7
- Android = "Android",
8
- ChromeOS = "ChromeOS",
9
- UnknownOS = "Unknown OS"
10
- }
11
- export declare const getOSFromUserAgent: () => DeviceOS;
12
- export declare const IS_WEB_WINDOWS: boolean;
13
- //# sourceMappingURL=os.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"os.d.ts","sourceRoot":"","sources":["../../../../../src/lib/helpers/os.ts"],"names":[],"mappings":"AAAA,oBAAY,QAAQ;IAClB,OAAO,YAAY;IACnB,KAAK,UAAU;IACf,IAAI,SAAS;IACb,KAAK,UAAU;IACf,GAAG,QAAQ;IACX,OAAO,YAAY;IACnB,QAAQ,aAAa;IACrB,SAAS,eAAe;CACzB;AAED,eAAO,MAAM,kBAAkB,gBAY9B,CAAA;AAED,eAAO,MAAM,cAAc,SAAoD,CAAA"}
@@ -1,13 +0,0 @@
1
- export declare enum DeviceOS {
2
- Windows = "Windows",
3
- macOS = "macOS",
4
- UNIX = "UNIX",
5
- Linux = "Linux",
6
- iOS = "iOS",
7
- Android = "Android",
8
- ChromeOS = "ChromeOS",
9
- UnknownOS = "Unknown OS"
10
- }
11
- export declare const getOSFromUserAgent: () => DeviceOS;
12
- export declare const IS_WEB_WINDOWS: boolean;
13
- //# sourceMappingURL=os.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"os.d.ts","sourceRoot":"","sources":["../../../../../src/lib/helpers/os.ts"],"names":[],"mappings":"AAAA,oBAAY,QAAQ;IAClB,OAAO,YAAY;IACnB,KAAK,UAAU;IACf,IAAI,SAAS;IACb,KAAK,UAAU;IACf,GAAG,QAAQ;IACX,OAAO,YAAY;IACnB,QAAQ,aAAa;IACrB,SAAS,eAAe;CACzB;AAED,eAAO,MAAM,kBAAkB,gBAY9B,CAAA;AAED,eAAO,MAAM,cAAc,SAAoD,CAAA"}
@@ -1,26 +0,0 @@
1
- export enum DeviceOS {
2
- Windows = 'Windows',
3
- macOS = 'macOS',
4
- UNIX = 'UNIX',
5
- Linux = 'Linux',
6
- iOS = 'iOS',
7
- Android = 'Android',
8
- ChromeOS = 'ChromeOS',
9
- UnknownOS = 'Unknown OS',
10
- }
11
-
12
- export const getOSFromUserAgent = () => {
13
- const userAgent = window.navigator.userAgent
14
-
15
- if (userAgent.indexOf('CrOS') !== -1) return DeviceOS.ChromeOS
16
- if (userAgent.indexOf('Win') !== -1) return DeviceOS.Windows
17
- if (userAgent.indexOf('Mac') !== -1) return DeviceOS.macOS
18
- if (userAgent.indexOf('X11') !== -1) return DeviceOS.UNIX
19
- if (userAgent.indexOf('Linux') !== -1) return DeviceOS.Linux
20
- if (userAgent.match(/i(Pod|Phone|Pad)/)) return DeviceOS.iOS
21
- if (userAgent.indexOf('Android') !== -1) return DeviceOS.Android
22
-
23
- return DeviceOS.UnknownOS
24
- }
25
-
26
- export const IS_WEB_WINDOWS = [DeviceOS.Windows].includes(getOSFromUserAgent())