@solidxai/core-ui 0.1.11 → 0.1.12-beta.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 (105) hide show
  1. package/dist/adapters/auth/signInWithOAuthAccessCode.d.ts +1 -1
  2. package/dist/adapters/auth/signInWithOAuthAccessCode.d.ts.map +1 -1
  3. package/dist/adapters/auth/signInWithOAuthAccessCode.js.map +1 -1
  4. package/dist/adapters/auth/signInWithOAuthAccessCode.ts +1 -1
  5. package/dist/components/auth/SolidLogin.d.ts.map +1 -1
  6. package/dist/components/auth/SolidLogin.js +10 -6
  7. package/dist/components/auth/SolidLogin.js.map +1 -1
  8. package/dist/components/auth/SolidLogin.tsx +19 -3
  9. package/dist/components/auth/SolidRegister.d.ts.map +1 -1
  10. package/dist/components/auth/SolidRegister.js +12 -8
  11. package/dist/components/auth/SolidRegister.js.map +1 -1
  12. package/dist/components/auth/SolidRegister.tsx +19 -3
  13. package/dist/components/common/GeneralSettings.d.ts.map +1 -1
  14. package/dist/components/common/GeneralSettings.js +46 -43
  15. package/dist/components/common/GeneralSettings.js.map +1 -1
  16. package/dist/components/common/GeneralSettings.tsx +22 -0
  17. package/dist/components/common/SocialMediaLogin.d.ts +2 -1
  18. package/dist/components/common/SocialMediaLogin.d.ts.map +1 -1
  19. package/dist/components/common/SocialMediaLogin.js +6 -6
  20. package/dist/components/common/SocialMediaLogin.js.map +1 -1
  21. package/dist/components/common/SocialMediaLogin.tsx +36 -8
  22. package/dist/components/common/SolidLoadingState.d.ts +10 -0
  23. package/dist/components/common/SolidLoadingState.d.ts.map +1 -0
  24. package/dist/components/common/SolidLoadingState.js +8 -0
  25. package/dist/components/common/SolidLoadingState.js.map +1 -0
  26. package/dist/components/common/SolidLoadingState.module.css +56 -0
  27. package/dist/components/common/SolidLoadingState.tsx +28 -0
  28. package/dist/components/core/json/SolidJsonEditor.css +195 -0
  29. package/dist/components/core/json/SolidJsonEditor.d.ts +19 -0
  30. package/dist/components/core/json/SolidJsonEditor.d.ts.map +1 -0
  31. package/dist/components/core/json/SolidJsonEditor.js +109 -0
  32. package/dist/components/core/json/SolidJsonEditor.js.map +1 -0
  33. package/dist/components/core/json/SolidJsonEditor.tsx +150 -0
  34. package/dist/components/core/module/CreateModule.css +70 -2
  35. package/dist/components/core/module/CreateModule.d.ts.map +1 -1
  36. package/dist/components/core/module/CreateModule.js +2 -2
  37. package/dist/components/core/module/CreateModule.js.map +1 -1
  38. package/dist/components/core/module/CreateModule.tsx +13 -1
  39. package/dist/components/shad-cn-ui/SolidTabs.d.ts.map +1 -1
  40. package/dist/components/shad-cn-ui/SolidTabs.js +1 -1
  41. package/dist/components/shad-cn-ui/SolidTabs.js.map +1 -1
  42. package/dist/components/shad-cn-ui/SolidTabs.tsx +1 -0
  43. package/dist/index.d.ts +5 -0
  44. package/dist/index.d.ts.map +1 -1
  45. package/dist/index.js +5 -0
  46. package/dist/index.js.map +1 -1
  47. package/dist/index.ts +16 -0
  48. package/dist/redux/api/datasourceIntrospectionApi.d.ts +203 -0
  49. package/dist/redux/api/datasourceIntrospectionApi.d.ts.map +1 -0
  50. package/dist/redux/api/datasourceIntrospectionApi.js +71 -0
  51. package/dist/redux/api/datasourceIntrospectionApi.js.map +1 -0
  52. package/dist/redux/api/datasourceIntrospectionApi.ts +261 -0
  53. package/dist/redux/api/datasourceManagementApi.d.ts +46 -0
  54. package/dist/redux/api/datasourceManagementApi.d.ts.map +1 -0
  55. package/dist/redux/api/datasourceManagementApi.js +35 -0
  56. package/dist/redux/api/datasourceManagementApi.js.map +1 -0
  57. package/dist/redux/api/datasourceManagementApi.ts +86 -0
  58. package/dist/redux/store/StoreProvider.d.ts.map +1 -1
  59. package/dist/redux/store/StoreProvider.js +4 -2
  60. package/dist/redux/store/StoreProvider.js.map +1 -1
  61. package/dist/redux/store/StoreProvider.tsx +9 -1
  62. package/dist/redux/store/defaultStoreConfig.d.ts +23 -0
  63. package/dist/redux/store/defaultStoreConfig.d.ts.map +1 -1
  64. package/dist/redux/store/defaultStoreConfig.js +4 -0
  65. package/dist/redux/store/defaultStoreConfig.js.map +1 -1
  66. package/dist/redux/store/defaultStoreConfig.ts +4 -0
  67. package/dist/resources/solid-custom.css +72 -18
  68. package/dist/routes/guards/AdminGuard.d.ts.map +1 -1
  69. package/dist/routes/guards/AdminGuard.js +2 -1
  70. package/dist/routes/guards/AdminGuard.js.map +1 -1
  71. package/dist/routes/guards/AdminGuard.tsx +7 -1
  72. package/dist/routes/guards/AuthGuard.d.ts.map +1 -1
  73. package/dist/routes/guards/AuthGuard.js +2 -1
  74. package/dist/routes/guards/AuthGuard.js.map +1 -1
  75. package/dist/routes/guards/AuthGuard.tsx +8 -2
  76. package/dist/routes/guards/GuestGuard.d.ts.map +1 -1
  77. package/dist/routes/guards/GuestGuard.js +2 -1
  78. package/dist/routes/guards/GuestGuard.js.map +1 -1
  79. package/dist/routes/guards/GuestGuard.tsx +8 -2
  80. package/dist/routes/pages/admin/core/DashboardPage.d.ts.map +1 -1
  81. package/dist/routes/pages/admin/core/DashboardPage.js +7 -5
  82. package/dist/routes/pages/admin/core/DashboardPage.js.map +1 -1
  83. package/dist/routes/pages/admin/core/DashboardPage.module.css +18 -0
  84. package/dist/routes/pages/admin/core/DashboardPage.tsx +50 -32
  85. package/dist/routes/pages/admin/core/DatasourceIntrospectionPage.css +828 -0
  86. package/dist/routes/pages/admin/core/DatasourceIntrospectionPage.d.ts +3 -0
  87. package/dist/routes/pages/admin/core/DatasourceIntrospectionPage.d.ts.map +1 -0
  88. package/dist/routes/pages/admin/core/DatasourceIntrospectionPage.js +947 -0
  89. package/dist/routes/pages/admin/core/DatasourceIntrospectionPage.js.map +1 -0
  90. package/dist/routes/pages/admin/core/DatasourceIntrospectionPage.tsx +1719 -0
  91. package/dist/routes/pages/admin/core/DatasourcesPage.css +337 -0
  92. package/dist/routes/pages/admin/core/DatasourcesPage.d.ts +3 -0
  93. package/dist/routes/pages/admin/core/DatasourcesPage.d.ts.map +1 -0
  94. package/dist/routes/pages/admin/core/DatasourcesPage.js +221 -0
  95. package/dist/routes/pages/admin/core/DatasourcesPage.js.map +1 -0
  96. package/dist/routes/pages/admin/core/DatasourcesPage.tsx +540 -0
  97. package/dist/routes/solidRoutes.d.ts.map +1 -1
  98. package/dist/routes/solidRoutes.js +7 -1
  99. package/dist/routes/solidRoutes.js.map +1 -1
  100. package/dist/routes/solidRoutes.tsx +6 -0
  101. package/dist/routes/types.d.ts +1 -1
  102. package/dist/routes/types.d.ts.map +1 -1
  103. package/dist/routes/types.js.map +1 -1
  104. package/dist/routes/types.ts +1 -0
  105. package/package.json +1 -1
@@ -3,12 +3,12 @@ import { useRouter } from "../../hooks/useRouter";
3
3
  import { env } from "../../adapters/env";
4
4
  import { SolidButton } from "../shad-cn-ui";
