intlayer-editor 8.5.0 → 8.5.1
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/client/dist/assets/{CodeBlockShiki-D9plzEFQ.js → CodeBlockShiki-DoD2Sc7u.js} +1 -1
- package/client/dist/assets/{MarkdownRendererPlugin-Dp6Cig6u.js → MarkdownRendererPlugin-qmrNTiKL.js} +1 -1
- package/client/dist/assets/{index-CDOIYDRk.js → index-B57zBtFg.js} +270 -153
- package/client/dist/assets/{index-SO-phafd.css → index-B5Qkzjg3.css} +34 -4
- package/client/dist/index.html +2 -2
- package/package.json +11 -11
|
@@ -3,7 +3,7 @@ import { a as __toESM } from "./chunk-C0u3WHrm.js";
|
|
|
3
3
|
import { t as require_react } from "./react-BI_C_976.js";
|
|
4
4
|
import { t as require_jsx_runtime } from "./jsx-runtime-BkWmzJHO.js";
|
|
5
5
|
import { t as __vitePreload } from "./preload-helper-B4JcPOPd.js";
|
|
6
|
-
import { t as CodeDefault } from "./index-
|
|
6
|
+
import { t as CodeDefault } from "./index-B57zBtFg.js";
|
|
7
7
|
//#region ../@intlayer/design-system/dist/esm/components/IDE/CodeBlockShiki.mjs
|
|
8
8
|
var import_react = /* @__PURE__ */ __toESM(require_react(), 1);
|
|
9
9
|
var import_jsx_runtime = require_jsx_runtime();
|
package/client/dist/assets/{MarkdownRendererPlugin-Dp6Cig6u.js → MarkdownRendererPlugin-qmrNTiKL.js}
RENAMED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { n as useMarkdownContext } from "./index-
|
|
1
|
+
import { n as useMarkdownContext } from "./index-B57zBtFg.js";
|
|
2
2
|
//#region ../react-intlayer/dist/esm/markdown/MarkdownRendererPlugin.mjs
|
|
3
3
|
var MarkdownRendererPlugin = (props) => {
|
|
4
4
|
const { children, options, components } = props;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/HTMLRendererPlugin-B6Eld7in.js","assets/chunk-C0u3WHrm.js","assets/react-BI_C_976.js","assets/CodeBlockShiki-
|
|
1
|
+
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/HTMLRendererPlugin-B6Eld7in.js","assets/chunk-C0u3WHrm.js","assets/react-BI_C_976.js","assets/CodeBlockShiki-DoD2Sc7u.js","assets/preload-helper-B4JcPOPd.js","assets/jsx-runtime-BkWmzJHO.js","assets/dist-D8J9DkzO.js"])))=>i.map(i=>d[i]);
|
|
2
2
|
import { a as __toESM, i as __toCommonJS, n as __esmMin, r as __exportAll, t as __commonJSMin } from "./chunk-C0u3WHrm.js";
|
|
3
3
|
import { t as require_react } from "./react-BI_C_976.js";
|
|
4
4
|
import { t as require_jsx_runtime } from "./jsx-runtime-BkWmzJHO.js";
|
|
@@ -9570,7 +9570,7 @@ var configuration = {
|
|
|
9570
9570
|
},
|
|
9571
9571
|
metadata: {
|
|
9572
9572
|
"name": "Intlayer",
|
|
9573
|
-
"version": "8.5.
|
|
9573
|
+
"version": "8.5.1",
|
|
9574
9574
|
"doc": "https://intlayer.org/docs"
|
|
9575
9575
|
}
|
|
9576
9576
|
};
|
|
@@ -12089,7 +12089,7 @@ var compile = (markdown = "", ctx, options = {}) => {
|
|
|
12089
12089
|
};
|
|
12090
12090
|
//#endregion
|
|
12091
12091
|
//#region ../react-intlayer/dist/esm/plugins.mjs
|
|
12092
|
-
var LazyMarkdownRendererPlugin = (0, import_react.lazy)(() => __vitePreload(() => import("./MarkdownRendererPlugin-
|
|
12092
|
+
var LazyMarkdownRendererPlugin = (0, import_react.lazy)(() => __vitePreload(() => import("./MarkdownRendererPlugin-qmrNTiKL.js").then((m) => ({ default: m.MarkdownRendererPlugin })), []));
|
|
12093
12093
|
var LazyHTMLRendererPlugin = (0, import_react.lazy)(() => __vitePreload(() => import("./HTMLRendererPlugin-B6Eld7in.js").then((m) => ({ default: m.HTMLRendererPlugin })), __vite__mapDeps([0,1,2])));
|
|
12094
12094
|
/** Translation plugin. Replaces node with a locale string if nodeType = Translation. */
|
|
12095
12095
|
var intlayerNodePlugins = {
|
|
@@ -30176,7 +30176,7 @@ var CodeDefault = ({ children }) => /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
|
30176
30176
|
}, `line-${index}-${line.slice(0, 10)}`)) : children })
|
|
30177
30177
|
})
|
|
30178
30178
|
});
|
|
30179
|
-
var CodeBlockShiki = (0, import_react.lazy)(() => __vitePreload(() => import("./CodeBlockShiki-
|
|
30179
|
+
var CodeBlockShiki = (0, import_react.lazy)(() => __vitePreload(() => import("./CodeBlockShiki-DoD2Sc7u.js").then((mod) => ({ default: mod.CodeBlockShiki })), __vite__mapDeps([3,1,4,5,2])));
|
|
30180
30180
|
var CodeBlock = ({ className, onChange, isEditable, children, lang, isDarkMode, ...props }) => /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", {
|
|
30181
30181
|
className: cn$2("flex w-full min-w-0 max-w-full overflow-x-auto", className),
|
|
30182
30182
|
...props,
|
|
@@ -34093,11 +34093,14 @@ var code_default = {
|
|
|
34093
34093
|
};
|
|
34094
34094
|
//#endregion
|
|
34095
34095
|
//#region ../@intlayer/design-system/dist/esm/components/IDE/CopyCode.mjs
|
|
34096
|
-
var CopyCode = ({ code }) => {
|
|
34096
|
+
var CopyCode = ({ code, ...props }) => {
|
|
34097
34097
|
const { title, description } = useDictionary(code_default);
|
|
34098
34098
|
return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(Popover, {
|
|
34099
34099
|
identifier: "copy",
|
|
34100
|
-
children: [/* @__PURE__ */ (0, import_jsx_runtime.jsx)(CopyButton, {
|
|
34100
|
+
children: [/* @__PURE__ */ (0, import_jsx_runtime.jsx)(CopyButton, {
|
|
34101
|
+
content: code,
|
|
34102
|
+
...props
|
|
34103
|
+
}), /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(Popover.Detail, {
|
|
34101
34104
|
identifier: "copy",
|
|
34102
34105
|
className: "flex min-w-64 flex-col gap-3 p-3 text-sm",
|
|
34103
34106
|
xAlign: PopoverXAlign.END,
|
|
@@ -44498,11 +44501,136 @@ var Modal = ({ children, isOpen, container, onClose, hasCloseButton = false, tit
|
|
|
44498
44501
|
})
|
|
44499
44502
|
}), containerElement);
|
|
44500
44503
|
};
|
|
44504
|
+
var table_default = {
|
|
44505
|
+
key: "table",
|
|
44506
|
+
content: {
|
|
44507
|
+
"nodeType": "translation",
|
|
44508
|
+
"translation": {
|
|
44509
|
+
"en": { "modal": {
|
|
44510
|
+
"title": "Show all table content",
|
|
44511
|
+
"description": "Open the table in a modal to view all data content clearly"
|
|
44512
|
+
} },
|
|
44513
|
+
"en-GB": { "modal": {
|
|
44514
|
+
"title": "Show all table content",
|
|
44515
|
+
"description": "Open the table in a modal to view all data content clearly"
|
|
44516
|
+
} },
|
|
44517
|
+
"fr": { "modal": {
|
|
44518
|
+
"title": "Afficher tout le contenu du tableau",
|
|
44519
|
+
"description": "Ouvrir le tableau dans une fenêtre modale pour voir tout le contenu clairement"
|
|
44520
|
+
} },
|
|
44521
|
+
"es": { "modal": {
|
|
44522
|
+
"title": "Mostrar todo el contenido de la tabla",
|
|
44523
|
+
"description": "Abrir la tabla en una ventana flotante para ver todo el contenido claramente"
|
|
44524
|
+
} },
|
|
44525
|
+
"de": { "modal": {
|
|
44526
|
+
"title": "Alle Tabellendaten anzeigen",
|
|
44527
|
+
"description": "Tabelle in einem Modal öffnen, um alle Daten übersichtlich anzuzeigen"
|
|
44528
|
+
} },
|
|
44529
|
+
"ja": { "modal": {
|
|
44530
|
+
"title": "テーブルのすべての内容を表示",
|
|
44531
|
+
"description": "テーブルをモーダルで開き、すべてのデータを明確に表示"
|
|
44532
|
+
} },
|
|
44533
|
+
"ko": { "modal": {
|
|
44534
|
+
"title": "테이블의 모든 내용 표시",
|
|
44535
|
+
"description": "테이블을 모달로 열어 모든 데이터를 명확하게 확인"
|
|
44536
|
+
} },
|
|
44537
|
+
"zh": { "modal": {
|
|
44538
|
+
"title": "显示表格的所有内容",
|
|
44539
|
+
"description": "在弹窗中打开表格以清晰地查看所有数据"
|
|
44540
|
+
} },
|
|
44541
|
+
"it": { "modal": {
|
|
44542
|
+
"title": "Mostra tutto il contenuto della tabella",
|
|
44543
|
+
"description": "Apri la tabella in una finestra modale per visualizzare tutti i dati in modo chiaro"
|
|
44544
|
+
} },
|
|
44545
|
+
"pt": { "modal": {
|
|
44546
|
+
"title": "Mostrar todo o conteúdo da tabela",
|
|
44547
|
+
"description": "Abrir a tabela em um modal para ver todo o conteúdo claramente"
|
|
44548
|
+
} },
|
|
44549
|
+
"hi": { "modal": {
|
|
44550
|
+
"title": "सभी तालिका सामग्री दिखाएं",
|
|
44551
|
+
"description": "सभी डेटा सामग्री को स्पष्ट रूप से देखने के लिए तालिका को मोडल में खोलें"
|
|
44552
|
+
} },
|
|
44553
|
+
"ar": { "modal": {
|
|
44554
|
+
"title": "اظهار جميع محتويات الجدول",
|
|
44555
|
+
"description": "افتح الجدول في نافذة منبثقة لعرض جميع محتويات البيانات بوضوح"
|
|
44556
|
+
} },
|
|
44557
|
+
"ru": { "modal": {
|
|
44558
|
+
"title": "Показать все данные таблицы",
|
|
44559
|
+
"description": "Открыть таблицу в модальном окне для четкого просмотра всех данных"
|
|
44560
|
+
} }
|
|
44561
|
+
}
|
|
44562
|
+
},
|
|
44563
|
+
localIds: ["table::local::../@intlayer/design-system/dist/esm/components/Table/table.content.mjs"]
|
|
44564
|
+
};
|
|
44501
44565
|
//#endregion
|
|
44502
|
-
//#region ../@intlayer/design-system/dist/esm/components/Table/
|
|
44566
|
+
//#region ../@intlayer/design-system/dist/esm/components/Table/ExpandButton.mjs
|
|
44567
|
+
var ExpandButton = ({ setIsModalOpen }) => {
|
|
44568
|
+
const { modal: modalContent } = useDictionary(table_default);
|
|
44569
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", {
|
|
44570
|
+
className: "pointer-events-none absolute inset-y-0 right-4 z-10",
|
|
44571
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", {
|
|
44572
|
+
className: "pointer-events-auto sticky top-48 pt-4",
|
|
44573
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(Popover, {
|
|
44574
|
+
identifier: "expand",
|
|
44575
|
+
children: [/* @__PURE__ */ (0, import_jsx_runtime.jsx)(Button, {
|
|
44576
|
+
variant: "hoverable",
|
|
44577
|
+
size: "icon-md",
|
|
44578
|
+
onClick: () => {
|
|
44579
|
+
setIsModalOpen(true);
|
|
44580
|
+
},
|
|
44581
|
+
label: modalContent.title,
|
|
44582
|
+
Icon: MoveDiagonal
|
|
44583
|
+
}), /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(Popover.Detail, {
|
|
44584
|
+
identifier: "expand",
|
|
44585
|
+
className: "flex min-w-64 flex-col gap-3 p-3 text-sm",
|
|
44586
|
+
xAlign: PopoverXAlign.END,
|
|
44587
|
+
children: [/* @__PURE__ */ (0, import_jsx_runtime.jsx)("strong", { children: modalContent.title }), /* @__PURE__ */ (0, import_jsx_runtime.jsx)("p", {
|
|
44588
|
+
className: "text-neutral",
|
|
44589
|
+
children: modalContent.description
|
|
44590
|
+
})]
|
|
44591
|
+
})]
|
|
44592
|
+
})
|
|
44593
|
+
})
|
|
44594
|
+
});
|
|
44595
|
+
};
|
|
44596
|
+
//#endregion
|
|
44597
|
+
//#region ../@intlayer/design-system/dist/esm/components/Table/useTableWidths.mjs
|
|
44503
44598
|
var CHAR_WIDTH_REM = .55;
|
|
44504
44599
|
var MIN_WIDTH_REM = 5;
|
|
44505
44600
|
var MAX_WIDTH_REM = 30;
|
|
44601
|
+
var useTableWidths = (tableRef, modalTableRef, dependencies) => {
|
|
44602
|
+
(0, import_react.useEffect)(() => {
|
|
44603
|
+
if (!tableRef.current) return;
|
|
44604
|
+
const colLengths = [];
|
|
44605
|
+
Array.from(tableRef.current.querySelectorAll("tr")).forEach((row) => {
|
|
44606
|
+
Array.from(row.children).forEach((cell, index) => {
|
|
44607
|
+
const len = cell.textContent?.trim().length ?? 0;
|
|
44608
|
+
if (colLengths[index] === void 0 || len > colLengths[index]) colLengths[index] = len;
|
|
44609
|
+
});
|
|
44610
|
+
});
|
|
44611
|
+
const applyToTable = (table) => {
|
|
44612
|
+
const rows = Array.from(table.querySelectorAll("tr"));
|
|
44613
|
+
if (rows.length === 0) return;
|
|
44614
|
+
const applyColStyle = (el, index) => {
|
|
44615
|
+
const minRem = Math.min(MAX_WIDTH_REM, Math.max(MIN_WIDTH_REM, (colLengths[index] ?? 0) * CHAR_WIDTH_REM));
|
|
44616
|
+
el.style.minWidth = `${minRem}rem`;
|
|
44617
|
+
el.style.maxWidth = `${MAX_WIDTH_REM}rem`;
|
|
44618
|
+
};
|
|
44619
|
+
table.querySelectorAll("th").forEach((th, index) => {
|
|
44620
|
+
applyColStyle(th, index);
|
|
44621
|
+
});
|
|
44622
|
+
rows.forEach((row) => {
|
|
44623
|
+
row.querySelectorAll("td").forEach((td, index) => {
|
|
44624
|
+
applyColStyle(td, index);
|
|
44625
|
+
});
|
|
44626
|
+
});
|
|
44627
|
+
};
|
|
44628
|
+
applyToTable(tableRef.current);
|
|
44629
|
+
if (modalTableRef.current) applyToTable(modalTableRef.current);
|
|
44630
|
+
}, dependencies);
|
|
44631
|
+
};
|
|
44632
|
+
//#endregion
|
|
44633
|
+
//#region ../@intlayer/design-system/dist/esm/components/Table/Table.mjs
|
|
44506
44634
|
/**
|
|
44507
44635
|
* Table component that provides an enhanced table experience with modal expansion and collapsible content
|
|
44508
44636
|
*
|
|
@@ -44640,63 +44768,52 @@ var MAX_WIDTH_REM = 30;
|
|
|
44640
44768
|
* @see {@link Modal} - Component used for full-screen table view
|
|
44641
44769
|
* @see {@link Button} - Component used for the modal trigger button
|
|
44642
44770
|
*/
|
|
44643
|
-
var Table = ({ className, isRollable = false, displayModal, ...props }) => {
|
|
44771
|
+
var Table = ({ className, isRollable = false, displayModal, onClick, ...props }) => {
|
|
44644
44772
|
const [isModalOpen, setIsModalOpen] = (0, import_react.useState)(false);
|
|
44773
|
+
const [highlightedRowIndex, setHighlightedRowIndex] = (0, import_react.useState)(null);
|
|
44645
44774
|
const tableRef = (0, import_react.useRef)(null);
|
|
44646
44775
|
const modalTableRef = (0, import_react.useRef)(null);
|
|
44776
|
+
useTableWidths(tableRef, modalTableRef, [props.children, isModalOpen]);
|
|
44647
44777
|
(0, import_react.useEffect)(() => {
|
|
44648
|
-
if (
|
|
44649
|
-
|
|
44650
|
-
|
|
44651
|
-
|
|
44652
|
-
|
|
44653
|
-
|
|
44654
|
-
});
|
|
44655
|
-
});
|
|
44656
|
-
const applyToTable = (table) => {
|
|
44657
|
-
const rows = Array.from(table.querySelectorAll("tr"));
|
|
44658
|
-
if (rows.length === 0) return;
|
|
44659
|
-
const applyColStyle = (el, index) => {
|
|
44660
|
-
const minRem = Math.min(MAX_WIDTH_REM, Math.max(MIN_WIDTH_REM, (colLengths[index] ?? 0) * CHAR_WIDTH_REM));
|
|
44661
|
-
el.style.minWidth = `${minRem}rem`;
|
|
44662
|
-
el.style.maxWidth = `${MAX_WIDTH_REM}rem`;
|
|
44663
|
-
};
|
|
44664
|
-
table.querySelectorAll("th").forEach((th, index) => {
|
|
44665
|
-
applyColStyle(th, index);
|
|
44666
|
-
});
|
|
44667
|
-
rows.forEach((row) => {
|
|
44668
|
-
row.querySelectorAll("td").forEach((td, index) => {
|
|
44669
|
-
applyColStyle(td, index);
|
|
44778
|
+
if (isModalOpen && highlightedRowIndex !== null && modalTableRef.current) {
|
|
44779
|
+
const row = modalTableRef.current.rows[highlightedRowIndex];
|
|
44780
|
+
if (row) {
|
|
44781
|
+
row.scrollIntoView({
|
|
44782
|
+
behavior: "smooth",
|
|
44783
|
+
block: "center"
|
|
44670
44784
|
});
|
|
44671
|
-
|
|
44672
|
-
|
|
44673
|
-
|
|
44674
|
-
|
|
44675
|
-
}, [
|
|
44785
|
+
row.classList.add("bg-neutral/40", "dark:bg-neutral-dark/40");
|
|
44786
|
+
row.style.transition = "background-color 0.3s ease-in-out";
|
|
44787
|
+
}
|
|
44788
|
+
}
|
|
44789
|
+
}, [isModalOpen, highlightedRowIndex]);
|
|
44790
|
+
(0, import_react.useEffect)(() => {
|
|
44791
|
+
if (!isModalOpen) setHighlightedRowIndex(null);
|
|
44792
|
+
}, [isModalOpen]);
|
|
44793
|
+
const handleTableClick = (e) => {
|
|
44794
|
+
if (displayModal) {
|
|
44795
|
+
const tr = e.target.closest("tr");
|
|
44796
|
+
if (tr?.closest("tbody")) {
|
|
44797
|
+
setHighlightedRowIndex(tr.rowIndex);
|
|
44798
|
+
setIsModalOpen(true);
|
|
44799
|
+
}
|
|
44800
|
+
}
|
|
44801
|
+
onClick?.(e);
|
|
44802
|
+
};
|
|
44676
44803
|
return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", {
|
|
44677
|
-
className: "relative
|
|
44804
|
+
className: "group relative",
|
|
44678
44805
|
children: [
|
|
44679
|
-
displayModal && /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
44680
|
-
className: "sticky top-48 z-10",
|
|
44681
|
-
children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", {
|
|
44682
|
-
className: "absolute top-4 right-2",
|
|
44683
|
-
children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Button, {
|
|
44684
|
-
variant: "hoverable",
|
|
44685
|
-
size: "icon-md",
|
|
44686
|
-
onClick: () => {
|
|
44687
|
-
setIsModalOpen(true);
|
|
44688
|
-
},
|
|
44689
|
-
label: "Move",
|
|
44690
|
-
Icon: MoveDiagonal
|
|
44691
|
-
})
|
|
44692
|
-
})
|
|
44693
|
-
}),
|
|
44806
|
+
displayModal && /* @__PURE__ */ (0, import_jsx_runtime.jsx)(ExpandButton, { setIsModalOpen }),
|
|
44694
44807
|
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(ExpandCollapse, {
|
|
44695
44808
|
isRollable,
|
|
44696
|
-
className: "max-w-full overflow-x-auto",
|
|
44809
|
+
className: "max-w-full overflow-x-auto rounded-2xl bg-background text-left [corner-shape:squircle] supports-[corner-shape:squircle]:rounded-3xl",
|
|
44697
44810
|
children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)("table", {
|
|
44698
44811
|
ref: tableRef,
|
|
44699
|
-
className: cn$2("w-full table-auto
|
|
44812
|
+
className: cn$2("w-full table-auto overflow-hidden", displayModal && "[&_tbody_tr:hover]:bg-neutral/40 [&_tbody_tr:hover]:dark:bg-neutral-dark/40 [&_tbody_tr]:cursor-pointer [&_tbody_tr]:transition-colors", className),
|
|
44813
|
+
onClick: handleTableClick,
|
|
44814
|
+
onKeyDown: (e) => {
|
|
44815
|
+
if (e.key === "Enter" || e.key === " ") handleTableClick(e);
|
|
44816
|
+
},
|
|
44700
44817
|
...props
|
|
44701
44818
|
})
|
|
44702
44819
|
}),
|
|
@@ -45221,106 +45338,6 @@ var renameKey = (obj, oldKey, newKey) => {
|
|
|
45221
45338
|
return newObj;
|
|
45222
45339
|
};
|
|
45223
45340
|
//#endregion
|
|
45224
|
-
//#region ../@intlayer/design-system/dist/esm/components/ContentEditor/ContentEditorInput.mjs
|
|
45225
|
-
/**
|
|
45226
|
-
* ContentEditorInput Component
|
|
45227
|
-
*
|
|
45228
|
-
* An inline editing component for single-line text input with validation,
|
|
45229
|
-
* cancel/save functionality, and support for additional action buttons.
|
|
45230
|
-
*
|
|
45231
|
-
* ## Features
|
|
45232
|
-
* - **Inline Input Editing**: Edit single-line content with immediate feedback
|
|
45233
|
-
* - **Validation Support**: Optional content validation with visual feedback
|
|
45234
|
-
* - **Action Buttons**: Built-in save/cancel with support for additional buttons
|
|
45235
|
-
* - **Keyboard Shortcuts**: Enter to save, Escape to cancel
|
|
45236
|
-
* - **Accessibility**: Full ARIA support and keyboard navigation
|
|
45237
|
-
* - **State Management**: Handles editing states and validation
|
|
45238
|
-
*
|
|
45239
|
-
* ## Accessibility
|
|
45240
|
-
* - Proper ARIA labels and descriptions for all controls
|
|
45241
|
-
* - Keyboard navigation (Tab, Enter, Escape)
|
|
45242
|
-
* - Screen reader support for validation states
|
|
45243
|
-
* - Focus management and visual indicators
|
|
45244
|
-
*
|
|
45245
|
-
* @param children - Current input value
|
|
45246
|
-
* @param onContentChange - Callback when content is saved
|
|
45247
|
-
* @param disabled - Whether the editor is disabled
|
|
45248
|
-
* @param validate - Optional validation function
|
|
45249
|
-
* @param additionalButtons - Extra buttons to display
|
|
45250
|
-
* @param props - Additional Input component props
|
|
45251
|
-
*/
|
|
45252
|
-
var ContentEditorInput$1 = ({ children, onContentChange, disabled, validate, additionalButtons, ...props }) => {
|
|
45253
|
-
const [newValue, setNewValue] = (0, import_react.useState)(children);
|
|
45254
|
-
const [resetIncrementor, setResetIncrementor] = (0, import_react.useState)(0);
|
|
45255
|
-
const isEdited = newValue !== children;
|
|
45256
|
-
const handleCancel = () => {
|
|
45257
|
-
setNewValue(children);
|
|
45258
|
-
setResetIncrementor((prev) => prev + 1);
|
|
45259
|
-
};
|
|
45260
|
-
const handleValid = () => {
|
|
45261
|
-
onContentChange(newValue);
|
|
45262
|
-
};
|
|
45263
|
-
const handleOnContentChange = (e) => {
|
|
45264
|
-
setNewValue(e.currentTarget.value);
|
|
45265
|
-
};
|
|
45266
|
-
const handleKeyDown = (e) => {
|
|
45267
|
-
if (e.key === "Enter" && !disabled && isValid) {
|
|
45268
|
-
e.preventDefault();
|
|
45269
|
-
handleValid();
|
|
45270
|
-
} else if (e.key === "Escape") {
|
|
45271
|
-
e.preventDefault();
|
|
45272
|
-
handleCancel();
|
|
45273
|
-
}
|
|
45274
|
-
};
|
|
45275
|
-
(0, import_react.useEffect)(() => {
|
|
45276
|
-
setNewValue(children);
|
|
45277
|
-
setResetIncrementor((prev) => prev + 1);
|
|
45278
|
-
}, [children]);
|
|
45279
|
-
const isValid = validate?.(newValue) ?? true;
|
|
45280
|
-
return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", {
|
|
45281
|
-
className: "flex size-full flex-col items-center justify-between gap-2",
|
|
45282
|
-
role: "group",
|
|
45283
|
-
"aria-label": "Content editor input",
|
|
45284
|
-
children: [/* @__PURE__ */ (0, import_jsx_runtime.jsx)(Input, {
|
|
45285
|
-
onChange: handleOnContentChange,
|
|
45286
|
-
onKeyDown: handleKeyDown,
|
|
45287
|
-
"aria-label": "Editable input value",
|
|
45288
|
-
"aria-describedby": isEdited || additionalButtons ? "content-editor-input-actions" : void 0,
|
|
45289
|
-
"aria-invalid": !isValid,
|
|
45290
|
-
variant: InputVariant.INVISIBLE,
|
|
45291
|
-
className: "size-full",
|
|
45292
|
-
defaultValue: children,
|
|
45293
|
-
disabled,
|
|
45294
|
-
...props
|
|
45295
|
-
}, resetIncrementor), (isEdited || additionalButtons) && /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", {
|
|
45296
|
-
id: "content-editor-input-actions",
|
|
45297
|
-
className: "flex w-full items-center justify-end gap-2",
|
|
45298
|
-
role: "group",
|
|
45299
|
-
"aria-label": "Edit actions",
|
|
45300
|
-
children: [isEdited && /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_jsx_runtime.Fragment, { children: [/* @__PURE__ */ (0, import_jsx_runtime.jsx)(Button, {
|
|
45301
|
-
Icon: Check,
|
|
45302
|
-
label: `Save changes${!isValid ? " (invalid content)" : ""}`,
|
|
45303
|
-
variant: ButtonVariant.HOVERABLE,
|
|
45304
|
-
color: ButtonColor.TEXT,
|
|
45305
|
-
size: ButtonSize.ICON_SM,
|
|
45306
|
-
className: "cursor-pointer hover:scale-110",
|
|
45307
|
-
disabled: disabled || !isValid,
|
|
45308
|
-
onClick: handleValid,
|
|
45309
|
-
"aria-describedby": !isValid ? "validation-error" : void 0
|
|
45310
|
-
}), /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Button, {
|
|
45311
|
-
Icon: X$1,
|
|
45312
|
-
label: "Cancel changes",
|
|
45313
|
-
variant: ButtonVariant.HOVERABLE,
|
|
45314
|
-
size: ButtonSize.ICON_SM,
|
|
45315
|
-
color: ButtonColor.TEXT,
|
|
45316
|
-
className: "cursor-pointer hover:scale-110",
|
|
45317
|
-
onClick: handleCancel,
|
|
45318
|
-
disabled
|
|
45319
|
-
})] }), additionalButtons]
|
|
45320
|
-
})]
|
|
45321
|
-
}, String(children));
|
|
45322
|
-
};
|
|
45323
|
-
//#endregion
|
|
45324
45341
|
//#region ../../node_modules/.bun/@tanstack+query-core@5.95.2/node_modules/@tanstack/query-core/build/modern/subscribable.js
|
|
45325
45342
|
var Subscribable = class {
|
|
45326
45343
|
constructor() {
|
|
@@ -51130,6 +51147,106 @@ var useWriteDictionary = () => {
|
|
|
51130
51147
|
});
|
|
51131
51148
|
};
|
|
51132
51149
|
//#endregion
|
|
51150
|
+
//#region ../@intlayer/design-system/dist/esm/components/ContentEditor/ContentEditorInput.mjs
|
|
51151
|
+
/**
|
|
51152
|
+
* ContentEditorInput Component
|
|
51153
|
+
*
|
|
51154
|
+
* An inline editing component for single-line text input with validation,
|
|
51155
|
+
* cancel/save functionality, and support for additional action buttons.
|
|
51156
|
+
*
|
|
51157
|
+
* ## Features
|
|
51158
|
+
* - **Inline Input Editing**: Edit single-line content with immediate feedback
|
|
51159
|
+
* - **Validation Support**: Optional content validation with visual feedback
|
|
51160
|
+
* - **Action Buttons**: Built-in save/cancel with support for additional buttons
|
|
51161
|
+
* - **Keyboard Shortcuts**: Enter to save, Escape to cancel
|
|
51162
|
+
* - **Accessibility**: Full ARIA support and keyboard navigation
|
|
51163
|
+
* - **State Management**: Handles editing states and validation
|
|
51164
|
+
*
|
|
51165
|
+
* ## Accessibility
|
|
51166
|
+
* - Proper ARIA labels and descriptions for all controls
|
|
51167
|
+
* - Keyboard navigation (Tab, Enter, Escape)
|
|
51168
|
+
* - Screen reader support for validation states
|
|
51169
|
+
* - Focus management and visual indicators
|
|
51170
|
+
*
|
|
51171
|
+
* @param children - Current input value
|
|
51172
|
+
* @param onContentChange - Callback when content is saved
|
|
51173
|
+
* @param disabled - Whether the editor is disabled
|
|
51174
|
+
* @param validate - Optional validation function
|
|
51175
|
+
* @param additionalButtons - Extra buttons to display
|
|
51176
|
+
* @param props - Additional Input component props
|
|
51177
|
+
*/
|
|
51178
|
+
var ContentEditorInput$1 = ({ children, onContentChange, disabled, validate, additionalButtons, ...props }) => {
|
|
51179
|
+
const [newValue, setNewValue] = (0, import_react.useState)(children);
|
|
51180
|
+
const [resetIncrementor, setResetIncrementor] = (0, import_react.useState)(0);
|
|
51181
|
+
const isEdited = newValue !== children;
|
|
51182
|
+
const handleCancel = () => {
|
|
51183
|
+
setNewValue(children);
|
|
51184
|
+
setResetIncrementor((prev) => prev + 1);
|
|
51185
|
+
};
|
|
51186
|
+
const handleValid = () => {
|
|
51187
|
+
onContentChange(newValue);
|
|
51188
|
+
};
|
|
51189
|
+
const handleOnContentChange = (e) => {
|
|
51190
|
+
setNewValue(e.currentTarget.value);
|
|
51191
|
+
};
|
|
51192
|
+
const handleKeyDown = (e) => {
|
|
51193
|
+
if (e.key === "Enter" && !disabled && isValid) {
|
|
51194
|
+
e.preventDefault();
|
|
51195
|
+
handleValid();
|
|
51196
|
+
} else if (e.key === "Escape") {
|
|
51197
|
+
e.preventDefault();
|
|
51198
|
+
handleCancel();
|
|
51199
|
+
}
|
|
51200
|
+
};
|
|
51201
|
+
(0, import_react.useEffect)(() => {
|
|
51202
|
+
setNewValue(children);
|
|
51203
|
+
setResetIncrementor((prev) => prev + 1);
|
|
51204
|
+
}, [children]);
|
|
51205
|
+
const isValid = validate?.(newValue) ?? true;
|
|
51206
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", {
|
|
51207
|
+
className: "flex size-full flex-col items-center justify-between gap-2",
|
|
51208
|
+
role: "group",
|
|
51209
|
+
"aria-label": "Content editor input",
|
|
51210
|
+
children: [/* @__PURE__ */ (0, import_jsx_runtime.jsx)(Input, {
|
|
51211
|
+
onChange: handleOnContentChange,
|
|
51212
|
+
onKeyDown: handleKeyDown,
|
|
51213
|
+
"aria-label": "Editable input value",
|
|
51214
|
+
"aria-describedby": isEdited || additionalButtons ? "content-editor-input-actions" : void 0,
|
|
51215
|
+
"aria-invalid": !isValid,
|
|
51216
|
+
variant: InputVariant.INVISIBLE,
|
|
51217
|
+
className: "size-full",
|
|
51218
|
+
defaultValue: children,
|
|
51219
|
+
disabled,
|
|
51220
|
+
...props
|
|
51221
|
+
}, resetIncrementor), (isEdited || additionalButtons) && /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", {
|
|
51222
|
+
id: "content-editor-input-actions",
|
|
51223
|
+
className: "flex w-full items-center justify-end gap-2",
|
|
51224
|
+
role: "group",
|
|
51225
|
+
"aria-label": "Edit actions",
|
|
51226
|
+
children: [isEdited && /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_jsx_runtime.Fragment, { children: [/* @__PURE__ */ (0, import_jsx_runtime.jsx)(Button, {
|
|
51227
|
+
Icon: Check,
|
|
51228
|
+
label: `Save changes${!isValid ? " (invalid content)" : ""}`,
|
|
51229
|
+
variant: ButtonVariant.HOVERABLE,
|
|
51230
|
+
color: ButtonColor.TEXT,
|
|
51231
|
+
size: ButtonSize.ICON_SM,
|
|
51232
|
+
className: "cursor-pointer hover:scale-110",
|
|
51233
|
+
disabled: disabled || !isValid,
|
|
51234
|
+
onClick: handleValid,
|
|
51235
|
+
"aria-describedby": !isValid ? "validation-error" : void 0
|
|
51236
|
+
}), /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Button, {
|
|
51237
|
+
Icon: X$1,
|
|
51238
|
+
label: "Cancel changes",
|
|
51239
|
+
variant: ButtonVariant.HOVERABLE,
|
|
51240
|
+
size: ButtonSize.ICON_SM,
|
|
51241
|
+
color: ButtonColor.TEXT,
|
|
51242
|
+
className: "cursor-pointer hover:scale-110",
|
|
51243
|
+
onClick: handleCancel,
|
|
51244
|
+
disabled
|
|
51245
|
+
})] }), additionalButtons]
|
|
51246
|
+
})]
|
|
51247
|
+
}, String(children));
|
|
51248
|
+
};
|
|
51249
|
+
//#endregion
|
|
51133
51250
|
//#region ../@intlayer/design-system/dist/esm/hooks/useUser/index.mjs
|
|
51134
51251
|
var useUser = () => {
|
|
51135
51252
|
const { session, revalidateSession, setSession } = useAuth();
|
|
@@ -585,6 +585,10 @@
|
|
|
585
585
|
inset: calc(var(--spacing) * 0);
|
|
586
586
|
}
|
|
587
587
|
|
|
588
|
+
.inset-y-0 {
|
|
589
|
+
inset-block: calc(var(--spacing) * 0);
|
|
590
|
+
}
|
|
591
|
+
|
|
588
592
|
.start {
|
|
589
593
|
inset-inline-start: var(--spacing);
|
|
590
594
|
}
|
|
@@ -609,10 +613,6 @@
|
|
|
609
613
|
top: calc(var(--spacing) * 2);
|
|
610
614
|
}
|
|
611
615
|
|
|
612
|
-
.top-4 {
|
|
613
|
-
top: calc(var(--spacing) * 4);
|
|
614
|
-
}
|
|
615
|
-
|
|
616
616
|
.top-5 {
|
|
617
617
|
top: calc(var(--spacing) * 5);
|
|
618
618
|
}
|
|
@@ -3006,6 +3006,16 @@
|
|
|
3006
3006
|
}
|
|
3007
3007
|
}
|
|
3008
3008
|
|
|
3009
|
+
.bg-neutral\/40 {
|
|
3010
|
+
background-color: #5d5d5d66;
|
|
3011
|
+
}
|
|
3012
|
+
|
|
3013
|
+
@supports (color: color-mix(in lab, red, red)) {
|
|
3014
|
+
.bg-neutral\/40 {
|
|
3015
|
+
background-color: color-mix(in oklab, var(--color-neutral) 40%, transparent);
|
|
3016
|
+
}
|
|
3017
|
+
}
|
|
3018
|
+
|
|
3009
3019
|
.bg-orange-100 {
|
|
3010
3020
|
background-color: var(--color-orange-100);
|
|
3011
3021
|
}
|
|
@@ -7019,6 +7029,26 @@
|
|
|
7019
7029
|
color: var(--color-neutral);
|
|
7020
7030
|
}
|
|
7021
7031
|
|
|
7032
|
+
.\[\&_tbody_tr\]\:cursor-pointer tbody tr {
|
|
7033
|
+
cursor: pointer;
|
|
7034
|
+
}
|
|
7035
|
+
|
|
7036
|
+
.\[\&_tbody_tr\]\:transition-colors tbody tr {
|
|
7037
|
+
transition-property: color, background-color, border-color, outline-color, text-decoration-color, fill, stroke, --tw-gradient-from, --tw-gradient-via, --tw-gradient-to;
|
|
7038
|
+
transition-timing-function: var(--tw-ease, var(--default-transition-timing-function));
|
|
7039
|
+
transition-duration: var(--tw-duration, var(--default-transition-duration));
|
|
7040
|
+
}
|
|
7041
|
+
|
|
7042
|
+
.\[\&_tbody_tr\:hover\]\:bg-neutral\/40 tbody tr:hover {
|
|
7043
|
+
background-color: #5d5d5d66;
|
|
7044
|
+
}
|
|
7045
|
+
|
|
7046
|
+
@supports (color: color-mix(in lab, red, red)) {
|
|
7047
|
+
.\[\&_tbody_tr\:hover\]\:bg-neutral\/40 tbody tr:hover {
|
|
7048
|
+
background-color: color-mix(in oklab, var(--color-neutral) 40%, transparent);
|
|
7049
|
+
}
|
|
7050
|
+
}
|
|
7051
|
+
|
|
7022
7052
|
.\[\&\+div\]\:text-xs + div {
|
|
7023
7053
|
font-size: var(--text-xs);
|
|
7024
7054
|
line-height: var(--tw-leading, var(--text-xs--line-height));
|
package/client/dist/index.html
CHANGED
|
@@ -5,12 +5,12 @@
|
|
|
5
5
|
<link rel="icon" type="image/svg+xml" href="/vite.svg" />
|
|
6
6
|
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
|
7
7
|
<title>Intlayer Editor</title>
|
|
8
|
-
<script type="module" crossorigin src="/assets/index-
|
|
8
|
+
<script type="module" crossorigin src="/assets/index-B57zBtFg.js"></script>
|
|
9
9
|
<link rel="modulepreload" crossorigin href="/assets/chunk-C0u3WHrm.js">
|
|
10
10
|
<link rel="modulepreload" crossorigin href="/assets/preload-helper-B4JcPOPd.js">
|
|
11
11
|
<link rel="modulepreload" crossorigin href="/assets/jsx-runtime-BkWmzJHO.js">
|
|
12
12
|
<link rel="modulepreload" crossorigin href="/assets/react-BI_C_976.js">
|
|
13
|
-
<link rel="stylesheet" crossorigin href="/assets/index-
|
|
13
|
+
<link rel="stylesheet" crossorigin href="/assets/index-B5Qkzjg3.css">
|
|
14
14
|
</head>
|
|
15
15
|
<body>
|
|
16
16
|
<div id="root"></div>
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "intlayer-editor",
|
|
3
|
-
"version": "8.5.
|
|
3
|
+
"version": "8.5.1",
|
|
4
4
|
"private": false,
|
|
5
5
|
"description": "Integrate the Intlayer visual editor into your Intlayer projects, enabling CMS-like content management with multilingual support.",
|
|
6
6
|
"keywords": [
|
|
@@ -93,17 +93,17 @@
|
|
|
93
93
|
"@fastify/formbody": "8.0.2",
|
|
94
94
|
"@fastify/helmet": "13.0.2",
|
|
95
95
|
"@fastify/static": "9.0.0",
|
|
96
|
-
"@intlayer/chokidar": "8.5.
|
|
97
|
-
"@intlayer/config": "8.5.
|
|
98
|
-
"@intlayer/unmerged-dictionaries-entry": "8.5.
|
|
96
|
+
"@intlayer/chokidar": "8.5.1",
|
|
97
|
+
"@intlayer/config": "8.5.1",
|
|
98
|
+
"@intlayer/unmerged-dictionaries-entry": "8.5.1",
|
|
99
99
|
"fastify": "5.8.2",
|
|
100
|
-
"fastify-intlayer": "8.5.
|
|
100
|
+
"fastify-intlayer": "8.5.1",
|
|
101
101
|
"mime": "4.1.0"
|
|
102
102
|
},
|
|
103
103
|
"devDependencies": {
|
|
104
|
-
"@intlayer/design-system": "8.5.
|
|
105
|
-
"@intlayer/editor-react": "8.5.
|
|
106
|
-
"@intlayer/types": "8.5.
|
|
104
|
+
"@intlayer/design-system": "8.5.1",
|
|
105
|
+
"@intlayer/editor-react": "8.5.1",
|
|
106
|
+
"@intlayer/types": "8.5.1",
|
|
107
107
|
"@tailwindcss/vite": "4.2.2",
|
|
108
108
|
"@tanstack/react-query": "5.95.2",
|
|
109
109
|
"@types/node": "25.5.0",
|
|
@@ -117,18 +117,18 @@
|
|
|
117
117
|
"framer-motion": "12.38.0",
|
|
118
118
|
"fuse.js": "7.1.0",
|
|
119
119
|
"globals": "17.4.0",
|
|
120
|
-
"intlayer": "8.5.
|
|
120
|
+
"intlayer": "8.5.1",
|
|
121
121
|
"lucide-react": "1.0.1",
|
|
122
122
|
"react": "19.2.4",
|
|
123
123
|
"react-dom": "19.2.4",
|
|
124
|
-
"react-intlayer": "8.5.
|
|
124
|
+
"react-intlayer": "8.5.1",
|
|
125
125
|
"react-router-dom": "7.13.1",
|
|
126
126
|
"tailwind-merge": "3.5.0",
|
|
127
127
|
"tailwindcss": "4.2.2",
|
|
128
128
|
"tsdown": "0.21.4",
|
|
129
129
|
"typescript": "6.0.2",
|
|
130
130
|
"vite": "8.0.2",
|
|
131
|
-
"vite-intlayer": "8.5.
|
|
131
|
+
"vite-intlayer": "8.5.1",
|
|
132
132
|
"vitest": "4.1.1"
|
|
133
133
|
},
|
|
134
134
|
"engines": {
|