• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1/*
2 * Copyright (C) 2023 The Android Open Source Project
3 *
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
7 *
8 *      http://www.apache.org/licenses/LICENSE-2.0
9 *
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
15 */
16
17import {ChangeDetectionStrategy, Component, Input} from '@angular/core';
18import {PersistentStore} from 'common/persistent_store';
19import {UiData} from './ui_data';
20
21/**
22 * TODO: Upgrade the View Capture's Properties View after getting UX's opinion.
23 */
24@Component({
25  selector: 'viewer-view-capture',
26  changeDetection: ChangeDetectionStrategy.OnPush,
27  template: `
28    <div class="card-grid">
29      <rects-view
30        class="rects-view"
31        title="View Hierarchy Sketch"
32        [enableShowVirtualButton]="false"
33        [rects]="inputData?.rects ?? []"
34        [highlightedItems]="inputData?.highlightedItems ?? []"
35        [displayIds]="[0]"></rects-view>
36      <mat-divider [vertical]="true"></mat-divider>
37      <hierarchy-view
38        class="hierarchy-view"
39        [tree]="inputData?.tree ?? null"
40        [dependencies]="inputData?.dependencies ?? []"
41        [highlightedItems]="inputData?.highlightedItems ?? []"
42        [pinnedItems]="inputData?.pinnedItems ?? []"
43        [store]="store"
44        [userOptions]="inputData?.hierarchyUserOptions ?? {}"></hierarchy-view>
45      <mat-divider [vertical]="true"></mat-divider>
46      <properties-view
47        class="properties-view"
48        [userOptions]="inputData?.propertiesUserOptions ?? {}"
49        [propertiesTree]="inputData?.propertiesTree ?? {}"
50        [displayPropertyGroups]="inputData?.displayPropertyGroups"
51        [isProtoDump]="true">
52      </properties-view>
53    </div>
54  `,
55  styles: [
56    `
57      .rects-view,
58      .hierarchy-view,
59      .properties-view {
60        flex: 1;
61        padding: 16px;
62        display: flex;
63        flex-direction: column;
64        overflow: auto;
65      }
66    `,
67  ],
68})
69export class ViewerViewCaptureComponent {
70  @Input() inputData?: UiData;
71  @Input() store: PersistentStore = new PersistentStore();
72}
73