# @desource/phone-mask

## 1.6.3

### Patch Changes

- Core/Vue/React/Svelte/Nuxt Upgrades:
  - Updated development dependencies across build, lint, test, release, and framework tooling.

## 1.6.2

### Patch Changes

- Core/Vue/React/Svelte/Nuxt Upgrades:
  - Updated development dependencies across build, lint, test, and framework tooling.

## 1.6.1

### Patch Changes

- Core Upgrades:
  - Sync country masks with google-libphonenumber (🇫🇴 Faroe Islands updates)

## 1.6.0

### Minor Changes

- React Upgrades:
  - Improved `PhoneInput` SSR support by deferring dropdown portal rendering until the component is mounted, avoiding server-side `document.body` access during render.
  - Preserved country selector portal behavior by rendering the dropdown into `document.body` after mount.

- Vue/React/Svelte/Nuxt Upgrades:
  - Improved default copy icon visuals across framework `PhoneInput` components.
  - Compressed default copy, copied, and clear SVG paths without changing public customization props or slots.

## 1.5.0

### Minor Changes

- Vue/React/Svelte Upgrades:
  - Improved `PhoneInput` DOM structure across framework packages for more consistent styling, accessibility, and test coverage.
  - Added stable public CSS hooks: `.desource-phone-input` and `.desource-phone-dropdown`.
  - Preserved existing `.phone-input` and `.phone-dropdown` classes for backward compatibility.
  - Moved duplicated framework styles into a shared SCSS implementation and aligned CSS build output across Vue, React, and Svelte packages.
  - Improved screen reader live region styling and dropdown search autofill handling.
  - Added shared unit and e2e coverage for structure, ARIA attributes, dropdown placement, style scope markers, and visually hidden announcements.

- Nuxt Upgrades:
  - Updated styling documentation to use the new Vue package CSS hooks and current CSS variables.

## 1.4.1

### Patch Changes

- Core/Vue/React/Svelte/Nuxt Upgrades:
  - Made an internal tooling update
  - Updated development environment dependencies for better stability and security

## 1.4.0

### Minor Changes

- Core Upgrades:
  - Added `@desource/phone-mask/kit` subpath for formatter, handlers, services, utilities, and shared country selector helpers
  - Root `@desource/phone-mask` now focuses on country mask entries/data. Helper, formatter, handler, service, and utility imports should use `@desource/phone-mask/kit`
  - Added shared country selector DOM, positioning, keyboard, and focus helpers used by framework packages

- Vue/React/Svelte Upgrades:
  - Rebuilt the country selector dropdown with stable body-rendered fixed positioning using Portal/Teleport patterns
  - Improved dropdown UX across desktop and mobile: viewport-aware above/below placement, body-level rendering, outside-click close, Escape close, focus restore, search keyboard navigation, and empty-results keyboard safety
  - Improved dropdown accessibility semantics by exposing the selector popup as a searchable dialog with listbox options
  - Aligned country selector behavior and tests across React, Vue, and Svelte through shared common/core helpers

- React Upgrades:
  - Simplified internal memoization and callback usage where it reduced bundle/runtime overhead without changing behavior

- Svelte Upgrades:
  - Cleaned up event listener and attachment typings for newer Svelte/TypeScript tooling

## 1.3.1

### Patch Changes

- Core Upgrades:
  - Sync country masks with google-libphonenumber (🇸🇰 Slovakia updates)

## 1.3.0

### Minor Changes

- Core Upgrades:
  - Improved process keydown event handler for browser autocomplete cases

- Vue Upgrades:
  - Added new `@desource/phone-mask-vue/core` subpath export (direct core helpers re-export)
  - Root `PMaskHelpers` facade removed from index (helpers now via `/core` to reduce bundle size impact for Vue users)
  - Added `id` and `name` props on `PhoneInput`, passed to underlying `<input>` element for better form integration and accessibility
  - Added autofill style normalization (`-webkit-autofill` / `-moz-autofill`) for better visual consistency

- React Upgrades:
  - Added new `@desource/phone-mask-react/core` subpath export (direct core helpers re-export)
  - Root `PMaskHelpers` facade removed from index (helpers now via `/core` to reduce bundle size impact for React users)
  - Added `id` and `name` props on `PhoneInput`, passed to underlying `<input>` element for better form integration and accessibility
  - Added autofill style normalization (`-webkit-autofill` / `-moz-autofill`) for better visual consistency
  - `useCountrySelector`, `useClipboard` internals stabilized (deps/callback consistency improvements)
  - `usePhoneMask` callback dependency tuning for better stability

