@clxmedia/clxforms-client 1.1.9 → 1.1.11

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.
@@ -22,6 +22,7 @@ export type ProcessedCLXFormLayout = {
22
22
  form: CLXForm;
23
23
  steps: ProcessedCLXFormStep[];
24
24
  stats?: FormStats;
25
+ gateSatisfiedEvent?: boolean;
25
26
  };
26
27
  export type FilteredCLXFormLayout = ProcessedCLXFormLayout & {
27
28
  usedSlugs: Set<string>;
@@ -115,21 +115,22 @@ const CLXFormLayoutProcessor = ({ mode, responseData, formRights }) => {
115
115
  .map(step => stepProcessor(step))
116
116
  .filter(step => step.sections.length > 0)
117
117
  .reduce((acc, step) => {
118
- if (isGated && !isGateSatisfied && !isCLXInternalUser) {
118
+ if (isGated && !isCLXInternalUser) {
119
119
  return acc;
120
120
  }
121
- if (step.has_ai && !isGateSatisfied && !isCLXInternalUser) {
121
+ if (step.has_ai && !isCLXInternalUser) {
122
122
  blockedByAi = true;
123
123
  return acc;
124
124
  }
125
- if (step.is_gate && !isGateSatisfied && !isCLXInternalUser) {
126
- isGated = !step.is_complete;
125
+ if (step.is_gate && !step.is_complete && !isGateSatisfied) {
126
+ isGated = true;
127
127
  }
128
128
  acc.push(step);
129
129
  return acc;
130
130
  }, [])
131
131
  .filter(step => !step.is_gate || isGateSatisfied || isCLXInternalUser);
132
- return { form: layout.form, steps: blockedByAi ? [] : steps, stats: gatherFormStats(steps) };
132
+ const gateSatisfiedEvent = !isGated && !isGateSatisfied;
133
+ return { form: layout.form, steps: blockedByAi ? [] : steps, stats: gatherFormStats(steps), gateSatisfiedEvent };
133
134
  };
134
135
  return {
135
136
  process,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@clxmedia/clxforms-client",
3
- "version": "1.1.9",
3
+ "version": "1.1.11",
4
4
  "description": "CLXperience Forms Client",
5
5
  "author": "Brandon Thompson <brandont@clxmedia.com>",
6
6
  "license": "MIT",