@nascentdigital/funnel-editor 8.0.2 → 8.0.4

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.
@@ -1,13 +1,22 @@
1
1
  import { Field, Schema } from '@nascentdigital/funnel-core';
2
+ import { SegmentedButton } from '../interaction';
2
3
  import { FieldLayout } from './FieldLayout';
3
4
  import { FieldSize } from './FieldSize';
4
- export declare function BooleanField({ className, field, variant, size, disableDelete }: BooleanField.Props): import("react/jsx-runtime").JSX.Element;
5
+ export declare function BooleanField({ className, field, variant, semantics: semanticsOverride, size, disableDelete }: BooleanField.Props): import("react/jsx-runtime").JSX.Element;
5
6
  export declare namespace BooleanField {
6
7
  type Props = {
7
8
  className?: string;
8
9
  field: Field<Schema.BooleanField>;
9
10
  variant?: FieldLayout.Variant;
11
+ semantics?: Schema.BooleanField.Semantics;
10
12
  size?: FieldSize;
11
13
  disableDelete?: boolean;
12
14
  };
13
15
  }
16
+ type BooleanOption = 'false' | 'true';
17
+ export declare namespace BooleanOptions {
18
+ const spec: Schema.EnumField.Options<BooleanOption>;
19
+ type Spec = typeof spec;
20
+ const options: ReadonlyArray<SegmentedButton.Option<BooleanOption>>;
21
+ }
22
+ export {};
@@ -1,5 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.BooleanOptions = void 0;
3
4
  exports.BooleanField = BooleanField;
4
5
  const jsx_runtime_1 = require("react/jsx-runtime");
5
6
  const funnel_core_1 = require("@nascentdigital/funnel-core");
@@ -7,7 +8,7 @@ const hooks_1 = require("../../hooks");
7
8
  const interaction_1 = require("../interaction");
8
9
  const FieldLayout_1 = require("./FieldLayout");
9
10
  // component
