@solidxai/core-ui 0.1.12-beta.0 → 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.
- 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/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/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/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/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/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/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 +23 -0
- 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 +70 -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/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/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
|
@@ -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,IAAI,CAAC,CAAC;IACzD,IAAM,SAAS,GAAG,MAAM,CAAM,IAAI,CAAC,CAAC;IACpC,IAAM,cAAc,GAAG,MAAM,CAAM,KAAK,CAAC,CAAC;IAE1C,SAAS,CAAC;QACR,cAAc,CAAC,OAAO,GAAG,KAAK,CAAC;IACjC,CAAC,EAAE,CAAC,KAAK,CAAC,CAAC,CAAC;IAEZ,IAAM,SAAS,GAAG;;QAChB,IAAM,MAAM,GAAG,SAAS,CAAC,OAAO,CAAC;QAEjC,IAAI,CAAC,MAAM,EAAE;YACX,OAAO;SACR;QAED,IAAI;YACF,IAAM,SAAS,GAAG,MAAM,CAAC,GAAG,EAAE,CAAC;YAC/B,IAAM,QAAQ,GAAG,MAAA,MAAA,MAAM,CAAC,OAAO,sDAAI,mCAAI,IAAI,CAAC,SAAS,CAAC,SAAS,EAAE,IAAI,EAAE,CAAC,CAAC,CAAC;YAC1E,aAAa,aAAb,aAAa,uBAAb,aAAa,CAAG,SAAS,CAAC,CAAC;YAC3B,YAAY,aAAZ,YAAY,uBAAZ,YAAY,CAAG,QAAQ,CAAC,CAAC;YACzB,aAAa,aAAb,aAAa,uBAAb,aAAa,CAAG,IAAI,CAAC,CAAC;SACvB;QAAC,OAAO,KAAU,EAAE;YACnB,IAAM,OAAO,GAAG,MAAA,MAAA,MAAM,CAAC,OAAO,sDAAI,mCAAI,EAAE,CAAC;YACzC,YAAY,aAAZ,YAAY,uBAAZ,YAAY,CAAG,OAAO,CAAC,CAAC;YACxB,aAAa,aAAb,aAAa,uBAAb,aAAa,CACX,CAAA,KAAK,aAAL,KAAK,uBAAL,KAAK,CAAE,OAAO,EAAC,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,gCAAgC,CAC1E,CAAC;SACH;IACH,CAAC,CAAC;IAEF,mBAAmB,CAAC,GAAG,EAAE,cAAM,OAAA,CAAC;QAC9B,MAAM;;YACJ,IAAI;gBACF,MAAA,MAAA,SAAS,CAAC,OAAO,0CAAE,MAAM,kDAAI,CAAC;aAC/B;YAAC,OAAO,MAAM,EAAE;gBACf,kEAAkE;aACnE;YAED,SAAS,EAAE,CAAC;QACd,CAAC;QACD,OAAO;;YACL,OAAO,MAAA,MAAA,MAAA,SAAS,CAAC,OAAO,0CAAE,OAAO,kDAAI,mCAAI,EAAE,CAAC;QAC9C,CAAC;KACF,CAAC,EAb6B,CAa7B,EAAE,EAAE,CAAC,CAAC;IAER,SAAS,CAAC;QACR,IAAI,CAAC,YAAY,CAAC,OAAO,IAAI,SAAS,CAAC,OAAO,EAAE;YAC9C,OAAO;SACR;QAED,IAAI,SAAS,GAAG,KAAK,CAAC;QAEtB,KAAK,MAAM,CAAC,YAAY,CAAC,CAAC,IAAI,CAAC,UAAC,gBAAqB;;YACnD,IAAI,SAAS,IAAI,CAAC,YAAY,CAAC,OAAO,IAAI,SAAS,CAAC,OAAO,EAAE;gBAC3D,OAAO;aACR;YAED,IAAM,UAAU,GAAG,MAAA,gBAAgB,aAAhB,gBAAgB,uBAAhB,gBAAgB,CAAE,OAAO,mCAAI,gBAAgB,CAAC;YACjE,SAAS,CAAC,OAAO,GAAG,IAAI,UAAU,CAAC,YAAY,CAAC,OAAO,EAAE;gBACvD,IAAI,EAAE,MAAM;gBACZ,KAAK,EAAE,CAAC,MAAM,CAAC;gBACf,WAAW,EAAE,IAAI;gBACjB,aAAa,EAAE,IAAI;gBACnB,SAAS,EAAE,IAAI;gBACf,MAAM,EAAE,IAAI;gBACZ,UAAU,EAAE,KAAK;gBACjB,eAAe,EAAE,KAAK;gBACtB,QAAQ,EAAE,cAAM,OAAA,SAAS,EAAE,EAAX,CAAW;aAC5B,CAAC,CAAC;YAEH,IAAI;gBACF,SAAS,CAAC,OAAO,CAAC,GAAG,CAAC,cAAc,CAAC,OAAO,CAAC,CAAC;aAC/C;YAAC,OAAO,MAAM,EAAE;gBACf,8EAA8E;aAC/E;YAED,SAAS,EAAE,CAAC;YAEZ,IAAI,MAAA,MAAA,SAAS,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"]}
|
|
@@ -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,7 +1,13 @@
|
|
|
1
1
|
.solid-module-form-workspace {
|
|
2
2
|
display: flex;
|
|
3
3
|
flex-direction: column;
|
|
4
|
-
gap: 0
|
|
4
|
+
gap: 0;
|
|
5
|
+
}
|
|
6
|
+
|
|
7
|
+
.solid-module-workspace-header {
|
|
8
|
+
padding: 0.55rem 0.9rem 0.2rem;
|
|
9
|
+
background: transparent;
|
|
10
|
+
border-bottom: none;
|
|
5
11
|
}
|
|
6
12
|
|
|
7
13
|
.solid-module-form-workspace .solid-module-form-tabs {
|
|
@@ -12,10 +18,16 @@
|
|
|
12
18
|
|
|
13
19
|
.solid-module-form-workspace .solid-module-form-tablist {
|
|
14
20
|
width: 100% !important;
|
|
15
|
-
padding: 0 0.
|
|
21
|
+
padding: 0 0.35rem;
|
|
16
22
|
border-bottom: 1px solid color-mix(in srgb, var(--border) 86%, transparent);
|
|
17
23
|
}
|
|
18
24
|
|
|
25
|
+
.solid-module-form-tab-extra {
|
|
26
|
+
display: inline-flex;
|
|
27
|
+
align-items: center;
|
|
28
|
+
padding-right: 0.35rem;
|
|
29
|
+
}
|
|
30
|
+
|
|
19
31
|
.solid-module-form-workspace .solid-module-form-tabpanel {
|
|
20
32
|
padding-top: 0.65rem;
|
|
21
33
|
}
|
|
@@ -31,6 +43,14 @@
|
|
|
31
43
|
padding: 0.9rem 0.95rem 0.8rem;
|
|
32
44
|
}
|
|
33
45
|
|
|
46
|
+
.solid-module-workspace-header .solid-form-toolbar-left {
|
|
47
|
+
min-height: 0;
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
.solid-module-workspace-header .solid-form-toolbar-actions {
|
|
51
|
+
flex: 0 0 auto;
|
|
52
|
+
}
|
|
53
|
+
|
|
34
54
|
.solid-module-general-info-content.is-tabbed {
|
|
35
55
|
padding: 0 0.9rem 1rem;
|
|
36
56
|
}
|
|
@@ -42,3 +62,51 @@
|
|
|
42
62
|
gap: 0.5rem;
|
|
43
63
|
margin-bottom: 0.75rem;
|
|
44
64
|
}
|
|
65
|
+
|
|
66
|
+
.solid-module-upload-card {
|
|
67
|
+
margin: 1rem 0 0;
|
|
68
|
+
padding: 0.9rem 1rem;
|
|
69
|
+
border-color: color-mix(in srgb, var(--border, #d6dae5) 90%, transparent);
|
|
70
|
+
background: color-mix(in srgb, var(--card, #ffffff) 94%, var(--background, #f8fafc) 6%);
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
.solid-module-upload-row {
|
|
74
|
+
display: flex;
|
|
75
|
+
align-items: flex-start;
|
|
76
|
+
gap: 0.8rem;
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
.solid-module-upload-copy {
|
|
80
|
+
flex: 1;
|
|
81
|
+
min-width: 0;
|
|
82
|
+
display: flex;
|
|
83
|
+
flex-direction: column;
|
|
84
|
+
gap: 0.35rem;
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
.solid-module-upload-header {
|
|
88
|
+
display: flex;
|
|
89
|
+
align-items: flex-start;
|
|
90
|
+
justify-content: space-between;
|
|
91
|
+
gap: 0.75rem;
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
.solid-module-upload-name {
|
|
95
|
+
min-width: 0;
|
|
96
|
+
line-height: 1.35;
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
.solid-module-upload-remove {
|
|
100
|
+
flex: 0 0 auto;
|
|
101
|
+
margin-top: 0.1rem;
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
.solid-module-upload-status {
|
|
105
|
+
display: flex;
|
|
106
|
+
flex-wrap: wrap;
|
|
107
|
+
align-items: center;
|
|
108
|
+
gap: 0.45rem;
|
|
109
|
+
color: color-mix(in srgb, var(--foreground, #111827) 78%, var(--muted-foreground, #6b7280));
|
|
110
|
+
font-size: 0.875rem;
|
|
111
|
+
line-height: 1.4;
|
|
112
|
+
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CreateModule.d.ts","sourceRoot":"","sources":["../../../../src/components/core/module/CreateModule.tsx"],"names":[],"mappings":"AA+BA,OAAO,oBAAoB,CAAC;AAK5B,QAAA,MAAM,YAAY,qBAAsB,GAAG,
|
|
1
|
+
{"version":3,"file":"CreateModule.d.ts","sourceRoot":"","sources":["../../../../src/components/core/module/CreateModule.tsx"],"names":[],"mappings":"AA+BA,OAAO,oBAAoB,CAAC;AAK5B,QAAA,MAAM,YAAY,qBAAsB,GAAG,4CAghB1C,CAAC;AAEF,eAAe,YAAY,CAAC"}
|