@nascentdigital/funnel-editor 6.1.7 → 7.0.0

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 (82) hide show
  1. package/dist/collection/components/CollectionHeader.js +17 -3
  2. package/dist/core/components/fields/EnumField.js +3 -1
  3. package/dist/core/components/fields/FieldHeader.js +16 -23
  4. package/dist/core/components/fields/FieldLayout.d.ts +1 -1
  5. package/dist/core/components/fields/FieldLayout.js +10 -18
  6. package/dist/core/components/fields/collection/CollectionEditor.js +7 -7
  7. package/dist/core/components/index.d.ts +1 -0
  8. package/dist/core/components/index.js +1 -0
  9. package/dist/core/components/interaction/Combobox.js +17 -28
  10. package/dist/core/components/interaction/Popup.js +14 -2
  11. package/dist/core/components/interaction/QuickPicker.js +0 -1
  12. package/dist/core/components/panels/MessagePanel.d.ts +7 -0
  13. package/dist/core/components/panels/MessagePanel.js +53 -0
  14. package/dist/core/components/panels/index.d.ts +2 -0
  15. package/dist/core/components/panels/index.js +18 -0
  16. package/dist/core/components/panels/visual/MediaEditor.d.ts +12 -0
  17. package/dist/core/components/panels/visual/MediaEditor.js +47 -0
  18. package/dist/core/components/panels/visual/VisualPanel.d.ts +7 -0
  19. package/dist/core/components/panels/visual/VisualPanel.js +332 -0
  20. package/dist/core/components/panels/visual/index.d.ts +1 -0
  21. package/dist/core/components/panels/visual/index.js +17 -0
  22. package/dist/core/components/visuals/Icon.d.ts +1 -1
  23. package/dist/core/components/visuals/Icon.js +12 -0
  24. package/dist/core/domain/Block.d.ts +18 -8
  25. package/dist/core/domain/Block.js +101 -78
  26. package/dist/core/domain/BlockConfiguration.d.ts +38 -32
  27. package/dist/core/domain/BlockConfiguration.js +348 -255
  28. package/dist/core/domain/CollectionFieldProxy.d.ts +1 -0
  29. package/dist/core/domain/CollectionFieldProxy.js +5 -0
  30. package/dist/core/domain/CollectionSummary.d.ts +1 -1
  31. package/dist/core/domain/CollectionSummary.js +1 -1
  32. package/dist/core/domain/Collections.d.ts +2 -0
  33. package/dist/core/domain/Collections.js +6 -0
  34. package/dist/core/domain/IPage.d.ts +3 -2
  35. package/dist/core/domain/Item.d.ts +1 -1
  36. package/dist/core/domain/ItemBase.d.ts +2 -0
  37. package/dist/core/domain/ItemBase.js +9 -0
  38. package/dist/core/domain/Page.d.ts +1 -1
  39. package/dist/core/domain/SectionBlock.d.ts +4 -5
  40. package/dist/core/domain/SectionBlock.js +3 -10
  41. package/dist/core/hooks/useBlockConfiguration.d.ts +1 -7
  42. package/dist/core/hooks/useBlockConfiguration.js +1 -6
  43. package/dist/core/repository/PageSerializer.js +11 -10
  44. package/dist/core/repository/SerializeCollectionUpdate.js +4 -4
  45. package/dist/core/repository/SerializePageUpdate.d.ts +2 -1
  46. package/dist/core/repository/SerializePageUpdate.js +79 -24
  47. package/dist/page/components/BlockEditor.js +3 -3
  48. package/dist/page/components/config/BlockConfigButton.d.ts +3 -1
  49. package/dist/page/components/config/BlockConfigButton.js +12 -24
  50. package/dist/page/components/config/BlockPreview.d.ts +7 -6
  51. package/dist/page/components/config/BlockPreview.js +30 -15
  52. package/dist/page/components/config/index.d.ts +1 -2
  53. package/dist/page/components/config/index.js +1 -2
  54. package/dist/page/components/config/preview/ColumnLayout.d.ts +7 -4
  55. package/dist/page/components/config/preview/ColumnLayout.js +14 -2
  56. package/dist/page/components/config/preview/ItemLayout.d.ts +7 -4
  57. package/dist/page/components/config/preview/ItemLayout.js +24 -11
  58. package/dist/page/components/config/preview/ListPanel.d.ts +7 -4
  59. package/dist/page/components/config/preview/ListPanel.js +4 -2
  60. package/dist/page/components/config/preview/MessagePanel.d.ts +7 -4
  61. package/dist/page/components/config/preview/MessagePanel.js +6 -3
  62. package/dist/page/components/config/preview/Panel.d.ts +14 -4
  63. package/dist/page/components/config/preview/Panel.js +25 -7
  64. package/dist/page/components/config/preview/PreviewSize.d.ts +1 -0
  65. package/dist/page/components/config/preview/PreviewSize.js +2 -0
  66. package/dist/page/components/config/preview/RowLayout.d.ts +7 -4
  67. package/dist/page/components/config/preview/RowLayout.js +15 -3
  68. package/dist/page/components/config/preview/StackLayout.d.ts +7 -4
  69. package/dist/page/components/config/preview/StackLayout.js +14 -2
  70. package/dist/page/components/config/preview/VisualPanel.d.ts +7 -4
  71. package/dist/page/components/config/preview/VisualPanel.js +7 -5
  72. package/dist/page/components/config/preview/index.d.ts +2 -0
  73. package/dist/page/components/config/preview/index.js +2 -0
  74. package/dist/page/components/panels/BlockConfigPanel.d.ts +7 -1
  75. package/dist/page/components/panels/BlockConfigPanel.js +9 -7
  76. package/dist/page/screens/PageEditor.js +3 -4
  77. package/dist/styles/index.css +74 -56
  78. package/package.json +2 -2
  79. package/dist/page/components/config/BlockConfigurationProvider.d.ts +0 -16
  80. package/dist/page/components/config/BlockConfigurationProvider.js +0 -25
  81. package/dist/page/components/config/useBlockConfiguration$.d.ts +0 -3
  82. package/dist/page/components/config/useBlockConfiguration$.js +0 -22
@@ -21,11 +21,10 @@ const funnel_ui_1 = require("@nascentdigital/funnel-ui");
21
21
  const classnames_1 = __importDefault(require("classnames"));
22
22
  const react_1 = require("motion/react");
23
23
  const react_2 = require("react");
