@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.
Files changed (140) hide show
  1. package/README.md +8 -2
  2. package/THIRD_PARTY_NOTICES.md +2 -229
  3. package/VISUALIZATION_DEFINITIONS.md +68 -114
  4. package/chunks/Button-BrGKp9Nm.js +110 -0
  5. package/chunks/DefaultPropsProvider-BsfB7QTn.js +257 -0
  6. package/chunks/FieldTypeIcon-Drs6hSJF.js +22 -0
  7. package/chunks/{LinearProgress-B1FeWaen.js → LinearProgress-VtfFx2vJ.js} +55 -55
  8. package/chunks/MenuOption-ByRqhRdX.js +3934 -0
  9. package/chunks/Title-CO5dP1ma.js +1691 -0
  10. package/chunks/ToggleButton-KOBAimC1.js +112 -0
  11. package/chunks/{app-filter-bar.compiler-BGJ7HAbr.js → app-filter-bar.compiler-TwVTeoj5.js} +10 -10
  12. package/chunks/{bar.compiler-CT0ZbQKc.js → bar.compiler-DuQg8EUb.js} +84 -84
  13. package/chunks/builder-DEDvNq1k.js +201 -0
  14. package/chunks/{color-settings-ZIvgNTq1.js → color-rules-CN7TcGrC.js} +2 -6
  15. package/chunks/color-settings-3VRlf_Vw.js +6 -0
  16. package/chunks/colorManipulator-D8Pjy1pf.js +45 -0
  17. package/chunks/coloring-CncX_JRX.js +278 -0
  18. package/chunks/{definitions-D3OVqmXl.js → definitions-BPJQTx16.js} +490 -382
  19. package/chunks/{escobar-eDjtGpkC.js → escobar-DRhRMYRE.js} +6067 -4742
  20. package/chunks/event-bus-CrLB-Y8z.js +3 -0
  21. package/chunks/extend-preset-CUFNpmPe.js +4398 -0
  22. package/chunks/{filter.compiler-DBsyRBJt.js → filter.compiler-w27dlv0C.js} +12 -12
  23. package/chunks/{filtering-tqjAyJH5.js → filtering-cc7WqWpg.js} +391 -310
  24. package/chunks/{handlers-VTBfIZYZ.js → handlers-TOT-7INo.js} +3241 -3442
  25. package/chunks/icon-picker-styles-CoJmwTRi.js +2246 -0
  26. package/chunks/isEqual-B8loyPsC.js +12 -0
  27. package/chunks/label-format-type-weq1XfcX.js +8 -0
  28. package/chunks/{line.compiler-CzdM5Ld0.js → line.compiler-Ct1WhN2p.js} +27 -27
  29. package/chunks/logger-DpQtYQnX.js +1163 -0
  30. package/chunks/lookup-BWllin0q.js +36 -0
  31. package/chunks/{metadata-BGElBy5Z.js → metadata-WABZrt7Y.js} +1 -1
  32. package/chunks/{number.compiler-G-R7y16P.js → number.compiler-D8TPly-4.js} +13 -13
  33. package/chunks/{operations-CTNUX6Sy.js → operations-Dh4v1Ovt.js} +9314 -9283
  34. package/chunks/{range-CiwTbMig.js → range-Bi-7zT0k.js} +2 -2
  35. package/chunks/render-wrappers-OEmtaM8g.js +2 -0
  36. package/chunks/{registry-CsQQzukD.js → requirements-Dvd8jqYF.js} +218 -222
  37. package/chunks/responsive.styles-DSiOGD7u.js +82 -0
  38. package/chunks/{shared-CBvcC5YV.js → shared-Bn4N5QcZ.js} +424 -424
  39. package/chunks/src-77e3mC7i.js +391 -0
  40. package/chunks/standalone-B55oyW6c.js +689 -0
  41. package/chunks/{standalone-C3gg736V.js → standalone-BDhPQtzQ.js} +375 -341
  42. package/chunks/{standalone-BMIbT1b2.js → standalone-BGkmozIb.js} +992 -837
  43. package/chunks/standalone-BMTCb10X.js +179 -0
  44. package/chunks/standalone-BXKRE_Se.js +468 -0
  45. package/chunks/standalone-Bes8srx1.js +354 -0
  46. package/chunks/standalone-BjZp0QMe.js +2 -0
  47. package/chunks/{standalone-JuLF-OoH.js → standalone-BlMIwpEe.js} +634 -519
  48. package/chunks/{standalone-C_rYnZ0N.js → standalone-C8ZAEutO.js} +43 -42
  49. package/chunks/standalone-C8qAelL4.js +2 -0
  50. package/chunks/standalone-CJvIXsQE.js +743 -0
  51. package/chunks/standalone-CLmGb7nn2.js +355 -0
  52. package/chunks/standalone-CM5XcAN5.js +52327 -0
  53. package/chunks/standalone-CXNP6-xD.js +420 -0
  54. package/chunks/{standalone-vzBY6q0I2.js → standalone-D5Q5ngsD.js} +57 -55
  55. package/chunks/standalone-DLlyRIE6.js +287 -0
  56. package/chunks/standalone-DMcI1afI.js +396 -0
  57. package/chunks/{standalone-DC-aUgXC.js → standalone-DN4S1MjT.js} +1111 -1092
  58. package/chunks/standalone-DT0wKji7.js +6 -0
  59. package/chunks/standalone-DW6NT205.js +518 -0
  60. package/chunks/standalone-DYQIQH4c.js +2095 -0
  61. package/chunks/standalone-D__XCp-h.js +1003 -0
  62. package/chunks/standalone-XTgSsTAa.js +354 -0
  63. package/chunks/{standalone-v1oxfU20.js → standalone-XuGksArp.js} +20 -20
  64. package/chunks/{standalone-0M4HlmDW2.js → standalone-vBnBS2YC.js} +1047 -964
  65. package/chunks/{standalone-BtSHCp2U2.js → standalone-we5D5MIn.js} +173 -168
  66. package/chunks/{table.compiler-tb914oj3.js → table.compiler-DMeeHxb6.js} +29 -29
  67. package/chunks/useFieldName-Cjn9KCVp.js +7 -0
  68. package/chunks/useSlotProps-DLbQp4lc.js +166 -0
  69. package/chunks/{utils-Bg7K-t6K.js → utils-vdmi_2PK.js} +6271 -7804
  70. package/chunks/{view-Bn83C8d9.js → view-BuwQugKb.js} +2717 -3504
  71. package/chunks/{isEqual-BDxAhUo8.js → visualization-filters-Cc4KU-l-.js} +1887 -1946
  72. package/chunks/with-html-element-D0uY2zjI.js +7328 -0
  73. package/definitions.js +2 -2
  74. package/docs/operations/astrato-app-filter-bar.md +1 -1
  75. package/docs/operations/bar.md +31 -14
  76. package/docs/operations/combo.md +1 -1
  77. package/docs/operations/date-picker.md +3 -3
  78. package/docs/operations/distribution-gauge.md +13 -13
  79. package/docs/operations/dot.md +13 -13
  80. package/docs/operations/filter.md +1 -1
  81. package/docs/operations/gauge.md +13 -13
  82. package/docs/operations/heatMap.md +13 -13
  83. package/docs/operations/histogram.md +1 -1
  84. package/docs/operations/iframe.md +1 -1
  85. package/docs/operations/image.md +1 -1
  86. package/docs/operations/index.md +3 -3
  87. package/docs/operations/line.md +7 -7
  88. package/docs/operations/number.md +1 -1
  89. package/docs/operations/pie.md +13 -13
  90. package/docs/operations/radar.md +7 -7
  91. package/docs/operations/sankey.md +13 -13
  92. package/docs/operations/scatter.md +13 -13
  93. package/docs/operations/shape.md +1 -1
  94. package/docs/operations/simpleTextObject.md +1 -1
  95. package/docs/operations/slider.md +1 -1
  96. package/docs/operations/table.md +18 -1
  97. package/docs/operations/tree.md +51 -37
  98. package/docs/operations/treemap.md +63 -49
  99. package/docs/operations/waterfall.md +1 -1
  100. package/docs/operations/word-cloud.md +13 -13
  101. package/getters.js +7 -7
  102. package/index.js +419 -417
  103. package/metadata.js +17 -18
  104. package/operations.js +13 -13
  105. package/package.json +70 -55
  106. package/src/definitions/index.d.ts +1 -1
  107. package/src/definitions/model/definitions/descriptors/descriptor-metadata.d.ts +53 -30
  108. package/src/definitions/model/definitions/index.d.ts +1 -1
  109. package/src/definitions/model/definitions/schema-registry.d.ts +2 -2
  110. package/src/definitions/model/definitions/schemas/object.schema.d.ts +2 -2
  111. package/src/definitions/model/definitions/types/compilation.types.d.ts +10 -0
  112. package/src/definitions/model/definitions/types/index.d.ts +1 -1
  113. package/src/getters/index.d.ts +1 -1
  114. package/src/operations/index.d.ts +1 -1
  115. package/src/types.d.ts +1 -0
  116. package/chunks/ClickAwayListener-BbeNMAvj.js +0 -52
  117. package/chunks/builder-B6dWSIdD.js +0 -12289
  118. package/chunks/coloring-B1XAfg6b.js +0 -664
  119. package/chunks/events-WZut5Ow6.js +0 -4
  120. package/chunks/grouping-type-On4s9Thj.js +0 -3
  121. package/chunks/requirements-DYjZCFyf.js +0 -6
  122. package/chunks/standalone-0ashe9w1.js +0 -411
  123. package/chunks/standalone-B7jax8wa.js +0 -339
  124. package/chunks/standalone-BK0VYU-l.js +0 -463
  125. package/chunks/standalone-BZV5vOwA.js +0 -6
  126. package/chunks/standalone-BhDrWj4p.js +0 -1980
  127. package/chunks/standalone-BvaKdky9.js +0 -344
  128. package/chunks/standalone-BwtM31-f.js +0 -2
  129. package/chunks/standalone-CC1VUjO32.js +0 -299
  130. package/chunks/standalone-CoLrAxRV.js +0 -13198
  131. package/chunks/standalone-DCtRoTWg.js +0 -675
  132. package/chunks/standalone-DUDFTBqL.js +0 -833
  133. package/chunks/standalone-DhZkX9Td.js +0 -2
  134. package/chunks/standalone-DtLElfuM.js +0 -512
  135. package/chunks/standalone-G9Q4Uczu.js +0 -726
  136. package/chunks/standalone-_DeX21JJ.js +0 -383
  137. package/chunks/standalone-gFhKZh8m.js +0 -179
  138. package/chunks/standalone-tDNy-SFH.js +0 -281
  139. package/chunks/ui-DQWtv2iM.js +0 -63551
  140. 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 { Ba as n, Fi as r, Ko as i, Mt as a, Ra as o, Sa as s, Ta as c, _a as l, bo as u, ga as d, os as f, va as p, xo as m, ya as h, za as g } from "./isEqual-BDxAhUo8.js";
