@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.
Files changed (106) hide show
  1. package/dist/AIChat-DP3ZdLL3.js +220 -0
  2. package/dist/AIChat-km1IYaR-.js +260 -0
  3. package/dist/Badge-BR94MUt5.js +48 -0
  4. package/dist/Badge-DzNZFKtC.js +70 -0
  5. package/dist/{BaseElement-BNBn_IJk.js → BaseElement-pS6m_x6Q.js} +153 -24
  6. package/dist/Button-BHAN7npC.js +92 -0
  7. package/dist/Button-DCqgsxrL.js +80 -0
  8. package/dist/Card-B70c8NFb.js +150 -0
  9. package/dist/Card-DhOCsGKC.js +120 -0
  10. package/dist/Checkbox-BZTcPwew.js +59 -0
  11. package/dist/Checkbox-LYTIBAUV.js +65 -0
  12. package/dist/Code-BWbiciC8.js +123 -0
  13. package/dist/Code-Ds0vFclr.js +109 -0
  14. package/dist/{CodeEditor-Bf4L2rO_.js → CodeEditor-ChuFC0ex.js} +22 -22
  15. package/dist/Col-B_wpWUcU.js +217 -0
  16. package/dist/Col-DYs8_65c.js +193 -0
  17. package/dist/Collapse-4kxbQ74u.js +74 -0
  18. package/dist/Collapse-Dkw6Ner6.js +96 -0
  19. package/dist/Collections-BSF-PqBz.js +122 -0
  20. package/dist/Collections-D5rwMFbv.js +151 -0
  21. package/dist/Container-DMNh5U4Y.js +204 -0
  22. package/dist/DatePicker-BmEOONiA.js +99 -0
  23. package/dist/DatePicker-VuUroOT4.js +80 -0
  24. package/dist/Divider-BfxR3rVl.js +86 -0
  25. package/dist/Divider-etMTYU3d.js +106 -0
  26. package/dist/Document-CHBcJciR.js +74 -0
  27. package/dist/Document-Cj-TmjAf.js +90 -0
  28. package/dist/Dropdown-BRtHvDa3.js +133 -0
  29. package/dist/Dropdown-C47Y11dj.js +112 -0
  30. package/dist/EmbedURL-BwbJRnY1.js +142 -0
  31. package/dist/EmbedURL-Ci5X1vQG.js +114 -0
  32. package/dist/FileUpload-BBgPcRag.js +54 -0
  33. package/dist/FileUpload-BgkhxtNe.js +47 -0
  34. package/dist/Form-BLq6U3In.js +339 -0
  35. package/dist/Form-E6zXqgsm.js +286 -0
  36. package/dist/Icon-CcLuhz6B.js +64 -0
  37. package/dist/Icon-_UiLblGb.js +74 -0
  38. package/dist/Image-B_VERIvH.js +111 -0
  39. package/dist/Image-hI8kIx8U.js +93 -0
  40. package/dist/Link-BVTo43Cc.js +76 -0
  41. package/dist/Link-xSrPxOLt.js +95 -0
  42. package/dist/Menu-CembLIjO.js +83 -0
  43. package/dist/Menu-D9ZjIOMg.js +73 -0
  44. package/dist/MicroApp-DI1kQwJk.js +100 -0
  45. package/dist/MicroApp-DJw57sLE.js +75 -0
  46. package/dist/NumberInput-DftAAKEs.js +84 -0
  47. package/dist/NumberInput-eOAk0-fb.js +95 -0
  48. package/dist/Panel-Bso5fv4i.js +127 -0
  49. package/dist/Panel-CwzW9iuA.js +161 -0
  50. package/dist/Radio-button-Sii5iveh.js +71 -0
  51. package/dist/Radio-button-YXsVqipQ.js +53 -0
  52. package/dist/RefComponent-Bwk_I0mK.js +79 -0
  53. package/dist/RefComponent-ZxafRVhZ.js +96 -0
  54. package/dist/RichText-CgYXXC_a.js +485 -0
  55. package/dist/RichText-DV46U7fI.js +449 -0
  56. package/dist/Row-Bb95f5DI.js +229 -0
  57. package/dist/Row-Dmd_61mR.js +202 -0
  58. package/dist/Select-Cma8JHAj.js +77 -0
  59. package/dist/Select-DqA08VYb.js +87 -0
  60. package/dist/Slider-B2_Qecjz.js +74 -0
  61. package/dist/Slider-DVY0N2YX.js +55 -0
  62. package/dist/Table-0WjrBnz-.js +159 -0
  63. package/dist/Table-dEma50kw.js +184 -0
  64. package/dist/Tabs-BDKEv1jn.js +131 -0
  65. package/dist/Tabs-Cvt3Q8vx.js +116 -0
  66. package/dist/Tag-BcZvQkE_.js +47 -0
  67. package/dist/Tag-DMZ0mu8y.js +61 -0
  68. package/dist/TextInput-KI6r9xET.js +193 -0
  69. package/dist/TextInput-hxK-HhJi.js +148 -0
  70. package/dist/TextLabel-DkV26yaL.js +102 -0
  71. package/dist/Textarea-Bzs3jSUm.js +117 -0
  72. package/dist/Textarea-CwK3SYbz.js +83 -0
  73. package/dist/Video-C4uBWCBb.js +100 -0
  74. package/dist/Video-CL1lgcvB.js +120 -0
  75. package/dist/aitchat-DjX5s7_8.js +23 -0
  76. package/dist/colorpicker-B-KETfWw.js +64 -0
  77. package/dist/colorpicker-DhB0AygJ.js +75 -0
  78. package/dist/constants-Bs_KQRi_.js +4 -0
  79. package/dist/constants-CXdpxgF2.js +4 -0
  80. package/dist/{cssMode-DMsdy1N0.js → cssMode-CV7QbFJv.js} +1 -1
  81. package/dist/{freemarker2-D51H9HYi.js → freemarker2-CqQxSEZa.js} +1 -1
  82. package/dist/{handlebars-CF6gdAX4.js → handlebars-a71LdN7X.js} +1 -1
  83. package/dist/{html-c2n_zkM3.js → html-D8UaB7IC.js} +1 -1
  84. package/dist/{htmlMode-9IJTuZUh.js → htmlMode-CqWQMFWX.js} +1 -1
  85. package/dist/iconbutton-DfnrRmmB.js +69 -0
  86. package/dist/iconbutton-DvIQHV8o.js +53 -0
  87. package/dist/{javascript-DhEEBMxD.js → javascript-D_jGqcRD.js} +1 -1
  88. package/dist/{jsonMode-CB6k-4rp.js → jsonMode-C3-m5xts.js} +1 -1
  89. package/dist/{liquid-CwtPiwnW.js → liquid-DLwYj6Te.js} +1 -1
  90. package/dist/{mdx-LewPRYF8.js → mdx-DhYjhxkW.js} +1 -1
  91. package/dist/micro-app-entry-DiNqE6xi.js +12042 -0
  92. package/dist/micro-app.bundle.js +1 -1
  93. package/dist/micro-app.js +6 -4940
  94. package/dist/{python-h5Z2g-yl.js → python-B-WcGqFq.js} +1 -1
  95. package/dist/{razor-D5ep1Doy.js → razor-JGACy1mz.js} +1 -1
  96. package/dist/runtime.js +4 -2
  97. package/dist/{tsMode-B_6LiBE1.js → tsMode-lzBM1oT2.js} +1 -1
  98. package/dist/{typescript-BBG0jH4p.js → typescript-CuL5pdO2.js} +1 -1
  99. package/dist/{xml-DgLB7rE6.js → xml-D1tacAKD.js} +1 -1
  100. package/dist/{yaml-DiI4HpSv.js → yaml-CjPB1g7v.js} +1 -1
  101. package/package.json +4 -1
  102. package/utils/index.ts +4 -1
  103. package/utils/lazy-component-loader.ts +120 -0
  104. package/utils/register-components.ts +14 -40
  105. package/utils/render-util.ts +84 -0
  106. package/dist/micro-app-entry-C3RDIukG.js +0 -15831
