@firestitch/block-editor 12.3.26 → 12.3.28
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 +7 -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 +6 -5
- package/esm2015/app/services/blocks-store.service.js +3 -3
- package/fesm2015/firestitch-block-editor.js +8 -7
- 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,8 @@
|
|
|
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)
|
|
971
|
+
.pipe(operators.mapTo(blocks)); }), operators.takeUntil(this._destroy$))
|
|
971
972
|
.subscribe(function (blocks) {
|
|
972
973
|
blocks
|
|
973
974
|
.forEach(function (block, index) {
|
|
@@ -1644,7 +1645,7 @@
|
|
|
1644
1645
|
.subscribe(function () {
|
|
1645
1646
|
_this._cdRef.markForCheck();
|
|
1646
1647
|
});
|
|
1647
|
-
if (this._blockEditor.config.
|
|
1648
|
+
if (this._blockEditor.config.blocksReorder) {
|
|
1648
1649
|
this.blocksReordered = function () {
|
|
1649
1650
|
var _a;
|
|
1650
1651
|
(_a = _this._document.defaultView) === null || _a === void 0 ? void 0 : _a.scrollTo(0, 0);
|