24
- const rxjs_1 = require("rxjs");
25
24
  const core_1 = require("../../../core");
26
25
  const hooks_1 = require("../../hooks");
27
26
  // component
28
- function BlockConfigButton({ target, anchorId: anchorOverrideId, children = 'Configure' }) {
27
+ function BlockConfigButton({ block, target, anchorId: anchorOverrideId, children = 'Configure' }) {
29
28
  var _a;
30
29
  // bind state + hooks
31
30
  const [open, setOpen] = (0, react_2.useState)(false);
@@ -33,14 +32,12 @@ function BlockConfigButton({ target, anchorId: anchorOverrideId, children = 'Con
33
32
  const nestedAnchorId = (0, react_2.useId)();
34
33
  const panelLayoutPickerRef = (0, react_2.useRef)(null);
35
34
  const listLayoutPickerRef = (0, react_2.useRef)(null);
36
- const configuration = (0, core_1.useBlockConfiguration)();
37
35
  const pageController = (0, hooks_1.usePageController)();
38
36
  const collectionStore = (0, core_1.useCollectionStore)();
39
37
  const assetStore = (0, core_1.useAssetStore)();
40
- // skip if there's no config
41
- if (!configuration) {
42
- return null;
43
- }
38
+ const { configuration } = block;
39
+ // sync config
40
+ (0, core_1.useBlockConfiguration)(configuration);
44
41
  // determine popup
45
42
  let size;
46
43
  let placement;
@@ -68,8 +65,9 @@ function BlockConfigButton({ target, anchorId: anchorOverrideId, children = 'Con
68
65
  })),
69
66
  selectedItem: layoutData === null || layoutData === void 0 ? void 0 : layoutData.value
70
67
  }));
68
+ // update if there was a selection
71
69
  if (selectedLayout) {
72
- configuration.setLayout(selectedLayout);
70
+ configuration.setPanelLayout(selectedLayout);
73
71
  }
74
72
  };
75
73
  // set variables
@@ -77,19 +75,16 @@ function BlockConfigButton({ target, anchorId: anchorOverrideId, children = 'Con
77
75
  placement = anchorOverrideId ? 'left-start' : 'left';
78
76
  title = 'Block Configuration';
79
77
  // render content
80
- const { scope, layoutField, blocksFields = [], desktopFields = [], mobileFields = [] } = configuration;
81
- const settingsFields = scope === 'desktop'
82
- ? desktopFields
83
- : mobileFields;
78
+ const { layoutField, blockFields = [], blockExtendedFields = [] } = configuration;
84
79
  const { options: slotOptions = [], currentIndex: slotIndex = 0 } = configuration.slotState;
85
- content = ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsxs)("section", { className: "grid grid-cols-2 gap-x-l5 gap-y-l4", children: [blocksFields.length > 0 &&
86
- (0, jsx_runtime_1.jsx)(core_1.FieldErrorController, { children: blocksFields.map(field => (0, jsx_runtime_1.jsx)(core_1.FieldEditor, { className: "col-span-full", field: field, size: "xs" }, field.id)) }), layoutField && layoutField.schema.enum.length > 1 &&
80
+ content = ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsxs)("section", { className: "grid grid-cols-2 gap-x-l5 gap-y-l4", children: [blockFields.length > 0 &&
81
+ (0, jsx_runtime_1.jsx)(core_1.FieldErrorController, { children: blockFields.map(field => (0, jsx_runtime_1.jsx)(core_1.FieldEditor, { className: "col-span-full", field: field, size: "xs" }, field.id)) }), layoutField && layoutField.schema.enum.length > 1 &&
87
82
  (0, jsx_runtime_1.jsxs)("div", { className: "flex flex-col gap-l2", children: [(0, jsx_runtime_1.jsx)(core_1.FieldHeader, { label: "Layout", size: "xs" }), (0, jsx_runtime_1.jsx)(core_1.Button, { anchorId: nestedAnchorId, variant: "secondary", size: "xs", iconLeft: "LayoutTemplate", onClick: onChangePanelLayout, children: "Change" })] }), slotOptions.length > 1 &&
88
83
  (0, jsx_runtime_1.jsxs)("div", { className: "flex flex-col gap-l2", children: [(0, jsx_runtime_1.jsx)(core_1.FieldHeader, { label: "Arrangement", size: "xs" }), slotOptions.length === 2
89
84
  ?
90
85
  (0, jsx_runtime_1.jsx)(core_1.Button, { variant: "secondary", size: "xs", iconLeft: "ArrowLeftRight", onClick: () => configuration === null || configuration === void 0 ? void 0 : configuration.gotToNextSlot(), children: "Swap" })
91
86
  :
92
- (0, jsx_runtime_1.jsxs)("div", { className: "flex items-center gap-l4", children: [(0, jsx_runtime_1.jsx)(core_1.Button, { variant: "secondary", size: "xs", onClick: () => configuration === null || configuration === void 0 ? void 0 : configuration.gotToPreviousSlot(), children: (0, jsx_runtime_1.jsx)(core_1.Icon, { variant: "ArrowLeft", size: { size: 16, strokeWidth: 1, absoluteStrokeWidth: true } }) }), (0, jsx_runtime_1.jsxs)("span", { className: "label-xs", children: [slotIndex + 1, " of ", slotOptions.length] }), (0, jsx_runtime_1.jsx)(core_1.Button, { variant: "secondary", size: "xs", onClick: () => configuration === null || configuration === void 0 ? void 0 : configuration.gotToNextSlot(), children: (0, jsx_runtime_1.jsx)(core_1.Icon, { variant: "ArrowRight", size: { size: 16, strokeWidth: 1, absoluteStrokeWidth: true } }) })] })] }), settingsFields.map(field => (0, jsx_runtime_1.jsx)(core_1.FieldEditor, { className: "col-span-full", field: field, size: "xs" }, field.id))] }), (0, jsx_runtime_1.jsx)(core_1.QuickPicker, { ref: panelLayoutPickerRef, variant: "card", title: "Pick Block Layout", description: "Select an available layout for this block.", renderItem: (item) => renderPanelLayoutItem(item) })] }));
87
+ (0, jsx_runtime_1.jsxs)("div", { className: "flex items-center gap-l4", children: [(0, jsx_runtime_1.jsx)(core_1.Button, { variant: "secondary", size: "xs", onClick: () => configuration === null || configuration === void 0 ? void 0 : configuration.gotToPreviousSlot(), children: (0, jsx_runtime_1.jsx)(core_1.Icon, { variant: "ArrowLeft", size: { size: 16, strokeWidth: 1, absoluteStrokeWidth: true } }) }), (0, jsx_runtime_1.jsxs)("span", { className: "label-xs", children: [slotIndex + 1, " of ", slotOptions.length] }), (0, jsx_runtime_1.jsx)(core_1.Button, { variant: "secondary", size: "xs", onClick: () => configuration === null || configuration === void 0 ? void 0 : configuration.gotToNextSlot(), children: (0, jsx_runtime_1.jsx)(core_1.Icon, { variant: "ArrowRight", size: { size: 16, strokeWidth: 1, absoluteStrokeWidth: true } }) })] })] }), blockExtendedFields.map(field => (0, jsx_runtime_1.jsx)(core_1.FieldEditor, { className: "col-span-full", field: field, size: "xs" }, field.id))] }), (0, jsx_runtime_1.jsx)(core_1.QuickPicker, { ref: panelLayoutPickerRef, variant: "card", title: "Pick Block Layout", description: "Select an available layout for this block.", renderItem: (item) => renderPanelLayoutItem(item) })] }));
93
88
  break;
