@bino-bi/bn-template-engine 1.0.0-alpha.12 → 1.0.0-alpha.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.
- package/dist/bn-template-engine/bn-template-engine.esm.js +1 -1
- package/dist/bn-template-engine/p-6b3c47b3.entry.js +1 -0
- package/dist/bn-template-engine/{p-3b73ffc7.entry.js → p-82023539.entry.js} +1 -1
- package/dist/bn-template-engine/p-BjBz5cSL.js +1 -0
- package/dist/cjs/bn-asset_21.cjs.entry.js +58 -23
- package/dist/cjs/bn-internationalization.cjs.entry.js +1 -1
- package/dist/cjs/{withBodyObserver-D7BKWN2N.js → withBodyObserver-BKUE_ypL.js} +12 -7
- package/dist/collection/components/bn-dataset/bn-dataset.js +43 -19
- package/dist/collection/components/bn-datasource/bn-datasource.js +20 -8
- package/dist/collection/utils/withBodyObserver.js +12 -7
- package/dist/components/bn-dataset.js +1 -1
- package/dist/components/bn-datasource.js +1 -1
- package/dist/components/withBodyObserver.js +1 -1
- package/dist/esm/bn-asset_21.entry.js +58 -23
- package/dist/esm/bn-internationalization.entry.js +1 -1
- package/dist/esm/{withBodyObserver-AFk2wwHT.js → withBodyObserver-IokS6fHD.js} +12 -7
- package/dist/types/components/bn-dataset/bn-dataset.d.ts +7 -4
- package/dist/types/components/bn-datasource/bn-datasource.d.ts +5 -3
- package/dist/types/components.d.ts +24 -20
- package/package.json +1 -1
- package/dist/bn-template-engine/p-230095a5.entry.js +0 -1
- package/dist/bn-template-engine/p-DSXNgKLa.js +0 -1
|
@@ -15,16 +15,21 @@ import { r as runIfExisits } from './withHasError-DW_vMDUp.js';
|
|
|
15
15
|
*/
|
|
16
16
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
17
17
|
const withBodyObserver = (component, onUpdate) => {
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
18
|
+
let hostElement;
|
|
19
|
+
// Coalesce bursts of mutations (e.g. devtools "Edit as HTML" fires childList +
|
|
20
|
+
// characterData in quick succession) and always read the *host* textContent so
|
|
21
|
+
// we deliver the complete body, not the individual text node that mutated.
|
|
22
|
+
const observer = new MutationObserver(() => {
|
|
23
|
+
var _a;
|
|
24
|
+
if (hostElement)
|
|
25
|
+
onUpdate((_a = hostElement.textContent) !== null && _a !== void 0 ? _a : "");
|
|
22
26
|
});
|
|
23
27
|
const connectedCallback = component["connectedCallback"];
|
|
24
28
|
component["connectedCallback"] = () => {
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
29
|
+
var _a;
|
|
30
|
+
hostElement = getElement(component);
|
|
31
|
+
observer.observe(hostElement, { childList: true, subtree: true, characterData: true });
|
|
32
|
+
onUpdate((_a = hostElement.textContent) !== null && _a !== void 0 ? _a : "");
|
|
28
33
|
runIfExisits(connectedCallback, component);
|
|
29
34
|
};
|
|
30
35
|
const disconnectedCallback = component["disconnectedCallback"];
|
|
@@ -6,9 +6,10 @@
|
|
|
6
6
|
* 1. **SQL** (default) — AlaSQL query against referenced `datasources`.
|
|
7
7
|
* 2. **Static JSON** — set `static="true"` to bypass SQL and write the
|
|
8
8
|
* parsed body directly to the `datasets` store.
|
|
9
|
-
* 3. **URL** — place an `http
|
|
10
|
-
*
|
|
11
|
-
* Set the `interval` prop (in seconds)
|
|
9
|
+
* 3. **URL** — place an `http://`/`https://` URL or a same-origin path
|
|
10
|
+
* starting with `/` in the body to fetch JSON from an HTTP endpoint and
|
|
11
|
+
* write it to the `datasets` store. Set the `interval` prop (in seconds)
|
|
12
|
+
* to enable periodic re-fetching.
|
|
12
13
|
*/
|
|
13
14
|
export declare class Dataset {
|
|
14
15
|
private element;
|
|
@@ -62,7 +63,9 @@ export declare class Dataset {
|
|
|
62
63
|
onIntervalChange(): void;
|
|
63
64
|
disconnectedCallback(): void;
|
|
64
65
|
/**
|
|
65
|
-
* Returns `true` if the text
|
|
66
|
+
* Returns `true` if the text is a fetchable URL: an absolute `http(s)://`
|
|
67
|
+
* URL, or a same-origin path starting with `/` (but not `//`, which is a
|
|
68
|
+
* protocol-relative URL we treat as inline-mode escape).
|
|
66
69
|
*/
|
|
67
70
|
private isUrl;
|
|
68
71
|
/**
|
|
@@ -4,8 +4,8 @@
|
|
|
4
4
|
* Data can be provided in three ways:
|
|
5
5
|
* 1. **Inline JSON** — Place JSON text inside the element body (default).
|
|
6
6
|
* 2. **Compressed payload** — Set `raw="false"` and provide `<hash>:<base64_gzip>` format.
|
|
7
|
-
* 3. **URL** — Place an `http
|
|
8
|
-
* from
|
|
7
|
+
* 3. **URL** — Place an `http://`/`https://` URL or a same-origin path
|
|
8
|
+
* starting with `/` in the body to fetch JSON from an HTTP endpoint.
|
|
9
9
|
*
|
|
10
10
|
* In URL mode the component fetches JSON from the URL. Set the `interval`
|
|
11
11
|
* prop (in seconds) to enable periodic re-fetching (polling).
|
|
@@ -50,7 +50,9 @@ export declare class Datasource {
|
|
|
50
50
|
onIntervalChange(): void;
|
|
51
51
|
disconnectedCallback(): void;
|
|
52
52
|
/**
|
|
53
|
-
* Returns `true` if the text
|
|
53
|
+
* Returns `true` if the text is a fetchable URL: an absolute `http(s)://`
|
|
54
|
+
* URL, or a same-origin path starting with `/` (but not `//`, which is a
|
|
55
|
+
* protocol-relative URL we treat as inline-mode escape).
|
|
54
56
|
*/
|
|
55
57
|
private isUrl;
|
|
56
58
|
/**
|
|
@@ -295,9 +295,10 @@ export namespace Components {
|
|
|
295
295
|
* 1. **SQL** (default) — AlaSQL query against referenced `datasources`.
|
|
296
296
|
* 2. **Static JSON** — set `static="true"` to bypass SQL and write the
|
|
297
297
|
* parsed body directly to the `datasets` store.
|
|
298
|
-
* 3. **URL** — place an `http
|
|
299
|
-
*
|
|
300
|
-
* Set the `interval` prop (in seconds)
|
|
298
|
+
* 3. **URL** — place an `http://`/`https://` URL or a same-origin path
|
|
299
|
+
* starting with `/` in the body to fetch JSON from an HTTP endpoint and
|
|
300
|
+
* write it to the `datasets` store. Set the `interval` prop (in seconds)
|
|
301
|
+
* to enable periodic re-fetching.
|
|
301
302
|
*/
|
|
302
303
|
interface BnDataset {
|
|
303
304
|
/**
|
|
@@ -330,8 +331,8 @@ export namespace Components {
|
|
|
330
331
|
* Data can be provided in three ways:
|
|
331
332
|
* 1. **Inline JSON** — Place JSON text inside the element body (default).
|
|
332
333
|
* 2. **Compressed payload** — Set `raw="false"` and provide `<hash>:<base64_gzip>` format.
|
|
333
|
-
* 3. **URL** — Place an `http
|
|
334
|
-
* from
|
|
334
|
+
* 3. **URL** — Place an `http://`/`https://` URL or a same-origin path
|
|
335
|
+
* starting with `/` in the body to fetch JSON from an HTTP endpoint.
|
|
335
336
|
* In URL mode the component fetches JSON from the URL. Set the `interval`
|
|
336
337
|
* prop (in seconds) to enable periodic re-fetching (polling).
|
|
337
338
|
* Other components (e.g. `bn-dataset`) reference the stored data by the
|
|
@@ -1387,9 +1388,10 @@ declare global {
|
|
|
1387
1388
|
* 1. **SQL** (default) — AlaSQL query against referenced `datasources`.
|
|
1388
1389
|
* 2. **Static JSON** — set `static="true"` to bypass SQL and write the
|
|
1389
1390
|
* parsed body directly to the `datasets` store.
|
|
1390
|
-
* 3. **URL** — place an `http
|
|
1391
|
-
*
|
|
1392
|
-
* Set the `interval` prop (in seconds)
|
|
1391
|
+
* 3. **URL** — place an `http://`/`https://` URL or a same-origin path
|
|
1392
|
+
* starting with `/` in the body to fetch JSON from an HTTP endpoint and
|
|
1393
|
+
* write it to the `datasets` store. Set the `interval` prop (in seconds)
|
|
1394
|
+
* to enable periodic re-fetching.
|
|
1393
1395
|
*/
|
|
1394
1396
|
interface HTMLBnDatasetElement extends Components.BnDataset, HTMLStencilElement {
|
|
1395
1397
|
}
|
|
@@ -1402,8 +1404,8 @@ declare global {
|
|
|
1402
1404
|
* Data can be provided in three ways:
|
|
1403
1405
|
* 1. **Inline JSON** — Place JSON text inside the element body (default).
|
|
1404
1406
|
* 2. **Compressed payload** — Set `raw="false"` and provide `<hash>:<base64_gzip>` format.
|
|
1405
|
-
* 3. **URL** — Place an `http
|
|
1406
|
-
* from
|
|
1407
|
+
* 3. **URL** — Place an `http://`/`https://` URL or a same-origin path
|
|
1408
|
+
* starting with `/` in the body to fetch JSON from an HTTP endpoint.
|
|
1407
1409
|
* In URL mode the component fetches JSON from the URL. Set the `interval`
|
|
1408
1410
|
* prop (in seconds) to enable periodic re-fetching (polling).
|
|
1409
1411
|
* Other components (e.g. `bn-dataset`) reference the stored data by the
|
|
@@ -1878,9 +1880,10 @@ declare namespace LocalJSX {
|
|
|
1878
1880
|
* 1. **SQL** (default) — AlaSQL query against referenced `datasources`.
|
|
1879
1881
|
* 2. **Static JSON** — set `static="true"` to bypass SQL and write the
|
|
1880
1882
|
* parsed body directly to the `datasets` store.
|
|
1881
|
-
* 3. **URL** — place an `http
|
|
1882
|
-
*
|
|
1883
|
-
* Set the `interval` prop (in seconds)
|
|
1883
|
+
* 3. **URL** — place an `http://`/`https://` URL or a same-origin path
|
|
1884
|
+
* starting with `/` in the body to fetch JSON from an HTTP endpoint and
|
|
1885
|
+
* write it to the `datasets` store. Set the `interval` prop (in seconds)
|
|
1886
|
+
* to enable periodic re-fetching.
|
|
1884
1887
|
*/
|
|
1885
1888
|
interface BnDataset {
|
|
1886
1889
|
/**
|
|
@@ -1913,8 +1916,8 @@ declare namespace LocalJSX {
|
|
|
1913
1916
|
* Data can be provided in three ways:
|
|
1914
1917
|
* 1. **Inline JSON** — Place JSON text inside the element body (default).
|
|
1915
1918
|
* 2. **Compressed payload** — Set `raw="false"` and provide `<hash>:<base64_gzip>` format.
|
|
1916
|
-
* 3. **URL** — Place an `http
|
|
1917
|
-
* from
|
|
1919
|
+
* 3. **URL** — Place an `http://`/`https://` URL or a same-origin path
|
|
1920
|
+
* starting with `/` in the body to fetch JSON from an HTTP endpoint.
|
|
1918
1921
|
* In URL mode the component fetches JSON from the URL. Set the `interval`
|
|
1919
1922
|
* prop (in seconds) to enable periodic re-fetching (polling).
|
|
1920
1923
|
* Other components (e.g. `bn-dataset`) reference the stored data by the
|
|
@@ -3249,9 +3252,10 @@ declare module "@stencil/core" {
|
|
|
3249
3252
|
* 1. **SQL** (default) — AlaSQL query against referenced `datasources`.
|
|
3250
3253
|
* 2. **Static JSON** — set `static="true"` to bypass SQL and write the
|
|
3251
3254
|
* parsed body directly to the `datasets` store.
|
|
3252
|
-
* 3. **URL** — place an `http
|
|
3253
|
-
*
|
|
3254
|
-
* Set the `interval` prop (in seconds)
|
|
3255
|
+
* 3. **URL** — place an `http://`/`https://` URL or a same-origin path
|
|
3256
|
+
* starting with `/` in the body to fetch JSON from an HTTP endpoint and
|
|
3257
|
+
* write it to the `datasets` store. Set the `interval` prop (in seconds)
|
|
3258
|
+
* to enable periodic re-fetching.
|
|
3255
3259
|
*/
|
|
3256
3260
|
"bn-dataset": LocalJSX.IntrinsicElements["bn-dataset"] & JSXBase.HTMLAttributes<HTMLBnDatasetElement>;
|
|
3257
3261
|
/**
|
|
@@ -3259,8 +3263,8 @@ declare module "@stencil/core" {
|
|
|
3259
3263
|
* Data can be provided in three ways:
|
|
3260
3264
|
* 1. **Inline JSON** — Place JSON text inside the element body (default).
|
|
3261
3265
|
* 2. **Compressed payload** — Set `raw="false"` and provide `<hash>:<base64_gzip>` format.
|
|
3262
|
-
* 3. **URL** — Place an `http
|
|
3263
|
-
* from
|
|
3266
|
+
* 3. **URL** — Place an `http://`/`https://` URL or a same-origin path
|
|
3267
|
+
* starting with `/` in the body to fetch JSON from an HTTP endpoint.
|
|
3264
3268
|
* In URL mode the component fetches JSON from the URL. Set the `interval`
|
|
3265
3269
|
* prop (in seconds) to enable periodic re-fetching (polling).
|
|
3266
3270
|
* Other components (e.g. `bn-dataset`) reference the stored data by the
|
package/package.json
CHANGED