Remove re-export shims and import types directly from core
Delete src/types.ts (pure re-export of Color, Rect, etc.) — 9 files now import directly from @open-pencil/core. Remove dead AI_PROVIDERS re-export from use-chat.ts and dead font function re-exports from engine/fonts.ts.
This commit is contained in:
parent
7c584db1b7
commit
33389a95ad
|
|
@ -1,9 +1,8 @@
|
|||
<script setup lang="ts">
|
||||
import ColorPicker from './ColorPicker.vue'
|
||||
import type { Color } from '@open-pencil/core'
|
||||
import { colorToHexRaw, parseColor } from '@open-pencil/core'
|
||||
|
||||
import type { Color } from '@/types'
|
||||
|
||||
const { color, editable = false } = defineProps<{
|
||||
color: Color
|
||||
editable?: boolean
|
||||
|
|
|
|||
|
|
@ -1,12 +1,11 @@
|
|||
<script setup lang="ts">
|
||||
import type { Color } from '@open-pencil/core'
|
||||
import { colorToCSS } from '@open-pencil/core'
|
||||
import { computed } from 'vue'
|
||||
import { PopoverRoot, PopoverTrigger, PopoverPortal, PopoverContent } from 'reka-ui'
|
||||
|
||||
import HsvColorArea from './HsvColorArea.vue'
|
||||
|
||||
import type { Color } from '@/types'
|
||||
|
||||
const { color } = defineProps<{
|
||||
color: Color
|
||||
}>()
|
||||
|
|
|
|||
|
|
@ -20,8 +20,7 @@ import HsvColorArea from './HsvColorArea.vue'
|
|||
import ScrubInput from './ScrubInput.vue'
|
||||
import { colorToCSS, colorToHexRaw, parseColor } from '@open-pencil/core'
|
||||
|
||||
import type { Color } from '@/types'
|
||||
import type { Fill, GradientStop, GradientTransform } from '@open-pencil/core'
|
||||
import type { Color, Fill, GradientStop, GradientTransform } from '@open-pencil/core'
|
||||
|
||||
type FillCategory = 'SOLID' | 'GRADIENT' | 'IMAGE'
|
||||
type GradientSubtype =
|
||||
|
|
|
|||
|
|
@ -14,10 +14,9 @@ import {
|
|||
type Color as RekaColor
|
||||
} from 'reka-ui'
|
||||
|
||||
import type { Color } from '@open-pencil/core'
|
||||
import { colorToHex8, rgba255ToColor } from '@open-pencil/core'
|
||||
|
||||
import type { Color } from '@/types'
|
||||
|
||||
const { color } = defineProps<{
|
||||
color: Color
|
||||
}>()
|
||||
|
|
|
|||
|
|
@ -10,7 +10,8 @@ import {
|
|||
} from 'reka-ui'
|
||||
|
||||
import { selectContent, selectItem, selectTrigger } from '@/components/ui/select'
|
||||
import { AI_PROVIDERS, useAIChat } from '@/composables/use-chat'
|
||||
import { AI_PROVIDERS } from '@open-pencil/core'
|
||||
import { useAIChat } from '@/composables/use-chat'
|
||||
|
||||
const { providerID, providerDef } = useAIChat()
|
||||
|
||||
|
|
|
|||
|
|
@ -2,7 +2,7 @@
|
|||
import ColorInput from '@/components/ColorInput.vue'
|
||||
import { useEditorStore } from '@/stores/editor'
|
||||
|
||||
import type { Color } from '@/types'
|
||||
import type { Color } from '@open-pencil/core'
|
||||
|
||||
const store = useEditorStore()
|
||||
|
||||
|
|
|
|||
|
|
@ -14,8 +14,7 @@ import {
|
|||
import { computeSelectionBounds, computeSnap } from '@open-pencil/core'
|
||||
|
||||
import type { EditorStore, Tool } from '@/stores/editor'
|
||||
import type { Rect } from '@/types'
|
||||
import type { NodeType, SceneNode } from '@open-pencil/core'
|
||||
import type { NodeType, Rect, SceneNode } from '@open-pencil/core'
|
||||
|
||||
type HandlePosition = 'nw' | 'n' | 'ne' | 'e' | 'se' | 's' | 'sw' | 'w'
|
||||
|
||||
|
|
|
|||
|
|
@ -15,8 +15,7 @@ import { AI_PROVIDERS, DEFAULT_AI_MODEL, DEFAULT_AI_PROVIDER } from '@open-penci
|
|||
import type { AIProviderID } from '@open-pencil/core'
|
||||
import type { LanguageModel, UIMessage } from 'ai'
|
||||
|
||||
export { AI_PROVIDERS } from '@open-pencil/core'
|
||||
export type { AIProviderDef, AIProviderID, ModelOption } from '@open-pencil/core'
|
||||
|
||||
|
||||
const STORAGE_PREFIX = 'open-pencil:'
|
||||
const LEGACY_KEY_STORAGE = `${STORAGE_PREFIX}openrouter-api-key`
|
||||
|
|
|
|||
|
|
@ -14,8 +14,7 @@ import {
|
|||
} from '@/constants'
|
||||
|
||||
import type { EditorStore } from '@/stores/editor'
|
||||
import type { Color } from '@/types'
|
||||
import type { SceneNode } from '@open-pencil/core'
|
||||
import type { Color, SceneNode } from '@open-pencil/core'
|
||||
import type { Room } from 'trystero'
|
||||
|
||||
export interface RemotePeer {
|
||||
|
|
|
|||
|
|
@ -58,8 +58,7 @@ export {
|
|||
RULER_MAJOR_TOLERANCE
|
||||
} from '@open-pencil/core'
|
||||
|
||||
import type { Color } from '@/types'
|
||||
import type { Fill, Stroke } from '@open-pencil/core'
|
||||
import type { Color, Fill, Stroke } from '@open-pencil/core'
|
||||
|
||||
export const TRYSTERO_APP_ID = 'openpencil'
|
||||
export const ROOM_ID_LENGTH = 8
|
||||
|
|
|
|||
|
|
@ -1,11 +1,3 @@
|
|||
export {
|
||||
initFontService,
|
||||
getFontProvider,
|
||||
ensureNodeFont,
|
||||
ensureCJKFallback,
|
||||
getCJKFallbackFamily
|
||||
} from '@open-pencil/core'
|
||||
|
||||
import {
|
||||
IS_TAURI,
|
||||
loadFont as loadFontCore,
|
||||
|
|
|
|||
|
|
@ -34,12 +34,13 @@ import {
|
|||
} from '@open-pencil/core'
|
||||
import { readFigFile } from '@open-pencil/core'
|
||||
|
||||
import type { Color, Rect } from '@/types'
|
||||
import type {
|
||||
Color,
|
||||
ExportFormat,
|
||||
Fill,
|
||||
LayoutMode,
|
||||
NodeType,
|
||||
Rect,
|
||||
SceneNode,
|
||||
SnapGuide,
|
||||
VectorNetwork,
|
||||
|
|
|
|||
|
|
@ -1 +0,0 @@
|
|||
export type { GUID, Color, Vector, Matrix, Rect } from '@open-pencil/core'
|
||||
Loading…
Reference in a new issue