@gramlot/gramlot-examples 0.2.10 → 0.2.12
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 +4 -3
- package/package.json +3 -3
- package/src/gramlot_examples/catalog.json +42 -3
- package/src/gramlot_examples/gallery/dist/frame.js +1473 -5
- package/src/gramlot_examples/gallery/dist/gallery.js +3822 -17162
- package/src/gramlot_examples/gallery/dist/notices.json +2 -22
- package/src/gramlot_examples/gallery/dist/theme-styles.js +2 -0
- package/src/gramlot_examples/gallery/gallery-page.js +38 -67
- package/src/gramlot_examples/gallery/gallery.css +22 -94
- package/src/gramlot_examples/index.js +2 -1
- package/src/gramlot_examples/pages/README.md +87 -4
- package/src/gramlot_examples/pages/binding/01_pointers.js +9 -0
- package/src/gramlot_examples/pages/binding/01_pointers.md +56 -9
- package/src/gramlot_examples/pages/binding/02_variable_datapath.md +50 -4
- package/src/gramlot_examples/pages/binding/03_setters_and_defaults.md +45 -6
- package/src/gramlot_examples/pages/binding/04_native_editing.md +48 -6
- package/src/gramlot_examples/pages/binding/05_checkbox_radio.md +44 -4
- package/src/gramlot_examples/pages/binding/06_style_and_visibility.md +40 -6
- package/src/gramlot_examples/pages/binding/07_bound_svg.md +48 -3
- package/src/gramlot_examples/pages/binding/08_freeze.js +1 -1
- package/src/gramlot_examples/pages/binding/08_freeze.md +44 -6
- package/src/gramlot_examples/pages/binding/09_forms.js +2 -1
- package/src/gramlot_examples/pages/binding/09_forms.md +53 -7
- package/src/gramlot_examples/pages/binding/10_svg_shapes.md +50 -5
- package/src/gramlot_examples/pages/binding/11_complete_page.md +53 -7
- package/src/gramlot_examples/pages/binding/README.md +34 -0
- package/src/gramlot_examples/pages/controllers/01_formula.md +48 -7
- package/src/gramlot_examples/pages/controllers/02_controller.js +24 -2
- package/src/gramlot_examples/pages/controllers/02_controller.md +61 -6
- package/src/gramlot_examples/pages/controllers/03_named_logic.md +63 -7
- package/src/gramlot_examples/pages/controllers/04_inline_expressions.md +50 -7
- package/src/gramlot_examples/pages/controllers/05_node_methods.md +41 -7
- package/src/gramlot_examples/pages/controllers/06_button_controller.md +49 -6
- package/src/gramlot_examples/pages/controllers/07_events.md +45 -6
- package/src/gramlot_examples/pages/controllers/08_end_to_end.js +26 -1
- package/src/gramlot_examples/pages/controllers/08_end_to_end.md +138 -9
- package/src/gramlot_examples/pages/controllers/09_endpoint.md +47 -7
- package/src/gramlot_examples/pages/controllers/10_call_on_change.md +48 -8
- package/src/gramlot_examples/pages/controllers/11_call_on_click.js +6 -0
- package/src/gramlot_examples/pages/controllers/11_call_on_click.md +58 -6
- package/src/gramlot_examples/pages/controllers/12_remote.js +33 -0
- package/src/gramlot_examples/pages/controllers/12_remote.md +60 -0
- package/src/gramlot_examples/pages/controllers/13_cached_remote.js +44 -0
- package/src/gramlot_examples/pages/controllers/13_cached_remote.md +67 -0
- package/src/gramlot_examples/pages/controllers/14_data_remote.js +39 -0
- package/src/gramlot_examples/pages/controllers/14_data_remote.md +69 -0
- package/src/gramlot_examples/pages/controllers/15_lifecycle.js +51 -0
- package/src/gramlot_examples/pages/controllers/15_lifecycle.md +59 -0
- package/src/gramlot_examples/pages/controllers/16_attribute_projection.js +25 -0
- package/src/gramlot_examples/pages/controllers/16_attribute_projection.md +58 -0
- package/src/gramlot_examples/pages/controllers/17_data_exchange.js +51 -0
- package/src/gramlot_examples/pages/controllers/17_data_exchange.md +61 -0
- package/src/gramlot_examples/pages/controllers/README.md +57 -3
- package/src/gramlot_examples/pages/html_svg/01_hello_world.md +48 -4
- package/src/gramlot_examples/pages/html_svg/02_text_and_links.md +42 -4
- package/src/gramlot_examples/pages/html_svg/03_lists.md +45 -4
- package/src/gramlot_examples/pages/html_svg/04_semantic_page.md +44 -4
- package/src/gramlot_examples/pages/html_svg/05_tables.md +46 -4
- package/src/gramlot_examples/pages/html_svg/06_forms.md +48 -4
- package/src/gramlot_examples/pages/html_svg/07_native_disclosure.md +41 -4
- package/src/gramlot_examples/pages/html_svg/08_svg_shapes.md +45 -4
- package/src/gramlot_examples/pages/html_svg/09_svg_composition.md +44 -4
- package/src/gramlot_examples/pages/html_svg/10_cards_with_icons.md +42 -15
- package/src/gramlot_examples/pages/html_svg/11_static_report.md +37 -4
- package/src/gramlot_examples/pages/html_svg/12_complete_page.md +41 -4
- package/src/gramlot_examples/pages/html_svg/13_live_source.md +47 -16
- package/src/gramlot_examples/pages/html_svg/README.md +36 -0
package/README.md
CHANGED
|
@@ -12,7 +12,7 @@ npm install @gramlot/gramlot-examples
|
|
|
12
12
|
[](https://pypi.org/project/gramlot-examples/)
|
|
13
13
|
[](https://www.npmjs.com/package/@gramlot/gramlot-examples)
|
|
14
14
|
|
|
15
|
-
Current release: 0.2.
|
|
15
|
+
Current release: 0.2.12.
|
|
16
16
|
|
|
17
17
|
The repositories of the family are described in
|
|
18
18
|
[The Gramlot family](https://github.com/gramlot-org/gramlot/blob/main/docs/public/055-family.md)
|
|
@@ -26,8 +26,9 @@ same-name README:
|
|
|
26
26
|
|
|
27
27
|
- `html_svg/`: thirteen HTML and SVG pages, without binding (`e01`–`e13`);
|
|
28
28
|
- `binding/`: eleven pages whose DOM follows the Data (`b01`–`b11`);
|
|
29
|
-
- `controllers/`:
|
|
30
|
-
end-to-end story
|
|
29
|
+
- `controllers/`: seventeen pages with formulas, controllers, named logic, events, the
|
|
30
|
+
end-to-end story, `dataRpc` calls to the endpoints of the page, `remote` fragments and
|
|
31
|
+
`dataRemote` values (`c01`–`c17`).
|
|
31
32
|
|
|
32
33
|
Each `NN_name.js` exports `Page` and `Logic`; the Python page `NN_name.py` takes its
|
|
33
34
|
`Logic` from the module beside it.
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@gramlot/gramlot-examples",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.12",
|
|
4
4
|
"description": "Gramlot example pages, the gallery page and its catalogue.",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"repository": {
|
|
@@ -14,10 +14,10 @@
|
|
|
14
14
|
"prepack": "node scripts/build-browser.mjs"
|
|
15
15
|
},
|
|
16
16
|
"dependencies": {
|
|
17
|
-
"@gramlot/gramlot": ">=0.2.
|
|
17
|
+
"@gramlot/gramlot": ">=0.2.17"
|
|
18
18
|
},
|
|
19
19
|
"devDependencies": {
|
|
20
|
-
"@genrojs/bag": ">=0.
|
|
20
|
+
"@genrojs/bag": ">=0.11.0",
|
|
21
21
|
"dompurify": "3.4.16",
|
|
22
22
|
"esbuild": "0.28.2",
|
|
23
23
|
"highlight.js": "^11.11.1",
|
|
@@ -154,7 +154,7 @@
|
|
|
154
154
|
"key": "b08",
|
|
155
155
|
"title": "Freeze",
|
|
156
156
|
"folder": "08_freeze",
|
|
157
|
-
"description": "Freeze
|
|
157
|
+
"description": "Freeze structural rendering while Data keeps updating; increment a counter, remove Source items, then thaw.",
|
|
158
158
|
"explanation": "A frozen branch keeps reacting to Data but defers structural DOM work. Removing a child under freeze takes effect at the thaw, which builds the current Source once."
|
|
159
159
|
},
|
|
160
160
|
{
|
|
@@ -237,8 +237,26 @@
|
|
|
237
237
|
"key": "c08",
|
|
238
238
|
"title": "End-to-end story",
|
|
239
239
|
"folder": "08_end_to_end",
|
|
240
|
-
"description": "
|
|
241
|
-
"explanation": "
|
|
240
|
+
"description": "First the local 0.2.0 story; return after the endpoint lessons for a separate 0.2.14 quote, error and recovery step.",
|
|
241
|
+
"explanation": "First compare setters, live editing, radio flags, formulas, SVG and freeze. After c09/c11, revisit the same inputs with a click-only dataRpc: the server quote is a snapshot, errors retain it and a successful retry clears the error."
|
|
242
|
+
},
|
|
243
|
+
{
|
|
244
|
+
"key": "c15",
|
|
245
|
+
"title": "Lifecycle",
|
|
246
|
+
"folder": "15_lifecycle",
|
|
247
|
+
"description": "Core 0.2.0: observe hook order, freeze, removal and Source/DOM lookup."
|
|
248
|
+
},
|
|
249
|
+
{
|
|
250
|
+
"key": "c16",
|
|
251
|
+
"title": "Attribute projection",
|
|
252
|
+
"folder": "16_attribute_projection",
|
|
253
|
+
"description": "Core 0.2.0 templates/masks, then the 0.2.3 sandboxed Data preview."
|
|
254
|
+
},
|
|
255
|
+
{
|
|
256
|
+
"key": "c17",
|
|
257
|
+
"title": "Data exchange",
|
|
258
|
+
"folder": "17_data_exchange",
|
|
259
|
+
"description": "Core 0.2.5: save/restore typed Data and export JSON/XML; current utility path from 0.2.10."
|
|
242
260
|
},
|
|
243
261
|
{
|
|
244
262
|
"key": "c09",
|
|
@@ -260,6 +278,27 @@
|
|
|
260
278
|
"folder": "11_call_on_click",
|
|
261
279
|
"description": "A dataRpc nested in a button, with _onError for a failing and a protected endpoint.",
|
|
262
280
|
"explanation": "Each click calls the endpoint. An exception answers application_error; an endpoint with auth answers not_authenticated on a server that knows no identity. _onError receives the error."
|
|
281
|
+
},
|
|
282
|
+
{
|
|
283
|
+
"key": "c12",
|
|
284
|
+
"title": "Remote",
|
|
285
|
+
"folder": "12_remote",
|
|
286
|
+
"description": "remote makes the content of an element a fragment built by the server.",
|
|
287
|
+
"explanation": "The section declares remote('details', record_id='^.record_id'). The page builds the fragment with @source in Python and Page.registerSource in JavaScript; each change of the record requests it again."
|
|
288
|
+
},
|
|
289
|
+
{
|
|
290
|
+
"key": "c13",
|
|
291
|
+
"title": "Cached remote",
|
|
292
|
+
"folder": "13_cached_remote",
|
|
293
|
+
"description": "Revisit remote with a last-result cache; distinguish mounted fragments from observed calls.",
|
|
294
|
+
"explanation": "The rules fragment depends on the category of the product. _cachedRemote makes no request when the category is the same; _onRemote is inline code that counts the mounted fragments and writes the status."
|
|
295
|
+
},
|
|
296
|
+
{
|
|
297
|
+
"key": "c14",
|
|
298
|
+
"title": "Data remote",
|
|
299
|
+
"folder": "14_data_remote",
|
|
300
|
+
"description": "Revisit endpoint values with lazy Data; compare a bound read, an explicit snapshot and cache expiry.",
|
|
301
|
+
"explanation": "The menu path holds a resolver of the endpoint load_menu with cacheTime 5. The ^.menu paragraph reads it: the answer arrives with the Data event. A change of the table loads the menu again."
|
|
263
302
|
}
|
|
264
303
|
]
|
|
265
304
|
}
|