@festo-ui/react 8.2.0-dev.624 → 8.2.0-dev.625

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.
@@ -11,7 +11,6 @@ export interface TextEditorConfiguration {
11
11
  image?: boolean;
12
12
  link?: boolean;
13
13
  };
14
- modules?: object;
15
14
  }
16
15
  export interface TextEditorProps {
17
16
  readonly disabled?: boolean;
@@ -75,8 +75,7 @@ function TextEditor(_ref) {
75
75
  if (editorRef.current && Quill && editor === null) {
76
76
  const newEditor = new Quill(editorRef.current, {
77
77
  modules: {
78
- toolbar: `#editor-toolbar-${CSS.escape(id ?? "")}`,
79
- ...config.modules
78
+ toolbar: `#editor-toolbar-${CSS.escape(id ?? "")}`
80
79
  },
81
80
  theme: "snow"
82
81
  });
@@ -96,7 +95,7 @@ function TextEditor(_ref) {
96
95
  }
97
96
  };
98
97
  initializeQuill();
99
- }, [editor, disabled, readOnly, id, setEditorContents, defaultValue, config.modules]);
98
+ }, [editor, disabled, readOnly, id, setEditorContents, defaultValue]);
100
99
  useEffect(() => {
101
100
  if (editor) {
102
101
  editor.on("text-change", () => {
@@ -104,6 +103,12 @@ function TextEditor(_ref) {
104
103
  if (html === "<p><br></p>" || html === "<div><br></div>" || html === undefined) {
105
104
  html = null;
106
105
  }
106
+ if (html !== null) {
107
+ // Repairs relative links in an HTML string by prepending "https://".
108
+ // It ignores links that are already absolute (http, https) as well as mailto: and tel: links.
109
+ const relativeLinkRegex = /href="(?!https?:\/\/|mailto:|tel:)([^"]+)"/g;
110
+ html = html.replace(relativeLinkRegex, 'href="https://$1"');
111
+ }
107
112
  if (onChange) {
108
113
  onChange(html);
109
114
  }
@@ -84,8 +84,7 @@ function TextEditor(_ref) {
84
84
  if (editorRef.current && Quill && editor === null) {
85
85
  const newEditor = new Quill(editorRef.current, {
86
86
  modules: {
87
- toolbar: `#editor-toolbar-${CSS.escape(id ?? "")}`,
88
- ...config.modules
87
+ toolbar: `#editor-toolbar-${CSS.escape(id ?? "")}`
89
88
  },
90
89
  theme: "snow"
91
90
  });
@@ -105,7 +104,7 @@ function TextEditor(_ref) {
105
104
  }
106
105
  };
107
106
  initializeQuill();
108
- }, [editor, disabled, readOnly, id, setEditorContents, defaultValue, config.modules]);
107
+ }, [editor, disabled, readOnly, id, setEditorContents, defaultValue]);
109
108
  (0, _react.useEffect)(() => {
110
109
  if (editor) {
111
110
  editor.on("text-change", () => {
@@ -113,6 +112,12 @@ function TextEditor(_ref) {
113
112
  if (html === "<p><br></p>" || html === "<div><br></div>" || html === undefined) {
114
113
  html = null;
115
114
  }
115
+ if (html !== null) {
116
+ // Repairs relative links in an HTML string by prepending "https://".
117
+ // It ignores links that are already absolute (http, https) as well as mailto: and tel: links.
118
+ const relativeLinkRegex = /href="(?!https?:\/\/|mailto:|tel:)([^"]+)"/g;
119
+ html = html.replace(relativeLinkRegex, 'href="https://$1"');
120
+ }
116
121
  if (onChange) {
117
122
  onChange(html);
118
123
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@festo-ui/react",
3
- "version": "8.2.0-dev.624",
3
+ "version": "8.2.0-dev.625",
4
4
  "author": "Festo UI (styleguide@festo.com)",
5
5
  "copyright": "Copyright (c) 2025 Festo SE & Co. KG. All rights reserved.",
6
6
  "license": "apache-2.0",