@agent-native/core 0.140.0 → 0.141.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.
Files changed (128) hide show
  1. package/corpus/README.md +1 -1
  2. package/corpus/templates/analytics/actions/query-agent-native-analytics.ts +1 -1
  3. package/corpus/templates/analytics/changelog/2026-08-05-historical-analytics-rollups-stay-complete-and-atomic.md +6 -0
  4. package/corpus/templates/analytics/server/lib/dashboard-report.ts +0 -2
  5. package/corpus/templates/analytics/server/lib/first-party-analytics-rollups.ts +11 -6
  6. package/corpus/templates/analytics/server/lib/first-party-analytics.ts +8 -18
  7. package/corpus/templates/analytics/server/plugins/db.ts +174 -0
  8. package/corpus/templates/calendar/app/components/calendar/OutOfOfficeEvent.tsx +38 -38
  9. package/corpus/templates/calendar/changelog/2026-08-05-out-of-office-blocks-now-open-from-their-scheduled-time-rang.md +6 -0
  10. package/corpus/templates/calendar/server/lib/booking-emails.ts +70 -154
  11. package/corpus/templates/calendar/server/lib/event-guest-notifications.ts +28 -64
  12. package/corpus/templates/clips/actions/get-recording-player-data.ts +1 -0
  13. package/corpus/templates/clips/actions/invite-member.ts +16 -39
  14. package/corpus/templates/clips/app/components/player/comments-panel.tsx +2 -3
  15. package/corpus/templates/clips/app/components/player/reaction-emojis.ts +10 -0
  16. package/corpus/templates/clips/app/components/player/reactions-tray.tsx +2 -2
  17. package/corpus/templates/clips/app/components/player/video-player.tsx +20 -6
  18. package/corpus/templates/clips/app/routes/embed.$shareId.tsx +33 -0
  19. package/corpus/templates/clips/app/routes/r.$recordingId.tsx +5 -1
  20. package/corpus/templates/clips/app/routes/share.$shareId.tsx +27 -1
  21. package/corpus/templates/clips/changelog/2026-08-05-comment-and-video-reaction-pickers-now-include-eyes-and-mind.md +6 -0
  22. package/corpus/templates/clips/changelog/2026-08-05-fresh-recordings-now-open-with-the-complete-video.md +6 -0
  23. package/corpus/templates/clips/server/lib/transactional-email-templates.ts +0 -24
  24. package/corpus/templates/clips/server/routes/api/public-recording.get.ts +1 -0
  25. package/corpus/templates/content/server/lib/comment-notifications.ts +26 -57
  26. package/corpus/templates/design/.agents/skills/design-systems/SKILL.md +1 -44
  27. package/corpus/templates/design/.generated/bridge/editor-chrome.generated.ts +1 -265
  28. package/corpus/templates/design/actions/create-design-system.ts +10 -9
  29. package/corpus/templates/design/actions/get-design-system.ts +0 -53
  30. package/corpus/templates/design/actions/import-design-tokens.ts +71 -5
  31. package/corpus/templates/design/actions/index-design-tokens.ts +80 -61
  32. package/corpus/templates/design/actions/update-design-system.ts +10 -7
  33. package/corpus/templates/design/app/components/design/EditPanel.tsx +2 -45
  34. package/corpus/templates/design/app/components/design/bridge/editor-chrome.bridge.ts +0 -12
  35. package/corpus/templates/design/app/components/design/edit-panel/document-colors.ts +6 -10
  36. package/corpus/templates/design/app/components/design/edit-panel/effects-properties.tsx +3 -19
  37. package/corpus/templates/design/app/components/design/edit-panel/fill-properties.tsx +10 -36
  38. package/corpus/templates/design/app/components/design/edit-panel/interaction-state-helpers.ts +0 -15
  39. package/corpus/templates/design/app/components/design/edit-panel/panel-primitives.tsx +1 -19
  40. package/corpus/templates/design/app/components/design/edit-panel/position-helpers.ts +0 -6
  41. package/corpus/templates/design/app/components/design/edit-panel/stroke-properties.tsx +23 -53
  42. package/corpus/templates/design/app/components/design/inspector/DesignColorPicker.tsx +4 -142
  43. package/corpus/templates/design/app/components/design/types.ts +0 -6
  44. package/corpus/templates/design/app/i18n-data.ts +0 -20
  45. package/corpus/templates/design/app/pages/DesignSystemSetup.tsx +1 -1
  46. package/corpus/templates/design/app/pages/DesignSystems.tsx +1 -78
  47. package/corpus/templates/design/app/pages/design-editor/html-layer-positioning.ts +1 -6
  48. package/corpus/templates/design/e2e/helpers.ts +0 -17
  49. package/corpus/templates/design/shared/resolve-tweaks.ts +18 -10
  50. package/corpus/templates/forms/server/lib/response-email.ts +0 -2
  51. package/corpus/templates/plan/actions/request-plan-access.ts +12 -33
  52. package/corpus/templates/plan/server/lib/comment-notifications.ts +27 -53
  53. package/corpus/templates/slides/server/lib/comment-notifications.ts +21 -44
  54. package/dist/a2a/handlers.js +9 -10
  55. package/dist/brand-kit/index.d.ts +0 -1
  56. package/dist/brand-kit/index.js +0 -1
  57. package/dist/brand-kit/types.d.ts +0 -25
  58. package/dist/collab/awareness.d.ts +2 -2
  59. package/dist/collab/struct-routes.d.ts +1 -1
  60. package/dist/db/client.js +8 -8
  61. package/dist/db/migrations.js +39 -19
  62. package/dist/localization/default-messages.d.ts +0 -45
  63. package/dist/localization/default-messages.js +0 -45
  64. package/dist/notifications/routes.d.ts +6 -6
  65. package/dist/observability/routes.d.ts +3 -3
  66. package/dist/org/handlers.js +1 -8
  67. package/dist/progress/routes.d.ts +1 -1
  68. package/dist/provider-api/actions/custom-provider-registration.d.ts +7 -7
  69. package/dist/provider-api/actions/provider-api.d.ts +7 -7
  70. package/dist/provider-api/corpus-jobs.d.ts +2 -2
  71. package/dist/resources/handlers.d.ts +1 -1
  72. package/dist/secrets/routes.d.ts +9 -9
  73. package/dist/server/action-discovery.js +0 -22
  74. package/dist/server/auth.js +3 -1
  75. package/dist/server/better-auth-instance.js +2 -17
  76. package/dist/server/email.d.ts +0 -9
  77. package/dist/server/email.js +3 -44
  78. package/dist/server/index.d.ts +0 -1
  79. package/dist/server/index.js +0 -1
  80. package/dist/server/transcribe-voice.d.ts +1 -1
  81. package/dist/templates/workspace-core/.agents/skills/authentication/SKILL.md +3 -2
  82. package/docs/content/authentication.mdx +25 -19
  83. package/package.json +1 -1
  84. package/src/templates/workspace-core/.agents/skills/authentication/SKILL.md +3 -2
  85. package/corpus/templates/analytics/server/lib/emails.ts +0 -51
  86. package/corpus/templates/analytics/server/plugins/transactional-emails.ts +0 -5
  87. package/corpus/templates/calendar/server/lib/emails.ts +0 -167
  88. package/corpus/templates/calendar/server/plugins/transactional-emails.ts +0 -5
  89. package/corpus/templates/clips/server/lib/emails.ts +0 -256
  90. package/corpus/templates/clips/server/plugins/transactional-email-catalog.ts +0 -5
  91. package/corpus/templates/content/server/lib/emails.ts +0 -70
  92. package/corpus/templates/content/server/plugins/transactional-emails.ts +0 -5
  93. package/corpus/templates/design/app/components/design/edit-panel/design-system-swatches.ts +0 -215
  94. package/corpus/templates/design/changelog/2026-08-04-design-system-tokens-show-by-name-in-the-editor.md +0 -6
  95. package/corpus/templates/design/server/lib/design-system-tokens.ts +0 -35
  96. package/corpus/templates/design/shared/authored-color-styles.ts +0 -401
  97. package/corpus/templates/dispatch/app/routes/transactional-email.$appId.$id.tsx +0 -4
  98. package/corpus/templates/dispatch/app/routes/transactional-email.tsx +0 -4
  99. package/corpus/templates/forms/server/lib/emails.ts +0 -52
  100. package/corpus/templates/forms/server/plugins/transactional-emails.ts +0 -5
  101. package/corpus/templates/plan/server/lib/emails.ts +0 -67
  102. package/corpus/templates/plan/server/plugins/transactional-emails.ts +0 -5
  103. package/corpus/templates/slides/server/lib/emails.ts +0 -40
  104. package/corpus/templates/slides/server/plugins/transactional-emails.ts +0 -5
  105. package/dist/brand-kit/tokens.d.ts +0 -92
  106. package/dist/brand-kit/tokens.js +0 -280
  107. package/dist/email-catalog/actions/list-email-activity.d.ts +0 -6
  108. package/dist/email-catalog/actions/list-email-activity.js +0 -15
  109. package/dist/email-catalog/actions/list-email-engagement.d.ts +0 -6
  110. package/dist/email-catalog/actions/list-email-engagement.js +0 -15
  111. package/dist/email-catalog/actions/list-email-log.d.ts +0 -8
  112. package/dist/email-catalog/actions/list-email-log.js +0 -22
  113. package/dist/email-catalog/actions/list-transactional-emails.d.ts +0 -23
  114. package/dist/email-catalog/actions/list-transactional-emails.js +0 -61
  115. package/dist/email-catalog/actions/render-transactional-email-preview.d.ts +0 -10
  116. package/dist/email-catalog/actions/render-transactional-email-preview.js +0 -24
  117. package/dist/email-catalog/authorize.d.ts +0 -2
  118. package/dist/email-catalog/authorize.js +0 -10
  119. package/dist/email-catalog/log.d.ts +0 -57
  120. package/dist/email-catalog/log.js +0 -117
  121. package/dist/email-catalog/provider-metrics.d.ts +0 -34
  122. package/dist/email-catalog/provider-metrics.js +0 -165
  123. package/dist/email-catalog/registry.d.ts +0 -79
  124. package/dist/email-catalog/registry.js +0 -71
  125. package/dist/email-catalog/schema.d.ts +0 -212
  126. package/dist/email-catalog/schema.js +0 -49
  127. package/dist/email-catalog/system-emails.d.ts +0 -14
  128. package/dist/email-catalog/system-emails.js +0 -68
