@magmamath/students-features 1.3.9-rc.1 → 1.3.9

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 (129) hide show
  1. package/.claude/settings.local.json +25 -0
  2. package/.editorconfig +15 -0
  3. package/.eslintignore +2 -0
  4. package/.eslintrc +22 -0
  5. package/.gitattributes +3 -0
  6. package/.github/actions/setup/action.yml +37 -0
  7. package/.github/workflows/ci.yml +73 -0
  8. package/.gitignore +84 -0
  9. package/.idea/.gitignore +8 -0
  10. package/.idea/codeStyles/Project.xml +62 -0
  11. package/.idea/codeStyles/codeStyleConfig.xml +5 -0
  12. package/.idea/copilot.data.migration.agent.xml +6 -0
  13. package/.idea/copilot.data.migration.ask.xml +6 -0
  14. package/.idea/copilot.data.migration.ask2agent.xml +6 -0
  15. package/.idea/copilot.data.migration.edit.xml +6 -0
  16. package/.idea/inspectionProfiles/Project_Default.xml +8 -0
  17. package/.idea/jsLinters/eslint.xml +6 -0
  18. package/.idea/modules.xml +8 -0
  19. package/.idea/prettier.xml +7 -0
  20. package/.idea/students-features.iml +12 -0
  21. package/.idea/vcs.xml +6 -0
  22. package/.idea/workspace.xml +675 -0
  23. package/.nvmrc +1 -0
  24. package/.prettierrc +11 -0
  25. package/.release-it.json +17 -0
  26. package/.watchmanconfig +1 -0
  27. package/.yarn/plugins/@yarnpkg/plugin-interactive-tools.cjs +541 -0
  28. package/.yarn/plugins/@yarnpkg/plugin-workspace-tools.cjs +28 -0
  29. package/.yarn/releases/yarn-3.6.1.cjs +874 -0
  30. package/babel.config.js +5 -0
  31. package/bob.config.js +25 -0
  32. package/dist/commonjs/features/chatbot/helpers.js +5 -1
  33. package/dist/commonjs/features/chatbot/helpers.js.map +1 -1
  34. package/dist/commonjs/features/chatbot/model/ChatBotModel.js +1 -0
  35. package/dist/commonjs/features/chatbot/model/ChatBotModel.js.map +1 -1
  36. package/dist/commonjs/features/chatbot/types/model.types.js.map +1 -1
  37. package/dist/commonjs/index.js +0 -12
  38. package/dist/commonjs/index.js.map +1 -1
  39. package/dist/module/features/chatbot/helpers.js +5 -1
  40. package/dist/module/features/chatbot/helpers.js.map +1 -1
  41. package/dist/module/features/chatbot/model/ChatBotModel.js +1 -0
  42. package/dist/module/features/chatbot/model/ChatBotModel.js.map +1 -1
  43. package/dist/module/features/chatbot/types/model.types.js.map +1 -1
  44. package/dist/module/index.js +0 -1
  45. package/dist/module/index.js.map +1 -1
  46. package/dist/typescript/commonjs/features/chatbot/helpers.d.ts.map +1 -1
  47. package/dist/typescript/commonjs/features/chatbot/model/ChatBotModel.d.ts.map +1 -1
  48. package/dist/typescript/commonjs/features/chatbot/types/api.types.d.ts +2 -0
  49. package/dist/typescript/commonjs/features/chatbot/types/api.types.d.ts.map +1 -1
  50. package/dist/typescript/commonjs/features/chatbot/types/model.types.d.ts +1 -0
  51. package/dist/typescript/commonjs/features/chatbot/types/model.types.d.ts.map +1 -1
  52. package/dist/typescript/commonjs/index.d.ts +0 -1
  53. package/dist/typescript/commonjs/index.d.ts.map +1 -1
  54. package/dist/typescript/module/features/chatbot/helpers.d.ts.map +1 -1
  55. package/dist/typescript/module/features/chatbot/model/ChatBotModel.d.ts.map +1 -1
  56. package/dist/typescript/module/features/chatbot/types/api.types.d.ts +2 -0
  57. package/dist/typescript/module/features/chatbot/types/api.types.d.ts.map +1 -1
  58. package/dist/typescript/module/features/chatbot/types/model.types.d.ts +1 -0
  59. package/dist/typescript/module/features/chatbot/types/model.types.d.ts.map +1 -1
  60. package/dist/typescript/module/index.d.ts +0 -1
  61. package/dist/typescript/module/index.d.ts.map +1 -1
  62. package/example/.expo/README.md +8 -0
  63. package/example/.expo/devices.json +3 -0
  64. package/example/.expo/web/cache/production/images/favicon/favicon-24272cdaeff82cc5facdaccd982a6f05b60c4504704bbf94c19a6388659880bb-contain-transparent/favicon-48.png +0 -0
  65. package/example/app.json +30 -0
  66. package/example/assets/adaptive-icon.png +0 -0
  67. package/example/assets/favicon.png +0 -0
  68. package/example/assets/icon.png +0 -0
  69. package/example/assets/splash-icon.png +0 -0
  70. package/example/babel.config.js +28 -0
  71. package/example/index.js +8 -0
  72. package/example/metro.config.js +18 -0
  73. package/example/package.json +25 -0
  74. package/example/src/App.tsx +8 -0
  75. package/example/tsconfig.json +6 -0
  76. package/package.json +1 -1
  77. package/src/features/chatbot/helpers.ts +2 -0
  78. package/src/features/chatbot/model/ChatBotModel.ts +1 -0
  79. package/src/features/chatbot/types/api.types.ts +2 -0
  80. package/src/features/chatbot/types/model.types.ts +1 -0
  81. package/src/index.ts +0 -1
  82. package/tsconfig.build.json +4 -0
  83. package/tsconfig.json +34 -0
  84. package/yarn.lock +10984 -0
  85. package/dist/commonjs/features/featureUsage/featureUsage.constants.js +0 -12
  86. package/dist/commonjs/features/featureUsage/featureUsage.constants.js.map +0 -1
  87. package/dist/commonjs/features/featureUsage/featureUsage.types.js +0 -6
  88. package/dist/commonjs/features/featureUsage/featureUsage.types.js.map +0 -1
  89. package/dist/commonjs/features/featureUsage/index.js +0 -27
  90. package/dist/commonjs/features/featureUsage/index.js.map +0 -1
  91. package/dist/commonjs/features/featureUsage/model/FeatureUsageModel.js +0 -24
  92. package/dist/commonjs/features/featureUsage/model/FeatureUsageModel.js.map +0 -1
  93. package/dist/commonjs/features/featureUsage/model/UsageTracker.js +0 -17
  94. package/dist/commonjs/features/featureUsage/model/UsageTracker.js.map +0 -1
  95. package/dist/module/features/featureUsage/featureUsage.constants.js +0 -8
  96. package/dist/module/features/featureUsage/featureUsage.constants.js.map +0 -1
  97. package/dist/module/features/featureUsage/featureUsage.types.js +0 -4
  98. package/dist/module/features/featureUsage/featureUsage.types.js.map +0 -1
  99. package/dist/module/features/featureUsage/index.js +0 -6
  100. package/dist/module/features/featureUsage/index.js.map +0 -1
  101. package/dist/module/features/featureUsage/model/FeatureUsageModel.js +0 -19
  102. package/dist/module/features/featureUsage/model/FeatureUsageModel.js.map +0 -1
  103. package/dist/module/features/featureUsage/model/UsageTracker.js +0 -12
  104. package/dist/module/features/featureUsage/model/UsageTracker.js.map +0 -1
  105. package/dist/typescript/commonjs/features/featureUsage/featureUsage.constants.d.ts +0 -5
  106. package/dist/typescript/commonjs/features/featureUsage/featureUsage.constants.d.ts.map +0 -1
  107. package/dist/typescript/commonjs/features/featureUsage/featureUsage.types.d.ts +0 -4
  108. package/dist/typescript/commonjs/features/featureUsage/featureUsage.types.d.ts.map +0 -1
  109. package/dist/typescript/commonjs/features/featureUsage/index.d.ts +0 -5
  110. package/dist/typescript/commonjs/features/featureUsage/index.d.ts.map +0 -1
  111. package/dist/typescript/commonjs/features/featureUsage/model/FeatureUsageModel.d.ts +0 -9
  112. package/dist/typescript/commonjs/features/featureUsage/model/FeatureUsageModel.d.ts.map +0 -1
  113. package/dist/typescript/commonjs/features/featureUsage/model/UsageTracker.d.ts +0 -9
  114. package/dist/typescript/commonjs/features/featureUsage/model/UsageTracker.d.ts.map +0 -1
  115. package/dist/typescript/module/features/featureUsage/featureUsage.constants.d.ts +0 -5
  116. package/dist/typescript/module/features/featureUsage/featureUsage.constants.d.ts.map +0 -1
  117. package/dist/typescript/module/features/featureUsage/featureUsage.types.d.ts +0 -4
  118. package/dist/typescript/module/features/featureUsage/featureUsage.types.d.ts.map +0 -1
  119. package/dist/typescript/module/features/featureUsage/index.d.ts +0 -5
  120. package/dist/typescript/module/features/featureUsage/index.d.ts.map +0 -1
  121. package/dist/typescript/module/features/featureUsage/model/FeatureUsageModel.d.ts +0 -9
  122. package/dist/typescript/module/features/featureUsage/model/FeatureUsageModel.d.ts.map +0 -1
  123. package/dist/typescript/module/features/featureUsage/model/UsageTracker.d.ts +0 -9
  124. package/dist/typescript/module/features/featureUsage/model/UsageTracker.d.ts.map +0 -1
  125. package/src/features/featureUsage/featureUsage.constants.ts +0 -4
  126. package/src/features/featureUsage/featureUsage.types.ts +0 -4
  127. package/src/features/featureUsage/index.ts +0 -4
  128. package/src/features/featureUsage/model/FeatureUsageModel.ts +0 -17
  129. package/src/features/featureUsage/model/UsageTracker.ts +0 -16
