inconel 0.1.41 → 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 +1 -1
- package/dist/cjs/components/RichTextEditor/icons.cjs.map +1 -1
- 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 +241 -157
- package/dist/components/RichTextEditor/RichTextEditor.js.map +1 -1
- package/dist/components/RichTextEditor/icons.d.ts +1 -0
- package/dist/components/RichTextEditor/icons.d.ts.map +1 -1
- package/dist/components/RichTextEditor/icons.js +6 -0
- package/dist/components/RichTextEditor/icons.js.map +1 -1
- 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 +1 -1
|
@@ -1,73 +1,77 @@
|
|
|
1
1
|
import { jsxs as c, jsx as n } from "react/jsx-runtime";
|
|
2
|
-
import { useId as
|
|
3
|
-
import
|
|
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 { icons as
|
|
7
|
-
import { sanitizeHtml as
|
|
8
|
-
const
|
|
6
|
+
import { icons as a } from "./icons.js";
|
|
7
|
+
import { sanitizeHtml as v } from "./sanitize.js";
|
|
8
|
+
const ke = [
|
|
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
|
+
], 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);
|
|
17
17
|
});
|
|
18
|
-
function N({ label:
|
|
18
|
+
function N({ label: m, onClick: h, disabled: S, active: o, children: j }) {
|
|
19
19
|
return /* @__PURE__ */ n(
|
|
20
20
|
"button",
|
|
21
21
|
{
|
|
22
22
|
type: "button",
|
|
23
|
-
className: `inconel-rte__btn${
|
|
24
|
-
"aria-label":
|
|
25
|
-
title:
|
|
26
|
-
"aria-pressed":
|
|
27
|
-
disabled:
|
|
28
|
-
onMouseDown: (
|
|
29
|
-
onClick:
|
|
30
|
-
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
|
|
31
31
|
}
|
|
32
32
|
);
|
|
33
33
|
}
|
|
34
|
-
function
|
|
35
|
-
value:
|
|
36
|
-
onChange:
|
|
37
|
-
onBlur:
|
|
38
|
-
label:
|
|
39
|
-
placeholder:
|
|
40
|
-
id:
|
|
41
|
-
disabled:
|
|
42
|
-
required:
|
|
43
|
-
fullWidth:
|
|
44
|
-
className:
|
|
45
|
-
minHeight:
|
|
46
|
-
onImageUpload:
|
|
47
|
-
onRequestMedia:
|
|
48
|
-
hint:
|
|
49
|
-
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
|
|
50
50
|
}) {
|
|
51
|
-
const
|
|
52
|
-
|
|
53
|
-
const e =
|
|
54
|
-
if (!e ||
|
|
55
|
-
const t =
|
|
56
|
-
e.innerHTML !== t && (e.innerHTML = t),
|
|
57
|
-
}, [
|
|
58
|
-
const
|
|
59
|
-
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;
|
|
60
60
|
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) && (
|
|
66
|
-
},
|
|
67
|
-
|
|
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();
|
|
68
68
|
const e = window.getSelection();
|
|
69
|
-
e &&
|
|
70
|
-
},
|
|
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());
|
|
71
75
|
const e = (t) => {
|
|
72
76
|
try {
|
|
73
77
|
return document.queryCommandState(t);
|
|
@@ -75,7 +79,7 @@ function ke({
|
|
|
75
79
|
return !1;
|
|
76
80
|
}
|
|
77
81
|
};
|
|
78
|
-
|
|
82
|
+
oe({
|
|
79
83
|
bold: e("bold"),
|
|
80
84
|
italic: e("italic"),
|
|
81
85
|
underline: e("underline"),
|
|
@@ -87,45 +91,67 @@ function ke({
|
|
|
87
91
|
insertUnorderedList: e("insertUnorderedList"),
|
|
88
92
|
insertOrderedList: e("insertOrderedList")
|
|
89
93
|
});
|
|
90
|
-
},
|
|
91
|
-
|
|
92
|
-
},
|
|
93
|
-
|
|
94
|
-
const
|
|
95
|
-
|
|
96
|
-
}),
|
|
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);
|
|
97
119
|
}, ee = (e) => {
|
|
98
|
-
|
|
99
|
-
},
|
|
100
|
-
|
|
101
|
-
},
|
|
102
|
-
|
|
103
|
-
|
|
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) => {
|
|
104
130
|
/^https?:/i.test(t.getAttribute("href") ?? "") && (t.setAttribute("target", "_blank"), t.setAttribute("rel", "noopener noreferrer"));
|
|
105
|
-
}),
|
|
106
|
-
},
|
|
131
|
+
}), g()) : s === "image" && E("insertImage", e), x(null));
|
|
132
|
+
}, fe = async (e) => {
|
|
107
133
|
const t = e.target.files?.[0];
|
|
108
134
|
if (e.target.value = "", !t || !t.type.startsWith("image/")) return;
|
|
109
|
-
const
|
|
110
|
-
|
|
111
|
-
},
|
|
135
|
+
const l = G ? await G(t) : await Se(t);
|
|
136
|
+
E("insertImage", l), x(null);
|
|
137
|
+
}, be = (e) => {
|
|
112
138
|
const t = e.clipboardData.getData("text/html");
|
|
113
|
-
t && (e.preventDefault(), document.execCommand("insertHTML", !1,
|
|
114
|
-
},
|
|
139
|
+
t && (e.preventDefault(), document.execCommand("insertHTML", !1, v(t)), g());
|
|
140
|
+
}, pe = () => {
|
|
115
141
|
if (f) {
|
|
116
|
-
const e =
|
|
117
|
-
|
|
142
|
+
const e = v(K);
|
|
143
|
+
L.current = null, u.current && (u.current.innerHTML = e), L.current = e, F(!e), h?.(e);
|
|
118
144
|
} else
|
|
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(
|
|
122
148
|
N,
|
|
123
149
|
{
|
|
124
150
|
label: t,
|
|
125
|
-
active:
|
|
126
|
-
disabled:
|
|
127
|
-
onClick: () =>
|
|
128
|
-
children:
|
|
151
|
+
active: ie[e],
|
|
152
|
+
disabled: _,
|
|
153
|
+
onClick: () => E(e, i),
|
|
154
|
+
children: l
|
|
129
155
|
}
|
|
130
156
|
);
|
|
131
157
|
return /* @__PURE__ */ c(
|
|
@@ -133,42 +159,42 @@ function ke({
|
|
|
133
159
|
{
|
|
134
160
|
className: [
|
|
135
161
|
"inconel-field",
|
|
136
|
-
|
|
137
|
-
|
|
162
|
+
ne ? "inconel-field--full-width" : "",
|
|
163
|
+
le ?? ""
|
|
138
164
|
].join(" "),
|
|
139
165
|
children: [
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
166
|
+
o && /* @__PURE__ */ c("label", { className: "inconel-field__label", htmlFor: T, children: [
|
|
167
|
+
o,
|
|
168
|
+
U && /* @__PURE__ */ n("span", { "aria-hidden": "true", children: " *" })
|
|
143
169
|
] }),
|
|
144
170
|
/* @__PURE__ */ c(
|
|
145
171
|
"div",
|
|
146
172
|
{
|
|
147
173
|
className: [
|
|
148
174
|
"inconel-rte",
|
|
149
|
-
|
|
150
|
-
|
|
175
|
+
w ? "inconel-is-invalid" : "",
|
|
176
|
+
y ? "inconel-is-disabled" : ""
|
|
151
177
|
].join(" "),
|
|
152
178
|
children: [
|
|
153
179
|
/* @__PURE__ */ c("div", { className: "inconel-rte__toolbar", role: "toolbar", "aria-label": "Biçimlendirme", children: [
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
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),
|
|
158
184
|
/* @__PURE__ */ n("span", { className: "inconel-rte__sep" }),
|
|
159
185
|
/* @__PURE__ */ c(
|
|
160
186
|
"select",
|
|
161
187
|
{
|
|
162
188
|
className: "inconel-rte__select",
|
|
163
189
|
"aria-label": "Biçim",
|
|
164
|
-
disabled:
|
|
190
|
+
disabled: _,
|
|
165
191
|
value: "",
|
|
166
192
|
onChange: (e) => {
|
|
167
|
-
e.target.value &&
|
|
193
|
+
e.target.value && E("formatBlock", e.target.value);
|
|
168
194
|
},
|
|
169
195
|
children: [
|
|
170
196
|
/* @__PURE__ */ n("option", { value: "", children: "Biçim" }),
|
|
171
|
-
|
|
197
|
+
ke.map((e) => /* @__PURE__ */ n("option", { value: e.tag, children: e.label }, e.tag))
|
|
172
198
|
]
|
|
173
199
|
}
|
|
174
200
|
),
|
|
@@ -177,14 +203,14 @@ function ke({
|
|
|
177
203
|
{
|
|
178
204
|
className: "inconel-rte__select",
|
|
179
205
|
"aria-label": "Yazı boyutu",
|
|
180
|
-
disabled:
|
|
206
|
+
disabled: _,
|
|
181
207
|
value: "",
|
|
182
208
|
onChange: (e) => {
|
|
183
|
-
e.target.value &&
|
|
209
|
+
e.target.value && de(Number(e.target.value));
|
|
184
210
|
},
|
|
185
211
|
children: [
|
|
186
212
|
/* @__PURE__ */ n("option", { value: "", children: "Boyut" }),
|
|
187
|
-
|
|
213
|
+
ve.map((e) => /* @__PURE__ */ c("option", { value: e, children: [
|
|
188
214
|
e,
|
|
189
215
|
"px"
|
|
190
216
|
] }, e))
|
|
@@ -192,80 +218,138 @@ function ke({
|
|
|
192
218
|
}
|
|
193
219
|
),
|
|
194
220
|
/* @__PURE__ */ n("span", { className: "inconel-rte__sep" }),
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
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),
|
|
199
225
|
/* @__PURE__ */ n("span", { className: "inconel-rte__sep" }),
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
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),
|
|
205
231
|
/* @__PURE__ */ n("span", { className: "inconel-rte__sep" }),
|
|
206
232
|
/* @__PURE__ */ n(
|
|
207
233
|
N,
|
|
208
234
|
{
|
|
209
235
|
label: "Bağlantı ekle",
|
|
210
|
-
disabled:
|
|
211
|
-
active:
|
|
212
|
-
onClick: () =>
|
|
213
|
-
children:
|
|
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
|
|
214
250
|
}
|
|
215
251
|
),
|
|
216
252
|
/* @__PURE__ */ n(
|
|
217
253
|
N,
|
|
218
254
|
{
|
|
219
255
|
label: "Görsel ekle",
|
|
220
|
-
disabled:
|
|
221
|
-
active:
|
|
222
|
-
onClick: () =>
|
|
223
|
-
children:
|
|
256
|
+
disabled: _,
|
|
257
|
+
active: s === "image",
|
|
258
|
+
onClick: () => H("image"),
|
|
259
|
+
children: a.image
|
|
224
260
|
}
|
|
225
261
|
),
|
|
226
|
-
|
|
262
|
+
P && /* @__PURE__ */ n(
|
|
227
263
|
N,
|
|
228
264
|
{
|
|
229
265
|
label: "Medya galerisi",
|
|
230
|
-
disabled:
|
|
266
|
+
disabled: _,
|
|
231
267
|
onClick: () => {
|
|
232
|
-
|
|
268
|
+
b(), P(ee);
|
|
233
269
|
},
|
|
234
|
-
children:
|
|
270
|
+
children: a.gallery
|
|
235
271
|
}
|
|
236
272
|
),
|
|
237
273
|
/* @__PURE__ */ n("span", { className: "inconel-rte__sep" }),
|
|
238
|
-
|
|
239
|
-
|
|
274
|
+
r("undo", "Geri al", a.undo),
|
|
275
|
+
r("redo", "Yinele", a.redo),
|
|
240
276
|
/* @__PURE__ */ n(
|
|
241
277
|
N,
|
|
242
278
|
{
|
|
243
279
|
label: "HTML kaynağı",
|
|
244
|
-
disabled:
|
|
280
|
+
disabled: y,
|
|
245
281
|
active: f,
|
|
246
|
-
onClick:
|
|
247
|
-
children:
|
|
282
|
+
onClick: pe,
|
|
283
|
+
children: a.code
|
|
248
284
|
}
|
|
249
285
|
)
|
|
250
286
|
] }),
|
|
251
|
-
|
|
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: [
|
|
252
336
|
/* @__PURE__ */ n(
|
|
253
337
|
"input",
|
|
254
338
|
{
|
|
255
339
|
type: "url",
|
|
256
340
|
className: "inconel-rte__input",
|
|
257
|
-
"aria-label":
|
|
258
|
-
placeholder:
|
|
259
|
-
value:
|
|
341
|
+
"aria-label": s === "link" ? "Bağlantı adresi" : "Görsel adresi",
|
|
342
|
+
placeholder: s === "link" ? "https://…" : "Görsel URL (https://…)",
|
|
343
|
+
value: J,
|
|
260
344
|
autoFocus: !0,
|
|
261
|
-
onChange: (e) =>
|
|
345
|
+
onChange: (e) => Z(e.target.value),
|
|
262
346
|
onKeyDown: (e) => {
|
|
263
|
-
e.key === "Enter" && (e.preventDefault(),
|
|
347
|
+
e.key === "Enter" && (e.preventDefault(), z());
|
|
264
348
|
}
|
|
265
349
|
}
|
|
266
350
|
),
|
|
267
|
-
/* @__PURE__ */ n("button", { type: "button", className: "inconel-rte__action", onClick:
|
|
268
|
-
|
|
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: [
|
|
269
353
|
"Dosya seç",
|
|
270
354
|
/* @__PURE__ */ n(
|
|
271
355
|
"input",
|
|
@@ -274,7 +358,7 @@ function ke({
|
|
|
274
358
|
accept: "image/*",
|
|
275
359
|
hidden: !0,
|
|
276
360
|
"aria-label": "Görsel dosyası",
|
|
277
|
-
onChange:
|
|
361
|
+
onChange: fe
|
|
278
362
|
}
|
|
279
363
|
)
|
|
280
364
|
] })
|
|
@@ -282,43 +366,43 @@ function ke({
|
|
|
282
366
|
f ? /* @__PURE__ */ n(
|
|
283
367
|
"textarea",
|
|
284
368
|
{
|
|
285
|
-
id:
|
|
369
|
+
id: T,
|
|
286
370
|
className: "inconel-rte__source",
|
|
287
|
-
style: { minHeight:
|
|
288
|
-
"aria-label":
|
|
289
|
-
value:
|
|
290
|
-
disabled:
|
|
371
|
+
style: { minHeight: A },
|
|
372
|
+
"aria-label": o ?? "HTML kaynağı",
|
|
373
|
+
value: K,
|
|
374
|
+
disabled: y,
|
|
291
375
|
spellCheck: !1,
|
|
292
|
-
onChange: (e) =>
|
|
376
|
+
onChange: (e) => Y(e.target.value)
|
|
293
377
|
}
|
|
294
|
-
) : /* @__PURE__ */ c("div", { className: "inconel-rte__surface", style: { minHeight:
|
|
295
|
-
|
|
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 }),
|
|
296
380
|
/* @__PURE__ */ n(
|
|
297
381
|
"div",
|
|
298
382
|
{
|
|
299
|
-
ref:
|
|
300
|
-
id:
|
|
383
|
+
ref: u,
|
|
384
|
+
id: T,
|
|
301
385
|
className: "inconel-rte__content",
|
|
302
386
|
role: "textbox",
|
|
303
387
|
"aria-multiline": "true",
|
|
304
|
-
"aria-label":
|
|
305
|
-
"aria-required":
|
|
306
|
-
"aria-invalid": !!
|
|
307
|
-
"aria-describedby":
|
|
308
|
-
"aria-disabled":
|
|
309
|
-
contentEditable: !
|
|
388
|
+
"aria-label": o,
|
|
389
|
+
"aria-required": U,
|
|
390
|
+
"aria-invalid": !!w,
|
|
391
|
+
"aria-describedby": he,
|
|
392
|
+
"aria-disabled": y,
|
|
393
|
+
contentEditable: !y,
|
|
310
394
|
suppressContentEditableWarning: !0,
|
|
311
|
-
style: { minHeight:
|
|
312
|
-
onInput:
|
|
313
|
-
onPaste:
|
|
395
|
+
style: { minHeight: A },
|
|
396
|
+
onInput: g,
|
|
397
|
+
onPaste: be,
|
|
314
398
|
onKeyUp: () => {
|
|
315
|
-
|
|
399
|
+
b(), D();
|
|
316
400
|
},
|
|
317
401
|
onMouseUp: () => {
|
|
318
|
-
|
|
402
|
+
b(), D();
|
|
319
403
|
},
|
|
320
404
|
onBlur: () => {
|
|
321
|
-
|
|
405
|
+
b(), S?.();
|
|
322
406
|
}
|
|
323
407
|
}
|
|
324
408
|
)
|
|
@@ -326,12 +410,12 @@ function ke({
|
|
|
326
410
|
]
|
|
327
411
|
}
|
|
328
412
|
),
|
|
329
|
-
/* @__PURE__ */ n(
|
|
413
|
+
/* @__PURE__ */ n(Ce, { hint: $, errorMessage: w, hintId: q, errorId: W })
|
|
330
414
|
]
|
|
331
415
|
}
|
|
332
416
|
);
|
|
333
417
|
}
|
|
334
418
|
export {
|
|
335
|
-
|
|
419
|
+
Re as default
|
|
336
420
|
};
|
|
337
421
|
//# sourceMappingURL=RichTextEditor.js.map
|