@lotics/app-sdk 0.36.0 → 0.36.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/AGENTS.md CHANGED
@@ -48,9 +48,12 @@ Pick by intent. (→ open the `.d.ts` for the exact signature.)
48
48
  local object-URL preview AT ONCE and uploads in the background; each `files[]` entry carries
49
49
  `{ id, filename, mime_type, preview_url, status, file_id? }`; previews are revoked on remove/clear.
50
50
  Picking is yours (button → `@lotics/ui` `pickFiles`, or paste/drop) — pass the `File[]` to `add`.
51
- Wire to `@lotics/ui` `Composer`: `actionsButton` triggers the pick, `files` maps to
52
- `<FileThumbnail uploading={f.status === "uploading"} />`, `sendDisabled` gates on `uploading`,
53
- and the send payload is `fileIds`. Don't hand-roll `createObjectURL`/upload/revoke per app.
51
+ Wire to `@lotics/ui` `Composer`: `actionsButton` triggers the pick, then map each `AttachedFile`
52
+ to a `DisplayFile` (snake camel `mime_type`→`mimeType`, `preview_url`→`url` the app owns this
53
+ data→UI adapter; the SDK never imports `@lotics/ui`) for
54
+ `<FileThumbnail file={{ id, filename, mimeType, url }} uploading={f.status === "uploading"} />`;
55
+ `sendDisabled` gates on `uploading` and the send payload is `fileIds`. Don't hand-roll
56
+ `createObjectURL`/upload/revoke per app.
54
57
  - **List members** — **`useMembers(opts?)`** → `{ members: {id,name,email,image}[], loading, error }`
55
58
  — the candidate set for an assign/picker. Gated: the app must declare a `member`-typed input
56
59
  (`opts.group` restricts to a declared group). Render with `@lotics/ui` `MemberSelect` / `MemberChip`.
@@ -355,7 +355,13 @@ interface AttachmentsState {
355
355
  * const { files, add, remove, clear, uploading, fileIds } = useAttachments();
356
356
  * const design = useWorkflow("design");
357
357
  * // attach: <Button icon="paperclip" onPress={() => pickFiles({ accept: "image/*" }).then(add)} />
358
- * // preview: files.map((f) => <FileThumbnail file={f} uploading={f.status === "uploading"} onRemove={() => remove(f.id)} />)
358
+ * // preview: map each AttachedFile to a @lotics/ui DisplayFile (snake_case camelCase) — the
359
+ * // app owns this data→UI adapter; the SDK never imports @lotics/ui:
360
+ * // files.map((f) => (
361
+ * // <FileThumbnail
362
+ * // file={{ id: f.id, filename: f.filename, mimeType: f.mime_type, url: f.preview_url }}
363
+ * // uploading={f.status === "uploading"} onRemove={() => remove(f.id)} />
364
+ * // ))
359
365
  * // send: design({ photo: fileIds[0] }); clear();
360
366
  * ```
361
367
  */
package/dist/src/hooks.js CHANGED
@@ -259,7 +259,13 @@ let attachSeq = 0;
259
259
  * const { files, add, remove, clear, uploading, fileIds } = useAttachments();
260
260
  * const design = useWorkflow("design");
261
261
  * // attach: <Button icon="paperclip" onPress={() => pickFiles({ accept: "image/*" }).then(add)} />
262
- * // preview: files.map((f) => <FileThumbnail file={f} uploading={f.status === "uploading"} onRemove={() => remove(f.id)} />)
262
+ * // preview: map each AttachedFile to a @lotics/ui DisplayFile (snake_case camelCase) — the
263
+ * // app owns this data→UI adapter; the SDK never imports @lotics/ui:
264
+ * // files.map((f) => (
265
+ * // <FileThumbnail
266
+ * // file={{ id: f.id, filename: f.filename, mimeType: f.mime_type, url: f.preview_url }}
267
+ * // uploading={f.status === "uploading"} onRemove={() => remove(f.id)} />
268
+ * // ))
263
269
  * // send: design({ photo: fileIds[0] }); clear();
264
270
  * ```
265
271
  */
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lotics/app-sdk",
3
- "version": "0.36.0",
3
+ "version": "0.36.1",
4
4
  "description": "Runtime SDK for Lotics custom-code apps — typed hooks, postMessage bridge, mount entry point",
5
5
  "type": "module",
6
6
  "exports": {