erl-mathtextx-editor 0.2.0 → 0.2.2

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,48 +1,48 @@
1
1
  import { jsx as t, jsxs as l } from "react/jsx-runtime";
2
- import z, { useId as H, useRef as A, useCallback as b, useState as d, useEffect as V } from "react";
3
- import { u as B } from "./index-D0Rzm7Tg.js";
4
- const M = z.memo(({
5
- isOpen: s,
2
+ import V, { useId as B, useRef as M, useCallback as b, useState as d, useEffect as A } from "react";
3
+ import { u as $ } from "./index-BHhpSW1p.js";
4
+ import { u as I } from "./useDraggable-DEoLIB5k.js";
5
+ const P = V.memo(({
6
+ isOpen: o,
6
7
  initialData: i = {},
7
8
  onSave: f,
8
- onClose: o
9
+ onClose: a
9
10
  }) => {
10
- const N = H(), C = A(null), p = b((e) => e ? e.endsWith("%") ? { value: e.replace("%", ""), unit: "%" } : e.endsWith("px") ? { value: e.replace("px", ""), unit: "px" } : { value: e.replace(/[^\d.]/g, ""), unit: "px" } : { value: "", unit: "%" }, []), k = p(i.width), [m, v] = d(k.value), [g, x] = d(k.unit), [h, u] = d(i.backgroundColor || ""), [n, r] = d(i.horizontalAlign || "left"), [a, c] = d(i.verticalAlign || "top");
11
- V(() => {
12
- if (s) {
11
+ const N = B(), k = M(null), p = b((e) => e ? e.endsWith("%") ? { value: e.replace("%", ""), unit: "%" } : e.endsWith("px") ? { value: e.replace("px", ""), unit: "px" } : { value: e.replace(/[^\d.]/g, ""), unit: "px" } : { value: "", unit: "%" }, []), C = p(i.width), [m, v] = d(C.value), [g, x] = d(C.unit), [h, u] = d(i.backgroundColor || ""), [n, r] = d(i.horizontalAlign || "left"), [c, s] = d(i.verticalAlign || "top"), { position: w, handleMouseDown: y } = I(o);
12
+ A(() => {
13
+ if (o) {
13
14
  const e = p(i.width);
14
- v(e.value), x(e.unit), u(i.backgroundColor || ""), r(i.horizontalAlign || "left"), c(i.verticalAlign || "top");
15
+ v(e.value), x(e.unit), u(i.backgroundColor || ""), r(i.horizontalAlign || "left"), s(i.verticalAlign || "top");
15
16
  }
16
- }, [p, i, s]), B({ isOpen: s, dialogRef: C, onClose: o });
17
- const w = b((e) => {
17
+ }, [p, i, o]), $({ isOpen: o, dialogRef: k, onClose: a });
18
+ const z = b((e) => {
18
19
  e.preventDefault(), f({
19
20
  width: m ? `${m}${g}` : void 0,
20
21
  backgroundColor: h || void 0,
21
22
  horizontalAlign: n,
22
- verticalAlign: a
23
- }), o();
24
- }, [m, g, h, n, a, f, o]), y = b(() => {
25
- v(""), x("%"), u(""), r("left"), c("top");
23
+ verticalAlign: c
24
+ }), a();
25
+ }, [m, g, h, n, c, f, a]), H = b(() => {
26
+ v(""), x("%"), u(""), r("left"), s("top");
26
27
  }, []);
27
- return s ? /* @__PURE__ */ t("div", { className: "mtx-modal-overlay", onClick: o, children: /* @__PURE__ */ l(
28
+ return o ? /* @__PURE__ */ t("div", { className: "mtx-modal-overlay", onClick: a, children: /* @__PURE__ */ t("div", { style: { transform: `translate(${w.x}px, ${w.y}px)` }, onClick: (e) => e.stopPropagation(), children: /* @__PURE__ */ l(
28
29
  "div",
29
30
  {
30
- ref: C,
31
+ ref: k,
31
32
  className: "mtx-modal-dialog mtx-cell-properties-dialog",
32
- onClick: (e) => e.stopPropagation(),
33
33
  role: "dialog",
34
34
  "aria-modal": "true",
35
35
  "aria-labelledby": N,
36
36
  tabIndex: -1,
37
37
  children: [
38
- /* @__PURE__ */ l("div", { className: "mtx-modal-header", children: [
39
- /* @__PURE__ */ t("h3", { className: "mtx-modal-title", id: N, children: "Cell Properties" }),
40
- /* @__PURE__ */ t("button", { className: "mtx-modal-close", onClick: o, title: "Close", "aria-label": "Close dialog", children: /* @__PURE__ */ t("svg", { width: "16", height: "16", viewBox: "0 0 16 16", fill: "currentColor", children: /* @__PURE__ */ t("path", { d: "M4 4l8 8m0-8l-8 8", stroke: "currentColor", strokeWidth: "1.5", strokeLinecap: "round" }) }) })
38
+ /* @__PURE__ */ l("div", { className: "mtx-modal-header", onMouseDown: y, style: { cursor: "move" }, children: [
39
+ /* @__PURE__ */ t("h3", { className: "mtx-modal-title", id: N, children: "Properti Sel" }),
40
+ /* @__PURE__ */ t("button", { className: "mtx-modal-close", onClick: a, title: "Tutup", "aria-label": "Close dialog", children: /* @__PURE__ */ t("svg", { width: "16", height: "16", viewBox: "0 0 16 16", fill: "currentColor", children: /* @__PURE__ */ t("path", { d: "M4 4l8 8m0-8l-8 8", stroke: "currentColor", strokeWidth: "1.5", strokeLinecap: "round" }) }) })
41
41
  ] }),
42
- /* @__PURE__ */ l("form", { onSubmit: w, children: [
42
+ /* @__PURE__ */ l("form", { onSubmit: z, children: [
43
43
  /* @__PURE__ */ l("div", { className: "mtx-modal-body", children: [
44
44
  /* @__PURE__ */ l("div", { className: "mtx-form-group", children: [
45
- /* @__PURE__ */ t("label", { className: "mtx-form-label", htmlFor: "cell-width", children: "Width" }),
45
+ /* @__PURE__ */ t("label", { className: "mtx-form-label", htmlFor: "cell-width", children: "Lebar" }),
46
46
  /* @__PURE__ */ l("div", { className: "mtx-width-input-wrapper", children: [
47
47
  /* @__PURE__ */ t(
48
48
  "input",
@@ -52,7 +52,7 @@ const M = z.memo(({
52
52
  className: "mtx-form-input mtx-width-input",
53
53
  value: m,
54
54
  onChange: (e) => v(e.target.value.replace(/[^\d.]/g, "")),
55
- placeholder: "Auto"
55
+ placeholder: "Otomatis"
56
56
  }
57
57
  ),
58
58
  /* @__PURE__ */ l("select", { className: "mtx-form-select mtx-width-unit", value: g, onChange: (e) => x(e.target.value), children: [
@@ -62,40 +62,40 @@ const M = z.memo(({
62
62
  ] })
63
63
  ] }),
64
64
  /* @__PURE__ */ l("div", { className: "mtx-form-group", children: [
65
- /* @__PURE__ */ t("label", { className: "mtx-form-label", htmlFor: "cell-bg-color", children: "Background Color" }),
65
+ /* @__PURE__ */ t("label", { className: "mtx-form-label", htmlFor: "cell-bg-color", children: "Warna Latar Belakang" }),
66
66
  /* @__PURE__ */ l("div", { className: "mtx-color-input-wrapper", children: [
67
67
  /* @__PURE__ */ t("input", { id: "cell-bg-color", type: "color", className: "mtx-color-picker-input", value: h || "#ffffff", onChange: (e) => u(e.target.value) }),
68
- /* @__PURE__ */ t("input", { type: "text", className: "mtx-form-input mtx-color-text-input", value: h, onChange: (e) => u(e.target.value), placeholder: "Kosongkan untuk default" })
68
+ /* @__PURE__ */ t("input", { type: "text", className: "mtx-form-input mtx-color-text-input", value: h, onChange: (e) => u(e.target.value), placeholder: "Kosongkan untuk bawaan" })
69
69
  ] })
70
70
  ] }),
71
71
  /* @__PURE__ */ l("div", { className: "mtx-form-group", children: [
72
- /* @__PURE__ */ t("label", { className: "mtx-form-label", children: "Horizontal Align" }),
72
+ /* @__PURE__ */ t("label", { className: "mtx-form-label", children: "Perataan Horizontal" }),
73
73
  /* @__PURE__ */ l("div", { className: "mtx-align-buttons", children: [
74
- /* @__PURE__ */ t("button", { type: "button", className: `mtx-align-btn ${n === "left" ? "is-active" : ""}`, onClick: () => r("left"), title: "Left", children: /* @__PURE__ */ t("svg", { width: "16", height: "16", viewBox: "0 0 16 16", fill: "currentColor", children: /* @__PURE__ */ t("path", { d: "M2 3h12v1.5H2V3zm0 4h8v1.5H2V7zm0 4h12v1.5H2v-1.5zM2 11h6v1.5H2V11z" }) }) }),
75
- /* @__PURE__ */ t("button", { type: "button", className: `mtx-align-btn ${n === "center" ? "is-active" : ""}`, onClick: () => r("center"), title: "Center", children: /* @__PURE__ */ t("svg", { width: "16", height: "16", viewBox: "0 0 16 16", fill: "currentColor", children: /* @__PURE__ */ t("path", { d: "M2 3h12v1.5H2V3zm3 4h6v1.5H5V7zm-3 4h12v1.5H2v-1.5zM5 11h6v1.5H5V11z" }) }) }),
76
- /* @__PURE__ */ t("button", { type: "button", className: `mtx-align-btn ${n === "right" ? "is-active" : ""}`, onClick: () => r("right"), title: "Right", children: /* @__PURE__ */ t("svg", { width: "16", height: "16", viewBox: "0 0 16 16", fill: "currentColor", children: /* @__PURE__ */ t("path", { d: "M2 3h12v1.5H2V3zm6 4h6v1.5H8V7zM2 11h12v1.5H2v-1.5zm6-4h6v1.5H8V7z" }) }) })
74
+ /* @__PURE__ */ t("button", { type: "button", className: `mtx-align-btn ${n === "left" ? "is-active" : ""}`, onClick: () => r("left"), title: "Kiri", children: /* @__PURE__ */ t("svg", { width: "16", height: "16", viewBox: "0 0 16 16", fill: "currentColor", children: /* @__PURE__ */ t("path", { d: "M2 3h12v1.5H2V3zm0 4h8v1.5H2V7zm0 4h12v1.5H2v-1.5zM2 11h6v1.5H2V11z" }) }) }),
75
+ /* @__PURE__ */ t("button", { type: "button", className: `mtx-align-btn ${n === "center" ? "is-active" : ""}`, onClick: () => r("center"), title: "Tengah", children: /* @__PURE__ */ t("svg", { width: "16", height: "16", viewBox: "0 0 16 16", fill: "currentColor", children: /* @__PURE__ */ t("path", { d: "M2 3h12v1.5H2V3zm3 4h6v1.5H5V7zm-3 4h12v1.5H2v-1.5zM5 11h6v1.5H5V11z" }) }) }),
76
+ /* @__PURE__ */ t("button", { type: "button", className: `mtx-align-btn ${n === "right" ? "is-active" : ""}`, onClick: () => r("right"), title: "Kanan", children: /* @__PURE__ */ t("svg", { width: "16", height: "16", viewBox: "0 0 16 16", fill: "currentColor", children: /* @__PURE__ */ t("path", { d: "M2 3h12v1.5H2V3zm6 4h6v1.5H8V7zM2 11h12v1.5H2v-1.5zm6-4h6v1.5H8V7z" }) }) })
77
77
  ] })
78
78
  ] }),
79
79
  /* @__PURE__ */ l("div", { className: "mtx-form-group", children: [
80
- /* @__PURE__ */ t("label", { className: "mtx-form-label", children: "Vertical Align" }),
80
+ /* @__PURE__ */ t("label", { className: "mtx-form-label", children: "Perataan Vertikal" }),
81
81
  /* @__PURE__ */ l("div", { className: "mtx-align-buttons", children: [
82
- /* @__PURE__ */ t("button", { type: "button", className: `mtx-align-btn ${a === "top" ? "is-active" : ""}`, onClick: () => c("top"), title: "Top", children: /* @__PURE__ */ t("svg", { width: "16", height: "16", viewBox: "0 0 16 16", fill: "currentColor", children: /* @__PURE__ */ t("path", { d: "M8 2l4 4h-3v8H7V6H4L8 2z", transform: "rotate(180 8 8)" }) }) }),
83
- /* @__PURE__ */ t("button", { type: "button", className: `mtx-align-btn ${a === "middle" ? "is-active" : ""}`, onClick: () => c("middle"), title: "Middle", children: /* @__PURE__ */ t("svg", { width: "16", height: "16", viewBox: "0 0 16 16", fill: "currentColor", children: /* @__PURE__ */ t("rect", { x: "4", y: "6", width: "8", height: "4" }) }) }),
84
- /* @__PURE__ */ t("button", { type: "button", className: `mtx-align-btn ${a === "bottom" ? "is-active" : ""}`, onClick: () => c("bottom"), title: "Bottom", children: /* @__PURE__ */ t("svg", { width: "16", height: "16", viewBox: "0 0 16 16", fill: "currentColor", children: /* @__PURE__ */ t("path", { d: "M8 2l4 4h-3v8H7V6H4L8 2z" }) }) })
82
+ /* @__PURE__ */ t("button", { type: "button", className: `mtx-align-btn ${c === "top" ? "is-active" : ""}`, onClick: () => s("top"), title: "Atas", children: /* @__PURE__ */ t("svg", { width: "16", height: "16", viewBox: "0 0 16 16", fill: "currentColor", children: /* @__PURE__ */ t("path", { d: "M8 2l4 4h-3v8H7V6H4L8 2z", transform: "rotate(180 8 8)" }) }) }),
83
+ /* @__PURE__ */ t("button", { type: "button", className: `mtx-align-btn ${c === "middle" ? "is-active" : ""}`, onClick: () => s("middle"), title: "Tengah (Vertikal)", children: /* @__PURE__ */ t("svg", { width: "16", height: "16", viewBox: "0 0 16 16", fill: "currentColor", children: /* @__PURE__ */ t("rect", { x: "4", y: "6", width: "8", height: "4" }) }) }),
84
+ /* @__PURE__ */ t("button", { type: "button", className: `mtx-align-btn ${c === "bottom" ? "is-active" : ""}`, onClick: () => s("bottom"), title: "Bawah", children: /* @__PURE__ */ t("svg", { width: "16", height: "16", viewBox: "0 0 16 16", fill: "currentColor", children: /* @__PURE__ */ t("path", { d: "M8 2l4 4h-3v8H7V6H4L8 2z" }) }) })
85
85
  ] })
86
86
  ] })
87
87
  ] }),
88
88
  /* @__PURE__ */ l("div", { className: "mtx-modal-footer", children: [
89
- /* @__PURE__ */ t("button", { type: "button", className: "mtx-btn mtx-btn-secondary", onClick: y, children: "Reset" }),
90
- /* @__PURE__ */ t("button", { type: "button", className: "mtx-btn mtx-btn-secondary", onClick: o, children: "Cancel" }),
91
- /* @__PURE__ */ t("button", { type: "submit", className: "mtx-btn mtx-btn-primary", children: "Apply" })
89
+ /* @__PURE__ */ t("button", { type: "button", className: "mtx-btn mtx-btn-secondary", onClick: H, children: "Reset" }),
90
+ /* @__PURE__ */ t("button", { type: "button", className: "mtx-btn mtx-btn-secondary", onClick: a, children: "Batal" }),
91
+ /* @__PURE__ */ t("button", { type: "submit", className: "mtx-btn mtx-btn-primary", children: "Terapkan" })
92
92
  ] })
93
93
  ] })
94
94
  ]
95
95
  }
96
- ) }) : null;
96
+ ) }) }) : null;
97
97
  });
98
- M.displayName = "CellPropertiesDialogImpl";
98
+ P.displayName = "CellPropertiesDialogImpl";
99
99
  export {
100
- M as CellPropertiesDialogImpl
100
+ P as CellPropertiesDialogImpl
101
101
  };
@@ -1,6 +1,6 @@
1
1
  import { jsxs as i, Fragment as J, jsx as e } from "react/jsx-runtime";
2
2
  import { useId as V, useRef as y, useState as d, useCallback as s } from "react";
3
- import { u as q } from "./index-D0Rzm7Tg.js";
3
+ import { u as q } from "./index-BHhpSW1p.js";
4
4
  function Z({
5
5
  isOpen: U,
6
6
  onClose: w,
@@ -1,34 +1,34 @@
1
1
  import { jsx as e, jsxs as t } from "react/jsx-runtime";
2
- import N, { useId as v, useRef as f, useState as c, useEffect as g, useCallback as w } from "react";
3
- import { u as y } from "./index-D0Rzm7Tg.js";
4
- const k = N.memo(({ isOpen: i, onInsert: d, onClose: m }) => {
5
- const b = v(), u = f(null), [l, n] = c(3), [a, s] = c(3), [o, h] = c(!0);
6
- g(() => {
2
+ import v, { useId as g, useRef as y, useState as c, useEffect as k, useCallback as w } from "react";
3
+ import { u as C } from "./index-BHhpSW1p.js";
4
+ import { u as M } from "./useDraggable-DEoLIB5k.js";
5
+ const I = v.memo(({ isOpen: i, onInsert: d, onClose: m }) => {
6
+ const u = g(), b = y(null), [l, n] = c(3), [a, s] = c(3), [o, h] = c(!0), { position: p, handleMouseDown: N } = M(i);
7
+ k(() => {
7
8
  i && (n(3), s(3), h(!0));
8
- }, [i]), y({ isOpen: i, dialogRef: u, onClose: m });
9
- const x = w((r) => {
9
+ }, [i]), C({ isOpen: i, dialogRef: b, onClose: m });
10
+ const f = w((r) => {
10
11
  r.preventDefault(), d(l, a, o), m();
11
12
  }, [l, a, o, d, m]);
12
- return i ? /* @__PURE__ */ e("div", { className: "mtx-modal-overlay", onClick: m, children: /* @__PURE__ */ t(
13
+ return i ? /* @__PURE__ */ e("div", { className: "mtx-modal-overlay", onClick: m, children: /* @__PURE__ */ e("div", { style: { transform: `translate(${p.x}px, ${p.y}px)` }, onClick: (r) => r.stopPropagation(), children: /* @__PURE__ */ t(
13
14
  "div",
14
15
  {
15
- ref: u,
16
+ ref: b,
16
17
  className: "mtx-modal-dialog mtx-insert-table-dialog",
17
- onClick: (r) => r.stopPropagation(),
18
18
  role: "dialog",
19
19
  "aria-modal": "true",
20
- "aria-labelledby": b,
20
+ "aria-labelledby": u,
21
21
  tabIndex: -1,
22
22
  children: [
23
- /* @__PURE__ */ t("div", { className: "mtx-modal-header", children: [
24
- /* @__PURE__ */ e("h3", { className: "mtx-modal-title", id: b, children: "Insert Table" }),
25
- /* @__PURE__ */ e("button", { className: "mtx-modal-close", onClick: m, title: "Close", "aria-label": "Close dialog", children: /* @__PURE__ */ e("svg", { width: "16", height: "16", viewBox: "0 0 16 16", fill: "currentColor", children: /* @__PURE__ */ e("path", { d: "M4 4l8 8m0-8l-8 8", stroke: "currentColor", strokeWidth: "1.5", strokeLinecap: "round" }) }) })
23
+ /* @__PURE__ */ t("div", { className: "mtx-modal-header", onMouseDown: N, style: { cursor: "move" }, children: [
24
+ /* @__PURE__ */ e("h3", { className: "mtx-modal-title", id: u, children: "Sisipkan Tabel" }),
25
+ /* @__PURE__ */ e("button", { className: "mtx-modal-close", onClick: m, title: "Tutup", "aria-label": "Close dialog", children: /* @__PURE__ */ e("svg", { width: "16", height: "16", viewBox: "0 0 16 16", fill: "currentColor", children: /* @__PURE__ */ e("path", { d: "M4 4l8 8m0-8l-8 8", stroke: "currentColor", strokeWidth: "1.5", strokeLinecap: "round" }) }) })
26
26
  ] }),
27
- /* @__PURE__ */ t("form", { onSubmit: x, children: [
27
+ /* @__PURE__ */ t("form", { onSubmit: f, children: [
28
28
  /* @__PURE__ */ t("div", { className: "mtx-modal-body", children: [
29
29
  /* @__PURE__ */ t("div", { className: "mtx-form-group", children: [
30
30
  /* @__PURE__ */ t("label", { className: "mtx-form-label", htmlFor: "table-rows", children: [
31
- "Rows",
31
+ "Baris",
32
32
  /* @__PURE__ */ e("span", { className: "mtx-form-hint", children: "(1-10)" })
33
33
  ] }),
34
34
  /* @__PURE__ */ t("div", { className: "mtx-number-input-wrapper", children: [
@@ -51,7 +51,7 @@ const k = N.memo(({ isOpen: i, onInsert: d, onClose: m }) => {
51
51
  ] }),
52
52
  /* @__PURE__ */ t("div", { className: "mtx-form-group", children: [
53
53
  /* @__PURE__ */ t("label", { className: "mtx-form-label", htmlFor: "table-cols", children: [
54
- "Columns",
54
+ "Kolom",
55
55
  /* @__PURE__ */ e("span", { className: "mtx-form-hint", children: "(1-10)" })
56
56
  ] }),
57
57
  /* @__PURE__ */ t("div", { className: "mtx-number-input-wrapper", children: [
@@ -73,28 +73,28 @@ const k = N.memo(({ isOpen: i, onInsert: d, onClose: m }) => {
73
73
  ] }),
74
74
  /* @__PURE__ */ e("div", { className: "mtx-form-group mtx-form-checkbox", children: /* @__PURE__ */ t("label", { className: "mtx-checkbox-label", children: [
75
75
  /* @__PURE__ */ e("input", { type: "checkbox", checked: o, onChange: (r) => h(r.target.checked) }),
76
- /* @__PURE__ */ e("span", { children: "Include header row" })
76
+ /* @__PURE__ */ e("span", { children: "Sertakan baris header" })
77
77
  ] }) }),
78
78
  /* @__PURE__ */ t("div", { className: "mtx-table-preview", children: [
79
79
  /* @__PURE__ */ t("div", { className: "mtx-table-preview-label", children: [
80
- "Preview: ",
80
+ "Pratinjau: ",
81
81
  l,
82
82
  "x",
83
83
  a
84
84
  ] }),
85
- /* @__PURE__ */ e("div", { className: "mtx-table-preview-grid", style: { display: "grid", gridTemplateColumns: `repeat(${a}, 1fr)`, gridTemplateRows: `repeat(${l}, 1fr)` }, children: Array.from({ length: l * a }).map((r, p) => /* @__PURE__ */ e("div", { className: `mtx-preview-cell${o && p < a ? " mtx-preview-header" : ""}` }, p)) })
85
+ /* @__PURE__ */ e("div", { className: "mtx-table-preview-grid", style: { display: "grid", gridTemplateColumns: `repeat(${a}, 1fr)`, gridTemplateRows: `repeat(${l}, 1fr)` }, children: Array.from({ length: l * a }).map((r, x) => /* @__PURE__ */ e("div", { className: `mtx-preview-cell${o && x < a ? " mtx-preview-header" : ""}` }, x)) })
86
86
  ] })
87
87
  ] }),
88
88
  /* @__PURE__ */ t("div", { className: "mtx-modal-footer", children: [
89
- /* @__PURE__ */ e("button", { type: "button", className: "mtx-btn mtx-btn-secondary", onClick: m, children: "Cancel" }),
90
- /* @__PURE__ */ e("button", { type: "submit", className: "mtx-btn mtx-btn-primary", children: "Insert Table" })
89
+ /* @__PURE__ */ e("button", { type: "button", className: "mtx-btn mtx-btn-secondary", onClick: m, children: "Batal" }),
90
+ /* @__PURE__ */ e("button", { type: "submit", className: "mtx-btn mtx-btn-primary", children: "Sisipkan Tabel" })
91
91
  ] })
92
92
  ] })
93
93
  ]
94
94
  }
95
- ) }) : null;
95
+ ) }) }) : null;
96
96
  });
97
- k.displayName = "InsertTableDialogImpl";
97
+ I.displayName = "InsertTableDialogImpl";
98
98
  export {
99
- k as InsertTableDialogImpl
99
+ I as InsertTableDialogImpl
100
100
  };
@@ -1,21 +1,21 @@
1
- import { jsx as e, jsxs as a } from "react/jsx-runtime";
2
- import D, { useId as _, useRef as j, useState as n, useEffect as F, useCallback as d } from "react";
3
- import { u as E } from "./index-D0Rzm7Tg.js";
4
- const S = D.memo(({
1
+ import { jsx as a, jsxs as e } from "react/jsx-runtime";
2
+ import S, { useId as T, useRef as _, useState as r, useEffect as w, useCallback as c } from "react";
3
+ import { u as F } from "./index-BHhpSW1p.js";
4
+ const I = S.memo(({
5
5
  isOpen: s,
6
6
  currentUrl: o = "",
7
7
  currentText: m = "",
8
- currentTitle: h = "",
9
- currentTarget: u = "_blank",
8
+ currentTitle: u = "",
9
+ currentTarget: h = "_blank",
10
10
  onInsert: g,
11
11
  onRemove: p,
12
- onClose: r
12
+ onClose: n
13
13
  }) => {
14
- const N = _(), v = j(null), [x, y] = n(o), [k, C] = n(m), [f, L] = n(h), [b, R] = n(u), [c, i] = n("");
15
- F(() => {
16
- s && (y(o), C(m), L(h), R(u || "_blank"), i(""));
17
- }, [s, o, m, h, u]), E({ isOpen: s, dialogRef: v, onClose: r });
18
- const U = d((t) => {
14
+ const N = T(), v = _(null), [k, y] = r(o), [x, C] = r(m), [f, L] = r(u), [b, R] = r(h), [d, i] = r("");
15
+ w(() => {
16
+ s && (y(o), C(m), L(u), R(h || "_blank"), i(""));
17
+ }, [s, o, m, u, h]), F({ isOpen: s, dialogRef: v, onClose: n });
18
+ const U = c((t) => {
19
19
  if (!t.trim())
20
20
  return i("URL tidak boleh kosong"), !1;
21
21
  if (t.startsWith("#"))
@@ -30,22 +30,22 @@ const S = D.memo(({
30
30
  return i("URL tidak valid. Pastikan format benar (contoh: https://example.com)"), !1;
31
31
  }
32
32
  return i(""), !0;
33
- }, []), I = d((t) => {
33
+ }, []), W = c((t) => {
34
34
  const l = t.trim();
35
35
  return l.startsWith("http://") || l.startsWith("https://") || l.startsWith("mailto:") || l.startsWith("#") ? l : `https://${l}`;
36
- }, []), W = d((t) => {
36
+ }, []), j = c((t) => {
37
37
  t.preventDefault();
38
- const l = I(x);
38
+ const l = W(k);
39
39
  U(l) && g({
40
40
  url: l,
41
- text: k.trim() || void 0,
41
+ text: x.trim() || void 0,
42
42
  title: f.trim() || void 0,
43
43
  target: b || void 0
44
44
  });
45
- }, [x, k, f, b, U, I, g]), w = d(() => {
46
- p?.(), r();
47
- }, [p, r]);
48
- return s ? /* @__PURE__ */ e("div", { className: "mtx-modal-overlay", onClick: r, children: /* @__PURE__ */ a(
45
+ }, [k, x, f, b, U, W, g]), D = c(() => {
46
+ p?.(), n();
47
+ }, [p, n]);
48
+ return s ? /* @__PURE__ */ a("div", { className: "mtx-modal-overlay", onClick: n, children: /* @__PURE__ */ e(
49
49
  "div",
50
50
  {
51
51
  ref: v,
@@ -56,58 +56,58 @@ const S = D.memo(({
56
56
  "aria-labelledby": N,
57
57
  tabIndex: -1,
58
58
  children: [
59
- /* @__PURE__ */ a("div", { className: "mtx-modal-header", children: [
60
- /* @__PURE__ */ e("h3", { className: "mtx-modal-title", id: N, children: o ? "Edit Link" : "Insert Link" }),
61
- /* @__PURE__ */ e("button", { className: "mtx-modal-close", onClick: r, title: "Close", "aria-label": "Close dialog", children: /* @__PURE__ */ e("svg", { width: "16", height: "16", viewBox: "0 0 16 16", fill: "currentColor", children: /* @__PURE__ */ e("path", { d: "M4 4l8 8m0-8l-8 8", stroke: "currentColor", strokeWidth: "1.5", strokeLinecap: "round" }) }) })
59
+ /* @__PURE__ */ e("div", { className: "mtx-modal-header", children: [
60
+ /* @__PURE__ */ a("h3", { className: "mtx-modal-title", id: N, children: o ? "Edit Tautan" : "Sisipkan Tautan" }),
61
+ /* @__PURE__ */ a("button", { className: "mtx-modal-close", onClick: n, title: "Tutup", "aria-label": "Tutup dialog", children: /* @__PURE__ */ a("svg", { width: "16", height: "16", viewBox: "0 0 16 16", fill: "currentColor", children: /* @__PURE__ */ a("path", { d: "M4 4l8 8m0-8l-8 8", stroke: "currentColor", strokeWidth: "1.5", strokeLinecap: "round" }) }) })
62
62
  ] }),
63
- /* @__PURE__ */ a("form", { onSubmit: W, children: [
64
- /* @__PURE__ */ a("div", { className: "mtx-modal-body", children: [
65
- /* @__PURE__ */ a("div", { className: "mtx-form-group", children: [
66
- /* @__PURE__ */ a("label", { className: "mtx-form-label", htmlFor: "link-url", children: [
63
+ /* @__PURE__ */ e("form", { onSubmit: j, children: [
64
+ /* @__PURE__ */ e("div", { className: "mtx-modal-body", children: [
65
+ /* @__PURE__ */ e("div", { className: "mtx-form-group", children: [
66
+ /* @__PURE__ */ e("label", { className: "mtx-form-label", htmlFor: "link-url", children: [
67
67
  "URL ",
68
- /* @__PURE__ */ e("span", { className: "mtx-required", children: "*" })
68
+ /* @__PURE__ */ a("span", { className: "mtx-required", children: "*" })
69
69
  ] }),
70
- /* @__PURE__ */ e(
70
+ /* @__PURE__ */ a(
71
71
  "input",
72
72
  {
73
73
  id: "link-url",
74
74
  type: "text",
75
- className: `mtx-form-input ${c ? "mtx-input-error" : ""}`,
76
- value: x,
75
+ className: `mtx-form-input ${d ? "mtx-input-error" : ""}`,
76
+ value: k,
77
77
  onChange: (t) => {
78
- y(t.target.value), c && i("");
78
+ y(t.target.value), d && i("");
79
79
  },
80
80
  placeholder: "https://example.com",
81
81
  autoFocus: !0,
82
82
  autoComplete: "url"
83
83
  }
84
84
  ),
85
- c && /* @__PURE__ */ e("div", { className: "mtx-form-error", children: c })
85
+ d && /* @__PURE__ */ a("div", { className: "mtx-form-error", children: d })
86
86
  ] }),
87
- /* @__PURE__ */ a("div", { className: "mtx-form-group", children: [
88
- /* @__PURE__ */ a("label", { className: "mtx-form-label", htmlFor: "link-text", children: [
89
- "Display Text",
90
- /* @__PURE__ */ e("span", { className: "mtx-form-hint", children: m ? "(kosongkan untuk tetap menggunakan text saat ini)" : "(opsional, akan menggunakan URL jika kosong)" })
87
+ /* @__PURE__ */ e("div", { className: "mtx-form-group", children: [
88
+ /* @__PURE__ */ e("label", { className: "mtx-form-label", htmlFor: "link-text", children: [
89
+ "Teks yang Ditampilkan",
90
+ /* @__PURE__ */ a("span", { className: "mtx-form-hint", children: m ? "(kosongkan untuk tetap menggunakan teks saat ini)" : "(opsional, URL akan digunakan jika kosong)" })
91
91
  ] }),
92
- /* @__PURE__ */ e(
92
+ /* @__PURE__ */ a(
93
93
  "input",
94
94
  {
95
95
  id: "link-text",
96
96
  type: "text",
97
97
  className: "mtx-form-input",
98
- value: k,
98
+ value: x,
99
99
  onChange: (t) => C(t.target.value),
100
- placeholder: "Click here",
100
+ placeholder: "Klik di sini",
101
101
  autoComplete: "off"
102
102
  }
103
103
  )
104
104
  ] }),
105
- /* @__PURE__ */ a("div", { className: "mtx-form-group", children: [
106
- /* @__PURE__ */ a("label", { className: "mtx-form-label", htmlFor: "link-title", children: [
107
- "Title (Tooltip)",
108
- /* @__PURE__ */ e("span", { className: "mtx-form-hint", children: "Teks yang muncul saat hover" })
105
+ /* @__PURE__ */ e("div", { className: "mtx-form-group", children: [
106
+ /* @__PURE__ */ e("label", { className: "mtx-form-label", htmlFor: "link-title", children: [
107
+ "Judul (Tooltip)",
108
+ /* @__PURE__ */ a("span", { className: "mtx-form-hint", children: "Teks yang muncul saat hover" })
109
109
  ] }),
110
- /* @__PURE__ */ e(
110
+ /* @__PURE__ */ a(
111
111
  "input",
112
112
  {
113
113
  id: "link-title",
@@ -115,13 +115,13 @@ const S = D.memo(({
115
115
  className: "mtx-form-input",
116
116
  value: f,
117
117
  onChange: (t) => L(t.target.value),
118
- placeholder: "Visit our website",
118
+ placeholder: "Kunjungi website kami",
119
119
  autoComplete: "off"
120
120
  }
121
121
  )
122
122
  ] }),
123
- /* @__PURE__ */ e("div", { className: "mtx-form-group mtx-form-checkbox", children: /* @__PURE__ */ a("label", { className: "mtx-checkbox-label", children: [
124
- /* @__PURE__ */ e(
123
+ /* @__PURE__ */ a("div", { className: "mtx-form-group mtx-form-checkbox", children: /* @__PURE__ */ e("label", { className: "mtx-checkbox-label", children: [
124
+ /* @__PURE__ */ a(
125
125
  "input",
126
126
  {
127
127
  type: "checkbox",
@@ -129,15 +129,15 @@ const S = D.memo(({
129
129
  onChange: (t) => R(t.target.checked ? "_blank" : "_self")
130
130
  }
131
131
  ),
132
- /* @__PURE__ */ e("span", { children: "Open in new tab" })
132
+ /* @__PURE__ */ a("span", { children: "Buka di tab baru" })
133
133
  ] }) })
134
134
  ] }),
135
- /* @__PURE__ */ a("div", { className: "mtx-modal-footer", children: [
136
- /* @__PURE__ */ e("button", { type: "button", className: "mtx-btn mtx-btn-secondary", onClick: r, children: "Cancel" }),
137
- o && p && /* @__PURE__ */ e("button", { type: "button", className: "mtx-btn mtx-btn-danger", onClick: w, children: "Remove Link" }),
138
- /* @__PURE__ */ a("button", { type: "submit", className: "mtx-btn mtx-btn-primary", children: [
139
- o ? "Update" : "Insert",
140
- " Link"
135
+ /* @__PURE__ */ e("div", { className: "mtx-modal-footer", children: [
136
+ /* @__PURE__ */ a("button", { type: "button", className: "mtx-btn mtx-btn-secondary", onClick: n, children: "Batal" }),
137
+ o && p && /* @__PURE__ */ a("button", { type: "button", className: "mtx-btn mtx-btn-danger", onClick: D, children: "Hapus Tautan" }),
138
+ /* @__PURE__ */ e("button", { type: "submit", className: "mtx-btn mtx-btn-primary", children: [
139
+ o ? "Perbarui" : "Sisipkan",
140
+ " Tautan"
141
141
  ] })
142
142
  ] })
143
143
  ] })
@@ -145,7 +145,7 @@ const S = D.memo(({
145
145
  }
146
146
  ) }) : null;
147
147
  });
148
- S.displayName = "LinkDialogImpl";
148
+ I.displayName = "LinkDialogImpl";
149
149
  export {
150
- S as LinkDialogImpl
150
+ I as LinkDialogImpl
151
151
  };
@@ -5,4 +5,4 @@ import { MathTextXEditorProps } from './types';
5
5
  * Drop-in replacement for CKEditor in solutest.id.
6
6
  * Supports rich text formatting and visual math input without LaTeX.
7
7
  */
8
- export declare function MathTextXEditor({ content, onChange, onSave, editable, placeholder, toolbarMode, className, minHeight, maxHeight, autoFocus, onImageUpload, onBeforePasteHTML, }: MathTextXEditorProps): import("react/jsx-runtime").JSX.Element;
8
+ export declare function MathTextXEditor({ content, onChange, onSave, editable, placeholder, toolbarMode, toolbar: _toolbar, mathToolbar: _mathToolbar, templates: _templates, outputFormat: _outputFormat, className, minHeight, maxHeight, autoFocus, onImageUpload, onBeforePasteHTML, }: MathTextXEditorProps): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,56 @@
1
+ import { jsx as t, jsxs as l } from "react/jsx-runtime";
2
+ import g, { useId as x, useRef as p, useState as f, useEffect as y, useCallback as h } from "react";
3
+ import { u as N } from "./index-BHhpSW1p.js";
4
+ import { u as k } from "./useDraggable-DEoLIB5k.js";
5
+ const z = g.memo(({
6
+ isOpen: a,
7
+ initialData: o = {},
8
+ onSave: s,
9
+ onClose: e
10
+ }) => {
11
+ const m = x(), c = p(null), [i, r] = f(o.align || "left"), { position: d, handleMouseDown: u } = k(a);
12
+ y(() => {
13
+ a && r(o.align || "left");
14
+ }, [o, a]), N({ isOpen: a, dialogRef: c, onClose: e });
15
+ const b = h((n) => {
16
+ n.preventDefault(), s({ align: i }), e();
17
+ }, [i, s, e]), v = h(() => {
18
+ r("left");
19
+ }, []);
20
+ return a ? /* @__PURE__ */ t("div", { className: "mtx-modal-overlay", onClick: e, children: /* @__PURE__ */ t("div", { style: { transform: `translate(${d.x}px, ${d.y}px)` }, onClick: (n) => n.stopPropagation(), children: /* @__PURE__ */ l(
21
+ "div",
22
+ {
23
+ ref: c,
24
+ className: "mtx-modal-dialog mtx-table-properties-dialog",
25
+ role: "dialog",
26
+ "aria-modal": "true",
27
+ "aria-labelledby": m,
28
+ tabIndex: -1,
29
+ children: [
30
+ /* @__PURE__ */ l("div", { className: "mtx-modal-header", onMouseDown: u, style: { cursor: "move" }, children: [
31
+ /* @__PURE__ */ t("h3", { className: "mtx-modal-title", id: m, children: "Properti Tabel" }),
32
+ /* @__PURE__ */ t("button", { className: "mtx-modal-close", onClick: e, title: "Tutup", "aria-label": "Close dialog", children: /* @__PURE__ */ t("svg", { width: "16", height: "16", viewBox: "0 0 16 16", fill: "currentColor", children: /* @__PURE__ */ t("path", { d: "M4 4l8 8m0-8l-8 8", stroke: "currentColor", strokeWidth: "1.5", strokeLinecap: "round" }) }) })
33
+ ] }),
34
+ /* @__PURE__ */ l("form", { onSubmit: b, children: [
35
+ /* @__PURE__ */ t("div", { className: "mtx-modal-body", children: /* @__PURE__ */ l("div", { className: "mtx-form-group", children: [
36
+ /* @__PURE__ */ t("label", { className: "mtx-form-label", children: "Perataan Tabel" }),
37
+ /* @__PURE__ */ l("div", { className: "mtx-align-buttons", children: [
38
+ /* @__PURE__ */ t("button", { type: "button", className: `mtx-align-btn ${i === "left" ? "is-active" : ""}`, onClick: () => r("left"), title: "Rata Kiri", children: /* @__PURE__ */ t("svg", { width: "16", height: "16", viewBox: "0 0 16 16", fill: "currentColor", children: /* @__PURE__ */ t("path", { d: "M2 3h12v1.5H2V3zm0 4h8v1.5H2V7zm0 4h12v1.5H2v-1.5zM2 11h6v1.5H2V11z" }) }) }),
39
+ /* @__PURE__ */ t("button", { type: "button", className: `mtx-align-btn ${i === "center" ? "is-active" : ""}`, onClick: () => r("center"), title: "Rata Tengah", children: /* @__PURE__ */ t("svg", { width: "16", height: "16", viewBox: "0 0 16 16", fill: "currentColor", children: /* @__PURE__ */ t("path", { d: "M2 3h12v1.5H2V3zm3 4h6v1.5H5V7zm-3 4h12v1.5H2v-1.5zM5 11h6v1.5H5V11z" }) }) }),
40
+ /* @__PURE__ */ t("button", { type: "button", className: `mtx-align-btn ${i === "right" ? "is-active" : ""}`, onClick: () => r("right"), title: "Rata Kanan", children: /* @__PURE__ */ t("svg", { width: "16", height: "16", viewBox: "0 0 16 16", fill: "currentColor", children: /* @__PURE__ */ t("path", { d: "M2 3h12v1.5H2V3zm6 4h6v1.5H8V7zM2 11h12v1.5H2v-1.5zm6-4h6v1.5H8V7z" }) }) })
41
+ ] })
42
+ ] }) }),
43
+ /* @__PURE__ */ l("div", { className: "mtx-modal-footer", children: [
44
+ /* @__PURE__ */ t("button", { type: "button", className: "mtx-btn mtx-btn-secondary", onClick: v, children: "Reset" }),
45
+ /* @__PURE__ */ t("button", { type: "button", className: "mtx-btn mtx-btn-secondary", onClick: e, children: "Batal" }),
46
+ /* @__PURE__ */ t("button", { type: "submit", className: "mtx-btn mtx-btn-primary", children: "Terapkan" })
47
+ ] })
48
+ ] })
49
+ ]
50
+ }
51
+ ) }) }) : null;
52
+ });
53
+ z.displayName = "TablePropertiesDialogImpl";
54
+ export {
55
+ z as TablePropertiesDialogImpl
56
+ };
@@ -0,0 +1,64 @@
1
+ import { jsx as e, jsxs as l } from "react/jsx-runtime";
2
+ import c, { useId as p, useRef as h, useCallback as x } from "react";
3
+ import { u as b } from "./index-BHhpSW1p.js";
4
+ import { u } from "./useDraggable-DEoLIB5k.js";
5
+ const g = [
6
+ { id: "plain", name: "Polos", description: "Tabel sederhana tanpa gaya tambahan", headerStyle: "none", borderStyle: "all", stripeRows: !1 },
7
+ { id: "light", name: "Terang", description: "Kepala tabel abu-abu terang", headerStyle: "light", borderStyle: "all", stripeRows: !1 },
8
+ { id: "dark", name: "Gelap", description: "Kepala tabel gelap dengan teks putih", headerStyle: "dark", borderStyle: "horizontal", stripeRows: !1 },
9
+ { id: "blue", name: "Tema Biru", description: "Kepala tabel biru dengan baris belang", headerStyle: "blue", borderStyle: "horizontal", stripeRows: !0 },
10
+ { id: "striped", name: "Belang", description: "Warna baris selang-seling", headerStyle: "light", borderStyle: "none", stripeRows: !0 },
11
+ { id: "minimal", name: "Minimalis", description: "Hanya border horizontal", headerStyle: "none", borderStyle: "horizontal", stripeRows: !1 }
12
+ ], N = c.memo(({ isOpen: i, onSelect: m, onClose: t }) => {
13
+ const r = p(), s = h(null), n = x((a) => {
14
+ m(a), t();
15
+ }, [m, t]), { position: d, handleMouseDown: o } = u(i);
16
+ return b({ isOpen: i, dialogRef: s, onClose: t }), i ? /* @__PURE__ */ e("div", { className: "mtx-modal-overlay", onClick: t, children: /* @__PURE__ */ e("div", { style: { transform: `translate(${d.x}px, ${d.y}px)` }, onClick: (a) => a.stopPropagation(), children: /* @__PURE__ */ l(
17
+ "div",
18
+ {
19
+ ref: s,
20
+ className: "mtx-modal-dialog mtx-table-templates-dialog",
21
+ role: "dialog",
22
+ "aria-modal": "true",
23
+ "aria-labelledby": r,
24
+ tabIndex: -1,
25
+ children: [
26
+ /* @__PURE__ */ l("div", { className: "mtx-modal-header", onMouseDown: o, style: { cursor: "move" }, children: [
27
+ /* @__PURE__ */ e("h3", { className: "mtx-modal-title", id: r, children: "Template Tabel" }),
28
+ /* @__PURE__ */ e("button", { className: "mtx-modal-close", onClick: t, title: "Tutup", "aria-label": "Close dialog", children: /* @__PURE__ */ e("svg", { width: "16", height: "16", viewBox: "0 0 16 16", fill: "currentColor", children: /* @__PURE__ */ e("path", { d: "M4 4l8 8m0-8l-8 8", stroke: "currentColor", strokeWidth: "1.5", strokeLinecap: "round" }) }) })
29
+ ] }),
30
+ /* @__PURE__ */ l("div", { className: "mtx-modal-body", children: [
31
+ /* @__PURE__ */ e("p", { className: "mtx-template-dialog-hint", children: "Pilih template untuk diterapkan ke tabel yang sedang dipilih." }),
32
+ /* @__PURE__ */ e("div", { className: "mtx-templates-grid", children: g.map((a) => /* @__PURE__ */ l("button", { type: "button", className: "mtx-table-template-card", onClick: () => n(a), children: [
33
+ /* @__PURE__ */ e("div", { className: "mtx-template-preview", children: /* @__PURE__ */ l("div", { className: `mtx-template-table mtx-template-${a.id}`, children: [
34
+ /* @__PURE__ */ l("div", { className: "mtx-template-row", children: [
35
+ /* @__PURE__ */ e("div", { className: "mtx-template-cell mtx-template-header" }),
36
+ /* @__PURE__ */ e("div", { className: "mtx-template-cell mtx-template-header" }),
37
+ /* @__PURE__ */ e("div", { className: "mtx-template-cell mtx-template-header" })
38
+ ] }),
39
+ /* @__PURE__ */ l("div", { className: "mtx-template-row", children: [
40
+ /* @__PURE__ */ e("div", { className: "mtx-template-cell" }),
41
+ /* @__PURE__ */ e("div", { className: "mtx-template-cell" }),
42
+ /* @__PURE__ */ e("div", { className: "mtx-template-cell" })
43
+ ] }),
44
+ /* @__PURE__ */ l("div", { className: "mtx-template-row", children: [
45
+ /* @__PURE__ */ e("div", { className: "mtx-template-cell" }),
46
+ /* @__PURE__ */ e("div", { className: "mtx-template-cell" }),
47
+ /* @__PURE__ */ e("div", { className: "mtx-template-cell" })
48
+ ] })
49
+ ] }) }),
50
+ /* @__PURE__ */ l("div", { className: "mtx-template-info", children: [
51
+ /* @__PURE__ */ e("h4", { className: "mtx-template-name", children: a.name }),
52
+ /* @__PURE__ */ e("p", { className: "mtx-template-description", children: a.description })
53
+ ] })
54
+ ] }, a.id)) })
55
+ ] }),
56
+ /* @__PURE__ */ e("div", { className: "mtx-modal-footer", children: /* @__PURE__ */ e("button", { type: "button", className: "mtx-btn mtx-btn-secondary", onClick: t, children: "Batal" }) })
57
+ ]
58
+ }
59
+ ) }) }) : null;
60
+ });
61
+ N.displayName = "TableTemplatesDialogImpl";
62
+ export {
63
+ N as TableTemplatesDialogImpl
64
+ };