@fileverse-dev/fortune-react 1.3.4-viewMode-1 → 1.3.4-viewMode-3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/es/components/LinkEidtCard/index.css +5 -2
- package/es/components/LinkEidtCard/index.js +5 -5
- package/es/components/SheetOverlay/index.js +2 -12
- package/lib/components/LinkEidtCard/index.css +5 -2
- package/lib/components/LinkEidtCard/index.js +5 -5
- package/lib/components/SheetOverlay/index.js +1 -11
- package/package.json +2 -2
|
@@ -7,7 +7,6 @@
|
|
|
7
7
|
box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
|
|
8
8
|
border: 1px solid #e5e5e5;
|
|
9
9
|
border-radius: 8px;
|
|
10
|
-
min-width: 320px;
|
|
11
10
|
}
|
|
12
11
|
|
|
13
12
|
.fortune-link-cards-container {
|
|
@@ -23,7 +22,7 @@
|
|
|
23
22
|
border: 1px solid #e5e5e5;
|
|
24
23
|
border-radius: 8px;
|
|
25
24
|
padding: 16px;
|
|
26
|
-
width:
|
|
25
|
+
width: fit-content;
|
|
27
26
|
box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
|
|
28
27
|
display: flex;
|
|
29
28
|
flex-direction: column;
|
|
@@ -31,6 +30,10 @@
|
|
|
31
30
|
z-index: 300;
|
|
32
31
|
}
|
|
33
32
|
|
|
33
|
+
.fortune-link-card--editing {
|
|
34
|
+
min-width: 280px;
|
|
35
|
+
}
|
|
36
|
+
|
|
34
37
|
.fortune-link-type-select {
|
|
35
38
|
width: 100% !important;
|
|
36
39
|
}
|
|
@@ -172,20 +172,20 @@ export var LinkEditCard = function LinkEditCard(_a) {
|
|
|
172
172
|
"data-testid": "link-card-info-open"
|
|
173
173
|
}, linkType === "webpage" ? insertLink.openLink : replaceHtml(insertLink.goTo, {
|
|
174
174
|
linkAddress: linkAddress
|
|
175
|
-
})), context.allowEdit === true && /*#__PURE__*/React.createElement("div", {
|
|
175
|
+
})), (context.allowEdit === true || context.isFlvReadOnly && linkType === "webpage") && (/*#__PURE__*/React.createElement("div", {
|
|
176
176
|
className: "divider"
|
|
177
|
-
}), context.allowEdit === true && linkType === "webpage" && renderToolbarButton("copy", function () {
|
|
177
|
+
})), (context.allowEdit === true || context.isFlvReadOnly) && linkType === "webpage" && renderToolbarButton("copy", function () {
|
|
178
178
|
navigator.clipboard.writeText(originAddress);
|
|
179
179
|
hideLinkCard();
|
|
180
|
-
}), context.allowEdit === true && renderToolbarButton("pencil", function () {
|
|
180
|
+
}), context.allowEdit === true && !context.isFlvReadOnly && renderToolbarButton("pencil", function () {
|
|
181
181
|
return setContext(function (draftCtx) {
|
|
182
182
|
if (draftCtx.linkCard != null && draftCtx.allowEdit) {
|
|
183
183
|
draftCtx.linkCard.isEditing = true;
|
|
184
184
|
}
|
|
185
185
|
});
|
|
186
|
-
}), context.allowEdit === true && /*#__PURE__*/React.createElement("div", {
|
|
186
|
+
}), context.allowEdit === true && !context.isFlvReadOnly && (/*#__PURE__*/React.createElement("div", {
|
|
187
187
|
className: "divider"
|
|
188
|
-
}), context.allowEdit === true && renderToolbarButton("unlink", function () {
|
|
188
|
+
})), context.allowEdit === true && !context.isFlvReadOnly && renderToolbarButton("unlink", function () {
|
|
189
189
|
return setContext(function (draftCtx) {
|
|
190
190
|
_.set(refs.globalCache, "linkCard.mouseEnter", false);
|
|
191
191
|
removeHyperlink(draftCtx, r, c);
|
|
@@ -10,7 +10,7 @@ var __assign = this && this.__assign || function () {
|
|
|
10
10
|
};
|
|
11
11
|
import React, { useContext, useCallback, useRef, useEffect, useLayoutEffect, useMemo } from "react";
|
|
12
12
|
import "./index.css";
|
|
13
|
-
import { locale, drawArrow, handleCellAreaDoubleClick, handleCellAreaMouseDown, handleContextMenu, handleOverlayMouseMove, handleOverlayMouseUp, selectAll, handleOverlayTouchEnd, handleOverlayTouchStart, createDropCellRange, getCellRowColumn, getCellHyperlink, showLinkCard,
|
|
13
|
+
import { locale, drawArrow, handleCellAreaDoubleClick, handleCellAreaMouseDown, handleContextMenu, handleOverlayMouseMove, handleOverlayMouseUp, selectAll, handleOverlayTouchEnd, handleOverlayTouchStart, createDropCellRange, getCellRowColumn, getCellHyperlink, showLinkCard, isAllowEdit, onCellsMoveStart, insertRowCol, getSheetIndex, fixRowStyleOverflowInFreeze, fixColumnStyleOverflowInFreeze, handleKeydownForZoom } from "@fileverse-dev/fortune-core";
|
|
14
14
|
import _ from "lodash";
|
|
15
15
|
import WorkbookContext from "../../context";
|
|
16
16
|
import ColumnHeader from "./ColumnHeader";
|
|
@@ -76,19 +76,9 @@ var SheetOverlay = function SheetOverlay() {
|
|
|
76
76
|
var cellAreaDoubleClick = useCallback(function (e) {
|
|
77
77
|
var nativeEvent = e.nativeEvent;
|
|
78
78
|
setContext(function (draftCtx) {
|
|
79
|
-
if (!isAllowEdit(draftCtx)) {
|
|
80
|
-
var rc = getCellRowColumn(draftCtx, nativeEvent, containerRef.current, refs.scrollbarX.current, refs.scrollbarY.current);
|
|
81
|
-
if (rc != null) {
|
|
82
|
-
var link = getCellHyperlink(draftCtx, rc.r, rc.c);
|
|
83
|
-
if (link != null) {
|
|
84
|
-
goToLink(draftCtx, rc.r, rc.c, link.linkType, link.linkAddress, refs.scrollbarX.current, refs.scrollbarY.current);
|
|
85
|
-
return;
|
|
86
|
-
}
|
|
87
|
-
}
|
|
88
|
-
}
|
|
89
79
|
handleCellAreaDoubleClick(draftCtx, refs.globalCache, settings, nativeEvent, refs.cellArea.current);
|
|
90
80
|
});
|
|
91
|
-
}, [refs.cellArea, refs.globalCache,
|
|
81
|
+
}, [refs.cellArea, refs.globalCache, setContext, settings]);
|
|
92
82
|
var onLeftTopClick = useCallback(function () {
|
|
93
83
|
setContext(function (draftCtx) {
|
|
94
84
|
selectAll(draftCtx);
|
|
@@ -7,7 +7,6 @@
|
|
|
7
7
|
box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
|
|
8
8
|
border: 1px solid #e5e5e5;
|
|
9
9
|
border-radius: 8px;
|
|
10
|
-
min-width: 320px;
|
|
11
10
|
}
|
|
12
11
|
|
|
13
12
|
.fortune-link-cards-container {
|
|
@@ -23,7 +22,7 @@
|
|
|
23
22
|
border: 1px solid #e5e5e5;
|
|
24
23
|
border-radius: 8px;
|
|
25
24
|
padding: 16px;
|
|
26
|
-
width:
|
|
25
|
+
width: fit-content;
|
|
27
26
|
box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
|
|
28
27
|
display: flex;
|
|
29
28
|
flex-direction: column;
|
|
@@ -31,6 +30,10 @@
|
|
|
31
30
|
z-index: 300;
|
|
32
31
|
}
|
|
33
32
|
|
|
33
|
+
.fortune-link-card--editing {
|
|
34
|
+
min-width: 280px;
|
|
35
|
+
}
|
|
36
|
+
|
|
34
37
|
.fortune-link-type-select {
|
|
35
38
|
width: 100% !important;
|
|
36
39
|
}
|
|
@@ -181,20 +181,20 @@ var LinkEditCard = exports.LinkEditCard = function LinkEditCard(_a) {
|
|
|
181
181
|
"data-testid": "link-card-info-open"
|
|
182
182
|
}, linkType === "webpage" ? insertLink.openLink : (0, _fortuneCore.replaceHtml)(insertLink.goTo, {
|
|
183
183
|
linkAddress: linkAddress
|
|
184
|
-
})), context.allowEdit === true && /*#__PURE__*/_react.default.createElement("div", {
|
|
184
|
+
})), (context.allowEdit === true || context.isFlvReadOnly && linkType === "webpage") && (/*#__PURE__*/_react.default.createElement("div", {
|
|
185
185
|
className: "divider"
|
|
186
|
-
}), context.allowEdit === true && linkType === "webpage" && renderToolbarButton("copy", function () {
|
|
186
|
+
})), (context.allowEdit === true || context.isFlvReadOnly) && linkType === "webpage" && renderToolbarButton("copy", function () {
|
|
187
187
|
navigator.clipboard.writeText(originAddress);
|
|
188
188
|
hideLinkCard();
|
|
189
|
-
}), context.allowEdit === true && renderToolbarButton("pencil", function () {
|
|
189
|
+
}), context.allowEdit === true && !context.isFlvReadOnly && renderToolbarButton("pencil", function () {
|
|
190
190
|
return setContext(function (draftCtx) {
|
|
191
191
|
if (draftCtx.linkCard != null && draftCtx.allowEdit) {
|
|
192
192
|
draftCtx.linkCard.isEditing = true;
|
|
193
193
|
}
|
|
194
194
|
});
|
|
195
|
-
}), context.allowEdit === true && /*#__PURE__*/_react.default.createElement("div", {
|
|
195
|
+
}), context.allowEdit === true && !context.isFlvReadOnly && (/*#__PURE__*/_react.default.createElement("div", {
|
|
196
196
|
className: "divider"
|
|
197
|
-
}), context.allowEdit === true && renderToolbarButton("unlink", function () {
|
|
197
|
+
})), context.allowEdit === true && !context.isFlvReadOnly && renderToolbarButton("unlink", function () {
|
|
198
198
|
return setContext(function (draftCtx) {
|
|
199
199
|
_lodash.default.set(refs.globalCache, "linkCard.mouseEnter", false);
|
|
200
200
|
(0, _fortuneCore.removeHyperlink)(draftCtx, r, c);
|
|
@@ -85,19 +85,9 @@ var SheetOverlay = function SheetOverlay() {
|
|
|
85
85
|
var cellAreaDoubleClick = (0, _react.useCallback)(function (e) {
|
|
86
86
|
var nativeEvent = e.nativeEvent;
|
|
87
87
|
setContext(function (draftCtx) {
|
|
88
|
-
if (!(0, _fortuneCore.isAllowEdit)(draftCtx)) {
|
|
89
|
-
var rc = (0, _fortuneCore.getCellRowColumn)(draftCtx, nativeEvent, containerRef.current, refs.scrollbarX.current, refs.scrollbarY.current);
|
|
90
|
-
if (rc != null) {
|
|
91
|
-
var link = (0, _fortuneCore.getCellHyperlink)(draftCtx, rc.r, rc.c);
|
|
92
|
-
if (link != null) {
|
|
93
|
-
(0, _fortuneCore.goToLink)(draftCtx, rc.r, rc.c, link.linkType, link.linkAddress, refs.scrollbarX.current, refs.scrollbarY.current);
|
|
94
|
-
return;
|
|
95
|
-
}
|
|
96
|
-
}
|
|
97
|
-
}
|
|
98
88
|
(0, _fortuneCore.handleCellAreaDoubleClick)(draftCtx, refs.globalCache, settings, nativeEvent, refs.cellArea.current);
|
|
99
89
|
});
|
|
100
|
-
}, [refs.cellArea, refs.globalCache,
|
|
90
|
+
}, [refs.cellArea, refs.globalCache, setContext, settings]);
|
|
101
91
|
var onLeftTopClick = (0, _react.useCallback)(function () {
|
|
102
92
|
setContext(function (draftCtx) {
|
|
103
93
|
(0, _fortuneCore.selectAll)(draftCtx);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@fileverse-dev/fortune-react",
|
|
3
|
-
"version": "1.3.4-viewMode-
|
|
3
|
+
"version": "1.3.4-viewMode-3",
|
|
4
4
|
"main": "lib/index.js",
|
|
5
5
|
"types": "lib/index.d.ts",
|
|
6
6
|
"module": "es/index.js",
|
|
@@ -16,7 +16,7 @@
|
|
|
16
16
|
"tsc": "tsc"
|
|
17
17
|
},
|
|
18
18
|
"dependencies": {
|
|
19
|
-
"@fileverse-dev/fortune-core": "1.3.4-viewMode-
|
|
19
|
+
"@fileverse-dev/fortune-core": "1.3.4-viewMode-3",
|
|
20
20
|
"@fileverse/ui": "5.0.0",
|
|
21
21
|
"@tippyjs/react": "^4.2.6",
|
|
22
22
|
"@types/regenerator-runtime": "^0.13.6",
|