- Svelte Upgrades:
  - Added new `@desource/phone-mask-svelte/core` subpath export (direct core helpers re-export)
  - Root `PMaskHelpers` facade removed from index (helpers now via `/core` to reduce bundle size impact for Svelte users)
  - Added `id` and `name` props on `PhoneInput`, passed to underlying `<input>` element for better form integration and accessibility
  - Added autofill style normalization (`-webkit-autofill` / `-moz-autofill`) for better visual consistency

- Nuxt Upgrades:
  - Module options expanded and clarified:
    - `types` (default `true`): auto-import types from packages for TypeScript users
    - `helpers` (default `false`): auto-import core helpers for direct usage in Nuxt apps (optional due to potential bundle size impact)
    - new: `composable` (default `false`): auto-import Vue composable for custom phone mask logic (optional for users who only need more custom solution than the provided component/directive)
  - Default auto-imports now focus on component/directive/types; helpers/composable are opt-in
  - Runtime shared exports updated:
    - `usePhoneMask` (composable) is now a separate export from `phoneMaskDirective` and `PhoneInput` component for more flexible usage patterns
    - `PMaskHelpers` sourced via `@desource/phone-mask-vue/core` for better tree-shaking and bundle size control

## 1.2.0

### Minor Changes

- Core Upgrades:
  - Core metadata minification redesigned for better performance and reliability
  - Breaking changes (minor impact):
    - Core mask shape normalized: `mask` is now always `string[]` (no `string | string[]` union) across core types/exports
    - `toArray` removed from all packages
  - Formatter edge case fixed: countries with no mask variants are now handled safely (`maxDigits = 0` path)

## 1.1.2

### Patch Changes

- Vue/React/Svelte Upgrades:
  - Reduced package bundle size (optimized build output)
  - No API changes

## 1.1.1

### Patch Changes

- Core Upgrades:
  - Optimized bundle size of core package

## 1.1.0

### Minor Changes

- Svelte Upgrades:
  - Added attachment `phoneMaskAttachment` for usage in native input (for Svelte 5.29+ versions)
  - Added action `phoneMaskAction` for usage in native input (for Svelte 5.0+ versions)
  - Improved keyboard country selection flow and active-descendant accessibility behavior
  - Refined dropdown/key navigation handling and related focus behavior
  - `usePhoneMask` now exposes `formatter` in the return object

- Vue Upgrades:
  - Directive was refactored to align with Svelte action
  - Improved keyboard country selection flow and active-descendant accessibility behavior
  - Refined dropdown/key navigation handling and related focus behavior
  - `usePhoneMask` now exposes `formatter` in the return object

- React Upgrades:
  - Improved keyboard country selection flow and active-descendant accessibility behavior
  - Refined dropdown/key navigation handling and related focus behavior
  - `usePhoneMask` now exposes `formatter` in the return object

- Core Upgrades:
  - Fixed edge cases in mask variant selection and improved input handler robustness
  - Applied reliability-focused refactors in formatter/handlers and build script generation logic

## 1.0.0

### Major Changes

- Core Upgrades:
  - Refactored core architecture for better separation of concerns and reusability
  - Added zero-config browser script support path
  - Improved Intl.DisplayNames caching for performance
  - Fixed various edge cases in formatting and event handling
  - Added comprehensive unit tests for core utilities and handlers

- React Upgrades:
  - Major internal refactor to a controlled pattern with consistent hooks
  - Improved React 18/19 compatibility for ref behavior
  - Added and expanded unit/e2e tests for React components and behavior

- Vue Upgrades:
  - Refactored to align composable structure and reuse core utilities
  - Fixed directive behavior for external value updates and dropdown close logic
  - Added substantial unit/e2e test coverage for Vue composables and directive

- 🚀 Svelte Upgrades:
  - Introduced Svelte version of phone-mask library

- Nuxt Upgrades:
  - Added full test foundation with @nuxt/test-utils
  - Added unit tests for module and runtime behavior
  - Added e2e fixtures/tests and shared e2e utilities

## 0.3.0

### Minor Changes

- React: Design React version of phone-mask library
- Core: Add geoip reusable service for country detection based on IP address

## 0.2.3

### Patch Changes

- Vue: Improve country dropdown scroll

## 0.2.2

### Patch Changes

- Core: Sync country masks with google-libphonenumber (Morocco & Western Sahara updates)

## 0.2.1

### Patch Changes

- Nuxt: Improve install process of the package
- Vue: Improve locale init of PhoneMask

## 0.2.0

### Minor Changes

- Initial release of phone-mask monorepo packages
  - Core phone masking library with Google libphonenumber integration
  - Vue 3 component and directive for phone input
  - Nuxt module with zero-config setup
