oolib 2.188.3 → 2.188.5
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.
|
@@ -84,8 +84,8 @@ function ImageEditor(_a) {
|
|
|
84
84
|
//backwards compat
|
|
85
85
|
_e = _c.richTextHasValue,
|
|
86
86
|
//backwards compat
|
|
87
|
-
richTextHasValue = _e === void 0 ? function () { return false; } : _e; //temporarily passed thru from okf
|
|
88
|
-
var
|
|
87
|
+
richTextHasValue = _e === void 0 ? function () { return false; } : _e, _f = _c.allTpls, allTpls = _f === void 0 ? [] : _f; //temporarily passed thru from okf
|
|
88
|
+
var _g = (0, react_1.useState)(_underEditImageData || undefined), underEditImageData = _g[0], setUnderEditImageData = _g[1];
|
|
89
89
|
var screenWidth = (0, _EXPORTS_1.useScreenWidth)();
|
|
90
90
|
//set state in parent imageeditor
|
|
91
91
|
(0, react_1.useEffect)(function () {
|
|
@@ -100,15 +100,15 @@ function ImageEditor(_a) {
|
|
|
100
100
|
* underEditImageData is merged into imageData, only if the 'formattings'
|
|
101
101
|
* are 'saved'
|
|
102
102
|
*/
|
|
103
|
-
var
|
|
103
|
+
var _h = underEditImageData || imageData, publicUrl = _h.publicUrl, _j = _h.imageSpread, imageSpread = _j === void 0 ? defaultImageSpread : _j, _k = _h.imageRotate, imageRotate = _k === void 0 ? 0 : _k, _l = _h.cropX, cropX = _l === void 0 ? 0 : _l, _m = _h.cropY, cropY = _m === void 0 ? 0 : _m;
|
|
104
104
|
/**
|
|
105
105
|
* repos management
|
|
106
106
|
*/
|
|
107
107
|
var wrapperRef = (0, react_1.useRef)(null);
|
|
108
108
|
var renderedImageRef = (0, react_1.useRef)(null);
|
|
109
109
|
var isFirstMount = (0, react_1.useRef)(true);
|
|
110
|
-
var
|
|
111
|
-
var
|
|
110
|
+
var _o = (0, react_1.useState)(undefined), fullWidthOrFullHeightImg = _o[0], setFullWidthOrFullHeightImg = _o[1];
|
|
111
|
+
var _p = (0, useReorientImage_1.useReorientImage)({
|
|
112
112
|
imageRotate: imageRotate,
|
|
113
113
|
setFullWidthOrFullHeightImg: setFullWidthOrFullHeightImg,
|
|
114
114
|
setUnderEditImageData: setUnderEditImageData,
|
|
@@ -118,10 +118,10 @@ function ImageEditor(_a) {
|
|
|
118
118
|
isFirstMount: isFirstMount,
|
|
119
119
|
handleDeleteSingleImage: handleDeleteSingleImage,
|
|
120
120
|
readOnly: readOnly
|
|
121
|
-
}), reorientedImageTempUrl =
|
|
122
|
-
var
|
|
121
|
+
}), reorientedImageTempUrl = _p.reorientedImageTempUrl, imageLazyLoading = _p.imageLazyLoading;
|
|
122
|
+
var _q = (0, react_1.useState)(undefined), showDeleteImageModal = _q[0], setShowDeleteImageModal = _q[1];
|
|
123
123
|
var inputRef = (0, react_1.useRef)(null);
|
|
124
|
-
var
|
|
124
|
+
var _r = (0, react_1.useState)(undefined), editorStyle = _r[0], setEditorStyle = _r[1]; //alt: modal
|
|
125
125
|
(0, react_1.useEffect)(function () { isFirstMount.current = false; }, []);
|
|
126
126
|
var decideEditorStyle = function () {
|
|
127
127
|
var _a = wrapperRef.current.getBoundingClientRect(), width = _a.width, height = _a.height;
|
|
@@ -183,7 +183,7 @@ function ImageEditor(_a) {
|
|
|
183
183
|
readOnly && react_1.default.createElement(Divider_1.Divider, { invert: invert }))),
|
|
184
184
|
(imageTags === null || imageTags === void 0 ? void 0 : imageTags.enable) &&
|
|
185
185
|
((_b = imageTags === null || imageTags === void 0 ? void 0 : imageTags.config) === null || _b === void 0 ? void 0 : _b.map(function (_a) {
|
|
186
|
-
var _b;
|
|
186
|
+
var _b, _c, _d, _e;
|
|
187
187
|
var comp = _a.comp, tagCategory = _a.tagCategory;
|
|
188
188
|
var compsLookup = {
|
|
189
189
|
TagsInputMulti: TagsInputMulti,
|
|
@@ -192,7 +192,7 @@ function ImageEditor(_a) {
|
|
|
192
192
|
var Comp = compsLookup[comp];
|
|
193
193
|
if (!Comp)
|
|
194
194
|
return react_1.default.createElement("div", null, "placeholder for tag input");
|
|
195
|
-
return (react_1.default.createElement(Comp, { tagType: tagCategory, value: (
|
|
195
|
+
return (react_1.default.createElement(Comp, { label: ((_d = (_c = (_b = allTpls.find(function (tpl) { return tpl.kp_content_type === tagCategory; })) === null || _b === void 0 ? void 0 : _b.general) === null || _c === void 0 ? void 0 : _c.content) === null || _d === void 0 ? void 0 : _d.title) || tagCategory, popOutOfOverflowHiddenParent: true, tagType: tagCategory, value: (_e = imageData.tags) === null || _e === void 0 ? void 0 : _e[tagCategory], onChange: function (id, val) {
|
|
196
196
|
var _a;
|
|
197
197
|
handleSingleImageDataChange({
|
|
198
198
|
publicUrl: publicUrl,
|