@pie-element/matrix 4.1.1 → 4.1.2-next.1

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 (117) hide show
  1. package/configure.js +2 -0
  2. package/controller.js +1 -0
  3. package/dist/author/HeaderCommon.d.ts +12 -0
  4. package/dist/author/HeaderCommon.js +20 -0
  5. package/dist/author/Main.d.ts +27 -0
  6. package/dist/author/Main.js +134 -0
  7. package/dist/author/MatrixColumnsSizeHeaderInput.d.ts +21 -0
  8. package/dist/author/MatrixColumnsSizeHeaderInput.js +39 -0
  9. package/dist/author/MatrixLabelEditableButton.d.ts +27 -0
  10. package/dist/author/MatrixLabelEditableButton.js +191 -0
  11. package/dist/author/MatrixLabelTypeHeaderInput.d.ts +21 -0
  12. package/dist/author/MatrixLabelTypeHeaderInput.js +96 -0
  13. package/dist/author/MatrixRowsSizeHeaderInput.d.ts +21 -0
  14. package/dist/author/MatrixRowsSizeHeaderInput.js +39 -0
  15. package/dist/author/MatrixValues.d.ts +29 -0
  16. package/dist/author/MatrixValues.js +156 -0
  17. package/dist/author/NumberInput.d.ts +20 -0
  18. package/dist/author/NumberInput.js +61 -0
  19. package/dist/author/columnLabelsGenerator.d.ts +11 -0
  20. package/dist/author/columnLabelsGenerator.js +101 -0
  21. package/dist/author/defaults.d.ts +88 -0
  22. package/dist/author/defaults.js +56 -0
  23. package/dist/author/index.d.ts +31 -0
  24. package/dist/author/index.js +66 -0
  25. package/dist/author/isNumeric.d.ts +10 -0
  26. package/dist/author/isNumeric.js +4 -0
  27. package/dist/author/matrixEntities.d.ts +17 -0
  28. package/dist/author/matrixEntities.js +12 -0
  29. package/dist/browser/Radio-DJhIYuTn.js +10138 -0
  30. package/dist/browser/Radio-DJhIYuTn.js.map +1 -0
  31. package/dist/browser/author/index.js +39771 -0
  32. package/dist/browser/author/index.js.map +1 -0
  33. package/dist/browser/controller/index.js +60 -0
  34. package/dist/browser/controller/index.js.map +1 -0
  35. package/dist/browser/delivery/index.js +205 -0
  36. package/dist/browser/delivery/index.js.map +1 -0
  37. package/dist/browser/dist-DHz-aOnW.js +92 -0
  38. package/dist/browser/dist-DHz-aOnW.js.map +1 -0
  39. package/dist/browser/matrix.css +2 -0
  40. package/dist/controller/defaults.d.ts +19 -0
  41. package/dist/controller/defaults.js +17 -0
  42. package/dist/controller/index.d.ts +19 -0
  43. package/dist/controller/index.js +46 -0
  44. package/dist/delivery/ChoiceInput.d.ts +25 -0
  45. package/dist/delivery/ChoiceInput.js +36 -0
  46. package/dist/delivery/Main.d.ts +23 -0
  47. package/dist/delivery/Main.js +37 -0
  48. package/dist/delivery/Matrix.d.ts +29 -0
  49. package/dist/delivery/Matrix.js +81 -0
  50. package/dist/delivery/index.d.ts +22 -0
  51. package/dist/delivery/index.js +45 -0
  52. package/dist/delivery/session-updater.d.ts +9 -0
  53. package/dist/index.d.ts +1 -0
  54. package/dist/index.iife.d.ts +8 -0
  55. package/dist/index.iife.js +164 -0
  56. package/dist/index.js +2 -0
  57. package/dist/runtime-support.d.ts +12 -0
  58. package/dist/runtime-support.js +12 -0
  59. package/package.json +84 -19
  60. package/CHANGELOG.json +0 -1
  61. package/CHANGELOG.md +0 -1409
  62. package/LICENSE.md +0 -5
  63. package/README.md +0 -59
  64. package/configure/CHANGELOG.json +0 -1
  65. package/configure/CHANGELOG.md +0 -1335
  66. package/configure/lib/HeaderCommon.js +0 -28
  67. package/configure/lib/HeaderCommon.js.map +0 -1
  68. package/configure/lib/Main.js +0 -179
  69. package/configure/lib/Main.js.map +0 -1
  70. package/configure/lib/MatrixColumnsSizeHeaderInput.js +0 -56
  71. package/configure/lib/MatrixColumnsSizeHeaderInput.js.map +0 -1
  72. package/configure/lib/MatrixLabelEditableButton.js +0 -224
  73. package/configure/lib/MatrixLabelEditableButton.js.map +0 -1
  74. package/configure/lib/MatrixLabelTypeHeaderInput.js +0 -98
  75. package/configure/lib/MatrixLabelTypeHeaderInput.js.map +0 -1
  76. package/configure/lib/MatrixRowsSizeHeaderInput.js +0 -56
  77. package/configure/lib/MatrixRowsSizeHeaderInput.js.map +0 -1
  78. package/configure/lib/MatrixValues.js +0 -217
  79. package/configure/lib/MatrixValues.js.map +0 -1
  80. package/configure/lib/NumberInput.js +0 -77
  81. package/configure/lib/NumberInput.js.map +0 -1
  82. package/configure/lib/columnLabelsGenerator.js +0 -49
  83. package/configure/lib/columnLabelsGenerator.js.map +0 -1
  84. package/configure/lib/defaults.js +0 -86
  85. package/configure/lib/defaults.js.map +0 -1
  86. package/configure/lib/index.js +0 -98
  87. package/configure/lib/index.js.map +0 -1
  88. package/configure/lib/isNumeric.js +0 -11
  89. package/configure/lib/isNumeric.js.map +0 -1
  90. package/configure/lib/matrixEntities.js +0 -16
  91. package/configure/lib/matrixEntities.js.map +0 -1
  92. package/configure/package.json +0 -28
  93. package/controller/CHANGELOG.json +0 -1
  94. package/controller/CHANGELOG.md +0 -88
  95. package/controller/lib/defaults.js +0 -17
  96. package/controller/lib/defaults.js.map +0 -1
  97. package/controller/lib/index.js +0 -96
  98. package/controller/lib/index.js.map +0 -1
  99. package/controller/package.json +0 -17
  100. package/docs/config-schema.json +0 -1475
  101. package/docs/config-schema.json.md +0 -1093
  102. package/docs/demo/config.js +0 -8
  103. package/docs/demo/generate.js +0 -9
  104. package/docs/demo/index.html +0 -1
  105. package/docs/demo/session.js +0 -6
  106. package/docs/pie-schema.json +0 -1
  107. package/docs/pie-schema.json.md +0 -1
  108. package/lib/ChoiceInput.js +0 -59
  109. package/lib/ChoiceInput.js.map +0 -1
  110. package/lib/Main.js +0 -42
  111. package/lib/Main.js.map +0 -1
  112. package/lib/Matrix.js +0 -104
  113. package/lib/Matrix.js.map +0 -1
  114. package/lib/index.js +0 -80
  115. package/lib/index.js.map +0 -1
  116. package/lib/session-updater.js +0 -10
  117. package/lib/session-updater.js.map +0 -1