5
5
  export var SocialMediaLogin = function (_a) {
6
- var _b = _a.googleEnabled, googleEnabled = _b === void 0 ? false : _b, _c = _a.facebookEnabled, facebookEnabled = _c === void 0 ? false : _c, _d = _a.appleEnabled, appleEnabled = _d === void 0 ? false : _d, _e = _a.microsoftEnabled, microsoftEnabled = _e === void 0 ? false : _e;
6
+ var _b = _a.googleEnabled, googleEnabled = _b === void 0 ? false : _b, _c = _a.facebookEnabled, facebookEnabled = _c === void 0 ? false : _c, _d = _a.appleEnabled, appleEnabled = _d === void 0 ? false : _d, _e = _a.microsoftEnabled, microsoftEnabled = _e === void 0 ? false : _e, _f = _a.microsoftActiveDirectoryEnabled, microsoftActiveDirectoryEnabled = _f === void 0 ? false : _f;
7
7
  var router = useRouter();
8
- var googleApiConnectRedirectUrl = "".concat(env("NEXT_PUBLIC_BACKEND_API_URL"), "/api/iam/google/connect");
9
- var facebookApiConnectRedirectUrl = "".concat(env("NEXT_PUBLIC_BACKEND_API_URL"), "/api/iam/facebook/connect");
10
- var appleApiConnectRedirectUrl = "".concat(env("NEXT_PUBLIC_BACKEND_API_URL"), "/api/iam/apple/connect");
11
- var microsoftApiConnectRedirectUrl = "".concat(env("NEXT_PUBLIC_BACKEND_API_URL"), "/api/iam/microsoft/connect");
12
- return (_jsx("div", { className: "mt-4", children: _jsxs("div", { className: "solid-auth-social-grid", children: [appleEnabled && (_jsx(SolidButton, { type: "button", variant: "outline", className: "solid-auth-social-btn", tabIndex: -1, onClick: function () { return router.push(appleApiConnectRedirectUrl); }, "aria-label": "Login with Apple", children: _jsx("svg", { viewBox: "0 0 24 24", width: "18", height: "18", fill: "currentColor", "aria-hidden": "true", children: _jsx("path", { d: "M12.152 6.896c-.948 0-2.415-1.078-3.96-1.04-2.04.027-3.91 1.183-4.961 3.014-2.117 3.675-.546 9.103 1.519 12.09 1.013 1.454 2.208 3.09 3.792 3.039 1.52-.065 2.09-.987 3.935-.987 1.831 0 2.35.987 3.96.948 1.637-.026 2.676-1.48 3.676-2.948 1.156-1.688 1.636-3.325 1.662-3.415-.039-.013-3.182-1.221-3.22-4.857-.026-3.04 2.48-4.494 2.597-4.559-1.429-2.09-3.623-2.324-4.39-2.376-2-.156-3.675 1.09-4.61 1.09zM15.53 3.83c.843-1.012 1.4-2.427 1.245-3.83-1.207.052-2.662.805-3.532 1.818-.78.896-1.454 2.338-1.273 3.714 1.338.104 2.715-.688 3.559-1.701" }) }) })), googleEnabled && (_jsx(SolidButton, { type: "button", variant: "outline", className: "solid-auth-social-btn", tabIndex: -1, onClick: function () { return router.push(googleApiConnectRedirectUrl); }, "aria-label": "Login with Google", children: _jsxs("svg", { viewBox: "0 0 24 24", width: "18", height: "18", fill: "none", "aria-hidden": "true", children: [_jsx("path", { d: "M21.8 12.23c0-.74-.07-1.45-.2-2.13H12v4.03h5.5a4.7 4.7 0 0 1-2.04 3.08v2.55h3.3c1.93-1.78 3.04-4.4 3.04-7.53z", fill: "#4285F4" }), _jsx("path", { d: "M12 22c2.75 0 5.05-.91 6.73-2.47l-3.3-2.55c-.92.62-2.1.99-3.43.99-2.64 0-4.88-1.78-5.68-4.18H2.9v2.63A10 10 0 0 0 12 22z", fill: "#34A853" }), _jsx("path", { d: "M6.32 13.79a6 6 0 0 1 0-3.58V7.58H2.9a10 10 0 0 0 0 8.84l3.42-2.63z", fill: "#FBBC05" }), _jsx("path", { d: "M12 6.02c1.49 0 2.82.51 3.87 1.5l2.9-2.9C17.04 2.98 14.74 2 12 2A10 10 0 0 0 2.9 7.58l3.42 2.63c.8-2.4 3.04-4.19 5.68-4.19z", fill: "#EA4335" })] }) })), facebookEnabled && (_jsx(SolidButton, { type: "button", variant: "outline", className: "solid-auth-social-btn", tabIndex: -1, onClick: function () { return router.push(facebookApiConnectRedirectUrl); }, "aria-label": "Login with Meta", children: _jsx("svg", { viewBox: "0 0 24 24", width: "18", height: "18", fill: "none", "aria-hidden": "true", children: _jsx("path", { d: "M5.4 15.6c0-3.14 1.62-7.09 3.76-7.09 1.43 0 2.56 1.72 2.84 2.25.28-.53 1.41-2.25 2.84-2.25 2.14 0 3.76 3.95 3.76 7.09 0 1.79-.63 2.89-1.82 2.89-2.12 0-3.75-3.02-4.78-4.82-1.03 1.8-2.66 4.82-4.78 4.82-1.19 0-1.82-1.1-1.82-2.89z", stroke: "currentColor", strokeWidth: "1.8", strokeLinecap: "round", strokeLinejoin: "round" }) }) })), microsoftEnabled && (_jsx(SolidButton, { type: "button", variant: "outline", className: "solid-auth-social-btn", tabIndex: -1, onClick: function () { return router.push(microsoftApiConnectRedirectUrl); }, "aria-label": "Login with Microsoft", children: _jsx("svg", { viewBox: "0 0 24 24", width: "18", height: "18", "aria-hidden": "true", children: _jsxs("g", { transform: "translate(2, 2)", children: [_jsx("rect", { width: "9", height: "9", x: "0", y: "0", fill: "#f25022" }), _jsx("rect", { width: "9", height: "9", x: "11", y: "0", fill: "#7fba00" }), _jsx("rect", { width: "9", height: "9", x: "0", y: "11", fill: "#00a4ef" }), _jsx("rect", { width: "9", height: "9", x: "11", y: "11", fill: "#ffb900" })] }) }) }))] }) }));
8
+ var backendApiUrl = (env("NEXT_PUBLIC_BACKEND_API_URL") || env("API_URL")).replace(/\/+$/, "");
9
+ var getOAuthConnectUrl = function (provider) {
10
+ return "".concat(backendApiUrl, "/api/iam/").concat(provider, "/connect");
11
+ };
12
+ return (_jsx("div", { className: "mt-4", children: _jsxs("div", { className: "solid-auth-social-grid", children: [appleEnabled && (_jsx(SolidButton, { type: "button", variant: "outline", className: "solid-auth-social-btn", tabIndex: -1, onClick: function () { return router.push(getOAuthConnectUrl("apple")); }, "aria-label": "Login with Apple", title: "Login with Apple", children: _jsx("svg", { viewBox: "0 0 24 24", width: "18", height: "18", fill: "currentColor", "aria-hidden": "true", children: _jsx("path", { d: "M12.152 6.896c-.948 0-2.415-1.078-3.96-1.04-2.04.027-3.91 1.183-4.961 3.014-2.117 3.675-.546 9.103 1.519 12.09 1.013 1.454 2.208 3.09 3.792 3.039 1.52-.065 2.09-.987 3.935-.987 1.831 0 2.35.987 3.96.948 1.637-.026 2.676-1.48 3.676-2.948 1.156-1.688 1.636-3.325 1.662-3.415-.039-.013-3.182-1.221-3.22-4.857-.026-3.04 2.48-4.494 2.597-4.559-1.429-2.09-3.623-2.324-4.39-2.376-2-.156-3.675 1.09-4.61 1.09zM15.53 3.83c.843-1.012 1.4-2.427 1.245-3.83-1.207.052-2.662.805-3.532 1.818-.78.896-1.454 2.338-1.273 3.714 1.338.104 2.715-.688 3.559-1.701" }) }) })), googleEnabled && (_jsx(SolidButton, { type: "button", variant: "outline", className: "solid-auth-social-btn", tabIndex: -1, onClick: function () { return router.push(getOAuthConnectUrl("google")); }, "aria-label": "Login with Google", title: "Login with Google", children: _jsxs("svg", { viewBox: "0 0 24 24", width: "18", height: "18", fill: "none", "aria-hidden": "true", children: [_jsx("path", { d: "M21.8 12.23c0-.74-.07-1.45-.2-2.13H12v4.03h5.5a4.7 4.7 0 0 1-2.04 3.08v2.55h3.3c1.93-1.78 3.04-4.4 3.04-7.53z", fill: "#4285F4" }), _jsx("path", { d: "M12 22c2.75 0 5.05-.91 6.73-2.47l-3.3-2.55c-.92.62-2.1.99-3.43.99-2.64 0-4.88-1.78-5.68-4.18H2.9v2.63A10 10 0 0 0 12 22z", fill: "#34A853" }), _jsx("path", { d: "M6.32 13.79a6 6 0 0 1 0-3.58V7.58H2.9a10 10 0 0 0 0 8.84l3.42-2.63z", fill: "#FBBC05" }), _jsx("path", { d: "M12 6.02c1.49 0 2.82.51 3.87 1.5l2.9-2.9C17.04 2.98 14.74 2 12 2A10 10 0 0 0 2.9 7.58l3.42 2.63c.8-2.4 3.04-4.19 5.68-4.19z", fill: "#EA4335" })] }) })), facebookEnabled && (_jsx(SolidButton, { type: "button", variant: "outline", className: "solid-auth-social-btn", tabIndex: -1, onClick: function () { return router.push(getOAuthConnectUrl("facebook")); }, "aria-label": "Login with Meta", title: "Login with Meta", children: _jsx("svg", { viewBox: "0 0 24 24", width: "18", height: "18", fill: "none", "aria-hidden": "true", children: _jsx("path", { d: "M5.4 15.6c0-3.14 1.62-7.09 3.76-7.09 1.43 0 2.56 1.72 2.84 2.25.28-.53 1.41-2.25 2.84-2.25 2.14 0 3.76 3.95 3.76 7.09 0 1.79-.63 2.89-1.82 2.89-2.12 0-3.75-3.02-4.78-4.82-1.03 1.8-2.66 4.82-4.78 4.82-1.19 0-1.82-1.1-1.82-2.89z", stroke: "currentColor", strokeWidth: "1.8", strokeLinecap: "round", strokeLinejoin: "round" }) }) })), microsoftEnabled && (_jsx(SolidButton, { type: "button", variant: "outline", className: "solid-auth-social-btn", tabIndex: -1, onClick: function () { return router.push(getOAuthConnectUrl("microsoft")); }, "aria-label": "Login with Microsoft", title: "Login with Microsoft", children: _jsx("svg", { viewBox: "0 0 24 24", width: "18", height: "18", "aria-hidden": "true", children: _jsxs("g", { transform: "translate(2, 2)", children: [_jsx("rect", { width: "9", height: "9", x: "0", y: "0", fill: "#f25022" }), _jsx("rect", { width: "9", height: "9", x: "11", y: "0", fill: "#7fba00" }), _jsx("rect", { width: "9", height: "9", x: "0", y: "11", fill: "#00a4ef" }), _jsx("rect", { width: "9", height: "9", x: "11", y: "11", fill: "#ffb900" })] }) }) })), microsoftActiveDirectoryEnabled && (_jsx(SolidButton, { type: "button", variant: "outline", className: "solid-auth-social-btn", tabIndex: -1, onClick: function () { return router.push(getOAuthConnectUrl("microsoft-active-directory")); }, "aria-label": "Login with Microsoft Active Directory", title: "Login with Microsoft Active Directory", children: _jsx("svg", { viewBox: "0 0 24 24", width: "18", height: "18", "aria-hidden": "true", children: _jsxs("g", { transform: "translate(2, 2)", children: [_jsx("rect", { width: "9", height: "9", x: "0", y: "0", fill: "#f25022" }), _jsx("rect", { width: "9", height: "9", x: "11", y: "0", fill: "#7fba00" }), _jsx("rect", { width: "9", height: "9", x: "0", y: "11", fill: "#00a4ef" }), _jsx("rect", { width: "9", height: "9", x: "11", y: "11", fill: "#ffb900" })] }) }) }))] }) }));
13
13
  };
