diff options
Diffstat (limited to 'src/client/documents/Documents.ts')
-rw-r--r-- | src/client/documents/Documents.ts | 65 |
1 files changed, 3 insertions, 62 deletions
diff --git a/src/client/documents/Documents.ts b/src/client/documents/Documents.ts index 80774f4ad..903bd907a 100644 --- a/src/client/documents/Documents.ts +++ b/src/client/documents/Documents.ts @@ -500,27 +500,8 @@ export class DocumentOptions { userColor?: STRt = new StrInfo('color associated with a Dash user (seen in header fields of shared documents)'); cardSort?: STRt = new StrInfo('way cards are sorted in deck view'); - customSortNumber?: NUMt = new NumInfo('number of custom sorts the user has created'); - // customGroup1?: List<Doc> - // customGroup2?: List<Doc> - // customGroup3?: List<Doc> - visibleGroupNumbers?: List<number> - custom1Group?: NUMt = new NumInfo('Which group a card is in for the 1st custom grouping'); - custom2Group?: NUMt = new NumInfo('Which group a card is in for the 2nd custom grouping'); - custom3Group?: NUMt = new NumInfo('Which group a card is in for the 3rd custom grouping'); - chatGroup?: NUMt = new NumInfo("Which group a card is in for the chat's grouping"); - chatAmGroups?: NUMt = new NumInfo("Number of cards created by chat sort"); - - - - - - - // card_sort_time?: BOOLt = new BoolInfo('whether sorting cards in deck view by time'); - // card_sort_type?: BOOLt = new BoolInfo('whether sorting cards in deck view by type'); - // card_sort_color?: BOOLt = new BoolInfo('whether sorting cards in deck view by color'); - - + cardSort_customField?: STRt = new StrInfo('field key used for sorting cards'); + cardSort_visibleSortGroups?: List<number>; // which sorting values are being filtered (shown) } export const DocOptions = new DocumentOptions(); @@ -1239,8 +1220,6 @@ export namespace Docs { ); } - - export function LinearDocument(documents: Array<Doc>, options: DocumentOptions, id?: string) { return InstanceFromProto(Prototypes.get(DocumentType.COL), new List(documents), { ...options, _type_collection: CollectionViewType.Linear }, id); } @@ -1258,7 +1237,7 @@ export namespace Docs { } export function CardDeckDocument(documents: Array<Doc>, options: DocumentOptions, id?: string) { - return InstanceFromProto(Prototypes.get(DocumentType.COL), new List(documents), { ...options, _type_collection: CollectionViewType.Card}); + return InstanceFromProto(Prototypes.get(DocumentType.COL), new List(documents), { ...options, _type_collection: CollectionViewType.Card }); } export function SchemaDocument(schemaHeaders: SchemaHeaderField[], documents: Array<Doc>, options: DocumentOptions) { @@ -1911,44 +1890,6 @@ export namespace DocUtils { } } - export function spreadCards(docList: Doc[], x: number = 0, y: number = 0, spreadAngle: number = 30, radius: number = 100, create: boolean = true) { - console.log('spread cards'); - const totalCards = docList.length; - const halfSpreadAngle = spreadAngle * 0.5; - const angleStep = spreadAngle / (totalCards - 1); - - runInAction(() => { - docList.forEach((d, i) => { - DocUtils.iconify(d); - const angle = (-halfSpreadAngle + angleStep * i) * (Math.PI / 180); // Convert degrees to radians - d.x = x + Math.cos(angle) * radius; - d.y = y + Math.sin(angle) * radius; - d.rotation = angle; - d._timecodeToShow = undefined; - }); - }); - - if (create) { - const newCollection = Docs.Create.CardDeckDocument(docList, { - title: 'card-spread', - _freeform_noZoom: true, - x: x - radius, - y: y - radius, - _width: radius * 2, - _height: radius * 2, - dragWhenActive: true, - _layout_fitWidth: false - }); - // Adjust position based on the collection's dimensions if needed - newCollection.x = NumCast(newCollection.x) + NumCast(newCollection._width) / 2 - radius; - newCollection.y = NumCast(newCollection.y) + NumCast(newCollection._height) / 2 - radius; - newCollection._width = newCollection._height = radius * 2; - return newCollection; - } - } - - - export function makeIntoPortal(doc: Doc, layoutDoc: Doc, allLinks: Doc[]) { const portalLink = allLinks.find(d => d.link_anchor_1 === doc && d.link_relationship === 'portal to:portal from'); if (!portalLink) { |