@nascentdigital/funnel-editor 4.5.1 → 4.5.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/EditorApp.js CHANGED
@@ -36,5 +36,5 @@ function EditorApp({ fonts }) {
36
36
  return null;
37
37
  }
38
38
  // render
39
- return ((0, jsx_runtime_1.jsx)("div", { className: (0, classnames_1.default)('Editor-wrap', ...fonts), children: (0, jsx_runtime_1.jsx)(core_1.AppStateContainer, { children: (0, jsx_runtime_1.jsx)(core_1.SettingsContainer, { children: (0, jsx_runtime_1.jsx)(react_hotkeys_hook_1.HotkeysProvider, { children: (0, jsx_runtime_1.jsx)(core_1.EditorApiContainer, { children: (0, jsx_runtime_1.jsx)(core_1.AuthContainer, { children: (0, jsx_runtime_1.jsx)(client_1.BreakpointContainer, { children: (0, jsx_runtime_1.jsx)(client_1.BackdropContainer, { children: (0, jsx_runtime_1.jsx)(core_1.DialogContainer, { children: (0, jsx_runtime_1.jsx)(core_1.CenterSheetContainer, { children: (0, jsx_runtime_1.jsx)(core_1.SplashContainer, { children: (0, jsx_runtime_1.jsx)(core_1.SiteConfigContainer, { children: (0, jsx_runtime_1.jsx)(EditorRoutes_1.EditorRoutes, {}) }) }) }) }) }) }) }) }) }) }) }) }));
39
+ return ((0, jsx_runtime_1.jsx)("div", { className: (0, classnames_1.default)('Editor-wrap', ...fonts), children: (0, jsx_runtime_1.jsx)(core_1.AppStateContainer, { children: (0, jsx_runtime_1.jsx)(core_1.SettingsContainer, { children: (0, jsx_runtime_1.jsx)(react_hotkeys_hook_1.HotkeysProvider, { children: (0, jsx_runtime_1.jsx)(core_1.EditorApiContainer, { children: (0, jsx_runtime_1.jsx)(core_1.AuthContainer, { children: (0, jsx_runtime_1.jsx)(client_1.BreakpointContainer, { breakpoints: { xs: 0, sm: 480, md: 768, lg: 980, xl: 1200 }, children: (0, jsx_runtime_1.jsx)(core_1.DialogContainer, { children: (0, jsx_runtime_1.jsx)(core_1.CenterSheetContainer, { children: (0, jsx_runtime_1.jsx)(core_1.SplashContainer, { children: (0, jsx_runtime_1.jsx)(core_1.SiteConfigContainer, { children: (0, jsx_runtime_1.jsx)(EditorRoutes_1.EditorRoutes, {}) }) }) }) }) }) }) }) }) }) }) }));
40
40
  }
@@ -1,8 +1,8 @@
1
- import { Popup } from '@nascentdigital/funnel-ui/client';
1
+ import { Placement } from '@nascentdigital/funnel-core';
2
2
  export declare function ColorModeToggle({ className, popupPlacement }: ColorModeToggle.Props): import("react/jsx-runtime").JSX.Element;
3
3
  export declare namespace ColorModeToggle {
4
4
  type Props = {
5
5
  className?: string;
6
- popupPlacement?: Popup.Placement;
6
+ popupPlacement?: Placement;
7
7
  };
8
8
  }
@@ -6,11 +6,10 @@ Object.defineProperty(exports, "__esModule", { value: true });
6
6
  exports.CollectionPicker = void 0;
7
7
  const jsx_runtime_1 = require("react/jsx-runtime");
8
8
  const funnel_core_1 = require("@nascentdigital/funnel-core");
9
- const client_1 = require("@nascentdigital/funnel-ui/client");
10
9
  const classnames_1 = __importDefault(require("classnames"));
11
10
  const framer_motion_1 = require("framer-motion");
12
11
  const react_1 = require("react");
13
- const client_2 = require("../../../client");
12
+ const client_1 = require("../../../client");
14
13
  const hooks_1 = require("../../../hooks");
15
14
  const feedback_1 = require("../../feedback");
16
15
  const interaction_1 = require("../../interaction");
@@ -29,7 +28,7 @@ exports.CollectionPicker = (0, react_1.forwardRef)(function CollectionPicker({ l
29
28
  const [tagTooltip, setTagTooltip] = (0, react_1.useState)();
30
29
  const [fetching, setFetching] = (0, react_1.useState)(false);
31
30
  const [error, setError] = (0, react_1.useState)();
32
- const editorApi = (0, client_2.useEditorApi)();
31
+ const editorApi = (0, client_1.useEditorApi)();
33
32
  const siteCollections = (0, hooks_1.useCollections)();
34
33
  const collectionStore = (0, hooks_1.useCollectionStore)();
35
34
  // export service
@@ -174,7 +173,7 @@ exports.CollectionPicker = (0, react_1.forwardRef)(function CollectionPicker({ l
174
173
  deferral.resolve(result !== null && result !== void 0 ? result : undefined);
175
174
  };
176
175
  // render
177
- return ((0, jsx_runtime_1.jsxs)(interaction_1.Picker, { className: "flex", open: deferral && result === undefined, disableDismiss: fetching, onClose: onCancel, onClosed: onPickerClosed, children: [(0, jsx_runtime_1.jsxs)("section", { className: "shrink-0 w-[206px] flex flex-col gap-l8 p-l8 bg-modal-background", children: [(0, jsx_runtime_1.jsx)("h1", { className: "heading-md text-content-primary", children: "Select Collection" }), (0, jsx_runtime_1.jsx)(interaction_1.ChipFilters, { title: "Site Collections", options: collectionGroups, selectedOptions: collectionGroup && [collectionGroup], onToggle: (collectionGroup, selected) => selected && setCollectionGroup(collectionGroup), renderLabel: collectionGroup => collectionGroup.template.name, disabled: fetching })] }), (0, jsx_runtime_1.jsxs)("section", { className: "flex-1 flex flex-col", children: [(0, jsx_runtime_1.jsx)("div", { className: "flex-1 p-l8 overflow-y-scroll", children: (0, jsx_runtime_1.jsx)(framer_motion_1.AnimatePresence, { mode: "wait", initial: false, children: renderPicker({ language, error, collectionGroups, collectionGroup, collections, tagOptions, tagFilters, onPick, setTagTooltip, fetching }) }) }), (0, jsx_runtime_1.jsx)("div", { className: "flex justify-end items-center p-l8 border-t border-solid border-border-l1", children: (0, jsx_runtime_1.jsx)(interaction_1.Button, { variant: "secondary", size: "sm", onClick: onCancel, disabled: fetching, children: "Cancel" }) }), (0, jsx_runtime_1.jsx)(client_1.Popup, { className: (0, classnames_1.default)('max-w-[200px] bg-surface2 rounded-md p-l5', 'border border-solid border-border-l1 shadow-tooltip', 'flex flex-wrap items-center gap-l4'), level: "l2", open: !!tagTooltip, anchor: tagTooltip === null || tagTooltip === void 0 ? void 0 : tagTooltip.anchor, anchorOffset: 4, placement: "top", onClose: () => setTagTooltip(undefined), children: tagTooltip === null || tagTooltip === void 0 ? void 0 : tagTooltip.tags.map(tag => (0, jsx_runtime_1.jsx)(feedback_1.Badge, { variant: "outlinedTiny", status: "draft", label: tag.name }, tag.data)) })] })] }));
176
+ return ((0, jsx_runtime_1.jsxs)(interaction_1.Picker, { className: "flex", open: deferral && result === undefined, disableDismiss: fetching, onClose: onCancel, onClosed: onPickerClosed, children: [(0, jsx_runtime_1.jsxs)("section", { className: "shrink-0 w-[206px] flex flex-col gap-l8 p-l8 bg-modal-background", children: [(0, jsx_runtime_1.jsx)("h1", { className: "heading-md text-content-primary", children: "Select Collection" }), (0, jsx_runtime_1.jsx)(interaction_1.ChipFilters, { title: "Site Collections", options: collectionGroups, selectedOptions: collectionGroup && [collectionGroup], onToggle: (collectionGroup, selected) => selected && setCollectionGroup(collectionGroup), renderLabel: collectionGroup => collectionGroup.template.name, disabled: fetching })] }), (0, jsx_runtime_1.jsxs)("section", { className: "flex-1 flex flex-col", children: [(0, jsx_runtime_1.jsx)("div", { className: "flex-1 p-l8 overflow-y-scroll", children: (0, jsx_runtime_1.jsx)(framer_motion_1.AnimatePresence, { mode: "wait", initial: false, children: renderPicker({ language, error, collectionGroups, collectionGroup, collections, tagOptions, tagFilters, onPick, setTagTooltip, fetching }) }) }), (0, jsx_runtime_1.jsx)("div", { className: "flex justify-end items-center p-l8 border-t border-solid border-border-l1", children: (0, jsx_runtime_1.jsx)(interaction_1.Button, { variant: "secondary", size: "sm", onClick: onCancel, disabled: fetching, children: "Cancel" }) }), (0, jsx_runtime_1.jsx)(interaction_1.Popup, { className: (0, classnames_1.default)('max-w-[200px] bg-surface2 rounded-md p-l5', 'border border-solid border-border-l1 shadow-tooltip', 'flex flex-wrap items-center gap-l4'), open: !!tagTooltip, anchor: tagTooltip === null || tagTooltip === void 0 ? void 0 : tagTooltip.anchor, anchorOffset: 4, placement: "top", disableOverlay: true, onClose: () => setTagTooltip(undefined), children: tagTooltip === null || tagTooltip === void 0 ? void 0 : tagTooltip.tags.map(tag => (0, jsx_runtime_1.jsx)(feedback_1.Badge, { variant: "outlinedTiny", status: "draft", label: tag.name }, tag.data)) })] })] }));
178
177
  });
179
178
  function renderPicker({ language, schema, error, collectionGroups, collectionGroup, collections, tagOptions, tagFilters, onPick, setTagTooltip, fetching }) {
180
179
  // show error if we have one
@@ -6,7 +6,6 @@ Object.defineProperty(exports, "__esModule", { value: true });
6
6
  exports.PagePicker = void 0;
7
7
  const jsx_runtime_1 = require("react/jsx-runtime");
8
8
  const funnel_core_1 = require("@nascentdigital/funnel-core");
9
- const client_1 = require("@nascentdigital/funnel-ui/client");
10
9
  const classnames_1 = __importDefault(require("classnames"));
11
10
  const framer_motion_1 = require("framer-motion");
12
11
  const react_1 = require("react");
@@ -206,7 +205,7 @@ exports.PagePicker = (0, react_1.forwardRef)(function PagePicker({ language }, r
206
205
  ? 'Primary'
207
206
  : filter.template.name }), tagOptions === null || tagOptions === void 0 ? void 0 : tagOptions.map(({ group, tags: groupTags }) => (0, jsx_runtime_1.jsx)(interaction_1.ChipFilters, { title: group.name, multiselect: true, options: groupTags.values().toArray(), selectedOptions: tagFilters.filter(tag => groupTags.has(tag)), onToggle: (tag, selected) => setTagFilters(tags => selected
208
207
  ? [...tags, tag]
209
- : tags.filter(t => t !== tag)), onToggleAll: () => setTagFilters(tags => tags.filter(tag => !groupTags.has(tag))), renderLabel: tag => tag.name }, group.id))] }), (0, jsx_runtime_1.jsxs)("section", { className: "flex-1 flex flex-col", children: [(0, jsx_runtime_1.jsx)("div", { className: "flex-1 p-l8 overflow-y-scroll", children: (0, jsx_runtime_1.jsx)(framer_motion_1.AnimatePresence, { mode: "wait", initial: false, children: renderPicker({ site, language, disabledIds, error, pageFilters, pageFilter, tagOptions, tagFilters, pagesSchema, pages, onPick, setTagTooltip }) }) }), (0, jsx_runtime_1.jsx)("div", { className: "flex justify-end items-center p-l8 border-t border-solid border-border-l1", children: (0, jsx_runtime_1.jsx)(interaction_1.Button, { variant: "secondary", size: "sm", onClick: onCancel, children: "Cancel" }) }), (0, jsx_runtime_1.jsx)(client_1.Popup, { className: (0, classnames_1.default)('max-w-[200px] bg-surface2 rounded-md p-l5', 'border border-solid border-border-l1 shadow-tooltip', 'flex flex-wrap items-center gap-l4'), level: "l2", open: !!tagTooltip, anchor: tagTooltip === null || tagTooltip === void 0 ? void 0 : tagTooltip.anchor, anchorOffset: 4, placement: "top", onClose: () => setTagTooltip(undefined), children: tagTooltip === null || tagTooltip === void 0 ? void 0 : tagTooltip.tags.map(tag => (0, jsx_runtime_1.jsx)(feedback_1.Badge, { variant: "outlinedTiny", status: "draft", label: tag.name }, tag.data)) })] })] }));
208
+ : tags.filter(t => t !== tag)), onToggleAll: () => setTagFilters(tags => tags.filter(tag => !groupTags.has(tag))), renderLabel: tag => tag.name }, group.id))] }), (0, jsx_runtime_1.jsxs)("section", { className: "flex-1 flex flex-col", children: [(0, jsx_runtime_1.jsx)("div", { className: "flex-1 p-l8 overflow-y-scroll", children: (0, jsx_runtime_1.jsx)(framer_motion_1.AnimatePresence, { mode: "wait", initial: false, children: renderPicker({ site, language, disabledIds, error, pageFilters, pageFilter, tagOptions, tagFilters, pagesSchema, pages, onPick, setTagTooltip }) }) }), (0, jsx_runtime_1.jsx)("div", { className: "flex justify-end items-center p-l8 border-t border-solid border-border-l1", children: (0, jsx_runtime_1.jsx)(interaction_1.Button, { variant: "secondary", size: "sm", onClick: onCancel, children: "Cancel" }) }), (0, jsx_runtime_1.jsx)(interaction_1.Popup, { className: (0, classnames_1.default)('max-w-[200px] bg-surface2 rounded-md p-l5', 'border border-solid border-border-l1 shadow-tooltip', 'flex flex-wrap items-center gap-l4'), open: !!tagTooltip, anchor: tagTooltip === null || tagTooltip === void 0 ? void 0 : tagTooltip.anchor, anchorOffset: 4, placement: "top", disableOverlay: true, onClose: () => setTagTooltip(undefined), children: tagTooltip === null || tagTooltip === void 0 ? void 0 : tagTooltip.tags.map(tag => (0, jsx_runtime_1.jsx)(feedback_1.Badge, { variant: "outlinedTiny", status: "draft", label: tag.name }, tag.data)) })] })] }));
210
209
  });
