@astrato-io/visualizations 0.6.4 → 0.7.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 (220) hide show
  1. package/CHANGELOG.md +0 -0
  2. package/README.md +32 -2
  3. package/THIRD_PARTY_NOTICES.md +68 -205
  4. package/VISUALIZATION_DEFINITIONS.md +68 -114
  5. package/chunks/Button-BrGKp9Nm.js +110 -0
  6. package/chunks/DefaultPropsProvider-BsfB7QTn.js +257 -0
  7. package/chunks/FieldTypeIcon-Drs6hSJF.js +22 -0
  8. package/chunks/{LinearProgress-CUZ0D8_t.js → LinearProgress-VtfFx2vJ.js} +51 -51
  9. package/chunks/MenuOption-ByRqhRdX.js +3934 -0
  10. package/chunks/Title-CO5dP1ma.js +1691 -0
  11. package/chunks/ToggleButton-KOBAimC1.js +112 -0
  12. package/chunks/app-filter-bar.compiler-TwVTeoj5.js +64 -0
  13. package/chunks/bar.compiler-DuQg8EUb.js +374 -0
  14. package/chunks/builder-DEDvNq1k.js +201 -0
  15. package/chunks/{color-settings-ZIvgNTq1.js → color-rules-CN7TcGrC.js} +2 -6
  16. package/chunks/color-settings-3VRlf_Vw.js +6 -0
  17. package/chunks/colorManipulator-D8Pjy1pf.js +45 -0
  18. package/chunks/coloring-CncX_JRX.js +278 -0
  19. package/chunks/{src-BC7cGcJ-.js → definitions-BPJQTx16.js} +650 -464
  20. package/chunks/{escobar-BGqT1EsE.js → escobar-DRhRMYRE.js} +6282 -4931
  21. package/chunks/event-bus-CrLB-Y8z.js +3 -0
  22. package/chunks/extend-preset-CUFNpmPe.js +4398 -0
  23. package/chunks/filter.compiler-w27dlv0C.js +70 -0
  24. package/chunks/filtering-cc7WqWpg.js +1153 -0
  25. package/chunks/handlers-TOT-7INo.js +12871 -0
  26. package/chunks/icon-picker-styles-CoJmwTRi.js +2246 -0
  27. package/chunks/isEqual-B8loyPsC.js +12 -0
  28. package/chunks/label-format-type-weq1XfcX.js +8 -0
  29. package/chunks/line.compiler-Ct1WhN2p.js +198 -0
  30. package/chunks/logger-DpQtYQnX.js +1163 -0
  31. package/chunks/lookup-BWllin0q.js +36 -0
  32. package/chunks/{metadata-CPXdYoln.js → metadata-WABZrt7Y.js} +1 -1
  33. package/chunks/number.compiler-D8TPly-4.js +53 -0
  34. package/chunks/{src-C0LgoUWY.js → operations-Dh4v1Ovt.js} +7716 -7541
  35. package/chunks/{range-DrzdfBX4.js → range-Bi-7zT0k.js} +2 -2
  36. package/chunks/registry-KervaxqJ.js +31 -0
  37. package/chunks/render-wrappers-OEmtaM8g.js +2 -0
  38. package/chunks/{registry-CExpGJ1N.js → requirements-PAoRaJyb.js} +294 -326
  39. package/chunks/responsive.styles-DSiOGD7u.js +82 -0
  40. package/chunks/shared-Bn4N5QcZ.js +1218 -0
  41. package/chunks/src-77e3mC7i.js +391 -0
  42. package/chunks/standalone-B55oyW6c.js +689 -0
  43. package/chunks/{standalone-CY57qwZ-.js → standalone-BDhPQtzQ.js} +386 -352
  44. package/chunks/{standalone-BDCwI6Hn.js → standalone-BGkmozIb.js} +1108 -953
  45. package/chunks/standalone-BMTCb10X.js +179 -0
  46. package/chunks/standalone-BXKRE_Se.js +468 -0
  47. package/chunks/standalone-Bes8srx1.js +354 -0
  48. package/chunks/standalone-BjZp0QMe.js +2 -0
  49. package/chunks/{standalone-BH5NqDwp.js → standalone-BlMIwpEe.js} +687 -573
  50. package/chunks/{standalone-CCNtaJ7s.js → standalone-C8ZAEutO.js} +44 -43
  51. package/chunks/standalone-C8qAelL4.js +2 -0
  52. package/chunks/standalone-CJvIXsQE.js +743 -0
  53. package/chunks/standalone-CLmGb7nn2.js +355 -0
  54. package/chunks/{ui-D1HQNIBy.js → standalone-CM5XcAN5.js} +15946 -17658
  55. package/chunks/standalone-CXNP6-xD.js +420 -0
  56. package/chunks/{standalone-BYm1UjLr.js → standalone-D5Q5ngsD.js} +59 -57
  57. package/chunks/standalone-DLlyRIE6.js +287 -0
  58. package/chunks/standalone-DMcI1afI.js +396 -0
  59. package/chunks/{standalone-jiz0L2Dg.js → standalone-DN4S1MjT.js} +1113 -1094
  60. package/chunks/{standalone-QJ1kKMnO.js → standalone-DT0wKji7.js} +2 -2
  61. package/chunks/{standalone-D5vnf-9y.js → standalone-DVTJwsTY.js} +1110 -1035
  62. package/chunks/standalone-DW6NT205.js +518 -0
  63. package/chunks/standalone-DYQIQH4c.js +2095 -0
  64. package/chunks/standalone-D__XCp-h.js +1003 -0
  65. package/chunks/standalone-XTgSsTAa.js +354 -0
  66. package/chunks/standalone-XuGksArp.js +68 -0
  67. package/chunks/{standalone-CNyNHKVx.js → standalone-we5D5MIn.js} +176 -172
  68. package/chunks/table.compiler-DMeeHxb6.js +222 -0
  69. package/chunks/useFieldName-Cjn9KCVp.js +7 -0
  70. package/chunks/useSlotProps-DLbQp4lc.js +166 -0
  71. package/chunks/{utils-Ba9T0TqC.js → utils-vdmi_2PK.js} +6266 -6517
  72. package/chunks/{src-DvX5LU9T.js → view-BuwQugKb.js} +2893 -5956
  73. package/chunks/visualization-filters-Cc4KU-l-.js +7455 -0
  74. package/chunks/web-components-DqClFkgO.js +1185 -0
  75. package/chunks/with-html-element-D0uY2zjI.js +7328 -0
  76. package/definitions.js +3 -3
  77. package/docs/operations/astrato-app-filter-bar.md +17 -17
  78. package/docs/operations/bar.md +1006 -1071
  79. package/docs/operations/combo.md +717 -738
  80. package/docs/operations/date-picker.md +27 -27
  81. package/docs/operations/distribution-gauge.md +471 -607
  82. package/docs/operations/dot.md +787 -879
  83. package/docs/operations/filter.md +139 -163
  84. package/docs/operations/gauge.md +491 -627
  85. package/docs/operations/heatMap.md +834 -916
  86. package/docs/operations/histogram.md +166 -180
  87. package/docs/operations/iframe.md +5 -5
  88. package/docs/operations/image.md +16 -16
  89. package/docs/operations/index.md +12 -12
  90. package/docs/operations/line.md +811 -888
  91. package/docs/operations/number.md +470 -536
  92. package/docs/operations/pie.md +825 -958
  93. package/docs/operations/radar.md +599 -679
  94. package/docs/operations/sankey.md +462 -584
  95. package/docs/operations/scatter.md +823 -929
  96. package/docs/operations/shape.md +34 -34
  97. package/docs/operations/simpleTextObject.md +18 -25
  98. package/docs/operations/slider.md +33 -43
  99. package/docs/operations/table.md +1177 -1150
  100. package/docs/operations/tree.md +404 -397
  101. package/docs/operations/treemap.md +595 -673
  102. package/docs/operations/waterfall.md +369 -379
  103. package/docs/operations/word-cloud.md +512 -583
  104. package/getters.js +7 -7
  105. package/index.js +3 -1183
  106. package/metadata.js +18 -18
  107. package/operations.js +13 -13
  108. package/package.json +133 -88
  109. package/render.js +10 -0
  110. package/src/charts/bar.d.ts +1 -0
  111. package/src/charts/combo.d.ts +1 -0
  112. package/src/charts/dot.d.ts +1 -0
  113. package/src/charts/gauge-distribution.d.ts +1 -0
  114. package/src/charts/gauge.d.ts +1 -0
  115. package/src/charts/heat-map.d.ts +1 -0
  116. package/src/charts/histogram.d.ts +1 -0
  117. package/src/charts/line.d.ts +1 -0
  118. package/src/charts/pie.d.ts +1 -0
  119. package/src/charts/radar.d.ts +1 -0
  120. package/src/charts/sankey.d.ts +1 -0
  121. package/src/charts/scatter.d.ts +1 -0
  122. package/src/charts/table.d.ts +1 -0
  123. package/src/charts/tree.d.ts +1 -0
  124. package/src/charts/treemap.d.ts +1 -0
  125. package/src/charts/waterfall.d.ts +1 -0
  126. package/src/charts/word-cloud.d.ts +1 -0
  127. package/src/definitions/index.d.ts +2 -2
  128. package/src/definitions/{shared/lib → model/definitions}/available-fields.d.ts +0 -1
  129. package/src/definitions/{shared/lib/compilers/index.d.ts → model/definitions/compilers/compile.d.ts} +1 -1
  130. package/src/definitions/model/definitions/data-item-resolution.d.ts +19 -0
  131. package/src/definitions/model/definitions/descriptors/descriptor-metadata.d.ts +1364 -0
  132. package/src/definitions/model/definitions/descriptors/json-schema.d.ts +2 -0
  133. package/src/definitions/model/definitions/diagnostics.d.ts +5 -0
  134. package/src/definitions/model/definitions/field-suggestions.d.ts +2 -0
  135. package/src/definitions/model/definitions/index.d.ts +23 -0
  136. package/src/definitions/{shared/lib → model/definitions}/registry/compile.d.ts +1 -1
  137. package/src/definitions/model/definitions/registry/descriptor-registry.d.ts +3 -0
  138. package/src/definitions/model/definitions/schema-registry.d.ts +660 -0
  139. package/src/definitions/{shared/lib → model/definitions}/schemas/broad-chart.schema.d.ts +1 -1
  140. package/src/definitions/{shared/lib → model/definitions}/schemas/common.schema.d.ts +0 -1
  141. package/src/definitions/model/definitions/schemas/index.d.ts +9 -0
  142. package/src/definitions/{shared/lib → model/definitions}/schemas/object.schema.d.ts +8 -8
  143. package/src/definitions/{shared/lib → model/definitions}/types/compilation.types.d.ts +10 -0
  144. package/src/definitions/{shared/lib → model/definitions}/types/definition.types.d.ts +1 -1
  145. package/src/definitions/model/definitions/types/index.d.ts +3 -0
  146. package/src/definitions/{shared/lib/registry → model/definitions}/validation.d.ts +1 -1
  147. package/src/getters/index.d.ts +3 -3
  148. package/src/index.d.ts +1 -1
  149. package/src/objects/app-filter-bar.d.ts +1 -0
  150. package/src/objects/date-picker.d.ts +1 -0
  151. package/src/objects/filter.d.ts +1 -0
  152. package/src/objects/iframe.d.ts +1 -0
  153. package/src/objects/image.d.ts +1 -0
  154. package/src/objects/number.d.ts +1 -0
  155. package/src/objects/shape.d.ts +1 -0
  156. package/src/objects/slider.d.ts +1 -0
  157. package/src/objects/text.d.ts +1 -0
  158. package/src/operations/index.d.ts +3 -3
  159. package/src/registry/create-visualization-registry.d.ts +5 -0
  160. package/src/render/index.d.ts +34 -0
  161. package/src/runtime/index.d.ts +2 -2
  162. package/src/types.d.ts +9 -4
  163. package/src/web-components/index.d.ts +3 -3
  164. package/chunks/Radio-Ciu-F4CU.js +0 -957
  165. package/chunks/ToggleButton-BCJc3Jlc.js +0 -153
  166. package/chunks/_baseFlatten-DPXPOrea.js +0 -7076
  167. package/chunks/app-filter-bar.compiler-j_CVoWTa.js +0 -55
  168. package/chunks/bar.compiler-oqaPzIut.js +0 -370
  169. package/chunks/coloring-C16AUZEi.js +0 -663
  170. package/chunks/data-item-resolution-1lvYB5ln.js +0 -53
  171. package/chunks/event-bus-KiSiCJrC.js +0 -2683
  172. package/chunks/events-WZut5Ow6.js +0 -4
  173. package/chunks/filter.compiler-CuLtc_02.js +0 -60
  174. package/chunks/filtering-Yq4DEa0t.js +0 -953
  175. package/chunks/gauge-target-type-BkKXAqkX.js +0 -4
  176. package/chunks/grouping-type-BX_9Ix5q.js +0 -3
  177. package/chunks/interfaces-VUY4_yVO.js +0 -8742
  178. package/chunks/line-settings-DfYTUyPz.js +0 -4
  179. package/chunks/line.compiler-BpA_6Tc7.js +0 -188
  180. package/chunks/number.compiler-DbkWcG4S.js +0 -44
  181. package/chunks/pie-uv42Eqal.js +0 -10
  182. package/chunks/requirements-DNhuShLS.js +0 -6
  183. package/chunks/shared-CKDL4hx9.js +0 -1171
  184. package/chunks/src-Cum_2NLV.js +0 -12145
  185. package/chunks/src-Dun_jXtz.js +0 -10295
  186. package/chunks/standalone-87YV_m9n.js +0 -687
  187. package/chunks/standalone-BLVAWLNJ.js +0 -385
  188. package/chunks/standalone-BPomtAVs.js +0 -2
  189. package/chunks/standalone-BXyBcUOQ.js +0 -2
  190. package/chunks/standalone-BllF4rDp.js +0 -383
  191. package/chunks/standalone-BmfMt74U.js +0 -726
  192. package/chunks/standalone-BqWyrnZI.js +0 -281
  193. package/chunks/standalone-C85u7U6I.js +0 -340
  194. package/chunks/standalone-CDQnr6qT.js +0 -345
  195. package/chunks/standalone-CZynjFG7.js +0 -12979
  196. package/chunks/standalone-DFPva_ku.js +0 -299
  197. package/chunks/standalone-DQxxNwF8.js +0 -675
  198. package/chunks/standalone-DS9T0FZ-.js +0 -830
  199. package/chunks/standalone-Dx3MLlrO.js +0 -512
  200. package/chunks/standalone-DzixzZAL.js +0 -411
  201. package/chunks/standalone-lBm9hQ-q.js +0 -179
  202. package/chunks/standalone-rJ45Zfl1.js +0 -68
  203. package/chunks/table.compiler-BrXkm4Fz.js +0 -213
  204. package/chunks/toInteger-DVZr-D1j.js +0 -11
  205. package/chunks/treemap-x_zmJoG7.js +0 -23
  206. package/chunks/types-dVVCsDWD.js +0 -4
  207. package/chunks/useFieldName-oqQ3bvnO.js +0 -7
  208. package/chunks/view-CLqWMV7Z.js +0 -156
  209. package/src/definitions/shared/index.d.ts +0 -5
  210. package/src/definitions/shared/lib/registry/descriptor-registry.d.ts +0 -587
  211. package/src/definitions/shared/lib/registry/index.d.ts +0 -3
  212. package/src/definitions/shared/lib/schemas/index.d.ts +0 -9
  213. package/src/definitions/shared/lib/types/index.d.ts +0 -3
  214. package/src/definitions/{shared/lib → model/definitions}/schemas/app-filter-bar.schema.d.ts +0 -0
  215. package/src/definitions/{shared/lib → model/definitions}/schemas/bar.schema.d.ts +0 -0
  216. package/src/definitions/{shared/lib → model/definitions}/schemas/filter.schema.d.ts +0 -0
  217. package/src/definitions/{shared/lib → model/definitions}/schemas/line.schema.d.ts +0 -0
  218. package/src/definitions/{shared/lib → model/definitions}/schemas/number.schema.d.ts +0 -0
  219. package/src/definitions/{shared/lib → model/definitions}/schemas/table.schema.d.ts +4 -4
  220. /package/src/definitions/{shared/lib → model/definitions}/types/descriptor.types.d.ts +0 -0
