@solidxai/core-ui 0.1.12-beta.0 → 0.1.12-beta.2
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/dist/components/auth/AuthLayout.d.ts.map +1 -1
- package/dist/components/auth/AuthLayout.js +15 -19
- package/dist/components/auth/AuthLayout.js.map +1 -1
- package/dist/components/auth/AuthLayout.tsx +26 -20
- package/dist/components/auth/SolidLogin.d.ts.map +1 -1
- package/dist/components/auth/SolidLogin.js +6 -3
- package/dist/components/auth/SolidLogin.js.map +1 -1
- package/dist/components/auth/SolidLogin.tsx +16 -2
- package/dist/components/auth/SolidRegister.d.ts.map +1 -1
- package/dist/components/auth/SolidRegister.js +7 -4
- package/dist/components/auth/SolidRegister.js.map +1 -1
- package/dist/components/auth/SolidRegister.tsx +16 -2
- package/dist/components/common/BackButton.js +1 -1
- package/dist/components/common/BackButton.js.map +1 -1
- package/dist/components/common/BackButton.tsx +1 -1
- package/dist/components/common/CancelButton.js +1 -1
- package/dist/components/common/CancelButton.js.map +1 -1
- package/dist/components/common/CancelButton.tsx +1 -1
- package/dist/components/common/GeneralSettings.d.ts.map +1 -1
- package/dist/components/common/GeneralSettings.js +6 -33
- package/dist/components/common/GeneralSettings.js.map +1 -1
- package/dist/components/common/GeneralSettings.tsx +20 -57
- package/dist/components/common/SettingsComponent.d.ts.map +1 -1
- package/dist/components/common/SettingsComponent.js +1 -9
- package/dist/components/common/SettingsComponent.js.map +1 -1
- package/dist/components/common/SettingsComponent.tsx +1 -8
- package/dist/components/common/SolidBreadcrumb.js +1 -1
- package/dist/components/common/SolidBreadcrumb.js.map +1 -1
- package/dist/components/common/SolidBreadcrumb.tsx +2 -2
- package/dist/components/common/SolidFaviconProvider.d.ts.map +1 -1
- package/dist/components/common/SolidFaviconProvider.js +1 -8
- package/dist/components/common/SolidFaviconProvider.js.map +1 -1
- package/dist/components/common/SolidFaviconProvider.tsx +1 -7
- package/dist/components/common/SolidLoadingState.d.ts +10 -0
- package/dist/components/common/SolidLoadingState.d.ts.map +1 -0
- package/dist/components/common/SolidLoadingState.js +8 -0
- package/dist/components/common/SolidLoadingState.js.map +1 -0
- package/dist/components/common/SolidLoadingState.module.css +56 -0
- package/dist/components/common/SolidLoadingState.tsx +28 -0
- package/dist/components/core/card/CardItem.d.ts.map +1 -1
- package/dist/components/core/card/CardItem.js +3 -4
- package/dist/components/core/card/CardItem.js.map +1 -1
- package/dist/components/core/card/CardItem.tsx +3 -4
- package/dist/components/core/card/SolidCardView.d.ts.map +1 -1
- package/dist/components/core/card/SolidCardView.js +6 -1
- package/dist/components/core/card/SolidCardView.js.map +1 -1
- package/dist/components/core/card/SolidCardView.tsx +6 -1
- package/dist/components/core/card/SolidCardViewConfigure.d.ts.map +1 -1
- package/dist/components/core/card/SolidCardViewConfigure.js +4 -1
- package/dist/components/core/card/SolidCardViewConfigure.js.map +1 -1
- package/dist/components/core/card/SolidCardViewConfigure.tsx +4 -1
- package/dist/components/core/common/SolidCreateButton.d.ts.map +1 -1
- package/dist/components/core/common/SolidCreateButton.js +2 -13
- package/dist/components/core/common/SolidCreateButton.js.map +1 -1
- package/dist/components/core/common/SolidCreateButton.tsx +2 -15
- package/dist/components/core/common/SolidGlobalSearchElement.d.ts.map +1 -1
- package/dist/components/core/common/SolidGlobalSearchElement.js +34 -15
- package/dist/components/core/common/SolidGlobalSearchElement.js.map +1 -1
- package/dist/components/core/common/SolidGlobalSearchElement.tsx +37 -17
- package/dist/components/core/extension/solid-core/modelMetadata/list/GenerateModelCodeRowAction.js +15 -13
- package/dist/components/core/extension/solid-core/modelMetadata/list/GenerateModelCodeRowAction.js.map +1 -1
- package/dist/components/core/extension/solid-core/modelMetadata/list/GenerateModelCodeRowAction.tsx +4 -4
- package/dist/components/core/extension/solid-core/moduleMetadata/list/GenerateModuleCodeRowAction.js +6 -5
- package/dist/components/core/extension/solid-core/moduleMetadata/list/GenerateModuleCodeRowAction.js.map +1 -1
- package/dist/components/core/extension/solid-core/moduleMetadata/list/GenerateModuleCodeRowAction.tsx +1 -1
- package/dist/components/core/form/SolidFormFooter.d.ts +2 -1
- package/dist/components/core/form/SolidFormFooter.d.ts.map +1 -1
- package/dist/components/core/form/SolidFormFooter.js +48 -14
- package/dist/components/core/form/SolidFormFooter.js.map +1 -1
- package/dist/components/core/form/SolidFormFooter.tsx +50 -4
- package/dist/components/core/form/SolidFormView.d.ts.map +1 -1
- package/dist/components/core/form/SolidFormView.js +52 -50
- package/dist/components/core/form/SolidFormView.js.map +1 -1
- package/dist/components/core/form/SolidFormView.tsx +16 -9
- package/dist/components/core/json/SolidJsonEditor.css +195 -0
- package/dist/components/core/json/SolidJsonEditor.d.ts +19 -0
- package/dist/components/core/json/SolidJsonEditor.d.ts.map +1 -0
- package/dist/components/core/json/SolidJsonEditor.js +109 -0
- package/dist/components/core/json/SolidJsonEditor.js.map +1 -0
- package/dist/components/core/json/SolidJsonEditor.tsx +150 -0
- package/dist/components/core/kanban/KanbanCard.d.ts.map +1 -1
- package/dist/components/core/kanban/KanbanCard.js +2 -10
- package/dist/components/core/kanban/KanbanCard.js.map +1 -1
- package/dist/components/core/kanban/KanbanCard.tsx +2 -10
- package/dist/components/core/kanban/SolidKanbanView.d.ts.map +1 -1
- package/dist/components/core/kanban/SolidKanbanView.js +11 -4
- package/dist/components/core/kanban/SolidKanbanView.js.map +1 -1
- package/dist/components/core/kanban/SolidKanbanView.tsx +13 -5
- package/dist/components/core/list/SolidListView.d.ts +2 -0
- package/dist/components/core/list/SolidListView.d.ts.map +1 -1
- package/dist/components/core/list/SolidListView.js +195 -111
- package/dist/components/core/list/SolidListView.js.map +1 -1
- package/dist/components/core/list/SolidListView.tsx +136 -39
- package/dist/components/core/list/SolidListViewConfigure.d.ts.map +1 -1
- package/dist/components/core/list/SolidListViewConfigure.js +2 -0
- package/dist/components/core/list/SolidListViewConfigure.js.map +1 -1
- package/dist/components/core/list/SolidListViewConfigure.tsx +2 -0
- package/dist/components/core/list/columns/relations/SolidRelationManyToOneColumn.d.ts.map +1 -1
- package/dist/components/core/list/columns/relations/SolidRelationManyToOneColumn.js +16 -19
- package/dist/components/core/list/columns/relations/SolidRelationManyToOneColumn.js.map +1 -1
- package/dist/components/core/list/columns/relations/SolidRelationManyToOneColumn.tsx +16 -22
- package/dist/components/core/locales/SolidChatterLocaleTabView.d.ts.map +1 -1
- package/dist/components/core/locales/SolidChatterLocaleTabView.js +9 -8
- package/dist/components/core/locales/SolidChatterLocaleTabView.js.map +1 -1
- package/dist/components/core/locales/SolidChatterLocaleTabView.tsx +4 -1
- package/dist/components/core/locales/SolidLocale.d.ts.map +1 -1
- package/dist/components/core/locales/SolidLocale.js +1 -2
- package/dist/components/core/locales/SolidLocale.js.map +1 -1
- package/dist/components/core/locales/SolidLocale.tsx +1 -2
- package/dist/components/core/model/CreateModel.d.ts.map +1 -1
- package/dist/components/core/model/CreateModel.js +1 -1
- package/dist/components/core/model/CreateModel.js.map +1 -1
- package/dist/components/core/model/CreateModel.tsx +0 -1
- package/dist/components/core/model/ModelMetaData.d.ts.map +1 -1
- package/dist/components/core/model/ModelMetaData.js +1 -2
- package/dist/components/core/model/ModelMetaData.js.map +1 -1
- package/dist/components/core/model/ModelMetaData.tsx +1 -3
- package/dist/components/core/module/CreateModule.css +70 -2
- package/dist/components/core/module/CreateModule.d.ts.map +1 -1
- package/dist/components/core/module/CreateModule.js +2 -2
- package/dist/components/core/module/CreateModule.js.map +1 -1
- package/dist/components/core/module/CreateModule.tsx +13 -1
- package/dist/components/core/tree/SolidTreeView.d.ts.map +1 -1
- package/dist/components/core/tree/SolidTreeView.js +47 -26
- package/dist/components/core/tree/SolidTreeView.js.map +1 -1
- package/dist/components/core/tree/SolidTreeView.tsx +55 -23
- package/dist/components/layout/AdminTopHeader.js +2 -3
- package/dist/components/layout/AdminTopHeader.js.map +1 -1
- package/dist/components/layout/AdminTopHeader.tsx +2 -2
- package/dist/components/layout/AppSidebar.d.ts.map +1 -1
- package/dist/components/layout/AppSidebar.js +5 -2
- package/dist/components/layout/AppSidebar.js.map +1 -1
- package/dist/components/layout/AppSidebar.tsx +7 -4
- package/dist/components/layout/navbar-two-menu.d.ts.map +1 -1
- package/dist/components/layout/navbar-two-menu.js +6 -4
- package/dist/components/layout/navbar-two-menu.js.map +1 -1
- package/dist/components/layout/navbar-two-menu.tsx +4 -2
- package/dist/components/shad-cn-ui/SolidTabs.d.ts.map +1 -1
- package/dist/components/shad-cn-ui/SolidTabs.js +1 -1
- package/dist/components/shad-cn-ui/SolidTabs.js.map +1 -1
- package/dist/components/shad-cn-ui/SolidTabs.tsx +1 -0
- package/dist/constants/error-messages.d.ts +1 -0
- package/dist/constants/error-messages.d.ts.map +1 -1
- package/dist/constants/error-messages.js +1 -0
- package/dist/constants/error-messages.js.map +1 -1
- package/dist/constants/error-messages.ts +1 -0
- package/dist/helpers/assetUrl.d.ts +3 -0
- package/dist/helpers/assetUrl.d.ts.map +1 -0
- package/dist/helpers/assetUrl.js +22 -0
- package/dist/helpers/assetUrl.js.map +1 -0
- package/dist/helpers/assetUrl.ts +26 -0
- package/dist/helpers/modelViewPersistence.d.ts +5 -0
- package/dist/helpers/modelViewPersistence.d.ts.map +1 -0
- package/dist/helpers/modelViewPersistence.js +168 -0
- package/dist/helpers/modelViewPersistence.js.map +1 -0
- package/dist/helpers/modelViewPersistence.ts +201 -0
- package/dist/helpers/routePaths.d.ts +6 -0
- package/dist/helpers/routePaths.d.ts.map +1 -1
- package/dist/helpers/routePaths.js +13 -0
- package/dist/helpers/routePaths.js.map +1 -1
- package/dist/helpers/routePaths.ts +25 -0
- package/dist/index.d.ts +3 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +3 -0
- package/dist/index.js.map +1 -1
- package/dist/index.ts +14 -0
- package/dist/redux/api/datasourceIntrospectionApi.d.ts +203 -0
- package/dist/redux/api/datasourceIntrospectionApi.d.ts.map +1 -0
- package/dist/redux/api/datasourceIntrospectionApi.js +71 -0
- package/dist/redux/api/datasourceIntrospectionApi.js.map +1 -0
- package/dist/redux/api/datasourceIntrospectionApi.ts +261 -0
- package/dist/redux/api/datasourceManagementApi.d.ts +46 -0
- package/dist/redux/api/datasourceManagementApi.d.ts.map +1 -0
- package/dist/redux/api/datasourceManagementApi.js +35 -0
- package/dist/redux/api/datasourceManagementApi.js.map +1 -0
- package/dist/redux/api/datasourceManagementApi.ts +86 -0
- package/dist/redux/api/solidServiceApi.d.ts +10 -2
- package/dist/redux/api/solidServiceApi.d.ts.map +1 -1
- package/dist/redux/api/solidServiceApi.js +2 -4
- package/dist/redux/api/solidServiceApi.js.map +1 -1
- package/dist/redux/api/solidServiceApi.ts +4 -6
- package/dist/redux/store/StoreProvider.d.ts.map +1 -1
- package/dist/redux/store/StoreProvider.js +4 -2
- package/dist/redux/store/StoreProvider.js.map +1 -1
- package/dist/redux/store/StoreProvider.tsx +9 -1
- package/dist/redux/store/defaultStoreConfig.d.ts +28 -1
- package/dist/redux/store/defaultStoreConfig.d.ts.map +1 -1
- package/dist/redux/store/defaultStoreConfig.js +4 -0
- package/dist/redux/store/defaultStoreConfig.js.map +1 -1
- package/dist/redux/store/defaultStoreConfig.ts +4 -0
- package/dist/resources/solid-custom.css +73 -16
- package/dist/routes/guards/AdminGuard.d.ts.map +1 -1
- package/dist/routes/guards/AdminGuard.js +2 -1
- package/dist/routes/guards/AdminGuard.js.map +1 -1
- package/dist/routes/guards/AdminGuard.tsx +7 -1
- package/dist/routes/guards/AuthGuard.d.ts.map +1 -1
- package/dist/routes/guards/AuthGuard.js +2 -1
- package/dist/routes/guards/AuthGuard.js.map +1 -1
- package/dist/routes/guards/AuthGuard.tsx +8 -2
- package/dist/routes/guards/GuestGuard.d.ts.map +1 -1
- package/dist/routes/guards/GuestGuard.js +2 -1
- package/dist/routes/guards/GuestGuard.js.map +1 -1
- package/dist/routes/guards/GuestGuard.tsx +8 -2
- package/dist/routes/pages/admin/core/CardPage.d.ts.map +1 -1
- package/dist/routes/pages/admin/core/CardPage.js +11 -0
- package/dist/routes/pages/admin/core/CardPage.js.map +1 -1
- package/dist/routes/pages/admin/core/CardPage.tsx +13 -0
- package/dist/routes/pages/admin/core/DashboardPage.d.ts.map +1 -1
- package/dist/routes/pages/admin/core/DashboardPage.js +7 -5
- package/dist/routes/pages/admin/core/DashboardPage.js.map +1 -1
- package/dist/routes/pages/admin/core/DashboardPage.module.css +18 -0
- package/dist/routes/pages/admin/core/DashboardPage.tsx +50 -32
- package/dist/routes/pages/admin/core/DatasourceIntrospectionPage.css +828 -0
- package/dist/routes/pages/admin/core/DatasourceIntrospectionPage.d.ts +3 -0
- package/dist/routes/pages/admin/core/DatasourceIntrospectionPage.d.ts.map +1 -0
- package/dist/routes/pages/admin/core/DatasourceIntrospectionPage.js +947 -0
- package/dist/routes/pages/admin/core/DatasourceIntrospectionPage.js.map +1 -0
- package/dist/routes/pages/admin/core/DatasourceIntrospectionPage.tsx +1719 -0
- package/dist/routes/pages/admin/core/DatasourcesPage.css +337 -0
- package/dist/routes/pages/admin/core/DatasourcesPage.d.ts +3 -0
- package/dist/routes/pages/admin/core/DatasourcesPage.d.ts.map +1 -0
- package/dist/routes/pages/admin/core/DatasourcesPage.js +221 -0
- package/dist/routes/pages/admin/core/DatasourcesPage.js.map +1 -0
- package/dist/routes/pages/admin/core/DatasourcesPage.tsx +540 -0
- package/dist/routes/pages/admin/core/KanbanPage.d.ts.map +1 -1
- package/dist/routes/pages/admin/core/KanbanPage.js +11 -0
- package/dist/routes/pages/admin/core/KanbanPage.js.map +1 -1
- package/dist/routes/pages/admin/core/KanbanPage.tsx +13 -0
- package/dist/routes/pages/admin/core/ListPage.d.ts.map +1 -1
- package/dist/routes/pages/admin/core/ListPage.js +25 -2
- package/dist/routes/pages/admin/core/ListPage.js.map +1 -1
- package/dist/routes/pages/admin/core/ListPage.tsx +29 -2
- package/dist/routes/pages/admin/core/TreePage.d.ts.map +1 -1
- package/dist/routes/pages/admin/core/TreePage.js +10 -2
- package/dist/routes/pages/admin/core/TreePage.js.map +1 -1
- package/dist/routes/pages/admin/core/TreePage.tsx +11 -2
- package/dist/routes/solidRoutes.d.ts.map +1 -1
- package/dist/routes/solidRoutes.js +5 -1
- package/dist/routes/solidRoutes.js.map +1 -1
- package/dist/routes/solidRoutes.tsx +4 -0
- package/package.json +1 -1
|
@@ -868,10 +868,12 @@ const SolidFormView = (params: SolidFormViewProps) => {
|
|
|
868
868
|
|
|
869
869
|
if (solidFormViewMetaData?.data?.solidView?.model?.internationalisation) {
|
|
870
870
|
setDefaultTabViewOptionIndex(0)
|
|
871
|
-
const
|
|
872
|
-
|
|
873
|
-
|
|
874
|
-
|
|
871
|
+
const applicableLocales = solidFormViewMetaData?.data?.applicableLocales || [];
|
|
872
|
+
const currentRecordLocale = applicableLocales.find((x: any) => String(x.entityId) === String(params.id));
|
|
873
|
+
const defaultLocale = applicableLocales.find((x: any) => x.isDefault === 'yes');
|
|
874
|
+
//this is to attach the current record locale when available, otherwise fall back to the default locale for create/new flows
|
|
875
|
+
if (!selectedLocale && !searchParams.get('locale')) {
|
|
876
|
+
setSelectedLocale(currentRecordLocale?.locale || defaultLocale?.locale || null);
|
|
875
877
|
}
|
|
876
878
|
}
|
|
877
879
|
|
|
@@ -1756,6 +1758,10 @@ const SolidFormView = (params: SolidFormViewProps) => {
|
|
|
1756
1758
|
setDefaultTabViewOptionIndex(2);
|
|
1757
1759
|
}
|
|
1758
1760
|
};
|
|
1761
|
+
const showChatterInfo = Boolean(
|
|
1762
|
+
solidFormViewMetaData?.data?.solidView?.model?.draftPublishWorkflow
|
|
1763
|
+
|| solidFormViewMetaData?.data?.solidView?.model?.internationalisation
|
|
1764
|
+
);
|
|
1759
1765
|
|
|
1760
1766
|
//en 4 null
|
|
1761
1767
|
const handleLocaleChangeRedirect = async (
|
|
@@ -1767,7 +1773,6 @@ const SolidFormView = (params: SolidFormViewProps) => {
|
|
|
1767
1773
|
const defaultApplicableLocales = solidFormViewMetaData?.data?.applicableLocales || [];
|
|
1768
1774
|
let matchingLocale = defaultApplicableLocales.find(
|
|
1769
1775
|
(loc: any) =>
|
|
1770
|
-
loc.defaultEntityLocaleId &&
|
|
1771
1776
|
loc.entityId &&
|
|
1772
1777
|
loc.locale === locale
|
|
1773
1778
|
);
|
|
@@ -1790,7 +1795,6 @@ const SolidFormView = (params: SolidFormViewProps) => {
|
|
|
1790
1795
|
const freshApplicableLocales = freshResponse?.data?.applicableLocales || [];
|
|
1791
1796
|
matchingLocale = freshApplicableLocales.find(
|
|
1792
1797
|
(loc: any) =>
|
|
1793
|
-
loc.defaultEntityLocaleId &&
|
|
1794
1798
|
loc.entityId &&
|
|
1795
1799
|
loc.locale === locale
|
|
1796
1800
|
);
|
|
@@ -1928,7 +1932,10 @@ const SolidFormView = (params: SolidFormViewProps) => {
|
|
|
1928
1932
|
</div>
|
|
1929
1933
|
|
|
1930
1934
|
</form>
|
|
1931
|
-
<SolidFormFooter
|
|
1935
|
+
<SolidFormFooter
|
|
1936
|
+
params={params}
|
|
1937
|
+
internationalisationEnabled={solidFormViewMetaData?.data?.solidView?.model?.internationalisation}
|
|
1938
|
+
></SolidFormFooter>
|
|
1932
1939
|
</div>
|
|
1933
1940
|
{params.embeded !== true &&
|
|
1934
1941
|
<div className={`chatter-section ${isShowChatter === false ? 'collapsed' : 'open'}`} style={{ width: chatterLocaleWidth }}>
|
|
@@ -1958,8 +1965,8 @@ const SolidFormView = (params: SolidFormViewProps) => {
|
|
|
1958
1965
|
}
|
|
1959
1966
|
{isShowChatter === false ?
|
|
1960
1967
|
<div className="flex flex-col gap-2 justify-center p-1">
|
|
1961
|
-
{/*
|
|
1962
|
-
{
|
|
1968
|
+
{/*Show the info tab when workflow info or internationalisation is enabled. */}
|
|
1969
|
+
{showChatterInfo &&
|
|
1963
1970
|
<div className="chatter-collapsed-content" onClick={() => handleChatterExpandClick('info')}>
|
|
1964
1971
|
Info
|
|
1965
1972
|
</div>}
|
|
@@ -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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S,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"]}
|
|
@@ -0,0 +1,150 @@
|
|
|
1
|
+
import { forwardRef, useEffect, useImperativeHandle, useRef } from "react";
|
|
2
|
+
import "jsoneditor/dist/jsoneditor.css";
|
|
3
|
+
import "./SolidJsonEditor.css";
|
|
4
|
+
|
|
5
|
+
export type SolidJsonEditorHandle = {
|
|
6
|
+
format: () => void;
|
|
7
|
+
getText: () => string;
|
|
8
|
+
};
|
|
9
|
+
|
|
10
|
+
type SolidJsonEditorProps = {
|
|
11
|
+
value: any;
|
|
12
|
+
resetToken: string;
|
|
13
|
+
readOnly?: boolean;
|
|
14
|
+
className?: string;
|
|
15
|
+
onValueChange?: (value: any) => void;
|
|
16
|
+
onTextChange?: (text: string) => void;
|
|
17
|
+
onErrorChange?: (message: string | null) => void;
|
|
18
|
+
};
|
|
19
|
+
|
|
20
|
+
export const SolidJsonEditor = forwardRef<SolidJsonEditorHandle, SolidJsonEditorProps>(function SolidJsonEditor(
|
|
21
|
+
{
|
|
22
|
+
value,
|
|
23
|
+
resetToken,
|
|
24
|
+
readOnly = false,
|
|
25
|
+
className = "",
|
|
26
|
+
onValueChange,
|
|
27
|
+
onTextChange,
|
|
28
|
+
onErrorChange,
|
|
29
|
+
},
|
|
30
|
+
ref,
|
|
31
|
+
) {
|
|
32
|
+
const containerRef = useRef<HTMLDivElement | null>(null);
|
|
33
|
+
const editorRef = useRef<any>(null);
|
|
34
|
+
const latestValueRef = useRef<any>(value);
|
|
35
|
+
|
|
36
|
+
useEffect(() => {
|
|
37
|
+
latestValueRef.current = value;
|
|
38
|
+
}, [value]);
|
|
39
|
+
|
|
40
|
+
const emitState = () => {
|
|
41
|
+
const editor = editorRef.current;
|
|
42
|
+
|
|
43
|
+
if (!editor) {
|
|
44
|
+
return;
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
try {
|
|
48
|
+
const nextValue = editor.get();
|
|
49
|
+
const nextText = editor.getText?.() ?? JSON.stringify(nextValue, null, 2);
|
|
50
|
+
onValueChange?.(nextValue);
|
|
51
|
+
onTextChange?.(nextText);
|
|
52
|
+
onErrorChange?.(null);
|
|
53
|
+
} catch (error: any) {
|
|
54
|
+
const rawText = editor.getText?.() ?? "";
|
|
55
|
+
onTextChange?.(rawText);
|
|
56
|
+
onErrorChange?.(
|
|
57
|
+
error?.message ? String(error.message) : "The JSON is currently invalid.",
|
|
58
|
+
);
|
|
59
|
+
}
|
|
60
|
+
};
|
|
61
|
+
|
|
62
|
+
useImperativeHandle(ref, () => ({
|
|
63
|
+
format() {
|
|
64
|
+
try {
|
|
65
|
+
editorRef.current?.format?.();
|
|
66
|
+
} catch (_error) {
|
|
67
|
+
// jsoneditor already surfaces parse states through onErrorChange.
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
emitState();
|
|
71
|
+
},
|
|
72
|
+
getText() {
|
|
73
|
+
return editorRef.current?.getText?.() ?? "";
|
|
74
|
+
},
|
|
75
|
+
}), []);
|
|
76
|
+
|
|
77
|
+
useEffect(() => {
|
|
78
|
+
if (!containerRef.current || editorRef.current) {
|
|
79
|
+
return;
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
let destroyed = false;
|
|
83
|
+
|
|
84
|
+
void import("jsoneditor").then((jsonEditorModule: any) => {
|
|
85
|
+
if (destroyed || !containerRef.current || editorRef.current) {
|
|
86
|
+
return;
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
const JSONEditor = jsonEditorModule?.default ?? jsonEditorModule;
|
|
90
|
+
editorRef.current = new JSONEditor(containerRef.current, {
|
|
91
|
+
mode: "code",
|
|
92
|
+
modes: ["code"],
|
|
93
|
+
mainMenuBar: true,
|
|
94
|
+
navigationBar: true,
|
|
95
|
+
statusBar: true,
|
|
96
|
+
search: true,
|
|
97
|
+
enableSort: false,
|
|
98
|
+
enableTransform: false,
|
|
99
|
+
onChange: () => emitState(),
|
|
100
|
+
});
|
|
101
|
+
|
|
102
|
+
try {
|
|
103
|
+
editorRef.current.set(latestValueRef.current);
|
|
104
|
+
} catch (_error) {
|
|
105
|
+
// Ignore seed failures and let jsoneditor surface them through its own state.
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
emitState();
|
|
109
|
+
|
|
110
|
+
if (editorRef.current?.aceEditor?.setReadOnly) {
|
|
111
|
+
editorRef.current.aceEditor.setReadOnly(readOnly);
|
|
112
|
+
}
|
|
113
|
+
});
|
|
114
|
+
|
|
115
|
+
return () => {
|
|
116
|
+
destroyed = true;
|
|
117
|
+
editorRef.current?.destroy?.();
|
|
118
|
+
editorRef.current = null;
|
|
119
|
+
};
|
|
120
|
+
}, []);
|
|
121
|
+
|
|
122
|
+
useEffect(() => {
|
|
123
|
+
if (!editorRef.current) {
|
|
124
|
+
return;
|
|
125
|
+
}
|
|
126
|
+
|
|
127
|
+
try {
|
|
128
|
+
editorRef.current.set(latestValueRef.current);
|
|
129
|
+
} catch (_error) {
|
|
130
|
+
// Ignore reset parse failures and surface them via emitState instead.
|
|
131
|
+
}
|
|
132
|
+
|
|
133
|
+
emitState();
|
|
134
|
+
}, [resetToken]);
|
|
135
|
+
|
|
136
|
+
useEffect(() => {
|
|
137
|
+
if (!editorRef.current?.aceEditor?.setReadOnly) {
|
|
138
|
+
return;
|
|
139
|
+
}
|
|
140
|
+
|
|
141
|
+
editorRef.current.aceEditor.setReadOnly(readOnly);
|
|
142
|
+
}, [readOnly]);
|
|
143
|
+
|
|
144
|
+
return (
|
|
145
|
+
<div
|
|
146
|
+
ref={containerRef}
|
|
147
|
+
className={`solid-json-editor-host solid-json-editor ${readOnly ? "is-readonly" : ""} ${className}`.trim()}
|
|
148
|
+
/>
|
|
149
|
+
);
|
|
150
|
+
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"KanbanCard.d.ts","sourceRoot":"","sources":["../../../../src/components/core/kanban/KanbanCard.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"KanbanCard.d.ts","sourceRoot":"","sources":["../../../../src/components/core/kanban/KanbanCard.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,MAAM,OAAO,CAAC;AAc1B,UAAU,IAAI;IACZ,EAAE,EAAE,MAAM,CAAC;IACX,KAAK,EAAE,MAAM,CAAC;IACd,OAAO,EAAE,MAAM,CAAC;CACjB;AAED,UAAU,eAAe;IACvB,IAAI,EAAE,IAAI,CAAC;IACX,uBAAuB,EAAE,GAAG,CAAC;IAC7B,KAAK,EAAE,MAAM,CAAC;IACd,cAAc,CAAC,EAAE,OAAO,CAAC;IACzB,eAAe,CAAC,EAAE,GAAG,CAAC;IACtB,eAAe,CAAC,EAAE,GAAG,CAAC;IACtB,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B,KAAK,CAAC,EAAE,GAAG,CAAC;IACZ,QAAQ,CAAC,EAAE,GAAG,CAAC;IACf,iBAAiB,CAAC,EAAE,GAAG,CAAC;IACxB,QAAQ,CAAC,EAAE,CAAC,MAAM,EAAE,IAAI,KAAK,IAAI,CAAC;CACnC;AAED,QAAA,MAAM,UAAU,EAAE,KAAK,CAAC,EAAE,CAAC,eAAe,CAoGzC,CAAC;AAEF,eAAe,UAAU,CAAC"}
|
|
@@ -12,21 +12,13 @@ var __assign = (this && this.__assign) || function () {
|
|
|
12
12
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
13
13
|
import { useRouter } from "../../../hooks/useRouter";
|
|
14
14
|
import { CompatibleDraggable } from "../common/dndCompat";
|
|
15
|
+
import { storeCurrentModelViewContext } from "../../../helpers/modelViewPersistence";
|
|
15
16
|
import { SolidDropdownMenu, SolidDropdownMenuContent, SolidDropdownMenuItem, SolidDropdownMenuTrigger, SolidIcon, } from "../../shad-cn-ui";
|
|
16
17
|
var KanbanCard = function (_a) {
|
|
17
18
|
var data = _a.data, solidKanbanViewMetaData = _a.solidKanbanViewMetaData, index = _a.index, _b = _a.isDragDisabled, isDragDisabled = _b === void 0 ? false : _b, setLightboxUrls = _a.setLightboxUrls, setOpenLightbox = _a.setOpenLightbox, editButtonUrl = _a.editButtonUrl, groupByFieldName = _a.groupByFieldName, group = _a.group, cardNode = _a.cardNode, DynamicCardWidget = _a.DynamicCardWidget, onDelete = _a.onDelete;
|
|
18
19
|
var router = useRouter();
|
|
19
20
|
var persistReturnView = function () {
|
|
20
|
-
|
|
21
|
-
return;
|
|
22
|
-
}
|
|
23
|
-
try {
|
|
24
|
-
sessionStorage.setItem("fromView", "kanban");
|
|
25
|
-
sessionStorage.setItem("fromViewUrl", window.location.pathname + window.location.search);
|
|
26
|
-
}
|
|
27
|
-
catch (error) {
|
|
28
|
-
// Ignore storage errors and continue navigation.
|
|
29
|
-
}
|
|
21
|
+
storeCurrentModelViewContext();
|
|
30
22
|
};
|
|
31
23
|
var openRecord = function () {
|
|
32
24
|
persistReturnView();
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"KanbanCard.js","sourceRoot":"","sources":["../../../../src/components/core/kanban/KanbanCard.tsx"],"names":[],"mappings":";;;;;;;;;;;;AAEA,OAAO,EAAE,SAAS,EAAE,MAAM,0BAA0B,CAAC;AAErD,OAAO,EAAE,mBAAmB,EAAE,MAAM,qBAAqB,CAAC;AAC1D,OAAO,EACL,iBAAiB,EACjB,wBAAwB,EACxB,qBAAqB,EACrB,wBAAwB,EACxB,SAAS,GACV,MAAM,kBAAkB,CAAC;AAwB1B,IAAM,UAAU,GAA8B,UAAC,EAAiL;QAA/K,IAAI,UAAA,EAAE,uBAAuB,6BAAA,EAAE,KAAK,WAAA,EAAE,sBAAsB,EAAtB,cAAc,mBAAG,KAAK,KAAA,EAAE,eAAe,qBAAA,EAAE,eAAe,qBAAA,EAAE,aAAa,mBAAA,EAAE,gBAAgB,sBAAA,EAAE,KAAK,WAAA,EAAE,QAAQ,cAAA,EAAE,iBAAiB,uBAAA,EAAE,QAAQ,cAAA;IAC5N,IAAM,MAAM,GAAG,SAAS,EAAE,CAAA;IAE1B,IAAM,iBAAiB,GAAG;QACxB,
|
|
1
|
+
{"version":3,"file":"KanbanCard.js","sourceRoot":"","sources":["../../../../src/components/core/kanban/KanbanCard.tsx"],"names":[],"mappings":";;;;;;;;;;;;AAEA,OAAO,EAAE,SAAS,EAAE,MAAM,0BAA0B,CAAC;AAErD,OAAO,EAAE,mBAAmB,EAAE,MAAM,qBAAqB,CAAC;AAC1D,OAAO,EAAE,4BAA4B,EAAE,MAAM,uCAAuC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CAAC,UAAU,CAAC,CAAC,CAAC,eAAe,CAAC,CAAC,CAAC,EAAE;wBACrD,MAAM,EAAE,cAAc,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,MAAM;qBAC5C,EACD,SAAS,EAAE,QAAQ,CAAC,UAAU,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,EACtC,SAAS,EAAC,mBAAmB,EAC7B,OAAO,EAAE,UAAU,aAElB,kBAAkB,CAAC,IAAI,CAAC,EACxB,iBAAiB,CAAC,CAAC,CAAC,CACnB,KAAC,iBAAiB,IAChB,OAAO,EAAE,IAAI,EACb,uBAAuB,EAAE,uBAAuB,EAChD,SAAS,EAAE,uBAAuB,aAAvB,uBAAuB,uBAAvB,uBAAuB,CAAE,SAAS,EAC7C,mBAAmB,EAAE,uBAAuB,aAAvB,uBAAuB,uBAAvB,uBAAuB,CAAE,mBAAmB,EACjE,IAAI,EAAE,QAAQ,EACd,WAAW,EAAE,CAAA,MAAA,MAAA,uBAAuB,aAAvB,uBAAuB,uBAAvB,uBAAuB,CAAE,SAAS,0CAAE,MAAM,0CAAE,KAAK,KAAI,EAAE,EACpE,WAAW,EAAE,IAAI,EACjB,gBAAgB,EAAE,gBAAgB,EAClC,KAAK,EAAE,KAAK,EACZ,aAAa,EAAE,aAAa,EAC5B,eAAe,EAAE,eAAe,EAChC,eAAe,EAAE,eAAe,EAChC,UAAU,EAAE,UAAU,EACtB,QAAQ,EAAE,QAAQ,GAClB,CACH,CAAC,CAAC,CAAC,IAAI,IACJ,IACF,CACP,CAAA;SAAA,GACmB,CACvB,CAAC;AACJ,CAAC,CAAC;AAEF,eAAe,UAAU,CAAC","sourcesContent":["// @ts-nocheck\nimport React from \"react\";\nimport { useRouter } from \"../../../hooks/useRouter\";\nimport { DraggableProvided } from \"@hello-pangea/dnd\";\nimport { CompatibleDraggable } from \"../common/dndCompat\";\nimport { storeCurrentModelViewContext } from \"../../../helpers/modelViewPersistence\";\nimport {\n SolidDropdownMenu,\n SolidDropdownMenuContent,\n SolidDropdownMenuItem,\n SolidDropdownMenuTrigger,\n SolidIcon,\n} from \"../../shad-cn-ui\";\n\n// Define the types for the data and props\ninterface Data {\n id: string;\n title: string;\n content: string;\n}\n\ninterface KanbanCardProps {\n data: Data;\n solidKanbanViewMetaData: any;\n index: number;\n isDragDisabled?: boolean;\n setLightboxUrls?: any;\n setOpenLightbox?: any;\n editButtonUrl?: string;\n groupByFieldName?: string;\n group?: any;\n cardNode?: any;\n DynamicCardWidget?: any;\n onDelete?: (record: Data) => void;\n}\n\nconst KanbanCard: React.FC<KanbanCardProps> = ({ data, solidKanbanViewMetaData, index, isDragDisabled = false, setLightboxUrls, setOpenLightbox, editButtonUrl, groupByFieldName, group, cardNode, DynamicCardWidget, onDelete }) => {\n const router = useRouter()\n\n const persistReturnView = () => {\n storeCurrentModelViewContext();\n };\n\n const openRecord = () => {\n persistReturnView();\n router.push(`${editButtonUrl}/${data?.id}`);\n };\n\n const openEdit = () => {\n persistReturnView();\n router.push(`${editButtonUrl}/${data?.id}`);\n };\n\n const renderKanbanAction = (data) => {\n return (\n <div className=\"solid-kanban-action\" onClick={(e) => e.stopPropagation()}>\n <SolidDropdownMenu>\n <SolidDropdownMenuTrigger asChild>\n <button\n type=\"button\"\n className=\"solid-header-cog-trigger solid-kanban-action-trigger\"\n aria-label=\"Open card actions\"\n >\n <SolidIcon name=\"si-ellipsis-v\" aria-hidden />\n </button>\n </SolidDropdownMenuTrigger>\n <SolidDropdownMenuContent className=\"solid-custom-overlay\" align=\"end\">\n <SolidDropdownMenuItem\n className=\"solid-header-dropdown-item\"\n onSelect={openEdit}\n >\n <SolidIcon name=\"si-pencil\" className=\"solid-header-action-button-icon\" aria-hidden />\n <span className=\"solid-header-action-button-label\">Edit</span>\n </SolidDropdownMenuItem>\n {onDelete ? (\n <SolidDropdownMenuItem\n className=\"solid-header-dropdown-item solid-header-dropdown-item-danger\"\n onSelect={() => onDelete(data)}\n >\n <SolidIcon name=\"si-trash\" className=\"solid-header-action-button-icon\" aria-hidden />\n <span className=\"solid-header-action-button-label\">Delete</span>\n </SolidDropdownMenuItem>\n ) : null}\n </SolidDropdownMenuContent>\n </SolidDropdownMenu>\n </div>\n )\n }\n\n return (\n <CompatibleDraggable draggableId={String(data.id)} index={index} isDragDisabled={isDragDisabled}>\n {(provided: DraggableProvided, snapshot) => (\n <div\n className=\"\"\n ref={provided.innerRef}\n {...provided.draggableProps}\n {...(!isDragDisabled ? provided.dragHandleProps : {})}\n style={{ marginTop: \"1rem\", ...provided.draggableProps.style }}\n className=\"kanban-card-container\"\n >\n {/* <p className=\"kanban-card-heading\">{data.title}</p> */}\n {/* <p className=\"kanban-card-content\">{data.content}</p> */}\n <div\n style={{\n opacity: snapshot.isDragging ? 0.9 : 1,\n transform: snapshot.isDragging ? \"rotate(-2deg)\" : \"\",\n cursor: isDragDisabled ? \"pointer\" : \"grab\"\n }}\n elevation={snapshot.isDragging ? 3 : 1}\n className=\"solid-kanban-card\"\n onClick={openRecord}\n >\n {renderKanbanAction(data)}\n {DynamicCardWidget ? (\n <DynamicCardWidget\n rowData={data}\n solidKanbanViewMetaData={solidKanbanViewMetaData}\n solidView={solidKanbanViewMetaData?.solidView}\n solidFieldsMetadata={solidKanbanViewMetaData?.solidFieldsMetadata}\n card={cardNode}\n layoutAttrs={solidKanbanViewMetaData?.solidView?.layout?.attrs || {}}\n groupedView={true}\n groupByFieldName={groupByFieldName}\n group={group}\n editButtonUrl={editButtonUrl}\n setLightboxUrls={setLightboxUrls}\n setOpenLightbox={setOpenLightbox}\n openRecord={openRecord}\n openEdit={openEdit}\n />\n ) : null}\n </div>\n </div>\n )}\n </CompatibleDraggable>\n );\n};\n\nexport default KanbanCard;\n"]}
|
|
@@ -3,6 +3,7 @@ import React from "react";
|
|
|
3
3
|
import { useRouter } from "../../../hooks/useRouter";
|
|
4
4
|
import { DraggableProvided } from "@hello-pangea/dnd";
|
|
5
5
|
import { CompatibleDraggable } from "../common/dndCompat";
|
|
6
|
+
import { storeCurrentModelViewContext } from "../../../helpers/modelViewPersistence";
|
|
6
7
|
import {
|
|
7
8
|
SolidDropdownMenu,
|
|
8
9
|
SolidDropdownMenuContent,
|
|
@@ -37,16 +38,7 @@ const KanbanCard: React.FC<KanbanCardProps> = ({ data, solidKanbanViewMetaData,
|
|
|
37
38
|
const router = useRouter()
|
|
38
39
|
|
|
39
40
|
const persistReturnView = () => {
|
|
40
|
-
|
|
41
|
-
return;
|
|
42
|
-
}
|
|
43
|
-
|
|
44
|
-
try {
|
|
45
|
-
sessionStorage.setItem("fromView", "kanban");
|
|
46
|
-
sessionStorage.setItem("fromViewUrl", window.location.pathname + window.location.search);
|
|
47
|
-
} catch (error) {
|
|
48
|
-
// Ignore storage errors and continue navigation.
|
|
49
|
-
}
|
|
41
|
+
storeCurrentModelViewContext();
|
|
50
42
|
};
|
|
51
43
|
|
|
52
44
|
const openRecord = () => {
|