+ `,
+ setup() {
+ return { args, store, Place };
+ }
+ };
+ },
+ args: {
+ orientation: "row",
+ gap: "10px",
+ backgroundColor: "black",
+ thumbnailColor: "black",
+ highlightColor: "dodgerblue",
+ textColor: "white",
+ startExpanded: true,
+ lazy: true,
+ filter: (item: Thumbnail) => item instanceof Place || item instanceof Folder || item instanceof FolderUp,
+ rootUrl: "https://cdn.worldwidetelescope.org/wwtweb/catalog.aspx?W=explorerootweb",
+ }
+};
diff --git a/src/types.ts b/src/types.ts
index cac41de..e765956 100644
--- a/src/types.ts
+++ b/src/types.ts
@@ -1,5 +1,7 @@
import { FontAwesomeIcon } from "@fortawesome/vue-fontawesome";
import { CircleMarkerOptions, TileLayerOptions } from "leaflet";
+import { Folder } from "@wwtelescope/engine";
+import { Thumbnail } from "@wwtelescope/engine-types";
import { engineStore } from "@wwtelescope/engine-pinia";
import { MapBoxFeatureCollection } from "./mapbox";
@@ -394,3 +396,37 @@ export interface ShareButtonProps {
/** The ARIA label for the button */
ariaLabel?: string;
}
+
+export interface FolderViewProps {
+ /** The root folder of the tree to display in the view. One of either this or `rootUrl` must be specified */
+ rootFolder?: Folder;
+ /** A URL for the root folder of the tree to display in the view. One of either this or `rootFolder` must be specified */
+ rootUrl?: string;
+ /** Specifies the orientation of the folder view */
+ orientation: "row" | "column";
+ /** The gap between folder view items. Any CSS flex gap size is valid. */
+ gap?: string;
+ /** The color of the folder view background. Should be a valid CSS color */
+ backgroundColor?: string;
+ /** The color of the thumbnail view background. Should be a valid CSS color */
+ thumbnailColor?: string;
+ /** The color marking the currently highlighted item. Should be a valid CSS color */
+ highlightColor?: string;
+ /** The color of item name text. Should be a valid CSS color */
+ textColor?: string;
+ /** Whether the folder view should start expanded or not. */
+ startExpanded?: boolean;
+ /** Whether to select the first non-folder item automatically on when the component is mounted. */
+ selectFirst?: boolean;
+ /** The URL of an image to use as a default thumbnail, for items that don't have one. */
+ defaultThumbnail?: string;
+ /**
+ * If true, subfolders are only loaded when they are first visited.
+ * If false, the entire folder tree is loaded right away.
+ * */
+ lazy?: boolean;
+ /** A predicate for filtering which folder items are displayed. Items to be displayed should return true. */
+ filter?: (item: Thumbnail) => boolean;
+}
+
+export type ItemSelectionType = "click" | "dblclick" | "keyup" | "folder";
diff --git a/yarn.lock b/yarn.lock
index d62959e..3f24bc1 100644
--- a/yarn.lock
+++ b/yarn.lock
@@ -555,6 +555,7 @@ __metadata:
"@vue/eslint-config-typescript": ^12.0.0
"@vueuse/core": ^13.1.0
"@wdns/vue-code-block": ^2.3.5
+ "@wwtelescope/engine": ^7.30.1
"@wwtelescope/engine-pinia": ^0.9.0
copy-webpack-plugin: ^12.0.2
css-loader: ^7.1.1
@@ -3001,7 +3002,7 @@ __metadata:
languageName: node
linkType: hard
-"@wwtelescope/engine@npm:^7.29.1":
+"@wwtelescope/engine@npm:^7.29.1, @wwtelescope/engine@npm:^7.30.1":
version: 7.30.1
resolution: "@wwtelescope/engine@npm:7.30.1"
dependencies: