@gramlot/gramlot 0.2.7 → 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/dist/gramlot.js +3 -0
- package/package.json +1 -1
- package/src/adapters/page.d.ts +3 -0
- package/src/adapters/page.js +6 -1
- package/src/gramlot.d.ts +3 -0
- package/src/gramlot.js +3 -0
package/dist/gramlot.js
CHANGED
|
@@ -25731,6 +25731,9 @@ var Gramlot = class {
|
|
|
25731
25731
|
* Replace one Source node's children only after incoming Source validation.
|
|
25732
25732
|
* The request lives as long as the target's NodeBinding (P24): a DOM rebuild
|
|
25733
25733
|
* or a freeze keeps it, the removal of the target cancels it.
|
|
25734
|
+
*
|
|
25735
|
+
* Source methods (`@source`, `source(...)`, `remoteSource`) are not yet part of the page-writing API:
|
|
25736
|
+
* they arrive together with the `remote` grammar attribute and `@endpoint`.
|
|
25734
25737
|
*/
|
|
25735
25738
|
async remoteSource(target, method, params = {}) {
|
|
25736
25739
|
if (!this.transport?.source) throw new Error("Remote Source is unavailable without a server transport");
|
package/package.json
CHANGED
package/src/adapters/page.d.ts
CHANGED
|
@@ -8,6 +8,9 @@ import type {GramlotBuilder} from '../builder/gramlot-builder.js';
|
|
|
8
8
|
/**
|
|
9
9
|
* Explicit registration of a remote Source method, equivalent to the Python `@source`.
|
|
10
10
|
* A Source method populates its `root` argument and returns nothing.
|
|
11
|
+
*
|
|
12
|
+
* Source methods (`@source`, `source(...)`, `remoteSource`) are not yet part of the page-writing API:
|
|
13
|
+
* they arrive together with the `remote` grammar attribute and `@endpoint`.
|
|
11
14
|
*/
|
|
12
15
|
export function source<T extends Function>(method: T): T;
|
|
13
16
|
|
package/src/adapters/page.js
CHANGED
|
@@ -8,7 +8,12 @@ import {GramlotBuilder} from '../builder/gramlot-builder.js';
|
|
|
8
8
|
|
|
9
9
|
const SOURCE_METHOD = Symbol('gramlot.source');
|
|
10
10
|
|
|
11
|
-
/**
|
|
11
|
+
/**
|
|
12
|
+
* Explicit method registration, equivalent to Python @source without syntax transforms.
|
|
13
|
+
*
|
|
14
|
+
* Source methods (`@source`, `source(...)`, `remoteSource`) are not yet part of the page-writing API:
|
|
15
|
+
* they arrive together with the `remote` grammar attribute and `@endpoint`.
|
|
16
|
+
*/
|
|
12
17
|
export function source(method) {
|
|
13
18
|
if (typeof method !== 'function') throw new TypeError('source requires a method');
|
|
14
19
|
method[SOURCE_METHOD] = true;
|
package/src/gramlot.d.ts
CHANGED
|
@@ -86,6 +86,9 @@ export class Gramlot {
|
|
|
86
86
|
/**
|
|
87
87
|
* Replace the children of one Source node with a remote Source, only after the incoming Source
|
|
88
88
|
* validates. Resolves with true when applied, false when superseded or cancelled.
|
|
89
|
+
*
|
|
90
|
+
* Source methods (`@source`, `source(...)`, `remoteSource`) are not yet part of the page-writing API:
|
|
91
|
+
* they arrive together with the `remote` grammar attribute and `@endpoint`.
|
|
89
92
|
*/
|
|
90
93
|
remoteSource(target: SourceBagNode, method: string, params?: Record<string, unknown>): Promise<boolean>;
|
|
91
94
|
/** Resolve a node or DOM reference descriptor. */
|
package/src/gramlot.js
CHANGED
|
@@ -108,6 +108,9 @@ export class Gramlot {
|
|
|
108
108
|
* Replace one Source node's children only after incoming Source validation.
|
|
109
109
|
* The request lives as long as the target's NodeBinding (P24): a DOM rebuild
|
|
110
110
|
* or a freeze keeps it, the removal of the target cancels it.
|
|
111
|
+
*
|
|
112
|
+
* Source methods (`@source`, `source(...)`, `remoteSource`) are not yet part of the page-writing API:
|
|
113
|
+
* they arrive together with the `remote` grammar attribute and `@endpoint`.
|
|
111
114
|
*/
|
|
112
115
|
async remoteSource(target, method, params = {}) {
|
|
113
116
|
if (!this.transport?.source) throw new Error('Remote Source is unavailable without a server transport');
|