@pie-lib/config-ui 13.1.0-beta.8 → 14.0.0-next.35

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.
Files changed (189) hide show
  1. package/dist/_virtual/_rolldown/runtime.js +11 -0
  2. package/dist/alert-dialog.d.ts +44 -0
  3. package/dist/alert-dialog.js +47 -0
  4. package/dist/checkbox.d.ts +34 -0
  5. package/dist/checkbox.js +57 -0
  6. package/dist/choice-configuration/feedback-menu.d.ts +32 -0
  7. package/dist/choice-configuration/feedback-menu.js +85 -0
  8. package/dist/choice-configuration/index.d.ts +62 -0
  9. package/dist/choice-configuration/index.js +240 -0
  10. package/dist/choice-utils.d.ts +21 -0
  11. package/dist/choice-utils.js +15 -0
  12. package/dist/feedback-config/feedback-selector.d.ts +33 -0
  13. package/dist/feedback-config/feedback-selector.js +92 -0
  14. package/dist/feedback-config/group.d.ts +21 -0
  15. package/dist/feedback-config/group.js +33 -0
  16. package/dist/feedback-config/index.d.ts +48 -0
  17. package/dist/feedback-config/index.js +96 -0
  18. package/dist/form-section.d.ts +25 -0
  19. package/dist/form-section.js +25 -0
  20. package/dist/fraction-to-number.d.ts +7 -0
  21. package/dist/fraction-to-number.js +9 -0
  22. package/dist/help.d.ts +41 -0
  23. package/dist/help.js +62 -0
  24. package/dist/index.d.ts +31 -0
  25. package/dist/index.js +34 -0
  26. package/dist/input.d.ts +29 -0
  27. package/dist/input.js +65 -0
  28. package/dist/inputs.d.ts +63 -0
  29. package/dist/inputs.js +70 -0
  30. package/dist/langs.d.ts +41 -0
  31. package/dist/langs.js +76 -0
  32. package/dist/layout/config-layout.d.ts +10 -0
  33. package/dist/layout/config-layout.js +75 -0
  34. package/dist/layout/index.d.ts +11 -0
  35. package/dist/layout/index.js +10 -0
  36. package/dist/layout/layout-contents.d.ts +21 -0
  37. package/dist/layout/layout-contents.js +70 -0
  38. package/dist/layout/settings-box.d.ts +19 -0
  39. package/dist/layout/settings-box.js +32 -0
  40. package/dist/mui-box/index.d.ts +21 -0
  41. package/dist/mui-box/index.js +47 -0
  42. package/dist/node_modules/.bun/@babel_runtime@7.29.7/node_modules/@babel/runtime/helpers/esm/extends.js +12 -0
  43. package/dist/node_modules/.bun/@babel_runtime@7.29.7/node_modules/@babel/runtime/helpers/esm/inheritsLoose.js +7 -0
  44. package/dist/node_modules/.bun/@babel_runtime@7.29.7/node_modules/@babel/runtime/helpers/esm/objectWithoutPropertiesLoose.js +12 -0
  45. package/dist/node_modules/.bun/@babel_runtime@7.29.7/node_modules/@babel/runtime/helpers/esm/setPrototypeOf.js +8 -0
  46. package/dist/node_modules/.bun/react-measure@2.5.2_6dbf9a050bc9aadb/node_modules/react-measure/dist/index.esm.js +122 -0
  47. package/dist/node_modules/.bun/resize-observer-polyfill@1.5.1/node_modules/resize-observer-polyfill/dist/ResizeObserver.es.js +276 -0
  48. package/dist/number-text-field-custom.d.ts +51 -0
  49. package/dist/number-text-field-custom.js +192 -0
  50. package/dist/number-text-field.d.ts +47 -0
  51. package/dist/number-text-field.js +122 -0
  52. package/dist/radio-with-label.d.ts +25 -0
  53. package/dist/radio-with-label.js +27 -0
  54. package/dist/settings/display-size.d.ts +26 -0
  55. package/dist/settings/display-size.js +45 -0
  56. package/dist/settings/index.d.ts +45 -0
  57. package/dist/settings/index.js +63 -0
  58. package/dist/settings/panel.d.ts +27 -0
  59. package/dist/settings/panel.js +201 -0
  60. package/dist/settings/settings-radio-label.d.ts +25 -0
  61. package/dist/settings/settings-radio-label.js +29 -0
  62. package/dist/settings/toggle.d.ts +25 -0
  63. package/dist/settings/toggle.js +33 -0
  64. package/dist/tabs/index.d.ts +22 -0
  65. package/dist/tabs/index.js +39 -0
  66. package/dist/tags-input/index.d.ts +21 -0
  67. package/dist/tags-input/index.js +83 -0
  68. package/dist/two-choice.d.ts +43 -0
  69. package/dist/two-choice.js +79 -0
  70. package/dist/with-stateful-model.d.ts +42 -0
  71. package/dist/with-stateful-model.js +32 -0
  72. package/package.json +31 -19
  73. package/CHANGELOG.json +0 -32
  74. package/CHANGELOG.md +0 -2419
  75. package/lib/alert-dialog.js +0 -68
  76. package/lib/alert-dialog.js.map +0 -1
  77. package/lib/checkbox.js +0 -84
  78. package/lib/checkbox.js.map +0 -1
  79. package/lib/choice-configuration/feedback-menu.js +0 -129
  80. package/lib/choice-configuration/feedback-menu.js.map +0 -1
  81. package/lib/choice-configuration/index.js +0 -381
  82. package/lib/choice-configuration/index.js.map +0 -1
  83. package/lib/choice-utils.js +0 -42
  84. package/lib/choice-utils.js.map +0 -1
  85. package/lib/feedback-config/feedback-selector.js +0 -155
  86. package/lib/feedback-config/feedback-selector.js.map +0 -1
  87. package/lib/feedback-config/group.js +0 -61
  88. package/lib/feedback-config/group.js.map +0 -1
  89. package/lib/feedback-config/index.js +0 -146
  90. package/lib/feedback-config/index.js.map +0 -1
  91. package/lib/form-section.js +0 -44
  92. package/lib/form-section.js.map +0 -1
  93. package/lib/help.js +0 -106
  94. package/lib/help.js.map +0 -1
  95. package/lib/index.js +0 -186
  96. package/lib/index.js.map +0 -1
  97. package/lib/input.js +0 -106
  98. package/lib/input.js.map +0 -1
  99. package/lib/inputs.js +0 -105
  100. package/lib/inputs.js.map +0 -1
  101. package/lib/langs.js +0 -136
  102. package/lib/langs.js.map +0 -1
  103. package/lib/layout/config-layout.js +0 -137
  104. package/lib/layout/config-layout.js.map +0 -1
  105. package/lib/layout/index.js +0 -21
  106. package/lib/layout/index.js.map +0 -1
  107. package/lib/layout/layout-contents.js +0 -160
  108. package/lib/layout/layout-contents.js.map +0 -1
  109. package/lib/layout/settings-box.js +0 -57
  110. package/lib/layout/settings-box.js.map +0 -1
  111. package/lib/mui-box/index.js +0 -63
  112. package/lib/mui-box/index.js.map +0 -1
  113. package/lib/number-text-field-custom.js +0 -376
  114. package/lib/number-text-field-custom.js.map +0 -1
  115. package/lib/number-text-field.js +0 -229
  116. package/lib/number-text-field.js.map +0 -1
  117. package/lib/radio-with-label.js +0 -48
  118. package/lib/radio-with-label.js.map +0 -1
  119. package/lib/settings/display-size.js +0 -61
  120. package/lib/settings/display-size.js.map +0 -1
  121. package/lib/settings/index.js +0 -110
  122. package/lib/settings/index.js.map +0 -1
  123. package/lib/settings/panel.js +0 -392
  124. package/lib/settings/panel.js.map +0 -1
  125. package/lib/settings/settings-radio-label.js +0 -51
  126. package/lib/settings/settings-radio-label.js.map +0 -1
  127. package/lib/settings/toggle.js +0 -63
  128. package/lib/settings/toggle.js.map +0 -1
  129. package/lib/tabs/index.js +0 -75
  130. package/lib/tabs/index.js.map +0 -1
  131. package/lib/tags-input/index.js +0 -149
  132. package/lib/tags-input/index.js.map +0 -1
  133. package/lib/two-choice.js +0 -136
  134. package/lib/two-choice.js.map +0 -1
  135. package/lib/with-stateful-model.js +0 -61
  136. package/lib/with-stateful-model.js.map +0 -1
  137. package/src/__tests__/alert-dialog.test.jsx +0 -183
  138. package/src/__tests__/checkbox.test.jsx +0 -152
  139. package/src/__tests__/choice-utils.test.js +0 -12
  140. package/src/__tests__/form-section.test.jsx +0 -328
  141. package/src/__tests__/help.test.jsx +0 -184
  142. package/src/__tests__/input.test.jsx +0 -156
  143. package/src/__tests__/langs.test.jsx +0 -376
  144. package/src/__tests__/number-text-field-custom.test.jsx +0 -255
  145. package/src/__tests__/number-text-field.test.jsx +0 -263
  146. package/src/__tests__/radio-with-label.test.jsx +0 -155
  147. package/src/__tests__/settings-panel.test.js +0 -187
  148. package/src/__tests__/settings.test.jsx +0 -452
  149. package/src/__tests__/tabs.test.jsx +0 -188
  150. package/src/__tests__/two-choice.test.js +0 -110
  151. package/src/__tests__/with-stateful-model.test.jsx +0 -139
  152. package/src/alert-dialog.jsx +0 -75
  153. package/src/checkbox.jsx +0 -61
  154. package/src/choice-configuration/__tests__/feedback-menu.test.jsx +0 -151
  155. package/src/choice-configuration/__tests__/index.test.jsx +0 -234
  156. package/src/choice-configuration/feedback-menu.jsx +0 -96
  157. package/src/choice-configuration/index.jsx +0 -357
  158. package/src/choice-utils.js +0 -30
  159. package/src/feedback-config/__tests__/feedback-config.test.jsx +0 -141
  160. package/src/feedback-config/__tests__/feedback-selector.test.jsx +0 -97
  161. package/src/feedback-config/feedback-selector.jsx +0 -112
  162. package/src/feedback-config/group.jsx +0 -51
  163. package/src/feedback-config/index.jsx +0 -111
  164. package/src/form-section.jsx +0 -31
  165. package/src/help.jsx +0 -79
  166. package/src/index.js +0 -55
  167. package/src/input.jsx +0 -72
  168. package/src/inputs.jsx +0 -69
  169. package/src/langs.jsx +0 -111
  170. package/src/layout/__tests__/config.layout.test.jsx +0 -59
  171. package/src/layout/__tests__/layout-content.test.jsx +0 -3
  172. package/src/layout/config-layout.jsx +0 -103
  173. package/src/layout/index.js +0 -4
  174. package/src/layout/layout-contents.jsx +0 -117
  175. package/src/layout/settings-box.jsx +0 -32
  176. package/src/mui-box/index.jsx +0 -56
  177. package/src/number-text-field-custom.jsx +0 -333
  178. package/src/number-text-field.jsx +0 -215
  179. package/src/radio-with-label.jsx +0 -30
  180. package/src/settings/display-size.jsx +0 -53
  181. package/src/settings/index.js +0 -83
  182. package/src/settings/panel.jsx +0 -333
  183. package/src/settings/settings-radio-label.jsx +0 -32
  184. package/src/settings/toggle.jsx +0 -46
  185. package/src/tabs/index.jsx +0 -47
  186. package/src/tags-input/__tests__/index.test.jsx +0 -113
  187. package/src/tags-input/index.jsx +0 -116
  188. package/src/two-choice.jsx +0 -90
  189. package/src/with-stateful-model.jsx +0 -36
