@plaidev/karte-action-sdk 1.1.265 → 1.1.266
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 +596 -99
- package/dist/index.es.d.ts +29 -3
- package/dist/index.es.js +570 -107
- package/dist/svelte5/hydrate/index.es.d.ts +30 -4
- package/dist/svelte5/hydrate/index.es.js +707 -375
- package/dist/svelte5/index.es.d.ts +30 -4
- package/dist/svelte5/index.es.js +587 -389
- package/dist/svelte5/index.front2.es.js +591 -389
- 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,117 +1834,6 @@ function ensureActionRoot(useShadow = true) {
|
|
1978
1834
|
return el;
|
1979
1835
|
}
|
1980
1836
|
}
|
1981
|
-
/**
|
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
|
2011
|
-
*/
|
2012
|
-
function createApp(App, options = {
|
2013
|
-
send: () => { },
|
2014
|
-
publish: () => { },
|
2015
|
-
props: {},
|
2016
|
-
variables: {},
|
2017
|
-
localVariablesQuery: undefined,
|
2018
|
-
context: { api_key: '' },
|
2019
|
-
}) {
|
2020
|
-
let app = null;
|
2021
|
-
const close = () => {
|
2022
|
-
if (app) {
|
2023
|
-
{
|
2024
|
-
// @ts-ignore -- Svelte3 では `unmount` は存在しない
|
2025
|
-
svelte.unmount(app);
|
2026
|
-
}
|
2027
|
-
app = null;
|
2028
|
-
}
|
2029
|
-
};
|
2030
|
-
const appArgs = {
|
2031
|
-
target: null,
|
2032
|
-
props: {
|
2033
|
-
send: options.send,
|
2034
|
-
publish: options.publish,
|
2035
|
-
close,
|
2036
|
-
data: {
|
2037
|
-
...options.props,
|
2038
|
-
...options.variables,
|
2039
|
-
},
|
2040
|
-
},
|
2041
|
-
};
|
2042
|
-
{
|
2043
|
-
const win = ensureModalRoot(false);
|
2044
|
-
appArgs.target = win;
|
2045
|
-
appArgs.hydrate = true;
|
2046
|
-
}
|
2047
|
-
return {
|
2048
|
-
close,
|
2049
|
-
show: () => {
|
2050
|
-
if (app) {
|
2051
|
-
return;
|
2052
|
-
}
|
2053
|
-
options.send('message_open');
|
2054
|
-
app = svelte.hydrate(App, appArgs)
|
2055
|
-
|
2056
|
-
;
|
2057
|
-
},
|
2058
|
-
};
|
2059
|
-
}
|
2060
|
-
/**
|
2061
|
-
* 非推奨
|
2062
|
-
*
|
2063
|
-
* @deprecated 非推奨
|
2064
|
-
*
|
2065
|
-
* @internal
|
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
1837
|
|
2093
1838
|
/**
|
2094
1839
|
* スクリプト接客が利用するコードの管理
|
@@ -2290,21 +2035,263 @@ function onCreate(fn) {
|
|
2290
2035
|
setInternalHandlers({ onCreateHandlers });
|
2291
2036
|
}
|
2292
2037
|
/**
|
2293
|
-
* アクションが破棄 (destroy) される前にフックする関数
|
2038
|
+
* アクションが破棄 (destroy) される前にフックする関数
|
2039
|
+
*
|
2040
|
+
* @param fn - 呼び出されるフック関数
|
2041
|
+
*
|
2042
|
+
* @public
|
2043
|
+
*/
|
2044
|
+
function onDestroy(fn) {
|
2045
|
+
let { onDestroyHandlers } = getInternalHandlers();
|
2046
|
+
if (!onDestroyHandlers) {
|
2047
|
+
onDestroyHandlers = [];
|
2048
|
+
}
|
2049
|
+
onDestroyHandlers.push(fn);
|
2050
|
+
setInternalHandlers({ onDestroyHandlers });
|
2051
|
+
}
|
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
|
+
* 非推奨
|
2294
2289
|
*
|
2295
|
-
* @
|
2290
|
+
* @deprecated 非推奨
|
2296
2291
|
*
|
2297
|
-
* @
|
2292
|
+
* @internal
|
2298
2293
|
*/
|
2299
|
-
|
2300
|
-
let { onDestroyHandlers } = getInternalHandlers();
|
2301
|
-
if (!onDestroyHandlers) {
|
2302
|
-
onDestroyHandlers = [];
|
2303
|
-
}
|
2304
|
-
onDestroyHandlers.push(fn);
|
2305
|
-
setInternalHandlers({ onDestroyHandlers });
|
2306
|
-
}
|
2307
|
-
// -------- The following codes are deprecated --------
|
2294
|
+
const ensureModalRoot = ensureActionRoot;
|
2308
2295
|
/**
|
2309
2296
|
* 非推奨
|
2310
2297
|
*
|
@@ -2312,7 +2299,51 @@ function onDestroy(fn) {
|
|
2312
2299
|
*
|
2313
2300
|
* @internal
|
2314
2301
|
*/
|
2315
|
-
|
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-gzaieg">`);
|
5088
5140
|
|
5089
|
-
const $$css$
|
5141
|
+
const $$css$g = {
|
5090
5142
|
hash: 'svelte-gzaieg',
|
5091
5143
|
code: '.image.svelte-gzaieg {max-width:100%;overflow:hidden;display:flex;align-items:center;justify-content:center;flex-shrink:0;}.image-img.svelte-gzaieg {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, () => ({}));
|
@@ -5144,7 +5196,7 @@ function Image($$anchor, $$props) {
|
|
5144
5196
|
|
5145
5197
|
$.event('click', $$element, handleClick);
|
5146
5198
|
|
5147
|
-
var img = root_1$
|
5199
|
+
var img = root_1$3();
|
5148
5200
|
|
5149
5201
|
$.template_effect(() => {
|
5150
5202
|
$.set_attribute(img, 'src', props().image);
|
@@ -5176,14 +5228,14 @@ const IMAGE_ASPECT_VARIANTS = {
|
|
5176
5228
|
'9/16': '9 : 16',
|
5177
5229
|
};
|
5178
5230
|
|
5179
|
-
const $$css$
|
5231
|
+
const $$css$f = {
|
5180
5232
|
hash: 'svelte-139vx15',
|
5181
5233
|
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
5234
|
};
|
5183
5235
|
|
5184
5236
|
function Layout($$anchor, $$props) {
|
5185
5237
|
$.push($$props, false);
|
5186
|
-
$.append_styles($$anchor, $$css$
|
5238
|
+
$.append_styles($$anchor, $$css$f);
|
5187
5239
|
|
5188
5240
|
const style = $.mutable_state();
|
5189
5241
|
let props = $.prop($$props, 'props', 24, () => ({}));
|
@@ -5204,8 +5256,8 @@ function Layout($$anchor, $$props) {
|
|
5204
5256
|
flexDirection: props().direction,
|
5205
5257
|
alignItems: props().align,
|
5206
5258
|
justifyContent: props().justify,
|
5207
|
-
rowGap: props().rowGap,
|
5208
|
-
columnGap: props().columnGap,
|
5259
|
+
rowGap: props().rowGap ?? props().gap,
|
5260
|
+
columnGap: props().columnGap ?? props().gap,
|
5209
5261
|
width: props().width,
|
5210
5262
|
...toCssOverflow(props()),
|
5211
5263
|
...toCssShadow(props()),
|
@@ -5258,17 +5310,17 @@ const LAYOUT_DIRECTION = ['column', 'column-reverse', 'row', 'row-reverse'];
|
|
5258
5310
|
const LAYOUT_ALIGN = ['flex-start', 'center', 'flex-end', 'stretch'];
|
5259
5311
|
const LAYOUT_JUSTIFY = ['flex-start', 'center', 'flex-end', 'space-between'];
|
5260
5312
|
|
5261
|
-
var root_1$
|
5313
|
+
var root_1$2 = $.template(`<button><i></i></button>`);
|
5262
5314
|
var root$d = $.template(`<div class="slider svelte-1slel1d"><ul class="slider-list svelte-1slel1d"><!></ul> <div></div></div>`);
|
5263
5315
|
|
5264
|
-
const $$css$
|
5316
|
+
const $$css$e = {
|
5265
5317
|
hash: 'svelte-1slel1d',
|
5266
5318
|
code: '.slider-list.svelte-1slel1d {-webkit-user-drag:none;margin:0;padding:0;list-style:none;}'
|
5267
5319
|
};
|
5268
5320
|
|
5269
5321
|
function Slider($$anchor, $$props) {
|
5270
5322
|
$.push($$props, false);
|
5271
|
-
$.append_styles($$anchor, $$css$
|
5323
|
+
$.append_styles($$anchor, $$css$e);
|
5272
5324
|
|
5273
5325
|
const indicators = $.mutable_state();
|
5274
5326
|
const itemWidthPercentage = $.mutable_state();
|
@@ -5501,7 +5553,7 @@ function Slider($$anchor, $$props) {
|
|
5501
5553
|
var div_1 = $.sibling(ul, 2);
|
5502
5554
|
|
5503
5555
|
$.each(div_1, 5, () => $.get(indicators) ?? [], $.index, ($$anchor, indicator, i) => {
|
5504
|
-
var button = root_1$
|
5556
|
+
var button = root_1$2();
|
5505
5557
|
var i_1 = $.child(button);
|
5506
5558
|
|
5507
5559
|
$.reset(button);
|
@@ -5558,14 +5610,14 @@ function Slider($$anchor, $$props) {
|
|
5558
5610
|
|
5559
5611
|
var root$c = $.template(`<li class="slider-item svelte-1amglxo"><!></li>`);
|
5560
5612
|
|
5561
|
-
const $$css$
|
5613
|
+
const $$css$d = {
|
5562
5614
|
hash: 'svelte-1amglxo',
|
5563
5615
|
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
5616
|
};
|
5565
5617
|
|
5566
5618
|
function SliderItem($$anchor, $$props) {
|
5567
5619
|
$.push($$props, false);
|
5568
|
-
$.append_styles($$anchor, $$css$
|
5620
|
+
$.append_styles($$anchor, $$css$d);
|
5569
5621
|
|
5570
5622
|
let layerId = $.prop($$props, 'layerId', 8);
|
5571
5623
|
let props = $.prop($$props, 'props', 8);
|
@@ -5683,14 +5735,14 @@ const TEXT_VARIANTS = {
|
|
5683
5735
|
|
5684
5736
|
var root$b = $.template(`<p class="text svelte-vifn7y"><!></p>`);
|
5685
5737
|
|
5686
|
-
const $$css$
|
5738
|
+
const $$css$c = {
|
5687
5739
|
hash: 'svelte-vifn7y',
|
5688
5740
|
code: '.text.svelte-vifn7y {margin:0;word-break:break-all;text-decoration:none;}'
|
5689
5741
|
};
|
5690
5742
|
|
5691
5743
|
function Text($$anchor, $$props) {
|
5692
5744
|
$.push($$props, false);
|
5693
|
-
$.append_styles($$anchor, $$css$
|
5745
|
+
$.append_styles($$anchor, $$css$c);
|
5694
5746
|
|
5695
5747
|
const escapedHTML = $.mutable_state();
|
5696
5748
|
const style = $.mutable_state();
|
@@ -5787,14 +5839,14 @@ function Text($$anchor, $$props) {
|
|
5787
5839
|
|
5788
5840
|
var root$a = $.template(`<div class="rich-text svelte-dxr423"><!></div>`);
|
5789
5841
|
|
5790
|
-
const $$css$
|
5842
|
+
const $$css$b = {
|
5791
5843
|
hash: 'svelte-dxr423',
|
5792
5844
|
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
5845
|
};
|
5794
5846
|
|
5795
5847
|
function RichText($$anchor, $$props) {
|
5796
5848
|
$.push($$props, false);
|
5797
|
-
$.append_styles($$anchor, $$css$
|
5849
|
+
$.append_styles($$anchor, $$css$b);
|
5798
5850
|
|
5799
5851
|
const style = $.mutable_state();
|
5800
5852
|
let props = $.prop($$props, 'props', 24, () => ({ content: '' }));
|
@@ -5944,16 +5996,16 @@ const callback = ({ brandKit }) => ({
|
|
5944
5996
|
});
|
5945
5997
|
const getTextLinkThemeStyles = getPropStyles(callback);
|
5946
5998
|
|
5947
|
-
var root_1 = $.template(`<!> <span><!></span>`, 1);
|
5999
|
+
var root_1$1 = $.template(`<!> <span><!></span>`, 1);
|
5948
6000
|
|
5949
|
-
const $$css$
|
6001
|
+
const $$css$a = {
|
5950
6002
|
hash: 'svelte-dc9m5n',
|
5951
6003
|
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
6004
|
};
|
5953
6005
|
|
5954
6006
|
function TextLink($$anchor, $$props) {
|
5955
6007
|
$.push($$props, false);
|
5956
|
-
$.append_styles($$anchor, $$css$
|
6008
|
+
$.append_styles($$anchor, $$css$a);
|
5957
6009
|
|
5958
6010
|
const escapedHTML = $.mutable_state();
|
5959
6011
|
const variables = $.mutable_state();
|
@@ -6058,7 +6110,7 @@ function TextLink($$anchor, $$props) {
|
|
6058
6110
|
|
6059
6111
|
$.event('click', $$element, handleClick);
|
6060
6112
|
|
6061
|
-
var fragment_1 = root_1();
|
6113
|
+
var fragment_1 = root_1$1();
|
6062
6114
|
var node_1 = $.first_child(fragment_1);
|
6063
6115
|
|
6064
6116
|
{
|
@@ -6114,9 +6166,52 @@ const TEXT_LINK_UNDERLINE = {
|
|
6114
6166
|
off: '常に非表示',
|
6115
6167
|
};
|
6116
6168
|
|
6117
|
-
$.template(`<div></div>`);
|
6169
|
+
var root_1 = $.template(`<div></div>`);
|
6170
|
+
|
6171
|
+
const $$css$9 = {
|
6172
|
+
hash: 'svelte-18nkdjz',
|
6173
|
+
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;}'
|
6174
|
+
};
|
6175
|
+
|
6176
|
+
function BackgroundOverlay($$anchor, $$props) {
|
6177
|
+
$.push($$props, false);
|
6178
|
+
$.append_styles($$anchor, $$css$9);
|
6179
|
+
|
6180
|
+
let backgroundOverlay = $.prop($$props, 'backgroundOverlay', 8, false);
|
6181
|
+
let className = $.prop($$props, 'class', 8, undefined);
|
6182
|
+
const dispatch = createEventDispatcher();
|
6183
|
+
|
6184
|
+
$.init();
|
6185
|
+
|
6186
|
+
var fragment = $.comment();
|
6187
|
+
var node = $.first_child(fragment);
|
6188
|
+
|
6189
|
+
{
|
6190
|
+
var consequent = ($$anchor) => {
|
6191
|
+
var div = root_1();
|
6192
|
+
|
6193
|
+
$.template_effect(
|
6194
|
+
($0) => $.set_class(div, 1, $0, 'svelte-18nkdjz'),
|
6195
|
+
[
|
6196
|
+
() => $.clsx(['v2-background', className() || ''].join(' '))
|
6197
|
+
],
|
6198
|
+
$.derived_safe_equal
|
6199
|
+
);
|
6200
|
+
|
6201
|
+
$.event('click', div, () => dispatch('click'));
|
6202
|
+
$.append($$anchor, div);
|
6203
|
+
};
|
6204
|
+
|
6205
|
+
$.if(node, ($$render) => {
|
6206
|
+
if (backgroundOverlay()) $$render(consequent);
|
6207
|
+
});
|
6208
|
+
}
|
6209
|
+
|
6210
|
+
$.append($$anchor, fragment);
|
6211
|
+
$.pop();
|
6212
|
+
}
|
6118
6213
|
|
6119
|
-
$.template(`<!> <!>`, 1);
|
6214
|
+
var root_2 = $.template(`<!> <!>`, 1);
|
6120
6215
|
var root_4 = $.template(`<div role="dialog" aria-modal="true"><!></div>`);
|
6121
6216
|
var root$9 = $.template(`<!> <!>`, 1);
|
6122
6217
|
|
@@ -6139,16 +6234,18 @@ function Modal($$anchor, $$props) {
|
|
6139
6234
|
let useBreakPoint = $.prop($$props, 'useBreakPoint', 8, false);
|
6140
6235
|
let placement = $.prop($$props, 'placement', 8);
|
6141
6236
|
let breakPoint = $.prop($$props, 'breakPoint', 8);
|
6142
|
-
|
6237
|
+
$.prop($$props, 'elasticity', 8);
|
6143
6238
|
let animation = $.prop($$props, 'animation', 8, 'none');
|
6144
6239
|
let props = $.prop($$props, 'props', 24, () => ({}));
|
6145
6240
|
let closeEventName = $.prop($$props, 'closeEventName', 8, '');
|
6146
6241
|
let closeEventValue = $.prop($$props, 'closeEventValue', 8, null);
|
6147
6242
|
let layerId = $.prop($$props, 'layerId', 8, '');
|
6148
6243
|
const { brandKit } = useBrandKit();
|
6244
|
+
// falseが明示的に指定されている場合以外はtrueにする
|
6245
|
+
const isOnSite = (document.querySelector('#preview')?.getAttribute('data-on-site') ?? 'true') !== 'false';
|
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 (isOnSite && 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 (isOnSite && 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 (isOnSite && 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),
|
@@ -6332,6 +6446,10 @@ function Modal($$anchor, $$props) {
|
|
6332
6446
|
() => {
|
6333
6447
|
let margin = DefaultModalPlacement.margin;
|
6334
6448
|
|
6449
|
+
if (isOnSite && placement() && placement().margin !== null) {
|
6450
|
+
margin = placement().margin;
|
6451
|
+
}
|
6452
|
+
|
6335
6453
|
let marginStyle = getMarginStyle(margin);
|
6336
6454
|
|
6337
6455
|
if (!useBreakPoint()) {
|
@@ -6339,6 +6457,11 @@ function Modal($$anchor, $$props) {
|
|
6339
6457
|
}
|
6340
6458
|
|
6341
6459
|
DEVICE_IDS.forEach((deviceId) => {
|
6460
|
+
if (isOnSite && useBreakPoint()) {
|
6461
|
+
const marginWithBp = breakPoint()[deviceId]?.placement?.margin;
|
6462
|
+
|
6463
|
+
marginStyle = getMarginStyle(marginWithBp);
|
6464
|
+
}
|
6342
6465
|
|
6343
6466
|
const marginVariables = stringifyStyleObj(formatObjectKey({
|
6344
6467
|
obj: parseStyle(marginStyle),
|
@@ -6351,33 +6474,6 @@ function Modal($$anchor, $$props) {
|
|
6351
6474
|
}
|
6352
6475
|
);
|
6353
6476
|
|
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
|
-
|
6376
|
-
modalStyles.add(elasticityVariables);
|
6377
|
-
});
|
6378
|
-
}
|
6379
|
-
);
|
6380
|
-
|
6381
6477
|
$.legacy_pre_effect(() => {}, () => {
|
6382
6478
|
$.set(modal, null);
|
6383
6479
|
});
|
@@ -6422,8 +6518,66 @@ function Modal($$anchor, $$props) {
|
|
6422
6518
|
{
|
6423
6519
|
var consequent = ($$anchor) => {};
|
6424
6520
|
|
6521
|
+
var alternate = ($$anchor, $$elseif) => {
|
6522
|
+
{
|
6523
|
+
var consequent_1 = ($$anchor) => {
|
6524
|
+
var fragment_1 = root_2();
|
6525
|
+
var node_1 = $.first_child(fragment_1);
|
6526
|
+
|
6527
|
+
BackgroundOverlay(node_1, {
|
6528
|
+
class: 'background-bp-pc',
|
6529
|
+
get backgroundOverlay() {
|
6530
|
+
return $.get(backgroundOverlayPC);
|
6531
|
+
},
|
6532
|
+
$$events: {
|
6533
|
+
click(...$$args) {
|
6534
|
+
$.get(backgroundClickPC)?.apply(this, $$args);
|
6535
|
+
}
|
6536
|
+
}
|
6537
|
+
});
|
6538
|
+
|
6539
|
+
var node_2 = $.sibling(node_1, 2);
|
6540
|
+
|
6541
|
+
BackgroundOverlay(node_2, {
|
6542
|
+
class: 'background-bp-sp ',
|
6543
|
+
get backgroundOverlay() {
|
6544
|
+
return $.get(backgroundOverlaySP);
|
6545
|
+
},
|
6546
|
+
$$events: {
|
6547
|
+
click(...$$args) {
|
6548
|
+
$.get(backgroundClickSP)?.apply(this, $$args);
|
6549
|
+
}
|
6550
|
+
}
|
6551
|
+
});
|
6552
|
+
|
6553
|
+
$.append($$anchor, fragment_1);
|
6554
|
+
};
|
6555
|
+
|
6556
|
+
var alternate_1 = ($$anchor) => {
|
6557
|
+
BackgroundOverlay($$anchor, {
|
6558
|
+
get backgroundOverlay() {
|
6559
|
+
return $.get(backgroundOverlay);
|
6560
|
+
},
|
6561
|
+
$$events: {
|
6562
|
+
click(...$$args) {
|
6563
|
+
$.get(backgroundClick)?.apply(this, $$args);
|
6564
|
+
}
|
6565
|
+
}
|
6566
|
+
});
|
6567
|
+
};
|
6568
|
+
|
6569
|
+
$.if(
|
6570
|
+
$$anchor,
|
6571
|
+
($$render) => {
|
6572
|
+
if (useBreakPoint()) $$render(consequent_1); else $$render(alternate_1, false);
|
6573
|
+
},
|
6574
|
+
$$elseif
|
6575
|
+
);
|
6576
|
+
}
|
6577
|
+
};
|
6578
|
+
|
6425
6579
|
$.if(node, ($$render) => {
|
6426
|
-
$$render(consequent);
|
6580
|
+
if (!isOnSite) $$render(consequent); else $$render(alternate, false);
|
6427
6581
|
});
|
6428
6582
|
}
|
6429
6583
|
|
@@ -7390,4 +7544,182 @@ const ROUND_STYLES = {
|
|
7390
7544
|
},
|
7391
7545
|
};
|
7392
7546
|
|
7393
|
-
|
7547
|
+
const createProp = (key, type, suggestions = [], priority = 0, defaultValue = undefined) => {
|
7548
|
+
return {
|
7549
|
+
key,
|
7550
|
+
type,
|
7551
|
+
priority,
|
7552
|
+
suggestions: suggestions,
|
7553
|
+
default: defaultValue,
|
7554
|
+
};
|
7555
|
+
};
|
7556
|
+
const byObj = (obj) => {
|
7557
|
+
return Object.keys(obj);
|
7558
|
+
};
|
7559
|
+
const overflowProps = [
|
7560
|
+
createProp('overflow', 'string', ['hidden', 'visible', 'scroll', 'auto']),
|
7561
|
+
];
|
7562
|
+
const borderProps = [
|
7563
|
+
createProp('borderTopWidth', 'string'),
|
7564
|
+
createProp('borderLeftWidth', 'string'),
|
7565
|
+
createProp('borderRightWidth', 'string'),
|
7566
|
+
createProp('borderBottomWidth', 'string'),
|
7567
|
+
createProp('borderColor', 'color'),
|
7568
|
+
];
|
7569
|
+
const radiusProps = [
|
7570
|
+
createProp('borderTopLeftRadius', 'string'),
|
7571
|
+
createProp('borderTopRightRadius', 'string'),
|
7572
|
+
createProp('borderBottomLeftRadius', 'string'),
|
7573
|
+
createProp('borderBottomRightRadius', 'string'),
|
7574
|
+
];
|
7575
|
+
const paddingProps = [
|
7576
|
+
createProp('paddingTop', 'string'),
|
7577
|
+
createProp('paddingLeft', 'string'),
|
7578
|
+
createProp('paddingRight', 'string'),
|
7579
|
+
createProp('paddingBottom', 'string'),
|
7580
|
+
];
|
7581
|
+
const backgroundColorProps = [
|
7582
|
+
createProp('backgroundColor', 'string'),
|
7583
|
+
];
|
7584
|
+
const backgroundImageProps = [
|
7585
|
+
createProp('backgroundImageUrl', 'url'),
|
7586
|
+
];
|
7587
|
+
const flexComponentSchemes = {
|
7588
|
+
FlexAvatar: {
|
7589
|
+
props: [
|
7590
|
+
createProp('size', 'string', byObj(AVATAR_SIZE), 10),
|
7591
|
+
createProp('width', 'string', [], 5),
|
7592
|
+
createProp('height', 'string', [], 5),
|
7593
|
+
createProp('shape', 'string', byObj(AVATAR_SHAPE), 10),
|
7594
|
+
createProp('image', 'url', [], 99),
|
7595
|
+
// createProp('caption', 'string'),
|
7596
|
+
createProp('alt', 'string', [], 50),
|
7597
|
+
// TODO: clickable
|
7598
|
+
...borderProps,
|
7599
|
+
],
|
7600
|
+
},
|
7601
|
+
FlexButton: {
|
7602
|
+
props: [
|
7603
|
+
createProp('size', 'string', byObj(BUTTON_SIZE), 50),
|
7604
|
+
createProp('label', 'string', [], 99),
|
7605
|
+
createProp('paddingLeft', 'string'),
|
7606
|
+
createProp('paddingRight', 'string'),
|
7607
|
+
createProp('fontSize', 'string'),
|
7608
|
+
createProp('theme', 'string', byObj(BUTTON_THEME), 50),
|
7609
|
+
createProp('variant', 'string', byObj(BUTTON_VARIANT)),
|
7610
|
+
createProp('color', 'color', [], 5),
|
7611
|
+
createProp('backgroundColor', 'string', [], 5),
|
7612
|
+
createProp('borderColor', 'string', [], 5),
|
7613
|
+
createProp('fontWeight', 'string', ['normal', 'bold']),
|
7614
|
+
createProp('round', 'string', byObj(BUTTON_ROUND)),
|
7615
|
+
createProp('width', 'string', [], 10),
|
7616
|
+
createProp('wrap', 'string', ['wrap', 'nowrap']),
|
7617
|
+
// TODO: clickable
|
7618
|
+
...radiusProps,
|
7619
|
+
],
|
7620
|
+
},
|
7621
|
+
FlexClipCopy: {
|
7622
|
+
props: [
|
7623
|
+
createProp('content', 'string'),
|
7624
|
+
createProp('copiedEventName', 'string'),
|
7625
|
+
createProp('noneTooltip', 'boolean'),
|
7626
|
+
],
|
7627
|
+
},
|
7628
|
+
FlexCloseButton: {
|
7629
|
+
props: [
|
7630
|
+
createProp('size', 'number'),
|
7631
|
+
createProp('placement', 'string', byObj(CLOSE_BUTTON_PLACEMENT), 99),
|
7632
|
+
createProp('round', 'string', byObj(CLOSE_BUTTON_ROUND)),
|
7633
|
+
createProp('bordered', 'boolean'),
|
7634
|
+
createProp('color', 'color'),
|
7635
|
+
createProp('backgroundColor', 'color'),
|
7636
|
+
createProp('label', 'string'),
|
7637
|
+
createProp('labelColor', 'color'),
|
7638
|
+
createProp('labelPlacement', 'string', byObj(CLOSE_BUTTON_LABEL_PLACEMENT)),
|
7639
|
+
createProp('top', 'string'),
|
7640
|
+
createProp('left', 'string'),
|
7641
|
+
createProp('right', 'string'),
|
7642
|
+
createProp('bottom', 'string'),
|
7643
|
+
],
|
7644
|
+
},
|
7645
|
+
FlexCountDown: {
|
7646
|
+
props: [
|
7647
|
+
createProp('timeLimit', 'date_string', [], 99),
|
7648
|
+
// createProp('timeLimit', 'date_string'),
|
7649
|
+
],
|
7650
|
+
},
|
7651
|
+
FlexIcon: {
|
7652
|
+
props: [
|
7653
|
+
createProp('variant', 'string', byObj(ICON_VARIANTS), 99),
|
7654
|
+
createProp('size', 'string', byObj(ICON_SIZE), 50),
|
7655
|
+
createProp('color', 'color', [], 5),
|
7656
|
+
createProp('width', 'string', [], 10),
|
7657
|
+
createProp('height', 'string', [], 10),
|
7658
|
+
],
|
7659
|
+
},
|
7660
|
+
FlexImage: {
|
7661
|
+
props: [
|
7662
|
+
createProp('image', 'url', [], 99),
|
7663
|
+
createProp('aspect', 'string', Object.keys(ASPECT_VARIANT).map(key => ASPECT_VARIANT[key].getProps().aspect), 98),
|
7664
|
+
createProp('width', 'string', [], 5),
|
7665
|
+
createProp('height', 'string', [], 5),
|
7666
|
+
createProp('shape', 'string', byObj(IMAGE_ROUND_SHAPE), 10),
|
7667
|
+
],
|
7668
|
+
},
|
7669
|
+
FlexLayout: {
|
7670
|
+
props: [
|
7671
|
+
createProp('display', 'string', ['flex', 'inline-flex', 'block']),
|
7672
|
+
createProp('direction', 'string', ['row', 'column', 'row-reverse', 'column-reverse'], 10),
|
7673
|
+
createProp('align', 'string', ['center', 'stretch', 'flex-start', 'flex-end'], 10),
|
7674
|
+
createProp('justify', 'string', ['center', 'flex-start', 'flex-end', 'space-between'], 10),
|
7675
|
+
createProp('gap', 'string', [], 10),
|
7676
|
+
createProp('rowGap', 'string', [], 10),
|
7677
|
+
createProp('columnGap', 'string', [], 10),
|
7678
|
+
createProp('width', 'string', [], 5),
|
7679
|
+
...overflowProps,
|
7680
|
+
...borderProps,
|
7681
|
+
...radiusProps,
|
7682
|
+
...backgroundColorProps,
|
7683
|
+
...backgroundImageProps,
|
7684
|
+
...paddingProps,
|
7685
|
+
],
|
7686
|
+
},
|
7687
|
+
FlexList: {
|
7688
|
+
props: [
|
7689
|
+
createProp('gap', 'string', [], 10),
|
7690
|
+
createProp('borderWidth', 'string', [], 10),
|
7691
|
+
createProp('borderStyle', 'string', [], 10),
|
7692
|
+
createProp('borderColor', 'string', [], 10),
|
7693
|
+
createProp('itemPaddingTop', 'string', [], 5),
|
7694
|
+
createProp('itemPaddingLeft', 'string', [], 5),
|
7695
|
+
createProp('itemPaddingRight', 'string', [], 5),
|
7696
|
+
createProp('itemPaddingBottom', 'string', [], 5),
|
7697
|
+
createProp('itemGap', 'string', [], 5),
|
7698
|
+
],
|
7699
|
+
},
|
7700
|
+
FlexListItem: {
|
7701
|
+
props: [
|
7702
|
+
createProp('gap', 'number', [], 10),
|
7703
|
+
// TODO: clickable
|
7704
|
+
],
|
7705
|
+
},
|
7706
|
+
FlexText: {
|
7707
|
+
props: [
|
7708
|
+
createProp('content', 'string', [], 99),
|
7709
|
+
createProp('theme', 'string', byObj(TEXT_THEME), 50),
|
7710
|
+
createProp('size', 'string', byObj(LAYER_TEXT_SIZE), 50),
|
7711
|
+
createProp('align', 'string', [], 5),
|
7712
|
+
createProp('fontStyle', 'string', [], 5),
|
7713
|
+
createProp('fontSize', 'string', [], 5),
|
7714
|
+
createProp('fontWeight', 'string', [], 5),
|
7715
|
+
createProp('lineHeight', 'string', [], 5),
|
7716
|
+
createProp('color', 'string', [], 5),
|
7717
|
+
createProp('width', 'string', [], 10),
|
7718
|
+
createProp('fontFamilyVariant', 'string', byObj(FONT_FAMILY_VARIANT), 10),
|
7719
|
+
createProp('fontFamily', 'string', []),
|
7720
|
+
// TODO: clickable
|
7721
|
+
],
|
7722
|
+
},
|
7723
|
+
};
|
7724
|
+
|
7725
|
+
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 };
|