@@ -0,0 +1,30 @@
1
+ {
2
+ "expo": {
3
+ "name": "example",
4
+ "slug": "example",
5
+ "version": "1.0.0",
6
+ "orientation": "portrait",
7
+ "icon": "./assets/icon.png",
8
+ "userInterfaceStyle": "light",
9
+ "newArchEnabled": true,
10
+ "splash": {
11
+ "image": "./assets/splash-icon.png",
12
+ "resizeMode": "contain",
13
+ "backgroundColor": "#ffffff"
14
+ },
15
+ "ios": {
16
+ "supportsTablet": true,
17
+ "bundleIdentifier": "magmamath.features.example"
18
+ },
19
+ "android": {
20
+ "adaptiveIcon": {
21
+ "foregroundImage": "./assets/adaptive-icon.png",
22
+ "backgroundColor": "#ffffff"
23
+ },
24
+ "package": "magmamath.features.example"
25
+ },
26
+ "web": {
27
+ "favicon": "./assets/favicon.png"
28
+ }
29
+ }
30
+ }
Binary file
Binary file
Binary file
Binary file
@@ -0,0 +1,28 @@
1
+ const path = require('path')
2
+ const { getConfig } = require('react-native-builder-bob/babel-config')
3
+ const pkg = require('../package.json')
4
+
5
+ const root = path.resolve(__dirname, '..')
6
+
7
+ module.exports = function (api) {
8
+ api.cache(true)
9
+
10
+ return getConfig(
11
+ {
12
+ presets: ['babel-preset-expo'],
13
+ plugins: [
14
+ [
15
+ 'module-resolver',
16
+ {
17
+ extensions: ['.tsx', '.ts', '.js', '.json'],
18
+ alias: {
19
+ [pkg.name]: path.join(__dirname, '../', pkg.source),
20
+ },
21
+ },
22
+ ],
23
+ ['@babel/plugin-transform-private-methods', { loose: true }],
24
+ ],
25
+ },
26
+ { root, pkg },
27
+ )
28
+ }
@@ -0,0 +1,8 @@
1
+ import { registerRootComponent } from 'expo';
2
+
3
+ import App from './src/App';
4
+
5
+ // registerRootComponent calls AppRegistry.registerComponent('main', () => App);
6
+ // It also ensures that whether you load the app in Expo Go or in a native build,
7
+ // the environment is set up appropriately
8
+ registerRootComponent(App);
@@ -0,0 +1,18 @@
1
+ const path = require('path');
2
+ const { getDefaultConfig } = require('@expo/metro-config');
3
+ const { getConfig } = require('react-native-builder-bob/metro-config');
4
+ const pkg = require('../package.json');
5
+
6
+ const root = path.resolve(__dirname, '..');
7
+
8
+ /**
9
+ * Metro configuration
10
+ * https://facebook.github.io/metro/docs/configuration
11
+ *
12
+ * @type {import('metro-config').MetroConfig}
13
+ */
14
+ module.exports = getConfig(getDefaultConfig(__dirname), {
15
+ root,
16
+ pkg,
17
+ project: __dirname,
18
+ });
@@ -0,0 +1,25 @@
1
+ {
2
+ "name": "@magmamath/students-features-example",
3
+ "version": "1.0.0",
4
+ "main": "index.js",
5
+ "scripts": {
6
+ "start": "expo start",
7
+ "android": "expo start --android",
8
+ "ios": "expo start --ios",
9
+ "web": "expo start --web"
10
+ },
11
+ "dependencies": {
12
+ "@expo/metro-runtime": "~4.0.0",
13
+ "expo": "~52.0.11",
14
+ "expo-status-bar": "~2.0.0",
15
+ "react": "18.3.1",
16
+ "react-dom": "18.3.1",
17
+ "react-native": "0.76.3",
18
+ "react-native-web": "~0.19.13"
19
+ },
20
+ "devDependencies": {
21
+ "@babel/core": "^7.20.0",
22
+ "react-native-builder-bob": "^0.33.3"
23
+ },
24
+ "private": true
25
+ }
@@ -0,0 +1,8 @@
1
+ import React from 'react'
2
+ import { Text } from 'react-native'
3
+
4
+ const App = () => {
5
+ return <Text>Hello</Text>
6
+ }
7
+
8
+ export default App
@@ -0,0 +1,6 @@
1
+ {
2
+ "extends": "../tsconfig",
3
+ "compilerOptions": {
4
+ // Avoid expo-cli auto-generating a tsconfig
5
+ }
6
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@magmamath/students-features",
3
- "version": "1.3.9-rc.1",
3
+ "version": "1.3.9",
4
4
  "description": "Magmamath features library",
5
5
  "source": "src/index.ts",
6
6
  "main": "src/index.ts",
@@ -66,6 +66,7 @@ export function prepareChatRequestPayload(
66
66
  answerOptions,
67
67
  answer,
68
68
  chatHistory,
69
+ assignmentGrade,
69
70
  } = payload
70
71
 
71
72
  if (freeTextMessage) {
@@ -106,6 +107,7 @@ export function prepareChatRequestPayload(
106
107
  ...(imageAltText && { altText: imageAltText }),
107
108
  ...(!!problemStandards?.length && { problemStandards }),
108
109
  ...(!!answerOptions?.length && { answerOptions }),
110
+ ...(assignmentGrade !== undefined && { assignmentGrade }),
109
111
  },
110
112
  }
111
113
  }
