@lotics/ui 14.3.0 → 14.3.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/docs/ai_patterns.md +3 -1
- package/examples/tpl_item_list.tsx +17 -1
- package/package.json +3 -6
package/docs/ai_patterns.md
CHANGED
|
@@ -149,7 +149,9 @@ list is already inverted and doesn't need the wrapper.
|
|
|
149
149
|
|
|
150
150
|
Fed natively by `@lotics/app-sdk`'s `useAgentRun().parts` (reasoning + per-tool I/O + state come
|
|
151
151
|
for free — no hand-assembly): `<AgentRun parts={run.parts} state={…} error={run.error} />` — see
|
|
152
|
-
[the SDK doc](../../app-sdk/docs/ai.md) for the hook.
|
|
152
|
+
[the SDK doc](../../app-sdk/docs/ai.md) for the hook. The `ai` package is a regular dependency of
|
|
153
|
+
`@lotics/ui` — its part TYPES resolve transitively in any consumer's typecheck with nothing to
|
|
154
|
+
install; the imports are type-only (purity-enforced), so no `ai` runtime ever enters a bundle.
|
|
153
155
|
**Reasoning only shows when the model produces it** — the declared model must support thinking
|
|
154
156
|
(Sonnet / Opus, not Haiku); the renderer shows every reasoning part it's handed.
|
|
155
157
|
|
|
@@ -1111,6 +1111,10 @@ function EnterDataDialog({ onCreate, onCreateMany }: {
|
|
|
1111
1111
|
const [fileNames, setFileNames] = useState<string[]>([]);
|
|
1112
1112
|
const [variant, setVariant] = useState<ManualVariant>("export");
|
|
1113
1113
|
const [grouping, setGrouping] = useState<"customer" | "order">("customer");
|
|
1114
|
+
// Q2's answer is load-bearing too: it decides how the unknown customer lands
|
|
1115
|
+
// on the drafted records (create + link, leave unlinked, or the user's own
|
|
1116
|
+
// instruction via the custom slot).
|
|
1117
|
+
const [customerPlan, setCustomerPlan] = useState("New customer created and linked");
|
|
1114
1118
|
// review state — per-card verdicts + the one editable value (the fee)
|
|
1115
1119
|
const [cardStatus, setCardStatus] = useState<Record<string, ChangeStatus>>({});
|
|
1116
1120
|
const [fees, setFees] = useState<Record<string, string>>({});
|
|
@@ -1151,6 +1155,7 @@ function EnterDataDialog({ onCreate, onCreateMany }: {
|
|
|
1151
1155
|
setFileNames([]);
|
|
1152
1156
|
setCardStatus({});
|
|
1153
1157
|
setFees({});
|
|
1158
|
+
setCustomerPlan("New customer created and linked");
|
|
1154
1159
|
setKhach("");
|
|
1155
1160
|
setDienThoai("");
|
|
1156
1161
|
setPhi(null);
|
|
@@ -1233,6 +1238,14 @@ function EnterDataDialog({ onCreate, onCreateMany }: {
|
|
|
1233
1238
|
onCancel={() => setPhase("intake")}
|
|
1234
1239
|
onSubmit={(answers: ClarifyWizardAnswer[]) => {
|
|
1235
1240
|
setGrouping(answers[0]?.value === "order" ? "order" : "customer");
|
|
1241
|
+
const plan = answers[1];
|
|
1242
|
+
setCustomerPlan(
|
|
1243
|
+
plan?.custom
|
|
1244
|
+
? plan.value
|
|
1245
|
+
: plan?.value === "skip"
|
|
1246
|
+
? "Left unassigned — link a customer later"
|
|
1247
|
+
: "New customer created and linked",
|
|
1248
|
+
);
|
|
1236
1249
|
setPhase("running");
|
|
1237
1250
|
}}
|
|
1238
1251
|
/>
|
|
@@ -1256,6 +1269,9 @@ function EnterDataDialog({ onCreate, onCreateMany }: {
|
|
|
1256
1269
|
onUndo={() => setCardStatus((s) => ({ ...s, [p.id]: "pending" }))}
|
|
1257
1270
|
>
|
|
1258
1271
|
<ChangeField label="Customer" value={p.khach} summary={p.khach} />
|
|
1272
|
+
{p.khach === "Blue Harbor Foods" ? (
|
|
1273
|
+
<ChangeField label="Customer link" value={customerPlan} summary={customerPlan} />
|
|
1274
|
+
) : null}
|
|
1259
1275
|
{p.dienThoai ? <ChangeField label="Phone" value={p.dienThoai} summary={p.dienThoai} /> : null}
|
|
1260
1276
|
<ChangeField label="Service fee" value={fees[p.id] ?? String(p.phi)} summary={formatMoney(Number(fees[p.id] ?? p.phi) || 0)}>
|
|
1261
1277
|
<ChangeValueInput value={fees[p.id] ?? String(p.phi)} onChangeText={(v) => setFees((s) => ({ ...s, [p.id]: v }))} accessibilityLabel={`Service fee for ${p.khach}`} />
|
|
@@ -1316,7 +1332,7 @@ function EnterDataDialog({ onCreate, onCreateMany }: {
|
|
|
1316
1332
|
</DialogFooter>
|
|
1317
1333
|
) : phase === "review" ? (
|
|
1318
1334
|
<DialogFooter>
|
|
1319
|
-
<ChangeReviewActions onDiscard={close} onApply={applyProposals} applyLabel={`Add ${keptCount} ${keptCount === 1 ? "record" : "records"}`} />
|
|
1335
|
+
<ChangeReviewActions onDiscard={close} onApply={applyProposals} applyLabel={keptCount > 0 ? `Add ${keptCount} ${keptCount === 1 ? "record" : "records"}` : "Add records"} />
|
|
1320
1336
|
</DialogFooter>
|
|
1321
1337
|
) : null}
|
|
1322
1338
|
</Dialog>
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@lotics/ui",
|
|
3
|
-
"version": "14.3.
|
|
3
|
+
"version": "14.3.1",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"exports": {
|
|
6
6
|
"./vite": {
|
|
@@ -248,6 +248,7 @@
|
|
|
248
248
|
"dependencies": {
|
|
249
249
|
"@lotics/docx": "^0.1.0",
|
|
250
250
|
"@lotics/xlsx": "^0.1.0",
|
|
251
|
+
"ai": "^7.0.30",
|
|
251
252
|
"mdast-util-from-markdown": "^2.0.3",
|
|
252
253
|
"mdast-util-gfm-footnote": "^2.1.0",
|
|
253
254
|
"mdast-util-gfm-strikethrough": "^2.0.0",
|
|
@@ -266,13 +267,9 @@
|
|
|
266
267
|
"react-dom": "^19.2.0",
|
|
267
268
|
"react-native": ">=0.85.0",
|
|
268
269
|
"react-native-svg": ">=15.0.0",
|
|
269
|
-
"react-native-web": ">=0.20.0"
|
|
270
|
-
"ai": ">=7.0.0"
|
|
270
|
+
"react-native-web": ">=0.20.0"
|
|
271
271
|
},
|
|
272
272
|
"peerDependenciesMeta": {
|
|
273
|
-
"ai": {
|
|
274
|
-
"optional": true
|
|
275
|
-
},
|
|
276
273
|
"expo-image": {
|
|
277
274
|
"optional": true
|
|
278
275
|
},
|