@abraca/dabra 2.24.0 → 2.26.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.
@@ -11043,9 +11043,14 @@ var AbracadabraClient = class {
11043
11043
  return this.request("GET", `/docs/${encodeURIComponent(docId)}/access`);
11044
11044
  }
11045
11045
  /**
11046
- * Update document metadata (label, description, kind, parent_id). Requires
11047
- * manage permission on the doc; reparenting additionally requires manage on
11048
- * the new parent (or admin if moving under the server root).
11046
+ * Update document metadata (label, description, kind, doc_type, parent_id).
11047
+ * Requires manage permission on the doc; reparenting additionally requires
11048
+ * manage on the new parent (or admin if moving under the server root).
11049
+ *
11050
+ * `doc_type` is the renderer hint (`"kanban"`, `"graph"`, …) — orthogonal
11051
+ * to `kind` (the structural role). Use it for post-create type changes;
11052
+ * never write renderer strings into `kind`. Servers older than migration
11053
+ * 0014 ignore the field (unknown JSON fields are dropped server-side).
11049
11054
  */
11050
11055
  async updateDocumentMeta(docId, opts) {
11051
11056
  await this.request("PATCH", `/docs/${encodeURIComponent(docId)}`, { body: opts });
@@ -15916,7 +15921,7 @@ function patchEntry(treeMap, id, patch, removeKeys = [], opts = {}) {
15916
15921
  //#region packages/provider/src/TreeTimestamps.ts
15917
15922
  /**
15918
15923
  * Attach an observer that writes `updatedAt` to the root doc-tree entry for
15919
- * `childDocId` whenever the child doc receives a non-offline update.
15924
+ * `childDocId` whenever the child doc receives a local edit.
15920
15925
  *
15921
15926
  * @param treeMap The root doc's "doc-tree" Y.Map.
15922
15927
  * @param childDocId The child document's UUID (key in treeMap).
@@ -15946,8 +15951,10 @@ function attachUpdatedAtObserver(treeMap, childDocId, childDoc, offlineStore, op
15946
15951
  pendingTs = 0;
15947
15952
  writeTs(ts);
15948
15953
  }
15949
- function handler(_update, origin) {
15950
- if (offlineStore !== null && origin === offlineStore) return;
15954
+ function handler(tr) {
15955
+ if (!tr.local) return;
15956
+ if (offlineStore !== null && tr.origin === offlineStore) return;
15957
+ if (tr.changed.size === 0) return;
15951
15958
  const now = Date.now();
15952
15959
  if (now - lastFlushedAt >= throttleMs) {
15953
15960
  writeTs(now);
@@ -15956,9 +15963,9 @@ function attachUpdatedAtObserver(treeMap, childDocId, childDoc, offlineStore, op
15956
15963
  pendingTs = now;
15957
15964
  if (timer === null) timer = setTimeout(flushPending, throttleMs - (now - lastFlushedAt));
15958
15965
  }
15959
- childDoc.on("update", handler);
15966
+ childDoc.on("afterTransaction", handler);
15960
15967
  return () => {
15961
- childDoc.off("update", handler);
15968
+ childDoc.off("afterTransaction", handler);
15962
15969
  if (timer !== null) {
15963
15970
  clearTimeout(timer);
15964
15971
  flushPending();