@starrykit/slides-editor 0.1.26
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/components/block-manipulation-overlay.d.ts +36 -0
- package/dist/components/color-picker.d.ts +10 -0
- package/dist/components/context-menu.d.ts +26 -0
- package/dist/components/editor-header.d.ts +19 -0
- package/dist/components/editor-workspace.d.ts +88 -0
- package/dist/components/floating-toolbar-attribute-dialog.d.ts +9 -0
- package/dist/components/floating-toolbar-feature.d.ts +8 -0
- package/dist/components/floating-toolbar-fields.d.ts +37 -0
- package/dist/components/floating-toolbar-parts.d.ts +47 -0
- package/dist/components/floating-toolbar-popovers.d.ts +44 -0
- package/dist/components/floating-toolbar-sections.d.ts +19 -0
- package/dist/components/floating-toolbar-types.d.ts +41 -0
- package/dist/components/floating-toolbar.d.ts +4 -0
- package/dist/components/image-crop-overlay.d.ts +9 -0
- package/dist/components/presenter-view.d.ts +14 -0
- package/dist/components/slide-sidebar.d.ts +20 -0
- package/dist/components/stage-canvas.d.ts +88 -0
- package/dist/components/ui/accordion.d.ts +7 -0
- package/dist/components/ui/button.d.ts +13 -0
- package/dist/components/ui/context-menu.d.ts +25 -0
- package/dist/components/ui/dialog.d.ts +10 -0
- package/dist/components/ui/input.d.ts +3 -0
- package/dist/components/ui/popover.d.ts +10 -0
- package/dist/components/ui/scroll-area.d.ts +5 -0
- package/dist/components/ui/select.d.ts +15 -0
- package/dist/components/ui/separator.d.ts +4 -0
- package/dist/components/ui/tabs.d.ts +11 -0
- package/dist/components/ui/textarea.d.ts +3 -0
- package/dist/components/ui/toggle-group.d.ts +9 -0
- package/dist/components/ui/toggle.d.ts +9 -0
- package/dist/components/ui/tooltip.d.ts +7 -0
- package/dist/editor-operations.d.ts +17 -0
- package/dist/hooks/block-manipulation-geometry.d.ts +27 -0
- package/dist/hooks/block-manipulation-operations.d.ts +10 -0
- package/dist/hooks/block-manipulation-overlay.d.ts +12 -0
- package/dist/hooks/block-manipulation-types.d.ts +81 -0
- package/dist/hooks/editor-keyboard-geometry.d.ts +22 -0
- package/dist/hooks/editor-keyboard-operations.d.ts +11 -0
- package/dist/hooks/editor-keyboard-types.d.ts +38 -0
- package/dist/hooks/iframe-active-text-session.d.ts +12 -0
- package/dist/hooks/iframe-editing-session.d.ts +10 -0
- package/dist/hooks/iframe-text-document-events.d.ts +26 -0
- package/dist/hooks/iframe-text-editing-dom.d.ts +12 -0
- package/dist/hooks/iframe-text-editing-types.d.ts +38 -0
- package/dist/hooks/object-clipboard-commands.d.ts +28 -0
- package/dist/hooks/use-block-manipulation.d.ts +3 -0
- package/dist/hooks/use-editor-element-actions.d.ts +42 -0
- package/dist/hooks/use-editor-keyboard-shortcuts.d.ts +3 -0
- package/dist/hooks/use-editor-slide-actions.d.ts +21 -0
- package/dist/hooks/use-iframe-text-editing.d.ts +3 -0
- package/dist/hooks/use-image-crop.d.ts +40 -0
- package/dist/hooks/use-marquee-selection.d.ts +17 -0
- package/dist/hooks/use-selection-overlay-actions.d.ts +41 -0
- package/dist/hooks/use-slide-history.d.ts +17 -0
- package/dist/hooks/use-slide-inspector.d.ts +24 -0
- package/dist/hooks/use-slide-thumbnails.d.ts +2 -0
- package/dist/hooks/use-stage-viewport.d.ts +13 -0
- package/dist/index.d.ts +14 -0
- package/dist/index.js +11508 -0
- package/dist/lib/block-snap-constants.d.ts +8 -0
- package/dist/lib/block-snap-guides.d.ts +6 -0
- package/dist/lib/block-snap-targets.d.ts +13 -0
- package/dist/lib/block-snap-types.d.ts +32 -0
- package/dist/lib/block-snapping.d.ts +17 -0
- package/dist/lib/collect-css-properties.d.ts +5 -0
- package/dist/lib/editor-selection-operations.d.ts +58 -0
- package/dist/lib/editor-selection-structure.d.ts +7 -0
- package/dist/lib/element-tool-commit.d.ts +17 -0
- package/dist/lib/element-tool-model.d.ts +17 -0
- package/dist/lib/element-tool-types.d.ts +35 -0
- package/dist/lib/element-tool-values.d.ts +22 -0
- package/dist/lib/image-crop.d.ts +24 -0
- package/dist/lib/motion.d.ts +8 -0
- package/dist/lib/selection-overlay.d.ts +4 -0
- package/dist/lib/style-controls.d.ts +17 -0
- package/dist/lib/thumbnail-renderer.d.ts +2 -0
- package/dist/lib/utils.d.ts +3 -0
- package/dist/logo-starry-slides-6GYA6NPA.png +0 -0
- package/package.json +38 -0
- package/src/styles/index.css +88 -0
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
export declare const SNAP_THRESHOLD_PX = 18;
|
|
2
|
+
export declare const SPACING_SNAP_DISTANCE_BONUS_PX = 6;
|
|
3
|
+
export declare const SNAP_GUIDE_EXTENSION_PX = 24;
|
|
4
|
+
export declare const SNAP_GUIDE_COLOR = "#ef4444";
|
|
5
|
+
export declare const SPACING_ALIGNMENT_TOLERANCE_PX = 40;
|
|
6
|
+
export declare const MIN_SPACING_TARGET_GAP_PX = 12;
|
|
7
|
+
export declare const MAX_SPACING_TARGET_GAP_PX = 360;
|
|
8
|
+
export declare function rangesOverlapOrNear(startA: number, endA: number, startB: number, endB: number, proximity: number): boolean;
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import type { StageRect } from "@starrykit/slides-core";
|
|
2
|
+
import type { SnapCandidate, SnapGuide } from "./block-snap-types";
|
|
3
|
+
export declare function buildSnapGuides(rect: StageRect, snap: {
|
|
4
|
+
vertical: SnapCandidate | null;
|
|
5
|
+
horizontal: SnapCandidate | null;
|
|
6
|
+
}): SnapGuide[];
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import type { SlideModel, StageGeometry, StageRect } from "@starrykit/slides-core";
|
|
2
|
+
import type { SnapTarget } from "./block-snap-types";
|
|
3
|
+
export declare function collectSnapTargets({ activeSlide, doc, rootRect, selectedElementId, slideStageRect, stageGeometry, }: {
|
|
4
|
+
activeSlide: SlideModel;
|
|
5
|
+
doc: Document;
|
|
6
|
+
rootRect: DOMRect;
|
|
7
|
+
selectedElementId: string;
|
|
8
|
+
slideStageRect: StageRect;
|
|
9
|
+
stageGeometry: StageGeometry;
|
|
10
|
+
}): {
|
|
11
|
+
vertical: SnapTarget[];
|
|
12
|
+
horizontal: SnapTarget[];
|
|
13
|
+
};
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import type { StageRect } from "@starrykit/slides-core";
|
|
2
|
+
export interface SnapGuide {
|
|
3
|
+
orientation: "vertical" | "horizontal";
|
|
4
|
+
start: {
|
|
5
|
+
x: number;
|
|
6
|
+
y: number;
|
|
7
|
+
};
|
|
8
|
+
end: {
|
|
9
|
+
x: number;
|
|
10
|
+
y: number;
|
|
11
|
+
};
|
|
12
|
+
variant: "alignment" | "spacing";
|
|
13
|
+
}
|
|
14
|
+
export interface SnapTarget {
|
|
15
|
+
position: number;
|
|
16
|
+
rect: StageRect;
|
|
17
|
+
kind: "slide" | "element" | "spacing";
|
|
18
|
+
role: "start" | "center" | "end";
|
|
19
|
+
anchor: SnapCandidate["anchor"] | null;
|
|
20
|
+
priority: number;
|
|
21
|
+
spacingPriority?: number;
|
|
22
|
+
elementId: string | null;
|
|
23
|
+
relatedRects: StageRect[];
|
|
24
|
+
}
|
|
25
|
+
export interface SnapCandidate {
|
|
26
|
+
anchor: "start" | "center" | "end";
|
|
27
|
+
delta: number;
|
|
28
|
+
target: SnapTarget;
|
|
29
|
+
}
|
|
30
|
+
export type ResizeHandleCorner = "top-left" | "top-right" | "bottom-right" | "bottom-left";
|
|
31
|
+
export type ResizeHandleEdge = "top-center" | "right-center" | "bottom-center" | "left-center";
|
|
32
|
+
export type ResizeHandlePosition = ResizeHandleCorner | ResizeHandleEdge;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import type { StageRect } from "@starrykit/slides-core";
|
|
2
|
+
export { collectSnapTargets } from "./block-snap-targets";
|
|
3
|
+
import type { ResizeHandlePosition, SnapGuide, SnapTarget } from "./block-snap-types";
|
|
4
|
+
export declare function snapStageRect(rect: StageRect, targets: {
|
|
5
|
+
vertical: SnapTarget[];
|
|
6
|
+
horizontal: SnapTarget[];
|
|
7
|
+
}): {
|
|
8
|
+
rect: StageRect;
|
|
9
|
+
guides: SnapGuide[];
|
|
10
|
+
};
|
|
11
|
+
export declare function snapResizeRect(rect: StageRect, resizeHandle: ResizeHandlePosition, targets: {
|
|
12
|
+
vertical: SnapTarget[];
|
|
13
|
+
horizontal: SnapTarget[];
|
|
14
|
+
}): {
|
|
15
|
+
rect: StageRect;
|
|
16
|
+
guides: SnapGuide[];
|
|
17
|
+
};
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
import type { AtomicSlideOperation, ElementInsertOperation, ElementLayoutUpdateOperation, ElementPresentationStyleMap, ElementRemoveOperation, GroupElementRectMap, SlideBatchOperation, SlideModel, StageRect, StyleUpdateOperation } from "@starrykit/slides-core";
|
|
2
|
+
export declare function batchSelectionOperation(slideId: string, operations: AtomicSlideOperation[]): AtomicSlideOperation | SlideBatchOperation | null;
|
|
3
|
+
export declare function createLayerOperations(slide: SlideModel, elementIds: string[], action: string): StyleUpdateOperation[];
|
|
4
|
+
export declare function createDuplicateSelectionOperations({ slide, elementIds, doc, }: {
|
|
5
|
+
slide: SlideModel;
|
|
6
|
+
elementIds: string[];
|
|
7
|
+
doc: Document | null | undefined;
|
|
8
|
+
}): {
|
|
9
|
+
operations: ElementInsertOperation[];
|
|
10
|
+
nextElementIds: string[];
|
|
11
|
+
};
|
|
12
|
+
export declare function createRemoveSelectionOperations(slide: SlideModel, elementIds: string[]): ElementRemoveOperation[];
|
|
13
|
+
export declare function createGroupOperation({ slide, elementIds, elementRects, }: {
|
|
14
|
+
slide: SlideModel;
|
|
15
|
+
elementIds: string[];
|
|
16
|
+
elementRects: GroupElementRectMap;
|
|
17
|
+
}): {
|
|
18
|
+
operation: import("@starrykit/slides-core").GroupCreateOperation;
|
|
19
|
+
groupElementId: string;
|
|
20
|
+
} | null;
|
|
21
|
+
export declare function createUngroupOperation({ slide, elementId, elementRects, elementPresentationStyles, parentPosition, }: {
|
|
22
|
+
slide: SlideModel;
|
|
23
|
+
elementId: string;
|
|
24
|
+
elementRects: GroupElementRectMap;
|
|
25
|
+
elementPresentationStyles: ElementPresentationStyleMap;
|
|
26
|
+
parentPosition?: {
|
|
27
|
+
x: number;
|
|
28
|
+
y: number;
|
|
29
|
+
};
|
|
30
|
+
}): import("@starrykit/slides-core").GroupUngroupOperation | null;
|
|
31
|
+
export declare function createGroupElementRectMap({ doc, slide, flattenRootElementId, }: {
|
|
32
|
+
doc: Document | null | undefined;
|
|
33
|
+
slide: SlideModel | undefined;
|
|
34
|
+
flattenRootElementId?: string;
|
|
35
|
+
}): GroupElementRectMap;
|
|
36
|
+
export declare function createElementPresentationStyleMap({ doc, elementId, }: {
|
|
37
|
+
doc: Document | null | undefined;
|
|
38
|
+
elementId: string;
|
|
39
|
+
}): ElementPresentationStyleMap;
|
|
40
|
+
export declare function createArrangeTransformValue({ action, elementId, slide, selectionOverlay, stage, }: {
|
|
41
|
+
action: string;
|
|
42
|
+
elementId: string;
|
|
43
|
+
slide: SlideModel;
|
|
44
|
+
selectionOverlay: StageRect;
|
|
45
|
+
stage: {
|
|
46
|
+
offsetX: number;
|
|
47
|
+
offsetY: number;
|
|
48
|
+
scale: number;
|
|
49
|
+
width: number;
|
|
50
|
+
height: number;
|
|
51
|
+
};
|
|
52
|
+
}): string | null;
|
|
53
|
+
export declare function createDistributeOperations({ slide, elementIds, doc, action, }: {
|
|
54
|
+
slide: SlideModel;
|
|
55
|
+
elementIds: string[];
|
|
56
|
+
doc: Document | null | undefined;
|
|
57
|
+
action: string;
|
|
58
|
+
}): ElementLayoutUpdateOperation[];
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
export declare function hasDirectEditableChildren(html: string, elementId: string): boolean;
|
|
2
|
+
export declare function createStructuralListIdMap(doc: Document, flattenRootElementId: string | undefined): Map<Element, string>;
|
|
3
|
+
export declare function isListWrapperWithEditableItems(node: Element): node is HTMLElement;
|
|
4
|
+
export declare function getScopedTextTargetAtPoint(doc: Document, activeGroupScopeId: string, point: {
|
|
5
|
+
x: number;
|
|
6
|
+
y: number;
|
|
7
|
+
}): HTMLElement | null;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import type { CssPropertyRow } from "./collect-css-properties";
|
|
2
|
+
import type { ElementToolFeature } from "./element-tool-model";
|
|
3
|
+
export interface ElementToolAttributeValues {
|
|
4
|
+
locked: string;
|
|
5
|
+
ariaLabel: string;
|
|
6
|
+
linkUrl: string;
|
|
7
|
+
}
|
|
8
|
+
export declare function commitElementToolFeature({ attributeValues, feature, inspectedStyles, nextValue, onAlignToSlide, onAttributeChange, onLayerOrder, onStyleChange, }: {
|
|
9
|
+
attributeValues: ElementToolAttributeValues;
|
|
10
|
+
feature: ElementToolFeature;
|
|
11
|
+
inspectedStyles: CssPropertyRow[];
|
|
12
|
+
nextValue: string;
|
|
13
|
+
onStyleChange: (propertyName: string, nextValue: string) => void;
|
|
14
|
+
onAttributeChange: (attributeName: string, nextValue: string) => void;
|
|
15
|
+
onAlignToSlide: (action: string) => void;
|
|
16
|
+
onLayerOrder: (action: string) => void;
|
|
17
|
+
}): void;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import type { ElementToolFeatureId, ElementToolGroup, ElementToolOption } from "./element-tool-types";
|
|
2
|
+
export type { ElementToolControlType, ElementToolFeature, ElementToolFeatureId, ElementToolGroup, ElementToolOption, ElementToolSubgroup, } from "./element-tool-types";
|
|
3
|
+
export declare const TEXT_ALIGN_OPTIONS: ElementToolOption[];
|
|
4
|
+
export declare const ALIGN_TO_SLIDE_OPTIONS: ElementToolOption[];
|
|
5
|
+
export declare const LAYER_ORDER_OPTIONS: ElementToolOption[];
|
|
6
|
+
export declare const DISTRIBUTE_OPTIONS: ElementToolOption[];
|
|
7
|
+
export declare const FONT_SIZE_TOOL_OPTIONS: ElementToolOption[];
|
|
8
|
+
export declare const LINE_HEIGHT_OPTIONS: ElementToolOption[];
|
|
9
|
+
export declare const SIZE_PRESET_OPTIONS: ElementToolOption[];
|
|
10
|
+
export declare const OPACITY_OPTIONS: ElementToolOption[];
|
|
11
|
+
export declare const ROTATION_OPTIONS: ElementToolOption[];
|
|
12
|
+
export declare const BORDER_STYLE_OPTIONS: ElementToolOption[];
|
|
13
|
+
export declare const BORDER_WIDTH_OPTIONS: ElementToolOption[];
|
|
14
|
+
export declare const BORDER_RADIUS_OPTIONS: ElementToolOption[];
|
|
15
|
+
export declare const SHADOW_OPTIONS: ElementToolOption[];
|
|
16
|
+
export declare const ELEMENT_TOOL_GROUPS: ElementToolGroup[];
|
|
17
|
+
export declare function getElementToolFeature(featureId: ElementToolFeatureId): import("./element-tool-types").ElementToolFeature | null;
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import type { LucideIcon } from "lucide-react";
|
|
2
|
+
export type ElementToolFeatureId = "font-family" | "font-size" | "font-bold" | "font-italic" | "font-underline" | "font-strikethrough" | "line-height" | "text-align" | "text-color" | "background-color" | "border" | "border-color" | "border-width" | "border-radius" | "box-shadow" | "width" | "height" | "opacity" | "rotation" | "image-crop" | "align-to-slide" | "distribute" | "layer-order" | "group" | "ungroup" | "locked" | "link-url" | "aria-label" | "custom-css" | "other-tools" | "other-link" | "other-aria-label";
|
|
3
|
+
export type ElementToolControlType = "select" | "number" | "toggle" | "color" | "text" | "slider" | "action-group" | "custom-css";
|
|
4
|
+
export interface ElementToolOption {
|
|
5
|
+
label: string;
|
|
6
|
+
value: string;
|
|
7
|
+
icon?: LucideIcon;
|
|
8
|
+
description?: string;
|
|
9
|
+
}
|
|
10
|
+
export interface ElementToolFeature {
|
|
11
|
+
id: ElementToolFeatureId;
|
|
12
|
+
label: string;
|
|
13
|
+
controlType: ElementToolControlType;
|
|
14
|
+
target: "style" | "attribute" | "operation";
|
|
15
|
+
propertyName?: string;
|
|
16
|
+
attributeName?: string;
|
|
17
|
+
options?: ElementToolOption[];
|
|
18
|
+
min?: number;
|
|
19
|
+
max?: number;
|
|
20
|
+
step?: number;
|
|
21
|
+
unit?: string;
|
|
22
|
+
placeholder?: string;
|
|
23
|
+
}
|
|
24
|
+
export interface ElementToolSubgroup {
|
|
25
|
+
id: string;
|
|
26
|
+
label: string;
|
|
27
|
+
icon: LucideIcon;
|
|
28
|
+
features: ElementToolFeature[];
|
|
29
|
+
}
|
|
30
|
+
export interface ElementToolGroup {
|
|
31
|
+
id: string;
|
|
32
|
+
label: string;
|
|
33
|
+
icon: LucideIcon;
|
|
34
|
+
subgroups: ElementToolSubgroup[];
|
|
35
|
+
}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import type { CssPropertyRow } from "./collect-css-properties";
|
|
2
|
+
import type { ElementToolFeature, ElementToolOption } from "./element-tool-model";
|
|
3
|
+
interface ElementToolValueOptions {
|
|
4
|
+
feature: ElementToolFeature;
|
|
5
|
+
inspectedStyles: CssPropertyRow[];
|
|
6
|
+
attributeValues: {
|
|
7
|
+
locked: string;
|
|
8
|
+
ariaLabel: string;
|
|
9
|
+
linkUrl: string;
|
|
10
|
+
};
|
|
11
|
+
}
|
|
12
|
+
export declare function getElementToolValue({ feature, inspectedStyles, attributeValues, }: ElementToolValueOptions): string;
|
|
13
|
+
export declare function normalizeFeatureCommitValue(feature: ElementToolFeature, nextValue: string): string;
|
|
14
|
+
export declare function getSteppedFeatureValue({ currentValue, feature, direction, }: {
|
|
15
|
+
currentValue: string;
|
|
16
|
+
feature: ElementToolFeature;
|
|
17
|
+
direction: "decrease" | "increase";
|
|
18
|
+
}): string;
|
|
19
|
+
export declare function getTextDecorationCommitValue(currentValue: string, line: "underline" | "line-through", active: boolean): string;
|
|
20
|
+
export declare function isFeatureActive(feature: ElementToolFeature, currentValue: string): boolean;
|
|
21
|
+
export declare function getFeatureOptions(feature: ElementToolFeature, currentValue: string): ElementToolOption[];
|
|
22
|
+
export {};
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import type { RectLike } from "@starrykit/slides-core";
|
|
2
|
+
export interface CropInsets {
|
|
3
|
+
top: number;
|
|
4
|
+
right: number;
|
|
5
|
+
bottom: number;
|
|
6
|
+
left: number;
|
|
7
|
+
}
|
|
8
|
+
export interface CropRadii {
|
|
9
|
+
topLeft: string;
|
|
10
|
+
topRight: string;
|
|
11
|
+
bottomRight: string;
|
|
12
|
+
bottomLeft: string;
|
|
13
|
+
}
|
|
14
|
+
export declare const DEFAULT_CROP_INSETS: CropInsets;
|
|
15
|
+
export declare const DEFAULT_CROP_RADII: CropRadii;
|
|
16
|
+
export declare function clampCropInset(value: number, min: number, max: number): number;
|
|
17
|
+
export declare function parseInsetClipPath(value: string): CropInsets;
|
|
18
|
+
export declare function formatInsetClipPath(insets: CropInsets): string;
|
|
19
|
+
export declare function formatRoundedInsetClipPath(insets: CropInsets, radii: CropRadii): string;
|
|
20
|
+
export declare function areCropInsetsEqual(left: CropInsets, right: CropInsets): boolean;
|
|
21
|
+
export declare function cropRectByInsets<T extends RectLike>(rect: T, insets: CropInsets): T;
|
|
22
|
+
export declare function getImageCropInsets(node: HTMLElement): CropInsets;
|
|
23
|
+
export declare function getImageCropRadii(node: HTMLElement): CropRadii;
|
|
24
|
+
export declare function getVisibleImageRect(node: HTMLElement): RectLike;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
declare const EDITOR_MOTION_MS = 200;
|
|
2
|
+
declare const editorMotionClassName = "motion-safe:duration-200 motion-safe:ease-out";
|
|
3
|
+
declare const editorMotionFastClassName = "motion-safe:duration-150 motion-safe:ease-out";
|
|
4
|
+
declare const editorMotionTransitionClassName = "motion-safe:transition-[flex-basis,width,max-width,opacity] motion-safe:duration-200 motion-safe:ease-out motion-reduce:transition-none";
|
|
5
|
+
declare const editorMotionFastTransitionClassName = "motion-safe:transition-[background-color,border-color,color,box-shadow,gap,opacity,outline-color] motion-safe:duration-150 motion-safe:ease-out motion-reduce:transition-none";
|
|
6
|
+
declare const editorPanelEnterClassName = "motion-safe:animate-in motion-safe:fade-in-0 motion-reduce:animate-none";
|
|
7
|
+
declare const editorPanelExitClassName = "motion-safe:animate-out motion-safe:fade-out-0 motion-reduce:animate-none";
|
|
8
|
+
export { EDITOR_MOTION_MS, editorMotionClassName, editorMotionFastClassName, editorMotionTransitionClassName, editorMotionFastTransitionClassName, editorPanelEnterClassName, editorPanelExitClassName, };
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import type { CssPropertyRow } from "./collect-css-properties";
|
|
2
|
+
export type TextAlign = "left" | "center" | "right";
|
|
3
|
+
export interface FontFamilyOption {
|
|
4
|
+
label: string;
|
|
5
|
+
value: string;
|
|
6
|
+
}
|
|
7
|
+
export declare const FONT_FAMILY_OPTIONS: FontFamilyOption[];
|
|
8
|
+
export declare const FONT_SIZE_OPTIONS: number[];
|
|
9
|
+
export declare function getStyleValue(styles: CssPropertyRow[], propertyName: string): string;
|
|
10
|
+
export declare function parsePixelValue(value: string, fallback: number): number;
|
|
11
|
+
export declare function roundCssPixel(value: number): string;
|
|
12
|
+
export declare function getFontFamilyLabel(value: string): string;
|
|
13
|
+
export declare function isFontFamilySelected(currentValue: string, optionValue: string): boolean;
|
|
14
|
+
export declare function isBoldFontWeight(value: string): boolean;
|
|
15
|
+
export declare function parseTextDecorationLines(value: string): Set<string>;
|
|
16
|
+
export declare function getColorInputValue(value: string): string;
|
|
17
|
+
export declare function isHexColor(value: string): boolean;
|
|
Binary file
|
package/package.json
ADDED
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@starrykit/slides-editor",
|
|
3
|
+
"version": "0.1.26",
|
|
4
|
+
"description": "Embeddable React editor UI for Starry Slides — host-driven through props and callbacks.",
|
|
5
|
+
"license": "MIT",
|
|
6
|
+
"type": "module",
|
|
7
|
+
"main": "./dist/index.js",
|
|
8
|
+
"module": "./dist/index.js",
|
|
9
|
+
"types": "./dist/index.d.ts",
|
|
10
|
+
"exports": {
|
|
11
|
+
".": {
|
|
12
|
+
"types": "./dist/index.d.ts",
|
|
13
|
+
"import": "./dist/index.js"
|
|
14
|
+
}
|
|
15
|
+
},
|
|
16
|
+
"files": [
|
|
17
|
+
"dist",
|
|
18
|
+
"src/styles"
|
|
19
|
+
],
|
|
20
|
+
"scripts": {
|
|
21
|
+
"build": "tsc -p tsconfig.json && tsup src/index.tsx --format esm --external react --external react-dom"
|
|
22
|
+
},
|
|
23
|
+
"dependencies": {
|
|
24
|
+
"@starrykit/slides-core": "0.1.26",
|
|
25
|
+
"class-variance-authority": "^0.7.1",
|
|
26
|
+
"clsx": "^2.1.1",
|
|
27
|
+
"html-to-image": "^1.11.11",
|
|
28
|
+
"lucide-react": "^1.14.0",
|
|
29
|
+
"sonner": "^2.0.7",
|
|
30
|
+
"tailwind-merge": "^3.5.0",
|
|
31
|
+
"radix-ui": "^1.4.3",
|
|
32
|
+
"tw-animate-css": "^1.4.0"
|
|
33
|
+
},
|
|
34
|
+
"peerDependencies": {
|
|
35
|
+
"react": "^19.1.0",
|
|
36
|
+
"react-dom": "^19.1.0"
|
|
37
|
+
}
|
|
38
|
+
}
|
|
@@ -0,0 +1,88 @@
|
|
|
1
|
+
@import "tailwindcss";
|
|
2
|
+
@import "tw-animate-css";
|
|
3
|
+
|
|
4
|
+
/* ADR-0008: src/editor owns the Tailwind/shadcn theme inside @starrykit/slides. */
|
|
5
|
+
@source "./..";
|
|
6
|
+
|
|
7
|
+
@custom-variant dark (&:is(.dark *));
|
|
8
|
+
|
|
9
|
+
@theme inline {
|
|
10
|
+
--font-sans: "IBM Plex Sans", "Segoe UI", sans-serif;
|
|
11
|
+
--font-mono: "SFMono-Regular", "Menlo", monospace;
|
|
12
|
+
--color-background: var(--background);
|
|
13
|
+
--color-foreground: var(--foreground);
|
|
14
|
+
--color-card: var(--card);
|
|
15
|
+
--color-card-foreground: var(--card-foreground);
|
|
16
|
+
--color-popover: var(--popover);
|
|
17
|
+
--color-popover-foreground: var(--popover-foreground);
|
|
18
|
+
--color-primary: var(--primary);
|
|
19
|
+
--color-primary-foreground: var(--primary-foreground);
|
|
20
|
+
--color-secondary: var(--secondary);
|
|
21
|
+
--color-secondary-foreground: var(--secondary-foreground);
|
|
22
|
+
--color-muted: var(--muted);
|
|
23
|
+
--color-muted-foreground: var(--muted-foreground);
|
|
24
|
+
--color-accent: var(--accent);
|
|
25
|
+
--color-accent-foreground: var(--accent-foreground);
|
|
26
|
+
--color-destructive: var(--destructive);
|
|
27
|
+
--color-border: var(--border);
|
|
28
|
+
--color-input: var(--input);
|
|
29
|
+
--color-ring: var(--ring);
|
|
30
|
+
--radius-sm: calc(var(--radius) - 4px);
|
|
31
|
+
--radius-md: calc(var(--radius) - 2px);
|
|
32
|
+
--radius-lg: var(--radius);
|
|
33
|
+
--radius-xl: calc(var(--radius) + 4px);
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
:root {
|
|
37
|
+
--background: oklch(0.985 0.002 95);
|
|
38
|
+
--foreground: oklch(0.22 0 0);
|
|
39
|
+
--card: oklch(1 0 0);
|
|
40
|
+
--card-foreground: var(--foreground);
|
|
41
|
+
--popover: oklch(1 0 0);
|
|
42
|
+
--popover-foreground: var(--foreground);
|
|
43
|
+
--primary: var(--foreground);
|
|
44
|
+
--primary-foreground: oklch(1 0 0);
|
|
45
|
+
--secondary: oklch(0.96 0 0);
|
|
46
|
+
--secondary-foreground: var(--foreground);
|
|
47
|
+
--muted: oklch(0.94 0 0);
|
|
48
|
+
--muted-foreground: oklch(0.5 0 0);
|
|
49
|
+
--accent: oklch(0.94 0 0);
|
|
50
|
+
--accent-foreground: var(--foreground);
|
|
51
|
+
--destructive: oklch(0.58 0.22 27);
|
|
52
|
+
--border: oklch(0.22 0 0 / 0.08);
|
|
53
|
+
--input: oklch(0.22 0 0 / 0.12);
|
|
54
|
+
--ring: oklch(0.22 0 0 / 0.24);
|
|
55
|
+
--radius: 0.5rem;
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
@layer base {
|
|
59
|
+
html,
|
|
60
|
+
body,
|
|
61
|
+
#root {
|
|
62
|
+
margin: 0;
|
|
63
|
+
width: 100%;
|
|
64
|
+
height: 100%;
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
* {
|
|
68
|
+
box-sizing: border-box;
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
body {
|
|
72
|
+
background: var(--background);
|
|
73
|
+
color: var(--foreground);
|
|
74
|
+
font-family: var(--font-sans);
|
|
75
|
+
line-height: 1.5;
|
|
76
|
+
font-weight: 400;
|
|
77
|
+
user-select: none;
|
|
78
|
+
-webkit-user-select: none;
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
input,
|
|
82
|
+
textarea,
|
|
83
|
+
[contenteditable="true"],
|
|
84
|
+
[contenteditable="plaintext-only"] {
|
|
85
|
+
user-select: text;
|
|
86
|
+
-webkit-user-select: text;
|
|
87
|
+
}
|
|
88
|
+
}
|