@streamscloud/kit 0.63.0 → 0.65.0
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/core/local-storage/index.d.ts +1 -1
- package/dist/core/local-storage/local-storage-item.d.ts +14 -2
- package/dist/core/local-storage/local-storage-item.js +35 -10
- package/dist/core/utils/color-helper.d.ts +4 -0
- package/dist/core/utils/color-helper.js +10 -0
- package/dist/core/utils/price-helper.d.ts +2 -0
- package/dist/core/utils/price-helper.js +12 -1
- package/dist/ui/cropper/image-editor-dialog/cmp.image-editor-dialog.svelte +17 -51
- package/dist/ui/cropper/image-editor-dialog/crop-and-resize.d.ts +4 -16
- package/dist/ui/cropper/image-editor-dialog/crop-and-resize.js +1 -14
- package/dist/ui/cropper/image-editor-dialog/index.d.ts +8 -7
- package/dist/ui/cropper/image-editor-dialog/index.js +8 -7
- package/dist/ui/cropper/image-editor-dialog/types.d.ts +1 -1
- package/dist/ui/cropper/img-cropper/cmp.img-cropper-toolbar.svelte +149 -181
- package/dist/ui/cropper/img-cropper/cmp.img-cropper-toolbar.svelte.d.ts +4 -13
- package/dist/ui/cropper/img-cropper/cmp.img-cropper.svelte +389 -147
- package/dist/ui/cropper/img-cropper/cmp.img-cropper.svelte.d.ts +13 -39
- package/dist/ui/cropper/img-cropper/frame-geometry.d.ts +82 -0
- package/dist/ui/cropper/img-cropper/frame-geometry.js +165 -0
- package/dist/ui/cropper/img-cropper/img-cropper-localization.d.ts +2 -3
- package/dist/ui/cropper/img-cropper/img-cropper-localization.js +12 -19
- package/dist/ui/cropper/img-cropper/img-cropper-toolbar-localization.d.ts +14 -5
- package/dist/ui/cropper/img-cropper/img-cropper-toolbar-localization.js +127 -33
- package/dist/ui/cropper/img-cropper/img-cropper-utils.d.ts +4 -51
- package/dist/ui/cropper/img-cropper/img-cropper-utils.js +35 -190
- package/dist/ui/cropper/img-cropper/img-cropper.svelte.d.ts +99 -34
- package/dist/ui/cropper/img-cropper/img-cropper.svelte.js +405 -104
- package/dist/ui/cropper/img-cropper/index.d.ts +1 -2
- package/dist/ui/cropper/img-cropper/index.js +0 -1
- package/dist/ui/image/cmp.image.svelte +23 -5
- package/dist/ui/image/cmp.image.svelte.d.ts +1 -1
- package/dist/ui/page-toolbar/cmp.toolbar-segmented-control.svelte +2 -2
- package/dist/ui/page-toolbar/cmp.toolbar-view-controls.svelte +4 -2
- package/dist/ui/table/table-columns-manager/cmp.table-columns-manager.svelte +4 -2
- package/package.json +1 -3
- package/dist/ui/cropper/img-cropper/cmp.img-cropper-controls.svelte +0 -68
- package/dist/ui/cropper/img-cropper/cmp.img-cropper-controls.svelte.d.ts +0 -21
- package/dist/ui/cropper/img-cropper/cropperjs-elements.d.ts +0 -35
- package/dist/ui/cropper/img-cropper/img-cropper-base-worker.svelte.d.ts +0 -40
- package/dist/ui/cropper/img-cropper/img-cropper-base-worker.svelte.js +0 -193
- package/dist/ui/cropper/img-cropper/img-cropper-contain-worker.svelte.d.ts +0 -7
- package/dist/ui/cropper/img-cropper/img-cropper-contain-worker.svelte.js +0 -51
- package/dist/ui/cropper/img-cropper/img-cropper-cover-worker.svelte.d.ts +0 -7
- package/dist/ui/cropper/img-cropper/img-cropper-cover-worker.svelte.js +0 -89
- package/dist/ui/cropper/img-cropper/img-cropper-worker.svelte.d.ts +0 -42
- package/dist/ui/cropper/img-cropper/img-cropper-worker.svelte.js +0 -1
|
@@ -1,86 +1,131 @@
|
|
|
1
|
-
<script lang="ts">import {
|
|
1
|
+
<script lang="ts">import { Button } from '../../button';
|
|
2
|
+
import { ColorPicker } from '../../color-picker';
|
|
3
|
+
import { Divider } from '../../divider';
|
|
2
4
|
import { Icon } from '../../icon';
|
|
3
|
-
import {
|
|
4
|
-
import { Popover } from '../../popover';
|
|
5
|
+
import { ToolbarIconButton } from '../../page-toolbar';
|
|
6
|
+
import { Popover, PopoverItem } from '../../popover';
|
|
7
|
+
import { Tooltip } from '../../tooltip';
|
|
5
8
|
import { ImgCropperToolbarLocalization } from './img-cropper-toolbar-localization';
|
|
6
9
|
import IconArrowMove from '@fluentui/svg-icons/icons/arrow_move_20_regular.svg?raw';
|
|
7
|
-
import
|
|
8
|
-
import
|
|
10
|
+
import IconArrowReset from '@fluentui/svg-icons/icons/arrow_reset_20_regular.svg?raw';
|
|
11
|
+
import IconRotateRight from '@fluentui/svg-icons/icons/arrow_rotate_clockwise_20_regular.svg?raw';
|
|
12
|
+
import IconRotateLeft from '@fluentui/svg-icons/icons/arrow_rotate_counterclockwise_20_regular.svg?raw';
|
|
13
|
+
import IconCheckmark from '@fluentui/svg-icons/icons/checkmark_20_regular.svg?raw';
|
|
9
14
|
import IconCrop from '@fluentui/svg-icons/icons/crop_20_regular.svg?raw';
|
|
10
|
-
import
|
|
15
|
+
import IconGridDots from '@fluentui/svg-icons/icons/grid_dots_20_regular.svg?raw';
|
|
11
16
|
import IconZoomIn from '@fluentui/svg-icons/icons/zoom_in_20_regular.svg?raw';
|
|
12
17
|
import IconZoomOut from '@fluentui/svg-icons/icons/zoom_out_20_regular.svg?raw';
|
|
13
18
|
const { cropper, children } = $props();
|
|
14
19
|
const loc = new ImgCropperToolbarLocalization();
|
|
15
|
-
const
|
|
16
|
-
const
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
});
|
|
20
|
+
const ZOOM_PRESETS = [1.5, 2, 3];
|
|
21
|
+
const ALIGN_FRACTIONS = [0, 0.5, 1];
|
|
22
|
+
const zoomPercent = $derived(Math.round(cropper.zoom * 100));
|
|
23
|
+
const ratioLabel = $derived(cropper.ratioLabel ?? loc.original);
|
|
20
24
|
</script>
|
|
21
25
|
|
|
22
|
-
|
|
23
|
-
<
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
<button
|
|
31
|
-
type="button"
|
|
32
|
-
class="img-cropper-toolbar__button"
|
|
33
|
-
class:img-cropper-toolbar__button--active={cropper.dragMode === 'crop'}
|
|
34
|
-
onclick={() => cropper.enableCropMode()}>
|
|
35
|
-
<IconText icon={IconCrop}>{loc.crop}</IconText>
|
|
36
|
-
</button>
|
|
37
|
-
<button type="button" class="img-cropper-toolbar__button" onclick={() => cropper.zoomIn()}>
|
|
38
|
-
<IconText icon={IconZoomIn}>{loc.zoomIn}</IconText>
|
|
39
|
-
</button>
|
|
40
|
-
<button type="button" class="img-cropper-toolbar__button" onclick={() => cropper.zoomOut()}>
|
|
41
|
-
<IconText icon={IconZoomOut}>{loc.zoomOut}</IconText>
|
|
42
|
-
</button>
|
|
43
|
-
<button type="button" class="img-cropper-toolbar__button" onclick={() => cropper.rotate()}>
|
|
44
|
-
<IconText icon={IconArrowRotateClockwise}>{loc.rotate}</IconText>
|
|
45
|
-
</button>
|
|
46
|
-
<button type="button" class="img-cropper-toolbar__button img-cropper-toolbar__button--reset" onclick={() => cropper.reset()}>
|
|
47
|
-
<IconText icon={IconReset}>{loc.reset}</IconText>
|
|
48
|
-
</button>
|
|
26
|
+
{#snippet modeLabel(label: string, active: boolean)}
|
|
27
|
+
<span class="img-cropper-toolbar__mode">
|
|
28
|
+
{label}
|
|
29
|
+
{#if active}
|
|
30
|
+
<Icon src={IconCheckmark} />
|
|
31
|
+
{/if}
|
|
32
|
+
</span>
|
|
33
|
+
{/snippet}
|
|
49
34
|
|
|
35
|
+
<div
|
|
36
|
+
class="img-cropper-toolbar"
|
|
37
|
+
role="toolbar"
|
|
38
|
+
aria-label={loc.toolbar}
|
|
39
|
+
tabindex="-1"
|
|
40
|
+
onpointerdown={(event) => event.stopPropagation()}
|
|
41
|
+
onwheel={(event) => event.stopPropagation()}>
|
|
50
42
|
{#if cropper.ratioOptions}
|
|
51
|
-
<
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
{/each}
|
|
63
|
-
</div>
|
|
64
|
-
</Popover>
|
|
65
|
-
</div>
|
|
43
|
+
<Popover position="top-start" aria-label={loc.ratio} --sc-kit--popover--content--min-width="7.5rem">
|
|
44
|
+
{#snippet trigger()}
|
|
45
|
+
<span class="img-cropper-toolbar__ratio-trigger">
|
|
46
|
+
<Button type="presentational" size="sm" variant="ghost">{ratioLabel}</Button>
|
|
47
|
+
</span>
|
|
48
|
+
{/snippet}
|
|
49
|
+
{#each cropper.ratioOptions as option (String(option.value))}
|
|
50
|
+
<PopoverItem on={{ click: () => cropper.changeAspectRatio(option.value) }}>{option.value === null ? loc.original : option.label}</PopoverItem>
|
|
51
|
+
{/each}
|
|
52
|
+
</Popover>
|
|
53
|
+
<Divider orientation="vertical" />
|
|
66
54
|
{/if}
|
|
67
55
|
|
|
68
|
-
{
|
|
69
|
-
<
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
56
|
+
<Tooltip text={loc.zoomOut}>
|
|
57
|
+
<ToolbarIconButton
|
|
58
|
+
icon={IconZoomOut}
|
|
59
|
+
aria-label={loc.zoomOut}
|
|
60
|
+
disabled={!cropper.ready || cropper.zoom <= cropper.minZoom + 0.001}
|
|
61
|
+
on={{ click: cropper.zoomOut }} />
|
|
62
|
+
</Tooltip>
|
|
63
|
+
<Popover position="top" aria-label={loc.zoom}>
|
|
64
|
+
{#snippet trigger()}
|
|
65
|
+
<span class="img-cropper-toolbar__zoom-trigger">
|
|
66
|
+
<Button type="presentational" size="sm" variant="ghost">{zoomPercent}%</Button>
|
|
67
|
+
</span>
|
|
68
|
+
{/snippet}
|
|
69
|
+
<PopoverItem on={{ click: cropper.fill }}>{@render modeLabel(loc.fillFrame, cropper.restingMode === 'cover')}</PopoverItem>
|
|
70
|
+
<PopoverItem divider on={{ click: cropper.fit }}>{@render modeLabel(loc.fitFrame, cropper.restingMode === 'contain')}</PopoverItem>
|
|
71
|
+
{#each ZOOM_PRESETS as preset (preset)}
|
|
72
|
+
<PopoverItem on={{ click: () => cropper.setZoom(preset) }}>{Math.round(preset * 100)}%</PopoverItem>
|
|
73
|
+
{/each}
|
|
74
|
+
</Popover>
|
|
75
|
+
<Tooltip text={loc.zoomIn}>
|
|
76
|
+
<ToolbarIconButton icon={IconZoomIn} aria-label={loc.zoomIn} disabled={!cropper.ready || cropper.zoom >= cropper.maxZoom} on={{ click: cropper.zoomIn }} />
|
|
77
|
+
</Tooltip>
|
|
78
|
+
|
|
79
|
+
<Divider orientation="vertical" />
|
|
80
|
+
|
|
81
|
+
<Tooltip text={loc.freePosition}>
|
|
82
|
+
<ToolbarIconButton icon={IconArrowMove} aria-label={loc.freePosition} active={cropper.free} disabled={!cropper.ready} on={{ click: cropper.toggleFree }} />
|
|
83
|
+
</Tooltip>
|
|
84
|
+
<Tooltip text={loc.cropMode}>
|
|
85
|
+
<ToolbarIconButton
|
|
86
|
+
icon={IconCrop}
|
|
87
|
+
aria-label={loc.cropMode}
|
|
88
|
+
active={cropper.cropMode}
|
|
89
|
+
disabled={!cropper.ready}
|
|
90
|
+
on={{ click: () => cropper.setCropMode(!cropper.cropMode) }} />
|
|
91
|
+
</Tooltip>
|
|
92
|
+
{#if cropper.hasSelection}
|
|
93
|
+
<Tooltip text={loc.applyCrop}>
|
|
94
|
+
<ToolbarIconButton
|
|
95
|
+
icon={IconCheckmark}
|
|
96
|
+
aria-label={loc.applyCrop}
|
|
97
|
+
on={{ click: cropper.applyCrop }}
|
|
98
|
+
--sc-kit--toolbar-icon-button--color="var(--sc-kit--color--accent)" />
|
|
99
|
+
</Tooltip>
|
|
100
|
+
{/if}
|
|
101
|
+
<Popover position="top" aria-label={loc.align} --sc-kit--popover--content--min-width="0">
|
|
102
|
+
{#snippet trigger()}
|
|
103
|
+
<ToolbarIconButton icon={IconGridDots} presentational />
|
|
104
|
+
{/snippet}
|
|
105
|
+
<div class="img-cropper-toolbar__align" role="group" aria-label={loc.align}>
|
|
106
|
+
{#each ALIGN_FRACTIONS as fy (fy)}
|
|
107
|
+
{#each ALIGN_FRACTIONS as fx (fx)}
|
|
108
|
+
<button type="button" class="img-cropper-toolbar__align-dot" aria-label={loc.alignPosition(fx, fy)} onclick={() => cropper.align(fx, fy)}></button>
|
|
109
|
+
{/each}
|
|
110
|
+
{/each}
|
|
83
111
|
</div>
|
|
112
|
+
</Popover>
|
|
113
|
+
<Tooltip text={loc.rotateLeft}>
|
|
114
|
+
<ToolbarIconButton icon={IconRotateLeft} aria-label={loc.rotateLeft} disabled={!cropper.ready} on={{ click: () => cropper.rotate(-1) }} />
|
|
115
|
+
</Tooltip>
|
|
116
|
+
<Tooltip text={loc.rotateRight}>
|
|
117
|
+
<ToolbarIconButton icon={IconRotateRight} aria-label={loc.rotateRight} disabled={!cropper.ready} on={{ click: () => cropper.rotate(1) }} />
|
|
118
|
+
</Tooltip>
|
|
119
|
+
|
|
120
|
+
<Divider orientation="vertical" />
|
|
121
|
+
|
|
122
|
+
<Tooltip text={loc.reset}>
|
|
123
|
+
<ToolbarIconButton icon={IconArrowReset} aria-label={loc.reset} disabled={!cropper.ready} on={{ click: cropper.reset }} />
|
|
124
|
+
</Tooltip>
|
|
125
|
+
|
|
126
|
+
{#if cropper.showFillColor}
|
|
127
|
+
<Divider orientation="vertical" />
|
|
128
|
+
<ColorPicker value={cropper.fillColor} label={loc.fill} variant="field" size="sm" clearable on={{ change: (value) => (cropper.fillColor = value) }} />
|
|
84
129
|
{/if}
|
|
85
130
|
|
|
86
131
|
{#if children}
|
|
@@ -90,136 +135,59 @@ const selectedRatioLabel = $derived.by(() => {
|
|
|
90
135
|
|
|
91
136
|
<!--
|
|
92
137
|
@component
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
### Props
|
|
98
|
-
| Prop | Type | Default | Description |
|
|
99
|
-
|---|---|---|---|
|
|
100
|
-
| `cropper` | `ImgCropper` | — | Cropper controller instance |
|
|
101
|
-
| `children` | `Snippet` | — | Extra controls rendered at the end |
|
|
138
|
+
Floating toolbar for `ImgCropperView` — aspect ratio, zoom, free position, alignment, rotate, reset, and the frame's
|
|
139
|
+
fill color (in `contain` mode, whenever free position is on, or when the picture has its own transparency). Pass it
|
|
140
|
+
to `ImgCropperView`'s `toolbar` snippet prop.
|
|
102
141
|
|
|
103
142
|
### CSS Custom Properties
|
|
104
143
|
| Property | Description | Default |
|
|
105
144
|
|---|---|---|
|
|
106
|
-
| `--sc-kit--img-cropper-toolbar--
|
|
107
|
-
| `--sc-kit--img-cropper-toolbar--background` | Button background | `light-dark(white, dark-700)` |
|
|
108
|
-
| `--sc-kit--img-cropper-toolbar--border-color` | Button border color | `light-dark(neutral-200, dark-600)` |
|
|
109
|
-
| `--sc-kit--img-cropper-toolbar--active-color` | Active button accent color | `light-dark(primary-500, primary-400)` |
|
|
145
|
+
| `--sc-kit--img-cropper-toolbar--background` | Panel background | `var(--sc-kit--color--bg--panel)` |
|
|
110
146
|
-->
|
|
111
147
|
|
|
112
148
|
<style>.img-cropper-toolbar {
|
|
113
|
-
--_img-cropper-toolbar--color: var(--sc-kit--img-cropper-toolbar--color, var(--sc-kit--color--text--primary));
|
|
114
149
|
--_img-cropper-toolbar--background: var(--sc-kit--img-cropper-toolbar--background, var(--sc-kit--color--bg--panel));
|
|
115
|
-
--
|
|
116
|
-
--
|
|
117
|
-
container-type: inline-size;
|
|
150
|
+
--sc-kit--divider--gap: 0;
|
|
151
|
+
--sc-kit--color-picker--width: 8.75rem;
|
|
118
152
|
display: flex;
|
|
119
153
|
align-items: center;
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
--sc-kit--
|
|
123
|
-
|
|
124
|
-
.img-cropper-toolbar__button {
|
|
125
|
-
font-size: 0.75rem;
|
|
126
|
-
border-radius: 0.25rem;
|
|
127
|
-
white-space: nowrap;
|
|
128
|
-
border: 1px solid var(--_img-cropper-toolbar--border-color);
|
|
129
|
-
color: var(--_img-cropper-toolbar--color);
|
|
154
|
+
gap: var(--sc-kit--space--1);
|
|
155
|
+
padding: var(--sc-kit--space--1);
|
|
156
|
+
border: 1px solid var(--sc-kit--color--border);
|
|
157
|
+
border-radius: var(--sc-kit--radius--lg);
|
|
130
158
|
background: var(--_img-cropper-toolbar--background);
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
justify-content: center;
|
|
135
|
-
cursor: pointer;
|
|
136
|
-
transition: background-color linear 0.2s, color linear 0.2s, border-color linear 0.2s;
|
|
137
|
-
}
|
|
138
|
-
.img-cropper-toolbar__button:hover, .img-cropper-toolbar__button--active {
|
|
139
|
-
color: var(--_img-cropper-toolbar--active-color);
|
|
140
|
-
border-color: var(--_img-cropper-toolbar--active-color);
|
|
141
|
-
}
|
|
142
|
-
.img-cropper-toolbar__button--reset {
|
|
143
|
-
margin-left: 0.5rem;
|
|
144
|
-
}
|
|
145
|
-
.img-cropper-toolbar__button {
|
|
146
|
-
/* Set 'container-type: inline-size;' to reference container*/
|
|
147
|
-
}
|
|
148
|
-
@container (width < 53.125rem) {
|
|
149
|
-
.img-cropper-toolbar__button {
|
|
150
|
-
min-width: auto;
|
|
151
|
-
padding: 0.25rem;
|
|
152
|
-
--sc-kit--icon-text--text--display: none;
|
|
153
|
-
}
|
|
154
|
-
}
|
|
155
|
-
.img-cropper-toolbar__label {
|
|
156
|
-
font-size: 0.625rem;
|
|
157
|
-
white-space: nowrap;
|
|
158
|
-
margin-right: 0.5rem;
|
|
159
|
-
}
|
|
160
|
-
.img-cropper-toolbar__ratio {
|
|
161
|
-
display: flex;
|
|
162
|
-
align-items: center;
|
|
163
|
-
margin-left: 1rem;
|
|
159
|
+
box-shadow: var(--sc-kit--shadow--lg);
|
|
160
|
+
cursor: default;
|
|
161
|
+
z-index: 1;
|
|
164
162
|
}
|
|
165
163
|
.img-cropper-toolbar__ratio-trigger {
|
|
166
|
-
|
|
167
|
-
border-radius: 0.125rem;
|
|
168
|
-
border: 1px solid var(--_img-cropper-toolbar--border-color);
|
|
169
|
-
cursor: pointer;
|
|
170
|
-
font-size: 0.75rem;
|
|
171
|
-
white-space: nowrap;
|
|
172
|
-
}
|
|
173
|
-
.img-cropper-toolbar__ratio-menu {
|
|
174
|
-
background: var(--_img-cropper-toolbar--background);
|
|
175
|
-
border: 1px solid var(--_img-cropper-toolbar--border-color);
|
|
176
|
-
border-radius: 0.25rem;
|
|
177
|
-
box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
|
|
178
|
-
padding: 0.25rem 0;
|
|
179
|
-
}
|
|
180
|
-
.img-cropper-toolbar__ratio-item {
|
|
181
|
-
display: block;
|
|
182
|
-
width: 100%;
|
|
183
|
-
padding: 0.375rem 0.75rem;
|
|
184
|
-
border: none;
|
|
185
|
-
background: none;
|
|
186
|
-
text-align: left;
|
|
187
|
-
cursor: pointer;
|
|
188
|
-
font-size: 0.75rem;
|
|
189
|
-
color: var(--_img-cropper-toolbar--color);
|
|
164
|
+
--sc-kit--button--width: 5.25rem;
|
|
190
165
|
}
|
|
191
|
-
.img-cropper-
|
|
192
|
-
|
|
166
|
+
.img-cropper-toolbar__zoom-trigger {
|
|
167
|
+
--sc-kit--button--width: 4.25rem;
|
|
193
168
|
}
|
|
194
|
-
.img-cropper-
|
|
169
|
+
.img-cropper-toolbar__mode {
|
|
195
170
|
display: flex;
|
|
196
171
|
align-items: center;
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
}
|
|
200
|
-
.img-cropper-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
background-size: 8px 8px;
|
|
210
|
-
background-position: 0 0, 0 4px, 4px -4px, -4px 0;
|
|
211
|
-
}
|
|
212
|
-
.img-cropper-toolbar__fill-reset {
|
|
213
|
-
display: flex;
|
|
214
|
-
align-items: center;
|
|
215
|
-
justify-content: center;
|
|
216
|
-
cursor: pointer;
|
|
217
|
-
color: var(--_img-cropper-toolbar--color);
|
|
218
|
-
background: none;
|
|
219
|
-
border: none;
|
|
172
|
+
justify-content: space-between;
|
|
173
|
+
gap: var(--sc-kit--space--2);
|
|
174
|
+
}
|
|
175
|
+
.img-cropper-toolbar__align {
|
|
176
|
+
display: grid;
|
|
177
|
+
grid-template-columns: repeat(3, 1.5rem);
|
|
178
|
+
gap: 0.25rem;
|
|
179
|
+
padding: var(--sc-kit--space--2);
|
|
180
|
+
}
|
|
181
|
+
.img-cropper-toolbar__align-dot {
|
|
182
|
+
inline-size: 1.5rem;
|
|
183
|
+
block-size: 1.5rem;
|
|
220
184
|
padding: 0;
|
|
221
|
-
--sc-kit--
|
|
185
|
+
border: 1px solid var(--sc-kit--color--border--strong);
|
|
186
|
+
border-radius: var(--sc-kit--radius--sm);
|
|
187
|
+
background: var(--sc-kit--color--bg--field);
|
|
188
|
+
cursor: pointer;
|
|
222
189
|
}
|
|
223
|
-
.img-cropper-
|
|
224
|
-
color: var(--
|
|
190
|
+
.img-cropper-toolbar__align-dot:hover {
|
|
191
|
+
border-color: var(--sc-kit--color--accent);
|
|
192
|
+
background: var(--sc-kit--color--accent--softer);
|
|
225
193
|
}</style>
|
|
@@ -5,23 +5,14 @@ type Props = {
|
|
|
5
5
|
children?: Snippet;
|
|
6
6
|
};
|
|
7
7
|
/**
|
|
8
|
-
*
|
|
9
|
-
*
|
|
10
|
-
*
|
|
11
|
-
*
|
|
12
|
-
* ### Props
|
|
13
|
-
* | Prop | Type | Default | Description |
|
|
14
|
-
* |---|---|---|---|
|
|
15
|
-
* | `cropper` | `ImgCropper` | — | Cropper controller instance |
|
|
16
|
-
* | `children` | `Snippet` | — | Extra controls rendered at the end |
|
|
8
|
+
* Floating toolbar for `ImgCropperView` — aspect ratio, zoom, free position, alignment, rotate, reset, and the frame's
|
|
9
|
+
* fill color (in `contain` mode, whenever free position is on, or when the picture has its own transparency). Pass it
|
|
10
|
+
* to `ImgCropperView`'s `toolbar` snippet prop.
|
|
17
11
|
*
|
|
18
12
|
* ### CSS Custom Properties
|
|
19
13
|
* | Property | Description | Default |
|
|
20
14
|
* |---|---|---|
|
|
21
|
-
* | `--sc-kit--img-cropper-toolbar--
|
|
22
|
-
* | `--sc-kit--img-cropper-toolbar--background` | Button background | `light-dark(white, dark-700)` |
|
|
23
|
-
* | `--sc-kit--img-cropper-toolbar--border-color` | Button border color | `light-dark(neutral-200, dark-600)` |
|
|
24
|
-
* | `--sc-kit--img-cropper-toolbar--active-color` | Active button accent color | `light-dark(primary-500, primary-400)` |
|
|
15
|
+
* | `--sc-kit--img-cropper-toolbar--background` | Panel background | `var(--sc-kit--color--bg--panel)` |
|
|
25
16
|
*/
|
|
26
17
|
declare const Cmp: import("svelte").Component<Props, {}, "">;
|
|
27
18
|
type Cmp = ReturnType<typeof Cmp>;
|