Skip to content

Commit

Permalink
fix: cycle import
Browse files Browse the repository at this point in the history
  • Loading branch information
lawvs committed Jul 31, 2024
1 parent 14bd2c5 commit 1c2d974
Show file tree
Hide file tree
Showing 6 changed files with 35 additions and 35 deletions.
5 changes: 2 additions & 3 deletions packages/filter/src/filter-builder.tsx
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
import type { FilterGroup } from "@fn-sphere/core";
import { FilterProvider } from "./hooks/filter-provider.js";
import { presetUiSpec } from "./preset.js";
import { useView } from "./specs/hooks.js";
import { FilterUiProvider } from "./specs/index.js";
import type { UiSpec } from "./specs/types.js";
import type { UiSpec } from "./specs/index.js";
import { FilterUiProvider, presetUiSpec } from "./specs/index.js";
import type { BasicFilterBuilderProps } from "./types.js";

export const FilterBuilder = <Data,>({
Expand Down
2 changes: 1 addition & 1 deletion packages/filter/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,5 +21,5 @@ export {
stringFilter,
} from "@fn-sphere/core";
export type { FilterGroup, FilterRule, SingleFilter } from "@fn-sphere/core";
export { presetUiSpec } from "./preset.js";
export { presetUiSpec } from "./specs/index.js";
export { presetDataInputSpecs } from "./views/data-input-views.js";
30 changes: 0 additions & 30 deletions packages/filter/src/preset.ts

This file was deleted.

2 changes: 1 addition & 1 deletion packages/filter/src/specs/context.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { createContext, type ReactNode } from "react";
import { presetUiSpec } from "../preset.js";
import { presetUiSpec } from "./preset.js";
import type { UiSpec } from "./types.js";

export const UiSpecContext = createContext<UiSpec>(presetUiSpec);
Expand Down
1 change: 1 addition & 0 deletions packages/filter/src/specs/index.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
export { FilterUiProvider } from "./context.js";
export { useDataInputView, useView } from "./hooks.js";
export { presetUiSpec } from "./preset.js";
export type * from "./types.js";
30 changes: 30 additions & 0 deletions packages/filter/src/specs/preset.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
import { ButtonView, InputView, SelectView } from "../views/components.js";
import { presetDataInputSpecs } from "../views/data-input-views.js";
import { FieldSelect } from "../views/field-select.js";
import { FilterDataInput } from "../views/filter-data-input.js";
import { FilterGroupContainer } from "../views/filter-group-container.js";
import { FilterGroupView } from "../views/filter-group.js";
import { SingleFilterView } from "../views/filter-rule.js";
import { FilterSelect } from "../views/filter-select.js";
import { primitives } from "../views/primitives.js";
import { RuleJoiner } from "../views/rule-joiner.js";
import type { UiSpec } from "./index.js";

export const presetUiSpec: UiSpec = {
primitives,
components: {
Button: ButtonView,
Input: InputView,
Select: SelectView,
},
templates: {
SingleFilter: SingleFilterView,
FilterGroup: FilterGroupView,
RuleJoiner,
FieldSelect,
FilterSelect,
FilterDataInput,
FilterGroupContainer,
},
dataInputViews: presetDataInputSpecs,
} satisfies UiSpec;

0 comments on commit 1c2d974

Please sign in to comment.