@digipair/skill-web 0.46.0 → 0.46.1

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
@@ -83,7 +83,6 @@ let WebService = class WebService {
83
83
  async generateElementFromPins(pinsSettings, parent, dom) {
84
84
  const element = dom.window.document.createElement(pinsSettings.element);
85
85
  element.setAttribute('data-ssr', '1');
86
- // const settings = await preparePinsSettings(pinsSettings, context);
87
86
  const settings = pinsSettings;
88
87
  Object.entries(settings.properties || {}).forEach(([key, value])=>{
89
88
  if (key === 'textContent') {
@@ -102,7 +101,7 @@ let WebService = class WebService {
102
101
  }
103
102
  async page(params, _pinsSettingsList, context) {
104
103
  var _context_request_body;
105
- const { body, title = 'Digipair', favicon = 'https://res.cloudinary.com/do87nxq3l/image/upload/fl_preserve_transparency/v1717769492/logo-digipair_oyvvxz.png?_s=public-apps', 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;
106
105
  const engineVersion = context.config.VERSIONS['@digipair/engine'] || 'latest';
107
106
  const preparedData = {};
108
107
  if (context.request.method === 'POST' && ((_context_request_body = context.request.body) == null ? void 0 : _context_request_body.type) === 'DIGIPAIR_EXECUTE_FACTORY') {
@@ -115,10 +114,12 @@ let WebService = class WebService {
115
114
  <!DOCTYPE html>
116
115
  <html style="${styleHtml}">
117
116
  <head>
118
- <meta charset="UTF-8" />
119
- <title>${title}</title>
120
- <meta name="viewport" content="width=device-width, initial-scale=1" />
121
- <link rel="icon" type="image/x-icon" href="${favicon}">
117
+ ${head ? await this.pins2html(head) : `
118
+ <meta charset="UTF-8" />
119
+ <title>Digipair</title>
120
+ <meta name="viewport" content="width=device-width, initial-scale=1" />
121
+ <link rel="icon" type="image/x-icon" href="https://res.cloudinary.com/do87nxq3l/image/upload/fl_preserve_transparency/v1717769492/logo-digipair_oyvvxz.png?_s=public-apps">
122
+ `}
122
123
  </head>
123
124
  <body style="${styleBody}">
124
125
  <script type="module">
@@ -163,7 +164,7 @@ let WebService = class WebService {
163
164
  }, 1);
164
165
  </script>
165
166
 
166
- ${await this.pins2html(body)}
167
+ ${ssr ? await this.pins2html(body) : ''}
167
168
  </body>
168
169
  </html>
169
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 tokens = tokens1, nextMatch = nextMatch1, i = i1, {
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 tokens = tokens1, nextMatch = nextMatch1, i = i1, "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 tokens = tokens1, nextMatch = nextMatch1, i = i1, "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 tokens = tokens1, nextMatch = nextMatch1, i = i1, "continue";
23949
+ return nextMatch = nextMatch1, i = i1, tokens = tokens1, "continue";
23950
23950
  }
23951
- return tokens = tokens1, nextMatch = nextMatch1, i = i1, {
23951
+ return nextMatch = nextMatch1, i = i1, tokens = tokens1, {
23952
23952
  v: nextMatch1
23953
23953
  };
23954
23954
  };
@@ -28022,7 +28022,6 @@ let WebService = class WebService {
28022
28022
  async generateElementFromPins(pinsSettings, parent, dom) {
28023
28023
  const element = dom.window.document.createElement(pinsSettings.element);
28024
28024
  element.setAttribute('data-ssr', '1');
28025
- // const settings = await preparePinsSettings(pinsSettings, context);
28026
28025
  const settings = pinsSettings;
28027
28026
  Object.entries(settings.properties || {}).forEach(([key, value])=>{
28028
28027
  if (key === 'textContent') {
@@ -28041,7 +28040,7 @@ let WebService = class WebService {
28041
28040
  }
28042
28041
  async page(params, _pinsSettingsList, context) {
28043
28042
  var _context_request_body;
28044
- const { body, title = 'Digipair', favicon = 'https://res.cloudinary.com/do87nxq3l/image/upload/fl_preserve_transparency/v1717769492/logo-digipair_oyvvxz.png?_s=public-apps', 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;
28045
28044
  const engineVersion = context.config.VERSIONS['@digipair/engine'] || 'latest';
28046
28045
  const preparedData = {};
28047
28046
  if (context.request.method === 'POST' && ((_context_request_body = context.request.body) == null ? void 0 : _context_request_body.type) === 'DIGIPAIR_EXECUTE_FACTORY') {
@@ -28054,10 +28053,12 @@ let WebService = class WebService {
28054
28053
  <!DOCTYPE html>
28055
28054
  <html style="${styleHtml}">
28056
28055
  <head>
28057
- <meta charset="UTF-8" />
28058
- <title>${title}</title>
28059
- <meta name="viewport" content="width=device-width, initial-scale=1" />
28060
- <link rel="icon" type="image/x-icon" href="${favicon}">
28056
+ ${head ? await this.pins2html(head) : `
28057
+ <meta charset="UTF-8" />
28058
+ <title>Digipair</title>
28059
+ <meta name="viewport" content="width=device-width, initial-scale=1" />
28060
+ <link rel="icon" type="image/x-icon" href="https://res.cloudinary.com/do87nxq3l/image/upload/fl_preserve_transparency/v1717769492/logo-digipair_oyvvxz.png?_s=public-apps">
28061
+ `}
28061
28062
  </head>
28062
28063
  <body style="${styleBody}">
28063
28064
  <script type="module">
@@ -28102,7 +28103,7 @@ let WebService = class WebService {
28102
28103
  }, 1);
28103
28104
  </script>
28104
28105
 
28105
- ${await this.pins2html(body)}
28106
+ ${ssr ? await this.pins2html(body) : ''}
28106
28107
  </body>
28107
28108
  </html>
28108
28109
  `;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@digipair/skill-web",
3
- "version": "0.46.0",
3
+ "version": "0.46.1",
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
  {