@pie-lib/mask-markup 3.0.3 → 3.0.4-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 (106) hide show
  1. package/dist/_virtual/_rolldown/runtime.js +4 -0
  2. package/dist/choices/choice.d.ts +24 -0
  3. package/dist/choices/choice.js +77 -0
  4. package/dist/choices/index.d.ts +25 -0
  5. package/dist/choices/index.js +49 -0
  6. package/dist/componentize.d.ts +12 -0
  7. package/dist/componentize.js +4 -0
  8. package/dist/components/blank.d.ts +39 -0
  9. package/dist/components/blank.js +240 -0
  10. package/dist/components/correct-input.d.ts +11 -0
  11. package/dist/components/dropdown.d.ts +37 -0
  12. package/dist/components/dropdown.js +320 -0
  13. package/dist/components/input.d.ts +37 -0
  14. package/dist/constructed-response.d.ts +44 -0
  15. package/dist/constructed-response.js +55 -0
  16. package/dist/customizable.d.ts +43 -0
  17. package/dist/customizable.js +8 -0
  18. package/dist/drag-in-the-blank.d.ts +37 -0
  19. package/dist/drag-in-the-blank.js +164 -0
  20. package/dist/index.d.ts +15 -0
  21. package/dist/index.js +7 -0
  22. package/dist/inline-dropdown.d.ts +44 -0
  23. package/dist/inline-dropdown.js +24 -0
  24. package/dist/mask.d.ts +30 -0
  25. package/dist/mask.js +99 -0
  26. package/dist/node_modules/.bun/to-style@1.3.3/node_modules/to-style/index.js +17 -0
  27. package/dist/node_modules/.bun/to-style@1.3.3/node_modules/to-style/src/cssPrefix.js +9 -0
  28. package/dist/node_modules/.bun/to-style@1.3.3/node_modules/to-style/src/cssUnitless.js +26 -0
  29. package/dist/node_modules/.bun/to-style@1.3.3/node_modules/to-style/src/hasOwn.js +11 -0
  30. package/dist/node_modules/.bun/to-style@1.3.3/node_modules/to-style/src/isFunction.js +11 -0
  31. package/dist/node_modules/.bun/to-style@1.3.3/node_modules/to-style/src/isObject.js +11 -0
  32. package/dist/node_modules/.bun/to-style@1.3.3/node_modules/to-style/src/prefixInfo.js +24 -0
  33. package/dist/node_modules/.bun/to-style@1.3.3/node_modules/to-style/src/prefixProperties.js +32 -0
  34. package/dist/node_modules/.bun/to-style@1.3.3/node_modules/to-style/src/prefixer.js +29 -0
  35. package/dist/node_modules/.bun/to-style@1.3.3/node_modules/to-style/src/stringUtils/camelize.js +14 -0
  36. package/dist/node_modules/.bun/to-style@1.3.3/node_modules/to-style/src/stringUtils/hyphenRe.js +8 -0
  37. package/dist/node_modules/.bun/to-style@1.3.3/node_modules/to-style/src/stringUtils/hyphenate.js +12 -0
  38. package/dist/node_modules/.bun/to-style@1.3.3/node_modules/to-style/src/stringUtils/separate.js +11 -0
  39. package/dist/node_modules/.bun/to-style@1.3.3/node_modules/to-style/src/stringUtils/toLowerFirst.js +10 -0
  40. package/dist/node_modules/.bun/to-style@1.3.3/node_modules/to-style/src/stringUtils/toUpperFirst.js +10 -0
  41. package/dist/node_modules/.bun/to-style@1.3.3/node_modules/to-style/src/toStyleObject.js +55 -0
  42. package/dist/node_modules/.bun/to-style@1.3.3/node_modules/to-style/src/toStyleString.js +16 -0
  43. package/dist/serialization.d.ts +34 -0
  44. package/dist/serialization.js +132 -0
  45. package/dist/with-mask.d.ts +55 -0
  46. package/dist/with-mask.js +45 -0
  47. package/package.json +34 -16
  48. package/CHANGELOG.json +0 -17
  49. package/CHANGELOG.md +0 -1256
  50. package/LICENSE.md +0 -5
  51. package/lib/choices/choice.js +0 -116
  52. package/lib/choices/choice.js.map +0 -1
  53. package/lib/choices/index.js +0 -103
  54. package/lib/choices/index.js.map +0 -1
  55. package/lib/componentize.js +0 -21
  56. package/lib/componentize.js.map +0 -1
  57. package/lib/components/blank.js +0 -371
  58. package/lib/components/blank.js.map +0 -1
  59. package/lib/components/correct-input.js +0 -94
  60. package/lib/components/correct-input.js.map +0 -1
  61. package/lib/components/dropdown.js +0 -468
  62. package/lib/components/dropdown.js.map +0 -1
  63. package/lib/components/input.js +0 -50
  64. package/lib/components/input.js.map +0 -1
  65. package/lib/constructed-response.js +0 -101
  66. package/lib/constructed-response.js.map +0 -1
  67. package/lib/customizable.js +0 -42
  68. package/lib/customizable.js.map +0 -1
  69. package/lib/drag-in-the-blank.js +0 -254
  70. package/lib/drag-in-the-blank.js.map +0 -1
  71. package/lib/index.js +0 -55
  72. package/lib/index.js.map +0 -1
  73. package/lib/inline-dropdown.js +0 -40
  74. package/lib/inline-dropdown.js.map +0 -1
  75. package/lib/mask.js +0 -198
  76. package/lib/mask.js.map +0 -1
  77. package/lib/serialization.js +0 -261
  78. package/lib/serialization.js.map +0 -1
  79. package/lib/with-mask.js +0 -97
  80. package/lib/with-mask.js.map +0 -1
  81. package/src/__tests__/drag-in-the-blank.test.js +0 -111
  82. package/src/__tests__/index.test.js +0 -38
  83. package/src/__tests__/mask.test.js +0 -381
  84. package/src/__tests__/serialization.test.js +0 -54
  85. package/src/__tests__/utils.js +0 -1
  86. package/src/__tests__/with-mask.test.js +0 -76
  87. package/src/choices/__tests__/index.test.js +0 -75
  88. package/src/choices/choice.jsx +0 -97
  89. package/src/choices/index.jsx +0 -64
  90. package/src/componentize.js +0 -13
  91. package/src/components/__tests__/blank.test.js +0 -169
  92. package/src/components/__tests__/correct-input.test.js +0 -90
  93. package/src/components/__tests__/dropdown.test.js +0 -93
  94. package/src/components/__tests__/input.test.js +0 -102
  95. package/src/components/blank.jsx +0 -386
  96. package/src/components/correct-input.jsx +0 -82
  97. package/src/components/dropdown.jsx +0 -410
  98. package/src/components/input.jsx +0 -48
  99. package/src/constructed-response.jsx +0 -87
  100. package/src/customizable.jsx +0 -34
  101. package/src/drag-in-the-blank.jsx +0 -241
  102. package/src/index.js +0 -16
  103. package/src/inline-dropdown.jsx +0 -29
  104. package/src/mask.jsx +0 -172
  105. package/src/serialization.js +0 -260
  106. package/src/with-mask.jsx +0 -75
