intlayer-editor 7.5.8 → 7.5.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-DOHz3hxi.js → CodeBlockShiki-DpCGruCb.js} +3 -3
- package/client/dist/assets/{bundle-web-BeYtMvYb.js → bundle-web-B0b7KTfP.js} +1 -1
- package/client/dist/assets/{index-BfDGXG1A.js → index-ChXpK4Au.js} +568 -490
- package/client/dist/assets/{index-ROdmYOAM.css → index-DxwJ6VyR.css} +123 -4
- package/client/dist/index.html +2 -2
- package/package.json +19 -21
- package/server/dist/controllers/configuration.controller.cjs +3 -5
- package/server/dist/controllers/configuration.controller.cjs.map +1 -1
- package/server/dist/controllers/configuration.controller.d.ts +2 -2
- package/server/dist/controllers/configuration.controller.mjs +3 -5
- package/server/dist/controllers/configuration.controller.mjs.map +1 -1
- package/server/dist/controllers/dictionary.controller.cjs +13 -17
- package/server/dist/controllers/dictionary.controller.cjs.map +1 -1
- package/server/dist/controllers/dictionary.controller.d.ts +6 -5
- package/server/dist/controllers/dictionary.controller.mjs +7 -11
- package/server/dist/controllers/dictionary.controller.mjs.map +1 -1
- package/server/dist/index.cjs +45 -30
- package/server/dist/index.cjs.map +1 -1
- package/server/dist/index.mjs +38 -25
- package/server/dist/index.mjs.map +1 -1
- package/server/dist/routes/config.routes.cjs +3 -3
- package/server/dist/routes/config.routes.cjs.map +1 -1
- package/server/dist/routes/config.routes.d.ts +2 -2
- package/server/dist/routes/config.routes.mjs +3 -3
- package/server/dist/routes/config.routes.mjs.map +1 -1
- package/server/dist/routes/dictionary.routes.cjs +4 -4
- package/server/dist/routes/dictionary.routes.cjs.map +1 -1
- package/server/dist/routes/dictionary.routes.d.ts +2 -2
- package/server/dist/routes/dictionary.routes.mjs +4 -4
- package/server/dist/routes/dictionary.routes.mjs.map +1 -1
|
@@ -12666,9 +12666,9 @@ var editor_exports = /* @__PURE__ */ __export$1({
|
|
|
12666
12666
|
});
|
|
12667
12667
|
const APPLICATION_URL = "";
|
|
12668
12668
|
const EDITOR_URL = "http://localhost:8000";
|
|
12669
|
-
const CMS_URL = "https://intlayer.org";
|
|
12670
|
-
const PORT = 8e3;
|
|
12669
|
+
const CMS_URL = "https://app.intlayer.org";
|
|
12671
12670
|
const BACKEND_URL = "https://back.intlayer.org";
|
|
12671
|
+
const PORT = 8e3;
|
|
12672
12672
|
const IS_ENABLED = true;
|
|
12673
12673
|
const LIVE_SYNC = true;
|
|
12674
12674
|
const DICTIONARY_PRIORITY_STRATEGY = "local_first";
|
|
@@ -13805,30 +13805,36 @@ const getEnumeration = (enumerationContent, quantity) => {
|
|
|
13805
13805
|
const getInsertion = (content2, values) => content2.replace(/\{\{(.*?)\}\}/g, (_2, key2) => (values[key2] ?? "").toString());
|
|
13806
13806
|
const internationalization = { "locales": ["en", "en-GB", "fr", "es", "de", "ja", "ko", "zh", "it", "pt", "hi", "ar", "ru"], "defaultLocale": "en" };
|
|
13807
13807
|
const routing = { "mode": "prefix-no-default", "storage": ["cookie", "header"] };
|
|
13808
|
-
const editor$1 = { "applicationURL": "", "editorURL": "http://localhost:8000", "cmsURL": "https://intlayer.org", "backendURL": "https://back.intlayer.org", "port": 8e3, "enabled": true, "dictionaryPriorityStrategy": "local_first", "liveSync": true, "liveSyncPort": 4e3, "liveSyncURL": "http://localhost:4000" };
|
|
13808
|
+
const editor$1 = { "applicationURL": "", "editorURL": "http://localhost:8000", "cmsURL": "https://app.intlayer.org", "backendURL": "https://back.intlayer.org", "port": 8e3, "enabled": true, "dictionaryPriorityStrategy": "local_first", "liveSync": true, "liveSyncPort": 4e3, "liveSyncURL": "http://localhost:4000" };
|
|
13809
13809
|
const log = { "mode": "default", "prefix": "\x1B[38;5;239m[intlayer] \x1B[0m" };
|
|
13810
|
-
const build = { "optimize": true };
|
|
13811
13810
|
const configuration = {
|
|
13812
13811
|
internationalization,
|
|
13813
13812
|
routing,
|
|
13814
13813
|
editor: editor$1,
|
|
13815
|
-
log
|
|
13816
|
-
build
|
|
13814
|
+
log
|
|
13817
13815
|
};
|
|
13818
13816
|
const dictionaries = {};
|
|
13819
13817
|
const getDictionaries = () => dictionaries;
|
|
13818
|
+
const createSafeFallback = (path = "") => {
|
|
13819
|
+
return new Proxy(() => path, {
|
|
13820
|
+
get: (_target, prop) => {
|
|
13821
|
+
if (prop === "toJSON" || prop === Symbol.toPrimitive || prop === "toString") return () => path;
|
|
13822
|
+
if (prop === "then") return;
|
|
13823
|
+
return createSafeFallback(path ? `${path}.${String(prop)}` : String(prop));
|
|
13824
|
+
},
|
|
13825
|
+
apply: () => {
|
|
13826
|
+
return path;
|
|
13827
|
+
}
|
|
13828
|
+
});
|
|
13829
|
+
};
|
|
13820
13830
|
const getIntlayer = (key2, locale, plugins) => {
|
|
13821
|
-
const
|
|
13822
|
-
const dictionary = dictionaries2[key2];
|
|
13831
|
+
const dictionary = getDictionaries()[key2];
|
|
13823
13832
|
if (!dictionary) {
|
|
13824
|
-
|
|
13825
|
-
|
|
13826
|
-
|
|
13827
|
-
|
|
13828
|
-
|
|
13829
|
-
throw new Error(`Dictionary ${key2} not found - Build optimization is enabled, the dictionary may have been purged. You can disable build optimization, or configure the 'traversePattern' to include the current component.`, dictionaries2);
|
|
13830
|
-
}
|
|
13831
|
-
throw new Error(`Dictionary ${key2} not found`, dictionaries2);
|
|
13833
|
+
getAppLogger(configuration)(`Dictionary "${key2}" was not found. Using fallback proxy.`, {
|
|
13834
|
+
level: "warn",
|
|
13835
|
+
isVerbose: true
|
|
13836
|
+
});
|
|
13837
|
+
return createSafeFallback(key2);
|
|
13832
13838
|
}
|
|
13833
13839
|
return getDictionary$1(dictionary, locale, plugins);
|
|
13834
13840
|
};
|
|
@@ -20995,7 +21001,7 @@ const containerVariants$1 = cva("flex flex-col text-text backdrop-blur", {
|
|
|
20995
21001
|
},
|
|
20996
21002
|
transparency: {
|
|
20997
21003
|
none: "bg-card",
|
|
20998
|
-
sm: "bg-card/
|
|
21004
|
+
sm: "bg-card/90",
|
|
20999
21005
|
md: "bg-card/70",
|
|
21000
21006
|
lg: "bg-card/40",
|
|
21001
21007
|
xl: "bg-card/20",
|
|
@@ -21352,7 +21358,7 @@ const Button = ({ variant, size: size2, color: color2, children, Icon: Icon2, Ic
|
|
|
21352
21358
|
"aria-hidden": "true"
|
|
21353
21359
|
}),
|
|
21354
21360
|
/* @__PURE__ */ jsxRuntimeExports.jsx("div", {
|
|
21355
|
-
className: cn$2("flex
|
|
21361
|
+
className: cn$2("flex items-center justify-center transition-[width] duration-300", isLoading && size2 === ButtonSize.SM && "w-3", isLoading && size2 === ButtonSize.MD && "w-4", isLoading && size2 === ButtonSize.LG && "w-5", isLoading && size2 === ButtonSize.XL && "w-6"),
|
|
21356
21362
|
children: /* @__PURE__ */ jsxRuntimeExports.jsx(Loader, {
|
|
21357
21363
|
className: buttonIconVariants({
|
|
21358
21364
|
size: size2,
|
|
@@ -21905,6 +21911,16 @@ const linkVariants = cva("gap-3 transition-all duration-300 focus-visible:outlin
|
|
|
21905
21911
|
}
|
|
21906
21912
|
},
|
|
21907
21913
|
compoundVariants: [
|
|
21914
|
+
{
|
|
21915
|
+
variant: LinkVariant.BUTTON,
|
|
21916
|
+
color: LinkColor.TEXT_INVERSE,
|
|
21917
|
+
class: "*:text-text"
|
|
21918
|
+
},
|
|
21919
|
+
{
|
|
21920
|
+
variant: LinkVariant.BUTTON_OUTLINED,
|
|
21921
|
+
color: LinkColor.TEXT_INVERSE,
|
|
21922
|
+
class: "text-text-opposite *:text-text-opposite"
|
|
21923
|
+
},
|
|
21908
21924
|
{
|
|
21909
21925
|
variant: [LinkVariant.BUTTON, LinkVariant.BUTTON_OUTLINED],
|
|
21910
21926
|
size: LinkSize.SM,
|
|
@@ -22864,6 +22880,326 @@ const SearchInput = ({ className, ...props }) => /* @__PURE__ */ jsxRuntimeExpor
|
|
|
22864
22880
|
className: cn$2("pl-8", className)
|
|
22865
22881
|
})]
|
|
22866
22882
|
});
|
|
22883
|
+
const getBreakpointFromSize = (breakpoint) => {
|
|
22884
|
+
switch (breakpoint) {
|
|
22885
|
+
case "xs":
|
|
22886
|
+
return 480;
|
|
22887
|
+
case "sm":
|
|
22888
|
+
return 640;
|
|
22889
|
+
case "md":
|
|
22890
|
+
return 768;
|
|
22891
|
+
case "lg":
|
|
22892
|
+
return 1024;
|
|
22893
|
+
case "xl":
|
|
22894
|
+
return 1280;
|
|
22895
|
+
case "2xl":
|
|
22896
|
+
return 1536;
|
|
22897
|
+
default:
|
|
22898
|
+
return breakpoint;
|
|
22899
|
+
}
|
|
22900
|
+
};
|
|
22901
|
+
const checkIsMobileUserAgent = () => {
|
|
22902
|
+
if (typeof window === "undefined") return;
|
|
22903
|
+
const userAgent = window.navigator?.userAgent;
|
|
22904
|
+
if (typeof userAgent === "undefined") return;
|
|
22905
|
+
return /android|bb\d+|meego|avantgo|bada\/|blackberry|blazer|compal|elaine|fennec|hiptop|iemobile|ip(?:hone|od|ad)|iris|kindle|lge |maemo|midp|mmp|mobile.+firefox|netfront|opera m(?:ob|in)i|palm(?: os)?|phone|p(?:ixi|re)\/|plucker|pocket|psp|series(?:4|6)0|symbian|treo|up\.(?:browser|link)|vodafone|wap|windows ce|windows phone|xda|xiino|zte-/i.test(userAgent);
|
|
22906
|
+
};
|
|
22907
|
+
const checkIsIOS = () => {
|
|
22908
|
+
if (typeof window === "undefined") return;
|
|
22909
|
+
const userAgent = window.navigator?.userAgent;
|
|
22910
|
+
if (typeof userAgent === "undefined") return;
|
|
22911
|
+
return /iP(?:hone|ad|od)/.test(userAgent);
|
|
22912
|
+
};
|
|
22913
|
+
const checkIsMac = () => {
|
|
22914
|
+
if (typeof window === "undefined") return;
|
|
22915
|
+
const userAgent = window.navigator?.userAgent;
|
|
22916
|
+
if (typeof userAgent === "undefined") return;
|
|
22917
|
+
return /Macintosh|MacIntel|Mac OS X/.test(userAgent);
|
|
22918
|
+
};
|
|
22919
|
+
const checkIsMobileScreen = (breakpoint) => {
|
|
22920
|
+
if (typeof window === "undefined") return;
|
|
22921
|
+
return (window?.innerWidth ?? 0) <= breakpoint;
|
|
22922
|
+
};
|
|
22923
|
+
const calculateIsMobile = (breakpoint = "md") => {
|
|
22924
|
+
const breakpointValue = getBreakpointFromSize(breakpoint);
|
|
22925
|
+
const isMobileUserAgent = checkIsMobileUserAgent();
|
|
22926
|
+
const isMobileScreen = checkIsMobileScreen(breakpointValue);
|
|
22927
|
+
return {
|
|
22928
|
+
isMobileScreen,
|
|
22929
|
+
isMobileUserAgent,
|
|
22930
|
+
isMobile: isMobileScreen ?? isMobileUserAgent,
|
|
22931
|
+
isIOS: checkIsIOS(),
|
|
22932
|
+
isMac: checkIsMac()
|
|
22933
|
+
};
|
|
22934
|
+
};
|
|
22935
|
+
const useDevice = (breakpoint = "md") => {
|
|
22936
|
+
const [result, setResult] = reactExports.useState(calculateIsMobile(breakpoint));
|
|
22937
|
+
reactExports.useEffect(() => {
|
|
22938
|
+
const handleResize = () => {
|
|
22939
|
+
setResult(calculateIsMobile(breakpoint));
|
|
22940
|
+
};
|
|
22941
|
+
window.addEventListener("resize", handleResize, { passive: true });
|
|
22942
|
+
return () => window.removeEventListener("resize", handleResize);
|
|
22943
|
+
}, [breakpoint]);
|
|
22944
|
+
return result;
|
|
22945
|
+
};
|
|
22946
|
+
const parseShortcut = (shortcut) => {
|
|
22947
|
+
return shortcut.split(" + ").map((key2) => key2.trim());
|
|
22948
|
+
};
|
|
22949
|
+
const normalizeKey = (key2) => {
|
|
22950
|
+
return {
|
|
22951
|
+
"⌘": "Meta",
|
|
22952
|
+
Ctrl: "Control",
|
|
22953
|
+
Control: "Control",
|
|
22954
|
+
Alt: "Alt",
|
|
22955
|
+
"⌥": "Alt",
|
|
22956
|
+
Shift: "Shift",
|
|
22957
|
+
Meta: "Meta",
|
|
22958
|
+
"↑": "ArrowUp",
|
|
22959
|
+
"↓": "ArrowDown",
|
|
22960
|
+
"←": "ArrowLeft",
|
|
22961
|
+
"→": "ArrowRight",
|
|
22962
|
+
ArrowUp: "ArrowUp",
|
|
22963
|
+
ArrowDown: "ArrowDown",
|
|
22964
|
+
ArrowLeft: "ArrowLeft",
|
|
22965
|
+
ArrowRight: "ArrowRight"
|
|
22966
|
+
}[key2] || key2;
|
|
22967
|
+
};
|
|
22968
|
+
const matchesShortcut = (event, keys) => {
|
|
22969
|
+
const normalizedKeys = keys.map(normalizeKey);
|
|
22970
|
+
const hasModifiers = {
|
|
22971
|
+
Meta: normalizedKeys.includes("Meta"),
|
|
22972
|
+
Control: normalizedKeys.includes("Control"),
|
|
22973
|
+
Alt: normalizedKeys.includes("Alt"),
|
|
22974
|
+
Shift: normalizedKeys.includes("Shift")
|
|
22975
|
+
};
|
|
22976
|
+
if (hasModifiers.Meta !== event.metaKey || hasModifiers.Control !== event.ctrlKey || hasModifiers.Alt !== event.altKey || hasModifiers.Shift !== event.shiftKey) return false;
|
|
22977
|
+
const nonModifierKey = keys.find((key2) => ![
|
|
22978
|
+
"⌘",
|
|
22979
|
+
"Ctrl",
|
|
22980
|
+
"Control",
|
|
22981
|
+
"Alt",
|
|
22982
|
+
"⌥",
|
|
22983
|
+
"Shift",
|
|
22984
|
+
"Meta"
|
|
22985
|
+
].includes(normalizeKey(key2)));
|
|
22986
|
+
if (!nonModifierKey) return false;
|
|
22987
|
+
const normalizedNonModifierKey = normalizeKey(nonModifierKey);
|
|
22988
|
+
if (normalizedNonModifierKey.startsWith("Arrow")) return event.key === normalizedNonModifierKey;
|
|
22989
|
+
return event.key.toLowerCase() === normalizedNonModifierKey.toLowerCase();
|
|
22990
|
+
};
|
|
22991
|
+
const getDisplayKey = (key2) => {
|
|
22992
|
+
return {
|
|
22993
|
+
ArrowUp: "↑",
|
|
22994
|
+
ArrowDown: "↓",
|
|
22995
|
+
ArrowLeft: "←",
|
|
22996
|
+
ArrowRight: "→"
|
|
22997
|
+
}[key2] || key2;
|
|
22998
|
+
};
|
|
22999
|
+
const getDisplayShortcut = (shortcut, isMac) => {
|
|
23000
|
+
let result = shortcut;
|
|
23001
|
+
if (isMac) {
|
|
23002
|
+
result = result.replace(/Ctrl/g, "⌘");
|
|
23003
|
+
result = result.replace(/Alt/g, "⌥");
|
|
23004
|
+
} else {
|
|
23005
|
+
result = result.replace(/⌘/g, "Ctrl");
|
|
23006
|
+
result = result.replace(/⌥/g, "Alt");
|
|
23007
|
+
}
|
|
23008
|
+
result = result.replace(/ArrowUp/g, "↑");
|
|
23009
|
+
result = result.replace(/ArrowDown/g, "↓");
|
|
23010
|
+
result = result.replace(/ArrowLeft/g, "←");
|
|
23011
|
+
result = result.replace(/ArrowRight/g, "→");
|
|
23012
|
+
return result;
|
|
23013
|
+
};
|
|
23014
|
+
const KeyboardShortcut = ({ shortcut, onTriggered, display = true, disabled = false, className, size: size2 = "md" }) => {
|
|
23015
|
+
const { isMac } = useDevice();
|
|
23016
|
+
const keys = parseShortcut(getDisplayShortcut(shortcut, isMac ?? false));
|
|
23017
|
+
const [pressedKeys, setPressedKeys] = reactExports.useState(/* @__PURE__ */ new Set());
|
|
23018
|
+
reactExports.useEffect(() => {
|
|
23019
|
+
const handleKeyDown = (event) => {
|
|
23020
|
+
const target = event.target;
|
|
23021
|
+
const isInputField = target.tagName === "INPUT" || target.tagName === "TEXTAREA" || target.isContentEditable;
|
|
23022
|
+
const currentKey = event.key;
|
|
23023
|
+
const normalizedEventKeys = /* @__PURE__ */ new Set();
|
|
23024
|
+
if (event.metaKey) normalizedEventKeys.add("⌘");
|
|
23025
|
+
if (event.ctrlKey) normalizedEventKeys.add("Ctrl");
|
|
23026
|
+
if (event.altKey) normalizedEventKeys.add(isMac ? "⌥" : "Alt");
|
|
23027
|
+
if (event.shiftKey) normalizedEventKeys.add("Shift");
|
|
23028
|
+
if (currentKey.startsWith("Arrow")) {
|
|
23029
|
+
normalizedEventKeys.add(currentKey);
|
|
23030
|
+
normalizedEventKeys.add(getDisplayKey(currentKey));
|
|
23031
|
+
} else normalizedEventKeys.add(currentKey.toUpperCase());
|
|
23032
|
+
setPressedKeys(normalizedEventKeys);
|
|
23033
|
+
if (!disabled && onTriggered && matchesShortcut(event, keys)) {
|
|
23034
|
+
const isEscapeShortcut = keys.includes("Escape");
|
|
23035
|
+
if (isInputField && !isEscapeShortcut) return;
|
|
23036
|
+
event.preventDefault();
|
|
23037
|
+
onTriggered();
|
|
23038
|
+
}
|
|
23039
|
+
};
|
|
23040
|
+
const handleKeyUp = () => {
|
|
23041
|
+
setPressedKeys(/* @__PURE__ */ new Set());
|
|
23042
|
+
};
|
|
23043
|
+
window.addEventListener("keydown", handleKeyDown);
|
|
23044
|
+
window.addEventListener("keyup", handleKeyUp);
|
|
23045
|
+
window.addEventListener("blur", handleKeyUp);
|
|
23046
|
+
return () => {
|
|
23047
|
+
window.removeEventListener("keydown", handleKeyDown);
|
|
23048
|
+
window.removeEventListener("keyup", handleKeyUp);
|
|
23049
|
+
window.removeEventListener("blur", handleKeyUp);
|
|
23050
|
+
};
|
|
23051
|
+
}, [
|
|
23052
|
+
keys,
|
|
23053
|
+
onTriggered,
|
|
23054
|
+
isMac,
|
|
23055
|
+
disabled
|
|
23056
|
+
]);
|
|
23057
|
+
if (!display) return null;
|
|
23058
|
+
const isKeyPressed = (key2) => {
|
|
23059
|
+
const upperKey = key2.toUpperCase();
|
|
23060
|
+
const normalizedKey = normalizeKey(key2);
|
|
23061
|
+
return pressedKeys.has(key2) || pressedKeys.has(upperKey) || pressedKeys.has(normalizedKey) || key2 === "⌘" && pressedKeys.has("Meta") || key2 === "Ctrl" && pressedKeys.has("Control") || key2 === "⌥" && pressedKeys.has("Alt") || key2 === "Alt" && pressedKeys.has("Alt") || key2 === "←" && pressedKeys.has("ArrowLeft") || key2 === "→" && pressedKeys.has("ArrowRight") || key2 === "↑" && pressedKeys.has("ArrowUp") || key2 === "↓" && pressedKeys.has("ArrowDown");
|
|
23062
|
+
};
|
|
23063
|
+
return /* @__PURE__ */ jsxRuntimeExports.jsx("kbd", {
|
|
23064
|
+
className: cn$2("inline-flex items-center justify-center gap-0.5 p-0.5", "rounded-lg [corner-shape:squircle] supports-[corner-shape:squircle]:rounded-xl", "font-medium font-sans", "border-1 border-neutral/20 text-neutral", size2 === "sm" && "text-xs", size2 === "md" && "text-sm", size2 === "lg" && "text-base", className),
|
|
23065
|
+
children: keys.map((key2, index2) => {
|
|
23066
|
+
const keyId = `${key2}-${index2}-${shortcut}`;
|
|
23067
|
+
const displayKey = getDisplayKey(key2);
|
|
23068
|
+
return /* @__PURE__ */ jsxRuntimeExports.jsxs("span", {
|
|
23069
|
+
className: "inline-flex items-center",
|
|
23070
|
+
children: [index2 > 0 && /* @__PURE__ */ jsxRuntimeExports.jsx("span", {
|
|
23071
|
+
className: "text-neutral/50",
|
|
23072
|
+
children: "+"
|
|
23073
|
+
}), /* @__PURE__ */ jsxRuntimeExports.jsx("span", {
|
|
23074
|
+
className: cn$2("min-w-4 px-0.5", isKeyPressed(key2) && "scale-120 font-bold text-text"),
|
|
23075
|
+
suppressHydrationWarning: true,
|
|
23076
|
+
children: displayKey
|
|
23077
|
+
})]
|
|
23078
|
+
}, keyId);
|
|
23079
|
+
})
|
|
23080
|
+
});
|
|
23081
|
+
};
|
|
23082
|
+
let PopoverXAlign = /* @__PURE__ */ (function(PopoverXAlign$1) {
|
|
23083
|
+
PopoverXAlign$1["START"] = "start";
|
|
23084
|
+
PopoverXAlign$1["END"] = "end";
|
|
23085
|
+
return PopoverXAlign$1;
|
|
23086
|
+
})({});
|
|
23087
|
+
let PopoverYAlign = /* @__PURE__ */ (function(PopoverYAlign$1) {
|
|
23088
|
+
PopoverYAlign$1["BELOW"] = "bellow";
|
|
23089
|
+
PopoverYAlign$1["ABOVE"] = "above";
|
|
23090
|
+
return PopoverYAlign$1;
|
|
23091
|
+
})({});
|
|
23092
|
+
const PopoverStatic = ({ children, className, identifier, ...props }) => /* @__PURE__ */ jsxRuntimeExports.jsx("div", {
|
|
23093
|
+
className: cn$2("group/popover relative flex cursor-pointer", className),
|
|
23094
|
+
id: `unrollable-panel-button-${identifier}`,
|
|
23095
|
+
"aria-haspopup": true,
|
|
23096
|
+
...props,
|
|
23097
|
+
children
|
|
23098
|
+
});
|
|
23099
|
+
const Detail$1 = ({ children, isHidden: isHidden2 = void 0, isOverable = true, isFocusable = false, xAlign = PopoverXAlign.START, yAlign = PopoverYAlign.BELOW, identifier, className, displayArrow = true, ...props }) => /* @__PURE__ */ jsxRuntimeExports.jsx(Container, {
|
|
23100
|
+
transparency: "sm",
|
|
23101
|
+
role: "group",
|
|
23102
|
+
"aria-hidden": isHidden2,
|
|
23103
|
+
"aria-labelledby": `unrollable-panel-button-${identifier}`,
|
|
23104
|
+
id: `unrollable-panel-${identifier}`,
|
|
23105
|
+
className: cn$2("absolute z-50 min-w-full rounded-md ring-1 ring-neutral", xAlign === "start" && "left-0", xAlign === "end" && "right-0", yAlign === "bellow" && "top-[calc(100%+1rem)]", yAlign === "above" && "bottom-[calc(100%+1rem)]", displayArrow && 'before:absolute before:z-[999] before:h-0 before:w-0 before:content-[""]', displayArrow && xAlign === "start" && "before:left-2", displayArrow && xAlign === "end" && "before:right-2", displayArrow && yAlign === "bellow" && "before:-top-[10px] before:border-r-[10px] before:border-r-transparent before:border-b-[10px] before:border-b-neutral before:border-l-[10px] before:border-l-transparent", displayArrow && yAlign === "above" && "before:-bottom-[10px] before:border-t-[10px] before:border-t-neutral before:border-r-[10px] before:border-r-transparent before:border-l-[10px] before:border-l-transparent", "overflow-x-visible opacity-0 transition-all duration-400 ease-in-out", isHidden2 !== false ? "invisible" : "visible opacity-100 delay-800", isOverable && "group-hover/popover:visible group-hover/popover:opacity-100 group-hover/popover:delay-800", isFocusable && "group-focus-within/popover:visible group-focus-within/popover:opacity-100 group-focus-within/popover:delay-800", className),
|
|
23106
|
+
...props,
|
|
23107
|
+
children
|
|
23108
|
+
});
|
|
23109
|
+
PopoverStatic.Detail = Detail$1;
|
|
23110
|
+
const PopoverComponent = (props) => {
|
|
23111
|
+
return /* @__PURE__ */ jsxRuntimeExports.jsx(PopoverStatic, { ...props });
|
|
23112
|
+
};
|
|
23113
|
+
const Detail = ({ xAlign = PopoverXAlign.START, yAlign = PopoverYAlign.BELOW, ...props }) => {
|
|
23114
|
+
const popoverRef = reactExports.useRef(null);
|
|
23115
|
+
const [computedXAlign, setComputedXAlign] = reactExports.useState(xAlign);
|
|
23116
|
+
const [computedYAlign, setComputedYAlign] = reactExports.useState(yAlign);
|
|
23117
|
+
const [maxWidth, setMaxWidth] = reactExports.useState(void 0);
|
|
23118
|
+
reactExports.useEffect(() => {
|
|
23119
|
+
const adjustPosition = () => {
|
|
23120
|
+
if (!popoverRef.current) return;
|
|
23121
|
+
const popoverElement = popoverRef.current;
|
|
23122
|
+
const triggerElement$1 = document.getElementById(`unrollable-panel-button-${props.identifier}`);
|
|
23123
|
+
if (!triggerElement$1) return;
|
|
23124
|
+
const triggerRect = triggerElement$1.getBoundingClientRect();
|
|
23125
|
+
const viewportWidth = window.innerWidth;
|
|
23126
|
+
const viewportHeight = window.innerHeight;
|
|
23127
|
+
const gap = 16;
|
|
23128
|
+
const padding = 16;
|
|
23129
|
+
const maxWidthFromLeft = viewportWidth - triggerRect.left - padding;
|
|
23130
|
+
const maxWidthFromRight = triggerRect.right - padding;
|
|
23131
|
+
setMaxWidth(Math.max(maxWidthFromLeft, maxWidthFromRight));
|
|
23132
|
+
const wasInvisible = popoverElement.classList.contains("invisible");
|
|
23133
|
+
if (wasInvisible) {
|
|
23134
|
+
popoverElement.style.visibility = "hidden";
|
|
23135
|
+
popoverElement.classList.remove("invisible");
|
|
23136
|
+
}
|
|
23137
|
+
requestAnimationFrame(() => {
|
|
23138
|
+
const popoverRect = popoverElement.getBoundingClientRect();
|
|
23139
|
+
if (wasInvisible) {
|
|
23140
|
+
popoverElement.style.visibility = "";
|
|
23141
|
+
popoverElement.classList.add("invisible");
|
|
23142
|
+
}
|
|
23143
|
+
let newYAlign = yAlign;
|
|
23144
|
+
const spaceBelow = viewportHeight - triggerRect.bottom - gap;
|
|
23145
|
+
const spaceAbove = triggerRect.top - gap;
|
|
23146
|
+
if (yAlign === PopoverYAlign.BELOW && spaceBelow < popoverRect.height) {
|
|
23147
|
+
if (spaceAbove >= popoverRect.height) newYAlign = PopoverYAlign.ABOVE;
|
|
23148
|
+
} else if (yAlign === PopoverYAlign.ABOVE && spaceAbove < popoverRect.height) {
|
|
23149
|
+
if (spaceBelow >= popoverRect.height) newYAlign = PopoverYAlign.BELOW;
|
|
23150
|
+
}
|
|
23151
|
+
let newXAlign = xAlign;
|
|
23152
|
+
const spaceRight = viewportWidth - triggerRect.left - padding;
|
|
23153
|
+
const spaceLeft = triggerRect.right - padding;
|
|
23154
|
+
if (xAlign === PopoverXAlign.START && spaceRight < popoverRect.width) {
|
|
23155
|
+
if (spaceLeft >= popoverRect.width) newXAlign = PopoverXAlign.END;
|
|
23156
|
+
} else if (xAlign === PopoverXAlign.END && spaceLeft < popoverRect.width) {
|
|
23157
|
+
if (spaceRight >= popoverRect.width) newXAlign = PopoverXAlign.START;
|
|
23158
|
+
}
|
|
23159
|
+
setComputedYAlign(newYAlign);
|
|
23160
|
+
setComputedXAlign(newXAlign);
|
|
23161
|
+
});
|
|
23162
|
+
};
|
|
23163
|
+
const timeoutId = setTimeout(adjustPosition, 0);
|
|
23164
|
+
const triggerElement = document.getElementById(`unrollable-panel-button-${props.identifier}`);
|
|
23165
|
+
if (triggerElement) {
|
|
23166
|
+
triggerElement.addEventListener("mouseenter", adjustPosition);
|
|
23167
|
+
triggerElement.addEventListener("focusin", adjustPosition);
|
|
23168
|
+
}
|
|
23169
|
+
const resizeObserver = new ResizeObserver(() => {
|
|
23170
|
+
adjustPosition();
|
|
23171
|
+
});
|
|
23172
|
+
if (popoverRef.current) resizeObserver.observe(popoverRef.current);
|
|
23173
|
+
window.addEventListener("resize", adjustPosition);
|
|
23174
|
+
window.addEventListener("scroll", adjustPosition, true);
|
|
23175
|
+
return () => {
|
|
23176
|
+
clearTimeout(timeoutId);
|
|
23177
|
+
if (triggerElement) {
|
|
23178
|
+
triggerElement.removeEventListener("mouseenter", adjustPosition);
|
|
23179
|
+
triggerElement.removeEventListener("focusin", adjustPosition);
|
|
23180
|
+
}
|
|
23181
|
+
resizeObserver.disconnect();
|
|
23182
|
+
window.removeEventListener("resize", adjustPosition);
|
|
23183
|
+
window.removeEventListener("scroll", adjustPosition, true);
|
|
23184
|
+
};
|
|
23185
|
+
}, [
|
|
23186
|
+
props.identifier,
|
|
23187
|
+
xAlign,
|
|
23188
|
+
yAlign
|
|
23189
|
+
]);
|
|
23190
|
+
return /* @__PURE__ */ jsxRuntimeExports.jsx(Detail$1, {
|
|
23191
|
+
...props,
|
|
23192
|
+
xAlign: computedXAlign,
|
|
23193
|
+
yAlign: computedYAlign,
|
|
23194
|
+
ref: popoverRef,
|
|
23195
|
+
style: {
|
|
23196
|
+
...props.style,
|
|
23197
|
+
maxWidth: maxWidth ? `${maxWidth}px` : void 0
|
|
23198
|
+
}
|
|
23199
|
+
});
|
|
23200
|
+
};
|
|
23201
|
+
const Popover = PopoverComponent;
|
|
23202
|
+
Popover.Detail = Detail;
|
|
22867
23203
|
function composeEventHandlers(originalEventHandler, ourEventHandler, { checkForDefaultPrevented = true } = {}) {
|
|
22868
23204
|
return function handleEvent(event) {
|
|
22869
23205
|
originalEventHandler?.(event);
|
|
@@ -28240,6 +28576,43 @@ const getEditorAPI = (authAPIOptions = {}, intlayerConfig) => {
|
|
|
28240
28576
|
writeDictionary
|
|
28241
28577
|
};
|
|
28242
28578
|
};
|
|
28579
|
+
const getGithubAPI = (authAPIOptions = {}, intlayerConfig) => {
|
|
28580
|
+
const backendURL = intlayerConfig?.editor?.backendURL ?? configuration?.editor?.backendURL;
|
|
28581
|
+
if (!backendURL) throw new Error("Backend URL is not defined in the Intlayer configuration.");
|
|
28582
|
+
const GITHUB_API_ROUTE = `${backendURL}/api/github`;
|
|
28583
|
+
const getAuthUrl = async (redirectUri, otherOptions = {}) => await fetcher(`${GITHUB_API_ROUTE}/auth-url`, authAPIOptions, otherOptions, { params: { redirectUri } });
|
|
28584
|
+
const authenticate = async (code, otherOptions = {}) => await fetcher(`${GITHUB_API_ROUTE}/auth`, authAPIOptions, otherOptions, {
|
|
28585
|
+
method: "POST",
|
|
28586
|
+
body: { code }
|
|
28587
|
+
});
|
|
28588
|
+
const getRepositories = async (token, otherOptions = {}) => await fetcher(`${GITHUB_API_ROUTE}/repos`, authAPIOptions, otherOptions, { params: token ? { token } : void 0 });
|
|
28589
|
+
const checkIntlayerConfig = async (token, owner, repository, branch = "main", otherOptions = {}) => await fetcher(`${GITHUB_API_ROUTE}/check-config`, authAPIOptions, otherOptions, {
|
|
28590
|
+
method: "POST",
|
|
28591
|
+
body: {
|
|
28592
|
+
token: token ?? void 0,
|
|
28593
|
+
owner,
|
|
28594
|
+
repository,
|
|
28595
|
+
branch
|
|
28596
|
+
}
|
|
28597
|
+
});
|
|
28598
|
+
const getConfigFile = async (token, owner, repository, branch = "main", path = "intlayer.config.ts", otherOptions = {}) => await fetcher(`${GITHUB_API_ROUTE}/get-config-file`, authAPIOptions, otherOptions, {
|
|
28599
|
+
method: "POST",
|
|
28600
|
+
body: {
|
|
28601
|
+
token: token ?? void 0,
|
|
28602
|
+
owner,
|
|
28603
|
+
repository,
|
|
28604
|
+
branch,
|
|
28605
|
+
path
|
|
28606
|
+
}
|
|
28607
|
+
});
|
|
28608
|
+
return {
|
|
28609
|
+
getAuthUrl,
|
|
28610
|
+
authenticate,
|
|
28611
|
+
getRepositories,
|
|
28612
|
+
checkIntlayerConfig,
|
|
28613
|
+
getConfigFile
|
|
28614
|
+
};
|
|
28615
|
+
};
|
|
28243
28616
|
const getOAuthAPI = (intlayerConfig) => {
|
|
28244
28617
|
const backendURL = intlayerConfig?.editor?.backendURL ?? configuration?.editor?.backendURL;
|
|
28245
28618
|
const { clientId, clientSecret } = intlayerConfig?.editor ?? {};
|
|
@@ -28469,6 +28842,7 @@ const getIntlayerAPI = (authAPIOptions = {}, intlayerConfig) => ({
|
|
|
28469
28842
|
search: getSearchAPI(authAPIOptions, intlayerConfig),
|
|
28470
28843
|
editor: getEditorAPI(authAPIOptions, intlayerConfig),
|
|
28471
28844
|
newsletter: getNewsletterAPI(authAPIOptions, intlayerConfig),
|
|
28845
|
+
github: getGithubAPI(authAPIOptions, intlayerConfig),
|
|
28472
28846
|
audit: getAuditAPI(authAPIOptions, intlayerConfig)
|
|
28473
28847
|
});
|
|
28474
28848
|
const useOAuth2 = (intlayerConfiguration) => {
|
|
@@ -29226,10 +29600,15 @@ function createSessionRefreshManager(opts) {
|
|
|
29226
29600
|
if (event?.event === "poll") {
|
|
29227
29601
|
state.lastSessionRequest = now$1();
|
|
29228
29602
|
$fetch("/get-session").then((res) => {
|
|
29229
|
-
sessionAtom.set({
|
|
29603
|
+
if (res.error) sessionAtom.set({
|
|
29604
|
+
...currentSession,
|
|
29605
|
+
data: null,
|
|
29606
|
+
error: res.error
|
|
29607
|
+
});
|
|
29608
|
+
else sessionAtom.set({
|
|
29230
29609
|
...currentSession,
|
|
29231
29610
|
data: res.data,
|
|
29232
|
-
error:
|
|
29611
|
+
error: null
|
|
29233
29612
|
});
|
|
29234
29613
|
state.lastSync = now$1();
|
|
29235
29614
|
sessionSignal.set(!sessionSignal.get());
|
|
@@ -29238,10 +29617,10 @@ function createSessionRefreshManager(opts) {
|
|
|
29238
29617
|
return;
|
|
29239
29618
|
}
|
|
29240
29619
|
if (event?.event === "visibilitychange") {
|
|
29241
|
-
if (now$1() - state.lastSessionRequest < FOCUS_REFETCH_RATE_LIMIT_SECONDS
|
|
29620
|
+
if (now$1() - state.lastSessionRequest < FOCUS_REFETCH_RATE_LIMIT_SECONDS) return;
|
|
29621
|
+
state.lastSessionRequest = now$1();
|
|
29242
29622
|
}
|
|
29243
29623
|
if (currentSession?.data === null || currentSession?.data === void 0 || event?.event === "visibilitychange") {
|
|
29244
|
-
if (event?.event === "visibilitychange") state.lastSessionRequest = now$1();
|
|
29245
29624
|
state.lastSync = now$1();
|
|
29246
29625
|
sessionSignal.set(!sessionSignal.get());
|
|
29247
29626
|
}
|
|
@@ -30345,9 +30724,12 @@ function createDynamicPathProxy(routes, client2, knownPathMethods, atoms, atomLi
|
|
|
30345
30724
|
if (!atomListeners || options.disableSignal) return;
|
|
30346
30725
|
const matches = atomListeners.filter((s2) => s2.matcher(routePath));
|
|
30347
30726
|
if (!matches.length) return;
|
|
30727
|
+
const visited = /* @__PURE__ */ new Set();
|
|
30348
30728
|
for (const match of matches) {
|
|
30349
30729
|
const signal = atoms[match.signal];
|
|
30350
30730
|
if (!signal) return;
|
|
30731
|
+
if (visited.has(match.signal)) continue;
|
|
30732
|
+
visited.add(match.signal);
|
|
30351
30733
|
const val = signal.get();
|
|
30352
30734
|
setTimeout(() => {
|
|
30353
30735
|
signal.set(!val);
|
|
@@ -30723,9 +31105,9 @@ function useSession(sessionProp, intlayerConfiguration) {
|
|
|
30723
31105
|
queryFn: async () => {
|
|
30724
31106
|
return (await getAuthAPI(config2).getSession()).data;
|
|
30725
31107
|
},
|
|
30726
|
-
staleTime:
|
|
31108
|
+
staleTime: 60 * 1e3,
|
|
30727
31109
|
gcTime: 300 * 1e3,
|
|
30728
|
-
refetchOnMount:
|
|
31110
|
+
refetchOnMount: true,
|
|
30729
31111
|
refetchOnWindowFocus: false,
|
|
30730
31112
|
refetchOnReconnect: false,
|
|
30731
31113
|
enabled: !sessionProp
|
|
@@ -30824,7 +31206,7 @@ const useDeleteDictionary = () => {
|
|
|
30824
31206
|
const intlayerOAuth = useIntlayerOAuth();
|
|
30825
31207
|
return useMutation({
|
|
30826
31208
|
mutationKey: ["dictionaries"],
|
|
30827
|
-
mutationFn: (args) => intlayerOAuth.dictionary.deleteDictionary(args),
|
|
31209
|
+
mutationFn: (args) => intlayerOAuth.dictionary.deleteDictionary(args.dictionaryId),
|
|
30828
31210
|
meta: { invalidateQueries: [["dictionaries"], ["dictionariesKeys"]] }
|
|
30829
31211
|
});
|
|
30830
31212
|
};
|
|
@@ -33370,7 +33752,7 @@ const CodeDefault = ({ children }) => /* @__PURE__ */ jsxRuntimeExports.jsx("div
|
|
|
33370
33752
|
}, `line-${index2}-${line.slice(0, 10)}`)) })
|
|
33371
33753
|
})
|
|
33372
33754
|
});
|
|
33373
|
-
const CodeBlockShiki = reactExports.lazy(() => __vitePreload(() => import("./CodeBlockShiki-
|
|
33755
|
+
const CodeBlockShiki = reactExports.lazy(() => __vitePreload(() => import("./CodeBlockShiki-DpCGruCb.js"), true ? [] : void 0).then((mod) => ({ default: mod.CodeBlockShiki })));
|
|
33374
33756
|
const CodeBlock = ({ className, onChange, isEditable, children, lang, isDarkMode, ...props }) => /* @__PURE__ */ jsxRuntimeExports.jsx("div", {
|
|
33375
33757
|
className: cn$2("flex w-full min-w-0 max-w-full overflow-x-auto", className),
|
|
33376
33758
|
...props,
|
|
@@ -37049,7 +37431,7 @@ const SelectScrollDownButton = ({ className, ...props }) => /* @__PURE__ */ jsxR
|
|
|
37049
37431
|
children: /* @__PURE__ */ jsxRuntimeExports.jsx(ChevronDown, {})
|
|
37050
37432
|
});
|
|
37051
37433
|
const SelectContent = ({ className, children, position = SelectContentPosition.POPPER, ...props }) => /* @__PURE__ */ jsxRuntimeExports.jsx(Portal, { children: /* @__PURE__ */ jsxRuntimeExports.jsxs(Content2, {
|
|
37052
|
-
className: cn$2("relative z-50 max-h-96 min-w-32 overflow-hidden", "rounded-xl shadow-md", "bg-white dark:bg-neutral-950", "text-text", "border border-neutral-200 dark:border-neutral-800", "data-[state=closed]:animate-out data-[state=open]:animate-in", "data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0", "data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95", "data-[side=bottom]:slide-in-from-top-2", "data-[side=left]:slide-in-from-right-2", "data-[side=right]:slide-in-from-left-2", "data-[side=top]:slide-in-from-bottom-2", position === "popper" && "data-[side=left]:-translate-x-1 data-[side=
|
|
37434
|
+
className: cn$2("relative z-50 max-h-96 min-w-32 overflow-hidden", "rounded-xl shadow-md", "bg-white dark:bg-neutral-950", "text-text", "border border-neutral-200 dark:border-neutral-800", "data-[state=closed]:animate-out data-[state=open]:animate-in", "data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0", "data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95", "data-[side=bottom]:slide-in-from-top-2", "data-[side=left]:slide-in-from-right-2", "data-[side=right]:slide-in-from-left-2", "data-[side=top]:slide-in-from-bottom-2", position === "popper" && "data-[side=left]:-translate-x-1 data-[side=right]:translate-x-1 data-[side=bottom]:translate-y-1 data-[side=top]:-translate-y-1", className),
|
|
37053
37435
|
position,
|
|
37054
37436
|
...props,
|
|
37055
37437
|
children: [
|
|
@@ -37087,127 +37469,6 @@ Select.Content = SelectContent;
|
|
|
37087
37469
|
Select.Label = SelectLabel;
|
|
37088
37470
|
Select.Item = SelectItem;
|
|
37089
37471
|
Select.Separator = SelectSeparator;
|
|
37090
|
-
let PopoverXAlign = /* @__PURE__ */ (function(PopoverXAlign$1) {
|
|
37091
|
-
PopoverXAlign$1["START"] = "start";
|
|
37092
|
-
PopoverXAlign$1["END"] = "end";
|
|
37093
|
-
return PopoverXAlign$1;
|
|
37094
|
-
})({});
|
|
37095
|
-
let PopoverYAlign = /* @__PURE__ */ (function(PopoverYAlign$1) {
|
|
37096
|
-
PopoverYAlign$1["BELOW"] = "bellow";
|
|
37097
|
-
PopoverYAlign$1["ABOVE"] = "above";
|
|
37098
|
-
return PopoverYAlign$1;
|
|
37099
|
-
})({});
|
|
37100
|
-
const PopoverStatic = ({ children, className, identifier, ...props }) => /* @__PURE__ */ jsxRuntimeExports.jsx("div", {
|
|
37101
|
-
className: cn$2("group/popover relative flex cursor-pointer", className),
|
|
37102
|
-
id: `unrollable-panel-button-${identifier}`,
|
|
37103
|
-
"aria-haspopup": true,
|
|
37104
|
-
...props,
|
|
37105
|
-
children
|
|
37106
|
-
});
|
|
37107
|
-
const Detail$1 = ({ children, isHidden: isHidden2 = void 0, isOverable = true, isFocusable = false, xAlign = PopoverXAlign.START, yAlign = PopoverYAlign.BELOW, identifier, className, displayArrow = true, ...props }) => /* @__PURE__ */ jsxRuntimeExports.jsx(Container, {
|
|
37108
|
-
transparency: "sm",
|
|
37109
|
-
role: "group",
|
|
37110
|
-
"aria-hidden": isHidden2,
|
|
37111
|
-
"aria-labelledby": `unrollable-panel-button-${identifier}`,
|
|
37112
|
-
id: `unrollable-panel-${identifier}`,
|
|
37113
|
-
className: cn$2("absolute z-50 min-w-full rounded-md ring-1 ring-neutral", xAlign === "start" && "left-0", xAlign === "end" && "right-0", yAlign === "bellow" && "top-[calc(100%+1rem)]", yAlign === "above" && "bottom-[calc(100%+1rem)]", displayArrow && 'before:absolute before:z-[999] before:h-0 before:w-0 before:content-[""]', displayArrow && xAlign === "start" && "before:left-2", displayArrow && xAlign === "end" && "before:right-2", displayArrow && yAlign === "bellow" && "before:-top-[10px] before:border-r-[10px] before:border-r-transparent before:border-b-[10px] before:border-b-neutral before:border-l-[10px] before:border-l-transparent", displayArrow && yAlign === "above" && "before:-bottom-[10px] before:border-t-[10px] before:border-t-neutral before:border-r-[10px] before:border-r-transparent before:border-l-[10px] before:border-l-transparent", "overflow-x-visible opacity-0 transition-all duration-400 ease-in-out", isHidden2 !== false ? "invisible" : "visible opacity-100 delay-800", isOverable && "group-hover/popover:visible group-hover/popover:opacity-100 group-hover/popover:delay-800", isFocusable && "group-focus-within/popover:visible group-focus-within/popover:opacity-100 group-focus-within/popover:delay-800", className),
|
|
37114
|
-
...props,
|
|
37115
|
-
children
|
|
37116
|
-
});
|
|
37117
|
-
PopoverStatic.Detail = Detail$1;
|
|
37118
|
-
const PopoverComponent = (props) => {
|
|
37119
|
-
return /* @__PURE__ */ jsxRuntimeExports.jsx(PopoverStatic, { ...props });
|
|
37120
|
-
};
|
|
37121
|
-
const Detail = ({ xAlign = PopoverXAlign.START, yAlign = PopoverYAlign.BELOW, ...props }) => {
|
|
37122
|
-
const popoverRef = reactExports.useRef(null);
|
|
37123
|
-
const [computedXAlign, setComputedXAlign] = reactExports.useState(xAlign);
|
|
37124
|
-
const [computedYAlign, setComputedYAlign] = reactExports.useState(yAlign);
|
|
37125
|
-
const [maxWidth, setMaxWidth] = reactExports.useState(void 0);
|
|
37126
|
-
reactExports.useEffect(() => {
|
|
37127
|
-
const adjustPosition = () => {
|
|
37128
|
-
if (!popoverRef.current) return;
|
|
37129
|
-
const popoverElement = popoverRef.current;
|
|
37130
|
-
const triggerElement$1 = document.getElementById(`unrollable-panel-button-${props.identifier}`);
|
|
37131
|
-
if (!triggerElement$1) return;
|
|
37132
|
-
const triggerRect = triggerElement$1.getBoundingClientRect();
|
|
37133
|
-
const viewportWidth = window.innerWidth;
|
|
37134
|
-
const viewportHeight = window.innerHeight;
|
|
37135
|
-
const gap = 16;
|
|
37136
|
-
const padding = 16;
|
|
37137
|
-
const maxWidthFromLeft = viewportWidth - triggerRect.left - padding;
|
|
37138
|
-
const maxWidthFromRight = triggerRect.right - padding;
|
|
37139
|
-
setMaxWidth(Math.max(maxWidthFromLeft, maxWidthFromRight));
|
|
37140
|
-
const wasInvisible = popoverElement.classList.contains("invisible");
|
|
37141
|
-
if (wasInvisible) {
|
|
37142
|
-
popoverElement.style.visibility = "hidden";
|
|
37143
|
-
popoverElement.classList.remove("invisible");
|
|
37144
|
-
}
|
|
37145
|
-
requestAnimationFrame(() => {
|
|
37146
|
-
const popoverRect = popoverElement.getBoundingClientRect();
|
|
37147
|
-
if (wasInvisible) {
|
|
37148
|
-
popoverElement.style.visibility = "";
|
|
37149
|
-
popoverElement.classList.add("invisible");
|
|
37150
|
-
}
|
|
37151
|
-
let newYAlign = yAlign;
|
|
37152
|
-
const spaceBelow = viewportHeight - triggerRect.bottom - gap;
|
|
37153
|
-
const spaceAbove = triggerRect.top - gap;
|
|
37154
|
-
if (yAlign === PopoverYAlign.BELOW && spaceBelow < popoverRect.height) {
|
|
37155
|
-
if (spaceAbove >= popoverRect.height) newYAlign = PopoverYAlign.ABOVE;
|
|
37156
|
-
} else if (yAlign === PopoverYAlign.ABOVE && spaceAbove < popoverRect.height) {
|
|
37157
|
-
if (spaceBelow >= popoverRect.height) newYAlign = PopoverYAlign.BELOW;
|
|
37158
|
-
}
|
|
37159
|
-
let newXAlign = xAlign;
|
|
37160
|
-
const spaceRight = viewportWidth - triggerRect.left - padding;
|
|
37161
|
-
const spaceLeft = triggerRect.right - padding;
|
|
37162
|
-
if (xAlign === PopoverXAlign.START && spaceRight < popoverRect.width) {
|
|
37163
|
-
if (spaceLeft >= popoverRect.width) newXAlign = PopoverXAlign.END;
|
|
37164
|
-
} else if (xAlign === PopoverXAlign.END && spaceLeft < popoverRect.width) {
|
|
37165
|
-
if (spaceRight >= popoverRect.width) newXAlign = PopoverXAlign.START;
|
|
37166
|
-
}
|
|
37167
|
-
setComputedYAlign(newYAlign);
|
|
37168
|
-
setComputedXAlign(newXAlign);
|
|
37169
|
-
});
|
|
37170
|
-
};
|
|
37171
|
-
const timeoutId = setTimeout(adjustPosition, 0);
|
|
37172
|
-
const triggerElement = document.getElementById(`unrollable-panel-button-${props.identifier}`);
|
|
37173
|
-
if (triggerElement) {
|
|
37174
|
-
triggerElement.addEventListener("mouseenter", adjustPosition);
|
|
37175
|
-
triggerElement.addEventListener("focusin", adjustPosition);
|
|
37176
|
-
}
|
|
37177
|
-
const resizeObserver = new ResizeObserver(() => {
|
|
37178
|
-
adjustPosition();
|
|
37179
|
-
});
|
|
37180
|
-
if (popoverRef.current) resizeObserver.observe(popoverRef.current);
|
|
37181
|
-
window.addEventListener("resize", adjustPosition);
|
|
37182
|
-
window.addEventListener("scroll", adjustPosition, true);
|
|
37183
|
-
return () => {
|
|
37184
|
-
clearTimeout(timeoutId);
|
|
37185
|
-
if (triggerElement) {
|
|
37186
|
-
triggerElement.removeEventListener("mouseenter", adjustPosition);
|
|
37187
|
-
triggerElement.removeEventListener("focusin", adjustPosition);
|
|
37188
|
-
}
|
|
37189
|
-
resizeObserver.disconnect();
|
|
37190
|
-
window.removeEventListener("resize", adjustPosition);
|
|
37191
|
-
window.removeEventListener("scroll", adjustPosition, true);
|
|
37192
|
-
};
|
|
37193
|
-
}, [
|
|
37194
|
-
props.identifier,
|
|
37195
|
-
xAlign,
|
|
37196
|
-
yAlign
|
|
37197
|
-
]);
|
|
37198
|
-
return /* @__PURE__ */ jsxRuntimeExports.jsx(Detail$1, {
|
|
37199
|
-
...props,
|
|
37200
|
-
xAlign: computedXAlign,
|
|
37201
|
-
yAlign: computedYAlign,
|
|
37202
|
-
ref: popoverRef,
|
|
37203
|
-
style: {
|
|
37204
|
-
...props.style,
|
|
37205
|
-
maxWidth: maxWidth ? `${maxWidth}px` : void 0
|
|
37206
|
-
}
|
|
37207
|
-
});
|
|
37208
|
-
};
|
|
37209
|
-
const Popover = PopoverComponent;
|
|
37210
|
-
Popover.Detail = Detail;
|
|
37211
37472
|
const CodeContext = reactExports.createContext({
|
|
37212
37473
|
packageManager: "npm",
|
|
37213
37474
|
setPackageManager: () => {
|
|
@@ -37248,7 +37509,7 @@ const CodeConditionalRender = ({ children, ...props }) => {
|
|
|
37248
37509
|
return /* @__PURE__ */ jsxRuntimeExports.jsx(jsxRuntimeExports.Fragment, {});
|
|
37249
37510
|
};
|
|
37250
37511
|
const key$d = "code-selectors";
|
|
37251
|
-
const content$d = { "nodeType": "translation", "translation": { "en": { "packageManager": { "label": "Select package manager" }, "codeFormat": { "label": "Select code format" }, "contentDeclarationFormat": { "label": "Select dictionary format" } }, "en-GB": { "packageManager": { "label": "Select package manager" }, "codeFormat": { "label": "Select code format" }, "contentDeclarationFormat": { "label": "Select dictionary format" } }, "fr": { "packageManager": { "label": "Sélectionner le gestionnaire de paquets" }, "codeFormat": { "label": "Sélectionner le format de code" }, "contentDeclarationFormat": { "label": "Sélectionner le format de dictionnaire" } }, "es": { "packageManager": { "label": "Seleccionar gestor de paquetes" }, "codeFormat": { "label": "Seleccionar formato de código" }, "contentDeclarationFormat": { "label": "Seleccionar formato de diccionario" } }, "de": { "packageManager": { "label": "Paketmanager auswählen" }, "codeFormat": { "label": "Code-Format auswählen" }, "contentDeclarationFormat": { "label": "Wörterbuchformat auswählen" } }, "ja": { "packageManager": { "label": "パッケージマネージャーを選択" }, "codeFormat": { "label": "コード形式を選択" }, "contentDeclarationFormat": { "label": "辞書形式を選択" } }, "ko": { "packageManager": { "label": "패키지 관리자 선택" }, "codeFormat": { "label": "코드 형식 선택" }, "contentDeclarationFormat": { "label": "사전 형식 선택" } }, "zh": { "packageManager": { "label": "选择包管理器" }, "codeFormat": { "label": "选择代码格式" }, "contentDeclarationFormat": { "label": "选择字典格式" } }, "it": { "packageManager": { "label": "Seleziona il gestore dei pacchetti" }, "codeFormat": { "label": "Seleziona il formato del codice" }, "contentDeclarationFormat": { "label": "Seleziona il formato del dizionario" } }, "pt": { "packageManager": { "label": "Selecionar gerenciador de pacotes" }, "codeFormat": { "label": "Selecionar formato de código" }, "contentDeclarationFormat": { "label": "Selecionar formato de dicionário" } }, "hi": { "packageManager": { "label": "पैकेज प्रबंधक चुनें" }, "codeFormat": { "label": "कोड प्रारूप चुनें" }, "contentDeclarationFormat": { "label": "शब्दकोश प्रारूप चुनें" } }, "ar": { "packageManager": { "label": "اختر مدير الحزم" }, "codeFormat": { "label": "اختر تنسيق الكود" }, "contentDeclarationFormat": { "label": "اختر تنسيق القاموس" } }, "ru": { "packageManager": { "label": "Выбрать менеджер пакетов" }, "codeFormat": { "label": "Выбрать формат кода" }, "contentDeclarationFormat": { "label": "Выбрать формат словаря" } } } };
|
|
37512
|
+
const content$d = { "nodeType": "translation", "translation": { "en": { "packageManager": { "placeholder": "Package Manager", "label": "Select package manager" }, "codeFormat": { "placeholder": "Code Format", "label": "Select code format" }, "contentDeclarationFormat": { "placeholder": "Dictionary Format", "label": "Select dictionary format" } }, "en-GB": { "packageManager": { "placeholder": "Package Manager", "label": "Select package manager" }, "codeFormat": { "placeholder": "Code Format", "label": "Select code format" }, "contentDeclarationFormat": { "placeholder": "Dictionary Format", "label": "Select dictionary format" } }, "fr": { "packageManager": { "placeholder": "Gestionnaire de paquets", "label": "Sélectionner le gestionnaire de paquets" }, "codeFormat": { "placeholder": "Format de code", "label": "Sélectionner le format de code" }, "contentDeclarationFormat": { "placeholder": "Format de dictionnaire", "label": "Sélectionner le format de dictionnaire" } }, "es": { "packageManager": { "placeholder": "Gestor de paquetes", "label": "Seleccionar gestor de paquetes" }, "codeFormat": { "placeholder": "Formato de código", "label": "Seleccionar formato de código" }, "contentDeclarationFormat": { "placeholder": "Formato de diccionario", "label": "Seleccionar formato de diccionario" } }, "de": { "packageManager": { "placeholder": "Paketmanager", "label": "Paketmanager auswählen" }, "codeFormat": { "placeholder": "Code-Format", "label": "Code-Format auswählen" }, "contentDeclarationFormat": { "placeholder": "Wörterbuchformat", "label": "Wörterbuchformat auswählen" } }, "ja": { "packageManager": { "placeholder": "パッケージマネージャー", "label": "パッケージマネージャーを選択" }, "codeFormat": { "placeholder": "コード形式", "label": "コード形式を選択" }, "contentDeclarationFormat": { "placeholder": "辞書形式", "label": "辞書形式を選択" } }, "ko": { "packageManager": { "placeholder": "패키지 관리자", "label": "패키지 관리자 선택" }, "codeFormat": { "placeholder": "코드 형식", "label": "코드 형식 선택" }, "contentDeclarationFormat": { "placeholder": "사전 형식", "label": "사전 형식 선택" } }, "zh": { "packageManager": { "placeholder": "包管理器", "label": "选择包管理器" }, "codeFormat": { "placeholder": "代码格式", "label": "选择代码格式" }, "contentDeclarationFormat": { "placeholder": "字典格式", "label": "选择字典格式" } }, "it": { "packageManager": { "placeholder": "Gestore dei pacchetti", "label": "Seleziona il gestore dei pacchetti" }, "codeFormat": { "placeholder": "Formato del codice", "label": "Seleziona il formato del codice" }, "contentDeclarationFormat": { "placeholder": "Formato del dizionario", "label": "Seleziona il formato del dizionario" } }, "pt": { "packageManager": { "placeholder": "Gerenciador de pacotes", "label": "Selecionar gerenciador de pacotes" }, "codeFormat": { "placeholder": "Formato de código", "label": "Selecionar formato de código" }, "contentDeclarationFormat": { "placeholder": "Formato de dicionário", "label": "Selecionar formato de dicionário" } }, "hi": { "packageManager": { "placeholder": "पैकेज प्रबंधक", "label": "पैकेज प्रबंधक चुनें" }, "codeFormat": { "placeholder": "कोड प्रारूप", "label": "कोड प्रारूप चुनें" }, "contentDeclarationFormat": { "placeholder": "शब्दकोश प्रारूप", "label": "शब्दकोश प्रारूप चुनें" } }, "ar": { "packageManager": { "placeholder": "مدير الحزم", "label": "اختر مدير الحزم" }, "codeFormat": { "placeholder": "تنسيق الكود", "label": "اختر تنسيق الكود" }, "contentDeclarationFormat": { "placeholder": "تنسيق القاموس", "label": "اختر تنسيق القاموس" } }, "ru": { "packageManager": { "placeholder": "Менеджер пакетов", "label": "Выбрать менеджер пакетов" }, "codeFormat": { "placeholder": "Формат кода", "label": "Выбрать формат кода" }, "contentDeclarationFormat": { "placeholder": "Формат словаря", "label": "Выбрать формат словаря" } } } };
|
|
37252
37513
|
const localIds$d = ["code-selectors::local::../@intlayer/design-system/src/components/IDE/selectors.content.ts"];
|
|
37253
37514
|
const _VaxfTMdlIxLlHVFaeieC = {
|
|
37254
37515
|
key: key$d,
|
|
@@ -37261,9 +37522,7 @@ const CodeFormatSelector = () => {
|
|
|
37261
37522
|
setCodeFormat,
|
|
37262
37523
|
setContentDeclarationFormat
|
|
37263
37524
|
} = useCodeContext();
|
|
37264
|
-
const
|
|
37265
|
-
codeFormat: codeFormatContent
|
|
37266
|
-
} = useDictionary(_VaxfTMdlIxLlHVFaeieC);
|
|
37525
|
+
const content2 = useDictionary(_VaxfTMdlIxLlHVFaeieC);
|
|
37267
37526
|
return /* @__PURE__ */ jsxRuntimeExports.jsxs(Select, {
|
|
37268
37527
|
value: codeFormat,
|
|
37269
37528
|
onValueChange: (value) => {
|
|
@@ -37271,10 +37530,10 @@ const CodeFormatSelector = () => {
|
|
|
37271
37530
|
setContentDeclarationFormat(value);
|
|
37272
37531
|
},
|
|
37273
37532
|
children: [/* @__PURE__ */ jsxRuntimeExports.jsx(Select.Trigger, {
|
|
37274
|
-
className: "py-1",
|
|
37275
|
-
"aria-label":
|
|
37533
|
+
className: "py-1!",
|
|
37534
|
+
"aria-label": content2.codeFormat.label.value,
|
|
37276
37535
|
children: /* @__PURE__ */ jsxRuntimeExports.jsx(Select.Value, {
|
|
37277
|
-
placeholder:
|
|
37536
|
+
placeholder: content2.codeFormat.placeholder.value
|
|
37278
37537
|
})
|
|
37279
37538
|
}), /* @__PURE__ */ jsxRuntimeExports.jsxs(Select.Content, {
|
|
37280
37539
|
children: [/* @__PURE__ */ jsxRuntimeExports.jsx(Select.Item, {
|
|
@@ -37295,17 +37554,15 @@ const ContentDeclarationFormatSelector = () => {
|
|
|
37295
37554
|
contentDeclarationFormat,
|
|
37296
37555
|
setContentDeclarationFormat
|
|
37297
37556
|
} = useCodeContext();
|
|
37298
|
-
const
|
|
37299
|
-
contentDeclarationFormat: contentDeclarationFormatContent
|
|
37300
|
-
} = useDictionary(_VaxfTMdlIxLlHVFaeieC);
|
|
37557
|
+
const content2 = useDictionary(_VaxfTMdlIxLlHVFaeieC);
|
|
37301
37558
|
return /* @__PURE__ */ jsxRuntimeExports.jsxs(Select, {
|
|
37302
37559
|
value: contentDeclarationFormat,
|
|
37303
37560
|
onValueChange: setContentDeclarationFormat,
|
|
37304
37561
|
children: [/* @__PURE__ */ jsxRuntimeExports.jsx(Select.Trigger, {
|
|
37305
|
-
className: "py-1",
|
|
37306
|
-
"aria-label":
|
|
37562
|
+
className: "py-1!",
|
|
37563
|
+
"aria-label": content2.contentDeclarationFormat.label.value,
|
|
37307
37564
|
children: /* @__PURE__ */ jsxRuntimeExports.jsx(Select.Value, {
|
|
37308
|
-
placeholder:
|
|
37565
|
+
placeholder: content2.contentDeclarationFormat.placeholder.value
|
|
37309
37566
|
})
|
|
37310
37567
|
}), /* @__PURE__ */ jsxRuntimeExports.jsxs(Select.Content, {
|
|
37311
37568
|
children: [/* @__PURE__ */ jsxRuntimeExports.jsx(Select.Item, {
|
|
@@ -37361,17 +37618,16 @@ const PackageManagerSelector = () => {
|
|
|
37361
37618
|
packageManager,
|
|
37362
37619
|
setPackageManager
|
|
37363
37620
|
} = useCodeContext();
|
|
37364
|
-
const
|
|
37365
|
-
|
|
37366
|
-
} = useDictionary(_VaxfTMdlIxLlHVFaeieC);
|
|
37621
|
+
const content2 = useDictionary(_VaxfTMdlIxLlHVFaeieC);
|
|
37622
|
+
useDictionary(_VaxfTMdlIxLlHVFaeieC);
|
|
37367
37623
|
return /* @__PURE__ */ jsxRuntimeExports.jsxs(Select, {
|
|
37368
37624
|
value: packageManager,
|
|
37369
37625
|
onValueChange: setPackageManager,
|
|
37370
37626
|
children: [/* @__PURE__ */ jsxRuntimeExports.jsx(Select.Trigger, {
|
|
37371
|
-
className: "py-1",
|
|
37372
|
-
"aria-label":
|
|
37627
|
+
className: "py-1!",
|
|
37628
|
+
"aria-label": content2.packageManager.label.value,
|
|
37373
37629
|
children: /* @__PURE__ */ jsxRuntimeExports.jsx(Select.Value, {
|
|
37374
|
-
placeholder:
|
|
37630
|
+
placeholder: content2.packageManager.placeholder.value
|
|
37375
37631
|
})
|
|
37376
37632
|
}), /* @__PURE__ */ jsxRuntimeExports.jsxs(Select.Content, {
|
|
37377
37633
|
children: [/* @__PURE__ */ jsxRuntimeExports.jsx(Select.Item, {
|
|
@@ -37456,7 +37712,7 @@ const tabSelectorVariant = cva("relative z-0 flex size-full flex-row items-cente
|
|
|
37456
37712
|
} },
|
|
37457
37713
|
defaultVariants: { color: "primary" }
|
|
37458
37714
|
});
|
|
37459
|
-
const indicatorVariant = cva("-z-1
|
|
37715
|
+
const indicatorVariant = cva("absolute -z-1 rounded-lg duration-300 ease-in-out motion-reduce:transition-none", {
|
|
37460
37716
|
variants: {
|
|
37461
37717
|
color: {
|
|
37462
37718
|
primary: "bg-primary/10 aria-selected:text-text",
|
|
@@ -45294,7 +45550,7 @@ const Modal = ({ children, isOpen, container, disableScroll = true, onClose, has
|
|
|
45294
45550
|
}),
|
|
45295
45551
|
role: "dialog",
|
|
45296
45552
|
"aria-modal": true,
|
|
45297
|
-
roundedSize: "
|
|
45553
|
+
roundedSize: "4xl",
|
|
45298
45554
|
...props,
|
|
45299
45555
|
children: [/* @__PURE__ */ jsxRuntimeExports.jsxs("div", {
|
|
45300
45556
|
className: cn$2("cursor-default", hasCloseButton && hasTitle ? `flex items-start` : hasCloseButton ? `flex justify-end` : hasTitle ? `items-center` : `hidden`),
|
|
@@ -46859,14 +47115,6 @@ const _LjElj9YzZe66ZBgugc8w = {
|
|
|
46859
47115
|
content: content$b,
|
|
46860
47116
|
localIds: localIds$b
|
|
46861
47117
|
};
|
|
46862
|
-
const renameKey = (obj, oldKey, newKey) => {
|
|
46863
|
-
const newObj = { ...obj };
|
|
46864
|
-
for (const key2 of Object.keys(obj)) if (key2 === oldKey) {
|
|
46865
|
-
newObj[newKey] = obj[oldKey];
|
|
46866
|
-
delete newObj[oldKey];
|
|
46867
|
-
} else newObj[key2] = obj[key2];
|
|
46868
|
-
return newObj;
|
|
46869
|
-
};
|
|
46870
47118
|
const ContentEditorInput$1 = ({ children, onContentChange, disabled, validate, additionalButtons, ...props }) => {
|
|
46871
47119
|
const [newValue, setNewValue] = reactExports.useState(children);
|
|
46872
47120
|
const [resetIncrementor, setResetIncrementor] = reactExports.useState(0);
|
|
@@ -47028,6 +47276,14 @@ const ContentEditorTextArea$1 = ({ children, onContentChange, disabled, validate
|
|
|
47028
47276
|
})]
|
|
47029
47277
|
}, children);
|
|
47030
47278
|
};
|
|
47279
|
+
const renameKey = (obj, oldKey, newKey) => {
|
|
47280
|
+
const newObj = { ...obj };
|
|
47281
|
+
for (const key2 of Object.keys(obj)) if (key2 === oldKey) {
|
|
47282
|
+
newObj[newKey] = obj[oldKey];
|
|
47283
|
+
delete newObj[oldKey];
|
|
47284
|
+
} else newObj[key2] = obj[key2];
|
|
47285
|
+
return newObj;
|
|
47286
|
+
};
|
|
47031
47287
|
const extractInitialState = (value) => {
|
|
47032
47288
|
let comparator;
|
|
47033
47289
|
let numberValue;
|
|
@@ -47218,29 +47474,32 @@ const TranslationTextEditor = ({
|
|
|
47218
47474
|
className: "w-full",
|
|
47219
47475
|
children: /* @__PURE__ */ jsxRuntimeExports.jsx("tbody", {
|
|
47220
47476
|
className: "flex w-full flex-col gap-2",
|
|
47221
|
-
children: localesList.map((translationKey) =>
|
|
47222
|
-
|
|
47223
|
-
|
|
47224
|
-
children: /* @__PURE__ */ jsxRuntimeExports.jsx("
|
|
47225
|
-
className: "
|
|
47226
|
-
children:
|
|
47227
|
-
|
|
47228
|
-
|
|
47229
|
-
className: "flex",
|
|
47230
|
-
children: /* @__PURE__ */ jsxRuntimeExports.jsx("td", {
|
|
47231
|
-
className: "flex w-full",
|
|
47232
|
-
children: /* @__PURE__ */ jsxRuntimeExports.jsx(TextEditorContainer, {
|
|
47233
|
-
section: content2[translationKey] ?? getEmptyNode(content2[defaultLocale]),
|
|
47234
|
-
keyPath: [...keyPath, {
|
|
47235
|
-
type: NodeType.Translation,
|
|
47236
|
-
key: translationKey
|
|
47237
|
-
}],
|
|
47238
|
-
dictionary,
|
|
47239
|
-
renderSection
|
|
47477
|
+
children: localesList.map((translationKey) => {
|
|
47478
|
+
const uniqueKey = `${JSON.stringify(keyPath)}-translation-${translationKey}`;
|
|
47479
|
+
return /* @__PURE__ */ jsxRuntimeExports.jsxs(reactExports.Fragment, {
|
|
47480
|
+
children: [/* @__PURE__ */ jsxRuntimeExports.jsx("tr", {
|
|
47481
|
+
className: "mt-2 w-full p-2 text-xs",
|
|
47482
|
+
children: /* @__PURE__ */ jsxRuntimeExports.jsx("td", {
|
|
47483
|
+
className: "flex w-full",
|
|
47484
|
+
children: getLocaleName(translationKey, locale)
|
|
47240
47485
|
})
|
|
47241
|
-
})
|
|
47242
|
-
|
|
47243
|
-
|
|
47486
|
+
}), /* @__PURE__ */ jsxRuntimeExports.jsx("tr", {
|
|
47487
|
+
className: "flex",
|
|
47488
|
+
children: /* @__PURE__ */ jsxRuntimeExports.jsx("td", {
|
|
47489
|
+
className: "flex w-full",
|
|
47490
|
+
children: /* @__PURE__ */ jsxRuntimeExports.jsx(TextEditorContainer, {
|
|
47491
|
+
section: content2[translationKey] ?? getEmptyNode(content2[defaultLocale]),
|
|
47492
|
+
keyPath: [...keyPath, {
|
|
47493
|
+
type: NodeType.Translation,
|
|
47494
|
+
key: translationKey
|
|
47495
|
+
}],
|
|
47496
|
+
dictionary,
|
|
47497
|
+
renderSection
|
|
47498
|
+
})
|
|
47499
|
+
})
|
|
47500
|
+
})]
|
|
47501
|
+
}, uniqueKey);
|
|
47502
|
+
})
|
|
47244
47503
|
})
|
|
47245
47504
|
});
|
|
47246
47505
|
};
|
|
@@ -47270,6 +47529,7 @@ const EnumerationTextEditor = ({
|
|
|
47270
47529
|
type: NodeType.Enumeration,
|
|
47271
47530
|
key: enumKey
|
|
47272
47531
|
}];
|
|
47532
|
+
const uniqueKey = `${JSON.stringify(keyPath)}-enumeration-${enumKey}`;
|
|
47273
47533
|
return /* @__PURE__ */ jsxRuntimeExports.jsxs(reactExports.Fragment, {
|
|
47274
47534
|
children: [/* @__PURE__ */ jsxRuntimeExports.jsx("tr", {
|
|
47275
47535
|
className: "mt-2 w-full",
|
|
@@ -47319,7 +47579,7 @@ const EnumerationTextEditor = ({
|
|
|
47319
47579
|
})
|
|
47320
47580
|
})
|
|
47321
47581
|
})]
|
|
47322
|
-
},
|
|
47582
|
+
}, uniqueKey);
|
|
47323
47583
|
})
|
|
47324
47584
|
})
|
|
47325
47585
|
}), /* @__PURE__ */ jsxRuntimeExports.jsx(Button, {
|
|
@@ -47349,29 +47609,32 @@ const ConditionTextEditor = ({
|
|
|
47349
47609
|
className: "w-full",
|
|
47350
47610
|
children: /* @__PURE__ */ jsxRuntimeExports.jsx("tbody", {
|
|
47351
47611
|
className: "flex w-full flex-col gap-2",
|
|
47352
|
-
children: ["true", "false", "fallback"].map((condKey) =>
|
|
47353
|
-
|
|
47354
|
-
|
|
47355
|
-
children: /* @__PURE__ */ jsxRuntimeExports.jsx("
|
|
47356
|
-
className: "
|
|
47357
|
-
children:
|
|
47358
|
-
|
|
47359
|
-
|
|
47360
|
-
className: "block w-full",
|
|
47361
|
-
children: /* @__PURE__ */ jsxRuntimeExports.jsx("td", {
|
|
47362
|
-
className: "flex w-full",
|
|
47363
|
-
children: /* @__PURE__ */ jsxRuntimeExports.jsx(TextEditorContainer, {
|
|
47364
|
-
section: content2[condKey] ?? getEmptyNode(content2.true),
|
|
47365
|
-
keyPath: [...keyPath, {
|
|
47366
|
-
type: NodeType.Condition,
|
|
47367
|
-
key: condKey
|
|
47368
|
-
}],
|
|
47369
|
-
dictionary,
|
|
47370
|
-
renderSection
|
|
47612
|
+
children: ["true", "false", "fallback"].map((condKey) => {
|
|
47613
|
+
const uniqueKey = `${JSON.stringify(keyPath)}-condition-${condKey}`;
|
|
47614
|
+
return /* @__PURE__ */ jsxRuntimeExports.jsxs(reactExports.Fragment, {
|
|
47615
|
+
children: [/* @__PURE__ */ jsxRuntimeExports.jsx("tr", {
|
|
47616
|
+
className: "mt-2 block w-full p-2 text-xs",
|
|
47617
|
+
children: /* @__PURE__ */ jsxRuntimeExports.jsx("td", {
|
|
47618
|
+
className: "flex w-full",
|
|
47619
|
+
children: String(condKey)
|
|
47371
47620
|
})
|
|
47372
|
-
})
|
|
47373
|
-
|
|
47374
|
-
|
|
47621
|
+
}), /* @__PURE__ */ jsxRuntimeExports.jsx("tr", {
|
|
47622
|
+
className: "block w-full",
|
|
47623
|
+
children: /* @__PURE__ */ jsxRuntimeExports.jsx("td", {
|
|
47624
|
+
className: "flex w-full",
|
|
47625
|
+
children: /* @__PURE__ */ jsxRuntimeExports.jsx(TextEditorContainer, {
|
|
47626
|
+
section: content2[condKey] ?? getEmptyNode(content2.true),
|
|
47627
|
+
keyPath: [...keyPath, {
|
|
47628
|
+
type: NodeType.Condition,
|
|
47629
|
+
key: condKey
|
|
47630
|
+
}],
|
|
47631
|
+
dictionary,
|
|
47632
|
+
renderSection
|
|
47633
|
+
})
|
|
47634
|
+
})
|
|
47635
|
+
})]
|
|
47636
|
+
}, uniqueKey);
|
|
47637
|
+
})
|
|
47375
47638
|
})
|
|
47376
47639
|
});
|
|
47377
47640
|
};
|
|
@@ -47386,29 +47649,32 @@ const GenderTextEditor = ({
|
|
|
47386
47649
|
className: "w-full",
|
|
47387
47650
|
children: /* @__PURE__ */ jsxRuntimeExports.jsx("tbody", {
|
|
47388
47651
|
className: "flex w-full flex-col gap-2",
|
|
47389
|
-
children: ["male", "female", "fallback"].map((condKey) =>
|
|
47390
|
-
|
|
47391
|
-
|
|
47392
|
-
children: /* @__PURE__ */ jsxRuntimeExports.jsx("
|
|
47393
|
-
className: "
|
|
47394
|
-
children:
|
|
47395
|
-
|
|
47396
|
-
|
|
47397
|
-
className: "block w-full",
|
|
47398
|
-
children: /* @__PURE__ */ jsxRuntimeExports.jsx("td", {
|
|
47399
|
-
className: "flex w-full",
|
|
47400
|
-
children: /* @__PURE__ */ jsxRuntimeExports.jsx(TextEditorContainer, {
|
|
47401
|
-
section: content2[condKey] ?? getEmptyNode(content2.male),
|
|
47402
|
-
keyPath: [...keyPath, {
|
|
47403
|
-
type: NodeType.Gender,
|
|
47404
|
-
key: condKey
|
|
47405
|
-
}],
|
|
47406
|
-
dictionary,
|
|
47407
|
-
renderSection
|
|
47652
|
+
children: ["male", "female", "fallback"].map((condKey) => {
|
|
47653
|
+
const uniqueKey = `${JSON.stringify(keyPath)}-gender-${condKey}`;
|
|
47654
|
+
return /* @__PURE__ */ jsxRuntimeExports.jsxs(reactExports.Fragment, {
|
|
47655
|
+
children: [/* @__PURE__ */ jsxRuntimeExports.jsx("tr", {
|
|
47656
|
+
className: "mt-2 block w-full p-2 text-xs",
|
|
47657
|
+
children: /* @__PURE__ */ jsxRuntimeExports.jsx("td", {
|
|
47658
|
+
className: "flex w-full",
|
|
47659
|
+
children: String(condKey)
|
|
47408
47660
|
})
|
|
47409
|
-
})
|
|
47410
|
-
|
|
47411
|
-
|
|
47661
|
+
}), /* @__PURE__ */ jsxRuntimeExports.jsx("tr", {
|
|
47662
|
+
className: "block w-full",
|
|
47663
|
+
children: /* @__PURE__ */ jsxRuntimeExports.jsx("td", {
|
|
47664
|
+
className: "flex w-full",
|
|
47665
|
+
children: /* @__PURE__ */ jsxRuntimeExports.jsx(TextEditorContainer, {
|
|
47666
|
+
section: content2[condKey] ?? getEmptyNode(content2.male),
|
|
47667
|
+
keyPath: [...keyPath, {
|
|
47668
|
+
type: NodeType.Gender,
|
|
47669
|
+
key: condKey
|
|
47670
|
+
}],
|
|
47671
|
+
dictionary,
|
|
47672
|
+
renderSection
|
|
47673
|
+
})
|
|
47674
|
+
})
|
|
47675
|
+
})]
|
|
47676
|
+
}, uniqueKey);
|
|
47677
|
+
})
|
|
47412
47678
|
})
|
|
47413
47679
|
});
|
|
47414
47680
|
};
|
|
@@ -47431,50 +47697,53 @@ const ArrayTextEditor = ({
|
|
|
47431
47697
|
className: "w-full",
|
|
47432
47698
|
children: /* @__PURE__ */ jsxRuntimeExports.jsx("tbody", {
|
|
47433
47699
|
className: "flex w-full flex-col gap-2",
|
|
47434
|
-
children: section.map((subSection, index2) =>
|
|
47435
|
-
|
|
47436
|
-
|
|
47437
|
-
children: /* @__PURE__ */ jsxRuntimeExports.jsx("
|
|
47438
|
-
className: "
|
|
47439
|
-
children: /* @__PURE__ */ jsxRuntimeExports.
|
|
47440
|
-
className: "flex w-full
|
|
47441
|
-
children:
|
|
47442
|
-
className: "
|
|
47443
|
-
children:
|
|
47444
|
-
|
|
47445
|
-
|
|
47446
|
-
|
|
47447
|
-
|
|
47448
|
-
|
|
47449
|
-
|
|
47450
|
-
|
|
47451
|
-
|
|
47452
|
-
|
|
47453
|
-
|
|
47454
|
-
|
|
47455
|
-
|
|
47456
|
-
|
|
47457
|
-
|
|
47458
|
-
|
|
47459
|
-
|
|
47700
|
+
children: section.map((subSection, index2) => {
|
|
47701
|
+
const uniqueKey = `${JSON.stringify(keyPath)}-array-${index2}`;
|
|
47702
|
+
return /* @__PURE__ */ jsxRuntimeExports.jsxs(reactExports.Fragment, {
|
|
47703
|
+
children: [/* @__PURE__ */ jsxRuntimeExports.jsx("tr", {
|
|
47704
|
+
className: "mt-2 w-full p-2",
|
|
47705
|
+
children: /* @__PURE__ */ jsxRuntimeExports.jsx("td", {
|
|
47706
|
+
className: "flex w-full",
|
|
47707
|
+
children: /* @__PURE__ */ jsxRuntimeExports.jsxs("div", {
|
|
47708
|
+
className: "flex w-full items-center justify-between gap-2",
|
|
47709
|
+
children: [/* @__PURE__ */ jsxRuntimeExports.jsx("span", {
|
|
47710
|
+
className: "text-xs",
|
|
47711
|
+
children: String(index2)
|
|
47712
|
+
}), /* @__PURE__ */ jsxRuntimeExports.jsx(Button, {
|
|
47713
|
+
label: removeElement.label.value,
|
|
47714
|
+
variant: "hoverable",
|
|
47715
|
+
size: "sm",
|
|
47716
|
+
color: "error",
|
|
47717
|
+
className: "ml-auto text-neutral hover:text-error",
|
|
47718
|
+
onClick: () => {
|
|
47719
|
+
const newKeyPath = [...keyPath, {
|
|
47720
|
+
type: NodeType.Array,
|
|
47721
|
+
key: index2
|
|
47722
|
+
}];
|
|
47723
|
+
addEditedContent(dictionary.localId, void 0, newKeyPath);
|
|
47724
|
+
},
|
|
47725
|
+
Icon: Trash,
|
|
47726
|
+
children: removeElement.text
|
|
47727
|
+
})]
|
|
47728
|
+
})
|
|
47460
47729
|
})
|
|
47461
|
-
})
|
|
47462
|
-
|
|
47463
|
-
|
|
47464
|
-
|
|
47465
|
-
|
|
47466
|
-
|
|
47467
|
-
|
|
47468
|
-
|
|
47469
|
-
|
|
47470
|
-
|
|
47471
|
-
|
|
47472
|
-
|
|
47473
|
-
|
|
47730
|
+
}), /* @__PURE__ */ jsxRuntimeExports.jsx("tr", {
|
|
47731
|
+
className: "block w-full",
|
|
47732
|
+
children: /* @__PURE__ */ jsxRuntimeExports.jsx("td", {
|
|
47733
|
+
className: "flex w-full",
|
|
47734
|
+
children: /* @__PURE__ */ jsxRuntimeExports.jsx(TextEditorContainer, {
|
|
47735
|
+
section: subSection ?? getEmptyNode(section[0]),
|
|
47736
|
+
keyPath: [...keyPath, {
|
|
47737
|
+
type: NodeType.Array,
|
|
47738
|
+
key: index2
|
|
47739
|
+
}],
|
|
47740
|
+
dictionary,
|
|
47741
|
+
renderSection
|
|
47742
|
+
})
|
|
47474
47743
|
})
|
|
47475
|
-
})
|
|
47476
|
-
})
|
|
47477
|
-
}
|
|
47744
|
+
})]
|
|
47745
|
+
}, uniqueKey);
|
|
47746
|
+
})
|
|
47478
47747
|
})
|
|
47479
47748
|
}), /* @__PURE__ */ jsxRuntimeExports.jsx(Button, {
|
|
47480
47749
|
label: addNewElement.label.value,
|
|
@@ -47512,6 +47781,7 @@ const ObjectTextEditor = ({
|
|
|
47512
47781
|
const typedSection = section;
|
|
47513
47782
|
const firstKey = Object.keys(typedSection)[0];
|
|
47514
47783
|
const subSection = typedSection[key2] ?? getEmptyNode(typedSection[firstKey]);
|
|
47784
|
+
const uniqueKey = `${JSON.stringify(keyPath)}-object-${key2}`;
|
|
47515
47785
|
return /* @__PURE__ */ jsxRuntimeExports.jsxs(reactExports.Fragment, {
|
|
47516
47786
|
children: [/* @__PURE__ */ jsxRuntimeExports.jsx("tr", {
|
|
47517
47787
|
className: "mt-2 p-2 text-xs",
|
|
@@ -47519,7 +47789,7 @@ const ObjectTextEditor = ({
|
|
|
47519
47789
|
className: "flex w-full",
|
|
47520
47790
|
children: String(key2)
|
|
47521
47791
|
})
|
|
47522
|
-
}
|
|
47792
|
+
}), /* @__PURE__ */ jsxRuntimeExports.jsx("tr", {
|
|
47523
47793
|
className: "block w-full",
|
|
47524
47794
|
children: /* @__PURE__ */ jsxRuntimeExports.jsx("td", {
|
|
47525
47795
|
className: "flex w-full",
|
|
@@ -47530,8 +47800,8 @@ const ObjectTextEditor = ({
|
|
|
47530
47800
|
renderSection
|
|
47531
47801
|
})
|
|
47532
47802
|
})
|
|
47533
|
-
}
|
|
47534
|
-
},
|
|
47803
|
+
})]
|
|
47804
|
+
}, uniqueKey);
|
|
47535
47805
|
})
|
|
47536
47806
|
})
|
|
47537
47807
|
})
|
|
@@ -55447,7 +55717,7 @@ const ObjectView = ({
|
|
|
55447
55717
|
}],
|
|
55448
55718
|
dictionaryLocalId
|
|
55449
55719
|
})
|
|
55450
|
-
}, key2))
|
|
55720
|
+
}, `${JSON.stringify(keyPath)}-object-${key2}`))
|
|
55451
55721
|
}), /* @__PURE__ */ jsxRuntimeExports.jsx(Button, {
|
|
55452
55722
|
label: addNodeButton.label.value,
|
|
55453
55723
|
variant: ButtonVariant.HOVERABLE,
|
|
@@ -55585,203 +55855,6 @@ const DictionaryFieldEditor = ({
|
|
|
55585
55855
|
})
|
|
55586
55856
|
});
|
|
55587
55857
|
};
|
|
55588
|
-
const getBreakpointFromSize = (breakpoint) => {
|
|
55589
|
-
switch (breakpoint) {
|
|
55590
|
-
case "xs":
|
|
55591
|
-
return 480;
|
|
55592
|
-
case "sm":
|
|
55593
|
-
return 640;
|
|
55594
|
-
case "md":
|
|
55595
|
-
return 768;
|
|
55596
|
-
case "lg":
|
|
55597
|
-
return 1024;
|
|
55598
|
-
case "xl":
|
|
55599
|
-
return 1280;
|
|
55600
|
-
case "2xl":
|
|
55601
|
-
return 1536;
|
|
55602
|
-
default:
|
|
55603
|
-
return breakpoint;
|
|
55604
|
-
}
|
|
55605
|
-
};
|
|
55606
|
-
const checkIsMobileUserAgent = () => {
|
|
55607
|
-
if (typeof window === "undefined") return;
|
|
55608
|
-
const userAgent = window.navigator?.userAgent;
|
|
55609
|
-
if (typeof userAgent === "undefined") return;
|
|
55610
|
-
return /android|bb\d+|meego|avantgo|bada\/|blackberry|blazer|compal|elaine|fennec|hiptop|iemobile|ip(?:hone|od|ad)|iris|kindle|lge |maemo|midp|mmp|mobile.+firefox|netfront|opera m(?:ob|in)i|palm(?: os)?|phone|p(?:ixi|re)\/|plucker|pocket|psp|series(?:4|6)0|symbian|treo|up\.(?:browser|link)|vodafone|wap|windows ce|windows phone|xda|xiino|zte-/i.test(userAgent);
|
|
55611
|
-
};
|
|
55612
|
-
const checkIsIOS = () => {
|
|
55613
|
-
if (typeof window === "undefined") return;
|
|
55614
|
-
const userAgent = window.navigator?.userAgent;
|
|
55615
|
-
if (typeof userAgent === "undefined") return;
|
|
55616
|
-
return /iP(?:hone|ad|od)/.test(userAgent);
|
|
55617
|
-
};
|
|
55618
|
-
const checkIsMac = () => {
|
|
55619
|
-
if (typeof window === "undefined") return;
|
|
55620
|
-
const userAgent = window.navigator?.userAgent;
|
|
55621
|
-
if (typeof userAgent === "undefined") return;
|
|
55622
|
-
return /Macintosh|MacIntel|Mac OS X/.test(userAgent);
|
|
55623
|
-
};
|
|
55624
|
-
const checkIsMobileScreen = (breakpoint) => {
|
|
55625
|
-
if (typeof window === "undefined") return;
|
|
55626
|
-
return (window?.innerWidth ?? 0) <= breakpoint;
|
|
55627
|
-
};
|
|
55628
|
-
const calculateIsMobile = (breakpoint = "md") => {
|
|
55629
|
-
const breakpointValue = getBreakpointFromSize(breakpoint);
|
|
55630
|
-
const isMobileUserAgent = checkIsMobileUserAgent();
|
|
55631
|
-
const isMobileScreen = checkIsMobileScreen(breakpointValue);
|
|
55632
|
-
return {
|
|
55633
|
-
isMobileScreen,
|
|
55634
|
-
isMobileUserAgent,
|
|
55635
|
-
isMobile: isMobileScreen ?? isMobileUserAgent,
|
|
55636
|
-
isIOS: checkIsIOS(),
|
|
55637
|
-
isMac: checkIsMac()
|
|
55638
|
-
};
|
|
55639
|
-
};
|
|
55640
|
-
const useDevice = (breakpoint = "md") => {
|
|
55641
|
-
const [result, setResult] = reactExports.useState(calculateIsMobile(breakpoint));
|
|
55642
|
-
reactExports.useEffect(() => {
|
|
55643
|
-
const handleResize = () => {
|
|
55644
|
-
setResult(calculateIsMobile(breakpoint));
|
|
55645
|
-
};
|
|
55646
|
-
window.addEventListener("resize", handleResize, { passive: true });
|
|
55647
|
-
return () => window.removeEventListener("resize", handleResize);
|
|
55648
|
-
}, [breakpoint]);
|
|
55649
|
-
return result;
|
|
55650
|
-
};
|
|
55651
|
-
const parseShortcut = (shortcut) => {
|
|
55652
|
-
return shortcut.split(" + ").map((key2) => key2.trim());
|
|
55653
|
-
};
|
|
55654
|
-
const normalizeKey = (key2) => {
|
|
55655
|
-
return {
|
|
55656
|
-
"⌘": "Meta",
|
|
55657
|
-
Ctrl: "Control",
|
|
55658
|
-
Control: "Control",
|
|
55659
|
-
Alt: "Alt",
|
|
55660
|
-
"⌥": "Alt",
|
|
55661
|
-
Shift: "Shift",
|
|
55662
|
-
Meta: "Meta",
|
|
55663
|
-
"↑": "ArrowUp",
|
|
55664
|
-
"↓": "ArrowDown",
|
|
55665
|
-
"←": "ArrowLeft",
|
|
55666
|
-
"→": "ArrowRight",
|
|
55667
|
-
ArrowUp: "ArrowUp",
|
|
55668
|
-
ArrowDown: "ArrowDown",
|
|
55669
|
-
ArrowLeft: "ArrowLeft",
|
|
55670
|
-
ArrowRight: "ArrowRight"
|
|
55671
|
-
}[key2] || key2;
|
|
55672
|
-
};
|
|
55673
|
-
const matchesShortcut = (event, keys) => {
|
|
55674
|
-
const normalizedKeys = keys.map(normalizeKey);
|
|
55675
|
-
const hasModifiers = {
|
|
55676
|
-
Meta: normalizedKeys.includes("Meta"),
|
|
55677
|
-
Control: normalizedKeys.includes("Control"),
|
|
55678
|
-
Alt: normalizedKeys.includes("Alt"),
|
|
55679
|
-
Shift: normalizedKeys.includes("Shift")
|
|
55680
|
-
};
|
|
55681
|
-
if (hasModifiers.Meta !== event.metaKey || hasModifiers.Control !== event.ctrlKey || hasModifiers.Alt !== event.altKey || hasModifiers.Shift !== event.shiftKey) return false;
|
|
55682
|
-
const nonModifierKey = keys.find((key2) => ![
|
|
55683
|
-
"⌘",
|
|
55684
|
-
"Ctrl",
|
|
55685
|
-
"Control",
|
|
55686
|
-
"Alt",
|
|
55687
|
-
"⌥",
|
|
55688
|
-
"Shift",
|
|
55689
|
-
"Meta"
|
|
55690
|
-
].includes(normalizeKey(key2)));
|
|
55691
|
-
if (!nonModifierKey) return false;
|
|
55692
|
-
const normalizedNonModifierKey = normalizeKey(nonModifierKey);
|
|
55693
|
-
if (normalizedNonModifierKey.startsWith("Arrow")) return event.key === normalizedNonModifierKey;
|
|
55694
|
-
return event.key.toLowerCase() === normalizedNonModifierKey.toLowerCase();
|
|
55695
|
-
};
|
|
55696
|
-
const getDisplayKey = (key2) => {
|
|
55697
|
-
return {
|
|
55698
|
-
ArrowUp: "↑",
|
|
55699
|
-
ArrowDown: "↓",
|
|
55700
|
-
ArrowLeft: "←",
|
|
55701
|
-
ArrowRight: "→"
|
|
55702
|
-
}[key2] || key2;
|
|
55703
|
-
};
|
|
55704
|
-
const getDisplayShortcut = (shortcut, isMac) => {
|
|
55705
|
-
let result = shortcut;
|
|
55706
|
-
if (isMac) {
|
|
55707
|
-
result = result.replace(/Ctrl/g, "⌘");
|
|
55708
|
-
result = result.replace(/Alt/g, "⌥");
|
|
55709
|
-
} else {
|
|
55710
|
-
result = result.replace(/⌘/g, "Ctrl");
|
|
55711
|
-
result = result.replace(/⌥/g, "Alt");
|
|
55712
|
-
}
|
|
55713
|
-
result = result.replace(/ArrowUp/g, "↑");
|
|
55714
|
-
result = result.replace(/ArrowDown/g, "↓");
|
|
55715
|
-
result = result.replace(/ArrowLeft/g, "←");
|
|
55716
|
-
result = result.replace(/ArrowRight/g, "→");
|
|
55717
|
-
return result;
|
|
55718
|
-
};
|
|
55719
|
-
const KeyboardShortcut = ({ shortcut, onTriggered, display = true, className, size: size2 = "md" }) => {
|
|
55720
|
-
const { isMac } = useDevice();
|
|
55721
|
-
const keys = parseShortcut(getDisplayShortcut(shortcut, isMac ?? false));
|
|
55722
|
-
const [pressedKeys, setPressedKeys] = reactExports.useState(/* @__PURE__ */ new Set());
|
|
55723
|
-
reactExports.useEffect(() => {
|
|
55724
|
-
const handleKeyDown = (event) => {
|
|
55725
|
-
const target = event.target;
|
|
55726
|
-
const isInputField = target.tagName === "INPUT" || target.tagName === "TEXTAREA" || target.isContentEditable;
|
|
55727
|
-
const currentKey = event.key;
|
|
55728
|
-
const normalizedEventKeys = /* @__PURE__ */ new Set();
|
|
55729
|
-
if (event.metaKey) normalizedEventKeys.add("⌘");
|
|
55730
|
-
if (event.ctrlKey) normalizedEventKeys.add("Ctrl");
|
|
55731
|
-
if (event.altKey) normalizedEventKeys.add(isMac ? "⌥" : "Alt");
|
|
55732
|
-
if (event.shiftKey) normalizedEventKeys.add("Shift");
|
|
55733
|
-
if (currentKey.startsWith("Arrow")) {
|
|
55734
|
-
normalizedEventKeys.add(currentKey);
|
|
55735
|
-
normalizedEventKeys.add(getDisplayKey(currentKey));
|
|
55736
|
-
} else normalizedEventKeys.add(currentKey.toUpperCase());
|
|
55737
|
-
setPressedKeys(normalizedEventKeys);
|
|
55738
|
-
if (onTriggered && matchesShortcut(event, keys)) {
|
|
55739
|
-
const isEscapeShortcut = keys.includes("Escape");
|
|
55740
|
-
if (isInputField && !isEscapeShortcut) return;
|
|
55741
|
-
event.preventDefault();
|
|
55742
|
-
onTriggered();
|
|
55743
|
-
}
|
|
55744
|
-
};
|
|
55745
|
-
const handleKeyUp = () => {
|
|
55746
|
-
setPressedKeys(/* @__PURE__ */ new Set());
|
|
55747
|
-
};
|
|
55748
|
-
window.addEventListener("keydown", handleKeyDown);
|
|
55749
|
-
window.addEventListener("keyup", handleKeyUp);
|
|
55750
|
-
window.addEventListener("blur", handleKeyUp);
|
|
55751
|
-
return () => {
|
|
55752
|
-
window.removeEventListener("keydown", handleKeyDown);
|
|
55753
|
-
window.removeEventListener("keyup", handleKeyUp);
|
|
55754
|
-
window.removeEventListener("blur", handleKeyUp);
|
|
55755
|
-
};
|
|
55756
|
-
}, [
|
|
55757
|
-
keys,
|
|
55758
|
-
onTriggered,
|
|
55759
|
-
isMac
|
|
55760
|
-
]);
|
|
55761
|
-
if (!display) return null;
|
|
55762
|
-
const isKeyPressed = (key2) => {
|
|
55763
|
-
const upperKey = key2.toUpperCase();
|
|
55764
|
-
const normalizedKey = normalizeKey(key2);
|
|
55765
|
-
return pressedKeys.has(key2) || pressedKeys.has(upperKey) || pressedKeys.has(normalizedKey) || key2 === "⌘" && pressedKeys.has("Meta") || key2 === "Ctrl" && pressedKeys.has("Control") || key2 === "⌥" && pressedKeys.has("Alt") || key2 === "Alt" && pressedKeys.has("Alt") || key2 === "←" && pressedKeys.has("ArrowLeft") || key2 === "→" && pressedKeys.has("ArrowRight") || key2 === "↑" && pressedKeys.has("ArrowUp") || key2 === "↓" && pressedKeys.has("ArrowDown");
|
|
55766
|
-
};
|
|
55767
|
-
return /* @__PURE__ */ jsxRuntimeExports.jsx("kbd", {
|
|
55768
|
-
className: cn$2("inline-flex items-center justify-center gap-0.5 p-0.5", "rounded-lg [corner-shape:squircle] supports-[corner-shape:squircle]:rounded-xl", "font-medium font-sans", "border-1 border-neutral/20 text-neutral", size2 === "sm" && "text-xs", size2 === "md" && "text-sm", size2 === "lg" && "text-base", className),
|
|
55769
|
-
children: keys.map((key2, index2) => {
|
|
55770
|
-
const keyId = `${key2}-${index2}-${shortcut}`;
|
|
55771
|
-
const displayKey = getDisplayKey(key2);
|
|
55772
|
-
return /* @__PURE__ */ jsxRuntimeExports.jsxs("span", {
|
|
55773
|
-
className: "inline-flex items-center",
|
|
55774
|
-
children: [index2 > 0 && /* @__PURE__ */ jsxRuntimeExports.jsx("span", {
|
|
55775
|
-
className: "text-neutral/50",
|
|
55776
|
-
children: "+"
|
|
55777
|
-
}), /* @__PURE__ */ jsxRuntimeExports.jsx("span", {
|
|
55778
|
-
className: cn$2("min-w-4 px-0.5", isKeyPressed(key2) && "scale-120 font-bold text-text"),
|
|
55779
|
-
children: displayKey
|
|
55780
|
-
})]
|
|
55781
|
-
}, keyId);
|
|
55782
|
-
})
|
|
55783
|
-
});
|
|
55784
|
-
};
|
|
55785
55858
|
const MaxWidthSmoother = ({ children, isHidden: isHidden2, minWidth = 0, align = "left", className, ...props }) => /* @__PURE__ */ jsxRuntimeExports.jsx("div", {
|
|
55786
55859
|
className: cn$2("relative grid h-full grid-cols-[0fr] overflow-x-hidden overflow-y-hidden transition-all duration-500 ease-in-out", isHidden2 ? "" : "grid-cols-[1fr]", className),
|
|
55787
55860
|
"aria-hidden": isHidden2,
|
|
@@ -55989,6 +56062,7 @@ let TagRoundedSize = /* @__PURE__ */ (function(TagRoundedSize$1) {
|
|
|
55989
56062
|
return TagRoundedSize$1;
|
|
55990
56063
|
})({});
|
|
55991
56064
|
let TagColor = /* @__PURE__ */ (function(TagColor$1) {
|
|
56065
|
+
TagColor$1["PRIMARY"] = "primary";
|
|
55992
56066
|
TagColor$1["SUCCESS"] = "success";
|
|
55993
56067
|
TagColor$1["ERROR"] = "error";
|
|
55994
56068
|
TagColor$1["WARNING"] = "warning";
|
|
@@ -56038,6 +56112,7 @@ const containerVariants = cva("w-fit backdrop-blur", {
|
|
|
56038
56112
|
[`${TagRoundedSize.FULL}`]: "rounded-full"
|
|
56039
56113
|
},
|
|
56040
56114
|
color: {
|
|
56115
|
+
[`${TagColor.PRIMARY}`]: "border-primary bg-primary/10 text-primary",
|
|
56041
56116
|
[`${TagColor.SUCCESS}`]: "border-success bg-success/10 text-success",
|
|
56042
56117
|
[`${TagColor.ERROR}`]: "border-error bg-error/10 text-error",
|
|
56043
56118
|
[`${TagColor.WARNING}`]: "border-warning bg-warning/10 text-warning",
|
|
@@ -56891,9 +56966,9 @@ const Toaster = () => {
|
|
|
56891
56966
|
const defaultQueryOptions = {
|
|
56892
56967
|
queries: {
|
|
56893
56968
|
retry: 1,
|
|
56894
|
-
staleTime:
|
|
56969
|
+
staleTime: 30 * 1e3,
|
|
56895
56970
|
gcTime: 300 * 1e3,
|
|
56896
|
-
refetchOnMount:
|
|
56971
|
+
refetchOnMount: true,
|
|
56897
56972
|
refetchOnWindowFocus: false,
|
|
56898
56973
|
refetchOnReconnect: false
|
|
56899
56974
|
},
|
|
@@ -58049,6 +58124,9 @@ const NoApplicationURLView = () => {
|
|
|
58049
58124
|
label: documentationLink.label.value,
|
|
58050
58125
|
href: "https://intlayer.org/doc/concept/configuration#editor-configuration",
|
|
58051
58126
|
color: "text",
|
|
58127
|
+
variant: "button",
|
|
58128
|
+
className: "ml-auto",
|
|
58129
|
+
isExternalLink: true,
|
|
58052
58130
|
children: documentationLink.text
|
|
58053
58131
|
});
|
|
58054
58132
|
$2[4] = documentationLink.label.value;
|
|
@@ -58119,7 +58197,7 @@ const IframeController = (t0) => {
|
|
|
58119
58197
|
if (!editor2.applicationURL) {
|
|
58120
58198
|
let t42;
|
|
58121
58199
|
if ($2[4] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel")) {
|
|
58122
|
-
t42 = /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
58200
|
+
t42 = /* @__PURE__ */ jsxRuntimeExports.jsx(Container, { className: "max-w-xl", padding: "xl", roundedSize: "2xl", children: /* @__PURE__ */ jsxRuntimeExports.jsx(NoApplicationURLView, {}) });
|
|
58123
58201
|
$2[4] = t42;
|
|
58124
58202
|
} else {
|
|
58125
58203
|
t42 = $2[4];
|