@ibodr/editor 0.1.1 → 0.1.4
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 +19 -1
- package/dist/index.mjs +58 -10
- package/dist/index.mjs.map +1 -1
- package/package.json +7 -7
package/dist/index.d.ts
CHANGED
|
@@ -9061,11 +9061,29 @@ interface EditorProviderProps {
|
|
|
9061
9061
|
/** @public @react */
|
|
9062
9062
|
declare function EditorProvider({ editor, children }: EditorProviderProps): react_jsx_runtime.JSX.Element;
|
|
9063
9063
|
|
|
9064
|
+
/** @public */
|
|
9065
|
+
interface DrCollaboratorCursorProps {
|
|
9066
|
+
/** Screen position relative to the editor container. */
|
|
9067
|
+
point: {
|
|
9068
|
+
x: number;
|
|
9069
|
+
y: number;
|
|
9070
|
+
};
|
|
9071
|
+
color: string;
|
|
9072
|
+
name?: string | null;
|
|
9073
|
+
chatMessage?: string;
|
|
9074
|
+
/** Scale relative to camera zoom (1 = base size at 100% zoom). */
|
|
9075
|
+
scale: number;
|
|
9076
|
+
}
|
|
9077
|
+
|
|
9064
9078
|
/** @public */
|
|
9065
9079
|
interface DrEditorComponents {
|
|
9066
9080
|
Background?: ComponentType | null;
|
|
9067
9081
|
Canvas?: ComponentType<DrCanvasComponentProps> | null;
|
|
9068
9082
|
Grid?: ComponentType<DrGridProps> | null;
|
|
9083
|
+
/** Renders a single collaborator cursor. Pass `null` to hide cursors entirely. */
|
|
9084
|
+
CollaboratorCursor?: ComponentType<DrCollaboratorCursorProps> | null;
|
|
9085
|
+
/** Renders all collaborator cursors. Pass `null` to disable the layer. */
|
|
9086
|
+
CollaboratorCursors?: ComponentType | null;
|
|
9069
9087
|
InFrontOfTheCanvas?: ComponentType | null;
|
|
9070
9088
|
LoadingScreen?: ComponentType | null;
|
|
9071
9089
|
OnTheCanvas?: ComponentType | null;
|
|
@@ -10391,4 +10409,4 @@ declare function uniq<T>(array: {
|
|
|
10391
10409
|
readonly [n: number]: T;
|
|
10392
10410
|
} | null | undefined): T[];
|
|
10393
10411
|
|
|
10394
|
-
export { Arc2d, AssetUtil, BaseBoxShapeTool, BaseBoxShapeUtil, BaseFrameLikeShapeUtil, type BatchMeasurementRequest, type BindingOnChangeOptions, type BindingOnCreateOptions, type BindingOnDeleteOptions, type BindingOnShapeChangeOptions, type BindingOnShapeDeleteOptions, type BindingOnShapeIsolateOptions, BindingUtil, type BoundsSnapGeometry, type BoundsSnapPoint, BoundsSnaps, Box, type BoxLike, type CanvasMaxSize, Circle2d, ClickManager, CollaboratorsManager, ContainerProvider, type ContainerProviderProps, CubicBezier2d, CubicSpline2d, DEFAULT_ANIMATION_OPTIONS, DEFAULT_CAMERA_OPTIONS, DEFAULT_THEME, type DebugFlag, type DebugFlagDef, type DebugFlagDefaults, DefaultBackground, DefaultCanvas, DefaultErrorFallback, DefaultGrid, DefaultSelectionBackground, DefaultShapeWrapper, DefaultSpinner, DefaultSvgDefs, type DrAdjacentDirection, type DrAnyAssetUtilConstructor, type DrAnyBindingUtilConstructor, type DrAnyOverlayUtilConstructor, type DrAnyShapeUtilConstructor, type DrAssetUtilConstructor, type DrBaseBoxShape, type DrBaseEventInfo, type DrBaseExternalContent, type DrBindingUtilConstructor, type DrCLickEventName, type DrCameraConstraints, type DrCameraEndPerfEvent, type DrCameraMoveOptions, type DrCameraOptions, type DrCameraStartPerfEvent, type DrCancelEvent, type DrCancelEventInfo, type DrCanvasComponentProps, type DrClickEvent, type DrClickEventInfo, type DrClickState, type DrClipboardPasteRawInfo, type DrClipboardWriteInfo, type DrCompleteEvent, type DrCompleteEventInfo, type DrContent, type DrCropInfo, type DrCurrentUser, type DrDeepLink, type DrDeepLinkOptions, type DrDragShapesInInfo, type DrDragShapesOutInfo, type DrDragShapesOverInfo, type DrDrawExternalContent, type DrDrawExternalContentSource, type DrDropShapesOverInfo, type DrEditStartInfo, type DrEditorComponents, type DrEditorOptions, type DrEditorRunOptions, type DrEditorSnapshot, type DrEmbedExternalContent, type DrEnterEventHandler, type DrErrorBoundaryProps, type DrErrorExternalContentSource, type DrErrorFallbackComponent, type DrEventHandlers, type DrEventInfo, type DrEventMap, type DrEventMapHandler, type DrEventName, type DrExcalidrawExternalContent, type DrExcalidrawExternalContentSource, type DrExitEventHandler, type DrExportType, type DrExternalAsset, type DrExternalContent, type DrExternalContentSource, type DrFileExternalAsset, type DrFileReplaceExternalContent, type DrFilesExternalContent, type DrFramePerfEvent, type DrGeometryOpts, type DrGetShapeAtPointOptions, type DrGridProps, type DrHandleDragInfo, type DrHistoryBatchOptions, type DrHistoryDiff, type DrHistoryEntry, type DrHistoryMark, type DrImageExportOptions, type DrIndicatorPath, type DrInteractionEndPerfEvent, type DrInteractionStartPerfEvent, type DrInterruptEvent, type DrInterruptEventInfo, type DrKeyboardEvent, type DrKeyboardEventInfo, type DrKeyboardEventName, type DrLoadSessionStateSnapshotOptions, type DrLoadSnapshotOptions, type DrMeasureTextOpts, type DrMeasureTextSpanOpts, type DrMeasuredTextSize, type DrOnMountHandler, type DrOverlay, type DrOverlayEntry, type DrOverlayUtilConstructor, type DrPerfEventMap, type DrPerfFrameTimeStats, type DrPerfLongAnimationFrame, type DrPerfLongAnimationFrameScript, type DrPinchEvent, type DrPinchEventInfo, type DrPinchEventName, type DrPointerEvent, type DrPointerEventInfo, type DrPointerEventName, type DrPointerEventTarget, type DrRenderingShape, type DrResizeHandle, type DrResizeInfo, type DrResizeMode, type DrResizeShapeOptions, type DrRotationSnapshot, type DrSelectionBackgroundProps, type DrSelectionHandle, type DrSessionStateSnapshot, type DrShapeErrorFallbackComponent, type DrShapeIndicatorOverlay, type DrShapeOperationPerfEvent, type DrShapeUtilCanBeLaidOutOpts, type DrShapeUtilCanBindOpts, type DrShapeUtilCanvasSvgDef, type DrShapeUtilConstructor, type DrShapeWrapperProps, type DrStateNodeConstructor, type DrStoreBaseOptions, type DrStoreEventInfo, type DrStoreOptions, type DrStoreSchemaOptions, type DrStoreWithStatus, type DrSvgExportOptions, type DrSvgTextExternalContent, type DrTextExternalContent, type DrTextExternalContentSource, type DrTextOptions, type DrTickEvent, type DrTickEventInfo, type DrUndoRedoPerfEvent, type DrUpdatePointerOptions, type DrUrlExternalAsset, type DrUrlExternalContent, type DrUserPreferences, type DrWheelEvent, type DrWheelEventInfo, DrawEditor, type DrawEditorBaseProps, type DrawEditorProps, type DrawEditorStoreProps, type DrawEditorWithStoreProps, type DrawEditorWithoutStoreProps, type DrawOptions, EASINGS, EVENT_NAME_MAP, Edge2d, EdgeScrollManager, Editor, EditorAtom, EditorContext, EditorProvider, type EditorProviderProps, Ellipse2d, ErrorBoundary, ErrorScreen, FontManager, type GapsSnapIndicator, Geometry2d, Geometry2dFilters, type Geometry2dOptions, Group2d, GroupShapeUtil, HALF_PI, HTMLContainer, type HTMLContainerProps, type HandleSnapGeometry, HandleSnaps, HistoryManager, InputsManager, LoadingScreen, type LoadingScreenProps, LocalIndexedDb, Mat, type MatLike, type MatModel, MenuClickCapture, OptionalErrorBoundary, type OptionalKeys, OverlayManager, type OverlayOptionsWithDisplayValues, OverlayUtil, PI, PI2, type PerfectDashTerminal, PerformanceApiAdapter, PerformanceManager, Point2d, type PointsSnapIndicator, Polygon2d, Polyline2d, ROTATE_CORNER_TO_SELECTION_CORNER, ReadonlySharedStyleMap, Rectangle2d, type RequiredKeys, type ResizeBoxOptions, type RichTextFontVisitor, type RichTextFontVisitorState, type RotateCorner, SIDES, SIN, SVGContainer, type SVGContainerProps, type SafeId, type ScribbleItem, ScribbleManager, type ScribbleSessionOptions, type SelectionCorner, type SelectionEdge, type SelectionHandle, ShapeIndicatorOverlayUtil, ShapeUtil, type SharedStyle, SharedStyleMap, type SnapData, type SnapIndicator, SnapManager, SpatialIndexManager, Stadium2d, StateNode, type StoreName, type SvgExportContext, type SvgExportDef, TAB_ID, Table, TextManager, ThemeManager, TickManager, type TiptapEditor, type TiptapNode, TransformedGeometry2d, type TransformedGeometry2dOptions, USER_COLORS, type UiEvent, type UiEventType, UserPreferencesManager, Vec, type VecLike, activeElementShouldCaptureKeys, angleDistance, applyRotationToSnapshotShapes, approximately, areAnglesCompatible, average, canonicalizeRotation, centerOfCircleFromThreePoints, clamp, clampRadians, clampToBrowserMaxCanvasSize, clockwiseAngleDist, coreShapes, counterClockwiseAngleDist, createDebugValue, createDeepLinkString, createDrCurrentUser, createDrSchemaFromUtils, createDrStore, createSessionStateSnapshotSignal, dataUrlToFile, debugFlags, defaultDrawOptions, defaultUserPreferences, defaultUserStore, degreesToRadians, elementShouldCaptureKeys, extractSessionStateFromLegacySnapshot, featureFlags, getArcMeasure, getColorValue, getCursor, getDefaultCdnBaseUrl, getDroppedShapesToNewParents, getFontsFromRichText, getFreshUserPreferences, getGlobalDocument, getGlobalWindow, getIncrementedName, getOverlayDisplayValues, getOwnerDocument, getOwnerWindow, getPerfectDashProps, getPointInArcT, getPointOnCircle, getPointerInfo, getPointsOnArc, getPolygonVertices, getRotationSnapshot, getSnapshot, getSvgAsImage, getSvgPathFromPoints, getUserPreferences, getVerticesCountForArcLength, hardReset, hardResetEditor, inlineBase64AssetStore, intersectCircleCircle, intersectCirclePolygon, intersectCirclePolyline, intersectLineSegmentCircle, intersectLineSegmentLineSegment, intersectLineSegmentPolygon, intersectLineSegmentPolyline, intersectPolygonBounds, intersectPolygonPolygon, isAccelKey, isSafeFloat, kickoutOccludedShapes, linesIntersect, loadSessionStateSnapshotIntoStore, loadSnapshot, loopToHtmlElement, maybeSnapToGrid, normalizeWheel, openWindow, parseDeepLinkString, perimeterOfEllipse, pointInPolygon, polygonIntersectsPolyline, polygonsIntersect, precise, preventDefault, radiansToDegrees, rangeIntersection, refreshPage, releasePointerCapture, resizeBox, resizeScaled, resolveThemes, rotateSelectionHandle, runtime, sanitizeId, setPointerCapture, setRuntimeOverrides, setUserPreferences, shortAngleDist, snapAngle, stopEventPropagation, strokeShapeIndicators, suffixSafeId, tlenv, tlenvReactive, tlmenus, tltime, toDomPrecision, toFixed, toPrecision, uniq, useColorMode, useContainer, useContainerIfExists, useDelaySvgExport, useDrSchemaFromUtils, useDrStore, useDrawCurrentUser, useEditor, useEditorComponents, useEvent, useGlobalMenuIsOpen, useIsCropping, useIsEditing, useLocalStore, useMaybeEditor, useOnMount, usePassThroughMouseOverEvents, usePassThroughWheelEvents, usePeerIds, usePresence, useReactiveEvent, useRefState, useShallowArrayIdentity, useShallowObjectIdentity, useSharedSafeId, useSvgExportContext, useTransform, useUniqueSafeId, useViewportHeight, userTypeValidator };
|
|
10412
|
+
export { Arc2d, AssetUtil, BaseBoxShapeTool, BaseBoxShapeUtil, BaseFrameLikeShapeUtil, type BatchMeasurementRequest, type BindingOnChangeOptions, type BindingOnCreateOptions, type BindingOnDeleteOptions, type BindingOnShapeChangeOptions, type BindingOnShapeDeleteOptions, type BindingOnShapeIsolateOptions, BindingUtil, type BoundsSnapGeometry, type BoundsSnapPoint, BoundsSnaps, Box, type BoxLike, type CanvasMaxSize, Circle2d, ClickManager, CollaboratorsManager, ContainerProvider, type ContainerProviderProps, CubicBezier2d, CubicSpline2d, DEFAULT_ANIMATION_OPTIONS, DEFAULT_CAMERA_OPTIONS, DEFAULT_THEME, type DebugFlag, type DebugFlagDef, type DebugFlagDefaults, DefaultBackground, DefaultCanvas, DefaultErrorFallback, DefaultGrid, DefaultSelectionBackground, DefaultShapeWrapper, DefaultSpinner, DefaultSvgDefs, type DrAdjacentDirection, type DrAnyAssetUtilConstructor, type DrAnyBindingUtilConstructor, type DrAnyOverlayUtilConstructor, type DrAnyShapeUtilConstructor, type DrAssetUtilConstructor, type DrBaseBoxShape, type DrBaseEventInfo, type DrBaseExternalContent, type DrBindingUtilConstructor, type DrCLickEventName, type DrCameraConstraints, type DrCameraEndPerfEvent, type DrCameraMoveOptions, type DrCameraOptions, type DrCameraStartPerfEvent, type DrCancelEvent, type DrCancelEventInfo, type DrCanvasComponentProps, type DrClickEvent, type DrClickEventInfo, type DrClickState, type DrClipboardPasteRawInfo, type DrClipboardWriteInfo, type DrCollaboratorCursorProps, type DrCompleteEvent, type DrCompleteEventInfo, type DrContent, type DrCropInfo, type DrCurrentUser, type DrDeepLink, type DrDeepLinkOptions, type DrDragShapesInInfo, type DrDragShapesOutInfo, type DrDragShapesOverInfo, type DrDrawExternalContent, type DrDrawExternalContentSource, type DrDropShapesOverInfo, type DrEditStartInfo, type DrEditorComponents, type DrEditorOptions, type DrEditorRunOptions, type DrEditorSnapshot, type DrEmbedExternalContent, type DrEnterEventHandler, type DrErrorBoundaryProps, type DrErrorExternalContentSource, type DrErrorFallbackComponent, type DrEventHandlers, type DrEventInfo, type DrEventMap, type DrEventMapHandler, type DrEventName, type DrExcalidrawExternalContent, type DrExcalidrawExternalContentSource, type DrExitEventHandler, type DrExportType, type DrExternalAsset, type DrExternalContent, type DrExternalContentSource, type DrFileExternalAsset, type DrFileReplaceExternalContent, type DrFilesExternalContent, type DrFramePerfEvent, type DrGeometryOpts, type DrGetShapeAtPointOptions, type DrGridProps, type DrHandleDragInfo, type DrHistoryBatchOptions, type DrHistoryDiff, type DrHistoryEntry, type DrHistoryMark, type DrImageExportOptions, type DrIndicatorPath, type DrInteractionEndPerfEvent, type DrInteractionStartPerfEvent, type DrInterruptEvent, type DrInterruptEventInfo, type DrKeyboardEvent, type DrKeyboardEventInfo, type DrKeyboardEventName, type DrLoadSessionStateSnapshotOptions, type DrLoadSnapshotOptions, type DrMeasureTextOpts, type DrMeasureTextSpanOpts, type DrMeasuredTextSize, type DrOnMountHandler, type DrOverlay, type DrOverlayEntry, type DrOverlayUtilConstructor, type DrPerfEventMap, type DrPerfFrameTimeStats, type DrPerfLongAnimationFrame, type DrPerfLongAnimationFrameScript, type DrPinchEvent, type DrPinchEventInfo, type DrPinchEventName, type DrPointerEvent, type DrPointerEventInfo, type DrPointerEventName, type DrPointerEventTarget, type DrRenderingShape, type DrResizeHandle, type DrResizeInfo, type DrResizeMode, type DrResizeShapeOptions, type DrRotationSnapshot, type DrSelectionBackgroundProps, type DrSelectionHandle, type DrSessionStateSnapshot, type DrShapeErrorFallbackComponent, type DrShapeIndicatorOverlay, type DrShapeOperationPerfEvent, type DrShapeUtilCanBeLaidOutOpts, type DrShapeUtilCanBindOpts, type DrShapeUtilCanvasSvgDef, type DrShapeUtilConstructor, type DrShapeWrapperProps, type DrStateNodeConstructor, type DrStoreBaseOptions, type DrStoreEventInfo, type DrStoreOptions, type DrStoreSchemaOptions, type DrStoreWithStatus, type DrSvgExportOptions, type DrSvgTextExternalContent, type DrTextExternalContent, type DrTextExternalContentSource, type DrTextOptions, type DrTickEvent, type DrTickEventInfo, type DrUndoRedoPerfEvent, type DrUpdatePointerOptions, type DrUrlExternalAsset, type DrUrlExternalContent, type DrUserPreferences, type DrWheelEvent, type DrWheelEventInfo, DrawEditor, type DrawEditorBaseProps, type DrawEditorProps, type DrawEditorStoreProps, type DrawEditorWithStoreProps, type DrawEditorWithoutStoreProps, type DrawOptions, EASINGS, EVENT_NAME_MAP, Edge2d, EdgeScrollManager, Editor, EditorAtom, EditorContext, EditorProvider, type EditorProviderProps, Ellipse2d, ErrorBoundary, ErrorScreen, FontManager, type GapsSnapIndicator, Geometry2d, Geometry2dFilters, type Geometry2dOptions, Group2d, GroupShapeUtil, HALF_PI, HTMLContainer, type HTMLContainerProps, type HandleSnapGeometry, HandleSnaps, HistoryManager, InputsManager, LoadingScreen, type LoadingScreenProps, LocalIndexedDb, Mat, type MatLike, type MatModel, MenuClickCapture, OptionalErrorBoundary, type OptionalKeys, OverlayManager, type OverlayOptionsWithDisplayValues, OverlayUtil, PI, PI2, type PerfectDashTerminal, PerformanceApiAdapter, PerformanceManager, Point2d, type PointsSnapIndicator, Polygon2d, Polyline2d, ROTATE_CORNER_TO_SELECTION_CORNER, ReadonlySharedStyleMap, Rectangle2d, type RequiredKeys, type ResizeBoxOptions, type RichTextFontVisitor, type RichTextFontVisitorState, type RotateCorner, SIDES, SIN, SVGContainer, type SVGContainerProps, type SafeId, type ScribbleItem, ScribbleManager, type ScribbleSessionOptions, type SelectionCorner, type SelectionEdge, type SelectionHandle, ShapeIndicatorOverlayUtil, ShapeUtil, type SharedStyle, SharedStyleMap, type SnapData, type SnapIndicator, SnapManager, SpatialIndexManager, Stadium2d, StateNode, type StoreName, type SvgExportContext, type SvgExportDef, TAB_ID, Table, TextManager, ThemeManager, TickManager, type TiptapEditor, type TiptapNode, TransformedGeometry2d, type TransformedGeometry2dOptions, USER_COLORS, type UiEvent, type UiEventType, UserPreferencesManager, Vec, type VecLike, activeElementShouldCaptureKeys, angleDistance, applyRotationToSnapshotShapes, approximately, areAnglesCompatible, average, canonicalizeRotation, centerOfCircleFromThreePoints, clamp, clampRadians, clampToBrowserMaxCanvasSize, clockwiseAngleDist, coreShapes, counterClockwiseAngleDist, createDebugValue, createDeepLinkString, createDrCurrentUser, createDrSchemaFromUtils, createDrStore, createSessionStateSnapshotSignal, dataUrlToFile, debugFlags, defaultDrawOptions, defaultUserPreferences, defaultUserStore, degreesToRadians, elementShouldCaptureKeys, extractSessionStateFromLegacySnapshot, featureFlags, getArcMeasure, getColorValue, getCursor, getDefaultCdnBaseUrl, getDroppedShapesToNewParents, getFontsFromRichText, getFreshUserPreferences, getGlobalDocument, getGlobalWindow, getIncrementedName, getOverlayDisplayValues, getOwnerDocument, getOwnerWindow, getPerfectDashProps, getPointInArcT, getPointOnCircle, getPointerInfo, getPointsOnArc, getPolygonVertices, getRotationSnapshot, getSnapshot, getSvgAsImage, getSvgPathFromPoints, getUserPreferences, getVerticesCountForArcLength, hardReset, hardResetEditor, inlineBase64AssetStore, intersectCircleCircle, intersectCirclePolygon, intersectCirclePolyline, intersectLineSegmentCircle, intersectLineSegmentLineSegment, intersectLineSegmentPolygon, intersectLineSegmentPolyline, intersectPolygonBounds, intersectPolygonPolygon, isAccelKey, isSafeFloat, kickoutOccludedShapes, linesIntersect, loadSessionStateSnapshotIntoStore, loadSnapshot, loopToHtmlElement, maybeSnapToGrid, normalizeWheel, openWindow, parseDeepLinkString, perimeterOfEllipse, pointInPolygon, polygonIntersectsPolyline, polygonsIntersect, precise, preventDefault, radiansToDegrees, rangeIntersection, refreshPage, releasePointerCapture, resizeBox, resizeScaled, resolveThemes, rotateSelectionHandle, runtime, sanitizeId, setPointerCapture, setRuntimeOverrides, setUserPreferences, shortAngleDist, snapAngle, stopEventPropagation, strokeShapeIndicators, suffixSafeId, tlenv, tlenvReactive, tlmenus, tltime, toDomPrecision, toFixed, toPrecision, uniq, useColorMode, useContainer, useContainerIfExists, useDelaySvgExport, useDrSchemaFromUtils, useDrStore, useDrawCurrentUser, useEditor, useEditorComponents, useEvent, useGlobalMenuIsOpen, useIsCropping, useIsEditing, useLocalStore, useMaybeEditor, useOnMount, usePassThroughMouseOverEvents, usePassThroughWheelEvents, usePeerIds, usePresence, useReactiveEvent, useRefState, useShallowArrayIdentity, useShallowObjectIdentity, useSharedSafeId, useSvgExportContext, useTransform, useUniqueSafeId, useViewportHeight, userTypeValidator };
|
package/dist/index.mjs
CHANGED
|
@@ -9681,6 +9681,38 @@ __decorateClass([
|
|
|
9681
9681
|
], FocusManager.prototype, "handleMouseDown");
|
|
9682
9682
|
var EMPTY_SHAPE_FONT_FACES_CACHE = { get: () => void 0 };
|
|
9683
9683
|
var EMPTY_SHAPE_FONT_LOAD_STATE_CACHE = { get: () => void 0 };
|
|
9684
|
+
var BUILTIN_FONT_LOCAL_SOURCES = {
|
|
9685
|
+
draw_mono: 'local("Menlo"), local("Consolas"), local("Courier New")',
|
|
9686
|
+
draw_mono_italic: 'local("Menlo Italic"), local("Consolas Italic"), local("Courier New Italic")',
|
|
9687
|
+
draw_mono_bold: 'local("Menlo Bold"), local("Consolas Bold"), local("Courier New Bold")',
|
|
9688
|
+
draw_mono_italic_bold: 'local("Menlo Bold Italic"), local("Consolas Bold Italic"), local("Courier New Bold Italic")',
|
|
9689
|
+
draw_serif: 'local("Georgia"), local("Times New Roman")',
|
|
9690
|
+
draw_serif_italic: 'local("Georgia Italic"), local("Times New Roman Italic")',
|
|
9691
|
+
draw_serif_bold: 'local("Georgia Bold"), local("Times New Roman Bold")',
|
|
9692
|
+
draw_serif_italic_bold: 'local("Georgia Bold Italic"), local("Times New Roman Bold Italic")',
|
|
9693
|
+
draw_sans: 'local("Helvetica Neue"), local("Arial"), local("sans-serif")',
|
|
9694
|
+
draw_sans_italic: 'local("Helvetica Neue Italic"), local("Arial Italic")',
|
|
9695
|
+
draw_sans_bold: 'local("Helvetica Neue Bold"), local("Arial Bold")',
|
|
9696
|
+
draw_sans_italic_bold: 'local("Helvetica Neue Bold Italic"), local("Arial Bold Italic")',
|
|
9697
|
+
draw_draw: 'local("Comic Sans MS"), local("Segoe Print"), local("cursive")',
|
|
9698
|
+
draw_draw_italic: 'local("Comic Sans MS Italic"), local("Segoe Print")',
|
|
9699
|
+
draw_draw_bold: 'local("Comic Sans MS Bold"), local("Segoe Print Bold")',
|
|
9700
|
+
draw_draw_italic_bold: 'local("Comic Sans MS Bold Italic"), local("Segoe Print Bold")'
|
|
9701
|
+
};
|
|
9702
|
+
function resolveFontFaceSource(font, assetUrls) {
|
|
9703
|
+
const assetUrl = assetUrls?.[font.src.url];
|
|
9704
|
+
if (assetUrl) {
|
|
9705
|
+
return `url(${JSON.stringify(assetUrl)})`;
|
|
9706
|
+
}
|
|
9707
|
+
const localSource = BUILTIN_FONT_LOCAL_SOURCES[font.src.url];
|
|
9708
|
+
if (localSource) {
|
|
9709
|
+
return localSource;
|
|
9710
|
+
}
|
|
9711
|
+
if (font.src.url.startsWith("http://") || font.src.url.startsWith("https://") || font.src.url.startsWith("data:") || font.src.url.startsWith("blob:")) {
|
|
9712
|
+
return `url(${JSON.stringify(font.src.url)})`;
|
|
9713
|
+
}
|
|
9714
|
+
return 'local("Arial")';
|
|
9715
|
+
}
|
|
9684
9716
|
var FontManager = class {
|
|
9685
9717
|
constructor(editor, assetUrls) {
|
|
9686
9718
|
this.editor = editor;
|
|
@@ -9790,8 +9822,8 @@ var FontManager = class {
|
|
|
9790
9822
|
return existing;
|
|
9791
9823
|
}
|
|
9792
9824
|
}
|
|
9793
|
-
const
|
|
9794
|
-
const instance = new FontFace(font.family,
|
|
9825
|
+
const src = resolveFontFaceSource(font, this.assetUrls);
|
|
9826
|
+
const instance = new FontFace(font.family, src, {
|
|
9795
9827
|
...mapObjectMapValues(defaultFontFaceDescriptors, (key) => font[key]),
|
|
9796
9828
|
display: "swap"
|
|
9797
9829
|
});
|
|
@@ -9799,13 +9831,27 @@ var FontManager = class {
|
|
|
9799
9831
|
return instance;
|
|
9800
9832
|
}
|
|
9801
9833
|
async toEmbeddedCssDeclaration(font) {
|
|
9802
|
-
|
|
9803
|
-
const
|
|
9804
|
-
|
|
9805
|
-
|
|
9806
|
-
|
|
9807
|
-
|
|
9808
|
-
|
|
9834
|
+
let src;
|
|
9835
|
+
const assetUrl = this.assetUrls?.[font.src.url];
|
|
9836
|
+
if (assetUrl) {
|
|
9837
|
+
const dataUrl = await FileHelpers.urlToDataUrl(assetUrl);
|
|
9838
|
+
src = compact([
|
|
9839
|
+
`url("${dataUrl}")`,
|
|
9840
|
+
font.src.format ? `format(${font.src.format})` : null,
|
|
9841
|
+
font.src.tech ? `tech(${font.src.tech})` : null
|
|
9842
|
+
]).join(" ");
|
|
9843
|
+
} else if (BUILTIN_FONT_LOCAL_SOURCES[font.src.url]) {
|
|
9844
|
+
src = BUILTIN_FONT_LOCAL_SOURCES[font.src.url];
|
|
9845
|
+
} else if (font.src.url.startsWith("http://") || font.src.url.startsWith("https://") || font.src.url.startsWith("data:") || font.src.url.startsWith("blob:")) {
|
|
9846
|
+
const dataUrl = await FileHelpers.urlToDataUrl(font.src.url);
|
|
9847
|
+
src = compact([
|
|
9848
|
+
`url("${dataUrl}")`,
|
|
9849
|
+
font.src.format ? `format(${font.src.format})` : null,
|
|
9850
|
+
font.src.tech ? `tech(${font.src.tech})` : null
|
|
9851
|
+
]).join(" ");
|
|
9852
|
+
} else {
|
|
9853
|
+
src = 'local("Arial")';
|
|
9854
|
+
}
|
|
9809
9855
|
return compact([
|
|
9810
9856
|
`@font-face {`,
|
|
9811
9857
|
` font-family: "${font.family}";`,
|
|
@@ -23181,6 +23227,8 @@ function EditorComponentsProvider({
|
|
|
23181
23227
|
ShapeWrapper: DefaultShapeWrapper,
|
|
23182
23228
|
Spinner: DefaultSpinner,
|
|
23183
23229
|
SvgDefs: DefaultSvgDefs,
|
|
23230
|
+
CollaboratorCursor: null,
|
|
23231
|
+
CollaboratorCursors: null,
|
|
23184
23232
|
ErrorFallback: DefaultErrorFallback,
|
|
23185
23233
|
ShapeErrorFallback: DefaultShapeErrorFallback,
|
|
23186
23234
|
..._overrides
|
|
@@ -24784,7 +24832,7 @@ function getFontsFromRichText(editor, richText, initialState2) {
|
|
|
24784
24832
|
// src/index.ts
|
|
24785
24833
|
registerDrawLibraryVersion(
|
|
24786
24834
|
"@ibodr/editor",
|
|
24787
|
-
"0.1.
|
|
24835
|
+
"0.1.4",
|
|
24788
24836
|
"esm"
|
|
24789
24837
|
);
|
|
24790
24838
|
/*!
|