@mongoosejs/studio 0.5.12 → 0.5.13

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.
@@ -152,18 +152,7 @@
152
152
 
153
153
  <!-- Field Content -->
154
154
  <div v-if="editting && path.path !== '_id'">
155
- <!-- Use detail-default with map editing for GeoJSON geometries -->
156
155
  <component
157
- v-if="isGeoJsonGeometry"
158
- :is="getComponentForPath(path)"
159
- :value="getEditValueForPath(path)"
160
- :viewMode="detailViewMode"
161
- :on-change="handleInputChange"
162
- >
163
- </component>
164
- <!-- Use standard edit components for other types -->
165
- <component
166
- v-else
167
156
  :is="getEditComponentForPath(path)"
168
157
  :value="getEditValueForPath(path)"
169
158
  :format="dateType"
@@ -150,20 +150,6 @@ module.exports = app => app.component('document-property', {
150
150
  }
151
151
  },
152
152
  watch: {
153
- isGeoJsonGeometry(newValue) {
154
- if (!newValue) {
155
- this.detailViewMode = 'text';
156
- } else if (this.editting) {
157
- // Default to map view when editing GeoJSON
158
- this.detailViewMode = 'map';
159
- }
160
- },
161
- editting(newValue) {
162
- // When entering edit mode for GeoJSON, default to map view
163
- if (newValue && this.isGeoJsonGeometry) {
164
- this.detailViewMode = 'map';
165
- }
166
- },
167
153
  canUseArrayTableView(can) {
168
154
  if (!can && this.arrayDetailViewMode === 'table') {
169
155
  this.arrayDetailViewMode = 'list';
@@ -250,6 +236,9 @@ module.exports = app => app.component('document-property', {
250
236
  return 'detail-default';
251
237
  },
252
238
  getEditComponentForPath(path) {
239
+ if (this.isGeoJsonGeometry) {
240
+ return this.detailViewMode === 'map' ? 'edit-geojson' : 'edit-subdocument';
241
+ }
253
242
  if (path.instance === 'String') {
254
243
  return 'edit-string';
255
244
  }
@@ -275,6 +264,9 @@ module.exports = app => app.component('document-property', {
275
264
  },
276
265
  getEditComponentProps(path) {
277
266
  const props = {};
267
+ if (this.isGeoJsonGeometry) {
268
+ props.viewMode = this.detailViewMode;
269
+ }
278
270
  if (path.instance === 'String') {
279
271
  if (path.enum?.length > 0) {
280
272
  props.enumValues = path.enum;
@@ -0,0 +1,17 @@
1
+ <div class="w-full">
2
+ <pre v-if="!isGeoJsonGeometry || !mapVisible" class="w-full whitespace-pre-wrap break-words font-mono text-sm text-content-secondary m-0">{{displayValue}}</pre>
3
+ <div v-show="isGeoJsonGeometry && mapVisible" class="mt-2 border border-edge rounded relative">
4
+ <div ref="map" class="h-64 w-full" style="min-height: 256px; height: 256px;"></div>
5
+ <!-- Undo button below map -->
6
+ <div v-if="isEditable && canUndo" class="mt-2 flex justify-end">
7
+ <button
8
+ @click="undoDelete"
9
+ class="text-xs px-3 py-1.5 bg-gray-600 text-white rounded hover:bg-gray-700 transition-colors"
10
+ title="Undo all changes"
11
+ >
12
+ Undo
13
+ </button>
14
+ </div>
15
+ </div>
16
+ </div>
17
+