@pie-element/placement-ordering 14.1.2-next.4 → 14.1.2-next.6

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 (33) hide show
  1. package/dist/author/choice-editor.js +2 -2
  2. package/dist/author/choice-tile.js +3 -2
  3. package/dist/author/design.js +1 -1
  4. package/dist/author/index.d.ts +1 -0
  5. package/dist/author/index.js +5 -2
  6. package/dist/browser/author/index.js +22660 -25834
  7. package/dist/browser/author/index.js.map +1 -1
  8. package/dist/browser/{browser-DHPggtaA.js → browser-Bd36Xf5z.js} +2 -2
  9. package/dist/browser/browser-Bd36Xf5z.js.map +1 -0
  10. package/dist/browser/controller/index.js +3 -3
  11. package/dist/browser/controller/index.js.map +1 -1
  12. package/dist/browser/delivery/index.js +436 -307
  13. package/dist/browser/delivery/index.js.map +1 -1
  14. package/dist/browser/{dist-D9ARZhQk.js → dist-DiGNNRzu.js} +2 -2
  15. package/dist/browser/{dist-D9ARZhQk.js.map → dist-DiGNNRzu.js.map} +1 -1
  16. package/dist/browser/{drag-provider-C1slTlsc.js → drag-provider-BdfhGCEU.js} +2474 -2529
  17. package/dist/browser/drag-provider-BdfhGCEU.js.map +1 -0
  18. package/dist/controller/scoring.js +1 -1
  19. package/dist/delivery/index.js +2 -2
  20. package/dist/delivery/keyboard-coordinates.d.ts +35 -0
  21. package/dist/delivery/keyboard-coordinates.js +48 -0
  22. package/dist/delivery/main.js +1 -1
  23. package/dist/delivery/ordering.js +1 -1
  24. package/dist/delivery/placement-ordering.d.ts +11 -0
  25. package/dist/delivery/placement-ordering.js +147 -79
  26. package/dist/delivery/tile.d.ts +3 -0
  27. package/dist/delivery/tile.js +66 -57
  28. package/dist/delivery/tiler.d.ts +6 -0
  29. package/dist/delivery/tiler.js +6 -3
  30. package/dist/index.iife.js +35 -35
  31. package/package.json +15 -9
  32. package/dist/browser/browser-DHPggtaA.js.map +0 -1
  33. package/dist/browser/drag-provider-C1slTlsc.js.map +0 -1
