telpick 1.0.1 → 1.0.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.

Potentially problematic release.


This version of telpick might be problematic. Click here for more details.

package/README.es.md CHANGED
@@ -8,6 +8,12 @@ Selector de país y código telefónico multiplataforma con diseño moderno y an
8
8
 
9
9
  [English](README.md) | **Español**
10
10
 
11
+ ## Probar la demo
12
+
13
+ Puedes probar la demo interactiva en línea:
14
+
15
+ **[→ Abrir demo (GitHub Pages)](https://julioalmirooficial.github.io/telpick/)**
16
+
11
17
  ## Características
12
18
 
13
19
  - Diseño moderno con animaciones suaves
package/README.md CHANGED
@@ -8,6 +8,12 @@ Multi-platform country and phone code selector with a modern design, smooth anim
8
8
 
9
9
  **English** | [Español](README.es.md)
10
10
 
11
+ ## Try the demo
12
+
13
+ You can try the interactive demo online:
14
+
15
+ **[→ Open demo (GitHub Pages)](https://julioalmirooficial.github.io/telpick/)**
16
+
11
17
  ## Features
12
18
 
13
19
  - Modern design with smooth animations
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "telpick",
3
- "version": "1.0.1",
3
+ "version": "1.0.2",
4
4
  "description": "Multi-platform country and phone code selector with a modern design, smooth animations, and automatic IP detection.",
5
5
  "main": "dist/telpick.umd.js",
6
6
  "module": "dist/telpick.esm.js",
@@ -34,6 +34,8 @@
34
34
  ],
35
35
  "scripts": {
36
36
  "build": "vite build",
37
+ "build:demo": "vite build --config vite.config.demo.js",
38
+ "deploy:demo": "npm run build:demo && gh-pages -d docs",
37
39
  "dev": "vite",
38
40
  "prepublishOnly": "npm run build",
39
41
  "test": "jest"
@@ -81,6 +83,7 @@
81
83
  }
82
84
  },
83
85
  "devDependencies": {
86
+ "gh-pages": "^6.1.1",
84
87
  "vite": "^4.0.0",
85
88
  "typescript": "^5.0.0",
86
89
  "vue": "^3.0.0",
@@ -0,0 +1,34 @@
1
+ /**
2
+ * Demo init: carga Telpick y monta el Interactive Demo.
3
+ * Así Telpick está disponible cuando se ejecuta el init (evita race con el script inline).
4
+ */
5
+ import Telpick from './telpick.js'
6
+
7
+ window.Telpick = Telpick
8
+
9
+ function initDemo() {
10
+ const container = document.getElementById('telpick-container')
11
+ if (!container) return
12
+
13
+ const telpick = new Telpick({
14
+ code: null,
15
+ onChange: (country) => {
16
+ const infoEl = document.getElementById('selected-info')
17
+ if (infoEl) {
18
+ document.getElementById('selected-code').textContent = country.code
19
+ document.getElementById('selected-country').textContent = country.country
20
+ document.getElementById('selected-phone').textContent = country.code
21
+ document.getElementById('selected-iso').textContent = country.country_code
22
+ infoEl.classList.add('active')
23
+ }
24
+ },
25
+ styleOverrides: {}
26
+ })
27
+ telpick.init(container)
28
+ }
29
+
30
+ if (document.readyState === 'loading') {
31
+ document.addEventListener('DOMContentLoaded', initDemo)
32
+ } else {
33
+ initDemo()
34
+ }