useblocks 1.1.9 → 1.1.11
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/README.md +0 -1
- package/iframe/js/amp.BSx0mG91.js +1 -0
- package/iframe/js/iframe-eblock.js +1 -1
- package/iframe/js/iframe.js +1 -1
- package/iframe/js/rules.B4dVzZIU.js +1 -1
- package/iframe/js/sanitize-html.BA1fFyP6.js +1 -0
- package/package.json +1 -1
- package/static/core/{4a6c33e4.js → 2ace19b3.js} +17 -17
- package/static/core/{b57dc87c.js → 30e1cd89.js} +1 -1
- package/static/core/62863a09.js +33 -0
- package/static/core/{cc141b53.js → 6b48c0fb.js} +1 -1
- package/static/core/{7b3ab6c8.js → 71a391c2.js} +1 -1
- package/static/core/{d4e69323.js → 75723bf5.js} +1 -1
- package/static/core/{c93b4f06.js → 771aecf6.js} +1 -1
- package/static/core/{3a92c038.js → 7a9d2ed3.js} +1 -1
- package/static/core/{4cb1af33.js → 98558f8c.js} +1 -1
- package/static/core/{6493972d.js → a19bf3ee.js} +1 -1
- package/static/core/{41400d24.js → b4600253.js} +1 -1
- package/static/core/{7b4f9e02.js → d4f3066f.js} +1 -1
- package/static/core/e62125cf.js +1 -0
- package/static/core/{5b91fab0.js → ea5758c2.js} +1 -1
- package/static/core/{e9ed0819.js → f6ba84b8.js} +1 -1
- package/static/esm/{e6780554.js → 1be7efab.js} +1 -1
- package/two_step_headless_plugin.html +1 -1
- package/{useblocks-core.a8855649.js → useblocks-core.5fac2936.js} +1 -1
- package/useblocks-esm.js +3 -3
- package/useblocks.d.ts +1 -9
- package/useblocks.js +2 -2
- package/iframe/js/amp.DltrX-cv.js +0 -1
- package/iframe/js/sanitize-html.BUfJ0Zmy.js +0 -1
- package/static/core/3fe138bd.js +0 -29
- package/static/core/7cf3023b.js +0 -1
- /package/iframe/{iframe-eblock.a8855649.html → iframe-eblock.5fac2936.html} +0 -0
- /package/iframe/{iframe.a8855649.html → iframe.5fac2936.html} +0 -0
package/useblocks.d.ts
CHANGED
|
@@ -561,11 +561,6 @@ type MergeTagItem = {
|
|
|
561
561
|
type MergeTag = MergeTagGroup | MergeTagItem;
|
|
562
562
|
type SaveListener<T> = AppListener<SaveEventPayload<T>, T | undefined | void>;
|
|
563
563
|
type SaveEvent<T> = AppEvent<SaveListener<T>>;
|
|
564
|
-
/** Payload кнопки «обновить глобальный блок» в iframe (синхронизация шаблона) */
|
|
565
|
-
type GlobalBlockPropagateUpdatePayload = {
|
|
566
|
-
/** ID глобального блока (атрибут em-block-id) */emBlockId: string; /** HTML фрагмент блока — тот же формат, что при сохранении в библиотеку */
|
|
567
|
-
blockHtml: string;
|
|
568
|
-
};
|
|
569
564
|
type RemoveListener<T> = AppListener<RemoveEventPayload<T>>;
|
|
570
565
|
type RemoveEvent<T> = AppEvent<RemoveListener<T>>;
|
|
571
566
|
type CreateListener<T> = AppListener<CreateEventPayload<T>, T | undefined | void>;
|
|
@@ -1811,7 +1806,6 @@ export declare namespace ExportedApi {
|
|
|
1811
1806
|
project: string;
|
|
1812
1807
|
}) => MayBePromise<Block[]>;
|
|
1813
1808
|
type ReadCommentsHandler = (emailId: string) => MayBePromise<Comment[]>;
|
|
1814
|
-
type PropagateGlobalBlockHandler = AppListener<GlobalBlockPropagateUpdatePayload, void | false>;
|
|
1815
1809
|
type EmailHandler = AppListener<Email>;
|
|
1816
1810
|
type HtmlHandler = AppListener<string>;
|
|
1817
1811
|
type TestEmailSendEventPayload = {
|
|
@@ -1862,8 +1856,6 @@ export declare namespace ExportedApi {
|
|
|
1862
1856
|
handleSaveBlock: SaveEvent<Block>;
|
|
1863
1857
|
/** fires when block delete */
|
|
1864
1858
|
handleRemoveBlock: RemoveEvent<Block>;
|
|
1865
|
-
/** iframe: обновить шаблон глобального блока (кнопка синхронизации на блоке с em-block-id) */
|
|
1866
|
-
handlePropagateGlobalBlock: AppEvent<PropagateGlobalBlockHandler>;
|
|
1867
1859
|
/** read comments handler */
|
|
1868
1860
|
handleReadComments: AppEvent<ReadCommentsHandler>;
|
|
1869
1861
|
/** fires when comment save */
|
|
@@ -3215,4 +3207,4 @@ export declare namespace helpers {
|
|
|
3215
3207
|
*/
|
|
3216
3208
|
export function mapHttpStatusToErrorCode(status: number, defaultCode?: FileManagerErrorCode): FileManagerErrorCode;
|
|
3217
3209
|
}
|
|
3218
|
-
export { ApiPaginationResponse, AppEvent, AppListener, BatchResult, BlockDesc, COMMON_STYLES, CommonStyles, CommonStylesBlock, CommonStylesBorder, CommonStylesBorderRadius, CommonStylesBorderSide, CommonStylesButton, CommonStylesCard, CommonStylesHeading, CommonStylesLink, CommonStylesPadding, CommonStylesText, Config, CreateEvent, CreateEventPayload, CreateListener, EditStackData, EditStackSnapshot, EmailDesc, ExtractPluginOptions, fileManager_d_exports as FileManager, FileManagerApiErrorInfo, FileSystemItem, FileSystemItemUpdate, GetFileDataOptions,
|
|
3210
|
+
export { ApiPaginationResponse, AppEvent, AppListener, BatchResult, BlockDesc, COMMON_STYLES, CommonStyles, CommonStylesBlock, CommonStylesBorder, CommonStylesBorderRadius, CommonStylesBorderSide, CommonStylesButton, CommonStylesCard, CommonStylesHeading, CommonStylesLink, CommonStylesPadding, CommonStylesText, Config, CreateEvent, CreateEventPayload, CreateListener, EditStackData, EditStackSnapshot, EmailDesc, ExtractPluginOptions, fileManager_d_exports as FileManager, FileManagerApiErrorInfo, FileSystemItem, FileSystemItemUpdate, GetFileDataOptions, IFrameErrorInfo, IPlugin, IPluginConstructor, ISelection, ISingleModelEditStackData, IUndoRedoService, Instance, InstanceOfPluginType, MayBePromise, MergeTag, MergeTagGroup, MergeTagItem, ModulePluginDescriptor, type NotifyEvent, OperationResult, Options, ParsedAMP, PluginClassConstructor, PluginDescriptor, PluginEntryItem, PluginFunctionConstructor, PluginLoader, PluginRegistry, PluginTypeMap, PreloadOptions, PromiseWrap, RecursivePartial, RegistryPluginDescriptor, RemoveEvent, RemoveEventPayload, RemoveListener, SaveEvent, SaveEventPayload, SaveListener, SortState, StorageProvider, StorageProviderController, UploadFileItemInput, UploadFilesRequest, WindowPluginDescriptor, init, parseAMP, pluginRegistry, preload, version };
|
package/useblocks.js
CHANGED
|
@@ -12,7 +12,7 @@
|
|
|
12
12
|
})(typeof globalThis !== 'undefined' ? globalThis : typeof self !== 'undefined' ? self : this, function() {
|
|
13
13
|
'use strict';
|
|
14
14
|
|
|
15
|
-
var e=window.__useblocks__||(window.__useblocks__={});(function(){"use strict";if(e!==void 0&&e.define)return;e===void 0&&(window.__amdEnv={});var t={},n={},r={},i={},a={},o=`./`,s={};function c(e,t){var n=Error(`[AMD] Failed to load module "`+e+`"`+(t?`: `+t.message:``));return n.moduleId=e,n.cause=t,n}function l(e,t,n){var r=Error(`[AMD] Failed to resolve dependency "`+t+`" for module "`+e+`"`+(n?`: `+n.message:``));return r.moduleId=e,r.dependencyId=t,r.cause=n,r}function u(e){for(var t=String(e||``).split(`/`),n=[],r=0;r<t.length;r++){var i=t[r];if(!(!i||i===`.`)){if(i===`..`){n.length>0&&n.pop();continue}n.push(i)}}return n.join(`/`)}function d(e){var t=String(e||``).replace(/\\/g,`/`),n=String(o||`./`).replace(/\\/g,`/`);return n=n.replace(/^\.\/+/,``),n=n.replace(/^\/+/,``),n&&n.slice(-1)!==`/`&&(n+=`/`),n&&t.indexOf(n)===0&&(t=t.slice(n.length)),t.indexOf(`./`)===0&&(t=t.slice(2)),t}function f(e,t){var n=String(e||``);if(!n)return n;if(!(n.indexOf(`./`)===0||n.indexOf(`../`)===0))return d(u(n));var r=u(t||``),i=r?r.split(`/`):[];i.length>0&&i.pop();for(var a=n.split(`/`),o=0;o<a.length;o++){var s=a[o];if(!(!s||s===`.`)){if(s===`..`){i.length>0&&i.pop();continue}i.push(s)}}return d(i.join(`/`))}function p(e){return/^[a-zA-Z][a-zA-Z\d+\-.]*:/.test(e)||e.indexOf(`//`)===0}function m(e){var t=String(e||``);if(!t||p(t))return t;try{var n=typeof document<`u`&&document.baseURI?document.baseURI:typeof window<`u`&&window.location?window.location.href:``;return n?new URL(t,n).href:t}catch{return t}}function h(){var t=String(o||`./`);if(t.slice(-1)!==`/`&&(t+=`/`),p(t)||t.charAt(0)===`/`)return t;if(e!==void 0&&e&&e.publicPath)try{return new URL(t,m(e.publicPath)).href}catch{}return m(t)}function g(e,t){var n=f(e,t),r=h(),i=Object.prototype.hasOwnProperty.call(s,n)?String(s[n]||``):n;i.slice(-3)!==`.js`&&(i+=`.js`);try{return new URL(i,r).href}catch{return r+i}}function _(){if(typeof document>`u`)return``;var e=document.currentScript;if(e){var t=e.getAttribute(`data-amd-module-id`);if(t)return t}return``}function v(e,n,r){if(Array.isArray(e)?(r=n,n=e,e=_()):typeof e==`function`?(r=e,n=[],e=_()):typeof n==`function`&&(r=n,n=[]),!e)throw Error(`[AMD] Anonymous define() could not be associated with a module id`);e in t||(t[e]={deps:n||[],factory:r})}v.amd={async:!0};function y(){return function(){}}function b(e,t){return{id:e,exports:t,uri:g(e)}}function x(e,t,n,r){if(Array.isArray(e)){var i=Promise.all(e.map(function(e){return C(e,r)})).then(function(e){return t&&t.apply(null,e),e});return n&&i.catch(n),i}return C(e,r)}function S(e,o){if(Array.isArray(e))throw Error(`[AMD] syncRequire does not support dependency arrays`);var s=f(e,o);if(s in a)throw a[s];if(s in n)return n[s];if(s in r||s in i)throw c(s,Error(`Module is still loading asynchronously`));if(!(s in t))throw c(s,Error(`Module is not available for syncRequire`));return T(s)}function C(e,i){var o=f(e,i);return o in a?Promise.reject(a[o]):o in n?Promise.resolve(n[o]):o in r?r[o]:o in t?(r[o]=w(o),r[o]):(r[o]=D(o).then(function(){if(!(o in t)){var e=c(o,Error(`Module not defined after script load`));throw a[o]=e,e}return w(o)}).catch(function(e){delete r[o];var t=c(o,e);throw a[o]=t,t}),r[o])}function w(e){var i=t[e],o=E(e),s=y(),c=b(e,s);return Promise.all(i.deps.map(function(t){return t===`exports`?s:t===`require`?o:t===`module`?c:C(t,e).catch(function(n){throw l(e,t,n)})})).then(function(t){var a=i.factory.apply(null,t);return a&&typeof a.then==`function`?a.then(function(t){return n[e]=t===void 0?c.exports:t,delete r[e],n[e]}):(n[e]=a===void 0?c.exports:a,delete r[e],n[e])}).catch(function(t){throw delete r[e],a[e]=t,t})}function T(e){var r=t[e],i=E(e),o=y(),s=b(e,o);try{var u=r.deps.map(function(t){if(t===`exports`)return o;if(t===`require`)return i;if(t===`module`)return s;try{return S(t,e)}catch(n){throw l(e,t,n)}}),d=r.factory.apply(null,u);if(d&&typeof d.then==`function`)throw c(e,Error(`Module resolved asynchronously and cannot be syncRequired`));return n[e]=d===void 0?s.exports:d,n[e]}catch(t){throw a[e]=t,t}}function E(e){var r=function(r,i,a){if(Array.isArray(r))return x(r,i,a,e);var o=f(r,e);return o in n?n[o]:o in t?S(r,e):C(r,e)};return r.resolve=function(t){return f(t,e)},r.toUrl=function(t){return g(t,e)},r.sync=function(t){return S(t,e)},r}function D(e){if(e in i)return i[e];var t=g(e);return document.querySelector(`script[src="`+t+`"]`)?(i[e]=Promise.resolve(),i[e]):(i[e]=new Promise(function(n,r){var a=document.createElement(`script`);a.src=t,a.setAttribute(`data-amd-module-id`,e),a.async=!0,a.onload=function(){n()},a.onerror=function(){delete i[e],r(Error(`Failed to load script: `+t))},document.head.appendChild(a)}),i[e])}x.config=function(e){if(e.baseUrl&&(o=e.baseUrl),e.paths)for(var t in e.paths)Object.prototype.hasOwnProperty.call(e.paths,t)&&(s[t]=e.paths[t])},x.modules=t,x.resolved=n,x.errors=a,x.toUrl=g,x.sync=S,e.define=v,e.require=x,e.syncRequire=S})(),e.require.config({baseUrl:`./`,paths:{core:`useblocks-core.
|
|
15
|
+
var e=window.__useblocks__||(window.__useblocks__={});(function(){"use strict";if(e!==void 0&&e.define)return;e===void 0&&(window.__amdEnv={});var t={},n={},r={},i={},a={},o=`./`,s={};function c(e,t){var n=Error(`[AMD] Failed to load module "`+e+`"`+(t?`: `+t.message:``));return n.moduleId=e,n.cause=t,n}function l(e,t,n){var r=Error(`[AMD] Failed to resolve dependency "`+t+`" for module "`+e+`"`+(n?`: `+n.message:``));return r.moduleId=e,r.dependencyId=t,r.cause=n,r}function u(e){for(var t=String(e||``).split(`/`),n=[],r=0;r<t.length;r++){var i=t[r];if(!(!i||i===`.`)){if(i===`..`){n.length>0&&n.pop();continue}n.push(i)}}return n.join(`/`)}function d(e){var t=String(e||``).replace(/\\/g,`/`),n=String(o||`./`).replace(/\\/g,`/`);return n=n.replace(/^\.\/+/,``),n=n.replace(/^\/+/,``),n&&n.slice(-1)!==`/`&&(n+=`/`),n&&t.indexOf(n)===0&&(t=t.slice(n.length)),t.indexOf(`./`)===0&&(t=t.slice(2)),t}function f(e,t){var n=String(e||``);if(!n)return n;if(!(n.indexOf(`./`)===0||n.indexOf(`../`)===0))return d(u(n));var r=u(t||``),i=r?r.split(`/`):[];i.length>0&&i.pop();for(var a=n.split(`/`),o=0;o<a.length;o++){var s=a[o];if(!(!s||s===`.`)){if(s===`..`){i.length>0&&i.pop();continue}i.push(s)}}return d(i.join(`/`))}function p(e){return/^[a-zA-Z][a-zA-Z\d+\-.]*:/.test(e)||e.indexOf(`//`)===0}function m(e){var t=String(e||``);if(!t||p(t))return t;try{var n=typeof document<`u`&&document.baseURI?document.baseURI:typeof window<`u`&&window.location?window.location.href:``;return n?new URL(t,n).href:t}catch{return t}}function h(){var t=String(o||`./`);if(t.slice(-1)!==`/`&&(t+=`/`),p(t)||t.charAt(0)===`/`)return t;if(e!==void 0&&e&&e.publicPath)try{return new URL(t,m(e.publicPath)).href}catch{}return m(t)}function g(e,t){var n=f(e,t),r=h(),i=Object.prototype.hasOwnProperty.call(s,n)?String(s[n]||``):n;i.slice(-3)!==`.js`&&(i+=`.js`);try{return new URL(i,r).href}catch{return r+i}}function _(){if(typeof document>`u`)return``;var e=document.currentScript;if(e){var t=e.getAttribute(`data-amd-module-id`);if(t)return t}return``}function v(e,n,r){if(Array.isArray(e)?(r=n,n=e,e=_()):typeof e==`function`?(r=e,n=[],e=_()):typeof n==`function`&&(r=n,n=[]),!e)throw Error(`[AMD] Anonymous define() could not be associated with a module id`);e in t||(t[e]={deps:n||[],factory:r})}v.amd={async:!0};function y(){return function(){}}function b(e,t){return{id:e,exports:t,uri:g(e)}}function x(e,t,n,r){if(Array.isArray(e)){var i=Promise.all(e.map(function(e){return C(e,r)})).then(function(e){return t&&t.apply(null,e),e});return n&&i.catch(n),i}return C(e,r)}function S(e,o){if(Array.isArray(e))throw Error(`[AMD] syncRequire does not support dependency arrays`);var s=f(e,o);if(s in a)throw a[s];if(s in n)return n[s];if(s in r||s in i)throw c(s,Error(`Module is still loading asynchronously`));if(!(s in t))throw c(s,Error(`Module is not available for syncRequire`));return T(s)}function C(e,i){var o=f(e,i);return o in a?Promise.reject(a[o]):o in n?Promise.resolve(n[o]):o in r?r[o]:o in t?(r[o]=w(o),r[o]):(r[o]=D(o).then(function(){if(!(o in t)){var e=c(o,Error(`Module not defined after script load`));throw a[o]=e,e}return w(o)}).catch(function(e){delete r[o];var t=c(o,e);throw a[o]=t,t}),r[o])}function w(e){var i=t[e],o=E(e),s=y(),c=b(e,s);return Promise.all(i.deps.map(function(t){return t===`exports`?s:t===`require`?o:t===`module`?c:C(t,e).catch(function(n){throw l(e,t,n)})})).then(function(t){var a=i.factory.apply(null,t);return a&&typeof a.then==`function`?a.then(function(t){return n[e]=t===void 0?c.exports:t,delete r[e],n[e]}):(n[e]=a===void 0?c.exports:a,delete r[e],n[e])}).catch(function(t){throw delete r[e],a[e]=t,t})}function T(e){var r=t[e],i=E(e),o=y(),s=b(e,o);try{var u=r.deps.map(function(t){if(t===`exports`)return o;if(t===`require`)return i;if(t===`module`)return s;try{return S(t,e)}catch(n){throw l(e,t,n)}}),d=r.factory.apply(null,u);if(d&&typeof d.then==`function`)throw c(e,Error(`Module resolved asynchronously and cannot be syncRequired`));return n[e]=d===void 0?s.exports:d,n[e]}catch(t){throw a[e]=t,t}}function E(e){var r=function(r,i,a){if(Array.isArray(r))return x(r,i,a,e);var o=f(r,e);return o in n?n[o]:o in t?S(r,e):C(r,e)};return r.resolve=function(t){return f(t,e)},r.toUrl=function(t){return g(t,e)},r.sync=function(t){return S(t,e)},r}function D(e){if(e in i)return i[e];var t=g(e);return document.querySelector(`script[src="`+t+`"]`)?(i[e]=Promise.resolve(),i[e]):(i[e]=new Promise(function(n,r){var a=document.createElement(`script`);a.src=t,a.setAttribute(`data-amd-module-id`,e),a.async=!0,a.onload=function(){n()},a.onerror=function(){delete i[e],r(Error(`Failed to load script: `+t))},document.head.appendChild(a)}),i[e])}x.config=function(e){if(e.baseUrl&&(o=e.baseUrl),e.paths)for(var t in e.paths)Object.prototype.hasOwnProperty.call(e.paths,t)&&(s[t]=e.paths[t])},x.modules=t,x.resolved=n,x.errors=a,x.toUrl=g,x.sync=S,e.define=v,e.require=x,e.syncRequire=S})(),e.require.config({baseUrl:`./`,paths:{core:`useblocks-core.5fac2936.js`}});
|
|
16
16
|
|
|
17
17
|
// PublicPath (script detection via document.currentScript)
|
|
18
18
|
if (!__useblocks__.publicPath) {
|
|
@@ -740,7 +740,7 @@ __useblocks__.define(`useblocks.js`,[`require`,`exports`,`module`],function(e,t,
|
|
|
740
740
|
100% {
|
|
741
741
|
transform: rotate(360deg);
|
|
742
742
|
}
|
|
743
|
-
}`;function ue(){return()=>{}}function de(e,t){if(!U()||!e||typeof document>`u`)return ue();e.querySelectorAll(`.blocks-app-initial-spinner-wrapper`).forEach(e=>{e.remove()});let n=document.createElement(`div`);n.classList.add(`blocks-app-initial-spinner-wrapper`);let r=document.createElement(`div`);r.classList.add(`blocks-app-initial-spinner`),n.appendChild(r);let i=document.createElement(`style`);i.setAttribute(t,`true`),i.textContent=W,document.head?.appendChild(i),e.appendChild(n);let a=!1;return()=>{a||(a=!0,n.remove(),i.remove())}}function G(e){return f(e)}G(`HANDLE_ATOM_INSERT`),G(`SETTINGS_PANEL_EVENT`),G(`MODAL_SHOW_EVENT`),G(`MODAL_CLOSE_EVENT`),G(`MODAL_UPDATE_EVENT`);var fe=i((e=>{var t={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},n=Object.assign,r={};function i(e,n,i){this.props=e,this.context=n,this.refs=r,this.updater=i||t}i.prototype.isReactComponent={},i.prototype.setState=function(e,t){if(typeof e!=`object`&&typeof e!=`function`&&e!=null)throw Error(`setState(...): takes an object of state variables to update or a function which returns an object of state variables.`);this.updater.enqueueSetState(this,e,t,`setState`)},i.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,`forceUpdate`)};function a(){}a.prototype=i.prototype;function o(e,n,i){this.props=e,this.context=n,this.refs=r,this.updater=i||t}var s=o.prototype=new a;s.constructor=o,n(s,i.prototype),s.isPureReactComponent=!0,Array.isArray}));i(((e,t)=>{t.exports=fe()}))();function K(e){return f(e)}var pe;(function(e){e.BEFORE_SAVE_EMAIL=K(),e.ON_SAVEBUTTON_CLICK_ID=K(),e.ON_NEXTBUTTON_CLICK_ID=K(),e.ON_PREVIOUSBUTTON_CLICK_ID=K(),e.ON_MODEL_CHANGE=K(),e.WILL_EMAIL_INIT_ID=K(),e.ON_EMAIL_INIT_ID=K(),e.ON_BLOCK_INIT_ID=K(),e.ON_CONTENT_CHANGED_ID=K(),e.ON_PREHEADER_CHANGED_ID=K(),e.ON_SUBJECT_CHANGED_ID=K(),e.ON_EMAIL_CHANGED_ID=K(),e.ON_BLOCK_CHANGED_ID=K(),e.ON_CHUNKS_LOADED=K(),e.ON_SEND_TESTEMAIL_ID=K(),e.ON_SEND_LIVEPREVIEW_ID=K(),e.ON_SHARE_ID=K(),e.ON_SHOW_PREVIEW_ID=K(),e.ON_EMAIL_CLONE_ID=K(),e.ON_SEND_EMAIL_MODAL_ID=K(),e.ON_NOTIFICATION=K(),e.READ_LOCALE=K(),e.ON_TRANSLATE_ID=K(),e.ON_CODE_VALIDATE_ID=K(),e.UPLOAD_EVENT_ID=K(),e.PROXY_URL_EVENT_ID=K(),e.FILE_PROXY_EVENT_ID=K(),e.ON_LIMIT_ID=K(),e.
|
|
743
|
+
}`;function ue(){return()=>{}}function de(e,t){if(!U()||!e||typeof document>`u`)return ue();e.querySelectorAll(`.blocks-app-initial-spinner-wrapper`).forEach(e=>{e.remove()});let n=document.createElement(`div`);n.classList.add(`blocks-app-initial-spinner-wrapper`);let r=document.createElement(`div`);r.classList.add(`blocks-app-initial-spinner`),n.appendChild(r);let i=document.createElement(`style`);i.setAttribute(t,`true`),i.textContent=W,document.head?.appendChild(i),e.appendChild(n);let a=!1;return()=>{a||(a=!0,n.remove(),i.remove())}}function G(e){return f(e)}G(`HANDLE_ATOM_INSERT`),G(`SETTINGS_PANEL_EVENT`),G(`MODAL_SHOW_EVENT`),G(`MODAL_CLOSE_EVENT`),G(`MODAL_UPDATE_EVENT`);var fe=i((e=>{var t={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},n=Object.assign,r={};function i(e,n,i){this.props=e,this.context=n,this.refs=r,this.updater=i||t}i.prototype.isReactComponent={},i.prototype.setState=function(e,t){if(typeof e!=`object`&&typeof e!=`function`&&e!=null)throw Error(`setState(...): takes an object of state variables to update or a function which returns an object of state variables.`);this.updater.enqueueSetState(this,e,t,`setState`)},i.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,`forceUpdate`)};function a(){}a.prototype=i.prototype;function o(e,n,i){this.props=e,this.context=n,this.refs=r,this.updater=i||t}var s=o.prototype=new a;s.constructor=o,n(s,i.prototype),s.isPureReactComponent=!0,Array.isArray}));i(((e,t)=>{t.exports=fe()}))();function K(e){return f(e)}var pe;(function(e){e.BEFORE_SAVE_EMAIL=K(),e.ON_SAVEBUTTON_CLICK_ID=K(),e.ON_NEXTBUTTON_CLICK_ID=K(),e.ON_PREVIOUSBUTTON_CLICK_ID=K(),e.ON_MODEL_CHANGE=K(),e.WILL_EMAIL_INIT_ID=K(),e.ON_EMAIL_INIT_ID=K(),e.ON_BLOCK_INIT_ID=K(),e.ON_CONTENT_CHANGED_ID=K(),e.ON_PREHEADER_CHANGED_ID=K(),e.ON_SUBJECT_CHANGED_ID=K(),e.ON_EMAIL_CHANGED_ID=K(),e.ON_BLOCK_CHANGED_ID=K(),e.ON_CHUNKS_LOADED=K(),e.ON_SEND_TESTEMAIL_ID=K(),e.ON_SEND_LIVEPREVIEW_ID=K(),e.ON_SHARE_ID=K(),e.ON_SHOW_PREVIEW_ID=K(),e.ON_EMAIL_CLONE_ID=K(),e.ON_SEND_EMAIL_MODAL_ID=K(),e.ON_NOTIFICATION=K(),e.READ_LOCALE=K(),e.ON_TRANSLATE_ID=K(),e.ON_CODE_VALIDATE_ID=K(),e.UPLOAD_EVENT_ID=K(),e.PROXY_URL_EVENT_ID=K(),e.FILE_PROXY_EVENT_ID=K(),e.ON_LIMIT_ID=K(),e.ON_BROWSER_EXTENSION_DETECTED_ID=K()})(pe||={}),K(`APP_LOAD_EVENT`),K(`CONFIG_CHANGED_EVENT`);function q(e){for(;e.endsWith(`/`);)e=e.slice(0,e.length-1);return/\/wp-json$/i.test(e)?e:`${e}/wp-json`}q(`https://app.useblocks.io/api`);var me;(function(e){let t=`https://racs.rest/v3`;function n(e,n){let r={method:`POST`,headers:{"Content-Type":`application/json`,Accept:`application/json`},body:JSON.stringify(n)};return fetch(`${t}?resource=${e}&dataset=${document.location.hostname}`,r)}e.post=n;async function r(e,n=0){let r={method:`POST`,headers:{"Content-Type":`application/json`,Accept:`application/json`},body:`{"filter":{},"limit":${n}}`};return await(await fetch(`${t}/get?resource=${e}&dataset=${document.location.hostname}`,r)).json()}e.getAll=r})(me||={});var J=new Map,Y=new WeakMap;function X(e){return q(String(e||``).trim()||`https://app.useblocks.io/api`)}async function he(e){if(!e.getAuthToken)return;let t=await e.getAuthToken(e.user,e.project,void 0);return t?`Bearer ${t}`:void 0}function ge(e){return async({baseUrl:t})=>{let n=X(t);if(!n)throw Error(`[Loader] appInit warmup requires baseUrl or REACT_APP_OPENAPI_BASE_URL`);let r=new Headers({Accept:`application/json`,"Content-Type":`application/x-www-form-urlencoded;charset=UTF-8`}),i=await he(e);i&&r.set(`authorization`,i);let a=await fetch(`${n}/app/v1/app_init`,{method:`POST`,headers:r,body:new URLSearchParams,credentials:`same-origin`});if(!a.ok)throw Error(`[Loader] appInit request failed: ${a.status} ${a.statusText}`);return a.json()}}function _e(e){return JSON.stringify({baseUrl:X(e.baseUrl)||``,project:e.project??``,userId:e.user?.id??``})}function ve(e){return async t=>{let n=_e(t),r=J.get(n);if(r)return r;let i=Promise.resolve(e(t)).catch(e=>{throw J.delete(n),e});return J.set(n,i),i}}function ye(e){if(e.standaloneKey)return e;let t=e.appInit||ge(e),n=Y.get(t);return n||(n=ve(t),Y.set(t,n)),Promise.resolve(n({baseUrl:e.baseUrl,user:e.user,project:e.project,prevApp:void 0})).catch(e=>{}),{...e,appInit:n}}var Z=new WeakMap;function be(e){let t=null;return async(n,r,i)=>(t||=Promise.resolve(e(n,r,i)).finally(()=>{t=null}),t)}function xe(e){if(e.standaloneKey)return e;let t=e.getAuthToken;if(!t)return e;let n=Z.get(t);return n||(n=be(t),Z.set(t,n)),Promise.resolve(n(e.user,e.project,void 0)).catch(e=>{}),{...e,getAuthToken:n}}var Q=a({FileManagerApiError:()=>y}),Se=a({mapHttpStatusToErrorCode:()=>b});function Ce(e,t){return{...e,element:t}}function $(){return()=>{}}function we(e){let t=e.element;return!t||typeof t==`string`||typeof document>`u`?$():(z(t,e.config?.styles,t),()=>{B(t)})}function Te(e){if(!U()||e.initialSpinner===!1||typeof document>`u`)return{options:e,cleanup:$()};let t=e.element;if(!t||typeof t==`string`)return{options:e,cleanup:$()};t.querySelectorAll(`.blocks-app-initial-spinner-wrapper`).forEach(e=>{e.remove()});let n=de(t,`data-useblocks`),r=e.handleChunkLoaded;return{options:{...e,handleChunkLoaded:()=>{n(),r?.()}},cleanup:n}}function Ee(e){return e?.length?e.some(e=>Array.isArray(e)?!1:!!(e&&typeof e==`object`&&`url`in e)):!1}var De=`1.1.11`;async function Oe(e){await D(typeof __useblocks__<`u`?__useblocks__:void 0)}async function ke(e){let t=new o,n=await V(e.element,t);t.dispose();let r=ye(xe(Ce(e,n)));if(n){let e=H.get(n);if(e)try{let t=await e;if(t.getElement()===n)return t.reset(r)}catch{H.get(n)===e&&H.delete(n)}}let i=we(r),a=Te(r),s=a.options;await T();let c=typeof __useblocks__<`u`?__useblocks__:void 0;Ee(s.plugins)?await E(c):A(c);let l=S().then(e=>e.init(s));n&&H.set(n,l);try{let e=await l;return n&&H.set(n,e),e}catch(e){throw i(),a.cleanup(),n&&H.get(n)===l&&H.delete(n),e}}async function Ae(e){return(await S()).parseAMP(e)}typeof window<`u`&&j(typeof __useblocks__<`u`?__useblocks__:void 0),Object.defineProperty(t,"errors",{enumerable:!0,get:function(){return Q}}),Object.defineProperty(t,"helpers",{enumerable:!0,get:function(){return Se}}),t.init=ke,t.parseAMP=Ae,t.pluginRegistry=P,t.preload=Oe,t.version=De});
|
|
744
744
|
|
|
745
745
|
// Возвращаем API из entry модуля
|
|
746
746
|
return __useblocks__.syncRequire("useblocks.js");
|