@pie-lib/render-ui 8.0.1-next.20261004023419 → 8.0.1-next.20261004165705

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.
@@ -1,12 +1,13 @@
1
1
  import { tertiary as e } from "../color.js";
2
- import t from "react";
3
- import n from "prop-types";
4
- import { styled as r } from "@mui/material/styles";
5
- import { jsx as i, jsxs as a } from "react/jsx-runtime";
6
- import o from "@mui/material/Collapse";
7
- import { renderMath as s } from "@pie-element/shared-math-rendering-mathjax";
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";
8
9
  //#region src/collapsible/index.tsx
9
- var c = r("button")({
10
+ var l = i("button")({
10
11
  display: "inline-block",
11
12
  minHeight: "24px",
12
13
  padding: 0,
@@ -16,41 +17,41 @@ var c = r("button")({
16
17
  textAlign: "inherit",
17
18
  color: e(),
18
19
  cursor: "pointer"
19
- }), l = r("span")({ borderBottom: "1px dotted currentColor" }), u = r(o)(({ theme: e }) => ({ paddingTop: e.spacing(2) })), d = class extends t.Component {
20
+ }), u = i("span")({ borderBottom: "1px dotted currentColor" }), d = i(s)(({ theme: e }) => ({ paddingTop: e.spacing(2) })), f = class extends n.Component {
20
21
  static propTypes = {
21
- className: n.string,
22
- children: n.object,
23
- labels: n.shape({
24
- visible: n.string,
25
- hidden: n.string
22
+ className: r.string,
23
+ children: r.object,
24
+ labels: r.shape({
25
+ visible: r.string,
26
+ hidden: r.string
26
27
  })
27
28
  };
28
29
  static defaultProps = { labels: {} };
29
30
  state = { expanded: !1 };
30
- panelId = `pie-collapsible-${Math.random().toString(36).slice(2, 10)}`;
31
+ panelId = t("pie-collapsible");
31
32
  toggleExpanded = () => {
32
33
  this.setState((e) => ({ expanded: !e.expanded }));
33
34
  };
34
35
  componentDidMount() {
35
- s(this.root);
36
+ c(this.root);
36
37
  }
37
38
  componentDidUpdate() {
38
- s(this.root);
39
+ c(this.root);
39
40
  }
40
41
  render() {
41
- let { labels: e, children: t, className: n } = this.props, { expanded: r } = this.state, o = r ? e.visible || "Hide" : e.hidden || "Show";
42
- return /* @__PURE__ */ a("div", {
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", {
43
44
  className: n,
44
45
  ref: (e) => this.root = e,
45
- children: [/* @__PURE__ */ i("div", { children: /* @__PURE__ */ i(c, {
46
+ children: [/* @__PURE__ */ a("div", { children: /* @__PURE__ */ a(l, {
46
47
  type: "button",
47
48
  "aria-expanded": r,
48
49
  "aria-controls": this.panelId,
49
50
  onClick: this.toggleExpanded,
50
- children: /* @__PURE__ */ i(l, { children: o })
51
- }) }), /* @__PURE__ */ i("div", {
51
+ children: /* @__PURE__ */ a(u, { children: i })
52
+ }) }), /* @__PURE__ */ a("div", {
52
53
  id: this.panelId,
53
- children: /* @__PURE__ */ i(u, {
54
+ children: /* @__PURE__ */ a(d, {
54
55
  in: r,
55
56
  timeout: {
56
57
  enter: 225,
@@ -64,4 +65,4 @@ var c = r("button")({
64
65
  }
65
66
  };
66
67
  //#endregion
67
- export { d as Collapsible, d as default };
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 { Collapsible as r } from "./collapsible/index.js";
5
- import i from "./withUndoReset.js";
6
- import a from "./ui-layout.js";
7
- import o from "./preview-layout.js";
8
- import s from "./html-and-math.js";
9
- import c from "./input-container.js";
10
- import { PreviewPrompt as l } from "./preview-prompt.js";
11
- import u from "./readable.js";
12
- import d from "./purpose.js";
13
- import { hasText as f } from "./has-text.js";
14
- import { hasMedia as p } from "./has-media.js";
15
- import m from "./assets/enableAudioAutoplayImage.js";
16
- import { transformDataHeadings as h } from "./transform-headings.js";
17
- import { InlineMenu as g } from "./inline-menu.js";
18
- export { r as Collapsible, m as EnableAudioAutoplayImage, t as Feedback, s as HtmlAndMath, g as InlineMenu, c as InputContainer, o as PreviewLayout, l as PreviewPrompt, d as Purpose, u as Readable, a as UiLayout, e as color, p as hasMedia, f as hasText, n as indicators, h as transformDataHeadings, i as withUndoReset };
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 };
@@ -0,0 +1,2 @@
1
+ export declare const createUniqueId: (prefix: string) => string;
2
+ export declare const useUniqueId: (prefix: string) => string;
@@ -0,0 +1,5 @@
1
+ import e from "react";
2
+ //#region src/unique-id.ts
3
+ var t = (e) => `${e}-${Math.random().toString(36).slice(2, 10)}`, n = (n) => e.useState(() => t(n))[0];
4
+ //#endregion
5
+ export { t as createUniqueId, n as useUniqueId };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pie-lib/render-ui",
3
- "version": "8.0.1-next.20261004023419",
3
+ "version": "8.0.1-next.20261004165705",
4
4
  "description": "Some shared ui elements when rendering - but not worthy of their own package yet.",
5
5
  "repository": {
6
6
  "type": "git",
@@ -12,7 +12,7 @@
12
12
  "@emotion/styled": "^11.14.1",
13
13
  "@mui/icons-material": "^7.3.4",
14
14
  "@mui/material": "^7.3.4",
15
- "@pie-lib/icons": "5.0.1-next.20261002233132",
15
+ "@pie-lib/icons": "5.0.1-next.20261004165705",
16
16
  "debug": "^4.1.1",
17
17
  "prop-types": "^15.7.2",
18
18
  "react-transition-group": "^4.4.5",