@elevasis/ui 2.40.1 → 2.41.1

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 (92) hide show
  1. package/dist/api/index.js +4 -6
  2. package/dist/app/index.css +384 -0
  3. package/dist/app/index.d.ts +108 -0
  4. package/dist/app/index.js +17 -27
  5. package/dist/auth/index.css +659 -0
  6. package/dist/auth/index.js +19 -6
  7. package/dist/charts/index.css +533 -0
  8. package/dist/charts/index.js +18 -15
  9. package/dist/{chunk-RXH4D6TY.js → chunk-5M4HSHQ5.js} +631 -2
  10. package/dist/{chunk-TE4P6OSJ.js → chunk-7FJI76OH.js} +1 -1
  11. package/dist/chunk-GMXGDO3I.js +244 -0
  12. package/dist/{chunk-CXY7FMUM.js → chunk-GUKY77FJ.js} +50 -4
  13. package/dist/{chunk-5JYKCULK.js → chunk-NZ2F5RQ4.js} +44 -2
  14. package/dist/{chunk-WF7CONXF.js → chunk-OJJK27GC.js} +658 -6
  15. package/dist/{chunk-RX6RSKWC.js → chunk-QDXTIQT4.js} +29255 -18312
  16. package/dist/{chunk-73EWE2EW.js → chunk-V5HWC5EW.js} +1 -1
  17. package/dist/components/chat/index.js +1 -2
  18. package/dist/components/index.css +149 -149
  19. package/dist/components/index.js +13 -37
  20. package/dist/components/navigation/index.css +659 -0
  21. package/dist/components/navigation/index.js +25 -4
  22. package/dist/features/auth/index.js +14 -38
  23. package/dist/features/clients/index.css +149 -149
  24. package/dist/features/clients/index.js +13 -37
  25. package/dist/features/crm/index.js +13 -37
  26. package/dist/features/dashboard/index.js +13 -37
  27. package/dist/features/delivery/index.js +13 -37
  28. package/dist/features/knowledge/index.css +659 -0
  29. package/dist/features/knowledge/index.js +25 -248
  30. package/dist/features/lead-gen/index.d.ts +81 -0
  31. package/dist/features/lead-gen/index.js +13 -37
  32. package/dist/features/monitoring/index.js +13 -37
  33. package/dist/features/monitoring/requests/index.d.ts +69 -7
  34. package/dist/features/monitoring/requests/index.js +32 -41
  35. package/dist/features/operations/index.d.ts +79 -0
  36. package/dist/features/operations/index.js +13 -37
  37. package/dist/features/seo/index.js +1 -4
  38. package/dist/features/settings/index.js +13 -37
  39. package/dist/hooks/access/index.css +659 -0
  40. package/dist/hooks/access/index.js +19 -5
  41. package/dist/hooks/delivery/index.js +13 -37
  42. package/dist/hooks/index.d.ts +18 -6
  43. package/dist/hooks/index.js +13 -37
  44. package/dist/hooks/published.d.ts +18 -6
  45. package/dist/hooks/published.js +13 -37
  46. package/dist/index.d.ts +151 -7
  47. package/dist/index.js +14 -38
  48. package/dist/initialization/index.js +1 -1
  49. package/dist/knowledge/index.css +659 -0
  50. package/dist/knowledge/index.d.ts +81 -0
  51. package/dist/knowledge/index.js +25 -15
  52. package/dist/layout/index.css +659 -0
  53. package/dist/layout/index.d.ts +18 -2
  54. package/dist/layout/index.js +24 -7
  55. package/dist/organization/index.js +13 -37
  56. package/dist/provider/index.css +384 -0
  57. package/dist/provider/index.d.ts +120 -1
  58. package/dist/provider/index.js +18 -22
  59. package/dist/provider/published.css +533 -0
  60. package/dist/provider/published.d.ts +121 -2
  61. package/dist/provider/published.js +18 -17
  62. package/dist/test-utils/index.js +4 -6
  63. package/dist/theme/index.js +2 -5
  64. package/dist/theme/presets/index.js +1 -2
  65. package/dist/utils/index.js +1 -3
  66. package/package.json +3 -3
  67. package/dist/chunk-3KMDHCAR.js +0 -52
  68. package/dist/chunk-4DRI3G36.js +0 -1016
  69. package/dist/chunk-5EYJ2GIN.js +0 -122
  70. package/dist/chunk-66U7JOWV.js +0 -425
  71. package/dist/chunk-6D4LCJ52.js +0 -10
  72. package/dist/chunk-6EV47QQW.js +0 -340
  73. package/dist/chunk-6ROXVZ3L.js +0 -9
  74. package/dist/chunk-7MTWRSUZ.js +0 -357
  75. package/dist/chunk-7PHY5ONQ.js +0 -85
  76. package/dist/chunk-B2DZLPDL.js +0 -39
  77. package/dist/chunk-CLDCYJQT.js +0 -1
  78. package/dist/chunk-CTJBPF3Z.js +0 -734
  79. package/dist/chunk-DT3QYZVU.js +0 -23
  80. package/dist/chunk-IIMU5YAJ.js +0 -53
  81. package/dist/chunk-IUQAP4IO.js +0 -2131
  82. package/dist/chunk-J3FLIZY4.js +0 -423
  83. package/dist/chunk-K7GKKETO.js +0 -3157
  84. package/dist/chunk-L7GXUSCV.js +0 -215
  85. package/dist/chunk-LJDYY3XB.js +0 -133
  86. package/dist/chunk-NYBEU5TE.js +0 -118
  87. package/dist/chunk-RH5VWWSC.js +0 -624
  88. package/dist/chunk-SJNIOGVX.js +0 -112
  89. package/dist/chunk-TYRUKGGD.js +0 -46
  90. package/dist/chunk-WLOQ4IBG.js +0 -654
  91. package/dist/chunk-X4WBGKJQ.js +0 -138
  92. package/dist/chunk-X7D6SUKR.js +0 -1234
