@intlayer/design-system 6.0.2 → 6.1.0
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/README.md +249 -56
- package/dist/.vite/manifest.json +42 -62
- package/dist/{better-auth.CMQ3rA-I-7umXOENE.js → better-auth.CiuwFiHM-7umXOENE.js} +1 -1
- package/dist/better-auth.CiuwFiHM-7umXOENE.js.map +1 -0
- package/dist/{better-auth.CMQ3rA-I-C2nBKRMa.cjs → better-auth.CiuwFiHM-C2nBKRMa.cjs} +1 -1
- package/dist/better-auth.CiuwFiHM-C2nBKRMa.cjs.map +1 -0
- package/dist/components/DictionaryFieldEditor/ContentEditorView/TextEditor.cjs +1 -1
- package/dist/components/DictionaryFieldEditor/ContentEditorView/TextEditor.mjs +1 -1
- package/dist/components/DictionaryFieldEditor/DictionaryCreationForm/DictionaryCreationForm.cjs +1 -1
- package/dist/components/DictionaryFieldEditor/DictionaryCreationForm/DictionaryCreationForm.mjs +1 -1
- package/dist/components/DictionaryFieldEditor/DictionaryCreationForm/useDictionaryFormSchema.cjs +1 -1
- package/dist/components/DictionaryFieldEditor/DictionaryCreationForm/useDictionaryFormSchema.mjs +1 -1
- package/dist/components/DictionaryFieldEditor/DictionaryDetails/DictionaryDetailsForm.cjs +1 -1
- package/dist/components/DictionaryFieldEditor/DictionaryDetails/DictionaryDetailsForm.mjs +1 -1
- package/dist/components/DictionaryFieldEditor/DictionaryDetails/useDictionaryDetailsSchema.cjs +1 -1
- package/dist/components/DictionaryFieldEditor/DictionaryDetails/useDictionaryDetailsSchema.mjs +1 -1
- package/dist/components/DictionaryFieldEditor/DictionaryFieldEditor.cjs +1 -1
- package/dist/components/DictionaryFieldEditor/DictionaryFieldEditor.mjs +1 -1
- package/dist/components/DictionaryFieldEditor/SaveForm/SaveForm.cjs +12 -1
- package/dist/components/DictionaryFieldEditor/SaveForm/SaveForm.cjs.map +1 -1
- package/dist/components/DictionaryFieldEditor/SaveForm/SaveForm.d.ts.map +1 -1
- package/dist/components/DictionaryFieldEditor/SaveForm/SaveForm.mjs +13 -2
- package/dist/components/DictionaryFieldEditor/SaveForm/SaveForm.mjs.map +1 -1
- package/dist/components/DictionaryFieldEditor/StructureView/StructureView.cjs +1 -1
- package/dist/components/DictionaryFieldEditor/StructureView/StructureView.mjs +1 -1
- package/dist/components/DictionaryFieldEditor/VersionSwitcherDropDown/VersionSwitcherContext.cjs +1 -1
- package/dist/components/DictionaryFieldEditor/VersionSwitcherDropDown/VersionSwitcherContext.mjs +1 -1
- package/dist/components/EditableField/EditableFieldTextArea.cjs +1 -1
- package/dist/components/EditableField/EditableFieldTextArea.mjs +1 -1
- package/dist/components/Form/FormBase.cjs +1 -1
- package/dist/components/Form/FormBase.mjs +1 -1
- package/dist/components/Form/elements/FormElementWrapper.cjs +2 -2
- package/dist/components/Form/elements/FormElementWrapper.mjs +2 -2
- package/dist/components/IDE/CodeContext.cjs +1 -1
- package/dist/components/IDE/CodeContext.mjs +1 -1
- package/dist/components/LocaleSwitcherContentDropDown/LocaleSwitcherContent.cjs +1 -1
- package/dist/components/LocaleSwitcherContentDropDown/LocaleSwitcherContent.mjs +1 -1
- package/dist/components/LocaleSwitcherContentDropDown/LocaleSwitcherContentContext.cjs +1 -1
- package/dist/components/LocaleSwitcherContentDropDown/LocaleSwitcherContentContext.mjs +1 -1
- package/dist/components/MarkDownRender/index.cjs +1 -1
- package/dist/components/MarkDownRender/index.cjs.map +1 -1
- package/dist/components/MarkDownRender/index.mjs +1 -1
- package/dist/components/MarkDownRender/index.mjs.map +1 -1
- package/dist/components/Modal/Modal.cjs +1 -1
- package/dist/components/Modal/Modal.mjs +1 -1
- package/dist/components/Navbar/DesktopNavbar.cjs +14 -16
- package/dist/components/Navbar/DesktopNavbar.cjs.map +1 -1
- package/dist/components/Navbar/DesktopNavbar.d.ts.map +1 -1
- package/dist/components/Navbar/DesktopNavbar.mjs +14 -16
- package/dist/components/Navbar/DesktopNavbar.mjs.map +1 -1
- package/dist/components/Navbar/MobileNavbar.cjs +1 -1
- package/dist/components/Navbar/MobileNavbar.mjs +1 -1
- package/dist/components/Navbar/index.cjs +1 -1
- package/dist/components/Navbar/index.mjs +1 -1
- package/dist/components/SwitchSelector/index.cjs +1 -1
- package/dist/components/SwitchSelector/index.mjs +1 -1
- package/dist/components/TabSelector/TabSelector.cjs +1 -1
- package/dist/components/TabSelector/TabSelector.mjs +1 -1
- package/dist/hooks/auth.cjs +13 -7
- package/dist/hooks/auth.cjs.map +1 -1
- package/dist/hooks/auth.mjs +12 -6
- package/dist/hooks/auth.mjs.map +1 -1
- package/dist/hooks/reactQuery.cjs +1 -1
- package/dist/hooks/reactQuery.d.ts +111 -43
- package/dist/hooks/reactQuery.d.ts.map +1 -1
- package/dist/hooks/reactQuery.mjs +1 -1
- package/dist/hooks/useAuth/useAuth.cjs.map +1 -1
- package/dist/hooks/useAuth/useAuth.d.ts +1 -0
- package/dist/hooks/useAuth/useAuth.d.ts.map +1 -1
- package/dist/hooks/useAuth/useAuth.mjs.map +1 -1
- package/dist/hooks/useAuth/useOAuth2.d.ts +1 -1
- package/dist/hooks/useAuth/useSession.d.ts +88 -1
- package/dist/hooks/useAuth/useSession.d.ts.map +1 -1
- package/dist/hooks/useUser/index.cjs +1 -1
- package/dist/hooks/useUser/index.d.ts +18 -2
- package/dist/hooks/useUser/index.d.ts.map +1 -1
- package/dist/hooks/useUser/index.mjs +1 -1
- package/dist/index-BCuMWKyy.js.map +1 -1
- package/dist/index-BYzBot7l.cjs.map +1 -1
- package/dist/{schemas-lh5OFOvX.cjs → schemas-0lUZlFWF.cjs} +703 -240
- package/dist/schemas-0lUZlFWF.cjs.map +1 -0
- package/dist/{schemas-DEXdAbCK.js → schemas-BG_GIt-j.js} +465 -2
- package/dist/schemas-BG_GIt-j.js.map +1 -0
- package/dist/zod-CCm3hUBS.js +210 -0
- package/dist/zod-CCm3hUBS.js.map +1 -0
- package/dist/zod-CvjrdkEg.cjs +209 -0
- package/dist/zod-CvjrdkEg.cjs.map +1 -0
- package/package.json +45 -43
- package/dist/better-auth.CMQ3rA-I-7umXOENE.js.map +0 -1
- package/dist/better-auth.CMQ3rA-I-C2nBKRMa.cjs.map +0 -1
- package/dist/parse-Ltyyb1op.cjs +0 -509
- package/dist/parse-Ltyyb1op.cjs.map +0 -1
- package/dist/parse-Vrm0h1r9.js +0 -510
- package/dist/parse-Vrm0h1r9.js.map +0 -1
- package/dist/schemas-DEXdAbCK.js.map +0 -1
- package/dist/schemas-lh5OFOvX.cjs.map +0 -1
- package/dist/zod-BvUVjPTw.cjs +0 -91
- package/dist/zod-BvUVjPTw.cjs.map +0 -1
- package/dist/zod-CJrbzxwg.js +0 -92
- package/dist/zod-CJrbzxwg.js.map +0 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"better-auth.CiuwFiHM-7umXOENE.js","sources":["../../../../node_modules/.pnpm/better-auth@1.3.16_next@15.5.4_@babel+core@7.28.4_@opentelemetry+api@1.9.0_react-dom@19_5e39a19fab8829b2d7dbe3167dd9fec3/node_modules/better-auth/dist/shared/better-auth.CiuwFiHM.mjs"],"sourcesContent":["const _envShim = /* @__PURE__ */ Object.create(null);\nconst _getEnv = (useShim) => globalThis.process?.env || //@ts-expect-error\nglobalThis.Deno?.env.toObject() || //@ts-expect-error\nglobalThis.__env__ || (useShim ? _envShim : globalThis);\nconst env = new Proxy(_envShim, {\n get(_, prop) {\n const env2 = _getEnv();\n return env2[prop] ?? _envShim[prop];\n },\n has(_, prop) {\n const env2 = _getEnv();\n return prop in env2 || prop in _envShim;\n },\n set(_, prop, value) {\n const env2 = _getEnv(true);\n env2[prop] = value;\n return true;\n },\n deleteProperty(_, prop) {\n if (!prop) {\n return false;\n }\n const env2 = _getEnv(true);\n delete env2[prop];\n return true;\n },\n ownKeys() {\n const env2 = _getEnv(true);\n return Object.keys(env2);\n }\n});\nfunction toBoolean(val) {\n return val ? val !== \"false\" : false;\n}\nconst nodeENV = typeof process !== \"undefined\" && process.env && process.env.NODE_ENV || \"\";\nconst isProduction = nodeENV === \"production\";\nconst isDevelopment = nodeENV === \"dev\" || nodeENV === \"development\";\nconst isTest = () => nodeENV === \"test\" || toBoolean(env.TEST);\nfunction getEnvVar(key, fallback) {\n if (typeof process !== \"undefined\" && process.env) {\n return process.env[key] ?? fallback;\n }\n if (typeof Deno !== \"undefined\") {\n return Deno.env.get(key) ?? fallback;\n }\n if (typeof Bun !== \"undefined\") {\n return Bun.env[key] ?? fallback;\n }\n return fallback;\n}\nfunction getBooleanEnvVar(key, fallback = true) {\n const value = getEnvVar(key);\n if (!value) return fallback;\n return value !== \"0\" && value.toLowerCase() !== \"false\" && value !== \"\";\n}\nconst ENV = {\n get BETTER_AUTH_TELEMETRY_ENDPOINT() {\n return getEnvVar(\n \"BETTER_AUTH_TELEMETRY_ENDPOINT\",\n \"https://telemetry.better-auth.com/v1/track\"\n );\n }\n};\n\nexport { ENV as E, isDevelopment as a, isProduction as b, getBooleanEnvVar as c, env as e, getEnvVar as g, isTest as i };\n"],"names":[],"mappings":"AAAA,MAAM,WAA2B,uBAAO,OAAO,IAAI;AACnD,MAAM,UAAU,CAAC,YAAY,WAAW,SAAS;AACjD,WAAW,MAAM,IAAI,SAAA;AACrB,WAAW,YAAY,UAAU,WAAW;AAC5C,MAAM,MAAM,IAAI,MAAM,UAAU;AAAA,EAC9B,IAAI,GAAG,MAAM;AACX,UAAM,OAAO,QAAA;AACb,WAAO,KAAK,IAAI,KAAK,SAAS,IAAI;AAAA,EACpC;AAAA,EACA,IAAI,GAAG,MAAM;AACX,UAAM,OAAO,QAAA;AACb,WAAO,QAAQ,QAAQ,QAAQ;AAAA,EACjC;AAAA,EACA,IAAI,GAAG,MAAM,OAAO;AAClB,UAAM,OAAO,QAAQ,IAAI;AACzB,SAAK,IAAI,IAAI;AACb,WAAO;AAAA,EACT;AAAA,EACA,eAAe,GAAG,MAAM;AACtB,QAAI,CAAC,MAAM;AACT,aAAO;AAAA,IACT;AACA,UAAM,OAAO,QAAQ,IAAI;AACzB,WAAO,KAAK,IAAI;AAChB,WAAO;AAAA,EACT;AAAA,EACA,UAAU;AACR,UAAM,OAAO,QAAQ,IAAI;AACzB,WAAO,OAAO,KAAK,IAAI;AAAA,EACzB;AACF,CAAC;","x_google_ignoreList":[0]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"better-auth.CiuwFiHM-C2nBKRMa.cjs","sources":["../../../../node_modules/.pnpm/better-auth@1.3.16_next@15.5.4_@babel+core@7.28.4_@opentelemetry+api@1.9.0_react-dom@19_5e39a19fab8829b2d7dbe3167dd9fec3/node_modules/better-auth/dist/shared/better-auth.CiuwFiHM.mjs"],"sourcesContent":["const _envShim = /* @__PURE__ */ Object.create(null);\nconst _getEnv = (useShim) => globalThis.process?.env || //@ts-expect-error\nglobalThis.Deno?.env.toObject() || //@ts-expect-error\nglobalThis.__env__ || (useShim ? _envShim : globalThis);\nconst env = new Proxy(_envShim, {\n get(_, prop) {\n const env2 = _getEnv();\n return env2[prop] ?? _envShim[prop];\n },\n has(_, prop) {\n const env2 = _getEnv();\n return prop in env2 || prop in _envShim;\n },\n set(_, prop, value) {\n const env2 = _getEnv(true);\n env2[prop] = value;\n return true;\n },\n deleteProperty(_, prop) {\n if (!prop) {\n return false;\n }\n const env2 = _getEnv(true);\n delete env2[prop];\n return true;\n },\n ownKeys() {\n const env2 = _getEnv(true);\n return Object.keys(env2);\n }\n});\nfunction toBoolean(val) {\n return val ? val !== \"false\" : false;\n}\nconst nodeENV = typeof process !== \"undefined\" && process.env && process.env.NODE_ENV || \"\";\nconst isProduction = nodeENV === \"production\";\nconst isDevelopment = nodeENV === \"dev\" || nodeENV === \"development\";\nconst isTest = () => nodeENV === \"test\" || toBoolean(env.TEST);\nfunction getEnvVar(key, fallback) {\n if (typeof process !== \"undefined\" && process.env) {\n return process.env[key] ?? fallback;\n }\n if (typeof Deno !== \"undefined\") {\n return Deno.env.get(key) ?? fallback;\n }\n if (typeof Bun !== \"undefined\") {\n return Bun.env[key] ?? fallback;\n }\n return fallback;\n}\nfunction getBooleanEnvVar(key, fallback = true) {\n const value = getEnvVar(key);\n if (!value) return fallback;\n return value !== \"0\" && value.toLowerCase() !== \"false\" && value !== \"\";\n}\nconst ENV = {\n get BETTER_AUTH_TELEMETRY_ENDPOINT() {\n return getEnvVar(\n \"BETTER_AUTH_TELEMETRY_ENDPOINT\",\n \"https://telemetry.better-auth.com/v1/track\"\n );\n }\n};\n\nexport { ENV as E, isDevelopment as a, isProduction as b, getBooleanEnvVar as c, env as e, getEnvVar as g, isTest as i };\n"],"names":[],"mappings":";AAAA,MAAM,WAA2B,uBAAO,OAAO,IAAI;AACnD,MAAM,UAAU,CAAC,YAAY,WAAW,SAAS;AACjD,WAAW,MAAM,IAAI,SAAA;AACrB,WAAW,YAAY,UAAU,WAAW;AAC5C,MAAM,MAAM,IAAI,MAAM,UAAU;AAAA,EAC9B,IAAI,GAAG,MAAM;AACX,UAAM,OAAO,QAAA;AACb,WAAO,KAAK,IAAI,KAAK,SAAS,IAAI;AAAA,EACpC;AAAA,EACA,IAAI,GAAG,MAAM;AACX,UAAM,OAAO,QAAA;AACb,WAAO,QAAQ,QAAQ,QAAQ;AAAA,EACjC;AAAA,EACA,IAAI,GAAG,MAAM,OAAO;AAClB,UAAM,OAAO,QAAQ,IAAI;AACzB,SAAK,IAAI,IAAI;AACb,WAAO;AAAA,EACT;AAAA,EACA,eAAe,GAAG,MAAM;AACtB,QAAI,CAAC,MAAM;AACT,aAAO;AAAA,IACT;AACA,UAAM,OAAO,QAAQ,IAAI;AACzB,WAAO,KAAK,IAAI;AAChB,WAAO;AAAA,EACT;AAAA,EACA,UAAU;AACR,UAAM,OAAO,QAAQ,IAAI;AACzB,WAAO,OAAO,KAAK,IAAI;AAAA,EACzB;AACF,CAAC;;","x_google_ignoreList":[0]}
|
|
@@ -8,7 +8,7 @@ const lucideReact = require("lucide-react");
|
|
|
8
8
|
const ReactExports = require("react");
|
|
9
9
|
const reactIntlayer = require("react-intlayer");
|
|
10
10
|
require("@intlayer/config/built");
|
|
11
|
-
require("../../../better-auth.
|
|
11
|
+
require("../../../better-auth.CiuwFiHM-C2nBKRMa.cjs");
|
|
12
12
|
const hooks_reactQuery = require("../../../hooks/reactQuery.cjs");
|
|
13
13
|
require("@intlayer/api");
|
|
14
14
|
require("@tanstack/react-query");
|
|
@@ -6,7 +6,7 @@ import { Trash, Plus, WandSparkles } from "lucide-react";
|
|
|
6
6
|
import { Fragment as Fragment$1, useState } from "react";
|
|
7
7
|
import { useIntlayer, useLocale } from "react-intlayer";
|
|
8
8
|
import "@intlayer/config/built";
|
|
9
|
-
import "../../../better-auth.
|
|
9
|
+
import "../../../better-auth.CiuwFiHM-7umXOENE.js";
|
|
10
10
|
import { useAuditContentDeclarationField } from "../../../hooks/reactQuery.mjs";
|
|
11
11
|
import "@intlayer/api";
|
|
12
12
|
import "@tanstack/react-query";
|
package/dist/components/DictionaryFieldEditor/DictionaryCreationForm/DictionaryCreationForm.cjs
CHANGED
|
@@ -9,7 +9,7 @@ require("@intlayer/api");
|
|
|
9
9
|
require("@intlayer/config/built");
|
|
10
10
|
require("@intlayer/editor-react");
|
|
11
11
|
require("@tanstack/react-query");
|
|
12
|
-
require("../../../better-auth.
|
|
12
|
+
require("../../../better-auth.CiuwFiHM-C2nBKRMa.cjs");
|
|
13
13
|
const components_Button_Button = require("../../Button/Button.cjs");
|
|
14
14
|
const components_Form_FormBase = require("../../Form/FormBase.cjs");
|
|
15
15
|
require("../../Form/FormField.cjs");
|
package/dist/components/DictionaryFieldEditor/DictionaryCreationForm/DictionaryCreationForm.mjs
CHANGED
|
@@ -7,7 +7,7 @@ import "@intlayer/api";
|
|
|
7
7
|
import "@intlayer/config/built";
|
|
8
8
|
import "@intlayer/editor-react";
|
|
9
9
|
import "@tanstack/react-query";
|
|
10
|
-
import "../../../better-auth.
|
|
10
|
+
import "../../../better-auth.CiuwFiHM-7umXOENE.js";
|
|
11
11
|
import { ButtonColor } from "../../Button/Button.mjs";
|
|
12
12
|
import { useForm } from "../../Form/FormBase.mjs";
|
|
13
13
|
import "../../Form/FormField.mjs";
|
package/dist/components/DictionaryFieldEditor/DictionaryCreationForm/useDictionaryFormSchema.cjs
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
3
3
|
const reactIntlayer = require("react-intlayer");
|
|
4
|
-
const schemas = require("../../../schemas-
|
|
4
|
+
const schemas = require("../../../schemas-0lUZlFWF.cjs");
|
|
5
5
|
const useDictionarySchema = (projectId) => {
|
|
6
6
|
const {
|
|
7
7
|
requiredErrorName,
|
package/dist/components/DictionaryFieldEditor/DictionaryCreationForm/useDictionaryFormSchema.mjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { useIntlayer } from "react-intlayer";
|
|
2
|
-
import { o as object, a as array, s as string } from "../../../schemas-
|
|
2
|
+
import { o as object, a as array, s as string } from "../../../schemas-BG_GIt-j.js";
|
|
3
3
|
const useDictionarySchema = (projectId) => {
|
|
4
4
|
const {
|
|
5
5
|
requiredErrorName,
|
|
@@ -7,7 +7,7 @@ const lucideReact = require("lucide-react");
|
|
|
7
7
|
const ReactExports = require("react");
|
|
8
8
|
const reactIntlayer = require("react-intlayer");
|
|
9
9
|
require("@intlayer/config/built");
|
|
10
|
-
require("../../../better-auth.
|
|
10
|
+
require("../../../better-auth.CiuwFiHM-C2nBKRMa.cjs");
|
|
11
11
|
const hooks_reactQuery = require("../../../hooks/reactQuery.cjs");
|
|
12
12
|
const hooks_useAuth_useAuth = require("../../../hooks/useAuth/useAuth.cjs");
|
|
13
13
|
require("@intlayer/api");
|
|
@@ -5,7 +5,7 @@ import { WandSparkles } from "lucide-react";
|
|
|
5
5
|
import { useEffect } from "react";
|
|
6
6
|
import { useIntlayer } from "react-intlayer";
|
|
7
7
|
import "@intlayer/config/built";
|
|
8
|
-
import "../../../better-auth.
|
|
8
|
+
import "../../../better-auth.CiuwFiHM-7umXOENE.js";
|
|
9
9
|
import { useGetProjects, useGetTags, useAuditContentDeclarationMetadata } from "../../../hooks/reactQuery.mjs";
|
|
10
10
|
import { useAuth } from "../../../hooks/useAuth/useAuth.mjs";
|
|
11
11
|
import "@intlayer/api";
|
package/dist/components/DictionaryFieldEditor/DictionaryDetails/useDictionaryDetailsSchema.cjs
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
3
3
|
const reactIntlayer = require("react-intlayer");
|
|
4
|
-
const schemas = require("../../../schemas-
|
|
4
|
+
const schemas = require("../../../schemas-0lUZlFWF.cjs");
|
|
5
5
|
const useDictionaryDetailsSchema = (projectId) => {
|
|
6
6
|
const {
|
|
7
7
|
titleRequiredError,
|
package/dist/components/DictionaryFieldEditor/DictionaryDetails/useDictionaryDetailsSchema.mjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { useIntlayer } from "react-intlayer";
|
|
2
|
-
import { o as object, a as array, s as string } from "../../../schemas-
|
|
2
|
+
import { o as object, a as array, s as string } from "../../../schemas-BG_GIt-j.js";
|
|
3
3
|
const useDictionaryDetailsSchema = (projectId) => {
|
|
4
4
|
const {
|
|
5
5
|
titleRequiredError,
|
|
@@ -11,7 +11,7 @@ require("@intlayer/config/client");
|
|
|
11
11
|
require("@intlayer/core");
|
|
12
12
|
require("fuse.js");
|
|
13
13
|
require("@intlayer/config/built");
|
|
14
|
-
require("../../better-auth.
|
|
14
|
+
require("../../better-auth.CiuwFiHM-C2nBKRMa.cjs");
|
|
15
15
|
require("@tanstack/react-query");
|
|
16
16
|
require("@intlayer/api");
|
|
17
17
|
require("../../hooks/useScrollBlockage/useScrollBlockageStore.cjs");
|
|
@@ -9,7 +9,7 @@ import "@intlayer/config/client";
|
|
|
9
9
|
import "@intlayer/core";
|
|
10
10
|
import "fuse.js";
|
|
11
11
|
import "@intlayer/config/built";
|
|
12
|
-
import "../../better-auth.
|
|
12
|
+
import "../../better-auth.CiuwFiHM-7umXOENE.js";
|
|
13
13
|
import "@tanstack/react-query";
|
|
14
14
|
import "@intlayer/api";
|
|
15
15
|
import "../../hooks/useScrollBlockage/useScrollBlockageStore.mjs";
|
|
@@ -8,7 +8,7 @@ const ReactExports = require("react");
|
|
|
8
8
|
const reactIntlayer = require("react-intlayer");
|
|
9
9
|
const components_Modal_Modal = require("../../Modal/Modal.cjs");
|
|
10
10
|
require("@intlayer/config/built");
|
|
11
|
-
require("../../../better-auth.
|
|
11
|
+
require("../../../better-auth.CiuwFiHM-C2nBKRMa.cjs");
|
|
12
12
|
const hooks_reactQuery = require("../../../hooks/reactQuery.cjs");
|
|
13
13
|
const hooks_useAuth_useAuth = require("../../../hooks/useAuth/useAuth.cjs");
|
|
14
14
|
require("@intlayer/api");
|
|
@@ -43,6 +43,7 @@ const SaveForm = ({
|
|
|
43
43
|
confirmation
|
|
44
44
|
} = reactIntlayer.useIntlayer("save-dictionary-details");
|
|
45
45
|
const { isAuthenticated } = hooks_useAuth_useAuth.useAuth();
|
|
46
|
+
const confirmButtonRef = ReactExports.useRef(null);
|
|
46
47
|
const editedDictionary = editedContent?.[dictionary.localId];
|
|
47
48
|
const isEdited = editedDictionary && JSON.stringify(editedDictionary) !== JSON.stringify(dictionary);
|
|
48
49
|
const isDistantDictionary = typeof dictionary?.id !== "undefined";
|
|
@@ -92,6 +93,13 @@ const SaveForm = ({
|
|
|
92
93
|
}
|
|
93
94
|
);
|
|
94
95
|
};
|
|
96
|
+
ReactExports.useEffect(() => {
|
|
97
|
+
setTimeout(() => {
|
|
98
|
+
if (confirmButtonRef.current) {
|
|
99
|
+
confirmButtonRef.current.focus();
|
|
100
|
+
}
|
|
101
|
+
}, 100);
|
|
102
|
+
}, []);
|
|
95
103
|
return /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
|
|
96
104
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
97
105
|
components_Modal_Modal.Modal,
|
|
@@ -174,6 +182,7 @@ const SaveForm = ({
|
|
|
174
182
|
className: "max-md:w-full",
|
|
175
183
|
isLoading: isWriting,
|
|
176
184
|
onClick: () => setIsFormatAlertModalOpen(true),
|
|
185
|
+
ref: confirmButtonRef,
|
|
177
186
|
children: downloadButton.text
|
|
178
187
|
}
|
|
179
188
|
),
|
|
@@ -187,6 +196,7 @@ const SaveForm = ({
|
|
|
187
196
|
className: "max-md:w-full",
|
|
188
197
|
isLoading: isPushing,
|
|
189
198
|
onClick: handlePushDictionary,
|
|
199
|
+
ref: confirmButtonRef,
|
|
190
200
|
children: publishButton.text
|
|
191
201
|
}
|
|
192
202
|
),
|
|
@@ -200,6 +210,7 @@ const SaveForm = ({
|
|
|
200
210
|
className: "max-md:w-full",
|
|
201
211
|
isLoading: isPushing,
|
|
202
212
|
onClick: handlePushDictionary,
|
|
213
|
+
ref: confirmButtonRef,
|
|
203
214
|
children: saveButton.text
|
|
204
215
|
}
|
|
205
216
|
)
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SaveForm.cjs","sources":["../../../../src/components/DictionaryFieldEditor/SaveForm/SaveForm.tsx"],"sourcesContent":["'use client';\n\nimport type { Dictionary as DistantDictionary } from '@intlayer/backend';\nimport type { Dictionary } from '@intlayer/core';\nimport {\n useDictionariesRecordActions,\n useEditedContent,\n} from '@intlayer/editor-react';\nimport {\n ArrowUpFromLine,\n Download,\n RotateCcw,\n Save,\n Trash,\n} from 'lucide-react';\nimport {\n type DetailedHTMLProps,\n type FC,\n type FormHTMLAttributes,\n useState,\n} from 'react';\nimport { useIntlayer } from 'react-intlayer';\nimport { Modal, ModalSize } from '../../../components/Modal';\nimport {\n useAuth,\n useDeleteDictionary,\n usePushDictionaries,\n useWriteDictionary,\n} from '../../../hooks';\nimport { cn } from '../../../utils/cn';\nimport { ButtonColor, ButtonVariant } from '../../Button';\nimport { Form } from '../../Form';\n\ntype DictionaryDetailsProps = {\n dictionary: Dictionary;\n mode: ('local' | 'remote')[];\n onDelete?: () => void;\n} & DetailedHTMLProps<FormHTMLAttributes<HTMLFormElement>, HTMLFormElement>;\n\nexport const SaveForm: FC<DictionaryDetailsProps> = ({\n dictionary,\n mode,\n className,\n onDelete,\n ...props\n}) => {\n const [isFormatAlertModalOpen, setIsFormatAlertModalOpen] = useState(false);\n const { setLocaleDictionary } = useDictionariesRecordActions();\n const { mutate: deleteDictionary, isPending: isDeleting } =\n useDeleteDictionary();\n const { mutate: writeDictionary, isPending: isWriting } =\n useWriteDictionary();\n const { mutate: pushDictionaries, isPending: isPushing } =\n usePushDictionaries();\n const isLoading = isWriting || isPushing;\n\n const { editedContent, restoreEditedContent } = useEditedContent();\n const {\n deleteButton,\n resetButton,\n saveButton,\n publishButton,\n downloadButton,\n confirmation,\n } = useIntlayer('save-dictionary-details');\n const { isAuthenticated } = useAuth();\n\n const editedDictionary = editedContent?.[dictionary.localId!];\n\n const isEdited =\n editedDictionary &&\n JSON.stringify(editedDictionary) !== JSON.stringify(dictionary);\n\n const isDistantDictionary =\n typeof (dictionary as unknown as DistantDictionary)?.id !== 'undefined';\n\n const handleSaveDictionaryConfirmation = async () => {\n if (!editedContent?.[dictionary.localId!]) return;\n\n const updatedDictionary = {\n ...dictionary,\n ...editedContent?.[dictionary.localId!],\n };\n\n writeDictionary(\n {\n dictionary: updatedDictionary,\n },\n {\n onSuccess: () => {\n setLocaleDictionary(editedContent?.[dictionary.localId!]);\n restoreEditedContent(dictionary.localId!);\n },\n }\n );\n };\n\n const handlePushDictionary = () => {\n if (!editedContent?.[dictionary.localId!]) return;\n\n const updatedDictionary = {\n ...dictionary,\n ...editedContent?.[dictionary.localId!],\n };\n\n pushDictionaries([updatedDictionary], {\n onSuccess: (res) => {\n if (res) {\n setLocaleDictionary(editedContent?.[dictionary.localId!]);\n restoreEditedContent(dictionary.localId!);\n }\n },\n });\n };\n\n const handleDeleteDictionary = () => {\n if (!(dictionary as unknown as DistantDictionary).id) return;\n\n deleteDictionary(\n (dictionary as unknown as DistantDictionary).id.toString(),\n {\n onSuccess: (res) => {\n if (res) {\n onDelete?.();\n }\n },\n }\n );\n };\n\n return (\n <>\n <Modal\n isOpen={isFormatAlertModalOpen}\n title={confirmation.title.value}\n size={ModalSize.MD}\n >\n <form className=\"size-full px-3\">\n <p className=\"text-neutral py-4 text-sm\">{confirmation.message}</p>\n\n <div className=\"mt-12 flex justify-end gap-2 max-md:flex-col\">\n <Form.Button\n label={confirmation.cancelButton.label.value}\n disabled={!isEdited || isLoading}\n color={ButtonColor.TEXT}\n className=\"max-md:w-full\"\n variant={ButtonVariant.OUTLINE}\n onClick={() => setIsFormatAlertModalOpen(false)}\n >\n {confirmation.cancelButton.text}\n </Form.Button>\n <Form.Button\n label={confirmation.confirmButton.label.value}\n disabled={!isEdited || isLoading}\n Icon={Save}\n color={ButtonColor.TEXT}\n className=\"max-md:w-full\"\n isLoading={isPushing}\n onClick={handleSaveDictionaryConfirmation}\n >\n {confirmation.confirmButton.text}\n </Form.Button>\n </div>\n </form>\n </Modal>\n <form\n className={cn('flex justify-end gap-2 max-md:flex-col', className)}\n {...props}\n >\n {mode.includes('remote') &&\n isDistantDictionary &&\n onDelete &&\n isAuthenticated && (\n <Form.Button\n label={deleteButton.label.value}\n Icon={Trash}\n color={ButtonColor.ERROR}\n variant={ButtonVariant.OUTLINE}\n className=\"max-md:w-full\"\n isLoading={isDeleting}\n onClick={handleDeleteDictionary}\n >\n {deleteButton.text}\n </Form.Button>\n )}\n {isEdited && (\n <Form.Button\n label={resetButton.label.value}\n disabled={!isEdited}\n Icon={RotateCcw}\n variant={ButtonVariant.OUTLINE}\n color={ButtonColor.TEXT}\n className=\"max-md:w-full\"\n onClick={() => restoreEditedContent(dictionary.localId!)}\n >\n {resetButton.text}\n </Form.Button>\n )}\n {mode.includes('local') && (\n <Form.Button\n label={downloadButton.label.value}\n disabled={!isEdited || isLoading}\n Icon={Download}\n color={ButtonColor.TEXT}\n variant={\n isAuthenticated ? ButtonVariant.OUTLINE : ButtonVariant.DEFAULT\n }\n className=\"max-md:w-full\"\n isLoading={isWriting}\n onClick={() => setIsFormatAlertModalOpen(true)}\n >\n {downloadButton.text}\n </Form.Button>\n )}\n {mode.includes('remote') && isAuthenticated && !isDistantDictionary && (\n <Form.Button\n label={publishButton.label.value}\n disabled={isLoading}\n Icon={ArrowUpFromLine}\n color={ButtonColor.TEXT}\n className=\"max-md:w-full\"\n isLoading={isPushing}\n onClick={handlePushDictionary}\n >\n {publishButton.text}\n </Form.Button>\n )}\n {mode.includes('remote') &&\n isAuthenticated &&\n isDistantDictionary &&\n isEdited && (\n <Form.Button\n label={saveButton.label.value}\n disabled={!isEdited || isLoading}\n Icon={Save}\n color=\"text\"\n className=\"max-md:w-full\"\n isLoading={isPushing}\n onClick={handlePushDictionary}\n >\n {saveButton.text}\n </Form.Button>\n )}\n </form>\n </>\n );\n};\n"],"names":["useState","useDictionariesRecordActions","useDeleteDictionary","useWriteDictionary","usePushDictionaries","useEditedContent","useIntlayer","useAuth","jsxs","Fragment","jsx","Modal","ModalSize","Form","ButtonColor","ButtonVariant","Save","cn","Trash","RotateCcw","Download","ArrowUpFromLine"],"mappings":";;;;;;;;;;;;;;;;;;;;;;AAuCO,MAAM,WAAuC,CAAC;AAAA,EACnD;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA,GAAG;AACL,MAAM;AACJ,QAAM,CAAC,wBAAwB,yBAAyB,IAAIA,aAAAA,SAAS,KAAK;AAC1E,QAAM,EAAE,oBAAA,IAAwBC,yCAAA;AAChC,QAAM,EAAE,QAAQ,kBAAkB,WAAW,WAAA,IAC3CC,iBAAAA,oBAAA;AACF,QAAM,EAAE,QAAQ,iBAAiB,WAAW,UAAA,IAC1CC,iBAAAA,mBAAA;AACF,QAAM,EAAE,QAAQ,kBAAkB,WAAW,UAAA,IAC3CC,iBAAAA,oBAAA;AACF,QAAM,YAAY,aAAa;AAE/B,QAA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AAA,cACV,MAAMQ,YAAAA;AAAAA,cACN,OAAOP,yBAAAA,YAAY;AAAA,cACnB,WAAU;AAAA,cACV,WAAW;AAAA,cACX,SAAS;AAAA,cAER,UAAA,cAAc;AAAA,YAAA;AAAA,UAAA;AAAA,UAGlB,KAAK,SAAS,QAAQ,KACrB,mBACA,uBACA,YACEJ,2BAAAA;AAAAA,YAACG,sCAAAA,KAAK;AAAA,YAAL;AAAA,cACC,OAAO,WAAW,MAAM;AAAA,cACxB,UAAU,CAAC,YAAY;AAAA,cACvB,MAAMG,YAAAA;AAAAA,cACN,OAAM;AAAA,cACN,WAAU;AAAA,cACV,WAAW;AAAA,cACX,SAAS;AAAA,cAER,UAAA,WAAW;AAAA,YAAA;AAAA,UAAA;AAAA,QACd;AAAA,MAAA;AAAA,IAAA;AAAA,EAEN,GACF;AAEJ;;"}
|
|
1
|
+
{"version":3,"file":"SaveForm.cjs","sources":["../../../../src/components/DictionaryFieldEditor/SaveForm/SaveForm.tsx"],"sourcesContent":["'use client';\n\nimport type { Dictionary as DistantDictionary } from '@intlayer/backend';\nimport type { Dictionary } from '@intlayer/core';\nimport {\n useDictionariesRecordActions,\n useEditedContent,\n} from '@intlayer/editor-react';\nimport {\n ArrowUpFromLine,\n Download,\n RotateCcw,\n Save,\n Trash,\n} from 'lucide-react';\nimport {\n type DetailedHTMLProps,\n type FC,\n type FormHTMLAttributes,\n useEffect,\n useRef,\n useState,\n} from 'react';\nimport { useIntlayer } from 'react-intlayer';\nimport { Modal, ModalSize } from '../../../components/Modal';\nimport {\n useAuth,\n useDeleteDictionary,\n usePushDictionaries,\n useWriteDictionary,\n} from '../../../hooks';\nimport { cn } from '../../../utils/cn';\nimport { ButtonColor, ButtonVariant } from '../../Button';\nimport { Form } from '../../Form';\n\ntype DictionaryDetailsProps = {\n dictionary: Dictionary;\n mode: ('local' | 'remote')[];\n onDelete?: () => void;\n} & DetailedHTMLProps<FormHTMLAttributes<HTMLFormElement>, HTMLFormElement>;\n\nexport const SaveForm: FC<DictionaryDetailsProps> = ({\n dictionary,\n mode,\n className,\n onDelete,\n ...props\n}) => {\n const [isFormatAlertModalOpen, setIsFormatAlertModalOpen] = useState(false);\n const { setLocaleDictionary } = useDictionariesRecordActions();\n const { mutate: deleteDictionary, isPending: isDeleting } =\n useDeleteDictionary();\n const { mutate: writeDictionary, isPending: isWriting } =\n useWriteDictionary();\n const { mutate: pushDictionaries, isPending: isPushing } =\n usePushDictionaries();\n const isLoading = isWriting || isPushing;\n\n const { editedContent, restoreEditedContent } = useEditedContent();\n const {\n deleteButton,\n resetButton,\n saveButton,\n publishButton,\n downloadButton,\n confirmation,\n } = useIntlayer('save-dictionary-details');\n const { isAuthenticated } = useAuth();\n const confirmButtonRef = useRef<HTMLButtonElement>(null);\n\n const editedDictionary = editedContent?.[dictionary.localId!];\n\n const isEdited =\n editedDictionary &&\n JSON.stringify(editedDictionary) !== JSON.stringify(dictionary);\n\n const isDistantDictionary =\n typeof (dictionary as unknown as DistantDictionary)?.id !== 'undefined';\n\n const handleSaveDictionaryConfirmation = async () => {\n if (!editedContent?.[dictionary.localId!]) return;\n\n const updatedDictionary = {\n ...dictionary,\n ...editedContent?.[dictionary.localId!],\n };\n\n writeDictionary(\n {\n dictionary: updatedDictionary,\n },\n {\n onSuccess: () => {\n setLocaleDictionary(editedContent?.[dictionary.localId!]);\n restoreEditedContent(dictionary.localId!);\n },\n }\n );\n };\n\n const handlePushDictionary = () => {\n if (!editedContent?.[dictionary.localId!]) return;\n\n const updatedDictionary = {\n ...dictionary,\n ...editedContent?.[dictionary.localId!],\n };\n\n pushDictionaries([updatedDictionary], {\n onSuccess: (res) => {\n if (res) {\n setLocaleDictionary(editedContent?.[dictionary.localId!]);\n restoreEditedContent(dictionary.localId!);\n }\n },\n });\n };\n\n const handleDeleteDictionary = () => {\n if (!(dictionary as unknown as DistantDictionary).id) return;\n\n deleteDictionary(\n (dictionary as unknown as DistantDictionary).id.toString(),\n {\n onSuccess: (res) => {\n if (res) {\n onDelete?.();\n }\n },\n }\n );\n };\n\n useEffect(() => {\n setTimeout(() => {\n if (confirmButtonRef.current) {\n confirmButtonRef.current.focus();\n }\n }, 100);\n }, []);\n\n return (\n <>\n <Modal\n isOpen={isFormatAlertModalOpen}\n title={confirmation.title.value}\n size={ModalSize.MD}\n >\n <form className=\"size-full px-3\">\n <p className=\"text-neutral py-4 text-sm\">{confirmation.message}</p>\n\n <div className=\"mt-12 flex justify-end gap-2 max-md:flex-col\">\n <Form.Button\n label={confirmation.cancelButton.label.value}\n disabled={!isEdited || isLoading}\n color={ButtonColor.TEXT}\n className=\"max-md:w-full\"\n variant={ButtonVariant.OUTLINE}\n onClick={() => setIsFormatAlertModalOpen(false)}\n >\n {confirmation.cancelButton.text}\n </Form.Button>\n <Form.Button\n label={confirmation.confirmButton.label.value}\n disabled={!isEdited || isLoading}\n Icon={Save}\n color={ButtonColor.TEXT}\n className=\"max-md:w-full\"\n isLoading={isPushing}\n onClick={handleSaveDictionaryConfirmation}\n >\n {confirmation.confirmButton.text}\n </Form.Button>\n </div>\n </form>\n </Modal>\n <form\n className={cn('flex justify-end gap-2 max-md:flex-col', className)}\n {...props}\n >\n {mode.includes('remote') &&\n isDistantDictionary &&\n onDelete &&\n isAuthenticated && (\n <Form.Button\n label={deleteButton.label.value}\n Icon={Trash}\n color={ButtonColor.ERROR}\n variant={ButtonVariant.OUTLINE}\n className=\"max-md:w-full\"\n isLoading={isDeleting}\n onClick={handleDeleteDictionary}\n >\n {deleteButton.text}\n </Form.Button>\n )}\n {isEdited && (\n <Form.Button\n label={resetButton.label.value}\n disabled={!isEdited}\n Icon={RotateCcw}\n variant={ButtonVariant.OUTLINE}\n color={ButtonColor.TEXT}\n className=\"max-md:w-full\"\n onClick={() => restoreEditedContent(dictionary.localId!)}\n >\n {resetButton.text}\n </Form.Button>\n )}\n {mode.includes('local') && (\n <Form.Button\n label={downloadButton.label.value}\n disabled={!isEdited || isLoading}\n Icon={Download}\n color={ButtonColor.TEXT}\n variant={\n isAuthenticated ? ButtonVariant.OUTLINE : ButtonVariant.DEFAULT\n }\n className=\"max-md:w-full\"\n isLoading={isWriting}\n onClick={() => setIsFormatAlertModalOpen(true)}\n ref={confirmButtonRef}\n >\n {downloadButton.text}\n </Form.Button>\n )}\n {mode.includes('remote') && isAuthenticated && !isDistantDictionary && (\n <Form.Button\n label={publishButton.label.value}\n disabled={isLoading}\n Icon={ArrowUpFromLine}\n color={ButtonColor.TEXT}\n className=\"max-md:w-full\"\n isLoading={isPushing}\n onClick={handlePushDictionary}\n ref={confirmButtonRef}\n >\n {publishButton.text}\n </Form.Button>\n )}\n {mode.includes('remote') &&\n isAuthenticated &&\n isDistantDictionary &&\n isEdited && (\n <Form.Button\n label={saveButton.label.value}\n disabled={!isEdited || isLoading}\n Icon={Save}\n color=\"text\"\n className=\"max-md:w-full\"\n isLoading={isPushing}\n onClick={handlePushDictionary}\n ref={confirmButtonRef}\n >\n {saveButton.text}\n </Form.Button>\n )}\n </form>\n </>\n );\n};\n"],"names":["useState","useDictionariesRecordActions","useDeleteDictionary","useWriteDictionary","usePushDictionaries","useEditedContent","useIntlayer","useAuth","useRef","useEffect","jsxs","Fragment","jsx","Modal","ModalSize","Form","ButtonColor","ButtonVariant","Save","cn","Trash","RotateCcw","Download","ArrowUpFromLine"],"mappings":";;;;;;;;;;;;;;;;;;;;;;AAyCO,MAAM,WAAuC,CAAC;AAAA,EACnD;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA,GAAG;AACL,MAAM;AACJ,QAAM,CAAC,wBAAwB,yBAAyB,IAAIA,aAAAA,SAAS,KAAK;AAC1E,QAAM,EAAE,oBAAA,IAAwBC,yCAAA;AAChC,QAAM,EAAE,QAAQ,kBAAkB,WAAW,WAAA,IAC3CC,iBAAAA,oBAAA;AACF,QAAM,EAAE,QAAQ,iBAAiB,WAAW,UAAA,IAC1CC,iBAAAA,mBAAA;AACF,QAAM,EAAE,QAAQ,kBAAkB,WAAW,UAAA,IAC3CC,iBA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AAW;AAAA,cACX,SAAS,MAAM,0BAA0B,IAAI;AAAA,cAC7C,KAAK;AAAA,cAEJ,UAAA,eAAe;AAAA,YAAA;AAAA,UAAA;AAAA,UAGnB,KAAK,SAAS,QAAQ,KAAK,mBAAmB,CAAC,uBAC9CL,2BAAAA;AAAAA,YAACG,sCAAAA,KAAK;AAAA,YAAL;AAAA,cACC,OAAO,cAAc,MAAM;AAAA,cAC3B,UAAU;AAAA,cACV,MAAMQ,YAAAA;AAAAA,cACN,OAAOP,yBAAAA,YAAY;AAAA,cACnB,WAAU;AAAA,cACV,WAAW;AAAA,cACX,SAAS;AAAA,cACT,KAAK;AAAA,cAEJ,UAAA,cAAc;AAAA,YAAA;AAAA,UAAA;AAAA,UAGlB,KAAK,SAAS,QAAQ,KACrB,mBACA,uBACA,YACEJ,2BAAAA;AAAAA,YAACG,sCAAAA,KAAK;AAAA,YAAL;AAAA,cACC,OAAO,WAAW,MAAM;AAAA,cACxB,UAAU,CAAC,YAAY;AAAA,cACvB,MAAMG,YAAAA;AAAAA,cACN,OAAM;AAAA,cACN,WAAU;AAAA,cACV,WAAW;AAAA,cACX,SAAS;AAAA,cACT,KAAK;AAAA,cAEJ,UAAA,WAAW;AAAA,YAAA;AAAA,UAAA;AAAA,QACd;AAAA,MAAA;AAAA,IAAA;AAAA,EAEN,GACF;AAEJ;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SaveForm.d.ts","sourceRoot":"","sources":["../../../../src/components/DictionaryFieldEditor/SaveForm/SaveForm.tsx"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,gBAAgB,CAAC;AAYjD,OAAO,EACL,KAAK,iBAAiB,EACtB,KAAK,EAAE,EACP,KAAK,kBAAkB,
|
|
1
|
+
{"version":3,"file":"SaveForm.d.ts","sourceRoot":"","sources":["../../../../src/components/DictionaryFieldEditor/SaveForm/SaveForm.tsx"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,gBAAgB,CAAC;AAYjD,OAAO,EACL,KAAK,iBAAiB,EACtB,KAAK,EAAE,EACP,KAAK,kBAAkB,EAIxB,MAAM,OAAO,CAAC;AAaf,KAAK,sBAAsB,GAAG;IAC5B,UAAU,EAAE,UAAU,CAAC;IACvB,IAAI,EAAE,CAAC,OAAO,GAAG,QAAQ,CAAC,EAAE,CAAC;IAC7B,QAAQ,CAAC,EAAE,MAAM,IAAI,CAAC;CACvB,GAAG,iBAAiB,CAAC,kBAAkB,CAAC,eAAe,CAAC,EAAE,eAAe,CAAC,CAAC;AAE5E,eAAO,MAAM,QAAQ,EAAE,EAAE,CAAC,sBAAsB,CA2N/C,CAAC"}
|
|
@@ -2,11 +2,11 @@
|
|
|
2
2
|
import { jsxs, Fragment, jsx } from "react/jsx-runtime";
|
|
3
3
|
import { useDictionariesRecordActions, useEditedContent } from "@intlayer/editor-react";
|
|
4
4
|
import { Save, Trash, RotateCcw, Download, ArrowUpFromLine } from "lucide-react";
|
|
5
|
-
import { useState } from "react";
|
|
5
|
+
import { useState, useRef, useEffect } from "react";
|
|
6
6
|
import { useIntlayer } from "react-intlayer";
|
|
7
7
|
import { Modal, ModalSize } from "../../Modal/Modal.mjs";
|
|
8
8
|
import "@intlayer/config/built";
|
|
9
|
-
import "../../../better-auth.
|
|
9
|
+
import "../../../better-auth.CiuwFiHM-7umXOENE.js";
|
|
10
10
|
import { useDeleteDictionary, useWriteDictionary, usePushDictionaries } from "../../../hooks/reactQuery.mjs";
|
|
11
11
|
import { useAuth } from "../../../hooks/useAuth/useAuth.mjs";
|
|
12
12
|
import "@intlayer/api";
|
|
@@ -41,6 +41,7 @@ const SaveForm = ({
|
|
|
41
41
|
confirmation
|
|
42
42
|
} = useIntlayer("save-dictionary-details");
|
|
43
43
|
const { isAuthenticated } = useAuth();
|
|
44
|
+
const confirmButtonRef = useRef(null);
|
|
44
45
|
const editedDictionary = editedContent?.[dictionary.localId];
|
|
45
46
|
const isEdited = editedDictionary && JSON.stringify(editedDictionary) !== JSON.stringify(dictionary);
|
|
46
47
|
const isDistantDictionary = typeof dictionary?.id !== "undefined";
|
|
@@ -90,6 +91,13 @@ const SaveForm = ({
|
|
|
90
91
|
}
|
|
91
92
|
);
|
|
92
93
|
};
|
|
94
|
+
useEffect(() => {
|
|
95
|
+
setTimeout(() => {
|
|
96
|
+
if (confirmButtonRef.current) {
|
|
97
|
+
confirmButtonRef.current.focus();
|
|
98
|
+
}
|
|
99
|
+
}, 100);
|
|
100
|
+
}, []);
|
|
93
101
|
return /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
94
102
|
/* @__PURE__ */ jsx(
|
|
95
103
|
Modal,
|
|
@@ -172,6 +180,7 @@ const SaveForm = ({
|
|
|
172
180
|
className: "max-md:w-full",
|
|
173
181
|
isLoading: isWriting,
|
|
174
182
|
onClick: () => setIsFormatAlertModalOpen(true),
|
|
183
|
+
ref: confirmButtonRef,
|
|
175
184
|
children: downloadButton.text
|
|
176
185
|
}
|
|
177
186
|
),
|
|
@@ -185,6 +194,7 @@ const SaveForm = ({
|
|
|
185
194
|
className: "max-md:w-full",
|
|
186
195
|
isLoading: isPushing,
|
|
187
196
|
onClick: handlePushDictionary,
|
|
197
|
+
ref: confirmButtonRef,
|
|
188
198
|
children: publishButton.text
|
|
189
199
|
}
|
|
190
200
|
),
|
|
@@ -198,6 +208,7 @@ const SaveForm = ({
|
|
|
198
208
|
className: "max-md:w-full",
|
|
199
209
|
isLoading: isPushing,
|
|
200
210
|
onClick: handlePushDictionary,
|
|
211
|
+
ref: confirmButtonRef,
|
|
201
212
|
children: saveButton.text
|
|
202
213
|
}
|
|
203
214
|
)
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SaveForm.mjs","sources":["../../../../src/components/DictionaryFieldEditor/SaveForm/SaveForm.tsx"],"sourcesContent":["'use client';\n\nimport type { Dictionary as DistantDictionary } from '@intlayer/backend';\nimport type { Dictionary } from '@intlayer/core';\nimport {\n useDictionariesRecordActions,\n useEditedContent,\n} from '@intlayer/editor-react';\nimport {\n ArrowUpFromLine,\n Download,\n RotateCcw,\n Save,\n Trash,\n} from 'lucide-react';\nimport {\n type DetailedHTMLProps,\n type FC,\n type FormHTMLAttributes,\n useState,\n} from 'react';\nimport { useIntlayer } from 'react-intlayer';\nimport { Modal, ModalSize } from '../../../components/Modal';\nimport {\n useAuth,\n useDeleteDictionary,\n usePushDictionaries,\n useWriteDictionary,\n} from '../../../hooks';\nimport { cn } from '../../../utils/cn';\nimport { ButtonColor, ButtonVariant } from '../../Button';\nimport { Form } from '../../Form';\n\ntype DictionaryDetailsProps = {\n dictionary: Dictionary;\n mode: ('local' | 'remote')[];\n onDelete?: () => void;\n} & DetailedHTMLProps<FormHTMLAttributes<HTMLFormElement>, HTMLFormElement>;\n\nexport const SaveForm: FC<DictionaryDetailsProps> = ({\n dictionary,\n mode,\n className,\n onDelete,\n ...props\n}) => {\n const [isFormatAlertModalOpen, setIsFormatAlertModalOpen] = useState(false);\n const { setLocaleDictionary } = useDictionariesRecordActions();\n const { mutate: deleteDictionary, isPending: isDeleting } =\n useDeleteDictionary();\n const { mutate: writeDictionary, isPending: isWriting } =\n useWriteDictionary();\n const { mutate: pushDictionaries, isPending: isPushing } =\n usePushDictionaries();\n const isLoading = isWriting || isPushing;\n\n const { editedContent, restoreEditedContent } = useEditedContent();\n const {\n deleteButton,\n resetButton,\n saveButton,\n publishButton,\n downloadButton,\n confirmation,\n } = useIntlayer('save-dictionary-details');\n const { isAuthenticated } = useAuth();\n\n const editedDictionary = editedContent?.[dictionary.localId!];\n\n const isEdited =\n editedDictionary &&\n JSON.stringify(editedDictionary) !== JSON.stringify(dictionary);\n\n const isDistantDictionary =\n typeof (dictionary as unknown as DistantDictionary)?.id !== 'undefined';\n\n const handleSaveDictionaryConfirmation = async () => {\n if (!editedContent?.[dictionary.localId!]) return;\n\n const updatedDictionary = {\n ...dictionary,\n ...editedContent?.[dictionary.localId!],\n };\n\n writeDictionary(\n {\n dictionary: updatedDictionary,\n },\n {\n onSuccess: () => {\n setLocaleDictionary(editedContent?.[dictionary.localId!]);\n restoreEditedContent(dictionary.localId!);\n },\n }\n );\n };\n\n const handlePushDictionary = () => {\n if (!editedContent?.[dictionary.localId!]) return;\n\n const updatedDictionary = {\n ...dictionary,\n ...editedContent?.[dictionary.localId!],\n };\n\n pushDictionaries([updatedDictionary], {\n onSuccess: (res) => {\n if (res) {\n setLocaleDictionary(editedContent?.[dictionary.localId!]);\n restoreEditedContent(dictionary.localId!);\n }\n },\n });\n };\n\n const handleDeleteDictionary = () => {\n if (!(dictionary as unknown as DistantDictionary).id) return;\n\n deleteDictionary(\n (dictionary as unknown as DistantDictionary).id.toString(),\n {\n onSuccess: (res) => {\n if (res) {\n onDelete?.();\n }\n },\n }\n );\n };\n\n return (\n <>\n <Modal\n isOpen={isFormatAlertModalOpen}\n title={confirmation.title.value}\n size={ModalSize.MD}\n >\n <form className=\"size-full px-3\">\n <p className=\"text-neutral py-4 text-sm\">{confirmation.message}</p>\n\n <div className=\"mt-12 flex justify-end gap-2 max-md:flex-col\">\n <Form.Button\n label={confirmation.cancelButton.label.value}\n disabled={!isEdited || isLoading}\n color={ButtonColor.TEXT}\n className=\"max-md:w-full\"\n variant={ButtonVariant.OUTLINE}\n onClick={() => setIsFormatAlertModalOpen(false)}\n >\n {confirmation.cancelButton.text}\n </Form.Button>\n <Form.Button\n label={confirmation.confirmButton.label.value}\n disabled={!isEdited || isLoading}\n Icon={Save}\n color={ButtonColor.TEXT}\n className=\"max-md:w-full\"\n isLoading={isPushing}\n onClick={handleSaveDictionaryConfirmation}\n >\n {confirmation.confirmButton.text}\n </Form.Button>\n </div>\n </form>\n </Modal>\n <form\n className={cn('flex justify-end gap-2 max-md:flex-col', className)}\n {...props}\n >\n {mode.includes('remote') &&\n isDistantDictionary &&\n onDelete &&\n isAuthenticated && (\n <Form.Button\n label={deleteButton.label.value}\n Icon={Trash}\n color={ButtonColor.ERROR}\n variant={ButtonVariant.OUTLINE}\n className=\"max-md:w-full\"\n isLoading={isDeleting}\n onClick={handleDeleteDictionary}\n >\n {deleteButton.text}\n </Form.Button>\n )}\n {isEdited && (\n <Form.Button\n label={resetButton.label.value}\n disabled={!isEdited}\n Icon={RotateCcw}\n variant={ButtonVariant.OUTLINE}\n color={ButtonColor.TEXT}\n className=\"max-md:w-full\"\n onClick={() => restoreEditedContent(dictionary.localId!)}\n >\n {resetButton.text}\n </Form.Button>\n )}\n {mode.includes('local') && (\n <Form.Button\n label={downloadButton.label.value}\n disabled={!isEdited || isLoading}\n Icon={Download}\n color={ButtonColor.TEXT}\n variant={\n isAuthenticated ? ButtonVariant.OUTLINE : ButtonVariant.DEFAULT\n }\n className=\"max-md:w-full\"\n isLoading={isWriting}\n onClick={() => setIsFormatAlertModalOpen(true)}\n >\n {downloadButton.text}\n </Form.Button>\n )}\n {mode.includes('remote') && isAuthenticated && !isDistantDictionary && (\n <Form.Button\n label={publishButton.label.value}\n disabled={isLoading}\n Icon={ArrowUpFromLine}\n color={ButtonColor.TEXT}\n className=\"max-md:w-full\"\n isLoading={isPushing}\n onClick={handlePushDictionary}\n >\n {publishButton.text}\n </Form.Button>\n )}\n {mode.includes('remote') &&\n isAuthenticated &&\n isDistantDictionary &&\n isEdited && (\n <Form.Button\n label={saveButton.label.value}\n disabled={!isEdited || isLoading}\n Icon={Save}\n color=\"text\"\n className=\"max-md:w-full\"\n isLoading={isPushing}\n onClick={handlePushDictionary}\n >\n {saveButton.text}\n </Form.Button>\n )}\n </form>\n </>\n );\n};\n"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;AAuCO,MAAM,WAAuC,CAAC;AAAA,EACnD;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA,GAAG;AACL,MAAM;AACJ,QAAM,CAAC,wBAAwB,yBAAyB,IAAI,SAAS,KAAK;AAC1E,QAAM,EAAE,oBAAA,IAAwB,6BAAA;AAChC,QAAM,EAAE,QAAQ,kBAAkB,WAAW,WA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ACA,uBACA,YACE;AAAA,YAAC,KAAK;AAAA,YAAL;AAAA,cACC,OAAO,WAAW,MAAM;AAAA,cACxB,UAAU,CAAC,YAAY;AAAA,cACvB,MAAM;AAAA,cACN,OAAM;AAAA,cACN,WAAU;AAAA,cACV,WAAW;AAAA,cACX,SAAS;AAAA,cAER,UAAA,WAAW;AAAA,YAAA;AAAA,UAAA;AAAA,QACd;AAAA,MAAA;AAAA,IAAA;AAAA,EAEN,GACF;AAEJ;"}
|
|
1
|
+
{"version":3,"file":"SaveForm.mjs","sources":["../../../../src/components/DictionaryFieldEditor/SaveForm/SaveForm.tsx"],"sourcesContent":["'use client';\n\nimport type { Dictionary as DistantDictionary } from '@intlayer/backend';\nimport type { Dictionary } from '@intlayer/core';\nimport {\n useDictionariesRecordActions,\n useEditedContent,\n} from '@intlayer/editor-react';\nimport {\n ArrowUpFromLine,\n Download,\n RotateCcw,\n Save,\n Trash,\n} from 'lucide-react';\nimport {\n type DetailedHTMLProps,\n type FC,\n type FormHTMLAttributes,\n useEffect,\n useRef,\n useState,\n} from 'react';\nimport { useIntlayer } from 'react-intlayer';\nimport { Modal, ModalSize } from '../../../components/Modal';\nimport {\n useAuth,\n useDeleteDictionary,\n usePushDictionaries,\n useWriteDictionary,\n} from '../../../hooks';\nimport { cn } from '../../../utils/cn';\nimport { ButtonColor, ButtonVariant } from '../../Button';\nimport { Form } from '../../Form';\n\ntype DictionaryDetailsProps = {\n dictionary: Dictionary;\n mode: ('local' | 'remote')[];\n onDelete?: () => void;\n} & DetailedHTMLProps<FormHTMLAttributes<HTMLFormElement>, HTMLFormElement>;\n\nexport const SaveForm: FC<DictionaryDetailsProps> = ({\n dictionary,\n mode,\n className,\n onDelete,\n ...props\n}) => {\n const [isFormatAlertModalOpen, setIsFormatAlertModalOpen] = useState(false);\n const { setLocaleDictionary } = useDictionariesRecordActions();\n const { mutate: deleteDictionary, isPending: isDeleting } =\n useDeleteDictionary();\n const { mutate: writeDictionary, isPending: isWriting } =\n useWriteDictionary();\n const { mutate: pushDictionaries, isPending: isPushing } =\n usePushDictionaries();\n const isLoading = isWriting || isPushing;\n\n const { editedContent, restoreEditedContent } = useEditedContent();\n const {\n deleteButton,\n resetButton,\n saveButton,\n publishButton,\n downloadButton,\n confirmation,\n } = useIntlayer('save-dictionary-details');\n const { isAuthenticated } = useAuth();\n const confirmButtonRef = useRef<HTMLButtonElement>(null);\n\n const editedDictionary = editedContent?.[dictionary.localId!];\n\n const isEdited =\n editedDictionary &&\n JSON.stringify(editedDictionary) !== JSON.stringify(dictionary);\n\n const isDistantDictionary =\n typeof (dictionary as unknown as DistantDictionary)?.id !== 'undefined';\n\n const handleSaveDictionaryConfirmation = async () => {\n if (!editedContent?.[dictionary.localId!]) return;\n\n const updatedDictionary = {\n ...dictionary,\n ...editedContent?.[dictionary.localId!],\n };\n\n writeDictionary(\n {\n dictionary: updatedDictionary,\n },\n {\n onSuccess: () => {\n setLocaleDictionary(editedContent?.[dictionary.localId!]);\n restoreEditedContent(dictionary.localId!);\n },\n }\n );\n };\n\n const handlePushDictionary = () => {\n if (!editedContent?.[dictionary.localId!]) return;\n\n const updatedDictionary = {\n ...dictionary,\n ...editedContent?.[dictionary.localId!],\n };\n\n pushDictionaries([updatedDictionary], {\n onSuccess: (res) => {\n if (res) {\n setLocaleDictionary(editedContent?.[dictionary.localId!]);\n restoreEditedContent(dictionary.localId!);\n }\n },\n });\n };\n\n const handleDeleteDictionary = () => {\n if (!(dictionary as unknown as DistantDictionary).id) return;\n\n deleteDictionary(\n (dictionary as unknown as DistantDictionary).id.toString(),\n {\n onSuccess: (res) => {\n if (res) {\n onDelete?.();\n }\n },\n }\n );\n };\n\n useEffect(() => {\n setTimeout(() => {\n if (confirmButtonRef.current) {\n confirmButtonRef.current.focus();\n }\n }, 100);\n }, []);\n\n return (\n <>\n <Modal\n isOpen={isFormatAlertModalOpen}\n title={confirmation.title.value}\n size={ModalSize.MD}\n >\n <form className=\"size-full px-3\">\n <p className=\"text-neutral py-4 text-sm\">{confirmation.message}</p>\n\n <div className=\"mt-12 flex justify-end gap-2 max-md:flex-col\">\n <Form.Button\n label={confirmation.cancelButton.label.value}\n disabled={!isEdited || isLoading}\n color={ButtonColor.TEXT}\n className=\"max-md:w-full\"\n variant={ButtonVariant.OUTLINE}\n onClick={() => setIsFormatAlertModalOpen(false)}\n >\n {confirmation.cancelButton.text}\n </Form.Button>\n <Form.Button\n label={confirmation.confirmButton.label.value}\n disabled={!isEdited || isLoading}\n Icon={Save}\n color={ButtonColor.TEXT}\n className=\"max-md:w-full\"\n isLoading={isPushing}\n onClick={handleSaveDictionaryConfirmation}\n >\n {confirmation.confirmButton.text}\n </Form.Button>\n </div>\n </form>\n </Modal>\n <form\n className={cn('flex justify-end gap-2 max-md:flex-col', className)}\n {...props}\n >\n {mode.includes('remote') &&\n isDistantDictionary &&\n onDelete &&\n isAuthenticated && (\n <Form.Button\n label={deleteButton.label.value}\n Icon={Trash}\n color={ButtonColor.ERROR}\n variant={ButtonVariant.OUTLINE}\n className=\"max-md:w-full\"\n isLoading={isDeleting}\n onClick={handleDeleteDictionary}\n >\n {deleteButton.text}\n </Form.Button>\n )}\n {isEdited && (\n <Form.Button\n label={resetButton.label.value}\n disabled={!isEdited}\n Icon={RotateCcw}\n variant={ButtonVariant.OUTLINE}\n color={ButtonColor.TEXT}\n className=\"max-md:w-full\"\n onClick={() => restoreEditedContent(dictionary.localId!)}\n >\n {resetButton.text}\n </Form.Button>\n )}\n {mode.includes('local') && (\n <Form.Button\n label={downloadButton.label.value}\n disabled={!isEdited || isLoading}\n Icon={Download}\n color={ButtonColor.TEXT}\n variant={\n isAuthenticated ? ButtonVariant.OUTLINE : ButtonVariant.DEFAULT\n }\n className=\"max-md:w-full\"\n isLoading={isWriting}\n onClick={() => setIsFormatAlertModalOpen(true)}\n ref={confirmButtonRef}\n >\n {downloadButton.text}\n </Form.Button>\n )}\n {mode.includes('remote') && isAuthenticated && !isDistantDictionary && (\n <Form.Button\n label={publishButton.label.value}\n disabled={isLoading}\n Icon={ArrowUpFromLine}\n color={ButtonColor.TEXT}\n className=\"max-md:w-full\"\n isLoading={isPushing}\n onClick={handlePushDictionary}\n ref={confirmButtonRef}\n >\n {publishButton.text}\n </Form.Button>\n )}\n {mode.includes('remote') &&\n isAuthenticated &&\n isDistantDictionary &&\n isEdited && (\n <Form.Button\n label={saveButton.label.value}\n disabled={!isEdited || isLoading}\n Icon={Save}\n color=\"text\"\n className=\"max-md:w-full\"\n isLoading={isPushing}\n onClick={handlePushDictionary}\n ref={confirmButtonRef}\n >\n {saveButton.text}\n </Form.Button>\n )}\n </form>\n </>\n );\n};\n"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;AAyCO,MAAM,WAAuC,CAAC;AAAA,EACnD;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA,GAAG;AACL,MAAM;AACJ,QAAM,CAAC,wBAAwB,yBAAyB,IAAI,SAAS,KAAK;AAC1E,QAAM,EAAE,oBAAA,IAAwB,6BAAA;AAChC,QAAM,EAAE,QAAQ,kBAAkB,WAAW,WAAA,IAC3C,oBAAA;AACF,QAAM,EAAE,QAAQ,iBAAiB,WAAW,UAAA,IAC1C,mBAAA;AACF,QAAM,EAAE,QAAQ,kBAAkB,WAAW,UAAA,IAC3C,oBAAA;AACF,QAAM,YAAY,aAAa;AAE/B,QAAM,EAAE,eAAe,qBAAA,IAAyB,iBAAA;AAChD,QAAM;AAAA,IACJ;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,EAAA,IACE,YAAY,yBAAyB;AACzC,QAAM,EAAE,gBAAA,IAAoB,QAAA;AAC5B,QAAM,mBAAmB,OAA0B,IAAI;AAEvD,QAAM,mBAAmB,gBAAgB,WAAW,OAAQ;AAE5D,QAAM,WACJ,oBACA,KAAK,UAAU,gBAAgB,MAAM,KAAK,UAAU,UAAU;AAEhE,QAAM,sBACJ,OAAQ,YAA6C,OAAO;AAE9D,QAAM,mCAAmC,YAA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 require("../../Input/Checkbox.cjs");
|
|
|
18
18
|
require("@tanstack/react-query");
|
|
19
19
|
require("@intlayer/api");
|
|
20
20
|
require("@intlayer/config/built");
|
|
21
|
-
require("../../../better-auth.
|
|
21
|
+
require("../../../better-auth.CiuwFiHM-C2nBKRMa.cjs");
|
|
22
22
|
const components_DictionaryFieldEditor_NodeTypeSelector = require("../NodeTypeSelector.cjs");
|
|
23
23
|
const NodeTypeView = ({
|
|
24
24
|
section,
|
|
@@ -16,7 +16,7 @@ import "../../Input/Checkbox.mjs";
|
|
|
16
16
|
import "@tanstack/react-query";
|
|
17
17
|
import "@intlayer/api";
|
|
18
18
|
import "@intlayer/config/built";
|
|
19
|
-
import "../../../better-auth.
|
|
19
|
+
import "../../../better-auth.CiuwFiHM-7umXOENE.js";
|
|
20
20
|
import { NodeTypeSelector } from "../NodeTypeSelector.mjs";
|
|
21
21
|
const NodeTypeView = ({
|
|
22
22
|
section,
|
package/dist/components/DictionaryFieldEditor/VersionSwitcherDropDown/VersionSwitcherContext.cjs
CHANGED
|
@@ -4,7 +4,7 @@ Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
|
4
4
|
const jsxRuntime = require("react/jsx-runtime");
|
|
5
5
|
const ReactExports = require("react");
|
|
6
6
|
require("@intlayer/config/built");
|
|
7
|
-
require("../../../better-auth.
|
|
7
|
+
require("../../../better-auth.CiuwFiHM-C2nBKRMa.cjs");
|
|
8
8
|
require("@intlayer/editor-react");
|
|
9
9
|
require("@tanstack/react-query");
|
|
10
10
|
require("@intlayer/api");
|
package/dist/components/DictionaryFieldEditor/VersionSwitcherDropDown/VersionSwitcherContext.mjs
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
import { jsx } from "react/jsx-runtime";
|
|
3
3
|
import { createContext, useContext } from "react";
|
|
4
4
|
import "@intlayer/config/built";
|
|
5
|
-
import "../../../better-auth.
|
|
5
|
+
import "../../../better-auth.CiuwFiHM-7umXOENE.js";
|
|
6
6
|
import "@intlayer/editor-react";
|
|
7
7
|
import "@tanstack/react-query";
|
|
8
8
|
import "@intlayer/api";
|
|
@@ -13,7 +13,7 @@ require("@intlayer/editor-react");
|
|
|
13
13
|
require("@tanstack/react-query");
|
|
14
14
|
require("@intlayer/api");
|
|
15
15
|
require("@intlayer/config/built");
|
|
16
|
-
require("../../better-auth.
|
|
16
|
+
require("../../better-auth.CiuwFiHM-C2nBKRMa.cjs");
|
|
17
17
|
const components_EditableField_EditableFieldLayout = require("./EditableFieldLayout.cjs");
|
|
18
18
|
const EditableFieldTextArea = ({
|
|
19
19
|
onSave,
|
|
@@ -11,7 +11,7 @@ import "@intlayer/editor-react";
|
|
|
11
11
|
import "@tanstack/react-query";
|
|
12
12
|
import "@intlayer/api";
|
|
13
13
|
import "@intlayer/config/built";
|
|
14
|
-
import "../../better-auth.
|
|
14
|
+
import "../../better-auth.CiuwFiHM-7umXOENE.js";
|
|
15
15
|
import { EditableFieldLayout } from "./EditableFieldLayout.mjs";
|
|
16
16
|
const EditableFieldTextArea = ({
|
|
17
17
|
onSave,
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
"use strict";
|
|
3
3
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
4
4
|
const jsxRuntime = require("react/jsx-runtime");
|
|
5
|
-
const zod = require("../../zod-
|
|
5
|
+
const zod = require("../../zod-CvjrdkEg.cjs");
|
|
6
6
|
const reactHookForm = require("react-hook-form");
|
|
7
7
|
const utils_cn = require("../../utils/cn.cjs");
|
|
8
8
|
const awaitFunction = async (fn) => {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { jsx } from "react/jsx-runtime";
|
|
3
|
-
import { a } from "../../zod-
|
|
3
|
+
import { a } from "../../zod-CCm3hUBS.js";
|
|
4
4
|
import { useForm as useForm$1, FormProvider } from "react-hook-form";
|
|
5
5
|
import { cn } from "../../utils/cn.mjs";
|
|
6
6
|
const awaitFunction = async (fn) => {
|
|
@@ -2,9 +2,9 @@
|
|
|
2
2
|
"use strict";
|
|
3
3
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
4
4
|
const jsxRuntime = require("react/jsx-runtime");
|
|
5
|
-
const zod = require("../../../zod-
|
|
5
|
+
const zod = require("../../../zod-CvjrdkEg.cjs");
|
|
6
6
|
const reactHookForm = require("react-hook-form");
|
|
7
|
-
const schemas = require("../../../schemas-
|
|
7
|
+
const schemas = require("../../../schemas-0lUZlFWF.cjs");
|
|
8
8
|
const Schema = schemas.object({
|
|
9
9
|
test: schemas.string().min(3, "test error")
|
|
10
10
|
});
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { jsx } from "react/jsx-runtime";
|
|
3
|
-
import { a } from "../../../zod-
|
|
3
|
+
import { a } from "../../../zod-CCm3hUBS.js";
|
|
4
4
|
import { useForm, FormProvider } from "react-hook-form";
|
|
5
|
-
import { o as object, s as string } from "../../../schemas-
|
|
5
|
+
import { o as object, s as string } from "../../../schemas-BG_GIt-j.js";
|
|
6
6
|
const Schema = object({
|
|
7
7
|
test: string().min(3, "test error")
|
|
8
8
|
});
|
|
@@ -4,7 +4,7 @@ Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
|
4
4
|
const jsxRuntime = require("react/jsx-runtime");
|
|
5
5
|
const ReactExports = require("react");
|
|
6
6
|
require("@intlayer/config/built");
|
|
7
|
-
require("../../better-auth.
|
|
7
|
+
require("../../better-auth.CiuwFiHM-C2nBKRMa.cjs");
|
|
8
8
|
require("@intlayer/editor-react");
|
|
9
9
|
require("@tanstack/react-query");
|
|
10
10
|
require("@intlayer/api");
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
import { jsx } from "react/jsx-runtime";
|
|
3
3
|
import { createContext, useContext } from "react";
|
|
4
4
|
import "@intlayer/config/built";
|
|
5
|
-
import "../../better-auth.
|
|
5
|
+
import "../../better-auth.CiuwFiHM-7umXOENE.js";
|
|
6
6
|
import "@intlayer/editor-react";
|
|
7
7
|
import "@tanstack/react-query";
|
|
8
8
|
import "@intlayer/api";
|
|
@@ -9,7 +9,7 @@ const lucideReact = require("lucide-react");
|
|
|
9
9
|
const ReactExports = require("react");
|
|
10
10
|
const reactIntlayer = require("react-intlayer");
|
|
11
11
|
require("@intlayer/config/built");
|
|
12
|
-
require("../../better-auth.
|
|
12
|
+
require("../../better-auth.CiuwFiHM-C2nBKRMa.cjs");
|
|
13
13
|
require("@intlayer/editor-react");
|
|
14
14
|
require("@tanstack/react-query");
|
|
15
15
|
require("@intlayer/api");
|
|
@@ -7,7 +7,7 @@ import { Globe, MoveVertical, Check } from "lucide-react";
|
|
|
7
7
|
import { useRef, useMemo, useState, useCallback } from "react";
|
|
8
8
|
import { useIntlayer, useLocale } from "react-intlayer";
|
|
9
9
|
import "@intlayer/config/built";
|
|
10
|
-
import "../../better-auth.
|
|
10
|
+
import "../../better-auth.CiuwFiHM-7umXOENE.js";
|
|
11
11
|
import "@intlayer/editor-react";
|
|
12
12
|
import "@tanstack/react-query";
|
|
13
13
|
import "@intlayer/api";
|
|
@@ -5,7 +5,7 @@ const jsxRuntime = require("react/jsx-runtime");
|
|
|
5
5
|
const ReactExports = require("react");
|
|
6
6
|
const reactIntlayer = require("react-intlayer");
|
|
7
7
|
require("@intlayer/config/built");
|
|
8
|
-
require("../../better-auth.
|
|
8
|
+
require("../../better-auth.CiuwFiHM-C2nBKRMa.cjs");
|
|
9
9
|
require("@intlayer/editor-react");
|
|
10
10
|
require("@tanstack/react-query");
|
|
11
11
|
require("@intlayer/api");
|
|
@@ -3,7 +3,7 @@ import { jsx } from "react/jsx-runtime";
|
|
|
3
3
|
import { createContext, useContext } from "react";
|
|
4
4
|
import { useLocale } from "react-intlayer";
|
|
5
5
|
import "@intlayer/config/built";
|
|
6
|
-
import "../../better-auth.
|
|
6
|
+
import "../../better-auth.CiuwFiHM-7umXOENE.js";
|
|
7
7
|
import "@intlayer/editor-react";
|
|
8
8
|
import "@tanstack/react-query";
|
|
9
9
|
import "@intlayer/api";
|