@motion-proto/live-tokens 0.90.0 → 0.90.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/CHANGELOG.md CHANGED
@@ -1,5 +1,19 @@
1
1
  # Changelog
2
2
 
3
+ ## 0.90.1 — Sketch mode spares the editor overlay
4
+
5
+ ### Fixed
6
+
7
+ - **Sketch mode leaves the editor overlay's layout alone.** The layer picks
8
+ out components by bare class name, and the overlay's pull tab shares
9
+ TabBar's `.tab`. With a sketchstyle on, a pill docked to an edge lost its
10
+ tab's positioning and background, which left nothing on screen to pull it
11
+ back with. Every rule that paints or moves an element now skips anything
12
+ inside `[data-live-tokens-chrome]`. A sketch scope nested inside chrome
13
+ still draws, so a preview stage placed there keeps previewing. The guard
14
+ sits in `:where()` and adds no specificity, so page overrides of the layer
15
+ keep their order.
16
+
3
17
  ## 0.90.0 — Thumbnail ratio for ImageLightbox
4
18
 
5
19
  ### Added
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@motion-proto/live-tokens",
3
- "version": "0.90.0",
3
+ "version": "0.90.1",
4
4
  "type": "module",
5
5
  "description": "Design token editor with live CSS variable editing. Svelte 5 + Vite 8.",
6
6
  "keywords": [
@@ -370,6 +370,15 @@ const UNCLIPPED = PART_SPECS.filter((p) => !p.clips).map((p) => p.sel).join(', '
370
370
  const CLIPPED = PART_SPECS.filter((p) => p.clips).map((p) => p.sel).join(', ');
371
371
  const UNMASKED = PART_SPECS.filter((p) => p.unmasked).map((p) => p.sel).join(', ');
372
372
 
373
+ /** Keeps the layer off the editor's own UI on the host page. The part
374
+ selectors are bare class names, and the overlay's `.tab` matched TabBar's:
375
+ the docked pill lost its positioning and its pull tab drew invisible. A
376
+ scope nested inside chrome draws again, so a preview stage placed there
377
+ still previews. `:where` adds no weight, so overrides keep their order. */
378
+ const OUTSIDE_CHROME =
379
+ ':where(:not([data-live-tokens-chrome], [data-live-tokens-chrome] *),' +
380
+ ' [data-live-tokens-chrome] [data-sketch] *)';
381
+
373
382
  export function buildDefsMarkup(s: SketchStyleSettings): string {
374
383
  /**
375
384
  * `warp` is the shape stage: one wave of noise whose wavelength spans a whole
@@ -697,9 +706,9 @@ const WARP_FREQUENCY = 0.08;
697
706
 
698
707
  export function buildStylesheet(s: SketchStyleSettings): string {
699
708
  const on = '[data-sketch]';
700
- const parts = `:is(${PARTS})`;
709
+ const parts = `:is(${PARTS})${OUTSIDE_CHROME}`;
701
710
  const el = `${on} ${parts}`;
702
- const strokeEl = `${on} :is(${STROKE_PARTS})`;
711
+ const strokeEl = `${on} :is(${STROKE_PARTS})${OUTSIDE_CHROME}`;
703
712
 
704
713
  // `--radius-none` is a bare `0`, so a part the theme leaves square hands the
705
714
  // corner maths a number where it needs a length: `calc(0 + 0.95 * 16px)` is
@@ -780,7 +789,7 @@ export function buildStylesheet(s: SketchStyleSettings): string {
780
789
  const iconSel = `[class*="fa-"], svg:not([${DEFS_ATTR}])`;
781
790
  const iconsOn = s.iconTravel > 0 || s.iconMaskOn;
782
791
  const icons = iconsOn
783
- ? `${on} :is(${iconSel}){` +
792
+ ? `${on} :is(${iconSel})${OUTSIDE_CHROME}{` +
784
793
  (s.iconTravel > 0
785
794
  ? `filter:var(--sketch-icon-off, var(--sketch-icon-filter, url(#${ID}-icon-0)));`
786
795
  : '') +
@@ -876,14 +885,14 @@ export function buildStylesheet(s: SketchStyleSettings): string {
876
885
  `background:transparent !important;border-color:transparent !important;` +
877
886
  `box-shadow:none !important;` +
878
887
  `}` +
879
- `${on} :is(${UNCLIPPED}){overflow:visible !important;}` +
888
+ `${on} :is(${UNCLIPPED})${OUTSIDE_CHROME}{overflow:visible !important;}` +
880
889
  // The five that keep their clip take the drawn radii on the host, so what
881
890
  // the clip cuts turns the same way the ink does at the corners. It cannot
882
891
  // follow the displacement, which is a filter and has no geometry to clip to.
883
892
  `${el}:is(${CLIPPED}){${corners}}` +
884
893
  // Only parts that sit in flow. Forcing this onto an absolutely-positioned
885
894
  // part would drop it back to its flow position.
886
- `${on} :is(${FLOW_PARTS}){position:relative;}`;
895
+ `${on} :is(${FLOW_PARTS})${OUTSIDE_CHROME}{position:relative;}`;
887
896
 
888
897
  // Fill layer. Own seed, own offset, sits behind the content.
889
898
  //
@@ -988,7 +997,7 @@ export function buildStylesheet(s: SketchStyleSettings): string {
988
997
  // per-instance cycle as the fill offset, so no two components retrace alike.
989
998
  const retraceStep = s.retraceOffset.toFixed(2);
990
999
  const retrace = s.retracePass === 'copy'
991
- ? `[data-sketch][data-sketch-passes='double'] :is(${STROKE_PARTS})::after{` +
1000
+ ? `[data-sketch][data-sketch-passes='double'] :is(${STROKE_PARTS})${OUTSIDE_CHROME}::after{` +
992
1001
  `--sketch-retrace:drop-shadow(` +
993
1002
  `calc(var(--sketch-jx, 0.6) * ${retraceStep}px)` +
994
1003
  ` calc(var(--sketch-jy, -0.4) * ${retraceStep}px)` +