@pie-lib/render-ui 8.0.1-next.20261003161149 → 8.0.1-next.20261004162038
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/collapsible/index.d.ts +1 -0
- package/dist/collapsible/index.js +45 -30
- package/dist/index.d.ts +1 -0
- package/dist/index.js +16 -15
- package/dist/unique-id.d.ts +2 -0
- package/dist/unique-id.js +5 -0
- package/package.json +1 -1
|
@@ -1,53 +1,68 @@
|
|
|
1
|
-
import e from "
|
|
2
|
-
import t from "
|
|
3
|
-
import
|
|
4
|
-
import
|
|
5
|
-
import
|
|
6
|
-
import {
|
|
1
|
+
import { tertiary as e } from "../color.js";
|
|
2
|
+
import { createUniqueId as t } from "../unique-id.js";
|
|
3
|
+
import n from "react";
|
|
4
|
+
import r from "prop-types";
|
|
5
|
+
import { styled as i } from "@mui/material/styles";
|
|
6
|
+
import { jsx as a, jsxs as o } from "react/jsx-runtime";
|
|
7
|
+
import s from "@mui/material/Collapse";
|
|
8
|
+
import { renderMath as c } from "@pie-element/shared-math-rendering-mathjax";
|
|
7
9
|
//#region src/collapsible/index.tsx
|
|
8
|
-
var
|
|
9
|
-
|
|
10
|
-
|
|
10
|
+
var l = i("button")({
|
|
11
|
+
display: "inline-block",
|
|
12
|
+
minHeight: "24px",
|
|
13
|
+
padding: 0,
|
|
14
|
+
border: 0,
|
|
15
|
+
background: "transparent",
|
|
16
|
+
font: "inherit",
|
|
17
|
+
textAlign: "inherit",
|
|
18
|
+
color: e(),
|
|
11
19
|
cursor: "pointer"
|
|
12
|
-
})),
|
|
20
|
+
}), u = i("span")({ borderBottom: "1px dotted currentColor" }), d = i(s)(({ theme: e }) => ({ paddingTop: e.spacing(2) })), f = class extends n.Component {
|
|
13
21
|
static propTypes = {
|
|
14
|
-
className:
|
|
15
|
-
children:
|
|
16
|
-
labels:
|
|
17
|
-
visible:
|
|
18
|
-
hidden:
|
|
22
|
+
className: r.string,
|
|
23
|
+
children: r.object,
|
|
24
|
+
labels: r.shape({
|
|
25
|
+
visible: r.string,
|
|
26
|
+
hidden: r.string
|
|
19
27
|
})
|
|
20
28
|
};
|
|
21
29
|
static defaultProps = { labels: {} };
|
|
22
30
|
state = { expanded: !1 };
|
|
31
|
+
panelId = t("pie-collapsible");
|
|
23
32
|
toggleExpanded = () => {
|
|
24
33
|
this.setState((e) => ({ expanded: !e.expanded }));
|
|
25
34
|
};
|
|
26
35
|
componentDidMount() {
|
|
27
|
-
|
|
36
|
+
c(this.root);
|
|
28
37
|
}
|
|
29
38
|
componentDidUpdate() {
|
|
30
|
-
|
|
39
|
+
c(this.root);
|
|
31
40
|
}
|
|
32
41
|
render() {
|
|
33
|
-
let { labels: e, children: t, className: n } = this.props,
|
|
34
|
-
return /* @__PURE__ */
|
|
42
|
+
let { labels: e, children: t, className: n } = this.props, { expanded: r } = this.state, i = r ? e.visible || "Hide" : e.hidden || "Show";
|
|
43
|
+
return /* @__PURE__ */ o("div", {
|
|
35
44
|
className: n,
|
|
36
45
|
ref: (e) => this.root = e,
|
|
37
|
-
children: [/* @__PURE__ */
|
|
46
|
+
children: [/* @__PURE__ */ a("div", { children: /* @__PURE__ */ a(l, {
|
|
47
|
+
type: "button",
|
|
48
|
+
"aria-expanded": r,
|
|
49
|
+
"aria-controls": this.panelId,
|
|
38
50
|
onClick: this.toggleExpanded,
|
|
39
|
-
children: /* @__PURE__ */
|
|
40
|
-
}), /* @__PURE__ */
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
51
|
+
children: /* @__PURE__ */ a(u, { children: i })
|
|
52
|
+
}) }), /* @__PURE__ */ a("div", {
|
|
53
|
+
id: this.panelId,
|
|
54
|
+
children: /* @__PURE__ */ a(d, {
|
|
55
|
+
in: r,
|
|
56
|
+
timeout: {
|
|
57
|
+
enter: 225,
|
|
58
|
+
exit: 195
|
|
59
|
+
},
|
|
60
|
+
unmountOnExit: !0,
|
|
61
|
+
children: t
|
|
62
|
+
})
|
|
48
63
|
})]
|
|
49
64
|
});
|
|
50
65
|
}
|
|
51
66
|
};
|
|
52
67
|
//#endregion
|
|
53
|
-
export {
|
|
68
|
+
export { f as Collapsible, f as default };
|
package/dist/index.d.ts
CHANGED
|
@@ -16,3 +16,4 @@ import EnableAudioAutoplayImage from './assets/enableAudioAutoplayImage.js';
|
|
|
16
16
|
import { transformDataHeadings } from './transform-headings.js';
|
|
17
17
|
export { HtmlAndMath, indicators, withUndoReset, Feedback, UiLayout, PreviewLayout, Collapsible, InputContainer, PreviewPrompt, color, Readable, Purpose, hasText, hasMedia, EnableAudioAutoplayImage, transformDataHeadings, };
|
|
18
18
|
export { InlineMenu } from './inline-menu.js';
|
|
19
|
+
export { createUniqueId, useUniqueId } from './unique-id.js';
|
package/dist/index.js
CHANGED
|
@@ -1,18 +1,19 @@
|
|
|
1
1
|
import { color_exports as e } from "./color.js";
|
|
2
2
|
import { Feedback as t } from "./feedback.js";
|
|
3
3
|
import { response_indicators_exports as n } from "./response-indicators.js";
|
|
4
|
-
import {
|
|
5
|
-
import
|
|
6
|
-
import
|
|
7
|
-
import
|
|
8
|
-
import
|
|
9
|
-
import
|
|
10
|
-
import
|
|
11
|
-
import
|
|
12
|
-
import
|
|
13
|
-
import
|
|
14
|
-
import {
|
|
15
|
-
import
|
|
16
|
-
import
|
|
17
|
-
import {
|
|
18
|
-
|
|
4
|
+
import { createUniqueId as r, useUniqueId as i } from "./unique-id.js";
|
|
5
|
+
import { Collapsible as a } from "./collapsible/index.js";
|
|
6
|
+
import o from "./withUndoReset.js";
|
|
7
|
+
import s from "./ui-layout.js";
|
|
8
|
+
import c from "./preview-layout.js";
|
|
9
|
+
import l from "./html-and-math.js";
|
|
10
|
+
import u from "./input-container.js";
|
|
11
|
+
import { PreviewPrompt as d } from "./preview-prompt.js";
|
|
12
|
+
import f from "./readable.js";
|
|
13
|
+
import p from "./purpose.js";
|
|
14
|
+
import { hasText as m } from "./has-text.js";
|
|
15
|
+
import { hasMedia as h } from "./has-media.js";
|
|
16
|
+
import g from "./assets/enableAudioAutoplayImage.js";
|
|
17
|
+
import { transformDataHeadings as _ } from "./transform-headings.js";
|
|
18
|
+
import { InlineMenu as v } from "./inline-menu.js";
|
|
19
|
+
export { a as Collapsible, g as EnableAudioAutoplayImage, t as Feedback, l as HtmlAndMath, v as InlineMenu, u as InputContainer, c as PreviewLayout, d as PreviewPrompt, p as Purpose, f as Readable, s as UiLayout, e as color, r as createUniqueId, h as hasMedia, m as hasText, n as indicators, _ as transformDataHeadings, i as useUniqueId, o as withUndoReset };
|
package/package.json
CHANGED