@legalplace/prerenderx 3.9.4 → 3.9.6

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/CHANGELOG.md CHANGED
@@ -3,6 +3,25 @@
3
3
  All notable changes to this project will be documented in this file.
4
4
  See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
5
5
 
6
+ ## [3.9.6](https://git.legalplace.eu/legalplace/prerenderx/compare/@legalplace/prerenderx@3.9.5...@legalplace/prerenderx@3.9.6) (2026-09-10)
7
+
8
+
9
+ ### Bug Fixes
10
+
11
+ * fix section handling across multiple documents ([6ff17f7](https://git.legalplace.eu/legalplace/prerenderx/commits/6ff17f7374ce746b304839566d1ef1222e6f9033))
12
+
13
+
14
+
15
+
16
+
17
+ ## [3.9.5](https://git.legalplace.eu/legalplace/prerenderx/compare/@legalplace/prerenderx@3.9.4...@legalplace/prerenderx@3.9.5) (2026-09-10)
18
+
19
+ **Note:** Version bump only for package @legalplace/prerenderx
20
+
21
+
22
+
23
+
24
+
6
25
  ## [3.9.4](https://git.legalplace.eu/legalplace/prerenderx/compare/@legalplace/prerenderx@3.9.3...@legalplace/prerenderx@3.9.4) (2026-09-09)
7
26
 
8
27
  **Note:** Version bump only for package @legalplace/prerenderx
@@ -29,7 +29,9 @@ var OptionRender = (function () {
29
29
  OptionRender.prototype.isDisplayed = function (optionId) {
30
30
  var _this = this;
31
31
  if (optionId === void 0) { optionId = this.id; }
32
- return (0, referencesparser_1.isOptionDisplayed)(this.references, this.ovc, function (type, entityId, entityIndex) {
32
+ return (0, referencesparser_1.isOptionDisplayed)(this.references, this.ovc, function (type, entityId, entityIndex, documentSlug) {
33
+ var _a;
34
+ if (documentSlug === void 0) { documentSlug = "main"; }
33
35
  if (type === "options") {
34
36
  var conditionObject = _this.references.conditions.options[entityId];
35
37
  return conditionObject === undefined
@@ -37,10 +39,10 @@ var OptionRender = (function () {
37
39
  : _this.conditions.executeCondition(conditionObject, entityId, entityIndex, "options");
38
40
  }
39
41
  if (type === "sections") {
40
- var conditionObject = _this.references.conditions.sections.main[entityId];
42
+ var conditionObject = (_a = _this.references.conditions.sections[documentSlug]) === null || _a === void 0 ? void 0 : _a[entityId];
41
43
  return conditionObject === undefined
42
44
  ? true
43
- : _this.conditions.executeCondition(conditionObject, entityId, entityIndex, "sections");
45
+ : _this.conditions.executeCondition(conditionObject, entityId, entityIndex, "sections", documentSlug);
44
46
  }
45
47
  return true;
46
48
  }, optionId, this.index);
@@ -44,7 +44,7 @@ var SectionRender = (function () {
44
44
  var conditionObject = this.references.conditions.sections[this.documentName][this.currentSection];
45
45
  var condition = conditionObject === undefined
46
46
  ? true
47
- : this.conditions.executeCondition(conditionObject, 0, this.baseIndex, "sections");
47
+ : this.conditions.executeCondition(conditionObject, 0, this.baseIndex, "sections", this.documentName);
48
48
  if (condition !== true)
49
49
  return;
50
50
  var documentMultipleSource = this.getDocumentMultipleSource();
@@ -4,12 +4,12 @@ var referencesparser_1 = require("@legalplace/referencesparser");
4
4
  var FillPdfFormBase = (function () {
5
5
  function FillPdfFormBase(references, conditions, ovc) {
6
6
  var _this = this;
7
- this.conditionEvaluator = function (type, id, index) {
7
+ this.conditionEvaluator = function (type, id, index, documentSlug) {
8
8
  if (type === "options")
9
9
  return _this.getOptionCondition(id, index);
10
10
  if (type === "variables")
11
11
  return _this.getVariableCondition(id, index);
12
- return _this.getSectionCondition(id);
12
+ return _this.getSectionCondition(id, documentSlug);
13
13
  };
14
14
  this.references = references;
15
15
  this.conditions = conditions;
@@ -33,11 +33,13 @@ var FillPdfFormBase = (function () {
33
33
  ? true
34
34
  : this.conditions.executeCondition(conditionObject, id, index, "options");
35
35
  };
36
- FillPdfFormBase.prototype.getSectionCondition = function (id) {
37
- var conditionObject = this.references.conditions.sections.main[id];
36
+ FillPdfFormBase.prototype.getSectionCondition = function (id, documentSlug) {
37
+ var _a;
38
+ if (documentSlug === void 0) { documentSlug = "main"; }
39
+ var conditionObject = (_a = this.references.conditions.sections[documentSlug]) === null || _a === void 0 ? void 0 : _a[id];
38
40
  return conditionObject === undefined
39
41
  ? true
40
- : this.conditions.executeCondition(conditionObject, id, 0, "sections");
42
+ : this.conditions.executeCondition(conditionObject, id, 0, "sections", documentSlug);
41
43
  };
42
44
  return FillPdfFormBase;
43
45
  }());
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@legalplace/prerenderx",
3
- "version": "3.9.4",
3
+ "version": "3.9.6",
4
4
  "description": "PrerenderX",
5
5
  "main": "dist/index.js",
6
6
  "repository": "https://git.legalplace.eu/legalplace/prerenderx",
@@ -16,11 +16,11 @@
16
16
  "release": "standard-version -a --no-verify"
17
17
  },
18
18
  "dependencies": {
19
- "@legalplace/conditions-runner": "^2.4.0",
19
+ "@legalplace/conditions-runner": "^2.4.2",
20
20
  "@legalplace/lplogic": "2.4.1",
21
- "@legalplace/models-v3-types": "^5.19.0",
22
- "@legalplace/ovc-converter": "^2.2.25",
23
- "@legalplace/referencesparser": "^3.4.0",
21
+ "@legalplace/models-v3-types": "^5.20.0",
22
+ "@legalplace/ovc-converter": "^2.2.27",
23
+ "@legalplace/referencesparser": "^3.4.2",
24
24
  "@legalplace/yousign": "^0.9.23",
25
25
  "crypto": "^1.0.1"
26
26
  },
@@ -37,5 +37,5 @@
37
37
  "ts-jest": "^24.0.2"
38
38
  },
39
39
  "prettier": "@legalplace/prettier-config",
40
- "gitHead": "291ab9a10b1cad0ef43afc9cb1e1b0dcc7dfbcdb"
40
+ "gitHead": "77ecb5b41ff0081d809928dc772da3ddc079975e"
41
41
  }
@@ -67,7 +67,7 @@ class OptionRender {
67
67
  return isOptionDisplayed(
68
68
  this.references,
69
69
  this.ovc,
70
- (type, entityId, entityIndex) => {
70
+ (type, entityId, entityIndex, documentSlug = "main") => {
71
71
  if (type === "options") {
72
72
  const conditionObject = this.references.conditions.options[entityId];
73
73
  return conditionObject === undefined
@@ -81,14 +81,15 @@ class OptionRender {
81
81
  }
82
82
  if (type === "sections") {
83
83
  const conditionObject =
84
- this.references.conditions.sections.main[entityId];
84
+ this.references.conditions.sections[documentSlug]?.[entityId];
85
85
  return conditionObject === undefined
86
86
  ? true
87
87
  : this.conditions.executeCondition(
88
88
  conditionObject,
89
89
  entityId,
90
90
  entityIndex,
91
- "sections"
91
+ "sections",
92
+ documentSlug
92
93
  );
93
94
  }
94
95
  return true;
@@ -77,7 +77,8 @@ class SectionRender {
77
77
  conditionObject,
78
78
  0,
79
79
  this.baseIndex,
80
- "sections"
80
+ "sections",
81
+ this.documentName
81
82
  );
82
83
 
83
84
  if (condition !== true) return;
@@ -29,11 +29,12 @@ class FillPdfFormBase {
29
29
  private readonly conditionEvaluator: ConditionEvaluator = (
30
30
  type,
31
31
  id,
32
- index
32
+ index,
33
+ documentSlug
33
34
  ) => {
34
35
  if (type === "options") return this.getOptionCondition(id, index);
35
36
  if (type === "variables") return this.getVariableCondition(id, index);
36
- return this.getSectionCondition(id);
37
+ return this.getSectionCondition(id, documentSlug);
37
38
  };
38
39
 
39
40
  /**
@@ -90,11 +91,18 @@ class FillPdfFormBase {
90
91
  /**
91
92
  * Returns a section's conditions.
92
93
  */
93
- private getSectionCondition(id: number) {
94
- const conditionObject = this.references.conditions.sections.main[id];
94
+ private getSectionCondition(id: number, documentSlug = "main") {
95
+ const conditionObject =
96
+ this.references.conditions.sections[documentSlug]?.[id];
95
97
  return conditionObject === undefined
96
98
  ? true
97
- : this.conditions.executeCondition(conditionObject, id, 0, "sections");
99
+ : this.conditions.executeCondition(
100
+ conditionObject,
101
+ id,
102
+ 0,
103
+ "sections",
104
+ documentSlug
105
+ );
98
106
  }
99
107
  }
100
108