@plaidev/karte-action-sdk 1.0.15 → 1.0.18
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/dist/index.cjs.js +1 -1
- package/dist/index.d.ts +11 -3
- package/dist/index.es.js +73 -48
- package/package.json +3 -1
- package/src/BreakPoint.svelte +1 -0
- package/src/DevicePC.svelte +7 -0
- package/src/DeviceSmartphone.svelte +7 -0
- package/src/DeviceTablet.svelte +7 -0
- package/src/GridItem.svelte +32 -0
- package/src/GridModalState.svelte +122 -0
- package/src/State.svelte +6 -0
- package/src/components/Animation.svelte +110 -0
- package/src/components/BackgroundOverray.svelte +25 -0
- package/src/components/BreakPointItem.svelte +44 -0
- package/src/components/Flex.svelte +43 -0
- package/src/components/FlexItem.svelte +45 -0
- package/src/components/Grid.svelte +45 -0
- package/src/components/Modal.svelte +132 -0
- package/src/components/Normalize.svelte +3 -0
- package/src/components/StateItem.svelte +12 -0
- package/src/components/__test__/Grid.test.ts +12 -0
- package/src/components/__test__/__snapshots__/Grid.test.ts.snap +3 -0
- package/src/functions.ts +76 -0
- package/src/index.ts +11 -0
- package/src/prop.ts +57 -0
- package/src/utils.ts +132 -0
- package/src/vite-env.d.ts +29 -0
package/dist/index.cjs.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});var C=require("svelte/store"),t=require("svelte/internal"),y=require("svelte");const F=n=>e=>{if(n){const i=n.querySelectorAll("*"),s=Array.from(i).filter(o=>o.tabIndex>=0);let l=s.indexOf(document.activeElement);l===-1&&e.shiftKey&&(l=0),l+=s.length+(e.shiftKey?-1:1),l%=s.length,s[l].focus(),e.preventDefault()}},M=()=>{const n=typeof document!="undefined"&&document.activeElement;n&&(n==null||n.focus())},P=n=>e=>{n[e.key]&&n[e.key](e)},V=n=>n==="center"?"top: 50%; left: 50%; transform: translate(-50%, -50%);":n==="top"?"top: 0; right: 50%; transform: translate(+50%, 0%);":n==="left"?"top: 50%; left: 0; transform: translate(0%, -50%);":n==="bottom"?"bottom: 0; right: 50%; transform: translate(+50%, 0%);":n==="right"?"top: 50%; right: 0; transform: translate(0%, -50%);":n==="none"?"top: 0; bottom: 0; right: 0; left: 0;":["top","bottom","left","right"].reduce((e,i)=>{const s=n.indexOf(i)>-1?"0":"auto";return e+` ${i}: ${s};`},"");function Z(n,e){const i=document.querySelector("body"),s={root:null,threshold:1-e,rootMargin:"-100% 0px 100% 0px"},l=new IntersectionObserver(o=>{for(const a of o)a.isIntersecting||n()||l.unobserve(i)},s);return l.observe(i),()=>l&&l.unobserve(i)}function W(n,e){const i=setTimeout(n,e);return()=>i&&clearTimeout(i)}function D(n,e){return new RegExp(`/[0-9]${e}$/`).test(n)}function X(n,e=!1){return e?n.replace(/\r?\n/g,"<br>"):n}function K(n=8){return Math.random().toString(32).substring(n)}const q={ALL_ACTION_ID:"KARTE_ALL_ACTION_ID",STATE_EVENT:"KARTE-ACTION-CHANGE-STATE"},N=C.writable({}),G=K(),O=C.writable("/"),j=C.writable(!1),v=(n,e)=>{var s;const i=C.get(N);(s=i==null?void 0:i.send)==null||s.call(i,n,e)},R=n=>{(n.detail.action_id===G||n.detail.action_id===q.ALL_ACTION_ID)&&O.set(n.detail.to)},Y=n=>{window.addEventListener(q.STATE_EVENT,R),j.set(!1),N.set(n!=null?n:{})},p=()=>{window.removeEventListener(q.STATE_EVENT,R)},L=()=>{const n=C.get(N);return n==null?void 0:n.isPreview},x=()=>()=>{},$=n=>()=>{v("_message_state_changed",{state:n}),window.dispatchEvent(new CustomEvent(q.STATE_EVENT,{detail:{to:n,action_id:G}}))},ee=(n,e=!0)=>()=>{v("message_click",{url:n}),e?window.open(n):location.href=n},te=()=>()=>{v("message_close",null),j.set(!0)},ne=["BooleanKeyword","NumberKeyword","StringKeyword","Function","Enum","Code","Direction","Url","Image","AnimationStyle","LongText","Length","Color","Alignment","Style"],ie={PC:"(\\s*min-width\\s*:\\s*1025px\\s*)",Tablet:"(\\s*min-width\\s*:\\s*897px)\\s+and\\s+(\\s*max-width\\s*:\\s*1024px\\s*)",Mobile:"(\\s*max-width\\s*:\\s*896px\\s*)"},le=["row","column"],se=["none","fade","bounce","slide-down","slide-up","slide-left","slide-right"],oe=["px","em","rem","vw","fr","%"],ae=["center","flex-start","flex-end"],re=["fill","contain","cover"],ce=["repeat","space","round","no-repeat"];function fe(n){t.append_styles(n,"svelte-zmz1k7","@import 'https://cdn.skypack.dev/normalize.css';")}class ue extends t.SvelteComponent{constructor(e){super(),t.init(this,e,null,null,t.safe_not_equal,{},fe)}}function _e(n){let e,i,s;e=new ue({});const l=n[1].default,o=t.create_slot(l,n,n[0],null);return{c(){t.create_component(e.$$.fragment),i=t.space(),o&&o.c()},m(a,r){t.mount_component(e,a,r),t.insert(a,i,r),o&&o.m(a,r),s=!0},p(a,[r]){o&&o.p&&(!s||r&1)&&t.update_slot_base(o,l,a,a[0],s?t.get_slot_changes(l,a[0],r,null):t.get_all_dirty_from_scope(a[0]),null)},i(a){s||(t.transition_in(e.$$.fragment,a),t.transition_in(o,a),s=!0)},o(a){t.transition_out(e.$$.fragment,a),t.transition_out(o,a),s=!1},d(a){t.destroy_component(e,a),a&&t.detach(i),o&&o.d(a)}}}function de(n,e,i){let{$$slots:s={},$$scope:l}=e;return n.$$set=o=>{"$$scope"in o&&i(0,l=o.$$scope)},[l,s]}class me extends t.SvelteComponent{constructor(e){super(),t.init(this,e,de,_e,t.safe_not_equal,{})}}function I(n){let e;const i=n[3].default,s=t.create_slot(i,n,n[2],null);return{c(){s&&s.c()},m(l,o){s&&s.m(l,o),e=!0},p(l,o){s&&s.p&&(!e||o&4)&&t.update_slot_base(s,i,l,l[2],e?t.get_slot_changes(i,l[2],o,null):t.get_all_dirty_from_scope(l[2]),null)},i(l){e||(t.transition_in(s,l),e=!0)},o(l){t.transition_out(s,l),e=!1},d(l){s&&s.d(l)}}}function ge(n){let e,i,s=n[1]===n[0]&&I(n);return{c(){s&&s.c(),e=t.empty()},m(l,o){s&&s.m(l,o),t.insert(l,e,o),i=!0},p(l,[o]){l[1]===l[0]?s?(s.p(l,o),o&3&&t.transition_in(s,1)):(s=I(l),s.c(),t.transition_in(s,1),s.m(e.parentNode,e)):s&&(t.group_outros(),t.transition_out(s,1,1,()=>{s=null}),t.check_outros())},i(l){i||(t.transition_in(s),i=!0)},o(l){t.transition_out(s),i=!1},d(l){s&&s.d(l),l&&t.detach(e)}}}function he(n,e,i){let s;t.component_subscribe(n,O,r=>i(1,s=r));let{$$slots:l={},$$scope:o}=e,{path:a}=e;return n.$$set=r=>{"path"in r&&i(0,a=r.path),"$$scope"in r&&i(2,o=r.$$scope)},[a,s,o,l]}class be extends t.SvelteComponent{constructor(e){super(),t.init(this,e,he,ge,t.safe_not_equal,{path:0})}}function ye(n){t.append_styles(n,"svelte-1h4b6e3",".background.svelte-1h4b6e3{position:fixed;top:0;left:0;width:100%;height:100%;background:rgba(0, 0, 0, 0.3)}")}function z(n){let e,i,s;return{c(){e=t.element("div"),t.attr(e,"class","background svelte-1h4b6e3")},m(l,o){t.insert(l,e,o),i||(s=t.listen(e,"click",n[2]),i=!0)},p:t.noop,d(l){l&&t.detach(e),i=!1,s()}}}function ve(n){let e,i=n[0]&&z(n);return{c(){i&&i.c(),e=t.empty()},m(s,l){i&&i.m(s,l),t.insert(s,e,l)},p(s,[l]){s[0]?i?i.p(s,l):(i=z(s),i.c(),i.m(e.parentNode,e)):i&&(i.d(1),i=null)},i:t.noop,o:t.noop,d(s){i&&i.d(s),s&&t.detach(e)}}}function we(n,e,i){let{backgroundOverray:s=!1}=e;const l=y.createEventDispatcher(),o=()=>l("click");return n.$$set=a=>{"backgroundOverray"in a&&i(0,s=a.backgroundOverray)},[s,l,o]}class ke extends t.SvelteComponent{constructor(e){super(),t.init(this,e,we,ve,t.safe_not_equal,{backgroundOverray:0},ye)}}function Se(n){t.append_styles(n,"svelte-sa0cac","@keyframes svelte-sa0cac-fade{0%{opacity:0}100%{opacity:1}}.fade.svelte-sa0cac{animation-name:svelte-sa0cac-fade;animation-duration:1s}@keyframes svelte-sa0cac-bounce{0%{opacity:0;transform:scale(0.3)}50%{opacity:1;transform:scale(1.05)}70%{transform:scale(0.9)}100%{transform:scale(1)}}.bounce.svelte-sa0cac{animation-name:svelte-sa0cac-bounce;animation-duration:1s}@keyframes svelte-sa0cac-slide-down{0%{transform:translate3d(0, -100%, 0);visibility:visible}100%{transform:translate3d(0, 0, 0)}}.slide-down.svelte-sa0cac{animation-name:svelte-sa0cac-slide-down;animation-duration:1s;animation-delay:0.1s}@keyframes svelte-sa0cac-slide-up{0%{transform:translate3d(0, 100%, 0);visibility:visible}100%{transform:translate3d(0, 0, 0)}}.slide-up.svelte-sa0cac{animation-name:svelte-sa0cac-slide-up;animation-duration:1s;animation-delay:0.1s}@keyframes svelte-sa0cac-slide-left{0%{transform:translate3d(100%, 0, 0);visibility:visible}100%{transform:translate3d(0, 0, 0)}}.slide-left.svelte-sa0cac{animation-name:svelte-sa0cac-slide-left;animation-duration:1s;animation-delay:0.1s}@keyframes svelte-sa0cac-slide-right{0%{transform:translate3d(-100%, 0, 0);visibility:visible}100%{transform:translate3d(0, 0, 0)}}.slide-right.svelte-sa0cac{animation-name:svelte-sa0cac-slide-right;animation-duration:1s;animation-delay:0.1s}")}function Ce(n){let e,i;const s=n[3].default,l=t.create_slot(s,n,n[2],null);return{c(){e=t.element("div"),l&&l.c(),t.attr(e,"class",t.null_to_empty(n[0])+" svelte-sa0cac")},m(o,a){t.insert(o,e,a),l&&l.m(e,null),i=!0},p(o,[a]){l&&l.p&&(!i||a&4)&&t.update_slot_base(l,s,o,o[2],i?t.get_slot_changes(s,o[2],a,null):t.get_all_dirty_from_scope(o[2]),null)},i(o){i||(t.transition_in(l,o),i=!0)},o(o){t.transition_out(l,o),i=!1},d(o){o&&t.detach(e),l&&l.d(o)}}}function Te(n,e,i){let{$$slots:s={},$$scope:l}=e,{animation:o="none"}=e;const a=L()?"none":o;return n.$$set=r=>{"animation"in r&&i(1,o=r.animation),"$$scope"in r&&i(2,l=r.$$scope)},[a,o,l,s]}class Ee extends t.SvelteComponent{constructor(e){super(),t.init(this,e,Te,Ce,t.safe_not_equal,{animation:1},Se)}}function Ae(n){t.append_styles(n,"svelte-mqsv2j",".modal.svelte-mqsv2j{position:absolute;box-sizing:border-box}.close.svelte-mqsv2j{position:absolute}button.svelte-mqsv2j{display:block;background-color:transparent;border:none;cursor:pointer}")}function B(n){let e,i,s,l,o,a;return{c(){e=t.element("div"),i=t.element("button"),s=t.svg_element("svg"),l=t.svg_element("path"),t.attr(l,"d","M5.78516 4.75L8.73828 1.82422C8.90234 1.66016 8.90234 1.35938 8.73828 1.19531L8.05469 0.511719C7.89062 0.347656 7.58984 0.347656 7.42578 0.511719L4.5 3.46484L1.54688 0.511719C1.38281 0.347656 1.08203 0.347656 0.917969 0.511719L0.234375 1.19531C0.0703125 1.35938 0.0703125 1.66016 0.234375 1.82422L3.1875 4.75L0.234375 7.70312C0.0703125 7.86719 0.0703125 8.16797 0.234375 8.33203L0.917969 9.01562C1.08203 9.17969 1.38281 9.17969 1.54688 9.01562L4.5 6.0625L7.42578 9.01562C7.58984 9.17969 7.89062 9.17969 8.05469 9.01562L8.73828 8.33203C8.90234 8.16797 8.90234 7.86719 8.73828 7.70312L5.78516 4.75Z"),t.attr(l,"fill",n[1]),t.attr(l,"fill-opacity","0.8"),t.attr(s,"width","9"),t.attr(s,"height","10"),t.attr(s,"viewBox","0 0 9 10"),t.attr(s,"fill","none"),t.attr(s,"xmlns","http://www.w3.org/2000/svg"),t.attr(i,"class","svelte-mqsv2j"),t.attr(e,"class","close svelte-mqsv2j"),t.attr(e,"style",n[3])},m(r,_){t.insert(r,e,_),t.append(e,i),t.append(i,s),t.append(s,l),o||(a=t.listen(i,"click",n[7]),o=!0)},p(r,_){_&2&&t.attr(l,"fill",r[1]),_&8&&t.attr(e,"style",r[3])},d(r){r&&t.detach(e),o=!1,a()}}}function Le(n){let e,i,s,l,o,a,r=n[0]&&B(n);const _=n[14].default,c=t.create_slot(_,n,n[13],null);return{c(){e=t.element("div"),r&&r.c(),i=t.space(),c&&c.c(),t.attr(e,"class","modal svelte-mqsv2j"),t.attr(e,"role","dialog"),t.attr(e,"aria-modal","true"),t.attr(e,"style",s="position:"+(n[6]?"fixed":"absolute")+"; "+n[5]+" "+n[2])},m(f,h){t.insert(f,e,h),r&&r.m(e,null),t.append(e,i),c&&c.m(e,null),n[15](e),l=!0,o||(a=t.listen(window,"keydown",n[8]),o=!0)},p(f,[h]){f[0]?r?r.p(f,h):(r=B(f),r.c(),r.m(e,i)):r&&(r.d(1),r=null),c&&c.p&&(!l||h&8192)&&t.update_slot_base(c,_,f,f[13],l?t.get_slot_changes(_,f[13],h,null):t.get_all_dirty_from_scope(f[13]),null),(!l||h&36&&s!==(s="position:"+(f[6]?"fixed":"absolute")+"; "+f[5]+" "+f[2]))&&t.attr(e,"style",s)},i(f){l||(t.transition_in(c,f),l=!0)},o(f){t.transition_out(c,f),l=!1},d(f){f&&t.detach(e),r&&r.d(),c&&c.d(f),n[15](null),o=!1,a()}}}function qe(n,e,i){let s,{$$slots:l={},$$scope:o}=e,{closable:a=!0}=e,{closeButtonColor:r="#000000"}=e,{eventName:_=""}=e,{eventValue:c=null}=e,{position:f="center"}=e;const h=L()?"center":f;let{fixed:d=!1}=e;const g=L()?!1:d;let{_style:w=""}=e,{_closeStyle:k=""}=e;const T=y.createEventDispatcher(),S=()=>{_&&v(_,c),T("close")};let b=null;const E=P({Escape:S,Tab:F(b)});y.onDestroy(()=>M());function A(m){t.binding_callbacks[m?"unshift":"push"](()=>{b=m,i(4,b)})}return n.$$set=m=>{"closable"in m&&i(0,a=m.closable),"closeButtonColor"in m&&i(1,r=m.closeButtonColor),"eventName"in m&&i(9,_=m.eventName),"eventValue"in m&&i(10,c=m.eventValue),"position"in m&&i(11,f=m.position),"fixed"in m&&i(12,d=m.fixed),"_style"in m&&i(2,w=m._style),"_closeStyle"in m&&i(3,k=m._closeStyle),"$$scope"in m&&i(13,o=m.$$scope)},i(5,s=V(h)),[a,r,w,k,b,s,g,S,E,_,c,f,d,o,l,A]}class U extends t.SvelteComponent{constructor(e){super(),t.init(this,e,qe,Le,t.safe_not_equal,{closable:0,closeButtonColor:1,eventName:9,eventValue:10,position:11,fixed:12,_style:2,_closeStyle:3},Ae)}}function Ne(n){let e,i;const s=n[8].default,l=t.create_slot(s,n,n[7],null);return{c(){e=t.element("div"),l&&l.c(),t.attr(e,"class","grid"),t.attr(e,"style",n[0])},m(o,a){t.insert(o,e,a),l&&l.m(e,null),i=!0},p(o,[a]){l&&l.p&&(!i||a&128)&&t.update_slot_base(l,s,o,o[7],i?t.get_slot_changes(s,o[7],a,null):t.get_all_dirty_from_scope(o[7]),null),(!i||a&1)&&t.attr(e,"style",o[0])},i(o){i||(t.transition_in(l,o),i=!0)},o(o){t.transition_out(l,o),i=!1},d(o){o&&t.detach(e),l&&l.d(o)}}}function Oe(n,e,i){let s,{$$slots:l={},$$scope:o}=e,{width:a="512px"}=e,{height:r="256px"}=e,{rows:_}=e,{columns:c}=e,{gap:f="0px"}=e,{background:h="transparent"}=e;const d=g=>typeof g=="number"?`repeat(${g}, 1fr)`:g.join(" ");return n.$$set=g=>{"width"in g&&i(1,a=g.width),"height"in g&&i(2,r=g.height),"rows"in g&&i(3,_=g.rows),"columns"in g&&i(4,c=g.columns),"gap"in g&&i(5,f=g.gap),"background"in g&&i(6,h=g.background),"$$scope"in g&&i(7,o=g.$$scope)},n.$$.update=()=>{n.$$.dirty&126&&i(0,s=["display: grid",`grid-template-rows: ${d(_)}`,`grid-template-columns: ${d(c)}`,`gap: ${f}`,`background: ${h}`,`width: ${a}`,`height: ${r};`].join(";"))},[s,a,r,_,c,f,h,o,l]}class je extends t.SvelteComponent{constructor(e){super(),t.init(this,e,Oe,Ne,t.safe_not_equal,{width:1,height:2,rows:3,columns:4,gap:5,background:6})}}function Ie(n){let e;const i=n[18].default,s=t.create_slot(i,n,n[19],null);return{c(){s&&s.c()},m(l,o){s&&s.m(l,o),e=!0},p(l,o){s&&s.p&&(!e||o&524288)&&t.update_slot_base(s,i,l,l[19],e?t.get_slot_changes(i,l[19],o,null):t.get_all_dirty_from_scope(l[19]),null)},i(l){e||(t.transition_in(s,l),e=!0)},o(l){t.transition_out(s,l),e=!1},d(l){s&&s.d(l)}}}function ze(n){let e,i;return e=new je({props:{width:n[9],height:n[10],rows:n[11],columns:n[12],gap:n[13],background:n[14],$$slots:{default:[Ie]},$$scope:{ctx:n}}}),{c(){t.create_component(e.$$.fragment)},m(s,l){t.mount_component(e,s,l),i=!0},p(s,l){const o={};l&512&&(o.width=s[9]),l&1024&&(o.height=s[10]),l&2048&&(o.rows=s[11]),l&4096&&(o.columns=s[12]),l&8192&&(o.gap=s[13]),l&16384&&(o.background=s[14]),l&524288&&(o.$$scope={dirty:l,ctx:s}),e.$set(o)},i(s){i||(t.transition_in(e.$$.fragment,s),i=!0)},o(s){t.transition_out(e.$$.fragment,s),i=!1},d(s){t.destroy_component(e,s)}}}function Be(n){let e,i;return e=new U({props:{closable:n[3],closeButtonColor:n[4],_closeStyle:n[8],position:n[5],fixed:n[6],_style:n[7],$$slots:{default:[ze]},$$scope:{ctx:n}}}),e.$on("close",n[15]),{c(){t.create_component(e.$$.fragment)},m(s,l){t.mount_component(e,s,l),i=!0},p(s,l){const o={};l&8&&(o.closable=s[3]),l&16&&(o.closeButtonColor=s[4]),l&256&&(o._closeStyle=s[8]),l&32&&(o.position=s[5]),l&64&&(o.fixed=s[6]),l&128&&(o._style=s[7]),l&556544&&(o.$$scope={dirty:l,ctx:s}),e.$set(o)},i(s){i||(t.transition_in(e.$$.fragment,s),i=!0)},o(s){t.transition_out(e.$$.fragment,s),i=!1},d(s){t.destroy_component(e,s)}}}function Fe(n){let e,i,s,l;return e=new ke({props:{backgroundOverray:n[2]}}),e.$on("click",n[15]),s=new Ee({props:{animation:n[1],$$slots:{default:[Be]},$$scope:{ctx:n}}}),{c(){t.create_component(e.$$.fragment),i=t.space(),t.create_component(s.$$.fragment)},m(o,a){t.mount_component(e,o,a),t.insert(o,i,a),t.mount_component(s,o,a),l=!0},p(o,a){const r={};a&4&&(r.backgroundOverray=o[2]),e.$set(r);const _={};a&2&&(_.animation=o[1]),a&557048&&(_.$$scope={dirty:a,ctx:o}),s.$set(_)},i(o){l||(t.transition_in(e.$$.fragment,o),t.transition_in(s.$$.fragment,o),l=!0)},o(o){t.transition_out(e.$$.fragment,o),t.transition_out(s.$$.fragment,o),l=!1},d(o){t.destroy_component(e,o),o&&t.detach(i),t.destroy_component(s,o)}}}function Me(n){let e,i;return e=new be({props:{path:n[0],$$slots:{default:[Fe]},$$scope:{ctx:n}}}),{c(){t.create_component(e.$$.fragment)},m(s,l){t.mount_component(e,s,l),i=!0},p(s,[l]){const o={};l&1&&(o.path=s[0]),l&557054&&(o.$$scope={dirty:l,ctx:s}),e.$set(o)},i(s){i||(t.transition_in(e.$$.fragment,s),i=!0)},o(s){t.transition_out(e.$$.fragment,s),i=!1},d(s){t.destroy_component(e,s)}}}function Pe(n,e,i){let{$$slots:s={},$$scope:l}=e,{path:o}=e,{animation:a="none"}=e,{backgroundOverray:r=!1}=e,{closable:_=!0}=e,{closeButtonColor:c="#000000"}=e,{eventName:f=""}=e,{eventValue:h=null}=e,{position:d="center"}=e,{fixed:g=!1}=e,{_modalStyle:w=""}=e,{_closeStyle:k=""}=e,{width:T="512px"}=e,{height:S="256px"}=e,{rows:b}=e,{columns:E}=e,{gap:A="0px"}=e,{background:m="transparent"}=e;const J=y.createEventDispatcher(),Q=()=>{f&&v(f,h),J("close")};return n.$$set=u=>{"path"in u&&i(0,o=u.path),"animation"in u&&i(1,a=u.animation),"backgroundOverray"in u&&i(2,r=u.backgroundOverray),"closable"in u&&i(3,_=u.closable),"closeButtonColor"in u&&i(4,c=u.closeButtonColor),"eventName"in u&&i(16,f=u.eventName),"eventValue"in u&&i(17,h=u.eventValue),"position"in u&&i(5,d=u.position),"fixed"in u&&i(6,g=u.fixed),"_modalStyle"in u&&i(7,w=u._modalStyle),"_closeStyle"in u&&i(8,k=u._closeStyle),"width"in u&&i(9,T=u.width),"height"in u&&i(10,S=u.height),"rows"in u&&i(11,b=u.rows),"columns"in u&&i(12,E=u.columns),"gap"in u&&i(13,A=u.gap),"background"in u&&i(14,m=u.background),"$$scope"in u&&i(19,l=u.$$scope)},[o,a,r,_,c,d,g,w,k,T,S,b,E,A,m,Q,f,h,s,l]}class Ve extends t.SvelteComponent{constructor(e){super(),t.init(this,e,Pe,Me,t.safe_not_equal,{path:0,animation:1,backgroundOverray:2,closable:3,closeButtonColor:4,eventName:16,eventValue:17,position:5,fixed:6,_modalStyle:7,_closeStyle:8,width:9,height:10,rows:11,columns:12,gap:13,background:14})}}function De(n){t.append_styles(n,"svelte-g0rfgr",".grid-item.svelte-g0rfgr{word-break:break-all}")}function Ke(n){let e,i;const s=n[8].default,l=t.create_slot(s,n,n[7],null);return{c(){e=t.element("div"),l&&l.c(),t.attr(e,"class","grid-item svelte-g0rfgr"),t.attr(e,"style",n[0])},m(o,a){t.insert(o,e,a),l&&l.m(e,null),i=!0},p(o,[a]){l&&l.p&&(!i||a&128)&&t.update_slot_base(l,s,o,o[7],i?t.get_slot_changes(s,o[7],a,null):t.get_all_dirty_from_scope(o[7]),null),(!i||a&1)&&t.attr(e,"style",o[0])},i(o){i||(t.transition_in(l,o),i=!0)},o(o){t.transition_out(l,o),i=!1},d(o){o&&t.detach(e),l&&l.d(o)}}}function Ge(n,e,i){let s,{$$slots:l={},$$scope:o}=e,{x1:a}=e,{x2:r}=e,{y1:_}=e,{y2:c}=e,{z:f}=e,{background:h="transparent"}=e;return n.$$set=d=>{"x1"in d&&i(1,a=d.x1),"x2"in d&&i(2,r=d.x2),"y1"in d&&i(3,_=d.y1),"y2"in d&&i(4,c=d.y2),"z"in d&&i(5,f=d.z),"background"in d&&i(6,h=d.background),"$$scope"in d&&i(7,o=d.$$scope)},n.$$.update=()=>{n.$$.dirty&126&&i(0,s=[`grid-area: ${_+1} / ${a+1} / ${c+2} / ${r+2}`,`z-index: ${f}`,`background: ${h}`,"display: grid","place-items: center"].join(";"))},[s,a,r,_,c,f,h,o,l]}class Re extends t.SvelteComponent{constructor(e){super(),t.init(this,e,Ge,Ke,t.safe_not_equal,{x1:1,x2:2,y1:3,y2:4,z:5,background:6},De)}}function Ue(n){t.append_styles(n,"svelte-1e71ejc",".flex.svelte-1e71ejc{display:flex}")}function He(n){let e,i,s;const l=n[5].default,o=t.create_slot(l,n,n[4],null);return{c(){e=t.element("div"),o&&o.c(),t.attr(e,"class","flex svelte-1e71ejc"),t.attr(e,"style",i="width:"+n[1]+"; height:"+n[2]+"; flex-direction:"+n[0]+"; "+n[3])},m(a,r){t.insert(a,e,r),o&&o.m(e,null),s=!0},p(a,[r]){o&&o.p&&(!s||r&16)&&t.update_slot_base(o,l,a,a[4],s?t.get_slot_changes(l,a[4],r,null):t.get_all_dirty_from_scope(a[4]),null),(!s||r&15&&i!==(i="width:"+a[1]+"; height:"+a[2]+"; flex-direction:"+a[0]+"; "+a[3]))&&t.attr(e,"style",i)},i(a){s||(t.transition_in(o,a),s=!0)},o(a){t.transition_out(o,a),s=!1},d(a){a&&t.detach(e),o&&o.d(a)}}}const H="action-sdk:flex";function Je(){return y.getContext(H)}function Qe(n,e,i){let{$$slots:s={},$$scope:l}=e,{direction:o="row"}=e,{width:a="100%"}=e,{height:r="100%"}=e,{_style:_=""}=e;return y.setContext(H,{direction:o}),n.$$set=c=>{"direction"in c&&i(0,o=c.direction),"width"in c&&i(1,a=c.width),"height"in c&&i(2,r=c.height),"_style"in c&&i(3,_=c._style),"$$scope"in c&&i(4,l=c.$$scope)},[o,a,r,_,l,s]}class Ze extends t.SvelteComponent{constructor(e){super(),t.init(this,e,Qe,He,t.safe_not_equal,{direction:0,width:1,height:2,_style:3},Ue)}}function We(n){t.append_styles(n,"svelte-1p0bk1x",".flex-item.svelte-1p0bk1x{max-width:100%;max-height:100%;position:relative;isolation:isolate}")}function Xe(n){let e,i;const s=n[4].default,l=t.create_slot(s,n,n[3],null);return{c(){e=t.element("div"),l&&l.c(),t.attr(e,"class","flex-item svelte-1p0bk1x"),t.attr(e,"style",n[0])},m(o,a){t.insert(o,e,a),l&&l.m(e,null),i=!0},p(o,[a]){l&&l.p&&(!i||a&8)&&t.update_slot_base(l,s,o,o[3],i?t.get_slot_changes(s,o[3],a,null):t.get_all_dirty_from_scope(o[3]),null),(!i||a&1)&&t.attr(e,"style",o[0])},i(o){i||(t.transition_in(l,o),i=!0)},o(o){t.transition_out(l,o),i=!1},d(o){o&&t.detach(e),l&&l.d(o)}}}function Ye(n,e,i){let{$$slots:s={},$$scope:l}=e,{length:o}=e,{_style:a=""}=e;const r=Je();let _;return n.$$set=c=>{"length"in c&&i(1,o=c.length),"_style"in c&&i(2,a=c._style),"$$scope"in c&&i(3,l=c.$$scope)},n.$$.update=()=>{if(n.$$.dirty&6){let c="";D(o,"px")?r.direction==="row"?c=`width: ${o}; height: 100%;`:r.direction==="column"&&(c=`width: 100%; height: ${o};`):r.direction==="row"?c=`height: 100%; flex-grow: ${o}; flex-basis: 0;`:r.direction==="column"&&(c=`width: 100%; flex-grow: ${o}; flex-basis: 0;`),i(0,_=c+a)}},[_,o,a,l,s]}class pe extends t.SvelteComponent{constructor(e){super(),t.init(this,e,Ye,Xe,t.safe_not_equal,{length:1,_style:2},We)}}exports.AnimationStyles=se;exports.Directions=le;exports.Flex=Ze;exports.FlexItem=pe;exports.GridItem=Re;exports.GridModalState=Ve;exports.Justifies=ae;exports.LengthUnits=oe;exports.MediaQueries=ie;exports.Modal=U;exports.ObjectFits=re;exports.PropTypes=ne;exports.Repeats=ce;exports.State=me;exports.closeApp=te;exports.closed=j;exports.finalize=p;exports.getPositionStyle=V;exports.handleFocus=F;exports.handleKeydown=P;exports.hasSuffix=D;exports.initialize=Y;exports.isPreview=L;exports.linkTo=ee;exports.moveTo=$;exports.none=x;exports.onScroll=Z;exports.onTime=W;exports.randStr=K;exports.send_event=v;exports.setPreviousFocus=M;exports.state=O;exports.toBr=X;
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});var v=require("svelte/store"),t=require("svelte/internal"),y=require("svelte");const V=n=>e=>{if(n){const i=n.querySelectorAll("*"),o=Array.from(i).filter(s=>s.tabIndex>=0);let l=o.indexOf(document.activeElement);l===-1&&e.shiftKey&&(l=0),l+=o.length+(e.shiftKey?-1:1),l%=o.length,o[l].focus(),e.preventDefault()}},D=()=>{const n=typeof document!="undefined"&&document.activeElement;n&&(n==null||n.focus())},j=n=>e=>{n[e.key]&&n[e.key](e)},K=n=>n==="top-center"?"top: 0; right: 50%; transform: translate(+50%, 0%);":n==="top-left"?"top: 0; left: 0; transform: translate(0%, 0%);":n==="top-right"?"top: 0; right: 0; transform: translate(0%, 0%);":n==="center-left"?"top: 50%; left: 0; transform: translate(0%, -50%);":n==="center"?"top: 50%; left: 50%; transform: translate(-50%, -50%);":n==="center-right"?"top: 50%; right: 0; transform: translate(0%, -50%);":n==="bottom-left"?"bottom: 0; left: 0; transform: translate(0%, 0%);":n==="bottom-center"?"bottom: 0; left: 50%; transform: translate(-50%, 0%);":n==="bottom-right"?"bottom: 0; right: 0; transform: translate(0%, 0);":n==="none"?"top: 0; bottom: 0; right: 0; left: 0;":["top-left","top-center","top-right","center-left","center","center-right","bottom-left","bottom-center","bottom-right"].reduce((e,i)=>{const o=n.indexOf(i)>-1?"0":"auto";return e+` ${i}: ${o};`},"");function W(n,e){const i=document.querySelector("body"),o={root:null,threshold:1-e,rootMargin:"-100% 0px 100% 0px"},l=new IntersectionObserver(s=>{for(const a of s)a.isIntersecting||n()||l.unobserve(i)},o);return l.observe(i),()=>l&&l.unobserve(i)}function X(n,e){const i=setTimeout(n,e);return()=>i&&clearTimeout(i)}function G(n,e){return new RegExp(`/[0-9]${e}$/`).test(n)}function Y(n){return n.replace(/\r?\n/g,"<br>")}function Z(n=8){return Math.random().toString(32).substring(n)}const q={ALL_ACTION_ID:"KARTE_ALL_ACTION_ID",STATE_EVENT:"KARTE-ACTION-CHANGE-STATE"},I=v.writable({}),R=Z(),z=v.writable("/"),B=v.writable(!1),N=v.writable(0),w=(n,e)=>{var o;const i=v.get(I);(o=i==null?void 0:i.send)==null||o.call(i,n,e)},U=n=>{(n.detail.action_id===R||n.detail.action_id===q.ALL_ACTION_ID)&&z.set(n.detail.to)},x=n=>{window.addEventListener(q.STATE_EVENT,U),B.set(!1),I.set(n!=null?n:{})},$=()=>{window.removeEventListener(q.STATE_EVENT,U)},O=()=>{const n=v.get(I);return n==null?void 0:n.isPreview},H=n=>{!n||n<v.get(N)||N.set(n)},ee=()=>()=>{},te=n=>()=>{w("_message_state_changed",{state:n}),window.dispatchEvent(new CustomEvent(q.STATE_EVENT,{detail:{to:n,action_id:R}}))},ne=(n,e=!0)=>()=>{w("message_click",{url:n}),e?window.open(n):location.href=n},ie=()=>()=>{w("message_close",null),B.set(!0)},le=["BooleanKeyword","NumberKeyword","StringKeyword","Function","Enum","Code","Direction","Url","Image","AnimationStyle","LongText","Length","Color","Alignment","Style"],se={PC:"(\\s*min-width\\s*:\\s*1025px\\s*)",Tablet:"(\\s*min-width\\s*:\\s*897px)\\s+and\\s+(\\s*max-width\\s*:\\s*1024px\\s*)",Mobile:"(\\s*max-width\\s*:\\s*896px\\s*)"},oe=["row","column"],ae=["none","fade","bounce","slide-down","slide-up","slide-left","slide-right"],re=["px","em","rem","vw","fr","%"],ce=["flex-start","center","flex-end"],fe=["flex-start","center","flex-end"],ue=["fill","contain","cover"],me=["repeat","space","round","no-repeat"];function de(n){t.append_styles(n,"svelte-zmz1k7","@import 'https://cdn.skypack.dev/normalize.css';")}class _e extends t.SvelteComponent{constructor(e){super(),t.init(this,e,null,null,t.safe_not_equal,{},de)}}function ge(n){let e,i,o;e=new _e({});const l=n[1].default,s=t.create_slot(l,n,n[0],null);return{c(){t.create_component(e.$$.fragment),i=t.space(),s&&s.c()},m(a,r){t.mount_component(e,a,r),t.insert(a,i,r),s&&s.m(a,r),o=!0},p(a,[r]){s&&s.p&&(!o||r&1)&&t.update_slot_base(s,l,a,a[0],o?t.get_slot_changes(l,a[0],r,null):t.get_all_dirty_from_scope(a[0]),null)},i(a){o||(t.transition_in(e.$$.fragment,a),t.transition_in(s,a),o=!0)},o(a){t.transition_out(e.$$.fragment,a),t.transition_out(s,a),o=!1},d(a){t.destroy_component(e,a),a&&t.detach(i),s&&s.d(a)}}}function he(n,e,i){let{$$slots:o={},$$scope:l}=e;return n.$$set=s=>{"$$scope"in s&&i(0,l=s.$$scope)},[l,o]}class be extends t.SvelteComponent{constructor(e){super(),t.init(this,e,he,ge,t.safe_not_equal,{})}}function M(n){let e;const i=n[3].default,o=t.create_slot(i,n,n[2],null);return{c(){o&&o.c()},m(l,s){o&&o.m(l,s),e=!0},p(l,s){o&&o.p&&(!e||s&4)&&t.update_slot_base(o,i,l,l[2],e?t.get_slot_changes(i,l[2],s,null):t.get_all_dirty_from_scope(l[2]),null)},i(l){e||(t.transition_in(o,l),e=!0)},o(l){t.transition_out(o,l),e=!1},d(l){o&&o.d(l)}}}function ye(n){let e,i,o=n[1]===n[0]&&M(n);return{c(){o&&o.c(),e=t.empty()},m(l,s){o&&o.m(l,s),t.insert(l,e,s),i=!0},p(l,[s]){l[1]===l[0]?o?(o.p(l,s),s&3&&t.transition_in(o,1)):(o=M(l),o.c(),t.transition_in(o,1),o.m(e.parentNode,e)):o&&(t.group_outros(),t.transition_out(o,1,1,()=>{o=null}),t.check_outros())},i(l){i||(t.transition_in(o),i=!0)},o(l){t.transition_out(o),i=!1},d(l){o&&o.d(l),l&&t.detach(e)}}}function ve(n,e,i){let o;t.component_subscribe(n,z,r=>i(1,o=r));let{$$slots:l={},$$scope:s}=e,{path:a}=e;return n.$$set=r=>{"path"in r&&i(0,a=r.path),"$$scope"in r&&i(2,s=r.$$scope)},[a,o,s,l]}class we extends t.SvelteComponent{constructor(e){super(),t.init(this,e,ve,ye,t.safe_not_equal,{path:0})}}function ke(n){t.append_styles(n,"svelte-1h4b6e3",".background.svelte-1h4b6e3{position:fixed;top:0;left:0;width:100%;height:100%;background:rgba(0, 0, 0, 0.3)}")}function F(n){let e,i,o;return{c(){e=t.element("div"),t.attr(e,"class","background svelte-1h4b6e3")},m(l,s){t.insert(l,e,s),i||(o=t.listen(e,"click",n[2]),i=!0)},p:t.noop,d(l){l&&t.detach(e),i=!1,o()}}}function Se(n){let e,i=n[0]&&F(n);return{c(){i&&i.c(),e=t.empty()},m(o,l){i&&i.m(o,l),t.insert(o,e,l)},p(o,[l]){o[0]?i?i.p(o,l):(i=F(o),i.c(),i.m(e.parentNode,e)):i&&(i.d(1),i=null)},i:t.noop,o:t.noop,d(o){i&&i.d(o),o&&t.detach(e)}}}function Ce(n,e,i){let{backgroundOverray:o=!1}=e;const l=y.createEventDispatcher(),s=()=>l("click");return n.$$set=a=>{"backgroundOverray"in a&&i(0,o=a.backgroundOverray)},[o,l,s]}class Te extends t.SvelteComponent{constructor(e){super(),t.init(this,e,Ce,Se,t.safe_not_equal,{backgroundOverray:0},ke)}}function Ee(n){t.append_styles(n,"svelte-sa0cac","@keyframes svelte-sa0cac-fade{0%{opacity:0}100%{opacity:1}}.fade.svelte-sa0cac{animation-name:svelte-sa0cac-fade;animation-duration:1s}@keyframes svelte-sa0cac-bounce{0%{opacity:0;transform:scale(0.3)}50%{opacity:1;transform:scale(1.05)}70%{transform:scale(0.9)}100%{transform:scale(1)}}.bounce.svelte-sa0cac{animation-name:svelte-sa0cac-bounce;animation-duration:1s}@keyframes svelte-sa0cac-slide-down{0%{transform:translate3d(0, -100%, 0);visibility:visible}100%{transform:translate3d(0, 0, 0)}}.slide-down.svelte-sa0cac{animation-name:svelte-sa0cac-slide-down;animation-duration:1s;animation-delay:0.1s}@keyframes svelte-sa0cac-slide-up{0%{transform:translate3d(0, 100%, 0);visibility:visible}100%{transform:translate3d(0, 0, 0)}}.slide-up.svelte-sa0cac{animation-name:svelte-sa0cac-slide-up;animation-duration:1s;animation-delay:0.1s}@keyframes svelte-sa0cac-slide-left{0%{transform:translate3d(100%, 0, 0);visibility:visible}100%{transform:translate3d(0, 0, 0)}}.slide-left.svelte-sa0cac{animation-name:svelte-sa0cac-slide-left;animation-duration:1s;animation-delay:0.1s}@keyframes svelte-sa0cac-slide-right{0%{transform:translate3d(-100%, 0, 0);visibility:visible}100%{transform:translate3d(0, 0, 0)}}.slide-right.svelte-sa0cac{animation-name:svelte-sa0cac-slide-right;animation-duration:1s;animation-delay:0.1s}")}function Ae(n){let e,i;const o=n[3].default,l=t.create_slot(o,n,n[2],null);return{c(){e=t.element("div"),l&&l.c(),t.attr(e,"class",t.null_to_empty(n[0])+" svelte-sa0cac")},m(s,a){t.insert(s,e,a),l&&l.m(e,null),i=!0},p(s,[a]){l&&l.p&&(!i||a&4)&&t.update_slot_base(l,o,s,s[2],i?t.get_slot_changes(o,s[2],a,null):t.get_all_dirty_from_scope(s[2]),null)},i(s){i||(t.transition_in(l,s),i=!0)},o(s){t.transition_out(l,s),i=!1},d(s){s&&t.detach(e),l&&l.d(s)}}}function Le(n,e,i){let{$$slots:o={},$$scope:l}=e,{animation:s="none"}=e;const a=O()?"none":s;return n.$$set=r=>{"animation"in r&&i(1,s=r.animation),"$$scope"in r&&i(2,l=r.$$scope)},[a,s,l,o]}class Ne extends t.SvelteComponent{constructor(e){super(),t.init(this,e,Le,Ae,t.safe_not_equal,{animation:1},Ee)}}function Oe(n){t.append_styles(n,"svelte-15uvai6",".modal.svelte-15uvai6{position:absolute;box-sizing:border-box}.close.svelte-15uvai6{position:absolute;display:flex;justify-content:center;align-items:center;background-color:transparent;border:none;cursor:pointer;padding:0;transition:all .25s}.close.svelte-15uvai6:hover{transform:rotate(90deg)}")}function P(n){let e,i,o,l,s,a;return{c(){e=t.element("button"),i=t.svg_element("svg"),o=t.svg_element("path"),t.attr(o,"d","M5.78516 4.75L8.73828 1.82422C8.90234 1.66016 8.90234 1.35938 8.73828 1.19531L8.05469 0.511719C7.89062 0.347656 7.58984 0.347656 7.42578 0.511719L4.5 3.46484L1.54688 0.511719C1.38281 0.347656 1.08203 0.347656 0.917969 0.511719L0.234375 1.19531C0.0703125 1.35938 0.0703125 1.66016 0.234375 1.82422L3.1875 4.75L0.234375 7.70312C0.0703125 7.86719 0.0703125 8.16797 0.234375 8.33203L0.917969 9.01562C1.08203 9.17969 1.38281 9.17969 1.54688 9.01562L4.5 6.0625L7.42578 9.01562C7.58984 9.17969 7.89062 9.17969 8.05469 9.01562L8.73828 8.33203C8.90234 8.16797 8.90234 7.86719 8.73828 7.70312L5.78516 4.75Z"),t.attr(o,"fill",n[1]),t.attr(o,"fill-opacity","0.8"),t.attr(i,"width","100%"),t.attr(i,"height","100%"),t.attr(i,"viewBox","0 0 9 10"),t.attr(i,"fill","none"),t.attr(i,"xmlns","http://www.w3.org/2000/svg"),t.attr(e,"class","close svelte-15uvai6"),t.attr(e,"style",l="z-index:"+(n[6]+1)+"; "+n[3])},m(r,m){t.insert(r,e,m),t.append(e,i),t.append(i,o),s||(a=t.listen(e,"click",n[8]),s=!0)},p(r,m){m&2&&t.attr(o,"fill",r[1]),m&72&&l!==(l="z-index:"+(r[6]+1)+"; "+r[3])&&t.attr(e,"style",l)},d(r){r&&t.detach(e),s=!1,a()}}}function qe(n){let e,i,o,l,s,a,r=n[0]&&P(n);const m=n[15].default,c=t.create_slot(m,n,n[14],null);return{c(){e=t.element("div"),r&&r.c(),i=t.space(),c&&c.c(),t.attr(e,"class","modal svelte-15uvai6"),t.attr(e,"role","dialog"),t.attr(e,"aria-modal","true"),t.attr(e,"style",o="position:"+(n[7]?"fixed":"absolute")+"; "+n[5]+" "+n[2])},m(f,g){t.insert(f,e,g),r&&r.m(e,null),t.append(e,i),c&&c.m(e,null),n[16](e),l=!0,s||(a=t.listen(window,"keydown",n[9]),s=!0)},p(f,[g]){f[0]?r?r.p(f,g):(r=P(f),r.c(),r.m(e,i)):r&&(r.d(1),r=null),c&&c.p&&(!l||g&16384)&&t.update_slot_base(c,m,f,f[14],l?t.get_slot_changes(m,f[14],g,null):t.get_all_dirty_from_scope(f[14]),null),(!l||g&36&&o!==(o="position:"+(f[7]?"fixed":"absolute")+"; "+f[5]+" "+f[2]))&&t.attr(e,"style",o)},i(f){l||(t.transition_in(c,f),l=!0)},o(f){t.transition_out(c,f),l=!1},d(f){f&&t.detach(e),r&&r.d(),c&&c.d(f),n[16](null),s=!1,a()}}}function Ie(n,e,i){let o,l;t.component_subscribe(n,N,_=>i(6,l=_));let{$$slots:s={},$$scope:a}=e,{closable:r=!0}=e,{closeButtonColor:m="#000000"}=e,{eventName:c=""}=e,{eventValue:f=null}=e,{position:g="center"}=e;const h=O()?"center":g;let{fixed:d=!1}=e;const T=O()?!1:d;let{_style:k=""}=e,{_closeStyle:S=""}=e;const E=y.createEventDispatcher(),C=()=>{c&&w(c,f),E("close")};let b=null;const A=j({Escape:C,Tab:V(b)});y.onDestroy(()=>D());function L(_){t.binding_callbacks[_?"unshift":"push"](()=>{b=_,i(4,b)})}return n.$$set=_=>{"closable"in _&&i(0,r=_.closable),"closeButtonColor"in _&&i(1,m=_.closeButtonColor),"eventName"in _&&i(10,c=_.eventName),"eventValue"in _&&i(11,f=_.eventValue),"position"in _&&i(12,g=_.position),"fixed"in _&&i(13,d=_.fixed),"_style"in _&&i(2,k=_._style),"_closeStyle"in _&&i(3,S=_._closeStyle),"$$scope"in _&&i(14,a=_.$$scope)},i(5,o=K(h)),[r,m,k,S,b,o,l,T,C,A,c,f,g,d,a,s,L]}class J extends t.SvelteComponent{constructor(e){super(),t.init(this,e,Ie,qe,t.safe_not_equal,{closable:0,closeButtonColor:1,eventName:10,eventValue:11,position:12,fixed:13,_style:2,_closeStyle:3},Oe)}}function ze(n){let e,i;const o=n[8].default,l=t.create_slot(o,n,n[7],null);return{c(){e=t.element("div"),l&&l.c(),t.attr(e,"class","grid"),t.attr(e,"style",n[0])},m(s,a){t.insert(s,e,a),l&&l.m(e,null),i=!0},p(s,[a]){l&&l.p&&(!i||a&128)&&t.update_slot_base(l,o,s,s[7],i?t.get_slot_changes(o,s[7],a,null):t.get_all_dirty_from_scope(s[7]),null),(!i||a&1)&&t.attr(e,"style",s[0])},i(s){i||(t.transition_in(l,s),i=!0)},o(s){t.transition_out(l,s),i=!1},d(s){s&&t.detach(e),l&&l.d(s)}}}function Be(n,e,i){let o,{$$slots:l={},$$scope:s}=e,{width:a="512px"}=e,{height:r="256px"}=e,{rows:m}=e,{columns:c}=e,{gap:f="0px"}=e,{background:g="transparent"}=e;const h=d=>typeof d=="number"?`repeat(${d}, 1fr)`:d.join(" ");return n.$$set=d=>{"width"in d&&i(1,a=d.width),"height"in d&&i(2,r=d.height),"rows"in d&&i(3,m=d.rows),"columns"in d&&i(4,c=d.columns),"gap"in d&&i(5,f=d.gap),"background"in d&&i(6,g=d.background),"$$scope"in d&&i(7,s=d.$$scope)},n.$$.update=()=>{n.$$.dirty&126&&i(0,o=["display: grid",`grid-template-rows: ${h(m)}`,`grid-template-columns: ${h(c)}`,`gap: ${f}`,`background: ${g}`,`width: ${a}`,`height: ${r};`].join(";"))},[o,a,r,m,c,f,g,s,l]}class Me extends t.SvelteComponent{constructor(e){super(),t.init(this,e,Be,ze,t.safe_not_equal,{width:1,height:2,rows:3,columns:4,gap:5,background:6})}}function Fe(n){let e;const i=n[18].default,o=t.create_slot(i,n,n[19],null);return{c(){o&&o.c()},m(l,s){o&&o.m(l,s),e=!0},p(l,s){o&&o.p&&(!e||s&524288)&&t.update_slot_base(o,i,l,l[19],e?t.get_slot_changes(i,l[19],s,null):t.get_all_dirty_from_scope(l[19]),null)},i(l){e||(t.transition_in(o,l),e=!0)},o(l){t.transition_out(o,l),e=!1},d(l){o&&o.d(l)}}}function Pe(n){let e,i;return e=new Me({props:{width:n[9],height:n[10],rows:n[11],columns:n[12],gap:n[13],background:n[14],$$slots:{default:[Fe]},$$scope:{ctx:n}}}),{c(){t.create_component(e.$$.fragment)},m(o,l){t.mount_component(e,o,l),i=!0},p(o,l){const s={};l&512&&(s.width=o[9]),l&1024&&(s.height=o[10]),l&2048&&(s.rows=o[11]),l&4096&&(s.columns=o[12]),l&8192&&(s.gap=o[13]),l&16384&&(s.background=o[14]),l&524288&&(s.$$scope={dirty:l,ctx:o}),e.$set(s)},i(o){i||(t.transition_in(e.$$.fragment,o),i=!0)},o(o){t.transition_out(e.$$.fragment,o),i=!1},d(o){t.destroy_component(e,o)}}}function Ve(n){let e,i;return e=new J({props:{closable:n[3],closeButtonColor:n[4],_closeStyle:n[8],position:n[5],fixed:n[6],_style:n[7],$$slots:{default:[Pe]},$$scope:{ctx:n}}}),e.$on("close",n[15]),{c(){t.create_component(e.$$.fragment)},m(o,l){t.mount_component(e,o,l),i=!0},p(o,l){const s={};l&8&&(s.closable=o[3]),l&16&&(s.closeButtonColor=o[4]),l&256&&(s._closeStyle=o[8]),l&32&&(s.position=o[5]),l&64&&(s.fixed=o[6]),l&128&&(s._style=o[7]),l&556544&&(s.$$scope={dirty:l,ctx:o}),e.$set(s)},i(o){i||(t.transition_in(e.$$.fragment,o),i=!0)},o(o){t.transition_out(e.$$.fragment,o),i=!1},d(o){t.destroy_component(e,o)}}}function De(n){let e,i,o,l;return e=new Te({props:{backgroundOverray:n[2]}}),e.$on("click",n[15]),o=new Ne({props:{animation:n[1],$$slots:{default:[Ve]},$$scope:{ctx:n}}}),{c(){t.create_component(e.$$.fragment),i=t.space(),t.create_component(o.$$.fragment)},m(s,a){t.mount_component(e,s,a),t.insert(s,i,a),t.mount_component(o,s,a),l=!0},p(s,a){const r={};a&4&&(r.backgroundOverray=s[2]),e.$set(r);const m={};a&2&&(m.animation=s[1]),a&557048&&(m.$$scope={dirty:a,ctx:s}),o.$set(m)},i(s){l||(t.transition_in(e.$$.fragment,s),t.transition_in(o.$$.fragment,s),l=!0)},o(s){t.transition_out(e.$$.fragment,s),t.transition_out(o.$$.fragment,s),l=!1},d(s){t.destroy_component(e,s),s&&t.detach(i),t.destroy_component(o,s)}}}function je(n){let e,i;return e=new we({props:{path:n[0],$$slots:{default:[De]},$$scope:{ctx:n}}}),{c(){t.create_component(e.$$.fragment)},m(o,l){t.mount_component(e,o,l),i=!0},p(o,[l]){const s={};l&1&&(s.path=o[0]),l&557054&&(s.$$scope={dirty:l,ctx:o}),e.$set(s)},i(o){i||(t.transition_in(e.$$.fragment,o),i=!0)},o(o){t.transition_out(e.$$.fragment,o),i=!1},d(o){t.destroy_component(e,o)}}}function Ke(n,e,i){let{$$slots:o={},$$scope:l}=e,{path:s}=e,{animation:a="none"}=e,{backgroundOverray:r=!1}=e,{closable:m=!0}=e,{closeButtonColor:c="#000000"}=e,{eventName:f=""}=e,{eventValue:g=null}=e,{position:h="center"}=e,{fixed:d=!1}=e,{_modalStyle:T=""}=e,{_closeStyle:k=""}=e,{width:S="512px"}=e,{height:E="256px"}=e,{rows:C}=e,{columns:b}=e,{gap:A="0px"}=e,{background:L="transparent"}=e;const _=y.createEventDispatcher(),p=()=>{f&&w(f,g),_("close")};return n.$$set=u=>{"path"in u&&i(0,s=u.path),"animation"in u&&i(1,a=u.animation),"backgroundOverray"in u&&i(2,r=u.backgroundOverray),"closable"in u&&i(3,m=u.closable),"closeButtonColor"in u&&i(4,c=u.closeButtonColor),"eventName"in u&&i(16,f=u.eventName),"eventValue"in u&&i(17,g=u.eventValue),"position"in u&&i(5,h=u.position),"fixed"in u&&i(6,d=u.fixed),"_modalStyle"in u&&i(7,T=u._modalStyle),"_closeStyle"in u&&i(8,k=u._closeStyle),"width"in u&&i(9,S=u.width),"height"in u&&i(10,E=u.height),"rows"in u&&i(11,C=u.rows),"columns"in u&&i(12,b=u.columns),"gap"in u&&i(13,A=u.gap),"background"in u&&i(14,L=u.background),"$$scope"in u&&i(19,l=u.$$scope)},[s,a,r,m,c,h,d,T,k,S,E,C,b,A,L,p,f,g,o,l]}class Ge extends t.SvelteComponent{constructor(e){super(),t.init(this,e,Ke,je,t.safe_not_equal,{path:0,animation:1,backgroundOverray:2,closable:3,closeButtonColor:4,eventName:16,eventValue:17,position:5,fixed:6,_modalStyle:7,_closeStyle:8,width:9,height:10,rows:11,columns:12,gap:13,background:14})}}function Ze(n){t.append_styles(n,"svelte-g0rfgr",".grid-item.svelte-g0rfgr{word-break:break-all}")}function Re(n){let e,i;const o=n[8].default,l=t.create_slot(o,n,n[7],null);return{c(){e=t.element("div"),l&&l.c(),t.attr(e,"class","grid-item svelte-g0rfgr"),t.attr(e,"style",n[0])},m(s,a){t.insert(s,e,a),l&&l.m(e,null),i=!0},p(s,[a]){l&&l.p&&(!i||a&128)&&t.update_slot_base(l,o,s,s[7],i?t.get_slot_changes(o,s[7],a,null):t.get_all_dirty_from_scope(s[7]),null),(!i||a&1)&&t.attr(e,"style",s[0])},i(s){i||(t.transition_in(l,s),i=!0)},o(s){t.transition_out(l,s),i=!1},d(s){s&&t.detach(e),l&&l.d(s)}}}function Ue(n,e,i){let o,{$$slots:l={},$$scope:s}=e,{x1:a}=e,{x2:r}=e,{y1:m}=e,{y2:c}=e,{z:f}=e,{background:g="transparent"}=e;return y.onMount(()=>{H(f)}),n.$$set=h=>{"x1"in h&&i(1,a=h.x1),"x2"in h&&i(2,r=h.x2),"y1"in h&&i(3,m=h.y1),"y2"in h&&i(4,c=h.y2),"z"in h&&i(5,f=h.z),"background"in h&&i(6,g=h.background),"$$scope"in h&&i(7,s=h.$$scope)},n.$$.update=()=>{n.$$.dirty&126&&i(0,o=[`grid-area: ${m+1} / ${a+1} / ${c+2} / ${r+2}`,`z-index: ${f}`,`background: ${g}`,"display: grid","place-items: center"].join(";"))},[o,a,r,m,c,f,g,s,l]}class He extends t.SvelteComponent{constructor(e){super(),t.init(this,e,Ue,Re,t.safe_not_equal,{x1:1,x2:2,y1:3,y2:4,z:5,background:6},Ze)}}function Je(n){t.append_styles(n,"svelte-1e71ejc",".flex.svelte-1e71ejc{display:flex}")}function Qe(n){let e,i,o;const l=n[5].default,s=t.create_slot(l,n,n[4],null);return{c(){e=t.element("div"),s&&s.c(),t.attr(e,"class","flex svelte-1e71ejc"),t.attr(e,"style",i="width:"+n[1]+"; height:"+n[2]+"; flex-direction:"+n[0]+"; "+n[3])},m(a,r){t.insert(a,e,r),s&&s.m(e,null),o=!0},p(a,[r]){s&&s.p&&(!o||r&16)&&t.update_slot_base(s,l,a,a[4],o?t.get_slot_changes(l,a[4],r,null):t.get_all_dirty_from_scope(a[4]),null),(!o||r&15&&i!==(i="width:"+a[1]+"; height:"+a[2]+"; flex-direction:"+a[0]+"; "+a[3]))&&t.attr(e,"style",i)},i(a){o||(t.transition_in(s,a),o=!0)},o(a){t.transition_out(s,a),o=!1},d(a){a&&t.detach(e),s&&s.d(a)}}}const Q="action-sdk:flex";function pe(){return y.getContext(Q)}function We(n,e,i){let{$$slots:o={},$$scope:l}=e,{direction:s="row"}=e,{width:a="100%"}=e,{height:r="100%"}=e,{_style:m=""}=e;return y.setContext(Q,{direction:s}),n.$$set=c=>{"direction"in c&&i(0,s=c.direction),"width"in c&&i(1,a=c.width),"height"in c&&i(2,r=c.height),"_style"in c&&i(3,m=c._style),"$$scope"in c&&i(4,l=c.$$scope)},[s,a,r,m,l,o]}class Xe extends t.SvelteComponent{constructor(e){super(),t.init(this,e,We,Qe,t.safe_not_equal,{direction:0,width:1,height:2,_style:3},Je)}}function Ye(n){t.append_styles(n,"svelte-1p0bk1x",".flex-item.svelte-1p0bk1x{max-width:100%;max-height:100%;position:relative;isolation:isolate}")}function xe(n){let e,i;const o=n[4].default,l=t.create_slot(o,n,n[3],null);return{c(){e=t.element("div"),l&&l.c(),t.attr(e,"class","flex-item svelte-1p0bk1x"),t.attr(e,"style",n[0])},m(s,a){t.insert(s,e,a),l&&l.m(e,null),i=!0},p(s,[a]){l&&l.p&&(!i||a&8)&&t.update_slot_base(l,o,s,s[3],i?t.get_slot_changes(o,s[3],a,null):t.get_all_dirty_from_scope(s[3]),null),(!i||a&1)&&t.attr(e,"style",s[0])},i(s){i||(t.transition_in(l,s),i=!0)},o(s){t.transition_out(l,s),i=!1},d(s){s&&t.detach(e),l&&l.d(s)}}}function $e(n,e,i){let{$$slots:o={},$$scope:l}=e,{length:s}=e,{_style:a=""}=e;const r=pe();let m;return n.$$set=c=>{"length"in c&&i(1,s=c.length),"_style"in c&&i(2,a=c._style),"$$scope"in c&&i(3,l=c.$$scope)},n.$$.update=()=>{if(n.$$.dirty&6){let c="";G(s,"px")?r.direction==="row"?c=`width: ${s}; height: 100%;`:r.direction==="column"&&(c=`width: 100%; height: ${s};`):r.direction==="row"?c=`height: 100%; flex-grow: ${s}; flex-basis: 0;`:r.direction==="column"&&(c=`width: 100%; flex-grow: ${s}; flex-basis: 0;`),i(0,m=c+a)}},[m,s,a,l,o]}class et extends t.SvelteComponent{constructor(e){super(),t.init(this,e,$e,xe,t.safe_not_equal,{length:1,_style:2},Ye)}}exports.Alignments=fe;exports.AnimationStyles=ae;exports.Directions=oe;exports.Flex=Xe;exports.FlexItem=et;exports.GridItem=He;exports.GridModalState=Ge;exports.Justifies=ce;exports.LengthUnits=re;exports.MediaQueries=se;exports.Modal=J;exports.ObjectFits=ue;exports.PropTypes=le;exports.Repeats=me;exports.State=be;exports.closeApp=ie;exports.closed=B;exports.finalize=$;exports.getPositionStyle=K;exports.handleFocus=V;exports.handleKeydown=j;exports.hasSuffix=G;exports.initialize=x;exports.isPreview=O;exports.linkTo=ne;exports.maximumZindex=N;exports.moveTo=te;exports.none=ee;exports.onScroll=W;exports.onTime=X;exports.randStr=Z;exports.send_event=w;exports.setMiximumZindex=H;exports.setPreviousFocus=D;exports.state=z;exports.toBr=Y;
|
package/dist/index.d.ts
CHANGED
|
@@ -6,6 +6,10 @@ import { default as Modal } from './components/Modal.svelte';
|
|
|
6
6
|
import { default as State } from './State.svelte';
|
|
7
7
|
import type { Writable } from 'svelte/store';
|
|
8
8
|
|
|
9
|
+
export declare type Alignment = typeof Alignments[number];
|
|
10
|
+
|
|
11
|
+
export declare const Alignments: readonly ["flex-start", "center", "flex-end"];
|
|
12
|
+
|
|
9
13
|
export declare type AnimationStyle = typeof AnimationStyles[number];
|
|
10
14
|
|
|
11
15
|
export declare const AnimationStyles: readonly ["none", "fade", "bounce", "slide-down", "slide-up", "slide-left", "slide-right"];
|
|
@@ -53,7 +57,7 @@ export declare const initialize: (options?: OPTIONS) => void;
|
|
|
53
57
|
|
|
54
58
|
export declare const isPreview: () => boolean;
|
|
55
59
|
|
|
56
|
-
export declare const Justifies: readonly ["
|
|
60
|
+
export declare const Justifies: readonly ["flex-start", "center", "flex-end"];
|
|
57
61
|
|
|
58
62
|
export declare type Justify = typeof Justifies[number];
|
|
59
63
|
|
|
@@ -67,6 +71,8 @@ export declare const linkTo: (to: string, targetBlank?: boolean) => () => void;
|
|
|
67
71
|
|
|
68
72
|
export declare type LongText = string;
|
|
69
73
|
|
|
74
|
+
export declare const maximumZindex: Writable<number>;
|
|
75
|
+
|
|
70
76
|
export declare const MediaQueries: {
|
|
71
77
|
[key: string]: string;
|
|
72
78
|
};
|
|
@@ -75,7 +81,7 @@ export declare type MediaQuery = string;
|
|
|
75
81
|
|
|
76
82
|
export { Modal }
|
|
77
83
|
|
|
78
|
-
export declare type ModalPosition = '
|
|
84
|
+
export declare type ModalPosition = 'top-left' | 'top-center' | 'top-right' | 'center-left' | 'center' | 'center-right' | 'bottom-left' | 'bottom-center' | 'bottom-right' | 'none';
|
|
79
85
|
|
|
80
86
|
declare const moveTo_2: (to: string) => () => void;
|
|
81
87
|
export { moveTo_2 as moveTo }
|
|
@@ -107,6 +113,8 @@ export declare const Repeats: readonly ["repeat", "space", "round", "no-repeat"]
|
|
|
107
113
|
|
|
108
114
|
export declare const send_event: (event_name: string, values?: any) => void;
|
|
109
115
|
|
|
116
|
+
export declare const setMiximumZindex: (zindex: number | undefined) => void;
|
|
117
|
+
|
|
110
118
|
export declare const setPreviousFocus: () => void;
|
|
111
119
|
|
|
112
120
|
export { State }
|
|
@@ -115,7 +123,7 @@ export declare const state: Writable<string>;
|
|
|
115
123
|
|
|
116
124
|
export declare type Style = string;
|
|
117
125
|
|
|
118
|
-
export declare function toBr(text: string
|
|
126
|
+
export declare function toBr(text: string): string;
|
|
119
127
|
|
|
120
128
|
export declare type Url = string;
|
|
121
129
|
|
package/dist/index.es.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { writable, get } from "svelte/store";
|
|
2
2
|
import { SvelteComponent, init, safe_not_equal, append_styles, create_slot, create_component, space, mount_component, insert, update_slot_base, get_all_dirty_from_scope, get_slot_changes, transition_in, transition_out, destroy_component, detach, empty, group_outros, check_outros, component_subscribe, element, attr, listen, noop, null_to_empty, svg_element, append, binding_callbacks } from "svelte/internal";
|
|
3
|
-
import { createEventDispatcher, onDestroy, setContext, getContext } from "svelte";
|
|
3
|
+
import { createEventDispatcher, onDestroy, onMount, setContext, getContext } from "svelte";
|
|
4
4
|
const handleFocus = (node) => (e) => {
|
|
5
5
|
if (node) {
|
|
6
6
|
const nodes = node.querySelectorAll("*");
|
|
@@ -26,20 +26,38 @@ const handleKeydown = (handlers) => (e) => {
|
|
|
26
26
|
}
|
|
27
27
|
};
|
|
28
28
|
const getPositionStyle = (position) => {
|
|
29
|
-
if (position === "center") {
|
|
30
|
-
return "top: 50%; left: 50%; transform: translate(-50%, -50%);";
|
|
31
|
-
} else if (position === "top") {
|
|
29
|
+
if (position === "top-center") {
|
|
32
30
|
return "top: 0; right: 50%; transform: translate(+50%, 0%);";
|
|
33
|
-
} else if (position === "left") {
|
|
31
|
+
} else if (position === "top-left") {
|
|
32
|
+
return "top: 0; left: 0; transform: translate(0%, 0%);";
|
|
33
|
+
} else if (position === "top-right") {
|
|
34
|
+
return "top: 0; right: 0; transform: translate(0%, 0%);";
|
|
35
|
+
} else if (position === "center-left") {
|
|
34
36
|
return "top: 50%; left: 0; transform: translate(0%, -50%);";
|
|
35
|
-
} else if (position === "
|
|
36
|
-
return "
|
|
37
|
-
} else if (position === "right") {
|
|
37
|
+
} else if (position === "center") {
|
|
38
|
+
return "top: 50%; left: 50%; transform: translate(-50%, -50%);";
|
|
39
|
+
} else if (position === "center-right") {
|
|
38
40
|
return "top: 50%; right: 0; transform: translate(0%, -50%);";
|
|
41
|
+
} else if (position === "bottom-left") {
|
|
42
|
+
return "bottom: 0; left: 0; transform: translate(0%, 0%);";
|
|
43
|
+
} else if (position === "bottom-center") {
|
|
44
|
+
return "bottom: 0; left: 50%; transform: translate(-50%, 0%);";
|
|
45
|
+
} else if (position === "bottom-right") {
|
|
46
|
+
return "bottom: 0; right: 0; transform: translate(0%, 0);";
|
|
39
47
|
} else if (position === "none") {
|
|
40
48
|
return "top: 0; bottom: 0; right: 0; left: 0;";
|
|
41
49
|
}
|
|
42
|
-
return [
|
|
50
|
+
return [
|
|
51
|
+
"top-left",
|
|
52
|
+
"top-center",
|
|
53
|
+
"top-right",
|
|
54
|
+
"center-left",
|
|
55
|
+
"center",
|
|
56
|
+
"center-right",
|
|
57
|
+
"bottom-left",
|
|
58
|
+
"bottom-center",
|
|
59
|
+
"bottom-right"
|
|
60
|
+
].reduce((acc, p) => {
|
|
43
61
|
const val = position.indexOf(p) > -1 ? "0" : "auto";
|
|
44
62
|
const ret = acc + ` ${p}: ${val};`;
|
|
45
63
|
return ret;
|
|
@@ -72,10 +90,7 @@ function onTime(onAppear, time) {
|
|
|
72
90
|
function hasSuffix(value, suffix) {
|
|
73
91
|
return new RegExp(`/[0-9]${suffix}$/`).test(value);
|
|
74
92
|
}
|
|
75
|
-
function toBr(text
|
|
76
|
-
if (!useNewLine) {
|
|
77
|
-
return text;
|
|
78
|
-
}
|
|
93
|
+
function toBr(text) {
|
|
79
94
|
return text.replace(/\r?\n/g, "<br>");
|
|
80
95
|
}
|
|
81
96
|
function randStr(digit = 8) {
|
|
@@ -89,6 +104,7 @@ const functionOptions = writable({});
|
|
|
89
104
|
const action_id = randStr();
|
|
90
105
|
const state = writable("/");
|
|
91
106
|
const closed = writable(false);
|
|
107
|
+
const maximumZindex = writable(0);
|
|
92
108
|
const send_event = (event_name, values) => {
|
|
93
109
|
var _a;
|
|
94
110
|
const options = get(functionOptions);
|
|
@@ -111,6 +127,11 @@ const isPreview = () => {
|
|
|
111
127
|
const options = get(functionOptions);
|
|
112
128
|
return options == null ? void 0 : options.isPreview;
|
|
113
129
|
};
|
|
130
|
+
const setMiximumZindex = (zindex) => {
|
|
131
|
+
if (!zindex || zindex < get(maximumZindex))
|
|
132
|
+
return;
|
|
133
|
+
maximumZindex.set(zindex);
|
|
134
|
+
};
|
|
114
135
|
const none = () => () => {
|
|
115
136
|
};
|
|
116
137
|
const moveTo = (to) => () => {
|
|
@@ -162,7 +183,8 @@ const AnimationStyles = [
|
|
|
162
183
|
"slide-right"
|
|
163
184
|
];
|
|
164
185
|
const LengthUnits = ["px", "em", "rem", "vw", "fr", "%"];
|
|
165
|
-
const Justifies = ["
|
|
186
|
+
const Justifies = ["flex-start", "center", "flex-end"];
|
|
187
|
+
const Alignments = ["flex-start", "center", "flex-end"];
|
|
166
188
|
const ObjectFits = ["fill", "contain", "cover"];
|
|
167
189
|
const Repeats = ["repeat", "space", "round", "no-repeat"];
|
|
168
190
|
function add_css$6(target) {
|
|
@@ -498,40 +520,37 @@ class Animation extends SvelteComponent {
|
|
|
498
520
|
}
|
|
499
521
|
}
|
|
500
522
|
function add_css$3(target) {
|
|
501
|
-
append_styles(target, "svelte-
|
|
523
|
+
append_styles(target, "svelte-15uvai6", ".modal.svelte-15uvai6{position:absolute;box-sizing:border-box}.close.svelte-15uvai6{position:absolute;display:flex;justify-content:center;align-items:center;background-color:transparent;border:none;cursor:pointer;padding:0;transition:all .25s}.close.svelte-15uvai6:hover{transform:rotate(90deg)}");
|
|
502
524
|
}
|
|
503
525
|
function create_if_block(ctx) {
|
|
504
|
-
let div;
|
|
505
526
|
let button;
|
|
506
527
|
let svg;
|
|
507
528
|
let path;
|
|
529
|
+
let button_style_value;
|
|
508
530
|
let mounted;
|
|
509
531
|
let dispose;
|
|
510
532
|
return {
|
|
511
533
|
c() {
|
|
512
|
-
div = element("div");
|
|
513
534
|
button = element("button");
|
|
514
535
|
svg = svg_element("svg");
|
|
515
536
|
path = svg_element("path");
|
|
516
537
|
attr(path, "d", "M5.78516 4.75L8.73828 1.82422C8.90234 1.66016 8.90234 1.35938 8.73828 1.19531L8.05469 0.511719C7.89062 0.347656 7.58984 0.347656 7.42578 0.511719L4.5 3.46484L1.54688 0.511719C1.38281 0.347656 1.08203 0.347656 0.917969 0.511719L0.234375 1.19531C0.0703125 1.35938 0.0703125 1.66016 0.234375 1.82422L3.1875 4.75L0.234375 7.70312C0.0703125 7.86719 0.0703125 8.16797 0.234375 8.33203L0.917969 9.01562C1.08203 9.17969 1.38281 9.17969 1.54688 9.01562L4.5 6.0625L7.42578 9.01562C7.58984 9.17969 7.89062 9.17969 8.05469 9.01562L8.73828 8.33203C8.90234 8.16797 8.90234 7.86719 8.73828 7.70312L5.78516 4.75Z");
|
|
517
538
|
attr(path, "fill", ctx[1]);
|
|
518
539
|
attr(path, "fill-opacity", "0.8");
|
|
519
|
-
attr(svg, "width", "
|
|
520
|
-
attr(svg, "height", "
|
|
540
|
+
attr(svg, "width", "100%");
|
|
541
|
+
attr(svg, "height", "100%");
|
|
521
542
|
attr(svg, "viewBox", "0 0 9 10");
|
|
522
543
|
attr(svg, "fill", "none");
|
|
523
544
|
attr(svg, "xmlns", "http://www.w3.org/2000/svg");
|
|
524
|
-
attr(button, "class", "svelte-
|
|
525
|
-
attr(
|
|
526
|
-
attr(div, "style", ctx[3]);
|
|
545
|
+
attr(button, "class", "close svelte-15uvai6");
|
|
546
|
+
attr(button, "style", button_style_value = "z-index:" + (ctx[6] + 1) + "; " + ctx[3]);
|
|
527
547
|
},
|
|
528
548
|
m(target, anchor) {
|
|
529
|
-
insert(target,
|
|
530
|
-
append(div, button);
|
|
549
|
+
insert(target, button, anchor);
|
|
531
550
|
append(button, svg);
|
|
532
551
|
append(svg, path);
|
|
533
552
|
if (!mounted) {
|
|
534
|
-
dispose = listen(button, "click", ctx[
|
|
553
|
+
dispose = listen(button, "click", ctx[8]);
|
|
535
554
|
mounted = true;
|
|
536
555
|
}
|
|
537
556
|
},
|
|
@@ -539,13 +558,13 @@ function create_if_block(ctx) {
|
|
|
539
558
|
if (dirty & 2) {
|
|
540
559
|
attr(path, "fill", ctx2[1]);
|
|
541
560
|
}
|
|
542
|
-
if (dirty &
|
|
543
|
-
attr(
|
|
561
|
+
if (dirty & 72 && button_style_value !== (button_style_value = "z-index:" + (ctx2[6] + 1) + "; " + ctx2[3])) {
|
|
562
|
+
attr(button, "style", button_style_value);
|
|
544
563
|
}
|
|
545
564
|
},
|
|
546
565
|
d(detaching) {
|
|
547
566
|
if (detaching)
|
|
548
|
-
detach(
|
|
567
|
+
detach(button);
|
|
549
568
|
mounted = false;
|
|
550
569
|
dispose();
|
|
551
570
|
}
|
|
@@ -559,8 +578,8 @@ function create_fragment$5(ctx) {
|
|
|
559
578
|
let mounted;
|
|
560
579
|
let dispose;
|
|
561
580
|
let if_block = ctx[0] && create_if_block(ctx);
|
|
562
|
-
const default_slot_template = ctx[
|
|
563
|
-
const default_slot = create_slot(default_slot_template, ctx, ctx[
|
|
581
|
+
const default_slot_template = ctx[15].default;
|
|
582
|
+
const default_slot = create_slot(default_slot_template, ctx, ctx[14], null);
|
|
564
583
|
return {
|
|
565
584
|
c() {
|
|
566
585
|
div = element("div");
|
|
@@ -569,10 +588,10 @@ function create_fragment$5(ctx) {
|
|
|
569
588
|
t = space();
|
|
570
589
|
if (default_slot)
|
|
571
590
|
default_slot.c();
|
|
572
|
-
attr(div, "class", "modal svelte-
|
|
591
|
+
attr(div, "class", "modal svelte-15uvai6");
|
|
573
592
|
attr(div, "role", "dialog");
|
|
574
593
|
attr(div, "aria-modal", "true");
|
|
575
|
-
attr(div, "style", div_style_value = "position:" + (ctx[
|
|
594
|
+
attr(div, "style", div_style_value = "position:" + (ctx[7] ? "fixed" : "absolute") + "; " + ctx[5] + " " + ctx[2]);
|
|
576
595
|
},
|
|
577
596
|
m(target, anchor) {
|
|
578
597
|
insert(target, div, anchor);
|
|
@@ -582,10 +601,10 @@ function create_fragment$5(ctx) {
|
|
|
582
601
|
if (default_slot) {
|
|
583
602
|
default_slot.m(div, null);
|
|
584
603
|
}
|
|
585
|
-
ctx[
|
|
604
|
+
ctx[16](div);
|
|
586
605
|
current = true;
|
|
587
606
|
if (!mounted) {
|
|
588
|
-
dispose = listen(window, "keydown", ctx[
|
|
607
|
+
dispose = listen(window, "keydown", ctx[9]);
|
|
589
608
|
mounted = true;
|
|
590
609
|
}
|
|
591
610
|
},
|
|
@@ -603,11 +622,11 @@ function create_fragment$5(ctx) {
|
|
|
603
622
|
if_block = null;
|
|
604
623
|
}
|
|
605
624
|
if (default_slot) {
|
|
606
|
-
if (default_slot.p && (!current || dirty &
|
|
607
|
-
update_slot_base(default_slot, default_slot_template, ctx2, ctx2[
|
|
625
|
+
if (default_slot.p && (!current || dirty & 16384)) {
|
|
626
|
+
update_slot_base(default_slot, default_slot_template, ctx2, ctx2[14], !current ? get_all_dirty_from_scope(ctx2[14]) : get_slot_changes(default_slot_template, ctx2[14], dirty, null), null);
|
|
608
627
|
}
|
|
609
628
|
}
|
|
610
|
-
if (!current || dirty & 36 && div_style_value !== (div_style_value = "position:" + (ctx2[
|
|
629
|
+
if (!current || dirty & 36 && div_style_value !== (div_style_value = "position:" + (ctx2[7] ? "fixed" : "absolute") + "; " + ctx2[5] + " " + ctx2[2])) {
|
|
611
630
|
attr(div, "style", div_style_value);
|
|
612
631
|
}
|
|
613
632
|
},
|
|
@@ -628,7 +647,7 @@ function create_fragment$5(ctx) {
|
|
|
628
647
|
if_block.d();
|
|
629
648
|
if (default_slot)
|
|
630
649
|
default_slot.d(detaching);
|
|
631
|
-
ctx[
|
|
650
|
+
ctx[16](null);
|
|
632
651
|
mounted = false;
|
|
633
652
|
dispose();
|
|
634
653
|
}
|
|
@@ -636,6 +655,8 @@ function create_fragment$5(ctx) {
|
|
|
636
655
|
}
|
|
637
656
|
function instance$5($$self, $$props, $$invalidate) {
|
|
638
657
|
let pos;
|
|
658
|
+
let $maximumZindex;
|
|
659
|
+
component_subscribe($$self, maximumZindex, ($$value) => $$invalidate(6, $maximumZindex = $$value));
|
|
639
660
|
let { $$slots: slots = {}, $$scope } = $$props;
|
|
640
661
|
let { closable = true } = $$props;
|
|
641
662
|
let { closeButtonColor = "#000000" } = $$props;
|
|
@@ -669,19 +690,19 @@ function instance$5($$self, $$props, $$invalidate) {
|
|
|
669
690
|
if ("closeButtonColor" in $$props2)
|
|
670
691
|
$$invalidate(1, closeButtonColor = $$props2.closeButtonColor);
|
|
671
692
|
if ("eventName" in $$props2)
|
|
672
|
-
$$invalidate(
|
|
693
|
+
$$invalidate(10, eventName = $$props2.eventName);
|
|
673
694
|
if ("eventValue" in $$props2)
|
|
674
|
-
$$invalidate(
|
|
695
|
+
$$invalidate(11, eventValue = $$props2.eventValue);
|
|
675
696
|
if ("position" in $$props2)
|
|
676
|
-
$$invalidate(
|
|
697
|
+
$$invalidate(12, position = $$props2.position);
|
|
677
698
|
if ("fixed" in $$props2)
|
|
678
|
-
$$invalidate(
|
|
699
|
+
$$invalidate(13, fixed = $$props2.fixed);
|
|
679
700
|
if ("_style" in $$props2)
|
|
680
701
|
$$invalidate(2, _style = $$props2._style);
|
|
681
702
|
if ("_closeStyle" in $$props2)
|
|
682
703
|
$$invalidate(3, _closeStyle = $$props2._closeStyle);
|
|
683
704
|
if ("$$scope" in $$props2)
|
|
684
|
-
$$invalidate(
|
|
705
|
+
$$invalidate(14, $$scope = $$props2.$$scope);
|
|
685
706
|
};
|
|
686
707
|
$$invalidate(5, pos = getPositionStyle(overwritePosition));
|
|
687
708
|
return [
|
|
@@ -691,6 +712,7 @@ function instance$5($$self, $$props, $$invalidate) {
|
|
|
691
712
|
_closeStyle,
|
|
692
713
|
modal,
|
|
693
714
|
pos,
|
|
715
|
+
$maximumZindex,
|
|
694
716
|
overwriteFixed,
|
|
695
717
|
close,
|
|
696
718
|
handle_keydown,
|
|
@@ -709,10 +731,10 @@ class Modal extends SvelteComponent {
|
|
|
709
731
|
init(this, options, instance$5, create_fragment$5, safe_not_equal, {
|
|
710
732
|
closable: 0,
|
|
711
733
|
closeButtonColor: 1,
|
|
712
|
-
eventName:
|
|
713
|
-
eventValue:
|
|
714
|
-
position:
|
|
715
|
-
fixed:
|
|
734
|
+
eventName: 10,
|
|
735
|
+
eventValue: 11,
|
|
736
|
+
position: 12,
|
|
737
|
+
fixed: 13,
|
|
716
738
|
_style: 2,
|
|
717
739
|
_closeStyle: 3
|
|
718
740
|
}, add_css$3);
|
|
@@ -1249,6 +1271,9 @@ function instance$2($$self, $$props, $$invalidate) {
|
|
|
1249
1271
|
let { y2 } = $$props;
|
|
1250
1272
|
let { z } = $$props;
|
|
1251
1273
|
let { background = "transparent" } = $$props;
|
|
1274
|
+
onMount(() => {
|
|
1275
|
+
setMiximumZindex(z);
|
|
1276
|
+
});
|
|
1252
1277
|
$$self.$$set = ($$props2) => {
|
|
1253
1278
|
if ("x1" in $$props2)
|
|
1254
1279
|
$$invalidate(1, x1 = $$props2.x1);
|
|
@@ -1473,4 +1498,4 @@ class FlexItem extends SvelteComponent {
|
|
|
1473
1498
|
init(this, options, instance, create_fragment, safe_not_equal, { length: 1, _style: 2 }, add_css);
|
|
1474
1499
|
}
|
|
1475
1500
|
}
|
|
1476
|
-
export { AnimationStyles, Directions, Flex, FlexItem, GridItem, GridModalState, Justifies, LengthUnits, MediaQueries, Modal, ObjectFits, PropTypes, Repeats, State, closeApp, closed, finalize, getPositionStyle, handleFocus, handleKeydown, hasSuffix, initialize, isPreview, linkTo, moveTo, none, onScroll, onTime, randStr, send_event, setPreviousFocus, state, toBr };
|
|
1501
|
+
export { Alignments, AnimationStyles, Directions, Flex, FlexItem, GridItem, GridModalState, Justifies, LengthUnits, MediaQueries, Modal, ObjectFits, PropTypes, Repeats, State, closeApp, closed, finalize, getPositionStyle, handleFocus, handleKeydown, hasSuffix, initialize, isPreview, linkTo, maximumZindex, moveTo, none, onScroll, onTime, randStr, send_event, setMiximumZindex, setPreviousFocus, state, toBr };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@plaidev/karte-action-sdk",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.18",
|
|
4
4
|
"author": "Plaid Inc.",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"main": "dist/index.cjs.js",
|
|
@@ -16,11 +16,13 @@
|
|
|
16
16
|
"types": "./dist/index.d.ts"
|
|
17
17
|
},
|
|
18
18
|
"./package.json": "./package.json",
|
|
19
|
+
"./src/*": "./src/*",
|
|
19
20
|
"./dist/*": "./dist/*"
|
|
20
21
|
},
|
|
21
22
|
"files": [
|
|
22
23
|
"dist",
|
|
23
24
|
"index.mjs",
|
|
25
|
+
"src",
|
|
24
26
|
"README.md",
|
|
25
27
|
"LICENSE"
|
|
26
28
|
],
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
<slot />
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
import { onMount } from 'svelte';
|
|
3
|
+
import { setMiximumZindex } from './functions';
|
|
4
|
+
|
|
5
|
+
export let x1: number;
|
|
6
|
+
export let x2: number;
|
|
7
|
+
export let y1: number;
|
|
8
|
+
export let y2: number;
|
|
9
|
+
export let z: number;
|
|
10
|
+
export let background = 'transparent';
|
|
11
|
+
$: _style = [
|
|
12
|
+
`grid-area: ${y1 + 1} / ${x1 + 1} / ${y2 + 2} / ${x2 + 2}`,
|
|
13
|
+
`z-index: ${z}`,
|
|
14
|
+
`background: ${background}`,
|
|
15
|
+
'display: grid',
|
|
16
|
+
'place-items: center',
|
|
17
|
+
].join(';');
|
|
18
|
+
|
|
19
|
+
onMount(() => {
|
|
20
|
+
setMiximumZindex(z);
|
|
21
|
+
});
|
|
22
|
+
</script>
|
|
23
|
+
|
|
24
|
+
<div class="grid-item" style={_style}>
|
|
25
|
+
<slot />
|
|
26
|
+
</div>
|
|
27
|
+
|
|
28
|
+
<style>
|
|
29
|
+
.grid-item {
|
|
30
|
+
word-break: break-all;
|
|
31
|
+
}
|
|
32
|
+
</style>
|