claude-artifact-framework 0.7.0 → 0.7.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/README.md CHANGED
@@ -12,7 +12,7 @@ mirrors npm packages automatically.
12
12
  ### As a global script (`<script>` tag)
13
13
 
14
14
  ```html
15
- <script src="https://cdn.jsdelivr.net/npm/claude-artifact-framework@0.7.0/dist/index.global.js"></script>
15
+ <script src="https://cdn.jsdelivr.net/npm/claude-artifact-framework@0.7.1/dist/index.global.js"></script>
16
16
  <script>
17
17
  const { storage, createStore, createPersistedStore, createSharedStore } = ArtifactKit;
18
18
  </script>
@@ -27,11 +27,11 @@ mirrors npm packages automatically.
27
27
  createStore,
28
28
  createPersistedStore,
29
29
  createSharedStore,
30
- } from "https://cdn.jsdelivr.net/npm/claude-artifact-framework@0.7.0/dist/index.esm.js";
30
+ } from "https://cdn.jsdelivr.net/npm/claude-artifact-framework@0.7.1/dist/index.esm.js";
31
31
  </script>
32
32
  ```
33
33
 
34
- Pin a version (`@0.7.0`) for reproducible artifacts, or drop the version
34
+ Pin a version (`@0.7.1`) for reproducible artifacts, or drop the version
35
35
  (`claude-artifact-framework/dist/...`) to always get the latest release.
36
36
 
37
37
  ### Inside a React artifact
@@ -315,6 +315,41 @@ Chat bubbles render the assistant's **markdown** (bold, code, lists,
315
315
  headings) automatically — HTML is escaped first, so model output can't
316
316
  inject markup.
317
317
 
318
+ ### The `workspace` layout — content + copilot
319
+
320
+ A full-width main column and a sidebar, for apps where content and an
321
+ assistant live side by side: an editor with a writing copilot, a dashboard
322
+ with an analyst, a viewer with an annotator. `chat` is available as a block,
323
+ so the copilot's tools can drive the main content:
324
+
325
+ ```js
326
+ ArtifactKit.createApp({
327
+ title: "Editor con copiloto",
328
+ layout: "workspace",
329
+ main: [
330
+ { fields: [{ key: "nota", type: "textarea", rows: 8 }], title: "Documento" },
331
+ { output: (d) => [{ label: "Palabras", value: countWords(d.nota), big: true }] },
332
+ ],
333
+ sidebar: [
334
+ { chat: {
335
+ system: (d) => "Sos un copiloto de escritura. Nota actual: " + (d.nota || ""),
336
+ tools: {
337
+ reescribir_nota: {
338
+ description: "Reemplaza el texto de la nota",
339
+ input: { texto: "string" },
340
+ run: (input, ctx) => { ctx.update((d) => { d.nota = input.texto; }); },
341
+ },
342
+ },
343
+ }},
344
+ ],
345
+ })
346
+ ```
347
+
348
+ `main` is required; `sidebar` is optional. Both take the same blocks as
349
+ `panel`. The panes sit side by side and stack on narrow screens. One chat
350
+ block per app — the conversation persists under `data.chat` and there is
351
+ exactly one.
352
+
318
353
  ## API reference
319
354
 
320
355
  Everything an app can declare, in one place.
@@ -323,11 +358,12 @@ Everything an app can declare, in one place.
323
358
  `records`, `steps`, `chat`, `data`, `shared`. Anything else throws.
324
359
 
325
360
  **Layouts** (`layout:`): `panel` (default — grid of blocks), `records` (CRUD
326
- list), `steps` (wizard), `chat` (conversation with Claude). Each requires its
327
- matching key (`blocks` / `records` / `steps` / `chat`).
361
+ list), `steps` (wizard), `chat` (conversation with Claude), `workspace`
362
+ (main column + sidebar). Each requires its matching key (`blocks` /
363
+ `records` / `steps` / `chat` / `main`+`sidebar`).
328
364
 
329
- **Block types** (entries of `blocks`): `fields`, `output`, `text`, `list`,
330
- `chart`, `timer`, `actions`, `custom`. One type per entry, plus optional `title`, `empty`,
365
+ **Block types** (entries of `blocks`, `main`, or `sidebar`): `fields`,
366
+ `output`, `text`, `list`, `chart`, `timer`, `actions`, `chat`, `custom`. One type per entry, plus optional `title`, `empty`,
331
367
  `wide`. In the `records` layout, `blocks` render below the list (never on the
332
368
  detail screen); their functions receive the same `data` object as everywhere
333
369
  else — the collection lives at `d.records`.