@civitai/blocks-react 0.65.1 → 0.65.2
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 +21 -10
- package/package.json +4 -4
package/README.md
CHANGED
|
@@ -1143,10 +1143,25 @@ The viewer searches in host chrome; the block only ever sees the one resource it
|
|
|
1143
1143
|
picked. DISCOVERY ONLY — the returned `versionId` is re-validated + re-priced
|
|
1144
1144
|
server-side at estimate/submit.
|
|
1145
1145
|
|
|
1146
|
-
🔴 **
|
|
1147
|
-
|
|
1148
|
-
the
|
|
1149
|
-
|
|
1146
|
+
🔴 **OMIT `baseModelGroup` BY DEFAULT, and never pass a HARDCODED ecosystem.** It
|
|
1147
|
+
is an ecosystem-family FILTER, not a label: the host hides every resource outside
|
|
1148
|
+
the family you pass, so a literal ecosystem string makes the viewer's own valid
|
|
1149
|
+
LoRAs invisible and the picker look empty or broken. Omit it for an unconstrained
|
|
1150
|
+
pick and the viewer sees everything of that type. Pass it ONLY when the block
|
|
1151
|
+
already holds a chosen checkpoint the pick has to match, and then DERIVE it from
|
|
1152
|
+
that checkpoint (`checkpoint.baseModel`). For stack and matrix apps that pair
|
|
1153
|
+
LoRAs with a checkpoint, this is the recommended pattern: a derived family keeps
|
|
1154
|
+
incompatible LoRAs out of the picker. This hook is PAGE-ONLY, and a page slot has
|
|
1155
|
+
no `context.checkpoint` (that field lives on `ModelSlotContext` alone), so the
|
|
1156
|
+
family comes from `BlockResourceInfo.baseModel`, the `baseModel` of a Checkpoint
|
|
1157
|
+
a picker returned earlier.
|
|
1158
|
+
|
|
1159
|
+
For a complete multi-LoRA app, see
|
|
1160
|
+
[`starters/examples/generate-studio`](https://github.com/civitai/civitai-app-starters/tree/main/starters/examples/generate-studio):
|
|
1161
|
+
`src/components/ModelSection.tsx` opens the picker once per LoRA slot, up to
|
|
1162
|
+
`MAX_LORAS`, with a `baseModelGroup` derived from the selected checkpoint, and
|
|
1163
|
+
`keepCompatibleLoras` (`src/studio/setup.ts`) re-filters the stack when the
|
|
1164
|
+
checkpoint changes, dropping LoRAs made for another family.
|
|
1150
1165
|
|
|
1151
1166
|
```tsx
|
|
1152
1167
|
const { open } = useResourcePicker();
|
|
@@ -1157,12 +1172,8 @@ if (picked) {
|
|
|
1157
1172
|
}
|
|
1158
1173
|
```
|
|
1159
1174
|
|
|
1160
|
-
|
|
1161
|
-
|
|
1162
|
-
🔴 **This hook is PAGE-ONLY, and a page slot has no `context.checkpoint`** — that
|
|
1163
|
-
field lives on `ModelSlotContext` alone, so the family comes from
|
|
1164
|
-
`BlockResourceInfo.baseModel`, the `baseModel` of a Checkpoint this same picker
|
|
1165
|
-
returned earlier:
|
|
1175
|
+
Constrained to the family of a checkpoint the block already holds, derived from
|
|
1176
|
+
that checkpoint, never from a literal:
|
|
1166
1177
|
|
|
1167
1178
|
```tsx
|
|
1168
1179
|
const { open } = useResourcePicker();
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@civitai/blocks-react",
|
|
3
|
-
"version": "0.65.
|
|
3
|
+
"version": "0.65.2",
|
|
4
4
|
"description": "React hooks and iframe transport for Civitai Apps. Pairs with @civitai/app-sdk/blocks.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"type": "module",
|
|
@@ -37,8 +37,8 @@
|
|
|
37
37
|
"node": ">=20"
|
|
38
38
|
},
|
|
39
39
|
"dependencies": {
|
|
40
|
-
"@civitai/
|
|
41
|
-
"@civitai/
|
|
40
|
+
"@civitai/theme": "^0.5.2",
|
|
41
|
+
"@civitai/components": "^0.9.3"
|
|
42
42
|
},
|
|
43
43
|
"comment-peerDependencies": "This floor is DERIVED, not chosen — the lowest published app-sdk that exports every symbol this package imports. Do not edit it without reading ./PEER_FLOOR.md (in-repo, unpublished) and tests/guards/blocks-react-peer-floor.test.mjs.",
|
|
44
44
|
"peerDependencies": {
|
|
@@ -58,7 +58,7 @@
|
|
|
58
58
|
"typescript": "^5.9.2",
|
|
59
59
|
"vite": "^8.0.14",
|
|
60
60
|
"vitest": "^4.1.11",
|
|
61
|
-
"@civitai/app-sdk": "^0.
|
|
61
|
+
"@civitai/app-sdk": "^0.60.0"
|
|
62
62
|
},
|
|
63
63
|
"publishConfig": {
|
|
64
64
|
"access": "public"
|