@motion-proto/live-tokens 0.13.0 → 0.13.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.
package/package.json
CHANGED
|
@@ -63,11 +63,20 @@
|
|
|
63
63
|
});
|
|
64
64
|
|
|
65
65
|
// The /components route renders the same component-editor surface as the
|
|
66
|
-
// overlay's components view. Pair them:
|
|
67
|
-
//
|
|
66
|
+
// overlay's components view. Pair them: on entering /components, flip the
|
|
67
|
+
// overlay to tokens so the two surfaces don't stack. Fires only on route
|
|
68
|
+
// change, not on every editorView change — otherwise cross-window storage
|
|
69
|
+
// sync re-triggers the rule, which writes editorView, which fires another
|
|
70
|
+
// storage event, which fires the rule again. The result is heavy re-render
|
|
71
|
+
// cascades (the storage handler regularly took >1s in practice) and a
|
|
72
|
+
// visible flicker as the view bounces.
|
|
73
|
+
let prevRoute: string | undefined;
|
|
68
74
|
run(() => {
|
|
69
|
-
|
|
70
|
-
|
|
75
|
+
const r = $route;
|
|
76
|
+
if (r === prevRoute) return;
|
|
77
|
+
prevRoute = r;
|
|
78
|
+
if (r === '/components') {
|
|
79
|
+
editorView.update((v) => (v === 'components' ? 'tokens' : v));
|
|
71
80
|
}
|
|
72
81
|
});
|
|
73
82
|
|