@plaidev/karte-action-sdk 1.1.265 → 1.1.266-29065938.e3ec46c6
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/hydrate/index.es.d.ts +29 -3
- package/dist/hydrate/index.es.js +779 -290
- package/dist/index.es.d.ts +29 -3
- package/dist/index.es.js +753 -298
- package/dist/svelte5/hydrate/index.es.d.ts +30 -4
- package/dist/svelte5/hydrate/index.es.js +754 -430
- package/dist/svelte5/index.es.d.ts +30 -4
- package/dist/svelte5/index.es.js +576 -386
- package/dist/svelte5/index.front2.es.js +578 -386
- package/package.json +1 -1
@@ -1,6 +1,6 @@
|
|
1
1
|
import { writable, get } from 'svelte/store';
|
2
2
|
import * as svelte from 'svelte';
|
3
|
-
import { onMount as onMount$1, onDestroy as onDestroy$1, beforeUpdate as beforeUpdate$1, afterUpdate as afterUpdate$1, tick as tick$1, getContext, setContext } from 'svelte';
|
3
|
+
import { onMount as onMount$1, onDestroy as onDestroy$1, beforeUpdate as beforeUpdate$1, afterUpdate as afterUpdate$1, tick as tick$1, getContext, setContext, createEventDispatcher } from 'svelte';
|
4
4
|
import 'svelte/internal/disclose-version';
|
5
5
|
import 'svelte/internal/flags/legacy';
|
6
6
|
import * as $ from 'svelte/internal/client';
|
@@ -20,6 +20,11 @@ const ALL_ACTION_ID = 'KARTE_ALL_ACTION_ID';
|
|
20
20
|
const ALL_ACTION_SHORTEN_ID = 'KARTE_ALL_ACTION_SHORTEN_ID';
|
21
21
|
/** @internal */
|
22
22
|
const DEVICE_IDS = ['PC', 'SP'];
|
23
|
+
/** @internal */
|
24
|
+
const DEVICE_QUERIES = {
|
25
|
+
PC: 'screen and (min-width: 641px)',
|
26
|
+
SP: 'screen and (max-width: 640px)',
|
27
|
+
};
|
23
28
|
// -------- The following codes are deprecated --------
|
24
29
|
/**
|
25
30
|
* 非推奨
|
@@ -1599,57 +1604,12 @@ const handleState = (event) => {
|
|
1599
1604
|
});
|
1600
1605
|
}
|
1601
1606
|
};
|
1602
|
-
/**
|
1603
|
-
* アクションが表示 (show) された後にフックする関数
|
1604
|
-
*
|
1605
|
-
* @param fn - 呼び出されるフック関数
|
1606
|
-
*
|
1607
|
-
* @public
|
1608
|
-
*/
|
1609
|
-
function onShow(fn) {
|
1610
|
-
let { onShowHandlers } = getInternalHandlers();
|
1611
|
-
if (!onShowHandlers) {
|
1612
|
-
onShowHandlers = [];
|
1613
|
-
}
|
1614
|
-
onShowHandlers.push(fn);
|
1615
|
-
setInternalHandlers({ onShowHandlers });
|
1616
|
-
}
|
1617
|
-
/**
|
1618
|
-
* アクションがクローズ (close) される前にフックする関数
|
1619
|
-
*
|
1620
|
-
* @param fn - 呼び出されるフック関数
|
1621
|
-
*
|
1622
|
-
* @public
|
1623
|
-
*/
|
1624
|
-
function onClose(fn) {
|
1625
|
-
let { onCloseHandlers } = getInternalHandlers();
|
1626
|
-
if (!onCloseHandlers) {
|
1627
|
-
onCloseHandlers = [];
|
1628
|
-
}
|
1629
|
-
onCloseHandlers.push(fn);
|
1630
|
-
setInternalHandlers({ onCloseHandlers });
|
1631
|
-
}
|
1632
|
-
/**
|
1633
|
-
* アクションのステートが変更された (changeState) 後にフックする関数
|
1634
|
-
*
|
1635
|
-
* @param fn - 呼び出されるフック関数
|
1636
|
-
*
|
1637
|
-
* @public
|
1638
|
-
*/
|
1639
|
-
function onChangeState(fn) {
|
1640
|
-
let { onChangeStateHandlers } = getInternalHandlers();
|
1641
|
-
if (!onChangeStateHandlers) {
|
1642
|
-
onChangeStateHandlers = [];
|
1643
|
-
}
|
1644
|
-
onChangeStateHandlers.push(fn);
|
1645
|
-
setInternalHandlers({ onChangeStateHandlers });
|
1646
|
-
}
|
1647
1607
|
/**
|
1648
1608
|
* アクションを表示する
|
1649
1609
|
*
|
1650
1610
|
* @public
|
1651
1611
|
*/
|
1652
|
-
function showAction() {
|
1612
|
+
function showAction$1() {
|
1653
1613
|
const event = new CustomEvent(ACTION_SHOW_EVENT, { detail: { trigger: 'custom' } });
|
1654
1614
|
window.dispatchEvent(event);
|
1655
1615
|
}
|
@@ -1660,114 +1620,10 @@ function showAction() {
|
|
1660
1620
|
*
|
1661
1621
|
* @public
|
1662
1622
|
*/
|
1663
|
-
function closeAction(trigger = 'none') {
|
1623
|
+
function closeAction$1(trigger = 'none') {
|
1664
1624
|
const event = new CustomEvent(ACTION_CLOSE_EVENT, { detail: { trigger } });
|
1665
1625
|
window.dispatchEvent(event);
|
1666
1626
|
}
|
1667
|
-
/**
|
1668
|
-
* アクションに CSS を適用する
|
1669
|
-
*
|
1670
|
-
* @param css - 適用する CSS
|
1671
|
-
*
|
1672
|
-
* @returns 適用された style 要素を返す Promise
|
1673
|
-
*
|
1674
|
-
* @public
|
1675
|
-
*/
|
1676
|
-
async function applyCss(css) {
|
1677
|
-
return new Promise((resolve, reject) => {
|
1678
|
-
const style = document.createElement('style');
|
1679
|
-
style.textContent = css;
|
1680
|
-
const shadowRoot = getActionRoot();
|
1681
|
-
if (!shadowRoot)
|
1682
|
-
return;
|
1683
|
-
shadowRoot.append(style);
|
1684
|
-
style.addEventListener('load', () => resolve(style));
|
1685
|
-
style.addEventListener('error', () => reject(style));
|
1686
|
-
});
|
1687
|
-
}
|
1688
|
-
async function fixFontFaceIssue(href, cssRules) {
|
1689
|
-
const css = new CSSStyleSheet();
|
1690
|
-
// @ts-ignore
|
1691
|
-
await css.replace(cssRules);
|
1692
|
-
const rules = [];
|
1693
|
-
const fixedRules = [];
|
1694
|
-
Array.from(css.cssRules).forEach(cssRule => {
|
1695
|
-
if (cssRule.type !== 5) {
|
1696
|
-
rules.push(cssRule.cssText);
|
1697
|
-
}
|
1698
|
-
// type 5 is @font-face
|
1699
|
-
const split = href.split('/');
|
1700
|
-
const stylePath = split.slice(0, split.length - 1).join('/');
|
1701
|
-
const cssText = cssRule.cssText;
|
1702
|
-
const newCssText = cssText.replace(
|
1703
|
-
// relative paths
|
1704
|
-
/url\s*\(\s*['"]?(?!((\/)|((?:https?:)?\/\/)|(?:data:?:)))([^'")]+)['"]?\s*\)/g, `url("${stylePath}/$4")`);
|
1705
|
-
if (cssText === newCssText)
|
1706
|
-
return;
|
1707
|
-
fixedRules.push(newCssText);
|
1708
|
-
});
|
1709
|
-
return [rules.join('\n'), fixedRules.join('\n')];
|
1710
|
-
}
|
1711
|
-
/**
|
1712
|
-
* アクションにグローバルなスタイルを読み込む
|
1713
|
-
*
|
1714
|
-
* @param href - style ファイルのリンク URL
|
1715
|
-
*
|
1716
|
-
* @public
|
1717
|
-
*/
|
1718
|
-
async function loadStyle(href) {
|
1719
|
-
const sr = getActionRoot();
|
1720
|
-
if (!sr)
|
1721
|
-
return;
|
1722
|
-
let cssRules = '';
|
1723
|
-
try {
|
1724
|
-
const res = await fetch(href);
|
1725
|
-
cssRules = await res.text();
|
1726
|
-
}
|
1727
|
-
catch (_) {
|
1728
|
-
// pass
|
1729
|
-
}
|
1730
|
-
if (!cssRules)
|
1731
|
-
return;
|
1732
|
-
// Chromeのバグで、Shadow Rootの@font-faceを絶対パスで指定する必要がある
|
1733
|
-
// @see https://stackoverflow.com/a/63717709
|
1734
|
-
const [rules, fontFaceRules] = await fixFontFaceIssue(href, cssRules);
|
1735
|
-
const css = new CSSStyleSheet();
|
1736
|
-
// @ts-ignore
|
1737
|
-
await css.replace(rules);
|
1738
|
-
const fontFaceCss = new CSSStyleSheet();
|
1739
|
-
// @ts-ignore
|
1740
|
-
await fontFaceCss.replace(fontFaceRules);
|
1741
|
-
// @ts-ignore
|
1742
|
-
sr.adoptedStyleSheets = [...sr.adoptedStyleSheets, css, fontFaceCss];
|
1743
|
-
// Chromeのバグで、ページとShadow Rootの両方に、@font-faceを設定する必要がある
|
1744
|
-
// @see https://stackoverflow.com/a/63717709
|
1745
|
-
// @ts-ignore
|
1746
|
-
document.adoptedStyleSheets = [...document.adoptedStyleSheets, css, fontFaceCss];
|
1747
|
-
}
|
1748
|
-
// @internal
|
1749
|
-
function getCssVariables(data) {
|
1750
|
-
return Object.entries(data)
|
1751
|
-
.filter(([key, value]) => {
|
1752
|
-
return ['string', 'number'].includes(typeof value) && key.startsWith('--');
|
1753
|
-
})
|
1754
|
-
.map(([key, value]) => `${key}:${value}`)
|
1755
|
-
.join(';');
|
1756
|
-
}
|
1757
|
-
/**
|
1758
|
-
* アクションのルートの DOM 要素を取得する
|
1759
|
-
*
|
1760
|
-
* @returns アクションがルートの DOM 要素 を持つ場合は DOM 要素を返します。ない場合は `null` を返します
|
1761
|
-
*
|
1762
|
-
* @public
|
1763
|
-
*/
|
1764
|
-
function getActionRoot() {
|
1765
|
-
const root = document.querySelector(`.${KARTE_ACTION_ROOT}[data-${KARTE_ACTION_RID}='${actionId}']`);
|
1766
|
-
if (!root?.shadowRoot) {
|
1767
|
-
return null;
|
1768
|
-
}
|
1769
|
-
return root.shadowRoot;
|
1770
|
-
}
|
1771
1627
|
/** @internal */
|
1772
1628
|
function createModal(App, options = {
|
1773
1629
|
send: () => { },
|
@@ -1863,7 +1719,7 @@ function createModal(App, options = {
|
|
1863
1719
|
return;
|
1864
1720
|
}
|
1865
1721
|
const props = {
|
1866
|
-
target: ensureActionRoot(!true),
|
1722
|
+
target: ensureActionRoot$1(!true),
|
1867
1723
|
hydrate: true,
|
1868
1724
|
props: {
|
1869
1725
|
send: options.send,
|
@@ -1955,7 +1811,7 @@ function createModal(App, options = {
|
|
1955
1811
|
return appCleanup;
|
1956
1812
|
}
|
1957
1813
|
/** @internal */
|
1958
|
-
function ensureActionRoot(useShadow = true) {
|
1814
|
+
function ensureActionRoot$1(useShadow = true) {
|
1959
1815
|
const systemConfig = getSystem();
|
1960
1816
|
const rootAttrs = {
|
1961
1817
|
class: `${KARTE_ACTION_ROOT} ${KARTE_MODAL_ROOT}`,
|
@@ -1978,164 +1834,53 @@ function ensureActionRoot(useShadow = true) {
|
|
1978
1834
|
return el;
|
1979
1835
|
}
|
1980
1836
|
}
|
1837
|
+
|
1981
1838
|
/**
|
1982
|
-
*
|
1983
|
-
*
|
1984
|
-
* @deprecated 非推奨
|
1985
|
-
*
|
1986
|
-
* @internal
|
1987
|
-
*/
|
1988
|
-
const show = showAction;
|
1989
|
-
/**
|
1990
|
-
* 非推奨
|
1991
|
-
*
|
1992
|
-
* @deprecated 非推奨
|
1993
|
-
*
|
1994
|
-
* @internal
|
1995
|
-
*/
|
1996
|
-
const close = closeAction;
|
1997
|
-
/**
|
1998
|
-
* 非推奨
|
1999
|
-
*
|
2000
|
-
* @deprecated 非推奨
|
2001
|
-
*
|
2002
|
-
* @internal
|
2003
|
-
*/
|
2004
|
-
const ensureModalRoot = ensureActionRoot;
|
2005
|
-
/**
|
2006
|
-
* 非推奨
|
2007
|
-
*
|
2008
|
-
* @deprecated 非推奨
|
2009
|
-
*
|
2010
|
-
* @internal
|
1839
|
+
* スクリプト接客が利用するコードの管理
|
2011
1840
|
*/
|
2012
|
-
|
1841
|
+
/** @internal */
|
1842
|
+
async function runScript$1(options = {
|
2013
1843
|
send: () => { },
|
2014
1844
|
publish: () => { },
|
2015
1845
|
props: {},
|
2016
1846
|
variables: {},
|
2017
1847
|
localVariablesQuery: undefined,
|
2018
|
-
|
1848
|
+
karteTemplate: {},
|
1849
|
+
context: { api_key: '', collection_endpoint: undefined },
|
2019
1850
|
}) {
|
2020
|
-
|
2021
|
-
|
2022
|
-
|
2023
|
-
|
2024
|
-
|
2025
|
-
|
2026
|
-
|
2027
|
-
|
2028
|
-
|
2029
|
-
|
2030
|
-
const
|
2031
|
-
|
2032
|
-
|
2033
|
-
|
2034
|
-
publish: options.publish,
|
2035
|
-
close,
|
2036
|
-
data: {
|
2037
|
-
...options.props,
|
2038
|
-
...options.variables,
|
2039
|
-
},
|
2040
|
-
},
|
1851
|
+
if (!options.onCreate)
|
1852
|
+
return;
|
1853
|
+
let data = getVariables();
|
1854
|
+
initialize({ send: options.send, initialState: data.initial_state });
|
1855
|
+
initActionTable(options.localVariablesQuery);
|
1856
|
+
const { success } = await setupActionTable(options.localVariablesQuery, data, data.api_key, options.context.collection_endpoint);
|
1857
|
+
if (!success)
|
1858
|
+
return;
|
1859
|
+
// Action Tableの取得結果を反映する
|
1860
|
+
data = getVariables();
|
1861
|
+
const actionProps = {
|
1862
|
+
send: options.send,
|
1863
|
+
publish: options.publish,
|
1864
|
+
data,
|
2041
1865
|
};
|
2042
|
-
|
2043
|
-
|
2044
|
-
|
2045
|
-
|
1866
|
+
options.send('script_fired');
|
1867
|
+
// 旧Widget API IFの処理
|
1868
|
+
const { onCreateHandlers } = getInternalHandlers();
|
1869
|
+
if (onCreateHandlers) {
|
1870
|
+
onCreateHandlers.forEach(h => {
|
1871
|
+
h({ send: options.send, publish: options.publish, data });
|
1872
|
+
console.debug(`${ACTION_HOOK_LABEL}: onCreate`);
|
1873
|
+
});
|
2046
1874
|
}
|
2047
|
-
|
2048
|
-
|
2049
|
-
show: () => {
|
2050
|
-
if (app) {
|
2051
|
-
return;
|
2052
|
-
}
|
2053
|
-
options.send('message_open');
|
2054
|
-
app = svelte.hydrate(App, appArgs)
|
2055
|
-
|
2056
|
-
;
|
2057
|
-
},
|
2058
|
-
};
|
1875
|
+
options.onCreate(actionProps);
|
1876
|
+
finalize();
|
2059
1877
|
}
|
2060
1878
|
/**
|
2061
|
-
*
|
1879
|
+
* ES Modules に対応していない JavaScript をページに読み込む
|
2062
1880
|
*
|
2063
|
-
* @
|
1881
|
+
* @param src - JavaScript ファイルのリンク URL
|
2064
1882
|
*
|
2065
|
-
* @
|
2066
|
-
*/
|
2067
|
-
function createFog({ color = '#000', opacity = '50%', zIndex = 999, onclick, }) {
|
2068
|
-
const root = ensureModalRoot(false);
|
2069
|
-
if (root.querySelector('.__krt-fog')) {
|
2070
|
-
return { fog: null, close: () => { } };
|
2071
|
-
}
|
2072
|
-
const fog = document.createElement('div');
|
2073
|
-
fog.className = '__krt-fog';
|
2074
|
-
Object.assign(fog.style, {
|
2075
|
-
position: 'fixed',
|
2076
|
-
left: 0,
|
2077
|
-
top: 0,
|
2078
|
-
width: '100%',
|
2079
|
-
height: '100%',
|
2080
|
-
'z-index': zIndex,
|
2081
|
-
'background-color': color,
|
2082
|
-
opacity,
|
2083
|
-
});
|
2084
|
-
const close = () => {
|
2085
|
-
onclick();
|
2086
|
-
fog.remove();
|
2087
|
-
};
|
2088
|
-
fog.onclick = close;
|
2089
|
-
root.appendChild(fog);
|
2090
|
-
return { fog, close };
|
2091
|
-
}
|
2092
|
-
|
2093
|
-
/**
|
2094
|
-
* スクリプト接客が利用するコードの管理
|
2095
|
-
*/
|
2096
|
-
/** @internal */
|
2097
|
-
async function runScript$1(options = {
|
2098
|
-
send: () => { },
|
2099
|
-
publish: () => { },
|
2100
|
-
props: {},
|
2101
|
-
variables: {},
|
2102
|
-
localVariablesQuery: undefined,
|
2103
|
-
karteTemplate: {},
|
2104
|
-
context: { api_key: '', collection_endpoint: undefined },
|
2105
|
-
}) {
|
2106
|
-
if (!options.onCreate)
|
2107
|
-
return;
|
2108
|
-
let data = getVariables();
|
2109
|
-
initialize({ send: options.send, initialState: data.initial_state });
|
2110
|
-
initActionTable(options.localVariablesQuery);
|
2111
|
-
const { success } = await setupActionTable(options.localVariablesQuery, data, data.api_key, options.context.collection_endpoint);
|
2112
|
-
if (!success)
|
2113
|
-
return;
|
2114
|
-
// Action Tableの取得結果を反映する
|
2115
|
-
data = getVariables();
|
2116
|
-
const actionProps = {
|
2117
|
-
send: options.send,
|
2118
|
-
publish: options.publish,
|
2119
|
-
data,
|
2120
|
-
};
|
2121
|
-
options.send('script_fired');
|
2122
|
-
// 旧Widget API IFの処理
|
2123
|
-
const { onCreateHandlers } = getInternalHandlers();
|
2124
|
-
if (onCreateHandlers) {
|
2125
|
-
onCreateHandlers.forEach(h => {
|
2126
|
-
h({ send: options.send, publish: options.publish, data });
|
2127
|
-
console.debug(`${ACTION_HOOK_LABEL}: onCreate`);
|
2128
|
-
});
|
2129
|
-
}
|
2130
|
-
options.onCreate(actionProps);
|
2131
|
-
finalize();
|
2132
|
-
}
|
2133
|
-
/**
|
2134
|
-
* ES Modules に対応していない JavaScript をページに読み込む
|
2135
|
-
*
|
2136
|
-
* @param src - JavaScript ファイルのリンク URL
|
2137
|
-
*
|
2138
|
-
* @public
|
1883
|
+
* @public
|
2139
1884
|
*/
|
2140
1885
|
async function loadGlobalScript(src) {
|
2141
1886
|
return new Promise((resolve, reject) => {
|
@@ -2304,15 +2049,301 @@ function onDestroy(fn) {
|
|
2304
2049
|
onDestroyHandlers.push(fn);
|
2305
2050
|
setInternalHandlers({ onDestroyHandlers });
|
2306
2051
|
}
|
2307
|
-
// -------- The following codes are deprecated --------
|
2308
|
-
/**
|
2309
|
-
* 非推奨
|
2310
|
-
*
|
2311
|
-
* @deprecated 非推奨
|
2312
|
-
*
|
2313
|
-
* @internal
|
2314
|
-
*/
|
2315
|
-
const showModal = create;
|
2052
|
+
// -------- The following codes are deprecated --------
|
2053
|
+
/**
|
2054
|
+
* 非推奨
|
2055
|
+
*
|
2056
|
+
* @deprecated 非推奨
|
2057
|
+
*
|
2058
|
+
* @internal
|
2059
|
+
*/
|
2060
|
+
const showModal = create;
|
2061
|
+
/**
|
2062
|
+
* 非推奨
|
2063
|
+
*
|
2064
|
+
* @deprecated 非推奨
|
2065
|
+
*
|
2066
|
+
* @internal
|
2067
|
+
*/
|
2068
|
+
function destroy() {
|
2069
|
+
setDestroyed(true);
|
2070
|
+
dispatchDestroyEvent();
|
2071
|
+
}
|
2072
|
+
|
2073
|
+
/**
|
2074
|
+
* モーダル(ポップアップ)に関連するコードの管理
|
2075
|
+
*
|
2076
|
+
* アクションのShow, Close, ChangeStateの状態はここで管理する。
|
2077
|
+
*/
|
2078
|
+
/**
|
2079
|
+
* アクションが表示 (show) された後にフックする関数
|
2080
|
+
*
|
2081
|
+
* @param fn - 呼び出されるフック関数
|
2082
|
+
*
|
2083
|
+
* @public
|
2084
|
+
*/
|
2085
|
+
function onShow(fn) {
|
2086
|
+
let { onShowHandlers } = getInternalHandlers();
|
2087
|
+
if (!onShowHandlers) {
|
2088
|
+
onShowHandlers = [];
|
2089
|
+
}
|
2090
|
+
onShowHandlers.push(fn);
|
2091
|
+
setInternalHandlers({ onShowHandlers });
|
2092
|
+
}
|
2093
|
+
/**
|
2094
|
+
* アクションがクローズ (close) される前にフックする関数
|
2095
|
+
*
|
2096
|
+
* @param fn - 呼び出されるフック関数
|
2097
|
+
*
|
2098
|
+
* @public
|
2099
|
+
*/
|
2100
|
+
function onClose(fn) {
|
2101
|
+
let { onCloseHandlers } = getInternalHandlers();
|
2102
|
+
if (!onCloseHandlers) {
|
2103
|
+
onCloseHandlers = [];
|
2104
|
+
}
|
2105
|
+
onCloseHandlers.push(fn);
|
2106
|
+
setInternalHandlers({ onCloseHandlers });
|
2107
|
+
}
|
2108
|
+
/**
|
2109
|
+
* アクションのステートが変更された (changeState) 後にフックする関数
|
2110
|
+
*
|
2111
|
+
* @param fn - 呼び出されるフック関数
|
2112
|
+
*
|
2113
|
+
* @public
|
2114
|
+
*/
|
2115
|
+
function onChangeState(fn) {
|
2116
|
+
let { onChangeStateHandlers } = getInternalHandlers();
|
2117
|
+
if (!onChangeStateHandlers) {
|
2118
|
+
onChangeStateHandlers = [];
|
2119
|
+
}
|
2120
|
+
onChangeStateHandlers.push(fn);
|
2121
|
+
setInternalHandlers({ onChangeStateHandlers });
|
2122
|
+
}
|
2123
|
+
/**
|
2124
|
+
* アクションを表示する
|
2125
|
+
*
|
2126
|
+
* @public
|
2127
|
+
*/
|
2128
|
+
function showAction() {
|
2129
|
+
const event = new CustomEvent(ACTION_SHOW_EVENT, { detail: { trigger: 'custom' } });
|
2130
|
+
window.dispatchEvent(event);
|
2131
|
+
}
|
2132
|
+
/**
|
2133
|
+
* アクションを閉じる
|
2134
|
+
*
|
2135
|
+
* @param trigger - 閉じた時のトリガー。デフォルト `'none'`
|
2136
|
+
*
|
2137
|
+
* @public
|
2138
|
+
*/
|
2139
|
+
function closeAction(trigger = 'none') {
|
2140
|
+
const event = new CustomEvent(ACTION_CLOSE_EVENT, { detail: { trigger } });
|
2141
|
+
window.dispatchEvent(event);
|
2142
|
+
}
|
2143
|
+
/**
|
2144
|
+
* アクションに CSS を適用する
|
2145
|
+
*
|
2146
|
+
* @param css - 適用する CSS
|
2147
|
+
*
|
2148
|
+
* @returns 適用された style 要素を返す Promise
|
2149
|
+
*
|
2150
|
+
* @public
|
2151
|
+
*/
|
2152
|
+
async function applyCss(css) {
|
2153
|
+
return new Promise((resolve, reject) => {
|
2154
|
+
const style = document.createElement('style');
|
2155
|
+
style.textContent = css;
|
2156
|
+
const shadowRoot = getActionRoot();
|
2157
|
+
if (!shadowRoot)
|
2158
|
+
return;
|
2159
|
+
shadowRoot.append(style);
|
2160
|
+
style.addEventListener('load', () => resolve(style));
|
2161
|
+
style.addEventListener('error', () => reject(style));
|
2162
|
+
});
|
2163
|
+
}
|
2164
|
+
async function fixFontFaceIssue(href, cssRules) {
|
2165
|
+
const css = new CSSStyleSheet();
|
2166
|
+
// @ts-ignore
|
2167
|
+
await css.replace(cssRules);
|
2168
|
+
const rules = [];
|
2169
|
+
const fixedRules = [];
|
2170
|
+
Array.from(css.cssRules).forEach(cssRule => {
|
2171
|
+
if (cssRule.type !== 5) {
|
2172
|
+
rules.push(cssRule.cssText);
|
2173
|
+
}
|
2174
|
+
// type 5 is @font-face
|
2175
|
+
const split = href.split('/');
|
2176
|
+
const stylePath = split.slice(0, split.length - 1).join('/');
|
2177
|
+
const cssText = cssRule.cssText;
|
2178
|
+
const newCssText = cssText.replace(
|
2179
|
+
// relative paths
|
2180
|
+
/url\s*\(\s*['"]?(?!((\/)|((?:https?:)?\/\/)|(?:data:?:)))([^'")]+)['"]?\s*\)/g, `url("${stylePath}/$4")`);
|
2181
|
+
if (cssText === newCssText)
|
2182
|
+
return;
|
2183
|
+
fixedRules.push(newCssText);
|
2184
|
+
});
|
2185
|
+
return [rules.join('\n'), fixedRules.join('\n')];
|
2186
|
+
}
|
2187
|
+
/**
|
2188
|
+
* アクションにグローバルなスタイルを読み込む
|
2189
|
+
*
|
2190
|
+
* @param href - style ファイルのリンク URL
|
2191
|
+
*
|
2192
|
+
* @public
|
2193
|
+
*/
|
2194
|
+
async function loadStyle(href) {
|
2195
|
+
const sr = getActionRoot();
|
2196
|
+
if (!sr)
|
2197
|
+
return;
|
2198
|
+
let cssRules = '';
|
2199
|
+
try {
|
2200
|
+
const res = await fetch(href);
|
2201
|
+
cssRules = await res.text();
|
2202
|
+
}
|
2203
|
+
catch (_) {
|
2204
|
+
// pass
|
2205
|
+
}
|
2206
|
+
if (!cssRules)
|
2207
|
+
return;
|
2208
|
+
// Chromeのバグで、Shadow Rootの@font-faceを絶対パスで指定する必要がある
|
2209
|
+
// @see https://stackoverflow.com/a/63717709
|
2210
|
+
const [rules, fontFaceRules] = await fixFontFaceIssue(href, cssRules);
|
2211
|
+
const css = new CSSStyleSheet();
|
2212
|
+
// @ts-ignore
|
2213
|
+
await css.replace(rules);
|
2214
|
+
const fontFaceCss = new CSSStyleSheet();
|
2215
|
+
// @ts-ignore
|
2216
|
+
await fontFaceCss.replace(fontFaceRules);
|
2217
|
+
// @ts-ignore
|
2218
|
+
sr.adoptedStyleSheets = [...sr.adoptedStyleSheets, css, fontFaceCss];
|
2219
|
+
// Chromeのバグで、ページとShadow Rootの両方に、@font-faceを設定する必要がある
|
2220
|
+
// @see https://stackoverflow.com/a/63717709
|
2221
|
+
// @ts-ignore
|
2222
|
+
document.adoptedStyleSheets = [...document.adoptedStyleSheets, css, fontFaceCss];
|
2223
|
+
}
|
2224
|
+
// @internal
|
2225
|
+
function getCssVariables(data) {
|
2226
|
+
return Object.entries(data)
|
2227
|
+
.filter(([key, value]) => {
|
2228
|
+
return ['string', 'number'].includes(typeof value) && key.startsWith('--');
|
2229
|
+
})
|
2230
|
+
.map(([key, value]) => `${key}:${value}`)
|
2231
|
+
.join(';');
|
2232
|
+
}
|
2233
|
+
/**
|
2234
|
+
* アクションのルートの DOM 要素を取得する
|
2235
|
+
*
|
2236
|
+
* @returns アクションがルートの DOM 要素 を持つ場合は DOM 要素を返します。ない場合は `null` を返します
|
2237
|
+
*
|
2238
|
+
* @public
|
2239
|
+
*/
|
2240
|
+
function getActionRoot() {
|
2241
|
+
const root = document.querySelector(`.${KARTE_ACTION_ROOT}[data-${KARTE_ACTION_RID}='${actionId}']`);
|
2242
|
+
if (!root?.shadowRoot) {
|
2243
|
+
return null;
|
2244
|
+
}
|
2245
|
+
return root.shadowRoot;
|
2246
|
+
}
|
2247
|
+
/** @internal */
|
2248
|
+
function ensureActionRoot() {
|
2249
|
+
const systemConfig = getSystem();
|
2250
|
+
const rootAttrs = {
|
2251
|
+
class: `${KARTE_ACTION_ROOT} ${KARTE_MODAL_ROOT}`,
|
2252
|
+
[`data-${KARTE_ACTION_RID}`]: actionId,
|
2253
|
+
[`data-${KARTE_ACTION_SHORTEN_ID}`]: systemConfig.shortenId
|
2254
|
+
? systemConfig.shortenId
|
2255
|
+
: ALL_ACTION_SHORTEN_ID,
|
2256
|
+
style: { display: 'block' },
|
2257
|
+
};
|
2258
|
+
let el = document.querySelector(`.${KARTE_MODAL_ROOT}[data-${KARTE_ACTION_RID}='${actionId}']`);
|
2259
|
+
if (el == null) {
|
2260
|
+
el = h('div', rootAttrs);
|
2261
|
+
document.body.appendChild(el);
|
2262
|
+
}
|
2263
|
+
const isShadow = !!document.body.attachShadow;
|
2264
|
+
if (isShadow) {
|
2265
|
+
return el.shadowRoot ?? el.attachShadow({ mode: 'open' });
|
2266
|
+
}
|
2267
|
+
else {
|
2268
|
+
return el;
|
2269
|
+
}
|
2270
|
+
}
|
2271
|
+
/**
|
2272
|
+
* 非推奨
|
2273
|
+
*
|
2274
|
+
* @deprecated 非推奨
|
2275
|
+
*
|
2276
|
+
* @internal
|
2277
|
+
*/
|
2278
|
+
const show = showAction;
|
2279
|
+
/**
|
2280
|
+
* 非推奨
|
2281
|
+
*
|
2282
|
+
* @deprecated 非推奨
|
2283
|
+
*
|
2284
|
+
* @internal
|
2285
|
+
*/
|
2286
|
+
const close = closeAction;
|
2287
|
+
/**
|
2288
|
+
* 非推奨
|
2289
|
+
*
|
2290
|
+
* @deprecated 非推奨
|
2291
|
+
*
|
2292
|
+
* @internal
|
2293
|
+
*/
|
2294
|
+
const ensureModalRoot = ensureActionRoot;
|
2295
|
+
/**
|
2296
|
+
* 非推奨
|
2297
|
+
*
|
2298
|
+
* @deprecated 非推奨
|
2299
|
+
*
|
2300
|
+
* @internal
|
2301
|
+
*/
|
2302
|
+
function createApp(App, options = {
|
2303
|
+
send: () => { },
|
2304
|
+
publish: () => { },
|
2305
|
+
props: {},
|
2306
|
+
variables: {},
|
2307
|
+
localVariablesQuery: undefined,
|
2308
|
+
context: { api_key: '' },
|
2309
|
+
}) {
|
2310
|
+
let app = null;
|
2311
|
+
const close = () => {
|
2312
|
+
if (app) {
|
2313
|
+
{
|
2314
|
+
// @ts-ignore -- Svelte3 では `unmount` は存在しない
|
2315
|
+
svelte.unmount(app);
|
2316
|
+
}
|
2317
|
+
app = null;
|
2318
|
+
}
|
2319
|
+
};
|
2320
|
+
const appArgs = {
|
2321
|
+
target: null,
|
2322
|
+
props: {
|
2323
|
+
send: options.send,
|
2324
|
+
publish: options.publish,
|
2325
|
+
close,
|
2326
|
+
data: {
|
2327
|
+
...options.props,
|
2328
|
+
...options.variables,
|
2329
|
+
},
|
2330
|
+
},
|
2331
|
+
};
|
2332
|
+
const win = ensureModalRoot();
|
2333
|
+
appArgs.target = win;
|
2334
|
+
return {
|
2335
|
+
close,
|
2336
|
+
show: () => {
|
2337
|
+
if (app) {
|
2338
|
+
return;
|
2339
|
+
}
|
2340
|
+
options.send('message_open');
|
2341
|
+
app = // @ts-ignore -- Svelte3 では `mount` は存在しない
|
2342
|
+
svelte.mount(App, appArgs)
|
2343
|
+
;
|
2344
|
+
},
|
2345
|
+
};
|
2346
|
+
}
|
2316
2347
|
/**
|
2317
2348
|
* 非推奨
|
2318
2349
|
*
|
@@ -2320,9 +2351,30 @@ const showModal = create;
|
|
2320
2351
|
*
|
2321
2352
|
* @internal
|
2322
2353
|
*/
|
2323
|
-
function
|
2324
|
-
|
2325
|
-
|
2354
|
+
function createFog({ color = '#000', opacity = '50%', zIndex = 999, onclick, }) {
|
2355
|
+
const root = ensureModalRoot();
|
2356
|
+
if (root.querySelector('.__krt-fog')) {
|
2357
|
+
return { fog: null, close: () => { } };
|
2358
|
+
}
|
2359
|
+
const fog = document.createElement('div');
|
2360
|
+
fog.className = '__krt-fog';
|
2361
|
+
Object.assign(fog.style, {
|
2362
|
+
position: 'fixed',
|
2363
|
+
left: 0,
|
2364
|
+
top: 0,
|
2365
|
+
width: '100%',
|
2366
|
+
height: '100%',
|
2367
|
+
'z-index': zIndex,
|
2368
|
+
'background-color': color,
|
2369
|
+
opacity,
|
2370
|
+
});
|
2371
|
+
const close = () => {
|
2372
|
+
onclick();
|
2373
|
+
fog.remove();
|
2374
|
+
};
|
2375
|
+
fog.onclick = close;
|
2376
|
+
root.appendChild(fog);
|
2377
|
+
return { fog, close };
|
2326
2378
|
}
|
2327
2379
|
|
2328
2380
|
const USER_ID_VARIABLE_NAME = '__karte_form_identify_user_id';
|
@@ -2732,13 +2784,13 @@ var widget = /*#__PURE__*/Object.freeze({
|
|
2732
2784
|
collection: collection,
|
2733
2785
|
getState: getState,
|
2734
2786
|
getVal: getVal,
|
2735
|
-
hide: closeAction,
|
2787
|
+
hide: closeAction$1,
|
2736
2788
|
method: method,
|
2737
2789
|
on: on,
|
2738
2790
|
onChangeVal: onChangeVal,
|
2739
2791
|
setState: setState,
|
2740
2792
|
setVal: setVal,
|
2741
|
-
show: showAction,
|
2793
|
+
show: showAction$1,
|
2742
2794
|
storage: storage
|
2743
2795
|
});
|
2744
2796
|
|
@@ -2783,7 +2835,7 @@ const LAYOUT_COMPONENT_NAMES = [
|
|
2783
2835
|
'StateItem',
|
2784
2836
|
];
|
2785
2837
|
|
2786
|
-
var root_2$
|
2838
|
+
var root_2$5 = $.template(`<link type="text/css" rel="stylesheet">`);
|
2787
2839
|
|
2788
2840
|
function Header($$anchor, $$props) {
|
2789
2841
|
$.push($$props, false);
|
@@ -2819,7 +2871,7 @@ function Header($$anchor, $$props) {
|
|
2819
2871
|
|
2820
2872
|
{
|
2821
2873
|
var consequent = ($$anchor) => {
|
2822
|
-
var link = root_2$
|
2874
|
+
var link = root_2$5();
|
2823
2875
|
|
2824
2876
|
$.template_effect(() => $.set_attribute(link, 'href', $.get(googleFontUrl)));
|
2825
2877
|
$.append($$anchor, link);
|
@@ -2893,16 +2945,16 @@ function State($$anchor, $$props) {
|
|
2893
2945
|
|
2894
2946
|
const STATE_ITEM_CONTEXT_KEY = Symbol();
|
2895
2947
|
|
2896
|
-
var root_1$
|
2948
|
+
var root_1$9 = $.template(`<div class="state-item svelte-2qb6dm"></div> <!>`, 1);
|
2897
2949
|
|
2898
|
-
const $$css$
|
2950
|
+
const $$css$n = {
|
2899
2951
|
hash: 'svelte-2qb6dm',
|
2900
2952
|
code: '.state-item.svelte-2qb6dm {position:absolute;display:none;}'
|
2901
2953
|
};
|
2902
2954
|
|
2903
2955
|
function StateItem($$anchor, $$props) {
|
2904
2956
|
$.push($$props, false);
|
2905
|
-
$.append_styles($$anchor, $$css$
|
2957
|
+
$.append_styles($$anchor, $$css$n);
|
2906
2958
|
|
2907
2959
|
const [$$stores, $$cleanup] = $.setup_stores();
|
2908
2960
|
const $state = () => $.store_get(state, '$state', $$stores);
|
@@ -2922,7 +2974,7 @@ function StateItem($$anchor, $$props) {
|
|
2922
2974
|
|
2923
2975
|
{
|
2924
2976
|
var consequent = ($$anchor) => {
|
2925
|
-
var fragment_1 = root_1$
|
2977
|
+
var fragment_1 = root_1$9();
|
2926
2978
|
var div = $.first_child(fragment_1);
|
2927
2979
|
var node_1 = $.sibling(div, 2);
|
2928
2980
|
|
@@ -3430,16 +3482,16 @@ const AVATAR_SIZE_STYLES = {
|
|
3430
3482
|
},
|
3431
3483
|
};
|
3432
3484
|
|
3433
|
-
var root_1$
|
3485
|
+
var root_1$8 = $.template(`<img class="avatar-image svelte-1krsdyx">`);
|
3434
3486
|
|
3435
|
-
const $$css$
|
3487
|
+
const $$css$m = {
|
3436
3488
|
hash: 'svelte-1krsdyx',
|
3437
3489
|
code: '.avatar.svelte-1krsdyx {display:flex;align-items:center;justify-content:center;overflow:hidden;flex-shrink:0;border:0;}'
|
3438
3490
|
};
|
3439
3491
|
|
3440
3492
|
function Avatar($$anchor, $$props) {
|
3441
3493
|
$.push($$props, false);
|
3442
|
-
$.append_styles($$anchor, $$css$
|
3494
|
+
$.append_styles($$anchor, $$css$m);
|
3443
3495
|
|
3444
3496
|
const style = $.mutable_state();
|
3445
3497
|
const imgStyle = $.mutable_state();
|
@@ -3511,7 +3563,7 @@ function Avatar($$anchor, $$props) {
|
|
3511
3563
|
|
3512
3564
|
$.event('click', $$element, handleClick);
|
3513
3565
|
|
3514
|
-
var img = root_1$
|
3566
|
+
var img = root_1$8();
|
3515
3567
|
|
3516
3568
|
$.template_effect(() => {
|
3517
3569
|
$.set_attribute(img, 'src', props().image);
|
@@ -4009,14 +4061,14 @@ const ICON_VARIANTS = {
|
|
4009
4061
|
x_mark: IconXMark,
|
4010
4062
|
};
|
4011
4063
|
|
4012
|
-
const $$css$
|
4064
|
+
const $$css$l = {
|
4013
4065
|
hash: 'svelte-19rssou',
|
4014
4066
|
code: '.icon.svelte-19rssou {display:flex;align-items:center;overflow:hidden;width:auto;cursor:pointer;text-decoration:none;}'
|
4015
4067
|
};
|
4016
4068
|
|
4017
4069
|
function Icon($$anchor, $$props) {
|
4018
4070
|
$.push($$props, false);
|
4019
|
-
$.append_styles($$anchor, $$css$
|
4071
|
+
$.append_styles($$anchor, $$css$l);
|
4020
4072
|
|
4021
4073
|
const style = $.mutable_state();
|
4022
4074
|
const IconComponent = $.mutable_state();
|
@@ -4280,17 +4332,17 @@ function darkenColor(color, percent) {
|
|
4280
4332
|
return rgbToHex(r, g, b);
|
4281
4333
|
}
|
4282
4334
|
|
4283
|
-
var root_2$
|
4284
|
-
var root_1$
|
4335
|
+
var root_2$4 = $.template(`<div class="button-icon svelte-o2gomt"><!></div>`);
|
4336
|
+
var root_1$7 = $.template(`<!> <span class="button-label"> </span>`, 1);
|
4285
4337
|
|
4286
|
-
const $$css$
|
4338
|
+
const $$css$k = {
|
4287
4339
|
hash: 'svelte-o2gomt',
|
4288
4340
|
code: '.button.svelte-o2gomt {display:inline-flex;gap:0.8em;align-items:center;justify-content:center;text-decoration:none;outline:0;border-width:1px;border-style:solid;line-height:1.5;transition:background-color 0.12s, border-color 0.12s, color 0.12s;cursor:pointer;color:var(--color);border-color:var(--border-color);background-color:var(--bg-color);}.button.svelte-o2gomt:hover {background-color:var(--hover-bg-color);border-color:var(--hover-border-color);}.button-icon.svelte-o2gomt {display:flex;align-items:center;justify-content:center;margin-left:-0.2em;margin-right:-0.2em;}'
|
4289
4341
|
};
|
4290
4342
|
|
4291
4343
|
function Button($$anchor, $$props) {
|
4292
4344
|
$.push($$props, false);
|
4293
|
-
$.append_styles($$anchor, $$css$
|
4345
|
+
$.append_styles($$anchor, $$css$k);
|
4294
4346
|
|
4295
4347
|
const variables = $.mutable_state();
|
4296
4348
|
const style = $.mutable_state();
|
@@ -4410,12 +4462,12 @@ function Button($$anchor, $$props) {
|
|
4410
4462
|
|
4411
4463
|
$.event('click', $$element, handleClick);
|
4412
4464
|
|
4413
|
-
var fragment_1 = root_1$
|
4465
|
+
var fragment_1 = root_1$7();
|
4414
4466
|
var node_1 = $.first_child(fragment_1);
|
4415
4467
|
|
4416
4468
|
{
|
4417
4469
|
var consequent = ($$anchor) => {
|
4418
|
-
var div = root_2$
|
4470
|
+
var div = root_2$4();
|
4419
4471
|
var node_2 = $.child(div);
|
4420
4472
|
|
4421
4473
|
const expression = $.derived_safe_equal(() => ({
|
@@ -4551,17 +4603,17 @@ const BUTTON_OUTLINED_WRAP_STYLES = {
|
|
4551
4603
|
},
|
4552
4604
|
};
|
4553
4605
|
|
4554
|
-
var root_2$
|
4555
|
-
var root_1$
|
4606
|
+
var root_2$3 = $.template(`<div class="button-outlined-icon svelte-38fju1"><!></div>`);
|
4607
|
+
var root_1$6 = $.template(`<!> <span class="button-outlined-label svelte-38fju1"> </span>`, 1);
|
4556
4608
|
|
4557
|
-
const $$css$
|
4609
|
+
const $$css$j = {
|
4558
4610
|
hash: 'svelte-38fju1',
|
4559
4611
|
code: '.button-outlined.svelte-38fju1 {display:inline-flex;gap:0.65em;align-items:center;justify-content:center;text-decoration:none;outline:0;border-width:1px;border-style:solid;line-height:1.5;transition:background-color 0.12s, border-color 0.12s, color 0.12s;cursor:pointer;background-color:var(--bg-color);}.button-outlined.svelte-38fju1:hover {background-color:var(--hover-bg-color);}.button-outlined-icon.svelte-38fju1 {display:flex;align-items:center;justify-content:center;margin-left:-0.2em;margin-right:-0.2em;margin-bottom:0.1em;}'
|
4560
4612
|
};
|
4561
4613
|
|
4562
4614
|
function ButtonOutlined($$anchor, $$props) {
|
4563
4615
|
$.push($$props, false);
|
4564
|
-
$.append_styles($$anchor, $$css$
|
4616
|
+
$.append_styles($$anchor, $$css$j);
|
4565
4617
|
|
4566
4618
|
const variables = $.mutable_state();
|
4567
4619
|
const style = $.mutable_state();
|
@@ -4638,12 +4690,12 @@ function ButtonOutlined($$anchor, $$props) {
|
|
4638
4690
|
|
4639
4691
|
$.event('click', $$element, handleClick);
|
4640
4692
|
|
4641
|
-
var fragment_1 = root_1$
|
4693
|
+
var fragment_1 = root_1$6();
|
4642
4694
|
var node_1 = $.first_child(fragment_1);
|
4643
4695
|
|
4644
4696
|
{
|
4645
4697
|
var consequent = ($$anchor) => {
|
4646
|
-
var div = root_2$
|
4698
|
+
var div = root_2$3();
|
4647
4699
|
var node_2 = $.child(div);
|
4648
4700
|
|
4649
4701
|
const expression = $.derived_safe_equal(() => ({
|
@@ -4736,17 +4788,17 @@ const callback$2 = ({ brandKit }) => ({
|
|
4736
4788
|
});
|
4737
4789
|
const getButtonTextThemeStyles = getPropStyles(callback$2);
|
4738
4790
|
|
4739
|
-
var root_2$
|
4740
|
-
var root_1$
|
4791
|
+
var root_2$2 = $.template(`<div class="button-text-icon svelte-1xgvp8r"><!></div>`);
|
4792
|
+
var root_1$5 = $.template(`<!> <span class="button-text-label svelte-1xgvp8r"> </span>`, 1);
|
4741
4793
|
|
4742
|
-
const $$css$
|
4794
|
+
const $$css$i = {
|
4743
4795
|
hash: 'svelte-1xgvp8r',
|
4744
4796
|
code: '.button-text.svelte-1xgvp8r {display:inline-flex;gap:0.65em;align-items:center;justify-content:center;text-decoration:none;outline:0;border:0;line-height:1.5;transition:background-color 0.12s, border-color 0.12s, color 0.12s;cursor:pointer;background-color:rgba(255, 255, 255, 0);}.button-text.svelte-1xgvp8r:hover {background-color:var(--hover-bg-color);}.button-text-icon.svelte-1xgvp8r {display:flex;align-items:center;justify-content:center;margin-left:-0.2em;margin-right:-0.2em;}'
|
4745
4797
|
};
|
4746
4798
|
|
4747
4799
|
function ButtonText($$anchor, $$props) {
|
4748
4800
|
$.push($$props, false);
|
4749
|
-
$.append_styles($$anchor, $$css$
|
4801
|
+
$.append_styles($$anchor, $$css$i);
|
4750
4802
|
|
4751
4803
|
const variables = $.mutable_state();
|
4752
4804
|
const style = $.mutable_state();
|
@@ -4813,12 +4865,12 @@ function ButtonText($$anchor, $$props) {
|
|
4813
4865
|
|
4814
4866
|
$.event('click', $$element, handleClick);
|
4815
4867
|
|
4816
|
-
var fragment_1 = root_1$
|
4868
|
+
var fragment_1 = root_1$5();
|
4817
4869
|
var node_1 = $.first_child(fragment_1);
|
4818
4870
|
|
4819
4871
|
{
|
4820
4872
|
var consequent = ($$anchor) => {
|
4821
|
-
var div = root_2$
|
4873
|
+
var div = root_2$2();
|
4822
4874
|
var node_2 = $.child(div);
|
4823
4875
|
|
4824
4876
|
const expression = $.derived_safe_equal(() => ({
|
@@ -4871,17 +4923,17 @@ const BUTTON_TEXT_THEME = {
|
|
4871
4923
|
white: 'White',
|
4872
4924
|
};
|
4873
4925
|
|
4874
|
-
var root_2 = $.template(`<span></span>`);
|
4875
|
-
var root_1$
|
4926
|
+
var root_2$1 = $.template(`<span></span>`);
|
4927
|
+
var root_1$4 = $.template(`<span><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 384 512" style="width: 100%; height: 100%;" class="svelte-3mvsv6"><path d="M342.6 150.6c12.5-12.5 12.5-32.8 0-45.3s-32.8-12.5-45.3 0L192 210.7 86.6 105.4c-12.5-12.5-32.8-12.5-45.3 0s-12.5 32.8 0 45.3L146.7 256 41.4 361.4c-12.5 12.5-12.5 32.8 0 45.3s32.8 12.5 45.3 0L192 301.3 297.4 406.6c12.5 12.5 32.8 12.5 45.3 0s12.5-32.8 0-45.3L237.3 256 342.6 150.6z"></path></svg></span> <!>`, 1);
|
4876
4928
|
|
4877
|
-
const $$css$
|
4929
|
+
const $$css$h = {
|
4878
4930
|
hash: 'svelte-3mvsv6',
|
4879
4931
|
code: '.close-button.svelte-3mvsv6 {display:inline-flex;align-items:center;justify-content:center;align-self:center;gap:8px;border-radius:100%;background:none;cursor:pointer;border:0;outline:0;transition:background-color 0.12s, border-color 0.12s, color 0.12s;}.close-button.svelte-3mvsv6 svg:where(.svelte-3mvsv6) {transition:transform 0.12s;}.close-button.svelte-3mvsv6:hover svg:where(.svelte-3mvsv6) {transform:rotate(90deg);}.close-button-order-one.svelte-3mvsv6 {order:1;}.close-button-order-two.svelte-3mvsv6 {order:2;}'
|
4880
4932
|
};
|
4881
4933
|
|
4882
4934
|
function CloseButton($$anchor, $$props) {
|
4883
4935
|
$.push($$props, false);
|
4884
|
-
$.append_styles($$anchor, $$css$
|
4936
|
+
$.append_styles($$anchor, $$css$h);
|
4885
4937
|
|
4886
4938
|
const hasLabel = $.mutable_state();
|
4887
4939
|
const style = $.mutable_state();
|
@@ -4984,7 +5036,7 @@ function CloseButton($$anchor, $$props) {
|
|
4984
5036
|
|
4985
5037
|
$.event('click', $$element, handleClick);
|
4986
5038
|
|
4987
|
-
var fragment_1 = root_1$
|
5039
|
+
var fragment_1 = root_1$4();
|
4988
5040
|
var span = $.first_child(fragment_1);
|
4989
5041
|
var svg = $.child(span);
|
4990
5042
|
|
@@ -4995,7 +5047,7 @@ function CloseButton($$anchor, $$props) {
|
|
4995
5047
|
|
4996
5048
|
{
|
4997
5049
|
var consequent = ($$anchor) => {
|
4998
|
-
var span_1 = root_2();
|
5050
|
+
var span_1 = root_2$1();
|
4999
5051
|
|
5000
5052
|
$.set_class(span_1, 1, `close-button-label ${(isLeftLabelPlacement ? 'close-button-order-one' : '') ?? ''}`, 'svelte-3mvsv6');
|
5001
5053
|
span_1.textContent = label;
|
@@ -5084,16 +5136,16 @@ const IMAGE_ROUND_STYLES = {
|
|
5084
5136
|
},
|
5085
5137
|
};
|
5086
5138
|
|
5087
|
-
var root_1$
|
5139
|
+
var root_1$3 = $.template(`<img class="image-img svelte-rewdem">`);
|
5088
5140
|
|
5089
|
-
const $$css$
|
5090
|
-
hash: 'svelte-
|
5091
|
-
code: '.image.svelte-
|
5141
|
+
const $$css$g = {
|
5142
|
+
hash: 'svelte-rewdem',
|
5143
|
+
code: '.image.svelte-rewdem {max-width:100%;overflow:hidden;display:flex;align-items:center;justify-content:center;}.image-img.svelte-rewdem {vertical-align:top;width:100%;height:100%;object-fit:cover;user-select:none;-webkit-user-drag:none;}'
|
5092
5144
|
};
|
5093
5145
|
|
5094
5146
|
function Image($$anchor, $$props) {
|
5095
5147
|
$.push($$props, false);
|
5096
|
-
$.append_styles($$anchor, $$css$
|
5148
|
+
$.append_styles($$anchor, $$css$g);
|
5097
5149
|
|
5098
5150
|
const style = $.mutable_state();
|
5099
5151
|
let props = $.prop($$props, 'props', 24, () => ({}));
|
@@ -5103,6 +5155,7 @@ function Image($$anchor, $$props) {
|
|
5103
5155
|
|
5104
5156
|
const { attributes, element, handleClick } = useClickable(props());
|
5105
5157
|
const aspectVariantStyles = ASPECT_VARIANT[props().aspectVariant]?.getProps();
|
5158
|
+
const width = props().width ?? '100%';
|
5106
5159
|
|
5107
5160
|
$.legacy_pre_effect(
|
5108
5161
|
() => (
|
@@ -5112,7 +5165,8 @@ function Image($$anchor, $$props) {
|
|
5112
5165
|
() => {
|
5113
5166
|
$.set(style, objToStyle({
|
5114
5167
|
...props().borderTopLeftRadius ? toCssRadius(props()) : IMAGE_ROUND_STYLES[props().shape ?? 'square'],
|
5115
|
-
width
|
5168
|
+
width,
|
5169
|
+
flexShrink: String(width).indexOf('px') !== -1 ? 0 : 1,
|
5116
5170
|
height: props().height ?? 'auto',
|
5117
5171
|
aspectRatio: props().aspect ?? aspectVariantStyles?.aspect,
|
5118
5172
|
...toCssCommon(props()),
|
@@ -5139,12 +5193,12 @@ function Image($$anchor, $$props) {
|
|
5139
5193
|
style: $.get(style),
|
5140
5194
|
'data-layer-id': layerId()
|
5141
5195
|
},
|
5142
|
-
'svelte-
|
5196
|
+
'svelte-rewdem'
|
5143
5197
|
));
|
5144
5198
|
|
5145
5199
|
$.event('click', $$element, handleClick);
|
5146
5200
|
|
5147
|
-
var img = root_1$
|
5201
|
+
var img = root_1$3();
|
5148
5202
|
|
5149
5203
|
$.template_effect(() => {
|
5150
5204
|
$.set_attribute(img, 'src', props().image);
|
@@ -5176,14 +5230,14 @@ const IMAGE_ASPECT_VARIANTS = {
|
|
5176
5230
|
'9/16': '9 : 16',
|
5177
5231
|
};
|
5178
5232
|
|
5179
|
-
const $$css$
|
5233
|
+
const $$css$f = {
|
5180
5234
|
hash: 'svelte-139vx15',
|
5181
5235
|
code: '.layout.svelte-139vx15 {text-decoration:none;color:inherit;}.layout[data-clickable=true].svelte-139vx15 {cursor:pointer;}.layout[data-clickable=true].svelte-139vx15:hover {opacity:0.8;}'
|
5182
5236
|
};
|
5183
5237
|
|
5184
5238
|
function Layout($$anchor, $$props) {
|
5185
5239
|
$.push($$props, false);
|
5186
|
-
$.append_styles($$anchor, $$css$
|
5240
|
+
$.append_styles($$anchor, $$css$f);
|
5187
5241
|
|
5188
5242
|
const style = $.mutable_state();
|
5189
5243
|
let props = $.prop($$props, 'props', 24, () => ({}));
|
@@ -5204,8 +5258,8 @@ function Layout($$anchor, $$props) {
|
|
5204
5258
|
flexDirection: props().direction,
|
5205
5259
|
alignItems: props().align,
|
5206
5260
|
justifyContent: props().justify,
|
5207
|
-
rowGap: props().rowGap,
|
5208
|
-
columnGap: props().columnGap,
|
5261
|
+
rowGap: props().rowGap ?? props().gap,
|
5262
|
+
columnGap: props().columnGap ?? props().gap,
|
5209
5263
|
width: props().width,
|
5210
5264
|
...toCssOverflow(props()),
|
5211
5265
|
...toCssShadow(props()),
|
@@ -5258,17 +5312,17 @@ const LAYOUT_DIRECTION = ['column', 'column-reverse', 'row', 'row-reverse'];
|
|
5258
5312
|
const LAYOUT_ALIGN = ['flex-start', 'center', 'flex-end', 'stretch'];
|
5259
5313
|
const LAYOUT_JUSTIFY = ['flex-start', 'center', 'flex-end', 'space-between'];
|
5260
5314
|
|
5261
|
-
var root_1$
|
5315
|
+
var root_1$2 = $.template(`<button><i></i></button>`);
|
5262
5316
|
var root$d = $.template(`<div class="slider svelte-1slel1d"><ul class="slider-list svelte-1slel1d"><!></ul> <div></div></div>`);
|
5263
5317
|
|
5264
|
-
const $$css$
|
5318
|
+
const $$css$e = {
|
5265
5319
|
hash: 'svelte-1slel1d',
|
5266
5320
|
code: '.slider-list.svelte-1slel1d {-webkit-user-drag:none;margin:0;padding:0;list-style:none;}'
|
5267
5321
|
};
|
5268
5322
|
|
5269
5323
|
function Slider($$anchor, $$props) {
|
5270
5324
|
$.push($$props, false);
|
5271
|
-
$.append_styles($$anchor, $$css$
|
5325
|
+
$.append_styles($$anchor, $$css$e);
|
5272
5326
|
|
5273
5327
|
const indicators = $.mutable_state();
|
5274
5328
|
const itemWidthPercentage = $.mutable_state();
|
@@ -5501,7 +5555,7 @@ function Slider($$anchor, $$props) {
|
|
5501
5555
|
var div_1 = $.sibling(ul, 2);
|
5502
5556
|
|
5503
5557
|
$.each(div_1, 5, () => $.get(indicators) ?? [], $.index, ($$anchor, indicator, i) => {
|
5504
|
-
var button = root_1$
|
5558
|
+
var button = root_1$2();
|
5505
5559
|
var i_1 = $.child(button);
|
5506
5560
|
|
5507
5561
|
$.reset(button);
|
@@ -5558,14 +5612,14 @@ function Slider($$anchor, $$props) {
|
|
5558
5612
|
|
5559
5613
|
var root$c = $.template(`<li class="slider-item svelte-1amglxo"><!></li>`);
|
5560
5614
|
|
5561
|
-
const $$css$
|
5615
|
+
const $$css$d = {
|
5562
5616
|
hash: 'svelte-1amglxo',
|
5563
5617
|
code: '.slider-item.svelte-1amglxo {overflow:hidden;}.slider-item-inner.svelte-1amglxo {text-decoration:none;background:none;border:0;margin:0;padding:0;color:inherit;-webkit-user-drag:none;user-select:none;}'
|
5564
5618
|
};
|
5565
5619
|
|
5566
5620
|
function SliderItem($$anchor, $$props) {
|
5567
5621
|
$.push($$props, false);
|
5568
|
-
$.append_styles($$anchor, $$css$
|
5622
|
+
$.append_styles($$anchor, $$css$d);
|
5569
5623
|
|
5570
5624
|
let layerId = $.prop($$props, 'layerId', 8);
|
5571
5625
|
let props = $.prop($$props, 'props', 8);
|
@@ -5683,14 +5737,14 @@ const TEXT_VARIANTS = {
|
|
5683
5737
|
|
5684
5738
|
var root$b = $.template(`<p class="text svelte-vifn7y"><!></p>`);
|
5685
5739
|
|
5686
|
-
const $$css$
|
5740
|
+
const $$css$c = {
|
5687
5741
|
hash: 'svelte-vifn7y',
|
5688
5742
|
code: '.text.svelte-vifn7y {margin:0;word-break:break-all;text-decoration:none;}'
|
5689
5743
|
};
|
5690
5744
|
|
5691
5745
|
function Text($$anchor, $$props) {
|
5692
5746
|
$.push($$props, false);
|
5693
|
-
$.append_styles($$anchor, $$css$
|
5747
|
+
$.append_styles($$anchor, $$css$c);
|
5694
5748
|
|
5695
5749
|
const escapedHTML = $.mutable_state();
|
5696
5750
|
const style = $.mutable_state();
|
@@ -5787,14 +5841,14 @@ function Text($$anchor, $$props) {
|
|
5787
5841
|
|
5788
5842
|
var root$a = $.template(`<div class="rich-text svelte-dxr423"><!></div>`);
|
5789
5843
|
|
5790
|
-
const $$css$
|
5844
|
+
const $$css$b = {
|
5791
5845
|
hash: 'svelte-dxr423',
|
5792
5846
|
code: '.rich-text.svelte-dxr423 p {margin:0;word-break:break-all;text-decoration:none;}.rich-text.svelte-dxr423 p + p {margin-top:0.75em;}'
|
5793
5847
|
};
|
5794
5848
|
|
5795
5849
|
function RichText($$anchor, $$props) {
|
5796
5850
|
$.push($$props, false);
|
5797
|
-
$.append_styles($$anchor, $$css$
|
5851
|
+
$.append_styles($$anchor, $$css$b);
|
5798
5852
|
|
5799
5853
|
const style = $.mutable_state();
|
5800
5854
|
let props = $.prop($$props, 'props', 24, () => ({ content: '' }));
|
@@ -5944,16 +5998,16 @@ const callback = ({ brandKit }) => ({
|
|
5944
5998
|
});
|
5945
5999
|
const getTextLinkThemeStyles = getPropStyles(callback);
|
5946
6000
|
|
5947
|
-
var root_1 = $.template(`<!> <span><!></span>`, 1);
|
6001
|
+
var root_1$1 = $.template(`<!> <span><!></span>`, 1);
|
5948
6002
|
|
5949
|
-
const $$css$
|
6003
|
+
const $$css$a = {
|
5950
6004
|
hash: 'svelte-dc9m5n',
|
5951
6005
|
code: '.link.svelte-dc9m5n {-webkit-appearance:none;border:0;background:none;padding:0;display:inline-flex;}.link.svelte-dc9m5n,\n .link.svelte-dc9m5n:visited,\n .link.svelte-dc9m5n:link {color:var(--color);}.link.svelte-dc9m5n:hover {color:var(--hover-color);}.link.svelte-dc9m5n:active {color:var(--active-color);}.link.underline-hover-on.svelte-dc9m5n {text-decoration:none;}.link.underline-hover-on.svelte-dc9m5n:hover {text-decoration:underline;}.link.underline-hover-off.svelte-dc9m5n {text-decoration:underline;}.link.underline-hover-off.svelte-dc9m5n:hover {text-decoration:none;}.link.underline-on.svelte-dc9m5n {text-decoration:underline;}.link.underline-off.svelte-dc9m5n {text-decoration:none;}'
|
5952
6006
|
};
|
5953
6007
|
|
5954
6008
|
function TextLink($$anchor, $$props) {
|
5955
6009
|
$.push($$props, false);
|
5956
|
-
$.append_styles($$anchor, $$css$
|
6010
|
+
$.append_styles($$anchor, $$css$a);
|
5957
6011
|
|
5958
6012
|
const escapedHTML = $.mutable_state();
|
5959
6013
|
const variables = $.mutable_state();
|
@@ -6058,7 +6112,7 @@ function TextLink($$anchor, $$props) {
|
|
6058
6112
|
|
6059
6113
|
$.event('click', $$element, handleClick);
|
6060
6114
|
|
6061
|
-
var fragment_1 = root_1();
|
6115
|
+
var fragment_1 = root_1$1();
|
6062
6116
|
var node_1 = $.first_child(fragment_1);
|
6063
6117
|
|
6064
6118
|
{
|
@@ -6114,9 +6168,52 @@ const TEXT_LINK_UNDERLINE = {
|
|
6114
6168
|
off: '常に非表示',
|
6115
6169
|
};
|
6116
6170
|
|
6117
|
-
$.template(`<div></div>`);
|
6171
|
+
var root_1 = $.template(`<div></div>`);
|
6172
|
+
|
6173
|
+
const $$css$9 = {
|
6174
|
+
hash: 'svelte-18nkdjz',
|
6175
|
+
code: '.v2-background.svelte-18nkdjz {position:fixed;top:0;left:0;width:100%;height:100%;background:rgba(0, 0, 0, 0.3);z-index:2147483646;}'
|
6176
|
+
};
|
6177
|
+
|
6178
|
+
function BackgroundOverlay($$anchor, $$props) {
|
6179
|
+
$.push($$props, false);
|
6180
|
+
$.append_styles($$anchor, $$css$9);
|
6181
|
+
|
6182
|
+
let backgroundOverlay = $.prop($$props, 'backgroundOverlay', 8, false);
|
6183
|
+
let className = $.prop($$props, 'class', 8, undefined);
|
6184
|
+
const dispatch = createEventDispatcher();
|
6185
|
+
|
6186
|
+
$.init();
|
6187
|
+
|
6188
|
+
var fragment = $.comment();
|
6189
|
+
var node = $.first_child(fragment);
|
6190
|
+
|
6191
|
+
{
|
6192
|
+
var consequent = ($$anchor) => {
|
6193
|
+
var div = root_1();
|
6194
|
+
|
6195
|
+
$.template_effect(
|
6196
|
+
($0) => $.set_class(div, 1, $0, 'svelte-18nkdjz'),
|
6197
|
+
[
|
6198
|
+
() => $.clsx(['v2-background', className() || ''].join(' '))
|
6199
|
+
],
|
6200
|
+
$.derived_safe_equal
|
6201
|
+
);
|
6202
|
+
|
6203
|
+
$.event('click', div, () => dispatch('click'));
|
6204
|
+
$.append($$anchor, div);
|
6205
|
+
};
|
6206
|
+
|
6207
|
+
$.if(node, ($$render) => {
|
6208
|
+
if (backgroundOverlay()) $$render(consequent);
|
6209
|
+
});
|
6210
|
+
}
|
6211
|
+
|
6212
|
+
$.append($$anchor, fragment);
|
6213
|
+
$.pop();
|
6214
|
+
}
|
6118
6215
|
|
6119
|
-
$.template(`<!> <!>`, 1);
|
6216
|
+
var root_2 = $.template(`<!> <!>`, 1);
|
6120
6217
|
var root_4 = $.template(`<div role="dialog" aria-modal="true"><!></div>`);
|
6121
6218
|
var root$9 = $.template(`<!> <!>`, 1);
|
6122
6219
|
|
@@ -6135,20 +6232,20 @@ function Modal($$anchor, $$props) {
|
|
6135
6232
|
const backgroundClickSP = $.mutable_state();
|
6136
6233
|
const handle_keydown = $.mutable_state();
|
6137
6234
|
const visible = $.mutable_state();
|
6138
|
-
const style = $.mutable_state();
|
6139
6235
|
let useBreakPoint = $.prop($$props, 'useBreakPoint', 8, false);
|
6140
6236
|
let placement = $.prop($$props, 'placement', 8);
|
6141
6237
|
let breakPoint = $.prop($$props, 'breakPoint', 8);
|
6142
|
-
|
6238
|
+
$.prop($$props, 'elasticity', 8);
|
6143
6239
|
let animation = $.prop($$props, 'animation', 8, 'none');
|
6144
6240
|
let props = $.prop($$props, 'props', 24, () => ({}));
|
6145
6241
|
let closeEventName = $.prop($$props, 'closeEventName', 8, '');
|
6146
6242
|
let closeEventValue = $.prop($$props, 'closeEventValue', 8, null);
|
6147
6243
|
let layerId = $.prop($$props, 'layerId', 8, '');
|
6148
6244
|
const { brandKit } = useBrandKit();
|
6245
|
+
const isCanvasPreview = (document.querySelector('#preview')?.getAttribute('data-canvas-preview') ?? 'false') === 'true';
|
6149
6246
|
// モーダル背景の設定
|
6150
|
-
placement() && placement().backgroundOverlay !== undefined;
|
6151
|
-
$.mutable_state(DefaultModalPlacement.backgroundOverlay);
|
6247
|
+
const isExistBackgroundOverlayValue = placement() && placement().backgroundOverlay !== undefined;
|
6248
|
+
let backgroundOverlay = $.mutable_state(DefaultModalPlacement.backgroundOverlay);
|
6152
6249
|
let backgroundOverlayPC = $.mutable_state(DefaultModalPlacement.backgroundOverlay);
|
6153
6250
|
let backgroundOverlaySP = $.mutable_state(DefaultModalPlacement.backgroundOverlay);
|
6154
6251
|
// モーダル背景のクリック動作の設定
|
@@ -6191,6 +6288,9 @@ function Modal($$anchor, $$props) {
|
|
6191
6288
|
$.deep_read_state(breakPoint())
|
6192
6289
|
),
|
6193
6290
|
() => {
|
6291
|
+
if (!isCanvasPreview && isExistBackgroundOverlayValue) {
|
6292
|
+
$.set(backgroundOverlay, placement().backgroundOverlay);
|
6293
|
+
}
|
6194
6294
|
|
6195
6295
|
if (useBreakPoint()) {
|
6196
6296
|
const pc = breakPoint()?.PC?.placement?.backgroundOverlay;
|
@@ -6294,6 +6394,10 @@ function Modal($$anchor, $$props) {
|
|
6294
6394
|
// 表示位置のスタイルの設定
|
6295
6395
|
let position = DefaultModalPlacement.position;
|
6296
6396
|
|
6397
|
+
if (!isCanvasPreview && placement() && placement().position !== null) {
|
6398
|
+
position = placement().position;
|
6399
|
+
}
|
6400
|
+
|
6297
6401
|
let positionStyle = getPositionStyle(position);
|
6298
6402
|
|
6299
6403
|
if (!useBreakPoint()) {
|
@@ -6307,6 +6411,16 @@ function Modal($$anchor, $$props) {
|
|
6307
6411
|
$.set(transforms, []);
|
6308
6412
|
|
6309
6413
|
DEVICE_IDS.forEach((deviceId) => {
|
6414
|
+
if (!isCanvasPreview && useBreakPoint()) {
|
6415
|
+
const positionWithBp = breakPoint()[deviceId]?.placement?.position;
|
6416
|
+
|
6417
|
+
$.get(transforms).push({
|
6418
|
+
query: DEVICE_QUERIES[deviceId],
|
6419
|
+
...getTransform(positionWithBp)
|
6420
|
+
});
|
6421
|
+
|
6422
|
+
positionStyle = getPositionStyle(positionWithBp);
|
6423
|
+
}
|
6310
6424
|
|
6311
6425
|
const positionVariables = stringifyStyleObj(formatObjectKey({
|
6312
6426
|
obj: parseStyle(positionStyle),
|
@@ -6327,11 +6441,16 @@ function Modal($$anchor, $$props) {
|
|
6327
6441
|
$.deep_read_state(placement()),
|
6328
6442
|
$.deep_read_state(useBreakPoint()),
|
6329
6443
|
$.deep_read_state(breakPoint()),
|
6330
|
-
|
6444
|
+
$.deep_read_state(props()),
|
6445
|
+
toCssBorder
|
6331
6446
|
),
|
6332
6447
|
() => {
|
6333
6448
|
let margin = DefaultModalPlacement.margin;
|
6334
6449
|
|
6450
|
+
if (!isCanvasPreview && placement() && placement().margin !== null) {
|
6451
|
+
margin = placement().margin;
|
6452
|
+
}
|
6453
|
+
|
6335
6454
|
let marginStyle = getMarginStyle(margin);
|
6336
6455
|
|
6337
6456
|
if (!useBreakPoint()) {
|
@@ -6339,6 +6458,11 @@ function Modal($$anchor, $$props) {
|
|
6339
6458
|
}
|
6340
6459
|
|
6341
6460
|
DEVICE_IDS.forEach((deviceId) => {
|
6461
|
+
if (!isCanvasPreview && useBreakPoint()) {
|
6462
|
+
const marginWithBp = breakPoint()[deviceId]?.placement?.margin;
|
6463
|
+
|
6464
|
+
marginStyle = getMarginStyle(marginWithBp);
|
6465
|
+
}
|
6342
6466
|
|
6343
6467
|
const marginVariables = stringifyStyleObj(formatObjectKey({
|
6344
6468
|
obj: parseStyle(marginStyle),
|
@@ -6348,33 +6472,18 @@ function Modal($$anchor, $$props) {
|
|
6348
6472
|
|
6349
6473
|
modalStyles.add(marginVariables);
|
6350
6474
|
});
|
6351
|
-
}
|
6352
|
-
);
|
6353
|
-
|
6354
|
-
$.legacy_pre_effect(
|
6355
|
-
() => (
|
6356
|
-
$.deep_read_state(elasticity()),
|
6357
|
-
$.deep_read_state(useBreakPoint()),
|
6358
|
-
$.deep_read_state(breakPoint()),
|
6359
|
-
parseStyle
|
6360
|
-
),
|
6361
|
-
() => {
|
6362
|
-
let elasticStyle = ElasticityStyle['none' ];
|
6363
|
-
|
6364
|
-
if (!useBreakPoint()) {
|
6365
|
-
modalStyles.add(elasticStyle);
|
6366
|
-
}
|
6367
|
-
|
6368
|
-
DEVICE_IDS.forEach((deviceId) => {
|
6369
|
-
|
6370
|
-
const elasticityVariables = stringifyStyleObj(formatObjectKey({
|
6371
|
-
obj: parseStyle(elasticStyle),
|
6372
|
-
prefix: '--modal-bp-',
|
6373
|
-
suffix: `-${deviceId.toLowerCase()}`
|
6374
|
-
}));
|
6375
6475
|
|
6376
|
-
|
6476
|
+
const propsStyle = objToStyle({
|
6477
|
+
width: props().width,
|
6478
|
+
...toCssOverflow(props()),
|
6479
|
+
...toCssShadow(props()),
|
6480
|
+
...toCssRadius(props()),
|
6481
|
+
...toCssBackgroundImage(props()),
|
6482
|
+
...toCssBackgroundColor(props()),
|
6483
|
+
...toCssBorder(props())
|
6377
6484
|
});
|
6485
|
+
|
6486
|
+
modalStyles.add(propsStyle);
|
6378
6487
|
}
|
6379
6488
|
);
|
6380
6489
|
|
@@ -6390,24 +6499,6 @@ function Modal($$anchor, $$props) {
|
|
6390
6499
|
$.set(visible, false);
|
6391
6500
|
});
|
6392
6501
|
|
6393
|
-
$.legacy_pre_effect(
|
6394
|
-
() => (
|
6395
|
-
$.deep_read_state(props()),
|
6396
|
-
toCssBorder
|
6397
|
-
),
|
6398
|
-
() => {
|
6399
|
-
$.set(style, objToStyle({
|
6400
|
-
width: props().width,
|
6401
|
-
...toCssOverflow(props()),
|
6402
|
-
...toCssShadow(props()),
|
6403
|
-
...toCssRadius(props()),
|
6404
|
-
...toCssBackgroundImage(props()),
|
6405
|
-
...toCssBackgroundColor(props()),
|
6406
|
-
...toCssBorder(props())
|
6407
|
-
}));
|
6408
|
-
}
|
6409
|
-
);
|
6410
|
-
|
6411
6502
|
$.legacy_pre_effect_reset();
|
6412
6503
|
$.init();
|
6413
6504
|
|
@@ -6422,8 +6513,66 @@ function Modal($$anchor, $$props) {
|
|
6422
6513
|
{
|
6423
6514
|
var consequent = ($$anchor) => {};
|
6424
6515
|
|
6516
|
+
var alternate = ($$anchor, $$elseif) => {
|
6517
|
+
{
|
6518
|
+
var consequent_1 = ($$anchor) => {
|
6519
|
+
var fragment_1 = root_2();
|
6520
|
+
var node_1 = $.first_child(fragment_1);
|
6521
|
+
|
6522
|
+
BackgroundOverlay(node_1, {
|
6523
|
+
class: 'background-bp-pc',
|
6524
|
+
get backgroundOverlay() {
|
6525
|
+
return $.get(backgroundOverlayPC);
|
6526
|
+
},
|
6527
|
+
$$events: {
|
6528
|
+
click(...$$args) {
|
6529
|
+
$.get(backgroundClickPC)?.apply(this, $$args);
|
6530
|
+
}
|
6531
|
+
}
|
6532
|
+
});
|
6533
|
+
|
6534
|
+
var node_2 = $.sibling(node_1, 2);
|
6535
|
+
|
6536
|
+
BackgroundOverlay(node_2, {
|
6537
|
+
class: 'background-bp-sp ',
|
6538
|
+
get backgroundOverlay() {
|
6539
|
+
return $.get(backgroundOverlaySP);
|
6540
|
+
},
|
6541
|
+
$$events: {
|
6542
|
+
click(...$$args) {
|
6543
|
+
$.get(backgroundClickSP)?.apply(this, $$args);
|
6544
|
+
}
|
6545
|
+
}
|
6546
|
+
});
|
6547
|
+
|
6548
|
+
$.append($$anchor, fragment_1);
|
6549
|
+
};
|
6550
|
+
|
6551
|
+
var alternate_1 = ($$anchor) => {
|
6552
|
+
BackgroundOverlay($$anchor, {
|
6553
|
+
get backgroundOverlay() {
|
6554
|
+
return $.get(backgroundOverlay);
|
6555
|
+
},
|
6556
|
+
$$events: {
|
6557
|
+
click(...$$args) {
|
6558
|
+
$.get(backgroundClick)?.apply(this, $$args);
|
6559
|
+
}
|
6560
|
+
}
|
6561
|
+
});
|
6562
|
+
};
|
6563
|
+
|
6564
|
+
$.if(
|
6565
|
+
$$anchor,
|
6566
|
+
($$render) => {
|
6567
|
+
if (useBreakPoint()) $$render(consequent_1); else $$render(alternate_1, false);
|
6568
|
+
},
|
6569
|
+
$$elseif
|
6570
|
+
);
|
6571
|
+
}
|
6572
|
+
};
|
6573
|
+
|
6425
6574
|
$.if(node, ($$render) => {
|
6426
|
-
$$render(consequent);
|
6575
|
+
if (isCanvasPreview) $$render(consequent); else $$render(alternate, false);
|
6427
6576
|
});
|
6428
6577
|
}
|
6429
6578
|
|
@@ -6449,10 +6598,7 @@ function Modal($$anchor, $$props) {
|
|
6449
6598
|
'modal',
|
6450
6599
|
useBreakPoint() ? 'modal-bp' : ''
|
6451
6600
|
].join(' ')),
|
6452
|
-
() =>
|
6453
|
-
Array.from(modalStyles).join(';'),
|
6454
|
-
$.get(style)
|
6455
|
-
].join(' ')
|
6601
|
+
() => Array.from(modalStyles).join(';')
|
6456
6602
|
],
|
6457
6603
|
$.derived_safe_equal
|
6458
6604
|
);
|
@@ -7390,4 +7536,182 @@ const ROUND_STYLES = {
|
|
7390
7536
|
},
|
7391
7537
|
};
|
7392
7538
|
|
7393
|
-
|
7539
|
+
const createProp = (key, type, suggestions = [], priority = 0, defaultValue = undefined) => {
|
7540
|
+
return {
|
7541
|
+
key,
|
7542
|
+
type,
|
7543
|
+
priority,
|
7544
|
+
suggestions: suggestions,
|
7545
|
+
default: defaultValue,
|
7546
|
+
};
|
7547
|
+
};
|
7548
|
+
const byObj = (obj) => {
|
7549
|
+
return Object.keys(obj);
|
7550
|
+
};
|
7551
|
+
const overflowProps = [
|
7552
|
+
createProp('overflow', 'string', ['hidden', 'visible', 'scroll', 'auto']),
|
7553
|
+
];
|
7554
|
+
const borderProps = [
|
7555
|
+
createProp('borderTopWidth', 'string'),
|
7556
|
+
createProp('borderLeftWidth', 'string'),
|
7557
|
+
createProp('borderRightWidth', 'string'),
|
7558
|
+
createProp('borderBottomWidth', 'string'),
|
7559
|
+
createProp('borderColor', 'color'),
|
7560
|
+
];
|
7561
|
+
const radiusProps = [
|
7562
|
+
createProp('borderTopLeftRadius', 'string'),
|
7563
|
+
createProp('borderTopRightRadius', 'string'),
|
7564
|
+
createProp('borderBottomLeftRadius', 'string'),
|
7565
|
+
createProp('borderBottomRightRadius', 'string'),
|
7566
|
+
];
|
7567
|
+
const paddingProps = [
|
7568
|
+
createProp('paddingTop', 'string'),
|
7569
|
+
createProp('paddingLeft', 'string'),
|
7570
|
+
createProp('paddingRight', 'string'),
|
7571
|
+
createProp('paddingBottom', 'string'),
|
7572
|
+
];
|
7573
|
+
const backgroundColorProps = [
|
7574
|
+
createProp('backgroundColor', 'string'),
|
7575
|
+
];
|
7576
|
+
const backgroundImageProps = [
|
7577
|
+
createProp('backgroundImageUrl', 'url'),
|
7578
|
+
];
|
7579
|
+
const flexComponentSchemes = {
|
7580
|
+
FlexAvatar: {
|
7581
|
+
props: [
|
7582
|
+
createProp('size', 'string', byObj(AVATAR_SIZE), 10),
|
7583
|
+
createProp('width', 'string', [], 5),
|
7584
|
+
createProp('height', 'string', [], 5),
|
7585
|
+
createProp('shape', 'string', byObj(AVATAR_SHAPE), 10),
|
7586
|
+
createProp('image', 'url', [], 99),
|
7587
|
+
// createProp('caption', 'string'),
|
7588
|
+
createProp('alt', 'string', [], 50),
|
7589
|
+
// TODO: clickable
|
7590
|
+
...borderProps,
|
7591
|
+
],
|
7592
|
+
},
|
7593
|
+
FlexButton: {
|
7594
|
+
props: [
|
7595
|
+
createProp('size', 'string', byObj(BUTTON_SIZE), 50),
|
7596
|
+
createProp('label', 'string', [], 99),
|
7597
|
+
createProp('paddingLeft', 'string'),
|
7598
|
+
createProp('paddingRight', 'string'),
|
7599
|
+
createProp('fontSize', 'string'),
|
7600
|
+
createProp('theme', 'string', byObj(BUTTON_THEME), 50),
|
7601
|
+
createProp('variant', 'string', byObj(BUTTON_VARIANT)),
|
7602
|
+
createProp('color', 'color', [], 5),
|
7603
|
+
createProp('backgroundColor', 'string', [], 5),
|
7604
|
+
createProp('borderColor', 'string', [], 5),
|
7605
|
+
createProp('fontWeight', 'string', ['normal', 'bold']),
|
7606
|
+
createProp('round', 'string', byObj(BUTTON_ROUND)),
|
7607
|
+
createProp('width', 'string', [], 10),
|
7608
|
+
createProp('wrap', 'string', ['wrap', 'nowrap']),
|
7609
|
+
// TODO: clickable
|
7610
|
+
...radiusProps,
|
7611
|
+
],
|
7612
|
+
},
|
7613
|
+
FlexClipCopy: {
|
7614
|
+
props: [
|
7615
|
+
createProp('content', 'string'),
|
7616
|
+
createProp('copiedEventName', 'string'),
|
7617
|
+
createProp('noneTooltip', 'boolean'),
|
7618
|
+
],
|
7619
|
+
},
|
7620
|
+
FlexCloseButton: {
|
7621
|
+
props: [
|
7622
|
+
createProp('size', 'number'),
|
7623
|
+
createProp('placement', 'string', byObj(CLOSE_BUTTON_PLACEMENT), 99),
|
7624
|
+
createProp('round', 'string', byObj(CLOSE_BUTTON_ROUND)),
|
7625
|
+
createProp('bordered', 'boolean'),
|
7626
|
+
createProp('color', 'color'),
|
7627
|
+
createProp('backgroundColor', 'color'),
|
7628
|
+
createProp('label', 'string'),
|
7629
|
+
createProp('labelColor', 'color'),
|
7630
|
+
createProp('labelPlacement', 'string', byObj(CLOSE_BUTTON_LABEL_PLACEMENT)),
|
7631
|
+
createProp('top', 'string'),
|
7632
|
+
createProp('left', 'string'),
|
7633
|
+
createProp('right', 'string'),
|
7634
|
+
createProp('bottom', 'string'),
|
7635
|
+
],
|
7636
|
+
},
|
7637
|
+
FlexCountDown: {
|
7638
|
+
props: [
|
7639
|
+
createProp('timeLimit', 'date_string', [], 99),
|
7640
|
+
// createProp('timeLimit', 'date_string'),
|
7641
|
+
],
|
7642
|
+
},
|
7643
|
+
FlexIcon: {
|
7644
|
+
props: [
|
7645
|
+
createProp('variant', 'string', byObj(ICON_VARIANTS), 99),
|
7646
|
+
createProp('size', 'string', byObj(ICON_SIZE), 50),
|
7647
|
+
createProp('color', 'color', [], 5),
|
7648
|
+
createProp('width', 'string', [], 10),
|
7649
|
+
createProp('height', 'string', [], 10),
|
7650
|
+
],
|
7651
|
+
},
|
7652
|
+
FlexImage: {
|
7653
|
+
props: [
|
7654
|
+
createProp('image', 'url', [], 99),
|
7655
|
+
createProp('aspect', 'string', Object.keys(ASPECT_VARIANT).map(key => ASPECT_VARIANT[key].getProps().aspect), 98),
|
7656
|
+
createProp('width', 'string', [], 5),
|
7657
|
+
createProp('height', 'string', [], 5),
|
7658
|
+
createProp('shape', 'string', byObj(IMAGE_ROUND_SHAPE), 10),
|
7659
|
+
],
|
7660
|
+
},
|
7661
|
+
FlexLayout: {
|
7662
|
+
props: [
|
7663
|
+
createProp('display', 'string', ['flex', 'inline-flex', 'block']),
|
7664
|
+
createProp('direction', 'string', ['row', 'column', 'row-reverse', 'column-reverse'], 10),
|
7665
|
+
createProp('align', 'string', ['center', 'stretch', 'flex-start', 'flex-end'], 10),
|
7666
|
+
createProp('justify', 'string', ['center', 'flex-start', 'flex-end', 'space-between'], 10),
|
7667
|
+
createProp('gap', 'string', [], 10),
|
7668
|
+
createProp('rowGap', 'string', [], 10),
|
7669
|
+
createProp('columnGap', 'string', [], 10),
|
7670
|
+
createProp('width', 'string', [], 5),
|
7671
|
+
...overflowProps,
|
7672
|
+
...borderProps,
|
7673
|
+
...radiusProps,
|
7674
|
+
...backgroundColorProps,
|
7675
|
+
...backgroundImageProps,
|
7676
|
+
...paddingProps,
|
7677
|
+
],
|
7678
|
+
},
|
7679
|
+
FlexList: {
|
7680
|
+
props: [
|
7681
|
+
createProp('gap', 'string', [], 10),
|
7682
|
+
createProp('borderWidth', 'string', [], 10),
|
7683
|
+
createProp('borderStyle', 'string', [], 10),
|
7684
|
+
createProp('borderColor', 'string', [], 10),
|
7685
|
+
createProp('itemPaddingTop', 'string', [], 5),
|
7686
|
+
createProp('itemPaddingLeft', 'string', [], 5),
|
7687
|
+
createProp('itemPaddingRight', 'string', [], 5),
|
7688
|
+
createProp('itemPaddingBottom', 'string', [], 5),
|
7689
|
+
createProp('itemGap', 'string', [], 5),
|
7690
|
+
],
|
7691
|
+
},
|
7692
|
+
FlexListItem: {
|
7693
|
+
props: [
|
7694
|
+
createProp('gap', 'number', [], 10),
|
7695
|
+
// TODO: clickable
|
7696
|
+
],
|
7697
|
+
},
|
7698
|
+
FlexText: {
|
7699
|
+
props: [
|
7700
|
+
createProp('content', 'string', [], 99),
|
7701
|
+
createProp('theme', 'string', byObj(TEXT_THEME), 50),
|
7702
|
+
createProp('size', 'string', byObj(LAYER_TEXT_SIZE), 50),
|
7703
|
+
createProp('align', 'string', [], 5),
|
7704
|
+
createProp('fontStyle', 'string', [], 5),
|
7705
|
+
createProp('fontSize', 'string', [], 5),
|
7706
|
+
createProp('fontWeight', 'string', [], 5),
|
7707
|
+
createProp('lineHeight', 'string', [], 5),
|
7708
|
+
createProp('color', 'string', [], 5),
|
7709
|
+
createProp('width', 'string', [], 10),
|
7710
|
+
createProp('fontFamilyVariant', 'string', byObj(FONT_FAMILY_VARIANT), 10),
|
7711
|
+
createProp('fontFamily', 'string', []),
|
7712
|
+
// TODO: clickable
|
7713
|
+
],
|
7714
|
+
},
|
7715
|
+
};
|
7716
|
+
|
7717
|
+
export { ACTION_HOOK_LABEL, ASPECT_VARIANT, ASPECT_VARIANTS, AVATAR_SHAPE, AVATAR_SIZE, AVATAR_SIZE_STYLES, Alignments, AnimationStyles, BUTTON_ICON_ANGLE, BUTTON_LINK_TARGET, BUTTON_OUTLINED_ROUND_STYLES, BUTTON_OUTLINED_SIZE_STYLES, BUTTON_OUTLINED_WRAP_STYLES, BUTTON_ROUND, BUTTON_ROUND_STYLES, BUTTON_SIZE, BUTTON_SIZE_STYLES, BUTTON_TEXT_SIZE, BUTTON_TEXT_SIZE_STYLES, BUTTON_TEXT_THEME, BUTTON_THEME, BUTTON_VARIANT, BUTTON_WRAP_STYLES, BackgroundSizes, CLOSE_BUTTON_LABEL_PLACEMENT, CLOSE_BUTTON_PLACEMENT, CLOSE_BUTTON_ROUND, ClipPaths, Cursors, DefaultEdgePosition, DefaultElasticity, DefaultFormButtonColor, DefaultFormIdentifyBooleanField, DefaultFormIdentifyTextField, DefaultListBackground, DefaultListBackgroundNone, DefaultListBackgroundStripe, DefaultListSeparator, DefaultListSeparatorBorder, DefaultListSeparatorGap, DefaultListSeparatorNone, DefaultModalBreakPoint, DefaultModalPlacement, DefaultSlideButton, DefaultSlideNavigationButton, Directions, Elasticities, ElasticityStyle, FONT_FAMILY_VARIANT, FONT_FAMILY_VARIANTS, FONT_FAMILY_VARIANT_GROUPS, Avatar as FlexAvatar, Button as FlexButton, ButtonOutlined as FlexButtonOutlined, ButtonText as FlexButtonText, ClipCopy as FlexClipCopy, CloseButton as FlexCloseButton, Code as FlexCode, CountDown as FlexCountDown, CountDownValue as FlexCountDownValue, FlexDirections, Icon as FlexIcon, Image as FlexImage, Layout as FlexLayout, List as FlexList, ListItem as FlexListItem, Modal as FlexModal, MultiColumn as FlexMultiColumn, MultiColumnItem as FlexMultiColumnItem, RichText as FlexRichText, Slider as FlexSlider, SliderItem as FlexSliderItem, Text as FlexText, TextLink as FlexTextLink, Youtube as FlexYoutube, Fonts, FormIdentifyBooleanFields, FormIdentifyTextFieldPlaceholders, FormIdentifyTextFieldValidations, FormIdentifyTextFields, ICON_SIZE, ICON_SIZE_STYLES, ICON_VARIANTS, IMAGE_ASPECT_VARIANTS, IMAGE_ROUND_SHAPE, IMAGE_ROUND_STYLES, Justifies, KARTE_MODAL_ROOT, LAYER_TEXT_SIZE, LAYOUT_ALIGN, LAYOUT_COMPONENT_NAMES, LAYOUT_DIRECTION, LAYOUT_DISPLAY_TYPE, LAYOUT_JUSTIFY, LIST_ITEM_CONTEXT_KEY, LengthUnits, ListBackgroundTypes, ListDirections, ListSeparatorTypes, MULTI_COLUMN_ITEM_CONTEXT_KEY, MediaQueries, ModalPositions, ObjectFits, OnClickOperationOptions, Overflows, PropTypes, ROUND_STYLES, ROUND_VARIANT, Repeats, SHADOW_VARIANT, SHADOW_VARIANTS, SYSTEM_FONT, State, StateItem, TEXT_LINK_SIZE, TEXT_LINK_SIZE_STYLES, TEXT_LINK_THEME, TEXT_LINK_UNDERLINE, TEXT_STYLE, TEXT_THEME, TEXT_VARIANTS, TextDirections, WritingModes, addChoiceAnswer, addFreeAnswer, afterUpdate, applyCss, applyGlobalCss, avatarPropsDefault, beforeUpdate, buttonOutlinedPropsDefault, buttonPropsDefault, close, closeAction, collection$1 as collection, create, createApp, createFog, createProp, destroy, destroyAction, ensureModalRoot, eventHandlers, finalize, flexComponentSchemes, formData, getActionRoot, getAnsweredQuestion, getAnsweredQuestionIds, getBrandKit, getButtonOutlinedThemeStyles, getButtonTextThemeStyles, getButtonThemeStyles, getCssVariables, getEventHandlers, getEvents, getLogs, getState$1 as getState, getStates, getSystem, getTextLinkThemeStyles, getTextThemeStyles, getVariables, hideOnScroll, hideOnTime, initialize, isOpened, listenLogger, loadActionTable, loadActionTableQuery, loadActionTableRow, loadActionTableRows, loadGlobalScript, loadGlobalStyle, loadStyle, logger, onChangeState, onClose, onCreate, onDestory, onDestroy, onMount, onScroll, onShow, onTime, removeAnswer, resetEventHandlers, resetVariables, sendAnswer, sendAnswers, setEventHandlers, setSetting, setState$1 as setState, setVariables, show, showAction, showModal, showOnScroll, showOnTime, state, tick, useBrandKit, variables, widget };
|