@pie-lib/render-ui 6.1.1-next.37 → 6.1.1-next.39

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.
@@ -50,4 +50,4 @@ var s = n("span")(({ theme: e }) => ({
50
50
  }
51
51
  };
52
52
  //#endregion
53
- export { l as default };
53
+ export { l as Collapsible, l as default };
package/dist/color.d.ts CHANGED
@@ -35,6 +35,9 @@ export declare const defaults: {
35
35
  BORDER_LIGHT: string;
36
36
  BORDER_DARK: string;
37
37
  BORDER_GRAY: string;
38
+ TABLE_GRID: string;
39
+ TABLE_GRID_LIGHT: string;
40
+ TABLE_STRIPE: string;
38
41
  BLACK: string;
39
42
  WHITE: string;
40
43
  TRANSPARENT: string;
@@ -42,6 +45,7 @@ export declare const defaults: {
42
45
  FOCUS_CHECKED_BORDER: string;
43
46
  FOCUS_UNCHECKED: string;
44
47
  FOCUS_UNCHECKED_BORDER: string;
48
+ BUTTON_FOCUS_OUTLINE: string;
45
49
  BLUE_GREY100: string;
46
50
  BLUE_GREY300: string;
47
51
  BLUE_GREY600: string;
@@ -88,6 +92,9 @@ export declare const border: () => any;
88
92
  export declare const borderLight: () => any;
89
93
  export declare const borderDark: () => any;
90
94
  export declare const borderGray: () => any;
95
+ export declare const tableGrid: () => any;
96
+ export declare const tableGridLight: () => any;
97
+ export declare const tableStripe: () => any;
91
98
  export declare const black: () => any;
92
99
  export declare const white: () => any;
93
100
  export declare const transparent: () => string;
@@ -95,6 +102,7 @@ export declare const focusChecked: () => any;
95
102
  export declare const focusCheckedBorder: () => any;
96
103
  export declare const focusUnchecked: () => any;
97
104
  export declare const focusUncheckedBorder: () => any;
105
+ export declare const buttonFocusOutline: () => any;
98
106
  export declare const blueGrey100: () => any;
99
107
  export declare const blueGrey300: () => any;
100
108
  export declare const blueGrey600: () => any;
package/dist/color.js CHANGED
@@ -1,79 +1,83 @@
1
- import { __exportAll as e } from "./_virtual/_rolldown/runtime.js";
2
- import { green as t, indigo as n, orange as r, pink as i, red as a } from "@mui/material/colors";
1
+ import { __exportAll as ee } from "./_virtual/_rolldown/runtime.js";
2
+ import { green as e, indigo as t, orange as te, pink as n, red as r } from "@mui/material/colors";
3
3
  //#region src/color.ts
4
- var o = /* @__PURE__ */ e({
5
- background: () => j,
6
- backgroundDark: () => M,
4
+ var ne = /* @__PURE__ */ ee({
5
+ background: () => O,
6
+ backgroundDark: () => k,
7
7
  black: () => B,
8
- blueGrey100: () => q,
9
- blueGrey300: () => J,
10
- blueGrey600: () => Y,
11
- blueGrey900: () => X,
12
- border: () => ee,
13
- borderDark: () => R,
14
- borderGray: () => z,
15
- borderLight: () => L,
16
- buttonBorder: () => ie,
17
- buttonHoverBg: () => ae,
18
- correct: () => p,
19
- correctSecondary: () => m,
20
- correctTertiary: () => h,
21
- correctWithIcon: () => g,
22
- defaults: () => s,
23
- disabled: () => d,
24
- disabledSecondary: () => f,
25
- dropdownBackground: () => P,
26
- fadedPrimary: () => E,
8
+ blueGrey100: () => J,
9
+ blueGrey300: () => Y,
10
+ blueGrey600: () => X,
11
+ blueGrey900: () => Z,
12
+ border: () => N,
13
+ borderDark: () => F,
14
+ borderGray: () => I,
15
+ borderLight: () => P,
16
+ buttonBorder: () => ce,
17
+ buttonFocusOutline: () => q,
18
+ buttonHoverBg: () => le,
19
+ correct: () => u,
20
+ correctSecondary: () => d,
21
+ correctTertiary: () => f,
22
+ correctWithIcon: () => p,
23
+ defaults: () => i,
24
+ disabled: () => c,
25
+ disabledSecondary: () => l,
26
+ dropdownBackground: () => j,
27
+ fadedPrimary: () => C,
27
28
  focusChecked: () => U,
28
29
  focusCheckedBorder: () => W,
29
30
  focusUnchecked: () => G,
30
31
  focusUncheckedBorder: () => K,
31
- incorrect: () => _,
32
- incorrectSecondary: () => y,
33
- incorrectWithIcon: () => v,
34
- keyBoardFocusIndicator: () => re,
35
- keypadButton: () => Z,
36
- keypadButtonHover: () => te,
37
- keypadButtonOperator: () => Q,
38
- keypadButtonOperatorHover: () => ne,
39
- keypadEmptyPlaceholder: () => $,
40
- missing: () => b,
41
- missingWithIcon: () => x,
42
- primary: () => S,
43
- primaryDark: () => w,
44
- primaryLight: () => C,
45
- primaryText: () => T,
46
- secondary: () => D,
47
- secondaryBackground: () => N,
48
- secondaryDark: () => k,
49
- secondaryLight: () => O,
50
- secondaryText: () => A,
51
- tertiary: () => F,
52
- tertiaryLight: () => I,
53
- text: () => u,
32
+ incorrect: () => m,
33
+ incorrectSecondary: () => g,
34
+ incorrectWithIcon: () => h,
35
+ keyBoardFocusIndicator: () => se,
36
+ keypadButton: () => Q,
37
+ keypadButtonHover: () => oe,
38
+ keypadButtonOperator: () => ie,
39
+ keypadButtonOperatorHover: () => $,
40
+ keypadEmptyPlaceholder: () => ae,
41
+ missing: () => _,
42
+ missingWithIcon: () => v,
43
+ primary: () => y,
44
+ primaryDark: () => x,
45
+ primaryLight: () => b,
46
+ primaryText: () => S,
47
+ secondary: () => w,
48
+ secondaryBackground: () => A,
49
+ secondaryDark: () => E,
50
+ secondaryLight: () => T,
51
+ secondaryText: () => D,
52
+ tableGrid: () => L,
53
+ tableGridLight: () => R,
54
+ tableStripe: () => z,
55
+ tertiary: () => re,
56
+ tertiaryLight: () => M,
57
+ text: () => s,
54
58
  transparent: () => H,
55
- v: () => c,
56
- visualElementsColors: () => oe,
59
+ v: () => a,
60
+ visualElementsColors: () => ue,
57
61
  white: () => V
58
- }), s = {
62
+ }), i = {
59
63
  TEXT: "black",
60
64
  DISABLED: "grey",
61
65
  DISABLED_SECONDARY: "#ABABAB",
62
- CORRECT: t[500],
63
- CORRECT_SECONDARY: t[50],
66
+ CORRECT: e[500],
67
+ CORRECT_SECONDARY: e[50],
64
68
  CORRECT_TERTIARY: "#0EA449",
65
69
  CORRECT_WITH_ICON: "#087D38",
66
- INCORRECT: r[500],
67
- INCORRECT_SECONDARY: a[50],
70
+ INCORRECT: te[500],
71
+ INCORRECT_SECONDARY: r[50],
68
72
  INCORRECT_WITH_ICON: "#BF0D00",
69
- MISSING: a[700],
73
+ MISSING: r[700],
70
74
  MISSING_WITH_ICON: "#6A78A1",
71
- PRIMARY: n[500],
72
- PRIMARY_LIGHT: n[200],
73
- PRIMARY_DARK: n[800],
74
- SECONDARY: i.A400,
75
- SECONDARY_LIGHT: i[200],
76
- SECONDARY_DARK: i[900],
75
+ PRIMARY: t[500],
76
+ PRIMARY_LIGHT: t[200],
77
+ PRIMARY_DARK: t[800],
78
+ SECONDARY: n.A400,
79
+ SECONDARY_LIGHT: n[200],
80
+ SECONDARY_DARK: n[900],
77
81
  TERTIARY: "#146EB3",
78
82
  TERTIARY_LIGHT: "#D0E2F0",
79
83
  BACKGROUND: "rgba(255,255,255,0)",
@@ -84,6 +88,9 @@ var o = /* @__PURE__ */ e({
84
88
  BORDER_LIGHT: "#D1D1D1",
85
89
  BORDER_DARK: "#646464",
86
90
  BORDER_GRAY: "#7E8494",
91
+ TABLE_GRID: "black",
92
+ TABLE_GRID_LIGHT: "#dfe2e5",
93
+ TABLE_STRIPE: "#f6f8fa",
87
94
  BLACK: "#000000",
88
95
  WHITE: "#ffffff",
89
96
  TRANSPARENT: "transparent",
@@ -91,6 +98,7 @@ var o = /* @__PURE__ */ e({
91
98
  FOCUS_CHECKED_BORDER: "#1565C0",
92
99
  FOCUS_UNCHECKED: "#E0E0E0",
93
100
  FOCUS_UNCHECKED_BORDER: "#757575",
101
+ BUTTON_FOCUS_OUTLINE: "#3B82F6",
94
102
  BLUE_GREY100: "#F3F5F7",
95
103
  BLUE_GREY300: "#C0C3CF",
96
104
  BLUE_GREY600: "#7E8494",
@@ -105,11 +113,11 @@ var o = /* @__PURE__ */ e({
105
113
  BUTTON_BORDER: "rgba(0, 0, 0, 0.23)",
106
114
  BUTTON_HOVER_BG: "rgba(0, 0, 0, 0.08)"
107
115
  };
108
- Object.freeze(s);
109
- var c = (e) => (...t) => {
110
- let n = t.pop();
111
- return t.reduceRight((t, n) => `var(--${e}-${n}, ${t})`, n);
112
- }, l = c("pie"), u = () => l("text", s.TEXT), d = () => l("disabled", s.DISABLED), f = () => l("disabled-secondary", s.DISABLED_SECONDARY), p = () => l("correct", s.CORRECT), m = () => l("correct-secondary", s.CORRECT_SECONDARY), h = () => l("correct-tertiary", s.CORRECT_TERTIARY), g = () => l("correct-icon", s.CORRECT_WITH_ICON), _ = () => l("incorrect", s.INCORRECT), v = () => l("incorrect-icon", s.INCORRECT_WITH_ICON), y = () => l("incorrect-secondary", s.INCORRECT_SECONDARY), b = () => l("missing", s.MISSING), x = () => l("missing-icon", s.MISSING_WITH_ICON), S = () => l("primary", s.PRIMARY), C = () => l("primary-light", s.PRIMARY_LIGHT), w = () => l("primary-dark", s.PRIMARY_DARK), T = () => l("primary-text", "text", s.TEXT), E = () => l("faded-primary", s.FADED_PRIMARY), D = () => l("secondary", s.SECONDARY), O = () => l("secondary-light", s.SECONDARY_LIGHT), k = () => l("secondary-dark", s.SECONDARY_DARK), A = () => l("secondary-text", "text", s.TEXT), j = () => l("background", s.BACKGROUND), M = () => l("background-dark", s.BACKGROUND_DARK), N = () => l("secondary-background", s.SECONDARY_BACKGROUND), P = () => l("dropdown-background", s.DROPDOWN_BACKGROUND), F = () => l("tertiary", s.TERTIARY), I = () => l("tertiary-light", s.TERTIARY_LIGHT), ee = () => l("border", s.BORDER), L = () => l("border-light", s.BORDER_LIGHT), R = () => l("border-dark", s.BORDER_DARK), z = () => l("border-gray", s.BORDER_GRAY), B = () => l("black", s.BLACK), V = () => l("white", s.WHITE), H = () => s.TRANSPARENT, U = () => l("focus-checked", s.FOCUS_CHECKED), W = () => l("focus-checked-border", s.FOCUS_CHECKED_BORDER), G = () => l("focus-unchecked", s.FOCUS_UNCHECKED), K = () => l("focus-unchecked-border", s.FOCUS_UNCHECKED_BORDER), q = () => l("blue-grey-100", s.BLUE_GREY100), J = () => l("blue-grey-300", s.BLUE_GREY300), Y = () => l("blue-grey-600", s.BLUE_GREY600), X = () => l("blue-grey-900", s.BLUE_GREY900), Z = () => l("keypad-button", s.KEYPAD_BUTTON), Q = () => l("keypad-button-operator", s.KEYPAD_BUTTON_OPERATOR), $ = () => l("keypad-empty-placeholder", s.KEYPAD_EMPTY_PLACEHOLDER), te = () => l("keypad-button-hover", s.KEYPAD_BUTTON_HOVER), ne = () => l("keypad-button-operator-hover", s.KEYPAD_BUTTON_OPERATOR_HOVER), re = () => l("keyboard-focus-indicator", s.KEY_BOARD_FOCUS_INDICATOR), ie = () => l("button-border", s.BUTTON_BORDER), ae = () => l("button-hover-bg", s.BUTTON_HOVER_BG), oe = {
116
+ Object.freeze(i);
117
+ var a = (ee) => (...e) => {
118
+ let t = e.pop();
119
+ return e.reduceRight((e, t) => `var(--${ee}-${t}, ${e})`, t);
120
+ }, o = a("pie"), s = () => o("text", i.TEXT), c = () => o("disabled", i.DISABLED), l = () => o("disabled-secondary", i.DISABLED_SECONDARY), u = () => o("correct", i.CORRECT), d = () => o("correct-secondary", i.CORRECT_SECONDARY), f = () => o("correct-tertiary", i.CORRECT_TERTIARY), p = () => o("correct-icon", i.CORRECT_WITH_ICON), m = () => o("incorrect", i.INCORRECT), h = () => o("incorrect-icon", i.INCORRECT_WITH_ICON), g = () => o("incorrect-secondary", i.INCORRECT_SECONDARY), _ = () => o("missing", i.MISSING), v = () => o("missing-icon", i.MISSING_WITH_ICON), y = () => o("primary", i.PRIMARY), b = () => o("primary-light", i.PRIMARY_LIGHT), x = () => o("primary-dark", i.PRIMARY_DARK), S = () => o("primary-text", "text", i.TEXT), C = () => o("faded-primary", i.FADED_PRIMARY), w = () => o("secondary", i.SECONDARY), T = () => o("secondary-light", i.SECONDARY_LIGHT), E = () => o("secondary-dark", i.SECONDARY_DARK), D = () => o("secondary-text", "text", i.TEXT), O = () => o("background", i.BACKGROUND), k = () => o("background-dark", i.BACKGROUND_DARK), A = () => o("secondary-background", i.SECONDARY_BACKGROUND), j = () => o("dropdown-background", i.DROPDOWN_BACKGROUND), re = () => o("tertiary", i.TERTIARY), M = () => o("tertiary-light", i.TERTIARY_LIGHT), N = () => o("border", i.BORDER), P = () => o("border-light", i.BORDER_LIGHT), F = () => o("border-dark", i.BORDER_DARK), I = () => o("border-gray", i.BORDER_GRAY), L = () => o("table-grid", "text", i.TABLE_GRID), R = () => o("table-grid-light", "border-light", i.TABLE_GRID_LIGHT), z = () => o("table-stripe", "background-dark", i.TABLE_STRIPE), B = () => o("black", i.BLACK), V = () => o("white", i.WHITE), H = () => i.TRANSPARENT, U = () => o("focus-checked", i.FOCUS_CHECKED), W = () => o("focus-checked-border", i.FOCUS_CHECKED_BORDER), G = () => o("focus-unchecked", i.FOCUS_UNCHECKED), K = () => o("focus-unchecked-border", i.FOCUS_UNCHECKED_BORDER), q = () => o("button-focus-outline", i.BUTTON_FOCUS_OUTLINE), J = () => o("blue-grey-100", i.BLUE_GREY100), Y = () => o("blue-grey-300", i.BLUE_GREY300), X = () => o("blue-grey-600", i.BLUE_GREY600), Z = () => o("blue-grey-900", i.BLUE_GREY900), Q = () => o("keypad-button", i.KEYPAD_BUTTON), ie = () => o("keypad-button-operator", i.KEYPAD_BUTTON_OPERATOR), ae = () => o("keypad-empty-placeholder", i.KEYPAD_EMPTY_PLACEHOLDER), oe = () => o("keypad-button-hover", i.KEYPAD_BUTTON_HOVER), $ = () => o("keypad-button-operator-hover", i.KEYPAD_BUTTON_OPERATOR_HOVER), se = () => o("keyboard-focus-indicator", i.KEY_BOARD_FOCUS_INDICATOR), ce = () => o("button-border", i.BUTTON_BORDER), le = () => o("button-hover-bg", i.BUTTON_HOVER_BG), ue = {
113
121
  AXIS_LINE_COLOR: "#5A53C9",
114
122
  ROLLOVER_FILL_BAR_COLOR: "#050F2D",
115
123
  GRIDLINES_COLOR: "#8E88EA",
@@ -117,4 +125,4 @@ var c = (e) => (...t) => {
117
125
  SHAPES_FILL_COLOR: "#7986cb"
118
126
  };
119
127
  //#endregion
120
- export { o as color_exports, p as correct, d as disabled, _ as incorrect, u as text };
128
+ export { O as background, k as backgroundDark, B as black, J as blueGrey100, Y as blueGrey300, X as blueGrey600, Z as blueGrey900, N as border, F as borderDark, I as borderGray, P as borderLight, ce as buttonBorder, q as buttonFocusOutline, le as buttonHoverBg, ne as color_exports, u as correct, d as correctSecondary, f as correctTertiary, p as correctWithIcon, i as defaults, c as disabled, l as disabledSecondary, j as dropdownBackground, C as fadedPrimary, U as focusChecked, W as focusCheckedBorder, G as focusUnchecked, K as focusUncheckedBorder, m as incorrect, g as incorrectSecondary, h as incorrectWithIcon, se as keyBoardFocusIndicator, Q as keypadButton, oe as keypadButtonHover, ie as keypadButtonOperator, $ as keypadButtonOperatorHover, ae as keypadEmptyPlaceholder, _ as missing, v as missingWithIcon, y as primary, x as primaryDark, b as primaryLight, S as primaryText, w as secondary, A as secondaryBackground, E as secondaryDark, T as secondaryLight, D as secondaryText, L as tableGrid, R as tableGridLight, z as tableStripe, re as tertiary, M as tertiaryLight, s as text, H as transparent, a as v, ue as visualElementsColors, V as white };
package/dist/feedback.js CHANGED
@@ -62,4 +62,4 @@ var l = a("div")({
62
62
  }
63
63
  };
64
64
  //#endregion
65
- export { f as default };
65
+ export { f as Feedback, f as default };
package/dist/index.js CHANGED
@@ -1,13 +1,13 @@
1
1
  import { color_exports as e } from "./color.js";
2
- import t from "./feedback.js";
2
+ import { Feedback as t } from "./feedback.js";
3
3
  import { response_indicators_exports as n } from "./response-indicators.js";
4
- import r from "./collapsible/index.js";
4
+ import { Collapsible as r } from "./collapsible/index.js";
5
5
  import i from "./withUndoReset.js";
6
6
  import a from "./ui-layout.js";
7
7
  import o from "./preview-layout.js";
8
8
  import s from "./html-and-math.js";
9
9
  import c from "./input-container.js";
10
- import l from "./preview-prompt.js";
10
+ import { PreviewPrompt as l } from "./preview-prompt.js";
11
11
  import u from "./readable.js";
12
12
  import d from "./purpose.js";
13
13
  import { hasText as f } from "./has-text.js";
@@ -24,6 +24,7 @@ export declare class PreviewPrompt extends Component {
24
24
  static defaultProps: {
25
25
  onClick: () => void;
26
26
  };
27
+ promptRef: React.RefObject<unknown>;
27
28
  parsedText: any;
28
29
  addCustomAudioButtonControls(): void;
29
30
  removeCustomAudioButtonListeners(): void;
@@ -1,20 +1,18 @@
1
- import { text as e } from "./color.js";
2
- import { Component as t } from "react";
3
- import n from "prop-types";
4
- import { styled as r } from "@mui/material/styles";
5
- import { jsx as i } from "react/jsx-runtime";
6
- import { renderMath as a } from "@pie-element/shared-math-rendering-mathjax";
1
+ import { tableGrid as e, tableStripe as t, text as n } from "./color.js";
2
+ import r, { Component as i } from "react";
3
+ import a from "prop-types";
4
+ import { styled as o } from "@mui/material/styles";
5
+ import { jsx as s } from "react/jsx-runtime";
6
+ import { renderMath as c } from "@pie-element/shared-math-rendering-mathjax";
7
7
  //#region src/preview-prompt.tsx
8
- var o = r("div")(({ theme: t, tagName: n }) => ({
8
+ var l = o("div")(({ theme: r, tagName: i }) => ({
9
9
  "&:not(.MathJax) > table:not([role=\"presentation\"])": { borderCollapse: "collapse" },
10
- "&:not(.MathJax) > table:not([role=\"presentation\"]):has(tbody tr > th:first-child):not(:has(tbody tr > td:first-child)) tbody td:nth-child(even)": {
11
- backgroundColor: "#f6f8fa",
12
- color: t.palette.common.black
13
- },
14
- "&:not(.MathJax) > table:not([role=\"presentation\"]):has(tbody tr > td:first-child) tbody tr:nth-child(even) td": {
15
- backgroundColor: "#f6f8fa",
16
- color: t.palette.common.black
10
+ "&:not(.MathJax) table[border]:not([role=\"presentation\"]), &:not(.MathJax) table[border]:not([role=\"presentation\"]) td, &:not(.MathJax) table[border]:not([role=\"presentation\"]) th": {
11
+ borderStyle: "solid",
12
+ borderColor: e()
17
13
  },
14
+ "&:not(.MathJax) > table:not([role=\"presentation\"]):has(tbody tr > th:first-child):not(:has(tbody tr > td:first-child)) tbody td:nth-child(even)": { backgroundColor: t() },
15
+ "&:not(.MathJax) > table:not([role=\"presentation\"]):has(tbody tr > td:first-child) tbody tr:nth-child(even) td": { backgroundColor: t() },
18
16
  "&:not(.MathJax) table:not([role=\"presentation\"]) td, &:not(.MathJax) table:not([role=\"presentation\"]) th": {
19
17
  padding: ".6em 1em",
20
18
  textAlign: "left"
@@ -22,38 +20,39 @@ var o = r("div")(({ theme: t, tagName: n }) => ({
22
20
  "&:not(.MathJax) > table td > p.kds-indent": { textAlign: "initial" },
23
21
  "&.prompt": {
24
22
  verticalAlign: "middle",
25
- color: e()
23
+ color: n()
26
24
  },
27
25
  "&.legend": {
28
26
  width: "100%",
29
27
  fontSize: "inherit !important"
30
28
  },
31
29
  "&.rationale": {
32
- paddingLeft: t.spacing(4),
33
- paddingBottom: t.spacing(1)
30
+ paddingLeft: r.spacing(4),
31
+ paddingBottom: r.spacing(1)
34
32
  },
35
33
  "&.prompt-label": {
36
- color: `${e()} !important`,
34
+ color: `${n()} !important`,
37
35
  display: "flex",
38
36
  flexDirection: "column",
39
37
  verticalAlign: "middle",
40
38
  cursor: "pointer",
41
39
  "& > p": { margin: "0 0 0 0 !important" }
42
40
  }
43
- })), s = /\\embed\{newLine\}\[\]/g, c = "\\newline ", l = class extends t {
41
+ })), u = /\\embed\{newLine\}\[\]/g, d = "\\newline ", f = "preview-prompt", p = class extends i {
44
42
  static propTypes = {
45
- prompt: n.string,
46
- tagName: n.string,
47
- className: n.string,
48
- onClick: n.func,
49
- defaultClassName: n.string,
50
- autoplayAudioEnabled: n.bool,
51
- customAudioButton: n.shape({
52
- playImage: n.string,
53
- pauseImage: n.string
43
+ prompt: a.string,
44
+ tagName: a.string,
45
+ className: a.string,
46
+ onClick: a.func,
47
+ defaultClassName: a.string,
48
+ autoplayAudioEnabled: a.bool,
49
+ customAudioButton: a.shape({
50
+ playImage: a.string,
51
+ pauseImage: a.string
54
52
  })
55
53
  };
56
54
  static defaultProps = { onClick: () => {} };
55
+ promptRef = r.createRef();
57
56
  parsedText = (e) => {
58
57
  let { customAudioButton: t } = this.props, n = document.createElement("div");
59
58
  n.innerHTML = e;
@@ -118,37 +117,37 @@ var o = r("div")(({ theme: t, tagName: n }) => ({
118
117
  this.renderMathContent();
119
118
  }
120
119
  renderMathContent() {
121
- let e = document.getElementById("preview-prompt");
122
- e && typeof a == "function" && a(e);
120
+ let e = this.promptRef.current;
121
+ e && typeof c == "function" && c(e);
123
122
  }
124
123
  alignImages() {
125
- document.querySelectorAll("#preview-prompt").forEach((e) => {
126
- let t = e.getElementsByTagName("img");
127
- if (t && t.length) {
128
- for (let e of t) if (e.attributes && e.attributes.alignment && e.attributes.alignment.value) {
129
- let t = e.attributes.alignment.value, n = t === "center" ? "center" : t === "right" ? "flex-end" : "flex-start", r = e.parentElement;
130
- if (r.tagName === "DIV" && r.style.display === "flex" && r.style.width === "100%") r.style.justifyContent = n;
131
- else {
132
- let t = document.createElement("div");
133
- t.style.display = "flex", t.style.width = "100%", t.style.justifyContent = n;
134
- let i = e.cloneNode(!0);
135
- t.appendChild(i), r.replaceChild(t, e);
136
- }
124
+ let e = this.promptRef.current;
125
+ if (!e) return;
126
+ let t = e.getElementsByTagName("img");
127
+ if (t && t.length) {
128
+ for (let e of t) if (e.attributes && e.attributes.alignment && e.attributes.alignment.value) {
129
+ let t = e.attributes.alignment.value, n = t === "center" ? "center" : t === "right" ? "flex-end" : "flex-start", r = e.parentElement;
130
+ if (r.tagName === "DIV" && r.style.display === "flex" && r.style.width === "100%") r.style.justifyContent = n;
131
+ else {
132
+ let t = document.createElement("div");
133
+ t.style.display = "flex", t.style.width = "100%", t.style.justifyContent = n;
134
+ let i = e.cloneNode(!0);
135
+ t.appendChild(i), r.replaceChild(t, e);
137
136
  }
138
137
  }
139
- });
138
+ }
140
139
  }
141
140
  render() {
142
- let { prompt: e, tagName: t, className: n, onClick: r, defaultClassName: a } = this.props, l = `${n || ""} ${a || ""} ${t === "legend" ? "legend" : ""}`.trim();
143
- return /* @__PURE__ */ i(o, {
141
+ let { prompt: e, tagName: t, className: n, onClick: r, defaultClassName: i } = this.props, a = `${n || ""} ${i || ""} ${t === "legend" ? "legend" : ""} ${f}`.trim();
142
+ return /* @__PURE__ */ s(l, {
144
143
  as: t || "div",
145
- id: "preview-prompt",
144
+ ref: this.promptRef,
146
145
  onClick: r,
147
- className: l,
146
+ className: a,
148
147
  tagName: t,
149
- dangerouslySetInnerHTML: { __html: this.parsedText(e || "").replace(s, c) }
148
+ dangerouslySetInnerHTML: { __html: this.parsedText(e || "").replace(u, d) }
150
149
  });
151
150
  }
152
151
  };
153
152
  //#endregion
154
- export { l as default };
153
+ export { p as PreviewPrompt, p as default };
@@ -1,5 +1,5 @@
1
1
  import { __exportAll as e } from "./_virtual/_rolldown/runtime.js";
2
- import t from "./feedback.js";
2
+ import { Feedback as t } from "./feedback.js";
3
3
  import n from "react";
4
4
  import r from "prop-types";
5
5
  import * as i from "@pie-lib/icons";
@@ -59,4 +59,4 @@ var u = /* @__PURE__ */ e({
59
59
  return a.propTypes = { feedback: r.string }, a;
60
60
  }, g = h(i.Correct, "correct"), _ = h(i.Incorrect, "incorrect"), v = h(i.PartiallyCorrect, "partially-correct"), y = h(i.NothingSubmitted, "nothing-submitted");
61
61
  //#endregion
62
- export { u as response_indicators_exports };
62
+ export { g as Correct, _ as Incorrect, y as NothingSubmitted, v as PartiallyCorrect, u as response_indicators_exports };
package/package.json CHANGED
@@ -1,7 +1,12 @@
1
1
  {
2
2
  "name": "@pie-lib/render-ui",
3
- "version": "6.1.1-next.37",
3
+ "version": "6.1.1-next.39",
4
4
  "description": "Some shared ui elements when rendering - but not worthy of their own package yet.",
5
+ "repository": {
6
+ "type": "git",
7
+ "url": "git+https://github.com/pie-framework/pie-elements-ng.git",
8
+ "directory": "packages/lib-react/render-ui"
9
+ },
5
10
  "dependencies": {
6
11
  "@emotion/react": "^11.14.0",
7
12
  "@emotion/styled": "^11.14.1",
@@ -13,7 +18,7 @@
13
18
  "prop-types": "^15.7.2",
14
19
  "react-transition-group": "^4.4.5",
15
20
  "@pie-element/shared-math-rendering-mathjax": "0.1.1-next.0",
16
- "@pie-element/shared-lodash": "0.1.1-next.0"
21
+ "@pie-element/shared-lodash": "0.1.1-next.1"
17
22
  },
18
23
  "type": "module",
19
24
  "main": "./dist/index.js",