@gramlot/gramlot-examples 0.2.11 → 0.2.14

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.
Files changed (71) hide show
  1. package/README.md +10 -3
  2. package/package.json +3 -3
  3. package/src/gramlot_examples/catalog.json +36 -6
  4. package/src/gramlot_examples/gallery/dist/frame.js +1742 -5
  5. package/src/gramlot_examples/gallery/dist/gallery.js +4073 -17144
  6. package/src/gramlot_examples/gallery/dist/inspector.js +1801 -0
  7. package/src/gramlot_examples/gallery/dist/notices.json +2 -22
  8. package/src/gramlot_examples/gallery/dist/theme-styles.js +2 -0
  9. package/src/gramlot_examples/gallery/gallery-page.js +35 -67
  10. package/src/gramlot_examples/gallery/gallery.css +23 -94
  11. package/src/gramlot_examples/index.js +2 -1
  12. package/src/gramlot_examples/pages/README.md +84 -1
  13. package/src/gramlot_examples/pages/binding/01_pointers.js +9 -0
  14. package/src/gramlot_examples/pages/binding/01_pointers.md +56 -9
  15. package/src/gramlot_examples/pages/binding/02_variable_datapath.md +50 -4
  16. package/src/gramlot_examples/pages/binding/03_setters_and_defaults.md +45 -6
  17. package/src/gramlot_examples/pages/binding/04_native_editing.md +48 -6
  18. package/src/gramlot_examples/pages/binding/05_checkbox_radio.md +44 -4
  19. package/src/gramlot_examples/pages/binding/06_style_and_visibility.md +40 -6
  20. package/src/gramlot_examples/pages/binding/07_bound_svg.md +48 -3
  21. package/src/gramlot_examples/pages/binding/08_freeze.js +1 -1
  22. package/src/gramlot_examples/pages/binding/08_freeze.md +44 -6
  23. package/src/gramlot_examples/pages/binding/09_forms.js +2 -1
  24. package/src/gramlot_examples/pages/binding/09_forms.md +53 -7
  25. package/src/gramlot_examples/pages/binding/10_svg_shapes.md +50 -5
  26. package/src/gramlot_examples/pages/binding/11_complete_page.md +53 -7
  27. package/src/gramlot_examples/pages/binding/README.md +34 -0
  28. package/src/gramlot_examples/pages/controllers/01_formula.md +48 -7
  29. package/src/gramlot_examples/pages/controllers/02_controller.js +24 -2
  30. package/src/gramlot_examples/pages/controllers/02_controller.md +61 -6
  31. package/src/gramlot_examples/pages/controllers/03_named_logic.md +63 -7
  32. package/src/gramlot_examples/pages/controllers/04_inline_expressions.md +50 -7
  33. package/src/gramlot_examples/pages/controllers/05_node_methods.md +41 -7
  34. package/src/gramlot_examples/pages/controllers/06_button_controller.md +49 -6
  35. package/src/gramlot_examples/pages/controllers/07_events.md +45 -6
  36. package/src/gramlot_examples/pages/controllers/08_end_to_end.js +26 -1
  37. package/src/gramlot_examples/pages/controllers/08_end_to_end.md +138 -9
  38. package/src/gramlot_examples/pages/controllers/09_endpoint.md +47 -7
  39. package/src/gramlot_examples/pages/controllers/10_call_on_change.md +48 -8
  40. package/src/gramlot_examples/pages/controllers/11_call_on_click.js +6 -0
  41. package/src/gramlot_examples/pages/controllers/11_call_on_click.md +58 -6
  42. package/src/gramlot_examples/pages/controllers/12_remote.md +55 -8
  43. package/src/gramlot_examples/pages/controllers/13_cached_remote.js +2 -2
  44. package/src/gramlot_examples/pages/controllers/13_cached_remote.md +62 -7
  45. package/src/gramlot_examples/pages/controllers/14_data_remote.js +10 -2
  46. package/src/gramlot_examples/pages/controllers/14_data_remote.md +65 -6
  47. package/src/gramlot_examples/pages/controllers/15_lifecycle.js +51 -0
  48. package/src/gramlot_examples/pages/controllers/15_lifecycle.md +59 -0
  49. package/src/gramlot_examples/pages/controllers/16_attribute_projection.js +25 -0
  50. package/src/gramlot_examples/pages/controllers/16_attribute_projection.md +58 -0
  51. package/src/gramlot_examples/pages/controllers/17_data_exchange.js +51 -0
  52. package/src/gramlot_examples/pages/controllers/17_data_exchange.md +61 -0
  53. package/src/gramlot_examples/pages/controllers/18_publish_subscribe.js +36 -0
  54. package/src/gramlot_examples/pages/controllers/18_publish_subscribe.md +20 -0
  55. package/src/gramlot_examples/pages/controllers/19_frame_messages.js +39 -0
  56. package/src/gramlot_examples/pages/controllers/19_frame_messages.md +20 -0
  57. package/src/gramlot_examples/pages/controllers/README.md +57 -1
  58. package/src/gramlot_examples/pages/html_svg/01_hello_world.md +48 -4
  59. package/src/gramlot_examples/pages/html_svg/02_text_and_links.md +42 -4
  60. package/src/gramlot_examples/pages/html_svg/03_lists.md +45 -4
  61. package/src/gramlot_examples/pages/html_svg/04_semantic_page.md +44 -4
  62. package/src/gramlot_examples/pages/html_svg/05_tables.md +46 -4
  63. package/src/gramlot_examples/pages/html_svg/06_forms.md +48 -4
  64. package/src/gramlot_examples/pages/html_svg/07_native_disclosure.md +41 -4
  65. package/src/gramlot_examples/pages/html_svg/08_svg_shapes.md +45 -4
  66. package/src/gramlot_examples/pages/html_svg/09_svg_composition.md +44 -4
  67. package/src/gramlot_examples/pages/html_svg/10_cards_with_icons.md +42 -15
  68. package/src/gramlot_examples/pages/html_svg/11_static_report.md +37 -4
  69. package/src/gramlot_examples/pages/html_svg/12_complete_page.md +41 -4
  70. package/src/gramlot_examples/pages/html_svg/13_live_source.md +47 -16
  71. package/src/gramlot_examples/pages/html_svg/README.md +36 -0
