-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathindex.ts
41 lines (36 loc) · 1.26 KB
/
index.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
import Component from '@glimmer/component';
import { tracked } from '@glimmer/tracking';
import type { ResolvedPNode } from '@lblod/ember-rdfa-editor/utils/_private/types';
import { dependencySatisfies, macroCondition } from '@embroider/macros';
import { importSync } from '@embroider/macros';
const ChevronDownIcon = macroCondition(
dependencySatisfies('@appuniversum/ember-appuniversum', '>=3.4.1'),
)
? // @ts-expect-error TS/glint doesn't seem to treat this as an import
importSync('@appuniversum/ember-appuniversum/components/icons/chevron-down')
.ChevronDownIcon
: 'chevron-down';
const ChevronUpIcon = macroCondition(
dependencySatisfies('@appuniversum/ember-appuniversum', '>=3.4.1'),
)
? // @ts-expect-error TS/glint doesn't seem to treat this as an import
importSync('@appuniversum/ember-appuniversum/components/icons/chevron-up')
.ChevronUpIcon
: 'chevron-up';
type Args = {
node: ResolvedPNode;
};
export default class DebugInfo extends Component<Args> {
ChevronDownIcon = ChevronDownIcon;
ChevronUpIcon = ChevronUpIcon;
@tracked collapsed = false;
get pos() {
return this.args.node.pos;
}
get nodeType() {
return this.args.node.value.type.name;
}
toggleSection = () => {
this.collapsed = !this.collapsed;
};
}