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.
@@ -1,75 +1,76 @@
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";
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 v } from "./sanitize.js";
8
- const ke = [
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
- ], 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);
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: m, onClick: h, disabled: S, active: o, children: j }) {
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${o ? " inconel-is-active" : ""}`,
23
+ className: `inconel-rte__btn${i ? " inconel-is-active" : ""}`,
24
24
  "aria-label": m,
25
25
  title: m,
26
- "aria-pressed": o,
26
+ "aria-pressed": i,
27
27
  disabled: S,
28
- onMouseDown: (R) => R.preventDefault(),
29
- onClick: h,
30
- children: j
28
+ onMouseDown: (j) => j.preventDefault(),
29
+ onClick: b,
30
+ children: E
31
31
  }
32
32
  );
33
33
  }
34
- function Re({
34
+ function Ie({
35
35
  value: m = "",
36
- onChange: h,
36
+ onChange: b,
37
37
  onBlur: S,
38
- label: o,
39
- placeholder: j,
40
- id: R,
41
- disabled: y = !1,
38
+ label: i,
39
+ placeholder: E,
40
+ id: j,
41
+ disabled: p = !1,
42
42
  required: U,
43
- fullWidth: ne = !0,
44
- className: le,
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: w
50
+ errorMessage: v
50
51
  }) {
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"));
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 = _e(() => {
59
- const e = u.current;
59
+ const g = Le(() => {
60
+ const e = d.current;
60
61
  if (!e) return;
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());
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
- u.current?.focus();
68
+ d.current?.focus();
68
69
  const e = window.getSelection();
69
- e && M.current && (e.removeAllRanges(), e.addRange(M.current));
70
+ e && F.current && (e.removeAllRanges(), e.addRange(F.current));
70
71
  }, 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;
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
- oe({
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
- }, 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) => {
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(), 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;
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 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();
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
- }, 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);
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>${i}</tbody></table><p><br></p>`
118
- ), x(null);
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, v(e)), b(), g();
121
- }, H = (e) => {
122
- b(), Z(""), x(s === e ? null : e);
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 (s === "table") {
125
- me();
125
+ if (u === "table") {
126
+ ye();
126
127
  return;
127
128
  }
128
- const e = J.trim();
129
- e && (s === "link" ? (E("createLink", e), u.current?.querySelectorAll("a").forEach((t) => {
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()) : s === "image" && E("insertImage", e), x(null));
132
- }, fe = async (e) => {
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 l = G ? await G(t) : await Se(t);
136
- E("insertImage", l), x(null);
137
- }, be = (e) => {
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, v(t)), g());
140
- }, pe = () => {
140
+ t && (e.preventDefault(), document.execCommand("insertHTML", !1, C(t)), g());
141
+ }, ge = () => {
141
142
  if (f) {
142
- const e = v(K);
143
- L.current = null, u.current && (u.current.innerHTML = e), L.current = e, F(!e), h?.(e);
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
- 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,
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: ie[e],
152
- disabled: _,
153
- onClick: () => E(e, i),
154
- children: l
152
+ active: se[e],
153
+ disabled: x,
154
+ onClick: () => T(e, o),
155
+ children: n
155
156
  }
156
- );
157
- 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(
158
263
  "div",
159
264
  {
160
265
  className: [
161
266
  "inconel-field",
162
- ne ? "inconel-field--full-width" : "",
163
- le ?? ""
267
+ le ? "inconel-field--full-width" : "",
268
+ ae ?? ""
164
269
  ].join(" "),
165
270
  children: [
166
- o && /* @__PURE__ */ c("label", { className: "inconel-field__label", htmlFor: T, children: [
167
- o,
168
- U && /* @__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: " *" })
169
274
  ] }),
170
- /* @__PURE__ */ c(
275
+ /* @__PURE__ */ s(
171
276
  "div",
172
277
  {
173
278
  className: [
174
279
  "inconel-rte",
175
- w ? "inconel-is-invalid" : "",
176
- y ? "inconel-is-disabled" : ""
280
+ v ? "inconel-is-invalid" : "",
281
+ p ? "inconel-is-disabled" : ""
177
282
  ].join(" "),
178
283
  children: [
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),
184
- /* @__PURE__ */ n("span", { className: "inconel-rte__sep" }),
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__ */ n(
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: C.rows,
298
- onChange: (e) => V({ ...C, rows: Number(e.target.value) })
298
+ value: k.rows,
299
+ onChange: (e) => V({ ...k, rows: Number(e.target.value) })
299
300
  }
300
301
  )
301
302
  ] }),
302
- /* @__PURE__ */ c("label", { className: "inconel-rte__field", children: [
303
+ /* @__PURE__ */ s("label", { className: "inconel-rte__field", children: [
303
304
  "Sütun",
304
- /* @__PURE__ */ n(
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: C.cols,
312
- onChange: (e) => V({ ...C, cols: Number(e.target.value) })
312
+ value: k.cols,
313
+ onChange: (e) => V({ ...k, cols: Number(e.target.value) })
313
314
  }
314
315
  )
315
316
  ] }),
316
- /* @__PURE__ */ n("button", { type: "button", className: "inconel-rte__action", onClick: z, children: "Tablo ekle" })
317
+ /* @__PURE__ */ l("button", { type: "button", className: "inconel-rte__action", onClick: z, children: "Tablo ekle" })
317
318
  ] }),
318
- ce && !f && !y && /* @__PURE__ */ n("div", { className: "inconel-rte__panel", role: "toolbar", "aria-label": "Tablo", children: [
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__ */ n(
325
+ ].map(([e, t]) => /* @__PURE__ */ l(
325
326
  "button",
326
327
  {
327
328
  type: "button",
328
329
  className: "inconel-rte__action",
329
- onMouseDown: (l) => l.preventDefault(),
330
- onClick: () => ue(e),
330
+ onMouseDown: (n) => n.preventDefault(),
331
+ onClick: () => fe(e),
331
332
  children: t
332
333
  },
333
334
  e
334
335
  )) }),
335
- s && s !== "table" && !f && /* @__PURE__ */ c("div", { className: "inconel-rte__panel", children: [
336
- /* @__PURE__ */ n(
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": s === "link" ? "Bağlantı adresi" : "Görsel adresi",
342
- placeholder: s === "link" ? "https://…" : "Görsel URL (https://…)",
343
- value: J,
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__ */ n("button", { type: "button", className: "inconel-rte__action", onClick: z, children: "Ekle" }),
352
- s === "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: [
353
354
  "Dosya seç",
354
- /* @__PURE__ */ n(
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: fe
362
+ onChange: be
362
363
  }
363
364
  )
364
365
  ] })
365
366
  ] }),
366
- f ? /* @__PURE__ */ n(
367
+ f ? /* @__PURE__ */ l(
367
368
  "textarea",
368
369
  {
369
- id: T,
370
+ id: N,
370
371
  className: "inconel-rte__source",
371
372
  style: { minHeight: A },
372
- "aria-label": o ?? "HTML kaynağı",
373
+ "aria-label": i ?? "HTML kaynağı",
373
374
  value: K,
374
- disabled: y,
375
+ disabled: p,
375
376
  spellCheck: !1,
376
- onChange: (e) => Y(e.target.value)
377
+ onChange: (e) => J(e.target.value)
377
378
  }
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 }),
380
- /* @__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(
381
382
  "div",
382
383
  {
383
- ref: u,
384
- id: T,
384
+ ref: d,
385
+ id: N,
385
386
  className: "inconel-rte__content",
386
387
  role: "textbox",
387
388
  "aria-multiline": "true",
388
- "aria-label": o,
389
+ "aria-label": i,
389
390
  "aria-required": U,
390
- "aria-invalid": !!w,
391
- "aria-describedby": he,
392
- "aria-disabled": y,
393
- contentEditable: !y,
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: be,
398
+ onPaste: pe,
398
399
  onKeyUp: () => {
399
- b(), D();
400
+ y(), D();
400
401
  },
401
402
  onMouseUp: () => {
402
- b(), D();
403
+ y(), D();
403
404
  },
404
405
  onBlur: () => {
405
- b(), S?.();
406
+ y(), S?.();
406
407
  }
407
408
  }
408
409
  )
@@ -410,12 +411,12 @@ function Re({
410
411
  ]
411
412
  }
412
413
  ),
413
- /* @__PURE__ */ n(Ce, { hint: $, errorMessage: w, hintId: q, errorId: W })
414
+ /* @__PURE__ */ l(Te, { hint: $, errorMessage: v, hintId: q, errorId: W })
414
415
  ]
415
416
  }
416
417
  );
417
418
  }
418
419
  export {
419
- Re as default
420
+ Ie as default
420
421
  };
421
422
  //# sourceMappingURL=RichTextEditor.js.map