Skip to content

Commit

Permalink
Little procrastinatory reorganisation
Browse files Browse the repository at this point in the history
  • Loading branch information
jonathonherbert committed Oct 23, 2024
1 parent 37fb996 commit b691194
Show file tree
Hide file tree
Showing 22 changed files with 29 additions and 29 deletions.
6 changes: 3 additions & 3 deletions prosemirror-client/src/cqlInput/CqlInput.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,17 +4,17 @@ import { findByTestId, findByText, fireEvent } from "@testing-library/dom";
import { CqlClientService } from "../services/CqlService";
import { TestTypeaheadHelpers } from "../lang/typeaheadHelpersTest";
import { createEditor, ProsemirrorTestChain } from "jest-prosemirror";
import { createCqlPlugin } from "./plugin";
import { createCqlPlugin } from "./editor/plugin";
import { redo, undo } from "prosemirror-history";
import { bottomOfLine, topOfLine } from "./commands";
import { bottomOfLine, topOfLine } from "./editor/commands";
import { keymap } from "prosemirror-keymap";
import {
createProseMirrorTokenToDocumentMap,
docToQueryStr,
mapResult,
tokensToDoc,
toProseMirrorTokens,
} from "./utils";
} from "./editor/utils";
import { TextSelection } from "prosemirror-state";

const typeheadHelpers = new TestTypeaheadHelpers();
Expand Down
6 changes: 3 additions & 3 deletions prosemirror-client/src/cqlInput/CqlInput.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import { EditorView } from "prosemirror-view";
import { CqlServiceInterface } from "../services/CqlService";
import { QueryChangeEventDetail } from "./dom";
import { createEditorView } from "./editor";
import { createCqlPlugin, VISIBLE_CLASS } from "./plugin";
import { QueryChangeEventDetail } from "../types/dom";
import { createEditorView } from "./editor/editor";
import { createCqlPlugin, VISIBLE_CLASS } from "./editor/plugin";

const baseFontSize = 28;
const baseBorderRadius = 5;
Expand Down
2 changes: 1 addition & 1 deletion prosemirror-client/src/cqlInput/ErrorPopover.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { EditorView } from "prosemirror-view";
import { CqlError } from "../services/CqlService";
import { Popover } from "./Popover";
import { ERROR_CLASS, VISIBLE_CLASS } from "./plugin";
import { ERROR_CLASS, VISIBLE_CLASS } from "./editor/plugin";

