@plaidev/karte-action-sdk
Advanced tools
Comparing version 1.0.22 to 1.0.23
@@ -13,7 +13,7 @@ /** | ||
declare const maximumZindex: Writable<number>; | ||
declare const initialize: (options?: OPTIONS) => () => void; | ||
declare const finalize: () => void; | ||
declare const send_event: (event_name: string, values?: any) => void; | ||
declare const initialize: (options?: OPTIONS) => void; | ||
declare const finalize: () => void; | ||
declare const isPreview: () => boolean; | ||
declare const setMiximumZindex: (zindex: number | undefined) => void; | ||
declare const setMiximumZindex: (zindex?: number) => void; | ||
// eslint-disable-next-line @typescript-eslint/no-empty-function | ||
@@ -34,5 +34,5 @@ declare const none: () => () => void; | ||
type ModalPosition = "top-left" | "top-center" | "top-right" | "center-left" | "center" | "center-right" | "bottom-left" | "bottom-center" | "bottom-right" | "none"; | ||
declare const getPositionStyle: (position: ModalPosition | string) => string; | ||
declare function onScroll(onAppear: Function, rate: number): () => void; | ||
declare function onTime(onAppear: Function, time: number): () => void; | ||
declare const getPositionStyle: (position: ModalPosition) => string; | ||
declare function onScroll(fn: Function, rate: number): () => void; | ||
declare function onTime(fn: Function, time: number): () => void; | ||
declare function hasSuffix<Suffix extends "px" | "em" | "rem" | "%" | "fr" | "vw" | "vh" | "">(value: string, suffix: Suffix): value is `${number}${Suffix}`; | ||
@@ -121,3 +121,3 @@ declare function toBr(text: string): string; | ||
type StateName = string; | ||
export { state, closed, maximumZindex, send_event, initialize, finalize, isPreview, setMiximumZindex, none, moveTo, linkTo, closeApp, _default, handleFocus, setPreviousFocus, handleKeydown, ModalPosition, getPositionStyle, onScroll, onTime, hasSuffix, toBr, randStr, PropTypes, PropType, Code, MediaQueries, MediaQuery, Directions, Direction, AnimationStyles, AnimationStyle, LongText, Url, Image, LengthUnits, LengthUnit, Length, Color, Justifies, Justify, Alignments, Alignment, ObjectFits, ObjectFit, Repeats, Repeat, Style, StateName }; | ||
export { state, closed, maximumZindex, initialize, finalize, send_event, isPreview, setMiximumZindex, none, moveTo, linkTo, closeApp, _default, handleFocus, setPreviousFocus, handleKeydown, ModalPosition, getPositionStyle, onScroll, onTime, hasSuffix, toBr, randStr, PropTypes, PropType, Code, MediaQueries, MediaQuery, Directions, Direction, AnimationStyles, AnimationStyle, LongText, Url, Image, LengthUnits, LengthUnit, Length, Color, Justifies, Justify, Alignments, Alignment, ObjectFits, ObjectFit, Repeats, Repeat, Style, StateName }; | ||
export { default as State } from './State.svelte'; | ||
@@ -124,0 +124,0 @@ export { default as GridModalState } from './GridModalState.svelte'; |
1679
dist/index.es.js
@@ -1,1 +0,1678 @@ | ||
import{writable as e,get as t}from"svelte/store";import{SvelteComponent as n,init as o,safe_not_equal as s,append_styles as l,create_slot as i,create_component as r,space as a,mount_component as c,insert as d,update_slot_base as u,get_all_dirty_from_scope as m,get_slot_changes as p,transition_in as $,transition_out as f,destroy_component as g,detach as h,empty as y,group_outros as v,check_outros as b,component_subscribe as x,element as w,attr as k,listen as _,noop as C,null_to_empty as S,svg_element as L,append as O,binding_callbacks as N}from"svelte/internal";import{createEventDispatcher as j,onDestroy as E,onMount as z,setContext as B,getContext as A}from"svelte";const T=e=>t=>{if(e){const n=e.querySelectorAll("*"),o=Array.from(n).filter((e=>e.tabIndex>=0));let s=o.indexOf(document.activeElement);-1===s&&t.shiftKey&&(s=0),s+=o.length+(t.shiftKey?-1:1),s%=o.length,o[s].focus(),t.preventDefault()}},q=()=>{const e="undefined"!=typeof document&&document.activeElement;e&&e?.focus()},V=e=>t=>{e[t.key]&&e[t.key](t)},I=e=>"top-center"===e?"top: 0; right: 50%; transform: translate(+50%, 0%);":"top-left"===e?"top: 0; left: 0; transform: translate(0%, 0%);":"top-right"===e?"top: 0; right: 0; transform: translate(0%, 0%);":"center-left"===e?"top: 50%; left: 0; transform: translate(0%, -50%);":"center"===e?"top: 50%; left: 50%; transform: translate(-50%, -50%);":"center-right"===e?"top: 50%; right: 0; transform: translate(0%, -50%);":"bottom-left"===e?"bottom: 0; left: 0; transform: translate(0%, 0%);":"bottom-center"===e?"bottom: 0; left: 50%; transform: translate(-50%, 0%);":"bottom-right"===e?"bottom: 0; right: 0; transform: translate(0%, 0);":"none"===e?"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(((t,n)=>t+` ${n}: ${e.indexOf(n)>-1?"0":"auto"};`),"");function K(e,t){const n=document.querySelector("body"),o=new IntersectionObserver((t=>{for(const s of t)if(!s.isIntersecting){e()||o.unobserve(n)}}),{root:null,threshold:1-t,rootMargin:"-100% 0px 100% 0px"});return o.observe(n),()=>o&&o.unobserve(n)}function M(e,t){const n=setTimeout(e,t);return()=>n&&clearTimeout(n)}function D(e,t){return new RegExp(`/[0-9]${t}$/`).test(e)}function R(e){return e.replace(/\r?\n/g,"<br>")}function P(e=8){return Math.random().toString(32).substring(e)}const F="KARTE_ALL_ACTION_ID",G="KARTE-ACTION-CHANGE-STATE",H=e({}),U=P(),Z=e("/"),J=e(!1),Q=e(0),W=(e,n)=>{t(H)?.send?.(e,n)},X=e=>{e.detail.action_id!==U&&e.detail.action_id!==F||Z.set(e.detail.to)},Y=e=>{window.addEventListener(G,X),e.initialState&&Z.set(e.initialState),J.set(!1),H.set(e??{})},ee=()=>{window.removeEventListener(G,X)},te=()=>t(H)?.isPreview,ne=e=>{!e||e<t(Q)||Q.set(e)},oe=()=>()=>{},se=e=>()=>{W("_message_state_changed",{state:e}),window.dispatchEvent(new CustomEvent(G,{detail:{to:e,action_id:U}}))},le=(e,t=!0)=>()=>{W("message_click",{url:e}),t?window.open(e):location.href=e},ie=()=>()=>{W("message_close",null),J.set(!0)},re=["BooleanKeyword","NumberKeyword","StringKeyword","Function","Enum","Code","Direction","Url","Image","AnimationStyle","LongText","Length","Color","Alignment","Style"],ae={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*)"},ce=["row","column"],de=["none","fade","bounce","slide-down","slide-up","slide-left","slide-right"],ue=["px","em","rem","vw","fr","%"],me=["flex-start","center","flex-end"],pe=["flex-start","center","flex-end"],$e=["fill","contain","cover"],fe=["repeat","space","round","no-repeat"];function ge(e){l(e,"svelte-zmz1k7","@import 'https://cdn.skypack.dev/normalize.css';")}class he extends n{constructor(e){super(),o(this,e,null,null,s,{},ge)}}function ye(e){let t,n,o;t=new he({});const s=e[1].default,l=i(s,e,e[0],null);return{c(){r(t.$$.fragment),n=a(),l&&l.c()},m(e,s){c(t,e,s),d(e,n,s),l&&l.m(e,s),o=!0},p(e,[t]){l&&l.p&&(!o||1&t)&&u(l,s,e,e[0],o?p(s,e[0],t,null):m(e[0]),null)},i(e){o||($(t.$$.fragment,e),$(l,e),o=!0)},o(e){f(t.$$.fragment,e),f(l,e),o=!1},d(e){g(t,e),e&&h(n),l&&l.d(e)}}}function ve(e,t,n){let{$$slots:o={},$$scope:s}=t;return e.$$set=e=>{"$$scope"in e&&n(0,s=e.$$scope)},[s,o]}class be extends n{constructor(e){super(),o(this,e,ve,ye,s,{})}}function xe(e){let t;const n=e[3].default,o=i(n,e,e[2],null);return{c(){o&&o.c()},m(e,n){o&&o.m(e,n),t=!0},p(e,s){o&&o.p&&(!t||4&s)&&u(o,n,e,e[2],t?p(n,e[2],s,null):m(e[2]),null)},i(e){t||($(o,e),t=!0)},o(e){f(o,e),t=!1},d(e){o&&o.d(e)}}}function we(e){let t,n,o=e[1]===e[0]&&xe(e);return{c(){o&&o.c(),t=y()},m(e,s){o&&o.m(e,s),d(e,t,s),n=!0},p(e,[n]){e[1]===e[0]?o?(o.p(e,n),3&n&&$(o,1)):(o=xe(e),o.c(),$(o,1),o.m(t.parentNode,t)):o&&(v(),f(o,1,1,(()=>{o=null})),b())},i(e){n||($(o),n=!0)},o(e){f(o),n=!1},d(e){o&&o.d(e),e&&h(t)}}}function ke(e,t,n){let o;x(e,Z,(e=>n(1,o=e)));let{$$slots:s={},$$scope:l}=t,{path:i}=t;return e.$$set=e=>{"path"in e&&n(0,i=e.path),"$$scope"in e&&n(2,l=e.$$scope)},[i,o,l,s]}class _e extends n{constructor(e){super(),o(this,e,ke,we,s,{path:0})}}function Ce(e){l(e,"svelte-1h4b6e3",".background.svelte-1h4b6e3{position:fixed;top:0;left:0;width:100%;height:100%;background:rgba(0, 0, 0, 0.3)}")}function Se(e){let t,n,o;return{c(){t=w("div"),k(t,"class","background svelte-1h4b6e3")},m(s,l){d(s,t,l),n||(o=_(t,"click",e[2]),n=!0)},p:C,d(e){e&&h(t),n=!1,o()}}}function Le(e){let t,n=e[0]&&Se(e);return{c(){n&&n.c(),t=y()},m(e,o){n&&n.m(e,o),d(e,t,o)},p(e,[o]){e[0]?n?n.p(e,o):(n=Se(e),n.c(),n.m(t.parentNode,t)):n&&(n.d(1),n=null)},i:C,o:C,d(e){n&&n.d(e),e&&h(t)}}}function Oe(e,t,n){let{backgroundOverray:o=!1}=t;const s=j();return e.$$set=e=>{"backgroundOverray"in e&&n(0,o=e.backgroundOverray)},[o,s,()=>s("click")]}class Ne extends n{constructor(e){super(),o(this,e,Oe,Le,s,{backgroundOverray:0},Ce)}}function je(e){l(e,"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 Ee(e){let t,n;const o=e[3].default,s=i(o,e,e[2],null);return{c(){t=w("div"),s&&s.c(),k(t,"class",S(e[0])+" svelte-sa0cac")},m(e,o){d(e,t,o),s&&s.m(t,null),n=!0},p(e,[t]){s&&s.p&&(!n||4&t)&&u(s,o,e,e[2],n?p(o,e[2],t,null):m(e[2]),null)},i(e){n||($(s,e),n=!0)},o(e){f(s,e),n=!1},d(e){e&&h(t),s&&s.d(e)}}}function ze(e,t,n){let{$$slots:o={},$$scope:s}=t,{animation:l="none"}=t;const i=te()?"none":l;return e.$$set=e=>{"animation"in e&&n(1,l=e.animation),"$$scope"in e&&n(2,s=e.$$scope)},[i,l,s,o]}class Be extends n{constructor(e){super(),o(this,e,ze,Ee,s,{animation:1},je)}}function Ae(e){l(e,"svelte-l1jnqm",".modal.svelte-l1jnqm{position:absolute;box-sizing:border-box;z-index:2147483647}.close.svelte-l1jnqm{position:absolute;display:flex;justify-content:center;align-items:center;background-color:transparent;border:none;cursor:pointer;padding:0;transition:all .25s}.close.svelte-l1jnqm:hover{transform:rotate(90deg)}")}function Te(e){let t,n,o,s,l,i;return{c(){t=w("button"),n=L("svg"),o=L("path"),k(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"),k(o,"fill",e[1]),k(o,"fill-opacity","0.8"),k(n,"width","100%"),k(n,"height","100%"),k(n,"viewBox","0 0 9 10"),k(n,"fill","none"),k(n,"xmlns","http://www.w3.org/2000/svg"),k(t,"class","close svelte-l1jnqm"),k(t,"style",s="z-index:"+(e[6]+1)+"; "+e[3])},m(s,r){d(s,t,r),O(t,n),O(n,o),l||(i=_(t,"click",e[8]),l=!0)},p(e,n){2&n&&k(o,"fill",e[1]),72&n&&s!==(s="z-index:"+(e[6]+1)+"; "+e[3])&&k(t,"style",s)},d(e){e&&h(t),l=!1,i()}}}function qe(e){let t,n,o,s,l,r,c=e[0]&&Te(e);const g=e[15].default,y=i(g,e,e[14],null);return{c(){t=w("div"),c&&c.c(),n=a(),y&&y.c(),k(t,"class","modal svelte-l1jnqm"),k(t,"role","dialog"),k(t,"aria-modal","true"),k(t,"style",o="position:"+(e[7]?"fixed":"absolute")+"; "+e[5]+" "+e[2])},m(o,i){d(o,t,i),c&&c.m(t,null),O(t,n),y&&y.m(t,null),e[16](t),s=!0,l||(r=_(window,"keydown",e[9]),l=!0)},p(e,[l]){e[0]?c?c.p(e,l):(c=Te(e),c.c(),c.m(t,n)):c&&(c.d(1),c=null),y&&y.p&&(!s||16384&l)&&u(y,g,e,e[14],s?p(g,e[14],l,null):m(e[14]),null),(!s||36&l&&o!==(o="position:"+(e[7]?"fixed":"absolute")+"; "+e[5]+" "+e[2]))&&k(t,"style",o)},i(e){s||($(y,e),s=!0)},o(e){f(y,e),s=!1},d(n){n&&h(t),c&&c.d(),y&&y.d(n),e[16](null),l=!1,r()}}}function Ve(e,t,n){let o,s;x(e,Q,(e=>n(6,s=e)));let{$$slots:l={},$$scope:i}=t,{closable:r=!0}=t,{closeButtonColor:a="#000000"}=t,{eventName:c=""}=t,{eventValue:d=null}=t,{position:u="center"}=t;const m=te()?"center":u;let{fixed:p=!1}=t;const $=!te()&&p;let{_style:f=""}=t,{_closeStyle:g=""}=t;const h=j(),y=()=>{c&&W(c,d),h("close")};let v=null;const b=V({Escape:y,Tab:T(v)});return E((()=>q())),e.$$set=e=>{"closable"in e&&n(0,r=e.closable),"closeButtonColor"in e&&n(1,a=e.closeButtonColor),"eventName"in e&&n(10,c=e.eventName),"eventValue"in e&&n(11,d=e.eventValue),"position"in e&&n(12,u=e.position),"fixed"in e&&n(13,p=e.fixed),"_style"in e&&n(2,f=e._style),"_closeStyle"in e&&n(3,g=e._closeStyle),"$$scope"in e&&n(14,i=e.$$scope)},n(5,o=I(m)),[r,a,f,g,v,o,s,$,y,b,c,d,u,p,i,l,function(e){N[e?"unshift":"push"]((()=>{v=e,n(4,v)}))}]}class Ie extends n{constructor(e){super(),o(this,e,Ve,qe,s,{closable:0,closeButtonColor:1,eventName:10,eventValue:11,position:12,fixed:13,_style:2,_closeStyle:3},Ae)}}function Ke(e){let t,n;const o=e[8].default,s=i(o,e,e[7],null);return{c(){t=w("div"),s&&s.c(),k(t,"class","grid"),k(t,"style",e[0])},m(e,o){d(e,t,o),s&&s.m(t,null),n=!0},p(e,[l]){s&&s.p&&(!n||128&l)&&u(s,o,e,e[7],n?p(o,e[7],l,null):m(e[7]),null),(!n||1&l)&&k(t,"style",e[0])},i(e){n||($(s,e),n=!0)},o(e){f(s,e),n=!1},d(e){e&&h(t),s&&s.d(e)}}}function Me(e,t,n){let o,{$$slots:s={},$$scope:l}=t,{width:i="512px"}=t,{height:r="256px"}=t,{rows:a}=t,{columns:c}=t,{gap:d="0px"}=t,{background:u="transparent"}=t;const m=e=>"number"==typeof e?`repeat(${e}, 1fr)`:e.join(" ");return e.$$set=e=>{"width"in e&&n(1,i=e.width),"height"in e&&n(2,r=e.height),"rows"in e&&n(3,a=e.rows),"columns"in e&&n(4,c=e.columns),"gap"in e&&n(5,d=e.gap),"background"in e&&n(6,u=e.background),"$$scope"in e&&n(7,l=e.$$scope)},e.$$.update=()=>{126&e.$$.dirty&&n(0,o=["display: grid",`grid-template-rows: ${m(a)}`,`grid-template-columns: ${m(c)}`,`gap: ${d}`,`background: ${u}`,`width: ${i}`,`height: ${r};`].join(";"))},[o,i,r,a,c,d,u,l,s]}class De extends n{constructor(e){super(),o(this,e,Me,Ke,s,{width:1,height:2,rows:3,columns:4,gap:5,background:6})}}function Re(e){let t;const n=e[18].default,o=i(n,e,e[19],null);return{c(){o&&o.c()},m(e,n){o&&o.m(e,n),t=!0},p(e,s){o&&o.p&&(!t||524288&s)&&u(o,n,e,e[19],t?p(n,e[19],s,null):m(e[19]),null)},i(e){t||($(o,e),t=!0)},o(e){f(o,e),t=!1},d(e){o&&o.d(e)}}}function Pe(e){let t,n;return t=new De({props:{width:e[9],height:e[10],rows:e[11],columns:e[12],gap:e[13],background:e[14],$$slots:{default:[Re]},$$scope:{ctx:e}}}),{c(){r(t.$$.fragment)},m(e,o){c(t,e,o),n=!0},p(e,n){const o={};512&n&&(o.width=e[9]),1024&n&&(o.height=e[10]),2048&n&&(o.rows=e[11]),4096&n&&(o.columns=e[12]),8192&n&&(o.gap=e[13]),16384&n&&(o.background=e[14]),524288&n&&(o.$$scope={dirty:n,ctx:e}),t.$set(o)},i(e){n||($(t.$$.fragment,e),n=!0)},o(e){f(t.$$.fragment,e),n=!1},d(e){g(t,e)}}}function Fe(e){let t,n;return t=new Ie({props:{closable:e[3],closeButtonColor:e[4],_closeStyle:e[8],position:e[5],fixed:e[6],_style:e[7],$$slots:{default:[Pe]},$$scope:{ctx:e}}}),t.$on("close",e[15]),{c(){r(t.$$.fragment)},m(e,o){c(t,e,o),n=!0},p(e,n){const o={};8&n&&(o.closable=e[3]),16&n&&(o.closeButtonColor=e[4]),256&n&&(o._closeStyle=e[8]),32&n&&(o.position=e[5]),64&n&&(o.fixed=e[6]),128&n&&(o._style=e[7]),556544&n&&(o.$$scope={dirty:n,ctx:e}),t.$set(o)},i(e){n||($(t.$$.fragment,e),n=!0)},o(e){f(t.$$.fragment,e),n=!1},d(e){g(t,e)}}}function Ge(e){let t,n,o,s;return t=new Ne({props:{backgroundOverray:e[2]}}),t.$on("click",e[15]),o=new Be({props:{animation:e[1],$$slots:{default:[Fe]},$$scope:{ctx:e}}}),{c(){r(t.$$.fragment),n=a(),r(o.$$.fragment)},m(e,l){c(t,e,l),d(e,n,l),c(o,e,l),s=!0},p(e,n){const s={};4&n&&(s.backgroundOverray=e[2]),t.$set(s);const l={};2&n&&(l.animation=e[1]),557048&n&&(l.$$scope={dirty:n,ctx:e}),o.$set(l)},i(e){s||($(t.$$.fragment,e),$(o.$$.fragment,e),s=!0)},o(e){f(t.$$.fragment,e),f(o.$$.fragment,e),s=!1},d(e){g(t,e),e&&h(n),g(o,e)}}}function He(e){let t,n;return t=new _e({props:{path:e[0],$$slots:{default:[Ge]},$$scope:{ctx:e}}}),{c(){r(t.$$.fragment)},m(e,o){c(t,e,o),n=!0},p(e,[n]){const o={};1&n&&(o.path=e[0]),557054&n&&(o.$$scope={dirty:n,ctx:e}),t.$set(o)},i(e){n||($(t.$$.fragment,e),n=!0)},o(e){f(t.$$.fragment,e),n=!1},d(e){g(t,e)}}}function Ue(e,t,n){let{$$slots:o={},$$scope:s}=t,{path:l}=t,{animation:i="none"}=t,{backgroundOverray:r=!1}=t,{closable:a=!0}=t,{closeButtonColor:c="#000000"}=t,{eventName:d=""}=t,{eventValue:u=null}=t,{position:m="center"}=t,{fixed:p=!1}=t,{_modalStyle:$=""}=t,{_closeStyle:f=""}=t,{width:g="512px"}=t,{height:h="256px"}=t,{rows:y}=t,{columns:v}=t,{gap:b="0px"}=t,{background:x="transparent"}=t;const w=j();return e.$$set=e=>{"path"in e&&n(0,l=e.path),"animation"in e&&n(1,i=e.animation),"backgroundOverray"in e&&n(2,r=e.backgroundOverray),"closable"in e&&n(3,a=e.closable),"closeButtonColor"in e&&n(4,c=e.closeButtonColor),"eventName"in e&&n(16,d=e.eventName),"eventValue"in e&&n(17,u=e.eventValue),"position"in e&&n(5,m=e.position),"fixed"in e&&n(6,p=e.fixed),"_modalStyle"in e&&n(7,$=e._modalStyle),"_closeStyle"in e&&n(8,f=e._closeStyle),"width"in e&&n(9,g=e.width),"height"in e&&n(10,h=e.height),"rows"in e&&n(11,y=e.rows),"columns"in e&&n(12,v=e.columns),"gap"in e&&n(13,b=e.gap),"background"in e&&n(14,x=e.background),"$$scope"in e&&n(19,s=e.$$scope)},[l,i,r,a,c,m,p,$,f,g,h,y,v,b,x,()=>{d&&W(d,u),w("close")},d,u,o,s]}class Ze extends n{constructor(e){super(),o(this,e,Ue,He,s,{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 Je(e){l(e,"svelte-g0rfgr",".grid-item.svelte-g0rfgr{word-break:break-all}")}function Qe(e){let t,n;const o=e[8].default,s=i(o,e,e[7],null);return{c(){t=w("div"),s&&s.c(),k(t,"class","grid-item svelte-g0rfgr"),k(t,"style",e[0])},m(e,o){d(e,t,o),s&&s.m(t,null),n=!0},p(e,[l]){s&&s.p&&(!n||128&l)&&u(s,o,e,e[7],n?p(o,e[7],l,null):m(e[7]),null),(!n||1&l)&&k(t,"style",e[0])},i(e){n||($(s,e),n=!0)},o(e){f(s,e),n=!1},d(e){e&&h(t),s&&s.d(e)}}}function We(e,t,n){let o,{$$slots:s={},$$scope:l}=t,{x1:i}=t,{x2:r}=t,{y1:a}=t,{y2:c}=t,{z:d}=t,{background:u="transparent"}=t;return z((()=>{ne(d)})),e.$$set=e=>{"x1"in e&&n(1,i=e.x1),"x2"in e&&n(2,r=e.x2),"y1"in e&&n(3,a=e.y1),"y2"in e&&n(4,c=e.y2),"z"in e&&n(5,d=e.z),"background"in e&&n(6,u=e.background),"$$scope"in e&&n(7,l=e.$$scope)},e.$$.update=()=>{126&e.$$.dirty&&n(0,o=[`grid-area: ${a+1} / ${i+1} / ${c+2} / ${r+2}`,`z-index: ${d}`,`background: ${u}`,"display: grid","place-items: center"].join(";"))},[o,i,r,a,c,d,u,l,s]}class Xe extends n{constructor(e){super(),o(this,e,We,Qe,s,{x1:1,x2:2,y1:3,y2:4,z:5,background:6},Je)}}function Ye(e){l(e,"svelte-1e71ejc",".flex.svelte-1e71ejc{display:flex}")}function et(e){let t,n,o;const s=e[5].default,l=i(s,e,e[4],null);return{c(){t=w("div"),l&&l.c(),k(t,"class","flex svelte-1e71ejc"),k(t,"style",n="width:"+e[1]+"; height:"+e[2]+"; flex-direction:"+e[0]+"; "+e[3])},m(e,n){d(e,t,n),l&&l.m(t,null),o=!0},p(e,[i]){l&&l.p&&(!o||16&i)&&u(l,s,e,e[4],o?p(s,e[4],i,null):m(e[4]),null),(!o||15&i&&n!==(n="width:"+e[1]+"; height:"+e[2]+"; flex-direction:"+e[0]+"; "+e[3]))&&k(t,"style",n)},i(e){o||($(l,e),o=!0)},o(e){f(l,e),o=!1},d(e){e&&h(t),l&&l.d(e)}}}function tt(e,t,n){let{$$slots:o={},$$scope:s}=t,{direction:l="row"}=t,{width:i="100%"}=t,{height:r="100%"}=t,{_style:a=""}=t;return B("action-sdk:flex",{direction:l}),e.$$set=e=>{"direction"in e&&n(0,l=e.direction),"width"in e&&n(1,i=e.width),"height"in e&&n(2,r=e.height),"_style"in e&&n(3,a=e._style),"$$scope"in e&&n(4,s=e.$$scope)},[l,i,r,a,s,o]}class nt extends n{constructor(e){super(),o(this,e,tt,et,s,{direction:0,width:1,height:2,_style:3},Ye)}}function ot(e){l(e,"svelte-1p0bk1x",".flex-item.svelte-1p0bk1x{max-width:100%;max-height:100%;position:relative;isolation:isolate}")}function st(e){let t,n;const o=e[4].default,s=i(o,e,e[3],null);return{c(){t=w("div"),s&&s.c(),k(t,"class","flex-item svelte-1p0bk1x"),k(t,"style",e[0])},m(e,o){d(e,t,o),s&&s.m(t,null),n=!0},p(e,[l]){s&&s.p&&(!n||8&l)&&u(s,o,e,e[3],n?p(o,e[3],l,null):m(e[3]),null),(!n||1&l)&&k(t,"style",e[0])},i(e){n||($(s,e),n=!0)},o(e){f(s,e),n=!1},d(e){e&&h(t),s&&s.d(e)}}}function lt(e,t,n){let{$$slots:o={},$$scope:s}=t,{length:l}=t,{_style:i=""}=t;const r=A("action-sdk:flex");let a;return e.$$set=e=>{"length"in e&&n(1,l=e.length),"_style"in e&&n(2,i=e._style),"$$scope"in e&&n(3,s=e.$$scope)},e.$$.update=()=>{if(6&e.$$.dirty){let e="";D(l,"px")?"row"===r.direction?e=`width: ${l}; height: 100%;`:"column"===r.direction&&(e=`width: 100%; height: ${l};`):"row"===r.direction?e=`height: 100%; flex-grow: ${l}; flex-basis: 0;`:"column"===r.direction&&(e=`width: 100%; flex-grow: ${l}; flex-basis: 0;`),n(0,a=e+i)}},[a,l,i,s,o]}class it extends n{constructor(e){super(),o(this,e,lt,st,s,{length:1,_style:2},ot)}}export{pe as Alignments,de as AnimationStyles,ce as Directions,nt as Flex,it as FlexItem,Xe as GridItem,Ze as GridModalState,me as Justifies,ue as LengthUnits,ae as MediaQueries,Ie as Modal,$e as ObjectFits,re as PropTypes,fe as Repeats,be as State,ie as closeApp,J as closed,ee as finalize,I as getPositionStyle,T as handleFocus,V as handleKeydown,D as hasSuffix,Y as initialize,te as isPreview,le as linkTo,Q as maximumZindex,se as moveTo,oe as none,K as onScroll,M as onTime,P as randStr,W as send_event,ne as setMiximumZindex,q as setPreviousFocus,Z as state,R as toBr}; | ||
import { writable, get } from 'svelte/store'; | ||
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'; | ||
import { createEventDispatcher, onDestroy, onMount, setContext, getContext } from 'svelte'; | ||
/** | ||
* 内部的に使われている、UIから選択できない関数 | ||
*/ | ||
const handleFocus = (node) => (e) => { | ||
if (node) { | ||
// trap focus | ||
const nodes = node.querySelectorAll('*'); | ||
const tabbable = Array.from(nodes).filter((n) => n.tabIndex >= 0); | ||
let index = tabbable.indexOf(document.activeElement); | ||
if (index === -1 && e.shiftKey) | ||
index = 0; | ||
index += tabbable.length + (e.shiftKey ? -1 : 1); | ||
index %= tabbable.length; | ||
tabbable[index].focus(); | ||
e.preventDefault(); | ||
} | ||
}; | ||
const setPreviousFocus = () => { | ||
const previously_focused = typeof document !== 'undefined' && document.activeElement; | ||
if (previously_focused) { | ||
previously_focused?.focus(); | ||
} | ||
}; | ||
const handleKeydown = (handlers) => (e) => { | ||
if (handlers[e.key]) { | ||
handlers[e.key](e); | ||
} | ||
}; | ||
const POSITION_STYLES = { | ||
'top-center': 'top: 0; right: 50%; transform: translate(+50%, 0%);', | ||
'top-left': 'top: 0; left: 0; transform: translate(0%, 0%);', | ||
'top-right': 'top: 0; right: 0; transform: translate(0%, 0%);', | ||
'center-left': 'top: 50%; left: 0; transform: translate(0%, -50%);', | ||
center: 'top: 50%; left: 50%; transform: translate(-50%, -50%);', | ||
'center-right': 'top: 50%; right: 0; transform: translate(0%, -50%);', | ||
'bottom-left': 'bottom: 0; left: 0; transform: translate(0%, 0%);', | ||
'bottom-center': 'bottom: 0; left: 50%; transform: translate(-50%, 0%);', | ||
'bottom-right': 'bottom: 0; right: 0; transform: translate(0%, 0);', | ||
none: 'top: 0; bottom: 0; right: 0; left: 0;', | ||
}; | ||
const getPositionStyle = (position) => { | ||
const style = POSITION_STYLES[position]; | ||
if (style != null) { | ||
return style; | ||
} | ||
// TODO: 以下の実装は、getPositionStyle から切り離して、別のAPIとして実装すべき | ||
return [ | ||
'top-left', | ||
'top-center', | ||
'top-right', | ||
'center-left', | ||
'center', | ||
'center-right', | ||
'bottom-left', | ||
'bottom-center', | ||
'bottom-right', | ||
] | ||
.reduce((acc, p) => { | ||
const val = position.indexOf(p) > -1 ? '0' : 'auto'; | ||
const ret = acc + ` ${p}: ${val};`; | ||
return ret; | ||
}, '') | ||
.trimStart(); | ||
}; | ||
function onScroll(fn, rate) { | ||
const target = document.querySelector('body'); | ||
// TBD ページが長いときの対策 | ||
const intersection = { | ||
root: null, | ||
threshold: 1 - rate, | ||
rootMargin: '-100% 0px 100% 0px', | ||
}; | ||
const observer = new IntersectionObserver(changes => { | ||
for (const change of changes) { | ||
if (!change.isIntersecting) { | ||
const repeat = fn(); | ||
if (!repeat) { | ||
observer.unobserve(target); | ||
} | ||
} | ||
} | ||
}, intersection); | ||
observer.observe(target); | ||
return () => observer && observer.unobserve(target); | ||
} | ||
function onTime(fn, time) { | ||
const timeoutHandler = setTimeout(fn, time); | ||
return () => timeoutHandler && clearTimeout(timeoutHandler); | ||
} | ||
function hasSuffix(value, suffix) { | ||
return new RegExp(`[0-9]${suffix}$`).test(value); | ||
} | ||
function toBr(text) { | ||
return text.replace(/\r?\n/g, '<br>'); | ||
} | ||
function randStr(digit = 8) { | ||
return Math.random().toString(32).substring(digit); | ||
} | ||
const CONSTANTS = { | ||
ALL_ACTION_ID: 'KARTE_ALL_ACTION_ID', | ||
STATE_EVENT: 'KARTE-ACTION-CHANGE-STATE', | ||
}; | ||
const functionOptions = writable({}); | ||
const action_id = randStr(); | ||
const state = writable('/'); | ||
const closed = writable(false); | ||
const maximumZindex = writable(0); | ||
const setState = (event) => { | ||
if (event.detail.action_id === action_id || event.detail.action_id === CONSTANTS.ALL_ACTION_ID) { | ||
state.set(event.detail.to); | ||
} | ||
}; | ||
const initialize = (options) => { | ||
window.addEventListener(CONSTANTS.STATE_EVENT, setState); | ||
if (options?.initialState) { | ||
state.set(options?.initialState); | ||
} | ||
closed.set(false); | ||
functionOptions.set(options ?? {}); | ||
return () => finalize(); | ||
}; | ||
const finalize = () => { | ||
window.removeEventListener(CONSTANTS.STATE_EVENT, setState); | ||
}; | ||
const send_event = (event_name, values) => { | ||
const options = get(functionOptions); | ||
options?.send?.(event_name, values); | ||
}; | ||
const isPreview = () => { | ||
const options = get(functionOptions); | ||
return !!options?.isPreview; | ||
}; | ||
const setMiximumZindex = (zindex) => { | ||
if (!zindex || zindex < get(maximumZindex)) | ||
return; | ||
maximumZindex.set(zindex); | ||
}; | ||
// eslint-disable-next-line @typescript-eslint/no-empty-function | ||
const none = () => () => { }; | ||
const moveTo = (to) => () => { | ||
send_event('_message_state_changed', { state: to }); | ||
window.dispatchEvent(new CustomEvent(CONSTANTS.STATE_EVENT, { detail: { to, action_id } })); | ||
}; | ||
const linkTo = (to, targetBlank = true) => () => { | ||
send_event('message_click', { url: to }); | ||
if (targetBlank) { | ||
window.open(to); | ||
} | ||
else { | ||
location.href = to; | ||
} | ||
}; | ||
const closeApp = () => () => { | ||
send_event('message_close', null); | ||
closed.set(true); | ||
}; | ||
const PropTypes = [ | ||
'BooleanKeyword', | ||
'NumberKeyword', | ||
'StringKeyword', | ||
'Function', | ||
'Enum', | ||
'Code', | ||
'Direction', | ||
'Url', | ||
'Image', | ||
'AnimationStyle', | ||
'LongText', | ||
'Length', | ||
'Color', | ||
'Alignment', | ||
'Style', | ||
]; | ||
const MediaQueries = { | ||
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*)', | ||
}; | ||
const Directions = ['row', 'column']; | ||
const AnimationStyles = [ | ||
'none', | ||
'fade', | ||
'bounce', | ||
'slide-down', | ||
'slide-up', | ||
'slide-left', | ||
'slide-right', | ||
]; | ||
const LengthUnits = ['px', 'em', 'rem', 'vw', 'fr', '%']; | ||
const Justifies = ['flex-start', 'center', 'flex-end']; | ||
const Alignments = ['flex-start', 'center', 'flex-end']; | ||
const ObjectFits = ['fill', 'contain', 'cover']; | ||
const Repeats = ['repeat', 'space', 'round', 'no-repeat']; | ||
/* src/components/Normalize.svelte generated by Svelte v3.44.1 */ | ||
function add_css$6(target) { | ||
append_styles(target, "svelte-zmz1k7", "@import 'https://cdn.skypack.dev/normalize.css';"); | ||
} | ||
class Normalize extends SvelteComponent { | ||
constructor(options) { | ||
super(); | ||
init(this, options, null, null, safe_not_equal, {}, add_css$6); | ||
} | ||
} | ||
/* src/State.svelte generated by Svelte v3.44.1 */ | ||
function create_fragment$9(ctx) { | ||
let normalize; | ||
let t; | ||
let current; | ||
normalize = new Normalize({}); | ||
const default_slot_template = /*#slots*/ ctx[1].default; | ||
const default_slot = create_slot(default_slot_template, ctx, /*$$scope*/ ctx[0], null); | ||
return { | ||
c() { | ||
create_component(normalize.$$.fragment); | ||
t = space(); | ||
if (default_slot) default_slot.c(); | ||
}, | ||
m(target, anchor) { | ||
mount_component(normalize, target, anchor); | ||
insert(target, t, anchor); | ||
if (default_slot) { | ||
default_slot.m(target, anchor); | ||
} | ||
current = true; | ||
}, | ||
p(ctx, [dirty]) { | ||
if (default_slot) { | ||
if (default_slot.p && (!current || dirty & /*$$scope*/ 1)) { | ||
update_slot_base( | ||
default_slot, | ||
default_slot_template, | ||
ctx, | ||
/*$$scope*/ ctx[0], | ||
!current | ||
? get_all_dirty_from_scope(/*$$scope*/ ctx[0]) | ||
: get_slot_changes(default_slot_template, /*$$scope*/ ctx[0], dirty, null), | ||
null | ||
); | ||
} | ||
} | ||
}, | ||
i(local) { | ||
if (current) return; | ||
transition_in(normalize.$$.fragment, local); | ||
transition_in(default_slot, local); | ||
current = true; | ||
}, | ||
o(local) { | ||
transition_out(normalize.$$.fragment, local); | ||
transition_out(default_slot, local); | ||
current = false; | ||
}, | ||
d(detaching) { | ||
destroy_component(normalize, detaching); | ||
if (detaching) detach(t); | ||
if (default_slot) default_slot.d(detaching); | ||
} | ||
}; | ||
} | ||
function instance$9($$self, $$props, $$invalidate) { | ||
let { $$slots: slots = {}, $$scope } = $$props; | ||
$$self.$$set = $$props => { | ||
if ('$$scope' in $$props) $$invalidate(0, $$scope = $$props.$$scope); | ||
}; | ||
return [$$scope, slots]; | ||
} | ||
class State extends SvelteComponent { | ||
constructor(options) { | ||
super(); | ||
init(this, options, instance$9, create_fragment$9, safe_not_equal, {}); | ||
} | ||
} | ||
/* src/components/StateItem.svelte generated by Svelte v3.44.1 */ | ||
function create_if_block$2(ctx) { | ||
let current; | ||
const default_slot_template = /*#slots*/ ctx[3].default; | ||
const default_slot = create_slot(default_slot_template, ctx, /*$$scope*/ ctx[2], null); | ||
return { | ||
c() { | ||
if (default_slot) default_slot.c(); | ||
}, | ||
m(target, anchor) { | ||
if (default_slot) { | ||
default_slot.m(target, anchor); | ||
} | ||
current = true; | ||
}, | ||
p(ctx, dirty) { | ||
if (default_slot) { | ||
if (default_slot.p && (!current || dirty & /*$$scope*/ 4)) { | ||
update_slot_base( | ||
default_slot, | ||
default_slot_template, | ||
ctx, | ||
/*$$scope*/ ctx[2], | ||
!current | ||
? get_all_dirty_from_scope(/*$$scope*/ ctx[2]) | ||
: get_slot_changes(default_slot_template, /*$$scope*/ ctx[2], dirty, null), | ||
null | ||
); | ||
} | ||
} | ||
}, | ||
i(local) { | ||
if (current) return; | ||
transition_in(default_slot, local); | ||
current = true; | ||
}, | ||
o(local) { | ||
transition_out(default_slot, local); | ||
current = false; | ||
}, | ||
d(detaching) { | ||
if (default_slot) default_slot.d(detaching); | ||
} | ||
}; | ||
} | ||
function create_fragment$8(ctx) { | ||
let if_block_anchor; | ||
let current; | ||
let if_block = /*$state*/ ctx[1] === /*path*/ ctx[0] && create_if_block$2(ctx); | ||
return { | ||
c() { | ||
if (if_block) if_block.c(); | ||
if_block_anchor = empty(); | ||
}, | ||
m(target, anchor) { | ||
if (if_block) if_block.m(target, anchor); | ||
insert(target, if_block_anchor, anchor); | ||
current = true; | ||
}, | ||
p(ctx, [dirty]) { | ||
if (/*$state*/ ctx[1] === /*path*/ ctx[0]) { | ||
if (if_block) { | ||
if_block.p(ctx, dirty); | ||
if (dirty & /*$state, path*/ 3) { | ||
transition_in(if_block, 1); | ||
} | ||
} else { | ||
if_block = create_if_block$2(ctx); | ||
if_block.c(); | ||
transition_in(if_block, 1); | ||
if_block.m(if_block_anchor.parentNode, if_block_anchor); | ||
} | ||
} else if (if_block) { | ||
group_outros(); | ||
transition_out(if_block, 1, 1, () => { | ||
if_block = null; | ||
}); | ||
check_outros(); | ||
} | ||
}, | ||
i(local) { | ||
if (current) return; | ||
transition_in(if_block); | ||
current = true; | ||
}, | ||
o(local) { | ||
transition_out(if_block); | ||
current = false; | ||
}, | ||
d(detaching) { | ||
if (if_block) if_block.d(detaching); | ||
if (detaching) detach(if_block_anchor); | ||
} | ||
}; | ||
} | ||
function instance$8($$self, $$props, $$invalidate) { | ||
let $state; | ||
component_subscribe($$self, state, $$value => $$invalidate(1, $state = $$value)); | ||
let { $$slots: slots = {}, $$scope } = $$props; | ||
let { path } = $$props; | ||
$$self.$$set = $$props => { | ||
if ('path' in $$props) $$invalidate(0, path = $$props.path); | ||
if ('$$scope' in $$props) $$invalidate(2, $$scope = $$props.$$scope); | ||
}; | ||
return [path, $state, $$scope, slots]; | ||
} | ||
class StateItem extends SvelteComponent { | ||
constructor(options) { | ||
super(); | ||
init(this, options, instance$8, create_fragment$8, safe_not_equal, { path: 0 }); | ||
} | ||
} | ||
/* src/components/BackgroundOverray.svelte generated by Svelte v3.44.1 */ | ||
function add_css$5(target) { | ||
append_styles(target, "svelte-1h4b6e3", ".background.svelte-1h4b6e3{position:fixed;top:0;left:0;width:100%;height:100%;background:rgba(0, 0, 0, 0.3)}"); | ||
} | ||
// (9:0) {#if backgroundOverray} | ||
function create_if_block$1(ctx) { | ||
let div; | ||
let mounted; | ||
let dispose; | ||
return { | ||
c() { | ||
div = element("div"); | ||
attr(div, "class", "background svelte-1h4b6e3"); | ||
}, | ||
m(target, anchor) { | ||
insert(target, div, anchor); | ||
if (!mounted) { | ||
dispose = listen(div, "click", /*click_handler*/ ctx[2]); | ||
mounted = true; | ||
} | ||
}, | ||
p: noop, | ||
d(detaching) { | ||
if (detaching) detach(div); | ||
mounted = false; | ||
dispose(); | ||
} | ||
}; | ||
} | ||
function create_fragment$7(ctx) { | ||
let if_block_anchor; | ||
let if_block = /*backgroundOverray*/ ctx[0] && create_if_block$1(ctx); | ||
return { | ||
c() { | ||
if (if_block) if_block.c(); | ||
if_block_anchor = empty(); | ||
}, | ||
m(target, anchor) { | ||
if (if_block) if_block.m(target, anchor); | ||
insert(target, if_block_anchor, anchor); | ||
}, | ||
p(ctx, [dirty]) { | ||
if (/*backgroundOverray*/ ctx[0]) { | ||
if (if_block) { | ||
if_block.p(ctx, dirty); | ||
} else { | ||
if_block = create_if_block$1(ctx); | ||
if_block.c(); | ||
if_block.m(if_block_anchor.parentNode, if_block_anchor); | ||
} | ||
} else if (if_block) { | ||
if_block.d(1); | ||
if_block = null; | ||
} | ||
}, | ||
i: noop, | ||
o: noop, | ||
d(detaching) { | ||
if (if_block) if_block.d(detaching); | ||
if (detaching) detach(if_block_anchor); | ||
} | ||
}; | ||
} | ||
function instance$7($$self, $$props, $$invalidate) { | ||
let { backgroundOverray = false } = $$props; | ||
const dispatch = createEventDispatcher(); | ||
const click_handler = () => dispatch('click'); | ||
$$self.$$set = $$props => { | ||
if ('backgroundOverray' in $$props) $$invalidate(0, backgroundOverray = $$props.backgroundOverray); | ||
}; | ||
return [backgroundOverray, dispatch, click_handler]; | ||
} | ||
class BackgroundOverray extends SvelteComponent { | ||
constructor(options) { | ||
super(); | ||
init(this, options, instance$7, create_fragment$7, safe_not_equal, { backgroundOverray: 0 }, add_css$5); | ||
} | ||
} | ||
/* src/components/Animation.svelte generated by Svelte v3.44.1 */ | ||
function add_css$4(target) { | ||
append_styles(target, "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 create_fragment$6(ctx) { | ||
let div; | ||
let current; | ||
const default_slot_template = /*#slots*/ ctx[3].default; | ||
const default_slot = create_slot(default_slot_template, ctx, /*$$scope*/ ctx[2], null); | ||
return { | ||
c() { | ||
div = element("div"); | ||
if (default_slot) default_slot.c(); | ||
attr(div, "class", "" + (null_to_empty(/*overwriteAnimation*/ ctx[0]) + " svelte-sa0cac")); | ||
}, | ||
m(target, anchor) { | ||
insert(target, div, anchor); | ||
if (default_slot) { | ||
default_slot.m(div, null); | ||
} | ||
current = true; | ||
}, | ||
p(ctx, [dirty]) { | ||
if (default_slot) { | ||
if (default_slot.p && (!current || dirty & /*$$scope*/ 4)) { | ||
update_slot_base( | ||
default_slot, | ||
default_slot_template, | ||
ctx, | ||
/*$$scope*/ ctx[2], | ||
!current | ||
? get_all_dirty_from_scope(/*$$scope*/ ctx[2]) | ||
: get_slot_changes(default_slot_template, /*$$scope*/ ctx[2], dirty, null), | ||
null | ||
); | ||
} | ||
} | ||
}, | ||
i(local) { | ||
if (current) return; | ||
transition_in(default_slot, local); | ||
current = true; | ||
}, | ||
o(local) { | ||
transition_out(default_slot, local); | ||
current = false; | ||
}, | ||
d(detaching) { | ||
if (detaching) detach(div); | ||
if (default_slot) default_slot.d(detaching); | ||
} | ||
}; | ||
} | ||
function instance$6($$self, $$props, $$invalidate) { | ||
let { $$slots: slots = {}, $$scope } = $$props; | ||
let { animation = 'none' } = $$props; | ||
const overwriteAnimation = isPreview() ? 'none' : animation; | ||
$$self.$$set = $$props => { | ||
if ('animation' in $$props) $$invalidate(1, animation = $$props.animation); | ||
if ('$$scope' in $$props) $$invalidate(2, $$scope = $$props.$$scope); | ||
}; | ||
return [overwriteAnimation, animation, $$scope, slots]; | ||
} | ||
class Animation extends SvelteComponent { | ||
constructor(options) { | ||
super(); | ||
init(this, options, instance$6, create_fragment$6, safe_not_equal, { animation: 1 }, add_css$4); | ||
} | ||
} | ||
/* src/components/Modal.svelte generated by Svelte v3.44.1 */ | ||
function add_css$3(target) { | ||
append_styles(target, "svelte-1ra4zfg", ".modal.svelte-1ra4zfg{position:absolute;box-sizing:border-box;z-index:2147483647}.close.svelte-1ra4zfg{position:absolute;display:flex;justify-content:center;align-items:center;background-color:transparent;border:none;cursor:pointer;padding:0;transition:all 0.25s}.close.svelte-1ra4zfg:hover{transform:rotate(90deg)}"); | ||
} | ||
// (78:2) {#if closable} | ||
function create_if_block(ctx) { | ||
let button; | ||
let svg; | ||
let path; | ||
let button_style_value; | ||
let mounted; | ||
let dispose; | ||
return { | ||
c() { | ||
button = element("button"); | ||
svg = svg_element("svg"); | ||
path = svg_element("path"); | ||
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"); | ||
attr(path, "fill", /*closeButtonColor*/ ctx[1]); | ||
attr(path, "fill-opacity", "0.8"); | ||
attr(svg, "width", "100%"); | ||
attr(svg, "height", "100%"); | ||
attr(svg, "viewBox", "0 0 9 10"); | ||
attr(svg, "fill", "none"); | ||
attr(svg, "xmlns", "http://www.w3.org/2000/svg"); | ||
attr(button, "class", "close svelte-1ra4zfg"); | ||
attr(button, "style", button_style_value = "z-index:" + (/*$maximumZindex*/ ctx[6] + 1) + "; " + /*_closeStyle*/ ctx[3] + ""); | ||
}, | ||
m(target, anchor) { | ||
insert(target, button, anchor); | ||
append(button, svg); | ||
append(svg, path); | ||
if (!mounted) { | ||
dispose = listen(button, "click", /*close*/ ctx[8]); | ||
mounted = true; | ||
} | ||
}, | ||
p(ctx, dirty) { | ||
if (dirty & /*closeButtonColor*/ 2) { | ||
attr(path, "fill", /*closeButtonColor*/ ctx[1]); | ||
} | ||
if (dirty & /*$maximumZindex, _closeStyle*/ 72 && button_style_value !== (button_style_value = "z-index:" + (/*$maximumZindex*/ ctx[6] + 1) + "; " + /*_closeStyle*/ ctx[3] + "")) { | ||
attr(button, "style", button_style_value); | ||
} | ||
}, | ||
d(detaching) { | ||
if (detaching) detach(button); | ||
mounted = false; | ||
dispose(); | ||
} | ||
}; | ||
} | ||
function create_fragment$5(ctx) { | ||
let div; | ||
let t; | ||
let div_style_value; | ||
let current; | ||
let mounted; | ||
let dispose; | ||
let if_block = /*closable*/ ctx[0] && create_if_block(ctx); | ||
const default_slot_template = /*#slots*/ ctx[15].default; | ||
const default_slot = create_slot(default_slot_template, ctx, /*$$scope*/ ctx[14], null); | ||
return { | ||
c() { | ||
div = element("div"); | ||
if (if_block) if_block.c(); | ||
t = space(); | ||
if (default_slot) default_slot.c(); | ||
attr(div, "class", "modal svelte-1ra4zfg"); | ||
attr(div, "role", "dialog"); | ||
attr(div, "aria-modal", "true"); | ||
attr(div, "style", div_style_value = "position:" + (/*overwriteFixed*/ ctx[7] ? 'fixed' : 'absolute') + "; " + /*pos*/ ctx[5] + " " + /*_style*/ ctx[2] + ""); | ||
}, | ||
m(target, anchor) { | ||
insert(target, div, anchor); | ||
if (if_block) if_block.m(div, null); | ||
append(div, t); | ||
if (default_slot) { | ||
default_slot.m(div, null); | ||
} | ||
/*div_binding*/ ctx[16](div); | ||
current = true; | ||
if (!mounted) { | ||
dispose = listen(window, "keydown", /*handle_keydown*/ ctx[9]); | ||
mounted = true; | ||
} | ||
}, | ||
p(ctx, [dirty]) { | ||
if (/*closable*/ ctx[0]) { | ||
if (if_block) { | ||
if_block.p(ctx, dirty); | ||
} else { | ||
if_block = create_if_block(ctx); | ||
if_block.c(); | ||
if_block.m(div, t); | ||
} | ||
} else if (if_block) { | ||
if_block.d(1); | ||
if_block = null; | ||
} | ||
if (default_slot) { | ||
if (default_slot.p && (!current || dirty & /*$$scope*/ 16384)) { | ||
update_slot_base( | ||
default_slot, | ||
default_slot_template, | ||
ctx, | ||
/*$$scope*/ ctx[14], | ||
!current | ||
? get_all_dirty_from_scope(/*$$scope*/ ctx[14]) | ||
: get_slot_changes(default_slot_template, /*$$scope*/ ctx[14], dirty, null), | ||
null | ||
); | ||
} | ||
} | ||
if (!current || dirty & /*pos, _style*/ 36 && div_style_value !== (div_style_value = "position:" + (/*overwriteFixed*/ ctx[7] ? 'fixed' : 'absolute') + "; " + /*pos*/ ctx[5] + " " + /*_style*/ ctx[2] + "")) { | ||
attr(div, "style", div_style_value); | ||
} | ||
}, | ||
i(local) { | ||
if (current) return; | ||
transition_in(default_slot, local); | ||
current = true; | ||
}, | ||
o(local) { | ||
transition_out(default_slot, local); | ||
current = false; | ||
}, | ||
d(detaching) { | ||
if (detaching) detach(div); | ||
if (if_block) if_block.d(); | ||
if (default_slot) default_slot.d(detaching); | ||
/*div_binding*/ ctx[16](null); | ||
mounted = false; | ||
dispose(); | ||
} | ||
}; | ||
} | ||
function instance$5($$self, $$props, $$invalidate) { | ||
let pos; | ||
let $maximumZindex; | ||
component_subscribe($$self, maximumZindex, $$value => $$invalidate(6, $maximumZindex = $$value)); | ||
let { $$slots: slots = {}, $$scope } = $$props; | ||
let { closable = true } = $$props; | ||
let { closeButtonColor = '#000000' } = $$props; | ||
let { eventName = '' } = $$props; | ||
let { eventValue = null } = $$props; | ||
let { position = 'center' } = $$props; | ||
const overwritePosition = isPreview() ? 'center' : position; | ||
let { fixed = false } = $$props; | ||
const overwriteFixed = isPreview() ? false : fixed; | ||
let { _style = '' } = $$props; | ||
let { _closeStyle = '' } = $$props; | ||
/** | ||
* {"title": {"ja": "閉じるボタン", "en": "Close Button"}} | ||
*/ | ||
const dispatch = createEventDispatcher(); | ||
const close = () => { | ||
if (eventName) { | ||
send_event(eventName, eventValue); | ||
} | ||
dispatch('close'); | ||
}; | ||
let modal = null; | ||
const handle_keydown = handleKeydown({ Escape: close, Tab: handleFocus(modal) }); | ||
onDestroy(() => setPreviousFocus()); | ||
function div_binding($$value) { | ||
binding_callbacks[$$value ? 'unshift' : 'push'](() => { | ||
modal = $$value; | ||
$$invalidate(4, modal); | ||
}); | ||
} | ||
$$self.$$set = $$props => { | ||
if ('closable' in $$props) $$invalidate(0, closable = $$props.closable); | ||
if ('closeButtonColor' in $$props) $$invalidate(1, closeButtonColor = $$props.closeButtonColor); | ||
if ('eventName' in $$props) $$invalidate(10, eventName = $$props.eventName); | ||
if ('eventValue' in $$props) $$invalidate(11, eventValue = $$props.eventValue); | ||
if ('position' in $$props) $$invalidate(12, position = $$props.position); | ||
if ('fixed' in $$props) $$invalidate(13, fixed = $$props.fixed); | ||
if ('_style' in $$props) $$invalidate(2, _style = $$props._style); | ||
if ('_closeStyle' in $$props) $$invalidate(3, _closeStyle = $$props._closeStyle); | ||
if ('$$scope' in $$props) $$invalidate(14, $$scope = $$props.$$scope); | ||
}; | ||
$$invalidate(5, pos = getPositionStyle(overwritePosition)); | ||
return [ | ||
closable, | ||
closeButtonColor, | ||
_style, | ||
_closeStyle, | ||
modal, | ||
pos, | ||
$maximumZindex, | ||
overwriteFixed, | ||
close, | ||
handle_keydown, | ||
eventName, | ||
eventValue, | ||
position, | ||
fixed, | ||
$$scope, | ||
slots, | ||
div_binding | ||
]; | ||
} | ||
class Modal extends SvelteComponent { | ||
constructor(options) { | ||
super(); | ||
init( | ||
this, | ||
options, | ||
instance$5, | ||
create_fragment$5, | ||
safe_not_equal, | ||
{ | ||
closable: 0, | ||
closeButtonColor: 1, | ||
eventName: 10, | ||
eventValue: 11, | ||
position: 12, | ||
fixed: 13, | ||
_style: 2, | ||
_closeStyle: 3 | ||
}, | ||
add_css$3 | ||
); | ||
} | ||
} | ||
/* src/components/Grid.svelte generated by Svelte v3.44.1 */ | ||
function create_fragment$4(ctx) { | ||
let div; | ||
let current; | ||
const default_slot_template = /*#slots*/ ctx[8].default; | ||
const default_slot = create_slot(default_slot_template, ctx, /*$$scope*/ ctx[7], null); | ||
return { | ||
c() { | ||
div = element("div"); | ||
if (default_slot) default_slot.c(); | ||
attr(div, "class", "grid"); | ||
attr(div, "style", /*_style*/ ctx[0]); | ||
}, | ||
m(target, anchor) { | ||
insert(target, div, anchor); | ||
if (default_slot) { | ||
default_slot.m(div, null); | ||
} | ||
current = true; | ||
}, | ||
p(ctx, [dirty]) { | ||
if (default_slot) { | ||
if (default_slot.p && (!current || dirty & /*$$scope*/ 128)) { | ||
update_slot_base( | ||
default_slot, | ||
default_slot_template, | ||
ctx, | ||
/*$$scope*/ ctx[7], | ||
!current | ||
? get_all_dirty_from_scope(/*$$scope*/ ctx[7]) | ||
: get_slot_changes(default_slot_template, /*$$scope*/ ctx[7], dirty, null), | ||
null | ||
); | ||
} | ||
} | ||
if (!current || dirty & /*_style*/ 1) { | ||
attr(div, "style", /*_style*/ ctx[0]); | ||
} | ||
}, | ||
i(local) { | ||
if (current) return; | ||
transition_in(default_slot, local); | ||
current = true; | ||
}, | ||
o(local) { | ||
transition_out(default_slot, local); | ||
current = false; | ||
}, | ||
d(detaching) { | ||
if (detaching) detach(div); | ||
if (default_slot) default_slot.d(detaching); | ||
} | ||
}; | ||
} | ||
function instance$4($$self, $$props, $$invalidate) { | ||
let _style; | ||
let { $$slots: slots = {}, $$scope } = $$props; | ||
let { width = '512px' } = $$props; | ||
let { height = '256px' } = $$props; | ||
let { rows } = $$props; | ||
let { columns } = $$props; | ||
let { gap = '0px' } = $$props; | ||
let { background = 'transparent' } = $$props; | ||
const toExpr = exp => typeof exp === 'number' | ||
? `repeat(${exp}, 1fr)` | ||
: exp.join(' '); | ||
$$self.$$set = $$props => { | ||
if ('width' in $$props) $$invalidate(1, width = $$props.width); | ||
if ('height' in $$props) $$invalidate(2, height = $$props.height); | ||
if ('rows' in $$props) $$invalidate(3, rows = $$props.rows); | ||
if ('columns' in $$props) $$invalidate(4, columns = $$props.columns); | ||
if ('gap' in $$props) $$invalidate(5, gap = $$props.gap); | ||
if ('background' in $$props) $$invalidate(6, background = $$props.background); | ||
if ('$$scope' in $$props) $$invalidate(7, $$scope = $$props.$$scope); | ||
}; | ||
$$self.$$.update = () => { | ||
if ($$self.$$.dirty & /*rows, columns, gap, background, width, height*/ 126) { | ||
$$invalidate(0, _style = [ | ||
`display: grid`, | ||
`grid-template-rows: ${toExpr(rows)}`, | ||
`grid-template-columns: ${toExpr(columns)}`, | ||
`gap: ${gap}`, | ||
`background: ${background}`, | ||
`width: ${width}`, | ||
`height: ${height};` | ||
].join(';')); | ||
} | ||
}; | ||
return [_style, width, height, rows, columns, gap, background, $$scope, slots]; | ||
} | ||
class Grid extends SvelteComponent { | ||
constructor(options) { | ||
super(); | ||
init(this, options, instance$4, create_fragment$4, safe_not_equal, { | ||
width: 1, | ||
height: 2, | ||
rows: 3, | ||
columns: 4, | ||
gap: 5, | ||
background: 6 | ||
}); | ||
} | ||
} | ||
/* src/GridModalState.svelte generated by Svelte v3.44.1 */ | ||
function create_default_slot_3(ctx) { | ||
let current; | ||
const default_slot_template = /*#slots*/ ctx[18].default; | ||
const default_slot = create_slot(default_slot_template, ctx, /*$$scope*/ ctx[19], null); | ||
return { | ||
c() { | ||
if (default_slot) default_slot.c(); | ||
}, | ||
m(target, anchor) { | ||
if (default_slot) { | ||
default_slot.m(target, anchor); | ||
} | ||
current = true; | ||
}, | ||
p(ctx, dirty) { | ||
if (default_slot) { | ||
if (default_slot.p && (!current || dirty & /*$$scope*/ 524288)) { | ||
update_slot_base( | ||
default_slot, | ||
default_slot_template, | ||
ctx, | ||
/*$$scope*/ ctx[19], | ||
!current | ||
? get_all_dirty_from_scope(/*$$scope*/ ctx[19]) | ||
: get_slot_changes(default_slot_template, /*$$scope*/ ctx[19], dirty, null), | ||
null | ||
); | ||
} | ||
} | ||
}, | ||
i(local) { | ||
if (current) return; | ||
transition_in(default_slot, local); | ||
current = true; | ||
}, | ||
o(local) { | ||
transition_out(default_slot, local); | ||
current = false; | ||
}, | ||
d(detaching) { | ||
if (default_slot) default_slot.d(detaching); | ||
} | ||
}; | ||
} | ||
// (99:4) <Modal {closable} {closeButtonColor} {_closeStyle} {position} {fixed} _style={_modalStyle} on:close={close} > | ||
function create_default_slot_2(ctx) { | ||
let grid; | ||
let current; | ||
grid = new Grid({ | ||
props: { | ||
width: /*width*/ ctx[9], | ||
height: /*height*/ ctx[10], | ||
rows: /*rows*/ ctx[11], | ||
columns: /*columns*/ ctx[12], | ||
gap: /*gap*/ ctx[13], | ||
background: /*background*/ ctx[14], | ||
$$slots: { default: [create_default_slot_3] }, | ||
$$scope: { ctx } | ||
} | ||
}); | ||
return { | ||
c() { | ||
create_component(grid.$$.fragment); | ||
}, | ||
m(target, anchor) { | ||
mount_component(grid, target, anchor); | ||
current = true; | ||
}, | ||
p(ctx, dirty) { | ||
const grid_changes = {}; | ||
if (dirty & /*width*/ 512) grid_changes.width = /*width*/ ctx[9]; | ||
if (dirty & /*height*/ 1024) grid_changes.height = /*height*/ ctx[10]; | ||
if (dirty & /*rows*/ 2048) grid_changes.rows = /*rows*/ ctx[11]; | ||
if (dirty & /*columns*/ 4096) grid_changes.columns = /*columns*/ ctx[12]; | ||
if (dirty & /*gap*/ 8192) grid_changes.gap = /*gap*/ ctx[13]; | ||
if (dirty & /*background*/ 16384) grid_changes.background = /*background*/ ctx[14]; | ||
if (dirty & /*$$scope*/ 524288) { | ||
grid_changes.$$scope = { dirty, ctx }; | ||
} | ||
grid.$set(grid_changes); | ||
}, | ||
i(local) { | ||
if (current) return; | ||
transition_in(grid.$$.fragment, local); | ||
current = true; | ||
}, | ||
o(local) { | ||
transition_out(grid.$$.fragment, local); | ||
current = false; | ||
}, | ||
d(detaching) { | ||
destroy_component(grid, detaching); | ||
} | ||
}; | ||
} | ||
// (98:2) <Animation {animation}> | ||
function create_default_slot_1(ctx) { | ||
let modal; | ||
let current; | ||
modal = new Modal({ | ||
props: { | ||
closable: /*closable*/ ctx[3], | ||
closeButtonColor: /*closeButtonColor*/ ctx[4], | ||
_closeStyle: /*_closeStyle*/ ctx[8], | ||
position: /*position*/ ctx[5], | ||
fixed: /*fixed*/ ctx[6], | ||
_style: /*_modalStyle*/ ctx[7], | ||
$$slots: { default: [create_default_slot_2] }, | ||
$$scope: { ctx } | ||
} | ||
}); | ||
modal.$on("close", /*close*/ ctx[15]); | ||
return { | ||
c() { | ||
create_component(modal.$$.fragment); | ||
}, | ||
m(target, anchor) { | ||
mount_component(modal, target, anchor); | ||
current = true; | ||
}, | ||
p(ctx, dirty) { | ||
const modal_changes = {}; | ||
if (dirty & /*closable*/ 8) modal_changes.closable = /*closable*/ ctx[3]; | ||
if (dirty & /*closeButtonColor*/ 16) modal_changes.closeButtonColor = /*closeButtonColor*/ ctx[4]; | ||
if (dirty & /*_closeStyle*/ 256) modal_changes._closeStyle = /*_closeStyle*/ ctx[8]; | ||
if (dirty & /*position*/ 32) modal_changes.position = /*position*/ ctx[5]; | ||
if (dirty & /*fixed*/ 64) modal_changes.fixed = /*fixed*/ ctx[6]; | ||
if (dirty & /*_modalStyle*/ 128) modal_changes._style = /*_modalStyle*/ ctx[7]; | ||
if (dirty & /*$$scope, width, height, rows, columns, gap, background*/ 556544) { | ||
modal_changes.$$scope = { dirty, ctx }; | ||
} | ||
modal.$set(modal_changes); | ||
}, | ||
i(local) { | ||
if (current) return; | ||
transition_in(modal.$$.fragment, local); | ||
current = true; | ||
}, | ||
o(local) { | ||
transition_out(modal.$$.fragment, local); | ||
current = false; | ||
}, | ||
d(detaching) { | ||
destroy_component(modal, detaching); | ||
} | ||
}; | ||
} | ||
// (96:0) <StateItem {path}> | ||
function create_default_slot(ctx) { | ||
let backgroundoverray; | ||
let t; | ||
let animation_1; | ||
let current; | ||
backgroundoverray = new BackgroundOverray({ | ||
props: { | ||
backgroundOverray: /*backgroundOverray*/ ctx[2] | ||
} | ||
}); | ||
backgroundoverray.$on("click", /*close*/ ctx[15]); | ||
animation_1 = new Animation({ | ||
props: { | ||
animation: /*animation*/ ctx[1], | ||
$$slots: { default: [create_default_slot_1] }, | ||
$$scope: { ctx } | ||
} | ||
}); | ||
return { | ||
c() { | ||
create_component(backgroundoverray.$$.fragment); | ||
t = space(); | ||
create_component(animation_1.$$.fragment); | ||
}, | ||
m(target, anchor) { | ||
mount_component(backgroundoverray, target, anchor); | ||
insert(target, t, anchor); | ||
mount_component(animation_1, target, anchor); | ||
current = true; | ||
}, | ||
p(ctx, dirty) { | ||
const backgroundoverray_changes = {}; | ||
if (dirty & /*backgroundOverray*/ 4) backgroundoverray_changes.backgroundOverray = /*backgroundOverray*/ ctx[2]; | ||
backgroundoverray.$set(backgroundoverray_changes); | ||
const animation_1_changes = {}; | ||
if (dirty & /*animation*/ 2) animation_1_changes.animation = /*animation*/ ctx[1]; | ||
if (dirty & /*$$scope, closable, closeButtonColor, _closeStyle, position, fixed, _modalStyle, width, height, rows, columns, gap, background*/ 557048) { | ||
animation_1_changes.$$scope = { dirty, ctx }; | ||
} | ||
animation_1.$set(animation_1_changes); | ||
}, | ||
i(local) { | ||
if (current) return; | ||
transition_in(backgroundoverray.$$.fragment, local); | ||
transition_in(animation_1.$$.fragment, local); | ||
current = true; | ||
}, | ||
o(local) { | ||
transition_out(backgroundoverray.$$.fragment, local); | ||
transition_out(animation_1.$$.fragment, local); | ||
current = false; | ||
}, | ||
d(detaching) { | ||
destroy_component(backgroundoverray, detaching); | ||
if (detaching) detach(t); | ||
destroy_component(animation_1, detaching); | ||
} | ||
}; | ||
} | ||
function create_fragment$3(ctx) { | ||
let stateitem; | ||
let current; | ||
stateitem = new StateItem({ | ||
props: { | ||
path: /*path*/ ctx[0], | ||
$$slots: { default: [create_default_slot] }, | ||
$$scope: { ctx } | ||
} | ||
}); | ||
return { | ||
c() { | ||
create_component(stateitem.$$.fragment); | ||
}, | ||
m(target, anchor) { | ||
mount_component(stateitem, target, anchor); | ||
current = true; | ||
}, | ||
p(ctx, [dirty]) { | ||
const stateitem_changes = {}; | ||
if (dirty & /*path*/ 1) stateitem_changes.path = /*path*/ ctx[0]; | ||
if (dirty & /*$$scope, animation, closable, closeButtonColor, _closeStyle, position, fixed, _modalStyle, width, height, rows, columns, gap, background, backgroundOverray*/ 557054) { | ||
stateitem_changes.$$scope = { dirty, ctx }; | ||
} | ||
stateitem.$set(stateitem_changes); | ||
}, | ||
i(local) { | ||
if (current) return; | ||
transition_in(stateitem.$$.fragment, local); | ||
current = true; | ||
}, | ||
o(local) { | ||
transition_out(stateitem.$$.fragment, local); | ||
current = false; | ||
}, | ||
d(detaching) { | ||
destroy_component(stateitem, detaching); | ||
} | ||
}; | ||
} | ||
function instance$3($$self, $$props, $$invalidate) { | ||
let { $$slots: slots = {}, $$scope } = $$props; | ||
let { path } = $$props; | ||
let { animation = 'none' } = $$props; | ||
let { backgroundOverray = false } = $$props; | ||
let { closable = true } = $$props; | ||
let { closeButtonColor = '#000000' } = $$props; | ||
let { eventName = '' } = $$props; | ||
let { eventValue = null } = $$props; | ||
let { position = 'center' } = $$props; | ||
let { fixed = false } = $$props; | ||
let { _modalStyle = '' } = $$props; | ||
let { _closeStyle = '' } = $$props; | ||
let { width = '512px' } = $$props; | ||
let { height = '256px' } = $$props; | ||
let { rows } = $$props; | ||
let { columns } = $$props; | ||
let { gap = '0px' } = $$props; | ||
let { background = 'transparent' } = $$props; | ||
/** | ||
* {"title": {"ja": "閉じるボタン", "en": "Close Button"}} | ||
*/ | ||
const dispatch = createEventDispatcher(); | ||
const close = () => { | ||
if (eventName) { | ||
send_event(eventName, eventValue); | ||
} | ||
dispatch('close'); | ||
}; | ||
$$self.$$set = $$props => { | ||
if ('path' in $$props) $$invalidate(0, path = $$props.path); | ||
if ('animation' in $$props) $$invalidate(1, animation = $$props.animation); | ||
if ('backgroundOverray' in $$props) $$invalidate(2, backgroundOverray = $$props.backgroundOverray); | ||
if ('closable' in $$props) $$invalidate(3, closable = $$props.closable); | ||
if ('closeButtonColor' in $$props) $$invalidate(4, closeButtonColor = $$props.closeButtonColor); | ||
if ('eventName' in $$props) $$invalidate(16, eventName = $$props.eventName); | ||
if ('eventValue' in $$props) $$invalidate(17, eventValue = $$props.eventValue); | ||
if ('position' in $$props) $$invalidate(5, position = $$props.position); | ||
if ('fixed' in $$props) $$invalidate(6, fixed = $$props.fixed); | ||
if ('_modalStyle' in $$props) $$invalidate(7, _modalStyle = $$props._modalStyle); | ||
if ('_closeStyle' in $$props) $$invalidate(8, _closeStyle = $$props._closeStyle); | ||
if ('width' in $$props) $$invalidate(9, width = $$props.width); | ||
if ('height' in $$props) $$invalidate(10, height = $$props.height); | ||
if ('rows' in $$props) $$invalidate(11, rows = $$props.rows); | ||
if ('columns' in $$props) $$invalidate(12, columns = $$props.columns); | ||
if ('gap' in $$props) $$invalidate(13, gap = $$props.gap); | ||
if ('background' in $$props) $$invalidate(14, background = $$props.background); | ||
if ('$$scope' in $$props) $$invalidate(19, $$scope = $$props.$$scope); | ||
}; | ||
return [ | ||
path, | ||
animation, | ||
backgroundOverray, | ||
closable, | ||
closeButtonColor, | ||
position, | ||
fixed, | ||
_modalStyle, | ||
_closeStyle, | ||
width, | ||
height, | ||
rows, | ||
columns, | ||
gap, | ||
background, | ||
close, | ||
eventName, | ||
eventValue, | ||
slots, | ||
$$scope | ||
]; | ||
} | ||
class GridModalState extends SvelteComponent { | ||
constructor(options) { | ||
super(); | ||
init(this, options, instance$3, create_fragment$3, 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 | ||
}); | ||
} | ||
} | ||
/* src/GridItem.svelte generated by Svelte v3.44.1 */ | ||
function add_css$2(target) { | ||
append_styles(target, "svelte-g0rfgr", ".grid-item.svelte-g0rfgr{word-break:break-all}"); | ||
} | ||
function create_fragment$2(ctx) { | ||
let div; | ||
let current; | ||
const default_slot_template = /*#slots*/ ctx[8].default; | ||
const default_slot = create_slot(default_slot_template, ctx, /*$$scope*/ ctx[7], null); | ||
return { | ||
c() { | ||
div = element("div"); | ||
if (default_slot) default_slot.c(); | ||
attr(div, "class", "grid-item svelte-g0rfgr"); | ||
attr(div, "style", /*_style*/ ctx[0]); | ||
}, | ||
m(target, anchor) { | ||
insert(target, div, anchor); | ||
if (default_slot) { | ||
default_slot.m(div, null); | ||
} | ||
current = true; | ||
}, | ||
p(ctx, [dirty]) { | ||
if (default_slot) { | ||
if (default_slot.p && (!current || dirty & /*$$scope*/ 128)) { | ||
update_slot_base( | ||
default_slot, | ||
default_slot_template, | ||
ctx, | ||
/*$$scope*/ ctx[7], | ||
!current | ||
? get_all_dirty_from_scope(/*$$scope*/ ctx[7]) | ||
: get_slot_changes(default_slot_template, /*$$scope*/ ctx[7], dirty, null), | ||
null | ||
); | ||
} | ||
} | ||
if (!current || dirty & /*_style*/ 1) { | ||
attr(div, "style", /*_style*/ ctx[0]); | ||
} | ||
}, | ||
i(local) { | ||
if (current) return; | ||
transition_in(default_slot, local); | ||
current = true; | ||
}, | ||
o(local) { | ||
transition_out(default_slot, local); | ||
current = false; | ||
}, | ||
d(detaching) { | ||
if (detaching) detach(div); | ||
if (default_slot) default_slot.d(detaching); | ||
} | ||
}; | ||
} | ||
function instance$2($$self, $$props, $$invalidate) { | ||
let _style; | ||
let { $$slots: slots = {}, $$scope } = $$props; | ||
let { x1 } = $$props; | ||
let { x2 } = $$props; | ||
let { y1 } = $$props; | ||
let { y2 } = $$props; | ||
let { z } = $$props; | ||
let { background = 'transparent' } = $$props; | ||
onMount(() => { | ||
setMiximumZindex(z); | ||
}); | ||
$$self.$$set = $$props => { | ||
if ('x1' in $$props) $$invalidate(1, x1 = $$props.x1); | ||
if ('x2' in $$props) $$invalidate(2, x2 = $$props.x2); | ||
if ('y1' in $$props) $$invalidate(3, y1 = $$props.y1); | ||
if ('y2' in $$props) $$invalidate(4, y2 = $$props.y2); | ||
if ('z' in $$props) $$invalidate(5, z = $$props.z); | ||
if ('background' in $$props) $$invalidate(6, background = $$props.background); | ||
if ('$$scope' in $$props) $$invalidate(7, $$scope = $$props.$$scope); | ||
}; | ||
$$self.$$.update = () => { | ||
if ($$self.$$.dirty & /*y1, x1, y2, x2, z, background*/ 126) { | ||
$$invalidate(0, _style = [ | ||
`grid-area: ${y1 + 1} / ${x1 + 1} / ${y2 + 2} / ${x2 + 2}`, | ||
`z-index: ${z}`, | ||
`background: ${background}`, | ||
'display: grid', | ||
'place-items: center' | ||
].join(';')); | ||
} | ||
}; | ||
return [_style, x1, x2, y1, y2, z, background, $$scope, slots]; | ||
} | ||
class GridItem extends SvelteComponent { | ||
constructor(options) { | ||
super(); | ||
init( | ||
this, | ||
options, | ||
instance$2, | ||
create_fragment$2, | ||
safe_not_equal, | ||
{ | ||
x1: 1, | ||
x2: 2, | ||
y1: 3, | ||
y2: 4, | ||
z: 5, | ||
background: 6 | ||
}, | ||
add_css$2 | ||
); | ||
} | ||
} | ||
/* src/components/Flex.svelte generated by Svelte v3.44.1 */ | ||
function add_css$1(target) { | ||
append_styles(target, "svelte-1e71ejc", ".flex.svelte-1e71ejc{display:flex}"); | ||
} | ||
function create_fragment$1(ctx) { | ||
let div; | ||
let div_style_value; | ||
let current; | ||
const default_slot_template = /*#slots*/ ctx[5].default; | ||
const default_slot = create_slot(default_slot_template, ctx, /*$$scope*/ ctx[4], null); | ||
return { | ||
c() { | ||
div = element("div"); | ||
if (default_slot) default_slot.c(); | ||
attr(div, "class", "flex svelte-1e71ejc"); | ||
attr(div, "style", div_style_value = "width:" + /*width*/ ctx[1] + "; height:" + /*height*/ ctx[2] + "; flex-direction:" + /*direction*/ ctx[0] + "; " + /*_style*/ ctx[3]); | ||
}, | ||
m(target, anchor) { | ||
insert(target, div, anchor); | ||
if (default_slot) { | ||
default_slot.m(div, null); | ||
} | ||
current = true; | ||
}, | ||
p(ctx, [dirty]) { | ||
if (default_slot) { | ||
if (default_slot.p && (!current || dirty & /*$$scope*/ 16)) { | ||
update_slot_base( | ||
default_slot, | ||
default_slot_template, | ||
ctx, | ||
/*$$scope*/ ctx[4], | ||
!current | ||
? get_all_dirty_from_scope(/*$$scope*/ ctx[4]) | ||
: get_slot_changes(default_slot_template, /*$$scope*/ ctx[4], dirty, null), | ||
null | ||
); | ||
} | ||
} | ||
if (!current || dirty & /*width, height, direction, _style*/ 15 && div_style_value !== (div_style_value = "width:" + /*width*/ ctx[1] + "; height:" + /*height*/ ctx[2] + "; flex-direction:" + /*direction*/ ctx[0] + "; " + /*_style*/ ctx[3])) { | ||
attr(div, "style", div_style_value); | ||
} | ||
}, | ||
i(local) { | ||
if (current) return; | ||
transition_in(default_slot, local); | ||
current = true; | ||
}, | ||
o(local) { | ||
transition_out(default_slot, local); | ||
current = false; | ||
}, | ||
d(detaching) { | ||
if (detaching) detach(div); | ||
if (default_slot) default_slot.d(detaching); | ||
} | ||
}; | ||
} | ||
const FlexContextKey = 'action-sdk:flex'; | ||
function getFlexContext() { | ||
return getContext(FlexContextKey); | ||
} | ||
function instance$1($$self, $$props, $$invalidate) { | ||
let { $$slots: slots = {}, $$scope } = $$props; | ||
let { direction = 'row' } = $$props; | ||
let { width = '100%' } = $$props; | ||
let { height = '100%' } = $$props; | ||
let { _style = '' } = $$props; | ||
setContext(FlexContextKey, { direction }); | ||
$$self.$$set = $$props => { | ||
if ('direction' in $$props) $$invalidate(0, direction = $$props.direction); | ||
if ('width' in $$props) $$invalidate(1, width = $$props.width); | ||
if ('height' in $$props) $$invalidate(2, height = $$props.height); | ||
if ('_style' in $$props) $$invalidate(3, _style = $$props._style); | ||
if ('$$scope' in $$props) $$invalidate(4, $$scope = $$props.$$scope); | ||
}; | ||
return [direction, width, height, _style, $$scope, slots]; | ||
} | ||
class Flex extends SvelteComponent { | ||
constructor(options) { | ||
super(); | ||
init( | ||
this, | ||
options, | ||
instance$1, | ||
create_fragment$1, | ||
safe_not_equal, | ||
{ | ||
direction: 0, | ||
width: 1, | ||
height: 2, | ||
_style: 3 | ||
}, | ||
add_css$1 | ||
); | ||
} | ||
} | ||
/* src/components/FlexItem.svelte generated by Svelte v3.44.1 */ | ||
function add_css(target) { | ||
append_styles(target, "svelte-1p0bk1x", ".flex-item.svelte-1p0bk1x{max-width:100%;max-height:100%;position:relative;isolation:isolate}"); | ||
} | ||
function create_fragment(ctx) { | ||
let div; | ||
let current; | ||
const default_slot_template = /*#slots*/ ctx[4].default; | ||
const default_slot = create_slot(default_slot_template, ctx, /*$$scope*/ ctx[3], null); | ||
return { | ||
c() { | ||
div = element("div"); | ||
if (default_slot) default_slot.c(); | ||
attr(div, "class", "flex-item svelte-1p0bk1x"); | ||
attr(div, "style", /*style*/ ctx[0]); | ||
}, | ||
m(target, anchor) { | ||
insert(target, div, anchor); | ||
if (default_slot) { | ||
default_slot.m(div, null); | ||
} | ||
current = true; | ||
}, | ||
p(ctx, [dirty]) { | ||
if (default_slot) { | ||
if (default_slot.p && (!current || dirty & /*$$scope*/ 8)) { | ||
update_slot_base( | ||
default_slot, | ||
default_slot_template, | ||
ctx, | ||
/*$$scope*/ ctx[3], | ||
!current | ||
? get_all_dirty_from_scope(/*$$scope*/ ctx[3]) | ||
: get_slot_changes(default_slot_template, /*$$scope*/ ctx[3], dirty, null), | ||
null | ||
); | ||
} | ||
} | ||
if (!current || dirty & /*style*/ 1) { | ||
attr(div, "style", /*style*/ ctx[0]); | ||
} | ||
}, | ||
i(local) { | ||
if (current) return; | ||
transition_in(default_slot, local); | ||
current = true; | ||
}, | ||
o(local) { | ||
transition_out(default_slot, local); | ||
current = false; | ||
}, | ||
d(detaching) { | ||
if (detaching) detach(div); | ||
if (default_slot) default_slot.d(detaching); | ||
} | ||
}; | ||
} | ||
function instance($$self, $$props, $$invalidate) { | ||
let { $$slots: slots = {}, $$scope } = $$props; | ||
let { length } = $$props; | ||
let { _style = '' } = $$props; | ||
const flexContext = getFlexContext(); | ||
let style; | ||
$$self.$$set = $$props => { | ||
if ('length' in $$props) $$invalidate(1, length = $$props.length); | ||
if ('_style' in $$props) $$invalidate(2, _style = $$props._style); | ||
if ('$$scope' in $$props) $$invalidate(3, $$scope = $$props.$$scope); | ||
}; | ||
$$self.$$.update = () => { | ||
if ($$self.$$.dirty & /*length, _style*/ 6) { | ||
{ | ||
let newStyle = ''; | ||
if (hasSuffix(length, 'px')) { | ||
if (flexContext.direction === 'row') { | ||
newStyle = `width: ${length}; height: 100%;`; | ||
} else if (flexContext.direction === 'column') { | ||
newStyle = `width: 100%; height: ${length};`; | ||
} | ||
} else { | ||
if (flexContext.direction === 'row') { | ||
newStyle = `height: 100%; flex-grow: ${length}; flex-basis: 0;`; | ||
} else if (flexContext.direction === 'column') { | ||
newStyle = `width: 100%; flex-grow: ${length}; flex-basis: 0;`; | ||
} | ||
} | ||
$$invalidate(0, style = newStyle + _style); | ||
} | ||
} | ||
}; | ||
return [style, length, _style, $$scope, slots]; | ||
} | ||
class FlexItem extends SvelteComponent { | ||
constructor(options) { | ||
super(); | ||
init(this, options, instance, create_fragment, safe_not_equal, { length: 1, _style: 2 }, add_css); | ||
} | ||
} | ||
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 }; |
{ | ||
"name": "@plaidev/karte-action-sdk", | ||
"version": "1.0.22", | ||
"version": "1.0.23", | ||
"author": "Plaid Inc.", | ||
@@ -17,3 +17,2 @@ "license": "Apache-2.0", | ||
"./package.json": "./package.json", | ||
"./src/*": "./src/*", | ||
"./dist/*": "./dist/*" | ||
@@ -24,3 +23,2 @@ }, | ||
"index.mjs", | ||
"src", | ||
"README.md", | ||
@@ -34,2 +32,3 @@ "LICENSE" | ||
"@rollup/plugin-node-resolve": "^13.3.0", | ||
"@rollup/plugin-replace": "^4.0.0", | ||
"@sveltejs/vite-plugin-svelte": "1.0.0-next.37", | ||
@@ -39,4 +38,4 @@ "@testing-library/svelte": "^3.1.3", | ||
"@vitest/ui": "latest", | ||
"happy-dom": "^6.0.3", | ||
"jiti": "1.14.0", | ||
"jsdom": "latest", | ||
"node-fetch": "2.6.7", | ||
@@ -49,3 +48,2 @@ "rimraf": "^3.0.2", | ||
"rollup-plugin-svelte": "^7.1.0", | ||
"rollup-plugin-terser": "^7.0.2", | ||
"rollup-plugin-ts": "^2.0.7", | ||
@@ -64,3 +62,4 @@ "svelte": "3.44.1", | ||
"check": "svelte-check --tsconfig ./tsconfig.json", | ||
"test": "vitest", | ||
"test": "vitest run", | ||
"test:watch": "vitest", | ||
"test:ui": "vitest --ui", | ||
@@ -67,0 +66,0 @@ "coverage": "vitest run --coverage" |
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
63793
1651
6