94
89
  }
95
90
  case 'message':
@@ -186,23 +181,16 @@ function BlockConfigButton({ target, anchorId: anchorOverrideId, children = 'Con
186
181
  }
187
182
  // helpers
188
183
  const onSave = async () => {
189
- // try to save
190
- configuration.save();
191
- // wait for page to save
192
- await (0, rxjs_1.firstValueFrom)(pageController.saved$);
193
- // re-sync config
194
- configuration.reset();
195
184
  // close
196
185
  setOpen(false);
197
186
  };
198
187
  const onClosed = () => {
199
188
  // reset configuration (drops changes)
200
- configuration.reset();
201
189
  };
202
190
  // render
203
- return ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)(core_1.Button, { anchorId: anchorId, variant: "secondary", size: "xs", onClick: () => setOpen(true), children: children }), (0, jsx_runtime_1.jsx)(core_1.MiniEditor, { title: title, size: size, anchor: anchorOverrideId || anchorId, anchorOffset: 4, placement: placement, open: open, onSave: onSave, disableSave: !configuration.modified, onClose: () => setOpen(false), onClosed: onClosed, customActions: (0, jsx_runtime_1.jsx)(core_1.Button, { variant: "secondary", size: "xs", iconLeft: configuration.scope === 'mobile'
191
+ return ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)(core_1.Button, { anchorId: anchorId, variant: "secondary", size: "xs", onClick: () => setOpen(true), children: children }), (0, jsx_runtime_1.jsx)(core_1.MiniEditor, { title: title, size: size, anchor: anchorOverrideId || anchorId, anchorOffset: 4, placement: placement, open: open, onSave: onSave, onClose: () => setOpen(false), onClosed: onClosed, customActions: (0, jsx_runtime_1.jsx)(core_1.Button, { variant: "secondary", size: "xs", iconLeft: configuration.variant === 'mobile'
204
192
  ? 'Smartphone'
205
- : 'Monitor', onClick: () => configuration.scope = configuration.scope === 'desktop' ? 'mobile' : 'desktop', children: configuration.scope === 'mobile' ? 'Mobile' : 'Desktop' }), children: (0, jsx_runtime_1.jsxs)("div", { className: "flex flex-col gap-l4", children: [tip &&
193
+ : 'Monitor', children: configuration.variant === 'mobile' ? 'Mobile' : 'Desktop' }), children: (0, jsx_runtime_1.jsxs)("div", { className: "flex flex-col gap-l4", children: [tip &&
206
194
  (0, jsx_runtime_1.jsx)(core_1.Note, { variant: "tip", size: size, children: (0, jsx_runtime_1.jsx)(funnel_ui_1.Markup, { markdown: `**Tip:** ${tip}` }) }), content] }) })] }));
207
195
  }
