@bigbluebutton/tlschema 2.0.0-alpha.19
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/LICENSE +190 -0
- package/dist-cjs/TLStore.js +133 -0
- package/dist-cjs/TLStore.js.map +7 -0
- package/dist-cjs/assets/TLBaseAsset.js +37 -0
- package/dist-cjs/assets/TLBaseAsset.js.map +7 -0
- package/dist-cjs/assets/TLBookmarkAsset.js +38 -0
- package/dist-cjs/assets/TLBookmarkAsset.js.map +7 -0
- package/dist-cjs/assets/TLImageAsset.js +76 -0
- package/dist-cjs/assets/TLImageAsset.js.map +7 -0
- package/dist-cjs/assets/TLVideoAsset.js +76 -0
- package/dist-cjs/assets/TLVideoAsset.js.map +7 -0
- package/dist-cjs/createPresenceStateDerivation.js +68 -0
- package/dist-cjs/createPresenceStateDerivation.js.map +7 -0
- package/dist-cjs/createTLSchema.js +68 -0
- package/dist-cjs/createTLSchema.js.map +7 -0
- package/dist-cjs/index.d.ts +1414 -0
- package/dist-cjs/index.js +142 -0
- package/dist-cjs/index.js.map +7 -0
- package/dist-cjs/misc/TLColor.js +36 -0
- package/dist-cjs/misc/TLColor.js.map +7 -0
- package/dist-cjs/misc/TLCursor.js +55 -0
- package/dist-cjs/misc/TLCursor.js.map +7 -0
- package/dist-cjs/misc/TLHandle.js +36 -0
- package/dist-cjs/misc/TLHandle.js.map +7 -0
- package/dist-cjs/misc/TLOpacity.js +30 -0
- package/dist-cjs/misc/TLOpacity.js.map +7 -0
- package/dist-cjs/misc/TLScribble.js +40 -0
- package/dist-cjs/misc/TLScribble.js.map +7 -0
- package/dist-cjs/misc/geometry-types.js +37 -0
- package/dist-cjs/misc/geometry-types.js.map +7 -0
- package/dist-cjs/misc/id-validator.js +33 -0
- package/dist-cjs/misc/id-validator.js.map +7 -0
- package/dist-cjs/records/TLAsset.js +74 -0
- package/dist-cjs/records/TLAsset.js.map +7 -0
- package/dist-cjs/records/TLCamera.js +74 -0
- package/dist-cjs/records/TLCamera.js.map +7 -0
- package/dist-cjs/records/TLDocument.js +82 -0
- package/dist-cjs/records/TLDocument.js.map +7 -0
- package/dist-cjs/records/TLInstance.js +452 -0
- package/dist-cjs/records/TLInstance.js.map +7 -0
- package/dist-cjs/records/TLPage.js +74 -0
- package/dist-cjs/records/TLPage.js.map +7 -0
- package/dist-cjs/records/TLPageState.js +209 -0
- package/dist-cjs/records/TLPageState.js.map +7 -0
- package/dist-cjs/records/TLPointer.js +76 -0
- package/dist-cjs/records/TLPointer.js.map +7 -0
- package/dist-cjs/records/TLPresence.js +170 -0
- package/dist-cjs/records/TLPresence.js.map +7 -0
- package/dist-cjs/records/TLRecord.js +17 -0
- package/dist-cjs/records/TLRecord.js.map +7 -0
- package/dist-cjs/records/TLShape.js +147 -0
- package/dist-cjs/records/TLShape.js.map +7 -0
- package/dist-cjs/shapes/TLArrowShape.js +156 -0
- package/dist-cjs/shapes/TLArrowShape.js.map +7 -0
- package/dist-cjs/shapes/TLBaseShape.js +52 -0
- package/dist-cjs/shapes/TLBaseShape.js.map +7 -0
- package/dist-cjs/shapes/TLBookmarkShape.js +57 -0
- package/dist-cjs/shapes/TLBookmarkShape.js.map +7 -0
- package/dist-cjs/shapes/TLDrawShape.js +89 -0
- package/dist-cjs/shapes/TLDrawShape.js.map +7 -0
- package/dist-cjs/shapes/TLEmbedShape.js +709 -0
- package/dist-cjs/shapes/TLEmbedShape.js.map +7 -0
- package/dist-cjs/shapes/TLFrameShape.js +33 -0
- package/dist-cjs/shapes/TLFrameShape.js.map +7 -0
- package/dist-cjs/shapes/TLGeoShape.js +230 -0
- package/dist-cjs/shapes/TLGeoShape.js.map +7 -0
- package/dist-cjs/shapes/TLGroupShape.js +28 -0
- package/dist-cjs/shapes/TLGroupShape.js.map +7 -0
- package/dist-cjs/shapes/TLHighlightShape.js +38 -0
- package/dist-cjs/shapes/TLHighlightShape.js.map +7 -0
- package/dist-cjs/shapes/TLImageShape.js +69 -0
- package/dist-cjs/shapes/TLImageShape.js.map +7 -0
- package/dist-cjs/shapes/TLLineShape.js +70 -0
- package/dist-cjs/shapes/TLLineShape.js.map +7 -0
- package/dist-cjs/shapes/TLNoteShape.js +144 -0
- package/dist-cjs/shapes/TLNoteShape.js.map +7 -0
- package/dist-cjs/shapes/TLTextShape.js +67 -0
- package/dist-cjs/shapes/TLTextShape.js.map +7 -0
- package/dist-cjs/shapes/TLVideoShape.js +53 -0
- package/dist-cjs/shapes/TLVideoShape.js.map +7 -0
- package/dist-cjs/store-migrations.js +81 -0
- package/dist-cjs/store-migrations.js.map +7 -0
- package/dist-cjs/styles/StyleProp.js +94 -0
- package/dist-cjs/styles/StyleProp.js.map +7 -0
- package/dist-cjs/styles/TLColorStyle.js +283 -0
- package/dist-cjs/styles/TLColorStyle.js.map +7 -0
- package/dist-cjs/styles/TLDashStyle.js +29 -0
- package/dist-cjs/styles/TLDashStyle.js.map +7 -0
- package/dist-cjs/styles/TLFillStyle.js +29 -0
- package/dist-cjs/styles/TLFillStyle.js.map +7 -0
- package/dist-cjs/styles/TLFontStyle.js +36 -0
- package/dist-cjs/styles/TLFontStyle.js.map +7 -0
- package/dist-cjs/styles/TLHorizontalAlignStyle.js +29 -0
- package/dist-cjs/styles/TLHorizontalAlignStyle.js.map +7 -0
- package/dist-cjs/styles/TLSizeStyle.js +29 -0
- package/dist-cjs/styles/TLSizeStyle.js.map +7 -0
- package/dist-cjs/styles/TLVerticalAlignStyle.js +29 -0
- package/dist-cjs/styles/TLVerticalAlignStyle.js.map +7 -0
- package/dist-cjs/translations/languages.js +59 -0
- package/dist-cjs/translations/languages.js.map +7 -0
- package/dist-cjs/translations/translations.js +63 -0
- package/dist-cjs/translations/translations.js.map +7 -0
- package/dist-cjs/util-types.js +17 -0
- package/dist-cjs/util-types.js.map +7 -0
- package/dist-esm/TLStore.mjs +113 -0
- package/dist-esm/TLStore.mjs.map +7 -0
- package/dist-esm/assets/TLBaseAsset.mjs +17 -0
- package/dist-esm/assets/TLBaseAsset.mjs.map +7 -0
- package/dist-esm/assets/TLBookmarkAsset.mjs +18 -0
- package/dist-esm/assets/TLBookmarkAsset.mjs.map +7 -0
- package/dist-esm/assets/TLImageAsset.mjs +56 -0
- package/dist-esm/assets/TLImageAsset.mjs.map +7 -0
- package/dist-esm/assets/TLVideoAsset.mjs +56 -0
- package/dist-esm/assets/TLVideoAsset.mjs.map +7 -0
- package/dist-esm/createPresenceStateDerivation.mjs +48 -0
- package/dist-esm/createPresenceStateDerivation.mjs.map +7 -0
- package/dist-esm/createTLSchema.mjs +48 -0
- package/dist-esm/createTLSchema.mjs.map +7 -0
- package/dist-esm/index.d.mts +1414 -0
- package/dist-esm/index.mjs +193 -0
- package/dist-esm/index.mjs.map +7 -0
- package/dist-esm/misc/TLColor.mjs +16 -0
- package/dist-esm/misc/TLColor.mjs.map +7 -0
- package/dist-esm/misc/TLCursor.mjs +35 -0
- package/dist-esm/misc/TLCursor.mjs.map +7 -0
- package/dist-esm/misc/TLHandle.mjs +16 -0
- package/dist-esm/misc/TLHandle.mjs.map +7 -0
- package/dist-esm/misc/TLOpacity.mjs +10 -0
- package/dist-esm/misc/TLOpacity.mjs.map +7 -0
- package/dist-esm/misc/TLScribble.mjs +20 -0
- package/dist-esm/misc/TLScribble.mjs.map +7 -0
- package/dist-esm/misc/geometry-types.mjs +17 -0
- package/dist-esm/misc/geometry-types.mjs.map +7 -0
- package/dist-esm/misc/id-validator.mjs +13 -0
- package/dist-esm/misc/id-validator.mjs.map +7 -0
- package/dist-esm/records/TLAsset.mjs +57 -0
- package/dist-esm/records/TLAsset.mjs.map +7 -0
- package/dist-esm/records/TLCamera.mjs +54 -0
- package/dist-esm/records/TLCamera.mjs.map +7 -0
- package/dist-esm/records/TLDocument.mjs +62 -0
- package/dist-esm/records/TLDocument.mjs.map +7 -0
- package/dist-esm/records/TLInstance.mjs +432 -0
- package/dist-esm/records/TLInstance.mjs.map +7 -0
- package/dist-esm/records/TLPage.mjs +54 -0
- package/dist-esm/records/TLPage.mjs.map +7 -0
- package/dist-esm/records/TLPageState.mjs +189 -0
- package/dist-esm/records/TLPageState.mjs.map +7 -0
- package/dist-esm/records/TLPointer.mjs +56 -0
- package/dist-esm/records/TLPointer.mjs.map +7 -0
- package/dist-esm/records/TLPresence.mjs +150 -0
- package/dist-esm/records/TLPresence.mjs.map +7 -0
- package/dist-esm/records/TLRecord.mjs +1 -0
- package/dist-esm/records/TLRecord.mjs.map +7 -0
- package/dist-esm/records/TLShape.mjs +127 -0
- package/dist-esm/records/TLShape.mjs.map +7 -0
- package/dist-esm/shapes/TLArrowShape.mjs +136 -0
- package/dist-esm/shapes/TLArrowShape.mjs.map +7 -0
- package/dist-esm/shapes/TLBaseShape.mjs +32 -0
- package/dist-esm/shapes/TLBaseShape.mjs.map +7 -0
- package/dist-esm/shapes/TLBookmarkShape.mjs +37 -0
- package/dist-esm/shapes/TLBookmarkShape.mjs.map +7 -0
- package/dist-esm/shapes/TLDrawShape.mjs +69 -0
- package/dist-esm/shapes/TLDrawShape.mjs.map +7 -0
- package/dist-esm/shapes/TLEmbedShape.mjs +689 -0
- package/dist-esm/shapes/TLEmbedShape.mjs.map +7 -0
- package/dist-esm/shapes/TLFrameShape.mjs +13 -0
- package/dist-esm/shapes/TLFrameShape.mjs.map +7 -0
- package/dist-esm/shapes/TLGeoShape.mjs +212 -0
- package/dist-esm/shapes/TLGeoShape.mjs.map +7 -0
- package/dist-esm/shapes/TLGroupShape.mjs +8 -0
- package/dist-esm/shapes/TLGroupShape.mjs.map +7 -0
- package/dist-esm/shapes/TLHighlightShape.mjs +18 -0
- package/dist-esm/shapes/TLHighlightShape.mjs.map +7 -0
- package/dist-esm/shapes/TLImageShape.mjs +49 -0
- package/dist-esm/shapes/TLImageShape.mjs.map +7 -0
- package/dist-esm/shapes/TLLineShape.mjs +50 -0
- package/dist-esm/shapes/TLLineShape.mjs.map +7 -0
- package/dist-esm/shapes/TLNoteShape.mjs +126 -0
- package/dist-esm/shapes/TLNoteShape.mjs.map +7 -0
- package/dist-esm/shapes/TLTextShape.mjs +47 -0
- package/dist-esm/shapes/TLTextShape.mjs.map +7 -0
- package/dist-esm/shapes/TLVideoShape.mjs +33 -0
- package/dist-esm/shapes/TLVideoShape.mjs.map +7 -0
- package/dist-esm/store-migrations.mjs +61 -0
- package/dist-esm/store-migrations.mjs.map +7 -0
- package/dist-esm/styles/StyleProp.mjs +74 -0
- package/dist-esm/styles/StyleProp.mjs.map +7 -0
- package/dist-esm/styles/TLColorStyle.mjs +263 -0
- package/dist-esm/styles/TLColorStyle.mjs.map +7 -0
- package/dist-esm/styles/TLDashStyle.mjs +9 -0
- package/dist-esm/styles/TLDashStyle.mjs.map +7 -0
- package/dist-esm/styles/TLFillStyle.mjs +9 -0
- package/dist-esm/styles/TLFillStyle.mjs.map +7 -0
- package/dist-esm/styles/TLFontStyle.mjs +16 -0
- package/dist-esm/styles/TLFontStyle.mjs.map +7 -0
- package/dist-esm/styles/TLHorizontalAlignStyle.mjs +9 -0
- package/dist-esm/styles/TLHorizontalAlignStyle.mjs.map +7 -0
- package/dist-esm/styles/TLSizeStyle.mjs +9 -0
- package/dist-esm/styles/TLSizeStyle.mjs.map +7 -0
- package/dist-esm/styles/TLVerticalAlignStyle.mjs +9 -0
- package/dist-esm/styles/TLVerticalAlignStyle.mjs.map +7 -0
- package/dist-esm/translations/languages.mjs +39 -0
- package/dist-esm/translations/languages.mjs.map +7 -0
- package/dist-esm/translations/translations.mjs +43 -0
- package/dist-esm/translations/translations.mjs.map +7 -0
- package/dist-esm/util-types.mjs +1 -0
- package/dist-esm/util-types.mjs.map +7 -0
- package/package.json +64 -0
- package/src/TLStore.ts +160 -0
- package/src/assets/TLBaseAsset.ts +44 -0
- package/src/assets/TLBookmarkAsset.ts +31 -0
- package/src/assets/TLImageAsset.ts +73 -0
- package/src/assets/TLVideoAsset.ts +73 -0
- package/src/createPresenceStateDerivation.ts +53 -0
- package/src/createTLSchema.ts +65 -0
- package/src/index.ts +168 -0
- package/src/migrations.test.ts +1768 -0
- package/src/misc/TLColor.ts +28 -0
- package/src/misc/TLCursor.ts +54 -0
- package/src/misc/TLHandle.ts +41 -0
- package/src/misc/TLOpacity.ts +11 -0
- package/src/misc/TLScribble.ts +39 -0
- package/src/misc/geometry-types.ts +37 -0
- package/src/misc/id-validator.ts +14 -0
- package/src/records/TLAsset.ts +80 -0
- package/src/records/TLCamera.ts +74 -0
- package/src/records/TLDocument.ts +77 -0
- package/src/records/TLInstance.ts +493 -0
- package/src/records/TLPage.ts +72 -0
- package/src/records/TLPageState.ts +216 -0
- package/src/records/TLPointer.ts +74 -0
- package/src/records/TLPresence.ts +179 -0
- package/src/records/TLRecord.ts +21 -0
- package/src/records/TLShape.ts +214 -0
- package/src/shapes/TLArrowShape.ts +160 -0
- package/src/shapes/TLBaseShape.ts +67 -0
- package/src/shapes/TLBookmarkShape.ts +44 -0
- package/src/shapes/TLDrawShape.ts +89 -0
- package/src/shapes/TLEmbedShape.ts +754 -0
- package/src/shapes/TLFrameShape.ts +18 -0
- package/src/shapes/TLGeoShape.ts +226 -0
- package/src/shapes/TLGroupShape.ts +14 -0
- package/src/shapes/TLHighlightShape.ts +24 -0
- package/src/shapes/TLImageShape.ts +59 -0
- package/src/shapes/TLLineShape.ts +61 -0
- package/src/shapes/TLNoteShape.ts +137 -0
- package/src/shapes/TLTextShape.ts +55 -0
- package/src/shapes/TLVideoShape.ts +40 -0
- package/src/store-migrations.ts +63 -0
- package/src/styles/StyleProp.ts +105 -0
- package/src/styles/TLColorStyle.ts +296 -0
- package/src/styles/TLDashStyle.ts +11 -0
- package/src/styles/TLFillStyle.ts +11 -0
- package/src/styles/TLFontStyle.ts +19 -0
- package/src/styles/TLHorizontalAlignStyle.ts +11 -0
- package/src/styles/TLSizeStyle.ts +11 -0
- package/src/styles/TLVerticalAlignStyle.ts +11 -0
- package/src/translations/languages.ts +39 -0
- package/src/translations/translations.test.ts +43 -0
- package/src/translations/translations.ts +73 -0
- package/src/util-types.ts +2 -0
|
@@ -0,0 +1,193 @@
|
|
|
1
|
+
import { assetIdValidator, createAssetValidator } from "./assets/TLBaseAsset.mjs";
|
|
2
|
+
import { createPresenceStateDerivation } from "./createPresenceStateDerivation.mjs";
|
|
3
|
+
import { createTLSchema } from "./createTLSchema.mjs";
|
|
4
|
+
import {
|
|
5
|
+
TL_CANVAS_UI_COLOR_TYPES,
|
|
6
|
+
canvasUiColorTypeValidator
|
|
7
|
+
} from "./misc/TLColor.mjs";
|
|
8
|
+
import { opacityValidator } from "./misc/TLOpacity.mjs";
|
|
9
|
+
import { scribbleValidator } from "./misc/TLScribble.mjs";
|
|
10
|
+
import {
|
|
11
|
+
box2dModelValidator,
|
|
12
|
+
vec2dModelValidator
|
|
13
|
+
} from "./misc/geometry-types.mjs";
|
|
14
|
+
import { idValidator } from "./misc/id-validator.mjs";
|
|
15
|
+
import {
|
|
16
|
+
AssetRecordType,
|
|
17
|
+
assetMigrations,
|
|
18
|
+
assetValidator
|
|
19
|
+
} from "./records/TLAsset.mjs";
|
|
20
|
+
import { CameraRecordType } from "./records/TLCamera.mjs";
|
|
21
|
+
import { DocumentRecordType, TLDOCUMENT_ID } from "./records/TLDocument.mjs";
|
|
22
|
+
import { TLINSTANCE_ID } from "./records/TLInstance.mjs";
|
|
23
|
+
import {
|
|
24
|
+
PageRecordType,
|
|
25
|
+
isPageId,
|
|
26
|
+
pageIdValidator
|
|
27
|
+
} from "./records/TLPage.mjs";
|
|
28
|
+
import { InstancePageStateRecordType } from "./records/TLPageState.mjs";
|
|
29
|
+
import { PointerRecordType, TLPOINTER_ID } from "./records/TLPointer.mjs";
|
|
30
|
+
import { InstancePresenceRecordType } from "./records/TLPresence.mjs";
|
|
31
|
+
import {
|
|
32
|
+
createShapeId,
|
|
33
|
+
getShapePropKeysByStyle,
|
|
34
|
+
isShape,
|
|
35
|
+
isShapeId,
|
|
36
|
+
rootShapeMigrations
|
|
37
|
+
} from "./records/TLShape.mjs";
|
|
38
|
+
import {
|
|
39
|
+
ArrowShapeArrowheadEndStyle,
|
|
40
|
+
ArrowShapeArrowheadStartStyle,
|
|
41
|
+
arrowShapeMigrations,
|
|
42
|
+
arrowShapeProps
|
|
43
|
+
} from "./shapes/TLArrowShape.mjs";
|
|
44
|
+
import {
|
|
45
|
+
createShapeValidator,
|
|
46
|
+
parentIdValidator,
|
|
47
|
+
shapeIdValidator
|
|
48
|
+
} from "./shapes/TLBaseShape.mjs";
|
|
49
|
+
import {
|
|
50
|
+
bookmarkShapeMigrations,
|
|
51
|
+
bookmarkShapeProps
|
|
52
|
+
} from "./shapes/TLBookmarkShape.mjs";
|
|
53
|
+
import {
|
|
54
|
+
drawShapeMigrations,
|
|
55
|
+
drawShapeProps
|
|
56
|
+
} from "./shapes/TLDrawShape.mjs";
|
|
57
|
+
import {
|
|
58
|
+
EMBED_DEFINITIONS,
|
|
59
|
+
embedShapeMigrations,
|
|
60
|
+
embedShapePermissionDefaults,
|
|
61
|
+
embedShapeProps
|
|
62
|
+
} from "./shapes/TLEmbedShape.mjs";
|
|
63
|
+
import { frameShapeMigrations, frameShapeProps } from "./shapes/TLFrameShape.mjs";
|
|
64
|
+
import {
|
|
65
|
+
GeoShapeGeoStyle,
|
|
66
|
+
geoShapeMigrations,
|
|
67
|
+
geoShapeProps
|
|
68
|
+
} from "./shapes/TLGeoShape.mjs";
|
|
69
|
+
import { groupShapeMigrations, groupShapeProps } from "./shapes/TLGroupShape.mjs";
|
|
70
|
+
import {
|
|
71
|
+
highlightShapeMigrations,
|
|
72
|
+
highlightShapeProps
|
|
73
|
+
} from "./shapes/TLHighlightShape.mjs";
|
|
74
|
+
import {
|
|
75
|
+
imageShapeMigrations,
|
|
76
|
+
imageShapeProps
|
|
77
|
+
} from "./shapes/TLImageShape.mjs";
|
|
78
|
+
import {
|
|
79
|
+
LineShapeSplineStyle,
|
|
80
|
+
lineShapeMigrations,
|
|
81
|
+
lineShapeProps
|
|
82
|
+
} from "./shapes/TLLineShape.mjs";
|
|
83
|
+
import { noteShapeMigrations, noteShapeProps } from "./shapes/TLNoteShape.mjs";
|
|
84
|
+
import {
|
|
85
|
+
textShapeMigrations,
|
|
86
|
+
textShapeProps
|
|
87
|
+
} from "./shapes/TLTextShape.mjs";
|
|
88
|
+
import { videoShapeMigrations, videoShapeProps } from "./shapes/TLVideoShape.mjs";
|
|
89
|
+
import { EnumStyleProp, StyleProp } from "./styles/StyleProp.mjs";
|
|
90
|
+
import {
|
|
91
|
+
DefaultColorStyle,
|
|
92
|
+
DefaultColorThemePalette,
|
|
93
|
+
getDefaultColorTheme
|
|
94
|
+
} from "./styles/TLColorStyle.mjs";
|
|
95
|
+
import { DefaultDashStyle } from "./styles/TLDashStyle.mjs";
|
|
96
|
+
import { DefaultFillStyle } from "./styles/TLFillStyle.mjs";
|
|
97
|
+
import {
|
|
98
|
+
DefaultFontFamilies,
|
|
99
|
+
DefaultFontStyle
|
|
100
|
+
} from "./styles/TLFontStyle.mjs";
|
|
101
|
+
import {
|
|
102
|
+
DefaultHorizontalAlignStyle
|
|
103
|
+
} from "./styles/TLHorizontalAlignStyle.mjs";
|
|
104
|
+
import { DefaultSizeStyle } from "./styles/TLSizeStyle.mjs";
|
|
105
|
+
import {
|
|
106
|
+
DefaultVerticalAlignStyle
|
|
107
|
+
} from "./styles/TLVerticalAlignStyle.mjs";
|
|
108
|
+
import {
|
|
109
|
+
LANGUAGES,
|
|
110
|
+
getDefaultTranslationLocale
|
|
111
|
+
} from "./translations/translations.mjs";
|
|
112
|
+
export {
|
|
113
|
+
ArrowShapeArrowheadEndStyle,
|
|
114
|
+
ArrowShapeArrowheadStartStyle,
|
|
115
|
+
AssetRecordType,
|
|
116
|
+
CameraRecordType,
|
|
117
|
+
DefaultColorStyle,
|
|
118
|
+
DefaultColorThemePalette,
|
|
119
|
+
DefaultDashStyle,
|
|
120
|
+
DefaultFillStyle,
|
|
121
|
+
DefaultFontFamilies,
|
|
122
|
+
DefaultFontStyle,
|
|
123
|
+
DefaultHorizontalAlignStyle,
|
|
124
|
+
DefaultSizeStyle,
|
|
125
|
+
DefaultVerticalAlignStyle,
|
|
126
|
+
DocumentRecordType,
|
|
127
|
+
EMBED_DEFINITIONS,
|
|
128
|
+
EnumStyleProp,
|
|
129
|
+
GeoShapeGeoStyle,
|
|
130
|
+
InstancePageStateRecordType,
|
|
131
|
+
InstancePresenceRecordType,
|
|
132
|
+
LANGUAGES,
|
|
133
|
+
LineShapeSplineStyle,
|
|
134
|
+
PageRecordType,
|
|
135
|
+
PointerRecordType,
|
|
136
|
+
StyleProp,
|
|
137
|
+
TLDOCUMENT_ID,
|
|
138
|
+
TLINSTANCE_ID,
|
|
139
|
+
TLPOINTER_ID,
|
|
140
|
+
TL_CANVAS_UI_COLOR_TYPES,
|
|
141
|
+
arrowShapeMigrations,
|
|
142
|
+
arrowShapeProps,
|
|
143
|
+
assetIdValidator,
|
|
144
|
+
assetMigrations,
|
|
145
|
+
assetValidator,
|
|
146
|
+
bookmarkShapeMigrations,
|
|
147
|
+
bookmarkShapeProps,
|
|
148
|
+
box2dModelValidator,
|
|
149
|
+
canvasUiColorTypeValidator,
|
|
150
|
+
createAssetValidator,
|
|
151
|
+
createPresenceStateDerivation,
|
|
152
|
+
createShapeId,
|
|
153
|
+
createShapeValidator,
|
|
154
|
+
createTLSchema,
|
|
155
|
+
drawShapeMigrations,
|
|
156
|
+
drawShapeProps,
|
|
157
|
+
embedShapeMigrations,
|
|
158
|
+
embedShapePermissionDefaults,
|
|
159
|
+
embedShapeProps,
|
|
160
|
+
frameShapeMigrations,
|
|
161
|
+
frameShapeProps,
|
|
162
|
+
geoShapeMigrations,
|
|
163
|
+
geoShapeProps,
|
|
164
|
+
getDefaultColorTheme,
|
|
165
|
+
getDefaultTranslationLocale,
|
|
166
|
+
getShapePropKeysByStyle,
|
|
167
|
+
groupShapeMigrations,
|
|
168
|
+
groupShapeProps,
|
|
169
|
+
highlightShapeMigrations,
|
|
170
|
+
highlightShapeProps,
|
|
171
|
+
idValidator,
|
|
172
|
+
imageShapeMigrations,
|
|
173
|
+
imageShapeProps,
|
|
174
|
+
isPageId,
|
|
175
|
+
isShape,
|
|
176
|
+
isShapeId,
|
|
177
|
+
lineShapeMigrations,
|
|
178
|
+
lineShapeProps,
|
|
179
|
+
noteShapeMigrations,
|
|
180
|
+
noteShapeProps,
|
|
181
|
+
opacityValidator,
|
|
182
|
+
pageIdValidator,
|
|
183
|
+
parentIdValidator,
|
|
184
|
+
rootShapeMigrations,
|
|
185
|
+
scribbleValidator,
|
|
186
|
+
shapeIdValidator,
|
|
187
|
+
textShapeMigrations,
|
|
188
|
+
textShapeProps,
|
|
189
|
+
vec2dModelValidator,
|
|
190
|
+
videoShapeMigrations,
|
|
191
|
+
videoShapeProps
|
|
192
|
+
};
|
|
193
|
+
//# sourceMappingURL=index.mjs.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../src/index.ts"],
|
|
4
|
+
"sourcesContent": ["export {\n\ttype TLSerializedStore,\n\ttype TLStore,\n\ttype TLStoreProps,\n\ttype TLStoreSchema,\n\ttype TLStoreSnapshot,\n} from './TLStore'\nexport { assetIdValidator, createAssetValidator, type TLBaseAsset } from './assets/TLBaseAsset'\nexport { type TLBookmarkAsset } from './assets/TLBookmarkAsset'\nexport { type TLImageAsset } from './assets/TLImageAsset'\nexport { type TLVideoAsset } from './assets/TLVideoAsset'\nexport { createPresenceStateDerivation } from './createPresenceStateDerivation'\nexport { createTLSchema, type SchemaShapeInfo, type TLSchema } from './createTLSchema'\nexport {\n\tTL_CANVAS_UI_COLOR_TYPES,\n\tcanvasUiColorTypeValidator,\n\ttype TLCanvasUiColor,\n} from './misc/TLColor'\nexport { type TLCursor, type TLCursorType } from './misc/TLCursor'\nexport { type TLHandle, type TLHandleType } from './misc/TLHandle'\nexport { opacityValidator, type TLOpacityType } from './misc/TLOpacity'\nexport { scribbleValidator, type TLScribble } from './misc/TLScribble'\nexport {\n\tbox2dModelValidator,\n\tvec2dModelValidator,\n\ttype Box2dModel,\n\ttype Vec2dModel,\n} from './misc/geometry-types'\nexport { idValidator } from './misc/id-validator'\nexport {\n\tAssetRecordType,\n\tassetMigrations,\n\tassetValidator,\n\ttype TLAsset,\n\ttype TLAssetId,\n\ttype TLAssetPartial,\n\ttype TLAssetShape,\n} from './records/TLAsset'\nexport { CameraRecordType, type TLCamera, type TLCameraId } from './records/TLCamera'\nexport { DocumentRecordType, TLDOCUMENT_ID, type TLDocument } from './records/TLDocument'\nexport { TLINSTANCE_ID, type TLInstance, type TLInstanceId } from './records/TLInstance'\nexport {\n\tPageRecordType,\n\tisPageId,\n\tpageIdValidator,\n\ttype TLPage,\n\ttype TLPageId,\n} from './records/TLPage'\nexport { InstancePageStateRecordType, type TLInstancePageState } from './records/TLPageState'\nexport { PointerRecordType, TLPOINTER_ID } from './records/TLPointer'\nexport { InstancePresenceRecordType, type TLInstancePresence } from './records/TLPresence'\nexport { type TLRecord } from './records/TLRecord'\nexport {\n\tcreateShapeId,\n\tgetShapePropKeysByStyle,\n\tisShape,\n\tisShapeId,\n\trootShapeMigrations,\n\ttype TLDefaultShape,\n\ttype TLParentId,\n\ttype TLShape,\n\ttype TLShapeId,\n\ttype TLShapePartial,\n\ttype TLShapeProp,\n\ttype TLShapeProps,\n\ttype TLUnknownShape,\n} from './records/TLShape'\nexport {\n\tArrowShapeArrowheadEndStyle,\n\tArrowShapeArrowheadStartStyle,\n\tarrowShapeMigrations,\n\tarrowShapeProps,\n\ttype TLArrowShape,\n\ttype TLArrowShapeArrowheadStyle,\n\ttype TLArrowShapeProps,\n\ttype TLArrowShapeTerminal,\n} from './shapes/TLArrowShape'\nexport {\n\tcreateShapeValidator,\n\tparentIdValidator,\n\tshapeIdValidator,\n\ttype ShapeProps,\n\ttype TLBaseShape,\n} from './shapes/TLBaseShape'\nexport {\n\tbookmarkShapeMigrations,\n\tbookmarkShapeProps,\n\ttype TLBookmarkShape,\n} from './shapes/TLBookmarkShape'\nexport {\n\tdrawShapeMigrations,\n\tdrawShapeProps,\n\ttype TLDrawShape,\n\ttype TLDrawShapeSegment,\n} from './shapes/TLDrawShape'\nexport {\n\tEMBED_DEFINITIONS,\n\tembedShapeMigrations,\n\tembedShapePermissionDefaults,\n\tembedShapeProps,\n\ttype EmbedDefinition,\n\ttype TLEmbedShape,\n\ttype TLEmbedShapePermissions,\n} from './shapes/TLEmbedShape'\nexport { frameShapeMigrations, frameShapeProps, type TLFrameShape } from './shapes/TLFrameShape'\nexport {\n\tGeoShapeGeoStyle,\n\tgeoShapeMigrations,\n\tgeoShapeProps,\n\ttype TLGeoShape,\n} from './shapes/TLGeoShape'\nexport { groupShapeMigrations, groupShapeProps, type TLGroupShape } from './shapes/TLGroupShape'\nexport {\n\thighlightShapeMigrations,\n\thighlightShapeProps,\n\ttype TLHighlightShape,\n} from './shapes/TLHighlightShape'\nexport {\n\timageShapeMigrations,\n\timageShapeProps,\n\ttype TLImageShape,\n\ttype TLImageShapeCrop,\n\ttype TLImageShapeProps,\n} from './shapes/TLImageShape'\nexport {\n\tLineShapeSplineStyle,\n\tlineShapeMigrations,\n\tlineShapeProps,\n\ttype TLLineShape,\n} from './shapes/TLLineShape'\nexport { noteShapeMigrations, noteShapeProps, type TLNoteShape } from './shapes/TLNoteShape'\nexport {\n\ttextShapeMigrations,\n\ttextShapeProps,\n\ttype TLTextShape,\n\ttype TLTextShapeProps,\n} from './shapes/TLTextShape'\nexport { videoShapeMigrations, videoShapeProps, type TLVideoShape } from './shapes/TLVideoShape'\nexport { EnumStyleProp, StyleProp } from './styles/StyleProp'\nexport {\n\tDefaultColorStyle,\n\tDefaultColorThemePalette,\n\tgetDefaultColorTheme,\n\ttype TLDefaultColorStyle,\n\ttype TLDefaultColorTheme,\n\ttype TLDefaultColorThemeColor,\n} from './styles/TLColorStyle'\nexport { DefaultDashStyle, type TLDefaultDashStyle } from './styles/TLDashStyle'\nexport { DefaultFillStyle, type TLDefaultFillStyle } from './styles/TLFillStyle'\nexport {\n\tDefaultFontFamilies,\n\tDefaultFontStyle,\n\ttype TLDefaultFontStyle,\n} from './styles/TLFontStyle'\nexport {\n\tDefaultHorizontalAlignStyle,\n\ttype TLDefaultHorizontalAlignStyle,\n} from './styles/TLHorizontalAlignStyle'\nexport { DefaultSizeStyle, type TLDefaultSizeStyle } from './styles/TLSizeStyle'\nexport {\n\tDefaultVerticalAlignStyle,\n\ttype TLDefaultVerticalAlignStyle,\n} from './styles/TLVerticalAlignStyle'\nexport {\n\tLANGUAGES,\n\tgetDefaultTranslationLocale,\n\ttype TLLanguage,\n} from './translations/translations'\n"],
|
|
5
|
+
"mappings": "AAOA,SAAS,kBAAkB,4BAA8C;AAIzE,SAAS,qCAAqC;AAC9C,SAAS,sBAA2D;AACpE;AAAA,EACC;AAAA,EACA;AAAA,OAEM;AAGP,SAAS,wBAA4C;AACrD,SAAS,yBAA0C;AACnD;AAAA,EACC;AAAA,EACA;AAAA,OAGM;AACP,SAAS,mBAAmB;AAC5B;AAAA,EACC;AAAA,EACA;AAAA,EACA;AAAA,OAKM;AACP,SAAS,wBAAwD;AACjE,SAAS,oBAAoB,qBAAsC;AACnE,SAAS,qBAAyD;AAClE;AAAA,EACC;AAAA,EACA;AAAA,EACA;AAAA,OAGM;AACP,SAAS,mCAA6D;AACtE,SAAS,mBAAmB,oBAAoB;AAChD,SAAS,kCAA2D;AAEpE;AAAA,EACC;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OASM;AACP;AAAA,EACC;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OAKM;AACP;AAAA,EACC;AAAA,EACA;AAAA,EACA;AAAA,OAGM;AACP;AAAA,EACC;AAAA,EACA;AAAA,OAEM;AACP;AAAA,EACC;AAAA,EACA;AAAA,OAGM;AACP;AAAA,EACC;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OAIM;AACP,SAAS,sBAAsB,uBAA0C;AACzE;AAAA,EACC;AAAA,EACA;AAAA,EACA;AAAA,OAEM;AACP,SAAS,sBAAsB,uBAA0C;AACzE;AAAA,EACC;AAAA,EACA;AAAA,OAEM;AACP;AAAA,EACC;AAAA,EACA;AAAA,OAIM;AACP;AAAA,EACC;AAAA,EACA;AAAA,EACA;AAAA,OAEM;AACP,SAAS,qBAAqB,sBAAwC;AACtE;AAAA,EACC;AAAA,EACA;AAAA,OAGM;AACP,SAAS,sBAAsB,uBAA0C;AACzE,SAAS,eAAe,iBAAiB;AACzC;AAAA,EACC;AAAA,EACA;AAAA,EACA;AAAA,OAIM;AACP,SAAS,wBAAiD;AAC1D,SAAS,wBAAiD;AAC1D;AAAA,EACC;AAAA,EACA;AAAA,OAEM;AACP;AAAA,EACC;AAAA,OAEM;AACP,SAAS,wBAAiD;AAC1D;AAAA,EACC;AAAA,OAEM;AACP;AAAA,EACC;AAAA,EACA;AAAA,OAEM;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { T } from "@bigbluebutton/validate";
|
|
2
|
+
const TL_CANVAS_UI_COLOR_TYPES = /* @__PURE__ */ new Set([
|
|
3
|
+
"accent",
|
|
4
|
+
"white",
|
|
5
|
+
"black",
|
|
6
|
+
"selection-stroke",
|
|
7
|
+
"selection-fill",
|
|
8
|
+
"laser",
|
|
9
|
+
"muted-1"
|
|
10
|
+
]);
|
|
11
|
+
const canvasUiColorTypeValidator = T.setEnum(TL_CANVAS_UI_COLOR_TYPES);
|
|
12
|
+
export {
|
|
13
|
+
TL_CANVAS_UI_COLOR_TYPES,
|
|
14
|
+
canvasUiColorTypeValidator
|
|
15
|
+
};
|
|
16
|
+
//# sourceMappingURL=TLColor.mjs.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../src/misc/TLColor.ts"],
|
|
4
|
+
"sourcesContent": ["import { T } from '@bigbluebutton/validate'\nimport { SetValue } from '../util-types'\n\n/**\n * The colors used by tldraw's default shapes.\n *\n * @public */\nexport const TL_CANVAS_UI_COLOR_TYPES = new Set([\n\t'accent',\n\t'white',\n\t'black',\n\t'selection-stroke',\n\t'selection-fill',\n\t'laser',\n\t'muted-1',\n] as const)\n\n/**\n * A type for the colors used by tldraw's default shapes.\n *\n * @public */\nexport type TLCanvasUiColor = SetValue<typeof TL_CANVAS_UI_COLOR_TYPES>\n\n/**\n * A validator for the colors used by tldraw's default shapes.\n *\n * @public */\nexport const canvasUiColorTypeValidator = T.setEnum(TL_CANVAS_UI_COLOR_TYPES)\n"],
|
|
5
|
+
"mappings": "AAAA,SAAS,SAAS;AAOX,MAAM,2BAA2B,oBAAI,IAAI;AAAA,EAC/C;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACD,CAAU;AAYH,MAAM,6BAA6B,EAAE,QAAQ,wBAAwB;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import { T } from "@bigbluebutton/validate";
|
|
2
|
+
const TL_CURSOR_TYPES = /* @__PURE__ */ new Set([
|
|
3
|
+
"none",
|
|
4
|
+
"default",
|
|
5
|
+
"pointer",
|
|
6
|
+
"cross",
|
|
7
|
+
"grab",
|
|
8
|
+
"rotate",
|
|
9
|
+
"grabbing",
|
|
10
|
+
"resize-edge",
|
|
11
|
+
"resize-corner",
|
|
12
|
+
"text",
|
|
13
|
+
"move",
|
|
14
|
+
"ew-resize",
|
|
15
|
+
"ns-resize",
|
|
16
|
+
"nesw-resize",
|
|
17
|
+
"nwse-resize",
|
|
18
|
+
"nesw-rotate",
|
|
19
|
+
"nwse-rotate",
|
|
20
|
+
"swne-rotate",
|
|
21
|
+
"senw-rotate",
|
|
22
|
+
"zoom-in",
|
|
23
|
+
"zoom-out"
|
|
24
|
+
]);
|
|
25
|
+
const cursorTypeValidator = T.setEnum(TL_CURSOR_TYPES);
|
|
26
|
+
const cursorValidator = T.object({
|
|
27
|
+
type: cursorTypeValidator,
|
|
28
|
+
rotation: T.number
|
|
29
|
+
});
|
|
30
|
+
export {
|
|
31
|
+
TL_CURSOR_TYPES,
|
|
32
|
+
cursorTypeValidator,
|
|
33
|
+
cursorValidator
|
|
34
|
+
};
|
|
35
|
+
//# sourceMappingURL=TLCursor.mjs.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../src/misc/TLCursor.ts"],
|
|
4
|
+
"sourcesContent": ["import { T } from '@bigbluebutton/validate'\nimport { SetValue } from '../util-types'\n\n/**\n * The cursor types used by tldraw's default shapes.\n *\n * @public */\nexport const TL_CURSOR_TYPES = new Set([\n\t'none',\n\t'default',\n\t'pointer',\n\t'cross',\n\t'grab',\n\t'rotate',\n\t'grabbing',\n\t'resize-edge',\n\t'resize-corner',\n\t'text',\n\t'move',\n\t'ew-resize',\n\t'ns-resize',\n\t'nesw-resize',\n\t'nwse-resize',\n\t'nesw-rotate',\n\t'nwse-rotate',\n\t'swne-rotate',\n\t'senw-rotate',\n\t'zoom-in',\n\t'zoom-out',\n])\n\n/**\n * A type for the cursor types used by tldraw's default shapes.\n *\n * @public */\nexport type TLCursorType = SetValue<typeof TL_CURSOR_TYPES>\n\n/** @internal */\nexport const cursorTypeValidator = T.setEnum(TL_CURSOR_TYPES)\n\n/**\n * A cursor used by tldraw.\n *\n * @public */\nexport interface TLCursor {\n\ttype: TLCursorType\n\trotation: number\n}\n\n/** @internal */\nexport const cursorValidator: T.Validator<TLCursor> = T.object<TLCursor>({\n\ttype: cursorTypeValidator,\n\trotation: T.number,\n})\n"],
|
|
5
|
+
"mappings": "AAAA,SAAS,SAAS;AAOX,MAAM,kBAAkB,oBAAI,IAAI;AAAA,EACtC;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACD,CAAC;AASM,MAAM,sBAAsB,EAAE,QAAQ,eAAe;AAYrD,MAAM,kBAAyC,EAAE,OAAiB;AAAA,EACxE,MAAM;AAAA,EACN,UAAU,EAAE;AACb,CAAC;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { T } from "@bigbluebutton/validate";
|
|
2
|
+
const TL_HANDLE_TYPES = /* @__PURE__ */ new Set(["vertex", "virtual", "create"]);
|
|
3
|
+
const handleValidator = T.object({
|
|
4
|
+
id: T.string,
|
|
5
|
+
type: T.setEnum(TL_HANDLE_TYPES),
|
|
6
|
+
canBind: T.boolean.optional(),
|
|
7
|
+
canSnap: T.boolean.optional(),
|
|
8
|
+
index: T.string,
|
|
9
|
+
x: T.number,
|
|
10
|
+
y: T.number
|
|
11
|
+
});
|
|
12
|
+
export {
|
|
13
|
+
TL_HANDLE_TYPES,
|
|
14
|
+
handleValidator
|
|
15
|
+
};
|
|
16
|
+
//# sourceMappingURL=TLHandle.mjs.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../src/misc/TLHandle.ts"],
|
|
4
|
+
"sourcesContent": ["import { T } from '@bigbluebutton/validate'\nimport { SetValue } from '../util-types'\n\n/**\n * The handle types used by tldraw's default shapes.\n *\n * @public */\nexport const TL_HANDLE_TYPES = new Set(['vertex', 'virtual', 'create'] as const)\n\n/**\n * A type for the handle types used by tldraw's default shapes.\n *\n * @public */\nexport type TLHandleType = SetValue<typeof TL_HANDLE_TYPES>\n\n/**\n * A base interface for a shape's handles.\n *\n * @public\n */\nexport interface TLHandle {\n\t/** A unique identifier for the handle. */\n\tid: string\n\ttype: TLHandleType\n\tcanBind?: boolean\n\tcanSnap?: boolean\n\tindex: string\n\tx: number\n\ty: number\n}\n\n/** @internal */\nexport const handleValidator: T.Validator<TLHandle> = T.object({\n\tid: T.string,\n\ttype: T.setEnum(TL_HANDLE_TYPES),\n\tcanBind: T.boolean.optional(),\n\tcanSnap: T.boolean.optional(),\n\tindex: T.string,\n\tx: T.number,\n\ty: T.number,\n})\n"],
|
|
5
|
+
"mappings": "AAAA,SAAS,SAAS;AAOX,MAAM,kBAAkB,oBAAI,IAAI,CAAC,UAAU,WAAW,QAAQ,CAAU;AAyBxE,MAAM,kBAAyC,EAAE,OAAO;AAAA,EAC9D,IAAI,EAAE;AAAA,EACN,MAAM,EAAE,QAAQ,eAAe;AAAA,EAC/B,SAAS,EAAE,QAAQ,SAAS;AAAA,EAC5B,SAAS,EAAE,QAAQ,SAAS;AAAA,EAC5B,OAAO,EAAE;AAAA,EACT,GAAG,EAAE;AAAA,EACL,GAAG,EAAE;AACN,CAAC;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { T } from "@bigbluebutton/validate";
|
|
2
|
+
const opacityValidator = T.number.check((n) => {
|
|
3
|
+
if (n < 0 || n > 1) {
|
|
4
|
+
throw new T.ValidationError("Opacity must be between 0 and 1");
|
|
5
|
+
}
|
|
6
|
+
});
|
|
7
|
+
export {
|
|
8
|
+
opacityValidator
|
|
9
|
+
};
|
|
10
|
+
//# sourceMappingURL=TLOpacity.mjs.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../src/misc/TLOpacity.ts"],
|
|
4
|
+
"sourcesContent": ["import { T } from '@bigbluebutton/validate'\n\n/** @public */\nexport type TLOpacityType = number\n\n/** @internal */\nexport const opacityValidator = T.number.check((n) => {\n\tif (n < 0 || n > 1) {\n\t\tthrow new T.ValidationError('Opacity must be between 0 and 1')\n\t}\n})\n"],
|
|
5
|
+
"mappings": "AAAA,SAAS,SAAS;AAMX,MAAM,mBAAmB,EAAE,OAAO,MAAM,CAAC,MAAM;AACrD,MAAI,IAAI,KAAK,IAAI,GAAG;AACnB,UAAM,IAAI,EAAE,gBAAgB,iCAAiC;AAAA,EAC9D;AACD,CAAC;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { T } from "@bigbluebutton/validate";
|
|
2
|
+
import { canvasUiColorTypeValidator } from "./TLColor.mjs";
|
|
3
|
+
import { vec2dModelValidator } from "./geometry-types.mjs";
|
|
4
|
+
const TL_SCRIBBLE_STATES = /* @__PURE__ */ new Set(["starting", "paused", "active", "stopping"]);
|
|
5
|
+
const scribbleValidator = T.object({
|
|
6
|
+
id: T.string,
|
|
7
|
+
points: T.arrayOf(vec2dModelValidator),
|
|
8
|
+
size: T.positiveNumber,
|
|
9
|
+
color: canvasUiColorTypeValidator,
|
|
10
|
+
opacity: T.number,
|
|
11
|
+
state: T.setEnum(TL_SCRIBBLE_STATES),
|
|
12
|
+
delay: T.number,
|
|
13
|
+
shrink: T.number,
|
|
14
|
+
taper: T.boolean
|
|
15
|
+
});
|
|
16
|
+
export {
|
|
17
|
+
TL_SCRIBBLE_STATES,
|
|
18
|
+
scribbleValidator
|
|
19
|
+
};
|
|
20
|
+
//# sourceMappingURL=TLScribble.mjs.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../src/misc/TLScribble.ts"],
|
|
4
|
+
"sourcesContent": ["import { T } from '@bigbluebutton/validate'\nimport { SetValue } from '../util-types'\nimport { TLCanvasUiColor, canvasUiColorTypeValidator } from './TLColor'\nimport { Vec2dModel, vec2dModelValidator } from './geometry-types'\n\n/**\n * The scribble states used by tldraw.\n *\n * @public */\nexport const TL_SCRIBBLE_STATES = new Set(['starting', 'paused', 'active', 'stopping'] as const)\n\n/**\n * A type for the scribble used by tldraw.\n *\n * @public */\nexport type TLScribble = {\n\tid: string\n\tpoints: Vec2dModel[]\n\tsize: number\n\tcolor: TLCanvasUiColor\n\topacity: number\n\tstate: SetValue<typeof TL_SCRIBBLE_STATES>\n\tdelay: number\n\tshrink: number\n\ttaper: boolean\n}\n\n/** @internal */\nexport const scribbleValidator: T.Validator<TLScribble> = T.object({\n\tid: T.string,\n\tpoints: T.arrayOf(vec2dModelValidator),\n\tsize: T.positiveNumber,\n\tcolor: canvasUiColorTypeValidator,\n\topacity: T.number,\n\tstate: T.setEnum(TL_SCRIBBLE_STATES),\n\tdelay: T.number,\n\tshrink: T.number,\n\ttaper: T.boolean,\n})\n"],
|
|
5
|
+
"mappings": "AAAA,SAAS,SAAS;AAElB,SAA0B,kCAAkC;AAC5D,SAAqB,2BAA2B;AAMzC,MAAM,qBAAqB,oBAAI,IAAI,CAAC,YAAY,UAAU,UAAU,UAAU,CAAU;AAmBxF,MAAM,oBAA6C,EAAE,OAAO;AAAA,EAClE,IAAI,EAAE;AAAA,EACN,QAAQ,EAAE,QAAQ,mBAAmB;AAAA,EACrC,MAAM,EAAE;AAAA,EACR,OAAO;AAAA,EACP,SAAS,EAAE;AAAA,EACX,OAAO,EAAE,QAAQ,kBAAkB;AAAA,EACnC,OAAO,EAAE;AAAA,EACT,QAAQ,EAAE;AAAA,EACV,OAAO,EAAE;AACV,CAAC;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { T } from "@bigbluebutton/validate";
|
|
2
|
+
const vec2dModelValidator = T.object({
|
|
3
|
+
x: T.number,
|
|
4
|
+
y: T.number,
|
|
5
|
+
z: T.number.optional()
|
|
6
|
+
});
|
|
7
|
+
const box2dModelValidator = T.object({
|
|
8
|
+
x: T.number,
|
|
9
|
+
y: T.number,
|
|
10
|
+
w: T.number,
|
|
11
|
+
h: T.number
|
|
12
|
+
});
|
|
13
|
+
export {
|
|
14
|
+
box2dModelValidator,
|
|
15
|
+
vec2dModelValidator
|
|
16
|
+
};
|
|
17
|
+
//# sourceMappingURL=geometry-types.mjs.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../src/misc/geometry-types.ts"],
|
|
4
|
+
"sourcesContent": ["import { T } from '@bigbluebutton/validate'\n\n/**\n * A serializable model for 2D boxes.\n *\n * @public */\nexport interface Box2dModel {\n\tx: number\n\ty: number\n\tw: number\n\th: number\n}\n\n/**\n * A serializable model for 2D vectors.\n *\n * @public */\nexport interface Vec2dModel {\n\tx: number\n\ty: number\n\tz?: number\n}\n\n/** @public */\nexport const vec2dModelValidator: T.Validator<Vec2dModel> = T.object({\n\tx: T.number,\n\ty: T.number,\n\tz: T.number.optional(),\n})\n\n/** @public */\nexport const box2dModelValidator: T.Validator<Box2dModel> = T.object({\n\tx: T.number,\n\ty: T.number,\n\tw: T.number,\n\th: T.number,\n})\n"],
|
|
5
|
+
"mappings": "AAAA,SAAS,SAAS;AAwBX,MAAM,sBAA+C,EAAE,OAAO;AAAA,EACpE,GAAG,EAAE;AAAA,EACL,GAAG,EAAE;AAAA,EACL,GAAG,EAAE,OAAO,SAAS;AACtB,CAAC;AAGM,MAAM,sBAA+C,EAAE,OAAO;AAAA,EACpE,GAAG,EAAE;AAAA,EACL,GAAG,EAAE;AAAA,EACL,GAAG,EAAE;AAAA,EACL,GAAG,EAAE;AACN,CAAC;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { T } from "@bigbluebutton/validate";
|
|
2
|
+
function idValidator(prefix) {
|
|
3
|
+
return T.string.refine((id) => {
|
|
4
|
+
if (!id.startsWith(`${prefix}:`)) {
|
|
5
|
+
throw new Error(`${prefix} ID must start with "${prefix}:"`);
|
|
6
|
+
}
|
|
7
|
+
return id;
|
|
8
|
+
});
|
|
9
|
+
}
|
|
10
|
+
export {
|
|
11
|
+
idValidator
|
|
12
|
+
};
|
|
13
|
+
//# sourceMappingURL=id-validator.mjs.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../src/misc/id-validator.ts"],
|
|
4
|
+
"sourcesContent": ["import type { RecordId, UnknownRecord } from '@bigbluebutton/store'\nimport { T } from '@bigbluebutton/validate'\n\n/** @internal */\nexport function idValidator<Id extends RecordId<UnknownRecord>>(\n\tprefix: Id['__type__']['typeName']\n): T.Validator<Id> {\n\treturn T.string.refine((id) => {\n\t\tif (!id.startsWith(`${prefix}:`)) {\n\t\t\tthrow new Error(`${prefix} ID must start with \"${prefix}:\"`)\n\t\t}\n\t\treturn id as Id\n\t})\n}\n"],
|
|
5
|
+
"mappings": "AACA,SAAS,SAAS;AAGX,SAAS,YACf,QACkB;AAClB,SAAO,EAAE,OAAO,OAAO,CAAC,OAAO;AAC9B,QAAI,CAAC,GAAG,WAAW,GAAG,MAAM,GAAG,GAAG;AACjC,YAAM,IAAI,MAAM,GAAG,MAAM,wBAAwB,MAAM,IAAI;AAAA,IAC5D;AACA,WAAO;AAAA,EACR,CAAC;AACF;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
import { createRecordType, defineMigrations } from "@bigbluebutton/store";
|
|
2
|
+
import { T } from "@bigbluebutton/validate";
|
|
3
|
+
import {
|
|
4
|
+
bookmarkAssetMigrations,
|
|
5
|
+
bookmarkAssetValidator
|
|
6
|
+
} from "../assets/TLBookmarkAsset.mjs";
|
|
7
|
+
import { imageAssetMigrations, imageAssetValidator } from "../assets/TLImageAsset.mjs";
|
|
8
|
+
import { videoAssetMigrations, videoAssetValidator } from "../assets/TLVideoAsset.mjs";
|
|
9
|
+
const assetValidator = T.model(
|
|
10
|
+
"asset",
|
|
11
|
+
T.union("type", {
|
|
12
|
+
image: imageAssetValidator,
|
|
13
|
+
video: videoAssetValidator,
|
|
14
|
+
bookmark: bookmarkAssetValidator
|
|
15
|
+
})
|
|
16
|
+
);
|
|
17
|
+
const assetVersions = {
|
|
18
|
+
AddMeta: 1
|
|
19
|
+
};
|
|
20
|
+
const assetMigrations = defineMigrations({
|
|
21
|
+
subTypeKey: "type",
|
|
22
|
+
subTypeMigrations: {
|
|
23
|
+
image: imageAssetMigrations,
|
|
24
|
+
video: videoAssetMigrations,
|
|
25
|
+
bookmark: bookmarkAssetMigrations
|
|
26
|
+
},
|
|
27
|
+
currentVersion: assetVersions.AddMeta,
|
|
28
|
+
migrators: {
|
|
29
|
+
[assetVersions.AddMeta]: {
|
|
30
|
+
up: (record) => {
|
|
31
|
+
return {
|
|
32
|
+
...record,
|
|
33
|
+
meta: {}
|
|
34
|
+
};
|
|
35
|
+
},
|
|
36
|
+
down: ({ meta: _, ...record }) => {
|
|
37
|
+
return {
|
|
38
|
+
...record
|
|
39
|
+
};
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
});
|
|
44
|
+
const AssetRecordType = createRecordType("asset", {
|
|
45
|
+
migrations: assetMigrations,
|
|
46
|
+
validator: assetValidator,
|
|
47
|
+
scope: "document"
|
|
48
|
+
}).withDefaultProperties(() => ({
|
|
49
|
+
meta: {}
|
|
50
|
+
}));
|
|
51
|
+
export {
|
|
52
|
+
AssetRecordType,
|
|
53
|
+
assetMigrations,
|
|
54
|
+
assetValidator,
|
|
55
|
+
assetVersions
|
|
56
|
+
};
|
|
57
|
+
//# sourceMappingURL=TLAsset.mjs.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../src/records/TLAsset.ts"],
|
|
4
|
+
"sourcesContent": ["import { createRecordType, defineMigrations, RecordId } from '@bigbluebutton/store'\nimport { T } from '@bigbluebutton/validate'\nimport { TLBaseAsset } from '../assets/TLBaseAsset'\nimport {\n\tbookmarkAssetMigrations,\n\tbookmarkAssetValidator,\n\tTLBookmarkAsset,\n} from '../assets/TLBookmarkAsset'\nimport { imageAssetMigrations, imageAssetValidator, TLImageAsset } from '../assets/TLImageAsset'\nimport { TLVideoAsset, videoAssetMigrations, videoAssetValidator } from '../assets/TLVideoAsset'\nimport { TLShape } from './TLShape'\n\n/** @public */\nexport type TLAsset = TLImageAsset | TLVideoAsset | TLBookmarkAsset\n\n/** @internal */\nexport const assetValidator: T.Validator<TLAsset> = T.model(\n\t'asset',\n\tT.union('type', {\n\t\timage: imageAssetValidator,\n\t\tvideo: videoAssetValidator,\n\t\tbookmark: bookmarkAssetValidator,\n\t})\n)\n\n/** @internal */\nexport const assetVersions = {\n\tAddMeta: 1,\n}\n\n/** @internal */\nexport const assetMigrations = defineMigrations({\n\tsubTypeKey: 'type',\n\tsubTypeMigrations: {\n\t\timage: imageAssetMigrations,\n\t\tvideo: videoAssetMigrations,\n\t\tbookmark: bookmarkAssetMigrations,\n\t},\n\tcurrentVersion: assetVersions.AddMeta,\n\tmigrators: {\n\t\t[assetVersions.AddMeta]: {\n\t\t\tup: (record) => {\n\t\t\t\treturn {\n\t\t\t\t\t...record,\n\t\t\t\t\tmeta: {},\n\t\t\t\t}\n\t\t\t},\n\t\t\tdown: ({ meta: _, ...record }) => {\n\t\t\t\treturn {\n\t\t\t\t\t...record,\n\t\t\t\t}\n\t\t\t},\n\t\t},\n\t},\n})\n\n/** @public */\nexport type TLAssetPartial<T extends TLAsset = TLAsset> = T extends T\n\t? {\n\t\t\tid: TLAssetId\n\t\t\ttype: T['type']\n\t\t\tprops?: Partial<T['props']>\n\t\t\tmeta?: Partial<T['meta']>\n\t } & Partial<Omit<T, 'type' | 'id' | 'props' | 'meta'>>\n\t: never\n\n/** @public */\nexport const AssetRecordType = createRecordType<TLAsset>('asset', {\n\tmigrations: assetMigrations,\n\tvalidator: assetValidator,\n\tscope: 'document',\n}).withDefaultProperties(() => ({\n\tmeta: {},\n}))\n\n/** @public */\nexport type TLAssetId = RecordId<TLBaseAsset<any, any>>\n\n/** @public */\nexport type TLAssetShape = Extract<TLShape, { props: { assetId: TLAssetId } }>\n"],
|
|
5
|
+
"mappings": "AAAA,SAAS,kBAAkB,wBAAkC;AAC7D,SAAS,SAAS;AAElB;AAAA,EACC;AAAA,EACA;AAAA,OAEM;AACP,SAAS,sBAAsB,2BAAyC;AACxE,SAAuB,sBAAsB,2BAA2B;AAOjE,MAAM,iBAAuC,EAAE;AAAA,EACrD;AAAA,EACA,EAAE,MAAM,QAAQ;AAAA,IACf,OAAO;AAAA,IACP,OAAO;AAAA,IACP,UAAU;AAAA,EACX,CAAC;AACF;AAGO,MAAM,gBAAgB;AAAA,EAC5B,SAAS;AACV;AAGO,MAAM,kBAAkB,iBAAiB;AAAA,EAC/C,YAAY;AAAA,EACZ,mBAAmB;AAAA,IAClB,OAAO;AAAA,IACP,OAAO;AAAA,IACP,UAAU;AAAA,EACX;AAAA,EACA,gBAAgB,cAAc;AAAA,EAC9B,WAAW;AAAA,IACV,CAAC,cAAc,OAAO,GAAG;AAAA,MACxB,IAAI,CAAC,WAAW;AACf,eAAO;AAAA,UACN,GAAG;AAAA,UACH,MAAM,CAAC;AAAA,QACR;AAAA,MACD;AAAA,MACA,MAAM,CAAC,EAAE,MAAM,GAAG,GAAG,OAAO,MAAM;AACjC,eAAO;AAAA,UACN,GAAG;AAAA,QACJ;AAAA,MACD;AAAA,IACD;AAAA,EACD;AACD,CAAC;AAaM,MAAM,kBAAkB,iBAA0B,SAAS;AAAA,EACjE,YAAY;AAAA,EACZ,WAAW;AAAA,EACX,OAAO;AACR,CAAC,EAAE,sBAAsB,OAAO;AAAA,EAC/B,MAAM,CAAC;AACR,EAAE;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
import { createRecordType, defineMigrations } from "@bigbluebutton/store";
|
|
2
|
+
import { T } from "@bigbluebutton/validate";
|
|
3
|
+
import { idValidator } from "../misc/id-validator.mjs";
|
|
4
|
+
const cameraValidator = T.model(
|
|
5
|
+
"camera",
|
|
6
|
+
T.object({
|
|
7
|
+
typeName: T.literal("camera"),
|
|
8
|
+
id: idValidator("camera"),
|
|
9
|
+
x: T.number,
|
|
10
|
+
y: T.number,
|
|
11
|
+
z: T.number,
|
|
12
|
+
meta: T.jsonValue
|
|
13
|
+
})
|
|
14
|
+
);
|
|
15
|
+
const cameraVersions = {
|
|
16
|
+
AddMeta: 1
|
|
17
|
+
};
|
|
18
|
+
const cameraMigrations = defineMigrations({
|
|
19
|
+
currentVersion: cameraVersions.AddMeta,
|
|
20
|
+
migrators: {
|
|
21
|
+
[cameraVersions.AddMeta]: {
|
|
22
|
+
up: (record) => {
|
|
23
|
+
return {
|
|
24
|
+
...record,
|
|
25
|
+
meta: {}
|
|
26
|
+
};
|
|
27
|
+
},
|
|
28
|
+
down: ({ meta: _, ...record }) => {
|
|
29
|
+
return {
|
|
30
|
+
...record
|
|
31
|
+
};
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
});
|
|
36
|
+
const CameraRecordType = createRecordType("camera", {
|
|
37
|
+
validator: cameraValidator,
|
|
38
|
+
migrations: cameraMigrations,
|
|
39
|
+
scope: "session"
|
|
40
|
+
}).withDefaultProperties(
|
|
41
|
+
() => ({
|
|
42
|
+
x: 0,
|
|
43
|
+
y: 0,
|
|
44
|
+
z: 1,
|
|
45
|
+
meta: {}
|
|
46
|
+
})
|
|
47
|
+
);
|
|
48
|
+
export {
|
|
49
|
+
CameraRecordType,
|
|
50
|
+
cameraMigrations,
|
|
51
|
+
cameraValidator,
|
|
52
|
+
cameraVersions
|
|
53
|
+
};
|
|
54
|
+
//# sourceMappingURL=TLCamera.mjs.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../src/records/TLCamera.ts"],
|
|
4
|
+
"sourcesContent": ["import { BaseRecord, createRecordType, defineMigrations, RecordId } from '@bigbluebutton/store'\nimport { JsonObject } from '@bigbluebutton/utils'\nimport { T } from '@bigbluebutton/validate'\nimport { idValidator } from '../misc/id-validator'\n\n/**\n * A camera record.\n *\n * @public\n */\nexport interface TLCamera extends BaseRecord<'camera', TLCameraId> {\n\tx: number\n\ty: number\n\tz: number\n\tmeta: JsonObject\n}\n\n/**\n * The id of a camera record.\n *\n * @public */\nexport type TLCameraId = RecordId<TLCamera>\n\n/** @internal */\nexport const cameraValidator: T.Validator<TLCamera> = T.model(\n\t'camera',\n\tT.object({\n\t\ttypeName: T.literal('camera'),\n\t\tid: idValidator<TLCameraId>('camera'),\n\t\tx: T.number,\n\t\ty: T.number,\n\t\tz: T.number,\n\t\tmeta: T.jsonValue as T.ObjectValidator<JsonObject>,\n\t})\n)\n\n/** @internal */\nexport const cameraVersions = {\n\tAddMeta: 1,\n}\n\n/** @internal */\nexport const cameraMigrations = defineMigrations({\n\tcurrentVersion: cameraVersions.AddMeta,\n\tmigrators: {\n\t\t[cameraVersions.AddMeta]: {\n\t\t\tup: (record) => {\n\t\t\t\treturn {\n\t\t\t\t\t...record,\n\t\t\t\t\tmeta: {},\n\t\t\t\t}\n\t\t\t},\n\t\t\tdown: ({ meta: _, ...record }) => {\n\t\t\t\treturn {\n\t\t\t\t\t...record,\n\t\t\t\t}\n\t\t\t},\n\t\t},\n\t},\n})\n\n/** @public */\nexport const CameraRecordType = createRecordType<TLCamera>('camera', {\n\tvalidator: cameraValidator,\n\tmigrations: cameraMigrations,\n\tscope: 'session',\n}).withDefaultProperties(\n\t(): Omit<TLCamera, 'id' | 'typeName'> => ({\n\t\tx: 0,\n\t\ty: 0,\n\t\tz: 1,\n\t\tmeta: {},\n\t})\n)\n"],
|
|
5
|
+
"mappings": "AAAA,SAAqB,kBAAkB,wBAAkC;AAEzE,SAAS,SAAS;AAClB,SAAS,mBAAmB;AAqBrB,MAAM,kBAAyC,EAAE;AAAA,EACvD;AAAA,EACA,EAAE,OAAO;AAAA,IACR,UAAU,EAAE,QAAQ,QAAQ;AAAA,IAC5B,IAAI,YAAwB,QAAQ;AAAA,IACpC,GAAG,EAAE;AAAA,IACL,GAAG,EAAE;AAAA,IACL,GAAG,EAAE;AAAA,IACL,MAAM,EAAE;AAAA,EACT,CAAC;AACF;AAGO,MAAM,iBAAiB;AAAA,EAC7B,SAAS;AACV;AAGO,MAAM,mBAAmB,iBAAiB;AAAA,EAChD,gBAAgB,eAAe;AAAA,EAC/B,WAAW;AAAA,IACV,CAAC,eAAe,OAAO,GAAG;AAAA,MACzB,IAAI,CAAC,WAAW;AACf,eAAO;AAAA,UACN,GAAG;AAAA,UACH,MAAM,CAAC;AAAA,QACR;AAAA,MACD;AAAA,MACA,MAAM,CAAC,EAAE,MAAM,GAAG,GAAG,OAAO,MAAM;AACjC,eAAO;AAAA,UACN,GAAG;AAAA,QACJ;AAAA,MACD;AAAA,IACD;AAAA,EACD;AACD,CAAC;AAGM,MAAM,mBAAmB,iBAA2B,UAAU;AAAA,EACpE,WAAW;AAAA,EACX,YAAY;AAAA,EACZ,OAAO;AACR,CAAC,EAAE;AAAA,EACF,OAA0C;AAAA,IACzC,GAAG;AAAA,IACH,GAAG;AAAA,IACH,GAAG;AAAA,IACH,MAAM,CAAC;AAAA,EACR;AACD;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
import { createRecordType, defineMigrations } from "@bigbluebutton/store";
|
|
2
|
+
import { T } from "@bigbluebutton/validate";
|
|
3
|
+
const documentValidator = T.model(
|
|
4
|
+
"document",
|
|
5
|
+
T.object({
|
|
6
|
+
typeName: T.literal("document"),
|
|
7
|
+
id: T.literal("document:document"),
|
|
8
|
+
gridSize: T.number,
|
|
9
|
+
name: T.string,
|
|
10
|
+
meta: T.jsonValue
|
|
11
|
+
})
|
|
12
|
+
);
|
|
13
|
+
const documentVersions = {
|
|
14
|
+
AddName: 1,
|
|
15
|
+
AddMeta: 2
|
|
16
|
+
};
|
|
17
|
+
const documentMigrations = defineMigrations({
|
|
18
|
+
currentVersion: documentVersions.AddMeta,
|
|
19
|
+
migrators: {
|
|
20
|
+
[documentVersions.AddName]: {
|
|
21
|
+
up: (document) => {
|
|
22
|
+
return { ...document, name: "" };
|
|
23
|
+
},
|
|
24
|
+
down: ({ name: _, ...document }) => {
|
|
25
|
+
return document;
|
|
26
|
+
}
|
|
27
|
+
},
|
|
28
|
+
[documentVersions.AddMeta]: {
|
|
29
|
+
up: (record) => {
|
|
30
|
+
return {
|
|
31
|
+
...record,
|
|
32
|
+
meta: {}
|
|
33
|
+
};
|
|
34
|
+
},
|
|
35
|
+
down: ({ meta: _, ...record }) => {
|
|
36
|
+
return {
|
|
37
|
+
...record
|
|
38
|
+
};
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
});
|
|
43
|
+
const DocumentRecordType = createRecordType("document", {
|
|
44
|
+
migrations: documentMigrations,
|
|
45
|
+
validator: documentValidator,
|
|
46
|
+
scope: "document"
|
|
47
|
+
}).withDefaultProperties(
|
|
48
|
+
() => ({
|
|
49
|
+
gridSize: 10,
|
|
50
|
+
name: "",
|
|
51
|
+
meta: {}
|
|
52
|
+
})
|
|
53
|
+
);
|
|
54
|
+
const TLDOCUMENT_ID = DocumentRecordType.createId("document");
|
|
55
|
+
export {
|
|
56
|
+
DocumentRecordType,
|
|
57
|
+
TLDOCUMENT_ID,
|
|
58
|
+
documentMigrations,
|
|
59
|
+
documentValidator,
|
|
60
|
+
documentVersions
|
|
61
|
+
};
|
|
62
|
+
//# sourceMappingURL=TLDocument.mjs.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../src/records/TLDocument.ts"],
|
|
4
|
+
"sourcesContent": ["import { BaseRecord, createRecordType, defineMigrations, RecordId } from '@bigbluebutton/store'\nimport { JsonObject } from '@bigbluebutton/utils'\nimport { T } from '@bigbluebutton/validate'\n\n/**\n * TLDocument\n *\n * @public\n */\nexport interface TLDocument extends BaseRecord<'document', RecordId<TLDocument>> {\n\tgridSize: number\n\tname: string\n\tmeta: JsonObject\n}\n\n/** @internal */\nexport const documentValidator: T.Validator<TLDocument> = T.model(\n\t'document',\n\tT.object({\n\t\ttypeName: T.literal('document'),\n\t\tid: T.literal('document:document' as RecordId<TLDocument>),\n\t\tgridSize: T.number,\n\t\tname: T.string,\n\t\tmeta: T.jsonValue as T.ObjectValidator<JsonObject>,\n\t})\n)\n\n/** @internal */\nexport const documentVersions = {\n\tAddName: 1,\n\tAddMeta: 2,\n} as const\n\n/** @internal */\nexport const documentMigrations = defineMigrations({\n\tcurrentVersion: documentVersions.AddMeta,\n\tmigrators: {\n\t\t[documentVersions.AddName]: {\n\t\t\tup: (document: TLDocument) => {\n\t\t\t\treturn { ...document, name: '' }\n\t\t\t},\n\t\t\tdown: ({ name: _, ...document }: TLDocument) => {\n\t\t\t\treturn document\n\t\t\t},\n\t\t},\n\t\t[documentVersions.AddMeta]: {\n\t\t\tup: (record) => {\n\t\t\t\treturn {\n\t\t\t\t\t...record,\n\t\t\t\t\tmeta: {},\n\t\t\t\t}\n\t\t\t},\n\t\t\tdown: ({ meta: _, ...record }) => {\n\t\t\t\treturn {\n\t\t\t\t\t...record,\n\t\t\t\t}\n\t\t\t},\n\t\t},\n\t},\n})\n\n/** @public */\nexport const DocumentRecordType = createRecordType<TLDocument>('document', {\n\tmigrations: documentMigrations,\n\tvalidator: documentValidator,\n\tscope: 'document',\n}).withDefaultProperties(\n\t(): Omit<TLDocument, 'id' | 'typeName'> => ({\n\t\tgridSize: 10,\n\t\tname: '',\n\t\tmeta: {},\n\t})\n)\n\n// all document records have the same ID: 'document:document'\n/** @public */\nexport const TLDOCUMENT_ID: RecordId<TLDocument> = DocumentRecordType.createId('document')\n"],
|
|
5
|
+
"mappings": "AAAA,SAAqB,kBAAkB,wBAAkC;AAEzE,SAAS,SAAS;AAcX,MAAM,oBAA6C,EAAE;AAAA,EAC3D;AAAA,EACA,EAAE,OAAO;AAAA,IACR,UAAU,EAAE,QAAQ,UAAU;AAAA,IAC9B,IAAI,EAAE,QAAQ,mBAA2C;AAAA,IACzD,UAAU,EAAE;AAAA,IACZ,MAAM,EAAE;AAAA,IACR,MAAM,EAAE;AAAA,EACT,CAAC;AACF;AAGO,MAAM,mBAAmB;AAAA,EAC/B,SAAS;AAAA,EACT,SAAS;AACV;AAGO,MAAM,qBAAqB,iBAAiB;AAAA,EAClD,gBAAgB,iBAAiB;AAAA,EACjC,WAAW;AAAA,IACV,CAAC,iBAAiB,OAAO,GAAG;AAAA,MAC3B,IAAI,CAAC,aAAyB;AAC7B,eAAO,EAAE,GAAG,UAAU,MAAM,GAAG;AAAA,MAChC;AAAA,MACA,MAAM,CAAC,EAAE,MAAM,GAAG,GAAG,SAAS,MAAkB;AAC/C,eAAO;AAAA,MACR;AAAA,IACD;AAAA,IACA,CAAC,iBAAiB,OAAO,GAAG;AAAA,MAC3B,IAAI,CAAC,WAAW;AACf,eAAO;AAAA,UACN,GAAG;AAAA,UACH,MAAM,CAAC;AAAA,QACR;AAAA,MACD;AAAA,MACA,MAAM,CAAC,EAAE,MAAM,GAAG,GAAG,OAAO,MAAM;AACjC,eAAO;AAAA,UACN,GAAG;AAAA,QACJ;AAAA,MACD;AAAA,IACD;AAAA,EACD;AACD,CAAC;AAGM,MAAM,qBAAqB,iBAA6B,YAAY;AAAA,EAC1E,YAAY;AAAA,EACZ,WAAW;AAAA,EACX,OAAO;AACR,CAAC,EAAE;AAAA,EACF,OAA4C;AAAA,IAC3C,UAAU;AAAA,IACV,MAAM;AAAA,IACN,MAAM,CAAC;AAAA,EACR;AACD;AAIO,MAAM,gBAAsC,mBAAmB,SAAS,UAAU;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|