@tutti-os/analytics-debug 0.0.248
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.
- package/LICENSE +201 -0
- package/README.md +32 -0
- package/dist/chunk-P6SYGHVV.js +41 -0
- package/dist/chunk-P6SYGHVV.js.map +1 -0
- package/dist/index.d.ts +58 -0
- package/dist/index.js +106 -0
- package/dist/index.js.map +1 -0
- package/dist/react/index.d.ts +22 -0
- package/dist/react/index.js +240 -0
- package/dist/react/index.js.map +1 -0
- package/package.json +54 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,201 @@
|
|
|
1
|
+
Apache License
|
|
2
|
+
Version 2.0, January 2004
|
|
3
|
+
http://www.apache.org/licenses/
|
|
4
|
+
|
|
5
|
+
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
|
|
6
|
+
|
|
7
|
+
1. Definitions.
|
|
8
|
+
|
|
9
|
+
"License" shall mean the terms and conditions for use, reproduction,
|
|
10
|
+
and distribution as defined by Sections 1 through 9 of this document.
|
|
11
|
+
|
|
12
|
+
"Licensor" shall mean the copyright owner or entity authorized by
|
|
13
|
+
the copyright owner that is granting the License.
|
|
14
|
+
|
|
15
|
+
"Legal Entity" shall mean the union of the acting entity and all
|
|
16
|
+
other entities that control, are controlled by, or are under common
|
|
17
|
+
control with that entity. For the purposes of this definition,
|
|
18
|
+
"control" means (i) the power, direct or indirect, to cause the
|
|
19
|
+
direction or management of such entity, whether by contract or
|
|
20
|
+
otherwise, or (ii) ownership of fifty percent (50%) or more of the
|
|
21
|
+
outstanding shares, or (iii) beneficial ownership of such entity.
|
|
22
|
+
|
|
23
|
+
"You" (or "Your") shall mean an individual or Legal Entity
|
|
24
|
+
exercising permissions granted by this License.
|
|
25
|
+
|
|
26
|
+
"Source" form shall mean the preferred form for making modifications,
|
|
27
|
+
including but not limited to software source code, documentation
|
|
28
|
+
source, and configuration files.
|
|
29
|
+
|
|
30
|
+
"Object" form shall mean any form resulting from mechanical
|
|
31
|
+
transformation or translation of a Source form, including but
|
|
32
|
+
not limited to compiled object code, generated documentation,
|
|
33
|
+
and conversions to other media types.
|
|
34
|
+
|
|
35
|
+
"Work" shall mean the work of authorship, whether in Source or
|
|
36
|
+
Object form, made available under the License, as indicated by a
|
|
37
|
+
copyright notice that is included in or attached to the work
|
|
38
|
+
(an example is provided in the Appendix below).
|
|
39
|
+
|
|
40
|
+
"Derivative Works" shall mean any work, whether in Source or Object
|
|
41
|
+
form, that is based on (or derived from) the Work and for which the
|
|
42
|
+
editorial revisions, annotations, elaborations, or other modifications
|
|
43
|
+
represent, as a whole, an original work of authorship. For the purposes
|
|
44
|
+
of this License, Derivative Works shall not include works that remain
|
|
45
|
+
separable from, or merely link (or bind by name) to the interfaces of,
|
|
46
|
+
the Work and Derivative Works thereof.
|
|
47
|
+
|
|
48
|
+
"Contribution" shall mean any work of authorship, including
|
|
49
|
+
the original version of the Work and any modifications or additions
|
|
50
|
+
to that Work or Derivative Works thereof, that is intentionally
|
|
51
|
+
submitted to Licensor for inclusion in the Work by the copyright owner
|
|
52
|
+
or by an individual or Legal Entity authorized to submit on behalf of
|
|
53
|
+
the copyright owner. For the purposes of this definition, "submitted"
|
|
54
|
+
means any form of electronic, verbal, or written communication sent
|
|
55
|
+
to the Licensor or its representatives, including but not limited to
|
|
56
|
+
communication on electronic mailing lists, source code control systems,
|
|
57
|
+
and issue tracking systems that are managed by, or on behalf of, the
|
|
58
|
+
Licensor for the purpose of discussing and improving the Work, but
|
|
59
|
+
excluding communication that is conspicuously marked or otherwise
|
|
60
|
+
designated in writing by the copyright owner as "Not a Contribution."
|
|
61
|
+
|
|
62
|
+
"Contributor" shall mean Licensor and any individual or Legal Entity
|
|
63
|
+
on behalf of whom a Contribution has been received by Licensor and
|
|
64
|
+
subsequently incorporated within the Work.
|
|
65
|
+
|
|
66
|
+
2. Grant of Copyright License. Subject to the terms and conditions of
|
|
67
|
+
this License, each Contributor hereby grants to You a perpetual,
|
|
68
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
69
|
+
copyright license to reproduce, prepare Derivative Works of,
|
|
70
|
+
publicly display, publicly perform, sublicense, and distribute the
|
|
71
|
+
Work and such Derivative Works in Source or Object form.
|
|
72
|
+
|
|
73
|
+
3. Grant of Patent License. Subject to the terms and conditions of
|
|
74
|
+
this License, each Contributor hereby grants to You a perpetual,
|
|
75
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
76
|
+
(except as stated in this section) patent license to make, have made,
|
|
77
|
+
use, offer to sell, sell, import, and otherwise transfer the Work,
|
|
78
|
+
where such license applies only to those patent claims licensable
|
|
79
|
+
by such Contributor that are necessarily infringed by their
|
|
80
|
+
Contribution(s) alone or by combination of their Contribution(s)
|
|
81
|
+
with the Work to which such Contribution(s) was submitted. If You
|
|
82
|
+
institute patent litigation against any entity (including a
|
|
83
|
+
cross-claim or counterclaim in a lawsuit) alleging that the Work
|
|
84
|
+
or a Contribution incorporated within the Work constitutes direct
|
|
85
|
+
or contributory patent infringement, then any patent licenses
|
|
86
|
+
granted to You under this License for that Work shall terminate
|
|
87
|
+
as of the date such litigation is filed.
|
|
88
|
+
|
|
89
|
+
4. Redistribution. You may reproduce and distribute copies of the
|
|
90
|
+
Work or Derivative Works thereof in any medium, with or without
|
|
91
|
+
modifications, and in Source or Object form, provided that You
|
|
92
|
+
meet the following conditions:
|
|
93
|
+
|
|
94
|
+
(a) You must give any other recipients of the Work or
|
|
95
|
+
Derivative Works a copy of this License; and
|
|
96
|
+
|
|
97
|
+
(b) You must cause any modified files to carry prominent notices
|
|
98
|
+
stating that You changed the files; and
|
|
99
|
+
|
|
100
|
+
(c) You must retain, in the Source form of any Derivative Works
|
|
101
|
+
that You distribute, all copyright, patent, trademark, and
|
|
102
|
+
attribution notices from the Source form of the Work,
|
|
103
|
+
excluding those notices that do not pertain to any part of
|
|
104
|
+
the Derivative Works; and
|
|
105
|
+
|
|
106
|
+
(d) If the Work includes a "NOTICE" text file as part of its
|
|
107
|
+
distribution, then any Derivative Works that You distribute must
|
|
108
|
+
include a readable copy of the attribution notices contained
|
|
109
|
+
within such NOTICE file, excluding those notices that do not
|
|
110
|
+
pertain to any part of the Derivative Works, in at least one
|
|
111
|
+
of the following places: within a NOTICE text file distributed
|
|
112
|
+
as part of the Derivative Works; within the Source form or
|
|
113
|
+
documentation, if provided along with the Derivative Works; or,
|
|
114
|
+
within a display generated by the Derivative Works, if and
|
|
115
|
+
wherever such third-party notices normally appear. The contents
|
|
116
|
+
of the NOTICE file are for informational purposes only and
|
|
117
|
+
do not modify the License. You may add Your own attribution
|
|
118
|
+
notices within Derivative Works that You distribute, alongside
|
|
119
|
+
or as an addendum to the NOTICE text from the Work, provided
|
|
120
|
+
that such additional attribution notices cannot be construed
|
|
121
|
+
as modifying the License.
|
|
122
|
+
|
|
123
|
+
You may add Your own copyright statement to Your modifications and
|
|
124
|
+
may provide additional or different license terms and conditions
|
|
125
|
+
for use, reproduction, or distribution of Your modifications, or
|
|
126
|
+
for any such Derivative Works as a whole, provided Your use,
|
|
127
|
+
reproduction, and distribution of the Work otherwise complies with
|
|
128
|
+
the conditions stated in this License.
|
|
129
|
+
|
|
130
|
+
5. Submission of Contributions. Unless You explicitly state otherwise,
|
|
131
|
+
any Contribution intentionally submitted for inclusion in the Work
|
|
132
|
+
by You to the Licensor shall be under the terms and conditions of
|
|
133
|
+
this License, without any additional terms or conditions.
|
|
134
|
+
Notwithstanding the above, nothing herein shall supersede or modify
|
|
135
|
+
the terms of any separate license agreement you may have executed
|
|
136
|
+
with Licensor regarding such Contributions.
|
|
137
|
+
|
|
138
|
+
6. Trademarks. This License does not grant permission to use the trade
|
|
139
|
+
names, trademarks, service marks, or product names of the Licensor,
|
|
140
|
+
except as required for reasonable and customary use in describing the
|
|
141
|
+
origin of the Work and reproducing the content of the NOTICE file.
|
|
142
|
+
|
|
143
|
+
7. Disclaimer of Warranty. Unless required by applicable law or
|
|
144
|
+
agreed to in writing, Licensor provides the Work (and each
|
|
145
|
+
Contributor provides its Contributions) on an "AS IS" BASIS,
|
|
146
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
|
|
147
|
+
implied, including, without limitation, any warranties or conditions
|
|
148
|
+
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
|
|
149
|
+
PARTICULAR PURPOSE. You are solely responsible for determining the
|
|
150
|
+
appropriateness of using or redistributing the Work and assume any
|
|
151
|
+
risks associated with Your exercise of permissions under this License.
|
|
152
|
+
|
|
153
|
+
8. Limitation of Liability. In no event and under no legal theory,
|
|
154
|
+
whether in tort (including negligence), contract, or otherwise,
|
|
155
|
+
unless required by applicable law (such as deliberate and grossly
|
|
156
|
+
negligent acts) or agreed to in writing, shall any Contributor be
|
|
157
|
+
liable to You for damages, including any direct, indirect, special,
|
|
158
|
+
incidental, or consequential damages of any character arising as a
|
|
159
|
+
result of this License or out of the use or inability to use the
|
|
160
|
+
Work (including but not limited to damages for loss of goodwill,
|
|
161
|
+
work stoppage, computer failure or malfunction, or any and all
|
|
162
|
+
other commercial damages or losses), even if such Contributor
|
|
163
|
+
has been advised of the possibility of such damages.
|
|
164
|
+
|
|
165
|
+
9. Accepting Warranty or Additional Liability. While redistributing
|
|
166
|
+
the Work or Derivative Works thereof, You may choose to offer,
|
|
167
|
+
and charge a fee for, acceptance of support, warranty, indemnity,
|
|
168
|
+
or other liability obligations and/or rights consistent with this
|
|
169
|
+
License. However, in accepting such obligations, You may act only
|
|
170
|
+
on Your own behalf and on Your sole responsibility, not on behalf
|
|
171
|
+
of any other Contributor, and only if You agree to indemnify,
|
|
172
|
+
defend, and hold each Contributor harmless for any liability
|
|
173
|
+
incurred by, or claims asserted against, such Contributor by reason
|
|
174
|
+
of your accepting any such warranty or additional liability.
|
|
175
|
+
|
|
176
|
+
END OF TERMS AND CONDITIONS
|
|
177
|
+
|
|
178
|
+
APPENDIX: How to apply the Apache License to your work.
|
|
179
|
+
|
|
180
|
+
To apply the Apache License to your work, attach the following
|
|
181
|
+
boilerplate notice, with the fields enclosed by brackets "[]"
|
|
182
|
+
replaced with your own identifying information. (Don't include
|
|
183
|
+
the brackets!) The text should be enclosed in the appropriate
|
|
184
|
+
comment syntax for the file format. We also recommend that a
|
|
185
|
+
file or class name and description of purpose be included on the
|
|
186
|
+
same "printed page" as the copyright notice for easier
|
|
187
|
+
identification within third-party archives.
|
|
188
|
+
|
|
189
|
+
Copyright 2025-2026 The Tutti Authors
|
|
190
|
+
|
|
191
|
+
Licensed under the Apache License, Version 2.0 (the "License");
|
|
192
|
+
you may not use this file except in compliance with the License.
|
|
193
|
+
You may obtain a copy of the License at
|
|
194
|
+
|
|
195
|
+
http://www.apache.org/licenses/LICENSE-2.0
|
|
196
|
+
|
|
197
|
+
Unless required by applicable law or agreed to in writing, software
|
|
198
|
+
distributed under the License is distributed on an "AS IS" BASIS,
|
|
199
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
200
|
+
See the License for the specific language governing permissions and
|
|
201
|
+
limitations under the License.
|
package/README.md
ADDED
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
# `@tutti-os/analytics-debug`
|
|
2
|
+
|
|
3
|
+
Host-agnostic storage and React UI for inspecting analytics events.
|
|
4
|
+
|
|
5
|
+
The package does not connect to a daemon, choose a feature flag, or own product
|
|
6
|
+
translations. Each host adapts its own event stream into
|
|
7
|
+
`AnalyticsDebugEventStore` and supplies localized labels to the React panel.
|
|
8
|
+
This keeps Tutti and TSH transport policy independent while sharing bounded
|
|
9
|
+
storage, redaction, rendering, and floating-panel behavior.
|
|
10
|
+
|
|
11
|
+
```ts
|
|
12
|
+
import { AnalyticsDebugEventStore } from "@tutti-os/analytics-debug";
|
|
13
|
+
import { AnalyticsDebugFloatingEntry } from "@tutti-os/analytics-debug/react";
|
|
14
|
+
|
|
15
|
+
const store = new AnalyticsDebugEventStore({
|
|
16
|
+
redact: (event) => event
|
|
17
|
+
});
|
|
18
|
+
|
|
19
|
+
eventSource.subscribe((events) => store.recordEvents(events));
|
|
20
|
+
```
|
|
21
|
+
|
|
22
|
+
Hosts must load `@tutti-os/ui-system/styles.css` and include the published debug
|
|
23
|
+
bundle in Tailwind v4 source discovery. Adjust the relative path for the host
|
|
24
|
+
stylesheet, for example:
|
|
25
|
+
|
|
26
|
+
```css
|
|
27
|
+
@source "../node_modules/@tutti-os/analytics-debug/dist";
|
|
28
|
+
```
|
|
29
|
+
|
|
30
|
+
Events are kept in memory only. The default limit is 200 events. Hosts that may
|
|
31
|
+
receive sensitive parameters should supply a `redact` function before exposing
|
|
32
|
+
the panel.
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
// src/react/floatingPosition.ts
|
|
2
|
+
var FLOATING_VIEWPORT_MARGIN = 8;
|
|
3
|
+
var FLOATING_DRAG_THRESHOLD = 5;
|
|
4
|
+
function resolveAnalyticsDebugFloatingPosition({
|
|
5
|
+
floatingSize,
|
|
6
|
+
pointerCurrent,
|
|
7
|
+
pointerStart,
|
|
8
|
+
startPosition,
|
|
9
|
+
viewport
|
|
10
|
+
}) {
|
|
11
|
+
return {
|
|
12
|
+
left: clamp(
|
|
13
|
+
startPosition.left + pointerCurrent.x - pointerStart.x,
|
|
14
|
+
FLOATING_VIEWPORT_MARGIN,
|
|
15
|
+
viewport.width - floatingSize.width - FLOATING_VIEWPORT_MARGIN
|
|
16
|
+
),
|
|
17
|
+
top: clamp(
|
|
18
|
+
startPosition.top + pointerCurrent.y - pointerStart.y,
|
|
19
|
+
FLOATING_VIEWPORT_MARGIN,
|
|
20
|
+
viewport.height - floatingSize.height - FLOATING_VIEWPORT_MARGIN
|
|
21
|
+
)
|
|
22
|
+
};
|
|
23
|
+
}
|
|
24
|
+
function hasAnalyticsDebugFloatingDragMoved({
|
|
25
|
+
pointerCurrent,
|
|
26
|
+
pointerStart
|
|
27
|
+
}) {
|
|
28
|
+
return Math.hypot(
|
|
29
|
+
pointerCurrent.x - pointerStart.x,
|
|
30
|
+
pointerCurrent.y - pointerStart.y
|
|
31
|
+
) > FLOATING_DRAG_THRESHOLD;
|
|
32
|
+
}
|
|
33
|
+
function clamp(value, min, max) {
|
|
34
|
+
return Math.min(Math.max(value, min), max);
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
export {
|
|
38
|
+
resolveAnalyticsDebugFloatingPosition,
|
|
39
|
+
hasAnalyticsDebugFloatingDragMoved
|
|
40
|
+
};
|
|
41
|
+
//# sourceMappingURL=chunk-P6SYGHVV.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/react/floatingPosition.ts"],"sourcesContent":["const FLOATING_VIEWPORT_MARGIN = 8;\nconst FLOATING_DRAG_THRESHOLD = 5;\n\nexport interface AnalyticsDebugPoint {\n x: number;\n y: number;\n}\n\nexport interface AnalyticsDebugPosition {\n left: number;\n top: number;\n}\n\nexport interface AnalyticsDebugSize {\n height: number;\n width: number;\n}\n\nexport interface ResolveAnalyticsDebugFloatingPositionInput {\n floatingSize: AnalyticsDebugSize;\n pointerCurrent: AnalyticsDebugPoint;\n pointerStart: AnalyticsDebugPoint;\n startPosition: AnalyticsDebugPosition;\n viewport: AnalyticsDebugSize;\n}\n\nexport function resolveAnalyticsDebugFloatingPosition({\n floatingSize,\n pointerCurrent,\n pointerStart,\n startPosition,\n viewport\n}: ResolveAnalyticsDebugFloatingPositionInput): AnalyticsDebugPosition {\n return {\n left: clamp(\n startPosition.left + pointerCurrent.x - pointerStart.x,\n FLOATING_VIEWPORT_MARGIN,\n viewport.width - floatingSize.width - FLOATING_VIEWPORT_MARGIN\n ),\n top: clamp(\n startPosition.top + pointerCurrent.y - pointerStart.y,\n FLOATING_VIEWPORT_MARGIN,\n viewport.height - floatingSize.height - FLOATING_VIEWPORT_MARGIN\n )\n };\n}\n\nexport function hasAnalyticsDebugFloatingDragMoved({\n pointerCurrent,\n pointerStart\n}: Pick<\n ResolveAnalyticsDebugFloatingPositionInput,\n \"pointerCurrent\" | \"pointerStart\"\n>): boolean {\n return (\n Math.hypot(\n pointerCurrent.x - pointerStart.x,\n pointerCurrent.y - pointerStart.y\n ) > FLOATING_DRAG_THRESHOLD\n );\n}\n\nfunction clamp(value: number, min: number, max: number): number {\n return Math.min(Math.max(value, min), max);\n}\n"],"mappings":";AAAA,IAAM,2BAA2B;AACjC,IAAM,0BAA0B;AAyBzB,SAAS,sCAAsC;AAAA,EACpD;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACF,GAAuE;AACrE,SAAO;AAAA,IACL,MAAM;AAAA,MACJ,cAAc,OAAO,eAAe,IAAI,aAAa;AAAA,MACrD;AAAA,MACA,SAAS,QAAQ,aAAa,QAAQ;AAAA,IACxC;AAAA,IACA,KAAK;AAAA,MACH,cAAc,MAAM,eAAe,IAAI,aAAa;AAAA,MACpD;AAAA,MACA,SAAS,SAAS,aAAa,SAAS;AAAA,IAC1C;AAAA,EACF;AACF;AAEO,SAAS,mCAAmC;AAAA,EACjD;AAAA,EACA;AACF,GAGY;AACV,SACE,KAAK;AAAA,IACH,eAAe,IAAI,aAAa;AAAA,IAChC,eAAe,IAAI,aAAa;AAAA,EAClC,IAAI;AAER;AAEA,SAAS,MAAM,OAAe,KAAa,KAAqB;AAC9D,SAAO,KAAK,IAAI,KAAK,IAAI,OAAO,GAAG,GAAG,GAAG;AAC3C;","names":[]}
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
import { AnalyticsTransportEvent } from '@tutti-os/analytics';
|
|
2
|
+
|
|
3
|
+
type AnalyticsDebugEvent = AnalyticsTransportEvent;
|
|
4
|
+
type AnalyticsDebugEventSnapshot = readonly AnalyticsDebugEvent[];
|
|
5
|
+
interface AnalyticsDebugEventStoreContract {
|
|
6
|
+
clear(): void;
|
|
7
|
+
getSnapshot(): AnalyticsDebugEventSnapshot;
|
|
8
|
+
recordEvents(events: readonly AnalyticsDebugEvent[]): void;
|
|
9
|
+
subscribe(listener: () => void): () => void;
|
|
10
|
+
}
|
|
11
|
+
type AnalyticsDebugEventRedactor = (event: AnalyticsDebugEvent) => AnalyticsDebugEvent | null;
|
|
12
|
+
interface AnalyticsDebugEventStoreOptions {
|
|
13
|
+
maxEvents?: number;
|
|
14
|
+
redact?: AnalyticsDebugEventRedactor;
|
|
15
|
+
}
|
|
16
|
+
/**
|
|
17
|
+
* Bounded, in-memory analytics event store.
|
|
18
|
+
*
|
|
19
|
+
* Transport connection and availability policy intentionally stay in the
|
|
20
|
+
* product host. Redaction runs before an event enters the store.
|
|
21
|
+
*/
|
|
22
|
+
declare class AnalyticsDebugEventStore implements AnalyticsDebugEventStoreContract {
|
|
23
|
+
private events;
|
|
24
|
+
private readonly listeners;
|
|
25
|
+
private readonly maxEvents;
|
|
26
|
+
private readonly redact;
|
|
27
|
+
constructor(options?: AnalyticsDebugEventStoreOptions);
|
|
28
|
+
clear(): void;
|
|
29
|
+
dispose(): void;
|
|
30
|
+
getSnapshot(): AnalyticsDebugEventSnapshot;
|
|
31
|
+
recordEvents(events: readonly AnalyticsDebugEvent[]): void;
|
|
32
|
+
subscribe(listener: () => void): () => void;
|
|
33
|
+
private emit;
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
interface AnalyticsDebugPoint {
|
|
37
|
+
x: number;
|
|
38
|
+
y: number;
|
|
39
|
+
}
|
|
40
|
+
interface AnalyticsDebugPosition {
|
|
41
|
+
left: number;
|
|
42
|
+
top: number;
|
|
43
|
+
}
|
|
44
|
+
interface AnalyticsDebugSize {
|
|
45
|
+
height: number;
|
|
46
|
+
width: number;
|
|
47
|
+
}
|
|
48
|
+
interface ResolveAnalyticsDebugFloatingPositionInput {
|
|
49
|
+
floatingSize: AnalyticsDebugSize;
|
|
50
|
+
pointerCurrent: AnalyticsDebugPoint;
|
|
51
|
+
pointerStart: AnalyticsDebugPoint;
|
|
52
|
+
startPosition: AnalyticsDebugPosition;
|
|
53
|
+
viewport: AnalyticsDebugSize;
|
|
54
|
+
}
|
|
55
|
+
declare function resolveAnalyticsDebugFloatingPosition({ floatingSize, pointerCurrent, pointerStart, startPosition, viewport }: ResolveAnalyticsDebugFloatingPositionInput): AnalyticsDebugPosition;
|
|
56
|
+
declare function hasAnalyticsDebugFloatingDragMoved({ pointerCurrent, pointerStart }: Pick<ResolveAnalyticsDebugFloatingPositionInput, "pointerCurrent" | "pointerStart">): boolean;
|
|
57
|
+
|
|
58
|
+
export { type AnalyticsDebugEvent, type AnalyticsDebugEventRedactor, type AnalyticsDebugEventSnapshot, AnalyticsDebugEventStore, type AnalyticsDebugEventStoreContract, type AnalyticsDebugEventStoreOptions, type AnalyticsDebugPoint, type AnalyticsDebugPosition, type AnalyticsDebugSize, type ResolveAnalyticsDebugFloatingPositionInput, hasAnalyticsDebugFloatingDragMoved, resolveAnalyticsDebugFloatingPosition };
|
package/dist/index.js
ADDED
|
@@ -0,0 +1,106 @@
|
|
|
1
|
+
import {
|
|
2
|
+
hasAnalyticsDebugFloatingDragMoved,
|
|
3
|
+
resolveAnalyticsDebugFloatingPosition
|
|
4
|
+
} from "./chunk-P6SYGHVV.js";
|
|
5
|
+
|
|
6
|
+
// src/eventStore.ts
|
|
7
|
+
var DEFAULT_MAX_EVENTS = 200;
|
|
8
|
+
var AnalyticsDebugEventStore = class {
|
|
9
|
+
events = Object.freeze([]);
|
|
10
|
+
listeners = /* @__PURE__ */ new Set();
|
|
11
|
+
maxEvents;
|
|
12
|
+
redact;
|
|
13
|
+
constructor(options = {}) {
|
|
14
|
+
this.maxEvents = normalizeMaxEvents(options.maxEvents);
|
|
15
|
+
this.redact = options.redact ?? cloneAnalyticsDebugEvent;
|
|
16
|
+
}
|
|
17
|
+
clear() {
|
|
18
|
+
if (this.events.length === 0) {
|
|
19
|
+
return;
|
|
20
|
+
}
|
|
21
|
+
this.events = Object.freeze([]);
|
|
22
|
+
this.emit();
|
|
23
|
+
}
|
|
24
|
+
dispose() {
|
|
25
|
+
this.listeners.clear();
|
|
26
|
+
}
|
|
27
|
+
getSnapshot() {
|
|
28
|
+
return this.events;
|
|
29
|
+
}
|
|
30
|
+
recordEvents(events) {
|
|
31
|
+
if (events.length === 0) {
|
|
32
|
+
return;
|
|
33
|
+
}
|
|
34
|
+
const accepted = [];
|
|
35
|
+
for (const event of events) {
|
|
36
|
+
try {
|
|
37
|
+
const redacted = this.redact(cloneAnalyticsDebugEvent(event));
|
|
38
|
+
if (redacted) {
|
|
39
|
+
accepted.push(
|
|
40
|
+
freezeAnalyticsDebugEvent(cloneAnalyticsDebugEvent(redacted))
|
|
41
|
+
);
|
|
42
|
+
}
|
|
43
|
+
} catch {
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
if (accepted.length === 0) {
|
|
47
|
+
return;
|
|
48
|
+
}
|
|
49
|
+
this.events = Object.freeze(
|
|
50
|
+
[...this.events, ...accepted].slice(-this.maxEvents)
|
|
51
|
+
);
|
|
52
|
+
this.emit();
|
|
53
|
+
}
|
|
54
|
+
subscribe(listener) {
|
|
55
|
+
this.listeners.add(listener);
|
|
56
|
+
return () => {
|
|
57
|
+
this.listeners.delete(listener);
|
|
58
|
+
};
|
|
59
|
+
}
|
|
60
|
+
emit() {
|
|
61
|
+
for (const listener of this.listeners) {
|
|
62
|
+
try {
|
|
63
|
+
listener();
|
|
64
|
+
} catch {
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
};
|
|
69
|
+
function normalizeMaxEvents(value) {
|
|
70
|
+
if (value === void 0) {
|
|
71
|
+
return DEFAULT_MAX_EVENTS;
|
|
72
|
+
}
|
|
73
|
+
if (!Number.isSafeInteger(value) || value <= 0) {
|
|
74
|
+
throw new RangeError(
|
|
75
|
+
"analytics debug maxEvents must be a positive integer"
|
|
76
|
+
);
|
|
77
|
+
}
|
|
78
|
+
return value;
|
|
79
|
+
}
|
|
80
|
+
function cloneAnalyticsDebugEvent(event) {
|
|
81
|
+
return {
|
|
82
|
+
clientTS: event.clientTS,
|
|
83
|
+
name: event.name,
|
|
84
|
+
...event.params !== void 0 ? { params: structuredClone(event.params) } : {}
|
|
85
|
+
};
|
|
86
|
+
}
|
|
87
|
+
function freezeAnalyticsDebugEvent(event) {
|
|
88
|
+
deepFreeze(event);
|
|
89
|
+
return event;
|
|
90
|
+
}
|
|
91
|
+
function deepFreeze(value, seen = /* @__PURE__ */ new WeakSet()) {
|
|
92
|
+
if (typeof value !== "object" && typeof value !== "function" || value === null || seen.has(value)) {
|
|
93
|
+
return;
|
|
94
|
+
}
|
|
95
|
+
seen.add(value);
|
|
96
|
+
for (const propertyValue of Object.values(value)) {
|
|
97
|
+
deepFreeze(propertyValue, seen);
|
|
98
|
+
}
|
|
99
|
+
Object.freeze(value);
|
|
100
|
+
}
|
|
101
|
+
export {
|
|
102
|
+
AnalyticsDebugEventStore,
|
|
103
|
+
hasAnalyticsDebugFloatingDragMoved,
|
|
104
|
+
resolveAnalyticsDebugFloatingPosition
|
|
105
|
+
};
|
|
106
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/eventStore.ts"],"sourcesContent":["import type { AnalyticsTransportEvent } from \"@tutti-os/analytics\";\n\nexport type AnalyticsDebugEvent = AnalyticsTransportEvent;\nexport type AnalyticsDebugEventSnapshot = readonly AnalyticsDebugEvent[];\n\nexport interface AnalyticsDebugEventStoreContract {\n clear(): void;\n getSnapshot(): AnalyticsDebugEventSnapshot;\n recordEvents(events: readonly AnalyticsDebugEvent[]): void;\n subscribe(listener: () => void): () => void;\n}\n\nexport type AnalyticsDebugEventRedactor = (\n event: AnalyticsDebugEvent\n) => AnalyticsDebugEvent | null;\n\nexport interface AnalyticsDebugEventStoreOptions {\n maxEvents?: number;\n redact?: AnalyticsDebugEventRedactor;\n}\n\nconst DEFAULT_MAX_EVENTS = 200;\n\n/**\n * Bounded, in-memory analytics event store.\n *\n * Transport connection and availability policy intentionally stay in the\n * product host. Redaction runs before an event enters the store.\n */\nexport class AnalyticsDebugEventStore implements AnalyticsDebugEventStoreContract {\n private events: AnalyticsDebugEventSnapshot = Object.freeze([]);\n private readonly listeners = new Set<() => void>();\n private readonly maxEvents: number;\n private readonly redact: AnalyticsDebugEventRedactor;\n\n constructor(options: AnalyticsDebugEventStoreOptions = {}) {\n this.maxEvents = normalizeMaxEvents(options.maxEvents);\n this.redact = options.redact ?? cloneAnalyticsDebugEvent;\n }\n\n clear(): void {\n if (this.events.length === 0) {\n return;\n }\n\n this.events = Object.freeze([]);\n this.emit();\n }\n\n dispose(): void {\n this.listeners.clear();\n }\n\n getSnapshot(): AnalyticsDebugEventSnapshot {\n return this.events;\n }\n\n recordEvents(events: readonly AnalyticsDebugEvent[]): void {\n if (events.length === 0) {\n return;\n }\n\n const accepted: AnalyticsDebugEvent[] = [];\n for (const event of events) {\n try {\n const redacted = this.redact(cloneAnalyticsDebugEvent(event));\n if (redacted) {\n accepted.push(\n freezeAnalyticsDebugEvent(cloneAnalyticsDebugEvent(redacted))\n );\n }\n } catch {\n // A host redactor must not interrupt event reporting or panel updates.\n }\n }\n if (accepted.length === 0) {\n return;\n }\n\n this.events = Object.freeze(\n [...this.events, ...accepted].slice(-this.maxEvents)\n );\n this.emit();\n }\n\n subscribe(listener: () => void): () => void {\n this.listeners.add(listener);\n\n return () => {\n this.listeners.delete(listener);\n };\n }\n\n private emit(): void {\n for (const listener of this.listeners) {\n try {\n listener();\n } catch {\n // One debug consumer must not break reporting or other consumers.\n }\n }\n }\n}\n\nfunction normalizeMaxEvents(value: number | undefined): number {\n if (value === undefined) {\n return DEFAULT_MAX_EVENTS;\n }\n if (!Number.isSafeInteger(value) || value <= 0) {\n throw new RangeError(\n \"analytics debug maxEvents must be a positive integer\"\n );\n }\n return value;\n}\n\nfunction cloneAnalyticsDebugEvent(\n event: AnalyticsDebugEvent\n): AnalyticsDebugEvent {\n return {\n clientTS: event.clientTS,\n name: event.name,\n ...(event.params !== undefined\n ? { params: structuredClone(event.params) }\n : {})\n };\n}\n\nfunction freezeAnalyticsDebugEvent(\n event: AnalyticsDebugEvent\n): AnalyticsDebugEvent {\n deepFreeze(event);\n return event;\n}\n\nfunction deepFreeze(value: unknown, seen = new WeakSet<object>()): void {\n if (\n (typeof value !== \"object\" && typeof value !== \"function\") ||\n value === null ||\n seen.has(value)\n ) {\n return;\n }\n\n seen.add(value);\n for (const propertyValue of Object.values(value)) {\n deepFreeze(propertyValue, seen);\n }\n Object.freeze(value);\n}\n"],"mappings":";;;;;;AAqBA,IAAM,qBAAqB;AAQpB,IAAM,2BAAN,MAA2E;AAAA,EACxE,SAAsC,OAAO,OAAO,CAAC,CAAC;AAAA,EAC7C,YAAY,oBAAI,IAAgB;AAAA,EAChC;AAAA,EACA;AAAA,EAEjB,YAAY,UAA2C,CAAC,GAAG;AACzD,SAAK,YAAY,mBAAmB,QAAQ,SAAS;AACrD,SAAK,SAAS,QAAQ,UAAU;AAAA,EAClC;AAAA,EAEA,QAAc;AACZ,QAAI,KAAK,OAAO,WAAW,GAAG;AAC5B;AAAA,IACF;AAEA,SAAK,SAAS,OAAO,OAAO,CAAC,CAAC;AAC9B,SAAK,KAAK;AAAA,EACZ;AAAA,EAEA,UAAgB;AACd,SAAK,UAAU,MAAM;AAAA,EACvB;AAAA,EAEA,cAA2C;AACzC,WAAO,KAAK;AAAA,EACd;AAAA,EAEA,aAAa,QAA8C;AACzD,QAAI,OAAO,WAAW,GAAG;AACvB;AAAA,IACF;AAEA,UAAM,WAAkC,CAAC;AACzC,eAAW,SAAS,QAAQ;AAC1B,UAAI;AACF,cAAM,WAAW,KAAK,OAAO,yBAAyB,KAAK,CAAC;AAC5D,YAAI,UAAU;AACZ,mBAAS;AAAA,YACP,0BAA0B,yBAAyB,QAAQ,CAAC;AAAA,UAC9D;AAAA,QACF;AAAA,MACF,QAAQ;AAAA,MAER;AAAA,IACF;AACA,QAAI,SAAS,WAAW,GAAG;AACzB;AAAA,IACF;AAEA,SAAK,SAAS,OAAO;AAAA,MACnB,CAAC,GAAG,KAAK,QAAQ,GAAG,QAAQ,EAAE,MAAM,CAAC,KAAK,SAAS;AAAA,IACrD;AACA,SAAK,KAAK;AAAA,EACZ;AAAA,EAEA,UAAU,UAAkC;AAC1C,SAAK,UAAU,IAAI,QAAQ;AAE3B,WAAO,MAAM;AACX,WAAK,UAAU,OAAO,QAAQ;AAAA,IAChC;AAAA,EACF;AAAA,EAEQ,OAAa;AACnB,eAAW,YAAY,KAAK,WAAW;AACrC,UAAI;AACF,iBAAS;AAAA,MACX,QAAQ;AAAA,MAER;AAAA,IACF;AAAA,EACF;AACF;AAEA,SAAS,mBAAmB,OAAmC;AAC7D,MAAI,UAAU,QAAW;AACvB,WAAO;AAAA,EACT;AACA,MAAI,CAAC,OAAO,cAAc,KAAK,KAAK,SAAS,GAAG;AAC9C,UAAM,IAAI;AAAA,MACR;AAAA,IACF;AAAA,EACF;AACA,SAAO;AACT;AAEA,SAAS,yBACP,OACqB;AACrB,SAAO;AAAA,IACL,UAAU,MAAM;AAAA,IAChB,MAAM,MAAM;AAAA,IACZ,GAAI,MAAM,WAAW,SACjB,EAAE,QAAQ,gBAAgB,MAAM,MAAM,EAAE,IACxC,CAAC;AAAA,EACP;AACF;AAEA,SAAS,0BACP,OACqB;AACrB,aAAW,KAAK;AAChB,SAAO;AACT;AAEA,SAAS,WAAW,OAAgB,OAAO,oBAAI,QAAgB,GAAS;AACtE,MACG,OAAO,UAAU,YAAY,OAAO,UAAU,cAC/C,UAAU,QACV,KAAK,IAAI,KAAK,GACd;AACA;AAAA,EACF;AAEA,OAAK,IAAI,KAAK;AACd,aAAW,iBAAiB,OAAO,OAAO,KAAK,GAAG;AAChD,eAAW,eAAe,IAAI;AAAA,EAChC;AACA,SAAO,OAAO,KAAK;AACrB;","names":[]}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
|
+
import { AnalyticsDebugEventStoreContract } from '../index.js';
|
|
3
|
+
export { AnalyticsDebugPoint, AnalyticsDebugPosition, AnalyticsDebugSize, ResolveAnalyticsDebugFloatingPositionInput, hasAnalyticsDebugFloatingDragMoved, resolveAnalyticsDebugFloatingPosition } from '../index.js';
|
|
4
|
+
import '@tutti-os/analytics';
|
|
5
|
+
|
|
6
|
+
interface AnalyticsDebugLabels {
|
|
7
|
+
clear: string;
|
|
8
|
+
clientTimestamp(value: number): string;
|
|
9
|
+
close: string;
|
|
10
|
+
count(value: number): string;
|
|
11
|
+
empty: string;
|
|
12
|
+
open: string;
|
|
13
|
+
title: string;
|
|
14
|
+
}
|
|
15
|
+
interface AnalyticsDebugFloatingEntryProps {
|
|
16
|
+
labels: AnalyticsDebugLabels;
|
|
17
|
+
store: AnalyticsDebugEventStoreContract;
|
|
18
|
+
formatEventTime?: (timestamp: number) => string;
|
|
19
|
+
}
|
|
20
|
+
declare function AnalyticsDebugFloatingEntry({ formatEventTime, labels, store }: AnalyticsDebugFloatingEntryProps): react_jsx_runtime.JSX.Element;
|
|
21
|
+
|
|
22
|
+
export { AnalyticsDebugFloatingEntry, type AnalyticsDebugFloatingEntryProps, type AnalyticsDebugLabels };
|
|
@@ -0,0 +1,240 @@
|
|
|
1
|
+
import {
|
|
2
|
+
hasAnalyticsDebugFloatingDragMoved,
|
|
3
|
+
resolveAnalyticsDebugFloatingPosition
|
|
4
|
+
} from "../chunk-P6SYGHVV.js";
|
|
5
|
+
|
|
6
|
+
// src/react/AnalyticsDebugFloatingEntry.tsx
|
|
7
|
+
import {
|
|
8
|
+
useCallback,
|
|
9
|
+
useMemo,
|
|
10
|
+
useRef,
|
|
11
|
+
useState,
|
|
12
|
+
useSyncExternalStore
|
|
13
|
+
} from "react";
|
|
14
|
+
import {
|
|
15
|
+
Badge,
|
|
16
|
+
Button,
|
|
17
|
+
CloseIcon,
|
|
18
|
+
DeleteIcon,
|
|
19
|
+
HealthIcon,
|
|
20
|
+
Popover,
|
|
21
|
+
PopoverContent,
|
|
22
|
+
PopoverTrigger,
|
|
23
|
+
ScrollArea
|
|
24
|
+
} from "@tutti-os/ui-system";
|
|
25
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
26
|
+
function AnalyticsDebugFloatingEntry({
|
|
27
|
+
formatEventTime = defaultFormatEventTime,
|
|
28
|
+
labels,
|
|
29
|
+
store
|
|
30
|
+
}) {
|
|
31
|
+
const [position, setPosition] = useState(null);
|
|
32
|
+
const [panelOpen, setPanelOpen] = useState(false);
|
|
33
|
+
const dragSessionRef = useRef(null);
|
|
34
|
+
const suppressNextClickRef = useRef(false);
|
|
35
|
+
const subscribe = useCallback(
|
|
36
|
+
(listener) => store.subscribe(listener),
|
|
37
|
+
[store]
|
|
38
|
+
);
|
|
39
|
+
const getSnapshot = useCallback(() => store.getSnapshot(), [store]);
|
|
40
|
+
const events = useSyncExternalStore(subscribe, getSnapshot, getSnapshot);
|
|
41
|
+
const orderedEvents = useMemo(() => [...events].reverse(), [events]);
|
|
42
|
+
const handlePointerDown = useCallback(
|
|
43
|
+
(event) => {
|
|
44
|
+
if (event.button !== 0) {
|
|
45
|
+
return;
|
|
46
|
+
}
|
|
47
|
+
const rect = event.currentTarget.getBoundingClientRect();
|
|
48
|
+
dragSessionRef.current = {
|
|
49
|
+
dragging: false,
|
|
50
|
+
floatingSize: {
|
|
51
|
+
height: rect.height,
|
|
52
|
+
width: rect.width
|
|
53
|
+
},
|
|
54
|
+
pointerStart: {
|
|
55
|
+
x: event.clientX,
|
|
56
|
+
y: event.clientY
|
|
57
|
+
},
|
|
58
|
+
startPosition: {
|
|
59
|
+
left: rect.left,
|
|
60
|
+
top: rect.top
|
|
61
|
+
}
|
|
62
|
+
};
|
|
63
|
+
event.currentTarget.setPointerCapture(event.pointerId);
|
|
64
|
+
},
|
|
65
|
+
[]
|
|
66
|
+
);
|
|
67
|
+
const handlePointerMove = useCallback(
|
|
68
|
+
(event) => {
|
|
69
|
+
const dragSession = dragSessionRef.current;
|
|
70
|
+
if (!dragSession) {
|
|
71
|
+
return;
|
|
72
|
+
}
|
|
73
|
+
const pointerCurrent = {
|
|
74
|
+
x: event.clientX,
|
|
75
|
+
y: event.clientY
|
|
76
|
+
};
|
|
77
|
+
const dragging = dragSession.dragging || hasAnalyticsDebugFloatingDragMoved({
|
|
78
|
+
pointerCurrent,
|
|
79
|
+
pointerStart: dragSession.pointerStart
|
|
80
|
+
});
|
|
81
|
+
if (!dragging) {
|
|
82
|
+
return;
|
|
83
|
+
}
|
|
84
|
+
dragSession.dragging = true;
|
|
85
|
+
suppressNextClickRef.current = true;
|
|
86
|
+
setPosition(
|
|
87
|
+
resolveAnalyticsDebugFloatingPosition({
|
|
88
|
+
floatingSize: dragSession.floatingSize,
|
|
89
|
+
pointerCurrent,
|
|
90
|
+
pointerStart: dragSession.pointerStart,
|
|
91
|
+
startPosition: dragSession.startPosition,
|
|
92
|
+
viewport: {
|
|
93
|
+
height: window.innerHeight,
|
|
94
|
+
width: window.innerWidth
|
|
95
|
+
}
|
|
96
|
+
})
|
|
97
|
+
);
|
|
98
|
+
},
|
|
99
|
+
[]
|
|
100
|
+
);
|
|
101
|
+
const handlePointerEnd = useCallback(
|
|
102
|
+
(event) => {
|
|
103
|
+
if (event.currentTarget.hasPointerCapture(event.pointerId)) {
|
|
104
|
+
event.currentTarget.releasePointerCapture(event.pointerId);
|
|
105
|
+
}
|
|
106
|
+
dragSessionRef.current = null;
|
|
107
|
+
},
|
|
108
|
+
[]
|
|
109
|
+
);
|
|
110
|
+
const handleClickCapture = useCallback(
|
|
111
|
+
(event) => {
|
|
112
|
+
if (!suppressNextClickRef.current) {
|
|
113
|
+
return;
|
|
114
|
+
}
|
|
115
|
+
suppressNextClickRef.current = false;
|
|
116
|
+
event.preventDefault();
|
|
117
|
+
event.stopPropagation();
|
|
118
|
+
},
|
|
119
|
+
[]
|
|
120
|
+
);
|
|
121
|
+
return /* @__PURE__ */ jsx(
|
|
122
|
+
"div",
|
|
123
|
+
{
|
|
124
|
+
className: "fixed right-4 bottom-4 z-[var(--z-dialog-popover)]",
|
|
125
|
+
"data-analytics-debug-floating-root": "true",
|
|
126
|
+
style: position ? {
|
|
127
|
+
bottom: "auto",
|
|
128
|
+
left: position.left,
|
|
129
|
+
right: "auto",
|
|
130
|
+
top: position.top
|
|
131
|
+
} : void 0,
|
|
132
|
+
children: /* @__PURE__ */ jsxs(Popover, { open: panelOpen, onOpenChange: setPanelOpen, children: [
|
|
133
|
+
/* @__PURE__ */ jsx(PopoverTrigger, { asChild: true, children: /* @__PURE__ */ jsxs(
|
|
134
|
+
Button,
|
|
135
|
+
{
|
|
136
|
+
"aria-label": labels.open,
|
|
137
|
+
className: "relative size-11 touch-none rounded-full border border-[var(--border-1)] bg-[var(--background-fronted)] text-[var(--text-primary)] shadow-soft hover:bg-[var(--background-hover)]",
|
|
138
|
+
onClickCapture: handleClickCapture,
|
|
139
|
+
onPointerCancel: handlePointerEnd,
|
|
140
|
+
onPointerDown: handlePointerDown,
|
|
141
|
+
onPointerMove: handlePointerMove,
|
|
142
|
+
onPointerUp: handlePointerEnd,
|
|
143
|
+
size: "icon-lg",
|
|
144
|
+
variant: "outline",
|
|
145
|
+
children: [
|
|
146
|
+
/* @__PURE__ */ jsx(HealthIcon, { size: 18 }),
|
|
147
|
+
events.length > 0 ? /* @__PURE__ */ jsx("span", { className: "absolute -top-1 -right-1 flex min-w-5 items-center justify-center rounded-full bg-[var(--accent-bg)] px-1 text-[10px] leading-5 text-[var(--accent)]", children: events.length }) : null
|
|
148
|
+
]
|
|
149
|
+
}
|
|
150
|
+
) }),
|
|
151
|
+
/* @__PURE__ */ jsxs(
|
|
152
|
+
PopoverContent,
|
|
153
|
+
{
|
|
154
|
+
align: "end",
|
|
155
|
+
className: "w-[min(420px,calc(100vw-32px))] gap-0 p-0",
|
|
156
|
+
"data-analytics-debug-floating-panel": "true",
|
|
157
|
+
onInteractOutside: (event) => {
|
|
158
|
+
event.preventDefault();
|
|
159
|
+
},
|
|
160
|
+
side: "top",
|
|
161
|
+
sideOffset: 10,
|
|
162
|
+
style: { zIndex: "var(--z-dialog-popover)" },
|
|
163
|
+
children: [
|
|
164
|
+
/* @__PURE__ */ jsxs("div", { className: "flex items-start justify-between gap-2 border-b border-[var(--border-1)] px-3 py-2", children: [
|
|
165
|
+
/* @__PURE__ */ jsxs("div", { className: "min-w-0", children: [
|
|
166
|
+
/* @__PURE__ */ jsx("div", { className: "truncate text-[13px] font-medium text-[var(--text-primary)]", children: labels.title }),
|
|
167
|
+
/* @__PURE__ */ jsx("div", { className: "text-[11px] text-[var(--text-tertiary)]", children: labels.count(events.length) })
|
|
168
|
+
] }),
|
|
169
|
+
/* @__PURE__ */ jsxs("div", { className: "flex shrink-0 items-center gap-1", children: [
|
|
170
|
+
/* @__PURE__ */ jsxs(
|
|
171
|
+
Button,
|
|
172
|
+
{
|
|
173
|
+
disabled: events.length === 0,
|
|
174
|
+
onClick: () => store.clear(),
|
|
175
|
+
size: "sm",
|
|
176
|
+
variant: "ghost",
|
|
177
|
+
children: [
|
|
178
|
+
/* @__PURE__ */ jsx(DeleteIcon, { size: 14 }),
|
|
179
|
+
labels.clear
|
|
180
|
+
]
|
|
181
|
+
}
|
|
182
|
+
),
|
|
183
|
+
/* @__PURE__ */ jsx(
|
|
184
|
+
Button,
|
|
185
|
+
{
|
|
186
|
+
"aria-label": labels.close,
|
|
187
|
+
onClick: () => setPanelOpen(false),
|
|
188
|
+
size: "icon-sm",
|
|
189
|
+
title: labels.close,
|
|
190
|
+
type: "button",
|
|
191
|
+
variant: "ghost",
|
|
192
|
+
children: /* @__PURE__ */ jsx(CloseIcon, { className: "size-4" })
|
|
193
|
+
}
|
|
194
|
+
)
|
|
195
|
+
] })
|
|
196
|
+
] }),
|
|
197
|
+
/* @__PURE__ */ jsx(ScrollArea, { className: "h-[min(420px,calc(100vh-120px))]", children: orderedEvents.length === 0 ? /* @__PURE__ */ jsx("div", { className: "px-3 py-8 text-center text-[13px] text-[var(--text-tertiary)]", children: labels.empty }) : /* @__PURE__ */ jsx("div", { className: "divide-y divide-[var(--border-1)]", children: orderedEvents.map((event, index) => /* @__PURE__ */ jsxs(
|
|
198
|
+
"article",
|
|
199
|
+
{
|
|
200
|
+
className: "px-3 py-2.5",
|
|
201
|
+
children: [
|
|
202
|
+
/* @__PURE__ */ jsxs("div", { className: "mb-1 flex items-center justify-between gap-2", children: [
|
|
203
|
+
/* @__PURE__ */ jsx("div", { className: "min-w-0 truncate text-[13px] font-medium text-[var(--text-primary)]", children: event.name }),
|
|
204
|
+
/* @__PURE__ */ jsx(Badge, { className: "shrink-0", variant: "secondary", children: formatEventTime(event.clientTS) })
|
|
205
|
+
] }),
|
|
206
|
+
/* @__PURE__ */ jsx("div", { className: "mb-1 text-[11px] text-[var(--text-tertiary)]", children: labels.clientTimestamp(event.clientTS) }),
|
|
207
|
+
/* @__PURE__ */ jsx("pre", { className: "max-w-full whitespace-pre-wrap break-words rounded-md bg-[var(--transparency-block)] p-2 text-[11px] leading-4 text-[var(--text-secondary)] [overflow-wrap:anywhere]", children: formatParams(event.params) })
|
|
208
|
+
]
|
|
209
|
+
},
|
|
210
|
+
`${event.name}-${event.clientTS}-${index}`
|
|
211
|
+
)) }) })
|
|
212
|
+
]
|
|
213
|
+
}
|
|
214
|
+
)
|
|
215
|
+
] })
|
|
216
|
+
}
|
|
217
|
+
);
|
|
218
|
+
}
|
|
219
|
+
function defaultFormatEventTime(timestamp) {
|
|
220
|
+
if (!Number.isFinite(timestamp) || timestamp <= 0) {
|
|
221
|
+
return "--:--:--";
|
|
222
|
+
}
|
|
223
|
+
return new Date(timestamp).toLocaleTimeString();
|
|
224
|
+
}
|
|
225
|
+
function formatParams(params) {
|
|
226
|
+
if (!params || typeof params !== "object") {
|
|
227
|
+
return "{}";
|
|
228
|
+
}
|
|
229
|
+
try {
|
|
230
|
+
return JSON.stringify(params, null, 2);
|
|
231
|
+
} catch {
|
|
232
|
+
return "{}";
|
|
233
|
+
}
|
|
234
|
+
}
|
|
235
|
+
export {
|
|
236
|
+
AnalyticsDebugFloatingEntry,
|
|
237
|
+
hasAnalyticsDebugFloatingDragMoved,
|
|
238
|
+
resolveAnalyticsDebugFloatingPosition
|
|
239
|
+
};
|
|
240
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../src/react/AnalyticsDebugFloatingEntry.tsx"],"sourcesContent":["import {\n useCallback,\n useMemo,\n useRef,\n useState,\n useSyncExternalStore,\n type MouseEvent as ReactMouseEvent,\n type PointerEvent as ReactPointerEvent\n} from \"react\";\nimport {\n Badge,\n Button,\n CloseIcon,\n DeleteIcon,\n HealthIcon,\n Popover,\n PopoverContent,\n PopoverTrigger,\n ScrollArea\n} from \"@tutti-os/ui-system\";\n\nimport type { AnalyticsDebugEventStoreContract } from \"../eventStore.ts\";\nimport {\n hasAnalyticsDebugFloatingDragMoved,\n resolveAnalyticsDebugFloatingPosition,\n type AnalyticsDebugPosition\n} from \"./floatingPosition.ts\";\n\nexport interface AnalyticsDebugLabels {\n clear: string;\n clientTimestamp(value: number): string;\n close: string;\n count(value: number): string;\n empty: string;\n open: string;\n title: string;\n}\n\nexport interface AnalyticsDebugFloatingEntryProps {\n labels: AnalyticsDebugLabels;\n store: AnalyticsDebugEventStoreContract;\n formatEventTime?: (timestamp: number) => string;\n}\n\ninterface DragSession {\n dragging: boolean;\n floatingSize: {\n height: number;\n width: number;\n };\n pointerStart: {\n x: number;\n y: number;\n };\n startPosition: AnalyticsDebugPosition;\n}\n\nexport function AnalyticsDebugFloatingEntry({\n formatEventTime = defaultFormatEventTime,\n labels,\n store\n}: AnalyticsDebugFloatingEntryProps) {\n const [position, setPosition] = useState<AnalyticsDebugPosition | null>(null);\n const [panelOpen, setPanelOpen] = useState(false);\n const dragSessionRef = useRef<DragSession | null>(null);\n const suppressNextClickRef = useRef(false);\n const subscribe = useCallback(\n (listener: () => void) => store.subscribe(listener),\n [store]\n );\n const getSnapshot = useCallback(() => store.getSnapshot(), [store]);\n const events = useSyncExternalStore(subscribe, getSnapshot, getSnapshot);\n const orderedEvents = useMemo(() => [...events].reverse(), [events]);\n const handlePointerDown = useCallback(\n (event: ReactPointerEvent<HTMLButtonElement>) => {\n if (event.button !== 0) {\n return;\n }\n\n const rect = event.currentTarget.getBoundingClientRect();\n dragSessionRef.current = {\n dragging: false,\n floatingSize: {\n height: rect.height,\n width: rect.width\n },\n pointerStart: {\n x: event.clientX,\n y: event.clientY\n },\n startPosition: {\n left: rect.left,\n top: rect.top\n }\n };\n event.currentTarget.setPointerCapture(event.pointerId);\n },\n []\n );\n const handlePointerMove = useCallback(\n (event: ReactPointerEvent<HTMLButtonElement>) => {\n const dragSession = dragSessionRef.current;\n if (!dragSession) {\n return;\n }\n\n const pointerCurrent = {\n x: event.clientX,\n y: event.clientY\n };\n const dragging =\n dragSession.dragging ||\n hasAnalyticsDebugFloatingDragMoved({\n pointerCurrent,\n pointerStart: dragSession.pointerStart\n });\n if (!dragging) {\n return;\n }\n\n dragSession.dragging = true;\n suppressNextClickRef.current = true;\n setPosition(\n resolveAnalyticsDebugFloatingPosition({\n floatingSize: dragSession.floatingSize,\n pointerCurrent,\n pointerStart: dragSession.pointerStart,\n startPosition: dragSession.startPosition,\n viewport: {\n height: window.innerHeight,\n width: window.innerWidth\n }\n })\n );\n },\n []\n );\n const handlePointerEnd = useCallback(\n (event: ReactPointerEvent<HTMLButtonElement>) => {\n if (event.currentTarget.hasPointerCapture(event.pointerId)) {\n event.currentTarget.releasePointerCapture(event.pointerId);\n }\n dragSessionRef.current = null;\n },\n []\n );\n const handleClickCapture = useCallback(\n (event: ReactMouseEvent<HTMLButtonElement>) => {\n if (!suppressNextClickRef.current) {\n return;\n }\n\n suppressNextClickRef.current = false;\n event.preventDefault();\n event.stopPropagation();\n },\n []\n );\n\n return (\n <div\n className=\"fixed right-4 bottom-4 z-[var(--z-dialog-popover)]\"\n data-analytics-debug-floating-root=\"true\"\n style={\n position\n ? {\n bottom: \"auto\",\n left: position.left,\n right: \"auto\",\n top: position.top\n }\n : undefined\n }\n >\n <Popover open={panelOpen} onOpenChange={setPanelOpen}>\n <PopoverTrigger asChild>\n <Button\n aria-label={labels.open}\n className=\"relative size-11 touch-none rounded-full border border-[var(--border-1)] bg-[var(--background-fronted)] text-[var(--text-primary)] shadow-soft hover:bg-[var(--background-hover)]\"\n onClickCapture={handleClickCapture}\n onPointerCancel={handlePointerEnd}\n onPointerDown={handlePointerDown}\n onPointerMove={handlePointerMove}\n onPointerUp={handlePointerEnd}\n size=\"icon-lg\"\n variant=\"outline\"\n >\n <HealthIcon size={18} />\n {events.length > 0 ? (\n <span className=\"absolute -top-1 -right-1 flex min-w-5 items-center justify-center rounded-full bg-[var(--accent-bg)] px-1 text-[10px] leading-5 text-[var(--accent)]\">\n {events.length}\n </span>\n ) : null}\n </Button>\n </PopoverTrigger>\n <PopoverContent\n align=\"end\"\n className=\"w-[min(420px,calc(100vw-32px))] gap-0 p-0\"\n data-analytics-debug-floating-panel=\"true\"\n onInteractOutside={(event) => {\n event.preventDefault();\n }}\n side=\"top\"\n sideOffset={10}\n style={{ zIndex: \"var(--z-dialog-popover)\" }}\n >\n <div className=\"flex items-start justify-between gap-2 border-b border-[var(--border-1)] px-3 py-2\">\n <div className=\"min-w-0\">\n <div className=\"truncate text-[13px] font-medium text-[var(--text-primary)]\">\n {labels.title}\n </div>\n <div className=\"text-[11px] text-[var(--text-tertiary)]\">\n {labels.count(events.length)}\n </div>\n </div>\n <div className=\"flex shrink-0 items-center gap-1\">\n <Button\n disabled={events.length === 0}\n onClick={() => store.clear()}\n size=\"sm\"\n variant=\"ghost\"\n >\n <DeleteIcon size={14} />\n {labels.clear}\n </Button>\n <Button\n aria-label={labels.close}\n onClick={() => setPanelOpen(false)}\n size=\"icon-sm\"\n title={labels.close}\n type=\"button\"\n variant=\"ghost\"\n >\n <CloseIcon className=\"size-4\" />\n </Button>\n </div>\n </div>\n <ScrollArea className=\"h-[min(420px,calc(100vh-120px))]\">\n {orderedEvents.length === 0 ? (\n <div className=\"px-3 py-8 text-center text-[13px] text-[var(--text-tertiary)]\">\n {labels.empty}\n </div>\n ) : (\n <div className=\"divide-y divide-[var(--border-1)]\">\n {orderedEvents.map((event, index) => (\n <article\n className=\"px-3 py-2.5\"\n key={`${event.name}-${event.clientTS}-${index}`}\n >\n <div className=\"mb-1 flex items-center justify-between gap-2\">\n <div className=\"min-w-0 truncate text-[13px] font-medium text-[var(--text-primary)]\">\n {event.name}\n </div>\n <Badge className=\"shrink-0\" variant=\"secondary\">\n {formatEventTime(event.clientTS)}\n </Badge>\n </div>\n <div className=\"mb-1 text-[11px] text-[var(--text-tertiary)]\">\n {labels.clientTimestamp(event.clientTS)}\n </div>\n <pre className=\"max-w-full whitespace-pre-wrap break-words rounded-md bg-[var(--transparency-block)] p-2 text-[11px] leading-4 text-[var(--text-secondary)] [overflow-wrap:anywhere]\">\n {formatParams(event.params)}\n </pre>\n </article>\n ))}\n </div>\n )}\n </ScrollArea>\n </PopoverContent>\n </Popover>\n </div>\n );\n}\n\nfunction defaultFormatEventTime(timestamp: number): string {\n if (!Number.isFinite(timestamp) || timestamp <= 0) {\n return \"--:--:--\";\n }\n\n return new Date(timestamp).toLocaleTimeString();\n}\n\nfunction formatParams(params: unknown): string {\n if (!params || typeof params !== \"object\") {\n return \"{}\";\n }\n\n try {\n return JSON.stringify(params, null, 2);\n } catch {\n return \"{}\";\n }\n}\n"],"mappings":"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","names":[]}
|
package/package.json
ADDED
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@tutti-os/analytics-debug",
|
|
3
|
+
"version": "0.0.248",
|
|
4
|
+
"private": false,
|
|
5
|
+
"type": "module",
|
|
6
|
+
"types": "./dist/index.d.ts",
|
|
7
|
+
"exports": {
|
|
8
|
+
".": {
|
|
9
|
+
"types": "./dist/index.d.ts",
|
|
10
|
+
"import": "./dist/index.js"
|
|
11
|
+
},
|
|
12
|
+
"./react": {
|
|
13
|
+
"types": "./dist/react/index.d.ts",
|
|
14
|
+
"import": "./dist/react/index.js"
|
|
15
|
+
}
|
|
16
|
+
},
|
|
17
|
+
"files": [
|
|
18
|
+
"dist",
|
|
19
|
+
"README.md"
|
|
20
|
+
],
|
|
21
|
+
"repository": {
|
|
22
|
+
"type": "git",
|
|
23
|
+
"url": "git+https://github.com/tutti-os/tutti.git",
|
|
24
|
+
"directory": "packages/analytics/debug"
|
|
25
|
+
},
|
|
26
|
+
"dependencies": {
|
|
27
|
+
"@tutti-os/analytics": "0.0.248",
|
|
28
|
+
"@tutti-os/ui-system": "0.0.248"
|
|
29
|
+
},
|
|
30
|
+
"devDependencies": {
|
|
31
|
+
"@types/node": "^24.0.1",
|
|
32
|
+
"@types/react": "^19.1.6",
|
|
33
|
+
"@types/react-dom": "^19.1.5",
|
|
34
|
+
"react": "^19.1.0",
|
|
35
|
+
"react-dom": "^19.1.0",
|
|
36
|
+
"typescript": "^5.8.3",
|
|
37
|
+
"@tutti-os/config-tsconfig": "0.0.0"
|
|
38
|
+
},
|
|
39
|
+
"peerDependencies": {
|
|
40
|
+
"react": "^19.1.0",
|
|
41
|
+
"react-dom": "^19.1.0"
|
|
42
|
+
},
|
|
43
|
+
"tutti": {
|
|
44
|
+
"tailwindSourceRoot": "src"
|
|
45
|
+
},
|
|
46
|
+
"publishConfig": {
|
|
47
|
+
"access": "public"
|
|
48
|
+
},
|
|
49
|
+
"scripts": {
|
|
50
|
+
"build": "tsup --config tsup.config.ts",
|
|
51
|
+
"test": "node --test --experimental-strip-types \"./src/**/*.test.ts\"",
|
|
52
|
+
"typecheck": "node ../../../tools/scripts/run-tsgo-typecheck.mjs"
|
|
53
|
+
}
|
|
54
|
+
}
|