claude-artifact-framework 0.9.0 → 0.9.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
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "claude-artifact-framework",
3
- "version": "0.9.0",
3
+ "version": "0.9.1",
4
4
  "description": "Utilities for building apps inside Claude Artifacts: platform storage, chat tool-calling loops, and other primitives verified against the real runtime.",
5
5
  "type": "module",
6
6
  "main": "./dist/index.esm.js",
package/src/app.js CHANGED
@@ -617,7 +617,9 @@ const BASE_CSS = `
617
617
  }
618
618
  .caf-block-title { margin: 0; font-size: 0.78rem; font-weight: 650; text-transform: uppercase; letter-spacing: 0.06em; color: var(--caf-muted); }
619
619
  .caf-field { display: flex; flex-direction: column; gap: 0.3rem; }
620
- .caf-field label { font-size: 0.72rem; font-weight: 500; color: var(--caf-muted); letter-spacing: 0.02em; }
620
+ /* A full size+weight step below .caf-block-title the uppercase alone was
621
+ not enough to tell "card title" from "field label" at a glance. */
622
+ .caf-field label { font-size: 0.68rem; font-weight: 500; color: var(--caf-muted); }
621
623
  .caf-field input, .caf-field select, .caf-field textarea {
622
624
  font: inherit; font-size: 0.95rem; padding: 0.5rem 0.6rem;
623
625
  border-radius: var(--caf-control-radius); border: 1px solid var(--caf-border);
@@ -651,7 +653,9 @@ const BASE_CSS = `
651
653
  .caf-row-sub { font-size: 0.78rem; color: var(--caf-muted); }
652
654
  .caf-panel-single { grid-template-columns: 1fr; }
653
655
  .caf-panel-single .caf-slot, .caf-panel-single > * { grid-column: span 1; }
654
- .caf-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 0.6rem; padding: 0.3rem 0.3rem 0.5rem; }
656
+ /* Bottom padding matches the inter-row rhythm so the toolbar doesn't sit
657
+ closer to the first row than rows sit to each other. */
658
+ .caf-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 0.6rem; padding: 0.3rem 0.3rem 0.75rem; }
655
659
  .caf-count { font-size: 0.8rem; color: var(--caf-muted); font-variant-numeric: tabular-nums; }
656
660
  .caf-btn {
657
661
  font: inherit; font-size: 0.85rem; font-weight: 600; cursor: pointer;
@@ -676,7 +680,8 @@ const BASE_CSS = `
676
680
  .caf-line-meta { display: flex; justify-content: space-between; align-items: baseline; gap: 0.6rem; }
677
681
  .caf-line-last { font-weight: 650; font-variant-numeric: tabular-nums; color: var(--caf-accent); }
678
682
  .caf-donut { display: flex; align-items: center; gap: 1.1rem; flex-wrap: wrap; }
679
- .caf-donut-svg { width: 110px; height: 110px; flex: none; transform: rotate(0.001deg); }
683
+ /* -3px optical correction: a circle beside flush-left text reads indented. */
684
+ .caf-donut-svg { width: 110px; height: 110px; flex: none; transform: rotate(0.001deg); margin-left: -3px; }
680
685
  .caf-donut-seg { fill: none; stroke-width: 6; }
681
686
  /* Capped width keeps each value NEXT TO its label in wide cards — the pair
682
687
  must read as a pair regardless of container width. */
@@ -769,7 +774,9 @@ const BASE_CSS = `
769
774
  .caf-collapse-head { box-shadow: 0 1px 2px rgba(0, 0, 0, 0.08); }
770
775
  .caf-collapse-head:hover { filter: brightness(0.97); }
771
776
  .caf-collapse-head:focus-visible { outline: 2px solid var(--caf-accent); outline-offset: 1px; }
772
- .caf-chevron { transition: transform 0.15s ease; color: var(--caf-muted); }
777
+ /* Accent chevron: the one interaction cue that distinguishes a collapsible
778
+ header from a static card title without breaking their shared typography. */
779
+ .caf-chevron { transition: transform 0.15s ease; color: var(--caf-accent); }
773
780
  .caf-chevron-closed { transform: rotate(-90deg); }
774
781
  .caf-block-fill { border: none; background: transparent; padding: 0; overflow: auto; min-height: 320px; }
775
782
  .caf-empty, .caf-loading { color: var(--caf-muted); font-size: 0.9rem; text-align: center; padding: 1.6rem 1rem; }
package/src/blocks.js CHANGED
@@ -464,7 +464,7 @@ export const BLOCKS = {
464
464
  chart: ChartBlock,
465
465
  timer: TimerBlock,
466
466
  actions: ActionsBlock,
467
- chat: ({ spec, ctx }) => h(ChatPanel, { cfg: spec.chat, ctx }),
467
+ chat: ({ spec, ctx }) => h(ChatPanel, { cfg: spec.chat, ctx, title: spec.title }),
468
468
  custom: CustomBlock,
469
469
  };
470
470
 
package/src/chat.js CHANGED
@@ -171,7 +171,7 @@ function Bubble({ m }) {
171
171
  // The embeddable core: everything the chat layout does, as a single column
172
172
  // that can live in a workspace sidebar (or any block slot) as well as fill
173
173
  // the whole app. One conversation per app — it persists under data.chat.
174
- export function ChatPanel({ cfg, ctx }) {
174
+ export function ChatPanel({ cfg, ctx, title }) {
175
175
  const c = cfg;
176
176
  const [draft, setDraft] = useState("");
177
177
  const [busy, setBusy] = useState(false);
@@ -250,6 +250,9 @@ export function ChatPanel({ cfg, ctx }) {
250
250
  h(
251
251
  "div",
252
252
  { className: "caf-block caf-chat-log" },
253
+ // Every other block opens with its title label — a chat card that
254
+ // starts straight at a bubble was the one heading-less block on screen.
255
+ title ? h("h2", { className: "caf-block-title" }, title) : null,
253
256
  c.greeting
254
257
  ? h("div", { className: "caf-msg caf-msg-assistant", dangerouslySetInnerHTML: { __html: renderMarkdown(c.greeting) } })
255
258
  : null,