@@ -1,76 +1,79 @@
1
1
  import { o as e, t } from "./rolldown-runtime-DleVn1XH.js";
2
- import { Ba as n, Ha as r, Lt as i, Oa as a, Ri as o, Sa as s, So as c, Ta as l, Va as u, ba as d, qo as f, ss as p, xa as m, xo as h, ya as g } from "./interfaces-VUY4_yVO.js";
3
- import { B as _, G as v, Hn as y, Ki as b, Nn as x, Wn as S, Zt as C, a as w, d as T, wi as E, xn as D } from "./utils-Ba9T0TqC.js";
4
- import { gt as O } from "./src-Dun_jXtz.js";
5
- import { n as k, t as A } from "./url-utils-B17gj_mr.js";
6
- import "./src-DvX5LU9T.js";
7
- import { c as j } from "./Radio-Ciu-F4CU.js";
8
- var M = /* @__PURE__ */ e(b()), N = (e, t) => {
9
- let n = e?.simpleTextObjectSettings || {}, r = n.fontFamily ?? o.fontFamily, i = n.textColor ?? o.textColor, a = t ? m(t, r) : r, s = t ? d(t, i) : i, { borderEnabled: c = o.borderEnabled, borderRadius: l = o.borderRadius, borderWidth: f = o.borderWidth } = n;
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";
5
+ import { n as A, t as j } from "./url-utils-B17gj_mr.js";
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;
10
9
  return {
11
- textContentType: n.textContentType ?? u.Text,
12
- textContent: n.textContent ?? o.textContent,
13
- variableId: n.variableId ?? o.variableId,
14
- representation: n.representation ?? o.representation,
15
- paragraphMargin: n.paragraphMargin ?? o.paragraphMargin,
16
- textColor: s,
17
- fontFamily: a,
18
- fontSize: n.fontSize ?? o.fontSize,
19
- bold: n.bold ?? o.bold,
20
- weight: n.weight ?? o.weight,
21
- italic: n.italic ?? o.italic,
22
- underlined: n.underlined ?? o.underlined,
23
- strikethrough: n.strikethrough ?? o.strikethrough,
24
- letterSpacing: n.letterSpacing ?? o.letterSpacing,
25
- lineSpacing: n.lineSpacing ?? o.lineSpacing,
26
- wordWrap: n.wordWrap ?? o.wordWrap,
27
- linkEnabled: n.linkEnabled ?? o.linkEnabled,
28
- linkUrl: n.linkUrl ?? o.linkUrl,
29
- backgroundType: n.backgroundType ?? o.backgroundType,
30
- backgroundColor: n.backgroundColor ?? o.backgroundColor,
31
- imageOpacity: n.imageOpacity ?? o.imageOpacity,
32
- backgroundBlur: n.backgroundBlur ?? o.backgroundBlur,
33
- backgroundImage: n.backgroundImage ?? o.backgroundImage,
34
- imageFitType: n.imageFitType ?? o.imageFitType,
35
- borderEnabled: c,
36
- borderWidth: c ?? !!f ? f : 0,
37
- borderRadius: c ?? !!f ? l : 0,
38
- borderStyle: n.borderStyle ?? o.borderStyle,
39
- borderColor: n.borderColor ?? o.borderColor,
40
- textPadding: n.textPadding ?? o.textPadding,
41
- textShadow: n.textShadow ?? o.textShadow,
42
- objectShadow: n.objectShadow ?? o.objectShadow,
43
- responsive: n.responsive ?? o.responsive,
44
- scaling: n.scaling ?? o.scaling,
45
- maxLines: n.maxLines ?? o.maxLines,
46
- position: n.position ?? o.position,
47
- align: n.align ?? o.align,
48
- richTextScaling: n.richTextScaling ?? o.richTextScaling,
49
- richTextResponsive: n.richTextResponsive ?? o.richTextResponsive,
50
- richTextMaxLines: n.richTextMaxLines ?? o.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
51
50
  };
52
- }, P = 8, F = (e, t, n) => {
53
- if (n.width === 0) return t.fontSize;
54
- let r = S(), i = 0, a = 0, o = t.fontSize;
55
- for (; a <= o;) {
56
- let s = Math.floor((a + o) / 2), { width: c, height: l } = r.getTextSize({
57
- 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,
58
58
  label: e,
59
- fontFamily: t.fontFamily,
59
+ fontFamily: t.fontFamily ?? "",
60
60
  letterSpacing: `${t.letterSpacing}`,
61
61
  fontWeight: t.bold ? 700 : 400,
62
62
  lineHeight: t.lineSpacing
63
- }), u = Math.ceil((c + t.letterSpacing) / (n.width - P * 2)), d = !t.wordWrap && u > 1, f = l * u * 1.2 + P * 2 > n.height;
64
- 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);
65
65
  }
