@plaidev/karte-action-sdk 1.1.270-29419384.246a50882 → 1.1.270-29420750.2ec690591

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.
Files changed (46) hide show
  1. package/dist/components-flex/css.d.ts +2 -2
  2. package/dist/components-flex/props.d.ts +2 -2
  3. package/dist/components-flex/responsiveProp.d.ts +7 -0
  4. package/dist/hydrate/components-flex/css.d.ts +2 -2
  5. package/dist/hydrate/components-flex/props.d.ts +2 -2
  6. package/dist/hydrate/components-flex/responsiveProp.d.ts +7 -0
  7. package/dist/hydrate/index.d.ts +1 -0
  8. package/dist/hydrate/index.es.js +168 -102
  9. package/dist/hydrate/index.svelte5.d.ts +2 -1
  10. package/dist/hydrate/preview.d.ts +28 -0
  11. package/dist/hydrate/stores.d.ts +22 -1
  12. package/dist/hydrate/types.d.ts +13 -0
  13. package/dist/hydrate/utils.d.ts +1 -0
  14. package/dist/index.es.d.ts +1 -0
  15. package/dist/index.es.js +168 -102
  16. package/dist/preview.d.ts +28 -0
  17. package/dist/stores.d.ts +22 -1
  18. package/dist/svelte5/components-flex/css.d.ts +2 -2
  19. package/dist/svelte5/components-flex/props.d.ts +2 -2
  20. package/dist/svelte5/components-flex/responsiveProp.d.ts +7 -0
  21. package/dist/svelte5/hydrate/components-flex/css.d.ts +2 -2
  22. package/dist/svelte5/hydrate/components-flex/props.d.ts +2 -2
  23. package/dist/svelte5/hydrate/components-flex/responsiveProp.d.ts +7 -0
  24. package/dist/svelte5/hydrate/index.es.d.ts +2 -1
  25. package/dist/svelte5/hydrate/index.es.js +157 -94
  26. package/dist/svelte5/hydrate/preview.d.ts +28 -0
  27. package/dist/svelte5/hydrate/stores.d.ts +22 -1
  28. package/dist/svelte5/hydrate/types.d.ts +13 -0
  29. package/dist/svelte5/hydrate/utils.d.ts +1 -0
  30. package/dist/svelte5/index.es.d.ts +2 -1
  31. package/dist/svelte5/index.es.js +157 -94
  32. package/dist/svelte5/index.front2.es.js +157 -94
  33. package/dist/svelte5/index.svelte5.d.ts +2 -1
  34. package/dist/svelte5/preview.d.ts +28 -0
  35. package/dist/svelte5/stores.d.ts +22 -1
  36. package/dist/svelte5/types.d.ts +13 -0
  37. package/dist/svelte5/utils.d.ts +1 -0
  38. package/dist/templates.cjs.js +3 -2
  39. package/dist/templates.js +3 -2
  40. package/dist/types.d.ts +13 -0
  41. package/dist/utils.d.ts +1 -0
  42. package/package.json +1 -1
  43. package/dist/components-flex/responsive.d.ts +0 -26
  44. package/dist/hydrate/components-flex/responsive.d.ts +0 -26
  45. package/dist/svelte5/components-flex/responsive.d.ts +0 -26
  46. package/dist/svelte5/hydrate/components-flex/responsive.d.ts +0 -26
@@ -58,6 +58,9 @@ const NOOP = (_args) => {};
58
58
  /** @internal */
59
59
  const isPreview = () => isInFrame();
60
60
  const isCanvasPreview = () => typeof document !== "undefined" ? (document?.querySelector("#preview")?.getAttribute("data-canvas-preview") ?? "false") === "true" : false;
61
+ const getPreviewId = () => {
62
+ return typeof document !== "undefined" ? document.documentElement.getAttribute("data-krt-preview-id") ?? "" : "";
63
+ };
61
64
  const isOnSite = () => typeof document !== "undefined" ? (document?.querySelector("#preview")?.getAttribute("data-on-site") ?? "true") === "true" : true;
62
65
  const isInFrame = () => window && window.self !== window.top;
63
66
  /** @internal */
