Skip to content

Commit 0b10898

Browse files
committed
docs: address image review feedback
1 parent c72f049 commit 0b10898

3 files changed

Lines changed: 45 additions & 3 deletions

File tree

.github/workflows/cloudflare-pages-preview.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,10 @@ name: Cloudflare Pages Preview
33
on:
44
pull_request:
55

6+
concurrency:
7+
group: ${{ github.workflow }}-${{ github.event.pull_request.number }}
8+
cancel-in-progress: true
9+
610
permissions:
711
contents: read
812
deployments: write

.github/workflows/surge-preview.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,10 @@ name: Surge Preview
33
on:
44
pull_request:
55

6+
concurrency:
7+
group: ${{ github.workflow }}-${{ github.event.pull_request.number }}
8+
cancel-in-progress: true
9+
610
permissions:
711
contents: read
812
pull-requests: write

README.md

Lines changed: 37 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -96,8 +96,9 @@ Native image attributes are also supported.
9696

9797
| Property | Description | Type | Default |
9898
| --- | --- | --- | --- |
99-
| actionsRender | Custom toolbar renderer | `(node: React.ReactElement, info: ToolbarRenderInfoType) => React.ReactNode` | - |
99+
| actionsRender | Custom toolbar renderer | `(node: React.ReactElement, info: Omit<ToolbarRenderInfoType, 'current' \| 'total'>) => React.ReactNode` | - |
100100
| closeIcon | Custom close icon | `React.ReactNode` | - |
101+
| cover | Custom preview cover | `React.ReactNode \| CoverConfig` | - |
101102
| countRender | Custom count renderer | `(current: number, total: number) => React.ReactNode` | - |
102103
| forceRender | Force render preview | boolean | false |
103104
| getContainer | Preview container | string \| HTMLElement \| `() => HTMLElement` \| false | `document.body` |
@@ -109,18 +110,21 @@ Native image attributes are also supported.
109110
| open | Controlled preview open state | boolean | - |
110111
| scaleStep | Scale step | number | 0.5 |
111112
| src | Custom preview image source | string | - |
112-
| onOpenChange | Callback when preview open state changes | `(open: boolean, prevOpen: boolean) => void` | - |
113+
| onOpenChange | Callback when preview open state changes | `(open: boolean) => void` | - |
113114
| onTransform | Callback when transform changes | `(info: { transform: TransformType; action: TransformAction }) => void` | - |
114115

115116
### Image.PreviewGroup
116117

117118
| Property | Description | Type | Default |
118119
| --- | --- | --- | --- |
120+
| children | Image children | `React.ReactNode` | - |
121+
| classNames | Semantic preview popup class names | `{ popup?: Partial<Record<PreviewSemanticName, string>> }` | - |
119122
| fallback | Image source used when loading fails | string | - |
120-
| icons | Custom preview operation icons | `OperationIcons` | - |
123+
| icons | Custom preview operation icons | `PreviewProps['icons']` | - |
121124
| items | Preview items | `(string \| ImageElementProps)[]` | - |
122125
| preview | Whether and how to show preview group | boolean \| `GroupPreviewConfig` | true |
123126
| previewPrefixCls | Preview class name prefix | string | `rc-image-preview` |
127+
| styles | Semantic preview popup styles | `{ popup?: Partial<Record<PreviewSemanticName, React.CSSProperties>> }` | - |
124128

125129
### TransformType
126130

@@ -148,6 +152,36 @@ type TransformAction =
148152
| 'doubleClick'
149153
| 'move'
150154
| 'dragRebound';
155+
156+
type Actions = {
157+
onActive: (offset: number) => void;
158+
onFlipY: () => void;
159+
onFlipX: () => void;
160+
onRotateLeft: () => void;
161+
onRotateRight: () => void;
162+
onZoomOut: () => void;
163+
onZoomIn: () => void;
164+
onClose: () => void;
165+
onReset: () => void;
166+
};
167+
168+
type ToolbarRenderInfoType = {
169+
icons: {
170+
prevIcon?: React.ReactNode;
171+
nextIcon?: React.ReactNode;
172+
flipYIcon: React.ReactNode;
173+
flipXIcon: React.ReactNode;
174+
rotateLeftIcon: React.ReactNode;
175+
rotateRightIcon: React.ReactNode;
176+
zoomOutIcon: React.ReactNode;
177+
zoomInIcon: React.ReactNode;
178+
};
179+
actions: Actions;
180+
transform: TransformType;
181+
current: number;
182+
total: number;
183+
image: ImgInfo;
184+
};
151185
```
152186

153187
## Development

0 commit comments

Comments
 (0)