@aatulwork/customform-renderer 1.2.0 → 1.4.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/dist/index.mjs CHANGED
@@ -555,12 +555,20 @@ var loadCKEditor = (scriptPath = "/lib/ckeditor/ckeditor.js") => {
555
555
  setTimeout(() => {
556
556
  clearInterval(checkInterval);
557
557
  if (!window.ClassicEditor) {
558
- reject(new Error("CKEditor script loaded but ClassicEditor not found on window after 10 seconds"));
558
+ reject(
559
+ new Error(
560
+ "CKEditor script loaded but ClassicEditor was not found on window. Ensure you are using the package-provided build from lib/ckeditor/ckeditor.js (see CKEDITOR_SETUP.md)."
561
+ )
562
+ );
559
563
  }
560
564
  }, 1e4);
561
565
  };
562
566
  script.onerror = () => {
563
- reject(new Error(`Failed to load CKEditor from ${scriptPath}`));
567
+ reject(
568
+ new Error(
569
+ `Failed to load CKEditor from ${scriptPath}. Ensure the file exists at that URL (e.g. copy from node_modules/@aatulwork/customform-renderer/lib/ckeditor/ckeditor.js to public/lib/ckeditor/ckeditor.js) or set services.ckEditorScriptPath to a working URL.`
570
+ )
571
+ );
564
572
  };
565
573
  document.head.appendChild(script);
566
574
  });
@@ -692,9 +700,10 @@ var CKEditorField = ({ field, control, defaultValue, rules, errors, setValue, fo
692
700
  ] });
693
701
  }
694
702
  if (ckEditorError || !isCKEditorReady) {
703
+ const message = ckEditorError?.message || `CKEditor failed to load. Script path: ${ckEditorScriptPath}. Copy ckeditor.js to public/lib/ckeditor/ or set services.ckEditorScriptPath. See CKEDITOR_SETUP.md.`;
695
704
  return /* @__PURE__ */ jsxs(Box, { children: [
696
705
  /* @__PURE__ */ jsx(FormLabel, { required: field.required, error: !!errors[field.name], children: field.label }),
697
- /* @__PURE__ */ jsx(Box, { sx: { p: 2, border: "1px solid", borderColor: formColors.error, borderRadius: 1 }, children: /* @__PURE__ */ jsx(FormHelperText, { error: true, children: ckEditorError?.message || "CKEditor failed to load. Please ensure the CKEditor script is loaded." }) })
706
+ /* @__PURE__ */ jsx(Box, { sx: { p: 2, border: "1px solid", borderColor: formColors.error, borderRadius: 1 }, children: /* @__PURE__ */ jsx(FormHelperText, { error: true, children: message }) })
698
707
  ] });
699
708
  }
700
709
  return /* @__PURE__ */ jsx(