@aatulwork/customform-renderer 1.2.0 → 1.3.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/README.md +61 -26
- package/dist/index.js +12 -3
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +12 -3
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
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(
|
|
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(
|
|
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:
|
|
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(
|