@astrato-io/visualizations 0.0.0-stage → 0.6.5

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