@pie-lib/mask-markup 3.0.4-next.33 → 3.0.4-next.36
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/CHANGELOG.json +17 -0
- package/CHANGELOG.md +1256 -0
- package/LICENSE.md +5 -0
- package/lib/choices/choice.js +116 -0
- package/lib/choices/choice.js.map +1 -0
- package/lib/choices/index.js +103 -0
- package/lib/choices/index.js.map +1 -0
- package/lib/componentize.js +21 -0
- package/lib/componentize.js.map +1 -0
- package/lib/components/blank.js +371 -0
- package/lib/components/blank.js.map +1 -0
- package/lib/components/correct-input.js +94 -0
- package/lib/components/correct-input.js.map +1 -0
- package/lib/components/dropdown.js +483 -0
- package/lib/components/dropdown.js.map +1 -0
- package/lib/components/input.js +50 -0
- package/lib/components/input.js.map +1 -0
- package/lib/constructed-response.js +101 -0
- package/lib/constructed-response.js.map +1 -0
- package/lib/customizable.js +42 -0
- package/lib/customizable.js.map +1 -0
- package/lib/drag-in-the-blank.js +254 -0
- package/lib/drag-in-the-blank.js.map +1 -0
- package/lib/index.js +55 -0
- package/lib/index.js.map +1 -0
- package/lib/inline-dropdown.js +40 -0
- package/lib/inline-dropdown.js.map +1 -0
- package/lib/mask.js +198 -0
- package/lib/mask.js.map +1 -0
- package/lib/serialization.js +261 -0
- package/lib/serialization.js.map +1 -0
- package/lib/with-mask.js +97 -0
- package/lib/with-mask.js.map +1 -0
- package/package.json +20 -39
- package/src/__tests__/drag-in-the-blank.test.js +111 -0
- package/src/__tests__/index.test.js +38 -0
- package/src/__tests__/mask.test.js +381 -0
- package/src/__tests__/serialization.test.js +54 -0
- package/src/__tests__/utils.js +1 -0
- package/src/__tests__/with-mask.test.js +76 -0
- package/src/choices/__tests__/index.test.js +75 -0
- package/src/choices/choice.jsx +97 -0
- package/src/choices/index.jsx +64 -0
- package/src/componentize.js +13 -0
- package/src/components/__tests__/blank.test.js +199 -0
- package/src/components/__tests__/correct-input.test.js +90 -0
- package/src/components/__tests__/dropdown.test.js +129 -0
- package/src/components/__tests__/input.test.js +102 -0
- package/src/components/blank.jsx +386 -0
- package/src/components/correct-input.jsx +82 -0
- package/src/components/dropdown.jsx +423 -0
- package/src/components/input.jsx +48 -0
- package/src/constructed-response.jsx +87 -0
- package/src/customizable.jsx +34 -0
- package/src/drag-in-the-blank.jsx +241 -0
- package/src/index.js +16 -0
- package/src/inline-dropdown.jsx +29 -0
- package/src/mask.jsx +172 -0
- package/src/serialization.js +260 -0
- package/src/with-mask.jsx +75 -0
- package/dist/_virtual/_rolldown/runtime.js +0 -4
- package/dist/choices/choice.d.ts +0 -24
- package/dist/choices/choice.js +0 -77
- package/dist/choices/index.d.ts +0 -25
- package/dist/choices/index.js +0 -49
- package/dist/componentize.d.ts +0 -12
- package/dist/componentize.js +0 -4
- package/dist/components/blank.d.ts +0 -39
- package/dist/components/blank.js +0 -240
- package/dist/components/correct-input.d.ts +0 -11
- package/dist/components/dropdown.d.ts +0 -37
- package/dist/components/dropdown.js +0 -320
- package/dist/components/input.d.ts +0 -37
- package/dist/constructed-response.d.ts +0 -44
- package/dist/constructed-response.js +0 -55
- package/dist/customizable.d.ts +0 -43
- package/dist/customizable.js +0 -8
- package/dist/drag-in-the-blank.d.ts +0 -37
- package/dist/drag-in-the-blank.js +0 -164
- package/dist/index.d.ts +0 -15
- package/dist/index.js +0 -7
- package/dist/inline-dropdown.d.ts +0 -44
- package/dist/inline-dropdown.js +0 -24
- package/dist/mask.d.ts +0 -30
- package/dist/mask.js +0 -99
- package/dist/node_modules/.bun/clsx@2.1.1/node_modules/clsx/dist/clsx.js +0 -16
- package/dist/node_modules/.bun/to-style@1.3.3/node_modules/to-style/index.js +0 -17
- package/dist/node_modules/.bun/to-style@1.3.3/node_modules/to-style/src/cssPrefix.js +0 -9
- package/dist/node_modules/.bun/to-style@1.3.3/node_modules/to-style/src/cssUnitless.js +0 -26
- package/dist/node_modules/.bun/to-style@1.3.3/node_modules/to-style/src/hasOwn.js +0 -11
- package/dist/node_modules/.bun/to-style@1.3.3/node_modules/to-style/src/isFunction.js +0 -11
- package/dist/node_modules/.bun/to-style@1.3.3/node_modules/to-style/src/isObject.js +0 -11
- package/dist/node_modules/.bun/to-style@1.3.3/node_modules/to-style/src/prefixInfo.js +0 -24
- package/dist/node_modules/.bun/to-style@1.3.3/node_modules/to-style/src/prefixProperties.js +0 -32
- package/dist/node_modules/.bun/to-style@1.3.3/node_modules/to-style/src/prefixer.js +0 -29
- package/dist/node_modules/.bun/to-style@1.3.3/node_modules/to-style/src/stringUtils/camelize.js +0 -14
- package/dist/node_modules/.bun/to-style@1.3.3/node_modules/to-style/src/stringUtils/hyphenRe.js +0 -8
- package/dist/node_modules/.bun/to-style@1.3.3/node_modules/to-style/src/stringUtils/hyphenate.js +0 -12
- package/dist/node_modules/.bun/to-style@1.3.3/node_modules/to-style/src/stringUtils/separate.js +0 -11
- package/dist/node_modules/.bun/to-style@1.3.3/node_modules/to-style/src/stringUtils/toLowerFirst.js +0 -10
- package/dist/node_modules/.bun/to-style@1.3.3/node_modules/to-style/src/stringUtils/toUpperFirst.js +0 -10
- package/dist/node_modules/.bun/to-style@1.3.3/node_modules/to-style/src/toStyleObject.js +0 -55
- package/dist/node_modules/.bun/to-style@1.3.3/node_modules/to-style/src/toStyleString.js +0 -16
- package/dist/serialization.d.ts +0 -34
- package/dist/serialization.js +0 -132
- package/dist/with-mask.d.ts +0 -55
- package/dist/with-mask.js +0 -45
|
@@ -1,164 +0,0 @@
|
|
|
1
|
-
import { withMask as e } from "./with-mask.js";
|
|
2
|
-
import t from "./choices/choice.js";
|
|
3
|
-
import n from "./choices/index.js";
|
|
4
|
-
import r from "./components/blank.js";
|
|
5
|
-
import i from "react";
|
|
6
|
-
import a from "prop-types";
|
|
7
|
-
import { jsx as o, jsxs as s } from "react/jsx-runtime";
|
|
8
|
-
import { DragProvider as c } from "@pie-lib/drag";
|
|
9
|
-
import { DragOverlay as l, rectIntersection as u } from "@dnd-kit/core";
|
|
10
|
-
//#region src/drag-in-the-blank.tsx
|
|
11
|
-
var d = e("blank", (e) => (t, n, i) => {
|
|
12
|
-
let a = t.data?.dataset || {};
|
|
13
|
-
if (a.component === "blank") {
|
|
14
|
-
let { disabled: s, duplicates: c, correctResponse: l, feedback: u, showCorrectAnswer: d, emptyResponseAreaWidth: f, emptyResponseAreaHeight: p, instanceId: m, isDragging: h } = e, g = d ? l[a.id] : n[a.id], _ = g && e.choices.find((e) => e.id === g);
|
|
15
|
-
return /* @__PURE__ */ o(r, {
|
|
16
|
-
correct: d || u && u[a.id],
|
|
17
|
-
disabled: s,
|
|
18
|
-
duplicates: c,
|
|
19
|
-
choice: _,
|
|
20
|
-
id: a.id,
|
|
21
|
-
emptyResponseAreaWidth: f,
|
|
22
|
-
emptyResponseAreaHeight: p,
|
|
23
|
-
onChange: (e, t) => {
|
|
24
|
-
let r = { ...n };
|
|
25
|
-
t === void 0 ? delete r[e] : r[e] = t, i(r);
|
|
26
|
-
},
|
|
27
|
-
instanceId: m,
|
|
28
|
-
isDragging: h
|
|
29
|
-
}, `${t.type}-${a.id}`);
|
|
30
|
-
}
|
|
31
|
-
}), f = class extends i.Component {
|
|
32
|
-
constructor(e) {
|
|
33
|
-
super(e), this.state = {
|
|
34
|
-
activeDragItem: null,
|
|
35
|
-
dropAnimation: void 0
|
|
36
|
-
};
|
|
37
|
-
}
|
|
38
|
-
static propTypes = {
|
|
39
|
-
markup: a.string,
|
|
40
|
-
layout: a.object,
|
|
41
|
-
choicesPosition: a.string,
|
|
42
|
-
choices: a.array,
|
|
43
|
-
value: a.object,
|
|
44
|
-
onChange: a.func,
|
|
45
|
-
duplicates: a.bool,
|
|
46
|
-
disabled: a.bool,
|
|
47
|
-
feedback: a.object,
|
|
48
|
-
correctResponse: a.object,
|
|
49
|
-
showCorrectAnswer: a.bool,
|
|
50
|
-
emptyResponseAreaWidth: a.oneOfType([a.string, a.number]),
|
|
51
|
-
emptyResponseAreaHeight: a.oneOfType([a.string, a.number]),
|
|
52
|
-
instanceId: a.string
|
|
53
|
-
};
|
|
54
|
-
static defaultProps = { instanceId: "drag-in-the-blank" };
|
|
55
|
-
handleDragStart = (e) => {
|
|
56
|
-
let { active: t } = e;
|
|
57
|
-
t?.data?.current && this.setState({
|
|
58
|
-
activeDragItem: t.data.current,
|
|
59
|
-
dropAnimation: void 0
|
|
60
|
-
});
|
|
61
|
-
};
|
|
62
|
-
renderDragOverlay = () => {
|
|
63
|
-
let { activeDragItem: e } = this.state;
|
|
64
|
-
return e && e.type === "MaskBlank" ? /* @__PURE__ */ o(t, {
|
|
65
|
-
disabled: e.disabled,
|
|
66
|
-
choice: e.choice,
|
|
67
|
-
instanceId: e.instanceId
|
|
68
|
-
}) : null;
|
|
69
|
-
};
|
|
70
|
-
handleDragEnd = (e) => {
|
|
71
|
-
let { active: t, over: n } = e, { onChange: r, value: i } = this.props, a = t?.data?.current, o = n?.data?.current, s = !!t && !!n && a?.type === "MaskBlank" && o?.accepts?.includes("MaskBlank");
|
|
72
|
-
if (this.setState({
|
|
73
|
-
activeDragItem: null,
|
|
74
|
-
dropAnimation: s ? null : void 0
|
|
75
|
-
}), !s || !r) return;
|
|
76
|
-
let c = a, l = o.id;
|
|
77
|
-
if (o.toChoiceBoard === !0) {
|
|
78
|
-
if (!c.fromChoice && c.id) {
|
|
79
|
-
let e = { ...i };
|
|
80
|
-
delete e[c.id], r(e);
|
|
81
|
-
}
|
|
82
|
-
} else if (c.fromChoice === !0) {
|
|
83
|
-
if (l && l !== "drag-in-the-blank-droppable") {
|
|
84
|
-
let e = { ...i };
|
|
85
|
-
e[l] = c.choice.id, r(e);
|
|
86
|
-
}
|
|
87
|
-
} else if (c.id && c.id !== l) {
|
|
88
|
-
let e = { ...i };
|
|
89
|
-
e[l] = c.choice.id, delete e[c.id], r(e);
|
|
90
|
-
}
|
|
91
|
-
};
|
|
92
|
-
getPositionDirection = (e) => {
|
|
93
|
-
let t, n, r;
|
|
94
|
-
switch (e) {
|
|
95
|
-
case "left":
|
|
96
|
-
t = "row", r = "center";
|
|
97
|
-
break;
|
|
98
|
-
case "right":
|
|
99
|
-
t = "row-reverse", n = "flex-end", r = "center";
|
|
100
|
-
break;
|
|
101
|
-
case "below":
|
|
102
|
-
t = "column-reverse";
|
|
103
|
-
break;
|
|
104
|
-
default:
|
|
105
|
-
t = "column";
|
|
106
|
-
break;
|
|
107
|
-
}
|
|
108
|
-
return {
|
|
109
|
-
flexDirection: t,
|
|
110
|
-
justifyContent: n,
|
|
111
|
-
alignItems: r
|
|
112
|
-
};
|
|
113
|
-
};
|
|
114
|
-
render() {
|
|
115
|
-
let { markup: e, duplicates: t, value: r, onChange: i, choicesPosition: a, choices: f, correctResponse: p, disabled: m, feedback: h, showCorrectAnswer: g, emptyResponseAreaWidth: _, emptyResponseAreaHeight: v, layout: y, instanceId: b } = this.props, x = a || "below", S = {
|
|
116
|
-
display: "flex",
|
|
117
|
-
minWidth: "100px",
|
|
118
|
-
...this.getPositionDirection(x)
|
|
119
|
-
};
|
|
120
|
-
return /* @__PURE__ */ o(c, {
|
|
121
|
-
onDragStart: this.handleDragStart,
|
|
122
|
-
onDragEnd: this.handleDragEnd,
|
|
123
|
-
collisionDetection: u,
|
|
124
|
-
children: /* @__PURE__ */ s("div", {
|
|
125
|
-
ref: (e) => this.rootRef = e,
|
|
126
|
-
style: S,
|
|
127
|
-
children: [
|
|
128
|
-
/* @__PURE__ */ o(n, {
|
|
129
|
-
choicePosition: x,
|
|
130
|
-
choices: f,
|
|
131
|
-
value: r,
|
|
132
|
-
duplicates: t,
|
|
133
|
-
disabled: m,
|
|
134
|
-
instanceId: b
|
|
135
|
-
}),
|
|
136
|
-
/* @__PURE__ */ o(d, {
|
|
137
|
-
elementType: "drag-in-the-blank",
|
|
138
|
-
markup: e,
|
|
139
|
-
layout: y,
|
|
140
|
-
value: r,
|
|
141
|
-
choices: f,
|
|
142
|
-
onChange: i,
|
|
143
|
-
disabled: m,
|
|
144
|
-
duplicates: t,
|
|
145
|
-
feedback: h,
|
|
146
|
-
correctResponse: p,
|
|
147
|
-
showCorrectAnswer: g,
|
|
148
|
-
emptyResponseAreaWidth: _,
|
|
149
|
-
emptyResponseAreaHeight: v,
|
|
150
|
-
instanceId: b,
|
|
151
|
-
isDragging: !!this.state.activeDragItem
|
|
152
|
-
}),
|
|
153
|
-
/* @__PURE__ */ o(l, {
|
|
154
|
-
style: { pointerEvents: "none" },
|
|
155
|
-
dropAnimation: this.state.dropAnimation,
|
|
156
|
-
children: this.renderDragOverlay()
|
|
157
|
-
})
|
|
158
|
-
]
|
|
159
|
-
})
|
|
160
|
-
});
|
|
161
|
-
}
|
|
162
|
-
};
|
|
163
|
-
//#endregion
|
|
164
|
-
export { f as default };
|
package/dist/index.d.ts
DELETED
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @synced-from pie-lib/packages/mask-markup/src/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 { buildLayoutFromMarkup, withMask } from './with-mask.js';
|
|
10
|
-
import DragInTheBlank from './drag-in-the-blank.js';
|
|
11
|
-
import ConstructedResponse from './constructed-response.js';
|
|
12
|
-
import Customizable from './customizable.js';
|
|
13
|
-
import InlineDropdown from './inline-dropdown.js';
|
|
14
|
-
import componentize from './componentize.js';
|
|
15
|
-
export { withMask, buildLayoutFromMarkup, DragInTheBlank, ConstructedResponse, InlineDropdown, componentize, Customizable, };
|
package/dist/index.js
DELETED
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import e from "./componentize.js";
|
|
2
|
-
import { buildLayoutFromMarkup as t, withMask as n } from "./with-mask.js";
|
|
3
|
-
import r from "./drag-in-the-blank.js";
|
|
4
|
-
import i from "./constructed-response.js";
|
|
5
|
-
import a from "./customizable.js";
|
|
6
|
-
import o from "./inline-dropdown.js";
|
|
7
|
-
export { i as ConstructedResponse, a as Customizable, r as DragInTheBlank, o as InlineDropdown, t as buildLayoutFromMarkup, e as componentize, n as withMask };
|
|
@@ -1,44 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @synced-from pie-lib/packages/mask-markup/src/inline-dropdown.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
|
-
declare const _default: {
|
|
11
|
-
new (props: any): {
|
|
12
|
-
componentDidUpdate(prevProps: any): void;
|
|
13
|
-
render(): React.JSX.Element;
|
|
14
|
-
context: unknown;
|
|
15
|
-
setState<K extends never>(state: {} | ((prevState: Readonly<{}>, props: Readonly<{}>) => {} | Pick<{}, K> | null) | Pick<{}, K> | null, callback?: (() => void) | undefined): void;
|
|
16
|
-
forceUpdate(callback?: (() => void) | undefined): void;
|
|
17
|
-
readonly props: Readonly<{}>;
|
|
18
|
-
state: Readonly<{}>;
|
|
19
|
-
refs: {
|
|
20
|
-
[key: string]: React.ReactInstance;
|
|
21
|
-
};
|
|
22
|
-
componentDidMount?(): void;
|
|
23
|
-
shouldComponentUpdate?(nextProps: Readonly<{}>, nextState: Readonly<{}>, nextContext: any): boolean;
|
|
24
|
-
componentWillUnmount?(): void;
|
|
25
|
-
componentDidCatch?(error: Error, errorInfo: React.ErrorInfo): void;
|
|
26
|
-
getSnapshotBeforeUpdate?(prevProps: Readonly<{}>, prevState: Readonly<{}>): any;
|
|
27
|
-
componentWillMount?(): void;
|
|
28
|
-
UNSAFE_componentWillMount?(): void;
|
|
29
|
-
componentWillReceiveProps?(nextProps: Readonly<{}>, nextContext: any): void;
|
|
30
|
-
UNSAFE_componentWillReceiveProps?(nextProps: Readonly<{}>, nextContext: any): void;
|
|
31
|
-
componentWillUpdate?(nextProps: Readonly<{}>, nextState: Readonly<{}>, nextContext: any): void;
|
|
32
|
-
UNSAFE_componentWillUpdate?(nextProps: Readonly<{}>, nextState: Readonly<{}>, nextContext: any): void;
|
|
33
|
-
};
|
|
34
|
-
propTypes: {
|
|
35
|
-
markup: import("prop-types").Requireable<string>;
|
|
36
|
-
layout: import("prop-types").Requireable<object>;
|
|
37
|
-
value: import("prop-types").Requireable<object>;
|
|
38
|
-
onChange: import("prop-types").Requireable<(...args: any[]) => any>;
|
|
39
|
-
customMarkMarkupComponent: import("prop-types").Requireable<(...args: any[]) => any>;
|
|
40
|
-
elementType: import("prop-types").Requireable<string>;
|
|
41
|
-
};
|
|
42
|
-
contextType?: React.Context<any> | undefined;
|
|
43
|
-
};
|
|
44
|
-
export default _default;
|
package/dist/inline-dropdown.js
DELETED
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
import { withMask as e } from "./with-mask.js";
|
|
2
|
-
import t from "./components/dropdown.js";
|
|
3
|
-
import "react";
|
|
4
|
-
import { jsx as n } from "react/jsx-runtime";
|
|
5
|
-
//#region src/inline-dropdown.tsx
|
|
6
|
-
var r = e("dropdown", (e) => (r, i, a) => {
|
|
7
|
-
let o = r.data && r.data.dataset || {};
|
|
8
|
-
if (o.component === "dropdown") {
|
|
9
|
-
let { choices: s, disabled: c, feedback: l, showCorrectAnswer: u } = e, d = s && s[o.id] && s[o.id].find((e) => e.correct), f = u ? d && d.value : i[o.id];
|
|
10
|
-
return /* @__PURE__ */ n(t, {
|
|
11
|
-
correct: l && l[o.id] && l[o.id] === "correct",
|
|
12
|
-
disabled: c || u,
|
|
13
|
-
value: f,
|
|
14
|
-
correctValue: u ? d && d.label : void 0,
|
|
15
|
-
id: o.id,
|
|
16
|
-
onChange: a,
|
|
17
|
-
choices: s[o.id],
|
|
18
|
-
showCorrectAnswer: u,
|
|
19
|
-
singleQuery: Object.keys(s).length == 1
|
|
20
|
-
}, `${r.type}-dropdown-${o.id}`);
|
|
21
|
-
}
|
|
22
|
-
});
|
|
23
|
-
//#endregion
|
|
24
|
-
export { r as default };
|
package/dist/mask.d.ts
DELETED
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @synced-from pie-lib/packages/mask-markup/src/mask.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 const renderChildren: (layout: any, value: any, onChange: any, rootRenderChildren: any, parentNode: any, elementType: any) => any[] | null;
|
|
12
|
-
/**
|
|
13
|
-
* Renders a layout that uses the slate.js Value model structure.
|
|
14
|
-
*/
|
|
15
|
-
export default class Mask extends React.Component {
|
|
16
|
-
constructor(props: any);
|
|
17
|
-
static propTypes: {
|
|
18
|
-
renderChildren: PropTypes.Requireable<(...args: any[]) => any>;
|
|
19
|
-
layout: PropTypes.Requireable<object>;
|
|
20
|
-
value: PropTypes.Requireable<object>;
|
|
21
|
-
onChange: PropTypes.Requireable<(...args: any[]) => any>;
|
|
22
|
-
elementType: PropTypes.Requireable<string>;
|
|
23
|
-
containerRef: PropTypes.Requireable<NonNullable<((...args: any[]) => any) | PropTypes.InferProps<{
|
|
24
|
-
current: PropTypes.Requireable<Element>;
|
|
25
|
-
}> | null | undefined>>;
|
|
26
|
-
};
|
|
27
|
-
componentDidMount(): void;
|
|
28
|
-
handleChange: any;
|
|
29
|
-
render(): React.JSX.Element;
|
|
30
|
-
}
|
package/dist/mask.js
DELETED
|
@@ -1,99 +0,0 @@
|
|
|
1
|
-
import { MARK_TAGS as e } from "./serialization.js";
|
|
2
|
-
import t from "react";
|
|
3
|
-
import n from "prop-types";
|
|
4
|
-
import { get as r } from "@pie-element/shared-lodash";
|
|
5
|
-
import { styled as i } from "@mui/material/styles";
|
|
6
|
-
import { renderMath as a } from "@pie-element/shared-math-rendering-mathjax";
|
|
7
|
-
import { jsx as o } from "react/jsx-runtime";
|
|
8
|
-
//#region src/mask.tsx
|
|
9
|
-
var s = i("div")(({ theme: e }) => ({
|
|
10
|
-
paddingTop: e.spacing(.5),
|
|
11
|
-
paddingBottom: e.spacing(.5)
|
|
12
|
-
})), c = i("span")(() => ({
|
|
13
|
-
display: "inline-block",
|
|
14
|
-
width: ".75em"
|
|
15
|
-
})), l = ["tbody", "tr"], u = (e, t) => {
|
|
16
|
-
let n = t.trim() === "", r = e && e.type;
|
|
17
|
-
if (!(n && l.includes(r))) return t;
|
|
18
|
-
}, d = (e) => {
|
|
19
|
-
let t = e.leaves.find((e) => r(e, "marks", []).length);
|
|
20
|
-
return t ? t.marks[0] : null;
|
|
21
|
-
}, f = (t, n, r, i, a, l) => {
|
|
22
|
-
if (!n) return null;
|
|
23
|
-
let p = [];
|
|
24
|
-
return (t.nodes || []).forEach((t, m) => {
|
|
25
|
-
let h = t.type ? `${t.type}-${m}` : `${m}`;
|
|
26
|
-
if (t.isMath) return p.push(/* @__PURE__ */ o("span", { dangerouslySetInnerHTML: { __html: `<math displaystyle="true">${t.nodes[0].innerHTML}</math>` } })), p;
|
|
27
|
-
if (i) {
|
|
28
|
-
let e = i(t, n, r);
|
|
29
|
-
if (e) {
|
|
30
|
-
let n = t.data?.dataset?.component === "blank";
|
|
31
|
-
n && p.push(/* @__PURE__ */ o(c, {}, `spacer-${m}`)), p.push(e), n && p.push(/* @__PURE__ */ o(c, {}, `spacer-${m}`));
|
|
32
|
-
return;
|
|
33
|
-
}
|
|
34
|
-
}
|
|
35
|
-
if (t.object === "text") {
|
|
36
|
-
let n = t.leaves.reduce((e, t) => {
|
|
37
|
-
let n = t.text, r = u(a, n);
|
|
38
|
-
return r ? e + r : e;
|
|
39
|
-
}, ""), r = d(t);
|
|
40
|
-
if (r) {
|
|
41
|
-
let t;
|
|
42
|
-
for (t in e) if (e[t] === r.type) {
|
|
43
|
-
let e = t;
|
|
44
|
-
p.push(/* @__PURE__ */ o(e, { children: n }, h));
|
|
45
|
-
break;
|
|
46
|
-
}
|
|
47
|
-
} else n.length > 0 && p.push(n);
|
|
48
|
-
} else {
|
|
49
|
-
let e = f(t, n, r, i, t, l);
|
|
50
|
-
if (t.type === "p" || t.type === "paragraph") p.push(/* @__PURE__ */ o(s, { children: e }, h));
|
|
51
|
-
else {
|
|
52
|
-
let n = t.type;
|
|
53
|
-
t.nodes && t.nodes.length > 0 ? p.push(/* @__PURE__ */ o(n, {
|
|
54
|
-
...t.data.attributes,
|
|
55
|
-
children: e
|
|
56
|
-
}, h)) : p.push(/* @__PURE__ */ o(n, { ...t.data.attributes }, h));
|
|
57
|
-
}
|
|
58
|
-
}
|
|
59
|
-
}), p;
|
|
60
|
-
}, p = i("div")(() => ({
|
|
61
|
-
display: "initial",
|
|
62
|
-
"&:not(.MathJax) table": { borderCollapse: "collapse" },
|
|
63
|
-
"&:not(.MathJax) table td, &:not(.MathJax) table th": {
|
|
64
|
-
padding: "8px 12px",
|
|
65
|
-
textAlign: "left"
|
|
66
|
-
}
|
|
67
|
-
})), m = class extends t.Component {
|
|
68
|
-
constructor(e) {
|
|
69
|
-
super(e), this.internalContainerRef = t.createRef();
|
|
70
|
-
}
|
|
71
|
-
static propTypes = {
|
|
72
|
-
renderChildren: n.func,
|
|
73
|
-
layout: n.object,
|
|
74
|
-
value: n.object,
|
|
75
|
-
onChange: n.func,
|
|
76
|
-
elementType: n.string,
|
|
77
|
-
containerRef: n.oneOfType([n.func, n.shape({ current: n.instanceOf(Element) })])
|
|
78
|
-
};
|
|
79
|
-
componentDidMount() {
|
|
80
|
-
let e = this.props.containerRef || this.internalContainerRef;
|
|
81
|
-
e.current && typeof a == "function" && a(e.current);
|
|
82
|
-
}
|
|
83
|
-
handleChange = (e, t) => {
|
|
84
|
-
let n = {
|
|
85
|
-
...this.props.value,
|
|
86
|
-
[e]: t
|
|
87
|
-
};
|
|
88
|
-
this.props.onChange(n);
|
|
89
|
-
};
|
|
90
|
-
render() {
|
|
91
|
-
let { value: e, layout: t, elementType: n, containerRef: r } = this.props, i = f(t, e, this.handleChange, this.props.renderChildren, null, n);
|
|
92
|
-
return /* @__PURE__ */ o(p, {
|
|
93
|
-
ref: r || this.internalContainerRef,
|
|
94
|
-
children: i
|
|
95
|
-
});
|
|
96
|
-
}
|
|
97
|
-
};
|
|
98
|
-
//#endregion
|
|
99
|
-
export { m as default };
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
//#region ../../../node_modules/.bun/clsx@2.1.1/node_modules/clsx/dist/clsx.mjs
|
|
2
|
-
function e(t) {
|
|
3
|
-
var n, r, i = "";
|
|
4
|
-
if (typeof t == "string" || typeof t == "number") i += t;
|
|
5
|
-
else if (typeof t == "object") if (Array.isArray(t)) {
|
|
6
|
-
var a = t.length;
|
|
7
|
-
for (n = 0; n < a; n++) t[n] && (r = e(t[n])) && (i && (i += " "), i += r);
|
|
8
|
-
} else for (r in t) t[r] && (i && (i += " "), i += r);
|
|
9
|
-
return i;
|
|
10
|
-
}
|
|
11
|
-
function t() {
|
|
12
|
-
for (var t, n, r = 0, i = "", a = arguments.length; r < a; r++) (t = arguments[r]) && (n = e(t)) && (i && (i += " "), i += n);
|
|
13
|
-
return i;
|
|
14
|
-
}
|
|
15
|
-
//#endregion
|
|
16
|
-
export { t as default };
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
import { __commonJSMin as e } from "../../../../../_virtual/_rolldown/runtime.js";
|
|
2
|
-
import { require_prefixProperties as t } from "./src/prefixProperties.js";
|
|
3
|
-
import { require_cssUnitless as n } from "./src/cssUnitless.js";
|
|
4
|
-
import { require_toStyleObject as r } from "./src/toStyleObject.js";
|
|
5
|
-
import { require_toStyleString as i } from "./src/toStyleString.js";
|
|
6
|
-
//#region ../../../node_modules/.bun/to-style@1.3.3/node_modules/to-style/index.js
|
|
7
|
-
var a = /* @__PURE__ */ e(((e, a) => {
|
|
8
|
-
a.exports = {
|
|
9
|
-
prefixProperties: t(),
|
|
10
|
-
cssUnitless: n(),
|
|
11
|
-
object: r(),
|
|
12
|
-
string: i()
|
|
13
|
-
};
|
|
14
|
-
}));
|
|
15
|
-
//#endregion
|
|
16
|
-
export default a();
|
|
17
|
-
export { a as require_to_style };
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import { __commonJSMin as e } from "../../../../../../_virtual/_rolldown/runtime.js";
|
|
2
|
-
import { require_prefixer as t } from "./prefixer.js";
|
|
3
|
-
//#region ../../../node_modules/.bun/to-style@1.3.3/node_modules/to-style/src/cssPrefix.js
|
|
4
|
-
var n = /* @__PURE__ */ e(((e, n) => {
|
|
5
|
-
n.exports = t()();
|
|
6
|
-
}));
|
|
7
|
-
//#endregion
|
|
8
|
-
export default n();
|
|
9
|
-
export { n as require_cssPrefix };
|
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
"use exports";
|
|
2
|
-
import { __commonJSMin as e } from "../../../../../../_virtual/_rolldown/runtime.js";
|
|
3
|
-
//#region ../../../node_modules/.bun/to-style@1.3.3/node_modules/to-style/src/cssUnitless.js
|
|
4
|
-
var t = /* @__PURE__ */ e(((e, t) => {
|
|
5
|
-
t.exports = {
|
|
6
|
-
animation: 1,
|
|
7
|
-
"column-count": 1,
|
|
8
|
-
columns: 1,
|
|
9
|
-
"font-weight": 1,
|
|
10
|
-
opacity: 1,
|
|
11
|
-
"order ": 1,
|
|
12
|
-
"z-index": 1,
|
|
13
|
-
zoom: 1,
|
|
14
|
-
flex: 1,
|
|
15
|
-
"box-flex": 1,
|
|
16
|
-
transform: 1,
|
|
17
|
-
perspective: 1,
|
|
18
|
-
"box-pack": 1,
|
|
19
|
-
"box-align": 1,
|
|
20
|
-
colspan: 1,
|
|
21
|
-
rowspan: 1
|
|
22
|
-
};
|
|
23
|
-
}));
|
|
24
|
-
//#endregion
|
|
25
|
-
export default t();
|
|
26
|
-
export { t as require_cssUnitless };
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import { __commonJSMin as e } from "../../../../../../_virtual/_rolldown/runtime.js";
|
|
2
|
-
//#region ../../../node_modules/.bun/to-style@1.3.3/node_modules/to-style/src/hasOwn.js
|
|
3
|
-
var t = /* @__PURE__ */ e(((e, t) => {
|
|
4
|
-
var n = Object.prototype.hasOwnProperty;
|
|
5
|
-
t.exports = function(e, t) {
|
|
6
|
-
return n.call(e, t);
|
|
7
|
-
};
|
|
8
|
-
}));
|
|
9
|
-
//#endregion
|
|
10
|
-
export default t();
|
|
11
|
-
export { t as require_hasOwn };
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import { __commonJSMin as e } from "../../../../../../_virtual/_rolldown/runtime.js";
|
|
2
|
-
//#region ../../../node_modules/.bun/to-style@1.3.3/node_modules/to-style/src/isFunction.js
|
|
3
|
-
var t = /* @__PURE__ */ e(((e, t) => {
|
|
4
|
-
var n = Object.prototype.toString;
|
|
5
|
-
t.exports = function(e) {
|
|
6
|
-
return n.apply(e) === "[object Function]";
|
|
7
|
-
};
|
|
8
|
-
}));
|
|
9
|
-
//#endregion
|
|
10
|
-
export default t();
|
|
11
|
-
export { t as require_isFunction };
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import { __commonJSMin as e } from "../../../../../../_virtual/_rolldown/runtime.js";
|
|
2
|
-
//#region ../../../node_modules/.bun/to-style@1.3.3/node_modules/to-style/src/isObject.js
|
|
3
|
-
var t = /* @__PURE__ */ e(((e, t) => {
|
|
4
|
-
var n = Object.prototype.toString;
|
|
5
|
-
t.exports = function(e) {
|
|
6
|
-
return !!e && n.call(e) === "[object Object]";
|
|
7
|
-
};
|
|
8
|
-
}));
|
|
9
|
-
//#endregion
|
|
10
|
-
export default t();
|
|
11
|
-
export { t as require_isObject };
|
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
import { __commonJSMin as e } from "../../../../../../_virtual/_rolldown/runtime.js";
|
|
2
|
-
import { require_toUpperFirst as t } from "./stringUtils/toUpperFirst.js";
|
|
3
|
-
//#region ../../../node_modules/.bun/to-style@1.3.3/node_modules/to-style/src/prefixInfo.js
|
|
4
|
-
var n = /* @__PURE__ */ e(((e, n) => {
|
|
5
|
-
var r = t(), i = /^(Moz|Webkit|Khtml|O|ms|Icab)(?=[A-Z])/, a = typeof document > "u" ? {} : document.documentElement.style;
|
|
6
|
-
n.exports = (function() {
|
|
7
|
-
var e = (function() {
|
|
8
|
-
for (var e in a) if (i.test(e)) return e.match(i)[0];
|
|
9
|
-
return "WebkitOpacity" in a ? "Webkit" : "KhtmlOpacity" in a ? "Khtml" : "";
|
|
10
|
-
})();
|
|
11
|
-
return {
|
|
12
|
-
style: e,
|
|
13
|
-
css: "-" + e.toLowerCase() + "-",
|
|
14
|
-
dom: {
|
|
15
|
-
Webkit: "WebKit",
|
|
16
|
-
ms: "MS",
|
|
17
|
-
o: "WebKit"
|
|
18
|
-
}[e] || r(e)
|
|
19
|
-
};
|
|
20
|
-
})();
|
|
21
|
-
}));
|
|
22
|
-
//#endregion
|
|
23
|
-
export default n();
|
|
24
|
-
export { n as require_prefixInfo };
|
|
@@ -1,32 +0,0 @@
|
|
|
1
|
-
import { __commonJSMin as e } from "../../../../../../_virtual/_rolldown/runtime.js";
|
|
2
|
-
//#region ../../../node_modules/.bun/to-style@1.3.3/node_modules/to-style/src/prefixProperties.js
|
|
3
|
-
var t = /* @__PURE__ */ e(((e, t) => {
|
|
4
|
-
t.exports = {
|
|
5
|
-
"border-radius": 1,
|
|
6
|
-
"border-top-left-radius": 1,
|
|
7
|
-
"border-top-right-radius": 1,
|
|
8
|
-
"border-bottom-left-radius": 1,
|
|
9
|
-
"border-bottom-right-radius": 1,
|
|
10
|
-
"box-shadow": 1,
|
|
11
|
-
order: 1,
|
|
12
|
-
flex: function(e, t) {
|
|
13
|
-
return [t + "box-flex"];
|
|
14
|
-
},
|
|
15
|
-
"box-flex": 1,
|
|
16
|
-
"box-align": 1,
|
|
17
|
-
animation: 1,
|
|
18
|
-
"animation-duration": 1,
|
|
19
|
-
"animation-name": 1,
|
|
20
|
-
transition: 1,
|
|
21
|
-
"transition-duration": 1,
|
|
22
|
-
transform: 1,
|
|
23
|
-
"transform-style": 1,
|
|
24
|
-
"transform-origin": 1,
|
|
25
|
-
"backface-visibility": 1,
|
|
26
|
-
perspective: 1,
|
|
27
|
-
"box-pack": 1
|
|
28
|
-
};
|
|
29
|
-
}));
|
|
30
|
-
//#endregion
|
|
31
|
-
export default t();
|
|
32
|
-
export { t as require_prefixProperties };
|
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
import { __commonJSMin as e } from "../../../../../../_virtual/_rolldown/runtime.js";
|
|
2
|
-
import { require_prefixProperties as t } from "./prefixProperties.js";
|
|
3
|
-
import { require_toUpperFirst as n } from "./stringUtils/toUpperFirst.js";
|
|
4
|
-
import { require_prefixInfo as r } from "./prefixInfo.js";
|
|
5
|
-
import { require_camelize as i } from "./stringUtils/camelize.js";
|
|
6
|
-
import { require_hyphenate as a } from "./stringUtils/hyphenate.js";
|
|
7
|
-
import { require_toLowerFirst as o } from "./stringUtils/toLowerFirst.js";
|
|
8
|
-
//#region ../../../node_modules/.bun/to-style@1.3.3/node_modules/to-style/src/prefixer.js
|
|
9
|
-
var s = /* @__PURE__ */ e(((e, s) => {
|
|
10
|
-
var c = i(), l = a(), u = o(), d = n(), f = r(), p = t(), m = typeof document > "u" ? {} : document.documentElement.style;
|
|
11
|
-
s.exports = function(e) {
|
|
12
|
-
return function(t, n) {
|
|
13
|
-
n ||= {};
|
|
14
|
-
var r = u(c(t)), i = l(t), a = e ? r : i, o = f.style ? e ? f.style : f.css : "";
|
|
15
|
-
if (r in m) return n.asString ? a : [a];
|
|
16
|
-
var s = a, h = p[i], g = [];
|
|
17
|
-
if (e && (s = d(a)), typeof h == "function") {
|
|
18
|
-
var _ = h(a, o) || [];
|
|
19
|
-
_ && !Array.isArray(_) && (_ = [_]), _.length && (_ = _.map(function(t) {
|
|
20
|
-
return e ? u(c(t)) : l(t);
|
|
21
|
-
})), g = g.concat(_);
|
|
22
|
-
}
|
|
23
|
-
return o && g.push(o + s), g.push(a), n.asString || g.length == 1 ? g[0] : g;
|
|
24
|
-
};
|
|
25
|
-
};
|
|
26
|
-
}));
|
|
27
|
-
//#endregion
|
|
28
|
-
export default s();
|
|
29
|
-
export { s as require_prefixer };
|
package/dist/node_modules/.bun/to-style@1.3.3/node_modules/to-style/src/stringUtils/camelize.js
DELETED
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
import { __commonJSMin as e } from "../../../../../../../_virtual/_rolldown/runtime.js";
|
|
2
|
-
import { require_hyphenRe as t } from "./hyphenRe.js";
|
|
3
|
-
//#region ../../../node_modules/.bun/to-style@1.3.3/node_modules/to-style/src/stringUtils/camelize.js
|
|
4
|
-
var n = /* @__PURE__ */ e(((e, n) => {
|
|
5
|
-
var r = function(e, t) {
|
|
6
|
-
return t ? t.toUpperCase() : "";
|
|
7
|
-
}, i = t();
|
|
8
|
-
n.exports = function(e) {
|
|
9
|
-
return e ? e.replace(i, r) : "";
|
|
10
|
-
};
|
|
11
|
-
}));
|
|
12
|
-
//#endregion
|
|
13
|
-
export default n();
|
|
14
|
-
export { n as require_camelize };
|
package/dist/node_modules/.bun/to-style@1.3.3/node_modules/to-style/src/stringUtils/hyphenRe.js
DELETED
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import { __commonJSMin as e } from "../../../../../../../_virtual/_rolldown/runtime.js";
|
|
2
|
-
//#region ../../../node_modules/.bun/to-style@1.3.3/node_modules/to-style/src/stringUtils/hyphenRe.js
|
|
3
|
-
var t = /* @__PURE__ */ e(((e, t) => {
|
|
4
|
-
t.exports = /[-\s]+(.)?/g;
|
|
5
|
-
}));
|
|
6
|
-
//#endregion
|
|
7
|
-
export default t();
|
|
8
|
-
export { t as require_hyphenRe };
|
package/dist/node_modules/.bun/to-style@1.3.3/node_modules/to-style/src/stringUtils/hyphenate.js
DELETED
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import { __commonJSMin as e } from "../../../../../../../_virtual/_rolldown/runtime.js";
|
|
2
|
-
import { require_separate as t } from "./separate.js";
|
|
3
|
-
//#region ../../../node_modules/.bun/to-style@1.3.3/node_modules/to-style/src/stringUtils/hyphenate.js
|
|
4
|
-
var n = /* @__PURE__ */ e(((e, n) => {
|
|
5
|
-
var r = t();
|
|
6
|
-
n.exports = function(e) {
|
|
7
|
-
return r(e).toLowerCase();
|
|
8
|
-
};
|
|
9
|
-
}));
|
|
10
|
-
//#endregion
|
|
11
|
-
export default n();
|
|
12
|
-
export { n as require_hyphenate };
|
package/dist/node_modules/.bun/to-style@1.3.3/node_modules/to-style/src/stringUtils/separate.js
DELETED
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import { __commonJSMin as e } from "../../../../../../../_virtual/_rolldown/runtime.js";
|
|
2
|
-
//#region ../../../node_modules/.bun/to-style@1.3.3/node_modules/to-style/src/stringUtils/separate.js
|
|
3
|
-
var t = /* @__PURE__ */ e(((e, t) => {
|
|
4
|
-
var n = /::/g, r = /([A-Z]+)([A-Z][a-z])/g, i = /([a-z\d])([A-Z])/g, a = /_/g;
|
|
5
|
-
t.exports = function(e, t) {
|
|
6
|
-
return e ? e.replace(n, "/").replace(r, "$1_$2").replace(i, "$1_$2").replace(a, t || "-") : "";
|
|
7
|
-
};
|
|
8
|
-
}));
|
|
9
|
-
//#endregion
|
|
10
|
-
export default t();
|
|
11
|
-
export { t as require_separate };
|
package/dist/node_modules/.bun/to-style@1.3.3/node_modules/to-style/src/stringUtils/toLowerFirst.js
DELETED
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import { __commonJSMin as e } from "../../../../../../../_virtual/_rolldown/runtime.js";
|
|
2
|
-
//#region ../../../node_modules/.bun/to-style@1.3.3/node_modules/to-style/src/stringUtils/toLowerFirst.js
|
|
3
|
-
var t = /* @__PURE__ */ e(((e, t) => {
|
|
4
|
-
t.exports = function(e) {
|
|
5
|
-
return e.length ? e.charAt(0).toLowerCase() + e.substring(1) : e;
|
|
6
|
-
};
|
|
7
|
-
}));
|
|
8
|
-
//#endregion
|
|
9
|
-
export default t();
|
|
10
|
-
export { t as require_toLowerFirst };
|
package/dist/node_modules/.bun/to-style@1.3.3/node_modules/to-style/src/stringUtils/toUpperFirst.js
DELETED
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import { __commonJSMin as e } from "../../../../../../../_virtual/_rolldown/runtime.js";
|
|
2
|
-
//#region ../../../node_modules/.bun/to-style@1.3.3/node_modules/to-style/src/stringUtils/toUpperFirst.js
|
|
3
|
-
var t = /* @__PURE__ */ e(((e, t) => {
|
|
4
|
-
t.exports = function(e) {
|
|
5
|
-
return e.length ? e.charAt(0).toUpperCase() + e.substring(1) : e;
|
|
6
|
-
};
|
|
7
|
-
}));
|
|
8
|
-
//#endregion
|
|
9
|
-
export default t();
|
|
10
|
-
export { t as require_toUpperFirst };
|