@pie-element/fraction-model 6.1.1-next.11 → 6.1.2-next.0

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 (194) hide show
  1. package/configure.js +2 -0
  2. package/controller.js +1 -0
  3. package/dist/author/card-bar.d.ts +20 -0
  4. package/dist/author/card-bar.js +40 -0
  5. package/dist/author/defaults.d.ts +113 -0
  6. package/dist/author/defaults.js +84 -0
  7. package/dist/author/index.d.ts +44 -0
  8. package/dist/author/index.js +88 -0
  9. package/dist/author/main.d.ts +25 -0
  10. package/dist/author/main.js +156 -0
  11. package/dist/author/model-options.d.ts +32 -0
  12. package/dist/author/model-options.js +85 -0
  13. package/dist/author/number-text-field.d.ts +15 -0
  14. package/dist/author/number-text-field.js +24 -0
  15. package/dist/browser/author/index.js +37287 -0
  16. package/dist/browser/author/index.js.map +1 -0
  17. package/dist/browser/controller/index.js +78 -0
  18. package/dist/browser/controller/index.js.map +1 -0
  19. package/dist/browser/delivery/index.js +2 -0
  20. package/dist/browser/delivery-BSG67wbh.js +28213 -0
  21. package/dist/browser/delivery-BSG67wbh.js.map +1 -0
  22. package/dist/browser/fraction-model.css +2 -0
  23. package/dist/browser/isEmpty-Cj-5W3cl.js +16 -0
  24. package/dist/browser/isEmpty-Cj-5W3cl.js.map +1 -0
  25. package/dist/browser/isTypedArray-yL07_GBh.js +171 -0
  26. package/dist/browser/isTypedArray-yL07_GBh.js.map +1 -0
  27. package/dist/controller/defaults.d.ts +21 -0
  28. package/dist/controller/defaults.js +13 -0
  29. package/dist/controller/index.d.ts +23 -0
  30. package/dist/controller/index.js +68 -0
  31. package/dist/delivery/answer-fraction.d.ts +27 -0
  32. package/dist/delivery/answer-fraction.js +69 -0
  33. package/dist/delivery/fraction-model-chart.d.ts +11 -0
  34. package/dist/delivery/fraction-model-chart.js +154 -0
  35. package/dist/delivery/index.d.ts +22 -0
  36. package/dist/delivery/index.js +54 -0
  37. package/dist/delivery/main.d.ts +38 -0
  38. package/dist/delivery/main.js +136 -0
  39. package/dist/index.d.ts +1 -0
  40. package/dist/index.iife.d.ts +8 -0
  41. package/dist/index.iife.js +179 -0
  42. package/dist/index.js +2 -0
  43. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_DataView.js +6 -0
  44. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_Hash.js +16 -0
  45. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_ListCache.js +16 -0
  46. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_Map.js +6 -0
  47. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_MapCache.js +16 -0
  48. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_Promise.js +6 -0
  49. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_Set.js +6 -0
  50. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_Stack.js +14 -0
  51. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_Symbol.js +5 -0
  52. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_Uint8Array.js +5 -0
  53. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_WeakMap.js +6 -0
  54. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_arrayEach.js +7 -0
  55. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_arrayFilter.js +10 -0
  56. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_arrayLikeKeys.js +15 -0
  57. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_arrayPush.js +7 -0
  58. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_assignValue.js +10 -0
  59. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_assocIndexOf.js +8 -0
  60. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_baseAssign.js +8 -0
  61. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_baseAssignIn.js +8 -0
  62. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_baseAssignValue.js +12 -0
  63. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_baseClone.js +57 -0
  64. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_baseCreate.js +14 -0
  65. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_baseGetAllKeys.js +9 -0
  66. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_baseGetTag.js +10 -0
  67. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_baseIsArguments.js +9 -0
  68. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_baseIsMap.js +9 -0
  69. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_baseIsNative.js +11 -0
  70. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_baseIsSet.js +9 -0
  71. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_baseIsTypedArray.js +11 -0
  72. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_baseKeys.js +12 -0
  73. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_baseKeysIn.js +13 -0
  74. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_baseTimes.js +7 -0
  75. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_baseUnary.js +8 -0
  76. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_cloneArrayBuffer.js +8 -0
  77. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_cloneBuffer.js +10 -0
  78. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_cloneDataView.js +8 -0
  79. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_cloneRegExp.js +8 -0
  80. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_cloneSymbol.js +8 -0
  81. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_cloneTypedArray.js +8 -0
  82. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_copyArray.js +8 -0
  83. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_copyObject.js +14 -0
  84. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_copySymbols.js +8 -0
  85. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_copySymbolsIn.js +8 -0
  86. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_coreJsData.js +5 -0
  87. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_defineProperty.js +10 -0
  88. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_freeGlobal.js +4 -0
  89. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_getAllKeys.js +9 -0
  90. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_getAllKeysIn.js +9 -0
  91. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_getMapData.js +8 -0
  92. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_getNative.js +9 -0
  93. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_getPrototype.js +5 -0
  94. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_getRawTag.js +14 -0
  95. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_getSymbols.js +10 -0
  96. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_getSymbolsIn.js +11 -0
  97. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_getTag.js +23 -0
  98. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_getValue.js +6 -0
  99. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_hashClear.js +7 -0
  100. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_hashDelete.js +7 -0
  101. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_hashGet.js +13 -0
  102. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_hashHas.js +9 -0
  103. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_hashSet.js +9 -0
  104. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_initCloneArray.js +8 -0
  105. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_initCloneByTag.js +33 -0
  106. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_initCloneObject.js +9 -0
  107. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_isIndex.js +8 -0
  108. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_isKeyable.js +7 -0
  109. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_isMasked.js +11 -0
  110. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_isPrototype.js +8 -0
  111. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_listCacheClear.js +6 -0
  112. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_listCacheDelete.js +9 -0
  113. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_listCacheGet.js +8 -0
  114. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_listCacheHas.js +7 -0
  115. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_listCacheSet.js +8 -0
  116. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_mapCacheClear.js +13 -0
  117. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_mapCacheDelete.js +8 -0
  118. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_mapCacheGet.js +7 -0
  119. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_mapCacheHas.js +7 -0
  120. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_mapCacheSet.js +8 -0
  121. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_nativeCreate.js +5 -0
  122. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_nativeKeys.js +5 -0
  123. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_nativeKeysIn.js +8 -0
  124. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_nodeUtil.js +9 -0
  125. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_objectToString.js +7 -0
  126. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_overArg.js +8 -0
  127. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_root.js +5 -0
  128. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_stackClear.js +7 -0
  129. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_stackDelete.js +7 -0
  130. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_stackGet.js +6 -0
  131. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_stackHas.js +6 -0
  132. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_stackSet.js +16 -0
  133. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_toSource.js +15 -0
  134. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/cloneDeep.js +8 -0
  135. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/eq.js +6 -0
  136. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/isArguments.js +10 -0
  137. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/isArray.js +4 -0
  138. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/isArrayLike.js +8 -0
  139. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/isBuffer.js +6 -0
  140. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/isEmpty.js +21 -0
  141. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/isFunction.js +11 -0
  142. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/isLength.js +7 -0
  143. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/isMap.js +7 -0
  144. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/isObject.js +7 -0
  145. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/isObjectLike.js +6 -0
  146. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/isSet.js +7 -0
  147. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/isTypedArray.js +7 -0
  148. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/keys.js +9 -0
  149. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/keysIn.js +9 -0
  150. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/stubArray.js +6 -0
  151. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/stubFalse.js +6 -0
  152. package/package.json +79 -19
  153. package/CHANGELOG.json +0 -1
  154. package/CHANGELOG.md +0 -584
  155. package/LICENSE.md +0 -5
  156. package/README.md +0 -18
  157. package/configure/CHANGELOG.json +0 -1
  158. package/configure/CHANGELOG.md +0 -549
  159. package/configure/lib/card-bar.js +0 -57
  160. package/configure/lib/card-bar.js.map +0 -1
  161. package/configure/lib/defaults.js +0 -114
  162. package/configure/lib/defaults.js.map +0 -1
  163. package/configure/lib/index.js +0 -163
  164. package/configure/lib/index.js.map +0 -1
  165. package/configure/lib/main.js +0 -253
  166. package/configure/lib/main.js.map +0 -1
  167. package/configure/lib/model-options.js +0 -144
  168. package/configure/lib/model-options.js.map +0 -1
  169. package/configure/lib/number-text-field.js +0 -47
  170. package/configure/lib/number-text-field.js.map +0 -1
  171. package/configure/package.json +0 -24
  172. package/controller/CHANGELOG.json +0 -1
  173. package/controller/CHANGELOG.md +0 -476
  174. package/controller/lib/defaults.js +0 -20
  175. package/controller/lib/defaults.js.map +0 -1
  176. package/controller/lib/index.js +0 -215
  177. package/controller/lib/index.js.map +0 -1
  178. package/controller/package.json +0 -15
  179. package/docs/config-schema.json +0 -1796
  180. package/docs/config-schema.json.md +0 -1318
  181. package/docs/demo/config.js +0 -8
  182. package/docs/demo/generate.js +0 -6
  183. package/docs/demo/index.html +0 -1
  184. package/docs/demo/session.js +0 -6
  185. package/docs/pie-schema.json +0 -873
  186. package/docs/pie-schema.json.md +0 -639
  187. package/lib/answer-fraction.js +0 -109
  188. package/lib/answer-fraction.js.map +0 -1
  189. package/lib/fraction-model-chart.js +0 -279
  190. package/lib/fraction-model-chart.js.map +0 -1
  191. package/lib/index.js +0 -91
  192. package/lib/index.js.map +0 -1
  193. package/lib/main.js +0 -203
  194. package/lib/main.js.map +0 -1
