@astrato-io/visualizations 0.10.0 → 0.11.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/CHANGELOG.md +21 -1
- package/README.md +22 -4
- package/THIRD_PARTY_NOTICES.md +494 -0
- package/VISUALIZATION_DEFINITIONS.md +59 -145
- package/chunks/{Button-CCF851ea.js → Button-CPG4WX8X.js} +3 -3
- package/chunks/{CircularProgress-yupH6YWs.js → CircularProgress-PSLW8HmD.js} +12 -12
- package/chunks/FieldTypeIcon-5k2bkqd0.js +22 -0
- package/chunks/{LinearProgress-CyFjN4px.js → LinearProgress-KQ2EQlGL.js} +16 -16
- package/chunks/{MenuOption-CQpT79AP.js → MenuOption-B-6K7kks.js} +151 -151
- package/chunks/{Title-C-p4ZarD.js → Title-BmvwZYkh.js} +32 -32
- package/chunks/{_createAggregator-BF4qG9XK.js → _createAggregator-CFmH6gUN.js} +11 -11
- package/chunks/{app-filter-bar.compiler-8fxCo2q7.js → app-filter-bar.compiler-BY5-T16I.js} +8 -8
- package/chunks/{bar-layout-DStC-GNV.js → bar-layout-BNou0dZF.js} +2 -2
- package/chunks/{bar.compiler-CQAu8KL8.js → bar.compiler-BkhO7sDd.js} +55 -53
- package/chunks/{builder-CScg1TOS.js → builder-CNjuqD2z.js} +107 -56
- package/chunks/category-axis-D1OVyMrr.js +20 -0
- package/chunks/{coloring-9jU3s_-p.js → coloring-BOiP0rmn.js} +54 -54
- package/chunks/{createSimplePaletteValueFilter-C4hZpCdn.js → createSimplePaletteValueFilter-BkgQ7MFE.js} +166 -166
- package/chunks/defaults-B5_8S-J-.js +3 -0
- package/chunks/{definitions-C4grxhye.js → definitions-AS9GcavE.js} +263 -242
- package/chunks/{escobar-CjirINHP.js → escobar-cQ1eQ64G.js} +8528 -8461
- package/chunks/{extend-preset-D-l9u_we.js → extend-preset-BlCbcXKR.js} +421 -421
- package/chunks/{filter.compiler-lji2Acgn.js → filter.compiler-CI7dDNM1.js} +12 -12
- package/chunks/{filtering-C1zakrrX.js → filtering-Dwi7hDPZ.js} +263 -263
- package/chunks/handlers-C63NVo7i.js +15433 -0
- package/chunks/{icon-picker-styles-Bj80ZUBK.js → icon-picker-styles-CBlxEu3s.js} +8 -8
- package/chunks/{isEqual-Ch9OEye3.js → isEqual-BdHo6wqq.js} +1 -1
- package/chunks/{isFocusVisible-CgMP0qkR.js → isFocusVisible-C1nlVUwL.js} +9 -9
- package/chunks/line.compiler-DCv3h42f.js +198 -0
- package/chunks/linear-Bq_r9l5S.js +264 -0
- package/chunks/{logger-CKRjhSHQ.js → logger-Bc-DqDM_.js} +72 -72
- package/chunks/{lookup-BWllin0q.js → lookup-B3tWH2hX.js} +1 -0
- package/chunks/{map.compiler-CKzorLgK.js → map.compiler-CRO6XpdI.js} +43 -45
- package/chunks/measure-format-default-B6ghxih7.js +22 -0
- package/chunks/{metadata-Bb9pTXrq.js → metadata-CtkvZEhS.js} +1 -1
- package/chunks/number.compiler-kV4lobCZ.js +57 -0
- package/chunks/{operations-DZoY50VX.js → operations-COl9wgqi.js} +9893 -9831
- package/chunks/{range-D1BTmFMp.js → range-CMJ5yc5Z.js} +2 -2
- package/chunks/{react-dom-Dgv2azN2.js → react-dom-BjsCbYHq.js} +76 -76
- package/chunks/{render-wrappers-_P3xwu5A.js → render-wrappers-DFHi3Wkr.js} +1 -1
- package/chunks/{requirements-NHNrR8Ie.js → requirements-C5YLmHKe.js} +251 -227
- package/chunks/{shared-UitWpq1J.js → shared-DyqxOie0.js} +290 -278
- package/chunks/standalone-06i1wmIX.js +6 -0
- package/chunks/{standalone-DtBk_iUz.js → standalone-9jrQ3zJT.js} +10 -10
- package/chunks/standalone-B6zUvxNQ.js +357 -0
- package/chunks/{standalone-Bnnr87pc.js → standalone-BYK2U0Vd.js} +418 -679
- package/chunks/standalone-Be5APcVv.js +762 -0
- package/chunks/standalone-Bp4G3MDx.js +396 -0
- package/chunks/{standalone-CbPk8bKn.js → standalone-BrjtMIdd.js} +132 -132
- package/chunks/{standalone-BOzHA_d4.js → standalone-Bsfz5vnJ.js} +57 -57
- package/chunks/standalone-BuXpKMnc.js +2 -0
- package/chunks/standalone-CIjNYyya.js +8378 -0
- package/chunks/{standalone-B0U6c3su.js → standalone-CS5VGoja.js} +358 -358
- package/chunks/standalone-CUGt2FUF.js +2 -0
- package/chunks/{standalone-BapqaniK.js → standalone-ChfEHb28.js} +2299 -1072
- package/chunks/standalone-CnF2OYLQ.js +355 -0
- package/chunks/standalone-CznEEiq3.js +422 -0
- package/chunks/{standalone-Ck63MZzj.js → standalone-D9k5SCd8.js} +165 -165
- package/chunks/{standalone-CRdDZYeM.js → standalone-DYVYccmY.js} +855 -855
- package/chunks/{standalone-CVknVdUC.js → standalone-DaNxWIKn.js} +27 -27
- package/chunks/{standalone-swGs70tD.js → standalone-Db_HNuWx.js} +50 -50
- package/chunks/standalone-DcuE8KBa.js +287 -0
- package/chunks/{standalone-U0WJwFlG.js → standalone-I5kRIsp8.js} +97 -97
- package/chunks/{standalone-BBu90BhK.js → standalone-K2OvRAQM.js} +125 -125
- package/chunks/{standalone-DCFY1MAV.js → standalone-c4CPN6ug.js} +4634 -4633
- package/chunks/{standalone-ByKKqT5L.js → standalone-iOnJhCvA.js} +302 -302
- package/chunks/standalone-pCrzBiTy.js +773 -0
- package/chunks/standalone-qrZaimgC.js +689 -0
- package/chunks/standalone-yqDJ8h3K.js +1012 -0
- package/chunks/{table.compiler-OWSx5MOq.js → table.compiler-CMH_dtYs.js} +29 -29
- package/chunks/{useFieldName-B8iCYyw1.js → useFieldName-BfxBzhhH.js} +1 -1
- package/chunks/{utils-3Igg6xmO.js → utils-BdJrEeIQ.js} +4037 -4015
- package/chunks/{view-DdMLZySj.js → view-Q-_XIrWE.js} +1615 -1615
- package/chunks/{visualization-filters-CzvFHE6M.js → visualization-filters-BwS0xUqs.js} +1723 -1693
- package/chunks/{with-html-element-DOfkR3C1.js → with-html-element-D_ooGNWI.js} +4006 -3994
- package/definitions.js +2 -2
- package/docs/operations/astrato-app-filter-bar.md +1 -1
- package/docs/operations/bar.md +30 -1
- package/docs/operations/combo.md +30 -1
- package/docs/operations/date-picker.md +1 -1
- package/docs/operations/distribution-gauge.md +1 -1
- package/docs/operations/dot.md +1 -1
- package/docs/operations/filter.md +1 -1
- package/docs/operations/gauge.md +1 -1
- package/docs/operations/heatMap.md +1 -1
- 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 +5 -4
- package/docs/operations/line.md +48 -1
- package/docs/operations/map.md +5274 -0
- package/docs/operations/number.md +1 -1
- package/docs/operations/pie.md +1 -1
- package/docs/operations/radar.md +1 -1
- package/docs/operations/sankey.md +1 -1
- package/docs/operations/scatter.md +1 -1
- 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 +1 -1
- package/docs/operations/tree.md +1 -1
- package/docs/operations/treemap.md +1 -1
- package/docs/operations/waterfall.md +1 -1
- package/docs/operations/word-cloud.md +1 -1
- package/getters.js +3 -3
- package/index.js +528 -504
- package/metadata.js +2 -2
- package/operations.js +6 -6
- package/package.json +73 -68
- package/src/definitions/index.d.ts +1 -1
- package/src/definitions/model/definitions/descriptors/descriptor-metadata.d.ts +34 -53
- package/src/definitions/model/definitions/schema-registry.d.ts +2 -2
- package/src/definitions/model/definitions/schemas/bar.schema.d.ts +1 -1
- package/src/definitions/model/definitions/schemas/broad-chart.schema.d.ts +2 -2
- package/src/definitions/model/definitions/schemas/common.schema.d.ts +14 -2
- package/src/definitions/model/definitions/schemas/index.d.ts +1 -1
- package/src/definitions/model/definitions/schemas/line.schema.d.ts +1 -1
- package/src/definitions/model/definitions/types/compilation.types.d.ts +4 -1
- package/src/types.d.ts +28 -28
- package/src/visualization-catalog.d.ts +3 -0
- package/styles.css +1 -1
- package/chunks/FieldTypeIcon-D_MzsdfY.js +0 -22
- package/chunks/defaults-cyNhn37t.js +0 -3
- package/chunks/handlers-ZviIUC-j.js +0 -15387
- package/chunks/line.compiler-De5fiKuR.js +0 -198
- package/chunks/number.compiler-CaTmJkmi.js +0 -53
- package/chunks/standalone-BEekPuA12.js +0 -357
- package/chunks/standalone-BR2JuRIC.js +0 -422
- package/chunks/standalone-BwJqDj2Z.js +0 -396
- package/chunks/standalone-CRfDOO1x.js +0 -287
- package/chunks/standalone-DZDGX3aa.js +0 -518
- package/chunks/standalone-DhfgeJIk.js +0 -1012
- package/chunks/standalone-DibjA73M.js +0 -6
- package/chunks/standalone-DxBAyqAu.js +0 -772
- package/chunks/standalone-KMQPsNsq.js +0 -2
- package/chunks/standalone-MBLSvsrY.js +0 -2
- package/chunks/standalone-wgFAVnnm.js +0 -355
- package/chunks/standalone-xGV0dqPV.js +0 -689
|
@@ -1,71 +1,71 @@
|
|
|
1
1
|
import { o as e, t } from "./rolldown-runtime-DleVn1XH.js";
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
2
|
+
import { Cr as n, Ja as r, Mo as i, Na as a, Ya as o, _i as s, ca as c, fa as l, jo as u, la as d, oa as f, qa as p, sa as m, ss as h, xs as g, yc as _ } from "./visualization-filters-BwS0xUqs.js";
|
|
3
|
+
import { B as v, Br as y, G as b, Mt as x, Qt as S, Sn as C, bn as w, cn as T, f as E, li as D, o as O } from "./utils-BdJrEeIQ.js";
|
|
4
|
+
import { wt as k } from "./handlers-C63NVo7i.js";
|
|
5
5
|
import { n as A, t as j } from "./url-utils-B17gj_mr.js";
|
|
6
|
-
import { t as M } from "./Title-
|
|
7
|
-
var N = /* @__PURE__ */ e(
|
|
8
|
-
let n = e?.simpleTextObjectSettings || {},
|
|
6
|
+
import { t as M } from "./Title-BmvwZYkh.js";
|
|
7
|
+
var N = /* @__PURE__ */ e(D()), P = (e, t) => {
|
|
8
|
+
let n = e?.simpleTextObjectSettings || {}, i = n.fontFamily ?? s.fontFamily, a = n.textColor ?? s.textColor, o = t ? c(t, i) : i, l = t ? m(t, a) : a, { borderEnabled: u = s.borderEnabled, borderRadius: d = s.borderRadius, borderWidth: f = s.borderWidth } = n;
|
|
9
9
|
return {
|
|
10
|
-
textContentType: n.textContentType ??
|
|
11
|
-
textContent: n.textContent ??
|
|
12
|
-
variableId: n.variableId ??
|
|
13
|
-
representation: n.representation ??
|
|
14
|
-
paragraphMargin: n.paragraphMargin ??
|
|
15
|
-
textColor:
|
|
10
|
+
textContentType: n.textContentType ?? r.Text,
|
|
11
|
+
textContent: n.textContent ?? s.textContent,
|
|
12
|
+
variableId: n.variableId ?? s.variableId,
|
|
13
|
+
representation: n.representation ?? s.representation,
|
|
14
|
+
paragraphMargin: n.paragraphMargin ?? s.paragraphMargin,
|
|
15
|
+
textColor: l,
|
|
16
16
|
fontFamily: o,
|
|
17
|
-
fontSize: n.fontSize ??
|
|
18
|
-
bold: n.bold ??
|
|
19
|
-
weight: n.weight ??
|
|
20
|
-
italic: n.italic ??
|
|
21
|
-
underlined: n.underlined ??
|
|
22
|
-
strikethrough: n.strikethrough ??
|
|
23
|
-
letterSpacing: n.letterSpacing ??
|
|
24
|
-
lineSpacing: n.lineSpacing ??
|
|
25
|
-
wordWrap: n.wordWrap ??
|
|
26
|
-
linkEnabled: n.linkEnabled ??
|
|
27
|
-
linkUrl: n.linkUrl ??
|
|
28
|
-
backgroundType: n.backgroundType ??
|
|
29
|
-
backgroundColor: n.backgroundColor ??
|
|
30
|
-
imageOpacity: n.imageOpacity ??
|
|
31
|
-
backgroundBlur: n.backgroundBlur ??
|
|
17
|
+
fontSize: n.fontSize ?? s.fontSize,
|
|
18
|
+
bold: n.bold ?? s.bold,
|
|
19
|
+
weight: n.weight ?? s.weight,
|
|
20
|
+
italic: n.italic ?? s.italic,
|
|
21
|
+
underlined: n.underlined ?? s.underlined,
|
|
22
|
+
strikethrough: n.strikethrough ?? s.strikethrough,
|
|
23
|
+
letterSpacing: n.letterSpacing ?? s.letterSpacing,
|
|
24
|
+
lineSpacing: n.lineSpacing ?? s.lineSpacing,
|
|
25
|
+
wordWrap: n.wordWrap ?? s.wordWrap,
|
|
26
|
+
linkEnabled: n.linkEnabled ?? s.linkEnabled,
|
|
27
|
+
linkUrl: n.linkUrl ?? s.linkUrl,
|
|
28
|
+
backgroundType: n.backgroundType ?? s.backgroundType,
|
|
29
|
+
backgroundColor: n.backgroundColor ?? s.backgroundColor,
|
|
30
|
+
imageOpacity: n.imageOpacity ?? s.imageOpacity,
|
|
31
|
+
backgroundBlur: n.backgroundBlur ?? s.backgroundBlur,
|
|
32
32
|
backgroundImage: n.backgroundImage ?? void 0,
|
|
33
|
-
imageFitType: n.imageFitType ??
|
|
34
|
-
borderEnabled:
|
|
35
|
-
borderWidth:
|
|
36
|
-
borderRadius:
|
|
37
|
-
borderStyle: n.borderStyle ??
|
|
38
|
-
borderColor: n.borderColor ??
|
|
39
|
-
textPadding: n.textPadding ??
|
|
40
|
-
textShadow: n.textShadow ??
|
|
41
|
-
objectShadow: n.objectShadow ??
|
|
42
|
-
responsive: n.responsive ??
|
|
43
|
-
scaling: n.scaling ??
|
|
44
|
-
maxLines: n.maxLines ??
|
|
45
|
-
position: n.position ??
|
|
46
|
-
align: n.align ??
|
|
47
|
-
richTextScaling: n.richTextScaling ??
|
|
48
|
-
richTextResponsive: n.richTextResponsive ??
|
|
49
|
-
richTextMaxLines: n.richTextMaxLines ??
|
|
33
|
+
imageFitType: n.imageFitType ?? s.imageFitType,
|
|
34
|
+
borderEnabled: u,
|
|
35
|
+
borderWidth: u ?? !!f ? f : 0,
|
|
36
|
+
borderRadius: u ?? !!f ? d : 0,
|
|
37
|
+
borderStyle: n.borderStyle ?? s.borderStyle,
|
|
38
|
+
borderColor: n.borderColor ?? s.borderColor,
|
|
39
|
+
textPadding: n.textPadding ?? s.textPadding,
|
|
40
|
+
textShadow: n.textShadow ?? s.textShadow,
|
|
41
|
+
objectShadow: n.objectShadow ?? s.objectShadow,
|
|
42
|
+
responsive: n.responsive ?? s.responsive,
|
|
43
|
+
scaling: n.scaling ?? s.scaling,
|
|
44
|
+
maxLines: n.maxLines ?? s.maxLines,
|
|
45
|
+
position: n.position ?? s.position,
|
|
46
|
+
align: n.align ?? s.align,
|
|
47
|
+
richTextScaling: n.richTextScaling ?? s.richTextScaling,
|
|
48
|
+
richTextResponsive: n.richTextResponsive ?? s.richTextResponsive,
|
|
49
|
+
richTextMaxLines: n.richTextMaxLines ?? s.richTextMaxLines
|
|
50
50
|
};
|
|
51
51
|
}, F = 8, I = (e, t, n) => {
|
|
52
|
-
let r = t.fontSize ??
|
|
52
|
+
let r = t.fontSize ?? s.fontSize, i = t.letterSpacing ?? s.letterSpacing;
|
|
53
53
|
if (n.width === 0) return r;
|
|
54
|
-
let a =
|
|
55
|
-
for (;
|
|
56
|
-
let r = Math.floor((
|
|
54
|
+
let a = C(), 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
57
|
size: r,
|
|
58
58
|
label: e,
|
|
59
59
|
fontFamily: t.fontFamily ?? "",
|
|
60
60
|
letterSpacing: `${t.letterSpacing}`,
|
|
61
61
|
fontWeight: t.bold ? 700 : 400,
|
|
62
62
|
lineHeight: t.lineSpacing
|
|
63
|
-
}), d = Math.ceil((
|
|
64
|
-
f || p ?
|
|
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);
|
|
65
65
|
}
|
|
66
66
|
return a.cleanDOM(), o;
|
|
67
|
-
}, L = (e, t) => e ? t :
|
|
68
|
-
let r = t.textPadding ??
|
|
67
|
+
}, L = (e, t) => e ? t : i.None, R = (e) => e === i.ViewportWidth ? "vw" : "px", ee = (e, t, n) => {
|
|
68
|
+
let r = t.textPadding ?? s.textPadding;
|
|
69
69
|
return I(e, t, {
|
|
70
70
|
width: n.width - r * 2,
|
|
71
71
|
height: n.height - r * 2
|
|
@@ -73,7 +73,7 @@ var N = /* @__PURE__ */ e(b()), P = (e, t) => {
|
|
|
73
73
|
}, te = {
|
|
74
74
|
width: 1920,
|
|
75
75
|
height: 1080
|
|
76
|
-
}, z = (e) => e / 1920 * 100, B = (e) => e / te.height * 100, V =
|
|
76
|
+
}, z = (e) => e / 1920 * 100, B = (e) => e / te.height * 100, V = y(), ne = b({
|
|
77
77
|
wrapper: {
|
|
78
78
|
height: "100%",
|
|
79
79
|
position: "relative",
|
|
@@ -149,14 +149,14 @@ var N = /* @__PURE__ */ e(b()), P = (e, t) => {
|
|
|
149
149
|
};
|
|
150
150
|
return /* @__PURE__ */ (0, V.jsx)("div", {
|
|
151
151
|
ref: l,
|
|
152
|
-
className:
|
|
152
|
+
className: T({
|
|
153
153
|
[h.wrapper]: !0,
|
|
154
154
|
[h.changed]: p,
|
|
155
155
|
"ast-advanced-text-editor": !1
|
|
156
156
|
}),
|
|
157
157
|
onClick: g
|
|
158
158
|
});
|
|
159
|
-
}, H =
|
|
159
|
+
}, H = b({
|
|
160
160
|
mainContainer: {
|
|
161
161
|
width: "100%",
|
|
162
162
|
height: "100%",
|
|
@@ -173,7 +173,7 @@ var N = /* @__PURE__ */ e(b()), P = (e, t) => {
|
|
|
173
173
|
overflowX: "hidden",
|
|
174
174
|
lineHeight: 1,
|
|
175
175
|
color: "#1F1C3B",
|
|
176
|
-
fontFamily:
|
|
176
|
+
fontFamily: d("Roboto"),
|
|
177
177
|
fontStyle: "normal",
|
|
178
178
|
fontWeight: 700
|
|
179
179
|
},
|
|
@@ -191,7 +191,7 @@ var N = /* @__PURE__ */ e(b()), P = (e, t) => {
|
|
|
191
191
|
WebkitBoxOrient: "vertical"
|
|
192
192
|
}
|
|
193
193
|
});
|
|
194
|
-
|
|
194
|
+
d("Roboto");
|
|
195
195
|
var U = "\n height: 100%; \n width: 100%;\n display: block;\n overflow: auto;\n", W = `
|
|
196
196
|
width: 100%;
|
|
197
197
|
height: 100%;
|
|
@@ -203,7 +203,7 @@ var U = "\n height: 100%; \n width: 100%;\n display: block;\n overflow: auto
|
|
|
203
203
|
overflow: auto;
|
|
204
204
|
line-height: 1;
|
|
205
205
|
color: #1F1C3B;
|
|
206
|
-
font-family: Roboto, ${
|
|
206
|
+
font-family: Roboto, ${f};
|
|
207
207
|
font-style: normal;
|
|
208
208
|
font-weight: 700;
|
|
209
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) => {
|
|
@@ -414,11 +414,11 @@ var U = "\n height: 100%; \n width: 100%;\n display: block;\n overflow: auto
|
|
|
414
414
|
ſ: "s"
|
|
415
415
|
});
|
|
416
416
|
})), Y = /* @__PURE__ */ t(((e, t) => {
|
|
417
|
-
var
|
|
418
|
-
function
|
|
419
|
-
return e =
|
|
417
|
+
var r = J(), i = n(), a = /[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g, o = RegExp("[\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff]", "g");
|
|
418
|
+
function s(e) {
|
|
419
|
+
return e = i(e), e && e.replace(a, r).replace(o, "");
|
|
420
420
|
}
|
|
421
|
-
t.exports =
|
|
421
|
+
t.exports = s;
|
|
422
422
|
})), ie = /* @__PURE__ */ t(((e, t) => {
|
|
423
423
|
var n = /[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g;
|
|
424
424
|
function r(e) {
|
|
@@ -463,11 +463,11 @@ var U = "\n height: 100%; \n width: 100%;\n display: block;\n overflow: auto
|
|
|
463
463
|
}
|
|
464
464
|
t.exports = R;
|
|
465
465
|
})), se = /* @__PURE__ */ t(((e, t) => {
|
|
466
|
-
var
|
|
467
|
-
function
|
|
468
|
-
return e =
|
|
466
|
+
var r = ie(), i = ae(), a = n(), o = oe();
|
|
467
|
+
function s(e, t, n) {
|
|
468
|
+
return e = a(e), t = n ? void 0 : t, t === void 0 ? i(e) ? o(e) : r(e) : e.match(t) || [];
|
|
469
469
|
}
|
|
470
|
-
t.exports =
|
|
470
|
+
t.exports = s;
|
|
471
471
|
})), ce = /* @__PURE__ */ t(((e, t) => {
|
|
472
472
|
var n = K(), r = Y(), i = se(), a = RegExp("['’]", "g");
|
|
473
473
|
function o(e) {
|
|
@@ -480,8 +480,8 @@ var U = "\n height: 100%; \n width: 100%;\n display: block;\n overflow: auto
|
|
|
480
480
|
t.exports = ce()(function(e, t, n) {
|
|
481
481
|
return e + (n ? "-" : "") + t.toLowerCase();
|
|
482
482
|
});
|
|
483
|
-
})))()), ue = (e, t =
|
|
484
|
-
let r = [e.underlined ? "underline" : void 0, e.strikethrough ? "line-through" : void 0].filter((e) => !!e).join(" "),
|
|
483
|
+
})))()), ue = (e, t = s.fontSize, n = "px") => {
|
|
484
|
+
let r = [e.underlined ? "underline" : void 0, e.strikethrough ? "line-through" : void 0].filter((e) => !!e).join(" "), i = Math.ceil(t / 10);
|
|
485
485
|
return {
|
|
486
486
|
fontFamily: e.fontFamily ?? void 0,
|
|
487
487
|
fontSize: `${t}${n}`,
|
|
@@ -492,12 +492,12 @@ var U = "\n height: 100%; \n width: 100%;\n display: block;\n overflow: auto
|
|
|
492
492
|
textDecoration: r,
|
|
493
493
|
letterSpacing: `${e.letterSpacing}px`,
|
|
494
494
|
lineHeight: e.lineSpacing,
|
|
495
|
-
whiteSpace: e.responsive || [o.HTML, o.Markdown].includes(e.representation ??
|
|
496
|
-
marginTop: e.position ===
|
|
497
|
-
marginBottom: e.position ===
|
|
498
|
-
textShadow: e.textShadow ? `0px 1px 2px ${
|
|
499
|
-
paddingTop:
|
|
500
|
-
paddingBottom:
|
|
495
|
+
whiteSpace: e.responsive || [o.HTML, o.Markdown].includes(e.representation ?? s.representation) ? e.wordWrap ? "pre-line" : "nowrap" : "pre-line",
|
|
496
|
+
marginTop: e.position === g.Top ? "unset" : "auto",
|
|
497
|
+
marginBottom: e.position === g.Bottom ? "unset" : "auto",
|
|
498
|
+
textShadow: e.textShadow ? `0px 1px 2px ${a.black}` : "none",
|
|
499
|
+
paddingTop: i,
|
|
500
|
+
paddingBottom: i,
|
|
501
501
|
overflow: e.responsive ? "visible" : "hidden",
|
|
502
502
|
textOverflow: e.responsive ? "initial" : "ellipsis",
|
|
503
503
|
WebkitLineClamp: e.maxLines || 1,
|
|
@@ -505,21 +505,21 @@ var U = "\n height: 100%; \n width: 100%;\n display: block;\n overflow: auto
|
|
|
505
505
|
display: e.responsive ? "initial" : "-webkit-box"
|
|
506
506
|
};
|
|
507
507
|
}, X = (e) => {
|
|
508
|
-
let t = e.borderStyle ===
|
|
508
|
+
let t = e.borderStyle === h.Line ? "solid" : "dashed";
|
|
509
509
|
return {
|
|
510
|
-
backgroundColor: (e.backgroundType ===
|
|
510
|
+
backgroundColor: (e.backgroundType === p.Image ? null : e.backgroundColor) ?? "transparent",
|
|
511
511
|
border: `${e.borderWidth}px ${t} ${e.borderColor}`,
|
|
512
512
|
borderRadius: `${e.borderRadius}px`,
|
|
513
513
|
backdropFilter: `blur(${e.backgroundBlur}px)`,
|
|
514
|
-
boxShadow: e.objectShadow ? `0px 2px 4px ${
|
|
514
|
+
boxShadow: e.objectShadow ? `0px 2px 4px ${a.alphaBlack(.25)}` : "none"
|
|
515
515
|
};
|
|
516
516
|
}, Z = (e) => ({ padding: `${e.textPadding ?? 0}px` }), de = (e, t, n) => {
|
|
517
517
|
if (!n) return {};
|
|
518
|
-
let
|
|
518
|
+
let r = e.fontSize ?? s.fontSize;
|
|
519
519
|
switch (t) {
|
|
520
|
-
case
|
|
521
|
-
case
|
|
522
|
-
case
|
|
520
|
+
case u.ViewportWidth: return { fontSize: `${z(r)}vw` };
|
|
521
|
+
case u.ViewportHeight: return { fontSize: `${B(r)}vh` };
|
|
522
|
+
case u.ViewportWidthHeight: return { fontSize: `min(${z(r)}vw, ${B(r)}vh)` };
|
|
523
523
|
}
|
|
524
524
|
return {};
|
|
525
525
|
}, fe = {
|
|
@@ -553,56 +553,56 @@ var U = "\n height: 100%; \n width: 100%;\n display: block;\n overflow: auto
|
|
|
553
553
|
.astrato-html-container li {
|
|
554
554
|
white-space: normal;
|
|
555
555
|
}`, he = (e) => `<div class="astrato-html-main-container"><div class="astrato-html-container">${e}</div></div>`, ge = (e, t, n) => {
|
|
556
|
-
let { textContent:
|
|
557
|
-
return [
|
|
556
|
+
let { textContent: i, variableId: a, textContentType: o = r.Text } = e;
|
|
557
|
+
return [r.Text, r.Delta].includes(o) ? i || n : a ? `${t[a]?.value ?? ""}` : n;
|
|
558
558
|
}, _e = (e) => e.replace(/(\r\n|\n|\r)/g, " "), $ = ({ textObjectSettings: e, scaling: t, elementSize: n }) => {
|
|
559
|
-
let r = H(),
|
|
560
|
-
t ===
|
|
561
|
-
let
|
|
562
|
-
...
|
|
559
|
+
let r = H(), a = S(), c = E(), { variablesDict: l } = O(), [u, d] = (0, N.useState)(""), f = ge(e, l, ""), m = e.fontSize ?? s.fontSize;
|
|
560
|
+
t === i.FitToObject && n ? m = ee(f, e, n) : t === i.ViewportWidth && (m = z(m));
|
|
561
|
+
let h = a?.daedalus.objectCapabilities.editable, g = e.backgroundType === p.Image, _ = [o.HTML, o.Markdown].includes(e.representation ?? s.representation), v = ue(e, m, R(t)), y = X(e), b = Z(e), x = Q(e), C = {
|
|
562
|
+
...b,
|
|
563
563
|
...v,
|
|
564
564
|
fontSize: `${e.fontSize}px`
|
|
565
565
|
};
|
|
566
|
-
delete
|
|
566
|
+
delete C.paddingBottom, delete C.paddingTop, delete C.display, (0, N.useEffect)(() => {
|
|
567
567
|
let t = async () => {
|
|
568
568
|
e.representation === o.Markdown ? d(await A(f)) : d(f);
|
|
569
569
|
};
|
|
570
570
|
(async () => {
|
|
571
|
-
await t(), !
|
|
571
|
+
await t(), !g && !_ && c();
|
|
572
572
|
})();
|
|
573
573
|
}, [
|
|
574
574
|
f,
|
|
575
575
|
e.representation,
|
|
576
|
-
h,
|
|
577
576
|
g,
|
|
578
|
-
|
|
577
|
+
_,
|
|
578
|
+
c
|
|
579
579
|
]);
|
|
580
|
-
let
|
|
580
|
+
let T = j(e.linkUrl ?? s.linkUrl), D = !_ && !e.responsive, k = !e.responsive && !_ ? _e(u) : u;
|
|
581
581
|
return /* @__PURE__ */ (0, V.jsx)(M, {
|
|
582
|
-
title:
|
|
582
|
+
title: D ? k : null,
|
|
583
583
|
children: /* @__PURE__ */ (0, V.jsxs)("div", {
|
|
584
584
|
className: r.mainContainer,
|
|
585
|
-
style:
|
|
585
|
+
style: y,
|
|
586
586
|
"data-testid": "simple-text-object-container",
|
|
587
587
|
children: [
|
|
588
|
-
|
|
588
|
+
_ ? /* @__PURE__ */ (0, V.jsx)(w, {
|
|
589
589
|
html: he(k),
|
|
590
|
-
css: me(
|
|
590
|
+
css: me(C, e),
|
|
591
591
|
style: fe,
|
|
592
|
-
onRendered:
|
|
592
|
+
onRendered: c
|
|
593
593
|
}) : null,
|
|
594
|
-
|
|
594
|
+
g ? /* @__PURE__ */ (0, V.jsx)("img", {
|
|
595
595
|
src: e.backgroundImage,
|
|
596
596
|
className: r.image,
|
|
597
|
-
style:
|
|
598
|
-
onLoad: () =>
|
|
599
|
-
onError: () =>
|
|
597
|
+
style: x,
|
|
598
|
+
onLoad: () => c(),
|
|
599
|
+
onError: () => c(),
|
|
600
600
|
alt: "text background"
|
|
601
601
|
}) : null,
|
|
602
|
-
|
|
602
|
+
h || !_ ? /* @__PURE__ */ (0, V.jsx)(V.Fragment, { children: /* @__PURE__ */ (0, V.jsx)("div", {
|
|
603
603
|
className: r.textContainer,
|
|
604
|
-
style:
|
|
605
|
-
children: e.linkEnabled &&
|
|
604
|
+
style: b,
|
|
605
|
+
children: e.linkEnabled && T ? /* @__PURE__ */ (0, V.jsx)("div", {
|
|
606
606
|
className: r.spanElement,
|
|
607
607
|
style: v,
|
|
608
608
|
"data-ellipsis": !0,
|
|
@@ -610,12 +610,12 @@ var U = "\n height: 100%; \n width: 100%;\n display: block;\n overflow: auto
|
|
|
610
610
|
children: /* @__PURE__ */ (0, V.jsx)("a", {
|
|
611
611
|
target: "_blank",
|
|
612
612
|
rel: "noreferrer",
|
|
613
|
-
href:
|
|
613
|
+
href: T,
|
|
614
614
|
style: {
|
|
615
615
|
textDecoration: "inherit",
|
|
616
616
|
color: "inherit"
|
|
617
617
|
},
|
|
618
|
-
children:
|
|
618
|
+
children: _ ? "" : k
|
|
619
619
|
})
|
|
620
620
|
}) : /* @__PURE__ */ (0, V.jsx)("div", {
|
|
621
621
|
className: r.spanElement,
|
|
@@ -625,54 +625,54 @@ var U = "\n height: 100%; \n width: 100%;\n display: block;\n overflow: auto
|
|
|
625
625
|
},
|
|
626
626
|
"data-ellipsis": !0,
|
|
627
627
|
"data-testid": "simple-text-object-content",
|
|
628
|
-
children:
|
|
628
|
+
children: _ ? "" : k
|
|
629
629
|
})
|
|
630
630
|
}) }) : null
|
|
631
631
|
]
|
|
632
632
|
})
|
|
633
633
|
});
|
|
634
|
-
}, ve =
|
|
635
|
-
let n =
|
|
634
|
+
}, ve = x($), ye = ({ textObjectSettings: e, isRichTextScalingSet: t }) => {
|
|
635
|
+
let n = S(), r = v(), i = X(e), a = Z(e), o = H(), s = E(), c = e.richTextScaling ?? u.ViewportBreakpoints, l = de(e, c, t);
|
|
636
636
|
return (0, N.useEffect)(() => {
|
|
637
|
-
|
|
638
|
-
}, [
|
|
639
|
-
className:
|
|
637
|
+
s();
|
|
638
|
+
}, [s]), /* @__PURE__ */ (0, V.jsx)("div", {
|
|
639
|
+
className: o.mainContainer,
|
|
640
640
|
style: {
|
|
641
|
+
...i,
|
|
641
642
|
...a,
|
|
642
|
-
...
|
|
643
|
-
...u
|
|
643
|
+
...l
|
|
644
644
|
},
|
|
645
645
|
"data-testid": "simple-text-object-container",
|
|
646
646
|
children: /* @__PURE__ */ (0, V.jsx)(re, {
|
|
647
647
|
value: e.textContent,
|
|
648
648
|
backendAPI: n,
|
|
649
|
-
responsive:
|
|
649
|
+
responsive: c === u.ViewportBreakpoints,
|
|
650
650
|
richTextResponsive: e.richTextResponsive,
|
|
651
651
|
richTextMaxLines: e.richTextMaxLines,
|
|
652
652
|
onSubmit: (t, n) => {
|
|
653
|
-
let
|
|
654
|
-
e.textContent === t && e.richTextResponsive ===
|
|
653
|
+
let i = n.overflowBehavior === "responsive", a = n.maxLines;
|
|
654
|
+
e.textContent === t && e.richTextResponsive === i && e.richTextMaxLines === a || k(r, {
|
|
655
655
|
textContent: t,
|
|
656
|
-
richTextResponsive:
|
|
656
|
+
richTextResponsive: i,
|
|
657
657
|
richTextMaxLines: a
|
|
658
658
|
});
|
|
659
659
|
}
|
|
660
660
|
})
|
|
661
661
|
});
|
|
662
662
|
}, be = (e) => {
|
|
663
|
-
if (!e.vSpec || !
|
|
664
|
-
let t = e.vTheme ??
|
|
663
|
+
if (!e.vSpec || !_(e.vSpec)) return null;
|
|
664
|
+
let t = e.vTheme ?? l, n = P(e.vSpec, t), a = L(n.responsive ?? s.responsive, n.scaling ?? s.scaling), o = {
|
|
665
665
|
...e,
|
|
666
|
-
scaling:
|
|
666
|
+
scaling: a,
|
|
667
667
|
textObjectSettings: n
|
|
668
668
|
};
|
|
669
|
-
if (n.textContentType ===
|
|
669
|
+
if (n.textContentType === r.Delta) return /* @__PURE__ */ (0, V.jsx)(ye, {
|
|
670
670
|
textObjectSettings: n,
|
|
671
671
|
isRichTextScalingSet: e.vSpec?.simpleTextObjectSettings?.richTextScaling !== void 0
|
|
672
672
|
});
|
|
673
|
-
switch (
|
|
674
|
-
case
|
|
675
|
-
default: return /* @__PURE__ */ (0, V.jsx)($, { ...
|
|
673
|
+
switch (a) {
|
|
674
|
+
case i.FitToObject: return /* @__PURE__ */ (0, V.jsx)(ve, { ...o });
|
|
675
|
+
default: return /* @__PURE__ */ (0, V.jsx)($, { ...o });
|
|
676
676
|
}
|
|
677
677
|
};
|
|
678
678
|
export { be as SimpleTextObject };
|