inconel 0.1.40 → 0.1.42
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/cjs/components/RichTextEditor/RichTextEditor.cjs +1 -1
- package/dist/cjs/components/RichTextEditor/RichTextEditor.cjs.map +1 -1
- package/dist/cjs/components/RichTextEditor/icons.cjs +2 -0
- package/dist/cjs/components/RichTextEditor/icons.cjs.map +1 -0
- package/dist/cjs/components/RichTextEditor/sanitize.cjs +1 -1
- package/dist/cjs/components/RichTextEditor/sanitize.cjs.map +1 -1
- package/dist/cjs/styles.css +1 -1
- package/dist/components/RichTextEditor/RichTextEditor.d.ts.map +1 -1
- package/dist/components/RichTextEditor/RichTextEditor.js +256 -171
- package/dist/components/RichTextEditor/RichTextEditor.js.map +1 -1
- package/dist/components/RichTextEditor/icons.d.ts +23 -0
- package/dist/components/RichTextEditor/icons.d.ts.map +1 -0
- package/dist/components/RichTextEditor/icons.js +73 -0
- package/dist/components/RichTextEditor/icons.js.map +1 -0
- package/dist/components/RichTextEditor/sanitize.d.ts.map +1 -1
- package/dist/components/RichTextEditor/sanitize.js +28 -14
- package/dist/components/RichTextEditor/sanitize.js.map +1 -1
- package/dist/styles.css +1 -1
- package/package.json +13 -13
|
@@ -1,72 +1,77 @@
|
|
|
1
|
-
import { jsxs as
|
|
2
|
-
import { useId as
|
|
3
|
-
import
|
|
1
|
+
import { jsxs as c, jsx as n } from "react/jsx-runtime";
|
|
2
|
+
import { useId as ye, useRef as O, useState as p, useEffect as ge, useCallback as _e } from "react";
|
|
3
|
+
import Ce from "../FieldFeedback/FieldFeedback.js";
|
|
4
4
|
/* empty css */
|
|
5
5
|
/* empty css */
|
|
6
|
-
import {
|
|
7
|
-
|
|
6
|
+
import { icons as a } from "./icons.js";
|
|
7
|
+
import { sanitizeHtml as v } from "./sanitize.js";
|
|
8
|
+
const ke = [
|
|
8
9
|
{ tag: "p", label: "Paragraf" },
|
|
9
10
|
{ tag: "h1", label: "Başlık 1" },
|
|
10
11
|
{ tag: "h2", label: "Başlık 2" },
|
|
11
12
|
{ tag: "h3", label: "Başlık 3" },
|
|
12
13
|
{ tag: "blockquote", label: "Alıntı" }
|
|
13
|
-
],
|
|
14
|
-
const
|
|
15
|
-
|
|
14
|
+
], ve = [12, 14, 16, 18, 24, 32], Ne = /* @__PURE__ */ new Set(["justifyLeft", "justifyCenter", "justifyRight", "justifyFull"]), Se = (m) => new Promise((h, S) => {
|
|
15
|
+
const o = new FileReader();
|
|
16
|
+
o.onload = () => h(String(o.result)), o.onerror = () => S(o.error), o.readAsDataURL(m);
|
|
16
17
|
});
|
|
17
|
-
function
|
|
18
|
+
function N({ label: m, onClick: h, disabled: S, active: o, children: j }) {
|
|
18
19
|
return /* @__PURE__ */ n(
|
|
19
20
|
"button",
|
|
20
21
|
{
|
|
21
22
|
type: "button",
|
|
22
|
-
className: `inconel-rte__btn${
|
|
23
|
-
"aria-label":
|
|
24
|
-
title:
|
|
25
|
-
"aria-pressed":
|
|
26
|
-
disabled:
|
|
27
|
-
onMouseDown: (
|
|
28
|
-
onClick:
|
|
29
|
-
children:
|
|
23
|
+
className: `inconel-rte__btn${o ? " inconel-is-active" : ""}`,
|
|
24
|
+
"aria-label": m,
|
|
25
|
+
title: m,
|
|
26
|
+
"aria-pressed": o,
|
|
27
|
+
disabled: S,
|
|
28
|
+
onMouseDown: (R) => R.preventDefault(),
|
|
29
|
+
onClick: h,
|
|
30
|
+
children: j
|
|
30
31
|
}
|
|
31
32
|
);
|
|
32
33
|
}
|
|
33
|
-
function
|
|
34
|
-
value:
|
|
35
|
-
onChange:
|
|
36
|
-
onBlur:
|
|
37
|
-
label:
|
|
38
|
-
placeholder:
|
|
39
|
-
id:
|
|
40
|
-
disabled:
|
|
41
|
-
required:
|
|
42
|
-
fullWidth:
|
|
43
|
-
className:
|
|
44
|
-
minHeight:
|
|
45
|
-
onImageUpload:
|
|
46
|
-
onRequestMedia:
|
|
47
|
-
hint:
|
|
48
|
-
errorMessage:
|
|
34
|
+
function Re({
|
|
35
|
+
value: m = "",
|
|
36
|
+
onChange: h,
|
|
37
|
+
onBlur: S,
|
|
38
|
+
label: o,
|
|
39
|
+
placeholder: j,
|
|
40
|
+
id: R,
|
|
41
|
+
disabled: y = !1,
|
|
42
|
+
required: U,
|
|
43
|
+
fullWidth: ne = !0,
|
|
44
|
+
className: le,
|
|
45
|
+
minHeight: A = 200,
|
|
46
|
+
onImageUpload: G,
|
|
47
|
+
onRequestMedia: P,
|
|
48
|
+
hint: $,
|
|
49
|
+
errorMessage: w
|
|
49
50
|
}) {
|
|
50
|
-
const
|
|
51
|
-
|
|
52
|
-
const e =
|
|
53
|
-
if (!e ||
|
|
54
|
-
const t =
|
|
55
|
-
e.innerHTML !== t && (e.innerHTML = t),
|
|
56
|
-
}, [
|
|
57
|
-
const
|
|
58
|
-
const e =
|
|
51
|
+
const ae = ye(), T = R ?? `inconel-rte-${ae.replace(/:/g, "")}`, q = `${T}-hint`, W = `${T}-error`, u = O(null), M = O(null), L = O(null), [f, re] = p(!1), [K, Y] = p(""), [s, x] = p(null), [J, Z] = p(""), [ie, oe] = p({}), [se, F] = p(!m), [ce, Q] = p(!1), [C, V] = p({ rows: 3, cols: 3 });
|
|
52
|
+
ge(() => {
|
|
53
|
+
const e = u.current;
|
|
54
|
+
if (!e || m === L.current) return;
|
|
55
|
+
const t = v(m);
|
|
56
|
+
e.innerHTML !== t && (e.innerHTML = t), L.current = m, F(!e.textContent && !e.querySelector("img"));
|
|
57
|
+
}, [m, f]);
|
|
58
|
+
const g = _e(() => {
|
|
59
|
+
const e = u.current;
|
|
59
60
|
if (!e) return;
|
|
60
|
-
const t = !!e.textContent || !!e.querySelector("img"),
|
|
61
|
-
|
|
62
|
-
}, [
|
|
63
|
-
const e = window.getSelection(), t =
|
|
64
|
-
e && e.rangeCount > 0 && t?.contains(e.getRangeAt(0).commonAncestorContainer) && (
|
|
65
|
-
},
|
|
66
|
-
|
|
61
|
+
const t = !!e.textContent || !!e.querySelector("img"), l = t ? v(e.innerHTML) : "";
|
|
62
|
+
F(!t), L.current = l, h?.(l);
|
|
63
|
+
}, [h]), b = () => {
|
|
64
|
+
const e = window.getSelection(), t = u.current;
|
|
65
|
+
e && e.rangeCount > 0 && t?.contains(e.getRangeAt(0).commonAncestorContainer) && (M.current = e.getRangeAt(0).cloneRange());
|
|
66
|
+
}, B = () => {
|
|
67
|
+
u.current?.focus();
|
|
67
68
|
const e = window.getSelection();
|
|
68
|
-
e &&
|
|
69
|
-
},
|
|
69
|
+
e && M.current && (e.removeAllRanges(), e.addRange(M.current));
|
|
70
|
+
}, X = () => {
|
|
71
|
+
const e = window.getSelection()?.anchorNode, l = (e instanceof Element ? e : e?.parentElement)?.closest("td, th") ?? null;
|
|
72
|
+
return l && u.current?.contains(l) ? l : null;
|
|
73
|
+
}, D = () => {
|
|
74
|
+
Q(!!X());
|
|
70
75
|
const e = (t) => {
|
|
71
76
|
try {
|
|
72
77
|
return document.queryCommandState(t);
|
|
@@ -74,7 +79,7 @@ function be({
|
|
|
74
79
|
return !1;
|
|
75
80
|
}
|
|
76
81
|
};
|
|
77
|
-
|
|
82
|
+
oe({
|
|
78
83
|
bold: e("bold"),
|
|
79
84
|
italic: e("italic"),
|
|
80
85
|
underline: e("underline"),
|
|
@@ -86,104 +91,126 @@ function be({
|
|
|
86
91
|
insertUnorderedList: e("insertUnorderedList"),
|
|
87
92
|
insertOrderedList: e("insertOrderedList")
|
|
88
93
|
});
|
|
89
|
-
},
|
|
90
|
-
|
|
91
|
-
},
|
|
92
|
-
|
|
93
|
-
const
|
|
94
|
-
|
|
95
|
-
}),
|
|
96
|
-
},
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
94
|
+
}, E = (e, t) => {
|
|
95
|
+
B(), document.execCommand("styleWithCSS", !1, Ne.has(e) ? "true" : "false"), document.execCommand(e, !1, t), b(), D(), g();
|
|
96
|
+
}, de = (e) => {
|
|
97
|
+
B(), document.execCommand("styleWithCSS", !1, "false"), document.execCommand("fontSize", !1, "7"), u.current?.querySelectorAll('font[size="7"]').forEach((t) => {
|
|
98
|
+
const l = document.createElement("span");
|
|
99
|
+
l.style.fontSize = `${e}px`, l.append(...Array.from(t.childNodes)), t.replaceWith(l);
|
|
100
|
+
}), b(), g();
|
|
101
|
+
}, ue = (e) => {
|
|
102
|
+
B();
|
|
103
|
+
const t = X(), l = t?.parentElement, i = t?.closest("table");
|
|
104
|
+
if (!t || !l || !i) return;
|
|
105
|
+
const I = t.cellIndex, te = (d) => {
|
|
106
|
+
const k = document.createElement(d.tagName);
|
|
107
|
+
return k.innerHTML = "<br>", k;
|
|
108
|
+
};
|
|
109
|
+
if (e === "addRow") {
|
|
110
|
+
const d = document.createElement("tr");
|
|
111
|
+
Array.from(l.cells).forEach((k) => d.append(te(k.tagName === "TH" ? document.createElement("td") : k))), l.parentElement?.tagName === "THEAD" ? (i.tBodies[0] ?? i.appendChild(document.createElement("tbody"))).prepend(d) : l.after(d);
|
|
112
|
+
} else e === "delRow" ? (l.remove(), i.rows.length || i.remove()) : e === "addCol" ? Array.from(i.rows).forEach((d) => d.cells[I]?.after(te(d.cells[I]))) : e === "delCol" ? (Array.from(i.rows).forEach((d) => d.cells[I]?.remove()), Array.from(i.rows).some((d) => d.cells.length) || i.remove()) : i.remove();
|
|
113
|
+
Q(!1), g();
|
|
114
|
+
}, me = () => {
|
|
115
|
+
const e = Math.min(Math.max(C.rows, 1), 20), t = Math.min(Math.max(C.cols, 1), 10), i = `<tr>${"<td><br></td>".repeat(t)}</tr>`.repeat(e);
|
|
116
|
+
ee(
|
|
117
|
+
`<table border="1" width="100%" cellspacing="0" cellpadding="6"><tbody>${i}</tbody></table><p><br></p>`
|
|
118
|
+
), x(null);
|
|
119
|
+
}, ee = (e) => {
|
|
120
|
+
B(), document.execCommand("insertHTML", !1, v(e)), b(), g();
|
|
121
|
+
}, H = (e) => {
|
|
122
|
+
b(), Z(""), x(s === e ? null : e);
|
|
123
|
+
}, z = () => {
|
|
124
|
+
if (s === "table") {
|
|
125
|
+
me();
|
|
126
|
+
return;
|
|
127
|
+
}
|
|
128
|
+
const e = J.trim();
|
|
129
|
+
e && (s === "link" ? (E("createLink", e), u.current?.querySelectorAll("a").forEach((t) => {
|
|
103
130
|
/^https?:/i.test(t.getAttribute("href") ?? "") && (t.setAttribute("target", "_blank"), t.setAttribute("rel", "noopener noreferrer"));
|
|
104
|
-
}),
|
|
105
|
-
},
|
|
131
|
+
}), g()) : s === "image" && E("insertImage", e), x(null));
|
|
132
|
+
}, fe = async (e) => {
|
|
106
133
|
const t = e.target.files?.[0];
|
|
107
134
|
if (e.target.value = "", !t || !t.type.startsWith("image/")) return;
|
|
108
|
-
const
|
|
109
|
-
|
|
110
|
-
},
|
|
135
|
+
const l = G ? await G(t) : await Se(t);
|
|
136
|
+
E("insertImage", l), x(null);
|
|
137
|
+
}, be = (e) => {
|
|
111
138
|
const t = e.clipboardData.getData("text/html");
|
|
112
|
-
t && (e.preventDefault(), document.execCommand("insertHTML", !1,
|
|
113
|
-
},
|
|
114
|
-
if (
|
|
115
|
-
const e =
|
|
116
|
-
|
|
139
|
+
t && (e.preventDefault(), document.execCommand("insertHTML", !1, v(t)), g());
|
|
140
|
+
}, pe = () => {
|
|
141
|
+
if (f) {
|
|
142
|
+
const e = v(K);
|
|
143
|
+
L.current = null, u.current && (u.current.innerHTML = e), L.current = e, F(!e), h?.(e);
|
|
117
144
|
} else
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
},
|
|
121
|
-
|
|
145
|
+
Y(v(u.current?.innerHTML ?? ""));
|
|
146
|
+
x(null), re(!f);
|
|
147
|
+
}, he = [$ && !w ? q : void 0, w ? W : void 0].filter(Boolean).join(" ") || void 0, _ = y || f, r = (e, t, l, i) => /* @__PURE__ */ n(
|
|
148
|
+
N,
|
|
122
149
|
{
|
|
123
150
|
label: t,
|
|
124
|
-
active:
|
|
125
|
-
disabled:
|
|
126
|
-
onClick: () =>
|
|
127
|
-
children:
|
|
151
|
+
active: ie[e],
|
|
152
|
+
disabled: _,
|
|
153
|
+
onClick: () => E(e, i),
|
|
154
|
+
children: l
|
|
128
155
|
}
|
|
129
156
|
);
|
|
130
|
-
return /* @__PURE__ */
|
|
157
|
+
return /* @__PURE__ */ c(
|
|
131
158
|
"div",
|
|
132
159
|
{
|
|
133
160
|
className: [
|
|
134
161
|
"inconel-field",
|
|
135
|
-
|
|
136
|
-
|
|
162
|
+
ne ? "inconel-field--full-width" : "",
|
|
163
|
+
le ?? ""
|
|
137
164
|
].join(" "),
|
|
138
165
|
children: [
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
166
|
+
o && /* @__PURE__ */ c("label", { className: "inconel-field__label", htmlFor: T, children: [
|
|
167
|
+
o,
|
|
168
|
+
U && /* @__PURE__ */ n("span", { "aria-hidden": "true", children: " *" })
|
|
142
169
|
] }),
|
|
143
|
-
/* @__PURE__ */
|
|
170
|
+
/* @__PURE__ */ c(
|
|
144
171
|
"div",
|
|
145
172
|
{
|
|
146
173
|
className: [
|
|
147
174
|
"inconel-rte",
|
|
148
|
-
|
|
149
|
-
|
|
175
|
+
w ? "inconel-is-invalid" : "",
|
|
176
|
+
y ? "inconel-is-disabled" : ""
|
|
150
177
|
].join(" "),
|
|
151
178
|
children: [
|
|
152
|
-
/* @__PURE__ */
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
179
|
+
/* @__PURE__ */ c("div", { className: "inconel-rte__toolbar", role: "toolbar", "aria-label": "Biçimlendirme", children: [
|
|
180
|
+
r("bold", "Kalın", a.bold),
|
|
181
|
+
r("italic", "İtalik", a.italic),
|
|
182
|
+
r("underline", "Altı çizili", a.underline),
|
|
183
|
+
r("strikeThrough", "Üstü çizili", a.strike),
|
|
157
184
|
/* @__PURE__ */ n("span", { className: "inconel-rte__sep" }),
|
|
158
|
-
/* @__PURE__ */
|
|
185
|
+
/* @__PURE__ */ c(
|
|
159
186
|
"select",
|
|
160
187
|
{
|
|
161
188
|
className: "inconel-rte__select",
|
|
162
189
|
"aria-label": "Biçim",
|
|
163
|
-
disabled:
|
|
190
|
+
disabled: _,
|
|
164
191
|
value: "",
|
|
165
192
|
onChange: (e) => {
|
|
166
|
-
e.target.value &&
|
|
193
|
+
e.target.value && E("formatBlock", e.target.value);
|
|
167
194
|
},
|
|
168
195
|
children: [
|
|
169
196
|
/* @__PURE__ */ n("option", { value: "", children: "Biçim" }),
|
|
170
|
-
|
|
197
|
+
ke.map((e) => /* @__PURE__ */ n("option", { value: e.tag, children: e.label }, e.tag))
|
|
171
198
|
]
|
|
172
199
|
}
|
|
173
200
|
),
|
|
174
|
-
/* @__PURE__ */
|
|
201
|
+
/* @__PURE__ */ c(
|
|
175
202
|
"select",
|
|
176
203
|
{
|
|
177
204
|
className: "inconel-rte__select",
|
|
178
205
|
"aria-label": "Yazı boyutu",
|
|
179
|
-
disabled:
|
|
206
|
+
disabled: _,
|
|
180
207
|
value: "",
|
|
181
208
|
onChange: (e) => {
|
|
182
|
-
e.target.value &&
|
|
209
|
+
e.target.value && de(Number(e.target.value));
|
|
183
210
|
},
|
|
184
211
|
children: [
|
|
185
212
|
/* @__PURE__ */ n("option", { value: "", children: "Boyut" }),
|
|
186
|
-
|
|
213
|
+
ve.map((e) => /* @__PURE__ */ c("option", { value: e, children: [
|
|
187
214
|
e,
|
|
188
215
|
"px"
|
|
189
216
|
] }, e))
|
|
@@ -191,80 +218,138 @@ function be({
|
|
|
191
218
|
}
|
|
192
219
|
),
|
|
193
220
|
/* @__PURE__ */ n("span", { className: "inconel-rte__sep" }),
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
221
|
+
r("justifyLeft", "Sola hizala", a.alignLeft),
|
|
222
|
+
r("justifyCenter", "Ortala", a.alignCenter),
|
|
223
|
+
r("justifyRight", "Sağa hizala", a.alignRight),
|
|
224
|
+
r("justifyFull", "İki yana yasla", a.alignJustify),
|
|
198
225
|
/* @__PURE__ */ n("span", { className: "inconel-rte__sep" }),
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
226
|
+
r("insertUnorderedList", "Madde işaretli liste", a.listUl),
|
|
227
|
+
r("insertOrderedList", "Numaralı liste", a.listOl),
|
|
228
|
+
r("outdent", "Girintiyi azalt", a.outdent),
|
|
229
|
+
r("indent", "Girintiyi artır", a.indent),
|
|
230
|
+
r("removeFormat", "Biçimi temizle", a.clearFormat),
|
|
204
231
|
/* @__PURE__ */ n("span", { className: "inconel-rte__sep" }),
|
|
205
232
|
/* @__PURE__ */ n(
|
|
206
|
-
|
|
233
|
+
N,
|
|
207
234
|
{
|
|
208
235
|
label: "Bağlantı ekle",
|
|
209
|
-
disabled:
|
|
210
|
-
active:
|
|
211
|
-
onClick: () =>
|
|
212
|
-
children:
|
|
236
|
+
disabled: _,
|
|
237
|
+
active: s === "link",
|
|
238
|
+
onClick: () => H("link"),
|
|
239
|
+
children: a.link
|
|
213
240
|
}
|
|
214
241
|
),
|
|
215
242
|
/* @__PURE__ */ n(
|
|
216
|
-
|
|
243
|
+
N,
|
|
244
|
+
{
|
|
245
|
+
label: "Tablo ekle",
|
|
246
|
+
disabled: _,
|
|
247
|
+
active: s === "table",
|
|
248
|
+
onClick: () => H("table"),
|
|
249
|
+
children: a.table
|
|
250
|
+
}
|
|
251
|
+
),
|
|
252
|
+
/* @__PURE__ */ n(
|
|
253
|
+
N,
|
|
217
254
|
{
|
|
218
255
|
label: "Görsel ekle",
|
|
219
|
-
disabled:
|
|
220
|
-
active:
|
|
221
|
-
onClick: () =>
|
|
222
|
-
children:
|
|
256
|
+
disabled: _,
|
|
257
|
+
active: s === "image",
|
|
258
|
+
onClick: () => H("image"),
|
|
259
|
+
children: a.image
|
|
223
260
|
}
|
|
224
261
|
),
|
|
225
|
-
|
|
226
|
-
|
|
262
|
+
P && /* @__PURE__ */ n(
|
|
263
|
+
N,
|
|
227
264
|
{
|
|
228
265
|
label: "Medya galerisi",
|
|
229
|
-
disabled:
|
|
266
|
+
disabled: _,
|
|
230
267
|
onClick: () => {
|
|
231
|
-
|
|
268
|
+
b(), P(ee);
|
|
232
269
|
},
|
|
233
|
-
children:
|
|
270
|
+
children: a.gallery
|
|
234
271
|
}
|
|
235
272
|
),
|
|
236
273
|
/* @__PURE__ */ n("span", { className: "inconel-rte__sep" }),
|
|
237
|
-
|
|
238
|
-
|
|
274
|
+
r("undo", "Geri al", a.undo),
|
|
275
|
+
r("redo", "Yinele", a.redo),
|
|
239
276
|
/* @__PURE__ */ n(
|
|
240
|
-
|
|
277
|
+
N,
|
|
241
278
|
{
|
|
242
279
|
label: "HTML kaynağı",
|
|
243
|
-
disabled:
|
|
244
|
-
active:
|
|
245
|
-
onClick:
|
|
246
|
-
children:
|
|
280
|
+
disabled: y,
|
|
281
|
+
active: f,
|
|
282
|
+
onClick: pe,
|
|
283
|
+
children: a.code
|
|
247
284
|
}
|
|
248
285
|
)
|
|
249
286
|
] }),
|
|
250
|
-
|
|
287
|
+
s === "table" && !f && /* @__PURE__ */ c("div", { className: "inconel-rte__panel", children: [
|
|
288
|
+
/* @__PURE__ */ c("label", { className: "inconel-rte__field", children: [
|
|
289
|
+
"Satır",
|
|
290
|
+
/* @__PURE__ */ n(
|
|
291
|
+
"input",
|
|
292
|
+
{
|
|
293
|
+
type: "number",
|
|
294
|
+
min: 1,
|
|
295
|
+
max: 20,
|
|
296
|
+
className: "inconel-rte__input inconel-rte__input--num",
|
|
297
|
+
value: C.rows,
|
|
298
|
+
onChange: (e) => V({ ...C, rows: Number(e.target.value) })
|
|
299
|
+
}
|
|
300
|
+
)
|
|
301
|
+
] }),
|
|
302
|
+
/* @__PURE__ */ c("label", { className: "inconel-rte__field", children: [
|
|
303
|
+
"Sütun",
|
|
304
|
+
/* @__PURE__ */ n(
|
|
305
|
+
"input",
|
|
306
|
+
{
|
|
307
|
+
type: "number",
|
|
308
|
+
min: 1,
|
|
309
|
+
max: 10,
|
|
310
|
+
className: "inconel-rte__input inconel-rte__input--num",
|
|
311
|
+
value: C.cols,
|
|
312
|
+
onChange: (e) => V({ ...C, cols: Number(e.target.value) })
|
|
313
|
+
}
|
|
314
|
+
)
|
|
315
|
+
] }),
|
|
316
|
+
/* @__PURE__ */ n("button", { type: "button", className: "inconel-rte__action", onClick: z, children: "Tablo ekle" })
|
|
317
|
+
] }),
|
|
318
|
+
ce && !f && !y && /* @__PURE__ */ n("div", { className: "inconel-rte__panel", role: "toolbar", "aria-label": "Tablo", children: [
|
|
319
|
+
["addRow", "Satır ekle"],
|
|
320
|
+
["delRow", "Satırı sil"],
|
|
321
|
+
["addCol", "Sütun ekle"],
|
|
322
|
+
["delCol", "Sütunu sil"],
|
|
323
|
+
["delTable", "Tabloyu sil"]
|
|
324
|
+
].map(([e, t]) => /* @__PURE__ */ n(
|
|
325
|
+
"button",
|
|
326
|
+
{
|
|
327
|
+
type: "button",
|
|
328
|
+
className: "inconel-rte__action",
|
|
329
|
+
onMouseDown: (l) => l.preventDefault(),
|
|
330
|
+
onClick: () => ue(e),
|
|
331
|
+
children: t
|
|
332
|
+
},
|
|
333
|
+
e
|
|
334
|
+
)) }),
|
|
335
|
+
s && s !== "table" && !f && /* @__PURE__ */ c("div", { className: "inconel-rte__panel", children: [
|
|
251
336
|
/* @__PURE__ */ n(
|
|
252
337
|
"input",
|
|
253
338
|
{
|
|
254
339
|
type: "url",
|
|
255
340
|
className: "inconel-rte__input",
|
|
256
|
-
"aria-label":
|
|
257
|
-
placeholder:
|
|
258
|
-
value:
|
|
341
|
+
"aria-label": s === "link" ? "Bağlantı adresi" : "Görsel adresi",
|
|
342
|
+
placeholder: s === "link" ? "https://…" : "Görsel URL (https://…)",
|
|
343
|
+
value: J,
|
|
259
344
|
autoFocus: !0,
|
|
260
|
-
onChange: (e) =>
|
|
345
|
+
onChange: (e) => Z(e.target.value),
|
|
261
346
|
onKeyDown: (e) => {
|
|
262
|
-
e.key === "Enter" && (e.preventDefault(),
|
|
347
|
+
e.key === "Enter" && (e.preventDefault(), z());
|
|
263
348
|
}
|
|
264
349
|
}
|
|
265
350
|
),
|
|
266
|
-
/* @__PURE__ */ n("button", { type: "button", className: "inconel-rte__action", onClick:
|
|
267
|
-
|
|
351
|
+
/* @__PURE__ */ n("button", { type: "button", className: "inconel-rte__action", onClick: z, children: "Ekle" }),
|
|
352
|
+
s === "image" && /* @__PURE__ */ c("label", { className: "inconel-rte__action", children: [
|
|
268
353
|
"Dosya seç",
|
|
269
354
|
/* @__PURE__ */ n(
|
|
270
355
|
"input",
|
|
@@ -273,51 +358,51 @@ function be({
|
|
|
273
358
|
accept: "image/*",
|
|
274
359
|
hidden: !0,
|
|
275
360
|
"aria-label": "Görsel dosyası",
|
|
276
|
-
onChange:
|
|
361
|
+
onChange: fe
|
|
277
362
|
}
|
|
278
363
|
)
|
|
279
364
|
] })
|
|
280
365
|
] }),
|
|
281
|
-
|
|
366
|
+
f ? /* @__PURE__ */ n(
|
|
282
367
|
"textarea",
|
|
283
368
|
{
|
|
284
|
-
id:
|
|
369
|
+
id: T,
|
|
285
370
|
className: "inconel-rte__source",
|
|
286
|
-
style: { minHeight:
|
|
287
|
-
"aria-label":
|
|
288
|
-
value:
|
|
289
|
-
disabled:
|
|
371
|
+
style: { minHeight: A },
|
|
372
|
+
"aria-label": o ?? "HTML kaynağı",
|
|
373
|
+
value: K,
|
|
374
|
+
disabled: y,
|
|
290
375
|
spellCheck: !1,
|
|
291
|
-
onChange: (e) =>
|
|
376
|
+
onChange: (e) => Y(e.target.value)
|
|
292
377
|
}
|
|
293
|
-
) : /* @__PURE__ */
|
|
294
|
-
|
|
378
|
+
) : /* @__PURE__ */ c("div", { className: "inconel-rte__surface", style: { minHeight: A }, children: [
|
|
379
|
+
se && j && /* @__PURE__ */ n("span", { className: "inconel-rte__placeholder", "aria-hidden": "true", children: j }),
|
|
295
380
|
/* @__PURE__ */ n(
|
|
296
381
|
"div",
|
|
297
382
|
{
|
|
298
|
-
ref:
|
|
299
|
-
id:
|
|
383
|
+
ref: u,
|
|
384
|
+
id: T,
|
|
300
385
|
className: "inconel-rte__content",
|
|
301
386
|
role: "textbox",
|
|
302
387
|
"aria-multiline": "true",
|
|
303
|
-
"aria-label":
|
|
304
|
-
"aria-required":
|
|
305
|
-
"aria-invalid": !!
|
|
306
|
-
"aria-describedby":
|
|
307
|
-
"aria-disabled":
|
|
308
|
-
contentEditable: !
|
|
388
|
+
"aria-label": o,
|
|
389
|
+
"aria-required": U,
|
|
390
|
+
"aria-invalid": !!w,
|
|
391
|
+
"aria-describedby": he,
|
|
392
|
+
"aria-disabled": y,
|
|
393
|
+
contentEditable: !y,
|
|
309
394
|
suppressContentEditableWarning: !0,
|
|
310
|
-
style: { minHeight:
|
|
311
|
-
onInput:
|
|
312
|
-
onPaste:
|
|
395
|
+
style: { minHeight: A },
|
|
396
|
+
onInput: g,
|
|
397
|
+
onPaste: be,
|
|
313
398
|
onKeyUp: () => {
|
|
314
|
-
|
|
399
|
+
b(), D();
|
|
315
400
|
},
|
|
316
401
|
onMouseUp: () => {
|
|
317
|
-
|
|
402
|
+
b(), D();
|
|
318
403
|
},
|
|
319
404
|
onBlur: () => {
|
|
320
|
-
|
|
405
|
+
b(), S?.();
|
|
321
406
|
}
|
|
322
407
|
}
|
|
323
408
|
)
|
|
@@ -325,12 +410,12 @@ function be({
|
|
|
325
410
|
]
|
|
326
411
|
}
|
|
327
412
|
),
|
|
328
|
-
/* @__PURE__ */ n(
|
|
413
|
+
/* @__PURE__ */ n(Ce, { hint: $, errorMessage: w, hintId: q, errorId: W })
|
|
329
414
|
]
|
|
330
415
|
}
|
|
331
416
|
);
|
|
332
417
|
}
|
|
333
418
|
export {
|
|
334
|
-
|
|
419
|
+
Re as default
|
|
335
420
|
};
|
|
336
421
|
//# sourceMappingURL=RichTextEditor.js.map
|