package/README.md CHANGED
@@ -12,7 +12,13 @@ npm install @gramlot/gramlot-examples
12
12
  [![PyPI](https://img.shields.io/pypi/v/gramlot-examples)](https://pypi.org/project/gramlot-examples/)
13
13
  [![npm](https://img.shields.io/npm/v/@gramlot/gramlot-examples)](https://www.npmjs.com/package/@gramlot/gramlot-examples)
14
14
 
15
- Current release: 0.2.11.
15
+ Current release: 0.2.14.
16
+
17
+ [Documentation and learning sequence](https://gramlot-examples.readthedocs.io/en/latest/)
18
+ include every lesson, its Python and JavaScript source, and the gallery guide.
19
+ To run the examples, choose the [Python server](https://gramlot-py-server.readthedocs.io/en/latest/),
20
+ [Node.js/Bun server](https://gramlot-js-server.readthedocs.io/en/latest/010-tutorial.html)
21
+ or [serverless exporter](https://gramlot-js-server.readthedocs.io/en/latest/135-serverless-tutorial.html).
16
22
 
17
23
  The repositories of the family are described in
18
24
  [The Gramlot family](https://github.com/gramlot-org/gramlot/blob/main/docs/public/055-family.md)
@@ -26,9 +32,10 @@ same-name README:
26
32
 
27
33
  - `html_svg/`: thirteen HTML and SVG pages, without binding (`e01`–`e13`);
28
34
  - `binding/`: eleven pages whose DOM follows the Data (`b01`–`b11`);
29
- - `controllers/`: fourteen pages with formulas, controllers, named logic, events, the
35
+ - `controllers/`: nineteen pages with formulas, controllers, named logic, events, the
30
36
  end-to-end story, `dataRpc` calls to the endpoints of the page, `remote` fragments and
31
- `dataRemote` values (`c01`–`c14`).
37
+ `dataRemote` values (`c01`–`c19`). The last two introduce: topics,
38
+ authored references, native ask and parent/child messages. They require core 0.2.18 or later.
32
39
 
33
40
  Each `NN_name.js` exports `Page` and `Logic`; the Python page `NN_name.py` takes its
34
41
  `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.11",
3
+ "version": "0.2.14",
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.16"
17
+ "@gramlot/gramlot": ">=0.2.18"
18
18
  },
19
19
  "devDependencies": {
20
- "@genrojs/bag": ">=0.10.1",
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",
@@ -72,7 +72,7 @@
72
72
  "title": "Cards with icons",
73
73
  "folder": "10_cards_with_icons",
74
74
  "description": "HTML cards with SVG icons and live Source removal.",
75
- "explanation": "Helpers and loops build the cards. Each × button removes its labelled Source node through the browser Builder; Gramlot updates the DOM without reloading. Reload restores the initial cards. No Data binding or server synchronization is involved."
75
+ "explanation": "Helpers and loops build the cards. Each \u00d7 button removes its labelled Source node through the browser Builder; Gramlot updates the DOM without reloading. Reload restores the initial cards. No Data binding or server synchronization is involved."
76
76
  },
77
77
  {
78
78
  "key": "e11",
@@ -154,7 +154,7 @@
154
154
  "key": "b08",
155
155
  "title": "Freeze",
156
156
  "folder": "08_freeze",
157
- "description": "Freeze a branch, change its Data and Source, then thaw once.",
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": "Title, input, radios, checkbox, formula, SVG, button and freeze together.",
241
- "explanation": "Setters after the controls, live editing, a radio pair, a formula and controller driving text and SVG, a counting button and freeze."
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",
@@ -272,15 +290,27 @@
272
290
  "key": "c13",
273
291
  "title": "Cached remote",
274
292
  "folder": "13_cached_remote",
275
- "description": "remote with _cachedRemote and _onRemote, under a variable datapath.",
293
+ "description": "Revisit remote with a last-result cache; distinguish mounted fragments from observed calls.",
276
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."
277
295
  },
278
296
  {
279
297
  "key": "c14",
280
298
  "title": "Data remote",
281
299
  "folder": "14_data_remote",
282
- "description": "dataRemote computes a Data value with an endpoint when the value is read.",
300
+ "description": "Revisit endpoint values with lazy Data; compare a bound read, an explicit snapshot and cache expiry.",
283
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."
302
+ },
303
+ {
304
+ "key": "c18",
305
+ "title": "Publish and subscribe",
306
+ "folder": "18_publish_subscribe",
307
+ "description": "Development core 0.2.18: revisit button actions with page topics, self receivers, references and native ask."
308
+ },
309
+ {
310
+ "key": "c19",
311
+ "title": "Parent and child messages",
312
+ "folder": "19_frame_messages",
313
+ "description": "Development core 0.2.18: local-first publish and direct parent/child postMessage exchange."
284
314
  }
285
315
  ]
286
316
  }