@prosopo/puzzle-assets 0.2.0 → 0.2.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.
@@ -20,4 +20,4 @@ dist/cjs/notch.cjs 4.46 kB │ gzip: 1.81 kB
20
20
  dist/cjs/decoys.cjs 4.54 kB │ gzip: 1.94 kB
21
21
  dist/cjs/compose.cjs 10.60 kB │ gzip: 4.03 kB
22
22
 
23
- ✓ built in 53ms
23
+ ✓ built in 91ms
@@ -1,11 +1,11 @@
1
1
  $ tsc --build --verbose
2
- 1:37:11 PM - Projects in this build:
2
+ 4:43:32 PM - Projects in this build:
3
3
  * ../../dev/config/tsconfig.json
4
4
  * tsconfig.json
5
5
 
6
- 1:37:12 PM - Project '../../dev/config/tsconfig.json' is up to date because newest input '../../dev/config/src/webpack/webpack.config.ts' is older than output '../../dev/config/tsconfig.tsbuildinfo'
6
+ 4:43:32 PM - Project '../../dev/config/tsconfig.json' is up to date because newest input '../../dev/config/src/webpack/webpack.config.ts' is older than output '../../dev/config/tsconfig.tsbuildinfo'
7
7
 
8
- 1:37:12 PM - Project 'tsconfig.json' is out of date because output file 'tsconfig.tsbuildinfo' does not exist
8
+ 4:43:32 PM - Project 'tsconfig.json' is out of date because output file 'tsconfig.tsbuildinfo' does not exist
9
9
 
10
- 1:37:12 PM - Building project '/home/runner/work/captcha/captcha/packages/puzzle-assets/tsconfig.json'...
10
+ 4:43:32 PM - Building project '/home/runner/work/captcha/captcha/packages/puzzle-assets/tsconfig.json'...
11
11
 
@@ -22,4 +22,4 @@ dist/notch.js 4.41 kB │ gzip: 1.81 kB
22
22
  dist/decoys.js 4.50 kB │ gzip: 1.93 kB
23
23
  dist/compose.js 10.51 kB │ gzip: 4.01 kB
24
24
 
25
- ✓ built in 33ms
25
+ ✓ built in 79ms
package/CHANGELOG.md CHANGED
@@ -1,5 +1,29 @@
1
1
  # @prosopo/puzzle-assets
2
2
 
3
+ ## 0.2.2
4
+ ### Patch Changes
5
+
6
+ - 1f36456: Roll up the open Dependabot updates: 25 minor and patch bumps, sharp 0.35.5, pbkdf2 3.1.7, smoldot 3.6.0, and two GitHub Actions bumps.
7
+
8
+ Babel moves to 8. Its plugins and babel-loader move with it, because Babel 8 refuses to load v7 plugins. The import-attributes syntax plugin is gone: Babel 8 parses `with { type: "json" }` by default. The unused `@rollup/plugin-babel` is removed.
9
+
10
+ `@polkadot/types` and `@polkadot/types-codec` move to 17.0.2. Without that, `@polkadot/extension-*` 0.64 pulls in a second copy of the types and the widget packages stop typechecking.
11
+
12
+ ## 0.2.1
13
+ ### Patch Changes
14
+
15
+ - e13d7a8: New captcha type: `iconOrder`. The user is shown a frame of icons and a legend, and clicks the legend's icons in the order given.
16
+
17
+ Icon-order is off by default. Only Prosopo can switch it on for a site, with the `captchaTypeFeatureFlags.iconOrder` feature flag; the site owner cannot. A site without the flag is never served icon-order by any route, and the challenge endpoint refuses it. Once the flag is on, the owner can still keep icon-order out of the frictionless flow with `frictionlessTypes.iconOrder`, the same way as image and puzzle.
18
+
19
+ The answer never leaves the provider. Icon positions are stored on the challenge record, and the widget receives only the rendered frame and legend. Grading checks order as well as position, and each icon's hit radius scales with its size. Verifying a token is single-use under concurrent requests.
20
+
21
+ `@prosopo/icon-order-assets` draws the imagery, and `@prosopo/procaptcha-icon-order` is the widget. Its text is translated into every supported language.
22
+
23
+ Puzzle and icon-order now share their server code: challenge and solution handlers, the verify route, the submit and verify pipeline, and the database record methods. The widget code they have in common moves into `@prosopo/procaptcha-common`: the lazy mount wrapper, manager expiry and dispose, spent-session handling, behavioural data encryption and trusted click coordinates. Puzzle's behaviour is unchanged.
24
+
25
+ The demo playground has icon-order pages, and there is an end-to-end test for it.
26
+
3
27
  ## 0.2.0
