@pie-element/placement-ordering 15.0.2-next.20261007003844 → 15.0.2
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.
- package/dist/browser/author/index.js +857 -857
- package/dist/browser/author/index.js.map +1 -1
- package/dist/browser/delivery/index.js +260 -260
- package/dist/browser/delivery/index.js.map +1 -1
- package/dist/browser/{drag-provider-BKqqYjQM.js → drag-provider-D5oUStBV.js} +3510 -2587
- package/dist/browser/drag-provider-D5oUStBV.js.map +1 -0
- package/dist/browser/editor-runtime/author/index.js +4048 -4048
- package/dist/browser/editor-runtime/author/index.js.map +1 -1
- package/dist/browser/editor-runtime/delivery/index.js +260 -260
- package/dist/browser/editor-runtime/delivery/index.js.map +1 -1
- package/dist/browser/editor-runtime/{drag-provider-DGcTd1pv.js → drag-provider-BRjfUagE.js} +3510 -2587
- package/dist/browser/editor-runtime/drag-provider-BRjfUagE.js.map +1 -0
- package/dist/delivery/placement-ordering.js +22 -21
- package/dist/delivery/tile.js +27 -26
- package/dist/delivery/tiler.js +37 -36
- package/dist/index.iife.js +52 -50
- package/package.json +15 -14
- package/dist/browser/drag-provider-BKqqYjQM.js.map +0 -1
- package/dist/browser/editor-runtime/drag-provider-DGcTd1pv.js.map +0 -1
|
@@ -16,18 +16,19 @@ import { jsx as w, jsxs as T } from "react/jsx-runtime";
|
|
|
16
16
|
import E from "@pie-lib/translator";
|
|
17
17
|
import D from "@pie-lib/correct-answer-toggle";
|
|
18
18
|
import { DragProvider as O, createDragCollision as k } from "@pie-lib/drag";
|
|
19
|
+
import { sanitizeModelHtml as A } from "@pie-element/shared-utils";
|
|
19
20
|
//#region src/delivery/placement-ordering.tsx
|
|
20
|
-
function
|
|
21
|
+
function j(e) {
|
|
21
22
|
return typeof e == "function" || typeof e == "object" && !!e && typeof e.$$typeof == "symbol";
|
|
22
23
|
}
|
|
23
|
-
function
|
|
24
|
-
return !e ||
|
|
24
|
+
function M(e, t) {
|
|
25
|
+
return !e || j(e) ? e : j(e.default) ? e.default : t && j(e[t]) ? e[t] : t && j(e[t]?.default) ? e[t].default : e;
|
|
25
26
|
}
|
|
26
|
-
var
|
|
27
|
+
var N = M(y, "UiLayout") || M(z.UiLayout, "UiLayout"), P = M(v, "PreviewPrompt") || M(z.PreviewPrompt, "PreviewPrompt"), F = M(_, "Feedback") || M(z.Feedback, "Feedback"), I = M(g, "Collapsible") || M(z.Collapsible, "Collapsible"), L = h, R = L.default, z = R && typeof R == "object" ? R : L, B = 250, V = (e, t) => {
|
|
27
28
|
if (!e || !t) return !1;
|
|
28
29
|
let n = t.left + t.width / 2, r = t.top + t.height / 2;
|
|
29
30
|
return n >= e.left && n <= e.right && r >= e.top && r <= e.bottom;
|
|
30
|
-
},
|
|
31
|
+
}, ee = (e, t, n) => {
|
|
31
32
|
let { initial: r, translated: i } = e || {};
|
|
32
33
|
if (!r || !t || typeof n?.clientX != "number") return i;
|
|
33
34
|
let a = t.x - n.clientX, o = t.y - n.clientY;
|
|
@@ -62,7 +63,7 @@ var M = j(y, "UiLayout") || j(R.UiLayout, "UiLayout"), N = j(v, "PreviewPrompt")
|
|
|
62
63
|
display: "flex",
|
|
63
64
|
justifyContent: "center",
|
|
64
65
|
minWidth: "min-content"
|
|
65
|
-
}), J = p("div")(({ theme: e }) => ({ paddingBottom: e.spacing(1) })), Y = p("div")(({ theme: e }) => ({ paddingBottom: e.spacing(2) })), X = p(D)(({ theme: e }) => ({ paddingBottom: e.spacing(1) })), Z = p(
|
|
66
|
+
}), J = p("div")(({ theme: e }) => ({ paddingBottom: e.spacing(1) })), Y = p("div")(({ theme: e }) => ({ paddingBottom: e.spacing(2) })), X = p(D)(({ theme: e }) => ({ paddingBottom: e.spacing(1) })), Z = p(I)(({ theme: e }) => ({
|
|
66
67
|
marginBottom: e.spacing(2),
|
|
67
68
|
alignSelf: "flex-start"
|
|
68
69
|
})), Q = (e) => {
|
|
@@ -176,7 +177,7 @@ var $ = class extends o.Component {
|
|
|
176
177
|
}
|
|
177
178
|
e && r && (this.onDropChoice(r, e, i), this.focusTile(this.getDestinationSlotId(r)));
|
|
178
179
|
} else if (!t && n) {
|
|
179
|
-
let e = n.data.current, t = n.rect?.current, a =
|
|
180
|
+
let e = n.data.current, t = n.rect?.current, a = ee(t, this.dragCollision.lastPointer(), r), o = V(t?.initial, a);
|
|
180
181
|
e && e.type === "target" && !o && (this.onRemoveChoice(e, i), this.focusTile(this.getDestinationSlotId({
|
|
181
182
|
type: "choice",
|
|
182
183
|
id: e.id
|
|
@@ -223,7 +224,7 @@ var $ = class extends o.Component {
|
|
|
223
224
|
});
|
|
224
225
|
});
|
|
225
226
|
};
|
|
226
|
-
isClickSoonAfterDragEnd = () => Date.now() - this.lastDragEndAt <
|
|
227
|
+
isClickSoonAfterDragEnd = () => Date.now() - this.lastDragEndAt < B;
|
|
227
228
|
onChoiceClick = (e) => {
|
|
228
229
|
this.isClickSoonAfterDragEnd() || this.toggleChoiceSelection(e);
|
|
229
230
|
};
|
|
@@ -234,7 +235,7 @@ var $ = class extends o.Component {
|
|
|
234
235
|
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 || {
|
|
235
236
|
orientation: "vertical",
|
|
236
237
|
includeTargets: !0
|
|
237
|
-
}, { orientation: x, includeTargets: E } = y, D = x === "vertical", k = this.createOrdering(), { mode:
|
|
238
|
+
}, { orientation: x, includeTargets: E } = y, D = x === "vertical", k = this.createOrdering(), { mode: j, role: M } = f || {}, I = D ? t : e, L = (v || j === "view" && M === "instructor") && d && u, R = s && (C(s) || S(s)), z = h && (C(h) || S(h)), B = {
|
|
238
239
|
color: b.text(),
|
|
239
240
|
backgroundColor: b.background(),
|
|
240
241
|
display: "flex",
|
|
@@ -242,7 +243,7 @@ var $ = class extends o.Component {
|
|
|
242
243
|
alignItems: "center",
|
|
243
244
|
boxSizing: "border-box",
|
|
244
245
|
width: "100%"
|
|
245
|
-
},
|
|
246
|
+
}, V = E ? {
|
|
246
247
|
selectedChoice: this.state.selectedChoice,
|
|
247
248
|
onChoiceClick: this.onChoiceClick,
|
|
248
249
|
onPlacementClick: this.onPlacementClick
|
|
@@ -254,19 +255,19 @@ var $ = class extends o.Component {
|
|
|
254
255
|
collisionDetection: this.dragCollision.collisionDetection,
|
|
255
256
|
modifiers: [m],
|
|
256
257
|
...H(E),
|
|
257
|
-
children: /* @__PURE__ */ w(G, { children: /* @__PURE__ */ T(
|
|
258
|
+
children: /* @__PURE__ */ w(G, { children: /* @__PURE__ */ T(N, {
|
|
258
259
|
extraCSSRules: a,
|
|
259
|
-
style:
|
|
260
|
+
style: B,
|
|
260
261
|
children: [
|
|
261
|
-
|
|
262
|
+
z && /* @__PURE__ */ w(Z, {
|
|
262
263
|
labels: {
|
|
263
264
|
hidden: U.t("common:showTeacherInstructions", { lng: g }),
|
|
264
265
|
visible: U.t("common:hideTeacherInstructions", { lng: g })
|
|
265
266
|
},
|
|
266
267
|
className: "collapsible",
|
|
267
|
-
children: /* @__PURE__ */ w(
|
|
268
|
+
children: /* @__PURE__ */ w(P, { prompt: h })
|
|
268
269
|
}),
|
|
269
|
-
/* @__PURE__ */ w(J, { children: /* @__PURE__ */ w(
|
|
270
|
+
/* @__PURE__ */ w(J, { children: /* @__PURE__ */ w(P, { prompt: o }) }),
|
|
270
271
|
/* @__PURE__ */ w(X, {
|
|
271
272
|
show: _,
|
|
272
273
|
toggled: v,
|
|
@@ -278,24 +279,24 @@ var $ = class extends o.Component {
|
|
|
278
279
|
choiceLabel: y.choiceLabel,
|
|
279
280
|
targetLabel: y.targetLabel,
|
|
280
281
|
ordering: k,
|
|
281
|
-
tiler:
|
|
282
|
+
tiler: I,
|
|
282
283
|
disabled: p,
|
|
283
284
|
addGuide: y.showOrdering,
|
|
284
285
|
tileSize: y.tileSize,
|
|
285
286
|
includeTargets: E,
|
|
286
287
|
choiceLabelEnabled: n.config && n.config.choiceLabelEnabled,
|
|
287
|
-
...
|
|
288
|
+
...V
|
|
288
289
|
}) }) }),
|
|
289
|
-
|
|
290
|
-
|
|
290
|
+
L && /* @__PURE__ */ w(Y, { dangerouslySetInnerHTML: { __html: A(u) } }),
|
|
291
|
+
R && /* @__PURE__ */ w(Z, {
|
|
291
292
|
labels: {
|
|
292
293
|
hidden: U.t("common:showRationale", { lng: g }),
|
|
293
294
|
visible: U.t("common:hideRationale", { lng: g })
|
|
294
295
|
},
|
|
295
296
|
className: "collapsible",
|
|
296
|
-
children: /* @__PURE__ */ w(
|
|
297
|
+
children: /* @__PURE__ */ w(P, { prompt: s })
|
|
297
298
|
}),
|
|
298
|
-
!v && /* @__PURE__ */ w(
|
|
299
|
+
!v && /* @__PURE__ */ w(F, {
|
|
299
300
|
correctness: i,
|
|
300
301
|
feedback: c
|
|
301
302
|
})
|
package/dist/delivery/tile.js
CHANGED
|
@@ -6,25 +6,26 @@ import { color as i } from "@pie-lib/render-ui";
|
|
|
6
6
|
import { jsx as a } from "react/jsx-runtime";
|
|
7
7
|
import { PlaceHolder as o } from "@pie-lib/drag";
|
|
8
8
|
import { useDraggable as s, useDroppable as c } from "@dnd-kit/core";
|
|
9
|
+
import { sanitizeModelHtml as l } from "@pie-element/shared-utils";
|
|
9
10
|
//#region src/delivery/tile.tsx
|
|
10
|
-
var
|
|
11
|
+
var u = t("pie-elements:placement-ordering:tile"), d = r("div")(({ theme: e }) => ({
|
|
11
12
|
width: "100%",
|
|
12
13
|
fontSize: e.typography.fontSize + 4,
|
|
13
14
|
textAlign: "center",
|
|
14
15
|
color: "inherit"
|
|
15
|
-
})),
|
|
16
|
+
})), f = ({ type: e, index: t, isOver: n, disabled: r }) => /* @__PURE__ */ a(o, {
|
|
16
17
|
type: e,
|
|
17
18
|
isOver: n,
|
|
18
19
|
disabled: r,
|
|
19
|
-
children: e === "target" && t !== void 0 && /* @__PURE__ */ a(
|
|
20
|
+
children: e === "target" && t !== void 0 && /* @__PURE__ */ a(d, { children: t })
|
|
20
21
|
});
|
|
21
|
-
|
|
22
|
+
f.propTypes = {
|
|
22
23
|
type: n.string,
|
|
23
24
|
index: n.number,
|
|
24
25
|
isOver: n.bool,
|
|
25
26
|
disabled: n.bool
|
|
26
27
|
};
|
|
27
|
-
var
|
|
28
|
+
var p = r("div")(({ theme: e, isDragging: t, isSelected: n, isOver: r, disabled: a, outcome: o, label: s, type: c }) => ({
|
|
28
29
|
cursor: a ? "not-allowed" : "grab",
|
|
29
30
|
width: "100%",
|
|
30
31
|
height: "100%",
|
|
@@ -68,25 +69,25 @@ var f = r("div")(({ theme: e, isDragging: t, isSelected: n, isOver: r, disabled:
|
|
|
68
69
|
border: "none",
|
|
69
70
|
"&:hover": { backgroundColor: "unset" }
|
|
70
71
|
}
|
|
71
|
-
})),
|
|
72
|
-
let { type: t, isDragging: n, isSelected: r, empty: i, isOver: o, label: s, disabled: c, outcome:
|
|
73
|
-
return i ? /* @__PURE__ */ a(
|
|
72
|
+
})), m = (e) => {
|
|
73
|
+
let { type: t, isDragging: n, isSelected: r, empty: i, isOver: o, label: s, disabled: c, outcome: u, guideIndex: d } = e;
|
|
74
|
+
return i ? /* @__PURE__ */ a(f, {
|
|
74
75
|
type: t,
|
|
75
|
-
index:
|
|
76
|
+
index: d,
|
|
76
77
|
isOver: o,
|
|
77
78
|
disabled: c
|
|
78
|
-
}) : /* @__PURE__ */ a(
|
|
79
|
+
}) : /* @__PURE__ */ a(p, {
|
|
79
80
|
type: t,
|
|
80
81
|
isDragging: n,
|
|
81
82
|
isSelected: r,
|
|
82
83
|
isOver: o,
|
|
83
84
|
disabled: c,
|
|
84
|
-
outcome:
|
|
85
|
+
outcome: u,
|
|
85
86
|
label: s,
|
|
86
|
-
dangerouslySetInnerHTML: { __html: s }
|
|
87
|
+
dangerouslySetInnerHTML: { __html: l(s) }
|
|
87
88
|
});
|
|
88
|
-
},
|
|
89
|
-
let { label: n, type: r, id: i, empty: o, disabled:
|
|
89
|
+
}, h = (t) => {
|
|
90
|
+
let { label: n, type: r, id: i, empty: o, disabled: l, outcome: d, index: f, guideIndex: p, instanceId: h, draggable: g, tileIndex: _, selectedChoice: v, onChoiceClick: y, onPlacementClick: b } = t, x = `tile-${r}-${i ?? "empty"}-${_}-${h}`, S = `drop-${r}-${i ?? "empty"}-${_}-${h}`, C = {
|
|
90
91
|
id: i,
|
|
91
92
|
type: r,
|
|
92
93
|
instanceId: h,
|
|
@@ -95,14 +96,14 @@ var f = r("div")(({ theme: e, isDragging: t, isSelected: n, isOver: r, disabled:
|
|
|
95
96
|
}, { attributes: w, listeners: T, setNodeRef: E, transform: D, isDragging: O } = s({
|
|
96
97
|
id: x,
|
|
97
98
|
data: C,
|
|
98
|
-
disabled: !g ||
|
|
99
|
+
disabled: !g || l
|
|
99
100
|
}), { setNodeRef: k, isOver: A } = c({
|
|
100
101
|
id: S,
|
|
101
102
|
data: C,
|
|
102
103
|
disabled: O
|
|
103
|
-
}), j = !!v && v.type === C.type && v.id === C.id && v.index === C.index, [M, N] = e.useState(!1), P = !!v && !
|
|
104
|
-
|
|
105
|
-
}, L = !(g && !
|
|
104
|
+
}), j = !!v && v.type === C.type && v.id === C.id && v.index === C.index, [M, N] = e.useState(!1), P = !!v && !l, F = A || r === "target" && P && M, I = () => {
|
|
105
|
+
l || (r === "choice" ? v?.type === "target" ? b?.(C) : g && y?.(C) : r === "target" && (j ? y?.(C) : v ? b?.(C) : g && y?.(C)));
|
|
106
|
+
}, L = !(g && !l) && !l && P, R = (e) => {
|
|
106
107
|
(e.code === "Space" || e.code === "Enter") && (e.preventDefault(), I());
|
|
107
108
|
}, z = e.useRef(null);
|
|
108
109
|
e.useEffect(() => {
|
|
@@ -116,7 +117,7 @@ var f = r("div")(({ theme: e, isDragging: t, isSelected: n, isOver: r, disabled:
|
|
|
116
117
|
let B = (e) => {
|
|
117
118
|
z.current = e, E(e), k(e);
|
|
118
119
|
};
|
|
119
|
-
|
|
120
|
+
u("[render], props: ", t);
|
|
120
121
|
let V = r === "target" ? `target-${f}` : r === "choice" ? `choice-${i}` : null, H = V ? `${h}:${V}` : void 0;
|
|
121
122
|
return /* @__PURE__ */ a("div", {
|
|
122
123
|
ref: B,
|
|
@@ -128,7 +129,7 @@ var f = r("div")(({ theme: e, isDragging: t, isSelected: n, isOver: r, disabled:
|
|
|
128
129
|
margin: 0,
|
|
129
130
|
textAlign: "center",
|
|
130
131
|
pointerEvents: "auto",
|
|
131
|
-
cursor:
|
|
132
|
+
cursor: l ? "not-allowed" : r === "target" && P ? "pointer" : O ? "grabbing" : "grab",
|
|
132
133
|
zIndex: O ? 1e3 : "auto",
|
|
133
134
|
willChange: O ? "transform" : "auto"
|
|
134
135
|
},
|
|
@@ -139,26 +140,26 @@ var f = r("div")(({ theme: e, isDragging: t, isSelected: n, isOver: r, disabled:
|
|
|
139
140
|
onMouseEnter: () => N(!0),
|
|
140
141
|
onMouseLeave: () => N(!1),
|
|
141
142
|
"data-tile-id": H,
|
|
142
|
-
...g && !
|
|
143
|
+
...g && !l ? {
|
|
143
144
|
...T,
|
|
144
145
|
...w
|
|
145
146
|
} : {},
|
|
146
|
-
children: /* @__PURE__ */ a(
|
|
147
|
+
children: /* @__PURE__ */ a(m, {
|
|
147
148
|
label: n,
|
|
148
149
|
id: i,
|
|
149
150
|
empty: o,
|
|
150
151
|
index: f,
|
|
151
|
-
guideIndex:
|
|
152
|
+
guideIndex: p,
|
|
152
153
|
isOver: F,
|
|
153
154
|
isDragging: O,
|
|
154
155
|
isSelected: j,
|
|
155
|
-
disabled:
|
|
156
|
+
disabled: l,
|
|
156
157
|
outcome: d,
|
|
157
158
|
type: r
|
|
158
159
|
})
|
|
159
160
|
});
|
|
160
161
|
};
|
|
161
|
-
|
|
162
|
+
h.propTypes = {
|
|
162
163
|
id: n.any,
|
|
163
164
|
label: n.string,
|
|
164
165
|
isOver: n.bool,
|
|
@@ -176,4 +177,4 @@ m.propTypes = {
|
|
|
176
177
|
onPlacementClick: n.func
|
|
177
178
|
};
|
|
178
179
|
//#endregion
|
|
179
|
-
export {
|
|
180
|
+
export { h as Tile, h as default };
|
package/dist/delivery/tiler.js
CHANGED
|
@@ -3,8 +3,9 @@ import t, { createElement as n } from "react";
|
|
|
3
3
|
import r from "prop-types";
|
|
4
4
|
import { styled as i } from "@mui/material/styles";
|
|
5
5
|
import { jsx as a, jsxs as o } from "react/jsx-runtime";
|
|
6
|
+
import { sanitizeModelHtml as s } from "@pie-element/shared-utils";
|
|
6
7
|
//#region src/delivery/tiler.tsx
|
|
7
|
-
var
|
|
8
|
+
var c = {
|
|
8
9
|
choiceLabel: r.string,
|
|
9
10
|
targetLabel: r.string,
|
|
10
11
|
disabled: r.bool,
|
|
@@ -14,11 +15,11 @@ var s = {
|
|
|
14
15
|
selectedChoice: r.object,
|
|
15
16
|
onChoiceClick: r.func,
|
|
16
17
|
onPlacementClick: r.func
|
|
17
|
-
},
|
|
18
|
+
}, l = {
|
|
18
19
|
tileSize: "1fr",
|
|
19
20
|
disabled: !1,
|
|
20
21
|
addGuide: !1
|
|
21
|
-
},
|
|
22
|
+
}, u = (t) => {
|
|
22
23
|
let r = (r, i) => (r.instanceId = t.instanceId, r.disabled = t.disabled, r.guideIndex = t.addGuide ? r.index + 1 : void 0, r.tileIndex = i, r.selectedChoice = t.selectedChoice, r.onChoiceClick = t.onChoiceClick, r.onPlacementClick = t.onPlacementClick, t.includeTargets || r.type === "choice" ? /* @__PURE__ */ n(e, {
|
|
23
24
|
...r,
|
|
24
25
|
key: i
|
|
@@ -27,66 +28,66 @@ var s = {
|
|
|
27
28
|
label: "",
|
|
28
29
|
key: i
|
|
29
30
|
}));
|
|
30
|
-
return r.propTypes = { ...
|
|
31
|
-
},
|
|
31
|
+
return r.propTypes = { ...c }, r;
|
|
32
|
+
}, d = i("div")(({ theme: e, includeTargets: t }) => ({
|
|
32
33
|
display: "grid",
|
|
33
34
|
paddingBottom: e.spacing(2),
|
|
34
35
|
...t && { gridGap: "10px" }
|
|
35
|
-
})),
|
|
36
|
+
})), f = i("div")({ textAlign: "center" }), p = i("div")({
|
|
36
37
|
textAlign: "center",
|
|
37
38
|
gridRow: "3/4"
|
|
38
|
-
}),
|
|
39
|
+
}), m = i("div")(({ includeTargets: e }) => ({
|
|
39
40
|
gridAutoFlow: "column",
|
|
40
41
|
display: "grid",
|
|
41
42
|
...e && { gridGap: "10px" }
|
|
42
|
-
})),
|
|
43
|
+
})), h = i("div")({
|
|
43
44
|
gridColumn: "1/2",
|
|
44
45
|
textAlign: "center"
|
|
45
|
-
}),
|
|
46
|
+
}), g = i("div")({
|
|
46
47
|
gridColumn: "2/3",
|
|
47
48
|
textAlign: "center"
|
|
48
|
-
}),
|
|
49
|
-
static propTypes = { ...
|
|
50
|
-
static defaultProps = { ...
|
|
49
|
+
}), _ = class extends t.Component {
|
|
50
|
+
static propTypes = { ...c };
|
|
51
|
+
static defaultProps = { ...l };
|
|
51
52
|
render() {
|
|
52
|
-
let { includeTargets: e, choiceLabelEnabled: t, choiceLabel: n, targetLabel: r, tiles: i, tileSize:
|
|
53
|
-
gridTemplateColumns: e ? `repeat(${
|
|
54
|
-
gridTemplateRows:
|
|
55
|
-
},
|
|
56
|
-
return /* @__PURE__ */ o(
|
|
53
|
+
let { includeTargets: e, choiceLabelEnabled: t, choiceLabel: n, targetLabel: r, tiles: i, tileSize: c } = this.props, l = e ? `auto ${c} auto ${c}` : `auto ${c} auto`, m = e ? i.length / 2 : i.length, h = {
|
|
54
|
+
gridTemplateColumns: e ? `repeat(${m}, ${c})` : `auto repeat(${Math.floor(m / 2) - 1}, ${c} 10px) ${c} auto`,
|
|
55
|
+
gridTemplateRows: l
|
|
56
|
+
}, g = { gridColumn: `1/${m + 1}` };
|
|
57
|
+
return /* @__PURE__ */ o(d, {
|
|
57
58
|
includeTargets: e,
|
|
58
|
-
style:
|
|
59
|
+
style: h,
|
|
59
60
|
children: [
|
|
60
|
-
/* @__PURE__ */ a(
|
|
61
|
-
style:
|
|
62
|
-
dangerouslySetInnerHTML: { __html: t ? n : "" }
|
|
61
|
+
/* @__PURE__ */ a(f, {
|
|
62
|
+
style: g,
|
|
63
|
+
dangerouslySetInnerHTML: { __html: s(t ? n : "") }
|
|
63
64
|
}),
|
|
64
|
-
e && /* @__PURE__ */ a(
|
|
65
|
-
style:
|
|
66
|
-
dangerouslySetInnerHTML: { __html: r }
|
|
65
|
+
e && /* @__PURE__ */ a(p, {
|
|
66
|
+
style: g,
|
|
67
|
+
dangerouslySetInnerHTML: { __html: s(r) }
|
|
67
68
|
}),
|
|
68
|
-
i.map(
|
|
69
|
+
i.map(u(this.props))
|
|
69
70
|
]
|
|
70
71
|
});
|
|
71
72
|
}
|
|
72
|
-
},
|
|
73
|
-
static propTypes = { ...
|
|
74
|
-
static defaultProps = { ...
|
|
73
|
+
}, v = class extends t.Component {
|
|
74
|
+
static propTypes = { ...c };
|
|
75
|
+
static defaultProps = { ...l };
|
|
75
76
|
render() {
|
|
76
|
-
let { includeTargets: e, choiceLabelEnabled: t, choiceLabel: n, targetLabel: r, tiles: i, tileSize:
|
|
77
|
-
return /* @__PURE__ */ o(
|
|
77
|
+
let { includeTargets: e, choiceLabelEnabled: t, choiceLabel: n, targetLabel: r, tiles: i, tileSize: c } = this.props, l = e ? 2 : 1, d = e ? i.length / 2 : i.length;
|
|
78
|
+
return /* @__PURE__ */ o(m, {
|
|
78
79
|
includeTargets: e,
|
|
79
80
|
style: {
|
|
80
|
-
gridTemplateColumns: `repeat(${
|
|
81
|
-
gridTemplateRows: e ? `auto repeat(${
|
|
81
|
+
gridTemplateColumns: `repeat(${l}, ${c})`,
|
|
82
|
+
gridTemplateRows: e ? `auto repeat(${d}, ${c})` : `auto auto repeat(${Math.floor(d / 2) - 1}, ${c} 10px) ${c} auto`
|
|
82
83
|
},
|
|
83
84
|
children: [
|
|
84
|
-
/* @__PURE__ */ a(
|
|
85
|
-
e && /* @__PURE__ */ a(
|
|
86
|
-
i.map(
|
|
85
|
+
/* @__PURE__ */ a(h, { dangerouslySetInnerHTML: { __html: s(t ? n : "") } }),
|
|
86
|
+
e && /* @__PURE__ */ a(g, { dangerouslySetInnerHTML: { __html: s(r) } }),
|
|
87
|
+
i.map(u(this.props))
|
|
87
88
|
]
|
|
88
89
|
});
|
|
89
90
|
}
|
|
90
91
|
};
|
|
91
92
|
//#endregion
|
|
92
|
-
export {
|
|
93
|
+
export { _ as HorizontalTiler, v as VerticalTiler };
|