feat(security,ui): self-host React deps, Tailwind, fonts; strict CSP; local QR; better selection state
Replace CDN React/ReactDOM/Babel with local libs; remove Babel and inline scripts Build Tailwind locally, add safelist; switch to assets/tailwind.css Self-host Font Awesome and Inter (CSS + woff2); remove external font CDNs Implement strict CSP (no unsafe-inline/eval; scripts/styles/fonts from self) Extract inline handlers; move PWA scripts to external files Add local QR code generation (qrcode lib) and remove api.qrserver.com Improve SessionTypeSelector visual selection (highlighted background and ring) Keep PWA working with service worker and offline assets Refs: CSP hardening, offline-first, no external dependencies
This commit is contained in:
22
node_modules/qrcode/lib/core/finder-pattern.js
generated
vendored
Normal file
22
node_modules/qrcode/lib/core/finder-pattern.js
generated
vendored
Normal file
@@ -0,0 +1,22 @@
|
||||
const getSymbolSize = require('./utils').getSymbolSize
|
||||
const FINDER_PATTERN_SIZE = 7
|
||||
|
||||
/**
|
||||
* Returns an array containing the positions of each finder pattern.
|
||||
* Each array's element represent the top-left point of the pattern as (x, y) coordinates
|
||||
*
|
||||
* @param {Number} version QR Code version
|
||||
* @return {Array} Array of coordinates
|
||||
*/
|
||||
exports.getPositions = function getPositions (version) {
|
||||
const size = getSymbolSize(version)
|
||||
|
||||
return [
|
||||
// top-left
|
||||
[0, 0],
|
||||
// top-right
|
||||
[size - FINDER_PATTERN_SIZE, 0],
|
||||
// bottom-left
|
||||
[0, size - FINDER_PATTERN_SIZE]
|
||||
]
|
||||
}
|
||||
Reference in New Issue
Block a user