@@ -0,0 +1,63 @@
1
+ /**
2
+ * @synced-from pie-lib/packages/config-ui/src/inputs.jsx
3
+ * @auto-generated
4
+ *
5
+ * This file is automatically synced from pie-elements and converted to TypeScript.
6
+ * Manual edits will be overwritten on next sync.
7
+ * To make changes, edit the upstream JavaScript file and run sync again.
8
+ */
9
+ import PropTypes from 'prop-types';
10
+ import React from 'react';
11
+ declare const InputSwitch: {
12
+ ({ className, label, checked, onChange }: {
13
+ className: any;
14
+ label: any;
15
+ checked: any;
16
+ onChange: any;
17
+ }): React.JSX.Element;
18
+ propTypes: {
19
+ className: PropTypes.Requireable<string>;
20
+ label: PropTypes.Requireable<string>;
21
+ checked: PropTypes.Requireable<boolean>;
22
+ onChange: PropTypes.Requireable<(...args: any[]) => any>;
23
+ disabled: PropTypes.Requireable<boolean>;
24
+ error: PropTypes.Requireable<string>;
25
+ };
26
+ };
27
+ declare const InputCheckbox: {
28
+ ({ className, label, checked, onChange, disabled, error }: {
29
+ className: any;
30
+ label: any;
31
+ checked: any;
32
+ onChange: any;
33
+ disabled: any;
34
+ error: any;
35
+ }): React.JSX.Element;
36
+ propTypes: {
37
+ className: PropTypes.Requireable<string>;
38
+ label: PropTypes.Requireable<string>;
39
+ checked: PropTypes.Requireable<boolean>;
40
+ onChange: PropTypes.Requireable<(...args: any[]) => any>;
41
+ disabled: PropTypes.Requireable<boolean>;
42
+ error: PropTypes.Requireable<string>;
43
+ };
44
+ };
45
+ declare const InputRadio: {
46
+ ({ className, label, checked, onChange, disabled, error }: {
47
+ className: any;
48
+ label: any;
49
+ checked: any;
50
+ onChange: any;
51
+ disabled: any;
52
+ error: any;
53
+ }): React.JSX.Element;
54
+ propTypes: {
55
+ className: PropTypes.Requireable<string>;
56
+ label: PropTypes.Requireable<string>;
57
+ checked: PropTypes.Requireable<boolean>;
58
+ onChange: PropTypes.Requireable<(...args: any[]) => any>;
59
+ disabled: PropTypes.Requireable<boolean>;
60
+ error: PropTypes.Requireable<string>;
61
+ };
62
+ };
63
+ export { InputSwitch, InputCheckbox, InputRadio };
package/dist/inputs.js ADDED
@@ -0,0 +1,70 @@
1
+ import "react";
2
+ import e from "prop-types";
3
+ import { styled as t } from "@mui/material/styles";
4
+ import { jsx as n } from "react/jsx-runtime";
5
+ import * as r from "@pie-lib/render-ui";
6
+ import { InputContainer as i, color as a } from "@pie-lib/render-ui";
7
+ import o from "@mui/material/Radio";
8
+ import s from "@mui/material/Checkbox";
9
+ import c from "@mui/material/Switch";
10
+ //#region src/inputs.tsx
11
+ function l(e) {
12
+ return typeof e == "function" || typeof e == "object" && !!e && typeof e.$$typeof == "symbol";
13
+ }
14
+ function u(e, t) {
15
+ return !e || l(e) ? e : l(e.default) ? e.default : t && l(e[t]) ? e[t] : t && l(e[t]?.default) ? e[t].default : e;
16
+ }
17
+ var d = u(i, "InputContainer") || u(m.InputContainer, "InputContainer"), f = r, p = f.default, m = p && typeof p == "object" ? p : f, h = {
18
+ className: e.string,
19
+ label: e.string,
20
+ checked: e.bool,
21
+ onChange: e.func,
22
+ disabled: e.bool,
23
+ error: e.string
24
+ }, g = t(c)(() => ({
25
+ justifyContent: "inherit",
26
+ transform: "translate(-20%, 20%)"
27
+ })), _ = ({ className: e, label: t, checked: r, onChange: i }) => /* @__PURE__ */ n(d, {
28
+ className: e,
29
+ label: t,
30
+ children: /* @__PURE__ */ n(g, {
31
+ checked: r,
32
+ onChange: i,
33
+ "aria-label": t
34
+ })
35
+ });
36
+ _.propTypes = { ...h };
37
+ var v = t(s)(({ theme: e, error: t }) => ({
38
+ transform: "translate(-25%, 20%)",
39
+ color: `${a.tertiary()} !important`,
40
+ ...t && { color: `${e.palette.error.main} !important` }
41
+ })), y = ({ className: e, label: t, checked: r, onChange: i, disabled: a, error: o }) => /* @__PURE__ */ n(d, {
42
+ className: e,
43
+ label: t,
44
+ children: /* @__PURE__ */ n(v, {
45
+ disabled: a,
46
+ checked: r,
47
+ onChange: i,
48
+ "aria-label": t,
49
+ error: o
50
+ })
51
+ });
52
+ y.propTypes = { ...h };
53
+ var b = t(o)(({ theme: e, error: t }) => ({
54
+ transform: "translate(-20%, 20%)",
55
+ color: `${a.tertiary()} !important`,
56
+ ...t && { color: `${e.palette.error.main} !important` }
57
+ })), x = ({ className: e, label: t, checked: r, onChange: i, disabled: a, error: o }) => /* @__PURE__ */ n(d, {
58
+ className: e,
59
+ label: t,
60
+ children: /* @__PURE__ */ n(b, {
61
+ disabled: a,
62
+ checked: r,
63
+ onChange: i,
64
+ "aria-label": t,
65
+ error: o
66
+ })
67
+ });
68
+ x.propTypes = { ...h };
69
+ //#endregion
70
+ export { y as InputCheckbox, x as InputRadio, _ as InputSwitch };
@@ -0,0 +1,41 @@
1
+ /**
2
+ * @synced-from pie-lib/packages/config-ui/src/langs.jsx
3
+ * @auto-generated
4
+ *
5
+ * This file is automatically synced from pie-elements and converted to TypeScript.
6
+ * Manual edits will be overwritten on next sync.
7
+ * To make changes, edit the upstream JavaScript file and run sync again.
8
+ */
9
+ import PropTypes from 'prop-types';
10
+ import React from 'react';
11
+ export declare class Langs extends React.Component {
12
+ static propTypes: {
13
+ onChange: PropTypes.Requireable<(...args: any[]) => any>;
14
+ langs: PropTypes.Requireable<any[]>;
15
+ selected: PropTypes.Requireable<string>;
16
+ label: PropTypes.Requireable<string>;
17
+ uid: PropTypes.Requireable<string>;
18
+ };
19
+ constructor(props: any);
20
+ choose: any;
21
+ render(): React.JSX.Element;
22
+ }
23
+ export default Langs;
24
+ export declare const LanguageControls: {
25
+ ({ langs, activeLang, defaultLang, onActiveLangChange, onDefaultLangChange, className, }: {
26
+ langs: any;
27
+ activeLang: any;
28
+ defaultLang: any;
29
+ onActiveLangChange: any;
30
+ onDefaultLangChange: any;
31
+ className: any;
32
+ }): React.JSX.Element;
33
+ propTypes: {
34
+ langs: PropTypes.Requireable<any[]>;
35
+ activeLang: PropTypes.Validator<string>;
36
+ defaultLang: PropTypes.Validator<string>;
37
+ onActiveLangChange: PropTypes.Validator<(...args: any[]) => any>;
38
+ onDefaultLangChange: PropTypes.Validator<(...args: any[]) => any>;
39
+ className: PropTypes.Requireable<string>;
40
+ };
41
+ };
package/dist/langs.js ADDED
@@ -0,0 +1,76 @@
1
+ import e from "react";
2
+ import t from "prop-types";
3
+ import { styled as n } from "@mui/material/styles";
4
+ import { jsx as r, jsxs as i } from "react/jsx-runtime";
5
+ import a from "@mui/material/Input";
6
+ import o from "@mui/material/InputLabel";
7
+ import s from "@mui/material/Select";
8
+ import c from "@mui/material/MenuItem";
9
+ import l from "@mui/material/FormControl";
10
+ import u from "debug";
11
+ //#region src/langs.tsx
12
+ var d = u("pie-elements:config-ui:langs"), f = n("div")(() => ({
13
+ flexDirection: "column",
14
+ alignItems: "start",
15
+ display: "flex",
16
+ position: "relative",
17
+ paddingTop: "0px",
18
+ paddingRight: "0px"
19
+ })), p = n(l)(() => ({ position: "initial" })), m = n(o)(({ theme: e }) => ({ paddingBottom: e.spacing(1) })), h = class extends e.Component {
20
+ static propTypes = {
21
+ onChange: t.func,
22
+ langs: t.array,
23
+ selected: t.string,
24
+ label: t.string,
25
+ uid: t.string
26
+ };
27
+ constructor(e) {
28
+ super(e), this.uid = e.uid || (Math.random() * 1e4).toFixed();
29
+ }
30
+ choose = (e) => {
31
+ d("[choose] event: ", e), this.props.onChange && this.props.onChange(e.target.value);
32
+ };
33
+ render() {
34
+ let { langs: e, selected: t, label: n } = this.props;
35
+ return d("[render] selected:", t), /* @__PURE__ */ r(f, { children: /* @__PURE__ */ i(p, { children: [/* @__PURE__ */ r(m, {
36
+ htmlFor: this.uid,
37
+ children: n
38
+ }), /* @__PURE__ */ r(s, {
39
+ value: t,
40
+ onChange: this.choose,
41
+ input: /* @__PURE__ */ r(a, { id: this.uid }),
42
+ children: e.map((e, t) => /* @__PURE__ */ r(c, {
43
+ value: e,
44
+ children: e
45
+ }, t))
46
+ })] }) });
47
+ }
48
+ }, g = n("div")(() => ({
49
+ display: "grid",
50
+ gridAutoFlow: "column",
51
+ gridAutoColumns: "1fr",
52
+ gridGap: "8px"
53
+ })), _ = ({ langs: e, activeLang: t, defaultLang: n, onActiveLangChange: a, onDefaultLangChange: o, className: s }) => /* @__PURE__ */ i(g, {
54
+ className: s,
55
+ children: [/* @__PURE__ */ r(h, {
56
+ label: "Choose language to edit",
57
+ langs: e,
58
+ selected: t,
59
+ onChange: (e) => a(e)
60
+ }), /* @__PURE__ */ r(h, {
61
+ label: "Default language",
62
+ langs: e,
63
+ selected: n,
64
+ onChange: (e) => o(e)
65
+ })]
66
+ });
67
+ _.propTypes = {
68
+ langs: t.array,
69
+ activeLang: t.string.isRequired,
70
+ defaultLang: t.string.isRequired,
71
+ onActiveLangChange: t.func.isRequired,
72
+ onDefaultLangChange: t.func.isRequired,
73
+ className: t.string
74
+ };
75
+ //#endregion
76
+ export { h as Langs, h as default, _ as LanguageControls };
@@ -0,0 +1,10 @@
1
+ /**
2
+ * @synced-from pie-lib/packages/config-ui/src/layout/config-layout.jsx
3
+ * @auto-generated
4
+ *
5
+ * This file is automatically synced from pie-elements and converted to TypeScript.
6
+ * Manual edits will be overwritten on next sync.
7
+ * To make changes, edit the upstream JavaScript file and run sync again.
8
+ */
9
+ declare const ConfigLayout: any;
10
+ export default ConfigLayout;
@@ -0,0 +1,75 @@
1
+ import e, { withContentRect as t } from "../node_modules/.bun/react-measure@2.5.2_6dbf9a050bc9aadb/node_modules/react-measure/dist/index.esm.js";
2
+ import n from "./layout-contents.js";
3
+ import { SettingsBox as r } from "./settings-box.js";
4
+ import i from "react";
5
+ import a from "prop-types";
6
+ import { StyledEngineProvider as o, ThemeProvider as s, createTheme as c } from "@mui/material/styles";
7
+ import { jsx as l, jsxs as u } from "react/jsx-runtime";
8
+ //#region src/layout/config-layout.tsx
9
+ var d = c({
10
+ typography: { fontFamily: "inherit" },
11
+ components: { MuiButton: { styleOverrides: { contained: {
12
+ backgroundColor: "#e0e0e0",
13
+ color: "#000000",
14
+ "&:hover": { backgroundColor: "#bdbdbd" }
15
+ } } } }
16
+ }), f = class extends i.Component {
17
+ static propTypes = {
18
+ children: a.oneOfType([
19
+ a.string,
20
+ a.arrayOf(a.element),
21
+ a.element
22
+ ]),
23
+ className: a.string,
24
+ dimensions: a.object,
25
+ settings: a.element,
26
+ sidePanelMinWidth: a.number,
27
+ hideSettings: a.bool,
28
+ extraCSSRules: a.shape({
29
+ names: a.arrayOf(a.string),
30
+ rules: a.string
31
+ })
32
+ };
33
+ static defaultProps = {
34
+ sidePanelMinWidth: 1135,
35
+ hideSettings: !1,
36
+ dimensions: {}
37
+ };
38
+ constructor(...e) {
39
+ super(...e), this.state = { layoutMode: void 0 };
40
+ }
41
+ onResize = (e) => {
42
+ let { bounds: t } = e, { sidePanelMinWidth: n, dimensions: r } = this.props, { maxWidth: i } = r || {}, a = t.width > n && (!i || i > n) ? "inline" : "tabbed";
43
+ a !== this.state.layoutMode && this.setState({ layoutMode: a });
44
+ };
45
+ render() {
46
+ return /* @__PURE__ */ l(o, {
47
+ injectFirst: !0,
48
+ children: /* @__PURE__ */ l(s, {
49
+ theme: d,
50
+ children: /* @__PURE__ */ l(e, {
51
+ bounds: !0,
52
+ onResize: this.onResize,
53
+ children: ({ measureRef: e }) => {
54
+ let { children: t, settings: i, hideSettings: a, dimensions: o, extraCSSRules: s } = this.props, { layoutMode: c } = this.state, d = a ? null : c === "inline" ? /* @__PURE__ */ l(r, {
55
+ className: "settings-box",
56
+ children: i
57
+ }) : i;
58
+ return /* @__PURE__ */ u("div", {
59
+ ref: e,
60
+ className: "main-container extraCSSRules",
61
+ children: [s?.rules ? /* @__PURE__ */ l("style", { dangerouslySetInnerHTML: { __html: `.extraCSSRules { ${s.rules} }` } }) : null, /* @__PURE__ */ l(n, {
62
+ mode: c,
63
+ secondary: d,
64
+ dimensions: o,
65
+ children: t
66
+ })]
67
+ });
68
+ }
69
+ })
70
+ })
71
+ });
72
+ }
73
+ }, p = t("bounds")(f);
74
+ //#endregion
75
+ export { p as default };
@@ -0,0 +1,11 @@
1
+ /**
2
+ * @synced-from pie-lib/packages/config-ui/src/layout/index.js
3
+ * @auto-generated
4
+ *
5
+ * This file is automatically synced from pie-elements and converted to TypeScript.
6
+ * Manual edits will be overwritten on next sync.
7
+ * To make changes, edit the upstream JavaScript file and run sync again.
8
+ */
9
+ import ConfigLayout from './config-layout.js';
10
+ import LayoutContents from './layout-contents.js';
11
+ export { LayoutContents, ConfigLayout };
@@ -0,0 +1,10 @@
1
+ import { __exportAll as e } from "../_virtual/_rolldown/runtime.js";
2
+ import t from "./layout-contents.js";
3
+ import n from "./config-layout.js";
4
+ //#region src/layout/index.ts
5
+ var r = /* @__PURE__ */ e({
6
+ ConfigLayout: () => n,
7
+ LayoutContents: () => t
8
+ });
9
+ //#endregion
10
+ export { n as ConfigLayout, t as LayoutContents, r as layout_exports };
@@ -0,0 +1,21 @@
1
+ /**
2
+ * @synced-from pie-lib/packages/config-ui/src/layout/layout-contents.jsx
3
+ * @auto-generated
4
+ *
5
+ * This file is automatically synced from pie-elements and converted to TypeScript.
6
+ * Manual edits will be overwritten on next sync.
7
+ * To make changes, edit the upstream JavaScript file and run sync again.
8
+ */
9
+ import React from 'react';
10
+ import PropTypes from 'prop-types';
11
+ declare class RawLayoutContents extends React.Component {
12
+ static propTypes: {
13
+ mode: PropTypes.Requireable<string>;
14
+ secondary: PropTypes.Requireable<NonNullable<PropTypes.ReactNodeLike>>;
15
+ children: PropTypes.Requireable<NonNullable<PropTypes.ReactNodeLike>>;
16
+ dimensions: PropTypes.Requireable<object>;
17
+ };
18
+ getConfiguration: any;
19
+ render(): React.JSX.Element;
20
+ }
21
+ export default RawLayoutContents;
@@ -0,0 +1,70 @@
1
+ import { Tabs as e } from "../tabs/index.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
+ //#region src/layout/layout-contents.tsx
7
+ var o = r("div")(() => ({
8
+ display: "flex",
9
+ flexDirection: "column",
10
+ position: "relative"
11
+ })), s = r("div")(() => ({
12
+ display: "flex",
13
+ justifyContent: "space-between"
14
+ })), c = r("div")(({ theme: e }) => ({ padding: `${e.spacing(2)} 0` })), l = r("div")(() => ({ flex: "1" })), u = r("div")(({ theme: e }) => ({ marginLeft: e.spacing(2) })), d = class extends t.Component {
15
+ static propTypes = {
16
+ mode: n.oneOf(["tabbed", "inline"]),
17
+ secondary: n.oneOfType([n.arrayOf(n.node), n.node]),
18
+ children: n.oneOfType([n.arrayOf(n.node), n.node]),
19
+ dimensions: n.object
20
+ };
21
+ getConfiguration = () => {
22
+ let { secondary: e } = this.props;
23
+ return e?.props?.configuration || e?.props?.children?.props?.configuration || void 0;
24
+ };
25
+ render() {
26
+ let { mode: t, secondary: n, children: r, dimensions: d } = this.props, { minHeight: f, minWidth: p, maxHeight: m, maxWidth: h } = d || {}, g = this.getConfiguration(), _ = Object.entries(g || {}).some(([, e]) => !!e?.settings);
27
+ if (!_) try {
28
+ _ = JSON.stringify(g)?.match(/settings":true/)?.length;
29
+ } catch (e) {
30
+ console.log(e.toString());
31
+ }
32
+ return /* @__PURE__ */ a(o, {
33
+ style: {
34
+ minHeight: f,
35
+ minWidth: p,
36
+ maxHeight: m,
37
+ maxWidth: h
38
+ },
39
+ children: [
40
+ t === "inline" && /* @__PURE__ */ a(s, { children: [/* @__PURE__ */ i(l, {
41
+ className: "design-container",
42
+ children: r
43
+ }), _ && /* @__PURE__ */ i(u, {
44
+ className: "settings-container",
45
+ children: n
46
+ })] }),
47
+ t === "tabbed" && _ && /* @__PURE__ */ a(e, {
48
+ onChange: this.onTabsChange,
49
+ contentClassName: "content-container",
50
+ indicatorColor: "primary",
51
+ children: [/* @__PURE__ */ i(c, {
52
+ title: "Design",
53
+ className: "design-container",
54
+ children: r
55
+ }), /* @__PURE__ */ i(c, {
56
+ title: "Settings",
57
+ className: "settings-container",
58
+ children: n
59
+ })]
60
+ }),
61
+ t === "tabbed" && !_ && /* @__PURE__ */ i(c, {
62
+ className: "design-container",
63
+ children: r
64
+ })
65
+ ]
66
+ });
67
+ }
68
+ };
69
+ //#endregion
70
+ export { d as default };
@@ -0,0 +1,19 @@
1
+ /**
2
+ * @synced-from pie-lib/packages/config-ui/src/layout/settings-box.jsx
3
+ * @auto-generated
4
+ *
5
+ * This file is automatically synced from pie-elements and converted to TypeScript.
6
+ * Manual edits will be overwritten on next sync.
7
+ * To make changes, edit the upstream JavaScript file and run sync again.
8
+ */
9
+ import React from 'react';
10
+ import PropTypes from 'prop-types';
11
+ export declare class SettingsBox extends React.Component {
12
+ static propTypes: {
13
+ className: PropTypes.Requireable<string>;
14
+ children: PropTypes.Validator<NonNullable<NonNullable<PropTypes.ReactNodeLike>>>;
15
+ };
16
+ static defaultProps: {};
17
+ render(): React.JSX.Element;
18
+ }
19
+ export default SettingsBox;
@@ -0,0 +1,32 @@
1
+ import e from "react";
2
+ import t from "prop-types";
3
+ import { styled as n } from "@mui/material/styles";
4
+ import { jsx as r } from "react/jsx-runtime";
5
+ import { color as i } from "@pie-lib/render-ui";
6
+ //#region src/layout/settings-box.tsx
7
+ var a = n("div")(() => ({
8
+ backgroundColor: i.white(),
9
+ border: `2px solid ${i.border()}`,
10
+ display: "flex",
11
+ flexDirection: "column",
12
+ justifyContent: "flex-start",
13
+ minWidth: "275px",
14
+ maxWidth: "300px",
15
+ padding: "20px 4px 4px 20px",
16
+ zIndex: 99
17
+ })), o = class extends e.Component {
18
+ static propTypes = {
19
+ className: t.string,
20
+ children: t.oneOfType([t.arrayOf(t.node), t.node]).isRequired
21
+ };
22
+ static defaultProps = {};
23
+ render() {
24
+ let { className: e, children: t } = this.props;
25
+ return /* @__PURE__ */ r(a, {
26
+ className: e,
27
+ children: t
28
+ });
29
+ }
30
+ };
31
+ //#endregion
32
+ export { o as SettingsBox, o as default };
@@ -0,0 +1,21 @@
1
+ /**
2
+ * @synced-from pie-lib/packages/config-ui/src/mui-box/index.jsx
3
+ * @auto-generated
4
+ *
5
+ * This file is automatically synced from pie-elements and converted to TypeScript.
6
+ * Manual edits will be overwritten on next sync.
7
+ * To make changes, edit the upstream JavaScript file and run sync again.
8
+ */
9
+ import React from 'react';
10
+ import PropTypes from 'prop-types';
11
+ declare const MuiBox: {
12
+ ({ children, focused }: {
13
+ children: any;
14
+ focused: any;
15
+ }): React.JSX.Element;
16
+ propTypes: {
17
+ children: PropTypes.Validator<NonNullable<NonNullable<PropTypes.ReactNodeLike>>>;
18
+ focused: PropTypes.Validator<boolean>;
19
+ };
20
+ };
21
+ export default MuiBox;
@@ -0,0 +1,47 @@
1
+ import "react";
2
+ import e from "prop-types";
3
+ import { styled as t } from "@mui/material/styles";
4
+ import { jsx as n } from "react/jsx-runtime";
5
+ import r from "debug";
6
+ //#region src/mui-box/index.tsx
7
+ var i = r("pie-elements:config-ui:mui-box"), a = t("div")(({ theme: e, focused: t }) => {
8
+ let n = e.palette.mode === "light" ? "rgba(0, 0, 0, 0.42)" : "rgba(255, 255, 255, 0.7)";
9
+ return i(e.palette.primary[e.palette.mode || "light"]), {
10
+ paddingTop: e.spacing(1),
11
+ paddingBottom: e.spacing(1),
12
+ position: "relative",
13
+ "&:before": {
14
+ left: 0,
15
+ right: 0,
16
+ bottom: 0,
17
+ height: "1px",
18
+ content: "\"\"",
19
+ position: "absolute",
20
+ transition: "background-color 200ms cubic-bezier(0.4, 0, 0.2, 1) 0ms",
21
+ pointerEvents: "none",
22
+ backgroundColor: n
23
+ },
24
+ "&:hover:before": { height: "2px" },
25
+ "&:after": {
26
+ left: 0,
27
+ right: 0,
28
+ bottom: 0,
29
+ height: "2px",
30
+ content: "\"\"",
31
+ position: "absolute",
32
+ transform: t ? "scaleX(1)" : "scaleX(0)",
33
+ transition: "transform 200ms cubic-bezier(0.0, 0, 0.2, 1) 0ms",
34
+ pointerEvents: "none",
35
+ backgroundColor: e.palette.primary[e.palette.mode]
36
+ }
37
+ };
38
+ }), o = ({ children: e, focused: t }) => /* @__PURE__ */ n(a, {
39
+ focused: t,
40
+ children: e
41
+ });
42
+ o.propTypes = {
43
+ children: e.oneOfType([e.arrayOf(e.node), e.node]).isRequired,
44
+ focused: e.bool.isRequired
45
+ };
46
+ //#endregion
47
+ export { o as default };
@@ -0,0 +1,12 @@
1
+ //#region ../../../node_modules/.bun/@babel+runtime@7.29.7/node_modules/@babel/runtime/helpers/esm/extends.js
2
+ function e() {
3
+ return e = Object.assign ? Object.assign.bind() : function(e) {
4
+ for (var t = 1; t < arguments.length; t++) {
5
+ var n = arguments[t];
6
+ for (var r in n) ({}).hasOwnProperty.call(n, r) && (e[r] = n[r]);
7
+ }
8
+ return e;
9
+ }, e.apply(null, arguments);
10
+ }
11
+ //#endregion
12
+ export { e as default };
@@ -0,0 +1,7 @@
1
+ import e from "./setPrototypeOf.js";
2
+ //#region ../../../node_modules/.bun/@babel+runtime@7.29.7/node_modules/@babel/runtime/helpers/esm/inheritsLoose.js
3
+ function t(t, n) {
4
+ t.prototype = Object.create(n.prototype), t.prototype.constructor = t, e(t, n);
5
+ }
6
+ //#endregion
7
+ export { t as default };
@@ -0,0 +1,12 @@
1
+ //#region ../../../node_modules/.bun/@babel+runtime@7.29.7/node_modules/@babel/runtime/helpers/esm/objectWithoutPropertiesLoose.js
2
+ function e(e, t) {
3
+ if (e == null) return {};
4
+ var n = {};
5
+ for (var r in e) if ({}.hasOwnProperty.call(e, r)) {
6
+ if (t.indexOf(r) !== -1) continue;
7
+ n[r] = e[r];
8
+ }
9
+ return n;
10
+ }
11
+ //#endregion
12
+ export { e as default };
@@ -0,0 +1,8 @@
1
+ //#region ../../../node_modules/.bun/@babel+runtime@7.29.7/node_modules/@babel/runtime/helpers/esm/setPrototypeOf.js
2
+ function e(t, n) {
3
+ return e = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function(e, t) {
4
+ return e.__proto__ = t, e;
5
+ }, e(t, n);
6
+ }
7
+ //#endregion
8
+ export { e as default };