@hanzo/ui 8.0.58 → 8.0.59
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/README.md +92 -0
- package/dist/product/Palette.cjs +2 -2
- package/dist/product/Palette.d.ts.map +1 -1
- package/dist/product/Palette.js +2 -2
- package/dist/product/Palette.js.map +1 -1
- package/dist/product/instrument.cjs +7 -2
- package/dist/product/instrument.d.ts.map +1 -1
- package/dist/product/instrument.js +7 -2
- package/dist/product/instrument.js.map +1 -1
- package/dist/root.cjs +10 -2
- package/dist/root.d.ts +26 -1
- package/dist/root.d.ts.map +1 -1
- package/dist/root.js +10 -2
- package/dist/root.js.map +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -114,6 +114,98 @@ import { registerField } from '@hanzo/ui/data'
|
|
|
114
114
|
registerField('rating', { Display: MyStars, Input: MyStarPicker })
|
|
115
115
|
```
|
|
116
116
|
|
|
117
|
+
## Analytics — one flag, and the components report themselves
|
|
118
|
+
|
|
119
|
+
```tsx
|
|
120
|
+
import { Hanzo } from '@hanzo/ui'
|
|
121
|
+
|
|
122
|
+
<Hanzo analytics={{ product: 'console', ingestKey: process.env.NEXT_PUBLIC_EVENT_INGEST_KEY }}>
|
|
123
|
+
<App />
|
|
124
|
+
</Hanzo>
|
|
125
|
+
```
|
|
126
|
+
|
|
127
|
+
That is the entire wiring. Every click, form change, submit and route change
|
|
128
|
+
inside the tree arrives on the ONE front door (`POST /v1/event`) annotated with
|
|
129
|
+
the component it happened on — no `onClick` handler anywhere reports anything,
|
|
130
|
+
and no call site changes:
|
|
131
|
+
|
|
132
|
+
```jsonc
|
|
133
|
+
{
|
|
134
|
+
"event": "$click",
|
|
135
|
+
"$el": "card/button[Save]", // the significant-node trail, root→leaf
|
|
136
|
+
"$role": "button",
|
|
137
|
+
"$component": "button", // from the data-slot every primitive carries
|
|
138
|
+
"$name": "Save"
|
|
139
|
+
}
|
|
140
|
+
```
|
|
141
|
+
|
|
142
|
+
Component names are real **in production**. Every primitive here stamps a
|
|
143
|
+
`data-slot` through one helper (`slot()`), and the capture engine reads it — so
|
|
144
|
+
attribution does not depend on React fiber owners, which a production build
|
|
145
|
+
minifies away. A component that wants a better name than its slot says so once,
|
|
146
|
+
on itself: `data-hz-name="SaveButton"` outranks everything.
|
|
147
|
+
|
|
148
|
+
### What it is made of — one of each
|
|
149
|
+
|
|
150
|
+
| Concern | Package | There is exactly one |
|
|
151
|
+
|---|---|---|
|
|
152
|
+
| Client + wire | [`@hanzo/event`](../../pkgs/event) | endpoint `POST /v1/event`, batched, beacon-on-unload |
|
|
153
|
+
| Capture engine | [`@hanzo/observe`](../../pkgs/observe) | delegated listeners, semantic annotation, redaction |
|
|
154
|
+
| Provider + consent | `@hanzogui/telemetry` | `<TelemetryProvider/>`, which `analytics` renders |
|
|
155
|
+
|
|
156
|
+
`analytics` is a **prop, not a default**. Mounting a component library must
|
|
157
|
+
never start a network conversation the app did not ask for: without it `<Hanzo>`
|
|
158
|
+
renders no provider, installs no listener and sends nothing.
|
|
159
|
+
|
|
160
|
+
### It cannot double-count
|
|
161
|
+
|
|
162
|
+
An app that already mounts `<TelemetryProvider/>` itself leaves `analytics`
|
|
163
|
+
off — but if both are mounted, the events still do not double. The capture
|
|
164
|
+
engine installs *delegated* listeners on a root, so two engines on one root
|
|
165
|
+
would report every interaction twice; a page-wide claim (`Symbol.for`, so
|
|
166
|
+
duplicate copies of the package in one bundle still see each other) gives the
|
|
167
|
+
root to the first engine and leaves any later one inert. Both providers also
|
|
168
|
+
resolve the same client, so there is one session and one stream either way.
|
|
169
|
+
|
|
170
|
+
### Privacy
|
|
171
|
+
|
|
172
|
+
Consent decides whether any of it runs: Global Privacy Control, Do Not Track,
|
|
173
|
+
and a stored choice a consent banner records — which outranks the browser signal
|
|
174
|
+
in **both** directions, because that is what explicit means. Beyond that:
|
|
175
|
+
|
|
176
|
+
- **Input values are withheld.** `$input`/`$change` carry the field's kind and
|
|
177
|
+
value length, never the typed text.
|
|
178
|
+
- **Sensitive fields are never captured at all** — password, email, card, cvv,
|
|
179
|
+
token, ssn — not even a length.
|
|
180
|
+
- **`data-hz-private`** on any element excludes its whole subtree.
|
|
181
|
+
|
|
182
|
+
### One ingest key
|
|
183
|
+
|
|
184
|
+
`ingestKey` is a publishable `pk-…` — write-only, safe in a bundle, minted per
|
|
185
|
+
org with `POST /v1/keys {"type":"publishable"}`. Omit it and the client reads
|
|
186
|
+
`NEXT_PUBLIC_EVENT_INGEST_KEY` from the build env, which is the spelling the
|
|
187
|
+
fleet already carries end to end (KMS holds `deploy/EVENT_INGEST_KEY`; the
|
|
188
|
+
Dockerfile takes it as a build-arg and re-exports it with the `NEXT_PUBLIC_`
|
|
189
|
+
prefix Next needs to inline it). A surface with no key reports only for whoever
|
|
190
|
+
is signed in and silently drops every logged-out visitor — the door refuses an
|
|
191
|
+
unattributable write rather than filing it where its owner cannot read it.
|
|
192
|
+
|
|
193
|
+
For a page with no build step at all, the same client ships as a script tag:
|
|
194
|
+
`@hanzo/event/hz.js`, with `data-ingest-key="pk-…"`.
|
|
195
|
+
|
|
196
|
+
### Naming a moment the components cannot see
|
|
197
|
+
|
|
198
|
+
Autocapture reports what was clicked; it cannot know that a click *was* a
|
|
199
|
+
checkout. Curated events live on `@hanzo/ui/product`, one closed verb set over
|
|
200
|
+
one event name, on the same client and the same stream:
|
|
201
|
+
|
|
202
|
+
```tsx
|
|
203
|
+
import { useEmit, InstrumentSurface } from '@hanzo/ui/product'
|
|
204
|
+
|
|
205
|
+
const emit = useEmit()
|
|
206
|
+
emit({ component: 'PlanCard', action: 'select', id: 'pro' })
|
|
207
|
+
```
|
|
208
|
+
|
|
117
209
|
## Design principles
|
|
118
210
|
|
|
119
211
|
- **One home, no duplication** — components are extracted, never copied. The record layer's source of truth stays in `@hanzo/data`; `@hanzo/ui` composes it.
|
package/dist/product/Palette.cjs
CHANGED
|
@@ -48,7 +48,7 @@ function Palette({ open, onOpenChange, ops, onRun, active, onActive, search: con
|
|
|
48
48
|
onSearch?.(s);
|
|
49
49
|
};
|
|
50
50
|
const groups = (0, react_1.useMemo)(() => (0, match_1.survivors)(ops, search, limit), [ops, search, limit]);
|
|
51
|
-
return ((0, jsx_runtime_1.jsxs)(gui_2.CommandDialog, { open: open, onOpenChange: onOpenChange, title: title, description: placeholder, value: active, onValueChange: onActive, shouldFilter: false, children: [(0, jsx_runtime_1.jsx)(gui_2.CommandInput, { value: search, onValueChange: setSearch, placeholder: placeholder, color: "$color", placeholderTextColor: "$color11" }), (0, jsx_runtime_1.jsxs)(gui_1.XStack, { minH: height, children: [(0, jsx_runtime_1.jsxs)(gui_2.CommandList, { maxH: height, width: children ? "50%" : "100%", borderRightWidth: children ? 1 : 0, borderColor: "$borderColor", py: "$1", children: [groups.length === 0 && ((0, jsx_runtime_1.jsx)(gui_2.CommandEmpty, { children: (0, jsx_runtime_1.jsx)(gui_1.SizableText, { color: "$color11", children: empty }) })), groups.map(([group, items]) => ((0, jsx_runtime_1.jsx)(gui_2.CommandGroup, { heading: group, children: items.map((op) => ((0, jsx_runtime_1.jsxs)(gui_2.CommandItem, { value: op.id, onSelect: () => onRun(op), gap: "$2", children: [op.icon, (0, jsx_runtime_1.jsx)(gui_1.SizableText, { numberOfLines: 1, children: op.label }), op.hint ? ((0, jsx_runtime_1.jsx)(gui_1.SizableText, { numberOfLines: 1, fontSize: "$1", color: "$color11", children: op.hint })) : null, (0, jsx_runtime_1.jsx)(Method, { of: op }), op.end] }, op.id))) }, group)))] }), children ? (0, jsx_runtime_1.jsx)(gui_1.YStack, { width: "50%", children: children }) : null] }), footer ? ((0, jsx_runtime_1.jsx)(gui_1.XStack, { items: "center", gap: "$4", borderTopWidth: 1, borderColor: "$borderColor", px: "$3", py: "$2", children: footer })) : null] }));
|
|
51
|
+
return ((0, jsx_runtime_1.jsxs)(gui_2.CommandDialog, { open: open, onOpenChange: onOpenChange, title: title, description: placeholder, value: active, onValueChange: onActive, shouldFilter: false, children: [(0, jsx_runtime_1.jsx)(gui_2.CommandInput, { value: search, onValueChange: setSearch, placeholder: placeholder, color: "$color", placeholderTextColor: "$color11" }), (0, jsx_runtime_1.jsxs)(gui_1.XStack, { minH: height, children: [(0, jsx_runtime_1.jsxs)(gui_2.CommandList, { maxH: height, width: children ? "50%" : "100%", borderRightWidth: children ? 1 : 0, borderColor: "$borderColor", py: "$1", children: [groups.length === 0 && ((0, jsx_runtime_1.jsx)(gui_2.CommandEmpty, { children: (0, jsx_runtime_1.jsx)(gui_1.SizableText, { color: "$color11", children: empty }) })), groups.map(([group, items]) => ((0, jsx_runtime_1.jsx)(gui_2.CommandGroup, { heading: group, children: items.map((op) => ((0, jsx_runtime_1.jsxs)(gui_2.CommandItem, { value: op.id, onSelect: () => onRun(op), gap: "$2", children: [op.icon, (0, jsx_runtime_1.jsxs)(gui_1.XStack, { flex: 1, items: "center", gap: "$2", overflow: "hidden", children: [(0, jsx_runtime_1.jsx)(gui_1.SizableText, { numberOfLines: 1, shrink: 0, children: op.label }), op.hint ? ((0, jsx_runtime_1.jsx)(gui_1.SizableText, { numberOfLines: 1, flex: 1, fontSize: "$1", color: "$color11", children: op.hint })) : null] }), (0, jsx_runtime_1.jsx)(Method, { of: op }), op.end] }, op.id))) }, group)))] }), children ? (0, jsx_runtime_1.jsx)(gui_1.YStack, { width: "50%", children: children }) : null] }), footer ? ((0, jsx_runtime_1.jsx)(gui_1.XStack, { items: "center", gap: "$4", borderTopWidth: 1, borderColor: "$borderColor", px: "$3", py: "$2", children: footer })) : null] }));
|
|
52
52
|
}
|
|
53
53
|
/**
|
|
54
54
|
* The method, at the end of the row, for route commands only.
|
|
@@ -61,5 +61,5 @@ function Palette({ open, onOpenChange, ops, onRun, active, onActive, search: con
|
|
|
61
61
|
function Method({ of }) {
|
|
62
62
|
if (of.method === undefined)
|
|
63
63
|
return null;
|
|
64
|
-
return ((0, jsx_runtime_1.jsx)(gui_1.SizableText, {
|
|
64
|
+
return ((0, jsx_runtime_1.jsx)(gui_1.SizableText, { shrink: 0, fontFamily: "$mono", fontSize: 10, letterSpacing: 0.4, color: of.method === match_1.SAFE ? "$color11" : "$color", children: of.method }));
|
|
65
65
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Palette.d.ts","sourceRoot":"","sources":["../../src/product/Palette.tsx"],"names":[],"mappings":"AAEA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAgCG;AACH,OAAO,EAAE,KAAK,SAAS,EAAqB,MAAM,OAAO,CAAA;AAWzD,OAAO,EAAmB,KAAK,EAAE,EAAE,MAAM,SAAS,CAAA;AAElD,MAAM,MAAM,YAAY,GAAG;IACzB,IAAI,EAAE,OAAO,CAAA;IACb,YAAY,EAAE,CAAC,IAAI,EAAE,OAAO,KAAK,IAAI,CAAA;IACrC,oEAAoE;IACpE,GAAG,EAAE,EAAE,EAAE,CAAA;IACT,0DAA0D;IAC1D,KAAK,EAAE,CAAC,EAAE,EAAE,EAAE,KAAK,IAAI,CAAA;IACvB;;;OAGG;IACH,MAAM,CAAC,EAAE,MAAM,CAAA;IACf,QAAQ,CAAC,EAAE,CAAC,EAAE,EAAE,MAAM,KAAK,IAAI,CAAA;IAC/B,uEAAuE;IACvE,MAAM,CAAC,EAAE,MAAM,CAAA;IACf,QAAQ,CAAC,EAAE,CAAC,MAAM,EAAE,MAAM,KAAK,IAAI,CAAA;IACnC,WAAW,CAAC,EAAE,MAAM,CAAA;IACpB,8CAA8C;IAC9C,KAAK,CAAC,EAAE,SAAS,CAAA;IACjB,2EAA2E;IAC3E,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,mEAAmE;IACnE,QAAQ,CAAC,EAAE,SAAS,CAAA;IACpB,qDAAqD;IACrD,MAAM,CAAC,EAAE,SAAS,CAAA;IAClB,oDAAoD;IACpD,MAAM,CAAC,EAAE,MAAM,CAAA;IACf,oCAAoC;IACpC,KAAK,CAAC,EAAE,MAAM,CAAA;CACf,CAAA;AAED,wBAAgB,OAAO,CAAC,EACtB,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ACpC,KAAK,CAAC,EAAE,MAAM,CAAA;CACf,CAAA;AAED,wBAAgB,OAAO,CAAC,EACtB,IAAI,EACJ,YAAY,EACZ,GAAG,EACH,KAAK,EACL,MAAM,EACN,QAAQ,EACR,MAAM,EAAE,UAAU,EAClB,QAAQ,EACR,WAAgC,EAChC,KAA2B,EAC3B,KAAK,EACL,QAAQ,EACR,MAAM,EACN,MAAY,EACZ,KAAyB,GAC1B,EAAE,YAAY,2CAqFd"}
|
package/dist/product/Palette.js
CHANGED
|
@@ -45,7 +45,7 @@ export function Palette({ open, onOpenChange, ops, onRun, active, onActive, sear
|
|
|
45
45
|
onSearch?.(s);
|
|
46
46
|
};
|
|
47
47
|
const groups = useMemo(() => survivors(ops, search, limit), [ops, search, limit]);
|
|
48
|
-
return (_jsxs(CommandDialog, { open: open, onOpenChange: onOpenChange, title: title, description: placeholder, value: active, onValueChange: onActive, shouldFilter: false, children: [_jsx(CommandInput, { value: search, onValueChange: setSearch, placeholder: placeholder, color: "$color", placeholderTextColor: "$color11" }), _jsxs(XStack, { minH: height, children: [_jsxs(CommandList, { maxH: height, width: children ? "50%" : "100%", borderRightWidth: children ? 1 : 0, borderColor: "$borderColor", py: "$1", children: [groups.length === 0 && (_jsx(CommandEmpty, { children: _jsx(SizableText, { color: "$color11", children: empty }) })), groups.map(([group, items]) => (_jsx(CommandGroup, { heading: group, children: items.map((op) => (_jsxs(CommandItem, { value: op.id, onSelect: () => onRun(op), gap: "$2", children: [op.icon, _jsx(SizableText, { numberOfLines: 1, children: op.label }), op.hint ? (_jsx(SizableText, { numberOfLines: 1, fontSize: "$1", color: "$color11", children: op.hint })) : null, _jsx(Method, { of: op }), op.end] }, op.id))) }, group)))] }), children ? _jsx(YStack, { width: "50%", children: children }) : null] }), footer ? (_jsx(XStack, { items: "center", gap: "$4", borderTopWidth: 1, borderColor: "$borderColor", px: "$3", py: "$2", children: footer })) : null] }));
|
|
48
|
+
return (_jsxs(CommandDialog, { open: open, onOpenChange: onOpenChange, title: title, description: placeholder, value: active, onValueChange: onActive, shouldFilter: false, children: [_jsx(CommandInput, { value: search, onValueChange: setSearch, placeholder: placeholder, color: "$color", placeholderTextColor: "$color11" }), _jsxs(XStack, { minH: height, children: [_jsxs(CommandList, { maxH: height, width: children ? "50%" : "100%", borderRightWidth: children ? 1 : 0, borderColor: "$borderColor", py: "$1", children: [groups.length === 0 && (_jsx(CommandEmpty, { children: _jsx(SizableText, { color: "$color11", children: empty }) })), groups.map(([group, items]) => (_jsx(CommandGroup, { heading: group, children: items.map((op) => (_jsxs(CommandItem, { value: op.id, onSelect: () => onRun(op), gap: "$2", children: [op.icon, _jsxs(XStack, { flex: 1, items: "center", gap: "$2", overflow: "hidden", children: [_jsx(SizableText, { numberOfLines: 1, shrink: 0, children: op.label }), op.hint ? (_jsx(SizableText, { numberOfLines: 1, flex: 1, fontSize: "$1", color: "$color11", children: op.hint })) : null] }), _jsx(Method, { of: op }), op.end] }, op.id))) }, group)))] }), children ? _jsx(YStack, { width: "50%", children: children }) : null] }), footer ? (_jsx(XStack, { items: "center", gap: "$4", borderTopWidth: 1, borderColor: "$borderColor", px: "$3", py: "$2", children: footer })) : null] }));
|
|
49
49
|
}
|
|
50
50
|
/**
|
|
51
51
|
* The method, at the end of the row, for route commands only.
|
|
@@ -58,6 +58,6 @@ export function Palette({ open, onOpenChange, ops, onRun, active, onActive, sear
|
|
|
58
58
|
function Method({ of }) {
|
|
59
59
|
if (of.method === undefined)
|
|
60
60
|
return null;
|
|
61
|
-
return (_jsx(SizableText, {
|
|
61
|
+
return (_jsx(SizableText, { shrink: 0, fontFamily: "$mono", fontSize: 10, letterSpacing: 0.4, color: of.method === SAFE ? "$color11" : "$color", children: of.method }));
|
|
62
62
|
}
|
|
63
63
|
//# sourceMappingURL=Palette.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Palette.js","sourceRoot":"","sources":["../../src/product/Palette.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAA;;AAEZ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AC,GAAG,KApBS,EAAE,CAAC,EAAE,CAqBT,CACf,CAAC,IAxBe,KAAK,CAyBT,CAChB,CAAC,IACU,EACb,QAAQ,CAAC,CAAC,CAAC,KAAC,MAAM,IAAC,KAAK,EAAC,KAAK,YAAE,QAAQ,GAAU,CAAC,CAAC,CAAC,IAAI,IACnD,EACR,MAAM,CAAC,CAAC,CAAC,CACR,KAAC,MAAM,IACL,KAAK,EAAC,QAAQ,EACd,GAAG,EAAC,IAAI,EACR,cAAc,EAAE,CAAC,EACjB,WAAW,EAAC,cAAc,EAC1B,EAAE,EAAC,IAAI,EACP,EAAE,EAAC,IAAI,YAEN,MAAM,GACA,CACV,CAAC,CAAC,CAAC,IAAI,IACM,CACjB,CAAA;AACH,CAAC;AAED;;;;;;;GAOG;AACH,SAAS,MAAM,CAAC,EAAE,EAAE,EAAc;IAChC,IAAI,EAAE,CAAC,MAAM,KAAK,SAAS;QAAE,OAAO,IAAI,CAAA;IACxC,OAAO,CACL,KAAC,WAAW,IACV,MAAM,EAAE,CAAC,EACT,UAAU,EAAC,OAAO,EAClB,QAAQ,EAAE,EAAE,EACZ,aAAa,EAAE,GAAG,EAClB,KAAK,EAAE,EAAE,CAAC,MAAM,KAAK,IAAI,CAAC,CAAC,CAAC,UAAU,CAAC,CAAC,CAAC,QAAQ,YAEhD,EAAE,CAAC,MAAM,GACE,CACf,CAAA;AACH,CAAC"}
|
|
@@ -7,8 +7,13 @@
|
|
|
7
7
|
// `EmptyState` or `ThemeToggle` reports the SAME interaction vocabulary with
|
|
8
8
|
// zero app code. Nothing to wire, nothing to remember, nothing to drift.
|
|
9
9
|
//
|
|
10
|
-
// import { emit, useEmit, InstrumentSurface } from '@hanzo/ui'
|
|
11
|
-
// <InstrumentSurface
|
|
10
|
+
// import { emit, useEmit, InstrumentSurface } from '@hanzo/ui/product'
|
|
11
|
+
// <InstrumentSurface value="billing">…</InstrumentSurface> // optional context
|
|
12
|
+
//
|
|
13
|
+
// This is the CURATED half. `<Hanzo analytics>` already reports every click,
|
|
14
|
+
// change, submit and route change on its own, annotated with the component it
|
|
15
|
+
// happened on — what autocapture cannot know is that a click WAS a checkout.
|
|
16
|
+
// That is what this names. Same client, same stream, same front door.
|
|
12
17
|
//
|
|
13
18
|
// ONE event name, structured properties — the taxonomy in @hanzo/event is a
|
|
14
19
|
// CLOSED set, and its own rule for a product-specific moment is "the `action`
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"instrument.d.ts","sourceRoot":"","sources":["../../src/product/instrument.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"instrument.d.ts","sourceRoot":"","sources":["../../src/product/instrument.ts"],"names":[],"mappings":"AAkCA;kFACkF;AAClF,MAAM,MAAM,QAAQ,GAChB,OAAO,GACP,MAAM,GACN,OAAO,GACP,QAAQ,GACR,QAAQ,GACR,MAAM,GACN,QAAQ,GACR,QAAQ,GACR,SAAS,GACT,QAAQ,GACR,SAAS,GACT,QAAQ,GACR,MAAM,GACN,OAAO,CAAA;AAEX;+EAC+E;AAC/E,MAAM,WAAW,OAAO;IACtB,8EAA8E;IAC9E,SAAS,EAAE,MAAM,CAAA;IACjB,MAAM,EAAE,QAAQ,CAAA;IAChB,yEAAyE;IACzE,EAAE,CAAC,EAAE,MAAM,CAAA;IACX;;0CAEsC;IACtC,KAAK,CAAC,EAAE,MAAM,GAAG,MAAM,GAAG,OAAO,CAAA;IACjC,8EAA8E;IAC9E,OAAO,CAAC,EAAE,MAAM,CAAA;CACjB;AAOD;mEACmE;AACnE,eAAO,MAAM,iBAAiB,8CAA0B,CAAA;AAExD,iEAAiE;AACjE,eAAO,MAAM,UAAU,QAAO,MAAM,GAAG,SAAuC,CAAA;AAE9E;8EAC8E;AAC9E,wBAAgB,IAAI,CAAC,CAAC,EAAE,OAAO,GAAG,IAAI,CAQrC;AAED;gFACgF;AAChF,wBAAgB,OAAO,IAAI,CAAC,CAAC,EAAE,OAAO,KAAK,IAAI,CAM9C;AAED;;;;mFAImF;AACnF,wBAAgB,OAAO,CAAC,QAAQ,EAAE,OAAO,GAAG,MAAM,GAAG,SAAS,CAO7D;AAED;;kCAEkC;AAClC,eAAO,MAAM,QAAQ,GAAI,GAAG,MAAM,GAAG,SAAS,KAAG,MAA4B,CAAA"}
|
|
@@ -6,8 +6,13 @@
|
|
|
6
6
|
// `EmptyState` or `ThemeToggle` reports the SAME interaction vocabulary with
|
|
7
7
|
// zero app code. Nothing to wire, nothing to remember, nothing to drift.
|
|
8
8
|
//
|
|
9
|
-
// import { emit, useEmit, InstrumentSurface } from '@hanzo/ui'
|
|
10
|
-
// <InstrumentSurface
|
|
9
|
+
// import { emit, useEmit, InstrumentSurface } from '@hanzo/ui/product'
|
|
10
|
+
// <InstrumentSurface value="billing">…</InstrumentSurface> // optional context
|
|
11
|
+
//
|
|
12
|
+
// This is the CURATED half. `<Hanzo analytics>` already reports every click,
|
|
13
|
+
// change, submit and route change on its own, annotated with the component it
|
|
14
|
+
// happened on — what autocapture cannot know is that a click WAS a checkout.
|
|
15
|
+
// That is what this names. Same client, same stream, same front door.
|
|
11
16
|
//
|
|
12
17
|
// ONE event name, structured properties — the taxonomy in @hanzo/event is a
|
|
13
18
|
// CLOSED set, and its own rule for a product-specific moment is "the `action`
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"instrument.js","sourceRoot":"","sources":["../../src/product/instrument.ts"],"names":[],"mappings":"AAAA,8DAA8D;AAC9D,EAAE;AACF,2EAA2E;AAC3E,gFAAgF;AAChF,yEAAyE;AACzE,6EAA6E;AAC7E,yEAAyE;AACzE,EAAE;AACF,
|
|
1
|
+
{"version":3,"file":"instrument.js","sourceRoot":"","sources":["../../src/product/instrument.ts"],"names":[],"mappings":"AAAA,8DAA8D;AAC9D,EAAE;AACF,2EAA2E;AAC3E,gFAAgF;AAChF,yEAAyE;AACzE,6EAA6E;AAC7E,yEAAyE;AACzE,EAAE;AACF,yEAAyE;AACzE,mFAAmF;AACnF,EAAE;AACF,6EAA6E;A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,CAAC;KAC7D,CAAC,CAAA;AACJ,CAAC;AAED;gFACgF;AAChF,MAAM,UAAU,OAAO;IACrB,MAAM,OAAO,GAAG,UAAU,EAAE,CAAA;IAC5B,OAAO,WAAW,CAChB,CAAC,CAAU,EAAE,EAAE,CAAC,IAAI,CAAC,OAAO,KAAK,SAAS,IAAI,CAAC,CAAC,OAAO,KAAK,SAAS,CAAC,CAAC,CAAC,EAAE,GAAG,CAAC,EAAE,OAAO,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC,EAC9F,CAAC,OAAO,CAAC,CACV,CAAA;AACH,CAAC;AAED;;;;mFAImF;AACnF,MAAM,UAAU,OAAO,CAAC,QAAiB;IACvC,IAAI,OAAO,QAAQ,KAAK,QAAQ;QAAE,OAAO,QAAQ,CAAC,IAAI,EAAE,IAAI,SAAS,CAAA;IACrE,IAAI,KAAK,CAAC,OAAO,CAAC,QAAQ,CAAC,EAAE,CAAC;QAC5B,MAAM,IAAI,GAAG,QAAQ,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,OAAO,CAAC,KAAK,QAAQ,IAAI,OAAO,CAAC,KAAK,QAAQ,CAAC,CAAC,IAAI,CAAC,EAAE,CAAC,CAAA;QAC5F,OAAO,IAAI,CAAC,IAAI,EAAE,IAAI,SAAS,CAAA;IACjC,CAAC;IACD,OAAO,SAAS,CAAA;AAClB,CAAC;AAED;;kCAEkC;AAClC,MAAM,CAAC,MAAM,QAAQ,GAAG,CAAC,CAAqB,EAAU,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,CAAC,CAAA"}
|
package/dist/root.cjs
CHANGED
|
@@ -38,6 +38,7 @@ const jsx_runtime_1 = require("react/jsx-runtime");
|
|
|
38
38
|
* this flag controls.
|
|
39
39
|
*/
|
|
40
40
|
const gui_1 = require("@hanzo/gui");
|
|
41
|
+
const telemetry_1 = require("@hanzogui/telemetry");
|
|
41
42
|
const gui_config_1 = require("./gui-config.cjs");
|
|
42
43
|
require("./styles.css");
|
|
43
44
|
/** A stylesheet that did not reach the document is invisible until someone opens
|
|
@@ -58,10 +59,17 @@ const assertStylesheet = () => {
|
|
|
58
59
|
'that does not process CSS imported from node_modules has dropped it. Import it ' +
|
|
59
60
|
"directly instead: import '@hanzo/ui/styles.css'.");
|
|
60
61
|
};
|
|
61
|
-
const Hanzo = ({ children, theme = 'dark' }) => {
|
|
62
|
+
const Hanzo = ({ children, theme = 'dark', analytics }) => {
|
|
62
63
|
if (process.env.NODE_ENV !== 'production')
|
|
63
64
|
assertStylesheet();
|
|
64
|
-
|
|
65
|
+
const tree = ((0, jsx_runtime_1.jsx)(gui_1.GuiProvider, { config: gui_config_1.config, defaultTheme: theme, disableInjectCSS: true, children: children }));
|
|
66
|
+
// OUTSIDE the gui provider: capture is delegated at the document, so it does
|
|
67
|
+
// not need to be inside the styled tree, and an app that renders its own
|
|
68
|
+
// `<TelemetryProvider/>` above `<Hanzo>` then nests two providers of the same
|
|
69
|
+
// kind rather than interleaving them with the theme.
|
|
70
|
+
if (!analytics)
|
|
71
|
+
return tree;
|
|
72
|
+
return (0, jsx_runtime_1.jsx)(telemetry_1.TelemetryProvider, { ...(analytics === true ? {} : analytics), children: tree });
|
|
65
73
|
};
|
|
66
74
|
exports.Hanzo = Hanzo;
|
|
67
75
|
exports.default = exports.Hanzo;
|
package/dist/root.d.ts
CHANGED
|
@@ -1,10 +1,35 @@
|
|
|
1
|
+
import { type TelemetryConfig } from '@hanzogui/telemetry';
|
|
1
2
|
import type { ReactNode } from 'react';
|
|
2
3
|
import './styles.css';
|
|
3
4
|
export type HanzoProps = {
|
|
4
5
|
children?: ReactNode;
|
|
5
6
|
/** Dark-first Hanzo identity. `light` retunes it. */
|
|
6
7
|
theme?: 'dark' | 'light';
|
|
8
|
+
/**
|
|
9
|
+
* Interaction analytics for everything inside — OFF unless you ask.
|
|
10
|
+
*
|
|
11
|
+
* <Hanzo analytics> // zero config
|
|
12
|
+
* <Hanzo analytics={{ product: 'console' }}> // named surface
|
|
13
|
+
*
|
|
14
|
+
* `true` is the whole setup: every click, form change, submit and route
|
|
15
|
+
* change inside this tree arrives on the ONE front door (`POST /v1/event`)
|
|
16
|
+
* annotated with the component it happened on — `card/button[Save]` — with
|
|
17
|
+
* input values withheld. Nothing to instrument at a call site.
|
|
18
|
+
*
|
|
19
|
+
* It is a PROP, not the default, because mounting a component library must
|
|
20
|
+
* never start a network conversation an app did not ask for. Off, this
|
|
21
|
+
* renders no provider, installs no listener and sends nothing.
|
|
22
|
+
*
|
|
23
|
+
* On, it is the one wiring: ONE client (@hanzo/event), ONE capture engine
|
|
24
|
+
* (@hanzo/observe), ONE endpoint, ONE publishable key — and consent decides
|
|
25
|
+
* whether any of it runs (Global Privacy Control, Do Not Track, and a stored
|
|
26
|
+
* choice a banner records, which outranks both). An app that already mounts
|
|
27
|
+
* `<TelemetryProvider/>` itself leaves this off; both would be the same
|
|
28
|
+
* client on the same stream, and the capture engine refuses a root another
|
|
29
|
+
* engine holds, so the events do not double either way.
|
|
30
|
+
*/
|
|
31
|
+
analytics?: boolean | TelemetryConfig;
|
|
7
32
|
};
|
|
8
|
-
export declare const Hanzo: ({ children, theme }: HanzoProps) => import("react/jsx-runtime").JSX.Element;
|
|
33
|
+
export declare const Hanzo: ({ children, theme, analytics }: HanzoProps) => import("react/jsx-runtime").JSX.Element;
|
|
9
34
|
export default Hanzo;
|
|
10
35
|
//# sourceMappingURL=root.d.ts.map
|
package/dist/root.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"root.d.ts","sourceRoot":"","sources":["../src/root.tsx"],"names":[],"mappings":"AAqCA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAA;AAGtC,OAAO,cAAc,CAAA;AAErB,MAAM,MAAM,UAAU,GAAG;IACvB,QAAQ,CAAC,EAAE,SAAS,CAAA;IACpB,qDAAqD;IACrD,KAAK,CAAC,EAAE,MAAM,GAAG,OAAO,CAAA;
|
|
1
|
+
{"version":3,"file":"root.d.ts","sourceRoot":"","sources":["../src/root.tsx"],"names":[],"mappings":"AAqCA,OAAO,EAAqB,KAAK,eAAe,EAAE,MAAM,qBAAqB,CAAA;AAC7E,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAA;AAGtC,OAAO,cAAc,CAAA;AAErB,MAAM,MAAM,UAAU,GAAG;IACvB,QAAQ,CAAC,EAAE,SAAS,CAAA;IACpB,qDAAqD;IACrD,KAAK,CAAC,EAAE,MAAM,GAAG,OAAO,CAAA;IACxB;;;;;;;;;;;;;;;;;;;;;;OAsBG;IACH,SAAS,CAAC,EAAE,OAAO,GAAG,eAAe,CAAA;CACtC,CAAA;AAqBD,eAAO,MAAM,KAAK,GAAI,gCAAyC,UAAU,4CAaxE,CAAA;AAED,eAAe,KAAK,CAAA"}
|
package/dist/root.js
CHANGED
|
@@ -35,6 +35,7 @@ import { jsx as _jsx } from "react/jsx-runtime";
|
|
|
35
35
|
* this flag controls.
|
|
36
36
|
*/
|
|
37
37
|
import { GuiProvider } from '@hanzo/gui';
|
|
38
|
+
import { TelemetryProvider } from '@hanzogui/telemetry';
|
|
38
39
|
import { config } from './gui-config.js';
|
|
39
40
|
import './styles.css';
|
|
40
41
|
/** A stylesheet that did not reach the document is invisible until someone opens
|
|
@@ -55,10 +56,17 @@ const assertStylesheet = () => {
|
|
|
55
56
|
'that does not process CSS imported from node_modules has dropped it. Import it ' +
|
|
56
57
|
"directly instead: import '@hanzo/ui/styles.css'.");
|
|
57
58
|
};
|
|
58
|
-
export const Hanzo = ({ children, theme = 'dark' }) => {
|
|
59
|
+
export const Hanzo = ({ children, theme = 'dark', analytics }) => {
|
|
59
60
|
if (process.env.NODE_ENV !== 'production')
|
|
60
61
|
assertStylesheet();
|
|
61
|
-
|
|
62
|
+
const tree = (_jsx(GuiProvider, { config: config, defaultTheme: theme, disableInjectCSS: true, children: children }));
|
|
63
|
+
// OUTSIDE the gui provider: capture is delegated at the document, so it does
|
|
64
|
+
// not need to be inside the styled tree, and an app that renders its own
|
|
65
|
+
// `<TelemetryProvider/>` above `<Hanzo>` then nests two providers of the same
|
|
66
|
+
// kind rather than interleaving them with the theme.
|
|
67
|
+
if (!analytics)
|
|
68
|
+
return tree;
|
|
69
|
+
return _jsx(TelemetryProvider, { ...(analytics === true ? {} : analytics), children: tree });
|
|
62
70
|
};
|
|
63
71
|
export default Hanzo;
|
|
64
72
|
//# sourceMappingURL=root.js.map
|
package/dist/root.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"root.js","sourceRoot":"","sources":["../src/root.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAA;;AAEZ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAiCG;AACH,OAAO,EAAE,WAAW,EAAE,MAAM,YAAY,CAAA;
|
|
1
|
+
{"version":3,"file":"root.js","sourceRoot":"","sources":["../src/root.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAA;;AAEZ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAiCG;AACH,OAAO,EAAE,WAAW,EAAE,MAAM,YAAY,CAAA;AACxC,OAAO,EAAE,iBAAiB,EAAwB,MAAM,qBAAqB,CAAA;AAG7E,OAAO,EAAE,MAAM,EAAE,MAAM,cAAc,CAAA;AACrC,OAAO,cAAc,CAAA;AAgCrB;;;;;;qEAMqE;AACrE,IAAI,OAAO,GAAG,KAAK,CAAA;AACnB,MAAM,gBAAgB,GAAG,GAAG,EAAE;IAC5B,IAAI,OAAO,IAAI,OAAO,QAAQ,KAAK,WAAW,IAAI,QAAQ,CAAC,WAAW,CAAC,MAAM,KAAK,CAAC;QAAE,OAAM;IAC3F,OAAO,GAAG,IAAI,CAAA;IACd,IAAI,gBAAgB,CAAC,QAAQ,CAAC,eAAe,CAAC,CAAC,gBAAgB,CAAC,mBAAmB,CAAC,CAAC,IAAI,EAAE;QAAE,OAAM;IACnG,MAAM,IAAI,KAAK,CACb,qFAAqF;QACnF,iFAAiF;QACjF,kDAAkD,CACrD,CAAA;AACH,CAAC,CAAA;AAED,MAAM,CAAC,MAAM,KAAK,GAAG,CAAC,EAAE,QAAQ,EAAE,KAAK,GAAG,MAAM,EAAE,SAAS,EAAc,EAAE,EAAE;IAC3E,IAAI,OAAO,CAAC,GAAG,CAAC,QAAQ,KAAK,YAAY;QAAE,gBAAgB,EAAE,CAAA;IAC7D,MAAM,IAAI,GAAG,CACX,KAAC,WAAW,IAAC,MAAM,EAAE,MAAM,EAAE,YAAY,EAAE,KAAK,EAAE,gBAAgB,kBAC/D,QAAQ,GACG,CACf,CAAA;IACD,6EAA6E;IAC7E,yEAAyE;IACzE,8EAA8E;IAC9E,qDAAqD;IACrD,IAAI,CAAC,SAAS;QAAE,OAAO,IAAI,CAAA;IAC3B,OAAO,KAAC,iBAAiB,OAAK,CAAC,SAAS,KAAK,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,SAAS,CAAC,YAAG,IAAI,GAAqB,CAAA;AACjG,CAAC,CAAA;AAED,eAAe,KAAK,CAAA"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@hanzo/ui",
|
|
3
|
-
"version": "8.0.
|
|
3
|
+
"version": "8.0.59",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "Hanzo UI — the one canonical Hanzo component library, on @hanzo/gui + @hanzo/design. ONE substrate: every component renders through @hanzo/gui primitives, so the same import works on web, native (expo) and desktop (Tauri). Self-contained (theme.css), presentational, host-agnostic, clean-room.",
|
|
6
6
|
"exports": {
|