mindoodb-app-sdk 0.0.44 → 0.0.46

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/README.md CHANGED
@@ -253,7 +253,7 @@ const unbind = session.drag.bindSource(cardEl, {
253
253
  });
254
254
  ```
255
255
 
256
- `bindSource` starts after an 8px mouse/pen move, or a 400ms long-press on touch (so lists can still scroll). You can also call `session.drag.start` yourself with a PNG `ArrayBuffer` preview. v1 is **copy-only** and **iframe-only**. Well-known types: `text/plain`, `text/markdown`, `application/json`, `application/x-mindoo-document`.
256
+ `bindSource` starts after an 8px mouse/pen move, or a 400ms long-press on touch (so lists can still scroll). After start, the source frame keeps the pressed pointer (browsers do not retarget mouse-capture into Haven) and forwards `pointermove` / `pointerup` to the host. You can also call `session.drag.start` yourself with a PNG `ArrayBuffer` preview, then `reportPointer` / `release`. v1 is **copy-only** and **iframe-only**. Well-known types: `text/plain`, `text/markdown`, `application/json`, `application/x-mindoo-document`.
257
257
 
258
258
  ### Databases and capabilities
259
259
 
@@ -1602,6 +1602,8 @@ Connect options: `launchId?`, `targetOrigin?`, `connectTimeoutMs?`.
1602
1602
  | `drag.setProfile(profile)` | `Promise<void>` |
1603
1603
  | `drag.start(input)` | `Promise<MindooDBAppDragStartResult>` |
1604
1604
  | `drag.cancel()` | `Promise<void>` |
1605
+ | `drag.reportPointer({ x, y })` | `Promise<void>` |
1606
+ | `drag.release({ x, y })` | `Promise<void>` |
1605
1607
  | `drag.bindSource(el, options)` | `() => void` (unbind) |
1606
1608
  | `storage` | `MindooDBAppStorageApi` |
1607
1609
  | `onThemeChange(listener)` | `() => void` (unsubscribe) |
@@ -122,15 +122,22 @@ function normalizePreview(value) {
122
122
  hotspotY: requireFiniteNumber(candidate.hotspotY, "preview.hotspotY")
123
123
  };
124
124
  }
125
+ function normalizeDragPointerInput(value) {
126
+ if (!value || typeof value !== "object") {
127
+ throw new MindooDBAppDragInputError("A drag pointer payload is required.");
128
+ }
129
+ const candidate = value;
130
+ return {
131
+ x: requireFiniteNumber(candidate.x, "pointer.x"),
132
+ y: requireFiniteNumber(candidate.y, "pointer.y")
133
+ };
134
+ }
125
135
  function normalizeDragStartInput(value) {
126
136
  if (!value || typeof value !== "object") {
127
137
  throw new MindooDBAppDragInputError("drag.start requires a payload object.");
128
138
  }
129
139
  const candidate = value;
130
- if (!candidate.pointer || typeof candidate.pointer !== "object") {
131
- throw new MindooDBAppDragInputError("pointer is required.");
132
- }
133
- const pointer = candidate.pointer;
140
+ const pointer = normalizeDragPointerInput(candidate.pointer);
134
141
  let allowedEffects;
135
142
  if (candidate.allowedEffects !== void 0) {
136
143
  if (!Array.isArray(candidate.allowedEffects) || candidate.allowedEffects.length === 0 || candidate.allowedEffects.some((effect) => effect !== "copy")) {
@@ -141,10 +148,7 @@ function normalizeDragStartInput(value) {
141
148
  return {
142
149
  offers: normalizeOffers(candidate.offers),
143
150
  preview: normalizePreview(candidate.preview),
144
- pointer: {
145
- x: requireFiniteNumber(pointer.x, "pointer.x"),
146
- y: requireFiniteNumber(pointer.y, "pointer.y")
147
- },
151
+ pointer,
148
152
  allowedEffects
149
153
  };
150
154
  }
@@ -237,7 +241,7 @@ function readPreviewElement(source, options) {
237
241
  }
238
242
  return typeof options.preview === "function" ? options.preview() : options.preview;
239
243
  }
240
- function bindDragSource(element, options, start) {
244
+ function bindDragSource(element, options, start, follow) {
241
245
  const longPressMs = options.longPressMs ?? DEFAULT_DRAG_LONG_PRESS_MS;
242
246
  const thresholdPx = options.pointerThresholdPx ?? DEFAULT_DRAG_POINTER_THRESHOLD_PX;
243
247
  let active = null;
@@ -247,7 +251,9 @@ function bindDragSource(element, options, start) {
247
251
  }
248
252
  active = null;
249
253
  };
250
- const beginHostDrag = async (event) => {
254
+ let pendingRelease = null;
255
+ let hostListening = false;
256
+ const beginHostDrag = (event) => {
251
257
  if (!active || active.started) {
252
258
  return;
253
259
  }
@@ -262,25 +268,50 @@ function bindDragSource(element, options, start) {
262
268
  return;
263
269
  }
264
270
  event.preventDefault();
265
- const preview = await active.preview;
271
+ const pointerId = active.pointerId;
266
272
  const hotX = event.clientX - element.getBoundingClientRect().left;
267
273
  const hotY = event.clientY - element.getBoundingClientRect().top;
268
- await start({
269
- offers,
270
- preview: {
271
- ...preview,
272
- hotspotX: hotX,
273
- hotspotY: hotY
274
- },
275
- pointer: { x: event.clientX, y: event.clientY },
276
- allowedEffects: ["copy"]
277
- });
274
+ const pointer = { x: event.clientX, y: event.clientY };
275
+ void (async () => {
276
+ const preview = await active?.preview;
277
+ if (!active || active.pointerId !== pointerId || !preview) {
278
+ return;
279
+ }
280
+ const session = start({
281
+ offers,
282
+ preview: {
283
+ ...preview,
284
+ hotspotX: hotX,
285
+ hotspotY: hotY
286
+ },
287
+ pointer,
288
+ allowedEffects: ["copy"]
289
+ });
290
+ hostListening = true;
291
+ if (pendingRelease) {
292
+ follow?.release(pendingRelease.x, pendingRelease.y);
293
+ pendingRelease = null;
294
+ }
295
+ try {
296
+ await session;
297
+ } finally {
298
+ hostListening = false;
299
+ pendingRelease = null;
300
+ reset();
301
+ }
302
+ })();
278
303
  };
279
304
  const onPointerDown = (event) => {
280
305
  if (event.button !== 0) {
281
306
  return;
282
307
  }
283
308
  reset();
309
+ pendingRelease = null;
310
+ hostListening = false;
311
+ try {
312
+ element.setPointerCapture(event.pointerId);
313
+ } catch {
314
+ }
284
315
  const previewElement = readPreviewElement(element, options);
285
316
  active = {
286
317
  pointerId: event.pointerId,
@@ -306,7 +337,11 @@ function bindDragSource(element, options, start) {
306
337
  }
307
338
  };
308
339
  const onPointerMove = (event) => {
309
- if (!active || event.pointerId !== active.pointerId || active.started) {
340
+ if (!active || event.pointerId !== active.pointerId) {
341
+ return;
342
+ }
343
+ if (active.started) {
344
+ follow?.move(event.clientX, event.clientY);
310
345
  return;
311
346
  }
312
347
  const distance = pointerDistance(active.origin, event);
@@ -324,6 +359,21 @@ function bindDragSource(element, options, start) {
324
359
  if (!active || event.pointerId !== active.pointerId) {
325
360
  return;
326
361
  }
362
+ try {
363
+ if (typeof element.hasPointerCapture === "function" && element.hasPointerCapture(event.pointerId)) {
364
+ element.releasePointerCapture(event.pointerId);
365
+ }
366
+ } catch {
367
+ }
368
+ if (active.started) {
369
+ const point = { x: event.clientX, y: event.clientY };
370
+ if (hostListening) {
371
+ follow?.release(point.x, point.y);
372
+ } else {
373
+ pendingRelease = point;
374
+ }
375
+ return;
376
+ }
327
377
  reset();
328
378
  };
329
379
  element.addEventListener("pointerdown", onPointerDown);
@@ -1563,8 +1613,30 @@ var MindooDBAppDragApiImpl = class {
1563
1613
  async cancel() {
1564
1614
  await this.rpc.call("drag.cancel", {});
1565
1615
  }
1616
+ async reportPointer(point) {
1617
+ await this.rpc.call("drag.reportPointer", normalizeDragPointerInput(point));
1618
+ }
1619
+ async release(point) {
1620
+ await this.rpc.call("drag.release", normalizeDragPointerInput(point));
1621
+ }
1566
1622
  bindSource(element, options) {
1567
- const unbind = bindDragSource(element, options, (input) => this.start(input));
1623
+ const unbind = bindDragSource(
1624
+ element,
1625
+ options,
1626
+ (input) => this.start(input),
1627
+ {
1628
+ move: (x, y) => {
1629
+ void this.reportPointer({ x, y }).catch((error) => {
1630
+ console.warn("[mindoodb-app-sdk] Could not report a drag pointer.", error);
1631
+ });
1632
+ },
1633
+ release: (x, y) => {
1634
+ void this.release({ x, y }).catch((error) => {
1635
+ console.warn("[mindoodb-app-sdk] Could not release a drag.", error);
1636
+ });
1637
+ }
1638
+ }
1639
+ );
1568
1640
  this.unbindSources.add(unbind);
1569
1641
  return () => {
1570
1642
  unbind();
@@ -1842,6 +1914,7 @@ export {
1842
1914
  MindooDBAppDragInputError,
1843
1915
  isMindooDBAppDragType,
1844
1916
  normalizeDragAccepts,
1917
+ normalizeDragPointerInput,
1845
1918
  normalizeDragStartInput,
1846
1919
  snapshotElementToPng,
1847
1920
  bindDragSource,
package/dist/index.d.ts CHANGED
@@ -1,5 +1,5 @@
1
- import { M as MindooDBAppAttachmentPreviewMode, a as MindooDBAppDragBindSourceOptions, b as MindooDBAppDragStartInput, c as MindooDBAppDragStartResult, d as MindooDBAppDragPreview, e as MindooDBAppBridge, f as MindooDBAppHostShortcutBinding, g as MindooDBAppHostShortcutAction, h as MindooDBAppHostingMode, i as MindooDBAppDatabase, j as MindooDBAppDocument, k as MindooDBAppRichTextSpan, l as MindooDBAppRichTextSnapshot } from './types-M3RwHErO.js';
2
- export { m as MINDOODB_APP_SEAL_SIGNING_DOMAIN, n as MINDOODB_APP_WELL_KNOWN_DRAG_TYPES, o as MindooDBAppAccessDecision, p as MindooDBAppAccessTier, q as MindooDBAppAttachmentApi, r as MindooDBAppAttachmentChunk, s as MindooDBAppAttachmentInfo, t as MindooDBAppAttachmentPreviewOptions, u as MindooDBAppAttachmentPreviewSession, v as MindooDBAppAutomergeChangesPatch, w as MindooDBAppAutomergeChangesSince, x as MindooDBAppAutomergeGetOptions, y as MindooDBAppAutomergePatchResult, z as MindooDBAppAutomergeSnapshot, A as MindooDBAppBridgeBeforeCloseAck, B as MindooDBAppBridgeBeforeCloseMessage, C as MindooDBAppBridgeConnectMessage, D as MindooDBAppBridgeConnectOptions, E as MindooDBAppBridgeConnectedMessage, F as MindooDBAppBridgeDragDropMessage, G as MindooDBAppBridgeDragLeaveMessage, H as MindooDBAppBridgeDragOverMessage, I as MindooDBAppBridgeErrorPayload, J as MindooDBAppBridgeHandshakeErrorMessage, K as MindooDBAppBridgeLocaleChangedMessage, L as MindooDBAppBridgePortMessage, N as MindooDBAppBridgeQueryResultMessage, O as MindooDBAppBridgeRpcError, P as MindooDBAppBridgeRpcMessage, Q as MindooDBAppBridgeRpcRequest, R as MindooDBAppBridgeRpcSuccess, S as MindooDBAppBridgeShortcutInvokedMessage, T as MindooDBAppBridgeShortcutsChangedMessage, U as MindooDBAppBridgeStreamAbortRequest, V as MindooDBAppBridgeStreamAck, W as MindooDBAppBridgeStreamCloseRequest, X as MindooDBAppBridgeStreamError, Y as MindooDBAppBridgeStreamMessage, Z as MindooDBAppBridgeStreamOpenResult, _ as MindooDBAppBridgeStreamReadRequest, $ as MindooDBAppBridgeStreamWriteRequest, a0 as MindooDBAppBridgeThemeChangedMessage, a1 as MindooDBAppBridgeUiPreferencesChangedMessage, a2 as MindooDBAppBridgeViewChangedMessage, a3 as MindooDBAppBridgeViewportChangedMessage, a4 as MindooDBAppCapability, a5 as MindooDBAppConfiguredViewCategorizationStyle, a6 as MindooDBAppConfiguredViewColumn, a7 as MindooDBAppConfiguredViewColumnRole, a8 as MindooDBAppConfiguredViewExpressionMode, a9 as MindooDBAppConfiguredViewFieldExpression, aa as MindooDBAppConfiguredViewFilterDefinition, ab as MindooDBAppConfiguredViewFilterMode, ac as MindooDBAppConfiguredViewFilterRule, ad as MindooDBAppConfiguredViewFormulaExpression, ae as MindooDBAppConfiguredViewFormulaFilterDefinition, af as MindooDBAppConfiguredViewPreviewMode, ag as MindooDBAppConfiguredViewRuleFilterDefinition, ah as MindooDBAppConfiguredViewRuleMatchMode, ai as MindooDBAppConfiguredViewRuleOperator, aj as MindooDBAppConfiguredViewValueExpression, ak as MindooDBAppCreateDocumentInput, al as MindooDBAppCreateKeyInfo, am as MindooDBAppCreateViewInput, an as MindooDBAppCreateViewNavigatorInput, ao as MindooDBAppDatabaseInfo, ap as MindooDBAppDirectoryApi, aq as MindooDBAppDirectoryEntry, ar as MindooDBAppDocumentApi, as as MindooDBAppDocumentHeadCursorResult, at as MindooDBAppDocumentHistoryEntry, au as MindooDBAppDocumentListQuery, av as MindooDBAppDocumentListResult, aw as MindooDBAppDocumentQuery, ax as MindooDBAppDocumentRevisionId, ay as MindooDBAppDocumentScanPreset, az as MindooDBAppDocumentSummary, aA as MindooDBAppDragApi, aB as MindooDBAppDragCancelReason, aC as MindooDBAppDragDropEvent, aD as MindooDBAppDragEffect, aE as MindooDBAppDragHoverResult, aF as MindooDBAppDragOffer, aG as MindooDBAppDragOverEvent, aH as MindooDBAppDragPointer, aI as MindooDBAppDragProfile, aJ as MindooDBAppEntryAttachmentRef, aK as MindooDBAppEntryProvenance, aL as MindooDBAppExtractDocumentTextInput, aM as MindooDBAppExtractDocumentTextResult, aN as MindooDBAppExtractTextFormat, aO as MindooDBAppExtractionSetup, aP as MindooDBAppFulltextSetup, aQ as MindooDBAppHistoricalDocument, aR as MindooDBAppHistoryQuery, aS as MindooDBAppHostTheme, aT as MindooDBAppIdentityApi, aU as MindooDBAppInaccessibleDocument, aV as MindooDBAppInaccessibleDocumentListQuery, aW as MindooDBAppInaccessibleDocumentListResult, aX as MindooDBAppJsonListDeletePatch, aY as MindooDBAppJsonListInsertPatch, aZ as MindooDBAppJsonPatch, a_ as MindooDBAppJsonSetPatch, a$ as MindooDBAppJsonTextMarkPatch, b0 as MindooDBAppJsonTextSplicePatch, b1 as MindooDBAppJsonTextUnmarkPatch, b2 as MindooDBAppJsonUnsetPatch, b3 as MindooDBAppLaunchContext, b4 as MindooDBAppLiveQuerySubscription, b5 as MindooDBAppMenuAnchor, b6 as MindooDBAppMenuApi, b7 as MindooDBAppMenuCommandItem, b8 as MindooDBAppMenuDismissReason, b9 as MindooDBAppMenuDismissedResult, ba as MindooDBAppMenuItem, bb as MindooDBAppMenuKind, bc as MindooDBAppMenuPlacement, bd as MindooDBAppMenuPointAnchor, be as MindooDBAppMenuRect, bf as MindooDBAppMenuRectAnchor, bg as MindooDBAppMenuSelectionResult, bh as MindooDBAppMenuSeparatorItem, bi as MindooDBAppQueryCoverage, bj as MindooDBAppQueryResult, bk as MindooDBAppQueryRow, bl as MindooDBAppQuerySortKey, bm as MindooDBAppQueryTextClause, bn as MindooDBAppReadableAttachmentStream, bo as MindooDBAppRecipientOptions, bp as MindooDBAppResolvedViewDefinition, bq as MindooDBAppResolvedViewSource, br as MindooDBAppRevisionPhase, bs as MindooDBAppRevisionVerification, bt as MindooDBAppRichTextBlockSpan, bu as MindooDBAppRichTextGetOptions, bv as MindooDBAppRichTextImmutableString, bw as MindooDBAppRichTextMarkRange, bx as MindooDBAppRichTextMaterializeValue, by as MindooDBAppRichTextPatch, bz as MindooDBAppRichTextScalar, bA as MindooDBAppRichTextSpliceStep, bB as MindooDBAppRichTextStep, bC as MindooDBAppRichTextStepPatch, bD as MindooDBAppRichTextTextSpan, bE as MindooDBAppRuntime, bF as MindooDBAppScanAttachmentOptions, bG as MindooDBAppScanAttachmentResult, bH as MindooDBAppScopedDocId, bI as MindooDBAppScopedDocumentSummary, bJ as MindooDBAppSealIntent, bK as MindooDBAppSealedChannelOpenInput, bL as MindooDBAppSealedChannelOpenResult, bM as MindooDBAppSealedChannelRequestInput, bN as MindooDBAppSession, bO as MindooDBAppShowMenuInput, bP as MindooDBAppShowMenuResult, bQ as MindooDBAppSignPreview, bR as MindooDBAppSignPreviewScope, bS as MindooDBAppSignStatementInput, bT as MindooDBAppSignStatementResult, bU as MindooDBAppStorageApi, bV as MindooDBAppTextEdit, bW as MindooDBAppTextPatch, bX as MindooDBAppThemeMode, bY as MindooDBAppTimestampApi, bZ as MindooDBAppTimestampInput, b_ as MindooDBAppTimestampProvider, b$ as MindooDBAppTimestampResult, c0 as MindooDBAppUiPreferences, c1 as MindooDBAppUpdateDocumentInput, c2 as MindooDBAppViewCursorDocumentListResult, c3 as MindooDBAppViewCursorResult, c4 as MindooDBAppViewEntry, c5 as MindooDBAppViewEntryKind, c6 as MindooDBAppViewNavigator, c7 as MindooDBAppViewNavigatorExpansionState, c8 as MindooDBAppViewNavigatorOpenOptions, c9 as MindooDBAppViewNavigatorPageOptions, ca as MindooDBAppViewNavigatorPageResult, cb as MindooDBAppViewNavigatorRangeQuery, cc as MindooDBAppViewNavigatorSelectionState, cd as MindooDBAppViewUpdateStats, ce as MindooDBAppViewport, cf as MindooDBAppWellKnownDragType, cg as MindooDBAppWritableAttachmentStream } from './types-M3RwHErO.js';
1
+ import { M as MindooDBAppAttachmentPreviewMode, a as MindooDBAppDragBindSourceOptions, b as MindooDBAppDragStartInput, c as MindooDBAppDragStartResult, d as MindooDBAppDragPreview, e as MindooDBAppBridge, f as MindooDBAppHostShortcutBinding, g as MindooDBAppHostShortcutAction, h as MindooDBAppHostingMode, i as MindooDBAppDatabase, j as MindooDBAppDocument, k as MindooDBAppRichTextSpan, l as MindooDBAppRichTextSnapshot } from './types-BaXvRKXY.js';
2
+ export { m as MINDOODB_APP_SEAL_SIGNING_DOMAIN, n as MINDOODB_APP_WELL_KNOWN_DRAG_TYPES, o as MindooDBAppAccessDecision, p as MindooDBAppAccessTier, q as MindooDBAppAttachmentApi, r as MindooDBAppAttachmentChunk, s as MindooDBAppAttachmentInfo, t as MindooDBAppAttachmentPreviewOptions, u as MindooDBAppAttachmentPreviewSession, v as MindooDBAppAutomergeChangesPatch, w as MindooDBAppAutomergeChangesSince, x as MindooDBAppAutomergeGetOptions, y as MindooDBAppAutomergePatchResult, z as MindooDBAppAutomergeSnapshot, A as MindooDBAppBridgeBeforeCloseAck, B as MindooDBAppBridgeBeforeCloseMessage, C as MindooDBAppBridgeConnectMessage, D as MindooDBAppBridgeConnectOptions, E as MindooDBAppBridgeConnectedMessage, F as MindooDBAppBridgeDragDropMessage, G as MindooDBAppBridgeDragLeaveMessage, H as MindooDBAppBridgeDragOverMessage, I as MindooDBAppBridgeErrorPayload, J as MindooDBAppBridgeHandshakeErrorMessage, K as MindooDBAppBridgeLocaleChangedMessage, L as MindooDBAppBridgePortMessage, N as MindooDBAppBridgeQueryResultMessage, O as MindooDBAppBridgeRpcError, P as MindooDBAppBridgeRpcMessage, Q as MindooDBAppBridgeRpcRequest, R as MindooDBAppBridgeRpcSuccess, S as MindooDBAppBridgeShortcutInvokedMessage, T as MindooDBAppBridgeShortcutsChangedMessage, U as MindooDBAppBridgeStreamAbortRequest, V as MindooDBAppBridgeStreamAck, W as MindooDBAppBridgeStreamCloseRequest, X as MindooDBAppBridgeStreamError, Y as MindooDBAppBridgeStreamMessage, Z as MindooDBAppBridgeStreamOpenResult, _ as MindooDBAppBridgeStreamReadRequest, $ as MindooDBAppBridgeStreamWriteRequest, a0 as MindooDBAppBridgeThemeChangedMessage, a1 as MindooDBAppBridgeUiPreferencesChangedMessage, a2 as MindooDBAppBridgeViewChangedMessage, a3 as MindooDBAppBridgeViewportChangedMessage, a4 as MindooDBAppCapability, a5 as MindooDBAppConfiguredViewCategorizationStyle, a6 as MindooDBAppConfiguredViewColumn, a7 as MindooDBAppConfiguredViewColumnRole, a8 as MindooDBAppConfiguredViewExpressionMode, a9 as MindooDBAppConfiguredViewFieldExpression, aa as MindooDBAppConfiguredViewFilterDefinition, ab as MindooDBAppConfiguredViewFilterMode, ac as MindooDBAppConfiguredViewFilterRule, ad as MindooDBAppConfiguredViewFormulaExpression, ae as MindooDBAppConfiguredViewFormulaFilterDefinition, af as MindooDBAppConfiguredViewPreviewMode, ag as MindooDBAppConfiguredViewRuleFilterDefinition, ah as MindooDBAppConfiguredViewRuleMatchMode, ai as MindooDBAppConfiguredViewRuleOperator, aj as MindooDBAppConfiguredViewValueExpression, ak as MindooDBAppCreateDocumentInput, al as MindooDBAppCreateKeyInfo, am as MindooDBAppCreateViewInput, an as MindooDBAppCreateViewNavigatorInput, ao as MindooDBAppDatabaseInfo, ap as MindooDBAppDirectoryApi, aq as MindooDBAppDirectoryEntry, ar as MindooDBAppDocumentApi, as as MindooDBAppDocumentHeadCursorResult, at as MindooDBAppDocumentHistoryEntry, au as MindooDBAppDocumentListQuery, av as MindooDBAppDocumentListResult, aw as MindooDBAppDocumentQuery, ax as MindooDBAppDocumentRevisionId, ay as MindooDBAppDocumentScanPreset, az as MindooDBAppDocumentSummary, aA as MindooDBAppDragApi, aB as MindooDBAppDragCancelReason, aC as MindooDBAppDragDropEvent, aD as MindooDBAppDragEffect, aE as MindooDBAppDragHoverResult, aF as MindooDBAppDragOffer, aG as MindooDBAppDragOverEvent, aH as MindooDBAppDragPointer, aI as MindooDBAppDragProfile, aJ as MindooDBAppEntryAttachmentRef, aK as MindooDBAppEntryProvenance, aL as MindooDBAppExtractDocumentTextInput, aM as MindooDBAppExtractDocumentTextResult, aN as MindooDBAppExtractTextFormat, aO as MindooDBAppExtractionSetup, aP as MindooDBAppFulltextSetup, aQ as MindooDBAppHistoricalDocument, aR as MindooDBAppHistoryQuery, aS as MindooDBAppHostTheme, aT as MindooDBAppIdentityApi, aU as MindooDBAppInaccessibleDocument, aV as MindooDBAppInaccessibleDocumentListQuery, aW as MindooDBAppInaccessibleDocumentListResult, aX as MindooDBAppJsonListDeletePatch, aY as MindooDBAppJsonListInsertPatch, aZ as MindooDBAppJsonPatch, a_ as MindooDBAppJsonSetPatch, a$ as MindooDBAppJsonTextMarkPatch, b0 as MindooDBAppJsonTextSplicePatch, b1 as MindooDBAppJsonTextUnmarkPatch, b2 as MindooDBAppJsonUnsetPatch, b3 as MindooDBAppLaunchContext, b4 as MindooDBAppLiveQuerySubscription, b5 as MindooDBAppMenuAnchor, b6 as MindooDBAppMenuApi, b7 as MindooDBAppMenuCommandItem, b8 as MindooDBAppMenuDismissReason, b9 as MindooDBAppMenuDismissedResult, ba as MindooDBAppMenuItem, bb as MindooDBAppMenuKind, bc as MindooDBAppMenuPlacement, bd as MindooDBAppMenuPointAnchor, be as MindooDBAppMenuRect, bf as MindooDBAppMenuRectAnchor, bg as MindooDBAppMenuSelectionResult, bh as MindooDBAppMenuSeparatorItem, bi as MindooDBAppQueryCoverage, bj as MindooDBAppQueryResult, bk as MindooDBAppQueryRow, bl as MindooDBAppQuerySortKey, bm as MindooDBAppQueryTextClause, bn as MindooDBAppReadableAttachmentStream, bo as MindooDBAppRecipientOptions, bp as MindooDBAppResolvedViewDefinition, bq as MindooDBAppResolvedViewSource, br as MindooDBAppRevisionPhase, bs as MindooDBAppRevisionVerification, bt as MindooDBAppRichTextBlockSpan, bu as MindooDBAppRichTextGetOptions, bv as MindooDBAppRichTextImmutableString, bw as MindooDBAppRichTextMarkRange, bx as MindooDBAppRichTextMaterializeValue, by as MindooDBAppRichTextPatch, bz as MindooDBAppRichTextScalar, bA as MindooDBAppRichTextSpliceStep, bB as MindooDBAppRichTextStep, bC as MindooDBAppRichTextStepPatch, bD as MindooDBAppRichTextTextSpan, bE as MindooDBAppRuntime, bF as MindooDBAppScanAttachmentOptions, bG as MindooDBAppScanAttachmentResult, bH as MindooDBAppScopedDocId, bI as MindooDBAppScopedDocumentSummary, bJ as MindooDBAppSealIntent, bK as MindooDBAppSealedChannelOpenInput, bL as MindooDBAppSealedChannelOpenResult, bM as MindooDBAppSealedChannelRequestInput, bN as MindooDBAppSession, bO as MindooDBAppShowMenuInput, bP as MindooDBAppShowMenuResult, bQ as MindooDBAppSignPreview, bR as MindooDBAppSignPreviewScope, bS as MindooDBAppSignStatementInput, bT as MindooDBAppSignStatementResult, bU as MindooDBAppStorageApi, bV as MindooDBAppTextEdit, bW as MindooDBAppTextPatch, bX as MindooDBAppThemeMode, bY as MindooDBAppTimestampApi, bZ as MindooDBAppTimestampInput, b_ as MindooDBAppTimestampProvider, b$ as MindooDBAppTimestampResult, c0 as MindooDBAppUiPreferences, c1 as MindooDBAppUpdateDocumentInput, c2 as MindooDBAppViewCursorDocumentListResult, c3 as MindooDBAppViewCursorResult, c4 as MindooDBAppViewEntry, c5 as MindooDBAppViewEntryKind, c6 as MindooDBAppViewNavigator, c7 as MindooDBAppViewNavigatorExpansionState, c8 as MindooDBAppViewNavigatorOpenOptions, c9 as MindooDBAppViewNavigatorPageOptions, ca as MindooDBAppViewNavigatorPageResult, cb as MindooDBAppViewNavigatorRangeQuery, cc as MindooDBAppViewNavigatorSelectionState, cd as MindooDBAppViewUpdateStats, ce as MindooDBAppViewport, cf as MindooDBAppWellKnownDragType, cg as MindooDBAppWritableAttachmentStream } from './types-BaXvRKXY.js';
3
3
  export { M as MINDOODB_APP_BUNDLE_ARCHIVE_FILE_NAME, a as MINDOODB_APP_BUNDLE_MANIFEST_FILE_NAME, b as MINDOODB_APP_BUNDLE_MANIFEST_FORMAT, c as MINDOODB_APP_BUNDLE_MANIFEST_VERSION, d as MindooDBAppBundleArchive, e as MindooDBAppBundleFileEntry, f as MindooDBAppBundleHash, g as MindooDBAppBundleManifest, h as MindooDBAppBundleManifestValidation, i as buildMindooDBAppBundleContentHashInput, j as isMindooDBAppBundleHash, n as normalizeMindooDBAppBundlePath, v as validateMindooDBAppBundleManifest } from './appBundleManifest-B0xfpaXG.js';
4
4
  import { MindooDBAppBooleanExpression } from 'mindoodb-view-language';
5
5
  export { MindooDBAppBooleanExpression, MindooDBAppExpression, MindooDBAppFilterDefinition, MindooDBAppViewCategoryChildrenPageRequest, MindooDBAppViewColumn, MindooDBAppViewColumnRole, MindooDBAppViewDefinition, MindooDBAppViewExpansionState, MindooDBAppViewExpressionBase, MindooDBAppViewExpressionDatePart, MindooDBAppViewExpressionOperation, MindooDBAppViewFieldExpression, MindooDBAppViewIfExpression, MindooDBAppViewLetExpression, MindooDBAppViewLiteralExpression, MindooDBAppViewLookupByPath, MindooDBAppViewOperationExpression, MindooDBAppViewOriginExpression, MindooDBAppViewPageRequest, MindooDBAppViewPageResult, MindooDBAppViewRow, MindooDBAppViewSortDirection, MindooDBAppViewTotalMode, MindooDBAppViewValueExpressionRef, MindooDBAppViewVariableExpression, createViewLanguage } from 'mindoodb-view-language';
@@ -69,6 +69,11 @@ declare class MindooDBAppDragInputError extends Error {
69
69
  declare function isMindooDBAppDragType(type: string): boolean;
70
70
  /** Project and validate the `accepts` list sent with `drag.setProfile`. */
71
71
  declare function normalizeDragAccepts(value: unknown): string[];
72
+ /** Project iframe-local pointer coordinates sent after `drag.start`. */
73
+ declare function normalizeDragPointerInput(value: unknown): {
74
+ x: number;
75
+ y: number;
76
+ };
72
77
  /** Project and validate a `drag.start` payload. */
73
78
  declare function normalizeDragStartInput(value: unknown): MindooDBAppDragStartInput;
74
79
  /**
@@ -80,7 +85,11 @@ declare function snapshotElementToPng(element: HTMLElement): Promise<MindooDBApp
80
85
  * Start a host drag from a pointer gesture. Mouse/pen use a move threshold;
81
86
  * touch waits for a long-press so lists can still scroll.
82
87
  */
83
- declare function bindDragSource(element: HTMLElement, options: MindooDBAppDragBindSourceOptions, start: (input: MindooDBAppDragStartInput) => Promise<MindooDBAppDragStartResult>): () => void;
88
+ type MindooDBAppDragPointerFollow = {
89
+ move: (x: number, y: number) => void;
90
+ release: (x: number, y: number) => void;
91
+ };
92
+ declare function bindDragSource(element: HTMLElement, options: MindooDBAppDragBindSourceOptions, start: (input: MindooDBAppDragStartInput) => Promise<MindooDBAppDragStartResult>, follow?: MindooDBAppDragPointerFollow): () => void;
84
93
 
85
94
  /**
86
95
  * Drops memoised sessions so the next `connect()` performs a fresh handshake.
@@ -357,4 +366,4 @@ declare function createMindooDBTextBuffer(options: CreateMindooDBTextBufferOptio
357
366
  */
358
367
  declare function queryDocuments(db: Pick<MindooDB, "query">, filter: MindooDBAppBooleanExpression | string, sortBy?: MindooQuerySortKey[], options?: MindooQueryOptions): Promise<MindooQueryResult>;
359
368
 
360
- export { type CreateMindooDBRichTextHandleOptions, type CreateMindooDBTextBufferOptions, DEFAULT_DRAG_LONG_PRESS_MS, DEFAULT_DRAG_POINTER_THRESHOLD_PX, DEFAULT_HAVEN_HOST_SHORTCUTS, type HavenStorageShimHandle, type InstallHavenStorageShimOptions, MINDOODB_APP_HOSTING_QUERY_PARAM, MINDOODB_APP_MAX_DRAG_PAYLOAD_BYTES, MINDOODB_APP_MAX_DRAG_PREVIEW_BYTES, MINDOODB_APP_MAX_DRAG_PREVIEW_EDGE, MINDOODB_APP_MAX_DRAG_TYPES, MINIMAL_DRAG_PREVIEW_PNG, MindooDBAppAttachmentPreviewMode, MindooDBAppBridge, MindooDBAppDatabase, MindooDBAppDocument, MindooDBAppDragBindSourceOptions, MindooDBAppDragInputError, MindooDBAppDragPreview, MindooDBAppDragStartInput, MindooDBAppDragStartResult, MindooDBAppHostShortcutAction, MindooDBAppHostShortcutBinding, MindooDBAppHostingMode, MindooDBAppRichTextSnapshot, MindooDBAppRichTextSpan, MindooDBRichTextHandle, type MindooDBRichTextHandleChangeListener, type MindooDBRichTextHandleFlushResult, MindooDBTextBuffer, type MindooDBTextBufferFlushResult, abbreviateCanonicalName, applyHostedDocumentOverscrollContain, bindDragSource, canPreviewAttachment, createMindooDBAppBridge, createMindooDBRichTextHandle, createMindooDBTextBuffer, expandAbbreviatedName, installHavenStorageShim, installHostShortcutCapture, isHostShortcutAction, isHostedBundleRuntime, isMindooDBAppDragType, matchHostShortcut, normalizeDragAccepts, normalizeDragStartInput, queryDocuments, readMindooDBAppHostingMode, releaseMindooDBAppBridgeSessions, sanitizeHostShortcutBindings, snapshotElementToPng };
369
+ export { type CreateMindooDBRichTextHandleOptions, type CreateMindooDBTextBufferOptions, DEFAULT_DRAG_LONG_PRESS_MS, DEFAULT_DRAG_POINTER_THRESHOLD_PX, DEFAULT_HAVEN_HOST_SHORTCUTS, type HavenStorageShimHandle, type InstallHavenStorageShimOptions, MINDOODB_APP_HOSTING_QUERY_PARAM, MINDOODB_APP_MAX_DRAG_PAYLOAD_BYTES, MINDOODB_APP_MAX_DRAG_PREVIEW_BYTES, MINDOODB_APP_MAX_DRAG_PREVIEW_EDGE, MINDOODB_APP_MAX_DRAG_TYPES, MINIMAL_DRAG_PREVIEW_PNG, MindooDBAppAttachmentPreviewMode, MindooDBAppBridge, MindooDBAppDatabase, MindooDBAppDocument, MindooDBAppDragBindSourceOptions, MindooDBAppDragInputError, MindooDBAppDragPreview, MindooDBAppDragStartInput, MindooDBAppDragStartResult, MindooDBAppHostShortcutAction, MindooDBAppHostShortcutBinding, MindooDBAppHostingMode, MindooDBAppRichTextSnapshot, MindooDBAppRichTextSpan, MindooDBRichTextHandle, type MindooDBRichTextHandleChangeListener, type MindooDBRichTextHandleFlushResult, MindooDBTextBuffer, type MindooDBTextBufferFlushResult, abbreviateCanonicalName, applyHostedDocumentOverscrollContain, bindDragSource, canPreviewAttachment, createMindooDBAppBridge, createMindooDBRichTextHandle, createMindooDBTextBuffer, expandAbbreviatedName, installHavenStorageShim, installHostShortcutCapture, isHostShortcutAction, isHostedBundleRuntime, isMindooDBAppDragType, matchHostShortcut, normalizeDragAccepts, normalizeDragPointerInput, normalizeDragStartInput, queryDocuments, readMindooDBAppHostingMode, releaseMindooDBAppBridgeSessions, sanitizeHostShortcutBindings, snapshotElementToPng };
package/dist/index.js CHANGED
@@ -16,11 +16,12 @@ import {
16
16
  isMindooDBAppDragType,
17
17
  matchHostShortcut,
18
18
  normalizeDragAccepts,
19
+ normalizeDragPointerInput,
19
20
  normalizeDragStartInput,
20
21
  releaseMindooDBAppBridgeSessions,
21
22
  sanitizeHostShortcutBindings,
22
23
  snapshotElementToPng
23
- } from "./chunk-ZO7UE6B2.js";
24
+ } from "./chunk-XPPTUWW6.js";
24
25
  import {
25
26
  MINDOODB_APP_BUNDLE_ARCHIVE_FILE_NAME,
26
27
  MINDOODB_APP_BUNDLE_MANIFEST_FILE_NAME,
@@ -808,6 +809,7 @@ export {
808
809
  isMindooDBAppDragType,
809
810
  matchHostShortcut,
810
811
  normalizeDragAccepts,
812
+ normalizeDragPointerInput,
811
813
  normalizeDragStartInput,
812
814
  normalizeMindooDBAppBundlePath,
813
815
  queryDocuments,
@@ -1,4 +1,4 @@
1
- import { an as MindooDBAppCreateViewNavigatorInput, c6 as MindooDBAppViewNavigator, b3 as MindooDBAppLaunchContext, ao as MindooDBAppDatabaseInfo, ar as MindooDBAppDocumentApi, c8 as MindooDBAppViewNavigatorOpenOptions, q as MindooDBAppAttachmentApi, aT as MindooDBAppIdentityApi, bY as MindooDBAppTimestampApi, ap as MindooDBAppDirectoryApi, j as MindooDBAppDocument, aP as MindooDBAppFulltextSetup, aO as MindooDBAppExtractionSetup, e as MindooDBAppBridge, bN as MindooDBAppSession, Q as MindooDBAppBridgeRpcRequest, aS as MindooDBAppHostTheme, ce as MindooDBAppViewport, c0 as MindooDBAppUiPreferences, bj as MindooDBAppQueryResult, cd as MindooDBAppViewUpdateStats, L as MindooDBAppBridgePortMessage, c as MindooDBAppDragStartResult, aI as MindooDBAppDragProfile } from '../types-M3RwHErO.js';
1
+ import { an as MindooDBAppCreateViewNavigatorInput, c6 as MindooDBAppViewNavigator, b3 as MindooDBAppLaunchContext, ao as MindooDBAppDatabaseInfo, ar as MindooDBAppDocumentApi, c8 as MindooDBAppViewNavigatorOpenOptions, q as MindooDBAppAttachmentApi, aT as MindooDBAppIdentityApi, bY as MindooDBAppTimestampApi, ap as MindooDBAppDirectoryApi, j as MindooDBAppDocument, aP as MindooDBAppFulltextSetup, aO as MindooDBAppExtractionSetup, e as MindooDBAppBridge, bN as MindooDBAppSession, Q as MindooDBAppBridgeRpcRequest, aS as MindooDBAppHostTheme, ce as MindooDBAppViewport, c0 as MindooDBAppUiPreferences, bj as MindooDBAppQueryResult, cd as MindooDBAppViewUpdateStats, L as MindooDBAppBridgePortMessage, c as MindooDBAppDragStartResult, aI as MindooDBAppDragProfile } from '../types-BaXvRKXY.js';
2
2
  import * as mindoodb from 'mindoodb';
3
3
  import 'mindoodb-view-language';
4
4
 
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  releaseMindooDBAppBridgeSessions
3
- } from "../chunk-ZO7UE6B2.js";
3
+ } from "../chunk-XPPTUWW6.js";
4
4
 
5
5
  // src/testing/index.ts
6
6
  import * as Automerge from "@automerge/automerge";
@@ -1895,6 +1895,10 @@ function createMockSessionState(options = {}) {
1895
1895
  });
1896
1896
  activeDragResolve = null;
1897
1897
  },
1898
+ async reportPointer() {
1899
+ },
1900
+ async release() {
1901
+ },
1898
1902
  bindSource() {
1899
1903
  return () => void 0;
1900
1904
  }
@@ -1144,10 +1144,24 @@ interface MindooDBAppDragApi {
1144
1144
  start(input: MindooDBAppDragStartInput): Promise<MindooDBAppDragStartResult>;
1145
1145
  /** Abort a gesture this app started. */
1146
1146
  cancel(): Promise<void>;
1147
+ /**
1148
+ * Forward an iframe-local pointer position after `start`. Required because
1149
+ * the source document keeps the pressed pointer (mouse capture).
1150
+ */
1151
+ reportPointer(point: {
1152
+ x: number;
1153
+ y: number;
1154
+ }): Promise<void>;
1155
+ /** End the gesture at an iframe-local pointer position. */
1156
+ release(point: {
1157
+ x: number;
1158
+ y: number;
1159
+ }): Promise<void>;
1147
1160
  /**
1148
1161
  * Pointer helper: mouse/pen starts after a small move; touch starts after
1149
1162
  * a long-press. Each element can be bound independently; the returned
1150
- * function unbinds only that element.
1163
+ * function unbinds only that element. After start, moves and the button-up
1164
+ * stay in this frame and are forwarded to Haven.
1151
1165
  */
1152
1166
  bindSource(element: HTMLElement, options: MindooDBAppDragBindSourceOptions): () => void;
1153
1167
  }
@@ -35,6 +35,7 @@ interface HavenBundleVitePlugin {
35
35
  name: string;
36
36
  apply: "build";
37
37
  configResolved: (config: ResolvedViteConfig) => void;
38
+ writeBundle: () => Promise<void>;
38
39
  closeBundle: () => Promise<void>;
39
40
  }
40
41
  /**
@@ -8,7 +8,7 @@ import {
8
8
 
9
9
  // src/vite/index.ts
10
10
  import { createHash } from "crypto";
11
- import { readdir, readFile, writeFile } from "fs/promises";
11
+ import { access, readdir, readFile, writeFile } from "fs/promises";
12
12
  import path from "path";
13
13
 
14
14
  // src/vite/zip.ts
@@ -155,6 +155,14 @@ var DEFAULT_EXCLUDED_ROOT_FILES = /* @__PURE__ */ new Set([
155
155
  MINDOODB_APP_BUNDLE_ARCHIVE_FILE_NAME
156
156
  ]);
157
157
  var WORKBOX_RUNTIME_PATTERN = /^workbox-[a-z0-9]+\.js(\.map)?$/i;
158
+ async function directoryExists(dir) {
159
+ try {
160
+ await access(dir);
161
+ return true;
162
+ } catch {
163
+ return false;
164
+ }
165
+ }
158
166
  function sha256(data) {
159
167
  return `sha256-${createHash("sha256").update(data).digest("hex")}`;
160
168
  }
@@ -223,66 +231,80 @@ async function readPackageMetadata(root) {
223
231
  }
224
232
  function havenBundle(options = {}) {
225
233
  let resolvedConfig = null;
234
+ let emitted = false;
235
+ async function emitBundle() {
236
+ if (emitted) {
237
+ return;
238
+ }
239
+ if (!resolvedConfig) {
240
+ throw new Error("[haven-bundle] Plugin ran without a resolved Vite config.");
241
+ }
242
+ const outDir = path.resolve(resolvedConfig.root, resolvedConfig.build.outDir);
243
+ if (!await directoryExists(outDir)) {
244
+ return;
245
+ }
246
+ const allPaths = await collectFiles(outDir);
247
+ const bundlePaths = allPaths.filter((candidate) => !isExcluded(candidate, options));
248
+ if (!bundlePaths.length) {
249
+ throw new Error(`[haven-bundle] No bundle files found in "${outDir}".`);
250
+ }
251
+ const entry = resolveEntryPath(bundlePaths, options.entry);
252
+ const packageMetadata = await readPackageMetadata(resolvedConfig.root);
253
+ const appId = options.appId ?? packageMetadata.name;
254
+ const version = options.version ?? packageMetadata.version;
255
+ if (!appId) {
256
+ throw new Error("[haven-bundle] Unable to determine appId \u2014 pass it explicitly.");
257
+ }
258
+ if (!version) {
259
+ throw new Error("[haven-bundle] Unable to determine version \u2014 pass it explicitly.");
260
+ }
261
+ const files = [];
262
+ const archiveEntries = [];
263
+ for (const relativePath of bundlePaths) {
264
+ const data = await readFile(path.join(outDir, relativePath));
265
+ files.push({ path: relativePath, hash: sha256(data), size: data.byteLength });
266
+ archiveEntries.push({ path: relativePath, data });
267
+ }
268
+ const archive = createZipArchive(archiveEntries);
269
+ const manifest = {
270
+ format: MINDOODB_APP_BUNDLE_MANIFEST_FORMAT,
271
+ formatVersion: MINDOODB_APP_BUNDLE_MANIFEST_VERSION,
272
+ appId,
273
+ version,
274
+ entry,
275
+ archive: {
276
+ path: MINDOODB_APP_BUNDLE_ARCHIVE_FILE_NAME,
277
+ hash: sha256(archive),
278
+ size: archive.byteLength
279
+ },
280
+ contentHash: sha256(buildMindooDBAppBundleContentHashInput(files)),
281
+ generatedAt: (/* @__PURE__ */ new Date()).toISOString(),
282
+ files
283
+ };
284
+ await writeFile(path.join(outDir, MINDOODB_APP_BUNDLE_ARCHIVE_FILE_NAME), archive);
285
+ await writeFile(
286
+ path.join(outDir, MINDOODB_APP_BUNDLE_MANIFEST_FILE_NAME),
287
+ `${JSON.stringify(manifest, null, 2)}
288
+ `,
289
+ "utf8"
290
+ );
291
+ const totalBytes = files.reduce((sum, file) => sum + file.size, 0);
292
+ console.log(
293
+ `[haven-bundle] ${files.length} files (${(totalBytes / 1024 / 1024).toFixed(2)} MB) \u2192 ${MINDOODB_APP_BUNDLE_ARCHIVE_FILE_NAME} (${(archive.byteLength / 1024 / 1024).toFixed(2)} MB), contentHash ${manifest.contentHash.slice(7, 19)}`
294
+ );
295
+ emitted = true;
296
+ }
226
297
  return {
227
298
  name: "haven-bundle",
228
299
  apply: "build",
229
300
  configResolved(config) {
230
301
  resolvedConfig = config;
231
302
  },
303
+ async writeBundle() {
304
+ await emitBundle();
305
+ },
232
306
  async closeBundle() {
233
- if (!resolvedConfig) {
234
- throw new Error("[haven-bundle] Plugin ran without a resolved Vite config.");
235
- }
236
- const outDir = path.resolve(resolvedConfig.root, resolvedConfig.build.outDir);
237
- const allPaths = await collectFiles(outDir);
238
- const bundlePaths = allPaths.filter((candidate) => !isExcluded(candidate, options));
239
- if (!bundlePaths.length) {
240
- throw new Error(`[haven-bundle] No bundle files found in "${outDir}".`);
241
- }
242
- const entry = resolveEntryPath(bundlePaths, options.entry);
243
- const packageMetadata = await readPackageMetadata(resolvedConfig.root);
244
- const appId = options.appId ?? packageMetadata.name;
245
- const version = options.version ?? packageMetadata.version;
246
- if (!appId) {
247
- throw new Error("[haven-bundle] Unable to determine appId \u2014 pass it explicitly.");
248
- }
249
- if (!version) {
250
- throw new Error("[haven-bundle] Unable to determine version \u2014 pass it explicitly.");
251
- }
252
- const files = [];
253
- const archiveEntries = [];
254
- for (const relativePath of bundlePaths) {
255
- const data = await readFile(path.join(outDir, relativePath));
256
- files.push({ path: relativePath, hash: sha256(data), size: data.byteLength });
257
- archiveEntries.push({ path: relativePath, data });
258
- }
259
- const archive = createZipArchive(archiveEntries);
260
- const manifest = {
261
- format: MINDOODB_APP_BUNDLE_MANIFEST_FORMAT,
262
- formatVersion: MINDOODB_APP_BUNDLE_MANIFEST_VERSION,
263
- appId,
264
- version,
265
- entry,
266
- archive: {
267
- path: MINDOODB_APP_BUNDLE_ARCHIVE_FILE_NAME,
268
- hash: sha256(archive),
269
- size: archive.byteLength
270
- },
271
- contentHash: sha256(buildMindooDBAppBundleContentHashInput(files)),
272
- generatedAt: (/* @__PURE__ */ new Date()).toISOString(),
273
- files
274
- };
275
- await writeFile(path.join(outDir, MINDOODB_APP_BUNDLE_ARCHIVE_FILE_NAME), archive);
276
- await writeFile(
277
- path.join(outDir, MINDOODB_APP_BUNDLE_MANIFEST_FILE_NAME),
278
- `${JSON.stringify(manifest, null, 2)}
279
- `,
280
- "utf8"
281
- );
282
- const totalBytes = files.reduce((sum, file) => sum + file.size, 0);
283
- console.log(
284
- `[haven-bundle] ${files.length} files (${(totalBytes / 1024 / 1024).toFixed(2)} MB) \u2192 ${MINDOODB_APP_BUNDLE_ARCHIVE_FILE_NAME} (${(archive.byteLength / 1024 / 1024).toFixed(2)} MB), contentHash ${manifest.contentHash.slice(7, 19)}`
285
- );
307
+ await emitBundle();
286
308
  }
287
309
  };
288
310
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "mindoodb-app-sdk",
3
- "version": "0.0.44",
3
+ "version": "0.0.46",
4
4
  "engines": {
5
5
  "node": ">=22.13.0"
6
6
  },