useblocks 1.1.53 → 1.1.60
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/iframe/js/amp.BP7EklKo.js +1 -1
- package/iframe/js/iframe-eblock.js +1 -1
- package/iframe/js/iframe.js +1 -1
- package/iframe/js/rules.4N5s3OV-.js +1 -1
- package/npm-publish.manifest.json +7 -7
- package/package.json +1 -7
- package/runtime/THIRD_PARTY_LICENSES.txt +0 -235
- package/runtime/index.js +0 -2
- package/runtime/package.json +0 -6
- package/runtime/plugin-dev-manifest.json +0 -4
- package/singlepage_headless_plugin.html +1 -1
- package/static/core/{5318562c.js → 161d1254.js} +268 -257
- package/static/core/{b9f47840.js → 17d3ee0b.js} +8 -8
- package/static/core/{6895dd352.js → 195ca4a32.js} +15 -15
- package/static/core/{dc1f9e4f.js → 2569fac8.js} +26 -26
- package/static/core/{4ca527032.js → 26ddf93e2.js} +2 -2
- package/static/core/{9929a348.js → 30c5fe5f.js} +90 -90
- package/static/core/{e93d55b92.js → 3af8f3592.js} +4 -4
- package/static/core/{ebd852b6.js → 40f73dfb.js} +1019 -1032
- package/static/core/{c3058168.js → 43c3f160.js} +3283 -3189
- package/static/core/{542ea53f2.js → 4a27bba92.js} +8 -8
- package/static/core/4c39852e.js +3150 -0
- package/static/core/{e5e07f1d.js → 4e75b331.js} +13 -13
- package/static/core/{e1d239ab.js → 5345bef8.js} +42 -42
- package/static/core/{31e98e6e.js → 53463a60.js} +707 -712
- package/static/core/{27544e7e.js → 581ce428.js} +37 -19
- package/static/core/{d8daf1142.js → 6156301b2.js} +3 -3
- package/static/core/{c3849484.js → 64bea1a9.js} +5 -5
- package/static/core/{ce4fc17f2.js → 680236f4.js} +1 -1
- package/static/core/{4b75d16c2.js → 687795b52.js} +4 -4
- package/static/core/{70407ac0.js → 72f86b2d.js} +3 -3
- package/static/core/{139e4380.js → 7a15fa8b.js} +3 -3
- package/static/core/{b77f0769.js → 8432f11e.js} +5 -5
- package/static/core/{d1eb3c68.js → 8815eb5b.js} +15670 -15289
- package/static/core/{f3cff4c9.js → 8a496b64.js} +158 -158
- package/static/core/{4e1b970f.js → 8ba13f332.js} +1 -1
- package/static/core/{75737a9d.js → 951903fb.js} +9096 -9074
- package/static/core/{a95c02bb.js → a1355a35.js} +5 -5
- package/static/core/{7c6fb2162.js → a36c3ab62.js} +3 -3
- package/static/core/{2da1d66b.js → abd3f34c.js} +5 -5
- package/static/core/{528ad9282.js → ae20f0992.js} +16 -16
- package/static/core/ba6c356e.js +466 -0
- package/static/core/{ee0ddb51.js → c9e59b34.js} +6884 -4960
- package/static/core/{f96d2049.js → d1a1d4902.js} +1 -1
- package/static/core/{5b48fd69.js → d8d6485e.js} +5 -5
- package/static/core/{59e92cc3.js → d9398296.js} +5 -5
- package/static/core/{b408f33a.js → d9baa55e.js} +25 -25
- package/static/core/dbf19c2e.js +811 -0
- package/static/core/{bc7e3d2b.js → f953827c.js} +10 -10
- package/static/core/{1e5bf73c.js → ffee9a77.js} +7 -7
- package/static/esm/2474de05.js +131 -0
- package/static/esm/{d180c108.js → 53b688bd.js} +66 -85
- package/two_step_headless_plugin.html +1 -1
- package/useblocks-core.f6bb8947.js +673 -0
- package/useblocks-esm.js +875 -552
- package/useblocks.d.ts +8 -0
- package/useblocks.js +691 -408
- package/runtime/prop-types/index.js +0 -4
- package/runtime/react-router-dom/index.js +0 -2
- package/static/core/1995fb0a2.js +0 -602
- package/static/core/1f5e1fc9.js +0 -3097
- package/static/core/ce0410b1.js +0 -467
- package/static/esm/448d4bb0.js +0 -127
- package/static/runtime/dom-export-CHgQ7Ws9.js +0 -8069
- package/static/runtime/prop-types-p_yYKrF7.js +0 -47
- package/useblocks-core.2a5dade1.js +0 -643
- /package/iframe/{iframe-eblock.2a5dade1.html → iframe-eblock.f6bb8947.html} +0 -0
- /package/iframe/{iframe.2a5dade1.html → iframe.f6bb8947.html} +0 -0
|
@@ -1,27 +1,24 @@
|
|
|
1
1
|
(function(){try{if(typeof document<"u"){var o=document.createElement("style");o.setAttribute("data-useblocks","true"),o.appendChild(document.createTextNode(".blocks-app .image-preview{text-align:center;min-height:100px;position:relative}.blocks-app .image-preview .image-editor-modal{border:1px solid red}.blocks-app .image-preview__edit-button{position:absolute;bottom:10px;left:50%;transform:translate(-50%)}.blocks-app .image-preview img{border:1px solid var(--colorBorder);border-radius:6px;max-width:100%;max-height:500px}.blocks-app .image-editor-modal .ant-modal-container{flex-direction:column;min-height:100vh;display:flex;border-radius:0!important}.blocks-app .image-editor-modal .ant-modal-body{flex-grow:1;display:flex}.blocks-app .image-editor-modal .ant-modal-body #pixie-editor{flex-grow:1;height:calc(100vh - 70px);min-height:calc(100vh - 70px);overflow:hidden}.blocks-app .image-editor-modal .pi .text-on-primary{background:var(--colorPrimary);border-color:var(--colorPrimary)}.blocks-app .image-editor-modal .pi .text-on-primary:hover{background:var(--colorPrimaryHover);border-color:var(--colorPrimaryHover)}.blocks-app .image-editor-modal .pi .text-on-primary.rounded-full{border-radius:calc(var(--borderRadius) * 1px)}.blocks-app .image-editor-modal .pi .shadow-xl{box-shadow:none}.blocks-app .image-editor-modal .w-\\[4ch\\].text-sm.text-center{width:5ch}.blocks-app .image-editor-modal .pi .border-white{border-color:var(--colorPrimary)}.blocks-app .image-editor-modal .pi .bg-white\\/50{background-color:var(--colorPrimary)}.blocks-app .image-editor-modal .pi .text-on-primary{color:var(--colorWhite)}.blocks-app .serach-results .ant-row{align-items:center}.blocks-app .serach-results .blocks-search__divider-wrapper{margin-top:12px;position:relative}.blocks-app .serach-results .blocks-search__divider-wrapper .ant-divider-horizontal{border-top:1px solid var(--colorBorderSecondary);background:0 0;width:100%;height:1px;min-height:0;margin:0;position:static}.blocks-app .slideshow-container{width:524px;height:350px;margin:auto;position:relative;overflow:hidden}.blocks-app .slideshow-image{opacity:0;width:100%;height:100%;position:absolute;top:0;left:0}.blocks-app .image-ai .slideshow-image{width:auto;height:auto}.blocks-app .image-ai__image-item{text-align:center;border-radius:6px;justify-content:center;align-items:center;min-height:100px;display:flex;position:relative}.blocks-app .image-ai__image-item .buttons{justify-content:space-between;display:flex;position:absolute;bottom:10px;left:50%;transform:translate(-50%)}.blocks-app .image-ai .text-area-input-hybrid{border:none;outline:none;min-height:0;padding:0 0 0 1px}.blocks-app .image-ai .text-area-input-hybrid textarea{height:32px;min-height:32px;padding:3px 11px;line-height:26px}.blocks-app .image-ai__loading{justify-content:center;align-items:center;min-height:150px;display:flex}.blocks-app .image-ai__loading .spin{flex-direction:column;justify-content:center;align-items:center;height:150px;display:flex}.blocks-app .image-ai__loading .status{margin:3px 0 0}.blocks-app .image-ai__preview{border-radius:6px;margin-top:24px;overflow:hidden}.blocks-app .image-ai__preview .image-ai__image-item img{border-radius:calc(var(--borderRadius) * 1px);object-fit:contain;max-height:100%;transition:height 1s;top:50%;left:50%;overflow:hidden;transform:translate(-50%,-50%)}.blocks-app .image-ai .small{width:302px;height:202px}.blocks-app .image-ai .large{width:524px;height:350px}.blocks-app .image-ai .image-ai__row{padding:0 2px}.blocks-app .image-ai .image-ai__input-affix-wrapper{border-style:solid;border-width:calc(var(--borderWidth) * 1px);border-color:var(--colorFillSecondaryDarken);border-radius:calc(var(--borderRadius) * 1px);width:100%;padding-left:0;display:inline-flex}.blocks-app .image-ai .image-ai__input-affix-wrapper:hover{border-color:var(--borderColorHover)}.blocks-app .image-ai .image-ai__input-affix-wrapper.ant-input-affix-wrapper-focused{border-color:var(--colorPrimaryBorder)}.blocks-app .image-ai .image-ai__textarea{font-size:16px}.blocks-app .image-ai .image-ai__input-icon{font-size:16px;top:0;right:0}.dark .blocks-app .image-ai .image-ai__preview .image-ai__image-item img{background:#2b2b2b;border:1px solid #434343}.dark .blocks-app .image-ai .ant-btn{background:#1f1f1f}.dark .blocks-app .image-ai .ant-btn:hover{color:var(--colorPrimary)}.blocks-app .stock-tab img{border-radius:0;max-width:none;max-height:none}.blocks-app .stock-tab .stock-search-input{padding:0 2px}.blocks-app .stock-tab .my-masonry-grid{text-align:center;width:auto;display:flex}.blocks-app .stock-tab .my-masonry-grid_column{background-clip:padding-box}.blocks-app .stock-tab .list-item{cursor:pointer;background:#f0f2f5;border:1px solid #f0f2f5;border-radius:6px;min-height:100px;max-height:100px;margin-bottom:20px;transition:all .3s;display:inline-block;position:relative;overflow:hidden}.blocks-app .stock-tab .list-item .overlay-image{opacity:0;background-size:cover;width:110px;height:40px;transition:opacity .5s;position:absolute;bottom:10px;right:10px}.blocks-app .stock-tab .list-item .ant-spin{color:#f0f2f5;font-size:20px;position:absolute;top:50%;left:50%;transform:translate(-50%,-50%)}.blocks-app .stock-tab .list-item img{object-fit:cover;opacity:0;border-radius:6px;height:auto;transition:opacity .5s ease-in-out;display:block}.blocks-app .stock-tab .list-item.loaded{border:1px solid #d9d9d9;max-height:1000px}.blocks-app .stock-tab .list-item.loaded img{opacity:1;height:100%}.blocks-app .stock-tab .list-item.loaded .loaded-image{opacity:.5}.blocks-app .stock-tab .list-item:hover{box-shadow:0 1px 2px -2px #00000029,0 3px 6px #0000001f,0 5px 12px 4px #00000017}.blocks-app .stock-tab .list-item:hover p.creator-info,.blocks-app .stock-tab .list-item:hover .overlay-image{opacity:1}.blocks-app .stock-tab .list-item p.creator-info{color:#fff;opacity:0;background-color:#00000080;border-radius:0 0 6px;margin:0;padding:5px;font-size:10px;line-height:1.2;position:absolute;bottom:0;right:0}.blocks-app .stock-tab .list-item p.creator-info:hover a{color:#fff;text-decoration:underline}.blocks-app .stock-tab .list-item p.creator-info a{color:#fff;text-decoration:none}.blocks-app .stock-color-filter{display:flex}.blocks-app .stock-color-filter label{border-width:1px;width:24px;height:24px;margin:4px;padding:0;font-size:0;border-radius:6px!important}.blocks-app .stock-color-filter label.all-colors{background-image:linear-gradient(135deg,red,#ff7f00,#ff0,#0f0,#00f,#8b00ff)}.blocks-app .stock-color-filter label.black-color{background:#222}.blocks-app .stock-color-filter label.bw-color{background-image:linear-gradient(135deg,#222 50%,#fff 50%)}.blocks-app .stock-color-filter label.white-color{background:#fff}.blocks-app .stock-color-filter label.orange-color{background:#fa8c16}.blocks-app .stock-color-filter label.red-color{background:#f5222d}.blocks-app .stock-color-filter label.purple-color{background:#722ed1}.blocks-app .stock-color-filter label.magenta-color{background:#eb2f96}.blocks-app .stock-color-filter label.green-color{background:#52c41a}.blocks-app .stock-color-filter label.teal-color{background:#43c3c3}.blocks-app .stock-color-filter label.blue-color{background:#1677ff}.blocks-app .stock-color-filter .ant-radio-button-wrapper:not(:first-child):before{display:none}.blocks-app .serach-results{padding-top:6px}.blocks-app .serach-results .stock-search-input{width:322px;padding:0 2px}.blocks-app .serach-results .blocks-search__divider-wrapper{width:calc(100% + 48px);margin-top:12px;margin-left:-24px;margin-right:-24px;position:relative}.blocks-app .serach-results .blocks-search__divider-wrapper .ant-divider-horizontal{pointer-events:none;border-top:1px solid var(--colorBorderSecondary);background:linear-gradient(180deg, var(--colorBgContainerDisabled), transparent 40%);border-bottom:none;width:100%;height:20px;min-height:20px;margin:0;position:relative;bottom:auto;left:auto;right:auto}.dark .blocks-app .image-center .stock-tab .serach-results .blocks-search__divider-wrapper .ant-divider-horizontal{background:linear-gradient(180deg, var(--colorBgBase), transparent 40%)}.dark .blocks-app .stock-tab .list-item{background:#2b2b2b;border:1px solid #2b2b2b}.dark .blocks-app .stock-tab .list-item.loaded{border:1px solid #434343}.blocks-app .image-center .image-center-image-preview{justify-content:center;align-items:center;display:flex}.blocks-app .image-center .ant-divider-horizontal{pointer-events:none;z-index:1;background:linear-gradient(180deg, var(--colorBgContainerDisabled), transparent 40%);width:calc(100% + 48px);height:20px;margin:24px -24px 0;position:absolute;bottom:-19px}.dark .blocks-app .image-center .ant-divider-horizontal{background:linear-gradient(180deg, var(--colorBgBase), transparent 40%)}.blocks-app .image-center .ant-divider-horizontal.ant-divider-with-text{background:0 0;width:calc(100% + 38px);margin:0 -24px 20px;position:relative;top:0}.blocks-app .image-center img{border-radius:4px;max-width:524px;max-height:352px}.blocks-app .image-center .image-size{justify-content:center;margin-top:6px;font-size:14px;line-height:22px;display:flex}.blocks-app .image-center .ant-upload.ant-upload-drag{border-radius:6px}.blocks-app .image-center .ant-modal-body .stock-search-input{margin-bottom:0}.blocks-app .image-center .ant-modal-body .serach-results .stock-search-input{margin-bottom:10px}.blocks-app .image-center .ant-modal-body .ant-form:not(.serach-results) .ant-form-item:last-child{margin-bottom:0}.blocks-app .image-center .ant-modal-body .ant-tabs{transition:all .7s cubic-bezier(.075,.82,.165,1)}.blocks-app .image-center .ant-modal-body .ant-tabs .ant-tabs-content-holder{overflow-y:clip}.blocks-app .ant-modal{transition:width .7s ease-in-out}")),document.head.appendChild(o)}}catch(a){console.error("vite-plugin-css-injected-by-js",a)}})();
|
|
2
|
-
__useblocks__.define("static/core/
|
|
2
|
+
__useblocks__.define("static/core/53463a60.js", [
|
|
3
3
|
"require",
|
|
4
4
|
"exports",
|
|
5
5
|
"module",
|
|
6
6
|
"static/core/bd36b180.js",
|
|
7
|
-
"static/core/
|
|
8
|
-
"static/core/
|
|
9
|
-
"static/core/
|
|
10
|
-
"static/core/
|
|
11
|
-
"static/core/
|
|
12
|
-
"static/core/
|
|
7
|
+
"static/core/c9e59b34.js",
|
|
8
|
+
"static/core/161d1254.js",
|
|
9
|
+
"static/core/4c39852e.js",
|
|
10
|
+
"static/core/40f73dfb.js",
|
|
11
|
+
"static/core/951903fb.js",
|
|
12
|
+
"static/core/dbf19c2e.js",
|
|
13
13
|
"react",
|
|
14
|
-
"prop-types",
|
|
15
|
-
"react-router-dom",
|
|
16
14
|
"react/jsx-runtime"
|
|
17
|
-
], function(
|
|
18
|
-
const
|
|
19
|
-
let n =
|
|
20
|
-
n =
|
|
21
|
-
let
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
function bt(t, e) {
|
|
15
|
+
], function(de, gt, ln) {
|
|
16
|
+
const Ze = de("./bd36b180.js"), u = de("./c9e59b34.js"), Z = de("./161d1254.js"), ne = de("./4c39852e.js"), m = de("./40f73dfb.js"), ht = de("./951903fb.js"), N = de("./dbf19c2e.js");
|
|
17
|
+
let n = de("react");
|
|
18
|
+
n = Ze.__toESM(n);
|
|
19
|
+
let r = de("react/jsx-runtime");
|
|
20
|
+
var yt = Ze.__toESM(ne.require_prop_types());
|
|
21
|
+
function vt(t, e) {
|
|
25
22
|
return { [t]: {
|
|
26
23
|
Filter: e("Filter"),
|
|
27
24
|
filter: e("filter"),
|
|
@@ -107,18 +104,18 @@ __useblocks__.define("static/core/31e98e6e.js", [
|
|
|
107
104
|
square: e("square")
|
|
108
105
|
} };
|
|
109
106
|
}
|
|
110
|
-
function
|
|
107
|
+
function Xe(t, e = "application/octet-stream") {
|
|
111
108
|
let o = t.trim(), a = e?.trim() || "application/octet-stream";
|
|
112
109
|
const i = o.indexOf(",");
|
|
113
110
|
if (o.startsWith("data:") && i >= 0) {
|
|
114
111
|
const d = o.slice(5, i).split(";")[0]?.trim();
|
|
115
112
|
d && (a = d), o = o.slice(i + 1);
|
|
116
113
|
}
|
|
117
|
-
const l = o.replace(/\s/g, ""), b = atob(l),
|
|
118
|
-
for (let d = 0; d < b.length; d++)
|
|
119
|
-
return new Blob([
|
|
114
|
+
const l = o.replace(/\s/g, ""), b = atob(l), p = new Uint8Array(b.length);
|
|
115
|
+
for (let d = 0; d < b.length; d++) p[d] = b.charCodeAt(d);
|
|
116
|
+
return new Blob([p], { type: a });
|
|
120
117
|
}
|
|
121
|
-
var
|
|
118
|
+
var Ct = "static/media/image-editor", bt = { text: {
|
|
122
119
|
replaceDefaultItems: !0,
|
|
123
120
|
defaultText: "Handwriting",
|
|
124
121
|
items: [
|
|
@@ -236,84 +233,84 @@ __useblocks__.define("static/core/31e98e6e.js", [
|
|
|
236
233
|
}
|
|
237
234
|
]
|
|
238
235
|
} };
|
|
239
|
-
function
|
|
236
|
+
function wt(t, e) {
|
|
240
237
|
if (t === "json") return new Blob([e], { type: "application/json" });
|
|
241
238
|
if (t === "svg") return new Blob([e], { type: "image/svg+xml" });
|
|
242
239
|
const o = `image/${t}`;
|
|
243
|
-
return
|
|
240
|
+
return Xe(e.replace(/data:image\/([a-z]*)?;base64,/, ""), o);
|
|
244
241
|
}
|
|
245
|
-
var
|
|
246
|
-
const l =
|
|
247
|
-
let
|
|
248
|
-
const
|
|
249
|
-
if (!
|
|
250
|
-
const
|
|
251
|
-
for (const [P,
|
|
252
|
-
return Object.keys(
|
|
253
|
-
}, [
|
|
242
|
+
var At = ({ currentImageLink: t, prefetchedBlob: e, resolveImageBlob: o, onSave: a, uploadImageResultIsLoading: i }) => {
|
|
243
|
+
const l = N.useCookieManager(), [b, p] = (0, n.useState)(), [d, v] = (0, n.useState)(), { __: I } = m.useI18n();
|
|
244
|
+
let w = u.useDispatch();
|
|
245
|
+
const C = u.useStore(), R = u.useAppConfig(), y = u.useSelector(u.selectedCurrentUser), L = u.useSelector(Z.selectSecondModal), A = u.useSelector(u.selectProject), G = (0, n.useMemo)(() => {
|
|
246
|
+
if (!R?.icons) return;
|
|
247
|
+
const E = {};
|
|
248
|
+
for (const [P, j] of Object.entries(R.icons)) typeof j == "string" && (E[P] = N.sanitizeHtml(j));
|
|
249
|
+
return Object.keys(E).length > 0 ? E : void 0;
|
|
250
|
+
}, [R?.icons]), O = (0, n.useRef)(!1), [D, H] = (0, n.useState)(), B = u.useEventEmitter(u.events.FILE_PROXY_EVENT_ID);
|
|
254
251
|
(0, n.useEffect)(() => {
|
|
255
|
-
let
|
|
252
|
+
let E = !1;
|
|
256
253
|
return (async () => {
|
|
257
|
-
const
|
|
258
|
-
if (!
|
|
259
|
-
let
|
|
260
|
-
if (!
|
|
261
|
-
typeof o == "function" ?
|
|
254
|
+
const j = t;
|
|
255
|
+
if (!j && !e) return;
|
|
256
|
+
let x = e;
|
|
257
|
+
if (!x && j) try {
|
|
258
|
+
typeof o == "function" ? x = await o(j) : x = await (await fetch(j)).blob();
|
|
262
259
|
} catch {
|
|
263
|
-
if (
|
|
264
|
-
if (
|
|
265
|
-
url:
|
|
266
|
-
project:
|
|
267
|
-
}).filter((
|
|
268
|
-
const
|
|
269
|
-
|
|
260
|
+
if (E) return;
|
|
261
|
+
if (x = await B.fire({
|
|
262
|
+
url: j,
|
|
263
|
+
project: A
|
|
264
|
+
}).filter((U) => U instanceof Blob)[0], !x) {
|
|
265
|
+
const U = l.get(u.APP_COOKIES.em_token) || await u.di.getInstance(C, Z.TOKEN_ID);
|
|
266
|
+
x = await (await fetch(`https://app.useblocks.io/api/wp-json/cors-proxy/v1/get?url=${encodeURIComponent(j)}`, { headers: { authorization: `Bearer ${U}` } })).blob();
|
|
270
267
|
}
|
|
271
268
|
}
|
|
272
|
-
if (
|
|
273
|
-
const
|
|
274
|
-
|
|
275
|
-
if (
|
|
276
|
-
const
|
|
277
|
-
typeof
|
|
278
|
-
},
|
|
279
|
-
})().catch((
|
|
280
|
-
|
|
269
|
+
if (E || !x) return;
|
|
270
|
+
const S = new FileReader();
|
|
271
|
+
S.onload = () => {
|
|
272
|
+
if (E) return;
|
|
273
|
+
const U = S.result;
|
|
274
|
+
typeof U == "string" && (p(U), v(x.type), D?.tools.import.openBackgroundImage(U));
|
|
275
|
+
}, S.onerror = () => {}, S.readAsDataURL(x);
|
|
276
|
+
})().catch((j) => {}), () => {
|
|
277
|
+
E = !0;
|
|
281
278
|
};
|
|
282
279
|
}, [
|
|
283
280
|
t,
|
|
284
281
|
e,
|
|
285
282
|
o,
|
|
286
283
|
l,
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
284
|
+
D,
|
|
285
|
+
B,
|
|
286
|
+
A,
|
|
287
|
+
C
|
|
291
288
|
]);
|
|
292
|
-
const
|
|
293
|
-
|
|
294
|
-
}, [
|
|
295
|
-
|
|
289
|
+
const z = (0, n.useCallback)(() => {
|
|
290
|
+
p(null), v(null), w(Z.closeSecondModal()), w(Z.closeModal(u.MODALS.UPLOAD_IMAGE_MODAL));
|
|
291
|
+
}, [w]), V = (0, n.useRef)();
|
|
292
|
+
V.current = async function(E, P, j) {
|
|
296
293
|
try {
|
|
297
|
-
const
|
|
298
|
-
a && await a(new File([
|
|
294
|
+
const x = wt(j, E);
|
|
295
|
+
a && await a(new File([x], P, {
|
|
299
296
|
lastModified: Date.now(),
|
|
300
|
-
type:
|
|
297
|
+
type: x.type
|
|
301
298
|
}));
|
|
302
|
-
} catch (
|
|
303
|
-
throw
|
|
299
|
+
} catch (x) {
|
|
300
|
+
throw x;
|
|
304
301
|
}
|
|
305
302
|
};
|
|
306
|
-
const ee = (0, n.useCallback)((
|
|
307
|
-
if (
|
|
303
|
+
const ee = (0, n.useCallback)((E) => {
|
|
304
|
+
if (E && !(O.current && D)) {
|
|
308
305
|
O.current = !0;
|
|
309
|
-
const P =
|
|
310
|
-
|
|
306
|
+
const P = y.locale ? y.locale.replace("_", "-") : "en-US", j = y.theme === "system" ? matchMedia("(prefers-color-scheme: dark)").matches ? u.DARK : u.LIGHT : y.theme;
|
|
307
|
+
ht.Tf.init({
|
|
311
308
|
selector: "#pixie-editor",
|
|
312
|
-
baseUrl: m.getBundledHostAssetUrl(
|
|
309
|
+
baseUrl: m.getBundledHostAssetUrl(Ct),
|
|
313
310
|
image: b,
|
|
314
311
|
activeLanguage: P,
|
|
315
|
-
languages:
|
|
316
|
-
tools:
|
|
312
|
+
languages: vt(P, I),
|
|
313
|
+
tools: bt,
|
|
317
314
|
ui: {
|
|
318
315
|
menubar: {
|
|
319
316
|
replaceDefaultItems: !0,
|
|
@@ -331,55 +328,55 @@ __useblocks__.define("static/core/31e98e6e.js", [
|
|
|
331
328
|
type: "button",
|
|
332
329
|
icon: (0, r.jsx)(m.EmIcons, {
|
|
333
330
|
icon: "HistoryOutlined",
|
|
334
|
-
configIcons:
|
|
331
|
+
configIcons: G,
|
|
335
332
|
style: { fontSize: 20 }
|
|
336
333
|
}),
|
|
337
334
|
align: "right",
|
|
338
335
|
desktopOnly: !0,
|
|
339
|
-
action: (
|
|
340
|
-
|
|
336
|
+
action: (x) => {
|
|
337
|
+
x.togglePanel("history");
|
|
341
338
|
}
|
|
342
339
|
},
|
|
343
340
|
{
|
|
344
341
|
type: "button",
|
|
345
342
|
icon: (0, r.jsx)(m.EmIcons, {
|
|
346
343
|
icon: "CloseOutlined",
|
|
347
|
-
configIcons:
|
|
344
|
+
configIcons: G,
|
|
348
345
|
style: { fontSize: 20 }
|
|
349
346
|
}),
|
|
350
347
|
align: "right",
|
|
351
348
|
desktopOnly: !0,
|
|
352
|
-
action: () =>
|
|
349
|
+
action: () => z()
|
|
353
350
|
}
|
|
354
351
|
]
|
|
355
352
|
},
|
|
356
353
|
nav: { position: "top" },
|
|
357
|
-
activeTheme:
|
|
354
|
+
activeTheme: j,
|
|
358
355
|
mode: "inline",
|
|
359
356
|
forceOverlayModeOnMobile: !1
|
|
360
357
|
},
|
|
361
|
-
onSave: async function(
|
|
358
|
+
onSave: async function(x, S, U) {
|
|
362
359
|
try {
|
|
363
|
-
await
|
|
360
|
+
await V.current(x, S, U);
|
|
364
361
|
} catch {}
|
|
365
362
|
}
|
|
366
|
-
}).then((
|
|
367
|
-
|
|
368
|
-
}).catch((
|
|
363
|
+
}).then((x) => {
|
|
364
|
+
H(x);
|
|
365
|
+
}).catch((x) => {});
|
|
369
366
|
}
|
|
370
367
|
}, [
|
|
371
|
-
|
|
368
|
+
y.theme,
|
|
372
369
|
b,
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
]),
|
|
380
|
-
|
|
370
|
+
D,
|
|
371
|
+
H,
|
|
372
|
+
y.locale,
|
|
373
|
+
I,
|
|
374
|
+
z,
|
|
375
|
+
G
|
|
376
|
+
]), q = (0, n.useCallback)(() => {
|
|
377
|
+
D?.tools.export.save(t?.split("/").pop().split(".")[0], d?.split("/")[1]);
|
|
381
378
|
}, [
|
|
382
|
-
|
|
379
|
+
D,
|
|
383
380
|
t,
|
|
384
381
|
d
|
|
385
382
|
]);
|
|
@@ -395,17 +392,17 @@ __useblocks__.define("static/core/31e98e6e.js", [
|
|
|
395
392
|
closable: !1,
|
|
396
393
|
zIndex: 1100,
|
|
397
394
|
mask: !1,
|
|
398
|
-
open:
|
|
395
|
+
open: L,
|
|
399
396
|
footer: [(0, r.jsx)(m.Button, {
|
|
400
397
|
className: "em-analytics__profile-cancel",
|
|
401
|
-
onClick:
|
|
402
|
-
children:
|
|
398
|
+
onClick: z,
|
|
399
|
+
children: I("Cancel")
|
|
403
400
|
}, "Cancel"), (0, r.jsx)(m.Button, {
|
|
404
401
|
className: "em-analytics__profile-updapixiete",
|
|
405
402
|
id: "save",
|
|
406
403
|
type: "primary",
|
|
407
|
-
onClick:
|
|
408
|
-
children:
|
|
404
|
+
onClick: q,
|
|
405
|
+
children: I("Update")
|
|
409
406
|
}, "Ok")],
|
|
410
407
|
children: [i && (0, r.jsx)("div", {
|
|
411
408
|
style: {
|
|
@@ -422,11 +419,11 @@ __useblocks__.define("static/core/31e98e6e.js", [
|
|
|
422
419
|
children: (0, r.jsx)(m.Spin, { size: "large" })
|
|
423
420
|
}), (0, r.jsx)("div", { id: "pixie-editor" })]
|
|
424
421
|
});
|
|
425
|
-
},
|
|
422
|
+
}, It = ({ currentImageLink: t, newLink: e, previewDisplayUrl: o, resolvedPreviewObjectUrl: a, resolvedPreviewBlob: i, resolveImageBlob: l, onSave: b, uploadImageResultIsLoading: p }) => {
|
|
426
423
|
const d = o || a;
|
|
427
424
|
return (0, r.jsxs)(r.Fragment, { children: [(0, r.jsx)("div", { children: (0, r.jsxs)("div", {
|
|
428
425
|
className: "image-preview",
|
|
429
|
-
children: [
|
|
426
|
+
children: [p && (0, r.jsx)("div", {
|
|
430
427
|
style: {
|
|
431
428
|
position: "absolute",
|
|
432
429
|
height: "100%",
|
|
@@ -443,22 +440,22 @@ __useblocks__.define("static/core/31e98e6e.js", [
|
|
|
443
440
|
alt: "uploadedImage",
|
|
444
441
|
src: d
|
|
445
442
|
})]
|
|
446
|
-
}) }), (0, r.jsx)(
|
|
443
|
+
}) }), (0, r.jsx)(At, {
|
|
447
444
|
currentImageLink: t,
|
|
448
445
|
prefetchedBlob: i,
|
|
449
446
|
resolveImageBlob: l,
|
|
450
447
|
newLink: e,
|
|
451
448
|
onSave: b,
|
|
452
|
-
uploadImageResultIsLoading:
|
|
449
|
+
uploadImageResultIsLoading: p
|
|
453
450
|
})] });
|
|
454
451
|
}, Re = {
|
|
455
452
|
Pixel: "Pixel",
|
|
456
453
|
Percent: "Percent"
|
|
457
|
-
},
|
|
454
|
+
}, Je = {
|
|
458
455
|
unit: Re.Percent,
|
|
459
456
|
value: 80
|
|
460
457
|
};
|
|
461
|
-
function
|
|
458
|
+
function xt(t) {
|
|
462
459
|
return typeof t == "number" ? {
|
|
463
460
|
unit: Re.Percent,
|
|
464
461
|
value: t * 100
|
|
@@ -468,147 +465,147 @@ __useblocks__.define("static/core/31e98e6e.js", [
|
|
|
468
465
|
} : /^(\d*(\.\d+)?)%$/.exec(t) ? {
|
|
469
466
|
unit: Re.Percent,
|
|
470
467
|
value: parseFloat(t)
|
|
471
|
-
} :
|
|
468
|
+
} : Je : Je;
|
|
472
469
|
}
|
|
473
|
-
function
|
|
474
|
-
const o =
|
|
470
|
+
function St(t, e) {
|
|
471
|
+
const o = xt(t);
|
|
475
472
|
let a;
|
|
476
473
|
return o.unit === Re.Pixel ? a = `${o.value}px` : a = `${100 - o.value}%`, e ? `${a} 0px 0px 0px` : `0px 0px ${a} 0px`;
|
|
477
474
|
}
|
|
478
|
-
function
|
|
479
|
-
const [ee,
|
|
480
|
-
|
|
481
|
-
const s = (0, n.useRef)(
|
|
482
|
-
s.current =
|
|
483
|
-
const h = (0, n.useRef)(
|
|
484
|
-
h.current =
|
|
485
|
-
const W = (0, n.useRef)(!1),
|
|
475
|
+
function $e({ next: t, hasMore: e, children: o, loader: a, scrollThreshold: i = .8, endMessage: l, style: b, height: p, scrollableTarget: d, hasChildren: v, inverse: I = !1, pullDownToRefresh: w = !1, pullDownToRefreshContent: C, releaseToRefreshContent: R, pullDownToRefreshThreshold: y = 100, refreshFunction: L, onScroll: A, dataLength: G, initialScrollY: O, className: D = "", role: H, tabIndex: B, id: z, ...V }) {
|
|
476
|
+
const [ee, q] = (0, n.useState)(!1), [E, P] = (0, n.useState)(!1), [j, x] = (0, n.useState)(0), S = (0, n.useRef)(null), U = (0, n.useRef)(null), _ = (0, n.useRef)(null), K = (0, n.useRef)(t);
|
|
477
|
+
K.current = t;
|
|
478
|
+
const s = (0, n.useRef)(L);
|
|
479
|
+
s.current = L;
|
|
480
|
+
const h = (0, n.useRef)(y);
|
|
481
|
+
h.current = y;
|
|
482
|
+
const W = (0, n.useRef)(!1), me = (0, n.useRef)(!1), T = (0, n.useRef)(0), J = (0, n.useRef)(0), $ = (0, n.useRef)(0), F = (0, n.useCallback)(() => d instanceof HTMLElement ? d : typeof d == "string" ? document.getElementById(d) : null, [d]);
|
|
486
483
|
(0, n.useEffect)(() => {
|
|
487
|
-
if (typeof
|
|
488
|
-
if (
|
|
484
|
+
if (typeof G > "u") throw new Error("mandatory prop \"dataLength\" is missing. The prop is needed when loading more content. Check README.md for usage");
|
|
485
|
+
if (w && typeof L != "function") throw new Error(`Mandatory prop "refreshFunction" missing.
|
|
489
486
|
Pull Down To Refresh functionality will not work
|
|
490
487
|
as expected. Check README.md for usage'`);
|
|
491
488
|
if (typeof O == "number") {
|
|
492
|
-
const Y =
|
|
489
|
+
const Y = p ? S.current : F();
|
|
493
490
|
Y && Y.scrollHeight > O && Y.scrollTo(0, O);
|
|
494
491
|
}
|
|
495
492
|
}, []), (0, n.useEffect)(() => {
|
|
496
|
-
W.current = !1,
|
|
497
|
-
}, [
|
|
493
|
+
W.current = !1, q(!1);
|
|
494
|
+
}, [G]), (0, n.useEffect)(() => {
|
|
498
495
|
if (!e || typeof IntersectionObserver > "u") return;
|
|
499
|
-
const Y =
|
|
496
|
+
const Y = U.current;
|
|
500
497
|
if (!Y) return;
|
|
501
|
-
const
|
|
502
|
-
!ae.isIntersecting || W.current || (W.current = !0,
|
|
498
|
+
const re = p ? S.current : F(), M = new IntersectionObserver(([ae]) => {
|
|
499
|
+
!ae.isIntersecting || W.current || (W.current = !0, q(!0), K.current());
|
|
503
500
|
}, {
|
|
504
|
-
root:
|
|
505
|
-
rootMargin:
|
|
501
|
+
root: re,
|
|
502
|
+
rootMargin: St(i, I),
|
|
506
503
|
threshold: 0
|
|
507
504
|
});
|
|
508
|
-
return
|
|
505
|
+
return M.observe(Y), () => M.disconnect();
|
|
509
506
|
}, [
|
|
510
507
|
e,
|
|
511
508
|
i,
|
|
512
|
-
|
|
513
|
-
|
|
514
|
-
|
|
509
|
+
I,
|
|
510
|
+
p,
|
|
511
|
+
F
|
|
515
512
|
]), (0, n.useEffect)(() => {
|
|
516
513
|
var Y;
|
|
517
|
-
if (!
|
|
518
|
-
const
|
|
519
|
-
if (!
|
|
520
|
-
const
|
|
521
|
-
setTimeout(() =>
|
|
514
|
+
if (!A) return;
|
|
515
|
+
const re = (Y = p ? S.current : F()) !== null && Y !== void 0 ? Y : typeof window < "u" ? window : null;
|
|
516
|
+
if (!re) return;
|
|
517
|
+
const M = (ae) => {
|
|
518
|
+
setTimeout(() => A(ae), 0);
|
|
522
519
|
};
|
|
523
|
-
return
|
|
520
|
+
return re.addEventListener("scroll", M), () => re.removeEventListener("scroll", M);
|
|
524
521
|
}, [
|
|
525
|
-
|
|
526
|
-
|
|
527
|
-
|
|
522
|
+
A,
|
|
523
|
+
p,
|
|
524
|
+
F
|
|
528
525
|
]), (0, n.useEffect)(() => {
|
|
529
|
-
var Y,
|
|
530
|
-
if (!
|
|
531
|
-
const
|
|
532
|
-
if (!
|
|
533
|
-
if (!((
|
|
534
|
-
const
|
|
535
|
-
|
|
526
|
+
var Y, re;
|
|
527
|
+
if (!w) return;
|
|
528
|
+
const M = (Y = p ? S.current : F()) !== null && Y !== void 0 ? Y : typeof window < "u" ? window : null;
|
|
529
|
+
if (!M) return;
|
|
530
|
+
if (!((re = _.current) === null || re === void 0) && re.firstChild) {
|
|
531
|
+
const X = _.current.firstChild.getBoundingClientRect().height;
|
|
532
|
+
$.current = X, x(X);
|
|
536
533
|
}
|
|
537
|
-
const ae = (
|
|
538
|
-
(
|
|
539
|
-
},
|
|
540
|
-
if (!
|
|
541
|
-
const
|
|
542
|
-
|
|
534
|
+
const ae = (X) => {
|
|
535
|
+
(M instanceof HTMLElement ? M.scrollTop : document.documentElement.scrollTop) > 0 || (me.current = !0, X instanceof MouseEvent ? T.current = X.pageY : X instanceof TouchEvent && (T.current = X.touches[0].pageY), J.current = T.current, S.current && (S.current.style.willChange = "transform", S.current.style.transition = "transform 0.2s cubic-bezier(0,0,0.31,1)"));
|
|
536
|
+
}, g = (X) => {
|
|
537
|
+
if (!me.current || (X instanceof MouseEvent ? J.current = X.pageY : X instanceof TouchEvent && (J.current = X.touches[0].pageY), J.current < T.current)) return;
|
|
538
|
+
const ce = J.current - T.current;
|
|
539
|
+
ce >= h.current && P(!0), !(ce > $.current * 1.5) && S.current && (S.current.style.overflow = "visible", S.current.style.transform = `translate3d(0px, ${ce}px, 0px)`);
|
|
543
540
|
}, te = () => {
|
|
544
|
-
|
|
545
|
-
var
|
|
546
|
-
return
|
|
541
|
+
T.current = 0, J.current = 0, me.current = !1, P((X) => {
|
|
542
|
+
var ce;
|
|
543
|
+
return X && ((ce = s.current) === null || ce === void 0 || ce.call(s)), !1;
|
|
547
544
|
}), requestAnimationFrame(() => {
|
|
548
|
-
|
|
545
|
+
S.current && (S.current.style.overflow = "auto", S.current.style.transform = "none", S.current.style.willChange = "unset");
|
|
549
546
|
});
|
|
550
547
|
};
|
|
551
|
-
return
|
|
552
|
-
|
|
548
|
+
return M.addEventListener("touchstart", ae), M.addEventListener("touchmove", g), M.addEventListener("touchend", te), M.addEventListener("mousedown", ae), M.addEventListener("mousemove", g), M.addEventListener("mouseup", te), () => {
|
|
549
|
+
M.removeEventListener("touchstart", ae), M.removeEventListener("touchmove", g), M.removeEventListener("touchend", te), M.removeEventListener("mousedown", ae), M.removeEventListener("mousemove", g), M.removeEventListener("mouseup", te);
|
|
553
550
|
};
|
|
554
551
|
}, [
|
|
552
|
+
w,
|
|
555
553
|
p,
|
|
556
|
-
|
|
557
|
-
H
|
|
554
|
+
F
|
|
558
555
|
]);
|
|
559
|
-
const
|
|
560
|
-
height:
|
|
556
|
+
const he = {
|
|
557
|
+
height: p ?? "auto",
|
|
561
558
|
overflow: "auto",
|
|
562
559
|
WebkitOverflowScrolling: "touch",
|
|
563
560
|
...b
|
|
564
|
-
},
|
|
565
|
-
ref:
|
|
561
|
+
}, ie = v || !!(o && o instanceof Array && o.length), pe = w && p ? { overflow: "auto" } : {}, Ae = e ? (0, r.jsx)("div", {
|
|
562
|
+
ref: U,
|
|
566
563
|
style: { height: 1 }
|
|
567
564
|
}) : null;
|
|
568
565
|
return (0, r.jsx)("div", {
|
|
569
|
-
style:
|
|
566
|
+
style: pe,
|
|
570
567
|
className: "infinite-scroll-component__outerdiv",
|
|
571
568
|
children: (0, r.jsxs)("div", {
|
|
572
|
-
...
|
|
573
|
-
role:
|
|
574
|
-
tabIndex:
|
|
575
|
-
id:
|
|
576
|
-
className: ["infinite-scroll-component",
|
|
577
|
-
ref:
|
|
578
|
-
style:
|
|
569
|
+
...V,
|
|
570
|
+
role: H,
|
|
571
|
+
tabIndex: B,
|
|
572
|
+
id: z,
|
|
573
|
+
className: ["infinite-scroll-component", D].filter(Boolean).join(" "),
|
|
574
|
+
ref: S,
|
|
575
|
+
style: he,
|
|
579
576
|
children: [
|
|
580
|
-
|
|
577
|
+
w && (0, r.jsx)("div", {
|
|
581
578
|
style: { position: "relative" },
|
|
582
|
-
ref:
|
|
579
|
+
ref: _,
|
|
583
580
|
children: (0, r.jsx)("div", {
|
|
584
581
|
style: {
|
|
585
582
|
position: "absolute",
|
|
586
583
|
left: 0,
|
|
587
584
|
right: 0,
|
|
588
|
-
top: -1 *
|
|
585
|
+
top: -1 * j
|
|
589
586
|
},
|
|
590
|
-
children:
|
|
587
|
+
children: E ? R : C
|
|
591
588
|
})
|
|
592
589
|
}),
|
|
593
590
|
o,
|
|
594
|
-
!ee && !
|
|
591
|
+
!ee && !ie && e && a,
|
|
595
592
|
ee && e && a,
|
|
596
|
-
|
|
593
|
+
Ae,
|
|
597
594
|
!e && l
|
|
598
595
|
]
|
|
599
596
|
})
|
|
600
597
|
});
|
|
601
598
|
}
|
|
602
|
-
function
|
|
599
|
+
function Rt(t, e) {
|
|
603
600
|
if (t == null) return {};
|
|
604
|
-
var o =
|
|
601
|
+
var o = kt(t, e), a, i;
|
|
605
602
|
if (Object.getOwnPropertySymbols) {
|
|
606
603
|
var l = Object.getOwnPropertySymbols(t);
|
|
607
604
|
for (i = 0; i < l.length; i++) a = l[i], !(e.indexOf(a) >= 0) && Object.prototype.propertyIsEnumerable.call(t, a) && (o[a] = t[a]);
|
|
608
605
|
}
|
|
609
606
|
return o;
|
|
610
607
|
}
|
|
611
|
-
function
|
|
608
|
+
function kt(t, e) {
|
|
612
609
|
if (t == null) return {};
|
|
613
610
|
var o = {}, a = Object.keys(t), i, l;
|
|
614
611
|
for (l = 0; l < a.length; l++) i = a[l], !(e.indexOf(i) >= 0) && (o[i] = t[i]);
|
|
@@ -623,7 +620,7 @@ __useblocks__.define("static/core/31e98e6e.js", [
|
|
|
623
620
|
return t;
|
|
624
621
|
}, De.apply(this, arguments);
|
|
625
622
|
}
|
|
626
|
-
function
|
|
623
|
+
function et(t, e) {
|
|
627
624
|
var o = Object.keys(t);
|
|
628
625
|
if (Object.getOwnPropertySymbols) {
|
|
629
626
|
var a = Object.getOwnPropertySymbols(t);
|
|
@@ -633,18 +630,18 @@ __useblocks__.define("static/core/31e98e6e.js", [
|
|
|
633
630
|
}
|
|
634
631
|
return o;
|
|
635
632
|
}
|
|
636
|
-
function
|
|
633
|
+
function ke(t) {
|
|
637
634
|
for (var e = 1; e < arguments.length; e++) {
|
|
638
635
|
var o = arguments[e] != null ? arguments[e] : {};
|
|
639
|
-
e % 2 ?
|
|
640
|
-
|
|
641
|
-
}) : Object.getOwnPropertyDescriptors ? Object.defineProperties(t, Object.getOwnPropertyDescriptors(o)) :
|
|
636
|
+
e % 2 ? et(Object(o), !0).forEach(function(a) {
|
|
637
|
+
jt(t, a, o[a]);
|
|
638
|
+
}) : Object.getOwnPropertyDescriptors ? Object.defineProperties(t, Object.getOwnPropertyDescriptors(o)) : et(Object(o)).forEach(function(a) {
|
|
642
639
|
Object.defineProperty(t, a, Object.getOwnPropertyDescriptor(o, a));
|
|
643
640
|
});
|
|
644
641
|
}
|
|
645
642
|
return t;
|
|
646
643
|
}
|
|
647
|
-
function
|
|
644
|
+
function jt(t, e, o) {
|
|
648
645
|
return e in t ? Object.defineProperty(t, e, {
|
|
649
646
|
value: o,
|
|
650
647
|
enumerable: !0,
|
|
@@ -652,18 +649,18 @@ __useblocks__.define("static/core/31e98e6e.js", [
|
|
|
652
649
|
writable: !0
|
|
653
650
|
}) : t[e] = o, t;
|
|
654
651
|
}
|
|
655
|
-
var
|
|
652
|
+
var Et = {
|
|
656
653
|
breakpointCols: void 0,
|
|
657
654
|
className: void 0,
|
|
658
655
|
columnClassName: void 0,
|
|
659
656
|
children: void 0,
|
|
660
657
|
columnAttrs: void 0,
|
|
661
658
|
column: void 0
|
|
662
|
-
},
|
|
659
|
+
}, Te = 2, Ne = class extends n.default.Component {
|
|
663
660
|
constructor(t) {
|
|
664
661
|
super(t), this.reCalculateColumnCount = this.reCalculateColumnCount.bind(this), this.reCalculateColumnCountDebounce = this.reCalculateColumnCountDebounce.bind(this);
|
|
665
662
|
let e;
|
|
666
|
-
this.props.breakpointCols && this.props.breakpointCols.default ? e = this.props.breakpointCols.default : e = parseInt(this.props.breakpointCols) ||
|
|
663
|
+
this.props.breakpointCols && this.props.breakpointCols.default ? e = this.props.breakpointCols.default : e = parseInt(this.props.breakpointCols) || Te, this.state = { columnCount: e };
|
|
667
664
|
}
|
|
668
665
|
componentDidMount() {
|
|
669
666
|
this.reCalculateColumnCount(), window && window.addEventListener("resize", this.reCalculateColumnCountDebounce);
|
|
@@ -686,8 +683,8 @@ __useblocks__.define("static/core/31e98e6e.js", [
|
|
|
686
683
|
reCalculateColumnCount() {
|
|
687
684
|
const t = window && window.innerWidth || Infinity;
|
|
688
685
|
let e = this.props.breakpointCols;
|
|
689
|
-
typeof e != "object" && (e = { default: parseInt(e) ||
|
|
690
|
-
let o = Infinity, a = e.default ||
|
|
686
|
+
typeof e != "object" && (e = { default: parseInt(e) || Te });
|
|
687
|
+
let o = Infinity, a = e.default || Te;
|
|
691
688
|
for (let i in e) {
|
|
692
689
|
const l = parseInt(i);
|
|
693
690
|
l > 0 && t <= l && l < o && (o = l, a = e[i]);
|
|
@@ -706,15 +703,15 @@ __useblocks__.define("static/core/31e98e6e.js", [
|
|
|
706
703
|
const { column: t, columnAttrs: e = {}, columnClassName: o } = this.props, a = this.itemsInColumns(), i = `${100 / a.length}%`;
|
|
707
704
|
let l = o;
|
|
708
705
|
l && typeof l != "string" && (this.logDeprecated("The property \"columnClassName\" requires a string"), typeof l > "u" && (l = "my-masonry-grid_column"));
|
|
709
|
-
const b =
|
|
710
|
-
style:
|
|
706
|
+
const b = ke(ke(ke({}, t), e), {}, {
|
|
707
|
+
style: ke(ke({}, e.style), {}, { width: i }),
|
|
711
708
|
className: l
|
|
712
709
|
});
|
|
713
|
-
return a.map((
|
|
710
|
+
return a.map((p, d) => n.default.createElement("div", De({}, b, { key: d }), p));
|
|
714
711
|
}
|
|
715
712
|
logDeprecated(t) {}
|
|
716
713
|
render() {
|
|
717
|
-
const t = this.props, { children: e, breakpointCols: o, columnClassName: a, columnAttrs: i, column: l, className: b } = t,
|
|
714
|
+
const t = this.props, { children: e, breakpointCols: o, columnClassName: a, columnAttrs: i, column: l, className: b } = t, p = Rt(t, [
|
|
718
715
|
"children",
|
|
719
716
|
"breakpointCols",
|
|
720
717
|
"columnClassName",
|
|
@@ -723,11 +720,11 @@ __useblocks__.define("static/core/31e98e6e.js", [
|
|
|
723
720
|
"className"
|
|
724
721
|
]);
|
|
725
722
|
let d = b;
|
|
726
|
-
return typeof b != "string" && (this.logDeprecated("The property \"className\" requires a string"), typeof b > "u" && (d = "my-masonry-grid")), n.default.createElement("div", De({},
|
|
723
|
+
return typeof b != "string" && (this.logDeprecated("The property \"className\" requires a string"), typeof b > "u" && (d = "my-masonry-grid")), n.default.createElement("div", De({}, p, { className: d }), this.renderColumns());
|
|
727
724
|
}
|
|
728
725
|
};
|
|
729
|
-
|
|
730
|
-
function
|
|
726
|
+
Ne.defaultProps = Et;
|
|
727
|
+
function Ge(t, e) {
|
|
731
728
|
return t ? t.exhausted ? {
|
|
732
729
|
...t,
|
|
733
730
|
src: null
|
|
@@ -736,21 +733,21 @@ __useblocks__.define("static/core/31e98e6e.js", [
|
|
|
736
733
|
src: t.src || e || null
|
|
737
734
|
} : null;
|
|
738
735
|
}
|
|
739
|
-
function
|
|
740
|
-
const [i, l] = (0, n.useState)({}), b = (0, n.useRef)(new Map()),
|
|
741
|
-
const
|
|
742
|
-
if (b.current.has(
|
|
743
|
-
itemId:
|
|
744
|
-
requestUrl:
|
|
745
|
-
cacheKey:
|
|
746
|
-
controller: b.current.get(
|
|
736
|
+
function tt({ items: t, getItemId: e, getRequestUrl: o, createController: a }) {
|
|
737
|
+
const [i, l] = (0, n.useState)({}), b = (0, n.useRef)(new Map()), p = (0, n.useCallback)((d) => {
|
|
738
|
+
const v = e(d), I = o(d), w = `${v}:${I}`;
|
|
739
|
+
if (b.current.has(w)) return {
|
|
740
|
+
itemId: v,
|
|
741
|
+
requestUrl: I,
|
|
742
|
+
cacheKey: w,
|
|
743
|
+
controller: b.current.get(w)
|
|
747
744
|
};
|
|
748
|
-
const
|
|
749
|
-
return b.current.set(
|
|
750
|
-
itemId:
|
|
751
|
-
requestUrl:
|
|
752
|
-
cacheKey:
|
|
753
|
-
controller:
|
|
745
|
+
const C = a(I);
|
|
746
|
+
return b.current.set(w, C), {
|
|
747
|
+
itemId: v,
|
|
748
|
+
requestUrl: I,
|
|
749
|
+
cacheKey: w,
|
|
750
|
+
controller: C
|
|
754
751
|
};
|
|
755
752
|
}, [
|
|
756
753
|
a,
|
|
@@ -758,103 +755,103 @@ __useblocks__.define("static/core/31e98e6e.js", [
|
|
|
758
755
|
o
|
|
759
756
|
]);
|
|
760
757
|
return (0, n.useEffect)(() => {
|
|
761
|
-
const d = new Set(),
|
|
762
|
-
const { itemId:
|
|
763
|
-
d.add(
|
|
764
|
-
const
|
|
765
|
-
return
|
|
766
|
-
const
|
|
767
|
-
!
|
|
758
|
+
const d = new Set(), v = {}, I = t.map((w) => {
|
|
759
|
+
const { itemId: C, cacheKey: R, controller: y } = p(w);
|
|
760
|
+
d.add(R), v[C] = y.src;
|
|
761
|
+
const L = Ge(y.handleChangeSrc?.(), y.src);
|
|
762
|
+
return L?.changed && L.src && (v[C] = L.src), y.subscribeToSrcChange?.((A) => {
|
|
763
|
+
const G = Ge(A, y.src);
|
|
764
|
+
!G?.changed || !G.src || l((O) => O[C] === G.src ? O : {
|
|
768
765
|
...O,
|
|
769
|
-
[
|
|
766
|
+
[C]: G.src
|
|
770
767
|
});
|
|
771
768
|
});
|
|
772
769
|
}).filter(Boolean);
|
|
773
|
-
return b.current.forEach((
|
|
774
|
-
d.has(
|
|
775
|
-
}), l(
|
|
776
|
-
|
|
770
|
+
return b.current.forEach((w, C) => {
|
|
771
|
+
d.has(C) || b.current.delete(C);
|
|
772
|
+
}), l(v), () => {
|
|
773
|
+
I.forEach((w) => w?.());
|
|
777
774
|
};
|
|
778
|
-
}, [
|
|
775
|
+
}, [p, t]), {
|
|
779
776
|
getDisplaySrc: (0, n.useCallback)((d) => {
|
|
780
|
-
const { itemId:
|
|
781
|
-
return i[
|
|
782
|
-
}, [i,
|
|
777
|
+
const { itemId: v, requestUrl: I, controller: w } = p(d);
|
|
778
|
+
return i[v] || w.src || I;
|
|
779
|
+
}, [i, p]),
|
|
783
780
|
handleLoad: (0, n.useCallback)((d) => {
|
|
784
|
-
|
|
785
|
-
}, [
|
|
781
|
+
p(d).controller.handleSuccess();
|
|
782
|
+
}, [p]),
|
|
786
783
|
handleError: (0, n.useCallback)((d) => {
|
|
787
|
-
const { itemId:
|
|
788
|
-
|
|
789
|
-
...
|
|
790
|
-
[
|
|
784
|
+
const { itemId: v, controller: I } = p(d), w = Ge(I.handleError(), I.src);
|
|
785
|
+
w?.changed && w.src && l((C) => ({
|
|
786
|
+
...C,
|
|
787
|
+
[v]: w.src
|
|
791
788
|
}));
|
|
792
|
-
}, [
|
|
789
|
+
}, [p])
|
|
793
790
|
};
|
|
794
791
|
}
|
|
795
|
-
var
|
|
796
|
-
const
|
|
797
|
-
|
|
792
|
+
var nt = "blocks", Ot = ({ setCurrentImageLink: t, setModalHeight: e, setModalWidth: o, setImageStockList: a, imageStockList: i, currentReq: l, setCurrentReq: b, inputRef: p, setStockLink: d, customRequest: v }) => {
|
|
793
|
+
const I = u.useAppConfig(), w = u.useIsStandalone(), [C, R] = (0, n.useState)(!1), [y, L] = (0, n.useState)(2), { __: A } = m.useI18n(), G = m.useNotification(), [O] = Z.useLazyGetUnsplashImageQuery(), [D] = Z.useLazyGetSearchImageQuery(), H = (0, n.useCallback)((s) => s instanceof Error || typeof s?.message == "string" && s.message ? s.message : typeof s?.error?.message == "string" && s.error.message ? s.error.message : A("Failed to load stock images through the configured proxy chain."), [A]), B = (0, n.useCallback)((s) => {
|
|
794
|
+
G.error({
|
|
798
795
|
id: "STOCK_IMAGES_SEARCH_FAILED",
|
|
799
|
-
title:
|
|
800
|
-
description:
|
|
796
|
+
title: A("Failed to load stock images"),
|
|
797
|
+
description: H(s)
|
|
801
798
|
});
|
|
802
799
|
}, [
|
|
803
|
-
|
|
804
|
-
|
|
805
|
-
|
|
806
|
-
]),
|
|
807
|
-
|
|
800
|
+
A,
|
|
801
|
+
H,
|
|
802
|
+
G
|
|
803
|
+
]), z = async () => {
|
|
804
|
+
C || (R(!0), D({
|
|
808
805
|
query: l,
|
|
809
|
-
page:
|
|
806
|
+
page: y
|
|
810
807
|
}).then((s) => {
|
|
811
808
|
if (s?.error) {
|
|
812
|
-
|
|
809
|
+
B(s.error), R(!1);
|
|
813
810
|
return;
|
|
814
811
|
}
|
|
815
812
|
const h = s?.data?.results || [];
|
|
816
|
-
a((W) => [...W, ...h]),
|
|
813
|
+
a((W) => [...W, ...h]), R(!1), L((W) => W + 1);
|
|
817
814
|
}).catch(() => {
|
|
818
|
-
|
|
815
|
+
R(!1);
|
|
819
816
|
}));
|
|
820
817
|
};
|
|
821
818
|
(0, n.useEffect)(() => {
|
|
822
|
-
l.keywords !== "" &&
|
|
819
|
+
l.keywords !== "" && V();
|
|
823
820
|
}, [l.color, l.orientation]);
|
|
824
|
-
const
|
|
825
|
-
const s = await
|
|
821
|
+
const V = async () => {
|
|
822
|
+
const s = await D({
|
|
826
823
|
query: l,
|
|
827
824
|
page: 1
|
|
828
825
|
});
|
|
829
826
|
if (s?.error) {
|
|
830
|
-
|
|
827
|
+
B(s.error), a([]);
|
|
831
828
|
return;
|
|
832
829
|
}
|
|
833
830
|
const h = s?.data?.results || [];
|
|
834
831
|
h.length > 0 ? (a(h), setTimeout(() => {
|
|
835
832
|
o(1060), e("84vh");
|
|
836
833
|
}, 0)) : a([]);
|
|
837
|
-
}, [ee,
|
|
838
|
-
config:
|
|
839
|
-
standalone:
|
|
834
|
+
}, [ee, q] = (0, n.useState)(null), E = (0, n.useCallback)((s, h, W) => `${s}${s.includes("?") ? "&" : "?"}w=${h}&q=${W}`, []), P = (0, n.useCallback)((s) => u.getProxiedUrl(s, {
|
|
835
|
+
config: I,
|
|
836
|
+
standalone: w,
|
|
840
837
|
resourceType: "stockImages",
|
|
841
838
|
intent: "display"
|
|
842
|
-
}), [
|
|
839
|
+
}), [I, w]), { getDisplaySrc: j, handleLoad: x, handleError: S } = tt({
|
|
843
840
|
items: i,
|
|
844
841
|
getItemId: (0, n.useCallback)((s) => s.id, []),
|
|
845
|
-
getRequestUrl: (0, n.useCallback)((s) =>
|
|
842
|
+
getRequestUrl: (0, n.useCallback)((s) => E(s.urls.raw, 644, 96), [E]),
|
|
846
843
|
createController: P
|
|
847
|
-
}),
|
|
848
|
-
|
|
849
|
-
},
|
|
850
|
-
|
|
851
|
-
},
|
|
852
|
-
O(h.download_location),
|
|
844
|
+
}), U = (s) => (h) => {
|
|
845
|
+
x(s), h.target.parentNode.classList.add("loaded");
|
|
846
|
+
}, _ = (s) => () => {
|
|
847
|
+
S(s);
|
|
848
|
+
}, K = (s, h, W) => {
|
|
849
|
+
O(h.download_location), q(W), setTimeout(() => q(null), 2e3), d(`${s.raw}&w=1200&q=96`), t(`${s.raw}&w=1200&q=96`), v(`${s.raw}&w=1200&q=96`);
|
|
853
850
|
};
|
|
854
851
|
return (0, r.jsxs)("div", {
|
|
855
852
|
className: "stock-tab",
|
|
856
853
|
children: [(0, r.jsxs)(m.Form, {
|
|
857
|
-
onValuesChange:
|
|
854
|
+
onValuesChange: V,
|
|
858
855
|
className: i.length > 0 ? "serach-results" : "",
|
|
859
856
|
children: [(0, r.jsxs)(m.Row, {
|
|
860
857
|
gutter: 24,
|
|
@@ -863,16 +860,16 @@ __useblocks__.define("static/core/31e98e6e.js", [
|
|
|
863
860
|
children: (0, r.jsx)(m.Form.Item, {
|
|
864
861
|
className: "stock-search-input",
|
|
865
862
|
children: (0, r.jsx)(m.SearchInput, {
|
|
866
|
-
onSearch:
|
|
863
|
+
onSearch: V,
|
|
867
864
|
allowClear: !0,
|
|
868
865
|
size: i.length > 0 ? "medium" : "large",
|
|
869
|
-
placeholder:
|
|
866
|
+
placeholder: A("Search image"),
|
|
870
867
|
value: l.keywords,
|
|
871
868
|
onChange: (s) => b((h) => ({
|
|
872
869
|
...h,
|
|
873
870
|
keywords: s.target.value
|
|
874
871
|
})),
|
|
875
|
-
ref:
|
|
872
|
+
ref: p,
|
|
876
873
|
spellCheck: "false",
|
|
877
874
|
enterButton: !1
|
|
878
875
|
})
|
|
@@ -885,35 +882,35 @@ __useblocks__.define("static/core/31e98e6e.js", [
|
|
|
885
882
|
})),
|
|
886
883
|
children: [
|
|
887
884
|
(0, r.jsx)(m.Tooltip, {
|
|
888
|
-
title:
|
|
885
|
+
title: A("All"),
|
|
889
886
|
placement: "top",
|
|
890
887
|
children: (0, r.jsx)(m.Radio.Button, {
|
|
891
888
|
value: "",
|
|
892
|
-
children: (0, r.jsx)(
|
|
889
|
+
children: (0, r.jsx)(N.EmIcons, { icon: "MixedView" })
|
|
893
890
|
})
|
|
894
891
|
}),
|
|
895
892
|
(0, r.jsx)(m.Tooltip, {
|
|
896
|
-
title:
|
|
893
|
+
title: A("Landscape"),
|
|
897
894
|
placement: "top",
|
|
898
895
|
children: (0, r.jsx)(m.Radio.Button, {
|
|
899
896
|
value: "landscape",
|
|
900
|
-
children: (0, r.jsx)(
|
|
897
|
+
children: (0, r.jsx)(N.EmIcons, { icon: "LandscapeView" })
|
|
901
898
|
})
|
|
902
899
|
}),
|
|
903
900
|
(0, r.jsx)(m.Tooltip, {
|
|
904
|
-
title:
|
|
901
|
+
title: A("Portrait"),
|
|
905
902
|
placement: "top",
|
|
906
903
|
children: (0, r.jsx)(m.Radio.Button, {
|
|
907
904
|
value: "portrait",
|
|
908
|
-
children: (0, r.jsx)(
|
|
905
|
+
children: (0, r.jsx)(N.EmIcons, { icon: "PortraitView" })
|
|
909
906
|
})
|
|
910
907
|
}),
|
|
911
908
|
(0, r.jsx)(m.Tooltip, {
|
|
912
|
-
title:
|
|
909
|
+
title: A("Squarish"),
|
|
913
910
|
placement: "top",
|
|
914
911
|
children: (0, r.jsx)(m.Radio.Button, {
|
|
915
912
|
value: "squarish",
|
|
916
|
-
children: (0, r.jsx)(
|
|
913
|
+
children: (0, r.jsx)(N.EmIcons, { icon: "SquareView" })
|
|
917
914
|
})
|
|
918
915
|
})
|
|
919
916
|
]
|
|
@@ -927,57 +924,57 @@ __useblocks__.define("static/core/31e98e6e.js", [
|
|
|
927
924
|
{
|
|
928
925
|
value: "",
|
|
929
926
|
colorClass: "all-colors",
|
|
930
|
-
label:
|
|
927
|
+
label: A("All")
|
|
931
928
|
},
|
|
932
929
|
{
|
|
933
930
|
value: "black",
|
|
934
931
|
colorClass: "black-color",
|
|
935
|
-
label:
|
|
932
|
+
label: A("Black")
|
|
936
933
|
},
|
|
937
934
|
{
|
|
938
935
|
value: "black_and_white",
|
|
939
936
|
colorClass: "bw-color",
|
|
940
|
-
label:
|
|
937
|
+
label: A("Black and White")
|
|
941
938
|
},
|
|
942
939
|
{
|
|
943
940
|
value: "white",
|
|
944
941
|
colorClass: "white-color",
|
|
945
|
-
label:
|
|
942
|
+
label: A("White")
|
|
946
943
|
},
|
|
947
944
|
{
|
|
948
945
|
value: "orange",
|
|
949
946
|
colorClass: "orange-color",
|
|
950
|
-
label:
|
|
947
|
+
label: A("Orange")
|
|
951
948
|
},
|
|
952
949
|
{
|
|
953
950
|
value: "red",
|
|
954
951
|
colorClass: "red-color",
|
|
955
|
-
label:
|
|
952
|
+
label: A("Red")
|
|
956
953
|
},
|
|
957
954
|
{
|
|
958
955
|
value: "purple",
|
|
959
956
|
colorClass: "purple-color",
|
|
960
|
-
label:
|
|
957
|
+
label: A("Purple")
|
|
961
958
|
},
|
|
962
959
|
{
|
|
963
960
|
value: "magenta",
|
|
964
961
|
colorClass: "magenta-color",
|
|
965
|
-
label:
|
|
962
|
+
label: A("Magenta")
|
|
966
963
|
},
|
|
967
964
|
{
|
|
968
965
|
value: "green",
|
|
969
966
|
colorClass: "green-color",
|
|
970
|
-
label:
|
|
967
|
+
label: A("Green")
|
|
971
968
|
},
|
|
972
969
|
{
|
|
973
970
|
value: "teal",
|
|
974
971
|
colorClass: "teal-color",
|
|
975
|
-
label:
|
|
972
|
+
label: A("Teal")
|
|
976
973
|
},
|
|
977
974
|
{
|
|
978
975
|
value: "blue",
|
|
979
976
|
colorClass: "blue-color",
|
|
980
|
-
label:
|
|
977
|
+
label: A("Blue")
|
|
981
978
|
}
|
|
982
979
|
],
|
|
983
980
|
tooltipPlacement: "top"
|
|
@@ -1005,32 +1002,32 @@ __useblocks__.define("static/core/31e98e6e.js", [
|
|
|
1005
1002
|
lineHeight: "0",
|
|
1006
1003
|
boxSizing: "unset"
|
|
1007
1004
|
},
|
|
1008
|
-
children: (0, r.jsx)(
|
|
1005
|
+
children: (0, r.jsx)($e, {
|
|
1009
1006
|
dataLength: i && i.length,
|
|
1010
|
-
next:
|
|
1007
|
+
next: z,
|
|
1011
1008
|
hasMore: i,
|
|
1012
1009
|
endMessage: (0, r.jsxs)(m.Divider, {
|
|
1013
1010
|
plain: !0,
|
|
1014
|
-
children: [
|
|
1011
|
+
children: [A("That`s all we could find."), " 🤐"]
|
|
1015
1012
|
}),
|
|
1016
1013
|
scrollableTarget: "scrollableDiv",
|
|
1017
1014
|
style: { overflow: "visible" },
|
|
1018
1015
|
loader: null,
|
|
1019
|
-
children: (0, r.jsx)(
|
|
1016
|
+
children: (0, r.jsx)(Ne, {
|
|
1020
1017
|
breakpointCols: { default: 3 },
|
|
1021
1018
|
className: "my-masonry-grid",
|
|
1022
1019
|
columnClassName: "my-masonry-grid_column",
|
|
1023
1020
|
children: i.map((s) => (0, r.jsxs)("div", {
|
|
1024
1021
|
className: "list-item",
|
|
1025
|
-
onClick: () =>
|
|
1022
|
+
onClick: () => K(s.urls, s.links, s.id),
|
|
1026
1023
|
children: [
|
|
1027
1024
|
(0, r.jsx)("img", {
|
|
1028
1025
|
className: ee === s.id ? "loaded-image" : "",
|
|
1029
1026
|
width: "322px",
|
|
1030
|
-
src:
|
|
1027
|
+
src: j(s),
|
|
1031
1028
|
alt: s.description,
|
|
1032
|
-
onLoad:
|
|
1033
|
-
onError:
|
|
1029
|
+
onLoad: U(s),
|
|
1030
|
+
onError: _(s)
|
|
1034
1031
|
}),
|
|
1035
1032
|
(0, r.jsxs)("p", {
|
|
1036
1033
|
className: "creator-info",
|
|
@@ -1040,7 +1037,7 @@ __useblocks__.define("static/core/31e98e6e.js", [
|
|
|
1040
1037
|
" ",
|
|
1041
1038
|
(0, r.jsx)("a", {
|
|
1042
1039
|
target: "_blank",
|
|
1043
|
-
href: `${s.user.links.html}?utm_source=${
|
|
1040
|
+
href: `${s.user.links.html}?utm_source=${nt}&utm_medium=referral`,
|
|
1044
1041
|
rel: "noreferrer",
|
|
1045
1042
|
children: s.user.name
|
|
1046
1043
|
}),
|
|
@@ -1049,7 +1046,7 @@ __useblocks__.define("static/core/31e98e6e.js", [
|
|
|
1049
1046
|
" ",
|
|
1050
1047
|
(0, r.jsx)("a", {
|
|
1051
1048
|
target: "_blank",
|
|
1052
|
-
href: `https://unsplash.com/?utm_source=${
|
|
1049
|
+
href: `https://unsplash.com/?utm_source=${nt}&utm_medium=referral`,
|
|
1053
1050
|
rel: "noreferrer",
|
|
1054
1051
|
children: "Unsplash"
|
|
1055
1052
|
})
|
|
@@ -1067,14 +1064,14 @@ __useblocks__.define("static/core/31e98e6e.js", [
|
|
|
1067
1064
|
})]
|
|
1068
1065
|
});
|
|
1069
1066
|
};
|
|
1070
|
-
function
|
|
1067
|
+
function rt(t) {
|
|
1071
1068
|
return /^(https?:)?\/\//i.test(t.trim());
|
|
1072
1069
|
}
|
|
1073
|
-
function
|
|
1070
|
+
function Lt(t) {
|
|
1074
1071
|
const e = t.trim();
|
|
1075
|
-
return
|
|
1072
|
+
return rt(e) || /^data:/i.test(e) ? e : `data:image/jpeg;base64, ${t}`;
|
|
1076
1073
|
}
|
|
1077
|
-
var
|
|
1074
|
+
var Dt = ({ images: t, transitionDuration: e = 1e3 }) => {
|
|
1078
1075
|
const [o, a] = (0, n.useState)([]);
|
|
1079
1076
|
return (0, n.useEffect)(() => {
|
|
1080
1077
|
if (t.length > 0) {
|
|
@@ -1083,7 +1080,7 @@ __useblocks__.define("static/core/31e98e6e.js", [
|
|
|
1083
1080
|
src: i,
|
|
1084
1081
|
opacity: 0
|
|
1085
1082
|
}]), setTimeout(() => {
|
|
1086
|
-
a((l) => l.map((b,
|
|
1083
|
+
a((l) => l.map((b, p) => p === l.length - 1 ? {
|
|
1087
1084
|
...b,
|
|
1088
1085
|
opacity: 1
|
|
1089
1086
|
} : b));
|
|
@@ -1092,7 +1089,7 @@ __useblocks__.define("static/core/31e98e6e.js", [
|
|
|
1092
1089
|
}, [t]), (0, r.jsx)("div", {
|
|
1093
1090
|
className: "slideshow-container",
|
|
1094
1091
|
children: o.map((i, l) => (0, r.jsx)("img", {
|
|
1095
|
-
src:
|
|
1092
|
+
src: Lt(i.src),
|
|
1096
1093
|
alt: `Slide ${l + 1}`,
|
|
1097
1094
|
className: "slideshow-image",
|
|
1098
1095
|
style: {
|
|
@@ -1102,115 +1099,115 @@ __useblocks__.define("static/core/31e98e6e.js", [
|
|
|
1102
1099
|
}, l))
|
|
1103
1100
|
});
|
|
1104
1101
|
};
|
|
1105
|
-
function
|
|
1106
|
-
const { __:
|
|
1107
|
-
limitsInPlugin:
|
|
1108
|
-
hostedAiActive:
|
|
1109
|
-
}),
|
|
1110
|
-
|
|
1102
|
+
function Bt({ setModalHeight: t, customRequest: e, aiTabRef: o, isImageUploaded: a, setIsImageUploaded: i, aiImageRequest: l, imageAiList: b, setImageAiList: p, isLoadingAi: d, setIsLoadingAi: v, onPluginAiImageLimitExceeded: I, onImageGenerateLimitExceeded: w }) {
|
|
1103
|
+
const { __: C } = m.useI18n(), R = u.useAppConfig(), y = m.useNotification(), L = u.usePushToDataLayer(), { emailId: A, blockId: G, projectId: O } = u.useParams(), [D] = Z.useLazySendAiImageRequestQuery(), [H, { data: B = [] }] = Z.useLazyGetAiImageSSEQuery(), [z] = Z.useLazyGetLimitsStatsByTypeQuery(), V = R?.sendAIImageRequest || D, ee = R?.trigger || H, q = R?.handleLimitUsageEmitter || u.useEventEmitter(u.events.ON_LIMIT_ID), [E, P] = (0, n.useState)(0), [j, x] = (0, n.useState)(null), [S, U] = (0, n.useState)(!1), [_, K] = (0, n.useState)(C("Evaluating the task")), [s, h] = (0, n.useState)(!1), W = A || G, { limits: me } = R?.limits ? R : { limits: { ai_img_limit: 0 } }, { ai_img_limit: T } = me, J = !!(R.limits && R.counters) && u.PLUGIN.isPlugin, $ = u.useEventEmitter(u.events.AI_IMAGE_REQUEST_ID).hasListeners(), F = ne.shouldCountAiUsage({
|
|
1104
|
+
limitsInPlugin: J,
|
|
1105
|
+
hostedAiActive: $
|
|
1106
|
+
}), he = !$ && T > 0 && E >= T, ie = (0, n.useCallback)(() => {
|
|
1107
|
+
q.fire({
|
|
1111
1108
|
name: "AiImgCount",
|
|
1112
|
-
count:
|
|
1109
|
+
count: E + 1
|
|
1113
1110
|
});
|
|
1114
|
-
}, [
|
|
1115
|
-
|
|
1116
|
-
|
|
1117
|
-
|
|
1118
|
-
|
|
1119
|
-
]),
|
|
1120
|
-
|
|
1111
|
+
}, [q, E]), pe = (0, n.useMemo)(() => !he && (!F || T === 0 || E < T), [
|
|
1112
|
+
he,
|
|
1113
|
+
F,
|
|
1114
|
+
E,
|
|
1115
|
+
T
|
|
1116
|
+
]), Ae = (0, n.useCallback)(async () => {
|
|
1117
|
+
K(C("Evaluating the task")), l !== "" && !d && (v(!0), h(!0), p([]), L({
|
|
1121
1118
|
event: "submit_form",
|
|
1122
1119
|
action: "ai_image_generation",
|
|
1123
|
-
entity_id:
|
|
1120
|
+
entity_id: A,
|
|
1124
1121
|
project_id: O
|
|
1125
|
-
}),
|
|
1122
|
+
}), V({ body: {
|
|
1126
1123
|
project_id: O,
|
|
1127
1124
|
request: "create-image",
|
|
1128
1125
|
connection: "midjourney",
|
|
1129
1126
|
message: l
|
|
1130
|
-
} }).then(({ data:
|
|
1127
|
+
} }).then(({ data: g, error: te }) => {
|
|
1131
1128
|
if (te) throw te;
|
|
1132
|
-
if (
|
|
1133
|
-
if (
|
|
1134
|
-
g
|
|
1129
|
+
if (g.data.status === 401) throw new Error(u.ERROR);
|
|
1130
|
+
if (g?.data?._eventResult) {
|
|
1131
|
+
p(g.data.task.images), v(!1), h(!1), K(C("Evaluating the task"));
|
|
1135
1132
|
return;
|
|
1136
1133
|
}
|
|
1137
|
-
|
|
1134
|
+
g?.data.status === 200 ? (g?.data.task.id && (K(g.data.task.message), x(g.data.task.id)), g.message && y.success({
|
|
1138
1135
|
id: "AI_IMAGE_SEND_SUCCESS",
|
|
1139
|
-
title:
|
|
1136
|
+
title: g.message,
|
|
1140
1137
|
placement: "bottomRight",
|
|
1141
1138
|
data: l
|
|
1142
1139
|
}), ee({
|
|
1143
|
-
task_id:
|
|
1140
|
+
task_id: g?.data.task.id,
|
|
1144
1141
|
entity_id: W
|
|
1145
|
-
})) : (
|
|
1142
|
+
})) : (v(!1), h(!1), y.error({
|
|
1146
1143
|
id: "AI_IMAGE_SEND_ERROR",
|
|
1147
|
-
title:
|
|
1144
|
+
title: g?.message || C("Something went wrong, please try again"),
|
|
1148
1145
|
placement: "bottomRight",
|
|
1149
1146
|
data: l,
|
|
1150
|
-
innerException:
|
|
1147
|
+
innerException: g
|
|
1151
1148
|
}));
|
|
1152
|
-
}).catch((
|
|
1153
|
-
|
|
1149
|
+
}).catch((g) => {
|
|
1150
|
+
v(!1), h(!1), (g?.error || g?.data) && y.fromError("AI_IMAGE_SEND_ERROR", l, g.error || g);
|
|
1154
1151
|
}));
|
|
1155
1152
|
}, [
|
|
1156
1153
|
l,
|
|
1157
1154
|
d,
|
|
1158
|
-
|
|
1155
|
+
v,
|
|
1159
1156
|
h,
|
|
1160
|
-
|
|
1161
|
-
|
|
1162
|
-
|
|
1157
|
+
p,
|
|
1158
|
+
L,
|
|
1159
|
+
A,
|
|
1163
1160
|
O,
|
|
1164
|
-
|
|
1165
|
-
|
|
1161
|
+
V,
|
|
1162
|
+
y,
|
|
1166
1163
|
ee,
|
|
1167
1164
|
W,
|
|
1168
|
-
|
|
1165
|
+
C
|
|
1169
1166
|
]), Y = (0, n.useCallback)(async () => {
|
|
1170
|
-
if (
|
|
1171
|
-
if (!u.PLUGIN.isPlugin &&
|
|
1172
|
-
const
|
|
1173
|
-
if (
|
|
1174
|
-
|
|
1167
|
+
if (pe) {
|
|
1168
|
+
if (!u.PLUGIN.isPlugin && !$) {
|
|
1169
|
+
const g = N.resolveLimitActionPreflightExceededForType("image_generate", (await z("image_generate")).data?.stats);
|
|
1170
|
+
if (g) {
|
|
1171
|
+
w?.(g);
|
|
1175
1172
|
return;
|
|
1176
1173
|
}
|
|
1177
1174
|
}
|
|
1178
|
-
|
|
1179
|
-
} else
|
|
1180
|
-
title:
|
|
1181
|
-
description:
|
|
1175
|
+
F && (P((g) => g + 1), ie()), Ae();
|
|
1176
|
+
} else J && (I ? I() : y.error({
|
|
1177
|
+
title: C("The usage limit has been exceeded"),
|
|
1178
|
+
description: C(`The maximum number of requests for the current subscription period has been reached.
|
|
1182
1179
|
Select the appropriate plan to fulfil more requests`),
|
|
1183
1180
|
placement: "bottomRight"
|
|
1184
1181
|
}));
|
|
1185
1182
|
}, [
|
|
1186
|
-
|
|
1183
|
+
pe,
|
|
1184
|
+
J,
|
|
1187
1185
|
$,
|
|
1188
|
-
|
|
1189
|
-
|
|
1190
|
-
|
|
1191
|
-
p,
|
|
1186
|
+
F,
|
|
1187
|
+
z,
|
|
1188
|
+
w,
|
|
1192
1189
|
P,
|
|
1193
|
-
|
|
1194
|
-
|
|
1190
|
+
ie,
|
|
1191
|
+
Ae,
|
|
1192
|
+
y,
|
|
1195
1193
|
C,
|
|
1196
|
-
|
|
1197
|
-
x
|
|
1194
|
+
I
|
|
1198
1195
|
]);
|
|
1199
1196
|
(0, n.useEffect)(() => {
|
|
1200
|
-
|
|
1201
|
-
}, [
|
|
1202
|
-
const
|
|
1197
|
+
J && P(R?.counters?.ai_img_counter || 0);
|
|
1198
|
+
}, [R, J]);
|
|
1199
|
+
const re = u.useEventEmitter(u.events.AI_IMAGE_PROGRESS_ID);
|
|
1203
1200
|
(0, n.useEffect)(() => {
|
|
1204
|
-
const
|
|
1205
|
-
|
|
1201
|
+
const g = re.event(({ progress: te, status: X }) => {
|
|
1202
|
+
K(X || `${Math.round(te)}%`);
|
|
1206
1203
|
});
|
|
1207
|
-
return () =>
|
|
1208
|
-
}, [
|
|
1209
|
-
const
|
|
1204
|
+
return () => g.dispose();
|
|
1205
|
+
}, [re]);
|
|
1206
|
+
const M = (0, n.useCallback)(async (g) => {
|
|
1210
1207
|
if (!a) {
|
|
1211
1208
|
i(!0);
|
|
1212
1209
|
try {
|
|
1213
|
-
const te =
|
|
1210
|
+
const te = rt(g) ? await (await fetch(g)).blob() : Xe(g);
|
|
1214
1211
|
e({ file: new File([te], "image.jpeg", { type: te.type || "image/jpeg" }) });
|
|
1215
1212
|
} catch {
|
|
1216
1213
|
i(!1);
|
|
@@ -1220,63 +1217,63 @@ Select the appropriate plan to fulfil more requests`),
|
|
|
1220
1217
|
a,
|
|
1221
1218
|
i,
|
|
1222
1219
|
e
|
|
1223
|
-
]), ae = (0, n.useCallback)((
|
|
1224
|
-
|
|
1220
|
+
]), ae = (0, n.useCallback)((g) => {
|
|
1221
|
+
g.status !== "error" && g.status !== "Canceled" ? g.images ? (K(g.status), g.progress === 100 && (p(g.images), K(C("Evaluating the task")), x(null), h(!1))) : (p([g.data]), v(!1)) : (v(!1), h(!1), y.error({
|
|
1225
1222
|
id: "AI_IMAGE_GET_ERROR",
|
|
1226
|
-
title:
|
|
1223
|
+
title: C("Something went wrong, please try again"),
|
|
1227
1224
|
placement: "bottomRight",
|
|
1228
|
-
data:
|
|
1225
|
+
data: j
|
|
1229
1226
|
}));
|
|
1230
1227
|
}, [
|
|
1231
|
-
|
|
1232
|
-
|
|
1233
|
-
w,
|
|
1234
|
-
R,
|
|
1235
|
-
t,
|
|
1236
|
-
E,
|
|
1228
|
+
p,
|
|
1229
|
+
K,
|
|
1237
1230
|
C,
|
|
1231
|
+
v,
|
|
1232
|
+
t,
|
|
1233
|
+
j,
|
|
1234
|
+
y,
|
|
1238
1235
|
h
|
|
1239
1236
|
]);
|
|
1240
1237
|
return (0, n.useEffect)(() => {
|
|
1241
|
-
|
|
1242
|
-
}, [
|
|
1238
|
+
B.length > 1 && ae(B[B.length - 1]);
|
|
1239
|
+
}, [B, ae]), (0, n.useEffect)(() => {
|
|
1243
1240
|
(d || b.length > 0) && setTimeout(() => {
|
|
1244
|
-
let
|
|
1245
|
-
o.current && (
|
|
1241
|
+
let g = 550;
|
|
1242
|
+
o.current && (g = o.current.offsetHeight + 68), t(g);
|
|
1246
1243
|
}, 0);
|
|
1247
1244
|
}, [
|
|
1248
1245
|
o,
|
|
1249
|
-
|
|
1246
|
+
B,
|
|
1250
1247
|
b.length,
|
|
1251
1248
|
d,
|
|
1252
1249
|
t
|
|
1253
1250
|
]), {
|
|
1254
|
-
aiImageCounter:
|
|
1251
|
+
aiImageCounter: E,
|
|
1255
1252
|
setAiImageCounter: P,
|
|
1256
|
-
currentAiImgLimits:
|
|
1257
|
-
isFieldsDisabled:
|
|
1258
|
-
canGenerateImage:
|
|
1253
|
+
currentAiImgLimits: T,
|
|
1254
|
+
isFieldsDisabled: he,
|
|
1255
|
+
canGenerateImage: pe,
|
|
1259
1256
|
aiImageRequest: l,
|
|
1260
1257
|
imageAiList: b,
|
|
1261
|
-
setImageAiList:
|
|
1258
|
+
setImageAiList: p,
|
|
1262
1259
|
isLoadingAi: d,
|
|
1263
|
-
setIsLoadingAi:
|
|
1260
|
+
setIsLoadingAi: v,
|
|
1264
1261
|
loadingDuringGeneration: s,
|
|
1265
1262
|
setLoadingDuringGeneration: h,
|
|
1266
|
-
requestStatus:
|
|
1267
|
-
setRequestStatus:
|
|
1263
|
+
requestStatus: _,
|
|
1264
|
+
setRequestStatus: K,
|
|
1268
1265
|
handleGenerate: Y,
|
|
1269
|
-
handleLimitAiImgCount:
|
|
1270
|
-
convertBase64ToFile:
|
|
1271
|
-
isShiftPressed:
|
|
1272
|
-
setIsShiftPressed:
|
|
1273
|
-
currentReqId:
|
|
1274
|
-
setCurrentReqId:
|
|
1275
|
-
limitsInPlugin:
|
|
1266
|
+
handleLimitAiImgCount: ie,
|
|
1267
|
+
convertBase64ToFile: M,
|
|
1268
|
+
isShiftPressed: S,
|
|
1269
|
+
setIsShiftPressed: U,
|
|
1270
|
+
currentReqId: j,
|
|
1271
|
+
setCurrentReqId: x,
|
|
1272
|
+
limitsInPlugin: J
|
|
1276
1273
|
};
|
|
1277
1274
|
}
|
|
1278
|
-
var
|
|
1279
|
-
const
|
|
1275
|
+
var Ut = ({ setModalHeight: t, customRequest: e, aiTabRef: o, inputAiRef: a, isImageUploaded: i, setIsImageUploaded: l, aiImageRequest: b, setAiImageRequest: p, imageAiList: d, setImageAiList: v, isLoadingAi: I, setIsLoadingAi: w }) => {
|
|
1276
|
+
const C = u.useNavigate(), R = u.useDispatch(), { __: y, _n: L } = m.useI18n(), A = u.useAppConfig(), [G, O] = (0, n.useState)(!1), [D, H] = (0, n.useState)(null), { aiImageCounter: B, currentAiImgLimits: z, loadingDuringGeneration: V, requestStatus: ee, handleGenerate: q, convertBase64ToFile: E, isShiftPressed: P, setIsShiftPressed: j, limitsInPlugin: x } = Bt({
|
|
1280
1277
|
setModalHeight: t,
|
|
1281
1278
|
customRequest: e,
|
|
1282
1279
|
aiTabRef: o,
|
|
@@ -1284,58 +1281,58 @@ Select the appropriate plan to fulfil more requests`),
|
|
|
1284
1281
|
setIsImageUploaded: l,
|
|
1285
1282
|
aiImageRequest: b,
|
|
1286
1283
|
imageAiList: d,
|
|
1287
|
-
setImageAiList:
|
|
1288
|
-
isLoadingAi:
|
|
1289
|
-
setIsLoadingAi:
|
|
1284
|
+
setImageAiList: v,
|
|
1285
|
+
isLoadingAi: I,
|
|
1286
|
+
setIsLoadingAi: w,
|
|
1290
1287
|
onPluginAiImageLimitExceeded: () => O(!0),
|
|
1291
|
-
onImageGenerateLimitExceeded:
|
|
1292
|
-
}),
|
|
1293
|
-
|
|
1288
|
+
onImageGenerateLimitExceeded: H
|
|
1289
|
+
}), S = G && z > 0 ? ne.getAiTariffUpgradeStep(z) : null, U = S ? N.getLimitUpgradePresetDefinition(S.presetId) : null, _ = D ? N.getLimitUpgradePresetDefinition(D.presetId) : null, [K, s] = (0, n.useState)(!1), h = (0, n.useCallback)(() => s(!0), []), W = (0, n.useCallback)(() => s(!1), []), me = (0, n.useCallback)((F) => p(F.target.value), [p]), T = (0, n.useCallback)((F) => {
|
|
1290
|
+
F.key === "Shift" ? j(!0) : F.key === "Enter" && !P && (F.preventDefault(), q());
|
|
1294
1291
|
}, [
|
|
1295
1292
|
P,
|
|
1296
|
-
|
|
1297
|
-
|
|
1298
|
-
]),
|
|
1299
|
-
|
|
1300
|
-
}, [
|
|
1293
|
+
q,
|
|
1294
|
+
j
|
|
1295
|
+
]), J = (0, n.useCallback)((F) => {
|
|
1296
|
+
F.key === "Shift" && j(!1);
|
|
1297
|
+
}, [j]), $ = d[d.length - 1];
|
|
1301
1298
|
return (0, r.jsxs)("div", {
|
|
1302
1299
|
className: "image-ai",
|
|
1303
1300
|
children: [
|
|
1304
|
-
|
|
1301
|
+
U && S ? (0, r.jsx)(N.LimitUpgradeModal, {
|
|
1305
1302
|
open: !0,
|
|
1306
1303
|
onClose: () => O(!1),
|
|
1307
|
-
title:
|
|
1308
|
-
subtitle:
|
|
1309
|
-
usageResource:
|
|
1310
|
-
previousDisplay:
|
|
1311
|
-
nextDisplay:
|
|
1304
|
+
title: y(U.titleKey),
|
|
1305
|
+
subtitle: y(U.subtitleKey),
|
|
1306
|
+
usageResource: U.usageResource,
|
|
1307
|
+
previousDisplay: N.presetLimitDisplay(S.previousLimit),
|
|
1308
|
+
nextDisplay: N.presetLimitDisplay(S.nextLimit),
|
|
1312
1309
|
onChangePlan: () => {
|
|
1313
|
-
O(!1), document.body.classList.remove("editor"),
|
|
1310
|
+
O(!1), document.body.classList.remove("editor"), C("/billing"), R(Z.openModal(u.MODALS.SWITCH_TO_PLAN_MODAL));
|
|
1314
1311
|
}
|
|
1315
1312
|
}) : null,
|
|
1316
|
-
|
|
1313
|
+
_ && D ? (0, r.jsx)(N.LimitUpgradeModal, {
|
|
1317
1314
|
open: !0,
|
|
1318
|
-
onClose: () =>
|
|
1319
|
-
title:
|
|
1320
|
-
subtitle:
|
|
1321
|
-
usageResource:
|
|
1322
|
-
previousDisplay:
|
|
1323
|
-
nextDisplay:
|
|
1315
|
+
onClose: () => H(null),
|
|
1316
|
+
title: y(_.titleKey),
|
|
1317
|
+
subtitle: y(_.subtitleKey),
|
|
1318
|
+
usageResource: _.usageResource,
|
|
1319
|
+
previousDisplay: N.presetLimitDisplay(D.previousLimit),
|
|
1320
|
+
nextDisplay: N.presetLimitDisplay(D.nextLimit),
|
|
1324
1321
|
onChangePlan: () => {
|
|
1325
|
-
|
|
1322
|
+
H(null), document.body.classList.remove("editor"), C("/billing"), R(Z.openModal(u.MODALS.SWITCH_TO_PLAN_MODAL));
|
|
1326
1323
|
}
|
|
1327
1324
|
}) : null,
|
|
1328
|
-
|
|
1329
|
-
text: `${
|
|
1330
|
-
exceeded:
|
|
1325
|
+
x && (0, r.jsx)(m.LimitsCounter, {
|
|
1326
|
+
text: `${B} ${y("of")} ${z > 0 ? z : "∞"} images ${L("was used", "were used", B)}`,
|
|
1327
|
+
exceeded: z > 0 && B >= z,
|
|
1331
1328
|
style: { marginTop: -25 },
|
|
1332
1329
|
extra: (0, r.jsx)("span", {
|
|
1333
1330
|
style: {
|
|
1334
1331
|
textDecoration: "underline",
|
|
1335
1332
|
cursor: "pointer"
|
|
1336
1333
|
},
|
|
1337
|
-
onClick: () =>
|
|
1338
|
-
children:
|
|
1334
|
+
onClick: () => C(A.billingPageUrl || u.APP_ROUTES.billing),
|
|
1335
|
+
children: y("Need more?")
|
|
1339
1336
|
})
|
|
1340
1337
|
}),
|
|
1341
1338
|
(0, r.jsx)(m.Row, {
|
|
@@ -1346,43 +1343,43 @@ Select the appropriate plan to fulfil more requests`),
|
|
|
1346
1343
|
children: (0, r.jsx)(m.Form.Item, {
|
|
1347
1344
|
style: { margin: 0 },
|
|
1348
1345
|
children: (0, r.jsxs)("span", {
|
|
1349
|
-
className: `ant-input-affix-wrapper ant-input-affix-wrapper-lg image-ai__input-affix-wrapper${
|
|
1346
|
+
className: `ant-input-affix-wrapper ant-input-affix-wrapper-lg image-ai__input-affix-wrapper${K ? " ant-input-affix-wrapper-focused" : ""}`,
|
|
1350
1347
|
children: [(0, r.jsx)(m.TextArea, {
|
|
1351
1348
|
ref: a,
|
|
1352
|
-
onKeyDown:
|
|
1353
|
-
onKeyUp:
|
|
1349
|
+
onKeyDown: T,
|
|
1350
|
+
onKeyUp: J,
|
|
1354
1351
|
onFocus: h,
|
|
1355
1352
|
onBlur: W,
|
|
1356
1353
|
autoSize: !0,
|
|
1357
1354
|
allowClear: !0,
|
|
1358
1355
|
className: "text-area-input-hybrid image-ai__textarea",
|
|
1359
|
-
placeholder:
|
|
1356
|
+
placeholder: y("Generate image"),
|
|
1360
1357
|
value: b,
|
|
1361
|
-
onChange:
|
|
1358
|
+
onChange: me,
|
|
1362
1359
|
spellCheck: "false"
|
|
1363
1360
|
}), (0, r.jsx)("span", {
|
|
1364
1361
|
className: "ant-input-suffix image-ai__input-suffix",
|
|
1365
|
-
children:
|
|
1362
|
+
children: I || V ? (0, r.jsx)(N.EmIcons, {
|
|
1366
1363
|
icon: "LoadingOutlined",
|
|
1367
1364
|
className: "input-icon image-ai__input-icon",
|
|
1368
1365
|
spin: !0
|
|
1369
|
-
}) : (0, r.jsx)(
|
|
1366
|
+
}) : (0, r.jsx)(N.EmIcons, {
|
|
1370
1367
|
icon: "AI",
|
|
1371
1368
|
className: "input-icon image-ai__input-icon",
|
|
1372
|
-
onClick:
|
|
1369
|
+
onClick: q
|
|
1373
1370
|
})
|
|
1374
1371
|
})]
|
|
1375
1372
|
})
|
|
1376
1373
|
})
|
|
1377
1374
|
})
|
|
1378
1375
|
}),
|
|
1379
|
-
(
|
|
1376
|
+
(I || d.length > 0) && (0, r.jsxs)("div", {
|
|
1380
1377
|
className: "image-ai__preview",
|
|
1381
|
-
children: [
|
|
1378
|
+
children: [I && d.length === 0 && (0, r.jsx)("div", {
|
|
1382
1379
|
className: "image-ai__loading",
|
|
1383
1380
|
children: (0, r.jsxs)("div", {
|
|
1384
1381
|
className: "spin",
|
|
1385
|
-
children: [(0, r.jsx)(
|
|
1382
|
+
children: [(0, r.jsx)(N.EmIcons, {
|
|
1386
1383
|
icon: "LoadingOutlined",
|
|
1387
1384
|
style: { fontSize: 48 },
|
|
1388
1385
|
spin: !0
|
|
@@ -1393,77 +1390,77 @@ Select the appropriate plan to fulfil more requests`),
|
|
|
1393
1390
|
})
|
|
1394
1391
|
}), d.length > 0 && (0, r.jsxs)("div", {
|
|
1395
1392
|
className: "image-ai__image-item",
|
|
1396
|
-
children: [(0, r.jsx)(
|
|
1393
|
+
children: [(0, r.jsx)(Dt, { images: d }), (0, r.jsx)("div", {
|
|
1397
1394
|
className: "buttons",
|
|
1398
1395
|
children: (0, r.jsx)(m.Button, {
|
|
1399
|
-
onClick: () =>
|
|
1400
|
-
icon: (0, r.jsx)(
|
|
1401
|
-
children:
|
|
1396
|
+
onClick: () => E($),
|
|
1397
|
+
icon: (0, r.jsx)(N.EmIcons, { icon: "CheckOutlined" }),
|
|
1398
|
+
children: y("Use this one")
|
|
1402
1399
|
})
|
|
1403
1400
|
})]
|
|
1404
1401
|
})]
|
|
1405
1402
|
})
|
|
1406
1403
|
]
|
|
1407
1404
|
});
|
|
1408
|
-
},
|
|
1409
|
-
const { __:
|
|
1410
|
-
|
|
1405
|
+
}, Mt = ({ setNewLink: t, setCurrentImageLink: e, setModalHeight: o, setModalWidth: a, setImageGifList: i, imageGifList: l, currentReqGif: b, setCurrentReqGif: p, inputRef: d, setStockLink: v, customRequest: I }) => {
|
|
1406
|
+
const { __: w } = m.useI18n(), C = u.useAppConfig(), R = u.useIsStandalone(), y = m.useNotification(), [L, A] = (0, n.useState)(null), [G, O] = (0, n.useState)(!1), [D, H] = (0, n.useState)(25), [B] = Z.useLazyGetSearchGifQuery(), z = (0, n.useCallback)((s) => s instanceof Error || typeof s?.message == "string" && s.message ? s.message : typeof s?.error?.message == "string" && s.error.message ? s.error.message : w("Failed to load GIFs through the configured proxy chain."), [w]), V = (0, n.useCallback)((s) => {
|
|
1407
|
+
y.error({
|
|
1411
1408
|
id: "STOCK_GIFS_SEARCH_FAILED",
|
|
1412
|
-
title:
|
|
1413
|
-
description:
|
|
1409
|
+
title: w("Failed to load GIFs"),
|
|
1410
|
+
description: z(s)
|
|
1414
1411
|
});
|
|
1415
1412
|
}, [
|
|
1416
|
-
|
|
1417
|
-
|
|
1418
|
-
|
|
1413
|
+
w,
|
|
1414
|
+
z,
|
|
1415
|
+
y
|
|
1419
1416
|
]), ee = async () => {
|
|
1420
|
-
|
|
1417
|
+
G || (O(!0), B({
|
|
1421
1418
|
query: b,
|
|
1422
|
-
page:
|
|
1419
|
+
page: D
|
|
1423
1420
|
}).then((s) => {
|
|
1424
1421
|
if (s?.error) {
|
|
1425
|
-
|
|
1422
|
+
V(s.error), O(!1);
|
|
1426
1423
|
return;
|
|
1427
1424
|
}
|
|
1428
|
-
i((h) => [...h, ...s.data.data]), O(!1),
|
|
1425
|
+
i((h) => [...h, ...s.data.data]), O(!1), H((h) => h + 25);
|
|
1429
1426
|
}).catch(() => {
|
|
1430
1427
|
O(!1);
|
|
1431
1428
|
}));
|
|
1432
|
-
},
|
|
1433
|
-
const s = await
|
|
1429
|
+
}, q = async () => {
|
|
1430
|
+
const s = await B({
|
|
1434
1431
|
query: b,
|
|
1435
1432
|
page: 0
|
|
1436
1433
|
});
|
|
1437
1434
|
if (s?.error) {
|
|
1438
|
-
|
|
1435
|
+
V(s.error), i([]);
|
|
1439
1436
|
return;
|
|
1440
1437
|
}
|
|
1441
1438
|
s?.data?.data?.length > 0 && (i(s.data.data), setTimeout(() => {
|
|
1442
1439
|
o("84vh"), a(1060);
|
|
1443
1440
|
}, 0));
|
|
1444
|
-
},
|
|
1445
|
-
|
|
1446
|
-
|
|
1447
|
-
}, 2e3),
|
|
1448
|
-
}, P = { default: 3 },
|
|
1449
|
-
config:
|
|
1450
|
-
standalone:
|
|
1441
|
+
}, E = (s, h) => {
|
|
1442
|
+
A(h), setTimeout(() => {
|
|
1443
|
+
A(null);
|
|
1444
|
+
}, 2e3), v(`${s}`), e(`${s}`), I(`${s}`);
|
|
1445
|
+
}, P = { default: 3 }, j = (0, n.useCallback)((s) => u.getProxiedUrl(s, {
|
|
1446
|
+
config: C,
|
|
1447
|
+
standalone: R,
|
|
1451
1448
|
resourceType: "generic",
|
|
1452
1449
|
intent: "display"
|
|
1453
|
-
}), [
|
|
1450
|
+
}), [C, R]), { getDisplaySrc: x, handleLoad: S, handleError: U } = tt({
|
|
1454
1451
|
items: l,
|
|
1455
1452
|
getItemId: (0, n.useCallback)((s) => s.id, []),
|
|
1456
1453
|
getRequestUrl: (0, n.useCallback)((s) => s.images.downsized.url, []),
|
|
1457
|
-
createController:
|
|
1458
|
-
}),
|
|
1459
|
-
|
|
1460
|
-
},
|
|
1461
|
-
|
|
1454
|
+
createController: j
|
|
1455
|
+
}), _ = (s) => (h) => {
|
|
1456
|
+
S(s), h.target.parentNode.classList.add("loaded");
|
|
1457
|
+
}, K = (s) => () => {
|
|
1458
|
+
U(s);
|
|
1462
1459
|
};
|
|
1463
1460
|
return (0, r.jsxs)("div", {
|
|
1464
1461
|
className: "stock-tab",
|
|
1465
1462
|
children: [(0, r.jsxs)(m.Form, {
|
|
1466
|
-
onValuesChange:
|
|
1463
|
+
onValuesChange: q,
|
|
1467
1464
|
className: l.length > 0 ? "serach-results" : "",
|
|
1468
1465
|
children: [(0, r.jsx)(m.Row, {
|
|
1469
1466
|
gutter: 24,
|
|
@@ -1472,12 +1469,12 @@ Select the appropriate plan to fulfil more requests`),
|
|
|
1472
1469
|
children: (0, r.jsx)(m.Form.Item, {
|
|
1473
1470
|
className: "stock-search-input",
|
|
1474
1471
|
children: (0, r.jsx)(m.SearchInput, {
|
|
1475
|
-
onSearch:
|
|
1472
|
+
onSearch: q,
|
|
1476
1473
|
allowClear: !0,
|
|
1477
1474
|
size: l.length > 0 ? "medium" : "large",
|
|
1478
|
-
placeholder:
|
|
1475
|
+
placeholder: w("Search GIFs"),
|
|
1479
1476
|
value: b.keywords,
|
|
1480
|
-
onChange: (s) =>
|
|
1477
|
+
onChange: (s) => p((h) => ({
|
|
1481
1478
|
...h,
|
|
1482
1479
|
keywords: s.target.value
|
|
1483
1480
|
})),
|
|
@@ -1510,32 +1507,32 @@ Select the appropriate plan to fulfil more requests`),
|
|
|
1510
1507
|
lineHeight: "0",
|
|
1511
1508
|
boxSizing: "unset"
|
|
1512
1509
|
},
|
|
1513
|
-
children: (0, r.jsx)(
|
|
1510
|
+
children: (0, r.jsx)($e, {
|
|
1514
1511
|
dataLength: l && l.length,
|
|
1515
1512
|
next: ee,
|
|
1516
1513
|
hasMore: l,
|
|
1517
1514
|
endMessage: (0, r.jsxs)(m.Divider, {
|
|
1518
1515
|
plain: !0,
|
|
1519
|
-
children: [
|
|
1516
|
+
children: [w("That`s all we could find."), " 🤐"]
|
|
1520
1517
|
}),
|
|
1521
1518
|
scrollableTarget: "scrollableDiv",
|
|
1522
1519
|
style: { overflow: "visible" },
|
|
1523
1520
|
loader: (0, r.jsx)(m.Spin, { size: "small" }),
|
|
1524
|
-
children: (0, r.jsx)(
|
|
1521
|
+
children: (0, r.jsx)(Ne, {
|
|
1525
1522
|
breakpointCols: P,
|
|
1526
1523
|
className: "my-masonry-grid",
|
|
1527
1524
|
columnClassName: "my-masonry-grid_column",
|
|
1528
1525
|
children: l.map((s, h) => (0, r.jsxs)("div", {
|
|
1529
1526
|
className: "list-item",
|
|
1530
|
-
onClick: () =>
|
|
1527
|
+
onClick: () => E(s.images.downsized.url, s.id),
|
|
1531
1528
|
children: [
|
|
1532
1529
|
(0, r.jsx)("img", {
|
|
1533
|
-
className:
|
|
1530
|
+
className: L === s.id ? "loaded-image" : "",
|
|
1534
1531
|
width: "322px",
|
|
1535
|
-
src:
|
|
1532
|
+
src: x(s),
|
|
1536
1533
|
alt: s.title,
|
|
1537
|
-
onLoad:
|
|
1538
|
-
onError:
|
|
1534
|
+
onLoad: _(s),
|
|
1535
|
+
onError: K(s)
|
|
1539
1536
|
}),
|
|
1540
1537
|
(0, r.jsx)("a", {
|
|
1541
1538
|
rel: "noreferrer",
|
|
@@ -1547,7 +1544,7 @@ Select the appropriate plan to fulfil more requests`),
|
|
|
1547
1544
|
style: { backgroundImage: "url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAGQAAAAkCAYAAAB/up84AAAACXBIWXMAAAsTAAALEwEAmpwYAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAABSBJREFUeNrsWjFv2zoQVoMW8BZ18xaN3qLRW9QtW9OtW92to98vaPoP3K1b1S1b3c2jvWlUNm3lw1s8Mpu3PAo4Iocr70jKlp0COuCQlpKPx/t43x1pv3h8fEwGeT5yNoTgeclLZvza6NgxXoNaGRktjE6MpjC2NVqh92bwt4HxBI1ro0s0dgN2tvD5a8a/9vkq0M+xYKdG81A7Gp6pyBjZddrnO6N36Hkbqyn8u4L3vYC0hjLHeAbPVhC4TwAK/ewNvLsEhyxgFXLK2l/D4tvnOVrUiPEh1k/JjvLYyWENdeTcKazBBr6AdY4AqBTmbkIzhO4gvMumYLxAYKzgPTvhBBajYNwCksHYhOyYiow1KONaKYlfO8bPEWyGEfi5Iu+Vjizg7EzB3xvwWTMxWkHG4mDnMF6BnSnYncLzHWGG4BqiwZkKQMC7I0cOVTCJhvRUKNgNCmCOxhNmrBEWzwGi0Y6rIihbsnOH/JgE2hshKrLZv4Px9yhj1twafRlid/UIGWvlFdlVLirIkIM12nETGLeO2tTPECBUZuT/a7JBMpSxUybYLjulUCN2iEpHQoyuGWZJUCa8R/VGSZvGB0iOdjAO9n8EtC2zUxICSIoW0ICTmA53DCDKQzWZg89XAXZ2B2iMavBnjDKpBX6B1tnAM5aqQgGhnU2D6GmHuqw7AkaOPmP/bsHpFC1kTLqVhglS6fFNgX1MCXUHO1zR1h5AFOoSc1jjmKx/An/1PoBQasBSoZZ3hpyaOrg0IW2sRkG8JsU8CaCaLckAhfi6AG0cmeuzkyMQMtL+SiySkY3oA/EgGeICK0UOZYQKVsQpDAjm2BpsaAGQLMKnMdok3yLtpKS70yT7OUBcm7UTHb5grk5y1Csrj40MqUbUpgW7NXo+RunckODkQvdXM37iwm7b1VA7lAaVB4jUUZOUIzNxfOougAwy3GUN0qWG2IJJ09V2NcvIFE8c54nQelEHFM6C6chUhI+WZjjffDQkrenPhqmlrAC9Naof/aLhXZeNNfMZOk+MtPOVRjNmTpfcCut0+biGZ3PBj1ywWTOfqV3v+yjLFuDPRs8Ddu05vLtmsuHQ0s73wehvR0t7aGkPevfCM5fcGr0MbOW9NSSFwF52cP5KcLIv+X4EUGbCemcOqpoz73/haE4CZNkRjAR20vwENXHRc2bWEMyQuUuGVe4hc6K6rBmg7pKN0XdGX7dts9E3Rr8afUATFl1PqgLAG6T3AoX1nSVtMP9l5r5FVyiu+D14/YssRHOheGVQYNMeinrhsMcV2WVPRR1rIRT4QmiA5r4G6oxp0y6ZzFh4LvhmB84MHz1xta9vWQMrcFR/3iF+7DmEu2YoyTshRbuMvGE9hnwGPQR1tdR04aCueKrqAIgiu/AqcCf1JXPhfuoYosGHn4Hgqa6AnCK4IfSkCa1eCJRxLGnn+mX0rfDOJok4AsQAUpwQlND2++HIgNiOVO1LVRIgtXDPs0bpunEU08vktHLMpoJS1/d9qEo6h6gAzq7RRaPV+QmBeICzUUh2fIHzk0s3HedXwkEy2ReQmjn4XDzDjqkN4D/J04/y/np5KbSrrtbwAyx+kTxdf9tfpvSZIW9O3FScHJAF8PEFc5F2lQzSi5wJheoG3U/t0xYOcgBAcOHuAkr7mY9ditoAiCz2q8uvEcD8gJpSDuGNl5hfnaTJ0/fpheMUr4CitHCO6fqdesj359xh1tWiqggfdUCmcz9ZivZ7+BnQM5P/BRgABx8sJWqTxoYAAAAASUVORK5CYII=)" }
|
|
1548
1545
|
})
|
|
1549
1546
|
}),
|
|
1550
|
-
|
|
1547
|
+
L === s.id && (0, r.jsx)(m.Spin, {
|
|
1551
1548
|
className: "ant-spin",
|
|
1552
1549
|
size: "small"
|
|
1553
1550
|
})
|
|
@@ -1559,10 +1556,10 @@ Select the appropriate plan to fulfil more requests`),
|
|
|
1559
1556
|
})]
|
|
1560
1557
|
});
|
|
1561
1558
|
};
|
|
1562
|
-
function
|
|
1559
|
+
function Pt(t) {
|
|
1563
1560
|
if (!(t == null || t === "")) return t;
|
|
1564
1561
|
}
|
|
1565
|
-
async function
|
|
1562
|
+
async function Tt(t, e) {
|
|
1566
1563
|
if (t) {
|
|
1567
1564
|
if (t.url) return t.url;
|
|
1568
1565
|
if (typeof e.getFileById == "function" && t.id) {
|
|
@@ -1582,10 +1579,10 @@ Select the appropriate plan to fulfil more requests`),
|
|
|
1582
1579
|
return t.thumbnail || t.thumbnailUrl;
|
|
1583
1580
|
}
|
|
1584
1581
|
}
|
|
1585
|
-
function
|
|
1582
|
+
function Nt(t) {
|
|
1586
1583
|
if (!(!t?.success || !Array.isArray(t.detailed))) return t.detailed.find((e) => e?.success && e.data)?.data;
|
|
1587
1584
|
}
|
|
1588
|
-
function
|
|
1585
|
+
function Gt(t, e, o) {
|
|
1589
1586
|
if (t) return {
|
|
1590
1587
|
id: t.id,
|
|
1591
1588
|
name: t.name || e.name,
|
|
@@ -1605,11 +1602,11 @@ Select the appropriate plan to fulfil more requests`),
|
|
|
1605
1602
|
childrenCount: t.childrenCount
|
|
1606
1603
|
};
|
|
1607
1604
|
}
|
|
1608
|
-
async function
|
|
1605
|
+
async function Ft(t, e, o) {
|
|
1609
1606
|
if (!e) return;
|
|
1610
|
-
const a =
|
|
1607
|
+
const a = Pt(o ?? e.rootId);
|
|
1611
1608
|
let i;
|
|
1612
|
-
typeof e.uploadFiles == "function" ? i =
|
|
1609
|
+
typeof e.uploadFiles == "function" ? i = Nt(await e.uploadFiles({
|
|
1613
1610
|
folderId: a,
|
|
1614
1611
|
items: [{
|
|
1615
1612
|
name: t.name,
|
|
@@ -1618,307 +1615,305 @@ Select the appropriate plan to fulfil more requests`),
|
|
|
1618
1615
|
folderId: a,
|
|
1619
1616
|
data: t
|
|
1620
1617
|
}]
|
|
1621
|
-
})) : typeof e.uploadFile == "function" && (i =
|
|
1618
|
+
})) : typeof e.uploadFile == "function" && (i = Gt(await e.uploadFile({
|
|
1622
1619
|
name: t.name,
|
|
1623
1620
|
size: t.size,
|
|
1624
1621
|
type: t.type,
|
|
1625
1622
|
folderId: a,
|
|
1626
1623
|
data: t
|
|
1627
1624
|
}), t, a));
|
|
1628
|
-
const l = await
|
|
1625
|
+
const l = await Tt(i, e);
|
|
1629
1626
|
return l ? {
|
|
1630
1627
|
item: i,
|
|
1631
1628
|
url: l
|
|
1632
1629
|
} : void 0;
|
|
1633
1630
|
}
|
|
1634
|
-
var
|
|
1635
|
-
const o =
|
|
1631
|
+
var st = "IMG", at = "BACKGROUND", zt = "GALLERY", we = "EDITOR", fe = "UPLOAD", Fe = "STOCK", ze = "GIF", Ke = "AI", Kt = { mode: "select" }, Wt = { mode: "save" }, { Dragger: Ht } = m.Upload, Vt = (t, e = "image") => Z.decodeFileNameFromUrl(t) ?? e, je = ne.normalizeImageFormatForDisplay, qt = (t, e) => {
|
|
1632
|
+
const o = je(e);
|
|
1636
1633
|
return !o || t.includes(".") ? t : `${t}.${o}`;
|
|
1637
|
-
},
|
|
1638
|
-
const e = u.useAppConfig(), o = u.useIsStandalone(), { __: a } = m.useI18n(), i = u.useDispatch(), { projectId: l } =
|
|
1634
|
+
}, Qt = (t, e) => new File([t], qt(Vt(e), t.type), { type: t.type || "application/octet-stream" }), ot = ({ dataProvider: t }) => {
|
|
1635
|
+
const e = u.useAppConfig(), o = u.useIsStandalone(), { __: a } = m.useI18n(), i = u.useDispatch(), { projectId: l } = u.useParams(), [b] = Z.useLazyGetImageInfoQuery(), { modal: p } = m.App.useApp(), d = m.useNotification(), v = u.useSelector(Z.selectActiveModal), { request: I, resolveImagePicker: w } = N.useImagePicker(), [C, R] = (0, n.useState)(""), [y, L] = (0, n.useState)(""), [A, G] = (0, n.useState)(""), [O, D] = (0, n.useState)(""), [H, B] = (0, n.useState)(fe), [z, V] = (0, n.useState)({
|
|
1639
1636
|
width: "",
|
|
1640
1637
|
height: "",
|
|
1641
1638
|
size: "",
|
|
1642
1639
|
format: ""
|
|
1643
|
-
}), [
|
|
1640
|
+
}), [ee, q] = (0, n.useState)("success"), [E, P] = (0, n.useState)(!1), j = n.default.useRef(null), x = n.default.useRef(null), S = n.default.useRef(null), U = n.default.useRef(null), _ = n.default.useRef(null), K = n.default.useRef(null), s = n.default.useRef(null), h = n.default.useRef(null), W = n.default.useRef(null), [me, T] = (0, n.useState)("auto"), [J, $] = (0, n.useState)(572), [F, he] = (0, n.useState)(!1), [ie, pe] = (0, n.useState)({
|
|
1644
1641
|
keywords: "",
|
|
1645
1642
|
color: "",
|
|
1646
1643
|
orientation: ""
|
|
1647
|
-
}), [
|
|
1644
|
+
}), [Ae, Y] = (0, n.useState)({ keywords: "" }), [re, M] = (0, n.useState)([]), [ae, g] = (0, n.useState)([]), [te, X] = (0, n.useState)([]), [ce, it] = (0, n.useState)(!1), [lt, We] = (0, n.useState)(""), [_t, Ee] = (0, n.useState)(!1), [Yt, Be] = (0, n.useState)(0), He = u.useSelector(u.selectProject), ct = He?.id !== void 0 ? String(He.id) : l || "", ut = u.useEventEmitter(u.events.UPLOAD_EVENT_ID), Ie = n.default.useRef(ne.createImageUrlBlobResolver()), Ve = n.default.useRef(""), Ce = n.default.useRef(0), xe = n.default.useRef(""), [Zt, dt] = (0, n.useState)(""), [Xt, ft] = (0, n.useState)(null), [Jt, qe] = (0, n.useState)(""), Ue = (0, n.useCallback)((c) => {
|
|
1648
1645
|
if (!(c instanceof Blob)) return;
|
|
1649
1646
|
xe.current && URL.revokeObjectURL(xe.current);
|
|
1650
1647
|
const f = URL.createObjectURL(c);
|
|
1651
|
-
xe.current = f,
|
|
1648
|
+
xe.current = f, dt(f), ft(c);
|
|
1652
1649
|
}, []), ge = (0, n.useCallback)(() => {
|
|
1653
|
-
xe.current && (URL.revokeObjectURL(xe.current), xe.current = ""),
|
|
1654
|
-
}, []),
|
|
1655
|
-
|
|
1656
|
-
}, [])
|
|
1657
|
-
|
|
1658
|
-
|
|
1659
|
-
|
|
1660
|
-
}, Me = (0, n.useCallback)((c, f, S = a("The image could not be uploaded.")) => {
|
|
1661
|
-
const V = f instanceof Error ? f.message : S;
|
|
1650
|
+
xe.current && (URL.revokeObjectURL(xe.current), xe.current = ""), dt(""), ft(null);
|
|
1651
|
+
}, []), le = (0, n.useCallback)(() => {
|
|
1652
|
+
qe("");
|
|
1653
|
+
}, []), ye = N.isEditorLockedByPlan(He, { isPlugin: u.PLUGIN.isPlugin }), $t = (c) => {
|
|
1654
|
+
L(c.target.value);
|
|
1655
|
+
}, Me = (0, n.useCallback)((c, f, k = a("The image could not be uploaded.")) => {
|
|
1656
|
+
const Q = f instanceof Error ? f.message : k;
|
|
1662
1657
|
d.error({
|
|
1663
1658
|
id: "IMAGE_UPLOAD_ERROR",
|
|
1664
1659
|
data: c,
|
|
1665
1660
|
title: a("Upload failed"),
|
|
1666
|
-
description:
|
|
1661
|
+
description: Q
|
|
1667
1662
|
});
|
|
1668
|
-
}, [a, d]),
|
|
1663
|
+
}, [a, d]), en = (0, n.useCallback)(async (c) => N.pickUploadImageUrlFromFireResults(await ut.fire({
|
|
1669
1664
|
file: c,
|
|
1670
|
-
project:
|
|
1671
|
-
})), [
|
|
1665
|
+
project: ct
|
|
1666
|
+
})), [ct, ut]), be = ne.useImageBlobFetch(), tn = (0, n.useCallback)((c) => Ie.current.resolve(ne.canonicalImageUrlKey(c), void 0, be), [be]), Pe = async (c) => {
|
|
1672
1667
|
if (c) try {
|
|
1673
|
-
const f = await
|
|
1674
|
-
f &&
|
|
1668
|
+
const f = await nn(c);
|
|
1669
|
+
f && _e(f) ? await Oe({ file: f }) : f || Me({ url: c }, null, a("Failed to download image from URL."));
|
|
1675
1670
|
} catch (f) {
|
|
1676
1671
|
Me({ url: c }, f, a("Failed to process image URL."));
|
|
1677
1672
|
}
|
|
1678
|
-
},
|
|
1679
|
-
|
|
1680
|
-
if (
|
|
1673
|
+
}, mt = n.default.useRef(Pe);
|
|
1674
|
+
mt.current = Pe, n.default.useEffect(() => {
|
|
1675
|
+
if (H !== fe || !O) return;
|
|
1681
1676
|
const c = y.trim();
|
|
1682
1677
|
if (!c || !c.toLowerCase().startsWith("http")) return;
|
|
1683
1678
|
const f = setTimeout(() => {
|
|
1684
|
-
|
|
1679
|
+
mt.current(c);
|
|
1685
1680
|
}, 1e3);
|
|
1686
1681
|
return () => {
|
|
1687
1682
|
clearTimeout(f);
|
|
1688
1683
|
};
|
|
1689
1684
|
}, [
|
|
1690
1685
|
y,
|
|
1691
|
-
|
|
1692
|
-
|
|
1686
|
+
H,
|
|
1687
|
+
O
|
|
1693
1688
|
]);
|
|
1694
|
-
const
|
|
1689
|
+
const nn = async (c) => {
|
|
1695
1690
|
try {
|
|
1696
1691
|
const f = ne.canonicalImageUrlKey(c);
|
|
1697
|
-
return
|
|
1692
|
+
return Qt(await Ie.current.resolve(f, void 0, be), f);
|
|
1698
1693
|
} catch {}
|
|
1699
1694
|
};
|
|
1700
1695
|
document.onpaste = function(c) {
|
|
1701
1696
|
const f = c.clipboardData?.items?.[0];
|
|
1702
|
-
if (
|
|
1697
|
+
if (H === fe && O) {
|
|
1703
1698
|
if (f?.type?.indexOf("image") === 0 && e.imageCenterLocalUploadEnabled !== !1) {
|
|
1704
|
-
const
|
|
1705
|
-
|
|
1706
|
-
const oe = { file:
|
|
1707
|
-
|
|
1699
|
+
const Q = f.getAsFile();
|
|
1700
|
+
_e(Q);
|
|
1701
|
+
const oe = { file: Q };
|
|
1702
|
+
L(""), Oe(oe);
|
|
1708
1703
|
return;
|
|
1709
1704
|
}
|
|
1710
|
-
const
|
|
1711
|
-
if (
|
|
1712
|
-
c.preventDefault(), c.stopPropagation(),
|
|
1705
|
+
const k = c.clipboardData?.getData("text/plain");
|
|
1706
|
+
if (k && k.trim().toLowerCase().startsWith("http")) {
|
|
1707
|
+
c.preventDefault(), c.stopPropagation(), L(k.trim());
|
|
1713
1708
|
return;
|
|
1714
1709
|
}
|
|
1715
|
-
f?.type?.indexOf("text") === 0 && f.getAsString((
|
|
1716
|
-
if (
|
|
1717
|
-
else if (
|
|
1718
|
-
const oe =
|
|
1719
|
-
oe &&
|
|
1710
|
+
f?.type?.indexOf("text") === 0 && f.getAsString((Q) => {
|
|
1711
|
+
if (Q.trim().toLowerCase().startsWith("http")) L(Q.trim());
|
|
1712
|
+
else if (Q.toString().slice(1, 5) === "meta") {
|
|
1713
|
+
const oe = Q.toString().split("\"")[1];
|
|
1714
|
+
oe && L(oe);
|
|
1720
1715
|
}
|
|
1721
1716
|
});
|
|
1722
1717
|
}
|
|
1723
1718
|
}, (0, n.useEffect)(() => {
|
|
1724
1719
|
const c = (f) => {
|
|
1725
|
-
let
|
|
1726
|
-
|
|
1720
|
+
let k = null;
|
|
1721
|
+
I?.kind === "background" ? (k = at, D(at)) : I?.kind === "img" && (D(st), k = st), I?.currentUrl && k && (R(I.currentUrl), B(f));
|
|
1727
1722
|
};
|
|
1728
|
-
|
|
1723
|
+
v === u.MODALS.UPLOAD_IMAGE_MODAL || v === u.MODALS.UPLOAD_BACKGROUND_MODAL ? c(we) : v === u.MODALS.UPLOAD_IMAGE_MODAL_AI || v === u.MODALS.UPLOAD_BACKGROUND_MODAL_AI ? (ye ? (Ee(!0), Be(2)) : c(Ke), setTimeout(() => W.current?.focus({ cursor: "start" }), 100)) : v === u.MODALS.UPLOAD_IMAGE_MODAL_UPLOAD || v === u.MODALS.UPLOAD_BACKGROUND_MODAL_UPLOAD ? (c(fe), setTimeout(() => K.current?.focus({ cursor: "start" }), 100)) : v === u.MODALS.UPLOAD_IMAGE_MODAL_STOCK || v === u.MODALS.UPLOAD_BACKGROUND_MODAL_STOCK ? (ye ? (Ee(!0), Be(3)) : c(Fe), setTimeout(() => h.current?.focus({ cursor: "start" }), 100)) : v === u.MODALS.UPLOAD_IMAGE_MODAL_GIF || v === u.MODALS.UPLOAD_BACKGROUND_MODAL_GIF ? (ye ? (Ee(!0), Be(3)) : c(ze), setTimeout(() => s.current?.focus({ cursor: "start" }), 100)) : v === u.MODALS.UPLOAD_IMAGE_MODAL_EDIT || v === u.MODALS.UPLOAD_BACKGROUND_MODAL_EDIT ? (ye ? (Ee(!0), Be(5)) : c(we), i(Z.openSecondModal(u.MODALS.IMAGE_EDITOR_MODAL))) : D("");
|
|
1729
1724
|
}, [
|
|
1730
|
-
|
|
1725
|
+
v,
|
|
1731
1726
|
i,
|
|
1732
|
-
|
|
1733
|
-
|
|
1727
|
+
ye,
|
|
1728
|
+
I
|
|
1734
1729
|
]);
|
|
1735
|
-
const
|
|
1736
|
-
|
|
1730
|
+
const Qe = (0, n.useCallback)(({ url: c = C || "", meta: f = Kt }) => {
|
|
1731
|
+
R(c), w({
|
|
1737
1732
|
url: c,
|
|
1738
1733
|
meta: f
|
|
1739
1734
|
}), setTimeout(() => {
|
|
1740
|
-
|
|
1735
|
+
le(), ge(), pe({
|
|
1741
1736
|
keywords: "",
|
|
1742
1737
|
color: "",
|
|
1743
1738
|
orientation: ""
|
|
1744
|
-
}),
|
|
1745
|
-
}, 200), i(
|
|
1739
|
+
}), Y({ keywords: "" }), g([]), M([]), D(""), We(""), it(!1), G(""), L(""), B(fe);
|
|
1740
|
+
}, 200), i(Z.closeModal()), i(Z.closeSecondModal());
|
|
1746
1741
|
}, [
|
|
1747
1742
|
C,
|
|
1748
|
-
|
|
1743
|
+
le,
|
|
1749
1744
|
i,
|
|
1750
|
-
|
|
1745
|
+
w,
|
|
1751
1746
|
ge
|
|
1752
|
-
]),
|
|
1747
|
+
]), pt = (0, n.useCallback)((c, f) => (T("auto"), P(!1), Qe({
|
|
1753
1748
|
url: c,
|
|
1754
|
-
meta:
|
|
1749
|
+
meta: Wt
|
|
1755
1750
|
}), d.success({
|
|
1756
1751
|
id: "IMAGE_UPLOAD_SUCCESS",
|
|
1757
1752
|
data: f,
|
|
1758
1753
|
title: a("The image was successfully uploaded.")
|
|
1759
1754
|
}), c), [
|
|
1760
1755
|
a,
|
|
1761
|
-
|
|
1756
|
+
Qe,
|
|
1762
1757
|
d
|
|
1763
1758
|
]);
|
|
1764
1759
|
(0, n.useEffect)(() => {
|
|
1765
|
-
const c = y ||
|
|
1760
|
+
const c = y || A, f = ne.canonicalImageUrlKey(c);
|
|
1766
1761
|
if (!c || !f) {
|
|
1767
|
-
|
|
1762
|
+
q(""), Ve.current = "", le(), ge(), Ie.current.invalidateAll();
|
|
1768
1763
|
return;
|
|
1769
1764
|
}
|
|
1770
|
-
const
|
|
1771
|
-
|
|
1772
|
-
const
|
|
1765
|
+
const k = Ve.current;
|
|
1766
|
+
k && k !== f && (Ie.current.abandonKey(k), le(), ge()), Ve.current = f;
|
|
1767
|
+
const Q = new AbortController(), oe = y ? 800 : 0, se = ++Ce.current, Ye = setTimeout(async () => {
|
|
1773
1768
|
try {
|
|
1774
1769
|
const Se = async () => {
|
|
1775
|
-
const
|
|
1776
|
-
if (
|
|
1777
|
-
const { width:
|
|
1778
|
-
|
|
1779
|
-
width:
|
|
1780
|
-
height:
|
|
1781
|
-
size: (
|
|
1782
|
-
format:
|
|
1783
|
-
}),
|
|
1770
|
+
const ue = await Ie.current.resolve(f, Q.signal, be);
|
|
1771
|
+
if (se !== Ce.current) return;
|
|
1772
|
+
const { width: ve, height: on } = await ne.getImageDimensionsFromBlob(ue);
|
|
1773
|
+
se === Ce.current && (V({
|
|
1774
|
+
width: ve,
|
|
1775
|
+
height: on,
|
|
1776
|
+
size: (ue.size / 1024).toFixed(2),
|
|
1777
|
+
format: je(ue.type)
|
|
1778
|
+
}), le(), Ue(ue));
|
|
1784
1779
|
};
|
|
1785
1780
|
if (o) await Se();
|
|
1786
1781
|
else {
|
|
1787
|
-
const
|
|
1788
|
-
if (
|
|
1789
|
-
|
|
1782
|
+
const ue = await ne.resolveDataProviderPreview(t, f);
|
|
1783
|
+
if (ue?.previewUrl && se === Ce.current) {
|
|
1784
|
+
qe(ue.previewUrl), ge();
|
|
1790
1785
|
try {
|
|
1791
|
-
const { data:
|
|
1792
|
-
if (
|
|
1793
|
-
|
|
1794
|
-
width:
|
|
1795
|
-
height:
|
|
1796
|
-
size:
|
|
1797
|
-
format:
|
|
1786
|
+
const { data: ve } = await b(f);
|
|
1787
|
+
if (se !== Ce.current) return;
|
|
1788
|
+
ve ? V({
|
|
1789
|
+
width: ve?.width,
|
|
1790
|
+
height: ve?.height,
|
|
1791
|
+
size: ve?.fileSize != null ? (ve.fileSize / 1024).toFixed(2) : "",
|
|
1792
|
+
format: je(ve?.format)
|
|
1798
1793
|
}) : await Se();
|
|
1799
1794
|
} catch {
|
|
1800
1795
|
await Se();
|
|
1801
1796
|
}
|
|
1802
1797
|
} else await Se();
|
|
1803
1798
|
}
|
|
1804
|
-
if (
|
|
1805
|
-
|
|
1806
|
-
let
|
|
1807
|
-
|
|
1799
|
+
if (se !== Ce.current) return;
|
|
1800
|
+
q("success"), R(c), $(572), setTimeout(() => {
|
|
1801
|
+
let ue = 0;
|
|
1802
|
+
x.current && (ue = x.current.offsetHeight + 62), T(ue);
|
|
1808
1803
|
}, 0);
|
|
1809
1804
|
} catch (Se) {
|
|
1810
|
-
if (Se?.name === "AbortError" ||
|
|
1811
|
-
|
|
1805
|
+
if (Se?.name === "AbortError" || Q.signal.aborted || se !== Ce.current) return;
|
|
1806
|
+
le(), ge(), q("error");
|
|
1812
1807
|
}
|
|
1813
1808
|
}, oe);
|
|
1814
1809
|
return () => {
|
|
1815
|
-
clearTimeout(
|
|
1810
|
+
clearTimeout(Ye), Q.abort();
|
|
1816
1811
|
};
|
|
1817
1812
|
}, [
|
|
1818
1813
|
y,
|
|
1819
|
-
|
|
1814
|
+
A,
|
|
1820
1815
|
o,
|
|
1821
|
-
|
|
1822
|
-
|
|
1816
|
+
le,
|
|
1817
|
+
be,
|
|
1823
1818
|
b,
|
|
1824
1819
|
ge,
|
|
1825
1820
|
t,
|
|
1826
1821
|
Ue
|
|
1827
1822
|
]), (0, n.useEffect)(() => {
|
|
1828
|
-
if (!C || y ||
|
|
1823
|
+
if (!C || y || A) return;
|
|
1829
1824
|
const c = ne.canonicalImageUrlKey(C), f = new AbortController();
|
|
1830
|
-
let
|
|
1831
|
-
const
|
|
1832
|
-
const oe = await Ie.current.resolve(c, f.signal,
|
|
1833
|
-
if (
|
|
1834
|
-
const { width:
|
|
1835
|
-
|
|
1836
|
-
width:
|
|
1837
|
-
height:
|
|
1825
|
+
let k = !1;
|
|
1826
|
+
const Q = async () => {
|
|
1827
|
+
const oe = await Ie.current.resolve(c, f.signal, be);
|
|
1828
|
+
if (k) return;
|
|
1829
|
+
const { width: se, height: Ye } = await ne.getImageDimensionsFromBlob(oe);
|
|
1830
|
+
k || (le(), Ue(oe), V({
|
|
1831
|
+
width: se,
|
|
1832
|
+
height: Ye,
|
|
1838
1833
|
size: (oe.size / 1024).toFixed(2),
|
|
1839
|
-
format:
|
|
1834
|
+
format: je(oe.type)
|
|
1840
1835
|
}));
|
|
1841
1836
|
};
|
|
1842
1837
|
return (async () => {
|
|
1843
1838
|
try {
|
|
1844
1839
|
if (!o) {
|
|
1845
1840
|
const oe = await ne.resolveDataProviderPreview(t, c);
|
|
1846
|
-
if (oe?.previewUrl && !
|
|
1847
|
-
|
|
1841
|
+
if (oe?.previewUrl && !k) {
|
|
1842
|
+
qe(oe.previewUrl), ge();
|
|
1848
1843
|
try {
|
|
1849
|
-
const { data:
|
|
1850
|
-
if (
|
|
1851
|
-
|
|
1852
|
-
width:
|
|
1853
|
-
height:
|
|
1854
|
-
size:
|
|
1855
|
-
format:
|
|
1856
|
-
}) : await
|
|
1844
|
+
const { data: se } = await b(c);
|
|
1845
|
+
if (k) return;
|
|
1846
|
+
se ? V({
|
|
1847
|
+
width: se?.width,
|
|
1848
|
+
height: se?.height,
|
|
1849
|
+
size: se?.fileSize != null ? (se.fileSize / 1024).toFixed(2) : "",
|
|
1850
|
+
format: je(se?.format)
|
|
1851
|
+
}) : await Q();
|
|
1857
1852
|
return;
|
|
1858
1853
|
} catch {
|
|
1859
|
-
await
|
|
1854
|
+
await Q();
|
|
1860
1855
|
}
|
|
1861
1856
|
}
|
|
1862
1857
|
}
|
|
1863
|
-
await
|
|
1858
|
+
await Q();
|
|
1864
1859
|
} catch {
|
|
1865
|
-
|
|
1860
|
+
k || le();
|
|
1866
1861
|
}
|
|
1867
1862
|
})(), () => {
|
|
1868
|
-
|
|
1863
|
+
k = !0, f.abort();
|
|
1869
1864
|
};
|
|
1870
1865
|
}, [
|
|
1871
1866
|
o,
|
|
1872
|
-
|
|
1867
|
+
le,
|
|
1873
1868
|
C,
|
|
1874
|
-
|
|
1869
|
+
be,
|
|
1875
1870
|
b,
|
|
1876
1871
|
t,
|
|
1877
1872
|
y,
|
|
1878
|
-
|
|
1873
|
+
A,
|
|
1879
1874
|
Ue
|
|
1880
1875
|
]);
|
|
1881
|
-
const
|
|
1882
|
-
i(
|
|
1883
|
-
|
|
1876
|
+
const rn = () => {
|
|
1877
|
+
i(Z.closeModal()), setTimeout(() => {
|
|
1878
|
+
le(), ge(), R(""), L(""), g([]), g([]), pe({
|
|
1884
1879
|
keywords: "",
|
|
1885
1880
|
color: "",
|
|
1886
1881
|
orientation: ""
|
|
1887
|
-
}),
|
|
1882
|
+
}), Y({ keywords: "" }), T("auto"), !ce && We(""), $(572), B(fe);
|
|
1888
1883
|
}, 200);
|
|
1889
|
-
},
|
|
1890
|
-
c ===
|
|
1884
|
+
}, sn = (c) => {
|
|
1885
|
+
c === zt ? p.success({
|
|
1891
1886
|
mask: { closable: !0 },
|
|
1892
1887
|
centered: !0,
|
|
1893
1888
|
title: a("Coming soon"),
|
|
1894
1889
|
content: a("The feature is under development."),
|
|
1895
1890
|
okText: a("Ok. I'll be waiting"),
|
|
1896
1891
|
onOk: () => {}
|
|
1897
|
-
}) : c ===
|
|
1892
|
+
}) : c === we && C === "" ? p.warning({
|
|
1898
1893
|
mask: { closable: !0 },
|
|
1899
1894
|
centered: !0,
|
|
1900
1895
|
title: a(""),
|
|
1901
1896
|
content: a("To preview and edit the uploaded image"),
|
|
1902
1897
|
okText: a("Upload Image"),
|
|
1903
1898
|
onOk: () => {
|
|
1904
|
-
|
|
1899
|
+
B(fe);
|
|
1905
1900
|
}
|
|
1906
1901
|
}) : (setTimeout(() => {
|
|
1907
|
-
let f = 0,
|
|
1908
|
-
c ===
|
|
1909
|
-
}, 0),
|
|
1902
|
+
let f = 0, k = 0;
|
|
1903
|
+
c === fe && j.current ? (ie.keywords === "" && K.current?.focus({ cursor: "start" }), f = 300, k = 572) : c === we && x.current ? (f = x.current.offsetHeight + 62, k = 572) : c === Fe && S.current ? (ie.keywords === "" && h.current?.focus({ cursor: "start" }), f = 130, k = 572, ae.length > 0 && (k = 1060, f = "84vh")) : c === ze && U.current ? (ie.keywords === "" && s.current?.focus({ cursor: "start" }), f = 130, k = 572, re.length > 0 && (k = 1060, f = "84vh")) : c === Ke && _.current && (lt === "" && te.length === 0 ? (W.current?.focus({ cursor: "start" }), f = 130) : f = _.current.offsetHeight + 82, k = 572), T(f), $(k);
|
|
1904
|
+
}, 0), B(c));
|
|
1910
1905
|
};
|
|
1911
1906
|
(0, n.useEffect)(() => {
|
|
1912
|
-
|
|
1913
|
-
|
|
1907
|
+
ie.keywords === "" && (K?.current?.focus({ cursor: "start" }), g([]), setTimeout(() => {
|
|
1908
|
+
T("auto"), $(572);
|
|
1914
1909
|
}, 0));
|
|
1915
1910
|
}, [
|
|
1916
|
-
|
|
1917
|
-
|
|
1918
|
-
|
|
1919
|
-
|
|
1911
|
+
ie,
|
|
1912
|
+
g,
|
|
1913
|
+
T,
|
|
1914
|
+
$
|
|
1920
1915
|
]);
|
|
1921
|
-
const
|
|
1916
|
+
const _e = (c) => {
|
|
1922
1917
|
const f = c.type === "image/jpeg" || c.type === "image/png" || c.type === "image/jpg" || c.type === "image/webp" || c.type === "image/gif" || c.type === "image/svg+xml";
|
|
1923
1918
|
return f || d.error({
|
|
1924
1919
|
id: "IMAGE_UPLOAD_WRONG_FORMAT",
|
|
@@ -1928,30 +1923,30 @@ Select the appropriate plan to fulfil more requests`),
|
|
|
1928
1923
|
}), f;
|
|
1929
1924
|
}, Oe = async ({ file: c }) => {
|
|
1930
1925
|
try {
|
|
1931
|
-
|
|
1932
|
-
const f = await ne.prepareImageForEditorUpload(c, e),
|
|
1933
|
-
if (
|
|
1934
|
-
const
|
|
1935
|
-
if (
|
|
1926
|
+
he(!0);
|
|
1927
|
+
const f = await ne.prepareImageForEditorUpload(c, e), k = await en(f);
|
|
1928
|
+
if (k) return pt(k, f), k;
|
|
1929
|
+
const Q = await Ft(f, t);
|
|
1930
|
+
if (Q?.url) return pt(Q.url, f), Q.url;
|
|
1936
1931
|
Me(f, null);
|
|
1937
1932
|
return;
|
|
1938
1933
|
} catch (f) {
|
|
1939
1934
|
Me(c, f);
|
|
1940
1935
|
return;
|
|
1941
1936
|
} finally {
|
|
1942
|
-
|
|
1937
|
+
he(!1);
|
|
1943
1938
|
}
|
|
1944
|
-
},
|
|
1939
|
+
}, an = (c) => Oe({ file: c });
|
|
1945
1940
|
let Le = [{
|
|
1946
1941
|
label: a("Upload"),
|
|
1947
|
-
key:
|
|
1942
|
+
key: fe,
|
|
1948
1943
|
children: (0, r.jsxs)("div", {
|
|
1949
|
-
ref:
|
|
1944
|
+
ref: j,
|
|
1950
1945
|
style: { paddingBottom: 24 },
|
|
1951
|
-
children: [e.imageCenterLocalUploadEnabled !== !1 && (0, r.jsxs)(
|
|
1946
|
+
children: [e.imageCenterLocalUploadEnabled !== !1 && (0, r.jsxs)(Ht, {
|
|
1952
1947
|
showUploadList: !1,
|
|
1953
1948
|
name: "Image",
|
|
1954
|
-
beforeUpload:
|
|
1949
|
+
beforeUpload: _e,
|
|
1955
1950
|
customRequest: Oe,
|
|
1956
1951
|
style: { marginBottom: 10 },
|
|
1957
1952
|
multiple: !1,
|
|
@@ -1959,7 +1954,7 @@ Select the appropriate plan to fulfil more requests`),
|
|
|
1959
1954
|
children: [
|
|
1960
1955
|
(0, r.jsx)("p", {
|
|
1961
1956
|
className: "ant-upload-drag-icon",
|
|
1962
|
-
children: (0, r.jsx)(
|
|
1957
|
+
children: (0, r.jsx)(N.EmIcons, { icon: "InboxOutlined" })
|
|
1963
1958
|
}),
|
|
1964
1959
|
(0, r.jsx)("p", {
|
|
1965
1960
|
className: "ant-upload-text",
|
|
@@ -1973,123 +1968,123 @@ Select the appropriate plan to fulfil more requests`),
|
|
|
1973
1968
|
}), (0, r.jsx)(m.Form, {
|
|
1974
1969
|
style: { padding: "0 2px 0 2px" },
|
|
1975
1970
|
children: (0, r.jsx)(m.Form.Item, {
|
|
1976
|
-
validateStatus:
|
|
1971
|
+
validateStatus: ee,
|
|
1977
1972
|
children: (0, r.jsx)(m.Input, {
|
|
1978
|
-
ref:
|
|
1973
|
+
ref: K,
|
|
1979
1974
|
allowClear: !0,
|
|
1980
1975
|
size: "large",
|
|
1981
1976
|
placeholder: a("Paste image URL here"),
|
|
1982
1977
|
value: y,
|
|
1983
|
-
onChange:
|
|
1978
|
+
onChange: $t,
|
|
1984
1979
|
spellCheck: "false"
|
|
1985
1980
|
})
|
|
1986
1981
|
})
|
|
1987
1982
|
})]
|
|
1988
1983
|
})
|
|
1989
1984
|
}];
|
|
1990
|
-
return e.imageCenterStockEnabled && !
|
|
1985
|
+
return e.imageCenterStockEnabled && !ye && Le.push({
|
|
1991
1986
|
label: a("Stock"),
|
|
1992
|
-
key:
|
|
1987
|
+
key: Fe,
|
|
1993
1988
|
children: (0, r.jsx)("div", {
|
|
1994
|
-
ref:
|
|
1989
|
+
ref: S,
|
|
1995
1990
|
style: { paddingBottom: 24 },
|
|
1996
|
-
children: (0, r.jsx)(
|
|
1997
|
-
currentReq:
|
|
1998
|
-
setCurrentReq:
|
|
1999
|
-
imageStockList:
|
|
2000
|
-
setImageStockList:
|
|
2001
|
-
setModalWidth:
|
|
2002
|
-
setModalHeight:
|
|
2003
|
-
setStockLink:
|
|
2004
|
-
setCurrentImageLink:
|
|
2005
|
-
inputRef:
|
|
1991
|
+
children: (0, r.jsx)(Ot, {
|
|
1992
|
+
currentReq: ie,
|
|
1993
|
+
setCurrentReq: pe,
|
|
1994
|
+
imageStockList: ae,
|
|
1995
|
+
setImageStockList: g,
|
|
1996
|
+
setModalWidth: $,
|
|
1997
|
+
setModalHeight: T,
|
|
1998
|
+
setStockLink: G,
|
|
1999
|
+
setCurrentImageLink: R,
|
|
2000
|
+
inputRef: h,
|
|
2006
2001
|
customRequest: Pe
|
|
2007
2002
|
})
|
|
2008
2003
|
})
|
|
2009
|
-
}), e.imageCenterGifEnabled && !
|
|
2004
|
+
}), e.imageCenterGifEnabled && !ye && Le.push({
|
|
2010
2005
|
label: a("GIF"),
|
|
2011
|
-
key:
|
|
2006
|
+
key: ze,
|
|
2012
2007
|
children: (0, r.jsx)("div", {
|
|
2013
|
-
ref:
|
|
2008
|
+
ref: U,
|
|
2014
2009
|
style: { paddingBottom: 24 },
|
|
2015
|
-
children: (0, r.jsx)(
|
|
2016
|
-
currentReqGif:
|
|
2017
|
-
setCurrentReqGif:
|
|
2018
|
-
imageGifList:
|
|
2019
|
-
setImageGifList:
|
|
2020
|
-
setModalWidth:
|
|
2021
|
-
setModalHeight:
|
|
2022
|
-
setStockLink:
|
|
2023
|
-
setCurrentImageLink:
|
|
2024
|
-
inputRef:
|
|
2010
|
+
children: (0, r.jsx)(Mt, {
|
|
2011
|
+
currentReqGif: Ae,
|
|
2012
|
+
setCurrentReqGif: Y,
|
|
2013
|
+
imageGifList: re,
|
|
2014
|
+
setImageGifList: M,
|
|
2015
|
+
setModalWidth: $,
|
|
2016
|
+
setModalHeight: T,
|
|
2017
|
+
setStockLink: G,
|
|
2018
|
+
setCurrentImageLink: R,
|
|
2019
|
+
inputRef: s,
|
|
2025
2020
|
customRequest: Pe
|
|
2026
2021
|
})
|
|
2027
2022
|
})
|
|
2028
|
-
}), e.elementAIimageEnabled && !
|
|
2023
|
+
}), e.elementAIimageEnabled && !ye && Le.push({
|
|
2029
2024
|
label: a("AI"),
|
|
2030
|
-
key:
|
|
2025
|
+
key: Ke,
|
|
2031
2026
|
children: (0, r.jsx)("div", {
|
|
2032
|
-
ref:
|
|
2027
|
+
ref: _,
|
|
2033
2028
|
style: { paddingBottom: 24 },
|
|
2034
|
-
children: (0, r.jsx)(
|
|
2035
|
-
setModalHeight:
|
|
2029
|
+
children: (0, r.jsx)(Ut, {
|
|
2030
|
+
setModalHeight: T,
|
|
2036
2031
|
customRequest: Oe,
|
|
2037
|
-
aiImageRequest:
|
|
2038
|
-
setAiImageRequest:
|
|
2039
|
-
imageAiList:
|
|
2040
|
-
setImageAiList:
|
|
2041
|
-
isLoadingAi:
|
|
2042
|
-
setIsLoadingAi:
|
|
2043
|
-
aiTabRef:
|
|
2044
|
-
inputAiRef:
|
|
2032
|
+
aiImageRequest: lt,
|
|
2033
|
+
setAiImageRequest: We,
|
|
2034
|
+
imageAiList: te,
|
|
2035
|
+
setImageAiList: X,
|
|
2036
|
+
isLoadingAi: ce,
|
|
2037
|
+
setIsLoadingAi: it,
|
|
2038
|
+
aiTabRef: _,
|
|
2039
|
+
inputAiRef: W,
|
|
2045
2040
|
isImageUploaded: E,
|
|
2046
|
-
setIsImageUploaded:
|
|
2041
|
+
setIsImageUploaded: P
|
|
2047
2042
|
})
|
|
2048
2043
|
})
|
|
2049
2044
|
}), e.imageCenterEditorEnabled && Le.push({
|
|
2050
2045
|
label: "",
|
|
2051
|
-
key:
|
|
2046
|
+
key: we,
|
|
2052
2047
|
children: (0, r.jsx)("div", {
|
|
2053
|
-
ref:
|
|
2054
|
-
children: (0, r.jsx)(
|
|
2048
|
+
ref: x,
|
|
2049
|
+
children: (0, r.jsx)(It, {
|
|
2055
2050
|
currentImageLink: C,
|
|
2056
2051
|
newLink: y,
|
|
2057
|
-
previewDisplayUrl:
|
|
2058
|
-
resolvedPreviewObjectUrl:
|
|
2059
|
-
resolvedPreviewBlob:
|
|
2060
|
-
resolveImageBlob:
|
|
2061
|
-
imageSize:
|
|
2062
|
-
onSave:
|
|
2063
|
-
uploadImageResultIsLoading:
|
|
2052
|
+
previewDisplayUrl: Jt,
|
|
2053
|
+
resolvedPreviewObjectUrl: Zt,
|
|
2054
|
+
resolvedPreviewBlob: Xt,
|
|
2055
|
+
resolveImageBlob: tn,
|
|
2056
|
+
imageSize: z,
|
|
2057
|
+
onSave: an,
|
|
2058
|
+
uploadImageResultIsLoading: F || !1
|
|
2064
2059
|
})
|
|
2065
2060
|
})
|
|
2066
2061
|
}), (0, r.jsxs)(r.Fragment, { children: [(0, r.jsx)(m.Modal, {
|
|
2067
|
-
width:
|
|
2062
|
+
width: J,
|
|
2068
2063
|
className: "image-center",
|
|
2069
2064
|
title: a("Image Center"),
|
|
2070
2065
|
style: { minHeight: 390 },
|
|
2071
|
-
open: !!
|
|
2072
|
-
onOk:
|
|
2073
|
-
onCancel:
|
|
2074
|
-
footer:
|
|
2066
|
+
open: !!O,
|
|
2067
|
+
onOk: Qe,
|
|
2068
|
+
onCancel: rn,
|
|
2069
|
+
footer: H === we ? (0, r.jsx)(r.Fragment, {}) : null,
|
|
2075
2070
|
children: (0, r.jsx)(m.Spin, {
|
|
2076
|
-
spinning:
|
|
2071
|
+
spinning: F,
|
|
2077
2072
|
children: (0, r.jsx)(m.Tabs, {
|
|
2078
|
-
activeKey:
|
|
2079
|
-
onChange:
|
|
2073
|
+
activeKey: H,
|
|
2074
|
+
onChange: sn,
|
|
2080
2075
|
items: Le,
|
|
2081
2076
|
className: "modal-tabs",
|
|
2082
2077
|
style: {
|
|
2083
|
-
height:
|
|
2078
|
+
height: me,
|
|
2084
2079
|
minHeight: 130
|
|
2085
2080
|
}
|
|
2086
2081
|
})
|
|
2087
2082
|
})
|
|
2088
|
-
}), (0, r.jsx)(
|
|
2089
|
-
open:
|
|
2083
|
+
}), (0, r.jsx)(N.PlanUpgradePrompt, {
|
|
2084
|
+
open: _t,
|
|
2090
2085
|
onCancel: () => Ee(!1),
|
|
2091
|
-
initialSlide:
|
|
2086
|
+
initialSlide: Yt
|
|
2092
2087
|
})] });
|
|
2093
2088
|
};
|
|
2094
|
-
|
|
2089
|
+
ot.propTypes = { dataProvider: yt.default.object }, gt.default = ot;
|
|
2095
2090
|
});
|