{
  "$schema": "https://ui.shadcn.com/schema/registry-item.json",
  "name": "queue-vue",
  "title": "Queue (Vue)",
  "description": "The agent's to-do list, queued and completed, that people can reorder, send now, edit and clear, or the messages queued in a Composer.",
  "dependencies": [
    "@kind-ui/agent-ui@0.9.0",
    "@ui-sdk/core@0.1.0-beta.17",
    "@ui-sdk/vue@0.1.0-beta.17"
  ],
  "registryDependencies": [
    "@kind-ui/agent-ui-setup"
  ],
  "files": [
    {
      "path": "packages/agent-ui/src/vue/queue.ts",
      "content": "import { type QueueSectionState, queuePrimitive } from \"@kind-ui/agent-ui/core\";\nimport { createParts } from \"@ui-sdk/vue/primitive\";\nimport { type Component, defineComponent, h, type Slot, type VNodeChild } from \"vue\";\n\n// `@ui-sdk/vue`'s `createParts` hands the primitive an emitter for every callback, whether or not anything listens, so\n// `onReorder` and `onRemove`, whose presence offers moving and removing, are declared function props instead, which\n// `@reorder` and `@remove` bind.\nconst primitive = Object.defineProperty(\n  Object.assign((options: never) => queuePrimitive(options), queuePrimitive, {\n    options: { ...queuePrimitive.options, onReorder: \"action\", onRemove: \"action\" },\n  }),\n  \"name\",\n  { value: queuePrimitive.name },\n) as typeof queuePrimitive;\n\nconst parts = createParts(primitive, {\n  root: \"div\",\n  section: \"div\",\n  \"section-trigger\": \"button\",\n  \"section-content\": \"div\",\n  list: \"ul\",\n  item: \"li\",\n  \"item-icon\": \"span\",\n  \"item-title\": \"span\",\n  \"item-description\": \"span\",\n  \"item-send\": \"button\",\n  \"item-edit\": \"button\",\n  \"item-remove\": \"button\",\n  instructions: \"span\",\n});\n\n// A part whose default slot falls back to `fallback`, as React's default `children` do.\nconst withDefault = <State, Part extends Component = Component>(\n  part: Part,\n  name: string,\n  fallback: (scope: { state: State }) => VNodeChild,\n): Part =>\n  defineComponent({\n    name,\n    inheritAttrs: false,\n    setup(_, { attrs, slots }) {\n      return () => h(part as Component, attrs, { ...slots, default: slots.default ?? (fallback as Slot) });\n    },\n  }) as unknown as Part;\n\nexport const QueueSection = parts.Section;\nexport const QueueSectionContent = parts.SectionContent;\nexport const QueueItemIcon = parts.ItemIcon;\n/** Sends a queued item now, shown while `@send` is bound. Named \"Send now\"; an arrow unless you fill the slot. */\nexport const QueueItemSend = parts.ItemSend;\n/** Gives a queued item back to the Composer it's docked in, shown while `@edit` is bound. A pencil unless you fill the slot. */\nexport const QueueItemEdit = parts.ItemEdit;\n/** Removes an item, shown while `@remove` is bound. An ✕ unless you fill the slot. */\nexport const QueueItemRemove = parts.ItemRemove;\n\n/** The section's title and count, unless you fill the slot. */\nexport const QueueSectionTrigger = withDefault<QueueSectionState>(\n  parts.SectionTrigger,\n  \"QueueSectionTrigger\",\n  ({ state }) => [h(\"span\", { \"data-title\": \"\" }, state.title), h(\"span\", { \"data-count\": \"\" }, state.count)],\n);\n\n/** The item's `title`, unless you fill the slot. */\nexport const QueueItemTitle = withDefault<{ title: string }>(\n  parts.ItemTitle,\n  \"QueueItemTitle\",\n  ({ state }) => state.title,\n);\n\n/** The item's `description`, unless you fill the slot. Hidden while empty. */\nexport const QueueItemDescription = withDefault<{ description: string }>(\n  parts.ItemDescription,\n  \"QueueItemDescription\",\n  ({ state }) => state.description,\n);\n\n/**\n * The item whose `id` is `value`. Without a default slot, it shows the item's mark, title and description, then Send\n * now, Edit and Remove.\n */\nexport const QueueItem = withDefault(parts.Item, \"QueueItem\", () => [\n  h(QueueItemIcon),\n  h(\"span\", { \"data-text\": \"\" }, [h(QueueItemTitle), h(QueueItemDescription)]),\n  h(\"span\", { \"data-queue-actions\": \"\" }, [h(QueueItemSend), h(QueueItemEdit), h(QueueItemRemove)]),\n]);\n\n/** An item for each of the section's rows, unless you fill the slot. */\nexport const QueueList = withDefault<{ rows: readonly { item: { id: string } }[] }>(\n  parts.List,\n  \"QueueList\",\n  ({ state }) => state.rows.map((row) => h(QueueItem, { key: row.item.id, value: row.item.id })),\n);\n\n/** The keys that move and remove items, read with each item and hidden from sight, unless you fill the slot. */\nexport const QueueInstructions = withDefault<{ text: string }>(\n  parts.Instructions,\n  \"QueueInstructions\",\n  ({ state }) => state.text,\n);\n\nconst section = (value: \"pending\" | \"complete\") =>\n  h(QueueSection, { value }, () => [\n    h(QueueSectionTrigger),\n    h(QueueSectionContent, null, () => h(QueueList)),\n  ]);\n\nconst defaultParts = () => [section(\"pending\"), section(\"complete\"), h(QueueInstructions)];\n\n/**\n * The agent's queue: pending items under Queued, complete ones under Completed, each with a count. Moving, removing,\n * sending now and editing items are offered while `@reorder`, `@remove`, `@send` and `@edit` are bound. A default\n * slot replaces the default sections.\n */\nexport const Queue = withDefault(parts.Root, \"Queue\", defaultParts);\n",
      "type": "registry:ui",
      "target": "@ui/vue/queue.ts"
    }
  ],
  "meta": {
    "layer": "vue"
  },
  "type": "registry:ui"
}
