@lotics/app-sdk 0.90.0 → 0.90.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/dist/src/hooks.d.ts +5 -5
- package/dist/src/hooks.js +1 -1
- package/dist/src/index.d.ts +8 -9
- package/dist/src/index.js +8 -9
- package/dist/src/select.d.ts +1 -1
- package/docs/data_fetching.md +6 -6
- package/docs/files.md +9 -10
- package/docs/members_and_options.md +12 -12
- package/docs/runtime.md +6 -9
- package/package.json +1 -1
package/dist/src/hooks.d.ts
CHANGED
|
@@ -383,10 +383,10 @@ export interface FieldOptionsOptions {
|
|
|
383
383
|
* ```tsx
|
|
384
384
|
* const { fields } = useFieldOptions("records");
|
|
385
385
|
* // populate + color a picker:
|
|
386
|
-
* <
|
|
387
|
-
* renderOptionContent={(o) => <
|
|
386
|
+
* <Select variant="native" options={fields.status?.options ?? []}
|
|
387
|
+
* renderOptionContent={(o) => <Status option={o} />} />
|
|
388
388
|
* // color a stored value:
|
|
389
|
-
* <
|
|
389
|
+
* <Status option={fields.status?.byKey(readSelect(r.status)[0]?.key ?? "")} />
|
|
390
390
|
* ```
|
|
391
391
|
*/
|
|
392
392
|
export declare function useFieldOptions<K extends keyof AppQueries & string>(alias: K, opts?: FieldOptionsOptions): FieldOptionsState;
|
|
@@ -448,7 +448,7 @@ export declare function usePaginatedQuery<K extends string>(alias: K, ...args: Q
|
|
|
448
448
|
*
|
|
449
449
|
* ```tsx
|
|
450
450
|
* const { total } = useCount("orders", { q }, { filter: unpaidFilter });
|
|
451
|
-
* return <
|
|
451
|
+
* return <Status label={total == null ? "…" : `${total}`} />;
|
|
452
452
|
* ```
|
|
453
453
|
*/
|
|
454
454
|
export declare function useCount<K extends string>(alias: K, ...args: QueryArgs<K, CountOptions<ColumnKeyOf<K>>>): CountState;
|
|
@@ -619,7 +619,7 @@ export interface MembersOptions {
|
|
|
619
619
|
*
|
|
620
620
|
* ```tsx
|
|
621
621
|
* const { members } = useMembers({ group: "grp_..." });
|
|
622
|
-
* // <
|
|
622
|
+
* // <Select variant="native" options={members.map((m) => ({
|
|
623
623
|
* // value: m.id, label: m.name || m.email || m.id, image: m.image,
|
|
624
624
|
* // }))} />
|
|
625
625
|
* ```
|
package/dist/src/hooks.js
CHANGED
|
@@ -536,7 +536,7 @@ export function useAiContext(slot, context) {
|
|
|
536
536
|
*
|
|
537
537
|
* ```tsx
|
|
538
538
|
* const { members } = useMembers({ group: "grp_..." });
|
|
539
|
-
* // <
|
|
539
|
+
* // <Select variant="native" options={members.map((m) => ({
|
|
540
540
|
* // value: m.id, label: m.name || m.email || m.id, image: m.image,
|
|
541
541
|
* // }))} />
|
|
542
542
|
* ```
|
package/dist/src/index.d.ts
CHANGED
|
@@ -4,15 +4,14 @@
|
|
|
4
4
|
* "@lotics/app-sdk"` and ship the resulting bundle via `lotics app deploy`.
|
|
5
5
|
*
|
|
6
6
|
* This SDK is data + RPC only — it deliberately does NOT re-export any
|
|
7
|
-
* `@lotics/ui`
|
|
8
|
-
*
|
|
9
|
-
*
|
|
10
|
-
*
|
|
11
|
-
*
|
|
12
|
-
*
|
|
13
|
-
*
|
|
14
|
-
*
|
|
15
|
-
* not raw HTML/CSS. See `docs/apps.md` → "Styling & components".
|
|
7
|
+
* `@lotics/ui` component, so an app's dependency on the kit is its own and one
|
|
8
|
+
* version answers for it. That is a packaging choice, NOT a limitation: apps
|
|
9
|
+
* import `@lotics/ui` directly as an ordinary dependency. The starter scaffold
|
|
10
|
+
* (`packages/sdk/src/starter_template.ts`) wires it — the kit as a dependency,
|
|
11
|
+
* `@lotics/ui/styles.css` + `fonts.css` in the entry, and `loticsResolve()` as
|
|
12
|
+
* the whole `resolve` block. Build screens by composing kit components (Card,
|
|
13
|
+
* Metric, charts, Table, …), not raw HTML/CSS. See `docs/apps.md` → "Styling
|
|
14
|
+
* & components".
|
|
16
15
|
*/
|
|
17
16
|
export { mount } from "./mount.js";
|
|
18
17
|
export type { MountOptions } from "./mount.js";
|
package/dist/src/index.js
CHANGED
|
@@ -4,15 +4,14 @@
|
|
|
4
4
|
* "@lotics/app-sdk"` and ship the resulting bundle via `lotics app deploy`.
|
|
5
5
|
*
|
|
6
6
|
* This SDK is data + RPC only — it deliberately does NOT re-export any
|
|
7
|
-
* `@lotics/ui`
|
|
8
|
-
*
|
|
9
|
-
*
|
|
10
|
-
*
|
|
11
|
-
*
|
|
12
|
-
*
|
|
13
|
-
*
|
|
14
|
-
*
|
|
15
|
-
* not raw HTML/CSS. See `docs/apps.md` → "Styling & components".
|
|
7
|
+
* `@lotics/ui` component, so an app's dependency on the kit is its own and one
|
|
8
|
+
* version answers for it. That is a packaging choice, NOT a limitation: apps
|
|
9
|
+
* import `@lotics/ui` directly as an ordinary dependency. The starter scaffold
|
|
10
|
+
* (`packages/sdk/src/starter_template.ts`) wires it — the kit as a dependency,
|
|
11
|
+
* `@lotics/ui/styles.css` + `fonts.css` in the entry, and `loticsResolve()` as
|
|
12
|
+
* the whole `resolve` block. Build screens by composing kit components (Card,
|
|
13
|
+
* Metric, charts, Table, …), not raw HTML/CSS. See `docs/apps.md` → "Styling
|
|
14
|
+
* & components".
|
|
16
15
|
*/
|
|
17
16
|
export { mount } from "./mount.js";
|
|
18
17
|
export { useWorkflow, useQuery, useInfiniteQuery, usePaginatedQuery, useCount, useFieldOptions, useFileUpload, useAttachments, useMembers, useAgentRun, useAgentRuns, useAiContext, buildChoiceOutput, } from "./hooks.js";
|
package/dist/src/select.d.ts
CHANGED
|
@@ -18,7 +18,7 @@ export interface ResolvedOption {
|
|
|
18
18
|
* Named palette color token (e.g. `"blue"`, `"emerald"`). Populated by
|
|
19
19
|
* `useFieldOptions` (which reads the field config); absent on options read
|
|
20
20
|
* back from a query CELL via `readSelect` — a cell carries only key + label.
|
|
21
|
-
* Pass the resolved option straight to `@lotics/ui`'s `
|
|
21
|
+
* Pass the resolved option straight to `@lotics/ui`'s `Status`, which
|
|
22
22
|
* degrades a missing/unknown token to a neutral badge.
|
|
23
23
|
*/
|
|
24
24
|
color?: string;
|
package/docs/data_fetching.md
CHANGED
|
@@ -439,7 +439,7 @@ a partial as its period start.
|
|
|
439
439
|
|
|
440
440
|
**`readSelect`.** A query **cell** carries `key` + `label` only — `color` comes from
|
|
441
441
|
`useFieldOptions`, not the cell. An option deleted after the cell was written surfaces as
|
|
442
|
-
`label === key` (the stale state is explicit, never hidden). Render with `@lotics/ui` `
|
|
442
|
+
`label === key` (the stale state is explicit, never hidden). Render with `@lotics/ui` `Status`
|
|
443
443
|
— see [./members_and_options.md](./members_and_options.md).
|
|
444
444
|
|
|
445
445
|
**`readMembers`.** `name` is `null` when the id doesn't resolve in the app's org (e.g. a removed
|
|
@@ -477,7 +477,7 @@ A query cell carries only the options a record actually holds (key + label, no c
|
|
|
477
477
|
**complete** option list of a select column — every option including those in no current row, with
|
|
478
478
|
colors — use **`useFieldOptions`**, and prefer it over deriving options from loaded rows
|
|
479
479
|
(row-derived sets are incomplete until every page loads and carry no colors). Its full contract
|
|
480
|
-
(return shape, `byKey`, `opts.enabled`, freshness), rendering the values (`
|
|
480
|
+
(return shape, `byKey`, `opts.enabled`, freshness), rendering the values (`Status`,
|
|
481
481
|
`MemberChip`, `MemberSelect`), and the member roster (`useMembers`) live in
|
|
482
482
|
[./members_and_options.md](./members_and_options.md).
|
|
483
483
|
|
|
@@ -510,7 +510,7 @@ pieces. Compose these — don't hand-roll search:
|
|
|
510
510
|
|
|
511
511
|
- **`Combobox`** (`@lotics/ui/combobox`) owns the interaction — debounced `onSearchChange`, a
|
|
512
512
|
popover listbox with rich rows (`renderOptionContent`), keyboard navigation, `recentOptions`,
|
|
513
|
-
`allowCustom`. (For a known small list with no search box, `
|
|
513
|
+
`allowCustom`. (For a known small list with no search box, `Select`.)
|
|
514
514
|
- **A parameterized `search` query** — a `from_table` with `search: "{{params.q}}"` over the
|
|
515
515
|
maintained search document: **diacritics- and case-insensitive**, trigram-indexed, and AND-ed
|
|
516
516
|
with the template's `filter` (search within a scope). The full `search` contract is in
|
|
@@ -540,7 +540,7 @@ const [typed, setTyped] = useState(""); // the input's own value, every
|
|
|
540
540
|
const [term, setTerm] = useState(""); // what the server is asked, once typing settles
|
|
541
541
|
const commit = useDebouncedCallback(setTerm, 250);
|
|
542
542
|
|
|
543
|
-
<
|
|
543
|
+
<TextInput type="search" value={typed} onChangeText={(v) => { setTyped(v); commit(v.trim()); }} />;
|
|
544
544
|
|
|
545
545
|
const { rows, loading } = useQuery(
|
|
546
546
|
"searchCustomers",
|
|
@@ -560,8 +560,8 @@ relationship exists.
|
|
|
560
560
|
When the user doesn't know the term — "show me everything, let me narrow it" — build a modal table
|
|
561
561
|
they can browse (numbered pages), search, sort, and filter:
|
|
562
562
|
|
|
563
|
-
- **The screen is app-owned**, composed from `@lotics/ui`: a `Dialog` over `
|
|
564
|
-
pills (`
|
|
563
|
+
- **The screen is app-owned**, composed from `@lotics/ui`: a `Dialog` over a search `TextInput` + filter
|
|
564
|
+
pills (`FilterChip column=`) + `Table` + `Pagination`. It needs both `@lotics/ui` and the SDK (which is
|
|
565
565
|
UI-free), so it lives in the app (e.g. a `record_picker.tsx`) — reuse it for any table by passing
|
|
566
566
|
a different `alias` + column config.
|
|
567
567
|
- **`usePaginatedQuery`** drives it: the page of rows, the `total` for "Page 1 of N" (the built-in
|
package/docs/files.md
CHANGED
|
@@ -19,7 +19,7 @@ discipline in [data fetching](./data_fetching.md).
|
|
|
19
19
|
| Attach to a record | a declared workflow with a `{ type: "file" }` input | the workflow writes the id(s) into a `files` field — the **only** write path |
|
|
20
20
|
| Read back from records | `useQuery` + `readFiles(cell)` | `AppFile[]` — presigned `url`/`thumbnail_url` (24 h) + `size`/`created_at` |
|
|
21
21
|
| Receive a generated document | `useWorkflow` → `WorkflowResult.files` | presigned files auto-extracted from the run |
|
|
22
|
-
| Show it | `@lotics/ui` `FileThumbnail` / `
|
|
22
|
+
| Show it | `@lotics/ui` `FileThumbnail` / `FileThumbnailGrid` / `FileGalleryDialog` | map to `DisplayFile` (see below) |
|
|
23
23
|
| Save browser-built bytes | `downloadFile(filename, data, mimeType?)` | a client-side download (see [runtime](./runtime.md)) |
|
|
24
24
|
|
|
25
25
|
An uploaded file is **inert until a workflow attaches it** — it has an id and serving URLs, but
|
|
@@ -175,10 +175,10 @@ Each `AttachedFile` is `{ id, filename, mime_type, preview_url, status, file_id?
|
|
|
175
175
|
|
|
176
176
|
Wiring to `@lotics/ui`: in a `Composer`, trigger picking from `actionsButton` (via `pickFiles`),
|
|
177
177
|
render the attachment pills with `FileThumbnail` as above, and gate `sendDisabled` on `uploading`.
|
|
178
|
-
For a full add-files *screen* (not a composer pill), map each `AttachedFile` to a
|
|
179
|
-
`FileUpload` entry — ready → `{ status: "complete", id: file_id, file:
|
|
180
|
-
`{ status, id, filename, mimeType: mime_type, previewUrl: preview_url }`
|
|
181
|
-
the uploading/error/retry tiles itself.
|
|
178
|
+
For a full add-files *screen* (not a composer pill), map each `AttachedFile` to a
|
|
179
|
+
`FileThumbnailGrid` `FileUpload` entry — ready → `{ status: "complete", id: file_id, file:
|
|
180
|
+
<DisplayFile> }`, else `{ status, id, filename, mimeType: mime_type, previewUrl: preview_url }`
|
|
181
|
+
— and the grid renders the uploading/error/retry tiles itself.
|
|
182
182
|
|
|
183
183
|
## File cells in query results — `readFiles` and `AppFile`
|
|
184
184
|
|
|
@@ -325,11 +325,10 @@ not viewing). Component contracts live in the `@lotics/ui` reference
|
|
|
325
325
|
For an `AttachedFile` still uploading, map `preview_url` → `url` (there is no server URL yet).
|
|
326
326
|
The app owns this data→UI adapter — the SDK deliberately never imports `@lotics/ui`.
|
|
327
327
|
|
|
328
|
-
- **`FileThumbnail`** — one square tile; `uploading`
|
|
329
|
-
`
|
|
330
|
-
- **`
|
|
331
|
-
|
|
332
|
-
- **`FileGalleryModal`** — the full-screen viewer (filename · counter · actions · close, with
|
|
328
|
+
- **`FileThumbnail`** — one square tile; `uploading` takes the queue status and overlays the
|
|
329
|
+
scrim, the spinner or the retry, images fall back from `previewUrl` to `thumbnailUrl` to `url`.
|
|
330
|
+
- **`FileThumbnailGrid`** — a grid of stored files plus a live `uploads` queue, in one grid.
|
|
331
|
+
- **`FileGalleryDialog`** — the full-screen viewer (filename · counter · actions · close, with
|
|
333
332
|
prev/next + ESC), delegating per-file to **`FilePreview`**, which dispatches by MIME. Wire
|
|
334
333
|
`onFilePress` → a `number | null` `activeIndex`.
|
|
335
334
|
- PDF renders **inline to a canvas** (a nested PDF browsing context is blocked in the sandboxed
|
|
@@ -4,7 +4,7 @@ How an app renders and picks **people** and **select-field options**, plus the *
|
|
|
4
4
|
surface. Covers the two cell readers (`readSelect`, `readMembers`), the two catalog hooks
|
|
5
5
|
(`useFieldOptions`, `useMembers`), the viewer identity hook (`useViewer`), comments
|
|
6
6
|
(`useComments`, `useCommentCounts`), and the `@lotics/ui` components they feed. Read this before
|
|
7
|
-
building an assign picker, a colored
|
|
7
|
+
building an assign picker, a colored `Status` mark, a per-viewer ("my records") screen, or a
|
|
8
8
|
comment thread. Query mechanics live in [queries](./queries.md); the authority model in
|
|
9
9
|
[security](./security.md).
|
|
10
10
|
|
|
@@ -61,7 +61,7 @@ const { fields } = useFieldOptions("orders"); // same alias you query
|
|
|
61
61
|
// are { value, label }, so map the option key to `value`):
|
|
62
62
|
<Select
|
|
63
63
|
options={(fields.status?.options ?? []).map((o) => ({ value: o.key, label: o.label }))}
|
|
64
|
-
renderOptionContent={(o) => <
|
|
64
|
+
renderOptionContent={(o) => <Status option={fields.status?.byKey(o.value)} />}
|
|
65
65
|
value={status} onValueChange={setStatus}
|
|
66
66
|
/>
|
|
67
67
|
```
|
|
@@ -78,7 +78,7 @@ name**, not the field key. Each `FieldOptions`:
|
|
|
78
78
|
| `byKey(key)` | Resolve one option by key; `undefined` for an unknown key (option removed after the cell was written) |
|
|
79
79
|
|
|
80
80
|
- `color` is a named palette token (e.g. `"blue"`, `"emerald"`). Pass the option straight to
|
|
81
|
-
`@lotics/ui`'s `
|
|
81
|
+
`@lotics/ui`'s `Status`; a missing/unrecognized token degrades to a neutral badge.
|
|
82
82
|
- **A column the server can't map to a single source select field is simply absent** from
|
|
83
83
|
`fields` — a UNION output whose arms disagree on the source field, or a computed column. Read
|
|
84
84
|
defensively: `fields.status?.options ?? []`.
|
|
@@ -99,7 +99,7 @@ until an edit drawer opens). State: `{ fields, loading, isValidating, error, ref
|
|
|
99
99
|
|
|
100
100
|
```tsx
|
|
101
101
|
const opt = readSelect(row.status)[0];
|
|
102
|
-
<
|
|
102
|
+
<Status option={opt ? (fields.status?.byKey(opt.key) ?? opt) : null} />
|
|
103
103
|
```
|
|
104
104
|
|
|
105
105
|
`byKey` hit → the configured color. `byKey` miss (option removed post-write) → fall back to the
|
|
@@ -128,12 +128,12 @@ projected `select_member` cell to `Array<{ id, name, email?, image?, groups?, ro
|
|
|
128
128
|
"Admin" beside a name as rank. If the question your screen asks is "who is this person in the
|
|
129
129
|
company", the answer is `groups`.
|
|
130
130
|
- **`joined` is an ISO timestamp of when the membership began.** Render it at whatever precision
|
|
131
|
-
your question needs — `@lotics/ui`'s `
|
|
131
|
+
your question needs — `@lotics/ui`'s `MemberPeek` shows month and year, because "is this
|
|
132
132
|
the new person?" does not want a day. Absent on a public response, and on an id that did not
|
|
133
133
|
resolve: there is no membership to have begun.
|
|
134
134
|
- **`archived: true` marks someone who has LEFT** — omitted otherwise, never `false`. It is the one
|
|
135
135
|
field that is NOT gated (a departed colleague reading as a current assignee is wrong on a public
|
|
136
|
-
app too). Feed it to `inactive` on `MemberChip` / `
|
|
136
|
+
app too). Feed it to `inactive` on `MemberChip` / `MemberPeek`.
|
|
137
137
|
- **An id that no longer resolves** (removed member, id outside the org) comes back with
|
|
138
138
|
`name: null` — an explicit missing state, never an empty string. Render a placeholder.
|
|
139
139
|
- Only ids already present in the projected rows are resolved — a member cell never exposes the
|
|
@@ -256,7 +256,7 @@ client-side up front, and re-checked server-side.
|
|
|
256
256
|
- **The author is always the real signed-in member** — correct attribution, enforced server-side.
|
|
257
257
|
**Warning:** under "View as", comments still author as the real member (the admin), not the
|
|
258
258
|
view-as target — unlike `useViewer` and `is_current_member` scoping, which follow the target.
|
|
259
|
-
- **Edit and delete are author-only**, checked server-side against the viewer. `
|
|
259
|
+
- **Edit and delete are author-only**, checked server-side against the viewer. `CommentThread`'s
|
|
260
260
|
`currentMemberId` prop drives the matching affordance client-side.
|
|
261
261
|
|
|
262
262
|
### Reading & writing
|
|
@@ -277,13 +277,13 @@ renders the panel. State: `{ comments, loading, error, available, createComment,
|
|
|
277
277
|
updateComment, deleteComment, refetch }`.
|
|
278
278
|
|
|
279
279
|
- `comments` — newest first on the wire (server order). Pass the array as-is to `@lotics/ui`'s
|
|
280
|
-
`
|
|
280
|
+
`CommentThread`, which re-sorts oldest-first for display. Each `AppComment`: `{ id, record_id,
|
|
281
281
|
table_id, member_id, content, files, workspace_id, created_at, updated_at }`. Attachments
|
|
282
282
|
(`AppCommentFile`) carry `id` / `filename` / `mime_type` — a file's identity is its `id`, and
|
|
283
283
|
the server re-reads every attachment from storage by that id, so nothing else you hold about a
|
|
284
284
|
file can affect what is stored. The `url` / `thumbnail_url` / `preview_url` fields exist on the type
|
|
285
285
|
but the server does not populate them today — render attachments by name and type (what
|
|
286
|
-
`
|
|
286
|
+
`CommentThread`'s default file row does), never by counting on a fetchable URL.
|
|
287
287
|
- `createComment({ content, file_ids? })` — posts as the viewing member. `file_ids` come from
|
|
288
288
|
`useFileUpload` / `useAttachments` (see [files](./files.md)). A comment must have content or at
|
|
289
289
|
least one file (empty input is a client no-op; the server enforces the same rule). Content max
|
|
@@ -296,7 +296,7 @@ updateComment, deleteComment, refetch }`.
|
|
|
296
296
|
on it.
|
|
297
297
|
- **Limitation:** a comment carries `member_id` only — resolving the author's display name needs a
|
|
298
298
|
member source: the `useMembers` roster (requires the member-access declaration above) or member
|
|
299
|
-
cells in your own data. An unresolvable id should render a fallback (`
|
|
299
|
+
cells in your own data. An unresolvable id should render a fallback (`CommentThread` has an
|
|
300
300
|
`unknownMember` label for exactly this).
|
|
301
301
|
- **Freshness:** SWR-cached, revalidates on focus/reconnect, so another viewer's comment appears on
|
|
302
302
|
the next focus or explicit `refetch()` — not on its own. Comments are the one read that does not
|
|
@@ -320,10 +320,10 @@ directly (full props: `node_modules/@lotics/ui/AGENTS.md` and its `docs/`):
|
|
|
320
320
|
|
|
321
321
|
| Value | Component | Feed it |
|
|
322
322
|
| --- | --- | --- |
|
|
323
|
-
| A select value (stored or picker option) | `
|
|
323
|
+
| A select value (stored or picker option) | `Status` | A `useFieldOptions` option, or `byKey(readSelect(cell)[0]?.key)`; accepts a single option, an array (multi → one badge each), or null (renders nothing). Missing/unknown color → neutral. |
|
|
324
324
|
| A person, inline | `MemberChip` | `name` / `image` from a roster or a cell — both carry it; no image → initials |
|
|
325
325
|
| A member picker | `MemberSelect` | `members={useMembers().members}` — renders each option as a `MemberChip`; `MEMBER_UNASSIGNED` marks its optional "unassigned" option |
|
|
326
|
-
| A comment thread | `
|
|
326
|
+
| A comment thread | `CommentThread` + `CommentComposer` | `useComments` state; `resolveMember` bridges `member_id` → your member source |
|
|
327
327
|
|
|
328
328
|
The SDK never imports `@lotics/ui` — the app owns the (thin) data→UI adapter in each row above.
|
|
329
329
|
|
package/docs/runtime.md
CHANGED
|
@@ -266,7 +266,7 @@ page (standalone). Opens in a new tab with `noopener,noreferrer`.
|
|
|
266
266
|
- Typical use: opening a workflow-generated file's `url` from
|
|
267
267
|
`WorkflowResult.files[]` (see [mutations](./mutations.md)).
|
|
268
268
|
- **Not a preview mechanism.** To *view* a file inline, use `@lotics/ui`'s
|
|
269
|
-
`FilePreview`/`
|
|
269
|
+
`FilePreview`/`FileGalleryDialog` (`@lotics/ui` ≥ 48 — see [files](./files.md)); `openExternal` is
|
|
270
270
|
"leave the app".
|
|
271
271
|
|
|
272
272
|
## `openApp()` — the cross-app hop
|
|
@@ -445,14 +445,11 @@ is a transport that wasn't wired.
|
|
|
445
445
|
no dynamic `import()`, no Node built-ins. Don't touch `window` at module top
|
|
446
446
|
level — resolve lazily (test environments import modules before `jsdom` is
|
|
447
447
|
ready).
|
|
448
|
-
- **
|
|
449
|
-
|
|
450
|
-
|
|
451
|
-
|
|
452
|
-
|
|
453
|
-
`@lotics/docx`) build under both. When a shared package must diverge per
|
|
454
|
-
target, use platform files (`x.web.ts` / `x.ts`) plus conditional package
|
|
455
|
-
`exports` — never a runtime `require` or dynamic import.
|
|
448
|
+
- **One module per entry.** A package apps share with the Lotics product
|
|
449
|
+
(`@lotics/ui`, `@lotics/xlsx`, `@lotics/docx`) ships ONE module per entry: no
|
|
450
|
+
platform twins, no per-target `exports` condition. The SDK itself is never
|
|
451
|
+
bundled by the product at all — the host frontend is forbidden from importing
|
|
452
|
+
`@lotics/app-sdk`, enforced by a dependency-direction test.
|
|
456
453
|
- **Self-contained on npm.** The SDK cannot import workspace-private or
|
|
457
454
|
host-only packages (`@lotics/shared`, `@lotics/ui-internal`, the frontend's
|
|
458
455
|
`@/` alias) or any React Native / Expo module — also test-enforced. A helper
|