forge-edit 0.1.0-beta.2 → 0.1.0-beta.21

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/index.js ADDED
@@ -0,0 +1,40 @@
1
+ import { t as e } from "./light-CM1Yx-3B.js";
2
+ //#region src/components/shared/Hooks/options.js
3
+ function t(e) {
4
+ return {
5
+ type: e.getAttribute("type") || "light",
6
+ placeholder: e.getAttribute("placeholder") || "",
7
+ width: e.getAttribute("width") || "100%",
8
+ height: e.getAttribute("height") || "300px",
9
+ lang: e.getAttribute("lang") || "en",
10
+ dir: e.getAttribute("dir") || "ltr"
11
+ };
12
+ }
13
+ //#endregion
14
+ //#region src/main/index.jsx
15
+ function n(n) {
16
+ let r = t(n);
17
+ if (r.type === "light") {
18
+ let { element: t, getHTML: i, setHTML: a, getText: o, getSelection: s } = e(r);
19
+ return n.innerHTML = "", n.appendChild(t), t.style.width = r.width, t.style.height = r.height, {
20
+ element: t,
21
+ getHTML: i,
22
+ setHTML: a,
23
+ getText: o,
24
+ getSelection: s
25
+ };
26
+ }
27
+ return null;
28
+ }
29
+ //#endregion
30
+ //#region src/main/main.jsx
31
+ var r = document.querySelectorAll("forge-editor"), i = [];
32
+ r.forEach((e) => {
33
+ let t = n(e);
34
+ t && i.push(t);
35
+ }), window.forgeEditors = i;
36
+ var a = document.getElementById("get-html-btn"), o = document.getElementById("html-output");
37
+ a && o && i[0] && a.addEventListener("click", () => {
38
+ o.value = i[0].getHTML();
39
+ });
40
+ //#endregion