next-box 1.1.3 → 1.1.4
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/index.js +1 -1
- package/interfaces.d.ts +2 -2
- package/package.json +1 -1
package/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
!function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e():"function"==typeof define&&define.amd?define([],e):"object"==typeof exports?exports.PolymaticaApi=e():t.PolymaticaApi=e()}(globalThis,(()=>(()=>{"use strict";var t={752:function(t,e,n){var o,i=this&&this.__extends||(o=function(t,e){return o=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},o(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}o(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)});Object.defineProperty(e,"__esModule",{value:!0}),e.NextBox=void 0;var r=n(139),s=n(382),a=n(679),c=function(t){function e(){var e=t.call(this)||this;return e.debug=!1,e}return i(e,t),e.prototype.on=function(e,n){return t.prototype.on.call(this,e,n)},e.prototype.off=function(e,n){return t.prototype.off.call(this,e,n)},Object.defineProperty(e.prototype,"fileUrl",{get:function(){var t;return(null===(t=this.state)||void 0===t?void 0:t.file_download_uri)||""},enumerable:!1,configurable:!0}),e.prototype.init=function(){this.subscribeEvent(),(0,s.sendEvent)(a.AppEvents.Init)},e.prototype.readMeta=function(){return this.state?fetch("".concat(this.state.root,".").concat(this.state.extenstion.name),{method:"GET"}).then((function(t){return t.json()})).catch((function(){return{}})):new Promise((function(){return{}}))},e.prototype.saveMeta=function(t){return this.state?fetch("".concat(this.state.root,".").concat(this.state.extenstion.name),{method:"POST",body:JSON.stringify(t)}):new Promise((function(){return{}}))},e.prototype.changeContent=function(t){(0,s.sendEvent)(a.AppEvents.ChangeContent,t)},e.prototype.close=function(t){(0,s.sendEvent)(a.AppEvents.Close,t)},e.prototype.download=function(){return this.fileDownload()},e.prototype.fileDownload=function(){return this.state?fetch(this.state.file_download_uri,{method:this.state.file_download_method}):new Promise((function(t){return{text:function(){return""}}}))},e.prototype.replace=function(t){return this.fileReplace(t)},e.prototype.fileReplace=function(t){return this.state?fetch(this.state.file_replace_uri,{method:this.state.file_replace_method,body:t}):new Promise((function(t){t(null)}))},e.prototype.subscribeEvent=function(){var t=this;window.addEventListener("message",(function(e){var n=e.data.event,o=e.data.payload;switch(t.debug&&console.log("frame.message",e.data),n){case a.ExtensionEvents.Ready:t.debug=o.debug,t.emit(a.ExtensionEvents.Ready);break;case a.ExtensionEvents.ChangeView:t.state&&(t.state.view=o)}}))},e}(r.EventEmitter);e.NextBox=c},139:(t,e)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.EventEmitter=void 0;var n=function(){function t(){this._handlers=new Map}return t.prototype.on=function(t,e){var n;this._handlers.has(t)||this._handlers.set(t,new Set),null===(n=this._handlers.get(t))||void 0===n||n.add(e)},t.prototype.off=function(t,e){var n;null===(n=this._handlers.get(t))||void 0===n||n.delete(e)},t.prototype.emit=function(t){for(var e=[],n=1;n<arguments.length;n++)e[n-1]=arguments[n];this._handlers.get(t)},t}();e.EventEmitter=n},382:(t,e)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.sendEvent=void 0,e.sendEvent=function(t,e){parent!==window&&parent.postMessage({event:t,payload:e},window.location.origin)}},607:function(t,e,n){var o=this&&this.__createBinding||(Object.create?function(t,e,n,o){void 0===o&&(o=n);var i=Object.getOwnPropertyDescriptor(e,n);i&&!("get"in i?!e.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return e[n]}}),Object.defineProperty(t,o,i)}:function(t,e,n,o){void 0===o&&(o=n),t[o]=e[n]}),i=this&&this.__exportStar||function(t,e){for(var n in t)"default"===n||Object.prototype.hasOwnProperty.call(e,n)||o(e,t,n)};Object.defineProperty(e,"__esModule",{value:!0}),i(n(679),e),i(n(178),e),i(n(139),e),i(n(382),e),i(n(752),e)},178:(t,e,n)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.initFileApi=e.init=void 0;var o=n(752),i=n(679);function r(){var t=new o.NextBox;return t.init(),t}e.init=r,e.initFileApi=function(){return new Promise((function(t){var e=r();e.on(i.ExtensionEvents.Ready,(function(){t(e)}))}))}},679:(t,e)=>{var n,o,i,r;Object.defineProperty(e,"__esModule",{value:!0}),e.ViewState=e.ExtensionEvents=e.AppEvents=e.
|
|
1
|
+
!function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e():"function"==typeof define&&define.amd?define([],e):"object"==typeof exports?exports.PolymaticaApi=e():t.PolymaticaApi=e()}(globalThis,(()=>(()=>{"use strict";var t={752:function(t,e,n){var o,i=this&&this.__extends||(o=function(t,e){return o=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},o(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}o(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)});Object.defineProperty(e,"__esModule",{value:!0}),e.NextBox=void 0;var r=n(139),s=n(382),a=n(679),c=function(t){function e(){var e=t.call(this)||this;return e.debug=!1,e}return i(e,t),e.prototype.on=function(e,n){return t.prototype.on.call(this,e,n)},e.prototype.off=function(e,n){return t.prototype.off.call(this,e,n)},Object.defineProperty(e.prototype,"fileUrl",{get:function(){var t;return(null===(t=this.state)||void 0===t?void 0:t.file_download_uri)||""},enumerable:!1,configurable:!0}),e.prototype.init=function(){this.subscribeEvent(),(0,s.sendEvent)(a.AppEvents.Init)},e.prototype.readMeta=function(){return this.state?fetch("".concat(this.state.root,".").concat(this.state.extenstion.name),{method:"GET"}).then((function(t){return t.json()})).catch((function(){return{}})):new Promise((function(){return{}}))},e.prototype.saveMeta=function(t){return this.state?fetch("".concat(this.state.root,".").concat(this.state.extenstion.name),{method:"POST",body:JSON.stringify(t)}):new Promise((function(){return{}}))},e.prototype.changeContent=function(t){(0,s.sendEvent)(a.AppEvents.ChangeContent,t)},e.prototype.close=function(t){(0,s.sendEvent)(a.AppEvents.Close,t)},e.prototype.download=function(){return this.fileDownload()},e.prototype.fileDownload=function(){return this.state?fetch(this.state.file_download_uri,{method:this.state.file_download_method}):new Promise((function(t){return{text:function(){return""}}}))},e.prototype.replace=function(t){return this.fileReplace(t)},e.prototype.fileReplace=function(t){return this.state?fetch(this.state.file_replace_uri,{method:this.state.file_replace_method,body:t}):new Promise((function(t){t(null)}))},e.prototype.subscribeEvent=function(){var t=this;window.addEventListener("message",(function(e){var n=e.data.event,o=e.data.payload;switch(t.debug&&console.log("frame.message",e.data),n){case a.ExtensionEvents.Ready:t.debug=o.debug,t.emit(a.ExtensionEvents.Ready);break;case a.ExtensionEvents.ChangeView:t.state&&(t.state.view=o)}}))},e}(r.EventEmitter);e.NextBox=c},139:(t,e)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.EventEmitter=void 0;var n=function(){function t(){this._handlers=new Map}return t.prototype.on=function(t,e){var n;this._handlers.has(t)||this._handlers.set(t,new Set),null===(n=this._handlers.get(t))||void 0===n||n.add(e)},t.prototype.off=function(t,e){var n;null===(n=this._handlers.get(t))||void 0===n||n.delete(e)},t.prototype.emit=function(t){for(var e=[],n=1;n<arguments.length;n++)e[n-1]=arguments[n];this._handlers.get(t)},t}();e.EventEmitter=n},382:(t,e)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.sendEvent=void 0,e.sendEvent=function(t,e){parent!==window&&parent.postMessage({event:t,payload:e},window.location.origin)}},607:function(t,e,n){var o=this&&this.__createBinding||(Object.create?function(t,e,n,o){void 0===o&&(o=n);var i=Object.getOwnPropertyDescriptor(e,n);i&&!("get"in i?!e.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return e[n]}}),Object.defineProperty(t,o,i)}:function(t,e,n,o){void 0===o&&(o=n),t[o]=e[n]}),i=this&&this.__exportStar||function(t,e){for(var n in t)"default"===n||Object.prototype.hasOwnProperty.call(e,n)||o(e,t,n)};Object.defineProperty(e,"__esModule",{value:!0}),i(n(679),e),i(n(178),e),i(n(139),e),i(n(382),e),i(n(752),e)},178:(t,e,n)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.initFileApi=e.init=void 0;var o=n(752),i=n(679);function r(){var t=new o.NextBox;return t.init(),t}e.init=r,e.initFileApi=function(){return new Promise((function(t){var e=r();e.on(i.ExtensionEvents.Ready,(function(){t(e)}))}))}},679:(t,e)=>{var n,o,i,r;Object.defineProperty(e,"__esModule",{value:!0}),e.ViewState=e.ExtensionEvents=e.AppEvents=e.ExtentionsType=void 0,(r=e.ExtentionsType||(e.ExtentionsType={})).App="app",r.File="file",(i=e.AppEvents||(e.AppEvents={})).Init="init",i.ChangeContent="change-content",i.Close="close",(o=e.ExtensionEvents||(e.ExtensionEvents={})).Ready="ready",o.ChangeView="change-view",o.SaveAndClose="save-and-close",(n=e.ViewState||(e.ViewState={})).view="view",n.edit="edit"}},e={};return function n(o){var i=e[o];if(void 0!==i)return i.exports;var r=e[o]={exports:{}};return t[o].call(r.exports,r,r.exports,n),r.exports}(607)})()));
|
package/interfaces.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export declare enum
|
|
1
|
+
export declare enum ExtentionsType {
|
|
2
2
|
App = "app",
|
|
3
3
|
File = "file"
|
|
4
4
|
}
|
|
@@ -29,7 +29,7 @@ export interface AppState {
|
|
|
29
29
|
extenstion: {
|
|
30
30
|
id: number;
|
|
31
31
|
name: string;
|
|
32
|
-
type:
|
|
32
|
+
type: ExtentionsType;
|
|
33
33
|
};
|
|
34
34
|
root: string;
|
|
35
35
|
debug: boolean;
|