3
- import { $t as _, B as v, Cn as y, Ei as b, Fn as x, G as S, Kn as C, Wn as w, Yi as T, a as E, d as D } from "./utils-Bg7K-t6K.js";
4
- import { gt as O } from "./handlers-VTBfIZYZ.js";
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
- var M = /* @__PURE__ */ e(T()), N = (e, t) => {
8
- let n = e?.simpleTextObjectSettings || {}, i = n.fontFamily ?? r.fontFamily, a = n.textColor ?? r.textColor, o = t ? p(t, i) : i, s = t ? l(t, a) : a, { borderEnabled: c = r.borderEnabled, borderRadius: u = r.borderRadius, borderWidth: d = r.borderWidth } = n;
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: n.textContentType ?? g.Text,
11
- textContent: n.textContent ?? r.textContent,
12
- variableId: n.variableId ?? r.variableId,
13
- representation: n.representation ?? r.representation,
14
- paragraphMargin: n.paragraphMargin ?? r.paragraphMargin,
15
- textColor: s,
16
- fontFamily: o,
17
- fontSize: n.fontSize ?? r.fontSize,
18
- bold: n.bold ?? r.bold,
19
- weight: n.weight ?? r.weight,
20
- italic: n.italic ?? r.italic,
21
- underlined: n.underlined ?? r.underlined,
22
- strikethrough: n.strikethrough ?? r.strikethrough,
23
- letterSpacing: n.letterSpacing ?? r.letterSpacing,
24
- lineSpacing: n.lineSpacing ?? r.lineSpacing,
25
- wordWrap: n.wordWrap ?? r.wordWrap,
26
- linkEnabled: n.linkEnabled ?? r.linkEnabled,
27
- linkUrl: n.linkUrl ?? r.linkUrl,
28
- backgroundType: n.backgroundType ?? r.backgroundType,
29
- backgroundColor: n.backgroundColor ?? r.backgroundColor,
30
- imageOpacity: n.imageOpacity ?? r.imageOpacity,
31
- backgroundBlur: n.backgroundBlur ?? r.backgroundBlur,
32
- backgroundImage: n.backgroundImage ?? r.backgroundImage,
33
- imageFitType: n.imageFitType ?? r.imageFitType,
34
- borderEnabled: c,
35
- borderWidth: c ?? !!d ? d : 0,
36
- borderRadius: c ?? !!d ? u : 0,
37
- borderStyle: n.borderStyle ?? r.borderStyle,
38
- borderColor: n.borderColor ?? r.borderColor,
39
- textPadding: n.textPadding ?? r.textPadding,
40
- textShadow: n.textShadow ?? r.textShadow,
41
- objectShadow: n.objectShadow ?? r.objectShadow,
42
- responsive: n.responsive ?? r.responsive,
43
- scaling: n.scaling ?? r.scaling,
44
- maxLines: n.maxLines ?? r.maxLines,
45
- position: n.position ?? r.position,
46
- align: n.align ?? r.align,
47
- richTextScaling: n.richTextScaling ?? r.richTextScaling,
48
- richTextResponsive: n.richTextResponsive ?? r.richTextResponsive,
49
- richTextMaxLines: n.richTextMaxLines ?? r.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
- }, P = 8, F = (e, t, n) => {
52
- if (n.width === 0) return t.fontSize;
53
- let r = C(), i = 0, a = 0, o = t.fontSize;
54
- for (; a <= o;) {
55
- let s = Math.floor((a + o) / 2), { width: c, height: l } = r.getTextSize({
56
- size: s,
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
- }), u = Math.ceil((c + t.letterSpacing) / (n.width - P * 2)), d = !t.wordWrap && u > 1, f = l * u * 1.2 + P * 2 > n.height;
63
- d || f ? o = s - 1 : (i = s, a = s + 1);
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 r.cleanDOM(), i;
66
- }, I = (e, t) => e ? t : m.None, L = (e) => e === m.ViewportWidth ? "vw" : "px", R = (e, t, n) => F(e, t, {
67
- width: n.width - t.textPadding * 2,
68
- height: n.height - t.textPadding * 2
69
- }), ee = {
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 / ee.height * 100, V = b(), te = S({
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
- }), ne = ({ value: e, backendAPI: t, onBlur: n, onSubmit: r, responsive: i, richTextResponsive: a = !0, richTextMaxLines: o = 1 }) => {
88
- let s = t.daedalus.variablesApi, c = t.objectId || "", l = (0, M.useRef)(null), u = (0, M.useRef)(null), d = t.dataSetsService, f = t.daedalus.objectCapabilities.editable || t.daedalus.isPreview(), [p, m] = (0, M.useState)(!1), h = te();
89
- (0, M.useEffect)(() => {
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, M.useEffect)(() => {
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: x({
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 = S({
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: h("Roboto"),
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
- h("Roboto");
191
- var re = "\n height: 100%; \n width: 100%;\n display: block;\n overflow: auto;\n", U = `
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, ${d};
206
+ font-family: Roboto, ${a};
203
207
  font-style: normal;
204
208
  font-weight: 700;
205
- `, W = "\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", G = /* @__PURE__ */ t(((e, t) => {
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
- })), K = /* @__PURE__ */ t(((e, t) => {
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
- })), q = /* @__PURE__ */ t(((e, t) => {
220
- t.exports = K()({
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
- })), ie = /* @__PURE__ */ t(((e, t) => {
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
- })), ae = /* @__PURE__ */ t(((e, t) => {
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 = G(), r = J(), i = oe(), a = RegExp("['’]", "g");
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
- })), ce = /* @__PURE__ */ e((/* @__PURE__ */ t(((e, t) => {
476
- t.exports = se()(function(e, t, n) {
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
- })))()), le = (e, t, r = "px") => {
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}${r}`,
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 || [n.HTML, n.Markdown].includes(e.representation) ? e.wordWrap ? "pre-line" : "nowrap" : "pre-line",
492
- marginTop: e.position === f.Top ? "unset" : "auto",
493
- marginBottom: e.position === f.Bottom ? "unset" : "auto",
494
- textShadow: e.textShadow ? `0px 1px 2px ${c.black}` : "none",
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 === i.Line ? "solid" : "dashed";
508
+ let t = e.borderStyle === m.Line ? "solid" : "dashed";
505
509
  return {
506
- backgroundColor: (e.backgroundType === o.Image ? null : e.backgroundColor) ?? "transparent",
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 ${c.alphaBlack(.25)}` : "none"
514
+ boxShadow: e.objectShadow ? `0px 2px 4px ${r.alphaBlack(.25)}` : "none"
511
515
  };
512
- }, Z = (e) => ({ padding: `${e.textPadding ?? 0}px` }), ue = (e, t, n) => {
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 u.ViewportWidth: return { fontSize: `${z(r)}vw` };
517
- case u.ViewportHeight: return { fontSize: `${B(r)}vh` };
518
- case u.ViewportWidthHeight: return { fontSize: `min(${z(r)}vw, ${B(r)}vh)` };
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
- }, de = {
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
- }), Q = (e) => Object.entries(e).map(([e, t]) => {
530
- let n = (0, ce.default)(e);
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(" "), pe = (e, t) => `:host {
537
- ${re}
540
+ }).join(" "), me = (e, t) => `:host {
541
+ ${U}
538
542
  }
539
543
  .astrato-html-main-container {
540
- ${U}
544
+ ${W}
541
545
  }
542
546
  .astrato-html-container {
543
- ${W}
544
- ${Q(e)}
547
+ ${G}
548
+ ${pe(e)}
545
549
  }
546
550
  .astrato-html-container p {
547
- margin: ${t.representation === n.Markdown ? `${t.paragraphMargin}px` : 0};
551
+ margin: ${t.representation === d.Markdown ? `${t.paragraphMargin}px` : 0};
548
552
  }
549
553
  .astrato-html-container li {
550
554
  white-space: normal;
551
- }`, me = (e) => `<div class="astrato-html-main-container"><div class="astrato-html-container">${e}</div></div>`, he = (e, t, n) => {
552
- let { textContent: r, variableId: i, textContentType: a = g.Text } = e;
553
- return [g.Text, g.Delta].includes(a) ? r || n : i ? `${t[i]?.value ?? ""}` : n;
554
- }, ge = (e) => e.replace(/(\r\n|\n|\r)/g, " "), $ = ({ textObjectSettings: e, scaling: t, elementSize: r }) => {
555
- let i = H(), a = y(), s = D(), { variablesDict: c } = E(), [l, u] = (0, M.useState)(""), d = he(e, c, ""), f = e.fontSize;
556
- t === m.FitToObject ? f = R(d, e, r) : t === m.ViewportWidth && (f = z(f));
557
- let p = a?.daedalus.objectCapabilities.editable, h = e.backgroundType === o.Image, g = [n.HTML, n.Markdown].includes(e.representation), _ = le(e, f, L(t)), v = X(e), b = Z(e), x = fe(e), S = {
558
- ...b,
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 S.paddingBottom, delete S.paddingTop, delete S.display, (0, M.useEffect)(() => {
566
+ delete E.paddingBottom, delete E.paddingTop, delete E.display, (0, N.useEffect)(() => {
563
567
  let t = async () => {
564
- e.representation === n.Markdown ? u(await A(d)) : u(d);
568
+ e.representation === d.Markdown ? l(await A(u)) : l(u);
565
569
  };
566
570
  (async () => {
567
- await t(), !h && !g && s();
571
+ await t(), !h && !_ && a();
568
572
  })();
569
573
  }, [
570
- d,
574
+ u,
571
575
  e.representation,
572
576
  h,
573
- g,
574
- s
577
+ _,
578
+ a
575
579
  ]);
576
- let C = j(e.linkUrl), T = !g && !e.responsive, O = !e.responsive && !g ? ge(l) : l;
577
- return /* @__PURE__ */ (0, V.jsx)(k, {
578
- title: T ? O : null,
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: i.mainContainer,
581
- style: v,
584
+ className: r.mainContainer,
585
+ style: y,
582
586
  "data-testid": "simple-text-object-container",
583
587
  children: [
584
- g ? /* @__PURE__ */ (0, V.jsx)(w, {
585
- html: me(O),
586
- css: pe(S, e),
587
- style: de,
588
- onRendered: s
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: i.image,
593
- style: x,
594
- onLoad: () => s(),
595
- onError: () => s(),
596
+ className: r.image,
597
+ style: S,
598
+ onLoad: () => a(),
599
+ onError: () => a(),
596
600
  alt: "text background"
597
601
  }) : null,
598
- p || !g ? /* @__PURE__ */ (0, V.jsx)(V.Fragment, { children: /* @__PURE__ */ (0, V.jsx)("div", {
599
- className: i.textContainer,
600
- style: b,
601
- children: e.linkEnabled && C ? /* @__PURE__ */ (0, V.jsx)("div", {
602
- className: i.spanElement,
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: C,
613
+ href: D,
610
614
  style: {
611
615
  textDecoration: "inherit",
612
616
  color: "inherit"
613
617
  },
614
- children: g ? "" : O
618
+ children: _ ? "" : k
615
619
  })
616
620
  }) : /* @__PURE__ */ (0, V.jsx)("div", {
617
- className: i.spanElement,
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: g ? "" : O
628
+ children: _ ? "" : k
625
629
  })
626
630
  }) }) : null
627
631
  ]
628
632
  })
629
633
  });
630
- }, _e = _($), ve = ({ textObjectSettings: e, isRichTextScalingSet: t }) => {
631
- let n = y(), r = v(), i = X(e), a = Z(e), o = H(), s = D(), c = e.richTextScaling ?? u.ViewportBreakpoints, l = ue(e, c, t);
632
- return (0, M.useEffect)(() => {
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
- ...l
643
+ ...u
640
644
  },
641
645
  "data-testid": "simple-text-object-container",
642
- children: /* @__PURE__ */ (0, V.jsx)(ne, {
646
+ children: /* @__PURE__ */ (0, V.jsx)(re, {
643
647
  value: e.textContent,
644
648
  backendAPI: n,
645
- responsive: c === u.ViewportBreakpoints,
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 || O(r, {
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
- }, ye = (e) => {
659
- let t = e.vTheme ?? s, n = N(e.vSpec, t), r = I(n.responsive, n.scaling), i = {
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 === g.Delta) return /* @__PURE__ */ (0, V.jsx)(ve, {
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 m.FitToObject: return /* @__PURE__ */ (0, V.jsx)(_e, { ...i });
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 { ye as SimpleTextObject };
678
+ export { be as SimpleTextObject };