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