@mongoosejs/studio 0.1.20 → 0.2.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/backend/actions/ChatMessage/executeScript.js +4 -1
- package/backend/actions/ChatThread/createChatMessage.js +28 -22
- package/backend/helpers/evaluateFilter.js +38 -1
- package/express.js +4 -2
- package/frontend/public/app.js +702 -428
- package/frontend/public/index.html +3 -3
- package/frontend/public/style.css +1 -1
- package/frontend/public/tw.css +81 -62
- package/frontend/src/_util/document-search-autocomplete.js +229 -0
- package/frontend/src/chat/chat-message-script/chat-message-script.html +27 -20
- package/frontend/src/chat/chat.html +20 -17
- package/frontend/src/chat/chat.js +2 -0
- package/frontend/src/document/document.css +1 -8
- package/frontend/src/document/document.html +202 -164
- package/frontend/src/document/document.js +1 -0
- package/frontend/src/document-details/document-details.html +1 -11
- package/frontend/src/document-details/document-details.js +43 -1
- package/frontend/src/document-details/document-property/document-property.html +4 -4
- package/frontend/src/index.js +36 -15
- package/frontend/src/json-node/json-node.html +118 -0
- package/frontend/src/json-node/json-node.js +272 -0
- package/frontend/src/list-array/list-array.html +15 -3
- package/frontend/src/list-array/list-array.js +21 -3
- package/frontend/src/list-default/list-default.js +2 -2
- package/frontend/src/list-json/list-json.html +1 -1
- package/frontend/src/list-json/list-json.js +11 -273
- package/frontend/src/list-subdocument/list-subdocument.html +13 -4
- package/frontend/src/list-subdocument/list-subdocument.js +11 -6
- package/frontend/src/models/document-search/document-search.html +1 -1
- package/frontend/src/models/document-search/document-search.js +22 -116
- package/frontend/src/models/models.css +5 -15
- package/frontend/src/models/models.html +34 -34
- package/frontend/src/navbar/navbar.html +15 -6
- package/package.json +2 -2
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
</div>
|
|
5
5
|
<aside class="bg-white border-r overflow-y-auto overflow-x-hidden h-full transition-all duration-300 ease-in-out z-20 w-0 lg:w-48 fixed lg:relative shrink-0" :class="hideSidebar === true ? '!w-0' : hideSidebar === false ? '!w-48' : ''">
|
|
6
6
|
<div class="flex items-center border-b border-gray-100 w-48 overflow-x-hidden">
|
|
7
|
-
<div class="p-
|
|
7
|
+
<div class="p-1 ml-2 font-bold">Models</div>
|
|
8
8
|
<button
|
|
9
9
|
@click="hideSidebar = true"
|
|
10
10
|
class="ml-auto mr-2 p-2 rounded hover:bg-gray-200 focus:outline-none"
|
|
@@ -14,14 +14,14 @@
|
|
|
14
14
|
</button>
|
|
15
15
|
</div>
|
|
16
16
|
<nav class="flex flex-1 flex-col">
|
|
17
|
-
<ul role="list" class="flex flex-1 flex-col gap-y-7">
|
|
17
|
+
<ul role="list" class="flex flex-1 flex-col gap-y-7 p-1">
|
|
18
18
|
<li>
|
|
19
19
|
<ul role="list">
|
|
20
20
|
<li v-for="model in models">
|
|
21
21
|
<router-link
|
|
22
22
|
:to="'/model/' + model"
|
|
23
|
-
class="block truncate rounded-md py-2 pr-2 pl-2 text-sm
|
|
24
|
-
:class="model === currentModel ? 'bg-ultramarine-100 font-bold' : 'hover:bg-ultramarine-
|
|
23
|
+
class="block truncate rounded-md py-2 pr-2 pl-2 text-sm text-gray-700"
|
|
24
|
+
:class="model === currentModel ? 'bg-ultramarine-100 font-bold text-gray-900' : 'hover:bg-ultramarine-50'">
|
|
25
25
|
{{model}}
|
|
26
26
|
</router-link>
|
|
27
27
|
</li>
|
|
@@ -33,9 +33,9 @@
|
|
|
33
33
|
</div>
|
|
34
34
|
</nav>
|
|
35
35
|
</aside>
|
|
36
|
-
<div class="documents" ref="documentsList">
|
|
36
|
+
<div class="documents bg-slate-50" ref="documentsList">
|
|
37
37
|
<div class="relative h-[42px] z-10">
|
|
38
|
-
<div class="documents-menu">
|
|
38
|
+
<div class="documents-menu bg-slate-50">
|
|
39
39
|
<div class="flex flex-row items-center w-full gap-2">
|
|
40
40
|
<document-search
|
|
41
41
|
ref="documentSearch"
|
|
@@ -48,13 +48,6 @@
|
|
|
48
48
|
<span v-if="numDocuments == null">Loading ...</span>
|
|
49
49
|
<span v-else-if="typeof numDocuments === 'number'">{{numDocuments === 1 ? numDocuments+ ' document' : numDocuments + ' documents'}}</span>
|
|
50
50
|
</div>
|
|
51
|
-
<button
|
|
52
|
-
@click="shouldShowExportModal = true"
|
|
53
|
-
type="button"
|
|
54
|
-
v-show="!selectMultiple"
|
|
55
|
-
class="rounded bg-ultramarine-600 px-2 py-2 text-sm font-semibold text-white shadow-sm hover:bg-ultramarine-500 focus-visible:outline focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-ultramarine-600">
|
|
56
|
-
Export
|
|
57
|
-
</button>
|
|
58
51
|
<button
|
|
59
52
|
@click="stagingSelect"
|
|
60
53
|
type="button"
|
|
@@ -79,20 +72,6 @@
|
|
|
79
72
|
>
|
|
80
73
|
Delete
|
|
81
74
|
</button>
|
|
82
|
-
<button
|
|
83
|
-
@click="shouldShowCreateModal = true;"
|
|
84
|
-
type="button"
|
|
85
|
-
v-show="!selectMultiple"
|
|
86
|
-
class="rounded bg-ultramarine-600 px-2 py-2 text-sm font-semibold text-white shadow-sm hover:bg-ultramarine-500 focus-visible:outline focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-ultramarine-600">
|
|
87
|
-
Create
|
|
88
|
-
</button>
|
|
89
|
-
<button
|
|
90
|
-
@click="openFieldSelection"
|
|
91
|
-
type="button"
|
|
92
|
-
v-show="!selectMultiple"
|
|
93
|
-
class="rounded bg-ultramarine-600 px-2 py-2 text-sm font-semibold text-white shadow-sm hover:bg-ultramarine-500 focus-visible:outline focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-ultramarine-600">
|
|
94
|
-
Fields
|
|
95
|
-
</button>
|
|
96
75
|
<div class="relative" v-show="!selectMultiple" ref="actionsMenuContainer" @keyup.esc.prevent="closeActionsMenu">
|
|
97
76
|
<button
|
|
98
77
|
@click="toggleActionsMenu"
|
|
@@ -108,6 +87,27 @@
|
|
|
108
87
|
class="absolute right-0 mt-2 w-48 origin-top-right rounded-md bg-white shadow-lg ring-1 ring-black ring-opacity-5 focus:outline-none z-20"
|
|
109
88
|
>
|
|
110
89
|
<div class="py-1">
|
|
90
|
+
<button
|
|
91
|
+
@click="shouldShowExportModal = true; showActionsMenu = false"
|
|
92
|
+
type="button"
|
|
93
|
+
class="block w-full px-4 py-2 text-left text-sm text-gray-700 hover:bg-gray-100"
|
|
94
|
+
>
|
|
95
|
+
Export
|
|
96
|
+
</button>
|
|
97
|
+
<button
|
|
98
|
+
@click="shouldShowCreateModal = true; showActionsMenu = false"
|
|
99
|
+
type="button"
|
|
100
|
+
class="block w-full px-4 py-2 text-left text-sm text-gray-700 hover:bg-gray-100"
|
|
101
|
+
>
|
|
102
|
+
Create
|
|
103
|
+
</button>
|
|
104
|
+
<button
|
|
105
|
+
@click="openFieldSelection(); showActionsMenu = false"
|
|
106
|
+
type="button"
|
|
107
|
+
class="block w-full px-4 py-2 text-left text-sm text-gray-700 hover:bg-gray-100"
|
|
108
|
+
>
|
|
109
|
+
Projection
|
|
110
|
+
</button>
|
|
111
111
|
<button
|
|
112
112
|
@click="openIndexModal"
|
|
113
113
|
type="button"
|
|
@@ -159,8 +159,8 @@
|
|
|
159
159
|
</div>
|
|
160
160
|
</div>
|
|
161
161
|
<table v-else-if="outputType === 'table'">
|
|
162
|
-
<thead>
|
|
163
|
-
<th v-for="path in filteredPaths" @click="addPathFilter(path.path)" class="cursor-pointer">
|
|
162
|
+
<thead class="bg-slate-50">
|
|
163
|
+
<th v-for="path in filteredPaths" @click="addPathFilter(path.path)" class="cursor-pointer p-3">
|
|
164
164
|
{{path.path}}
|
|
165
165
|
<span class="path-type">
|
|
166
166
|
({{(path.instance || 'unknown')}})
|
|
@@ -170,8 +170,8 @@
|
|
|
170
170
|
</th>
|
|
171
171
|
</thead>
|
|
172
172
|
<tbody>
|
|
173
|
-
<tr v-for="document in documents" @click="handleDocumentClick(document, $event)" :key="document._id">
|
|
174
|
-
<td v-for="schemaPath in filteredPaths" :class="{ 'bg-blue-200': selectedDocuments.some(x => x._id.toString() === document._id.toString()) }">
|
|
173
|
+
<tr v-for="document in documents" @click="handleDocumentClick(document, $event)" :key="document._id" class="bg-white hover:bg-slate-50">
|
|
174
|
+
<td v-for="schemaPath in filteredPaths" class="p-3 cursor-pointer" :class="{ 'bg-blue-200': selectedDocuments.some(x => x._id.toString() === document._id.toString()) }">
|
|
175
175
|
<component
|
|
176
176
|
:is="getComponentForPath(schemaPath)"
|
|
177
177
|
:value="getValueForPath(document, schemaPath.path)"
|
|
@@ -181,14 +181,14 @@
|
|
|
181
181
|
</tr>
|
|
182
182
|
</tbody>
|
|
183
183
|
</table>
|
|
184
|
-
<div v-else-if="outputType === 'json'" class="flex flex-col space-y-
|
|
184
|
+
<div v-else-if="outputType === 'json'" class="flex flex-col space-y-2 p-1 mt-1">
|
|
185
185
|
<div
|
|
186
186
|
v-for="document in documents"
|
|
187
187
|
:key="document._id"
|
|
188
188
|
@click="handleDocumentContainerClick(document, $event)"
|
|
189
189
|
:class="[
|
|
190
|
-
'group relative transition-colors',
|
|
191
|
-
selectedDocuments.some(x => x._id.toString() === document._id.toString()) ? 'bg-blue-200' : 'hover:
|
|
190
|
+
'group relative transition-colors rounded-md border border-slate-100',
|
|
191
|
+
selectedDocuments.some(x => x._id.toString() === document._id.toString()) ? 'bg-blue-200' : 'hover:shadow-sm hover:border-slate-300 bg-white'
|
|
192
192
|
]"
|
|
193
193
|
>
|
|
194
194
|
<button
|
|
@@ -1,10 +1,19 @@
|
|
|
1
|
-
<div class="navbar w-full bg-
|
|
2
|
-
<div class="flex items-center gap-4 h-full pl-4">
|
|
1
|
+
<div class="navbar w-full bg-white flex justify-between border-b border-gray-200 !h-[55px]">
|
|
2
|
+
<div class="flex items-center gap-4 md:gap-6 h-full pl-4">
|
|
3
3
|
<router-link :to="{ name: defaultRoute }">
|
|
4
|
-
<img src="images/logo.svg" class="h-
|
|
4
|
+
<img src="images/logo.svg" class="h-10 mr-1" alt="Mongoose Studio Logo" />
|
|
5
5
|
</router-link>
|
|
6
|
-
<div
|
|
7
|
-
|
|
6
|
+
<div
|
|
7
|
+
v-if="!!state.nodeEnv"
|
|
8
|
+
title="NODE_ENV"
|
|
9
|
+
class="inline-flex items-center rounded px-2 py-1 text-xs text-gray-500 bg-white border border-gray-200 gap-2"
|
|
10
|
+
>
|
|
11
|
+
<span
|
|
12
|
+
:class="warnEnv ? 'bg-red-400' : 'bg-yellow-400'"
|
|
13
|
+
class="inline-block rounded-full"
|
|
14
|
+
style="width: 0.5em; height: 0.5em;"
|
|
15
|
+
></span>
|
|
16
|
+
<span>{{state.nodeEnv}}</span>
|
|
8
17
|
</div>
|
|
9
18
|
</div>
|
|
10
19
|
<div class="h-full pr-4 hidden md:block">
|
|
@@ -93,7 +102,7 @@
|
|
|
93
102
|
<!-- Mobile menu mask -->
|
|
94
103
|
<div id="mobile-menu-mask" class="fixed inset-0 bg-black bg-opacity-40 z-40 hidden"></div>
|
|
95
104
|
<!-- Mobile menu drawer -->
|
|
96
|
-
<div id="mobile-menu" class="fixed inset-0 bg-white shadow-lg
|
|
105
|
+
<div id="mobile-menu" style="z-index: 1000" class="fixed inset-0 bg-white shadow-lg transform translate-x-full transition-transform duration-200 ease-in-out flex flex-col">
|
|
97
106
|
<div class="flex items-center justify-between px-4 !h-[55px] border-b border-gray-200">
|
|
98
107
|
<router-link :to="{ name: defaultRoute }">
|
|
99
108
|
<img src="images/logo.svg" class="h-[32px]" alt="Mongoose Studio Logo" />
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mongoosejs/studio",
|
|
3
|
-
"version": "0.1
|
|
4
|
-
"description": "A
|
|
3
|
+
"version": "0.2.1",
|
|
4
|
+
"description": "A Mongoose-native MongoDB UI with schema-aware autocomplete, AI-assisted queries, and dashboards that understand your models - not just your data.",
|
|
5
5
|
"homepage": "https://mongoosestudio.app/",
|
|
6
6
|
"repository": {
|
|
7
7
|
"type": "git",
|