This repository has been archived by the owner on Sep 17, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 16
/
embedded-block.web_components.js
2 lines (2 loc) · 5.4 KB
/
embedded-block.web_components.js
1
2
var app=function(){"use strict";function t(){}function e(t){return t()}function n(){return Object.create(null)}function o(t){t.forEach(e)}function r(t){return"function"==typeof t}function s(t,e){return t!=t?e==e:t!==e||t&&"object"==typeof t||"function"==typeof t}function i(t,e){t.appendChild(e)}function c(t,e,n){t.insertBefore(e,n||null)}function l(t){t.parentNode.removeChild(t)}function a(t){return document.createElement(t)}function d(t){return document.createElementNS("http://www.w3.org/2000/svg",t)}function u(){return t=" ",document.createTextNode(t);var t}function f(t,e,n){null==n?t.removeAttribute(e):t.getAttribute(e)!==n&&t.setAttribute(e,n)}function h(t,e,n,o){t.style.setProperty(e,n,o?"important":"")}function p(t){const e={};for(const n of t)e[n.name]=n.value;return e}let b;function $(t){b=t}const m=[],g=[],x=[],_=[],y=Promise.resolve();let v=!1;function k(t){x.push(t)}let w=!1;const E=new Set;function M(){if(!w){w=!0;do{for(let t=0;t<m.length;t+=1){const e=m[t];$(e),C(e.$$)}for($(null),m.length=0;g.length;)g.pop()();for(let t=0;t<x.length;t+=1){const e=x[t];E.has(e)||(E.add(e),e())}x.length=0}while(m.length);for(;_.length;)_.pop()();v=!1,w=!1,E.clear()}}function C(t){if(null!==t.fragment){t.update(),o(t.before_update);const e=t.dirty;t.dirty=[-1],t.fragment&&t.fragment.p(t.ctx,e),t.after_update.forEach(k)}}const q=new Set;function A(t,e){-1===t.$$.dirty[0]&&(m.push(t),v||(v=!0,y.then(M)),t.$$.dirty.fill(0)),t.$$.dirty[e/31|0]|=1<<e%31}function T(s,i,c,a,d,u,f,h=[-1]){const p=b;$(s);const m=s.$$={fragment:null,ctx:null,props:u,update:t,not_equal:d,bound:n(),on_mount:[],on_destroy:[],on_disconnect:[],before_update:[],after_update:[],context:new Map(p?p.$$.context:i.context||[]),callbacks:n(),dirty:h,skip_bound:!1,root:i.target||p.$$.root};f&&f(m.root);let g=!1;if(m.ctx=c?c(s,i.props||{},((t,e,...n)=>{const o=n.length?n[0]:e;return m.ctx&&d(m.ctx[t],m.ctx[t]=o)&&(!m.skip_bound&&m.bound[t]&&m.bound[t](o),g&&A(s,t)),e})):[],m.update(),g=!0,o(m.before_update),m.fragment=!!a&&a(m.ctx),i.target){if(i.hydrate){const t=function(t){return Array.from(t.childNodes)}(i.target);m.fragment&&m.fragment.l(t),t.forEach(l)}else m.fragment&&m.fragment.c();i.intro&&((x=s.$$.fragment)&&x.i&&(q.delete(x),x.i(_))),function(t,n,s,i){const{fragment:c,on_mount:l,on_destroy:a,after_update:d}=t.$$;c&&c.m(n,s),i||k((()=>{const n=l.map(e).filter(r);a?a.push(...n):o(n),t.$$.on_mount=[]})),d.forEach(k)}(s,i.target,i.anchor,i.customElement),M()}var x,_;$(p)}let z;function H(e){let n,o,r,s,p,b,$,m;return{c(){n=a("article"),o=a("header"),r=a("a"),s=d("svg"),p=d("path"),$=u(),m=a("div"),m.innerHTML="<slot></slot>",this.c=t,f(p,"d","M24.038 7.962q3.305 0 5.634 2.366t2.329 5.671-2.329 5.671-5.634 2.366h-6.46v-3.080h6.46q2.028 0 3.493-1.465t1.465-3.493-1.465-3.493-3.493-1.465h-6.46v-3.080h6.46zM9.615 17.577v-3.155h12.77v3.155h-12.77zM3.005 16q0 2.028 1.465 3.493t3.493 1.465h6.46v3.080h-6.46q-3.305 0-5.634-2.366t-2.329-5.671 2.329-5.671 5.634-2.366h6.46v3.080h-6.46q-2.028 0-3.493 1.465t-1.465 3.493z"),f(s,"viewBox","0 0 32 32"),h(s,"height","26px"),h(s,"width","18px"),h(s,"fill","#fff"),f(r,"href",e[0]),f(r,"title",b="打开 ["+e[1]+"]("+e[0]+")"),h(r,"display","flex"),h(r,"align-items","center"),f(o,"class","embedded_block-header"),f(m,"class","embedded_block-content"),f(n,"class","embedded_block")},m(t,e){c(t,n,e),i(n,o),i(o,r),i(r,s),i(s,p),i(n,$),i(n,m)},p(t,[e]){1&e&&f(r,"href",t[0]),3&e&&b!==(b="打开 ["+t[1]+"]("+t[0]+")")&&f(r,"title",b)},i:t,o:t,d(t){t&&l(n)}}}function L(t,e,n){let{src:o}=e,{title:r}=e;return t.$$set=t=>{"src"in t&&n(0,o=t.src),"title"in t&&n(1,r=t.title)},[o,r]}"function"==typeof HTMLElement&&(z=class extends HTMLElement{constructor(){super(),this.attachShadow({mode:"open"})}connectedCallback(){const{on_mount:t}=this.$$;this.$$.on_disconnect=t.map(e).filter(r);for(const t in this.$$.slotted)this.appendChild(this.$$.slotted[t])}attributeChangedCallback(t,e,n){this[t]=n}disconnectedCallback(){o(this.$$.on_disconnect)}$destroy(){!function(t,e){const n=t.$$;null!==n.fragment&&(o(n.on_destroy),n.fragment&&n.fragment.d(e),n.on_destroy=n.fragment=null,n.ctx=[])}(this,1),this.$destroy=t}$on(t,e){const n=this.$$.callbacks[t]||(this.$$.callbacks[t]=[]);return n.push(e),()=>{const t=n.indexOf(e);-1!==t&&n.splice(t,1)}}$set(t){var e;this.$$set&&(e=t,0!==Object.keys(e).length)&&(this.$$.skip_bound=!0,this.$$set(t),this.$$.skip_bound=!1)}});class N extends z{constructor(t){super(),this.shadowRoot.innerHTML="<style>.embedded_block{display:block;border:1px solid var(--b3-border-color);border-radius:4px;margin-bottom:8px;box-sizing:border-box;white-space:initial;position:relative}.embedded_block-header{position:absolute;right:6px;top:6px;height:22px;padding:2px 4px;background-color:var(--b3-theme-on-surface);transition:var(--b3-transition);border-radius:4px;display:none}.embedded_block:hover .embedded_block-header{display:flex}.embedded_block-content{padding:8px 16px;background-color:var(--b3-theme-surface);border-left:1px dashed var(--b3-border-color)}</style>",T(this,{target:this.shadowRoot,props:p(this.attributes),customElement:!0},L,H,s,{src:0,title:1},null),t&&(t.target&&c(t.target,this,t.anchor),t.props&&(this.$set(t.props),M()))}static get observedAttributes(){return["src","title"]}get src(){return this.$$.ctx[0]}set src(t){this.$$set({src:t}),M()}get title(){return this.$$.ctx[1]}set title(t){this.$$set({title:t}),M()}}return customElements.define("oceanpress-embedded-block",N),N}();
//# sourceMappingURL=embedded-block.web_components.js.map