211
210
  function renderPicker({ site, language, disabledIds, error, pageFilters, pageFilter, tagOptions, tagFilters, pagesSchema, pages, onPick, setTagTooltip }) {
212
211
  // show error if we have one
@@ -265,7 +264,7 @@ function renderPageRef({ language, template, disabledIds, ref, onPick, setTagToo
265
264
  const visibleTags = tags.slice(0, Math.min(tags.length, 2));
266
265
  const tooltipTags = tags.length > 2
267
266
  ? tags.slice(2)
268
- : [];
267
+ : [...Object.values(funnel_core_1.Schema.AssetField.Tags.image.tags)];
269
268
  const disabled = !ref || ref.language !== language || disabledIds.includes(ref.id);
270
269
  // helpers
271
270
  const onClick = () => {
@@ -9,5 +9,5 @@ export declare namespace Animate {
9
9
  layout?: boolean;
10
10
  effect?: Effect;
11
11
  };
12
- type Effect = 'fade';
12
+ type Effect = 'fade' | 'slideFromLeft' | 'slideFromBottom';
13
13
  }
@@ -18,8 +18,18 @@ function Animate({ className, present = false, layout = false, effect = 'fade',
18
18
  Animate.Variants = {
19
19
  fade: {
20
20
  initial: { opacity: 0, transition: { when: 'beforeChildren' } },
21
- animate: { opacity: 1, transition: { ease: "easeIn", when: 'beforeChildren' } },
22
- exit: { opacity: 0, transition: { ease: "easeOut", when: 'afterChildren' } }
21
+ animate: { opacity: 1, transition: { duration: 0.4, ease: "easeIn", when: 'beforeChildren' } },
22
+ exit: { opacity: 0, transition: { duration: 0.3, ease: "easeOut", when: 'afterChildren' } }
23
+ },
24
+ slideFromLeft: {
25
+ initial: { x: '100%', transition: { when: 'beforeChildren' } },
26
+ animate: { x: 0, transition: { duration: 0.3, ease: "easeIn", when: 'beforeChildren' } },
27
+ exit: { x: '100%', transition: { duration: 0.3, ease: "easeOut", when: 'afterChildren' } }
28
+ },
29
+ slideFromBottom: {
30
+ initial: { y: '100%', transition: { when: 'beforeChildren' } },
31
+ animate: { y: 0, transition: { duration: 0.3, ease: "easeIn", when: 'beforeChildren' } },
32
+ exit: { y: '100%', transition: { duration: 0.3, ease: "easeOut", when: 'afterChildren' } }
23
33
  }
24
34
  };
25
35
  })(Animate || (exports.Animate = Animate = {}));
@@ -88,7 +88,7 @@ exports.QuickPicker = (0, react_1.forwardRef)(function QuickPicker({ variant, ti
88
88
  }
89
89
  };
90
90
  // render
91
- return ((0, jsx_runtime_1.jsxs)(Popup_1.Popup, Object.assign({}, (popupProps !== null && popupProps !== void 0 ? popupProps : {}), { className: (0, classnames_1.default)('glass-overlay w-[420px] max-w-full flex flex-col gap-l8 pt-l8 interpolate', 'border-t border-solid border-glass-stroke-l1 rounded-md', {
91
+ return ((0, jsx_runtime_1.jsxs)(Popup_1.Popup, Object.assign({}, (popupProps !== null && popupProps !== void 0 ? popupProps : {}), { className: (0, classnames_1.default)('glass-overlay w-[420px] max-w-full flex flex-col gap-l8 pt-l8 interpolate', 'border border-solid border-glass-stroke-l1/tint5 rounded-md', {
92
92
  'opacity-none': !opened,
93
93
  'opacity-full': opened
94
94
  }), animation: "out", open: !!deferral, onOpened: () => setOpened(true), onClose: onClose, onClosed: () => setOpened(false), children: [(0, jsx_runtime_1.jsxs)("section", { className: "px-l8", children: [(0, jsx_runtime_1.jsx)("h3", { className: "heading-sm text-content-primary", children: title }), description &&
@@ -0,0 +1,26 @@
1
+ import { Callback, Provider, Transform } from '@nascentdigital/funnel-core';
2
+ import { HTMLMotionProps } from 'framer-motion';
3
+ import { PropsWithChildren, ReactNode } from 'react';
4
+ export declare function SideSheet({ className, title, size, backdrop, disabled, disableDismiss, disableOverlay, disableSave, canSave, renderSaveLabel, onSave: onSaveRaw, open, onOpened: onOpenedRaw, onClose: onCloseRaw, onClosed: onClosedRaw, onKeyDown: onKeyDownRaw, customActions, children, ...props }: SideSheet.Props): import("react").ReactPortal | null;
5
+ export declare namespace SideSheet {
6
+ type Props = Omit<HTMLMotionProps<'div'>, 'children'> & PropsWithChildren & {
7
+ title: ReactNode;
8
+ size?: Size;
9
+ backdrop?: Backdrop;
10
+ disabled?: boolean;
11
+ disableDismiss?: boolean;
12
+ disableOverlay?: boolean;
13
+ disableSave?: boolean;
14
+ canSave?: Provider<boolean> | Provider.Async<boolean>;
15
+ renderSaveLabel?: Transform<State, string>;
16
+ onSave?: Callback.Void | Callback.AsyncVoid;
17
+ customActions?: ReactNode;
18
+ open?: boolean;
19
+ onOpened?: Callback.Void;
20
+ onClose?: Callback.Void;
21
+ onClosed?: Callback.Void;
22
+ };
23
+ type Size = 'xs' | 'sm' | 'md' | 'lg';
24
+ type Backdrop = 'none' | 'glass';
25
+ type State = 'editing' | 'validating' | 'saving' | 'error' | 'saved';
26
+ }
@@ -0,0 +1,172 @@
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.SideSheet = SideSheet;
18
+ const jsx_runtime_1 = require("react/jsx-runtime");
19
+ const funnel_core_1 = require("@nascentdigital/funnel-core");
20
+ const hooks_1 = require("@nascentdigital/funnel-ui/hooks");
21
+ const classnames_1 = __importDefault(require("classnames"));
22
+ const framer_motion_1 = require("framer-motion");
23
+ const react_1 = require("motion/react");
24
+ const react_2 = require("react");
25
+ const react_dom_1 = require("react-dom");
26
+ const Animate_1 = require("./Animate");
27
+ const Button_1 = require("./Button");
28
+ // component
29
+ function SideSheet(_a) {
30
+ var _b;
31
+ var { className, title, size = 'md', backdrop = 'none', disabled = false, disableDismiss = false, disableOverlay = false, disableSave = false, canSave = funnel_core_1.Fn.True, renderSaveLabel = onRenderSaveLabel, onSave: onSaveRaw = funnel_core_1.Fn.NoOp, open = false, onOpened: onOpenedRaw = funnel_core_1.Fn.NoOp, onClose: onCloseRaw = funnel_core_1.Fn.NoOp, onClosed: onClosedRaw = funnel_core_1.Fn.NoOp, onKeyDown: onKeyDownRaw, customActions, children } = _a, props = __rest(_a, ["className", "title", "size", "backdrop", "disabled", "disableDismiss", "disableOverlay", "disableSave", "canSave", "renderSaveLabel", "onSave", "open", "onOpened", "onClose", "onClosed", "onKeyDown", "customActions", "children"]);
32
+ // bind state + hooks + refs
33
+ const [state, setState] = (0, react_2.useState)('editing');
34
+ const locked = disabled || state === 'validating' || state === 'saving' || state === 'saved';
35
+ const breakpoint = (_b = (0, hooks_1.useCurrentBreakpoint)()) !== null && _b !== void 0 ? _b : 'xs';
36
+ const id = (0, react_2.useId)();
37
+ const openRef = (0, react_2.useRef)(open);
38
+ openRef.current = open;
39
+ const onOpenedRef = (0, react_2.useRef)(onOpenedRaw);
40
+ onOpenedRef.current = onOpenedRaw;
41
+ const onClosedRef = (0, react_2.useRef)(onClosedRaw);
42
+ onClosedRef.current = onClosedRaw;
43
+ // reset state on open
44
+ (0, react_2.useEffect)(() => {
45
+ if (open) {
46
+ setState('editing');
47
+ }
48
+ }, [open]);
49
+ // lock tab focus
50
+ (0, react_2.useEffect)(() => {
51
+ // lock when opened
52
+ let unlock = undefined;
53
+ if (open) {
54
+ unlock = funnel_core_1.Browser.lockFocus(`#${CSS.escape(id)}`);
55
+ }
56
+ // unlock on unmount
57
+ return () => unlock && unlock();
58
+ }, [open, id]);
59
+ // skip for SSR
60
+ if (!funnel_core_1.Browser.available) {
61
+ return null;
62
+ }
63
+ // helpers
64
+ const onSave = async (e) => {
65
+ console.debug('[SideSheet/onSave]', { state, disabled, open });
66
+ // consume event
67
+ if (e) {
68
+ e.preventDefault();
69
+ e.stopPropagation();
70
+ }
71
+ // ignore if state is invalid
72
+ if (state !== 'editing' && state !== 'error') {
73
+ return;
74
+ }
75
+ // try to save
76
+ try {
77
+ // update state
78
+ setState('validating');
79
+ // skip if not valid
80
+ const valid = await Promise.resolve(canSave());
81
+ if (!valid) {
82
+ setState('error');
83
+ return;
84
+ }
85
+ // update state
86
+ setState('saving');
87
+ // try to save
88
+ await Promise.resolve(onSaveRaw());
89
+ // mark as saved
90
+ setState('saved');
91
+ }
92
+ // handle error
93
+ catch (e) {
94
+ console.warn('[SideSheet/onSave] error', e);
95
+ // update state
96
+ setState('error');
97
+ }
98
+ };
99
+ const onClose = (e) => {
100
+ // consume event
101
+ if (e) {
102
+ e.preventDefault();
103
+ e.stopPropagation();
104
+ }
105
+ // close
106
+ onCloseRaw();
107
+ };
108
+ const onKeyDown = async (e) => {
109
+ // ignore if disabled OR state is invalid
110
+ if (disabled || (state !== 'editing' && state !== 'error')) {
111
+ return;
112
+ }
113
+ // cancel on escape
114
+ switch (e.key) {
115
+ case 'Escape':
116
+ if (!disableDismiss) {
117
+ onClose(e);
118
+ }
119
+ break;
120
+ case 'Enter':
121
+ await onSave(e);
122
+ break;
123
+ }
124
+ };
125
+ const onAnimationComplete = (definition) => {
126
+ if (definition === 'visible') {
127
+ onOpenedRef.current();
128
+ }
129
+ else if (definition === 'exit') {
130
+ onClosedRef.current();
131
+ }
132
+ };
133
+ const onBackdropClick = (e) => {
134
+ // close only if the backdrop is directly clicked
135
+ const target = e.target;
136
+ if ((target === null || target === void 0 ? void 0 : target.id) === id) {
137
+ // stop bubbling
138
+ e.stopPropagation();
139
+ // close
140
+ onClose();
141
+ }
142
+ };
143
+ // render
144
+ return (0, react_dom_1.createPortal)((0, jsx_runtime_1.jsx)(react_1.AnimatePresence, { children: open &&
145
+ (0, jsx_runtime_1.jsxs)(framer_motion_1.motion.div, { id: id, className: (0, classnames_1.default)('fixed inset-0 z-popup', {
146
+ 'pointer-events-none': disableOverlay
147
+ }), onClick: disableDismiss || locked ? undefined : onBackdropClick, layout: true, children: [backdrop !== 'none' &&
148
+ (0, jsx_runtime_1.jsx)(framer_motion_1.motion.div, { className: (0, classnames_1.default)('fixed inset-0 z-backdrop pointer-events-none', {
149
+ 'backdrop-blur-[9px] bg-glass/backdrop will-change-[backdrop-filter]': backdrop === 'glass'
150
+ }), variants: Animate_1.Animate.Variants.fade, initial: "initial", animate: "animate", exit: "exit" }, "backdrop"), (0, jsx_runtime_1.jsx)(framer_motion_1.motion.div, Object.assign({}, props, { className: (0, classnames_1.default)(className, 'fixed max-md:inset-x-0 max-md:bottom-0 max-md:top-[40px] md:right-0 md:inset-y-0 z-sheet pointer-events-none', {
151
+ 'w-full md:w-[320px]': size === 'xs',
152
+ 'w-full md:w-[380px]': size === 'sm',
153
+ 'w-full md:w-[480px]': size === 'md',
154
+ 'w-full md:w-screen-sm': size === 'lg'
155
+ }), variants: breakpoint === 'xs' || breakpoint === 'sm'
156
+ ? Animate_1.Animate.Variants.slideFromBottom
157
+ : Animate_1.Animate.Variants.slideFromLeft, initial: "initial", animate: "animate", exit: "exit", onAnimationComplete: definition => onAnimationComplete(definition), onKeyDown: onKeyDown, tabIndex: -1, children: (0, jsx_runtime_1.jsxs)("div", { className: (0, classnames_1.default)(className, 'w-full h-full max-h-full pointer-events-auto', 'flex flex-col', 'bg-background border-solid border-border-l1', 'max-md:border-t max-md:rounded-tl-md max-md:rounded-tr-md', 'md:border-l md:rounded-tl-md md:rounded-bl-md'), children: [(0, jsx_runtime_1.jsx)("h2", { className: "heading-md text-content-primary p-l8", children: title }), (0, jsx_runtime_1.jsx)("div", { className: "flex-1 overflow-y-scroll", children: children }), (0, jsx_runtime_1.jsxs)("div", { className: (0, classnames_1.default)('flex justify-end items-center gap-l4 p-l8', 'border-t border-solid border-border-l1'), children: [(0, jsx_runtime_1.jsx)(Button_1.Button, { variant: "text", size: "sm", disabled: locked, onClick: onClose, children: "Cancel" }), customActions &&
158
+ (0, jsx_runtime_1.jsx)("div", { className: "flex-1 flex justify-end items-center gap-l4", children: customActions }), (0, jsx_runtime_1.jsx)(Button_1.Button, { variant: "primary", size: "sm", loading: state === 'saving', disabled: disableSave || locked, onClick: onSave, children: renderSaveLabel(state) })] })] }) }))] }, id) }), document.body);
159
+ }
160
+ // helpers
161
+ function onRenderSaveLabel(state) {
162
+ switch (state) {
163
+ case 'editing':
164
+ case 'validating':
165
+ case 'error':
166
+ return 'Save';
167
+ case 'saving':
168
+ return 'Saving...';
169
+ case 'saved':
170
+ return 'Saved';
171
+ }
172
+ }
@@ -96,7 +96,7 @@ exports.CenterSheet = (0, react_2.forwardRef)(function CenterSheet({ className,
96
96
  }
97
97
  // render
98
98
  return (0, react_dom_1.createPortal)((0, jsx_runtime_1.jsx)(react_1.AnimatePresence, { children: open &&
99
- (0, jsx_runtime_1.jsxs)(framer_motion_1.motion.div, { id: id, className: (0, classnames_1.default)('absolute inset-0 z-popup-l1 pointer-events-auto', 'flex flex-col justify-stretch items-center pt-l12 px-l6 md:px-l10 lg:px-l15'), variants: Animations.container, onAnimationComplete: definition => onAnimationComplete(definition), initial: "hidden", animate: "visible", exit: "exit", children: [(0, jsx_runtime_1.jsx)("div", { className: "absolute inset-0", onClick: onClose }), (0, jsx_runtime_1.jsx)("div", { className: (0, classnames_1.default)(className, 'relative h-full w-full max-w-[1000px] max-h-full overflow-hidden', 'text-onSurface bg-background rounded-t-lg shadow-objectEditor'), children: children })] }, id) }), anchor);
99
+ (0, jsx_runtime_1.jsxs)(framer_motion_1.motion.div, { id: id, className: (0, classnames_1.default)('absolute inset-0 z-popup pointer-events-auto', 'flex flex-col justify-stretch items-center pt-l12 px-l6 md:px-l10 lg:px-l15'), variants: Animations.container, onAnimationComplete: definition => onAnimationComplete(definition), initial: "hidden", animate: "visible", exit: "exit", children: [(0, jsx_runtime_1.jsx)("div", { className: "absolute inset-0", onClick: onClose }), (0, jsx_runtime_1.jsx)("div", { className: (0, classnames_1.default)(className, 'relative h-full w-full max-w-[1000px] max-h-full overflow-hidden', 'text-onSurface bg-background rounded-t-lg shadow-objectEditor'), children: children })] }, id) }), anchor);
100
100
  });
101
101
  // animations
102
102
  var Animations;
@@ -58,7 +58,7 @@ function CenterSheetContainer({ children }) {
58
58
  // render
59
59
  const { sheets } = context;
60
60
  const active = sheets.length > 0;
61
- return ((0, jsx_runtime_1.jsxs)(CenterSheetContext_1.CenterSheetContext.Provider, { value: context, children: [children, (0, jsx_runtime_1.jsx)("div", { className: "fixed inset-0 pointer-events-none", children: (0, jsx_runtime_1.jsx)("div", { id: anchorId, className: "relative w-full h-full", children: (0, jsx_runtime_1.jsx)("div", { className: (0, classnames_1.default)('absolute inset-0 z-backdrop-l1 interpolate will-change-[backdrop-filter,opacity]', 'backdrop-blur-[9px] bg-glass-fill-l1', {
61
+ return ((0, jsx_runtime_1.jsxs)(CenterSheetContext_1.CenterSheetContext.Provider, { value: context, children: [children, (0, jsx_runtime_1.jsx)("div", { className: "fixed inset-0 pointer-events-none", children: (0, jsx_runtime_1.jsx)("div", { id: anchorId, className: "relative w-full h-full", children: (0, jsx_runtime_1.jsx)("div", { className: (0, classnames_1.default)('absolute inset-0 z-backdrop interpolate will-change-[backdrop-filter,opacity]', 'backdrop-blur-[9px] bg-glass-fill-l1', {
62
62
  'pointer-events-none opacity-none': !active,
63
63
  'pointer-events-auto opacity-full': active
64
64
  }) }, "backdrop") }) })] }));
@@ -25,6 +25,7 @@ export * from './Profile';
25
25
  export * from './QuickInput';
26
26
  export * from './QuickPicker';
27
27
  export * from './SegmentedButton';
28
+ export * from './SideSheet';
28
29
  export * from './Sortable';
29
30
  export * from './Tabs';
30
31
  export * from './Toggle';
@@ -41,6 +41,7 @@ __exportStar(require("./Profile"), exports);
41
41
  __exportStar(require("./QuickInput"), exports);
42
42
  __exportStar(require("./QuickPicker"), exports);
43
43
  __exportStar(require("./SegmentedButton"), exports);
44
+ __exportStar(require("./SideSheet"), exports);
44
45
  __exportStar(require("./Sortable"), exports);
45
46
  __exportStar(require("./Tabs"), exports);
46
47
  __exportStar(require("./Toggle"), exports);
@@ -1,5 +1,5 @@
1
1
  import { BlockLayout, EventBus, Field, FieldModel, Schema } from '@nascentdigital/funnel-core';
2
- import { PanelLayout } from '@nascentdigital/funnel-ui';
2
+ import { PanelLayout, SlotVariation } from '@nascentdigital/funnel-ui';
3
3
  import { Block } from './Block';
4
4
  import { IAssetStore } from './IAssetStore';
5
5
  import { SectionBlock } from './SectionBlock';
@@ -23,6 +23,9 @@ export declare class BlockConfiguration {
23
23
  get nameField(): FieldModel.Config | undefined;
24
24
  get themeField(): FieldModel.Config | undefined;
25
25
  get layoutField(): Field<Schema.EnumField<Schema.EnumField.Options<PanelLayout>>> | undefined;
26
+ get slotField(): Field<Schema.EnumField<Schema.EnumField.Options<SlotVariation>>> | undefined;
27
+ get slotOptions(): string[];
28
+ gotToNextSlot(): void;
26
29
  get layout(): BlockLayout | undefined;
27
30
  get events$(): import("rxjs").Observable<EventBus.Event<string, string>>;
28
31
  get valid(): boolean;
@@ -94,6 +94,37 @@ class BlockConfiguration {
94
94
  get layoutField() {
95
95
  return this._editableFields.find(field => field.id === 'layout');
96
96
  }
97
+ get slotField() {
98
+ return this._editableFields.find(field => field.id === 'slotVariation');
99
+ }
100
+ get slotOptions() {
101
+ const slotField = this.slotField;
102
+ return slotField ? Object.keys(slotField.schema.options) : [];
103
+ }
104
+ gotToNextSlot() {
105
+ var _a;
106
+ // get the slot field and skip if the field doesn't exist
107
+ const slotField = this.slotField;
108
+ if (!slotField) {
109
+ return;
110
+ }
111
+ // get the current slot value and skip if no value found (should not happen)
112
+ const currentValue = (_a = slotField.value) === null || _a === void 0 ? void 0 : _a.value;
113
+ if (!currentValue) {
114
+ return;
115
+ }
116
+ // get all the available slot options
117
+ const options = this.slotOptions;
118
+ // compute the next index and account for being out of bound
119
+ let nextIndex = options.indexOf(currentValue) + 1;
120
+ if (nextIndex > options.length - 1) {
121
+ nextIndex = 0;
122
+ }
123
+ // get the next slot value
124
+ const nextSlot = options[nextIndex];
125
+ // update the slot
126
+ slotField.value = funnel_core_1.Schema.EnumField.Value.toData(nextSlot);
127
+ }
97
128
  get layout() {
98
129
  return this._layout;
99
130
  }
@@ -104,7 +135,13 @@ class BlockConfiguration {
104
135
  return this.editableFields.every(field => field.valid);
105
136
  }
106
137
  get modified() {
107
- return !funnel_core_1.Value.equals(this.fields.filter(field => field.hasValue).map(field => field.value), this.editableFields.map(field => field.value));
138
+ const original = this.fields
139
+ .filter(field => field.hasValue)
140
+ .map(field => field.value);
141
+ const updated = this.editableFields
142
+ .filter(field => field.hasValue)
143
+ .map(field => field.value);
144
+ return !funnel_core_1.Value.equals(original, updated);
108
145
  }
109
146
  getField(fieldId) {
110
147
  // return field or throw
@@ -9,8 +9,7 @@ const LegacyBlockConfigEditor_1 = require("./LegacyBlockConfigEditor");
9
9
  // component
10
10
  function BlockConfig({ className, block: blockOrSectionBlock }) {
11
11
  // bind ref
12
- const editorRef = (0, react_1.useRef)(null);
13
- const legacyEditorRef = (0, react_1.useRef)(null);
12
+ const [configuration, setConfiguration] = (0, react_1.useState)();
14
13
  // skip if there's no config
15
14
  const block = blockOrSectionBlock instanceof core_1.SectionBlock
16
15
  ? blockOrSectionBlock.block
@@ -19,25 +18,11 @@ function BlockConfig({ className, block: blockOrSectionBlock }) {
19
18
  if (config.length === 0) {
20
19
  return undefined;
21
20
  }
22
- // helpers
23
- const onEdit = async (event) => {
24
- var _a, _b;
25
- // use new configurator (if enabled)
26
- if (process.env.NEXT_PUBLIC_EDITOR_BLOCK_CONFIG === 'experimental') {
27
- await ((_a = editorRef.current) === null || _a === void 0 ? void 0 : _a.edit({
28
- block: blockOrSectionBlock,
29
- anchor: event.currentTarget
30
- }));
31
- }
32
- // or use legacy version
33
- else {
34
- await ((_b = legacyEditorRef.current) === null || _b === void 0 ? void 0 : _b.edit({
35
- block: blockOrSectionBlock,
36
- anchor: event.currentTarget
37
- }));
38
- }
39
- };
40
21
  // render
41
22
  const valid = config.every(field => field.valid);
42
- return ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)(core_1.StatusChip, { className: className, variant: valid ? 'success' : 'error', onClick: onEdit, children: "Configure" }), (0, jsx_runtime_1.jsx)(BlockConfigEditor_1.BlockConfigEditor, { ref: editorRef }), (0, jsx_runtime_1.jsx)(LegacyBlockConfigEditor_1.LegacyBlockConfigEditor, { ref: legacyEditorRef })] }));
23
+ return ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)(core_1.StatusChip, { className: className, variant: valid ? 'success' : 'error', onClick: () => setConfiguration(block.getConfiguration()), children: "Configure" }), process.env.NEXT_PUBLIC_EDITOR_BLOCK_CONFIG === 'experimental'
24
+ ?
25
+ (0, jsx_runtime_1.jsx)(BlockConfigEditor_1.BlockConfigEditor, { configuration: configuration, onClose: () => setConfiguration(undefined) })
26
+ :
27
+ (0, jsx_runtime_1.jsx)(LegacyBlockConfigEditor_1.LegacyBlockConfigEditor, { configuration: configuration, onClose: () => setConfiguration(undefined) })] }));
43
28
  }
@@ -1,13 +1,9 @@
1
- import { Rect } from '@nascentdigital/funnel-core';
2
- import { Block, SectionBlock } from '../../../core';
3
- export declare const BlockConfigEditor: import("react").ForwardRefExoticComponent<import("react").RefAttributes<BlockConfigEditor.Ref>>;
1
+ import { Callback } from '@nascentdigital/funnel-core';
2
+ import { BlockConfiguration } from '../../../core';
3
+ export declare function BlockConfigEditor({ configuration, onClose }: BlockConfigEditor.Props): import("react/jsx-runtime").JSX.Element;
4
4
  export declare namespace BlockConfigEditor {
5
- type Props = {};
6
- interface Ref {
7
- edit(options: Options): Promise<void>;
8
- }
9
- type Options = {
10
- block: Block | SectionBlock;
11
- anchor: HTMLElement | Rect;
5
+ type Props = {
6
+ configuration?: BlockConfiguration;
7
+ onClose: Callback.Void;
12
8
  };
13
9
  }
@@ -1,9 +1,8 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.BlockConfigEditor = void 0;
3
+ exports.BlockConfigEditor = BlockConfigEditor;
4
4
  const jsx_runtime_1 = require("react/jsx-runtime");
5
5
  const funnel_core_1 = require("@nascentdigital/funnel-core");
6
- const client_1 = require("@nascentdigital/funnel-ui/client");
7
6
  const react_1 = require("motion/react");
8
7
  const react_2 = require("react");
9
8
  const rxjs_1 = require("rxjs");
@@ -11,53 +10,30 @@ const core_1 = require("../../../core");
11
10
  const hooks_1 = require("../../hooks");
12
11
  const BlockPreview_1 = require("./BlockPreview");
13
12
  // editor
14
- exports.BlockConfigEditor = (0, react_2.forwardRef)(function BlockConfigEditor(_, ref) {
13
+ function BlockConfigEditor({ configuration, onClose }) {
14
+ var _a;
15
15
  // bind state + hooks
16
- const [deferral, setDeferral] = (0, react_2.useState)(undefined);
17
- const [configuration, setConfiguration] = (0, react_2.useState)();
18
- const [anchor, setAnchor] = (0, react_2.useState)();
19
16
  const [blockView, setBlockView] = (0, react_2.useState)('desktop');
20
17
  const pageController = (0, hooks_1.usePageController)();
21
- const touch = (0, client_1.useTouch)();
22
18
  const panelLayoutPickerRef = (0, react_2.useRef)(null);
23
19
  const { modified = false, valid = false, blocksFields = [], desktopFields = [], mobileFields = [] } = configuration !== null && configuration !== void 0 ? configuration : {};
24
20
  const settingsFields = blockView === 'desktop' ? desktopFields : mobileFields;
25
21
  // sync w/ configuration
26
22
  (0, core_1.useBlockConfiguration)(configuration);
27
- // bind ref
28
- (0, react_2.useImperativeHandle)(ref, () => ({
29
- edit: async ({ block, anchor }) => {
30
- // reset state
31
- setConfiguration(block.getConfiguration());
32
- setAnchor(anchor);
23
+ // reset to desktop when open
24
+ (0, react_2.useEffect)(() => {
25
+ if (configuration) {
33
26
  setBlockView('desktop');
34
- // create deferral
35
- const deferral = new funnel_core_1.Deferral();
36
- setDeferral(deferral);
37
- // wait until deferral is resolved
38
- return deferral.promise;
39
27
  }
40
- }), []);
28
+ }, [configuration]);
41
29
  // helpers
42
30
  const onSave = async () => {
43
31
  // save config
44
32
  configuration === null || configuration === void 0 ? void 0 : configuration.save();
45
33
  // wait for page to save
46
34
  await (0, rxjs_1.firstValueFrom)(pageController.saved$);
47
- // complete (we're done)
48
- deferral === null || deferral === void 0 ? void 0 : deferral.resolve();
49
- // refresh
50
- touch();
51
- };
52
- const onCancel = () => {
53
- // skip if missing or already completed
54
- if (!deferral || deferral.isComplete) {
55
- return;
56
- }
57
- // cancel
58
- deferral.resolve(undefined);
59
- // touch
60
- touch();
35
+ // complete
36
+ onClose();
61
37
  };
62
38
  const onChangePanelLayout = async (e) => {
63
39
  var _a;
@@ -83,23 +59,44 @@ exports.BlockConfigEditor = (0, react_2.forwardRef)(function BlockConfigEditor(_
83
59
  layoutField.value = funnel_core_1.Schema.EnumField.Value.toData(selectedLayout);
84
60
  }
85
61
  };
86
- // skip if there's no config
87
- if (!configuration) {
88
- return null;
89
- }
90
62
  // render
91
- return ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsxs)(core_1.MiniEditor, { className: "w-[550px] max-w-full", title: "Block Configuration", open: !!deferral && !deferral.isComplete, anchor: anchor, anchorOffset: 4, onSave: onSave, onClose: onCancel, disableSave: !modified || !valid, customActions: (0, jsx_runtime_1.jsx)(core_1.Button, { variant: "secondary", size: "sm", disabled: configuration.isConfigInDefault, onClick: () => configuration.reset(), children: "Reset to Default" }), wide: true, children: [(0, jsx_runtime_1.jsxs)("section", { className: "flex items-center gap-l4", children: [(0, jsx_runtime_1.jsx)("span", { className: "label-sm text-content-primary flex-1", children: "Layout" }), (0, jsx_runtime_1.jsx)(core_1.Button, { variant: "secondary", size: "sm", iconLeft: "ArrowLeftRight", children: "Rearrange" }), (0, jsx_runtime_1.jsx)(core_1.Button, { variant: "secondary", size: "sm", iconLeft: "LayoutTemplate", onClick: onChangePanelLayout, children: "Change" })] }), blocksFields.length > 0 &&
92
- (0, jsx_runtime_1.jsx)("section", { className: "grid grid-cols-2 auto-rows-auto items-start gap-l6", children: (0, jsx_runtime_1.jsx)(core_1.FieldErrorController, { children: blocksFields.map(field => (0, jsx_runtime_1.jsx)(core_1.FieldEditor, { className: "col-span-2", field: field, variant: "wide" }, field.id)) }) }), (0, jsx_runtime_1.jsx)(core_1.Tabs, { items: blockViews, selectedItem: blockView, onSelect: setBlockView }), (0, jsx_runtime_1.jsx)("section", { className: "stacked p-l6 bg-surface1 rounded-md", children: (0, jsx_runtime_1.jsx)(react_1.AnimatePresence, { children: (0, jsx_runtime_1.jsx)(core_1.Animate, { effect: "fade", present: true, children: (0, jsx_runtime_1.jsx)(BlockPreview_1.BlockPreview, { variant: blockView, configuration: configuration }) }, blockView) }) }), settingsFields.length > 0 &&
93
- (0, jsx_runtime_1.jsx)("section", { className: "grid grid-cols-2 auto-rows-auto items-start gap-l6", children: (0, jsx_runtime_1.jsx)(core_1.FieldErrorController, { children: settingsFields.map(field => (0, jsx_runtime_1.jsx)(core_1.FieldEditor, { className: "col-span-2", field: field, variant: "wide" }, field.id)) }) }), (0, jsx_runtime_1.jsx)("hr", { className: "divider border-border-l1" })] }), (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) })] }));
94
- });
63
+ return ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)(core_1.SideSheet, { size: "xs", title: "Block Configuration", backdrop: "glass", open: !!configuration, onSave: onSave, onClose: onClose, disableDismiss: modified, disableSave: !modified || !valid, customActions: (0, jsx_runtime_1.jsx)(core_1.Button, { variant: "secondary", size: "sm", disabled: configuration === null || configuration === void 0 ? void 0 : configuration.isConfigInDefault, onClick: () => configuration === null || configuration === void 0 ? void 0 : configuration.reset(), children: "Reset to Default" }), children: (0, jsx_runtime_1.jsxs)("div", { className: "h-full flex flex-col gap-l9 p-l8", children: [(0, jsx_runtime_1.jsxs)("section", { className: "flex items-center gap-l4", children: [(0, jsx_runtime_1.jsx)("span", { className: "label-sm text-content-primary flex-1", children: "Layout" }), ((_a = configuration === null || configuration === void 0 ? void 0 : configuration.slotOptions) !== null && _a !== void 0 ? _a : []).length > 1 &&
64
+ (0, jsx_runtime_1.jsx)(core_1.Button, { variant: "secondary", size: "sm", iconLeft: "ArrowLeftRight", onClick: () => configuration === null || configuration === void 0 ? void 0 : configuration.gotToNextSlot(), children: "Rearrange" }), (0, jsx_runtime_1.jsx)(core_1.Button, { variant: "secondary", size: "sm", iconLeft: "LayoutTemplate", onClick: onChangePanelLayout, children: "Change" })] }), blocksFields.length > 0 &&
65
+ (0, jsx_runtime_1.jsx)("section", { className: "grid grid-cols-2 auto-rows-auto items-start gap-l6", children: (0, jsx_runtime_1.jsx)(core_1.FieldErrorController, { children: blocksFields.map(field => (0, jsx_runtime_1.jsx)(core_1.FieldEditor, { className: "col-span-2", field: field, variant: "wide" }, field.id)) }) }), (0, jsx_runtime_1.jsx)(core_1.Tabs, { items: blockViews, selectedItem: blockView, onSelect: setBlockView }), (0, jsx_runtime_1.jsx)("section", { className: "stacked p-l6 bg-surface1 rounded-md", children: (0, jsx_runtime_1.jsx)(react_1.AnimatePresence, { children: (0, jsx_runtime_1.jsx)(core_1.Animate, { effect: "fade", present: true, children: (0, jsx_runtime_1.jsx)(BlockPreview_1.BlockPreview, { variant: blockView, configuration: configuration }) }, blockView) }) }), settingsFields.length > 0 &&
66
+ (0, jsx_runtime_1.jsx)("section", { className: "grid grid-cols-2 auto-rows-auto items-start gap-l6", children: (0, jsx_runtime_1.jsx)(core_1.FieldErrorController, { children: settingsFields.map(field => (0, jsx_runtime_1.jsx)(core_1.FieldEditor, { className: "col-span-2", field: field, variant: "wide" }, 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) })] }));
67
+ }
95
68
  function renderPanelLayoutItem(item) {
96
69
  switch (item.id) {
97
- case 'stack.h':
98
- return ((0, jsx_runtime_1.jsx)("div", { children: "Stack H" }));
70
+ case 'solo':
71
+ return ((0, jsx_runtime_1.jsx)("div", { className: "p-l6 size-full", children: (0, jsx_runtime_1.jsx)("div", { className: "size-full bg-surface2" }) }));
99
72
  case 'stack.v':
100
- return ((0, jsx_runtime_1.jsx)("div", { children: "Stack V" }));
73
+ return ((0, jsx_runtime_1.jsxs)("div", { className: "p-l6 flex flex-col gap-l2 h-full", children: [(0, jsx_runtime_1.jsx)("div", { className: "flex-1 bg-surface2" }), (0, jsx_runtime_1.jsx)("div", { className: "flex-1 bg-surface2" })] }));
74
+ case 'stack.h':
75
+ return ((0, jsx_runtime_1.jsxs)("div", { className: "p-l6 flex gap-l2 h-full", children: [(0, jsx_runtime_1.jsx)("div", { className: "flex-1 bg-surface2" }), (0, jsx_runtime_1.jsx)("div", { className: "flex-1 bg-surface2" })] }));
76
+ case 'brick.v':
77
+ return ((0, jsx_runtime_1.jsxs)("div", { className: "p-l6 flex flex-col gap-l2 h-full", children: [(0, jsx_runtime_1.jsx)("div", { className: "flex-1 bg-surface2" }), (0, jsx_runtime_1.jsx)("div", { className: "flex-1 bg-surface2" }), (0, jsx_runtime_1.jsx)("div", { className: "flex-1 bg-surface2" })] }));
78
+ case 'brick.t':
79
+ return ((0, jsx_runtime_1.jsxs)("div", { className: "p-l6 flex flex-col gap-l2 h-full", children: [(0, jsx_runtime_1.jsx)("div", { className: "h-[20px] w-full bg-surface2" }), (0, jsx_runtime_1.jsxs)("div", { className: "flex gap-l2 flex-1", children: [(0, jsx_runtime_1.jsx)("div", { className: "flex-1 bg-surface2" }), (0, jsx_runtime_1.jsx)("div", { className: "flex-1 bg-surface2" })] })] }));
80
+ case 'brick.r':
81
+ return ((0, jsx_runtime_1.jsxs)("div", { className: "p-l6 flex gap-l2 h-full", children: [(0, jsx_runtime_1.jsxs)("div", { className: "flex flex-col flex-1 gap-l2 h-full", children: [(0, jsx_runtime_1.jsx)("div", { className: "flex-1 bg-surface2" }), (0, jsx_runtime_1.jsx)("div", { className: "flex-1 bg-surface2" })] }), (0, jsx_runtime_1.jsx)("div", { className: "h-full w-[30px] bg-surface2" })] }));
82
+ case 'brick.b':
83
+ return ((0, jsx_runtime_1.jsxs)("div", { className: "p-l6 flex flex-col gap-l2 h-full", children: [(0, jsx_runtime_1.jsxs)("div", { className: "flex gap-l2 flex-1", children: [(0, jsx_runtime_1.jsx)("div", { className: "flex-1 bg-surface2" }), (0, jsx_runtime_1.jsx)("div", { className: "flex-1 bg-surface2" })] }), (0, jsx_runtime_1.jsx)("div", { className: "h-[20px] w-full bg-surface2" })] }));
84
+ case 'brick.l':
85
+ return ((0, jsx_runtime_1.jsxs)("div", { className: "p-l6 flex gap-l2 h-full", children: [(0, jsx_runtime_1.jsx)("div", { className: "h-full w-[30px] bg-surface2" }), (0, jsx_runtime_1.jsxs)("div", { className: "flex flex-col flex-1 gap-l2 h-full", children: [(0, jsx_runtime_1.jsx)("div", { className: "flex-1 bg-surface2" }), (0, jsx_runtime_1.jsx)("div", { className: "flex-1 bg-surface2" })] })] }));
101
86
  case 'nested':
102
- return ((0, jsx_runtime_1.jsx)("div", { children: "Nested" }));
87
+ return ((0, jsx_runtime_1.jsx)("div", { className: "p-l6 size-full", children: (0, jsx_runtime_1.jsx)("div", { className: "px-l5 py-l3 flex h-full bg-surface2", children: (0, jsx_runtime_1.jsx)("div", { className: "bg-surface1" }) }) }));
88
+ case 'nested.v':
89
+ return ((0, jsx_runtime_1.jsx)("div", { className: "p-l6 w-full h-full", children: (0, jsx_runtime_1.jsxs)("div", { className: "px-l5 py-l3 flex flex-col gap-l2 h-full bg-surface2", children: [(0, jsx_runtime_1.jsx)("div", { className: "flex-1 bg-surface1" }), (0, jsx_runtime_1.jsx)("div", { className: "flex-1 bg-surface1" })] }) }));
90
+ case 'nested.h':
91
+ return ((0, jsx_runtime_1.jsx)("div", { className: "p-l6 w-full h-full", children: (0, jsx_runtime_1.jsxs)("div", { className: "px-l5 py-l3 flex gap-l2 h-full bg-surface2", children: [(0, jsx_runtime_1.jsx)("div", { className: "flex-1 bg-surface1" }), (0, jsx_runtime_1.jsx)("div", { className: "flex-1 bg-surface1" })] }) }));
92
+ case 'nested.t':
93
+ return ((0, jsx_runtime_1.jsxs)("div", { className: "p-l6 flex flex-col gap-l2 h-full", children: [(0, jsx_runtime_1.jsx)("div", { className: "flex-1 p-l2 bg-surface2", children: (0, jsx_runtime_1.jsx)("div", { className: "h-full w-7/12 bg-surface1" }) }), (0, jsx_runtime_1.jsx)("div", { className: "flex-1 p-l2 bg-surface2" })] }));
94
+ case 'nested.r':
95
+ return ((0, jsx_runtime_1.jsxs)("div", { className: "p-l6 flex gap-l2 h-full", children: [(0, jsx_runtime_1.jsx)("div", { className: "flex-1 p-l2 bg-surface2" }), (0, jsx_runtime_1.jsx)("div", { className: "flex-1 flex flex-col p-l2 bg-surface2", children: (0, jsx_runtime_1.jsx)("div", { className: "h-[60%] w-full bg-surface1" }) })] }));
96
+ case 'nested.b':
97
+ return ((0, jsx_runtime_1.jsxs)("div", { className: "p-l6 flex flex-col gap-l2 h-full", children: [(0, jsx_runtime_1.jsx)("div", { className: "flex-1 p-l2 bg-surface2" }), (0, jsx_runtime_1.jsx)("div", { className: "flex-1 p-l2 bg-surface2", children: (0, jsx_runtime_1.jsx)("div", { className: "h-full w-7/12 bg-surface1" }) })] }));
98
+ case 'nested.l':
99
+ return ((0, jsx_runtime_1.jsxs)("div", { className: "p-l6 flex gap-l2 h-full", children: [(0, jsx_runtime_1.jsx)("div", { className: "flex-1 flex flex-col p-l2 bg-surface2", children: (0, jsx_runtime_1.jsx)("div", { className: "h-[60%] w-full bg-surface1" }) }), (0, jsx_runtime_1.jsx)("div", { className: "flex-1 p-l2 bg-surface2" })] }));
103
100
  default:
104
101
  return ((0, jsx_runtime_1.jsx)("div", { children: item.id }));
105
102
  }
@@ -5,6 +5,6 @@ export declare namespace BlockPreview {
5
5
  type Props = {
6
6
  className?: string;
7
7
  variant: Variant;
8
- configuration: BlockConfiguration;
8
+ configuration?: BlockConfiguration;
9
9
  };
10
10
  }
@@ -23,7 +23,7 @@ const core_1 = require("../../../core");
23
23
  // component
24
24
  function BlockPreview({ className, variant, configuration }) {
25
25
  // determine active panels
26
- const { layout } = configuration;
26
+ const { layout } = configuration !== null && configuration !== void 0 ? configuration : {};
27
27
  // sync configuration
28
28
  (0, core_1.useBlockConfiguration)(configuration);
29
29
  // helpers
@@ -1,13 +1,9 @@
1
- import { Rect } from '@nascentdigital/funnel-core';
2
- import { Block, SectionBlock } from '../../../core';
3
- export declare const LegacyBlockConfigEditor: import("react").ForwardRefExoticComponent<import("react").RefAttributes<LegacyBlockConfigEditor.Ref>>;
1
+ import { Callback } from '@nascentdigital/funnel-core';
2
+ import { BlockConfiguration } from '../../../core';
3
+ export declare function LegacyBlockConfigEditor({ configuration, onClose }: LegacyBlockConfigEditor.Props): import("react/jsx-runtime").JSX.Element;
4
4
  export declare namespace LegacyBlockConfigEditor {
5
- type Props = {};
6
- interface Ref {
7
- edit(options: Options): Promise<void>;
8
- }
9
- type Options = {
10
- block: Block | SectionBlock;
11
- anchor: HTMLElement | Rect;
5
+ type Props = {
6
+ configuration?: BlockConfiguration;
7
+ onClose: Callback.Void;
12
8
  };
13
9
  }
@@ -1,63 +1,27 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.LegacyBlockConfigEditor = void 0;
3
+ exports.LegacyBlockConfigEditor = LegacyBlockConfigEditor;
4
4
  const jsx_runtime_1 = require("react/jsx-runtime");
5
- const funnel_core_1 = require("@nascentdigital/funnel-core");
6
- const client_1 = require("@nascentdigital/funnel-ui/client");
7
- const react_1 = require("react");
8
5
  const rxjs_1 = require("rxjs");
9
6
  const core_1 = require("../../../core");
10
7
  const hooks_1 = require("../../hooks");
11
8
  // editor
12
- exports.LegacyBlockConfigEditor = (0, react_1.forwardRef)(function LegacyBlockConfigEditor(_, ref) {
9
+ function LegacyBlockConfigEditor({ configuration, onClose }) {
13
10
  // bind state + hooks
14
- const [deferral, setDeferral] = (0, react_1.useState)(undefined);
15
- const [configuration, setConfiguration] = (0, react_1.useState)();
16
- const [anchor, setAnchor] = (0, react_1.useState)();
17
11
  const pageController = (0, hooks_1.usePageController)();
18
- const touch = (0, client_1.useTouch)();
19
12
  const { modified = false, valid = false } = configuration !== null && configuration !== void 0 ? configuration : {};
20
13
  // sync w/ configuration
21
14
  (0, core_1.useBlockConfiguration)(configuration);
22
- // bind ref
23
- (0, react_1.useImperativeHandle)(ref, () => ({
24
- edit: async ({ block, anchor }) => {
25
- // reset state
26
- setConfiguration(block.getConfiguration());
27
- setAnchor(anchor);
28
- // create deferral
29
- const deferral = new funnel_core_1.Deferral();
30
- setDeferral(deferral);
31
- // wait until deferral is resolved
32
- return deferral.promise;
33
- }
34
- }), []);
35
15
  // helpers
36
16
  const onSave = async () => {
37
17
  // save config
38
18
  configuration === null || configuration === void 0 ? void 0 : configuration.save();
39
19
  // wait for page to save
40
20
  await (0, rxjs_1.firstValueFrom)(pageController.saved$);
41
- // complete (we're done)
42
- deferral === null || deferral === void 0 ? void 0 : deferral.resolve();
43
- // refresh
44
- touch();
21
+ // complete
22
+ onClose();
45
23
  };
46
- const onCancel = () => {
47
- // skip if missing or already completed
48
- if (!deferral || deferral.isComplete) {
49
- return;
50
- }
51
- // cancel
52
- deferral.resolve(undefined);
53
- // touch
54
- touch();
55
- };
56
- // skip if there's no config
57
- if (!configuration) {
58
- return null;
59
- }
60
24
  // render
61
- const { layout } = configuration;
62
- return ((0, jsx_runtime_1.jsx)(core_1.MiniEditor, { title: "Block Configuration", open: !!deferral && !deferral.isComplete, anchor: anchor, anchorOffset: 4, onSave: onSave, onClose: onCancel, disableSave: !modified || !valid, customActions: (0, jsx_runtime_1.jsx)(core_1.Button, { variant: "secondary", size: "sm", disabled: configuration.isConfigInDefault, onClick: () => configuration.reset(), children: "Reset to Default" }), wide: true, children: (0, jsx_runtime_1.jsxs)("div", { className: "flex justify-start items-start gap-l9", children: [(0, jsx_runtime_1.jsxs)("section", { className: "flex flex-col items-start gap-l8", children: [(0, jsx_runtime_1.jsx)(core_1.SkeletonLayout, { variant: "desktop", layout: layout }), (0, jsx_runtime_1.jsx)(core_1.SkeletonLayout, { variant: "mobile", layout: layout })] }), (0, jsx_runtime_1.jsx)("div", { className: "grid grid-cols-[max-content_1fr] auto-rows-auto items-start gap-l6", children: (0, jsx_runtime_1.jsx)(core_1.FieldErrorController, { children: configuration.editableFields.map(field => (0, jsx_runtime_1.jsx)(core_1.FieldEditor, { className: "col-span-2", field: field, variant: "wide" }, field.id)) }) })] }) }));
63
- });
25
+ const { layout } = configuration !== null && configuration !== void 0 ? configuration : {};
26
+ return ((0, jsx_runtime_1.jsx)(core_1.SideSheet, { size: "lg", title: "Block Configuration", backdrop: "glass", open: !!configuration, onSave: onSave, onClose: onClose, disableSave: !modified || !valid, customActions: (0, jsx_runtime_1.jsx)(core_1.Button, { variant: "secondary", size: "sm", disabled: configuration === null || configuration === void 0 ? void 0 : configuration.isConfigInDefault, onClick: () => configuration === null || configuration === void 0 ? void 0 : configuration.reset(), children: "Reset to Default" }), children: (0, jsx_runtime_1.jsxs)("div", { className: "h-full flex flex-col gap-l9 p-l8", children: [(0, jsx_runtime_1.jsxs)("section", { className: "flex flex-wrap justify-center items-start gap-l8", children: [(0, jsx_runtime_1.jsx)(core_1.SkeletonLayout, { variant: "desktop", layout: layout }), (0, jsx_runtime_1.jsx)(core_1.SkeletonLayout, { variant: "mobile", layout: layout })] }), (0, jsx_runtime_1.jsx)("div", { className: "grid grid-cols-[max-content_1fr] auto-rows-auto items-start gap-l6", children: (0, jsx_runtime_1.jsx)(core_1.FieldErrorController, { children: configuration === null || configuration === void 0 ? void 0 : configuration.editableFields.map(field => (0, jsx_runtime_1.jsx)(core_1.FieldEditor, { className: "col-span-2", field: field, variant: "wide" }, field.id)) }) })] }) }));
27
+ }
@@ -580,10 +580,10 @@ video {
580
580
  --color-ix-disabled-content : 156 163 176;
581
581
 
582
582
  --color-glass: 156 163 176;
583
- --color-glass-fill-l1: rgba(226, 232, 240, 0.5);
584
- --color-glass-fill-l2: rgba(255, 255, 255, 0.75);
585
- --color-glass-stroke-l1: rgba(255, 255, 255, 1);
586
- --color-glass-stroke-l2: rgba(226, 232, 240, 1);
583
+ --color-glass-fill-l1: 203 213 224;
584
+ --color-glass-fill-l2: 226 232 240;
585
+ --color-glass-stroke-l1: 156 163 176;
586
+ --color-glass-stroke-l2: 156 163 176;
587
587
 
588
588
  --color-destructive-content: 255 84 84;
589
589
  --color-destructive: 255 94 94;
@@ -634,10 +634,10 @@ video {
634
634
  --color-ix-disabled-content : 156 163 176 !important;
635
635
 
636
636
  --color-glass: 26 32 44 !important;
637
- --color-glass-fill-l1: rgba(0, 0, 0, 0.1) !important;
638
- --color-glass-fill-l2: rgba(117, 119, 130, 0.25) !important;
639
- --color-glass-stroke-l1: rgba(117, 119, 130, 1) !important;
640
- --color-glass-stroke-l2: rgba(30, 29, 44, 1) !important;
637
+ --color-glass-fill-l1: 0 0 0 !important;
638
+ --color-glass-fill-l2: 26 32 44 !important;
639
+ --color-glass-stroke-l1: 117 119 130 !important;
640
+ --color-glass-stroke-l2: 30 29 44 !important;
641
641
 
642
642
  --color-destructive-content: 255 84 84 !important;
643
643
  --color-destructive: 255 94 94 !important;
@@ -688,10 +688,10 @@ video {
688
688
  --color-ix-disabled-content : 156 163 176;
689
689
 
690
690
  --color-glass: 26 32 44;
691
- --color-glass-fill-l1: rgba(0, 0, 0, 0.1);
692
- --color-glass-fill-l2: rgba(117, 119, 130, 0.25);
693
- --color-glass-stroke-l1: rgba(117, 119, 130, 1);
694
- --color-glass-stroke-l2: rgba(30, 29, 44, 1);
691
+ --color-glass-fill-l1: 0 0 0;
692
+ --color-glass-fill-l2: 26 32 44;
693
+ --color-glass-stroke-l1: 117 119 130;
694
+ --color-glass-stroke-l2: 30 29 44;
695
695
 
696
696
  --color-destructive-content: 255 84 84;
697
697
  --color-destructive: 255 94 94;
@@ -940,7 +940,7 @@ video {
940
940
  border-bottom-left-radius: 8px;
941
941
  }
942
942
  .react-datepicker-popper{
943
- z-index: 140;
943
+ z-index: 150;
944
944
  }
945
945
  .react-datepicker__header{
946
946
  position: relative;
@@ -2047,24 +2047,6 @@ video {
2047
2047
  font-weight: 400;
2048
2048
  line-height: 1.5;
2049
2049
  }
2050
- .Backdrop-root{
2051
- position: fixed;
2052
- inset: 0px;
2053
- background-color: rgb(var(--color-glass) / .8);
2054
- --tw-backdrop-blur: blur(9px);
2055
- backdrop-filter: var(--tw-backdrop-blur) var(--tw-backdrop-brightness) var(--tw-backdrop-contrast) var(--tw-backdrop-grayscale) var(--tw-backdrop-hue-rotate) var(--tw-backdrop-invert) var(--tw-backdrop-opacity) var(--tw-backdrop-saturate) var(--tw-backdrop-sepia);
2056
- will-change: backdrop-filter;
2057
- }
2058
- /* vertical stacking */
2059
- .Backdrop-root.Backdrop-l1{
2060
- z-index: 100;
2061
- }
2062
- .Backdrop-root.Backdrop-l2{
2063
- z-index: 200;
2064
- }
2065
- .Backdrop-root.Backdrop-l3{
2066
- z-index: 300;
2067
- }
2068
2050
  .button{
2069
2051
  flex-shrink: 0;
2070
2052
  cursor: pointer;
@@ -3587,12 +3569,19 @@ video {
3587
3569
  --tw-backdrop-blur: blur(10px);
3588
3570
  backdrop-filter: var(--tw-backdrop-blur) var(--tw-backdrop-brightness) var(--tw-backdrop-contrast) var(--tw-backdrop-grayscale) var(--tw-backdrop-hue-rotate) var(--tw-backdrop-invert) var(--tw-backdrop-opacity) var(--tw-backdrop-saturate) var(--tw-backdrop-sepia);
3589
3571
  background-image: linear-gradient(to bottom, var(--tw-gradient-stops));
3590
- --tw-gradient-from: var(--color-glass-fill-l2) var(--tw-gradient-from-position);
3591
- --tw-gradient-to: rgb(255 255 255 / 0) var(--tw-gradient-to-position);
3572
+ --tw-gradient-from: rgb(var(--color-glass-fill-l2) / .5) var(--tw-gradient-from-position);
3573
+ --tw-gradient-to: rgb(var(--color-glass-fill-l2) / 0) var(--tw-gradient-to-position);
3592
3574
  --tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to);
3593
- --tw-gradient-to: var(--color-glass-fill-l1) var(--tw-gradient-to-position);
3575
+ --tw-gradient-from-position: 0%;
3576
+ --tw-gradient-to: rgb(var(--color-glass-fill-l1) / .5) var(--tw-gradient-to-position);
3594
3577
  --tw-gradient-to-position: 75%;
3595
3578
  }
3579
+ @media (prefers-color-scheme: dark){
3580
+
3581
+ .glass-overlay{
3582
+ --tw-gradient-to: rgb(var(--color-glass-fill-l1) / .01) var(--tw-gradient-to-position);
3583
+ }
3584
+ }
3596
3585
  .Picker-root{
3597
3586
  margin-left: auto;
3598
3587
  margin-right: auto;
@@ -4292,11 +4281,8 @@ video {
4292
4281
  .z-backdrop{
4293
4282
  z-index: 100;
4294
4283
  }
4295
- .z-backdrop-l1{
4296
- z-index: 100;
4297
- }
4298
4284
  .z-dialog{
4299
- z-index: 130;
4285
+ z-index: 140;
4300
4286
  }
4301
4287
  .z-header{
4302
4288
  z-index: 120;
@@ -4305,10 +4291,10 @@ video {
4305
4291
  z-index: 10;
4306
4292
  }
4307
4293
  .z-popup{
4308
- z-index: 140;
4294
+ z-index: 150;
4309
4295
  }
4310
- .z-popup-l1{
4311
- z-index: 140;
4296
+ .z-sheet{
4297
+ z-index: 130;
4312
4298
  }
4313
4299
  .z-splash{
4314
4300
  z-index: 199;
@@ -4507,6 +4493,10 @@ video {
4507
4493
  width: 20px;
4508
4494
  height: 20px;
4509
4495
  }
4496
+ .size-full{
4497
+ width: 100%;
4498
+ height: 100%;
4499
+ }
4510
4500
  .h-10{
4511
4501
  height: 10px;
4512
4502
  }
@@ -4561,12 +4551,18 @@ video {
4561
4551
  .h-\[170px\]{
4562
4552
  height: 170px;
4563
4553
  }
4554
+ .h-\[20px\]{
4555
+ height: 20px;
4556
+ }
4564
4557
  .h-\[210px\]{
4565
4558
  height: 210px;
4566
4559
  }
4567
4560
  .h-\[400px\]{
4568
4561
  height: 400px;
4569
4562
  }
4563
+ .h-\[60\%\]{
4564
+ height: 60%;
4565
+ }
4570
4566
  .h-\[80px\]{
4571
4567
  height: 80px;
4572
4568
  }
@@ -4675,6 +4671,9 @@ video {
4675
4671
  .w-6{
4676
4672
  width: 6px;
4677
4673
  }
4674
+ .w-7\/12{
4675
+ width: 58.333333%;
4676
+ }
4678
4677
  .w-8\/12{
4679
4678
  width: 66.666667%;
4680
4679
  }
@@ -4702,6 +4701,9 @@ video {
4702
4701
  .w-\[220px\]{
4703
4702
  width: 220px;
4704
4703
  }
4704
+ .w-\[30px\]{
4705
+ width: 30px;
4706
+ }
4705
4707
  .w-\[330px\]{
4706
4708
  width: 330px;
4707
4709
  }
@@ -4711,9 +4713,6 @@ video {
4711
4713
  .w-\[50px\]{
4712
4714
  width: 50px;
4713
4715
  }
4714
- .w-\[550px\]{
4715
- width: 550px;
4716
- }
4717
4716
  .w-\[64px\]{
4718
4717
  width: 64px;
4719
4718
  }
@@ -4723,6 +4722,9 @@ video {
4723
4722
  .w-full{
4724
4723
  width: 100%;
4725
4724
  }
4725
+ .w-screen-sm{
4726
+ width: 600px;
4727
+ }
4726
4728
  .min-w-18{
4727
4729
  min-width: 18px;
4728
4730
  }
@@ -5099,7 +5101,11 @@ video {
5099
5101
  border-color: rgb(var(--color-draft) / .3);
5100
5102
  }
5101
5103
  .border-glass-stroke-l1{
5102
- border-color: var(--color-glass-stroke-l1);
5104
+ --tw-border-opacity: 1;
5105
+ border-color: rgb(var(--color-glass-stroke-l1) / var(--tw-border-opacity, 1));
5106
+ }
5107
+ .border-glass-stroke-l1\/tint5{
5108
+ border-color: rgb(var(--color-glass-stroke-l1) / .5);
5103
5109
  }
5104
5110
  .border-info-content{
5105
5111
  --tw-border-opacity: 1;
@@ -5176,7 +5182,8 @@ video {
5176
5182
  background-color: rgb(var(--color-draft) / .3);
5177
5183
  }
5178
5184
  .bg-glass-fill-l1{
5179
- background-color: var(--color-glass-fill-l1);
5185
+ --tw-bg-opacity: 1;
5186
+ background-color: rgb(var(--color-glass-fill-l1) / var(--tw-bg-opacity, 1));
5180
5187
  }
5181
5188
  .bg-glass\/backdrop{
5182
5189
  background-color: rgb(var(--color-glass) / .8);
@@ -5417,6 +5424,10 @@ video {
5417
5424
  padding-top: 72px;
5418
5425
  padding-bottom: 72px;
5419
5426
  }
5427
+ .py-l3{
5428
+ padding-top: 6px;
5429
+ padding-bottom: 6px;
5430
+ }
5420
5431
  .py-l4{
5421
5432
  padding-top: 8px;
5422
5433
  padding-bottom: 8px;
@@ -6195,6 +6206,33 @@ video {
6195
6206
  --tw-bg-opacity: 1;
6196
6207
  background-color: rgb(var(--color-ix-secondary) / var(--tw-bg-opacity, 1));
6197
6208
  }
6209
+ @media not all and (min-width: 768px){
6210
+
6211
+ .max-md\:inset-x-0{
6212
+ left: 0px;
6213
+ right: 0px;
6214
+ }
6215
+
6216
+ .max-md\:bottom-0{
6217
+ bottom: 0px;
6218
+ }
6219
+
6220
+ .max-md\:top-\[40px\]{
6221
+ top: 40px;
6222
+ }
6223
+
6224
+ .max-md\:rounded-tl-md{
6225
+ border-top-left-radius: 12px;
6226
+ }
6227
+
6228
+ .max-md\:rounded-tr-md{
6229
+ border-top-right-radius: 12px;
6230
+ }
6231
+
6232
+ .max-md\:border-t{
6233
+ border-top-width: 1px;
6234
+ }
6235
+ }
6198
6236
  @media (min-width: 480px){
6199
6237
 
6200
6238
  .sm\:w-4\/5{
@@ -6215,6 +6253,15 @@ video {
6215
6253
  }
6216
6254
  @media (min-width: 768px){
6217
6255
 
6256
+ .md\:inset-y-0{
6257
+ top: 0px;
6258
+ bottom: 0px;
6259
+ }
6260
+
6261
+ .md\:right-0{
6262
+ right: 0px;
6263
+ }
6264
+
6218
6265
  .md\:block{
6219
6266
  display: block;
6220
6267
  }
@@ -6231,10 +6278,38 @@ video {
6231
6278
  width: 280px;
6232
6279
  }
6233
6280
 
6281
+ .md\:w-\[320px\]{
6282
+ width: 320px;
6283
+ }
6284
+
6285
+ .md\:w-\[380px\]{
6286
+ width: 380px;
6287
+ }
6288
+
6289
+ .md\:w-\[480px\]{
6290
+ width: 480px;
6291
+ }
6292
+
6293
+ .md\:w-screen-sm{
6294
+ width: 600px;
6295
+ }
6296
+
6234
6297
  .md\:grid-cols-3{
6235
6298
  grid-template-columns: repeat(3, minmax(0, 1fr));
6236
6299
  }
6237
6300
 
6301
+ .md\:rounded-bl-md{
6302
+ border-bottom-left-radius: 12px;
6303
+ }
6304
+
6305
+ .md\:rounded-tl-md{
6306
+ border-top-left-radius: 12px;
6307
+ }
6308
+
6309
+ .md\:border-l{
6310
+ border-left-width: 1px;
6311
+ }
6312
+
6238
6313
  .md\:px-l10{
6239
6314
  padding-left: 40px;
6240
6315
  padding-right: 40px;
@@ -56,24 +56,13 @@ exports.EditorTailwindConfig = {
56
56
  l1: '2px', l2: '4px', l3: '6px', l4: '8px', l5: '12px', l6: '16px', l7: '20px', l8: '24px', l9: '32px', l10: '40px', l11: '48px', l12: '56px', l13: '64px', l14: '72px', l15: '80px', l16: '96px', l17: '120px', l18: '160px', l19: '180px', touchable: '40px', icon: '24px', 'body-sm': '18px' }),
57
57
  zIndex: {
58
58
  splash: '199',
59
- tooltip: '150',
60
- 'tooltip-l1': '150',
61
- 'tooltip-l2': '250',
62
- 'tooltip-l3': '350',
63
- popup: '140',
64
- 'popup-l1': '140',
65
- 'popup-l2': '240',
66
- 'popup-l3': '340',
67
- dialog: '130',
68
- 'dialog-l1': '130',
69
- 'dialog-l2': '230',
70
- 'dialog-l3': '330',
59
+ tooltip: '160',
60
+ popup: '150',
61
+ dialog: '140',
62
+ sheet: '130',
71
63
  header: '120',
72
64
  subheader: '110',
73
65
  backdrop: '100',
74
- 'backdrop-l1': '100',
75
- 'backdrop-l2': '200',
76
- 'backdrop-l3': '300',
77
66
  fab: '20',
78
67
  superoverlay: '11',
79
68
  overlay: '10',
@@ -129,6 +118,10 @@ exports.EditorTailwindConfig = {
129
118
  'ix-disabled-content': '--color-ix-disabled-content',
130
119
  // overlay
131
120
  glass: '--color-glass',
121
+ 'glass-fill-l1': '--color-glass-fill-l1',
122
+ 'glass-fill-l2': '--color-glass-fill-l2',
123
+ 'glass-stroke-l1': '--color-glass-stroke-l1',
124
+ 'glass-stroke-l2': '--color-glass-stroke-l2',
132
125
  // status
133
126
  'destructive-content': '--color-destructive-content',
134
127
  'destructive': '--color-destructive',
@@ -140,7 +133,7 @@ exports.EditorTailwindConfig = {
140
133
  'draft': '--color-draft',
141
134
  'info-content': '--color-info-content',
142
135
  'info': '--color-info'
143
- })), { inherit: 'inherit', current: 'currentColor', transparent: 'transparent', 'shadow1': 'var(--color-shadow1)', 'shadow2': 'var(--color-shadow2)', 'glass-fill-l1': 'var(--color-glass-fill-l1)', 'glass-fill-l2': 'var(--color-glass-fill-l2)', 'glass-stroke-l1': 'var(--color-glass-stroke-l1)', 'glass-stroke-l2': 'var(--color-glass-stroke-l2)' }),
136
+ })), { inherit: 'inherit', current: 'currentColor', transparent: 'transparent', 'shadow1': 'var(--color-shadow1)', 'shadow2': 'var(--color-shadow2)' }),
144
137
  opacity: {
145
138
  'tint0': '.05',
146
139
  'tint1': '.1',
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nascentdigital/funnel-editor",
3
- "version": "4.5.1",
3
+ "version": "4.5.3",
4
4
  "publishConfig": {
5
5
  "registry": "https://registry.npmjs.org/",
6
6
  "access": "restricted"
@@ -89,5 +89,5 @@
89
89
  "ts-jest": "^29",
90
90
  "type-fest": "^4"
91
91
  },
92
- "gitHead": "3348c90ff56f3dd931ab564f8a6ad13d454a4ca1"
92
+ "gitHead": "ef42bb5440cc23187aeefc29319875ed5402676f"
93
93
  }