2023-04-25 11:01:25 +00:00
|
|
|
export {
|
2023-06-27 12:25:55 +00:00
|
|
|
type TLSerializedStore,
|
2023-04-25 11:01:25 +00:00
|
|
|
type TLStore,
|
|
|
|
type TLStoreProps,
|
|
|
|
type TLStoreSchema,
|
|
|
|
type TLStoreSnapshot,
|
|
|
|
} from './TLStore'
|
2023-06-03 20:46:53 +00:00
|
|
|
export { assetIdValidator, createAssetValidator, type TLBaseAsset } from './assets/TLBaseAsset'
|
|
|
|
export { type TLBookmarkAsset } from './assets/TLBookmarkAsset'
|
|
|
|
export { type TLImageAsset } from './assets/TLImageAsset'
|
|
|
|
export { type TLVideoAsset } from './assets/TLVideoAsset'
|
2023-05-25 09:54:29 +00:00
|
|
|
export { createPresenceStateDerivation } from './createPresenceStateDerivation'
|
2023-06-12 14:04:14 +00:00
|
|
|
export { createTLSchema, type SchemaShapeInfo, type TLSchema } from './createTLSchema'
|
|
|
|
export {
|
|
|
|
TL_CANVAS_UI_COLOR_TYPES,
|
|
|
|
canvasUiColorTypeValidator,
|
|
|
|
type TLCanvasUiColor,
|
|
|
|
} from './misc/TLColor'
|
2023-06-03 20:46:53 +00:00
|
|
|
export { type TLCursor, type TLCursorType } from './misc/TLCursor'
|
|
|
|
export { type TLHandle, type TLHandleType } from './misc/TLHandle'
|
2023-06-16 10:33:47 +00:00
|
|
|
export { opacityValidator, type TLOpacityType } from './misc/TLOpacity'
|
2023-06-03 20:46:53 +00:00
|
|
|
export { scribbleValidator, type TLScribble } from './misc/TLScribble'
|
2023-06-16 10:33:47 +00:00
|
|
|
export {
|
2024-01-03 12:13:15 +00:00
|
|
|
boxModelValidator,
|
|
|
|
vecModelValidator,
|
|
|
|
type BoxModel,
|
|
|
|
type VecModel,
|
2023-06-16 10:33:47 +00:00
|
|
|
} from './misc/geometry-types'
|
2023-06-03 20:46:53 +00:00
|
|
|
export { idValidator } from './misc/id-validator'
|
2023-04-25 11:01:25 +00:00
|
|
|
export {
|
2023-05-26 13:37:59 +00:00
|
|
|
AssetRecordType,
|
2023-06-03 20:46:53 +00:00
|
|
|
assetMigrations,
|
|
|
|
assetValidator,
|
2023-05-26 13:37:59 +00:00
|
|
|
type TLAsset,
|
2023-04-25 11:01:25 +00:00
|
|
|
type TLAssetId,
|
|
|
|
type TLAssetPartial,
|
|
|
|
type TLAssetShape,
|
|
|
|
} from './records/TLAsset'
|
2023-06-03 20:46:53 +00:00
|
|
|
export { CameraRecordType, type TLCamera, type TLCameraId } from './records/TLCamera'
|
|
|
|
export { DocumentRecordType, TLDOCUMENT_ID, type TLDocument } from './records/TLDocument'
|
2023-06-16 10:33:47 +00:00
|
|
|
export { TLINSTANCE_ID, type TLInstance, type TLInstanceId } from './records/TLInstance'
|
Independent instance state persistence (#1493)
This PR
- Removes UserDocumentRecordType
- moving isSnapMode to user preferences
- moving isGridMode and isPenMode to InstanceRecordType
- deleting the other properties which are no longer needed.
- Creates a separate pipeline for persisting instance state.
Previously the instance state records were stored alongside the document
state records, and in order to load the state for a particular instance
(in our case, a particular tab) you needed to pass the 'instanceId'
prop. This prop ended up totally pervading the public API and people ran
into all kinds of issues with it, e.g. using the same instance id in
multiple editor instances.
There was also an issue whereby it was hard for us to clean up old
instance state so the idb table ended up bloating over time.
This PR makes it so that rather than passing an instanceId, you load the
instance state yourself while creating the store. It provides tools to
make that easy.
- Undoes the assumption that we might have more than one instance's
state in the store.
- Like `document`, `instance` now has a singleton id
`instance:instance`.
- Page state ids and camera ids are no longer random, but rather derive
from the page they belong to. This is like having a foreign primary key
in SQL databases. It's something i'd love to support fully as part of
the RecordType/Store api.
Tests to do
- [x] Test Migrations
- [x] Test Store.listen filtering
- [x] Make type sets in Store public and readonly
- [x] Test RecordType.createId
- [x] Test Instance state snapshot loading/exporting
- [x] Manual test File I/O
- [x] Manual test Vscode extension with multiple tabs
- [x] Audit usages of store.query
- [x] Audit usages of changed types: InstanceRecordType, 'instance',
InstancePageStateRecordType, 'instance_page_state', 'user_document',
'camera', CameraRecordType, InstancePresenceRecordType,
'instance_presence'
- [x] Test user preferences
- [x] Manual test isSnapMode and isGridMode and isPenMode
- [ ] Test indexedDb functions
- [x] Add instanceId stuff back
### Change Type
- [x] `major` — Breaking Change
### Test Plan
1. Add a step-by-step description of how to test your PR here.
2.
- [ ] Unit Tests
- [ ] Webdriver tests
### Release Notes
- Add a brief release note for your PR here.
2023-06-05 14:11:07 +00:00
|
|
|
export {
|
|
|
|
PageRecordType,
|
|
|
|
isPageId,
|
|
|
|
pageIdValidator,
|
|
|
|
type TLPage,
|
|
|
|
type TLPageId,
|
|
|
|
} from './records/TLPage'
|
2023-08-01 17:03:31 +00:00
|
|
|
export { InstancePageStateRecordType, type TLInstancePageState } from './records/TLPageState'
|
|
|
|
export { PointerRecordType, TLPOINTER_ID } from './records/TLPointer'
|
2023-06-03 20:46:53 +00:00
|
|
|
export { InstancePresenceRecordType, type TLInstancePresence } from './records/TLPresence'
|
|
|
|
export { type TLRecord } from './records/TLRecord'
|
2023-04-25 11:01:25 +00:00
|
|
|
export {
|
|
|
|
createShapeId,
|
2023-06-16 10:33:47 +00:00
|
|
|
getShapePropKeysByStyle,
|
2023-04-25 11:01:25 +00:00
|
|
|
isShape,
|
|
|
|
isShapeId,
|
2023-06-03 20:46:53 +00:00
|
|
|
rootShapeMigrations,
|
2023-05-24 10:48:31 +00:00
|
|
|
type TLDefaultShape,
|
2023-04-25 11:01:25 +00:00
|
|
|
type TLParentId,
|
|
|
|
type TLShape,
|
|
|
|
type TLShapeId,
|
|
|
|
type TLShapePartial,
|
|
|
|
type TLShapeProp,
|
|
|
|
type TLShapeProps,
|
|
|
|
type TLUnknownShape,
|
|
|
|
} from './records/TLShape'
|
|
|
|
export {
|
2023-06-16 10:33:47 +00:00
|
|
|
ArrowShapeArrowheadEndStyle,
|
|
|
|
ArrowShapeArrowheadStartStyle,
|
2023-06-12 14:04:14 +00:00
|
|
|
arrowShapeMigrations,
|
|
|
|
arrowShapeProps,
|
2023-04-25 11:01:25 +00:00
|
|
|
type TLArrowShape,
|
2023-06-16 10:33:47 +00:00
|
|
|
type TLArrowShapeArrowheadStyle,
|
2023-04-25 11:01:25 +00:00
|
|
|
type TLArrowShapeProps,
|
2023-06-16 10:33:47 +00:00
|
|
|
type TLArrowShapeTerminal,
|
2023-04-25 11:01:25 +00:00
|
|
|
} from './shapes/TLArrowShape'
|
|
|
|
export {
|
2023-06-03 20:46:53 +00:00
|
|
|
createShapeValidator,
|
|
|
|
parentIdValidator,
|
|
|
|
shapeIdValidator,
|
2023-06-12 14:04:14 +00:00
|
|
|
type ShapeProps,
|
2023-06-03 20:46:53 +00:00
|
|
|
type TLBaseShape,
|
|
|
|
} from './shapes/TLBaseShape'
|
2023-06-12 14:04:14 +00:00
|
|
|
export {
|
|
|
|
bookmarkShapeMigrations,
|
|
|
|
bookmarkShapeProps,
|
|
|
|
type TLBookmarkShape,
|
|
|
|
} from './shapes/TLBookmarkShape'
|
|
|
|
export {
|
|
|
|
drawShapeMigrations,
|
|
|
|
drawShapeProps,
|
|
|
|
type TLDrawShape,
|
|
|
|
type TLDrawShapeSegment,
|
|
|
|
} from './shapes/TLDrawShape'
|
2023-04-25 11:01:25 +00:00
|
|
|
export {
|
|
|
|
EMBED_DEFINITIONS,
|
2023-06-12 14:04:14 +00:00
|
|
|
embedShapeMigrations,
|
2023-06-03 20:46:53 +00:00
|
|
|
embedShapePermissionDefaults,
|
2023-06-12 14:04:14 +00:00
|
|
|
embedShapeProps,
|
2023-04-25 11:01:25 +00:00
|
|
|
type EmbedDefinition,
|
|
|
|
type TLEmbedShape,
|
|
|
|
type TLEmbedShapePermissions,
|
|
|
|
} from './shapes/TLEmbedShape'
|
2023-06-12 14:04:14 +00:00
|
|
|
export { frameShapeMigrations, frameShapeProps, type TLFrameShape } from './shapes/TLFrameShape'
|
2023-06-16 10:33:47 +00:00
|
|
|
export {
|
|
|
|
GeoShapeGeoStyle,
|
|
|
|
geoShapeMigrations,
|
|
|
|
geoShapeProps,
|
|
|
|
type TLGeoShape,
|
|
|
|
} from './shapes/TLGeoShape'
|
2023-06-12 14:04:14 +00:00
|
|
|
export { groupShapeMigrations, groupShapeProps, type TLGroupShape } from './shapes/TLGroupShape'
|
|
|
|
export {
|
|
|
|
highlightShapeMigrations,
|
|
|
|
highlightShapeProps,
|
|
|
|
type TLHighlightShape,
|
|
|
|
} from './shapes/TLHighlightShape'
|
|
|
|
export {
|
|
|
|
imageShapeMigrations,
|
|
|
|
imageShapeProps,
|
|
|
|
type TLImageShape,
|
2023-06-16 10:33:47 +00:00
|
|
|
type TLImageShapeCrop,
|
2023-06-12 14:04:14 +00:00
|
|
|
type TLImageShapeProps,
|
|
|
|
} from './shapes/TLImageShape'
|
2023-06-16 10:33:47 +00:00
|
|
|
export {
|
|
|
|
LineShapeSplineStyle,
|
|
|
|
lineShapeMigrations,
|
|
|
|
lineShapeProps,
|
|
|
|
type TLLineShape,
|
|
|
|
} from './shapes/TLLineShape'
|
2023-06-12 14:04:14 +00:00
|
|
|
export { noteShapeMigrations, noteShapeProps, type TLNoteShape } from './shapes/TLNoteShape'
|
|
|
|
export {
|
|
|
|
textShapeMigrations,
|
|
|
|
textShapeProps,
|
|
|
|
type TLTextShape,
|
|
|
|
type TLTextShapeProps,
|
|
|
|
} from './shapes/TLTextShape'
|
|
|
|
export { videoShapeMigrations, videoShapeProps, type TLVideoShape } from './shapes/TLVideoShape'
|
2023-06-16 10:33:47 +00:00
|
|
|
export { EnumStyleProp, StyleProp } from './styles/StyleProp'
|
2023-06-24 13:46:04 +00:00
|
|
|
export {
|
|
|
|
DefaultColorStyle,
|
|
|
|
DefaultColorThemePalette,
|
|
|
|
getDefaultColorTheme,
|
|
|
|
type TLDefaultColorStyle,
|
|
|
|
type TLDefaultColorTheme,
|
|
|
|
type TLDefaultColorThemeColor,
|
|
|
|
} from './styles/TLColorStyle'
|
2023-06-16 10:33:47 +00:00
|
|
|
export { DefaultDashStyle, type TLDefaultDashStyle } from './styles/TLDashStyle'
|
|
|
|
export { DefaultFillStyle, type TLDefaultFillStyle } from './styles/TLFillStyle'
|
2023-06-24 13:46:04 +00:00
|
|
|
export {
|
|
|
|
DefaultFontFamilies,
|
|
|
|
DefaultFontStyle,
|
|
|
|
type TLDefaultFontStyle,
|
|
|
|
} from './styles/TLFontStyle'
|
2023-06-16 10:33:47 +00:00
|
|
|
export {
|
|
|
|
DefaultHorizontalAlignStyle,
|
|
|
|
type TLDefaultHorizontalAlignStyle,
|
|
|
|
} from './styles/TLHorizontalAlignStyle'
|
|
|
|
export { DefaultSizeStyle, type TLDefaultSizeStyle } from './styles/TLSizeStyle'
|
|
|
|
export {
|
|
|
|
DefaultVerticalAlignStyle,
|
|
|
|
type TLDefaultVerticalAlignStyle,
|
|
|
|
} from './styles/TLVerticalAlignStyle'
|
2023-06-03 20:46:53 +00:00
|
|
|
export {
|
|
|
|
LANGUAGES,
|
|
|
|
getDefaultTranslationLocale,
|
|
|
|
type TLLanguage,
|
|
|
|
} from './translations/translations'
|