10
- function BooleanField({ className, field, variant = 'minimal', size = 'md', disableDelete }) {
11
+ function BooleanField({ className, field, variant = 'minimal', semantics: semanticsOverride, size = 'md', disableDelete }) {
11
12
  // bind toolbar
12
13
  const { id, name, value: data, schema } = field;
13
14
  const value = funnel_core_1.Schema.BooleanField.Value.fromData(data);
@@ -16,14 +17,34 @@ function BooleanField({ className, field, variant = 'minimal', size = 'md', disa
16
17
  (0, hooks_1.useField)(field);
17
18
  // render toggle
18
19
  let component;
19
- switch (semantics) {
20
+ switch (semanticsOverride !== null && semanticsOverride !== void 0 ? semanticsOverride : semantics) {
20
21
  case 'check':
21
22
  component = ((0, jsx_runtime_1.jsxs)("div", { className: "flex items-center gap-l4", children: [(0, jsx_runtime_1.jsx)(interaction_1.Checkbox, { id: id, checked: value !== null && value !== void 0 ? value : defaultValue, onChange: value => field.value = funnel_core_1.Schema.BooleanField.Value.toData(value) }), (0, jsx_runtime_1.jsx)("label", { className: "cursor-pointer select-none", htmlFor: id, children: name })] }));
22
23
  break;
23
24
  case 'toggle':
24
25
  component = ((0, jsx_runtime_1.jsxs)("div", { className: "flex items-center gap-l4", children: [(0, jsx_runtime_1.jsx)(interaction_1.Toggle, { id: id, checked: value !== null && value !== void 0 ? value : defaultValue, onChange: value => field.value = funnel_core_1.Schema.BooleanField.Value.toData(value) }), (0, jsx_runtime_1.jsx)("label", { className: "cursor-pointer select-none", htmlFor: id, children: name })] }));
25
26
  break;
27
+ case 'segment':
28
+ component = ((0, jsx_runtime_1.jsx)(interaction_1.SegmentedButton, { size: size, options: BooleanOptions.options, selected: value ? 'true' : 'false', onSelectionChange: ([value]) => field.value = funnel_core_1.Schema.BooleanField.Value.toData(value === 'true') }));
29
+ break;
26
30
  }
27
31
  // render
28
32
  return ((0, jsx_runtime_1.jsx)(FieldLayout_1.FieldLayout, { className: className, field: field, variant: variant, size: size, disableDelete: disableDelete, children: component }));
29
33
  }
34
+ var BooleanOptions;
35
+ (function (BooleanOptions) {
36
+ // spec
37
+ BooleanOptions.spec = {
38
+ false: {
39
+ name: 'No'
40
+ },
41
+ true: {
42
+ name: 'Yes'
43
+ }
44
+ };
45
+ // optinos
46
+ BooleanOptions.options = [
47
+ { id: 'false', value: 'false', label: 'No' },
48
+ { id: 'true', value: 'true', label: 'Yes' }
49
+ ];
50
+ })(BooleanOptions || (exports.BooleanOptions = BooleanOptions = {}));
@@ -1,4 +1,5 @@
1
1
  export * from './asset/AssetPreview';
2
+ export * from './BooleanField';
2
3
  export * from './DateField';
3
4
  export * from './FieldEditor';
4
5
  export * from './FieldErrorController';
@@ -15,6 +15,7 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
15
15
  };
16
16
  Object.defineProperty(exports, "__esModule", { value: true });
17
17
  __exportStar(require("./asset/AssetPreview"), exports);
18
+ __exportStar(require("./BooleanField"), exports);
18
19
  __exportStar(require("./DateField"), exports);
19
20
  __exportStar(require("./FieldEditor"), exports);
20
21
  __exportStar(require("./FieldErrorController"), exports);
@@ -19,7 +19,7 @@ export declare namespace Button {
19
19
  loading?: boolean;
20
20
  disabled?: boolean;
21
21
  };
22
- type Variant = 'primary' | 'secondary' | 'destructive' | 'text';
22
+ type Variant = 'primary' | 'secondary' | 'destructive' | 'text' | 'combobox';
23
23
  type Size = 'md' | 'sm' | 'xs';
24
24
  }
25
25
  export type GetButtonClassnameArgs = {
@@ -28,19 +28,33 @@ exports.Button = (0, react_1.forwardRef)(function Button(_a, ref) {
28
28
  // render
29
29
  return ((0, jsx_runtime_1.jsxs)("button", Object.assign({ ref: ref, className: (0, classnames_1.default)(className, anchorId ? Popup_1.Popup.anchorClassName : undefined, getButtonClassnames({ variant, size, loading, disabled })), style: anchorId ? Popup_1.Popup.getAnchorStyle(anchorId, style) : style, type: "button", disabled: disabled || loading }, props, { children: [loading &&
30
30
  (0, jsx_runtime_1.jsx)(Loader_1.Loader, { size: "sm" }), iconLeft && !loading &&
31
- (0, jsx_runtime_1.jsx)(visuals_1.Icon, { variant: iconLeft, size: size }), children, iconRight &&
32
- (0, jsx_runtime_1.jsx)(visuals_1.Icon, { variant: iconRight, size: size })] })));
31
+ (0, jsx_runtime_1.jsx)(visuals_1.Icon, { variant: iconLeft, size: size }), variant === 'combobox'
32
+ ? (0, jsx_runtime_1.jsx)("span", { className: "nd-Combobox-selection", children: children })
33
+ : children, iconRight &&
34
+ (0, jsx_runtime_1.jsx)(visuals_1.Icon, { variant: iconRight, size: size }), variant === 'combobox' && !iconRight &&
35
+ (0, jsx_runtime_1.jsx)(visuals_1.Icon, { className: "nd-Combobox-icon", variant: "ChevronDown", size: size })] })));
33
36
  });
34
37
  function getButtonClassnames({ variant, size, loading, disabled }) {
35
- return (0, classnames_1.default)('button', {
36
- 'button-primary': variant === 'primary',
37
- 'button-secondary': variant === 'secondary',
38
- 'button-destructive': variant === 'destructive',
39
- 'button-text': variant === 'text',
40
- 'button-disabled': disabled,
41
- 'button-loading': loading,
42
- 'button-md': size === 'md',
43
- 'button-sm': size === 'sm',
44
- 'button-xs': size === 'xs'
45
- });
38
+ // special handling for combobox variant
39
+ if (variant === 'combobox') {
40
+ return (0, classnames_1.default)('nd-Combobox', {
41
+ 'nd-Combobox-md': size === 'md',
42
+ 'nd-Combobox-sm': size === 'sm',
43
+ 'nd-Combobox-xs': size === 'xs'
44
+ });
45
+ }
46
+ // or standard rendering
47
+ else {
48
+ return (0, classnames_1.default)('button', {
49
+ 'button-primary': variant === 'primary',
50
+ 'button-secondary': variant === 'secondary',
51
+ 'button-destructive': variant === 'destructive',
52
+ 'button-text': variant === 'text',
53
+ 'button-disabled': disabled,
54
+ 'button-loading': loading,
55
+ 'button-md': size === 'md',
56
+ 'button-sm': size === 'sm',
57
+ 'button-xs': size === 'xs',
58
+ });
59
+ }
46
60
  }
