@digipair/skill-web 0.47.6 → 0.48.0

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 CHANGED
@@ -16,7 +16,6 @@ function _extends() {
16
16
  return _extends.apply(this, arguments);
17
17
  }
18
18
 
19
- /* eslint-disable @typescript-eslint/no-unused-vars */ // import { render } from '@lit-labs/ssr';
20
19
  let WebService = class WebService {
21
20
  filteredWebPinsSettings(item, path) {
22
21
  if (Array.isArray(item)) {
@@ -73,7 +72,6 @@ let WebService = class WebService {
73
72
  const dom = new jsdom.JSDOM();
74
73
  const element = dom.window.document.createElement('section');
75
74
  await this.generateElementsFromPins(pins, element, dom);
76
- // return await collectResult(render(element.innerHTML));
77
75
  return element.innerHTML;
78
76
  }
79
77
  async generateElementsFromPins(pinsList, parent, dom) {
@@ -83,12 +81,8 @@ let WebService = class WebService {
83
81
  }
84
82
  }
85
83
  async generateElementFromPins(pinsSettings, parent, dom) {
86
- // if (pinsSettings.library !== 'web') {
87
- // require(pinsSettings.library);
88
- // }
89
84
  const element = dom.window.document.createElement(pinsSettings.element);
90
85
  element.setAttribute('data-ssr', '1');
91
- // const settings = await preparePinsSettings(pinsSettings, context);
92
86
  const settings = pinsSettings;
93
87
  Object.entries(settings.properties || {}).forEach(([key, value])=>{
94
88
  if (key === 'textContent') {
@@ -107,7 +101,7 @@ let WebService = class WebService {
107
101
  }
108
102
  async page(params, _pinsSettingsList, context) {
109
103
  var _context_request_body;
110
- const { body, head, styleHtml = '', styleBody = '', baseUrl = 'https://cdn.jsdelivr.net/npm', factoryInitialize = [], browserInitialize = [], browserLoad = [] } = params;
104
+ const { body, head, ssr = true, styleHtml = '', styleBody = '', baseUrl = 'https://cdn.jsdelivr.net/npm', factoryInitialize = [], browserInitialize = [], browserLoad = [] } = params;
111
105
  const engineVersion = context.config.VERSIONS['@digipair/engine'] || 'latest';
112
106
  const preparedData = {};
113
107
  if (context.request.method === 'POST' && ((_context_request_body = context.request.body) == null ? void 0 : _context_request_body.type) === 'DIGIPAIR_EXECUTE_FACTORY') {
@@ -170,7 +164,7 @@ let WebService = class WebService {
170
164
  }, 1);
171
165
  </script>
172
166
 
173
- ${await this.pins2html(body)}
167
+ ${ssr ? await this.pins2html(body) : ''}
174
168
  </body>
175
169
  </html>
176
170
  `;
package/index.esm.js CHANGED
@@ -23901,14 +23901,14 @@ function indent(str, spaces) {
23901
23901
  var match = parseIdentifier(input, i1, namePart) || namePart && parseAdditionalSymbol(input, i1) || maybeSpace && parseSpaces(input, i1);
23902
23902
  // match is required
23903
23903
  if (!match) {
23904
- return i = i1, tokens = tokens1, nextMatch = nextMatch1, {
23904
+ return nextMatch = nextMatch1, i = i1, tokens = tokens1, {
23905
23905
  v: nextMatch1
23906
23906
  };
23907
23907
  }
23908
23908
  var token = match.token, offset = match.offset;
23909
23909
  i1 += offset;
23910
23910
  if (token === " ") {
23911
- return i = i1, tokens = tokens1, nextMatch = nextMatch1, "continue";
23911
+ return nextMatch = nextMatch1, i = i1, tokens = tokens1, "continue";
23912
23912
  }
23913
23913
  tokens1 = _to_consumable_array$1(tokens1).concat([
23914
23914
  token
@@ -23927,7 +23927,7 @@ function indent(str, spaces) {
23927
23927
  if (contextKeys.some(function(el) {
23928
23928
  return el.startsWith(name);
23929
23929
  })) {
23930
- return i = i1, tokens = tokens1, nextMatch = nextMatch1, "continue";
23930
+ return nextMatch = nextMatch1, i = i1, tokens = tokens1, "continue";
23931
23931
  }
23932
23932
  if (dateTimeIdentifiers.some(function(el) {
23933
23933
  return el === name;
@@ -23946,9 +23946,9 @@ function indent(str, spaces) {
23946
23946
  if (dateTimeIdentifiers.some(function(el) {
23947
23947
  return el.startsWith(name);
23948
23948
  })) {
23949
- return i = i1, tokens = tokens1, nextMatch = nextMatch1, "continue";
23949
+ return nextMatch = nextMatch1, i = i1, tokens = tokens1, "continue";
23950
23950
  }
23951
- return i = i1, tokens = tokens1, nextMatch = nextMatch1, {
23951
+ return nextMatch = nextMatch1, i = i1, tokens = tokens1, {
23952
23952
  v: nextMatch1
23953
23953
  };
23954
23954
  };
@@ -27955,7 +27955,6 @@ const preparePinsSettings = async (settings, context)=>{
27955
27955
  });
27956
27956
  };
27957
27957
 
27958
- /* eslint-disable @typescript-eslint/no-unused-vars */ // import { render } from '@lit-labs/ssr';
27959
27958
  let WebService = class WebService {
27960
27959
  filteredWebPinsSettings(item, path) {
27961
27960
  if (Array.isArray(item)) {
@@ -28012,7 +28011,6 @@ let WebService = class WebService {
28012
28011
  const dom = new JSDOM();
28013
28012
  const element = dom.window.document.createElement('section');
28014
28013
  await this.generateElementsFromPins(pins, element, dom);
28015
- // return await collectResult(render(element.innerHTML));
28016
28014
  return element.innerHTML;
28017
28015
  }
28018
28016
  async generateElementsFromPins(pinsList, parent, dom) {
@@ -28022,12 +28020,8 @@ let WebService = class WebService {
28022
28020
  }
28023
28021
  }
28024
28022
  async generateElementFromPins(pinsSettings, parent, dom) {
28025
- // if (pinsSettings.library !== 'web') {
28026
- // require(pinsSettings.library);
28027
- // }
28028
28023
  const element = dom.window.document.createElement(pinsSettings.element);
28029
28024
  element.setAttribute('data-ssr', '1');
28030
- // const settings = await preparePinsSettings(pinsSettings, context);
28031
28025
  const settings = pinsSettings;
28032
28026
  Object.entries(settings.properties || {}).forEach(([key, value])=>{
28033
28027
  if (key === 'textContent') {
@@ -28046,7 +28040,7 @@ let WebService = class WebService {
28046
28040
  }
28047
28041
  async page(params, _pinsSettingsList, context) {
28048
28042
  var _context_request_body;
28049
- const { body, head, styleHtml = '', styleBody = '', baseUrl = 'https://cdn.jsdelivr.net/npm', factoryInitialize = [], browserInitialize = [], browserLoad = [] } = params;
28043
+ const { body, head, ssr = true, styleHtml = '', styleBody = '', baseUrl = 'https://cdn.jsdelivr.net/npm', factoryInitialize = [], browserInitialize = [], browserLoad = [] } = params;
28050
28044
  const engineVersion = context.config.VERSIONS['@digipair/engine'] || 'latest';
28051
28045
  const preparedData = {};
28052
28046
  if (context.request.method === 'POST' && ((_context_request_body = context.request.body) == null ? void 0 : _context_request_body.type) === 'DIGIPAIR_EXECUTE_FACTORY') {
@@ -28109,7 +28103,7 @@ let WebService = class WebService {
28109
28103
  }, 1);
28110
28104
  </script>
28111
28105
 
28112
- ${await this.pins2html(body)}
28106
+ ${ssr ? await this.pins2html(body) : ''}
28113
28107
  </body>
28114
28108
  </html>
28115
28109
  `;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@digipair/skill-web",
3
- "version": "0.47.6",
3
+ "version": "0.48.0",
4
4
  "dependencies": {},
5
5
  "main": "./index.cjs.js",
6
6
  "module": "./index.esm.js"
package/schema.fr.json CHANGED
@@ -54,21 +54,24 @@
54
54
  }
55
55
  },
56
56
  {
57
- "name": "title",
58
- "summary": "Titre",
57
+ "name": "head",
58
+ "summary": "En tête",
59
59
  "required": false,
60
- "description": "Titre de la page",
60
+ "description": "En tête de la page",
61
61
  "schema": {
62
- "type": "string"
62
+ "type": "array",
63
+ "items": {
64
+ "$ref": "https://schemas.digipair.ai/pinsSettings"
65
+ }
63
66
  }
64
67
  },
65
68
  {
66
- "name": "favicon",
67
- "summary": "Icone de la page",
69
+ "name": "ssr",
70
+ "summary": "Rendu coté serveur",
68
71
  "required": false,
69
- "description": "Icone de la page",
72
+ "description": "Rendu coté serveur",
70
73
  "schema": {
71
- "type": "string"
74
+ "type": "boolean"
72
75
  }
73
76
  },
74
77
  {
package/schema.json CHANGED
@@ -54,21 +54,24 @@
54
54
  }
55
55
  },
56
56
  {
57
- "name": "title",
58
- "summary": "Title",
57
+ "name": "head",
58
+ "summary": "Header",
59
59
  "required": false,
60
- "description": "Title of the page",
60
+ "description": "Header of the page",
61
61
  "schema": {
62
- "type": "string"
62
+ "type": "array",
63
+ "items": {
64
+ "$ref": "https://schemas.digipair.ai/pinsSettings"
65
+ }
63
66
  }
64
67
  },
65
68
  {
66
- "name": "favicon",
67
- "summary": "Page icon",
69
+ "name": "ssr",
70
+ "summary": "Server Side Rendering",
68
71
  "required": false,
69
- "description": "Icon of the page",
72
+ "description": "Server Side Rendering",
70
73
  "schema": {
71
- "type": "string"
74
+ "type": "boolean"
72
75
  }
73
76
  },
74
77
  {