useblocks 1.1.53 → 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 +0 -235
- package/runtime/index.js +0 -2
- package/runtime/package.json +0 -6
- package/runtime/plugin-dev-manifest.json +0 -4
- package/singlepage_headless_plugin.html +1 -1
- package/static/core/{d1eb3c68.js → 12a9aa4e.js} +12892 -12866
- package/static/core/{b9f47840.js → 17d3ee0b.js} +8 -8
- package/static/core/{6895dd352.js → 195ca4a32.js} +15 -15
- package/static/core/{dc1f9e4f.js → 2569fac8.js} +26 -26
- package/static/core/{4ca527032.js → 26ddf93e2.js} +2 -2
- package/static/core/{c3058168.js → 289ba982.js} +334 -323
- package/static/core/{9929a348.js → 30c5fe5f.js} +90 -90
- 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/{5318562c.js → 4d493eba.js} +3 -3
- package/static/core/{ebd852b6.js → 4dadf572.js} +1019 -1032
- package/static/core/{e1d239ab.js → 5345bef8.js} +42 -42
- 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/{31e98e6e.js → 87969347.js} +247 -250
- package/static/core/{f3cff4c9.js → 8a496b64.js} +158 -158
- package/static/core/{4e1b970f.js → 8ba13f332.js} +1 -1
- package/static/core/{75737a9d.js → 951903fb.js} +9096 -9074
- package/static/core/{bc7e3d2b.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/{e5e07f1d.js → a4c19e27.js} +13 -13
- package/static/core/{2da1d66b.js → abd3f34c.js} +5 -5
- package/static/core/{528ad9282.js → ae20f0992.js} +16 -16
- package/static/core/{ee0ddb51.js → b9bb2c5f.js} +6403 -4842
- 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/{139e4380.js → eb23332a.js} +3 -3
- package/static/core/{b408f33a.js → fa354fb5.js} +25 -25
- 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/{useblocks-core.2a5dade1.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/1995fb0a2.js +0 -602
- package/static/core/1f5e1fc9.js +0 -3097
- package/static/core/ce0410b1.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.2a5dade1.html → iframe-eblock.1279854f.html} +0 -0
- /package/iframe/{iframe.2a5dade1.html → iframe.1279854f.html} +0 -0
|
@@ -1,27 +1,24 @@
|
|
|
1
1
|
(function(){try{if(typeof document<"u"){var o=document.createElement("style");o.setAttribute("data-useblocks","true"),o.appendChild(document.createTextNode(".blocks-app .image-preview{text-align:center;min-height:100px;position:relative}.blocks-app .image-preview .image-editor-modal{border:1px solid red}.blocks-app .image-preview__edit-button{position:absolute;bottom:10px;left:50%;transform:translate(-50%)}.blocks-app .image-preview img{border:1px solid var(--colorBorder);border-radius:6px;max-width:100%;max-height:500px}.blocks-app .image-editor-modal .ant-modal-container{flex-direction:column;min-height:100vh;display:flex;border-radius:0!important}.blocks-app .image-editor-modal .ant-modal-body{flex-grow:1;display:flex}.blocks-app .image-editor-modal .ant-modal-body #pixie-editor{flex-grow:1;height:calc(100vh - 70px);min-height:calc(100vh - 70px);overflow:hidden}.blocks-app .image-editor-modal .pi .text-on-primary{background:var(--colorPrimary);border-color:var(--colorPrimary)}.blocks-app .image-editor-modal .pi .text-on-primary:hover{background:var(--colorPrimaryHover);border-color:var(--colorPrimaryHover)}.blocks-app .image-editor-modal .pi .text-on-primary.rounded-full{border-radius:calc(var(--borderRadius) * 1px)}.blocks-app .image-editor-modal .pi .shadow-xl{box-shadow:none}.blocks-app .image-editor-modal .w-\\[4ch\\].text-sm.text-center{width:5ch}.blocks-app .image-editor-modal .pi .border-white{border-color:var(--colorPrimary)}.blocks-app .image-editor-modal .pi .bg-white\\/50{background-color:var(--colorPrimary)}.blocks-app .image-editor-modal .pi .text-on-primary{color:var(--colorWhite)}.blocks-app .serach-results .ant-row{align-items:center}.blocks-app .serach-results .blocks-search__divider-wrapper{margin-top:12px;position:relative}.blocks-app .serach-results .blocks-search__divider-wrapper .ant-divider-horizontal{border-top:1px solid var(--colorBorderSecondary);background:0 0;width:100%;height:1px;min-height:0;margin:0;position:static}.blocks-app .slideshow-container{width:524px;height:350px;margin:auto;position:relative;overflow:hidden}.blocks-app .slideshow-image{opacity:0;width:100%;height:100%;position:absolute;top:0;left:0}.blocks-app .image-ai .slideshow-image{width:auto;height:auto}.blocks-app .image-ai__image-item{text-align:center;border-radius:6px;justify-content:center;align-items:center;min-height:100px;display:flex;position:relative}.blocks-app .image-ai__image-item .buttons{justify-content:space-between;display:flex;position:absolute;bottom:10px;left:50%;transform:translate(-50%)}.blocks-app .image-ai .text-area-input-hybrid{border:none;outline:none;min-height:0;padding:0 0 0 1px}.blocks-app .image-ai .text-area-input-hybrid textarea{height:32px;min-height:32px;padding:3px 11px;line-height:26px}.blocks-app .image-ai__loading{justify-content:center;align-items:center;min-height:150px;display:flex}.blocks-app .image-ai__loading .spin{flex-direction:column;justify-content:center;align-items:center;height:150px;display:flex}.blocks-app .image-ai__loading .status{margin:3px 0 0}.blocks-app .image-ai__preview{border-radius:6px;margin-top:24px;overflow:hidden}.blocks-app .image-ai__preview .image-ai__image-item img{border-radius:calc(var(--borderRadius) * 1px);object-fit:contain;max-height:100%;transition:height 1s;top:50%;left:50%;overflow:hidden;transform:translate(-50%,-50%)}.blocks-app .image-ai .small{width:302px;height:202px}.blocks-app .image-ai .large{width:524px;height:350px}.blocks-app .image-ai .image-ai__row{padding:0 2px}.blocks-app .image-ai .image-ai__input-affix-wrapper{border-style:solid;border-width:calc(var(--borderWidth) * 1px);border-color:var(--colorFillSecondaryDarken);border-radius:calc(var(--borderRadius) * 1px);width:100%;padding-left:0;display:inline-flex}.blocks-app .image-ai .image-ai__input-affix-wrapper:hover{border-color:var(--borderColorHover)}.blocks-app .image-ai .image-ai__input-affix-wrapper.ant-input-affix-wrapper-focused{border-color:var(--colorPrimaryBorder)}.blocks-app .image-ai .image-ai__textarea{font-size:16px}.blocks-app .image-ai .image-ai__input-icon{font-size:16px;top:0;right:0}.dark .blocks-app .image-ai .image-ai__preview .image-ai__image-item img{background:#2b2b2b;border:1px solid #434343}.dark .blocks-app .image-ai .ant-btn{background:#1f1f1f}.dark .blocks-app .image-ai .ant-btn:hover{color:var(--colorPrimary)}.blocks-app .stock-tab img{border-radius:0;max-width:none;max-height:none}.blocks-app .stock-tab .stock-search-input{padding:0 2px}.blocks-app .stock-tab .my-masonry-grid{text-align:center;width:auto;display:flex}.blocks-app .stock-tab .my-masonry-grid_column{background-clip:padding-box}.blocks-app .stock-tab .list-item{cursor:pointer;background:#f0f2f5;border:1px solid #f0f2f5;border-radius:6px;min-height:100px;max-height:100px;margin-bottom:20px;transition:all .3s;display:inline-block;position:relative;overflow:hidden}.blocks-app .stock-tab .list-item .overlay-image{opacity:0;background-size:cover;width:110px;height:40px;transition:opacity .5s;position:absolute;bottom:10px;right:10px}.blocks-app .stock-tab .list-item .ant-spin{color:#f0f2f5;font-size:20px;position:absolute;top:50%;left:50%;transform:translate(-50%,-50%)}.blocks-app .stock-tab .list-item img{object-fit:cover;opacity:0;border-radius:6px;height:auto;transition:opacity .5s ease-in-out;display:block}.blocks-app .stock-tab .list-item.loaded{border:1px solid #d9d9d9;max-height:1000px}.blocks-app .stock-tab .list-item.loaded img{opacity:1;height:100%}.blocks-app .stock-tab .list-item.loaded .loaded-image{opacity:.5}.blocks-app .stock-tab .list-item:hover{box-shadow:0 1px 2px -2px #00000029,0 3px 6px #0000001f,0 5px 12px 4px #00000017}.blocks-app .stock-tab .list-item:hover p.creator-info,.blocks-app .stock-tab .list-item:hover .overlay-image{opacity:1}.blocks-app .stock-tab .list-item p.creator-info{color:#fff;opacity:0;background-color:#00000080;border-radius:0 0 6px;margin:0;padding:5px;font-size:10px;line-height:1.2;position:absolute;bottom:0;right:0}.blocks-app .stock-tab .list-item p.creator-info:hover a{color:#fff;text-decoration:underline}.blocks-app .stock-tab .list-item p.creator-info a{color:#fff;text-decoration:none}.blocks-app .stock-color-filter{display:flex}.blocks-app .stock-color-filter label{border-width:1px;width:24px;height:24px;margin:4px;padding:0;font-size:0;border-radius:6px!important}.blocks-app .stock-color-filter label.all-colors{background-image:linear-gradient(135deg,red,#ff7f00,#ff0,#0f0,#00f,#8b00ff)}.blocks-app .stock-color-filter label.black-color{background:#222}.blocks-app .stock-color-filter label.bw-color{background-image:linear-gradient(135deg,#222 50%,#fff 50%)}.blocks-app .stock-color-filter label.white-color{background:#fff}.blocks-app .stock-color-filter label.orange-color{background:#fa8c16}.blocks-app .stock-color-filter label.red-color{background:#f5222d}.blocks-app .stock-color-filter label.purple-color{background:#722ed1}.blocks-app .stock-color-filter label.magenta-color{background:#eb2f96}.blocks-app .stock-color-filter label.green-color{background:#52c41a}.blocks-app .stock-color-filter label.teal-color{background:#43c3c3}.blocks-app .stock-color-filter label.blue-color{background:#1677ff}.blocks-app .stock-color-filter .ant-radio-button-wrapper:not(:first-child):before{display:none}.blocks-app .serach-results{padding-top:6px}.blocks-app .serach-results .stock-search-input{width:322px;padding:0 2px}.blocks-app .serach-results .blocks-search__divider-wrapper{width:calc(100% + 48px);margin-top:12px;margin-left:-24px;margin-right:-24px;position:relative}.blocks-app .serach-results .blocks-search__divider-wrapper .ant-divider-horizontal{pointer-events:none;border-top:1px solid var(--colorBorderSecondary);background:linear-gradient(180deg, var(--colorBgContainerDisabled), transparent 40%);border-bottom:none;width:100%;height:20px;min-height:20px;margin:0;position:relative;bottom:auto;left:auto;right:auto}.dark .blocks-app .image-center .stock-tab .serach-results .blocks-search__divider-wrapper .ant-divider-horizontal{background:linear-gradient(180deg, var(--colorBgBase), transparent 40%)}.dark .blocks-app .stock-tab .list-item{background:#2b2b2b;border:1px solid #2b2b2b}.dark .blocks-app .stock-tab .list-item.loaded{border:1px solid #434343}.blocks-app .image-center .image-center-image-preview{justify-content:center;align-items:center;display:flex}.blocks-app .image-center .ant-divider-horizontal{pointer-events:none;z-index:1;background:linear-gradient(180deg, var(--colorBgContainerDisabled), transparent 40%);width:calc(100% + 48px);height:20px;margin:24px -24px 0;position:absolute;bottom:-19px}.dark .blocks-app .image-center .ant-divider-horizontal{background:linear-gradient(180deg, var(--colorBgBase), transparent 40%)}.blocks-app .image-center .ant-divider-horizontal.ant-divider-with-text{background:0 0;width:calc(100% + 38px);margin:0 -24px 20px;position:relative;top:0}.blocks-app .image-center img{border-radius:4px;max-width:524px;max-height:352px}.blocks-app .image-center .image-size{justify-content:center;margin-top:6px;font-size:14px;line-height:22px;display:flex}.blocks-app .image-center .ant-upload.ant-upload-drag{border-radius:6px}.blocks-app .image-center .ant-modal-body .stock-search-input{margin-bottom:0}.blocks-app .image-center .ant-modal-body .serach-results .stock-search-input{margin-bottom:10px}.blocks-app .image-center .ant-modal-body .ant-form:not(.serach-results) .ant-form-item:last-child{margin-bottom:0}.blocks-app .image-center .ant-modal-body .ant-tabs{transition:all .7s cubic-bezier(.075,.82,.165,1)}.blocks-app .image-center .ant-modal-body .ant-tabs .ant-tabs-content-holder{overflow-y:clip}.blocks-app .ant-modal{transition:width .7s ease-in-out}")),document.head.appendChild(o)}}catch(a){console.error("vite-plugin-css-injected-by-js",a)}})();
|
|
2
|
-
__useblocks__.define("static/core/
|
|
2
|
+
__useblocks__.define("static/core/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
|
-
"prop-types",
|
|
15
|
-
"react-router-dom",
|
|
16
14
|
"react/jsx-runtime"
|
|
17
|
-
], function(
|
|
18
|
-
const
|
|
19
|
-
let n =
|
|
20
|
-
n =
|
|
21
|
-
let
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
function bt(t, e) {
|
|
15
|
+
], function(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) {
|
|
25
22
|
return { [t]: {
|
|
26
23
|
Filter: e("Filter"),
|
|
27
24
|
filter: e("filter"),
|
|
@@ -107,7 +104,7 @@ __useblocks__.define("static/core/31e98e6e.js", [
|
|
|
107
104
|
square: e("square")
|
|
108
105
|
} };
|
|
109
106
|
}
|
|
110
|
-
function
|
|
107
|
+
function Xe(t, e = "application/octet-stream") {
|
|
111
108
|
let o = t.trim(), a = e?.trim() || "application/octet-stream";
|
|
112
109
|
const i = o.indexOf(",");
|
|
113
110
|
if (o.startsWith("data:") && i >= 0) {
|
|
@@ -118,7 +115,7 @@ __useblocks__.define("static/core/31e98e6e.js", [
|
|
|
118
115
|
for (let d = 0; d < b.length; d++) g[d] = b.charCodeAt(d);
|
|
119
116
|
return new Blob([g], { type: a });
|
|
120
117
|
}
|
|
121
|
-
var
|
|
118
|
+
var bt = "static/media/image-editor", wt = { text: {
|
|
122
119
|
replaceDefaultItems: !0,
|
|
123
120
|
defaultText: "Handwriting",
|
|
124
121
|
items: [
|
|
@@ -236,21 +233,21 @@ __useblocks__.define("static/core/31e98e6e.js", [
|
|
|
236
233
|
}
|
|
237
234
|
]
|
|
238
235
|
} };
|
|
239
|
-
function
|
|
236
|
+
function At(t, e) {
|
|
240
237
|
if (t === "json") return new Blob([e], { type: "application/json" });
|
|
241
238
|
if (t === "svg") return new Blob([e], { type: "image/svg+xml" });
|
|
242
239
|
const o = `image/${t}`;
|
|
243
|
-
return
|
|
240
|
+
return Xe(e.replace(/data:image\/([a-z]*)?;base64,/, ""), o);
|
|
244
241
|
}
|
|
245
|
-
var
|
|
246
|
-
const l =
|
|
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();
|
|
247
244
|
let p = u.useDispatch();
|
|
248
|
-
const w = u.useStore(), j = u.useAppConfig(), C = u.useSelector(u.selectedCurrentUser), U = u.useSelector(
|
|
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)(() => {
|
|
249
246
|
if (!j?.icons) return;
|
|
250
247
|
const k = {};
|
|
251
248
|
for (const [P, E] of Object.entries(j.icons)) typeof E == "string" && (k[P] = F.sanitizeHtml(E));
|
|
252
249
|
return Object.keys(k).length > 0 ? k : void 0;
|
|
253
|
-
}, [j?.icons]), O = (0, n.useRef)(!1), [T,
|
|
250
|
+
}, [j?.icons]), O = (0, n.useRef)(!1), [T, q] = (0, n.useState)(), N = u.useEventEmitter(u.events.FILE_PROXY_EVENT_ID);
|
|
254
251
|
(0, n.useEffect)(() => {
|
|
255
252
|
let k = !1;
|
|
256
253
|
return (async () => {
|
|
@@ -265,7 +262,7 @@ __useblocks__.define("static/core/31e98e6e.js", [
|
|
|
265
262
|
url: E,
|
|
266
263
|
project: y
|
|
267
264
|
}).filter((L) => L instanceof Blob)[0], !I) {
|
|
268
|
-
const L = l.get(u.APP_COOKIES.em_token) || await u.di.getInstance(w,
|
|
265
|
+
const L = l.get(u.APP_COOKIES.em_token) || await u.di.getInstance(w, Y.TOKEN_ID);
|
|
269
266
|
I = await (await fetch(`https://app.useblocks.io/api/wp-json/cors-proxy/v1/get?url=${encodeURIComponent(E)}`, { headers: { authorization: `Bearer ${L}` } })).blob();
|
|
270
267
|
}
|
|
271
268
|
}
|
|
@@ -290,11 +287,11 @@ __useblocks__.define("static/core/31e98e6e.js", [
|
|
|
290
287
|
w
|
|
291
288
|
]);
|
|
292
289
|
const M = (0, n.useCallback)(() => {
|
|
293
|
-
g(null), R(null), p(
|
|
290
|
+
g(null), R(null), p(Y.closeSecondModal()), p(Y.closeModal(u.MODALS.UPLOAD_IMAGE_MODAL));
|
|
294
291
|
}, [p]), z = (0, n.useRef)();
|
|
295
292
|
z.current = async function(k, P, E) {
|
|
296
293
|
try {
|
|
297
|
-
const I =
|
|
294
|
+
const I = At(E, k);
|
|
298
295
|
a && await a(new File([I], P, {
|
|
299
296
|
lastModified: Date.now(),
|
|
300
297
|
type: I.type
|
|
@@ -307,13 +304,13 @@ __useblocks__.define("static/core/31e98e6e.js", [
|
|
|
307
304
|
if (k && !(O.current && T)) {
|
|
308
305
|
O.current = !0;
|
|
309
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;
|
|
310
|
-
|
|
307
|
+
yt.Tf.init({
|
|
311
308
|
selector: "#pixie-editor",
|
|
312
|
-
baseUrl: m.getBundledHostAssetUrl(
|
|
309
|
+
baseUrl: m.getBundledHostAssetUrl(bt),
|
|
313
310
|
image: b,
|
|
314
311
|
activeLanguage: P,
|
|
315
|
-
languages:
|
|
316
|
-
tools:
|
|
312
|
+
languages: Ct(P, x),
|
|
313
|
+
tools: wt,
|
|
317
314
|
ui: {
|
|
318
315
|
menubar: {
|
|
319
316
|
replaceDefaultItems: !0,
|
|
@@ -364,14 +361,14 @@ __useblocks__.define("static/core/31e98e6e.js", [
|
|
|
364
361
|
} catch {}
|
|
365
362
|
}
|
|
366
363
|
}).then((I) => {
|
|
367
|
-
|
|
364
|
+
q(I);
|
|
368
365
|
}).catch((I) => {});
|
|
369
366
|
}
|
|
370
367
|
}, [
|
|
371
368
|
C.theme,
|
|
372
369
|
b,
|
|
373
370
|
T,
|
|
374
|
-
|
|
371
|
+
q,
|
|
375
372
|
C.locale,
|
|
376
373
|
x,
|
|
377
374
|
M,
|
|
@@ -422,7 +419,7 @@ __useblocks__.define("static/core/31e98e6e.js", [
|
|
|
422
419
|
children: (0, r.jsx)(m.Spin, { size: "large" })
|
|
423
420
|
}), (0, r.jsx)("div", { id: "pixie-editor" })]
|
|
424
421
|
});
|
|
425
|
-
},
|
|
422
|
+
}, xt = ({ currentImageLink: t, newLink: e, previewDisplayUrl: o, resolvedPreviewObjectUrl: a, resolvedPreviewBlob: i, resolveImageBlob: l, onSave: b, uploadImageResultIsLoading: g }) => {
|
|
426
423
|
const d = o || a;
|
|
427
424
|
return (0, r.jsxs)(r.Fragment, { children: [(0, r.jsx)("div", { children: (0, r.jsxs)("div", {
|
|
428
425
|
className: "image-preview",
|
|
@@ -443,7 +440,7 @@ __useblocks__.define("static/core/31e98e6e.js", [
|
|
|
443
440
|
alt: "uploadedImage",
|
|
444
441
|
src: d
|
|
445
442
|
})]
|
|
446
|
-
}) }), (0, r.jsx)(
|
|
443
|
+
}) }), (0, r.jsx)(It, {
|
|
447
444
|
currentImageLink: t,
|
|
448
445
|
prefetchedBlob: i,
|
|
449
446
|
resolveImageBlob: l,
|
|
@@ -454,11 +451,11 @@ __useblocks__.define("static/core/31e98e6e.js", [
|
|
|
454
451
|
}, Re = {
|
|
455
452
|
Pixel: "Pixel",
|
|
456
453
|
Percent: "Percent"
|
|
457
|
-
},
|
|
454
|
+
}, Je = {
|
|
458
455
|
unit: Re.Percent,
|
|
459
456
|
value: 80
|
|
460
457
|
};
|
|
461
|
-
function
|
|
458
|
+
function St(t) {
|
|
462
459
|
return typeof t == "number" ? {
|
|
463
460
|
unit: Re.Percent,
|
|
464
461
|
value: t * 100
|
|
@@ -468,44 +465,44 @@ __useblocks__.define("static/core/31e98e6e.js", [
|
|
|
468
465
|
} : /^(\d*(\.\d+)?)%$/.exec(t) ? {
|
|
469
466
|
unit: Re.Percent,
|
|
470
467
|
value: parseFloat(t)
|
|
471
|
-
} :
|
|
468
|
+
} : Je : Je;
|
|
472
469
|
}
|
|
473
|
-
function
|
|
474
|
-
const o =
|
|
470
|
+
function Rt(t, e) {
|
|
471
|
+
const o = St(t);
|
|
475
472
|
let a;
|
|
476
473
|
return o.unit === Re.Pixel ? a = `${o.value}px` : a = `${100 - o.value}%`, e ? `${a} 0px 0px 0px` : `0px 0px ${a} 0px`;
|
|
477
474
|
}
|
|
478
|
-
function
|
|
479
|
-
const [ee, 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),
|
|
480
|
-
|
|
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;
|
|
481
478
|
const s = (0, n.useRef)(U);
|
|
482
479
|
s.current = U;
|
|
483
480
|
const h = (0, n.useRef)(C);
|
|
484
481
|
h.current = C;
|
|
485
|
-
const W = (0, n.useRef)(!1),
|
|
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]);
|
|
486
483
|
(0, n.useEffect)(() => {
|
|
487
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");
|
|
488
485
|
if (p && typeof U != "function") throw new Error(`Mandatory prop "refreshFunction" missing.
|
|
489
486
|
Pull Down To Refresh functionality will not work
|
|
490
487
|
as expected. Check README.md for usage'`);
|
|
491
488
|
if (typeof O == "number") {
|
|
492
|
-
const
|
|
493
|
-
|
|
489
|
+
const _ = g ? A.current : H();
|
|
490
|
+
_ && _.scrollHeight > O && _.scrollTo(0, O);
|
|
494
491
|
}
|
|
495
492
|
}, []), (0, n.useEffect)(() => {
|
|
496
493
|
W.current = !1, K(!1);
|
|
497
494
|
}, [D]), (0, n.useEffect)(() => {
|
|
498
495
|
if (!e || typeof IntersectionObserver > "u") return;
|
|
499
|
-
const
|
|
500
|
-
if (!
|
|
496
|
+
const _ = L.current;
|
|
497
|
+
if (!_) return;
|
|
501
498
|
const se = g ? A.current : H(), B = new IntersectionObserver(([ae]) => {
|
|
502
|
-
!ae.isIntersecting || W.current || (W.current = !0, K(!0),
|
|
499
|
+
!ae.isIntersecting || W.current || (W.current = !0, K(!0), Q.current());
|
|
503
500
|
}, {
|
|
504
501
|
root: se,
|
|
505
|
-
rootMargin:
|
|
502
|
+
rootMargin: Rt(i, x),
|
|
506
503
|
threshold: 0
|
|
507
504
|
});
|
|
508
|
-
return B.observe(
|
|
505
|
+
return B.observe(_), () => B.disconnect();
|
|
509
506
|
}, [
|
|
510
507
|
e,
|
|
511
508
|
i,
|
|
@@ -513,9 +510,9 @@ __useblocks__.define("static/core/31e98e6e.js", [
|
|
|
513
510
|
g,
|
|
514
511
|
H
|
|
515
512
|
]), (0, n.useEffect)(() => {
|
|
516
|
-
var
|
|
513
|
+
var _;
|
|
517
514
|
if (!y) return;
|
|
518
|
-
const se = (
|
|
515
|
+
const se = (_ = g ? A.current : H()) !== null && _ !== void 0 ? _ : typeof window < "u" ? window : null;
|
|
519
516
|
if (!se) return;
|
|
520
517
|
const B = (ae) => {
|
|
521
518
|
setTimeout(() => y(ae), 0);
|
|
@@ -526,24 +523,24 @@ __useblocks__.define("static/core/31e98e6e.js", [
|
|
|
526
523
|
g,
|
|
527
524
|
H
|
|
528
525
|
]), (0, n.useEffect)(() => {
|
|
529
|
-
var
|
|
526
|
+
var _, se;
|
|
530
527
|
if (!p) return;
|
|
531
|
-
const B = (
|
|
528
|
+
const B = (_ = g ? A.current : H()) !== null && _ !== void 0 ? _ : typeof window < "u" ? window : null;
|
|
532
529
|
if (!B) return;
|
|
533
530
|
if (!((se = J.current) === null || se === void 0) && se.firstChild) {
|
|
534
531
|
const G = J.current.firstChild.getBoundingClientRect().height;
|
|
535
532
|
X.current = G, I(G);
|
|
536
533
|
}
|
|
537
534
|
const ae = (G) => {
|
|
538
|
-
(B instanceof HTMLElement ? B.scrollTop : document.documentElement.scrollTop) > 0 || (
|
|
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)"));
|
|
539
536
|
}, v = (G) => {
|
|
540
|
-
if (!
|
|
541
|
-
const
|
|
542
|
-
|
|
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)`);
|
|
543
540
|
}, te = () => {
|
|
544
|
-
Z.current = 0, $.current = 0,
|
|
545
|
-
var
|
|
546
|
-
return G && ((
|
|
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;
|
|
547
544
|
}), requestAnimationFrame(() => {
|
|
548
545
|
A.current && (A.current.style.overflow = "auto", A.current.style.transform = "none", A.current.style.willChange = "unset");
|
|
549
546
|
});
|
|
@@ -561,7 +558,7 @@ __useblocks__.define("static/core/31e98e6e.js", [
|
|
|
561
558
|
overflow: "auto",
|
|
562
559
|
WebkitOverflowScrolling: "touch",
|
|
563
560
|
...b
|
|
564
|
-
}, he = R || !!(o && o instanceof Array && o.length), ye = p && g ? { overflow: "auto" } : {},
|
|
561
|
+
}, he = R || !!(o && o instanceof Array && o.length), ye = p && g ? { overflow: "auto" } : {}, ce = e ? (0, r.jsx)("div", {
|
|
565
562
|
ref: L,
|
|
566
563
|
style: { height: 1 }
|
|
567
564
|
}) : null;
|
|
@@ -570,7 +567,7 @@ __useblocks__.define("static/core/31e98e6e.js", [
|
|
|
570
567
|
className: "infinite-scroll-component__outerdiv",
|
|
571
568
|
children: (0, r.jsxs)("div", {
|
|
572
569
|
...z,
|
|
573
|
-
role:
|
|
570
|
+
role: q,
|
|
574
571
|
tabIndex: N,
|
|
575
572
|
id: M,
|
|
576
573
|
className: ["infinite-scroll-component", T].filter(Boolean).join(" "),
|
|
@@ -593,22 +590,22 @@ __useblocks__.define("static/core/31e98e6e.js", [
|
|
|
593
590
|
o,
|
|
594
591
|
!ee && !he && e && a,
|
|
595
592
|
ee && e && a,
|
|
596
|
-
|
|
593
|
+
ce,
|
|
597
594
|
!e && l
|
|
598
595
|
]
|
|
599
596
|
})
|
|
600
597
|
});
|
|
601
598
|
}
|
|
602
|
-
function
|
|
599
|
+
function jt(t, e) {
|
|
603
600
|
if (t == null) return {};
|
|
604
|
-
var o =
|
|
601
|
+
var o = kt(t, e), a, i;
|
|
605
602
|
if (Object.getOwnPropertySymbols) {
|
|
606
603
|
var l = Object.getOwnPropertySymbols(t);
|
|
607
604
|
for (i = 0; i < l.length; i++) a = l[i], !(e.indexOf(a) >= 0) && Object.prototype.propertyIsEnumerable.call(t, a) && (o[a] = t[a]);
|
|
608
605
|
}
|
|
609
606
|
return o;
|
|
610
607
|
}
|
|
611
|
-
function
|
|
608
|
+
function kt(t, e) {
|
|
612
609
|
if (t == null) return {};
|
|
613
610
|
var o = {}, a = Object.keys(t), i, l;
|
|
614
611
|
for (l = 0; l < a.length; l++) i = a[l], !(e.indexOf(i) >= 0) && (o[i] = t[i]);
|
|
@@ -623,7 +620,7 @@ __useblocks__.define("static/core/31e98e6e.js", [
|
|
|
623
620
|
return t;
|
|
624
621
|
}, De.apply(this, arguments);
|
|
625
622
|
}
|
|
626
|
-
function
|
|
623
|
+
function et(t, e) {
|
|
627
624
|
var o = Object.keys(t);
|
|
628
625
|
if (Object.getOwnPropertySymbols) {
|
|
629
626
|
var a = Object.getOwnPropertySymbols(t);
|
|
@@ -636,15 +633,15 @@ __useblocks__.define("static/core/31e98e6e.js", [
|
|
|
636
633
|
function je(t) {
|
|
637
634
|
for (var e = 1; e < arguments.length; e++) {
|
|
638
635
|
var o = arguments[e] != null ? arguments[e] : {};
|
|
639
|
-
e % 2 ?
|
|
640
|
-
|
|
641
|
-
}) : Object.getOwnPropertyDescriptors ? Object.defineProperties(t, Object.getOwnPropertyDescriptors(o)) :
|
|
636
|
+
e % 2 ? et(Object(o), !0).forEach(function(a) {
|
|
637
|
+
Et(t, a, o[a]);
|
|
638
|
+
}) : Object.getOwnPropertyDescriptors ? Object.defineProperties(t, Object.getOwnPropertyDescriptors(o)) : et(Object(o)).forEach(function(a) {
|
|
642
639
|
Object.defineProperty(t, a, Object.getOwnPropertyDescriptor(o, a));
|
|
643
640
|
});
|
|
644
641
|
}
|
|
645
642
|
return t;
|
|
646
643
|
}
|
|
647
|
-
function
|
|
644
|
+
function Et(t, e, o) {
|
|
648
645
|
return e in t ? Object.defineProperty(t, e, {
|
|
649
646
|
value: o,
|
|
650
647
|
enumerable: !0,
|
|
@@ -652,18 +649,18 @@ __useblocks__.define("static/core/31e98e6e.js", [
|
|
|
652
649
|
writable: !0
|
|
653
650
|
}) : t[e] = o, t;
|
|
654
651
|
}
|
|
655
|
-
var
|
|
652
|
+
var Ot = {
|
|
656
653
|
breakpointCols: void 0,
|
|
657
654
|
className: void 0,
|
|
658
655
|
columnClassName: void 0,
|
|
659
656
|
children: void 0,
|
|
660
657
|
columnAttrs: void 0,
|
|
661
658
|
column: void 0
|
|
662
|
-
},
|
|
659
|
+
}, Te = 2, Ne = class extends n.default.Component {
|
|
663
660
|
constructor(t) {
|
|
664
661
|
super(t), this.reCalculateColumnCount = this.reCalculateColumnCount.bind(this), this.reCalculateColumnCountDebounce = this.reCalculateColumnCountDebounce.bind(this);
|
|
665
662
|
let e;
|
|
666
|
-
this.props.breakpointCols && this.props.breakpointCols.default ? e = this.props.breakpointCols.default : e = parseInt(this.props.breakpointCols) ||
|
|
663
|
+
this.props.breakpointCols && this.props.breakpointCols.default ? e = this.props.breakpointCols.default : e = parseInt(this.props.breakpointCols) || Te, this.state = { columnCount: e };
|
|
667
664
|
}
|
|
668
665
|
componentDidMount() {
|
|
669
666
|
this.reCalculateColumnCount(), window && window.addEventListener("resize", this.reCalculateColumnCountDebounce);
|
|
@@ -686,8 +683,8 @@ __useblocks__.define("static/core/31e98e6e.js", [
|
|
|
686
683
|
reCalculateColumnCount() {
|
|
687
684
|
const t = window && window.innerWidth || Infinity;
|
|
688
685
|
let e = this.props.breakpointCols;
|
|
689
|
-
typeof e != "object" && (e = { default: parseInt(e) ||
|
|
690
|
-
let o = Infinity, a = e.default ||
|
|
686
|
+
typeof e != "object" && (e = { default: parseInt(e) || Te });
|
|
687
|
+
let o = Infinity, a = e.default || Te;
|
|
691
688
|
for (let i in e) {
|
|
692
689
|
const l = parseInt(i);
|
|
693
690
|
l > 0 && t <= l && l < o && (o = l, a = e[i]);
|
|
@@ -714,7 +711,7 @@ __useblocks__.define("static/core/31e98e6e.js", [
|
|
|
714
711
|
}
|
|
715
712
|
logDeprecated(t) {}
|
|
716
713
|
render() {
|
|
717
|
-
const t = this.props, { children: e, breakpointCols: o, columnClassName: a, columnAttrs: i, column: l, className: b } = t, g =
|
|
714
|
+
const t = this.props, { children: e, breakpointCols: o, columnClassName: a, columnAttrs: i, column: l, className: b } = t, g = jt(t, [
|
|
718
715
|
"children",
|
|
719
716
|
"breakpointCols",
|
|
720
717
|
"columnClassName",
|
|
@@ -726,8 +723,8 @@ __useblocks__.define("static/core/31e98e6e.js", [
|
|
|
726
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());
|
|
727
724
|
}
|
|
728
725
|
};
|
|
729
|
-
|
|
730
|
-
function
|
|
726
|
+
Ne.defaultProps = Ot;
|
|
727
|
+
function Fe(t, e) {
|
|
731
728
|
return t ? t.exhausted ? {
|
|
732
729
|
...t,
|
|
733
730
|
src: null
|
|
@@ -736,7 +733,7 @@ __useblocks__.define("static/core/31e98e6e.js", [
|
|
|
736
733
|
src: t.src || e || null
|
|
737
734
|
} : null;
|
|
738
735
|
}
|
|
739
|
-
function
|
|
736
|
+
function tt({ items: t, getItemId: e, getRequestUrl: o, createController: a }) {
|
|
740
737
|
const [i, l] = (0, n.useState)({}), b = (0, n.useRef)(new Map()), g = (0, n.useCallback)((d) => {
|
|
741
738
|
const R = e(d), x = o(d), p = `${R}:${x}`;
|
|
742
739
|
if (b.current.has(p)) return {
|
|
@@ -761,9 +758,9 @@ __useblocks__.define("static/core/31e98e6e.js", [
|
|
|
761
758
|
const d = new Set(), R = {}, x = t.map((p) => {
|
|
762
759
|
const { itemId: w, cacheKey: j, controller: C } = g(p);
|
|
763
760
|
d.add(j), R[w] = C.src;
|
|
764
|
-
const U =
|
|
761
|
+
const U = Fe(C.handleChangeSrc?.(), C.src);
|
|
765
762
|
return U?.changed && U.src && (R[w] = U.src), C.subscribeToSrcChange?.((y) => {
|
|
766
|
-
const D =
|
|
763
|
+
const D = Fe(y, C.src);
|
|
767
764
|
!D?.changed || !D.src || l((O) => O[w] === D.src ? O : {
|
|
768
765
|
...O,
|
|
769
766
|
[w]: D.src
|
|
@@ -784,7 +781,7 @@ __useblocks__.define("static/core/31e98e6e.js", [
|
|
|
784
781
|
g(d).controller.handleSuccess();
|
|
785
782
|
}, [g]),
|
|
786
783
|
handleError: (0, n.useCallback)((d) => {
|
|
787
|
-
const { itemId: R, controller: x } = g(d), p =
|
|
784
|
+
const { itemId: R, controller: x } = g(d), p = Fe(x.handleError(), x.src);
|
|
788
785
|
p?.changed && p.src && l((w) => ({
|
|
789
786
|
...w,
|
|
790
787
|
[R]: p.src
|
|
@@ -792,16 +789,16 @@ __useblocks__.define("static/core/31e98e6e.js", [
|
|
|
792
789
|
}, [g])
|
|
793
790
|
};
|
|
794
791
|
}
|
|
795
|
-
var
|
|
796
|
-
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] =
|
|
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) => {
|
|
797
794
|
D.error({
|
|
798
795
|
id: "STOCK_IMAGES_SEARCH_FAILED",
|
|
799
796
|
title: y("Failed to load stock images"),
|
|
800
|
-
description:
|
|
797
|
+
description: q(s)
|
|
801
798
|
});
|
|
802
799
|
}, [
|
|
803
800
|
y,
|
|
804
|
-
|
|
801
|
+
q,
|
|
805
802
|
D
|
|
806
803
|
]), M = async () => {
|
|
807
804
|
w || (j(!0), T({
|
|
@@ -839,7 +836,7 @@ __useblocks__.define("static/core/31e98e6e.js", [
|
|
|
839
836
|
standalone: p,
|
|
840
837
|
resourceType: "stockImages",
|
|
841
838
|
intent: "display"
|
|
842
|
-
}), [x, p]), { getDisplaySrc: E, handleLoad: I, handleError: A } =
|
|
839
|
+
}), [x, p]), { getDisplaySrc: E, handleLoad: I, handleError: A } = tt({
|
|
843
840
|
items: i,
|
|
844
841
|
getItemId: (0, n.useCallback)((s) => s.id, []),
|
|
845
842
|
getRequestUrl: (0, n.useCallback)((s) => k(s.urls.raw, 644, 96), [k]),
|
|
@@ -848,7 +845,7 @@ __useblocks__.define("static/core/31e98e6e.js", [
|
|
|
848
845
|
I(s), h.target.parentNode.classList.add("loaded");
|
|
849
846
|
}, J = (s) => () => {
|
|
850
847
|
A(s);
|
|
851
|
-
},
|
|
848
|
+
}, Q = (s, h, W) => {
|
|
852
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`);
|
|
853
850
|
};
|
|
854
851
|
return (0, r.jsxs)("div", {
|
|
@@ -1005,7 +1002,7 @@ __useblocks__.define("static/core/31e98e6e.js", [
|
|
|
1005
1002
|
lineHeight: "0",
|
|
1006
1003
|
boxSizing: "unset"
|
|
1007
1004
|
},
|
|
1008
|
-
children: (0, r.jsx)(
|
|
1005
|
+
children: (0, r.jsx)($e, {
|
|
1009
1006
|
dataLength: i && i.length,
|
|
1010
1007
|
next: M,
|
|
1011
1008
|
hasMore: i,
|
|
@@ -1016,13 +1013,13 @@ __useblocks__.define("static/core/31e98e6e.js", [
|
|
|
1016
1013
|
scrollableTarget: "scrollableDiv",
|
|
1017
1014
|
style: { overflow: "visible" },
|
|
1018
1015
|
loader: null,
|
|
1019
|
-
children: (0, r.jsx)(
|
|
1016
|
+
children: (0, r.jsx)(Ne, {
|
|
1020
1017
|
breakpointCols: { default: 3 },
|
|
1021
1018
|
className: "my-masonry-grid",
|
|
1022
1019
|
columnClassName: "my-masonry-grid_column",
|
|
1023
1020
|
children: i.map((s) => (0, r.jsxs)("div", {
|
|
1024
1021
|
className: "list-item",
|
|
1025
|
-
onClick: () =>
|
|
1022
|
+
onClick: () => Q(s.urls, s.links, s.id),
|
|
1026
1023
|
children: [
|
|
1027
1024
|
(0, r.jsx)("img", {
|
|
1028
1025
|
className: ee === s.id ? "loaded-image" : "",
|
|
@@ -1040,7 +1037,7 @@ __useblocks__.define("static/core/31e98e6e.js", [
|
|
|
1040
1037
|
" ",
|
|
1041
1038
|
(0, r.jsx)("a", {
|
|
1042
1039
|
target: "_blank",
|
|
1043
|
-
href: `${s.user.links.html}?utm_source=${
|
|
1040
|
+
href: `${s.user.links.html}?utm_source=${nt}&utm_medium=referral`,
|
|
1044
1041
|
rel: "noreferrer",
|
|
1045
1042
|
children: s.user.name
|
|
1046
1043
|
}),
|
|
@@ -1049,7 +1046,7 @@ __useblocks__.define("static/core/31e98e6e.js", [
|
|
|
1049
1046
|
" ",
|
|
1050
1047
|
(0, r.jsx)("a", {
|
|
1051
1048
|
target: "_blank",
|
|
1052
|
-
href: `https://unsplash.com/?utm_source=${
|
|
1049
|
+
href: `https://unsplash.com/?utm_source=${nt}&utm_medium=referral`,
|
|
1053
1050
|
rel: "noreferrer",
|
|
1054
1051
|
children: "Unsplash"
|
|
1055
1052
|
})
|
|
@@ -1067,14 +1064,14 @@ __useblocks__.define("static/core/31e98e6e.js", [
|
|
|
1067
1064
|
})]
|
|
1068
1065
|
});
|
|
1069
1066
|
};
|
|
1070
|
-
function
|
|
1067
|
+
function rt(t) {
|
|
1071
1068
|
return /^(https?:)?\/\//i.test(t.trim());
|
|
1072
1069
|
}
|
|
1073
|
-
function
|
|
1070
|
+
function Dt(t) {
|
|
1074
1071
|
const e = t.trim();
|
|
1075
|
-
return
|
|
1072
|
+
return rt(e) || /^data:/i.test(e) ? e : `data:image/jpeg;base64, ${t}`;
|
|
1076
1073
|
}
|
|
1077
|
-
var
|
|
1074
|
+
var Bt = ({ images: t, transitionDuration: e = 1e3 }) => {
|
|
1078
1075
|
const [o, a] = (0, n.useState)([]);
|
|
1079
1076
|
return (0, n.useEffect)(() => {
|
|
1080
1077
|
if (t.length > 0) {
|
|
@@ -1092,7 +1089,7 @@ __useblocks__.define("static/core/31e98e6e.js", [
|
|
|
1092
1089
|
}, [t]), (0, r.jsx)("div", {
|
|
1093
1090
|
className: "slideshow-container",
|
|
1094
1091
|
children: o.map((i, l) => (0, r.jsx)("img", {
|
|
1095
|
-
src:
|
|
1092
|
+
src: Dt(i.src),
|
|
1096
1093
|
alt: `Slide ${l + 1}`,
|
|
1097
1094
|
className: "slideshow-image",
|
|
1098
1095
|
style: {
|
|
@@ -1102,8 +1099,8 @@ __useblocks__.define("static/core/31e98e6e.js", [
|
|
|
1102
1099
|
}, l))
|
|
1103
1100
|
});
|
|
1104
1101
|
};
|
|
1105
|
-
function
|
|
1106
|
-
const { __: w } = m.useI18n(), j = u.useAppConfig(), C = m.useNotification(), U = u.usePushToDataLayer(), { emailId: y, blockId: D, projectId: O } =
|
|
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({
|
|
1107
1104
|
limitsInPlugin: $,
|
|
1108
1105
|
hostedAiActive: X
|
|
1109
1106
|
}), ie = !X && Z > 0 && k >= Z, he = (0, n.useCallback)(() => {
|
|
@@ -1116,8 +1113,8 @@ __useblocks__.define("static/core/31e98e6e.js", [
|
|
|
1116
1113
|
H,
|
|
1117
1114
|
k,
|
|
1118
1115
|
Z
|
|
1119
|
-
]),
|
|
1120
|
-
|
|
1116
|
+
]), ce = (0, n.useCallback)(async () => {
|
|
1117
|
+
Q(w("Evaluating the task")), l !== "" && !d && (R(!0), h(!0), g([]), U({
|
|
1121
1118
|
event: "submit_form",
|
|
1122
1119
|
action: "ai_image_generation",
|
|
1123
1120
|
entity_id: y,
|
|
@@ -1131,10 +1128,10 @@ __useblocks__.define("static/core/31e98e6e.js", [
|
|
|
1131
1128
|
if (te) throw te;
|
|
1132
1129
|
if (v.data.status === 401) throw new Error(u.ERROR);
|
|
1133
1130
|
if (v?.data?._eventResult) {
|
|
1134
|
-
g(v.data.task.images), R(!1), h(!1),
|
|
1131
|
+
g(v.data.task.images), R(!1), h(!1), Q(w("Evaluating the task"));
|
|
1135
1132
|
return;
|
|
1136
1133
|
}
|
|
1137
|
-
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({
|
|
1138
1135
|
id: "AI_IMAGE_SEND_SUCCESS",
|
|
1139
1136
|
title: v.message,
|
|
1140
1137
|
placement: "bottomRight",
|
|
@@ -1166,7 +1163,7 @@ __useblocks__.define("static/core/31e98e6e.js", [
|
|
|
1166
1163
|
ee,
|
|
1167
1164
|
W,
|
|
1168
1165
|
w
|
|
1169
|
-
]),
|
|
1166
|
+
]), _ = (0, n.useCallback)(async () => {
|
|
1170
1167
|
if (ye) {
|
|
1171
1168
|
if (!u.PLUGIN.isPlugin && !X) {
|
|
1172
1169
|
const v = F.resolveLimitActionPreflightExceededForType("image_generate", (await M("image_generate")).data?.stats);
|
|
@@ -1175,7 +1172,7 @@ __useblocks__.define("static/core/31e98e6e.js", [
|
|
|
1175
1172
|
return;
|
|
1176
1173
|
}
|
|
1177
1174
|
}
|
|
1178
|
-
H && (P((v) => v + 1), he()),
|
|
1175
|
+
H && (P((v) => v + 1), he()), ce();
|
|
1179
1176
|
} else $ && (x ? x() : C.error({
|
|
1180
1177
|
title: w("The usage limit has been exceeded"),
|
|
1181
1178
|
description: w(`The maximum number of requests for the current subscription period has been reached.
|
|
@@ -1191,7 +1188,7 @@ Select the appropriate plan to fulfil more requests`),
|
|
|
1191
1188
|
p,
|
|
1192
1189
|
P,
|
|
1193
1190
|
he,
|
|
1194
|
-
|
|
1191
|
+
ce,
|
|
1195
1192
|
C,
|
|
1196
1193
|
w,
|
|
1197
1194
|
x
|
|
@@ -1202,7 +1199,7 @@ Select the appropriate plan to fulfil more requests`),
|
|
|
1202
1199
|
const se = u.useEventEmitter(u.events.AI_IMAGE_PROGRESS_ID);
|
|
1203
1200
|
(0, n.useEffect)(() => {
|
|
1204
1201
|
const v = se.event(({ progress: te, status: G }) => {
|
|
1205
|
-
|
|
1202
|
+
Q(G || `${Math.round(te)}%`);
|
|
1206
1203
|
});
|
|
1207
1204
|
return () => v.dispose();
|
|
1208
1205
|
}, [se]);
|
|
@@ -1210,7 +1207,7 @@ Select the appropriate plan to fulfil more requests`),
|
|
|
1210
1207
|
if (!a) {
|
|
1211
1208
|
i(!0);
|
|
1212
1209
|
try {
|
|
1213
|
-
const te =
|
|
1210
|
+
const te = rt(v) ? await (await fetch(v)).blob() : Xe(v);
|
|
1214
1211
|
e({ file: new File([te], "image.jpeg", { type: te.type || "image/jpeg" }) });
|
|
1215
1212
|
} catch {
|
|
1216
1213
|
i(!1);
|
|
@@ -1221,7 +1218,7 @@ Select the appropriate plan to fulfil more requests`),
|
|
|
1221
1218
|
i,
|
|
1222
1219
|
e
|
|
1223
1220
|
]), ae = (0, n.useCallback)((v) => {
|
|
1224
|
-
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({
|
|
1225
1222
|
id: "AI_IMAGE_GET_ERROR",
|
|
1226
1223
|
title: w("Something went wrong, please try again"),
|
|
1227
1224
|
placement: "bottomRight",
|
|
@@ -1229,7 +1226,7 @@ Select the appropriate plan to fulfil more requests`),
|
|
|
1229
1226
|
}));
|
|
1230
1227
|
}, [
|
|
1231
1228
|
g,
|
|
1232
|
-
|
|
1229
|
+
Q,
|
|
1233
1230
|
w,
|
|
1234
1231
|
R,
|
|
1235
1232
|
t,
|
|
@@ -1264,8 +1261,8 @@ Select the appropriate plan to fulfil more requests`),
|
|
|
1264
1261
|
loadingDuringGeneration: s,
|
|
1265
1262
|
setLoadingDuringGeneration: h,
|
|
1266
1263
|
requestStatus: J,
|
|
1267
|
-
setRequestStatus:
|
|
1268
|
-
handleGenerate:
|
|
1264
|
+
setRequestStatus: Q,
|
|
1265
|
+
handleGenerate: _,
|
|
1269
1266
|
handleLimitAiImgCount: he,
|
|
1270
1267
|
convertBase64ToFile: B,
|
|
1271
1268
|
isShiftPressed: A,
|
|
@@ -1275,8 +1272,8 @@ Select the appropriate plan to fulfil more requests`),
|
|
|
1275
1272
|
limitsInPlugin: $
|
|
1276
1273
|
};
|
|
1277
1274
|
}
|
|
1278
|
-
var
|
|
1279
|
-
const w =
|
|
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({
|
|
1280
1277
|
setModalHeight: t,
|
|
1281
1278
|
customRequest: e,
|
|
1282
1279
|
aiTabRef: o,
|
|
@@ -1288,8 +1285,8 @@ Select the appropriate plan to fulfil more requests`),
|
|
|
1288
1285
|
isLoadingAi: x,
|
|
1289
1286
|
setIsLoadingAi: p,
|
|
1290
1287
|
onPluginAiImageLimitExceeded: () => O(!0),
|
|
1291
|
-
onImageGenerateLimitExceeded:
|
|
1292
|
-
}), A = D && M > 0 ? ne.getAiTariffUpgradeStep(M) : null, L = A ? F.getLimitUpgradePresetDefinition(A.presetId) : null, J = T ? F.getLimitUpgradePresetDefinition(T.presetId) : null, [
|
|
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) => {
|
|
1293
1290
|
H.key === "Shift" ? E(!0) : H.key === "Enter" && !P && (H.preventDefault(), K());
|
|
1294
1291
|
}, [
|
|
1295
1292
|
P,
|
|
@@ -1310,19 +1307,19 @@ Select the appropriate plan to fulfil more requests`),
|
|
|
1310
1307
|
previousDisplay: F.presetLimitDisplay(A.previousLimit),
|
|
1311
1308
|
nextDisplay: F.presetLimitDisplay(A.nextLimit),
|
|
1312
1309
|
onChangePlan: () => {
|
|
1313
|
-
O(!1), document.body.classList.remove("editor"), w("/billing"), j(
|
|
1310
|
+
O(!1), document.body.classList.remove("editor"), w("/billing"), j(Y.openModal(u.MODALS.SWITCH_TO_PLAN_MODAL));
|
|
1314
1311
|
}
|
|
1315
1312
|
}) : null,
|
|
1316
1313
|
J && T ? (0, r.jsx)(F.LimitUpgradeModal, {
|
|
1317
1314
|
open: !0,
|
|
1318
|
-
onClose: () =>
|
|
1315
|
+
onClose: () => q(null),
|
|
1319
1316
|
title: C(J.titleKey),
|
|
1320
1317
|
subtitle: C(J.subtitleKey),
|
|
1321
1318
|
usageResource: J.usageResource,
|
|
1322
1319
|
previousDisplay: F.presetLimitDisplay(T.previousLimit),
|
|
1323
1320
|
nextDisplay: F.presetLimitDisplay(T.nextLimit),
|
|
1324
1321
|
onChangePlan: () => {
|
|
1325
|
-
|
|
1322
|
+
q(null), document.body.classList.remove("editor"), w("/billing"), j(Y.openModal(u.MODALS.SWITCH_TO_PLAN_MODAL));
|
|
1326
1323
|
}
|
|
1327
1324
|
}) : null,
|
|
1328
1325
|
I && (0, r.jsx)(m.LimitsCounter, {
|
|
@@ -1346,7 +1343,7 @@ Select the appropriate plan to fulfil more requests`),
|
|
|
1346
1343
|
children: (0, r.jsx)(m.Form.Item, {
|
|
1347
1344
|
style: { margin: 0 },
|
|
1348
1345
|
children: (0, r.jsxs)("span", {
|
|
1349
|
-
className: `ant-input-affix-wrapper ant-input-affix-wrapper-lg image-ai__input-affix-wrapper${
|
|
1346
|
+
className: `ant-input-affix-wrapper ant-input-affix-wrapper-lg image-ai__input-affix-wrapper${Q ? " ant-input-affix-wrapper-focused" : ""}`,
|
|
1350
1347
|
children: [(0, r.jsx)(m.TextArea, {
|
|
1351
1348
|
ref: a,
|
|
1352
1349
|
onKeyDown: Z,
|
|
@@ -1358,7 +1355,7 @@ Select the appropriate plan to fulfil more requests`),
|
|
|
1358
1355
|
className: "text-area-input-hybrid image-ai__textarea",
|
|
1359
1356
|
placeholder: C("Generate image"),
|
|
1360
1357
|
value: b,
|
|
1361
|
-
onChange:
|
|
1358
|
+
onChange: le,
|
|
1362
1359
|
spellCheck: "false"
|
|
1363
1360
|
}), (0, r.jsx)("span", {
|
|
1364
1361
|
className: "ant-input-suffix image-ai__input-suffix",
|
|
@@ -1393,7 +1390,7 @@ Select the appropriate plan to fulfil more requests`),
|
|
|
1393
1390
|
})
|
|
1394
1391
|
}), d.length > 0 && (0, r.jsxs)("div", {
|
|
1395
1392
|
className: "image-ai__image-item",
|
|
1396
|
-
children: [(0, r.jsx)(
|
|
1393
|
+
children: [(0, r.jsx)(Bt, { images: d }), (0, r.jsx)("div", {
|
|
1397
1394
|
className: "buttons",
|
|
1398
1395
|
children: (0, r.jsx)(m.Button, {
|
|
1399
1396
|
onClick: () => k(X),
|
|
@@ -1405,8 +1402,8 @@ Select the appropriate plan to fulfil more requests`),
|
|
|
1405
1402
|
})
|
|
1406
1403
|
]
|
|
1407
1404
|
});
|
|
1408
|
-
},
|
|
1409
|
-
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,
|
|
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) => {
|
|
1410
1407
|
C.error({
|
|
1411
1408
|
id: "STOCK_GIFS_SEARCH_FAILED",
|
|
1412
1409
|
title: p("Failed to load GIFs"),
|
|
@@ -1425,7 +1422,7 @@ Select the appropriate plan to fulfil more requests`),
|
|
|
1425
1422
|
z(s.error), O(!1);
|
|
1426
1423
|
return;
|
|
1427
1424
|
}
|
|
1428
|
-
i((h) => [...h, ...s.data.data]), O(!1),
|
|
1425
|
+
i((h) => [...h, ...s.data.data]), O(!1), q((h) => h + 25);
|
|
1429
1426
|
}).catch(() => {
|
|
1430
1427
|
O(!1);
|
|
1431
1428
|
}));
|
|
@@ -1450,14 +1447,14 @@ Select the appropriate plan to fulfil more requests`),
|
|
|
1450
1447
|
standalone: j,
|
|
1451
1448
|
resourceType: "generic",
|
|
1452
1449
|
intent: "display"
|
|
1453
|
-
}), [w, j]), { getDisplaySrc: I, handleLoad: A, handleError: L } =
|
|
1450
|
+
}), [w, j]), { getDisplaySrc: I, handleLoad: A, handleError: L } = tt({
|
|
1454
1451
|
items: l,
|
|
1455
1452
|
getItemId: (0, n.useCallback)((s) => s.id, []),
|
|
1456
1453
|
getRequestUrl: (0, n.useCallback)((s) => s.images.downsized.url, []),
|
|
1457
1454
|
createController: E
|
|
1458
1455
|
}), J = (s) => (h) => {
|
|
1459
1456
|
A(s), h.target.parentNode.classList.add("loaded");
|
|
1460
|
-
},
|
|
1457
|
+
}, Q = (s) => () => {
|
|
1461
1458
|
L(s);
|
|
1462
1459
|
};
|
|
1463
1460
|
return (0, r.jsxs)("div", {
|
|
@@ -1510,7 +1507,7 @@ Select the appropriate plan to fulfil more requests`),
|
|
|
1510
1507
|
lineHeight: "0",
|
|
1511
1508
|
boxSizing: "unset"
|
|
1512
1509
|
},
|
|
1513
|
-
children: (0, r.jsx)(
|
|
1510
|
+
children: (0, r.jsx)($e, {
|
|
1514
1511
|
dataLength: l && l.length,
|
|
1515
1512
|
next: ee,
|
|
1516
1513
|
hasMore: l,
|
|
@@ -1521,7 +1518,7 @@ Select the appropriate plan to fulfil more requests`),
|
|
|
1521
1518
|
scrollableTarget: "scrollableDiv",
|
|
1522
1519
|
style: { overflow: "visible" },
|
|
1523
1520
|
loader: (0, r.jsx)(m.Spin, { size: "small" }),
|
|
1524
|
-
children: (0, r.jsx)(
|
|
1521
|
+
children: (0, r.jsx)(Ne, {
|
|
1525
1522
|
breakpointCols: P,
|
|
1526
1523
|
className: "my-masonry-grid",
|
|
1527
1524
|
columnClassName: "my-masonry-grid_column",
|
|
@@ -1535,7 +1532,7 @@ Select the appropriate plan to fulfil more requests`),
|
|
|
1535
1532
|
src: I(s),
|
|
1536
1533
|
alt: s.title,
|
|
1537
1534
|
onLoad: J(s),
|
|
1538
|
-
onError:
|
|
1535
|
+
onError: Q(s)
|
|
1539
1536
|
}),
|
|
1540
1537
|
(0, r.jsx)("a", {
|
|
1541
1538
|
rel: "noreferrer",
|
|
@@ -1559,10 +1556,10 @@ Select the appropriate plan to fulfil more requests`),
|
|
|
1559
1556
|
})]
|
|
1560
1557
|
});
|
|
1561
1558
|
};
|
|
1562
|
-
function
|
|
1559
|
+
function Tt(t) {
|
|
1563
1560
|
if (!(t == null || t === "")) return t;
|
|
1564
1561
|
}
|
|
1565
|
-
async function
|
|
1562
|
+
async function Nt(t, e) {
|
|
1566
1563
|
if (t) {
|
|
1567
1564
|
if (t.url) return t.url;
|
|
1568
1565
|
if (typeof e.getFileById == "function" && t.id) {
|
|
@@ -1582,10 +1579,10 @@ Select the appropriate plan to fulfil more requests`),
|
|
|
1582
1579
|
return t.thumbnail || t.thumbnailUrl;
|
|
1583
1580
|
}
|
|
1584
1581
|
}
|
|
1585
|
-
function
|
|
1582
|
+
function Ft(t) {
|
|
1586
1583
|
if (!(!t?.success || !Array.isArray(t.detailed))) return t.detailed.find((e) => e?.success && e.data)?.data;
|
|
1587
1584
|
}
|
|
1588
|
-
function
|
|
1585
|
+
function Gt(t, e, o) {
|
|
1589
1586
|
if (t) return {
|
|
1590
1587
|
id: t.id,
|
|
1591
1588
|
name: t.name || e.name,
|
|
@@ -1605,11 +1602,11 @@ Select the appropriate plan to fulfil more requests`),
|
|
|
1605
1602
|
childrenCount: t.childrenCount
|
|
1606
1603
|
};
|
|
1607
1604
|
}
|
|
1608
|
-
async function
|
|
1605
|
+
async function zt(t, e, o) {
|
|
1609
1606
|
if (!e) return;
|
|
1610
|
-
const a =
|
|
1607
|
+
const a = Tt(o ?? e.rootId);
|
|
1611
1608
|
let i;
|
|
1612
|
-
typeof e.uploadFiles == "function" ? i =
|
|
1609
|
+
typeof e.uploadFiles == "function" ? i = Ft(await e.uploadFiles({
|
|
1613
1610
|
folderId: a,
|
|
1614
1611
|
items: [{
|
|
1615
1612
|
name: t.name,
|
|
@@ -1618,44 +1615,44 @@ Select the appropriate plan to fulfil more requests`),
|
|
|
1618
1615
|
folderId: a,
|
|
1619
1616
|
data: t
|
|
1620
1617
|
}]
|
|
1621
|
-
})) : typeof e.uploadFile == "function" && (i =
|
|
1618
|
+
})) : typeof e.uploadFile == "function" && (i = Gt(await e.uploadFile({
|
|
1622
1619
|
name: t.name,
|
|
1623
1620
|
size: t.size,
|
|
1624
1621
|
type: t.type,
|
|
1625
1622
|
folderId: a,
|
|
1626
1623
|
data: t
|
|
1627
1624
|
}), t, a));
|
|
1628
|
-
const l = await
|
|
1625
|
+
const l = await Nt(i, e);
|
|
1629
1626
|
return l ? {
|
|
1630
1627
|
item: i,
|
|
1631
1628
|
url: l
|
|
1632
1629
|
} : void 0;
|
|
1633
1630
|
}
|
|
1634
|
-
var
|
|
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) => {
|
|
1635
1632
|
const o = ke(e);
|
|
1636
1633
|
return !o || t.includes(".") ? t : `${t}.${o}`;
|
|
1637
|
-
}, _t = (t, e) => new File([t],
|
|
1638
|
-
const e = u.useAppConfig(), o = u.useIsStandalone(), { __: a } = m.useI18n(), i = u.useDispatch(), { projectId: l } =
|
|
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)({
|
|
1639
1636
|
width: "",
|
|
1640
1637
|
height: "",
|
|
1641
1638
|
size: "",
|
|
1642
1639
|
format: ""
|
|
1643
|
-
}), [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),
|
|
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)({
|
|
1644
1641
|
keywords: "",
|
|
1645
1642
|
color: "",
|
|
1646
1643
|
orientation: ""
|
|
1647
|
-
}), [se, B] = (0, n.useState)({ keywords: "" }), [ae, v] = (0, n.useState)([]), [te, G] = (0, n.useState)([]), [
|
|
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) => {
|
|
1648
1645
|
if (!(c instanceof Blob)) return;
|
|
1649
1646
|
xe.current && URL.revokeObjectURL(xe.current);
|
|
1650
1647
|
const f = URL.createObjectURL(c);
|
|
1651
|
-
xe.current = f,
|
|
1648
|
+
xe.current = f, ft(f), mt(c);
|
|
1652
1649
|
}, []), ge = (0, n.useCallback)(() => {
|
|
1653
|
-
xe.current && (URL.revokeObjectURL(xe.current), xe.current = ""),
|
|
1654
|
-
}, []),
|
|
1655
|
-
|
|
1650
|
+
xe.current && (URL.revokeObjectURL(xe.current), xe.current = ""), ft(""), mt(null);
|
|
1651
|
+
}, []), ue = (0, n.useCallback)(() => {
|
|
1652
|
+
qe("");
|
|
1656
1653
|
}, []);
|
|
1657
|
-
let ve = !(R || !F.isProjectOwner(
|
|
1658
|
-
const
|
|
1654
|
+
let ve = !(R || !F.isProjectOwner(He, x));
|
|
1655
|
+
const tn = (c) => {
|
|
1659
1656
|
D(c.target.value);
|
|
1660
1657
|
}, Me = (0, n.useCallback)((c, f, S = a("The image could not be uploaded.")) => {
|
|
1661
1658
|
const V = f instanceof Error ? f.message : S;
|
|
@@ -1665,23 +1662,23 @@ Select the appropriate plan to fulfil more requests`),
|
|
|
1665
1662
|
title: a("Upload failed"),
|
|
1666
1663
|
description: V
|
|
1667
1664
|
});
|
|
1668
|
-
}, [a, d]),
|
|
1665
|
+
}, [a, d]), nn = (0, n.useCallback)(async (c) => F.pickUploadImageUrlFromFireResults(await dt.fire({
|
|
1669
1666
|
file: c,
|
|
1670
|
-
project:
|
|
1671
|
-
})), [
|
|
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) => {
|
|
1672
1669
|
if (c) try {
|
|
1673
|
-
const f = await
|
|
1674
|
-
f &&
|
|
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."));
|
|
1675
1672
|
} catch (f) {
|
|
1676
1673
|
Me({ url: c }, f, a("Failed to process image URL."));
|
|
1677
1674
|
}
|
|
1678
|
-
},
|
|
1679
|
-
|
|
1680
|
-
if (M !== pe || !
|
|
1675
|
+
}, pt = n.default.useRef(Pe);
|
|
1676
|
+
pt.current = Pe, n.default.useEffect(() => {
|
|
1677
|
+
if (M !== pe || !q) return;
|
|
1681
1678
|
const c = y.trim();
|
|
1682
1679
|
if (!c || !c.toLowerCase().startsWith("http")) return;
|
|
1683
1680
|
const f = setTimeout(() => {
|
|
1684
|
-
|
|
1681
|
+
pt.current(c);
|
|
1685
1682
|
}, 1e3);
|
|
1686
1683
|
return () => {
|
|
1687
1684
|
clearTimeout(f);
|
|
@@ -1689,9 +1686,9 @@ Select the appropriate plan to fulfil more requests`),
|
|
|
1689
1686
|
}, [
|
|
1690
1687
|
y,
|
|
1691
1688
|
M,
|
|
1692
|
-
|
|
1689
|
+
q
|
|
1693
1690
|
]);
|
|
1694
|
-
const
|
|
1691
|
+
const sn = async (c) => {
|
|
1695
1692
|
try {
|
|
1696
1693
|
const f = ne.canonicalImageUrlKey(c);
|
|
1697
1694
|
return _t(await Ie.current.resolve(f, void 0, we), f);
|
|
@@ -1699,10 +1696,10 @@ Select the appropriate plan to fulfil more requests`),
|
|
|
1699
1696
|
};
|
|
1700
1697
|
document.onpaste = function(c) {
|
|
1701
1698
|
const f = c.clipboardData?.items?.[0];
|
|
1702
|
-
if (M === pe &&
|
|
1699
|
+
if (M === pe && q) {
|
|
1703
1700
|
if (f?.type?.indexOf("image") === 0 && e.imageCenterLocalUploadEnabled !== !1) {
|
|
1704
1701
|
const V = f.getAsFile();
|
|
1705
|
-
|
|
1702
|
+
_e(V);
|
|
1706
1703
|
const oe = { file: V };
|
|
1707
1704
|
D(""), Oe(oe);
|
|
1708
1705
|
return;
|
|
@@ -1723,70 +1720,70 @@ Select the appropriate plan to fulfil more requests`),
|
|
|
1723
1720
|
}, (0, n.useEffect)(() => {
|
|
1724
1721
|
const c = (f) => {
|
|
1725
1722
|
let S = null;
|
|
1726
|
-
w?.kind === "background" ? (S =
|
|
1723
|
+
w?.kind === "background" ? (S = at, N(at)) : w?.kind === "img" && (N(st), S = st), w?.currentUrl && S && (U(w.currentUrl), z(f));
|
|
1727
1724
|
};
|
|
1728
|
-
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(
|
|
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("");
|
|
1729
1726
|
}, [
|
|
1730
1727
|
p,
|
|
1731
1728
|
i,
|
|
1732
1729
|
ve,
|
|
1733
1730
|
w
|
|
1734
1731
|
]);
|
|
1735
|
-
const
|
|
1732
|
+
const Qe = (0, n.useCallback)(({ url: c = C || "", meta: f = Wt }) => {
|
|
1736
1733
|
U(c), j({
|
|
1737
1734
|
url: c,
|
|
1738
1735
|
meta: f
|
|
1739
1736
|
}), setTimeout(() => {
|
|
1740
|
-
|
|
1737
|
+
ue(), ge(), _({
|
|
1741
1738
|
keywords: "",
|
|
1742
1739
|
color: "",
|
|
1743
1740
|
orientation: ""
|
|
1744
|
-
}), B({ keywords: "" }), G([]), v([]), N(""),
|
|
1745
|
-
}, 200), i(
|
|
1741
|
+
}), B({ keywords: "" }), G([]), v([]), N(""), We(""), lt(!1), T(""), D(""), z(pe);
|
|
1742
|
+
}, 200), i(Y.closeModal()), i(Y.closeSecondModal());
|
|
1746
1743
|
}, [
|
|
1747
1744
|
C,
|
|
1748
|
-
|
|
1745
|
+
ue,
|
|
1749
1746
|
i,
|
|
1750
1747
|
j,
|
|
1751
1748
|
ge
|
|
1752
|
-
]),
|
|
1749
|
+
]), gt = (0, n.useCallback)((c, f) => (X("auto"), I(!1), Qe({
|
|
1753
1750
|
url: c,
|
|
1754
|
-
meta:
|
|
1751
|
+
meta: Ht
|
|
1755
1752
|
}), d.success({
|
|
1756
1753
|
id: "IMAGE_UPLOAD_SUCCESS",
|
|
1757
1754
|
data: f,
|
|
1758
1755
|
title: a("The image was successfully uploaded.")
|
|
1759
1756
|
}), c), [
|
|
1760
1757
|
a,
|
|
1761
|
-
|
|
1758
|
+
Qe,
|
|
1762
1759
|
d
|
|
1763
1760
|
]);
|
|
1764
1761
|
(0, n.useEffect)(() => {
|
|
1765
1762
|
const c = y || O, f = ne.canonicalImageUrlKey(c);
|
|
1766
1763
|
if (!c || !f) {
|
|
1767
|
-
P(""),
|
|
1764
|
+
P(""), Ve.current = "", ue(), ge(), Ie.current.invalidateAll();
|
|
1768
1765
|
return;
|
|
1769
1766
|
}
|
|
1770
|
-
const S =
|
|
1771
|
-
S && S !== f && (Ie.current.abandonKey(S),
|
|
1772
|
-
const V = new AbortController(), oe = y ? 800 : 0, re = ++be.current,
|
|
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 () => {
|
|
1773
1770
|
try {
|
|
1774
1771
|
const Se = async () => {
|
|
1775
|
-
const
|
|
1772
|
+
const fe = await Ie.current.resolve(f, V.signal, we);
|
|
1776
1773
|
if (re !== be.current) return;
|
|
1777
|
-
const { width: Ce, height:
|
|
1774
|
+
const { width: Ce, height: cn } = await ne.getImageDimensionsFromBlob(fe);
|
|
1778
1775
|
re === be.current && (K({
|
|
1779
1776
|
width: Ce,
|
|
1780
|
-
height:
|
|
1781
|
-
size: (
|
|
1782
|
-
format: ke(
|
|
1783
|
-
}),
|
|
1777
|
+
height: cn,
|
|
1778
|
+
size: (fe.size / 1024).toFixed(2),
|
|
1779
|
+
format: ke(fe.type)
|
|
1780
|
+
}), ue(), Ue(fe));
|
|
1784
1781
|
};
|
|
1785
1782
|
if (o) await Se();
|
|
1786
1783
|
else {
|
|
1787
|
-
const
|
|
1788
|
-
if (
|
|
1789
|
-
|
|
1784
|
+
const fe = await ne.resolveDataProviderPreview(t, f);
|
|
1785
|
+
if (fe?.previewUrl && re === be.current) {
|
|
1786
|
+
qe(fe.previewUrl), ge();
|
|
1790
1787
|
try {
|
|
1791
1788
|
const { data: Ce } = await b(f);
|
|
1792
1789
|
if (re !== be.current) return;
|
|
@@ -1803,22 +1800,22 @@ Select the appropriate plan to fulfil more requests`),
|
|
|
1803
1800
|
}
|
|
1804
1801
|
if (re !== be.current) return;
|
|
1805
1802
|
P("success"), U(c), ie(572), setTimeout(() => {
|
|
1806
|
-
let
|
|
1807
|
-
L.current && (
|
|
1803
|
+
let fe = 0;
|
|
1804
|
+
L.current && (fe = L.current.offsetHeight + 62), X(fe);
|
|
1808
1805
|
}, 0);
|
|
1809
1806
|
} catch (Se) {
|
|
1810
1807
|
if (Se?.name === "AbortError" || V.signal.aborted || re !== be.current) return;
|
|
1811
|
-
|
|
1808
|
+
ue(), ge(), P("error");
|
|
1812
1809
|
}
|
|
1813
1810
|
}, oe);
|
|
1814
1811
|
return () => {
|
|
1815
|
-
clearTimeout(
|
|
1812
|
+
clearTimeout(Ye), V.abort();
|
|
1816
1813
|
};
|
|
1817
1814
|
}, [
|
|
1818
1815
|
y,
|
|
1819
1816
|
O,
|
|
1820
1817
|
o,
|
|
1821
|
-
|
|
1818
|
+
ue,
|
|
1822
1819
|
we,
|
|
1823
1820
|
b,
|
|
1824
1821
|
ge,
|
|
@@ -1831,10 +1828,10 @@ Select the appropriate plan to fulfil more requests`),
|
|
|
1831
1828
|
const V = async () => {
|
|
1832
1829
|
const oe = await Ie.current.resolve(c, f.signal, we);
|
|
1833
1830
|
if (S) return;
|
|
1834
|
-
const { width: re, height:
|
|
1835
|
-
S || (
|
|
1831
|
+
const { width: re, height: Ye } = await ne.getImageDimensionsFromBlob(oe);
|
|
1832
|
+
S || (ue(), Ue(oe), K({
|
|
1836
1833
|
width: re,
|
|
1837
|
-
height:
|
|
1834
|
+
height: Ye,
|
|
1838
1835
|
size: (oe.size / 1024).toFixed(2),
|
|
1839
1836
|
format: ke(oe.type)
|
|
1840
1837
|
}));
|
|
@@ -1844,7 +1841,7 @@ Select the appropriate plan to fulfil more requests`),
|
|
|
1844
1841
|
if (!o) {
|
|
1845
1842
|
const oe = await ne.resolveDataProviderPreview(t, c);
|
|
1846
1843
|
if (oe?.previewUrl && !S) {
|
|
1847
|
-
|
|
1844
|
+
qe(oe.previewUrl), ge();
|
|
1848
1845
|
try {
|
|
1849
1846
|
const { data: re } = await b(c);
|
|
1850
1847
|
if (S) return;
|
|
@@ -1862,14 +1859,14 @@ Select the appropriate plan to fulfil more requests`),
|
|
|
1862
1859
|
}
|
|
1863
1860
|
await V();
|
|
1864
1861
|
} catch {
|
|
1865
|
-
S ||
|
|
1862
|
+
S || ue();
|
|
1866
1863
|
}
|
|
1867
1864
|
})(), () => {
|
|
1868
1865
|
S = !0, f.abort();
|
|
1869
1866
|
};
|
|
1870
1867
|
}, [
|
|
1871
1868
|
o,
|
|
1872
|
-
|
|
1869
|
+
ue,
|
|
1873
1870
|
C,
|
|
1874
1871
|
we,
|
|
1875
1872
|
b,
|
|
@@ -1878,16 +1875,16 @@ Select the appropriate plan to fulfil more requests`),
|
|
|
1878
1875
|
O,
|
|
1879
1876
|
Ue
|
|
1880
1877
|
]);
|
|
1881
|
-
const
|
|
1882
|
-
i(
|
|
1883
|
-
|
|
1878
|
+
const an = () => {
|
|
1879
|
+
i(Y.closeModal()), setTimeout(() => {
|
|
1880
|
+
ue(), ge(), U(""), D(""), G([]), G([]), _({
|
|
1884
1881
|
keywords: "",
|
|
1885
1882
|
color: "",
|
|
1886
1883
|
orientation: ""
|
|
1887
|
-
}), B({ keywords: "" }), X("auto"), !
|
|
1884
|
+
}), B({ keywords: "" }), X("auto"), !it && We(""), ie(572), z(pe);
|
|
1888
1885
|
}, 200);
|
|
1889
|
-
},
|
|
1890
|
-
c ===
|
|
1886
|
+
}, on = (c) => {
|
|
1887
|
+
c === Kt ? g.success({
|
|
1891
1888
|
mask: { closable: !0 },
|
|
1892
1889
|
centered: !0,
|
|
1893
1890
|
title: a("Coming soon"),
|
|
@@ -1905,20 +1902,20 @@ Select the appropriate plan to fulfil more requests`),
|
|
|
1905
1902
|
}
|
|
1906
1903
|
}) : (setTimeout(() => {
|
|
1907
1904
|
let f = 0, S = 0;
|
|
1908
|
-
c === pe && A.current ? (
|
|
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);
|
|
1909
1906
|
}, 0), z(c));
|
|
1910
1907
|
};
|
|
1911
1908
|
(0, n.useEffect)(() => {
|
|
1912
|
-
|
|
1909
|
+
ce.keywords === "" && (h?.current?.focus({ cursor: "start" }), G([]), setTimeout(() => {
|
|
1913
1910
|
X("auto"), ie(572);
|
|
1914
1911
|
}, 0));
|
|
1915
1912
|
}, [
|
|
1916
|
-
|
|
1913
|
+
ce,
|
|
1917
1914
|
G,
|
|
1918
1915
|
X,
|
|
1919
1916
|
ie
|
|
1920
1917
|
]);
|
|
1921
|
-
const
|
|
1918
|
+
const _e = (c) => {
|
|
1922
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";
|
|
1923
1920
|
return f || d.error({
|
|
1924
1921
|
id: "IMAGE_UPLOAD_WRONG_FORMAT",
|
|
@@ -1929,10 +1926,10 @@ Select the appropriate plan to fulfil more requests`),
|
|
|
1929
1926
|
}, Oe = async ({ file: c }) => {
|
|
1930
1927
|
try {
|
|
1931
1928
|
ye(!0);
|
|
1932
|
-
const f = await ne.prepareImageForEditorUpload(c, e), S = await
|
|
1933
|
-
if (S) return
|
|
1934
|
-
const V = await
|
|
1935
|
-
if (V?.url) return
|
|
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;
|
|
1936
1933
|
Me(f, null);
|
|
1937
1934
|
return;
|
|
1938
1935
|
} catch (f) {
|
|
@@ -1941,17 +1938,17 @@ Select the appropriate plan to fulfil more requests`),
|
|
|
1941
1938
|
} finally {
|
|
1942
1939
|
ye(!1);
|
|
1943
1940
|
}
|
|
1944
|
-
},
|
|
1941
|
+
}, ln = (c) => Oe({ file: c });
|
|
1945
1942
|
let Le = [{
|
|
1946
1943
|
label: a("Upload"),
|
|
1947
1944
|
key: pe,
|
|
1948
1945
|
children: (0, r.jsxs)("div", {
|
|
1949
1946
|
ref: A,
|
|
1950
1947
|
style: { paddingBottom: 24 },
|
|
1951
|
-
children: [e.imageCenterLocalUploadEnabled !== !1 && (0, r.jsxs)(
|
|
1948
|
+
children: [e.imageCenterLocalUploadEnabled !== !1 && (0, r.jsxs)(Vt, {
|
|
1952
1949
|
showUploadList: !1,
|
|
1953
1950
|
name: "Image",
|
|
1954
|
-
beforeUpload:
|
|
1951
|
+
beforeUpload: _e,
|
|
1955
1952
|
customRequest: Oe,
|
|
1956
1953
|
style: { marginBottom: 10 },
|
|
1957
1954
|
multiple: !1,
|
|
@@ -1980,7 +1977,7 @@ Select the appropriate plan to fulfil more requests`),
|
|
|
1980
1977
|
size: "large",
|
|
1981
1978
|
placeholder: a("Paste image URL here"),
|
|
1982
1979
|
value: y,
|
|
1983
|
-
onChange:
|
|
1980
|
+
onChange: tn,
|
|
1984
1981
|
spellCheck: "false"
|
|
1985
1982
|
})
|
|
1986
1983
|
})
|
|
@@ -1989,30 +1986,30 @@ Select the appropriate plan to fulfil more requests`),
|
|
|
1989
1986
|
}];
|
|
1990
1987
|
return e.imageCenterStockEnabled && !ve && Le.push({
|
|
1991
1988
|
label: a("Stock"),
|
|
1992
|
-
key:
|
|
1989
|
+
key: Ge,
|
|
1993
1990
|
children: (0, r.jsx)("div", {
|
|
1994
1991
|
ref: J,
|
|
1995
1992
|
style: { paddingBottom: 24 },
|
|
1996
|
-
children: (0, r.jsx)(
|
|
1997
|
-
currentReq:
|
|
1998
|
-
setCurrentReq:
|
|
1993
|
+
children: (0, r.jsx)(Lt, {
|
|
1994
|
+
currentReq: ce,
|
|
1995
|
+
setCurrentReq: _,
|
|
1999
1996
|
imageStockList: te,
|
|
2000
1997
|
setImageStockList: G,
|
|
2001
1998
|
setModalWidth: ie,
|
|
2002
1999
|
setModalHeight: X,
|
|
2003
2000
|
setStockLink: T,
|
|
2004
2001
|
setCurrentImageLink: U,
|
|
2005
|
-
inputRef:
|
|
2002
|
+
inputRef: le,
|
|
2006
2003
|
customRequest: Pe
|
|
2007
2004
|
})
|
|
2008
2005
|
})
|
|
2009
2006
|
}), e.imageCenterGifEnabled && !ve && Le.push({
|
|
2010
2007
|
label: a("GIF"),
|
|
2011
|
-
key:
|
|
2008
|
+
key: ze,
|
|
2012
2009
|
children: (0, r.jsx)("div", {
|
|
2013
|
-
ref:
|
|
2010
|
+
ref: Q,
|
|
2014
2011
|
style: { paddingBottom: 24 },
|
|
2015
|
-
children: (0, r.jsx)(
|
|
2012
|
+
children: (0, r.jsx)(Pt, {
|
|
2016
2013
|
currentReqGif: se,
|
|
2017
2014
|
setCurrentReqGif: B,
|
|
2018
2015
|
imageGifList: ae,
|
|
@@ -2027,19 +2024,19 @@ Select the appropriate plan to fulfil more requests`),
|
|
|
2027
2024
|
})
|
|
2028
2025
|
}), e.elementAIimageEnabled && !ve && Le.push({
|
|
2029
2026
|
label: a("AI"),
|
|
2030
|
-
key:
|
|
2027
|
+
key: Ke,
|
|
2031
2028
|
children: (0, r.jsx)("div", {
|
|
2032
2029
|
ref: s,
|
|
2033
2030
|
style: { paddingBottom: 24 },
|
|
2034
|
-
children: (0, r.jsx)(
|
|
2031
|
+
children: (0, r.jsx)(Mt, {
|
|
2035
2032
|
setModalHeight: X,
|
|
2036
2033
|
customRequest: Oe,
|
|
2037
|
-
aiImageRequest:
|
|
2038
|
-
setAiImageRequest:
|
|
2039
|
-
imageAiList:
|
|
2040
|
-
setImageAiList:
|
|
2041
|
-
isLoadingAi:
|
|
2042
|
-
setIsLoadingAi:
|
|
2034
|
+
aiImageRequest: ct,
|
|
2035
|
+
setAiImageRequest: We,
|
|
2036
|
+
imageAiList: de,
|
|
2037
|
+
setImageAiList: Yt,
|
|
2038
|
+
isLoadingAi: it,
|
|
2039
|
+
setIsLoadingAi: lt,
|
|
2043
2040
|
aiTabRef: s,
|
|
2044
2041
|
inputAiRef: Z,
|
|
2045
2042
|
isImageUploaded: E,
|
|
@@ -2051,15 +2048,15 @@ Select the appropriate plan to fulfil more requests`),
|
|
|
2051
2048
|
key: Ae,
|
|
2052
2049
|
children: (0, r.jsx)("div", {
|
|
2053
2050
|
ref: L,
|
|
2054
|
-
children: (0, r.jsx)(
|
|
2051
|
+
children: (0, r.jsx)(xt, {
|
|
2055
2052
|
currentImageLink: C,
|
|
2056
2053
|
newLink: y,
|
|
2057
|
-
previewDisplayUrl:
|
|
2058
|
-
resolvedPreviewObjectUrl:
|
|
2059
|
-
resolvedPreviewBlob:
|
|
2060
|
-
resolveImageBlob:
|
|
2054
|
+
previewDisplayUrl: en,
|
|
2055
|
+
resolvedPreviewObjectUrl: Jt,
|
|
2056
|
+
resolvedPreviewBlob: $t,
|
|
2057
|
+
resolveImageBlob: rn,
|
|
2061
2058
|
imageSize: ee,
|
|
2062
|
-
onSave:
|
|
2059
|
+
onSave: ln,
|
|
2063
2060
|
uploadImageResultIsLoading: he || !1
|
|
2064
2061
|
})
|
|
2065
2062
|
})
|
|
@@ -2068,15 +2065,15 @@ Select the appropriate plan to fulfil more requests`),
|
|
|
2068
2065
|
className: "image-center",
|
|
2069
2066
|
title: a("Image Center"),
|
|
2070
2067
|
style: { minHeight: 390 },
|
|
2071
|
-
open: !!
|
|
2072
|
-
onOk:
|
|
2073
|
-
onCancel:
|
|
2068
|
+
open: !!q,
|
|
2069
|
+
onOk: Qe,
|
|
2070
|
+
onCancel: an,
|
|
2074
2071
|
footer: M === Ae ? (0, r.jsx)(r.Fragment, {}) : null,
|
|
2075
2072
|
children: (0, r.jsx)(m.Spin, {
|
|
2076
2073
|
spinning: he,
|
|
2077
2074
|
children: (0, r.jsx)(m.Tabs, {
|
|
2078
2075
|
activeKey: M,
|
|
2079
|
-
onChange:
|
|
2076
|
+
onChange: on,
|
|
2080
2077
|
items: Le,
|
|
2081
2078
|
className: "modal-tabs",
|
|
2082
2079
|
style: {
|
|
@@ -2085,11 +2082,11 @@ Select the appropriate plan to fulfil more requests`),
|
|
|
2085
2082
|
}
|
|
2086
2083
|
})
|
|
2087
2084
|
})
|
|
2088
|
-
}), (0, r.jsx)(F.
|
|
2089
|
-
open:
|
|
2085
|
+
}), (0, r.jsx)(F.PlanUpgradePrompt, {
|
|
2086
|
+
open: Zt,
|
|
2090
2087
|
onCancel: () => Ee(!1),
|
|
2091
|
-
initialSlide:
|
|
2088
|
+
initialSlide: Xt
|
|
2092
2089
|
})] });
|
|
2093
2090
|
};
|
|
2094
|
-
|
|
2091
|
+
ot.propTypes = { dataProvider: vt.default.object }, ht.default = ot;
|
|
2095
2092
|
});
|