@nuraly/runtime 0.1.8 → 0.1.10
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/AIChat-DP3ZdLL3.js +220 -0
- package/dist/AIChat-km1IYaR-.js +260 -0
- package/dist/Badge-BR94MUt5.js +48 -0
- package/dist/Badge-DzNZFKtC.js +70 -0
- package/dist/{BaseElement-BNBn_IJk.js → BaseElement-pS6m_x6Q.js} +153 -24
- package/dist/Button-BHAN7npC.js +92 -0
- package/dist/Button-DCqgsxrL.js +80 -0
- package/dist/Card-B70c8NFb.js +150 -0
- package/dist/Card-DhOCsGKC.js +120 -0
- package/dist/Checkbox-BZTcPwew.js +59 -0
- package/dist/Checkbox-LYTIBAUV.js +65 -0
- package/dist/Code-BWbiciC8.js +123 -0
- package/dist/Code-Ds0vFclr.js +109 -0
- package/dist/{CodeEditor-Bf4L2rO_.js → CodeEditor-ChuFC0ex.js} +22 -22
- package/dist/Col-B_wpWUcU.js +217 -0
- package/dist/Col-DYs8_65c.js +193 -0
- package/dist/Collapse-4kxbQ74u.js +74 -0
- package/dist/Collapse-Dkw6Ner6.js +96 -0
- package/dist/Collections-BSF-PqBz.js +122 -0
- package/dist/Collections-D5rwMFbv.js +151 -0
- package/dist/Container-DMNh5U4Y.js +204 -0
- package/dist/DatePicker-BmEOONiA.js +99 -0
- package/dist/DatePicker-VuUroOT4.js +80 -0
- package/dist/Divider-BfxR3rVl.js +86 -0
- package/dist/Divider-etMTYU3d.js +106 -0
- package/dist/Document-CHBcJciR.js +74 -0
- package/dist/Document-Cj-TmjAf.js +90 -0
- package/dist/Dropdown-BRtHvDa3.js +133 -0
- package/dist/Dropdown-C47Y11dj.js +112 -0
- package/dist/EmbedURL-BwbJRnY1.js +142 -0
- package/dist/EmbedURL-Ci5X1vQG.js +114 -0
- package/dist/FileUpload-BBgPcRag.js +54 -0
- package/dist/FileUpload-BgkhxtNe.js +47 -0
- package/dist/Form-BLq6U3In.js +339 -0
- package/dist/Form-E6zXqgsm.js +286 -0
- package/dist/Icon-CcLuhz6B.js +64 -0
- package/dist/Icon-_UiLblGb.js +74 -0
- package/dist/Image-B_VERIvH.js +111 -0
- package/dist/Image-hI8kIx8U.js +93 -0
- package/dist/Link-BVTo43Cc.js +76 -0
- package/dist/Link-xSrPxOLt.js +95 -0
- package/dist/Menu-CembLIjO.js +83 -0
- package/dist/Menu-D9ZjIOMg.js +73 -0
- package/dist/MicroApp-DI1kQwJk.js +100 -0
- package/dist/MicroApp-DJw57sLE.js +75 -0
- package/dist/NumberInput-DftAAKEs.js +84 -0
- package/dist/NumberInput-eOAk0-fb.js +95 -0
- package/dist/Panel-Bso5fv4i.js +127 -0
- package/dist/Panel-CwzW9iuA.js +161 -0
- package/dist/Radio-button-Sii5iveh.js +71 -0
- package/dist/Radio-button-YXsVqipQ.js +53 -0
- package/dist/RefComponent-Bwk_I0mK.js +79 -0
- package/dist/RefComponent-ZxafRVhZ.js +96 -0
- package/dist/RichText-CgYXXC_a.js +485 -0
- package/dist/RichText-DV46U7fI.js +449 -0
- package/dist/Row-Bb95f5DI.js +229 -0
- package/dist/Row-Dmd_61mR.js +202 -0
- package/dist/Select-Cma8JHAj.js +77 -0
- package/dist/Select-DqA08VYb.js +87 -0
- package/dist/Slider-B2_Qecjz.js +74 -0
- package/dist/Slider-DVY0N2YX.js +55 -0
- package/dist/Table-0WjrBnz-.js +159 -0
- package/dist/Table-dEma50kw.js +184 -0
- package/dist/Tabs-BDKEv1jn.js +131 -0
- package/dist/Tabs-Cvt3Q8vx.js +116 -0
- package/dist/Tag-BcZvQkE_.js +47 -0
- package/dist/Tag-DMZ0mu8y.js +61 -0
- package/dist/TextInput-KI6r9xET.js +193 -0
- package/dist/TextInput-hxK-HhJi.js +148 -0
- package/dist/TextLabel-DkV26yaL.js +102 -0
- package/dist/Textarea-Bzs3jSUm.js +117 -0
- package/dist/Textarea-CwK3SYbz.js +83 -0
- package/dist/Video-C4uBWCBb.js +100 -0
- package/dist/Video-CL1lgcvB.js +120 -0
- package/dist/aitchat-DjX5s7_8.js +23 -0
- package/dist/colorpicker-B-KETfWw.js +64 -0
- package/dist/colorpicker-DhB0AygJ.js +75 -0
- package/dist/constants-Bs_KQRi_.js +4 -0
- package/dist/constants-CXdpxgF2.js +4 -0
- package/dist/{cssMode-DMsdy1N0.js → cssMode-CV7QbFJv.js} +1 -1
- package/dist/{freemarker2-D51H9HYi.js → freemarker2-CqQxSEZa.js} +1 -1
- package/dist/{handlebars-CF6gdAX4.js → handlebars-a71LdN7X.js} +1 -1
- package/dist/{html-c2n_zkM3.js → html-D8UaB7IC.js} +1 -1
- package/dist/{htmlMode-9IJTuZUh.js → htmlMode-CqWQMFWX.js} +1 -1
- package/dist/iconbutton-DfnrRmmB.js +69 -0
- package/dist/iconbutton-DvIQHV8o.js +53 -0
- package/dist/{javascript-DhEEBMxD.js → javascript-D_jGqcRD.js} +1 -1
- package/dist/{jsonMode-CB6k-4rp.js → jsonMode-C3-m5xts.js} +1 -1
- package/dist/{liquid-CwtPiwnW.js → liquid-DLwYj6Te.js} +1 -1
- package/dist/{mdx-LewPRYF8.js → mdx-DhYjhxkW.js} +1 -1
- package/dist/micro-app-entry-DiNqE6xi.js +12042 -0
- package/dist/micro-app.bundle.js +1 -1
- package/dist/micro-app.js +6 -4940
- package/dist/{python-h5Z2g-yl.js → python-B-WcGqFq.js} +1 -1
- package/dist/{razor-D5ep1Doy.js → razor-JGACy1mz.js} +1 -1
- package/dist/runtime.js +4 -2
- package/dist/{tsMode-B_6LiBE1.js → tsMode-lzBM1oT2.js} +1 -1
- package/dist/{typescript-BBG0jH4p.js → typescript-CuL5pdO2.js} +1 -1
- package/dist/{xml-DgLB7rE6.js → xml-D1tacAKD.js} +1 -1
- package/dist/{yaml-DiI4HpSv.js → yaml-CjPB1g7v.js} +1 -1
- package/package.json +4 -1
- package/utils/index.ts +4 -1
- package/utils/lazy-component-loader.ts +120 -0
- package/utils/register-components.ts +14 -40
- package/utils/render-util.ts +84 -0
- package/dist/micro-app-entry-C3RDIukG.js +0 -15831
|
@@ -0,0 +1,449 @@
|
|
|
1
|
+
import { i as b, c as p, d, q as z, b as h, t as f, u as w, w as _, A as g, x as y, E as H, B as x, h as M, n as V, o as L } from "./micro-app-entry-DiNqE6xi.js";
|
|
2
|
+
var k = Object.defineProperty, $ = Object.getOwnPropertyDescriptor, u = (o, e, i, a) => {
|
|
3
|
+
for (var n = a > 1 ? void 0 : a ? $(e, i) : e, t = o.length - 1, r; t >= 0; t--)
|
|
4
|
+
(r = o[t]) && (n = (a ? r(e, i, n) : r(n)) || n);
|
|
5
|
+
return a && n && k(e, i, n), n;
|
|
6
|
+
};
|
|
7
|
+
const C = {
|
|
8
|
+
format_clear: '<svg viewBox="0 0 24 24"><path d="M3.27 5L2 6.27l6.97 6.97L6.5 19h3l1.57-3.66L16.73 21 18 19.73 3.55 5.27 3.27 5zM6 5v.18L8.82 8h2.4l-.72 1.68 2.1 2.1L14.21 8H20V5H6z"></path></svg>',
|
|
9
|
+
format_bold: '<svg viewBox="0 0 24 24"><path d="M15.6 10.79c.97-.67 1.65-1.77 1.65-2.79 0-2.26-1.75-4-4-4H7v14h7.04c2.09 0 3.71-1.7 3.71-3.79 0-1.52-.86-2.82-2.15-3.42zM10 6.5h3c.83 0 1.5.67 1.5 1.5s-.67 1.5-1.5 1.5h-3v-3zm3.5 9H10v-3h3.5c.83 0 1.5.67 1.5 1.5s-.67 1.5-1.5 1.5z"></path></svg>',
|
|
10
|
+
format_italic: '<svg viewBox="0 0 24 24"><path d="M10 4v3h2.21l-3.42 8H6v3h8v-3h-2.21l3.42-8H18V4z"></path></svg>',
|
|
11
|
+
format_underlined: '<svg viewBox="0 0 24 24"><path d="M12 17c3.31 0 6-2.69 6-6V3h-2.5v8c0 1.93-1.57 3.5-3.5 3.5S8.5 12.93 8.5 11V3H6v8c0 3.31 2.69 6 6 6zm-7 2v2h14v-2H5z"></path></svg>',
|
|
12
|
+
format_align_left: '<svg viewBox="0 0 24 24"><path d="M15 15H3v2h12v-2zm0-8H3v2h12V7zM3 13h18v-2H3v2zm0 8h18v-2H3v2zM3 3v2h18V3H3z"></path></svg>',
|
|
13
|
+
format_align_center: '<svg viewBox="0 0 24 24"><path d="M7 15v2h10v-2H7zm-4 6h18v-2H3v2zm0-8h18v-2H3v2zm4-6v2h10V7H7zM3 3v2h18V3H3z"></path></svg>',
|
|
14
|
+
format_align_right: '<svg viewBox="0 0 24 24"><path d="M3 21h18v-2H3v2zm6-4h12v-2H9v2zm-6-4h18v-2H3v2zm6-4h12V7H9v2zM3 3v2h18V3H3z"></path></svg>',
|
|
15
|
+
format_list_numbered: '<svg viewBox="0 0 24 24"><path d="M2 17h2v.5H3v1h1v.5H2v1h3v-4H2v1zm1-9h1V4H2v1h1v3zm-1 3h1.8L2 13.1v.9h3v-1H3.2L5 10.9V10H2v1zm5-6v2h14V5H7zm0 14h14v-2H7v2zm0-6h14v-2H7v2z"></path></svg>',
|
|
16
|
+
format_list_bulleted: '<svg viewBox="0 0 24 24"><path d="M4 10.5c-.83 0-1.5.67-1.5 1.5s.67 1.5 1.5 1.5 1.5-.67 1.5-1.5-.67-1.5-1.5-1.5zm0-6c-.83 0-1.5.67-1.5 1.5S3.17 7.5 4 7.5 5.5 6.83 5.5 6 4.83 4.5 4 4.5zm0 12c-.83 0-1.5.68-1.5 1.5s.68 1.5 1.5 1.5 1.5-.68 1.5-1.5-.67-1.5-1.5-1.5zM7 19h14v-2H7v2zm0-6h14v-2H7v2zm0-8v2h14V5H7z"></path></svg>',
|
|
17
|
+
format_quote: '<svg viewBox="0 0 24 24"><path d="M6 17h3l2-4V7H5v6h3zm8 0h3l2-4V7h-6v6h3z"></path></svg>',
|
|
18
|
+
format_indent_decrease: '<svg viewBox="0 0 24 24"><path d="M11 17h10v-2H11v2zm-8-5l4 4V8l-4 4zm0 9h18v-2H3v2zM3 3v2h18V3H3zm8 6h10V7H11v2zm0 4h10v-2H11v2z"></path></svg>',
|
|
19
|
+
format_indent_increase: '<svg viewBox="0 0 24 24"><path d="M3 21h18v-2H3v2zM3 8v8l4-4-4-4zm8 9h10v-2H11v2zM3 3v2h18V3H3zm8 6h10V7H11v2zm0 4h10v-2H11v2z"></path></svg>',
|
|
20
|
+
link_off: '<svg viewBox="0 0 24 24"><path d="M17 7h-4v1.9h4c1.71 0 3.1 1.39 3.1 3.1 0 1.43-.98 2.63-2.31 2.98l1.46 1.46C20.88 15.61 22 13.95 22 12c0-2.76-2.24-5-5-5zm-1 4h-2.19l2 2H16zM2 4.27l3.11 3.11C3.29 8.12 2 9.91 2 12c0 2.76 2.24 5 5 5h4v-1.9H7c-1.71 0-3.1-1.39-3.1-3.1 0-1.59 1.21-2.9 2.76-3.07L8.73 11H8v2h2.73L13 15.27V17h1.73l4.01 4.01 1.41-1.41L3.41 2.86 2 4.27z"></path></svg>',
|
|
21
|
+
add_link: '<svg viewBox="0 0 24 24"><path d="M3.9 12c0-1.71 1.39-3.1 3.1-3.1h4V7H7c-2.76 0-5 2.24-5 5s2.24 5 5 5h4v-1.9H7c-1.71 0-3.1-1.39-3.1-3.1zM8 13h8v-2H8v2zm9-6h-4v1.9h4c1.71 0 3.1 1.39 3.1 3.1s-1.39 3.1-3.1 3.1h-4V17h4c2.76 0 5-2.24 5-5s-2.24-5-5-5z"></path></svg>',
|
|
22
|
+
format_color_text: '<svg viewBox="0 0 24 24"><path d="M11 3L5.5 17h2.25l1.12-3h6.25l1.12 3h2.25L13 3h-2zm-1.38 9L12 5.67 14.38 12H9.62z"></path></svg>',
|
|
23
|
+
border_color: '<svg viewBox="0 0 24 24"><path d="M17.75 7L14 3.25l-10 10V17h3.75l10-10zm2.96-2.96c.39-.39.39-1.02 0-1.41L18.37.29c-.39-.39-1.02-.39-1.41 0L15 2.25 18.75 6l1.96-1.96z"></path></svg>',
|
|
24
|
+
title: '<svg viewBox="0 0 24 24"><path d="M5 4v3h5.5v12h3V7H19V4z"></path></svg>',
|
|
25
|
+
text_format: '<svg viewBox="0 0 24 24"><path d="M5 17v2h14v-2H5zm4.5-4.2h5l.9 2.2h2.1L12.75 4h-1.5L6.5 15h2.1l.9-2.2zM12 5.98L13.87 11h-3.74L12 5.98z"></path></svg>',
|
|
26
|
+
format_size: '<svg viewBox="0 0 24 24"><path d="M9 4v3h5v12h3V7h5V4H9zm-6 8h3v7h3v-7h3V9H3v3z"></path></svg>',
|
|
27
|
+
undo: '<svg viewBox="0 0 24 24"><path d="M12.5 8c-2.65 0-5.05.99-6.9 2.6L2 7v9h9l-3.62-3.62c1.39-1.16 3.16-1.88 5.12-1.88 3.54 0 6.55 2.31 7.6 5.5l2.37-.78C21.08 11.03 17.15 8 12.5 8z"></path></svg>',
|
|
28
|
+
redo: '<svg viewBox="0 0 24 24"><path d="M18.4 10.6C16.55 8.99 14.15 8 11.5 8c-4.65 0-8.58 3.03-9.96 7.22L3.9 16c1.05-3.19 4.05-5.5 7.6-5.5 1.95 0 3.73.72 5.12 1.88L13 16h9V7l-3.6 3.6z"></path></svg>',
|
|
29
|
+
content_cut: '<svg viewBox="0 0 24 24"><path d="M9.64 7.64c.23-.5.36-1.05.36-1.64 0-2.21-1.79-4-4-4S2 3.79 2 6s1.79 4 4 4c.59 0 1.14-.13 1.64-.36L10 12l-2.36 2.36C7.14 14.13 6.59 14 6 14c-2.21 0-4 1.79-4 4s1.79 4 4 4 4-1.79 4-4c0-.59-.13-1.14-.36-1.64L12 14l7 7h3v-1L9.64 7.64zM6 8c-1.1 0-2-.89-2-2s.9-2 2-2 2 .89 2 2-.9 2-2 2zm0 12c-1.1 0-2-.89-2-2s.9-2 2-2 2 .89 2 2-.9 2-2 2zm6-7.5c-.28 0-.5-.22-.5-.5s.22-.5.5-.5.5.22.5.5-.22.5-.5.5zM19 3l-6 6 2 2 7-7V3z"></path></svg>',
|
|
30
|
+
content_copy: '<svg viewBox="0 0 24 24"><path d="M16 1H4c-1.1 0-2 .9-2 2v14h2V3h12V1zm3 4H8c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h11c1.1 0 2-.9 2-2V7c0-1.1-.9-2-2-2zm0 16H8V7h11v14z"></path></svg>',
|
|
31
|
+
content_paste: '<svg viewBox="0 0 24 24"><path d="M19 2h-4.18C14.4.84 13.3 0 12 0c-1.3 0-2.4.84-2.82 2H5c-1.1 0-2 .9-2 2v16c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2V4c0-1.1-.9-2-2-2zm-7 0c.55 0 1 .45 1 1s-.45 1-1 1-1-.45-1-1 .45-1 1-1zm7 18H5V4h2v3h10V4h2v16z"></path></svg>'
|
|
32
|
+
};
|
|
33
|
+
let v = class extends z {
|
|
34
|
+
constructor() {
|
|
35
|
+
super(...arguments), this.content = "", this.root = null;
|
|
36
|
+
}
|
|
37
|
+
render() {
|
|
38
|
+
return h`<main>
|
|
39
|
+
|
|
40
|
+
<div id="editor-actions">
|
|
41
|
+
<div id="toolbar">
|
|
42
|
+
${B(this.shadowRoot, this.getSelection(), (o, e) => {
|
|
43
|
+
document.execCommand(o, !1, e);
|
|
44
|
+
})}
|
|
45
|
+
<input id="bg" type="color" style="display: none" />
|
|
46
|
+
<input id="fg" type="color" style="display: none" />
|
|
47
|
+
</div>
|
|
48
|
+
</div>
|
|
49
|
+
<div id="editor" @input=${(o) => {
|
|
50
|
+
this.dispatchEvent(new CustomEvent("content-change", {
|
|
51
|
+
detail: {
|
|
52
|
+
value: this.root?.innerHTML
|
|
53
|
+
}
|
|
54
|
+
}));
|
|
55
|
+
}}>${this.root}</div>
|
|
56
|
+
</main> `;
|
|
57
|
+
}
|
|
58
|
+
async firstUpdated() {
|
|
59
|
+
this.parentElement?.querySelector("rich-text-editor template"), this.reset();
|
|
60
|
+
}
|
|
61
|
+
reset() {
|
|
62
|
+
const e = new DOMParser().parseFromString(this.content, "text/html");
|
|
63
|
+
document.execCommand("defaultParagraphSeparator", !1, "br"), document.addEventListener("selectionchange", () => {
|
|
64
|
+
this.requestUpdate();
|
|
65
|
+
});
|
|
66
|
+
const i = e.querySelector("body");
|
|
67
|
+
i.setAttribute("contenteditable", "true"), this.root = i, this.root.style.height = "100%";
|
|
68
|
+
}
|
|
69
|
+
getSelection() {
|
|
70
|
+
return this.shadowRoot?.getSelection ? this.shadowRoot?.getSelection() : null;
|
|
71
|
+
}
|
|
72
|
+
};
|
|
73
|
+
v.styles = b`
|
|
74
|
+
:host {
|
|
75
|
+
/* --editor-width: 600px; */
|
|
76
|
+
/* --editor-height: 600px; */
|
|
77
|
+
/* --editor-background: #f1f1f1; */
|
|
78
|
+
--editor-toolbar-height: 33px;
|
|
79
|
+
--editor-toolbar-background: #454545;
|
|
80
|
+
--editor-toolbar-on-background: white;
|
|
81
|
+
/* --editor-toolbar-on-active-background: #a4a4a4; */
|
|
82
|
+
}
|
|
83
|
+
main {
|
|
84
|
+
width: var(--editor-width);
|
|
85
|
+
height: var(--editor-height);
|
|
86
|
+
display: grid;
|
|
87
|
+
grid-template-areas:
|
|
88
|
+
"toolbar toolbar"
|
|
89
|
+
"editor editor";
|
|
90
|
+
grid-template-rows: auto 1fr;
|
|
91
|
+
grid-template-columns: auto auto;
|
|
92
|
+
}
|
|
93
|
+
#editor-actions {
|
|
94
|
+
grid-area: toolbar;
|
|
95
|
+
width: var(--editor-width);
|
|
96
|
+
/* height: var(--editor-toolbar-height); */
|
|
97
|
+
background-color: var(--editor-toolbar-background);
|
|
98
|
+
color: var(--editor-toolbar-on-background);
|
|
99
|
+
overscroll-behavior: contain;
|
|
100
|
+
/* overflow-y: auto; */
|
|
101
|
+
-ms-overflow-style: none;
|
|
102
|
+
scrollbar-width: none;
|
|
103
|
+
overflow:auto;
|
|
104
|
+
|
|
105
|
+
/* Add these lines for vertical alignment */
|
|
106
|
+
display: flex;
|
|
107
|
+
align-items: center; /* vertically center items */
|
|
108
|
+
}
|
|
109
|
+
#editor-actions::-webkit-scrollbar {
|
|
110
|
+
display: none;
|
|
111
|
+
}
|
|
112
|
+
#editor {
|
|
113
|
+
width: var(--editor-width);
|
|
114
|
+
grid-area: editor;
|
|
115
|
+
background-color: var(--editor-background);
|
|
116
|
+
border: 1px solid var(--editor-toolbar-background);
|
|
117
|
+
}
|
|
118
|
+
#toolbar {
|
|
119
|
+
width: 1080px;
|
|
120
|
+
height: var(--editor-toolbar-height);
|
|
121
|
+
}
|
|
122
|
+
[contenteditable] {
|
|
123
|
+
outline: 0px solid transparent;
|
|
124
|
+
}
|
|
125
|
+
.icon-button {
|
|
126
|
+
display: inline-flex;
|
|
127
|
+
align-items: center;
|
|
128
|
+
justify-content: center;
|
|
129
|
+
width: 30px;
|
|
130
|
+
height: 30px;
|
|
131
|
+
border: none;
|
|
132
|
+
background: transparent;
|
|
133
|
+
cursor: pointer;
|
|
134
|
+
padding: 0;
|
|
135
|
+
color: var(--editor-toolbar-on-background);
|
|
136
|
+
}
|
|
137
|
+
.icon-button svg {
|
|
138
|
+
width: 20px;
|
|
139
|
+
height: 20px;
|
|
140
|
+
fill: currentColor;
|
|
141
|
+
}
|
|
142
|
+
.icon-button.active {
|
|
143
|
+
color: var(--editor-toolbar-on-active-background);
|
|
144
|
+
}
|
|
145
|
+
select {
|
|
146
|
+
margin-top: -5px;
|
|
147
|
+
height: calc(var(--editor-toolbar-height) - 10px);
|
|
148
|
+
vertical-align: middle;
|
|
149
|
+
}
|
|
150
|
+
input[type="color"] {
|
|
151
|
+
height: calc(var(--editor-toolbar-height) - 15px);
|
|
152
|
+
-webkit-appearance: none;
|
|
153
|
+
border: none;
|
|
154
|
+
width: 22px;
|
|
155
|
+
}
|
|
156
|
+
input[type="color"]::-webkit-color-swatch-wrapper {
|
|
157
|
+
padding: 0;
|
|
158
|
+
}
|
|
159
|
+
input[type="color"]::-webkit-color-swatch {
|
|
160
|
+
border: none;
|
|
161
|
+
}
|
|
162
|
+
`;
|
|
163
|
+
u([
|
|
164
|
+
p()
|
|
165
|
+
], v.prototype, "content", 2);
|
|
166
|
+
u([
|
|
167
|
+
d()
|
|
168
|
+
], v.prototype, "root", 2);
|
|
169
|
+
v = u([
|
|
170
|
+
f("rich-text-editor-block")
|
|
171
|
+
], v);
|
|
172
|
+
function B(o, e, i) {
|
|
173
|
+
const a = [];
|
|
174
|
+
if (e?.type === "Range") {
|
|
175
|
+
let t = e?.baseNode;
|
|
176
|
+
if (t) {
|
|
177
|
+
const r = () => {
|
|
178
|
+
const l = t?.tagName?.toLowerCase()?.trim();
|
|
179
|
+
l && a.push(l);
|
|
180
|
+
};
|
|
181
|
+
for (; t != null; )
|
|
182
|
+
r(), t = t?.parentNode;
|
|
183
|
+
}
|
|
184
|
+
}
|
|
185
|
+
const n = [
|
|
186
|
+
{
|
|
187
|
+
icon: "format_clear",
|
|
188
|
+
command: "removeFormat"
|
|
189
|
+
},
|
|
190
|
+
{
|
|
191
|
+
icon: "format_bold",
|
|
192
|
+
command: "bold",
|
|
193
|
+
active: a.includes("b")
|
|
194
|
+
},
|
|
195
|
+
{
|
|
196
|
+
icon: "format_italic",
|
|
197
|
+
command: "italic",
|
|
198
|
+
active: a.includes("i")
|
|
199
|
+
},
|
|
200
|
+
{
|
|
201
|
+
icon: "format_underlined",
|
|
202
|
+
command: "underline",
|
|
203
|
+
active: a.includes("u")
|
|
204
|
+
},
|
|
205
|
+
{
|
|
206
|
+
icon: "format_align_left",
|
|
207
|
+
command: "justifyleft"
|
|
208
|
+
},
|
|
209
|
+
{
|
|
210
|
+
icon: "format_align_center",
|
|
211
|
+
command: "justifycenter"
|
|
212
|
+
},
|
|
213
|
+
{
|
|
214
|
+
icon: "format_align_right",
|
|
215
|
+
command: "justifyright"
|
|
216
|
+
},
|
|
217
|
+
{
|
|
218
|
+
icon: "format_list_numbered",
|
|
219
|
+
command: "insertorderedlist",
|
|
220
|
+
active: a.includes("ol")
|
|
221
|
+
},
|
|
222
|
+
{
|
|
223
|
+
icon: "format_list_bulleted",
|
|
224
|
+
command: "insertunorderedlist",
|
|
225
|
+
active: a.includes("ul")
|
|
226
|
+
},
|
|
227
|
+
{
|
|
228
|
+
icon: "format_quote",
|
|
229
|
+
command: "formatblock",
|
|
230
|
+
command_value: "blockquote"
|
|
231
|
+
},
|
|
232
|
+
{
|
|
233
|
+
icon: "format_indent_decrease",
|
|
234
|
+
command: "outdent"
|
|
235
|
+
},
|
|
236
|
+
{
|
|
237
|
+
icon: "format_indent_increase",
|
|
238
|
+
command: "indent"
|
|
239
|
+
},
|
|
240
|
+
a.includes("a") ? { icon: "link_off", command: "unlink" } : {
|
|
241
|
+
icon: "add_link",
|
|
242
|
+
command: () => {
|
|
243
|
+
const t = prompt("Write the URL here", "http://");
|
|
244
|
+
t && t != "" && t != "http://" && i("createlink", t);
|
|
245
|
+
}
|
|
246
|
+
},
|
|
247
|
+
{
|
|
248
|
+
icon: "format_color_text",
|
|
249
|
+
command: () => {
|
|
250
|
+
const t = o.querySelector("#fg");
|
|
251
|
+
t.addEventListener("input", (r) => {
|
|
252
|
+
const l = r.target.value;
|
|
253
|
+
i("forecolor", l);
|
|
254
|
+
}), t.click();
|
|
255
|
+
},
|
|
256
|
+
type: "color"
|
|
257
|
+
},
|
|
258
|
+
{
|
|
259
|
+
icon: "border_color",
|
|
260
|
+
command: () => {
|
|
261
|
+
const t = o.querySelector("#bg");
|
|
262
|
+
t.addEventListener("input", (r) => {
|
|
263
|
+
const l = r.target.value;
|
|
264
|
+
i("backcolor", l);
|
|
265
|
+
}), t.click();
|
|
266
|
+
},
|
|
267
|
+
type: "color"
|
|
268
|
+
},
|
|
269
|
+
{
|
|
270
|
+
icon: "format_size",
|
|
271
|
+
command: "fontsize",
|
|
272
|
+
values: [
|
|
273
|
+
{ name: "Font Size", value: "--" },
|
|
274
|
+
{ name: "Very Small", value: "1" },
|
|
275
|
+
{ name: "Small", value: "2" },
|
|
276
|
+
{ name: "Normal", value: "3" },
|
|
277
|
+
{ name: "Medium Large", value: "4" },
|
|
278
|
+
{ name: "Large", value: "5" },
|
|
279
|
+
{ name: "Very Large", value: "6" },
|
|
280
|
+
{ name: "Maximum", value: "7" }
|
|
281
|
+
]
|
|
282
|
+
},
|
|
283
|
+
{
|
|
284
|
+
icon: "undo",
|
|
285
|
+
command: "undo"
|
|
286
|
+
},
|
|
287
|
+
{
|
|
288
|
+
icon: "redo",
|
|
289
|
+
command: "redo"
|
|
290
|
+
},
|
|
291
|
+
{
|
|
292
|
+
icon: "content_cut",
|
|
293
|
+
command: "cut"
|
|
294
|
+
},
|
|
295
|
+
{
|
|
296
|
+
icon: "content_copy",
|
|
297
|
+
command: "copy"
|
|
298
|
+
},
|
|
299
|
+
{
|
|
300
|
+
icon: "content_paste",
|
|
301
|
+
command: "paste"
|
|
302
|
+
}
|
|
303
|
+
];
|
|
304
|
+
return h`
|
|
305
|
+
${n.map((t) => t.values ? h`
|
|
306
|
+
<select
|
|
307
|
+
id="${t.icon}"
|
|
308
|
+
@change=${(r) => {
|
|
309
|
+
const l = r.target.value;
|
|
310
|
+
l === "--" ? i("removeFormat", void 0) : typeof t.command == "string" && i(t.command, l);
|
|
311
|
+
}}
|
|
312
|
+
>
|
|
313
|
+
${t.values.map(
|
|
314
|
+
(r) => h`<option value=${r.value}>${r.name}</option>`
|
|
315
|
+
)}
|
|
316
|
+
</select>
|
|
317
|
+
` : h`
|
|
318
|
+
<button
|
|
319
|
+
class="icon-button ${t.active ? "active" : ""}"
|
|
320
|
+
@click=${() => {
|
|
321
|
+
typeof t.command == "string" ? i(t.command, t.command_value) : t.command();
|
|
322
|
+
}}
|
|
323
|
+
.innerHTML=${C[t.icon]}
|
|
324
|
+
></button>
|
|
325
|
+
`)}
|
|
326
|
+
`;
|
|
327
|
+
}
|
|
328
|
+
/**
|
|
329
|
+
* @license
|
|
330
|
+
* Copyright 2017 Google LLC
|
|
331
|
+
* SPDX-License-Identifier: BSD-3-Clause
|
|
332
|
+
*/
|
|
333
|
+
class m extends _ {
|
|
334
|
+
constructor(e) {
|
|
335
|
+
if (super(e), this.it = g, e.type !== y.CHILD) throw Error(this.constructor.directiveName + "() can only be used in child bindings");
|
|
336
|
+
}
|
|
337
|
+
render(e) {
|
|
338
|
+
if (e === g || e == null) return this._t = void 0, this.it = e;
|
|
339
|
+
if (e === H) return e;
|
|
340
|
+
if (typeof e != "string") throw Error(this.constructor.directiveName + "() called with a non-string value");
|
|
341
|
+
if (e === this.it) return this._t;
|
|
342
|
+
this.it = e;
|
|
343
|
+
const i = [e];
|
|
344
|
+
return i.raw = i, this._t = { _$litType$: this.constructor.resultType, strings: i, values: [] };
|
|
345
|
+
}
|
|
346
|
+
}
|
|
347
|
+
m.directiveName = "unsafeHTML", m.resultType = 1;
|
|
348
|
+
const S = w(m);
|
|
349
|
+
var E = Object.defineProperty, O = Object.getOwnPropertyDescriptor, s = (o, e, i, a) => {
|
|
350
|
+
for (var n = a > 1 ? void 0 : a ? O(e, i) : e, t = o.length - 1, r; t >= 0; t--)
|
|
351
|
+
(r = o[t]) && (n = (a ? r(e, i, n) : r(n)) || n);
|
|
352
|
+
return a && n && E(e, i, n), n;
|
|
353
|
+
};
|
|
354
|
+
let c = class extends x {
|
|
355
|
+
constructor() {
|
|
356
|
+
super(), this.isViewMode = !1, this.dragOverSituation = !1, this.wrapperStyle = {}, this.editing = !1, this.handleKeyDown = (o) => {
|
|
357
|
+
o.key === "Escape" && this.editing && (this.editing = !1, o.preventDefault(), o.stopPropagation());
|
|
358
|
+
}, this.handleDoubleClick = () => {
|
|
359
|
+
this.editing = !0;
|
|
360
|
+
};
|
|
361
|
+
}
|
|
362
|
+
connectedCallback() {
|
|
363
|
+
super.connectedCallback(), window.addEventListener("keydown", this.handleKeyDown);
|
|
364
|
+
}
|
|
365
|
+
disconnectedCallback() {
|
|
366
|
+
super.disconnectedCallback(), window.removeEventListener("keydown", this.handleKeyDown);
|
|
367
|
+
}
|
|
368
|
+
handleCodeEditorChange(o) {
|
|
369
|
+
if (!this.isViewMode) {
|
|
370
|
+
const e = JSON.stringify(o);
|
|
371
|
+
M(
|
|
372
|
+
this.component,
|
|
373
|
+
/* js */
|
|
374
|
+
`
|
|
375
|
+
try {
|
|
376
|
+
const selectedComponent = Utils.first($selectedComponents);
|
|
377
|
+
updateInput(selectedComponent, "value", "string", ${e}, null);
|
|
378
|
+
} catch (error) {
|
|
379
|
+
console.error(error);
|
|
380
|
+
}
|
|
381
|
+
`,
|
|
382
|
+
{}
|
|
383
|
+
);
|
|
384
|
+
}
|
|
385
|
+
}
|
|
386
|
+
renderComponent() {
|
|
387
|
+
return h`
|
|
388
|
+
|
|
389
|
+
<div ${V(this.inputRef)}
|
|
390
|
+
class="${`drop-${this.component.uuid}`}"
|
|
391
|
+
style=${L({
|
|
392
|
+
width: this.editing ? "auto" : this.getStyles().width,
|
|
393
|
+
display: "block"
|
|
394
|
+
})}
|
|
395
|
+
>
|
|
396
|
+
${this.editing && !this.isViewMode ? h`
|
|
397
|
+
<rich-text-editor-block
|
|
398
|
+
@content-change=${(o) => {
|
|
399
|
+
this.handleCodeEditorChange(o.detail.value);
|
|
400
|
+
}}
|
|
401
|
+
.content=${this.inputHandlersValue.value}
|
|
402
|
+
></rich-text-editor-block>
|
|
403
|
+
` : h`
|
|
404
|
+
<p @dblclick=${this.handleDoubleClick}>
|
|
405
|
+
${S(this.inputHandlersValue.value)}
|
|
406
|
+
</p>
|
|
407
|
+
`}
|
|
408
|
+
</div>
|
|
409
|
+
`;
|
|
410
|
+
}
|
|
411
|
+
firstUpdated(o) {
|
|
412
|
+
}
|
|
413
|
+
};
|
|
414
|
+
s([
|
|
415
|
+
p({ type: Object })
|
|
416
|
+
], c.prototype, "component", 2);
|
|
417
|
+
s([
|
|
418
|
+
p({ type: Object })
|
|
419
|
+
], c.prototype, "item", 2);
|
|
420
|
+
s([
|
|
421
|
+
p({ type: Object })
|
|
422
|
+
], c.prototype, "draggingComponentInfo", 2);
|
|
423
|
+
s([
|
|
424
|
+
p({ type: Boolean })
|
|
425
|
+
], c.prototype, "isViewMode", 2);
|
|
426
|
+
s([
|
|
427
|
+
d()
|
|
428
|
+
], c.prototype, "dragOverSituation", 2);
|
|
429
|
+
s([
|
|
430
|
+
d()
|
|
431
|
+
], c.prototype, "selectedComponent", 2);
|
|
432
|
+
s([
|
|
433
|
+
d()
|
|
434
|
+
], c.prototype, "hoveredComponent", 2);
|
|
435
|
+
s([
|
|
436
|
+
d()
|
|
437
|
+
], c.prototype, "wrapperStyle", 2);
|
|
438
|
+
s([
|
|
439
|
+
d()
|
|
440
|
+
], c.prototype, "components", 2);
|
|
441
|
+
s([
|
|
442
|
+
d()
|
|
443
|
+
], c.prototype, "editing", 2);
|
|
444
|
+
c = s([
|
|
445
|
+
f("rich-text-block")
|
|
446
|
+
], c);
|
|
447
|
+
export {
|
|
448
|
+
c as RichTextContainer
|
|
449
|
+
};
|
|
@@ -0,0 +1,229 @@
|
|
|
1
|
+
import { ae as BaseElementBlock, $ as $components, aM as renderComponent, ak as setCurrentComponentIdAction, ap as setContextMenuEvent } from './BaseElement-pS6m_x6Q.js';
|
|
2
|
+
import { css, nothing, html } from 'lit';
|
|
3
|
+
import { property, state, customElement } from 'lit/decorators.js';
|
|
4
|
+
import { styleMap } from 'lit/directives/style-map.js';
|
|
5
|
+
import { createRef, ref } from 'lit/directives/ref.js';
|
|
6
|
+
import '@nuralyui/grid';
|
|
7
|
+
|
|
8
|
+
const styles = css`
|
|
9
|
+
:host {
|
|
10
|
+
display: block;
|
|
11
|
+
width: 100%;
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
.grid-row {
|
|
15
|
+
display: flex;
|
|
16
|
+
flex-flow: row wrap;
|
|
17
|
+
min-width: 0;
|
|
18
|
+
width: 100%;
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
.grid-row.no-wrap {
|
|
22
|
+
flex-wrap: nowrap;
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
/* Alignment */
|
|
26
|
+
.grid-row.align-top {
|
|
27
|
+
align-items: flex-start;
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
.grid-row.align-middle {
|
|
31
|
+
align-items: center;
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
.grid-row.align-bottom {
|
|
35
|
+
align-items: flex-end;
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
.grid-row.align-stretch {
|
|
39
|
+
align-items: stretch;
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
/* Justify */
|
|
43
|
+
.grid-row.justify-start {
|
|
44
|
+
justify-content: flex-start;
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
.grid-row.justify-end {
|
|
48
|
+
justify-content: flex-end;
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
.grid-row.justify-center {
|
|
52
|
+
justify-content: center;
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
.grid-row.justify-space-around {
|
|
56
|
+
justify-content: space-around;
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
.grid-row.justify-space-between {
|
|
60
|
+
justify-content: space-between;
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
.grid-row.justify-space-evenly {
|
|
64
|
+
justify-content: space-evenly;
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
.empty-message {
|
|
68
|
+
display: flex;
|
|
69
|
+
justify-content: center;
|
|
70
|
+
align-items: center;
|
|
71
|
+
width: 100%;
|
|
72
|
+
min-height: 100px;
|
|
73
|
+
border: 2px dashed #ccc;
|
|
74
|
+
color: #999;
|
|
75
|
+
font-size: 14px;
|
|
76
|
+
position: relative;
|
|
77
|
+
}
|
|
78
|
+
`;
|
|
79
|
+
|
|
80
|
+
var __defProp = Object.defineProperty;
|
|
81
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
82
|
+
var __decorateClass = (decorators, target, key, kind) => {
|
|
83
|
+
var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc(target, key) : target;
|
|
84
|
+
for (var i = decorators.length - 1, decorator; i >= 0; i--)
|
|
85
|
+
if (decorator = decorators[i])
|
|
86
|
+
result = (kind ? decorator(target, key, result) : decorator(result)) || result;
|
|
87
|
+
if (kind && result) __defProp(target, key, result);
|
|
88
|
+
return result;
|
|
89
|
+
};
|
|
90
|
+
const ROW_INPUT_PROPS = ["gutter", "align", "justify", "wrap"];
|
|
91
|
+
let GridRow = class extends BaseElementBlock {
|
|
92
|
+
constructor() {
|
|
93
|
+
super(...arguments);
|
|
94
|
+
this.isViewMode = false;
|
|
95
|
+
this.childrenComponents = [];
|
|
96
|
+
this.containerRef = createRef();
|
|
97
|
+
}
|
|
98
|
+
connectedCallback() {
|
|
99
|
+
super.connectedCallback();
|
|
100
|
+
this.updateChildrenComponents();
|
|
101
|
+
ROW_INPUT_PROPS.forEach((prop) => this.registerCallback(prop, () => this.requestUpdate()));
|
|
102
|
+
}
|
|
103
|
+
willUpdate(changedProperties) {
|
|
104
|
+
super.willUpdate(changedProperties);
|
|
105
|
+
if (changedProperties.has("component")) {
|
|
106
|
+
this.updateChildrenComponents();
|
|
107
|
+
}
|
|
108
|
+
}
|
|
109
|
+
updateChildrenComponents() {
|
|
110
|
+
this.childrenComponents = this.component?.childrenIds?.map((id) => {
|
|
111
|
+
return $components.get()[this.component?.application_id]?.find((component) => component.uuid === id);
|
|
112
|
+
}).filter(Boolean) ?? [];
|
|
113
|
+
}
|
|
114
|
+
/**
|
|
115
|
+
* Parse gutter value - supports number, [h, v] array, or responsive object
|
|
116
|
+
*/
|
|
117
|
+
parseGutter(gutter) {
|
|
118
|
+
if (!gutter) return 0;
|
|
119
|
+
if (typeof gutter === "number" || Array.isArray(gutter)) return gutter;
|
|
120
|
+
if (typeof gutter === "string" && !isNaN(Number(gutter))) return Number(gutter);
|
|
121
|
+
return gutter;
|
|
122
|
+
}
|
|
123
|
+
/**
|
|
124
|
+
* Get all row properties from input handlers
|
|
125
|
+
*/
|
|
126
|
+
getRowProps() {
|
|
127
|
+
const input = this.inputHandlersValue;
|
|
128
|
+
return {
|
|
129
|
+
gutter: this.parseGutter(input?.gutter),
|
|
130
|
+
align: input?.align || "",
|
|
131
|
+
justify: input?.justify || "",
|
|
132
|
+
wrap: input?.wrap !== false
|
|
133
|
+
};
|
|
134
|
+
}
|
|
135
|
+
/**
|
|
136
|
+
* Render children components
|
|
137
|
+
*/
|
|
138
|
+
renderChildren() {
|
|
139
|
+
return this.childrenComponents.length ? renderComponent(
|
|
140
|
+
this.childrenComponents.map((component) => ({ ...component, item: this.item })),
|
|
141
|
+
this.item,
|
|
142
|
+
this.isViewMode,
|
|
143
|
+
{ ...this.component, uniqueUUID: this.uniqueUUID }
|
|
144
|
+
) : nothing;
|
|
145
|
+
}
|
|
146
|
+
/**
|
|
147
|
+
* Render empty state placeholder for editor mode
|
|
148
|
+
*/
|
|
149
|
+
renderEmptyState() {
|
|
150
|
+
return html`
|
|
151
|
+
<div
|
|
152
|
+
class="empty-message"
|
|
153
|
+
@click="${() => setCurrentComponentIdAction(this.component?.uuid)}"
|
|
154
|
+
>
|
|
155
|
+
Add Grid Columns (nr-col) to this row
|
|
156
|
+
<drag-wrapper
|
|
157
|
+
.where=${"inside"}
|
|
158
|
+
.message=${"Drop inside"}
|
|
159
|
+
.component=${{ ...this.component }}
|
|
160
|
+
.inputRef=${this.inputRef}
|
|
161
|
+
.isDragInitiator=${this.isDragInitiator}
|
|
162
|
+
>
|
|
163
|
+
</drag-wrapper>
|
|
164
|
+
</div>
|
|
165
|
+
`;
|
|
166
|
+
}
|
|
167
|
+
renderComponent() {
|
|
168
|
+
const props = this.getRowProps();
|
|
169
|
+
if (this.isViewMode) {
|
|
170
|
+
return html`
|
|
171
|
+
<nr-row
|
|
172
|
+
${ref(this.inputRef)}
|
|
173
|
+
data-component-uuid=${this.component?.uuid}
|
|
174
|
+
data-component-name=${this.component?.name}
|
|
175
|
+
style=${styleMap(this.getStyles())}
|
|
176
|
+
.gutter=${props.gutter}
|
|
177
|
+
align=${props.align || nothing}
|
|
178
|
+
justify=${props.justify || nothing}
|
|
179
|
+
?wrap=${props.wrap}
|
|
180
|
+
>
|
|
181
|
+
${this.renderChildren()}
|
|
182
|
+
</nr-row>
|
|
183
|
+
`;
|
|
184
|
+
}
|
|
185
|
+
return html`
|
|
186
|
+
<nr-row
|
|
187
|
+
${ref(this.inputRef)}
|
|
188
|
+
${ref(this.containerRef)}
|
|
189
|
+
data-component-uuid=${this.component?.uuid}
|
|
190
|
+
data-component-name=${this.component?.name}
|
|
191
|
+
@click="${(e) => {
|
|
192
|
+
setContextMenuEvent(null);
|
|
193
|
+
this.executeEvent("onClick", e);
|
|
194
|
+
}}"
|
|
195
|
+
style=${styleMap({
|
|
196
|
+
...this.getStyles(),
|
|
197
|
+
"min-height": this.childrenComponents.length ? "auto" : "100px"
|
|
198
|
+
})}
|
|
199
|
+
.gutter=${props.gutter}
|
|
200
|
+
align=${props.align || nothing}
|
|
201
|
+
justify=${props.justify || nothing}
|
|
202
|
+
?wrap=${props.wrap}
|
|
203
|
+
>
|
|
204
|
+
${this.childrenComponents.length ? this.renderChildren() : this.renderEmptyState()}
|
|
205
|
+
</nr-row>
|
|
206
|
+
`;
|
|
207
|
+
}
|
|
208
|
+
};
|
|
209
|
+
GridRow.styles = styles;
|
|
210
|
+
__decorateClass([
|
|
211
|
+
property({ type: Object })
|
|
212
|
+
], GridRow.prototype, "component", 2);
|
|
213
|
+
__decorateClass([
|
|
214
|
+
property({ type: Object })
|
|
215
|
+
], GridRow.prototype, "item", 2);
|
|
216
|
+
__decorateClass([
|
|
217
|
+
property({ type: Boolean })
|
|
218
|
+
], GridRow.prototype, "isViewMode", 2);
|
|
219
|
+
__decorateClass([
|
|
220
|
+
state()
|
|
221
|
+
], GridRow.prototype, "childrenComponents", 2);
|
|
222
|
+
__decorateClass([
|
|
223
|
+
state()
|
|
224
|
+
], GridRow.prototype, "containerRef", 2);
|
|
225
|
+
GridRow = __decorateClass([
|
|
226
|
+
customElement("grid-row-block")
|
|
227
|
+
], GridRow);
|
|
228
|
+
|
|
229
|
+
export { GridRow };
|