14
14
  //# sourceMappingURL=SocialMediaLogin.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"SocialMediaLogin.js","sourceRoot":"","sources":["../../../src/components/common/SocialMediaLogin.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,uBAAuB,CAAC;AAClD,OAAO,EAAE,GAAG,EAAE,MAAM,oBAAoB,CAAC;AACzC,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAS5C,MAAM,CAAC,IAAM,gBAAgB,GAAG,UAAC,EAKT;QAJtB,qBAAqB,EAArB,aAAa,mBAAG,KAAK,KAAA,EACrB,uBAAuB,EAAvB,eAAe,mBAAG,KAAK,KAAA,EACvB,oBAAoB,EAApB,YAAY,mBAAG,KAAK,KAAA,EACpB,wBAAwB,EAAxB,gBAAgB,mBAAG,KAAK,KAAA;IAExB,IAAM,MAAM,GAAG,SAAS,EAAE,CAAC;IAE3B,IAAM,2BAA2B,GAAG,UAAG,GAAG,CAAC,6BAA6B,CAAC,4BAAyB,CAAC;IACnG,IAAM,6BAA6B,GAAG,UAAG,GAAG,CAAC,6BAA6B,CAAC,8BAA2B,CAAC;IACvG,IAAM,0BAA0B,GAAG,UAAG,GA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GAAG,EACzD,eAAM,KAAK,EAAC,GAAG,EAAC,MAAM,EAAC,GAAG,EAAC,CAAC,EAAC,IAAI,EAAC,CAAC,EAAC,IAAI,EAAC,IAAI,EAAC,SAAS,GAAG,IACxD,GACA,GACM,CACb,IACG,GACF,CACP,CAAC;AACJ,CAAC,CAAC","sourcesContent":["import { useRouter } from \"../../hooks/useRouter\";\nimport { env } from \"../../adapters/env\";\nimport { SolidButton } from \"../shad-cn-ui\";\n\ntype SocialMediaLoginProps = {\n googleEnabled?: boolean;\n facebookEnabled?: boolean;\n appleEnabled?: boolean;\n microsoftEnabled?: boolean;\n};\n\nexport const SocialMediaLogin = ({\n googleEnabled = false,\n facebookEnabled = false,\n appleEnabled = false,\n microsoftEnabled = false,\n}: SocialMediaLoginProps) => {\n const router = useRouter();\n\n const googleApiConnectRedirectUrl = `${env(\"NEXT_PUBLIC_BACKEND_API_URL\")}/api/iam/google/connect`;\n const facebookApiConnectRedirectUrl = `${env(\"NEXT_PUBLIC_BACKEND_API_URL\")}/api/iam/facebook/connect`;\n const appleApiConnectRedirectUrl = `${env(\"NEXT_PUBLIC_BACKEND_API_URL\")}/api/iam/apple/connect`;\n const microsoftApiConnectRedirectUrl = `${env(\"NEXT_PUBLIC_BACKEND_API_URL\")}/api/iam/microsoft/connect`;\n\n return (\n <div className=\"mt-4\">\n <div className=\"solid-auth-social-grid\">\n {appleEnabled && (\n <SolidButton\n type=\"button\"\n variant=\"outline\"\n className=\"solid-auth-social-btn\"\n tabIndex={-1}\n onClick={() => router.push(appleApiConnectRedirectUrl)}\n aria-label=\"Login with Apple\"\n >\n <svg\n viewBox=\"0 0 24 24\"\n width=\"18\"\n height=\"18\"\n fill=\"currentColor\"\n aria-hidden=\"true\"\n >\n <path d=\"M12.152 6.896c-.948 0-2.415-1.078-3.96-1.04-2.04.027-3.91 1.183-4.961 3.014-2.117 3.675-.546 9.103 1.519 12.09 1.013 1.454 2.208 3.09 3.792 3.039 1.52-.065 2.09-.987 3.935-.987 1.831 0 2.35.987 3.96.948 1.637-.026 2.676-1.48 3.676-2.948 1.156-1.688 1.636-3.325 1.662-3.415-.039-.013-3.182-1.221-3.22-4.857-.026-3.04 2.48-4.494 2.597-4.559-1.429-2.09-3.623-2.324-4.39-2.376-2-.156-3.675 1.09-4.61 1.09zM15.53 3.83c.843-1.012 1.4-2.427 1.245-3.83-1.207.052-2.662.805-3.532 1.818-.78.896-1.454 2.338-1.273 3.714 1.338.104 2.715-.688 3.559-1.701\" />\n </svg>\n </SolidButton>\n )}\n\n {googleEnabled && (\n <SolidButton\n type=\"button\"\n variant=\"outline\"\n className=\"solid-auth-social-btn\"\n tabIndex={-1}\n onClick={() => router.push(googleApiConnectRedirectUrl)}\n aria-label=\"Login with Google\"\n >\n <svg\n viewBox=\"0 0 24 24\"\n width=\"18\"\n height=\"18\"\n fill=\"none\"\n aria-hidden=\"true\"\n >\n <path\n d=\"M21.8 12.23c0-.74-.07-1.45-.2-2.13H12v4.03h5.5a4.7 4.7 0 0 1-2.04 3.08v2.55h3.3c1.93-1.78 3.04-4.4 3.04-7.53z\"\n fill=\"#4285F4\"\n />\n <path\n d=\"M12 22c2.75 0 5.05-.91 6.73-2.47l-3.3-2.55c-.92.62-2.1.99-3.43.99-2.64 0-4.88-1.78-5.68-4.18H2.9v2.63A10 10 0 0 0 12 22z\"\n fill=\"#34A853\"\n />\n <path\n d=\"M6.32 13.79a6 6 0 0 1 0-3.58V7.58H2.9a10 10 0 0 0 0 8.84l3.42-2.63z\"\n fill=\"#FBBC05\"\n />\n <path\n d=\"M12 6.02c1.49 0 2.82.51 3.87 1.5l2.9-2.9C17.04 2.98 14.74 2 12 2A10 10 0 0 0 2.9 7.58l3.42 2.63c.8-2.4 3.04-4.19 5.68-4.19z\"\n fill=\"#EA4335\"\n />\n </svg>\n </SolidButton>\n )}\n\n {facebookEnabled && (\n <SolidButton\n type=\"button\"\n variant=\"outline\"\n className=\"solid-auth-social-btn\"\n tabIndex={-1}\n onClick={() => router.push(facebookApiConnectRedirectUrl)}\n aria-label=\"Login with Meta\"\n >\n <svg\n viewBox=\"0 0 24 24\"\n width=\"18\"\n height=\"18\"\n fill=\"none\"\n aria-hidden=\"true\"\n >\n <path\n d=\"M5.4 15.6c0-3.14 1.62-7.09 3.76-7.09 1.43 0 2.56 1.72 2.84 2.25.28-.53 1.41-2.25 2.84-2.25 2.14 0 3.76 3.95 3.76 7.09 0 1.79-.63 2.89-1.82 2.89-2.12 0-3.75-3.02-4.78-4.82-1.03 1.8-2.66 4.82-4.78 4.82-1.19 0-1.82-1.1-1.82-2.89z\"\n stroke=\"currentColor\"\n strokeWidth=\"1.8\"\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n />\n </svg>\n </SolidButton>\n )}\n\n {microsoftEnabled && (\n <SolidButton\n type=\"button\"\n variant=\"outline\"\n className=\"solid-auth-social-btn\"\n tabIndex={-1}\n onClick={() => router.push(microsoftApiConnectRedirectUrl)}\n aria-label=\"Login with Microsoft\"\n >\n <svg viewBox=\"0 0 24 24\" width=\"18\" height=\"18\" aria-hidden=\"true\">\n <g transform=\"translate(2, 2)\">\n <rect width=\"9\" height=\"9\" x=\"0\" y=\"0\" fill=\"#f25022\" />\n <rect width=\"9\" height=\"9\" x=\"11\" y=\"0\" fill=\"#7fba00\" />\n <rect width=\"9\" height=\"9\" x=\"0\" y=\"11\" fill=\"#00a4ef\" />\n <rect width=\"9\" height=\"9\" x=\"11\" y=\"11\" fill=\"#ffb900\" />\n </g>\n </svg>\n </SolidButton>\n )}\n </div>\n </div>\n );\n};\n"]}
