@ibodr/schema 0.2.1 → 0.2.3
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/index.d.ts +31 -15
- package/dist/index.mjs +46 -14
- package/dist/index.mjs.map +1 -1
- package/package.json +5 -5
package/dist/index.d.ts
CHANGED
|
@@ -825,6 +825,10 @@ interface DrThemeDefaultColors {
|
|
|
825
825
|
'light-red': DrDefaultColor;
|
|
826
826
|
red: DrDefaultColor;
|
|
827
827
|
white: DrDefaultColor;
|
|
828
|
+
/** Soft pink sticky (Miro-like pastel) */
|
|
829
|
+
pink: DrDefaultColor;
|
|
830
|
+
/** Soft cyan / teal sticky (Miro-like pastel) */
|
|
831
|
+
cyan: DrDefaultColor;
|
|
828
832
|
}
|
|
829
833
|
/**
|
|
830
834
|
* A font definition within a theme. Maps a font style name to a CSS font-family
|
|
@@ -984,14 +988,24 @@ type DrThemeId = keyof DrThemes & string;
|
|
|
984
988
|
type DrDefaultColorStyle = {
|
|
985
989
|
[K in keyof DrThemeDefaultColors]: DrThemeDefaultColors[K] extends DrDefaultColor ? K : never;
|
|
986
990
|
}[keyof DrThemeDefaultColors] & string;
|
|
991
|
+
/**
|
|
992
|
+
* Named theme color **or** a CSS hex (`#RGB` / `#RRGGBB` / `#RRGGBBAA`).
|
|
993
|
+
* Hex values render via {@link getColorValue} pass-through and are used for
|
|
994
|
+
* faithful imports (e.g. Miro sticky pastels).
|
|
995
|
+
*
|
|
996
|
+
* @public
|
|
997
|
+
*/
|
|
998
|
+
type DrColorStyle = DrDefaultColorStyle | (string & {});
|
|
999
|
+
/** @public */
|
|
1000
|
+
declare function isCssHexColor(value: unknown): value is string;
|
|
987
1001
|
/**
|
|
988
1002
|
* @public
|
|
989
1003
|
*/
|
|
990
|
-
declare const DefaultColorStyle: EnumStyleProp<
|
|
1004
|
+
declare const DefaultColorStyle: EnumStyleProp<DrColorStyle>;
|
|
991
1005
|
/**
|
|
992
1006
|
* @public
|
|
993
1007
|
*/
|
|
994
|
-
declare const DefaultLabelColorStyle: EnumStyleProp<
|
|
1008
|
+
declare const DefaultLabelColorStyle: EnumStyleProp<DrColorStyle>;
|
|
995
1009
|
/**
|
|
996
1010
|
* Scan theme definitions and sync color registrations to match.
|
|
997
1011
|
* A color entry is any key in `DrThemeColors` whose value is an object
|
|
@@ -1218,6 +1232,7 @@ declare function registerFontsFromThemes(definitions: DrThemes): void;
|
|
|
1218
1232
|
* Controls the relative size of shape elements like stroke width, text size, and other proportional features.
|
|
1219
1233
|
*
|
|
1220
1234
|
* Available values:
|
|
1235
|
+
* - `xs` - Extra small size
|
|
1221
1236
|
* - `s` - Small size
|
|
1222
1237
|
* - `m` - Medium size (default)
|
|
1223
1238
|
* - `l` - Large size
|
|
@@ -1245,7 +1260,7 @@ declare function registerFontsFromThemes(definitions: DrThemes): void;
|
|
|
1245
1260
|
*
|
|
1246
1261
|
* @public
|
|
1247
1262
|
*/
|
|
1248
|
-
declare const DefaultSizeStyle: EnumStyleProp<"m" | "s" | "l" | "xl">;
|
|
1263
|
+
declare const DefaultSizeStyle: EnumStyleProp<"m" | "xs" | "s" | "l" | "xl">;
|
|
1249
1264
|
/**
|
|
1250
1265
|
* Type representing a default size style value.
|
|
1251
1266
|
* This is a union type of all available size options.
|
|
@@ -1255,6 +1270,7 @@ declare const DefaultSizeStyle: EnumStyleProp<"m" | "s" | "l" | "xl">;
|
|
|
1255
1270
|
* import { DrDefaultSizeStyle } from '@ibodr/schema'
|
|
1256
1271
|
*
|
|
1257
1272
|
* // Valid size values
|
|
1273
|
+
* const extraSmallSize: DrDefaultSizeStyle = 'xs'
|
|
1258
1274
|
* const smallSize: DrDefaultSizeStyle = 's'
|
|
1259
1275
|
* const mediumSize: DrDefaultSizeStyle = 'm'
|
|
1260
1276
|
* const largeSize: DrDefaultSizeStyle = 'l'
|
|
@@ -1589,8 +1605,8 @@ type DrArrowShapeArrowheadStyle = T.TypeOf<typeof ArrowShapeArrowheadStartStyle>
|
|
|
1589
1605
|
*/
|
|
1590
1606
|
interface DrArrowShapeProps {
|
|
1591
1607
|
kind: DrArrowShapeKind;
|
|
1592
|
-
labelColor:
|
|
1593
|
-
color:
|
|
1608
|
+
labelColor: DrColorStyle;
|
|
1609
|
+
color: DrColorStyle;
|
|
1594
1610
|
fill: DrDefaultFillStyle;
|
|
1595
1611
|
dash: DrDefaultDashStyle;
|
|
1596
1612
|
size: DrDefaultSizeStyle;
|
|
@@ -1779,7 +1795,7 @@ interface DrDrawShapeSegment {
|
|
|
1779
1795
|
*/
|
|
1780
1796
|
interface DrDrawShapeProps {
|
|
1781
1797
|
/** Color style for the drawing stroke */
|
|
1782
|
-
color:
|
|
1798
|
+
color: DrColorStyle;
|
|
1783
1799
|
/** Fill style for closed drawing shapes */
|
|
1784
1800
|
fill: DrDefaultFillStyle;
|
|
1785
1801
|
/** Dash pattern style for the stroke */
|
|
@@ -1949,7 +1965,7 @@ interface DrFrameShapeProps {
|
|
|
1949
1965
|
/** Display name for the frame (shown in UI) */
|
|
1950
1966
|
name: string;
|
|
1951
1967
|
/** Color style for the frame border and label */
|
|
1952
|
-
color:
|
|
1968
|
+
color: DrColorStyle;
|
|
1953
1969
|
}
|
|
1954
1970
|
/**
|
|
1955
1971
|
* A frame shape provides a container for organizing and grouping other shapes.
|
|
@@ -2156,9 +2172,9 @@ interface DrGeoShapeProps {
|
|
|
2156
2172
|
/** Scale factor applied to the shape */
|
|
2157
2173
|
scale: number;
|
|
2158
2174
|
/** Color style for text label */
|
|
2159
|
-
labelColor:
|
|
2175
|
+
labelColor: DrColorStyle;
|
|
2160
2176
|
/** Color style for the shape outline */
|
|
2161
|
-
color:
|
|
2177
|
+
color: DrColorStyle;
|
|
2162
2178
|
/** Fill style for the shape interior */
|
|
2163
2179
|
fill: DrDefaultFillStyle;
|
|
2164
2180
|
/** Size/thickness style for outline and text */
|
|
@@ -2311,7 +2327,7 @@ declare const groupShapeMigrations: DrPropsMigrations;
|
|
|
2311
2327
|
*/
|
|
2312
2328
|
interface DrHighlightShapeProps {
|
|
2313
2329
|
/** The color style of the highlight stroke */
|
|
2314
|
-
color:
|
|
2330
|
+
color: DrColorStyle;
|
|
2315
2331
|
/** The size style determining the thickness of the highlight stroke */
|
|
2316
2332
|
size: DrDefaultSizeStyle;
|
|
2317
2333
|
/** Array of segments that make up the highlight stroke path */
|
|
@@ -2642,7 +2658,7 @@ interface DrLineShapePoint {
|
|
|
2642
2658
|
*/
|
|
2643
2659
|
interface DrLineShapeProps {
|
|
2644
2660
|
/** Color style of the line stroke */
|
|
2645
|
-
color:
|
|
2661
|
+
color: DrColorStyle;
|
|
2646
2662
|
/** Dash pattern style for the line (solid, dashed, dotted) */
|
|
2647
2663
|
dash: DrDefaultDashStyle;
|
|
2648
2664
|
/** Size/thickness style of the line stroke */
|
|
@@ -2738,9 +2754,9 @@ declare const lineShapeMigrations: DrPropsMigrations;
|
|
|
2738
2754
|
*/
|
|
2739
2755
|
interface DrNoteShapeProps {
|
|
2740
2756
|
/** Background color style of the note */
|
|
2741
|
-
color:
|
|
2757
|
+
color: DrColorStyle;
|
|
2742
2758
|
/** Text color style for the note content */
|
|
2743
|
-
labelColor:
|
|
2759
|
+
labelColor: DrColorStyle;
|
|
2744
2760
|
/** Size style determining the font size and note dimensions */
|
|
2745
2761
|
size: DrDefaultSizeStyle;
|
|
2746
2762
|
/** Font family style for the note text */
|
|
@@ -2900,7 +2916,7 @@ type DrDefaultTextAlignStyle = T.TypeOf<typeof DefaultTextAlignStyle>;
|
|
|
2900
2916
|
* ```
|
|
2901
2917
|
*/
|
|
2902
2918
|
interface DrTextShapeProps {
|
|
2903
|
-
color:
|
|
2919
|
+
color: DrColorStyle;
|
|
2904
2920
|
size: DrDefaultSizeStyle;
|
|
2905
2921
|
font: DrDefaultFontStyle;
|
|
2906
2922
|
textAlign: DrDefaultTextAlignStyle;
|
|
@@ -6712,4 +6728,4 @@ declare class b64Vecs {
|
|
|
6712
6728
|
static decodeLastPoint(b64Points: string): VecModel | null;
|
|
6713
6729
|
}
|
|
6714
6730
|
|
|
6715
|
-
export { ArrowShapeArrowheadEndStyle, ArrowShapeArrowheadStartStyle, ArrowShapeKindStyle, AssetRecordType, type BoxModel, CameraRecordType, type CreatePresenceStateDerivationOpts, type CustomRecordInfo, DR_BOARD_BACKGROUND_TYPES, DefaultColorStyle, DefaultDashStyle, DefaultFillStyle, DefaultFontFamilies, DefaultFontStyle, DefaultHorizontalAlignStyle, DefaultLabelColorStyle, DefaultSizeStyle, DefaultTextAlignStyle, DefaultVerticalAlignStyle, DocumentRecordType, type DrArrowBinding, type DrArrowBindingProps, type DrArrowShape, type DrArrowShapeArrowheadStyle, type DrArrowShapeKind, type DrArrowShapeProps, type DrAsset, type DrAssetContext, type DrAssetId, type DrAssetPartial, type DrAssetShape, type DrAssetStore, type DrBaseAsset, type DrBaseBinding, type DrBaseShape, type DrBinding, type DrBindingCreate, type DrBindingId, type DrBindingUpdate, type DrBoardBackgroundType, type DrBookmarkAsset, type DrBookmarkShape, type DrBookmarkShapeProps, type DrCamera, type DrCameraId, type DrCanvasUiColor, type DrCreateShapePartial, type DrCursor, type DrCursorType, type DrCustomRecord, DrDOCUMENT_ID, type DrDefaultAsset, type DrDefaultBinding, type DrDefaultColor, type DrDefaultColorStyle, type DrDefaultDashStyle, type DrDefaultFillStyle, type DrDefaultFontStyle, type DrDefaultHorizontalAlignStyle, type DrDefaultRecord, type DrDefaultShape, type DrDefaultSizeStyle, type DrDefaultTextAlignStyle, type DrDefaultVerticalAlignStyle, type DrDocument, type DrDrawShape, type DrDrawShapeProps, type DrDrawShapeSegment, type DrEmbedShape, type DrEmbedShapeProps, type DrFontFace, type DrFontFaceSource, type DrFrameShape, type DrFrameShapeProps, type DrGeoShape, type DrGeoShapeGeoStyle, type DrGeoShapeProps, type DrGlobalAssetPropsMap, type DrGlobalBindingPropsMap, type DrGlobalRecordPropsMap, type DrGlobalShapePropsMap, type DrGroupShape, type DrGroupShapeProps, type DrHandle, type DrHandleType, type DrHighlightShape, type DrHighlightShapeProps, DrINSTANCE_ID, type DrImageAsset, type DrImageShape, type DrImageShapeProps, type DrIndexedAssets, type DrIndexedBindings, type DrIndexedRecords, type DrIndexedShapes, type DrInstance, type DrInstanceId, type DrInstancePageState, type DrInstancePageStateId, type DrInstancePresence, type DrInstancePresenceID, type DrLanguage, type DrLineShape, type DrLineShapePoint, type DrLineShapeProps, type DrLineShapeSplineStyle, type DrNoteShape, type DrNoteShapeProps, type DrOpacityType, DrPOINTER_ID, type DrPage, type DrPageId, type DrParentId, type DrPointer, type DrPointerId, type DrPresenceStateInfo, type DrPropsMigration, type DrPropsMigrations, type DrRecord, type DrRemovedDefaultThemeColors, type DrRichText, type DrSchema, type DrScribble, type DrSerializedStore, type DrShape, type DrShapeCrop, type DrShapeId, type DrShapePartial, type DrStore, type DrStoreProps, type DrStoreSchema, type DrStoreSnapshot, type DrTextShape, type DrTextShapeProps, type DrTheme, type DrThemeColors, type DrThemeDefaultColors, type DrThemeFont, type DrThemeFonts, type DrThemeId, type DrThemeUiColorKeys, type DrThemes, type DrUnknownAsset, type DrUnknownBinding, type DrUnknownShape, type DrUser, type DrUserId, type DrUserStore, type DrVideoAsset, type DrVideoShape, type DrVideoShapeProps, ElbowArrowSnap, EnumStyleProp, type ExtractShapeByProps, GeoShapeGeoStyle, ImageShapeCrop, InstancePageStateRecordType, InstancePresenceRecordType, LANGUAGES, LineShapeSplineStyle, PageRecordType, PointerRecordType, type RecordProps, type RecordPropsType, type SchemaPropsInfo, type SetValue, type ShapeWithCrop, StyleProp, type StylePropValue, TL_CANVAS_UI_COLOR_TYPES, TL_CURSOR_TYPES, TL_HANDLE_TYPES, TL_SCRIBBLE_STATES, UserRecordType, type UserSchemaInfo, type VecModel, arrowBindingMigrations, arrowBindingProps, arrowBindingVersions, arrowShapeMigrations, arrowShapeProps, arrowShapeVersions, assetIdValidator, assetMigrations, b64Vecs, bindingIdValidator, bookmarkAssetMigrations, bookmarkAssetProps, bookmarkShapeMigrations, bookmarkShapeProps, boxModelValidator, canvasUiColorTypeValidator, compressLegacySegments, createAssetPropsMigrationIds, createAssetPropsMigrationSequence, createAssetRecordType, createAssetValidator, createBindingId, createBindingPropsMigrationIds, createBindingPropsMigrationSequence, createBindingValidator, createCachedUserResolve, createCustomRecordId, createCustomRecordMigrationIds, createCustomRecordMigrationSequence, createDrSchema, createPresenceStateDerivation, createShapeId, createShapePropsMigrationIds, createShapePropsMigrationSequence, createShapeValidator, createUserId, createUserRecordType, defaultAssetSchemas, defaultBindingSchemas, defaultShapeSchemas, drawShapeMigrations, drawShapeProps, embedShapeMigrations, embedShapeProps, frameShapeMigrations, frameShapeProps, geoShapeMigrations, geoShapeProps, getDefaultTranslationLocale, getDefaultUserPresence, getShapePropKeysByStyle, groupShapeMigrations, groupShapeProps, highlightShapeMigrations, highlightShapeProps, idValidator, imageAssetMigrations, imageAssetProps, imageShapeMigrations, imageShapeProps, isBinding, isBindingId, isCustomRecord, isCustomRecordId, isDocument, isFontEntry, isPageId, isShape, isShapeId, isUserId, lineShapeMigrations, lineShapeProps, noteShapeMigrations, noteShapeProps, opacityValidator, pageIdValidator, parentIdValidator, pluckPreservingValues, registerColorsFromThemes, registerFontsFromThemes, richTextValidator, rootBindingMigrations, rootShapeMigrations, scribbleValidator, shapeIdValidator, textShapeMigrations, textShapeProps, toRichText, userIdValidator, vecModelValidator, videoAssetMigrations, videoAssetProps, videoShapeMigrations, videoShapeProps };
|
|
6731
|
+
export { ArrowShapeArrowheadEndStyle, ArrowShapeArrowheadStartStyle, ArrowShapeKindStyle, AssetRecordType, type BoxModel, CameraRecordType, type CreatePresenceStateDerivationOpts, type CustomRecordInfo, DR_BOARD_BACKGROUND_TYPES, DefaultColorStyle, DefaultDashStyle, DefaultFillStyle, DefaultFontFamilies, DefaultFontStyle, DefaultHorizontalAlignStyle, DefaultLabelColorStyle, DefaultSizeStyle, DefaultTextAlignStyle, DefaultVerticalAlignStyle, DocumentRecordType, type DrArrowBinding, type DrArrowBindingProps, type DrArrowShape, type DrArrowShapeArrowheadStyle, type DrArrowShapeKind, type DrArrowShapeProps, type DrAsset, type DrAssetContext, type DrAssetId, type DrAssetPartial, type DrAssetShape, type DrAssetStore, type DrBaseAsset, type DrBaseBinding, type DrBaseShape, type DrBinding, type DrBindingCreate, type DrBindingId, type DrBindingUpdate, type DrBoardBackgroundType, type DrBookmarkAsset, type DrBookmarkShape, type DrBookmarkShapeProps, type DrCamera, type DrCameraId, type DrCanvasUiColor, type DrColorStyle, type DrCreateShapePartial, type DrCursor, type DrCursorType, type DrCustomRecord, DrDOCUMENT_ID, type DrDefaultAsset, type DrDefaultBinding, type DrDefaultColor, type DrDefaultColorStyle, type DrDefaultDashStyle, type DrDefaultFillStyle, type DrDefaultFontStyle, type DrDefaultHorizontalAlignStyle, type DrDefaultRecord, type DrDefaultShape, type DrDefaultSizeStyle, type DrDefaultTextAlignStyle, type DrDefaultVerticalAlignStyle, type DrDocument, type DrDrawShape, type DrDrawShapeProps, type DrDrawShapeSegment, type DrEmbedShape, type DrEmbedShapeProps, type DrFontFace, type DrFontFaceSource, type DrFrameShape, type DrFrameShapeProps, type DrGeoShape, type DrGeoShapeGeoStyle, type DrGeoShapeProps, type DrGlobalAssetPropsMap, type DrGlobalBindingPropsMap, type DrGlobalRecordPropsMap, type DrGlobalShapePropsMap, type DrGroupShape, type DrGroupShapeProps, type DrHandle, type DrHandleType, type DrHighlightShape, type DrHighlightShapeProps, DrINSTANCE_ID, type DrImageAsset, type DrImageShape, type DrImageShapeProps, type DrIndexedAssets, type DrIndexedBindings, type DrIndexedRecords, type DrIndexedShapes, type DrInstance, type DrInstanceId, type DrInstancePageState, type DrInstancePageStateId, type DrInstancePresence, type DrInstancePresenceID, type DrLanguage, type DrLineShape, type DrLineShapePoint, type DrLineShapeProps, type DrLineShapeSplineStyle, type DrNoteShape, type DrNoteShapeProps, type DrOpacityType, DrPOINTER_ID, type DrPage, type DrPageId, type DrParentId, type DrPointer, type DrPointerId, type DrPresenceStateInfo, type DrPropsMigration, type DrPropsMigrations, type DrRecord, type DrRemovedDefaultThemeColors, type DrRichText, type DrSchema, type DrScribble, type DrSerializedStore, type DrShape, type DrShapeCrop, type DrShapeId, type DrShapePartial, type DrStore, type DrStoreProps, type DrStoreSchema, type DrStoreSnapshot, type DrTextShape, type DrTextShapeProps, type DrTheme, type DrThemeColors, type DrThemeDefaultColors, type DrThemeFont, type DrThemeFonts, type DrThemeId, type DrThemeUiColorKeys, type DrThemes, type DrUnknownAsset, type DrUnknownBinding, type DrUnknownShape, type DrUser, type DrUserId, type DrUserStore, type DrVideoAsset, type DrVideoShape, type DrVideoShapeProps, ElbowArrowSnap, EnumStyleProp, type ExtractShapeByProps, GeoShapeGeoStyle, ImageShapeCrop, InstancePageStateRecordType, InstancePresenceRecordType, LANGUAGES, LineShapeSplineStyle, PageRecordType, PointerRecordType, type RecordProps, type RecordPropsType, type SchemaPropsInfo, type SetValue, type ShapeWithCrop, StyleProp, type StylePropValue, TL_CANVAS_UI_COLOR_TYPES, TL_CURSOR_TYPES, TL_HANDLE_TYPES, TL_SCRIBBLE_STATES, UserRecordType, type UserSchemaInfo, type VecModel, arrowBindingMigrations, arrowBindingProps, arrowBindingVersions, arrowShapeMigrations, arrowShapeProps, arrowShapeVersions, assetIdValidator, assetMigrations, b64Vecs, bindingIdValidator, bookmarkAssetMigrations, bookmarkAssetProps, bookmarkShapeMigrations, bookmarkShapeProps, boxModelValidator, canvasUiColorTypeValidator, compressLegacySegments, createAssetPropsMigrationIds, createAssetPropsMigrationSequence, createAssetRecordType, createAssetValidator, createBindingId, createBindingPropsMigrationIds, createBindingPropsMigrationSequence, createBindingValidator, createCachedUserResolve, createCustomRecordId, createCustomRecordMigrationIds, createCustomRecordMigrationSequence, createDrSchema, createPresenceStateDerivation, createShapeId, createShapePropsMigrationIds, createShapePropsMigrationSequence, createShapeValidator, createUserId, createUserRecordType, defaultAssetSchemas, defaultBindingSchemas, defaultShapeSchemas, drawShapeMigrations, drawShapeProps, embedShapeMigrations, embedShapeProps, frameShapeMigrations, frameShapeProps, geoShapeMigrations, geoShapeProps, getDefaultTranslationLocale, getDefaultUserPresence, getShapePropKeysByStyle, groupShapeMigrations, groupShapeProps, highlightShapeMigrations, highlightShapeProps, idValidator, imageAssetMigrations, imageAssetProps, imageShapeMigrations, imageShapeProps, isBinding, isBindingId, isCssHexColor, isCustomRecord, isCustomRecordId, isDocument, isFontEntry, isPageId, isShape, isShapeId, isUserId, lineShapeMigrations, lineShapeProps, noteShapeMigrations, noteShapeProps, opacityValidator, pageIdValidator, parentIdValidator, pluckPreservingValues, registerColorsFromThemes, registerFontsFromThemes, richTextValidator, rootBindingMigrations, rootShapeMigrations, scribbleValidator, shapeIdValidator, textShapeMigrations, textShapeProps, toRichText, userIdValidator, vecModelValidator, videoAssetMigrations, videoAssetProps, videoShapeMigrations, videoShapeProps };
|
package/dist/index.mjs
CHANGED
|
@@ -658,8 +658,6 @@ function createPropsMigration(typeName, subType, m) {
|
|
|
658
658
|
} : void 0
|
|
659
659
|
};
|
|
660
660
|
}
|
|
661
|
-
|
|
662
|
-
// src/styles/DrColorStyle.ts
|
|
663
661
|
var defaultColorNames = [
|
|
664
662
|
"black",
|
|
665
663
|
"grey",
|
|
@@ -673,16 +671,48 @@ var defaultColorNames = [
|
|
|
673
671
|
"light-green",
|
|
674
672
|
"light-red",
|
|
675
673
|
"red",
|
|
676
|
-
"white"
|
|
674
|
+
"white",
|
|
675
|
+
"pink",
|
|
676
|
+
"cyan"
|
|
677
677
|
];
|
|
678
|
-
|
|
679
|
-
|
|
680
|
-
|
|
681
|
-
|
|
682
|
-
|
|
683
|
-
|
|
684
|
-
|
|
678
|
+
function isCssHexColor(value) {
|
|
679
|
+
return typeof value === "string" && /^#(?:[0-9a-fA-F]{3}|[0-9a-fA-F]{6}|[0-9a-fA-F]{8})$/.test(value);
|
|
680
|
+
}
|
|
681
|
+
var cssHexColorValidator = T.string.check("css-hex-color", (value) => {
|
|
682
|
+
if (!isCssHexColor(value)) {
|
|
683
|
+
throw new Error(`Expected CSS hex color (#RGB/#RRGGBB/#RRGGBBAA), got ${JSON.stringify(value)}`);
|
|
684
|
+
}
|
|
685
685
|
});
|
|
686
|
+
function colorStyleValidator(namedValues) {
|
|
687
|
+
return T.or(T.literalEnum(...namedValues), cssHexColorValidator);
|
|
688
|
+
}
|
|
689
|
+
var ColorStyleProp = class extends EnumStyleProp {
|
|
690
|
+
constructor(id, defaultValue, values) {
|
|
691
|
+
super(id, defaultValue, values);
|
|
692
|
+
this.rebuildValidator();
|
|
693
|
+
}
|
|
694
|
+
rebuildValidator() {
|
|
695
|
+
this.type = colorStyleValidator(this.values);
|
|
696
|
+
}
|
|
697
|
+
addValues(...newValues) {
|
|
698
|
+
super.addValues(...newValues);
|
|
699
|
+
this.rebuildValidator();
|
|
700
|
+
}
|
|
701
|
+
removeValues(...valuesToRemove) {
|
|
702
|
+
super.removeValues(...valuesToRemove);
|
|
703
|
+
this.rebuildValidator();
|
|
704
|
+
}
|
|
705
|
+
};
|
|
706
|
+
var DefaultColorStyle = new ColorStyleProp(
|
|
707
|
+
"draw:color",
|
|
708
|
+
"black",
|
|
709
|
+
defaultColorNames
|
|
710
|
+
);
|
|
711
|
+
var DefaultLabelColorStyle = new ColorStyleProp(
|
|
712
|
+
"draw:labelColor",
|
|
713
|
+
"black",
|
|
714
|
+
defaultColorNames
|
|
715
|
+
);
|
|
686
716
|
function registerColorsFromThemes(definitions) {
|
|
687
717
|
const colorNames = /* @__PURE__ */ new Set();
|
|
688
718
|
for (const def of Object.values(definitions)) {
|
|
@@ -698,7 +728,9 @@ function registerColorsFromThemes(definitions) {
|
|
|
698
728
|
DefaultColorStyle.addValues(...colorNames);
|
|
699
729
|
DefaultLabelColorStyle.addValues(...colorNames);
|
|
700
730
|
}
|
|
701
|
-
const toRemove = DefaultColorStyle.values.filter(
|
|
731
|
+
const toRemove = DefaultColorStyle.values.filter(
|
|
732
|
+
(v) => !isCssHexColor(v) && !colorNames.has(v)
|
|
733
|
+
);
|
|
702
734
|
if (toRemove.length > 0) {
|
|
703
735
|
DefaultColorStyle.removeValues(...toRemove);
|
|
704
736
|
DefaultLabelColorStyle.removeValues(...toRemove);
|
|
@@ -781,7 +813,7 @@ function registerFontsFromThemes(definitions) {
|
|
|
781
813
|
// src/styles/DrSizeStyle.ts
|
|
782
814
|
var DefaultSizeStyle = StyleProp.defineEnum("draw:size", {
|
|
783
815
|
defaultValue: "m",
|
|
784
|
-
values: ["s", "m", "l", "xl"]
|
|
816
|
+
values: ["xs", "s", "m", "l", "xl"]
|
|
785
817
|
});
|
|
786
818
|
|
|
787
819
|
// src/shapes/DrArrowShape.ts
|
|
@@ -4111,10 +4143,10 @@ function getSupportedLocale(locale) {
|
|
|
4111
4143
|
// src/index.ts
|
|
4112
4144
|
registerDrawLibraryVersion(
|
|
4113
4145
|
"@ibodr/schema",
|
|
4114
|
-
"0.2.
|
|
4146
|
+
"0.2.3",
|
|
4115
4147
|
"esm"
|
|
4116
4148
|
);
|
|
4117
4149
|
|
|
4118
|
-
export { ArrowShapeArrowheadEndStyle, ArrowShapeArrowheadStartStyle, ArrowShapeKindStyle, AssetRecordType, CameraRecordType, DR_BOARD_BACKGROUND_TYPES, DefaultColorStyle, DefaultDashStyle, DefaultFillStyle, DefaultFontFamilies, DefaultFontStyle, DefaultHorizontalAlignStyle, DefaultLabelColorStyle, DefaultSizeStyle, DefaultTextAlignStyle, DefaultVerticalAlignStyle, DocumentRecordType, DrDOCUMENT_ID, DrINSTANCE_ID, DrPOINTER_ID, ElbowArrowSnap, EnumStyleProp, GeoShapeGeoStyle, ImageShapeCrop, InstancePageStateRecordType, InstancePresenceRecordType, LANGUAGES, LineShapeSplineStyle, PageRecordType, PointerRecordType, StyleProp, TL_CANVAS_UI_COLOR_TYPES, TL_CURSOR_TYPES, TL_HANDLE_TYPES, TL_SCRIBBLE_STATES, UserRecordType, arrowBindingMigrations, arrowBindingProps, arrowBindingVersions, arrowShapeMigrations, arrowShapeProps, arrowShapeVersions, assetIdValidator, assetMigrations, b64Vecs, bindingIdValidator, bookmarkAssetMigrations, bookmarkAssetProps, bookmarkShapeMigrations, bookmarkShapeProps, boxModelValidator, canvasUiColorTypeValidator, compressLegacySegments, createAssetPropsMigrationIds, createAssetPropsMigrationSequence, createAssetRecordType, createAssetValidator, createBindingId, createBindingPropsMigrationIds, createBindingPropsMigrationSequence, createBindingValidator, createCachedUserResolve, createCustomRecordId, createCustomRecordMigrationIds, createCustomRecordMigrationSequence, createDrSchema, createPresenceStateDerivation, createShapeId, createShapePropsMigrationIds, createShapePropsMigrationSequence, createShapeValidator, createUserId, createUserRecordType, defaultAssetSchemas, defaultBindingSchemas, defaultShapeSchemas, drawShapeMigrations, drawShapeProps, embedShapeMigrations, embedShapeProps, frameShapeMigrations, frameShapeProps, geoShapeMigrations, geoShapeProps, getDefaultTranslationLocale, getDefaultUserPresence, getShapePropKeysByStyle, groupShapeMigrations, groupShapeProps, highlightShapeMigrations, highlightShapeProps, idValidator, imageAssetMigrations, imageAssetProps, imageShapeMigrations, imageShapeProps, isBinding, isBindingId, isCustomRecord, isCustomRecordId, isDocument, isFontEntry, isPageId, isShape, isShapeId, isUserId, lineShapeMigrations, lineShapeProps, noteShapeMigrations, noteShapeProps, opacityValidator, pageIdValidator, parentIdValidator, pluckPreservingValues, registerColorsFromThemes, registerFontsFromThemes, richTextValidator, rootBindingMigrations, rootShapeMigrations, scribbleValidator, shapeIdValidator, textShapeMigrations, textShapeProps, toRichText, userIdValidator, vecModelValidator, videoAssetMigrations, videoAssetProps, videoShapeMigrations, videoShapeProps };
|
|
4150
|
+
export { ArrowShapeArrowheadEndStyle, ArrowShapeArrowheadStartStyle, ArrowShapeKindStyle, AssetRecordType, CameraRecordType, DR_BOARD_BACKGROUND_TYPES, DefaultColorStyle, DefaultDashStyle, DefaultFillStyle, DefaultFontFamilies, DefaultFontStyle, DefaultHorizontalAlignStyle, DefaultLabelColorStyle, DefaultSizeStyle, DefaultTextAlignStyle, DefaultVerticalAlignStyle, DocumentRecordType, DrDOCUMENT_ID, DrINSTANCE_ID, DrPOINTER_ID, ElbowArrowSnap, EnumStyleProp, GeoShapeGeoStyle, ImageShapeCrop, InstancePageStateRecordType, InstancePresenceRecordType, LANGUAGES, LineShapeSplineStyle, PageRecordType, PointerRecordType, StyleProp, TL_CANVAS_UI_COLOR_TYPES, TL_CURSOR_TYPES, TL_HANDLE_TYPES, TL_SCRIBBLE_STATES, UserRecordType, arrowBindingMigrations, arrowBindingProps, arrowBindingVersions, arrowShapeMigrations, arrowShapeProps, arrowShapeVersions, assetIdValidator, assetMigrations, b64Vecs, bindingIdValidator, bookmarkAssetMigrations, bookmarkAssetProps, bookmarkShapeMigrations, bookmarkShapeProps, boxModelValidator, canvasUiColorTypeValidator, compressLegacySegments, createAssetPropsMigrationIds, createAssetPropsMigrationSequence, createAssetRecordType, createAssetValidator, createBindingId, createBindingPropsMigrationIds, createBindingPropsMigrationSequence, createBindingValidator, createCachedUserResolve, createCustomRecordId, createCustomRecordMigrationIds, createCustomRecordMigrationSequence, createDrSchema, createPresenceStateDerivation, createShapeId, createShapePropsMigrationIds, createShapePropsMigrationSequence, createShapeValidator, createUserId, createUserRecordType, defaultAssetSchemas, defaultBindingSchemas, defaultShapeSchemas, drawShapeMigrations, drawShapeProps, embedShapeMigrations, embedShapeProps, frameShapeMigrations, frameShapeProps, geoShapeMigrations, geoShapeProps, getDefaultTranslationLocale, getDefaultUserPresence, getShapePropKeysByStyle, groupShapeMigrations, groupShapeProps, highlightShapeMigrations, highlightShapeProps, idValidator, imageAssetMigrations, imageAssetProps, imageShapeMigrations, imageShapeProps, isBinding, isBindingId, isCssHexColor, isCustomRecord, isCustomRecordId, isDocument, isFontEntry, isPageId, isShape, isShapeId, isUserId, lineShapeMigrations, lineShapeProps, noteShapeMigrations, noteShapeProps, opacityValidator, pageIdValidator, parentIdValidator, pluckPreservingValues, registerColorsFromThemes, registerFontsFromThemes, richTextValidator, rootBindingMigrations, rootShapeMigrations, scribbleValidator, shapeIdValidator, textShapeMigrations, textShapeProps, toRichText, userIdValidator, vecModelValidator, videoAssetMigrations, videoAssetProps, videoShapeMigrations, videoShapeProps };
|
|
4119
4151
|
//# sourceMappingURL=index.mjs.map
|
|
4120
4152
|
//# sourceMappingURL=index.mjs.map
|