@tinymce/tinymce-svelte
Version:
TinyMCE Svelte Component
2 lines (1 loc) • 5.33 kB
JavaScript
var Editor=function(){"use strict";function t(){}function n(t){return t()}function e(){return Object.create(null)}function o(t){t.forEach(n)}function r(t){return"function"==typeof t}function i(t,n){return t!=t?n==n:t!==n||t&&"object"==typeof t||"function"==typeof t}function c(t,n,e){t.insertBefore(n,e||null)}function l(t){t.parentNode&&t.parentNode.removeChild(t)}function s(t){return document.createElement(t)}function u(t,n,e){null==e?t.removeAttribute(n):t.getAttribute(n)!==e&&t.setAttribute(n,e)}let a;function d(t){a=t}function f(){if(!a)throw new Error("Function called outside component initialization");return a}function p(){const t=f();return(n,e,{cancelable:o=!1}={})=>{const r=t.$$.callbacks[n];if(r){const i=function(t,n,{bubbles:e=!1,cancelable:o=!1}={}){return new CustomEvent(t,{detail:n,bubbles:e,cancelable:o})}(n,e,{cancelable:o});return r.slice().forEach((n=>{n.call(t,i)})),!i.defaultPrevented}return!0}}const $=[],h=[];let y=[];const m=[],b=Promise.resolve();let g=!1;function v(t){y.push(t)}const _=new Set;let x=0;function w(){if(0!==x)return;const t=a;do{try{for(;x<$.length;){const t=$[x];x++,d(t),E(t.$$)}}catch(t){throw $.length=0,x=0,t}for(d(null),$.length=0,x=0;h.length;)h.pop()();for(let t=0;t<y.length;t+=1){const n=y[t];_.has(n)||(_.add(n),n())}y.length=0}while($.length);for(;m.length;)m.pop()();g=!1,_.clear(),d(t)}function E(t){if(null!==t.fragment){t.update(),o(t.before_update);const n=t.dirty;t.dirty=[-1],t.fragment&&t.fragment.p(t.ctx,n),t.after_update.forEach(v)}}const k=new Set;function K(t,n){const e=t.$$;null!==e.fragment&&(!function(t){const n=[],e=[];y.forEach((o=>-1===t.indexOf(o)?n.push(o):e.push(o))),e.forEach((t=>t())),y=n}(e.after_update),o(e.on_destroy),e.fragment&&e.fragment.d(n),e.on_destroy=e.fragment=null,e.ctx=[])}function S(t,n){-1===t.$$.dirty[0]&&($.push(t),g||(g=!0,b.then(w)),t.$$.dirty.fill(0)),t.$$.dirty[n/31|0]|=1<<n%31}function C(i,c,s,u,f,p,$=null,h=[-1]){const y=a;d(i);const m=i.$$={fragment:null,ctx:[],props:p,update:t,not_equal:f,bound:e(),on_mount:[],on_destroy:[],on_disconnect:[],before_update:[],after_update:[],context:new Map(c.context||(y?y.$$.context:[])),callbacks:e(),dirty:h,skip_bound:!1,root:c.target||y.$$.root};$&&$(m.root);let b=!1;if(m.ctx=s?s(i,c.props||{},((t,n,...e)=>{const o=e.length?e[0]:n;return m.ctx&&f(m.ctx[t],m.ctx[t]=o)&&(!m.skip_bound&&m.bound[t]&&m.bound[t](o),b&&S(i,t)),n})):[],m.update(),b=!0,o(m.before_update),m.fragment=!!u&&u(m.ctx),c.target){if(c.hydrate){const t=function(t){return Array.from(t.childNodes)}(c.target);m.fragment&&m.fragment.l(t),t.forEach(l)}else m.fragment&&m.fragment.c();c.intro&&((g=i.$$.fragment)&&g.i&&(k.delete(g),g.i(_))),function(t,e,i){const{fragment:c,after_update:l}=t.$$;c&&c.m(e,i),v((()=>{const e=t.$$.on_mount.map(n).filter(r);t.$$.on_destroy?t.$$.on_destroy.push(...e):o(e),t.$$.on_mount=[]})),l.forEach(v)}(i,c.target,c.anchor),w()}var g,_;d(y)}class A{$$=void 0;$$set=void 0;$destroy(){K(this,1),this.$destroy=t}$on(n,e){if(!r(e))return t;const o=this.$$.callbacks[n]||(this.$$.callbacks[n]=[]);return o.push(e),()=>{const t=o.indexOf(e);-1!==t&&o.splice(t,1)}}$set(t){var n;this.$$set&&(n=t,0!==Object.keys(n).length)&&(this.$$.skip_bound=!0,this.$$set(t),this.$$.skip_bound=!1)}}function O(t){let n;return{c(){var e,o,r,i;n=s("textarea"),u(n,"id",t[0]),e=n,o="visibility",null==(r="hidden")?e.style.removeProperty(o):e.style.setProperty(o,r,i?"important":"")},m(e,o){c(e,n,o),t[20](n)},p(t,e){1&e&&u(n,"id",t[0])},d(e){e&&l(n),t[20](null)}}}function P(t){let n;return{c(){n=s("div"),u(n,"id",t[0])},m(e,o){c(e,n,o),t[19](n)},p(t,e){1&e&&u(n,"id",t[0])},d(e){e&&l(n),t[19](null)}}}function j(n){let e;function o(t,n){return t[1]?P:O}let r=o(n),i=r(n);return{c(){e=s("div"),i.c(),u(e,"class",n[2])},m(t,o){c(t,e,o),i.m(e,null),n[21](e)},p(t,[n]){r===(r=o(t))&&i?i.p(t,n):(i.d(1),i=r(t),i&&(i.c(),i.m(e,null))),4&n&&u(e,"class",t[2])},i:t,o:t,d(t){t&&l(e),i.d(),n[21](null)}}}"undefined"!=typeof window&&(window.__svelte||(window.__svelte={v:new Set})).v.add("4");const M=t=>t+"_"+Math.floor(1e9*Math.random())+String(Date.now());function N(t,n,e){let o,r,{id:i=M("tinymce-svelte")}=n,{inline:c}=n,{disabled:l=!1}=n,{readonly:s=!1}=n,{apiKey:u="no-api-key"}=n,{licenseKey:a}=n,{channel:d="8"}=n,{scriptSrc:$}=n,{conf:y={}}=n,{modelEvents:m="change input undo redo"}=n,{value:b=""}=n,{text:g=""}=n,{cssClass:v="tinymce-wrapper"}=n,_=b,x=l,w=s;var E;return p(),E=()=>{},f().$$.on_destroy.push(E),t.$$set=t=>{"id"in t&&e(0,i=t.id),"inline"in t&&e(1,c=t.inline),"disabled"in t&&e(7,l=t.disabled),"readonly"in t&&e(8,s=t.readonly),"apiKey"in t&&e(9,u=t.apiKey),"licenseKey"in t&&e(10,a=t.licenseKey),"channel"in t&&e(11,d=t.channel),"scriptSrc"in t&&e(12,$=t.scriptSrc),"conf"in t&&e(13,y=t.conf),"modelEvents"in t&&e(14,m=t.modelEvents),"value"in t&&e(5,b=t.value),"text"in t&&e(6,g=t.text),"cssClass"in t&&e(2,v=t.cssClass)},t.$$.update=()=>{t.$$.dirty},[i,c,v,o,r,b,g,l,s,u,a,d,$,y,m,undefined,_,x,w,function(t){h[t?"unshift":"push"]((()=>{r=t,e(4,r)}))},function(t){h[t?"unshift":"push"]((()=>{r=t,e(4,r)}))},function(t){h[t?"unshift":"push"]((()=>{o=t,e(3,o)}))}]}return class extends A{constructor(t){super(),C(this,t,N,j,i,{id:0,inline:1,disabled:7,readonly:8,apiKey:9,licenseKey:10,channel:11,scriptSrc:12,conf:13,modelEvents:14,value:5,text:6,cssClass:2})}}}();