@@ -42,7 +42,6 @@ import {
42
42
  type GlslShaderPanelContext,
43
43
  } from "../inspector/GlslShaderPanel";
44
44
  import type { ElementInfo } from "../types";
45
- import type { DesignSystemColorSwatch } from "./design-system-swatches";
46
45
  import { isTextElement } from "./element-classification";
47
46
  import { elementStableKey } from "./element-identity";
48
47
  import { FieldTrailer } from "./field-primitives";
@@ -52,7 +51,6 @@ import {
52
51
  SectionIconButton,
53
52
  useRowDragReorder,
54
53
  } from "./inspector-controls";
55
- import { authoredColorValue } from "./interaction-state-helpers";
56
54
  import { ColorInput, PanelSection } from "./panel-primitives";
57
55
  import {
58
56
  colorHasVisibleAlpha,
@@ -297,15 +295,10 @@ function ShadowEffectRow({
297
295
  rowProps,
298
296
  handleProps,
299
297
  element,
300
- designSystemColors,
301
- resolvedColor,
302
298
  motionKeyframeContext,
303
299
  }: {
304
300
  layer: ShadowLayer;
305
301
  index: number;
306
- designSystemColors?: DesignSystemColorSwatch[];
307
- /** The layer's painted colour, for the swatch when `layer.color` is a token. */
308
- resolvedColor?: string;
309
302
  onChange: (patch: Partial<ShadowLayer>, meta?: StyleChangeMeta) => void;
310
303
  onRemove: () => void;
311
304
  onToggleVisibility: () => void;
@@ -459,8 +452,6 @@ function ShadowEffectRow({
459
452
  <ColorInput
460
453
  label={t("editPanel.labels.color")}
461
454
  value={cssColorOrFallback(layer.color, "rgba(0, 0, 0, 0.25)")}
462
- designSystemColors={designSystemColors}
463
- resolvedColor={resolvedColor}
464
455
  onChange={(value, meta) => onChange({ color: value }, meta)}
465
456
  />
466
457
  </div>
@@ -473,15 +464,12 @@ export function EffectsProperties({
473
464
  element,
474
465
  onStyleChange,
475
466
  onStylesChange,
476
- designSystemColors,
477
467
  glslShaderContext,
478
468
  motionKeyframeContext,
479
469
  }: {
480
470
  element: ElementInfo;
481
471
  onStyleChange: StyleChangeHandler;
482
472
  onStylesChange?: StylesChangeHandler;
483
- /** Kit tokens offered by name in the drop-shadow colour picker. */
484
- designSystemColors?: DesignSystemColorSwatch[];
485
473
  /**
486
474
  * Persistence context for the code-backed Shader effect type (GLSL
487
475
  * overlay rendered above the element's content, saved into the screen
@@ -520,13 +508,11 @@ export function EffectsProperties({
520
508
  const shadowTargetsText = isTextElement(element);
521
509
  // Read from the same property the writer targets, or the rows would show a
522
510
  // box-shadow that is no longer what this element uses.
523
- const shadowProperty = shadowTargetsText ? "textShadow" : "boxShadow";
524
- const paintedShadowLayers = effectsAreMixed
525
- ? []
526
- : parseShadowLayers(styles[shadowProperty]);
527
511
  const shadowLayers = effectsAreMixed
528
512
  ? []
529
- : parseShadowLayers(authoredColorValue(element, shadowProperty));
513
+ : parseShadowLayers(
514
+ shadowTargetsText ? styles.textShadow : styles.boxShadow,
515
+ );
530
516
  const setShadowLayers = (layers: ShadowLayer[], meta?: StyleChangeMeta) => {
531
517
  setHiddenEffectStash((stash) =>
532
518
  remapIndexedShadowStash(stash, effectStashKey, layers),
@@ -690,8 +676,6 @@ export function EffectsProperties({
690
676
  }
691
677
  rowProps={shadowDrag.getRowProps(index)}
692
678
  handleProps={shadowDrag.getHandleProps(index)}
693
- designSystemColors={designSystemColors}
694
- resolvedColor={paintedShadowLayers[index]?.color}
695
679
  onChange={(patch, meta) => {
696
680
  const next = shadowLayers.map((candidate) =>
697
681
  candidate.id === layer.id
@@ -23,12 +23,6 @@ import {
23
23
  import { DesignColorPicker, imageFillToBackgroundStyles } from "../inspector";
24
24
  import type { GlslShaderPanelContext } from "../inspector/GlslShaderPanel";
25
25
  import type { ElementInfo } from "../types";
26
- import {
27
- hiddenColorWrite,
28
- hiddenTokenReference,
29
- parseTokenReference,
30
- type DesignSystemColorSwatch,
31
- } from "./design-system-swatches";
32
26
  import { selectionColorValues } from "./document-colors";
33
27
  import { isTextElement } from "./element-classification";
34
28
  import { elementStableKey } from "./element-identity";
@@ -52,13 +46,11 @@ import {
52
46
  SectionIconButton,
53
47
  useRowDragReorder,
54
48
  } from "./inspector-controls";
55
- import { authoredColorValue } from "./interaction-state-helpers";
56
49
  import { ColorInput, PanelSection } from "./panel-primitives";
57
50
  import {
58
51
  colorHasVisibleAlpha,
59
52
  cssColorOrFallback,
60
53
  swatchStyle,
61
- zeroAlphaLiteral,
62
54
  } from "./position-helpers";
63
55
  import { isMixedValue } from "./selection-helpers";
64
56
  import type {
@@ -117,7 +109,6 @@ export function FillProperties({
117
109
  onStyleChange,
118
110
  onStylesChange,
119
111
  documentColorPalette = [],
120
- designSystemColors,
121
112
  glslShaderContext,
122
113
  motionKeyframeContext,
123
114
  breakpointOverrideContext,
@@ -130,9 +121,6 @@ export function FillProperties({
130
121
  * colors below so a real, always-populated "Document colors" row is
131
122
  * available even before any file content has been scanned. */
132
123
  documentColorPalette?: string[];
133
- /** Colour tokens from the design's linked Brand Kit, shown by name in the
134
- * fill picker above the document palette. */
135
- designSystemColors?: DesignSystemColorSwatch[];
136
124
  /**
137
125
  * Persistence context for the code-backed Shader paint type (GLSL source
138
126
  * saved into the screen HTML). Threaded into the fill picker so its
@@ -156,20 +144,9 @@ export function FillProperties({
156
144
  Record<string, string>
157
145
  >({});
158
146
  const fillStashKey = elementStableKey(element);
159
- // getComputedStyle resolves `var()` before we can read it, so a token-backed
160
- // fill would come back as a bare colour and lose the name it was set from.
161
- // The authored inline value still holds the reference.
162
- const authoredFill = authoredColorValue(element, fillProperty);
163
- const computedFill = isTextFillElement
147
+ const fillValue = isTextFillElement
164
148
  ? styles.color || ""
165
149
  : styles.backgroundColor || "";
166
- // A hidden token's `color-mix` also has to survive here, or the reference it
167
- // carries is replaced by the transparent colour it computes to.
168
- const fillValue =
169
- authoredFill &&
170
- (parseTokenReference(authoredFill) || hiddenTokenReference(authoredFill))
171
- ? authoredFill
172
- : computedFill;
173
150
  const backgroundLayers = isTextFillElement
174
151
  ? []
175
152
  : splitCssLayers(styles.backgroundImage || "");
@@ -206,25 +183,24 @@ export function FillProperties({
206
183
  // separately: computed style strips comments but keeps rgba() channels).
207
184
  // Showing again just restores alpha to 1 using those same channels, so no
208
185
  // stash is required and the hide survives reselect/reload.
209
- const hiddenFillToken = hiddenTokenReference(fillValue);
210
- const isHidden = Boolean(hiddenFillToken) || !colorHasVisibleAlpha(fillValue);
211
-
186
+ const isHidden = !colorHasVisibleAlpha(fillValue);
212
187
  const handleFillVisibilityToggle = () => {
188
+ const parsed = parseCssColor(fillValue);
213
189
  if (isHidden) {
214
- if (hiddenFillToken) {
215
- onStyleChange(fillProperty, hiddenFillToken);
216
- return;
217
- }
218
- const parsed = parseCssColor(fillValue);
219
190
  const restored = parsed
220
191
  ? rgbaToCss(withColorOpacity(parsed, 100))
221
192
  : isTextFillElement
222
193
  ? "#000000"
223
194
  : "#ffffff";
224
195
  onStyleChange(fillProperty, restored);
225
- return;
196
+ } else if (parsed) {
197
+ onStyleChange(fillProperty, rgbaToCss(withColorOpacity(parsed, 0)));
198
+ } else {
199
+ // Value wasn't a parseable color (e.g. already the literal
200
+ // "transparent") — nothing to preserve, transparent is the best we
201
+ // can do.
202
+ onStyleChange(fillProperty, "transparent");
226
203
  }
227
- onStyleChange(fillProperty, hiddenColorWrite(fillValue, zeroAlphaLiteral));
228
204
  };
229
205
 
230
206
  // Reorder fill layers by dragging: permute all four index-aligned parallel
@@ -409,8 +385,6 @@ export function FillProperties({
409
385
  commitStylePatch(patch, onStyleChange, onStylesChange)
410
386
  }
411
387
  documentColors={documentColors}
412
- designSystemColors={designSystemColors}
413
- resolvedColor={computedFill}
414
388
  pickerKey={[
415
389
  element.sourceId ??
416
390
  element.id ??
@@ -1,20 +1,5 @@
1
1
  import type { ElementInfo } from "../types";
2
2
 
3
- /**
4
- * The colour a property was authored with, else the computed value. A generated
5
- * design styles through classes, so `el.style` alone is not enough.
6
- */
7
- export function authoredColorValue(
8
- element: ElementInfo,
9
- property: string,
10
- ): string | undefined {
11
- const inline = element.inlineStyles?.[property];
12
- if (inline) return inline;
13
- const authored = element.authoredColorStyles?.[property];
14
- if (authored) return authored;
15
- return element.computedStyles[property];
16
- }
17
-
18
3
  export function authoredStyleValue(
19
4
  element: ElementInfo,
20
5
  property: string,
@@ -26,10 +26,6 @@ import {
26
26
  } from "../inspector";
27
27
  import type { DesignPaintType } from "../inspector/DesignColorPicker";
28
28
  import type { GlslShaderPanelContext } from "../inspector/GlslShaderPanel";
29
- import {
30
- parseTokenReference,
31
- type DesignSystemColorSwatch,
32
- } from "./design-system-swatches";
33
29
  import {
34
30
  buildGradientLayer,
35
31
  defaultGradientLayer,
@@ -229,8 +225,6 @@ export function ColorInput({
229
225
  onBlendModeChange,
230
226
  supportsLayeredFills = false,
231
227
  documentColors,
232
- designSystemColors,
233
- resolvedColor,
234
228
  supportedPaintTypes,
235
229
  pickerKey,
236
230
  glslShaderContext,
@@ -276,8 +270,6 @@ export function ColorInput({
276
270
  supportsLayeredFills?: boolean;
277
271
  /** Hex strings already in use on the page — forwarded to the color picker swatch grid. */
278
272
  documentColors?: string[];
279
- designSystemColors?: DesignSystemColorSwatch[];
280
- resolvedColor?: string;
281
273
  /**
282
274
  * Restricts which paint-type tabs the popover renders. Omit for the full
283
275
  * set (solid + gradients + image + …). Pass `["solid"]` for properties
@@ -377,15 +369,7 @@ export function ColorInput({
377
369
  // before clobbering the last-known-good value in this component's own
378
370
  // state. Reject anything that doesn't parse as a plain solid color in
379
371
  // that case instead of forwarding it.
380
- // A design system token reference is valid on a plain color property even
381
- // though it is not itself a color, so it must survive this guard.
382
- if (
383
- !supportsLayeredFills &&
384
- !parseCssColor(next) &&
385
- !parseTokenReference(next)
386
- ) {
387
- return;
388
- }
372
+ if (!supportsLayeredFills && !parseCssColor(next)) return;
389
373
  pendingGestureRef.current = phase === "preview";
390
374
  setDraft(next);
391
375
  onChange(next, { phase });
@@ -590,8 +574,6 @@ export function ColorInput({
590
574
  gradientType={activeGradient?.type}
591
575
  onGradientTypeChange={handleGradientTypeChange}
592
576
  documentColors={documentColors}
593
- designSystemColors={designSystemColors}
594
- resolvedColor={resolvedColor}
595
577
  supportedPaintTypes={supportedPaintTypes}
596
578
  glslShaderContext={glslShaderContext}
597
579
  />
@@ -213,12 +213,6 @@ export function resolveRestoredStrokeStyle(
213
213
  * (a single undo/history step, matching every other multi-property commit
214
214
  * in this file, e.g. TextStrokeProperties' equivalent show handler).
215
215
  */
216
- /** A literal colour at zero alpha, or null when it does not parse as one. */
217
- export function zeroAlphaLiteral(literal: string): string | null {
218
- const parsed = parseCssColor(literal);
219
- return parsed ? rgbaToCss(withColorOpacity(parsed, 0)) : null;
220
- }
221
-
222
216
  export function strokeShowPatch(
223
217
  prefix: "border" | "outline",
224
218
  color: string,
@@ -23,12 +23,6 @@ import {
23
23
  import { ScrubInput } from "../inspector";
24
24
  import type { DesignPaintType } from "../inspector/DesignColorPicker";
25
25
  import type { ElementInfo } from "../types";
26
- import {
27
- hiddenColorWrite,
28
- hiddenTokenReference,
29
- parseTokenReference,
30
- type DesignSystemColorSwatch,
31
- } from "./design-system-swatches";
32
26
  import { isTextElement } from "./element-classification";
33
27
  import { commitStylePatch, FieldTrailer } from "./field-primitives";
34
28
  import { SectionIconButton } from "./inspector-controls";
@@ -47,7 +41,6 @@ import {
47
41
  strokeShowPatch,
48
42
  textStrokeAddPatch,
49
43
  textStrokeIsVisible,
50
- zeroAlphaLiteral,
51
44
  } from "./position-helpers";
52
45
  import { isMixedValue } from "./selection-helpers";
53
46
  import type {
@@ -67,26 +60,6 @@ import { STROKE_POSITION_OPTIONS } from "./style-options";
67
60
  */
68
61
  const SOLID_ONLY_PAINT_TYPES: DesignPaintType[] = ["solid"];
69
62
 
70
- /**
71
- * The stroke colour as authored: its token name when it has one, else the
72
- * resolved colour. Empty when no rule set it at all — the border then paints
73
- * CSS's `currentColor` default, and echoing the inherited text colour here
74
- * would claim a stroke colour the design never chose.
75
- */
76
- export function authoredStrokeColor(
77
- element: ElementInfo,
78
- property: string,
79
- computed: string | undefined,
80
- ): string {
81
- const authored =
82
- element.inlineStyles?.[property] ?? element.authoredColorStyles?.[property];
83
- if (!authored) return "";
84
- if (parseTokenReference(authored) || hiddenTokenReference(authored)) {
85
- return authored;
86
- }
87
- return computed || authored;
88
- }
89
-
90
63
  type StrokeLayerKind = "border" | "outline";
91
64
  type StrokePosition = "inside" | "outside" | "center";
92
65
 
@@ -94,7 +67,6 @@ function StrokeLayerControl({
94
67
  kind,
95
68
  visible,
96
69
  color,
97
- designSystemColors,
98
70
  width,
99
71
  styleValue,
100
72
  outlineOffset,
@@ -108,7 +80,6 @@ function StrokeLayerControl({
108
80
  kind: StrokeLayerKind;
109
81
  visible: boolean;
110
82
  color: string;
111
- designSystemColors?: DesignSystemColorSwatch[];
112
83
  width: string;
113
84
  styleValue: string;
114
85
  /** Only meaningful when `kind === "outline"` — distinguishes outside vs
@@ -133,7 +104,6 @@ function StrokeLayerControl({
133
104
  label: t(`editPanel.labels.${option.key}`),
134
105
  }));
135
106
  const prefix = kind === "border" ? "border" : "outline";
136
- const hiddenToken = hiddenTokenReference(color);
137
107
  const position: StrokePosition =
138
108
  kind === "border"
139
109
  ? "inside"
@@ -192,10 +162,11 @@ function StrokeLayerControl({
192
162
  <div className="min-w-0 flex-1">
193
163
  <ColorInput
194
164
  label=""
195
- // Not cssColorOrFallback: an unset stroke must stay unset here
196
- // rather than render as a black the design never chose.
197
- value={hiddenToken ?? color}
198
- designSystemColors={designSystemColors}
165
+ value={cssColorOrFallback(
166
+ color,
167
+ /* guard:allow-raw-color - ColorInput needs a concrete swatch fallback. */
168
+ "#000000",
169
+ )}
199
170
  onChange={(value, meta) =>
200
171
  onStyleChange(`${prefix}Color`, value, meta)
201
172
  }
@@ -216,18 +187,21 @@ function StrokeLayerControl({
216
187
  // style permanently, since there is no round-trippable "unset"
217
188
  // for that keyword once it's overwritten.
218
189
  if (visible) {
190
+ const parsed = parseCssColor(color);
219
191
  onStyleChange(
220
192
  `${prefix}Color`,
221
- hiddenColorWrite(color, zeroAlphaLiteral),
193
+ parsed ? rgbaToCss(withColorOpacity(parsed, 0)) : "transparent",
222
194
  );
223
195
  return;
224
196
  }
225
197
  // Restore color/width/style as ONE commit (single undo step)
226
198
  // rather than three sequential onStyleChange calls — see
227
199
  // strokeShowPatch's doc comment.
228
- const showPatch = strokeShowPatch(prefix, color, width, styleValue);
229
- if (hiddenToken) showPatch[`${prefix}Color`] = hiddenToken;
230
- commitStylePatch(showPatch, onStyleChange, onStylesChange);
200
+ commitStylePatch(
201
+ strokeShowPatch(prefix, color, width, styleValue),
202
+ onStyleChange,
203
+ onStylesChange,
204
+ );
231
205
  }}
232
206
  >
233
207
  {visible ? (
@@ -323,15 +297,12 @@ export function StrokeProperties({
323
297
  element,
324
298
  onStyleChange,
325
299
  onStylesChange,
326
- designSystemColors,
327
300
  motionKeyframeContext,
328
301
  breakpointOverrideContext,
329
302
  }: {
330
303
  element: ElementInfo;
331
304
  onStyleChange: StyleChangeHandler;
332
305
  onStylesChange?: StylesChangeHandler;
333
- /** Linked Brand Kit colour tokens, offered by name in the stroke picker. */
334
- designSystemColors?: DesignSystemColorSwatch[];
335
306
  motionKeyframeContext?: MotionKeyframeFieldContext;
336
307
  breakpointOverrideContext?: BreakpointOverrideFieldContext;
337
308
  }) {
@@ -482,12 +453,11 @@ export function StrokeProperties({
482
453
  <StrokeLayerControl
483
454
  kind="border"
484
455
  visible={borderVisible}
485
- color={authoredStrokeColor(
486
- element,
487
- "borderColor",
488
- styles.borderColor,
489
- )}
490
- designSystemColors={designSystemColors}
456
+ color={
457
+ styles.borderColor ||
458
+ /* guard:allow-raw-color - a new stroke needs a concrete color. */
459
+ "#000000"
460
+ }
491
461
  width={styles.borderWidth || "0px"}
492
462
  styleValue={styles.borderStyle || "none"}
493
463
  onStyleChange={onStyleChange}
@@ -508,12 +478,12 @@ export function StrokeProperties({
508
478
  <StrokeLayerControl
509
479
  kind="outline"
510
480
  visible={outlineVisible}
511
- color={authoredStrokeColor(
512
- element,
513
- "outlineColor",
514
- styles.outlineColor || styles.borderColor,
515
- )}
516
- designSystemColors={designSystemColors}
481
+ color={
482
+ styles.outlineColor ||
483
+ styles.borderColor ||
484
+ /* guard:allow-raw-color - a new stroke needs a concrete color. */
485
+ "#000000"
486
+ }
517
487
  width={styles.outlineWidth || "0px"}
518
488
  styleValue={styles.outlineStyle || "solid"}
519
489
  outlineOffset={styles.outlineOffset || "0px"}
@@ -43,14 +43,6 @@ import {
43
43
  } from "@/components/ui/tooltip";
44
44
  import { cn } from "@/lib/utils";
45
45
 
46
- import {
47
- groupColorSwatches,
48
- parseTokenReference,
49
- resolveTokenNameForColor,
50
- swatchLabel,
51
- tokenReferenceValue,
52
- type DesignSystemColorSwatch,
53
- } from "../edit-panel/design-system-swatches";
54
46
  import {
55
47
  GlslShaderPanel,
56
48
  type GlslShaderPanelContext,
@@ -198,16 +190,6 @@ export interface DesignColorPickerProps {
198
190
  * limited in the caller; the component renders whatever is passed.
199
191
  */
200
192
  documentColors?: string[];
201
- /**
202
- * Colour tokens from the design's linked Brand Kit, listed by name above
203
- * "Document colors". Picking one writes `var(--token, #hex)`.
204
- */
205
- designSystemColors?: DesignSystemColorSwatch[];
206
- /**
207
- * The colour the canvas resolved `value` to. Only consulted when `value` is a
208
- * token reference this document cannot resolve on its own.
209
- */
210
- resolvedColor?: string;
211
193
  /**
212
194
  * Restricts which paint-type tabs are rendered (Solid, Linear, Radial, …).
213
195
  * Omit to show every type (default, backward compatible). Callers that
@@ -721,8 +703,6 @@ export function DesignColorPicker({
721
703
  gradientType,
722
704
  onGradientTypeChange,
723
705
  documentColors,
724
- designSystemColors,
725
- resolvedColor,
726
706
  supportedPaintTypes,
727
707
  shaderContext,
728
708
  glslShaderContext,
@@ -732,15 +712,7 @@ export function DesignColorPicker({
732
712
  className,
733
713
  }: DesignColorPickerProps) {
734
714
  const copy = { ...DEFAULT_LABELS, ...labels };
735
- // A `var(--token, #hex)` fill has no colour of its own outside the preview
736
- // document; read the literal so the SV field and chip are not blank.
737
- const tokenReference = parseTokenReference(value);
738
- // Generated CSS writes bare `var(--token)`, unresolvable here, so the colour
739
- // has to come from what the canvas painted.
740
- const color =
741
- parseCssColorExtended(tokenReference?.fallback ?? value) ??
742
- (tokenReference ? parseCssColorExtended(resolvedColor ?? "") : null) ??
743
- FALLBACK_COLOR;
715
+ const color = parseCssColorExtended(value) ?? FALLBACK_COLOR;
744
716
  const hsv = rgbaToHsv(color);
745
717
  const hsl = rgbaToHsl(color);
746
718
  const effectiveOpacity = opacity ?? alphaToOpacity(color.a);
@@ -842,16 +814,6 @@ export function DesignColorPicker({
842
814
  ? rawEffectivePaintType
843
815
  : "solid";
844
816
 
845
- const tokenName = useMemo(() => {
846
- if (effectivePaintType !== "solid" || !designSystemColors?.length) {
847
- return null;
848
- }
849
- return resolveTokenNameForColor(
850
- tokenReference ? value : rgbaToCss(color),
851
- designSystemColors,
852
- );
853
- }, [color, designSystemColors, effectivePaintType, tokenReference, value]);
854
-
855
817
  // Resolve the active gradient: prefer EditPanel-driven props; otherwise parse
856
818
  // the live CSS value, falling back to local edit state.
857
819
  const parsedGradient = useMemo(
@@ -934,15 +896,6 @@ export function DesignColorPicker({
934
896
  onChange(next);
935
897
  };
936
898
 
937
- /**
938
- * Same route as `emitColor`: a solid fill must not detour through the
939
- * layered-paint merge just because its value is an expression.
940
- */
941
- const emitTokenReference = (nextValue: string) => {
942
- lastEmittedValueRef.current = nextValue;
943
- onChange(nextValue);
944
- };
945
-
946
899
  const emitPaintValue = (nextValue: string) => {
947
900
  lastEmittedValueRef.current = nextValue;
948
901
  if (onPaintValueChange) onPaintValueChange(nextValue);
@@ -1383,14 +1336,8 @@ export function DesignColorPicker({
1383
1336
  className="size-4 shrink-0 rounded-[3px] border border-border/60"
1384
1337
  style={triggerSwatchStyle(value, color)}
1385
1338
  />
1386
- <span
1387
- className={cn(
1388
- "min-w-0 flex-1 truncate text-left tabular-nums !text-[11px]",
1389
- // Hex is conventionally upper-case; a token name is not.
1390
- !tokenName && "uppercase",
1391
- )}
1392
- >
1393
- {tokenName ?? triggerLabel(effectivePaintType, color)}
1339
+ <span className="min-w-0 flex-1 truncate text-left tabular-nums uppercase !text-[11px]">
1340
+ {triggerLabel(effectivePaintType, color)}
1394
1341
  </span>
1395
1342
  <span className="tabular-nums text-muted-foreground !text-[11px]">
1396
1343
  {effectiveOpacity}%
@@ -1403,7 +1350,7 @@ export function DesignColorPicker({
1403
1350
  side="left"
1404
1351
  align="start"
1405
1352
  sideOffset={8}
1406
- className="z-[10000] max-h-[calc(100vh-5rem)] w-[252px] overflow-y-auto p-0 shadow-xl"
1353
+ className="z-[10000] w-[252px] p-0 shadow-xl"
1407
1354
  // Keep the picker open when the style change triggered by a paint-type
1408
1355
  // switch causes the canvas to re-project the element. Without this,
1409
1356
  // Radix treats the resulting focus shift as an "interact outside" event
@@ -1832,91 +1779,6 @@ export function DesignColorPicker({
1832
1779
  </div>
1833
1780
  )}
1834
1781
 
1835
- {/* ── Design system ────────────────────────────────────────── */}
1836
- {/* The linked Brand Kit's colour tokens, under the names the
1837
- source system uses. Clicking one applies its value; it does
1838
- not bind to the CSS variable, so the fill will not follow a
1839
- later kit edit. */}
1840
- {designSystemColors && designSystemColors.length > 0 && (
1841
- <div className="border-t border-border/70 px-3 py-2.5">
1842
- <div className="mb-2 flex h-6 w-full items-center justify-between gap-2 px-0.5 !text-[11px] text-muted-foreground">
1843
- <span className="truncate">
1844
- {"Design system" /* i18n-ignore design picker source */}
1845
- </span>
1846
- {designSystemColors[0]?.source ? (
1847
- <span className="shrink-0 truncate opacity-80">
1848
- {designSystemColors[0].source}
1849
- </span>
1850
- ) : null}
1851
- </div>
1852
-
1853
- {/* A list, not a swatch grid: the token's name is the whole
1854
- point of this section, and a grid hides it behind hover. */}
1855
- <div className="max-h-40 space-y-2 overflow-y-auto pe-0.5">
1856
- {groupColorSwatches(designSystemColors).map((group) => (
1857
- <div key={group.label ?? "ungrouped"}>
1858
- {group.label ? (
1859
- <div className="mb-1 truncate px-0.5 !text-[10px] text-muted-foreground/80">
1860
- {group.label}
1861
- </div>
1862
- ) : null}
1863
- <div className="space-y-0.5">
1864
- {group.swatches.map((swatch) => {
1865
- const isActive =
1866
- !activeGradient && tokenName === swatch.name;
1867
- return (
1868
- <button
1869
- key={swatch.cssVar}
1870
- type="button"
1871
- disabled={disabled}
1872
- aria-label={swatchLabel(swatch)}
1873
- aria-pressed={isActive}
1874
- title={`${swatch.name} · ${swatch.cssVar}`}
1875
- className={cn(
1876
- "flex w-full items-center gap-2 rounded-sm border px-1 py-0.5 text-left transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring",
1877
- isActive
1878
- ? "border-primary bg-accent/40"
1879
- : "border-transparent hover:bg-accent/40",
1880
- )}
1881
- onClick={() => {
1882
- if (activeGradient) {
1883
- // The stop parser round-trips colours,
1884
- // not var() expressions.
1885
- emitStopColor(
1886
- parseCssColorExtended(swatch.value) ??
1887
- color,
1888
- );
1889
- } else {
1890
- emitTokenReference(
1891
- tokenReferenceValue(swatch),
1892
- );
1893
- }
1894
- notifyChangeComplete();
1895
- }}
1896
- >
1897
- <span
1898
- className="size-4 shrink-0 rounded-[3px] border border-border/60"
1899
- style={swatchStyle(swatch.value)}
1900
- />
1901
- <span className="min-w-0 flex-1 truncate !text-[11px] text-foreground">
1902
- {swatchLabel(swatch)}
1903
- </span>
1904
- <span className="shrink-0 font-mono uppercase !text-[10px] text-muted-foreground">
1905
- {rgbaToHex(
1906
- parseCssColorExtended(swatch.value) ??
1907
- color,
1908
- )}
1909
- </span>
1910
- </button>
1911
- );
1912
- })}
1913
- </div>
1914
- </div>
1915
- ))}
1916
- </div>
1917
- </div>
1918
- )}
1919
-
1920
1782
  {/* ── Document colors ──────────────────────────────────────── */}
1921
1783
  {/* Renders the palette of colors already used in the design.
1922
1784
  When `documentColors` is provided, those swatches are shown;
@@ -95,12 +95,6 @@ export interface ElementInfo {
95
95
  * must fall back to computedStyles-based inference when absent.
96
96
  */
97
97
  inlineStyles?: Record<string, string>;
98
- /**
99
- * Colour declarations resolved through the cascade (inline, else the last
100
- * matching rule). Generated designs style via classes, so `inlineStyles` is
101
- * empty and only this preserves a `var(--token, …)` reference.
102
- */
103
- authoredColorStyles?: Record<string, string>;
104
98
  /**
105
99
  * Value of the element's `data-an-primitive` attribute (e.g. "text",
106
100
  * "rectangle", "frame", "ellipse") when present. Canvas-drawn primitives —