@astrato-io/visualizations 0.6.5 → 0.8.0
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/README.md +8 -2
- package/THIRD_PARTY_NOTICES.md +2 -229
- package/VISUALIZATION_DEFINITIONS.md +68 -114
- package/chunks/Button-BrGKp9Nm.js +110 -0
- package/chunks/DefaultPropsProvider-BsfB7QTn.js +257 -0
- package/chunks/FieldTypeIcon-Drs6hSJF.js +22 -0
- package/chunks/{LinearProgress-B1FeWaen.js → LinearProgress-VtfFx2vJ.js} +55 -55
- package/chunks/MenuOption-ByRqhRdX.js +3934 -0
- package/chunks/Title-CO5dP1ma.js +1691 -0
- package/chunks/ToggleButton-KOBAimC1.js +112 -0
- package/chunks/{app-filter-bar.compiler-BGJ7HAbr.js → app-filter-bar.compiler-TwVTeoj5.js} +10 -10
- package/chunks/{bar.compiler-CT0ZbQKc.js → bar.compiler-DuQg8EUb.js} +84 -84
- package/chunks/builder-DEDvNq1k.js +201 -0
- package/chunks/{color-settings-ZIvgNTq1.js → color-rules-CN7TcGrC.js} +2 -6
- package/chunks/color-settings-3VRlf_Vw.js +6 -0
- package/chunks/colorManipulator-D8Pjy1pf.js +45 -0
- package/chunks/coloring-CncX_JRX.js +278 -0
- package/chunks/{definitions-D3OVqmXl.js → definitions-BPJQTx16.js} +490 -382
- package/chunks/{escobar-eDjtGpkC.js → escobar-DRhRMYRE.js} +6067 -4742
- package/chunks/event-bus-CrLB-Y8z.js +3 -0
- package/chunks/extend-preset-CUFNpmPe.js +4398 -0
- package/chunks/{filter.compiler-DBsyRBJt.js → filter.compiler-w27dlv0C.js} +12 -12
- package/chunks/{filtering-tqjAyJH5.js → filtering-cc7WqWpg.js} +391 -310
- package/chunks/{handlers-VTBfIZYZ.js → handlers-TOT-7INo.js} +3241 -3442
- package/chunks/icon-picker-styles-CoJmwTRi.js +2246 -0
- package/chunks/isEqual-B8loyPsC.js +12 -0
- package/chunks/label-format-type-weq1XfcX.js +8 -0
- package/chunks/{line.compiler-CzdM5Ld0.js → line.compiler-Ct1WhN2p.js} +27 -27
- package/chunks/logger-DpQtYQnX.js +1163 -0
- package/chunks/lookup-BWllin0q.js +36 -0
- package/chunks/{metadata-BGElBy5Z.js → metadata-WABZrt7Y.js} +1 -1
- package/chunks/{number.compiler-G-R7y16P.js → number.compiler-D8TPly-4.js} +13 -13
- package/chunks/{operations-CTNUX6Sy.js → operations-Dh4v1Ovt.js} +9314 -9283
- package/chunks/{range-CiwTbMig.js → range-Bi-7zT0k.js} +2 -2
- package/chunks/render-wrappers-OEmtaM8g.js +2 -0
- package/chunks/{registry-CsQQzukD.js → requirements-Dvd8jqYF.js} +218 -222
- package/chunks/responsive.styles-DSiOGD7u.js +82 -0
- package/chunks/{shared-CBvcC5YV.js → shared-Bn4N5QcZ.js} +424 -424
- package/chunks/src-77e3mC7i.js +391 -0
- package/chunks/standalone-B55oyW6c.js +689 -0
- package/chunks/{standalone-C3gg736V.js → standalone-BDhPQtzQ.js} +375 -341
- package/chunks/{standalone-BMIbT1b2.js → standalone-BGkmozIb.js} +992 -837
- package/chunks/standalone-BMTCb10X.js +179 -0
- package/chunks/standalone-BXKRE_Se.js +468 -0
- package/chunks/standalone-Bes8srx1.js +354 -0
- package/chunks/standalone-BjZp0QMe.js +2 -0
- package/chunks/{standalone-JuLF-OoH.js → standalone-BlMIwpEe.js} +634 -519
- package/chunks/{standalone-C_rYnZ0N.js → standalone-C8ZAEutO.js} +43 -42
- package/chunks/standalone-C8qAelL4.js +2 -0
- package/chunks/standalone-CJvIXsQE.js +743 -0
- package/chunks/standalone-CLmGb7nn2.js +355 -0
- package/chunks/standalone-CM5XcAN5.js +52327 -0
- package/chunks/standalone-CXNP6-xD.js +420 -0
- package/chunks/{standalone-vzBY6q0I2.js → standalone-D5Q5ngsD.js} +57 -55
- package/chunks/standalone-DLlyRIE6.js +287 -0
- package/chunks/standalone-DMcI1afI.js +396 -0
- package/chunks/{standalone-DC-aUgXC.js → standalone-DN4S1MjT.js} +1111 -1092
- package/chunks/standalone-DT0wKji7.js +6 -0
- package/chunks/standalone-DW6NT205.js +518 -0
- package/chunks/standalone-DYQIQH4c.js +2095 -0
- package/chunks/standalone-D__XCp-h.js +1003 -0
- package/chunks/standalone-XTgSsTAa.js +354 -0
- package/chunks/{standalone-v1oxfU20.js → standalone-XuGksArp.js} +20 -20
- package/chunks/{standalone-0M4HlmDW2.js → standalone-vBnBS2YC.js} +1047 -964
- package/chunks/{standalone-BtSHCp2U2.js → standalone-we5D5MIn.js} +173 -168
- package/chunks/{table.compiler-tb914oj3.js → table.compiler-DMeeHxb6.js} +29 -29
- package/chunks/useFieldName-Cjn9KCVp.js +7 -0
- package/chunks/useSlotProps-DLbQp4lc.js +166 -0
- package/chunks/{utils-Bg7K-t6K.js → utils-vdmi_2PK.js} +6271 -7804
- package/chunks/{view-Bn83C8d9.js → view-BuwQugKb.js} +2717 -3504
- package/chunks/{isEqual-BDxAhUo8.js → visualization-filters-Cc4KU-l-.js} +1887 -1946
- package/chunks/with-html-element-D0uY2zjI.js +7328 -0
- package/definitions.js +2 -2
- package/docs/operations/astrato-app-filter-bar.md +1 -1
- package/docs/operations/bar.md +31 -14
- package/docs/operations/combo.md +1 -1
- package/docs/operations/date-picker.md +3 -3
- package/docs/operations/distribution-gauge.md +13 -13
- package/docs/operations/dot.md +13 -13
- package/docs/operations/filter.md +1 -1
- package/docs/operations/gauge.md +13 -13
- package/docs/operations/heatMap.md +13 -13
- package/docs/operations/histogram.md +1 -1
- package/docs/operations/iframe.md +1 -1
- package/docs/operations/image.md +1 -1
- package/docs/operations/index.md +3 -3
- package/docs/operations/line.md +7 -7
- package/docs/operations/number.md +1 -1
- package/docs/operations/pie.md +13 -13
- package/docs/operations/radar.md +7 -7
- package/docs/operations/sankey.md +13 -13
- package/docs/operations/scatter.md +13 -13
- package/docs/operations/shape.md +1 -1
- package/docs/operations/simpleTextObject.md +1 -1
- package/docs/operations/slider.md +1 -1
- package/docs/operations/table.md +18 -1
- package/docs/operations/tree.md +51 -37
- package/docs/operations/treemap.md +63 -49
- package/docs/operations/waterfall.md +1 -1
- package/docs/operations/word-cloud.md +13 -13
- package/getters.js +7 -7
- package/index.js +419 -417
- package/metadata.js +17 -18
- package/operations.js +13 -13
- package/package.json +70 -55
- package/src/definitions/index.d.ts +1 -1
- package/src/definitions/model/definitions/descriptors/descriptor-metadata.d.ts +53 -30
- package/src/definitions/model/definitions/index.d.ts +1 -1
- package/src/definitions/model/definitions/schema-registry.d.ts +2 -2
- package/src/definitions/model/definitions/schemas/object.schema.d.ts +2 -2
- package/src/definitions/model/definitions/types/compilation.types.d.ts +10 -0
- package/src/definitions/model/definitions/types/index.d.ts +1 -1
- package/src/getters/index.d.ts +1 -1
- package/src/operations/index.d.ts +1 -1
- package/src/types.d.ts +1 -0
- package/chunks/ClickAwayListener-BbeNMAvj.js +0 -52
- package/chunks/builder-B6dWSIdD.js +0 -12289
- package/chunks/coloring-B1XAfg6b.js +0 -664
- package/chunks/events-WZut5Ow6.js +0 -4
- package/chunks/grouping-type-On4s9Thj.js +0 -3
- package/chunks/requirements-DYjZCFyf.js +0 -6
- package/chunks/standalone-0ashe9w1.js +0 -411
- package/chunks/standalone-B7jax8wa.js +0 -339
- package/chunks/standalone-BK0VYU-l.js +0 -463
- package/chunks/standalone-BZV5vOwA.js +0 -6
- package/chunks/standalone-BhDrWj4p.js +0 -1980
- package/chunks/standalone-BvaKdky9.js +0 -344
- package/chunks/standalone-BwtM31-f.js +0 -2
- package/chunks/standalone-CC1VUjO32.js +0 -299
- package/chunks/standalone-CoLrAxRV.js +0 -13198
- package/chunks/standalone-DCtRoTWg.js +0 -675
- package/chunks/standalone-DUDFTBqL.js +0 -833
- package/chunks/standalone-DhZkX9Td.js +0 -2
- package/chunks/standalone-DtLElfuM.js +0 -512
- package/chunks/standalone-G9Q4Uczu.js +0 -726
- package/chunks/standalone-_DeX21JJ.js +0 -383
- package/chunks/standalone-gFhKZh8m.js +0 -179
- package/chunks/standalone-tDNy-SFH.js +0 -281
- package/chunks/ui-DQWtv2iM.js +0 -63551
- package/chunks/useFieldName-BvdcoJRl.js +0 -7
|
@@ -1,75 +1,79 @@
|
|
|
1
1
|
import { o as e, t } from "./rolldown-runtime-DleVn1XH.js";
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import { gt as
|
|
5
|
-
import { ht as k } from "./ui-DQWtv2iM.js";
|
|
2
|
+
import { Fi as n, Hi as r, Ii as i, Ni as a, Pi as o, Qr as s, Ra as c, bs as l, ft as u, ia as d, na as f, ra as p, uo as m, wo as h, za as g, zi as _ } from "./visualization-filters-Cc4KU-l-.js";
|
|
3
|
+
import { An as v, Ei as y, Ln as b, W as x, Xt as S, a as C, bn as w, d as T, ri as E, z as D, zn as O } from "./utils-vdmi_2PK.js";
|
|
4
|
+
import { gt as k } from "./handlers-TOT-7INo.js";
|
|
6
5
|
import { n as A, t as j } from "./url-utils-B17gj_mr.js";
|
|
7
|
-
|
|
8
|
-
|
|
6
|
+
import { t as M } from "./Title-CO5dP1ma.js";
|
|
7
|
+
var N = /* @__PURE__ */ e(y()), P = (e, t) => {
|
|
8
|
+
let r = e?.simpleTextObjectSettings || {}, i = r.fontFamily ?? s.fontFamily, a = r.textColor ?? s.textColor, c = t ? n(t, i) : i, l = t ? o(t, a) : a, { borderEnabled: u = s.borderEnabled, borderRadius: d = s.borderRadius, borderWidth: f = s.borderWidth } = r;
|
|
9
9
|
return {
|
|
10
|
-
textContentType:
|
|
11
|
-
textContent:
|
|
12
|
-
variableId:
|
|
13
|
-
representation:
|
|
14
|
-
paragraphMargin:
|
|
15
|
-
textColor:
|
|
16
|
-
fontFamily:
|
|
17
|
-
fontSize:
|
|
18
|
-
bold:
|
|
19
|
-
weight:
|
|
20
|
-
italic:
|
|
21
|
-
underlined:
|
|
22
|
-
strikethrough:
|
|
23
|
-
letterSpacing:
|
|
24
|
-
lineSpacing:
|
|
25
|
-
wordWrap:
|
|
26
|
-
linkEnabled:
|
|
27
|
-
linkUrl:
|
|
28
|
-
backgroundType:
|
|
29
|
-
backgroundColor:
|
|
30
|
-
imageOpacity:
|
|
31
|
-
backgroundBlur:
|
|
32
|
-
backgroundImage:
|
|
33
|
-
imageFitType:
|
|
34
|
-
borderEnabled:
|
|
35
|
-
borderWidth:
|
|
36
|
-
borderRadius:
|
|
37
|
-
borderStyle:
|
|
38
|
-
borderColor:
|
|
39
|
-
textPadding:
|
|
40
|
-
textShadow:
|
|
41
|
-
objectShadow:
|
|
42
|
-
responsive:
|
|
43
|
-
scaling:
|
|
44
|
-
maxLines:
|
|
45
|
-
position:
|
|
46
|
-
align:
|
|
47
|
-
richTextScaling:
|
|
48
|
-
richTextResponsive:
|
|
49
|
-
richTextMaxLines:
|
|
10
|
+
textContentType: r.textContentType ?? p.Text,
|
|
11
|
+
textContent: r.textContent ?? s.textContent,
|
|
12
|
+
variableId: r.variableId ?? s.variableId,
|
|
13
|
+
representation: r.representation ?? s.representation,
|
|
14
|
+
paragraphMargin: r.paragraphMargin ?? s.paragraphMargin,
|
|
15
|
+
textColor: l,
|
|
16
|
+
fontFamily: c,
|
|
17
|
+
fontSize: r.fontSize ?? s.fontSize,
|
|
18
|
+
bold: r.bold ?? s.bold,
|
|
19
|
+
weight: r.weight ?? s.weight,
|
|
20
|
+
italic: r.italic ?? s.italic,
|
|
21
|
+
underlined: r.underlined ?? s.underlined,
|
|
22
|
+
strikethrough: r.strikethrough ?? s.strikethrough,
|
|
23
|
+
letterSpacing: r.letterSpacing ?? s.letterSpacing,
|
|
24
|
+
lineSpacing: r.lineSpacing ?? s.lineSpacing,
|
|
25
|
+
wordWrap: r.wordWrap ?? s.wordWrap,
|
|
26
|
+
linkEnabled: r.linkEnabled ?? s.linkEnabled,
|
|
27
|
+
linkUrl: r.linkUrl ?? s.linkUrl,
|
|
28
|
+
backgroundType: r.backgroundType ?? s.backgroundType,
|
|
29
|
+
backgroundColor: r.backgroundColor ?? s.backgroundColor,
|
|
30
|
+
imageOpacity: r.imageOpacity ?? s.imageOpacity,
|
|
31
|
+
backgroundBlur: r.backgroundBlur ?? s.backgroundBlur,
|
|
32
|
+
backgroundImage: r.backgroundImage ?? void 0,
|
|
33
|
+
imageFitType: r.imageFitType ?? s.imageFitType,
|
|
34
|
+
borderEnabled: u,
|
|
35
|
+
borderWidth: u ?? !!f ? f : 0,
|
|
36
|
+
borderRadius: u ?? !!f ? d : 0,
|
|
37
|
+
borderStyle: r.borderStyle ?? s.borderStyle,
|
|
38
|
+
borderColor: r.borderColor ?? s.borderColor,
|
|
39
|
+
textPadding: r.textPadding ?? s.textPadding,
|
|
40
|
+
textShadow: r.textShadow ?? s.textShadow,
|
|
41
|
+
objectShadow: r.objectShadow ?? s.objectShadow,
|
|
42
|
+
responsive: r.responsive ?? s.responsive,
|
|
43
|
+
scaling: r.scaling ?? s.scaling,
|
|
44
|
+
maxLines: r.maxLines ?? s.maxLines,
|
|
45
|
+
position: r.position ?? s.position,
|
|
46
|
+
align: r.align ?? s.align,
|
|
47
|
+
richTextScaling: r.richTextScaling ?? s.richTextScaling,
|
|
48
|
+
richTextResponsive: r.richTextResponsive ?? s.richTextResponsive,
|
|
49
|
+
richTextMaxLines: r.richTextMaxLines ?? s.richTextMaxLines
|
|
50
50
|
};
|
|
51
|
-
},
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
51
|
+
}, F = 8, I = (e, t, n) => {
|
|
52
|
+
let r = t.fontSize ?? s.fontSize, i = t.letterSpacing ?? s.letterSpacing;
|
|
53
|
+
if (n.width === 0) return r;
|
|
54
|
+
let a = O(), o = 0, c = 0, l = r;
|
|
55
|
+
for (; c <= l;) {
|
|
56
|
+
let r = Math.floor((c + l) / 2), { width: s, height: u } = a.getTextSize({
|
|
57
|
+
size: r,
|
|
57
58
|
label: e,
|
|
58
|
-
fontFamily: t.fontFamily,
|
|
59
|
+
fontFamily: t.fontFamily ?? "",
|
|
59
60
|
letterSpacing: `${t.letterSpacing}`,
|
|
60
61
|
fontWeight: t.bold ? 700 : 400,
|
|
61
62
|
lineHeight: t.lineSpacing
|
|
62
|
-
}),
|
|
63
|
-
|
|
63
|
+
}), d = Math.ceil((s + i) / (n.width - F * 2)), f = !t.wordWrap && d > 1, p = u * d * 1.2 + F * 2 > n.height;
|
|
64
|
+
f || p ? l = r - 1 : (o = r, c = r + 1);
|
|
64
65
|
}
|
|
65
|
-
return
|
|
66
|
-
},
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
66
|
+
return a.cleanDOM(), o;
|
|
67
|
+
}, L = (e, t) => e ? t : g.None, R = (e) => e === g.ViewportWidth ? "vw" : "px", ee = (e, t, n) => {
|
|
68
|
+
let r = t.textPadding ?? s.textPadding;
|
|
69
|
+
return I(e, t, {
|
|
70
|
+
width: n.width - r * 2,
|
|
71
|
+
height: n.height - r * 2
|
|
72
|
+
});
|
|
73
|
+
}, te = {
|
|
70
74
|
width: 1920,
|
|
71
75
|
height: 1080
|
|
72
|
-
}, z = (e) => e / 1920 * 100, B = (e) => e /
|
|
76
|
+
}, z = (e) => e / 1920 * 100, B = (e) => e / te.height * 100, V = E(), ne = x({
|
|
73
77
|
wrapper: {
|
|
74
78
|
height: "100%",
|
|
75
79
|
position: "relative",
|
|
@@ -84,9 +88,9 @@ var M = /* @__PURE__ */ e(T()), N = (e, t) => {
|
|
|
84
88
|
top: 0,
|
|
85
89
|
fontSize: 24
|
|
86
90
|
} }
|
|
87
|
-
}),
|
|
88
|
-
let s = t.daedalus.variablesApi, c = t.objectId || "", l = (0,
|
|
89
|
-
(0,
|
|
91
|
+
}), re = ({ value: e = "", backendAPI: t, onBlur: n, onSubmit: r, responsive: i, richTextResponsive: a = !0, richTextMaxLines: o = 1 }) => {
|
|
92
|
+
let s = t.daedalus.variablesApi, c = t.objectId || "", l = (0, N.useRef)(null), u = (0, N.useRef)(null), d = t.dataSetsService, f = t.daedalus.objectCapabilities.editable || t.daedalus.isPreview(), [p, m] = (0, N.useState)(!1), h = ne();
|
|
93
|
+
(0, N.useEffect)(() => {
|
|
90
94
|
if (!l.current) return;
|
|
91
95
|
let r = l.current, p = r.appendChild(r.ownerDocument.createElement("div")), m = {
|
|
92
96
|
value: e,
|
|
@@ -118,7 +122,7 @@ var M = /* @__PURE__ */ e(T()), N = (e, t) => {
|
|
|
118
122
|
a,
|
|
119
123
|
o,
|
|
120
124
|
f
|
|
121
|
-
]), (0,
|
|
125
|
+
]), (0, N.useEffect)(() => {
|
|
122
126
|
u.current?.getContents() !== e && u.current?.setContents(e), m(!1);
|
|
123
127
|
}, [e, s]);
|
|
124
128
|
let g = () => {
|
|
@@ -145,14 +149,14 @@ var M = /* @__PURE__ */ e(T()), N = (e, t) => {
|
|
|
145
149
|
};
|
|
146
150
|
return /* @__PURE__ */ (0, V.jsx)("div", {
|
|
147
151
|
ref: l,
|
|
148
|
-
className:
|
|
152
|
+
className: v({
|
|
149
153
|
[h.wrapper]: !0,
|
|
150
154
|
[h.changed]: p,
|
|
151
155
|
"ast-advanced-text-editor": !1
|
|
152
156
|
}),
|
|
153
157
|
onClick: g
|
|
154
158
|
});
|
|
155
|
-
}, H =
|
|
159
|
+
}, H = x({
|
|
156
160
|
mainContainer: {
|
|
157
161
|
width: "100%",
|
|
158
162
|
height: "100%",
|
|
@@ -169,7 +173,7 @@ var M = /* @__PURE__ */ e(T()), N = (e, t) => {
|
|
|
169
173
|
overflowX: "hidden",
|
|
170
174
|
lineHeight: 1,
|
|
171
175
|
color: "#1F1C3B",
|
|
172
|
-
fontFamily:
|
|
176
|
+
fontFamily: i("Roboto"),
|
|
173
177
|
fontStyle: "normal",
|
|
174
178
|
fontWeight: 700
|
|
175
179
|
},
|
|
@@ -187,8 +191,8 @@ var M = /* @__PURE__ */ e(T()), N = (e, t) => {
|
|
|
187
191
|
WebkitBoxOrient: "vertical"
|
|
188
192
|
}
|
|
189
193
|
});
|
|
190
|
-
|
|
191
|
-
var
|
|
194
|
+
i("Roboto");
|
|
195
|
+
var U = "\n height: 100%; \n width: 100%;\n display: block;\n overflow: auto;\n", W = `
|
|
192
196
|
width: 100%;
|
|
193
197
|
height: 100%;
|
|
194
198
|
position: absolute;
|
|
@@ -199,25 +203,25 @@ var re = "\n height: 100%; \n width: 100%;\n display: block;\n overflow: aut
|
|
|
199
203
|
overflow: auto;
|
|
200
204
|
line-height: 1;
|
|
201
205
|
color: #1F1C3B;
|
|
202
|
-
font-family: Roboto, ${
|
|
206
|
+
font-family: Roboto, ${a};
|
|
203
207
|
font-style: normal;
|
|
204
208
|
font-weight: 700;
|
|
205
|
-
`,
|
|
209
|
+
`, G = "\n cursor: default;\n width: 100%;\n height: auto;\n -webkit-flex: 1 1 auto;\n -ms-flex: 1 1 auto;\n flex: 1 1 auto;\n overflow: auto;\n overflow-wrap: break-word;\n text-overflow: ellipsis;\n -box-orient: vertical;\n", K = /* @__PURE__ */ t(((e, t) => {
|
|
206
210
|
function n(e, t, n, r) {
|
|
207
211
|
var i = -1, a = e == null ? 0 : e.length;
|
|
208
212
|
for (r && a && (n = e[++i]); ++i < a;) n = t(n, e[i], i, e);
|
|
209
213
|
return n;
|
|
210
214
|
}
|
|
211
215
|
t.exports = n;
|
|
212
|
-
})),
|
|
216
|
+
})), q = /* @__PURE__ */ t(((e, t) => {
|
|
213
217
|
function n(e) {
|
|
214
218
|
return function(t) {
|
|
215
219
|
return e?.[t];
|
|
216
220
|
};
|
|
217
221
|
}
|
|
218
222
|
t.exports = n;
|
|
219
|
-
})),
|
|
220
|
-
t.exports =
|
|
223
|
+
})), J = /* @__PURE__ */ t(((e, t) => {
|
|
224
|
+
t.exports = q()({
|
|
221
225
|
À: "A",
|
|
222
226
|
Á: "A",
|
|
223
227
|
Â: "A",
|
|
@@ -409,25 +413,25 @@ var re = "\n height: 100%; \n width: 100%;\n display: block;\n overflow: aut
|
|
|
409
413
|
ʼn: "'n",
|
|
410
414
|
ſ: "s"
|
|
411
415
|
});
|
|
412
|
-
})), J = /* @__PURE__ */ t(((e, t) => {
|
|
413
|
-
var n = q(), r = a(), i = /[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g, o = RegExp("[\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff]", "g");
|
|
414
|
-
function s(e) {
|
|
415
|
-
return e = r(e), e && e.replace(i, n).replace(o, "");
|
|
416
|
-
}
|
|
417
|
-
t.exports = s;
|
|
418
416
|
})), Y = /* @__PURE__ */ t(((e, t) => {
|
|
417
|
+
var n = J(), r = u(), i = /[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g, a = RegExp("[\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff]", "g");
|
|
418
|
+
function o(e) {
|
|
419
|
+
return e = r(e), e && e.replace(i, n).replace(a, "");
|
|
420
|
+
}
|
|
421
|
+
t.exports = o;
|
|
422
|
+
})), ie = /* @__PURE__ */ t(((e, t) => {
|
|
419
423
|
var n = /[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g;
|
|
420
424
|
function r(e) {
|
|
421
425
|
return e.match(n) || [];
|
|
422
426
|
}
|
|
423
427
|
t.exports = r;
|
|
424
|
-
})),
|
|
428
|
+
})), ae = /* @__PURE__ */ t(((e, t) => {
|
|
425
429
|
var n = /[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/;
|
|
426
430
|
function r(e) {
|
|
427
431
|
return n.test(e);
|
|
428
432
|
}
|
|
429
433
|
t.exports = r;
|
|
430
|
-
})),
|
|
434
|
+
})), oe = /* @__PURE__ */ t(((e, t) => {
|
|
431
435
|
var n = "\\ud800-\\udfff", r = "\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff", i = "\\u2700-\\u27bf", a = "a-z\\xdf-\\xf6\\xf8-\\xff", o = "\\xac\\xb1\\xd7\\xf7", s = "\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf", c = "\\u2000-\\u206f", l = " \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000", u = "A-Z\\xc0-\\xd6\\xd8-\\xde", d = "\\ufe0e\\ufe0f", f = o + s + c + l, p = "['’]", m = "[" + f + "]", h = "[" + r + "]", g = "\\d+", _ = "[" + i + "]", v = "[" + a + "]", y = "[^" + n + f + g + i + a + u + "]", b = "(?:" + h + "|\\ud83c[\\udffb-\\udfff])", x = "[^" + n + "]", S = "(?:\\ud83c[\\udde6-\\uddff]){2}", C = "[\\ud800-\\udbff][\\udc00-\\udfff]", w = "[" + u + "]", T = "\\u200d", E = "(?:" + v + "|" + y + ")", D = "(?:" + w + "|" + y + ")", O = "(?:" + p + "(?:d|ll|m|re|s|t|ve))?", k = "(?:" + p + "(?:D|LL|M|RE|S|T|VE))?", A = b + "?", j = "[" + d + "]?", M = "(?:" + T + "(?:" + [
|
|
432
436
|
x,
|
|
433
437
|
S,
|
|
@@ -458,29 +462,29 @@ var re = "\n height: 100%; \n width: 100%;\n display: block;\n overflow: aut
|
|
|
458
462
|
return e.match(L) || [];
|
|
459
463
|
}
|
|
460
464
|
t.exports = R;
|
|
461
|
-
})), oe = /* @__PURE__ */ t(((e, t) => {
|
|
462
|
-
var n = Y(), r = ie(), i = a(), o = ae();
|
|
463
|
-
function s(e, t, a) {
|
|
464
|
-
return e = i(e), t = a ? void 0 : t, t === void 0 ? r(e) ? o(e) : n(e) : e.match(t) || [];
|
|
465
|
-
}
|
|
466
|
-
t.exports = s;
|
|
467
465
|
})), se = /* @__PURE__ */ t(((e, t) => {
|
|
468
|
-
var n =
|
|
466
|
+
var n = ie(), r = ae(), i = u(), a = oe();
|
|
467
|
+
function o(e, t, o) {
|
|
468
|
+
return e = i(e), t = o ? void 0 : t, t === void 0 ? r(e) ? a(e) : n(e) : e.match(t) || [];
|
|
469
|
+
}
|
|
470
|
+
t.exports = o;
|
|
471
|
+
})), ce = /* @__PURE__ */ t(((e, t) => {
|
|
472
|
+
var n = K(), r = Y(), i = se(), a = RegExp("['’]", "g");
|
|
469
473
|
function o(e) {
|
|
470
474
|
return function(t) {
|
|
471
475
|
return n(i(r(t).replace(a, "")), e, "");
|
|
472
476
|
};
|
|
473
477
|
}
|
|
474
478
|
t.exports = o;
|
|
475
|
-
})),
|
|
476
|
-
t.exports =
|
|
479
|
+
})), le = /* @__PURE__ */ e((/* @__PURE__ */ t(((e, t) => {
|
|
480
|
+
t.exports = ce()(function(e, t, n) {
|
|
477
481
|
return e + (n ? "-" : "") + t.toLowerCase();
|
|
478
482
|
});
|
|
479
|
-
})))()),
|
|
483
|
+
})))()), ue = (e, t = s.fontSize, n = "px") => {
|
|
480
484
|
let i = [e.underlined ? "underline" : void 0, e.strikethrough ? "line-through" : void 0].filter((e) => !!e).join(" "), a = Math.ceil(t / 10);
|
|
481
485
|
return {
|
|
482
|
-
fontFamily: e.fontFamily,
|
|
483
|
-
fontSize: `${t}${
|
|
486
|
+
fontFamily: e.fontFamily ?? void 0,
|
|
487
|
+
fontSize: `${t}${n}`,
|
|
484
488
|
fontWeight: e.weight ?? (e.bold ? "bold" : "normal"),
|
|
485
489
|
fontStyle: e.italic ? "italic" : "normal",
|
|
486
490
|
color: e.textColor ?? "inherit",
|
|
@@ -488,10 +492,10 @@ var re = "\n height: 100%; \n width: 100%;\n display: block;\n overflow: aut
|
|
|
488
492
|
textDecoration: i,
|
|
489
493
|
letterSpacing: `${e.letterSpacing}px`,
|
|
490
494
|
lineHeight: e.lineSpacing,
|
|
491
|
-
whiteSpace: e.responsive || [
|
|
492
|
-
marginTop: e.position ===
|
|
493
|
-
marginBottom: e.position ===
|
|
494
|
-
textShadow: e.textShadow ? `0px 1px 2px ${
|
|
495
|
+
whiteSpace: e.responsive || [d.HTML, d.Markdown].includes(e.representation ?? s.representation) ? e.wordWrap ? "pre-line" : "nowrap" : "pre-line",
|
|
496
|
+
marginTop: e.position === h.Top ? "unset" : "auto",
|
|
497
|
+
marginBottom: e.position === h.Bottom ? "unset" : "auto",
|
|
498
|
+
textShadow: e.textShadow ? `0px 1px 2px ${r.black}` : "none",
|
|
495
499
|
paddingTop: a,
|
|
496
500
|
paddingBottom: a,
|
|
497
501
|
overflow: e.responsive ? "visible" : "hidden",
|
|
@@ -501,24 +505,24 @@ var re = "\n height: 100%; \n width: 100%;\n display: block;\n overflow: aut
|
|
|
501
505
|
display: e.responsive ? "initial" : "-webkit-box"
|
|
502
506
|
};
|
|
503
507
|
}, X = (e) => {
|
|
504
|
-
let t = e.borderStyle ===
|
|
508
|
+
let t = e.borderStyle === m.Line ? "solid" : "dashed";
|
|
505
509
|
return {
|
|
506
|
-
backgroundColor: (e.backgroundType ===
|
|
510
|
+
backgroundColor: (e.backgroundType === f.Image ? null : e.backgroundColor) ?? "transparent",
|
|
507
511
|
border: `${e.borderWidth}px ${t} ${e.borderColor}`,
|
|
508
512
|
borderRadius: `${e.borderRadius}px`,
|
|
509
513
|
backdropFilter: `blur(${e.backgroundBlur}px)`,
|
|
510
|
-
boxShadow: e.objectShadow ? `0px 2px 4px ${
|
|
514
|
+
boxShadow: e.objectShadow ? `0px 2px 4px ${r.alphaBlack(.25)}` : "none"
|
|
511
515
|
};
|
|
512
|
-
}, Z = (e) => ({ padding: `${e.textPadding ?? 0}px` }),
|
|
516
|
+
}, Z = (e) => ({ padding: `${e.textPadding ?? 0}px` }), de = (e, t, n) => {
|
|
513
517
|
if (!n) return {};
|
|
514
|
-
let r = e.fontSize;
|
|
518
|
+
let r = e.fontSize ?? s.fontSize;
|
|
515
519
|
switch (t) {
|
|
516
|
-
case
|
|
517
|
-
case
|
|
518
|
-
case
|
|
520
|
+
case c.ViewportWidth: return { fontSize: `${z(r)}vw` };
|
|
521
|
+
case c.ViewportHeight: return { fontSize: `${B(r)}vh` };
|
|
522
|
+
case c.ViewportWidthHeight: return { fontSize: `min(${z(r)}vw, ${B(r)}vh)` };
|
|
519
523
|
}
|
|
520
524
|
return {};
|
|
521
|
-
},
|
|
525
|
+
}, Q = {
|
|
522
526
|
borderStyle: "none",
|
|
523
527
|
width: "100%",
|
|
524
528
|
height: "100%",
|
|
@@ -526,128 +530,128 @@ var re = "\n height: 100%; \n width: 100%;\n display: block;\n overflow: aut
|
|
|
526
530
|
}, fe = (e) => ({
|
|
527
531
|
objectFit: e.imageFitType ?? "contain",
|
|
528
532
|
opacity: e.imageOpacity ?? 1
|
|
529
|
-
}),
|
|
530
|
-
let n = (0,
|
|
533
|
+
}), pe = (e) => Object.entries(e).map(([e, t]) => {
|
|
534
|
+
let n = (0, le.default)(e);
|
|
531
535
|
return typeof t == "number" && ![
|
|
532
536
|
"lineHeight",
|
|
533
537
|
"opacity",
|
|
534
538
|
"zIndex"
|
|
535
539
|
].includes(e) && (t = `${t}px`), `${n}: ${t};`;
|
|
536
|
-
}).join(" "),
|
|
537
|
-
${
|
|
540
|
+
}).join(" "), me = (e, t) => `:host {
|
|
541
|
+
${U}
|
|
538
542
|
}
|
|
539
543
|
.astrato-html-main-container {
|
|
540
|
-
${
|
|
544
|
+
${W}
|
|
541
545
|
}
|
|
542
546
|
.astrato-html-container {
|
|
543
|
-
${
|
|
544
|
-
${
|
|
547
|
+
${G}
|
|
548
|
+
${pe(e)}
|
|
545
549
|
}
|
|
546
550
|
.astrato-html-container p {
|
|
547
|
-
margin: ${t.representation ===
|
|
551
|
+
margin: ${t.representation === d.Markdown ? `${t.paragraphMargin}px` : 0};
|
|
548
552
|
}
|
|
549
553
|
.astrato-html-container li {
|
|
550
554
|
white-space: normal;
|
|
551
|
-
}`,
|
|
552
|
-
let { textContent: r, variableId: i, textContentType: a =
|
|
553
|
-
return [
|
|
554
|
-
},
|
|
555
|
-
let
|
|
556
|
-
t ===
|
|
557
|
-
let
|
|
558
|
-
...
|
|
559
|
-
...
|
|
555
|
+
}`, he = (e) => `<div class="astrato-html-main-container"><div class="astrato-html-container">${e}</div></div>`, ge = (e, t, n) => {
|
|
556
|
+
let { textContent: r, variableId: i, textContentType: a = p.Text } = e;
|
|
557
|
+
return [p.Text, p.Delta].includes(a) ? r || n : i ? `${t[i]?.value ?? ""}` : n;
|
|
558
|
+
}, _e = (e) => e.replace(/(\r\n|\n|\r)/g, " "), $ = ({ textObjectSettings: e, scaling: t, elementSize: n }) => {
|
|
559
|
+
let r = H(), i = w(), a = T(), { variablesDict: o } = C(), [c, l] = (0, N.useState)(""), u = ge(e, o, ""), p = e.fontSize ?? s.fontSize;
|
|
560
|
+
t === g.FitToObject && n ? p = ee(u, e, n) : t === g.ViewportWidth && (p = z(p));
|
|
561
|
+
let m = i?.daedalus.objectCapabilities.editable, h = e.backgroundType === f.Image, _ = [d.HTML, d.Markdown].includes(e.representation ?? s.representation), v = ue(e, p, R(t)), y = X(e), x = Z(e), S = fe(e), E = {
|
|
562
|
+
...x,
|
|
563
|
+
...v,
|
|
560
564
|
fontSize: `${e.fontSize}px`
|
|
561
565
|
};
|
|
562
|
-
delete
|
|
566
|
+
delete E.paddingBottom, delete E.paddingTop, delete E.display, (0, N.useEffect)(() => {
|
|
563
567
|
let t = async () => {
|
|
564
|
-
e.representation ===
|
|
568
|
+
e.representation === d.Markdown ? l(await A(u)) : l(u);
|
|
565
569
|
};
|
|
566
570
|
(async () => {
|
|
567
|
-
await t(), !h && !
|
|
571
|
+
await t(), !h && !_ && a();
|
|
568
572
|
})();
|
|
569
573
|
}, [
|
|
570
|
-
|
|
574
|
+
u,
|
|
571
575
|
e.representation,
|
|
572
576
|
h,
|
|
573
|
-
|
|
574
|
-
|
|
577
|
+
_,
|
|
578
|
+
a
|
|
575
579
|
]);
|
|
576
|
-
let
|
|
577
|
-
return /* @__PURE__ */ (0, V.jsx)(
|
|
578
|
-
title:
|
|
580
|
+
let D = j(e.linkUrl ?? s.linkUrl), O = !_ && !e.responsive, k = !e.responsive && !_ ? _e(c) : c;
|
|
581
|
+
return /* @__PURE__ */ (0, V.jsx)(M, {
|
|
582
|
+
title: O ? k : null,
|
|
579
583
|
children: /* @__PURE__ */ (0, V.jsxs)("div", {
|
|
580
|
-
className:
|
|
581
|
-
style:
|
|
584
|
+
className: r.mainContainer,
|
|
585
|
+
style: y,
|
|
582
586
|
"data-testid": "simple-text-object-container",
|
|
583
587
|
children: [
|
|
584
|
-
|
|
585
|
-
html:
|
|
586
|
-
css:
|
|
587
|
-
style:
|
|
588
|
-
onRendered:
|
|
588
|
+
_ ? /* @__PURE__ */ (0, V.jsx)(b, {
|
|
589
|
+
html: he(k),
|
|
590
|
+
css: me(E, e),
|
|
591
|
+
style: Q,
|
|
592
|
+
onRendered: a
|
|
589
593
|
}) : null,
|
|
590
594
|
h ? /* @__PURE__ */ (0, V.jsx)("img", {
|
|
591
595
|
src: e.backgroundImage,
|
|
592
|
-
className:
|
|
593
|
-
style:
|
|
594
|
-
onLoad: () =>
|
|
595
|
-
onError: () =>
|
|
596
|
+
className: r.image,
|
|
597
|
+
style: S,
|
|
598
|
+
onLoad: () => a(),
|
|
599
|
+
onError: () => a(),
|
|
596
600
|
alt: "text background"
|
|
597
601
|
}) : null,
|
|
598
|
-
|
|
599
|
-
className:
|
|
600
|
-
style:
|
|
601
|
-
children: e.linkEnabled &&
|
|
602
|
-
className:
|
|
603
|
-
style:
|
|
602
|
+
m || !_ ? /* @__PURE__ */ (0, V.jsx)(V.Fragment, { children: /* @__PURE__ */ (0, V.jsx)("div", {
|
|
603
|
+
className: r.textContainer,
|
|
604
|
+
style: x,
|
|
605
|
+
children: e.linkEnabled && D ? /* @__PURE__ */ (0, V.jsx)("div", {
|
|
606
|
+
className: r.spanElement,
|
|
607
|
+
style: v,
|
|
604
608
|
"data-ellipsis": !0,
|
|
605
609
|
"data-testid": "simple-text-object-content",
|
|
606
610
|
children: /* @__PURE__ */ (0, V.jsx)("a", {
|
|
607
611
|
target: "_blank",
|
|
608
612
|
rel: "noreferrer",
|
|
609
|
-
href:
|
|
613
|
+
href: D,
|
|
610
614
|
style: {
|
|
611
615
|
textDecoration: "inherit",
|
|
612
616
|
color: "inherit"
|
|
613
617
|
},
|
|
614
|
-
children:
|
|
618
|
+
children: _ ? "" : k
|
|
615
619
|
})
|
|
616
620
|
}) : /* @__PURE__ */ (0, V.jsx)("div", {
|
|
617
|
-
className:
|
|
621
|
+
className: r.spanElement,
|
|
618
622
|
style: {
|
|
619
|
-
...
|
|
623
|
+
...v,
|
|
620
624
|
pointerEvents: "none"
|
|
621
625
|
},
|
|
622
626
|
"data-ellipsis": !0,
|
|
623
627
|
"data-testid": "simple-text-object-content",
|
|
624
|
-
children:
|
|
628
|
+
children: _ ? "" : k
|
|
625
629
|
})
|
|
626
630
|
}) }) : null
|
|
627
631
|
]
|
|
628
632
|
})
|
|
629
633
|
});
|
|
630
|
-
},
|
|
631
|
-
let n =
|
|
632
|
-
return (0,
|
|
634
|
+
}, ve = S($), ye = ({ textObjectSettings: e, isRichTextScalingSet: t }) => {
|
|
635
|
+
let n = w(), r = D(), i = X(e), a = Z(e), o = H(), s = T(), l = e.richTextScaling ?? c.ViewportBreakpoints, u = de(e, l, t);
|
|
636
|
+
return (0, N.useEffect)(() => {
|
|
633
637
|
s();
|
|
634
638
|
}, [s]), /* @__PURE__ */ (0, V.jsx)("div", {
|
|
635
639
|
className: o.mainContainer,
|
|
636
640
|
style: {
|
|
637
641
|
...i,
|
|
638
642
|
...a,
|
|
639
|
-
...
|
|
643
|
+
...u
|
|
640
644
|
},
|
|
641
645
|
"data-testid": "simple-text-object-container",
|
|
642
|
-
children: /* @__PURE__ */ (0, V.jsx)(
|
|
646
|
+
children: /* @__PURE__ */ (0, V.jsx)(re, {
|
|
643
647
|
value: e.textContent,
|
|
644
648
|
backendAPI: n,
|
|
645
|
-
responsive:
|
|
649
|
+
responsive: l === c.ViewportBreakpoints,
|
|
646
650
|
richTextResponsive: e.richTextResponsive,
|
|
647
651
|
richTextMaxLines: e.richTextMaxLines,
|
|
648
652
|
onSubmit: (t, n) => {
|
|
649
653
|
let i = n.overflowBehavior === "responsive", a = n.maxLines;
|
|
650
|
-
e.textContent === t && e.richTextResponsive === i && e.richTextMaxLines === a ||
|
|
654
|
+
e.textContent === t && e.richTextResponsive === i && e.richTextMaxLines === a || k(r, {
|
|
651
655
|
textContent: t,
|
|
652
656
|
richTextResponsive: i,
|
|
653
657
|
richTextMaxLines: a
|
|
@@ -655,19 +659,20 @@ var re = "\n height: 100%; \n width: 100%;\n display: block;\n overflow: aut
|
|
|
655
659
|
}
|
|
656
660
|
})
|
|
657
661
|
});
|
|
658
|
-
},
|
|
659
|
-
|
|
662
|
+
}, be = (e) => {
|
|
663
|
+
if (!e.vSpec || !l(e.vSpec)) return null;
|
|
664
|
+
let t = e.vTheme ?? _, n = P(e.vSpec, t), r = L(n.responsive ?? s.responsive, n.scaling ?? s.scaling), i = {
|
|
660
665
|
...e,
|
|
661
666
|
scaling: r,
|
|
662
667
|
textObjectSettings: n
|
|
663
668
|
};
|
|
664
|
-
if (n.textContentType ===
|
|
669
|
+
if (n.textContentType === p.Delta) return /* @__PURE__ */ (0, V.jsx)(ye, {
|
|
665
670
|
textObjectSettings: n,
|
|
666
671
|
isRichTextScalingSet: e.vSpec?.simpleTextObjectSettings?.richTextScaling !== void 0
|
|
667
672
|
});
|
|
668
673
|
switch (r) {
|
|
669
|
-
case
|
|
674
|
+
case g.FitToObject: return /* @__PURE__ */ (0, V.jsx)(ve, { ...i });
|
|
670
675
|
default: return /* @__PURE__ */ (0, V.jsx)($, { ...i });
|
|
671
676
|
}
|
|
672
677
|
};
|
|
673
|
-
export {
|
|
678
|
+
export { be as SimpleTextObject };
|