@@ -0,0 +1,12 @@
1
+ import { Callback } from '@nascentdigital/funnel-core';
2
+ import { HTMLAttributes, MouseEvent } from 'react';
3
+ export declare function StepperButton({ className, disabled, size, onPrev, onNext, children, ...props }: StepperButton.Props): import("react/jsx-runtime").JSX.Element;
4
+ export declare namespace StepperButton {
5
+ type Props = HTMLAttributes<HTMLDivElement> & {
6
+ size?: Size;
7
+ disabled?: boolean | 'prev' | 'next';
8
+ onPrev?: Callback<MouseEvent<HTMLButtonElement>>;
9
+ onNext?: Callback<MouseEvent<HTMLButtonElement>>;
10
+ };
11
+ type Size = 'md' | 'sm' | 'xs';
12
+ }
@@ -0,0 +1,44 @@
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
+ };
13
+ var __importDefault = (this && this.__importDefault) || function (mod) {
14
+ return (mod && mod.__esModule) ? mod : { "default": mod };
15
+ };
16
+ Object.defineProperty(exports, "__esModule", { value: true });
17
+ exports.StepperButton = StepperButton;
18
+ const jsx_runtime_1 = require("react/jsx-runtime");
19
+ const funnel_core_1 = require("@nascentdigital/funnel-core");
20
+ const classnames_1 = __importDefault(require("classnames"));
21
+ const visuals_1 = require("../visuals");
22
+ // component
23
+ function StepperButton(_a) {
24
+ var { className, disabled = false, size = 'md', onPrev = funnel_core_1.Fn.NoOp, onNext = funnel_core_1.Fn.NoOp, children } = _a, props = __rest(_a, ["className", "disabled", "size", "onPrev", "onNext", "children"]);
25
+ // bind props
26
+ const disablePrev = disabled && disabled !== 'next';
27
+ const disableNext = disabled && disabled !== 'prev';
28
+ // helpers
29
+ const onPrevClick = (e) => {
30
+ // callback
31
+ onPrev(e);
32
+ };
33
+ const onNextClick = (e) => {
34
+ // callback
35
+ onNext(e);
36
+ };
37
+ // render
38
+ return ((0, jsx_runtime_1.jsxs)("div", Object.assign({ className: (0, classnames_1.default)(className, 'nd-StepperButton', {
39
+ 'nd-StepperButton-md': size === 'md',
40
+ 'nd-StepperButton-sm': size === 'sm',
41
+ 'nd-StepperButton-xs': size === 'xs',
42
+ 'nd-StepperButton-disabled': disabled === true
43
+ }) }, props, { children: [(0, jsx_runtime_1.jsx)("button", { className: "nd-StepperButton-btn nd-StepperButton-prev", onClick: onPrevClick, disabled: disablePrev, children: (0, jsx_runtime_1.jsx)(visuals_1.Icon, { variant: "ChevronLeft", size: size }) }), (0, jsx_runtime_1.jsx)("div", { className: "nd-StepperButton-content", children: children }), (0, jsx_runtime_1.jsx)("button", { className: "nd-StepperButton-btn nd-StepperButton-next", onClick: onNextClick, disabled: disableNext, children: (0, jsx_runtime_1.jsx)(visuals_1.Icon, { variant: "ChevronRight", size: size }) })] })));
44
+ }
@@ -29,6 +29,7 @@ export * from './RadioButtons';
29
29
  export * from './SegmentedButton';
30
30
  export * from './SideSheet';
31
31
  export * from './Sortable';
32
+ export * from './StepperButton';
32
33
  export * from './Tabs';
