@voplus/morpho-document 6.1.57 → 6.1.58
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.
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import React from "react";
|
|
1
|
+
import React, { useState } from "react";
|
|
2
2
|
import { Paste, PasteLinks, PasteShortcut } from "./items";
|
|
3
3
|
import { Button, Dropdown } from "antd";
|
|
4
4
|
import { observe } from "@voplus/morpho-ui";
|
|
@@ -8,12 +8,16 @@ import { faPaste } from "@fortawesome/pro-light-svg-icons";
|
|
|
8
8
|
import { useSelectNodeInfoService } from "@voplus/morpho-document-core";
|
|
9
9
|
import classnames from "classnames";
|
|
10
10
|
const SubPasteMenu = (props) => {
|
|
11
|
-
const select = useSelectNodeInfoService();
|
|
12
11
|
const { user } = useApplicationContext();
|
|
12
|
+
const [forceUpdate, setForceUpdate] = useState(0);
|
|
13
|
+
const select = useSelectNodeInfoService();
|
|
13
14
|
return observe(() => !user.info.guest ? (React.createElement(Dropdown, { overlayStyle: { zIndex: 99999 }, dropdownRender: () => (React.createElement("div", { className: classnames("sub-node-menu"), style: { left: "-172px", width: "160px" } },
|
|
14
|
-
React.createElement(Paste, { ...props.pasteProps, selectState: select }),
|
|
15
|
-
React.createElement(PasteLinks, { ...props.pasteProps, selectState: select }),
|
|
16
|
-
React.createElement(PasteShortcut, { ...props.pasteProps, selectState: select })))
|
|
15
|
+
React.createElement(Paste, { key: forceUpdate, ...props.pasteProps, selectState: select }),
|
|
16
|
+
React.createElement(PasteLinks, { key: forceUpdate + 1000, ...props.pasteProps, selectState: select }),
|
|
17
|
+
React.createElement(PasteShortcut, { key: forceUpdate + 2000, ...props.pasteProps, selectState: select }))), onOpenChange: (open) => {
|
|
18
|
+
if (open)
|
|
19
|
+
setForceUpdate((v) => v + 1);
|
|
20
|
+
} },
|
|
17
21
|
React.createElement(Button, { type: "link", className: "document-menu-paste-dropdown" }, props.text ? (props.text) : (React.createElement(React.Fragment, null,
|
|
18
22
|
React.createElement(FAIcon, { icon: faPaste }),
|
|
19
23
|
"Paste"))))) : null);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SubPasteDropdown.js","sourceRoot":"","sources":["../../../src/controls/DocumentMenu/SubPasteDropdown.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"SubPasteDropdown.js","sourceRoot":"","sources":["../../../src/controls/DocumentMenu/SubPasteDropdown.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AACxC,OAAO,EAAE,KAAK,EAAE,UAAU,EAAE,aAAa,EAAE,MAAM,SAAS,CAAC;AAC3D,OAAO,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,MAAM,CAAC;AAExC,OAAO,EAAE,OAAO,EAAE,MAAM,mBAAmB,CAAC;AAC5C,OAAO,EAAE,qBAAqB,EAAE,MAAM,qBAAqB,CAAC;AAC5D,OAAO,EAAE,eAAe,IAAI,MAAM,EAAE,MAAM,gCAAgC,CAAC;AAC3E,OAAO,EAAE,OAAO,EAAE,MAAM,kCAAkC,CAAC;AAC3D,OAAO,EAAE,wBAAwB,EAAE,MAAM,8BAA8B,CAAC;AACxE,OAAO,UAAU,MAAM,YAAY,CAAC;AAEpC,MAAM,YAAY,GAAG,CAAC,KAIrB,EAAE,EAAE;IACJ,MAAM,EAAE,IAAI,EAAE,GAAG,qBAAqB,EAAE,CAAC;IAEzC,MAAM,CAAC,WAAW,EAAE,cAAc,CAAC,GAAG,QAAQ,CAAC,CAAC,CAAC,CAAC;IAElD,MAAM,MAAM,GAAG,wBAAwB,EAAE,CAAC;IAE1C,OAAO,OAAO,CAAC,GAAG,EAAE,CACnB,CAAC,IAAI,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,CAClB,oBAAC,QAAQ,IACR,YAAY,EAAE,EAAE,MAAM,EAAE,KA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