@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 +6 -3
- package/dist/src/hooks.d.ts +7 -1
- package/dist/src/hooks.js +7 -1
- package/package.json +1 -1
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, `
|
|
52
|
-
|
|
53
|
-
|
|
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`.
|
package/dist/src/hooks.d.ts
CHANGED
|
@@ -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:
|
|
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:
|
|
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
|
*/
|