@@ -1147,6 +1150,33 @@ function setDestroyed(on$1) {
1147
1150
  *
1148
1151
  * @internal
1149
1152
  */
1153
+ const breakpoints = writable([]);
1154
+ /**
1155
+ * ブレイクポイントの一覧を取得する
1156
+ *
1157
+ * @returns 現在のブレイクポイントの一覧
1158
+ */
1159
+ function getBreakpoints() {
1160
+ return get(breakpoints);
1161
+ }
1162
+ /**
1163
+ * 変数を設定する
1164
+ *
1165
+ * @remarks
1166
+ * 設定したブレイクポイントは、ビジュアルエディタでブレイクポイントとして利用できます。
1167
+ *
1168
+ * @param values - ブレイクポイントの一覧
1169
+ */
1170
+ function setBreakpoints(values) {
1171
+ if (!get(breakpoints)) breakpoints.set([]);
1172
+ breakpoints.update(() => values);
1173
+ return getBreakpoints();
1174
+ }
1175
+ /**
1176
+ * Store to handle variables
1177
+ *
1178
+ * @internal
1179
+ */
1150
1180
  const variables = writable({});
1151
1181
  /**
1152
1182
  * 変数の一覧を取得する
@@ -2394,6 +2424,93 @@ async function loadGlobalStyle(href) {
2394
2424
  });
2395
2425
  }
2396
2426
 
2427
+ //#endregion
2428
+ //#region src/preview.ts
2429
+ /** @internal */
2430
+ const initPreview = () => {
2431
+ if (!isPreview()) return () => {};
2432
+ let root$56;
2433
+ let timer = null;
2434
+ const previewId = getPreviewId();
2435
+ const LAYER_ID_ATTR_KEY = "data-layer-id";
2436
+ const toInfo = (element) => {
2437
+ if (!element) return null;
2438
+ const rect = element.getBoundingClientRect();
2439
+ const styles = window.getComputedStyle(element);
2440
+ return {
2441
+ layerId: element.getAttribute(LAYER_ID_ATTR_KEY),
2442
+ top: rect.top,
2443
+ left: rect.left,
2444
+ width: rect.width,
2445
+ height: rect.height,
2446
+ direction: styles?.flexDirection === "row" || styles?.flexDirection === "row-reverse" ? "row" : "column",
2447
+ classNames: Array.from(element.classList.values()),
2448
+ styles: {
2449
+ direction: styles.flexDirection,
2450
+ opacity: styles.opacity,
2451
+ rowGap: styles.rowGap,
2452
+ columnGap: styles.columnGap,
2453
+ paddingLeft: styles.paddingLeft,
2454
+ paddingRight: styles.paddingRight,
2455
+ paddingTop: styles.paddingTop,
2456
+ paddingBottom: styles.paddingBottom,
2457
+ zIndex: styles.zIndex,
2458
+ position: styles.position,
2459
+ top: styles.top,
2460
+ left: styles.left,
2461
+ right: styles.right,
2462
+ bottom: styles.bottom
2463
+ }
2464
+ };
2465
+ };
2466
+ const w$1 = (w$2) => w$2.parent === w$2 ? w$2 : w$2.parent;
2467
+ const postUpdateLayers = () => {
2468
+ const layerElements = Array.from(root$56.querySelectorAll(`[${LAYER_ID_ATTR_KEY}]`)).map((el) => toInfo(el));
2469
+ if (layerElements.length === 0) return;
2470
+ w$1(window).postMessage({
2471
+ type: "KARTE-ACTION-PREVIEW-UPDATE-LAYERS",
2472
+ detail: {
2473
+ previewId,
2474
+ layerElements
2475
+ }
2476
+ }, "*");
2477
+ };
2478
+ const rootObserver = new MutationObserver(postUpdateLayers);
2479
+ const handleMessage = (e) => {
2480
+ console.log("message", e);
2481
+ const data = e.data;
2482
+ if (data.event_name === "OVERRIDE_LAYER_STYLE") {
2483
+ const { layerId = "", styles = [] } = data.detail || {};
2484
+ const layerElement = root$56.querySelector(`[${LAYER_ID_ATTR_KEY}="${layerId}"]`);
2485
+ if (!layerElement) return;
2486
+ styles.forEach(({ key, value }) => {
2487
+ layerElement.style.setProperty(key, value);
2488
+ });
2489
+ }
2490
+ };
2491
+ (() => {
2492
+ const init = () => {
2493
+ root$56 = getActionRoot();
2494
+ if (root$56) {
2495
+ rootObserver.observe(root$56, {
2496
+ childList: true,
2497
+ subtree: true,
2498
+ characterData: true,
2499
+ attributes: true
2500
+ });
2501
+ timer = setInterval(postUpdateLayers, 1e3);
2502
+ window.addEventListener("message", handleMessage);
2503
+ } else setTimeout(init, 30);
2504
+ };
2505
+ init();
2506
+ })();
2507
+ return () => {
2508
+ if (timer) clearInterval(timer);
2509
+ rootObserver.disconnect();
2510
+ window.removeEventListener("message", handleMessage);
2511
+ };
2512
+ };
2513
+
2397
2514
  //#endregion
2398
2515
  //#region src/action.ts
2399
2516
  /**
@@ -2438,6 +2555,7 @@ function create(App, options) {
2438
2555
  publish: options.publish,
2439
2556
  data
2440
2557
  };
2558
+ const destroyPreview = initPreview();
2441
2559
  const handleDestroy = () => {
2442
2560
  const { onDestroyHandlers } = getInternalHandlers();
2443
2561
  onDestroyHandlers?.forEach((h$1) => {
@@ -2446,6 +2564,7 @@ function create(App, options) {
2446
2564
  });
2447
2565
  const { onDestroyHandlers: onDestroyWidgetHandlers } = getWidgetHandlers();
2448
2566
  if (onDestroyWidgetHandlers) onDestroyWidgetHandlers.forEach((h$1) => h$1(actionProps));
2567
+ destroyPreview();
2449
2568
  };
2450
2569
  setSystem({
2451
2570
  apiKey: data.api_key || null,
@@ -3431,19 +3550,17 @@ function createComponentRawCss(layerId, define) {
3431
3550
  return define(gen).join("\n");
3432
3551
  }
3433
3552
  function toResponsiveSelector(responsiveSetting, body) {
3434
- const { mediaQueryCondition, userAgentCondition } = responsiveSetting;
3435
- if (mediaQueryCondition) {
3436
- const { raw, range, orientation } = mediaQueryCondition;
3553
+ const { breakpointId } = responsiveSetting;
3554
+ const breakpoint = getBreakpoints().find((v) => v.id === breakpointId);
3555
+ if (breakpoint && breakpoint.mediaQuery) {
3556
+ const { maxWidth, minWidth, orientation } = breakpoint.mediaQuery;
3437
3557
  const prefix = `@media screen and`;
3438
- if (raw) return `${prefix} (${raw}) {\n${body}\n}`;
3439
3558
  const orientationStyle = orientation ? ` and (orientation: ${orientation})` : "";
3440
- if (range) {
3441
- if (range.min && range.max) return `${prefix} (min-width: ${range.min}px)${orientationStyle} and (max-width: ${range.max}) {\n${body}\n}`;
3442
- else if (range.max) return `${prefix} (max-width: ${range.max}px)${orientationStyle} {\n${body}\n}`;
3443
- else if (range.min) return `${prefix} (min-width: ${range.min}px)${orientationStyle} {\n${body}\n}`;
3444
- }
3559
+ if (minWidth && maxWidth) return `${prefix} (min-width: ${minWidth}px)${orientationStyle} and (max-width: ${maxWidth}px) {\n${body}\n}`;
3560
+ else if (maxWidth) return `${prefix} (max-width: ${maxWidth}px)${orientationStyle} {\n${body}\n}`;
3561
+ else if (minWidth) return `${prefix} (min-width: ${minWidth}px)${orientationStyle} {\n${body}\n}`;
3445
3562
  return "";
3446
- } else if (userAgentCondition) return "";
3563
+ }
3447
3564
  return "";
3448
3565
  }
3449
3566
  function toStyleTag(css) {
@@ -3488,7 +3605,9 @@ function State($$anchor, $$props) {
3488
3605
  $.push($$props, false);
3489
3606
  let customBrandKit = $.prop($$props, "customBrandKit", 8, void 0);
3490
3607
  let globalCssCode = $.prop($$props, "globalCssCode", 8, void 0);
3608
+ let breakpoints$1 = $.prop($$props, "breakpoints", 24, () => []);
3491
3609
  setContext("brandKit", getBrandKit(customBrandKit()));
3610
+ setBreakpoints(breakpoints$1());
3492
3611
  $.init();
3493
3612
  var fragment = root$55();
3494
3613
  var node = $.first_child(fragment);
@@ -3559,57 +3678,25 @@ const ROUND_VARIANT = {
3559
3678
  };
3560
3679
 
3561
3680
  //#endregion
3562
- //#region src/components-flex/responsive.ts
3563
- const USER_AGENT_VARIANT = {
3564
- smartphone: { regex: /iPhone|Android.*Mobile/i },
3565
- tablet: { regex: /iPad|Android(?!.*Mobile)/i },
3566
- pc: { regex: /Windows NT|Macintosh|Linux x86_64/i },
3567
- windows: { regex: /Windows NT/i },
3568
- mac: { regex: /Macintosh|Mac OS X/i },
3569
- ios: { regex: /iPhone|iPad|iPod/i },
3570
- android: { regex: /Android/i },
3571
- safari: { regex: /Safari/i },
3572
- chrome: { regex: /Chrome|CriOS/i },
3573
- firefox: { regex: /Firefox/i },
3574
- ios_webview: { regex: /iPhone|iPad|iPod/i },
3575
- android_webview: { regex: /; wv\)/i }
3576
- };
3681
+ //#region src/components-flex/responsiveProp.ts
3577
3682
  const isMatchMediaQueryCondition = (condition) => {
3578
- const { raw, range, orientation } = condition;
3683
+ const { minWidth, maxWidth, orientation } = condition;
3579
3684
  if (orientation) return window.matchMedia(`(orientation: ${condition.orientation})`).matches;
3580
- if (range) {
3581
- const { min, max } = range;
3582
- if (typeof min === "number" && typeof max === "number") return window.matchMedia(`(min-width: ${min}px) and (max-width: ${max}px)`).matches;
3583
- else if (typeof min === "number") return window.matchMedia(`(min-width: ${min}px)`).matches;
3584
- else if (typeof max === "number") return window.matchMedia(`(max-width: ${max}px)`).matches;
3585
- }
3586
- if (raw) return window.matchMedia(raw).matches;
3685
+ if (typeof minWidth === "number" && typeof maxWidth === "number") return window.matchMedia(`(min-width: ${minWidth}px) and (max-width: ${maxWidth}px)`).matches;
3686
+ else if (typeof minWidth === "number") return window.matchMedia(`(min-width: ${minWidth}px)`).matches;
3687
+ else if (typeof maxWidth === "number") return window.matchMedia(`(max-width: ${maxWidth}px)`).matches;
3587
3688
  return false;
3588
3689
  };
3589
- const isMatchUserAgentCondition = (condition) => {
3590
- const { variants, regex } = condition;
3591
- if (variants) return variants.some((variant) => {
3592
- const regex$1 = USER_AGENT_VARIANT[variant]?.regex;
3593
- if (!regex$1) return false;
3594
- return new RegExp(regex$1).test(navigator.userAgent);
3595
- });
3596
- else if (regex) return new RegExp(regex).test(navigator.userAgent);
3597
- return false;
3598
- };
3599
- const isMatchResponsiveSetting = (setting) => {
3600
- const { mediaQueryCondition, userAgentCondition } = setting;
3601
- if (mediaQueryCondition) return isMatchMediaQueryCondition(mediaQueryCondition);
3602
- else if (userAgentCondition) return isMatchUserAgentCondition(userAgentCondition);
3603
- else return false;
3604
- };
3605
3690
  function useResponsiveProps(props) {
3606
3691
  return readable(props, (set) => {
3607
3692
  if (!props.responsiveSettings) {
3608
3693
  set(props);
3609
3694
  return () => {};
3610
3695
  }
3696
+ const breakpoints$1 = getBreakpoints();
3611
3697
  const update = () => {
3612
- const matchedSetting = [...props.responsiveSettings ?? []].reverse().find(isMatchResponsiveSetting);
3698
+ const breakpoint = breakpoints$1.find((v) => v.mediaQuery && isMatchMediaQueryCondition(v.mediaQuery));
3699
+ const matchedSetting = props.responsiveSettings.find((v) => v.breakpointId === breakpoint?.id);
3613
3700
  if (matchedSetting) set(Object.assign({}, props, matchedSetting.props ?? {}));
3614
3701
  else set(props);
3615
3702
  };
@@ -4210,11 +4297,7 @@ var Avatar_css_default = (layerId, props) => {
4210
4297
  appearance: "none"
4211
4298
  }),
4212
4299
  toDynamicStyle$3(layerId, props),
4213
- ...props.responsiveSettings?.map((v) => {
4214
- if (v.mediaQueryCondition) return toResponsiveSelector(v, toDynamicStyle$3(layerId, v.props));
4215
- else if (v.userAgentCondition) return "";
4216
- return "";
4217
- }) ?? [],
4300
+ ...props.responsiveSettings?.map((v) => toResponsiveSelector(v, toDynamicStyle$3(layerId, v.props))) ?? [],
4218
4301
  props.customizeCss
4219
4302
  ]);
4220
4303
  };
@@ -4850,14 +4933,10 @@ var Icon_css_default = (layerId, props, _brandKit) => {
4850
4933
  style("&[aria-disabled=\"true\"]:hover", { opacity: "0.24" }),
4851
4934
  style("&[aria-hidden=\"true\"]", { display: "none" }),
4852
4935
  toDynamicStyle$2(layerId, props),
4853
- ...props.responsiveSettings?.map((v) => {
4854
- if (v.mediaQueryCondition) return toResponsiveSelector(v, toDynamicStyle$2(layerId, {
4855
- variant: v.props.variant ?? props.variant,
4856
- ...v.props
4857
- }));
4858
- else if (v.userAgentCondition) return "";
4859
- return "";
4860
- }) ?? [],
4936
+ ...props.responsiveSettings?.map((v) => toResponsiveSelector(v, toDynamicStyle$2(layerId, {
4937
+ variant: v.props.variant ?? props.variant,
4938
+ ...v.props
4939
+ }))) ?? [],
4861
4940
  props.customizeCss
4862
4941
  ]);
4863
4942
  };
@@ -5121,11 +5200,7 @@ var Button_css_default = (layerId, props, brandKit) => {
5121
5200
  marginRight: "-0.2em"
5122
5201
  }),
5123
5202
  toDynamicStyle$1(layerId, props, brandKit),
5124
- ...props.responsiveSettings?.map((v) => {
5125
- if (v.mediaQueryCondition) return toResponsiveSelector(v, toDynamicStyle$1(layerId, v.props, brandKit));
5126
- else if (v.userAgentCondition) return "";
5127
- return "";
5128
- }) ?? [],
5203
+ ...props.responsiveSettings?.map((v) => toResponsiveSelector(v, toDynamicStyle$1(layerId, v.props, brandKit))) ?? [],
5129
5204
  props.customizeCss
5130
5205
  ]);
5131
5206
  };
@@ -6033,11 +6108,7 @@ var Layout_css_default = (layerId, props, brandKit) => {
6033
6108
  style("&[data-clickable=\"true\"]", { cursor: "pointer" }),
6034
6109
  style("&[data-clickable=\"true\"]:hover", { opacity: .8 }),
6035
6110
  toDynamicStyle$4(props),
6036
- ...props.responsiveSettings?.map((v) => {
6037
- if (v.mediaQueryCondition) return toResponsiveSelector(v, toDynamicStyle$4(v.props));
6038
- else if (v.userAgentCondition) return "";
6039
- return "";
6040
- }) ?? [],
6111
+ ...props.responsiveSettings?.map((v) => toResponsiveSelector(v, toDynamicStyle$4(v.props))) ?? [],
6041
6112
  props.customizeCss
6042
6113
  ]);
6043
6114
  };
@@ -6520,14 +6591,10 @@ var Text_css_default = (layerId, props, brandKit) => {
6520
6591
  wordBreak: "break-all"
6521
6592
  }),
6522
6593
  toDynamicStyle$4(props),
6523
- ...props.responsiveSettings?.map((v) => {
6524
- if (v.mediaQueryCondition) return toResponsiveSelector(v, toDynamicStyle$4({
6525
- ...v.props,
6526
- content: v.props.content ?? props.content
6527
- }));
6528
- else if (v.userAgentCondition) return "";
6529
- return "";
6530
- }) ?? [],
6594
+ ...props.responsiveSettings?.map((v) => toResponsiveSelector(v, toDynamicStyle$4({
6595
+ ...v.props,
6596
+ content: v.props.content ?? props.content
6597
+ }))) ?? [],
6531
6598
  props.customizeCss
6532
6599
  ]);
6533
6600
  };
@@ -6725,14 +6792,10 @@ var TextLink_css_default = (layerId, props, brandKit) => {
6725
6792
  style("&[aria-disabled=\"true\"]:hover", { opacity: "0.24" }),
6726
6793
  style("&[aria-hidden=\"true\"]", { display: "none" }),
6727
6794
  toDynamicStyle(layerId, props, brandKit),
6728
- ...props.responsiveSettings?.map((v) => {
6729
- if (v.mediaQueryCondition) return toResponsiveSelector(v, toDynamicStyle(layerId, {
6730
- ...v.props,
6731
- label: v.props.label ?? props.label
6732
- }, brandKit));
6733
- else if (v.userAgentCondition) return "";
6734
- return "";
6735
- }) ?? [],
6795
+ ...props.responsiveSettings?.map((v) => toResponsiveSelector(v, toDynamicStyle(layerId, {
6796
+ ...v.props,
6797
+ label: v.props.label ?? props.label
6798
+ }, brandKit))) ?? [],
6736
6799
  props.customizeCss
6737
6800
  ]);
6738
6801
  };
@@ -7838,7 +7901,7 @@ var root$3 = $.template(`<!> <!>`, 1);
7838
7901
  function ClipCopy($$anchor, $$props) {
7839
7902
  $.push($$props, false);
7840
7903
  const [$$stores, $$cleanup] = $.setup_stores();
7841
- const $responsiveProps = () => $.store_get(responsiveProps, "$responsiveProps", $$stores);
7904
+ const $responsiveSettings = () => $.store_get(responsiveSettings, "$responsiveSettings", $$stores);
7842
7905
  const rProps = $.mutable_state();
7843
7906
  let props = $.prop($$props, "props", 24, () => ({}));
7844
7907
  let layerId = $.prop($$props, "layerId", 24, () => crypto.randomUUID());
@@ -7846,7 +7909,7 @@ function ClipCopy($$anchor, $$props) {
7846
7909
  let buttonElement = $.mutable_state();
7847
7910
  let showTooltip = $.mutable_state(false);
7848
7911
  const cssCode = ClipCopy_css_default(layerId(), props());
7849
- const responsiveProps = useResponsiveProps(props());
7912
+ const responsiveSettings = useResponsiveProps(props());
7850
7913
  const handleClick = async (e) => {
7851
7914
  e.preventDefault();
7852
7915
  const targetText = $.get(rProps).content ?? $.get(buttonElement)?.innerText ?? "";
@@ -7863,8 +7926,8 @@ function ClipCopy($$anchor, $$props) {
7863
7926
  console.warn(e$1);
7864
7927
  }
7865
7928
  };
7866
- $.legacy_pre_effect(() => $responsiveProps(), () => {
7867
- $.set(rProps, $responsiveProps());
7929
+ $.legacy_pre_effect(() => $responsiveSettings(), () => {
7930
+ $.set(rProps, $responsiveSettings());
7868
7931
  });
7869
7932
  $.legacy_pre_effect_reset();
7870
7933
  $.init();
@@ -9167,4 +9230,4 @@ const flexComponentSchemes = {
9167
9230
  };
9168
9231
 
9169
9232
  //#endregion
9170
- export { ACTION_HOOK_LABEL, ASPECT_VARIANT, ASPECT_VARIANTS, AVATAR_SHAPE, AVATAR_SIZE, AVATAR_SIZE_STYLES, Alignments, AnimationStyles, BACKGROUND_COLOR_VARIANT, BACKGROUND_COLOR_VARIANTS, BORDER_COLOR_VARIANT, BORDER_COLOR_VARIANTS, 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, FORM_FIELD_LABEL_SIZE, FORM_FIELD_LABEL_THEME, FORM_FIELD_SIZE, FORM_FIELD_TYPE, FORM_FIELD_VARIANT, FORM_FIELD_VARIANT_FOR_CHECKER, FORM_IDENTIFY_FIELD_TYPE, FORM_INPUT_TYPE, FORM_VALIDATION_DEFAULT_ERROR_MESSAGES, FORM_VALIDATION_REGEX, FORM_VALIDATION_TYPE, 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, Embed as FlexEmbed, Form as FlexForm, FormBoolean as FlexFormBoolean, FormCheckboxes as FlexFormCheckboxes, FormField as FlexFormField, FormIdentifyField as FlexFormIdentifyField, FormInput as FlexFormInput, FormRadios as FlexFormRadios, FormSelect as FlexFormSelect, FormTextarea as FlexFormTextarea, 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, USER_AGENT_VARIANT, WritingModes, addChoiceAnswer, addFreeAnswer, afterUpdate, applyCss, applyGlobalCss, beforeUpdate, buttonOutlinedPropsDefault, buttonPropsDefault, close, closeAction, collection, create, createApp, createFog, createProp, destroy, destroyAction, ensureModalRoot, eventHandlers, finalize, flexComponentSchemes, formData, formStore, formSubmittedIdentifyValues, formSubmittedValues, getActionRoot, getAnsweredQuestion, getAnsweredQuestionIds, getBrandKit, getButtonOutlinedThemeStyles, getButtonTextThemeStyles, getButtonThemeStyles, getCssVariables, getEventHandlers, getEvents, getFormErrors, getFormFieldSchema, getFormFieldState, getFormFieldValue, getFormValues, getLogs, 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, onSubmitForm, onTime, registerFormField, removeAnswer, resetEventHandlers, resetVariables, sendAnswer, sendAnswers, setEventHandlers, setFormFieldError, setFormFieldTouched, setFormFieldValue, setSetting, setState, setVariables, show, showAction, showModal, showOnScroll, showOnTime, state, tick, unregisterFormField, useBrandKit, useResponsiveProps, validateFormField, variables, widget_exports as widget };
9233
+ export { ACTION_HOOK_LABEL, ASPECT_VARIANT, ASPECT_VARIANTS, AVATAR_SHAPE, AVATAR_SIZE, AVATAR_SIZE_STYLES, Alignments, AnimationStyles, BACKGROUND_COLOR_VARIANT, BACKGROUND_COLOR_VARIANTS, BORDER_COLOR_VARIANT, BORDER_COLOR_VARIANTS, 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, FORM_FIELD_LABEL_SIZE, FORM_FIELD_LABEL_THEME, FORM_FIELD_SIZE, FORM_FIELD_TYPE, FORM_FIELD_VARIANT, FORM_FIELD_VARIANT_FOR_CHECKER, FORM_IDENTIFY_FIELD_TYPE, FORM_INPUT_TYPE, FORM_VALIDATION_DEFAULT_ERROR_MESSAGES, FORM_VALIDATION_REGEX, FORM_VALIDATION_TYPE, 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, Embed as FlexEmbed, Form as FlexForm, FormBoolean as FlexFormBoolean, FormCheckboxes as FlexFormCheckboxes, FormField as FlexFormField, FormIdentifyField as FlexFormIdentifyField, FormInput as FlexFormInput, FormRadios as FlexFormRadios, FormSelect as FlexFormSelect, FormTextarea as FlexFormTextarea, 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, beforeUpdate, buttonOutlinedPropsDefault, buttonPropsDefault, close, closeAction, collection, create, createApp, createFog, createProp, destroy, destroyAction, ensureModalRoot, eventHandlers, finalize, flexComponentSchemes, formData, formStore, formSubmittedIdentifyValues, formSubmittedValues, getActionRoot, getAnsweredQuestion, getAnsweredQuestionIds, getBrandKit, getButtonOutlinedThemeStyles, getButtonTextThemeStyles, getButtonThemeStyles, getCssVariables, getEventHandlers, getEvents, getFormErrors, getFormFieldSchema, getFormFieldState, getFormFieldValue, getFormValues, getLogs, getState, getStates, getSystem, getTextLinkThemeStyles, getTextThemeStyles, getVariables, hideOnScroll, hideOnTime, initPreview, initialize, isOpened, listenLogger, loadActionTable, loadActionTableQuery, loadActionTableRow, loadActionTableRows, loadGlobalScript, loadGlobalStyle, loadStyle, logger, onChangeState, onClose, onCreate, onDestory, onDestroy, onMount, onScroll, onShow, onSubmitForm, onTime, registerFormField, removeAnswer, resetEventHandlers, resetVariables, sendAnswer, sendAnswers, setEventHandlers, setFormFieldError, setFormFieldTouched, setFormFieldValue, setSetting, setState, setVariables, show, showAction, showModal, showOnScroll, showOnTime, state, tick, unregisterFormField, useBrandKit, useResponsiveProps, validateFormField, variables, widget_exports as widget };
@@ -0,0 +1,28 @@
1
+ export type ElementInfoStyles = {
2
+ opacity: string;
3
+ rowGap: string;
4
+ columnGap: string;
5
+ direction: string;
6
+ paddingLeft: string;
7
+ paddingRight: string;
8
+ paddingTop: string;
9
+ paddingBottom: string;
10
+ zIndex: string;
11
+ position: string;
12
+ top: string;
13
+ left: string;
14
+ right: string;
15
+ bottom: string;
16
+ };
17
+ export type ElementInfo = {
18
+ top: number;
19
+ left: number;
20
+ width: number;
21
+ height: number;
22
+ layerId: string;
23
+ direction: "row" | "column" | "";
24
+ classNames: string[];
25
+ styles: ElementInfoStyles;
26
+ };
27
+ /** @internal */
28
+ export declare const initPreview: () => (() => void);
@@ -1,6 +1,6 @@
1
1
  import { get as get_ } from "svelte/store";
2
2
  import type { Writable as Writable_ } from "svelte/store";
3
- import type { ActionSetting, ActionEventHandler, ActionVariables, SystemConfig, ActionRunnerContext } from "./types.js";
3
+ import { ActionSetting, ActionEventHandler, ActionVariables, SystemConfig, ActionRunnerContext, Breakpoint } from "./types.js";
4
4
  /** @internal */
5
5
  export type Store<T> = Writable_<T>;
6
6
  /**
@@ -350,6 +350,27 @@ export declare function setDestroyed(on: boolean): void;
350
350
  *
351
351
  * @internal
352
352
  */
353
+ export declare const breakpoints: Store<Breakpoint[]>;
354
+ /**
355
+ * ブレイクポイントの一覧を取得する
356
+ *
357
+ * @returns 現在のブレイクポイントの一覧
358
+ */
359
+ export declare function getBreakpoints(): Breakpoint[];
360
+ /**
361
+ * 変数を設定する
362
+ *
363
+ * @remarks
364
+ * 設定したブレイクポイントは、ビジュアルエディタでブレイクポイントとして利用できます。
365
+ *
366
+ * @param values - ブレイクポイントの一覧
367
+ */
368
+ export declare function setBreakpoints(values: Breakpoint[]): Breakpoint[];
369
+ /**
370
+ * Store to handle variables
371
+ *
372
+ * @internal
373
+ */
353
374
  export declare const variables: Store<{
354
375
  [key: string]: any;
355
376
  }>;
@@ -18,6 +18,19 @@ export type ActionVariables = {
18
18
  [key: string]: any;
19
19
  };
20
20
  /**
21
+ * ブレイクポイント
22
+ *
23
+ * @public
24
+ */
25
+ export type Breakpoint = {
26
+ id: string;
27
+ mediaQuery?: {
28
+ minWidth?: number;
29
+ maxWidth?: number;
30
+ orientation?: "portrait" | "landscape";
31
+ };
32
+ };
33
+ /**
21
34
  * アクションの send 関数
22
35
  *
23
36
  * @public
@@ -4,6 +4,7 @@ export declare const NOOP: Function;
4
4
  /** @internal */
5
5
  export declare const isPreview: () => boolean;
6
6
  export declare const isCanvasPreview: () => boolean;
7
+ export declare const getPreviewId: () => string;
7
8
  export declare const isOnSite: () => boolean;
8
9
  export declare const isInFrame: () => boolean;
9
10
  /** @internal */
@@ -17,12 +17,13 @@ export type { CollectionConfig, ActionTableRowRequestConfig, ActionTableRowsRequ
17
17
  export { addChoiceAnswer, addFreeAnswer, removeAnswer, getAnsweredQuestion, getAnsweredQuestionIds, sendAnswer, sendAnswers } from "./form.js";
18
18
  export * as widget from "./widget.js";
19
19
  export { onMount, onDestory, beforeUpdate, afterUpdate, tick, LAYOUT_COMPONENT_NAMES } from "./components/index.js";
20
+ export * from "./preview.js";
20
21
  export * from "./components-flex/form.js";
21
22
  export { default as State } from "./components-flex/state/State.svelte.js";
22
23
  export { default as StateItem } from "./components-flex/state/StateItem.svelte.js";
23
24
  export * from "./components-flex/shared/types.js";
24
25
  export * from "./components-flex/props.js";
25
- export * from "./components-flex/responsive.js";
26
+ export * from "./components-flex/responsiveProp.js";
26
27
  export { default as FlexAvatar } from "./components-flex/avatar/Avatar.svelte.js";
27
28
  export * from "./components-flex/avatar/types.js";
28
29
  export * from "./components-flex/avatar/styles.js";