@signalcore/ui 1.0.0-beta.3 → 1.0.0-beta.4
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 +79 -0
- package/dist/AgentChat.d.ts +19 -3
- package/dist/AgentChat.js +149 -27
- package/dist/AgentChat.js.map +1 -1
- package/dist/AgentSpace.d.ts +14 -2
- package/dist/AgentSpace.js +3 -1
- package/dist/AgentSpace.js.map +1 -1
- package/dist/View.d.ts +48 -0
- package/dist/View.js +101 -0
- package/dist/View.js.map +1 -0
- package/dist/blocks.d.ts +83 -2
- package/dist/client.d.ts +9 -1
- package/dist/client.js +1 -0
- package/dist/client.js.map +1 -1
- package/dist/es.js +12 -0
- package/dist/es.js.map +1 -1
- package/dist/index.d.ts +11 -5
- package/dist/index.js +7 -1
- package/dist/kit/Agenda.d.ts +25 -0
- package/dist/kit/Agenda.js +119 -0
- package/dist/kit/Agenda.js.map +1 -0
- package/dist/kit/Combobox.js +1 -1
- package/dist/kit/DateField.js +1 -1
- package/dist/kit/Kanban.d.ts +17 -0
- package/dist/kit/Kanban.js +157 -0
- package/dist/kit/Kanban.js.map +1 -0
- package/dist/kit/TimeField.js +1 -1
- package/dist/kit/Timeline.d.ts +14 -0
- package/dist/kit/Timeline.js +71 -0
- package/dist/kit/Timeline.js.map +1 -0
- package/dist/kit/context.d.ts +1 -1
- package/dist/kit/context.js.map +1 -1
- package/dist/kit/messages.d.ts +22 -0
- package/dist/kit/messages.js +10 -0
- package/dist/kit/messages.js.map +1 -1
- package/dist/surface/Placed.d.ts +20 -0
- package/dist/surface/Placed.js +70 -0
- package/dist/surface/Placed.js.map +1 -0
- package/dist/surface/Surface.d.ts +4 -2
- package/dist/surface/Surface.js +78 -2
- package/dist/surface/Surface.js.map +1 -1
- package/dist/surface/places.d.ts +16 -0
- package/dist/surface/places.js +15 -0
- package/dist/surface/places.js.map +1 -0
- package/dist/surface/scope.d.ts +17 -1
- package/dist/surface/scope.js +1 -0
- package/dist/surface/scope.js.map +1 -1
- package/dist/types.d.ts +12 -0
- package/dist/types.js.map +1 -1
- package/dist/widget.js +17 -17
- package/package.json +1 -1
- package/src/AgentChat.tsx +215 -34
- package/src/AgentSpace.tsx +17 -1
- package/src/View.tsx +117 -0
- package/src/blocks.ts +100 -2
- package/src/client.ts +16 -0
- package/src/contract.ts +166 -5
- package/src/es.ts +9 -0
- package/src/index.ts +27 -2
- package/src/kit/Agenda.tsx +161 -0
- package/src/kit/Kanban.tsx +182 -0
- package/src/kit/Timeline.tsx +58 -0
- package/src/kit/context.tsx +45 -1
- package/src/kit/messages.ts +31 -0
- package/src/styles.css +568 -0
- package/src/surface/Placed.tsx +98 -0
- package/src/surface/Surface.tsx +92 -1
- package/src/surface/places.ts +19 -0
- package/src/surface/scope.ts +24 -1
- package/src/types.ts +13 -0
- package/src/widget/element.tsx +41 -3
package/dist/es.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"es.js","names":[],"sources":["../src/es.ts"],"sourcesContent":["/**\n * The package's words in Spanish, for the people an agent serves: the chat, the browser it drives,\n * the kit's controls (with an automation's and its runs'), a call and the agent's space. English\n * is every component's default; a host in Spanish passes these as `messages`, the calendar's\n * language as `locale` (`import { es } from \"@signalcore/ui/locale\"`).\n */\nimport type { ChatMessages } from \"./AgentChat\";\nimport type { SpaceMessages } from \"./AgentSpace\";\nimport type { TaskMessages } from \"./AgentTasks\";\nimport type { AutomationMessages, DayRef } from \"./automation/messages\";\nimport type { BrowserMessages } from \"./BrowserView\";\nimport type { KitMessages } from \"./kit/messages\";\nimport type { ThreadMessages } from \"./Threads\";\nimport type { VoiceCallMessages } from \"./VoiceCall\";\n\n/** The article before a time: \"la 1:00\", \"las 8:00\". */\nconst at = (time: string): string => `a ${time.startsWith(\"1:\") ? \"la\" : \"las\"} ${time}`;\n\nconst list = (items: readonly string[]): string => new Intl.ListFormat(\"es\").format(items);\n\n/** A weekday as the plural says it: \"los lunes\", \"los sábados\". */\nconst days = (name: string): string => (name.endsWith(\"s\") ? name : `${name}s`);\n\nconst capital = (text: string): string => text.charAt(0).toUpperCase() + text.slice(1);\n\n/** A day said after \"próxima\": \"hoy\", \"mañana\", \"el lunes\", \"el 3 nov\". */\nfunction nextDay(day: DayRef): string {\n switch (day.kind) {\n case \"today\":\n return \"hoy\";\n case \"tomorrow\":\n return \"mañana\";\n case \"yesterday\":\n return \"\";\n default:\n return `el ${day.name}`;\n }\n}\n\n/** A message sent on a channel, by the channel's kind: \"un WhatsApp\", \"un SMS\". */\nconst SENT: Readonly<Record<string, string>> = {\n whatsapp: \"un WhatsApp\",\n instagram: \"un mensaje de Instagram\",\n sms: \"un SMS\",\n};\n\n/** What an automation's tool call did, by what the tool's name says, done or (a test) not. */\nconst TOOL = {\n search: [(app: string) => `Buscó en ${app}`, (app: string) => `Buscó en ${app}`],\n send: [(app: string) => `Envió por ${app}`, (app: string) => `Habría enviado por ${app}`],\n create: [(app: string) => `Creó en ${app}`, (app: string) => `Habría creado en ${app}`],\n update: [(app: string) => `Cambió en ${app}`, (app: string) => `Habría cambiado en ${app}`],\n remove: [(app: string) => `Borró en ${app}`, (app: string) => `Habría borrado en ${app}`],\n use: [(app: string) => `Usó ${app}`, (app: string) => `Habría usado ${app}`],\n} as const;\n\nexport const AUTOMATION_MESSAGES_ES: AutomationMessages = {\n daily: \"Cada día\",\n weekdays: \"Cada día laborable\",\n weekends: \"Los fines de semana\",\n weekly: (names) =>\n names.length === 1 ? `Cada ${names[0] ?? \"\"}` : `Los ${list(names.map(days))}`,\n monthly: (numbers) =>\n numbers.length === 1\n ? `El día ${numbers[0] ?? \"\"} de cada mes`\n : `Los días ${list(numbers.map(String))} de cada mes`,\n at: (times) => list(times.map(at)),\n every: (count, unit) =>\n unit === \"minute\"\n ? count === 1\n ? \"Cada minuto\"\n : `Cada ${count} minutos`\n : count === 1\n ? \"Cada hora\"\n : `Cada ${count} horas`,\n between: (from, to) => `de ${from} a ${to}`,\n on: (often, when) => `${often}, ${when.charAt(0).toLowerCase()}${when.slice(1)}`,\n custom: \"Con un horario propio\",\n webhook: \"Cuando otro sistema la llama\",\n manual: \"Cuando alguien la inicia\",\n after: (automation) => (automation ? `Tras «${automation}»` : \"Tras otra automatización\"),\n platform: \"Cuando llega un mensaje\",\n event: (app, event) =>\n event\n ? `Cuando pasa «${event}» en ${app ?? \"una app\"}`\n : `Cuando pasa algo en ${app ?? \"una app\"}`,\n next: (day, time) =>\n [\"próxima\", nextDay(day), time === null ? \"\" : at(time)].filter(Boolean).join(\" \"),\n states: { active: \"Activa\", paused: \"En pausa\", failing: \"Falló la última\" },\n switchLabel: \"Activa\",\n steps: \"Pasos\",\n runs: \"Ejecuciones\",\n noRuns: \"Aún no se ha ejecutado.\",\n uses: {\n ai: \"IA\",\n agent: \"Agente\",\n notify: \"Aviso\",\n send: \"Mensaje\",\n data: \"Tabla\",\n http: \"Web\",\n },\n more: (count) => `+${count}`,\n gone: \"Esta automatización ya no existe.\",\n moment: (day, time) => {\n switch (day.kind) {\n case \"today\":\n return `Hoy ${time}`;\n case \"yesterday\":\n return `Ayer ${time}`;\n case \"tomorrow\":\n return `Mañana ${time}`;\n default:\n return `${capital(day.name)} ${time}`;\n }\n },\n by: (by, app) =>\n ({\n schedule: \"horario\",\n webhook: \"webhook\",\n event: app ? `evento de ${app}` : \"evento\",\n platform: \"un mensaje\",\n agent: \"se lo pidieron en el chat\",\n test: \"prueba\",\n api: \"tu app\",\n after: \"tras otra\",\n })[by],\n statuses: {\n running: \"En curso\",\n waiting: \"Esperando\",\n done: \"Hecha\",\n failed: \"Falló\",\n skipped: \"Omitida\",\n },\n dry: (summary) => `Prueba: ${summary}`,\n took: (ms) => {\n if (ms < 1000) return \"menos de 1 s\";\n const seconds = Math.round(ms / 1000);\n return seconds < 60 ? `${seconds} s` : `${Math.floor(seconds / 60)} min ${seconds % 60} s`;\n },\n opened: \"Conversaciones que abrió\",\n conversation: (index) => `Conversación ${index}`,\n askedIn: \"La conversación donde se lo pidieron\",\n noCalls: \"No llegó a hacer nada.\",\n outside: \"Fuera de los pasos\",\n times: (count) => `×${count}`,\n calls: {\n tool: (verb, app, would) => TOOL[verb][would ? 1 : 0](app),\n ai: \"Usó la IA\",\n notify: (would) => (would ? \"Habría avisado en la bandeja\" : \"Avisó en la bandeja\"),\n send: (channel, to, would) => {\n const sent = `${SENT[channel ?? \"\"] ?? \"un mensaje\"} a ${to || \"un contacto\"}`;\n return would ? `Habría enviado ${sent}` : `Envió ${sent}`;\n },\n start: (would) => (would ? \"Habría abierto una conversación\" : \"Abrió una conversación\"),\n find: (table) => `Consultó ${table}`,\n add: (table, would) =>\n would ? `Habría añadido una fila a ${table}` : `Añadió una fila a ${table}`,\n change: (table, would) =>\n would ? `Habría cambiado una fila de ${table}` : `Cambió una fila de ${table}`,\n http: (host, would) => (would ? `Habría llamado a ${host}` : `Llamó a ${host}`),\n files: \"Buscó en los archivos\",\n read: (file) => `Leyó ${file}`,\n wrote: (file, would) => (would ? `Habría guardado ${file}` : `Guardó ${file}`),\n listed: \"Miró sus archivos\",\n remember: (would) => (would ? \"Habría guardado un recuerdo\" : \"Guardó un recuerdo\"),\n recall: \"Buscó en lo aprendido\",\n },\n};\n\nconst FAMILIES: Readonly<Record<string, string>> = {\n image: \"imágenes\",\n video: \"vídeos\",\n audio: \"audios\",\n text: \"textos\",\n};\n\nexport const KIT_MESSAGES_ES: KitMessages = {\n required: \"Este campo es obligatorio\",\n chooseDate: \"Elige un día\",\n chooseTime: \"Elige una hora\",\n chooseMoment: \"Elige día y hora\",\n chooseOption: \"Elige una opción\",\n other: \"Otra respuesta\",\n otherPlaceholder: \"Escribe tu respuesta\",\n chooseRating: \"Elige una puntuación\",\n check: \"Marca la casilla para seguir\",\n invalidEmail: \"Correo no válido\",\n invalidPhone: \"Teléfono no válido\",\n invalidUrl: \"Dirección no válida\",\n invalidNumber: \"Escribe un número\",\n invalidTime: \"Escribe la hora así: 9:30\",\n atLeast: (min) => `Como mínimo ${min}`,\n atMost: (max) => `Como máximo ${max}`,\n unavailableDate: \"Ese día no está disponible\",\n unavailableTime: \"Esa hora no está disponible\",\n optional: \"Opcional\",\n pick: \"Elige…\",\n search: \"Buscar…\",\n noResults: \"Sin resultados\",\n show: \"Mostrar\",\n hide: \"Ocultar\",\n increase: \"Sumar\",\n decrease: \"Restar\",\n remove: (label) => `Quitar ${label}`,\n yes: \"Sí\",\n no: \"No\",\n rated: (value, max) => `${value} de ${max}`,\n stars: (count) => (count === 1 ? \"1 estrella\" : `${count} estrellas`),\n send: \"Enviar\",\n sent: \"Enviado\",\n chooseFile: \"Falta el archivo\",\n upload: (multiple) => (multiple ? \"Sube archivos\" : \"Sube un archivo\"),\n drop: \"Suelta aquí o elige\",\n limits: (kinds, size) => (kinds ? `${kinds}, hasta ${size}` : `Hasta ${size}`),\n anyOf: (family) => FAMILIES[family] ?? family,\n uploading: \"Subiendo\",\n tooBig: (size) => `Pasa de ${size}`,\n wrongType: \"Aquí no vale este tipo de archivo\",\n tooMany: (max) => `Como máximo ${max} archivos`,\n uploadFailed: \"No se ha podido subir\",\n retry: \"Reintentar\",\n stillUploading: \"Espera a que termine de subir\",\n fixFiles: \"Quita o reintenta los archivos con error\",\n open: (name) => `Abrir ${name}`,\n file: \"Archivo\",\n play: \"Reproducir\",\n pause: \"Pausar\",\n position: \"Posición\",\n automation: AUTOMATION_MESSAGES_ES,\n connect: {\n authorize: (app) => `Autorizar en ${app}`,\n connected: \"Conectada\",\n failed: \"No se ha podido conectar\",\n preparing: \"Preparando la conexión\",\n },\n};\n\nexport const BROWSER_MESSAGES_ES: BrowserMessages = {\n agent: (name) => `Lo controla ${name}`,\n agentMine: (name) => `${name}, en tu Chrome`,\n person: \"Lo controlas tú\",\n take: \"Tomar el control\",\n giveBack: \"Devolver\",\n handedOver: (name) => `${name} te pasa el navegador`,\n done: \"Listo, sigue\",\n closed: \"El navegador se cerró mientras te esperaba.\",\n close: \"Cerrar el navegador\",\n expand: \"Ampliar\",\n shrink: \"Reducir\",\n blank: \"Página en blanco\",\n screen: (where) => `Navegador: ${where}`,\n};\n\nexport const CHAT_MESSAGES_ES: ChatMessages = {\n placeholder: (name) => `Escribe a ${name}…`,\n connecting: \"Conectando…\",\n awaiting: \"Responde arriba para seguir…\",\n thinking: (name) => `${name} está pensando`,\n typing: \"Escribiendo\",\n working: \"Trabajando\",\n writing: \"Escribiendo\",\n elapsed: (seconds) => `${seconds} s`,\n escape: \"esc para detener\",\n done: (seconds) =>\n `Listo en ${seconds < 60 ? `${seconds} s` : `${Math.floor(seconds / 60)} min ${seconds % 60} s`}`,\n empty: (name) => `Habla con ${name}`,\n intro: () => \"\",\n send: \"Enviar\",\n attach: \"Adjuntar archivos\",\n drop: \"Suelta para adjuntar\",\n dictate: \"Dictar\",\n dictateStop: \"Parar y escribirlo\",\n dictation: {\n listening: \"Escuchando…\",\n writing: \"Escribiéndolo…\",\n failed: \"No te he oído: permite el micrófono e inténtalo otra vez\",\n },\n stop: \"Detener\",\n log: \"Conversación\",\n steps: {\n show: \"Muestra\",\n ask_person: \"Pregunta\",\n search_files: \"Busca en archivos\",\n read_file: \"Lee un archivo\",\n keep_file: \"Guarda un archivo\",\n remember: \"Recuerda\",\n recall: \"Busca en lo aprendido\",\n escalate: \"Pasa a una persona\",\n notify: \"Avisa\",\n data_find: \"Consulta una tabla\",\n data_add: \"Añade una fila\",\n data_update: \"Cambia una fila\",\n browser_open: \"Abre una página\",\n browser_read: \"Lee la página\",\n browser_click: \"Hace clic\",\n browser_fill: \"Rellena un campo\",\n browser_scroll: \"Desplaza la página\",\n browser_back: \"Vuelve atrás\",\n browser_submit: \"Envía en la web\",\n browser_hand_over: \"Te pasa el navegador\",\n browser_attach: \"Sube un archivo a la web\",\n browser_download: \"Guarda un archivo de la web\",\n browser_screenshot: \"Hace una captura de la web\",\n browser_record: \"Graba la web en vídeo\",\n browser_fill_key: \"Escribe una clave en la web\",\n ask_builder: \"Se lo pide al builder\",\n send_message: \"Envía un mensaje\",\n voice_note: \"Manda una nota de voz\",\n ai: \"Usa la IA\",\n call: \"Llama\",\n },\n failed: \"falló\",\n approval: \"Necesita tu aprobación\",\n request: (name, action) => `${name} quiere hacer «${action}»`,\n inputs: {},\n allow: \"Aprobar\",\n decline: \"Rechazar\",\n approvals: (count) => `${count} acciones esperan tu aprobación`,\n approveAll: \"Aprobar todo\",\n approveSome: (count) => `Aprobar ${count}`,\n declineAll: \"Rechazar todo\",\n confirming: \"Esperando la confirmación del negocio\",\n handedOff: \"Pasada a una persona\",\n handover: (holder, by, name) => {\n const automation = by.kind === \"automation\" ? ` por «${by.title}»` : \"\";\n switch (holder) {\n case \"agent\":\n if (by.kind === \"owner\") return `Devolviste la conversación a ${name}`;\n return `Se devolvió a ${name}${automation}`;\n case \"person\":\n if (by.kind === \"owner\") return `Pausaste a ${name}`;\n if (by.kind === \"agent\") return `${name} la pasó a una persona`;\n return `Pasó a una persona${automation}`;\n case \"nobody\":\n return `Ignorada${automation}`;\n }\n },\n skipped: \"No respondió\",\n cut: (heard) =>\n heard === \"\" ? \"Interrumpida antes de que se oyera nada\" : `Interrumpida tras «${heard}»`,\n write: \"Responde como el negocio…\",\n business: \"Tú\",\n voiceNote: \"Nota de voz\",\n delivery: {\n queued: \"Esperando para salir\",\n sent: \"Enviado\",\n delivered: \"Entregado\",\n read: \"Leído\",\n failed: \"No entregado\",\n },\n undelivered: (error) => (error ? `No entregado: ${error}` : \"No entregado\"),\n noTool: \"Esta página no puede hacer eso\",\n kit: KIT_MESSAGES_ES,\n browser: BROWSER_MESSAGES_ES,\n};\n\nexport const VOICE_CALL_MESSAGES_ES: VoiceCallMessages = {\n call: (name) => `Llamada con ${name}`,\n states: {\n connecting: \"Conectando…\",\n listening: \"Escuchando\",\n thinking: \"Pensando\",\n speaking: \"Hablando\",\n reconnecting: \"Reconectando…\",\n ended: \"Llamada terminada\",\n },\n calling: (name) => `Llamando a ${name}`,\n ended: {\n person: () => \"Has colgado\",\n agent: (name) => `${name} ha colgado`,\n limit: () => \"Se alcanzó la duración máxima\",\n dropped: () => \"Se cortó la llamada\",\n },\n problems: {\n denied: {\n title: () => \"Sin permiso para el micrófono\",\n help: \"Permite el micrófono a esta página (en el icono junto a la dirección) y vuelve a llamar.\",\n },\n nomic: {\n title: () => \"No hay ningún micrófono\",\n help: \"Conecta uno, o elige otro en los ajustes de sonido del sistema, y vuelve a llamar.\",\n },\n inuse: {\n title: () => \"El micrófono está ocupado\",\n help: \"Otra aplicación lo está usando. Ciérrala y vuelve a llamar.\",\n },\n unsupported: {\n title: () => \"Este navegador no puede llamar\",\n help: \"Abre la página por https en un Chrome, Edge, Safari o Firefox actual.\",\n },\n off: {\n title: () => \"Las llamadas no están activadas\",\n help: \"Este servicio aún no atiende llamadas. Escríbele mientras tanto.\",\n },\n builder: {\n title: (name) => `${name} no atiende llamadas`,\n help: \"Escríbele en el chat.\",\n },\n refused: {\n title: (name) => `${name} no puede atender la llamada`,\n help: \"Inténtalo de nuevo en un momento.\",\n },\n failed: {\n title: (name) => `No se ha podido llamar a ${name}`,\n help: \"Comprueba tu conexión y vuelve a intentarlo.\",\n },\n unanswered: {\n title: (name) => `${name} no contesta`,\n help: \"Ahora mismo no atiende llamadas. Inténtalo de nuevo en un momento.\",\n },\n },\n mute: \"Silenciar\",\n hangUp: \"Colgar\",\n keys: \"Espacio silencia y activa el micrófono\",\n muted: \"Tu micrófono está silenciado\",\n hear: (name) => `Oír a ${name}`,\n};\n\nexport const TASK_MESSAGES_ES: TaskMessages = {\n open: (count) =>\n count === 1 ? \"Tienes 1 tarea programada\" : `Tienes ${count} tareas programadas`,\n title: \"Tus tareas\",\n back: \"Volver a la conversación\",\n remove: \"Quitar\",\n empty: \"No hay nada programado. Pídele que te recuerde algo, o que te escriba más adelante.\",\n failed: \"No se ha podido cambiar. Inténtalo de nuevo.\",\n};\n\nexport const THREAD_MESSAGES_ES: ThreadMessages = {\n open: \"Conversaciones\",\n title: \"Tus conversaciones\",\n back: \"Volver a la conversación\",\n new: \"Nueva conversación\",\n untitled: \"Conversación nueva\",\n unread: (count) => (count === 1 ? \"1 mensaje sin leer\" : `${count} mensajes sin leer`),\n waiting: \"Te espera\",\n empty: \"Aún no hay nada aquí.\",\n};\n\nexport const SPACE_MESSAGES_ES: SpaceMessages = {\n modes: { label: \"Modo\", text: \"Texto\", voice: \"Voz\" },\n again: \"Volver a llamar\",\n close: \"Cerrar\",\n agent: \"Agente\",\n opening: \"Abriendo la conversación…\",\n failed: \"No se ha podido abrir la conversación.\",\n retry: \"Reintentar\",\n chat: CHAT_MESSAGES_ES,\n voice: VOICE_CALL_MESSAGES_ES,\n tasks: TASK_MESSAGES_ES,\n threads: THREAD_MESSAGES_ES,\n};\n"],"mappings":";;AAgBA,MAAM,MAAM,SAAyB,KAAK,KAAK,WAAW,IAAI,IAAI,OAAO,MAAM,GAAG;AAElF,MAAM,QAAQ,UAAqC,IAAI,KAAK,WAAW,IAAI,CAAC,CAAC,OAAO,KAAK;;AAGzF,MAAM,QAAQ,SAA0B,KAAK,SAAS,GAAG,IAAI,OAAO,GAAG,KAAK;AAE5E,MAAM,WAAW,SAAyB,KAAK,OAAO,CAAC,CAAC,CAAC,YAAY,IAAI,KAAK,MAAM,CAAC;;AAGrF,SAAS,QAAQ,KAAqB;CACpC,QAAQ,IAAI,MAAZ;EACE,KAAK,SACH,OAAO;EACT,KAAK,YACH,OAAO;EACT,KAAK,aACH,OAAO;EACT,SACE,OAAO,MAAM,IAAI;CACrB;AACF;;AAGA,MAAM,OAAyC;CAC7C,UAAU;CACV,WAAW;CACX,KAAK;AACP;;AAGA,MAAM,OAAO;CACX,QAAQ,EAAE,QAAgB,YAAY,QAAQ,QAAgB,YAAY,KAAK;CAC/E,MAAM,EAAE,QAAgB,aAAa,QAAQ,QAAgB,sBAAsB,KAAK;CACxF,QAAQ,EAAE,QAAgB,WAAW,QAAQ,QAAgB,oBAAoB,KAAK;CACtF,QAAQ,EAAE,QAAgB,aAAa,QAAQ,QAAgB,sBAAsB,KAAK;C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AAM;EACR;CACF;CACA,MAAM;CACN,QAAQ;CACR,MAAM;CACN,OAAO;CACP,OAAO,SAAS,SAAS;AAC3B;AAEA,MAAa,mBAAiC;CAC5C,OAAO,UACL,UAAU,IAAI,8BAA8B,UAAU,MAAM;CAC9D,OAAO;CACP,MAAM;CACN,QAAQ;CACR,OAAO;CACP,QAAQ;AACV;AAEA,MAAa,qBAAqC;CAChD,MAAM;CACN,OAAO;CACP,MAAM;CACN,KAAK;CACL,UAAU;CACV,SAAS,UAAW,UAAU,IAAI,uBAAuB,GAAG,MAAM;CAClE,SAAS;CACT,OAAO;AACT;AAEA,MAAa,oBAAmC;CAC9C,OAAO;EAAE,OAAO;EAAQ,MAAM;EAAS,OAAO;CAAM;CACpD,OAAO;CACP,OAAO;CACP,OAAO;CACP,SAAS;CACT,QAAQ;CACR,OAAO;CACP,MAAM;CACN,OAAO;CACP,OAAO;CACP,SAAS;AACX"}
|
|
1
|
+
{"version":3,"file":"es.js","names":[],"sources":["../src/es.ts"],"sourcesContent":["/**\n * The package's words in Spanish, for the people an agent serves: the chat, the browser it drives,\n * the kit's controls (with an automation's and its runs'), a call and the agent's space. English\n * is every component's default; a host in Spanish passes these as `messages`, the calendar's\n * language as `locale` (`import { es } from \"@signalcore/ui/locale\"`).\n */\nimport type { ChatMessages } from \"./AgentChat\";\nimport type { SpaceMessages } from \"./AgentSpace\";\nimport type { TaskMessages } from \"./AgentTasks\";\nimport type { AutomationMessages, DayRef } from \"./automation/messages\";\nimport type { BrowserMessages } from \"./BrowserView\";\nimport type { KitMessages } from \"./kit/messages\";\nimport type { ThreadMessages } from \"./Threads\";\nimport type { VoiceCallMessages } from \"./VoiceCall\";\n\n/** The article before a time: \"la 1:00\", \"las 8:00\". */\nconst at = (time: string): string => `a ${time.startsWith(\"1:\") ? \"la\" : \"las\"} ${time}`;\n\nconst list = (items: readonly string[]): string => new Intl.ListFormat(\"es\").format(items);\n\n/** A weekday as the plural says it: \"los lunes\", \"los sábados\". */\nconst days = (name: string): string => (name.endsWith(\"s\") ? name : `${name}s`);\n\nconst capital = (text: string): string => text.charAt(0).toUpperCase() + text.slice(1);\n\n/** A day said after \"próxima\": \"hoy\", \"mañana\", \"el lunes\", \"el 3 nov\". */\nfunction nextDay(day: DayRef): string {\n switch (day.kind) {\n case \"today\":\n return \"hoy\";\n case \"tomorrow\":\n return \"mañana\";\n case \"yesterday\":\n return \"\";\n default:\n return `el ${day.name}`;\n }\n}\n\n/** A message sent on a channel, by the channel's kind: \"un WhatsApp\", \"un SMS\". */\nconst SENT: Readonly<Record<string, string>> = {\n whatsapp: \"un WhatsApp\",\n instagram: \"un mensaje de Instagram\",\n sms: \"un SMS\",\n};\n\n/** What an automation's tool call did, by what the tool's name says, done or (a test) not. */\nconst TOOL = {\n search: [(app: string) => `Buscó en ${app}`, (app: string) => `Buscó en ${app}`],\n send: [(app: string) => `Envió por ${app}`, (app: string) => `Habría enviado por ${app}`],\n create: [(app: string) => `Creó en ${app}`, (app: string) => `Habría creado en ${app}`],\n update: [(app: string) => `Cambió en ${app}`, (app: string) => `Habría cambiado en ${app}`],\n remove: [(app: string) => `Borró en ${app}`, (app: string) => `Habría borrado en ${app}`],\n use: [(app: string) => `Usó ${app}`, (app: string) => `Habría usado ${app}`],\n} as const;\n\nexport const AUTOMATION_MESSAGES_ES: AutomationMessages = {\n daily: \"Cada día\",\n weekdays: \"Cada día laborable\",\n weekends: \"Los fines de semana\",\n weekly: (names) =>\n names.length === 1 ? `Cada ${names[0] ?? \"\"}` : `Los ${list(names.map(days))}`,\n monthly: (numbers) =>\n numbers.length === 1\n ? `El día ${numbers[0] ?? \"\"} de cada mes`\n : `Los días ${list(numbers.map(String))} de cada mes`,\n at: (times) => list(times.map(at)),\n every: (count, unit) =>\n unit === \"minute\"\n ? count === 1\n ? \"Cada minuto\"\n : `Cada ${count} minutos`\n : count === 1\n ? \"Cada hora\"\n : `Cada ${count} horas`,\n between: (from, to) => `de ${from} a ${to}`,\n on: (often, when) => `${often}, ${when.charAt(0).toLowerCase()}${when.slice(1)}`,\n custom: \"Con un horario propio\",\n webhook: \"Cuando otro sistema la llama\",\n manual: \"Cuando alguien la inicia\",\n after: (automation) => (automation ? `Tras «${automation}»` : \"Tras otra automatización\"),\n platform: \"Cuando llega un mensaje\",\n event: (app, event) =>\n event\n ? `Cuando pasa «${event}» en ${app ?? \"una app\"}`\n : `Cuando pasa algo en ${app ?? \"una app\"}`,\n next: (day, time) =>\n [\"próxima\", nextDay(day), time === null ? \"\" : at(time)].filter(Boolean).join(\" \"),\n states: { active: \"Activa\", paused: \"En pausa\", failing: \"Falló la última\" },\n switchLabel: \"Activa\",\n steps: \"Pasos\",\n runs: \"Ejecuciones\",\n noRuns: \"Aún no se ha ejecutado.\",\n uses: {\n ai: \"IA\",\n agent: \"Agente\",\n notify: \"Aviso\",\n send: \"Mensaje\",\n data: \"Tabla\",\n http: \"Web\",\n },\n more: (count) => `+${count}`,\n gone: \"Esta automatización ya no existe.\",\n moment: (day, time) => {\n switch (day.kind) {\n case \"today\":\n return `Hoy ${time}`;\n case \"yesterday\":\n return `Ayer ${time}`;\n case \"tomorrow\":\n return `Mañana ${time}`;\n default:\n return `${capital(day.name)} ${time}`;\n }\n },\n by: (by, app) =>\n ({\n schedule: \"horario\",\n webhook: \"webhook\",\n event: app ? `evento de ${app}` : \"evento\",\n platform: \"un mensaje\",\n agent: \"se lo pidieron en el chat\",\n test: \"prueba\",\n api: \"tu app\",\n after: \"tras otra\",\n })[by],\n statuses: {\n running: \"En curso\",\n waiting: \"Esperando\",\n done: \"Hecha\",\n failed: \"Falló\",\n skipped: \"Omitida\",\n },\n dry: (summary) => `Prueba: ${summary}`,\n took: (ms) => {\n if (ms < 1000) return \"menos de 1 s\";\n const seconds = Math.round(ms / 1000);\n return seconds < 60 ? `${seconds} s` : `${Math.floor(seconds / 60)} min ${seconds % 60} s`;\n },\n opened: \"Conversaciones que abrió\",\n conversation: (index) => `Conversación ${index}`,\n askedIn: \"La conversación donde se lo pidieron\",\n noCalls: \"No llegó a hacer nada.\",\n outside: \"Fuera de los pasos\",\n times: (count) => `×${count}`,\n calls: {\n tool: (verb, app, would) => TOOL[verb][would ? 1 : 0](app),\n ai: \"Usó la IA\",\n notify: (would) => (would ? \"Habría avisado en la bandeja\" : \"Avisó en la bandeja\"),\n send: (channel, to, would) => {\n const sent = `${SENT[channel ?? \"\"] ?? \"un mensaje\"} a ${to || \"un contacto\"}`;\n return would ? `Habría enviado ${sent}` : `Envió ${sent}`;\n },\n start: (would) => (would ? \"Habría abierto una conversación\" : \"Abrió una conversación\"),\n find: (table) => `Consultó ${table}`,\n add: (table, would) =>\n would ? `Habría añadido una fila a ${table}` : `Añadió una fila a ${table}`,\n change: (table, would) =>\n would ? `Habría cambiado una fila de ${table}` : `Cambió una fila de ${table}`,\n http: (host, would) => (would ? `Habría llamado a ${host}` : `Llamó a ${host}`),\n files: \"Buscó en los archivos\",\n read: (file) => `Leyó ${file}`,\n wrote: (file, would) => (would ? `Habría guardado ${file}` : `Guardó ${file}`),\n listed: \"Miró sus archivos\",\n remember: (would) => (would ? \"Habría guardado un recuerdo\" : \"Guardó un recuerdo\"),\n recall: \"Buscó en lo aprendido\",\n },\n};\n\nconst FAMILIES: Readonly<Record<string, string>> = {\n image: \"imágenes\",\n video: \"vídeos\",\n audio: \"audios\",\n text: \"textos\",\n};\n\nexport const KIT_MESSAGES_ES: KitMessages = {\n required: \"Este campo es obligatorio\",\n chooseDate: \"Elige un día\",\n chooseTime: \"Elige una hora\",\n chooseMoment: \"Elige día y hora\",\n chooseOption: \"Elige una opción\",\n other: \"Otra respuesta\",\n otherPlaceholder: \"Escribe tu respuesta\",\n chooseRating: \"Elige una puntuación\",\n check: \"Marca la casilla para seguir\",\n invalidEmail: \"Correo no válido\",\n invalidPhone: \"Teléfono no válido\",\n invalidUrl: \"Dirección no válida\",\n invalidNumber: \"Escribe un número\",\n invalidTime: \"Escribe la hora así: 9:30\",\n atLeast: (min) => `Como mínimo ${min}`,\n atMost: (max) => `Como máximo ${max}`,\n unavailableDate: \"Ese día no está disponible\",\n unavailableTime: \"Esa hora no está disponible\",\n optional: \"Opcional\",\n pick: \"Elige…\",\n search: \"Buscar…\",\n noResults: \"Sin resultados\",\n show: \"Mostrar\",\n hide: \"Ocultar\",\n increase: \"Sumar\",\n decrease: \"Restar\",\n remove: (label) => `Quitar ${label}`,\n yes: \"Sí\",\n no: \"No\",\n rated: (value, max) => `${value} de ${max}`,\n stars: (count) => (count === 1 ? \"1 estrella\" : `${count} estrellas`),\n send: \"Enviar\",\n sent: \"Enviado\",\n chooseFile: \"Falta el archivo\",\n upload: (multiple) => (multiple ? \"Sube archivos\" : \"Sube un archivo\"),\n drop: \"Suelta aquí o elige\",\n limits: (kinds, size) => (kinds ? `${kinds}, hasta ${size}` : `Hasta ${size}`),\n anyOf: (family) => FAMILIES[family] ?? family,\n uploading: \"Subiendo\",\n tooBig: (size) => `Pasa de ${size}`,\n wrongType: \"Aquí no vale este tipo de archivo\",\n tooMany: (max) => `Como máximo ${max} archivos`,\n uploadFailed: \"No se ha podido subir\",\n retry: \"Reintentar\",\n stillUploading: \"Espera a que termine de subir\",\n fixFiles: \"Quita o reintenta los archivos con error\",\n open: (name) => `Abrir ${name}`,\n file: \"Archivo\",\n play: \"Reproducir\",\n pause: \"Pausar\",\n position: \"Posición\",\n automation: AUTOMATION_MESSAGES_ES,\n connect: {\n authorize: (app) => `Autorizar en ${app}`,\n connected: \"Conectada\",\n failed: \"No se ha podido conectar\",\n preparing: \"Preparando la conexión\",\n },\n calendar: { allDay: \"Todo el día\", empty: \"Nada previsto\" },\n board: {\n move: (card) => `Mover ${card}`,\n moveTo: \"Mover a\",\n moved: (card, column) => `${card} a ${column}`,\n empty: \"Nada aquí\",\n },\n};\n\nexport const BROWSER_MESSAGES_ES: BrowserMessages = {\n agent: (name) => `Lo controla ${name}`,\n agentMine: (name) => `${name}, en tu Chrome`,\n person: \"Lo controlas tú\",\n take: \"Tomar el control\",\n giveBack: \"Devolver\",\n handedOver: (name) => `${name} te pasa el navegador`,\n done: \"Listo, sigue\",\n closed: \"El navegador se cerró mientras te esperaba.\",\n close: \"Cerrar el navegador\",\n expand: \"Ampliar\",\n shrink: \"Reducir\",\n blank: \"Página en blanco\",\n screen: (where) => `Navegador: ${where}`,\n};\n\nexport const CHAT_MESSAGES_ES: ChatMessages = {\n placeholder: (name) => `Escribe a ${name}…`,\n connecting: \"Conectando…\",\n awaiting: \"Responde arriba para seguir…\",\n thinking: (name) => `${name} está pensando`,\n typing: \"Escribiendo\",\n working: \"Trabajando\",\n writing: \"Escribiendo\",\n elapsed: (seconds) => `${seconds} s`,\n escape: \"esc para detener\",\n done: (seconds) =>\n `Listo en ${seconds < 60 ? `${seconds} s` : `${Math.floor(seconds / 60)} min ${seconds % 60} s`}`,\n empty: (name) => `Habla con ${name}`,\n intro: () => \"\",\n send: \"Enviar\",\n attach: \"Adjuntar archivos\",\n drop: \"Suelta para adjuntar\",\n dictate: \"Dictar\",\n dictateStop: \"Parar y escribirlo\",\n dictation: {\n listening: \"Escuchando…\",\n writing: \"Escribiéndolo…\",\n failed: \"No te he oído: permite el micrófono e inténtalo otra vez\",\n },\n stop: \"Detener\",\n log: \"Conversación\",\n steps: {\n show: \"Muestra\",\n ask_person: \"Pregunta\",\n search_files: \"Busca en archivos\",\n read_file: \"Lee un archivo\",\n keep_file: \"Guarda un archivo\",\n remember: \"Recuerda\",\n recall: \"Busca en lo aprendido\",\n escalate: \"Pasa a una persona\",\n notify: \"Avisa\",\n data_find: \"Consulta una tabla\",\n data_add: \"Añade una fila\",\n data_update: \"Cambia una fila\",\n browser_open: \"Abre una página\",\n browser_read: \"Lee la página\",\n browser_click: \"Hace clic\",\n browser_fill: \"Rellena un campo\",\n browser_scroll: \"Desplaza la página\",\n browser_back: \"Vuelve atrás\",\n browser_submit: \"Envía en la web\",\n browser_hand_over: \"Te pasa el navegador\",\n browser_attach: \"Sube un archivo a la web\",\n browser_download: \"Guarda un archivo de la web\",\n browser_screenshot: \"Hace una captura de la web\",\n browser_record: \"Graba la web en vídeo\",\n browser_fill_key: \"Escribe una clave en la web\",\n ask_builder: \"Se lo pide al builder\",\n send_message: \"Envía un mensaje\",\n voice_note: \"Manda una nota de voz\",\n ai: \"Usa la IA\",\n call: \"Llama\",\n },\n failed: \"falló\",\n approval: \"Necesita tu aprobación\",\n request: (name, action) => `${name} quiere hacer «${action}»`,\n inputs: {},\n allow: \"Aprobar\",\n decline: \"Rechazar\",\n approvals: (count) => `${count} acciones esperan tu aprobación`,\n approveAll: \"Aprobar todo\",\n approveSome: (count) => `Aprobar ${count}`,\n declineAll: \"Rechazar todo\",\n confirming: \"Esperando la confirmación del negocio\",\n handedOff: \"Pasada a una persona\",\n opened: (name, title) => `${name} abrió ${title}`,\n closePlaced: \"Cerrar\",\n handover: (holder, by, name) => {\n const automation = by.kind === \"automation\" ? ` por «${by.title}»` : \"\";\n switch (holder) {\n case \"agent\":\n if (by.kind === \"owner\") return `Devolviste la conversación a ${name}`;\n return `Se devolvió a ${name}${automation}`;\n case \"person\":\n if (by.kind === \"owner\") return `Pausaste a ${name}`;\n if (by.kind === \"agent\") return `${name} la pasó a una persona`;\n return `Pasó a una persona${automation}`;\n case \"nobody\":\n return `Ignorada${automation}`;\n }\n },\n skipped: \"No respondió\",\n cut: (heard) =>\n heard === \"\" ? \"Interrumpida antes de que se oyera nada\" : `Interrumpida tras «${heard}»`,\n write: \"Responde como el negocio…\",\n business: \"Tú\",\n voiceNote: \"Nota de voz\",\n delivery: {\n queued: \"Esperando para salir\",\n sent: \"Enviado\",\n delivered: \"Entregado\",\n read: \"Leído\",\n failed: \"No entregado\",\n },\n undelivered: (error) => (error ? `No entregado: ${error}` : \"No entregado\"),\n noTool: \"Esta página no puede hacer eso\",\n kit: KIT_MESSAGES_ES,\n browser: BROWSER_MESSAGES_ES,\n};\n\nexport const VOICE_CALL_MESSAGES_ES: VoiceCallMessages = {\n call: (name) => `Llamada con ${name}`,\n states: {\n connecting: \"Conectando…\",\n listening: \"Escuchando\",\n thinking: \"Pensando\",\n speaking: \"Hablando\",\n reconnecting: \"Reconectando…\",\n ended: \"Llamada terminada\",\n },\n calling: (name) => `Llamando a ${name}`,\n ended: {\n person: () => \"Has colgado\",\n agent: (name) => `${name} ha colgado`,\n limit: () => \"Se alcanzó la duración máxima\",\n dropped: () => \"Se cortó la llamada\",\n },\n problems: {\n denied: {\n title: () => \"Sin permiso para el micrófono\",\n help: \"Permite el micrófono a esta página (en el icono junto a la dirección) y vuelve a llamar.\",\n },\n nomic: {\n title: () => \"No hay ningún micrófono\",\n help: \"Conecta uno, o elige otro en los ajustes de sonido del sistema, y vuelve a llamar.\",\n },\n inuse: {\n title: () => \"El micrófono está ocupado\",\n help: \"Otra aplicación lo está usando. Ciérrala y vuelve a llamar.\",\n },\n unsupported: {\n title: () => \"Este navegador no puede llamar\",\n help: \"Abre la página por https en un Chrome, Edge, Safari o Firefox actual.\",\n },\n off: {\n title: () => \"Las llamadas no están activadas\",\n help: \"Este servicio aún no atiende llamadas. Escríbele mientras tanto.\",\n },\n builder: {\n title: (name) => `${name} no atiende llamadas`,\n help: \"Escríbele en el chat.\",\n },\n refused: {\n title: (name) => `${name} no puede atender la llamada`,\n help: \"Inténtalo de nuevo en un momento.\",\n },\n failed: {\n title: (name) => `No se ha podido llamar a ${name}`,\n help: \"Comprueba tu conexión y vuelve a intentarlo.\",\n },\n unanswered: {\n title: (name) => `${name} no contesta`,\n help: \"Ahora mismo no atiende llamadas. Inténtalo de nuevo en un momento.\",\n },\n },\n mute: \"Silenciar\",\n hangUp: \"Colgar\",\n keys: \"Espacio silencia y activa el micrófono\",\n muted: \"Tu micrófono está silenciado\",\n hear: (name) => `Oír a ${name}`,\n};\n\nexport const TASK_MESSAGES_ES: TaskMessages = {\n open: (count) =>\n count === 1 ? \"Tienes 1 tarea programada\" : `Tienes ${count} tareas programadas`,\n title: \"Tus tareas\",\n back: \"Volver a la conversación\",\n remove: \"Quitar\",\n empty: \"No hay nada programado. Pídele que te recuerde algo, o que te escriba más adelante.\",\n failed: \"No se ha podido cambiar. Inténtalo de nuevo.\",\n};\n\nexport const THREAD_MESSAGES_ES: ThreadMessages = {\n open: \"Conversaciones\",\n title: \"Tus conversaciones\",\n back: \"Volver a la conversación\",\n new: \"Nueva conversación\",\n untitled: \"Conversación nueva\",\n unread: (count) => (count === 1 ? \"1 mensaje sin leer\" : `${count} mensajes sin leer`),\n waiting: \"Te espera\",\n empty: \"Aún no hay nada aquí.\",\n};\n\nexport const SPACE_MESSAGES_ES: SpaceMessages = {\n modes: { label: \"Modo\", text: \"Texto\", voice: \"Voz\" },\n again: \"Volver a llamar\",\n close: \"Cerrar\",\n agent: \"Agente\",\n opening: \"Abriendo la conversación…\",\n failed: \"No se ha podido abrir la conversación.\",\n retry: \"Reintentar\",\n chat: CHAT_MESSAGES_ES,\n voice: VOICE_CALL_MESSAGES_ES,\n tasks: TASK_MESSAGES_ES,\n threads: THREAD_MESSAGES_ES,\n};\n"],"mappings":";;AAgBA,MAAM,MAAM,SAAyB,KAAK,KAAK,WAAW,IAAI,IAAI,OAAO,MAAM,GAAG;AAElF,MAAM,QAAQ,UAAqC,IAAI,KAAK,WAAW,IAAI,CAAC,CAAC,OAAO,KAAK;;AAGzF,MAAM,QAAQ,SAA0B,KAAK,SAAS,GAAG,IAAI,OAAO,GAAG,KAAK;AAE5E,MAAM,WAAW,SAAyB,KAAK,OAAO,CAAC,CAAC,CAAC,YAAY,IAAI,KAAK,MAAM,CAAC;;AAGrF,SAAS,QAAQ,KAAqB;CACpC,QAAQ,IAAI,MAAZ;EACE,KAAK,SACH,OAAO;EACT,KAAK,YACH,OAAO;EACT,KAAK,aACH,OAAO;EACT,SACE,OAAO,MAAM,IAAI;CACrB;AACF;;AAGA,MAAM,OAAyC;CAC7C,UAAU;CACV,WAAW;CACX,KAAK;AACP;;AAGA,MAAM,OAAO;CACX,QAAQ,EAAE,QAAgB,YAAY,QAAQ,QAAgB,YAAY,KAAK;CAC/E,MAAM,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AM;EACR;EACA,OAAO;GACL,aAAa;GACb,MAAM;EACR;EACA,OAAO;GACL,aAAa;GACb,MAAM;EACR;EACA,aAAa;GACX,aAAa;GACb,MAAM;EACR;EACA,KAAK;GACH,aAAa;GACb,MAAM;EACR;EACA,SAAS;GACP,QAAQ,SAAS,GAAG,KAAK;GACzB,MAAM;EACR;EACA,SAAS;GACP,QAAQ,SAAS,GAAG,KAAK;GACzB,MAAM;EACR;EACA,QAAQ;GACN,QAAQ,SAAS,4BAA4B;GAC7C,MAAM;EACR;EACA,YAAY;GACV,QAAQ,SAAS,GAAG,KAAK;GACzB,MAAM;EACR;CACF;CACA,MAAM;CACN,QAAQ;CACR,MAAM;CACN,OAAO;CACP,OAAO,SAAS,SAAS;AAC3B;AAEA,MAAa,mBAAiC;CAC5C,OAAO,UACL,UAAU,IAAI,8BAA8B,UAAU,MAAM;CAC9D,OAAO;CACP,MAAM;CACN,QAAQ;CACR,OAAO;CACP,QAAQ;AACV;AAEA,MAAa,qBAAqC;CAChD,MAAM;CACN,OAAO;CACP,MAAM;CACN,KAAK;CACL,UAAU;CACV,SAAS,UAAW,UAAU,IAAI,uBAAuB,GAAG,MAAM;CAClE,SAAS;CACT,OAAO;AACT;AAEA,MAAa,oBAAmC;CAC9C,OAAO;EAAE,OAAO;EAAQ,MAAM;EAAS,OAAO;CAAM;CACpD,OAAO;CACP,OAAO;CACP,OAAO;CACP,SAAS;CACT,QAAQ;CACR,OAAO;CACP,MAAM;CACN,OAAO;CACP,OAAO;CACP,SAAS;AACX"}
|
package/dist/index.d.ts
CHANGED
|
@@ -2,11 +2,11 @@ import { formatSize } from "./kit/numbers.js";
|
|
|
2
2
|
import { About, AboutOut, AboutState, ActionFact, AskFact, AutomationFact, AutomationKind, ChannelFact, ChannelKind, ConnectionFact, DataFact, DeviceFact, DeviceKind, Does, Facts, FileFact, ICONS, Icon, MemoryFact, Provider, StatusTone, TOPICS, Told, Topic, VaultFact, aboutState, actionWords, appSteps, appTitle, automationsOf, countOf, generatedName, namesOf, toneOf, toolName, toolTitle } from "./about.js";
|
|
3
3
|
import { Automation as Automation$1, AutomationState, AutomationView, Board, Run, RunBy, RunRecord, RunStatus, RunStep, Step, Task, Trigger, Use, taskCard } from "./automation/types.js";
|
|
4
4
|
import { Credentials, Speaker, VISITOR_KEY } from "./credentials.js";
|
|
5
|
-
import { AutomationBlock, Block, ButtonBlock, CardBlock, ChartBlock, ChartPoint, ChoiceBlock, DividerBlock, Entry, FieldKind, FieldValue, FieldsBlock, FormBlock, FormField, ImageBlock, ListBlock, NoteBlock, Option, StackBlock, StatBlock, Surface as Surface$1, TableBlock, TextBlock, Tone } from "./blocks.js";
|
|
6
|
-
import { Action, AgentFace, Attachment, Author, BrowserControl, BrowserFrame, BrowserInput, BrowserState, BrowserWhere, CallGlance, CallReason, CallToken, Channel, ChannelGlance, ChannelSettings, ChannelStatus, ChannelWeb, ContactGlance, ConversationDetail, ConversationFile, ConversationPerson, Decides, Decision, Delivery, FileAt, FileBlock, FileIndex, FilePreview, Handover, Holder, HoursSpan, Message, Request, Step as Step$1, StepApp, StepState, StoredFile, ToolCall, WIDGET_FONTS, WeekHours, Weekday, WidgetConfig, WidgetFont, WidgetLook } from "./types.js";
|
|
5
|
+
import { AutomationBlock, Block, BoardBlock, BoardCard, BoardColumn, ButtonBlock, CalendarBlock, CalendarEvent, CardBlock, ChartBlock, ChartPoint, ChoiceBlock, DividerBlock, Entry, FieldKind, FieldValue, FieldsBlock, FormBlock, FormField, HostBlock, ImageBlock, ListBlock, NoteBlock, Option, Place, StackBlock, StatBlock, Surface as Surface$1, TableBlock, TextBlock, TimelineBlock, TimelineItem, Tone } from "./blocks.js";
|
|
6
|
+
import { Action, AgentFace, Attachment, Author, BrowserControl, BrowserFrame, BrowserInput, BrowserState, BrowserWhere, CallGlance, CallReason, CallToken, Channel, ChannelGlance, ChannelSettings, ChannelStatus, ChannelWeb, ContactGlance, ConversationDetail, ConversationFile, ConversationPerson, Decides, Decision, Delivery, FileAt, FileBlock, FileIndex, FilePreview, Handover, Holder, HoursSpan, Message, Request, Step as Step$1, StepApp, StepState, StoredFile, ToolCall, ViewRendered, WIDGET_FONTS, WeekHours, Weekday, WidgetConfig, WidgetFont, WidgetLook } from "./types.js";
|
|
7
7
|
import { ApiError, Client, ClientOptions, Files, UploadOptions, createClient } from "./client.js";
|
|
8
8
|
import { AUTOMATION_MESSAGES, AutomationMessages, CallMessages, DayRef, Verb } from "./automation/messages.js";
|
|
9
|
-
import { KIT_MESSAGES, KitLocale, KitMessages } from "./kit/messages.js";
|
|
9
|
+
import { BoardMessages, CalendarMessages, KIT_MESSAGES, KitLocale, KitMessages } from "./kit/messages.js";
|
|
10
10
|
import { KitClassNames, KitPart, KitProvider } from "./kit/context.js";
|
|
11
11
|
import { ABOUT_HOME, ABOUT_MESSAGES, AboutControls, AboutMessages, AboutPart, AboutTools, AboutView, AgentAbout, AgentAboutProps, AppDirectory, aboutBack } from "./AgentAbout.js";
|
|
12
12
|
import { AGENT_ICONS, AgentIcon, agentGlyph } from "./agentIcons.js";
|
|
@@ -20,9 +20,11 @@ import { FILES_PER_MESSAGE, Frame, TOOL_ERROR_MAX, ToolResult, UpFrame, toolResu
|
|
|
20
20
|
import { LiveConversation, NO_TOOL, ToolHandler, useConversation } from "./useConversation.js";
|
|
21
21
|
import { BROWSER_MESSAGES, BrowserMessages, BrowserPart, BrowserView, BrowserViewProps } from "./BrowserView.js";
|
|
22
22
|
import { Dictate, Dictation, useDictation } from "./useDictation.js";
|
|
23
|
+
import { Placed, PlacedPart } from "./surface/Placed.js";
|
|
24
|
+
import { EVERY_PLACE, SurfacePlaces, placeOf } from "./surface/places.js";
|
|
23
25
|
import { FileFamily, FileHost, MAX_MB, Uploader, accepts, familyOf } from "./kit/uploads.js";
|
|
24
26
|
import { SurfaceAction, Values, chosen, filled, labelOf, picked, pressed, problemOf } from "./surface/values.js";
|
|
25
|
-
import { BlockProps, SurfaceComponents, SurfacePart } from "./surface/scope.js";
|
|
27
|
+
import { BlockProps, HostBlockProps, HostBlocks, SurfaceComponents, SurfacePart } from "./surface/scope.js";
|
|
26
28
|
import { AgentChat, AgentChatProps, CHAT_MESSAGES, ChatCompose, ChatLook, ChatMessages, ChatPart, ChatSteps, HandoverBy } from "./AgentChat.js";
|
|
27
29
|
import { Conversation, ConversationProps, THREADS_POLL_MS, THREAD_MESSAGES, ThreadMessages, ThreadPart, Threads, ThreadsProps, Unread, useUnread } from "./Threads.js";
|
|
28
30
|
import { AgentCard, AgentCardProps, CardField, CardPart } from "./AgentCard.js";
|
|
@@ -38,6 +40,8 @@ import { Orb } from "./voice/Orb.js";
|
|
|
38
40
|
import { FILE_MESSAGES, FileMessages, FilePart, FileView, FileViewProps } from "./FileView.js";
|
|
39
41
|
import { Preview, cleanDocument, previewOf } from "./files.js";
|
|
40
42
|
import { Button, ButtonProps } from "./kit/Button.js";
|
|
43
|
+
import { Agenda, daysOf, hoursOf } from "./kit/Agenda.js";
|
|
44
|
+
import { Kanban, placed } from "./kit/Kanban.js";
|
|
41
45
|
import { Card } from "./kit/Card.js";
|
|
42
46
|
import { ControlBase, Field, FieldIds } from "./kit/Field.js";
|
|
43
47
|
import { Chips, Choices } from "./kit/Choices.js";
|
|
@@ -56,9 +60,11 @@ import { RatingField } from "./kit/RatingField.js";
|
|
|
56
60
|
import { Switch, SwitchProps } from "./kit/Switch.js";
|
|
57
61
|
import { AudioPlayer, AudioPlayerProps } from "./kit/AudioPlayer.js";
|
|
58
62
|
import { Tag } from "./kit/Tag.js";
|
|
63
|
+
import { Timeline, formatWhen } from "./kit/Timeline.js";
|
|
59
64
|
import { Tile, TileProps, Tiles } from "./kit/Tile.js";
|
|
60
65
|
import { DateTimeField, DateTimeFieldProps, TimeField, TimeFieldProps } from "./kit/TimeField.js";
|
|
61
66
|
import { Surface, SurfaceProps } from "./surface/Surface.js";
|
|
62
67
|
import { FaceRead, useAgentFace } from "./useAgentFace.js";
|
|
68
|
+
import { VIEW_POLL_MS, View, ViewProps, ViewRead, useView } from "./View.js";
|
|
63
69
|
import { Live, LiveHandlers, useLive } from "./useLive.js";
|
|
64
|
-
export { ABOUT_HOME, ABOUT_MESSAGES, AGENT_ICONS, AUTOMATION_MESSAGES, AUTOMATION_MESSAGES_ES, type About, type AboutControls, type AboutMessages, type AboutOut, type AboutPart, type AboutState, type AboutTools, type AboutView, type Action, type ActionFact, AgentAbout, type AgentAboutProps, type AgentActivity, AgentCard, type AgentCardProps, AgentChat, type AgentChatProps, type AgentFace, type AgentIcon, AgentSpace, type AgentSpaceProps, AgentTasks, type AgentTasksProps, type AgentTint, ApiError, type AppDirectory, type AskFact, type Attachment, AudioPlayer, type AudioPlayerProps, type Author, Automation, type AutomationBlock, type Automation$1 as AutomationData, type AutomationFact, type AutomationKind, type AutomationMessages, type AutomationProps, type AutomationState, type Step as AutomationStep, type AutomationView, BROWSER_MESSAGES, BROWSER_MESSAGES_ES, type Block, type BlockProps, type Board, type BrowserControl, type BrowserFrame, type BrowserInput, type BrowserMessages, type BrowserPart, type BrowserState, BrowserView, type BrowserViewProps, type BrowserWhere, Button, type ButtonBlock, type ButtonProps, CHAT_MESSAGES, CHAT_MESSAGES_ES, type Call, type CallEnd, type CallEndedBy, type CallGlance, type CallJoin, type CallLine, type CallLook, type CallMessages, type CallMeter, type CallProblem, type CallReason, type CallState, type CallToken, Card, type CardBlock, type CardField, type CardPart, type Channel, type ChannelFact, type ChannelGlance, type ChannelKind, type ChannelSettings, type ChannelStatus, type ChannelWeb, type ChartBlock, type ChartPoint, type ChatCompose, type ChatLook, type ChatMessages, type ChatPart, type ChatSteps, Checkbox, Chips, type ChoiceBlock, Choices, type Client, type ClientOptions, Combobox, type ComboboxProps, type ConnectionFact, type ContactGlance, type ControlBase, Conversation, type ConversationDetail, type ConversationFile, type ConversationPerson, type ConversationProps, type Credentials, type Cron, type DataFact, DateField, type DateFieldProps, DateTimeField, type DateTimeFieldProps, type DayRef, type Decides, type Decision, type Delivery, type DeviceFact, type DeviceKind, type Dictate, type Dictation, type DividerBlock, type Does, type Entry, FILES_PER_MESSAGE, FILE_MESSAGES, type FaceRead, type Facts, Field, type FieldIds, type FieldKind, type FieldValue, type FieldsBlock, type FileAt, type FileBlock, FileChip, type FileChipProps, FileChips, type FileFact, type FileFamily, FileField, type FileFieldProps, type FileHost, type FileIndex, FileMark, type FileMessages, type FilePart, type FilePreview, FileView, type FileViewProps, type Files, type FormBlock, type FormField, type Frame, type Handover, type HandoverBy, type Holder, type HoursSpan, ICONS, type Icon, type ImageBlock, KIT_MESSAGES, KIT_MESSAGES_ES, type KitClassNames, type KitLocale, type KitMessages, type KitPart, KitProvider, List, type ListBlock, type Live, type LiveConversation, type LiveHandlers, MAX_MB, Mark, type MarkProps, MarkStack, type MemoryFact, type Message, type ModeMessages, type ModePart, NO_TOOL, type Names, Note, type NoteBlock, NumberInput, ORB_STYLES, type Option, Orb, type OrbProps, type OrbState, type OrbStyle, type Preview, type Provider, RangeField, RatingField, type Request, Row, type RowProps, type Run, type RunBy, type RunRecord, type RunStatus, type RunStep, RunView, type RunViewProps, SPACE_MESSAGES, SPACE_MESSAGES_ES, SecretInput, type SpaceLayout, type SpaceMessages, type SpaceMode, type SpacePart, type Speaker, type StackBlock, Stat, type StatBlock, Stats, type StatusTone, type Step$1 as Step, type StepApp, type StepGroup, type StepState, type StoredFile, Surface, type SurfaceAction, type SurfaceComponents, type Surface$1 as SurfaceData, type SurfacePart, type SurfaceProps, Switch, type SwitchProps, TASKS_POLL_MS, TASK_MESSAGES, TASK_MESSAGES_ES, THREADS_POLL_MS, THREAD_MESSAGES, THREAD_MESSAGES_ES, TOOL_ERROR_MAX, TOPICS, type TableBlock, Tag, type Task, type TaskMessages, type TaskPart, TextArea, type TextBlock, TextInput, type ThreadMessages, type ThreadPart, Threads, type ThreadsProps, Tile, type TileProps, Tiles, TimeField, type TimeFieldProps, type Told, type Tone, type ToolCall, type ToolHandler, type ToolResult, type Topic, type Trigger, type Unread, type UpFrame, type Upload, UploadChips, type UploadOptions, type UploadRules, type Uploader, type Uploads, type Use, VISITOR_KEY, VOICE_CALL_MESSAGES, VOICE_CALL_MESSAGES_ES, type Values, type VaultFact, type Verb, VoiceCall, type VoiceCallMessages, type VoiceCallPart, type VoiceCallProps, WIDGET_FONTS, type Wall, type WeekHours, type Weekday, type When, type WidgetConfig, type WidgetFont, type WidgetLook, aboutBack, aboutState, accepts, actionWords, agentGlyph, agentTint, appOf, appSteps, appTitle, automationsOf, callWords, captionsOf, chosen, cleanDocument, clockOf, countOf, createClient, dayRefOf, durationOf, endedByReason, familyOf, filled, fires, formatSize, generatedName, groupsOf, labelOf, lineOf, lookOf, momentOf, namesOf, namingOf, occurrences, offsetOf, orbOf, parseCron, picked, pressed, previewOf, problemOf, scheduleOf, taskCard, timeOf, toneOf, tookOf, toolName, toolResultOf, toolTitle, useAgentFace, useCall, useConversation, useDictation, useLive, useTasks, useUnread, useUploads, verbOf, whenOf };
|
|
70
|
+
export { ABOUT_HOME, ABOUT_MESSAGES, AGENT_ICONS, AUTOMATION_MESSAGES, AUTOMATION_MESSAGES_ES, type About, type AboutControls, type AboutMessages, type AboutOut, type AboutPart, type AboutState, type AboutTools, type AboutView, type Action, type ActionFact, Agenda, AgentAbout, type AgentAboutProps, type AgentActivity, AgentCard, type AgentCardProps, AgentChat, type AgentChatProps, type AgentFace, type AgentIcon, AgentSpace, type AgentSpaceProps, AgentTasks, type AgentTasksProps, type AgentTint, ApiError, type AppDirectory, type AskFact, type Attachment, AudioPlayer, type AudioPlayerProps, type Author, Automation, type AutomationBlock, type Automation$1 as AutomationData, type AutomationFact, type AutomationKind, type AutomationMessages, type AutomationProps, type AutomationState, type Step as AutomationStep, type AutomationView, BROWSER_MESSAGES, BROWSER_MESSAGES_ES, type Block, type BlockProps, type Board, type BoardBlock, type BoardCard, type BoardColumn, type BoardMessages, type BrowserControl, type BrowserFrame, type BrowserInput, type BrowserMessages, type BrowserPart, type BrowserState, BrowserView, type BrowserViewProps, type BrowserWhere, Button, type ButtonBlock, type ButtonProps, CHAT_MESSAGES, CHAT_MESSAGES_ES, type CalendarBlock, type CalendarEvent, type CalendarMessages, type Call, type CallEnd, type CallEndedBy, type CallGlance, type CallJoin, type CallLine, type CallLook, type CallMessages, type CallMeter, type CallProblem, type CallReason, type CallState, type CallToken, Card, type CardBlock, type CardField, type CardPart, type Channel, type ChannelFact, type ChannelGlance, type ChannelKind, type ChannelSettings, type ChannelStatus, type ChannelWeb, type ChartBlock, type ChartPoint, type ChatCompose, type ChatLook, type ChatMessages, type ChatPart, type ChatSteps, Checkbox, Chips, type ChoiceBlock, Choices, type Client, type ClientOptions, Combobox, type ComboboxProps, type ConnectionFact, type ContactGlance, type ControlBase, Conversation, type ConversationDetail, type ConversationFile, type ConversationPerson, type ConversationProps, type Credentials, type Cron, type DataFact, DateField, type DateFieldProps, DateTimeField, type DateTimeFieldProps, type DayRef, type Decides, type Decision, type Delivery, type DeviceFact, type DeviceKind, type Dictate, type Dictation, type DividerBlock, type Does, EVERY_PLACE, type Entry, FILES_PER_MESSAGE, FILE_MESSAGES, type FaceRead, type Facts, Field, type FieldIds, type FieldKind, type FieldValue, type FieldsBlock, type FileAt, type FileBlock, FileChip, type FileChipProps, FileChips, type FileFact, type FileFamily, FileField, type FileFieldProps, type FileHost, type FileIndex, FileMark, type FileMessages, type FilePart, type FilePreview, FileView, type FileViewProps, type Files, type FormBlock, type FormField, type Frame, type Handover, type HandoverBy, type Holder, type HostBlock, type HostBlockProps, type HostBlocks, type HoursSpan, ICONS, type Icon, type ImageBlock, KIT_MESSAGES, KIT_MESSAGES_ES, Kanban, type KitClassNames, type KitLocale, type KitMessages, type KitPart, KitProvider, List, type ListBlock, type Live, type LiveConversation, type LiveHandlers, MAX_MB, Mark, type MarkProps, MarkStack, type MemoryFact, type Message, type ModeMessages, type ModePart, NO_TOOL, type Names, Note, type NoteBlock, NumberInput, ORB_STYLES, type Option, Orb, type OrbProps, type OrbState, type OrbStyle, type Place, Placed, type PlacedPart, type Preview, type Provider, RangeField, RatingField, type Request, Row, type RowProps, type Run, type RunBy, type RunRecord, type RunStatus, type RunStep, RunView, type RunViewProps, SPACE_MESSAGES, SPACE_MESSAGES_ES, SecretInput, type SpaceLayout, type SpaceMessages, type SpaceMode, type SpacePart, type Speaker, type StackBlock, Stat, type StatBlock, Stats, type StatusTone, type Step$1 as Step, type StepApp, type StepGroup, type StepState, type StoredFile, Surface, type SurfaceAction, type SurfaceComponents, type Surface$1 as SurfaceData, type SurfacePart, type SurfacePlaces, type SurfaceProps, Switch, type SwitchProps, TASKS_POLL_MS, TASK_MESSAGES, TASK_MESSAGES_ES, THREADS_POLL_MS, THREAD_MESSAGES, THREAD_MESSAGES_ES, TOOL_ERROR_MAX, TOPICS, type TableBlock, Tag, type Task, type TaskMessages, type TaskPart, TextArea, type TextBlock, TextInput, type ThreadMessages, type ThreadPart, Threads, type ThreadsProps, Tile, type TileProps, Tiles, TimeField, type TimeFieldProps, Timeline, type TimelineBlock, type TimelineItem, type Told, type Tone, type ToolCall, type ToolHandler, type ToolResult, type Topic, type Trigger, type Unread, type UpFrame, type Upload, UploadChips, type UploadOptions, type UploadRules, type Uploader, type Uploads, type Use, VIEW_POLL_MS, VISITOR_KEY, VOICE_CALL_MESSAGES, VOICE_CALL_MESSAGES_ES, type Values, type VaultFact, type Verb, View, type ViewProps, type ViewRead, type ViewRendered, VoiceCall, type VoiceCallMessages, type VoiceCallPart, type VoiceCallProps, WIDGET_FONTS, type Wall, type WeekHours, type Weekday, type When, type WidgetConfig, type WidgetFont, type WidgetLook, aboutBack, aboutState, accepts, actionWords, agentGlyph, agentTint, appOf, appSteps, appTitle, automationsOf, callWords, captionsOf, chosen, cleanDocument, clockOf, countOf, createClient, dayRefOf, daysOf, durationOf, endedByReason, familyOf, filled, fires, formatSize, formatWhen, generatedName, groupsOf, hoursOf, labelOf, lineOf, lookOf, momentOf, namesOf, namingOf, occurrences, offsetOf, orbOf, parseCron, picked, placeOf, placed, pressed, previewOf, problemOf, scheduleOf, taskCard, timeOf, toneOf, tookOf, toolName, toolResultOf, toolTitle, useAgentFace, useCall, useConversation, useDictation, useLive, useTasks, useUnread, useUploads, useView, verbOf, whenOf };
|
package/dist/index.js
CHANGED
|
@@ -33,7 +33,12 @@ import { AudioPlayer } from "./kit/AudioPlayer.js";
|
|
|
33
33
|
import { Field } from "./kit/Field.js";
|
|
34
34
|
import { Checkbox, NumberInput, SecretInput, TextArea, TextInput } from "./kit/Inputs.js";
|
|
35
35
|
import { FileChip, FileChips, FileField, UploadChips, useUploads } from "./kit/FileField.js";
|
|
36
|
+
import { Placed } from "./surface/Placed.js";
|
|
37
|
+
import { EVERY_PLACE, placeOf } from "./surface/places.js";
|
|
38
|
+
import { Agenda, daysOf, hoursOf } from "./kit/Agenda.js";
|
|
39
|
+
import { Kanban, placed } from "./kit/Kanban.js";
|
|
36
40
|
import { Card } from "./kit/Card.js";
|
|
41
|
+
import { Timeline, formatWhen } from "./kit/Timeline.js";
|
|
37
42
|
import { Chips, Choices } from "./kit/Choices.js";
|
|
38
43
|
import { Combobox } from "./kit/Combobox.js";
|
|
39
44
|
import { DateField } from "./kit/DateField.js";
|
|
@@ -58,4 +63,5 @@ import { VOICE_CALL_MESSAGES, VoiceCall } from "./VoiceCall.js";
|
|
|
58
63
|
import { FILE_MESSAGES, FileView } from "./FileView.js";
|
|
59
64
|
import { Tile, Tiles } from "./kit/Tile.js";
|
|
60
65
|
import { WIDGET_FONTS } from "./types.js";
|
|
61
|
-
|
|
66
|
+
import { VIEW_POLL_MS, View, useView } from "./View.js";
|
|
67
|
+
export { ABOUT_HOME, ABOUT_MESSAGES, AGENT_ICONS, AUTOMATION_MESSAGES, AUTOMATION_MESSAGES_ES, Agenda, AgentAbout, AgentCard, AgentChat, AgentSpace, AgentTasks, ApiError, AudioPlayer, Automation, BROWSER_MESSAGES, BROWSER_MESSAGES_ES, BrowserView, Button, CHAT_MESSAGES, CHAT_MESSAGES_ES, Card, Checkbox, Chips, Choices, Combobox, Conversation, DateField, DateTimeField, EVERY_PLACE, FILES_PER_MESSAGE, FILE_MESSAGES, Field, FileChip, FileChips, FileField, FileMark, FileView, ICONS, KIT_MESSAGES, KIT_MESSAGES_ES, Kanban, KitProvider, List, MAX_MB, Mark, MarkStack, NO_TOOL, Note, NumberInput, ORB_STYLES, Orb, Placed, RangeField, RatingField, Row, RunView, SPACE_MESSAGES, SPACE_MESSAGES_ES, SecretInput, Stat, Stats, Surface, Switch, TASKS_POLL_MS, TASK_MESSAGES, TASK_MESSAGES_ES, THREADS_POLL_MS, THREAD_MESSAGES, THREAD_MESSAGES_ES, TOOL_ERROR_MAX, TOPICS, Tag, TextArea, TextInput, Threads, Tile, Tiles, TimeField, Timeline, UploadChips, VIEW_POLL_MS, VISITOR_KEY, VOICE_CALL_MESSAGES, VOICE_CALL_MESSAGES_ES, View, VoiceCall, WIDGET_FONTS, aboutBack, aboutState, accepts, actionWords, agentGlyph, agentTint, appOf, appSteps, appTitle, automationsOf, callWords, captionsOf, chosen, cleanDocument, clockOf, countOf, createClient, dayRefOf, daysOf, durationOf, endedByReason, familyOf, filled, fires, formatSize, formatWhen, generatedName, groupsOf, hoursOf, labelOf, lineOf, lookOf, momentOf, namesOf, namingOf, occurrences, offsetOf, orbOf, parseCron, picked, placeOf, placed, pressed, previewOf, problemOf, scheduleOf, taskCard, timeOf, toneOf, tookOf, toolName, toolResultOf, toolTitle, useAgentFace, useCall, useConversation, useDictation, useLive, useTasks, useUnread, useUploads, useView, verbOf, whenOf };
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { CalendarEvent } from "../blocks.js";
|
|
2
|
+
//#region src/kit/Agenda.d.ts
|
|
3
|
+
/** The days a calendar shows from its first: a day's, or a week's. */
|
|
4
|
+
export declare function daysOf(span: "day" | "week", start: string): string[];
|
|
5
|
+
/** An event's hours as the language writes them: "10:00 – 11:00", one end, or none (a day). */
|
|
6
|
+
export declare function hoursOf(event: CalendarEvent, code: string): string | null;
|
|
7
|
+
/**
|
|
8
|
+
* A day's events, or a week's, at their hours: each day under its weekday and number (today in
|
|
9
|
+
* the accent), its events in order, each with its hours (or "all day"), its title and a quiet
|
|
10
|
+
* line of detail. In a narrow place the days go one under another, an empty one a single quiet
|
|
11
|
+
* line; wide enough, the week stands as seven columns. An event with a page opens it apart;
|
|
12
|
+
* with `onEvent`, pressing one sends it.
|
|
13
|
+
*/
|
|
14
|
+
export declare function Agenda({ span, start, events, onEvent, disabled, today }: {
|
|
15
|
+
span: "day" | "week";
|
|
16
|
+
/** The first day shown, "YYYY-MM-DD". */
|
|
17
|
+
start: string;
|
|
18
|
+
events: CalendarEvent[];
|
|
19
|
+
onEvent?: ((event: CalendarEvent) => void) | undefined;
|
|
20
|
+
disabled?: boolean | undefined;
|
|
21
|
+
/** What counts as today; now by default. */
|
|
22
|
+
today?: Date | undefined;
|
|
23
|
+
}): import("react").JSX.Element;
|
|
24
|
+
//#endregion
|
|
25
|
+
//# sourceMappingURL=Agenda.d.ts.map
|
|
@@ -0,0 +1,119 @@
|
|
|
1
|
+
import { useKit, useParts } from "./context.js";
|
|
2
|
+
import { TIME, dayOf, formatTime, isoDay, momentParts } from "./dates.js";
|
|
3
|
+
import { Fragment } from "react";
|
|
4
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
5
|
+
//#region src/kit/Agenda.tsx
|
|
6
|
+
/** The days a calendar shows from its first: a day's, or a week's. */
|
|
7
|
+
function daysOf(span, start) {
|
|
8
|
+
const first = dayOf(start);
|
|
9
|
+
if (!first) return [];
|
|
10
|
+
return Array.from({ length: span === "week" ? 7 : 1 }, (_, index) => {
|
|
11
|
+
const day = new Date(first);
|
|
12
|
+
day.setDate(first.getDate() + index);
|
|
13
|
+
return isoDay(day);
|
|
14
|
+
});
|
|
15
|
+
}
|
|
16
|
+
/** An event's hours as the language writes them: "10:00 – 11:00", one end, or none (a day). */
|
|
17
|
+
function hoursOf(event, code) {
|
|
18
|
+
const [day, from] = momentParts(event.start);
|
|
19
|
+
if (!TIME.test(from)) return null;
|
|
20
|
+
const [endDay, to] = momentParts(event.end ?? null);
|
|
21
|
+
const until = endDay === day && TIME.test(to) ? to : null;
|
|
22
|
+
return until === null ? formatTime(from, code) : `${formatTime(from, code)} – ${formatTime(until, code)}`;
|
|
23
|
+
}
|
|
24
|
+
/**
|
|
25
|
+
* A day's events, or a week's, at their hours: each day under its weekday and number (today in
|
|
26
|
+
* the accent), its events in order, each with its hours (or "all day"), its title and a quiet
|
|
27
|
+
* line of detail. In a narrow place the days go one under another, an empty one a single quiet
|
|
28
|
+
* line; wide enough, the week stands as seven columns. An event with a page opens it apart;
|
|
29
|
+
* with `onEvent`, pressing one sends it.
|
|
30
|
+
*/
|
|
31
|
+
function Agenda({ span, start, events, onEvent, disabled = false, today = /* @__PURE__ */ new Date() }) {
|
|
32
|
+
const part = useParts();
|
|
33
|
+
const { code, messages } = useKit();
|
|
34
|
+
const now = isoDay(today);
|
|
35
|
+
const days = daysOf(span, start);
|
|
36
|
+
const weekday = new Intl.DateTimeFormat(code, { weekday: "short" });
|
|
37
|
+
const whole = new Intl.DateTimeFormat(code, {
|
|
38
|
+
weekday: "long",
|
|
39
|
+
day: "numeric",
|
|
40
|
+
month: "long"
|
|
41
|
+
});
|
|
42
|
+
return /* @__PURE__ */ jsx("div", {
|
|
43
|
+
part: "agenda",
|
|
44
|
+
className: part("sc-agenda", ...span === "day" ? ["sc-agenda--day"] : []),
|
|
45
|
+
children: /* @__PURE__ */ jsx("div", {
|
|
46
|
+
className: part("sc-agenda__days"),
|
|
47
|
+
children: days.map((day) => {
|
|
48
|
+
const date = dayOf(day) ?? today;
|
|
49
|
+
const own = events.filter((event) => event.start.slice(0, 10) === day);
|
|
50
|
+
return /* @__PURE__ */ jsxs("section", {
|
|
51
|
+
"aria-label": whole.format(date),
|
|
52
|
+
className: part("sc-agenda__day", ...day === now ? ["sc-agenda__day--today"] : [], ...own.length === 0 ? ["sc-agenda__day--empty"] : []),
|
|
53
|
+
children: [span === "week" && /* @__PURE__ */ jsxs("h4", {
|
|
54
|
+
"aria-hidden": true,
|
|
55
|
+
className: part("sc-agenda__date"),
|
|
56
|
+
children: [/* @__PURE__ */ jsx("span", {
|
|
57
|
+
className: part("sc-agenda__weekday"),
|
|
58
|
+
children: weekday.format(date)
|
|
59
|
+
}), /* @__PURE__ */ jsx("span", {
|
|
60
|
+
className: part("sc-agenda__number"),
|
|
61
|
+
children: date.getDate()
|
|
62
|
+
})]
|
|
63
|
+
}), own.length === 0 ? /* @__PURE__ */ jsx("p", {
|
|
64
|
+
className: part("sc-agenda__empty"),
|
|
65
|
+
children: messages.calendar.empty
|
|
66
|
+
}) : /* @__PURE__ */ jsx("ol", {
|
|
67
|
+
className: part("sc-agenda__events"),
|
|
68
|
+
children: own.map((event) => /* @__PURE__ */ jsx("li", { children: /* @__PURE__ */ jsxs(Event, {
|
|
69
|
+
event,
|
|
70
|
+
onEvent,
|
|
71
|
+
disabled,
|
|
72
|
+
children: [/* @__PURE__ */ jsx("span", {
|
|
73
|
+
className: part("sc-agenda__time"),
|
|
74
|
+
children: (hoursOf(event, code) ?? messages.calendar.allDay).split(" – ").map((end, index) => index === 0 ? /* @__PURE__ */ jsx("span", { children: end }, index) : /* @__PURE__ */ jsxs(Fragment, { children: [" ", /* @__PURE__ */ jsxs("span", { children: ["– ", end] })] }, index))
|
|
75
|
+
}), /* @__PURE__ */ jsxs("span", {
|
|
76
|
+
className: part("sc-agenda__what"),
|
|
77
|
+
children: [/* @__PURE__ */ jsx("span", {
|
|
78
|
+
className: part("sc-agenda__title"),
|
|
79
|
+
children: event.title
|
|
80
|
+
}), event.detail !== void 0 && /* @__PURE__ */ jsx("span", {
|
|
81
|
+
className: part("sc-agenda__detail"),
|
|
82
|
+
children: event.detail
|
|
83
|
+
})]
|
|
84
|
+
})]
|
|
85
|
+
}) }, event.id))
|
|
86
|
+
})]
|
|
87
|
+
}, day);
|
|
88
|
+
})
|
|
89
|
+
})
|
|
90
|
+
});
|
|
91
|
+
}
|
|
92
|
+
/** One event: a link to its page, a button that sends it, or just its words. */
|
|
93
|
+
function Event({ event, onEvent, disabled, children }) {
|
|
94
|
+
const className = useParts()("sc-agenda__event");
|
|
95
|
+
if (event.url !== void 0 && /^https:\/\//i.test(event.url)) return /* @__PURE__ */ jsx("a", {
|
|
96
|
+
className,
|
|
97
|
+
href: event.url,
|
|
98
|
+
target: "_blank",
|
|
99
|
+
rel: "noreferrer noopener",
|
|
100
|
+
children
|
|
101
|
+
});
|
|
102
|
+
if (onEvent !== void 0) return /* @__PURE__ */ jsx("button", {
|
|
103
|
+
type: "button",
|
|
104
|
+
className,
|
|
105
|
+
disabled,
|
|
106
|
+
onClick: () => {
|
|
107
|
+
onEvent(event);
|
|
108
|
+
},
|
|
109
|
+
children
|
|
110
|
+
});
|
|
111
|
+
return /* @__PURE__ */ jsx("div", {
|
|
112
|
+
className,
|
|
113
|
+
children
|
|
114
|
+
});
|
|
115
|
+
}
|
|
116
|
+
//#endregion
|
|
117
|
+
export { Agenda, daysOf, hoursOf };
|
|
118
|
+
|
|
119
|
+
//# sourceMappingURL=Agenda.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Agenda.js","names":[],"sources":["../../src/kit/Agenda.tsx"],"sourcesContent":["import { Fragment, type ReactNode } from \"react\";\n\nimport type { CalendarEvent } from \"../blocks\";\nimport { useKit, useParts } from \"./context\";\nimport { dayOf, formatTime, isoDay, momentParts, TIME } from \"./dates\";\n\n/** The days a calendar shows from its first: a day's, or a week's. */\nexport function daysOf(span: \"day\" | \"week\", start: string): string[] {\n const first = dayOf(start);\n if (!first) return [];\n return Array.from({ length: span === \"week\" ? 7 : 1 }, (_, index) => {\n const day = new Date(first);\n day.setDate(first.getDate() + index);\n return isoDay(day);\n });\n}\n\n/** An event's hours as the language writes them: \"10:00 – 11:00\", one end, or none (a day). */\nexport function hoursOf(event: CalendarEvent, code: string): string | null {\n const [day, from] = momentParts(event.start);\n if (!TIME.test(from)) return null;\n const [endDay, to] = momentParts(event.end ?? null);\n const until = endDay === day && TIME.test(to) ? to : null;\n return until === null\n ? formatTime(from, code)\n : `${formatTime(from, code)} – ${formatTime(until, code)}`;\n}\n\n/**\n * A day's events, or a week's, at their hours: each day under its weekday and number (today in\n * the accent), its events in order, each with its hours (or \"all day\"), its title and a quiet\n * line of detail. In a narrow place the days go one under another, an empty one a single quiet\n * line; wide enough, the week stands as seven columns. An event with a page opens it apart;\n * with `onEvent`, pressing one sends it.\n */\nexport function Agenda({\n span,\n start,\n events,\n onEvent,\n disabled = false,\n today = new Date(),\n}: {\n span: \"day\" | \"week\";\n /** The first day shown, \"YYYY-MM-DD\". */\n start: string;\n events: CalendarEvent[];\n onEvent?: ((event: CalendarEvent) => void) | undefined;\n disabled?: boolean | undefined;\n /** What counts as today; now by default. */\n today?: Date | undefined;\n}) {\n const part = useParts();\n const { code, messages } = useKit();\n const now = isoDay(today);\n const days = daysOf(span, start);\n const weekday = new Intl.DateTimeFormat(code, { weekday: \"short\" });\n const whole = new Intl.DateTimeFormat(code, { weekday: \"long\", day: \"numeric\", month: \"long\" });\n return (\n <div\n part=\"agenda\"\n className={part(\"sc-agenda\", ...(span === \"day\" ? ([\"sc-agenda--day\"] as const) : []))}\n >\n <div className={part(\"sc-agenda__days\")}>\n {days.map((day) => {\n const date = dayOf(day) ?? today;\n const own = events.filter((event) => event.start.slice(0, 10) === day);\n return (\n <section\n key={day}\n aria-label={whole.format(date)}\n className={part(\n \"sc-agenda__day\",\n ...(day === now ? ([\"sc-agenda__day--today\"] as const) : []),\n ...(own.length === 0 ? ([\"sc-agenda__day--empty\"] as const) : []),\n )}\n >\n {span === \"week\" && (\n <h4 aria-hidden className={part(\"sc-agenda__date\")}>\n <span className={part(\"sc-agenda__weekday\")}>{weekday.format(date)}</span>\n <span className={part(\"sc-agenda__number\")}>{date.getDate()}</span>\n </h4>\n )}\n {own.length === 0 ? (\n <p className={part(\"sc-agenda__empty\")}>{messages.calendar.empty}</p>\n ) : (\n <ol className={part(\"sc-agenda__events\")}>\n {own.map((event) => (\n <li key={event.id}>\n <Event event={event} onEvent={onEvent} disabled={disabled}>\n <span className={part(\"sc-agenda__time\")}>\n {(hoursOf(event, code) ?? messages.calendar.allDay)\n .split(\" – \")\n .map((end, index) =>\n // A range breaks before its dash, never inside a time (\"5:00 PM\").\n index === 0 ? (\n <span key={index}>{end}</span>\n ) : (\n <Fragment key={index}>\n {\" \"}\n <span>– {end}</span>\n </Fragment>\n ),\n )}\n </span>\n <span className={part(\"sc-agenda__what\")}>\n <span className={part(\"sc-agenda__title\")}>{event.title}</span>\n {event.detail !== undefined && (\n <span className={part(\"sc-agenda__detail\")}>{event.detail}</span>\n )}\n </span>\n </Event>\n </li>\n ))}\n </ol>\n )}\n </section>\n );\n })}\n </div>\n </div>\n );\n}\n\n/** One event: a link to its page, a button that sends it, or just its words. */\nfunction Event({\n event,\n onEvent,\n disabled,\n children,\n}: {\n event: CalendarEvent;\n onEvent: ((event: CalendarEvent) => void) | undefined;\n disabled: boolean;\n children: ReactNode;\n}) {\n const part = useParts();\n const className = part(\"sc-agenda__event\");\n if (event.url !== undefined && /^https:\\/\\//i.test(event.url)) {\n return (\n <a className={className} href={event.url} target=\"_blank\" rel=\"noreferrer noopener\">\n {children}\n </a>\n );\n }\n if (onEvent !== undefined) {\n return (\n <button\n type=\"button\"\n className={className}\n disabled={disabled}\n onClick={() => {\n onEvent(event);\n }}\n >\n {children}\n </button>\n );\n }\n return <div className={className}>{children}</div>;\n}\n"],"mappings":";;;;;;AAOA,SAAgB,OAAO,MAAsB,OAAyB;CACpE,MAAM,QAAQ,MAAM,KAAK;CACzB,IAAI,CAAC,OAAO,OAAO,CAAC;CACpB,OAAO,MAAM,KAAK,EAAE,QAAQ,SAAS,SAAS,IAAI,EAAE,IAAI,GAAG,UAAU;EACnE,MAAM,MAAM,IAAI,KAAK,KAAK;EAC1B,IAAI,QAAQ,MAAM,QAAQ,IAAI,KAAK;EACnC,OAAO,OAAO,GAAG;CACnB,CAAC;AACH;;AAGA,SA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A;AAET;;AAGA,SAAS,MAAM,EACb,OACA,SACA,UACA,YAMC;CAED,MAAM,YADO,SACQ,CAAC,CAAC,kBAAkB;CACzC,IAAI,MAAM,QAAQ,KAAA,KAAa,eAAe,KAAK,MAAM,GAAG,GAC1D,OACE,oBAAC,KAAD;EAAc;EAAW,MAAM,MAAM;EAAK,QAAO;EAAS,KAAI;EAC3D;CACA,CAAA;CAGP,IAAI,YAAY,KAAA,GACd,OACE,oBAAC,UAAD;EACE,MAAK;EACM;EACD;EACV,eAAe;GACb,QAAQ,KAAK;EACf;EAEC;CACK,CAAA;CAGZ,OAAO,oBAAC,OAAD;EAAgB;EAAY;CAAc,CAAA;AACnD"}
|
package/dist/kit/Combobox.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { useKit, useParts } from "./context.js";
|
|
2
2
|
import { ariaOf } from "./Field.js";
|
|
3
|
-
import { matches } from "./options.js";
|
|
4
3
|
import { Popover, usePopover } from "./Popover.js";
|
|
4
|
+
import { matches } from "./options.js";
|
|
5
5
|
import { useId, useLayoutEffect, useRef, useState } from "react";
|
|
6
6
|
import { CaretUpDownIcon, CheckIcon, XIcon } from "@phosphor-icons/react";
|
|
7
7
|
import { Fragment as Fragment$1, jsx, jsxs } from "react/jsx-runtime";
|
package/dist/kit/DateField.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { useKit, useParts } from "./context.js";
|
|
2
2
|
import { ariaOf } from "./Field.js";
|
|
3
|
-
import { Popover, usePopover } from "./Popover.js";
|
|
4
3
|
import { dayAllowed, dayOf, daySpan, formatDay, isoDay, openingDay } from "./dates.js";
|
|
4
|
+
import { Popover, usePopover } from "./Popover.js";
|
|
5
5
|
import { useState } from "react";
|
|
6
6
|
import { CalendarBlankIcon, CaretDownIcon, CaretLeftIcon, CaretRightIcon } from "@phosphor-icons/react";
|
|
7
7
|
import { Fragment as Fragment$1, jsx, jsxs } from "react/jsx-runtime";
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { BoardCard, BoardColumn } from "../blocks.js";
|
|
2
|
+
//#region src/kit/Kanban.d.ts
|
|
3
|
+
/** The columns with each card where the person last put it (`moved`, card id to column id). */
|
|
4
|
+
export declare function placed(columns: readonly BoardColumn[], moved: Readonly<Record<string, string>>): BoardColumn[];
|
|
5
|
+
/**
|
|
6
|
+
* Cards in columns, a column per stage, side by side, scrolling across when they don't fit: each
|
|
7
|
+
* column's title and how many it holds over its cards (a title, a quieter line, a detail at its
|
|
8
|
+
* foot). With `onMove`, the person moves a card to another column by dragging it there, or from
|
|
9
|
+
* its button's list of the other columns (the keyboard's way); the card goes there at once.
|
|
10
|
+
*/
|
|
11
|
+
export declare function Kanban({ columns, onMove, disabled }: {
|
|
12
|
+
columns: BoardColumn[];
|
|
13
|
+
onMove?: ((card: BoardCard, column: BoardColumn) => void) | undefined;
|
|
14
|
+
disabled?: boolean | undefined;
|
|
15
|
+
}): import("react").JSX.Element;
|
|
16
|
+
//#endregion
|
|
17
|
+
//# sourceMappingURL=Kanban.d.ts.map
|
|
@@ -0,0 +1,157 @@
|
|
|
1
|
+
import { useKit, useParts } from "./context.js";
|
|
2
|
+
import { Popover, usePopover } from "./Popover.js";
|
|
3
|
+
import { useState } from "react";
|
|
4
|
+
import { ArrowsLeftRightIcon } from "@phosphor-icons/react";
|
|
5
|
+
import { Fragment as Fragment$1, jsx, jsxs } from "react/jsx-runtime";
|
|
6
|
+
//#region src/kit/Kanban.tsx
|
|
7
|
+
/** What a dragged card carries, so a drop elsewhere on the page takes nothing of it. */
|
|
8
|
+
const CARD = "application/x-signalcore-card";
|
|
9
|
+
/** The columns with each card where the person last put it (`moved`, card id to column id). */
|
|
10
|
+
function placed(columns, moved) {
|
|
11
|
+
const cards = columns.flatMap((column) => column.cards.map((card) => ({
|
|
12
|
+
card,
|
|
13
|
+
column: moved[card.id] ?? column.id
|
|
14
|
+
})));
|
|
15
|
+
return columns.map((column) => ({
|
|
16
|
+
...column,
|
|
17
|
+
cards: cards.filter((each) => each.column === column.id).map((each) => each.card)
|
|
18
|
+
}));
|
|
19
|
+
}
|
|
20
|
+
/**
|
|
21
|
+
* Cards in columns, a column per stage, side by side, scrolling across when they don't fit: each
|
|
22
|
+
* column's title and how many it holds over its cards (a title, a quieter line, a detail at its
|
|
23
|
+
* foot). With `onMove`, the person moves a card to another column by dragging it there, or from
|
|
24
|
+
* its button's list of the other columns (the keyboard's way); the card goes there at once.
|
|
25
|
+
*/
|
|
26
|
+
function Kanban({ columns, onMove, disabled = false }) {
|
|
27
|
+
const part = useParts();
|
|
28
|
+
const { messages } = useKit();
|
|
29
|
+
const [moved, setMoved] = useState({});
|
|
30
|
+
const [dragging, setDragging] = useState(null);
|
|
31
|
+
const [over, setOver] = useState(null);
|
|
32
|
+
const movable = onMove !== void 0 && !disabled;
|
|
33
|
+
const shown = placed(columns, moved);
|
|
34
|
+
const move = (card, to) => {
|
|
35
|
+
const from = shown.find((column) => column.cards.some((each) => each.id === card.id));
|
|
36
|
+
if (!onMove || from?.id === to.id) return;
|
|
37
|
+
setMoved((before) => ({
|
|
38
|
+
...before,
|
|
39
|
+
[card.id]: to.id
|
|
40
|
+
}));
|
|
41
|
+
onMove(card, to);
|
|
42
|
+
};
|
|
43
|
+
const dropOn = (column) => (event) => {
|
|
44
|
+
event.preventDefault();
|
|
45
|
+
setOver(null);
|
|
46
|
+
setDragging(null);
|
|
47
|
+
const id = event.dataTransfer.getData(CARD);
|
|
48
|
+
const card = columns.flatMap((each) => each.cards).find((each) => each.id === id);
|
|
49
|
+
if (card) move(card, column);
|
|
50
|
+
};
|
|
51
|
+
return /* @__PURE__ */ jsx("div", {
|
|
52
|
+
part: "board",
|
|
53
|
+
className: part("sc-board"),
|
|
54
|
+
children: shown.map((column) => /* @__PURE__ */ jsxs("section", {
|
|
55
|
+
"aria-label": column.title,
|
|
56
|
+
className: part("sc-board__column", ...over === column.id ? ["sc-board__column--over"] : []),
|
|
57
|
+
onDragOver: (event) => {
|
|
58
|
+
if (!movable || dragging === null) return;
|
|
59
|
+
event.preventDefault();
|
|
60
|
+
event.dataTransfer.dropEffect = "move";
|
|
61
|
+
setOver(column.id);
|
|
62
|
+
},
|
|
63
|
+
onDragLeave: (event) => {
|
|
64
|
+
const to = event.relatedTarget;
|
|
65
|
+
if (!(to instanceof Node && event.currentTarget.contains(to))) setOver(null);
|
|
66
|
+
},
|
|
67
|
+
onDrop: movable ? dropOn(column) : void 0,
|
|
68
|
+
children: [/* @__PURE__ */ jsxs("h4", {
|
|
69
|
+
className: part("sc-board__head"),
|
|
70
|
+
children: [/* @__PURE__ */ jsx("span", {
|
|
71
|
+
className: part("sc-board__title"),
|
|
72
|
+
children: column.title
|
|
73
|
+
}), /* @__PURE__ */ jsx("span", {
|
|
74
|
+
className: part("sc-board__count"),
|
|
75
|
+
children: column.cards.length
|
|
76
|
+
})]
|
|
77
|
+
}), column.cards.length === 0 ? /* @__PURE__ */ jsx("p", {
|
|
78
|
+
className: part("sc-board__empty"),
|
|
79
|
+
children: messages.board.empty
|
|
80
|
+
}) : /* @__PURE__ */ jsx("ul", {
|
|
81
|
+
className: part("sc-board__cards"),
|
|
82
|
+
children: column.cards.map((card) => /* @__PURE__ */ jsxs("li", {
|
|
83
|
+
draggable: movable,
|
|
84
|
+
onDragStart: (event) => {
|
|
85
|
+
event.dataTransfer.setData(CARD, card.id);
|
|
86
|
+
event.dataTransfer.effectAllowed = "move";
|
|
87
|
+
setDragging(card.id);
|
|
88
|
+
},
|
|
89
|
+
onDragEnd: () => {
|
|
90
|
+
setDragging(null);
|
|
91
|
+
setOver(null);
|
|
92
|
+
},
|
|
93
|
+
className: part("sc-board__card", ...dragging === card.id ? ["sc-board__card--dragging"] : []),
|
|
94
|
+
children: [
|
|
95
|
+
/* @__PURE__ */ jsx("span", {
|
|
96
|
+
className: part("sc-board__card-title"),
|
|
97
|
+
children: card.title
|
|
98
|
+
}),
|
|
99
|
+
card.subtitle !== void 0 && /* @__PURE__ */ jsx("span", {
|
|
100
|
+
className: part("sc-board__card-subtitle"),
|
|
101
|
+
children: card.subtitle
|
|
102
|
+
}),
|
|
103
|
+
card.meta !== void 0 && /* @__PURE__ */ jsx("span", {
|
|
104
|
+
className: part("sc-board__card-meta"),
|
|
105
|
+
children: card.meta
|
|
106
|
+
}),
|
|
107
|
+
movable && /* @__PURE__ */ jsx(Move, {
|
|
108
|
+
card,
|
|
109
|
+
to: shown.filter((other) => other.id !== column.id),
|
|
110
|
+
onMove: move
|
|
111
|
+
})
|
|
112
|
+
]
|
|
113
|
+
}, card.id))
|
|
114
|
+
})]
|
|
115
|
+
}, column.id))
|
|
116
|
+
});
|
|
117
|
+
}
|
|
118
|
+
/** A card's button that opens the other columns, to move it to one of them. */
|
|
119
|
+
function Move({ card, to, onMove }) {
|
|
120
|
+
const part = useParts();
|
|
121
|
+
const { messages } = useKit();
|
|
122
|
+
const [open, setOpen] = useState(false);
|
|
123
|
+
const popover = usePopover(open, setOpen, {
|
|
124
|
+
width: "own",
|
|
125
|
+
role: "dialog"
|
|
126
|
+
});
|
|
127
|
+
return /* @__PURE__ */ jsxs(Fragment$1, { children: [/* @__PURE__ */ jsx("button", {
|
|
128
|
+
ref: popover.refs.setReference,
|
|
129
|
+
type: "button",
|
|
130
|
+
"aria-label": messages.board.move(card.title),
|
|
131
|
+
title: messages.board.move(card.title),
|
|
132
|
+
"aria-expanded": open,
|
|
133
|
+
className: part("sc-board__move"),
|
|
134
|
+
...popover.getReferenceProps({ onClick: () => setOpen(!open) }),
|
|
135
|
+
children: /* @__PURE__ */ jsx(ArrowsLeftRightIcon, { "aria-hidden": true })
|
|
136
|
+
}), open && /* @__PURE__ */ jsx(Popover, {
|
|
137
|
+
popover,
|
|
138
|
+
focus: true,
|
|
139
|
+
label: messages.board.moveTo,
|
|
140
|
+
children: /* @__PURE__ */ jsxs("div", {
|
|
141
|
+
className: part("sc-board__menu"),
|
|
142
|
+
children: [/* @__PURE__ */ jsx("p", { children: messages.board.moveTo }), to.map((column) => /* @__PURE__ */ jsx("button", {
|
|
143
|
+
type: "button",
|
|
144
|
+
className: part("sc-listbox__item"),
|
|
145
|
+
onClick: () => {
|
|
146
|
+
setOpen(false);
|
|
147
|
+
onMove(card, column);
|
|
148
|
+
},
|
|
149
|
+
children: column.title
|
|
150
|
+
}, column.id))]
|
|
151
|
+
})
|
|
152
|
+
})] });
|
|
153
|
+
}
|
|
154
|
+
//#endregion
|
|
155
|
+
export { Kanban, placed };
|
|
156
|
+
|
|
157
|
+
//# sourceMappingURL=Kanban.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Kanban.js","names":[],"sources":["../../src/kit/Kanban.tsx"],"sourcesContent":["import { ArrowsLeftRightIcon } from \"@phosphor-icons/react\";\nimport { useState, type DragEvent } from \"react\";\n\nimport type { BoardCard, BoardColumn } from \"../blocks\";\nimport { useKit, useParts } from \"./context\";\nimport { Popover, usePopover } from \"./Popover\";\n\n/** What a dragged card carries, so a drop elsewhere on the page takes nothing of it. */\nconst CARD = \"application/x-signalcore-card\";\n\n/** The columns with each card where the person last put it (`moved`, card id to column id). */\nexport function placed(\n columns: readonly BoardColumn[],\n moved: Readonly<Record<string, string>>,\n): BoardColumn[] {\n const cards = columns.flatMap((column) =>\n column.cards.map((card) => ({ card, column: moved[card.id] ?? column.id })),\n );\n return columns.map((column) => ({\n ...column,\n cards: cards.filter((each) => each.column === column.id).map((each) => each.card),\n }));\n}\n\n/**\n * Cards in columns, a column per stage, side by side, scrolling across when they don't fit: each\n * column's title and how many it holds over its cards (a title, a quieter line, a detail at its\n * foot). With `onMove`, the person moves a card to another column by dragging it there, or from\n * its button's list of the other columns (the keyboard's way); the card goes there at once.\n */\nexport function Kanban({\n columns,\n onMove,\n disabled = false,\n}: {\n columns: BoardColumn[];\n onMove?: ((card: BoardCard, column: BoardColumn) => void) | undefined;\n disabled?: boolean | undefined;\n}) {\n const part = useParts();\n const { messages } = useKit();\n const [moved, setMoved] = useState<Record<string, string>>({});\n const [dragging, setDragging] = useState<string | null>(null);\n const [over, setOver] = useState<string | null>(null);\n const movable = onMove !== undefined && !disabled;\n const shown = placed(columns, moved);\n const move = (card: BoardCard, to: BoardColumn) => {\n const from = shown.find((column) => column.cards.some((each) => each.id === card.id));\n if (!onMove || from?.id === to.id) return;\n setMoved((before) => ({ ...before, [card.id]: to.id }));\n onMove(card, to);\n };\n const dropOn = (column: BoardColumn) => (event: DragEvent) => {\n event.preventDefault();\n setOver(null);\n setDragging(null);\n const id = event.dataTransfer.getData(CARD);\n const card = columns.flatMap((each) => each.cards).find((each) => each.id === id);\n if (card) move(card, column);\n };\n return (\n <div part=\"board\" className={part(\"sc-board\")}>\n {shown.map((column) => (\n <section\n key={column.id}\n aria-label={column.title}\n className={part(\n \"sc-board__column\",\n ...(over === column.id ? ([\"sc-board__column--over\"] as const) : []),\n )}\n onDragOver={(event) => {\n if (!movable || dragging === null) return;\n event.preventDefault();\n event.dataTransfer.dropEffect = \"move\";\n setOver(column.id);\n }}\n onDragLeave={(event) => {\n const to = event.relatedTarget;\n if (!(to instanceof Node && event.currentTarget.contains(to))) setOver(null);\n }}\n onDrop={movable ? dropOn(column) : undefined}\n >\n <h4 className={part(\"sc-board__head\")}>\n <span className={part(\"sc-board__title\")}>{column.title}</span>\n <span className={part(\"sc-board__count\")}>{column.cards.length}</span>\n </h4>\n {column.cards.length === 0 ? (\n <p className={part(\"sc-board__empty\")}>{messages.board.empty}</p>\n ) : (\n <ul className={part(\"sc-board__cards\")}>\n {column.cards.map((card) => (\n <li\n key={card.id}\n draggable={movable}\n onDragStart={(event) => {\n event.dataTransfer.setData(CARD, card.id);\n event.dataTransfer.effectAllowed = \"move\";\n setDragging(card.id);\n }}\n onDragEnd={() => {\n setDragging(null);\n setOver(null);\n }}\n className={part(\n \"sc-board__card\",\n ...(dragging === card.id ? ([\"sc-board__card--dragging\"] as const) : []),\n )}\n >\n <span className={part(\"sc-board__card-title\")}>{card.title}</span>\n {card.subtitle !== undefined && (\n <span className={part(\"sc-board__card-subtitle\")}>{card.subtitle}</span>\n )}\n {card.meta !== undefined && (\n <span className={part(\"sc-board__card-meta\")}>{card.meta}</span>\n )}\n {movable && (\n <Move\n card={card}\n to={shown.filter((other) => other.id !== column.id)}\n onMove={move}\n />\n )}\n </li>\n ))}\n </ul>\n )}\n </section>\n ))}\n </div>\n );\n}\n\n/** A card's button that opens the other columns, to move it to one of them. */\nfunction Move({\n card,\n to,\n onMove,\n}: {\n card: BoardCard;\n to: BoardColumn[];\n onMove: (card: BoardCard, column: BoardColumn) => void;\n}) {\n const part = useParts();\n const { messages } = useKit();\n const [open, setOpen] = useState(false);\n const popover = usePopover(open, setOpen, { width: \"own\", role: \"dialog\" });\n return (\n <>\n <button\n ref={popover.refs.setReference}\n type=\"button\"\n aria-label={messages.board.move(card.title)}\n title={messages.board.move(card.title)}\n aria-expanded={open}\n className={part(\"sc-board__move\")}\n {...popover.getReferenceProps({ onClick: () => setOpen(!open) })}\n >\n <ArrowsLeftRightIcon aria-hidden />\n </button>\n {open && (\n <Popover popover={popover} focus label={messages.board.moveTo}>\n <div className={part(\"sc-board__menu\")}>\n <p>{messages.board.moveTo}</p>\n {to.map((column) => (\n <button\n key={column.id}\n type=\"button\"\n className={part(\"sc-listbox__item\")}\n onClick={() => {\n setOpen(false);\n onMove(card, column);\n }}\n >\n {column.title}\n </button>\n ))}\n </div>\n </Popover>\n )}\n </>\n );\n}\n"],"mappings":";;;;;;;AAQA,MAAM,OAAO;;AAGb,SAAgB,OACd,SACA,OACe;CACf,MAAM,QAAQ,QAAQ,SAAS,WAC7B,OAAO,MAAM,KAAK,UAAU;EAAE;EAAM,QAAQ,MAAM,KAAK,OAAO,OAAO;CAAG,EAAE,CAC5E;CACA,OAAO,QAAQ,KAAK,YAAY;EAC9B,GAAG;EACH,OAAO,MAAM,QAAQ,SAAS,KAAK,WAAW,OAAO,EAAE,CAAC,CAAC,KAAK,SAAS,KAAK,IAAI;CAClF,EAAE;AACJ;;;;;;;AAQA,SAAgB,OAAO,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