@@ -27,4 +27,4 @@ var a = r("pie-elements:placement-ordering:controller"), o = (e) => /* @__PURE__
27
27
  }), a;
28
28
  };
29
29
  //#endregion
30
- export { c as flattenCorrect, l as getAllCorrectResponses, u as score };
30
+ export { c as flattenCorrect, l as getAllCorrectResponses, o as illegalArgumentError, s as pairwiseCombinationScore, u as score };
@@ -60,10 +60,10 @@ var s = i("pie-elements:placement-ordering"), c = ({ model: e, session: t }) =>
60
60
  }
61
61
  }
62
62
  connectedCallback() {
63
- this._initMathObserver();
63
+ this._initMathObserver(), this.render();
64
64
  }
65
65
  disconnectedCallback() {
66
- this._disconnectMathObserver(), this._root && this._root.unmount();
66
+ this._disconnectMathObserver(), this._root &&= (this._root.unmount(), null);
67
67
  }
68
68
  };
69
69
  //#endregion
@@ -0,0 +1,35 @@
1
+ /**
2
+ * @synced-from pie-elements/packages/placement-ordering/src/keyboard-coordinates.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
+ /**
10
+ * Custom keyboard coordinate getter for placement-ordering's Tab-based placement mode
11
+ * (enabled only when the item is configured with `placementArea` / `includeTargets`).
12
+ *
13
+ * Tab/Shift+Tab cycle the dragged choice directly onto the next/previous enabled
14
+ * droppable (a placement/target tile, or an empty gap left behind in the choices row),
15
+ * in real on-screen position order, placing the dragged item's own top-left corner at
16
+ * the target's center-left point.
17
+ *
18
+ * Arrow keys are delegated to dnd-kit's own `defaultKeyboardCoordinateGetter` so the
19
+ * pre-existing free-form arrow-key dragging behavior is left completely unchanged.
20
+ *
21
+ * The tile currently being dragged already disables its own droppable
22
+ * (see `useDroppable({ disabled: isDragging })` in tile.jsx), so it's naturally
23
+ * excluded from the candidate list here without any extra bookkeeping.
24
+ *
25
+ * When picking up a choice from the choices row, the other not-yet-placed choice
26
+ * tiles are also registered droppables (tile.jsx disables a droppable only while it's
27
+ * the one being dragged), but dropping a choice onto another choice is a no-op in the
28
+ * reducer (ordering.js's updateResponse has no `choice -> choice` case) — so they're
29
+ * excluded from the Tab/Shift+Tab cycle, leaving only the real placement targets.
30
+ */
31
+ export declare const closestDroppableKeyboardCoordinates: (event: any, { active, context, currentCoordinates }: {
32
+ active: any;
33
+ context: any;
34
+ currentCoordinates: any;
35
+ }) => any;
@@ -0,0 +1,48 @@
1
+ import { KeyboardCode as e, defaultKeyboardCoordinateGetter as t } from "@dnd-kit/core";
2
+ //#region src/delivery/keyboard-coordinates.ts
3
+ var n = (n, { active: i, context: a, currentCoordinates: o }) => {
4
+ let { code: s } = n, c = s === "Tab", l = s === e.Down || s === e.Up || s === e.Left || s === e.Right;
5
+ if (!c && !l) return;
6
+ if (l) return t(n, {
7
+ context: a,
8
+ currentCoordinates: o
9
+ });
10
+ n.preventDefault();
11
+ let { droppableRects: u, droppableContainers: d, collisionRect: f } = a;
12
+ if (!u || u.size === 0) return o;
13
+ let p = {
14
+ x: (f?.width || 0) / 2,
15
+ y: (f?.height || 0) / 2
16
+ }, m = {
17
+ x: o.x + p.x,
18
+ y: o.y + p.y
19
+ }, h = i?.data?.current?.type === "choice", g = [];
20
+ for (let [e, t] of d) {
21
+ if (t?.disabled || h && t?.data?.current?.type === "choice") continue;
22
+ let n = u.get(e);
23
+ if (!n) continue;
24
+ let r = {
25
+ x: n.left + n.width / 2,
26
+ y: n.top + n.height / 2
27
+ }, i = {
28
+ x: n.left,
29
+ y: n.top + n.height / 2
30
+ };
31
+ g.push({
32
+ id: e,
33
+ dropPosition: i,
34
+ center: r
35
+ });
36
+ }
37
+ if (g.length === 0) return o;
38
+ let _ = n.shiftKey;
39
+ g.sort((e, t) => Math.abs(e.center.y - t.center.y) > 10 ? e.center.y - t.center.y : e.center.x - t.center.x);
40
+ let v = 0, y = Infinity;
41
+ for (let e = 0; e < g.length; e++) {
42
+ let t = r(m, g[e].center);
43
+ t < y && (y = t, v = e);
44
+ }
45
+ return g[_ ? (v - 1 + g.length) % g.length : (v + 1) % g.length].dropPosition;
46
+ }, r = (e, t) => Math.sqrt((e.x - t.x) ** 2 + (e.y - t.y) ** 2);
47
+ //#endregion
48
+ export { n as closestDroppableKeyboardCoordinates };
@@ -1,4 +1,4 @@
1
- import e from "./placement-ordering.js";
1
+ import { PlacementOrdering as e } from "./placement-ordering.js";
2
2
  import t from "react";
3
3
  import n from "prop-types";
4
4
  import { jsx as r } from "react/jsx-runtime";
@@ -90,4 +90,4 @@ function f(e, t) {
90
90
  return t;
91
91
  }
92
92
  //#endregion
93
- export { d as buildState, f as reducer };
93
+ export { d as buildState, o as push, f as reducer, s as swap };
@@ -23,6 +23,17 @@ export declare class PlacementOrdering extends React.Component {
23
23
  onRemoveChoice: any;
24
24
  createOrdering: any;
25
25
  onDragEnd: any;
26
+ onDragStart: any;
27
+ onDragCancel: any;
28
+ isSameChoice: (a: any, b: any) => boolean;
29
+ selectChoice: any;
30
+ toggleChoiceSelection: any;
31
+ cancelSelection: any;
32
+ endAnyLiveKeyboardDrag: any;
33
+ placeSelectedChoice: any;
34
+ isClickSoonAfterDragEnd: () => boolean;
35
+ onChoiceClick: any;
36
+ onPlacementClick: any;
26
37
  render(): React.JSX.Element;
27
38
  }
