Skip to content

V2 beta 3#35

Merged
flipbit merged 46 commits into
mainfrom
v2-beta-3
Jun 17, 2026
Merged

V2 beta 3#35
flipbit merged 46 commits into
mainfrom
v2-beta-3

Conversation

@flipbit

@flipbit flipbit commented Jun 17, 2026

Copy link
Copy Markdown
Owner

CSS theming

Theme support via CSS custom properties. Set theme: "dark" (or whatever) in options and style with .image-annotate-canvas[data-theme="dark"] { ... }. Button icons switched to mask-image so they pick up the text color
automatically. Includes a themes demo page.

Smart positioning

Tooltips and edit forms now position themselves to stay within the image bounds instead of overflowing off the edges. Annotations are clamped to image bounds on load so out-of-range coordinates don't cause invisible
notes.

Note display improvements

Notes get proper z-index on hover so they stack correctly, plus configurable max-width via CSS custom properties.

Housekeeping

  • Bumped TypeScript 6, ESLint 10, jsdom 29, and other devDependencies
  • README now has badges, preview image, and links to docs/demo
  • Version bump to 2.0.0-beta.3 for pre-release validation

flipbit added 30 commits June 17, 2026 09:07
Also fixes a pre-existing bug in the auto-scaling test block where
vi.unstubAllGlobals() was removing the jQuery global stubs needed by
subsequent describe blocks. The afterEach now restores only ResizeObserver.
Remove default canvas border (breaking change).
Add variables for area background, border radius, shadows,
and add-button styling. All other defaults preserve current
visual behavior.
Icon color now follows --image-annotate-button-text automatically.
Dark themes no longer need to override icon SVG variables.
Changed SVG fills from #333 to #fff (mask needs white = opaque).
show() now calls computeNoteLeft to set inline left on the tooltip,
centering it under the annotation area and clamping to viewport edges.
Move clampNote from annotate-image.ts to positioning.ts alongside
computeNoteLeft. Add clampNotes() helper that applies clamping in
place via Object.assign, replacing duplicated 6-line loops in load()
and loadFromApi(). Addresses M1, M2, D1, D2.
The initial positionForm() call happens before buttons are appended,
but form width is dominated by textarea and CSS min-width. Position
is recalculated on drag/resize stop. Addresses M3.
Verify that drag and resize onStop callbacks trigger positionForm(),
updating form.style.left. Addresses H2.
Replace weak "style.left is not empty" assertion with stubbed
getBoundingClientRect returning non-zero rects (tooltip width=150,
area left=100, width=80). Assert computed left matches
computeNoteLeft output (-35px). Addresses H1.
Demo has 4 notes but test expected 3. Also add comments explaining
why color assertions check "differ" rather than exact values.
Addresses M6, D4.
Icon SVGs have an opaque fill for the mask shape, but the visible
color comes from background-color via CSS mask-image. Addresses L1.
flipbit added 16 commits June 17, 2026 09:07
Tooltip vertical position is CSS-driven. Vertical clamping (flipping
above the area near viewport bottom) is intentionally not implemented.
Addresses D3.
# Conflicts:
#	package-lock.json
Update @playwright/test, @vue/test-utils, esbuild, eslint-plugin-react-hooks,
eslint-plugin-vue, prettier, typescript-eslint, vitest, and vue to latest
within semver range.
Fix no-useless-assignment lint errors in resizeCorner() by assigning
left/top in both branches instead of initializing then overwriting.
Use typeof import('jquery') instead of bare JQueryStatic global,
which TS 6 no longer resolves under moduleResolution: "bundler".
- multiple-instances: expect 4 annotations per image (was 2)
- programmatic-api: expect 4 annotations (was 3)
- scaling: expect 400px canvas width without border (was 402)
- playwright config: use 127.0.0.1 URL for webServer readiness check
  (Playwright 1.61 requires 2xx, not just TCP connect) and increase
  timeout to 60s for build + serve startup
Converted retina PNG screenshot to JPEG at 1x resolution (387×544),
reducing from 1.6MB to 102KB. Centered in README for GitHub/NPM display.
@flipbit
flipbit merged commit 2da4234 into main Jun 17, 2026
3 checks passed
@flipbit
flipbit deleted the v2-beta-3 branch June 17, 2026 08:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant