Skip to content

Commit 3bdd1a5

Browse files
committed
build: v1.0.12 (Zion Protocol)
1 parent 88f2ff2 commit 3bdd1a5

13 files changed

Lines changed: 99 additions & 29 deletions

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ npm install @codecorn/euro-plate-validator
6060
### Client SDK (UI)
6161

6262
- **ESM**
63-
`https://cdn.jsdelivr.net/npm/@codecorn/euro-plate-validator@1.0.12/dist/client/europlate.client.mjs`
63+
`https://cdn.jsdelivr.net/npm/@codecorn/euro-plate-validator@1.0.12/dist/client/index.mjs`
6464

6565
- **CJS (Node)**
6666
`https://cdn.jsdelivr.net/npm/@codecorn/euro-plate-validator@1.0.12/dist/client/europlate.client.cjs`
@@ -159,7 +159,7 @@ type EuroPlateInstance = {
159159

160160
<script type="module">
161161
import * as EuroMod from "https://cdn.jsdelivr.net/npm/@codecorn/euro-plate-validator@1.0.12/dist/browser/index.esm.js";
162-
import { createEuroPlate } from "https://cdn.jsdelivr.net/npm/@codecorn/euro-plate-validator@1.0.12/dist/client/europlate.client.mjs";
162+
import { createEuroPlate } from "https://cdn.jsdelivr.net/npm/@codecorn/euro-plate-validator@1.0.12/dist/client/index.mjs";
163163
164164
createEuroPlate(EuroMod, {
165165
wrapper: "#plateBox",

README_IT.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ npm install @codecorn/euro-plate-validator
6060
### Client SDK (UI)
6161

6262
- **ESM**
63-
`https://cdn.jsdelivr.net/npm/@codecorn/euro-plate-validator@1.0.12/dist/client/europlate.client.mjs`
63+
`https://cdn.jsdelivr.net/npm/@codecorn/euro-plate-validator@1.0.12/dist/client/index.mjs`
6464

6565
- **CJS (Node)**
6666
`https://cdn.jsdelivr.net/npm/@codecorn/euro-plate-validator@1.0.12/dist/client/europlate.client.cjs`
@@ -160,7 +160,7 @@ type EuroPlateInstance = {
160160

161161
<script type="module">
162162
import * as EuroMod from "https://cdn.jsdelivr.net/npm/@codecorn/euro-plate-validator@1.0.12/dist/browser/index.esm.js";
163-
import { createEuroPlate } from "https://cdn.jsdelivr.net/npm/@codecorn/euro-plate-validator@1.0.12/dist/client/europlate.client.mjs";
163+
import { createEuroPlate } from "https://cdn.jsdelivr.net/npm/@codecorn/euro-plate-validator@1.0.12/dist/client/index.mjs";
164164
165165
createEuroPlate(EuroMod, {
166166
wrapper: "#plateBox",
@@ -178,7 +178,7 @@ type EuroPlateInstance = {
178178
```html
179179
<script type="module">
180180
import * as EuroMod from "https://cdn.jsdelivr.net/npm/@codecorn/euro-plate-validator@1.0.12/dist/browser/index.esm.js";
181-
import { createEuroPlate } from "https://cdn.jsdelivr.net/npm/@codecorn/euro-plate-validator@1.0.12/dist/client/europlate.client.mjs";
181+
import { createEuroPlate } from "https://cdn.jsdelivr.net/npm/@codecorn/euro-plate-validator@1.0.12/dist/client/index.mjs";
182182
183183
createEuroPlate(EuroMod, {
184184
wrapper: "#plateBox",
@@ -213,7 +213,7 @@ createEuroPlate(EuroMod, {
213213
<input id="myPlate" />
214214
<script type="module">
215215
import * as EuroMod from ".../index.esm.js";
216-
import { createEuroPlate } from ".../europlate.client.mjs";
216+
import { createEuroPlate } from ".../index.mjs";
217217
218218
createEuroPlate(EuroMod, {
219219
input: document.getElementById("myPlate"),
@@ -247,7 +247,7 @@ add_action('wp_enqueue_scripts', function () {
247247
if ($handle === 'epv-init') {
248248
return '<script type="module">' .
249249
'import * as EuroMod from "https://cdn.jsdelivr.net/npm/@codecorn/euro-plate-validator@1.0.12/dist/browser/index.esm.js";' .
250-
'import { createEuroPlate } from "https://cdn.jsdelivr.net/npm/@codecorn/euro-plate-validator@1.0.12/dist/client/europlate.client.mjs";' .
250+
'import { createEuroPlate } from "https://cdn.jsdelivr.net/npm/@codecorn/euro-plate-validator@1.0.12/dist/client/index.mjs";' .
251251
'window.__epvInit=(id,opts)=>createEuroPlate(EuroMod,Object.assign({wrapper:"#"+id,mode:"AUTO",i18n:"IT",debug:true,autoFocusOnInit:false},opts||{}));' .
252252
'</script>';
253253
}

dist-types/client/europlate.client.d.ts

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,17 @@
1-
type Lang = "it" | "en";
1+
/** Lingue supportate dall’SDK. */
22
export type I18nCode = "AUTO" | "IT" | "EN";
3+
/** Tipi veicolo supportati dal validatore. */
34
export type VehicleType = "any" | "car" | "bike";
5+
/** Interfaccia logger esterno compatibile. */
46
export type Logger = {
57
debug?: (...a: any[]) => void;
68
info?: (...a: any[]) => void;
79
warn?: (...a: any[]) => void;
810
error?: (...a: any[]) => void;
11+
/** Tipo libero lato SDK; verrà normalizzato lato toastr. */
912
notify?: (msg: string, type?: string) => void;
1013
};
14+
/** Riferimenti UI opzionali (se non si usa `wrapper`). */
1115
export type EuroPlateUI = {
1216
flagIcon?: HTMLElement;
1317
flagLabel?: HTMLElement;
@@ -68,7 +72,7 @@ export type EuroPlateOptions = {
6872
normalize?: (code: string) => string;
6973
/** Formatter per country code (applicato a input/paste). */
7074
formatters?: Record<string, (s: string) => string>;
71-
/** Timing UI: debounce applicazione mask e clear. @default {debounce:80, clear:60} */
75+
/** Timing UI: debounce applicazione mask e clear. @default {debounce:80,clear:60} */
7276
timings?: {
7377
debounce?: number;
7478
clear?: number;
@@ -82,7 +86,7 @@ export type EuroPlateOptions = {
8286
inputmask?: any;
8387
};
8488
/** Flag di autoload per dipendenze esterne.
85-
* @default { inputmask:true, jquery:false, toastr:false }
89+
* @default {inputmask:true,jquery:false,toastr:false}
8690
*/
8791
autoLoadDeps?: {
8892
inputmask?: boolean;
@@ -144,7 +148,6 @@ export type EuroPlateInstance = {
144148
* @throws Error se wrapper/input non trovati o `EuroMod` incompleto
145149
*/
146150
export declare function createEuroPlate(EuroMod: any, opts: EuroPlateOptions): EuroPlateInstance;
147-
export {};
148151
/**
149152
* Wrapper DOM
150153
* - A runtime, se `wrapper` è fornito, viene generata la struttura:

dist-types/client/europlate.client.d.ts.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist-types/client/index.d.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
export type { I18nCode, VehicleType, Logger, EuroPlateUI, EuroPlateOptions, EuroPlateInstance, } from "./europlate.client.js";
2+
export { createEuroPlate } from "./europlate.client.js";
3+
//# sourceMappingURL=index.d.ts.map

dist-types/client/index.d.ts.map

Lines changed: 1 addition & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package-lock.json

Lines changed: 12 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -45,9 +45,9 @@
4545
"default": "./dist/index.js"
4646
},
4747
"./client": {
48-
"types": "./dist-types/client/europlate.client.d.ts",
49-
"import": "./dist/client/europlate.client.mjs",
50-
"require": "./dist/client/europlate.client.cjs"
48+
"types": "./dist-types/client/index.d.ts",
49+
"import": "./dist/client/index.mjs",
50+
"require": "./dist/client/index.cjs"
5151
},
5252
"./browser": {
5353
"import": "./dist/browser/index.esm.js",
@@ -94,9 +94,9 @@
9494
"build:browser:esm": "esbuild src/index.ts --bundle --platform=browser --format=esm --sourcemap --outfile=dist/browser/index.esm.js",
9595
"build:browser:esm:min": "esbuild src/index.ts --bundle --platform=browser --format=esm --minify --sourcemap --outfile=dist/browser/index.esm.min.js",
9696
"build:browser:iife": "esbuild src/index.ts --bundle --platform=browser --format=iife --global-name=EuroPlateValidator --minify --outfile=dist/browser/index.iife.min.js",
97-
"build:client:esm": "esbuild src/client/europlate.client.ts --bundle --platform=browser --format=esm --sourcemap --outfile=dist/client/europlate.client.mjs",
98-
"build:client:esm:min": "esbuild src/client/europlate.client.ts --bundle --platform=browser --format=esm --minify --sourcemap --outfile=dist/client/europlate.client.min.mjs",
99-
"build:client:cjs": "esbuild src/client/europlate.client.ts --bundle --platform=node --format=cjs --sourcemap --outfile=dist/client/europlate.client.cjs",
97+
"build:client:esm": "esbuild src/client/index.ts --bundle --platform=browser --format=esm --sourcemap --outfile=dist/client/index.mjs",
98+
"build:client:esm:min": "esbuild src/client/index.ts --bundle --platform=browser --format=esm --minify --sourcemap --outfile=dist/client/index.min.mjs",
99+
"build:client:cjs": "esbuild src/client/index.ts --bundle --platform=node --format=cjs --sourcemap --outfile=dist/client/index.cjs",
100100
"build:cli": "esbuild src/cli.ts --bundle --platform=node --format=esm --sourcemap --outfile=dist/cli.mjs",
101101
"build:browser": "npm run build:browser:esm && npm run build:browser:iife",
102102
"build:client": "npm run build:client:esm && npm run build:client:cjs",
@@ -123,7 +123,8 @@
123123
"prettier": "3.6.2",
124124
"rimraf": "6.0.1",
125125
"tslib": "2.8.1",
126-
"typescript": "^5.9.3"
126+
"typescript": "^5.9.3",
127+
"undici-types": "7.16.0"
127128
},
128129
"peerDependencies": {
129130
"inputmask": ">=5"

src/assets/css/epv.css

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,13 @@
88
display: flex;
99
flex-direction: column;
1010
align-items: stretch;
11+
/* assicura che eventuali overlay non vengano tagliati */
12+
overflow: visible;
1113
}
1214

1315
/* --- Contenitore interno (flag + input + dropdown) --- */
1416
.plate-epv {
17+
position: relative; /* 👈 dropdown assoluto ancorato qui */
1518
display: flex;
1619
align-items: center;
1720
gap: 8px;
@@ -26,19 +29,20 @@
2629

2730
/* --- Input targa --- */
2831
.plate-input {
29-
flex: 1;
32+
flex: 1 1 auto;
33+
min-width: 0; /* 👈 importante in flex per evitare overflow */
3034
border: none;
3135
outline: none;
3236
font-size: 1rem;
3337
background: transparent;
3438
letter-spacing: 0.5px;
35-
/* TODO: width fissa o min-width? */
36-
width: 30%;
39+
3740
}
3841

3942
/* --- Bottone bandiera --- */
4043
.flag-btn {
4144
display: flex;
45+
position: relative;
4246
align-items: center;
4347
gap: 6px;
4448
background: none;
@@ -81,9 +85,11 @@
8185
.dropdown {
8286
position: absolute;
8387
z-index: 9999;
84-
left: 6px;
85-
width: 320px;
86-
max-height: 280px;
88+
top: calc(100% + 6px); /* 👈 esci sotto al box */
89+
left: 0; /* 👈 allinea al bordo sinistro del container */
90+
min-width: max(280px, 100%); /* 👈 almeno 280px, ma non più stretto del box */
91+
max-height: 320px;
92+
right: auto;
8793
overflow: auto;
8894
background: #fff;
8995
border: 1px solid #e5e7eb;

src/client/globals.d.ts

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
// src/client/globals.d.ts
2+
import type { JQueryStatic } from "jquery";
3+
import type { Toastr } from "toastr";
4+
5+
declare global {
6+
interface Window {
7+
jQuery?: JQueryStatic;
8+
$?: JQueryStatic;
9+
toastr?: Toastr;
10+
Inputmask?: typeof import("inputmask");
11+
__CSP_NONCE__?: string;
12+
}
13+
}
14+
export {};
15+
// Se preferisci usare `window` invece di `globalThis`, decommenta la riga seguente
16+
//declare var window: Window;

0 commit comments

Comments
 (0)