@nascentdigital/funnel-editor 5.0.3 → 6.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/collection/hooks/CollectionController.d.ts +7 -2
- package/dist/collection/hooks/CollectionController.js +2 -2
- package/dist/collection/screens/CollectionEditor.js +5 -4
- package/dist/components.d.ts +2 -0
- package/dist/components.js +3 -0
- package/dist/core/components/interaction/Popup.js +23 -11
- package/dist/core/components/layout/InfoPanel.js +1 -1
- package/dist/core/components/visuals/Icon.d.ts +1 -1
- package/dist/core/components/visuals/Icon.js +3 -0
- package/dist/core/domain/IPage.d.ts +9 -14
- package/dist/core/domain/Page.d.ts +3 -5
- package/dist/core/domain/Page.js +8 -1
- package/dist/core/domain/PageRefStoreProxy.d.ts +4 -6
- package/dist/core/domain/PageRefStoreProxy.js +16 -50
- package/dist/core/domain/PageStatus.d.ts +28 -0
- package/dist/core/domain/PageStatus.js +2 -0
- package/dist/core/domain/PageSummary.js +2 -2
- package/dist/core/domain/Pages.js +0 -2
- package/dist/core/domain/Section.js +2 -2
- package/dist/core/domain/index.d.ts +1 -0
- package/dist/core/domain/index.js +1 -0
- package/dist/core/repository/IPageRepository.d.ts +5 -0
- package/dist/core/repository/PageRepository.d.ts +1 -0
- package/dist/core/repository/PageRepository.js +13 -4
- package/dist/explore/components/CreateCollectionDialog.js +1 -1
- package/dist/page/hooks/PageController.d.ts +3 -3
- package/dist/page/hooks/PageController.js +2 -2
- package/dist/page/screens/PageEditor.js +4 -4
- package/dist/styles/index.css +14 -18
- package/dist/styles/tailwind.js +1 -1
- package/package.json +2 -2
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Collection, CollectionGroup, CollectionRepository, CollectionTarget,
|
|
1
|
+
import { Collection, CollectionGroup, CollectionRepository, CollectionTarget, ICollection } from '../../core';
|
|
2
2
|
import { ICollectionController } from './ICollectionController';
|
|
3
3
|
export declare class CollectionController implements ICollectionController {
|
|
4
4
|
private readonly _eventBus;
|
|
@@ -9,7 +9,7 @@ export declare class CollectionController implements ICollectionController {
|
|
|
9
9
|
private _collection?;
|
|
10
10
|
private _saveQueuedFor?;
|
|
11
11
|
private _subscription?;
|
|
12
|
-
constructor(
|
|
12
|
+
constructor({ collectionRepository }: CollectionController.ConstructorArgs);
|
|
13
13
|
get events$(): import("rxjs").Observable<ICollection.Event | ICollectionController.Event>;
|
|
14
14
|
get state(): ICollectionController.State;
|
|
15
15
|
private set state(value);
|
|
@@ -27,3 +27,8 @@ export declare class CollectionController implements ICollectionController {
|
|
|
27
27
|
unpublish(): Promise<void>;
|
|
28
28
|
private raiseEvent;
|
|
29
29
|
}
|
|
30
|
+
export declare namespace CollectionController {
|
|
31
|
+
type ConstructorArgs = {
|
|
32
|
+
collectionRepository: CollectionRepository;
|
|
33
|
+
};
|
|
34
|
+
}
|
|
@@ -7,10 +7,10 @@ const core_1 = require("../../core");
|
|
|
7
7
|
const ICollectionController_1 = require("./ICollectionController");
|
|
8
8
|
// class
|
|
9
9
|
class CollectionController {
|
|
10
|
-
constructor(
|
|
10
|
+
constructor({ collectionRepository }) {
|
|
11
11
|
// initialize instance variables
|
|
12
12
|
this._eventBus = new funnel_core_1.EventBus();
|
|
13
|
-
this.repository =
|
|
13
|
+
this.repository = collectionRepository;
|
|
14
14
|
this._state = 'uninitialized';
|
|
15
15
|
}
|
|
16
16
|
get events$() {
|
|
@@ -13,7 +13,8 @@ function CollectionEditor({ type, groupId, language }) {
|
|
|
13
13
|
// bind hooks
|
|
14
14
|
const router = (0, core_1.useEditorRouter)();
|
|
15
15
|
const splash = (0, core_1.useSplash)();
|
|
16
|
-
const
|
|
16
|
+
const collectionRepository = (0, core_1.useCollectionRepository)();
|
|
17
|
+
const pageRepository = (0, core_1.usePageRepository)();
|
|
17
18
|
const pageRefStore = (0, core_1.usePossiblePageRefStore)();
|
|
18
19
|
const target = (0, react_2.useMemo)(() => ({
|
|
19
20
|
template: funnel_core_1.Schema.Site.getCollection(type),
|
|
@@ -23,15 +24,15 @@ function CollectionEditor({ type, groupId, language }) {
|
|
|
23
24
|
}), [type, groupId, language]);
|
|
24
25
|
const { controller, controllerContext } = (0, react_2.useMemo)(() => {
|
|
25
26
|
// return controller + context
|
|
26
|
-
const controller = new hooks_1.CollectionController(
|
|
27
|
+
const controller = new hooks_1.CollectionController({ collectionRepository });
|
|
27
28
|
return {
|
|
28
29
|
controller,
|
|
29
30
|
controllerContext: { controller }
|
|
30
31
|
};
|
|
31
|
-
}, [
|
|
32
|
+
}, [collectionRepository]);
|
|
32
33
|
const { collection } = controller;
|
|
33
34
|
const collectionContext = (0, react_2.useMemo)(() => ({ collection }), [collection]);
|
|
34
|
-
const pageRefStoreProxy = (0, react_2.useMemo)(() => new core_1.PageRefStoreProxy({
|
|
35
|
+
const pageRefStoreProxy = (0, react_2.useMemo)(() => new core_1.PageRefStoreProxy({ pageRepository, language, parent: pageRefStore }), [pageRepository, language, pageRefStore]);
|
|
35
36
|
// load any needed page refs
|
|
36
37
|
(0, react_2.useEffect)(() => {
|
|
37
38
|
pageRefStoreProxy
|
package/dist/components.d.ts
CHANGED
|
@@ -15,6 +15,8 @@ export * from './core/repository/SerializeCollectionUpdate';
|
|
|
15
15
|
export * from './core/repository/SerializePageUpdate';
|
|
16
16
|
export * from './core/repository/TagSerializer';
|
|
17
17
|
export * from './core/splash';
|
|
18
|
+
export * from './explore/components/CreatePageDialog';
|
|
19
|
+
export * from './explore/components/CreateCollectionDialog';
|
|
18
20
|
export * from './page/components/config';
|
|
19
21
|
export * from './page/components/SettingsEditor';
|
|
20
22
|
export * from './page/hooks';
|
package/dist/components.js
CHANGED
|
@@ -35,6 +35,9 @@ __exportStar(require("./core/repository/SerializeCollectionUpdate"), exports);
|
|
|
35
35
|
__exportStar(require("./core/repository/SerializePageUpdate"), exports);
|
|
36
36
|
__exportStar(require("./core/repository/TagSerializer"), exports);
|
|
37
37
|
__exportStar(require("./core/splash"), exports);
|
|
38
|
+
// explore
|
|
39
|
+
__exportStar(require("./explore/components/CreatePageDialog"), exports);
|
|
40
|
+
__exportStar(require("./explore/components/CreateCollectionDialog"), exports);
|
|
38
41
|
// page
|
|
39
42
|
__exportStar(require("./page/components/config"), exports);
|
|
40
43
|
__exportStar(require("./page/components/SettingsEditor"), exports);
|
|
@@ -28,10 +28,11 @@ const Animate_1 = require("./Animate");
|
|
|
28
28
|
function Popup(_a) {
|
|
29
29
|
var { className, style = {}, anchor, anchorOffset = 4, placement = 'bottom', animation = 'in-out', backdrop = 'none', disabled = false, disableDismiss = false, disableOverlay = false, open = false, onOpened: onOpenedRaw = funnel_core_1.Fn.NoOp, onClose = funnel_core_1.Fn.NoOp, onClosed: onClosedRaw = funnel_core_1.Fn.NoOp, onKeyDown: onKeyDownRaw, children } = _a, props = __rest(_a, ["className", "style", "anchor", "anchorOffset", "placement", "animation", "backdrop", "disabled", "disableDismiss", "disableOverlay", "open", "onOpened", "onClose", "onClosed", "onKeyDown", "children"]);
|
|
30
30
|
// bind context
|
|
31
|
-
const
|
|
31
|
+
const containerId = (0, react_1.useId)();
|
|
32
|
+
const backdropId = (0, react_1.useId)();
|
|
32
33
|
const anchorId = typeof anchor === 'string'
|
|
33
34
|
? anchor
|
|
34
|
-
:
|
|
35
|
+
: containerId;
|
|
35
36
|
const [contentRef, contentElement] = (0, client_1.useRefElement)();
|
|
36
37
|
const openRef = (0, react_1.useRef)(open);
|
|
37
38
|
openRef.current = open;
|
|
@@ -44,11 +45,11 @@ function Popup(_a) {
|
|
|
44
45
|
// lock when opened
|
|
45
46
|
let unlock = undefined;
|
|
46
47
|
if (open) {
|
|
47
|
-
unlock = funnel_core_1.Browser.lockFocus(`#${CSS.escape(
|
|
48
|
+
unlock = funnel_core_1.Browser.lockFocus(`#${CSS.escape(containerId)}`);
|
|
48
49
|
}
|
|
49
50
|
// unlock on unmount
|
|
50
51
|
return () => unlock && unlock();
|
|
51
|
-
}, [open,
|
|
52
|
+
}, [open, containerId]);
|
|
52
53
|
// skip for SSR
|
|
53
54
|
if (!funnel_core_1.Browser.available) {
|
|
54
55
|
return null;
|
|
@@ -78,10 +79,20 @@ function Popup(_a) {
|
|
|
78
79
|
onClosedRef.current();
|
|
79
80
|
}
|
|
80
81
|
};
|
|
82
|
+
const onContainerClick = (e) => {
|
|
83
|
+
// close only if the container is directly clicked
|
|
84
|
+
const target = e.target;
|
|
85
|
+
if ((target === null || target === void 0 ? void 0 : target.id) === containerId) {
|
|
86
|
+
// stop bubbling
|
|
87
|
+
e.stopPropagation();
|
|
88
|
+
// close
|
|
89
|
+
onClose();
|
|
90
|
+
}
|
|
91
|
+
};
|
|
81
92
|
const onBackdropClick = (e) => {
|
|
82
93
|
// close only if the backdrop is directly clicked
|
|
83
94
|
const target = e.target;
|
|
84
|
-
if ((target === null || target === void 0 ? void 0 : target.id) ===
|
|
95
|
+
if ((target === null || target === void 0 ? void 0 : target.id) === backdropId) {
|
|
85
96
|
// stop bubbling
|
|
86
97
|
e.stopPropagation();
|
|
87
98
|
// close
|
|
@@ -92,14 +103,15 @@ function Popup(_a) {
|
|
|
92
103
|
const { popupContainerClassName, popupClassName, popupStyles } = getPopupClassNames({ anchor, anchorId, anchorOffset, placement });
|
|
93
104
|
return ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [anchor && typeof anchor !== 'string' &&
|
|
94
105
|
(0, jsx_runtime_1.jsx)(Popup.AnchorElement, { tag: "div", anchorId: anchorId, children: anchor }), (0, react_dom_1.createPortal)((0, jsx_runtime_1.jsx)(framer_motion_1.AnimatePresence, { mode: "wait", children: open &&
|
|
95
|
-
(0, jsx_runtime_1.jsx)(jsx_runtime_1.Fragment, { children: (0, jsx_runtime_1.jsxs)(framer_motion_1.motion.div, { id:
|
|
106
|
+
(0, jsx_runtime_1.jsx)(jsx_runtime_1.Fragment, { children: (0, jsx_runtime_1.jsxs)(framer_motion_1.motion.div, { id: containerId, className: (0, classnames_1.default)(popupContainerClassName, 'fixed inset-0 z-popup', {
|
|
96
107
|
'pointer-events-none': disableOverlay
|
|
97
|
-
}), variants: Animate_1.Animate.Variants.fade, initial: animation !== 'out' ? 'initial' : 'animate', animate: "animate", exit: animation !== 'in' ? 'exit' : 'animate', onAnimationComplete: definition => onAnimationComplete(definition), onClick: disableDismiss ? undefined :
|
|
98
|
-
(0, jsx_runtime_1.jsx)(framer_motion_1.motion.div, { className: (0, classnames_1.default)('fixed inset-0 z-backdrop', {
|
|
99
|
-
'backdrop-blur-[9px] bg-glass/backdrop will-change-[backdrop-filter]': backdrop === 'glass'
|
|
100
|
-
|
|
108
|
+
}), variants: Animate_1.Animate.Variants.fade, initial: animation !== 'out' ? 'initial' : 'animate', animate: "animate", exit: animation !== 'in' ? 'exit' : 'animate', onAnimationComplete: definition => onAnimationComplete(definition), onClick: disableDismiss ? undefined : onContainerClick, children: [backdrop !== 'none' &&
|
|
109
|
+
(0, jsx_runtime_1.jsx)(framer_motion_1.motion.div, { id: backdropId, className: (0, classnames_1.default)('fixed inset-0 z-backdrop', {
|
|
110
|
+
'backdrop-blur-[9px] bg-glass/backdrop will-change-[backdrop-filter]': backdrop === 'glass',
|
|
111
|
+
'pointer-events-auto': !disableDismiss
|
|
112
|
+
}), onClick: disableDismiss ? undefined : onBackdropClick }, "backdrop"), (0, jsx_runtime_1.jsx)("div", Object.assign({}, props, { ref: contentRef, className: (0, classnames_1.default)(className, popupClassName, 'pointer-events-auto'), style: anchor
|
|
101
113
|
? Popup.getAnchorStyle(anchorId, Object.assign({ margin: `${anchorOffset !== null && anchorOffset !== void 0 ? anchorOffset : 0}px` }, popupStyles))
|
|
102
|
-
: popupStyles, onKeyDown: onKeyDown, children: children }))] },
|
|
114
|
+
: popupStyles, onKeyDown: onKeyDown, children: children }))] }, containerId) }) }), document.body)] }));
|
|
103
115
|
}
|
|
104
116
|
// extension
|
|
105
117
|
(function (Popup) {
|
|
@@ -41,7 +41,7 @@ function InfoPanel(_a) {
|
|
|
41
41
|
};
|
|
42
42
|
// render
|
|
43
43
|
return ((0, jsx_runtime_1.jsxs)("section", { className: (0, classnames_1.default)(className, 'flex flex-col p-l7', 'bg-surface1 rounded-xxl'), children: [(0, jsx_runtime_1.jsxs)("div", { className: "shrink-0 flex items-center gap-l4", children: [status &&
|
|
44
|
-
(0, jsx_runtime_1.jsx)(feedback_1.StatusIcon, { variant: status, size: "md" }), (0, jsx_runtime_1.jsx)("h3", { className: "flex-1 heading-sm text-content-primary ellipsis", children: title }), menu &&
|
|
44
|
+
(0, jsx_runtime_1.jsx)(feedback_1.StatusIcon, { variant: status, size: "md" }), (0, jsx_runtime_1.jsx)("h3", { className: "flex-1 heading-sm text-content-primary ellipsis", children: title }), menu.items.length > 0 &&
|
|
45
45
|
(0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)(interaction_1.IconButton, { anchorId: anchorId, className: "shrink-0", icon: "EllipsisVertical", onClick: onMenuOpen }), (0, jsx_runtime_1.jsx)(interaction_1.Menu, { controller: menu, onItemClick: onMenuClick })] })] }), caption &&
|
|
46
46
|
(0, jsx_runtime_1.jsx)(funnel_ui_1.Markup, { className: (0, classnames_1.default)('markup-caption mt-l6', {
|
|
47
47
|
'text-destructive-content bg-destructive/tint0 p-l5 rounded-md': status === 'error'
|
|
@@ -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' | 'ArrowLeft' | 'ArrowRight' | 'ArrowLeftRight' | 'Atom' | 'Blocks' | 'Bold' | 'Check' | 'ChevronDown' | 'ChevronRight' | 'ChevronUp' | 'Circle' | 'CircleAlert' | 'CircleCheck' | 'CircleCheckBig' | 'CirclePlus' | 'CircleQuestionMark' | 'CloudCheck' | 'CloudUpload' | 'CornerDownRight' | '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' | 'Minus' | 'Monitor' | 'MonitorCog' | 'Moon' | 'NotebookPen' | 'Pencil' | 'Pin' | 'Plus' | 'Redo' | 'RefreshCw' | 'RotateCcw' | 'RotateCw' | 'Search' | 'SearchCode' | 'Settings' | 'Smartphone' | 'SquarePlay' | 'Star' | 'Strikethrough' | 'Subscript' | 'Sun' | 'Superscript' | 'TextAlignStart' | 'Trash' | 'TriangleAlert' | 'Trophy' | 'Underline' | 'Undo' | 'Upload' | 'UserRound' | 'X';
|
|
9
|
+
type Variant = 'Archive' | 'ArrowLeft' | 'ArrowRight' | 'ArrowLeftRight' | 'Atom' | 'Blocks' | 'Bold' | 'Check' | 'ChevronDown' | 'ChevronRight' | 'ChevronUp' | 'Circle' | 'CircleAlert' | 'CircleCheck' | 'CircleCheckBig' | 'CirclePlus' | 'CircleQuestionMark' | 'CloudCheck' | 'CloudUpload' | 'Copy' | 'CornerDownRight' | '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' | 'Minus' | 'Monitor' | 'MonitorCog' | 'Moon' | 'NotebookPen' | 'Pencil' | 'Pin' | 'Plus' | 'Redo' | 'RefreshCw' | 'RotateCcw' | 'RotateCw' | 'Search' | 'SearchCode' | 'Settings' | 'Smartphone' | 'SquarePlay' | 'Star' | 'Strikethrough' | 'Subscript' | 'Sun' | 'Superscript' | 'TextAlignStart' | 'Trash' | 'TriangleAlert' | 'Trophy' | 'Underline' | 'Undo' | 'Upload' | 'UserRound' | 'X';
|
|
10
10
|
namespace Variant {
|
|
11
11
|
function filter(value: any): value is Variant;
|
|
12
12
|
}
|
|
@@ -37,6 +37,7 @@ function Icon({ className, variant, size: sizing = 'md' }) {
|
|
|
37
37
|
'CircleQuestionMark',
|
|
38
38
|
'CloudCheck',
|
|
39
39
|
'CloudUpload',
|
|
40
|
+
'Copy',
|
|
40
41
|
'CornerDownRight',
|
|
41
42
|
'EllipsisVertical',
|
|
42
43
|
'Eye',
|
|
@@ -150,6 +151,8 @@ function getIcon(variant) {
|
|
|
150
151
|
return lucide_react_1.CloudCheck;
|
|
151
152
|
case 'CloudUpload':
|
|
152
153
|
return lucide_react_1.CloudUpload;
|
|
154
|
+
case 'Copy':
|
|
155
|
+
return lucide_react_1.Copy;
|
|
153
156
|
case 'CornerDownRight':
|
|
154
157
|
return lucide_react_1.CornerDownRight;
|
|
155
158
|
case 'EllipsisVertical':
|
|
@@ -8,8 +8,10 @@ import type { IPageRefStore } from './IPageRefStore';
|
|
|
8
8
|
import type { ITagged } from './ITagged';
|
|
9
9
|
import type { Item } from './Item';
|
|
10
10
|
import type { PageSettings } from './PageSettings';
|
|
11
|
+
import type { PageStatus } from './PageStatus';
|
|
11
12
|
import type { PageSummary } from './PageSummary';
|
|
12
13
|
import type { Section } from './Section';
|
|
14
|
+
import { SectionBlock } from './SectionBlock';
|
|
13
15
|
export interface IPage extends IAssetStore, ICollectionStore, IPageRefStore, ITagged {
|
|
14
16
|
readonly template: Schema.Page;
|
|
15
17
|
readonly id: Schema.Page.Id;
|
|
@@ -26,6 +28,8 @@ export interface IPage extends IAssetStore, ICollectionStore, IPageRefStore, ITa
|
|
|
26
28
|
readonly url: string;
|
|
27
29
|
readonly createdOn: number;
|
|
28
30
|
readonly updatedOn: number;
|
|
31
|
+
readonly errors: IPage.Errors;
|
|
32
|
+
readonly status: PageStatus;
|
|
29
33
|
readonly asRef: IPage.Ref;
|
|
30
34
|
publication: number | undefined;
|
|
31
35
|
slug: string | undefined;
|
|
@@ -35,22 +39,13 @@ export declare namespace IPage {
|
|
|
35
39
|
type Content = ReadonlyArray<Block | Section>;
|
|
36
40
|
type Area = 'discover' | 'content';
|
|
37
41
|
type Savable = Section | Block | FieldModel;
|
|
38
|
-
type
|
|
42
|
+
type Errors = {
|
|
43
|
+
page: IPage;
|
|
44
|
+
items: Array<Block | SectionBlock>;
|
|
45
|
+
};
|
|
46
|
+
type Ref = Omit<Schema.Page.Data.AsLink, 'type' | 'tags'> & {
|
|
39
47
|
template: Schema.Page;
|
|
40
|
-
id: Schema.Page.Id;
|
|
41
|
-
groupId: Schema.Page.GroupId;
|
|
42
|
-
brand: string;
|
|
43
|
-
language: Language;
|
|
44
|
-
region: string;
|
|
45
|
-
url: string;
|
|
46
|
-
slug?: string;
|
|
47
|
-
name: string;
|
|
48
48
|
tags: Schema.Tag[];
|
|
49
|
-
state: Schema.Page.State;
|
|
50
|
-
errors: boolean;
|
|
51
|
-
createdOn: number;
|
|
52
|
-
updatedOn: number;
|
|
53
|
-
publishedOn?: number;
|
|
54
49
|
};
|
|
55
50
|
namespace Ref {
|
|
56
51
|
function fromData({ tags, ...data }: Schema.Page.Data.AsLink): Ref;
|
|
@@ -3,6 +3,7 @@ import { EventBus, FieldModel, Language, Schema } from '@nascentdigital/funnel-c
|
|
|
3
3
|
import { Observable } from 'rxjs';
|
|
4
4
|
import { Asset, Block, IAssetStore, ICollectionStore, IPage, IPageRefStore, ITagged, PageSummary, Section, SectionBlock } from './';
|
|
5
5
|
import { PageSettings } from './PageSettings';
|
|
6
|
+
import { PageStatus } from './PageStatus';
|
|
6
7
|
export declare class Page implements IAssetStore, ICollectionStore, IPageRefStore, ITagged {
|
|
7
8
|
readonly template: Schema.Page;
|
|
8
9
|
readonly eventBus: EventBus;
|
|
@@ -82,7 +83,8 @@ export declare class Page implements IAssetStore, ICollectionStore, IPageRefStor
|
|
|
82
83
|
get items(): Array<Block | Section>;
|
|
83
84
|
get changes(): Page.Changes;
|
|
84
85
|
get initialErrors(): boolean;
|
|
85
|
-
get errors():
|
|
86
|
+
get errors(): IPage.Errors;
|
|
87
|
+
get status(): PageStatus;
|
|
86
88
|
get hasErrors(): boolean;
|
|
87
89
|
get asRef(): IPage.Ref;
|
|
88
90
|
/**
|
|
@@ -147,10 +149,6 @@ export declare namespace Page {
|
|
|
147
149
|
page: Page;
|
|
148
150
|
items: Array<Block | Section>;
|
|
149
151
|
};
|
|
150
|
-
type Errors = {
|
|
151
|
-
page: Page;
|
|
152
|
-
items: Array<Block | Section>;
|
|
153
|
-
};
|
|
154
152
|
type WithSummary = {
|
|
155
153
|
summary: PageSummary;
|
|
156
154
|
page?: Page;
|
package/dist/core/domain/Page.js
CHANGED
|
@@ -288,10 +288,17 @@ class Page {
|
|
|
288
288
|
get errors() {
|
|
289
289
|
return {
|
|
290
290
|
page: this,
|
|
291
|
-
items: this.items
|
|
291
|
+
items: this.items
|
|
292
|
+
.filter(item => (!item.activated && item.required)
|
|
292
293
|
|| (item.activated && !item.valid))
|
|
294
|
+
.flatMap(item => item instanceof _1.Section
|
|
295
|
+
? item.errors.blocks
|
|
296
|
+
: item)
|
|
293
297
|
};
|
|
294
298
|
}
|
|
299
|
+
get status() {
|
|
300
|
+
throw new funnel_core_1.NotImplementedError('The Strapi editor currently uses errors/changes for UI');
|
|
301
|
+
}
|
|
295
302
|
get hasErrors() {
|
|
296
303
|
return this.errors.items.length > 0;
|
|
297
304
|
}
|
|
@@ -1,15 +1,14 @@
|
|
|
1
1
|
import { Language, Schema } from '@nascentdigital/funnel-core';
|
|
2
2
|
import { Observable } from 'rxjs';
|
|
3
|
-
import {
|
|
3
|
+
import { IPageRepository } from '../repository';
|
|
4
4
|
import { IPageRefStore } from './IPageRefStore';
|
|
5
5
|
import { IPage } from './IPage';
|
|
6
6
|
export declare class PageRefStoreProxy implements IPageRefStore {
|
|
7
|
+
readonly pageRepository: IPageRepository;
|
|
7
8
|
readonly language: Language;
|
|
8
9
|
private _parentStore;
|
|
9
10
|
private readonly _pages;
|
|
10
|
-
private readonly _pageIds;
|
|
11
11
|
private readonly _syncing$;
|
|
12
|
-
private readonly _editorApi;
|
|
13
12
|
constructor(args: PageRefStoreProxy.ConstructorArgs);
|
|
14
13
|
get syncing(): boolean;
|
|
15
14
|
get stable$(): Observable<boolean>;
|
|
@@ -22,10 +21,9 @@ export declare class PageRefStoreProxy implements IPageRefStore {
|
|
|
22
21
|
}
|
|
23
22
|
export declare namespace PageRefStoreProxy {
|
|
24
23
|
type ConstructorArgs = {
|
|
25
|
-
|
|
26
|
-
parent?: IPageRefStore;
|
|
24
|
+
pageRepository: IPageRepository;
|
|
27
25
|
language: Language;
|
|
26
|
+
parent?: IPageRefStore;
|
|
28
27
|
pages?: ReadonlyArray<IPage.Ref>;
|
|
29
|
-
pageIds?: ReadonlyArray<Schema.Page.Id>;
|
|
30
28
|
};
|
|
31
29
|
}
|
|
@@ -1,15 +1,4 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
var __rest = (this && this.__rest) || function (s, e) {
|
|
3
|
-
var t = {};
|
|
4
|
-
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
5
|
-
t[p] = s[p];
|
|
6
|
-
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
7
|
-
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
8
|
-
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
9
|
-
t[p[i]] = s[p[i]];
|
|
10
|
-
}
|
|
11
|
-
return t;
|
|
12
|
-
};
|
|
13
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
14
3
|
exports.PageRefStoreProxy = void 0;
|
|
15
4
|
const funnel_core_1 = require("@nascentdigital/funnel-core");
|
|
@@ -18,12 +7,13 @@ const rxjs_1 = require("rxjs");
|
|
|
18
7
|
class PageRefStoreProxy {
|
|
19
8
|
constructor(args) {
|
|
20
9
|
var _a;
|
|
10
|
+
this.pageRepository = args.pageRepository;
|
|
21
11
|
this.language = args.language;
|
|
22
12
|
this._parentStore = args.parent;
|
|
23
|
-
this._editorApi = args.editorApi;
|
|
24
|
-
this._pages = [...(_a = args.pages) !== null && _a !== void 0 ? _a : []];
|
|
25
|
-
this._pageIds = new Set(args.pageIds);
|
|
26
13
|
this._syncing$ = new rxjs_1.BehaviorSubject(true);
|
|
14
|
+
// set current pages
|
|
15
|
+
this._pages = new Map();
|
|
16
|
+
(_a = args.pages) === null || _a === void 0 ? void 0 : _a.forEach(page => this._pages.set(page.id, page));
|
|
27
17
|
}
|
|
28
18
|
get syncing() {
|
|
29
19
|
return this._syncing$.getValue();
|
|
@@ -39,26 +29,19 @@ class PageRefStoreProxy {
|
|
|
39
29
|
return this;
|
|
40
30
|
}
|
|
41
31
|
async load(pageIds) {
|
|
42
|
-
//
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
const
|
|
46
|
-
// bail if no
|
|
47
|
-
if (
|
|
32
|
+
// determine pages that need to be fetched
|
|
33
|
+
const pageIdsRequested = new Set(pageIds);
|
|
34
|
+
const loadedPageIds = new Set(this._pages.keys());
|
|
35
|
+
const pageIdsToFetch = pageIdsRequested.difference(loadedPageIds);
|
|
36
|
+
// bail if no fetching needed
|
|
37
|
+
if (pageIdsToFetch.size === 0) {
|
|
48
38
|
this._syncing$.next(false);
|
|
49
39
|
return;
|
|
50
40
|
}
|
|
51
41
|
// fetch missing page refs
|
|
52
|
-
const
|
|
53
|
-
const pageRefs = pageLinks.map((_a) => {
|
|
54
|
-
var { tags } = _a, page = __rest(_a, ["tags"]);
|
|
55
|
-
// get page template/schema
|
|
56
|
-
const template = funnel_core_1.Schema.Site.getPage(page.type, page.region);
|
|
57
|
-
// return page ref
|
|
58
|
-
return Object.assign(Object.assign({ template }, page), { tags: template.tags.flatMap(tagGroup => tagGroup.parse(tags)) });
|
|
59
|
-
});
|
|
42
|
+
const refs = await this.pageRepository.getSummaries({ ids: [...pageIdsToFetch], version: 'draft' });
|
|
60
43
|
// add to store
|
|
61
|
-
this._pages.
|
|
44
|
+
refs.forEach(ref => this._pages.set(ref.id, ref));
|
|
62
45
|
// signal syncing is finished
|
|
63
46
|
this._syncing$.next(false);
|
|
64
47
|
}
|
|
@@ -69,7 +52,7 @@ class PageRefStoreProxy {
|
|
|
69
52
|
return undefined;
|
|
70
53
|
}
|
|
71
54
|
// first try looking in current store
|
|
72
|
-
const pageRef = this._pages.
|
|
55
|
+
const pageRef = this._pages.get(pageId);
|
|
73
56
|
if (pageRef) {
|
|
74
57
|
return pageRef;
|
|
75
58
|
}
|
|
@@ -87,32 +70,15 @@ class PageRefStoreProxy {
|
|
|
87
70
|
// return
|
|
88
71
|
// }
|
|
89
72
|
// replace ref if it exists
|
|
90
|
-
|
|
91
|
-
const pageId = page.id;
|
|
92
|
-
const refIndex = _pages.findIndex(ref => ref.id === pageId);
|
|
93
|
-
if (refIndex >= 0) {
|
|
94
|
-
_pages[refIndex] = page;
|
|
95
|
-
}
|
|
96
|
-
// or add ref
|
|
97
|
-
else {
|
|
98
|
-
_pages.push(page);
|
|
99
|
-
}
|
|
73
|
+
this._pages.set(page.id, page);
|
|
100
74
|
}
|
|
101
75
|
removePageRef(pageId) {
|
|
102
76
|
// try to remove from parent first
|
|
103
77
|
// if (this._parentStore?.removePageRef(pageId)) {
|
|
104
78
|
// return true
|
|
105
79
|
// }
|
|
106
|
-
//
|
|
107
|
-
|
|
108
|
-
const refIndex = _pages.findIndex(ref => ref.id === pageId);
|
|
109
|
-
if (refIndex < 0) {
|
|
110
|
-
return false;
|
|
111
|
-
}
|
|
112
|
-
// remove file
|
|
113
|
-
_pages.splice(refIndex, 1);
|
|
114
|
-
// indicate success
|
|
115
|
-
return true;
|
|
80
|
+
// remove page
|
|
81
|
+
return this._pages.delete(pageId);
|
|
116
82
|
}
|
|
117
83
|
}
|
|
118
84
|
exports.PageRefStoreProxy = PageRefStoreProxy;
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
export type PageStatus = {
|
|
2
|
+
published: boolean;
|
|
3
|
+
content: Array<PageStatus.ForBlock | PageStatus.ForSection>;
|
|
4
|
+
};
|
|
5
|
+
export declare namespace PageStatus {
|
|
6
|
+
type ForPageItem = {
|
|
7
|
+
identifier: string;
|
|
8
|
+
name: string;
|
|
9
|
+
valid: boolean;
|
|
10
|
+
};
|
|
11
|
+
type ForBlock = ForPageItem & {
|
|
12
|
+
type: 'block';
|
|
13
|
+
required: boolean;
|
|
14
|
+
status: ForBlock.Status;
|
|
15
|
+
};
|
|
16
|
+
namespace ForBlock {
|
|
17
|
+
type Status = 'new' | 'modified' | 'unchanged';
|
|
18
|
+
}
|
|
19
|
+
type ForSection = ForPageItem & {
|
|
20
|
+
type: 'section';
|
|
21
|
+
min: number;
|
|
22
|
+
items: ForBlock[];
|
|
23
|
+
status: ForSection.Status;
|
|
24
|
+
};
|
|
25
|
+
namespace ForSection {
|
|
26
|
+
type Status = 'modified' | 'unchanged';
|
|
27
|
+
}
|
|
28
|
+
}
|
|
@@ -30,9 +30,9 @@ class PageSummary {
|
|
|
30
30
|
return this.pages.find(page => page.region === region && page.language === language);
|
|
31
31
|
}
|
|
32
32
|
getClosestPageRef({ region, language, fallbackLanguage }) {
|
|
33
|
-
var _a, _b, _c, _d;
|
|
33
|
+
var _a, _b, _c, _d, _e;
|
|
34
34
|
const { template, brand, groupId, pages } = this;
|
|
35
|
-
const ref = (_d = (_c = (_b = (_a = pages.find(page => page.region === region && page.language === language)) !== null && _a !== void 0 ? _a : (fallbackLanguage && pages.find(page => page.region === region && page.language === fallbackLanguage))) !== null && _b !== void 0 ? _b : pages.find(page => page.language === language)) !== null && _c !== void 0 ? _c : (fallbackLanguage && pages.find(page => page.language === fallbackLanguage))) !== null && _d !== void 0 ? _d : pages[0];
|
|
35
|
+
const ref = (_e = (_d = (_c = (_b = (_a = pages.find(page => page.region === region && page.language === language)) !== null && _a !== void 0 ? _a : (fallbackLanguage && pages.find(page => page.region === region && page.language === fallbackLanguage))) !== null && _b !== void 0 ? _b : pages.find(page => page.language === language)) !== null && _c !== void 0 ? _c : (fallbackLanguage && pages.find(page => page.language === fallbackLanguage))) !== null && _d !== void 0 ? _d : pages.find(page => page.region === region)) !== null && _e !== void 0 ? _e : pages[0];
|
|
36
36
|
return IPage_1.IPage.Ref.fromData(Object.assign(Object.assign({}, ref), { groupId, type: template.type, brand }));
|
|
37
37
|
}
|
|
38
38
|
isInGroup({ template }) {
|
|
@@ -57,13 +57,11 @@ class Pages {
|
|
|
57
57
|
: 'syncing';
|
|
58
58
|
// load all pages for the region
|
|
59
59
|
const { site, template, pageType, tags } = this;
|
|
60
|
-
const { region } = site;
|
|
61
60
|
const { items: pages } = await site.repository.search({
|
|
62
61
|
template,
|
|
63
62
|
tags: tags.map(tag => tag.data),
|
|
64
63
|
pagination: 'all'
|
|
65
64
|
});
|
|
66
|
-
console.debug(`[PageCollection/sync] fetched ${pages.length} "${pageType}" pages`);
|
|
67
65
|
// group/convert the pages into summaries
|
|
68
66
|
const itemsArgs = [];
|
|
69
67
|
const itemsArgsMap = new Map();
|
|
@@ -29,9 +29,9 @@ class Section extends ItemBase_1.ItemBase {
|
|
|
29
29
|
.map(key => availableBlocks.find(block => block.key === key))
|
|
30
30
|
.filter(funnel_core_1.Value.isDefined)
|
|
31
31
|
.map(SectionBlock_1.SectionBlock.for);
|
|
32
|
-
// mark as activated
|
|
33
|
-
this.activated = true;
|
|
34
32
|
}
|
|
33
|
+
// mark as activated
|
|
34
|
+
this.activated = true;
|
|
35
35
|
}
|
|
36
36
|
get identifier() {
|
|
37
37
|
return this.key;
|
|
@@ -36,6 +36,7 @@ __exportStar(require("./Page"), exports);
|
|
|
36
36
|
__exportStar(require("./PageOverview"), exports);
|
|
37
37
|
__exportStar(require("./PageRefStoreProxy"), exports);
|
|
38
38
|
__exportStar(require("./PageSettings"), exports);
|
|
39
|
+
__exportStar(require("./PageStatus"), exports);
|
|
39
40
|
__exportStar(require("./PageSummary"), exports);
|
|
40
41
|
__exportStar(require("./Pages"), exports);
|
|
41
42
|
__exportStar(require("./Section"), exports);
|
|
@@ -8,6 +8,7 @@ export interface IPageRepository {
|
|
|
8
8
|
save(page: IPage): Promise<IPage>;
|
|
9
9
|
unpublish(page: IPage): Promise<void>;
|
|
10
10
|
getOverview(args: IPageRepository.GetOverview.Args): Promise<IPageRepository.GetOverview.Result>;
|
|
11
|
+
getSummaries(args: IPageRepository.GetSummaries.Args): Promise<IPageRepository.GetSummaries.Result>;
|
|
11
12
|
}
|
|
12
13
|
export declare namespace IPageRepository {
|
|
13
14
|
namespace Search {
|
|
@@ -36,4 +37,8 @@ export declare namespace IPageRepository {
|
|
|
36
37
|
};
|
|
37
38
|
type Result = PageOverview[];
|
|
38
39
|
}
|
|
40
|
+
namespace GetSummaries {
|
|
41
|
+
type Args = Omit<PageClient.GetSummaries.Args, 'brand'>;
|
|
42
|
+
type Result = IPage.Ref[];
|
|
43
|
+
}
|
|
39
44
|
}
|
|
@@ -14,6 +14,7 @@ export declare class PageRepository implements IPageRepository {
|
|
|
14
14
|
save(page: Page): Promise<Page>;
|
|
15
15
|
unpublish(page: Page): Promise<void>;
|
|
16
16
|
getOverview(args: IPageRepository.GetOverview.Args): Promise<IPageRepository.GetOverview.Result>;
|
|
17
|
+
getSummaries(args: IPageRepository.GetSummaries.Args): Promise<IPageRepository.GetSummaries.Result>;
|
|
17
18
|
private serializePageUpdate;
|
|
18
19
|
}
|
|
19
20
|
export declare namespace PageRepository {
|
|
@@ -23,14 +23,13 @@ class PageRepository {
|
|
|
23
23
|
}
|
|
24
24
|
async search(args) {
|
|
25
25
|
// query pages
|
|
26
|
-
const { template
|
|
27
|
-
const _a = await this.editorApi.searchPages(Object.assign(Object.assign({}, query), { version: 'draft', brand: funnel_core_1.AppConfig.brand(),
|
|
26
|
+
const { template } = args, query = __rest(args, ["template"]);
|
|
27
|
+
const _a = await this.editorApi.searchPages(Object.assign(Object.assign({}, query), { version: 'draft', brand: funnel_core_1.AppConfig.brand(), type: template.type })), { items } = _a, pagination = __rest(_a, ["items"]);
|
|
28
28
|
// return result
|
|
29
29
|
return Object.assign({ items: items.map((_a) => {
|
|
30
30
|
var _b;
|
|
31
31
|
var { tags } = _a, item = __rest(_a, ["tags"]);
|
|
32
|
-
return (Object.assign(Object.assign({}, item), { template,
|
|
33
|
-
region, name: (_b = item.name) !== null && _b !== void 0 ? _b : `Unnamed ${template.name} page`, tags: template.tags.flatMap(tagGroup => tagGroup.parse(tags)) }));
|
|
32
|
+
return (Object.assign(Object.assign({}, item), { template, name: (_b = item.name) !== null && _b !== void 0 ? _b : `Unnamed ${template.name} page`, tags: template.tags.flatMap(tagGroup => tagGroup.parse(tags)) }));
|
|
34
33
|
}) }, pagination);
|
|
35
34
|
}
|
|
36
35
|
async load(args) {
|
|
@@ -95,6 +94,16 @@ class PageRepository {
|
|
|
95
94
|
async getOverview(args) {
|
|
96
95
|
return this.editorApi.getPagesOverview(Object.assign(Object.assign({}, args), { version: 'draft' }));
|
|
97
96
|
}
|
|
97
|
+
async getSummaries(args) {
|
|
98
|
+
// fetch page summaries
|
|
99
|
+
const summaries = await this.editorApi.getPageSummaries(args);
|
|
100
|
+
// return as page ref
|
|
101
|
+
return summaries.map(summary => {
|
|
102
|
+
var _a;
|
|
103
|
+
const template = funnel_core_1.Schema.Site.getPage(summary.type, summary.region);
|
|
104
|
+
return Object.assign(Object.assign({}, summary), { template, tags: template.parseTags((_a = summary.tags) !== null && _a !== void 0 ? _a : []) });
|
|
105
|
+
});
|
|
106
|
+
}
|
|
98
107
|
serializePageUpdate(page, savables) {
|
|
99
108
|
var _a, _b;
|
|
100
109
|
// root page updates
|
|
@@ -114,7 +114,7 @@ exports.CreateCollectionDialog = (0, react_1.forwardRef)(function CreateCollecti
|
|
|
114
114
|
return null;
|
|
115
115
|
}
|
|
116
116
|
// render
|
|
117
|
-
return ((0, jsx_runtime_1.jsxs)(core_1.MiniEditor, { className: "flex flex-col gap-l8", title: `Create new ${(_d = collectionBrowser.template.name) !== null && _d !== void 0 ? _d : 'collection'}`, open: result === undefined, anchor: anchor, anchorOffset: 4, placement: "
|
|
117
|
+
return ((0, jsx_runtime_1.jsxs)(core_1.MiniEditor, { className: "flex flex-col gap-l8", title: `Create new ${(_d = collectionBrowser.template.name) !== null && _d !== void 0 ? _d : 'collection'}`, open: result === undefined, anchor: anchor, anchorOffset: 4, placement: "left", renderSaveLabel: state => state === 'saving' ? 'Creating...' : 'Create', canSave: onValidate, onSave: onCreate, onClose: onCancel, onClosed: onClosed, children: [(0, jsx_runtime_1.jsx)(core_1.ErrorMessage, { error: error }), (0, jsx_runtime_1.jsxs)(core_1.FieldErrorController, { errorLevel: errorLevel, children: [(0, jsx_runtime_1.jsx)(core_1.FieldEditor, { field: nameField, autoFocus: true }), multiLanguage &&
|
|
118
118
|
(0, jsx_runtime_1.jsx)(core_1.FieldEditor, { field: languageField })] })] }));
|
|
119
119
|
});
|
|
120
120
|
function getLanguageOptions(collectionBrowser) {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Schema } from '@nascentdigital/funnel-core';
|
|
2
|
-
import { AppState,
|
|
2
|
+
import { AppState, IPage, Page, PageRepository, PageSummary } from '../../core';
|
|
3
3
|
import { IPageController } from './IPageController';
|
|
4
4
|
export declare class PageController implements IPageController {
|
|
5
5
|
private readonly _eventBus;
|
|
@@ -11,7 +11,7 @@ export declare class PageController implements IPageController {
|
|
|
11
11
|
private _page?;
|
|
12
12
|
private _pageSubscription?;
|
|
13
13
|
private _saveQueuedFor?;
|
|
14
|
-
constructor({ appState,
|
|
14
|
+
constructor({ appState, pageRepository }: PageController.ConstructorArgs);
|
|
15
15
|
get events$(): import("rxjs").Observable<IPage.Event | IPageController.Event>;
|
|
16
16
|
get saved$(): import("rxjs").Observable<[IPageController.StateChangedEvent, IPageController.StateChangedEvent]>;
|
|
17
17
|
get state(): IPageController.State;
|
|
@@ -38,6 +38,6 @@ export declare class PageController implements IPageController {
|
|
|
38
38
|
export declare namespace PageController {
|
|
39
39
|
type ConstructorArgs = {
|
|
40
40
|
appState: AppState;
|
|
41
|
-
|
|
41
|
+
pageRepository: PageRepository;
|
|
42
42
|
};
|
|
43
43
|
}
|
|
@@ -7,11 +7,11 @@ const core_1 = require("../../core");
|
|
|
7
7
|
const IPageController_1 = require("./IPageController");
|
|
8
8
|
// class
|
|
9
9
|
class PageController {
|
|
10
|
-
constructor({ appState,
|
|
10
|
+
constructor({ appState, pageRepository }) {
|
|
11
11
|
// initialize instance variables
|
|
12
12
|
this._eventBus = new funnel_core_1.EventBus();
|
|
13
13
|
this.appState = appState;
|
|
14
|
-
this.repository =
|
|
14
|
+
this.repository = pageRepository;
|
|
15
15
|
this._state = 'uninitialized';
|
|
16
16
|
}
|
|
17
17
|
get events$() {
|
|
@@ -21,19 +21,19 @@ function PageEditor({ templateId, region, language, slug }) {
|
|
|
21
21
|
const splash = (0, core_1.useSplash)();
|
|
22
22
|
const router = (0, core_1.useEditorRouter)();
|
|
23
23
|
const target = (0, react_2.useMemo)(() => coerceTarget({ templateId, slug, region, language }), [templateId, slug, region, language]);
|
|
24
|
-
const
|
|
24
|
+
const pageRepository = (0, core_1.usePageRepository)();
|
|
25
25
|
const { controller, controllerContext } = (0, react_2.useMemo)(() => {
|
|
26
26
|
// return controller + context
|
|
27
|
-
const controller = new hooks_1.PageController({ appState,
|
|
27
|
+
const controller = new hooks_1.PageController({ appState, pageRepository });
|
|
28
28
|
return {
|
|
29
29
|
controller,
|
|
30
30
|
controllerContext: { controller }
|
|
31
31
|
};
|
|
32
|
-
}, [appState,
|
|
32
|
+
}, [appState, pageRepository]);
|
|
33
33
|
const { page } = controller;
|
|
34
34
|
const pageContext = (0, react_2.useMemo)(() => ({ page }), [page]);
|
|
35
35
|
const selectedItem = (0, react_2.useMemo)(() => page === null || page === void 0 ? void 0 : page.coerceItem(itemId), [page, itemId]);
|
|
36
|
-
const pageRefStoreProxy = (0, react_2.useMemo)(() => new core_1.PageRefStoreProxy({
|
|
36
|
+
const pageRefStoreProxy = (0, react_2.useMemo)(() => new core_1.PageRefStoreProxy({ pageRepository, language }), [pageRepository, language]);
|
|
37
37
|
// load any needed page refs
|
|
38
38
|
(0, react_2.useEffect)(() => {
|
|
39
39
|
// bail if no page
|
package/dist/styles/index.css
CHANGED
|
@@ -501,10 +501,10 @@ video {
|
|
|
501
501
|
}
|
|
502
502
|
|
|
503
503
|
[popover]{
|
|
504
|
-
inset: var(--toolwind-toggle-
|
|
505
|
-
background-color: var(--toolwind-toggle-
|
|
506
|
-
color: var(--toolwind-toggle-
|
|
507
|
-
margin: var(--toolwind-toggle-
|
|
504
|
+
inset: var(--toolwind-toggle-AcLhegQ593, 0px);
|
|
505
|
+
background-color: var(--toolwind-toggle-pOdFeExQFr, canvas);
|
|
506
|
+
color: var(--toolwind-toggle-vbIn7qRdsp, canvastext);
|
|
507
|
+
margin: var(--toolwind-toggle-nEH1eNUgT7, auto);
|
|
508
508
|
}
|
|
509
509
|
html, body, #__next, #root, .Editor-wrap{
|
|
510
510
|
position: relative;
|
|
@@ -3666,17 +3666,13 @@ video {
|
|
|
3666
3666
|
border-radius: 12px;
|
|
3667
3667
|
--tw-bg-opacity: 1;
|
|
3668
3668
|
background-color: rgb(var(--color-modal-surface1) / var(--tw-bg-opacity, 1));
|
|
3669
|
-
--tw-shadow: 0 15px 50px 0 rgba(26,32,44,0.25);
|
|
3669
|
+
--tw-shadow: 0 15px 50px 0 var(--color-shadow1, rgba(26, 32, 44, 0.25));
|
|
3670
3670
|
--tw-shadow-colored: 0 15px 50px 0 var(--tw-shadow-color);
|
|
3671
3671
|
box-shadow: var(--tw-ring-offset-shadow, 0 0 #0000), var(--tw-ring-shadow, 0 0 #0000), var(--tw-shadow);
|
|
3672
3672
|
}
|
|
3673
|
-
|
|
3674
|
-
|
|
3675
|
-
|
|
3676
|
-
--tw-shadow: 0 15px 50px 0 rgba(26,32,44,0.75);
|
|
3677
|
-
--tw-shadow-colored: 0 15px 50px 0 var(--tw-shadow-color);
|
|
3678
|
-
box-shadow: var(--tw-ring-offset-shadow, 0 0 #0000), var(--tw-ring-shadow, 0 0 #0000), var(--tw-shadow);
|
|
3679
|
-
}
|
|
3673
|
+
.Picker-root.Picker-sm{
|
|
3674
|
+
height: 340px;
|
|
3675
|
+
width: 512px;
|
|
3680
3676
|
}
|
|
3681
3677
|
.segmented-button-group{
|
|
3682
3678
|
display: inline-grid;
|
|
@@ -5891,8 +5887,8 @@ img.nd-Visual-image {
|
|
|
5891
5887
|
opacity: 0;
|
|
5892
5888
|
}
|
|
5893
5889
|
.shadow-dialog{
|
|
5894
|
-
--tw-shadow: 0 15px 50px 0 var(--color-shadow1
|
|
5895
|
-
--tw-shadow-colored: 0 15px 50px 0 var(--tw-shadow-color)
|
|
5890
|
+
--tw-shadow: 0 15px 50px 0 var(--color-shadow1, rgba(26, 32, 44, 0.25));
|
|
5891
|
+
--tw-shadow-colored: 0 15px 50px 0 var(--tw-shadow-color);
|
|
5896
5892
|
box-shadow: var(--tw-ring-offset-shadow, 0 0 #0000), var(--tw-ring-shadow, 0 0 #0000), var(--tw-shadow);
|
|
5897
5893
|
}
|
|
5898
5894
|
.shadow-miniEditor{
|
|
@@ -6021,10 +6017,10 @@ img.nd-Visual-image {
|
|
|
6021
6017
|
.anchored\/\[--nd-popup-anchor\]:where(.anchored\/\[--nd-popup-anchor\]){
|
|
6022
6018
|
position: absolute;
|
|
6023
6019
|
view-transition-name: --tw-anchor-view-transition-2j1919322s193433343934192p322r2w33362l;
|
|
6024
|
-
--toolwind-toggle-
|
|
6025
|
-
--toolwind-toggle-
|
|
6026
|
-
--toolwind-toggle-
|
|
6027
|
-
--toolwind-toggle-
|
|
6020
|
+
--toolwind-toggle-AcLhegQ593: auto;
|
|
6021
|
+
--toolwind-toggle-pOdFeExQFr: transparent;
|
|
6022
|
+
--toolwind-toggle-vbIn7qRdsp: inherit;
|
|
6023
|
+
--toolwind-toggle-nEH1eNUgT7: 0px;
|
|
6028
6024
|
}
|
|
6029
6025
|
.counter-l1{
|
|
6030
6026
|
counter-reset: l1;
|
package/dist/styles/tailwind.js
CHANGED
|
@@ -214,7 +214,7 @@ exports.EditorTailwindConfig = {
|
|
|
214
214
|
menu: '0 0 20px -10px rgba(0, 0, 0, 0.20), 5px 5px 5px -3px rgba(12, 12, 13, 0.05)',
|
|
215
215
|
card: '0px 3px 8px 0px rgba(0, 0, 0, 0.24)',
|
|
216
216
|
tooltip: '0 1px 4px 0 rgba(12, 12, 13, 0.10)',
|
|
217
|
-
dialog: '0 15px 50px 0 var(--color-shadow1
|
|
217
|
+
dialog: '0 15px 50px 0 var(--color-shadow1, rgba(26, 32, 44, 0.25))',
|
|
218
218
|
quickInput: '0 8px 20px 0 rgba(0, 0, 0, 0.06)',
|
|
219
219
|
miniEditor: '0 8px 20px 0 rgba(0, 0, 0, 0.06)',
|
|
220
220
|
objectEditor: '0 0 12px 0 rgb(var(--color-ix-util-hover)/10%)',
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@nascentdigital/funnel-editor",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "6.0.0",
|
|
4
4
|
"publishConfig": {
|
|
5
5
|
"registry": "https://registry.npmjs.org/",
|
|
6
6
|
"access": "public"
|
|
@@ -91,5 +91,5 @@
|
|
|
91
91
|
"ts-jest": "^29",
|
|
92
92
|
"type-fest": "^4"
|
|
93
93
|
},
|
|
94
|
-
"gitHead": "
|
|
94
|
+
"gitHead": "83e335312f91fb90aae73dfc31b3df1ec1895f76"
|
|
95
95
|
}
|