Skip to content

Commit 15efd71

Browse files
committed
include optional debug prop to silence module import notifications in the console
1 parent af8aee7 commit 15efd71

File tree

9 files changed

+22
-18
lines changed

9 files changed

+22
-18
lines changed

dist/components/form/Form.d.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ declare const Form: {
1818
({ type, className, ...rest }: import("./components/FormCheck").FormCheckProps): React.JSX.Element;
1919
Feedback: import("react-bootstrap/esm/helpers").BsPrefixRefForwardingComponent<"div", import("react-bootstrap/esm/Feedback").FeedbackProps>;
2020
};
21-
RichText: ({ modules, value, onChange, theme, importCallback, ...rest }: import("./components/FormRichText").QuillEditorProps) => React.JSX.Element;
21+
RichText: ({ modules, value, onChange, theme, importCallback, debug, ...rest }: import("./components/FormRichText").QuillEditorProps) => React.JSX.Element;
2222
DateTime: {
2323
({ className, ...rest }: import("./components/FormDateTime").FormDateTimeProps): React.JSX.Element;
2424
Feedback: import("react-bootstrap/esm/helpers").BsPrefixRefForwardingComponent<"div", import("react-bootstrap/esm/Feedback").FeedbackProps>;

dist/components/form/components/FormRichText.d.ts

+2-1
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,10 @@ export interface QuillEditorProps {
77
modules?: Record<string, unknown>;
88
value?: string;
99
theme?: string;
10+
debug?: boolean;
1011
onChange?(value: string): any;
1112
importCallback?(): any;
1213
}
13-
declare const FormRichText: ({ modules, value, onChange, theme, importCallback, ...rest }: QuillEditorProps) => React.JSX.Element;
14+
declare const FormRichText: ({ modules, value, onChange, theme, importCallback, debug, ...rest }: QuillEditorProps) => React.JSX.Element;
1415
export default FormRichText;
1516
//# sourceMappingURL=FormRichText.d.ts.map

dist/components/form/components/FormRichText.d.ts.map

+1-1
Original file line numberDiff line numberDiff line change

dist/components/form/components/FormRichText.js

+5-5
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/components/form/components/FormRichText.js.map

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/index.es.js

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/index.js

+5-5
Original file line numberDiff line numberDiff line change
@@ -25532,9 +25532,11 @@ Quill.register({
2553225532
}, true);
2553325533

2553425534
var FormRichText = function (_a) {
25535-
var modules = _a.modules, value = _a.value, onChange = _a.onChange, theme = _a.theme, importCallback = _a.importCallback, rest = __rest(_a, ["modules", "value", "onChange", "theme", "importCallback"]);
25535+
var modules = _a.modules, value = _a.value, onChange = _a.onChange, theme = _a.theme, importCallback = _a.importCallback, debug = _a.debug, rest = __rest(_a, ["modules", "value", "onChange", "theme", "importCallback", "debug"]);
2553625536
var quillRef = React.useRef(null);
2553725537
var containerRef = React.useRef(null);
25538+
//Set debug mode, false results in no output.
25539+
Quill.debug(debug || false);
2553825540
var quillOptions = __assign(__assign({}, modules), { theme: theme || 'snow' });
2553925541
var setValue = function (quillRef) {
2554025542
var delta = quillRef.clipboard.convert({ html: value });
@@ -25550,10 +25552,8 @@ var FormRichText = function (_a) {
2555025552
};
2555125553
React.useEffect(function () {
2555225554
if (containerRef.current) {
25553-
console.log(importCallback);
2555425555
if (importCallback) {
25555-
console.log("import callback called");
25556-
// Callback to import new modules into quill, needs to be done within the same instance as the quill object.
25556+
//Callback to import new modules into quill, needs to be done within the same instance as the quill object.
2555725557
importCallback();
2555825558
}
2555925559
var container_1 = containerRef.current;
@@ -25572,7 +25572,7 @@ var FormRichText = function (_a) {
2557225572
// NOTE: Run effect once on component mount, please recheck dependencies if effect is updated.
2557325573
// eslint-disable-next-line react-hooks/exhaustive-deps
2557425574
}, []);
25575-
return (React.createElement("div", { ref: containerRef, style: rest.style, id: rest.id, className: rest.className }));
25575+
return React.createElement("div", { ref: containerRef, style: rest.style, id: rest.id, className: rest.className });
2557625576
};
2557725577

2557825578
var FormDateTime = function (_a) {

dist/index.min.js

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/components/form/components/FormRichText.tsx

+5-2
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ export interface QuillEditorProps {
99
modules?: Record<string, unknown>;
1010
value?: string;
1111
theme?: string;
12+
debug?: boolean;
1213

1314
onChange?(value: string): any;
1415
importCallback?(): any;
@@ -20,11 +21,15 @@ const FormRichText = ({
2021
onChange,
2122
theme,
2223
importCallback,
24+
debug,
2325
...rest
2426
}: QuillEditorProps) => {
2527
const quillRef = useRef<Quill | null>(null);
2628
const containerRef = useRef<HTMLDivElement>(null);
2729

30+
// Set debug mode, false results in no output.
31+
Quill.debug(debug || false);
32+
2833
const quillOptions = {
2934
...modules,
3035
theme: theme || 'snow',
@@ -45,9 +50,7 @@ const FormRichText = ({
4550

4651
useEffect(() => {
4752
if (containerRef.current) {
48-
console.log(importCallback);
4953
if (importCallback) {
50-
console.log('import callback called');
5154
// Callback to import new modules into quill, needs to be done within the same instance as the quill object.
5255
importCallback();
5356
}

0 commit comments

Comments
 (0)