@intlayer/design-system 6.0.2 → 6.1.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (97) hide show
  1. package/README.md +249 -56
  2. package/dist/.vite/manifest.json +42 -62
  3. package/dist/{better-auth.CMQ3rA-I-7umXOENE.js → better-auth.CiuwFiHM-7umXOENE.js} +1 -1
  4. package/dist/better-auth.CiuwFiHM-7umXOENE.js.map +1 -0
  5. package/dist/{better-auth.CMQ3rA-I-C2nBKRMa.cjs → better-auth.CiuwFiHM-C2nBKRMa.cjs} +1 -1
  6. package/dist/better-auth.CiuwFiHM-C2nBKRMa.cjs.map +1 -0
  7. package/dist/components/DictionaryFieldEditor/ContentEditorView/TextEditor.cjs +1 -1
  8. package/dist/components/DictionaryFieldEditor/ContentEditorView/TextEditor.mjs +1 -1
  9. package/dist/components/DictionaryFieldEditor/DictionaryCreationForm/DictionaryCreationForm.cjs +1 -1
  10. package/dist/components/DictionaryFieldEditor/DictionaryCreationForm/DictionaryCreationForm.mjs +1 -1
  11. package/dist/components/DictionaryFieldEditor/DictionaryCreationForm/useDictionaryFormSchema.cjs +1 -1
  12. package/dist/components/DictionaryFieldEditor/DictionaryCreationForm/useDictionaryFormSchema.mjs +1 -1
  13. package/dist/components/DictionaryFieldEditor/DictionaryDetails/DictionaryDetailsForm.cjs +1 -1
  14. package/dist/components/DictionaryFieldEditor/DictionaryDetails/DictionaryDetailsForm.mjs +1 -1
  15. package/dist/components/DictionaryFieldEditor/DictionaryDetails/useDictionaryDetailsSchema.cjs +1 -1
  16. package/dist/components/DictionaryFieldEditor/DictionaryDetails/useDictionaryDetailsSchema.mjs +1 -1
  17. package/dist/components/DictionaryFieldEditor/DictionaryFieldEditor.cjs +1 -1
  18. package/dist/components/DictionaryFieldEditor/DictionaryFieldEditor.mjs +1 -1
  19. package/dist/components/DictionaryFieldEditor/SaveForm/SaveForm.cjs +1 -1
  20. package/dist/components/DictionaryFieldEditor/SaveForm/SaveForm.mjs +1 -1
  21. package/dist/components/DictionaryFieldEditor/StructureView/StructureView.cjs +1 -1
  22. package/dist/components/DictionaryFieldEditor/StructureView/StructureView.mjs +1 -1
  23. package/dist/components/DictionaryFieldEditor/VersionSwitcherDropDown/VersionSwitcherContext.cjs +1 -1
  24. package/dist/components/DictionaryFieldEditor/VersionSwitcherDropDown/VersionSwitcherContext.mjs +1 -1
  25. package/dist/components/EditableField/EditableFieldTextArea.cjs +1 -1
  26. package/dist/components/EditableField/EditableFieldTextArea.mjs +1 -1
  27. package/dist/components/Form/FormBase.cjs +1 -1
  28. package/dist/components/Form/FormBase.mjs +1 -1
  29. package/dist/components/Form/elements/FormElementWrapper.cjs +2 -2
  30. package/dist/components/Form/elements/FormElementWrapper.mjs +2 -2
  31. package/dist/components/IDE/CodeContext.cjs +1 -1
  32. package/dist/components/IDE/CodeContext.mjs +1 -1
  33. package/dist/components/LocaleSwitcherContentDropDown/LocaleSwitcherContent.cjs +1 -1
  34. package/dist/components/LocaleSwitcherContentDropDown/LocaleSwitcherContent.mjs +1 -1
  35. package/dist/components/LocaleSwitcherContentDropDown/LocaleSwitcherContentContext.cjs +1 -1
  36. package/dist/components/LocaleSwitcherContentDropDown/LocaleSwitcherContentContext.mjs +1 -1
  37. package/dist/components/MarkDownRender/index.cjs +1 -1
  38. package/dist/components/MarkDownRender/index.cjs.map +1 -1
  39. package/dist/components/MarkDownRender/index.mjs +1 -1
  40. package/dist/components/MarkDownRender/index.mjs.map +1 -1
  41. package/dist/components/Modal/Modal.cjs +1 -1
  42. package/dist/components/Modal/Modal.mjs +1 -1
  43. package/dist/components/Navbar/DesktopNavbar.cjs +14 -16
  44. package/dist/components/Navbar/DesktopNavbar.cjs.map +1 -1
  45. package/dist/components/Navbar/DesktopNavbar.d.ts.map +1 -1
  46. package/dist/components/Navbar/DesktopNavbar.mjs +14 -16
  47. package/dist/components/Navbar/DesktopNavbar.mjs.map +1 -1
  48. package/dist/components/Navbar/MobileNavbar.cjs +1 -1
  49. package/dist/components/Navbar/MobileNavbar.mjs +1 -1
  50. package/dist/components/Navbar/index.cjs +1 -1
  51. package/dist/components/Navbar/index.mjs +1 -1
  52. package/dist/components/SwitchSelector/index.cjs +1 -1
  53. package/dist/components/SwitchSelector/index.mjs +1 -1
  54. package/dist/components/TabSelector/TabSelector.cjs +1 -1
  55. package/dist/components/TabSelector/TabSelector.mjs +1 -1
  56. package/dist/hooks/auth.cjs +13 -7
  57. package/dist/hooks/auth.cjs.map +1 -1
  58. package/dist/hooks/auth.mjs +12 -6
  59. package/dist/hooks/auth.mjs.map +1 -1
  60. package/dist/hooks/reactQuery.cjs +1 -1
  61. package/dist/hooks/reactQuery.d.ts +111 -43
  62. package/dist/hooks/reactQuery.d.ts.map +1 -1
  63. package/dist/hooks/reactQuery.mjs +1 -1
  64. package/dist/hooks/useAuth/useAuth.cjs.map +1 -1
  65. package/dist/hooks/useAuth/useAuth.d.ts +1 -0
  66. package/dist/hooks/useAuth/useAuth.d.ts.map +1 -1
  67. package/dist/hooks/useAuth/useAuth.mjs.map +1 -1
  68. package/dist/hooks/useAuth/useOAuth2.d.ts +1 -1
  69. package/dist/hooks/useAuth/useSession.d.ts +88 -1
  70. package/dist/hooks/useAuth/useSession.d.ts.map +1 -1
  71. package/dist/hooks/useUser/index.cjs +1 -1
  72. package/dist/hooks/useUser/index.d.ts +18 -2
  73. package/dist/hooks/useUser/index.d.ts.map +1 -1
  74. package/dist/hooks/useUser/index.mjs +1 -1
  75. package/dist/index-BCuMWKyy.js.map +1 -1
  76. package/dist/index-BYzBot7l.cjs.map +1 -1
  77. package/dist/{schemas-lh5OFOvX.cjs → schemas-0lUZlFWF.cjs} +703 -240
  78. package/dist/schemas-0lUZlFWF.cjs.map +1 -0
  79. package/dist/{schemas-DEXdAbCK.js → schemas-BG_GIt-j.js} +465 -2
  80. package/dist/schemas-BG_GIt-j.js.map +1 -0
  81. package/dist/zod-CCm3hUBS.js +210 -0
  82. package/dist/zod-CCm3hUBS.js.map +1 -0
  83. package/dist/zod-CvjrdkEg.cjs +209 -0
  84. package/dist/zod-CvjrdkEg.cjs.map +1 -0
  85. package/package.json +45 -43
  86. package/dist/better-auth.CMQ3rA-I-7umXOENE.js.map +0 -1
  87. package/dist/better-auth.CMQ3rA-I-C2nBKRMa.cjs.map +0 -1
  88. package/dist/parse-Ltyyb1op.cjs +0 -509
  89. package/dist/parse-Ltyyb1op.cjs.map +0 -1
  90. package/dist/parse-Vrm0h1r9.js +0 -510
  91. package/dist/parse-Vrm0h1r9.js.map +0 -1
  92. package/dist/schemas-DEXdAbCK.js.map +0 -1
  93. package/dist/schemas-lh5OFOvX.cjs.map +0 -1
  94. package/dist/zod-BvUVjPTw.cjs +0 -91
  95. package/dist/zod-BvUVjPTw.cjs.map +0 -1
  96. package/dist/zod-CJrbzxwg.js +0 -92
  97. package/dist/zod-CJrbzxwg.js.map +0 -1
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@intlayer/design-system",
3
- "version": "6.0.2",
3
+ "version": "6.1.1",
4
4
  "private": false,
