@bigbinary/neeto-form-frontend 3.12.3 → 3.12.4

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.
@@ -29,7 +29,8 @@ var useBuildFormStore = zustand.create(reactUtils.withImmutableActions(function
29
29
  isUsingDefaultQuestionKinds: true,
30
30
  showReadOnlySwitch: false,
31
31
  showResponseVisibleOnlyToHostSwitch: false,
32
- usesCustomSubmissionComponent: false
32
+ usesCustomSubmissionComponent: false,
33
+ hostSpecificData: {}
33
34
  },
34
35
  setFormData: function setFormData(arg) {
35
36
  return set(ramda.modify("formState", index.isFunction(arg) ? arg : ramda.mergeLeft(arg)));
@@ -42,4 +43,4 @@ var useBuildFormState = function useBuildFormState() {
42
43
 
43
44
  exports.useBuildFormState = useBuildFormState;
44
45
  exports.useBuildFormStore = useBuildFormStore;
45
- //# sourceMappingURL=buildForm-C53vOltw.js.map
46
+ //# sourceMappingURL=buildForm-CkodU5Ns.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"buildForm-CkodU5Ns.js","sources":["../app/javascript/src/stores/buildForm.js"],"sourcesContent":["import i18next from \"i18next\";\nimport { noop } from \"neetocist\";\nimport { withImmutableActions } from \"neetocommons/react-utils\";\nimport { mergeLeft, modify, prop } from \"ramda\";\nimport { create } from \"zustand\";\n\nimport { isFunction } from \"utils\";\n\n/** @type {import(\"neetocommons/react-utils\").ZustandStoreHook} */\nconst useBuildFormStore = create(\n withImmutableActions(set => ({\n formState: {\n values: {},\n dirty: false,\n isSubmitting: false,\n isValid: true,\n errors: [],\n submitForm: noop,\n resetForm: noop,\n selectedLanguage: i18next.resolvedLanguage,\n formId: null,\n enabled: false,\n title: \"\",\n richTextFieldsToReset: [],\n helpDocUrls: {},\n enableDomainBlacklisting: true,\n enableDomainWhitelisting: true,\n isUsingDefaultQuestionKinds: true,\n showReadOnlySwitch: false,\n showResponseVisibleOnlyToHostSwitch: false,\n usesCustomSubmissionComponent: false,\n hostSpecificData: {},\n },\n\n setFormData: arg =>\n set(modify(\"formState\", isFunction(arg) ? arg : mergeLeft(arg))),\n }))\n);\n\nexport const useBuildFormState = () => useBuildFormStore(prop(\"formState\"));\n\nexport default useBuildFormStore;\n"],"names":["useBuildFormStore","create","withImmutableActions","set","formState","values","dirty","isSubmitting","isValid","errors","submitForm","noop","resetForm","selectedLanguage","i18next","resolvedLanguage","formId","enabled","title","richTextFieldsToReset","helpDocUrls","enableDomainBlacklisting","enableDomainWhitelisting","isUsingDefaultQuestionKinds","showReadOnlySwitch","showResponseVisibleOnlyToHostSwitch","usesCustomSubmissionComponent","hostSpecificData","setFormData","arg","modify","isFunction","mergeLeft","useBuildFormState","prop"],"mappings":";;;;;;;;;AAQA;AACA,IAAMA,iBAAiB,GAAGC,cAAM,CAC9BC,+BAAoB,CAAC,UAAAC,GAAG,EAAA;EAAA,OAAK;AAC3BC,IAAAA,SAAS,EAAE;MACTC,MAAM,EAAE,EAAE;AACVC,MAAAA,KAAK,EAAE,KAAK;AACZC,MAAAA,YAAY,EAAE,KAAK;AACnBC,MAAAA,OAAO,EAAE,IAAI;AACbC,MAAAA,MAAM,EAAE,EAAE;AACVC,MAAAA,UAAU,EAAEC,cAAI;AAChBC,MAAAA,SAAS,EAAED,cAAI;MACfE,gBAAgB,EAAEC,OAAO,CAACC,gBAAgB;AAC1CC,MAAAA,MAAM,EAAE,IAAI;AACZC,MAAAA,OAAO,EAAE,KAAK;AACdC,MAAAA,KAAK,EAAE,EAAE;AACTC,MAAAA,qBAAqB,EAAE,EAAE;MACzBC,WAAW,EAAE,EAAE;AACfC,MAAAA,wBAAwB,EAAE,IAAI;AAC9BC,MAAAA,wBAAwB,EAAE,IAAI;AAC9BC,MAAAA,2BAA2B,EAAE,IAAI;AACjCC,MAAAA,kBAAkB,EAAE,KAAK;AACzBC,MAAAA,mCAAmC,EAAE,KAAK;AAC1CC,MAAAA,6BAA6B,EAAE,KAAK;AACpCC,MAAAA,gBAAgB,EAAE;KACnB;AAEDC,IAAAA,WAAW,EAAE,SAAbA,WAAWA,CAAEC,GAAG,EAAA;AAAA,MAAA,OACd1B,GAAG,CAAC2B,YAAM,CAAC,WAAW,EAAEC,gBAAU,CAACF,GAAG,CAAC,GAAGA,GAAG,GAAGG,eAAS,CAACH,GAAG,CAAC,CAAC,CAAC;AAAA;GACnE;AAAA,CAAC,CACJ;AAEaI,IAAAA,iBAAiB,GAAG,SAApBA,iBAAiBA,GAAA;AAAA,EAAA,OAASjC,iBAAiB,CAACkC,UAAI,CAAC,WAAW,CAAC,CAAC;AAAA;;;;;"}
@@ -27,7 +27,8 @@ var useBuildFormStore = create(withImmutableActions(function (set) {
27
27
  isUsingDefaultQuestionKinds: true,
28
28
  showReadOnlySwitch: false,
29
29
  showResponseVisibleOnlyToHostSwitch: false,
30
- usesCustomSubmissionComponent: false
30
+ usesCustomSubmissionComponent: false,
31
+ hostSpecificData: {}
31
32
  },
32
33
  setFormData: function setFormData(arg) {
33
34
  return set(modify("formState", isFunction(arg) ? arg : mergeLeft(arg)));
@@ -39,4 +40,4 @@ var useBuildFormState = function useBuildFormState() {
39
40
  };
40
41
 
41
42
  export { useBuildFormStore as a, useBuildFormState as u };
42
- //# sourceMappingURL=buildForm-BHII-vAK.js.map
43
+ //# sourceMappingURL=buildForm-nI7TrULn.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"buildForm-nI7TrULn.js","sources":["../app/javascript/src/stores/buildForm.js"],"sourcesContent":["import i18next from \"i18next\";\nimport { noop } from \"neetocist\";\nimport { withImmutableActions } from \"neetocommons/react-utils\";\nimport { mergeLeft, modify, prop } from \"ramda\";\nimport { create } from \"zustand\";\n\nimport { isFunction } from \"utils\";\n\n/** @type {import(\"neetocommons/react-utils\").ZustandStoreHook} */\nconst useBuildFormStore = create(\n withImmutableActions(set => ({\n formState: {\n values: {},\n dirty: false,\n isSubmitting: false,\n isValid: true,\n errors: [],\n submitForm: noop,\n resetForm: noop,\n selectedLanguage: i18next.resolvedLanguage,\n formId: null,\n enabled: false,\n title: \"\",\n richTextFieldsToReset: [],\n helpDocUrls: {},\n enableDomainBlacklisting: true,\n enableDomainWhitelisting: true,\n isUsingDefaultQuestionKinds: true,\n showReadOnlySwitch: false,\n showResponseVisibleOnlyToHostSwitch: false,\n usesCustomSubmissionComponent: false,\n hostSpecificData: {},\n },\n\n setFormData: arg =>\n set(modify(\"formState\", isFunction(arg) ? arg : mergeLeft(arg))),\n }))\n);\n\nexport const useBuildFormState = () => useBuildFormStore(prop(\"formState\"));\n\nexport default useBuildFormStore;\n"],"names":["useBuildFormStore","create","withImmutableActions","set","formState","values","dirty","isSubmitting","isValid","errors","submitForm","noop","resetForm","selectedLanguage","i18next","resolvedLanguage","formId","enabled","title","richTextFieldsToReset","helpDocUrls","enableDomainBlacklisting","enableDomainWhitelisting","isUsingDefaultQuestionKinds","showReadOnlySwitch","showResponseVisibleOnlyToHostSwitch","usesCustomSubmissionComponent","hostSpecificData","setFormData","arg","modify","isFunction","mergeLeft","useBuildFormState","prop"],"mappings":";;;;;;;AAQA;AACA,IAAMA,iBAAiB,GAAGC,MAAM,CAC9BC,oBAAoB,CAAC,UAAAC,GAAG,EAAA;EAAA,OAAK;AAC3BC,IAAAA,SAAS,EAAE;MACTC,MAAM,EAAE,EAAE;AACVC,MAAAA,KAAK,EAAE,KAAK;AACZC,MAAAA,YAAY,EAAE,KAAK;AACnBC,MAAAA,OAAO,EAAE,IAAI;AACbC,MAAAA,MAAM,EAAE,EAAE;AACVC,MAAAA,UAAU,EAAEC,IAAI;AAChBC,MAAAA,SAAS,EAAED,IAAI;MACfE,gBAAgB,EAAEC,OAAO,CAACC,gBAAgB;AAC1CC,MAAAA,MAAM,EAAE,IAAI;AACZC,MAAAA,OAAO,EAAE,KAAK;AACdC,MAAAA,KAAK,EAAE,EAAE;AACTC,MAAAA,qBAAqB,EAAE,EAAE;MACzBC,WAAW,EAAE,EAAE;AACfC,MAAAA,wBAAwB,EAAE,IAAI;AAC9BC,MAAAA,wBAAwB,EAAE,IAAI;AAC9BC,MAAAA,2BAA2B,EAAE,IAAI;AACjCC,MAAAA,kBAAkB,EAAE,KAAK;AACzBC,MAAAA,mCAAmC,EAAE,KAAK;AAC1CC,MAAAA,6BAA6B,EAAE,KAAK;AACpCC,MAAAA,gBAAgB,EAAE;KACnB;AAEDC,IAAAA,WAAW,EAAE,SAAbA,WAAWA,CAAEC,GAAG,EAAA;AAAA,MAAA,OACd1B,GAAG,CAAC2B,MAAM,CAAC,WAAW,EAAEC,UAAU,CAACF,GAAG,CAAC,GAAGA,GAAG,GAAGG,SAAS,CAACH,GAAG,CAAC,CAAC,CAAC;AAAA;GACnE;AAAA,CAAC,CACJ;AAEaI,IAAAA,iBAAiB,GAAG,SAApBA,iBAAiBA,GAAA;AAAA,EAAA,OAASjC,iBAAiB,CAACkC,IAAI,CAAC,WAAW,CAAC,CAAC;AAAA;;;;"}
@@ -18,7 +18,7 @@ var reactUtils = require('@bigbinary/neeto-commons-frontend/react-utils');
18
18
  var HelpPopover = require('@bigbinary/neeto-molecules/HelpPopover');
19
19
  var ActionBlock = require('@bigbinary/neetoui/formik/ActionBlock');
20
20
  var reactI18next = require('react-i18next');
21
- var buildForm = require('../buildForm-C53vOltw.js');
21
+ var buildForm = require('../buildForm-CkodU5Ns.js');
22
22
  var shallow = require('zustand/shallow');
23
23
  var Alert = require('@bigbinary/neetoui/Alert');
24
24
  var jsxRuntime = require('react/jsx-runtime');
@@ -1715,11 +1715,14 @@ var RestrictDomainsBlock = function RestrictDomainsBlock(_ref) {
1715
1715
  var switchName = _ref.switchName,
1716
1716
  domainName = _ref.domainName,
1717
1717
  isDomainRestrictionEnabled = _ref.isDomainRestrictionEnabled;
1718
- var _DOMAIN_RESTRICTION_T = DOMAIN_RESTRICTION_TRANSLATIONS[domainName],
1719
- title = _DOMAIN_RESTRICTION_T.title,
1720
- description = _DOMAIN_RESTRICTION_T.description,
1721
- popoverDescription = _DOMAIN_RESTRICTION_T.popoverDescription;
1722
- var helpLink = buildForm.useBuildFormStore(ramda.path(["formState", "helpDocUrls", domainName]));
1718
+ var _useBuildFormStore = buildForm.useBuildFormStore(ramda.paths([["formState", "helpDocUrls", domainName], ["formState", "hostSpecificData", domainName]])),
1719
+ _useBuildFormStore2 = _slicedToArray(_useBuildFormStore, 2),
1720
+ helpLink = _useBuildFormStore2[0],
1721
+ hostSpecificTranslations = _useBuildFormStore2[1];
1722
+ var _mergeLeft = ramda.mergeLeft(hostSpecificTranslations, DOMAIN_RESTRICTION_TRANSLATIONS[domainName]),
1723
+ title = _mergeLeft.title,
1724
+ description = _mergeLeft.description,
1725
+ popoverDescription = _mergeLeft.popoverDescription;
1723
1726
  return /*#__PURE__*/jsxRuntime.jsxs("div", {
1724
1727
  className: "flex flex-col space-y-4",
1725
1728
  "data-cy": "".concat(neetoCist.hyphenate(switchName), "-container"),
@@ -2230,9 +2233,10 @@ var Form = function Form(_ref) {
2230
2233
  isUsingDefaultQuestionKinds: isUsingDefaultQuestionKinds,
2231
2234
  showReadOnlySwitch: showReadOnlySwitch,
2232
2235
  showResponseVisibleOnlyToHostSwitch: showResponseVisibleOnlyToHostSwitch,
2233
- usesCustomSubmissionComponent: usesCustomSubmissionComponent
2236
+ usesCustomSubmissionComponent: usesCustomSubmissionComponent,
2237
+ hostSpecificData: hostSpecificData
2234
2238
  });
2235
- }, [formId, isFormEnabled, savedTitle, setFormData, values, dirty, isSubmitting, isValid, errors, submitForm, resetForm, selectedLanguage, helpDocUrls, enableDomainBlacklisting, enableDomainWhitelisting, isUsingDefaultQuestionKinds, showReadOnlySwitch, showResponseVisibleOnlyToHostSwitch, usesCustomSubmissionComponent]);
2239
+ }, [formId, isFormEnabled, savedTitle, setFormData, values, dirty, isSubmitting, isValid, errors, submitForm, resetForm, selectedLanguage, helpDocUrls, enableDomainBlacklisting, enableDomainWhitelisting, isUsingDefaultQuestionKinds, showReadOnlySwitch, showResponseVisibleOnlyToHostSwitch, usesCustomSubmissionComponent, hostSpecificData]);
2236
2240
  var questions = values.questions;
2237
2241
  var handleSelect = function handleSelect(question) {
2238
2242
  setSelectedQuestion(question);
@@ -2457,8 +2461,7 @@ var BuildForm = function BuildForm(_ref) {
2457
2461
  className = _ref.className,
2458
2462
  _ref$questionsHelpPro = _ref.questionsHelpProps,
2459
2463
  questionsHelpProps = _ref$questionsHelpPro === void 0 ? {} : _ref$questionsHelpPro,
2460
- _ref$hostSpecificData = _ref.hostSpecificData,
2461
- hostSpecificData = _ref$hostSpecificData === void 0 ? {} : _ref$hostSpecificData,
2464
+ hostSpecificData = _ref.hostSpecificData,
2462
2465
  _ref$showReadOnlySwit = _ref.showReadOnlySwitch,
2463
2466
  showReadOnlySwitch = _ref$showReadOnlySwit === void 0 ? false : _ref$showReadOnlySwit,
2464
2467
  _ref$showResponseVisi = _ref.showResponseVisibleOnlyToHostSwitch,