@mongoosejs/studio 0.5.11 → 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.
@@ -2,6 +2,7 @@
2
2
 
3
3
  const api = require('../../api');
4
4
  const marked = require('marked').marked;
5
+ const xss = require('xss');
5
6
  const template = require('./chat-message.html');
6
7
 
7
8
  module.exports = app => app.component('chat-message', {
@@ -52,7 +53,10 @@ module.exports = app => app.component('chat-message', {
52
53
  },
53
54
  methods: {
54
55
  marked(text) {
55
- return marked(text);
56
+ if (text == null || text === '') {
57
+ return '';
58
+ }
59
+ return xss(marked(text));
56
60
  },
57
61
  formatToolInput(input) {
58
62
  if (!input) return '';
@@ -243,9 +243,10 @@ module.exports = {
243
243
  },
244
244
  getAgentModePreference() {
245
245
  if (typeof window === 'undefined') {
246
- return false;
246
+ return true;
247
247
  }
248
- return window.localStorage?.getItem(AGENT_MODE_STORAGE_KEY) === 'true';
248
+ const preference = window.localStorage?.getItem(AGENT_MODE_STORAGE_KEY);
249
+ return preference == null ? true : preference === 'true';
249
250
  },
250
251
  persistAgentModePreference(agentMode) {
251
252
  if (typeof window !== 'undefined') {
@@ -2,15 +2,5 @@
2
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
3
  <div v-show="isGeoJsonGeometry && mapVisible" class="mt-2 border border-edge rounded relative">
4
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
5
  </div>
16
6
  </div>