@pie-element/inline-dropdown 10.1.2-next.2 → 10.1.2-next.20
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/author.js +2 -0
- package/dist/author/index.d.ts +1 -0
- package/dist/author/index.js +5 -2
- package/dist/author/inline-dropdown-toolbar.d.ts +1 -0
- package/dist/author/inline-dropdown-toolbar.js +18 -20
- package/dist/author/main.js +1 -1
- package/dist/author/markupUtils.js +1 -1
- package/dist/browser/{Close-ihSzAQyP.js → Close-DJv6MCxq.js} +2284 -2310
- package/dist/browser/Close-DJv6MCxq.js.map +1 -0
- package/dist/browser/assets/Symbola-4c507403.woff2 +0 -0
- package/dist/browser/author/index.js +15785 -20430
- package/dist/browser/author/index.js.map +1 -1
- package/dist/browser/controller/index.js +3 -3
- package/dist/browser/controller/index.js.map +1 -1
- package/dist/browser/delivery/index.js +298 -208
- package/dist/browser/delivery/index.js.map +1 -1
- package/dist/browser/{dist-CAsDMEWi.js → dist-BJd6t-uW.js} +6 -2
- package/dist/browser/dist-BJd6t-uW.js.map +1 -0
- package/dist/browser/editor-runtime/Close-CYmIbifw.js +9005 -0
- package/dist/browser/editor-runtime/Close-CYmIbifw.js.map +1 -0
- package/dist/browser/editor-runtime/assets/Symbola-4c507403.woff2 +0 -0
- package/dist/browser/editor-runtime/author/index.js +19547 -0
- package/dist/browser/editor-runtime/author/index.js.map +1 -0
- package/dist/browser/editor-runtime/controller/index.js +196 -0
- package/dist/browser/editor-runtime/controller/index.js.map +1 -0
- package/dist/browser/editor-runtime/delivery/index.js +2804 -0
- package/dist/browser/editor-runtime/delivery/index.js.map +1 -0
- package/dist/browser/editor-runtime/dist-BJd6t-uW.js +137 -0
- package/dist/browser/editor-runtime/dist-BJd6t-uW.js.map +1 -0
- package/dist/browser/editor-runtime/rolldown-runtime-CHQKHQ89.js +32 -0
- package/dist/browser/rolldown-runtime-CWhphoD1.js +32 -0
- package/dist/delivery/index.js +2 -2
- package/dist/delivery/inline-dropdown.js +1 -1
- package/dist/index.iife.js +34 -34
- package/package.json +36 -23
- package/dist/browser/Close-ihSzAQyP.js.map +0 -1
- package/dist/browser/dist-CAsDMEWi.js.map +0 -1
- package/dist/browser/inline-dropdown.css +0 -2
package/author.js
ADDED
package/dist/author/index.d.ts
CHANGED
package/dist/author/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import e from "./main.js";
|
|
1
|
+
import { Main as e } from "./main.js";
|
|
2
2
|
import t from "./defaults.js";
|
|
3
3
|
import { createSlateMarkup as n, processMarkup as r } from "./markupUtils.js";
|
|
4
4
|
import i from "react";
|
|
@@ -75,8 +75,11 @@ var p = f("multiple-choice:configure"), m = class f extends HTMLElement {
|
|
|
75
75
|
});
|
|
76
76
|
this._root ||= a(this), this._root.render(t);
|
|
77
77
|
}
|
|
78
|
+
connectedCallback() {
|
|
79
|
+
this._render();
|
|
80
|
+
}
|
|
78
81
|
disconnectedCallback() {
|
|
79
|
-
this._root
|
|
82
|
+
this._root &&= (this._root.unmount(), null);
|
|
80
83
|
}
|
|
81
84
|
};
|
|
82
85
|
//#endregion
|
|
@@ -14,12 +14,12 @@ import m from "@mui/icons-material/Close";
|
|
|
14
14
|
import h from "@mui/icons-material/Edit";
|
|
15
15
|
import g from "@mui/material/IconButton";
|
|
16
16
|
//#region src/author/inline-dropdown-toolbar.tsx
|
|
17
|
-
var _ = u("div")((
|
|
17
|
+
var _ = u("div")(() => ({
|
|
18
18
|
display: "flex",
|
|
19
19
|
alignItems: "flex-start",
|
|
20
20
|
position: "relative",
|
|
21
|
-
background:
|
|
22
|
-
borderBottom: `1px solid ${
|
|
21
|
+
background: s.white(),
|
|
22
|
+
borderBottom: `1px solid ${s.border()}`,
|
|
23
23
|
"&:last-child": { borderRadius: "0 0 4px 4px" }
|
|
24
24
|
})), v = u("div")(({ theme: e }) => ({
|
|
25
25
|
display: "flex",
|
|
@@ -138,11 +138,11 @@ var _ = u("div")(({ theme: e }) => ({
|
|
|
138
138
|
componentDidMount() {
|
|
139
139
|
let { editor: e } = this.props, t = e.view.nodeDOM(e.state.selection.from);
|
|
140
140
|
if (t?.nodeType === 1) {
|
|
141
|
-
let e = t.getBoundingClientRect(), n = t.closest(".tiptap").getBoundingClientRect(), r = e.top -
|
|
141
|
+
let e = t.getBoundingClientRect(), n = t.closest(".tiptap").getBoundingClientRect(), r = e.top - n.top, i = e.left - n.left;
|
|
142
142
|
this.setState({ toolbarStyle: {
|
|
143
143
|
position: "absolute",
|
|
144
|
-
top: `${r + e.height +
|
|
145
|
-
left: `${i
|
|
144
|
+
top: `${r + e.height + 25}px`,
|
|
145
|
+
left: `${i}px`
|
|
146
146
|
} });
|
|
147
147
|
}
|
|
148
148
|
}
|
|
@@ -183,13 +183,11 @@ var _ = u("div")(({ theme: e }) => ({
|
|
|
183
183
|
}
|
|
184
184
|
this.onRespAreaChange(e), this.setState({ editedChoiceIndex: t });
|
|
185
185
|
};
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
return this.onDone(e), this.preventDone = !0, !0;
|
|
190
|
-
}
|
|
191
|
-
return !1;
|
|
186
|
+
finishEditing = () => {
|
|
187
|
+
let e = this.editorRef.getHTML() || "";
|
|
188
|
+
this.onDone(e), this.preventDone = !0;
|
|
192
189
|
};
|
|
190
|
+
onKeyDown = (e) => e.key === "Enter" ? (this.finishEditing(), !0) : !1;
|
|
193
191
|
onBlur = () => {
|
|
194
192
|
if (this.clickedInside) {
|
|
195
193
|
this.clickedInside = !1;
|
|
@@ -206,13 +204,13 @@ var _ = u("div")(({ theme: e }) => ({
|
|
|
206
204
|
this.clickedInside = !0;
|
|
207
205
|
};
|
|
208
206
|
render() {
|
|
209
|
-
let { choices: t, spellCheck: n, uploadSoundSupport: r, mathMlOptions: i = {}, baseInputConfiguration: a = {}, responseAreaInputConfiguration: o = {} } = this.props, { respAreaMarkup:
|
|
210
|
-
return
|
|
207
|
+
let { choices: t, spellCheck: n, uploadSoundSupport: r, mathMlOptions: i = {}, baseInputConfiguration: a = {}, responseAreaInputConfiguration: o = {} } = this.props, { respAreaMarkup: u, toolbarStyle: d, editedChoiceIndex: m } = this.state;
|
|
208
|
+
return d ? /* @__PURE__ */ l(w, {
|
|
211
209
|
"data-inline-dropdown-toolbar": "",
|
|
212
210
|
style: {
|
|
213
|
-
...
|
|
214
|
-
backgroundColor:
|
|
215
|
-
zIndex:
|
|
211
|
+
...d,
|
|
212
|
+
backgroundColor: s.dropdownBackground(),
|
|
213
|
+
zIndex: 999
|
|
216
214
|
},
|
|
217
215
|
onMouseDown: this.onClickInside,
|
|
218
216
|
children: [/* @__PURE__ */ l(O, { children: [/* @__PURE__ */ c(T, {
|
|
@@ -227,7 +225,7 @@ var _ = u("div")(({ theme: e }) => ({
|
|
|
227
225
|
showDone: !1,
|
|
228
226
|
doneOn: "blur"
|
|
229
227
|
},
|
|
230
|
-
markup:
|
|
228
|
+
markup: u,
|
|
231
229
|
onKeyDown: this.onKeyDown,
|
|
232
230
|
languageCharactersProps: [{ language: "spanish" }, { language: "special" }],
|
|
233
231
|
onChange: (e) => {
|
|
@@ -250,10 +248,10 @@ var _ = u("div")(({ theme: e }) => ({
|
|
|
250
248
|
uploadSoundSupport: r,
|
|
251
249
|
mathMlOptions: i
|
|
252
250
|
}), /* @__PURE__ */ c(E, {
|
|
253
|
-
onClick: () => this.onAddChoice(),
|
|
251
|
+
onClick: () => m >= 0 ? this.finishEditing() : this.onAddChoice(),
|
|
254
252
|
size: "small",
|
|
255
253
|
"aria-label": "Add",
|
|
256
|
-
children:
|
|
254
|
+
children: c(m >= 0 ? p : f, { fontSize: "inherit" })
|
|
257
255
|
})] }), t && /* @__PURE__ */ c(D, { children: t.map(({ label: e, correct: t }, n) => /* @__PURE__ */ c(S, {
|
|
258
256
|
onClick: () => this.onSelectChoice(e, n),
|
|
259
257
|
onRemoveChoice: () => this.onRemoveChoice(e, n),
|
package/dist/author/main.js
CHANGED
|
@@ -20,4 +20,4 @@ var t = "imes|riangle|an|heta|herefore", n = "throot|parallel|cong|approx|eq|e|s
|
|
|
20
20
|
return r.replace(s, (e, t) => a(t));
|
|
21
21
|
};
|
|
22
22
|
//#endregion
|
|
23
|
-
export { c as createSlateMarkup, o as processMarkup };
|
|
23
|
+
export { a as createElementFromHTML, c as createSlateMarkup, o as processMarkup, i as removeUnwantedCharacters };
|