@gov-cy/govcy-frontend-renderer 1.0.2 → 1.1.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/dist/index.cjs CHANGED
@@ -22488,6 +22488,7 @@ class govcyFrontendRenderer {
22488
22488
  * Returns the rendered html as string, based on the nunjucks templates
22489
22489
  *
22490
22490
  * @param {string} input The input
22491
+ * @param {Object} data The data
22491
22492
  * @returns {string} Rendered html as string
22492
22493
  */
22493
22494
  renderFromString(input,data = {}) {
@@ -22521,6 +22522,13 @@ class govcyFrontendRenderer {
22521
22522
  return renderedContent;
22522
22523
  }
22523
22524
 
22525
+ /**
22526
+ * Returns the rendered html as string, based on the json templates
22527
+ *
22528
+ * @param {onject} input The JSON input
22529
+ * @param {Object} data The data
22530
+ * @returns {string} Rendered html as string
22531
+ */
22524
22532
  renderFromJSON(input,data = {}) {
22525
22533
  //build the template from the jsonInput
22526
22534
  let jsonTemplate = `{% from "govcyElement.njk" import govcyElement %} `;
package/dist/index.mjs CHANGED
@@ -22485,6 +22485,7 @@ class govcyFrontendRenderer {
22485
22485
  * Returns the rendered html as string, based on the nunjucks templates
22486
22486
  *
22487
22487
  * @param {string} input The input
22488
+ * @param {Object} data The data
22488
22489
  * @returns {string} Rendered html as string
22489
22490
  */
22490
22491
  renderFromString(input,data = {}) {
@@ -22518,6 +22519,13 @@ class govcyFrontendRenderer {
22518
22519
  return renderedContent;
22519
22520
  }
22520
22521
 
22522
+ /**
22523
+ * Returns the rendered html as string, based on the json templates
22524
+ *
22525
+ * @param {onject} input The JSON input
22526
+ * @param {Object} data The data
22527
+ * @returns {string} Rendered html as string
22528
+ */
22521
22529
  renderFromJSON(input,data = {}) {
22522
22530
  //build the template from the jsonInput
22523
22531
  let jsonTemplate = `{% from "govcyElement.njk" import govcyElement %} `;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@gov-cy/govcy-frontend-renderer",
3
- "version": "1.0.2",
3
+ "version": "1.1.1",
4
4
  "description": "Render html for design elements of the Unified design system using njk or json template.",
5
5
  "author": "DMRID - DSF Team",
6
6
  "license": "MIT",
@@ -40,7 +40,7 @@
40
40
  },
41
41
  "scripts": {
42
42
  "test": "mocha --timeout 60000 ./test/**/*.test.mjs",
43
- "build": "rollup -c",
43
+ "build": "rollup -c&&node precompile.browser.js",
44
44
  "start": "nodemon app.mjs"
45
45
  },
46
46
  "devDependencies": {
@@ -50,6 +50,7 @@
50
50
  "chai": "^5.1.0",
51
51
  "mocha": "^10.4.0",
52
52
  "nodemon": "^3.1.4",
53
+ "puppeteer": "^23.11.1",
53
54
  "rollup": "^4.21.2"
54
55
  }
55
56
  }
@@ -104,7 +104,7 @@
104
104
  {%- for action in actions %}
105
105
  <li class="list-inline-item">
106
106
  {#- render href -#}
107
- <a href="{% if action.href %}{{ action.href }}{% else %}#{% endif %}">
107
+ <a href="{% if action.href %}{{ action.href }}{% else %}#{% endif %}"{% if action.classes %}class="{{ action.classes }}"{% endif %}>
108
108
  {#- render content -#}
109
109
  {{ govcyLocalizeContent(action.text, lang) }}
110
110
  {#- If visuallyHiddenText is set -#}