@flemo/devtools 0.5.0 → 0.6.0

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 CHANGED
@@ -1,10 +1,24 @@
1
1
  # @flemo/devtools
2
2
 
3
- Zero-dependency flight recorder, on-device readout and visual panel for [flemo](https://flemo.dev) transitions. It observes existing `data-flemo-*` surfaces, leftover `flemo:*` keys, CSS animation events, pointer events, `MutationObserver`, `PerformanceObserver("longtask")`, and rAF. It imports neither `@flemo/core` nor `@flemo/react` and does not alter measured motion.
3
+ Zero-dependency flight recorder, on-device readout and visual panel, with a one-element React binding for [flemo](https://flemo.dev) transitions. It observes existing `data-flemo-*` surfaces, leftover `flemo:*` keys, CSS animation events, pointer events, `MutationObserver`, `PerformanceObserver("longtask")`, and rAF. It imports neither `@flemo/core` nor `@flemo/react` and does not alter measured motion.
4
4
 
5
5
  Everything in it is one probe module per question — pacing, motion, images, shared elements, one-frame events, landing residue — behind a small orchestrator. Adding a measurement means adding a probe.
6
6
 
7
- ## Quickstart
7
+ ## Quickstart (React)
8
+
9
+ ```tsx
10
+ import { FlemoDevtools } from "@flemo/devtools/react";
11
+
12
+ <FlemoDevtools />;
13
+ ```
14
+
15
+ That is the whole wiring. Leave it in the tree and ship it: under the `production` export condition the same specifier resolves to a component that renders null and imports nothing, so the recorder, the panel and the readout never enter a production graph. There is no flag to remember and nothing to strip before a release.
16
+
17
+ Props are `recorder`, `hud` (`true`), `panel` (`true`), `hudPosition` (`"top"`), `panelPosition` (`"bottom-left"`), `initialOpen` (`false`) and `buckets` (`["A", "B"]`). `react` is an optional peer dependency, needed only for this entry.
18
+
19
+ Do not reach for `@flemo/devtools/force` to make the component appear in a production build. The specifier survives whatever guard is wrapped around it, so it puts the real panel back into a public chunk; that is a measured mistake, made twice on this project's own site.
20
+
21
+ ## Quickstart (any framework)
8
22
 
9
23
  ```ts
10
24
  import { attachFlightRecorder } from "@flemo/devtools";
@@ -0,0 +1,31 @@
1
+ import { DevtoolsHudOptions } from './hud';
2
+ import { DevtoolsPanelOptions } from './panel';
3
+ import { FlightRecorderHandle } from './types';
4
+ export interface FlemoDevtoolsProps {
5
+ /**
6
+ * Recorder to read. Defaults to this package's `window.flemo` when one is
7
+ * installed, otherwise the surfaces attach one and take it down with them.
8
+ */
9
+ recorder?: FlightRecorderHandle;
10
+ /** Mount the on-device readout. Default true — it is the half a phone needs. */
11
+ hud?: boolean;
12
+ /** Mount the drawer. Default true. */
13
+ panel?: boolean;
14
+ /** Where the readout sits. Default "top". */
15
+ hudPosition?: DevtoolsHudOptions["position"];
16
+ /** Which corner the drawer's toggle sits in. Default "bottom-left". */
17
+ panelPosition?: DevtoolsPanelOptions["position"];
18
+ /** Start the drawer open. Default false. */
19
+ initialOpen?: boolean;
20
+ /** Labels the A/B control cycles through. Default ["A", "B"]. */
21
+ buckets?: string[];
22
+ }
23
+ /**
24
+ * Mount the devtools for as long as this component is rendered.
25
+ *
26
+ * Inert in a production build: the package's `production` export condition
27
+ * resolves this module to one that renders null, so a consumer can leave the
28
+ * element in their tree and ship it.
29
+ */
30
+ export declare function FlemoDevtools({ recorder, hud, panel, hudPosition, panelPosition, initialOpen, buckets }?: FlemoDevtoolsProps): null;
31
+ export default FlemoDevtools;