@astrato-io/visualizations 0.0.0-stage → 0.6.4

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 (145) hide show
  1. package/CHANGELOG.md +23 -0
  2. package/LICENSE +93 -0
  3. package/README.md +843 -2
  4. package/THIRD_PARTY_NOTICES.md +8387 -0
  5. package/VISUALIZATION_DEFINITIONS.md +2378 -0
  6. package/chunks/LinearProgress-CUZ0D8_t.js +253 -0
  7. package/chunks/Radio-Ciu-F4CU.js +957 -0
  8. package/chunks/ToggleButton-BCJc3Jlc.js +153 -0
  9. package/chunks/_baseFlatten-DPXPOrea.js +7076 -0
  10. package/chunks/accessors-DemrDevR.js +128 -0
  11. package/chunks/app-filter-bar.compiler-j_CVoWTa.js +55 -0
  12. package/chunks/bar.compiler-oqaPzIut.js +370 -0
  13. package/chunks/color-settings-ZIvgNTq1.js +10 -0
  14. package/chunks/coloring-C16AUZEi.js +663 -0
  15. package/chunks/data-item-resolution-1lvYB5ln.js +53 -0
  16. package/chunks/debounce-fn-CUixuz45.js +7 -0
  17. package/chunks/escobar-BGqT1EsE.js +34580 -0
  18. package/chunks/event-bus-KiSiCJrC.js +2683 -0
  19. package/chunks/events-WZut5Ow6.js +4 -0
  20. package/chunks/extend-BKUkc4_i.js +37 -0
  21. package/chunks/filter.compiler-CuLtc_02.js +60 -0
  22. package/chunks/filtering-Yq4DEa0t.js +953 -0
  23. package/chunks/gauge-target-type-BkKXAqkX.js +4 -0
  24. package/chunks/grouping-type-BX_9Ix5q.js +3 -0
  25. package/chunks/interfaces-VUY4_yVO.js +8742 -0
  26. package/chunks/line-settings-DfYTUyPz.js +4 -0
  27. package/chunks/line.compiler-BpA_6Tc7.js +188 -0
  28. package/chunks/metadata-CPXdYoln.js +28 -0
  29. package/chunks/number.compiler-DbkWcG4S.js +44 -0
  30. package/chunks/pie-uv42Eqal.js +10 -0
  31. package/chunks/range-DrzdfBX4.js +22 -0
  32. package/chunks/registry-CExpGJ1N.js +920 -0
  33. package/chunks/requirements-DNhuShLS.js +6 -0
  34. package/chunks/rolldown-runtime-DleVn1XH.js +28 -0
  35. package/chunks/set-coloring-datafield-B3uIS1Pe.js +8 -0
  36. package/chunks/shared-CKDL4hx9.js +1171 -0
  37. package/chunks/src-BC7cGcJ-.js +2024 -0
  38. package/chunks/src-BOS6SqkZ.js +67 -0
  39. package/chunks/src-C0LgoUWY.js +26105 -0
  40. package/chunks/src-Cum_2NLV.js +12145 -0
  41. package/chunks/src-D9XogOrc.js +422 -0
  42. package/chunks/src-Dun_jXtz.js +10295 -0
  43. package/chunks/src-DvX5LU9T.js +14742 -0
  44. package/chunks/standalone-87YV_m9n.js +687 -0
  45. package/chunks/standalone-BDCwI6Hn.js +4619 -0
  46. package/chunks/standalone-BH5NqDwp.js +1763 -0
  47. package/chunks/standalone-BLVAWLNJ.js +385 -0
  48. package/chunks/standalone-BPomtAVs.js +2 -0
  49. package/chunks/standalone-BXyBcUOQ.js +2 -0
  50. package/chunks/standalone-BYm1UjLr.js +140 -0
  51. package/chunks/standalone-BllF4rDp.js +383 -0
  52. package/chunks/standalone-BmfMt74U.js +726 -0
  53. package/chunks/standalone-BqWyrnZI.js +281 -0
  54. package/chunks/standalone-C85u7U6I.js +340 -0
  55. package/chunks/standalone-CCNtaJ7s.js +741 -0
  56. package/chunks/standalone-CDQnr6qT.js +345 -0
  57. package/chunks/standalone-CNyNHKVx.js +674 -0
  58. package/chunks/standalone-CY57qwZ-.js +1129 -0
  59. package/chunks/standalone-CZynjFG7.js +12979 -0
  60. package/chunks/standalone-D5vnf-9y.js +3943 -0
  61. package/chunks/standalone-DFPva_ku.js +299 -0
  62. package/chunks/standalone-DQxxNwF8.js +675 -0
  63. package/chunks/standalone-DS9T0FZ-.js +830 -0
  64. package/chunks/standalone-Dx3MLlrO.js +512 -0
  65. package/chunks/standalone-DzixzZAL.js +411 -0
  66. package/chunks/standalone-QJ1kKMnO.js +6 -0
  67. package/chunks/standalone-jiz0L2Dg.js +3855 -0
  68. package/chunks/standalone-lBm9hQ-q.js +179 -0
  69. package/chunks/standalone-rJ45Zfl1.js +68 -0
  70. package/chunks/stroke-dash-UgMEcCS4.js +6 -0
  71. package/chunks/table.compiler-BrXkm4Fz.js +213 -0
  72. package/chunks/toInteger-DVZr-D1j.js +11 -0
  73. package/chunks/treemap-x_zmJoG7.js +23 -0
  74. package/chunks/typeof-CJDtcySz.js +13 -0
  75. package/chunks/types-dVVCsDWD.js +4 -0
  76. package/chunks/ui-D1HQNIBy.js +54039 -0
  77. package/chunks/url-utils-B17gj_mr.js +5501 -0
  78. package/chunks/useFieldName-oqQ3bvnO.js +7 -0
  79. package/chunks/utils-Ba9T0TqC.js +31097 -0
  80. package/chunks/view-CLqWMV7Z.js +156 -0
  81. package/definitions.js +3 -0
  82. package/docs/operations/astrato-app-filter-bar.md +161 -0
  83. package/docs/operations/bar.md +7050 -0
  84. package/docs/operations/combo.md +5825 -0
  85. package/docs/operations/date-picker.md +644 -0
  86. package/docs/operations/distribution-gauge.md +3218 -0
  87. package/docs/operations/dot.md +5662 -0
  88. package/docs/operations/filter.md +1507 -0
  89. package/docs/operations/gauge.md +3452 -0
  90. package/docs/operations/heatMap.md +6026 -0
  91. package/docs/operations/histogram.md +1870 -0
  92. package/docs/operations/iframe.md +56 -0
  93. package/docs/operations/image.md +177 -0
  94. package/docs/operations/index.md +46 -0
  95. package/docs/operations/line.md +6468 -0
  96. package/docs/operations/number.md +3969 -0
  97. package/docs/operations/pie.md +6089 -0
  98. package/docs/operations/radar.md +4646 -0
  99. package/docs/operations/sankey.md +3210 -0
  100. package/docs/operations/scatter.md +6075 -0
  101. package/docs/operations/shape.md +315 -0
  102. package/docs/operations/simpleTextObject.md +706 -0
  103. package/docs/operations/slider.md +230 -0
  104. package/docs/operations/table.md +8790 -0
  105. package/docs/operations/tree.md +2874 -0
  106. package/docs/operations/treemap.md +3619 -0
  107. package/docs/operations/waterfall.md +2938 -0
  108. package/docs/operations/word-cloud.md +3071 -0
  109. package/getters.js +18 -0
  110. package/index.js +1183 -0
  111. package/metadata.js +20 -0
  112. package/operations.js +64 -0
  113. package/package.json +191 -4
  114. package/src/definitions/index.d.ts +2 -0
  115. package/src/definitions/shared/index.d.ts +5 -0
  116. package/src/definitions/shared/lib/available-fields.d.ts +36 -0
  117. package/src/definitions/shared/lib/compilers/index.d.ts +7 -0
  118. package/src/definitions/shared/lib/registry/compile.d.ts +2 -0
  119. package/src/definitions/shared/lib/registry/descriptor-registry.d.ts +587 -0
  120. package/src/definitions/shared/lib/registry/index.d.ts +3 -0
  121. package/src/definitions/shared/lib/registry/validation.d.ts +3 -0
  122. package/src/definitions/shared/lib/schemas/app-filter-bar.schema.d.ts +22 -0
  123. package/src/definitions/shared/lib/schemas/bar.schema.d.ts +73 -0
  124. package/src/definitions/shared/lib/schemas/broad-chart.schema.d.ts +68 -0
  125. package/src/definitions/shared/lib/schemas/common.schema.d.ts +304 -0
  126. package/src/definitions/shared/lib/schemas/filter.schema.d.ts +22 -0
  127. package/src/definitions/shared/lib/schemas/index.d.ts +9 -0
  128. package/src/definitions/shared/lib/schemas/line.schema.d.ts +72 -0
  129. package/src/definitions/shared/lib/schemas/number.schema.d.ts +21 -0
  130. package/src/definitions/shared/lib/schemas/object.schema.d.ts +215 -0
  131. package/src/definitions/shared/lib/schemas/table.schema.d.ts +458 -0
  132. package/src/definitions/shared/lib/types/compilation.types.d.ts +36 -0
  133. package/src/definitions/shared/lib/types/definition.types.d.ts +2 -0
  134. package/src/definitions/shared/lib/types/descriptor.types.d.ts +39 -0
  135. package/src/definitions/shared/lib/types/index.d.ts +3 -0
  136. package/src/getters/index.d.ts +30 -0
  137. package/src/index.d.ts +4 -0
  138. package/src/metadata/index.d.ts +4 -0
  139. package/src/operations/index.d.ts +30 -0
  140. package/src/registry/index.d.ts +6 -0
  141. package/src/runtime/index.d.ts +2 -0
  142. package/src/types.d.ts +307 -0
  143. package/src/visualization-catalog.d.ts +82 -0
  144. package/src/web-components/index.d.ts +12 -0
  145. package/styles.css +2 -0
