Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions packages/annotation/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,9 @@
"version": "0.0.0-development",
"private": true,
"type": "module",
"imports": {
"#src/*": "./src/*"
},
"scripts": {
"dev": "vite",
"build": "vite build",
Expand Down
2 changes: 1 addition & 1 deletion packages/annotation/src/demo/DemoStage.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import type { AnnotationPayload } from '@contextbridge/shared/annotationSchema';
import { type ReactNode, useEffect, useState } from 'react';
import { App, type AppProps } from '../App.tsx';
import { App, type AppProps } from '#src/App.tsx';
import { TerminalWindow } from './TerminalWindow.tsx';

type InputMode = 'plan' | 'accept';
Expand Down
2 changes: 1 addition & 1 deletion packages/annotation/src/element/ElementAdapter.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import type { ElementAnnotationAnchor } from '@contextbridge/shared/annotationSchema';
import type { ComponentType } from 'react';
import type { ResolvedAnnotationThread } from '../annotationTypes.ts';
import type { ResolvedAnnotationThread } from '#src/annotationTypes.ts';
import type { ElementBlockProps } from './elementBlock.ts';
import { mermaidAdapter } from './mermaid/mermaidAdapter.ts';

Expand Down
4 changes: 2 additions & 2 deletions packages/annotation/src/element/mermaid/MermaidBlock.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { useEffect, useId, useRef, useState } from 'react';
import type { ElementBlockProps } from '../elementBlock.ts';
import { dispatchElementRendered, elementBlockContainerProps } from '../elementBlock.ts';
import type { ElementBlockProps } from '#src/element/elementBlock.ts';
import { dispatchElementRendered, elementBlockContainerProps } from '#src/element/elementBlock.ts';
import './mermaidAdapter.css';
import { currentMermaidTheme, renderMermaid } from './renderer.ts';

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { afterEach, describe, expect, it } from 'vitest';
import type { ResolvedAnnotationThread } from '../../annotationTypes.ts';
import type { ResolvedAnnotationThread } from '#src/annotationTypes.ts';
import { mermaidAdapter } from './mermaidAdapter.ts';

describe('mermaidAdapter', () => {
Expand Down
6 changes: 3 additions & 3 deletions packages/annotation/src/element/mermaid/mermaidAdapter.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import type { ElementAnnotationAnchor } from '@contextbridge/shared/annotationSchema';
import type { ResolvedAnnotationThread } from '../../annotationTypes.ts';
import type { ElementAdapter } from '../ElementAdapter.ts';
import { elementBlockAttrs } from '../elementBlock.ts';
import type { ResolvedAnnotationThread } from '#src/annotationTypes.ts';
import type { ElementAdapter } from '#src/element/ElementAdapter.ts';
import { elementBlockAttrs } from '#src/element/elementBlock.ts';
import { MermaidBlock, mermaidAttrs } from './MermaidBlock.tsx';

const CONTENT_TYPE = 'mermaid';
Expand Down
6 changes: 3 additions & 3 deletions packages/annotation/src/element/useElementTargets.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { useEffect, useState } from 'react';
import { getNewThreadDraftId } from '../annotationResolvers.ts';
import type { ResolvedAnnotationThread } from '../annotationTypes.ts';
import type { OpenAnnotationCommentDraftArgs } from '../useAnnotationState.ts';
import { getNewThreadDraftId } from '#src/annotationResolvers.ts';
import type { ResolvedAnnotationThread } from '#src/annotationTypes.ts';
import type { OpenAnnotationCommentDraftArgs } from '#src/useAnnotationState.ts';
import { elementAdapterForContentType, elementAdapters } from './ElementAdapter.ts';
import { ELEMENT_RENDERED_EVENT, elementBlockAttrs } from './elementBlock.ts';

Expand Down
4 changes: 2 additions & 2 deletions packages/annotation/src/testHelpers/appContextDecorator.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { FakeFrontendBrowser, fakeFrontendContext } from '@contextbridge/context/testHelpers';
import type { ComponentType, ReactElement } from 'react';
import type { AnnotationAppContext as AnnotationAppContextValue } from '../useAppContext.ts';
import { AnnotationAppContext } from '../useAppContext.ts';
import type { AnnotationAppContext as AnnotationAppContextValue } from '#src/useAppContext.ts';
import { AnnotationAppContext } from '#src/useAppContext.ts';

export function createStoryAppContext(overrides?: Partial<AnnotationAppContextValue>): AnnotationAppContextValue {
return {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import type { AnnotationPayload, AnnotationSubmission } from '@contextbridge/sha
import type { UpdateNotice } from '@contextbridge/shared/updateNoticeSchema';
import type { Mock } from 'vitest';
import { vi } from 'vitest';
import type { AnnotationAppContext } from '../useAppContext.ts';
import type { AnnotationAppContext } from '#src/useAppContext.ts';

export interface FakeAppContextResult {
context: AnnotationAppContext;
Expand Down
14 changes: 7 additions & 7 deletions packages/annotation/src/testHelpers/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,13 @@ import { fireEvent, render, screen, waitFor } from '@testing-library/react';
import type { RenderResult } from '@testing-library/react';
import userEvent from '@testing-library/user-event';
import { expect } from 'vitest';
import { annotatedMarkdownTestIds } from '../AnnotatedMarkdown.tsx';
import { annotationDraftCommentComposerTestIds } from '../AnnotationDraftCommentComposer.tsx';
import type { AppProps } from '../App.tsx';
import { App } from '../App.tsx';
import { submitBarTestIds } from '../SubmitBar.tsx';
import type { AnnotationAppContext as AnnotationAppContextValue } from '../useAppContext.ts';
import { AnnotationAppContext } from '../useAppContext.ts';
import { annotatedMarkdownTestIds } from '#src/AnnotatedMarkdown.tsx';
import { annotationDraftCommentComposerTestIds } from '#src/AnnotationDraftCommentComposer.tsx';
import type { AppProps } from '#src/App.tsx';
import { App } from '#src/App.tsx';
import { submitBarTestIds } from '#src/SubmitBar.tsx';
import type { AnnotationAppContext as AnnotationAppContextValue } from '#src/useAppContext.ts';
import { AnnotationAppContext } from '#src/useAppContext.ts';
import type { FakeAppContextResult } from './createFakeAppContext.ts';
import { createFakeAppContext } from './createFakeAppContext.ts';

Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import type { RenderHookOptions, RenderHookResult } from '@testing-library/react';
import { renderHook } from '@testing-library/react';
import type { ReactNode } from 'react';
import type { AnnotationAppContext as AnnotationAppContextValue } from '../useAppContext.ts';
import { AnnotationAppContext } from '../useAppContext.ts';
import type { AnnotationAppContext as AnnotationAppContextValue } from '#src/useAppContext.ts';
import { AnnotationAppContext } from '#src/useAppContext.ts';
import type { FakeAppContextResult } from './createFakeAppContext.ts';
import { createFakeAppContext } from './createFakeAppContext.ts';

Expand Down
Loading