@gramlot/gramlot-examples 0.2.8 → 0.2.9

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 CHANGED
@@ -12,7 +12,7 @@ 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.8.
15
+ Current release: 0.2.9.
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)
@@ -37,7 +37,7 @@ Each `NN_name.js` exports `Page` and `Logic`; the Python page `NN_name.py` takes
37
37
  The gallery page lists the families and opens each example beside its README and
38
38
  source. `build_gallery` (Python) and `buildGallery` (JavaScript) return its routes and
39
39
  static assets; each environment (`gramlot-py-server`, `gramlot-js-server`) serves the
40
- gallery with its own host and can add its own catalogue. Guide:
40
+ gallery with its own server and can add its own catalogue. Guide:
41
41
  [GE-010](https://github.com/gramlot-org/gramlot-examples/blob/main/docs/010-gallery.md).
42
42
 
43
43
  ```sh
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@gramlot/gramlot-examples",
3
- "version": "0.2.8",
3
+ "version": "0.2.9",
4
4
  "description": "Gramlot example pages, the gallery page and its catalogue.",
5
5
  "license": "Apache-2.0",
6
6
  "repository": {
@@ -14,7 +14,7 @@
14
14
  "prepack": "node scripts/build-browser.mjs"
15
15
  },
16
16
  "dependencies": {
17
- "@gramlot/gramlot": ">=0.2.10"
17
+ "@gramlot/gramlot": ">=0.2.12"
18
18
  },
19
19
  "devDependencies": {
20
20
  "@genrojs/bag": ">=0.10.1",
@@ -37,7 +37,7 @@ function readCatalog(catalog, pages, common) {
37
37
  * Each item of `catalogs` is a pair `[catalog.json, pages folder]` of one environment.
38
38
  * `routes` maps each key to its JavaScript page, its same-name stylesheet and its logic
39
39
  * module: `NN_name_aux.js`, else `NN_name.js`, the page module itself, whose `Logic` export
40
- * the host takes (the host throws when both hold a `Logic`). `assets` maps each URL to its
40
+ * the server takes (the server throws when both hold a `Logic`). `assets` maps each URL to its
41
41
  * file and media type. Nothing is written or served here.
42
42
  */
43
43
  export function buildGallery({catalogs = []} = {}) {
@@ -14,7 +14,7 @@ JavaScript, in three families:
14
14
  Each example is a file page: `NN_name.py`, its JavaScript equivalent `NN_name.js`,
15
15
  its README `NN_name.md`, and where needed a same-name stylesheet `NN_name.css`.
16
16
  `NN_name.js` exports `Page` and `Logic`: the JavaScript page uses both, the Python
17
- page takes `Logic` from it. The pages use only what the core `FileHost` serves:
17
+ page takes `Logic` from it. The pages use only what the core `GramlotFileServer` serves:
18
18
  `Page.css`, the same-name stylesheet and the `Logic` of the page module. The gallery
19
19
  adds its own files: the frame script, a staged `<key>_aux.js` per example and its
20
20
  assets ([GE-010 §025](https://github.com/gramlot-org/gramlot-examples/blob/main/docs/010-gallery.md#ge-010-025)).
@@ -28,7 +28,7 @@ export class Page extends BasePage {
28
28
  }
29
29
 
30
30
  /**
31
- * Logic of 03_named_logic.py and 03_named_logic.js. The minimal FileHost serves this module as the
31
+ * Logic of 03_named_logic.py and 03_named_logic.js. The core GramlotFileServer serves this module as the
32
32
  * root group of the page logic: `func='finalPrice'` names the method below.
33
33
  */
34
34
  export class Logic {
@@ -1,6 +1,6 @@
1
1
  # 03 · Named logic
2
2
 
3
- The code of this page lives in `class Logic`, which `03_named_logic.js` exports beside `Page`. The minimal FileHost serves that module as the page logic for the JavaScript page and for the Python page `03_named_logic.py` alike.
3
+ The code of this page lives in `class Logic`, which `03_named_logic.js` exports beside `Page`. The core GramlotFileServer serves that module as the page logic for the JavaScript page and for the Python page `03_named_logic.py` alike.
4
4
 
5
5
  - `func='finalPrice'` names a method of `Logic`. A formula method receives one object with the resolved parameters and returns the result: 10% off from the `threshold`.
6
6
  - A controller method receives its Source node and the parameters. `node.SET('.changes', …)` writes relative to the node's context.
@@ -4,7 +4,7 @@
4
4
 
5
5
  - The value is inline code with `this` = the declaring node and the parameter `event`. `this.SET('.path', …)` writes relative to the node's context.
6
6
  - The handler runs with the declaring node also when the event hits a descendant: a click on a chip reaches the section's handler, and `event.target` names the chip.
7
- - A value of dotted names, such as `gui.focused`, is named logic of a `js_requires` group instead. `js_requires` needs a Host with a resource system: the core `FileHost` and the current adapters have none and raise an error for any name, so this page uses inline code. The resource system comes with genro-kajenn, part of Genro.
7
+ - A value of dotted names, such as `gui.focused`, is named logic of a `js_requires` group instead. `js_requires` needs a server with a resource system: the core `GramlotFileServer` and the current adapters have none and raise an error for any name, so this page uses inline code. The resource system comes with genro-kajenn, part of Genro.
8
8
  - Removing the node removes its listeners.
9
9
 
10
10
  **Try it:** Click the green chip, type a word, then add `connect_onfocus` to the field.