@@ -1,122 +0,0 @@
1
- // src/features/operations/organization-graph/types.ts
2
- var ORGANIZATION_GRAPH_NODE_KIND_ORDER = [
3
- "organization",
4
- "system",
5
- "role",
6
- "action",
7
- "entity",
8
- "event",
9
- "policy",
10
- "stage",
11
- "resource",
12
- "knowledge",
13
- "customer-segment",
14
- "offering",
15
- "goal",
16
- "surface",
17
- "navigation-group",
18
- "ontology"
19
- ];
20
- var ORGANIZATION_GRAPH_NODE_KIND_LABELS = {
21
- organization: "Organization",
22
- system: "System",
23
- role: "Role",
24
- action: "Action",
25
- entity: "Entity",
26
- event: "Event",
27
- policy: "Policy",
28
- stage: "Stage",
29
- resource: "Resource",
30
- knowledge: "Knowledge",
31
- "customer-segment": "Customer segment",
32
- offering: "Offering",
33
- goal: "Goal",
34
- surface: "Surface",
35
- "navigation-group": "Navigation group",
36
- ontology: "Ontology"
37
- };
38
- var ORGANIZATION_GRAPH_NODE_KIND_DETAIL_LABELS = {
39
- organization: "Organization root",
40
- system: "System",
41
- role: "Role",
42
- action: "Action",
43
- entity: "Entity",
44
- event: "Event",
45
- policy: "Policy",
46
- stage: "Stage",
47
- resource: "Resource",
48
- knowledge: "Knowledge",
49
- "customer-segment": "Customer segment",
50
- offering: "Offering",
51
- goal: "Goal",
52
- surface: "Surface",
53
- "navigation-group": "Navigation group",
54
- ontology: "Ontology record"
55
- };
56
- var ORGANIZATION_GRAPH_NODE_KIND_MEANINGS = {
57
- organization: "The root of the shared organization model and the parent for every derived node.",
58
- system: "A canonical Organization Model system for ownership, routing, and governance.",
59
- role: "An Organization Model role that owns responsibilities and may govern systems.",
60
- action: "A reusable action that can be attached to a system.",
61
- entity: "A modeled business object or stateful data domain owned by the organization model.",
62
- event: "A derived domain or runtime event emitted by entities, resources, or actions.",
63
- policy: "A governance rule that applies to targets and may trigger effects across the graph.",
64
- stage: "A lifecycle stage that records progress for an entity through a build pipeline.",
65
- resource: "A concrete command-view or mapped resource that bridges execution topology into the model.",
66
- knowledge: "An operational knowledge node that documents a process, strategy, or runbook in the org model.",
67
- "customer-segment": "A defined segment of customers or prospects that the organization targets or serves.",
68
- offering: "A product, service, or value proposition the organization delivers to customer segments.",
69
- goal: "A strategic or operational objective that guides priorities and measures progress.",
70
- surface: "A navigation surface (page or view) that is exposed through the platform shell.",
71
- "navigation-group": "A logical grouping of navigation surfaces within the platform shell.",
72
- ontology: "A compiled ontology record such as an object, action, catalog, value type, surface, or resource binding."
73
- };
74
- var ORGANIZATION_GRAPH_EDGE_KIND_LABELS = {
75
- contains: "Containment",
76
- references: "Reference",
77
- maps_to: "Mapping",
78
- uses: "Uses",
79
- governs: "Governs",
80
- links: "Links",
81
- affects: "Affects",
82
- emits: "Emits",
83
- originates_from: "Originates from",
84
- triggers: "Triggers",
85
- approval: "Approval",
86
- applies_to: "Applies to",
87
- effects: "Effects",
88
- actions: "Actions",
89
- reads: "Reads",
90
- writes: "Writes",
91
- uses_catalog: "Uses catalog"
92
- };
93
- var ORGANIZATION_GRAPH_EDGE_KIND_MEANINGS = {
94
- contains: "A hierarchy or ownership link inside the shared graph.",
95
- references: "A semantic association or dependency between two graph nodes.",
96
- maps_to: "An action is aligned to a concrete resource.",
97
- uses: "A graph node depends on another node, resource, entity, or integration.",
98
- governs: "A knowledge node, role, or policy provides authoritative guidance for another node.",
99
- links: "Two modeled nodes are associated without stronger ownership or execution semantics.",
100
- affects: "The source can influence the behavior, state, or outcome of the target.",
101
- emits: "The source produces an event that can be inspected or traversed.",
102
- originates_from: "The source is derived from or owned by the target origin.",
103
- triggers: "The source can start or activate the target.",
104
- approval: "The source requests or participates in an approval path.",
105
- applies_to: "A policy or rule targets the node it applies to.",
106
- effects: "A policy or event produces the target effect.",
107
- actions: "The source is bound to the target ontology action contract.",
108
- reads: "The source reads data described by the target ontology record.",
109
- writes: "The source writes data described by the target ontology record.",
110
- uses_catalog: "The source uses the target ontology catalog."
111
- };
112
- var DEFAULT_ORGANIZATION_GRAPH_FILTERS = {
113
- search: "",
114
- nodeKinds: [],
115
- topologyPresence: "all",
116
- environmentStatus: "all",
117
- resourceTypes: [],
118
- showIntegrations: true,
119
- domainFilters: {}
120
- };
121
-
122
- export { DEFAULT_ORGANIZATION_GRAPH_FILTERS, ORGANIZATION_GRAPH_EDGE_KIND_LABELS, ORGANIZATION_GRAPH_EDGE_KIND_MEANINGS, ORGANIZATION_GRAPH_NODE_KIND_DETAIL_LABELS, ORGANIZATION_GRAPH_NODE_KIND_LABELS, ORGANIZATION_GRAPH_NODE_KIND_MEANINGS, ORGANIZATION_GRAPH_NODE_KIND_ORDER };
@@ -1,425 +0,0 @@
1
- import { useAppearance } from './chunk-L7GXUSCV.js';
2
- import { useState, Component } from 'react';
3
- import { CopyButton, Tooltip } from '@mantine/core';
4
- import { IconCheck, IconCopy } from '@tabler/icons-react';
5
- import { jsxs, jsx, Fragment } from 'react/jsx-runtime';
6
-
7
- var tokens = {
8
- cardBg: "rgba(16, 16, 20, 0.92)",
9
- cardBorder: "rgba(255, 255, 255, 0.06)",
10
- accentRed: "#ff5555",
11
- accentRedDim: "rgba(255, 85, 85, 0.15)",
12
- textPrimary: "#e8e8e8",
13
- textSecondary: "rgba(255, 255, 255, 0.5)",
14
- textTertiary: "rgba(255, 255, 255, 0.3)",
15
- codeBg: "rgba(0, 0, 0, 0.35)",
16
- codeBorder: "rgba(255, 255, 255, 0.05)",
17
- fileHighlight: "#7dd3fc",
18
- separator: "rgba(255, 255, 255, 0.06)",
19
- mono: "'JetBrains Mono', 'Fira Code', 'Cascadia Code', ui-monospace, monospace",
20
- sans: "'Inter', -apple-system, system-ui, sans-serif"
21
- };
22
- function parseStackFrames(stack) {
23
- return stack.split("\n").filter((line) => line.trim().startsWith("at ")).map((line) => {
24
- const trimmed = line.trim();
25
- const parenMatch = trimmed.match(/^at\s+(.+?)\s+\((.+)\)$/);
26
- if (parenMatch) {
27
- return { fn: parenMatch[1], file: parenMatch[2], raw: trimmed };
28
- }
29
- const simpleMatch = trimmed.match(/^at\s+(.+)$/);
30
- if (simpleMatch) {
31
- return { fn: "", file: simpleMatch[1], raw: trimmed };
32
- }
33
- return { fn: "", file: "", raw: trimmed };
34
- });
35
- }
36
- var COMPONENT_NOISE = /* @__PURE__ */ new Set([
37
- "div",
38
- "main",
39
- "span",
40
- "section",
41
- "Lazy",
42
- "Suspense",
43
- "SafeFragment",
44
- "MatchImpl",
45
- "MatchInnerImpl",
46
- "OutletImpl",
47
- "CatchBoundaryImpl",
48
- "CatchBoundary",
49
- "MatchesInner",
50
- "Matches",
51
- "SplitComponent"
52
- ]);
53
- function isNoiseComponent(name) {
54
- if (COMPONENT_NOISE.has(name)) return true;
55
- if (name.startsWith("@mantine/") || name.startsWith("@tanstack/")) return true;
56
- return false;
57
- }
58
- function parseComponentStack(stack) {
59
- return stack.trim().split("\n").map((line) => line.trim()).filter((line) => line.startsWith("at ")).map((line) => {
60
- const match = line.match(/^at\s+(\S+)/);
61
- return match ? match[1] : line.replace(/^at\s+/, "");
62
- }).filter((name) => !isNoiseComponent(name));
63
- }
64
- function SectionLabel({ children }) {
65
- return /* @__PURE__ */ jsx(
66
- "div",
67
- {
68
- style: {
69
- fontSize: 10,
70
- fontFamily: tokens.sans,
71
- fontWeight: 600,
72
- textTransform: "uppercase",
73
- letterSpacing: "0.08em",
74
- color: tokens.textTertiary,
75
- marginBottom: 6
76
- },
77
- children
78
- }
79
- );
80
- }
81
- function CodeBlock({ children, style }) {
82
- return /* @__PURE__ */ jsx(
83
- "div",
84
- {
85
- style: {
86
- background: tokens.codeBg,
87
- border: `1px solid ${tokens.codeBorder}`,
88
- borderRadius: 6,
89
- padding: "10px 14px",
90
- fontFamily: tokens.mono,
91
- fontSize: 12,
92
- lineHeight: 1.6,
93
- color: tokens.textPrimary,
94
- overflowX: "auto",
95
- ...style
96
- },
97
- children
98
- }
99
- );
100
- }
101
- function StackFrameRow({ frame }) {
102
- return /* @__PURE__ */ jsxs("div", { style: { display: "flex", gap: 8, alignItems: "baseline" }, children: [
103
- frame.fn && /* @__PURE__ */ jsx("span", { style: { color: tokens.textPrimary, flexShrink: 0 }, children: frame.fn }),
104
- /* @__PURE__ */ jsx("span", { style: { color: tokens.fileHighlight, opacity: 0.7, fontSize: 11 }, children: frame.file })
105
- ] });
106
- }
107
- function Separator() {
108
- return /* @__PURE__ */ jsx("div", { style: { height: 1, background: tokens.separator, margin: "4px 0" } });
109
- }
110
- function ErrorReportCard({
111
- errorName,
112
- errorMessage,
113
- errorStack,
114
- componentStack,
115
- eventId,
116
- url,
117
- timestamp,
118
- reportText,
119
- appVersion
120
- }) {
121
- const [expanded, setExpanded] = useState(true);
122
- const frames = errorStack ? parseStackFrames(errorStack) : [];
123
- const components = componentStack ? parseComponentStack(componentStack) : [];
124
- return /* @__PURE__ */ jsxs(
125
- "div",
126
- {
127
- style: {
128
- background: tokens.cardBg,
129
- border: `1px solid ${tokens.cardBorder}`,
130
- borderTop: `3px solid ${tokens.accentRed}`,
131
- borderRadius: 10,
132
- maxWidth: 720,
133
- width: "100%",
134
- fontFamily: tokens.sans,
135
- backdropFilter: "blur(20px)",
136
- boxShadow: "0 25px 60px rgba(0, 0, 0, 0.5), 0 0 40px rgba(255, 85, 85, 0.05)"
137
- },
138
- children: [
139
- /* @__PURE__ */ jsxs("div", { style: { padding: "20px 24px 0" }, children: [
140
- /* @__PURE__ */ jsxs("div", { style: { display: "flex", alignItems: "center", justifyContent: "space-between", marginBottom: 12 }, children: [
141
- /* @__PURE__ */ jsx("div", { style: { display: "flex", alignItems: "center", gap: 10 }, children: /* @__PURE__ */ jsx(
142
- "span",
143
- {
144
- style: {
145
- background: tokens.accentRedDim,
146
- color: tokens.accentRed,
147
- fontSize: 12,
148
- fontWeight: 600,
149
- fontFamily: tokens.mono,
150
- padding: "3px 10px",
151
- borderRadius: 4,
152
- letterSpacing: "0.02em"
153
- },
154
- children: errorName
155
- }
156
- ) }),
157
- /* @__PURE__ */ jsx(CopyButton, { value: reportText, timeout: 2e3, children: ({ copied, copy }) => /* @__PURE__ */ jsx(Tooltip, { label: copied ? "Copied!" : "Copy error report", position: "left", children: /* @__PURE__ */ jsxs(
158
- "button",
159
- {
160
- onClick: copy,
161
- style: {
162
- background: copied ? "rgba(45, 212, 191, 0.15)" : "rgba(255, 255, 255, 0.06)",
163
- border: `1px solid ${copied ? "rgba(45, 212, 191, 0.3)" : "rgba(255, 255, 255, 0.08)"}`,
164
- borderRadius: 6,
165
- padding: "5px 12px",
166
- color: copied ? "#2dd4bf" : tokens.textSecondary,
167
- cursor: "pointer",
168
- display: "flex",
169
- alignItems: "center",
170
- gap: 6,
171
- fontSize: 12,
172
- fontFamily: tokens.sans,
173
- transition: "all 0.15s ease"
174
- },
175
- children: [
176
- copied ? /* @__PURE__ */ jsx(IconCheck, { size: 13 }) : /* @__PURE__ */ jsx(IconCopy, { size: 13 }),
177
- copied ? "Copied" : "Copy"
178
- ]
179
- }
180
- ) }) })
181
- ] }),
182
- /* @__PURE__ */ jsx(
183
- "div",
184
- {
185
- style: {
186
- fontSize: 16,
187
- fontWeight: 500,
188
- color: tokens.textPrimary,
189
- lineHeight: 1.5,
190
- marginBottom: 16
191
- },
192
- children: errorMessage
193
- }
194
- ),
195
- /* @__PURE__ */ jsxs(
196
- "div",
197
- {
198
- style: {
199
- background: tokens.codeBg,
200
- border: `1px solid ${tokens.codeBorder}`,
201
- borderRadius: 6,
202
- padding: "8px 12px",
203
- fontFamily: tokens.mono,
204
- fontSize: 12,
205
- color: tokens.fileHighlight,
206
- marginBottom: 16,
207
- display: "flex",
208
- alignItems: "center",
209
- gap: 8
210
- },
211
- children: [
212
- /* @__PURE__ */ jsx("span", { style: { color: tokens.textTertiary, fontSize: 10, flexShrink: 0 }, children: "URL" }),
213
- /* @__PURE__ */ jsx("span", { style: { opacity: 0.8 }, children: url })
214
- ]
215
- }
216
- )
217
- ] }),
218
- /* @__PURE__ */ jsx("div", { style: { padding: "0 24px" }, children: /* @__PURE__ */ jsxs(
219
- "button",
220
- {
221
- onClick: () => setExpanded((v) => !v),
222
- style: {
223
- background: "none",
224
- border: "none",
225
- color: tokens.textTertiary,
226
- fontSize: 11,
227
- fontFamily: tokens.sans,
228
- cursor: "pointer",
229
- padding: "4px 0",
230
- display: "flex",
231
- alignItems: "center",
232
- gap: 4,
233
- letterSpacing: "0.05em",
234
- textTransform: "uppercase",
235
- fontWeight: 600
236
- },
237
- children: [
238
- expanded ? "- Hide" : "+ Show",
239
- " details"
240
- ]
241
- }
242
- ) }),
243
- expanded && /* @__PURE__ */ jsxs("div", { style: { padding: "8px 24px 20px" }, children: [
244
- frames.length > 0 && /* @__PURE__ */ jsxs("div", { style: { marginBottom: 16 }, children: [
245
- /* @__PURE__ */ jsx(SectionLabel, { children: "Stack Trace" }),
246
- /* @__PURE__ */ jsx(CodeBlock, { style: { maxHeight: 220, overflowY: "auto" }, children: frames.map((frame, i) => /* @__PURE__ */ jsx(StackFrameRow, { frame }, i)) })
247
- ] }),
248
- components.length > 0 && /* @__PURE__ */ jsxs("div", { style: { marginBottom: 16 }, children: [
249
- /* @__PURE__ */ jsx(SectionLabel, { children: "Component Tree" }),
250
- /* @__PURE__ */ jsx(CodeBlock, { style: { maxHeight: 120, overflowY: "auto" }, children: /* @__PURE__ */ jsx("div", { style: { display: "flex", flexWrap: "wrap", gap: "2px 0", alignItems: "center" }, children: components.map((name, i) => /* @__PURE__ */ jsxs("span", { style: { display: "inline-flex", alignItems: "center" }, children: [
251
- /* @__PURE__ */ jsx(
252
- "span",
253
- {
254
- style: {
255
- color: i === 0 ? tokens.accentRed : tokens.textPrimary,
256
- fontWeight: i === 0 ? 600 : 400
257
- },
258
- children: name
259
- }
260
- ),
261
- i < components.length - 1 && /* @__PURE__ */ jsx("span", { style: { color: tokens.textTertiary, margin: "0 6px", fontSize: 10 }, children: "\u203A" })
262
- ] }, i)) }) })
263
- ] }),
264
- /* @__PURE__ */ jsx(Separator, {}),
265
- /* @__PURE__ */ jsxs(
266
- "div",
267
- {
268
- style: {
269
- display: "grid",
270
- gridTemplateColumns: "auto 1fr",
271
- gap: "4px 16px",
272
- fontSize: 11,
273
- fontFamily: tokens.mono,
274
- paddingTop: 12
275
- },
276
- children: [
277
- appVersion && /* @__PURE__ */ jsxs(Fragment, { children: [
278
- /* @__PURE__ */ jsx("span", { style: { color: tokens.textTertiary }, children: "version" }),
279
- /* @__PURE__ */ jsx("span", { style: { color: tokens.textSecondary }, children: appVersion })
280
- ] }),
281
- /* @__PURE__ */ jsx("span", { style: { color: tokens.textTertiary }, children: "timestamp" }),
282
- /* @__PURE__ */ jsx("span", { style: { color: tokens.textSecondary }, children: timestamp }),
283
- /* @__PURE__ */ jsx("span", { style: { color: tokens.textTertiary }, children: "viewport" }),
284
- /* @__PURE__ */ jsxs("span", { style: { color: tokens.textSecondary }, children: [
285
- window.innerWidth,
286
- "x",
287
- window.innerHeight
288
- ] }),
289
- eventId && /* @__PURE__ */ jsxs(Fragment, { children: [
290
- /* @__PURE__ */ jsx("span", { style: { color: tokens.textTertiary }, children: "sentry" }),
291
- /* @__PURE__ */ jsx("span", { style: { color: tokens.textSecondary }, children: eventId })
292
- ] })
293
- ]
294
- }
295
- )
296
- ] }),
297
- /* @__PURE__ */ jsx(
298
- "div",
299
- {
300
- style: {
301
- borderTop: `1px solid ${tokens.separator}`,
302
- padding: "12px 24px",
303
- display: "flex",
304
- justifyContent: "center"
305
- },
306
- children: /* @__PURE__ */ jsx(
307
- "button",
308
- {
309
- onClick: () => window.location.reload(),
310
- style: {
311
- background: "none",
312
- border: "none",
313
- color: tokens.textTertiary,
314
- fontSize: 12,
315
- fontFamily: tokens.sans,
316
- cursor: "pointer",
317
- padding: "2px 8px",
318
- textDecoration: "underline",
319
- textUnderlineOffset: 3
320
- },
321
- children: "Reload page"
322
- }
323
- )
324
- }
325
- )
326
- ]
327
- }
328
- );
329
- }
330
- function getErrorName(error) {
331
- if (error instanceof Error) {
332
- return error.constructor.name === "Error" ? "Error" : error.constructor.name;
333
- }
334
- return "Error";
335
- }
336
- function buildErrorReport(opts) {
337
- const { error, componentStack, eventId } = opts;
338
- const errorMessage = error instanceof Error ? error.message : String(error);
339
- const errorStack = error instanceof Error ? error.stack : void 0;
340
- const url = opts.url ?? window.location.href;
341
- const sections = [
342
- `## Error Report`,
343
- `**Timestamp:** ${(/* @__PURE__ */ new Date()).toISOString()}`,
344
- `**URL:** ${url}`,
345
- opts.appVersion && `**App Version:** ${opts.appVersion}`,
346
- eventId && `**Sentry Event ID:** ${eventId}`,
347
- `**User Agent:** ${navigator.userAgent}`,
348
- `**Viewport:** ${window.innerWidth}x${window.innerHeight}`,
349
- "",
350
- `### Error`,
351
- "```",
352
- `${getErrorName(error)}: ${errorMessage}`,
353
- "```",
354
- "",
355
- errorStack && `### Stack Trace`,
356
- errorStack && "```",
357
- errorStack,
358
- errorStack && "```",
359
- errorStack && "",
360
- componentStack && `### Component Stack`,
361
- componentStack && "```",
362
- componentStack?.trim(),
363
- componentStack && "```"
364
- ];
365
- return sections.filter(Boolean).join("\n");
366
- }
367
- function CrashErrorFallback({ error, componentStack, eventId, appVersion }) {
368
- const { background } = useAppearance();
369
- const errorMessage = error instanceof Error ? error.message : String(error);
370
- const errorStack = error instanceof Error ? error.stack : void 0;
371
- const errorName = getErrorName(error);
372
- const reportText = buildErrorReport({ error, componentStack, eventId, appVersion });
373
- const timestamp = (/* @__PURE__ */ new Date()).toISOString();
374
- return /* @__PURE__ */ jsxs(
375
- "div",
376
- {
377
- style: {
378
- position: "fixed",
379
- inset: 0,
380
- overflow: "auto",
381
- background: "var(--color-background)",
382
- display: "flex",
383
- alignItems: "center",
384
- justifyContent: "center",
385
- padding: 24
386
- },
387
- children: [
388
- background,
389
- /* @__PURE__ */ jsx("div", { style: { position: "relative", zIndex: 1, width: "100%", display: "flex", justifyContent: "center" }, children: /* @__PURE__ */ jsx(
390
- ErrorReportCard,
391
- {
392
- errorName,
393
- errorMessage,
394
- errorStack,
395
- componentStack,
396
- eventId,
397
- url: window.location.href,
398
- timestamp,
399
- reportText,
400
- appVersion
401
- }
402
- ) })
403
- ]
404
- }
405
- );
406
- }
407
- var AppErrorBoundary = class extends Component {
408
- state = { error: null, componentStack: "" };
409
- static getDerivedStateFromError(error) {
410
- return { error };
411
- }
412
- componentDidCatch(error, errorInfo) {
413
- this.setState({ componentStack: errorInfo.componentStack ?? "" });
414
- this.props.onError?.(error, errorInfo);
415
- }
416
- render() {
417
- if (this.state.error !== null) {
418
- const props = { error: this.state.error, componentStack: this.state.componentStack };
419
- return this.props.fallback ? this.props.fallback(props) : /* @__PURE__ */ jsx(CrashErrorFallback, { ...props, appVersion: this.props.appVersion });
420
- }
421
- return this.props.children;
422
- }
423
- };
424
-
425
- export { AppErrorBoundary, CrashErrorFallback, ErrorReportCard, buildErrorReport };
@@ -1,10 +0,0 @@
1
- import { PRESETS } from './chunk-WF7CONXF.js';
2
- import { createContext, useContext } from 'react';
3
-
4
- var PresetsContext = createContext(PRESETS);
5
- var PresetsProvider = PresetsContext.Provider;
6
- function usePresetsContext() {
7
- return useContext(PresetsContext);
8
- }
9
-
10
- export { PresetsProvider, usePresetsContext };