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