@anglr/dynamic 1.0.0-beta.20221012104031 → 1.0.0-beta.20221105113020
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/basic-components/src/dynamicItems/block/block.component.d.ts +11 -0
- package/basic-components/src/dynamicItems/block/block.component.d.ts.map +1 -0
- package/basic-components/src/dynamicItems/block/block.component.html +1 -0
- package/basic-components/src/dynamicItems/block/block.metadata.d.ts +8 -0
- package/basic-components/src/dynamicItems/block/block.metadata.d.ts.map +1 -0
- package/basic-components/src/dynamicItems/block/block.options.d.ts +11 -0
- package/basic-components/src/dynamicItems/block/block.options.d.ts.map +1 -0
- package/basic-components/src/dynamicItems/block/index.d.ts +2 -0
- package/basic-components/src/dynamicItems/block/index.d.ts.map +1 -0
- package/basic-components/src/dynamicItems/block/metadata/block.layoutMetadata.d.ts +31 -0
- package/basic-components/src/dynamicItems/block/metadata/block.layoutMetadata.d.ts.map +1 -0
- package/basic-components/src/dynamicItems/block/metadata/block.model.d.ts +13 -0
- package/basic-components/src/dynamicItems/block/metadata/block.model.d.ts.map +1 -0
- package/basic-components/src/dynamicItems/block/type.d.ts +5 -0
- package/basic-components/src/dynamicItems/block/type.d.ts.map +1 -0
- package/basic-components/src/dynamicItems/index.d.ts +1 -0
- package/basic-components/src/dynamicItems/index.d.ts.map +1 -1
- package/basic-components/src/types.d.ts.map +1 -1
- package/es2015/basic-components/src/dynamicItems/block/block.component.js +24 -0
- package/es2015/basic-components/src/dynamicItems/block/block.component.js.map +1 -0
- package/es2015/basic-components/src/dynamicItems/block/block.metadata.js +6 -0
- package/es2015/basic-components/src/dynamicItems/block/block.metadata.js.map +1 -0
- package/es2015/basic-components/src/dynamicItems/block/block.options.js +2 -0
- package/es2015/basic-components/src/dynamicItems/block/block.options.js.map +1 -0
- package/es2015/basic-components/src/dynamicItems/block/index.js +2 -0
- package/es2015/basic-components/src/dynamicItems/block/index.js.map +1 -0
- package/es2015/basic-components/src/dynamicItems/block/metadata/block.layoutMetadata.js +50 -0
- package/es2015/basic-components/src/dynamicItems/block/metadata/block.layoutMetadata.js.map +1 -0
- package/es2015/basic-components/src/dynamicItems/block/metadata/block.model.js +11 -0
- package/es2015/basic-components/src/dynamicItems/block/metadata/block.model.js.map +1 -0
- package/es2015/basic-components/src/dynamicItems/block/type.js +5 -0
- package/es2015/basic-components/src/dynamicItems/block/type.js.map +1 -0
- package/es2015/basic-components/src/dynamicItems/index.js +1 -0
- package/es2015/basic-components/src/dynamicItems/index.js.map +1 -1
- package/es2015/basic-components/src/types.js +1 -0
- package/es2015/basic-components/src/types.js.map +1 -1
- package/es2015/layout-editor/src/components/layoutDesigner/layoutDesigner.component.js +3 -3
- package/es2015/layout-editor/src/components/layoutDesigner/layoutDesigner.component.js.map +1 -1
- package/es2015/src/services/editorHotkeys/editorHotkeys.service.js +4 -4
- package/es2015/src/services/editorHotkeys/editorHotkeys.service.js.map +1 -1
- package/es2020/basic-components/src/dynamicItems/block/block.component.js +24 -0
- package/es2020/basic-components/src/dynamicItems/block/block.component.js.map +1 -0
- package/es2020/basic-components/src/dynamicItems/block/block.metadata.js +5 -0
- package/es2020/basic-components/src/dynamicItems/block/block.metadata.js.map +1 -0
- package/es2020/basic-components/src/dynamicItems/block/block.options.js +2 -0
- package/es2020/basic-components/src/dynamicItems/block/block.options.js.map +1 -0
- package/es2020/basic-components/src/dynamicItems/block/index.js +2 -0
- package/es2020/basic-components/src/dynamicItems/block/index.js.map +1 -0
- package/es2020/basic-components/src/dynamicItems/block/metadata/block.layoutMetadata.js +50 -0
- package/es2020/basic-components/src/dynamicItems/block/metadata/block.layoutMetadata.js.map +1 -0
- package/es2020/basic-components/src/dynamicItems/block/metadata/block.model.js +11 -0
- package/es2020/basic-components/src/dynamicItems/block/metadata/block.model.js.map +1 -0
- package/es2020/basic-components/src/dynamicItems/block/type.js +5 -0
- package/es2020/basic-components/src/dynamicItems/block/type.js.map +1 -0
- package/es2020/basic-components/src/dynamicItems/index.js +1 -0
- package/es2020/basic-components/src/dynamicItems/index.js.map +1 -1
- package/es2020/basic-components/src/types.js +1 -0
- package/es2020/basic-components/src/types.js.map +1 -1
- package/es2020/layout-editor/src/components/layoutDesigner/layoutDesigner.component.js +3 -3
- package/es2020/layout-editor/src/components/layoutDesigner/layoutDesigner.component.js.map +1 -1
- package/es2020/src/services/editorHotkeys/editorHotkeys.service.js +4 -4
- package/es2020/src/services/editorHotkeys/editorHotkeys.service.js.map +1 -1
- package/layout-editor/src/components/layoutDesigner/layoutDesigner.component.html +1 -0
- package/package.json +9 -9
- package/version.bak +1 -1
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { LayoutComponent, LayoutComponentBase } from '@anglr/dynamic/layout';
|
|
2
|
+
import { BlockComponentOptions } from './block.options';
|
|
3
|
+
import * as i0 from "@angular/core";
|
|
4
|
+
/**
|
|
5
|
+
* Component used for displaying block
|
|
6
|
+
*/
|
|
7
|
+
export declare class BlockSAComponent extends LayoutComponentBase<BlockComponentOptions> implements LayoutComponent<BlockComponentOptions> {
|
|
8
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<BlockSAComponent, never>;
|
|
9
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<BlockSAComponent, "div", never, {}, {}, never, never, true>;
|
|
10
|
+
}
|
|
11
|
+
//# sourceMappingURL=block.component.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"block.component.d.ts","sourceRoot":"","sources":["block.component.ts"],"names":[],"mappings":"AACA,OAAO,EAAC,eAAe,EAAE,mBAAmB,EAAqC,MAAM,uBAAuB,CAAC;AAG/G,OAAO,EAAC,qBAAqB,EAAC,MAAM,iBAAiB,CAAC;;AAGtD;;GAEG;AACH,qBAYa,gBAAiB,SAAQ,mBAAmB,CAAC,qBAAqB,CAAE,YAAW,eAAe,CAAC,qBAAqB,CAAC;yCAArH,gBAAgB;2CAAhB,gBAAgB;CAE5B"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
<ng-template [layoutComponentRenderer]="options?.content"></ng-template>
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { DynamicMetadataLoader } from '@anglr/dynamic';
|
|
2
|
+
import { LayoutEditorMetadataDescriptor } from '@anglr/dynamic/layout-editor';
|
|
3
|
+
import { BlockComponentOptions } from './block.options';
|
|
4
|
+
/**
|
|
5
|
+
* Block layout metadata loader
|
|
6
|
+
*/
|
|
7
|
+
export declare const BlockLayoutMetadataLoader: DynamicMetadataLoader<LayoutEditorMetadataDescriptor<BlockComponentOptions>>;
|
|
8
|
+
//# sourceMappingURL=block.metadata.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"block.metadata.d.ts","sourceRoot":"","sources":["block.metadata.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,qBAAqB,EAAC,MAAM,gBAAgB,CAAC;AACrD,OAAO,EAAC,8BAA8B,EAAC,MAAM,8BAA8B,CAAC;AAE5E,OAAO,EAAC,qBAAqB,EAAC,MAAM,iBAAiB,CAAC;AAEtD;;GAEG;AACH,eAAO,MAAM,yBAAyB,EAAE,qBAAqB,CAAC,8BAA8B,CAAC,qBAAqB,CAAC,CAAiG,CAAC"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { LayoutComponentMetadata } from '@anglr/dynamic/layout';
|
|
2
|
+
/**
|
|
3
|
+
* Options for block component
|
|
4
|
+
*/
|
|
5
|
+
export interface BlockComponentOptions {
|
|
6
|
+
/**
|
|
7
|
+
* Metadata for component displayed as content of block
|
|
8
|
+
*/
|
|
9
|
+
content: LayoutComponentMetadata | undefined | null;
|
|
10
|
+
}
|
|
11
|
+
//# sourceMappingURL=block.options.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"block.options.d.ts","sourceRoot":"","sources":["block.options.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,uBAAuB,EAAC,MAAM,uBAAuB,CAAC;AAE9D;;GAEG;AACH,MAAM,WAAW,qBAAqB;IAElC;;OAEG;IACH,OAAO,EAAE,uBAAuB,GAAC,SAAS,GAAC,IAAI,CAAC;CACnD"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["index.ts"],"names":[],"mappings":"AAAA,cAAc,iBAAiB,CAAC"}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { LayoutEditorMetadataDescriptor, LayoutEditorMetadataInfo } from '@anglr/dynamic/layout-editor';
|
|
2
|
+
import { LayoutComponentMetadata } from '@anglr/dynamic/layout';
|
|
3
|
+
import { Action, Func } from '@jscrpt/common';
|
|
4
|
+
import { BlockComponentOptions } from '../block.options';
|
|
5
|
+
/**
|
|
6
|
+
* Block layout metadata
|
|
7
|
+
*/
|
|
8
|
+
export declare class BlockLayoutEditorMetadata implements LayoutEditorMetadataDescriptor<BlockComponentOptions> {
|
|
9
|
+
/**
|
|
10
|
+
* @inheritdoc
|
|
11
|
+
*/
|
|
12
|
+
metaInfo?: LayoutEditorMetadataInfo<BlockComponentOptions>;
|
|
13
|
+
/**
|
|
14
|
+
* @inheritdoc
|
|
15
|
+
*/
|
|
16
|
+
addDescendant?: Action<[LayoutComponentMetadata, BlockComponentOptions, number]>;
|
|
17
|
+
/**
|
|
18
|
+
* @inheritdoc
|
|
19
|
+
*/
|
|
20
|
+
canDropMetadata?: Func<boolean, [BlockComponentOptions | undefined | null]>;
|
|
21
|
+
/**
|
|
22
|
+
* @inheritdoc
|
|
23
|
+
*/
|
|
24
|
+
getDescendants?: Func<LayoutComponentMetadata[], [BlockComponentOptions | undefined | null]>;
|
|
25
|
+
/**
|
|
26
|
+
* @inheritdoc
|
|
27
|
+
*/
|
|
28
|
+
removeDescendant?: Action<[string, BlockComponentOptions]>;
|
|
29
|
+
constructor();
|
|
30
|
+
}
|
|
31
|
+
//# sourceMappingURL=block.layoutMetadata.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"block.layoutMetadata.d.ts","sourceRoot":"","sources":["block.layoutMetadata.ts"],"names":[],"mappings":"AAAA,OAAO,EAAoE,8BAA8B,EAAE,wBAAwB,EAAC,MAAM,8BAA8B,CAAC;AACzK,OAAO,EAAC,uBAAuB,EAAC,MAAM,uBAAuB,CAAC;AAC9D,OAAO,EAAC,MAAM,EAAE,IAAI,EAAC,MAAM,gBAAgB,CAAC;AAE5C,OAAO,EAAC,qBAAqB,EAAC,MAAM,kBAAkB,CAAC;AAEvD;;GAEG;AACH,qBAAa,yBAA0B,YAAW,8BAA8B,CAAC,qBAAqB,CAAC;IAInG;;OAEG;IACI,QAAQ,CAAC,EAAE,wBAAwB,CAAC,qBAAqB,CAAC,CAkB/D;IAEF;;OAEG;IACI,aAAa,CAAC,EAAE,MAAM,CAAC,CAAC,uBAAuB,EAAE,qBAAqB,EAAE,MAAM,CAAC,CAAC,CAGrF;IAEF;;OAEG;IACI,eAAe,CAAC,EAAE,IAAI,CAAC,OAAO,EAAE,CAAC,qBAAqB,GAAC,SAAS,GAAC,IAAI,CAAC,CAAC,CAAgC;IAE9G;;OAEG;IACI,cAAc,CAAC,EAAE,IAAI,CAAC,uBAAuB,EAAE,EAAE,CAAC,qBAAqB,GAAC,SAAS,GAAC,IAAI,CAAC,CAAC,CAAyD;IAExJ;;OAEG;IACI,gBAAgB,CAAC,EAAE,MAAM,CAAC,CAAC,MAAM,EAAE,qBAAqB,CAAC,CAAC,CAGhE;;CAOJ"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { LayoutComponentMetadata } from '@anglr/dynamic/layout';
|
|
2
|
+
import { BlockComponentOptions } from '../block.options';
|
|
3
|
+
/**
|
|
4
|
+
* Block model for properties editor
|
|
5
|
+
*/
|
|
6
|
+
export declare class BlockModel implements BlockComponentOptions {
|
|
7
|
+
/**
|
|
8
|
+
* @inheritdoc
|
|
9
|
+
*/
|
|
10
|
+
content: LayoutComponentMetadata | undefined | null;
|
|
11
|
+
constructor(value: BlockComponentOptions | undefined | null);
|
|
12
|
+
}
|
|
13
|
+
//# sourceMappingURL=block.model.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"block.model.d.ts","sourceRoot":"","sources":["block.model.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,uBAAuB,EAAC,MAAM,uBAAuB,CAAC;AAG9D,OAAO,EAAC,qBAAqB,EAAC,MAAM,kBAAkB,CAAC;AAEvD;;GAEG;AACH,qBAAa,UAAW,YAAW,qBAAqB;IAIpD;;OAEG;IACI,OAAO,EAAE,uBAAuB,GAAC,SAAS,GAAC,IAAI,CAAC;gBAG3C,KAAK,EAAE,qBAAqB,GAAC,SAAS,GAAC,IAAI;CAI1D"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"type.d.ts","sourceRoot":"","sources":["type.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,yBAAyB,EAAC,MAAM,uBAAuB,CAAC;AAEhE,OAAO,EAAC,gBAAgB,EAAC,MAAM,mBAAmB,CAAC;AAEnD,eAAe,gBAAgB,CAAC;AAEhC,eAAO,MAAM,UAAU,sCAA8B,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["index.ts"],"names":[],"mappings":"AAAA,cAAc,UAAU,CAAC;AACzB,cAAc,iBAAiB,CAAC;AAChC,cAAc,gBAAgB,CAAC;AAC/B,cAAc,aAAa,CAAC;AAC5B,cAAc,iBAAiB,CAAC;AAChC,cAAc,aAAa,CAAC;AAC5B,cAAc,WAAW,CAAC;AAC1B,cAAc,aAAa,CAAC;AAC5B,cAAc,cAAc,CAAC;AAC7B,cAAc,aAAa,CAAC;AAC5B,cAAc,YAAY,CAAC;AAC3B,cAAc,YAAY,CAAC;AAC3B,cAAc,cAAc,CAAC;AAC7B,cAAc,cAAc,CAAC;AAC7B,cAAc,iBAAiB,CAAC;AAChC,cAAc,aAAa,CAAC;AAC5B,cAAc,gBAAgB,CAAC;AAC/B,cAAc,iBAAiB,CAAC;AAChC,cAAc,SAAS,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["index.ts"],"names":[],"mappings":"AAAA,cAAc,SAAS,CAAC;AACxB,cAAc,UAAU,CAAC;AACzB,cAAc,iBAAiB,CAAC;AAChC,cAAc,gBAAgB,CAAC;AAC/B,cAAc,aAAa,CAAC;AAC5B,cAAc,iBAAiB,CAAC;AAChC,cAAc,aAAa,CAAC;AAC5B,cAAc,WAAW,CAAC;AAC1B,cAAc,aAAa,CAAC;AAC5B,cAAc,cAAc,CAAC;AAC7B,cAAc,aAAa,CAAC;AAC5B,cAAc,YAAY,CAAC;AAC3B,cAAc,YAAY,CAAC;AAC3B,cAAc,cAAc,CAAC;AAC7B,cAAc,cAAc,CAAC;AAC7B,cAAc,iBAAiB,CAAC;AAChC,cAAc,aAAa,CAAC;AAC5B,cAAc,gBAAgB,CAAC;AAC/B,cAAc,iBAAiB,CAAC;AAChC,cAAc,SAAS,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["types.ts"],"names":[],"mappings":"AAAA,QAAA,MAAM,UAAU,
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["types.ts"],"names":[],"mappings":"AAAA,QAAA,MAAM,UAAU,UAYf,CAAC;AAEF,eAAe,UAAU,CAAC"}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { __decorate } from "tslib";
|
|
2
|
+
import { Component, ChangeDetectionStrategy } from '@angular/core';
|
|
3
|
+
import { LayoutComponentBase, LayoutComponentRendererSADirective } from '@anglr/dynamic/layout';
|
|
4
|
+
import { LayoutEditorMetadata } from '@anglr/dynamic/layout-editor';
|
|
5
|
+
import { BlockLayoutMetadataLoader } from './block.metadata';
|
|
6
|
+
import * as i0 from "@angular/core";
|
|
7
|
+
/**
|
|
8
|
+
* Component used for displaying block
|
|
9
|
+
*/
|
|
10
|
+
let BlockSAComponent = class BlockSAComponent extends LayoutComponentBase {
|
|
11
|
+
};
|
|
12
|
+
BlockSAComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.1.0", ngImport: i0, type: BlockSAComponent, deps: null, target: i0.ɵɵFactoryTarget.Component });
|
|
13
|
+
BlockSAComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.1.0", type: BlockSAComponent, isStandalone: true, selector: "div", usesInheritance: true, ngImport: i0, template: "<ng-template [layoutComponentRenderer]=\"options?.content\"></ng-template>", dependencies: [{ kind: "directive", type: LayoutComponentRendererSADirective, selector: "[layoutComponentRenderer]", inputs: ["layoutComponentRenderer", "layoutComponentRendererInjector", "layoutComponentRendererDisableTransformer"], outputs: ["layoutComponentRendererComponentChange", "componentElementChange"], exportAs: ["layoutComponentRenderer"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
14
|
+
BlockSAComponent = __decorate([
|
|
15
|
+
LayoutEditorMetadata(BlockLayoutMetadataLoader)
|
|
16
|
+
], BlockSAComponent);
|
|
17
|
+
export { BlockSAComponent };
|
|
18
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.1.0", ngImport: i0, type: BlockSAComponent, decorators: [{
|
|
19
|
+
type: Component,
|
|
20
|
+
args: [{ selector: 'div', standalone: true, imports: [
|
|
21
|
+
LayoutComponentRendererSADirective,
|
|
22
|
+
], changeDetection: ChangeDetectionStrategy.OnPush, template: "<ng-template [layoutComponentRenderer]=\"options?.content\"></ng-template>" }]
|
|
23
|
+
}] });
|
|
24
|
+
//# sourceMappingURL=block.component.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"block.component.js","sourceRoot":"","sources":["../../../../../basic-components/src/dynamicItems/block/block.component.ts","../../../../../basic-components/src/dynamicItems/block/block.component.html"],"names":[],"mappings":";AAAA,OAAO,EAAC,SAAS,EAAE,uBAAuB,EAAC,MAAM,eAAe,CAAC;AACjE,OAAO,EAAkB,mBAAmB,EAAE,kCAAkC,EAAC,MAAM,uBAAuB,CAAC;AAC/G,OAAO,EAAC,oBAAoB,EAAC,MAAM,8BAA8B,CAAC;AAGlE,OAAO,EAAC,yBAAyB,EAAC,MAAM,kBAAkB,CAAC;;AAE3D;;GAEG;IAaU,gBAAgB,SAAhB,gBAAiB,SAAQ,mBAA0C;CAE/E,CAAA;6GAFY,gBAAgB;iGAAhB,gBAAgB,sFCtB7B,4EAAwE,4CDiBhE,kCAAkC;AAK7B,gBAAgB;IAD5B,oBAAoB,CAAC,yBAAyB,CAAC;GACnC,gBAAgB,CAE5B;SAFY,gBAAgB;2FAAhB,gBAAgB;kBAZ5B,SAAS;+BAEI,KAAK,cAEH,IAAI,WAEhB;wBACI,kCAAkC;qBACrC,mBACgB,uBAAuB,CAAC,MAAM","sourcesContent":["import {Component, ChangeDetectionStrategy} from '@angular/core';\nimport {LayoutComponent, LayoutComponentBase, LayoutComponentRendererSADirective} from '@anglr/dynamic/layout';\nimport {LayoutEditorMetadata} from '@anglr/dynamic/layout-editor';\n\nimport {BlockComponentOptions} from './block.options';\nimport {BlockLayoutMetadataLoader} from './block.metadata';\n\n/**\n * Component used for displaying block\n */\n@Component(\n{\n selector: 'div',\n templateUrl: 'block.component.html',\n standalone: true,\n imports:\n [\n LayoutComponentRendererSADirective,\n ],\n changeDetection: ChangeDetectionStrategy.OnPush\n})\n@LayoutEditorMetadata(BlockLayoutMetadataLoader)\nexport class BlockSAComponent extends LayoutComponentBase<BlockComponentOptions> implements LayoutComponent<BlockComponentOptions>\n{\n}","<ng-template [layoutComponentRenderer]=\"options?.content\"></ng-template>"]}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { __awaiter } from "tslib";
|
|
2
|
+
/**
|
|
3
|
+
* Block layout metadata loader
|
|
4
|
+
*/
|
|
5
|
+
export const BlockLayoutMetadataLoader = () => __awaiter(void 0, void 0, void 0, function* () { return new (yield import('./metadata/block.layoutMetadata')).BlockLayoutEditorMetadata(); });
|
|
6
|
+
//# sourceMappingURL=block.metadata.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"block.metadata.js","sourceRoot":"","sources":["../../../../../basic-components/src/dynamicItems/block/block.metadata.ts"],"names":[],"mappings":";AAKA;;GAEG;AACH,MAAM,CAAC,MAAM,yBAAyB,GAAiF,GAAS,EAAE,kDAAC,OAAA,IAAI,CAAC,MAAM,MAAM,CAAC,iCAAiC,CAAC,CAAC,CAAC,yBAAyB,EAAE,CAAA,GAAA,CAAC","sourcesContent":["import {DynamicMetadataLoader} from '@anglr/dynamic';\nimport {LayoutEditorMetadataDescriptor} from '@anglr/dynamic/layout-editor';\n\nimport {BlockComponentOptions} from './block.options';\n\n/**\n * Block layout metadata loader\n */\nexport const BlockLayoutMetadataLoader: DynamicMetadataLoader<LayoutEditorMetadataDescriptor<BlockComponentOptions>> = async () => new (await import('./metadata/block.layoutMetadata')).BlockLayoutEditorMetadata();\n"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"block.options.js","sourceRoot":"","sources":["../../../../../basic-components/src/dynamicItems/block/block.options.ts"],"names":[],"mappings":"","sourcesContent":["import {LayoutComponentMetadata} from '@anglr/dynamic/layout';\n\n/**\n * Options for block component\n */\nexport interface BlockComponentOptions\n{\n /**\n * Metadata for component displayed as content of block\n */\n content: LayoutComponentMetadata|undefined|null;\n}"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../basic-components/src/dynamicItems/block/index.ts"],"names":[],"mappings":"AAAA,cAAc,iBAAiB,CAAC","sourcesContent":["export * from './block.options';\n"]}
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
import { ComponentStylingModel, ComponentStylingPropertiesControlComponent } from '@anglr/dynamic/layout-editor';
|
|
2
|
+
/**
|
|
3
|
+
* Block layout metadata
|
|
4
|
+
*/
|
|
5
|
+
export class BlockLayoutEditorMetadata {
|
|
6
|
+
//######################### constructor #########################
|
|
7
|
+
constructor() {
|
|
8
|
+
//######################### public properties - implementation of LayoutEditorMetadataDescriptor #########################
|
|
9
|
+
/**
|
|
10
|
+
* @inheritdoc
|
|
11
|
+
*/
|
|
12
|
+
this.metaInfo = {
|
|
13
|
+
name: 'Block',
|
|
14
|
+
description: 'Block element, wraps content, allows custom styling',
|
|
15
|
+
group: 'Layout',
|
|
16
|
+
optionsMetadata: {
|
|
17
|
+
propertiesMetadata: [
|
|
18
|
+
{
|
|
19
|
+
modelType: ComponentStylingModel,
|
|
20
|
+
propertiesControls: [
|
|
21
|
+
ComponentStylingPropertiesControlComponent,
|
|
22
|
+
],
|
|
23
|
+
},
|
|
24
|
+
]
|
|
25
|
+
},
|
|
26
|
+
};
|
|
27
|
+
/**
|
|
28
|
+
* @inheritdoc
|
|
29
|
+
*/
|
|
30
|
+
this.addDescendant = (metadata, options) => {
|
|
31
|
+
options.content = metadata;
|
|
32
|
+
};
|
|
33
|
+
/**
|
|
34
|
+
* @inheritdoc
|
|
35
|
+
*/
|
|
36
|
+
this.canDropMetadata = options => !(options === null || options === void 0 ? void 0 : options.content);
|
|
37
|
+
/**
|
|
38
|
+
* @inheritdoc
|
|
39
|
+
*/
|
|
40
|
+
this.getDescendants = options => (options === null || options === void 0 ? void 0 : options.content) ? [options === null || options === void 0 ? void 0 : options.content] : [];
|
|
41
|
+
/**
|
|
42
|
+
* @inheritdoc
|
|
43
|
+
*/
|
|
44
|
+
this.removeDescendant = (_, options) => {
|
|
45
|
+
options.content = null;
|
|
46
|
+
};
|
|
47
|
+
Object.freeze(this);
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
//# sourceMappingURL=block.layoutMetadata.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"block.layoutMetadata.js","sourceRoot":"","sources":["../../../../../../basic-components/src/dynamicItems/block/metadata/block.layoutMetadata.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,qBAAqB,EAAE,0CAA0C,EAA2D,MAAM,8BAA8B,CAAC;AAMzK;;GAEG;AACH,MAAM,OAAO,yBAAyB;IAqDlC,iEAAiE;IACjE;QApDA,0HAA0H;QAE1H;;WAEG;QACI,aAAQ,GACf;YACI,IAAI,EAAE,OAAO;YACb,WAAW,EAAE,qDAAqD;YAClE,KAAK,EAAE,QAAQ;YACf,eAAe,EACf;gBACI,kBAAkB,EAClB;oBACI;wBACI,SAAS,EAAE,qBAAqB;wBAChC,kBAAkB,EAClB;4BACI,0CAA0C;yBAC7C;qBACJ;iBACJ;aACJ;SACJ,CAAC;QAEF;;WAEG;QACI,kBAAa,GAAsE,CAAC,QAAQ,EAAE,OAAO,EAAE,EAAE;YAE5G,OAAO,CAAC,OAAO,GAAG,QAAQ,CAAC;QAC/B,CAAC,CAAC;QAEF;;WAEG;QACI,oBAAe,GAA2D,OAAO,CAAC,EAAE,CAAC,CAAC,CAAA,OAAO,aAAP,OAAO,uBAAP,OAAO,CAAE,OAAO,CAAA,CAAC;QAE9G;;WAEG;QACI,mBAAc,GAA6E,OAAO,CAAC,EAAE,CAAC,CAAA,OAAO,aAAP,OAAO,uBAAP,OAAO,CAAE,OAAO,EAAC,CAAC,CAAC,CAAC,OAAO,aAAP,OAAO,uBAAP,OAAO,CAAE,OAAO,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC;QAExJ;;WAEG;QACI,qBAAgB,GAA6C,CAAC,CAAC,EAAE,OAAO,EAAE,EAAE;YAE/E,OAAO,CAAC,OAAO,GAAG,IAAI,CAAC;QAC3B,CAAC,CAAA;QAKG,MAAM,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC;IACxB,CAAC;CACJ","sourcesContent":["import {ComponentStylingModel, ComponentStylingPropertiesControlComponent, LayoutEditorMetadataDescriptor, LayoutEditorMetadataInfo} from '@anglr/dynamic/layout-editor';\nimport {LayoutComponentMetadata} from '@anglr/dynamic/layout';\nimport {Action, Func} from '@jscrpt/common';\n\nimport {BlockComponentOptions} from '../block.options';\n\n/**\n * Block layout metadata\n */\nexport class BlockLayoutEditorMetadata implements LayoutEditorMetadataDescriptor<BlockComponentOptions>\n{\n //######################### public properties - implementation of LayoutEditorMetadataDescriptor #########################\n\n /**\n * @inheritdoc\n */\n public metaInfo?: LayoutEditorMetadataInfo<BlockComponentOptions> =\n {\n name: 'Block',\n description: 'Block element, wraps content, allows custom styling',\n group: 'Layout',\n optionsMetadata:\n {\n propertiesMetadata:\n [\n {\n modelType: ComponentStylingModel,\n propertiesControls:\n [\n ComponentStylingPropertiesControlComponent,\n ],\n },\n ]\n },\n };\n\n /**\n * @inheritdoc\n */\n public addDescendant?: Action<[LayoutComponentMetadata, BlockComponentOptions, number]> = (metadata, options) =>\n {\n options.content = metadata;\n };\n\n /**\n * @inheritdoc\n */\n public canDropMetadata?: Func<boolean, [BlockComponentOptions|undefined|null]> = options => !options?.content;\n\n /**\n * @inheritdoc\n */\n public getDescendants?: Func<LayoutComponentMetadata[], [BlockComponentOptions|undefined|null]> = options => options?.content ? [options?.content] : [];\n\n /**\n * @inheritdoc\n */\n public removeDescendant?: Action<[string, BlockComponentOptions]> = (_, options) =>\n {\n options.content = null;\n }\n\n //######################### constructor #########################\n constructor()\n {\n Object.freeze(this);\n }\n}"]}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { mapValuesToThis } from '@jscrpt/common';
|
|
2
|
+
/**
|
|
3
|
+
* Block model for properties editor
|
|
4
|
+
*/
|
|
5
|
+
export class BlockModel {
|
|
6
|
+
//######################### constructor #########################
|
|
7
|
+
constructor(value) {
|
|
8
|
+
mapValuesToThis.bind(this)(value);
|
|
9
|
+
}
|
|
10
|
+
}
|
|
11
|
+
//# sourceMappingURL=block.model.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"block.model.js","sourceRoot":"","sources":["../../../../../../basic-components/src/dynamicItems/block/metadata/block.model.ts"],"names":[],"mappings":"AACA,OAAO,EAAC,eAAe,EAAC,MAAM,gBAAgB,CAAC;AAI/C;;GAEG;AACH,MAAM,OAAO,UAAU;IASnB,iEAAiE;IACjE,YAAY,KAA2C;QAEnD,eAAe,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,KAAK,CAAC,CAAC;IACtC,CAAC;CACJ","sourcesContent":["import {LayoutComponentMetadata} from '@anglr/dynamic/layout';\nimport {mapValuesToThis} from '@jscrpt/common';\n\nimport {BlockComponentOptions} from '../block.options';\n\n/**\n * Block model for properties editor\n */\nexport class BlockModel implements BlockComponentOptions\n{\n //######################### public properties #########################\n\n /**\n * @inheritdoc\n */\n public content: LayoutComponentMetadata|undefined|null;\n\n //######################### constructor #########################\n constructor(value: BlockComponentOptions|undefined|null)\n {\n mapValuesToThis.bind(this)(value);\n }\n}"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"type.js","sourceRoot":"","sources":["../../../../../basic-components/src/dynamicItems/block/type.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,yBAAyB,EAAC,MAAM,uBAAuB,CAAC;AAEhE,OAAO,EAAC,gBAAgB,EAAC,MAAM,mBAAmB,CAAC;AAEnD,eAAe,gBAAgB,CAAC;AAEhC,MAAM,CAAC,MAAM,UAAU,GAAG,CAAC,yBAAyB,CAAC,CAAC","sourcesContent":["import {ComponentStylingExtension} from '@anglr/dynamic/layout';\n\nimport {BlockSAComponent} from './block.component';\n\nexport default BlockSAComponent;\n\nexport const extensions = [ComponentStylingExtension];"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../basic-components/src/dynamicItems/index.ts"],"names":[],"mappings":"AAAA,cAAc,UAAU,CAAC;AACzB,cAAc,iBAAiB,CAAC;AAChC,cAAc,gBAAgB,CAAC;AAC/B,cAAc,aAAa,CAAC;AAC5B,cAAc,iBAAiB,CAAC;AAChC,cAAc,aAAa,CAAC;AAC5B,cAAc,WAAW,CAAC;AAC1B,cAAc,aAAa,CAAC;AAC5B,cAAc,cAAc,CAAC;AAC7B,cAAc,aAAa,CAAC;AAC5B,cAAc,YAAY,CAAC;AAC3B,cAAc,YAAY,CAAC;AAC3B,cAAc,cAAc,CAAC;AAC7B,cAAc,cAAc,CAAC;AAC7B,cAAc,iBAAiB,CAAC;AAChC,cAAc,aAAa,CAAC;AAC5B,cAAc,gBAAgB,CAAC;AAC/B,cAAc,iBAAiB,CAAC;AAChC,cAAc,SAAS,CAAC","sourcesContent":["export * from './button';\nexport * from './debounceValue';\nexport * from './firstNonNull';\nexport * from './gridPanel';\nexport * from './gridPanelCell';\nexport * from './htmlBlock';\nexport * from './ifBlock';\nexport * from './listBlock';\nexport * from './logicalAnd';\nexport * from './logicalOr';\nexport * from './negation';\nexport * from './notFound';\nexport * from './stackPanel';\nexport * from './syncValues';\nexport * from './templateBlock';\nexport * from './textBlock';\nexport * from './toggleButton';\nexport * from './transformData';\nexport * from './value';\n"]}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../basic-components/src/dynamicItems/index.ts"],"names":[],"mappings":"AAAA,cAAc,SAAS,CAAC;AACxB,cAAc,UAAU,CAAC;AACzB,cAAc,iBAAiB,CAAC;AAChC,cAAc,gBAAgB,CAAC;AAC/B,cAAc,aAAa,CAAC;AAC5B,cAAc,iBAAiB,CAAC;AAChC,cAAc,aAAa,CAAC;AAC5B,cAAc,WAAW,CAAC;AAC1B,cAAc,aAAa,CAAC;AAC5B,cAAc,cAAc,CAAC;AAC7B,cAAc,aAAa,CAAC;AAC5B,cAAc,YAAY,CAAC;AAC3B,cAAc,YAAY,CAAC;AAC3B,cAAc,cAAc,CAAC;AAC7B,cAAc,cAAc,CAAC;AAC7B,cAAc,iBAAiB,CAAC;AAChC,cAAc,aAAa,CAAC;AAC5B,cAAc,gBAAgB,CAAC;AAC/B,cAAc,iBAAiB,CAAC;AAChC,cAAc,SAAS,CAAC","sourcesContent":["export * from './block';\nexport * from './button';\nexport * from './debounceValue';\nexport * from './firstNonNull';\nexport * from './gridPanel';\nexport * from './gridPanelCell';\nexport * from './htmlBlock';\nexport * from './ifBlock';\nexport * from './listBlock';\nexport * from './logicalAnd';\nexport * from './logicalOr';\nexport * from './negation';\nexport * from './notFound';\nexport * from './stackPanel';\nexport * from './syncValues';\nexport * from './templateBlock';\nexport * from './textBlock';\nexport * from './toggleButton';\nexport * from './transformData';\nexport * from './value';\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../../basic-components/src/types.ts"],"names":[],"mappings":"AAAA,MAAM,UAAU,GAChB;IACI,QAAQ;IACR,WAAW;IACX,WAAW;IACX,SAAS;IACT,WAAW;IACX,YAAY;IACZ,eAAe;IACf,WAAW;IACX,cAAc;CACjB,CAAC;AAEF,eAAe,UAAU,CAAC","sourcesContent":["const components = \n[\n 'button',\n 'gridPanel',\n 'htmlBlock',\n 'ifBlock',\n 'listBlock',\n 'stackPanel',\n 'templateBlock',\n 'textBlock',\n 'toggleButton',\n];\n\nexport default components;\n"]}
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../../basic-components/src/types.ts"],"names":[],"mappings":"AAAA,MAAM,UAAU,GAChB;IACI,OAAO;IACP,QAAQ;IACR,WAAW;IACX,WAAW;IACX,SAAS;IACT,WAAW;IACX,YAAY;IACZ,eAAe;IACf,WAAW;IACX,cAAc;CACjB,CAAC;AAEF,eAAe,UAAU,CAAC","sourcesContent":["const components = \n[\n 'block',\n 'button',\n 'gridPanel',\n 'htmlBlock',\n 'ifBlock',\n 'listBlock',\n 'stackPanel',\n 'templateBlock',\n 'textBlock',\n 'toggleButton',\n];\n\nexport default components;\n"]}
|
|
@@ -266,9 +266,9 @@ export class LayoutDesignerSAComponent extends LayoutComponentBase {
|
|
|
266
266
|
}
|
|
267
267
|
}
|
|
268
268
|
LayoutDesignerSAComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.1.0", ngImport: i0, type: LayoutDesignerSAComponent, deps: [{ token: i0.ChangeDetectorRef }, { token: i0.ElementRef }, { token: i0.Injector }, { token: i1.LayoutEditorMetadataExtractor }, { token: i1.LayoutEditorMetadataManager }, { token: i1.LayoutComponentsIteratorService }, { token: LAYOUT_HISTORY_MANAGER }, { token: SCOPE_ID, optional: true }, { token: LOGGER, optional: true }, { token: LayoutDesignerSAComponent, optional: true, skipSelf: true }], target: i0.ɵɵFactoryTarget.Component });
|
|
269
|
-
LayoutDesignerSAComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.1.0", type: LayoutDesignerSAComponent, isStandalone: true, selector: "layout-designer-component", viewQueries: [{ propertyName: "designerElement", first: true, predicate: ["layoutDesigner"], descendants: true, static: true }, { propertyName: "dndCoreDesigner", first: true, predicate: ["dndCoreDesigner"], descendants: true, static: true }], usesInheritance: true, ngImport: i0, template: "<div class=\"designer-overlay\" \n #layoutDesigner\n #dndCore=\"dndCoreDesigner\"\n [dndCoreDesigner]=\"{metadata: renderedType, parentId: parent?.renderedType?.id, index: index}\"\n [dropzoneElement]=\"layoutDropzone\"\n [dragDisabled]=\"dragDisabled\"\n [dragSource]=\"dndCore.drag\"\n [noHTML5Preview]=\"true\"\n (dropMetadata)=\"addDescendant($event)\"\n [copyDesignerStyles]=\"renderedType\"\n (mouseleave)=\"hideOverlay($event)\"\n (mouseover)=\"showOverlay($event)\"\n (click)=\"selectComponent($event)\"\n (dblclick)=\"unselectComponent($event)\">\n <div class=\"designer-dropzone\"\n #layoutDropzone\n designerMinWidth\n [canDrop]=\"canDrop\"\n [editorMetadata]=\"editorMetadata\"\n [horizontal]=\"parent?.horizontal ?? false\"\n [dropTarget]=\"dndCore.dropzone\"\n [isDropZone]=\"canDrop\">\n <ng-template #renderer=\"layoutComponentRenderer\" [layoutComponentRenderer]=\"renderedType\" [layoutComponentRendererDisableTransformer]=\"true\"></ng-template>\n\n <ng-container *ngIf=\"highlighted || selected\">\n <div class=\"designer-overlay-border\"></div>\n <div class=\"designer-overlay-layout\" [layoutDesignerOverlayFor]=\"renderer\"></div>\n\n <div class=\"designer-overlay-title\"\n *bodyRender\n [positionTo]=\"layoutDesigner\"\n placement=\"TopStart\">{{editorMetadata?.metaInfo?.name ?? renderedType?.name}}</div>\n\n <ng-container *ngIf=\"!!parent && parent.editorMetadata?.removeDescendant\">\n <div *bodyRender\n class=\"designer-overlay-remove\"\n [positionTo]=\"layoutDesigner\"\n placement=\"TopEnd\"\n (click)=\"remove()\">\n <span class=\"fas fa-times\"></span>\n </div>\n </ng-container>\n </ng-container>\n </div>\n</div>\n", dependencies: [{ kind: "ngmodule", type:
|
|
269
|
+
LayoutDesignerSAComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.1.0", type: LayoutDesignerSAComponent, isStandalone: true, selector: "layout-designer-component", viewQueries: [{ propertyName: "designerElement", first: true, predicate: ["layoutDesigner"], descendants: true, static: true }, { propertyName: "dndCoreDesigner", first: true, predicate: ["dndCoreDesigner"], descendants: true, static: true }], usesInheritance: true, ngImport: i0, template: "<div class=\"designer-overlay\" \n #layoutDesigner\n #dndCore=\"dndCoreDesigner\"\n [dndCoreDesigner]=\"{metadata: renderedType, parentId: parent?.renderedType?.id, index: index}\"\n [dropzoneElement]=\"layoutDropzone\"\n [dragDisabled]=\"dragDisabled\"\n [dragSource]=\"dndCore.drag\"\n [noHTML5Preview]=\"true\"\n (dropMetadata)=\"addDescendant($event)\"\n [copyDesignerStyles]=\"renderedType\"\n (mouseleave)=\"hideOverlay($event)\"\n (mouseover)=\"showOverlay($event)\"\n (click)=\"selectComponent($event)\"\n (dblclick)=\"unselectComponent($event)\">\n <div class=\"designer-dropzone\"\n #layoutDropzone\n designerMinWidth\n [canDrop]=\"canDrop\"\n [editorMetadata]=\"editorMetadata\"\n [horizontal]=\"parent?.horizontal ?? false\"\n [dropTarget]=\"dndCore.dropzone\"\n [isDropZone]=\"canDrop\">\n <ng-template #renderer=\"layoutComponentRenderer\" [layoutComponentRenderer]=\"renderedType\" [layoutComponentRendererDisableTransformer]=\"true\"></ng-template>\n\n <ng-container *ngIf=\"highlighted || selected\">\n <div class=\"designer-overlay-border\"></div>\n <div class=\"designer-overlay-layout\" [layoutDesignerOverlayFor]=\"renderer\"></div>\n\n <div class=\"designer-overlay-title\"\n *bodyRender\n [positionTo]=\"layoutDesigner\"\n placement=\"TopStart\">{{editorMetadata?.metaInfo?.name ?? renderedType?.name}}</div>\n\n <ng-container *ngIf=\"!!parent && parent.editorMetadata?.removeDescendant\">\n <div *bodyRender\n class=\"designer-overlay-remove\"\n [positionTo]=\"layoutDesigner\"\n [offset]=\"{mainAxis: -18, alignmentAxis: -6}\"\n placement=\"TopEnd\"\n (click)=\"remove()\">\n <span class=\"fas fa-times\"></span>\n </div>\n </ng-container>\n </ng-container>\n </div>\n</div>\n", dependencies: [{ kind: "ngmodule", type:
|
|
270
270
|
//TODO: cleanup
|
|
271
|
-
CommonModule }, { kind: "directive", type: i2.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "ngmodule", type: PositionModule }, { kind: "directive", type: i3.PositionToDirective, selector: "[positionTo]", inputs: ["positionTo", "placement"], outputs: ["flip"] }, { kind: "component", type: LayoutDesignerOverlayForSAComponent, selector: "[layoutDesignerOverlayFor]", inputs: ["layoutDesignerOverlayFor"] }, { kind: "directive", type: DesignerMinDimensionSADirective, selector: "[designerMinWidth]", inputs: ["horizontal", "canDrop", "editorMetadata"] }, { kind: "directive", type: CopyDesignerStylesSADirective, selector: "[copyDesignerStyles]", inputs: ["copyDesignerStyles"], exportAs: ["copyDesignerStyles"] }, { kind: "directive", type: LayoutComponentRendererSADirective, selector: "[layoutComponentRenderer]", inputs: ["layoutComponentRenderer", "layoutComponentRendererInjector", "layoutComponentRendererDisableTransformer"], outputs: ["layoutComponentRendererComponentChange", "componentElementChange"], exportAs: ["layoutComponentRenderer"] }, { kind: "directive", type: DesignerDropzoneSADirective, selector: ".designer-dropzone", inputs: ["isDropZone"] }, { kind: "directive", type: BodyRenderSADirective, selector: "[bodyRender]" }, { kind: "ngmodule", type: DndModule }, { kind: "directive", type: i4.DragSourceDirective, selector: "[dragSource]", inputs: ["dragSource", "dragSourceType", "dragSourceOptions", "noHTML5Preview"] }, { kind: "directive", type: i4.DropTargetDirective, selector: "[dropTarget]", inputs: ["dropTarget", "dropTargetTypes", "dropTargetType"] }, { kind: "ngmodule", type: LayoutDndCoreModule }, { kind: "directive", type: i5.DndCoreDesignerDirective, selector: "[dndCoreDesigner]", inputs: ["dropzoneElement", "dndCoreDesigner", "dragDisabled"], outputs: ["dropMetadata"], exportAs: ["dndCoreDesigner"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
271
|
+
CommonModule }, { kind: "directive", type: i2.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "ngmodule", type: PositionModule }, { kind: "directive", type: i3.PositionToDirective, selector: "[positionTo]", inputs: ["positionTo", "placement", "offset", "autoUpdate"], outputs: ["flip", "done"] }, { kind: "component", type: LayoutDesignerOverlayForSAComponent, selector: "[layoutDesignerOverlayFor]", inputs: ["layoutDesignerOverlayFor"] }, { kind: "directive", type: DesignerMinDimensionSADirective, selector: "[designerMinWidth]", inputs: ["horizontal", "canDrop", "editorMetadata"] }, { kind: "directive", type: CopyDesignerStylesSADirective, selector: "[copyDesignerStyles]", inputs: ["copyDesignerStyles"], exportAs: ["copyDesignerStyles"] }, { kind: "directive", type: LayoutComponentRendererSADirective, selector: "[layoutComponentRenderer]", inputs: ["layoutComponentRenderer", "layoutComponentRendererInjector", "layoutComponentRendererDisableTransformer"], outputs: ["layoutComponentRendererComponentChange", "componentElementChange"], exportAs: ["layoutComponentRenderer"] }, { kind: "directive", type: DesignerDropzoneSADirective, selector: ".designer-dropzone", inputs: ["isDropZone"] }, { kind: "directive", type: BodyRenderSADirective, selector: "[bodyRender]" }, { kind: "ngmodule", type: DndModule }, { kind: "directive", type: i4.DragSourceDirective, selector: "[dragSource]", inputs: ["dragSource", "dragSourceType", "dragSourceOptions", "noHTML5Preview"] }, { kind: "directive", type: i4.DropTargetDirective, selector: "[dropTarget]", inputs: ["dropTarget", "dropTargetTypes", "dropTargetType"] }, { kind: "ngmodule", type: LayoutDndCoreModule }, { kind: "directive", type: i5.DndCoreDesignerDirective, selector: "[dndCoreDesigner]", inputs: ["dropzoneElement", "dndCoreDesigner", "dragDisabled"], outputs: ["dropMetadata"], exportAs: ["dndCoreDesigner"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
272
272
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.1.0", ngImport: i0, type: LayoutDesignerSAComponent, decorators: [{
|
|
273
273
|
type: Component,
|
|
274
274
|
args: [{ selector: 'layout-designer-component', standalone: true, imports: [
|
|
@@ -284,7 +284,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.1.0", ngImpor
|
|
|
284
284
|
BodyRenderSADirective,
|
|
285
285
|
DndModule,
|
|
286
286
|
LayoutDndCoreModule,
|
|
287
|
-
], changeDetection: ChangeDetectionStrategy.OnPush, template: "<div class=\"designer-overlay\" \n #layoutDesigner\n #dndCore=\"dndCoreDesigner\"\n [dndCoreDesigner]=\"{metadata: renderedType, parentId: parent?.renderedType?.id, index: index}\"\n [dropzoneElement]=\"layoutDropzone\"\n [dragDisabled]=\"dragDisabled\"\n [dragSource]=\"dndCore.drag\"\n [noHTML5Preview]=\"true\"\n (dropMetadata)=\"addDescendant($event)\"\n [copyDesignerStyles]=\"renderedType\"\n (mouseleave)=\"hideOverlay($event)\"\n (mouseover)=\"showOverlay($event)\"\n (click)=\"selectComponent($event)\"\n (dblclick)=\"unselectComponent($event)\">\n <div class=\"designer-dropzone\"\n #layoutDropzone\n designerMinWidth\n [canDrop]=\"canDrop\"\n [editorMetadata]=\"editorMetadata\"\n [horizontal]=\"parent?.horizontal ?? false\"\n [dropTarget]=\"dndCore.dropzone\"\n [isDropZone]=\"canDrop\">\n <ng-template #renderer=\"layoutComponentRenderer\" [layoutComponentRenderer]=\"renderedType\" [layoutComponentRendererDisableTransformer]=\"true\"></ng-template>\n\n <ng-container *ngIf=\"highlighted || selected\">\n <div class=\"designer-overlay-border\"></div>\n <div class=\"designer-overlay-layout\" [layoutDesignerOverlayFor]=\"renderer\"></div>\n\n <div class=\"designer-overlay-title\"\n *bodyRender\n [positionTo]=\"layoutDesigner\"\n placement=\"TopStart\">{{editorMetadata?.metaInfo?.name ?? renderedType?.name}}</div>\n\n <ng-container *ngIf=\"!!parent && parent.editorMetadata?.removeDescendant\">\n <div *bodyRender\n class=\"designer-overlay-remove\"\n [positionTo]=\"layoutDesigner\"\n placement=\"TopEnd\"\n (click)=\"remove()\">\n <span class=\"fas fa-times\"></span>\n </div>\n </ng-container>\n </ng-container>\n </div>\n</div>\n" }]
|
|
287
|
+
], changeDetection: ChangeDetectionStrategy.OnPush, template: "<div class=\"designer-overlay\" \n #layoutDesigner\n #dndCore=\"dndCoreDesigner\"\n [dndCoreDesigner]=\"{metadata: renderedType, parentId: parent?.renderedType?.id, index: index}\"\n [dropzoneElement]=\"layoutDropzone\"\n [dragDisabled]=\"dragDisabled\"\n [dragSource]=\"dndCore.drag\"\n [noHTML5Preview]=\"true\"\n (dropMetadata)=\"addDescendant($event)\"\n [copyDesignerStyles]=\"renderedType\"\n (mouseleave)=\"hideOverlay($event)\"\n (mouseover)=\"showOverlay($event)\"\n (click)=\"selectComponent($event)\"\n (dblclick)=\"unselectComponent($event)\">\n <div class=\"designer-dropzone\"\n #layoutDropzone\n designerMinWidth\n [canDrop]=\"canDrop\"\n [editorMetadata]=\"editorMetadata\"\n [horizontal]=\"parent?.horizontal ?? false\"\n [dropTarget]=\"dndCore.dropzone\"\n [isDropZone]=\"canDrop\">\n <ng-template #renderer=\"layoutComponentRenderer\" [layoutComponentRenderer]=\"renderedType\" [layoutComponentRendererDisableTransformer]=\"true\"></ng-template>\n\n <ng-container *ngIf=\"highlighted || selected\">\n <div class=\"designer-overlay-border\"></div>\n <div class=\"designer-overlay-layout\" [layoutDesignerOverlayFor]=\"renderer\"></div>\n\n <div class=\"designer-overlay-title\"\n *bodyRender\n [positionTo]=\"layoutDesigner\"\n placement=\"TopStart\">{{editorMetadata?.metaInfo?.name ?? renderedType?.name}}</div>\n\n <ng-container *ngIf=\"!!parent && parent.editorMetadata?.removeDescendant\">\n <div *bodyRender\n class=\"designer-overlay-remove\"\n [positionTo]=\"layoutDesigner\"\n [offset]=\"{mainAxis: -18, alignmentAxis: -6}\"\n placement=\"TopEnd\"\n (click)=\"remove()\">\n <span class=\"fas fa-times\"></span>\n </div>\n </ng-container>\n </ng-container>\n </div>\n</div>\n" }]
|
|
288
288
|
}], ctorParameters: function () { return [{ type: i0.ChangeDetectorRef }, { type: i0.ElementRef }, { type: i0.Injector }, { type: i1.LayoutEditorMetadataExtractor }, { type: i1.LayoutEditorMetadataManager }, { type: i1.LayoutComponentsIteratorService }, { type: i6.MetadataHistoryManager, decorators: [{
|
|
289
289
|
type: Inject,
|
|
290
290
|
args: [LAYOUT_HISTORY_MANAGER]
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"layoutDesigner.component.js","sourceRoot":"","sources":["../../../../../layout-editor/src/components/layoutDesigner/layoutDesigner.component.ts","../../../../../layout-editor/src/components/layoutDesigner/layoutDesigner.component.html"],"names":[],"mappings":";AAAA,OAAO,EAAC,SAAS,EAAE,uBAAuB,EAAE,iBAAiB,EAAE,UAAU,EAAE,QAAQ,EAAE,QAAQ,EAAE,MAAM,EAAa,QAAQ,EAAE,SAAS,EAAC,MAAM,eAAe,CAAC;AAC5J,OAAO,EAAC,YAAY,EAAC,MAAM,iBAAiB,CAAC;AAC7C,OAAO,EAAS,MAAM,EAAE,cAAc,EAAC,MAAM,eAAe,CAAC;AAE7D,OAAO,EAAC,mBAAmB,EAAE,kCAAkC,EAAC,MAAM,uBAA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AAS;wBACT,mBAAmB;qBACtB,mBACgB,uBAAuB,CAAC,MAAM;;0BAiHlC,MAAM;2BAAC,sBAAsB;;0BAC7B,QAAQ;;0BAAI,MAAM;2BAAC,QAAQ;;0BAC3B,MAAM;2BAAC,MAAM;;0BAAG,QAAQ;8BACkB,yBAAyB;0BAAnE,QAAQ;;0BAAI,QAAQ;4CA1DvB,eAAe;sBADxB,SAAS;uBAAC,gBAAgB,EAAE,EAAC,MAAM,EAAE,IAAI,EAAC;gBASpC,eAAe;sBADrB,SAAS;uBAAC,iBAAiB,EAAE,EAAC,MAAM,EAAE,IAAI,EAAC","sourcesContent":["import {Component, ChangeDetectionStrategy, ChangeDetectorRef, ElementRef, SkipSelf, Optional, Inject, OnDestroy, Injector, ViewChild} from '@angular/core';\nimport {CommonModule} from '@angular/common';\nimport {Logger, LOGGER, PositionModule} from '@anglr/common';\nimport {LayoutComponent, LayoutComponentMetadata} from '@anglr/dynamic/layout';\nimport {LayoutComponentBase, LayoutComponentRendererSADirective} from '@anglr/dynamic/layout';\nimport {MetadataHistoryManager, SCOPE_ID} from '@anglr/dynamic';\nimport {isPresent} from '@jscrpt/common';\nimport {DndModule} from '@ng-dnd/core';\nimport {Subscription} from 'rxjs';\n\nimport {LayoutDesignerComponentOptions} from './layoutDesigner.options';\nimport {BodyRenderSADirective, CopyDesignerStylesSADirective, DesignerDropzoneSADirective, DesignerMinDimensionSADirective} from '../../directives';\nimport {LayoutComponentsIteratorService, LayoutEditorMetadataExtractor, LayoutEditorMetadataManager} from '../../services';\nimport {LayoutEditorDragPreviewSAComponent} from '../layoutEditorDragPreview/layoutEditorDragPreview.component';\nimport {LayoutDesignerOverlayForSAComponent} from '../layoutDesignerOverlayFor/layoutDesignerOverlayFor.component';\nimport {LayoutEditorMetadataDescriptor} from '../../decorators';\nimport {LAYOUT_HISTORY_MANAGER} from '../../misc/tokens';\nimport {DndCoreDesignerDirective, LayoutDndCoreModule} from '../../modules';\nimport {LayoutComponentDragData} from '../../interfaces';\n\n/**\n * Component used as designer component wrapper for layout component\n */\n@Component(\n{\n selector: 'layout-designer-component',\n templateUrl: 'layoutDesigner.component.html',\n standalone: true,\n imports:\n [\n //TODO: cleanup\n CommonModule,\n PositionModule,\n LayoutEditorDragPreviewSAComponent,\n LayoutDesignerOverlayForSAComponent,\n DesignerMinDimensionSADirective,\n CopyDesignerStylesSADirective,\n LayoutComponentRendererSADirective,\n DesignerDropzoneSADirective,\n BodyRenderSADirective,\n DndModule,\n LayoutDndCoreModule,\n ],\n changeDetection: ChangeDetectionStrategy.OnPush\n})\nexport class LayoutDesignerSAComponent extends LayoutComponentBase<LayoutDesignerComponentOptions> implements LayoutComponent<LayoutDesignerComponentOptions>, OnDestroy\n{\n //######################### protected properties #########################\n\n /**\n * Subscriptions created during initialization\n */\n protected initSubscriptions: Subscription = new Subscription();\n\n //######################### protected properties - template bindings #########################\n\n /**\n * Indication whether is component selected\n */\n protected get selected(): boolean\n {\n return this.layoutEditorMetadataManager.selectedComponent === this.options?.typeMetadata.id;\n }\n\n /**\n * Indication whether is component highlighted\n */\n protected get highlighted(): boolean\n {\n return this.layoutEditorMetadataManager.highlightedComponent === this.options?.typeMetadata.id;\n }\n\n /**\n * Metadata for rendered type\n */\n protected renderedType: LayoutComponentMetadata|undefined|null;\n\n //######################### protected properties - overrides #########################\n\n /**\n * @inheritdoc\n */\n protected override get element(): ElementRef<HTMLElement>\n {\n return this.designerElement;\n }\n\n /**\n * @inheritdoc\n */\n protected override get extensionsOptions(): any|undefined|null\n {\n return this.options?.typeMetadata.options;\n }\n\n //######################### protected properties - children #########################\n\n /**\n * Instance of designer div element\n */\n @ViewChild('layoutDesigner', {static: true})\n protected designerElement!: ElementRef<HTMLElement>;\n\n //######################### public properties - children #########################\n\n /**\n * Instance of designer dnd core directive\n */\n @ViewChild('dndCoreDesigner', {static: true})\n public dndCoreDesigner!: DndCoreDesignerDirective;\n\n //######################### public properties #########################\n\n /**\n * Indication whether drag is disabled for component\n */\n public get dragDisabled(): boolean\n {\n return !this.parent || !!this.editorMetadata?.metaInfo?.dragDisabled;\n }\n\n /**\n * Indication whether item can be dropped here\n */\n public canDrop: boolean = false;\n\n /**\n * Indication whether drop list is horizontally oriented\n */\n public horizontal: boolean = false;\n\n /**\n * Component identifier\n */\n public get id(): string\n {\n return this.options?.typeMetadata?.id ?? '';\n }\n\n /**\n * Index of current layout designer in its parent\n */\n public index: number = 0;\n\n /**\n * Layout editor metadata\n */\n public editorMetadata: LayoutEditorMetadataDescriptor|null = null;\n\n //######################### constructor #########################\n constructor(changeDetector: ChangeDetectorRef,\n element: ElementRef<HTMLElement>,\n injector: Injector,\n protected metadataExtractor: LayoutEditorMetadataExtractor,\n protected layoutEditorMetadataManager: LayoutEditorMetadataManager,\n protected iteratorSvc: LayoutComponentsIteratorService,\n @Inject(LAYOUT_HISTORY_MANAGER) protected history: MetadataHistoryManager<LayoutComponentMetadata>,\n @Optional() @Inject(SCOPE_ID) protected scopeId?: string,\n @Inject(LOGGER) @Optional() logger?: Logger,\n @SkipSelf() @Optional() protected parent?: LayoutDesignerSAComponent,)\n {\n super(changeDetector, element, injector, logger);\n }\n\n //######################### public methods - implementation of OnDestroy #########################\n \n /**\n * Called when component is destroyed\n */\n public override ngOnDestroy(): void\n {\n this.logger?.debug('LayoutDesignerSAComponent: Destroying component {@data}', {id: this.options?.typeMetadata.id});\n\n this.initSubscriptions.unsubscribe();\n\n super.ngOnDestroy();\n\n if(this.options)\n {\n this.layoutEditorMetadataManager.unregisterLayoutDesignerComponent(this.options.typeMetadata.id);\n }\n }\n\n //######################### public methods #########################\n\n /**\n * Adds descentant component metadata to this component metadata\n * @param dragData - Data from drag n drop event\n */\n public addDescendant(dragData: LayoutComponentDragData): void\n {\n if(!this.options)\n {\n return;\n }\n\n const parentId = dragData.parentId;\n this.logger?.debug('LayoutDesignerSAComponent: Adding descendant {@data}', {id: dragData.metadata?.id, parent: this.options.typeMetadata.id});\n\n if(!dragData.metadata)\n {\n this.logger?.warn('LayoutDesignerSAComponent: Missing metadata while adding descendant');\n\n return;\n }\n\n //already added to tree, removing old reference\n if(parentId)\n {\n this.history.disable();\n this.layoutEditorMetadataManager.getComponent(parentId)?.removeDescendant(dragData.metadata?.id);\n this.history.enable();\n }\n\n this.editorMetadata?.addDescendant?.(dragData?.metadata, this.options.typeMetadata.options, dragData.index ?? 0);\n this.canDrop = this.editorMetadata?.canDropMetadata?.(this.options.typeMetadata.options) ?? false;\n\n this.renderedType = {...this.options.typeMetadata};\n this.changeDetector.markForCheck();\n this.history.getNewState();\n }\n\n /**\n * Removes descendant metadata from this component metadata\n * @param id - Id of descendant to be removed\n */\n public removeDescendant(id: string): void\n {\n if(!this.options)\n {\n return;\n }\n\n this.logger?.debug('LayoutDesignerSAComponent: Removing descendant {@data}', {id: this.options.typeMetadata.id, child: id});\n\n this.editorMetadata?.removeDescendant?.(id, this.options.typeMetadata.options);\n this.canDrop = this.editorMetadata?.canDropMetadata?.(this.options.typeMetadata.options) ?? false;\n this.renderedType = {...this.options.typeMetadata};\n this.changeDetector.markForCheck();\n this.history.getNewState();\n }\n\n //######################### protected methods - template bindings #########################\n\n /**\n * Shows designer overlay\n * @param event - Mouse event that occured\n */\n protected showOverlay(event: Event): void\n {\n this.logger?.verbose('LayoutDesignerComponent: Showing overlay for {@type}', {name: this.options?.typeMetadata.name, id: this.options?.typeMetadata.id});\n\n event.preventDefault();\n event.stopPropagation();\n\n this.layoutEditorMetadataManager.highlightComponent(this.options?.typeMetadata.id);\n }\n\n /**\n * Hides designer overlay\n * @param event - Mouse event that occured\n */\n protected hideOverlay(event: Event): void\n {\n if(isPresent(this.parent))\n {\n return;\n }\n\n this.logger?.verbose('LayoutDesignerComponent: Hiding overlay for {@type}', {name: this.options?.typeMetadata.name, id: this.options?.typeMetadata.id});\n\n event.preventDefault();\n event.stopPropagation();\n\n this.layoutEditorMetadataManager.cancelHighlightedComponent();\n }\n\n /**\n * Marks component as selected\n * @param event - Event that occured\n */\n protected selectComponent(event: MouseEvent): void\n {\n event.preventDefault();\n event.stopPropagation();\n\n if(this.options)\n {\n this.layoutEditorMetadataManager.selectComponent(this.options.typeMetadata.id);\n }\n }\n\n /**\n * Unselects selected component\n * @param event - Event that occured\n */\n protected unselectComponent(event: MouseEvent): void\n {\n event.preventDefault();\n event.stopPropagation();\n\n this.layoutEditorMetadataManager.unselectComponent();\n }\n\n /**\n * Removes itself from tree\n */\n protected remove(): void\n {\n if(!this.parent || !this.options)\n {\n return;\n }\n\n this.parent.removeDescendant(this.options.typeMetadata.id);\n }\n\n //######################### protected methods - overrides #########################\n\n /**\n * @inheritdoc\n */\n protected override async onInit(): Promise<void>\n {\n await super.onInit();\n\n if(!this.options)\n {\n return;\n }\n\n this.options.typeMetadata.scope = this.scopeId;\n\n if(this.parent?.options)\n {\n for await(const child of this.iteratorSvc.getChildrenIteratorFor(this.parent.options?.typeMetadata))\n {\n if(this.options.typeMetadata.id === child.metadata.id)\n {\n this.index = child.index;\n\n break;\n }\n }\n }\n\n //TODO: optimize\n this.initSubscriptions.add(this.layoutEditorMetadataManager.selectedChange.subscribe(() => this.changeDetector.detectChanges()));\n this.initSubscriptions.add(this.layoutEditorMetadataManager.highlightedChange.subscribe(() => this.changeDetector.detectChanges()));\n\n this.editorMetadata = await this.metadataExtractor.extractMetadata(this.options.typeMetadata);\n this.canDrop = this.editorMetadata?.canDropMetadata?.(this.options.typeMetadata.options) ?? false;\n this.layoutEditorMetadataManager.registerLayoutDesignerComponent(this, this.options.typeMetadata.id, this.parent?.options?.typeMetadata.id);\n }\n\n /**\n * @inheritdoc\n */\n protected override onOptionsSet(): void\n {\n if(!this.options)\n {\n return;\n }\n\n this.renderedType = {...this.options.typeMetadata};\n this.horizontal = this.editorMetadata?.isHorizontalDrop?.(this.options.typeMetadata.options) ?? false;\n }\n}","<div class=\"designer-overlay\" \n #layoutDesigner\n #dndCore=\"dndCoreDesigner\"\n [dndCoreDesigner]=\"{metadata: renderedType, parentId: parent?.renderedType?.id, index: index}\"\n [dropzoneElement]=\"layoutDropzone\"\n [dragDisabled]=\"dragDisabled\"\n [dragSource]=\"dndCore.drag\"\n [noHTML5Preview]=\"true\"\n (dropMetadata)=\"addDescendant($event)\"\n [copyDesignerStyles]=\"renderedType\"\n (mouseleave)=\"hideOverlay($event)\"\n (mouseover)=\"showOverlay($event)\"\n (click)=\"selectComponent($event)\"\n (dblclick)=\"unselectComponent($event)\">\n <div class=\"designer-dropzone\"\n #layoutDropzone\n designerMinWidth\n [canDrop]=\"canDrop\"\n [editorMetadata]=\"editorMetadata\"\n [horizontal]=\"parent?.horizontal ?? false\"\n [dropTarget]=\"dndCore.dropzone\"\n [isDropZone]=\"canDrop\">\n <ng-template #renderer=\"layoutComponentRenderer\" [layoutComponentRenderer]=\"renderedType\" [layoutComponentRendererDisableTransformer]=\"true\"></ng-template>\n\n <ng-container *ngIf=\"highlighted || selected\">\n <div class=\"designer-overlay-border\"></div>\n <div class=\"designer-overlay-layout\" [layoutDesignerOverlayFor]=\"renderer\"></div>\n\n <div class=\"designer-overlay-title\"\n *bodyRender\n [positionTo]=\"layoutDesigner\"\n placement=\"TopStart\">{{editorMetadata?.metaInfo?.name ?? renderedType?.name}}</div>\n\n <ng-container *ngIf=\"!!parent && parent.editorMetadata?.removeDescendant\">\n <div *bodyRender\n class=\"designer-overlay-remove\"\n [positionTo]=\"layoutDesigner\"\n placement=\"TopEnd\"\n (click)=\"remove()\">\n <span class=\"fas fa-times\"></span>\n </div>\n </ng-container>\n </ng-container>\n </div>\n</div>\n"]}
|
|
1
|
+
{"version":3,"file":"layoutDesigner.component.js","sourceRoot":"","sources":["../../../../../layout-editor/src/components/layoutDesigner/layoutDesigner.component.ts","../../../../../layout-editor/src/components/layoutDesigner/layoutDesigner.component.html"],"names":[],"mappings":";AAAA,OAAO,EAAC,SAAS,EAAE,uBAAuB,EAAE,iBAAiB,EAAE,UAAU,EAAE,QAAQ,EAAE,QAAQ,EAAE,MAAM,EAAa,QAAQ,EAAE,SAAS,EAAC,MAAM,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BAA2B,cAEzB,IAAI,WAEhB;wBACI,eAAe;wBACf,YAAY;wBACZ,cAAc;wBACd,kCAAkC;wBAClC,mCAAmC;wBACnC,+BAA+B;wBAC/B,6BAA6B;wBAC7B,kCAAkC;wBAClC,2BAA2B;wBAC3B,qBAAqB;wBACrB,SAAS;wBACT,mBAAmB;qBACtB,mBACgB,uBAAuB,CAAC,MAAM;;0BAiHlC,MAAM;2BAAC,sBAAsB;;0BAC7B,QAAQ;;0BAAI,MAAM;2BAAC,QAAQ;;0BAC3B,MAAM;2BAAC,MAAM;;0BAAG,QAAQ;8BACkB,yBAAyB;0BAAnE,QAAQ;;0BAAI,QAAQ;4CA1DvB,eAAe;sBADxB,SAAS;uBAAC,gBAAgB,EAAE,EAAC,MAAM,EAAE,IAAI,EAAC;gBASpC,eAAe;sBADrB,SAAS;uBAAC,iBAAiB,EAAE,EAAC,MAAM,EAAE,IAAI,EAAC","sourcesContent":["import {Component, ChangeDetectionStrategy, ChangeDetectorRef, ElementRef, SkipSelf, Optional, Inject, OnDestroy, Injector, ViewChild} from '@angular/core';\nimport {CommonModule} from '@angular/common';\nimport {Logger, LOGGER, PositionModule} from '@anglr/common';\nimport {LayoutComponent, LayoutComponentMetadata} from '@anglr/dynamic/layout';\nimport {LayoutComponentBase, LayoutComponentRendererSADirective} from '@anglr/dynamic/layout';\nimport {MetadataHistoryManager, SCOPE_ID} from '@anglr/dynamic';\nimport {isPresent} from '@jscrpt/common';\nimport {DndModule} from '@ng-dnd/core';\nimport {Subscription} from 'rxjs';\n\nimport {LayoutDesignerComponentOptions} from './layoutDesigner.options';\nimport {BodyRenderSADirective, CopyDesignerStylesSADirective, DesignerDropzoneSADirective, DesignerMinDimensionSADirective} from '../../directives';\nimport {LayoutComponentsIteratorService, LayoutEditorMetadataExtractor, LayoutEditorMetadataManager} from '../../services';\nimport {LayoutEditorDragPreviewSAComponent} from '../layoutEditorDragPreview/layoutEditorDragPreview.component';\nimport {LayoutDesignerOverlayForSAComponent} from '../layoutDesignerOverlayFor/layoutDesignerOverlayFor.component';\nimport {LayoutEditorMetadataDescriptor} from '../../decorators';\nimport {LAYOUT_HISTORY_MANAGER} from '../../misc/tokens';\nimport {DndCoreDesignerDirective, LayoutDndCoreModule} from '../../modules';\nimport {LayoutComponentDragData} from '../../interfaces';\n\n/**\n * Component used as designer component wrapper for layout component\n */\n@Component(\n{\n selector: 'layout-designer-component',\n templateUrl: 'layoutDesigner.component.html',\n standalone: true,\n imports:\n [\n //TODO: cleanup\n CommonModule,\n PositionModule,\n LayoutEditorDragPreviewSAComponent,\n LayoutDesignerOverlayForSAComponent,\n DesignerMinDimensionSADirective,\n CopyDesignerStylesSADirective,\n LayoutComponentRendererSADirective,\n DesignerDropzoneSADirective,\n BodyRenderSADirective,\n DndModule,\n LayoutDndCoreModule,\n ],\n changeDetection: ChangeDetectionStrategy.OnPush\n})\nexport class LayoutDesignerSAComponent extends LayoutComponentBase<LayoutDesignerComponentOptions> implements LayoutComponent<LayoutDesignerComponentOptions>, OnDestroy\n{\n //######################### protected properties #########################\n\n /**\n * Subscriptions created during initialization\n */\n protected initSubscriptions: Subscription = new Subscription();\n\n //######################### protected properties - template bindings #########################\n\n /**\n * Indication whether is component selected\n */\n protected get selected(): boolean\n {\n return this.layoutEditorMetadataManager.selectedComponent === this.options?.typeMetadata.id;\n }\n\n /**\n * Indication whether is component highlighted\n */\n protected get highlighted(): boolean\n {\n return this.layoutEditorMetadataManager.highlightedComponent === this.options?.typeMetadata.id;\n }\n\n /**\n * Metadata for rendered type\n */\n protected renderedType: LayoutComponentMetadata|undefined|null;\n\n //######################### protected properties - overrides #########################\n\n /**\n * @inheritdoc\n */\n protected override get element(): ElementRef<HTMLElement>\n {\n return this.designerElement;\n }\n\n /**\n * @inheritdoc\n */\n protected override get extensionsOptions(): any|undefined|null\n {\n return this.options?.typeMetadata.options;\n }\n\n //######################### protected properties - children #########################\n\n /**\n * Instance of designer div element\n */\n @ViewChild('layoutDesigner', {static: true})\n protected designerElement!: ElementRef<HTMLElement>;\n\n //######################### public properties - children #########################\n\n /**\n * Instance of designer dnd core directive\n */\n @ViewChild('dndCoreDesigner', {static: true})\n public dndCoreDesigner!: DndCoreDesignerDirective;\n\n //######################### public properties #########################\n\n /**\n * Indication whether drag is disabled for component\n */\n public get dragDisabled(): boolean\n {\n return !this.parent || !!this.editorMetadata?.metaInfo?.dragDisabled;\n }\n\n /**\n * Indication whether item can be dropped here\n */\n public canDrop: boolean = false;\n\n /**\n * Indication whether drop list is horizontally oriented\n */\n public horizontal: boolean = false;\n\n /**\n * Component identifier\n */\n public get id(): string\n {\n return this.options?.typeMetadata?.id ?? '';\n }\n\n /**\n * Index of current layout designer in its parent\n */\n public index: number = 0;\n\n /**\n * Layout editor metadata\n */\n public editorMetadata: LayoutEditorMetadataDescriptor|null = null;\n\n //######################### constructor #########################\n constructor(changeDetector: ChangeDetectorRef,\n element: ElementRef<HTMLElement>,\n injector: Injector,\n protected metadataExtractor: LayoutEditorMetadataExtractor,\n protected layoutEditorMetadataManager: LayoutEditorMetadataManager,\n protected iteratorSvc: LayoutComponentsIteratorService,\n @Inject(LAYOUT_HISTORY_MANAGER) protected history: MetadataHistoryManager<LayoutComponentMetadata>,\n @Optional() @Inject(SCOPE_ID) protected scopeId?: string,\n @Inject(LOGGER) @Optional() logger?: Logger,\n @SkipSelf() @Optional() protected parent?: LayoutDesignerSAComponent,)\n {\n super(changeDetector, element, injector, logger);\n }\n\n //######################### public methods - implementation of OnDestroy #########################\n \n /**\n * Called when component is destroyed\n */\n public override ngOnDestroy(): void\n {\n this.logger?.debug('LayoutDesignerSAComponent: Destroying component {@data}', {id: this.options?.typeMetadata.id});\n\n this.initSubscriptions.unsubscribe();\n\n super.ngOnDestroy();\n\n if(this.options)\n {\n this.layoutEditorMetadataManager.unregisterLayoutDesignerComponent(this.options.typeMetadata.id);\n }\n }\n\n //######################### public methods #########################\n\n /**\n * Adds descentant component metadata to this component metadata\n * @param dragData - Data from drag n drop event\n */\n public addDescendant(dragData: LayoutComponentDragData): void\n {\n if(!this.options)\n {\n return;\n }\n\n const parentId = dragData.parentId;\n this.logger?.debug('LayoutDesignerSAComponent: Adding descendant {@data}', {id: dragData.metadata?.id, parent: this.options.typeMetadata.id});\n\n if(!dragData.metadata)\n {\n this.logger?.warn('LayoutDesignerSAComponent: Missing metadata while adding descendant');\n\n return;\n }\n\n //already added to tree, removing old reference\n if(parentId)\n {\n this.history.disable();\n this.layoutEditorMetadataManager.getComponent(parentId)?.removeDescendant(dragData.metadata?.id);\n this.history.enable();\n }\n\n this.editorMetadata?.addDescendant?.(dragData?.metadata, this.options.typeMetadata.options, dragData.index ?? 0);\n this.canDrop = this.editorMetadata?.canDropMetadata?.(this.options.typeMetadata.options) ?? false;\n\n this.renderedType = {...this.options.typeMetadata};\n this.changeDetector.markForCheck();\n this.history.getNewState();\n }\n\n /**\n * Removes descendant metadata from this component metadata\n * @param id - Id of descendant to be removed\n */\n public removeDescendant(id: string): void\n {\n if(!this.options)\n {\n return;\n }\n\n this.logger?.debug('LayoutDesignerSAComponent: Removing descendant {@data}', {id: this.options.typeMetadata.id, child: id});\n\n this.editorMetadata?.removeDescendant?.(id, this.options.typeMetadata.options);\n this.canDrop = this.editorMetadata?.canDropMetadata?.(this.options.typeMetadata.options) ?? false;\n this.renderedType = {...this.options.typeMetadata};\n this.changeDetector.markForCheck();\n this.history.getNewState();\n }\n\n //######################### protected methods - template bindings #########################\n\n /**\n * Shows designer overlay\n * @param event - Mouse event that occured\n */\n protected showOverlay(event: Event): void\n {\n this.logger?.verbose('LayoutDesignerComponent: Showing overlay for {@type}', {name: this.options?.typeMetadata.name, id: this.options?.typeMetadata.id});\n\n event.preventDefault();\n event.stopPropagation();\n\n this.layoutEditorMetadataManager.highlightComponent(this.options?.typeMetadata.id);\n }\n\n /**\n * Hides designer overlay\n * @param event - Mouse event that occured\n */\n protected hideOverlay(event: Event): void\n {\n if(isPresent(this.parent))\n {\n return;\n }\n\n this.logger?.verbose('LayoutDesignerComponent: Hiding overlay for {@type}', {name: this.options?.typeMetadata.name, id: this.options?.typeMetadata.id});\n\n event.preventDefault();\n event.stopPropagation();\n\n this.layoutEditorMetadataManager.cancelHighlightedComponent();\n }\n\n /**\n * Marks component as selected\n * @param event - Event that occured\n */\n protected selectComponent(event: MouseEvent): void\n {\n event.preventDefault();\n event.stopPropagation();\n\n if(this.options)\n {\n this.layoutEditorMetadataManager.selectComponent(this.options.typeMetadata.id);\n }\n }\n\n /**\n * Unselects selected component\n * @param event - Event that occured\n */\n protected unselectComponent(event: MouseEvent): void\n {\n event.preventDefault();\n event.stopPropagation();\n\n this.layoutEditorMetadataManager.unselectComponent();\n }\n\n /**\n * Removes itself from tree\n */\n protected remove(): void\n {\n if(!this.parent || !this.options)\n {\n return;\n }\n\n this.parent.removeDescendant(this.options.typeMetadata.id);\n }\n\n //######################### protected methods - overrides #########################\n\n /**\n * @inheritdoc\n */\n protected override async onInit(): Promise<void>\n {\n await super.onInit();\n\n if(!this.options)\n {\n return;\n }\n\n this.options.typeMetadata.scope = this.scopeId;\n\n if(this.parent?.options)\n {\n for await(const child of this.iteratorSvc.getChildrenIteratorFor(this.parent.options?.typeMetadata))\n {\n if(this.options.typeMetadata.id === child.metadata.id)\n {\n this.index = child.index;\n\n break;\n }\n }\n }\n\n //TODO: optimize\n this.initSubscriptions.add(this.layoutEditorMetadataManager.selectedChange.subscribe(() => this.changeDetector.detectChanges()));\n this.initSubscriptions.add(this.layoutEditorMetadataManager.highlightedChange.subscribe(() => this.changeDetector.detectChanges()));\n\n this.editorMetadata = await this.metadataExtractor.extractMetadata(this.options.typeMetadata);\n this.canDrop = this.editorMetadata?.canDropMetadata?.(this.options.typeMetadata.options) ?? false;\n this.layoutEditorMetadataManager.registerLayoutDesignerComponent(this, this.options.typeMetadata.id, this.parent?.options?.typeMetadata.id);\n }\n\n /**\n * @inheritdoc\n */\n protected override onOptionsSet(): void\n {\n if(!this.options)\n {\n return;\n }\n\n this.renderedType = {...this.options.typeMetadata};\n this.horizontal = this.editorMetadata?.isHorizontalDrop?.(this.options.typeMetadata.options) ?? false;\n }\n}","<div class=\"designer-overlay\" \n #layoutDesigner\n #dndCore=\"dndCoreDesigner\"\n [dndCoreDesigner]=\"{metadata: renderedType, parentId: parent?.renderedType?.id, index: index}\"\n [dropzoneElement]=\"layoutDropzone\"\n [dragDisabled]=\"dragDisabled\"\n [dragSource]=\"dndCore.drag\"\n [noHTML5Preview]=\"true\"\n (dropMetadata)=\"addDescendant($event)\"\n [copyDesignerStyles]=\"renderedType\"\n (mouseleave)=\"hideOverlay($event)\"\n (mouseover)=\"showOverlay($event)\"\n (click)=\"selectComponent($event)\"\n (dblclick)=\"unselectComponent($event)\">\n <div class=\"designer-dropzone\"\n #layoutDropzone\n designerMinWidth\n [canDrop]=\"canDrop\"\n [editorMetadata]=\"editorMetadata\"\n [horizontal]=\"parent?.horizontal ?? false\"\n [dropTarget]=\"dndCore.dropzone\"\n [isDropZone]=\"canDrop\">\n <ng-template #renderer=\"layoutComponentRenderer\" [layoutComponentRenderer]=\"renderedType\" [layoutComponentRendererDisableTransformer]=\"true\"></ng-template>\n\n <ng-container *ngIf=\"highlighted || selected\">\n <div class=\"designer-overlay-border\"></div>\n <div class=\"designer-overlay-layout\" [layoutDesignerOverlayFor]=\"renderer\"></div>\n\n <div class=\"designer-overlay-title\"\n *bodyRender\n [positionTo]=\"layoutDesigner\"\n placement=\"TopStart\">{{editorMetadata?.metaInfo?.name ?? renderedType?.name}}</div>\n\n <ng-container *ngIf=\"!!parent && parent.editorMetadata?.removeDescendant\">\n <div *bodyRender\n class=\"designer-overlay-remove\"\n [positionTo]=\"layoutDesigner\"\n [offset]=\"{mainAxis: -18, alignmentAxis: -6}\"\n placement=\"TopEnd\"\n (click)=\"remove()\">\n <span class=\"fas fa-times\"></span>\n </div>\n </ng-container>\n </ng-container>\n </div>\n</div>\n"]}
|
|
@@ -111,19 +111,19 @@ export class EditorHotkeys {
|
|
|
111
111
|
this.hotkeys.hotkeys.add(new Hotkey('del', () => {
|
|
112
112
|
this.deleteSubject.next();
|
|
113
113
|
return false;
|
|
114
|
-
}, [
|
|
114
|
+
}, [], 'Emits delete event'));
|
|
115
115
|
this.hotkeys.hotkeys.add(new Hotkey('ctrl+c', () => {
|
|
116
116
|
this.copySubject.next();
|
|
117
117
|
return false;
|
|
118
|
-
}, [
|
|
118
|
+
}, [], 'Emits copy event'));
|
|
119
119
|
this.hotkeys.hotkeys.add(new Hotkey('ctrl+v', () => {
|
|
120
120
|
this.pasteSubject.next();
|
|
121
121
|
return false;
|
|
122
|
-
}, [
|
|
122
|
+
}, [], 'Emits paste event'));
|
|
123
123
|
this.hotkeys.hotkeys.add(new Hotkey('ctrl+x', () => {
|
|
124
124
|
this.cutSubject.next();
|
|
125
125
|
return false;
|
|
126
|
-
}, [
|
|
126
|
+
}, [], 'Emits cut event'));
|
|
127
127
|
}
|
|
128
128
|
}
|
|
129
129
|
EditorHotkeys.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.1.0", ngImport: i0, type: EditorHotkeys, deps: [{ token: i1.AppHotkeysService }], target: i0.ɵɵFactoryTarget.Injectable });
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"editorHotkeys.service.js","sourceRoot":"","sources":["../../../../src/services/editorHotkeys/editorHotkeys.service.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,UAAU,EAAC,MAAM,eAAe,CAAC;AACzC,OAAO,EAAC,iBAAiB,EAAC,MAAM,uBAAuB,CAAC;AACxD,OAAO,EAAC,MAAM,EAAC,MAAM,kBAAkB,CAAC;AACxC,OAAO,EAAa,OAAO,EAAC,MAAM,MAAM,CAAC;;;AAEzC;;GAEG;AAEH,MAAM,OAAO,aAAa;IAiGtB,iEAAiE;IACjE,YAAsB,OAA0B;QAA1B,YAAO,GAAP,OAAO,CAAmB;QAhGhD,0EAA0E;QAE1E;;WAEG;QACO,gBAAW,GAAkB,IAAI,OAAO,EAAQ,CAAC;QAE3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AAC,WAAW,CAAC,IAAI,EAAE,CAAC;YAExB,OAAO,KAAK,CAAC;QACjB,CAAC,EAAE,EAAE,EAAE,kBAAkB,CAAC,CAAC,CAAC;QAE5B,IAAI,CAAC,OAAO,CAAC,OAAO,CAAC,GAAG,CAAC,IAAI,MAAM,CAAC,QAAQ,EAAE,GAAG,EAAE;YAE/C,IAAI,CAAC,YAAY,CAAC,IAAI,EAAE,CAAC;YAEzB,OAAO,KAAK,CAAC;QACjB,CAAC,EAAE,EAAE,EAAE,mBAAmB,CAAC,CAAC,CAAC;QAE7B,IAAI,CAAC,OAAO,CAAC,OAAO,CAAC,GAAG,CAAC,IAAI,MAAM,CAAC,QAAQ,EAAE,GAAG,EAAE;YAE/C,IAAI,CAAC,UAAU,CAAC,IAAI,EAAE,CAAC;YAEvB,OAAO,KAAK,CAAC;QACjB,CAAC,EAAE,EAAE,EAAE,iBAAiB,CAAC,CAAC,CAAC;IAC/B,CAAC;;0GAvKQ,aAAa;8GAAb,aAAa;2FAAb,aAAa;kBADzB,UAAU","sourcesContent":["import {Injectable} from '@angular/core';\nimport {AppHotkeysService} from '@anglr/common/hotkeys';\nimport {Hotkey} from 'angular2-hotkeys';\nimport {Observable, Subject} from 'rxjs';\n\n/**\n * Class that handles hotkeys for editors\n */\n@Injectable()\nexport class EditorHotkeys\n{\n //######################### protected properties #########################\n\n /**\n * Subject used for emitting undo\n */\n protected undoSubject: Subject<void> = new Subject<void>();\n\n /**\n * Subject used for emitting redo\n */\n protected redoSubject: Subject<void> = new Subject<void>();\n\n /**\n * Subject used for emitting save\n */\n protected saveSubject: Subject<void> = new Subject<void>();\n\n /**\n * Subject used for emitting copy\n */\n protected copySubject: Subject<void> = new Subject<void>();\n\n /**\n * Subject used for emitting paste\n */\n protected pasteSubject: Subject<void> = new Subject<void>();\n\n /**\n * Subject used for emitting cut\n */\n protected cutSubject: Subject<void> = new Subject<void>();\n\n /**\n * Subject used for emitting delete\n */\n protected deleteSubject: Subject<void> = new Subject<void>();\n\n //######################### public properties #########################\n\n /**\n * Occurs on undo shortcut\n */\n public get undo(): Observable<void>\n {\n return this.undoSubject.asObservable();\n }\n\n /**\n * Occurs on redo shortcut\n */\n public get redo(): Observable<void>\n {\n return this.redoSubject.asObservable();\n }\n\n /**\n * Occurs on save shortcut\n */\n public get save(): Observable<void>\n {\n return this.saveSubject.asObservable();\n }\n \n /**\n * Occurs on copy shortcut\n */\n public get copy(): Observable<void>\n {\n return this.copySubject.asObservable();\n }\n\n /**\n * Occurs on cut shortcut\n */\n public get cut(): Observable<void>\n {\n return this.cutSubject.asObservable();\n }\n\n /**\n * Occurs on paste shortcut\n */\n public get paste(): Observable<void>\n {\n return this.pasteSubject.asObservable();\n }\n\n /**\n * Occurs on delete shortcut\n */\n public get delete(): Observable<void>\n {\n return this.deleteSubject.asObservable();\n }\n\n //######################### constructor #########################\n constructor(protected hotkeys: AppHotkeysService,)\n {\n }\n\n //######################### public methods - implementation of OnDestroy #########################\n \n /**\n * Called when component is destroyed\n */\n public destroy(): void\n {\n this.hotkeys.destroy();\n }\n\n //######################### public methods #########################\n\n /**\n * Initialize hotkeys\n */\n public init(): void\n {\n this.hotkeys.hotkeys.add(new Hotkey('ctrl+s', () =>\n {\n this.saveSubject.next();\n\n return false;\n }, ['INPUT', 'TEXTAREA'], 'Emits save event'));\n\n this.hotkeys.hotkeys.add(new Hotkey('ctrl+z', () =>\n {\n this.undoSubject.next();\n\n return false;\n }, ['INPUT', 'TEXTAREA'], 'Emits undo event'));\n\n this.hotkeys.hotkeys.add(new Hotkey('ctrl+y', () =>\n {\n this.redoSubject.next();\n\n return false;\n }, ['INPUT', 'TEXTAREA'], 'Emits redo event'));\n\n this.hotkeys.hotkeys.add(new Hotkey('del', () =>\n {\n this.deleteSubject.next();\n\n return false;\n }, [], 'Emits delete event'));\n\n this.hotkeys.hotkeys.add(new Hotkey('ctrl+c', () =>\n {\n this.copySubject.next();\n\n return false;\n }, [], 'Emits copy event'));\n\n this.hotkeys.hotkeys.add(new Hotkey('ctrl+v', () =>\n {\n this.pasteSubject.next();\n\n return false;\n }, [], 'Emits paste event'));\n\n this.hotkeys.hotkeys.add(new Hotkey('ctrl+x', () =>\n {\n this.cutSubject.next();\n\n return false;\n }, [], 'Emits cut event'));\n }\n}"]}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { __decorate } from "tslib";
|
|
2
|
+
import { Component, ChangeDetectionStrategy } from '@angular/core';
|
|
3
|
+
import { LayoutComponentBase, LayoutComponentRendererSADirective } from '@anglr/dynamic/layout';
|
|
4
|
+
import { LayoutEditorMetadata } from '@anglr/dynamic/layout-editor';
|
|
5
|
+
import { BlockLayoutMetadataLoader } from './block.metadata';
|
|
6
|
+
import * as i0 from "@angular/core";
|
|
7
|
+
/**
|
|
8
|
+
* Component used for displaying block
|
|
9
|
+
*/
|
|
10
|
+
let BlockSAComponent = class BlockSAComponent extends LayoutComponentBase {
|
|
11
|
+
};
|
|
12
|
+
BlockSAComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.1.0", ngImport: i0, type: BlockSAComponent, deps: null, target: i0.ɵɵFactoryTarget.Component });
|
|
13
|
+
BlockSAComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.1.0", type: BlockSAComponent, isStandalone: true, selector: "div", usesInheritance: true, ngImport: i0, template: "<ng-template [layoutComponentRenderer]=\"options?.content\"></ng-template>", dependencies: [{ kind: "directive", type: LayoutComponentRendererSADirective, selector: "[layoutComponentRenderer]", inputs: ["layoutComponentRenderer", "layoutComponentRendererInjector", "layoutComponentRendererDisableTransformer"], outputs: ["layoutComponentRendererComponentChange", "componentElementChange"], exportAs: ["layoutComponentRenderer"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
14
|
+
BlockSAComponent = __decorate([
|
|
15
|
+
LayoutEditorMetadata(BlockLayoutMetadataLoader)
|
|
16
|
+
], BlockSAComponent);
|
|
17
|
+
export { BlockSAComponent };
|
|
18
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.1.0", ngImport: i0, type: BlockSAComponent, decorators: [{
|
|
19
|
+
type: Component,
|
|
20
|
+
args: [{ selector: 'div', standalone: true, imports: [
|
|
21
|
+
LayoutComponentRendererSADirective,
|
|
22
|
+
], changeDetection: ChangeDetectionStrategy.OnPush, template: "<ng-template [layoutComponentRenderer]=\"options?.content\"></ng-template>" }]
|
|
23
|
+
}] });
|
|
24
|
+
//# sourceMappingURL=block.component.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"block.component.js","sourceRoot":"","sources":["../../../../../basic-components/src/dynamicItems/block/block.component.ts","../../../../../basic-components/src/dynamicItems/block/block.component.html"],"names":[],"mappings":";AAAA,OAAO,EAAC,SAAS,EAAE,uBAAuB,EAAC,MAAM,eAAe,CAAC;AACjE,OAAO,EAAkB,mBAAmB,EAAE,kCAAkC,EAAC,MAAM,uBAAuB,CAAC;AAC/G,OAAO,EAAC,oBAAoB,EAAC,MAAM,8BAA8B,CAAC;AAGlE,OAAO,EAAC,yBAAyB,EAAC,MAAM,kBAAkB,CAAC;;AAE3D;;GAEG;IAaU,gBAAgB,SAAhB,gBAAiB,SAAQ,mBAA0C;CAE/E,CAAA;6GAFY,gBAAgB;iGAAhB,gBAAgB,sFCtB7B,4EAAwE,4CDiBhE,kCAAkC;AAK7B,gBAAgB;IAD5B,oBAAoB,CAAC,yBAAyB,CAAC;GACnC,gBAAgB,CAE5B;SAFY,gBAAgB;2FAAhB,gBAAgB;kBAZ5B,SAAS;+BAEI,KAAK,cAEH,IAAI,WAEhB;wBACI,kCAAkC;qBACrC,mBACgB,uBAAuB,CAAC,MAAM","sourcesContent":["import {Component, ChangeDetectionStrategy} from '@angular/core';\nimport {LayoutComponent, LayoutComponentBase, LayoutComponentRendererSADirective} from '@anglr/dynamic/layout';\nimport {LayoutEditorMetadata} from '@anglr/dynamic/layout-editor';\n\nimport {BlockComponentOptions} from './block.options';\nimport {BlockLayoutMetadataLoader} from './block.metadata';\n\n/**\n * Component used for displaying block\n */\n@Component(\n{\n selector: 'div',\n templateUrl: 'block.component.html',\n standalone: true,\n imports:\n [\n LayoutComponentRendererSADirective,\n ],\n changeDetection: ChangeDetectionStrategy.OnPush\n})\n@LayoutEditorMetadata(BlockLayoutMetadataLoader)\nexport class BlockSAComponent extends LayoutComponentBase<BlockComponentOptions> implements LayoutComponent<BlockComponentOptions>\n{\n}","<ng-template [layoutComponentRenderer]=\"options?.content\"></ng-template>"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"block.metadata.js","sourceRoot":"","sources":["../../../../../basic-components/src/dynamicItems/block/block.metadata.ts"],"names":[],"mappings":"AAKA;;GAEG;AACH,MAAM,CAAC,MAAM,yBAAyB,GAAiF,KAAK,IAAI,EAAE,CAAC,IAAI,CAAC,MAAM,MAAM,CAAC,iCAAiC,CAAC,CAAC,CAAC,yBAAyB,EAAE,CAAC","sourcesContent":["import {DynamicMetadataLoader} from '@anglr/dynamic';\nimport {LayoutEditorMetadataDescriptor} from '@anglr/dynamic/layout-editor';\n\nimport {BlockComponentOptions} from './block.options';\n\n/**\n * Block layout metadata loader\n */\nexport const BlockLayoutMetadataLoader: DynamicMetadataLoader<LayoutEditorMetadataDescriptor<BlockComponentOptions>> = async () => new (await import('./metadata/block.layoutMetadata')).BlockLayoutEditorMetadata();\n"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"block.options.js","sourceRoot":"","sources":["../../../../../basic-components/src/dynamicItems/block/block.options.ts"],"names":[],"mappings":"","sourcesContent":["import {LayoutComponentMetadata} from '@anglr/dynamic/layout';\n\n/**\n * Options for block component\n */\nexport interface BlockComponentOptions\n{\n /**\n * Metadata for component displayed as content of block\n */\n content: LayoutComponentMetadata|undefined|null;\n}"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../basic-components/src/dynamicItems/block/index.ts"],"names":[],"mappings":"AAAA,cAAc,iBAAiB,CAAC","sourcesContent":["export * from './block.options';\n"]}
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
import { ComponentStylingModel, ComponentStylingPropertiesControlComponent } from '@anglr/dynamic/layout-editor';
|
|
2
|
+
/**
|
|
3
|
+
* Block layout metadata
|
|
4
|
+
*/
|
|
5
|
+
export class BlockLayoutEditorMetadata {
|
|
6
|
+
//######################### constructor #########################
|
|
7
|
+
constructor() {
|
|
8
|
+
//######################### public properties - implementation of LayoutEditorMetadataDescriptor #########################
|
|
9
|
+
/**
|
|
10
|
+
* @inheritdoc
|
|
11
|
+
*/
|
|
12
|
+
this.metaInfo = {
|
|
13
|
+
name: 'Block',
|
|
14
|
+
description: 'Block element, wraps content, allows custom styling',
|
|
15
|
+
group: 'Layout',
|
|
16
|
+
optionsMetadata: {
|
|
17
|
+
propertiesMetadata: [
|
|
18
|
+
{
|
|
19
|
+
modelType: ComponentStylingModel,
|
|
20
|
+
propertiesControls: [
|
|
21
|
+
ComponentStylingPropertiesControlComponent,
|
|
22
|
+
],
|
|
23
|
+
},
|
|
24
|
+
]
|
|
25
|
+
},
|
|
26
|
+
};
|
|
27
|
+
/**
|
|
28
|
+
* @inheritdoc
|
|
29
|
+
*/
|
|
30
|
+
this.addDescendant = (metadata, options) => {
|
|
31
|
+
options.content = metadata;
|
|
32
|
+
};
|
|
33
|
+
/**
|
|
34
|
+
* @inheritdoc
|
|
35
|
+
*/
|
|
36
|
+
this.canDropMetadata = options => !options?.content;
|
|
37
|
+
/**
|
|
38
|
+
* @inheritdoc
|
|
39
|
+
*/
|
|
40
|
+
this.getDescendants = options => options?.content ? [options?.content] : [];
|
|
41
|
+
/**
|
|
42
|
+
* @inheritdoc
|
|
43
|
+
*/
|
|
44
|
+
this.removeDescendant = (_, options) => {
|
|
45
|
+
options.content = null;
|
|
46
|
+
};
|
|
47
|
+
Object.freeze(this);
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
//# sourceMappingURL=block.layoutMetadata.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"block.layoutMetadata.js","sourceRoot":"","sources":["../../../../../../basic-components/src/dynamicItems/block/metadata/block.layoutMetadata.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,qBAAqB,EAAE,0CAA0C,EAA2D,MAAM,8BAA8B,CAAC;AAMzK;;GAEG;AACH,MAAM,OAAO,yBAAyB;IAqDlC,iEAAiE;IACjE;QApDA,0HAA0H;QAE1H;;WAEG;QACI,aAAQ,GACf;YACI,IAAI,EAAE,OAAO;YACb,WAAW,EAAE,qDAAqD;YAClE,KAAK,EAAE,QAAQ;YACf,eAAe,EACf;gBACI,kBAAkB,EAClB;oBACI;wBACI,SAAS,EAAE,qBAAqB;wBAChC,kBAAkB,EAClB;4BACI,0CAA0C;yBAC7C;qBACJ;iBACJ;aACJ;SACJ,CAAC;QAEF;;WAEG;QACI,kBAAa,GAAsE,CAAC,QAAQ,EAAE,OAAO,EAAE,EAAE;YAE5G,OAAO,CAAC,OAAO,GAAG,QAAQ,CAAC;QAC/B,CAAC,CAAC;QAEF;;WAEG;QACI,oBAAe,GAA2D,OAAO,CAAC,EAAE,CAAC,CAAC,OAAO,EAAE,OAAO,CAAC;QAE9G;;WAEG;QACI,mBAAc,GAA6E,OAAO,CAAC,EAAE,CAAC,OAAO,EAAE,OAAO,CAAC,CAAC,CAAC,CAAC,OAAO,EAAE,OAAO,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC;QAExJ;;WAEG;QACI,qBAAgB,GAA6C,CAAC,CAAC,EAAE,OAAO,EAAE,EAAE;YAE/E,OAAO,CAAC,OAAO,GAAG,IAAI,CAAC;QAC3B,CAAC,CAAA;QAKG,MAAM,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC;IACxB,CAAC;CACJ","sourcesContent":["import {ComponentStylingModel, ComponentStylingPropertiesControlComponent, LayoutEditorMetadataDescriptor, LayoutEditorMetadataInfo} from '@anglr/dynamic/layout-editor';\nimport {LayoutComponentMetadata} from '@anglr/dynamic/layout';\nimport {Action, Func} from '@jscrpt/common';\n\nimport {BlockComponentOptions} from '../block.options';\n\n/**\n * Block layout metadata\n */\nexport class BlockLayoutEditorMetadata implements LayoutEditorMetadataDescriptor<BlockComponentOptions>\n{\n //######################### public properties - implementation of LayoutEditorMetadataDescriptor #########################\n\n /**\n * @inheritdoc\n */\n public metaInfo?: LayoutEditorMetadataInfo<BlockComponentOptions> =\n {\n name: 'Block',\n description: 'Block element, wraps content, allows custom styling',\n group: 'Layout',\n optionsMetadata:\n {\n propertiesMetadata:\n [\n {\n modelType: ComponentStylingModel,\n propertiesControls:\n [\n ComponentStylingPropertiesControlComponent,\n ],\n },\n ]\n },\n };\n\n /**\n * @inheritdoc\n */\n public addDescendant?: Action<[LayoutComponentMetadata, BlockComponentOptions, number]> = (metadata, options) =>\n {\n options.content = metadata;\n };\n\n /**\n * @inheritdoc\n */\n public canDropMetadata?: Func<boolean, [BlockComponentOptions|undefined|null]> = options => !options?.content;\n\n /**\n * @inheritdoc\n */\n public getDescendants?: Func<LayoutComponentMetadata[], [BlockComponentOptions|undefined|null]> = options => options?.content ? [options?.content] : [];\n\n /**\n * @inheritdoc\n */\n public removeDescendant?: Action<[string, BlockComponentOptions]> = (_, options) =>\n {\n options.content = null;\n }\n\n //######################### constructor #########################\n constructor()\n {\n Object.freeze(this);\n }\n}"]}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { mapValuesToThis } from '@jscrpt/common';
|
|
2
|
+
/**
|
|
3
|
+
* Block model for properties editor
|
|
4
|
+
*/
|
|
5
|
+
export class BlockModel {
|
|
6
|
+
//######################### constructor #########################
|
|
7
|
+
constructor(value) {
|
|
8
|
+
mapValuesToThis.bind(this)(value);
|
|
9
|
+
}
|
|
10
|
+
}
|
|
11
|
+
//# sourceMappingURL=block.model.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"block.model.js","sourceRoot":"","sources":["../../../../../../basic-components/src/dynamicItems/block/metadata/block.model.ts"],"names":[],"mappings":"AACA,OAAO,EAAC,eAAe,EAAC,MAAM,gBAAgB,CAAC;AAI/C;;GAEG;AACH,MAAM,OAAO,UAAU;IASnB,iEAAiE;IACjE,YAAY,KAA2C;QAEnD,eAAe,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,KAAK,CAAC,CAAC;IACtC,CAAC;CACJ","sourcesContent":["import {LayoutComponentMetadata} from '@anglr/dynamic/layout';\nimport {mapValuesToThis} from '@jscrpt/common';\n\nimport {BlockComponentOptions} from '../block.options';\n\n/**\n * Block model for properties editor\n */\nexport class BlockModel implements BlockComponentOptions\n{\n //######################### public properties #########################\n\n /**\n * @inheritdoc\n */\n public content: LayoutComponentMetadata|undefined|null;\n\n //######################### constructor #########################\n constructor(value: BlockComponentOptions|undefined|null)\n {\n mapValuesToThis.bind(this)(value);\n }\n}"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"type.js","sourceRoot":"","sources":["../../../../../basic-components/src/dynamicItems/block/type.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,yBAAyB,EAAC,MAAM,uBAAuB,CAAC;AAEhE,OAAO,EAAC,gBAAgB,EAAC,MAAM,mBAAmB,CAAC;AAEnD,eAAe,gBAAgB,CAAC;AAEhC,MAAM,CAAC,MAAM,UAAU,GAAG,CAAC,yBAAyB,CAAC,CAAC","sourcesContent":["import {ComponentStylingExtension} from '@anglr/dynamic/layout';\n\nimport {BlockSAComponent} from './block.component';\n\nexport default BlockSAComponent;\n\nexport const extensions = [ComponentStylingExtension];"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../basic-components/src/dynamicItems/index.ts"],"names":[],"mappings":"AAAA,cAAc,UAAU,CAAC;AACzB,cAAc,iBAAiB,CAAC;AAChC,cAAc,gBAAgB,CAAC;AAC/B,cAAc,aAAa,CAAC;AAC5B,cAAc,iBAAiB,CAAC;AAChC,cAAc,aAAa,CAAC;AAC5B,cAAc,WAAW,CAAC;AAC1B,cAAc,aAAa,CAAC;AAC5B,cAAc,cAAc,CAAC;AAC7B,cAAc,aAAa,CAAC;AAC5B,cAAc,YAAY,CAAC;AAC3B,cAAc,YAAY,CAAC;AAC3B,cAAc,cAAc,CAAC;AAC7B,cAAc,cAAc,CAAC;AAC7B,cAAc,iBAAiB,CAAC;AAChC,cAAc,aAAa,CAAC;AAC5B,cAAc,gBAAgB,CAAC;AAC/B,cAAc,iBAAiB,CAAC;AAChC,cAAc,SAAS,CAAC","sourcesContent":["export * from './button';\nexport * from './debounceValue';\nexport * from './firstNonNull';\nexport * from './gridPanel';\nexport * from './gridPanelCell';\nexport * from './htmlBlock';\nexport * from './ifBlock';\nexport * from './listBlock';\nexport * from './logicalAnd';\nexport * from './logicalOr';\nexport * from './negation';\nexport * from './notFound';\nexport * from './stackPanel';\nexport * from './syncValues';\nexport * from './templateBlock';\nexport * from './textBlock';\nexport * from './toggleButton';\nexport * from './transformData';\nexport * from './value';\n"]}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../basic-components/src/dynamicItems/index.ts"],"names":[],"mappings":"AAAA,cAAc,SAAS,CAAC;AACxB,cAAc,UAAU,CAAC;AACzB,cAAc,iBAAiB,CAAC;AAChC,cAAc,gBAAgB,CAAC;AAC/B,cAAc,aAAa,CAAC;AAC5B,cAAc,iBAAiB,CAAC;AAChC,cAAc,aAAa,CAAC;AAC5B,cAAc,WAAW,CAAC;AAC1B,cAAc,aAAa,CAAC;AAC5B,cAAc,cAAc,CAAC;AAC7B,cAAc,aAAa,CAAC;AAC5B,cAAc,YAAY,CAAC;AAC3B,cAAc,YAAY,CAAC;AAC3B,cAAc,cAAc,CAAC;AAC7B,cAAc,cAAc,CAAC;AAC7B,cAAc,iBAAiB,CAAC;AAChC,cAAc,aAAa,CAAC;AAC5B,cAAc,gBAAgB,CAAC;AAC/B,cAAc,iBAAiB,CAAC;AAChC,cAAc,SAAS,CAAC","sourcesContent":["export * from './block';\nexport * from './button';\nexport * from './debounceValue';\nexport * from './firstNonNull';\nexport * from './gridPanel';\nexport * from './gridPanelCell';\nexport * from './htmlBlock';\nexport * from './ifBlock';\nexport * from './listBlock';\nexport * from './logicalAnd';\nexport * from './logicalOr';\nexport * from './negation';\nexport * from './notFound';\nexport * from './stackPanel';\nexport * from './syncValues';\nexport * from './templateBlock';\nexport * from './textBlock';\nexport * from './toggleButton';\nexport * from './transformData';\nexport * from './value';\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../../basic-components/src/types.ts"],"names":[],"mappings":"AAAA,MAAM,UAAU,GAChB;IACI,QAAQ;IACR,WAAW;IACX,WAAW;IACX,SAAS;IACT,WAAW;IACX,YAAY;IACZ,eAAe;IACf,WAAW;IACX,cAAc;CACjB,CAAC;AAEF,eAAe,UAAU,CAAC","sourcesContent":["const components = \n[\n 'button',\n 'gridPanel',\n 'htmlBlock',\n 'ifBlock',\n 'listBlock',\n 'stackPanel',\n 'templateBlock',\n 'textBlock',\n 'toggleButton',\n];\n\nexport default components;\n"]}
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../../basic-components/src/types.ts"],"names":[],"mappings":"AAAA,MAAM,UAAU,GAChB;IACI,OAAO;IACP,QAAQ;IACR,WAAW;IACX,WAAW;IACX,SAAS;IACT,WAAW;IACX,YAAY;IACZ,eAAe;IACf,WAAW;IACX,cAAc;CACjB,CAAC;AAEF,eAAe,UAAU,CAAC","sourcesContent":["const components = \n[\n 'block',\n 'button',\n 'gridPanel',\n 'htmlBlock',\n 'ifBlock',\n 'listBlock',\n 'stackPanel',\n 'templateBlock',\n 'textBlock',\n 'toggleButton',\n];\n\nexport default components;\n"]}
|
|
@@ -237,9 +237,9 @@ export class LayoutDesignerSAComponent extends LayoutComponentBase {
|
|
|
237
237
|
}
|
|
238
238
|
}
|
|
239
239
|
LayoutDesignerSAComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.1.0", ngImport: i0, type: LayoutDesignerSAComponent, deps: [{ token: i0.ChangeDetectorRef }, { token: i0.ElementRef }, { token: i0.Injector }, { token: i1.LayoutEditorMetadataExtractor }, { token: i1.LayoutEditorMetadataManager }, { token: i1.LayoutComponentsIteratorService }, { token: LAYOUT_HISTORY_MANAGER }, { token: SCOPE_ID, optional: true }, { token: LOGGER, optional: true }, { token: LayoutDesignerSAComponent, optional: true, skipSelf: true }], target: i0.ɵɵFactoryTarget.Component });
|
|
240
|
-
LayoutDesignerSAComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.1.0", type: LayoutDesignerSAComponent, isStandalone: true, selector: "layout-designer-component", viewQueries: [{ propertyName: "designerElement", first: true, predicate: ["layoutDesigner"], descendants: true, static: true }, { propertyName: "dndCoreDesigner", first: true, predicate: ["dndCoreDesigner"], descendants: true, static: true }], usesInheritance: true, ngImport: i0, template: "<div class=\"designer-overlay\" \n #layoutDesigner\n #dndCore=\"dndCoreDesigner\"\n [dndCoreDesigner]=\"{metadata: renderedType, parentId: parent?.renderedType?.id, index: index}\"\n [dropzoneElement]=\"layoutDropzone\"\n [dragDisabled]=\"dragDisabled\"\n [dragSource]=\"dndCore.drag\"\n [noHTML5Preview]=\"true\"\n (dropMetadata)=\"addDescendant($event)\"\n [copyDesignerStyles]=\"renderedType\"\n (mouseleave)=\"hideOverlay($event)\"\n (mouseover)=\"showOverlay($event)\"\n (click)=\"selectComponent($event)\"\n (dblclick)=\"unselectComponent($event)\">\n <div class=\"designer-dropzone\"\n #layoutDropzone\n designerMinWidth\n [canDrop]=\"canDrop\"\n [editorMetadata]=\"editorMetadata\"\n [horizontal]=\"parent?.horizontal ?? false\"\n [dropTarget]=\"dndCore.dropzone\"\n [isDropZone]=\"canDrop\">\n <ng-template #renderer=\"layoutComponentRenderer\" [layoutComponentRenderer]=\"renderedType\" [layoutComponentRendererDisableTransformer]=\"true\"></ng-template>\n\n <ng-container *ngIf=\"highlighted || selected\">\n <div class=\"designer-overlay-border\"></div>\n <div class=\"designer-overlay-layout\" [layoutDesignerOverlayFor]=\"renderer\"></div>\n\n <div class=\"designer-overlay-title\"\n *bodyRender\n [positionTo]=\"layoutDesigner\"\n placement=\"TopStart\">{{editorMetadata?.metaInfo?.name ?? renderedType?.name}}</div>\n\n <ng-container *ngIf=\"!!parent && parent.editorMetadata?.removeDescendant\">\n <div *bodyRender\n class=\"designer-overlay-remove\"\n [positionTo]=\"layoutDesigner\"\n placement=\"TopEnd\"\n (click)=\"remove()\">\n <span class=\"fas fa-times\"></span>\n </div>\n </ng-container>\n </ng-container>\n </div>\n</div>\n", dependencies: [{ kind: "ngmodule", type:
|
|
240
|
+
LayoutDesignerSAComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.1.0", type: LayoutDesignerSAComponent, isStandalone: true, selector: "layout-designer-component", viewQueries: [{ propertyName: "designerElement", first: true, predicate: ["layoutDesigner"], descendants: true, static: true }, { propertyName: "dndCoreDesigner", first: true, predicate: ["dndCoreDesigner"], descendants: true, static: true }], usesInheritance: true, ngImport: i0, template: "<div class=\"designer-overlay\" \n #layoutDesigner\n #dndCore=\"dndCoreDesigner\"\n [dndCoreDesigner]=\"{metadata: renderedType, parentId: parent?.renderedType?.id, index: index}\"\n [dropzoneElement]=\"layoutDropzone\"\n [dragDisabled]=\"dragDisabled\"\n [dragSource]=\"dndCore.drag\"\n [noHTML5Preview]=\"true\"\n (dropMetadata)=\"addDescendant($event)\"\n [copyDesignerStyles]=\"renderedType\"\n (mouseleave)=\"hideOverlay($event)\"\n (mouseover)=\"showOverlay($event)\"\n (click)=\"selectComponent($event)\"\n (dblclick)=\"unselectComponent($event)\">\n <div class=\"designer-dropzone\"\n #layoutDropzone\n designerMinWidth\n [canDrop]=\"canDrop\"\n [editorMetadata]=\"editorMetadata\"\n [horizontal]=\"parent?.horizontal ?? false\"\n [dropTarget]=\"dndCore.dropzone\"\n [isDropZone]=\"canDrop\">\n <ng-template #renderer=\"layoutComponentRenderer\" [layoutComponentRenderer]=\"renderedType\" [layoutComponentRendererDisableTransformer]=\"true\"></ng-template>\n\n <ng-container *ngIf=\"highlighted || selected\">\n <div class=\"designer-overlay-border\"></div>\n <div class=\"designer-overlay-layout\" [layoutDesignerOverlayFor]=\"renderer\"></div>\n\n <div class=\"designer-overlay-title\"\n *bodyRender\n [positionTo]=\"layoutDesigner\"\n placement=\"TopStart\">{{editorMetadata?.metaInfo?.name ?? renderedType?.name}}</div>\n\n <ng-container *ngIf=\"!!parent && parent.editorMetadata?.removeDescendant\">\n <div *bodyRender\n class=\"designer-overlay-remove\"\n [positionTo]=\"layoutDesigner\"\n [offset]=\"{mainAxis: -18, alignmentAxis: -6}\"\n placement=\"TopEnd\"\n (click)=\"remove()\">\n <span class=\"fas fa-times\"></span>\n </div>\n </ng-container>\n </ng-container>\n </div>\n</div>\n", dependencies: [{ kind: "ngmodule", type:
|
|
241
241
|
//TODO: cleanup
|
|
242
|
-
CommonModule }, { kind: "directive", type: i2.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "ngmodule", type: PositionModule }, { kind: "directive", type: i3.PositionToDirective, selector: "[positionTo]", inputs: ["positionTo", "placement"], outputs: ["flip"] }, { kind: "component", type: LayoutDesignerOverlayForSAComponent, selector: "[layoutDesignerOverlayFor]", inputs: ["layoutDesignerOverlayFor"] }, { kind: "directive", type: DesignerMinDimensionSADirective, selector: "[designerMinWidth]", inputs: ["horizontal", "canDrop", "editorMetadata"] }, { kind: "directive", type: CopyDesignerStylesSADirective, selector: "[copyDesignerStyles]", inputs: ["copyDesignerStyles"], exportAs: ["copyDesignerStyles"] }, { kind: "directive", type: LayoutComponentRendererSADirective, selector: "[layoutComponentRenderer]", inputs: ["layoutComponentRenderer", "layoutComponentRendererInjector", "layoutComponentRendererDisableTransformer"], outputs: ["layoutComponentRendererComponentChange", "componentElementChange"], exportAs: ["layoutComponentRenderer"] }, { kind: "directive", type: DesignerDropzoneSADirective, selector: ".designer-dropzone", inputs: ["isDropZone"] }, { kind: "directive", type: BodyRenderSADirective, selector: "[bodyRender]" }, { kind: "ngmodule", type: DndModule }, { kind: "directive", type: i4.DragSourceDirective, selector: "[dragSource]", inputs: ["dragSource", "dragSourceType", "dragSourceOptions", "noHTML5Preview"] }, { kind: "directive", type: i4.DropTargetDirective, selector: "[dropTarget]", inputs: ["dropTarget", "dropTargetTypes", "dropTargetType"] }, { kind: "ngmodule", type: LayoutDndCoreModule }, { kind: "directive", type: i5.DndCoreDesignerDirective, selector: "[dndCoreDesigner]", inputs: ["dropzoneElement", "dndCoreDesigner", "dragDisabled"], outputs: ["dropMetadata"], exportAs: ["dndCoreDesigner"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
242
|
+
CommonModule }, { kind: "directive", type: i2.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "ngmodule", type: PositionModule }, { kind: "directive", type: i3.PositionToDirective, selector: "[positionTo]", inputs: ["positionTo", "placement", "offset", "autoUpdate"], outputs: ["flip", "done"] }, { kind: "component", type: LayoutDesignerOverlayForSAComponent, selector: "[layoutDesignerOverlayFor]", inputs: ["layoutDesignerOverlayFor"] }, { kind: "directive", type: DesignerMinDimensionSADirective, selector: "[designerMinWidth]", inputs: ["horizontal", "canDrop", "editorMetadata"] }, { kind: "directive", type: CopyDesignerStylesSADirective, selector: "[copyDesignerStyles]", inputs: ["copyDesignerStyles"], exportAs: ["copyDesignerStyles"] }, { kind: "directive", type: LayoutComponentRendererSADirective, selector: "[layoutComponentRenderer]", inputs: ["layoutComponentRenderer", "layoutComponentRendererInjector", "layoutComponentRendererDisableTransformer"], outputs: ["layoutComponentRendererComponentChange", "componentElementChange"], exportAs: ["layoutComponentRenderer"] }, { kind: "directive", type: DesignerDropzoneSADirective, selector: ".designer-dropzone", inputs: ["isDropZone"] }, { kind: "directive", type: BodyRenderSADirective, selector: "[bodyRender]" }, { kind: "ngmodule", type: DndModule }, { kind: "directive", type: i4.DragSourceDirective, selector: "[dragSource]", inputs: ["dragSource", "dragSourceType", "dragSourceOptions", "noHTML5Preview"] }, { kind: "directive", type: i4.DropTargetDirective, selector: "[dropTarget]", inputs: ["dropTarget", "dropTargetTypes", "dropTargetType"] }, { kind: "ngmodule", type: LayoutDndCoreModule }, { kind: "directive", type: i5.DndCoreDesignerDirective, selector: "[dndCoreDesigner]", inputs: ["dropzoneElement", "dndCoreDesigner", "dragDisabled"], outputs: ["dropMetadata"], exportAs: ["dndCoreDesigner"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
243
243
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.1.0", ngImport: i0, type: LayoutDesignerSAComponent, decorators: [{
|
|
244
244
|
type: Component,
|
|
245
245
|
args: [{ selector: 'layout-designer-component', standalone: true, imports: [
|
|
@@ -255,7 +255,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.1.0", ngImpor
|
|
|
255
255
|
BodyRenderSADirective,
|
|
256
256
|
DndModule,
|
|
257
257
|
LayoutDndCoreModule,
|
|
258
|
-
], changeDetection: ChangeDetectionStrategy.OnPush, template: "<div class=\"designer-overlay\" \n #layoutDesigner\n #dndCore=\"dndCoreDesigner\"\n [dndCoreDesigner]=\"{metadata: renderedType, parentId: parent?.renderedType?.id, index: index}\"\n [dropzoneElement]=\"layoutDropzone\"\n [dragDisabled]=\"dragDisabled\"\n [dragSource]=\"dndCore.drag\"\n [noHTML5Preview]=\"true\"\n (dropMetadata)=\"addDescendant($event)\"\n [copyDesignerStyles]=\"renderedType\"\n (mouseleave)=\"hideOverlay($event)\"\n (mouseover)=\"showOverlay($event)\"\n (click)=\"selectComponent($event)\"\n (dblclick)=\"unselectComponent($event)\">\n <div class=\"designer-dropzone\"\n #layoutDropzone\n designerMinWidth\n [canDrop]=\"canDrop\"\n [editorMetadata]=\"editorMetadata\"\n [horizontal]=\"parent?.horizontal ?? false\"\n [dropTarget]=\"dndCore.dropzone\"\n [isDropZone]=\"canDrop\">\n <ng-template #renderer=\"layoutComponentRenderer\" [layoutComponentRenderer]=\"renderedType\" [layoutComponentRendererDisableTransformer]=\"true\"></ng-template>\n\n <ng-container *ngIf=\"highlighted || selected\">\n <div class=\"designer-overlay-border\"></div>\n <div class=\"designer-overlay-layout\" [layoutDesignerOverlayFor]=\"renderer\"></div>\n\n <div class=\"designer-overlay-title\"\n *bodyRender\n [positionTo]=\"layoutDesigner\"\n placement=\"TopStart\">{{editorMetadata?.metaInfo?.name ?? renderedType?.name}}</div>\n\n <ng-container *ngIf=\"!!parent && parent.editorMetadata?.removeDescendant\">\n <div *bodyRender\n class=\"designer-overlay-remove\"\n [positionTo]=\"layoutDesigner\"\n placement=\"TopEnd\"\n (click)=\"remove()\">\n <span class=\"fas fa-times\"></span>\n </div>\n </ng-container>\n </ng-container>\n </div>\n</div>\n" }]
|
|
258
|
+
], changeDetection: ChangeDetectionStrategy.OnPush, template: "<div class=\"designer-overlay\" \n #layoutDesigner\n #dndCore=\"dndCoreDesigner\"\n [dndCoreDesigner]=\"{metadata: renderedType, parentId: parent?.renderedType?.id, index: index}\"\n [dropzoneElement]=\"layoutDropzone\"\n [dragDisabled]=\"dragDisabled\"\n [dragSource]=\"dndCore.drag\"\n [noHTML5Preview]=\"true\"\n (dropMetadata)=\"addDescendant($event)\"\n [copyDesignerStyles]=\"renderedType\"\n (mouseleave)=\"hideOverlay($event)\"\n (mouseover)=\"showOverlay($event)\"\n (click)=\"selectComponent($event)\"\n (dblclick)=\"unselectComponent($event)\">\n <div class=\"designer-dropzone\"\n #layoutDropzone\n designerMinWidth\n [canDrop]=\"canDrop\"\n [editorMetadata]=\"editorMetadata\"\n [horizontal]=\"parent?.horizontal ?? false\"\n [dropTarget]=\"dndCore.dropzone\"\n [isDropZone]=\"canDrop\">\n <ng-template #renderer=\"layoutComponentRenderer\" [layoutComponentRenderer]=\"renderedType\" [layoutComponentRendererDisableTransformer]=\"true\"></ng-template>\n\n <ng-container *ngIf=\"highlighted || selected\">\n <div class=\"designer-overlay-border\"></div>\n <div class=\"designer-overlay-layout\" [layoutDesignerOverlayFor]=\"renderer\"></div>\n\n <div class=\"designer-overlay-title\"\n *bodyRender\n [positionTo]=\"layoutDesigner\"\n placement=\"TopStart\">{{editorMetadata?.metaInfo?.name ?? renderedType?.name}}</div>\n\n <ng-container *ngIf=\"!!parent && parent.editorMetadata?.removeDescendant\">\n <div *bodyRender\n class=\"designer-overlay-remove\"\n [positionTo]=\"layoutDesigner\"\n [offset]=\"{mainAxis: -18, alignmentAxis: -6}\"\n placement=\"TopEnd\"\n (click)=\"remove()\">\n <span class=\"fas fa-times\"></span>\n </div>\n </ng-container>\n </ng-container>\n </div>\n</div>\n" }]
|
|
259
259
|
}], ctorParameters: function () { return [{ type: i0.ChangeDetectorRef }, { type: i0.ElementRef }, { type: i0.Injector }, { type: i1.LayoutEditorMetadataExtractor }, { type: i1.LayoutEditorMetadataManager }, { type: i1.LayoutComponentsIteratorService }, { type: i6.MetadataHistoryManager, decorators: [{
|
|
260
260
|
type: Inject,
|
|
261
261
|
args: [LAYOUT_HISTORY_MANAGER]
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"layoutDesigner.component.js","sourceRoot":"","sources":["../../../../../layout-editor/src/components/layoutDesigner/layoutDesigner.component.ts","../../../../../layout-editor/src/components/layoutDesigner/layoutDesigner.component.html"],"names":[],"mappings":"AAAA,OAAO,EAAC,SAAS,EAAE,uBAAuB,EAAE,iBAAiB,EAAE,UAAU,EAAE,QAAQ,EAAE,QAAQ,EAAE,MAAM,EAAa,QAAQ,EAAE,SAAS,EAAC,MAAM,eAAe,CAAC;AAC5J,OAAO,EAAC,YAAY,EAAC,MAAM,iBAAiB,CAAC;AAC7C,OAAO,EAAS,MAAM,EAAE,cAAc,EAAC,MAA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AAE,EAAC,MAAM,EAAE,IAAI,EAAC;gBASpC,eAAe;sBADrB,SAAS;uBAAC,iBAAiB,EAAE,EAAC,MAAM,EAAE,IAAI,EAAC","sourcesContent":["import {Component, ChangeDetectionStrategy, ChangeDetectorRef, ElementRef, SkipSelf, Optional, Inject, OnDestroy, Injector, ViewChild} from '@angular/core';\nimport {CommonModule} from '@angular/common';\nimport {Logger, LOGGER, PositionModule} from '@anglr/common';\nimport {LayoutComponent, LayoutComponentMetadata} from '@anglr/dynamic/layout';\nimport {LayoutComponentBase, LayoutComponentRendererSADirective} from '@anglr/dynamic/layout';\nimport {MetadataHistoryManager, SCOPE_ID} from '@anglr/dynamic';\nimport {isPresent} from '@jscrpt/common';\nimport {DndModule} from '@ng-dnd/core';\nimport {Subscription} from 'rxjs';\n\nimport {LayoutDesignerComponentOptions} from './layoutDesigner.options';\nimport {BodyRenderSADirective, CopyDesignerStylesSADirective, DesignerDropzoneSADirective, DesignerMinDimensionSADirective} from '../../directives';\nimport {LayoutComponentsIteratorService, LayoutEditorMetadataExtractor, LayoutEditorMetadataManager} from '../../services';\nimport {LayoutEditorDragPreviewSAComponent} from '../layoutEditorDragPreview/layoutEditorDragPreview.component';\nimport {LayoutDesignerOverlayForSAComponent} from '../layoutDesignerOverlayFor/layoutDesignerOverlayFor.component';\nimport {LayoutEditorMetadataDescriptor} from '../../decorators';\nimport {LAYOUT_HISTORY_MANAGER} from '../../misc/tokens';\nimport {DndCoreDesignerDirective, LayoutDndCoreModule} from '../../modules';\nimport {LayoutComponentDragData} from '../../interfaces';\n\n/**\n * Component used as designer component wrapper for layout component\n */\n@Component(\n{\n selector: 'layout-designer-component',\n templateUrl: 'layoutDesigner.component.html',\n standalone: true,\n imports:\n [\n //TODO: cleanup\n CommonModule,\n PositionModule,\n LayoutEditorDragPreviewSAComponent,\n LayoutDesignerOverlayForSAComponent,\n DesignerMinDimensionSADirective,\n CopyDesignerStylesSADirective,\n LayoutComponentRendererSADirective,\n DesignerDropzoneSADirective,\n BodyRenderSADirective,\n DndModule,\n LayoutDndCoreModule,\n ],\n changeDetection: ChangeDetectionStrategy.OnPush\n})\nexport class LayoutDesignerSAComponent extends LayoutComponentBase<LayoutDesignerComponentOptions> implements LayoutComponent<LayoutDesignerComponentOptions>, OnDestroy\n{\n //######################### protected properties #########################\n\n /**\n * Subscriptions created during initialization\n */\n protected initSubscriptions: Subscription = new Subscription();\n\n //######################### protected properties - template bindings #########################\n\n /**\n * Indication whether is component selected\n */\n protected get selected(): boolean\n {\n return this.layoutEditorMetadataManager.selectedComponent === this.options?.typeMetadata.id;\n }\n\n /**\n * Indication whether is component highlighted\n */\n protected get highlighted(): boolean\n {\n return this.layoutEditorMetadataManager.highlightedComponent === this.options?.typeMetadata.id;\n }\n\n /**\n * Metadata for rendered type\n */\n protected renderedType: LayoutComponentMetadata|undefined|null;\n\n //######################### protected properties - overrides #########################\n\n /**\n * @inheritdoc\n */\n protected override get element(): ElementRef<HTMLElement>\n {\n return this.designerElement;\n }\n\n /**\n * @inheritdoc\n */\n protected override get extensionsOptions(): any|undefined|null\n {\n return this.options?.typeMetadata.options;\n }\n\n //######################### protected properties - children #########################\n\n /**\n * Instance of designer div element\n */\n @ViewChild('layoutDesigner', {static: true})\n protected designerElement!: ElementRef<HTMLElement>;\n\n //######################### public properties - children #########################\n\n /**\n * Instance of designer dnd core directive\n */\n @ViewChild('dndCoreDesigner', {static: true})\n public dndCoreDesigner!: DndCoreDesignerDirective;\n\n //######################### public properties #########################\n\n /**\n * Indication whether drag is disabled for component\n */\n public get dragDisabled(): boolean\n {\n return !this.parent || !!this.editorMetadata?.metaInfo?.dragDisabled;\n }\n\n /**\n * Indication whether item can be dropped here\n */\n public canDrop: boolean = false;\n\n /**\n * Indication whether drop list is horizontally oriented\n */\n public horizontal: boolean = false;\n\n /**\n * Component identifier\n */\n public get id(): string\n {\n return this.options?.typeMetadata?.id ?? '';\n }\n\n /**\n * Index of current layout designer in its parent\n */\n public index: number = 0;\n\n /**\n * Layout editor metadata\n */\n public editorMetadata: LayoutEditorMetadataDescriptor|null = null;\n\n //######################### constructor #########################\n constructor(changeDetector: ChangeDetectorRef,\n element: ElementRef<HTMLElement>,\n injector: Injector,\n protected metadataExtractor: LayoutEditorMetadataExtractor,\n protected layoutEditorMetadataManager: LayoutEditorMetadataManager,\n protected iteratorSvc: LayoutComponentsIteratorService,\n @Inject(LAYOUT_HISTORY_MANAGER) protected history: MetadataHistoryManager<LayoutComponentMetadata>,\n @Optional() @Inject(SCOPE_ID) protected scopeId?: string,\n @Inject(LOGGER) @Optional() logger?: Logger,\n @SkipSelf() @Optional() protected parent?: LayoutDesignerSAComponent,)\n {\n super(changeDetector, element, injector, logger);\n }\n\n //######################### public methods - implementation of OnDestroy #########################\n \n /**\n * Called when component is destroyed\n */\n public override ngOnDestroy(): void\n {\n this.logger?.debug('LayoutDesignerSAComponent: Destroying component {@data}', {id: this.options?.typeMetadata.id});\n\n this.initSubscriptions.unsubscribe();\n\n super.ngOnDestroy();\n\n if(this.options)\n {\n this.layoutEditorMetadataManager.unregisterLayoutDesignerComponent(this.options.typeMetadata.id);\n }\n }\n\n //######################### public methods #########################\n\n /**\n * Adds descentant component metadata to this component metadata\n * @param dragData - Data from drag n drop event\n */\n public addDescendant(dragData: LayoutComponentDragData): void\n {\n if(!this.options)\n {\n return;\n }\n\n const parentId = dragData.parentId;\n this.logger?.debug('LayoutDesignerSAComponent: Adding descendant {@data}', {id: dragData.metadata?.id, parent: this.options.typeMetadata.id});\n\n if(!dragData.metadata)\n {\n this.logger?.warn('LayoutDesignerSAComponent: Missing metadata while adding descendant');\n\n return;\n }\n\n //already added to tree, removing old reference\n if(parentId)\n {\n this.history.disable();\n this.layoutEditorMetadataManager.getComponent(parentId)?.removeDescendant(dragData.metadata?.id);\n this.history.enable();\n }\n\n this.editorMetadata?.addDescendant?.(dragData?.metadata, this.options.typeMetadata.options, dragData.index ?? 0);\n this.canDrop = this.editorMetadata?.canDropMetadata?.(this.options.typeMetadata.options) ?? false;\n\n this.renderedType = {...this.options.typeMetadata};\n this.changeDetector.markForCheck();\n this.history.getNewState();\n }\n\n /**\n * Removes descendant metadata from this component metadata\n * @param id - Id of descendant to be removed\n */\n public removeDescendant(id: string): void\n {\n if(!this.options)\n {\n return;\n }\n\n this.logger?.debug('LayoutDesignerSAComponent: Removing descendant {@data}', {id: this.options.typeMetadata.id, child: id});\n\n this.editorMetadata?.removeDescendant?.(id, this.options.typeMetadata.options);\n this.canDrop = this.editorMetadata?.canDropMetadata?.(this.options.typeMetadata.options) ?? false;\n this.renderedType = {...this.options.typeMetadata};\n this.changeDetector.markForCheck();\n this.history.getNewState();\n }\n\n //######################### protected methods - template bindings #########################\n\n /**\n * Shows designer overlay\n * @param event - Mouse event that occured\n */\n protected showOverlay(event: Event): void\n {\n this.logger?.verbose('LayoutDesignerComponent: Showing overlay for {@type}', {name: this.options?.typeMetadata.name, id: this.options?.typeMetadata.id});\n\n event.preventDefault();\n event.stopPropagation();\n\n this.layoutEditorMetadataManager.highlightComponent(this.options?.typeMetadata.id);\n }\n\n /**\n * Hides designer overlay\n * @param event - Mouse event that occured\n */\n protected hideOverlay(event: Event): void\n {\n if(isPresent(this.parent))\n {\n return;\n }\n\n this.logger?.verbose('LayoutDesignerComponent: Hiding overlay for {@type}', {name: this.options?.typeMetadata.name, id: this.options?.typeMetadata.id});\n\n event.preventDefault();\n event.stopPropagation();\n\n this.layoutEditorMetadataManager.cancelHighlightedComponent();\n }\n\n /**\n * Marks component as selected\n * @param event - Event that occured\n */\n protected selectComponent(event: MouseEvent): void\n {\n event.preventDefault();\n event.stopPropagation();\n\n if(this.options)\n {\n this.layoutEditorMetadataManager.selectComponent(this.options.typeMetadata.id);\n }\n }\n\n /**\n * Unselects selected component\n * @param event - Event that occured\n */\n protected unselectComponent(event: MouseEvent): void\n {\n event.preventDefault();\n event.stopPropagation();\n\n this.layoutEditorMetadataManager.unselectComponent();\n }\n\n /**\n * Removes itself from tree\n */\n protected remove(): void\n {\n if(!this.parent || !this.options)\n {\n return;\n }\n\n this.parent.removeDescendant(this.options.typeMetadata.id);\n }\n\n //######################### protected methods - overrides #########################\n\n /**\n * @inheritdoc\n */\n protected override async onInit(): Promise<void>\n {\n await super.onInit();\n\n if(!this.options)\n {\n return;\n }\n\n this.options.typeMetadata.scope = this.scopeId;\n\n if(this.parent?.options)\n {\n for await(const child of this.iteratorSvc.getChildrenIteratorFor(this.parent.options?.typeMetadata))\n {\n if(this.options.typeMetadata.id === child.metadata.id)\n {\n this.index = child.index;\n\n break;\n }\n }\n }\n\n //TODO: optimize\n this.initSubscriptions.add(this.layoutEditorMetadataManager.selectedChange.subscribe(() => this.changeDetector.detectChanges()));\n this.initSubscriptions.add(this.layoutEditorMetadataManager.highlightedChange.subscribe(() => this.changeDetector.detectChanges()));\n\n this.editorMetadata = await this.metadataExtractor.extractMetadata(this.options.typeMetadata);\n this.canDrop = this.editorMetadata?.canDropMetadata?.(this.options.typeMetadata.options) ?? false;\n this.layoutEditorMetadataManager.registerLayoutDesignerComponent(this, this.options.typeMetadata.id, this.parent?.options?.typeMetadata.id);\n }\n\n /**\n * @inheritdoc\n */\n protected override onOptionsSet(): void\n {\n if(!this.options)\n {\n return;\n }\n\n this.renderedType = {...this.options.typeMetadata};\n this.horizontal = this.editorMetadata?.isHorizontalDrop?.(this.options.typeMetadata.options) ?? false;\n }\n}","<div class=\"designer-overlay\" \n #layoutDesigner\n #dndCore=\"dndCoreDesigner\"\n [dndCoreDesigner]=\"{metadata: renderedType, parentId: parent?.renderedType?.id, index: index}\"\n [dropzoneElement]=\"layoutDropzone\"\n [dragDisabled]=\"dragDisabled\"\n [dragSource]=\"dndCore.drag\"\n [noHTML5Preview]=\"true\"\n (dropMetadata)=\"addDescendant($event)\"\n [copyDesignerStyles]=\"renderedType\"\n (mouseleave)=\"hideOverlay($event)\"\n (mouseover)=\"showOverlay($event)\"\n (click)=\"selectComponent($event)\"\n (dblclick)=\"unselectComponent($event)\">\n <div class=\"designer-dropzone\"\n #layoutDropzone\n designerMinWidth\n [canDrop]=\"canDrop\"\n [editorMetadata]=\"editorMetadata\"\n [horizontal]=\"parent?.horizontal ?? false\"\n [dropTarget]=\"dndCore.dropzone\"\n [isDropZone]=\"canDrop\">\n <ng-template #renderer=\"layoutComponentRenderer\" [layoutComponentRenderer]=\"renderedType\" [layoutComponentRendererDisableTransformer]=\"true\"></ng-template>\n\n <ng-container *ngIf=\"highlighted || selected\">\n <div class=\"designer-overlay-border\"></div>\n <div class=\"designer-overlay-layout\" [layoutDesignerOverlayFor]=\"renderer\"></div>\n\n <div class=\"designer-overlay-title\"\n *bodyRender\n [positionTo]=\"layoutDesigner\"\n placement=\"TopStart\">{{editorMetadata?.metaInfo?.name ?? renderedType?.name}}</div>\n\n <ng-container *ngIf=\"!!parent && parent.editorMetadata?.removeDescendant\">\n <div *bodyRender\n class=\"designer-overlay-remove\"\n [positionTo]=\"layoutDesigner\"\n placement=\"TopEnd\"\n (click)=\"remove()\">\n <span class=\"fas fa-times\"></span>\n </div>\n </ng-container>\n </ng-container>\n </div>\n</div>\n"]}
|
|
1
|
+
{"version":3,"file":"layoutDesigner.component.js","sourceRoot":"","sources":["../../../../../layout-editor/src/components/layoutDesigner/layoutDesigner.component.ts","../../../../../layout-editor/src/components/layoutDesigner/layoutDesigner.component.html"],"names":[],"mappings":"AAAA,OAAO,EAAC,SAAS,EAAE,uBAAuB,EAAE,iBAAiB,EAAE,UAAU,EAAE,QAAQ,EAAE,QAAQ,EAAE,MAAM,EAAa,QAAQ,EAAE,SAAS,EAAC,MAAM,eAAe,CAAC;AAC5J,OAAO,EAAC,YAAY,EAAC,MAAM,iBAAiB,CAAC;AAC7C,OAAO,EAAS,MAAM,EAAE,cAAc,EAAC,MAAM,eAAe,CAAC;AAE7D,OAAO,EAAC,mBAAmB,EAAE,kCAAkC,EAAC,MAAM,uBAAuB,CAAC;AAC9F,OAAO,EAAC,sBAAsB,EAAE,QAAQ,EAAC,MAAM,gBAAgB,CAAC;AAChE,OA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ElementRef, SkipSelf, Optional, Inject, OnDestroy, Injector, ViewChild} from '@angular/core';\nimport {CommonModule} from '@angular/common';\nimport {Logger, LOGGER, PositionModule} from '@anglr/common';\nimport {LayoutComponent, LayoutComponentMetadata} from '@anglr/dynamic/layout';\nimport {LayoutComponentBase, LayoutComponentRendererSADirective} from '@anglr/dynamic/layout';\nimport {MetadataHistoryManager, SCOPE_ID} from '@anglr/dynamic';\nimport {isPresent} from '@jscrpt/common';\nimport {DndModule} from '@ng-dnd/core';\nimport {Subscription} from 'rxjs';\n\nimport {LayoutDesignerComponentOptions} from './layoutDesigner.options';\nimport {BodyRenderSADirective, CopyDesignerStylesSADirective, DesignerDropzoneSADirective, DesignerMinDimensionSADirective} from '../../directives';\nimport {LayoutComponentsIteratorService, LayoutEditorMetadataExtractor, LayoutEditorMetadataManager} from '../../services';\nimport {LayoutEditorDragPreviewSAComponent} from '../layoutEditorDragPreview/layoutEditorDragPreview.component';\nimport {LayoutDesignerOverlayForSAComponent} from '../layoutDesignerOverlayFor/layoutDesignerOverlayFor.component';\nimport {LayoutEditorMetadataDescriptor} from '../../decorators';\nimport {LAYOUT_HISTORY_MANAGER} from '../../misc/tokens';\nimport {DndCoreDesignerDirective, LayoutDndCoreModule} from '../../modules';\nimport {LayoutComponentDragData} from '../../interfaces';\n\n/**\n * Component used as designer component wrapper for layout component\n */\n@Component(\n{\n selector: 'layout-designer-component',\n templateUrl: 'layoutDesigner.component.html',\n standalone: true,\n imports:\n [\n //TODO: cleanup\n CommonModule,\n PositionModule,\n LayoutEditorDragPreviewSAComponent,\n LayoutDesignerOverlayForSAComponent,\n DesignerMinDimensionSADirective,\n CopyDesignerStylesSADirective,\n LayoutComponentRendererSADirective,\n DesignerDropzoneSADirective,\n BodyRenderSADirective,\n DndModule,\n LayoutDndCoreModule,\n ],\n changeDetection: ChangeDetectionStrategy.OnPush\n})\nexport class LayoutDesignerSAComponent extends LayoutComponentBase<LayoutDesignerComponentOptions> implements LayoutComponent<LayoutDesignerComponentOptions>, OnDestroy\n{\n //######################### protected properties #########################\n\n /**\n * Subscriptions created during initialization\n */\n protected initSubscriptions: Subscription = new Subscription();\n\n //######################### protected properties - template bindings #########################\n\n /**\n * Indication whether is component selected\n */\n protected get selected(): boolean\n {\n return this.layoutEditorMetadataManager.selectedComponent === this.options?.typeMetadata.id;\n }\n\n /**\n * Indication whether is component highlighted\n */\n protected get highlighted(): boolean\n {\n return this.layoutEditorMetadataManager.highlightedComponent === this.options?.typeMetadata.id;\n }\n\n /**\n * Metadata for rendered type\n */\n protected renderedType: LayoutComponentMetadata|undefined|null;\n\n //######################### protected properties - overrides #########################\n\n /**\n * @inheritdoc\n */\n protected override get element(): ElementRef<HTMLElement>\n {\n return this.designerElement;\n }\n\n /**\n * @inheritdoc\n */\n protected override get extensionsOptions(): any|undefined|null\n {\n return this.options?.typeMetadata.options;\n }\n\n //######################### protected properties - children #########################\n\n /**\n * Instance of designer div element\n */\n @ViewChild('layoutDesigner', {static: true})\n protected designerElement!: ElementRef<HTMLElement>;\n\n //######################### public properties - children #########################\n\n /**\n * Instance of designer dnd core directive\n */\n @ViewChild('dndCoreDesigner', {static: true})\n public dndCoreDesigner!: DndCoreDesignerDirective;\n\n //######################### public properties #########################\n\n /**\n * Indication whether drag is disabled for component\n */\n public get dragDisabled(): boolean\n {\n return !this.parent || !!this.editorMetadata?.metaInfo?.dragDisabled;\n }\n\n /**\n * Indication whether item can be dropped here\n */\n public canDrop: boolean = false;\n\n /**\n * Indication whether drop list is horizontally oriented\n */\n public horizontal: boolean = false;\n\n /**\n * Component identifier\n */\n public get id(): string\n {\n return this.options?.typeMetadata?.id ?? '';\n }\n\n /**\n * Index of current layout designer in its parent\n */\n public index: number = 0;\n\n /**\n * Layout editor metadata\n */\n public editorMetadata: LayoutEditorMetadataDescriptor|null = null;\n\n //######################### constructor #########################\n constructor(changeDetector: ChangeDetectorRef,\n element: ElementRef<HTMLElement>,\n injector: Injector,\n protected metadataExtractor: LayoutEditorMetadataExtractor,\n protected layoutEditorMetadataManager: LayoutEditorMetadataManager,\n protected iteratorSvc: LayoutComponentsIteratorService,\n @Inject(LAYOUT_HISTORY_MANAGER) protected history: MetadataHistoryManager<LayoutComponentMetadata>,\n @Optional() @Inject(SCOPE_ID) protected scopeId?: string,\n @Inject(LOGGER) @Optional() logger?: Logger,\n @SkipSelf() @Optional() protected parent?: LayoutDesignerSAComponent,)\n {\n super(changeDetector, element, injector, logger);\n }\n\n //######################### public methods - implementation of OnDestroy #########################\n \n /**\n * Called when component is destroyed\n */\n public override ngOnDestroy(): void\n {\n this.logger?.debug('LayoutDesignerSAComponent: Destroying component {@data}', {id: this.options?.typeMetadata.id});\n\n this.initSubscriptions.unsubscribe();\n\n super.ngOnDestroy();\n\n if(this.options)\n {\n this.layoutEditorMetadataManager.unregisterLayoutDesignerComponent(this.options.typeMetadata.id);\n }\n }\n\n //######################### public methods #########################\n\n /**\n * Adds descentant component metadata to this component metadata\n * @param dragData - Data from drag n drop event\n */\n public addDescendant(dragData: LayoutComponentDragData): void\n {\n if(!this.options)\n {\n return;\n }\n\n const parentId = dragData.parentId;\n this.logger?.debug('LayoutDesignerSAComponent: Adding descendant {@data}', {id: dragData.metadata?.id, parent: this.options.typeMetadata.id});\n\n if(!dragData.metadata)\n {\n this.logger?.warn('LayoutDesignerSAComponent: Missing metadata while adding descendant');\n\n return;\n }\n\n //already added to tree, removing old reference\n if(parentId)\n {\n this.history.disable();\n this.layoutEditorMetadataManager.getComponent(parentId)?.removeDescendant(dragData.metadata?.id);\n this.history.enable();\n }\n\n this.editorMetadata?.addDescendant?.(dragData?.metadata, this.options.typeMetadata.options, dragData.index ?? 0);\n this.canDrop = this.editorMetadata?.canDropMetadata?.(this.options.typeMetadata.options) ?? false;\n\n this.renderedType = {...this.options.typeMetadata};\n this.changeDetector.markForCheck();\n this.history.getNewState();\n }\n\n /**\n * Removes descendant metadata from this component metadata\n * @param id - Id of descendant to be removed\n */\n public removeDescendant(id: string): void\n {\n if(!this.options)\n {\n return;\n }\n\n this.logger?.debug('LayoutDesignerSAComponent: Removing descendant {@data}', {id: this.options.typeMetadata.id, child: id});\n\n this.editorMetadata?.removeDescendant?.(id, this.options.typeMetadata.options);\n this.canDrop = this.editorMetadata?.canDropMetadata?.(this.options.typeMetadata.options) ?? false;\n this.renderedType = {...this.options.typeMetadata};\n this.changeDetector.markForCheck();\n this.history.getNewState();\n }\n\n //######################### protected methods - template bindings #########################\n\n /**\n * Shows designer overlay\n * @param event - Mouse event that occured\n */\n protected showOverlay(event: Event): void\n {\n this.logger?.verbose('LayoutDesignerComponent: Showing overlay for {@type}', {name: this.options?.typeMetadata.name, id: this.options?.typeMetadata.id});\n\n event.preventDefault();\n event.stopPropagation();\n\n this.layoutEditorMetadataManager.highlightComponent(this.options?.typeMetadata.id);\n }\n\n /**\n * Hides designer overlay\n * @param event - Mouse event that occured\n */\n protected hideOverlay(event: Event): void\n {\n if(isPresent(this.parent))\n {\n return;\n }\n\n this.logger?.verbose('LayoutDesignerComponent: Hiding overlay for {@type}', {name: this.options?.typeMetadata.name, id: this.options?.typeMetadata.id});\n\n event.preventDefault();\n event.stopPropagation();\n\n this.layoutEditorMetadataManager.cancelHighlightedComponent();\n }\n\n /**\n * Marks component as selected\n * @param event - Event that occured\n */\n protected selectComponent(event: MouseEvent): void\n {\n event.preventDefault();\n event.stopPropagation();\n\n if(this.options)\n {\n this.layoutEditorMetadataManager.selectComponent(this.options.typeMetadata.id);\n }\n }\n\n /**\n * Unselects selected component\n * @param event - Event that occured\n */\n protected unselectComponent(event: MouseEvent): void\n {\n event.preventDefault();\n event.stopPropagation();\n\n this.layoutEditorMetadataManager.unselectComponent();\n }\n\n /**\n * Removes itself from tree\n */\n protected remove(): void\n {\n if(!this.parent || !this.options)\n {\n return;\n }\n\n this.parent.removeDescendant(this.options.typeMetadata.id);\n }\n\n //######################### protected methods - overrides #########################\n\n /**\n * @inheritdoc\n */\n protected override async onInit(): Promise<void>\n {\n await super.onInit();\n\n if(!this.options)\n {\n return;\n }\n\n this.options.typeMetadata.scope = this.scopeId;\n\n if(this.parent?.options)\n {\n for await(const child of this.iteratorSvc.getChildrenIteratorFor(this.parent.options?.typeMetadata))\n {\n if(this.options.typeMetadata.id === child.metadata.id)\n {\n this.index = child.index;\n\n break;\n }\n }\n }\n\n //TODO: optimize\n this.initSubscriptions.add(this.layoutEditorMetadataManager.selectedChange.subscribe(() => this.changeDetector.detectChanges()));\n this.initSubscriptions.add(this.layoutEditorMetadataManager.highlightedChange.subscribe(() => this.changeDetector.detectChanges()));\n\n this.editorMetadata = await this.metadataExtractor.extractMetadata(this.options.typeMetadata);\n this.canDrop = this.editorMetadata?.canDropMetadata?.(this.options.typeMetadata.options) ?? false;\n this.layoutEditorMetadataManager.registerLayoutDesignerComponent(this, this.options.typeMetadata.id, this.parent?.options?.typeMetadata.id);\n }\n\n /**\n * @inheritdoc\n */\n protected override onOptionsSet(): void\n {\n if(!this.options)\n {\n return;\n }\n\n this.renderedType = {...this.options.typeMetadata};\n this.horizontal = this.editorMetadata?.isHorizontalDrop?.(this.options.typeMetadata.options) ?? false;\n }\n}","<div class=\"designer-overlay\" \n #layoutDesigner\n #dndCore=\"dndCoreDesigner\"\n [dndCoreDesigner]=\"{metadata: renderedType, parentId: parent?.renderedType?.id, index: index}\"\n [dropzoneElement]=\"layoutDropzone\"\n [dragDisabled]=\"dragDisabled\"\n [dragSource]=\"dndCore.drag\"\n [noHTML5Preview]=\"true\"\n (dropMetadata)=\"addDescendant($event)\"\n [copyDesignerStyles]=\"renderedType\"\n (mouseleave)=\"hideOverlay($event)\"\n (mouseover)=\"showOverlay($event)\"\n (click)=\"selectComponent($event)\"\n (dblclick)=\"unselectComponent($event)\">\n <div class=\"designer-dropzone\"\n #layoutDropzone\n designerMinWidth\n [canDrop]=\"canDrop\"\n [editorMetadata]=\"editorMetadata\"\n [horizontal]=\"parent?.horizontal ?? false\"\n [dropTarget]=\"dndCore.dropzone\"\n [isDropZone]=\"canDrop\">\n <ng-template #renderer=\"layoutComponentRenderer\" [layoutComponentRenderer]=\"renderedType\" [layoutComponentRendererDisableTransformer]=\"true\"></ng-template>\n\n <ng-container *ngIf=\"highlighted || selected\">\n <div class=\"designer-overlay-border\"></div>\n <div class=\"designer-overlay-layout\" [layoutDesignerOverlayFor]=\"renderer\"></div>\n\n <div class=\"designer-overlay-title\"\n *bodyRender\n [positionTo]=\"layoutDesigner\"\n placement=\"TopStart\">{{editorMetadata?.metaInfo?.name ?? renderedType?.name}}</div>\n\n <ng-container *ngIf=\"!!parent && parent.editorMetadata?.removeDescendant\">\n <div *bodyRender\n class=\"designer-overlay-remove\"\n [positionTo]=\"layoutDesigner\"\n [offset]=\"{mainAxis: -18, alignmentAxis: -6}\"\n placement=\"TopEnd\"\n (click)=\"remove()\">\n <span class=\"fas fa-times\"></span>\n </div>\n </ng-container>\n </ng-container>\n </div>\n</div>\n"]}
|
|
@@ -111,19 +111,19 @@ export class EditorHotkeys {
|
|
|
111
111
|
this.hotkeys.hotkeys.add(new Hotkey('del', () => {
|
|
112
112
|
this.deleteSubject.next();
|
|
113
113
|
return false;
|
|
114
|
-
}, [
|
|
114
|
+
}, [], 'Emits delete event'));
|
|
115
115
|
this.hotkeys.hotkeys.add(new Hotkey('ctrl+c', () => {
|
|
116
116
|
this.copySubject.next();
|
|
117
117
|
return false;
|
|
118
|
-
}, [
|
|
118
|
+
}, [], 'Emits copy event'));
|
|
119
119
|
this.hotkeys.hotkeys.add(new Hotkey('ctrl+v', () => {
|
|
120
120
|
this.pasteSubject.next();
|
|
121
121
|
return false;
|
|
122
|
-
}, [
|
|
122
|
+
}, [], 'Emits paste event'));
|
|
123
123
|
this.hotkeys.hotkeys.add(new Hotkey('ctrl+x', () => {
|
|
124
124
|
this.cutSubject.next();
|
|
125
125
|
return false;
|
|
126
|
-
}, [
|
|
126
|
+
}, [], 'Emits cut event'));
|
|
127
127
|
}
|
|
128
128
|
}
|
|
129
129
|
EditorHotkeys.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.1.0", ngImport: i0, type: EditorHotkeys, deps: [{ token: i1.AppHotkeysService }], target: i0.ɵɵFactoryTarget.Injectable });
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"editorHotkeys.service.js","sourceRoot":"","sources":["../../../../src/services/editorHotkeys/editorHotkeys.service.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,UAAU,EAAC,MAAM,eAAe,CAAC;AACzC,OAAO,EAAC,iBAAiB,EAAC,MAAM,uBAAuB,CAAC;AACxD,OAAO,EAAC,MAAM,EAAC,MAAM,kBAAkB,CAAC;AACxC,OAAO,EAAa,OAAO,EAAC,MAAM,MAAM,CAAC;;;AAEzC;;GAEG;AAEH,MAAM,OAAO,aAAa;IAiGtB,iEAAiE;IACjE,YAAsB,OAA0B;QAA1B,YAAO,GAAP,OAAO,CAAmB;QAhGhD,0EAA0E;QAE1E;;WAEG;QACO,gBAAW,GAAkB,IAAI,OAAO,EAAQ,CAAC;QAE3D;;WAEG;QACO,gBAAW,GAAkB,IAAI,OAAO,EAAQ,CAAC;QAE3D;;WAEG;QACO,gBAAW,GAAkB,IAAI,OAAO,EAAQ,CAAC;QAE3D;;WAEG;QACO,gBAAW,GAAkB,IAAI,OAAO,EAAQ,CAAC;QAE3D;;WAEG;QACO,iBAAY,GAAkB,IAAI,OAAO,EAAQ,CAAC;QAE5D;;WAEG;QACO,eAAU,GAAkB,IAAI,OAAO,EAAQ,CAAC;QAE1D;;WAEG;QACO,kBAAa,GAAkB,IAAI,OAAO,EAAQ,CAAC;IA+D7D,CAAC;IA7DD,uEAAuE;IAEvE;;OAEG;IACH,IAAW,IAAI;QAEX,OAAO,IAAI,CAAC,WAAW,CAAC,YAAY,EAAE,CAAC;IAC3C,CAAC;IAED;;OAEG;IACH,IAAW,IAAI;QAEX,OAAO,IAAI,CAAC,WAAW,CAAC,YAAY,EAAE,CAAC;IAC3C,CAAC;IAED;;OAEG;IACH,IAAW,IAAI;QAEX,OAAO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aAAa;2FAAb,aAAa;kBADzB,UAAU","sourcesContent":["import {Injectable} from '@angular/core';\nimport {AppHotkeysService} from '@anglr/common/hotkeys';\nimport {Hotkey} from 'angular2-hotkeys';\nimport {Observable, Subject} from 'rxjs';\n\n/**\n * Class that handles hotkeys for editors\n */\n@Injectable()\nexport class EditorHotkeys\n{\n //######################### protected properties #########################\n\n /**\n * Subject used for emitting undo\n */\n protected undoSubject: Subject<void> = new Subject<void>();\n\n /**\n * Subject used for emitting redo\n */\n protected redoSubject: Subject<void> = new Subject<void>();\n\n /**\n * Subject used for emitting save\n */\n protected saveSubject: Subject<void> = new Subject<void>();\n\n /**\n * Subject used for emitting copy\n */\n protected copySubject: Subject<void> = new Subject<void>();\n\n /**\n * Subject used for emitting paste\n */\n protected pasteSubject: Subject<void> = new Subject<void>();\n\n /**\n * Subject used for emitting cut\n */\n protected cutSubject: Subject<void> = new Subject<void>();\n\n /**\n * Subject used for emitting delete\n */\n protected deleteSubject: Subject<void> = new Subject<void>();\n\n //######################### public properties #########################\n\n /**\n * Occurs on undo shortcut\n */\n public get undo(): Observable<void>\n {\n return this.undoSubject.asObservable();\n }\n\n /**\n * Occurs on redo shortcut\n */\n public get redo(): Observable<void>\n {\n return this.redoSubject.asObservable();\n }\n\n /**\n * Occurs on save shortcut\n */\n public get save(): Observable<void>\n {\n return this.saveSubject.asObservable();\n }\n \n /**\n * Occurs on copy shortcut\n */\n public get copy(): Observable<void>\n {\n return this.copySubject.asObservable();\n }\n\n /**\n * Occurs on cut shortcut\n */\n public get cut(): Observable<void>\n {\n return this.cutSubject.asObservable();\n }\n\n /**\n * Occurs on paste shortcut\n */\n public get paste(): Observable<void>\n {\n return this.pasteSubject.asObservable();\n }\n\n /**\n * Occurs on delete shortcut\n */\n public get delete(): Observable<void>\n {\n return this.deleteSubject.asObservable();\n }\n\n //######################### constructor #########################\n constructor(protected hotkeys: AppHotkeysService,)\n {\n }\n\n //######################### public methods - implementation of OnDestroy #########################\n \n /**\n * Called when component is destroyed\n */\n public destroy(): void\n {\n this.hotkeys.destroy();\n }\n\n //######################### public methods #########################\n\n /**\n * Initialize hotkeys\n */\n public init(): void\n {\n this.hotkeys.hotkeys.add(new Hotkey('ctrl+s', () =>\n {\n this.saveSubject.next();\n\n return false;\n }, ['INPUT', 'TEXTAREA'], 'Emits save event'));\n\n this.hotkeys.hotkeys.add(new Hotkey('ctrl+z', () =>\n {\n this.undoSubject.next();\n\n return false;\n }, ['INPUT', 'TEXTAREA'], 'Emits undo event'));\n\n this.hotkeys.hotkeys.add(new Hotkey('ctrl+y', () =>\n {\n this.redoSubject.next();\n\n return false;\n }, ['INPUT', 'TEXTAREA'], 'Emits redo event'));\n\n this.hotkeys.hotkeys.add(new Hotkey('del', () =>\n {\n this.deleteSubject.next();\n\n return false;\n }, [], 'Emits delete event'));\n\n this.hotkeys.hotkeys.add(new Hotkey('ctrl+c', () =>\n {\n this.copySubject.next();\n\n return false;\n }, [], 'Emits copy event'));\n\n this.hotkeys.hotkeys.add(new Hotkey('ctrl+v', () =>\n {\n this.pasteSubject.next();\n\n return false;\n }, [], 'Emits paste event'));\n\n this.hotkeys.hotkeys.add(new Hotkey('ctrl+x', () =>\n {\n this.cutSubject.next();\n\n return false;\n }, [], 'Emits cut event'));\n }\n}"]}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@anglr/dynamic",
|
|
3
|
-
"version": "1.0.0-beta.
|
|
3
|
+
"version": "1.0.0-beta.20221105113020",
|
|
4
4
|
"description": "Contains code for generating dynamic content from metadata",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"sideEffects": false,
|
|
@@ -79,10 +79,10 @@
|
|
|
79
79
|
"@angular/forms": ">=14.1.0",
|
|
80
80
|
"@angular/cdk": ">=14.1.0",
|
|
81
81
|
"@angular/material": ">=14.1.0",
|
|
82
|
-
"@anglr/common": ">=
|
|
83
|
-
"@anglr/rest": ">=12.1.
|
|
82
|
+
"@anglr/common": ">=15.0.1",
|
|
83
|
+
"@anglr/rest": ">=12.1.4",
|
|
84
84
|
"rxjs": ">=7.5.6",
|
|
85
|
-
"@jscrpt/common": ">=3.
|
|
85
|
+
"@jscrpt/common": ">=3.2.0",
|
|
86
86
|
"angular2-hotkeys": "^13.1.0",
|
|
87
87
|
"@ng-dnd/core": "^2.0.2",
|
|
88
88
|
"react-dnd-html5-backend": "^16.0.1",
|
|
@@ -107,16 +107,16 @@
|
|
|
107
107
|
"@angular/material": "14.1.0",
|
|
108
108
|
"@anglr/animations": "9.1.0",
|
|
109
109
|
"@anglr/authentication": "11.0.0",
|
|
110
|
-
"@anglr/common": "
|
|
111
|
-
"@anglr/datetime": "
|
|
112
|
-
"@anglr/error-handling": "
|
|
110
|
+
"@anglr/common": "15.0.1",
|
|
111
|
+
"@anglr/datetime": "5.0.0",
|
|
112
|
+
"@anglr/error-handling": "12.0.0",
|
|
113
113
|
"@anglr/grid": "9.0.1",
|
|
114
114
|
"@anglr/md-help": "8.0.0",
|
|
115
115
|
"@anglr/notifications": "9.0.0",
|
|
116
116
|
"@anglr/rest": "12.1.1",
|
|
117
117
|
"@anglr/select": "11.0.2",
|
|
118
118
|
"@anglr/translate-extensions": "9.0.0",
|
|
119
|
-
"@jscrpt/common": "3.
|
|
119
|
+
"@jscrpt/common": "3.3.0",
|
|
120
120
|
"@ngx-translate/core": "14.0.0",
|
|
121
121
|
"angular2-hotkeys": "13.1.0",
|
|
122
122
|
"@ng-dnd/core": "2.0.2",
|
|
@@ -145,7 +145,7 @@
|
|
|
145
145
|
"highlight.js": "10.6.0",
|
|
146
146
|
"sourcemapped-stacktrace": "1.1.11",
|
|
147
147
|
"positions": "1.6.2",
|
|
148
|
-
"@floating-ui/dom": "0.
|
|
148
|
+
"@floating-ui/dom": "1.0.3",
|
|
149
149
|
"@popperjs/core": "2.10.2",
|
|
150
150
|
"store": "2.0.12",
|
|
151
151
|
"structured-log": "0.2.0",
|
package/version.bak
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
1.0.0-beta.
|
|
1
|
+
1.0.0-beta.20221105113020
|