Skip to content

Commit aaaf2b9

Browse files
committed
feat(repo): use anycontextwithdefenitions in core types
1 parent fbbd534 commit aaaf2b9

File tree

6 files changed

+10
-14
lines changed

6 files changed

+10
-14
lines changed

packages/core/src/compiler/duplicateConfig.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import { deepClone, uniqueId } from "@easyblocks/utils";
22
import { NoCodeComponentEntry } from "../types";
33
import { configTraverse } from "./configTraverse";
44
import { traverseComponents } from "./traverseComponents";
5-
import { AnyContextWithDefinitions } from "./types";
5+
import { AnyContextWithDefinitions } from "../types";
66

77
export function duplicateConfig<
88
ConfigType extends NoCodeComponentEntry = NoCodeComponentEntry

packages/core/src/compiler/findComponentDefinition.ts

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,6 @@
11
import { toArray } from "@easyblocks/utils";
2-
import { NoCodeComponentEntry } from "../types";
3-
import {
4-
InternalComponentDefinition,
5-
InternalComponentDefinitions,
6-
} from "./types";
7-
8-
type AnyContextWithDefinitions = { definitions: InternalComponentDefinitions };
2+
import { NoCodeComponentEntry, AnyContextWithDefinitions } from "../types";
3+
import { InternalComponentDefinition } from "./types";
94

105
function allDefs(
116
context?: AnyContextWithDefinitions

packages/core/src/compiler/traverseComponents.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import { NoCodeComponentEntry } from "../types";
22
import { findComponentDefinition } from "./findComponentDefinition";
33
import { isSchemaPropComponent } from "./schema";
4-
import { AnyContextWithDefinitions } from "./types";
4+
import { AnyContextWithDefinitions } from "../types";
55

66
type TraverseComponentsCallback = (arg: {
77
path: string;

packages/core/src/compiler/types.ts

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -168,7 +168,3 @@ export type EditorContextType = CompilationContextType & {
168168
actions: EditorActions;
169169
templates?: Template[];
170170
};
171-
172-
export type AnyContextWithDefinitions = {
173-
definitions: InternalComponentDefinitions;
174-
};

packages/core/src/types.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
import { ComponentType, ReactElement } from "react";
22
import { PartialDeep } from "type-fest";
33
import { Locale } from "./locales";
4+
import { InternalComponentDefinitions } from "./_internals";
45

56
export type ScalarOrCollection<T> = T | Array<T>;
67

@@ -997,3 +998,7 @@ export type TokenValue<T = any> = {
997998
tokenId?: string;
998999
widgetId?: string;
9991000
};
1001+
1002+
export type AnyContextWithDefinitions = {
1003+
definitions: InternalComponentDefinitions;
1004+
};

packages/editor/src/useCanvasGlobalKeyboardShortcuts.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import {
55
} from "@easyblocks/core/_internals";
66
import { dotNotationGet, preOrderPathComparator } from "@easyblocks/utils";
77
import { useEffect } from "react";
8-
import { AnyContextWithDefinitions } from "../../core/dist/types/compiler/types";
8+
import { AnyContextWithDefinitions } from "@easyblocks/core/";
99

1010
const GLOBAL_SHORTCUTS_KEYS = [
1111
"Delete",

0 commit comments

Comments
 (0)