28
39
  export default PlacementOrdering;
@@ -1,62 +1,84 @@
1
1
  import { HorizontalTiler as e, VerticalTiler as t } from "./tiler.js";
2
2
  import { buildState as n, reducer as r } from "./ordering.js";
3
3
  import { haveSameValuesButDifferentOrder as i } from "./utils.js";
4
- import a from "react";
5
- import { difference as o, isEqual as s, uniqueId as c } from "@pie-element/shared-lodash";
6
- import l from "debug";
7
- import { renderMath as u } from "@pie-element/shared-math-rendering-mathjax";
8
- import d from "prop-types";
9
- import f from "react-dom";
10
- import { styled as p } from "@mui/material/styles";
11
- import { closestCenter as m } from "@dnd-kit/core";
12
- import * as h from "@pie-lib/render-ui";
13
- import { Collapsible as g, Feedback as _, PreviewPrompt as v, UiLayout as y, color as b, hasMedia as x, hasText as S } from "@pie-lib/render-ui";
14
- import { jsx as C, jsxs as w } from "react/jsx-runtime";
15
- import T from "@pie-lib/translator";
16
- import E from "@pie-lib/correct-answer-toggle";
17
- import { DragProvider as D } from "@pie-lib/drag";
4
+ import { closestDroppableKeyboardCoordinates as a } from "./keyboard-coordinates.js";
5
+ import o from "react";
6
+ import { difference as s, isEqual as c, uniqueId as l } from "@pie-element/shared-lodash";
7
+ import u from "debug";
8
+ import { renderMath as d } from "@pie-element/shared-math-rendering-mathjax";
9
+ import f from "prop-types";
10
+ import p from "react-dom";
11
+ import { styled as m } from "@mui/material/styles";
12
+ import { rectIntersection as h } from "@dnd-kit/core";
13
+ import { restrictToParentElement as g } from "@dnd-kit/modifiers";
14
+ import * as _ from "@pie-lib/render-ui";
15
+ import { Collapsible as v, Feedback as y, PreviewPrompt as b, UiLayout as x, color as S, hasMedia as C, hasText as w } from "@pie-lib/render-ui";
16
+ import { jsx as T, jsxs as E } from "react/jsx-runtime";
17
+ import D from "@pie-lib/translator";
18
+ import O from "@pie-lib/correct-answer-toggle";
19
+ import { DragProvider as k } from "@pie-lib/drag";
18
20
  //#region src/delivery/placement-ordering.tsx
