oolib 2.71.0 → 2.71.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/components/ImageInput/comps/ImageEditor/comps/ImageActionsMenu/index.d.ts +2 -1
- package/dist/components/ImageInput/comps/ImageEditor/comps/ImageActionsMenu/index.js +9 -4
- package/dist/components/ImageInput/comps/ImageEditor/index.js +1 -0
- package/dist/components/cards/CardContent/index.js +1 -1
- package/dist/components/cards/CardEmbed/index.js +1 -1
- package/dist/components/cards/ListContent/index.js +1 -1
- package/package.json +1 -1
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
export function ImageActionsMenu({ invert, setUnderEditImageData, setImageUnderEdit, setShowDeleteImageModal, publicUrl, imageData, handleReplaceSingleImage, handleUpload, isInRTE }: {
|
|
1
|
+
export function ImageActionsMenu({ id, invert, setUnderEditImageData, setImageUnderEdit, setShowDeleteImageModal, publicUrl, imageData, handleReplaceSingleImage, handleUpload, isInRTE }: {
|
|
2
|
+
id: any;
|
|
2
3
|
invert: any;
|
|
3
4
|
setUnderEditImageData: any;
|
|
4
5
|
setImageUnderEdit: any;
|
|
@@ -39,7 +39,7 @@ var lodash_1 = require("lodash");
|
|
|
39
39
|
var ActionMenu_1 = require("../../../../../ActionMenu");
|
|
40
40
|
var react_1 = __importStar(require("react"));
|
|
41
41
|
var ImageActionsMenu = function (_a) {
|
|
42
|
-
var invert = _a.invert, setUnderEditImageData = _a.setUnderEditImageData, setImageUnderEdit = _a.setImageUnderEdit, setShowDeleteImageModal = _a.setShowDeleteImageModal, publicUrl = _a.publicUrl, imageData = _a.imageData, handleReplaceSingleImage = _a.handleReplaceSingleImage, handleUpload = _a.handleUpload, isInRTE = _a.isInRTE;
|
|
42
|
+
var id = _a.id, invert = _a.invert, setUnderEditImageData = _a.setUnderEditImageData, setImageUnderEdit = _a.setImageUnderEdit, setShowDeleteImageModal = _a.setShowDeleteImageModal, publicUrl = _a.publicUrl, imageData = _a.imageData, handleReplaceSingleImage = _a.handleReplaceSingleImage, handleUpload = _a.handleUpload, isInRTE = _a.isInRTE;
|
|
43
43
|
var inputRef = (0, react_1.useRef)(null);
|
|
44
44
|
return (react_1.default.createElement("div", { style: __assign({ padding: "0.5rem" }, (isInRTE ? { display: 'none' } : {})) },
|
|
45
45
|
react_1.default.createElement("input", { ref: inputRef, type: "file", accept: "image/*", onChange: function (e) {
|
|
@@ -58,7 +58,12 @@ var ImageActionsMenu = function (_a) {
|
|
|
58
58
|
}, style: { display: "none" } }),
|
|
59
59
|
react_1.default.createElement(ActionMenu_1.ActionMenu, { popOutOfOverflowHiddenParent: true, ButtonComp: "ButtonPrimary", iconSize: "M", invert: invert, actions: [
|
|
60
60
|
{
|
|
61
|
-
|
|
61
|
+
/**
|
|
62
|
+
* imp. to attach this comp id to this action's id so that when a
|
|
63
|
+
* click is triggered from outside (ImageInputNode Lexical), it
|
|
64
|
+
* indeed clicks this button and not the button of some other ImageInput
|
|
65
|
+
*/
|
|
66
|
+
id: "".concat(id, "_editImage"),
|
|
62
67
|
display: "Edit",
|
|
63
68
|
onClick: function (e) {
|
|
64
69
|
setUnderEditImageData((0, lodash_1.cloneDeep)(imageData));
|
|
@@ -66,12 +71,12 @@ var ImageActionsMenu = function (_a) {
|
|
|
66
71
|
},
|
|
67
72
|
},
|
|
68
73
|
{
|
|
69
|
-
id:
|
|
74
|
+
id: "".concat(id, "_replaceImage"),
|
|
70
75
|
display: "Replace",
|
|
71
76
|
onClick: function () { return inputRef.current.click(); },
|
|
72
77
|
},
|
|
73
78
|
{
|
|
74
|
-
id:
|
|
79
|
+
id: "".concat(id, "_deleteImage"),
|
|
75
80
|
display: "Delete",
|
|
76
81
|
onClick: function (e) { return setShowDeleteImageModal({ publicUrl: publicUrl }); },
|
|
77
82
|
},
|
|
@@ -184,6 +184,7 @@ function ImageEditor(_a) {
|
|
|
184
184
|
containerShape: containerShape,
|
|
185
185
|
isInPopUp: isInPopUp,
|
|
186
186
|
}), underEditImageData === undefined ? (react_1.default.createElement(ImageActionsMenu_1.ImageActionsMenu, __assign({}, {
|
|
187
|
+
id: id,
|
|
187
188
|
invert: invert,
|
|
188
189
|
setUnderEditImageData: setUnderEditImageData,
|
|
189
190
|
setImageUnderEdit: setImageUnderEdit,
|
|
@@ -36,7 +36,7 @@ var CardContent = function (_a) {
|
|
|
36
36
|
return dontRenderRes;
|
|
37
37
|
var _c = (0, decideLinkCompAndTarget_1.decideLinkCompAndTarget)({ to: to, openInNewTab: openInNewTab }), LinkComp = _c.LinkComp, target = _c.target, externalUrl = _c.externalUrl;
|
|
38
38
|
return (react_1.default.createElement(LinkComp, { target: target, href: (0, injectHttps_1.injectHttps)(to), to: to },
|
|
39
|
-
react_1.default.createElement(styled_2.StyledCardWrapper, { id: id, onClick: onClick },
|
|
39
|
+
react_1.default.createElement(styled_2.StyledCardWrapper, { id: id, onClick: function (e) { return onClick(e, data); } },
|
|
40
40
|
react_1.default.createElement(styled_2.StyledUpperSection, null,
|
|
41
41
|
react_1.default.createElement(styled_2.StyledContainer1, null,
|
|
42
42
|
cardLabel ? (react_1.default.createElement("div", { title: cardLabel, style: {
|
|
@@ -61,7 +61,7 @@ var CardEmbed = function (_a) {
|
|
|
61
61
|
var mediaConfigExists = config.video || config.image;
|
|
62
62
|
// if (status === "error") return <ErrorEmbedComp to={to} />;
|
|
63
63
|
return (react_1.default.createElement(LinkComp, { target: target, href: (0, injectHttps_1.injectHttps)(to), to: to },
|
|
64
|
-
react_1.default.createElement(styled_2.StyledEmbedCardWrapper, { id: id, disabled: disabled, onClick: onClick },
|
|
64
|
+
react_1.default.createElement(styled_2.StyledEmbedCardWrapper, { id: id, disabled: disabled, onClick: function (e) { return onClick(e, data); } },
|
|
65
65
|
react_1.default.createElement(styled_2.StyledContentModule1, { mediaConfigExists: mediaConfigExists },
|
|
66
66
|
cardLabel && (react_1.default.createElement("div", { style: { paddingBottom: "0.7rem" }, title: cardLabel },
|
|
67
67
|
react_1.default.createElement(styled_1.StyledLabel, { disabled: disabled, color: (0, utilsOolib_1.getPrimaryColorText)(theme === null || theme === void 0 ? void 0 : theme.colors) }, cardLabel))),
|
|
@@ -43,7 +43,7 @@ var ListContent = function (_a) {
|
|
|
43
43
|
}), LinkComp = _d.LinkComp, target = _d.target, externalUrl = _d.externalUrl;
|
|
44
44
|
var mediaConfigExists = config.video || config.image;
|
|
45
45
|
return (react_1.default.createElement(LinkComp, { target: target, href: (0, injectHttps_1.injectHttps)(to), to: to },
|
|
46
|
-
react_1.default.createElement(styled_js_1.StyledListElemContainer, { id: id, onClick: onClick },
|
|
46
|
+
react_1.default.createElement(styled_js_1.StyledListElemContainer, { id: id, onClick: function (e) { return onClick(e, data); } },
|
|
47
47
|
react_1.default.createElement(styled_js_1.StyledListWrapper, { mediaConfigExists: mediaConfigExists /*cuz if it does space needs to be allocated for it */, actions: actions },
|
|
48
48
|
react_1.default.createElement(styled_js_1.StyledHeader, null,
|
|
49
49
|
(cardLabel || statusTag) &&
|