@pie-element/image-cloze-association 10.2.0-beta.0 → 10.2.0-next.18

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 (133) hide show
  1. package/author.js +2 -0
  2. package/configure.js +2 -0
  3. package/controller.js +1 -0
  4. package/dist/author/defaults.d.ts +88 -0
  5. package/dist/author/defaults.js +58 -0
  6. package/dist/author/index.d.ts +35 -0
  7. package/dist/author/index.js +74 -0
  8. package/dist/author/root.d.ts +14 -0
  9. package/dist/author/root.js +80 -0
  10. package/dist/browser/Check-DHSwIAJ-.js +10676 -0
  11. package/dist/browser/Check-DHSwIAJ-.js.map +1 -0
  12. package/dist/browser/assets/Symbola-4c507403.woff2 +0 -0
  13. package/dist/browser/author/index.js +33953 -0
  14. package/dist/browser/author/index.js.map +1 -0
  15. package/dist/browser/controller/index.js +171 -0
  16. package/dist/browser/controller/index.js.map +1 -0
  17. package/dist/browser/delivery/index.js +2974 -0
  18. package/dist/browser/delivery/index.js.map +1 -0
  19. package/dist/browser/dist-DZyIyIXw.js +350 -0
  20. package/dist/browser/dist-DZyIyIXw.js.map +1 -0
  21. package/dist/browser/humps-C6P4rNef.js +67 -0
  22. package/dist/browser/humps-C6P4rNef.js.map +1 -0
  23. package/dist/controller/defaults.d.ts +16 -0
  24. package/dist/controller/defaults.js +10 -0
  25. package/dist/controller/index.d.ts +23 -0
  26. package/dist/controller/index.js +122 -0
  27. package/dist/controller/utils.d.ts +14 -0
  28. package/dist/controller/utils.js +36 -0
  29. package/dist/delivery/constants.d.ts +14 -0
  30. package/dist/delivery/evaluation-icon.d.ts +28 -0
  31. package/dist/delivery/evaluation-icon.js +38 -0
  32. package/dist/delivery/image-container.d.ts +13 -0
  33. package/dist/delivery/image-container.js +74 -0
  34. package/dist/delivery/image-drop-target.d.ts +51 -0
  35. package/dist/delivery/image-drop-target.js +107 -0
  36. package/dist/delivery/index.d.ts +20 -0
  37. package/dist/delivery/index.js +112 -0
  38. package/dist/delivery/interactive-section.d.ts +15 -0
  39. package/dist/delivery/interactive-section.js +73 -0
  40. package/dist/delivery/keyboard-coordinates.d.ts +24 -0
  41. package/dist/delivery/keyboard-coordinates.js +49 -0
  42. package/dist/delivery/possible-response.d.ts +41 -0
  43. package/dist/delivery/possible-response.js +115 -0
  44. package/dist/delivery/possible-responses.d.ts +37 -0
  45. package/dist/delivery/possible-responses.js +50 -0
  46. package/dist/delivery/root.d.ts +30 -0
  47. package/dist/delivery/root.js +327 -0
  48. package/dist/delivery/static-html-span.d.ts +14 -0
  49. package/dist/delivery/static-html-span.js +22 -0
  50. package/dist/delivery/utils-correctness.d.ts +10 -0
  51. package/dist/delivery/utils-correctness.js +43 -0
  52. package/dist/index.d.ts +1 -0
  53. package/dist/index.iife.d.ts +8 -0
  54. package/dist/index.iife.js +152 -0
  55. package/dist/index.js +2 -0
  56. package/dist/node_modules/.bun/clsx@2.1.1/node_modules/clsx/dist/clsx.js +16 -0
  57. package/dist/runtime-support.d.ts +12 -0
  58. package/dist/runtime-support.js +12 -0
  59. package/package.json +88 -21
  60. package/CHANGELOG.json +0 -437
  61. package/CHANGELOG.md +0 -2000
  62. package/LICENSE.md +0 -5
  63. package/README.md +0 -1
  64. package/configure/CHANGELOG.json +0 -197
  65. package/configure/CHANGELOG.md +0 -1603
  66. package/configure/lib/defaults.js +0 -86
  67. package/configure/lib/defaults.js.map +0 -1
  68. package/configure/lib/index.js +0 -103
  69. package/configure/lib/index.js.map +0 -1
  70. package/configure/lib/root.js +0 -135
  71. package/configure/lib/root.js.map +0 -1
  72. package/configure/package.json +0 -23
  73. package/configure/src/__tests__/index.test.js +0 -155
  74. package/configure/src/defaults.js +0 -59
  75. package/configure/src/index.js +0 -119
  76. package/configure/src/root.jsx +0 -116
  77. package/controller/CHANGELOG.json +0 -137
  78. package/controller/CHANGELOG.md +0 -1151
  79. package/controller/lib/defaults.js +0 -14
  80. package/controller/lib/defaults.js.map +0 -1
  81. package/controller/lib/index.js +0 -304
  82. package/controller/lib/index.js.map +0 -1
  83. package/controller/lib/utils.js +0 -70
  84. package/controller/lib/utils.js.map +0 -1
  85. package/controller/package.json +0 -19
  86. package/controller/src/__tests__/index.test.js +0 -711
  87. package/controller/src/defaults.js +0 -7
  88. package/controller/src/index.js +0 -322
  89. package/controller/src/utils.js +0 -72
  90. package/docs/config-schema.json +0 -1382
  91. package/docs/config-schema.json.md +0 -1021
  92. package/docs/demo/config.js +0 -8
  93. package/docs/demo/generate.js +0 -74
  94. package/docs/demo/index.html +0 -1
  95. package/docs/demo/session.js +0 -16
  96. package/docs/pie-schema.json +0 -1085
  97. package/docs/pie-schema.json.md +0 -810
  98. package/lib/constants.js +0 -12
  99. package/lib/constants.js.map +0 -1
  100. package/lib/evaluation-icon.js +0 -60
  101. package/lib/evaluation-icon.js.map +0 -1
  102. package/lib/image-container.js +0 -94
  103. package/lib/image-container.js.map +0 -1
  104. package/lib/image-drop-target.js +0 -130
  105. package/lib/image-drop-target.js.map +0 -1
  106. package/lib/index.js +0 -221
  107. package/lib/index.js.map +0 -1
  108. package/lib/interactive-section.js +0 -104
  109. package/lib/interactive-section.js.map +0 -1
  110. package/lib/possible-response.js +0 -161
  111. package/lib/possible-response.js.map +0 -1
  112. package/lib/possible-responses.js +0 -58
  113. package/lib/possible-responses.js.map +0 -1
  114. package/lib/root.js +0 -491
  115. package/lib/root.js.map +0 -1
  116. package/lib/static-html-span.js +0 -35
  117. package/lib/static-html-span.js.map +0 -1
  118. package/lib/utils-correctness.js +0 -89
  119. package/lib/utils-correctness.js.map +0 -1
  120. package/src/__tests__/index.test.js +0 -174
  121. package/src/__tests__/root.test.jsx +0 -99
  122. package/src/__tests__/utils.test.js +0 -207
  123. package/src/constants.js +0 -5
  124. package/src/evaluation-icon.jsx +0 -54
  125. package/src/image-container.jsx +0 -90
  126. package/src/image-drop-target.jsx +0 -140
  127. package/src/index.js +0 -246
  128. package/src/interactive-section.jsx +0 -94
  129. package/src/possible-response.jsx +0 -152
  130. package/src/possible-responses.jsx +0 -52
  131. package/src/root.jsx +0 -490
  132. package/src/static-html-span.jsx +0 -30
  133. package/src/utils-correctness.js +0 -95