@@ -0,0 +1,674 @@
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;
10
+ 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
51
+ };
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,
58
+ label: e,
59
+ fontFamily: t.fontFamily,
60
+ letterSpacing: `${t.letterSpacing}`,
61
+ fontWeight: t.bold ? 700 : 400,
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);
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 = {
71
+ width: 1920,
72
+ height: 1080
73
+ }, z = (e) => e / 1920 * 100, B = (e) => e / ee.height * 100, V = E(), te = v({
74
+ wrapper: {
75
+ height: "100%",
76
+ position: "relative",
77
+ ".ql-editor": { padding: 0 }
78
+ },
79
+ changed: { "&::before": {
80
+ content: "\"*\"",
81
+ color: "#5d098d",
82
+ marginRight: 0,
83
+ position: "absolute",
84
+ right: 6,
85
+ top: 0,
86
+ fontSize: 24
87
+ } }
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
+ if (!l.current) return;
92
+ let r = l.current, p = r.appendChild(r.ownerDocument.createElement("div")), m = {
93
+ value: e,
94
+ variableAPI: s,
95
+ objectId: c,
96
+ ...d ? { dataSetsAPI: d } : {},
97
+ readOnly: !0,
98
+ toolbar: "floating",
99
+ responsive: i !== !1,
100
+ displaySettings: {
101
+ overflowBehavior: a ? "responsive" : "ellipsis",
102
+ maxLines: o
103
+ },
104
+ showInvalidDataSetReference: f,
105
+ onChange: (e, t) => {},
106
+ onBlur: (e) => {
107
+ n?.(e);
108
+ }
109
+ }, h = t.daedalus.textEditorService.createTextEditor(p, m);
110
+ return u.current = h, () => {
111
+ u.current?.destroy(), u.current = null, r.innerHTML = "";
112
+ };
113
+ }, [
114
+ d,
115
+ u,
116
+ s,
117
+ c,
118
+ i,
119
+ a,
120
+ o,
121
+ f
122
+ ]), (0, M.useEffect)(() => {
123
+ u.current?.getContents() !== e && u.current?.setContents(e), m(!1);
124
+ }, [e, s]);
125
+ let g = () => {
126
+ if (t.daedalus.objectCapabilities.editable && t.daedalus.workbookAPI.isObjectEditableAndActive(c)) {
127
+ let i = {
128
+ overflowBehavior: a ? "responsive" : "ellipsis",
129
+ maxLines: o
130
+ }, l = {
131
+ initialValue: e,
132
+ variableAPI: s,
133
+ objectId: c,
134
+ displaySettings: i,
135
+ onSubmit: (e, t = i) => {
136
+ if (r) {
137
+ r(e, t);
138
+ return;
139
+ }
140
+ n?.(e);
141
+ },
142
+ ...d ? { dataSetsAPI: d } : {}
143
+ };
144
+ t.daedalus.textEditorService.openTextEditor(l);
145
+ }
146
+ };
147
+ return /* @__PURE__ */ (0, V.jsx)("div", {
148
+ ref: l,
149
+ className: x({
150
+ [h.wrapper]: !0,
151
+ [h.changed]: p,
152
+ "ast-advanced-text-editor": !1
153
+ }),
154
+ onClick: g
155
+ });
156
+ }, H = v({
157
+ mainContainer: {
158
+ width: "100%",
159
+ height: "100%",
160
+ display: "block",
161
+ overflow: "hidden"
162
+ },
163
+ textContainer: {
164
+ width: "100%",
165
+ height: "100%",
166
+ position: "absolute",
167
+ top: 0,
168
+ left: 0,
169
+ display: "flex",
170
+ overflowX: "hidden",
171
+ lineHeight: 1,
172
+ color: "#1F1C3B",
173
+ fontFamily: s("Roboto"),
174
+ fontStyle: "normal",
175
+ fontWeight: 700
176
+ },
177
+ image: {
178
+ width: "100%",
179
+ height: "100%"
180
+ },
181
+ spanElement: {
182
+ cursor: "default",
183
+ width: "100%",
184
+ flex: "1 1 auto",
185
+ overflow: "hidden",
186
+ overflowWrap: "break-word",
187
+ textOverflow: "ellipsis",
188
+ WebkitBoxOrient: "vertical"
189
+ }
190
+ });
191
+ s("Roboto");
192
+ var re = "\n height: 100%; \n width: 100%;\n display: block;\n overflow: auto;\n", U = `
193
+ width: 100%;
194
+ height: 100%;
195
+ position: absolute;
196
+ top: 0;
197
+ left: 0;
198
+ display: flex;
199
+ -overflow-x: hidden;
200
+ overflow: auto;
201
+ line-height: 1;
202
+ color: #1F1C3B;
203
+ font-family: Roboto, ${g};
204
+ font-style: normal;
205
+ 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) => {
207
+ function n(e, t, n, r) {
208
+ var i = -1, a = e == null ? 0 : e.length;
209
+ for (r && a && (n = e[++i]); ++i < a;) n = t(n, e[i], i, e);
210
+ return n;
211
+ }
212
+ t.exports = n;
213
+ })), K = /* @__PURE__ */ t(((e, t) => {
214
+ function n(e) {
215
+ return function(t) {
216
+ return e?.[t];
217
+ };
218
+ }
219
+ t.exports = n;
220
+ })), q = /* @__PURE__ */ t(((e, t) => {
221
+ t.exports = K()({
222
+ À: "A",
223
+ Á: "A",
224
+ Â: "A",
225
+ Ã: "A",
226
+ Ä: "A",
227
+ Å: "A",
228
+ à: "a",
229
+ á: "a",
230
+ â: "a",
231
+ ã: "a",
232
+ ä: "a",
233
+ å: "a",
234
+ Ç: "C",
235
+ ç: "c",
236
+ Ð: "D",
237
+ ð: "d",
238
+ È: "E",
239
+ É: "E",
240
+ Ê: "E",
241
+ Ë: "E",
242
+ è: "e",
243
+ é: "e",
244
+ ê: "e",
245
+ ë: "e",
246
+ Ì: "I",
247
+ Í: "I",
248
+ Î: "I",
249
+ Ï: "I",
250
+ ì: "i",
251
+ í: "i",
252
+ î: "i",
253
+ ï: "i",
254
+ Ñ: "N",
255
+ ñ: "n",
256
+ Ò: "O",
257
+ Ó: "O",
258
+ Ô: "O",
259
+ Õ: "O",
260
+ Ö: "O",
261
+ Ø: "O",
262
+ ò: "o",
263
+ ó: "o",
264
+ ô: "o",
265
+ õ: "o",
266
+ ö: "o",
267
+ ø: "o",
268
+ Ù: "U",
269
+ Ú: "U",
270
+ Û: "U",
271
+ Ü: "U",
272
+ ù: "u",
273
+ ú: "u",
274
+ û: "u",
275
+ ü: "u",
276
+ Ý: "Y",
277
+ ý: "y",
278
+ ÿ: "y",
279
+ Æ: "Ae",
280
+ æ: "ae",
281
+ Þ: "Th",
282
+ þ: "th",
283
+ ß: "ss",
284
+ Ā: "A",
285
+ Ă: "A",
286
+ Ą: "A",
287
+ ā: "a",
288
+ ă: "a",
289
+ ą: "a",
290
+ Ć: "C",
291
+ Ĉ: "C",
292
+ Ċ: "C",
293
+ Č: "C",
294
+ ć: "c",
295
+ ĉ: "c",
296
+ ċ: "c",
297
+ č: "c",
298
+ Ď: "D",
299
+ Đ: "D",
300
+ ď: "d",
301
+ đ: "d",
302
+ Ē: "E",
303
+ Ĕ: "E",
304
+ Ė: "E",
305
+ Ę: "E",
306
+ Ě: "E",
307
+ ē: "e",
308
+ ĕ: "e",
309
+ ė: "e",
310
+ ę: "e",
311
+ ě: "e",
312
+ Ĝ: "G",
313
+ Ğ: "G",
314
+ Ġ: "G",
315
+ Ģ: "G",
316
+ ĝ: "g",
317
+ ğ: "g",
318
+ ġ: "g",
319
+ ģ: "g",
320
+ Ĥ: "H",
321
+ Ħ: "H",
322
+ ĥ: "h",
323
+ ħ: "h",
324
+ Ĩ: "I",
325
+ Ī: "I",
326
+ Ĭ: "I",
327
+ Į: "I",
328
+ İ: "I",
329
+ ĩ: "i",
330
+ ī: "i",
331
+ ĭ: "i",
332
+ į: "i",
333
+ ı: "i",
334
+ Ĵ: "J",
335
+ ĵ: "j",
336
+ Ķ: "K",
337
+ ķ: "k",
338
+ ĸ: "k",
339
+ Ĺ: "L",
340
+ Ļ: "L",
341
+ Ľ: "L",
342
+ Ŀ: "L",
343
+ Ł: "L",
344
+ ĺ: "l",
345
+ ļ: "l",
346
+ ľ: "l",
347
+ ŀ: "l",
348
+ ł: "l",
349
+ Ń: "N",
350
+ Ņ: "N",
351
+ Ň: "N",
352
+ Ŋ: "N",
353
+ ń: "n",
354
+ ņ: "n",
355
+ ň: "n",
356
+ ŋ: "n",
357
+ Ō: "O",
358
+ Ŏ: "O",
359
+ Ő: "O",
360
+ ō: "o",
361
+ ŏ: "o",
362
+ ő: "o",
363
+ Ŕ: "R",
364
+ Ŗ: "R",
365
+ Ř: "R",
366
+ ŕ: "r",
367
+ ŗ: "r",
368
+ ř: "r",
369
+ Ś: "S",
370
+ Ŝ: "S",
371
+ Ş: "S",
372
+ Š: "S",
373
+ ś: "s",
374
+ ŝ: "s",
375
+ ş: "s",
376
+ š: "s",
377
+ Ţ: "T",
378
+ Ť: "T",
379
+ Ŧ: "T",
380
+ ţ: "t",
381
+ ť: "t",
382
+ ŧ: "t",
383
+ Ũ: "U",
384
+ Ū: "U",
385
+ Ŭ: "U",
386
+ Ů: "U",
387
+ Ű: "U",
388
+ Ų: "U",
389
+ ũ: "u",
390
+ ū: "u",
391
+ ŭ: "u",
392
+ ů: "u",
393
+ ű: "u",
394
+ ų: "u",
395
+ Ŵ: "W",
396
+ ŵ: "w",
397
+ Ŷ: "Y",
398
+ ŷ: "y",
399
+ Ÿ: "Y",
400
+ Ź: "Z",
401
+ Ż: "Z",
402
+ Ž: "Z",
403
+ ź: "z",
404
+ ż: "z",
405
+ ž: "z",
406
+ IJ: "IJ",
407
+ ij: "ij",
408
+ Œ: "Oe",
409
+ œ: "oe",
410
+ ʼn: "'n",
411
+ ſ: "s"
412
+ });
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
+ })), Y = /* @__PURE__ */ t(((e, t) => {
420
+ var n = /[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g;
421
+ function r(e) {
422
+ return e.match(n) || [];
423
+ }
424
+ t.exports = r;
425
+ })), ie = /* @__PURE__ */ t(((e, t) => {
426
+ 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
+ function r(e) {
428
+ return n.test(e);
429
+ }
430
+ t.exports = r;
431
+ })), ae = /* @__PURE__ */ t(((e, t) => {
432
+ 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
+ x,
434
+ S,
435
+ C
436
+ ].join("|") + ")" + j + A + ")*", N = "\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])", P = "\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])", F = j + A + M, I = "(?:" + [
437
+ _,
438
+ S,
439
+ C
440
+ ].join("|") + ")" + F, L = RegExp([
441
+ w + "?" + v + "+" + O + "(?=" + [
442
+ m,
443
+ w,
444
+ "$"
445
+ ].join("|") + ")",
446
+ D + "+" + k + "(?=" + [
447
+ m,
448
+ w + E,
449
+ "$"
450
+ ].join("|") + ")",
451
+ w + "?" + E + "+" + O,
452
+ w + "+" + k,
453
+ P,
454
+ N,
455
+ g,
456
+ I
457
+ ].join("|"), "g");
458
+ function R(e) {
459
+ return e.match(L) || [];
460
+ }
461
+ 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
+ })), se = /* @__PURE__ */ t(((e, t) => {
469
+ var n = G(), r = J(), i = oe(), a = RegExp("['’]", "g");
470
+ function o(e) {
471
+ return function(t) {
472
+ return n(i(r(t).replace(a, "")), e, "");
473
+ };
474
+ }
475
+ t.exports = o;
476
+ })), ce = /* @__PURE__ */ e((/* @__PURE__ */ t(((e, t) => {
477
+ t.exports = se()(function(e, t, n) {
478
+ return e + (n ? "-" : "") + t.toLowerCase();
479
+ });
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);
482
+ return {
483
+ fontFamily: e.fontFamily,
484
+ fontSize: `${t}${n}`,
485
+ fontWeight: e.weight ?? (e.bold ? "bold" : "normal"),
486
+ fontStyle: e.italic ? "italic" : "normal",
487
+ color: e.textColor ?? "inherit",
488
+ textAlign: e.align ?? "center",
489
+ textDecoration: i,
490
+ letterSpacing: `${e.letterSpacing}px`,
491
+ 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,
498
+ overflow: e.responsive ? "visible" : "hidden",
499
+ textOverflow: e.responsive ? "initial" : "ellipsis",
500
+ WebkitLineClamp: e.maxLines || 1,
501
+ WebkitBoxOrient: e.responsive ? "initial" : "vertical",
502
+ display: e.responsive ? "initial" : "-webkit-box"
503
+ };
504
+ }, X = (e) => {
505
+ let t = e.borderStyle === f.Line ? "solid" : "dashed";
506
+ return {
507
+ backgroundColor: (e.backgroundType === n.Image ? null : e.backgroundColor) ?? "transparent",
508
+ border: `${e.borderWidth}px ${t} ${e.borderColor}`,
509
+ borderRadius: `${e.borderRadius}px`,
510
+ backdropFilter: `blur(${e.backgroundBlur}px)`,
511
+ boxShadow: e.objectShadow ? `0px 2px 4px ${a.alphaBlack(.25)}` : "none"
512
+ };
513
+ }, Z = (e) => ({ padding: `${e.textPadding ?? 0}px` }), ue = (e, t, n) => {
514
+ if (!n) return {};
515
+ let r = e.fontSize;
516
+ 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
+ }
521
+ return {};
522
+ }, de = {
523
+ borderStyle: "none",
524
+ width: "100%",
525
+ height: "100%",
526
+ position: "absolute"
527
+ }, fe = (e) => ({
528
+ objectFit: e.imageFitType ?? "contain",
529
+ opacity: e.imageOpacity ?? 1
530
+ }), Q = (e) => Object.entries(e).map(([e, t]) => {
531
+ let n = (0, ce.default)(e);
532
+ return typeof t == "number" && ![
533
+ "lineHeight",
534
+ "opacity",
535
+ "zIndex"
536
+ ].includes(e) && (t = `${t}px`), `${n}: ${t};`;
537
+ }).join(" "), pe = (e, t) => `:host {
538
+ ${re}
539
+ }
540
+ .astrato-html-main-container {
541
+ ${U}
542
+ }
543
+ .astrato-html-container {
544
+ ${W}
545
+ ${Q(e)}
546
+ }
547
+ .astrato-html-container p {
548
+ margin: ${t.representation === r.Markdown ? `${t.paragraphMargin}px` : 0};
549
+ }
550
+ .astrato-html-container li {
551
+ 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
+ ..._,
561
+ fontSize: `${e.fontSize}px`
562
+ };
563
+ delete S.paddingBottom, delete S.paddingTop, delete S.display, (0, M.useEffect)(() => {
564
+ let t = async () => {
565
+ e.representation === r.Markdown ? d(await k(f)) : d(f);
566
+ };
567
+ (async () => {
568
+ await t(), !h && !g && s();
569
+ })();
570
+ }, [
571
+ f,
572
+ e.representation,
573
+ h,
574
+ g,
575
+ s
576
+ ]);
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
+ children: /* @__PURE__ */ (0, V.jsxs)("div", {
581
+ className: a.mainContainer,
582
+ style: v,
583
+ "data-testid": "simple-text-object-container",
584
+ children: [
585
+ g ? /* @__PURE__ */ (0, V.jsx)(y, {
586
+ html: me(O),
587
+ css: pe(S, e),
588
+ style: de,
589
+ onRendered: s
590
+ }) : null,
591
+ h ? /* @__PURE__ */ (0, V.jsx)("img", {
592
+ src: e.backgroundImage,
593
+ className: a.image,
594
+ style: x,
595
+ onLoad: () => s(),
596
+ onError: () => s(),
597
+ alt: "text background"
598
+ }) : 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: _,
605
+ "data-ellipsis": !0,
606
+ "data-testid": "simple-text-object-content",
607
+ children: /* @__PURE__ */ (0, V.jsx)("a", {
608
+ target: "_blank",
609
+ rel: "noreferrer",
610
+ href: C,
611
+ style: {
612
+ textDecoration: "inherit",
613
+ color: "inherit"
614
+ },
615
+ children: g ? "" : O
616
+ })
617
+ }) : /* @__PURE__ */ (0, V.jsx)("div", {
618
+ className: a.spanElement,
619
+ style: {
620
+ ..._,
621
+ pointerEvents: "none"
622
+ },
623
+ "data-ellipsis": !0,
624
+ "data-testid": "simple-text-object-content",
625
+ children: g ? "" : O
626
+ })
627
+ }) }) : null
628
+ ]
629
+ })
630
+ });
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
+ s();
635
+ }, [s]), /* @__PURE__ */ (0, V.jsx)("div", {
636
+ className: o.mainContainer,
637
+ style: {
638
+ ...i,
639
+ ...a,
640
+ ...l
641
+ },
642
+ "data-testid": "simple-text-object-container",
643
+ children: /* @__PURE__ */ (0, V.jsx)(ne, {
644
+ value: e.textContent,
645
+ backendAPI: n,
646
+ responsive: c === h.ViewportBreakpoints,
647
+ richTextResponsive: e.richTextResponsive,
648
+ richTextMaxLines: e.richTextMaxLines,
649
+ onSubmit: (t, n) => {
650
+ let i = n.overflowBehavior === "responsive", a = n.maxLines;
651
+ e.textContent === t && e.richTextResponsive === i && e.richTextMaxLines === a || O(r, {
652
+ textContent: t,
653
+ richTextResponsive: i,
654
+ richTextMaxLines: a
655
+ });
656
+ }
657
+ })
658
+ });
659
+ }, ye = (e) => {
660
+ let t = e.vTheme ?? l, n = N(e.vSpec, t), r = I(n.responsive, n.scaling), i = {
661
+ ...e,
662
+ scaling: r,
663
+ textObjectSettings: n
664
+ };
665
+ if (n.textContentType === u.Delta) return /* @__PURE__ */ (0, V.jsx)(ve, {
666
+ textObjectSettings: n,
667
+ isRichTextScalingSet: e.vSpec?.simpleTextObjectSettings?.richTextScaling !== void 0
668
+ });
669
+ switch (r) {
670
+ case c.FitToObject: return /* @__PURE__ */ (0, V.jsx)(_e, { ...i });
671
+ default: return /* @__PURE__ */ (0, V.jsx)($, { ...i });
672
+ }
673
+ };
674
+ export { ye as SimpleTextObject };