From 736ef560dca8495ab0c9c55913b93b7559b73176 Mon Sep 17 00:00:00 2001 From: Michael Gartner Date: Mon, 13 Jan 2025 11:19:45 -0600 Subject: [PATCH 1/4] move canvas utils --- apps/roam/src/components/canvas/Tldraw.tsx | 4 ++-- .../canvas/uiOverrides.ts => utils/canvasUiOverrides.ts} | 8 ++++---- .../roam/src/{components/canvas => utils}/useRoamStore.ts | 0 3 files changed, 6 insertions(+), 6 deletions(-) rename apps/roam/src/{components/canvas/uiOverrides.ts => utils/canvasUiOverrides.ts} (97%) rename apps/roam/src/{components/canvas => utils}/useRoamStore.ts (100%) diff --git a/apps/roam/src/components/canvas/Tldraw.tsx b/apps/roam/src/components/canvas/Tldraw.tsx index 75d5706ce..beb717443 100644 --- a/apps/roam/src/components/canvas/Tldraw.tsx +++ b/apps/roam/src/components/canvas/Tldraw.tsx @@ -47,8 +47,8 @@ import ExtensionApiContextProvider, { } from "roamjs-components/components/ExtensionApiContext"; import calcCanvasNodeSizeAndImg from "~/utils/calcCanvasNodeSizeAndImg"; import getPageTitleByPageUid from "roamjs-components/queries/getPageTitleByPageUid"; -import { useRoamStore } from "./useRoamStore"; -import { createUiOverrides } from "./uiOverrides"; +import { useRoamStore } from "~/utils/useRoamStore"; +import { createUiOverrides } from "~/utils/canvasUiOverrides"; import { DiscourseNodeShape, DiscourseNodeUtil } from "./DiscourseNodeUtil"; import { AddReferencedNodeType, diff --git a/apps/roam/src/components/canvas/uiOverrides.ts b/apps/roam/src/utils/canvasUiOverrides.ts similarity index 97% rename from apps/roam/src/components/canvas/uiOverrides.ts rename to apps/roam/src/utils/canvasUiOverrides.ts index 5597b7d91..5be1c6d23 100644 --- a/apps/roam/src/components/canvas/uiOverrides.ts +++ b/apps/roam/src/utils/canvasUiOverrides.ts @@ -13,15 +13,15 @@ import { SubMenu, } from "@tldraw/tldraw"; import { DiscourseNode } from "~/utils/getDiscourseNodes"; -import { COLOR_ARRAY, discourseContext } from "./Tldraw"; -import { formatHexColor } from "../settings/DiscourseNodeCanvasSettings"; -import { openCanvasDrawer } from "./CanvasDrawer"; +import { COLOR_ARRAY, discourseContext } from "~/components/canvas/Tldraw"; +import { formatHexColor } from "~/components/settings/DiscourseNodeCanvasSettings"; +import { openCanvasDrawer } from "~/components/canvas/CanvasDrawer"; import { OnloadArgs } from "roamjs-components/types"; import { getNewDiscourseNodeText } from "~/utils/formatUtils"; import createDiscourseNode from "~/utils/createDiscourseNode"; import calcCanvasNodeSizeAndImg from "~/utils/calcCanvasNodeSizeAndImg"; import renderToast from "roamjs-components/components/Toast"; -import { AddReferencedNodeType } from "./DiscourseRelationsUtil"; +import { AddReferencedNodeType } from "~/components/canvas/DiscourseRelationsUtil"; type TldrawAppRef = React.MutableRefObject; type CreateUiOverridesProps = { diff --git a/apps/roam/src/components/canvas/useRoamStore.ts b/apps/roam/src/utils/useRoamStore.ts similarity index 100% rename from apps/roam/src/components/canvas/useRoamStore.ts rename to apps/roam/src/utils/useRoamStore.ts From 8cacd4dde509a0cc037ffe1cab2039a4855beef7 Mon Sep 17 00:00:00 2001 From: Michael Gartner Date: Mon, 13 Jan 2025 11:50:38 -0600 Subject: [PATCH 2/4] move settings --- .../roam/src/components/settings/Settings.tsx | 2 +- apps/roam/src/index.ts | 22 +-- apps/roam/src/utils/configPageTabs.ts | 155 ++++++++++++++++++ .../createSettingsPanel.ts} | 0 apps/roam/src/utils/discourseConfigRef.ts | 2 +- apps/roam/src/utils/getExportSettings.ts | 2 +- .../utils/initializeObserversAndListeners.ts | 4 +- .../src/utils/isDiscourseNodeConfigPage.ts | 2 +- apps/roam/src/utils/refreshConfigTree.ts | 2 +- .../registerCommandPaletteCommands.ts} | 4 +- .../renderNodeConfigPage.ts} | 145 +--------------- 11 files changed, 173 insertions(+), 167 deletions(-) create mode 100644 apps/roam/src/utils/configPageTabs.ts rename apps/roam/src/{settings/settingsPanel.ts => utils/createSettingsPanel.ts} (100%) rename apps/roam/src/{settings/commandPalette.ts => utils/registerCommandPaletteCommands.ts} (97%) rename apps/roam/src/{settings/configPages.ts => utils/renderNodeConfigPage.ts} (53%) diff --git a/apps/roam/src/components/settings/Settings.tsx b/apps/roam/src/components/settings/Settings.tsx index 9e088f918..d737befe2 100644 --- a/apps/roam/src/components/settings/Settings.tsx +++ b/apps/roam/src/components/settings/Settings.tsx @@ -6,7 +6,7 @@ import DiscourseRelationConfigPanel from "./DiscourseRelationConfigPanel"; import DEFAULT_RELATION_VALUES from "~/data/defaultDiscourseRelations"; import { getFormattedConfigTree } from "~/utils/discourseConfigRef"; import DiscourseGraphHome from "./GeneralSettings"; -import { DISCOURSE_CONFIG_PAGE_TITLE } from "~/settings/configPages"; +import { DISCOURSE_CONFIG_PAGE_TITLE } from "~/utils/renderNodeConfigPage"; import DiscourseGraphExport from "./ExportSettings"; import QuerySettings from "./QuerySettings"; import DiscourseNodeConfigPanel from "./DiscourseNodeConfigPanel"; diff --git a/apps/roam/src/index.ts b/apps/roam/src/index.ts index b331da486..e7f2f697c 100644 --- a/apps/roam/src/index.ts +++ b/apps/roam/src/index.ts @@ -1,31 +1,25 @@ import { addStyle } from "roamjs-components/dom"; import { render as renderToast } from "roamjs-components/components/Toast"; - +import getCurrentUserUid from "roamjs-components/queries/getCurrentUserUid"; import { runExtension } from "roamjs-components/util"; - import { queryBuilderLoadedToast } from "./data/toastMessages"; - import runQuery from "./utils/runQuery"; import isDiscourseNode from "./utils/isDiscourseNode"; import { fireQuerySync } from "./utils/fireQuery"; import parseQuery from "./utils/parseQuery"; import refreshConfigTree from "./utils/refreshConfigTree"; - -import styles from "./styles/styles.css"; -import settingsStyles from "./styles/settingsStyles.css"; -import discourseGraphStyles from "./styles/discourseGraphStyles.css"; - -import { registerCommandPaletteCommands } from "./settings/commandPalette"; -import { createSettingsPanel } from "./settings/settingsPanel"; - +import { registerCommandPaletteCommands } from "./utils/registerCommandPaletteCommands"; +import { createSettingsPanel } from "~/utils/createSettingsPanel"; import { listActiveQueries } from "./utils/listActiveQueries"; import { registerSmartBlock } from "./utils/registerSmartBlock"; import { initObservers } from "./utils/initializeObserversAndListeners"; import { addGraphViewNodeStyling } from "./utils/graphViewNodeStyling"; import { setQueryPages } from "./utils/setQueryPages"; import initializeDiscourseNodes from "./utils/initializeDiscourseNodes"; +import styles from "./styles/styles.css"; +import settingsStyles from "./styles/settingsStyles.css"; +import discourseGraphStyles from "./styles/discourseGraphStyles.css"; import posthog from "posthog-js"; -import getCurrentUserUid from "roamjs-components/queries/getCurrentUserUid"; const initPostHog = () => { posthog.init("phc_SNMmBqwNfcEpNduQ41dBUjtGNEUEKAy6jTn63Fzsrax", { @@ -87,7 +81,7 @@ export default runExtension(async (onloadArgs) => { setQueryPages(onloadArgs); const style = addStyle(styles); - const dgraphStyles = addStyle(discourseGraphStyles); + const discourseGraphStyle = addStyle(discourseGraphStyles); const settingsStyle = addStyle(settingsStyles); const { observers, listeners } = await initObservers({ onloadArgs }); @@ -112,7 +106,7 @@ export default runExtension(async (onloadArgs) => { }; return { - elements: [style, settingsStyle, dgraphStyles], + elements: [style, settingsStyle, discourseGraphStyle], observers: observers, unload: () => { window.roamjs.extension?.smartblocks?.unregisterCommand("QUERYBUILDER"); diff --git a/apps/roam/src/utils/configPageTabs.ts b/apps/roam/src/utils/configPageTabs.ts new file mode 100644 index 000000000..e2b3239b1 --- /dev/null +++ b/apps/roam/src/utils/configPageTabs.ts @@ -0,0 +1,155 @@ +import { OnloadArgs } from "roamjs-components/types"; +import MultiTextPanel from "roamjs-components/components/ConfigPanels/MultiTextPanel"; +import NumberPanel from "roamjs-components/components/ConfigPanels/NumberPanel"; +import FlagPanel from "roamjs-components/components/ConfigPanels/FlagPanel"; +import CustomPanel from "roamjs-components/components/ConfigPanels/CustomPanel"; +import SelectPanel from "roamjs-components/components/ConfigPanels/SelectPanel"; +import TextPanel from "roamjs-components/components/ConfigPanels/TextPanel"; +import DiscourseNodeConfigPanel from "~/components/settings/DiscourseNodeConfigPanel"; +import DiscourseRelationConfigPanel from "~/components/settings/DiscourseRelationConfigPanel"; +import DEFAULT_RELATION_VALUES from "~/data/defaultDiscourseRelations"; +import { + onPageRefObserverChange, + previewPageRefHandler, + overlayPageRefHandler, +} from "~/utils/pageRefObserverHandlers"; +import { ConfigTab } from "roamjs-components/components/ConfigPage"; +import { + Field, + CustomField, + SelectField, + FlagField, +} from "roamjs-components/components/ConfigPanels/types"; + +export const configPageTabs = (args: OnloadArgs): ConfigTab[] => [ + { + id: "home", + fields: [ + { + title: "trigger", + description: + "The trigger to create the node menu. Must refresh after editing", + defaultValue: "\\", + // @ts-ignore + Panel: TextPanel, + }, + // @ts-ignore + { + title: "disable sidebar open", + description: "Disable opening new nodes in the sidebar when created", + Panel: FlagPanel, + } as Field, + // @ts-ignore + { + title: "preview", + description: + "Whether or not to display page previews when hovering over page refs", + Panel: FlagPanel, + options: { + onChange: onPageRefObserverChange(previewPageRefHandler), + }, + } as Field, + ], + }, + { + id: "grammar", + fields: [ + // @ts-ignore + { + title: "nodes", + Panel: CustomPanel, + description: "The types of nodes in your discourse graph", + options: { + component: DiscourseNodeConfigPanel, + }, + } as Field, + // @ts-ignore + { + title: "relations", + Panel: CustomPanel, + description: "The types of relations in your discourse graph", + defaultValue: DEFAULT_RELATION_VALUES, + options: { + component: DiscourseRelationConfigPanel, + }, + } as Field, + // @ts-ignore + { + title: "overlay", + Panel: FlagPanel, + // description: + // "Whether to overlay discourse context information over node references", + description: "Currently disabled. Being reworked.", + disabled: true, + options: { + onChange: (val) => { + onPageRefObserverChange((s) => overlayPageRefHandler(s, args))(val); + }, + }, + } as Field, + ], + }, + { + id: "export", + fields: [ + { + title: "max filename length", + // @ts-ignore + Panel: NumberPanel, + description: "Set the maximum name length for markdown file exports", + defaultValue: 64, + }, + { + title: "remove special characters", + // @ts-ignore + Panel: FlagPanel, + description: + "Whether or not to remove the special characters in a file name", + }, + { + title: "simplified filename", + // @ts-ignore + Panel: FlagPanel, + description: + "For discourse nodes, extract out the {content} from the page name to become the file name", + }, + { + title: "frontmatter", + // @ts-ignore + Panel: MultiTextPanel, + description: + "Specify all the lines that should go to the Frontmatter of the markdown file", + }, + { + title: "resolve block references", + // @ts-ignore + Panel: FlagPanel, + description: + "Replaces block references in the markdown content with the block's content", + }, + { + title: "resolve block embeds", + // @ts-ignore + Panel: FlagPanel, + description: + "Replaces block embeds in the markdown content with the block's content tree", + }, + // @ts-ignore + { + title: "link type", + Panel: SelectPanel, + description: "How to format links that appear in your export.", + options: { + items: ["alias", "wikilinks", "roam url"], + }, + } as Field, + { + title: "append referenced node", + // @ts-ignore + Panel: FlagPanel, + description: + "If a referenced node is defined in a node's format, it will be appended to the discourse context", + }, + ], + }, +]; diff --git a/apps/roam/src/settings/settingsPanel.ts b/apps/roam/src/utils/createSettingsPanel.ts similarity index 100% rename from apps/roam/src/settings/settingsPanel.ts rename to apps/roam/src/utils/createSettingsPanel.ts diff --git a/apps/roam/src/utils/discourseConfigRef.ts b/apps/roam/src/utils/discourseConfigRef.ts index 0aa39f87e..8be543837 100644 --- a/apps/roam/src/utils/discourseConfigRef.ts +++ b/apps/roam/src/utils/discourseConfigRef.ts @@ -7,7 +7,7 @@ import { getUidAndStringSetting, getUidAndBooleanSetting, } from "./getExportSettings"; -import { DISCOURSE_CONFIG_PAGE_TITLE } from "~/settings/configPages"; +import { DISCOURSE_CONFIG_PAGE_TITLE } from "~/utils/renderNodeConfigPage"; import getPageUidByPageTitle from "roamjs-components/queries/getPageUidByPageTitle"; const configTreeRef: { diff --git a/apps/roam/src/utils/getExportSettings.ts b/apps/roam/src/utils/getExportSettings.ts index e878d748b..21cadbc5c 100644 --- a/apps/roam/src/utils/getExportSettings.ts +++ b/apps/roam/src/utils/getExportSettings.ts @@ -2,7 +2,7 @@ import getBasicTreeByParentUid from "roamjs-components/queries/getBasicTreeByPar import getPageUidByPageTitle from "roamjs-components/queries/getPageUidByPageTitle"; import { RoamBasicNode } from "roamjs-components/types"; import { getSubTree } from "roamjs-components/util"; -import { DISCOURSE_CONFIG_PAGE_TITLE } from "~/settings/configPages"; +import { DISCOURSE_CONFIG_PAGE_TITLE } from "~/utils/renderNodeConfigPage"; type UidPair = { uid?: string; diff --git a/apps/roam/src/utils/initializeObserversAndListeners.ts b/apps/roam/src/utils/initializeObserversAndListeners.ts index 3befcedeb..5d8f865a6 100644 --- a/apps/roam/src/utils/initializeObserversAndListeners.ts +++ b/apps/roam/src/utils/initializeObserversAndListeners.ts @@ -9,10 +9,9 @@ import { createConfigObserver } from "roamjs-components/components/ConfigPage"; import { renderTldrawCanvas } from "~/components/canvas/Tldraw"; import { renderQueryPage, renderQueryBlock } from "~/components/QueryBuilder"; import { - configPageTabs, DISCOURSE_CONFIG_PAGE_TITLE, renderNodeConfigPage, -} from "~/settings/configPages"; +} from "~/utils/renderNodeConfigPage"; import isFlagEnabled from "~/utils/isFlagEnabled"; import { isCurrentPageCanvas as isCanvasPage } from "~/utils/isCanvasPage"; import { isDiscourseNodeConfigPage as isNodeConfigPage } from "~/utils/isDiscourseNodeConfigPage"; @@ -34,6 +33,7 @@ import { render as renderDiscourseNodeMenu, } from "~/components/DiscourseNodeMenu"; import { IKeyCombo } from "@blueprintjs/core"; +import { configPageTabs } from "~/utils/configPageTabs"; export const initObservers = async ({ onloadArgs, diff --git a/apps/roam/src/utils/isDiscourseNodeConfigPage.ts b/apps/roam/src/utils/isDiscourseNodeConfigPage.ts index efaeaee71..8989f8eac 100644 --- a/apps/roam/src/utils/isDiscourseNodeConfigPage.ts +++ b/apps/roam/src/utils/isDiscourseNodeConfigPage.ts @@ -1,4 +1,4 @@ -import { NODE_CONFIG_PAGE_TITLE } from "~/settings/configPages"; +import { NODE_CONFIG_PAGE_TITLE } from "~/utils/renderNodeConfigPage"; export const isDiscourseNodeConfigPage = (title: string) => title.startsWith(NODE_CONFIG_PAGE_TITLE); diff --git a/apps/roam/src/utils/refreshConfigTree.ts b/apps/roam/src/utils/refreshConfigTree.ts index 178fc15ad..25e2ffa3f 100644 --- a/apps/roam/src/utils/refreshConfigTree.ts +++ b/apps/roam/src/utils/refreshConfigTree.ts @@ -5,7 +5,7 @@ import discourseConfigRef from "./discourseConfigRef"; import registerDiscourseDatalogTranslators from "./registerDiscourseDatalogTranslators"; import { unregisterDatalogTranslator } from "./conditionToDatalog"; import type { PullBlock } from "roamjs-components/types/native"; -import { DISCOURSE_CONFIG_PAGE_TITLE } from "~/settings/configPages"; +import { DISCOURSE_CONFIG_PAGE_TITLE } from "~/utils/renderNodeConfigPage"; const getPagesStartingWithPrefix = (prefix: string) => ( diff --git a/apps/roam/src/settings/commandPalette.ts b/apps/roam/src/utils/registerCommandPaletteCommands.ts similarity index 97% rename from apps/roam/src/settings/commandPalette.ts rename to apps/roam/src/utils/registerCommandPaletteCommands.ts index c9d977e8b..2143d237c 100644 --- a/apps/roam/src/settings/commandPalette.ts +++ b/apps/roam/src/utils/registerCommandPaletteCommands.ts @@ -9,8 +9,8 @@ import { } from "roamjs-components/dom"; import getPageTitleByPageUid from "roamjs-components/queries/getPageTitleByPageUid"; import { OnloadArgs } from "roamjs-components/types"; -import getDiscourseNodes from "../utils/getDiscourseNodes"; -import fireQuery from "../utils/fireQuery"; +import getDiscourseNodes from "./getDiscourseNodes"; +import fireQuery from "./fireQuery"; import { excludeDefaultNodes } from "~/utils/getDiscourseNodes"; import { render as renderSettings } from "~/components/settings/Settings"; diff --git a/apps/roam/src/settings/configPages.ts b/apps/roam/src/utils/renderNodeConfigPage.ts similarity index 53% rename from apps/roam/src/settings/configPages.ts rename to apps/roam/src/utils/renderNodeConfigPage.ts index f1c7929ae..0f384320e 100644 --- a/apps/roam/src/settings/configPages.ts +++ b/apps/roam/src/utils/renderNodeConfigPage.ts @@ -4,8 +4,7 @@ import FlagPanel from "roamjs-components/components/ConfigPanels/FlagPanel"; import SelectPanel from "roamjs-components/components/ConfigPanels/SelectPanel"; import TextPanel from "roamjs-components/components/ConfigPanels/TextPanel"; import BlocksPanel from "roamjs-components/components/ConfigPanels/BlocksPanel"; -import MultiTextPanel from "roamjs-components/components/ConfigPanels/MultiTextPanel"; -import NumberPanel from "roamjs-components/components/ConfigPanels/NumberPanel"; + import { Field, CustomField, @@ -25,15 +24,6 @@ import { } from "~/components"; import getDiscourseNodes from "~/utils/getDiscourseNodes"; import { render as configPageRender } from "roamjs-components/components/ConfigPage"; -import DiscourseNodeConfigPanel from "~/components/settings/DiscourseNodeConfigPanel"; -import DiscourseRelationConfigPanel from "~/components/settings/DiscourseRelationConfigPanel"; -import DEFAULT_RELATION_VALUES from "~/data/defaultDiscourseRelations"; -import { - onPageRefObserverChange, - previewPageRefHandler, - overlayPageRefHandler, -} from "~/utils/pageRefObserverHandlers"; -import { ConfigTab } from "roamjs-components/components/ConfigPage"; export const DISCOURSE_CONFIG_PAGE_TITLE = "roam/js/discourse-graph"; export const NODE_CONFIG_PAGE_TITLE = "discourse-graph/nodes/"; @@ -156,136 +146,3 @@ export const renderNodeConfigPage = ({ renderNode(); } }; - -export const configPageTabs = (args: OnloadArgs): ConfigTab[] => [ - { - id: "home", - fields: [ - { - title: "trigger", - description: - "The trigger to create the node menu. Must refresh after editing", - defaultValue: "\\", - // @ts-ignore - Panel: TextPanel, - }, - // @ts-ignore - { - title: "disable sidebar open", - description: "Disable opening new nodes in the sidebar when created", - Panel: FlagPanel, - } as Field, - // @ts-ignore - { - title: "preview", - description: - "Whether or not to display page previews when hovering over page refs", - Panel: FlagPanel, - options: { - onChange: onPageRefObserverChange(previewPageRefHandler), - }, - } as Field, - ], - }, - { - id: "grammar", - fields: [ - // @ts-ignore - { - title: "nodes", - Panel: CustomPanel, - description: "The types of nodes in your discourse graph", - options: { - component: DiscourseNodeConfigPanel, - }, - } as Field, - // @ts-ignore - { - title: "relations", - Panel: CustomPanel, - description: "The types of relations in your discourse graph", - defaultValue: DEFAULT_RELATION_VALUES, - options: { - component: DiscourseRelationConfigPanel, - }, - } as Field, - // @ts-ignore - { - title: "overlay", - Panel: FlagPanel, - // description: - // "Whether to overlay discourse context information over node references", - description: "Currently disabled. Being reworked.", - disabled: true, - options: { - onChange: (val) => { - onPageRefObserverChange((s) => overlayPageRefHandler(s, args))(val); - }, - }, - } as Field, - ], - }, - { - id: "export", - fields: [ - { - title: "max filename length", - // @ts-ignore - Panel: NumberPanel, - description: "Set the maximum name length for markdown file exports", - defaultValue: 64, - }, - { - title: "remove special characters", - // @ts-ignore - Panel: FlagPanel, - description: - "Whether or not to remove the special characters in a file name", - }, - { - title: "simplified filename", - // @ts-ignore - Panel: FlagPanel, - description: - "For discourse nodes, extract out the {content} from the page name to become the file name", - }, - { - title: "frontmatter", - // @ts-ignore - Panel: MultiTextPanel, - description: - "Specify all the lines that should go to the Frontmatter of the markdown file", - }, - { - title: "resolve block references", - // @ts-ignore - Panel: FlagPanel, - description: - "Replaces block references in the markdown content with the block's content", - }, - { - title: "resolve block embeds", - // @ts-ignore - Panel: FlagPanel, - description: - "Replaces block embeds in the markdown content with the block's content tree", - }, - // @ts-ignore - { - title: "link type", - Panel: SelectPanel, - description: "How to format links that appear in your export.", - options: { - items: ["alias", "wikilinks", "roam url"], - }, - } as Field, - { - title: "append referenced node", - // @ts-ignore - Panel: FlagPanel, - description: - "If a referenced node is defined in a node's format, it will be appended to the discourse context", - }, - ], - }, -]; From f3f5166fa6f06b60995a49129f9783a52d6edfc0 Mon Sep 17 00:00:00 2001 From: Michael Gartner Date: Mon, 13 Jan 2025 11:56:04 -0600 Subject: [PATCH 3/4] rename results-view folder, move views --- apps/roam/src/components/DiscourseContext.tsx | 2 +- apps/roam/src/components/QueryBuilder.tsx | 2 +- apps/roam/src/components/QueryDrawer.tsx | 2 +- apps/roam/src/components/index.ts | 4 ++-- .../{ResultsView/views => results-view}/Charts.tsx | 0 .../{ResultsView/views => results-view}/Kanban.tsx | 0 .../{ResultsView/views => results-view}/ResultsTable.tsx | 0 .../{ResultsView => results-view}/ResultsView.tsx | 8 ++++---- .../{ResultsView/views => results-view}/Timeline.tsx | 0 9 files changed, 9 insertions(+), 9 deletions(-) rename apps/roam/src/components/{ResultsView/views => results-view}/Charts.tsx (100%) rename apps/roam/src/components/{ResultsView/views => results-view}/Kanban.tsx (100%) rename apps/roam/src/components/{ResultsView/views => results-view}/ResultsTable.tsx (100%) rename apps/roam/src/components/{ResultsView => results-view}/ResultsView.tsx (99%) rename apps/roam/src/components/{ResultsView/views => results-view}/Timeline.tsx (100%) diff --git a/apps/roam/src/components/DiscourseContext.tsx b/apps/roam/src/components/DiscourseContext.tsx index 34c42f316..0e187d3aa 100644 --- a/apps/roam/src/components/DiscourseContext.tsx +++ b/apps/roam/src/components/DiscourseContext.tsx @@ -20,7 +20,7 @@ import getShallowTreeByParentUid from "roamjs-components/queries/getShallowTreeB import { Result } from "roamjs-components/types/query-builder"; import nanoId from "nanoid"; import getDiscourseContextResults from "../utils/getDiscourseContextResults"; -import ResultsView from "./ResultsView/ResultsView"; +import ResultsView from "./results-view/ResultsView"; import { getPageTitleValueByHtmlElement } from "roamjs-components/dom"; import getPageUidByPageTitle from "roamjs-components/queries/getPageUidByPageTitle"; import renderWithUnmount from "roamjs-components/util/renderWithUnmount"; diff --git a/apps/roam/src/components/QueryBuilder.tsx b/apps/roam/src/components/QueryBuilder.tsx index 3ff36232c..e27597663 100644 --- a/apps/roam/src/components/QueryBuilder.tsx +++ b/apps/roam/src/components/QueryBuilder.tsx @@ -9,7 +9,7 @@ import React, { import fireQuery from "../utils/fireQuery"; import parseQuery from "../utils/parseQuery"; import type { Result } from "roamjs-components/types/query-builder"; -import ResultsView from "./ResultsView/ResultsView"; +import ResultsView from "./results-view/ResultsView"; import ReactDOM from "react-dom"; import QueryEditor from "./QueryEditor"; import getSubTree from "roamjs-components/util/getSubTree"; diff --git a/apps/roam/src/components/QueryDrawer.tsx b/apps/roam/src/components/QueryDrawer.tsx index 973b6ec33..700b772de 100644 --- a/apps/roam/src/components/QueryDrawer.tsx +++ b/apps/roam/src/components/QueryDrawer.tsx @@ -16,7 +16,7 @@ import getParentUidByBlockUid from "roamjs-components/queries/getParentUidByBloc import renderOverlay from "roamjs-components/util/renderOverlay"; import fireQuery from "../utils/fireQuery"; import parseQuery from "../utils/parseQuery"; -import ResultsView from "./ResultsView/ResultsView"; +import ResultsView from "./results-view/ResultsView"; import ExtensionApiContextProvider from "roamjs-components/components/ExtensionApiContext"; import QueryEditor from "./QueryEditor"; import { Column } from "../utils/types"; diff --git a/apps/roam/src/components/index.ts b/apps/roam/src/components/index.ts index f4c1df4ba..4bcc82a4b 100644 --- a/apps/roam/src/components/index.ts +++ b/apps/roam/src/components/index.ts @@ -17,5 +17,5 @@ export { default as QueryEditor } from "./QueryEditor"; export { default as QueryBuilder } from "./QueryBuilder"; export { default as QueryPagesPanel } from "./settings/QueryPagesPanel"; export { default as ResizableDrawer } from "./ResizableDrawer"; -export { default as ResultsView } from "./ResultsView/ResultsView"; -export { default as Timeline } from "./ResultsView/views/Timeline"; +export { default as ResultsView } from "./results-view/ResultsView"; +export { default as Timeline } from "./results-view/Timeline"; diff --git a/apps/roam/src/components/ResultsView/views/Charts.tsx b/apps/roam/src/components/results-view/Charts.tsx similarity index 100% rename from apps/roam/src/components/ResultsView/views/Charts.tsx rename to apps/roam/src/components/results-view/Charts.tsx diff --git a/apps/roam/src/components/ResultsView/views/Kanban.tsx b/apps/roam/src/components/results-view/Kanban.tsx similarity index 100% rename from apps/roam/src/components/ResultsView/views/Kanban.tsx rename to apps/roam/src/components/results-view/Kanban.tsx diff --git a/apps/roam/src/components/ResultsView/views/ResultsTable.tsx b/apps/roam/src/components/results-view/ResultsTable.tsx similarity index 100% rename from apps/roam/src/components/ResultsView/views/ResultsTable.tsx rename to apps/roam/src/components/results-view/ResultsTable.tsx diff --git a/apps/roam/src/components/ResultsView/ResultsView.tsx b/apps/roam/src/components/results-view/ResultsView.tsx similarity index 99% rename from apps/roam/src/components/ResultsView/ResultsView.tsx rename to apps/roam/src/components/results-view/ResultsView.tsx index fc455ab90..ab4d3ebdb 100644 --- a/apps/roam/src/components/ResultsView/ResultsView.tsx +++ b/apps/roam/src/components/results-view/ResultsView.tsx @@ -27,16 +27,16 @@ import { useExtensionAPI } from "roamjs-components/components/ExtensionApiContex import postProcessResults from "~/utils/postProcessResults"; import setInputSetting from "roamjs-components/util/setInputSetting"; import getUids from "roamjs-components/dom/getUids"; -import Charts from "./views/Charts"; -import Timeline from "./views/Timeline"; -import Kanban from "./views/Kanban"; +import Charts from "./Charts"; +import Timeline from "./Timeline"; +import Kanban from "./Kanban"; import MenuItemSelect from "roamjs-components/components/MenuItemSelect"; import { RoamBasicNode } from "roamjs-components/types"; import { render as renderToast } from "roamjs-components/components/Toast"; import { Column, Result } from "~/utils/types"; import updateBlock from "roamjs-components/writes/updateBlock"; import { Condition } from "~/utils/types"; -import ResultsTable from "./views/ResultsTable"; +import ResultsTable from "./ResultsTable"; import { render as renderSimpleAlert } from "roamjs-components/components/SimpleAlert"; import setInputSettings from "roamjs-components/util/setInputSettings"; import posthog from "posthog-js"; diff --git a/apps/roam/src/components/ResultsView/views/Timeline.tsx b/apps/roam/src/components/results-view/Timeline.tsx similarity index 100% rename from apps/roam/src/components/ResultsView/views/Timeline.tsx rename to apps/roam/src/components/results-view/Timeline.tsx From a47ebe4f5259bbce1352f60357abec80a6ec54fc Mon Sep 17 00:00:00 2001 From: Michael Gartner Date: Mon, 13 Jan 2025 12:15:14 -0600 Subject: [PATCH 4/4] sp --- apps/roam/src/components/settings/NodeConfig.tsx | 2 +- apps/roam/src/utils/renderNodeConfigPage.ts | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/apps/roam/src/components/settings/NodeConfig.tsx b/apps/roam/src/components/settings/NodeConfig.tsx index ec8b6e0b1..91112aae4 100644 --- a/apps/roam/src/components/settings/NodeConfig.tsx +++ b/apps/roam/src/components/settings/NodeConfig.tsx @@ -90,7 +90,7 @@ const NodeConfig = ({