66
- return r.cleanDOM(), i;
67
- }, I = (e, t) => e ? t : c.None, L = (e) => e === c.ViewportWidth ? "vw" : "px", R = (e, t, n) => F(e, t, {
68
- width: n.width - t.textPadding * 2,
69
- height: n.height - t.textPadding * 2
70
- }), 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 = {
71
74
  width: 1920,
72
75
  height: 1080
73
- }, z = (e) => e / 1920 * 100, B = (e) => e / ee.height * 100, V = E(), te = v({
76
+ }, z = (e) => e / 1920 * 100, B = (e) => e / te.height * 100, V = E(), ne = x({
74
77
  wrapper: {
75
78
  height: "100%",
76
79
  position: "relative",
@@ -85,9 +88,9 @@ var M = /* @__PURE__ */ e(b()), N = (e, t) => {
85
88
  top: 0,
86
89
  fontSize: 24
87
90
  } }
88
- }), ne = ({ value: e, backendAPI: t, onBlur: n, onSubmit: r, responsive: i, richTextResponsive: a = !0, richTextMaxLines: o = 1 }) => {
89
- 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();
90
- (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)(() => {
91
94
  if (!l.current) return;
92
95
  let r = l.current, p = r.appendChild(r.ownerDocument.createElement("div")), m = {
93
96
  value: e,
@@ -119,7 +122,7 @@ var M = /* @__PURE__ */ e(b()), N = (e, t) => {
119
122
  a,
120
123
  o,
121
124
  f
122
- ]), (0, M.useEffect)(() => {
125
+ ]), (0, N.useEffect)(() => {
123
126
  u.current?.getContents() !== e && u.current?.setContents(e), m(!1);
124
127
  }, [e, s]);
125
128
  let g = () => {
@@ -146,14 +149,14 @@ var M = /* @__PURE__ */ e(b()), N = (e, t) => {
146
149
  };
147
150
  return /* @__PURE__ */ (0, V.jsx)("div", {
148
151
  ref: l,
149
- className: x({
152
+ className: v({
150
153
  [h.wrapper]: !0,
151
154
  [h.changed]: p,
152
155
  "ast-advanced-text-editor": !1
153
156
  }),
154
157
  onClick: g
155
158
  });
156
- }, H = v({
159
+ }, H = x({
157
160
  mainContainer: {
158
161
  width: "100%",
159
162
  height: "100%",
@@ -170,7 +173,7 @@ var M = /* @__PURE__ */ e(b()), N = (e, t) => {
170
173
  overflowX: "hidden",
171
174
  lineHeight: 1,
172
175
  color: "#1F1C3B",
173
- fontFamily: s("Roboto"),
176
+ fontFamily: i("Roboto"),
174
177
  fontStyle: "normal",
175
178
  fontWeight: 700
176
179
  },
@@ -188,8 +191,8 @@ var M = /* @__PURE__ */ e(b()), N = (e, t) => {
188
191
  WebkitBoxOrient: "vertical"
189
192
  }
190
193
  });
191
- s("Roboto");
192
- 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 = `
193
196
  width: 100%;
194
197
  height: 100%;
195
198
  position: absolute;
@@ -200,25 +203,25 @@ var re = "\n height: 100%; \n width: 100%;\n display: block;\n overflow: aut
200
203
  overflow: auto;
201
204
  line-height: 1;
202
205
  color: #1F1C3B;
203
- font-family: Roboto, ${g};
206
+ font-family: Roboto, ${a};
204
207
  font-style: normal;
205
208
  font-weight: 700;
206
- `, 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) => {
207
210
  function n(e, t, n, r) {
208
211
  var i = -1, a = e == null ? 0 : e.length;
209
212
  for (r && a && (n = e[++i]); ++i < a;) n = t(n, e[i], i, e);
210
213
  return n;
211
214
  }
212
215
  t.exports = n;
213
- })), K = /* @__PURE__ */ t(((e, t) => {
216
+ })), q = /* @__PURE__ */ t(((e, t) => {
214
217
  function n(e) {
215
218
  return function(t) {
216
219
  return e?.[t];
217
220
  };
218
221
  }
219
222
  t.exports = n;
220
- })), q = /* @__PURE__ */ t(((e, t) => {
221
- t.exports = K()({
223
+ })), J = /* @__PURE__ */ t(((e, t) => {
224
+ t.exports = q()({
222
225
  À: "A",
223
226
  Á: "A",
224
227
  Â: "A",
@@ -410,25 +413,25 @@ var re = "\n height: 100%; \n width: 100%;\n display: block;\n overflow: aut
410
413
  ʼn: "'n",
411
414
  ſ: "s"
412
415
  });
413
- })), J = /* @__PURE__ */ t(((e, t) => {
414
- var n = q(), r = i(), a = /[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g, o = RegExp("[\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff]", "g");
415
- function s(e) {
416
- return e = r(e), e && e.replace(a, n).replace(o, "");
417
- }
418
- t.exports = s;
419
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) => {
420
423
  var n = /[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g;
421
424
  function r(e) {
422
425
  return e.match(n) || [];
423
426
  }
424
427
  t.exports = r;
425
- })), ie = /* @__PURE__ */ t(((e, t) => {
428
+ })), ae = /* @__PURE__ */ t(((e, t) => {
426
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 ]/;
427
430
  function r(e) {
428
431
  return n.test(e);
429
432
  }
430
433
  t.exports = r;
431
- })), ae = /* @__PURE__ */ t(((e, t) => {
434
+ })), oe = /* @__PURE__ */ t(((e, t) => {
432
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 + "(?:" + [
433
436
  x,
434
437
  S,
@@ -459,28 +462,28 @@ var re = "\n height: 100%; \n width: 100%;\n display: block;\n overflow: aut
459
462
  return e.match(L) || [];
460
463
  }
461
464
  t.exports = R;
462
- })), oe = /* @__PURE__ */ t(((e, t) => {
463
- var n = Y(), r = ie(), a = i(), o = ae();
464
- function s(e, t, i) {
465
- return e = a(e), t = i ? void 0 : t, t === void 0 ? r(e) ? o(e) : n(e) : e.match(t) || [];
466
- }
467
- t.exports = s;
468
465
  })), se = /* @__PURE__ */ t(((e, t) => {
469
- 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");
470
473
  function o(e) {
471
474
  return function(t) {
472
475
  return n(i(r(t).replace(a, "")), e, "");
473
476
  };
474
477
  }
475
478
  t.exports = o;
476
- })), ce = /* @__PURE__ */ e((/* @__PURE__ */ t(((e, t) => {
477
- t.exports = se()(function(e, t, n) {
479
+ })), le = /* @__PURE__ */ e((/* @__PURE__ */ t(((e, t) => {
480
+ t.exports = ce()(function(e, t, n) {
478
481
  return e + (n ? "-" : "") + t.toLowerCase();
479
482
  });
480
- })))()), le = (e, t, n = "px") => {
481
- let i = [e.underlined ? "underline" : void 0, e.strikethrough ? "line-through" : void 0].filter((e) => !!e).join(" "), o = Math.ceil(t / 10);
483
+ })))()), ue = (e, t = s.fontSize, n = "px") => {
484
+ let i = [e.underlined ? "underline" : void 0, e.strikethrough ? "line-through" : void 0].filter((e) => !!e).join(" "), a = Math.ceil(t / 10);
482
485
  return {
483
- fontFamily: e.fontFamily,
486
+ fontFamily: e.fontFamily ?? void 0,
484
487
  fontSize: `${t}${n}`,
485
488
  fontWeight: e.weight ?? (e.bold ? "bold" : "normal"),
486
489
  fontStyle: e.italic ? "italic" : "normal",
@@ -489,12 +492,12 @@ var re = "\n height: 100%; \n width: 100%;\n display: block;\n overflow: aut
489
492
  textDecoration: i,
490
493
  letterSpacing: `${e.letterSpacing}px`,
491
494
  lineHeight: e.lineSpacing,
492
- whiteSpace: e.responsive || [r.HTML, r.Markdown].includes(e.representation) ? e.wordWrap ? "pre-line" : "nowrap" : "pre-line",
493
- marginTop: e.position === p.Top ? "unset" : "auto",
494
- marginBottom: e.position === p.Bottom ? "unset" : "auto",
495
- textShadow: e.textShadow ? `0px 1px 2px ${a.black}` : "none",
496
- paddingTop: o,
497
- paddingBottom: o,
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",
499
+ paddingTop: a,
500
+ paddingBottom: a,
498
501
  overflow: e.responsive ? "visible" : "hidden",
499
502
  textOverflow: e.responsive ? "initial" : "ellipsis",
500
503
  WebkitLineClamp: e.maxLines || 1,
@@ -502,24 +505,24 @@ var re = "\n height: 100%; \n width: 100%;\n display: block;\n overflow: aut
502
505
  display: e.responsive ? "initial" : "-webkit-box"
503
506
  };
504
507
  }, X = (e) => {
505
- let t = e.borderStyle === f.Line ? "solid" : "dashed";
508
+ let t = e.borderStyle === m.Line ? "solid" : "dashed";
506
509
  return {
507
- backgroundColor: (e.backgroundType === n.Image ? null : e.backgroundColor) ?? "transparent",
510
+ backgroundColor: (e.backgroundType === f.Image ? null : e.backgroundColor) ?? "transparent",
508
511
  border: `${e.borderWidth}px ${t} ${e.borderColor}`,
509
512
  borderRadius: `${e.borderRadius}px`,
510
513
  backdropFilter: `blur(${e.backgroundBlur}px)`,
511
- boxShadow: e.objectShadow ? `0px 2px 4px ${a.alphaBlack(.25)}` : "none"
514
+ boxShadow: e.objectShadow ? `0px 2px 4px ${r.alphaBlack(.25)}` : "none"
512
515
  };
513
- }, Z = (e) => ({ padding: `${e.textPadding ?? 0}px` }), ue = (e, t, n) => {
516
+ }, Z = (e) => ({ padding: `${e.textPadding ?? 0}px` }), de = (e, t, n) => {
514
517
  if (!n) return {};
515
- let r = e.fontSize;
518
+ let r = e.fontSize ?? s.fontSize;
516
519
  switch (t) {
517
- case h.ViewportWidth: return { fontSize: `${z(r)}vw` };
518
- case h.ViewportHeight: return { fontSize: `${B(r)}vh` };
519
- case h.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)` };
520
523
  }
521
524
  return {};
522
- }, de = {
525
+ }, Q = {
523
526
  borderStyle: "none",
524
527
  width: "100%",
525
528
  height: "100%",
@@ -527,128 +530,128 @@ var re = "\n height: 100%; \n width: 100%;\n display: block;\n overflow: aut
527
530
  }, fe = (e) => ({
528
531
  objectFit: e.imageFitType ?? "contain",
529
532
  opacity: e.imageOpacity ?? 1
530
- }), Q = (e) => Object.entries(e).map(([e, t]) => {
531
- let n = (0, ce.default)(e);
533
+ }), pe = (e) => Object.entries(e).map(([e, t]) => {
534
+ let n = (0, le.default)(e);
532
535
  return typeof t == "number" && ![
533
536
  "lineHeight",
534
537
  "opacity",
535
538
  "zIndex"
536
539
  ].includes(e) && (t = `${t}px`), `${n}: ${t};`;
537
- }).join(" "), pe = (e, t) => `:host {
538
- ${re}
540
+ }).join(" "), me = (e, t) => `:host {
541
+ ${U}
539
542
  }
540
543
  .astrato-html-main-container {
541
- ${U}
544
+ ${W}
542
545
  }
543
546
  .astrato-html-container {
544
- ${W}
545
- ${Q(e)}
547
+ ${G}
548
+ ${pe(e)}
546
549
  }
547
550
  .astrato-html-container p {
548
- margin: ${t.representation === r.Markdown ? `${t.paragraphMargin}px` : 0};
551
+ margin: ${t.representation === d.Markdown ? `${t.paragraphMargin}px` : 0};
549
552
  }
550
553
  .astrato-html-container li {
551
554
  white-space: normal;
552
- }`, me = (e) => `<div class="astrato-html-main-container"><div class="astrato-html-container">${e}</div></div>`, he = (e, t, n) => {
553
- let { textContent: r, variableId: i, textContentType: a = u.Text } = e;
554
- return [u.Text, u.Delta].includes(a) ? r || n : i ? `${t[i]?.value ?? ""}` : n;
555
- }, ge = (e) => e.replace(/(\r\n|\n|\r)/g, " "), $ = ({ textObjectSettings: e, scaling: t, elementSize: i }) => {
556
- let a = H(), o = D(), s = T(), { variablesDict: l } = w(), [u, d] = (0, M.useState)(""), f = he(e, l, ""), p = e.fontSize;
557
- t === c.FitToObject ? p = R(f, e, i) : t === c.ViewportWidth && (p = z(p));
558
- let m = o?.daedalus.objectCapabilities.editable, h = e.backgroundType === n.Image, g = [r.HTML, r.Markdown].includes(e.representation), _ = le(e, p, L(t)), v = X(e), b = Z(e), x = fe(e), S = {
559
- ...b,
560
- ..._,
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,
561
564
  fontSize: `${e.fontSize}px`
562
565
  };
563
- 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)(() => {
564
567
  let t = async () => {
565
- e.representation === r.Markdown ? d(await k(f)) : d(f);
568
+ e.representation === d.Markdown ? l(await A(u)) : l(u);
566
569
  };
567
570
  (async () => {
568
- await t(), !h && !g && s();
571
+ await t(), !h && !_ && a();
569
572
  })();
570
573
  }, [
571
- f,
574
+ u,
572
575
  e.representation,
573
576
  h,
574
- g,
575
- s
577
+ _,
578
+ a
576
579
  ]);
577
- let C = A(e.linkUrl), E = !g && !e.responsive, O = !e.responsive && !g ? ge(u) : u;
578
- return /* @__PURE__ */ (0, V.jsx)(j, {
579
- title: E ? 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,
580
583
  children: /* @__PURE__ */ (0, V.jsxs)("div", {
581
- className: a.mainContainer,
582
- style: v,
584
+ className: r.mainContainer,
585
+ style: y,
583
586
  "data-testid": "simple-text-object-container",
584
587
  children: [
585
- g ? /* @__PURE__ */ (0, V.jsx)(y, {
586
- html: me(O),
587
- css: pe(S, e),
588
- style: de,
589
- onRendered: s
588
+ _ ? /* @__PURE__ */ (0, V.jsx)(b, {
589
+ html: he(k),
590
+ css: me(E, e),
591
+ style: Q,
592
+ onRendered: a
590
593
  }) : null,
591
594
  h ? /* @__PURE__ */ (0, V.jsx)("img", {
592
595
  src: e.backgroundImage,
593
- className: a.image,
594
- style: x,
595
- onLoad: () => s(),
596
- onError: () => s(),
596
+ className: r.image,
597
+ style: S,
598
+ onLoad: () => a(),
599
+ onError: () => a(),
597
600
  alt: "text background"
598
601
  }) : null,
599
- m || !g ? /* @__PURE__ */ (0, V.jsx)(V.Fragment, { children: /* @__PURE__ */ (0, V.jsx)("div", {
600
- className: a.textContainer,
601
- style: b,
602
- children: e.linkEnabled && C ? /* @__PURE__ */ (0, V.jsx)("div", {
603
- className: a.spanElement,
604
- 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,
605
608
  "data-ellipsis": !0,
606
609
  "data-testid": "simple-text-object-content",
607
610
  children: /* @__PURE__ */ (0, V.jsx)("a", {
608
611
  target: "_blank",
609
612
  rel: "noreferrer",
610
- href: C,
613
+ href: D,
611
614
  style: {
612
615
  textDecoration: "inherit",
613
616
  color: "inherit"
614
617
  },
615
- children: g ? "" : O
618
+ children: _ ? "" : k
616
619
  })
617
620
  }) : /* @__PURE__ */ (0, V.jsx)("div", {
618
- className: a.spanElement,
621
+ className: r.spanElement,
619
622
  style: {
620
- ..._,
623
+ ...v,
621
624
  pointerEvents: "none"
622
625
  },
623
626
  "data-ellipsis": !0,
624
627
  "data-testid": "simple-text-object-content",
625
- children: g ? "" : O
628
+ children: _ ? "" : k
626
629
  })
627
630
  }) }) : null
628
631
  ]
629
632
  })
630
633
  });
631
- }, _e = C($), ve = ({ textObjectSettings: e, isRichTextScalingSet: t }) => {
632
- let n = D(), r = _(), i = X(e), a = Z(e), o = H(), s = T(), c = e.richTextScaling ?? h.ViewportBreakpoints, l = ue(e, c, t);
633
- 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)(() => {
634
637
  s();
635
638
  }, [s]), /* @__PURE__ */ (0, V.jsx)("div", {
636
639
  className: o.mainContainer,
637
640
  style: {
638
641
  ...i,
639
642
  ...a,
640
- ...l
643
+ ...u
641
644
  },
642
645
  "data-testid": "simple-text-object-container",
643
- children: /* @__PURE__ */ (0, V.jsx)(ne, {
646
+ children: /* @__PURE__ */ (0, V.jsx)(re, {
644
647
  value: e.textContent,
645
648
  backendAPI: n,
646
- responsive: c === h.ViewportBreakpoints,
649
+ responsive: l === c.ViewportBreakpoints,
647
650
  richTextResponsive: e.richTextResponsive,
648
651
  richTextMaxLines: e.richTextMaxLines,
649
652
  onSubmit: (t, n) => {
650
653
  let i = n.overflowBehavior === "responsive", a = n.maxLines;
651
- e.textContent === t && e.richTextResponsive === i && e.richTextMaxLines === a || O(r, {
654
+ e.textContent === t && e.richTextResponsive === i && e.richTextMaxLines === a || k(r, {
652
655
  textContent: t,
653
656
  richTextResponsive: i,
654
657
  richTextMaxLines: a
@@ -656,19 +659,20 @@ var re = "\n height: 100%; \n width: 100%;\n display: block;\n overflow: aut
656
659
  }
657
660
  })
658
661
  });
659
- }, ye = (e) => {
660
- let t = e.vTheme ?? l, 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 = {
661
665
  ...e,
662
666
  scaling: r,
663
667
  textObjectSettings: n
664
668
  };
665
- if (n.textContentType === u.Delta) return /* @__PURE__ */ (0, V.jsx)(ve, {
669
+ if (n.textContentType === p.Delta) return /* @__PURE__ */ (0, V.jsx)(ye, {
666
670
  textObjectSettings: n,
667
671
  isRichTextScalingSet: e.vSpec?.simpleTextObjectSettings?.richTextScaling !== void 0
668
672
  });
669
673
  switch (r) {
670
- case c.FitToObject: return /* @__PURE__ */ (0, V.jsx)(_e, { ...i });
674
+ case g.FitToObject: return /* @__PURE__ */ (0, V.jsx)(ve, { ...i });
671
675
  default: return /* @__PURE__ */ (0, V.jsx)($, { ...i });
672
676
  }
673
677
  };
674
- export { ye as SimpleTextObject };
678
+ export { be as SimpleTextObject };