package/author.js ADDED
@@ -0,0 +1,2 @@
1
+ export { default } from './dist/author/index.js';
2
+ export * from './dist/author/index.js';
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,88 @@
1
+ /**
2
+ * @synced-from pie-elements/packages/image-cloze-association/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
+ rationale: string;
12
+ rationaleEnabled: boolean;
13
+ studentInstructionsEnabled: boolean;
14
+ teacherInstructions: string;
15
+ teacherInstructionsEnabled: boolean;
16
+ };
17
+ configuration: {
18
+ baseInputConfiguration: {
19
+ h3: {
20
+ disabled: boolean;
21
+ };
22
+ audio: {
23
+ disabled: boolean;
24
+ };
25
+ video: {
26
+ disabled: boolean;
27
+ };
28
+ image: {
29
+ disabled: boolean;
30
+ };
31
+ textAlign: {
32
+ disabled: boolean;
33
+ };
34
+ showParagraphs: {
35
+ disabled: boolean;
36
+ };
37
+ separateParagraphs: {
38
+ disabled: boolean;
39
+ };
40
+ };
41
+ maxImageWidth: {
42
+ teacherInstructions: number;
43
+ };
44
+ maxImageHeight: {
45
+ teacherInstructions: number;
46
+ };
47
+ settingsPanelDisabled: boolean;
48
+ spellCheck: {
49
+ label: string;
50
+ settings: boolean;
51
+ enabled: boolean;
52
+ };
53
+ teacherInstructions: {
54
+ settings: boolean;
55
+ label: string;
56
+ inputConfiguration: {
57
+ audio: {
58
+ disabled: boolean;
59
+ };
60
+ video: {
61
+ disabled: boolean;
62
+ };
63
+ image: {
64
+ disabled: boolean;
65
+ };
66
+ };
67
+ required: boolean;
68
+ };
69
+ withRubric: {
70
+ settings: boolean;
71
+ label: string;
72
+ };
73
+ mathMlOptions: {
74
+ mmlOutput: boolean;
75
+ mmlEditing: boolean;
76
+ };
77
+ language: {
78
+ settings: boolean;
79
+ label: string;
80
+ enabled: boolean;
81
+ };
82
+ languageChoices: {
83
+ label: string;
84
+ options: never[];
85
+ };
86
+ };
87
+ };
88
+ export default _default;
@@ -0,0 +1,58 @@
1
+ //#region src/author/defaults.ts
2
+ var e = {
3
+ model: {
4
+ rationale: "",
5
+ rationaleEnabled: !0,
6
+ studentInstructionsEnabled: !0,
7
+ teacherInstructions: "",
8
+ teacherInstructionsEnabled: !0
9
+ },
10
+ configuration: {
11
+ baseInputConfiguration: {
12
+ h3: { disabled: !0 },
13
+ audio: { disabled: !1 },
14
+ video: { disabled: !1 },
15
+ image: { disabled: !1 },
16
+ textAlign: { disabled: !0 },
17
+ showParagraphs: { disabled: !1 },
18
+ separateParagraphs: { disabled: !0 }
19
+ },
20
+ maxImageWidth: { teacherInstructions: 300 },
21
+ maxImageHeight: { teacherInstructions: 300 },
22
+ settingsPanelDisabled: !1,
23
+ spellCheck: {
24
+ label: "Spellcheck",
25
+ settings: !1,
26
+ enabled: !0
27
+ },
28
+ teacherInstructions: {
29
+ settings: !0,
30
+ label: "Teacher Instructions",
31
+ inputConfiguration: {
32
+ audio: { disabled: !1 },
33
+ video: { disabled: !1 },
34
+ image: { disabled: !1 }
35
+ },
36
+ required: !1
37
+ },
38
+ withRubric: {
39
+ settings: !1,
40
+ label: "Add Rubric"
41
+ },
42
+ mathMlOptions: {
43
+ mmlOutput: !1,
44
+ mmlEditing: !1
45
+ },
46
+ language: {
47
+ settings: !1,
48
+ label: "Specify Language",
49
+ enabled: !1
50
+ },
51
+ languageChoices: {
52
+ label: "Language Choices",
53
+ options: []
54
+ }
55
+ }
56
+ };
57
+ //#endregion
58
+ export { e as default };
@@ -0,0 +1,35 @@
1
+ /**
2
+ * @synced-from pie-elements/packages/image-cloze-association/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 ImageClozeAssociationConfigure extends HTMLElement {
10
+ static createDefaultModel: (model?: {}) => {
11
+ rationale: string;
12
+ rationaleEnabled: boolean;
13
+ studentInstructionsEnabled: boolean;
14
+ teacherInstructions: string;
15
+ teacherInstructionsEnabled: boolean;
16
+ };
17
+ constructor();
18
+ set model(s: any);
19
+ set configuration(c: any);
20
+ set disableSidePanel(s: any);
21
+ dispatchModelUpdated(reset: any): void;
22
+ onModelChanged(m: any, reset: any): void;
23
+ onConfigurationChanged(config: any): void;
24
+ /**
25
+ *
26
+ * @param {done, progress, file} handler
27
+ */
28
+ insertImage(handler: any): void;
29
+ onDeleteImage(src: any, done: any): void;
30
+ insertSound(handler: any): void;
31
+ onDeleteSound(src: any, done: any): void;
32
+ _render(): void;
33
+ connectedCallback(): void;
34
+ disconnectedCallback(): void;
35
+ }
@@ -0,0 +1,74 @@
1
+ import { Root as e } from "./root.js";
2
+ import t from "./defaults.js";
3
+ import n from "react";
4
+ import { createRoot as r } from "react-dom/client";
5
+ import i from "debug";
6
+ import { DeleteImageEvent as a, DeleteSoundEvent as o, InsertImageEvent as s, InsertSoundEvent as c, ModelUpdatedEvent as l } from "@pie-element/shared-configure-events";
7
+ //#region src/author/index.ts
8
+ var u = i("image-cloze-association:configure"), d = class i extends HTMLElement {
9
+ static createDefaultModel = (e = {}) => ({
10
+ ...t.model,
11
+ ...e
12
+ });
13
+ constructor() {
14
+ super(), this._root = null, this._model = i.createDefaultModel(), this.onModelChanged = this.onModelChanged.bind(this), this._configuration = t.configuration;
15
+ }
16
+ set model(e) {
17
+ this._model = i.createDefaultModel(e), this._render();
18
+ }
19
+ set configuration(e) {
20
+ this._configuration = e, this._render();
21
+ }
22
+ set disableSidePanel(e) {
23
+ this._disableSidePanel = e, this._render();
24
+ }
25
+ dispatchModelUpdated(e) {
26
+ let t = !!e;
27
+ this.dispatchEvent(new l(this._model, t));
28
+ }
29
+ onModelChanged(e, t) {
30
+ this._model = e, this.dispatchModelUpdated(t), this._render();
31
+ }
32
+ onConfigurationChanged(e) {
33
+ this._configuration = e, this._render();
34
+ }
35
+ insertImage(e) {
36
+ this.dispatchEvent(new s(e));
37
+ }
38
+ onDeleteImage(e, t) {
39
+ this.dispatchEvent(new a(e, t));
40
+ }
41
+ insertSound(e) {
42
+ this.dispatchEvent(new c(e));
43
+ }
44
+ onDeleteSound(e, t) {
45
+ this.dispatchEvent(new o(e, t));
46
+ }
47
+ _render() {
48
+ u("_render");
49
+ let t = n.createElement(e, {
50
+ disableSidePanel: this._disableSidePanel,
51
+ model: this._model,
52
+ configuration: this._configuration,
53
+ onModelChanged: this.onModelChanged.bind(this),
54
+ onConfigurationChanged: this.onConfigurationChanged.bind(this),
55
+ imageSupport: {
56
+ add: this.insertImage.bind(this),
57
+ delete: this.onDeleteImage.bind(this)
58
+ },
59
+ uploadSoundSupport: {
60
+ add: this.insertSound.bind(this),
61
+ delete: this.onDeleteSound.bind(this)
62
+ }
63
+ });
64
+ this._root ||= r(this), this._root.render(t);
65
+ }
66
+ connectedCallback() {
67
+ this._render();
68
+ }
69
+ disconnectedCallback() {
70
+ this._root &&= (this._root.unmount(), null);
71
+ }
72
+ };
73
+ //#endregion
74
+ export { d as default };
@@ -0,0 +1,14 @@
1
+ /**
2
+ * @synced-from pie-elements/packages/image-cloze-association/configure/src/root.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
+ export declare class Root extends React.Component {
11
+ onTeacherInstructionsChanged: any;
12
+ render(): React.JSX.Element;
13
+ }
14
+ export default Root;
@@ -0,0 +1,80 @@
1
+ import e from "react";
2
+ import t from "prop-types";
3
+ import { jsx as n, jsxs as r } from "react/jsx-runtime";
4
+ import { styled as i } from "@mui/material/styles";
5
+ import { InputContainer as a, layout as o, settings as s } from "@pie-lib/config-ui";
6
+ import c from "@pie-lib/editable-html-tip-tap";
7
+ //#region src/author/root.tsx
8
+ var { Panel: l, toggle: u, dropdown: d } = s, f = i(a)(({ theme: e }) => ({
9
+ width: "100%",
10
+ paddingTop: e.spacing(2),
11
+ marginBottom: e.spacing(2)
12
+ })), p = i("div")(({ theme: e }) => ({
13
+ fontSize: e.typography.fontSize - 2,
14
+ color: e.palette.error.main,
15
+ paddingTop: e.spacing(1)
16
+ })), m = class extends e.Component {
17
+ onTeacherInstructionsChanged = (e) => {
18
+ this.props.onModelChanged({
19
+ ...this.props.model,
20
+ teacherInstructions: e
21
+ });
22
+ };
23
+ render() {
24
+ let { model: e, configuration: t, onModelChanged: i, onConfigurationChanged: a, imageSupport: s, uploadSoundSupport: m } = this.props, { baseInputConfiguration: h = {}, contentDimensions: g = {}, maxImageWidth: _ = {}, maxImageHeight: v = {}, settingsPanelDisabled: y, spellCheck: b = {}, teacherInstructions: x = {}, withRubric: S = {}, mathMlOptions: C = {}, language: w = {}, languageChoices: T = {} } = t || {}, { errors: E = {}, extraCSSRules: D, spellCheckEnabled: O } = e || {}, { teacherInstructions: k } = E, A = {
25
+ teacherInstructionsEnabled: x.settings && u(x.label),
26
+ spellCheckEnabled: b.settings && u(b.label),
27
+ rubricEnabled: S?.settings && u(S?.label),
28
+ "language.enabled": w.settings && u(w.label, !0),
29
+ language: w.settings && w.enabled && d(T.label, T.options)
30
+ };
31
+ return /* @__PURE__ */ r(o.ConfigLayout, {
32
+ extraCSSRules: D,
33
+ dimensions: g,
34
+ hideSettings: y,
35
+ settings: /* @__PURE__ */ n(l, {
36
+ model: e,
37
+ configuration: t,
38
+ onChangeModel: (e) => i(e),
39
+ onChangeConfiguration: (e) => a(e),
40
+ groups: { Properties: A }
41
+ }),
42
+ children: [e && e.teacherInstructionsEnabled && /* @__PURE__ */ r(f, {
43
+ label: x.label,
44
+ children: [/* @__PURE__ */ n(c, {
45
+ markup: e.teacherInstructions || "",
46
+ onChange: this.onTeacherInstructionsChanged,
47
+ imageSupport: s,
48
+ nonEmpty: !1,
49
+ error: k,
50
+ spellCheck: O,
51
+ pluginProps: ((e = {}) => ({
52
+ ...h,
53
+ ...e
54
+ }))(x?.inputConfiguration),
55
+ maxImageWidth: _ && _.teacherInstructions,
56
+ maxImageHeight: v && v.teacherInstructions,
57
+ uploadSoundSupport: m,
58
+ languageCharactersProps: [{ language: "spanish" }, { language: "special" }],
59
+ mathMlOptions: C
60
+ }), k && /* @__PURE__ */ n(p, { children: k })]
61
+ }), /* @__PURE__ */ n("div", { children: "Image cloze association" })]
62
+ });
63
+ }
64
+ };
65
+ m.propTypes = {
66
+ onModelChanged: t.func,
67
+ onConfigurationChanged: t.func,
68
+ model: t.object.isRequired,
69
+ configuration: t.object.isRequired,
70
+ imageSupport: t.shape({
71
+ add: t.func.isRequired,
72
+ delete: t.func.isRequired
73
+ }),
74
+ uploadSoundSupport: t.shape({
75
+ add: t.func.isRequired,
76
+ delete: t.func.isRequired
77
+ })
78
+ };
79
+ //#endregion
80
+ export { m as Root, m as default };