package/configure.js ADDED
@@ -0,0 +1,2 @@
1
+ export { default } from './dist/author/index.js';
2
+ export * from './dist/author/index.js';
package/controller.js ADDED
@@ -0,0 +1 @@
1
+ export * from './dist/controller/index.js';
@@ -0,0 +1,20 @@
1
+ /**
2
+ * @synced-from pie-elements/packages/fraction-model/configure/src/card-bar.jsx
3
+ * @auto-generated
4
+ *
5
+ * This file is automatically synced from pie-elements and converted to TypeScript.
6
+ * Manual edits will be overwritten on next sync.
7
+ * To make changes, edit the upstream JavaScript file and run sync again.
8
+ */
9
+ import React from 'react';
10
+ import PropTypes from 'prop-types';
11
+ declare const CardBar: {
12
+ (props: any): React.JSX.Element;
13
+ propTypes: {
14
+ mini: PropTypes.Requireable<boolean>;
15
+ header: PropTypes.Requireable<string>;
16
+ children: PropTypes.Requireable<PropTypes.ReactNodeLike>;
17
+ info: PropTypes.Requireable<any>;
18
+ };
19
+ };
20
+ export default CardBar;
@@ -0,0 +1,40 @@
1
+ import "react";
2
+ import e from "prop-types";
3
+ import { styled as t } from "@mui/material/styles";
4
+ import { jsx as n, jsxs as r } from "react/jsx-runtime";
5
+ import i from "@mui/material/Tooltip";
6
+ import a from "@mui/icons-material/HelpOutline";
7
+ import o from "@mui/material/IconButton";
8
+ import s from "@mui/material/Typography";
9
+ //#region src/author/card-bar.tsx
10
+ var c = t("div")({
11
+ display: "flex",
12
+ justifyContent: "space-between"
13
+ }), l = t("div")({
14
+ display: "flex",
15
+ alignItems: "center"
16
+ }), u = t(o)({
17
+ margin: 0,
18
+ padding: 0
19
+ }), d = t(i)(({ theme: e }) => ({ "& .MuiTooltip-tooltip": { fontSize: e.typography.fontSize - 2 } })), f = (e) => {
20
+ let { header: t, children: i, mini: o, info: f } = e;
21
+ return /* @__PURE__ */ r(c, { children: [/* @__PURE__ */ r(l, { children: [/* @__PURE__ */ n(s, {
22
+ variant: o ? "h6" : "h5",
23
+ children: t
24
+ }), f] }), i && /* @__PURE__ */ n(d, {
25
+ title: i,
26
+ children: /* @__PURE__ */ n(u, {
27
+ "aria-label": "Delete",
28
+ size: "large",
29
+ children: /* @__PURE__ */ n(a, {})
30
+ })
31
+ })] });
32
+ };
33
+ f.propTypes = {
34
+ mini: e.bool,
35
+ header: e.string,
36
+ children: e.node,
37
+ info: e.any
38
+ };
39
+ //#endregion
40
+ export { f as default };
@@ -0,0 +1,113 @@
1
+ /**
2
+ * @synced-from pie-elements/packages/fraction-model/configure/src/defaults.js
3
+ * @auto-generated
4
+ *
5
+ * This file is automatically synced from pie-elements and converted to TypeScript.
6
+ * Manual edits will be overwritten on next sync.
7
+ * To make changes, edit the upstream JavaScript file and run sync again.
8
+ */
9
+ declare const _default: {
10
+ model: {
11
+ correctResponse: never[];
12
+ title: string;
13
+ prompt: string;
14
+ modelTypeSelected: string;
15
+ maxModelSelected: number;
16
+ partsPerModel: number;
17
+ allowedStudentConfig: boolean;
18
+ showGraphLabels: boolean;
19
+ };
20
+ configuration: {
21
+ baseInputConfiguration: {
22
+ h3: {
23
+ disabled: boolean;
24
+ };
25
+ audio: {
26
+ disabled: boolean;
27
+ };
28
+ video: {
29
+ disabled: boolean;
30
+ };
31
+ image: {
32
+ disabled: boolean;
33
+ };
34
+ textAlign: {
35
+ disabled: boolean;
36
+ };
37
+ showParagraphs: {
38
+ disabled: boolean;
39
+ };
40
+ separateParagraphs: {
41
+ disabled: boolean;
42
+ };
43
+ };
44
+ title: {
45
+ label: string;
46
+ settings: boolean;
47
+ enabled: boolean;
48
+ inputConfiguration: {
49
+ audio: {
50
+ disabled: boolean;
51
+ };
52
+ video: {
53
+ disabled: boolean;
54
+ };
55
+ image: {
56
+ disabled: boolean;
57
+ };
58
+ };
59
+ };
60
+ prompt: {
61
+ label: string;
62
+ settings: boolean;
63
+ enabled: boolean;
64
+ inputConfiguration: {
65
+ audio: {
66
+ disabled: boolean;
67
+ };
68
+ video: {
69
+ disabled: boolean;
70
+ };
71
+ image: {
72
+ disabled: boolean;
73
+ };
74
+ };
75
+ };
76
+ modelOptions: {
77
+ maxOfModel: {
78
+ min: number;
79
+ max: number;
80
+ default: number;
81
+ };
82
+ partsPerModel: {
83
+ min: number;
84
+ max: number;
85
+ default: number;
86
+ };
87
+ modelTypeChoices: {
88
+ value: string;
89
+ label: string;
90
+ }[];
91
+ };
92
+ mathMlOptions: {
93
+ mmlOutput: boolean;
94
+ mmlEditing: boolean;
95
+ };
96
+ language: {
97
+ settings: boolean;
98
+ label: string;
99
+ enabled: boolean;
100
+ };
101
+ languageChoices: {
102
+ label: string;
103
+ options: never[];
104
+ };
105
+ spellCheck: {
106
+ label: string;
107
+ settings: boolean;
108
+ enabled: boolean;
109
+ };
110
+ settingsPanelDisabled: boolean;
111
+ };
112
+ };
113
+ export default _default;
@@ -0,0 +1,84 @@
1
+ //#region src/author/defaults.ts
2
+ var e = {
3
+ model: {
4
+ correctResponse: [],
5
+ title: "",
6
+ prompt: "",
7
+ modelTypeSelected: "bar",
8
+ maxModelSelected: 1,
9
+ partsPerModel: 5,
10
+ allowedStudentConfig: !1,
11
+ showGraphLabels: !1
12
+ },
13
+ configuration: {
14
+ baseInputConfiguration: {
15
+ h3: { disabled: !0 },
16
+ audio: { disabled: !1 },
17
+ video: { disabled: !1 },
18
+ image: { disabled: !1 },
19
+ textAlign: { disabled: !0 },
20
+ showParagraphs: { disabled: !1 },
21
+ separateParagraphs: { disabled: !0 }
22
+ },
23
+ title: {
24
+ label: "Title",
25
+ settings: !0,
26
+ enabled: !0,
27
+ inputConfiguration: {
28
+ audio: { disabled: !1 },
29
+ video: { disabled: !1 },
30
+ image: { disabled: !1 }
31
+ }
32
+ },
33
+ prompt: {
34
+ label: "Question",
35
+ settings: !0,
36
+ enabled: !0,
37
+ inputConfiguration: {
38
+ audio: { disabled: !1 },
39
+ video: { disabled: !1 },
40
+ image: { disabled: !1 }
41
+ }
42
+ },
43
+ modelOptions: {
44
+ maxOfModel: {
45
+ min: 1,
46
+ max: 9,
47
+ default: 1
48
+ },
49
+ partsPerModel: {
50
+ min: 1,
51
+ max: 9,
52
+ default: 5
53
+ },
54
+ modelTypeChoices: [{
55
+ value: "bar",
56
+ label: "Bar"
57
+ }, {
58
+ value: "pie",
59
+ label: "Pie"
60
+ }]
61
+ },
62
+ mathMlOptions: {
63
+ mmlOutput: !1,
64
+ mmlEditing: !1
65
+ },
66
+ language: {
67
+ settings: !1,
68
+ label: "Specify Language",
69
+ enabled: !1
70
+ },
71
+ languageChoices: {
72
+ label: "Language Choices",
73
+ options: []
74
+ },
75
+ spellCheck: {
76
+ label: "Spellcheck",
77
+ settings: !1,
78
+ enabled: !0
79
+ },
80
+ settingsPanelDisabled: !0
81
+ }
82
+ };
83
+ //#endregion
84
+ export { e as default };
@@ -0,0 +1,44 @@
1
+ /**
2
+ * @synced-from pie-elements/packages/fraction-model/configure/src/index.js
3
+ * @auto-generated
4
+ *
5
+ * This file is automatically synced from pie-elements and converted to TypeScript.
6
+ * Manual edits will be overwritten on next sync.
7
+ * To make changes, edit the upstream JavaScript file and run sync again.
8
+ */
9
+ export default class FractionModelConfigure extends HTMLElement {
10
+ /**
11
+ * This function makes sure you set the default values on the model
12
+ * @param model
13
+ * @returns model
14
+ */
15
+ static createDefaultModel: (model?: {}) => {
16
+ language: any;
17
+ correctResponse: never[];
18
+ title: string;
19
+ prompt: string;
20
+ modelTypeSelected: string;
21
+ maxModelSelected: number;
22
+ partsPerModel: number;
23
+ allowedStudentConfig: boolean;
24
+ showGraphLabels: boolean;
25
+ };
26
+ constructor();
27
+ set model(m: any);
28
+ set configuration(c: any);
29
+ resetModelAfterConfigurationIsSet: any;
30
+ connectedCallback(): void;
31
+ modelChanged(m: any): void;
32
+ onChange: any;
33
+ onConfigurationChanged(c: any): void;
34
+ /**
35
+ *
36
+ * @param {done, progress, file} handler
37
+ */
38
+ insertImage(handler: any): void;
39
+ onDeleteImage(src: any, done: any): void;
40
+ insertSound(handler: any): void;
41
+ onDeleteSound(src: any, done: any): void;
42
+ render(): void;
43
+ disconnectedCallback(): void;
44
+ }
@@ -0,0 +1,88 @@
1
+ import e from "./main.js";
2
+ import t from "./defaults.js";
3
+ import n from "react";
4
+ import { createRoot as r } from "react-dom/client";
5
+ import { DeleteImageEvent as i, DeleteSoundEvent as a, InsertImageEvent as o, InsertSoundEvent as s, ModelUpdatedEvent as c } from "@pie-element/shared-configure-events";
6
+ //#region src/author/index.ts
7
+ var l = class l extends HTMLElement {
8
+ static createDefaultModel = (e = {}) => {
9
+ let n = t.configuration, r = e.language || "";
10
+ return !r && n.language && n.language.enabled && n.languageChoices?.options?.length && (r = n.languageChoices.options[0].value), {
11
+ ...t.model,
12
+ ...e,
13
+ language: r
14
+ };
15
+ };
16
+ constructor() {
17
+ super(), this._root = null, this._model = l.createDefaultModel(), this._configuration = t.configuration;
18
+ }
19
+ set model(e) {
20
+ this._model = l.createDefaultModel(e), this.render();
21
+ }
22
+ set configuration(e) {
23
+ let n = {
24
+ ...t.configuration,
25
+ ...e
26
+ };
27
+ this._configuration = n, this.resetModelAfterConfigurationIsSet(), n?.language?.enabled ? n?.languageChoices?.options?.length && (this._model.language = n?.languageChoices.options[0].value) : n.language.settings && this._model.language ? (this._configuration.language.enabled = !0, (!this._configuration.languageChoices.options || !this._configuration.languageChoices.options.length) && (this._configuration.languageChoices.options = []), this._configuration.languageChoices.options.find((e) => e.value === this._model.language) || this._configuration.languageChoices.options.push({
28
+ value: this._model.language,
29
+ label: this._model.language
30
+ })) : delete this._model.language, this.render();
31
+ }
32
+ resetModelAfterConfigurationIsSet = () => {
33
+ let e = document.querySelectorAll("pie-author");
34
+ this.hasPlayerAsParent = Array.from(e).some((e) => e.contains(this)), this.hasPlayerAsParent && (this._modelCopy ? this._model = this._modelCopy : delete this._modelCopy);
35
+ };
36
+ connectedCallback() {
37
+ this.render();
38
+ }
39
+ modelChanged(e) {
40
+ this._model = e, this.dispatchEvent(new c(this._model), !0), this.render();
41
+ }
42
+ onChange = (e) => {
43
+ this._model = {
44
+ ...this._model,
45
+ ...e
46
+ }, this.dispatchEvent(new c(this._model)), this.render();
47
+ };
48
+ onConfigurationChanged(e) {
49
+ this._configuration = e, this.render();
50
+ }
51
+ insertImage(e) {
52
+ this.dispatchEvent(new o(e));
53
+ }
54
+ onDeleteImage(e, t) {
55
+ this.dispatchEvent(new i(e, t));
56
+ }
57
+ insertSound(e) {
58
+ this.dispatchEvent(new s(e));
59
+ }
60
+ onDeleteSound(e, t) {
61
+ this.dispatchEvent(new a(e, t));
62
+ }
63
+ render() {
64
+ if (this._model) {
65
+ let t = n.createElement(e, {
66
+ classes: {},
67
+ model: this._model,
68
+ configuration: this._configuration,
69
+ onConfigurationChanged: this.onConfigurationChanged,
70
+ onChange: this.onChange,
71
+ imageSupport: {
72
+ add: this.insertImage.bind(this),
73
+ delete: this.onDeleteImage.bind(this)
74
+ },
75
+ uploadSoundSupport: {
76
+ add: this.insertSound.bind(this),
77
+ delete: this.onDeleteSound.bind(this)
78
+ }
79
+ });
80
+ this._root ||= r(this), this._root.render(t);
81
+ }
82
+ }
83
+ disconnectedCallback() {
84
+ this._root && this._root.unmount();
85
+ }
86
+ };
87
+ //#endregion
88
+ export { l as default };
@@ -0,0 +1,25 @@
1
+ /**
2
+ * @synced-from pie-elements/packages/fraction-model/configure/src/main.jsx
3
+ * @auto-generated
4
+ *
5
+ * This file is automatically synced from pie-elements and converted to TypeScript.
6
+ * Manual edits will be overwritten on next sync.
7
+ * To make changes, edit the upstream JavaScript file and run sync again.
8
+ */
9
+ import React from 'react';
10
+ import PropTypes from 'prop-types';
11
+ export declare class Main extends React.Component {
12
+ static propTypes: {
13
+ model: PropTypes.Validator<object>;
14
+ configuration: PropTypes.Validator<object>;
15
+ onConfigurationChanged: PropTypes.Validator<(...args: any[]) => any>;
16
+ onChange: PropTypes.Validator<(...args: any[]) => any>;
17
+ uploadSoundSupport: PropTypes.Validator<object>;
18
+ };
19
+ constructor(props: any);
20
+ onCorrectAnswerChange: any;
21
+ onModelOptionsChange: any;
22
+ generateRandomKey: any;
23
+ render(): React.JSX.Element;
24
+ }
25
+ export default Main;
@@ -0,0 +1,156 @@
1
+ import e from "../delivery/fraction-model-chart.js";
2
+ import t from "./card-bar.js";
3
+ import n from "./model-options.js";
4
+ import r from "react";
5
+ import i from "prop-types";
6
+ import { styled as a } from "@mui/material/styles";
7
+ import { jsx as o, jsxs as s } from "react/jsx-runtime";
8
+ import { AlertDialog as c, FormSection as l, layout as u } from "@pie-lib/config-ui";
9
+ import d from "@pie-lib/editable-html-tip-tap";
10
+ import f from "@mui/material/Tooltip";
11
+ import p from "@mui/icons-material/Info";
12
+ //#region src/author/main.tsx
13
+ var m = a(l)(({ theme: e }) => ({ marginBottom: e.spacing(4) })), h = a(f)(({ theme: e }) => ({ "& .MuiTooltip-tooltip": {
14
+ fontSize: e.typography.fontSize - 2,
15
+ whiteSpace: "pre",
16
+ maxWidth: "500px"
17
+ } })), g = a("div")(({ theme: e }) => ({
18
+ fontSize: e.typography.fontSize - 2,
19
+ color: e.palette.error.main,
20
+ marginTop: e.spacing(1)
21
+ })), _ = a("div")(({ theme: e, hasError: t }) => ({ ...t && { border: `2px solid ${e.palette.error.main}` } })), v = a("label")(({ theme: e }) => ({ marginBottom: e.spacing(4) })), y = class extends r.Component {
22
+ static propTypes = {
23
+ model: i.object.isRequired,
24
+ configuration: i.object.isRequired,
25
+ onConfigurationChanged: i.func.isRequired,
26
+ onChange: i.func.isRequired,
27
+ uploadSoundSupport: i.object.isRequired
28
+ };
29
+ constructor(e) {
30
+ super(e), this.state = { correctAnswerChangeDialog: {
31
+ open: !1,
32
+ text: ""
33
+ } };
34
+ }
35
+ onCorrectAnswerChange = (e) => {
36
+ let { model: t, onChange: n } = this.props;
37
+ t.correctResponse = e, n({ ...t });
38
+ };
39
+ onModelOptionsChange = (e, t, n) => {
40
+ let { onChange: r } = this.props;
41
+ n && e.correctResponse.length > 0 ? this.setState({ correctAnswerChangeDialog: {
42
+ open: !0,
43
+ oldModel: e,
44
+ newModel: t,
45
+ text: "Changing either the Number of Models or Parts per Model will remove added correct answer. Are you sure you want to continue?"
46
+ } }) : r({ ...t });
47
+ };
48
+ generateRandomKey = () => Math.floor(Math.random() * 1e4);
49
+ render() {
50
+ let { model: r, onChange: i, configuration: a, imageSupport: f, uploadSoundSupport: y } = this.props, { baseInputConfiguration: b = {}, contentDimensions: x = {}, title: S = {}, prompt: C = {}, modelOptions: w = {}, mathMlOptions: T = {} } = a || {}, { errors: E = {}, extraCSSRules: D, spellCheckEnabled: O, toolbarEditorPosition: k } = r || {}, { correctAnswerChangeDialog: A } = this.state, j = { position: k === "top" ? "top" : "bottom" }, M = (e = {}) => ({
51
+ ...b,
52
+ ...e
53
+ }), N = this.generateRandomKey();
54
+ return /* @__PURE__ */ s(u.ConfigLayout, {
55
+ extraCSSRules: D,
56
+ dimensions: x,
57
+ hideSettings: !0,
58
+ children: [
59
+ /* @__PURE__ */ o(t, { header: "Set Up" }),
60
+ /* @__PURE__ */ o(m, {
61
+ label: S?.label || "Title",
62
+ children: /* @__PURE__ */ o(d, {
63
+ markup: r.title || "",
64
+ onChange: (e) => i({ title: e }),
65
+ toolbarOpts: j,
66
+ activePlugins: [
67
+ "bold",
68
+ "html",
69
+ "italic",
70
+ "underline",
71
+ "strikethrough",
72
+ "image",
73
+ "math",
74
+ "languageCharacters",
75
+ "responseArea"
76
+ ],
77
+ pluginProps: M(S?.inputConfiguration),
78
+ spellCheck: O,
79
+ uploadSoundSupport: y,
80
+ languageCharactersProps: [{ language: "spanish" }, { language: "special" }],
81
+ mathMlOptions: T
82
+ })
83
+ }),
84
+ /* @__PURE__ */ o(m, {
85
+ label: C?.label || "Question",
86
+ children: /* @__PURE__ */ o(d, {
87
+ markup: r.prompt || "",
88
+ minHeight: 60,
89
+ onChange: (e) => i({ prompt: e }),
90
+ toolbarOpts: j,
91
+ pluginProps: M(C?.inputConfiguration),
92
+ spellCheck: O,
93
+ uploadSoundSupport: y,
94
+ imageSupport: f,
95
+ languageCharactersProps: [{ language: "spanish" }, { language: "special" }],
96
+ mathMlOptions: T
97
+ })
98
+ }),
99
+ /* @__PURE__ */ o(l, { children: /* @__PURE__ */ o(n, {
100
+ model: r,
101
+ onChange: this.onModelOptionsChange,
102
+ modelOptions: w
103
+ }) }),
104
+ /* @__PURE__ */ s(l, { children: [
105
+ " ",
106
+ /* @__PURE__ */ o(t, {
107
+ header: "Correct Answer",
108
+ info: /* @__PURE__ */ o(h, {
109
+ disableFocusListener: !0,
110
+ disableTouchListener: !0,
111
+ placement: "right",
112
+ title: "The correct answer should include no more than one partially-filled model",
113
+ children: /* @__PURE__ */ o(p, {
114
+ fontSize: "small",
115
+ color: "primary",
116
+ style: { marginLeft: "8px" }
117
+ })
118
+ })
119
+ }),
120
+ /* @__PURE__ */ o("br", {}),
121
+ /* @__PURE__ */ o(v, { children: "Click/touch the number of parts to represent the correct fraction model" }),
122
+ /* @__PURE__ */ o("br", {}),
123
+ /* @__PURE__ */ o(_, {
124
+ hasError: !!E.correctResponse,
125
+ children: /* @__PURE__ */ o(e, {
126
+ value: r.correctResponse,
127
+ modelType: r.modelTypeSelected,
128
+ noOfModels: r.maxModelSelected,
129
+ partsPerModel: r.partsPerModel,
130
+ showLabel: r.showGraphLabels,
131
+ onChange: this.onCorrectAnswerChange
132
+ }, N)
133
+ }),
134
+ E.correctResponse && /* @__PURE__ */ o(g, { children: E.correctResponse })
135
+ ] }),
136
+ /* @__PURE__ */ o(c, {
137
+ open: A.open,
138
+ title: "Warning",
139
+ text: A.text,
140
+ onConfirm: () => {
141
+ let e = this.state.correctAnswerChangeDialog.newModel;
142
+ e.correctResponse = [], i({ ...e }), this.setState({ correctAnswerChangeDialog: { open: !1 } });
143
+ },
144
+ onClose: () => {
145
+ let e = this.state.correctAnswerChangeDialog.oldModel;
146
+ i({ ...e }), this.setState({ correctAnswerChangeDialog: { open: !1 } });
147
+ },
148
+ onConfirmText: "OK",
149
+ onCloseText: "Cancel"
150
+ })
151
+ ]
152
+ });
153
+ }
154
+ };
155
+ //#endregion
156
+ export { y as default };
@@ -0,0 +1,32 @@
1
+ /**
2
+ * @synced-from pie-elements/packages/fraction-model/configure/src/model-options.jsx
3
+ * @auto-generated
4
+ *
5
+ * This file is automatically synced from pie-elements and converted to TypeScript.
6
+ * Manual edits will be overwritten on next sync.
7
+ * To make changes, edit the upstream JavaScript file and run sync again.
8
+ */
9
+ import React from 'react';
10
+ import PropTypes from 'prop-types';
11
+ export declare class ModelOptions extends React.Component {
12
+ static propTypes: {
13
+ model: PropTypes.Validator<object>;
14
+ onChange: PropTypes.Requireable<(...args: any[]) => any>;
15
+ modelOptions: PropTypes.Validator<object>;
16
+ };
17
+ constructor(props: any);
18
+ /**
19
+ * Function to trigger when DOM elements value change for Number type
20
+ * @param {string} key contains key of element
21
+ * @param {object} event contains event object
22
+ * @param {string} value contains value of DOM element
23
+ */
24
+ change(key: any, event: any, value: any): void;
25
+ /**
26
+ * Function to trigger on change of dropdown value model type
27
+ * @param {string} value contains selection value
28
+ */
29
+ handleSelect: any;
30
+ render(): React.JSX.Element;
31
+ }
32
+ export default ModelOptions;