33
34
  export * from './Toggle';
34
35
  export * from './Touchable';
@@ -45,6 +45,7 @@ __exportStar(require("./RadioButtons"), exports);
45
45
  __exportStar(require("./SegmentedButton"), exports);
46
46
  __exportStar(require("./SideSheet"), exports);
47
47
  __exportStar(require("./Sortable"), exports);
48
+ __exportStar(require("./StepperButton"), exports);
48
49
  __exportStar(require("./Tabs"), exports);
49
50
  __exportStar(require("./Toggle"), exports);
50
51
  __exportStar(require("./Touchable"), exports);
@@ -6,7 +6,7 @@ export declare namespace Icon {
6
6
  size?: Size;
7
7
  };
8
8
  type Size = 'xl' | 'lg' | 'md' | 'sm' | 'xs' | 'xxs' | 'nav' | 'card' | Sizing;
9
- type Variant = 'Archive' | 'ArrowDownUp' | 'ArrowLeft' | 'ArrowRight' | 'ArrowLeftRight' | 'Atom' | 'Blocks' | 'Bold' | 'Check' | 'ChevronDown' | 'ChevronRight' | 'ChevronUp' | 'Circle' | 'CircleAlert' | 'CircleCheck' | 'CircleCheckBig' | 'CirclePlus' | 'CircleQuestionMark' | 'CloudCheck' | 'CloudUpload' | 'Copy' | 'CornerDownRight' | 'Cuboid' | 'EllipsisVertical' | 'Eye' | 'EyeOff' | 'File' | 'FileDown' | 'FilePlusCorner' | 'FileSearchCorner' | 'Goal' | 'Globe' | 'GripVertical' | 'HatGlasses' | 'History' | 'Highlighter' | 'Image' | 'ImageDown' | 'Info' | 'Italic' | 'Layers' | 'LayoutTemplate' | 'Link' | 'Link2' | 'List' | 'ListChecks' | 'ListIndentDecrease' | 'ListIndentIncrease' | 'ListOrdered' | 'Lock' | 'LockOpen' | 'Mail' | 'MessageSquareQuote' | 'MessageSquareText' | 'Minus' | 'Monitor' | 'MonitorCog' | 'Moon' | 'NotebookPen' | 'Pencil' | 'Pin' | 'Plus' | 'Redo' | 'RefreshCw' | 'RotateCcw' | 'RotateCw' | 'Search' | 'SearchCode' | 'Settings' | 'Settings2' | 'Smartphone' | 'SquarePlay' | 'Star' | 'Strikethrough' | 'Subscript' | 'Sun' | 'Superscript' | 'Tablet' | 'TextAlignStart' | 'Trash' | 'TriangleAlert' | 'Trophy' | 'Type' | 'Underline' | 'Undo' | 'Upload' | 'UserRound' | 'X';
9
+ type Variant = 'Archive' | 'ArrowDownUp' | 'ArrowLeft' | 'ArrowRight' | 'ArrowLeftRight' | 'Atom' | 'Blocks' | 'Bold' | 'Check' | 'ChevronDown' | 'ChevronLeft' | 'ChevronRight' | 'ChevronUp' | 'Circle' | 'CircleAlert' | 'CircleCheck' | 'CircleCheckBig' | 'CirclePlus' | 'CircleQuestionMark' | 'CloudCheck' | 'CloudUpload' | 'Copy' | 'CornerDownRight' | 'Cuboid' | 'EllipsisVertical' | 'Eye' | 'EyeOff' | 'File' | 'FileDown' | 'FilePlusCorner' | 'FileSearchCorner' | 'Goal' | 'Globe' | 'GripVertical' | 'HatGlasses' | 'History' | 'Highlighter' | 'Image' | 'ImageDown' | 'Info' | 'Italic' | 'Layers' | 'LayoutTemplate' | 'Link' | 'Link2' | 'List' | 'ListChecks' | 'ListIndentDecrease' | 'ListIndentIncrease' | 'ListOrdered' | 'Lock' | 'LockOpen' | 'Mail' | 'MessageSquareQuote' | 'MessageSquareText' | 'Minus' | 'Monitor' | 'MonitorCog' | 'Moon' | 'NotebookPen' | 'Pencil' | 'Pin' | 'Plus' | 'Redo' | 'RefreshCw' | 'RotateCcw' | 'RotateCw' | 'Search' | 'SearchCode' | 'Settings' | 'Settings2' | 'Smartphone' | 'SquarePlay' | 'Star' | 'Strikethrough' | 'Subscript' | 'Sun' | 'Superscript' | 'Tablet' | 'TextAlignStart' | 'Trash' | 'TriangleAlert' | 'Trophy' | 'Type' | 'Underline' | 'Undo' | 'Upload' | 'UserRound' | 'X';
10
10
  namespace Variant {
11
11
  function filter(value: any): value is Variant;
12
12
  }
