mindoodb-app-sdk 0.0.45 → 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 +3 -1
- package/dist/{chunk-ZO7UE6B2.js → chunk-XPPTUWW6.js} +96 -23
- package/dist/index.d.ts +13 -4
- package/dist/index.js +3 -1
- package/dist/testing/index.d.ts +1 -1
- package/dist/testing/index.js +5 -1
- package/dist/{types-M3RwHErO.d.ts → types-BaXvRKXY.d.ts} +15 -1
- package/package.json +1 -1
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
|
|
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
|
-
|
|
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
|
-
|
|
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
|
|
271
|
+
const pointerId = active.pointerId;
|
|
266
272
|
const hotX = event.clientX - element.getBoundingClientRect().left;
|
|
267
273
|
const hotY = event.clientY - element.getBoundingClientRect().top;
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
preview
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
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
|
|
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(
|
|
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-
|
|
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-
|
|
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
|
-
|
|
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-
|
|
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,
|
package/dist/testing/index.d.ts
CHANGED
|
@@ -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-
|
|
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
|
|
package/dist/testing/index.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import {
|
|
2
2
|
releaseMindooDBAppBridgeSessions
|
|
3
|
-
} from "../chunk-
|
|
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
|
}
|