inconel 0.1.41 → 0.1.43

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