@nascentdigital/funnel-editor 6.1.9 → 7.0.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/components/CollectionHeader.js +17 -3
- package/dist/core/components/fields/EnumField.js +3 -1
- package/dist/core/components/fields/FieldHeader.js +16 -23
- package/dist/core/components/fields/FieldLayout.d.ts +1 -1
- package/dist/core/components/fields/FieldLayout.js +10 -18
- package/dist/core/components/fields/collection/CollectionEditor.js +7 -7
- package/dist/core/components/index.d.ts +1 -0
- package/dist/core/components/index.js +1 -0
- package/dist/core/components/interaction/Combobox.js +17 -28
- package/dist/core/components/interaction/Popup.js +14 -0
- package/dist/core/components/interaction/QuickPicker.js +0 -1
- package/dist/core/components/panels/MessagePanel.d.ts +7 -0
- package/dist/core/components/panels/MessagePanel.js +53 -0
- package/dist/core/components/panels/index.d.ts +2 -0
- package/dist/core/components/panels/index.js +18 -0
- package/dist/core/components/panels/visual/MediaEditor.d.ts +12 -0
- package/dist/core/components/panels/visual/MediaEditor.js +47 -0
- package/dist/core/components/panels/visual/VisualPanel.d.ts +7 -0
- package/dist/core/components/panels/visual/VisualPanel.js +332 -0
- package/dist/core/components/panels/visual/index.d.ts +1 -0
- package/dist/core/components/panels/visual/index.js +17 -0
- package/dist/core/components/visuals/Icon.d.ts +1 -1
- package/dist/core/components/visuals/Icon.js +12 -0
- package/dist/core/domain/Block.d.ts +16 -7
- package/dist/core/domain/Block.js +98 -78
- package/dist/core/domain/BlockConfiguration.d.ts +35 -30
- package/dist/core/domain/BlockConfiguration.js +338 -254
- package/dist/core/domain/CollectionFieldProxy.d.ts +1 -0
- package/dist/core/domain/CollectionFieldProxy.js +5 -0
- package/dist/core/domain/CollectionSummary.d.ts +1 -1
- package/dist/core/domain/CollectionSummary.js +1 -1
- package/dist/core/domain/Collections.d.ts +2 -0
- package/dist/core/domain/Collections.js +6 -0
- package/dist/core/domain/IPage.d.ts +3 -2
- package/dist/core/domain/Item.d.ts +1 -1
- package/dist/core/domain/ItemBase.d.ts +2 -0
- package/dist/core/domain/ItemBase.js +9 -0
- package/dist/core/domain/Page.d.ts +1 -1
- package/dist/core/domain/SectionBlock.d.ts +4 -5
- package/dist/core/domain/SectionBlock.js +3 -10
- package/dist/core/hooks/useBlockConfiguration.d.ts +1 -7
- package/dist/core/hooks/useBlockConfiguration.js +1 -6
- package/dist/core/repository/PageSerializer.js +11 -10
- package/dist/core/repository/SerializeCollectionUpdate.js +4 -4
- package/dist/core/repository/SerializePageUpdate.d.ts +2 -1
- package/dist/core/repository/SerializePageUpdate.js +79 -24
- package/dist/page/components/BlockEditor.js +3 -3
- package/dist/page/components/config/BlockConfigButton.d.ts +3 -1
- package/dist/page/components/config/BlockConfigButton.js +10 -23
- package/dist/page/components/config/BlockPreview.d.ts +7 -6
- package/dist/page/components/config/BlockPreview.js +30 -15
- package/dist/page/components/config/index.d.ts +1 -2
- package/dist/page/components/config/index.js +1 -2
- package/dist/page/components/config/preview/ColumnLayout.d.ts +7 -4
- package/dist/page/components/config/preview/ColumnLayout.js +14 -2
- package/dist/page/components/config/preview/ItemLayout.d.ts +7 -4
- package/dist/page/components/config/preview/ItemLayout.js +24 -11
- package/dist/page/components/config/preview/ListPanel.d.ts +7 -4
- package/dist/page/components/config/preview/ListPanel.js +4 -2
- package/dist/page/components/config/preview/MessagePanel.d.ts +7 -4
- package/dist/page/components/config/preview/MessagePanel.js +6 -3
- package/dist/page/components/config/preview/Panel.d.ts +14 -4
- package/dist/page/components/config/preview/Panel.js +25 -7
- package/dist/page/components/config/preview/PreviewSize.d.ts +1 -0
- package/dist/page/components/config/preview/PreviewSize.js +2 -0
- package/dist/page/components/config/preview/RowLayout.d.ts +7 -4
- package/dist/page/components/config/preview/RowLayout.js +15 -3
- package/dist/page/components/config/preview/StackLayout.d.ts +7 -4
- package/dist/page/components/config/preview/StackLayout.js +14 -2
- package/dist/page/components/config/preview/VisualPanel.d.ts +7 -4
- package/dist/page/components/config/preview/VisualPanel.js +7 -5
- package/dist/page/components/config/preview/index.d.ts +2 -0
- package/dist/page/components/config/preview/index.js +2 -0
- package/dist/page/components/panels/BlockConfigPanel.d.ts +7 -1
- package/dist/page/components/panels/BlockConfigPanel.js +9 -7
- package/dist/page/screens/PageEditor.js +3 -4
- package/dist/styles/index.css +74 -56
- package/package.json +2 -2
- package/dist/page/components/config/BlockConfigurationProvider.d.ts +0 -16
- package/dist/page/components/config/BlockConfigurationProvider.js +0 -25
- package/dist/page/components/config/useBlockConfiguration$.d.ts +0 -3
- package/dist/page/components/config/useBlockConfiguration$.js +0 -22
|
@@ -6,6 +6,7 @@ const funnel_ui_1 = require("@nascentdigital/funnel-ui");
|
|
|
6
6
|
const rxjs_1 = require("rxjs");
|
|
7
7
|
const BlockConfiguration_1 = require("./BlockConfiguration");
|
|
8
8
|
const ItemBase_1 = require("./ItemBase");
|
|
9
|
+
const Section_1 = require("./Section");
|
|
9
10
|
// class
|
|
10
11
|
class Block extends ItemBase_1.ItemBase {
|
|
11
12
|
constructor(args) {
|
|
@@ -14,39 +15,25 @@ class Block extends ItemBase_1.ItemBase {
|
|
|
14
15
|
// initialize instance variables
|
|
15
16
|
this.log = funnel_core_1.Logger.get('editor:page:block');
|
|
16
17
|
this.schema = args.schema;
|
|
17
|
-
this.
|
|
18
|
+
this._configData = args.configData;
|
|
18
19
|
this.fields = args.fields;
|
|
19
|
-
this.nameField = new funnel_core_1.Field({
|
|
20
|
-
id: '_nd-blockName',
|
|
21
|
-
name: 'Name',
|
|
22
|
-
schema: funnel_core_1.Schema.Field.text({
|
|
23
|
-
name: 'Name',
|
|
24
|
-
description: `This is the name used to identify this block.`,
|
|
25
|
-
hint: 'Please provide a name',
|
|
26
|
-
semantics: 'short',
|
|
27
|
-
required: true
|
|
28
|
-
}),
|
|
29
|
-
eventBus: args.eventBus,
|
|
30
|
-
initialValue: args.name
|
|
31
|
-
? funnel_core_1.Schema.TextField.Value.toData(args.name)
|
|
32
|
-
: undefined,
|
|
33
|
-
publishedValue: undefined,
|
|
34
|
-
required: true
|
|
35
|
-
});
|
|
36
20
|
// group fields
|
|
37
21
|
const messageKeys = Object.keys(funnel_ui_1.MessagePanel.Fields.getSchema());
|
|
38
22
|
this.messageFields = this.fields.filter(field => messageKeys.includes(field.id));
|
|
39
23
|
this.visualFields = this.fields.filter(field => field.id === 'visual');
|
|
40
24
|
this.listsFields = this.fields.filter(field => field.id === 'list');
|
|
41
25
|
this.extendedFields = this.fields.filter(field => !messageKeys.includes(field.id) && field.id !== 'visual' && field.id !== 'list');
|
|
42
|
-
// listen to field
|
|
43
|
-
this.fieldChanged
|
|
26
|
+
// listen to field saves
|
|
27
|
+
this.fieldChanged$
|
|
28
|
+
.pipe((0, rxjs_1.filter)(event => event.type === 'saved'))
|
|
29
|
+
.subscribe(event => this.onFieldChange(event));
|
|
44
30
|
}
|
|
45
31
|
get identifier() {
|
|
46
32
|
return this.key;
|
|
47
33
|
}
|
|
48
34
|
get name() {
|
|
49
|
-
|
|
35
|
+
const { _nameField, schema } = this;
|
|
36
|
+
return funnel_core_1.Schema.TextField.Value.fromData(_nameField === null || _nameField === void 0 ? void 0 : _nameField.value) || schema.name;
|
|
50
37
|
}
|
|
51
38
|
get state() {
|
|
52
39
|
return this.activated
|
|
@@ -60,20 +47,31 @@ class Block extends ItemBase_1.ItemBase {
|
|
|
60
47
|
.pipe((0, rxjs_1.filter)(funnel_core_1.Field.Event.filter), (0, rxjs_1.filter)(event => (event.type === 'changed' || event.type === 'reset')
|
|
61
48
|
&& this.fields.includes(event.field)));
|
|
62
49
|
}
|
|
50
|
+
get configData() {
|
|
51
|
+
var _a, _b;
|
|
52
|
+
return (_b = (_a = this._configuration) === null || _a === void 0 ? void 0 : _a.configData) !== null && _b !== void 0 ? _b : this._configData;
|
|
53
|
+
}
|
|
54
|
+
get configuration() {
|
|
55
|
+
// throw if accessed too early
|
|
56
|
+
const { _configuration } = this;
|
|
57
|
+
if (!_configuration) {
|
|
58
|
+
throw new funnel_core_1.InvalidOperationError('Cannot to access Block configuration before being bound to parent');
|
|
59
|
+
}
|
|
60
|
+
// return configuration
|
|
61
|
+
return _configuration;
|
|
62
|
+
}
|
|
63
63
|
get value() {
|
|
64
|
-
|
|
64
|
+
var _a;
|
|
65
|
+
const { log, schema, name, _configuration, fields } = this;
|
|
66
|
+
const { base = {}, mobile, tablet } = (_a = _configuration === null || _configuration === void 0 ? void 0 : _configuration.value) !== null && _a !== void 0 ? _a : {};
|
|
67
|
+
log.d(`value/${name}`, { id: schema.id, base, mobile, tablet });
|
|
65
68
|
return {
|
|
66
69
|
type: 'block',
|
|
67
70
|
id: schema.id,
|
|
68
71
|
version: schema.version,
|
|
69
|
-
config:
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
// bind config (force casting value in case it's not set)
|
|
73
|
-
values[field.id] = field.value;
|
|
74
|
-
// keep reducing
|
|
75
|
-
return values;
|
|
76
|
-
}, {}),
|
|
72
|
+
config: base,
|
|
73
|
+
configMobile: mobile && Object.keys(mobile).length > 0 ? mobile : undefined,
|
|
74
|
+
configTablet: tablet && Object.keys(tablet).length > 0 ? tablet : undefined,
|
|
77
75
|
fields: fields.reduce((values, field) => {
|
|
78
76
|
// bind content
|
|
79
77
|
values[field.id] = field.value;
|
|
@@ -83,70 +81,85 @@ class Block extends ItemBase_1.ItemBase {
|
|
|
83
81
|
};
|
|
84
82
|
}
|
|
85
83
|
get modified() {
|
|
84
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
|
|
86
85
|
// ignore if not activated
|
|
87
|
-
const { activated, isNew,
|
|
86
|
+
const { log, name, activated, isNew, _nameField, _configuration, configData, fields } = this;
|
|
88
87
|
if (isNew && !activated) {
|
|
89
88
|
return false;
|
|
90
89
|
}
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
||
|
|
94
|
-
|| fields.some(field => field.modified)
|
|
90
|
+
const { base = {}, mobile, tablet } = (_a = _configuration === null || _configuration === void 0 ? void 0 : _configuration.value) !== null && _a !== void 0 ? _a : {};
|
|
91
|
+
const modified = (isNew && activated)
|
|
92
|
+
|| (!!_nameField && _nameField.modified)
|
|
93
|
+
|| fields.some(field => field.modified)
|
|
94
|
+
|| !funnel_core_1.Value.equals(base, (_b = configData.base) === null || _b === void 0 ? void 0 : _b.config)
|
|
95
|
+
|| !funnel_core_1.Value.equals(mobile, (_c = configData.mobile) === null || _c === void 0 ? void 0 : _c.config)
|
|
96
|
+
|| !funnel_core_1.Value.equals(tablet, (_d = configData.tablet) === null || _d === void 0 ? void 0 : _d.config);
|
|
97
|
+
log.s(`modified/${name} - block modified = ${modified}`, {
|
|
98
|
+
isNew,
|
|
99
|
+
activated,
|
|
100
|
+
configBase: {
|
|
101
|
+
modified: !funnel_core_1.Value.equals(base, (_e = configData.base) === null || _e === void 0 ? void 0 : _e.config),
|
|
102
|
+
from: (_f = configData.base) === null || _f === void 0 ? void 0 : _f.config,
|
|
103
|
+
to: base
|
|
104
|
+
},
|
|
105
|
+
configMobile: {
|
|
106
|
+
modified: !funnel_core_1.Value.equals(mobile, (_g = configData.mobile) === null || _g === void 0 ? void 0 : _g.config),
|
|
107
|
+
from: (_h = configData.mobile) === null || _h === void 0 ? void 0 : _h.config,
|
|
108
|
+
to: mobile
|
|
109
|
+
},
|
|
110
|
+
configTablet: {
|
|
111
|
+
modified: !funnel_core_1.Value.equals(tablet, (_j = configData.tablet) === null || _j === void 0 ? void 0 : _j.config),
|
|
112
|
+
from: (_k = configData.tablet) === null || _k === void 0 ? void 0 : _k.config,
|
|
113
|
+
to: tablet
|
|
114
|
+
}
|
|
115
|
+
});
|
|
116
|
+
return modified;
|
|
95
117
|
}
|
|
96
118
|
get changes() {
|
|
119
|
+
var _a;
|
|
120
|
+
const { _configuration, fields } = this;
|
|
97
121
|
return {
|
|
98
122
|
block: this,
|
|
99
|
-
config:
|
|
100
|
-
fields:
|
|
123
|
+
config: (_a = _configuration === null || _configuration === void 0 ? void 0 : _configuration.fields.filter(field => field.changed)) !== null && _a !== void 0 ? _a : [],
|
|
124
|
+
fields: fields.filter(field => field.changed)
|
|
101
125
|
};
|
|
102
126
|
}
|
|
103
127
|
get valid() {
|
|
104
|
-
return this.
|
|
105
|
-
&& this.fields.every(field => field.valid);
|
|
128
|
+
return this.fields.every(field => field.valid);
|
|
106
129
|
}
|
|
107
130
|
get errors() {
|
|
108
131
|
return {
|
|
109
132
|
block: this,
|
|
110
|
-
config:
|
|
133
|
+
config: [],
|
|
111
134
|
fields: this.fields.filter(field => !field.valid)
|
|
112
135
|
};
|
|
113
136
|
}
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
super.bind(parentContext);
|
|
117
|
-
// sync config if we are already activated
|
|
118
|
-
if (this.activated) {
|
|
119
|
-
this.syncBlockConfig();
|
|
120
|
-
}
|
|
137
|
+
get sectionBlock() {
|
|
138
|
+
return this._sectionBlock;
|
|
121
139
|
}
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
return new BlockConfiguration_1.BlockConfiguration({ block: this, assetStore: root, collectionStore: root });
|
|
140
|
+
get nameField() {
|
|
141
|
+
return this._nameField;
|
|
125
142
|
}
|
|
126
|
-
|
|
127
|
-
//
|
|
128
|
-
const
|
|
129
|
-
if (
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
}
|
|
135
|
-
setConfig(config) {
|
|
136
|
-
console.warn(`[Block/setConfig] updating "${this.name}" config with:`, config);
|
|
137
|
-
// map fields
|
|
138
|
-
config.forEach(updatedField => {
|
|
139
|
-
// find source field (or ignore)
|
|
140
|
-
const { id, schema } = updatedField;
|
|
141
|
-
const field = this.config.find(field => field.id === id && field.schema === schema);
|
|
142
|
-
if (!field) {
|
|
143
|
-
console.warn(`[Block/setConfig] unable to find field [${schema.type}/${id}]`);
|
|
144
|
-
}
|
|
145
|
-
// sync basic field
|
|
146
|
-
else {
|
|
147
|
-
field.value = updatedField.value;
|
|
143
|
+
onBind(parentContext) {
|
|
144
|
+
// look for owning parent (if any)
|
|
145
|
+
const { parent } = parentContext;
|
|
146
|
+
if (parent instanceof Section_1.Section) {
|
|
147
|
+
for (const sectionBlock of parent.blocks) {
|
|
148
|
+
if (sectionBlock.block === this) {
|
|
149
|
+
this._sectionBlock = sectionBlock;
|
|
150
|
+
}
|
|
148
151
|
}
|
|
149
|
-
}
|
|
152
|
+
}
|
|
153
|
+
// create config if we are already activated
|
|
154
|
+
if (this.activated) {
|
|
155
|
+
const { root, configData } = this;
|
|
156
|
+
this._configuration = new BlockConfiguration_1.BlockConfiguration({
|
|
157
|
+
configData,
|
|
158
|
+
block: this,
|
|
159
|
+
assetStore: root,
|
|
160
|
+
collectionStore: root
|
|
161
|
+
});
|
|
162
|
+
}
|
|
150
163
|
}
|
|
151
164
|
getField(fieldId) {
|
|
152
165
|
// get field (or throw)
|
|
@@ -284,7 +297,7 @@ class Block extends ItemBase_1.ItemBase {
|
|
|
284
297
|
key: this.key,
|
|
285
298
|
schema: this.schema,
|
|
286
299
|
eventBus: this.eventBus,
|
|
287
|
-
|
|
300
|
+
configData: funnel_core_1.ObjectUtils.clone(this.configData),
|
|
288
301
|
fields: this.fields.map(field => field.clone()),
|
|
289
302
|
required: this.required,
|
|
290
303
|
exists: forceExists || this.activated
|
|
@@ -331,16 +344,23 @@ class Block extends ItemBase_1.ItemBase {
|
|
|
331
344
|
break;
|
|
332
345
|
}
|
|
333
346
|
});
|
|
347
|
+
// bind configuration
|
|
348
|
+
const { root, configData } = this;
|
|
349
|
+
this._configuration = new BlockConfiguration_1.BlockConfiguration({
|
|
350
|
+
configData,
|
|
351
|
+
block: this,
|
|
352
|
+
assetStore: root,
|
|
353
|
+
collectionStore: root
|
|
354
|
+
});
|
|
334
355
|
}
|
|
335
356
|
syncBlockConfig() {
|
|
357
|
+
var _a;
|
|
336
358
|
// guard: block fields must be ready AND block must exist and be activated
|
|
337
359
|
if (!this.activated) {
|
|
338
360
|
throw new funnel_core_1.InvalidOperationError('Cannot sync config for an unactivated block');
|
|
339
361
|
}
|
|
340
|
-
//
|
|
341
|
-
|
|
342
|
-
// save the config
|
|
343
|
-
config.save();
|
|
362
|
+
// sync all configuration
|
|
363
|
+
(_a = this._configuration) === null || _a === void 0 ? void 0 : _a.syncAll();
|
|
344
364
|
}
|
|
345
365
|
onFieldChange(event) {
|
|
346
366
|
// sync config changes
|
|
@@ -3,32 +3,34 @@ import { ListPanel, MessagePanel, PanelLayout, SlotVariation, VisualPanel } from
|
|
|
3
3
|
import { Block } from './Block';
|
|
4
4
|
import { IAssetStore } from './IAssetStore';
|
|
5
5
|
import { ICollectionStore } from './ICollectionStore';
|
|
6
|
-
import { SectionBlock } from './SectionBlock';
|
|
7
6
|
export declare class BlockConfiguration {
|
|
8
7
|
readonly log: Logger;
|
|
9
8
|
readonly eventBus: EventBus;
|
|
10
9
|
readonly assetStore: IAssetStore;
|
|
11
10
|
readonly collectionStore: ICollectionStore;
|
|
12
|
-
readonly sectionBlock?: SectionBlock;
|
|
13
11
|
readonly block: Block;
|
|
14
|
-
|
|
15
|
-
private
|
|
16
|
-
private
|
|
12
|
+
readonly configData: Block.ConfigData;
|
|
13
|
+
private readonly _fields;
|
|
14
|
+
private readonly _createdVariants;
|
|
15
|
+
private readonly _deletedVariants;
|
|
16
|
+
private _variant;
|
|
17
17
|
private _layout?;
|
|
18
18
|
private _slotState;
|
|
19
|
-
private
|
|
20
|
-
private
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
get
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
get
|
|
19
|
+
private _value?;
|
|
20
|
+
private _modifiedOn?;
|
|
21
|
+
private _savingOn?;
|
|
22
|
+
constructor({ block, assetStore, collectionStore, configData, variant }: BlockConfiguration.ConstructorArgs);
|
|
23
|
+
get events$(): import("rxjs").Observable<BlockConfiguration.Event>;
|
|
24
|
+
get fields(): FieldModel.Config[];
|
|
25
|
+
getFields(variant: Schema.Block.Config.Variant): ReadonlyArray<FieldModel.Config>;
|
|
26
|
+
get value(): Record<Schema.Block.Config.Variant, Schema.Block.Data.ForConfig | undefined>;
|
|
27
|
+
get variant(): Schema.Block.Config.Variant;
|
|
28
|
+
set variant(variant: Schema.Block.Config.Variant);
|
|
29
|
+
isVariantAvailable(variant: Schema.Block.Config.Variant): boolean;
|
|
30
|
+
get blockFields(): FieldModel.Config[];
|
|
31
|
+
get blockExtendedFields(): FieldModel.Config[];
|
|
28
32
|
get blockFieldData(): Schema.Block.Data.ForFields<Schema.Fields>;
|
|
29
|
-
get
|
|
30
|
-
get mobileFields(): FieldModel.Config[];
|
|
31
|
-
get nameField(): FieldModel.Config | undefined;
|
|
33
|
+
get nameField(): Field<Schema.TextField> | undefined;
|
|
32
34
|
get themeField(): FieldModel.Config | undefined;
|
|
33
35
|
get layoutField(): Field<Schema.EnumField<Schema.EnumField.Options<PanelLayout>>> | undefined;
|
|
34
36
|
get slotState(): Readonly<BlockConfiguration.SlotState>;
|
|
@@ -41,23 +43,20 @@ export declare class BlockConfiguration {
|
|
|
41
43
|
get visualFields(): Record<keyof VisualPanel.Config.Keys<'visual'>, FieldModel.Config | undefined>;
|
|
42
44
|
get extendedFields(): Record<string, FieldModel.Config>;
|
|
43
45
|
get layout(): BlockLayout | undefined;
|
|
44
|
-
|
|
45
|
-
get valid(): boolean;
|
|
46
|
-
get modified(): boolean;
|
|
46
|
+
getPossibleField(fieldId: string): FieldModel.Config | undefined;
|
|
47
47
|
getField(fieldId: string): FieldModel.Config;
|
|
48
48
|
getFieldData(fieldId: string): Schema.Field.LinkedData | undefined;
|
|
49
|
-
getEditableField(fieldId: string): FieldModel.Config | undefined;
|
|
50
|
-
save(): void;
|
|
51
|
-
resetToDefault(): void;
|
|
52
|
-
get isConfigInDefault(): boolean | undefined;
|
|
53
49
|
setPanelLayout(layout: PanelLayout): void;
|
|
54
|
-
sync(): void;
|
|
55
|
-
|
|
56
|
-
|
|
50
|
+
sync({ variant: targetVariant, coerce }?: Partial<BlockConfiguration.SyncArgs>): void;
|
|
51
|
+
private syncLayout;
|
|
52
|
+
syncAll(coerce?: boolean): void;
|
|
53
|
+
createVariant(variant: Schema.Block.Config.Variant.Override): void;
|
|
54
|
+
deleteVariant(variant: Schema.Block.Config.Variant.Override): void;
|
|
55
|
+
onSaveStart(): void;
|
|
56
|
+
onSaveComplete(): void;
|
|
57
57
|
private raiseEvent;
|
|
58
58
|
}
|
|
59
59
|
export declare namespace BlockConfiguration {
|
|
60
|
-
type Scope = 'desktop' | 'mobile';
|
|
61
60
|
type SlotState = {
|
|
62
61
|
field?: Field<Schema.EnumField<Schema.EnumField.Options<SlotVariation>>>;
|
|
63
62
|
options: ReadonlyArray<SlotVariation>;
|
|
@@ -67,13 +66,19 @@ export declare namespace BlockConfiguration {
|
|
|
67
66
|
type ConstructorArgs = {
|
|
68
67
|
assetStore: IAssetStore;
|
|
69
68
|
collectionStore: ICollectionStore;
|
|
70
|
-
block: Block
|
|
69
|
+
block: Block;
|
|
70
|
+
configData: Block.ConfigData;
|
|
71
|
+
variant?: Schema.Block.Config.Variant;
|
|
72
|
+
};
|
|
73
|
+
type SyncArgs = {
|
|
74
|
+
variant?: Schema.Block.Config.Variant;
|
|
75
|
+
coerce?: boolean;
|
|
71
76
|
};
|
|
72
77
|
interface Event extends EventBus.Event<'BlockConfiguration', Event.Type> {
|
|
73
78
|
configuration: BlockConfiguration;
|
|
74
79
|
}
|
|
75
80
|
namespace Event {
|
|
76
|
-
type Type = 'changed' | 'modified';
|
|
81
|
+
type Type = 'changed' | 'modified' | 'layout.updated';
|
|
77
82
|
function filter(event: EventBus.Event): event is Event;
|
|
78
83
|
function create(event: EventBus.Args<Event>): Event;
|
|
79
84
|
}
|