@digipair/skill-web 0.4.10 → 0.4.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/index.cjs.js +3 -3
- package/index.esm.js +3 -3
- package/package.json +1 -1
- package/schema.json +34 -2
package/index.cjs.js
CHANGED
|
@@ -5,6 +5,7 @@ Object.defineProperty(exports, '__esModule', { value: true });
|
|
|
5
5
|
/* eslint-disable @typescript-eslint/no-unused-vars */ let WebService = class WebService {
|
|
6
6
|
async page(params, _pinsSettingsList, context) {
|
|
7
7
|
const { body, title = 'Digipair', baseUrl = 'https://cdn.jsdelivr.net/npm', libraries = {} } = params;
|
|
8
|
+
const engineVersion = libraries['@digipair/engine'] || 'latest';
|
|
8
9
|
const html = `
|
|
9
10
|
<!DOCTYPE html>
|
|
10
11
|
<html>
|
|
@@ -14,7 +15,7 @@ Object.defineProperty(exports, '__esModule', { value: true });
|
|
|
14
15
|
</head>
|
|
15
16
|
<body>
|
|
16
17
|
<script type="module">
|
|
17
|
-
import { config, generateElementFromPins } from '${baseUrl}/@digipair/engine/index.esm.js';
|
|
18
|
+
import { config, generateElementFromPins } from '${baseUrl}/@digipair/engine@${engineVersion}/index.esm.js';
|
|
18
19
|
|
|
19
20
|
config.set('LIBRARIES', ${JSON.stringify(libraries)});
|
|
20
21
|
config.set('BASE_URL', '${baseUrl}');
|
|
@@ -29,8 +30,7 @@ Object.defineProperty(exports, '__esModule', { value: true });
|
|
|
29
30
|
const pinsList = ${JSON.stringify(body)};
|
|
30
31
|
for (let i = 0; i < pinsList.length; i++) {
|
|
31
32
|
const item = pinsList[i];
|
|
32
|
-
|
|
33
|
-
document.body.appendChild(child);
|
|
33
|
+
await generateElementFromPins(item, document.body, context, options);
|
|
34
34
|
}
|
|
35
35
|
</script>
|
|
36
36
|
</body>
|
package/index.esm.js
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
/* eslint-disable @typescript-eslint/no-unused-vars */ let WebService = class WebService {
|
|
2
2
|
async page(params, _pinsSettingsList, context) {
|
|
3
3
|
const { body, title = 'Digipair', baseUrl = 'https://cdn.jsdelivr.net/npm', libraries = {} } = params;
|
|
4
|
+
const engineVersion = libraries['@digipair/engine'] || 'latest';
|
|
4
5
|
const html = `
|
|
5
6
|
<!DOCTYPE html>
|
|
6
7
|
<html>
|
|
@@ -10,7 +11,7 @@
|
|
|
10
11
|
</head>
|
|
11
12
|
<body>
|
|
12
13
|
<script type="module">
|
|
13
|
-
import { config, generateElementFromPins } from '${baseUrl}/@digipair/engine/index.esm.js';
|
|
14
|
+
import { config, generateElementFromPins } from '${baseUrl}/@digipair/engine@${engineVersion}/index.esm.js';
|
|
14
15
|
|
|
15
16
|
config.set('LIBRARIES', ${JSON.stringify(libraries)});
|
|
16
17
|
config.set('BASE_URL', '${baseUrl}');
|
|
@@ -25,8 +26,7 @@
|
|
|
25
26
|
const pinsList = ${JSON.stringify(body)};
|
|
26
27
|
for (let i = 0; i < pinsList.length; i++) {
|
|
27
28
|
const item = pinsList[i];
|
|
28
|
-
|
|
29
|
-
document.body.appendChild(child);
|
|
29
|
+
await generateElementFromPins(item, document.body, context, options);
|
|
30
30
|
}
|
|
31
31
|
</script>
|
|
32
32
|
</body>
|
package/package.json
CHANGED
package/schema.json
CHANGED
|
@@ -8,13 +8,33 @@
|
|
|
8
8
|
},
|
|
9
9
|
"paths": {},
|
|
10
10
|
"components": {
|
|
11
|
-
"schemas": {
|
|
11
|
+
"schemas": {
|
|
12
|
+
"dataAttribute": {
|
|
13
|
+
"tags": ["service"],
|
|
14
|
+
"summary": "Paramètre",
|
|
15
|
+
"type": "object",
|
|
16
|
+
"properties": {
|
|
17
|
+
"name": {
|
|
18
|
+
"type": "string",
|
|
19
|
+
"summary": "Nom"
|
|
20
|
+
},
|
|
21
|
+
"value": {
|
|
22
|
+
"summary": "Valeur",
|
|
23
|
+
"type": "array",
|
|
24
|
+
"items": {
|
|
25
|
+
"$ref": "https://www.pinser.world/schemas/pinsSettings"
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
},
|
|
29
|
+
"required": ["name", "value"]
|
|
30
|
+
}
|
|
31
|
+
}
|
|
12
32
|
},
|
|
13
33
|
"x-scene-blocks": {
|
|
14
34
|
"/page": {
|
|
15
35
|
"summary": "Page internet",
|
|
16
36
|
"description": "Affichage d'une page d'un site internet.",
|
|
17
|
-
"tags": ["web"],
|
|
37
|
+
"tags": ["web", "service"],
|
|
18
38
|
"metadata": [],
|
|
19
39
|
"parameters": [
|
|
20
40
|
{
|
|
@@ -29,6 +49,18 @@
|
|
|
29
49
|
}
|
|
30
50
|
}
|
|
31
51
|
},
|
|
52
|
+
{
|
|
53
|
+
"name": "data",
|
|
54
|
+
"summary": "Préparation des données",
|
|
55
|
+
"required": false,
|
|
56
|
+
"description": "Préparation des données backend à envoyer à la page",
|
|
57
|
+
"schema": {
|
|
58
|
+
"type": "array",
|
|
59
|
+
"items": {
|
|
60
|
+
"$ref": "#/components/schemas/dataAttribute"
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
},
|
|
32
64
|
{
|
|
33
65
|
"name": "title",
|
|
34
66
|
"summary": "Titre",
|