5
5
  "description": "Intlayer design system, including UI components used in the Intlayer editor, website, and visual editor/CMS.",
6
6
  "keywords": [
@@ -66,32 +66,32 @@
66
66
  "dependencies": {
67
67
  "@hookform/resolvers": "^5.0.1",
68
68
  "@monaco-editor/react": "^4.7.0",
69
- "@radix-ui/react-dialog": "^1.1.4",
69
+ "@radix-ui/react-dialog": "^1.1.15",
70
70
  "@radix-ui/react-select": "^2.1.4",
71
- "@radix-ui/react-slot": "^1.1.1",
72
- "@radix-ui/react-toast": "^1.2.4",
73
- "@shikijs/transformers": "^3.2.1",
74
- "better-auth": "^1.3.4",
71
+ "@radix-ui/react-slot": "^1.2.3",
72
+ "@radix-ui/react-toast": "^1.2.15",
73
+ "@shikijs/transformers": "^3.13.0",
74
+ "better-auth": "^1.3.16",
75
75
  "class-variance-authority": "^0.7.1",
76
76
  "clsx": "^2.1.1",
77
- "cmdk": "^1.0.4",
77
+ "cmdk": "^1.1.1",
78
78
  "deepmerge": "^4.3.1",
79
- "framer-motion": "^12.16.0",
79
+ "framer-motion": "^12.23.21",
80
80
  "fuse.js": "^7.1.0",
81
- "markdown-to-jsx": "^7.7.6",
82
- "react-hook-form": "^7.54.2",
81
+ "markdown-to-jsx": "^7.7.13",
82
+ "react-hook-form": "^7.63.0",
83
83
  "rollup-preserve-directives": "^1.1.3",
84
84
  "shiki": "^3.2.1",
85
- "tailwind-merge": "^3.3.0",
85
+ "tailwind-merge": "^3.3.1",
86
86
  "zod": "^3.25.56",
87
87
  "zustand": "^4.5.6",
88
- "@intlayer/api": "6.0.2",
89
- "@intlayer/config": "6.0.2",
90
- "@intlayer/core": "6.0.2",
91
- "@intlayer/dictionaries-entry": "6.0.2",
92
- "intlayer": "6.0.2",
93
- "react-intlayer": "6.0.2",
94
- "@intlayer/editor-react": "6.0.2"
88
+ "@intlayer/api": "6.1.1",
89
+ "@intlayer/config": "6.1.1",
90
+ "@intlayer/dictionaries-entry": "6.1.1",
91
+ "@intlayer/core": "6.1.1",
92
+ "@intlayer/editor-react": "6.1.1",
93
+ "intlayer": "6.1.1",
94
+ "react-intlayer": "6.1.1"
95
95
  },
96
96
  "devDependencies": {
97
97
  "@chromatic-com/storybook": "^3.2.7",
@@ -105,57 +105,58 @@
105
105
  "@storybook/test": "^8.6.14",
106
106
  "@tailwindcss/aspect-ratio": "^0.4.2",
107
107
  "@tailwindcss/cli": "^4.0.14",
108
- "@tailwindcss/vite": "^4.0.14",
109
- "@tanstack/query-persist-client-core": "^5.85.5",
110
- "@tanstack/query-sync-storage-persister": "^5.85.5",
111
- "@tanstack/react-query": "^5.85.5",
108
+ "@tailwindcss/vite": "^4.1.13",
109
+ "@tanstack/query-persist-client-core": "^5.90.2",
110
+ "@tanstack/query-sync-storage-persister": "^5.90.2",
111
+ "@tanstack/react-query": "^5.90.2",
112
112
  "@testing-library/jest-dom": "^6.6.3",
113
113
  "@testing-library/react": "^16.2.0",
114
114
  "@testing-library/user-event": "^14.6.1",
115
115
  "@types/espree": "^10.1.0",
116
- "@types/node": "^24.2.1",
116
+ "@types/node": "^24.5.2",
117
117
  "@types/react": ">=16.0.0",
118
118
  "@types/react-dom": ">=16.0.0",
119
- "@typescript-eslint/parser": "^8.33.1",
119
+ "@typescript-eslint/parser": "^8.44.1",
120
120
  "@vitejs/plugin-react": "^5.0.0",
121
121
  "concurrently": "^9.2.0",
122
- "eslint": "^9.34.0",
122
+ "eslint": "^9.36.0",
123
123
  "fast-glob": "^3.3.3",
124
- "lucide-react": "^0.541.0",
124
+ "lucide-react": "^0.544.0",
125
125
  "prettier": "^3.6.2",
126
126
  "rimraf": "^6.0.1",
127
127
  "storybook": "^8.6.14",
128
- "tailwindcss": "^4.1.8",
128
+ "tailwindcss": "^4.1.13",
129
129
  "typescript": "^5.9.2",
130
- "vite": "^7.1.2",
130
+ "vite": "^7.1.7",
131
131
  "vite-plugin-dts": "^4.5.3",
132
132
  "vitest": "^3.2.4",
133
- "@utils/eslint-config": "1.0.4",
134
133
  "@utils/ts-config": "1.0.4",
134
+ "@intlayer/backend": "6.1.1",
135
+ "@utils/eslint-config": "1.0.4",
135
136
  "@utils/ts-config-types": "1.0.4",
136
137
  "@utils/tsup-config": "1.0.4",
137
- "vite-intlayer": "6.0.2"
138
+ "vite-intlayer": "6.1.1"
138
139
  },
139
140
  "peerDependencies": {
140
141
  "@monaco-editor/react": "^4.7.0",
141
- "@tanstack/query-persist-client-core": "^5.85.5",
142
- "@tanstack/query-sync-storage-persister": "^5.85.5",
143
- "@tanstack/react-query": "^5.85.5",
142
+ "@tanstack/query-persist-client-core": "^5.90.2",
143
+ "@tanstack/query-sync-storage-persister": "^5.90.2",
144
+ "@tanstack/react-query": "^5.90.2",
144
145
  "clsx": "^2.1.1",
145
- "framer-motion": "^12.16.0",
146
+ "framer-motion": "^12.23.21",
146
147
  "fuse.js": "^7.1.0",
147
148
  "react": ">=16.0.0",
148
149
  "react-dom": ">=16.0.0",
149
- "tailwind-merge": "^3.3.0",
150
+ "tailwind-merge": "^3.3.1",
150
151
  "zustand": "^4.5.6",
151
- "@intlayer/config": "6.0.2",
152
- "@intlayer/dictionaries-entry": "6.0.2",
153
- "@intlayer/core": "6.0.2",
154
- "@intlayer/api": "6.0.2",
155
- "@intlayer/editor-react": "6.0.2",
156
- "react-intlayer": "6.0.2",
157
- "intlayer": "6.0.2",
158
- "@intlayer/backend": "6.0.2"
152
+ "@intlayer/api": "6.1.1",
153
+ "@intlayer/config": "6.1.1",
154
+ "@intlayer/core": "6.1.1",
155
+ "@intlayer/dictionaries-entry": "6.1.1",
156
+ "@intlayer/backend": "6.1.1",
157
+ "react-intlayer": "6.1.1",
158
+ "intlayer": "6.1.1",
159
+ "@intlayer/editor-react": "6.1.1"
159
160
  },
160
161
  "scripts": {
161
162
  "build": "pnpm clean & pnpm build:ci",
@@ -171,6 +172,7 @@
171
172
  "prettier": "prettier . --check",
172
173
  "prettier:fix": "prettier . --write",
173
174
  "preview": "vite preview",
175
+ "prepublish": "cp -f ../../../README.md ./README.md",
174
176
  "start": "pnpm storybook -p 6006 --no-open --host 0.0.0.0",
175
177
  "start:serve": "npx http-server -y storybook-static -p 6006 -o --no-open",
176
178
  "storybook": "storybook dev -p 6006",
@@ -1 +0,0 @@
1
- {"version":3,"file":"better-auth.CMQ3rA-I-7umXOENE.js","sources":["../../../../node_modules/.pnpm/better-auth@1.3.8_react-dom@19.1.1_react@19.1.1__react@19.1.1/node_modules/better-auth/dist/shared/better-auth.CMQ3rA-I.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, isProduction as a, isDevelopment 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]}
@@ -1 +0,0 @@
1
- {"version":3,"file":"better-auth.CMQ3rA-I-C2nBKRMa.cjs","sources":["../../../../node_modules/.pnpm/better-auth@1.3.8_react-dom@19.1.1_react@19.1.1__react@19.1.1/node_modules/better-auth/dist/shared/better-auth.CMQ3rA-I.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, isProduction as a, isDevelopment 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]}
@@ -1,509 +0,0 @@
1
- "use strict";
2
- function $constructor(name, initializer2, params) {
3
- function init(inst, def) {
4
- var _a;
5
- Object.defineProperty(inst, "_zod", {
6
- value: inst._zod ?? {},
7
- enumerable: false
8
- });
9
- (_a = inst._zod).traits ?? (_a.traits = /* @__PURE__ */ new Set());
10
- inst._zod.traits.add(name);
11
- initializer2(inst, def);
12
- for (const k in _.prototype) {
13
- if (!(k in inst))
14
- Object.defineProperty(inst, k, { value: _.prototype[k].bind(inst) });
15
- }
16
- inst._zod.constr = _;
17
- inst._zod.def = def;
18
- }
19
- const Parent = params?.Parent ?? Object;
20
- class Definition extends Parent {
21
- }
22
- Object.defineProperty(Definition, "name", { value: name });
23
- function _(def) {
24
- var _a;
25
- const inst = params?.Parent ? new Definition() : this;
26
- init(inst, def);
27
- (_a = inst._zod).deferred ?? (_a.deferred = []);
28
- for (const fn of inst._zod.deferred) {
29
- fn();
30
- }
31
- return inst;
32
- }
33
- Object.defineProperty(_, "init", { value: init });
34
- Object.defineProperty(_, Symbol.hasInstance, {
35
- value: (inst) => {
36
- if (params?.Parent && inst instanceof params.Parent)
37
- return true;
38
- return inst?._zod?.traits?.has(name);
39
- }
40
- });
41
- Object.defineProperty(_, "name", { value: name });
42
- return _;
43
- }
44
- class $ZodAsyncError extends Error {
45
- constructor() {
46
- super(`Encountered Promise during synchronous parse. Use .parseAsync() instead.`);
47
- }
48
- }
49
- const globalConfig = {};
50
- function config(newConfig) {
51
- return globalConfig;
52
- }
53
- function getEnumValues(entries) {
54
- const numericValues = Object.values(entries).filter((v) => typeof v === "number");
55
- const values = Object.entries(entries).filter(([k, _]) => numericValues.indexOf(+k) === -1).map(([_, v]) => v);
56
- return values;
57
- }
58
- function jsonStringifyReplacer(_, value) {
59
- if (typeof value === "bigint")
60
- return value.toString();
61
- return value;
62
- }
63
- function cached(getter) {
64
- return {
65
- get value() {
66
- {
67
- const value = getter();
68
- Object.defineProperty(this, "value", { value });
69
- return value;
70
- }
71
- }
72
- };
73
- }
74
- function nullish(input) {
75
- return input === null || input === void 0;
76
- }
77
- function cleanRegex(source) {
78
- const start = source.startsWith("^") ? 1 : 0;
79
- const end = source.endsWith("$") ? source.length - 1 : source.length;
80
- return source.slice(start, end);
81
- }
82
- function defineLazy(object, key, getter) {
83
- Object.defineProperty(object, key, {
84
- get() {
85
- {
86
- const value = getter();
87
- object[key] = value;
88
- return value;
89
- }
90
- },
91
- set(v) {
92
- Object.defineProperty(object, key, {
93
- value: v
94
- // configurable: true,
95
- });
96
- },
97
- configurable: true
98
- });
99
- }
100
- function assignProp(target, prop, value) {
101
- Object.defineProperty(target, prop, {
102
- value,
103
- writable: true,
104
- enumerable: true,
105
- configurable: true
106
- });
107
- }
108
- function esc(str) {
109
- return JSON.stringify(str);
110
- }
111
- const captureStackTrace = Error.captureStackTrace ? Error.captureStackTrace : (..._args) => {
112
- };
113
- function isObject(data) {
114
- return typeof data === "object" && data !== null && !Array.isArray(data);
115
- }
116
- const allowsEval = cached(() => {
117
- if (typeof navigator !== "undefined" && navigator?.userAgent?.includes("Cloudflare")) {
118
- return false;
119
- }
120
- try {
121
- const F = Function;
122
- new F("");
123
- return true;
124
- } catch (_) {
125
- return false;
126
- }
127
- });
128
- function isPlainObject(o) {
129
- if (isObject(o) === false)
130
- return false;
131
- const ctor = o.constructor;
132
- if (ctor === void 0)
133
- return true;
134
- const prot = ctor.prototype;
135
- if (isObject(prot) === false)
136
- return false;
137
- if (Object.prototype.hasOwnProperty.call(prot, "isPrototypeOf") === false) {
138
- return false;
139
- }
140
- return true;
141
- }
142
- const propertyKeyTypes = /* @__PURE__ */ new Set(["string", "number", "symbol"]);
143
- function escapeRegex(str) {
144
- return str.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
145
- }
146
- function clone(inst, def, params) {
147
- const cl = new inst._zod.constr(def ?? inst._zod.def);
148
- if (!def || params?.parent)
149
- cl._zod.parent = inst;
150
- return cl;
151
- }
152
- function normalizeParams(_params) {
153
- const params = _params;
154
- if (!params)
155
- return {};
156
- if (typeof params === "string")
157
- return { error: () => params };
158
- if (params?.message !== void 0) {
159
- if (params?.error !== void 0)
160
- throw new Error("Cannot specify both `message` and `error` params");
161
- params.error = params.message;
162
- }
163
- delete params.message;
164
- if (typeof params.error === "string")
165
- return { ...params, error: () => params.error };
166
- return params;
167
- }
168
- function optionalKeys(shape) {
169
- return Object.keys(shape).filter((k) => {
170
- return shape[k]._zod.optin === "optional" && shape[k]._zod.optout === "optional";
171
- });
172
- }
173
- function pick(schema, mask) {
174
- const newShape = {};
175
- const currDef = schema._zod.def;
176
- for (const key in mask) {
177
- if (!(key in currDef.shape)) {
178
- throw new Error(`Unrecognized key: "${key}"`);
179
- }
180
- if (!mask[key])
181
- continue;
182
- newShape[key] = currDef.shape[key];
183
- }
184
- return clone(schema, {
185
- ...schema._zod.def,
186
- shape: newShape,
187
- checks: []
188
- });
189
- }
190
- function omit(schema, mask) {
191
- const newShape = { ...schema._zod.def.shape };
192
- const currDef = schema._zod.def;
193
- for (const key in mask) {
194
- if (!(key in currDef.shape)) {
195
- throw new Error(`Unrecognized key: "${key}"`);
196
- }
197
- if (!mask[key])
198
- continue;
199
- delete newShape[key];
200
- }
201
- return clone(schema, {
202
- ...schema._zod.def,
203
- shape: newShape,
204
- checks: []
205
- });
206
- }
207
- function extend(schema, shape) {
208
- if (!isPlainObject(shape)) {
209
- throw new Error("Invalid input to extend: expected a plain object");
210
- }
211
- const def = {
212
- ...schema._zod.def,
213
- get shape() {
214
- const _shape = { ...schema._zod.def.shape, ...shape };
215
- assignProp(this, "shape", _shape);
216
- return _shape;
217
- },
218
- checks: []
219
- // delete existing checks
220
- };
221
- return clone(schema, def);
222
- }
223
- function merge(a, b) {
224
- return clone(a, {
225
- ...a._zod.def,
226
- get shape() {
227
- const _shape = { ...a._zod.def.shape, ...b._zod.def.shape };
228
- assignProp(this, "shape", _shape);
229
- return _shape;
230
- },
231
- catchall: b._zod.def.catchall,
232
- checks: []
233
- // delete existing checks
234
- });
235
- }
236
- function partial(Class, schema, mask) {
237
- const oldShape = schema._zod.def.shape;
238
- const shape = { ...oldShape };
239
- if (mask) {
240
- for (const key in mask) {
241
- if (!(key in oldShape)) {
242
- throw new Error(`Unrecognized key: "${key}"`);
243
- }
244
- if (!mask[key])
245
- continue;
246
- shape[key] = Class ? new Class({
247
- type: "optional",
248
- innerType: oldShape[key]
249
- }) : oldShape[key];
250
- }
251
- } else {
252
- for (const key in oldShape) {
253
- shape[key] = Class ? new Class({
254
- type: "optional",
255
- innerType: oldShape[key]
256
- }) : oldShape[key];
257
- }
258
- }
259
- return clone(schema, {
260
- ...schema._zod.def,
261
- shape,
262
- checks: []
263
- });
264
- }
265
- function required(Class, schema, mask) {
266
- const oldShape = schema._zod.def.shape;
267
- const shape = { ...oldShape };
268
- if (mask) {
269
- for (const key in mask) {
270
- if (!(key in shape)) {
271
- throw new Error(`Unrecognized key: "${key}"`);
272
- }
273
- if (!mask[key])
274
- continue;
275
- shape[key] = new Class({
276
- type: "nonoptional",
277
- innerType: oldShape[key]
278
- });
279
- }
280
- } else {
281
- for (const key in oldShape) {
282
- shape[key] = new Class({
283
- type: "nonoptional",
284
- innerType: oldShape[key]
285
- });
286
- }
287
- }
288
- return clone(schema, {
289
- ...schema._zod.def,
290
- shape,
291
- // optional: [],
292
- checks: []
293
- });
294
- }
295
- function aborted(x, startIndex = 0) {
296
- for (let i = startIndex; i < x.issues.length; i++) {
297
- if (x.issues[i]?.continue !== true)
298
- return true;
299
- }
300
- return false;
301
- }
302
- function prefixIssues(path, issues) {
303
- return issues.map((iss) => {
304
- var _a;
305
- (_a = iss).path ?? (_a.path = []);
306
- iss.path.unshift(path);
307
- return iss;
308
- });
309
- }
310
- function unwrapMessage(message) {
311
- return typeof message === "string" ? message : message?.message;
312
- }
313
- function finalizeIssue(iss, ctx, config2) {
314
- const full = { ...iss, path: iss.path ?? [] };
315
- if (!iss.message) {
316
- const message = unwrapMessage(iss.inst?._zod.def?.error?.(iss)) ?? unwrapMessage(ctx?.error?.(iss)) ?? unwrapMessage(config2.customError?.(iss)) ?? unwrapMessage(config2.localeError?.(iss)) ?? "Invalid input";
317
- full.message = message;
318
- }
319
- delete full.inst;
320
- delete full.continue;
321
- if (!ctx?.reportInput) {
322
- delete full.input;
323
- }
324
- return full;
325
- }
326
- function getLengthableOrigin(input) {
327
- if (Array.isArray(input))
328
- return "array";
329
- if (typeof input === "string")
330
- return "string";
331
- return "unknown";
332
- }
333
- function issue(...args) {
334
- const [iss, input, inst] = args;
335
- if (typeof iss === "string") {
336
- return {
337
- message: iss,
338
- code: "custom",
339
- input,
340
- inst
341
- };
342
- }
343
- return { ...iss };
344
- }
345
- const initializer = (inst, def) => {
346
- inst.name = "$ZodError";
347
- Object.defineProperty(inst, "_zod", {
348
- value: inst._zod,
349
- enumerable: false
350
- });
351
- Object.defineProperty(inst, "issues", {
352
- value: def,
353
- enumerable: false
354
- });
355
- Object.defineProperty(inst, "message", {
356
- get() {
357
- return JSON.stringify(def, jsonStringifyReplacer, 2);
358
- },
359
- enumerable: true
360
- // configurable: false,
361
- });
362
- Object.defineProperty(inst, "toString", {
363
- value: () => inst.message,
364
- enumerable: false
365
- });
366
- };
367
- const $ZodError = $constructor("$ZodError", initializer);
368
- const $ZodRealError = $constructor("$ZodError", initializer, { Parent: Error });
369
- function flattenError(error, mapper = (issue2) => issue2.message) {
370
- const fieldErrors = {};
371
- const formErrors = [];
372
- for (const sub of error.issues) {
373
- if (sub.path.length > 0) {
374
- fieldErrors[sub.path[0]] = fieldErrors[sub.path[0]] || [];
375
- fieldErrors[sub.path[0]].push(mapper(sub));
376
- } else {
377
- formErrors.push(mapper(sub));
378
- }
379
- }
380
- return { formErrors, fieldErrors };
381
- }
382
- function formatError(error, _mapper) {
383
- const mapper = _mapper || function(issue2) {
384
- return issue2.message;
385
- };
386
- const fieldErrors = { _errors: [] };
387
- const processError = (error2) => {
388
- for (const issue2 of error2.issues) {
389
- if (issue2.code === "invalid_union" && issue2.errors.length) {
390
- issue2.errors.map((issues) => processError({ issues }));
391
- } else if (issue2.code === "invalid_key") {
392
- processError({ issues: issue2.issues });
393
- } else if (issue2.code === "invalid_element") {
394
- processError({ issues: issue2.issues });
395
- } else if (issue2.path.length === 0) {
396
- fieldErrors._errors.push(mapper(issue2));
397
- } else {
398
- let curr = fieldErrors;
399
- let i = 0;
400
- while (i < issue2.path.length) {
401
- const el = issue2.path[i];
402
- const terminal = i === issue2.path.length - 1;
403
- if (!terminal) {
404
- curr[el] = curr[el] || { _errors: [] };
405
- } else {
406
- curr[el] = curr[el] || { _errors: [] };
407
- curr[el]._errors.push(mapper(issue2));
408
- }
409
- curr = curr[el];
410
- i++;
411
- }
412
- }
413
- }
414
- };
415
- processError(error);
416
- return fieldErrors;
417
- }
418
- const _parse = (_Err) => (schema, value, _ctx, _params) => {
419
- const ctx = _ctx ? Object.assign(_ctx, { async: false }) : { async: false };
420
- const result = schema._zod.run({ value, issues: [] }, ctx);
421
- if (result instanceof Promise) {
422
- throw new $ZodAsyncError();
423
- }
424
- if (result.issues.length) {
425
- const e = new (_params?.Err ?? _Err)(result.issues.map((iss) => finalizeIssue(iss, ctx, config())));
426
- captureStackTrace(e, _params?.callee);
427
- throw e;
428
- }
429
- return result.value;
430
- };
431
- const parse = /* @__PURE__ */ _parse($ZodRealError);
432
- const _parseAsync = (_Err) => async (schema, value, _ctx, params) => {
433
- const ctx = _ctx ? Object.assign(_ctx, { async: true }) : { async: true };
434
- let result = schema._zod.run({ value, issues: [] }, ctx);
435
- if (result instanceof Promise)
436
- result = await result;
437
- if (result.issues.length) {
438
- const e = new (params?.Err ?? _Err)(result.issues.map((iss) => finalizeIssue(iss, ctx, config())));
439
- captureStackTrace(e, params?.callee);
440
- throw e;
441
- }
442
- return result.value;
443
- };
444
- const parseAsync = /* @__PURE__ */ _parseAsync($ZodRealError);
445
- const _safeParse = (_Err) => (schema, value, _ctx) => {
446
- const ctx = _ctx ? { ..._ctx, async: false } : { async: false };
447
- const result = schema._zod.run({ value, issues: [] }, ctx);
448
- if (result instanceof Promise) {
449
- throw new $ZodAsyncError();
450
- }
451
- return result.issues.length ? {
452
- success: false,
453
- error: new (_Err ?? $ZodError)(result.issues.map((iss) => finalizeIssue(iss, ctx, config())))
454
- } : { success: true, data: result.value };
455
- };
456
- const safeParse = /* @__PURE__ */ _safeParse($ZodRealError);
457
- const _safeParseAsync = (_Err) => async (schema, value, _ctx) => {
458
- const ctx = _ctx ? Object.assign(_ctx, { async: true }) : { async: true };
459
- let result = schema._zod.run({ value, issues: [] }, ctx);
460
- if (result instanceof Promise)
461
- result = await result;
462
- return result.issues.length ? {
463
- success: false,
464
- error: new _Err(result.issues.map((iss) => finalizeIssue(iss, ctx, config())))
465
- } : { success: true, data: result.value };
466
- };
467
- const safeParseAsync = /* @__PURE__ */ _safeParseAsync($ZodRealError);
468
- exports.$ZodAsyncError = $ZodAsyncError;
469
- exports.$ZodError = $ZodError;
470
- exports.$constructor = $constructor;
471
- exports._parse = _parse;
472
- exports._parseAsync = _parseAsync;
473
- exports._safeParse = _safeParse;
474
- exports._safeParseAsync = _safeParseAsync;
475
- exports.aborted = aborted;
476
- exports.allowsEval = allowsEval;
477
- exports.assignProp = assignProp;
478
- exports.cached = cached;
479
- exports.cleanRegex = cleanRegex;
480
- exports.clone = clone;
481
- exports.config = config;
482
- exports.defineLazy = defineLazy;
483
- exports.esc = esc;
484
- exports.escapeRegex = escapeRegex;
485
- exports.extend = extend;
486
- exports.finalizeIssue = finalizeIssue;
487
- exports.flattenError = flattenError;
488
- exports.formatError = formatError;
489
- exports.getEnumValues = getEnumValues;
490
- exports.getLengthableOrigin = getLengthableOrigin;
491
- exports.globalConfig = globalConfig;
492
- exports.isObject = isObject;
493
- exports.isPlainObject = isPlainObject;
494
- exports.issue = issue;
495
- exports.merge = merge;
496
- exports.normalizeParams = normalizeParams;
497
- exports.nullish = nullish;
498
- exports.omit = omit;
499
- exports.optionalKeys = optionalKeys;
500
- exports.parse = parse;
501
- exports.parseAsync = parseAsync;
502
- exports.partial = partial;
503
- exports.pick = pick;
504
- exports.prefixIssues = prefixIssues;
505
- exports.propertyKeyTypes = propertyKeyTypes;
506
- exports.required = required;
507
- exports.safeParse = safeParse;
508
- exports.safeParseAsync = safeParseAsync;
509
- //# sourceMappingURL=parse-Ltyyb1op.cjs.map