@digipair/skill-html 0.59.2 → 0.60.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
@@ -73,9 +73,16 @@ let HtmlService = class HtmlService {
73
73
  await this.generateElementsFromPins(pinsList, element, dom);
74
74
  parent.appendChild(element);
75
75
  }
76
+ async html2document(params, _pinsSettingsList, _context) {
77
+ const { html } = params;
78
+ const dom = new jsdom.JSDOM(html);
79
+ return dom.window.document;
80
+ }
76
81
  };
77
82
  const html2pins = (params, pinsSettingsList, context)=>new HtmlService().html2pins(params, pinsSettingsList, context);
78
83
  const pins2html = (params, pinsSettingsList, context)=>new HtmlService().pins2html(params, pinsSettingsList, context);
84
+ const html2document = (params, pinsSettingsList, context)=>new HtmlService().html2document(params, pinsSettingsList, context);
79
85
 
86
+ exports.html2document = html2document;
80
87
  exports.html2pins = html2pins;
81
88
  exports.pins2html = pins2html;
package/index.esm.js CHANGED
@@ -69,8 +69,14 @@ let HtmlService = class HtmlService {
69
69
  await this.generateElementsFromPins(pinsList, element, dom);
70
70
  parent.appendChild(element);
71
71
  }
72
+ async html2document(params, _pinsSettingsList, _context) {
73
+ const { html } = params;
74
+ const dom = new JSDOM(html);
75
+ return dom.window.document;
76
+ }
72
77
  };
73
78
  const html2pins = (params, pinsSettingsList, context)=>new HtmlService().html2pins(params, pinsSettingsList, context);
74
79
  const pins2html = (params, pinsSettingsList, context)=>new HtmlService().pins2html(params, pinsSettingsList, context);
80
+ const html2document = (params, pinsSettingsList, context)=>new HtmlService().html2document(params, pinsSettingsList, context);
75
81
 
76
- export { html2pins, pins2html };
82
+ export { html2document, html2pins, pins2html };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@digipair/skill-html",
3
- "version": "0.59.2",
3
+ "version": "0.60.0",
4
4
  "dependencies": {
5
5
  "jsdom": "^25.0.1"
6
6
  },
package/schema.fr.json CHANGED
@@ -52,6 +52,24 @@
52
52
  ],
53
53
  "x-events": []
54
54
  }
55
+ },
56
+ "/html2document": {
57
+ "post": {
58
+ "tags": ["service"],
59
+ "summary": "Convertir du HTML en Document",
60
+ "parameters": [
61
+ {
62
+ "name": "html",
63
+ "summary": "HTML",
64
+ "required": true,
65
+ "description": "Code HTML",
66
+ "schema": {
67
+ "type": "string"
68
+ }
69
+ }
70
+ ],
71
+ "x-events": []
72
+ }
55
73
  }
56
74
  },
57
75
  "components": {
package/schema.json CHANGED
@@ -52,6 +52,24 @@
52
52
  ],
53
53
  "x-events": []
54
54
  }
55
+ },
56
+ "/html2document": {
57
+ "post": {
58
+ "tags": ["service"],
59
+ "summary": "Convert HTML to Document",
60
+ "parameters": [
61
+ {
62
+ "name": "html",
63
+ "summary": "HTML",
64
+ "required": true,
65
+ "description": "HTML code",
66
+ "schema": {
67
+ "type": "string"
68
+ }
69
+ }
70
+ ],
71
+ "x-events": []
72
+ }
55
73
  }
56
74
  },
57
75
  "components": {
@@ -1,3 +1,4 @@
1
1
  import { PinsSettings } from '@digipair/engine';
2
2
  export declare const html2pins: (params: any, pinsSettingsList: PinsSettings[], context: any) => Promise<any>;
3
3
  export declare const pins2html: (params: any, pinsSettingsList: PinsSettings[], context: any) => Promise<any>;
4
+ export declare const html2document: (params: any, pinsSettingsList: PinsSettings[], context: any) => Promise<any>;