@@ -0,0 +1,106 @@
1
+ import { nothing, html, css } from 'lit';
2
+ import { property, customElement } from 'lit/decorators.js';
3
+ import { styleMap } from 'lit/directives/style-map.js';
4
+ import { ae as BaseElementBlock } from './BaseElement-pS6m_x6Q.js';
5
+ import { ref } from 'lit/directives/ref.js';
6
+
7
+ var __defProp = Object.defineProperty;
8
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
9
+ var __decorateClass = (decorators, target, key, kind) => {
10
+ var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc(target, key) : target;
11
+ for (var i = decorators.length - 1, decorator; i >= 0; i--)
12
+ if (decorator = decorators[i])
13
+ result = (kind ? decorator(target, key, result) : decorator(result)) || result;
14
+ if (kind && result) __defProp(target, key, result);
15
+ return result;
16
+ };
17
+ try {
18
+ await import('@nuralyui/divider');
19
+ } catch (error) {
20
+ console.warn("[@nuralyui/divider] Package not found or failed to load.");
21
+ }
22
+ let DividerBlock = class extends BaseElementBlock {
23
+ connectedCallback() {
24
+ super.connectedCallback();
25
+ this.registerCallback("value", () => {
26
+ });
27
+ this.updateHostAttribute();
28
+ }
29
+ updated(changedProperties) {
30
+ super.updated(changedProperties);
31
+ this.updateHostAttribute();
32
+ }
33
+ updateHostAttribute() {
34
+ const direction = this.inputHandlersValue?.direction ?? "horizontal";
35
+ this.setAttribute("data-type", direction);
36
+ }
37
+ disconnectedCallback() {
38
+ super.disconnectedCallback();
39
+ if (this.unsubscribe) this.unsubscribe();
40
+ }
41
+ render() {
42
+ const dividerStyles = this.component?.style || {};
43
+ const dividerAutoWidth = this.inputHandlersValue?.width;
44
+ const dividerAutoHeight = this.inputHandlersValue?.height;
45
+ const isVertical = (this.inputHandlersValue?.direction ?? "horizontal") === "vertical";
46
+ const filteredStyles = { ...dividerStyles };
47
+ if (isVertical && dividerAutoHeight) {
48
+ delete filteredStyles.height;
49
+ }
50
+ return html`
51
+ ${!this.inputHandlersValue?.display || this.inputHandlersValue.display == "show" ? html`
52
+ <nr-divider
53
+ ${ref(this.inputRef)}
54
+ style=${styleMap({
55
+ ...filteredStyles,
56
+ width: dividerAutoWidth ? "100%" : dividerStyles.width,
57
+ height: !isVertical && dividerAutoHeight ? "auto" : filteredStyles.height
58
+ })}
59
+ type=${this.inputHandlersValue?.direction ?? "horizontal"}
60
+ .variant=${this.inputHandlersValue?.variant || "solid"}
61
+ .orientation=${this.inputHandlersValue?.textOrientation || "center"}
62
+ .orientationMargin=${this.inputHandlersValue?.orientationMargin ?? nothing}
63
+ .plain=${this.inputHandlersValue?.plain !== false}
64
+ .size=${this.inputHandlersValue?.size ?? nothing}
65
+ .dashed=${this.inputHandlersValue?.dashed || false}
66
+ @click=${(e) => {
67
+ this.executeEvent("onClick", e);
68
+ }}
69
+ >
70
+ ${this.inputHandlersValue?.text || ""}
71
+ </nr-divider>
72
+ ` : nothing}
73
+ `;
74
+ }
75
+ };
76
+ DividerBlock.styles = [
77
+ css`
78
+ :host {
79
+ display: block;
80
+ width: 100%;
81
+ }
82
+
83
+ :host([data-type="vertical"]) {
84
+ display: inline-flex;
85
+ width: auto;
86
+ align-self: stretch; /* This makes it fill the parent's height in flexbox */
87
+ }
88
+
89
+ :host([data-type="vertical"]) nr-divider {
90
+ height: 100%;
91
+ display: flex;
92
+ align-items: stretch;
93
+ }
94
+ `
95
+ ];
96
+ __decorateClass([
97
+ property({ type: Object })
98
+ ], DividerBlock.prototype, "component", 2);
99
+ __decorateClass([
100
+ property({ type: Object })
101
+ ], DividerBlock.prototype, "item", 2);
102
+ DividerBlock = __decorateClass([
103
+ customElement("divider-block")
104
+ ], DividerBlock);
105
+
106
+ export { DividerBlock };
@@ -0,0 +1,74 @@
1
+ import { B as p, n as s, o as a, b as d, i as u, c as m, t as y } from "./micro-app-entry-DiNqE6xi.js";
2
+ var f = Object.defineProperty, v = Object.getOwnPropertyDescriptor, h = (r, t, o, i) => {
3
+ for (var n = i > 1 ? void 0 : i ? v(t, o) : t, e = r.length - 1, c; e >= 0; e--)
4
+ (c = r[e]) && (n = (i ? c(t, o, n) : c(n)) || n);
5
+ return i && n && f(t, o, n), n;
6
+ };
7
+ try {
8
+ await import("@nuralyui/document");
9
+ } catch {
10
+ console.warn("[@nuralyui/document] Package not found or failed to load.");
11
+ }
12
+ let l = class extends p {
13
+ renderComponent() {
14
+ const r = this.getStyles() || {}, t = this.component?.styleHandlers ? Object.fromEntries(
15
+ Object.entries(this.component?.styleHandlers).filter(([e, c]) => c)
16
+ ) : {}, o = this.inputHandlersValue?.src, i = this.inputHandlersValue?.type ?? "pdf", n = this.inputHandlersValue?.previewable ?? !1;
17
+ return o ? d`
18
+ <nr-document-viewer
19
+ ${s(this.inputRef)}
20
+ style=${a({
21
+ ...this.getStyles()
22
+ })}
23
+ .src=${o}
24
+ .type=${i}
25
+ .previewable=${n}
26
+ .width=${t?.width || r?.width}
27
+ .height=${t?.height || r?.height}
28
+ @click=${(e) => this.executeEvent("onClick", e)}
29
+ @load=${(e) => this.executeEvent("onLoad", e, { src: o })}
30
+ @error=${(e) => this.executeEvent("onError", e, { src: o, error: "Failed to load document" })}
31
+ >
32
+ </nr-document-viewer>
33
+ ` : d`
34
+ <div
35
+ ${s(this.inputRef)}
36
+ class="document-placeholder"
37
+ style=${a({
38
+ ...this.getStyles(),
39
+ width: t?.width || r?.width || "100%",
40
+ height: t?.height || r?.height || "200px"
41
+ })}
42
+ @click=${(e) => this.executeEvent("onClick", e)}
43
+ >
44
+ <nr-icon name="file-text"></nr-icon>
45
+ <nr-label>No document source</nr-label>
46
+ </div>
47
+ `;
48
+ }
49
+ };
50
+ l.styles = [u`
51
+ .document-placeholder {
52
+ display: flex;
53
+ flex-direction: column;
54
+ align-items: center;
55
+ justify-content: center;
56
+ color: #64748b;
57
+ min-height: 200px;
58
+ border-radius: 8px;
59
+ border: 2px dashed #cbd5e1;
60
+ gap: 12px;
61
+ }
62
+ .document-placeholder nr-icon {
63
+ --nuraly-icon-size: 48px;
64
+ }
65
+ `];
66
+ h([
67
+ m({ type: Object })
68
+ ], l.prototype, "component", 2);
69
+ l = h([
70
+ y("document-block")
71
+ ], l);
72
+ export {
73
+ l as DocumentBlock
74
+ };
@@ -0,0 +1,90 @@
1
+ import { html, css } from 'lit';
2
+ import { property, customElement } from 'lit/decorators.js';
3
+ import { ae as BaseElementBlock } from './BaseElement-pS6m_x6Q.js';
4
+ import { styleMap } from 'lit/directives/style-map.js';
5
+ import { ref } from 'lit/directives/ref.js';
6
+
7
+ var __defProp = Object.defineProperty;
8
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
9
+ var __decorateClass = (decorators, target, key, kind) => {
10
+ var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc(target, key) : target;
11
+ for (var i = decorators.length - 1, decorator; i >= 0; i--)
12
+ if (decorator = decorators[i])
13
+ result = (kind ? decorator(target, key, result) : decorator(result)) || result;
14
+ if (kind && result) __defProp(target, key, result);
15
+ return result;
16
+ };
17
+ try {
18
+ await import('@nuralyui/document');
19
+ } catch (error) {
20
+ console.warn("[@nuralyui/document] Package not found or failed to load.");
21
+ }
22
+ let DocumentBlock = class extends BaseElementBlock {
23
+ renderComponent() {
24
+ const documentStyles = this.getStyles() || {};
25
+ const documentStyleHandlers = this.component?.styleHandlers ? Object.fromEntries(
26
+ Object.entries(this.component?.styleHandlers).filter(([key, value]) => value)
27
+ ) : {};
28
+ const src = this.inputHandlersValue?.src;
29
+ const type = this.inputHandlersValue?.type ?? "pdf";
30
+ const previewable = this.inputHandlersValue?.previewable ?? false;
31
+ if (!src) {
32
+ return html`
33
+ <div
34
+ ${ref(this.inputRef)}
35
+ class="document-placeholder"
36
+ style=${styleMap({
37
+ ...this.getStyles(),
38
+ width: documentStyleHandlers?.width || documentStyles?.width || "100%",
39
+ height: documentStyleHandlers?.height || documentStyles?.height || "200px"
40
+ })}
41
+ @click=${(e) => this.executeEvent("onClick", e)}
42
+ >
43
+ <nr-icon name="file-text"></nr-icon>
44
+ <nr-label>No document source</nr-label>
45
+ </div>
46
+ `;
47
+ }
48
+ return html`
49
+ <nr-document-viewer
50
+ ${ref(this.inputRef)}
51
+ style=${styleMap({
52
+ ...this.getStyles()
53
+ })}
54
+ .src=${src}
55
+ .type=${type}
56
+ .previewable=${previewable}
57
+ .width=${documentStyleHandlers?.width || documentStyles?.width}
58
+ .height=${documentStyleHandlers?.height || documentStyles?.height}
59
+ @click=${(e) => this.executeEvent("onClick", e)}
60
+ @load=${(e) => this.executeEvent("onLoad", e, { src })}
61
+ @error=${(e) => this.executeEvent("onError", e, { src, error: "Failed to load document" })}
62
+ >
63
+ </nr-document-viewer>
64
+ `;
65
+ }
66
+ };
67
+ DocumentBlock.styles = [css`
68
+ .document-placeholder {
69
+ display: flex;
70
+ flex-direction: column;
71
+ align-items: center;
72
+ justify-content: center;
73
+ color: #64748b;
74
+ min-height: 200px;
75
+ border-radius: 8px;
76
+ border: 2px dashed #cbd5e1;
77
+ gap: 12px;
78
+ }
79
+ .document-placeholder nr-icon {
80
+ --nuraly-icon-size: 48px;
81
+ }
82
+ `];
83
+ __decorateClass([
84
+ property({ type: Object })
85
+ ], DocumentBlock.prototype, "component", 2);
86
+ DocumentBlock = __decorateClass([
87
+ customElement("document-block")
88
+ ], DocumentBlock);
89
+
90
+ export { DocumentBlock };
@@ -0,0 +1,133 @@
1
+ import { nothing, html } from 'lit';
2
+ import { property, state, customElement } from 'lit/decorators.js';
3
+ import { styleMap } from 'lit/directives/style-map.js';
4
+ import { ae as BaseElementBlock, $ as $components, aM as renderComponent } from './BaseElement-pS6m_x6Q.js';
5
+ import { ref } from 'lit/directives/ref.js';
6
+
7
+ var __defProp = Object.defineProperty;
8
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
9
+ var __decorateClass = (decorators, target, key, kind) => {
10
+ var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc(target, key) : target;
11
+ for (var i = decorators.length - 1, decorator; i >= 0; i--)
12
+ if (decorator = decorators[i])
13
+ result = (kind ? decorator(target, key, result) : decorator(result)) || result;
14
+ if (kind && result) __defProp(target, key, result);
15
+ return result;
16
+ };
17
+ try {
18
+ await import('@nuralyui/dropdown');
19
+ } catch (error) {
20
+ console.warn("[@nuralyui/dropdown] Package not found or failed to load. Dropdown functionality may be limited.");
21
+ }
22
+ let DropdownBlock = class extends BaseElementBlock {
23
+ constructor() {
24
+ super();
25
+ this.childrenComponents = [];
26
+ this.options = [
27
+ { label: "Copy", value: "Copy", icon: "copy" },
28
+ { label: "Paste", value: "Paste", icon: "paste" },
29
+ { label: "Delete", value: "Delete", icon: "trash" },
30
+ { label: "Export", value: "value12" },
31
+ { label: "Import", value: "value12" }
32
+ ];
33
+ }
34
+ connectedCallback() {
35
+ super.connectedCallback();
36
+ this.registerCallback("value", (v) => {
37
+ this.requestUpdate();
38
+ });
39
+ }
40
+ updateChildrenComponents() {
41
+ this.childrenComponents = this.component?.childrenIds?.map((id) => {
42
+ return $components.get()[this.component?.application_id]?.find(
43
+ (component) => component.uuid === id
44
+ );
45
+ }).filter(Boolean) ?? [];
46
+ }
47
+ updated(changedProperties) {
48
+ if (changedProperties.has("component")) {
49
+ this.updateChildrenComponents();
50
+ }
51
+ }
52
+ renderComponent() {
53
+ const options = this.inputHandlersValue?.value?.[0] ?? [];
54
+ const dropdownStyles = this.component?.style || {};
55
+ const size = dropdownStyles.size || "medium";
56
+ const placement = dropdownStyles.placement || "bottom";
57
+ const trigger = dropdownStyles.trigger || "click";
58
+ const animation = dropdownStyles.animation || "fade";
59
+ return html`
60
+ <nr-dropdown
61
+ .open=${this.inputHandlersValue.show || false}
62
+ ${ref(this.inputRef)}
63
+ style=${styleMap({
64
+ ...this.getStyles()
65
+ })}
66
+ .trigger=${trigger}
67
+ .placement=${placement}
68
+ .size=${size}
69
+ .animation=${animation}
70
+ .disabled=${this.inputHandlersValue?.state == "disabled"}
71
+ .items=${this.inputHandlersValue.options || options}
72
+ .arrow=${dropdownStyles.arrow === "true" || this.inputHandlersValue.arrow || false}
73
+ .autoClose=${dropdownStyles.autoClose !== "false" && this.inputHandlersValue.autoClose !== false}
74
+ .closeOnOutsideClick=${dropdownStyles.closeOnOutsideClick !== "false" && this.inputHandlersValue.closeOnOutsideClick !== false}
75
+ .closeOnEscape=${dropdownStyles.closeOnEscape !== "false" && this.inputHandlersValue.closeOnEscape !== false}
76
+ .offset=${this.inputHandlersValue.offset || 4}
77
+ .delay=${this.inputHandlersValue.delay || 50}
78
+ .maxHeight=${this.inputHandlersValue.maxHeight || "300px"}
79
+ .minWidth=${this.inputHandlersValue.minWidth || "auto"}
80
+ .cascadeDirection=${this.inputHandlersValue.cascadeDirection || "auto"}
81
+ .cascadeDelay=${this.inputHandlersValue.cascadeDelay || 50}
82
+ .cascadeOnHover=${this.inputHandlersValue.cascadeOnHover !== false}
83
+ @nr-dropdown-item-click=${(e) => {
84
+ const item = e.detail.item;
85
+ this.executeEvent("onItemClick", e, {
86
+ value: item.value,
87
+ item,
88
+ additionalData: item.additionalData
89
+ });
90
+ }}
91
+ @nr-dropdown-open=${(e) => {
92
+ this.executeEvent("onOpen", e);
93
+ }}
94
+ @nr-dropdown-close=${(e) => {
95
+ this.executeEvent("onClose", e);
96
+ }}
97
+ >
98
+ <span slot="trigger">
99
+ ${this.childrenComponents.length ? renderComponent(this.childrenComponents.map((component) => ({ ...component, item: this.item })), this.item, this.isViewMode) : html`
100
+ <nr-label
101
+ style=${styleMap({
102
+ "--resolved-text-label-color": this.getStyles()["title-color"]
103
+ })}
104
+ >${this.inputHandlersValue?.label ?? this.inputHandlersValue?.placeholder ?? nothing}</nr-label>
105
+
106
+ <drag-wrapper
107
+ .where=${"inside"}
108
+ .message=${"Drop inside"}
109
+ .component=${{ ...this.component }}
110
+ .inputRef=${this.inputRef}
111
+ .isDragInitiator=${this.isDragInitiator}
112
+ >
113
+ </drag-wrapper>
114
+ `}
115
+ </span>
116
+ </nr-dropdown>
117
+ `;
118
+ }
119
+ };
120
+ __decorateClass([
121
+ property({ type: Object })
122
+ ], DropdownBlock.prototype, "component", 2);
123
+ __decorateClass([
124
+ state()
125
+ ], DropdownBlock.prototype, "childrenComponents", 2);
126
+ __decorateClass([
127
+ state()
128
+ ], DropdownBlock.prototype, "options", 2);
129
+ DropdownBlock = __decorateClass([
130
+ customElement("dropdown-block")
131
+ ], DropdownBlock);
132
+
133
+ export { DropdownBlock };
@@ -0,0 +1,112 @@
1
+ import { B as h, $ as m, n as $, o as d, r as f, A as C, b as c, c as v, d as u, t as w } from "./micro-app-entry-DiNqE6xi.js";
2
+ var b = Object.defineProperty, g = Object.getOwnPropertyDescriptor, r = (n, e, o, s) => {
3
+ for (var a = s > 1 ? void 0 : s ? g(e, o) : e, i = n.length - 1, t; i >= 0; i--)
4
+ (t = n[i]) && (a = (s ? t(e, o, a) : t(a)) || a);
5
+ return s && a && b(e, o, a), a;
6
+ };
7
+ try {
8
+ await import("@nuralyui/dropdown");
9
+ } catch {
10
+ console.warn("[@nuralyui/dropdown] Package not found or failed to load. Dropdown functionality may be limited.");
11
+ }
12
+ let l = class extends h {
13
+ constructor() {
14
+ super(), this.childrenComponents = [], this.options = [
15
+ { label: "Copy", value: "Copy", icon: "copy" },
16
+ { label: "Paste", value: "Paste", icon: "paste" },
17
+ { label: "Delete", value: "Delete", icon: "trash" },
18
+ { label: "Export", value: "value12" },
19
+ { label: "Import", value: "value12" }
20
+ ];
21
+ }
22
+ connectedCallback() {
23
+ super.connectedCallback(), this.registerCallback("value", (n) => {
24
+ this.requestUpdate();
25
+ });
26
+ }
27
+ updateChildrenComponents() {
28
+ this.childrenComponents = this.component?.childrenIds?.map((n) => m.get()[this.component?.application_id]?.find(
29
+ (e) => e.uuid === n
30
+ )).filter(Boolean) ?? [];
31
+ }
32
+ updated(n) {
33
+ n.has("component") && this.updateChildrenComponents();
34
+ }
35
+ renderComponent() {
36
+ const n = this.inputHandlersValue?.value?.[0] ?? [], e = this.component?.style || {}, o = e.size || "medium", s = e.placement || "bottom", a = e.trigger || "click", i = e.animation || "fade";
37
+ return c`
38
+ <nr-dropdown
39
+ .open=${this.inputHandlersValue.show || !1}
40
+ ${$(this.inputRef)}
41
+ style=${d({
42
+ ...this.getStyles()
43
+ })}
44
+ .trigger=${a}
45
+ .placement=${s}
46
+ .size=${o}
47
+ .animation=${i}
48
+ .disabled=${this.inputHandlersValue?.state == "disabled"}
49
+ .items=${this.inputHandlersValue.options || n}
50
+ .arrow=${e.arrow === "true" || this.inputHandlersValue.arrow || !1}
51
+ .autoClose=${e.autoClose !== "false" && this.inputHandlersValue.autoClose !== !1}
52
+ .closeOnOutsideClick=${e.closeOnOutsideClick !== "false" && this.inputHandlersValue.closeOnOutsideClick !== !1}
53
+ .closeOnEscape=${e.closeOnEscape !== "false" && this.inputHandlersValue.closeOnEscape !== !1}
54
+ .offset=${this.inputHandlersValue.offset || 4}
55
+ .delay=${this.inputHandlersValue.delay || 50}
56
+ .maxHeight=${this.inputHandlersValue.maxHeight || "300px"}
57
+ .minWidth=${this.inputHandlersValue.minWidth || "auto"}
58
+ .cascadeDirection=${this.inputHandlersValue.cascadeDirection || "auto"}
59
+ .cascadeDelay=${this.inputHandlersValue.cascadeDelay || 50}
60
+ .cascadeOnHover=${this.inputHandlersValue.cascadeOnHover !== !1}
61
+ @nr-dropdown-item-click=${(t) => {
62
+ const p = t.detail.item;
63
+ this.executeEvent("onItemClick", t, {
64
+ value: p.value,
65
+ item: p,
66
+ additionalData: p.additionalData
67
+ });
68
+ }}
69
+ @nr-dropdown-open=${(t) => {
70
+ this.executeEvent("onOpen", t);
71
+ }}
72
+ @nr-dropdown-close=${(t) => {
73
+ this.executeEvent("onClose", t);
74
+ }}
75
+ >
76
+ <span slot="trigger">
77
+ ${this.childrenComponents.length ? f(this.childrenComponents.map((t) => ({ ...t, item: this.item })), this.item, this.isViewMode) : c`
78
+ <nr-label
79
+ style=${d({
80
+ "--resolved-text-label-color": this.getStyles()["title-color"]
81
+ })}
82
+ >${this.inputHandlersValue?.label ?? this.inputHandlersValue?.placeholder ?? C}</nr-label>
83
+
84
+ <drag-wrapper
85
+ .where=${"inside"}
86
+ .message=${"Drop inside"}
87
+ .component=${{ ...this.component }}
88
+ .inputRef=${this.inputRef}
89
+ .isDragInitiator=${this.isDragInitiator}
90
+ >
91
+ </drag-wrapper>
92
+ `}
93
+ </span>
94
+ </nr-dropdown>
95
+ `;
96
+ }
97
+ };
98
+ r([
99
+ v({ type: Object })
100
+ ], l.prototype, "component", 2);
101
+ r([
102
+ u()
103
+ ], l.prototype, "childrenComponents", 2);
104
+ r([
105
+ u()
106
+ ], l.prototype, "options", 2);
107
+ l = r([
108
+ w("dropdown-block")
109
+ ], l);
110
+ export {
111
+ l as DropdownBlock
112
+ };
@@ -0,0 +1,142 @@
1
+ import { html, css } from 'lit';
2
+ import { property, state, customElement } from 'lit/decorators.js';
3
+ import { styleMap } from 'lit/directives/style-map.js';
4
+ import { ref } from 'lit/directives/ref.js';
5
+ import { ae as BaseElementBlock } from './BaseElement-pS6m_x6Q.js';
6
+
7
+ var __defProp = Object.defineProperty;
8
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
9
+ var __decorateClass = (decorators, target, key, kind) => {
10
+ var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc(target, key) : target;
11
+ for (var i = decorators.length - 1, decorator; i >= 0; i--)
12
+ if (decorator = decorators[i])
13
+ result = (kind ? decorator(target, key, result) : decorator(result)) || result;
14
+ if (kind && result) __defProp(target, key, result);
15
+ return result;
16
+ };
17
+ let EmbedUrlBlock = class extends BaseElementBlock {
18
+ constructor() {
19
+ super();
20
+ this.currentUrl = "";
21
+ this._isUserFocused = false;
22
+ this._focusResetTimeout = null;
23
+ this.iframeRef = ref();
24
+ this.onFocus = (e) => {
25
+ this._isUserFocused = true;
26
+ this.executeEvent("onFocus", e);
27
+ };
28
+ this.onBlur = (e) => {
29
+ this._isUserFocused = false;
30
+ this.executeEvent("onBlur", e);
31
+ };
32
+ }
33
+ firstUpdated(_changedProperties) {
34
+ super.firstUpdated(_changedProperties);
35
+ this.registerCallback("url", (url) => {
36
+ if (!this._isUserFocused && this.currentUrl !== url) {
37
+ this.currentUrl = url ?? "";
38
+ }
39
+ });
40
+ }
41
+ handleIframeLoad(e) {
42
+ this.executeEvent("onLoad", e, {
43
+ url: this.currentUrl || this.inputHandlersValue?.url || ""
44
+ });
45
+ }
46
+ handleIframeError(e) {
47
+ this.executeEvent("onError", e, {
48
+ url: this.currentUrl || this.inputHandlersValue?.url || "",
49
+ error: "Failed to load iframe content"
50
+ });
51
+ }
52
+ resetFocusAfterInactivity() {
53
+ if (this._focusResetTimeout) clearTimeout(this._focusResetTimeout);
54
+ this._focusResetTimeout = setTimeout(() => {
55
+ this._isUserFocused = false;
56
+ }, 3e3);
57
+ }
58
+ disconnectedCallback() {
59
+ super.disconnectedCallback();
60
+ if (this.unsubscribe) this.unsubscribe();
61
+ if (this._focusResetTimeout) clearTimeout(this._focusResetTimeout);
62
+ }
63
+ renderComponent() {
64
+ const embedStyles = this.getStyles() || {};
65
+ const embedStyleHandlers = this.component?.styleHandlers ? Object.fromEntries(
66
+ Object.entries(this.component?.styleHandlers).filter(([key, value]) => value)
67
+ ) : {};
68
+ const url = this.currentUrl || this.inputHandlersValue?.url || "";
69
+ if (!url) {
70
+ return html`
71
+ <div
72
+ ${ref(this.inputRef)}
73
+ class="embed-placeholder"
74
+ style=${styleMap({
75
+ ...this.getStyles(),
76
+ width: embedStyleHandlers?.width || embedStyles?.width || "100%",
77
+ height: embedStyleHandlers?.height || embedStyles?.height || "200px"
78
+ })}
79
+ @click=${(e) => this.executeEvent("onClick", e)}
80
+ >
81
+ <nr-icon name="globe"></nr-icon>
82
+ <nr-label>No URL provided</nr-label>
83
+ </div>
84
+ `;
85
+ }
86
+ return html`
87
+ <div
88
+ ${ref(this.inputRef)}
89
+ tabindex="0"
90
+ @focus=${this.onFocus}
91
+ @blur=${this.onBlur}
92
+ @click=${(e) => this.executeEvent("onClick", e)}
93
+ style=${styleMap(this.getStyles())}
94
+ >
95
+ <iframe
96
+ ${ref(this.iframeRef)}
97
+ src=${url}
98
+ @load=${(e) => this.handleIframeLoad(e)}
99
+ @error=${(e) => this.handleIframeError(e)}
100
+ ></iframe>
101
+ </div>
102
+ `;
103
+ }
104
+ };
105
+ EmbedUrlBlock.styles = [css`
106
+ iframe {
107
+ width: 100%;
108
+ height: 100%;
109
+ border: none;
110
+ }
111
+ .embed-placeholder {
112
+ display: flex;
113
+ flex-direction: column;
114
+ align-items: center;
115
+ justify-content: center;
116
+ color: #64748b;
117
+ min-height: 200px;
118
+ border-radius: 8px;
119
+ border: 2px dashed #cbd5e1;
120
+ gap: 12px;
121
+ }
122
+ .embed-placeholder nr-icon {
123
+ --nuraly-icon-size: 48px;
124
+ }
125
+ `];
126
+ __decorateClass([
127
+ property({ type: Object })
128
+ ], EmbedUrlBlock.prototype, "component", 2);
129
+ __decorateClass([
130
+ property({ type: Object })
131
+ ], EmbedUrlBlock.prototype, "item", 2);
132
+ __decorateClass([
133
+ state()
134
+ ], EmbedUrlBlock.prototype, "currentUrl", 2);
135
+ __decorateClass([
136
+ state()
137
+ ], EmbedUrlBlock.prototype, "_isUserFocused", 2);
138
+ EmbedUrlBlock = __decorateClass([
139
+ customElement("embed-url-block")
140
+ ], EmbedUrlBlock);
141
+
142
+ export { EmbedUrlBlock };