19
- function O(e) {
21
+ function A(e) {
20
22
  return typeof e == "function" || typeof e == "object" && !!e && typeof e.$$typeof == "symbol";
21
23
  }
22
- function k(e, t) {
23
- return !e || O(e) ? e : O(e.default) ? e.default : t && O(e[t]) ? e[t] : t && O(e[t]?.default) ? e[t].default : e;
24
+ function j(e, t) {
25
+ return !e || A(e) ? e : A(e.default) ? e.default : t && A(e[t]) ? e[t] : t && A(e[t]?.default) ? e[t].default : e;
24
26
  }
25
- var A = k(y, "UiLayout") || k(I.UiLayout, "UiLayout"), j = k(v, "PreviewPrompt") || k(I.PreviewPrompt, "PreviewPrompt"), M = k(_, "Feedback") || k(I.Feedback, "Feedback"), N = k(g, "Collapsible") || k(I.Collapsible, "Collapsible"), P = h, F = P.default, I = F && typeof F == "object" ? F : P, { translator: L } = T, R = l("pie-elements:placement-ordering"), z = p("div")({
26
- color: b.text(),
27
- backgroundColor: b.background(),
27
+ var M = j(x, "UiLayout") || j(R.UiLayout, "UiLayout"), N = j(b, "PreviewPrompt") || j(R.PreviewPrompt, "PreviewPrompt"), P = j(y, "Feedback") || j(R.Feedback, "Feedback"), F = j(v, "Collapsible") || j(R.Collapsible, "Collapsible"), I = _, L = I.default, R = L && typeof L == "object" ? L : I, z = 250, B = (e) => e ? {
28
+ keyboardCoordinateGetter: a,
29
+ keyboardCodes: {
30
+ start: ["Space", "Enter"],
31
+ cancel: ["Escape"],
32
+ end: ["Space", "Enter"]
33
+ },
34
+ accessibility: { screenReaderInstructions: { draggable: "Press Space or Enter to pick up this answer choice. Once picked up, use Tab or Shift+Tab to cycle through response areas, or use arrow keys to move it freely. Press Space or Enter to drop, or Escape to cancel." } }
35
+ } : {}, { translator: V } = D, H = u("pie-elements:placement-ordering"), U = m("div")({
36
+ color: S.text(),
37
+ backgroundColor: S.background(),
28
38
  display: "flex",
29
39
  flexDirection: "column",
30
40
  alignItems: "center",
31
41
  boxSizing: "border-box"
32
- }), B = p("div")(({ theme: e }) => ({ paddingBottom: e.spacing(1) })), V = p("div")(({ theme: e }) => ({ paddingBottom: e.spacing(2) })), H = p(E)(({ theme: e }) => ({ paddingBottom: e.spacing(1) })), U = p(N)(({ theme: e }) => ({
42
+ }), W = m("div")({
43
+ alignSelf: "stretch",
44
+ maxWidth: "100%",
45
+ overflowX: "auto",
46
+ overflowY: "hidden"
47
+ }), G = m("div")({
48
+ display: "flex",
49
+ justifyContent: "center",
50
+ minWidth: "min-content"
51
+ }), K = m("div")(({ theme: e }) => ({ paddingBottom: e.spacing(1) })), q = m("div")(({ theme: e }) => ({ paddingBottom: e.spacing(2) })), J = m(O)(({ theme: e }) => ({ paddingBottom: e.spacing(1) })), Y = m(F)(({ theme: e }) => ({
33
52
  marginBottom: e.spacing(2),
34
53
  alignSelf: "flex-start"
35
- })), W = (e) => {
54
+ })), X = (e) => {
36
55
  let { tiler: t, ordering: n, onDropChoice: r, onRemoveChoice: i, ...a } = e;
37
- return /* @__PURE__ */ C(t, {
56
+ return /* @__PURE__ */ T(t, {
38
57
  ...a,
39
58
  tiles: n.tiles,
40
59
  onDropChoice: (e, t) => r(e, t, n),
41
60
  onRemoveChoice: (e) => i(e, n)
42
61
  });
43
62
  };
44
- W.propTypes = {
45
- tiler: d.func,
46
- ordering: d.any,
47
- onDropChoice: d.func,
48
- onRemoveChoice: d.func
63
+ X.propTypes = {
64
+ tiler: f.func,
65
+ ordering: f.any,
66
+ onDropChoice: f.func,
67
+ onRemoveChoice: f.func
49
68
  };
50
- var G = class extends a.Component {
69
+ var Z = class extends o.Component {
51
70
  static propTypes = {
52
- onSessionChange: d.func.isRequired,
53
- model: d.object.isRequired,
54
- session: d.oneOfType([d.array.isRequired, d.object.isRequired])
71
+ onSessionChange: f.func.isRequired,
72
+ model: f.object.isRequired,
73
+ session: f.oneOfType([f.array.isRequired, f.object.isRequired])
55
74
  };
56
75
  constructor(e) {
57
- super(e), this.instanceId = c();
76
+ super(e), this.instanceId = l();
58
77
  let { value: t, needsReset: n } = this.validateSession(e);
59
- this.state = { showingCorrect: !1 };
78
+ this.state = {
79
+ showingCorrect: !1,
80
+ selectedChoice: null
81
+ }, this.lastDragEndAt = 0;
60
82
  let { model: r } = e || {}, { env: i } = r || {}, { mode: a } = i || {};
61
83
  n && a === "gather" && this.props.onSessionChange({
62
84
  ...e.session,
@@ -65,18 +87,18 @@ var G = class extends a.Component {
65
87
  }
66
88
  toggleCorrect = (e) => this.setState({ showingCorrect: e });
67
89
  componentDidUpdate() {
68
- u(f.findDOMNode(this));
90
+ d(p.findDOMNode(this));
69
91
  }
70
92
  validateSession = ({ model: e, session: t }, n = !1) => {
71
- let { config: r, choices: i } = e || {}, { includeTargets: a } = r || {}, c = i.map((e) => e.id), { value: l } = t || {}, u;
72
- if (a) l && l.length !== c.length && (u = !0, l = l.length < c.length ? l.concat(Array(c.length - l.length)) : l.filter((e) => c.includes(e)));
93
+ let { config: r, choices: i } = e || {}, { includeTargets: a } = r || {}, o = i.map((e) => e.id), { value: l } = t || {}, u;
94
+ if (a) l && l.length !== o.length && (u = !0, l = l.length < o.length ? l.concat(Array(o.length - l.length)) : l.filter((e) => o.includes(e)));
73
95
  else {
74
- if (!l || !l.length || n) l = c;
96
+ if (!l || !l.length || n) l = o;
75
97
  else {
76
- let e = o(c, l), t = o(l, c);
77
- (e.length || t.length) && (l = c);
98
+ let e = s(o, l), t = s(l, o);
99
+ (e.length || t.length) && (l = o);
78
100
  }
79
- u = !s(t.value, l);
101
+ u = !c(t.value, l);
80
102
  }
81
103
  return u && console.warn("This session is not valid anymore. It will be reset."), {
82
104
  value: l,
@@ -84,8 +106,8 @@ var G = class extends a.Component {
84
106
  };
85
107
  };
86
108
  UNSAFE_componentWillReceiveProps(e) {
87
- let { model: t = {} } = e || {}, { model: n = {} } = this.props || {}, { correctResponse: r, config: a, choices: o = [], env: s } = t, { includeTargets: c } = a || {}, l = {}, u = n.language && n.language !== t.language, d = n.note && n.note === L.t("common:commonCorrectAnswerWithAlternates", { lng: n.language });
88
- u && d && (n.note = L.t("common:commonCorrectAnswerWithAlternates", { lng: t.language })), r || (l.showingCorrect = !1);
109
+ let { model: t = {} } = e || {}, { model: n = {} } = this.props || {}, { correctResponse: r, config: a, choices: o = [], env: s } = t, { includeTargets: c } = a || {}, l = {}, u = n.language && n.language !== t.language, d = n.note && n.note === V.t("common:commonCorrectAnswerWithAlternates", { lng: n.language });
110
+ u && d && (n.note = V.t("common:commonCorrectAnswerWithAlternates", { lng: t.language })), r || (l.showingCorrect = !1);
89
111
  let f = i(o, n.choices), { value: p, needsReset: m } = this.validateSession(e, f), h = {
90
112
  ...e.session,
91
113
  value: p
@@ -97,7 +119,7 @@ var G = class extends a.Component {
97
119
  }
98
120
  onDropChoice = (e, t, n) => {
99
121
  let { onSessionChange: i, session: a } = this.props, o = n.tiles.find((e) => e.id === t.id && e.type === t.type && e.index === t.index), s = e;
100
- R("[onDropChoice] ", o, s);
122
+ H("[onDropChoice] ", o, s);
101
123
  let c = r({
102
124
  type: "move",
103
125
  from: o,
@@ -107,7 +129,7 @@ var G = class extends a.Component {
107
129
  };
108
130
  onRemoveChoice = (e, t) => {
109
131
  let { onSessionChange: n, session: i } = this.props;
110
- R("[onRemoveChoice]", e);
132
+ H("[onRemoveChoice]", e);
111
133
  let a = r({
112
134
  type: "remove",
113
135
  target: e
@@ -132,7 +154,7 @@ var G = class extends a.Component {
132
154
  };
133
155
  onDragEnd = (e) => {
134
156
  let { over: t, active: n } = e, r = this.createOrdering();
135
- if (t && n) {
157
+ if (this.cancelSelection(), this.lastDragEndAt = Date.now(), t && n) {
136
158
  let e = n.data.current, i = t.data.current;
137
159
  if (e && i && i.type === "target") {
138
160
  this.onDropChoice(i, e, r);
@@ -144,63 +166,109 @@ var G = class extends a.Component {
144
166
  e && e.type === "target" && this.onRemoveChoice(e, r);
145
167
  }
146
168
  };
169
+ onDragStart = (e) => {
170
+ let { active: t } = e;
171
+ t?.data?.current && this.selectChoice(t.data.current);
172
+ };
173
+ onDragCancel = () => {
174
+ this.cancelSelection(), this.lastDragEndAt = Date.now();
175
+ };
176
+ isSameChoice = (e, t) => !!e && !!t && e.type === t.type && e.id === t.id && e.index === t.index;
177
+ selectChoice = (e) => {
178
+ this.setState({ selectedChoice: e });
179
+ };
180
+ toggleChoiceSelection = (e) => {
181
+ this.setState((t) => ({ selectedChoice: this.isSameChoice(t.selectedChoice, e) ? null : e }));
182
+ };
183
+ cancelSelection = () => {
184
+ this.setState({ selectedChoice: null });
185
+ };
186
+ endAnyLiveKeyboardDrag = () => {
187
+ document.dispatchEvent(new KeyboardEvent("keydown", {
188
+ code: "Escape",
189
+ bubbles: !0,
190
+ cancelable: !0
191
+ }));
192
+ };
193
+ placeSelectedChoice = (e) => {
194
+ let { selectedChoice: t } = this.state;
195
+ if (!t) return;
196
+ let n = this.createOrdering();
197
+ this.onDropChoice(e, t, n), this.cancelSelection(), this.endAnyLiveKeyboardDrag(), this.lastDragEndAt = Date.now();
198
+ };
199
+ isClickSoonAfterDragEnd = () => Date.now() - this.lastDragEndAt < z;
200
+ onChoiceClick = (e) => {
201
+ this.isClickSoonAfterDragEnd() || this.toggleChoiceSelection(e);
202
+ };
203
+ onPlacementClick = (e) => {
204
+ this.isClickSoonAfterDragEnd() || this.placeSelectedChoice(e);
205
+ };
147
206
  render() {
148
- let { model: n } = this.props, { correctResponse: r, correctness: i, extraCSSRules: a, prompt: o, rationale: s, feedback: c, config: l, note: u, showNote: d, env: f, disabled: p, teacherInstructions: h, language: g } = n, _ = r && r.length > 0, { showingCorrect: v } = this.state, y = l || {
207
+ let { model: n } = this.props, { correctResponse: r, correctness: i, extraCSSRules: a, prompt: o, rationale: s, feedback: c, config: l, note: u, showNote: d, env: f, disabled: p, teacherInstructions: m, language: _ } = n, v = r && r.length > 0, { showingCorrect: y } = this.state, b = l || {
149
208
  orientation: "vertical",
150
209
  includeTargets: !0
151
- }, { orientation: T, includeTargets: E } = y, O = T === "vertical", k = this.createOrdering(), { mode: N, role: P } = f || {}, F = O ? t : e, I = (v || N === "view" && P === "instructor") && d && u, L = s && (S(s) || x(s)), R = h && (S(h) || x(h)), G = {
152
- color: b.text(),
153
- backgroundColor: b.background(),
210
+ }, { orientation: x, includeTargets: D } = b, O = x === "vertical", A = this.createOrdering(), { mode: j, role: F } = f || {}, I = O ? t : e, L = (y || j === "view" && F === "instructor") && d && u, R = s && (w(s) || C(s)), z = m && (w(m) || C(m)), V = {
211
+ color: S.text(),
212
+ backgroundColor: S.background(),
154
213
  display: "flex",
155
214
  flexDirection: "column",
156
215
  alignItems: "center",
157
- boxSizing: "border-box"
158
- };
159
- return /* @__PURE__ */ C(D, {
160
- onDragStart: () => {},
216
+ boxSizing: "border-box",
217
+ width: "100%"
218
+ }, H = D ? {
219
+ selectedChoice: this.state.selectedChoice,
220
+ onChoiceClick: this.onChoiceClick,
221
+ onPlacementClick: this.onPlacementClick
222
+ } : {};
223
+ return /* @__PURE__ */ T(k, {
224
+ onDragStart: this.onDragStart,
161
225
  onDragEnd: this.onDragEnd,
162
- collisionDetection: m,
163
- children: /* @__PURE__ */ C(z, { children: /* @__PURE__ */ w(A, {
226
+ onDragCancel: this.onDragCancel,
227
+ collisionDetection: h,
228
+ modifiers: [g],
229
+ ...B(D),
230
+ children: /* @__PURE__ */ T(U, { children: /* @__PURE__ */ E(M, {
164
231
  extraCSSRules: a,
165
- style: G,
232
+ style: V,
166
233
  children: [
167
- R && /* @__PURE__ */ C(U, {
234
+ z && /* @__PURE__ */ T(Y, {
168
235
  labels: {
169
236
  hidden: "Show Teacher Instructions",
170
237
  visible: "Hide Teacher Instructions"
171
238
  },
172
239
  className: "collapsible",
173
- children: /* @__PURE__ */ C(j, { prompt: h })
240
+ children: /* @__PURE__ */ T(N, { prompt: m })
174
241
  }),
175
- /* @__PURE__ */ C(B, { children: /* @__PURE__ */ C(j, { prompt: o }) }),
176
- /* @__PURE__ */ C(H, {
177
- show: _,
178
- toggled: v,
242
+ /* @__PURE__ */ T(K, { children: /* @__PURE__ */ T(N, { prompt: o }) }),
243
+ /* @__PURE__ */ T(J, {
244
+ show: v,
245
+ toggled: y,
179
246
  onToggle: this.toggleCorrect,
180
- language: g
247
+ language: _
181
248
  }),
182
- /* @__PURE__ */ C(W, {
249
+ /* @__PURE__ */ T(W, { children: /* @__PURE__ */ T(G, { children: /* @__PURE__ */ T(X, {
183
250
  instanceId: this.instanceId,
184
- choiceLabel: y.choiceLabel,
185
- targetLabel: y.targetLabel,
186
- ordering: k,
187
- tiler: F,
251
+ choiceLabel: b.choiceLabel,
252
+ targetLabel: b.targetLabel,
253
+ ordering: A,
254
+ tiler: I,
188
255
  disabled: p,
189
- addGuide: y.showOrdering,
190
- tileSize: y.tileSize,
191
- includeTargets: E,
192
- choiceLabelEnabled: n.config && n.config.choiceLabelEnabled
193
- }),
194
- I && /* @__PURE__ */ C(V, { dangerouslySetInnerHTML: { __html: u } }),
195
- L && /* @__PURE__ */ C(U, {
256
+ addGuide: b.showOrdering,
257
+ tileSize: b.tileSize,
258
+ includeTargets: D,
259
+ choiceLabelEnabled: n.config && n.config.choiceLabelEnabled,
260
+ ...H
261
+ }) }) }),
262
+ L && /* @__PURE__ */ T(q, { dangerouslySetInnerHTML: { __html: u } }),
263
+ R && /* @__PURE__ */ T(Y, {
196
264
  labels: {
197
265
  hidden: "Show Rationale",
198
266
  visible: "Hide Rationale"
199
267
  },
200
268
  className: "collapsible",
201
- children: /* @__PURE__ */ C(j, { prompt: s })
269
+ children: /* @__PURE__ */ T(N, { prompt: s })
202
270
  }),
203
- !v && /* @__PURE__ */ C(M, {
271
+ !y && /* @__PURE__ */ T(P, {
204
272
  correctness: i,
205
273
  feedback: c
206
274
  })
@@ -210,4 +278,4 @@ var G = class extends a.Component {
210
278
  }
211
279
  };
212
280
  //#endregion
213
- export { G as default };
281
+ export { Z as PlacementOrdering, Z as default };
@@ -23,6 +23,9 @@ export declare const Tile: {
23
23
  instanceId: PropTypes.Requireable<any>;
24
24
  draggable: PropTypes.Requireable<boolean>;
25
25
  tileIndex: PropTypes.Requireable<number>;
26
+ selectedChoice: PropTypes.Requireable<object>;
27
+ onChoiceClick: PropTypes.Requireable<(...args: any[]) => any>;
28
+ onPlacementClick: PropTypes.Requireable<(...args: any[]) => any>;
26
29
  };
27
30
  };
28
31
  export default Tile;