@pie-lib/render-ui 6.1.1-next.38 → 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.
- package/dist/collapsible/index.js +1 -1
- package/dist/color.d.ts +8 -0
- package/dist/color.js +75 -67
- package/dist/feedback.js +1 -1
- package/dist/index.js +3 -3
- package/dist/preview-prompt.d.ts +1 -0
- package/dist/preview-prompt.js +48 -49
- package/dist/response-indicators.js +2 -2
- package/package.json +6 -1
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
|
|
2
|
-
import { green as
|
|
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
|
|
5
|
-
background: () =>
|
|
6
|
-
backgroundDark: () =>
|
|
4
|
+
var ne = /* @__PURE__ */ ee({
|
|
5
|
+
background: () => O,
|
|
6
|
+
backgroundDark: () => k,
|
|
7
7
|
black: () => B,
|
|
8
|
-
blueGrey100: () =>
|
|
9
|
-
blueGrey300: () =>
|
|
10
|
-
blueGrey600: () =>
|
|
11
|
-
blueGrey900: () =>
|
|
12
|
-
border: () =>
|
|
13
|
-
borderDark: () =>
|
|
14
|
-
borderGray: () =>
|
|
15
|
-
borderLight: () =>
|
|
16
|
-
buttonBorder: () =>
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
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: () =>
|
|
33
|
-
incorrectWithIcon: () =>
|
|
34
|
-
keyBoardFocusIndicator: () =>
|
|
35
|
-
keypadButton: () =>
|
|
36
|
-
keypadButtonHover: () =>
|
|
37
|
-
keypadButtonOperator: () =>
|
|
38
|
-
keypadButtonOperatorHover: () =>
|
|
39
|
-
keypadEmptyPlaceholder: () =>
|
|
40
|
-
missing: () =>
|
|
41
|
-
missingWithIcon: () =>
|
|
42
|
-
primary: () =>
|
|
43
|
-
primaryDark: () =>
|
|
44
|
-
primaryLight: () =>
|
|
45
|
-
primaryText: () =>
|
|
46
|
-
secondary: () =>
|
|
47
|
-
secondaryBackground: () =>
|
|
48
|
-
secondaryDark: () =>
|
|
49
|
-
secondaryLight: () =>
|
|
50
|
-
secondaryText: () =>
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
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: () =>
|
|
56
|
-
visualElementsColors: () =>
|
|
59
|
+
v: () => a,
|
|
60
|
+
visualElementsColors: () => ue,
|
|
57
61
|
white: () => V
|
|
58
|
-
}),
|
|
62
|
+
}), i = {
|
|
59
63
|
TEXT: "black",
|
|
60
64
|
DISABLED: "grey",
|
|
61
65
|
DISABLED_SECONDARY: "#ABABAB",
|
|
62
|
-
CORRECT:
|
|
63
|
-
CORRECT_SECONDARY:
|
|
66
|
+
CORRECT: e[500],
|
|
67
|
+
CORRECT_SECONDARY: e[50],
|
|
64
68
|
CORRECT_TERTIARY: "#0EA449",
|
|
65
69
|
CORRECT_WITH_ICON: "#087D38",
|
|
66
|
-
INCORRECT:
|
|
67
|
-
INCORRECT_SECONDARY:
|
|
70
|
+
INCORRECT: te[500],
|
|
71
|
+
INCORRECT_SECONDARY: r[50],
|
|
68
72
|
INCORRECT_WITH_ICON: "#BF0D00",
|
|
69
|
-
MISSING:
|
|
73
|
+
MISSING: r[700],
|
|
70
74
|
MISSING_WITH_ICON: "#6A78A1",
|
|
71
|
-
PRIMARY:
|
|
72
|
-
PRIMARY_LIGHT:
|
|
73
|
-
PRIMARY_DARK:
|
|
74
|
-
SECONDARY:
|
|
75
|
-
SECONDARY_LIGHT:
|
|
76
|
-
SECONDARY_DARK:
|
|
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(
|
|
109
|
-
var
|
|
110
|
-
let
|
|
111
|
-
return
|
|
112
|
-
},
|
|
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 {
|
|
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
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";
|
package/dist/preview-prompt.d.ts
CHANGED
package/dist/preview-prompt.js
CHANGED
|
@@ -1,20 +1,18 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { Component as
|
|
3
|
-
import
|
|
4
|
-
import { styled as
|
|
5
|
-
import { jsx as
|
|
6
|
-
import { renderMath as
|
|
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
|
|
8
|
+
var l = o("div")(({ theme: r, tagName: i }) => ({
|
|
9
9
|
"&:not(.MathJax) > table:not([role=\"presentation\"])": { borderCollapse: "collapse" },
|
|
10
|
-
"&:not(.MathJax)
|
|
11
|
-
|
|
12
|
-
|
|
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:
|
|
23
|
+
color: n()
|
|
26
24
|
},
|
|
27
25
|
"&.legend": {
|
|
28
26
|
width: "100%",
|
|
29
27
|
fontSize: "inherit !important"
|
|
30
28
|
},
|
|
31
29
|
"&.rationale": {
|
|
32
|
-
paddingLeft:
|
|
33
|
-
paddingBottom:
|
|
30
|
+
paddingLeft: r.spacing(4),
|
|
31
|
+
paddingBottom: r.spacing(1)
|
|
34
32
|
},
|
|
35
33
|
"&.prompt-label": {
|
|
36
|
-
color: `${
|
|
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
|
-
})),
|
|
41
|
+
})), u = /\\embed\{newLine\}\[\]/g, d = "\\newline ", f = "preview-prompt", p = class extends i {
|
|
44
42
|
static propTypes = {
|
|
45
|
-
prompt:
|
|
46
|
-
tagName:
|
|
47
|
-
className:
|
|
48
|
-
onClick:
|
|
49
|
-
defaultClassName:
|
|
50
|
-
autoplayAudioEnabled:
|
|
51
|
-
customAudioButton:
|
|
52
|
-
playImage:
|
|
53
|
-
pauseImage:
|
|
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 =
|
|
122
|
-
e && typeof
|
|
120
|
+
let e = this.promptRef.current;
|
|
121
|
+
e && typeof c == "function" && c(e);
|
|
123
122
|
}
|
|
124
123
|
alignImages() {
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
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:
|
|
143
|
-
return /* @__PURE__ */
|
|
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
|
-
|
|
144
|
+
ref: this.promptRef,
|
|
146
145
|
onClick: r,
|
|
147
|
-
className:
|
|
146
|
+
className: a,
|
|
148
147
|
tagName: t,
|
|
149
|
-
dangerouslySetInnerHTML: { __html: this.parsedText(e || "").replace(
|
|
148
|
+
dangerouslySetInnerHTML: { __html: this.parsedText(e || "").replace(u, d) }
|
|
150
149
|
});
|
|
151
150
|
}
|
|
152
151
|
};
|
|
153
152
|
//#endregion
|
|
154
|
-
export {
|
|
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.
|
|
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",
|