208
196
  function renderPanelLayoutItem(item) {
@@ -1,10 +1,11 @@
1
- import { BlockLayout } from '@nascentdigital/funnel-core';
2
- import { BlockConfiguration } from '../../../core';
3
- export declare function BlockPreview({ className, scope, layout }: BlockPreview.Props): import("react/jsx-runtime").JSX.Element;
1
+ import { BlockLayout, Schema } from '@nascentdigital/funnel-core';
2
+ import { Panel, PreviewSize } from './preview';
3
+ export declare function BlockPreview({ className, variant, size, layout, selectedPanel, onSelectPanel }: BlockPreview.Props): import("react/jsx-runtime").JSX.Element;
4
4
  export declare namespace BlockPreview {
5
- type Props = {
5
+ type Props = Panel.SelectionProps & {
6
6
  className?: string;
7
- scope: BlockConfiguration.Scope;
8
- layout: BlockLayout;
7
+ variant: Schema.Block.Config.Variant;
8
+ size?: PreviewSize;
9
+ layout?: BlockLayout;
9
10
  };
10
11
  }
@@ -1,4 +1,15 @@
1
1
  "use strict";
2
+ var __rest = (this && this.__rest) || function (s, e) {
3
+ var t = {};
4
+ for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
5
+ t[p] = s[p];
6
+ if (s != null && typeof Object.getOwnPropertySymbols === "function")
7
+ for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
8
+ if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
9
+ t[p[i]] = s[p[i]];
10
+ }
11
+ return t;
12
+ };
2
13
  var __importDefault = (this && this.__importDefault) || function (mod) {
3
14
  return (mod && mod.__esModule) ? mod : { "default": mod };
4
15
  };
@@ -10,37 +21,41 @@ const classnames_1 = __importDefault(require("classnames"));
10
21
  const react_1 = require("motion/react");
11
22
  const preview_1 = require("./preview");
12
23
  // components
13
- function BlockPreview({ className, scope, layout }) {
24
+ function BlockPreview({ className, variant, size = 'md', layout, selectedPanel, onSelectPanel }) {
25
+ var _a, _b;
14
26
  // bind props
15
- const tight = scope === 'mobile'
16
- ? layout.tight.mobile
17
- : layout.tight.desktop;
27
+ const tight = variant === 'mobile'
28
+ ? (_a = layout === null || layout === void 0 ? void 0 : layout.tight.mobile) !== null && _a !== void 0 ? _a : 'none'
29
+ : (_b = layout === null || layout === void 0 ? void 0 : layout.tight.desktop) !== null && _b !== void 0 ? _b : 'none';
18
30
  // render
19
- return ((0, jsx_runtime_1.jsx)(react_1.motion.section, { className: (0, classnames_1.default)(className, 'bg-surface2 rounded-xs interpolate-all', {
20
- 'min-h-[100px]': !layout,
21
- 'w-[240px]': scope === 'desktop',
22
- 'w-[136px]': scope === 'mobile',
31
+ return ((0, jsx_runtime_1.jsx)(react_1.motion.section, { className: (0, classnames_1.default)(className, 'bg-surface2 rounded-sm interpolate-all', {
32
+ 'min-h-[120px]': !layout && size === 'sm',
33
+ 'min-h-[240px]': !layout && size === 'md',
34
+ 'min-h-[320px]': !layout && size === 'lg',
35
+ 'w-full': variant === 'base' || variant === 'tablet',
36
+ 'w-[200px]': variant === 'mobile',
23
37
  'pb-l4': tight === 'above',
24
38
  'pt-l4': tight === 'below',
25
39
  'py-l4': tight === 'none'
26
- }), layoutRoot: true, layout: true, children: renderLayout({ scope, layout }) }));
40
+ }), layoutRoot: true, layout: true, children: layout && renderLayout({ variant, layout, size, selectedPanel, onSelectPanel }) }));
27
41
  }
28
- function renderLayout({ scope, layout }) {
42
+ function renderLayout(_a) {
43
+ var { layout } = _a, args = __rest(_a, ["layout"]);
29
44
  // render layout based on root type
30
- const mobile = scope === 'mobile';
45
+ const mobile = args.variant === 'mobile';
31
46
  const { root } = layout;
32
47
  switch (root.type) {
33
48
  // row (force column if mobile)
34
49
  case 'row':
35
50
  return mobile
36
- ? (0, jsx_runtime_1.jsx)(preview_1.ColumnLayout, { layout: root, mobile: mobile })
37
- : (0, jsx_runtime_1.jsx)(preview_1.RowLayout, { layout: root, mobile: mobile });
51
+ ? (0, jsx_runtime_1.jsx)(preview_1.ColumnLayout, Object.assign({ layout: root }, args))
52
+ : (0, jsx_runtime_1.jsx)(preview_1.RowLayout, Object.assign({ layout: root }, args));
38
53
  // column
39
54
  case 'column':
40
- return (0, jsx_runtime_1.jsx)(preview_1.ColumnLayout, { layout: root, mobile: mobile });
55
+ return (0, jsx_runtime_1.jsx)(preview_1.ColumnLayout, Object.assign({ layout: root }, args));
41
56
  // stack
42
57
  case 'stack':
43
- return (0, jsx_runtime_1.jsx)(preview_1.StackLayout, { layout: root, mobile: mobile });
58
+ return (0, jsx_runtime_1.jsx)(preview_1.StackLayout, Object.assign({ layout: root }, args));
44
59
  default:
45
60
  throw new funnel_core_1.NotImplementedError(`Unsupported layout: ${layout.root.type}`);
46
61
  }
@@ -1,4 +1,3 @@
1
+ export * from './preview';
1
2
  export * from './BlockConfigButton';
2
- export * from './BlockConfigurationProvider';
3
3
  export * from './BlockPreview';
4
- export * from './useBlockConfiguration$';
@@ -14,7 +14,6 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
14
  for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
15
  };
16
16
  Object.defineProperty(exports, "__esModule", { value: true });
17
+ __exportStar(require("./preview"), exports);
17
18
  __exportStar(require("./BlockConfigButton"), exports);
18
- __exportStar(require("./BlockConfigurationProvider"), exports);
19
19
  __exportStar(require("./BlockPreview"), exports);
20
- __exportStar(require("./useBlockConfiguration$"), exports);
@@ -1,10 +1,13 @@
1
- import { BlockLayout } from '@nascentdigital/funnel-core';
2
- export declare function ColumnLayout({ className, layout, mobile, nested }: ColumnLayout.Props): import("react/jsx-runtime").JSX.Element;
1
+ import { BlockLayout, Schema } from '@nascentdigital/funnel-core';
2
+ import { Panel } from './Panel';
3
+ import { PreviewSize } from './PreviewSize';
4
+ export declare function ColumnLayout({ className, layout, nested, ...args }: ColumnLayout.Props): import("react/jsx-runtime").JSX.Element;
3
5
  export declare namespace ColumnLayout {
4
- type Props = {
6
+ type Props = Panel.SelectionProps & {
5
7
  className?: string;
6
8
  layout: BlockLayout.Container;
7
- mobile: boolean;
9
+ variant: Schema.Block.Config.Variant;
8
10
  nested?: boolean;
11
+ size: PreviewSize;
9
12
  };
10
13
  }
@@ -1,4 +1,15 @@
1
1
  "use strict";
2
+ var __rest = (this && this.__rest) || function (s, e) {
3
+ var t = {};
4
+ for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
5
+ t[p] = s[p];
6
+ if (s != null && typeof Object.getOwnPropertySymbols === "function")
7
+ for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
8
+ if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
9
+ t[p[i]] = s[p[i]];
10
+ }
11
+ return t;
12
+ };
2
13
  var __importDefault = (this && this.__importDefault) || function (mod) {
3
14
  return (mod && mod.__esModule) ? mod : { "default": mod };
4
15
  };
@@ -8,8 +19,9 @@ const jsx_runtime_1 = require("react/jsx-runtime");
8
19
  const classnames_1 = __importDefault(require("classnames"));
9
20
  const ItemLayout_1 = require("./ItemLayout");
10
21
  // components
11
- function ColumnLayout({ className, layout, mobile, nested = false }) {
22
+ function ColumnLayout(_a) {
23
+ var { className, layout, nested = false } = _a, args = __rest(_a, ["className", "layout", "nested"]);
12
24
  // render
13
25
  const { items } = layout;
14
- return ((0, jsx_runtime_1.jsx)(ItemLayout_1.ItemLayout, { className: (0, classnames_1.default)(className, 'flex flex-col gap-l4'), parentType: "column", items: items, mobile: mobile, nested: nested }));
26
+ return ((0, jsx_runtime_1.jsx)(ItemLayout_1.ItemLayout, Object.assign({ className: (0, classnames_1.default)(className, 'flex flex-col gap-l4'), parentType: "column", items: items, nested: nested }, args)));
15
27
  }
@@ -1,12 +1,15 @@
1
- import { BlockLayout, Transform } from '@nascentdigital/funnel-core';
2
- export declare function ItemLayout({ className, itemClassName, parentType, items, mobile, nested }: ItemLayout.Props): import("react/jsx-runtime").JSX.Element;
1
+ import { BlockLayout, Schema, Transform } from '@nascentdigital/funnel-core';
2
+ import { Panel } from './Panel';
3
+ import { PreviewSize } from './PreviewSize';
4
+ export declare function ItemLayout({ className, itemClassName, parentType, items, nested, ...args }: ItemLayout.Props): import("react/jsx-runtime").JSX.Element;
3
5
  export declare namespace ItemLayout {
4
- type Props = {
6
+ type Props = Panel.SelectionProps & {
5
7
  className?: string;
6
8
  itemClassName?: Transform<BlockLayout.NestedItem, string>;
7
9
  parentType: BlockLayout.Container['type'];
8
10
  items: ReadonlyArray<BlockLayout.NestedItem>;
9
- mobile: boolean;
11
+ variant: Schema.Block.Config.Variant;
10
12
  nested: boolean;
13
+ size: PreviewSize;
11
14
  };
12
15
  }
@@ -1,4 +1,15 @@
1
1
  "use strict";
2
+ var __rest = (this && this.__rest) || function (s, e) {
3
+ var t = {};
4
+ for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
5
+ t[p] = s[p];
6
+ if (s != null && typeof Object.getOwnPropertySymbols === "function")
7
+ for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
8
+ if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
9
+ t[p[i]] = s[p[i]];
10
+ }
11
+ return t;
12
+ };
2
13
  var __importDefault = (this && this.__importDefault) || function (mod) {
3
14
  return (mod && mod.__esModule) ? mod : { "default": mod };
4
15
  };
@@ -15,11 +26,13 @@ const RowLayout_1 = require("./RowLayout");
15
26
  const StackLayout_1 = require("./StackLayout");
16
27
  const VisualPanel_1 = require("./VisualPanel");
17
28
  // components
18
- function ItemLayout({ className, itemClassName = () => '', parentType, items, mobile, nested }) {
29
+ function ItemLayout(_a) {
30
+ var { className, itemClassName = () => '', parentType, items, nested } = _a, args = __rest(_a, ["className", "itemClassName", "parentType", "items", "nested"]);
19
31
  // render
20
- return ((0, jsx_runtime_1.jsx)(react_1.motion.div, { className: (0, classnames_1.default)(className), layout: true, children: items.map((item, itemOffset) => renderItem({ className: itemClassName(item), parentType, item, itemOffset, mobile, nested })) }));
32
+ return ((0, jsx_runtime_1.jsx)(react_1.motion.div, { className: (0, classnames_1.default)(className), layout: true, children: items.map((item, itemOffset) => renderItem(Object.assign({ className: itemClassName(item), parentType, item, itemOffset, nested }, args))) }));
21
33
  }
22
- function renderItem({ className, parentType, item, itemOffset, mobile, nested }) {
34
+ function renderItem(_a) {
35
+ var { className, parentType, item, itemOffset, nested } = _a, args = __rest(_a, ["className", "parentType", "item", "itemOffset", "nested"]);
23
36
  // render based on type
24
37
  const key = funnel_core_1.BlockLayout.Container.filter(item)
25
38
  ? `${item.type}.${itemOffset}`
@@ -27,19 +40,19 @@ function renderItem({ className, parentType, item, itemOffset, mobile, nested })
27
40
  switch (item.type) {
28
41
  // containers (nested)
29
42
  case 'row':
30
- return mobile
31
- ? (0, jsx_runtime_1.jsx)(ColumnLayout_1.ColumnLayout, { layout: item, mobile: mobile, nested: true }, key)
32
- : (0, jsx_runtime_1.jsx)(RowLayout_1.RowLayout, { layout: item, mobile: mobile, nested: true }, key);
43
+ return args.variant === 'mobile'
44
+ ? (0, jsx_runtime_1.jsx)(ColumnLayout_1.ColumnLayout, Object.assign({ layout: item, nested: true }, args), key)
45
+ : (0, jsx_runtime_1.jsx)(RowLayout_1.RowLayout, Object.assign({ layout: item, nested: true }, args), key);
33
46
  case 'column':
34
- return (0, jsx_runtime_1.jsx)(ColumnLayout_1.ColumnLayout, { layout: item, mobile: mobile, nested: true }, key);
47
+ return (0, jsx_runtime_1.jsx)(ColumnLayout_1.ColumnLayout, Object.assign({ layout: item, nested: true }, args), key);
35
48
  case 'stack':
36
- return (0, jsx_runtime_1.jsx)(StackLayout_1.StackLayout, { layout: item, mobile: mobile, nested: true }, key);
49
+ return (0, jsx_runtime_1.jsx)(StackLayout_1.StackLayout, Object.assign({ layout: item, nested: true }, args), key);
37
50
  // panels
38
51
  case 'message':
39
- return ((0, jsx_runtime_1.jsx)(MessagePanel_1.MessagePanel, { className: className, parentType: parentType, itemOffset: itemOffset, panel: item, mobile: mobile, nested: nested }, key));
52
+ return ((0, jsx_runtime_1.jsx)(MessagePanel_1.MessagePanel, Object.assign({ className: className, parentType: parentType, itemOffset: itemOffset, panel: item, nested: nested }, args), key));
40
53
  case 'list':
41
- return ((0, jsx_runtime_1.jsx)(ListPanel_1.ListPanel, { className: className, parentType: parentType, itemOffset: itemOffset, panel: item, mobile: mobile, nested: nested }, key));
54
+ return ((0, jsx_runtime_1.jsx)(ListPanel_1.ListPanel, Object.assign({ className: className, parentType: parentType, itemOffset: itemOffset, panel: item, nested: nested }, args), key));
42
55
  case 'visual':
43
- return ((0, jsx_runtime_1.jsx)(VisualPanel_1.VisualPanel, { className: className, parentType: parentType, itemOffset: itemOffset, panel: item, mobile: mobile, nested: nested }, key));
56
+ return ((0, jsx_runtime_1.jsx)(VisualPanel_1.VisualPanel, Object.assign({ className: className, parentType: parentType, itemOffset: itemOffset, panel: item, nested: nested }, args), key));
44
57
  }
45
58
  }
@@ -1,12 +1,15 @@
1
- import { BlockLayout } from '@nascentdigital/funnel-core';
2
- export declare function ListPanel({ className, parentType, itemOffset, panel, mobile, nested }: ListPanel.Props): import("react/jsx-runtime").JSX.Element;
1
+ import { BlockLayout, Schema } from '@nascentdigital/funnel-core';
2
+ import { Panel } from './Panel';
3
+ import { PreviewSize } from './PreviewSize';
4
+ export declare function ListPanel({ className, parentType, itemOffset, panel, variant, nested, size, selectedPanel, onSelectPanel }: ListPanel.Props): import("react/jsx-runtime").JSX.Element;
3
5
  export declare namespace ListPanel {
4
- type Props = {
6
+ type Props = Panel.SelectionProps & {
5
7
  className?: string;
6
8
  parentType: BlockLayout.Container['type'];
7
9
  itemOffset: number;
8
10
  panel: BlockLayout.List;
9
- mobile: boolean;
11
+ variant: Schema.Block.Config.Variant;
10
12
  nested: boolean;
13
+ size: PreviewSize;
11
14
  };
12
15
  }
@@ -8,7 +8,9 @@ const jsx_runtime_1 = require("react/jsx-runtime");
8
8
  const classnames_1 = __importDefault(require("classnames"));
9
9
  const Panel_1 = require("./Panel");
10
10
  // components
11
- function ListPanel({ className, parentType, itemOffset, panel, mobile, nested }) {
11
+ function ListPanel({ className, parentType, itemOffset, panel, variant, nested, size, selectedPanel, onSelectPanel }) {
12
12
  // render
13
- return ((0, jsx_runtime_1.jsx)(Panel_1.Panel, { className: className, contentClassName: (0, classnames_1.default)('flex flex-col p-6 bg-background rounded-xs', {}), parentType: parentType, itemOffset: itemOffset, panel: panel, mobile: mobile, nested: nested, disableSizing: mobile, children: (0, jsx_runtime_1.jsx)("div", { children: "List Panel" }) }));
13
+ return ((0, jsx_runtime_1.jsx)(Panel_1.Panel, { className: className, contentClassName: (0, classnames_1.default)('flex flex-col p-6 bg-surface1 rounded-xs', {}), label: "List", parentType: parentType, itemOffset: itemOffset, panel: panel, variant: variant, nested: nested, disableSizing: variant === 'mobile', size: size, selected: selectedPanel === 'list', onClick: onSelectPanel
14
+ ? () => onSelectPanel('list')
15
+ : undefined, children: (0, jsx_runtime_1.jsx)("div", { children: "List Panel" }) }));
14
16
  }
@@ -1,12 +1,15 @@
1
- import { BlockLayout } from '@nascentdigital/funnel-core';
2
- export declare function MessagePanel({ className, parentType, itemOffset, panel, mobile, nested }: MessagePanel.Props): import("react/jsx-runtime").JSX.Element;
1
+ import { BlockLayout, Schema } from '@nascentdigital/funnel-core';
2
+ import { Panel } from './Panel';
3
+ import { PreviewSize } from './PreviewSize';
4
+ export declare function MessagePanel({ className, parentType, itemOffset, panel, variant, nested, size, selectedPanel, onSelectPanel }: MessagePanel.Props): import("react/jsx-runtime").JSX.Element;
3
5
  export declare namespace MessagePanel {
4
- type Props = {
6
+ type Props = Panel.SelectionProps & {
5
7
  className?: string;
6
8
  parentType: BlockLayout.Container['type'];
7
9
  itemOffset: number;
8
10
  panel: BlockLayout.Message;
9
- mobile: boolean;
11
+ variant: Schema.Block.Config.Variant;
10
12
  nested: boolean;
13
+ size: PreviewSize;
11
14
  };
12
15
  }
@@ -9,13 +9,16 @@ const classnames_1 = __importDefault(require("classnames"));
9
9
  const react_1 = require("motion/react");
10
10
  const Panel_1 = require("./Panel");
11
11
  // components
12
- function MessagePanel({ className, parentType, itemOffset, panel, mobile, nested }) {
12
+ function MessagePanel({ className, parentType, itemOffset, panel, variant, nested, size, selectedPanel, onSelectPanel }) {
13
13
  // render
14
14
  const { textAlign: { mobile: textAlignMobile, desktop: textAlignDesktop } } = panel;
15
+ const mobile = variant === 'mobile';
15
16
  const textAlign = mobile ? textAlignMobile : textAlignDesktop;
16
- return ((0, jsx_runtime_1.jsxs)(Panel_1.Panel, { className: className, contentClassName: (0, classnames_1.default)('flex flex-col p-6 bg-background rounded-xs', {
17
+ return ((0, jsx_runtime_1.jsxs)(Panel_1.Panel, { className: className, contentClassName: (0, classnames_1.default)('flex flex-col gap-l3 p-10 bg-surface1 rounded-xs', {
17
18
  'items-start': textAlign === 'left',
18
19
  'items-center': textAlign === 'center',
19
20
  'items-end': textAlign === 'right'
20
- }), parentType: parentType, itemOffset: itemOffset, panel: panel, mobile: mobile, nested: nested, disableSizing: mobile, children: [(0, jsx_runtime_1.jsx)(react_1.motion.div, { className: "w-full h-8 mb-4 bg-ix-primary rounded-xxs overflow-hidden", layout: true }), (0, jsx_runtime_1.jsx)(react_1.motion.div, { className: "w-full h-4 mb-3 bg-draft/tint3 rounded-px overflow-hidden", layout: true }), (0, jsx_runtime_1.jsx)(react_1.motion.div, { className: "w-full h-4 mb-3 bg-draft/tint3 rounded-px overflow-hidden", layout: true }), (0, jsx_runtime_1.jsx)(react_1.motion.div, { className: "w-1/2 h-4 bg-draft/tint3 rounded-px overflow-hidden", layout: true })] }));
21
+ }), label: "Message", parentType: parentType, itemOffset: itemOffset, panel: panel, variant: variant, nested: nested, disableSizing: mobile, size: size, selected: selectedPanel === 'message', onClick: onSelectPanel
22
+ ? () => onSelectPanel('message')
23
+ : undefined, children: [(0, jsx_runtime_1.jsx)(react_1.motion.div, { className: "w-full h-12 bg-[#036FE3] rounded-xs overflow-hidden", layout: true }), (0, jsx_runtime_1.jsx)(react_1.motion.div, { className: "w-full h-6 bg-surface-placeholder-raised rounded-xs overflow-hidden", layout: true }), (0, jsx_runtime_1.jsx)(react_1.motion.div, { className: "w-full h-6 bg-surface-placeholder-raised rounded-xs overflow-hidden", layout: true }), (0, jsx_runtime_1.jsx)(react_1.motion.div, { className: "w-1/2 h-6 bg-surface-placeholder-raised rounded-xs overflow-hidden", layout: true })] }));
21
24
  }
@@ -1,15 +1,25 @@
1
- import { BlockLayout } from '@nascentdigital/funnel-core';
2
- import { PropsWithChildren } from 'react';
3
- export declare function Panel({ className, contentClassName, parentType, itemOffset, panel, mobile, nested, disableSizing, children }: Panel.Props): import("react/jsx-runtime").JSX.Element;
1
+ import { BlockLayout, Callback, Schema } from '@nascentdigital/funnel-core';
2
+ import { PropsWithChildren, MouseEvent } from 'react';
3
+ import { PreviewSize } from './PreviewSize';
4
+ export declare function Panel({ className, contentClassName, label, parentType, itemOffset, panel, variant, nested, disableSizing, size, selected, onClick, children }: Panel.Props): import("react/jsx-runtime").JSX.Element;
4
5
  export declare namespace Panel {
6
+ type Type = BlockLayout.Panel['type'];
7
+ type SelectionProps = {
8
+ selectedPanel?: Type | undefined;
9
+ onSelectPanel?: Callback<Type | undefined>;
10
+ };
5
11
  type Props = PropsWithChildren & {
6
12
  className?: string;
7
13
  contentClassName?: string;
14
+ label: string;
8
15
  parentType: BlockLayout.Container['type'];
9
16
  itemOffset: number;
10
17
  panel: BlockLayout.Panel;
11
- mobile: boolean;
18
+ variant: Schema.Block.Config.Variant;
12
19
  nested: boolean;
13
20
  disableSizing: boolean;
21
+ size: PreviewSize;
22
+ selected?: boolean;
23
+ onClick?: Callback<MouseEvent<HTMLElement>>;
14
24
  };
15
25
  }
@@ -8,11 +8,21 @@ const jsx_runtime_1 = require("react/jsx-runtime");
8
8
  const classnames_1 = __importDefault(require("classnames"));
9
9
  const react_1 = require("motion/react");
10
10
  // components
11
- function Panel({ className, contentClassName, parentType, itemOffset, panel, mobile, nested, disableSizing, children }) {
11
+ function Panel({ className, contentClassName, label, parentType, itemOffset, panel, variant, nested, disableSizing, size, selected = false, onClick, children }) {
12
+ // helpers
13
+ const onPanelClick = (e) => {
14
+ // consume click
15
+ e.stopPropagation();
16
+ // click
17
+ if (onClick) {
18
+ onClick(e);
19
+ }
20
+ };
12
21
  // render
13
22
  const { key, mobileOrder, alignY, fullBleed: { mobile: fullBleedMobile, desktop: fullBleedDesktop } } = panel;
23
+ const mobile = variant === 'mobile';
14
24
  const fullBleed = mobile ? fullBleedMobile : fullBleedDesktop;
15
- return ((0, jsx_runtime_1.jsx)(react_1.motion.div, { className: (0, classnames_1.default)(className, {
25
+ return ((0, jsx_runtime_1.jsx)(react_1.motion.div, { className: (0, classnames_1.default)(className, 'group rounded-sm overflow-hidden interpolate-colors', {
16
26
  // mobile
17
27
  'flex flex-col': mobile,
18
28
  'justify-start': mobile && alignY === 'start',
@@ -28,12 +38,20 @@ function Panel({ className, contentClassName, parentType, itemOffset, panel, mob
28
38
  // '-ml-l4': itemPosition.left && fullBleed.desktop,
29
39
  // '-mr-l4': itemPosition.right && fullBleed.desktop
30
40
  // spacing (row)
31
- 'pl-l4': parentType === 'row' && itemOffset === 0 && !fullBleed,
32
- 'pr-l4': parentType === 'row' && itemOffset === 1 && !fullBleed,
41
+ 'ml-l4': parentType === 'row' && itemOffset === 0 && !fullBleed,
42
+ 'mr-l4': parentType === 'row' && itemOffset === 1 && !fullBleed,
33
43
  // spacing (column/stack)
34
- 'px-l4': (parentType === 'column' || (parentType === 'stack' && panel.type === 'visual')) && !fullBleed,
35
- 'px-l6 py-l4': parentType === 'stack' && panel.type !== 'visual' && !fullBleed
36
- }), layoutId: key, layout: true, children: (0, jsx_runtime_1.jsx)(react_1.motion.div, { className: getContentClasses({ className: (0, classnames_1.default)(contentClassName, 'relative'), panel, disableSizing }), layout: true, children: children }) }, key));
44
+ 'mx-l4': (parentType === 'column' || (parentType === 'stack' && panel.type === 'visual')) && !fullBleed,
45
+ 'mx-l6 my-l4': parentType === 'stack' && panel.type !== 'visual' && !fullBleed,
46
+ // selection
47
+ 'cursor-pointer border border-solid outline outline-[3px]': !!onClick,
48
+ 'border-transparent hover:border-ix-primary outline-transparent active:outline-[#98CBFF]': !!onClick && !selected,
49
+ 'border-ix-primary outline-[#98CBFF]': !!onClick && selected
50
+ }), layoutId: key, layout: true, onClick: onPanelClick, tabIndex: onClick ? 0 : -1, children: (0, jsx_runtime_1.jsxs)(react_1.motion.div, { className: getContentClasses({ className: (0, classnames_1.default)(contentClassName, 'relative'), panel, disableSizing }), layout: true, children: [children, onClick &&
51
+ (0, jsx_runtime_1.jsx)("div", { className: (0, classnames_1.default)('absolute inset-0 p-l2 bg-[#E8F5FF]/[.72] z-overlay pointer-events-none interpolate-colors', {
52
+ 'opacity-none group-hover:opacity-full': !selected,
53
+ 'opacity-full': selected
54
+ }), children: (0, jsx_runtime_1.jsx)("span", { className: "h-16 inline-flex items-center px-l2 label-xs text-content-button bg-ix-primary rounded-xs", children: label }) })] }) }, key));
37
55
  }
38
56
  function getContentClasses({ className, panel: { alignX, size }, disableSizing }) {
39
57
  // force full width for mobile
@@ -0,0 +1 @@
1
+ export type PreviewSize = 'lg' | 'md' | 'sm';
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -1,10 +1,13 @@
1
- import { BlockLayout } from '@nascentdigital/funnel-core';
2
- export declare function RowLayout({ className, layout, mobile, nested }: RowLayout.Props): import("react/jsx-runtime").JSX.Element;
1
+ import { BlockLayout, Schema } from '@nascentdigital/funnel-core';
2
+ import { Panel } from './Panel';
3
+ import { PreviewSize } from './PreviewSize';
4
+ export declare function RowLayout({ className, layout, variant, nested, ...args }: RowLayout.Props): import("react/jsx-runtime").JSX.Element;
3
5
  export declare namespace RowLayout {
4
- type Props = {
6
+ type Props = Panel.SelectionProps & {
5
7
  className?: string;
6
8
  layout: BlockLayout.Row | BlockLayout.Row.Nested;
7
- mobile: boolean;
9
+ variant: Schema.Block.Config.Variant;
8
10
  nested?: boolean;
11
+ size: PreviewSize;
9
12
  };
10
13
  }
@@ -1,4 +1,15 @@
1
1
  "use strict";
2
+ var __rest = (this && this.__rest) || function (s, e) {
3
+ var t = {};
4
+ for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
5
+ t[p] = s[p];
6
+ if (s != null && typeof Object.getOwnPropertySymbols === "function")
7
+ for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
8
+ if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
9
+ t[p[i]] = s[p[i]];
10
+ }
11
+ return t;
12
+ };
2
13
  var __importDefault = (this && this.__importDefault) || function (mod) {
3
14
  return (mod && mod.__esModule) ? mod : { "default": mod };
4
15
  };
@@ -8,10 +19,11 @@ const jsx_runtime_1 = require("react/jsx-runtime");
8
19
  const classnames_1 = __importDefault(require("classnames"));
9
20
  const ItemLayout_1 = require("./ItemLayout");
10
21
  // components
11
- function RowLayout({ className, layout, mobile, nested = false }) {
22
+ function RowLayout(_a) {
23
+ var { className, layout, variant, nested = false } = _a, args = __rest(_a, ["className", "layout", "variant", "nested"]);
12
24
  // render
13
25
  const { alignY, ratio, items } = layout;
14
- return ((0, jsx_runtime_1.jsx)(ItemLayout_1.ItemLayout, { className: (0, classnames_1.default)(className, 'grid gap-l5', {
26
+ return ((0, jsx_runtime_1.jsx)(ItemLayout_1.ItemLayout, Object.assign({ className: (0, classnames_1.default)(className, 'grid gap-l5', {
15
27
  'items-start': alignY === 'start',
16
28
  'items-center': alignY === 'center',
17
29
  'items-end': alignY === 'end',
@@ -22,5 +34,5 @@ function RowLayout({ className, layout, mobile, nested = false }) {
22
34
  'grid-cols-[2fr,3fr]': ratio.desktop === '2/3',
23
35
  'grid-cols-[3fr,1fr]': ratio.desktop === '3/1',
24
36
  'grid-cols-[3fr,2fr]': ratio.desktop === '3/2'
25
- }), itemClassName: () => 'flex-1', parentType: "row", items: items, mobile: mobile, nested: nested }));
37
+ }), itemClassName: () => 'flex-1', parentType: "row", items: items, variant: variant, nested: nested }, args)));
26
38
  }
@@ -1,10 +1,13 @@
1
- import { BlockLayout } from '@nascentdigital/funnel-core';
2
- export declare function StackLayout({ className, layout, mobile, nested }: StackLayout.Props): import("react/jsx-runtime").JSX.Element;
1
+ import { BlockLayout, Schema } from '@nascentdigital/funnel-core';
2
+ import { Panel } from './Panel';
3
+ import { PreviewSize } from './PreviewSize';
4
+ export declare function StackLayout({ className, layout, variant, nested, ...args }: StackLayout.Props): import("react/jsx-runtime").JSX.Element;
3
5
  export declare namespace StackLayout {
4
- type Props = {
6
+ type Props = Panel.SelectionProps & {
5
7
  className?: string;
6
8
  layout: BlockLayout.Container;
7
- mobile: boolean;
9
+ variant: Schema.Block.Config.Variant;
8
10
  nested?: boolean;
11
+ size: PreviewSize;
9
12
  };
10
13
  }
@@ -1,4 +1,15 @@
1
1
  "use strict";
2
+ var __rest = (this && this.__rest) || function (s, e) {
3
+ var t = {};
4
+ for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
5
+ t[p] = s[p];
6
+ if (s != null && typeof Object.getOwnPropertySymbols === "function")
7
+ for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
8
+ if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
9
+ t[p[i]] = s[p[i]];
10
+ }
11
+ return t;
12
+ };
2
13
  var __importDefault = (this && this.__importDefault) || function (mod) {
3
14
  return (mod && mod.__esModule) ? mod : { "default": mod };
4
15
  };
@@ -8,8 +19,9 @@ const jsx_runtime_1 = require("react/jsx-runtime");
8
19
  const classnames_1 = __importDefault(require("classnames"));
9
20
  const ItemLayout_1 = require("./ItemLayout");
10
21
  // components
11
- function StackLayout({ className, layout, mobile, nested = false }) {
22
+ function StackLayout(_a) {
23
+ var { className, layout, variant, nested = false } = _a, args = __rest(_a, ["className", "layout", "variant", "nested"]);
12
24
  // render
13
25
  const { items } = layout;
14
- return ((0, jsx_runtime_1.jsx)(ItemLayout_1.ItemLayout, { className: (0, classnames_1.default)(className, 'stacked-stretch'), parentType: "stack", items: items, mobile: mobile, nested: nested }));
26
+ return ((0, jsx_runtime_1.jsx)(ItemLayout_1.ItemLayout, Object.assign({ className: (0, classnames_1.default)(className, 'stacked-stretch'), parentType: "stack", items: items, variant: variant, nested: nested }, args)));
15
27
  }