@peteai/presentation-editor 0.0.1 → 0.0.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/README.md +172 -38
- package/dist/components/presentation-editor/active-layers-buttons.svelte +53 -0
- package/dist/components/presentation-editor/active-layers-buttons.svelte.d.ts +3 -0
- package/dist/components/presentation-editor/active-layers.svelte +181 -0
- package/dist/components/presentation-editor/active-layers.svelte.d.ts +3 -0
- package/dist/components/presentation-editor/color-indicator/color-indicator-gradient-def.svelte +81 -0
- package/dist/components/presentation-editor/color-indicator/color-indicator-gradient-def.svelte.d.ts +9 -0
- package/dist/components/presentation-editor/color-indicator/color-indicator-gradient.svelte +21 -0
- package/dist/components/presentation-editor/color-indicator/color-indicator-gradient.svelte.d.ts +8 -0
- package/dist/components/presentation-editor/color-indicator/color-indicator.svelte +23 -0
- package/dist/components/presentation-editor/color-indicator/color-indicator.svelte.d.ts +6 -0
- package/dist/components/presentation-editor/color-indicator/index.d.ts +4 -0
- package/dist/components/presentation-editor/color-indicator/index.js +6 -0
- package/dist/components/presentation-editor/cursor-tooltip.svelte +1 -1
- package/dist/components/presentation-editor/dragged.svelte +21 -11
- package/dist/components/presentation-editor/fonts.d.ts +3 -0
- package/dist/components/presentation-editor/fonts.js +1278 -0
- package/dist/components/presentation-editor/header.svelte +21 -33
- package/dist/components/presentation-editor/header.svelte.d.ts +16 -6
- package/dist/components/presentation-editor/hotkeys.svelte +85 -0
- package/dist/components/presentation-editor/{sidebar/layers.svelte.d.ts → hotkeys.svelte.d.ts} +3 -3
- package/dist/components/presentation-editor/layers/active-background-border.svelte +3 -7
- package/dist/components/presentation-editor/layers/active-layer-border.svelte +2 -5
- package/dist/components/presentation-editor/layers/active-layer-border.svelte.d.ts +0 -1
- package/dist/components/presentation-editor/layers/buttons/border-button/border-button.svelte +113 -129
- package/dist/components/presentation-editor/layers/buttons/border-button/border-button.svelte.d.ts +2 -2
- package/dist/components/presentation-editor/layers/buttons/corner-radius-button/corner-radius-button.svelte +51 -32
- package/dist/components/presentation-editor/layers/buttons/corner-radius-button/corner-radius-button.svelte.d.ts +2 -2
- package/dist/components/presentation-editor/layers/buttons/flip-button/flip-button.svelte +30 -7
- package/dist/components/presentation-editor/layers/buttons/flip-button/flip-button.svelte.d.ts +3 -3
- package/dist/components/presentation-editor/layers/buttons/opacity-button/opacity-button.svelte +76 -33
- package/dist/components/presentation-editor/layers/buttons/opacity-button/opacity-button.svelte.d.ts +3 -3
- package/dist/components/presentation-editor/layers/controls/corner-scale-control/corner-scale-control.svelte +89 -59
- package/dist/components/presentation-editor/layers/controls/corner-scale-control/corner-scale-control.svelte.d.ts +5 -100
- package/dist/components/presentation-editor/layers/controls/group-resize-control/group-resize-control.svelte +337 -0
- package/dist/components/presentation-editor/layers/controls/group-resize-control/group-resize-control.svelte.d.ts +104 -0
- package/dist/components/presentation-editor/layers/controls/group-resize-control/index.d.ts +2 -0
- package/dist/components/presentation-editor/layers/controls/group-resize-control/index.js +4 -0
- package/dist/components/presentation-editor/layers/controls/rotate-control/rotate-control.svelte +128 -43
- package/dist/components/presentation-editor/layers/controls/rotate-control/rotate-control.svelte.d.ts +1 -5
- package/dist/components/presentation-editor/layers/controls/side-resize-control/side-resize-control.svelte +68 -57
- package/dist/components/presentation-editor/layers/controls/side-resize-control/side-resize-control.svelte.d.ts +2 -110
- package/dist/components/presentation-editor/layers/controls/side-scale-control/side-scale-control.svelte +45 -32
- package/dist/components/presentation-editor/layers/controls/side-scale-control/side-scale-control.svelte.d.ts +2 -54
- package/dist/components/presentation-editor/layers/index.d.ts +4 -5
- package/dist/components/presentation-editor/layers/index.js +7 -8
- package/dist/components/presentation-editor/layers/layer-button.svelte +25 -7
- package/dist/components/presentation-editor/layers/layer-wrapper.svelte +212 -162
- package/dist/components/presentation-editor/layers/layer-wrapper.svelte.d.ts +2 -2
- package/dist/components/presentation-editor/layers/types/background/background-content-image.svelte +41 -0
- package/dist/components/presentation-editor/layers/types/background/background-content-image.svelte.d.ts +8 -0
- package/dist/components/presentation-editor/layers/types/background/background-layer-buttons.svelte +28 -74
- package/dist/components/presentation-editor/layers/types/background/background-layer-buttons.svelte.d.ts +2 -17
- package/dist/components/presentation-editor/layers/types/background/background-layer-content.svelte +19 -0
- package/dist/components/presentation-editor/layers/types/background/background-layer-content.svelte.d.ts +8 -0
- package/dist/components/presentation-editor/layers/types/background/background-layer.svelte +69 -61
- package/dist/components/presentation-editor/layers/types/background/background-layer.svelte.d.ts +2 -3
- package/dist/components/presentation-editor/layers/types/background/index.d.ts +2 -3
- package/dist/components/presentation-editor/layers/types/background/index.js +2 -3
- package/dist/components/presentation-editor/layers/types/html/buttons/alignment-button/alignment-button.svelte +55 -12
- package/dist/components/presentation-editor/layers/types/html/buttons/alignment-button/alignment-button.svelte.d.ts +3 -3
- package/dist/components/presentation-editor/layers/types/html/buttons/bold-button/bold-button.svelte +60 -8
- package/dist/components/presentation-editor/layers/types/html/buttons/bold-button/bold-button.svelte.d.ts +3 -3
- package/dist/components/presentation-editor/layers/types/html/buttons/case-button/case-button.svelte +59 -24
- package/dist/components/presentation-editor/layers/types/html/buttons/case-button/case-button.svelte.d.ts +3 -3
- package/dist/components/presentation-editor/layers/types/html/buttons/color-button/color-button.svelte +27 -76
- package/dist/components/presentation-editor/layers/types/html/buttons/color-button/color-button.svelte.d.ts +3 -3
- package/dist/components/presentation-editor/layers/types/html/buttons/font-family-button/font-family-button.svelte +36 -0
- package/dist/components/presentation-editor/layers/types/html/buttons/font-family-button/font-family-button.svelte.d.ts +7 -0
- package/dist/components/presentation-editor/layers/types/html/buttons/font-family-button/index.d.ts +2 -0
- package/dist/components/presentation-editor/layers/types/html/buttons/font-family-button/index.js +2 -0
- package/dist/components/presentation-editor/layers/types/html/buttons/font-size-button/font-size-button.svelte +72 -29
- package/dist/components/presentation-editor/layers/types/html/buttons/font-size-button/font-size-button.svelte.d.ts +3 -5
- package/dist/components/presentation-editor/layers/types/html/buttons/italic-button/italic-button.svelte +60 -8
- package/dist/components/presentation-editor/layers/types/html/buttons/italic-button/italic-button.svelte.d.ts +3 -3
- package/dist/components/presentation-editor/layers/types/html/buttons/list-button/list-button.svelte +71 -18
- package/dist/components/presentation-editor/layers/types/html/buttons/list-button/list-button.svelte.d.ts +3 -3
- package/dist/components/presentation-editor/layers/types/html/buttons/strikethrough-button/strikethrough-button.svelte +54 -8
- package/dist/components/presentation-editor/layers/types/html/buttons/strikethrough-button/strikethrough-button.svelte.d.ts +3 -3
- package/dist/components/presentation-editor/layers/types/html/buttons/underline-button/underline-button.svelte +54 -9
- package/dist/components/presentation-editor/layers/types/html/buttons/underline-button/underline-button.svelte.d.ts +3 -3
- package/dist/components/presentation-editor/layers/types/html/editor/createEditor.js +2 -2
- package/dist/components/presentation-editor/layers/types/html/editor/utils.d.ts +11 -0
- package/dist/components/presentation-editor/layers/types/html/editor/utils.js +88 -0
- package/dist/components/presentation-editor/layers/types/html/extensions/font-family/font-family.d.ts +27 -0
- package/dist/components/presentation-editor/layers/types/html/extensions/font-family/font-family.js +40 -0
- package/dist/components/presentation-editor/layers/types/html/extensions/font-family/index.d.ts +3 -0
- package/dist/components/presentation-editor/layers/types/html/extensions/font-family/index.js +3 -0
- package/dist/components/presentation-editor/layers/types/html/extensions/font-size/font-size.d.ts +5 -1
- package/dist/components/presentation-editor/layers/types/html/extensions/font-size/font-size.js +3 -7
- package/dist/components/presentation-editor/layers/types/html/extensions.d.ts +1 -0
- package/dist/components/presentation-editor/layers/types/html/extensions.js +56 -0
- package/dist/components/presentation-editor/layers/types/html/html-content.svelte +26 -5
- package/dist/components/presentation-editor/layers/types/html/html-layer-content.svelte +26 -0
- package/dist/components/presentation-editor/layers/types/html/html-layer-content.svelte.d.ts +9 -0
- package/dist/components/presentation-editor/layers/types/html/html-layer-edit.svelte +103 -0
- package/dist/components/presentation-editor/layers/types/html/html-layer-edit.svelte.d.ts +8 -0
- package/dist/components/presentation-editor/layers/types/html/html-layer.svelte +61 -53
- package/dist/components/presentation-editor/layers/types/html/index.d.ts +3 -5
- package/dist/components/presentation-editor/layers/types/html/index.js +3 -56
- package/dist/components/presentation-editor/layers/types/image/{image-content.svelte → image-layer-content.svelte} +11 -3
- package/dist/components/presentation-editor/layers/types/image/image-layer-content.svelte.d.ts +8 -0
- package/dist/components/presentation-editor/layers/types/image/image-layer.svelte +51 -21
- package/dist/components/presentation-editor/layers/types/image/index.d.ts +2 -4
- package/dist/components/presentation-editor/layers/types/image/index.js +2 -4
- package/dist/components/presentation-editor/layers/utils.d.ts +68 -9
- package/dist/components/presentation-editor/layers/utils.js +260 -25
- package/dist/components/presentation-editor/menu/background-menu-content.svelte +80 -0
- package/dist/components/presentation-editor/menu/background-menu-content.svelte.d.ts +9 -0
- package/dist/components/presentation-editor/menu/layer-menu-content.svelte +183 -0
- package/dist/components/presentation-editor/menu/layer-menu-content.svelte.d.ts +3 -0
- package/dist/components/presentation-editor/menu/slide-menu-content.svelte +67 -0
- package/dist/components/presentation-editor/menu/slide-menu-content.svelte.d.ts +9 -0
- package/dist/components/presentation-editor/presentation-editor.svelte +120 -176
- package/dist/components/presentation-editor/presentation-editor.svelte.d.ts +1 -4
- package/dist/components/presentation-editor/presentation-editor.svelte.js +597 -136
- package/dist/components/presentation-editor/sidebar/color-sidebar/color-sidebar-color.svelte +58 -0
- package/dist/components/presentation-editor/sidebar/color-sidebar/color-sidebar-color.svelte.d.ts +10 -0
- package/dist/components/presentation-editor/sidebar/color-sidebar/color-sidebar-gradient-picker.svelte +144 -0
- package/dist/components/presentation-editor/sidebar/color-sidebar/color-sidebar-gradient-picker.svelte.d.ts +7 -0
- package/dist/components/presentation-editor/sidebar/color-sidebar/color-sidebar.svelte +404 -0
- package/dist/components/presentation-editor/sidebar/color-sidebar/color-sidebar.svelte.d.ts +3 -0
- package/dist/components/presentation-editor/sidebar/color-sidebar/index.d.ts +2 -0
- package/dist/components/presentation-editor/sidebar/color-sidebar/index.js +2 -0
- package/dist/components/presentation-editor/sidebar/font-sidebar/font-sidebar-button.svelte +26 -0
- package/dist/components/presentation-editor/sidebar/font-sidebar/font-sidebar-button.svelte.d.ts +8 -0
- package/dist/components/presentation-editor/sidebar/font-sidebar/font-sidebar.svelte +216 -0
- package/dist/components/presentation-editor/sidebar/font-sidebar/font-sidebar.svelte.d.ts +3 -0
- package/dist/components/presentation-editor/sidebar/font-sidebar/index.d.ts +2 -0
- package/dist/components/presentation-editor/sidebar/font-sidebar/index.js +2 -0
- package/dist/components/presentation-editor/sidebar/position-slidebar.svelte +130 -0
- package/dist/components/presentation-editor/sidebar/position-slidebar.svelte.d.ts +18 -0
- package/dist/components/presentation-editor/sidebar/sidebar-text-tab-button.svelte +90 -0
- package/dist/components/presentation-editor/sidebar/sidebar-text-tab-button.svelte.d.ts +7 -0
- package/dist/components/presentation-editor/sidebar/sidebar-text-tab.svelte +82 -0
- package/dist/components/presentation-editor/sidebar/sidebar-text-tab.svelte.d.ts +18 -0
- package/dist/components/presentation-editor/sidebar/{images-library.svelte → sidebar-uploads-tab.svelte} +0 -1
- package/dist/components/presentation-editor/sidebar/sidebar-uploads-tab.svelte.d.ts +3 -0
- package/dist/components/presentation-editor/sidebar/sidebar-wrapper.svelte +25 -0
- package/dist/components/presentation-editor/sidebar/sidebar-wrapper.svelte.d.ts +7 -0
- package/dist/components/presentation-editor/sidebar/sidebar.svelte +71 -15
- package/dist/components/presentation-editor/sidebar/sidebar.svelte.d.ts +16 -5
- package/dist/components/presentation-editor/sidebar/uploads-image.svelte +28 -11
- package/dist/components/presentation-editor/slide-editor.svelte +20 -22
- package/dist/components/presentation-editor/slide-inner.svelte +19 -18
- package/dist/components/presentation-editor/slides-navigation/slide-preview.svelte +61 -52
- package/dist/components/presentation-editor/slides-navigation/slides-navigation.svelte +6 -8
- package/dist/components/presentation-editor/snapping-guides.svelte +3 -3
- package/dist/components/presentation-editor/types.d.ts +67 -27
- package/dist/components/presentation-editor/utils.d.ts +50 -1
- package/dist/components/presentation-editor/utils.js +101 -6
- package/dist/components/ui/button/button.svelte +3 -2
- package/dist/components/ui/button/button.svelte.d.ts +5 -82
- package/dist/components/ui/color-picker/color-picker-alpha-grid.svelte +43 -0
- package/dist/components/ui/color-picker/color-picker-alpha-grid.svelte.d.ts +8 -0
- package/dist/components/ui/color-picker/color-picker.svelte +344 -0
- package/dist/components/ui/color-picker/color-picker.svelte.d.ts +13 -0
- package/dist/components/ui/color-picker/index.d.ts +3 -0
- package/dist/components/ui/color-picker/index.js +5 -0
- package/dist/components/ui/context-menu/context-menu-shortcut.svelte +6 -3
- package/dist/components/ui/context-menu/context-menu-sub-trigger.svelte +1 -1
- package/dist/components/ui/dropdown-menu/dropdown-menu-item.svelte +1 -1
- package/dist/components/ui/dropdown-menu/dropdown-menu-shortcut.svelte +6 -3
- package/dist/components/ui/dropdown-menu/dropdown-menu-sub-trigger.svelte +1 -1
- package/dist/components/ui/infinite-loader/index.d.ts +4 -0
- package/dist/components/ui/infinite-loader/index.js +4 -0
- package/dist/components/ui/infinite-loader/infinite-loader-loop-tracker.d.ts +13 -0
- package/dist/components/ui/infinite-loader/infinite-loader-loop-tracker.js +44 -0
- package/dist/components/ui/infinite-loader/infinite-loader-state.svelte.d.ts +15 -0
- package/dist/components/ui/infinite-loader/infinite-loader-state.svelte.js +28 -0
- package/dist/components/ui/infinite-loader/infinite-loader.svelte +149 -0
- package/dist/components/ui/infinite-loader/infinite-loader.svelte.d.ts +17 -0
- package/dist/components/ui/input/input.svelte +1 -1
- package/dist/components/ui/slider/slider.svelte +20 -18
- package/dist/components/ui/tabs/index.d.ts +6 -0
- package/dist/components/ui/tabs/index.js +8 -0
- package/dist/components/ui/tabs/tabs-content.svelte +19 -0
- package/dist/components/ui/tabs/tabs-content.svelte.d.ts +4 -0
- package/dist/components/ui/tabs/tabs-list.svelte +19 -0
- package/dist/components/ui/tabs/tabs-list.svelte.d.ts +4 -0
- package/dist/components/ui/tabs/tabs-trigger.svelte +19 -0
- package/dist/components/ui/tabs/tabs-trigger.svelte.d.ts +4 -0
- package/dist/components/ui/toggle/toggle.svelte +3 -2
- package/dist/components/ui/toggle/toggle.svelte.d.ts +2 -46
- package/dist/index.d.ts +5 -6
- package/dist/index.js +1 -4
- package/dist/plugin.js +3 -2
- package/dist/utils.d.ts +1 -0
- package/dist/utils.js +1 -0
- package/package.json +28 -25
- package/dist/components/presentation-editor/app.css +0 -12
- package/dist/components/presentation-editor/layers/hovered-layer.svelte +0 -34
- package/dist/components/presentation-editor/layers/hovered-layer.svelte.d.ts +0 -7
- package/dist/components/presentation-editor/layers/types/background/background-content.svelte +0 -11
- package/dist/components/presentation-editor/layers/types/background/background-content.svelte.d.ts +0 -7
- package/dist/components/presentation-editor/layers/types/background/background-layer-thumb.svelte +0 -12
- package/dist/components/presentation-editor/layers/types/background/background-layer-thumb.svelte.d.ts +0 -7
- package/dist/components/presentation-editor/layers/types/html/html-layer-active.svelte +0 -159
- package/dist/components/presentation-editor/layers/types/html/html-layer-active.svelte.d.ts +0 -8
- package/dist/components/presentation-editor/layers/types/html/html-layer-buttons.svelte +0 -42
- package/dist/components/presentation-editor/layers/types/html/html-layer-buttons.svelte.d.ts +0 -10
- package/dist/components/presentation-editor/layers/types/html/html-layer-thumb.svelte +0 -24
- package/dist/components/presentation-editor/layers/types/html/html-layer-thumb.svelte.d.ts +0 -8
- package/dist/components/presentation-editor/layers/types/image/image-content.svelte.d.ts +0 -8
- package/dist/components/presentation-editor/layers/types/image/image-layer-buttons.svelte +0 -21
- package/dist/components/presentation-editor/layers/types/image/image-layer-buttons.svelte.d.ts +0 -7
- package/dist/components/presentation-editor/layers/types/image/image-layer-thumb.svelte +0 -13
- package/dist/components/presentation-editor/layers/types/image/image-layer-thumb.svelte.d.ts +0 -8
- package/dist/components/presentation-editor/sidebar/images-library.svelte.d.ts +0 -3
- package/dist/components/presentation-editor/sidebar/layers.svelte +0 -94
- package/dist/components/presentation-editor/slides-navigation/buttons/slide-delete-button.svelte +0 -32
- package/dist/components/presentation-editor/slides-navigation/buttons/slide-delete-button.svelte.d.ts +0 -10
- package/dist/components/presentation-editor/slides-navigation/buttons/slide-duplicate-button.svelte +0 -34
- package/dist/components/presentation-editor/slides-navigation/buttons/slide-duplicate-button.svelte.d.ts +0 -10
|
@@ -1,23 +1,18 @@
|
|
|
1
1
|
import { type JSONContent } from '@tiptap/core';
|
|
2
|
-
export type
|
|
2
|
+
export type ActiveSidebarTab = 'text' | 'uploads';
|
|
3
|
+
type Colored = 'background' | 'text' | 'border';
|
|
4
|
+
export type ActiveSidebarPopup = 'position' | 'font' | `${Colored}Color`;
|
|
5
|
+
export type Fonts = {
|
|
6
|
+
[key: string]: {
|
|
7
|
+
type: string;
|
|
8
|
+
};
|
|
9
|
+
};
|
|
3
10
|
export type Image = {
|
|
4
11
|
id: string;
|
|
5
12
|
src: string;
|
|
6
13
|
width: number;
|
|
7
14
|
height: number;
|
|
8
15
|
};
|
|
9
|
-
export type Dragged = {
|
|
10
|
-
id: string;
|
|
11
|
-
hidden: boolean;
|
|
12
|
-
sticky: boolean;
|
|
13
|
-
image: Image;
|
|
14
|
-
x: number;
|
|
15
|
-
y: number;
|
|
16
|
-
offsetX: number;
|
|
17
|
-
offsetY: number;
|
|
18
|
-
initialScale: number;
|
|
19
|
-
scale: number | null;
|
|
20
|
-
};
|
|
21
16
|
export type CursorTooltip = {
|
|
22
17
|
x: number;
|
|
23
18
|
y: number;
|
|
@@ -29,13 +24,14 @@ interface BaseLayer {
|
|
|
29
24
|
y: number;
|
|
30
25
|
width: number;
|
|
31
26
|
height: number;
|
|
27
|
+
scale: number | null;
|
|
32
28
|
rotate: number | null;
|
|
33
29
|
opacity: number | null;
|
|
34
30
|
sortOrder: number;
|
|
31
|
+
locked: boolean;
|
|
35
32
|
}
|
|
36
33
|
export interface HtmlLayer extends BaseLayer {
|
|
37
34
|
type: 'html';
|
|
38
|
-
scale: number | null;
|
|
39
35
|
html: JSONContent;
|
|
40
36
|
}
|
|
41
37
|
export type LayerBorder = {
|
|
@@ -45,7 +41,6 @@ export type LayerBorder = {
|
|
|
45
41
|
};
|
|
46
42
|
export interface ImageLayer extends BaseLayer, LayerBorder {
|
|
47
43
|
type: 'image';
|
|
48
|
-
scale: number | null;
|
|
49
44
|
image: Image;
|
|
50
45
|
offsetX: number | null;
|
|
51
46
|
offsetY: number | null;
|
|
@@ -54,19 +49,25 @@ export interface ImageLayer extends BaseLayer, LayerBorder {
|
|
|
54
49
|
flipY: boolean;
|
|
55
50
|
}
|
|
56
51
|
export type Layer = HtmlLayer | ImageLayer;
|
|
52
|
+
export type Gradient = {
|
|
53
|
+
type: 'linear90' | 'linear180' | 'linear135' | 'radialCenter' | 'radialTopLeft';
|
|
54
|
+
colors: string[];
|
|
55
|
+
};
|
|
56
|
+
export type BackgroundImage = Pick<ImageLayer, 'rotate' | 'opacity' | 'scale' | 'image' | 'offsetX' | 'offsetY' | 'flipX' | 'flipY'>;
|
|
57
57
|
export type Slide = {
|
|
58
58
|
id: string;
|
|
59
59
|
backgroundColor: string | null;
|
|
60
|
+
backgroundImage: BackgroundImage | null;
|
|
61
|
+
backgroundLocked: boolean;
|
|
60
62
|
layers: Layer[];
|
|
61
63
|
sortOrder: number;
|
|
64
|
+
locked: boolean;
|
|
62
65
|
};
|
|
63
66
|
export type ActiveAction = {
|
|
67
|
+
id: string;
|
|
64
68
|
type: string;
|
|
65
69
|
cursor?: string;
|
|
66
70
|
tooltip?: CursorTooltip | null;
|
|
67
|
-
clientX: number;
|
|
68
|
-
clientY: number;
|
|
69
|
-
layer: Layer;
|
|
70
71
|
};
|
|
71
72
|
export type SlideAddAction = {
|
|
72
73
|
type: 'slideAdd';
|
|
@@ -77,17 +78,20 @@ export type SlideRemoveAction = {
|
|
|
77
78
|
slide: Slide;
|
|
78
79
|
newSlide?: Slide;
|
|
79
80
|
};
|
|
80
|
-
export type
|
|
81
|
-
type: 'layerAdd' | 'layerRemove';
|
|
82
|
-
layer: Layer;
|
|
83
|
-
};
|
|
84
|
-
export type SlideChangesAction = {
|
|
81
|
+
export type SlideUpdateAction = {
|
|
85
82
|
type: 'slide';
|
|
83
|
+
slideId: Slide['id'];
|
|
86
84
|
undo: object;
|
|
87
85
|
redo: object;
|
|
88
86
|
};
|
|
89
|
-
export type
|
|
87
|
+
export type LayersToggleAction = {
|
|
88
|
+
type: 'layersAdd' | 'layersRemove';
|
|
89
|
+
slideId: Slide['id'];
|
|
90
|
+
layers: Layer[];
|
|
91
|
+
};
|
|
92
|
+
export type LayerUpdateAction = {
|
|
90
93
|
type: 'layer';
|
|
94
|
+
slideId: Slide['id'];
|
|
91
95
|
layer: {
|
|
92
96
|
id: string;
|
|
93
97
|
type: string;
|
|
@@ -95,10 +99,25 @@ export type LayerChangesAction = {
|
|
|
95
99
|
undo: object;
|
|
96
100
|
redo: object;
|
|
97
101
|
};
|
|
98
|
-
|
|
99
|
-
export type
|
|
100
|
-
|
|
102
|
+
type LayerAction = LayersToggleAction | LayerUpdateAction;
|
|
103
|
+
export type LayersGroupAction = {
|
|
104
|
+
type: 'layersGroup';
|
|
105
|
+
actions: LayerAction[];
|
|
106
|
+
};
|
|
107
|
+
export type LayerToSlideBackgroundAction = {
|
|
108
|
+
type: 'layerToSlideBackground';
|
|
109
|
+
slideId: Slide['id'];
|
|
110
|
+
imageLayer: ImageLayer;
|
|
111
|
+
backgroundImage: Slide['backgroundImage'];
|
|
112
|
+
opposite?: boolean;
|
|
101
113
|
};
|
|
114
|
+
export type BackgroundImageUpdateAction = {
|
|
115
|
+
type: 'backgroundImage';
|
|
116
|
+
slideId: Slide['id'];
|
|
117
|
+
undo: object;
|
|
118
|
+
redo: object;
|
|
119
|
+
};
|
|
120
|
+
export type HistoryAction = SlideAddAction | SlideUpdateAction | SlideRemoveAction | LayerAction | LayersGroupAction | LayerToSlideBackgroundAction | BackgroundImageUpdateAction;
|
|
102
121
|
interface BaseLayerGuide {
|
|
103
122
|
id: string;
|
|
104
123
|
type: string;
|
|
@@ -115,4 +134,25 @@ export interface BoxLayerGuide extends BaseLayerGuide {
|
|
|
115
134
|
inset: number;
|
|
116
135
|
}
|
|
117
136
|
export type ActiveLayerGuide = LineLayerGuide | BoxLayerGuide;
|
|
137
|
+
interface BaseDragged {
|
|
138
|
+
x: number;
|
|
139
|
+
y: number;
|
|
140
|
+
offsetX: number;
|
|
141
|
+
offsetY: number;
|
|
142
|
+
opacity: number;
|
|
143
|
+
hidden: boolean;
|
|
144
|
+
sticky: boolean;
|
|
145
|
+
inside: boolean;
|
|
146
|
+
initialScale: number;
|
|
147
|
+
scale: number;
|
|
148
|
+
customScale?: number | null;
|
|
149
|
+
ref?: HTMLDivElement;
|
|
150
|
+
}
|
|
151
|
+
export interface DraggedImage extends BaseDragged {
|
|
152
|
+
image: ImageLayer['image'];
|
|
153
|
+
}
|
|
154
|
+
export interface DraggedHtml extends BaseDragged {
|
|
155
|
+
html: HtmlLayer['html'];
|
|
156
|
+
}
|
|
157
|
+
export type Dragged = DraggedHtml | DraggedImage;
|
|
118
158
|
export {};
|
|
@@ -1,5 +1,54 @@
|
|
|
1
|
-
import type { Slide } from './types.js';
|
|
1
|
+
import type { Gradient, Slide } from './types.js';
|
|
2
2
|
export declare const arraysEqual: (a: unknown[], b: unknown[]) => boolean;
|
|
3
3
|
export declare const checkImage: (url: string) => Promise<HTMLImageElement>;
|
|
4
|
+
export declare function gradientToString(gradient: Gradient): string;
|
|
5
|
+
export declare function stringToGradient(value: string): Gradient;
|
|
4
6
|
export declare const getSlides: () => Slide[];
|
|
7
|
+
export declare const buildParagraphHtml: ({ text, fontSize, lineHeight, textAlign, uppercase, bold, italic, }: {
|
|
8
|
+
text: string;
|
|
9
|
+
fontSize?: number;
|
|
10
|
+
lineHeight?: number;
|
|
11
|
+
textAlign?: string;
|
|
12
|
+
uppercase?: boolean;
|
|
13
|
+
bold?: boolean;
|
|
14
|
+
italic?: boolean;
|
|
15
|
+
}) => {
|
|
16
|
+
type: string;
|
|
17
|
+
content: {
|
|
18
|
+
type: string;
|
|
19
|
+
attrs: {
|
|
20
|
+
textTransform?: string | undefined;
|
|
21
|
+
textAlign?: string | undefined;
|
|
22
|
+
fontSize: number;
|
|
23
|
+
lineHeight: number;
|
|
24
|
+
};
|
|
25
|
+
content: {
|
|
26
|
+
marks?: {
|
|
27
|
+
type: string;
|
|
28
|
+
}[] | undefined;
|
|
29
|
+
type: string;
|
|
30
|
+
text: string;
|
|
31
|
+
}[];
|
|
32
|
+
}[];
|
|
33
|
+
};
|
|
34
|
+
export declare const buildHtmlLayerParagraphFields: ({ text }: {
|
|
35
|
+
text: string;
|
|
36
|
+
}) => {
|
|
37
|
+
html: {
|
|
38
|
+
type: string;
|
|
39
|
+
content: {
|
|
40
|
+
type: string;
|
|
41
|
+
attrs: {
|
|
42
|
+
textAlign?: string | undefined;
|
|
43
|
+
fontFamily: string;
|
|
44
|
+
fontSize: number;
|
|
45
|
+
lineHeight: number;
|
|
46
|
+
};
|
|
47
|
+
content: {
|
|
48
|
+
type: string;
|
|
49
|
+
text: string;
|
|
50
|
+
}[];
|
|
51
|
+
}[];
|
|
52
|
+
};
|
|
53
|
+
};
|
|
5
54
|
export declare const cognitionSlideToJson: (slide: any) => Slide;
|
|
@@ -22,11 +22,27 @@ export const checkImage = (url) => new Promise((resolve, reject) => {
|
|
|
22
22
|
image.onload = () => resolve(image);
|
|
23
23
|
image.onerror = reject;
|
|
24
24
|
});
|
|
25
|
+
// Function to convert Gradient to a single string value
|
|
26
|
+
export function gradientToString(gradient) {
|
|
27
|
+
return `${gradient.type}:${gradient.colors.join(',')}`;
|
|
28
|
+
}
|
|
29
|
+
// Function to convert a single string value back to Gradient
|
|
30
|
+
export function stringToGradient(value) {
|
|
31
|
+
const [type, colorsString] = value.split(':');
|
|
32
|
+
const colors = colorsString.split(',');
|
|
33
|
+
return {
|
|
34
|
+
type: type,
|
|
35
|
+
colors,
|
|
36
|
+
};
|
|
37
|
+
}
|
|
25
38
|
export const getSlides = () => [
|
|
26
39
|
{
|
|
27
40
|
id: uniqid(),
|
|
28
41
|
backgroundColor: '#5ce1e6',
|
|
42
|
+
backgroundImage: null,
|
|
43
|
+
backgroundLocked: false,
|
|
29
44
|
sortOrder: 1,
|
|
45
|
+
locked: false,
|
|
30
46
|
layers: [
|
|
31
47
|
{
|
|
32
48
|
id: uniqid(),
|
|
@@ -36,6 +52,7 @@ export const getSlides = () => [
|
|
|
36
52
|
height: 200,
|
|
37
53
|
type: 'html',
|
|
38
54
|
sortOrder: 1,
|
|
55
|
+
locked: false,
|
|
39
56
|
scale: null,
|
|
40
57
|
rotate: null,
|
|
41
58
|
opacity: null,
|
|
@@ -131,6 +148,7 @@ export const getSlides = () => [
|
|
|
131
148
|
height: 200,
|
|
132
149
|
type: 'html',
|
|
133
150
|
sortOrder: 2,
|
|
151
|
+
locked: false,
|
|
134
152
|
scale: 2,
|
|
135
153
|
rotate: 45,
|
|
136
154
|
opacity: null,
|
|
@@ -165,6 +183,7 @@ export const getSlides = () => [
|
|
|
165
183
|
height: 200,
|
|
166
184
|
type: 'html',
|
|
167
185
|
sortOrder: 3,
|
|
186
|
+
locked: false,
|
|
168
187
|
scale: null,
|
|
169
188
|
rotate: null,
|
|
170
189
|
opacity: null,
|
|
@@ -204,10 +223,30 @@ export const getSlides = () => [
|
|
|
204
223
|
],
|
|
205
224
|
},
|
|
206
225
|
];
|
|
207
|
-
const
|
|
226
|
+
const getRandomFontFamily = () => {
|
|
227
|
+
const fontFamilies = [
|
|
228
|
+
// Commonly available in most browsers
|
|
229
|
+
// 'Arial',
|
|
230
|
+
// 'Verdana',
|
|
231
|
+
// 'Times New Roman',
|
|
232
|
+
// 'Courier New',
|
|
233
|
+
// 'Georgia',
|
|
234
|
+
// Web fonts that may not be available by default
|
|
235
|
+
'Roboto',
|
|
236
|
+
'Open Sans',
|
|
237
|
+
'Lato',
|
|
238
|
+
'Montserrat',
|
|
239
|
+
'Oswald',
|
|
240
|
+
];
|
|
241
|
+
const randomIndex = Math.floor(Math.random() * fontFamilies.length);
|
|
242
|
+
return fontFamilies[randomIndex];
|
|
243
|
+
};
|
|
244
|
+
const buildParagraphContent = ({ text, fontFamily = getRandomFontFamily(), fontSize = 40, lineHeight = 1.4, textAlign, }) => ({
|
|
208
245
|
type: 'paragraph',
|
|
209
246
|
attrs: {
|
|
210
|
-
|
|
247
|
+
fontFamily,
|
|
248
|
+
fontSize,
|
|
249
|
+
lineHeight,
|
|
211
250
|
...(textAlign && { textAlign }),
|
|
212
251
|
},
|
|
213
252
|
content: [{ type: 'text', text }],
|
|
@@ -219,9 +258,33 @@ const buildBulletListContent = ({ bullets }) => ({
|
|
|
219
258
|
attrs: {
|
|
220
259
|
fontSize: 40,
|
|
221
260
|
},
|
|
222
|
-
content: [buildParagraphContent({ text: bullet })],
|
|
261
|
+
content: [buildParagraphContent({ text: bullet, lineHeight: 1.5 })],
|
|
223
262
|
})),
|
|
224
263
|
});
|
|
264
|
+
export const buildParagraphHtml = ({ text, fontSize = 56, lineHeight = 1.4, textAlign, uppercase, bold, italic, }) => {
|
|
265
|
+
const marks = [];
|
|
266
|
+
if (bold) {
|
|
267
|
+
marks.push({ type: 'bold' });
|
|
268
|
+
}
|
|
269
|
+
if (italic) {
|
|
270
|
+
marks.push({ type: 'italic' });
|
|
271
|
+
}
|
|
272
|
+
return {
|
|
273
|
+
type: 'doc',
|
|
274
|
+
content: [
|
|
275
|
+
{
|
|
276
|
+
type: 'paragraph',
|
|
277
|
+
attrs: {
|
|
278
|
+
fontSize,
|
|
279
|
+
lineHeight,
|
|
280
|
+
...(textAlign && { textAlign }),
|
|
281
|
+
...(uppercase && { textTransform: 'uppercase' }),
|
|
282
|
+
},
|
|
283
|
+
content: [{ type: 'text', text, ...(marks.length && { marks }) }],
|
|
284
|
+
},
|
|
285
|
+
],
|
|
286
|
+
};
|
|
287
|
+
};
|
|
225
288
|
const buildHeadlineLayer = ({ sortOrder, text, isTitle, withSubheadline, }) => ({
|
|
226
289
|
id: uniqid(),
|
|
227
290
|
x: 200,
|
|
@@ -230,6 +293,7 @@ const buildHeadlineLayer = ({ sortOrder, text, isTitle, withSubheadline, }) => (
|
|
|
230
293
|
height: 200,
|
|
231
294
|
type: 'html',
|
|
232
295
|
sortOrder,
|
|
296
|
+
locked: false,
|
|
233
297
|
scale: null,
|
|
234
298
|
rotate: null,
|
|
235
299
|
opacity: null,
|
|
@@ -255,6 +319,7 @@ const buildSubheadlineLayer = ({ sortOrder, text, }) => ({
|
|
|
255
319
|
height: 200,
|
|
256
320
|
type: 'html',
|
|
257
321
|
sortOrder,
|
|
322
|
+
locked: false,
|
|
258
323
|
scale: null,
|
|
259
324
|
rotate: null,
|
|
260
325
|
opacity: null,
|
|
@@ -263,10 +328,10 @@ const buildSubheadlineLayer = ({ sortOrder, text, }) => ({
|
|
|
263
328
|
content: [buildParagraphContent({ text, fontSize: 80, textAlign: 'center' })],
|
|
264
329
|
},
|
|
265
330
|
});
|
|
266
|
-
const buildHtmlLayerParagraphFields = ({ text }) => ({
|
|
331
|
+
export const buildHtmlLayerParagraphFields = ({ text }) => ({
|
|
267
332
|
html: {
|
|
268
333
|
type: 'doc',
|
|
269
|
-
content: [buildParagraphContent({ text })],
|
|
334
|
+
content: [buildParagraphContent({ text, lineHeight: 1.5 })],
|
|
270
335
|
},
|
|
271
336
|
});
|
|
272
337
|
const buildHtmlLayerBulletsFields = ({ bullets }) => ({
|
|
@@ -288,6 +353,7 @@ const buildColumnLayer = ({ sortOrder, slide, isRight, }) => {
|
|
|
288
353
|
height: 800,
|
|
289
354
|
type: type === 'image' ? 'image' : 'html',
|
|
290
355
|
sortOrder,
|
|
356
|
+
locked: false,
|
|
291
357
|
scale: null,
|
|
292
358
|
rotate: null,
|
|
293
359
|
opacity: null,
|
|
@@ -301,6 +367,34 @@ const buildColumnLayer = ({ sortOrder, slide, isRight, }) => {
|
|
|
301
367
|
};
|
|
302
368
|
};
|
|
303
369
|
let slideSortOrder = 1;
|
|
370
|
+
const generateBackgroundColor = () => {
|
|
371
|
+
const generateRandomHex = (length) => Math.floor(Math.random() * Math.pow(16, length))
|
|
372
|
+
.toString(16)
|
|
373
|
+
.padStart(length, '0');
|
|
374
|
+
const randomHexColor = (includeOpacity = false) => {
|
|
375
|
+
const color = `#${generateRandomHex(6)}`;
|
|
376
|
+
return `${color}${includeOpacity ? 'ff' : ''}`;
|
|
377
|
+
};
|
|
378
|
+
const isGradient = Math.random() > 0.5; // 50% chance to be a gradient
|
|
379
|
+
if (isGradient) {
|
|
380
|
+
const gradientTypes = [
|
|
381
|
+
'linear90',
|
|
382
|
+
'linear180',
|
|
383
|
+
'linear135',
|
|
384
|
+
'radialCenter',
|
|
385
|
+
'radialTopLeft',
|
|
386
|
+
];
|
|
387
|
+
const randomGradientType = gradientTypes[Math.floor(Math.random() * gradientTypes.length)];
|
|
388
|
+
const randomColorCount = Math.floor(Math.random() * 7) + 2; // Random number of colors between 2 and 8
|
|
389
|
+
return gradientToString({
|
|
390
|
+
type: randomGradientType,
|
|
391
|
+
colors: Array.from({ length: randomColorCount }, () => randomHexColor(true)),
|
|
392
|
+
});
|
|
393
|
+
}
|
|
394
|
+
else {
|
|
395
|
+
return randomHexColor();
|
|
396
|
+
}
|
|
397
|
+
};
|
|
304
398
|
export const cognitionSlideToJson = (slide) => {
|
|
305
399
|
let sortOrder = 1;
|
|
306
400
|
const layers = [];
|
|
@@ -330,6 +424,7 @@ export const cognitionSlideToJson = (slide) => {
|
|
|
330
424
|
height: 800,
|
|
331
425
|
type: 'html',
|
|
332
426
|
sortOrder: sortOrder++,
|
|
427
|
+
locked: false,
|
|
333
428
|
scale: null,
|
|
334
429
|
rotate: null,
|
|
335
430
|
opacity: null,
|
|
@@ -342,7 +437,7 @@ export const cognitionSlideToJson = (slide) => {
|
|
|
342
437
|
return {
|
|
343
438
|
id: uniqid(),
|
|
344
439
|
sortOrder: slideSortOrder++,
|
|
345
|
-
backgroundColor:
|
|
440
|
+
backgroundColor: generateBackgroundColor(),
|
|
346
441
|
layers,
|
|
347
442
|
};
|
|
348
443
|
};
|
|
@@ -4,8 +4,8 @@
|
|
|
4
4
|
import { type VariantProps, tv } from 'tailwind-variants';
|
|
5
5
|
|
|
6
6
|
export const buttonVariants = tv({
|
|
7
|
-
base: 'inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium transition-colors focus-visible:outline-none disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:
|
|
8
|
-
// ring-offset-background focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2
|
|
7
|
+
base: 'inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium transition-colors focus-visible:outline-none disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0',
|
|
8
|
+
// ring-offset-background focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 [&_svg]:size-4
|
|
9
9
|
variants: {
|
|
10
10
|
variant: {
|
|
11
11
|
default: 'bg-primary text-primary-foreground hover:bg-primary/90',
|
|
@@ -14,6 +14,7 @@
|
|
|
14
14
|
secondary: 'bg-secondary text-secondary-foreground hover:bg-secondary/80',
|
|
15
15
|
ghost: 'hover:bg-accent hover:text-accent-foreground',
|
|
16
16
|
link: 'text-primary underline-offset-4 hover:underline',
|
|
17
|
+
muted: 'bg-muted text-muted-foregound hover:bg-muted/80',
|
|
17
18
|
},
|
|
18
19
|
size: {
|
|
19
20
|
default: 'h-10 px-4 py-2',
|
|
@@ -9,6 +9,7 @@ export declare const buttonVariants: import("tailwind-variants").TVReturnType<{
|
|
|
9
9
|
secondary: string;
|
|
10
10
|
ghost: string;
|
|
11
11
|
link: string;
|
|
12
|
+
muted: string;
|
|
12
13
|
};
|
|
13
14
|
size: {
|
|
14
15
|
default: string;
|
|
@@ -21,47 +22,7 @@ export declare const buttonVariants: import("tailwind-variants").TVReturnType<{
|
|
|
21
22
|
active: {
|
|
22
23
|
true: string;
|
|
23
24
|
};
|
|
24
|
-
}, undefined, "inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium transition-colors focus-visible:outline-none disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:
|
|
25
|
-
variant: {
|
|
26
|
-
default: string;
|
|
27
|
-
destructive: string;
|
|
28
|
-
outline: string;
|
|
29
|
-
secondary: string;
|
|
30
|
-
ghost: string;
|
|
31
|
-
link: string;
|
|
32
|
-
};
|
|
33
|
-
size: {
|
|
34
|
-
default: string;
|
|
35
|
-
xs: string;
|
|
36
|
-
sm: string;
|
|
37
|
-
lg: string;
|
|
38
|
-
icon: string;
|
|
39
|
-
'icon-xs': string;
|
|
40
|
-
};
|
|
41
|
-
active: {
|
|
42
|
-
true: string;
|
|
43
|
-
};
|
|
44
|
-
}, {
|
|
45
|
-
variant: {
|
|
46
|
-
default: string;
|
|
47
|
-
destructive: string;
|
|
48
|
-
outline: string;
|
|
49
|
-
secondary: string;
|
|
50
|
-
ghost: string;
|
|
51
|
-
link: string;
|
|
52
|
-
};
|
|
53
|
-
size: {
|
|
54
|
-
default: string;
|
|
55
|
-
xs: string;
|
|
56
|
-
sm: string;
|
|
57
|
-
lg: string;
|
|
58
|
-
icon: string;
|
|
59
|
-
'icon-xs': string;
|
|
60
|
-
};
|
|
61
|
-
active: {
|
|
62
|
-
true: string;
|
|
63
|
-
};
|
|
64
|
-
}>, {
|
|
25
|
+
}, undefined, "inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium transition-colors focus-visible:outline-none disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0", {
|
|
65
26
|
variant: {
|
|
66
27
|
default: string;
|
|
67
28
|
destructive: string;
|
|
@@ -69,6 +30,7 @@ export declare const buttonVariants: import("tailwind-variants").TVReturnType<{
|
|
|
69
30
|
secondary: string;
|
|
70
31
|
ghost: string;
|
|
71
32
|
link: string;
|
|
33
|
+
muted: string;
|
|
72
34
|
};
|
|
73
35
|
size: {
|
|
74
36
|
default: string;
|
|
@@ -89,6 +51,7 @@ export declare const buttonVariants: import("tailwind-variants").TVReturnType<{
|
|
|
89
51
|
secondary: string;
|
|
90
52
|
ghost: string;
|
|
91
53
|
link: string;
|
|
54
|
+
muted: string;
|
|
92
55
|
};
|
|
93
56
|
size: {
|
|
94
57
|
default: string;
|
|
@@ -101,47 +64,7 @@ export declare const buttonVariants: import("tailwind-variants").TVReturnType<{
|
|
|
101
64
|
active: {
|
|
102
65
|
true: string;
|
|
103
66
|
};
|
|
104
|
-
}, undefined, "inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium transition-colors focus-visible:outline-none disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:
|
|
105
|
-
variant: {
|
|
106
|
-
default: string;
|
|
107
|
-
destructive: string;
|
|
108
|
-
outline: string;
|
|
109
|
-
secondary: string;
|
|
110
|
-
ghost: string;
|
|
111
|
-
link: string;
|
|
112
|
-
};
|
|
113
|
-
size: {
|
|
114
|
-
default: string;
|
|
115
|
-
xs: string;
|
|
116
|
-
sm: string;
|
|
117
|
-
lg: string;
|
|
118
|
-
icon: string;
|
|
119
|
-
'icon-xs': string;
|
|
120
|
-
};
|
|
121
|
-
active: {
|
|
122
|
-
true: string;
|
|
123
|
-
};
|
|
124
|
-
}, {
|
|
125
|
-
variant: {
|
|
126
|
-
default: string;
|
|
127
|
-
destructive: string;
|
|
128
|
-
outline: string;
|
|
129
|
-
secondary: string;
|
|
130
|
-
ghost: string;
|
|
131
|
-
link: string;
|
|
132
|
-
};
|
|
133
|
-
size: {
|
|
134
|
-
default: string;
|
|
135
|
-
xs: string;
|
|
136
|
-
sm: string;
|
|
137
|
-
lg: string;
|
|
138
|
-
icon: string;
|
|
139
|
-
'icon-xs': string;
|
|
140
|
-
};
|
|
141
|
-
active: {
|
|
142
|
-
true: string;
|
|
143
|
-
};
|
|
144
|
-
}>, unknown, unknown, undefined>>;
|
|
67
|
+
}, undefined, "inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium transition-colors focus-visible:outline-none disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0", unknown, unknown, undefined>>;
|
|
145
68
|
export type ButtonVariant = VariantProps<typeof buttonVariants>['variant'];
|
|
146
69
|
export type ButtonSize = VariantProps<typeof buttonVariants>['size'];
|
|
147
70
|
export type ButtonActive = VariantProps<typeof buttonVariants>['active'];
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
import type { HTMLAttributes } from 'svelte/elements';
|
|
3
|
+
import { cn } from '../../../utils.js';
|
|
4
|
+
|
|
5
|
+
interface Props {
|
|
6
|
+
size: number;
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
let {
|
|
10
|
+
size,
|
|
11
|
+
class: className,
|
|
12
|
+
children,
|
|
13
|
+
...restProps
|
|
14
|
+
}: HTMLAttributes<HTMLDivElement> & Props = $props();
|
|
15
|
+
</script>
|
|
16
|
+
|
|
17
|
+
<div class={cn('alpha-grid h-full w-full', className)} style:--size="{size}px" {...restProps}>
|
|
18
|
+
{@render children?.()}
|
|
19
|
+
</div>
|
|
20
|
+
|
|
21
|
+
<style>
|
|
22
|
+
.alpha-grid {
|
|
23
|
+
background-color: hsl(var(--background));
|
|
24
|
+
background-image: linear-gradient(
|
|
25
|
+
-45deg,
|
|
26
|
+
hsl(var(--foreground)) 25%,
|
|
27
|
+
transparent 25%,
|
|
28
|
+
transparent 75%,
|
|
29
|
+
hsl(var(--foreground)) 75%
|
|
30
|
+
),
|
|
31
|
+
linear-gradient(
|
|
32
|
+
-45deg,
|
|
33
|
+
hsl(var(--foreground)) 25%,
|
|
34
|
+
transparent 25%,
|
|
35
|
+
transparent 75%,
|
|
36
|
+
hsl(var(--foreground)) 75%
|
|
37
|
+
);
|
|
38
|
+
background-position:
|
|
39
|
+
0 0,
|
|
40
|
+
calc(var(--size) / 2) calc(var(--size) / 2);
|
|
41
|
+
background-size: var(--size) var(--size);
|
|
42
|
+
}
|
|
43
|
+
</style>
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { HTMLAttributes } from 'svelte/elements';
|
|
2
|
+
interface Props {
|
|
3
|
+
size: number;
|
|
4
|
+
}
|
|
5
|
+
type $$ComponentProps = HTMLAttributes<HTMLDivElement> & Props;
|
|
6
|
+
declare const ColorPickerAlphaGrid: import("svelte").Component<$$ComponentProps, {}, "">;
|
|
7
|
+
type ColorPickerAlphaGrid = ReturnType<typeof ColorPickerAlphaGrid>;
|
|
8
|
+
export default ColorPickerAlphaGrid;
|