@nascentdigital/funnel-editor 4.5.7 → 4.6.1
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 +1 -1
- package/dist/core/components/ColorModeToggle.js +6 -4
- package/dist/core/components/Header.js +3 -2
- package/dist/core/components/UserEditor.d.ts +2 -2
- package/dist/core/components/feedback/Badge.d.ts +2 -1
- package/dist/core/components/feedback/Badge.js +4 -3
- package/dist/core/components/fields/DynamicPagesEditor.js +7 -6
- package/dist/core/components/fields/EmptyFieldCard.js +4 -4
- package/dist/core/components/fields/FieldCardLayout.js +5 -5
- package/dist/core/components/fields/FieldHeader.js +3 -2
- package/dist/core/components/fields/FieldsPanel.js +4 -4
- package/dist/core/components/fields/FormEditor.js +5 -4
- package/dist/core/components/fields/asset/AssetEditor.d.ts +3 -2
- package/dist/core/components/fields/asset/AssetEditor.js +1 -1
- package/dist/core/components/fields/asset/AssetUploader.d.ts +3 -2
- package/dist/core/components/fields/asset/AssetUploader.js +1 -1
- package/dist/core/components/fields/collection/CollectionCard.js +1 -11
- package/dist/core/components/fields/collection/CollectionPicker.js +3 -2
- package/dist/core/components/fields/collection/previews/index.d.ts +0 -1
- package/dist/core/components/fields/collection/previews/index.js +0 -1
- package/dist/core/components/fields/embed/EmbeddedVideoEditor.d.ts +2 -2
- package/dist/core/components/fields/factories/AssetFactory.d.ts +1 -1
- package/dist/core/components/fields/factories/CollectionFactory.d.ts +1 -1
- package/dist/core/components/fields/factories/EmbeddedVideoFactory.d.ts +2 -2
- package/dist/core/components/fields/factories/FieldValueFactory.d.ts +1 -1
- package/dist/core/components/fields/factories/FieldValueFactory.js +1 -1
- package/dist/core/components/fields/factories/LinkFactory.d.ts +2 -2
- package/dist/core/components/fields/factories/TextFactory.d.ts +2 -2
- package/dist/core/components/fields/form/FormFieldEditor.d.ts +3 -2
- package/dist/core/components/fields/index.d.ts +1 -0
- package/dist/core/components/fields/index.js +1 -0
- package/dist/core/components/fields/link/LinkEditor.d.ts +2 -2
- package/dist/core/components/fields/link/LinkEditor.js +4 -0
- package/dist/core/components/fields/list/CreateFieldButton.d.ts +1 -1
- package/dist/core/components/fields/list/CreateFieldButton.js +4 -5
- package/dist/core/components/fields/list/CreateFieldCard.js +4 -4
- package/dist/core/components/fields/page/PagePicker.js +4 -2
- package/dist/core/components/fields/richtext/FloatingToolbarPlugin.js +3 -2
- package/dist/core/components/fields/richtext/LinkEditor.js +17 -4
- package/dist/core/components/fields/richtext/LinkPopup.js +11 -7
- package/dist/core/components/interaction/AvatarButton.d.ts +2 -1
- package/dist/core/components/interaction/AvatarButton.js +3 -2
- package/dist/core/components/interaction/Button.d.ts +2 -0
- package/dist/core/components/interaction/Button.js +3 -2
- package/dist/core/components/interaction/Combobox.js +2 -2
- package/dist/core/components/interaction/IconButton.d.ts +2 -0
- package/dist/core/components/interaction/IconButton.js +3 -2
- package/dist/core/components/interaction/IconLink.d.ts +1 -1
- package/dist/core/components/interaction/MiniEditor.d.ts +3 -2
- package/dist/core/components/interaction/MiniEditor.js +7 -5
- package/dist/core/components/interaction/Popup.d.ts +20 -15
- package/dist/core/components/interaction/Popup.js +63 -66
- package/dist/core/components/interaction/QuickInput.js +2 -0
- package/dist/core/components/interaction/QuickPicker.js +4 -4
- package/dist/core/components/interaction/Tabs.d.ts +5 -1
- package/dist/core/components/interaction/Tabs.js +18 -8
- package/dist/core/components/interaction/menu/useMenuController.d.ts +2 -2
- package/dist/core/components/interaction/table/TableItem.d.ts +2 -1
- package/dist/core/components/interaction/table/TableItem.js +5 -3
- package/dist/core/components/layout/InfoPanel.js +4 -2
- package/dist/core/components/visuals/Icon.d.ts +1 -1
- package/dist/core/components/visuals/Icon.js +6 -0
- package/dist/core/components/visuals/index.d.ts +0 -1
- package/dist/core/components/visuals/index.js +0 -1
- package/dist/core/domain/Block.d.ts +4 -0
- package/dist/core/domain/Block.js +7 -0
- package/dist/core/domain/BlockConfiguration.d.ts +9 -2
- package/dist/core/domain/BlockConfiguration.js +49 -12
- package/dist/core/domain/CollectionBrowser.d.ts +2 -2
- package/dist/core/domain/CollectionFieldProxy.d.ts +7 -2
- package/dist/core/domain/CollectionFieldProxy.js +55 -66
- package/dist/core/domain/SectionBlock.d.ts +5 -0
- package/dist/core/domain/SectionBlock.js +15 -0
- package/dist/core/hooks/useBlockConfiguration.d.ts +7 -1
- package/dist/core/hooks/useBlockConfiguration.js +8 -1
- package/dist/core/hooks/usePage.d.ts +2 -2
- package/dist/core/hooks/usePage.js +5 -4
- package/dist/core/repository/CollectionRepository.js +1 -1
- package/dist/core/repository/CollectionSerializer.d.ts +3 -2
- package/dist/core/repository/CollectionSerializer.js +12 -7
- package/dist/core/repository/PageRepository.js +2 -2
- package/dist/core/repository/PageSerializer.d.ts +5 -3
- package/dist/core/repository/PageSerializer.js +10 -11
- package/dist/explore/components/CreateCollectionDialog.d.ts +2 -3
- package/dist/explore/components/CreateCollectionDialog.js +1 -1
- package/dist/explore/components/CreatePageDialog.d.ts +3 -3
- package/dist/explore/components/CreatePageDialog.js +2 -2
- package/dist/explore/screens/CollectionExplorer.js +4 -4
- package/dist/explore/screens/PageExplorer.js +4 -4
- package/dist/page/components/BlockEditor.js +10 -2
- package/dist/page/components/config/BlockConfigButton.d.ts +8 -0
- package/dist/page/components/config/BlockConfigButton.js +320 -0
- package/dist/page/components/config/BlockConfigurationProvider.d.ts +8 -0
- package/dist/page/components/config/BlockConfigurationProvider.js +17 -0
- package/dist/page/components/config/LegacyBlockPreview.d.ts +8 -0
- package/dist/page/components/config/{BlockPreview.js → LegacyBlockPreview.js} +30 -40
- package/dist/page/components/config/index.d.ts +3 -1
- package/dist/page/components/config/index.js +3 -1
- package/dist/page/components/index.d.ts +1 -1
- package/dist/page/components/index.js +1 -1
- package/dist/page/components/nav/NavSection.js +4 -3
- package/dist/page/components/panels/BlockConfigPanel.d.ts +1 -0
- package/dist/page/components/panels/BlockConfigPanel.js +25 -0
- package/dist/page/components/{PageStatus.d.ts → panels/PageStatus.d.ts} +3 -3
- package/dist/page/components/{PageStatus.js → panels/PageStatus.js} +10 -14
- package/dist/page/components/panels/index.d.ts +2 -0
- package/dist/page/components/{status → panels}/index.js +2 -1
- package/dist/page/hooks/PageController.d.ts +2 -2
- package/dist/page/screens/PageEditor.js +8 -1
- package/dist/styles/index.css +157 -46
- package/dist/styles/tailwind.js +7 -3
- package/dist/users/screens/UserExplorer.js +7 -6
- package/package.json +3 -2
- package/dist/core/components/fields/collection/previews/ClientPreview.d.ts +0 -10
- package/dist/core/components/fields/collection/previews/ClientPreview.js +0 -29
- package/dist/core/components/visuals/SkeletonLayout.d.ts +0 -9
- package/dist/core/components/visuals/SkeletonLayout.js +0 -429
- package/dist/page/components/config/BlockConfig.d.ts +0 -8
- package/dist/page/components/config/BlockConfig.js +0 -28
- package/dist/page/components/config/BlockConfigEditor.d.ts +0 -9
- package/dist/page/components/config/BlockConfigEditor.js +0 -129
- package/dist/page/components/config/BlockPreview.d.ts +0 -10
- package/dist/page/components/config/BlockView.d.ts +0 -4
- package/dist/page/components/config/BlockView.js +0 -9
- package/dist/page/components/config/LegacyBlockConfigEditor.d.ts +0 -9
- package/dist/page/components/config/LegacyBlockConfigEditor.js +0 -27
- package/dist/page/components/config/ListPanelEditor.d.ts +0 -8
- package/dist/page/components/config/ListPanelEditor.js +0 -102
- package/dist/page/components/config/MessagePanelEditor.d.ts +0 -8
- package/dist/page/components/config/MessagePanelEditor.js +0 -17
- package/dist/page/components/config/VisualPanelEditor.d.ts +0 -8
- package/dist/page/components/config/VisualPanelEditor.js +0 -76
- package/dist/page/components/status/index.d.ts +0 -1
- /package/dist/page/components/{status → panels}/AutoSave.d.ts +0 -0
- /package/dist/page/components/{status → panels}/AutoSave.js +0 -0
|
@@ -18,8 +18,8 @@ export declare class CollectionBrowser {
|
|
|
18
18
|
get template(): Schema.Collection;
|
|
19
19
|
get count(): number;
|
|
20
20
|
get items(): readonly CollectionSummary[];
|
|
21
|
-
get languages(): ("
|
|
22
|
-
get defaultLanguage(): "
|
|
21
|
+
get languages(): ("cy" | "fr" | "fy" | "to" | "br" | "hr" | "li" | "th" | "tr" | "id" | "is" | "tw" | "no" | "aa" | "ab" | "ae" | "af" | "ak" | "am" | "an" | "ar" | "as" | "av" | "ay" | "az" | "ba" | "be" | "bg" | "bh" | "bi" | "bm" | "bn" | "bo" | "bs" | "ca" | "ce" | "ch" | "co" | "cr" | "cs" | "cu" | "cv" | "da" | "de" | "dv" | "dz" | "ee" | "el" | "en" | "eo" | "es" | "et" | "eu" | "fa" | "ff" | "fi" | "fj" | "fo" | "ga" | "gd" | "gl" | "gn" | "gu" | "gv" | "ha" | "he" | "hi" | "ho" | "ht" | "hu" | "hy" | "hz" | "ia" | "ie" | "ig" | "ii" | "ik" | "io" | "it" | "iu" | "ja" | "jv" | "ka" | "kg" | "ki" | "kj" | "kk" | "kl" | "km" | "kn" | "ko" | "kr" | "ks" | "ku" | "kv" | "kw" | "ky" | "la" | "lb" | "lg" | "ln" | "lo" | "lt" | "lu" | "lv" | "mg" | "mh" | "mi" | "mk" | "ml" | "mn" | "mr" | "ms" | "mt" | "my" | "na" | "nb" | "nd" | "ne" | "ng" | "nl" | "nn" | "nr" | "nv" | "ny" | "oc" | "oj" | "om" | "or" | "os" | "pa" | "pi" | "pl" | "ps" | "pt" | "qu" | "rm" | "rn" | "ro" | "ru" | "rw" | "sa" | "sc" | "sd" | "se" | "sg" | "si" | "sk" | "sl" | "sm" | "sn" | "so" | "sq" | "sr" | "ss" | "st" | "su" | "sv" | "sw" | "ta" | "te" | "tg" | "ti" | "tk" | "tl" | "tn" | "ts" | "tt" | "ty" | "ug" | "uk" | "ur" | "uz" | "ve" | "vi" | "vo" | "wa" | "wo" | "xh" | "yi" | "yo" | "za" | "zh" | "zu")[];
|
|
22
|
+
get defaultLanguage(): "cy" | "fr" | "fy" | "to" | "br" | "hr" | "li" | "th" | "tr" | "id" | "is" | "tw" | "no" | "aa" | "ab" | "ae" | "af" | "ak" | "am" | "an" | "ar" | "as" | "av" | "ay" | "az" | "ba" | "be" | "bg" | "bh" | "bi" | "bm" | "bn" | "bo" | "bs" | "ca" | "ce" | "ch" | "co" | "cr" | "cs" | "cu" | "cv" | "da" | "de" | "dv" | "dz" | "ee" | "el" | "en" | "eo" | "es" | "et" | "eu" | "fa" | "ff" | "fi" | "fj" | "fo" | "ga" | "gd" | "gl" | "gn" | "gu" | "gv" | "ha" | "he" | "hi" | "ho" | "ht" | "hu" | "hy" | "hz" | "ia" | "ie" | "ig" | "ii" | "ik" | "io" | "it" | "iu" | "ja" | "jv" | "ka" | "kg" | "ki" | "kj" | "kk" | "kl" | "km" | "kn" | "ko" | "kr" | "ks" | "ku" | "kv" | "kw" | "ky" | "la" | "lb" | "lg" | "ln" | "lo" | "lt" | "lu" | "lv" | "mg" | "mh" | "mi" | "mk" | "ml" | "mn" | "mr" | "ms" | "mt" | "my" | "na" | "nb" | "nd" | "ne" | "ng" | "nl" | "nn" | "nr" | "nv" | "ny" | "oc" | "oj" | "om" | "or" | "os" | "pa" | "pi" | "pl" | "ps" | "pt" | "qu" | "rm" | "rn" | "ro" | "ru" | "rw" | "sa" | "sc" | "sd" | "se" | "sg" | "si" | "sk" | "sl" | "sm" | "sn" | "so" | "sq" | "sr" | "ss" | "st" | "su" | "sv" | "sw" | "ta" | "te" | "tg" | "ti" | "tk" | "tl" | "tn" | "ts" | "tt" | "ty" | "ug" | "uk" | "ur" | "uz" | "ve" | "vi" | "vo" | "wa" | "wo" | "xh" | "yi" | "yo" | "za" | "zh" | "zu";
|
|
23
23
|
sync(): Promise<void>;
|
|
24
24
|
private raiseEvent;
|
|
25
25
|
}
|
|
@@ -51,7 +51,7 @@ export declare class CollectionFieldProxy implements IAssetStore, ICollectionSto
|
|
|
51
51
|
getInlineData(): Schema.Collection.Data.AsInline;
|
|
52
52
|
getAssetScope(range: Schema.AssetScope.Range): Schema.AssetScope;
|
|
53
53
|
getSearchScope(): AssetClient.GetAssets.Scope;
|
|
54
|
-
getAsset(
|
|
54
|
+
getAsset(assetId: Asset.Id): Asset | undefined;
|
|
55
55
|
addAsset(asset: Asset): void;
|
|
56
56
|
removeAsset(assetId: Asset.Id): boolean;
|
|
57
57
|
getCollection(collectionId: Schema.Collection.Id): Schema.Collection.Data.AsLink | undefined;
|
|
@@ -62,6 +62,11 @@ export declare class CollectionFieldProxy implements IAssetStore, ICollectionSto
|
|
|
62
62
|
save(shared?: boolean): Promise<void>;
|
|
63
63
|
private raiseEvent;
|
|
64
64
|
static create(args: CollectionFieldProxy.CreateArgs): Promise<CollectionFieldProxy>;
|
|
65
|
+
/**
|
|
66
|
+
* Data format could be either flattened data or inline data.
|
|
67
|
+
* Either way get the underlying inline collection data.
|
|
68
|
+
*/
|
|
69
|
+
private dataFrom;
|
|
65
70
|
}
|
|
66
71
|
export declare namespace CollectionFieldProxy {
|
|
67
72
|
type ConstructorArgs = {
|
|
@@ -72,7 +77,7 @@ export declare namespace CollectionFieldProxy {
|
|
|
72
77
|
collectionSchema: Schema.Collection;
|
|
73
78
|
language: Language;
|
|
74
79
|
initialValue?: Schema.CollectionField.Value;
|
|
75
|
-
initialData?: Schema.Collection.
|
|
80
|
+
initialData?: Schema.Collection.FlattenedData | Schema.Collection.Data.AsInline;
|
|
76
81
|
};
|
|
77
82
|
type CreateArgs = Omit<ConstructorArgs, 'initialData'>;
|
|
78
83
|
type Events = Event | Item.Event | Field.Event | ObjectField.Event | FieldList.Event;
|
|
@@ -22,7 +22,8 @@ class CollectionFieldProxy {
|
|
|
22
22
|
this._initialData = initialData;
|
|
23
23
|
this._syncing = false;
|
|
24
24
|
// initialize name
|
|
25
|
-
const
|
|
25
|
+
const data = this.dataFrom(initialData);
|
|
26
|
+
const name = (data === null || data === void 0 ? void 0 : data.name) || '';
|
|
26
27
|
this.nameField = new funnel_core_1.Field({
|
|
27
28
|
id: 'name',
|
|
28
29
|
name: 'Name',
|
|
@@ -40,7 +41,7 @@ class CollectionFieldProxy {
|
|
|
40
41
|
// initialize tags
|
|
41
42
|
const tags = repository_1.TagSerializer.deserializeTags({
|
|
42
43
|
groups: collectionSchema.tags,
|
|
43
|
-
tagsData: (_a =
|
|
44
|
+
tagsData: (_a = data === null || data === void 0 ? void 0 : data.tags) !== null && _a !== void 0 ? _a : []
|
|
44
45
|
});
|
|
45
46
|
this._initialTags = new Set(tags);
|
|
46
47
|
this._tags = new Set(tags);
|
|
@@ -50,7 +51,7 @@ class CollectionFieldProxy {
|
|
|
50
51
|
id,
|
|
51
52
|
eventBus,
|
|
52
53
|
schema,
|
|
53
|
-
content:
|
|
54
|
+
content: data === null || data === void 0 ? void 0 : data.fields[id],
|
|
54
55
|
snapshot: undefined
|
|
55
56
|
}));
|
|
56
57
|
// initial errors
|
|
@@ -77,14 +78,14 @@ class CollectionFieldProxy {
|
|
|
77
78
|
}
|
|
78
79
|
get assets() {
|
|
79
80
|
const { assetStore, _initialData } = this;
|
|
80
|
-
return funnel_core_1.Schema.Collection.
|
|
81
|
-
? _initialData.files
|
|
81
|
+
return funnel_core_1.Schema.Collection.FlattenedData.filter(_initialData)
|
|
82
|
+
? Object.values(_initialData.files)
|
|
82
83
|
: assetStore.assets;
|
|
83
84
|
}
|
|
84
85
|
get collections() {
|
|
85
86
|
const { collectionStore, _initialData } = this;
|
|
86
|
-
return funnel_core_1.Schema.Collection.
|
|
87
|
-
? _initialData.collections
|
|
87
|
+
return funnel_core_1.Schema.Collection.FlattenedData.filter(_initialData)
|
|
88
|
+
? Object.values(_initialData.collections)
|
|
88
89
|
: collectionStore.collections;
|
|
89
90
|
}
|
|
90
91
|
get groupId() {
|
|
@@ -208,46 +209,31 @@ class CollectionFieldProxy {
|
|
|
208
209
|
? { target: 'collection', type, groupId }
|
|
209
210
|
: assetStore.getSearchScope();
|
|
210
211
|
}
|
|
211
|
-
getAsset(
|
|
212
|
+
getAsset(assetId) {
|
|
212
213
|
const { assetStore, _initialData } = this;
|
|
213
|
-
return funnel_core_1.Schema.Collection.
|
|
214
|
-
? _initialData.files
|
|
215
|
-
: assetStore.getAsset(
|
|
214
|
+
return funnel_core_1.Schema.Collection.FlattenedData.filter(_initialData)
|
|
215
|
+
? _initialData.files[assetId]
|
|
216
|
+
: assetStore.getAsset(assetId);
|
|
216
217
|
}
|
|
217
218
|
addAsset(asset) {
|
|
218
219
|
// forward if not remote
|
|
219
220
|
const { assetStore, _initialData } = this;
|
|
220
|
-
if (!funnel_core_1.Schema.Collection.
|
|
221
|
+
if (!funnel_core_1.Schema.Collection.FlattenedData.filter(_initialData)) {
|
|
221
222
|
return assetStore.addAsset(asset);
|
|
222
223
|
}
|
|
223
|
-
//
|
|
224
|
-
|
|
225
|
-
const { id } = asset.value;
|
|
226
|
-
const assetIndex = files.findIndex(asset => asset.value.id === id);
|
|
227
|
-
if (assetIndex >= 0) {
|
|
228
|
-
files[assetIndex] = asset;
|
|
229
|
-
}
|
|
230
|
-
// or add asset
|
|
231
|
-
else {
|
|
232
|
-
files.push(asset);
|
|
233
|
-
}
|
|
224
|
+
// set asset
|
|
225
|
+
_initialData.files[asset.value.id] = asset;
|
|
234
226
|
// raise event
|
|
235
227
|
this.raiseEvent('changed');
|
|
236
228
|
}
|
|
237
229
|
removeAsset(assetId) {
|
|
238
230
|
// forward if not remote
|
|
239
231
|
const { assetStore, _initialData } = this;
|
|
240
|
-
if (!funnel_core_1.Schema.Collection.
|
|
232
|
+
if (!funnel_core_1.Schema.Collection.FlattenedData.filter(_initialData)) {
|
|
241
233
|
return assetStore.removeAsset(assetId);
|
|
242
234
|
}
|
|
243
|
-
// skip if asset isn't there
|
|
244
|
-
const { files } = _initialData;
|
|
245
|
-
const assetIndex = files.findIndex(asset => asset.value.id === assetId);
|
|
246
|
-
if (assetIndex < 0) {
|
|
247
|
-
return false;
|
|
248
|
-
}
|
|
249
235
|
// remove asset
|
|
250
|
-
files
|
|
236
|
+
delete _initialData.files[assetId];
|
|
251
237
|
// raise event
|
|
252
238
|
this.raiseEvent('changed');
|
|
253
239
|
// indicate success
|
|
@@ -255,44 +241,29 @@ class CollectionFieldProxy {
|
|
|
255
241
|
}
|
|
256
242
|
getCollection(collectionId) {
|
|
257
243
|
const { collectionStore, _initialData } = this;
|
|
258
|
-
return funnel_core_1.Schema.Collection.
|
|
259
|
-
? _initialData.collections
|
|
244
|
+
return funnel_core_1.Schema.Collection.FlattenedData.filter(_initialData)
|
|
245
|
+
? _initialData.collections[collectionId]
|
|
260
246
|
: collectionStore.getCollection(collectionId);
|
|
261
247
|
}
|
|
262
248
|
addCollection(collection) {
|
|
263
249
|
// forward if not remote
|
|
264
250
|
const { collectionStore, _initialData } = this;
|
|
265
|
-
if (!funnel_core_1.Schema.Collection.
|
|
251
|
+
if (!funnel_core_1.Schema.Collection.FlattenedData.filter(_initialData)) {
|
|
266
252
|
return collectionStore.addCollection(collection);
|
|
267
253
|
}
|
|
268
|
-
//
|
|
269
|
-
|
|
270
|
-
const collectionId = collection.id;
|
|
271
|
-
const collectionIndex = collections.findIndex(collection => collection.id === collectionId);
|
|
272
|
-
if (collectionIndex >= 0) {
|
|
273
|
-
collections[collectionIndex] = collection;
|
|
274
|
-
}
|
|
275
|
-
// or add collection
|
|
276
|
-
else {
|
|
277
|
-
collections.push(collection);
|
|
278
|
-
}
|
|
254
|
+
// set collection
|
|
255
|
+
_initialData.collections[collection.id] = collection;
|
|
279
256
|
// raise event
|
|
280
257
|
this.raiseEvent('changed');
|
|
281
258
|
}
|
|
282
259
|
removeCollection(collectionId) {
|
|
283
260
|
// forward if not remote
|
|
284
261
|
const { collectionStore, _initialData } = this;
|
|
285
|
-
if (!funnel_core_1.Schema.Collection.
|
|
262
|
+
if (!funnel_core_1.Schema.Collection.FlattenedData.filter(_initialData)) {
|
|
286
263
|
return collectionStore.removeCollection(collectionId);
|
|
287
264
|
}
|
|
288
|
-
// skip if collection isn't there
|
|
289
|
-
const { collections } = _initialData;
|
|
290
|
-
const collectionIndex = collections.findIndex(collection => collection.id === collectionId);
|
|
291
|
-
if (collectionIndex < 0) {
|
|
292
|
-
return false;
|
|
293
|
-
}
|
|
294
265
|
// remove collection
|
|
295
|
-
collections
|
|
266
|
+
delete _initialData.collections[collectionId];
|
|
296
267
|
// raise event
|
|
297
268
|
this.raiseEvent('changed');
|
|
298
269
|
// indicate success
|
|
@@ -322,7 +293,7 @@ class CollectionFieldProxy {
|
|
|
322
293
|
let initialData = undefined;
|
|
323
294
|
if (_initialData !== undefined) {
|
|
324
295
|
// shared collection means the initial data should be collection data
|
|
325
|
-
if (!funnel_core_1.Schema.Collection.
|
|
296
|
+
if (!funnel_core_1.Schema.Collection.FlattenedData.filter(_initialData)) {
|
|
326
297
|
throw new funnel_core_1.IllegalStateError('Local data is not collection data');
|
|
327
298
|
}
|
|
328
299
|
// set collection data
|
|
@@ -350,8 +321,8 @@ class CollectionFieldProxy {
|
|
|
350
321
|
initialData = collectionData;
|
|
351
322
|
// update initial value
|
|
352
323
|
this._initialValue = {
|
|
353
|
-
id: collectionData.id,
|
|
354
|
-
type: collectionData.type
|
|
324
|
+
id: collectionData.data.id,
|
|
325
|
+
type: collectionData.data.type
|
|
355
326
|
};
|
|
356
327
|
}
|
|
357
328
|
console.debug('[CollectionFieldProxy/save] updating remote instance', initialData);
|
|
@@ -363,34 +334,34 @@ class CollectionFieldProxy {
|
|
|
363
334
|
this.onSaveStart();
|
|
364
335
|
savables.forEach(savable => savable.onSaveStart());
|
|
365
336
|
// update page
|
|
366
|
-
const { collection
|
|
337
|
+
const { collection } = await collectionRepository.editorApi.updateCollection(update);
|
|
367
338
|
// update collection in store and reset if updated
|
|
368
|
-
if (
|
|
339
|
+
if (collection) {
|
|
369
340
|
// add to collection store
|
|
370
|
-
collectionStore.addCollection(
|
|
341
|
+
collectionStore.addCollection(collection.data);
|
|
371
342
|
// reset fields
|
|
372
|
-
nameField.reset(funnel_core_1.Schema.TextField.Value.toData(
|
|
343
|
+
nameField.reset(funnel_core_1.Schema.TextField.Value.toData(collection.data.name));
|
|
373
344
|
fields.forEach(field => {
|
|
374
345
|
var _a, _b, _c;
|
|
375
346
|
if (field instanceof funnel_core_1.Field) {
|
|
376
|
-
field.reset((_a =
|
|
347
|
+
field.reset((_a = collection.data.fields[field.id]) !== null && _a !== void 0 ? _a : null);
|
|
377
348
|
}
|
|
378
349
|
else if (field instanceof funnel_core_1.ObjectField) {
|
|
379
|
-
field.reset((_b =
|
|
350
|
+
field.reset((_b = collection.data.fields[field.id]) !== null && _b !== void 0 ? _b : null);
|
|
380
351
|
}
|
|
381
352
|
else {
|
|
382
|
-
field.reset((_c =
|
|
353
|
+
field.reset((_c = collection.data.fields[field.id]) !== null && _c !== void 0 ? _c : null);
|
|
383
354
|
}
|
|
384
355
|
});
|
|
385
356
|
// update data
|
|
386
|
-
initialData =
|
|
357
|
+
initialData = collection;
|
|
387
358
|
}
|
|
388
359
|
// update collection store with updated local values
|
|
389
360
|
else {
|
|
390
361
|
// update data
|
|
391
|
-
initialData = Object.assign(Object.assign({}, initialData), this.getInlineData());
|
|
362
|
+
initialData.data = Object.assign(Object.assign({}, initialData.data), this.getInlineData());
|
|
392
363
|
// add to collection store
|
|
393
|
-
collectionStore.addCollection(initialData);
|
|
364
|
+
collectionStore.addCollection(initialData.data);
|
|
394
365
|
}
|
|
395
366
|
// complete all updates
|
|
396
367
|
savables.forEach(savable => savable.onSaveComplete());
|
|
@@ -422,6 +393,24 @@ class CollectionFieldProxy {
|
|
|
422
393
|
// return new model
|
|
423
394
|
return new CollectionFieldProxy(Object.assign(Object.assign({}, args), { initialData }));
|
|
424
395
|
}
|
|
396
|
+
/**
|
|
397
|
+
* Data format could be either flattened data or inline data.
|
|
398
|
+
* Either way get the underlying inline collection data.
|
|
399
|
+
*/
|
|
400
|
+
dataFrom(data) {
|
|
401
|
+
// undefined data
|
|
402
|
+
if (data === undefined) {
|
|
403
|
+
return undefined;
|
|
404
|
+
}
|
|
405
|
+
// otherwise check if flattened data (need to return inner data)
|
|
406
|
+
else if (funnel_core_1.Schema.Collection.FlattenedData.filter(data)) {
|
|
407
|
+
return data.data;
|
|
408
|
+
}
|
|
409
|
+
// otherwise inline data
|
|
410
|
+
else {
|
|
411
|
+
return data;
|
|
412
|
+
}
|
|
413
|
+
}
|
|
425
414
|
}
|
|
426
415
|
exports.CollectionFieldProxy = CollectionFieldProxy;
|
|
427
416
|
// extension
|
|
@@ -12,6 +12,11 @@ export declare class SectionBlock<TBlock extends Schema.Block = Schema.Block> ex
|
|
|
12
12
|
get name(): string;
|
|
13
13
|
get config(): ReadonlyArray<FieldModel>;
|
|
14
14
|
get fields(): ReadonlyArray<FieldModel>;
|
|
15
|
+
get nameField(): import("@nascentdigital/funnel-core").Field<Schema.TextField>;
|
|
16
|
+
get messageFields(): readonly FieldModel[];
|
|
17
|
+
get visualFields(): readonly FieldModel[];
|
|
18
|
+
get listsFields(): readonly FieldModel[];
|
|
19
|
+
get extendedFields(): readonly FieldModel[];
|
|
15
20
|
get state(): "undefined" | "invalid" | "valid";
|
|
16
21
|
get value(): Schema.Section.Data.ForBlock;
|
|
17
22
|
get modified(): boolean;
|
|
@@ -28,6 +28,21 @@ class SectionBlock extends ItemBase_1.ItemBase {
|
|
|
28
28
|
get fields() {
|
|
29
29
|
return this.block.fields;
|
|
30
30
|
}
|
|
31
|
+
get nameField() {
|
|
32
|
+
return this.block.nameField;
|
|
33
|
+
}
|
|
34
|
+
get messageFields() {
|
|
35
|
+
return this.block.messageFields;
|
|
36
|
+
}
|
|
37
|
+
get visualFields() {
|
|
38
|
+
return this.block.visualFields;
|
|
39
|
+
}
|
|
40
|
+
get listsFields() {
|
|
41
|
+
return this.block.listsFields;
|
|
42
|
+
}
|
|
43
|
+
get extendedFields() {
|
|
44
|
+
return this.block.extendedFields;
|
|
45
|
+
}
|
|
31
46
|
get state() {
|
|
32
47
|
return this.block.state;
|
|
33
48
|
}
|
|
@@ -1,2 +1,8 @@
|
|
|
1
1
|
import { BlockConfiguration } from '../domain';
|
|
2
|
-
export declare function useBlockConfiguration(
|
|
2
|
+
export declare function useBlockConfiguration(newConfiguration?: BlockConfiguration): BlockConfiguration | undefined;
|
|
3
|
+
export declare const BlockConfigurationContext: import("react").Context<BlockConfigurationContext.Data>;
|
|
4
|
+
export declare namespace BlockConfigurationContext {
|
|
5
|
+
type Data = {
|
|
6
|
+
configuration?: BlockConfiguration;
|
|
7
|
+
};
|
|
8
|
+
}
|
|
@@ -1,11 +1,14 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.BlockConfigurationContext = void 0;
|
|
3
4
|
exports.useBlockConfiguration = useBlockConfiguration;
|
|
4
5
|
const client_1 = require("@nascentdigital/funnel-ui/client");
|
|
5
6
|
const react_1 = require("react");
|
|
6
7
|
// hook
|
|
7
|
-
function useBlockConfiguration(
|
|
8
|
+
function useBlockConfiguration(newConfiguration) {
|
|
8
9
|
// bind touch (for re-rendering parent)
|
|
10
|
+
const { configuration: existingConfiguration } = (0, react_1.useContext)(exports.BlockConfigurationContext);
|
|
11
|
+
const configuration = newConfiguration !== null && newConfiguration !== void 0 ? newConfiguration : existingConfiguration;
|
|
9
12
|
const touch = (0, client_1.useTouch)();
|
|
10
13
|
// listen to configuration changes
|
|
11
14
|
(0, react_1.useEffect)(() => {
|
|
@@ -18,4 +21,8 @@ function useBlockConfiguration(configuration) {
|
|
|
18
21
|
// unsubscribe on unmount
|
|
19
22
|
return () => subscription.unsubscribe();
|
|
20
23
|
}, [configuration, touch]);
|
|
24
|
+
// return configuration
|
|
25
|
+
return configuration;
|
|
21
26
|
}
|
|
27
|
+
// context
|
|
28
|
+
exports.BlockConfigurationContext = (0, react_1.createContext)({});
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { Page } from '../domain';
|
|
2
|
-
export declare function usePossiblePage(): Page | undefined;
|
|
3
|
-
export declare function usePage(): Page;
|
|
2
|
+
export declare function usePossiblePage(newPage?: Page): Page | undefined;
|
|
3
|
+
export declare function usePage(newPage?: Page): Page;
|
|
4
4
|
export declare const PageContext: import("react").Context<PageContext.Data>;
|
|
5
5
|
export declare namespace PageContext {
|
|
6
6
|
type Data = {
|
|
@@ -7,9 +7,10 @@ const funnel_core_1 = require("@nascentdigital/funnel-core");
|
|
|
7
7
|
const client_1 = require("@nascentdigital/funnel-ui/client");
|
|
8
8
|
const react_1 = require("react");
|
|
9
9
|
// hook
|
|
10
|
-
function usePossiblePage() {
|
|
10
|
+
function usePossiblePage(newPage) {
|
|
11
11
|
// bind context + touch
|
|
12
|
-
const { page } = (0, react_1.useContext)(exports.PageContext);
|
|
12
|
+
const { page: existingPage } = (0, react_1.useContext)(exports.PageContext);
|
|
13
|
+
const page = newPage !== null && newPage !== void 0 ? newPage : existingPage;
|
|
13
14
|
const touch = (0, client_1.useTouch)();
|
|
14
15
|
// listen to page changes
|
|
15
16
|
(0, react_1.useEffect)(() => {
|
|
@@ -25,9 +26,9 @@ function usePossiblePage() {
|
|
|
25
26
|
// return page
|
|
26
27
|
return page;
|
|
27
28
|
}
|
|
28
|
-
function usePage() {
|
|
29
|
+
function usePage(newPage) {
|
|
29
30
|
// resolve page
|
|
30
|
-
const page = usePossiblePage();
|
|
31
|
+
const page = usePossiblePage(newPage);
|
|
31
32
|
// throw if there's no page (should never happen)
|
|
32
33
|
if (!page) {
|
|
33
34
|
throw new funnel_core_1.InvalidOperationError('Attempt to access Page outside of PageContext');
|
|
@@ -60,7 +60,7 @@ class CollectionRepository {
|
|
|
60
60
|
if (collectionData) {
|
|
61
61
|
console.debug('[CollectionRepository/save] received new collection');
|
|
62
62
|
const { eventBus, template } = collection;
|
|
63
|
-
return CollectionSerializer_1.CollectionSerializer.deserializeCollection(
|
|
63
|
+
return CollectionSerializer_1.CollectionSerializer.deserializeCollection({ flattenedCollection: collectionData, eventBus, template });
|
|
64
64
|
}
|
|
65
65
|
// or simply update the collection updated stamp
|
|
66
66
|
else {
|
|
@@ -6,9 +6,10 @@ export declare namespace CollectionSerializer {
|
|
|
6
6
|
eventBus: EventBus;
|
|
7
7
|
};
|
|
8
8
|
function deserializeCollectionGroup({ template, eventBus, group: groupData, collection: collectionData }: DeserializeCollectionGroupArgs): CollectionGroup;
|
|
9
|
-
type DeserializeCollectionArgs =
|
|
9
|
+
type DeserializeCollectionArgs = {
|
|
10
|
+
flattenedCollection: Schema.Collection.FlattenedData;
|
|
10
11
|
template: Schema.Collection;
|
|
11
12
|
eventBus: EventBus;
|
|
12
13
|
};
|
|
13
|
-
function deserializeCollection({ eventBus, template,
|
|
14
|
+
function deserializeCollection({ eventBus, template, flattenedCollection }: DeserializeCollectionArgs): Collection;
|
|
14
15
|
}
|
|
@@ -20,7 +20,11 @@ var CollectionSerializer;
|
|
|
20
20
|
(function (CollectionSerializer) {
|
|
21
21
|
function deserializeCollectionGroup({ template, eventBus, group: groupData, collection: collectionData }) {
|
|
22
22
|
// deserialize collection (if any)
|
|
23
|
-
const collection = collectionData && deserializeCollection(
|
|
23
|
+
const collection = collectionData && deserializeCollection({
|
|
24
|
+
flattenedCollection: collectionData,
|
|
25
|
+
template,
|
|
26
|
+
eventBus
|
|
27
|
+
});
|
|
24
28
|
// deserialize summary
|
|
25
29
|
const { groupId, brand, name, instances } = groupData;
|
|
26
30
|
return new domain_1.CollectionGroup({
|
|
@@ -33,8 +37,11 @@ var CollectionSerializer;
|
|
|
33
37
|
});
|
|
34
38
|
}
|
|
35
39
|
CollectionSerializer.deserializeCollectionGroup = deserializeCollectionGroup;
|
|
36
|
-
function deserializeCollection(
|
|
37
|
-
|
|
40
|
+
function deserializeCollection({ eventBus, template, flattenedCollection }) {
|
|
41
|
+
const { data, files, collections } = flattenedCollection;
|
|
42
|
+
const { snapshot, tags, fields, pageIds } = data, dataRest = __rest(data
|
|
43
|
+
// determine latest snapshot (if any)
|
|
44
|
+
, ["snapshot", "tags", "fields", "pageIds"]);
|
|
38
45
|
// determine latest snapshot (if any)
|
|
39
46
|
const { fields: snapshotFields = {} } = snapshot !== null && snapshot !== void 0 ? snapshot : {};
|
|
40
47
|
// create new collection using shared bus
|
|
@@ -42,15 +49,13 @@ var CollectionSerializer;
|
|
|
42
49
|
template, tags: TagSerializer_1.TagSerializer.deserializeTags({
|
|
43
50
|
groups: template.tags,
|
|
44
51
|
tagsData: tags
|
|
45
|
-
}) },
|
|
52
|
+
}) }, dataRest), { fields: Object.entries(template.editableFields).map(([id, schema]) => FieldSerializer_1.FieldSerializer.deserializeField({
|
|
46
53
|
id,
|
|
47
54
|
eventBus,
|
|
48
55
|
schema,
|
|
49
56
|
content: fields[id],
|
|
50
57
|
snapshot: snapshotFields[id]
|
|
51
|
-
})), files,
|
|
52
|
-
collections,
|
|
53
|
-
pageIds,
|
|
58
|
+
})), files: Object.values(files), collections: Object.values(collections), pageIds,
|
|
54
59
|
snapshot }));
|
|
55
60
|
}
|
|
56
61
|
CollectionSerializer.deserializeCollection = deserializeCollection;
|
|
@@ -73,8 +73,8 @@ class PageRepository {
|
|
|
73
73
|
// return new page if it was updated
|
|
74
74
|
if (pageData) {
|
|
75
75
|
console.debug('[PageRepository/save] received new page');
|
|
76
|
-
const { eventBus, template, region } = page;
|
|
77
|
-
return PageSerializer_1.PageSerializer.deserializePage(
|
|
76
|
+
const { eventBus, template, region, language } = page;
|
|
77
|
+
return PageSerializer_1.PageSerializer.deserializePage({ flattenedPage: pageData, eventBus, target: { template, region, language } });
|
|
78
78
|
}
|
|
79
79
|
// or simply update the page updated stamp
|
|
80
80
|
else {
|
|
@@ -5,9 +5,11 @@ export declare namespace PageSerializer {
|
|
|
5
5
|
type DeserializePageWithSummaryArgs = Schema.Page.Data.AsGroup & PageTarget & {
|
|
6
6
|
eventBus: EventBus;
|
|
7
7
|
};
|
|
8
|
-
function deserializePageWithSummary({ eventBus, group: groupData, page:
|
|
9
|
-
type DeserializePageArgs =
|
|
8
|
+
function deserializePageWithSummary({ eventBus, group: groupData, page: flattenedPage, ...target }: DeserializePageWithSummaryArgs): Page.WithSummary;
|
|
9
|
+
type DeserializePageArgs = {
|
|
10
|
+
flattenedPage: Schema.Page.FlattenedData;
|
|
11
|
+
target: PageTarget;
|
|
10
12
|
eventBus: EventBus;
|
|
11
13
|
};
|
|
12
|
-
function deserializePage({
|
|
14
|
+
function deserializePage({ flattenedPage, target, eventBus }: DeserializePageArgs): Page;
|
|
13
15
|
}
|
|
@@ -20,30 +20,30 @@ const TagSerializer_1 = require("./TagSerializer");
|
|
|
20
20
|
var PageSerializer;
|
|
21
21
|
(function (PageSerializer) {
|
|
22
22
|
function deserializePageWithSummary(_a) {
|
|
23
|
-
var { eventBus, group: groupData, page:
|
|
23
|
+
var { eventBus, group: groupData, page: flattenedPage } = _a, target = __rest(_a, ["eventBus", "group", "page"]);
|
|
24
24
|
// deserialize page (if any)
|
|
25
|
-
const {
|
|
26
|
-
const page = pageData && deserializePage(Object.assign(Object.assign({}, pageData), { template, region, eventBus }));
|
|
25
|
+
const page = flattenedPage && deserializePage({ flattenedPage, target, eventBus });
|
|
27
26
|
// deserialize summary
|
|
28
27
|
const { brand, groupId, instances } = groupData;
|
|
29
|
-
const summary = new domain_1.PageSummary(Object.assign(Object.assign({},
|
|
28
|
+
const summary = new domain_1.PageSummary(Object.assign(Object.assign({}, target), { brand,
|
|
30
29
|
groupId, pages: instances }));
|
|
31
30
|
// return result
|
|
32
31
|
return { summary, page };
|
|
33
32
|
}
|
|
34
33
|
PageSerializer.deserializePageWithSummary = deserializePageWithSummary;
|
|
35
|
-
function deserializePage(
|
|
36
|
-
|
|
34
|
+
function deserializePage({ flattenedPage, target, eventBus }) {
|
|
35
|
+
const { data, files, pages, collections } = flattenedPage;
|
|
36
|
+
const { snapshot, discover, content, tags } = data, dataRest = __rest(data, ["snapshot", "discover", "content", "tags"]);
|
|
37
|
+
const { template, region } = target;
|
|
37
38
|
// determine latest snapshot (if any)
|
|
38
39
|
const { discover: discoverSnapshot = {}, preview: previewSnapshot = {}, content: contentSnapshot = {} } = snapshot !== null && snapshot !== void 0 ? snapshot : {};
|
|
39
40
|
// create new page using shared bus
|
|
40
|
-
const region = data.region;
|
|
41
41
|
const pageSchemas = funnel_core_1.Schema.Site.current().regions[region];
|
|
42
42
|
const page = new domain_1.Page(Object.assign(Object.assign({ eventBus,
|
|
43
43
|
template, tags: TagSerializer_1.TagSerializer.deserializeTags({
|
|
44
44
|
groups: template.tags,
|
|
45
45
|
tagsData: tags
|
|
46
|
-
}) },
|
|
46
|
+
}) }, dataRest), { discover: [
|
|
47
47
|
deserializeBlock({ schema: funnel_core_1.Schema.Seo, eventBus, key: 'seo', content: discover['seo'], snapshot: discoverSnapshot['seo'] })
|
|
48
48
|
], content: Object.entries(template.content).map(([key, schema]) => deserializeContent({
|
|
49
49
|
key,
|
|
@@ -51,11 +51,10 @@ var PageSerializer;
|
|
|
51
51
|
eventBus,
|
|
52
52
|
content: content[key],
|
|
53
53
|
snapshot: contentSnapshot[key]
|
|
54
|
-
})), files, pages: pages.map((_a) => {
|
|
54
|
+
})), files: Object.values(files), pages: Object.values(pages).map((_a) => {
|
|
55
55
|
var { type, tags } = _a, ref = __rest(_a, ["type", "tags"]);
|
|
56
56
|
return (Object.assign(Object.assign({}, ref), { template: pageSchemas[type], tags: template.tags.flatMap(tagGroup => tagGroup.parse(tags)) }));
|
|
57
|
-
}), collections,
|
|
58
|
-
snapshot }));
|
|
57
|
+
}), collections: Object.values(collections), snapshot }));
|
|
59
58
|
// repair any issues on the page
|
|
60
59
|
page.repair();
|
|
61
60
|
// return page
|
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { Collection, CollectionBrowser } from '../../core';
|
|
1
|
+
import { Collection, CollectionBrowser, Popup } from '../../core';
|
|
3
2
|
export declare const CreateCollectionDialog: import("react").ForwardRefExoticComponent<import("react").RefAttributes<CreateCollectionDialog.Ref>>;
|
|
4
3
|
export declare namespace CreateCollectionDialog {
|
|
5
4
|
type Props = {};
|
|
@@ -8,6 +7,6 @@ export declare namespace CreateCollectionDialog {
|
|
|
8
7
|
}
|
|
9
8
|
type Options = {
|
|
10
9
|
collectionBrowser: CollectionBrowser;
|
|
11
|
-
anchor:
|
|
10
|
+
anchor: Popup.Anchor;
|
|
12
11
|
};
|
|
13
12
|
}
|
|
@@ -110,7 +110,7 @@ exports.CreateCollectionDialog = (0, react_1.forwardRef)(function CreateCollecti
|
|
|
110
110
|
deferral.resolve(result !== null && result !== void 0 ? result : undefined);
|
|
111
111
|
};
|
|
112
112
|
// skip if we don't have any params
|
|
113
|
-
if (!deferral || !collectionBrowser) {
|
|
113
|
+
if (!deferral || !collectionBrowser || !anchor) {
|
|
114
114
|
return null;
|
|
115
115
|
}
|
|
116
116
|
// render
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { Page, Pages, Site } from '../../core';
|
|
1
|
+
import { Schema } from '@nascentdigital/funnel-core';
|
|
2
|
+
import { Page, Pages, Popup, Site } from '../../core';
|
|
3
3
|
export declare const CreatePageDialog: import("react").ForwardRefExoticComponent<import("react").RefAttributes<CreatePageDialog.Ref>>;
|
|
4
4
|
export declare namespace CreatePageDialog {
|
|
5
5
|
type Props = {};
|
|
@@ -10,6 +10,6 @@ export declare namespace CreatePageDialog {
|
|
|
10
10
|
site: Site;
|
|
11
11
|
template: Schema.Page;
|
|
12
12
|
collection: Pages;
|
|
13
|
-
anchor:
|
|
13
|
+
anchor: Popup.Anchor;
|
|
14
14
|
};
|
|
15
15
|
}
|
|
@@ -159,11 +159,11 @@ exports.CreatePageDialog = (0, react_1.forwardRef)(function CreatePageDialog(_,
|
|
|
159
159
|
deferral.resolve(result !== null && result !== void 0 ? result : undefined);
|
|
160
160
|
};
|
|
161
161
|
// skip if we don't have any params
|
|
162
|
-
if (!deferral || !site || !template) {
|
|
162
|
+
if (!deferral || !site || !template || !anchor) {
|
|
163
163
|
return null;
|
|
164
164
|
}
|
|
165
165
|
// render
|
|
166
|
-
return ((0, jsx_runtime_1.jsxs)(core_1.MiniEditor, { className: "flex flex-col gap-l8", title: `Create new ${(_d = template.name) !== null && _d !== void 0 ? _d : 'page'}`, open: result === undefined, anchor: anchor, anchorOffset: 4, placement: "
|
|
166
|
+
return ((0, jsx_runtime_1.jsxs)(core_1.MiniEditor, { className: "flex flex-col gap-l8", title: `Create new ${(_d = template.name) !== null && _d !== void 0 ? _d : 'page'}`, 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 }), (0, jsx_runtime_1.jsx)(core_1.TextField, { ref: slugFieldRef, field: slugField, onKeyDown: onSlugKeyDown }), multiLanguage &&
|
|
167
167
|
(0, jsx_runtime_1.jsx)(core_1.FieldEditor, { field: languageField })] })] }));
|
|
168
168
|
});
|
|
169
169
|
function getLanguageOptions(site) {
|