1
+ {"version":3,"file":"SocialMediaLogin.js","sourceRoot":"","sources":["../../../src/components/common/SocialMediaLogin.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,uBAAuB,CAAC;AAClD,OAAO,EAAE,GAAG,EAAE,MAAM,oBAAoB,CAAC;AACzC,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAU5C,MAAM,CAAC,IAAM,gBA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AM,EAAC,GAAG,EAAC,CAAC,EAAC,GAAG,EAAC,CAAC,EAAC,GAAG,EAAC,IAAI,EAAC,SAAS,GAAG,EACxD,eAAM,KAAK,EAAC,GAAG,EAAC,MAAM,EAAC,GAAG,EAAC,CAAC,EAAC,IAAI,EAAC,CAAC,EAAC,GAAG,EAAC,IAAI,EAAC,SAAS,GAAG,EACzD,eAAM,KAAK,EAAC,GAAG,EAAC,MAAM,EAAC,GAAG,EAAC,CAAC,EAAC,GAAG,EAAC,CAAC,EAAC,IAAI,EAAC,IAAI,EAAC,SAAS,GAAG,EACzD,eAAM,KAAK,EAAC,GAAG,EAAC,MAAM,EAAC,GAAG,EAAC,CAAC,EAAC,IAAI,EAAC,CAAC,EAAC,IAAI,EAAC,IAAI,EAAC,SAAS,GAAG,IACxD,GACA,GACM,CACb,IACG,GACF,CACP,CAAC;AACJ,CAAC,CAAC","sourcesContent":["import { useRouter } from \"../../hooks/useRouter\";\nimport { env } from \"../../adapters/env\";\nimport { SolidButton } from \"../shad-cn-ui\";\n\ntype SocialMediaLoginProps = {\n googleEnabled?: boolean;\n facebookEnabled?: boolean;\n appleEnabled?: boolean;\n microsoftEnabled?: boolean;\n microsoftActiveDirectoryEnabled?: boolean;\n};\n\nexport const SocialMediaLogin = ({\n googleEnabled = false,\n facebookEnabled = false,\n appleEnabled = false,\n microsoftEnabled = false,\n microsoftActiveDirectoryEnabled = false,\n}: SocialMediaLoginProps) => {\n const router = useRouter();\n\n const backendApiUrl = (\n env(\"NEXT_PUBLIC_BACKEND_API_URL\") || env(\"API_URL\")\n ).replace(/\\/+$/, \"\");\n const getOAuthConnectUrl = (provider: string) =>\n `${backendApiUrl}/api/iam/${provider}/connect`;\n\n return (\n <div className=\"mt-4\">\n <div className=\"solid-auth-social-grid\">\n {appleEnabled && (\n <SolidButton\n type=\"button\"\n variant=\"outline\"\n className=\"solid-auth-social-btn\"\n tabIndex={-1}\n onClick={() => router.push(getOAuthConnectUrl(\"apple\"))}\n aria-label=\"Login with Apple\"\n title=\"Login with Apple\"\n >\n <svg\n viewBox=\"0 0 24 24\"\n width=\"18\"\n height=\"18\"\n fill=\"currentColor\"\n aria-hidden=\"true\"\n >\n <path d=\"M12.152 6.896c-.948 0-2.415-1.078-3.96-1.04-2.04.027-3.91 1.183-4.961 3.014-2.117 3.675-.546 9.103 1.519 12.09 1.013 1.454 2.208 3.09 3.792 3.039 1.52-.065 2.09-.987 3.935-.987 1.831 0 2.35.987 3.96.948 1.637-.026 2.676-1.48 3.676-2.948 1.156-1.688 1.636-3.325 1.662-3.415-.039-.013-3.182-1.221-3.22-4.857-.026-3.04 2.48-4.494 2.597-4.559-1.429-2.09-3.623-2.324-4.39-2.376-2-.156-3.675 1.09-4.61 1.09zM15.53 3.83c.843-1.012 1.4-2.427 1.245-3.83-1.207.052-2.662.805-3.532 1.818-.78.896-1.454 2.338-1.273 3.714 1.338.104 2.715-.688 3.559-1.701\" />\n </svg>\n </SolidButton>\n )}\n\n {googleEnabled && (\n <SolidButton\n type=\"button\"\n variant=\"outline\"\n className=\"solid-auth-social-btn\"\n tabIndex={-1}\n onClick={() => router.push(getOAuthConnectUrl(\"google\"))}\n aria-label=\"Login with Google\"\n title=\"Login with Google\"\n >\n <svg\n viewBox=\"0 0 24 24\"\n width=\"18\"\n height=\"18\"\n fill=\"none\"\n aria-hidden=\"true\"\n >\n <path\n d=\"M21.8 12.23c0-.74-.07-1.45-.2-2.13H12v4.03h5.5a4.7 4.7 0 0 1-2.04 3.08v2.55h3.3c1.93-1.78 3.04-4.4 3.04-7.53z\"\n fill=\"#4285F4\"\n />\n <path\n d=\"M12 22c2.75 0 5.05-.91 6.73-2.47l-3.3-2.55c-.92.62-2.1.99-3.43.99-2.64 0-4.88-1.78-5.68-4.18H2.9v2.63A10 10 0 0 0 12 22z\"\n fill=\"#34A853\"\n />\n <path\n d=\"M6.32 13.79a6 6 0 0 1 0-3.58V7.58H2.9a10 10 0 0 0 0 8.84l3.42-2.63z\"\n fill=\"#FBBC05\"\n />\n <path\n d=\"M12 6.02c1.49 0 2.82.51 3.87 1.5l2.9-2.9C17.04 2.98 14.74 2 12 2A10 10 0 0 0 2.9 7.58l3.42 2.63c.8-2.4 3.04-4.19 5.68-4.19z\"\n fill=\"#EA4335\"\n />\n </svg>\n </SolidButton>\n )}\n\n {facebookEnabled && (\n <SolidButton\n type=\"button\"\n variant=\"outline\"\n className=\"solid-auth-social-btn\"\n tabIndex={-1}\n onClick={() => router.push(getOAuthConnectUrl(\"facebook\"))}\n aria-label=\"Login with Meta\"\n title=\"Login with Meta\"\n >\n <svg\n viewBox=\"0 0 24 24\"\n width=\"18\"\n height=\"18\"\n fill=\"none\"\n aria-hidden=\"true\"\n >\n <path\n d=\"M5.4 15.6c0-3.14 1.62-7.09 3.76-7.09 1.43 0 2.56 1.72 2.84 2.25.28-.53 1.41-2.25 2.84-2.25 2.14 0 3.76 3.95 3.76 7.09 0 1.79-.63 2.89-1.82 2.89-2.12 0-3.75-3.02-4.78-4.82-1.03 1.8-2.66 4.82-4.78 4.82-1.19 0-1.82-1.1-1.82-2.89z\"\n stroke=\"currentColor\"\n strokeWidth=\"1.8\"\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n />\n </svg>\n </SolidButton>\n )}\n\n {microsoftEnabled && (\n <SolidButton\n type=\"button\"\n variant=\"outline\"\n className=\"solid-auth-social-btn\"\n tabIndex={-1}\n onClick={() => router.push(getOAuthConnectUrl(\"microsoft\"))}\n aria-label=\"Login with Microsoft\"\n title=\"Login with Microsoft\"\n >\n <svg viewBox=\"0 0 24 24\" width=\"18\" height=\"18\" aria-hidden=\"true\">\n <g transform=\"translate(2, 2)\">\n <rect width=\"9\" height=\"9\" x=\"0\" y=\"0\" fill=\"#f25022\" />\n <rect width=\"9\" height=\"9\" x=\"11\" y=\"0\" fill=\"#7fba00\" />\n <rect width=\"9\" height=\"9\" x=\"0\" y=\"11\" fill=\"#00a4ef\" />\n <rect width=\"9\" height=\"9\" x=\"11\" y=\"11\" fill=\"#ffb900\" />\n </g>\n </svg>\n </SolidButton>\n )}\n\n {microsoftActiveDirectoryEnabled && (\n <SolidButton\n type=\"button\"\n variant=\"outline\"\n className=\"solid-auth-social-btn\"\n tabIndex={-1}\n onClick={() => router.push(getOAuthConnectUrl(\"microsoft-active-directory\"))}\n aria-label=\"Login with Microsoft Active Directory\"\n title=\"Login with Microsoft Active Directory\"\n >\n <svg viewBox=\"0 0 24 24\" width=\"18\" height=\"18\" aria-hidden=\"true\">\n <g transform=\"translate(2, 2)\">\n <rect width=\"9\" height=\"9\" x=\"0\" y=\"0\" fill=\"#f25022\" />\n <rect width=\"9\" height=\"9\" x=\"11\" y=\"0\" fill=\"#7fba00\" />\n <rect width=\"9\" height=\"9\" x=\"0\" y=\"11\" fill=\"#00a4ef\" />\n <rect width=\"9\" height=\"9\" x=\"11\" y=\"11\" fill=\"#ffb900\" />\n </g>\n </svg>\n </SolidButton>\n )}\n </div>\n </div>\n );\n};\n"]}
@@ -7,6 +7,7 @@ type SocialMediaLoginProps = {
7
7
  facebookEnabled?: boolean;
8
8
  appleEnabled?: boolean;
9
9
  microsoftEnabled?: boolean;
10
+ microsoftActiveDirectoryEnabled?: boolean;
10
11
  };
11
12
 
12
13
  export const SocialMediaLogin = ({
@@ -14,13 +15,15 @@ export const SocialMediaLogin = ({
14
15
  facebookEnabled = false,
15
16
  appleEnabled = false,
16
17
  microsoftEnabled = false,
18
+ microsoftActiveDirectoryEnabled = false,
17
19
  }: SocialMediaLoginProps) => {
18
20
  const router = useRouter();
19
21
 
20
- const googleApiConnectRedirectUrl = `${env("NEXT_PUBLIC_BACKEND_API_URL")}/api/iam/google/connect`;
21
- const facebookApiConnectRedirectUrl = `${env("NEXT_PUBLIC_BACKEND_API_URL")}/api/iam/facebook/connect`;
22
- const appleApiConnectRedirectUrl = `${env("NEXT_PUBLIC_BACKEND_API_URL")}/api/iam/apple/connect`;
23
- const microsoftApiConnectRedirectUrl = `${env("NEXT_PUBLIC_BACKEND_API_URL")}/api/iam/microsoft/connect`;
22
+ const backendApiUrl = (
23
+ env("NEXT_PUBLIC_BACKEND_API_URL") || env("API_URL")
24
+ ).replace(/\/+$/, "");
25
+ const getOAuthConnectUrl = (provider: string) =>
26
+ `${backendApiUrl}/api/iam/${provider}/connect`;
24
27
 
25
28
  return (
26
29
  <div className="mt-4">
@@ -31,8 +34,9 @@ export const SocialMediaLogin = ({
31
34
  variant="outline"
32
35
  className="solid-auth-social-btn"
33
36
  tabIndex={-1}
34
- onClick={() => router.push(appleApiConnectRedirectUrl)}
37
+ onClick={() => router.push(getOAuthConnectUrl("apple"))}
35
38
  aria-label="Login with Apple"
39
+ title="Login with Apple"
36
40
  >
37
41
  <svg
38
42
  viewBox="0 0 24 24"
@@ -52,8 +56,9 @@ export const SocialMediaLogin = ({
52
56
  variant="outline"
53
57
  className="solid-auth-social-btn"
54
58
  tabIndex={-1}
55
- onClick={() => router.push(googleApiConnectRedirectUrl)}
59
+ onClick={() => router.push(getOAuthConnectUrl("google"))}
56
60
  aria-label="Login with Google"
61
+ title="Login with Google"
57
62
  >
58
63
  <svg
59
64
  viewBox="0 0 24 24"
@@ -88,8 +93,9 @@ export const SocialMediaLogin = ({
88
93
  variant="outline"
89
94
  className="solid-auth-social-btn"
90
95
  tabIndex={-1}
91
- onClick={() => router.push(facebookApiConnectRedirectUrl)}
96
+ onClick={() => router.push(getOAuthConnectUrl("facebook"))}
92
97
  aria-label="Login with Meta"
98
+ title="Login with Meta"
93
99
  >
94
100
  <svg
95
101
  viewBox="0 0 24 24"
@@ -115,8 +121,30 @@ export const SocialMediaLogin = ({
115
121
  variant="outline"
116
122
  className="solid-auth-social-btn"
117
123
  tabIndex={-1}
118
- onClick={() => router.push(microsoftApiConnectRedirectUrl)}
124
+ onClick={() => router.push(getOAuthConnectUrl("microsoft"))}
119
125
  aria-label="Login with Microsoft"
126
+ title="Login with Microsoft"
127
+ >
128
+ <svg viewBox="0 0 24 24" width="18" height="18" aria-hidden="true">
129
+ <g transform="translate(2, 2)">
130
+ <rect width="9" height="9" x="0" y="0" fill="#f25022" />
131
+ <rect width="9" height="9" x="11" y="0" fill="#7fba00" />
132
+ <rect width="9" height="9" x="0" y="11" fill="#00a4ef" />
133
+ <rect width="9" height="9" x="11" y="11" fill="#ffb900" />
134
+ </g>
135
+ </svg>
136
+ </SolidButton>
137
+ )}
138
+
139
+ {microsoftActiveDirectoryEnabled && (
140
+ <SolidButton
141
+ type="button"
142
+ variant="outline"
143
+ className="solid-auth-social-btn"
144
+ tabIndex={-1}
145
+ onClick={() => router.push(getOAuthConnectUrl("microsoft-active-directory"))}
146
+ aria-label="Login with Microsoft Active Directory"
147
+ title="Login with Microsoft Active Directory"
120
148
  >
121
149
  <svg viewBox="0 0 24 24" width="18" height="18" aria-hidden="true">
122
150
  <g transform="translate(2, 2)">
@@ -0,0 +1,10 @@
1
+ import type { ReactNode } from "react";
2
+ type SolidLoadingStateProps = {
3
+ title?: string;
4
+ description?: string;
5
+ spinnerLabel?: string;
6
+ children?: ReactNode;
7
+ };
8
+ export declare function SolidLoadingState({ title, description, spinnerLabel, children, }: SolidLoadingStateProps): import("react/jsx-runtime").JSX.Element;
9
+ export {};
10
+ //# sourceMappingURL=SolidLoadingState.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"SolidLoadingState.d.ts","sourceRoot":"","sources":["../../../src/components/common/SolidLoadingState.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAIvC,KAAK,sBAAsB,GAAG;IAC5B,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,EAAE,SAAS,CAAC;CACtB,CAAC;AAEF,wBAAgB,iBAAiB,CAAC,EAChC,KAAiB,EACjB,WAA4D,EAC5D,YAAY,EACZ,QAAQ,GACT,EAAE,sBAAsB,2CAWxB"}
@@ -0,0 +1,8 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import { SolidSpinner } from "../shad-cn-ui";
3
+ import styles from "./SolidLoadingState.module.css";
4
+ export function SolidLoadingState(_a) {
5
+ var _b = _a.title, title = _b === void 0 ? "Loading" : _b, _c = _a.description, description = _c === void 0 ? "Please wait while we prepare things for you." : _c, spinnerLabel = _a.spinnerLabel, children = _a.children;
6
+ return (_jsx("section", { className: styles.solidLoadingState, "aria-busy": "true", "aria-live": "polite", children: _jsxs("div", { className: styles.card, children: [_jsx(SolidSpinner, { size: 28, className: styles.spinner, label: spinnerLabel }), _jsx("h2", { className: styles.title, children: title }), _jsx("p", { className: styles.description, children: description }), children] }) }));
7
+ }
8
+ //# sourceMappingURL=SolidLoadingState.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"SolidLoadingState.js","sourceRoot":"","sources":["../../../src/components/common/SolidLoadingState.tsx"],"names":[],"mappings":";AACA,OAAO,EAAE,YAAY,EAAE,MAAM,eAAe,CAAC;AAC7C,OAAO,MAAM,MAAM,gCAAgC,CAAC;AASpD,MAAM,UAAU,iBAAiB,CAAC,EAKT;QAJvB,aAAiB,EAAjB,KAAK,mBAAG,SAAS,KAAA,EACjB,mBAA4D,EAA5D,WAAW,mBAAG,8CAA8C,KAAA,EAC5D,YAAY,kBAAA,EACZ,QAAQ,cAAA;IAER,OAAO,CACL,kBAAS,SAAS,EAAE,MAAM,CAAC,iBAAiB,eAAY,MAAM,eAAW,QAAQ,YAC/E,eAAK,SAAS,EAAE,MAAM,CAAC,IAAI,aACzB,KAAC,YAAY,IAAC,IAAI,EAAE,EAAE,EAAE,SAAS,EAAE,MAAM,CAAC,OAAO,EAAE,KAAK,EAAE,YAAY,GAAI,EAC1E,aAAI,SAAS,EAAE,MAAM,CAAC,KAAK,YAAG,KAAK,GAAM,EACzC,YAAG,SAAS,EAAE,MAAM,CAAC,WAAW,YAAG,WAAW,GAAK,EAClD,QAAQ,IACL,GACE,CACX,CAAC;AACJ,CAAC","sourcesContent":["import type { ReactNode } from \"react\";\nimport { SolidSpinner } from \"../shad-cn-ui\";\nimport styles from \"./SolidLoadingState.module.css\";\n\ntype SolidLoadingStateProps = {\n title?: string;\n description?: string;\n spinnerLabel?: string;\n children?: ReactNode;\n};\n\nexport function SolidLoadingState({\n title = \"Loading\",\n description = \"Please wait while we prepare things for you.\",\n spinnerLabel,\n children,\n}: SolidLoadingStateProps) {\n return (\n <section className={styles.solidLoadingState} aria-busy=\"true\" aria-live=\"polite\">\n <div className={styles.card}>\n <SolidSpinner size={28} className={styles.spinner} label={spinnerLabel} />\n <h2 className={styles.title}>{title}</h2>\n <p className={styles.description}>{description}</p>\n {children}\n </div>\n </section>\n );\n}\n"]}
@@ -0,0 +1,56 @@
1
+ .solidLoadingState {
2
+ min-height: 100vh;
3
+ width: 100%;
4
+ display: flex;
5
+ align-items: center;
6
+ justify-content: center;
7
+ padding: 2rem 1.5rem;
8
+ background:
9
+ radial-gradient(circle at top, color-mix(in srgb, var(--primary-color) 10%, transparent), transparent 38%),
10
+ var(--background);
11
+ }
12
+
13
+ .card {
14
+ width: min(100%, 28rem);
15
+ display: flex;
16
+ flex-direction: column;
17
+ align-items: center;
18
+ gap: 0.875rem;
19
+ text-align: center;
20
+ padding: 2rem 1.5rem;
21
+ border: 1px solid color-mix(in srgb, var(--border) 84%, white 16%);
22
+ border-radius: 1rem;
23
+ background: color-mix(in srgb, var(--card) 94%, white 6%);
24
+ box-shadow: 0 18px 40px -28px rgba(15, 23, 42, 0.35);
25
+ }
26
+
27
+ .spinner {
28
+ color: var(--primary-color);
29
+ }
30
+
31
+ .title {
32
+ margin: 0;
33
+ font-size: 1rem;
34
+ font-weight: 600;
35
+ line-height: 1.4;
36
+ color: var(--foreground);
37
+ }
38
+
39
+ .description {
40
+ margin: 0;
41
+ max-width: 24rem;
42
+ font-size: 0.875rem;
43
+ line-height: 1.6;
44
+ color: var(--muted-foreground);
45
+ }
46
+
47
+ @media (max-width: 640px) {
48
+ .solidLoadingState {
49
+ padding: 1.25rem;
50
+ }
51
+
52
+ .card {
53
+ padding: 1.5rem 1.25rem;
54
+ border-radius: 0.875rem;
55
+ }
56
+ }
@@ -0,0 +1,28 @@
1
+ import type { ReactNode } from "react";
2
+ import { SolidSpinner } from "../shad-cn-ui";
3
+ import styles from "./SolidLoadingState.module.css";
4
+
5
+ type SolidLoadingStateProps = {
6
+ title?: string;
7
+ description?: string;
8
+ spinnerLabel?: string;
9
+ children?: ReactNode;
10
+ };
11
+
12
+ export function SolidLoadingState({
13
+ title = "Loading",
14
+ description = "Please wait while we prepare things for you.",
15
+ spinnerLabel,
16
+ children,
17
+ }: SolidLoadingStateProps) {
18
+ return (
19
+ <section className={styles.solidLoadingState} aria-busy="true" aria-live="polite">
20
+ <div className={styles.card}>
21
+ <SolidSpinner size={28} className={styles.spinner} label={spinnerLabel} />
22
+ <h2 className={styles.title}>{title}</h2>
23
+ <p className={styles.description}>{description}</p>
24
+ {children}
25
+ </div>
26
+ </section>
27
+ );
28
+ }
@@ -0,0 +1,195 @@
1
+ .solid-json-editor-host {
2
+ min-height: 30rem;
3
+ flex: 1 1 auto;
4
+ }
5
+
6
+ .solid-json-editor-host.sdix-json-editor {
7
+ min-height: 0;
8
+ height: 100%;
9
+ }
10
+
11
+ .solid-json-editor .jsoneditor {
12
+ border: none;
13
+ }
14
+
15
+ .solid-json-editor.sdix-json-editor .jsoneditor,
16
+ .solid-json-editor.sdix-json-editor div.jsoneditor-outer,
17
+ .solid-json-editor.sdix-json-editor .ace-jsoneditor {
18
+ height: 100% !important;
19
+ }
20
+
21
+ .solid-json-editor .jsoneditor-menu {
22
+ background:
23
+ linear-gradient(
24
+ 180deg,
25
+ color-mix(in srgb, var(--primary-color, #4f46e5) 88%, #1f2937 12%),
26
+ color-mix(in srgb, var(--primary-color, #4f46e5) 76%, #111827 24%)
27
+ );
28
+ border-bottom: 1px solid color-mix(in srgb, var(--border) 82%, transparent);
29
+ }
30
+
31
+ .solid-json-editor .jsoneditor-menu > button,
32
+ .solid-json-editor .jsoneditor-menu > .jsoneditor-modes > button,
33
+ .solid-json-editor .jsoneditor-menu a {
34
+ color: rgba(255, 255, 255, 0.95);
35
+ opacity: 0.95;
36
+ }
37
+
38
+ .solid-json-editor .jsoneditor-menu > button:hover,
39
+ .solid-json-editor .jsoneditor-menu > .jsoneditor-modes > button:hover {
40
+ background-color: rgba(255, 255, 255, 0.14);
41
+ border-color: rgba(255, 255, 255, 0.24);
42
+ }
43
+
44
+ .solid-json-editor .jsoneditor-menu > button:focus,
45
+ .solid-json-editor .jsoneditor-menu > button:active,
46
+ .solid-json-editor .jsoneditor-menu > .jsoneditor-modes > button:focus,
47
+ .solid-json-editor .jsoneditor-menu > .jsoneditor-modes > button:active {
48
+ background-color: rgba(255, 255, 255, 0.2);
49
+ }
50
+
51
+ .solid-json-editor .jsoneditor-menu > button:disabled,
52
+ .solid-json-editor .jsoneditor-menu > .jsoneditor-modes > button:disabled {
53
+ opacity: 0.6;
54
+ }
55
+
56
+ .solid-json-editor .ace_tooltip {
57
+ max-width: 13rem;
58
+ width: max-content;
59
+ min-width: 0;
60
+ padding: 0.35rem 0.55rem;
61
+ border-radius: 0.65rem;
62
+ border: 1px solid color-mix(in srgb, var(--border) 82%, transparent);
63
+ background: color-mix(in srgb, var(--surface-card, #ffffff) 96%, #111827 4%);
64
+ box-shadow: 0 14px 30px rgba(15, 23, 42, 0.14);
65
+ color: var(--foreground);
66
+ font-size: 0.76rem;
67
+ line-height: 1.35;
68
+ white-space: normal;
69
+ overflow: hidden;
70
+ }
71
+
72
+ .solid-json-editor .ace_tooltip.ace_dark {
73
+ background: color-mix(in srgb, #111827 92%, var(--primary-color, #4f46e5) 8%);
74
+ border-color: color-mix(in srgb, var(--primary-color, #4f46e5) 26%, transparent);
75
+ color: #f8fafc;
76
+ }
77
+
78
+ .solid-json-editor .jsoneditor-navigation-bar {
79
+ border-bottom: 1px solid color-mix(in srgb, var(--border) 76%, transparent);
80
+ }
81
+
82
+ .solid-json-editor .jsoneditor-contextmenu .jsoneditor-menu {
83
+ width: 15rem;
84
+ background: var(--surface-card, #ffffff);
85
+ border: 1px solid color-mix(in srgb, var(--border) 84%, transparent);
86
+ border-radius: 0.9rem;
87
+ box-shadow: 0 18px 40px rgba(15, 23, 42, 0.16);
88
+ padding: 0.35rem;
89
+ overflow: hidden;
90
+ }
91
+
92
+ .solid-json-editor .jsoneditor-contextmenu .jsoneditor-menu button {
93
+ width: 100%;
94
+ min-height: 2rem;
95
+ color: var(--foreground);
96
+ border-radius: 0.65rem;
97
+ font-family: inherit;
98
+ font-size: 0.86rem;
99
+ }
100
+
101
+ .solid-json-editor .jsoneditor-contextmenu .jsoneditor-menu button.jsoneditor-default {
102
+ width: calc(100% - 2rem);
103
+ }
104
+
105
+ .solid-json-editor .jsoneditor-contextmenu .jsoneditor-menu button.jsoneditor-expand {
106
+ width: 2rem;
107
+ height: 2rem;
108
+ border-left: 1px solid color-mix(in srgb, var(--border) 72%, transparent);
109
+ }
110
+
111
+ .solid-json-editor .jsoneditor-contextmenu .jsoneditor-menu button:hover,
112
+ .solid-json-editor .jsoneditor-contextmenu .jsoneditor-menu button:focus {
113
+ color: var(--foreground);
114
+ background: color-mix(in srgb, var(--primary-color, #4f46e5) 10%, #ffffff 90%);
115
+ outline: none;
116
+ }
117
+
118
+ .solid-json-editor .jsoneditor-contextmenu .jsoneditor-menu li button.jsoneditor-selected,
119
+ .solid-json-editor .jsoneditor-contextmenu .jsoneditor-menu li button.jsoneditor-selected:hover,
120
+ .solid-json-editor .jsoneditor-contextmenu .jsoneditor-menu li button.jsoneditor-selected:focus {
121
+ color: #ffffff;
122
+ background: color-mix(in srgb, var(--primary-color, #4f46e5) 82%, #1f2937 18%);
123
+ }
124
+
125
+ .solid-json-editor .jsoneditor-contextmenu .jsoneditor-menu li ul {
126
+ left: 0;
127
+ margin-top: 0.2rem;
128
+ border: 1px solid color-mix(in srgb, var(--border) 72%, transparent);
129
+ border-radius: 0.75rem;
130
+ box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.28);
131
+ background: color-mix(in srgb, var(--surface-ground, #f8fafc) 94%, #ffffff 6%);
132
+ }
133
+
134
+ .solid-json-editor .jsoneditor-contextmenu .jsoneditor-menu li ul li button {
135
+ padding-left: 1.8rem;
136
+ }
137
+
138
+ .solid-json-editor .jsoneditor-contextmenu .jsoneditor-text {
139
+ padding-top: 0.4rem;
140
+ padding-bottom: 0.4rem;
141
+ }
142
+
143
+ .solid-json-editor .jsoneditor-contextmenu .jsoneditor-separator {
144
+ border-top-color: color-mix(in srgb, var(--border) 72%, transparent);
145
+ margin-top: 0.35rem;
146
+ padding-top: 0.35rem;
147
+ }
148
+
149
+ .solid-json-editor .jsoneditor-contextmenu .jsoneditor-text,
150
+ .solid-json-editor .jsoneditor-contextmenu .jsoneditor-text.jsoneditor-right-margin {
151
+ color: inherit;
152
+ }
153
+
154
+ .solid-json-editor .jsoneditor-contextmenu .jsoneditor-expand {
155
+ opacity: 0.8;
156
+ }
157
+
158
+ .solid-json-editor div.jsoneditor-tree,
159
+ .solid-json-editor textarea.jsoneditor-text,
160
+ .solid-json-editor .ace-jsoneditor {
161
+ min-height: 28rem;
162
+ }
163
+
164
+ .solid-json-editor textarea.jsoneditor-text,
165
+ .solid-json-editor .ace-jsoneditor,
166
+ .solid-json-editor .ace-jsoneditor .ace_text-layer,
167
+ .solid-json-editor .ace-jsoneditor .ace_line {
168
+ font-size: 12px;
169
+ }
170
+
171
+ .solid-json-editor textarea.jsoneditor-text,
172
+ .solid-json-editor .ace-jsoneditor,
173
+ .solid-json-editor .ace-jsoneditor .ace_gutter,
174
+ .solid-json-editor .ace-jsoneditor .ace_scroller,
175
+ .solid-json-editor .ace-jsoneditor .ace_content,
176
+ .solid-json-editor .ace-jsoneditor .ace_text-layer,
177
+ .solid-json-editor .ace-jsoneditor .ace_line,
178
+ .solid-json-editor .ace-jsoneditor .ace_gutter-layer {
179
+ font-family: ui-monospace, SFMono-Regular, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace !important;
180
+ font-size: 12px !important;
181
+ line-height: 1.5 !important;
182
+ }
183
+
184
+ .solid-json-editor .ace-jsoneditor .ace_line,
185
+ .solid-json-editor .ace-jsoneditor .ace_gutter-cell {
186
+ line-height: 1.5 !important;
187
+ }
188
+
189
+ .solid-json-editor .ace-jsoneditor .ace_cursor {
190
+ border-left-width: 1px !important;
191
+ }
192
+
193
+ .solid-json-editor.is-readonly .ace-jsoneditor .ace_cursor {
194
+ opacity: 0.45;
195
+ }
@@ -0,0 +1,19 @@
1
+ /// <reference types="react" />
2
+ import "jsoneditor/dist/jsoneditor.css";
3
+ import "./SolidJsonEditor.css";
4
+ export type SolidJsonEditorHandle = {
5
+ format: () => void;
6
+ getText: () => string;
7
+ };
8
+ type SolidJsonEditorProps = {
9
+ value: any;
10
+ resetToken: string;
11
+ readOnly?: boolean;
12
+ className?: string;
13
+ onValueChange?: (value: any) => void;
14
+ onTextChange?: (text: string) => void;
15
+ onErrorChange?: (message: string | null) => void;
16
+ };
17
+ export declare const SolidJsonEditor: import("react").ForwardRefExoticComponent<SolidJsonEditorProps & import("react").RefAttributes<SolidJsonEditorHandle>>;
18
+ export {};
19
+ //# sourceMappingURL=SolidJsonEditor.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"SolidJsonEditor.d.ts","sourceRoot":"","sources":["../../../../src/components/core/json/SolidJsonEditor.tsx"],"names":[],"mappings":";AACA,OAAO,gCAAgC,CAAC;AACxC,OAAO,uBAAuB,CAAC;AAE/B,MAAM,MAAM,qBAAqB,GAAG;IAClC,MAAM,EAAE,MAAM,IAAI,CAAC;IACnB,OAAO,EAAE,MAAM,MAAM,CAAC;CACvB,CAAC;AAEF,KAAK,oBAAoB,GAAG;IAC1B,KAAK,EAAE,GAAG,CAAC;IACX,UAAU,EAAE,MAAM,CAAC;IACnB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,aAAa,CAAC,EAAE,CAAC,KAAK,EAAE,GAAG,KAAK,IAAI,CAAC;IACrC,YAAY,CAAC,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,IAAI,CAAC;IACtC,aAAa,CAAC,EAAE,CAAC,OAAO,EAAE,MAAM,GAAG,IAAI,KAAK,IAAI,CAAC;CAClD,CAAC;AAEF,eAAO,MAAM,eAAe,wHAkI1B,CAAC"}
@@ -0,0 +1,109 @@
1
+ import { jsx as _jsx } from "react/jsx-runtime";
2
+ import { forwardRef, useEffect, useImperativeHandle, useRef } from "react";
3
+ import "jsoneditor/dist/jsoneditor.css";
4
+ import "./SolidJsonEditor.css";
5
+ export var SolidJsonEditor = forwardRef(function SolidJsonEditor(_a, ref) {
6
+ var value = _a.value, resetToken = _a.resetToken, _b = _a.readOnly, readOnly = _b === void 0 ? false : _b, _c = _a.className, className = _c === void 0 ? "" : _c, onValueChange = _a.onValueChange, onTextChange = _a.onTextChange, onErrorChange = _a.onErrorChange;
7
+ var containerRef = useRef(null);
8
+ var editorRef = useRef(null);
9
+ var latestValueRef = useRef(value);
10
+ useEffect(function () {
11
+ latestValueRef.current = value;
12
+ }, [value]);
13
+ var emitState = function () {
14
+ var _a, _b, _c, _d;
15
+ var editor = editorRef.current;
16
+ if (!editor) {
17
+ return;
18
+ }
19
+ try {
20
+ var nextValue = editor.get();
21
+ var nextText = (_b = (_a = editor.getText) === null || _a === void 0 ? void 0 : _a.call(editor)) !== null && _b !== void 0 ? _b : JSON.stringify(nextValue, null, 2);
22
+ onValueChange === null || onValueChange === void 0 ? void 0 : onValueChange(nextValue);
23
+ onTextChange === null || onTextChange === void 0 ? void 0 : onTextChange(nextText);
24
+ onErrorChange === null || onErrorChange === void 0 ? void 0 : onErrorChange(null);
25
+ }
26
+ catch (error) {
27
+ var rawText = (_d = (_c = editor.getText) === null || _c === void 0 ? void 0 : _c.call(editor)) !== null && _d !== void 0 ? _d : "";
28
+ onTextChange === null || onTextChange === void 0 ? void 0 : onTextChange(rawText);
29
+ onErrorChange === null || onErrorChange === void 0 ? void 0 : onErrorChange((error === null || error === void 0 ? void 0 : error.message) ? String(error.message) : "The JSON is currently invalid.");
30
+ }
31
+ };
32
+ useImperativeHandle(ref, function () { return ({
33
+ format: function () {
34
+ var _a, _b;
35
+ try {
36
+ (_b = (_a = editorRef.current) === null || _a === void 0 ? void 0 : _a.format) === null || _b === void 0 ? void 0 : _b.call(_a);
37
+ }
38
+ catch (_error) {
39
+ // jsoneditor already surfaces parse states through onErrorChange.
40
+ }
41
+ emitState();
42
+ },
43
+ getText: function () {
44
+ var _a, _b, _c;
45
+ return (_c = (_b = (_a = editorRef.current) === null || _a === void 0 ? void 0 : _a.getText) === null || _b === void 0 ? void 0 : _b.call(_a)) !== null && _c !== void 0 ? _c : "";
46
+ },
47
+ }); }, []);
48
+ useEffect(function () {
49
+ if (!containerRef.current || editorRef.current) {
50
+ return;
51
+ }
52
+ var destroyed = false;
53
+ void import("jsoneditor").then(function (jsonEditorModule) {
54
+ var _a, _b, _c;
55
+ if (destroyed || !containerRef.current || editorRef.current) {
56
+ return;
57
+ }
58
+ var JSONEditor = (_a = jsonEditorModule === null || jsonEditorModule === void 0 ? void 0 : jsonEditorModule.default) !== null && _a !== void 0 ? _a : jsonEditorModule;
59
+ editorRef.current = new JSONEditor(containerRef.current, {
60
+ mode: "code",
61
+ modes: ["code"],
62
+ mainMenuBar: true,
63
+ navigationBar: true,
64
+ statusBar: true,
65
+ search: true,
66
+ enableSort: false,
67
+ enableTransform: false,
68
+ onChange: function () { return emitState(); },
69
+ });
70
+ try {
71
+ editorRef.current.set(latestValueRef.current);
72
+ }
73
+ catch (_error) {
74
+ // Ignore seed failures and let jsoneditor surface them through its own state.
75
+ }
76
+ emitState();
77
+ if ((_c = (_b = editorRef.current) === null || _b === void 0 ? void 0 : _b.aceEditor) === null || _c === void 0 ? void 0 : _c.setReadOnly) {
78
+ editorRef.current.aceEditor.setReadOnly(readOnly);
79
+ }
80
+ });
81
+ return function () {
82
+ var _a, _b;
83
+ destroyed = true;
84
+ (_b = (_a = editorRef.current) === null || _a === void 0 ? void 0 : _a.destroy) === null || _b === void 0 ? void 0 : _b.call(_a);
85
+ editorRef.current = null;
86
+ };
87
+ }, []);
88
+ useEffect(function () {
89
+ if (!editorRef.current) {
90
+ return;
91
+ }
92
+ try {
93
+ editorRef.current.set(latestValueRef.current);
94
+ }
95
+ catch (_error) {
96
+ // Ignore reset parse failures and surface them via emitState instead.
97
+ }
98
+ emitState();
99
+ }, [resetToken]);
100
+ useEffect(function () {
101
+ var _a, _b;
102
+ if (!((_b = (_a = editorRef.current) === null || _a === void 0 ? void 0 : _a.aceEditor) === null || _b === void 0 ? void 0 : _b.setReadOnly)) {
103
+ return;
104
+ }
105
+ editorRef.current.aceEditor.setReadOnly(readOnly);
106
+ }, [readOnly]);
107
+ return (_jsx("div", { ref: containerRef, className: "solid-json-editor-host solid-json-editor ".concat(readOnly ? "is-readonly" : "", " ").concat(className).trim() }));
108
+ });
109
+ //# sourceMappingURL=SolidJsonEditor.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"SolidJsonEditor.js","sourceRoot":"","sources":["../../../../src/components/core/json/SolidJsonEditor.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,UAAU,EAAE,SAAS,EAAE,mBAAmB,EAAE,MAAM,EAAE,MAAM,OAAO,CAAC;AAC3E,OAAO,gCAAgC,CAAC;AACxC,OAAO,uBAAuB,CAAC;AAiB/B,MAAM,CAAC,IAAM,eAAe,GAAG,UAAU,CAA8C,SAAS,eAAe,CAC7G,EAQC,EACD,GAAG;QARD,KAAK,WAAA,EACL,UAAU,gBAAA,EACV,gBAAgB,EAAhB,QAAQ,mBAAG,KAAK,KAAA,EAChB,iBAAc,EAAd,SAAS,mBAAG,EAAE,KAAA,EACd,aAAa,mBAAA,EACb,YAAY,kBAAA,EACZ,aAAa,mBAAA;IAIf,IAAM,YAAY,GAAG,MAAM,CAAwB,IAA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AAS,CAAC,OAAO,0CAAE,SAAS,0CAAE,WAAW,EAAE;gBAC7C,SAAS,CAAC,OAAO,CAAC,SAAS,CAAC,WAAW,CAAC,QAAQ,CAAC,CAAC;aACnD;QACH,CAAC,CAAC,CAAC;QAEH,OAAO;;YACL,SAAS,GAAG,IAAI,CAAC;YACjB,MAAA,MAAA,SAAS,CAAC,OAAO,0CAAE,OAAO,kDAAI,CAAC;YAC/B,SAAS,CAAC,OAAO,GAAG,IAAI,CAAC;QAC3B,CAAC,CAAC;IACJ,CAAC,EAAE,EAAE,CAAC,CAAC;IAEP,SAAS,CAAC;QACR,IAAI,CAAC,SAAS,CAAC,OAAO,EAAE;YACtB,OAAO;SACR;QAED,IAAI;YACF,SAAS,CAAC,OAAO,CAAC,GAAG,CAAC,cAAc,CAAC,OAAO,CAAC,CAAC;SAC/C;QAAC,OAAO,MAAM,EAAE;YACf,sEAAsE;SACvE;QAED,SAAS,EAAE,CAAC;IACd,CAAC,EAAE,CAAC,UAAU,CAAC,CAAC,CAAC;IAEjB,SAAS,CAAC;;QACR,IAAI,CAAC,CAAA,MAAA,MAAA,SAAS,CAAC,OAAO,0CAAE,SAAS,0CAAE,WAAW,CAAA,EAAE;YAC9C,OAAO;SACR;QAED,SAAS,CAAC,OAAO,CAAC,SAAS,CAAC,WAAW,CAAC,QAAQ,CAAC,CAAC;IACpD,CAAC,EAAE,CAAC,QAAQ,CAAC,CAAC,CAAC;IAEf,OAAO,CACL,cACE,GAAG,EAAE,YAAY,EACjB,SAAS,EAAE,mDAA4C,QAAQ,CAAC,CAAC,CAAC,aAAa,CAAC,CAAC,CAAC,EAAE,cAAI,SAAS,CAAE,CAAC,IAAI,EAAE,GAC1G,CACH,CAAC;AACJ,CAAC,CAAC,CAAC","sourcesContent":["import { forwardRef, useEffect, useImperativeHandle, useRef } from \"react\";\nimport \"jsoneditor/dist/jsoneditor.css\";\nimport \"./SolidJsonEditor.css\";\n\nexport type SolidJsonEditorHandle = {\n format: () => void;\n getText: () => string;\n};\n\ntype SolidJsonEditorProps = {\n value: any;\n resetToken: string;\n readOnly?: boolean;\n className?: string;\n onValueChange?: (value: any) => void;\n onTextChange?: (text: string) => void;\n onErrorChange?: (message: string | null) => void;\n};\n\nexport const SolidJsonEditor = forwardRef<SolidJsonEditorHandle, SolidJsonEditorProps>(function SolidJsonEditor(\n {\n value,\n resetToken,\n readOnly = false,\n className = \"\",\n onValueChange,\n onTextChange,\n onErrorChange,\n },\n ref,\n) {\n const containerRef = useRef<HTMLDivElement | null>(null);\n const editorRef = useRef<any>(null);\n const latestValueRef = useRef<any>(value);\n\n useEffect(() => {\n latestValueRef.current = value;\n }, [value]);\n\n const emitState = () => {\n const editor = editorRef.current;\n\n if (!editor) {\n return;\n }\n\n try {\n const nextValue = editor.get();\n const nextText = editor.getText?.() ?? JSON.stringify(nextValue, null, 2);\n onValueChange?.(nextValue);\n onTextChange?.(nextText);\n onErrorChange?.(null);\n } catch (error: any) {\n const rawText = editor.getText?.() ?? \"\";\n onTextChange?.(rawText);\n onErrorChange?.(\n error?.message ? String(error.message) : \"The JSON is currently invalid.\",\n );\n }\n };\n\n useImperativeHandle(ref, () => ({\n format() {\n try {\n editorRef.current?.format?.();\n } catch (_error) {\n // jsoneditor already surfaces parse states through onErrorChange.\n }\n\n emitState();\n },\n getText() {\n return editorRef.current?.getText?.() ?? \"\";\n },\n }), []);\n\n useEffect(() => {\n if (!containerRef.current || editorRef.current) {\n return;\n }\n\n let destroyed = false;\n\n void import(\"jsoneditor\").then((jsonEditorModule: any) => {\n if (destroyed || !containerRef.current || editorRef.current) {\n return;\n }\n\n const JSONEditor = jsonEditorModule?.default ?? jsonEditorModule;\n editorRef.current = new JSONEditor(containerRef.current, {\n mode: \"code\",\n modes: [\"code\"],\n mainMenuBar: true,\n navigationBar: true,\n statusBar: true,\n search: true,\n enableSort: false,\n enableTransform: false,\n onChange: () => emitState(),\n });\n\n try {\n editorRef.current.set(latestValueRef.current);\n } catch (_error) {\n // Ignore seed failures and let jsoneditor surface them through its own state.\n }\n\n emitState();\n\n if (editorRef.current?.aceEditor?.setReadOnly) {\n editorRef.current.aceEditor.setReadOnly(readOnly);\n }\n });\n\n return () => {\n destroyed = true;\n editorRef.current?.destroy?.();\n editorRef.current = null;\n };\n }, []);\n\n useEffect(() => {\n if (!editorRef.current) {\n return;\n }\n\n try {\n editorRef.current.set(latestValueRef.current);\n } catch (_error) {\n // Ignore reset parse failures and surface them via emitState instead.\n }\n\n emitState();\n }, [resetToken]);\n\n useEffect(() => {\n if (!editorRef.current?.aceEditor?.setReadOnly) {\n return;\n }\n\n editorRef.current.aceEditor.setReadOnly(readOnly);\n }, [readOnly]);\n\n return (\n <div\n ref={containerRef}\n className={`solid-json-editor-host solid-json-editor ${readOnly ? \"is-readonly\" : \"\"} ${className}`.trim()}\n />\n );\n});\n"]}