@pie-element/categorize 14.0.3-next.20261007184841 → 14.0.3
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/{alert-dialog-1V8hnBV0.js → alert-dialog-mM4Uj-J0.js} +3023 -3060
- package/dist/browser/alert-dialog-mM4Uj-J0.js.map +1 -0
- package/dist/browser/author/index.js +1531 -1531
- package/dist/browser/author/index.js.map +1 -1
- package/dist/browser/delivery/index.js +380 -383
- package/dist/browser/delivery/index.js.map +1 -1
- package/dist/browser/editor-runtime/{alert-dialog-D3CgNohV.js → alert-dialog-DhPkkcee.js} +3023 -3060
- package/dist/browser/editor-runtime/alert-dialog-DhPkkcee.js.map +1 -0
- package/dist/browser/editor-runtime/author/index.js +1372 -1372
- package/dist/browser/editor-runtime/author/index.js.map +1 -1
- package/dist/browser/editor-runtime/delivery/index.js +380 -383
- package/dist/browser/editor-runtime/delivery/index.js.map +1 -1
- package/dist/delivery/categorize/choice.js +72 -75
- package/dist/index.iife.js +36 -36
- package/package.json +16 -16
- package/dist/browser/alert-dialog-1V8hnBV0.js.map +0 -1
- package/dist/browser/editor-runtime/alert-dialog-D3CgNohV.js.map +0 -1
- package/dist/delivery/__tests__/math-control-names.test.d.ts +0 -1
|
@@ -1,118 +1,115 @@
|
|
|
1
|
-
import e
|
|
2
|
-
import { color as
|
|
3
|
-
import
|
|
4
|
-
import
|
|
5
|
-
import { styled as
|
|
6
|
-
import { useDraggable as
|
|
7
|
-
import { uid as
|
|
8
|
-
import { jsx as
|
|
9
|
-
import
|
|
10
|
-
import
|
|
11
|
-
import { sanitizeModelHtml as
|
|
1
|
+
import e from "react";
|
|
2
|
+
import { color as t } from "@pie-lib/render-ui";
|
|
3
|
+
import n from "prop-types";
|
|
4
|
+
import r from "debug";
|
|
5
|
+
import { styled as i } from "@mui/material/styles";
|
|
6
|
+
import { useDraggable as a } from "@dnd-kit/core";
|
|
7
|
+
import { uid as o } from "@pie-lib/drag";
|
|
8
|
+
import { jsx as s } from "react/jsx-runtime";
|
|
9
|
+
import c from "@mui/material/Card";
|
|
10
|
+
import l from "@mui/material/CardContent";
|
|
11
|
+
import { sanitizeModelHtml as u } from "@pie-element/shared-utils";
|
|
12
12
|
//#region src/delivery/categorize/choice.tsx
|
|
13
|
-
|
|
14
|
-
var
|
|
15
|
-
content:
|
|
16
|
-
id:
|
|
17
|
-
},
|
|
13
|
+
r("@pie-ui:categorize:choice");
|
|
14
|
+
var d = {
|
|
15
|
+
content: n.string.isRequired,
|
|
16
|
+
id: n.string
|
|
17
|
+
}, f = i("div", { shouldForwardProp: (e) => ![
|
|
18
18
|
"isDragging",
|
|
19
19
|
"disabled",
|
|
20
20
|
"correct",
|
|
21
21
|
"isSelected"
|
|
22
|
-
].includes(e) })(({ isDragging: e, disabled:
|
|
22
|
+
].includes(e) })(({ isDragging: e, disabled: n, correct: r, isSelected: i }) => ({
|
|
23
23
|
direction: "initial",
|
|
24
|
-
cursor:
|
|
24
|
+
cursor: n ? "not-allowed" : e ? "move" : "pointer",
|
|
25
25
|
width: "100%",
|
|
26
26
|
borderRadius: "6px",
|
|
27
|
-
...i && { border: `solid 2px ${
|
|
28
|
-
...r === !0 && { border: `solid 2px ${
|
|
29
|
-
...r === !1 && { border: `solid 2px ${
|
|
30
|
-
})),
|
|
31
|
-
color:
|
|
32
|
-
backgroundColor:
|
|
27
|
+
...i && { border: `solid 2px ${t.buttonFocusOutline()}` },
|
|
28
|
+
...r === !0 && { border: `solid 2px ${t.correct()}` },
|
|
29
|
+
...r === !1 && { border: `solid 2px ${t.incorrect()}` }
|
|
30
|
+
})), p = i(c, { shouldForwardProp: (e) => e !== "isSelected" })(({ isSelected: e }) => ({
|
|
31
|
+
color: t.text(),
|
|
32
|
+
backgroundColor: t.background(),
|
|
33
33
|
width: "100%",
|
|
34
34
|
opacity: e ? .5 : 1
|
|
35
|
-
})),
|
|
36
|
-
color:
|
|
37
|
-
backgroundColor:
|
|
35
|
+
})), m = i(l)(({ theme: e }) => ({
|
|
36
|
+
color: t.text(),
|
|
37
|
+
backgroundColor: t.v("pie")("background", t.defaults.WHITE),
|
|
38
38
|
"&:last-child": { paddingBottom: e.spacing(2) },
|
|
39
39
|
borderRadius: "4px",
|
|
40
40
|
border: "1px solid",
|
|
41
41
|
"& p": { margin: "0px" }
|
|
42
|
-
})),
|
|
42
|
+
})), h = class extends e.Component {
|
|
43
43
|
static propTypes = {
|
|
44
|
-
...
|
|
45
|
-
disabled:
|
|
46
|
-
correct:
|
|
47
|
-
isDragging:
|
|
48
|
-
isSelected:
|
|
44
|
+
...d,
|
|
45
|
+
disabled: n.bool,
|
|
46
|
+
correct: n.bool,
|
|
47
|
+
isDragging: n.bool,
|
|
48
|
+
isSelected: n.bool
|
|
49
49
|
};
|
|
50
50
|
static defaultProps = {};
|
|
51
51
|
render() {
|
|
52
52
|
let { content: e, isDragging: t, disabled: n, correct: r, isSelected: i, showsSelectionBorder: a } = this.props;
|
|
53
|
-
return /* @__PURE__ */
|
|
53
|
+
return /* @__PURE__ */ s(f, {
|
|
54
54
|
isDragging: t,
|
|
55
55
|
disabled: n,
|
|
56
56
|
correct: r,
|
|
57
57
|
isSelected: i,
|
|
58
|
-
children: /* @__PURE__ */
|
|
58
|
+
children: /* @__PURE__ */ s(p, {
|
|
59
59
|
isSelected: i,
|
|
60
|
-
children: /* @__PURE__ */
|
|
60
|
+
children: /* @__PURE__ */ s(m, { dangerouslySetInnerHTML: { __html: u(e) } })
|
|
61
61
|
})
|
|
62
62
|
});
|
|
63
63
|
}
|
|
64
|
-
},
|
|
65
|
-
let
|
|
64
|
+
}, g = ({ id: e, content: t, disabled: n, correct: r, extraStyle: i, categoryId: o, choiceIndex: c, selectedItem: l, onSelectClick: u }) => {
|
|
65
|
+
let d = o === void 0 ? `choice-${e}-board` : `choice-${e}-${o}-${c}`, f = {
|
|
66
66
|
id: e,
|
|
67
|
-
categoryId:
|
|
68
|
-
choiceIndex:
|
|
69
|
-
value:
|
|
67
|
+
categoryId: o,
|
|
68
|
+
choiceIndex: c,
|
|
69
|
+
value: t,
|
|
70
70
|
itemType: "categorize",
|
|
71
71
|
type: "choice"
|
|
72
|
-
}, { attributes:
|
|
73
|
-
id:
|
|
74
|
-
data:
|
|
75
|
-
disabled:
|
|
76
|
-
}),
|
|
77
|
-
if (!
|
|
78
|
-
if (
|
|
79
|
-
e.stopPropagation(),
|
|
72
|
+
}, { attributes: p, listeners: m, setNodeRef: g, isDragging: _ } = a({
|
|
73
|
+
id: d,
|
|
74
|
+
data: f,
|
|
75
|
+
disabled: n
|
|
76
|
+
}), v = !!l && l.id === e && l.categoryId === o && l.choiceIndex === c, y = (e) => {
|
|
77
|
+
if (!n) {
|
|
78
|
+
if (v) {
|
|
79
|
+
e.stopPropagation(), u?.(f);
|
|
80
80
|
return;
|
|
81
81
|
}
|
|
82
|
-
|
|
82
|
+
l && o !== void 0 || (e.stopPropagation(), u?.(f));
|
|
83
83
|
}
|
|
84
84
|
};
|
|
85
|
-
return /* @__PURE__ */
|
|
86
|
-
ref:
|
|
87
|
-
b.current = e, v(e);
|
|
88
|
-
},
|
|
85
|
+
return /* @__PURE__ */ s("div", {
|
|
86
|
+
ref: g,
|
|
89
87
|
style: {
|
|
90
88
|
margin: "4px",
|
|
91
|
-
...
|
|
89
|
+
...i
|
|
92
90
|
},
|
|
93
|
-
onClick:
|
|
94
|
-
...
|
|
95
|
-
...
|
|
96
|
-
|
|
97
|
-
children: /* @__PURE__ */ l(_, {
|
|
91
|
+
onClick: y,
|
|
92
|
+
...m,
|
|
93
|
+
...p,
|
|
94
|
+
children: /* @__PURE__ */ s(h, {
|
|
98
95
|
id: e,
|
|
99
|
-
content:
|
|
100
|
-
disabled:
|
|
101
|
-
correct:
|
|
102
|
-
isDragging:
|
|
103
|
-
isSelected:
|
|
96
|
+
content: t,
|
|
97
|
+
disabled: n,
|
|
98
|
+
correct: r,
|
|
99
|
+
isDragging: _,
|
|
100
|
+
isSelected: v
|
|
104
101
|
})
|
|
105
102
|
});
|
|
106
103
|
};
|
|
107
|
-
|
|
108
|
-
...
|
|
109
|
-
extraStyle:
|
|
110
|
-
categoryId:
|
|
111
|
-
choiceIndex:
|
|
112
|
-
onRemoveChoice:
|
|
113
|
-
selectedItem:
|
|
114
|
-
onSelectClick:
|
|
104
|
+
g.propTypes = {
|
|
105
|
+
...d,
|
|
106
|
+
extraStyle: n.object,
|
|
107
|
+
categoryId: n.string,
|
|
108
|
+
choiceIndex: n.number,
|
|
109
|
+
onRemoveChoice: n.func,
|
|
110
|
+
selectedItem: n.object,
|
|
111
|
+
onSelectClick: n.func
|
|
115
112
|
};
|
|
116
|
-
var
|
|
113
|
+
var _ = o.withUid(g);
|
|
117
114
|
//#endregion
|
|
118
|
-
export {
|
|
115
|
+
export { d as ChoiceType, h as Layout, _ as default };
|