@abraca/nuxt 2.67.0 → 2.71.0

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/module.json CHANGED
@@ -4,7 +4,7 @@
4
4
  "compatibility": {
5
5
  "nuxt": ">=4.0.0"
6
6
  },
7
- "version": "2.67.0",
7
+ "version": "2.71.0",
8
8
  "builder": {
9
9
  "@nuxt/module-builder": "1.0.2",
10
10
  "unbuild": "3.6.1"
@@ -184,6 +184,13 @@ watchEffect(() => {
184
184
  fileDropStore.onFiles = effectiveEditable.value ? uploadAndInsertFiles : null;
185
185
  });
186
186
  let metaInitDone = false;
187
+ const appMetaExcludedKeys = computed(() => {
188
+ const s = /* @__PURE__ */ new Set();
189
+ for (const p of registry.getPlugins()) {
190
+ for (const k of p.metaExcludeKeys ?? []) s.add(k);
191
+ }
192
+ return s;
193
+ });
187
194
  function handleMetaUpdate(patch) {
188
195
  writeTreeMeta(patch);
189
196
  emit("updateMeta", patch);
@@ -204,6 +211,7 @@ function buildOrphanFields(meta, coveredKeys, metaFieldType) {
204
211
  const nodes = [];
205
212
  for (const [key, value] of Object.entries(meta)) {
206
213
  if (AUTO_DETECT_EXCLUDED.has(key)) continue;
214
+ if (appMetaExcludedKeys.value.has(key)) continue;
207
215
  if (coveredKeys.has(key)) continue;
208
216
  if (key.startsWith("_")) continue;
209
217
  if (value === void 0 || value === null) continue;
@@ -275,6 +283,12 @@ function deduplicateMetaFields(ed) {
275
283
  metaNode.forEach((child, childOffset) => {
276
284
  if (child.type.name !== "metaField") return;
277
285
  const a = child.attrs;
286
+ const excluded = appMetaExcludedKeys.value;
287
+ if ([a.metaKey, a.startKey, a.latKey].some((k) => k && excluded.has(String(k)))) {
288
+ const from = metaPos + 1 + childOffset;
289
+ deletions.push({ from, to: from + child.nodeSize });
290
+ return;
291
+ }
278
292
  if (a.metaKey && !a.allDayKey && ownedAllDayKeys.has(String(a.metaKey))) {
279
293
  const from = metaPos + 1 + childOffset;
280
294
  deletions.push({ from, to: from + child.nodeSize });
@@ -202,10 +202,14 @@ export const AUTO_DETECT_EXCLUDED = /* @__PURE__ */ new Set([
202
202
  "spatialGridVisible",
203
203
  "mediaRepeat",
204
204
  "mediaShuffle",
205
- // Cover (managed by gallery / cover UI)
205
+ // Cover / icon media (managed by gallery, cover and icon UI)
206
206
  "coverUploadId",
207
207
  "coverDocId",
208
208
  "coverMimeType",
209
+ "coverUrl",
210
+ "iconUploadId",
211
+ "iconMimeType",
212
+ "iconUrl",
209
213
  // Geo (managed by map renderer)
210
214
  "geoType",
211
215
  "geoLat",
@@ -523,6 +523,7 @@ function removeOption(opt) {
523
523
  class="meta-field-chip"
524
524
  contenteditable="false"
525
525
  :data-field-type="fieldType"
526
+ :data-meta-key="metaKey || startKey || latKey || void 0"
526
527
  :class="{ 'meta-field-chip--dragging': isDragging }"
527
528
  @mouseenter="isHovered = true"
528
529
  @mouseleave="isHovered = false"
@@ -21,6 +21,14 @@ import type { AbraPlugin, AbraAwarenessContribution as BaseAbraAwarenessContribu
21
21
  export interface AbracadabraPlugin extends AbraPlugin {
22
22
  /** Document/page type renderers keyed by type slug */
23
23
  pageTypes?: Record<string, AbracadabraPageType>;
24
+ /**
25
+ * App-internal tree-meta keys that must never surface as meta-field chips
26
+ * (renderer bookkeeping: draft flags, plain-text mirrors, upload manifests…).
27
+ * Two effects in `AEditor`: orphan auto-detection skips these keys, and any
28
+ * chip already persisted for one of them is removed when the doc opens
29
+ * (self-healing docs written before the key was excluded).
30
+ */
31
+ metaExcludeKeys?: string[];
24
32
  /** Extra toolbar item groups appended after the built-in toolbar groups */
25
33
  toolbarItems?(ctx: EditorPluginCtx): AbracadabraToolbarItem[][];
26
34
  /** Extra bubble menu item groups (appear on text selection) */
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@abraca/nuxt",
3
- "version": "2.67.0",
3
+ "version": "2.71.0",
4
4
  "description": "First-class Nuxt module for the Abracadabra CRDT collaboration platform",
5
5
  "repository": "abracadabra/abracadabra-nuxt",
6
6
  "license": "MIT",
@@ -30,6 +30,7 @@
30
30
  "@vueuse/core": "^14.3.0",
31
31
  "defu": "^6.1.7",
32
32
  "exifr": "^7.1.3",
33
+ "music-metadata": "^11.14.0",
33
34
  "nanoevents": "^9.1.0"
34
35
  },
35
36
  "peerDependencies": {