Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 4 additions & 16 deletions packages/base/cards-grid.gts
Original file line number Diff line number Diff line change
Expand Up @@ -161,22 +161,11 @@ class Isolated extends Component<typeof CardsGrid> {
icon: AllCardsIcon,
query: {
filter: {
every: [
{
not: {
eq: {
_cardType: 'Cards Grid',
},
},
not: {
eq: {
_cardType: 'Cards Grid',
},
{
not: {
eq: {
_cardType: 'Index',
},
},
},
],
},
},
},
filters: this.cardTypeFilters,
Expand Down Expand Up @@ -308,7 +297,6 @@ class Isolated extends Component<typeof CardsGrid> {
let excludedCardTypeIds = [
`${baseRealm.url}card-api/CardDef`,
`${baseRealm.url}cards-grid/CardsGrid`,
`${baseRealm.url}index/IndexCard`,
];

this.cardTypeFilters.splice(0, this.cardTypeFilters.length);
Expand Down
12 changes: 0 additions & 12 deletions packages/base/cards-grid.json

This file was deleted.

76 changes: 2 additions & 74 deletions packages/base/index.gts
Original file line number Diff line number Diff line change
@@ -1,74 +1,2 @@
import { CardsGrid } from './cards-grid';
import {
CardDef,
Component,
contains,
field,
linksTo,
realmInfo,
StringField,
} from './card-api';

export class IndexCard extends CardDef {
static displayName = 'Index';
static prefersWideFormat = true;

@field realmName = contains(StringField, {
computeVia: function (this: IndexCard) {
return this[realmInfo]?.name;
},
});
@field cardTitle = contains(StringField, {
computeVia: function (this: IndexCard) {
return this.realmName;
},
});
@field cardsGrid = linksTo(CardsGrid);
@field interactHome = linksTo(CardDef);
@field hostHome = linksTo(CardDef);

static isolated = class Isolated extends Component<typeof IndexCard> {
private get prefersInteractHome() {
let submode = this.args.context?.submode;
return !!(
(submode === 'interact' || submode === 'code') &&
this.args.model.interactHome
);
}

private get prefersHostHome() {
let mode = this.args.context?.mode;
let submode = this.args.context?.submode;
return !!(
(mode === 'host' || submode === 'host') &&
this.args.model.hostHome
);
}

<template>
<div class='home'>
{{#if this.prefersInteractHome}}
<@fields.interactHome @format='isolated' />
{{else if this.prefersHostHome}}
<@fields.hostHome @format='isolated' />
{{else if @model.cardsGrid}}
<@fields.cardsGrid @format='isolated' />
{{else}}
<div data-test-empty-field class='empty-field'></div>
{{/if}}
</div>
<style scoped>
.home {
height: 100%;
width: 100%;
}
.home > :deep(.field-component-card.isolated-format) {
overflow: auto;
}
.home > :deep(.boxel-card-container) {
border-radius: 0;
}
</style>
</template>
};
}
// Backward compatibility: IndexCard is now CardsGrid
export { CardsGrid as IndexCard } from './cards-grid';
26 changes: 3 additions & 23 deletions packages/base/index.json
Original file line number Diff line number Diff line change
@@ -1,30 +1,10 @@
{
"data": {
"type": "card",
"meta": {
"adoptsFrom": {
"name": "IndexCard",
"module": "./index"
}
},
"type": "card",
"attributes": {
"cardInfo": {
"notes": null,
"name": null,
"summary": null,
"cardThumbnailURL": null
}
},
"relationships": {
"cardsGrid": {
"links": {
"self": "./cards-grid"
}
},
"cardInfo.theme": {
"links": {
"self": null
}
"module": "./cards-grid",
"name": "CardsGrid"
}
}
}
Expand Down
12 changes: 0 additions & 12 deletions packages/experiments-realm/cards-grid.json

This file was deleted.

26 changes: 3 additions & 23 deletions packages/experiments-realm/index.json
Original file line number Diff line number Diff line change
@@ -1,30 +1,10 @@
{
"data": {
"type": "card",
"meta": {
"adoptsFrom": {
"name": "IndexCard",
"module": "https://cardstack.com/base/index"
}
},
"type": "card",
"attributes": {
"cardInfo": {
"notes": null,
"name": null,
"summary": null,
"cardThumbnailURL": null
}
},
"relationships": {
"cardsGrid": {
"links": {
"self": "./cards-grid"
}
},
"cardInfo.theme": {
"links": {
"self": null
}
"module": "https://cardstack.com/base/cards-grid",
"name": "CardsGrid"
}
}
}
Expand Down
Loading