@rippling/pebble-sdui-mobile 1.1.5 → 1.1.6
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/catalogs/custom-apps/catalog.d.ts +1 -1
- package/dist/catalogs/custom-apps/component-props.d.ts +21 -21
- package/dist/catalogs/custom-apps/index.cjs +7 -7
- package/dist/catalogs/custom-apps/index.cjs.map +1 -1
- package/dist/catalogs/custom-apps/index.js +2822 -2925
- package/dist/catalogs/custom-apps/index.js.map +1 -1
- package/dist/core/expressions.d.ts +2 -2
- package/dist/core/spec.cjs +1 -1
- package/dist/core/spec.cjs.map +1 -1
- package/dist/core/spec.js +62 -54
- package/dist/core/spec.js.map +1 -1
- package/dist/docs/concepts.md +13 -14
- package/dist/docs/typescript/api-reference.md +6 -7
- package/dist/docs/typescript/mobile/catalogs/custom-apps/components.md +21 -21
- package/dist/docs/typescript/mobile/catalogs/custom-apps/readme.md +1 -1
- package/dist/docs/typescript/recipes.md +14 -10
- package/package.json +1 -1
|
@@ -164,7 +164,7 @@ Rendered prop shape:
|
|
|
164
164
|
}
|
|
165
165
|
```
|
|
166
166
|
|
|
167
|
-
Put plain words directly in the template string.
|
|
167
|
+
Put plain words directly in the template string; interpolate only state refs, `null`, or `undefined`. In repeated children, use an item ref directly for a plain value. On web runtimes with standard directives, use `$concat('Task: ', item.$('title'))` for combined text instead of interpolating item or index refs in `$template`.
|
|
168
168
|
|
|
169
169
|
## Show Or Hide Components With Conditions
|
|
170
170
|
|
|
@@ -230,7 +230,7 @@ Both branches should resolve to the same prop type.
|
|
|
230
230
|
|
|
231
231
|
## Repeat Over Runtime Lists
|
|
232
232
|
|
|
233
|
-
Use `repeat(path, key?)`
|
|
233
|
+
Use `repeat(path, key?)` to render a container's children once per item in a state array. To repeat a Card, put it inside that container.
|
|
234
234
|
|
|
235
235
|
```ts
|
|
236
236
|
interface Todo {
|
|
@@ -253,11 +253,16 @@ const { repeat } = createSpec<AppState>({
|
|
|
253
253
|
|
|
254
254
|
const [todoRepeat, todo] = repeat('/todos', 'id');
|
|
255
255
|
|
|
256
|
-
|
|
256
|
+
VStack({
|
|
257
257
|
repeat: todoRepeat,
|
|
258
|
-
props: {
|
|
259
|
-
|
|
260
|
-
|
|
258
|
+
props: { gap: 'space300' },
|
|
259
|
+
children: [
|
|
260
|
+
Card({
|
|
261
|
+
id: 'todo-card',
|
|
262
|
+
props: { padding: 'space300' },
|
|
263
|
+
children: [Text({ props: { text: todo.$('title') } })],
|
|
264
|
+
}),
|
|
265
|
+
],
|
|
261
266
|
});
|
|
262
267
|
```
|
|
263
268
|
|
|
@@ -265,17 +270,16 @@ Rendered shape includes:
|
|
|
265
270
|
|
|
266
271
|
```json
|
|
267
272
|
{
|
|
273
|
+
"type": "VStack",
|
|
268
274
|
"repeat": {
|
|
269
275
|
"statePath": "/todos",
|
|
270
276
|
"key": "id"
|
|
271
277
|
},
|
|
272
|
-
"
|
|
273
|
-
"text": { "$item": "title" }
|
|
274
|
-
}
|
|
278
|
+
"children": ["todo-card"]
|
|
275
279
|
}
|
|
276
280
|
```
|
|
277
281
|
|
|
278
|
-
Use `todo.$bind('field')` only when
|
|
282
|
+
Use `todo.$bind('field')` only when a repeated child should write back to that item field. Use `todo.$index()` when the UI needs the current item index.
|
|
279
283
|
|
|
280
284
|
## Use Components From A Catalog
|
|
281
285
|
|