@tldraw/editor 5.5.0-next.f9308d324e1c → 5.6.0-canary.5bfc37740468
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-cjs/index.d.ts +49 -23
- package/dist-cjs/index.js +1 -1
- package/dist-cjs/index.js.map +2 -2
- package/dist-cjs/lib/TldrawEditor.js +16 -12
- package/dist-cjs/lib/TldrawEditor.js.map +2 -2
- package/dist-cjs/lib/components/MenuClickCapture.js +42 -3
- package/dist-cjs/lib/components/MenuClickCapture.js.map +2 -2
- package/dist-cjs/lib/components/default-components/DefaultCanvas.js +5 -1
- package/dist-cjs/lib/components/default-components/DefaultCanvas.js.map +2 -2
- package/dist-cjs/lib/components/default-components/DefaultErrorFallback.js +2 -5
- package/dist-cjs/lib/components/default-components/DefaultErrorFallback.js.map +3 -3
- package/dist-cjs/lib/components/default-components/DefaultSpinner.js.map +2 -2
- package/dist-cjs/lib/editor/Editor.js +183 -185
- package/dist-cjs/lib/editor/Editor.js.map +3 -3
- package/dist-cjs/lib/editor/derivations/bindingsIndex.js +2 -0
- package/dist-cjs/lib/editor/derivations/bindingsIndex.js.map +2 -2
- package/dist-cjs/lib/editor/managers/ClickManager/ClickManager.js +3 -2
- package/dist-cjs/lib/editor/managers/ClickManager/ClickManager.js.map +2 -2
- package/dist-cjs/lib/editor/managers/EditorManager.js +11 -2
- package/dist-cjs/lib/editor/managers/EditorManager.js.map +2 -2
- package/dist-cjs/lib/editor/managers/PerformanceManager/PerformanceManager.js +49 -63
- package/dist-cjs/lib/editor/managers/PerformanceManager/PerformanceManager.js.map +2 -2
- package/dist-cjs/lib/editor/managers/ScribbleManager/ScribbleManager.js +1 -1
- package/dist-cjs/lib/editor/managers/ScribbleManager/ScribbleManager.js.map +2 -2
- package/dist-cjs/lib/editor/managers/SnapManager/BoundsSnaps.js +24 -24
- package/dist-cjs/lib/editor/managers/SnapManager/BoundsSnaps.js.map +2 -2
- package/dist-cjs/lib/editor/managers/SnapManager/HandleSnaps.js +7 -1
- package/dist-cjs/lib/editor/managers/SnapManager/HandleSnaps.js.map +2 -2
- package/dist-cjs/lib/editor/managers/SnapManager/SnapManager.js +4 -3
- package/dist-cjs/lib/editor/managers/SnapManager/SnapManager.js.map +2 -2
- package/dist-cjs/lib/editor/managers/TextManager/TextManager.js +4 -4
- package/dist-cjs/lib/editor/managers/TextManager/TextManager.js.map +2 -2
- package/dist-cjs/lib/editor/shapes/group/GroupShapeUtil.js +14 -6
- package/dist-cjs/lib/editor/shapes/group/GroupShapeUtil.js.map +3 -3
- package/dist-cjs/lib/editor/shapes/shared/resizeBox.js +21 -16
- package/dist-cjs/lib/editor/shapes/shared/resizeBox.js.map +2 -2
- package/dist-cjs/lib/editor/types/external-content.js.map +1 -1
- package/dist-cjs/lib/exports/ExportDelay.js +10 -2
- package/dist-cjs/lib/exports/ExportDelay.js.map +2 -2
- package/dist-cjs/lib/exports/FontEmbedder.js +25 -11
- package/dist-cjs/lib/exports/FontEmbedder.js.map +2 -2
- package/dist-cjs/lib/exports/StyleEmbedder.js +9 -4
- package/dist-cjs/lib/exports/StyleEmbedder.js.map +2 -2
- package/dist-cjs/lib/exports/fetchCache.js +3 -0
- package/dist-cjs/lib/exports/fetchCache.js.map +2 -2
- package/dist-cjs/lib/exports/getSvgAsImage.js +10 -4
- package/dist-cjs/lib/exports/getSvgAsImage.js.map +2 -2
- package/dist-cjs/lib/exports/getSvgJsx.js +18 -9
- package/dist-cjs/lib/exports/getSvgJsx.js.map +2 -2
- package/dist-cjs/lib/exports/parseCss.js +1 -1
- package/dist-cjs/lib/exports/parseCss.js.map +1 -1
- package/dist-cjs/lib/hooks/EditorComponentsContext.js.map +2 -2
- package/dist-cjs/lib/hooks/useCanvasEvents.js +24 -0
- package/dist-cjs/lib/hooks/useCanvasEvents.js.map +2 -2
- package/dist-cjs/lib/hooks/useCursor.js +12 -8
- package/dist-cjs/lib/hooks/useCursor.js.map +2 -2
- package/dist-cjs/lib/hooks/useIdentity.js +6 -2
- package/dist-cjs/lib/hooks/useIdentity.js.map +3 -3
- package/dist-cjs/lib/license/LicenseManager.js +9 -1
- package/dist-cjs/lib/license/LicenseManager.js.map +2 -2
- package/dist-cjs/lib/license/LicenseProvider.js +12 -4
- package/dist-cjs/lib/license/LicenseProvider.js.map +2 -2
- package/dist-cjs/lib/utils/debug-flags.js +0 -6
- package/dist-cjs/lib/utils/debug-flags.js.map +2 -2
- package/dist-cjs/lib/utils/deepLinks.js +2 -1
- package/dist-cjs/lib/utils/deepLinks.js.map +2 -2
- package/dist-cjs/lib/utils/sync/LocalIndexedDb.js +32 -25
- package/dist-cjs/lib/utils/sync/LocalIndexedDb.js.map +2 -2
- package/dist-cjs/lib/utils/sync/TLLocalSyncClient.js +88 -40
- package/dist-cjs/lib/utils/sync/TLLocalSyncClient.js.map +2 -2
- package/dist-cjs/version.js +3 -3
- package/dist-cjs/version.js.map +1 -1
- package/dist-esm/index.d.mts +49 -23
- package/dist-esm/index.mjs +4 -2
- package/dist-esm/index.mjs.map +2 -2
- package/dist-esm/lib/TldrawEditor.mjs +17 -13
- package/dist-esm/lib/TldrawEditor.mjs.map +2 -2
- package/dist-esm/lib/components/MenuClickCapture.mjs +42 -3
- package/dist-esm/lib/components/MenuClickCapture.mjs.map +2 -2
- package/dist-esm/lib/components/default-components/DefaultCanvas.mjs +5 -1
- package/dist-esm/lib/components/default-components/DefaultCanvas.mjs.map +2 -2
- package/dist-esm/lib/components/default-components/DefaultErrorFallback.mjs +2 -5
- package/dist-esm/lib/components/default-components/DefaultErrorFallback.mjs.map +3 -3
- package/dist-esm/lib/components/default-components/DefaultSpinner.mjs.map +2 -2
- package/dist-esm/lib/editor/Editor.mjs +185 -186
- package/dist-esm/lib/editor/Editor.mjs.map +3 -3
- package/dist-esm/lib/editor/derivations/bindingsIndex.mjs +2 -0
- package/dist-esm/lib/editor/derivations/bindingsIndex.mjs.map +2 -2
- package/dist-esm/lib/editor/managers/ClickManager/ClickManager.mjs +3 -2
- package/dist-esm/lib/editor/managers/ClickManager/ClickManager.mjs.map +2 -2
- package/dist-esm/lib/editor/managers/EditorManager.mjs +11 -2
- package/dist-esm/lib/editor/managers/EditorManager.mjs.map +2 -2
- package/dist-esm/lib/editor/managers/PerformanceManager/PerformanceManager.mjs +49 -63
- package/dist-esm/lib/editor/managers/PerformanceManager/PerformanceManager.mjs.map +2 -2
- package/dist-esm/lib/editor/managers/ScribbleManager/ScribbleManager.mjs +1 -1
- package/dist-esm/lib/editor/managers/ScribbleManager/ScribbleManager.mjs.map +2 -2
- package/dist-esm/lib/editor/managers/SnapManager/BoundsSnaps.mjs +24 -24
- package/dist-esm/lib/editor/managers/SnapManager/BoundsSnaps.mjs.map +2 -2
- package/dist-esm/lib/editor/managers/SnapManager/HandleSnaps.mjs +7 -1
- package/dist-esm/lib/editor/managers/SnapManager/HandleSnaps.mjs.map +2 -2
- package/dist-esm/lib/editor/managers/SnapManager/SnapManager.mjs +4 -3
- package/dist-esm/lib/editor/managers/SnapManager/SnapManager.mjs.map +2 -2
- package/dist-esm/lib/editor/managers/TextManager/TextManager.mjs +4 -4
- package/dist-esm/lib/editor/managers/TextManager/TextManager.mjs.map +2 -2
- package/dist-esm/lib/editor/shapes/group/GroupShapeUtil.mjs +14 -6
- package/dist-esm/lib/editor/shapes/group/GroupShapeUtil.mjs.map +3 -3
- package/dist-esm/lib/editor/shapes/shared/resizeBox.mjs +21 -16
- package/dist-esm/lib/editor/shapes/shared/resizeBox.mjs.map +2 -2
- package/dist-esm/lib/exports/ExportDelay.mjs +11 -3
- package/dist-esm/lib/exports/ExportDelay.mjs.map +2 -2
- package/dist-esm/lib/exports/FontEmbedder.mjs +25 -11
- package/dist-esm/lib/exports/FontEmbedder.mjs.map +2 -2
- package/dist-esm/lib/exports/StyleEmbedder.mjs +9 -4
- package/dist-esm/lib/exports/StyleEmbedder.mjs.map +2 -2
- package/dist-esm/lib/exports/fetchCache.mjs +3 -0
- package/dist-esm/lib/exports/fetchCache.mjs.map +2 -2
- package/dist-esm/lib/exports/getSvgAsImage.mjs +10 -4
- package/dist-esm/lib/exports/getSvgAsImage.mjs.map +2 -2
- package/dist-esm/lib/exports/getSvgJsx.mjs +18 -9
- package/dist-esm/lib/exports/getSvgJsx.mjs.map +2 -2
- package/dist-esm/lib/exports/parseCss.mjs +1 -1
- package/dist-esm/lib/exports/parseCss.mjs.map +1 -1
- package/dist-esm/lib/hooks/EditorComponentsContext.mjs.map +2 -2
- package/dist-esm/lib/hooks/useCanvasEvents.mjs +24 -0
- package/dist-esm/lib/hooks/useCanvasEvents.mjs.map +2 -2
- package/dist-esm/lib/hooks/useCursor.mjs +12 -8
- package/dist-esm/lib/hooks/useCursor.mjs.map +2 -2
- package/dist-esm/lib/hooks/useIdentity.mjs +7 -3
- package/dist-esm/lib/hooks/useIdentity.mjs.map +3 -3
- package/dist-esm/lib/license/LicenseManager.mjs +9 -1
- package/dist-esm/lib/license/LicenseManager.mjs.map +2 -2
- package/dist-esm/lib/license/LicenseProvider.mjs +13 -5
- package/dist-esm/lib/license/LicenseProvider.mjs.map +2 -2
- package/dist-esm/lib/utils/debug-flags.mjs +0 -6
- package/dist-esm/lib/utils/debug-flags.mjs.map +2 -2
- package/dist-esm/lib/utils/deepLinks.mjs +2 -1
- package/dist-esm/lib/utils/deepLinks.mjs.map +2 -2
- package/dist-esm/lib/utils/sync/LocalIndexedDb.mjs +32 -25
- package/dist-esm/lib/utils/sync/LocalIndexedDb.mjs.map +2 -2
- package/dist-esm/lib/utils/sync/TLLocalSyncClient.mjs +89 -41
- package/dist-esm/lib/utils/sync/TLLocalSyncClient.mjs.map +2 -2
- package/dist-esm/version.mjs +3 -3
- package/dist-esm/version.mjs.map +1 -1
- package/editor.css +9 -1
- package/package.json +18 -23
- package/src/index.ts +5 -1
- package/src/lib/TldrawEditor.tsx +35 -21
- package/src/lib/components/MenuClickCapture.tsx +55 -4
- package/src/lib/components/default-components/DefaultCanvas.tsx +7 -1
- package/src/lib/components/default-components/DefaultErrorFallback.tsx +13 -5
- package/src/lib/components/default-components/DefaultSpinner.tsx +4 -1
- package/src/lib/editor/Editor.test.ts +65 -0
- package/src/lib/editor/Editor.ts +299 -303
- package/src/lib/editor/derivations/bindingsIndex.ts +3 -0
- package/src/lib/editor/managers/ClickManager/ClickManager.test.ts +1 -0
- package/src/lib/editor/managers/ClickManager/ClickManager.ts +3 -2
- package/src/lib/editor/managers/EditorManager.test.ts +32 -1
- package/src/lib/editor/managers/EditorManager.ts +15 -3
- package/src/lib/editor/managers/PerformanceManager/PerformanceManager.test.ts +80 -0
- package/src/lib/editor/managers/PerformanceManager/PerformanceManager.ts +54 -81
- package/src/lib/editor/managers/ScribbleManager/ScribbleManager.ts +1 -1
- package/src/lib/editor/managers/SnapManager/BoundsSnaps.ts +32 -36
- package/src/lib/editor/managers/SnapManager/HandleSnaps.ts +13 -2
- package/src/lib/editor/managers/SnapManager/SnapManager.test.ts +13 -0
- package/src/lib/editor/managers/SnapManager/SnapManager.ts +6 -4
- package/src/lib/editor/managers/TextManager/TextManager.test.ts +74 -0
- package/src/lib/editor/managers/TextManager/TextManager.ts +6 -5
- package/src/lib/editor/shapes/group/GroupShapeUtil.tsx +23 -8
- package/src/lib/editor/shapes/shared/resizeBox.ts +21 -16
- package/src/lib/editor/types/external-content.ts +5 -0
- package/src/lib/exports/ExportDelay.tsx +16 -4
- package/src/lib/exports/FontEmbedder.test.ts +99 -0
- package/src/lib/exports/FontEmbedder.ts +32 -11
- package/src/lib/exports/StyleEmbedder.ts +13 -4
- package/src/lib/exports/fetchCache.test.ts +22 -0
- package/src/lib/exports/fetchCache.ts +4 -0
- package/src/lib/exports/getSvgAsImage.ts +13 -5
- package/src/lib/exports/getSvgJsx.test.ts +43 -1
- package/src/lib/exports/getSvgJsx.tsx +28 -16
- package/src/lib/exports/parseCss.test.ts +4 -0
- package/src/lib/exports/parseCss.ts +2 -2
- package/src/lib/hooks/EditorComponentsContext.tsx +2 -1
- package/src/lib/hooks/useCanvasEvents.ts +42 -0
- package/src/lib/hooks/useCursor.ts +14 -7
- package/src/lib/hooks/useIdentity.tsx +12 -1
- package/src/lib/license/LicenseManager.ts +13 -1
- package/src/lib/license/LicenseProvider.test.tsx +76 -0
- package/src/lib/license/LicenseProvider.tsx +19 -5
- package/src/lib/test/preserveFocus.test.tsx +81 -0
- package/src/lib/test/useCursor.test.tsx +36 -0
- package/src/lib/utils/debug-flags.ts +0 -6
- package/src/lib/utils/deepLinks.test.ts +15 -0
- package/src/lib/utils/deepLinks.ts +8 -3
- package/src/lib/utils/sync/LocalIndexedDb.test.ts +121 -1
- package/src/lib/utils/sync/LocalIndexedDb.ts +41 -28
- package/src/lib/utils/sync/TLLocalSyncClient.test.ts +330 -1
- package/src/lib/utils/sync/TLLocalSyncClient.ts +129 -55
- package/src/version.ts +3 -3
- package/dist-cjs/lib/primitives/geometry/geometry.bench.js +0 -133
- package/dist-cjs/lib/primitives/geometry/geometry.bench.js.map +0 -7
- package/dist-esm/lib/primitives/geometry/geometry.bench.mjs +0 -132
- package/dist-esm/lib/primitives/geometry/geometry.bench.mjs.map +0 -7
- package/src/lib/primitives/geometry/geometry.bench.ts +0 -179
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { Signal, transact } from '@tldraw/state'
|
|
2
2
|
import { RecordsDiff, SerializedSchema, UnknownRecord, squashRecordDiffs } from '@tldraw/store'
|
|
3
3
|
import { TLStore } from '@tldraw/tlschema'
|
|
4
|
-
import { assert } from '@tldraw/utils'
|
|
4
|
+
import { assert, noop } from '@tldraw/utils'
|
|
5
5
|
import {
|
|
6
6
|
TAB_ID,
|
|
7
7
|
TLSessionStateSnapshot,
|
|
@@ -9,6 +9,7 @@ import {
|
|
|
9
9
|
extractSessionStateFromLegacySnapshot,
|
|
10
10
|
loadSessionStateSnapshotIntoStore,
|
|
11
11
|
} from '../../config/TLSessionStateSnapshot'
|
|
12
|
+
import { refreshPage } from '../runtime'
|
|
12
13
|
import { showCantReadFromIndexDbAlert, showCantWriteToIndexDbAlert } from './alerts'
|
|
13
14
|
import { LocalIndexedDb } from './LocalIndexedDb'
|
|
14
15
|
|
|
@@ -63,6 +64,9 @@ export class BroadcastChannelMock {
|
|
|
63
64
|
|
|
64
65
|
const BC = typeof BroadcastChannel === 'undefined' ? BroadcastChannelMock : BroadcastChannel
|
|
65
66
|
|
|
67
|
+
// Flushes still running for closed clients, by key. See connect() and close().
|
|
68
|
+
const pendingFlushes = new Map<string, Promise<void>>()
|
|
69
|
+
|
|
66
70
|
/** @internal */
|
|
67
71
|
export class TLLocalSyncClient {
|
|
68
72
|
private disposables = new Set<() => void>()
|
|
@@ -108,7 +112,6 @@ export class TLLocalSyncClient {
|
|
|
108
112
|
this.persistenceKey = persistenceKey
|
|
109
113
|
this.sessionId = sessionId
|
|
110
114
|
this.db = new LocalIndexedDb(persistenceKey)
|
|
111
|
-
this.disposables.add(() => this.db.close())
|
|
112
115
|
|
|
113
116
|
this.serializedSchema = this.store.schema.serialize()
|
|
114
117
|
this.$sessionStateSnapshot = createSessionStateSnapshotSignal(this.store)
|
|
@@ -179,6 +182,70 @@ export class TLLocalSyncClient {
|
|
|
179
182
|
this.debug('connecting')
|
|
180
183
|
let data: UnpackPromise<ReturnType<LocalIndexedDb['load']>> | undefined
|
|
181
184
|
|
|
185
|
+
const handleMessage = (msg: Message) => {
|
|
186
|
+
// if their schema is earlier than ours, we need to tell them so they can refresh
|
|
187
|
+
// if their schema is later than ours, we need to refresh
|
|
188
|
+
const res = this.store.schema.getMigrationsSince(msg.schema)
|
|
189
|
+
|
|
190
|
+
if (!res.ok) {
|
|
191
|
+
this.isReloading = true
|
|
192
|
+
// we are older, refresh
|
|
193
|
+
// but add a safety check to make sure we don't get in an infinite loop
|
|
194
|
+
const timeSinceInit = Date.now() - this.initTime
|
|
195
|
+
if (timeSinceInit < 5000) {
|
|
196
|
+
// This tab was just reloaded, but is out of date compared to other tabs.
|
|
197
|
+
// Not expecting this to ever happen. It should only happen if we roll back a release that incremented
|
|
198
|
+
// the schema version (which we should never do)
|
|
199
|
+
// Or maybe during development if you have multiple local tabs open running the app on prod mode and you
|
|
200
|
+
// check out an older commit. Dev server should be fine.
|
|
201
|
+
onLoadError(new Error('Schema mismatch, please close other tabs and reload the page'))
|
|
202
|
+
return false
|
|
203
|
+
}
|
|
204
|
+
this.debug('reloading')
|
|
205
|
+
if (typeof window !== 'undefined') refreshPage()
|
|
206
|
+
return false
|
|
207
|
+
} else if (res.value.length > 0) {
|
|
208
|
+
// they are older, tell them to refresh and not write any more data
|
|
209
|
+
this.debug('telling them to reload')
|
|
210
|
+
this.channel.postMessage({ type: 'announce', schema: this.serializedSchema })
|
|
211
|
+
// schedule a full db write in case they wrote data anyway
|
|
212
|
+
this.shouldDoFullDBWrite = true
|
|
213
|
+
this.schedulePersist()
|
|
214
|
+
return true
|
|
215
|
+
}
|
|
216
|
+
// otherwise, all good, same version :)
|
|
217
|
+
if (msg.type === 'diff') {
|
|
218
|
+
this.debug('applying diff')
|
|
219
|
+
transact(() => {
|
|
220
|
+
this.store.mergeRemoteChanges(() => {
|
|
221
|
+
this.store.applyDiff(msg.changes as any)
|
|
222
|
+
})
|
|
223
|
+
})
|
|
224
|
+
}
|
|
225
|
+
return true
|
|
226
|
+
}
|
|
227
|
+
|
|
228
|
+
// Listen from the start and buffer until we've loaded: diffs other tabs broadcast while
|
|
229
|
+
// we're still reading from IndexedDB would otherwise be dropped, then erased by our first
|
|
230
|
+
// (full) db write.
|
|
231
|
+
let bufferedMessages: Message[] | null = []
|
|
232
|
+
this.channel.onmessage = ({ data }) => {
|
|
233
|
+
this.debug('got message', data)
|
|
234
|
+
if (bufferedMessages) {
|
|
235
|
+
bufferedMessages.push(data as Message)
|
|
236
|
+
} else {
|
|
237
|
+
handleMessage(data as Message)
|
|
238
|
+
}
|
|
239
|
+
}
|
|
240
|
+
this.disposables.add(() => {
|
|
241
|
+
this.channel.close()
|
|
242
|
+
})
|
|
243
|
+
|
|
244
|
+
// our first write is a full snapshot, so it would erase whatever a client that just closed
|
|
245
|
+
// on this key is still flushing
|
|
246
|
+
await pendingFlushes.get(this.persistenceKey)
|
|
247
|
+
if (this.didDispose) return
|
|
248
|
+
|
|
182
249
|
try {
|
|
183
250
|
data = await this.db.load({ sessionId: this.sessionId })
|
|
184
251
|
} catch (error: any) {
|
|
@@ -224,56 +291,24 @@ export class TLLocalSyncClient {
|
|
|
224
291
|
})
|
|
225
292
|
}
|
|
226
293
|
}
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
const res = this.store.schema.getMigrationsSince(msg.schema)
|
|
234
|
-
|
|
235
|
-
if (!res.ok) {
|
|
236
|
-
// we are older, refresh
|
|
237
|
-
// but add a safety check to make sure we don't get in an infinite loop
|
|
238
|
-
const timeSinceInit = Date.now() - this.initTime
|
|
239
|
-
if (timeSinceInit < 5000) {
|
|
240
|
-
// This tab was just reloaded, but is out of date compared to other tabs.
|
|
241
|
-
// Not expecting this to ever happen. It should only happen if we roll back a release that incremented
|
|
242
|
-
// the schema version (which we should never do)
|
|
243
|
-
// Or maybe during development if you have multiple local tabs open running the app on prod mode and you
|
|
244
|
-
// check out an older commit. Dev server should be fine.
|
|
245
|
-
onLoadError(new Error('Schema mismatch, please close other tabs and reload the page'))
|
|
246
|
-
return
|
|
247
|
-
}
|
|
248
|
-
this.debug('reloading')
|
|
249
|
-
this.isReloading = true
|
|
250
|
-
window?.location?.reload?.()
|
|
251
|
-
return
|
|
252
|
-
} else if (res.value.length > 0) {
|
|
253
|
-
// they are older, tell them to refresh and not write any more data
|
|
254
|
-
this.debug('telling them to reload')
|
|
255
|
-
this.channel.postMessage({ type: 'announce', schema: this.serializedSchema })
|
|
256
|
-
// schedule a full db write in case they wrote data anyway
|
|
257
|
-
this.shouldDoFullDBWrite = true
|
|
258
|
-
this.persistIfNeeded()
|
|
259
|
-
return
|
|
260
|
-
}
|
|
261
|
-
// otherwise, all good, same version :)
|
|
262
|
-
if (msg.type === 'diff') {
|
|
263
|
-
this.debug('applying diff')
|
|
264
|
-
transact(() => {
|
|
265
|
-
this.store.mergeRemoteChanges(() => {
|
|
266
|
-
this.store.applyDiff(msg.changes as any)
|
|
267
|
-
})
|
|
268
|
-
})
|
|
269
|
-
}
|
|
294
|
+
// Older-schema announcements schedule writes, so drain every diff before those writes
|
|
295
|
+
// or an onLoad callback that immediately closes the client can capture a snapshot.
|
|
296
|
+
const messages = bufferedMessages
|
|
297
|
+
bufferedMessages = null
|
|
298
|
+
for (const message of messages) {
|
|
299
|
+
if (!handleMessage(message)) return
|
|
270
300
|
}
|
|
271
|
-
this.channel.postMessage({ type: 'announce', schema: this.serializedSchema })
|
|
272
|
-
this.disposables.add(() => {
|
|
273
|
-
this.channel.close()
|
|
274
|
-
})
|
|
275
301
|
this.didLoad = true
|
|
302
|
+
if (this.diffQueue.length > 0) this.schedulePersist()
|
|
303
|
+
|
|
304
|
+
this.channel.postMessage({ type: 'announce', schema: this.serializedSchema })
|
|
276
305
|
onLoad(this)
|
|
306
|
+
|
|
307
|
+
// Session state rows accumulate one per tab, so trim them on load. Pruning is best-effort
|
|
308
|
+
// and must never turn a successful load into a failure.
|
|
309
|
+
this.db.pruneSessions({ keepSessionId: this.sessionId }).catch((e: unknown) => {
|
|
310
|
+
this.debug('failed to prune session state rows', e)
|
|
311
|
+
})
|
|
277
312
|
} catch (e: any) {
|
|
278
313
|
this.debug('error loading data from store', e)
|
|
279
314
|
if (this.didDispose) return
|
|
@@ -283,15 +318,51 @@ export class TLLocalSyncClient {
|
|
|
283
318
|
}
|
|
284
319
|
|
|
285
320
|
close() {
|
|
321
|
+
if (this.didDispose) return
|
|
286
322
|
this.debug('closing')
|
|
287
323
|
this.didDispose = true
|
|
288
324
|
this.disposables.forEach((d) => d())
|
|
325
|
+
if (this.scheduledPersistTimeout) {
|
|
326
|
+
clearTimeout(this.scheduledPersistTimeout)
|
|
327
|
+
this.scheduledPersistTimeout = null
|
|
328
|
+
}
|
|
289
329
|
if (typeof window !== 'undefined' && (window as any).tlsync === this) {
|
|
290
330
|
delete (window as any).tlsync
|
|
291
331
|
}
|
|
332
|
+
// flush now when the key is idle: close() runs during teardown, where a deferred write may
|
|
333
|
+
// never run. wait when it isn't, or our snapshot lands first and gets overwritten.
|
|
334
|
+
// connect() awaits this, so it must never reject
|
|
335
|
+
const previous = pendingFlushes.get(this.persistenceKey)
|
|
336
|
+
const flush = (previous ? previous.then(() => this.flushAndCloseDb()) : this.flushAndCloseDb())
|
|
337
|
+
.catch(noop)
|
|
338
|
+
.then(() => {
|
|
339
|
+
if (pendingFlushes.get(this.persistenceKey) === flush) {
|
|
340
|
+
pendingFlushes.delete(this.persistenceKey)
|
|
341
|
+
}
|
|
342
|
+
})
|
|
343
|
+
pendingFlushes.set(this.persistenceKey, flush)
|
|
344
|
+
}
|
|
345
|
+
|
|
346
|
+
/**
|
|
347
|
+
* Flush queued changes so edits made in the last PERSIST_THROTTLE_MS before unmount aren't lost,
|
|
348
|
+
* then close the db. Never flushes before load (a full write then would wipe the db with an empty
|
|
349
|
+
* store), and only when something is queued: shouldDoFullDBWrite stays true until the first
|
|
350
|
+
* persist, so an unconditional flush would rewrite the whole document on every no-op close.
|
|
351
|
+
*/
|
|
352
|
+
private flushAndCloseDb(): Promise<void> {
|
|
353
|
+
// A persist in flight can't be joined (persistIfNeeded bails while one is running) and,
|
|
354
|
+
// now that we're disposed, won't schedule a follow-up. Edits queued during that write
|
|
355
|
+
// would be lost if the db closed now, so wait for it and flush again.
|
|
356
|
+
if (this.persistPromise) {
|
|
357
|
+
return this.persistPromise.then(() => this.flushAndCloseDb())
|
|
358
|
+
}
|
|
359
|
+
if (this.didLoad && this.diffQueue.length > 0) this.persistIfNeeded()
|
|
360
|
+
// the db waits for the transaction the flush just opened before actually closing
|
|
361
|
+
return this.db.close()
|
|
292
362
|
}
|
|
293
363
|
|
|
294
364
|
private isPersisting = false
|
|
365
|
+
private persistPromise: Promise<void> | null = null
|
|
295
366
|
private didLastWriteError = false
|
|
296
367
|
// eslint-disable-next-line no-restricted-globals
|
|
297
368
|
private scheduledPersistTimeout: ReturnType<typeof setTimeout> | null = null
|
|
@@ -305,6 +376,8 @@ export class TLLocalSyncClient {
|
|
|
305
376
|
private schedulePersist() {
|
|
306
377
|
this.debug('schedulePersist', this.scheduledPersistTimeout)
|
|
307
378
|
if (this.scheduledPersistTimeout) return
|
|
379
|
+
// A deferred persist would try to write to a database that is closing or already closed.
|
|
380
|
+
if (this.didDispose) return
|
|
308
381
|
// eslint-disable-next-line no-restricted-globals
|
|
309
382
|
this.scheduledPersistTimeout = setTimeout(
|
|
310
383
|
() => {
|
|
@@ -339,6 +412,8 @@ export class TLLocalSyncClient {
|
|
|
339
412
|
this.scheduledPersistTimeout = null
|
|
340
413
|
}
|
|
341
414
|
|
|
415
|
+
if (!this.didLoad) return
|
|
416
|
+
|
|
342
417
|
// if a persist is already in progress, we don't need to do anything -
|
|
343
418
|
// if there are still outstanding changes once it's finished, it'll
|
|
344
419
|
// schedule another persist
|
|
@@ -353,7 +428,7 @@ export class TLLocalSyncClient {
|
|
|
353
428
|
|
|
354
429
|
// if we're scheduled for a full write or if we have changes outstanding, let's persist them!
|
|
355
430
|
if (this.shouldDoFullDBWrite || this.diffQueue.length > 0) {
|
|
356
|
-
this.doPersist()
|
|
431
|
+
this.persistPromise = this.doPersist()
|
|
357
432
|
}
|
|
358
433
|
}
|
|
359
434
|
|
|
@@ -363,7 +438,6 @@ export class TLLocalSyncClient {
|
|
|
363
438
|
*/
|
|
364
439
|
private async doPersist() {
|
|
365
440
|
assert(!this.isPersisting, 'persist already in progress')
|
|
366
|
-
if (this.didDispose) return
|
|
367
441
|
this.isPersisting = true
|
|
368
442
|
|
|
369
443
|
this.debug('doPersist start')
|
|
@@ -401,14 +475,14 @@ export class TLLocalSyncClient {
|
|
|
401
475
|
this.didLastWriteError = true
|
|
402
476
|
console.error('failed to store changes in indexed db', e)
|
|
403
477
|
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
window.location.reload()
|
|
478
|
+
if (!this.didDispose && typeof window !== 'undefined') {
|
|
479
|
+
showCantWriteToIndexDbAlert()
|
|
480
|
+
refreshPage()
|
|
408
481
|
}
|
|
409
482
|
}
|
|
410
483
|
|
|
411
484
|
this.isPersisting = false
|
|
485
|
+
this.persistPromise = null
|
|
412
486
|
this.debug('doPersist end')
|
|
413
487
|
|
|
414
488
|
// changes might have come in between when we started the persist and
|
package/src/version.ts
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
// This file is automatically generated by internal/scripts/refresh-assets.ts.
|
|
2
2
|
// Do not edit manually. Or do, I'm a comment, not a cop.
|
|
3
3
|
|
|
4
|
-
export const version = '5.
|
|
4
|
+
export const version = '5.6.0-canary.5bfc37740468'
|
|
5
5
|
export const publishDates = {
|
|
6
6
|
major: '2026-05-06T16:28:18.473Z',
|
|
7
|
-
minor: '2026-09-
|
|
8
|
-
patch: '2026-09-
|
|
7
|
+
minor: '2026-09-30T16:28:13.830Z',
|
|
8
|
+
patch: '2026-09-30T16:28:13.830Z',
|
|
9
9
|
}
|
|
@@ -1,133 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var import_vitest = require("vitest");
|
|
3
|
-
var import_Vec = require("../Vec");
|
|
4
|
-
var import_Arc2d = require("./Arc2d");
|
|
5
|
-
var import_Circle2d = require("./Circle2d");
|
|
6
|
-
var import_Edge2d = require("./Edge2d");
|
|
7
|
-
var import_Polyline2d = require("./Polyline2d");
|
|
8
|
-
var import_Rectangle2d = require("./Rectangle2d");
|
|
9
|
-
var import_intersect = require("../intersect");
|
|
10
|
-
const lsA = new import_Vec.Vec(0, 0);
|
|
11
|
-
const lsB = new import_Vec.Vec(100, 50);
|
|
12
|
-
const lsP = new import_Vec.Vec(30, 60);
|
|
13
|
-
(0, import_vitest.describe)("Vec line segment", () => {
|
|
14
|
-
(0, import_vitest.bench)("NearestPointOnLineSegment", () => {
|
|
15
|
-
import_Vec.Vec.NearestPointOnLineSegment(lsA, lsB, lsP, true);
|
|
16
|
-
});
|
|
17
|
-
(0, import_vitest.bench)("DistanceToLineSegment", () => {
|
|
18
|
-
import_Vec.Vec.DistanceToLineSegment(lsA, lsB, lsP, true);
|
|
19
|
-
});
|
|
20
|
-
});
|
|
21
|
-
const vecA = new import_Vec.Vec(3, 4);
|
|
22
|
-
const vecB = new import_Vec.Vec(-1, 2);
|
|
23
|
-
const lineOrigin = new import_Vec.Vec(10, 10);
|
|
24
|
-
const lineDir = new import_Vec.Vec(0.7071, 0.7071);
|
|
25
|
-
const lineTestP = new import_Vec.Vec(20, 15);
|
|
26
|
-
(0, import_vitest.describe)("Vec utilities", () => {
|
|
27
|
-
(0, import_vitest.bench)("Lrp", () => {
|
|
28
|
-
import_Vec.Vec.Lrp(lsA, lsB, 0.35);
|
|
29
|
-
});
|
|
30
|
-
(0, import_vitest.bench)("AngleBetween", () => {
|
|
31
|
-
import_Vec.Vec.AngleBetween(vecA, vecB);
|
|
32
|
-
});
|
|
33
|
-
(0, import_vitest.bench)("NearestPointOnLineThroughPoint", () => {
|
|
34
|
-
import_Vec.Vec.NearestPointOnLineThroughPoint(lineOrigin, lineDir, lineTestP);
|
|
35
|
-
});
|
|
36
|
-
(0, import_vitest.bench)("DistanceToLineThroughPoint", () => {
|
|
37
|
-
import_Vec.Vec.DistanceToLineThroughPoint(lineOrigin, lineDir, lineTestP);
|
|
38
|
-
});
|
|
39
|
-
});
|
|
40
|
-
const intA1 = new import_Vec.Vec(0, 0);
|
|
41
|
-
const intA2 = new import_Vec.Vec(100, 100);
|
|
42
|
-
const intB1 = new import_Vec.Vec(100, 0);
|
|
43
|
-
const intB2 = new import_Vec.Vec(0, 100);
|
|
44
|
-
const intB1Miss = new import_Vec.Vec(200, 0);
|
|
45
|
-
const intB2Miss = new import_Vec.Vec(200, 100);
|
|
46
|
-
const intCenter = new import_Vec.Vec(50, 50);
|
|
47
|
-
(0, import_vitest.describe)("Intersections", () => {
|
|
48
|
-
(0, import_vitest.bench)("lineSegment-lineSegment (hit)", () => {
|
|
49
|
-
(0, import_intersect.intersectLineSegmentLineSegment)(intA1, intA2, intB1, intB2);
|
|
50
|
-
});
|
|
51
|
-
(0, import_vitest.bench)("lineSegment-lineSegment (miss)", () => {
|
|
52
|
-
(0, import_intersect.intersectLineSegmentLineSegment)(intA1, intA2, intB1Miss, intB2Miss);
|
|
53
|
-
});
|
|
54
|
-
(0, import_vitest.bench)("lineSegment-circle (hit)", () => {
|
|
55
|
-
(0, import_intersect.intersectLineSegmentCircle)(intA1, intA2, intCenter, 30);
|
|
56
|
-
});
|
|
57
|
-
(0, import_vitest.bench)("lineSegment-circle (miss)", () => {
|
|
58
|
-
(0, import_intersect.intersectLineSegmentCircle)(intA1, intA2, intCenter, 5);
|
|
59
|
-
});
|
|
60
|
-
});
|
|
61
|
-
const edge = new import_Edge2d.Edge2d({ start: new import_Vec.Vec(0, 0), end: new import_Vec.Vec(100, 50) });
|
|
62
|
-
const edgePoint = new import_Vec.Vec(30, 60);
|
|
63
|
-
(0, import_vitest.describe)("Edge2d", () => {
|
|
64
|
-
(0, import_vitest.bench)("nearestPoint", () => {
|
|
65
|
-
edge.nearestPoint(edgePoint);
|
|
66
|
-
});
|
|
67
|
-
(0, import_vitest.bench)("distanceToPoint", () => {
|
|
68
|
-
edge.distanceToPoint(edgePoint);
|
|
69
|
-
});
|
|
70
|
-
});
|
|
71
|
-
const circle = new import_Circle2d.Circle2d({ radius: 50, isFilled: true });
|
|
72
|
-
const circlePoint = new import_Vec.Vec(80, 60);
|
|
73
|
-
const circlePointInside = new import_Vec.Vec(50, 50);
|
|
74
|
-
(0, import_vitest.describe)("Circle2d", () => {
|
|
75
|
-
(0, import_vitest.bench)("nearestPoint", () => {
|
|
76
|
-
circle.nearestPoint(circlePoint);
|
|
77
|
-
});
|
|
78
|
-
(0, import_vitest.bench)("distanceToPoint", () => {
|
|
79
|
-
circle.distanceToPoint(circlePoint);
|
|
80
|
-
});
|
|
81
|
-
(0, import_vitest.bench)("hitTestPoint (outside)", () => {
|
|
82
|
-
circle.hitTestPoint(circlePoint, 5);
|
|
83
|
-
});
|
|
84
|
-
(0, import_vitest.bench)("hitTestPoint (inside)", () => {
|
|
85
|
-
circle.hitTestPoint(circlePointInside, 5, true);
|
|
86
|
-
});
|
|
87
|
-
});
|
|
88
|
-
const arc = new import_Arc2d.Arc2d({
|
|
89
|
-
center: new import_Vec.Vec(50, 50),
|
|
90
|
-
start: new import_Vec.Vec(100, 50),
|
|
91
|
-
end: new import_Vec.Vec(50, 100),
|
|
92
|
-
sweepFlag: 1,
|
|
93
|
-
largeArcFlag: 0
|
|
94
|
-
});
|
|
95
|
-
const arcPoint = new import_Vec.Vec(90, 90);
|
|
96
|
-
(0, import_vitest.describe)("Arc2d", () => {
|
|
97
|
-
(0, import_vitest.bench)("nearestPoint", () => {
|
|
98
|
-
arc.nearestPoint(arcPoint);
|
|
99
|
-
});
|
|
100
|
-
});
|
|
101
|
-
const polyPoints = [];
|
|
102
|
-
for (let i = 0; i <= 20; i++) {
|
|
103
|
-
const t = i / 20;
|
|
104
|
-
polyPoints.push(new import_Vec.Vec(t * 200, Math.sin(t * Math.PI * 2) * 50 + 50));
|
|
105
|
-
}
|
|
106
|
-
const polyline = new import_Polyline2d.Polyline2d({ points: polyPoints });
|
|
107
|
-
const polyPoint = new import_Vec.Vec(100, 80);
|
|
108
|
-
(0, import_vitest.describe)("Polyline2d", () => {
|
|
109
|
-
(0, import_vitest.bench)("nearestPoint", () => {
|
|
110
|
-
polyline.nearestPoint(polyPoint);
|
|
111
|
-
});
|
|
112
|
-
(0, import_vitest.bench)("distanceToPoint", () => {
|
|
113
|
-
polyline.distanceToPoint(polyPoint);
|
|
114
|
-
});
|
|
115
|
-
});
|
|
116
|
-
const rect = new import_Rectangle2d.Rectangle2d({ width: 100, height: 80, isFilled: true });
|
|
117
|
-
const rectPointOutside = new import_Vec.Vec(120, 40);
|
|
118
|
-
const rectPointInside = new import_Vec.Vec(50, 40);
|
|
119
|
-
(0, import_vitest.describe)("Rectangle2d (Geometry2d)", () => {
|
|
120
|
-
(0, import_vitest.bench)("hitTestPoint (outside)", () => {
|
|
121
|
-
rect.hitTestPoint(rectPointOutside, 5);
|
|
122
|
-
});
|
|
123
|
-
(0, import_vitest.bench)("hitTestPoint (inside)", () => {
|
|
124
|
-
rect.hitTestPoint(rectPointInside, 5, true);
|
|
125
|
-
});
|
|
126
|
-
(0, import_vitest.bench)("distanceToPoint (outside)", () => {
|
|
127
|
-
rect.distanceToPoint(rectPointOutside);
|
|
128
|
-
});
|
|
129
|
-
(0, import_vitest.bench)("distanceToPoint (inside)", () => {
|
|
130
|
-
rect.distanceToPoint(rectPointInside, true);
|
|
131
|
-
});
|
|
132
|
-
});
|
|
133
|
-
//# sourceMappingURL=geometry.bench.js.map
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../../../../src/lib/primitives/geometry/geometry.bench.ts"],
|
|
4
|
-
"sourcesContent": ["import { bench, describe } from 'vitest'\nimport { Vec } from '../Vec'\nimport { Arc2d } from './Arc2d'\nimport { Circle2d } from './Circle2d'\nimport { Edge2d } from './Edge2d'\nimport { Polyline2d } from './Polyline2d'\nimport { Rectangle2d } from './Rectangle2d'\n\n// --- Vec line segment utilities ---\n\nconst lsA = new Vec(0, 0)\nconst lsB = new Vec(100, 50)\nconst lsP = new Vec(30, 60)\n\ndescribe('Vec line segment', () => {\n\tbench('NearestPointOnLineSegment', () => {\n\t\tVec.NearestPointOnLineSegment(lsA, lsB, lsP, true)\n\t})\n\n\tbench('DistanceToLineSegment', () => {\n\t\tVec.DistanceToLineSegment(lsA, lsB, lsP, true)\n\t})\n})\n\n// --- Vec utilities ---\n\nconst vecA = new Vec(3, 4)\nconst vecB = new Vec(-1, 2)\nconst lineOrigin = new Vec(10, 10)\nconst lineDir = new Vec(0.7071, 0.7071) // ~unit vector at 45\u00B0\nconst lineTestP = new Vec(20, 15)\n\ndescribe('Vec utilities', () => {\n\tbench('Lrp', () => {\n\t\tVec.Lrp(lsA, lsB, 0.35)\n\t})\n\n\tbench('AngleBetween', () => {\n\t\tVec.AngleBetween(vecA, vecB)\n\t})\n\n\tbench('NearestPointOnLineThroughPoint', () => {\n\t\tVec.NearestPointOnLineThroughPoint(lineOrigin, lineDir, lineTestP)\n\t})\n\n\tbench('DistanceToLineThroughPoint', () => {\n\t\tVec.DistanceToLineThroughPoint(lineOrigin, lineDir, lineTestP)\n\t})\n})\n\n// --- Intersections ---\n\nimport { intersectLineSegmentCircle, intersectLineSegmentLineSegment } from '../intersect'\n\nconst intA1 = new Vec(0, 0)\nconst intA2 = new Vec(100, 100)\nconst intB1 = new Vec(100, 0)\nconst intB2 = new Vec(0, 100)\nconst intB1Miss = new Vec(200, 0)\nconst intB2Miss = new Vec(200, 100)\nconst intCenter = new Vec(50, 50)\n\ndescribe('Intersections', () => {\n\tbench('lineSegment-lineSegment (hit)', () => {\n\t\tintersectLineSegmentLineSegment(intA1, intA2, intB1, intB2)\n\t})\n\n\tbench('lineSegment-lineSegment (miss)', () => {\n\t\tintersectLineSegmentLineSegment(intA1, intA2, intB1Miss, intB2Miss)\n\t})\n\n\tbench('lineSegment-circle (hit)', () => {\n\t\tintersectLineSegmentCircle(intA1, intA2, intCenter, 30)\n\t})\n\n\tbench('lineSegment-circle (miss)', () => {\n\t\tintersectLineSegmentCircle(intA1, intA2, intCenter, 5)\n\t})\n})\n\n// --- Edge2d ---\n\nconst edge = new Edge2d({ start: new Vec(0, 0), end: new Vec(100, 50) })\nconst edgePoint = new Vec(30, 60)\n\ndescribe('Edge2d', () => {\n\tbench('nearestPoint', () => {\n\t\tedge.nearestPoint(edgePoint)\n\t})\n\n\tbench('distanceToPoint', () => {\n\t\tedge.distanceToPoint(edgePoint)\n\t})\n})\n\n// --- Circle2d ---\n\nconst circle = new Circle2d({ radius: 50, isFilled: true })\nconst circlePoint = new Vec(80, 60)\nconst circlePointInside = new Vec(50, 50)\n\ndescribe('Circle2d', () => {\n\tbench('nearestPoint', () => {\n\t\tcircle.nearestPoint(circlePoint)\n\t})\n\n\tbench('distanceToPoint', () => {\n\t\tcircle.distanceToPoint(circlePoint)\n\t})\n\n\tbench('hitTestPoint (outside)', () => {\n\t\tcircle.hitTestPoint(circlePoint, 5)\n\t})\n\n\tbench('hitTestPoint (inside)', () => {\n\t\tcircle.hitTestPoint(circlePointInside, 5, true)\n\t})\n})\n\n// --- Arc2d ---\n\nconst arc = new Arc2d({\n\tcenter: new Vec(50, 50),\n\tstart: new Vec(100, 50),\n\tend: new Vec(50, 100),\n\tsweepFlag: 1,\n\tlargeArcFlag: 0,\n})\nconst arcPoint = new Vec(90, 90)\n\ndescribe('Arc2d', () => {\n\tbench('nearestPoint', () => {\n\t\tarc.nearestPoint(arcPoint)\n\t})\n})\n\n// --- Polyline2d (20 segments) ---\n\nconst polyPoints: Vec[] = []\nfor (let i = 0; i <= 20; i++) {\n\tconst t = i / 20\n\tpolyPoints.push(new Vec(t * 200, Math.sin(t * Math.PI * 2) * 50 + 50))\n}\nconst polyline = new Polyline2d({ points: polyPoints })\nconst polyPoint = new Vec(100, 80)\n\ndescribe('Polyline2d', () => {\n\tbench('nearestPoint', () => {\n\t\tpolyline.nearestPoint(polyPoint)\n\t})\n\n\tbench('distanceToPoint', () => {\n\t\tpolyline.distanceToPoint(polyPoint)\n\t})\n})\n\n// --- Rectangle2d (Geometry2d base) ---\n\nconst rect = new Rectangle2d({ width: 100, height: 80, isFilled: true })\nconst rectPointOutside = new Vec(120, 40)\nconst rectPointInside = new Vec(50, 40)\n\ndescribe('Rectangle2d (Geometry2d)', () => {\n\tbench('hitTestPoint (outside)', () => {\n\t\trect.hitTestPoint(rectPointOutside, 5)\n\t})\n\n\tbench('hitTestPoint (inside)', () => {\n\t\trect.hitTestPoint(rectPointInside, 5, true)\n\t})\n\n\tbench('distanceToPoint (outside)', () => {\n\t\trect.distanceToPoint(rectPointOutside)\n\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AI,IAAI,EAAE;AAAA,IAEtC,wBAAS,4BAA4B,MAAM;AAC1C,2BAAM,0BAA0B,MAAM;AACrC,SAAK,aAAa,kBAAkB,CAAC;AAAA,EACtC,CAAC;AAED,2BAAM,yBAAyB,MAAM;AACpC,SAAK,aAAa,iBAAiB,GAAG,IAAI;AAAA,EAC3C,CAAC;AAED,2BAAM,6BAA6B,MAAM;AACxC,SAAK,gBAAgB,gBAAgB;AAAA,EACtC,CAAC;AAED,2BAAM,4BAA4B,MAAM;AACvC,SAAK,gBAAgB,iBAAiB,IAAI;AAAA,EAC3C,CAAC;AACF,CAAC;",
|
|
6
|
-
"names": []
|
|
7
|
-
}
|
|
@@ -1,132 +0,0 @@
|
|
|
1
|
-
import { bench, describe } from "vitest";
|
|
2
|
-
import { Vec } from "../Vec.mjs";
|
|
3
|
-
import { Arc2d } from "./Arc2d.mjs";
|
|
4
|
-
import { Circle2d } from "./Circle2d.mjs";
|
|
5
|
-
import { Edge2d } from "./Edge2d.mjs";
|
|
6
|
-
import { Polyline2d } from "./Polyline2d.mjs";
|
|
7
|
-
import { Rectangle2d } from "./Rectangle2d.mjs";
|
|
8
|
-
const lsA = new Vec(0, 0);
|
|
9
|
-
const lsB = new Vec(100, 50);
|
|
10
|
-
const lsP = new Vec(30, 60);
|
|
11
|
-
describe("Vec line segment", () => {
|
|
12
|
-
bench("NearestPointOnLineSegment", () => {
|
|
13
|
-
Vec.NearestPointOnLineSegment(lsA, lsB, lsP, true);
|
|
14
|
-
});
|
|
15
|
-
bench("DistanceToLineSegment", () => {
|
|
16
|
-
Vec.DistanceToLineSegment(lsA, lsB, lsP, true);
|
|
17
|
-
});
|
|
18
|
-
});
|
|
19
|
-
const vecA = new Vec(3, 4);
|
|
20
|
-
const vecB = new Vec(-1, 2);
|
|
21
|
-
const lineOrigin = new Vec(10, 10);
|
|
22
|
-
const lineDir = new Vec(0.7071, 0.7071);
|
|
23
|
-
const lineTestP = new Vec(20, 15);
|
|
24
|
-
describe("Vec utilities", () => {
|
|
25
|
-
bench("Lrp", () => {
|
|
26
|
-
Vec.Lrp(lsA, lsB, 0.35);
|
|
27
|
-
});
|
|
28
|
-
bench("AngleBetween", () => {
|
|
29
|
-
Vec.AngleBetween(vecA, vecB);
|
|
30
|
-
});
|
|
31
|
-
bench("NearestPointOnLineThroughPoint", () => {
|
|
32
|
-
Vec.NearestPointOnLineThroughPoint(lineOrigin, lineDir, lineTestP);
|
|
33
|
-
});
|
|
34
|
-
bench("DistanceToLineThroughPoint", () => {
|
|
35
|
-
Vec.DistanceToLineThroughPoint(lineOrigin, lineDir, lineTestP);
|
|
36
|
-
});
|
|
37
|
-
});
|
|
38
|
-
import { intersectLineSegmentCircle, intersectLineSegmentLineSegment } from "../intersect.mjs";
|
|
39
|
-
const intA1 = new Vec(0, 0);
|
|
40
|
-
const intA2 = new Vec(100, 100);
|
|
41
|
-
const intB1 = new Vec(100, 0);
|
|
42
|
-
const intB2 = new Vec(0, 100);
|
|
43
|
-
const intB1Miss = new Vec(200, 0);
|
|
44
|
-
const intB2Miss = new Vec(200, 100);
|
|
45
|
-
const intCenter = new Vec(50, 50);
|
|
46
|
-
describe("Intersections", () => {
|
|
47
|
-
bench("lineSegment-lineSegment (hit)", () => {
|
|
48
|
-
intersectLineSegmentLineSegment(intA1, intA2, intB1, intB2);
|
|
49
|
-
});
|
|
50
|
-
bench("lineSegment-lineSegment (miss)", () => {
|
|
51
|
-
intersectLineSegmentLineSegment(intA1, intA2, intB1Miss, intB2Miss);
|
|
52
|
-
});
|
|
53
|
-
bench("lineSegment-circle (hit)", () => {
|
|
54
|
-
intersectLineSegmentCircle(intA1, intA2, intCenter, 30);
|
|
55
|
-
});
|
|
56
|
-
bench("lineSegment-circle (miss)", () => {
|
|
57
|
-
intersectLineSegmentCircle(intA1, intA2, intCenter, 5);
|
|
58
|
-
});
|
|
59
|
-
});
|
|
60
|
-
const edge = new Edge2d({ start: new Vec(0, 0), end: new Vec(100, 50) });
|
|
61
|
-
const edgePoint = new Vec(30, 60);
|
|
62
|
-
describe("Edge2d", () => {
|
|
63
|
-
bench("nearestPoint", () => {
|
|
64
|
-
edge.nearestPoint(edgePoint);
|
|
65
|
-
});
|
|
66
|
-
bench("distanceToPoint", () => {
|
|
67
|
-
edge.distanceToPoint(edgePoint);
|
|
68
|
-
});
|
|
69
|
-
});
|
|
70
|
-
const circle = new Circle2d({ radius: 50, isFilled: true });
|
|
71
|
-
const circlePoint = new Vec(80, 60);
|
|
72
|
-
const circlePointInside = new Vec(50, 50);
|
|
73
|
-
describe("Circle2d", () => {
|
|
74
|
-
bench("nearestPoint", () => {
|
|
75
|
-
circle.nearestPoint(circlePoint);
|
|
76
|
-
});
|
|
77
|
-
bench("distanceToPoint", () => {
|
|
78
|
-
circle.distanceToPoint(circlePoint);
|
|
79
|
-
});
|
|
80
|
-
bench("hitTestPoint (outside)", () => {
|
|
81
|
-
circle.hitTestPoint(circlePoint, 5);
|
|
82
|
-
});
|
|
83
|
-
bench("hitTestPoint (inside)", () => {
|
|
84
|
-
circle.hitTestPoint(circlePointInside, 5, true);
|
|
85
|
-
});
|
|
86
|
-
});
|
|
87
|
-
const arc = new Arc2d({
|
|
88
|
-
center: new Vec(50, 50),
|
|
89
|
-
start: new Vec(100, 50),
|
|
90
|
-
end: new Vec(50, 100),
|
|
91
|
-
sweepFlag: 1,
|
|
92
|
-
largeArcFlag: 0
|
|
93
|
-
});
|
|
94
|
-
const arcPoint = new Vec(90, 90);
|
|
95
|
-
describe("Arc2d", () => {
|
|
96
|
-
bench("nearestPoint", () => {
|
|
97
|
-
arc.nearestPoint(arcPoint);
|
|
98
|
-
});
|
|
99
|
-
});
|
|
100
|
-
const polyPoints = [];
|
|
101
|
-
for (let i = 0; i <= 20; i++) {
|
|
102
|
-
const t = i / 20;
|
|
103
|
-
polyPoints.push(new Vec(t * 200, Math.sin(t * Math.PI * 2) * 50 + 50));
|
|
104
|
-
}
|
|
105
|
-
const polyline = new Polyline2d({ points: polyPoints });
|
|
106
|
-
const polyPoint = new Vec(100, 80);
|
|
107
|
-
describe("Polyline2d", () => {
|
|
108
|
-
bench("nearestPoint", () => {
|
|
109
|
-
polyline.nearestPoint(polyPoint);
|
|
110
|
-
});
|
|
111
|
-
bench("distanceToPoint", () => {
|
|
112
|
-
polyline.distanceToPoint(polyPoint);
|
|
113
|
-
});
|
|
114
|
-
});
|
|
115
|
-
const rect = new Rectangle2d({ width: 100, height: 80, isFilled: true });
|
|
116
|
-
const rectPointOutside = new Vec(120, 40);
|
|
117
|
-
const rectPointInside = new Vec(50, 40);
|
|
118
|
-
describe("Rectangle2d (Geometry2d)", () => {
|
|
119
|
-
bench("hitTestPoint (outside)", () => {
|
|
120
|
-
rect.hitTestPoint(rectPointOutside, 5);
|
|
121
|
-
});
|
|
122
|
-
bench("hitTestPoint (inside)", () => {
|
|
123
|
-
rect.hitTestPoint(rectPointInside, 5, true);
|
|
124
|
-
});
|
|
125
|
-
bench("distanceToPoint (outside)", () => {
|
|
126
|
-
rect.distanceToPoint(rectPointOutside);
|
|
127
|
-
});
|
|
128
|
-
bench("distanceToPoint (inside)", () => {
|
|
129
|
-
rect.distanceToPoint(rectPointInside, true);
|
|
130
|
-
});
|
|
131
|
-
});
|
|
132
|
-
//# sourceMappingURL=geometry.bench.mjs.map
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../../../../src/lib/primitives/geometry/geometry.bench.ts"],
|
|
4
|
-
"sourcesContent": ["import { bench, describe } from 'vitest'\nimport { Vec } from '../Vec'\nimport { Arc2d } from './Arc2d'\nimport { Circle2d } from './Circle2d'\nimport { Edge2d } from './Edge2d'\nimport { Polyline2d } from './Polyline2d'\nimport { Rectangle2d } from './Rectangle2d'\n\n// --- Vec line segment utilities ---\n\nconst lsA = new Vec(0, 0)\nconst lsB = new Vec(100, 50)\nconst lsP = new Vec(30, 60)\n\ndescribe('Vec line segment', () => {\n\tbench('NearestPointOnLineSegment', () => {\n\t\tVec.NearestPointOnLineSegment(lsA, lsB, lsP, true)\n\t})\n\n\tbench('DistanceToLineSegment', () => {\n\t\tVec.DistanceToLineSegment(lsA, lsB, lsP, true)\n\t})\n})\n\n// --- Vec utilities ---\n\nconst vecA = new Vec(3, 4)\nconst vecB = new Vec(-1, 2)\nconst lineOrigin = new Vec(10, 10)\nconst lineDir = new Vec(0.7071, 0.7071) // ~unit vector at 45\u00B0\nconst lineTestP = new Vec(20, 15)\n\ndescribe('Vec utilities', () => {\n\tbench('Lrp', () => {\n\t\tVec.Lrp(lsA, lsB, 0.35)\n\t})\n\n\tbench('AngleBetween', () => {\n\t\tVec.AngleBetween(vecA, vecB)\n\t})\n\n\tbench('NearestPointOnLineThroughPoint', () => {\n\t\tVec.NearestPointOnLineThroughPoint(lineOrigin, lineDir, lineTestP)\n\t})\n\n\tbench('DistanceToLineThroughPoint', () => {\n\t\tVec.DistanceToLineThroughPoint(lineOrigin, lineDir, lineTestP)\n\t})\n})\n\n// --- Intersections ---\n\nimport { intersectLineSegmentCircle, intersectLineSegmentLineSegment } from '../intersect'\n\nconst intA1 = new Vec(0, 0)\nconst intA2 = new Vec(100, 100)\nconst intB1 = new Vec(100, 0)\nconst intB2 = new Vec(0, 100)\nconst intB1Miss = new Vec(200, 0)\nconst intB2Miss = new Vec(200, 100)\nconst intCenter = new Vec(50, 50)\n\ndescribe('Intersections', () => {\n\tbench('lineSegment-lineSegment (hit)', () => {\n\t\tintersectLineSegmentLineSegment(intA1, intA2, intB1, intB2)\n\t})\n\n\tbench('lineSegment-lineSegment (miss)', () => {\n\t\tintersectLineSegmentLineSegment(intA1, intA2, intB1Miss, intB2Miss)\n\t})\n\n\tbench('lineSegment-circle (hit)', () => {\n\t\tintersectLineSegmentCircle(intA1, intA2, intCenter, 30)\n\t})\n\n\tbench('lineSegment-circle (miss)', () => {\n\t\tintersectLineSegmentCircle(intA1, intA2, intCenter, 5)\n\t})\n})\n\n// --- Edge2d ---\n\nconst edge = new Edge2d({ start: new Vec(0, 0), end: new Vec(100, 50) })\nconst edgePoint = new Vec(30, 60)\n\ndescribe('Edge2d', () => {\n\tbench('nearestPoint', () => {\n\t\tedge.nearestPoint(edgePoint)\n\t})\n\n\tbench('distanceToPoint', () => {\n\t\tedge.distanceToPoint(edgePoint)\n\t})\n})\n\n// --- Circle2d ---\n\nconst circle = new Circle2d({ radius: 50, isFilled: true })\nconst circlePoint = new Vec(80, 60)\nconst circlePointInside = new Vec(50, 50)\n\ndescribe('Circle2d', () => {\n\tbench('nearestPoint', () => {\n\t\tcircle.nearestPoint(circlePoint)\n\t})\n\n\tbench('distanceToPoint', () => {\n\t\tcircle.distanceToPoint(circlePoint)\n\t})\n\n\tbench('hitTestPoint (outside)', () => {\n\t\tcircle.hitTestPoint(circlePoint, 5)\n\t})\n\n\tbench('hitTestPoint (inside)', () => {\n\t\tcircle.hitTestPoint(circlePointInside, 5, true)\n\t})\n})\n\n// --- Arc2d ---\n\nconst arc = new Arc2d({\n\tcenter: new Vec(50, 50),\n\tstart: new Vec(100, 50),\n\tend: new Vec(50, 100),\n\tsweepFlag: 1,\n\tlargeArcFlag: 0,\n})\nconst arcPoint = new Vec(90, 90)\n\ndescribe('Arc2d', () => {\n\tbench('nearestPoint', () => {\n\t\tarc.nearestPoint(arcPoint)\n\t})\n})\n\n// --- Polyline2d (20 segments) ---\n\nconst polyPoints: Vec[] = []\nfor (let i = 0; i <= 20; i++) {\n\tconst t = i / 20\n\tpolyPoints.push(new Vec(t * 200, Math.sin(t * Math.PI * 2) * 50 + 50))\n}\nconst polyline = new Polyline2d({ points: polyPoints })\nconst polyPoint = new Vec(100, 80)\n\ndescribe('Polyline2d', () => {\n\tbench('nearestPoint', () => {\n\t\tpolyline.nearestPoint(polyPoint)\n\t})\n\n\tbench('distanceToPoint', () => {\n\t\tpolyline.distanceToPoint(polyPoint)\n\t})\n})\n\n// --- Rectangle2d (Geometry2d base) ---\n\nconst rect = new Rectangle2d({ width: 100, height: 80, isFilled: true })\nconst rectPointOutside = new Vec(120, 40)\nconst rectPointInside = new Vec(50, 40)\n\ndescribe('Rectangle2d (Geometry2d)', () => {\n\tbench('hitTestPoint (outside)', () => {\n\t\trect.hitTestPoint(rectPointOutside, 5)\n\t})\n\n\tbench('hitTestPoint (inside)', () => {\n\t\trect.hitTestPoint(rectPointInside, 5, true)\n\t})\n\n\tbench('distanceToPoint (outside)', () => {\n\t\trect.distanceToPoint(rectPointOutside)\n\t})\n\n\tbench('distanceToPoint (inside)', () => {\n\t\trect.distanceToPoint(rectPointInside, true)\n\t})\n})\n"],
|
|
5
|
-
"mappings": "AAAA,SAAS,OAAO,gBAAgB;AAChC,SAAS,WAAW;AACpB,SAAS,aAAa;AACtB,SAAS,gBAAgB;AACzB,SAAS,cAAc;AACvB,SAAS,kBAAkB;AAC3B,SAAS,mBAAmB;AAI5B,MAAM,MAAM,IAAI,IAAI,GAAG,CAAC;AACxB,MAAM,MAAM,IAAI,IAAI,KAAK,EAAE;AAC3B,MAAM,MAAM,IAAI,IAAI,IAAI,EAAE;AAE1B,SAAS,oBAAoB,MAAM;AAClC,QAAM,6BAA6B,MAAM;AACxC,QAAI,0BAA0B,KAAK,KAAK,KAAK,IAAI;AAAA,EAClD,CAAC;AAED,QAAM,yBAAyB,MAAM;AACpC,QAAI,sBAAsB,KAAK,KAAK,KAAK,IAAI;AAAA,EAC9C,CAAC;AACF,CAAC;AAID,MAAM,OAAO,IAAI,IAAI,GAAG,CAAC;AACzB,MAAM,OAAO,IAAI,IAAI,IAAI,CAAC;AAC1B,MAAM,aAAa,IAAI,IAAI,IAAI,EAAE;AACjC,MAAM,UAAU,IAAI,IAAI,QAAQ,MAAM;AACtC,MAAM,YAAY,IAAI,IAAI,IAAI,EAAE;AAEhC,SAAS,iBAAiB,MAAM;AAC/B,QAAM,OAAO,MAAM;AAClB,QAAI,IAAI,KAAK,KAAK,IAAI;AAAA,EACvB,CAAC;AAED,QAAM,gBAAgB,MAAM;AAC3B,QAAI,aAAa,MAAM,IAAI;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