export class ErrorPopover extends Popover {
private debugContainer: HTMLElement | undefined;
Expand Down
4 changes: 2 additions & 2 deletions prosemirror-client/src/cqlInput/TypeaheadPopover.ts
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
import { EditorView } from "prosemirror-view";
import { schema } from "./schema";
import { schema } from "./editor/schema";
import { TextSelection } from "prosemirror-state";
import { Popover } from "./Popover";
import {
MappedTypeaheadSuggestion,
TextSuggestionOption,
TypeaheadSuggestion,
} from "../lang/types";
import { getNextPositionAfterTypeaheadSelection } from "./utils";
import { getNextPositionAfterTypeaheadSelection } from "./editor/utils";

type MenuItem = {
label: string;
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { Node } from "prosemirror-model";
import { Mapping } from "prosemirror-transform";

/**
* Utility function to log node structure to console. Quick, dirty, cursed code.
* Utility function to log node structure to console.
*/
export const logNode = (doc: Node) => {
console.log(`Log node ${doc.type.name}:`);
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { DecorationSet } from "prosemirror-view";
import { CqlError, CqlServiceInterface } from "../services/CqlService";
import { CqlError, CqlServiceInterface } from "../../services/CqlService";
import {
AllSelection,
Plugin,
Expand All @@ -19,13 +19,13 @@ import {
mapResult,
} from "./utils";
import { Mapping } from "prosemirror-transform";
import { TypeaheadPopover } from "./TypeaheadPopover";
import { TypeaheadPopover } from "../TypeaheadPopover";
import { chip, DELETE_CHIP_INTENT, doc, schema } from "./schema";
import { DOMSerializer, Fragment } from "prosemirror-model";
import { QueryChangeEventDetail } from "./dom";
import { ErrorPopover } from "./ErrorPopover";
import { MappedTypeaheadSuggestion } from "../lang/types";
import { CqlConfig } from "./CqlInput";
import { QueryChangeEventDetail } from "../../types/dom";
import { ErrorPopover } from "../ErrorPopover";
import { MappedTypeaheadSuggestion } from "../../lang/types";
import { CqlConfig } from "../CqlInput";
import { getDebugMappingHTML } from "./debug";

const cqlPluginKey = new PluginKey<PluginState>("cql-plugin");
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@ import {
} from "./utils";
import { schema } from "./schema";
import { builders } from "prosemirror-test-builder";
import { Typeahead } from "../lang/typeahead";
import { TestTypeaheadHelpers } from "../lang/typeaheadHelpersTest";
import { Cql } from "../lang/Cql";
import { Typeahead } from "../../lang/typeahead";
import { TestTypeaheadHelpers } from "../../lang/typeaheadHelpersTest";
import { Cql } from "../../lang/Cql";

describe("utils", () => {
const { chip, chipKey, chipValue, doc, searchText } = builders(schema);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,10 @@ import {
import { Node, NodeType } from "prosemirror-model";
import { Selection, TextSelection } from "prosemirror-state";
import { ERROR_CLASS } from "./plugin";
import { Token } from "../lang/token";
import { MappedTypeaheadSuggestion, TypeaheadSuggestion } from "../lang/types";
import { CqlResult } from "../lang/Cql";
import { CqlError } from "../services/CqlService";
import { Token } from "../../lang/token";
import { MappedTypeaheadSuggestion, TypeaheadSuggestion } from "../../lang/types";
import { CqlResult } from "../../lang/Cql";
import { CqlError } from "../../services/CqlService";

const tokensToPreserve = ["QUERY_FIELD_KEY", "QUERY_VALUE", "EOF"];

Expand Down
2 changes: 1 addition & 1 deletion prosemirror-client/src/lang/Cql.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { either, Result } from "../util/result";
import { either, Result } from "../utils/result";
import { QueryList } from "./ast";
import { queryStrFromQueryList } from "./capiQueryString";
import { Parser } from "./parser";
Expand Down
2 changes: 1 addition & 1 deletion prosemirror-client/src/lang/capiQueryString.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { err, ok, Result } from "../util/result";
import { err, ok, Result } from "../utils/result";
import { QueryBinary, QueryContent, QueryList } from "./ast";
import { getQueryFieldsFromQueryList } from "./util";

Expand Down
2 changes: 1 addition & 1 deletion prosemirror-client/src/lang/parser.spec.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { describe, expect, it } from "bun:test";
import { ok, Result, ResultKind } from "../util/result";
import { ok, Result, ResultKind } from "../utils/result";
import {
createQueryList,
createQueryBinary,
Expand Down
2 changes: 1 addition & 1 deletion prosemirror-client/src/lang/parser.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ import {
QueryStr,
} from "./ast";
import { TokenType } from "./token";
import { either, err, mapError, ok, Result } from "../util/result";
import { either, err, mapError, ok, Result } from "../utils/result";

class ParseError extends Error {
constructor(public position: number, public message: string) {
Expand Down
2 changes: 1 addition & 1 deletion prosemirror-client/src/lang/typeahead.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { QueryList, QueryField, QueryContent, QueryBinary } from "./ast";
import { QueryList, QueryField } from "./ast";
import { Token } from "./token";
import {
DateSuggestion,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { QueryChangeEventDetail, QueryChangeEvent } from "./CqlInput";
import { QueryChangeEventDetail, QueryChangeEvent } from "../cqlInput/CqlInput";

export type QueryChangeEventDetail = {
cqlQuery: string;
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.

0 comments on commit b691194

Please sign in to comment.