@haklex/rich-renderer-image 0.0.65 → 0.0.67
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 +35 -49
- package/dist/EditMetaPopover.d.ts.map +1 -1
- package/dist/ImageEditContext.d.ts +1 -1
- package/dist/ImageEditContext.d.ts.map +1 -1
- package/dist/ImageEditRenderer.d.ts +1 -1
- package/dist/ImageEditRenderer.d.ts.map +1 -1
- package/dist/ImageEditToolbar.d.ts.map +1 -1
- package/dist/{ImageRenderer-BzOAp28v.js → ImageRenderer-gflWZhku.js} +35 -60
- package/dist/ImageRenderer.d.ts +1 -1
- package/dist/ImageRenderer.d.ts.map +1 -1
- package/dist/ReplacePanel.d.ts.map +1 -1
- package/dist/atoms.d.ts +3 -0
- package/dist/atoms.d.ts.map +1 -1
- package/dist/index.mjs +161 -229
- package/dist/rich-renderer-image.css +1 -1
- package/dist/static.mjs +1 -1
- package/dist/styles.css.d.ts +0 -6
- package/dist/styles.css.d.ts.map +1 -1
- package/dist/useImageActions.d.ts.map +1 -1
- package/package.json +16 -11
package/README.md
CHANGED
|
@@ -1,77 +1,63 @@
|
|
|
1
1
|
# @haklex/rich-renderer-image
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
Image renderer with blurhash placeholder support and lightbox zoom for full-size viewing.
|
|
4
4
|
|
|
5
|
-
##
|
|
5
|
+
## Installation
|
|
6
6
|
|
|
7
7
|
```bash
|
|
8
|
-
pnpm add @haklex/rich-renderer-image
|
|
8
|
+
pnpm add @haklex/rich-renderer-image
|
|
9
9
|
```
|
|
10
10
|
|
|
11
|
-
##
|
|
11
|
+
## Peer Dependencies
|
|
12
12
|
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
- Thumbhash 模糊占位 + 渐显加载动画
|
|
21
|
-
- 图片灯箱(react-photo-view)
|
|
22
|
-
- 图片说明(caption)
|
|
23
|
-
- 加载 / 错误状态
|
|
24
|
-
- 编辑模式:替换、元信息编辑、复制、删除、下载
|
|
25
|
-
|
|
26
|
-
## 架构
|
|
27
|
-
|
|
28
|
-
```
|
|
29
|
-
ImageRenderer — 静态渲染(灯箱 + thumbhash)
|
|
30
|
-
ImageEditRenderer — 编辑模式入口,mode !== 'editor' 时回退到 ImageRenderer
|
|
31
|
-
├── ImageEditContext — Jotai Provider,管理编辑状态 atoms
|
|
32
|
-
├── ImageEditToolbar — 悬浮工具栏(元信息 / 替换 / 打开 / 复制 / 下载 / 删除)
|
|
33
|
-
├── EditMetaPopover — 编辑 src / alt / caption
|
|
34
|
-
├── ReplacePopover — 替换图片(上传 / URL)
|
|
35
|
-
├── ReplacePanel — Upload / URL 切换面板
|
|
36
|
-
├── useImageActions — 所有编辑操作 hooks
|
|
37
|
-
└── atoms — Jotai atoms(src, loadState, hovering, replace 状态等)
|
|
38
|
-
```
|
|
13
|
+
| Package | Version |
|
|
14
|
+
| --- | --- |
|
|
15
|
+
| `lexical` | `^0.41.0` |
|
|
16
|
+
| `@lexical/react` | `^0.41.0` |
|
|
17
|
+
| `react` | `>=19` |
|
|
18
|
+
| `react-dom` | `>=19` |
|
|
39
19
|
|
|
40
|
-
##
|
|
20
|
+
## Usage
|
|
41
21
|
|
|
42
22
|
```tsx
|
|
43
|
-
import { ImageRenderer } from '@haklex/rich-renderer-image'
|
|
44
|
-
import type { RendererConfig } from '@haklex/rich-editor'
|
|
23
|
+
import { ImageRenderer } from '@haklex/rich-renderer-image/static'
|
|
45
24
|
|
|
46
|
-
//
|
|
47
|
-
const
|
|
25
|
+
// Register in a static RendererConfig
|
|
26
|
+
const rendererConfig = {
|
|
27
|
+
// ...other renderers
|
|
48
28
|
Image: ImageRenderer,
|
|
49
29
|
}
|
|
30
|
+
```
|
|
31
|
+
|
|
32
|
+
For edit mode:
|
|
50
33
|
|
|
51
|
-
|
|
34
|
+
```tsx
|
|
52
35
|
import { ImageEditRenderer } from '@haklex/rich-renderer-image'
|
|
53
36
|
|
|
54
|
-
const
|
|
37
|
+
const editRendererConfig = {
|
|
38
|
+
// ...other renderers
|
|
55
39
|
Image: ImageEditRenderer,
|
|
56
40
|
}
|
|
57
41
|
```
|
|
58
42
|
|
|
59
|
-
##
|
|
43
|
+
## Exports
|
|
44
|
+
|
|
45
|
+
### Components
|
|
46
|
+
|
|
47
|
+
- `ImageRenderer` — Static (read-only) renderer with blurhash placeholder and lightbox zoom
|
|
48
|
+
- `ImageEditRenderer` — Edit (interactive) renderer with image controls
|
|
60
49
|
|
|
61
|
-
|
|
50
|
+
### Sub-path Exports
|
|
62
51
|
|
|
63
|
-
|
|
52
|
+
| Path | Description |
|
|
53
|
+
| --- | --- |
|
|
54
|
+
| `@haklex/rich-renderer-image` | Full exports (edit + static) |
|
|
55
|
+
| `@haklex/rich-renderer-image/static` | Static-only renderer |
|
|
56
|
+
| `@haklex/rich-renderer-image/style.css` | Stylesheet |
|
|
64
57
|
|
|
65
|
-
##
|
|
58
|
+
## Part of Haklex
|
|
66
59
|
|
|
67
|
-
|
|
68
|
-
|---|------|
|
|
69
|
-
| `@haklex/rich-editor` | 核心类型、节点操作、上传上下文 |
|
|
70
|
-
| `@haklex/rich-editor-ui` | Popover、SegmentedControl |
|
|
71
|
-
| `jotai` | 编辑状态管理 |
|
|
72
|
-
| `lucide-react` | 工具栏图标 |
|
|
73
|
-
| `react-photo-view` | 灯箱 |
|
|
74
|
-
| `thumbhash` | 模糊占位图解码 |
|
|
60
|
+
This package is part of the [Haklex](../../README.md) rich editor ecosystem.
|
|
75
61
|
|
|
76
62
|
## License
|
|
77
63
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"EditMetaPopover.d.ts","sourceRoot":"","sources":["../src/EditMetaPopover.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"EditMetaPopover.d.ts","sourceRoot":"","sources":["../src/EditMetaPopover.tsx"],"names":[],"mappings":"AAeA,wBAAgB,eAAe,4CAwE9B"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ImageEditContext.d.ts","sourceRoot":"","sources":["../src/ImageEditContext.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"ImageEditContext.d.ts","sourceRoot":"","sources":["../src/ImageEditContext.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,+BAA+B,CAAC;AAExE,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAoBvC,wBAAgB,iBAAiB,CAAC,EAChC,KAAK,EACL,QAAQ,GACT,EAAE;IACD,KAAK,EAAE,kBAAkB,CAAC;IAC1B,QAAQ,EAAE,SAAS,CAAC;CACrB,2CAsDA"}
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import { ImageRendererProps } from '@haklex/rich-editor';
|
|
1
|
+
import { ImageRendererProps } from '@haklex/rich-editor/renderers';
|
|
2
2
|
export declare function ImageEditRenderer(props: ImageRendererProps): import("react/jsx-runtime").JSX.Element;
|
|
3
3
|
//# sourceMappingURL=ImageEditRenderer.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ImageEditRenderer.d.ts","sourceRoot":"","sources":["../src/ImageEditRenderer.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"ImageEditRenderer.d.ts","sourceRoot":"","sources":["../src/ImageEditRenderer.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,+BAA+B,CAAC;AA+BxE,wBAAgB,iBAAiB,CAAC,KAAK,EAAE,kBAAkB,2CAQ1D"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ImageEditToolbar.d.ts","sourceRoot":"","sources":["../src/ImageEditToolbar.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"ImageEditToolbar.d.ts","sourceRoot":"","sources":["../src/ImageEditToolbar.tsx"],"names":[],"mappings":"AAUA,wBAAgB,gBAAgB,4CAqG/B"}
|
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
import { jsxs, jsx } from "react/jsx-runtime";
|
|
2
2
|
import "react-photo-view/dist/react-photo-view.css";
|
|
3
|
-
import {
|
|
3
|
+
import { vars } from "@haklex/rich-editor";
|
|
4
|
+
import { decodeThumbHash } from "@haklex/rich-editor/renderers";
|
|
4
5
|
import { useState, useMemo } from "react";
|
|
5
6
|
import { PhotoProvider, PhotoView } from "react-photo-view";
|
|
6
|
-
var semanticClassNames = { root: "rr-image-root", frame: "rr-image-frame", frameLoading: "rr-image-loading", frameLoaded: "rr-image-loaded", frameError: "rr-image-error", image: "rr-image-img", loader: "rr-image-loader", errorBadge: "rr-image-error", caption: "rr-image-caption", editTrigger: "rr-image-edit-trigger", editPlaceholder: "rr-image-edit-placeholder", editToolbar: "rr-image-edit-toolbar", editToolbarVisible: "rr-image-edit-toolbar-visible", editToolbarButton: "rr-image-edit-toolbar-button", editToolbarButtonDanger: "rr-image-edit-toolbar-danger", editField: "rr-image-edit-field", editFieldIcon: "rr-image-edit-field-icon", editInput: "rr-image-edit-input",
|
|
7
|
+
var semanticClassNames = { root: "rr-image-root", frame: "rr-image-frame", frameLoading: "rr-image-loading", frameLoaded: "rr-image-loaded", frameError: "rr-image-error", image: "rr-image-img", loader: "rr-image-loader", errorBadge: "rr-image-error", caption: "rr-image-caption", editTrigger: "rr-image-edit-trigger", editPlaceholder: "rr-image-edit-placeholder", editToolbar: "rr-image-edit-toolbar", editToolbarVisible: "rr-image-edit-toolbar-visible", editToolbarButton: "rr-image-edit-toolbar-button", editToolbarButtonDanger: "rr-image-edit-toolbar-danger", editField: "rr-image-edit-field", editFieldIcon: "rr-image-edit-field-icon", editInput: "rr-image-edit-input", replaceUploadArea: "rr-image-replace-upload-area", replacePreview: "rr-image-replace-preview", panelHint: "rr-image-panel-hint" };
|
|
7
8
|
var root = "_1n94osf0";
|
|
8
9
|
var image = "_1n94osf2";
|
|
9
10
|
var imageState = { loading: "_1n94osf3", loaded: "_1n94osf4", error: "_1n94osf5" };
|
|
@@ -23,12 +24,9 @@ var editPanel = "_1n94osfq";
|
|
|
23
24
|
var editField = "_1n94osfr";
|
|
24
25
|
var editFieldIcon = "_1n94osfs";
|
|
25
26
|
var editInput = "_1n94osft";
|
|
26
|
-
var
|
|
27
|
-
var
|
|
28
|
-
var
|
|
29
|
-
var replaceUploadArea = "_1n94osfx";
|
|
30
|
-
var replacePreview = "_1n94osfy";
|
|
31
|
-
var panelHint = "_1n94osfz";
|
|
27
|
+
var replaceUploadArea = "_1n94osfu";
|
|
28
|
+
var replacePreview = "_1n94osfv";
|
|
29
|
+
var panelHint = "_1n94osfw";
|
|
32
30
|
const frameStateSemanticClass = {
|
|
33
31
|
loading: semanticClassNames.frameLoading,
|
|
34
32
|
loaded: semanticClassNames.frameLoaded,
|
|
@@ -52,10 +50,7 @@ const ImageRenderer = ({
|
|
|
52
50
|
accent
|
|
53
51
|
}) => {
|
|
54
52
|
const [state, setState] = useState("loading");
|
|
55
|
-
const captionText = useMemo(
|
|
56
|
-
() => getCaptionText(altText, caption$1),
|
|
57
|
-
[altText, caption$1]
|
|
58
|
-
);
|
|
53
|
+
const captionText = useMemo(() => getCaptionText(altText, caption$1), [altText, caption$1]);
|
|
59
54
|
const placeholderUrl = useMemo(
|
|
60
55
|
() => thumbhash ? decodeThumbHash(thumbhash) : void 0,
|
|
61
56
|
[thumbhash]
|
|
@@ -73,11 +68,11 @@ const ImageRenderer = ({
|
|
|
73
68
|
/* @__PURE__ */ jsx(PhotoProvider, { photoClosable: true, children: /* @__PURE__ */ jsx(PhotoView, { src, children: /* @__PURE__ */ jsxs(
|
|
74
69
|
"div",
|
|
75
70
|
{
|
|
71
|
+
"aria-label": `Open image: ${altText || "image"}`,
|
|
76
72
|
className: `${frame} ${semanticClassNames.frame} ${imageState[state]} ${frameStateSemanticClass[state]}`.trim(),
|
|
77
|
-
style: frameStyle,
|
|
78
73
|
role: "button",
|
|
74
|
+
style: frameStyle,
|
|
79
75
|
tabIndex: 0,
|
|
80
|
-
"aria-label": `Open image: ${altText || "image"}`,
|
|
81
76
|
onKeyDown: (e) => {
|
|
82
77
|
if (e.key !== "Enter" && e.key !== " ") return;
|
|
83
78
|
e.preventDefault();
|
|
@@ -87,69 +82,49 @@ const ImageRenderer = ({
|
|
|
87
82
|
/* @__PURE__ */ jsx(
|
|
88
83
|
"img",
|
|
89
84
|
{
|
|
90
|
-
src,
|
|
91
85
|
alt: altText,
|
|
92
|
-
|
|
86
|
+
className: `${image} ${state === "loaded" ? imageVisible : ""} ${semanticClassNames.image}`,
|
|
87
|
+
"data-state": state,
|
|
93
88
|
height,
|
|
94
89
|
loading: "lazy",
|
|
95
|
-
|
|
96
|
-
className: `${image} ${state === "loaded" ? imageVisible : ""} ${semanticClassNames.image}`,
|
|
90
|
+
src,
|
|
97
91
|
style: width && height ? { height: "100%", objectFit: "cover" } : void 0,
|
|
98
|
-
|
|
99
|
-
onError: () => setState("error")
|
|
100
|
-
|
|
101
|
-
),
|
|
102
|
-
state === "loading" && /* @__PURE__ */ jsx(
|
|
103
|
-
"span",
|
|
104
|
-
{
|
|
105
|
-
className: `${loader} ${semanticClassNames.loader}`
|
|
92
|
+
width,
|
|
93
|
+
onError: () => setState("error"),
|
|
94
|
+
onLoad: () => setState("loaded")
|
|
106
95
|
}
|
|
107
96
|
),
|
|
108
|
-
state === "
|
|
109
|
-
|
|
110
|
-
{
|
|
111
|
-
className: `${errorBadge} ${semanticClassNames.errorBadge}`,
|
|
112
|
-
children: "Image failed to load"
|
|
113
|
-
}
|
|
114
|
-
)
|
|
97
|
+
state === "loading" && /* @__PURE__ */ jsx("span", { className: `${loader} ${semanticClassNames.loader}` }),
|
|
98
|
+
state === "error" && /* @__PURE__ */ jsx("span", { className: `${errorBadge} ${semanticClassNames.errorBadge}`, children: "Image failed to load" })
|
|
115
99
|
]
|
|
116
100
|
}
|
|
117
101
|
) }) }),
|
|
118
|
-
captionText && /* @__PURE__ */ jsx(
|
|
119
|
-
"figcaption",
|
|
120
|
-
{
|
|
121
|
-
className: `${caption} ${semanticClassNames.caption}`,
|
|
122
|
-
children: captionText
|
|
123
|
-
}
|
|
124
|
-
)
|
|
102
|
+
captionText && /* @__PURE__ */ jsx("figcaption", { className: `${caption} ${semanticClassNames.caption}`, children: captionText })
|
|
125
103
|
] });
|
|
126
104
|
};
|
|
127
105
|
export {
|
|
128
106
|
ImageRenderer as I,
|
|
129
107
|
editFieldIcon as a,
|
|
130
108
|
editInput as b,
|
|
131
|
-
|
|
132
|
-
|
|
109
|
+
replacePreview as c,
|
|
110
|
+
editToolbar as d,
|
|
133
111
|
editField as e,
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
112
|
+
editToolbarVisible as f,
|
|
113
|
+
editToolbarButton as g,
|
|
114
|
+
editPanel as h,
|
|
115
|
+
editToolbarButtonDanger as i,
|
|
116
|
+
editPlaceholder as j,
|
|
117
|
+
editTrigger as k,
|
|
118
|
+
root as l,
|
|
119
|
+
image as m,
|
|
120
|
+
imageVisible as n,
|
|
121
|
+
loader as o,
|
|
144
122
|
panelHint as p,
|
|
145
|
-
|
|
123
|
+
errorBadge as q,
|
|
146
124
|
replaceUploadArea as r,
|
|
147
125
|
semanticClassNames as s,
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
frameEditMode as x,
|
|
153
|
-
imageState as y,
|
|
154
|
-
caption as z
|
|
126
|
+
frame as t,
|
|
127
|
+
frameEditMode as u,
|
|
128
|
+
imageState as v,
|
|
129
|
+
caption as w
|
|
155
130
|
};
|
package/dist/ImageRenderer.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { ImageRendererProps } from '@haklex/rich-editor';
|
|
1
|
+
import { ImageRendererProps } from '@haklex/rich-editor/renderers';
|
|
2
2
|
import { ComponentType } from 'react';
|
|
3
3
|
export declare const ImageRenderer: ComponentType<ImageRendererProps>;
|
|
4
4
|
//# sourceMappingURL=ImageRenderer.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ImageRenderer.d.ts","sourceRoot":"","sources":["../src/ImageRenderer.tsx"],"names":[],"mappings":"AAAA,OAAO,4CAA4C,
|
|
1
|
+
{"version":3,"file":"ImageRenderer.d.ts","sourceRoot":"","sources":["../src/ImageRenderer.tsx"],"names":[],"mappings":"AAAA,OAAO,4CAA4C,CAAC;AAGpD,OAAO,EAAmB,KAAK,kBAAkB,EAAE,MAAM,+BAA+B,CAAC;AACzF,OAAO,KAAK,EAAE,aAAa,EAAiB,MAAM,OAAO,CAAC;AAuB1D,eAAO,MAAM,aAAa,EAAE,aAAa,CAAC,kBAAkB,CA8E3D,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ReplacePanel.d.ts","sourceRoot":"","sources":["../src/ReplacePanel.tsx"],"names":[],"mappings":"AAqBA,wBAAgB,YAAY,
|
|
1
|
+
{"version":3,"file":"ReplacePanel.d.ts","sourceRoot":"","sources":["../src/ReplacePanel.tsx"],"names":[],"mappings":"AAqBA,wBAAgB,YAAY,4CAmG3B"}
|
package/dist/atoms.d.ts
CHANGED
|
@@ -35,6 +35,9 @@ export declare const replaceOpenAtom: import('jotai').PrimitiveAtom<boolean> & {
|
|
|
35
35
|
init: boolean;
|
|
36
36
|
};
|
|
37
37
|
export declare const toolbarVisibleAtom: import('jotai').Atom<boolean>;
|
|
38
|
+
export declare const focusCaptionOnOpenAtom: import('jotai').PrimitiveAtom<boolean> & {
|
|
39
|
+
init: boolean;
|
|
40
|
+
};
|
|
38
41
|
export declare const editSrcAtom: import('jotai').PrimitiveAtom<string> & {
|
|
39
42
|
init: string;
|
|
40
43
|
};
|
package/dist/atoms.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"atoms.d.ts","sourceRoot":"","sources":["../src/atoms.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,aAAa,EAAE,SAAS,EAAE,MAAM,OAAO,
|
|
1
|
+
{"version":3,"file":"atoms.d.ts","sourceRoot":"","sources":["../src/atoms.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,aAAa,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAEtD,MAAM,MAAM,cAAc,GAAG,SAAS,GAAG,QAAQ,GAAG,OAAO,CAAC;AAC5D,MAAM,MAAM,WAAW,GAAG,QAAQ,GAAG,KAAK,CAAC;AAY3C,eAAO,MAAM,OAAO;;CAAW,CAAC;AAChC,eAAO,MAAM,WAAW;;CAAW,CAAC;AACpC,eAAO,MAAM,SAAS;;CAA6B,CAAC;AACpD,eAAO,MAAM,UAAU;;CAA6B,CAAC;AACrD,eAAO,MAAM,WAAW;;CAA6B,CAAC;AACtD,eAAO,MAAM,aAAa;;CAA6B,CAAC;AACxD,eAAO,MAAM,UAAU;;CAA6B,CAAC;AAGrD,eAAO,MAAM,aAAa;;CAAkC,CAAC;AAC7D,eAAO,MAAM,YAAY;;CAAc,CAAC;AACxC,eAAO,MAAM,YAAY;;CAAc,CAAC;AACxC,eAAO,MAAM,eAAe;;CAAc,CAAC;AAC3C,eAAO,MAAM,kBAAkB,+BAE9B,CAAC;AAEF,eAAO,MAAM,sBAAsB;;CAAc,CAAC;AAGlD,eAAO,MAAM,WAAW;;CAAW,CAAC;AACpC,eAAO,MAAM,eAAe;;CAAW,CAAC;AACxC,eAAO,MAAM,eAAe;;CAAW,CAAC;AAGxC,eAAO,MAAM,eAAe;;CAA8B,CAAC;AAC3D,eAAO,MAAM,cAAc;;CAAW,CAAC;AACvC,eAAO,MAAM,kBAAkB;;CAA4B,CAAC;AAC5D,eAAO,MAAM,eAAe;WACnB,MAAM;YACL,MAAM;;;eADP,MAAM;gBACL,MAAM;;CACD,CAAC;AAChB,eAAO,MAAM,kBAAkB;;CAAc,CAAC;AAC9C,eAAO,MAAM,gBAAgB;;CAA4B,CAAC;AAG1D,eAAO,MAAM,cAAc;;CAEzB,CAAC;AACH,eAAO,MAAM,gBAAgB;;CAE3B,CAAC;AAGH,eAAO,MAAM,kBAAkB,0CAG7B,CAAC;AAEH,eAAO,MAAM,eAAe,0CAAoE,CAAC;AAEjG,eAAO,MAAM,cAAc,qCAezB,CAAC"}
|
package/dist/index.mjs
CHANGED
|
@@ -1,11 +1,14 @@
|
|
|
1
1
|
import { jsx, jsxs, Fragment } from "react/jsx-runtime";
|
|
2
|
-
import {
|
|
2
|
+
import { useRendererMode } from "@haklex/rich-editor";
|
|
3
3
|
import { useLexicalComposerContext } from "@lexical/react/LexicalComposerContext";
|
|
4
4
|
import { atom, createStore, Provider, useStore, useAtomValue, useSetAtom } from "jotai";
|
|
5
5
|
import { useRef, useState, useEffect, useCallback } from "react";
|
|
6
|
-
import {
|
|
6
|
+
import { decodeThumbHash, computeImageMeta } from "@haklex/rich-editor/renderers";
|
|
7
|
+
import { ActionBar, ActionButton, SegmentedControl, Popover, PopoverTrigger, PopoverPanel } from "@haklex/rich-editor-ui";
|
|
7
8
|
import { ImageIcon, Type, Captions, Loader2, Upload, Replace, ExternalLink, Copy, Download, Trash2 } from "lucide-react";
|
|
8
|
-
import { e as editField, s as semanticClassNames, a as editFieldIcon, b as editInput,
|
|
9
|
+
import { e as editField, s as semanticClassNames, a as editFieldIcon, b as editInput, r as replaceUploadArea, p as panelHint, c as replacePreview, d as editToolbar, f as editToolbarVisible, g as editToolbarButton, h as editPanel, i as editToolbarButtonDanger, j as editPlaceholder, I as ImageRenderer, k as editTrigger, l as root, m as image, n as imageVisible, o as loader, q as errorBadge, t as frame, u as frameEditMode, v as imageState, w as caption } from "./ImageRenderer-gflWZhku.js";
|
|
10
|
+
import { $isImageNode, $createImageNode } from "@haklex/rich-editor/nodes";
|
|
11
|
+
import { useImageUpload } from "@haklex/rich-editor/plugins";
|
|
9
12
|
import { $getNearestNodeFromDOMNode } from "lexical";
|
|
10
13
|
function getCaptionText(altText, caption2) {
|
|
11
14
|
if (caption2) return caption2;
|
|
@@ -29,6 +32,7 @@ const replaceOpenAtom = atom(false);
|
|
|
29
32
|
const toolbarVisibleAtom = atom(
|
|
30
33
|
(get) => get(hoveringAtom) || get(metaOpenAtom) || get(replaceOpenAtom)
|
|
31
34
|
);
|
|
35
|
+
const focusCaptionOnOpenAtom = atom(false);
|
|
32
36
|
const editSrcAtom = atom("");
|
|
33
37
|
const editAltTextAtom = atom("");
|
|
34
38
|
const editCaptionAtom = atom("");
|
|
@@ -48,9 +52,7 @@ const placeholderUrlAtom = atom((get) => {
|
|
|
48
52
|
const thumbhash = get(thumbhashAtom);
|
|
49
53
|
return thumbhash ? decodeThumbHash(thumbhash) : void 0;
|
|
50
54
|
});
|
|
51
|
-
const captionTextAtom = atom(
|
|
52
|
-
(get) => getCaptionText(get(altTextAtom), get(captionAtom))
|
|
53
|
-
);
|
|
55
|
+
const captionTextAtom = atom((get) => getCaptionText(get(altTextAtom), get(captionAtom)));
|
|
54
56
|
const frameStyleAtom = atom((get) => {
|
|
55
57
|
const placeholderUrl = get(placeholderUrlAtom);
|
|
56
58
|
const accent = get(accentAtom);
|
|
@@ -224,17 +226,11 @@ function useImageActions() {
|
|
|
224
226
|
altText: nextFile.name
|
|
225
227
|
});
|
|
226
228
|
const uploader = uploadImage ?? fallbackUploader;
|
|
227
|
-
const [result, meta] = await Promise.all([
|
|
228
|
-
uploader(file),
|
|
229
|
-
computeImageMeta(file)
|
|
230
|
-
]);
|
|
229
|
+
const [result, meta] = await Promise.all([uploader(file), computeImageMeta(file)]);
|
|
231
230
|
withImageNode((node) => {
|
|
232
231
|
node.setSrc(result.src);
|
|
233
232
|
node.setAltText(result.altText ?? file.name);
|
|
234
|
-
node.setDimensions(
|
|
235
|
-
result.width ?? meta.width,
|
|
236
|
-
result.height ?? meta.height
|
|
237
|
-
);
|
|
233
|
+
node.setDimensions(result.width ?? meta.width, result.height ?? meta.height);
|
|
238
234
|
node.setThumbhash(result.thumbhash ?? meta.thumbhash);
|
|
239
235
|
});
|
|
240
236
|
closeReplacePanel();
|
|
@@ -306,108 +302,79 @@ function EditMetaPopover() {
|
|
|
306
302
|
const setEditCaption = useSetAtom(editCaptionAtom);
|
|
307
303
|
const setMetaOpen = useSetAtom(metaOpenAtom);
|
|
308
304
|
const { commitMeta } = useImageActions();
|
|
305
|
+
const captionInputRef = useRef(null);
|
|
306
|
+
const focusCaptionOnOpen = useAtomValue(focusCaptionOnOpenAtom);
|
|
307
|
+
const setFocusCaptionOnOpen = useSetAtom(focusCaptionOnOpenAtom);
|
|
308
|
+
useEffect(() => {
|
|
309
|
+
if (focusCaptionOnOpen && captionInputRef.current) {
|
|
310
|
+
captionInputRef.current.focus();
|
|
311
|
+
captionInputRef.current.select();
|
|
312
|
+
setFocusCaptionOnOpen(false);
|
|
313
|
+
}
|
|
314
|
+
}, [focusCaptionOnOpen, setFocusCaptionOnOpen]);
|
|
309
315
|
return /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
310
|
-
/* @__PURE__ */ jsxs(
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
/* @__PURE__ */ jsx(
|
|
373
|
-
"input",
|
|
374
|
-
{
|
|
375
|
-
className: `${editInput} ${semanticClassNames.editInput}`,
|
|
376
|
-
type: "text",
|
|
377
|
-
value: editCaption,
|
|
378
|
-
onChange: (event) => setEditCaption(event.target.value),
|
|
379
|
-
placeholder: "Caption (optional)"
|
|
380
|
-
}
|
|
381
|
-
)
|
|
382
|
-
]
|
|
383
|
-
}
|
|
384
|
-
),
|
|
385
|
-
/* @__PURE__ */ jsxs(
|
|
386
|
-
"div",
|
|
387
|
-
{
|
|
388
|
-
className: `${editActions} ${semanticClassNames.editActions}`,
|
|
389
|
-
children: [
|
|
390
|
-
/* @__PURE__ */ jsx(
|
|
391
|
-
"button",
|
|
392
|
-
{
|
|
393
|
-
className: `${editActionButton} ${semanticClassNames.editActionButton}`,
|
|
394
|
-
type: "button",
|
|
395
|
-
onClick: commitMeta,
|
|
396
|
-
children: "Save"
|
|
397
|
-
}
|
|
398
|
-
),
|
|
399
|
-
/* @__PURE__ */ jsx(
|
|
400
|
-
"button",
|
|
401
|
-
{
|
|
402
|
-
className: `${editActionButton} ${semanticClassNames.editActionButton} ${editActionButtonEnd} ${semanticClassNames.editActionButtonEnd}`,
|
|
403
|
-
type: "button",
|
|
404
|
-
onClick: () => setMetaOpen(false),
|
|
405
|
-
children: "Close"
|
|
406
|
-
}
|
|
407
|
-
)
|
|
408
|
-
]
|
|
409
|
-
}
|
|
410
|
-
)
|
|
316
|
+
/* @__PURE__ */ jsxs("div", { className: `${editField} ${semanticClassNames.editField}`, children: [
|
|
317
|
+
/* @__PURE__ */ jsx(
|
|
318
|
+
ImageIcon,
|
|
319
|
+
{
|
|
320
|
+
className: `${editFieldIcon} ${semanticClassNames.editFieldIcon}`,
|
|
321
|
+
size: 14
|
|
322
|
+
}
|
|
323
|
+
),
|
|
324
|
+
/* @__PURE__ */ jsx(
|
|
325
|
+
"input",
|
|
326
|
+
{
|
|
327
|
+
className: `${editInput} ${semanticClassNames.editInput}`,
|
|
328
|
+
placeholder: "Image URL",
|
|
329
|
+
type: "url",
|
|
330
|
+
value: editSrc,
|
|
331
|
+
onChange: (event) => setEditSrc(event.target.value)
|
|
332
|
+
}
|
|
333
|
+
)
|
|
334
|
+
] }),
|
|
335
|
+
/* @__PURE__ */ jsxs("div", { className: `${editField} ${semanticClassNames.editField}`, children: [
|
|
336
|
+
/* @__PURE__ */ jsx(
|
|
337
|
+
Type,
|
|
338
|
+
{
|
|
339
|
+
className: `${editFieldIcon} ${semanticClassNames.editFieldIcon}`,
|
|
340
|
+
size: 14
|
|
341
|
+
}
|
|
342
|
+
),
|
|
343
|
+
/* @__PURE__ */ jsx(
|
|
344
|
+
"input",
|
|
345
|
+
{
|
|
346
|
+
className: `${editInput} ${semanticClassNames.editInput}`,
|
|
347
|
+
placeholder: "Alt text",
|
|
348
|
+
type: "text",
|
|
349
|
+
value: editAltText,
|
|
350
|
+
onChange: (event) => setEditAltText(event.target.value)
|
|
351
|
+
}
|
|
352
|
+
)
|
|
353
|
+
] }),
|
|
354
|
+
/* @__PURE__ */ jsxs("div", { className: `${editField} ${semanticClassNames.editField}`, children: [
|
|
355
|
+
/* @__PURE__ */ jsx(
|
|
356
|
+
Captions,
|
|
357
|
+
{
|
|
358
|
+
className: `${editFieldIcon} ${semanticClassNames.editFieldIcon}`,
|
|
359
|
+
size: 14
|
|
360
|
+
}
|
|
361
|
+
),
|
|
362
|
+
/* @__PURE__ */ jsx(
|
|
363
|
+
"input",
|
|
364
|
+
{
|
|
365
|
+
className: `${editInput} ${semanticClassNames.editInput}`,
|
|
366
|
+
placeholder: "Caption (optional)",
|
|
367
|
+
ref: captionInputRef,
|
|
368
|
+
type: "text",
|
|
369
|
+
value: editCaption,
|
|
370
|
+
onChange: (event) => setEditCaption(event.target.value)
|
|
371
|
+
}
|
|
372
|
+
)
|
|
373
|
+
] }),
|
|
374
|
+
/* @__PURE__ */ jsxs(ActionBar, { children: [
|
|
375
|
+
/* @__PURE__ */ jsx(ActionButton, { onClick: () => setMetaOpen(false), children: "Close" }),
|
|
376
|
+
/* @__PURE__ */ jsx(ActionButton, { variant: "accent", onClick: commitMeta, children: "Save" })
|
|
377
|
+
] })
|
|
411
378
|
] });
|
|
412
379
|
}
|
|
413
380
|
const replaceModeItems = [
|
|
@@ -428,20 +395,20 @@ function ReplacePanel() {
|
|
|
428
395
|
/* @__PURE__ */ jsx(
|
|
429
396
|
SegmentedControl,
|
|
430
397
|
{
|
|
398
|
+
fullWidth: true,
|
|
431
399
|
items: replaceModeItems,
|
|
432
400
|
value: replaceMode,
|
|
433
|
-
onChange: setReplaceMode
|
|
434
|
-
fullWidth: true
|
|
401
|
+
onChange: setReplaceMode
|
|
435
402
|
}
|
|
436
403
|
),
|
|
437
404
|
replaceMode === "upload" ? /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
438
405
|
/* @__PURE__ */ jsx(
|
|
439
406
|
"input",
|
|
440
407
|
{
|
|
441
|
-
ref: fileInputRef,
|
|
442
|
-
type: "file",
|
|
443
408
|
accept: "image/*",
|
|
409
|
+
ref: fileInputRef,
|
|
444
410
|
style: { display: "none" },
|
|
411
|
+
type: "file",
|
|
445
412
|
onChange: (event) => {
|
|
446
413
|
const file = event.currentTarget.files?.[0] ?? null;
|
|
447
414
|
void handleReplaceFile(file);
|
|
@@ -452,8 +419,8 @@ function ReplacePanel() {
|
|
|
452
419
|
/* @__PURE__ */ jsx(
|
|
453
420
|
"button",
|
|
454
421
|
{
|
|
455
|
-
type: "button",
|
|
456
422
|
className: `${replaceUploadArea} ${semanticClassNames.replaceUploadArea}`,
|
|
423
|
+
type: "button",
|
|
457
424
|
onClick: () => fileInputRef.current?.click(),
|
|
458
425
|
children: replaceLoading ? /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
459
426
|
/* @__PURE__ */ jsx(Loader2, { size: 16 }),
|
|
@@ -465,80 +432,45 @@ function ReplacePanel() {
|
|
|
465
432
|
}
|
|
466
433
|
)
|
|
467
434
|
] }) : /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
468
|
-
/* @__PURE__ */ jsxs(
|
|
469
|
-
|
|
470
|
-
|
|
471
|
-
|
|
472
|
-
|
|
473
|
-
|
|
474
|
-
|
|
475
|
-
|
|
476
|
-
|
|
477
|
-
|
|
478
|
-
|
|
479
|
-
|
|
480
|
-
|
|
481
|
-
|
|
482
|
-
|
|
483
|
-
|
|
484
|
-
|
|
485
|
-
|
|
486
|
-
|
|
487
|
-
|
|
488
|
-
if (event.key === "Enter") {
|
|
489
|
-
event.preventDefault();
|
|
490
|
-
handlePreviewUrl();
|
|
491
|
-
}
|
|
492
|
-
},
|
|
493
|
-
placeholder: "https://example.com/image.jpg"
|
|
494
|
-
}
|
|
495
|
-
)
|
|
496
|
-
]
|
|
497
|
-
}
|
|
498
|
-
),
|
|
499
|
-
/* @__PURE__ */ jsxs(
|
|
500
|
-
"div",
|
|
501
|
-
{
|
|
502
|
-
className: `${editActions} ${semanticClassNames.editActions}`,
|
|
503
|
-
children: [
|
|
504
|
-
/* @__PURE__ */ jsx(
|
|
505
|
-
"button",
|
|
506
|
-
{
|
|
507
|
-
className: `${editActionButton} ${semanticClassNames.editActionButton}`,
|
|
508
|
-
type: "button",
|
|
509
|
-
disabled: replaceLoading || !replaceUrl.trim(),
|
|
510
|
-
onClick: handlePreviewUrl,
|
|
511
|
-
children: "Preview"
|
|
512
|
-
}
|
|
513
|
-
),
|
|
514
|
-
/* @__PURE__ */ jsx(
|
|
515
|
-
"button",
|
|
516
|
-
{
|
|
517
|
-
className: `${editActionButton} ${semanticClassNames.editActionButton} ${editActionButtonEnd} ${semanticClassNames.editActionButtonEnd}`,
|
|
518
|
-
type: "button",
|
|
519
|
-
disabled: !replacePreview$1,
|
|
520
|
-
onClick: handleReplaceByUrl,
|
|
521
|
-
children: "Apply"
|
|
435
|
+
/* @__PURE__ */ jsxs("div", { className: `${editField} ${semanticClassNames.editField}`, children: [
|
|
436
|
+
/* @__PURE__ */ jsx(
|
|
437
|
+
ImageIcon,
|
|
438
|
+
{
|
|
439
|
+
className: `${editFieldIcon} ${semanticClassNames.editFieldIcon}`,
|
|
440
|
+
size: 14
|
|
441
|
+
}
|
|
442
|
+
),
|
|
443
|
+
/* @__PURE__ */ jsx(
|
|
444
|
+
"input",
|
|
445
|
+
{
|
|
446
|
+
className: `${editInput} ${semanticClassNames.editInput}`,
|
|
447
|
+
placeholder: "https://example.com/image.jpg",
|
|
448
|
+
type: "url",
|
|
449
|
+
value: replaceUrl,
|
|
450
|
+
onChange: (event) => setReplaceUrl(event.target.value),
|
|
451
|
+
onKeyDown: (event) => {
|
|
452
|
+
if (event.key === "Enter") {
|
|
453
|
+
event.preventDefault();
|
|
454
|
+
handlePreviewUrl();
|
|
522
455
|
}
|
|
523
|
-
|
|
524
|
-
|
|
525
|
-
|
|
526
|
-
)
|
|
456
|
+
}
|
|
457
|
+
}
|
|
458
|
+
)
|
|
459
|
+
] }),
|
|
460
|
+
/* @__PURE__ */ jsxs(ActionBar, { children: [
|
|
461
|
+
/* @__PURE__ */ jsx(
|
|
462
|
+
ActionButton,
|
|
463
|
+
{
|
|
464
|
+
disabled: replaceLoading || !replaceUrl.trim(),
|
|
465
|
+
onClick: handlePreviewUrl,
|
|
466
|
+
children: "Preview"
|
|
467
|
+
}
|
|
468
|
+
),
|
|
469
|
+
/* @__PURE__ */ jsx(ActionButton, { disabled: !replacePreview$1, variant: "accent", onClick: handleReplaceByUrl, children: "Apply" })
|
|
470
|
+
] })
|
|
527
471
|
] }),
|
|
528
|
-
replaceError && /* @__PURE__ */ jsx(
|
|
529
|
-
|
|
530
|
-
{
|
|
531
|
-
className: `${panelHint} ${semanticClassNames.panelHint}`,
|
|
532
|
-
children: replaceError
|
|
533
|
-
}
|
|
534
|
-
),
|
|
535
|
-
replacePreview$1 && /* @__PURE__ */ jsx(
|
|
536
|
-
"div",
|
|
537
|
-
{
|
|
538
|
-
className: `${replacePreview} ${semanticClassNames.replacePreview}`,
|
|
539
|
-
children: /* @__PURE__ */ jsx("img", { src: replacePreview$1, alt: "Replace preview" })
|
|
540
|
-
}
|
|
541
|
-
)
|
|
472
|
+
replaceError && /* @__PURE__ */ jsx("span", { className: `${panelHint} ${semanticClassNames.panelHint}`, children: replaceError }),
|
|
473
|
+
replacePreview$1 && /* @__PURE__ */ jsx("div", { className: `${replacePreview} ${semanticClassNames.replacePreview}`, children: /* @__PURE__ */ jsx("img", { alt: "Replace preview", src: replacePreview$1 }) })
|
|
542
474
|
] });
|
|
543
475
|
}
|
|
544
476
|
function ImageEditToolbar() {
|
|
@@ -546,13 +478,7 @@ function ImageEditToolbar() {
|
|
|
546
478
|
const metaOpen = useAtomValue(metaOpenAtom);
|
|
547
479
|
const setMetaOpen = useSetAtom(metaOpenAtom);
|
|
548
480
|
const replaceOpen = useAtomValue(replaceOpenAtom);
|
|
549
|
-
const {
|
|
550
|
-
handleReplaceOpenChange,
|
|
551
|
-
handleOpen,
|
|
552
|
-
handleDuplicate,
|
|
553
|
-
handleDownload,
|
|
554
|
-
handleDelete
|
|
555
|
-
} = useImageActions();
|
|
481
|
+
const { handleReplaceOpenChange, handleOpen, handleDuplicate, handleDownload, handleDelete } = useImageActions();
|
|
556
482
|
return /* @__PURE__ */ jsxs(
|
|
557
483
|
"div",
|
|
558
484
|
{
|
|
@@ -575,7 +501,7 @@ function ImageEditToolbar() {
|
|
|
575
501
|
children: /* @__PURE__ */ jsx(Type, { size: 14 })
|
|
576
502
|
}
|
|
577
503
|
),
|
|
578
|
-
/* @__PURE__ */ jsx(PopoverPanel, { side: "bottom", sideOffset: 8,
|
|
504
|
+
/* @__PURE__ */ jsx(PopoverPanel, { className: editPanel, side: "bottom", sideOffset: 8, children: /* @__PURE__ */ jsx(EditMetaPopover, {}) })
|
|
579
505
|
]
|
|
580
506
|
}
|
|
581
507
|
),
|
|
@@ -596,7 +522,7 @@ function ImageEditToolbar() {
|
|
|
596
522
|
children: /* @__PURE__ */ jsx(Replace, { size: 14 })
|
|
597
523
|
}
|
|
598
524
|
),
|
|
599
|
-
/* @__PURE__ */ jsx(PopoverPanel, { side: "bottom", sideOffset: 8,
|
|
525
|
+
/* @__PURE__ */ jsx(PopoverPanel, { className: editPanel, side: "bottom", sideOffset: 8, children: /* @__PURE__ */ jsx(ReplacePanel, {}) })
|
|
600
526
|
]
|
|
601
527
|
}
|
|
602
528
|
),
|
|
@@ -604,13 +530,13 @@ function ImageEditToolbar() {
|
|
|
604
530
|
"button",
|
|
605
531
|
{
|
|
606
532
|
className: `${editToolbarButton} ${semanticClassNames.editToolbarButton}`,
|
|
533
|
+
title: "Open source",
|
|
607
534
|
type: "button",
|
|
535
|
+
onClick: handleOpen,
|
|
608
536
|
onMouseDown: (e) => {
|
|
609
537
|
e.preventDefault();
|
|
610
538
|
e.stopPropagation();
|
|
611
539
|
},
|
|
612
|
-
onClick: handleOpen,
|
|
613
|
-
title: "Open source",
|
|
614
540
|
children: /* @__PURE__ */ jsx(ExternalLink, { size: 14 })
|
|
615
541
|
}
|
|
616
542
|
),
|
|
@@ -618,13 +544,13 @@ function ImageEditToolbar() {
|
|
|
618
544
|
"button",
|
|
619
545
|
{
|
|
620
546
|
className: `${editToolbarButton} ${semanticClassNames.editToolbarButton}`,
|
|
547
|
+
title: "Duplicate",
|
|
621
548
|
type: "button",
|
|
549
|
+
onClick: handleDuplicate,
|
|
622
550
|
onMouseDown: (e) => {
|
|
623
551
|
e.preventDefault();
|
|
624
552
|
e.stopPropagation();
|
|
625
553
|
},
|
|
626
|
-
onClick: handleDuplicate,
|
|
627
|
-
title: "Duplicate",
|
|
628
554
|
children: /* @__PURE__ */ jsx(Copy, { size: 14 })
|
|
629
555
|
}
|
|
630
556
|
),
|
|
@@ -632,13 +558,13 @@ function ImageEditToolbar() {
|
|
|
632
558
|
"button",
|
|
633
559
|
{
|
|
634
560
|
className: `${editToolbarButton} ${semanticClassNames.editToolbarButton}`,
|
|
561
|
+
title: "Download",
|
|
635
562
|
type: "button",
|
|
563
|
+
onClick: handleDownload,
|
|
636
564
|
onMouseDown: (e) => {
|
|
637
565
|
e.preventDefault();
|
|
638
566
|
e.stopPropagation();
|
|
639
567
|
},
|
|
640
|
-
onClick: handleDownload,
|
|
641
|
-
title: "Download",
|
|
642
568
|
children: /* @__PURE__ */ jsx(Download, { size: 14 })
|
|
643
569
|
}
|
|
644
570
|
),
|
|
@@ -646,13 +572,13 @@ function ImageEditToolbar() {
|
|
|
646
572
|
"button",
|
|
647
573
|
{
|
|
648
574
|
className: `${editToolbarButton} ${semanticClassNames.editToolbarButton} ${editToolbarButtonDanger} ${semanticClassNames.editToolbarButtonDanger}`,
|
|
575
|
+
title: "Remove image",
|
|
649
576
|
type: "button",
|
|
577
|
+
onClick: handleDelete,
|
|
650
578
|
onMouseDown: (e) => {
|
|
651
579
|
e.preventDefault();
|
|
652
580
|
e.stopPropagation();
|
|
653
581
|
},
|
|
654
|
-
onClick: handleDelete,
|
|
655
|
-
title: "Remove image",
|
|
656
582
|
children: /* @__PURE__ */ jsx(Trash2, { size: 14 })
|
|
657
583
|
}
|
|
658
584
|
)
|
|
@@ -674,7 +600,7 @@ function ReplacePopover() {
|
|
|
674
600
|
]
|
|
675
601
|
}
|
|
676
602
|
),
|
|
677
|
-
/* @__PURE__ */ jsx(PopoverPanel, { side: "bottom", sideOffset: 8,
|
|
603
|
+
/* @__PURE__ */ jsx(PopoverPanel, { className: editPanel, side: "bottom", sideOffset: 8, children: /* @__PURE__ */ jsx(ReplacePanel, {}) })
|
|
678
604
|
] });
|
|
679
605
|
}
|
|
680
606
|
const frameStateSemanticClass = {
|
|
@@ -708,11 +634,27 @@ function ImageEditContent() {
|
|
|
708
634
|
const width = useAtomValue(widthAtom);
|
|
709
635
|
const height = useAtomValue(heightAtom);
|
|
710
636
|
const captionText = useAtomValue(captionTextAtom);
|
|
637
|
+
const setMetaOpen = useSetAtom(metaOpenAtom);
|
|
638
|
+
const setReplaceOpen = useSetAtom(replaceOpenAtom);
|
|
639
|
+
const setFocusCaptionOnOpen = useSetAtom(focusCaptionOnOpenAtom);
|
|
640
|
+
const handleCaptionClick = useCallback(
|
|
641
|
+
(e) => {
|
|
642
|
+
e.stopPropagation();
|
|
643
|
+
const scrollY = window.scrollY;
|
|
644
|
+
setReplaceOpen(false);
|
|
645
|
+
setMetaOpen(true);
|
|
646
|
+
setFocusCaptionOnOpen(true);
|
|
647
|
+
requestAnimationFrame(() => {
|
|
648
|
+
window.scrollTo({ top: scrollY });
|
|
649
|
+
});
|
|
650
|
+
},
|
|
651
|
+
[setMetaOpen, setReplaceOpen, setFocusCaptionOnOpen]
|
|
652
|
+
);
|
|
711
653
|
return /* @__PURE__ */ jsxs(
|
|
712
654
|
"div",
|
|
713
655
|
{
|
|
714
|
-
ref: wrapperRef,
|
|
715
656
|
className: `${editTrigger} ${semanticClassNames.editTrigger}`,
|
|
657
|
+
ref: wrapperRef,
|
|
716
658
|
onMouseEnter: () => setHovering(true),
|
|
717
659
|
onMouseLeave: () => setHovering(false),
|
|
718
660
|
children: [
|
|
@@ -726,29 +668,18 @@ function ImageEditContent() {
|
|
|
726
668
|
/* @__PURE__ */ jsx(
|
|
727
669
|
"img",
|
|
728
670
|
{
|
|
729
|
-
src,
|
|
730
671
|
alt: altText,
|
|
731
|
-
|
|
672
|
+
className: `${image} ${loadState === "loaded" ? imageVisible : ""} ${semanticClassNames.image}`,
|
|
732
673
|
height,
|
|
733
674
|
loading: "lazy",
|
|
734
|
-
|
|
735
|
-
|
|
736
|
-
onError: () => setLoadState("error")
|
|
737
|
-
|
|
738
|
-
),
|
|
739
|
-
loadState === "loading" && /* @__PURE__ */ jsx(
|
|
740
|
-
"span",
|
|
741
|
-
{
|
|
742
|
-
className: `${loader} ${semanticClassNames.loader}`
|
|
675
|
+
src,
|
|
676
|
+
width,
|
|
677
|
+
onError: () => setLoadState("error"),
|
|
678
|
+
onLoad: () => setLoadState("loaded")
|
|
743
679
|
}
|
|
744
680
|
),
|
|
745
|
-
loadState === "
|
|
746
|
-
|
|
747
|
-
{
|
|
748
|
-
className: `${errorBadge} ${semanticClassNames.errorBadge}`,
|
|
749
|
-
children: "Image failed to load"
|
|
750
|
-
}
|
|
751
|
-
)
|
|
681
|
+
loadState === "loading" && /* @__PURE__ */ jsx("span", { className: `${loader} ${semanticClassNames.loader}` }),
|
|
682
|
+
loadState === "error" && /* @__PURE__ */ jsx("span", { className: `${errorBadge} ${semanticClassNames.errorBadge}`, children: "Image failed to load" })
|
|
752
683
|
]
|
|
753
684
|
}
|
|
754
685
|
),
|
|
@@ -756,6 +687,7 @@ function ImageEditContent() {
|
|
|
756
687
|
"figcaption",
|
|
757
688
|
{
|
|
758
689
|
className: `${caption} ${semanticClassNames.caption}`,
|
|
690
|
+
onClick: handleCaptionClick,
|
|
759
691
|
children: captionText
|
|
760
692
|
}
|
|
761
693
|
)
|
|
@@ -1 +1 @@
|
|
|
1
|
-
:root{--rc-text: #000;--rc-text-secondary: #27272a;--rc-text-tertiary: #71717a;--rc-text-quaternary: #a1a1aa;--rc-bg: #ffffff;--rc-bg-secondary: #fafafa;--rc-bg-tertiary: #f4f4f5;--rc-fill: #e8e8ec;--rc-fill-secondary: #eeeeef;--rc-fill-tertiary: #f4f4f6;--rc-fill-quaternary: #f9f9fa;--rc-border: #f4f4f5;--rc-accent: #2563eb;--rc-accent-light: #2563eb20;--rc-link: #2563eb;--rc-code-text: #3f3f46;--rc-code-bg: #f4f4f5;--rc-hr-border: #e4e4e7;--rc-quote-border: #2563eb;--rc-quote-bg: #eff6ff;--rc-alert-info: #006bb7;--rc-alert-warning: #cc5500;--rc-alert-tip: #11cc00;--rc-alert-caution: #cc0011;--rc-alert-important: #5500cc;--rc-max-width: 700px;--rc-shadow-top-bar: 0 8px 30px rgba(0, 0, 0, .12), 0 2px 8px rgba(0, 0, 0, .06);--rc-shadow-modal: 0 10px 15px -3px rgba(0,0,0,.1), 0 4px 6px -4px rgba(0,0,0,.1);--rc-shadow-menu: 0 1px 4px rgba(0,0,0,.04), 0 4px 16px rgba(0,0,0,.08);--rc-space-xs: 4px;--rc-space-sm: 8px;--rc-space-md: 16px;--rc-space-lg: 24px;--rc-space-xl: 32px;--rc-font-family-sans: "PingFang SC", "Microsoft YaHei", "Segoe UI", Roboto, Helvetica, "noto sans sc", "hiragino sans gb", -apple-system, system-ui, sans-serif, Apple Color Emoji, Segoe UI Emoji, Not Color Emoji;--rc-font-family-serif: "Noto Serif CJK SC", "Source Han Serif SC", "Source Han Serif", "source-han-serif-sc", "Songti SC", STSong, "华文宋体", serif;--rc-font-mono: "SF Mono", SFMono-Regular, ui-monospace, "DejaVu Sans Mono", Menlo, Consolas, monospace;--rc-font-size-2xs: .625em;--rc-font-size-xs: .75em;--rc-font-size-sm: .8125em;--rc-font-size-md: .875em;--rc-font-size-lg: 1.25em;--rc-font-size-base: 16px;--rc-font-size-small: 14px;--rc-line-height: 1.7;--rc-line-height-tight: 1.4;--rc-font-family: "PingFang SC", "Microsoft YaHei", "Segoe UI", Roboto, Helvetica, "noto sans sc", "hiragino sans gb", -apple-system, system-ui, sans-serif, Apple Color Emoji, Segoe UI Emoji, Not Color Emoji;--rc-radius-sm: 4px;--rc-radius-md: 8px;--rc-radius-lg: 12px}:root.dark{--rc-text: #fafafa;--rc-text-secondary: #a1a1aa;--rc-text-tertiary: #71717a;--rc-text-quaternary: #52525b;--rc-bg: #09090b;--rc-bg-secondary: #18181b;--rc-bg-tertiary: #27272a;--rc-fill: #2a2a2f;--rc-fill-secondary: #222226;--rc-fill-tertiary: #1b1b1f;--rc-fill-quaternary: #131316;--rc-border: #27272a;--rc-accent: #60a5fa;--rc-accent-light: #60a5fa20;--rc-link: #60a5fa;--rc-code-text: #e4e4e7;--rc-code-bg: #27272a;--rc-hr-border: #27272a;--rc-quote-border: #60a5fa;--rc-quote-bg: #1e3a5f;--rc-alert-info: #7db9e5;--rc-alert-warning: #da864a;--rc-alert-tip: #54da48;--rc-alert-caution: #e16973;--rc-alert-important: #9966e0;--rc-max-width: 700px;--rc-shadow-top-bar: 0 8px 30px rgba(0, 0, 0, .45), 0 2px 8px rgba(0, 0, 0, .3);--rc-shadow-modal: 0 10px 15px -3px rgba(0,0,0,.4), 0 4px 6px -4px rgba(0,0,0,.35);--rc-shadow-menu: 0 1px 4px rgba(0,0,0,.25), 0 4px 16px rgba(0,0,0,.4);--rc-space-xs: 4px;--rc-space-sm: 8px;--rc-space-md: 16px;--rc-space-lg: 24px;--rc-space-xl: 32px;--rc-font-family-sans: "PingFang SC", "Microsoft YaHei", "Segoe UI", Roboto, Helvetica, "noto sans sc", "hiragino sans gb", -apple-system, system-ui, sans-serif, Apple Color Emoji, Segoe UI Emoji, Not Color Emoji;--rc-font-family-serif: "Noto Serif CJK SC", "Source Han Serif SC", "Source Han Serif", "source-han-serif-sc", "Songti SC", STSong, "华文宋体", serif;--rc-font-mono: "SF Mono", SFMono-Regular, ui-monospace, "DejaVu Sans Mono", Menlo, Consolas, monospace;--rc-font-size-2xs: .625em;--rc-font-size-xs: .75em;--rc-font-size-sm: .8125em;--rc-font-size-md: .875em;--rc-font-size-lg: 1.25em;--rc-font-size-base: 16px;--rc-font-size-small: 14px;--rc-line-height: 1.7;--rc-line-height-tight: 1.4;--rc-font-family: "PingFang SC", "Microsoft YaHei", "Segoe UI", Roboto, Helvetica, "noto sans sc", "hiragino sans gb", -apple-system, system-ui, sans-serif, Apple Color Emoji, Segoe UI Emoji, Not Color Emoji;--rc-radius-sm: 4px;--rc-radius-md: 8px;--rc-radius-lg: 12px}._7eow1s0{--rc-text: #000;--rc-text-secondary: #27272a;--rc-text-tertiary: #71717a;--rc-text-quaternary: #a1a1aa;--rc-bg: #ffffff;--rc-bg-secondary: #fafafa;--rc-bg-tertiary: #f4f4f5;--rc-fill: #e8e8ec;--rc-fill-secondary: #eeeeef;--rc-fill-tertiary: #f4f4f6;--rc-fill-quaternary: #f9f9fa;--rc-border: #f4f4f5;--rc-accent: #2563eb;--rc-accent-light: #2563eb20;--rc-link: #2563eb;--rc-code-text: #3f3f46;--rc-code-bg: #f4f4f5;--rc-hr-border: #e4e4e7;--rc-quote-border: #2563eb;--rc-quote-bg: #eff6ff;--rc-alert-info: #006bb7;--rc-alert-warning: #cc5500;--rc-alert-tip: #11cc00;--rc-alert-caution: #cc0011;--rc-alert-important: #5500cc;--rc-max-width: 700px;--rc-shadow-top-bar: 0 8px 30px rgba(0, 0, 0, .12), 0 2px 8px rgba(0, 0, 0, .06);--rc-shadow-modal: 0 10px 15px -3px rgba(0,0,0,.1), 0 4px 6px -4px rgba(0,0,0,.1);--rc-shadow-menu: 0 1px 4px rgba(0,0,0,.04), 0 4px 16px rgba(0,0,0,.08);--rc-space-xs: 4px;--rc-space-sm: 8px;--rc-space-md: 16px;--rc-space-lg: 24px;--rc-space-xl: 32px;--rc-font-family-sans: "PingFang SC", "Microsoft YaHei", "Segoe UI", Roboto, Helvetica, "noto sans sc", "hiragino sans gb", -apple-system, system-ui, sans-serif, Apple Color Emoji, Segoe UI Emoji, Not Color Emoji;--rc-font-family-serif: "Noto Serif CJK SC", "Source Han Serif SC", "Source Han Serif", "source-han-serif-sc", "Songti SC", STSong, "华文宋体", serif;--rc-font-mono: "SF Mono", SFMono-Regular, ui-monospace, "DejaVu Sans Mono", Menlo, Consolas, monospace;--rc-font-size-2xs: .625em;--rc-font-size-xs: .75em;--rc-font-size-sm: .8125em;--rc-font-size-md: .875em;--rc-font-size-lg: 1.25em;--rc-font-size-base: 16px;--rc-font-size-small: 14px;--rc-line-height: 1.7;--rc-line-height-tight: 1.4;--rc-font-family: "PingFang SC", "Microsoft YaHei", "Segoe UI", Roboto, Helvetica, "noto sans sc", "hiragino sans gb", -apple-system, system-ui, sans-serif, Apple Color Emoji, Segoe UI Emoji, Not Color Emoji;--rc-radius-sm: 4px;--rc-radius-md: 8px;--rc-radius-lg: 12px}._7eow1s1{--rc-text: #000;--rc-text-secondary: #27272a;--rc-text-tertiary: #71717a;--rc-text-quaternary: #a1a1aa;--rc-bg: #ffffff;--rc-bg-secondary: #fafafa;--rc-bg-tertiary: #f4f4f5;--rc-fill: #e8e8ec;--rc-fill-secondary: #eeeeef;--rc-fill-tertiary: #f4f4f6;--rc-fill-quaternary: #f9f9fa;--rc-border: #f4f4f5;--rc-accent: #2563eb;--rc-accent-light: #2563eb20;--rc-link: #2563eb;--rc-code-text: #3f3f46;--rc-code-bg: #f4f4f5;--rc-hr-border: #e4e4e7;--rc-quote-border: #2563eb;--rc-quote-bg: #eff6ff;--rc-alert-info: #006bb7;--rc-alert-warning: #cc5500;--rc-alert-tip: #11cc00;--rc-alert-caution: #cc0011;--rc-alert-important: #5500cc;--rc-max-width: 700px;--rc-shadow-top-bar: 0 8px 30px rgba(0, 0, 0, .12), 0 2px 8px rgba(0, 0, 0, .06);--rc-shadow-modal: 0 10px 15px -3px rgba(0,0,0,.1), 0 4px 6px -4px rgba(0,0,0,.1);--rc-shadow-menu: 0 1px 4px rgba(0,0,0,.04), 0 4px 16px rgba(0,0,0,.08);--rc-space-xs: 4px;--rc-space-sm: 8px;--rc-space-md: 16px;--rc-space-lg: 24px;--rc-space-xl: 32px;--rc-font-family-sans: "PingFang SC", "Microsoft YaHei", "Segoe UI", Roboto, Helvetica, "noto sans sc", "hiragino sans gb", -apple-system, system-ui, sans-serif, Apple Color Emoji, Segoe UI Emoji, Not Color Emoji;--rc-font-family-serif: "Noto Serif CJK SC", "Source Han Serif SC", "Source Han Serif", "source-han-serif-sc", "Songti SC", STSong, "华文宋体", serif;--rc-font-mono: "SF Mono", SFMono-Regular, ui-monospace, "DejaVu Sans Mono", Menlo, Consolas, monospace;--rc-font-size-2xs: .625em;--rc-font-size-xs: .75em;--rc-font-size-sm: .8125em;--rc-font-size-md: .875em;--rc-font-size-lg: 1.25em;--rc-font-size-base: 16px;--rc-font-size-small: 14px;--rc-line-height: 1.8;--rc-line-height-tight: 1.4;--rc-font-family: "Noto Serif CJK SC", "Source Han Serif SC", "Source Han Serif", "source-han-serif-sc", "Songti SC", STSong, "华文宋体", serif;--rc-radius-sm: 4px;--rc-radius-md: 8px;--rc-radius-lg: 12px}._7eow1s2{--rc-text: #000;--rc-text-secondary: #27272a;--rc-text-tertiary: #71717a;--rc-text-quaternary: #a1a1aa;--rc-bg: #ffffff;--rc-bg-secondary: #fafafa;--rc-bg-tertiary: #f4f4f5;--rc-fill: #e8e8ec;--rc-fill-secondary: #eeeeef;--rc-fill-tertiary: #f4f4f6;--rc-fill-quaternary: #f9f9fa;--rc-border: #f4f4f5;--rc-accent: #2563eb;--rc-accent-light: #2563eb20;--rc-link: #2563eb;--rc-code-text: #3f3f46;--rc-code-bg: #f4f4f5;--rc-hr-border: #e4e4e7;--rc-quote-border: #a1a1aa;--rc-quote-bg: #fafafa;--rc-alert-info: #006bb7;--rc-alert-warning: #cc5500;--rc-alert-tip: #11cc00;--rc-alert-caution: #cc0011;--rc-alert-important: #5500cc;--rc-max-width: none;--rc-shadow-top-bar: 0 8px 30px rgba(0, 0, 0, .12), 0 2px 8px rgba(0, 0, 0, .06);--rc-shadow-modal: 0 10px 15px -3px rgba(0,0,0,.1), 0 4px 6px -4px rgba(0,0,0,.1);--rc-shadow-menu: 0 1px 4px rgba(0,0,0,.04), 0 4px 16px rgba(0,0,0,.08);--rc-space-xs: 2px;--rc-space-sm: 4px;--rc-space-md: 10px;--rc-space-lg: 16px;--rc-space-xl: 20px;--rc-font-family-sans: "PingFang SC", "Microsoft YaHei", "Segoe UI", Roboto, Helvetica, "noto sans sc", "hiragino sans gb", -apple-system, system-ui, sans-serif, Apple Color Emoji, Segoe UI Emoji, Not Color Emoji;--rc-font-family-serif: "Noto Serif CJK SC", "Source Han Serif SC", "Source Han Serif", "source-han-serif-sc", "Songti SC", STSong, "华文宋体", serif;--rc-font-mono: "SF Mono", SFMono-Regular, ui-monospace, "DejaVu Sans Mono", Menlo, Consolas, monospace;--rc-font-size-2xs: .625em;--rc-font-size-xs: .75em;--rc-font-size-sm: .8125em;--rc-font-size-md: .875em;--rc-font-size-lg: 1.25em;--rc-font-size-base: 14px;--rc-font-size-small: 12px;--rc-line-height: 1.5;--rc-line-height-tight: 1.3;--rc-font-family: "PingFang SC", "Microsoft YaHei", "Segoe UI", Roboto, Helvetica, "noto sans sc", "hiragino sans gb", -apple-system, system-ui, sans-serif, Apple Color Emoji, Segoe UI Emoji, Not Color Emoji;--rc-radius-sm: 3px;--rc-radius-md: 6px;--rc-radius-lg: 8px}.dark ._7eow1s0,[data-theme=dark] ._7eow1s0,.dark._7eow1s0,[data-theme=dark]._7eow1s0,.dark ._7eow1s1,[data-theme=dark] ._7eow1s1,.dark._7eow1s1,[data-theme=dark]._7eow1s1,.dark ._7eow1s2,[data-theme=dark] ._7eow1s2,.dark._7eow1s2,[data-theme=dark]._7eow1s2{--rc-text: #fafafa;--rc-text-secondary: #a1a1aa;--rc-text-tertiary: #71717a;--rc-text-quaternary: #52525b;--rc-bg: #09090b;--rc-bg-secondary: #18181b;--rc-bg-tertiary: #27272a;--rc-fill: #2a2a2f;--rc-fill-secondary: #222226;--rc-fill-tertiary: #1b1b1f;--rc-fill-quaternary: #131316;--rc-border: #27272a;--rc-accent: #60a5fa;--rc-accent-light: #60a5fa20;--rc-link: #60a5fa;--rc-code-text: #e4e4e7;--rc-code-bg: #27272a;--rc-hr-border: #27272a;--rc-quote-border: #60a5fa;--rc-quote-bg: #1e3a5f;--rc-alert-info: #7db9e5;--rc-alert-warning: #da864a;--rc-alert-tip: #54da48;--rc-alert-caution: #e16973;--rc-alert-important: #9966e0;--rc-shadow-top-bar: 0 8px 30px rgba(0, 0, 0, .45), 0 2px 8px rgba(0, 0, 0, .3);--rc-shadow-modal: 0 10px 15px -3px rgba(0,0,0,.4), 0 4px 6px -4px rgba(0,0,0,.35);--rc-shadow-menu: 0 1px 4px rgba(0,0,0,.25), 0 4px 16px rgba(0,0,0,.4)}@keyframes _1n94osf1{0%{mask:linear-gradient(90deg,#000 25%,#000000e6 50%,#00000000) 150% 0 / 400% no-repeat;opacity:.16}to{mask:linear-gradient(90deg,#000 25%,#000000e6 50%,#00000000) 0 / 400% no-repeat;opacity:1}}@keyframes _1n94osf9{to{transform:rotate(360deg)}}@keyframes _1n94osfh{0%{opacity:0}to{opacity:1}}._1n94osf0{margin:1.25rem 0;text-align:center}._1n94osf2{display:block;width:100%;height:auto;max-width:100%;opacity:0;border-radius:0!important}._1n94osf6{opacity:1;animation:_1n94osf1 .42s ease}._1n94osf7{position:relative;display:inline-flex;align-items:center;justify-content:center;overflow:hidden;border-radius:var(--rc-radius-md);cursor:zoom-in;min-height:3rem;transition:transform .25s ease}._1n94osf7:hover{transform:translateY(-1px)}._1n94osf8{cursor:default}._1n94osf8:hover{transform:none}._1n94osfa{position:absolute;width:1.65rem;height:1.65rem;border:2px solid color-mix(in srgb,var(--rc-text-secondary) 45%,transparent);border-top-color:color-mix(in srgb,var(--rc-text) 65%,transparent);border-radius:50%;animation:_1n94osf9 .75s linear infinite}._1n94osfb{font-size:var(--rc-font-size-sm);color:var(--rc-alert-caution);background:color-mix(in srgb,var(--rc-bg) 86%,transparent);border-radius:999px;padding:.15rem .6rem}._1n94osfc{margin-top:.5rem;color:var(--rc-text-tertiary);font-size:var(--rc-font-size-md);line-height:1.5}._1n94osfd{margin:var(--rc-space-md) 0;text-align:center}._1n94osfe{position:relative;display:inline-block;overflow:hidden;border-radius:var(--rc-radius-md);transition:background-color .3s ease}._1n94osff{opacity:0;transition:opacity .3s ease}._1n94osfg{opacity:1;transition:opacity .3s ease}._1n94osfi{position:fixed;inset:0;z-index:9999;display:flex;align-items:center;justify-content:center;background-color:#000000d9;cursor:zoom-out;animation:_1n94osfh .2s ease}._1n94osfj{max-width:90vw;max-height:90vh;object-fit:contain;border-radius:0}.rich-image{margin:var(--rc-space-md) 0;text-align:center}.rich-image figcaption{font-size:var(--rc-font-size-md);color:var(--rc-text-secondary);margin-top:var(--rc-space-sm);line-height:var(--rc-line-height-tight)}.rich-image-container{position:relative;display:inline-block;overflow:hidden;border-radius:var(--rc-radius-md);transition:background-color .3s ease}.rich-image-hidden{opacity:0;transition:opacity .3s ease}.rich-image-visible{opacity:1;transition:opacity .3s ease}.rich-image-zoom-overlay{position:fixed;inset:0;z-index:9999;display:flex;align-items:center;justify-content:center;background-color:#000000d9;cursor:zoom-out;animation:_1n94osfh .2s ease}.rich-image-zoom-img{max-width:90vw;max-height:90vh;object-fit:contain;border-radius:0}._1n94osfk{display:block;position:relative;cursor:default}._1n94osfl{display:flex;flex-direction:column;align-items:center;justify-content:center;gap:8px;padding:2rem;border:2px dashed var(--rc-border);border-radius:var(--rc-radius-md);color:var(--rc-text-secondary);font-size:var(--rc-font-size-md);cursor:pointer;transition:border-color .2s,color .2s,background-color .2s}._1n94osfl:hover{border-color:var(--rc-accent);color:var(--rc-text);background-color:color-mix(in srgb,var(--rc-accent) 8%,transparent)}._1n94osfm{position:absolute;top:-2.5rem;left:50%;transform:translate(-50%);z-index:20;display:inline-flex;align-items:center;gap:4px;padding:4px;border-radius:10px;border:1px solid var(--rc-border);background:color-mix(in srgb,var(--rc-bg) 96%,transparent);box-shadow:var(--rc-shadow-top-bar);opacity:0;pointer-events:none;transition:opacity .15s ease}._1n94osfn{opacity:1;pointer-events:auto}._1n94osfo{display:inline-flex;align-items:center;justify-content:center;width:30px;height:30px;border-radius:8px;border:none;background:transparent;color:var(--rc-text-secondary);cursor:pointer;transition:background-color .15s ease,color .15s ease}._1n94osfo:hover{color:var(--rc-text);background-color:var(--rc-fill-secondary)}._1n94osfp:hover{color:var(--rc-alert-caution);background-color:color-mix(in srgb,var(--rc-alert-caution) 12%,transparent)}._1n94osfq{position:relative;display:flex;flex-direction:column;gap:8px;width:360px;padding:12px;font-size:var(--rc-font-size-sm);font-family:var(--rc-font-family);z-index:30}._1n94osfr{display:flex;align-items:center;gap:8px;padding:6px 10px;background-color:var(--rc-bg-secondary);border-radius:6px;min-width:0}._1n94osfs{flex-shrink:0;color:var(--rc-text-secondary)}._1n94osft{flex:1;appearance:none;border:none;background-color:transparent;color:inherit;font-size:var(--rc-font-size-sm);padding:0;outline:none;min-width:0}._1n94osft::placeholder{color:var(--rc-text-secondary)}._1n94osfu{display:flex;align-items:center;gap:4px}._1n94osfv{display:inline-flex;align-items:center;gap:6px;appearance:none;border:none;background:none;color:inherit;font-size:var(--rc-font-size-sm);font-weight:500;cursor:pointer;padding:4px 8px;border-radius:4px;transition:color .15s ease,background-color .15s ease;white-space:nowrap}._1n94osfv:hover{background-color:var(--rc-fill-secondary)}._1n94osfw{margin-left:auto}._1n94osfx{display:flex;flex-direction:column;align-items:center;justify-content:center;gap:.45rem;min-height:138px;border-radius:var(--rc-radius-md);border:1.5px dashed var(--rc-border);color:var(--rc-text-secondary);cursor:pointer;transition:border-color .15s ease,background-color .15s ease}._1n94osfx:hover{border-color:color-mix(in srgb,var(--rc-accent) 45%,transparent);color:var(--rc-text);background-color:color-mix(in srgb,var(--rc-accent) 7%,transparent)}._1n94osfy{border-radius:var(--rc-radius-md);overflow:hidden;border:1px solid var(--rc-border);background-color:color-mix(in srgb,var(--rc-text) 2%,transparent)}._1n94osfy img{width:100%;max-height:188px;object-fit:cover;display:block}._1n94osfz{display:inline-flex;align-items:center;gap:.4rem;color:var(--rc-text-secondary);font-size:var(--rc-font-size-xs)}
|
|
1
|
+
:root{--rc-text: #000;--rc-text-secondary: #27272a;--rc-text-tertiary: #71717a;--rc-text-quaternary: #a1a1aa;--rc-bg: #ffffff;--rc-bg-secondary: #fafafa;--rc-bg-tertiary: #f4f4f5;--rc-fill: #e8e8ec;--rc-fill-secondary: #eeeeef;--rc-fill-tertiary: #f4f4f6;--rc-fill-quaternary: #f9f9fa;--rc-border: #f4f4f5;--rc-accent: #2563eb;--rc-accent-light: #2563eb20;--rc-link: #2563eb;--rc-code-text: #3f3f46;--rc-code-bg: #f4f4f5;--rc-hr-border: #e4e4e7;--rc-quote-border: #2563eb;--rc-quote-bg: #eff6ff;--rc-alert-info: #006bb7;--rc-alert-warning: #cc5500;--rc-alert-tip: #11cc00;--rc-alert-caution: #cc0011;--rc-alert-important: #5500cc;--rc-max-width: 700px;--rc-shadow-top-bar: 0 8px 30px rgba(0, 0, 0, .12), 0 2px 8px rgba(0, 0, 0, .06);--rc-shadow-modal: 0 10px 15px -3px rgba(0,0,0,.1), 0 4px 6px -4px rgba(0,0,0,.1);--rc-shadow-menu: 0 1px 4px rgba(0,0,0,.04), 0 4px 16px rgba(0,0,0,.08);--rc-space-xs: 4px;--rc-space-sm: 8px;--rc-space-md: 16px;--rc-space-lg: 24px;--rc-space-xl: 32px;--rc-font-family-sans: "PingFang SC", "Microsoft YaHei", "Segoe UI", Roboto, Helvetica, "noto sans sc", "hiragino sans gb", -apple-system, system-ui, sans-serif, Apple Color Emoji, Segoe UI Emoji, Not Color Emoji;--rc-font-family-serif: "Noto Serif CJK SC", "Source Han Serif SC", "Source Han Serif", "source-han-serif-sc", "Songti SC", STSong, "华文宋体", serif;--rc-font-mono: "SF Mono", SFMono-Regular, ui-monospace, "DejaVu Sans Mono", Menlo, Consolas, monospace;--rc-font-size-2xs: .625em;--rc-font-size-xs: .75em;--rc-font-size-sm: .8125em;--rc-font-size-md: .875em;--rc-font-size-lg: 1.25em;--rc-font-size-base: 16px;--rc-font-size-small: 14px;--rc-line-height: 1.7;--rc-line-height-tight: 1.4;--rc-font-family: "PingFang SC", "Microsoft YaHei", "Segoe UI", Roboto, Helvetica, "noto sans sc", "hiragino sans gb", -apple-system, system-ui, sans-serif, Apple Color Emoji, Segoe UI Emoji, Not Color Emoji;--rc-radius-sm: 4px;--rc-radius-md: 8px;--rc-radius-lg: 12px}:root.dark{--rc-text: #fafafa;--rc-text-secondary: #a1a1aa;--rc-text-tertiary: #71717a;--rc-text-quaternary: #52525b;--rc-bg: #09090b;--rc-bg-secondary: #18181b;--rc-bg-tertiary: #27272a;--rc-fill: #2a2a2f;--rc-fill-secondary: #222226;--rc-fill-tertiary: #1b1b1f;--rc-fill-quaternary: #131316;--rc-border: #27272a;--rc-accent: #60a5fa;--rc-accent-light: #60a5fa20;--rc-link: #60a5fa;--rc-code-text: #e4e4e7;--rc-code-bg: #27272a;--rc-hr-border: #27272a;--rc-quote-border: #60a5fa;--rc-quote-bg: #1e3a5f;--rc-alert-info: #7db9e5;--rc-alert-warning: #da864a;--rc-alert-tip: #54da48;--rc-alert-caution: #e16973;--rc-alert-important: #9966e0;--rc-max-width: 700px;--rc-shadow-top-bar: 0 8px 30px rgba(0, 0, 0, .45), 0 2px 8px rgba(0, 0, 0, .3);--rc-shadow-modal: 0 10px 15px -3px rgba(0,0,0,.4), 0 4px 6px -4px rgba(0,0,0,.35);--rc-shadow-menu: 0 1px 4px rgba(0,0,0,.25), 0 4px 16px rgba(0,0,0,.4);--rc-space-xs: 4px;--rc-space-sm: 8px;--rc-space-md: 16px;--rc-space-lg: 24px;--rc-space-xl: 32px;--rc-font-family-sans: "PingFang SC", "Microsoft YaHei", "Segoe UI", Roboto, Helvetica, "noto sans sc", "hiragino sans gb", -apple-system, system-ui, sans-serif, Apple Color Emoji, Segoe UI Emoji, Not Color Emoji;--rc-font-family-serif: "Noto Serif CJK SC", "Source Han Serif SC", "Source Han Serif", "source-han-serif-sc", "Songti SC", STSong, "华文宋体", serif;--rc-font-mono: "SF Mono", SFMono-Regular, ui-monospace, "DejaVu Sans Mono", Menlo, Consolas, monospace;--rc-font-size-2xs: .625em;--rc-font-size-xs: .75em;--rc-font-size-sm: .8125em;--rc-font-size-md: .875em;--rc-font-size-lg: 1.25em;--rc-font-size-base: 16px;--rc-font-size-small: 14px;--rc-line-height: 1.7;--rc-line-height-tight: 1.4;--rc-font-family: "PingFang SC", "Microsoft YaHei", "Segoe UI", Roboto, Helvetica, "noto sans sc", "hiragino sans gb", -apple-system, system-ui, sans-serif, Apple Color Emoji, Segoe UI Emoji, Not Color Emoji;--rc-radius-sm: 4px;--rc-radius-md: 8px;--rc-radius-lg: 12px}._7eow1s0{--rc-text: #000;--rc-text-secondary: #27272a;--rc-text-tertiary: #71717a;--rc-text-quaternary: #a1a1aa;--rc-bg: #ffffff;--rc-bg-secondary: #fafafa;--rc-bg-tertiary: #f4f4f5;--rc-fill: #e8e8ec;--rc-fill-secondary: #eeeeef;--rc-fill-tertiary: #f4f4f6;--rc-fill-quaternary: #f9f9fa;--rc-border: #f4f4f5;--rc-accent: #2563eb;--rc-accent-light: #2563eb20;--rc-link: #2563eb;--rc-code-text: #3f3f46;--rc-code-bg: #f4f4f5;--rc-hr-border: #e4e4e7;--rc-quote-border: #2563eb;--rc-quote-bg: #eff6ff;--rc-alert-info: #006bb7;--rc-alert-warning: #cc5500;--rc-alert-tip: #11cc00;--rc-alert-caution: #cc0011;--rc-alert-important: #5500cc;--rc-max-width: 700px;--rc-shadow-top-bar: 0 8px 30px rgba(0, 0, 0, .12), 0 2px 8px rgba(0, 0, 0, .06);--rc-shadow-modal: 0 10px 15px -3px rgba(0,0,0,.1), 0 4px 6px -4px rgba(0,0,0,.1);--rc-shadow-menu: 0 1px 4px rgba(0,0,0,.04), 0 4px 16px rgba(0,0,0,.08);--rc-space-xs: 4px;--rc-space-sm: 8px;--rc-space-md: 16px;--rc-space-lg: 24px;--rc-space-xl: 32px;--rc-font-family-sans: "PingFang SC", "Microsoft YaHei", "Segoe UI", Roboto, Helvetica, "noto sans sc", "hiragino sans gb", -apple-system, system-ui, sans-serif, Apple Color Emoji, Segoe UI Emoji, Not Color Emoji;--rc-font-family-serif: "Noto Serif CJK SC", "Source Han Serif SC", "Source Han Serif", "source-han-serif-sc", "Songti SC", STSong, "华文宋体", serif;--rc-font-mono: "SF Mono", SFMono-Regular, ui-monospace, "DejaVu Sans Mono", Menlo, Consolas, monospace;--rc-font-size-2xs: .625em;--rc-font-size-xs: .75em;--rc-font-size-sm: .8125em;--rc-font-size-md: .875em;--rc-font-size-lg: 1.25em;--rc-font-size-base: 16px;--rc-font-size-small: 14px;--rc-line-height: 1.7;--rc-line-height-tight: 1.4;--rc-font-family: "PingFang SC", "Microsoft YaHei", "Segoe UI", Roboto, Helvetica, "noto sans sc", "hiragino sans gb", -apple-system, system-ui, sans-serif, Apple Color Emoji, Segoe UI Emoji, Not Color Emoji;--rc-radius-sm: 4px;--rc-radius-md: 8px;--rc-radius-lg: 12px}._7eow1s1{--rc-text: #000;--rc-text-secondary: #27272a;--rc-text-tertiary: #71717a;--rc-text-quaternary: #a1a1aa;--rc-bg: #ffffff;--rc-bg-secondary: #fafafa;--rc-bg-tertiary: #f4f4f5;--rc-fill: #e8e8ec;--rc-fill-secondary: #eeeeef;--rc-fill-tertiary: #f4f4f6;--rc-fill-quaternary: #f9f9fa;--rc-border: #f4f4f5;--rc-accent: #2563eb;--rc-accent-light: #2563eb20;--rc-link: #2563eb;--rc-code-text: #3f3f46;--rc-code-bg: #f4f4f5;--rc-hr-border: #e4e4e7;--rc-quote-border: #2563eb;--rc-quote-bg: #eff6ff;--rc-alert-info: #006bb7;--rc-alert-warning: #cc5500;--rc-alert-tip: #11cc00;--rc-alert-caution: #cc0011;--rc-alert-important: #5500cc;--rc-max-width: 700px;--rc-shadow-top-bar: 0 8px 30px rgba(0, 0, 0, .12), 0 2px 8px rgba(0, 0, 0, .06);--rc-shadow-modal: 0 10px 15px -3px rgba(0,0,0,.1), 0 4px 6px -4px rgba(0,0,0,.1);--rc-shadow-menu: 0 1px 4px rgba(0,0,0,.04), 0 4px 16px rgba(0,0,0,.08);--rc-space-xs: 4px;--rc-space-sm: 8px;--rc-space-md: 16px;--rc-space-lg: 24px;--rc-space-xl: 32px;--rc-font-family-sans: "PingFang SC", "Microsoft YaHei", "Segoe UI", Roboto, Helvetica, "noto sans sc", "hiragino sans gb", -apple-system, system-ui, sans-serif, Apple Color Emoji, Segoe UI Emoji, Not Color Emoji;--rc-font-family-serif: "Noto Serif CJK SC", "Source Han Serif SC", "Source Han Serif", "source-han-serif-sc", "Songti SC", STSong, "华文宋体", serif;--rc-font-mono: "SF Mono", SFMono-Regular, ui-monospace, "DejaVu Sans Mono", Menlo, Consolas, monospace;--rc-font-size-2xs: .625em;--rc-font-size-xs: .75em;--rc-font-size-sm: .8125em;--rc-font-size-md: .875em;--rc-font-size-lg: 1.25em;--rc-font-size-base: 16px;--rc-font-size-small: 14px;--rc-line-height: 1.8;--rc-line-height-tight: 1.4;--rc-font-family: "Noto Serif CJK SC", "Source Han Serif SC", "Source Han Serif", "source-han-serif-sc", "Songti SC", STSong, "华文宋体", serif;--rc-radius-sm: 4px;--rc-radius-md: 8px;--rc-radius-lg: 12px}._7eow1s2{--rc-text: #000;--rc-text-secondary: #27272a;--rc-text-tertiary: #71717a;--rc-text-quaternary: #a1a1aa;--rc-bg: #ffffff;--rc-bg-secondary: #fafafa;--rc-bg-tertiary: #f4f4f5;--rc-fill: #e8e8ec;--rc-fill-secondary: #eeeeef;--rc-fill-tertiary: #f4f4f6;--rc-fill-quaternary: #f9f9fa;--rc-border: #f4f4f5;--rc-accent: #2563eb;--rc-accent-light: #2563eb20;--rc-link: #2563eb;--rc-code-text: #3f3f46;--rc-code-bg: #f4f4f5;--rc-hr-border: #e4e4e7;--rc-quote-border: #a1a1aa;--rc-quote-bg: #fafafa;--rc-alert-info: #006bb7;--rc-alert-warning: #cc5500;--rc-alert-tip: #11cc00;--rc-alert-caution: #cc0011;--rc-alert-important: #5500cc;--rc-max-width: none;--rc-shadow-top-bar: 0 8px 30px rgba(0, 0, 0, .12), 0 2px 8px rgba(0, 0, 0, .06);--rc-shadow-modal: 0 10px 15px -3px rgba(0,0,0,.1), 0 4px 6px -4px rgba(0,0,0,.1);--rc-shadow-menu: 0 1px 4px rgba(0,0,0,.04), 0 4px 16px rgba(0,0,0,.08);--rc-space-xs: 2px;--rc-space-sm: 4px;--rc-space-md: 10px;--rc-space-lg: 16px;--rc-space-xl: 20px;--rc-font-family-sans: "PingFang SC", "Microsoft YaHei", "Segoe UI", Roboto, Helvetica, "noto sans sc", "hiragino sans gb", -apple-system, system-ui, sans-serif, Apple Color Emoji, Segoe UI Emoji, Not Color Emoji;--rc-font-family-serif: "Noto Serif CJK SC", "Source Han Serif SC", "Source Han Serif", "source-han-serif-sc", "Songti SC", STSong, "华文宋体", serif;--rc-font-mono: "SF Mono", SFMono-Regular, ui-monospace, "DejaVu Sans Mono", Menlo, Consolas, monospace;--rc-font-size-2xs: .625em;--rc-font-size-xs: .75em;--rc-font-size-sm: .8125em;--rc-font-size-md: .875em;--rc-font-size-lg: 1.25em;--rc-font-size-base: 14px;--rc-font-size-small: 12px;--rc-line-height: 1.5;--rc-line-height-tight: 1.3;--rc-font-family: "PingFang SC", "Microsoft YaHei", "Segoe UI", Roboto, Helvetica, "noto sans sc", "hiragino sans gb", -apple-system, system-ui, sans-serif, Apple Color Emoji, Segoe UI Emoji, Not Color Emoji;--rc-radius-sm: 3px;--rc-radius-md: 6px;--rc-radius-lg: 8px}.dark ._7eow1s0,[data-theme=dark] ._7eow1s0,.dark._7eow1s0,[data-theme=dark]._7eow1s0,.dark ._7eow1s1,[data-theme=dark] ._7eow1s1,.dark._7eow1s1,[data-theme=dark]._7eow1s1,.dark ._7eow1s2,[data-theme=dark] ._7eow1s2,.dark._7eow1s2,[data-theme=dark]._7eow1s2{--rc-text: #fafafa;--rc-text-secondary: #a1a1aa;--rc-text-tertiary: #71717a;--rc-text-quaternary: #52525b;--rc-bg: #09090b;--rc-bg-secondary: #18181b;--rc-bg-tertiary: #27272a;--rc-fill: #2a2a2f;--rc-fill-secondary: #222226;--rc-fill-tertiary: #1b1b1f;--rc-fill-quaternary: #131316;--rc-border: #27272a;--rc-accent: #60a5fa;--rc-accent-light: #60a5fa20;--rc-link: #60a5fa;--rc-code-text: #e4e4e7;--rc-code-bg: #27272a;--rc-hr-border: #27272a;--rc-quote-border: #60a5fa;--rc-quote-bg: #1e3a5f;--rc-alert-info: #7db9e5;--rc-alert-warning: #da864a;--rc-alert-tip: #54da48;--rc-alert-caution: #e16973;--rc-alert-important: #9966e0;--rc-shadow-top-bar: 0 8px 30px rgba(0, 0, 0, .45), 0 2px 8px rgba(0, 0, 0, .3);--rc-shadow-modal: 0 10px 15px -3px rgba(0,0,0,.4), 0 4px 6px -4px rgba(0,0,0,.35);--rc-shadow-menu: 0 1px 4px rgba(0,0,0,.25), 0 4px 16px rgba(0,0,0,.4)}@keyframes _1n94osf1{0%{mask:linear-gradient(90deg,#000 25%,#000000e6 50%,#00000000) 150% 0 / 400% no-repeat;opacity:.16}to{mask:linear-gradient(90deg,#000 25%,#000000e6 50%,#00000000) 0 / 400% no-repeat;opacity:1}}@keyframes _1n94osf9{to{transform:rotate(360deg)}}@keyframes _1n94osfh{0%{opacity:0}to{opacity:1}}._1n94osf0{margin:1.25rem 0;text-align:center}._1n94osf2{display:block;width:100%;height:auto;max-width:100%;opacity:0;border-radius:0!important}._1n94osf6{opacity:1;animation:_1n94osf1 .42s ease}._1n94osf7{position:relative;display:inline-flex;align-items:center;justify-content:center;overflow:hidden;border-radius:var(--rc-radius-md);cursor:zoom-in;min-height:3rem;transition:transform .25s ease}._1n94osf7:hover{transform:translateY(-1px)}._1n94osf8{cursor:default}._1n94osf8:hover{transform:none}._1n94osfa{position:absolute;width:1.65rem;height:1.65rem;border:2px solid color-mix(in srgb,var(--rc-text-secondary) 45%,transparent);border-top-color:color-mix(in srgb,var(--rc-text) 65%,transparent);border-radius:50%;animation:_1n94osf9 .75s linear infinite}._1n94osfb{font-size:var(--rc-font-size-sm);color:var(--rc-alert-caution);background:color-mix(in srgb,var(--rc-bg) 86%,transparent);border-radius:999px;padding:.15rem .6rem}._1n94osfc{margin-top:.5rem;color:var(--rc-text-tertiary);font-size:var(--rc-font-size-md);line-height:1.5}._1n94osfd{margin:var(--rc-space-md) 0;text-align:center}._1n94osfe{position:relative;display:inline-block;overflow:hidden;border-radius:var(--rc-radius-md);transition:background-color .3s ease}._1n94osff{opacity:0;transition:opacity .3s ease}._1n94osfg{opacity:1;transition:opacity .3s ease}._1n94osfi{position:fixed;inset:0;z-index:9999;display:flex;align-items:center;justify-content:center;background-color:#000000d9;cursor:zoom-out;animation:_1n94osfh .2s ease}._1n94osfj{max-width:90vw;max-height:90vh;object-fit:contain;border-radius:0}.rich-image{margin:var(--rc-space-md) 0;text-align:center}.rich-image figcaption{font-size:var(--rc-font-size-md);color:var(--rc-text-secondary);margin-top:var(--rc-space-sm);line-height:var(--rc-line-height-tight)}.rich-image-container{position:relative;display:inline-block;overflow:hidden;border-radius:var(--rc-radius-md);transition:background-color .3s ease}.rich-image-hidden{opacity:0;transition:opacity .3s ease}.rich-image-visible{opacity:1;transition:opacity .3s ease}.rich-image-zoom-overlay{position:fixed;inset:0;z-index:9999;display:flex;align-items:center;justify-content:center;background-color:#000000d9;cursor:zoom-out;animation:_1n94osfh .2s ease}.rich-image-zoom-img{max-width:90vw;max-height:90vh;object-fit:contain;border-radius:0}._1n94osfk{display:block;position:relative;cursor:default}._1n94osfl{display:flex;flex-direction:column;align-items:center;justify-content:center;gap:8px;padding:2rem;border:2px dashed var(--rc-border);border-radius:var(--rc-radius-md);color:var(--rc-text-secondary);font-size:var(--rc-font-size-md);cursor:pointer;transition:border-color .2s,color .2s,background-color .2s}._1n94osfl:hover{border-color:var(--rc-accent);color:var(--rc-text);background-color:color-mix(in srgb,var(--rc-accent) 8%,transparent)}._1n94osfm{position:absolute;top:-2.5rem;left:50%;transform:translate(-50%);z-index:20;display:inline-flex;align-items:center;gap:4px;padding:4px;border-radius:10px;border:1px solid var(--rc-border);background:color-mix(in srgb,var(--rc-bg) 96%,transparent);box-shadow:var(--rc-shadow-top-bar);opacity:0;pointer-events:none;transition:opacity .15s ease}._1n94osfn{opacity:1;pointer-events:auto}._1n94osfo{display:inline-flex;align-items:center;justify-content:center;width:30px;height:30px;border-radius:8px;border:none;background:transparent;color:var(--rc-text-secondary);cursor:pointer;transition:background-color .15s ease,color .15s ease}._1n94osfo:hover{color:var(--rc-text);background-color:var(--rc-fill-secondary)}._1n94osfp:hover{color:var(--rc-alert-caution);background-color:color-mix(in srgb,var(--rc-alert-caution) 12%,transparent)}._1n94osfq{position:relative;display:flex;flex-direction:column;gap:8px;width:360px;padding:12px;font-size:var(--rc-font-size-base);font-family:var(--rc-font-family);z-index:30}._1n94osfr{display:flex;align-items:center;gap:8px;padding:6px 10px;background-color:var(--rc-bg-secondary);border-radius:6px;min-width:0}._1n94osfs{flex-shrink:0;color:var(--rc-text-secondary)}._1n94osft{flex:1;appearance:none;border:none;background-color:transparent;color:inherit;font-size:var(--rc-font-size-sm);padding:0;outline:none;min-width:0}._1n94osft::placeholder{color:var(--rc-text-secondary)}._1n94osfu{display:flex;flex-direction:column;align-items:center;justify-content:center;gap:.45rem;min-height:138px;border-radius:var(--rc-radius-md);border:1.5px dashed var(--rc-border);color:var(--rc-text-secondary);cursor:pointer;transition:border-color .15s ease,background-color .15s ease}._1n94osfu:hover{border-color:color-mix(in srgb,var(--rc-accent) 45%,transparent);color:var(--rc-text);background-color:color-mix(in srgb,var(--rc-accent) 7%,transparent)}._1n94osfv{border-radius:var(--rc-radius-md);overflow:hidden;border:1px solid var(--rc-border);background-color:color-mix(in srgb,var(--rc-text) 2%,transparent)}._1n94osfv img{width:100%;max-height:188px;object-fit:cover;display:block}._1n94osfw{display:inline-flex;align-items:center;gap:.4rem;color:var(--rc-text-secondary);font-size:var(--rc-font-size-xs)}
|
package/dist/static.mjs
CHANGED
package/dist/styles.css.d.ts
CHANGED
|
@@ -18,9 +18,6 @@ export declare const semanticClassNames: {
|
|
|
18
18
|
readonly editField: "rr-image-edit-field";
|
|
19
19
|
readonly editFieldIcon: "rr-image-edit-field-icon";
|
|
20
20
|
readonly editInput: "rr-image-edit-input";
|
|
21
|
-
readonly editActions: "rr-image-edit-actions";
|
|
22
|
-
readonly editActionButton: "rr-image-edit-action-btn";
|
|
23
|
-
readonly editActionButtonEnd: "rr-image-edit-action-btn--end";
|
|
24
21
|
readonly replaceUploadArea: "rr-image-replace-upload-area";
|
|
25
22
|
readonly replacePreview: "rr-image-replace-preview";
|
|
26
23
|
readonly panelHint: "rr-image-panel-hint";
|
|
@@ -58,9 +55,6 @@ export declare const editPanel: string;
|
|
|
58
55
|
export declare const editField: string;
|
|
59
56
|
export declare const editFieldIcon: string;
|
|
60
57
|
export declare const editInput: string;
|
|
61
|
-
export declare const editActions: string;
|
|
62
|
-
export declare const editActionButton: string;
|
|
63
|
-
export declare const editActionButtonEnd: string;
|
|
64
58
|
export declare const replaceUploadArea: string;
|
|
65
59
|
export declare const replacePreview: string;
|
|
66
60
|
export declare const panelHint: string;
|
package/dist/styles.css.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"styles.css.d.ts","sourceRoot":"","sources":["../src/styles.css.ts"],"names":[],"mappings":"AAQA,eAAO,MAAM,kBAAkB
|
|
1
|
+
{"version":3,"file":"styles.css.d.ts","sourceRoot":"","sources":["../src/styles.css.ts"],"names":[],"mappings":"AAQA,eAAO,MAAM,kBAAkB;;;;;;;;;;;;;;;;;;;;;;;CAuBrB,CAAA;AAEV,eAAO,MAAM,IAAI,QAGf,CAAA;AAaF,eAAO,MAAM,KAAK,QAOhB,CAAA;AAEF,eAAO,MAAM,UAAU,gDAIrB,CAAA;AAEF,eAAO,MAAM,YAAY,QAGvB,CAAA;AAEF,eAAO,MAAM,KAAK,QAehB,CAAA;AAEF,eAAO,MAAM,aAAa,QAOxB,CAAA;AAIF,eAAO,MAAM,MAAM,QAQjB,CAAA;AAEF,eAAO,MAAM,UAAU,QAMrB,CAAA;AAEF,eAAO,MAAM,OAAO,QAKlB,CAAA;AAEF,eAAO,MAAM,yBAAyB;;;;;;;CAO5B,CAAA;AAgCV,eAAO,MAAM,WAAW,QAA2B,CAAA;AACnD,eAAO,MAAM,gBAAgB,QAAgC,CAAA;AAC7D,eAAO,MAAM,aAAa,QAA6B,CAAA;AACvD,eAAO,MAAM,cAAc,QAA8B,CAAA;AA0BzD,eAAO,MAAM,kBAAkB,QAAkC,CAAA;AACjE,eAAO,MAAM,gBAAgB,QAAgC,CAAA;AAgB7D,eAAO,MAAM,WAAW,QAItB,CAAA;AAEF,eAAO,MAAM,eAAe,QAoB1B,CAAA;AAEF,eAAO,MAAM,WAAW,QAiBtB,CAAA;AAEF,eAAO,MAAM,kBAAkB,QAG7B,CAAA;AAEF,eAAO,MAAM,iBAAiB,QAkB5B,CAAA;AAEF,eAAO,MAAM,uBAAuB,QAOlC,CAAA;AAEF,eAAO,MAAM,SAAS,QAUpB,CAAA;AAEF,eAAO,MAAM,SAAS,QAQpB,CAAA;AAEF,eAAO,MAAM,aAAa,QAGxB,CAAA;AAEF,eAAO,MAAM,SAAS,QAepB,CAAA;AAEF,eAAO,MAAM,iBAAiB,QAmB5B,CAAA;AAEF,eAAO,MAAM,cAAc,QAKzB,CAAA;AASF,eAAO,MAAM,SAAS,QAMpB,CAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useImageActions.d.ts","sourceRoot":"","sources":["../src/useImageActions.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"useImageActions.d.ts","sourceRoot":"","sources":["../src/useImageActions.ts"],"names":[],"mappings":"AAoDA,wBAAgB,eAAe;;;8BA+Ed,IAAI,GAAG,IAAI;;;wCA6Db,OAAO;;;;;EAmBrB"}
|
package/package.json
CHANGED
|
@@ -1,9 +1,14 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@haklex/rich-renderer-image",
|
|
3
|
-
"
|
|
4
|
-
"version": "0.0.65",
|
|
3
|
+
"version": "0.0.67",
|
|
5
4
|
"description": "Image renderer with blurhash and lightbox",
|
|
5
|
+
"repository": {
|
|
6
|
+
"type": "git",
|
|
7
|
+
"url": "https://github.com/Innei/haklex.git",
|
|
8
|
+
"directory": "packages/rich-renderer-image"
|
|
9
|
+
},
|
|
6
10
|
"license": "MIT",
|
|
11
|
+
"type": "module",
|
|
7
12
|
"exports": {
|
|
8
13
|
".": {
|
|
9
14
|
"import": "./dist/index.mjs",
|
|
@@ -19,19 +24,13 @@
|
|
|
19
24
|
"files": [
|
|
20
25
|
"dist"
|
|
21
26
|
],
|
|
22
|
-
"peerDependencies": {
|
|
23
|
-
"@lexical/react": "^0.41.0",
|
|
24
|
-
"lexical": "^0.41.0",
|
|
25
|
-
"react": ">=19",
|
|
26
|
-
"react-dom": ">=19"
|
|
27
|
-
},
|
|
28
27
|
"dependencies": {
|
|
29
28
|
"jotai": "2.18.0",
|
|
30
29
|
"lucide-react": "^0.577.0",
|
|
31
30
|
"react-photo-view": "^1.2.7",
|
|
32
|
-
"@haklex/rich-editor": "0.0.
|
|
33
|
-
"@haklex/rich-editor-ui": "0.0.
|
|
34
|
-
"@haklex/rich-style-token": "0.0.
|
|
31
|
+
"@haklex/rich-editor": "0.0.67",
|
|
32
|
+
"@haklex/rich-editor-ui": "0.0.67",
|
|
33
|
+
"@haklex/rich-style-token": "0.0.67"
|
|
35
34
|
},
|
|
36
35
|
"devDependencies": {
|
|
37
36
|
"@lexical/react": "^0.41.0",
|
|
@@ -46,6 +45,12 @@
|
|
|
46
45
|
"vite": "^7.3.1",
|
|
47
46
|
"vite-plugin-dts": "^4.5.4"
|
|
48
47
|
},
|
|
48
|
+
"peerDependencies": {
|
|
49
|
+
"@lexical/react": "^0.41.0",
|
|
50
|
+
"lexical": "^0.41.0",
|
|
51
|
+
"react": ">=19",
|
|
52
|
+
"react-dom": ">=19"
|
|
53
|
+
},
|
|
49
54
|
"publishConfig": {
|
|
50
55
|
"access": "public"
|
|
51
56
|
},
|