@@ -0,0 +1,29 @@
1
+ /**
2
+ * @synced-from pie-elements/packages/matrix/configure/src/MatrixValues.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 const ScoringContainer: any;
12
+ export declare const MatrixColumns: any;
13
+ export declare const ColumnLabelWrapper: any;
14
+ export declare const RowLabelWrapper: any;
15
+ export declare const ValueRowWrapper: any;
16
+ export declare const ValueItemWrapper: any;
17
+ export declare const ScoringRows: any;
18
+ export declare const ScoringNumberInputWrapper: any;
19
+ export declare const GridSeparatorHorizontal: any;
20
+ export declare const GridSeparatorVertical: any;
21
+ export declare const Content: any;
22
+ declare const MatrixValues: {
23
+ (props: any): React.JSX.Element;
24
+ propTypes: {
25
+ model: PropTypes.Validator<object>;
26
+ onChangeModel: PropTypes.Validator<(...args: any[]) => any>;
27
+ };
28
+ };
29
+ export default MatrixValues;
@@ -0,0 +1,156 @@
1
+ import e from "./NumberInput.js";
2
+ import t from "./isNumeric.js";
3
+ import n, { ACTION_TYPE as r } from "./MatrixLabelEditableButton.js";
4
+ import "react";
5
+ import i from "prop-types";
6
+ import { jsx as a, jsxs as o } from "react/jsx-runtime";
7
+ import s from "styled-components";
8
+ //#region src/author/MatrixValues.tsx
9
+ var c = "120px", l = s.div`
10
+ display: grid;
11
+ grid-template-columns: min-content min-content auto;
12
+ `, u = s.div`
13
+ display: flex;
14
+ justify-content: space-between;
15
+ padding: 5px;
16
+ `, d = s.div`
17
+ width: ${c};
18
+ display: flex;
19
+ align-items: center;
20
+ justify-content: center;
21
+ `, f = s.div`
22
+ width: 200px;
23
+ display: flex;
24
+ align-items: center;
25
+ justify-content: center;
26
+ `, p = s.div`
27
+ display: flex;
28
+ justify-content: space-between;
29
+ `, m = s.div`
30
+ width: ${c};
31
+ height: 50px;
32
+ margin: 1px;
33
+ display: flex;
34
+ align-items: center;
35
+ justify-content: center;
36
+ `, h = s.div`
37
+ display: flex;
38
+ flex-direction: column;
39
+ justify-content: space-between;
40
+ padding: 5px;
41
+ `, g = s.div`
42
+ width: 60px;
43
+ justify-self: center;
44
+ align-self: center;
45
+ `, _ = s.div`
46
+ background: gray;
47
+ width: 100%;
48
+ height: 1px;
49
+ `, v = s.div`
50
+ background: gray;
51
+ width: 1px;
52
+ height: 100%;
53
+ `, y = s.div`
54
+ padding: 5px;
55
+ `, b = (i) => {
56
+ let { model: s, onChangeModel: c } = i, { rowLabels: b, columnLabels: x, matrixValues: S, spellCheckEnabled: C } = s, w = (e, n) => {
57
+ let r = { ...S };
58
+ t(n) ? r[e] = parseInt(n, 10) : delete r[e], c({
59
+ ...s,
60
+ matrixValues: r
61
+ });
62
+ }, T = (e, t) => {
63
+ let n = [...x];
64
+ n[e] = t, c({
65
+ ...s,
66
+ columnLabels: n
67
+ });
68
+ }, E = (e, t) => {
69
+ let n = [...b];
70
+ n[e] = t, c({
71
+ ...s,
72
+ rowLabels: n
73
+ });
74
+ }, D = ({ resourceIndex: e, actionType: t, setValue: n }) => {
75
+ let i = e, a = { ...S };
76
+ b.forEach((e, o) => {
77
+ switch (t) {
78
+ case r.clear:
79
+ delete a[`${o}-${i}`];
80
+ break;
81
+ case r.sortAscending:
82
+ a[`${o}-${i}`] = o + 1;
83
+ break;
84
+ case r.sortDescending:
85
+ a[`${o}-${i}`] = b.length - o;
86
+ break;
87
+ case r.set:
88
+ a[`${o}-${i}`] = n;
89
+ break;
90
+ default: throw "Incorrect actionType";
91
+ }
92
+ }), c({
93
+ ...s,
94
+ matrixValues: a
95
+ });
96
+ }, O = ({ resourceIndex: e, actionType: t, setValue: n }) => {
97
+ let i = e, a = { ...S };
98
+ x.forEach((e, o) => {
99
+ switch (t) {
100
+ case r.clear:
101
+ delete a[`${i}-${o}`];
102
+ break;
103
+ case r.sortAscending:
104
+ a[`${i}-${o}`] = i + 1;
105
+ break;
106
+ case r.sortDescending:
107
+ a[`${i}-${o}`] = b.length - i;
108
+ break;
109
+ case r.set:
110
+ a[`${i}-${o}`] = n;
111
+ break;
112
+ default: throw "Incorrect actionType";
113
+ }
114
+ }), c({
115
+ ...s,
116
+ matrixValues: a
117
+ });
118
+ };
119
+ return /* @__PURE__ */ o(l, { children: [
120
+ /* @__PURE__ */ a("div", {}),
121
+ /* @__PURE__ */ a(v, {}),
122
+ /* @__PURE__ */ a(u, { children: x.map((e, t) => /* @__PURE__ */ a(d, { children: /* @__PURE__ */ a(n, {
123
+ resourceIndex: t,
124
+ onAction: D,
125
+ value: e,
126
+ onLabelUpdate: (e) => T(t, e),
127
+ spellCheck: C
128
+ }) }, t)) }),
129
+ /* @__PURE__ */ a(_, {}),
130
+ /* @__PURE__ */ a(v, {}),
131
+ /* @__PURE__ */ a(_, {}),
132
+ /* @__PURE__ */ a(h, { children: b.map((e, t) => /* @__PURE__ */ a(f, { children: /* @__PURE__ */ a(n, {
133
+ resourceIndex: t,
134
+ onAction: O,
135
+ value: e,
136
+ onLabelUpdate: (e) => E(t, e),
137
+ spellCheck: C
138
+ }) }, t)) }),
139
+ /* @__PURE__ */ a(v, {}),
140
+ /* @__PURE__ */ a(y, { children: b.map((n, r) => /* @__PURE__ */ a(p, { children: x.map((n, i) => {
141
+ let o = `${r}-${i}`;
142
+ return /* @__PURE__ */ a(m, { children: /* @__PURE__ */ a(g, { children: /* @__PURE__ */ a(e, {
143
+ onFieldUpdate: (e) => w(o, e),
144
+ name: o,
145
+ placeholder: "#",
146
+ fieldValue: { value: t(S[o]) ? S[o] : "" }
147
+ }) }) }, i);
148
+ }) }, r)) })
149
+ ] });
150
+ };
151
+ b.propTypes = {
152
+ model: i.object.isRequired,
153
+ onChangeModel: i.func.isRequired
154
+ };
155
+ //#endregion
156
+ export { b as default };
@@ -0,0 +1,20 @@
1
+ /**
2
+ * @synced-from pie-elements/packages/matrix/configure/src/NumberInput.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 * as React from 'react';
10
+ import PropTypes from 'prop-types';
11
+ declare const NumericInput: {
12
+ (props: any): React.JSX.Element;
13
+ propTypes: {
14
+ name: PropTypes.Validator<string>;
15
+ placeholder: PropTypes.Validator<string>;
16
+ fieldValue: PropTypes.Validator<object>;
17
+ onFieldUpdate: PropTypes.Validator<(...args: any[]) => any>;
18
+ };
19
+ };
20
+ export default NumericInput;
@@ -0,0 +1,61 @@
1
+ import "react";
2
+ import e from "prop-types";
3
+ import { jsx as t } from "react/jsx-runtime";
4
+ import { styled as n } from "@mui/material/styles";
5
+ import { TextField as r } from "@mui/material";
6
+ //#region src/author/NumberInput.tsx
7
+ var i = n("div")`
8
+ width: 100%;
9
+ height: 100%;
10
+ input[type='number'] {
11
+ -moz-appearance: textfield;
12
+ }
13
+
14
+ input::-webkit-outer-spin-button,
15
+ input::-webkit-inner-spin-button {
16
+ -webkit-appearance: none;
17
+ }
18
+ `, a = n(r)({
19
+ "& .MuiOutlinedInput-root": {
20
+ fontSize: "16px",
21
+ textAlign: "center!important",
22
+ padding: "0!important",
23
+ margin: "5px 0",
24
+ "&:hover .MuiOutlinedInput-notchedOutline": { borderColor: "gray !important" },
25
+ "&.Mui-focused .MuiOutlinedInput-notchedOutline": {
26
+ borderColor: "green !important",
27
+ borderWidth: "1px !important"
28
+ }
29
+ },
30
+ "& .MuiOutlinedInput-input": {
31
+ fontSize: "16px",
32
+ textAlign: "center",
33
+ padding: "0",
34
+ margin: "5px 0"
35
+ },
36
+ "& .MuiOutlinedInput-notchedOutline": {
37
+ borderWidth: "1px !important",
38
+ borderColor: "#d6d6d6 !important"
39
+ }
40
+ }), o = (e) => {
41
+ let { onFieldUpdate: n, name: r, placeholder: o, fieldValue: s } = e;
42
+ return /* @__PURE__ */ t(i, { children: /* @__PURE__ */ t(a, {
43
+ name: r,
44
+ value: s.value,
45
+ inputRef: s.ref,
46
+ type: "number",
47
+ placeholder: o,
48
+ onChange: (e) => {
49
+ n(e.target.value);
50
+ },
51
+ variant: "outlined"
52
+ }) });
53
+ };
54
+ o.propTypes = {
55
+ name: e.string.isRequired,
56
+ placeholder: e.string.isRequired,
57
+ fieldValue: e.object.isRequired,
58
+ onFieldUpdate: e.func.isRequired
59
+ };
60
+ //#endregion
61
+ export { o as default };
@@ -0,0 +1,11 @@
1
+ /**
2
+ * @synced-from pie-elements/packages/matrix/configure/src/columnLabelsGenerator.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 declare const AGREEMENT_3: string[];
10
+ declare const generateColumnLabels: (labelType: any, size: any) => any;
11
+ export default generateColumnLabels;
@@ -0,0 +1,101 @@
1
+ //#region src/author/columnLabelsGenerator.ts
2
+ var e = [
3
+ "Disagree",
4
+ "Unsure",
5
+ "Agree"
6
+ ], t = [
7
+ "Strongly Disagree",
8
+ ...e,
9
+ "Strongly Agree"
10
+ ], n = [
11
+ "Extremely Disagree",
12
+ ...t,
13
+ "Extremely Agree"
14
+ ], r = [
15
+ "Infrequently",
16
+ "Unsure",
17
+ "Frequently"
18
+ ], i = [
19
+ "Very Infrequently",
20
+ ...r,
21
+ "Very Frequently"
22
+ ], a = [
23
+ "Never",
24
+ ...i,
25
+ "Always"
26
+ ], o = [
27
+ "No",
28
+ "Unsure",
29
+ "Yes"
30
+ ], s = [
31
+ "No",
32
+ "Not really",
33
+ "Unsure",
34
+ "Sometimes",
35
+ "Yes"
36
+ ], c = [
37
+ "No",
38
+ "Rarely",
39
+ "Not really",
40
+ "Unsure",
41
+ "Sometimes",
42
+ "Very Often",
43
+ "Always"
44
+ ], l = [
45
+ "Not Likely",
46
+ "Unsure",
47
+ "Likely"
48
+ ], u = [
49
+ "Very Unlikely",
50
+ ...l,
51
+ "Very Likely"
52
+ ], d = [
53
+ "Extremely Unlikely",
54
+ ...u,
55
+ "Extremely Likely"
56
+ ], f = [
57
+ "Not Important",
58
+ "Unsure",
59
+ "Important"
60
+ ], p = [
61
+ "Very Not Important",
62
+ ...f,
63
+ "Very Important"
64
+ ], m = [
65
+ "Extremely Not Important",
66
+ ...p,
67
+ "Extremely Important"
68
+ ], h = [
69
+ "Dislike",
70
+ "Unsure",
71
+ "Like"
72
+ ], g = [
73
+ "Really Dislike",
74
+ ...h,
75
+ "Really Like"
76
+ ], _ = {
77
+ agreement_3: e,
78
+ agreement_5: t,
79
+ agreement_7: n,
80
+ frequency_3: r,
81
+ frequency_5: i,
82
+ frequency_7: a,
83
+ yesNo_3: o,
84
+ yesNo_5: s,
85
+ yesNo_7: c,
86
+ likelihood_3: l,
87
+ likelihood_5: u,
88
+ likelihood_7: d,
89
+ importance_3: f,
90
+ importance_5: p,
91
+ importance_7: m,
92
+ like_3: h,
93
+ like_5: g,
94
+ like_7: [
95
+ "Extremely Dislike",
96
+ ...g,
97
+ "Extremely Like"
98
+ ]
99
+ }, v = (e, t) => _[`${e}_${t}`];
100
+ //#endregion
101
+ export { v as default };
@@ -0,0 +1,88 @@
1
+ /**
2
+ * @synced-from pie-elements/packages/matrix/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
+ /** NOTE: teacherInstructions, studentInstructions, rationale & scoringType
10
+ * functionalities are not defined yet - the value for those can belong to
11
+ * model or to configure
12
+ */
13
+ declare const _default: {
14
+ model: {
15
+ columnLabels: string[];
16
+ labelType: string;
17
+ matrixValues: {};
18
+ prompt: string;
19
+ promptEnabled: boolean;
20
+ rowLabels: string[];
21
+ teacherInstructions: string;
22
+ teacherInstructionsEnabled: boolean;
23
+ };
24
+ configuration: {
25
+ baseInputConfiguration: {
26
+ h3: {
27
+ disabled: boolean;
28
+ };
29
+ audio: {
30
+ disabled: boolean;
31
+ };
32
+ video: {
33
+ disabled: boolean;
34
+ };
35
+ image: {
36
+ disabled: boolean;
37
+ };
38
+ textAlign: {
39
+ disabled: boolean;
40
+ };
41
+ showParagraphs: {
42
+ disabled: boolean;
43
+ };
44
+ separateParagraphs: {
45
+ disabled: boolean;
46
+ };
47
+ };
48
+ prompt: {
49
+ settings: boolean;
50
+ label: string;
51
+ inputConfiguration: {
52
+ audio: {
53
+ disabled: boolean;
54
+ };
55
+ video: {
56
+ disabled: boolean;
57
+ };
58
+ image: {
59
+ disabled: boolean;
60
+ };
61
+ };
62
+ required: boolean;
63
+ };
64
+ settingsPanelDisabled: boolean;
65
+ spellCheck: {
66
+ label: string;
67
+ settings: boolean;
68
+ enabled: boolean;
69
+ };
70
+ teacherInstructions: {
71
+ settings: boolean;
72
+ label: string;
73
+ inputConfiguration: {
74
+ audio: {
75
+ disabled: boolean;
76
+ };
77
+ video: {
78
+ disabled: boolean;
79
+ };
80
+ image: {
81
+ disabled: boolean;
82
+ };
83
+ };
84
+ required: boolean;
85
+ };
86
+ };
87
+ };
88
+ export default _default;
@@ -0,0 +1,56 @@
1
+ //#region src/author/defaults.ts
2
+ var e = {
3
+ model: {
4
+ columnLabels: [
5
+ "COLUMN 1",
6
+ "COLUMN 2",
7
+ "COLUMN 3"
8
+ ],
9
+ labelType: "agreement",
10
+ matrixValues: {},
11
+ prompt: "",
12
+ promptEnabled: !0,
13
+ rowLabels: ["STATEMENT 1", "STATEMENT 2"],
14
+ teacherInstructions: "",
15
+ teacherInstructionsEnabled: !0
16
+ },
17
+ configuration: {
18
+ baseInputConfiguration: {
19
+ h3: { disabled: !0 },
20
+ audio: { disabled: !1 },
21
+ video: { disabled: !1 },
22
+ image: { disabled: !1 },
23
+ textAlign: { disabled: !0 },
24
+ showParagraphs: { disabled: !1 },
25
+ separateParagraphs: { disabled: !0 }
26
+ },
27
+ prompt: {
28
+ settings: !0,
29
+ label: "Prompt",
30
+ inputConfiguration: {
31
+ audio: { disabled: !1 },
32
+ video: { disabled: !1 },
33
+ image: { disabled: !1 }
34
+ },
35
+ required: !1
36
+ },
37
+ settingsPanelDisabled: !1,
38
+ spellCheck: {
39
+ label: "Spellcheck",
40
+ settings: !1,
41
+ enabled: !0
42
+ },
43
+ teacherInstructions: {
44
+ settings: !0,
45
+ label: "Teacher Instructions",
46
+ inputConfiguration: {
47
+ audio: { disabled: !1 },
48
+ video: { disabled: !1 },
49
+ image: { disabled: !1 }
50
+ },
51
+ required: !1
52
+ }
53
+ }
54
+ };
55
+ //#endregion
56
+ export { e as default };
@@ -0,0 +1,31 @@
1
+ /**
2
+ * @synced-from pie-elements/packages/matrix/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 Matrix extends HTMLElement {
10
+ static createDefaultModel: (model?: {}) => {
11
+ columnLabels: string[];
12
+ labelType: string;
13
+ matrixValues: {};
14
+ prompt: string;
15
+ promptEnabled: boolean;
16
+ rowLabels: string[];
17
+ teacherInstructions: string;
18
+ teacherInstructionsEnabled: boolean;
19
+ };
20
+ constructor();
21
+ set model(s: any);
22
+ set configuration(c: any);
23
+ set disableSidePanel(s: any);
24
+ dispatchModelUpdated(reset: any): void;
25
+ onModelChanged(m: any, reset: any): void;
26
+ onConfigurationChanged(c: any): void;
27
+ insertSound(handler: any): void;
28
+ onDeleteSound(src: any, done: any): void;
29
+ _render(): void;
30
+ disconnectedCallback(): void;
31
+ }
@@ -0,0 +1,66 @@
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 { defaults as i } from "@pie-element/shared-lodash";
6
+ import a from "debug";
7
+ import { DeleteSoundEvent as o, InsertSoundEvent as s, ModelUpdatedEvent as c } from "@pie-element/shared-configure-events";
8
+ //#region src/author/index.ts
9
+ var l = a("matrix:configure"), u = (e, n) => ({
10
+ configuration: i(e, t.configuration),
11
+ model: n
12
+ }), d = class i extends HTMLElement {
13
+ static createDefaultModel = (e = {}) => ({
14
+ ...t.model,
15
+ ...e
16
+ });
17
+ constructor() {
18
+ super(), this._root = null, this._model = i.createDefaultModel(), this._configuration = t.configuration, this.onModelChanged = this.onModelChanged.bind(this), this.onConfigurationChanged = this.onConfigurationChanged.bind(this);
19
+ }
20
+ set model(e) {
21
+ this._model = i.createDefaultModel(e), this._render();
22
+ }
23
+ set configuration(e) {
24
+ let t = u(e, this._model);
25
+ this.onModelChanged(t.model), this._configuration = t.configuration, this._render();
26
+ }
27
+ set disableSidePanel(e) {
28
+ this._disableSidePanel = e, this._render();
29
+ }
30
+ dispatchModelUpdated(e) {
31
+ let t = !!e;
32
+ this.dispatchEvent(new c(this._model, t));
33
+ }
34
+ onModelChanged(e, t) {
35
+ this._model = e, this._render(), this.dispatchModelUpdated(t);
36
+ }
37
+ onConfigurationChanged(e) {
38
+ this._configuration = u(e, this._model).configuration, this._model && this.onModelChanged(this._model), this._render();
39
+ }
40
+ insertSound(e) {
41
+ this.dispatchEvent(new s(e));
42
+ }
43
+ onDeleteSound(e, t) {
44
+ this.dispatchEvent(new o(e, t));
45
+ }
46
+ _render() {
47
+ l("_render");
48
+ let t = n.createElement(e, {
49
+ model: this._model,
50
+ configuration: this._configuration,
51
+ onModelChanged: this.onModelChanged,
52
+ onConfigurationChanged: this.onConfigurationChanged,
53
+ disableSidePanel: this._disableSidePanel,
54
+ uploadSoundSupport: {
55
+ add: this.insertSound.bind(this),
56
+ delete: this.onDeleteSound.bind(this)
57
+ }
58
+ });
59
+ this._root ||= r(this), this._root.render(t);
60
+ }
61
+ disconnectedCallback() {
62
+ this._root && this._root.unmount();
63
+ }
64
+ };
65
+ //#endregion
66
+ export { d as default };
@@ -0,0 +1,10 @@
1
+ /**
2
+ * @synced-from pie-elements/packages/matrix/configure/src/isNumeric.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: (value: any) => boolean;
10
+ export default _default;
@@ -0,0 +1,4 @@
1
+ //#region src/author/isNumeric.ts
2
+ var e = (e) => /^-?\d+$/.test(e);
3
+ //#endregion
4
+ export { e as default };
@@ -0,0 +1,17 @@
1
+ /**
2
+ * @synced-from pie-elements/packages/matrix/configure/src/matrixEntities.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 declare const MATRIX_LABEL_TYPE: {
10
+ agreement: string;
11
+ frequency: string;
12
+ yesNo: string;
13
+ importance: string;
14
+ likelihood: string;
15
+ like: string;
16
+ custom: string;
17
+ };
@@ -0,0 +1,12 @@
1
+ //#region src/author/matrixEntities.ts
2
+ var e = {
3
+ agreement: "agreement",
4
+ frequency: "frequency",
5
+ yesNo: "yesNo",
6
+ importance: "importance",
7
+ likelihood: "likelihood",
8
+ like: "like",
9
+ custom: "custom"
10
+ };
11
+ //#endregion
12
+ export { e as MATRIX_LABEL_TYPE };