@firestitch/block-editor 12.3.26 → 12.3.27
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/app/interfaces/block-editor-config.d.ts +3 -3
- package/bundles/firestitch-block-editor.umd.js +6 -6
- package/bundles/firestitch-block-editor.umd.js.map +1 -1
- package/esm2015/app/components/sidebar/sidebar.component.js +2 -2
- package/esm2015/app/interfaces/block-editor-config.js +1 -1
- package/esm2015/app/services/block-editor.service.js +4 -4
- package/esm2015/app/services/blocks-store.service.js +3 -3
- package/fesm2015/firestitch-block-editor.js +6 -6
- package/fesm2015/firestitch-block-editor.js.map +1 -1
- package/package.json +1 -1
|
@@ -10,11 +10,11 @@ export interface BlockEditorConfig {
|
|
|
10
10
|
marginLeft?: number;
|
|
11
11
|
blocks?: Block[];
|
|
12
12
|
defaultValidation?: (block: Block, value: any) => Observable<any>;
|
|
13
|
-
|
|
13
|
+
blockChange?: (block: Block) => void;
|
|
14
14
|
blockAdd?: (block: Block) => Observable<Block>;
|
|
15
15
|
blockUpload?: (block: Block, file: Blob) => Observable<Block>;
|
|
16
16
|
blocksRemove?: (block: Block[]) => Observable<any>;
|
|
17
17
|
blocksLevelChanged?: (blocks: Block[]) => void;
|
|
18
|
-
|
|
19
|
-
|
|
18
|
+
blocksSelect?: (blocks: Block[]) => void;
|
|
19
|
+
blocksReorder?: (blocks: Block[]) => Observable<any>;
|
|
20
20
|
}
|
|
@@ -632,11 +632,11 @@
|
|
|
632
632
|
var _this = this;
|
|
633
633
|
this._config = config;
|
|
634
634
|
this._setBlocks(this._config.blocks);
|
|
635
|
-
if (this._config.
|
|
635
|
+
if (this._config.blockChange) {
|
|
636
636
|
this.blockChanged$
|
|
637
637
|
.pipe(operators.groupBy(function (block) { return (block.guid); }), operators.map(function (group) { return group.pipe(operators.debounceTime(250)); }), operators.mergeAll())
|
|
638
638
|
.subscribe(function (block) {
|
|
639
|
-
_this._config.
|
|
639
|
+
_this._config.blockChange(block);
|
|
640
640
|
});
|
|
641
641
|
}
|
|
642
642
|
};
|
|
@@ -921,8 +921,8 @@
|
|
|
921
921
|
},
|
|
922
922
|
set: function (blocks) {
|
|
923
923
|
this._selectedBlocks$.next(blocks);
|
|
924
|
-
if (this.config.
|
|
925
|
-
this.config.
|
|
924
|
+
if (this.config.blocksSelect) {
|
|
925
|
+
this.config.blocksSelect(blocks);
|
|
926
926
|
}
|
|
927
927
|
},
|
|
928
928
|
enumerable: false,
|
|
@@ -967,7 +967,7 @@
|
|
|
967
967
|
}
|
|
968
968
|
})
|
|
969
969
|
.afterClosed()
|
|
970
|
-
.pipe(operators.filter(function (blocks) { return !!blocks; }), operators.switchMap(function (blocks) { return _this.config.
|
|
970
|
+
.pipe(operators.filter(function (blocks) { return !!blocks; }), operators.switchMap(function (blocks) { return _this.config.blocksReorder(blocks); }), operators.takeUntil(this._destroy$))
|
|
971
971
|
.subscribe(function (blocks) {
|
|
972
972
|
blocks
|
|
973
973
|
.forEach(function (block, index) {
|
|
@@ -1644,7 +1644,7 @@
|
|
|
1644
1644
|
.subscribe(function () {
|
|
1645
1645
|
_this._cdRef.markForCheck();
|
|
1646
1646
|
});
|
|
1647
|
-
if (this._blockEditor.config.
|
|
1647
|
+
if (this._blockEditor.config.blocksReorder) {
|
|
1648
1648
|
this.blocksReordered = function () {
|
|
1649
1649
|
var _a;
|
|
1650
1650
|
(_a = _this._document.defaultView) === null || _a === void 0 ? void 0 : _a.scrollTo(0, 0);
|