@@ -0,0 +1,4 @@
1
+ //#region \0rolldown/runtime.js
2
+ var e = (e, t) => () => (t || (e((t = { exports: {} }).exports, t), e = null), t.exports);
3
+ //#endregion
4
+ export { e as __commonJSMin };
@@ -0,0 +1,24 @@
1
+ /**
2
+ * @synced-from pie-lib/packages/mask-markup/src/choices/choice.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 DRAG_TYPE = "MaskBlank";
12
+ declare function Choice({ choice, disabled, instanceId }: {
13
+ choice: any;
14
+ disabled: any;
15
+ instanceId: any;
16
+ }): React.JSX.Element;
17
+ declare namespace Choice {
18
+ var propTypes: {
19
+ choice: PropTypes.Validator<object>;
20
+ disabled: PropTypes.Requireable<boolean>;
21
+ instanceId: PropTypes.Requireable<NonNullable<string | number | null | undefined>>;
22
+ };
23
+ }
24
+ export default Choice;
@@ -0,0 +1,77 @@
1
+ import { useEffect as e, useRef as t } from "react";
2
+ import n from "prop-types";
3
+ import { styled as r } from "@mui/material/styles";
4
+ import { renderMath as i } from "@pie-element/shared-math-rendering-mathjax";
5
+ import { jsx as a } from "react/jsx-runtime";
6
+ import { useDraggable as o } from "@dnd-kit/core";
7
+ import s from "@mui/material/Chip";
8
+ import { color as c } from "@pie-lib/render-ui";
9
+ //#region src/choices/choice.tsx
10
+ var l = "MaskBlank", u = r("span")(({ theme: e, disabled: t }) => ({
11
+ border: `solid 0px ${e.palette.primary.main}`,
12
+ borderRadius: e.spacing(2),
13
+ margin: e.spacing(.5),
14
+ transform: "translate(0, 0)",
15
+ display: "inline-flex",
16
+ ...t && {}
17
+ })), d = r(s)(() => ({
18
+ backgroundColor: c.white(),
19
+ border: `1px solid ${c.text()}`,
20
+ color: c.text(),
21
+ alignItems: "center",
22
+ display: "inline-flex",
23
+ height: "initial",
24
+ minHeight: "32px",
25
+ fontSize: "inherit",
26
+ whiteSpace: "pre-wrap",
27
+ maxWidth: "374px",
28
+ pointerEvents: "none",
29
+ borderRadius: "3px",
30
+ paddingTop: "12px",
31
+ paddingBottom: "12px",
32
+ "&.Mui-disabled": { opacity: 1 }
33
+ })), f = r("span")(() => ({
34
+ whiteSpace: "normal",
35
+ "& img": {
36
+ display: "block",
37
+ padding: "2px 0"
38
+ },
39
+ "& mjx-frac": { fontSize: "120% !important" }
40
+ }));
41
+ function p({ choice: n, disabled: r, instanceId: s }) {
42
+ let c = t(null), { attributes: p, listeners: m, setNodeRef: h, isDragging: g } = o({
43
+ id: `choice-${n.id}`,
44
+ data: {
45
+ choice: n,
46
+ instanceId: s,
47
+ fromChoice: !0,
48
+ type: l
49
+ },
50
+ disabled: r
51
+ });
52
+ return e(() => {
53
+ i(c.current);
54
+ }, [n.value]), /* @__PURE__ */ a(u, {
55
+ ref: h,
56
+ style: g ? {
57
+ width: c.current?.offsetWidth,
58
+ height: c.current?.offsetHeight
59
+ } : {},
60
+ disabled: r,
61
+ ...m,
62
+ ...p,
63
+ children: /* @__PURE__ */ a(d, {
64
+ clickable: !1,
65
+ disabled: r,
66
+ ref: c,
67
+ label: /* @__PURE__ */ a(f, { dangerouslySetInnerHTML: { __html: n.value } })
68
+ })
69
+ });
70
+ }
71
+ p.propTypes = {
72
+ choice: n.object.isRequired,
73
+ disabled: n.bool,
74
+ instanceId: n.oneOfType([n.string, n.number])
75
+ };
76
+ //#endregion
77
+ export { p as default };
@@ -0,0 +1,25 @@
1
+ /**
2
+ * @synced-from pie-lib/packages/mask-markup/src/choices/index.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 default class Choices extends React.Component {
12
+ static propTypes: {
13
+ disabled: PropTypes.Requireable<boolean>;
14
+ duplicates: PropTypes.Requireable<boolean>;
15
+ choices: PropTypes.Requireable<(PropTypes.InferProps<{
16
+ label: PropTypes.Requireable<string>;
17
+ value: PropTypes.Requireable<string>;
18
+ }> | null | undefined)[]>;
19
+ value: PropTypes.Requireable<object>;
20
+ choicePosition: PropTypes.Validator<string>;
21
+ instanceId: PropTypes.Requireable<string>;
22
+ };
23
+ getStyleForWrapper: any;
24
+ render(): React.JSX.Element;
25
+ }
@@ -0,0 +1,49 @@
1
+ import e from "./choice.js";
2
+ import t from "react";
3
+ import n from "prop-types";
4
+ import { findKey as r } from "lodash-es";
5
+ import { jsx as i } from "react/jsx-runtime";
6
+ import { DragDroppablePlaceholder as a } from "@pie-lib/drag";
7
+ //#region src/choices/index.tsx
8
+ var o = class extends t.Component {
9
+ static propTypes = {
10
+ disabled: n.bool,
11
+ duplicates: n.bool,
12
+ choices: n.arrayOf(n.shape({
13
+ label: n.string,
14
+ value: n.string
15
+ })),
16
+ value: n.object,
17
+ choicePosition: n.string.isRequired,
18
+ instanceId: n.string
19
+ };
20
+ getStyleForWrapper = () => {
21
+ let { choicePosition: e } = this.props;
22
+ switch (e) {
23
+ case "above": return { margin: "0 0 40px 0" };
24
+ case "below": return { margin: "40px 0 0 0" };
25
+ case "right": return { margin: "0 0 0 40px" };
26
+ default: return { margin: "0 40px 0 0" };
27
+ }
28
+ };
29
+ render() {
30
+ let { disabled: t, duplicates: n, choices: o, value: s, instanceId: c } = this.props, l = o.filter((e) => n === !0 ? !0 : r(s, (t) => t === e.id) === void 0);
31
+ return /* @__PURE__ */ i("div", {
32
+ style: {
33
+ ...this.getStyleForWrapper(),
34
+ minWidth: "100px"
35
+ },
36
+ children: /* @__PURE__ */ i(a, {
37
+ disabled: t,
38
+ instanceId: c,
39
+ children: l.map((n, r) => /* @__PURE__ */ i(e, {
40
+ disabled: t,
41
+ choice: n,
42
+ instanceId: c
43
+ }, `${n.value}-${r}`))
44
+ })
45
+ });
46
+ }
47
+ };
48
+ //#endregion
49
+ export { o as default };
@@ -0,0 +1,12 @@
1
+ /**
2
+ * @synced-from pie-lib/packages/mask-markup/src/componentize.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: (s: any, t: any) => {
10
+ markup: any;
11
+ };
12
+ export default _default;
@@ -0,0 +1,4 @@
1
+ //#region src/componentize.tsx
2
+ var e = /\{\{(\d+)\}\}/g, t = (t, n) => t ? { markup: t.replace(e, (e, t) => `<span data-component="${n}" data-id="${t}"></span>`) } : { markup: "" };
3
+ //#endregion
4
+ export { t as default };
@@ -0,0 +1,39 @@
1
+ /**
2
+ * @synced-from pie-lib/packages/mask-markup/src/components/blank.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 function DragDropBlank({ id, disabled, duplicates, choice, correct, onChange, emptyResponseAreaWidth, emptyResponseAreaHeight, instanceId, }: {
12
+ id: any;
13
+ disabled: any;
14
+ duplicates: any;
15
+ choice: any;
16
+ correct: any;
17
+ onChange: any;
18
+ emptyResponseAreaWidth: any;
19
+ emptyResponseAreaHeight: any;
20
+ instanceId: any;
21
+ }): React.JSX.Element;
22
+ declare namespace DragDropBlank {
23
+ var defaultProps: {
24
+ emptyResponseAreaWidth: number;
25
+ emptyResponseAreaHeight: number;
26
+ };
27
+ var propTypes: {
28
+ id: PropTypes.Requireable<NonNullable<string | number | null | undefined>>;
29
+ disabled: PropTypes.Requireable<boolean>;
30
+ duplicates: PropTypes.Requireable<boolean>;
31
+ choice: PropTypes.Requireable<object>;
32
+ correct: PropTypes.Requireable<boolean>;
33
+ onChange: PropTypes.Requireable<(...args: any[]) => any>;
34
+ emptyResponseAreaWidth: PropTypes.Requireable<NonNullable<string | number | null | undefined>>;
35
+ emptyResponseAreaHeight: PropTypes.Requireable<NonNullable<string | number | null | undefined>>;
36
+ instanceId: PropTypes.Requireable<string>;
37
+ };
38
+ }
39
+ export default DragDropBlank;
@@ -0,0 +1,240 @@
1
+ import e, { useEffect as t, useRef as n, useState as r } from "react";
2
+ import i from "prop-types";
3
+ import { styled as a } from "@mui/material/styles";
4
+ import { renderMath as o } from "@pie-element/shared-math-rendering-mathjax";
5
+ import s from "debug";
6
+ import { jsx as c, jsxs as l } from "react/jsx-runtime";
7
+ import { useDraggable as u, useDroppable as d } from "@dnd-kit/core";
8
+ import f from "@mui/material/Chip";
9
+ import { color as p } from "@pie-lib/render-ui";
10
+ import { CSS as m } from "@dnd-kit/utilities";
11
+ import h from "classnames";
12
+ import { grey as g } from "@mui/material/colors";
13
+ //#region src/components/blank.tsx
14
+ s("pie-lib:mask-markup:blank");
15
+ var _ = a("span")(({ dragged: e, over: t }) => ({
16
+ border: `solid 0px ${p.primary()}`,
17
+ minWidth: "200px",
18
+ touchAction: "none",
19
+ overflow: "hidden",
20
+ whiteSpace: "nowrap",
21
+ opacity: 1,
22
+ ...t && {
23
+ whiteSpace: "nowrap",
24
+ overflow: "hidden"
25
+ },
26
+ ...e && { opacity: .5 }
27
+ })), v = a(f)(() => ({
28
+ backgroundColor: p.background(),
29
+ border: `2px dashed ${p.text()}`,
30
+ touchAction: "none",
31
+ color: p.text(),
32
+ fontSize: "inherit",
33
+ maxWidth: "374px",
34
+ position: "relative",
35
+ borderRadius: "3px",
36
+ "&.over": {
37
+ whiteSpace: "nowrap",
38
+ overflow: "hidden"
39
+ },
40
+ "&.parentOver": {
41
+ border: `1px solid ${g[500]}`,
42
+ backgroundColor: `${g[300]}`
43
+ },
44
+ "&.correct": { border: `solid 1px ${p.correct()}` },
45
+ "&.incorrect": { border: `solid 1px ${p.incorrect()}` },
46
+ "&.Mui-disabled": { opacity: 1 }
47
+ })), y = a("span")(() => ({
48
+ whiteSpace: "normal",
49
+ pointerEvents: "none",
50
+ "& img": {
51
+ display: "block",
52
+ padding: "2px 0"
53
+ },
54
+ "& p": {
55
+ marginTop: "0",
56
+ marginBottom: "0"
57
+ },
58
+ "& mjx-frac": { fontSize: "120% !important" },
59
+ "&.over": {
60
+ whiteSpace: "nowrap",
61
+ overflow: "hidden"
62
+ },
63
+ "&.hidden": {
64
+ color: "transparent",
65
+ opacity: 0
66
+ },
67
+ "&.dragged": {
68
+ position: "absolute",
69
+ left: 16,
70
+ maxWidth: "60px",
71
+ top: "50%",
72
+ transform: "translateY(-50%)"
73
+ }
74
+ }));
75
+ function b({ disabled: i, choice: a, isOver: s, isDragging: u, dragItem: d, correct: f, emptyResponseAreaWidth: p, emptyResponseAreaHeight: m }) {
76
+ let g = n(null), _ = n(null), b = n(null), [x, S] = r({
77
+ height: 0,
78
+ width: 0
79
+ }), C = () => {
80
+ E();
81
+ }, w = () => {
82
+ let e = _.current?.querySelector("img");
83
+ e ? e.onload = C : setTimeout(() => {
84
+ E();
85
+ }, 300);
86
+ }, T = () => _.current ? _.current.querySelector("mjx-container") && _.current.parentElement ? _.current.parentElement : _.current.querySelector("img") || _.current : null, E = () => {
87
+ if (_.current && g.current) {
88
+ g.current.style.width = "auto", g.current.style.height = "auto", g.current.offsetHeight;
89
+ let e = T() || _.current, t = e.getBoundingClientRect(), n = t.width || e.offsetWidth || 0, r = Math.max(t.height || 0, e.offsetHeight || 0, e.scrollHeight || 0, _.current.scrollHeight || 0), i = n + 24, a = r + 24, o = parseFloat(p) || 0, s = parseFloat(m) || 0, c = i <= o ? o : i, l = a <= s ? s : a;
90
+ S((e) => ({
91
+ width: c > o ? c : e.width,
92
+ height: l > s ? l : e.height
93
+ })), g.current.style.width = `${c}px`, g.current.style.height = `${l}px`;
94
+ }
95
+ }, D = () => {
96
+ let e = isNaN(parseFloat(p)) ? 0 : parseFloat(p), t = isNaN(parseFloat(m)) ? 0 : parseFloat(m);
97
+ return {
98
+ height: x.height || t,
99
+ width: x.width || e,
100
+ ...e ? {} : { minWidth: 90 },
101
+ ...t ? {} : { minHeight: 32 }
102
+ };
103
+ };
104
+ t(() => {
105
+ w();
106
+ }, []), t(() => {
107
+ g.current && o(g.current);
108
+ }, [
109
+ f,
110
+ s,
111
+ d?.choice?.value
112
+ ]), t(() => {
113
+ if (!a) {
114
+ S({
115
+ height: 0,
116
+ width: 0
117
+ });
118
+ return;
119
+ }
120
+ w();
121
+ }, [a]), t(() => {
122
+ !s && !u && (b.current = {
123
+ width: g.current.offsetWidth,
124
+ height: g.current.offsetHeight
125
+ });
126
+ }, [
127
+ a,
128
+ s,
129
+ u
130
+ ]);
131
+ let O = d && s && d.choice && d.choice.value, k = a && a.value, A = s || u ? {
132
+ width: b.current?.width,
133
+ height: b.current?.height
134
+ } : D();
135
+ return /* @__PURE__ */ c(v, {
136
+ clickable: !1,
137
+ disabled: i,
138
+ ref: g,
139
+ component: "span",
140
+ label: /* @__PURE__ */ l(e.Fragment, { children: [/* @__PURE__ */ c(y, {
141
+ ref: _,
142
+ draggable: !0,
143
+ className: h({
144
+ over: s,
145
+ hidden: O
146
+ }),
147
+ dangerouslySetInnerHTML: { __html: k || "" }
148
+ }), O && /* @__PURE__ */ c(y, {
149
+ draggable: !0,
150
+ className: h({
151
+ over: s,
152
+ dragged: !0
153
+ }),
154
+ dangerouslySetInnerHTML: { __html: O || "" }
155
+ })] }),
156
+ className: h({
157
+ over: s,
158
+ parentOver: s,
159
+ correct: f !== void 0 && f,
160
+ incorrect: f !== void 0 && !f
161
+ }),
162
+ variant: i ? "outlined" : void 0,
163
+ style: A
164
+ });
165
+ }
166
+ b.defaultProps = {
167
+ emptyResponseAreaWidth: 0,
168
+ emptyResponseAreaHeight: 0
169
+ }, b.propTypes = {
170
+ id: i.oneOfType([i.string, i.number]),
171
+ disabled: i.bool,
172
+ duplicates: i.bool,
173
+ choice: i.object,
174
+ isOver: i.bool,
175
+ dragItem: i.object,
176
+ correct: i.bool,
177
+ onChange: i.func,
178
+ emptyResponseAreaWidth: i.oneOfType([i.string, i.number]),
179
+ emptyResponseAreaHeight: i.oneOfType([i.string, i.number]),
180
+ instanceId: i.string
181
+ };
182
+ function x({ id: e, disabled: t, duplicates: n, choice: r, correct: i, onChange: a, emptyResponseAreaWidth: o, emptyResponseAreaHeight: s, instanceId: l }) {
183
+ let { attributes: f, listeners: p, setNodeRef: h, transform: g, isDragging: v } = u({
184
+ id: `mask-blank-drag-${e}`,
185
+ disabled: t || !r,
186
+ data: {
187
+ id: e,
188
+ choice: r,
189
+ instanceId: l,
190
+ fromChoice: !1,
191
+ type: "MaskBlank"
192
+ }
193
+ }), { setNodeRef: y, isOver: x, active: S } = d({
194
+ id: `mask-blank-drop-${e}`,
195
+ data: {
196
+ id: e,
197
+ accepts: ["MaskBlank"],
198
+ instanceId: l
199
+ }
200
+ });
201
+ return /* @__PURE__ */ c(_, {
202
+ ref: (e) => {
203
+ h(e), y(e);
204
+ },
205
+ style: { transform: m.Translate.toString(g) },
206
+ dragged: v,
207
+ over: x,
208
+ ...f,
209
+ ...p,
210
+ children: /* @__PURE__ */ c(b, {
211
+ id: e,
212
+ disabled: t,
213
+ duplicates: n,
214
+ choice: r,
215
+ isOver: x,
216
+ dragItem: S?.data?.current,
217
+ correct: i,
218
+ onChange: a,
219
+ emptyResponseAreaWidth: o,
220
+ emptyResponseAreaHeight: s,
221
+ instanceId: l
222
+ })
223
+ });
224
+ }
225
+ x.defaultProps = {
226
+ emptyResponseAreaWidth: 0,
227
+ emptyResponseAreaHeight: 0
228
+ }, x.propTypes = {
229
+ id: i.oneOfType([i.string, i.number]),
230
+ disabled: i.bool,
231
+ duplicates: i.bool,
232
+ choice: i.object,
233
+ correct: i.bool,
234
+ onChange: i.func,
235
+ emptyResponseAreaWidth: i.oneOfType([i.string, i.number]),
236
+ emptyResponseAreaHeight: i.oneOfType([i.string, i.number]),
237
+ instanceId: i.string
238
+ };
239
+ //#endregion
240
+ export { x as default };
@@ -0,0 +1,11 @@
1
+ /**
2
+ * @synced-from pie-lib/packages/mask-markup/src/components/correct-input.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
+ declare const CorrectInput: (props: any) => React.JSX.Element;
11
+ export default CorrectInput;
@@ -0,0 +1,37 @@
1
+ /**
2
+ * @synced-from pie-lib/packages/mask-markup/src/components/dropdown.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 class Dropdown extends React.Component {
12
+ static propTypes: {
13
+ id: PropTypes.Requireable<string>;
14
+ value: PropTypes.Requireable<string>;
15
+ disabled: PropTypes.Requireable<boolean>;
16
+ onChange: PropTypes.Requireable<(...args: any[]) => any>;
17
+ correct: PropTypes.Requireable<boolean>;
18
+ choices: PropTypes.Requireable<(PropTypes.InferProps<{
19
+ value: PropTypes.Requireable<string>;
20
+ label: PropTypes.Requireable<string>;
21
+ }> | null | undefined)[]>;
22
+ showCorrectAnswer: PropTypes.Requireable<boolean>;
23
+ singleQuery: PropTypes.Requireable<boolean>;
24
+ correctValue: PropTypes.Requireable<string>;
25
+ };
26
+ constructor(props: any);
27
+ componentDidMount(): void;
28
+ componentDidUpdate(prevProps: any, prevState: any): void;
29
+ handleClick: any;
30
+ handleClose: any;
31
+ handleHighlight: any;
32
+ handleSelect: any;
33
+ handleHover: any;
34
+ getLabel(choices: any, value: any): any;
35
+ render(): React.JSX.Element;
36
+ }
37
+ export default Dropdown;