@@ -245,6 +245,7 @@ export class ChatbotModel {
245
245
  imageAltText: context.imageDescription,
246
246
  imageCdnId: context.imageCdnId,
247
247
  conversationId: cache[key].conversationId,
248
+ assignmentGrade: context.assignmentGrade,
248
249
  ...(isFreeText && { freeTextMessage: message }),
249
250
  ...(context.assignmentId && {
250
251
  chatHistory: {
@@ -64,6 +64,7 @@ export type PostMessagePayload = {
64
64
  freeTextMessage?: string
65
65
  conversationId?: string | null
66
66
  chatHistory?: ChatHistory
67
+ assignmentGrade?: number
67
68
  }
68
69
 
69
70
  export type PostMessageResponse = {
@@ -128,6 +129,7 @@ export type ChatHintPayload = {
128
129
  hintNumber: number
129
130
  studentInput: string
130
131
  answerOptions?: string[]
132
+ assignmentGrade?: number
131
133
  }
132
134
 
133
135
  export type ChatHintResponse = {
@@ -152,6 +152,7 @@ export type ChatbotContext = {
152
152
  problemStandards?: ProblemStandard[]
153
153
  assignmentId?: string
154
154
  problemId?: string
155
+ assignmentGrade?: number
155
156
  }
156
157
 
157
158
  export type ReinitConversationProps = {
package/src/index.ts CHANGED
@@ -13,4 +13,3 @@ export * from './features/pmProgress'
13
13
  export * from './features/openEnded'
14
14
  export * from './shared/icons'
15
15
  export * from './features/voice'
16
- export * from './features/featureUsage'
@@ -0,0 +1,4 @@
1
+ {
2
+ "extends": "./tsconfig",
3
+ "exclude": ["example", "dist"]
4
+ }
package/tsconfig.json ADDED
@@ -0,0 +1,34 @@
1
+ {
2
+ "compilerOptions": {
3
+ "paths": {
4
+ "@magmamath/students-features": ["./src/index"]
5
+ },
6
+ "target": "esnext",
7
+ "baseUrl": "./",
8
+ "lib": [
9
+ "dom",
10
+ "dom.iterable",
11
+ "esnext"
12
+ ],
13
+ "declaration": true,
14
+ "allowJs": true,
15
+ "skipLibCheck": true,
16
+ "esModuleInterop": true,
17
+ "allowSyntheticDefaultImports": true,
18
+ "strict": true,
19
+ "forceConsistentCasingInFileNames": true,
20
+ "module": "esnext",
21
+ "moduleResolution": "node",
22
+ "resolveJsonModule": true,
23
+ "isolatedModules": true,
24
+ "jsx": "react",
25
+ "experimentalDecorators": true
26
+ },
27
+ "include": [
28
+ "src"
29
+ ],
30
+ "exclude": [
31
+ "node_modules",
32
+ "example"
33
+ ]
34
+ }