intlayer-editor 8.4.8 → 8.4.10
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-CBpFC0wa.js → CodeBlockShiki-CjD7FtGt.js} +1 -1
- package/client/dist/assets/{index-3RB3SZoe.js → index-C5gyL3b-.js} +146 -82
- package/client/dist/assets/{markdown-BRt2VivO.js → markdown-B_VAQu_B.js} +6 -2
- package/client/dist/assets/{markdown-CKVmpT1j.js → markdown-DJYH1etf.js} +2 -2
- package/client/dist/index.html +2 -2
- package/package.json +16 -16
- package/server/dist/controllers/dictionary.controller.cjs +5 -1
- package/server/dist/controllers/dictionary.controller.cjs.map +1 -1
- package/server/dist/controllers/dictionary.controller.mjs +5 -1
- package/server/dist/controllers/dictionary.controller.mjs.map +1 -1
|
@@ -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-C5gyL3b-.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();
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/markdown-
|
|
1
|
+
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/markdown-B_VAQu_B.js","assets/chunk-C0u3WHrm.js","assets/markdown-DJYH1etf.js","assets/html-CC2iD1GB.js","assets/react-BI_C_976.js","assets/CodeBlockShiki-CjD7FtGt.js","assets/preload-helper-B4JcPOPd.js","assets/jsx-runtime-BkWmzJHO.js","assets/dist-B9LA40uC.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";
|
|
5
5
|
import { t as __vitePreload } from "./preload-helper-B4JcPOPd.js";
|
|
6
|
-
import { n as compile } from "./markdown-
|
|
6
|
+
import { n as compile } from "./markdown-B_VAQu_B.js";
|
|
7
7
|
//#region \0vite/modulepreload-polyfill.js
|
|
8
8
|
(function polyfill() {
|
|
9
9
|
const relList = document.createElement("link").relList;
|
|
@@ -9570,7 +9570,7 @@ var configuration_default = {
|
|
|
9570
9570
|
},
|
|
9571
9571
|
metadata: {
|
|
9572
9572
|
"name": "Intlayer",
|
|
9573
|
-
"version": "8.4.
|
|
9573
|
+
"version": "8.4.10",
|
|
9574
9574
|
"doc": "https://intlayer.org/docs"
|
|
9575
9575
|
}
|
|
9576
9576
|
};
|
|
@@ -10275,10 +10275,10 @@ var splitInsertionTemplate = (template, values = {}) => {
|
|
|
10275
10275
|
//#endregion
|
|
10276
10276
|
//#region ../react-intlayer/dist/esm/plugins.mjs
|
|
10277
10277
|
var _getMarkdownMetadata = null;
|
|
10278
|
-
__vitePreload(() => import("./markdown-
|
|
10278
|
+
__vitePreload(() => import("./markdown-B_VAQu_B.js").then((n) => n.t).then((m) => {
|
|
10279
10279
|
_getMarkdownMetadata = m.getMarkdownMetadata;
|
|
10280
10280
|
}), __vite__mapDeps([0,1]));
|
|
10281
|
-
var LazyMarkdownRendererPlugin = (0, import_react.lazy)(() => __vitePreload(() => import("./markdown-
|
|
10281
|
+
var LazyMarkdownRendererPlugin = (0, import_react.lazy)(() => __vitePreload(() => import("./markdown-DJYH1etf.js").then((m) => ({ default: m.MarkdownRendererPlugin })), __vite__mapDeps([2,1,0])));
|
|
10282
10282
|
var LazyHTMLRendererPlugin = (0, import_react.lazy)(() => __vitePreload(() => import("./html-CC2iD1GB.js").then((m) => ({ default: m.HTMLRendererPlugin })), __vite__mapDeps([3,1,4])));
|
|
10283
10283
|
/** Translation plugin. Replaces node with a locale string if nodeType = Translation. */
|
|
10284
10284
|
var intlayerNodePlugins = {
|
|
@@ -16492,9 +16492,9 @@ var cva = (base, config) => (props) => {
|
|
|
16492
16492
|
}, []), props === null || props === void 0 ? void 0 : props.class, props === null || props === void 0 ? void 0 : props.className);
|
|
16493
16493
|
};
|
|
16494
16494
|
//#endregion
|
|
16495
|
-
//#region ../../node_modules/.bun/lucide-react@0.
|
|
16495
|
+
//#region ../../node_modules/.bun/lucide-react@1.0.1+b1ab299f0a400331/node_modules/lucide-react/dist/esm/shared/src/utils/mergeClasses.js
|
|
16496
16496
|
/**
|
|
16497
|
-
* @license lucide-react
|
|
16497
|
+
* @license lucide-react v1.0.1 - ISC
|
|
16498
16498
|
*
|
|
16499
16499
|
* This source code is licensed under the ISC license.
|
|
16500
16500
|
* See the LICENSE file in the root directory of this source tree.
|
|
@@ -16503,27 +16503,27 @@ var mergeClasses = (...classes) => classes.filter((className, index, array) => {
|
|
|
16503
16503
|
return Boolean(className) && className.trim() !== "" && array.indexOf(className) === index;
|
|
16504
16504
|
}).join(" ").trim();
|
|
16505
16505
|
//#endregion
|
|
16506
|
-
//#region ../../node_modules/.bun/lucide-react@0.
|
|
16506
|
+
//#region ../../node_modules/.bun/lucide-react@1.0.1+b1ab299f0a400331/node_modules/lucide-react/dist/esm/shared/src/utils/toKebabCase.js
|
|
16507
16507
|
/**
|
|
16508
|
-
* @license lucide-react
|
|
16508
|
+
* @license lucide-react v1.0.1 - ISC
|
|
16509
16509
|
*
|
|
16510
16510
|
* This source code is licensed under the ISC license.
|
|
16511
16511
|
* See the LICENSE file in the root directory of this source tree.
|
|
16512
16512
|
*/
|
|
16513
16513
|
var toKebabCase = (string) => string.replace(/([a-z0-9])([A-Z])/g, "$1-$2").toLowerCase();
|
|
16514
16514
|
//#endregion
|
|
16515
|
-
//#region ../../node_modules/.bun/lucide-react@0.
|
|
16515
|
+
//#region ../../node_modules/.bun/lucide-react@1.0.1+b1ab299f0a400331/node_modules/lucide-react/dist/esm/shared/src/utils/toCamelCase.js
|
|
16516
16516
|
/**
|
|
16517
|
-
* @license lucide-react
|
|
16517
|
+
* @license lucide-react v1.0.1 - ISC
|
|
16518
16518
|
*
|
|
16519
16519
|
* This source code is licensed under the ISC license.
|
|
16520
16520
|
* See the LICENSE file in the root directory of this source tree.
|
|
16521
16521
|
*/
|
|
16522
16522
|
var toCamelCase = (string) => string.replace(/^([A-Z])|[\s-_]+(\w)/g, (match, p1, p2) => p2 ? p2.toUpperCase() : p1.toLowerCase());
|
|
16523
16523
|
//#endregion
|
|
16524
|
-
//#region ../../node_modules/.bun/lucide-react@0.
|
|
16524
|
+
//#region ../../node_modules/.bun/lucide-react@1.0.1+b1ab299f0a400331/node_modules/lucide-react/dist/esm/shared/src/utils/toPascalCase.js
|
|
16525
16525
|
/**
|
|
16526
|
-
* @license lucide-react
|
|
16526
|
+
* @license lucide-react v1.0.1 - ISC
|
|
16527
16527
|
*
|
|
16528
16528
|
* This source code is licensed under the ISC license.
|
|
16529
16529
|
* See the LICENSE file in the root directory of this source tree.
|
|
@@ -16533,9 +16533,9 @@ var toPascalCase = (string) => {
|
|
|
16533
16533
|
return camelCase.charAt(0).toUpperCase() + camelCase.slice(1);
|
|
16534
16534
|
};
|
|
16535
16535
|
//#endregion
|
|
16536
|
-
//#region ../../node_modules/.bun/lucide-react@0.
|
|
16536
|
+
//#region ../../node_modules/.bun/lucide-react@1.0.1+b1ab299f0a400331/node_modules/lucide-react/dist/esm/defaultAttributes.js
|
|
16537
16537
|
/**
|
|
16538
|
-
* @license lucide-react
|
|
16538
|
+
* @license lucide-react v1.0.1 - ISC
|
|
16539
16539
|
*
|
|
16540
16540
|
* This source code is licensed under the ISC license.
|
|
16541
16541
|
* See the LICENSE file in the root directory of this source tree.
|
|
@@ -16552,9 +16552,9 @@ var defaultAttributes = {
|
|
|
16552
16552
|
strokeLinejoin: "round"
|
|
16553
16553
|
};
|
|
16554
16554
|
//#endregion
|
|
16555
|
-
//#region ../../node_modules/.bun/lucide-react@0.
|
|
16555
|
+
//#region ../../node_modules/.bun/lucide-react@1.0.1+b1ab299f0a400331/node_modules/lucide-react/dist/esm/shared/src/utils/hasA11yProp.js
|
|
16556
16556
|
/**
|
|
16557
|
-
* @license lucide-react
|
|
16557
|
+
* @license lucide-react v1.0.1 - ISC
|
|
16558
16558
|
*
|
|
16559
16559
|
* This source code is licensed under the ISC license.
|
|
16560
16560
|
* See the LICENSE file in the root directory of this source tree.
|
|
@@ -16564,28 +16564,42 @@ var hasA11yProp = (props) => {
|
|
|
16564
16564
|
return false;
|
|
16565
16565
|
};
|
|
16566
16566
|
//#endregion
|
|
16567
|
-
//#region ../../node_modules/.bun/lucide-react@0.
|
|
16567
|
+
//#region ../../node_modules/.bun/lucide-react@1.0.1+b1ab299f0a400331/node_modules/lucide-react/dist/esm/context.js
|
|
16568
16568
|
/**
|
|
16569
|
-
* @license lucide-react
|
|
16569
|
+
* @license lucide-react v1.0.1 - ISC
|
|
16570
16570
|
*
|
|
16571
16571
|
* This source code is licensed under the ISC license.
|
|
16572
16572
|
* See the LICENSE file in the root directory of this source tree.
|
|
16573
16573
|
*/
|
|
16574
|
-
var
|
|
16575
|
-
|
|
16576
|
-
|
|
16577
|
-
|
|
16578
|
-
|
|
16579
|
-
|
|
16580
|
-
|
|
16581
|
-
|
|
16582
|
-
|
|
16583
|
-
|
|
16584
|
-
|
|
16574
|
+
var LucideContext = (0, import_react.createContext)({});
|
|
16575
|
+
var useLucideContext = () => (0, import_react.useContext)(LucideContext);
|
|
16576
|
+
//#endregion
|
|
16577
|
+
//#region ../../node_modules/.bun/lucide-react@1.0.1+b1ab299f0a400331/node_modules/lucide-react/dist/esm/Icon.js
|
|
16578
|
+
/**
|
|
16579
|
+
* @license lucide-react v1.0.1 - ISC
|
|
16580
|
+
*
|
|
16581
|
+
* This source code is licensed under the ISC license.
|
|
16582
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
16583
|
+
*/
|
|
16584
|
+
var Icon$1 = (0, import_react.forwardRef)(({ color, size, strokeWidth, absoluteStrokeWidth, className = "", children, iconNode, ...rest }, ref) => {
|
|
16585
|
+
const { size: contextSize = 24, strokeWidth: contextStrokeWidth = 2, absoluteStrokeWidth: contextAbsoluteStrokeWidth = false, color: contextColor = "currentColor", className: contextClass = "" } = useLucideContext() ?? {};
|
|
16586
|
+
const calculatedStrokeWidth = absoluteStrokeWidth ?? contextAbsoluteStrokeWidth ? Number(strokeWidth ?? contextStrokeWidth) * 24 / Number(size ?? contextSize) : strokeWidth ?? contextStrokeWidth;
|
|
16587
|
+
return (0, import_react.createElement)("svg", {
|
|
16588
|
+
ref,
|
|
16589
|
+
...defaultAttributes,
|
|
16590
|
+
width: size ?? contextSize ?? defaultAttributes.width,
|
|
16591
|
+
height: size ?? contextSize ?? defaultAttributes.height,
|
|
16592
|
+
stroke: color ?? contextColor,
|
|
16593
|
+
strokeWidth: calculatedStrokeWidth,
|
|
16594
|
+
className: mergeClasses("lucide", contextClass, className),
|
|
16595
|
+
...!children && !hasA11yProp(rest) && { "aria-hidden": "true" },
|
|
16596
|
+
...rest
|
|
16597
|
+
}, [...iconNode.map(([tag, attrs]) => (0, import_react.createElement)(tag, attrs)), ...Array.isArray(children) ? children : [children]]);
|
|
16598
|
+
});
|
|
16585
16599
|
//#endregion
|
|
16586
|
-
//#region ../../node_modules/.bun/lucide-react@0.
|
|
16600
|
+
//#region ../../node_modules/.bun/lucide-react@1.0.1+b1ab299f0a400331/node_modules/lucide-react/dist/esm/createLucideIcon.js
|
|
16587
16601
|
/**
|
|
16588
|
-
* @license lucide-react
|
|
16602
|
+
* @license lucide-react v1.0.1 - ISC
|
|
16589
16603
|
*
|
|
16590
16604
|
* This source code is licensed under the ISC license.
|
|
16591
16605
|
* See the LICENSE file in the root directory of this source tree.
|
|
@@ -28355,7 +28369,7 @@ var CodeDefault = ({ children }) => /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
|
28355
28369
|
}, `line-${index}-${line.slice(0, 10)}`)) : children })
|
|
28356
28370
|
})
|
|
28357
28371
|
});
|
|
28358
|
-
var CodeBlockShiki = (0, import_react.lazy)(() => __vitePreload(() => import("./CodeBlockShiki-
|
|
28372
|
+
var CodeBlockShiki = (0, import_react.lazy)(() => __vitePreload(() => import("./CodeBlockShiki-CjD7FtGt.js").then((mod) => ({ default: mod.CodeBlockShiki })), __vite__mapDeps([5,1,6,7,4])));
|
|
28359
28373
|
var CodeBlock = ({ className, onChange, isEditable, children, lang, isDarkMode, ...props }) => /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", {
|
|
28360
28374
|
className: cn$2("flex w-full min-w-0 max-w-full overflow-x-auto", className),
|
|
28361
28375
|
...props,
|
|
@@ -42679,6 +42693,9 @@ var Modal = ({ children, isOpen, container, onClose, hasCloseButton = false, tit
|
|
|
42679
42693
|
};
|
|
42680
42694
|
//#endregion
|
|
42681
42695
|
//#region ../@intlayer/design-system/dist/esm/components/Table/Table.mjs
|
|
42696
|
+
var CHAR_WIDTH_REM = .55;
|
|
42697
|
+
var MIN_WIDTH_REM = 5;
|
|
42698
|
+
var MAX_WIDTH_REM = 30;
|
|
42682
42699
|
/**
|
|
42683
42700
|
* Table component that provides an enhanced table experience with modal expansion and collapsible content
|
|
42684
42701
|
*
|
|
@@ -42818,8 +42835,39 @@ var Modal = ({ children, isOpen, container, onClose, hasCloseButton = false, tit
|
|
|
42818
42835
|
*/
|
|
42819
42836
|
var Table = ({ className, isRollable = false, displayModal, ...props }) => {
|
|
42820
42837
|
const [isModalOpen, setIsModalOpen] = (0, import_react.useState)(false);
|
|
42838
|
+
const tableRef = (0, import_react.useRef)(null);
|
|
42839
|
+
const modalTableRef = (0, import_react.useRef)(null);
|
|
42840
|
+
(0, import_react.useEffect)(() => {
|
|
42841
|
+
if (!tableRef.current) return;
|
|
42842
|
+
const colLengths = [];
|
|
42843
|
+
Array.from(tableRef.current.querySelectorAll("tr")).forEach((row) => {
|
|
42844
|
+
Array.from(row.children).forEach((cell, index) => {
|
|
42845
|
+
const len = cell.textContent?.trim().length ?? 0;
|
|
42846
|
+
if (colLengths[index] === void 0 || len > colLengths[index]) colLengths[index] = len;
|
|
42847
|
+
});
|
|
42848
|
+
});
|
|
42849
|
+
const applyToTable = (table) => {
|
|
42850
|
+
const rows = Array.from(table.querySelectorAll("tr"));
|
|
42851
|
+
if (rows.length === 0) return;
|
|
42852
|
+
const applyColStyle = (el, index) => {
|
|
42853
|
+
const minRem = Math.min(MAX_WIDTH_REM, Math.max(MIN_WIDTH_REM, (colLengths[index] ?? 0) * CHAR_WIDTH_REM));
|
|
42854
|
+
el.style.minWidth = `${minRem}rem`;
|
|
42855
|
+
el.style.maxWidth = `${MAX_WIDTH_REM}rem`;
|
|
42856
|
+
};
|
|
42857
|
+
table.querySelectorAll("th").forEach((th, index) => {
|
|
42858
|
+
applyColStyle(th, index);
|
|
42859
|
+
});
|
|
42860
|
+
rows.forEach((row) => {
|
|
42861
|
+
row.querySelectorAll("td").forEach((td, index) => {
|
|
42862
|
+
applyColStyle(td, index);
|
|
42863
|
+
});
|
|
42864
|
+
});
|
|
42865
|
+
};
|
|
42866
|
+
applyToTable(tableRef.current);
|
|
42867
|
+
if (modalTableRef.current) applyToTable(modalTableRef.current);
|
|
42868
|
+
}, [props.children, isModalOpen]);
|
|
42821
42869
|
return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", {
|
|
42822
|
-
className: "relative",
|
|
42870
|
+
className: "relative overflow-hidden rounded-2xl bg-background pr-4 [corner-shape:squircle] supports-[corner-shape:squircle]:rounded-3xl",
|
|
42823
42871
|
children: [
|
|
42824
42872
|
displayModal && /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", {
|
|
42825
42873
|
className: "sticky top-48 z-10",
|
|
@@ -42840,7 +42888,8 @@ var Table = ({ className, isRollable = false, displayModal, ...props }) => {
|
|
|
42840
42888
|
isRollable,
|
|
42841
42889
|
className: "max-w-full overflow-x-auto",
|
|
42842
42890
|
children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)("table", {
|
|
42843
|
-
|
|
42891
|
+
ref: tableRef,
|
|
42892
|
+
className: cn$2("w-full table-auto text-left", className),
|
|
42844
42893
|
...props
|
|
42845
42894
|
})
|
|
42846
42895
|
}),
|
|
@@ -42849,9 +42898,11 @@ var Table = ({ className, isRollable = false, displayModal, ...props }) => {
|
|
|
42849
42898
|
onClose: () => setIsModalOpen(false),
|
|
42850
42899
|
size: ModalSize.XL,
|
|
42851
42900
|
hasCloseButton: true,
|
|
42901
|
+
isScrollable: true,
|
|
42852
42902
|
children: isModalOpen ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", {
|
|
42853
42903
|
className: "grid",
|
|
42854
42904
|
children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)("table", {
|
|
42905
|
+
ref: modalTableRef,
|
|
42855
42906
|
className: cn$2("min-w-full max-w-full table-auto text-left", className),
|
|
42856
42907
|
...props
|
|
42857
42908
|
})
|
|
@@ -42949,7 +43000,11 @@ var createLinkRenderer = (locale) => {
|
|
|
42949
43000
|
});
|
|
42950
43001
|
};
|
|
42951
43002
|
var PreRenderer = (props) => /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_jsx_runtime.Fragment, { children: props.children });
|
|
42952
|
-
var TableRenderer = (props) => /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Table, {
|
|
43003
|
+
var TableRenderer = (props) => /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Table, {
|
|
43004
|
+
isRollable: true,
|
|
43005
|
+
displayModal: true,
|
|
43006
|
+
...props
|
|
43007
|
+
});
|
|
42953
43008
|
var ThRenderer = ({ className, ...props }) => /* @__PURE__ */ (0, import_jsx_runtime.jsx)("th", {
|
|
42954
43009
|
className: cn$2("border-neutral border-b bg-neutral/10 p-4", className),
|
|
42955
43010
|
...props
|
|
@@ -43459,7 +43514,7 @@ var ContentEditorInput$1 = ({ children, onContentChange, disabled, validate, add
|
|
|
43459
43514
|
}, String(children));
|
|
43460
43515
|
};
|
|
43461
43516
|
//#endregion
|
|
43462
|
-
//#region ../../node_modules/.bun/@tanstack+query-core@5.
|
|
43517
|
+
//#region ../../node_modules/.bun/@tanstack+query-core@5.95.2/node_modules/@tanstack/query-core/build/modern/subscribable.js
|
|
43463
43518
|
var Subscribable = class {
|
|
43464
43519
|
constructor() {
|
|
43465
43520
|
this.listeners = /* @__PURE__ */ new Set();
|
|
@@ -43480,7 +43535,7 @@ var Subscribable = class {
|
|
|
43480
43535
|
onUnsubscribe() {}
|
|
43481
43536
|
};
|
|
43482
43537
|
//#endregion
|
|
43483
|
-
//#region ../../node_modules/.bun/@tanstack+query-core@5.
|
|
43538
|
+
//#region ../../node_modules/.bun/@tanstack+query-core@5.95.2/node_modules/@tanstack/query-core/build/modern/focusManager.js
|
|
43484
43539
|
var FocusManager = class extends Subscribable {
|
|
43485
43540
|
#focused;
|
|
43486
43541
|
#cleanup;
|
|
@@ -43533,7 +43588,7 @@ var FocusManager = class extends Subscribable {
|
|
|
43533
43588
|
};
|
|
43534
43589
|
var focusManager = new FocusManager();
|
|
43535
43590
|
//#endregion
|
|
43536
|
-
//#region ../../node_modules/.bun/@tanstack+query-core@5.
|
|
43591
|
+
//#region ../../node_modules/.bun/@tanstack+query-core@5.95.2/node_modules/@tanstack/query-core/build/modern/timeoutManager.js
|
|
43537
43592
|
var defaultTimeoutProvider = {
|
|
43538
43593
|
setTimeout: (callback, delay) => setTimeout(callback, delay),
|
|
43539
43594
|
clearTimeout: (timeoutId) => clearTimeout(timeoutId),
|
|
@@ -43564,7 +43619,7 @@ function systemSetTimeoutZero(callback) {
|
|
|
43564
43619
|
setTimeout(callback, 0);
|
|
43565
43620
|
}
|
|
43566
43621
|
//#endregion
|
|
43567
|
-
//#region ../../node_modules/.bun/@tanstack+query-core@5.
|
|
43622
|
+
//#region ../../node_modules/.bun/@tanstack+query-core@5.95.2/node_modules/@tanstack/query-core/build/modern/utils.js
|
|
43568
43623
|
var isServer$1 = typeof window === "undefined" || "Deno" in globalThis;
|
|
43569
43624
|
function noop() {}
|
|
43570
43625
|
function functionalUpdate(updater, input) {
|
|
@@ -43722,7 +43777,7 @@ function addConsumeAwareSignal(object, getSignal, onCancelled) {
|
|
|
43722
43777
|
return object;
|
|
43723
43778
|
}
|
|
43724
43779
|
//#endregion
|
|
43725
|
-
//#region ../../node_modules/.bun/@tanstack+query-core@5.
|
|
43780
|
+
//#region ../../node_modules/.bun/@tanstack+query-core@5.95.2/node_modules/@tanstack/query-core/build/modern/environmentManager.js
|
|
43726
43781
|
var environmentManager = /* @__PURE__ */ (() => {
|
|
43727
43782
|
let isServerFn = () => isServer$1;
|
|
43728
43783
|
return {
|
|
@@ -43735,7 +43790,7 @@ var environmentManager = /* @__PURE__ */ (() => {
|
|
|
43735
43790
|
};
|
|
43736
43791
|
})();
|
|
43737
43792
|
//#endregion
|
|
43738
|
-
//#region ../../node_modules/.bun/@tanstack+query-core@5.
|
|
43793
|
+
//#region ../../node_modules/.bun/@tanstack+query-core@5.95.2/node_modules/@tanstack/query-core/build/modern/thenable.js
|
|
43739
43794
|
function pendingThenable() {
|
|
43740
43795
|
let resolve;
|
|
43741
43796
|
let reject;
|
|
@@ -43767,7 +43822,7 @@ function pendingThenable() {
|
|
|
43767
43822
|
return thenable;
|
|
43768
43823
|
}
|
|
43769
43824
|
//#endregion
|
|
43770
|
-
//#region ../../node_modules/.bun/@tanstack+query-core@5.
|
|
43825
|
+
//#region ../../node_modules/.bun/@tanstack+query-core@5.95.2/node_modules/@tanstack/query-core/build/modern/notifyManager.js
|
|
43771
43826
|
var defaultScheduler = systemSetTimeoutZero;
|
|
43772
43827
|
function createNotifyManager() {
|
|
43773
43828
|
let queue = [];
|
|
@@ -43829,7 +43884,7 @@ function createNotifyManager() {
|
|
|
43829
43884
|
}
|
|
43830
43885
|
var notifyManager = createNotifyManager();
|
|
43831
43886
|
//#endregion
|
|
43832
|
-
//#region ../../node_modules/.bun/@tanstack+query-core@5.
|
|
43887
|
+
//#region ../../node_modules/.bun/@tanstack+query-core@5.95.2/node_modules/@tanstack/query-core/build/modern/onlineManager.js
|
|
43833
43888
|
var OnlineManager = class extends Subscribable {
|
|
43834
43889
|
#online = true;
|
|
43835
43890
|
#cleanup;
|
|
@@ -43877,7 +43932,7 @@ var OnlineManager = class extends Subscribable {
|
|
|
43877
43932
|
};
|
|
43878
43933
|
var onlineManager = new OnlineManager();
|
|
43879
43934
|
//#endregion
|
|
43880
|
-
//#region ../../node_modules/.bun/@tanstack+query-core@5.
|
|
43935
|
+
//#region ../../node_modules/.bun/@tanstack+query-core@5.95.2/node_modules/@tanstack/query-core/build/modern/retryer.js
|
|
43881
43936
|
function defaultRetryDelay(failureCount) {
|
|
43882
43937
|
return Math.min(1e3 * 2 ** failureCount, 3e4);
|
|
43883
43938
|
}
|
|
@@ -43983,7 +44038,7 @@ function createRetryer(config) {
|
|
|
43983
44038
|
};
|
|
43984
44039
|
}
|
|
43985
44040
|
//#endregion
|
|
43986
|
-
//#region ../../node_modules/.bun/@tanstack+query-core@5.
|
|
44041
|
+
//#region ../../node_modules/.bun/@tanstack+query-core@5.95.2/node_modules/@tanstack/query-core/build/modern/removable.js
|
|
43987
44042
|
var Removable = class {
|
|
43988
44043
|
#gcTimeout;
|
|
43989
44044
|
destroy() {
|
|
@@ -44006,7 +44061,7 @@ var Removable = class {
|
|
|
44006
44061
|
}
|
|
44007
44062
|
};
|
|
44008
44063
|
//#endregion
|
|
44009
|
-
//#region ../../node_modules/.bun/@tanstack+query-core@5.
|
|
44064
|
+
//#region ../../node_modules/.bun/@tanstack+query-core@5.95.2/node_modules/@tanstack/query-core/build/modern/query.js
|
|
44010
44065
|
var Query = class extends Removable {
|
|
44011
44066
|
#initialState;
|
|
44012
44067
|
#revertState;
|
|
@@ -44374,7 +44429,7 @@ function getDefaultState$1(options) {
|
|
|
44374
44429
|
};
|
|
44375
44430
|
}
|
|
44376
44431
|
//#endregion
|
|
44377
|
-
//#region ../../node_modules/.bun/@tanstack+query-core@5.
|
|
44432
|
+
//#region ../../node_modules/.bun/@tanstack+query-core@5.95.2/node_modules/@tanstack/query-core/build/modern/queryObserver.js
|
|
44378
44433
|
var QueryObserver = class extends Subscribable {
|
|
44379
44434
|
constructor(client, options) {
|
|
44380
44435
|
super();
|
|
@@ -44717,7 +44772,7 @@ function shouldAssignObserverCurrentProperties(observer, optimisticResult) {
|
|
|
44717
44772
|
return false;
|
|
44718
44773
|
}
|
|
44719
44774
|
//#endregion
|
|
44720
|
-
//#region ../../node_modules/.bun/@tanstack+query-core@5.
|
|
44775
|
+
//#region ../../node_modules/.bun/@tanstack+query-core@5.95.2/node_modules/@tanstack/query-core/build/modern/infiniteQueryBehavior.js
|
|
44721
44776
|
function infiniteQueryBehavior(pages) {
|
|
44722
44777
|
return { onFetch: (context, query) => {
|
|
44723
44778
|
const options = context.options;
|
|
@@ -44795,7 +44850,7 @@ function getPreviousPageParam(options, { pages, pageParams }) {
|
|
|
44795
44850
|
return pages.length > 0 ? options.getPreviousPageParam?.(pages[0], pages, pageParams[0], pageParams) : void 0;
|
|
44796
44851
|
}
|
|
44797
44852
|
//#endregion
|
|
44798
|
-
//#region ../../node_modules/.bun/@tanstack+query-core@5.
|
|
44853
|
+
//#region ../../node_modules/.bun/@tanstack+query-core@5.95.2/node_modules/@tanstack/query-core/build/modern/mutation.js
|
|
44799
44854
|
var Mutation = class extends Removable {
|
|
44800
44855
|
#client;
|
|
44801
44856
|
#observers;
|
|
@@ -45009,7 +45064,7 @@ function getDefaultState() {
|
|
|
45009
45064
|
};
|
|
45010
45065
|
}
|
|
45011
45066
|
//#endregion
|
|
45012
|
-
//#region ../../node_modules/.bun/@tanstack+query-core@5.
|
|
45067
|
+
//#region ../../node_modules/.bun/@tanstack+query-core@5.95.2/node_modules/@tanstack/query-core/build/modern/mutationCache.js
|
|
45013
45068
|
var MutationCache = class extends Subscribable {
|
|
45014
45069
|
constructor(config = {}) {
|
|
45015
45070
|
super();
|
|
@@ -45116,7 +45171,7 @@ function scopeFor(mutation) {
|
|
|
45116
45171
|
return mutation.options.scope?.id;
|
|
45117
45172
|
}
|
|
45118
45173
|
//#endregion
|
|
45119
|
-
//#region ../../node_modules/.bun/@tanstack+query-core@5.
|
|
45174
|
+
//#region ../../node_modules/.bun/@tanstack+query-core@5.95.2/node_modules/@tanstack/query-core/build/modern/mutationObserver.js
|
|
45120
45175
|
var MutationObserver$1 = class extends Subscribable {
|
|
45121
45176
|
#client;
|
|
45122
45177
|
#currentResult = void 0;
|
|
@@ -45220,7 +45275,7 @@ var MutationObserver$1 = class extends Subscribable {
|
|
|
45220
45275
|
}
|
|
45221
45276
|
};
|
|
45222
45277
|
//#endregion
|
|
45223
|
-
//#region ../../node_modules/.bun/@tanstack+query-core@5.
|
|
45278
|
+
//#region ../../node_modules/.bun/@tanstack+query-core@5.95.2/node_modules/@tanstack/query-core/build/modern/queryCache.js
|
|
45224
45279
|
var QueryCache = class extends Subscribable {
|
|
45225
45280
|
constructor(config = {}) {
|
|
45226
45281
|
super();
|
|
@@ -45312,7 +45367,7 @@ var QueryCache = class extends Subscribable {
|
|
|
45312
45367
|
}
|
|
45313
45368
|
};
|
|
45314
45369
|
//#endregion
|
|
45315
|
-
//#region ../../node_modules/.bun/@tanstack+query-core@5.
|
|
45370
|
+
//#region ../../node_modules/.bun/@tanstack+query-core@5.95.2/node_modules/@tanstack/query-core/build/modern/queryClient.js
|
|
45316
45371
|
var QueryClient = class {
|
|
45317
45372
|
#queryCache;
|
|
45318
45373
|
#mutationCache;
|
|
@@ -45553,7 +45608,7 @@ var QueryClient = class {
|
|
|
45553
45608
|
}
|
|
45554
45609
|
};
|
|
45555
45610
|
//#endregion
|
|
45556
|
-
//#region ../../node_modules/.bun/@tanstack+react-query@5.
|
|
45611
|
+
//#region ../../node_modules/.bun/@tanstack+react-query@5.95.2+b1ab299f0a400331/node_modules/@tanstack/react-query/build/modern/QueryClientProvider.js
|
|
45557
45612
|
var QueryClientContext = import_react.createContext(void 0);
|
|
45558
45613
|
var useQueryClient = (queryClient) => {
|
|
45559
45614
|
const client = import_react.useContext(QueryClientContext);
|
|
@@ -45574,12 +45629,12 @@ var QueryClientProvider = ({ client, children }) => {
|
|
|
45574
45629
|
});
|
|
45575
45630
|
};
|
|
45576
45631
|
//#endregion
|
|
45577
|
-
//#region ../../node_modules/.bun/@tanstack+react-query@5.
|
|
45632
|
+
//#region ../../node_modules/.bun/@tanstack+react-query@5.95.2+b1ab299f0a400331/node_modules/@tanstack/react-query/build/modern/IsRestoringProvider.js
|
|
45578
45633
|
var IsRestoringContext = import_react.createContext(false);
|
|
45579
45634
|
var useIsRestoring = () => import_react.useContext(IsRestoringContext);
|
|
45580
45635
|
IsRestoringContext.Provider;
|
|
45581
45636
|
//#endregion
|
|
45582
|
-
//#region ../../node_modules/.bun/@tanstack+react-query@5.
|
|
45637
|
+
//#region ../../node_modules/.bun/@tanstack+react-query@5.95.2+b1ab299f0a400331/node_modules/@tanstack/react-query/build/modern/QueryErrorResetBoundary.js
|
|
45583
45638
|
function createValue() {
|
|
45584
45639
|
let isReset = false;
|
|
45585
45640
|
return {
|
|
@@ -45597,7 +45652,7 @@ function createValue() {
|
|
|
45597
45652
|
var QueryErrorResetBoundaryContext = import_react.createContext(createValue());
|
|
45598
45653
|
var useQueryErrorResetBoundary = () => import_react.useContext(QueryErrorResetBoundaryContext);
|
|
45599
45654
|
//#endregion
|
|
45600
|
-
//#region ../../node_modules/.bun/@tanstack+react-query@5.
|
|
45655
|
+
//#region ../../node_modules/.bun/@tanstack+react-query@5.95.2+b1ab299f0a400331/node_modules/@tanstack/react-query/build/modern/errorBoundaryUtils.js
|
|
45601
45656
|
var ensurePreventErrorBoundaryRetry = (options, errorResetBoundary, query) => {
|
|
45602
45657
|
const throwOnError = query?.state.error && typeof options.throwOnError === "function" ? shouldThrowError(options.throwOnError, [query.state.error, query]) : options.throwOnError;
|
|
45603
45658
|
if (options.suspense || options.experimental_prefetchInRender || throwOnError) {
|
|
@@ -45613,7 +45668,7 @@ var getHasError = ({ result, errorResetBoundary, throwOnError, query, suspense }
|
|
|
45613
45668
|
return result.isError && !errorResetBoundary.isReset() && !result.isFetching && query && (suspense && result.data === void 0 || shouldThrowError(throwOnError, [result.error, query]));
|
|
45614
45669
|
};
|
|
45615
45670
|
//#endregion
|
|
45616
|
-
//#region ../../node_modules/.bun/@tanstack+react-query@5.
|
|
45671
|
+
//#region ../../node_modules/.bun/@tanstack+react-query@5.95.2+b1ab299f0a400331/node_modules/@tanstack/react-query/build/modern/suspense.js
|
|
45617
45672
|
var ensureSuspenseTimers = (defaultedOptions) => {
|
|
45618
45673
|
if (defaultedOptions.suspense) {
|
|
45619
45674
|
const MIN_SUSPENSE_TIME_MS = 1e3;
|
|
@@ -45629,7 +45684,7 @@ var fetchOptimistic = (defaultedOptions, observer, errorResetBoundary) => observ
|
|
|
45629
45684
|
errorResetBoundary.clearReset();
|
|
45630
45685
|
});
|
|
45631
45686
|
//#endregion
|
|
45632
|
-
//#region ../../node_modules/.bun/@tanstack+react-query@5.
|
|
45687
|
+
//#region ../../node_modules/.bun/@tanstack+react-query@5.95.2+b1ab299f0a400331/node_modules/@tanstack/react-query/build/modern/useBaseQuery.js
|
|
45633
45688
|
function useBaseQuery(options, Observer, queryClient) {
|
|
45634
45689
|
const isRestoring = useIsRestoring();
|
|
45635
45690
|
const errorResetBoundary = useQueryErrorResetBoundary();
|
|
@@ -45668,12 +45723,12 @@ function useBaseQuery(options, Observer, queryClient) {
|
|
|
45668
45723
|
return !defaultedOptions.notifyOnChangeProps ? observer.trackResult(result) : result;
|
|
45669
45724
|
}
|
|
45670
45725
|
//#endregion
|
|
45671
|
-
//#region ../../node_modules/.bun/@tanstack+react-query@5.
|
|
45726
|
+
//#region ../../node_modules/.bun/@tanstack+react-query@5.95.2+b1ab299f0a400331/node_modules/@tanstack/react-query/build/modern/useQuery.js
|
|
45672
45727
|
function useQuery(options, queryClient) {
|
|
45673
45728
|
return useBaseQuery(options, QueryObserver, queryClient);
|
|
45674
45729
|
}
|
|
45675
45730
|
//#endregion
|
|
45676
|
-
//#region ../../node_modules/.bun/@tanstack+react-query@5.
|
|
45731
|
+
//#region ../../node_modules/.bun/@tanstack+react-query@5.95.2+b1ab299f0a400331/node_modules/@tanstack/react-query/build/modern/useMutation.js
|
|
45677
45732
|
function useMutation(options, queryClient) {
|
|
45678
45733
|
const client = useQueryClient(queryClient);
|
|
45679
45734
|
const [observer] = import_react.useState(() => new MutationObserver$1(client, options));
|
|
@@ -45909,7 +45964,8 @@ var getAiAPI = (authAPIOptions = {}, intlayerConfig) => {
|
|
|
45909
45964
|
let errorMessage = "An error occurred";
|
|
45910
45965
|
try {
|
|
45911
45966
|
const errorData = await response.json();
|
|
45912
|
-
|
|
45967
|
+
const errorObj = errorData.error ?? errorData;
|
|
45968
|
+
errorMessage = JSON.stringify(errorObj) ?? "An error occurred";
|
|
45913
45969
|
} catch {
|
|
45914
45970
|
try {
|
|
45915
45971
|
const errorText = await response.text();
|
|
@@ -46929,7 +46985,7 @@ function defineErrorCodes(codes) {
|
|
|
46929
46985
|
}]));
|
|
46930
46986
|
}
|
|
46931
46987
|
//#endregion
|
|
46932
|
-
//#region ../../node_modules/.bun/@better-auth+passkey@1.5.5+
|
|
46988
|
+
//#region ../../node_modules/.bun/@better-auth+passkey@1.5.5+06b9efb931663ad4/node_modules/@better-auth/passkey/dist/error-codes-Dvu2mv33.mjs
|
|
46933
46989
|
var PASSKEY_ERROR_CODES = defineErrorCodes({
|
|
46934
46990
|
CHALLENGE_NOT_FOUND: "Challenge not found",
|
|
46935
46991
|
YOU_ARE_NOT_ALLOWED_TO_REGISTER_THIS_PASSKEY: "You are not allowed to register this passkey",
|
|
@@ -47391,7 +47447,7 @@ async function startAuthentication(options) {
|
|
|
47391
47447
|
};
|
|
47392
47448
|
}
|
|
47393
47449
|
//#endregion
|
|
47394
|
-
//#region ../../node_modules/.bun/better-auth@1.5.5+
|
|
47450
|
+
//#region ../../node_modules/.bun/better-auth@1.5.5+e56975f313122268/node_modules/better-auth/dist/client/broadcast-channel.mjs
|
|
47395
47451
|
var kBroadcastChannel = Symbol.for("better-auth:broadcast-channel");
|
|
47396
47452
|
var now$1 = () => Math.floor(Date.now() / 1e3);
|
|
47397
47453
|
var WindowBroadcastChannel = class {
|
|
@@ -47434,7 +47490,7 @@ function getGlobalBroadcastChannel(name = "better-auth.message") {
|
|
|
47434
47490
|
return globalThis[kBroadcastChannel];
|
|
47435
47491
|
}
|
|
47436
47492
|
//#endregion
|
|
47437
|
-
//#region ../../node_modules/.bun/better-auth@1.5.5+
|
|
47493
|
+
//#region ../../node_modules/.bun/better-auth@1.5.5+e56975f313122268/node_modules/better-auth/dist/client/focus-manager.mjs
|
|
47438
47494
|
var kFocusManager = Symbol.for("better-auth:focus-manager");
|
|
47439
47495
|
var WindowFocusManager = class {
|
|
47440
47496
|
listeners = /* @__PURE__ */ new Set();
|
|
@@ -47463,7 +47519,7 @@ function getGlobalFocusManager() {
|
|
|
47463
47519
|
return globalThis[kFocusManager];
|
|
47464
47520
|
}
|
|
47465
47521
|
//#endregion
|
|
47466
|
-
//#region ../../node_modules/.bun/better-auth@1.5.5+
|
|
47522
|
+
//#region ../../node_modules/.bun/better-auth@1.5.5+e56975f313122268/node_modules/better-auth/dist/client/online-manager.mjs
|
|
47467
47523
|
var kOnlineManager = Symbol.for("better-auth:online-manager");
|
|
47468
47524
|
var WindowOnlineManager = class {
|
|
47469
47525
|
listeners = /* @__PURE__ */ new Set();
|
|
@@ -47495,7 +47551,7 @@ function getGlobalOnlineManager() {
|
|
|
47495
47551
|
return globalThis[kOnlineManager];
|
|
47496
47552
|
}
|
|
47497
47553
|
//#endregion
|
|
47498
|
-
//#region ../../node_modules/.bun/better-auth@1.5.5+
|
|
47554
|
+
//#region ../../node_modules/.bun/better-auth@1.5.5+e56975f313122268/node_modules/better-auth/dist/client/parser.mjs
|
|
47499
47555
|
var PROTO_POLLUTION_PATTERNS = {
|
|
47500
47556
|
proto: /"(?:_|\\u0{2}5[Ff]){2}(?:p|\\u0{2}70)(?:r|\\u0{2}72)(?:o|\\u0{2}6[Ff])(?:t|\\u0{2}74)(?:o|\\u0{2}6[Ff])(?:_|\\u0{2}5[Ff]){2}"\s*:/,
|
|
47501
47557
|
constructor: /"(?:c|\\u0063)(?:o|\\u006[Ff])(?:n|\\u006[Ee])(?:s|\\u0073)(?:t|\\u0074)(?:r|\\u0072)(?:u|\\u0075)(?:c|\\u0063)(?:t|\\u0074)(?:o|\\u006[Ff])(?:r|\\u0072)"\s*:/,
|
|
@@ -47677,7 +47733,7 @@ var onMount = ($store, initialize) => {
|
|
|
47677
47733
|
});
|
|
47678
47734
|
};
|
|
47679
47735
|
//#endregion
|
|
47680
|
-
//#region ../../node_modules/.bun/better-auth@1.5.5+
|
|
47736
|
+
//#region ../../node_modules/.bun/better-auth@1.5.5+e56975f313122268/node_modules/better-auth/dist/client/query.mjs
|
|
47681
47737
|
var isServer = () => typeof window === "undefined";
|
|
47682
47738
|
var useAuthQuery = (initializedAtom, path, $fetch, options) => {
|
|
47683
47739
|
const value = /* @__PURE__ */ atom({
|
|
@@ -47771,7 +47827,7 @@ var useAuthQuery = (initializedAtom, path, $fetch, options) => {
|
|
|
47771
47827
|
return value;
|
|
47772
47828
|
};
|
|
47773
47829
|
//#endregion
|
|
47774
|
-
//#region ../../node_modules/.bun/better-auth@1.5.5+
|
|
47830
|
+
//#region ../../node_modules/.bun/better-auth@1.5.5+e56975f313122268/node_modules/better-auth/dist/client/session-refresh.mjs
|
|
47775
47831
|
var now = () => Math.floor(Date.now() / 1e3);
|
|
47776
47832
|
/**
|
|
47777
47833
|
* Rate limit: don't refetch on focus if a session request was made within this many seconds
|
|
@@ -47970,7 +48026,7 @@ var BetterAuthError = class extends Error {
|
|
|
47970
48026
|
}
|
|
47971
48027
|
};
|
|
47972
48028
|
//#endregion
|
|
47973
|
-
//#region ../../node_modules/.bun/better-auth@1.5.5+
|
|
48029
|
+
//#region ../../node_modules/.bun/better-auth@1.5.5+e56975f313122268/node_modules/better-auth/dist/utils/url.mjs
|
|
47974
48030
|
function checkHasPath(url) {
|
|
47975
48031
|
try {
|
|
47976
48032
|
return (new URL(url).pathname.replace(/\/+$/, "") || "/") !== "/";
|
|
@@ -48042,7 +48098,7 @@ function getOrigin(url) {
|
|
|
48042
48098
|
}
|
|
48043
48099
|
}
|
|
48044
48100
|
//#endregion
|
|
48045
|
-
//#region ../../node_modules/.bun/better-auth@1.5.5+
|
|
48101
|
+
//#region ../../node_modules/.bun/better-auth@1.5.5+e56975f313122268/node_modules/better-auth/dist/client/fetch-plugins.mjs
|
|
48046
48102
|
var redirectPlugin = {
|
|
48047
48103
|
id: "redirect",
|
|
48048
48104
|
name: "Redirect",
|
|
@@ -48057,7 +48113,7 @@ var redirectPlugin = {
|
|
|
48057
48113
|
} }
|
|
48058
48114
|
};
|
|
48059
48115
|
//#endregion
|
|
48060
|
-
//#region ../../node_modules/.bun/better-auth@1.5.5+
|
|
48116
|
+
//#region ../../node_modules/.bun/better-auth@1.5.5+e56975f313122268/node_modules/better-auth/dist/client/session-atom.mjs
|
|
48061
48117
|
function getSessionAtom($fetch, options) {
|
|
48062
48118
|
const $signal = /* @__PURE__ */ atom(false);
|
|
48063
48119
|
const session = useAuthQuery($signal, "/get-session", $fetch, { method: "GET" });
|
|
@@ -48516,7 +48572,7 @@ var betterFetch = async (url, options) => {
|
|
|
48516
48572
|
};
|
|
48517
48573
|
};
|
|
48518
48574
|
//#endregion
|
|
48519
|
-
//#region ../../node_modules/.bun/better-auth@1.5.5+
|
|
48575
|
+
//#region ../../node_modules/.bun/better-auth@1.5.5+e56975f313122268/node_modules/better-auth/dist/client/config.mjs
|
|
48520
48576
|
var resolvePublicAuthUrl = (basePath) => {
|
|
48521
48577
|
if (typeof process === "undefined") return void 0;
|
|
48522
48578
|
const path = basePath ?? "/api/auth";
|
|
@@ -48614,12 +48670,12 @@ var getClientConfig = (options, loadEnv) => {
|
|
|
48614
48670
|
};
|
|
48615
48671
|
};
|
|
48616
48672
|
//#endregion
|
|
48617
|
-
//#region ../../node_modules/.bun/better-auth@1.5.5+
|
|
48673
|
+
//#region ../../node_modules/.bun/better-auth@1.5.5+e56975f313122268/node_modules/better-auth/dist/utils/is-atom.mjs
|
|
48618
48674
|
function isAtom(value) {
|
|
48619
48675
|
return typeof value === "object" && value !== null && "get" in value && typeof value.get === "function" && "lc" in value && typeof value.lc === "number";
|
|
48620
48676
|
}
|
|
48621
48677
|
//#endregion
|
|
48622
|
-
//#region ../../node_modules/.bun/better-auth@1.5.5+
|
|
48678
|
+
//#region ../../node_modules/.bun/better-auth@1.5.5+e56975f313122268/node_modules/better-auth/dist/client/proxy.mjs
|
|
48623
48679
|
function getMethod(path, knownPathMethods, args) {
|
|
48624
48680
|
const method = knownPathMethods[path];
|
|
48625
48681
|
const { fetchOptions, query: _query, ...body } = args || {};
|
|
@@ -48699,7 +48755,7 @@ function capitalizeFirstLetter(str) {
|
|
|
48699
48755
|
return str.charAt(0).toUpperCase() + str.slice(1);
|
|
48700
48756
|
}
|
|
48701
48757
|
//#endregion
|
|
48702
|
-
//#region ../../node_modules/.bun/better-auth@1.5.5+
|
|
48758
|
+
//#region ../../node_modules/.bun/better-auth@1.5.5+e56975f313122268/node_modules/better-auth/dist/client/vanilla.mjs
|
|
48703
48759
|
function createAuthClient(options) {
|
|
48704
48760
|
const { pluginPathMethods, pluginsActions, pluginsAtoms, $fetch, atomListeners, $store } = getClientConfig(options);
|
|
48705
48761
|
const resolvedHooks = {};
|
|
@@ -48712,7 +48768,7 @@ function createAuthClient(options) {
|
|
|
48712
48768
|
}, $fetch, pluginPathMethods, pluginsAtoms, atomListeners);
|
|
48713
48769
|
}
|
|
48714
48770
|
//#endregion
|
|
48715
|
-
//#region ../../node_modules/.bun/@better-auth+passkey@1.5.5+
|
|
48771
|
+
//#region ../../node_modules/.bun/@better-auth+passkey@1.5.5+06b9efb931663ad4/node_modules/@better-auth/passkey/dist/client.mjs
|
|
48716
48772
|
var getPasskeyActions = ($fetch, { $listPasskeys, $store }) => {
|
|
48717
48773
|
const signInPasskey = async (opts, options) => {
|
|
48718
48774
|
const response = await $fetch("/passkey/generate-authenticate-options", {
|
|
@@ -48854,7 +48910,7 @@ var passkeyClient = () => {
|
|
|
48854
48910
|
};
|
|
48855
48911
|
};
|
|
48856
48912
|
//#endregion
|
|
48857
|
-
//#region ../../node_modules/.bun/@better-auth+sso@1.5.5+
|
|
48913
|
+
//#region ../../node_modules/.bun/@better-auth+sso@1.5.5+c13bcbbab381f6fe/node_modules/@better-auth/sso/dist/client.mjs
|
|
48858
48914
|
var ssoClient = (options) => {
|
|
48859
48915
|
return {
|
|
48860
48916
|
id: "sso-client",
|
|
@@ -48866,7 +48922,7 @@ var ssoClient = (options) => {
|
|
|
48866
48922
|
};
|
|
48867
48923
|
};
|
|
48868
48924
|
//#endregion
|
|
48869
|
-
//#region ../../node_modules/.bun/better-auth@1.5.5+
|
|
48925
|
+
//#region ../../node_modules/.bun/better-auth@1.5.5+e56975f313122268/node_modules/better-auth/dist/plugins/magic-link/client.mjs
|
|
48870
48926
|
var magicLinkClient = () => {
|
|
48871
48927
|
return {
|
|
48872
48928
|
id: "magic-link",
|
|
@@ -48874,7 +48930,7 @@ var magicLinkClient = () => {
|
|
|
48874
48930
|
};
|
|
48875
48931
|
};
|
|
48876
48932
|
//#endregion
|
|
48877
|
-
//#region ../../node_modules/.bun/better-auth@1.5.5+
|
|
48933
|
+
//#region ../../node_modules/.bun/better-auth@1.5.5+e56975f313122268/node_modules/better-auth/dist/plugins/two-factor/error-code.mjs
|
|
48878
48934
|
var TWO_FACTOR_ERROR_CODES = defineErrorCodes({
|
|
48879
48935
|
OTP_NOT_ENABLED: "OTP not enabled",
|
|
48880
48936
|
OTP_HAS_EXPIRED: "OTP has expired",
|
|
@@ -48887,7 +48943,7 @@ var TWO_FACTOR_ERROR_CODES = defineErrorCodes({
|
|
|
48887
48943
|
INVALID_TWO_FACTOR_COOKIE: "Invalid two factor cookie"
|
|
48888
48944
|
});
|
|
48889
48945
|
//#endregion
|
|
48890
|
-
//#region ../../node_modules/.bun/better-auth@1.5.5+
|
|
48946
|
+
//#region ../../node_modules/.bun/better-auth@1.5.5+e56975f313122268/node_modules/better-auth/dist/plugins/two-factor/client.mjs
|
|
48891
48947
|
var twoFactorClient = (options) => {
|
|
48892
48948
|
return {
|
|
48893
48949
|
id: "two-factor",
|
|
@@ -58446,10 +58502,18 @@ var useToastEvents = () => {
|
|
|
58446
58502
|
[(() => {
|
|
58447
58503
|
try {
|
|
58448
58504
|
if (typeof error === "string") return JSON.parse(error);
|
|
58505
|
+
if (error instanceof Error) return JSON.parse(error.message);
|
|
58449
58506
|
} catch (_) {}
|
|
58450
58507
|
return error;
|
|
58451
58508
|
})()].flat().forEach((err) => {
|
|
58452
58509
|
const apiError = err?.error ?? err;
|
|
58510
|
+
if (apiError?.code === "RATE_LIMIT_EXCEEDED_UNAUTHENTICATED") {
|
|
58511
|
+
toast({
|
|
58512
|
+
title: apiError.message,
|
|
58513
|
+
variant: "error"
|
|
58514
|
+
});
|
|
58515
|
+
return;
|
|
58516
|
+
}
|
|
58453
58517
|
toast({
|
|
58454
58518
|
title: formatErrorCode(apiError?.title ?? err?.title ?? "Error"),
|
|
58455
58519
|
description: apiError?.message ?? err?.message ?? String(apiError ?? "An error occurred"),
|
|
@@ -1636,7 +1636,7 @@ var createRules = (createElement, ctx, options, footnotes, refs, attrStringToMap
|
|
|
1636
1636
|
},
|
|
1637
1637
|
_render(node, output, state = {}) {
|
|
1638
1638
|
const table = node;
|
|
1639
|
-
const getStyle = (i) => table.align[i] ? { textAlign: table.align[i] } : {};
|
|
1639
|
+
const getStyle = (i) => table.align[i] && table.align[i] !== "left" ? { textAlign: table.align[i] } : {};
|
|
1640
1640
|
return createElement("table", { key: state.key }, createElement("thead", null, createElement("tr", null, ...table.header.map((c, i) => createElement("th", {
|
|
1641
1641
|
key: i,
|
|
1642
1642
|
style: getStyle(i)
|
|
@@ -1665,7 +1665,11 @@ var createRules = (createElement, ctx, options, footnotes, refs, attrStringToMap
|
|
|
1665
1665
|
_order: Priority.MIN,
|
|
1666
1666
|
_parse(capture) {
|
|
1667
1667
|
const text = capture[0];
|
|
1668
|
-
return { text: text.indexOf("&") === -1 ? text : text.replace(HTML_CHAR_CODE_R, (f, i) =>
|
|
1668
|
+
return { text: text.indexOf("&") === -1 ? text : text.replace(HTML_CHAR_CODE_R, (f, i) => {
|
|
1669
|
+
if (i.startsWith("#x")) return String.fromCharCode(parseInt(i.slice(2), 16));
|
|
1670
|
+
if (i.startsWith("#")) return String.fromCharCode(parseInt(i.slice(1), 10));
|
|
1671
|
+
return namedCodesToUnicode[i] || f;
|
|
1672
|
+
}) };
|
|
1669
1673
|
},
|
|
1670
1674
|
_render(node) {
|
|
1671
1675
|
return node.text;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import "./chunk-C0u3WHrm.js";
|
|
2
|
-
import "./markdown-
|
|
3
|
-
import { r as useMarkdownContext } from "./index-
|
|
2
|
+
import "./markdown-B_VAQu_B.js";
|
|
3
|
+
import { r as useMarkdownContext } from "./index-C5gyL3b-.js";
|
|
4
4
|
//#region ../react-intlayer/dist/esm/markdown/MarkdownRendererPlugin.mjs
|
|
5
5
|
var MarkdownRendererPlugin = (props) => {
|
|
6
6
|
const { children, options, components } = props;
|
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-C5gyL3b-.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="modulepreload" crossorigin href="/assets/markdown-
|
|
13
|
+
<link rel="modulepreload" crossorigin href="/assets/markdown-B_VAQu_B.js">
|
|
14
14
|
<link rel="stylesheet" crossorigin href="/assets/index-SO-phafd.css">
|
|
15
15
|
</head>
|
|
16
16
|
<body>
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "intlayer-editor",
|
|
3
|
-
"version": "8.4.
|
|
3
|
+
"version": "8.4.10",
|
|
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,19 +93,19 @@
|
|
|
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.4.
|
|
97
|
-
"@intlayer/config": "8.4.
|
|
98
|
-
"@intlayer/unmerged-dictionaries-entry": "8.4.
|
|
96
|
+
"@intlayer/chokidar": "8.4.10",
|
|
97
|
+
"@intlayer/config": "8.4.10",
|
|
98
|
+
"@intlayer/unmerged-dictionaries-entry": "8.4.10",
|
|
99
99
|
"fastify": "5.8.2",
|
|
100
|
-
"fastify-intlayer": "8.4.
|
|
100
|
+
"fastify-intlayer": "8.4.10",
|
|
101
101
|
"mime": "4.1.0"
|
|
102
102
|
},
|
|
103
103
|
"devDependencies": {
|
|
104
|
-
"@intlayer/design-system": "8.4.
|
|
105
|
-
"@intlayer/editor-react": "8.4.
|
|
106
|
-
"@intlayer/types": "8.4.
|
|
104
|
+
"@intlayer/design-system": "8.4.10",
|
|
105
|
+
"@intlayer/editor-react": "8.4.10",
|
|
106
|
+
"@intlayer/types": "8.4.10",
|
|
107
107
|
"@tailwindcss/vite": "4.2.2",
|
|
108
|
-
"@tanstack/react-query": "5.
|
|
108
|
+
"@tanstack/react-query": "5.95.2",
|
|
109
109
|
"@types/node": "25.5.0",
|
|
110
110
|
"@types/react": "19.2.14",
|
|
111
111
|
"@types/react-dom": "19.2.3",
|
|
@@ -117,19 +117,19 @@
|
|
|
117
117
|
"framer-motion": "12.38.0",
|
|
118
118
|
"fuse.js": "7.1.0",
|
|
119
119
|
"globals": "17.4.0",
|
|
120
|
-
"intlayer": "8.4.
|
|
121
|
-
"lucide-react": "0.
|
|
120
|
+
"intlayer": "8.4.10",
|
|
121
|
+
"lucide-react": "1.0.1",
|
|
122
122
|
"react": "19.2.4",
|
|
123
123
|
"react-dom": "19.2.4",
|
|
124
|
-
"react-intlayer": "8.4.
|
|
124
|
+
"react-intlayer": "8.4.10",
|
|
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
|
-
"typescript": "
|
|
130
|
-
"vite": "8.0.
|
|
131
|
-
"vite-intlayer": "8.4.
|
|
132
|
-
"vitest": "4.1.
|
|
129
|
+
"typescript": "6.0.2",
|
|
130
|
+
"vite": "8.0.2",
|
|
131
|
+
"vite-intlayer": "8.4.10",
|
|
132
|
+
"vitest": "4.1.1"
|
|
133
133
|
},
|
|
134
134
|
"engines": {
|
|
135
135
|
"node": ">=18.0.0"
|
|
@@ -3,8 +3,10 @@ const require_runtime = require('../_virtual/_rolldown/runtime.cjs');
|
|
|
3
3
|
const require_utils_responseData = require('../utils/responseData.cjs');
|
|
4
4
|
let _intlayer_config_node = require("@intlayer/config/node");
|
|
5
5
|
let _intlayer_chokidar_build = require("@intlayer/chokidar/build");
|
|
6
|
+
let _intlayer_config_utils = require("@intlayer/config/utils");
|
|
6
7
|
let _intlayer_unmerged_dictionaries_entry = require("@intlayer/unmerged-dictionaries-entry");
|
|
7
8
|
let fastify_intlayer = require("fastify-intlayer");
|
|
9
|
+
let path = require("path");
|
|
8
10
|
|
|
9
11
|
//#region src/controllers/dictionary.controller.ts
|
|
10
12
|
/**
|
|
@@ -36,7 +38,9 @@ const getDictionaries = async (_req, res) => {
|
|
|
36
38
|
const writeContentDeclaration = async (req, res) => {
|
|
37
39
|
try {
|
|
38
40
|
const dictionaryData = req.body.dictionary;
|
|
39
|
-
const
|
|
41
|
+
const config = (0, _intlayer_config_node.getConfiguration)();
|
|
42
|
+
const result = await (0, _intlayer_chokidar_build.writeContentDeclaration)(dictionaryData, config);
|
|
43
|
+
(0, _intlayer_config_utils.clearModuleCache)((0, path.join)(config.system.mainDir, `unmerged_dictionaries.cjs`));
|
|
40
44
|
let description = "";
|
|
41
45
|
switch (result.status) {
|
|
42
46
|
case "created":
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"dictionary.controller.cjs","names":["formatResponse"],"sources":["../../src/controllers/dictionary.controller.ts"],"sourcesContent":["import {\n type DictionaryStatus,\n writeContentDeclaration as writeContentDeclarationEditor,\n} from '@intlayer/chokidar/build';\nimport { getConfiguration } from '@intlayer/config/node';\nimport type { Dictionary } from '@intlayer/types/dictionary';\nimport {\n getUnmergedDictionaries,\n type UnmergedDictionaries,\n} from '@intlayer/unmerged-dictionaries-entry';\nimport { formatResponse, type ResponseData } from '@utils/responseData';\nimport type { FastifyReply, FastifyRequest } from 'fastify';\nimport { t } from 'fastify-intlayer';\n\nexport type GetEditorDictionariesResult = ResponseData<UnmergedDictionaries>;\n\n/**\n * Get the Intlayer configuration\n */\nexport const getDictionaries = async (\n _req: FastifyRequest,\n res: FastifyReply\n): Promise<void> => {\n try {\n const formattedResponse = formatResponse<UnmergedDictionaries>({\n data: getUnmergedDictionaries(),\n });\n\n return res.send(formattedResponse);\n } catch (err) {\n const errorMessage = (err as { message?: string; status?: number }) ?? {\n message: 'Internal Server Error',\n status: 500,\n };\n\n const formattedErrorResponse = formatResponse<UnmergedDictionaries>({\n error: {\n message: errorMessage.message ?? 'Internal Server Error',\n code: 'INTERNAL_SERVER_ERROR',\n title: 'Internal Server Error',\n },\n status: errorMessage.status ?? 500,\n });\n\n return res.send(formattedErrorResponse);\n }\n};\n\nexport type WriteContentDeclarationBody = { dictionary: Dictionary };\ntype WriteContentDeclarationResultData = {\n status: DictionaryStatus;\n path: string;\n};\nexport type WriteContentDeclarationResult =\n ResponseData<WriteContentDeclarationResultData>;\n\n/**\n * Adds a new dictionary to the database.\n */\nexport const writeContentDeclaration = async (\n req: FastifyRequest<{ Body: WriteContentDeclarationBody }>,\n res: FastifyReply\n): Promise<void> => {\n try {\n const dictionaryData = req.body.dictionary;\n\n const config = getConfiguration();\n\n const result = await writeContentDeclarationEditor(dictionaryData, config);\n\n let description = '';\n\n switch (result.status) {\n case 'created': {\n description = t({\n en: 'Content declaration created successfully',\n fr: 'Déclaration de contenu créée avec succès',\n es: 'Declaración de contenido creada con éxito',\n });\n break;\n }\n\n case 'updated': {\n description = t({\n en: 'Content declaration updated successfully',\n fr: 'Déclaration de contenu mise à jour avec succès',\n es: 'Declaración de contenido actualizada con éxito',\n });\n break;\n }\n case 'reimported in JSON': {\n description = t({\n en: 'Content declaration reimported in JSON successfully',\n fr: 'Déclaration de contenu réimportée en JSON avec succès',\n es: 'Declaración de contenido reimportada en JSON con éxito',\n });\n break;\n }\n case 'new content file': {\n description = t({\n en: 'Content declaration new content file successfully',\n fr: 'Déclaration de contenu réimportée dans un nouveau emplacement avec succès',\n es: 'Declaración de contenido reimportada en un nuevo lugar con éxito',\n });\n break;\n }\n default: {\n description = t({\n en: 'Content declaration written successfully',\n fr: 'Déclaration de contenu écrite avec succès',\n es: 'Declaración de contenido escrita con éxito',\n });\n break;\n }\n }\n\n const formattedResponse = formatResponse<WriteContentDeclarationResultData>(\n {\n data: result,\n message: t({\n en: 'Content declaration written',\n fr: 'Déclaration de contenu écrite',\n es: 'Declaración de contenido escrita',\n }),\n description,\n }\n );\n\n return res.send(formattedResponse);\n } catch (err) {\n const errorMessage = (err as { message?: string; status?: number }) ?? {\n message: 'Internal Server Error',\n status: 500,\n };\n\n console.error(errorMessage);\n\n const formattedErrorResponse =\n formatResponse<WriteContentDeclarationResultData>({\n error: {\n message: errorMessage.message ?? 'Internal Server Error',\n code: 'INTERNAL_SERVER_ERROR',\n title: 'Internal Server Error',\n },\n status: errorMessage.status ?? 500,\n });\n\n return res.send(formattedErrorResponse);\n }\n};\n"],"mappings":"
|
|
1
|
+
{"version":3,"file":"dictionary.controller.cjs","names":["formatResponse"],"sources":["../../src/controllers/dictionary.controller.ts"],"sourcesContent":["import {\n type DictionaryStatus,\n writeContentDeclaration as writeContentDeclarationEditor,\n} from '@intlayer/chokidar/build';\nimport { getConfiguration } from '@intlayer/config/node';\nimport { clearModuleCache } from '@intlayer/config/utils';\nimport type { Dictionary } from '@intlayer/types/dictionary';\nimport {\n getUnmergedDictionaries,\n type UnmergedDictionaries,\n} from '@intlayer/unmerged-dictionaries-entry';\nimport { formatResponse, type ResponseData } from '@utils/responseData';\nimport type { FastifyReply, FastifyRequest } from 'fastify';\nimport { t } from 'fastify-intlayer';\nimport { join } from 'path';\n\nexport type GetEditorDictionariesResult = ResponseData<UnmergedDictionaries>;\n\n/**\n * Get the Intlayer configuration\n */\nexport const getDictionaries = async (\n _req: FastifyRequest,\n res: FastifyReply\n): Promise<void> => {\n try {\n const formattedResponse = formatResponse<UnmergedDictionaries>({\n data: getUnmergedDictionaries(),\n });\n\n return res.send(formattedResponse);\n } catch (err) {\n const errorMessage = (err as { message?: string; status?: number }) ?? {\n message: 'Internal Server Error',\n status: 500,\n };\n\n const formattedErrorResponse = formatResponse<UnmergedDictionaries>({\n error: {\n message: errorMessage.message ?? 'Internal Server Error',\n code: 'INTERNAL_SERVER_ERROR',\n title: 'Internal Server Error',\n },\n status: errorMessage.status ?? 500,\n });\n\n return res.send(formattedErrorResponse);\n }\n};\n\nexport type WriteContentDeclarationBody = { dictionary: Dictionary };\ntype WriteContentDeclarationResultData = {\n status: DictionaryStatus;\n path: string;\n};\nexport type WriteContentDeclarationResult =\n ResponseData<WriteContentDeclarationResultData>;\n\n/**\n * Adds a new dictionary to the database.\n */\nexport const writeContentDeclaration = async (\n req: FastifyRequest<{ Body: WriteContentDeclarationBody }>,\n res: FastifyReply\n): Promise<void> => {\n try {\n const dictionaryData = req.body.dictionary;\n\n const config = getConfiguration();\n\n const result = await writeContentDeclarationEditor(dictionaryData, config);\n\n // Clear cache to hot reload the dictionaries\n const dictionariesPath = join(\n config.system.mainDir,\n `unmerged_dictionaries.cjs`\n );\n clearModuleCache(dictionariesPath);\n\n let description = '';\n\n switch (result.status) {\n case 'created': {\n description = t({\n en: 'Content declaration created successfully',\n fr: 'Déclaration de contenu créée avec succès',\n es: 'Declaración de contenido creada con éxito',\n });\n break;\n }\n\n case 'updated': {\n description = t({\n en: 'Content declaration updated successfully',\n fr: 'Déclaration de contenu mise à jour avec succès',\n es: 'Declaración de contenido actualizada con éxito',\n });\n break;\n }\n case 'reimported in JSON': {\n description = t({\n en: 'Content declaration reimported in JSON successfully',\n fr: 'Déclaration de contenu réimportée en JSON avec succès',\n es: 'Declaración de contenido reimportada en JSON con éxito',\n });\n break;\n }\n case 'new content file': {\n description = t({\n en: 'Content declaration new content file successfully',\n fr: 'Déclaration de contenu réimportée dans un nouveau emplacement avec succès',\n es: 'Declaración de contenido reimportada en un nuevo lugar con éxito',\n });\n break;\n }\n default: {\n description = t({\n en: 'Content declaration written successfully',\n fr: 'Déclaration de contenu écrite avec succès',\n es: 'Declaración de contenido escrita con éxito',\n });\n break;\n }\n }\n\n const formattedResponse = formatResponse<WriteContentDeclarationResultData>(\n {\n data: result,\n message: t({\n en: 'Content declaration written',\n fr: 'Déclaration de contenu écrite',\n es: 'Declaración de contenido escrita',\n }),\n description,\n }\n );\n\n return res.send(formattedResponse);\n } catch (err) {\n const errorMessage = (err as { message?: string; status?: number }) ?? {\n message: 'Internal Server Error',\n status: 500,\n };\n\n console.error(errorMessage);\n\n const formattedErrorResponse =\n formatResponse<WriteContentDeclarationResultData>({\n error: {\n message: errorMessage.message ?? 'Internal Server Error',\n code: 'INTERNAL_SERVER_ERROR',\n title: 'Internal Server Error',\n },\n status: errorMessage.status ?? 500,\n });\n\n return res.send(formattedErrorResponse);\n }\n};\n"],"mappings":";;;;;;;;;;;;;;AAqBA,MAAa,kBAAkB,OAC7B,MACA,QACkB;AAClB,KAAI;EACF,MAAM,oBAAoBA,0CAAqC,EAC7D,0EAA+B,EAChC,CAAC;AAEF,SAAO,IAAI,KAAK,kBAAkB;UAC3B,KAAK;EACZ,MAAM,eAAgB,OAAiD;GACrE,SAAS;GACT,QAAQ;GACT;EAED,MAAM,yBAAyBA,0CAAqC;GAClE,OAAO;IACL,SAAS,aAAa,WAAW;IACjC,MAAM;IACN,OAAO;IACR;GACD,QAAQ,aAAa,UAAU;GAChC,CAAC;AAEF,SAAO,IAAI,KAAK,uBAAuB;;;;;;AAe3C,MAAa,0BAA0B,OACrC,KACA,QACkB;AAClB,KAAI;EACF,MAAM,iBAAiB,IAAI,KAAK;EAEhC,MAAM,sDAA2B;EAEjC,MAAM,SAAS,4DAAoC,gBAAgB,OAAO;AAO1E,8DAHE,OAAO,OAAO,SACd,4BACD,CACiC;EAElC,IAAI,cAAc;AAElB,UAAQ,OAAO,QAAf;GACE,KAAK;AACH,0CAAgB;KACd,IAAI;KACJ,IAAI;KACJ,IAAI;KACL,CAAC;AACF;GAGF,KAAK;AACH,0CAAgB;KACd,IAAI;KACJ,IAAI;KACJ,IAAI;KACL,CAAC;AACF;GAEF,KAAK;AACH,0CAAgB;KACd,IAAI;KACJ,IAAI;KACJ,IAAI;KACL,CAAC;AACF;GAEF,KAAK;AACH,0CAAgB;KACd,IAAI;KACJ,IAAI;KACJ,IAAI;KACL,CAAC;AACF;GAEF;AACE,0CAAgB;KACd,IAAI;KACJ,IAAI;KACJ,IAAI;KACL,CAAC;AACF;;EAIJ,MAAM,oBAAoBA,0CACxB;GACE,MAAM;GACN,iCAAW;IACT,IAAI;IACJ,IAAI;IACJ,IAAI;IACL,CAAC;GACF;GACD,CACF;AAED,SAAO,IAAI,KAAK,kBAAkB;UAC3B,KAAK;EACZ,MAAM,eAAgB,OAAiD;GACrE,SAAS;GACT,QAAQ;GACT;AAED,UAAQ,MAAM,aAAa;EAE3B,MAAM,yBACJA,0CAAkD;GAChD,OAAO;IACL,SAAS,aAAa,WAAW;IACjC,MAAM;IACN,OAAO;IACR;GACD,QAAQ,aAAa,UAAU;GAChC,CAAC;AAEJ,SAAO,IAAI,KAAK,uBAAuB"}
|
|
@@ -1,8 +1,10 @@
|
|
|
1
1
|
import { formatResponse } from "../utils/responseData.mjs";
|
|
2
2
|
import { getConfiguration } from "@intlayer/config/node";
|
|
3
3
|
import { writeContentDeclaration as writeContentDeclaration$1 } from "@intlayer/chokidar/build";
|
|
4
|
+
import { clearModuleCache } from "@intlayer/config/utils";
|
|
4
5
|
import { getUnmergedDictionaries } from "@intlayer/unmerged-dictionaries-entry";
|
|
5
6
|
import { t } from "fastify-intlayer";
|
|
7
|
+
import { join } from "path";
|
|
6
8
|
|
|
7
9
|
//#region src/controllers/dictionary.controller.ts
|
|
8
10
|
/**
|
|
@@ -34,7 +36,9 @@ const getDictionaries = async (_req, res) => {
|
|
|
34
36
|
const writeContentDeclaration = async (req, res) => {
|
|
35
37
|
try {
|
|
36
38
|
const dictionaryData = req.body.dictionary;
|
|
37
|
-
const
|
|
39
|
+
const config = getConfiguration();
|
|
40
|
+
const result = await writeContentDeclaration$1(dictionaryData, config);
|
|
41
|
+
clearModuleCache(join(config.system.mainDir, `unmerged_dictionaries.cjs`));
|
|
38
42
|
let description = "";
|
|
39
43
|
switch (result.status) {
|
|
40
44
|
case "created":
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"dictionary.controller.mjs","names":["writeContentDeclarationEditor"],"sources":["../../src/controllers/dictionary.controller.ts"],"sourcesContent":["import {\n type DictionaryStatus,\n writeContentDeclaration as writeContentDeclarationEditor,\n} from '@intlayer/chokidar/build';\nimport { getConfiguration } from '@intlayer/config/node';\nimport type { Dictionary } from '@intlayer/types/dictionary';\nimport {\n getUnmergedDictionaries,\n type UnmergedDictionaries,\n} from '@intlayer/unmerged-dictionaries-entry';\nimport { formatResponse, type ResponseData } from '@utils/responseData';\nimport type { FastifyReply, FastifyRequest } from 'fastify';\nimport { t } from 'fastify-intlayer';\n\nexport type GetEditorDictionariesResult = ResponseData<UnmergedDictionaries>;\n\n/**\n * Get the Intlayer configuration\n */\nexport const getDictionaries = async (\n _req: FastifyRequest,\n res: FastifyReply\n): Promise<void> => {\n try {\n const formattedResponse = formatResponse<UnmergedDictionaries>({\n data: getUnmergedDictionaries(),\n });\n\n return res.send(formattedResponse);\n } catch (err) {\n const errorMessage = (err as { message?: string; status?: number }) ?? {\n message: 'Internal Server Error',\n status: 500,\n };\n\n const formattedErrorResponse = formatResponse<UnmergedDictionaries>({\n error: {\n message: errorMessage.message ?? 'Internal Server Error',\n code: 'INTERNAL_SERVER_ERROR',\n title: 'Internal Server Error',\n },\n status: errorMessage.status ?? 500,\n });\n\n return res.send(formattedErrorResponse);\n }\n};\n\nexport type WriteContentDeclarationBody = { dictionary: Dictionary };\ntype WriteContentDeclarationResultData = {\n status: DictionaryStatus;\n path: string;\n};\nexport type WriteContentDeclarationResult =\n ResponseData<WriteContentDeclarationResultData>;\n\n/**\n * Adds a new dictionary to the database.\n */\nexport const writeContentDeclaration = async (\n req: FastifyRequest<{ Body: WriteContentDeclarationBody }>,\n res: FastifyReply\n): Promise<void> => {\n try {\n const dictionaryData = req.body.dictionary;\n\n const config = getConfiguration();\n\n const result = await writeContentDeclarationEditor(dictionaryData, config);\n\n let description = '';\n\n switch (result.status) {\n case 'created': {\n description = t({\n en: 'Content declaration created successfully',\n fr: 'Déclaration de contenu créée avec succès',\n es: 'Declaración de contenido creada con éxito',\n });\n break;\n }\n\n case 'updated': {\n description = t({\n en: 'Content declaration updated successfully',\n fr: 'Déclaration de contenu mise à jour avec succès',\n es: 'Declaración de contenido actualizada con éxito',\n });\n break;\n }\n case 'reimported in JSON': {\n description = t({\n en: 'Content declaration reimported in JSON successfully',\n fr: 'Déclaration de contenu réimportée en JSON avec succès',\n es: 'Declaración de contenido reimportada en JSON con éxito',\n });\n break;\n }\n case 'new content file': {\n description = t({\n en: 'Content declaration new content file successfully',\n fr: 'Déclaration de contenu réimportée dans un nouveau emplacement avec succès',\n es: 'Declaración de contenido reimportada en un nuevo lugar con éxito',\n });\n break;\n }\n default: {\n description = t({\n en: 'Content declaration written successfully',\n fr: 'Déclaration de contenu écrite avec succès',\n es: 'Declaración de contenido escrita con éxito',\n });\n break;\n }\n }\n\n const formattedResponse = formatResponse<WriteContentDeclarationResultData>(\n {\n data: result,\n message: t({\n en: 'Content declaration written',\n fr: 'Déclaration de contenu écrite',\n es: 'Declaración de contenido escrita',\n }),\n description,\n }\n );\n\n return res.send(formattedResponse);\n } catch (err) {\n const errorMessage = (err as { message?: string; status?: number }) ?? {\n message: 'Internal Server Error',\n status: 500,\n };\n\n console.error(errorMessage);\n\n const formattedErrorResponse =\n formatResponse<WriteContentDeclarationResultData>({\n error: {\n message: errorMessage.message ?? 'Internal Server Error',\n code: 'INTERNAL_SERVER_ERROR',\n title: 'Internal Server Error',\n },\n status: errorMessage.status ?? 500,\n });\n\n return res.send(formattedErrorResponse);\n }\n};\n"],"mappings":"
|
|
1
|
+
{"version":3,"file":"dictionary.controller.mjs","names":["writeContentDeclarationEditor"],"sources":["../../src/controllers/dictionary.controller.ts"],"sourcesContent":["import {\n type DictionaryStatus,\n writeContentDeclaration as writeContentDeclarationEditor,\n} from '@intlayer/chokidar/build';\nimport { getConfiguration } from '@intlayer/config/node';\nimport { clearModuleCache } from '@intlayer/config/utils';\nimport type { Dictionary } from '@intlayer/types/dictionary';\nimport {\n getUnmergedDictionaries,\n type UnmergedDictionaries,\n} from '@intlayer/unmerged-dictionaries-entry';\nimport { formatResponse, type ResponseData } from '@utils/responseData';\nimport type { FastifyReply, FastifyRequest } from 'fastify';\nimport { t } from 'fastify-intlayer';\nimport { join } from 'path';\n\nexport type GetEditorDictionariesResult = ResponseData<UnmergedDictionaries>;\n\n/**\n * Get the Intlayer configuration\n */\nexport const getDictionaries = async (\n _req: FastifyRequest,\n res: FastifyReply\n): Promise<void> => {\n try {\n const formattedResponse = formatResponse<UnmergedDictionaries>({\n data: getUnmergedDictionaries(),\n });\n\n return res.send(formattedResponse);\n } catch (err) {\n const errorMessage = (err as { message?: string; status?: number }) ?? {\n message: 'Internal Server Error',\n status: 500,\n };\n\n const formattedErrorResponse = formatResponse<UnmergedDictionaries>({\n error: {\n message: errorMessage.message ?? 'Internal Server Error',\n code: 'INTERNAL_SERVER_ERROR',\n title: 'Internal Server Error',\n },\n status: errorMessage.status ?? 500,\n });\n\n return res.send(formattedErrorResponse);\n }\n};\n\nexport type WriteContentDeclarationBody = { dictionary: Dictionary };\ntype WriteContentDeclarationResultData = {\n status: DictionaryStatus;\n path: string;\n};\nexport type WriteContentDeclarationResult =\n ResponseData<WriteContentDeclarationResultData>;\n\n/**\n * Adds a new dictionary to the database.\n */\nexport const writeContentDeclaration = async (\n req: FastifyRequest<{ Body: WriteContentDeclarationBody }>,\n res: FastifyReply\n): Promise<void> => {\n try {\n const dictionaryData = req.body.dictionary;\n\n const config = getConfiguration();\n\n const result = await writeContentDeclarationEditor(dictionaryData, config);\n\n // Clear cache to hot reload the dictionaries\n const dictionariesPath = join(\n config.system.mainDir,\n `unmerged_dictionaries.cjs`\n );\n clearModuleCache(dictionariesPath);\n\n let description = '';\n\n switch (result.status) {\n case 'created': {\n description = t({\n en: 'Content declaration created successfully',\n fr: 'Déclaration de contenu créée avec succès',\n es: 'Declaración de contenido creada con éxito',\n });\n break;\n }\n\n case 'updated': {\n description = t({\n en: 'Content declaration updated successfully',\n fr: 'Déclaration de contenu mise à jour avec succès',\n es: 'Declaración de contenido actualizada con éxito',\n });\n break;\n }\n case 'reimported in JSON': {\n description = t({\n en: 'Content declaration reimported in JSON successfully',\n fr: 'Déclaration de contenu réimportée en JSON avec succès',\n es: 'Declaración de contenido reimportada en JSON con éxito',\n });\n break;\n }\n case 'new content file': {\n description = t({\n en: 'Content declaration new content file successfully',\n fr: 'Déclaration de contenu réimportée dans un nouveau emplacement avec succès',\n es: 'Declaración de contenido reimportada en un nuevo lugar con éxito',\n });\n break;\n }\n default: {\n description = t({\n en: 'Content declaration written successfully',\n fr: 'Déclaration de contenu écrite avec succès',\n es: 'Declaración de contenido escrita con éxito',\n });\n break;\n }\n }\n\n const formattedResponse = formatResponse<WriteContentDeclarationResultData>(\n {\n data: result,\n message: t({\n en: 'Content declaration written',\n fr: 'Déclaration de contenu écrite',\n es: 'Declaración de contenido escrita',\n }),\n description,\n }\n );\n\n return res.send(formattedResponse);\n } catch (err) {\n const errorMessage = (err as { message?: string; status?: number }) ?? {\n message: 'Internal Server Error',\n status: 500,\n };\n\n console.error(errorMessage);\n\n const formattedErrorResponse =\n formatResponse<WriteContentDeclarationResultData>({\n error: {\n message: errorMessage.message ?? 'Internal Server Error',\n code: 'INTERNAL_SERVER_ERROR',\n title: 'Internal Server Error',\n },\n status: errorMessage.status ?? 500,\n });\n\n return res.send(formattedErrorResponse);\n }\n};\n"],"mappings":";;;;;;;;;;;;AAqBA,MAAa,kBAAkB,OAC7B,MACA,QACkB;AAClB,KAAI;EACF,MAAM,oBAAoB,eAAqC,EAC7D,MAAM,yBAAyB,EAChC,CAAC;AAEF,SAAO,IAAI,KAAK,kBAAkB;UAC3B,KAAK;EACZ,MAAM,eAAgB,OAAiD;GACrE,SAAS;GACT,QAAQ;GACT;EAED,MAAM,yBAAyB,eAAqC;GAClE,OAAO;IACL,SAAS,aAAa,WAAW;IACjC,MAAM;IACN,OAAO;IACR;GACD,QAAQ,aAAa,UAAU;GAChC,CAAC;AAEF,SAAO,IAAI,KAAK,uBAAuB;;;;;;AAe3C,MAAa,0BAA0B,OACrC,KACA,QACkB;AAClB,KAAI;EACF,MAAM,iBAAiB,IAAI,KAAK;EAEhC,MAAM,SAAS,kBAAkB;EAEjC,MAAM,SAAS,MAAMA,0BAA8B,gBAAgB,OAAO;AAO1E,mBAJyB,KACvB,OAAO,OAAO,SACd,4BACD,CACiC;EAElC,IAAI,cAAc;AAElB,UAAQ,OAAO,QAAf;GACE,KAAK;AACH,kBAAc,EAAE;KACd,IAAI;KACJ,IAAI;KACJ,IAAI;KACL,CAAC;AACF;GAGF,KAAK;AACH,kBAAc,EAAE;KACd,IAAI;KACJ,IAAI;KACJ,IAAI;KACL,CAAC;AACF;GAEF,KAAK;AACH,kBAAc,EAAE;KACd,IAAI;KACJ,IAAI;KACJ,IAAI;KACL,CAAC;AACF;GAEF,KAAK;AACH,kBAAc,EAAE;KACd,IAAI;KACJ,IAAI;KACJ,IAAI;KACL,CAAC;AACF;GAEF;AACE,kBAAc,EAAE;KACd,IAAI;KACJ,IAAI;KACJ,IAAI;KACL,CAAC;AACF;;EAIJ,MAAM,oBAAoB,eACxB;GACE,MAAM;GACN,SAAS,EAAE;IACT,IAAI;IACJ,IAAI;IACJ,IAAI;IACL,CAAC;GACF;GACD,CACF;AAED,SAAO,IAAI,KAAK,kBAAkB;UAC3B,KAAK;EACZ,MAAM,eAAgB,OAAiD;GACrE,SAAS;GACT,QAAQ;GACT;AAED,UAAQ,MAAM,aAAa;EAE3B,MAAM,yBACJ,eAAkD;GAChD,OAAO;IACL,SAAS,aAAa,WAAW;IACjC,MAAM;IACN,OAAO;IACR;GACD,QAAQ,aAAa,UAAU;GAChC,CAAC;AAEJ,SAAO,IAAI,KAAK,uBAAuB"}
|