@@ -28,6 +28,7 @@ function Icon({ className, variant, size: sizing = 'md' }) {
28
28
  'Bold',
29
29
  'Check',
30
30
  'ChevronDown',
31
+ 'ChevronLeft',
31
32
  'ChevronRight',
32
33
  'ChevronUp',
33
34
  'Circle',
@@ -139,6 +140,8 @@ function getIcon(variant) {
139
140
  return lucide_react_1.Check;
140
141
  case 'ChevronDown':
141
142
  return lucide_react_1.ChevronDown;
143
+ case 'ChevronLeft':
144
+ return lucide_react_1.ChevronLeft;
142
145
  case 'ChevronRight':
143
146
  return lucide_react_1.ChevronRight;
144
147
  case 'ChevronUp':
@@ -24,6 +24,7 @@ export declare class Block<TBlock extends Block.SchemaType = Block.SchemaType> e
24
24
  get state(): "undefined" | "invalid" | "valid";
25
25
  get fieldChanged$(): import("rxjs").Observable<Field.Event>;
26
26
  get configData(): Partial<Record<Schema.Block.Config.Variant, Block.ConfigVariantData>>;
27
+ get hasConfiguration(): boolean;
27
28
  get configuration(): BlockConfiguration;
28
29
  get value(): Schema.Block.Data;
29
30
  get modified(): boolean;
@@ -18,7 +18,7 @@ class Block extends ItemBase_1.ItemBase {
18
18
  this._configData = args.configData;
19
19
  this.fields = args.fields;
20
20
  // group fields
21
- const messageKeys = Object.keys(funnel_ui_1.MessagePanel.Fields.getSchema());
21
+ const messageKeys = funnel_ui_1.MessagePanel.Fields.Keys.values;
22
22
  this.messageFields = this.fields.filter(field => messageKeys.includes(field.id));
23
23
  this.visualFields = this.fields.filter(field => field.id === 'visual');
24
24
  this.listsFields = this.fields.filter(field => field.id === 'list');
@@ -51,11 +51,14 @@ class Block extends ItemBase_1.ItemBase {
51
51
  var _a, _b;
52
52
  return (_b = (_a = this._configuration) === null || _a === void 0 ? void 0 : _a.configData) !== null && _b !== void 0 ? _b : this._configData;
53
53
  }
54
+ get hasConfiguration() {
55
+ return !!this._configuration;
56
+ }
54
57
  get configuration() {
55
58
  // throw if accessed too early
56
59
  const { _configuration } = this;
57
60
  if (!_configuration) {
58
- throw new funnel_core_1.InvalidOperationError('Cannot to access Block configuration before being bound to parent');
61
+ throw new funnel_core_1.InvalidOperationError('Cannot access Block configuration before being bound to parent. Please use hasConfiguration to check first.');
59
62
  }
60
63
  // return configuration
61
64
  return _configuration;
@@ -1,5 +1,5 @@
1
1
  import { BlockLayout, EventBus, Field, FieldModel, Logger, Schema } from '@nascentdigital/funnel-core';
2
- import { ListPanel, MessagePanel, PanelLayout, SlotVariation, VisualPanel } from '@nascentdigital/funnel-ui';
2
+ import { Block as PanelledBlock, ListPanel, MessagePanel, PanelLayout, SlotVariation, VisualPanel } from '@nascentdigital/funnel-ui';
3
3
  import { Block } from './Block';
4
4
  import { IAssetStore } from './IAssetStore';
5
5
  import { ICollectionStore } from './ICollectionStore';
@@ -27,25 +27,25 @@ export declare class BlockConfiguration {
27
27
  get variant(): Schema.Block.Config.Variant;
28
28
  set variant(variant: Schema.Block.Config.Variant);
29
29
  isVariantAvailable(variant: Schema.Block.Config.Variant): boolean;
30
- get blockFields(): FieldModel.Config[];
31
- get blockExtendedFields(): FieldModel.Config[];
30
+ get blockFields(): (Field<Schema.TextField> | Field<Schema.EnumConfig<Readonly<import("@nascentdigital/funnel-core").BlockThemes.Options>>>)[];
31
+ get blockExtendedFields(): (FieldModel.Config | Field<Schema.EnumConfig<Schema.EnumField.Options<import("@nascentdigital/funnel-ui").ItemAlignment>>> | Field<Schema.EnumConfig<Schema.EnumField.Options<import("@nascentdigital/funnel-ui").RowRatio>>>)[];
32
32
  get blockFieldData(): Schema.Block.Data.ForFields<Schema.Fields>;
33
33
  get nameField(): Field<Schema.TextField> | undefined;
34
- get themeField(): FieldModel.Config | undefined;
34
+ get themeField(): Field<Schema.EnumConfig<Readonly<import("@nascentdigital/funnel-core").BlockThemes.Options>>> | undefined;
35
35
  get layoutField(): Field<Schema.EnumField<Schema.EnumField.Options<PanelLayout>>> | undefined;
36
36
  get slotState(): Readonly<BlockConfiguration.SlotState>;
37
37
  gotToNextSlot(): void;
38
38
  gotToPreviousSlot(): void;
39
39
  get hasBlockConfig(): boolean;
40
40
  get hasPanels(): boolean;
41
- get messageFields(): Record<MessagePanel.Config.Key<'message'>, FieldModel.Config>;
42
- get listFields(): Record<ListPanel.Config.Key<'list'>, FieldModel.Config>;
43
- get visualFields(): Record<VisualPanel.Config.Key<'visual'>, FieldModel.Config>;
41
+ get messageFields(): Partial<FieldModel.Config.FromSchema<MessagePanel.Config.Schema>>;
42
+ get visualFields(): Partial<FieldModel.Config.FromSchema<VisualPanel.Config.Schema>>;
43
+ get listFields(): Partial<FieldModel.Config.FromSchema<ListPanel.Config.Schema>>;
44
44
  get extendedFields(): Record<string, FieldModel.Config>;
45
45
  get layout(): BlockLayout | undefined;
46
- getPossibleField(fieldId: string): FieldModel.Config | undefined;
46
+ getPossibleField<TKey extends PanelledBlock.Config.Schema.All.Keys>(fieldId: TKey): Field<PanelledBlock.Config.Schema.All[TKey]> | undefined;
47
47
  getFieldsForTags(...tagsRaw: ReadonlyArray<Schema.FieldTag>): Record<string, FieldModel.Config>;
48
- getField(fieldId: string): FieldModel.Config;
48
+ getField<TKey extends PanelledBlock.Config.Schema.All.Keys>(fieldId: TKey): Field<PanelledBlock.Config.Schema.All[TKey]>;
49
49
  getFieldData(fieldId: string): Schema.Field.LinkedData | undefined;
50
50
  setPanelLayout(layout: PanelLayout): void;
51
51
  sync({ variant: targetVariant, coerce }?: Partial<BlockConfiguration.SyncArgs>): void;
@@ -134,14 +134,15 @@ class BlockConfiguration {
134
134
  get blockFields() {
135
135
  return [
136
136
  this.nameField,
137
- this.themeField
137
+ this.getPossibleField('theme'),
138
138
  ].filter(funnel_core_1.Value.isDefined);
139
139
  }
140
140
  get blockExtendedFields() {
141
141
  return [
142
- ...Object.values(this.extendedFields),
143
- this.getPossibleField('contentAlign'),
144
- this.getPossibleField('contentSplit')
142
+ this.getPossibleField('rowAlign'),
143
+ this.getPossibleField('rowSplit'),
144
+ this.getPossibleField('fullHeight'),
145
+ ...Object.values(this.extendedFields)
145
146
  ].filter(funnel_core_1.Value.isDefined);
146
147
  }
147
148
  get blockFieldData() {
@@ -221,7 +222,7 @@ class BlockConfiguration {
221
222
  return block.nameField;
222
223
  }
223
224
  get themeField() {
224
- return this.getPossibleField(funnel_ui_1.BlockConfig.Presets.ThemeOnly.key);
225
+ return this.getPossibleField(funnel_ui_1.Block.Config.Presets.ThemeOnly.key);
225
226
  }
226
227
  get layoutField() {
227
228
  return this.fields.find(field => field.id === 'layout');
@@ -266,26 +267,22 @@ class BlockConfiguration {
266
267
  return this.block.schema instanceof funnel_core_1.Schema.PanelledBlock;
267
268
  }
268
269
  get messageFields() {
269
- return this.getFieldsForTags(funnel_ui_1.MessagePanel.Tag.message);
270
+ return this.getFieldsForTags(funnel_ui_1.MessagePanelTags.message);
271
+ }
272
+ get visualFields() {
273
+ return this.getFieldsForTags(funnel_ui_1.VisualPanelTags.visual);
270
274
  }
271
275
  get listFields() {
272
276
  return this.getFieldsForTags(funnel_ui_1.ListPanelTags.list);
273
277
  }
274
- get visualFields() {
275
- return this.getFieldsForTags(funnel_ui_1.VisualPanel.Tag.visual);
276
- }
277
278
  get extendedFields() {
278
279
  // get all top-level keys
279
280
  const { fields } = this;
280
281
  const coreKeys = [
281
- funnel_ui_1.BlockConfig.Presets.ThemeOnly.key,
282
- 'layout',
283
- 'slotVariation',
284
- 'contentAlign',
285
- 'contentSplit',
286
- ...Object.values(funnel_ui_1.MessagePanel.Config.getKeys('message')),
287
- ...Object.values(funnel_ui_1.ListPanel.Config.getKeys('list')),
288
- ...Object.values(funnel_ui_1.VisualPanel.Config.getKeys('visual'))
282
+ ...funnel_ui_1.Block.Config.Schema.Core.Keys.values,
283
+ ...funnel_ui_1.MessagePanel.Config.Keys.values,
284
+ ...funnel_ui_1.VisualPanel.Config.Keys.values,
285
+ ...funnel_ui_1.ListPanel.Config.Keys.values
289
286
  ];
290
287
  // return all editable fields, minus the core keys
291
288
  return fields.reduce((fields, field) => {
@@ -10,6 +10,7 @@ export declare class SectionBlock<TBlock extends Schema.Block = Schema.Block> ex
10
10
  get schema(): TBlock;
11
11
  get identifier(): string;
12
12
  get name(): string;
13
+ get hasConfiguration(): boolean;
13
14
  get configuration(): import("./BlockConfiguration").BlockConfiguration;
14
15
  get fields(): ReadonlyArray<FieldModel>;
15
16
  get nameField(): import("@nascentdigital/funnel-core").Field<Schema.TextField> | undefined;
@@ -21,6 +21,9 @@ class SectionBlock extends ItemBase_1.ItemBase {
21
21
  get name() {
22
22
  return this.block.name;
23
23
  }
24
+ get hasConfiguration() {
25
+ return this.block.hasConfiguration;
26
+ }
24
27
  get configuration() {
25
28
  return this.block.configuration;
26
29
  }
@@ -121,7 +121,7 @@ function BlockConfigButton({ block, target, anchorId: anchorOverrideId, children
121
121
  }));
122
122
  // update if something was picked
123
123
  if (selectedLayout) {
124
- layoutField.value = funnel_core_1.Schema.EnumField.Value.toData(selectedLayout);
124
+ layoutField.value = funnel_core_1.Schema.EnumConfig.toData(selectedLayout);
125
125
  }
126
126
  };
127
127
  // set variables
@@ -272,9 +272,6 @@ function renderListLayoutItem(item) {
272
272
  case 'brick':
273
273
  content = ((0, jsx_runtime_1.jsxs)("div", { className: (0, classnames_1.default)(panelClassName, panelPaddedX, 'grid grid-cols-2 gap-l3 pt-10'), children: [panel('h-12 row-start-1 col-span-full'), panel('h-12 row-start-2 col-start-1'), panel('h-12 row-start-2 col-start-2'), panel('h-12 row-start-3 col-span-full')] }));
274
274
  break;
275
- case 'brickFlipped':
276
- content = ((0, jsx_runtime_1.jsxs)("div", { className: (0, classnames_1.default)(panelClassName, panelPaddedX, 'grid grid-cols-2 gap-l3 pt-10'), children: [panel('h-12 row-start-1 col-start-1'), panel('h-12 row-start-1 col-start-2'), panel('h-12 row-start-2 col-span-full'), panel('h-12 row-start-3 col-start-1'), panel('h-12 row-start-3 col-start-2')] }));
277
- break;
278
275
  case 'carousel':
279
276
  content = ((0, jsx_runtime_1.jsxs)("div", { className: (0, classnames_1.default)(panelClassName, 'flex flex-col gap-l2 pt-10 pb-l3'), children: [(0, jsx_runtime_1.jsxs)("div", { className: "flex-1 flex items-stretch gap-l3", children: [(0, jsx_runtime_1.jsx)("div", { className: "w-8 bg-surface-placeholder rounded-r-[2px]" }), (0, jsx_runtime_1.jsx)("div", { className: "flex-1 bg-surface-placeholder-raised rounded-[2px]" }), (0, jsx_runtime_1.jsx)("div", { className: "w-8 bg-surface-placeholder rounded-l-[2px]" })] }), (0, jsx_runtime_1.jsxs)("div", { className: "flex justify-center items-center gap-l1", children: [(0, jsx_runtime_1.jsx)("div", { className: "w-4 h-4 bg-surface-placeholder-raised rounded-full" }), (0, jsx_runtime_1.jsx)("div", { className: "w-4 h-4 bg-surface-placeholder-raised rounded-full" }), (0, jsx_runtime_1.jsx)("div", { className: "w-4 h-4 bg-surface-placeholder-raised rounded-full" })] })] }));
280
277
  break;
@@ -501,10 +501,10 @@ video {
501
501
  }
502
502
 
503
503
  [popover]{
504
- inset: var(--toolwind-toggle-poD8BZape9, 0px);
505
- background-color: var(--toolwind-toggle-QmYKh026Mc, canvas);
506
- color: var(--toolwind-toggle-KqTa7MZK0g, canvastext);
507
- margin: var(--toolwind-toggle-l6dUu6u6Un, auto);
504
+ inset: var(--toolwind-toggle-nSvp8q7rrL, 0px);
505
+ background-color: var(--toolwind-toggle-ZSSRbB7EKW, canvas);
506
+ color: var(--toolwind-toggle-GwZMPobI7s, canvastext);
507
+ margin: var(--toolwind-toggle-GVxBrKGCyn, auto);
508
508
  }
509
509
  html, body, #__next, #root, .Editor-wrap{
510
510
  position: relative;
@@ -6220,10 +6220,10 @@ img.nd-Visual-image {
6220
6220
  .anchored\/\[--nd-popup-anchor\]:where(.anchored\/\[--nd-popup-anchor\]){
6221
6221
  position: absolute;
6222
6222
  view-transition-name: --tw-anchor-view-transition-2j1919322s193433343934192p322r2w33362l;
6223
- --toolwind-toggle-poD8BZape9: auto;
6224
- --toolwind-toggle-QmYKh026Mc: transparent;
6225
- --toolwind-toggle-KqTa7MZK0g: inherit;
6226
- --toolwind-toggle-l6dUu6u6Un: 0px;
6223
+ --toolwind-toggle-nSvp8q7rrL: auto;
6224
+ --toolwind-toggle-ZSSRbB7EKW: transparent;
6225
+ --toolwind-toggle-GwZMPobI7s: inherit;
6226
+ --toolwind-toggle-GVxBrKGCyn: 0px;
6227
6227
  }
6228
6228
  .counter-l1{
6229
6229
  counter-reset: l1;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nascentdigital/funnel-editor",
3
- "version": "8.0.2",
3
+ "version": "8.0.4",
4
4
  "publishConfig": {
5
5
  "registry": "https://registry.npmjs.org/",
6
6
  "access": "public"
@@ -92,5 +92,5 @@
92
92
  "ts-jest": "^29",
93
93
  "type-fest": "^4"
94
94
  },
95
- "gitHead": "63c8c0aecf4c61227b25965a54c75818d456d8f3"
95
+ "gitHead": "5375c943981bd14ac211a94f5455fdc1d5ba5098"
96
96
  }