4
28
  ### Minor Changes
5
29
 
package/dist/index.d.ts CHANGED
@@ -1,5 +1,6 @@
1
1
  import type { NotchPlacement, PuzzleGeometry, PuzzleRenderSettings, RenderedPuzzle, RgbaImage } from "./types.js";
2
2
  export { createPrng, createSeed, SEED_BYTES } from "./prng.js";
3
+ export type { Prng } from "./prng.js";
3
4
  export { generateBackground } from "./background.js";
4
5
  export { bestPairContrast, contrastRatio, relativeLuminance, simulateVision, worstCaseContrast, VISION_TYPES, type VisionType, } from "./contrast.js";
5
6
  export { MIN_PALETTE_CONTRAST, drawPalette, hslToRgb, type Rgb, } from "./palette.js";
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAoBA,OAAO,KAAK,EACX,cAAc,EACd,cAAc,EACd,oBAAoB,EACpB,cAAc,EACd,SAAS,EACT,MAAM,YAAY,CAAC;AAEpB,OAAO,EAAE,UAAU,EAAE,UAAU,EAAE,UAAU,EAAE,MAAM,WAAW,CAAC;AAC/D,OAAO,EAAE,kBAAkB,EAAE,MAAM,iBAAiB,CAAC;AACrD,OAAO,EACN,gBAAgB,EAChB,aAAa,EACb,iBAAiB,EACjB,cAAc,EACd,iBAAiB,EACjB,YAAY,EACZ,KAAK,UAAU,GACf,MAAM,eAAe,CAAC;AACvB,OAAO,EACN,oBAAoB,EACpB,WAAW,EACX,QAAQ,EACR,KAAK,GAAG,GACR,MAAM,cAAc,CAAC;AACtB,OAAO,EAAE,WAAW,EAAE,eAAe,EAAE,MAAM,aAAa,CAAC;AAC3D,OAAO,EACN,gBAAgB,EAChB,WAAW,EACX,SAAS,EACT,SAAS,GACT,MAAM,aAAa,CAAC;AACrB,YAAY,EACX,cAAc,EACd,cAAc,EACd,oBAAoB,EACpB,cAAc,EACd,SAAS,GACT,MAAM,YAAY,CAAC;AAOpB,eAAO,MAAM,gBAAgB,EAAE,cAI9B,CAAC;AAQF,eAAO,MAAM,uBAAuB,EAAE,oBAMrC,CAAC;AAQF,eAAO,MAAM,gBAAgB,cAClB,cAAc,SAClB,MAAM,KACV,SACmE,CAAC;AAOvE,eAAO,MAAM,YAAY,eACZ,SAAS,aACV,cAAc,aACf,cAAc,aACd,oBAAoB,SACxB,MA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AAC;IAEH,OAAO;QACN,UAAU,EAAE,cAAc;QAC1B,KAAK,EAAE,SAAS;QAChB,SAAS;QACT,IAAI;KACJ,CAAC;AACH,CAAC,CAAC;AASF,MAAM,CAAC,MAAM,YAAY,GAAG,KAAK,EAChC,SAAyB,EACzB,WAA2B,gBAAgB,EAC3C,WAAiC,uBAAuB,EACxD,iBAAyB,UAAU,EAAE,EACrC,aAAqB,UAAU,EAAE,EACP,EAAE,CAC5B,YAAY,CACX,gBAAgB,CAAC,QAAQ,EAAE,cAAc,CAAC,EAC1C,SAAS,EACT,QAAQ,EACR,QAAQ,EACR,UAAU,CACV,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@prosopo/puzzle-assets",
3
- "version": "0.2.0",
3
+ "version": "0.2.2",
4
4
  "description": "Procedural imagery for the slider puzzle captcha",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
@@ -32,10 +32,10 @@
32
32
  },
33
33
  "homepage": "https://github.com/prosopo/captcha#readme",
34
34
  "dependencies": {
35
- "sharp": "0.35.4"
35
+ "sharp": "0.35.5"
36
36
  },
37
37
  "devDependencies": {
38
- "@prosopo/config": "3.4.3",
38
+ "@prosopo/config": "3.4.4",
39
39
  "@types/node": "22.10.2",
40
40
  "@vitest/coverage-v8": "4.1.11",
41
41
  "del-cli": "6.0.0",