altcha 2.3.0 → 3.0.0-beta.1
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.
- package/LICENSE.txt +1 -1
- package/README.md +149 -204
- package/dist/external/altcha.css +1 -0
- package/dist/external/altcha.js +6681 -0
- package/dist/external/altcha.min.js +1 -0
- package/dist/external/altcha.umd.cjs +6687 -0
- package/dist/external/altcha.umd.min.cjs +1 -0
- package/dist/external/index.d.ts +1 -0
- package/dist/i18n/419.d.ts +1 -0
- package/dist/i18n/af.d.ts +1 -0
- package/dist/i18n/af.js +22 -0
- package/dist/i18n/af.umd.cjs +27 -0
- package/dist/i18n/africa.d.ts +1 -0
- package/{dist_i18n → dist/i18n}/africa.js +52 -97
- package/dist/i18n/africa.umd.cjs +159 -0
- package/dist/i18n/all.d.ts +1 -0
- package/{dist_i18n → dist/i18n}/all.js +465 -299
- package/dist/i18n/all.umd.cjs +1325 -0
- package/dist/i18n/am.d.ts +1 -0
- package/dist/i18n/am.js +22 -0
- package/dist/i18n/am.umd.cjs +27 -0
- package/dist/i18n/americas.d.ts +1 -0
- package/{dist_i18n → dist/i18n}/americas.js +24 -85
- package/dist/i18n/americas.umd.cjs +71 -0
- package/dist/i18n/ar.d.ts +1 -0
- package/dist/i18n/ar.js +22 -0
- package/dist/i18n/ar.umd.cjs +27 -0
- package/dist/i18n/asia.d.ts +1 -0
- package/{dist_i18n → dist/i18n}/asia.js +177 -158
- package/dist/i18n/asia.umd.cjs +511 -0
- package/dist/i18n/az.d.ts +1 -0
- package/dist/i18n/az.js +22 -0
- package/dist/i18n/az.umd.cjs +27 -0
- package/dist/i18n/be.d.ts +1 -0
- package/dist/i18n/be.js +22 -0
- package/dist/i18n/be.umd.cjs +27 -0
- package/dist/i18n/bg.d.ts +1 -0
- package/dist/i18n/bg.js +22 -0
- package/dist/i18n/bg.umd.cjs +27 -0
- package/dist/i18n/bn.d.ts +1 -0
- package/dist/i18n/bn.js +22 -0
- package/dist/i18n/bn.umd.cjs +27 -0
- package/dist/i18n/br.d.ts +1 -0
- package/dist/i18n/bs.d.ts +1 -0
- package/dist/i18n/bs.js +22 -0
- package/dist/i18n/bs.umd.cjs +27 -0
- package/dist/i18n/ca.d.ts +1 -0
- package/dist/i18n/ca.js +22 -0
- package/dist/i18n/ca.umd.cjs +27 -0
- package/dist/i18n/cn.d.ts +1 -0
- package/dist/i18n/cs.d.ts +1 -0
- package/dist/i18n/cs.js +22 -0
- package/dist/i18n/cs.umd.cjs +27 -0
- package/dist/i18n/da.d.ts +1 -0
- package/dist/i18n/da.js +22 -0
- package/dist/i18n/da.umd.cjs +27 -0
- package/dist/i18n/de.d.ts +1 -0
- package/dist/i18n/de.js +22 -0
- package/dist/i18n/de.umd.cjs +27 -0
- package/dist/i18n/el.d.ts +1 -0
- package/dist/i18n/el.js +22 -0
- package/dist/i18n/el.umd.cjs +27 -0
- package/dist/i18n/en.d.ts +1 -0
- package/dist/i18n/en.js +22 -0
- package/dist/i18n/en.umd.cjs +27 -0
- package/dist/i18n/es-419.js +22 -0
- package/dist/i18n/es-419.umd.cjs +27 -0
- package/dist/i18n/es-es.js +22 -0
- package/dist/i18n/es-es.umd.cjs +27 -0
- package/dist/i18n/es.d.ts +1 -0
- package/dist/i18n/et.d.ts +1 -0
- package/dist/i18n/et.js +22 -0
- package/dist/i18n/et.umd.cjs +27 -0
- package/dist/i18n/eu.d.ts +1 -0
- package/dist/i18n/eu.js +22 -0
- package/dist/i18n/eu.umd.cjs +27 -0
- package/dist/i18n/europe.d.ts +1 -0
- package/{dist_i18n → dist/i18n}/europe.js +283 -209
- package/dist/i18n/europe.umd.cjs +819 -0
- package/dist/i18n/fa.d.ts +1 -0
- package/dist/i18n/fa.js +22 -0
- package/dist/i18n/fa.umd.cjs +27 -0
- package/dist/i18n/fi.d.ts +1 -0
- package/dist/i18n/fi.js +22 -0
- package/dist/i18n/fi.umd.cjs +27 -0
- package/dist/i18n/fr-ca.js +22 -0
- package/dist/i18n/fr-ca.umd.cjs +27 -0
- package/dist/i18n/fr-fr.js +22 -0
- package/dist/i18n/fr-fr.umd.cjs +27 -0
- package/dist/i18n/fr.d.ts +1 -0
- package/dist/i18n/ga.d.ts +1 -0
- package/dist/i18n/ga.js +22 -0
- package/dist/i18n/ga.umd.cjs +27 -0
- package/dist/i18n/he.d.ts +1 -0
- package/dist/i18n/he.js +22 -0
- package/dist/i18n/he.umd.cjs +27 -0
- package/dist/i18n/hi.d.ts +1 -0
- package/dist/i18n/hi.js +22 -0
- package/dist/i18n/hi.umd.cjs +27 -0
- package/dist/i18n/hr.d.ts +1 -0
- package/dist/i18n/hr.js +22 -0
- package/dist/i18n/hr.umd.cjs +27 -0
- package/dist/i18n/hu.d.ts +1 -0
- package/dist/i18n/hu.js +22 -0
- package/dist/i18n/hu.umd.cjs +27 -0
- package/dist/i18n/hy.d.ts +1 -0
- package/dist/i18n/hy.js +22 -0
- package/dist/i18n/hy.umd.cjs +27 -0
- package/dist/i18n/id.d.ts +1 -0
- package/dist/i18n/id.js +22 -0
- package/dist/i18n/id.umd.cjs +27 -0
- package/dist/i18n/is.d.ts +1 -0
- package/dist/i18n/is.js +22 -0
- package/dist/i18n/is.umd.cjs +27 -0
- package/dist/i18n/it.d.ts +1 -0
- package/dist/i18n/it.js +22 -0
- package/dist/i18n/it.umd.cjs +27 -0
- package/dist/i18n/ja.d.ts +1 -0
- package/dist/i18n/ja.js +22 -0
- package/dist/i18n/ja.umd.cjs +27 -0
- package/dist/i18n/ka.d.ts +1 -0
- package/dist/i18n/ka.js +22 -0
- package/dist/i18n/ka.umd.cjs +27 -0
- package/dist/i18n/kk.d.ts +1 -0
- package/dist/i18n/kk.js +22 -0
- package/dist/i18n/kk.umd.cjs +27 -0
- package/dist/i18n/ko.d.ts +1 -0
- package/dist/i18n/ko.js +22 -0
- package/dist/i18n/ko.umd.cjs +27 -0
- package/dist/i18n/lb.d.ts +1 -0
- package/dist/i18n/lb.js +22 -0
- package/dist/i18n/lb.umd.cjs +27 -0
- package/dist/i18n/lt.d.ts +1 -0
- package/dist/i18n/lt.js +22 -0
- package/dist/i18n/lt.umd.cjs +27 -0
- package/dist/i18n/lv.d.ts +1 -0
- package/dist/i18n/lv.js +22 -0
- package/dist/i18n/lv.umd.cjs +27 -0
- package/dist/i18n/me.d.ts +1 -0
- package/dist/i18n/me.js +22 -0
- package/dist/i18n/me.umd.cjs +27 -0
- package/dist/i18n/mk.d.ts +1 -0
- package/dist/i18n/mk.js +22 -0
- package/dist/i18n/mk.umd.cjs +27 -0
- package/dist/i18n/mr.d.ts +1 -0
- package/dist/i18n/mr.js +22 -0
- package/dist/i18n/mr.umd.cjs +27 -0
- package/dist/i18n/mt.d.ts +1 -0
- package/dist/i18n/mt.js +22 -0
- package/dist/i18n/mt.umd.cjs +27 -0
- package/dist/i18n/nb.d.ts +1 -0
- package/dist/i18n/nb.js +22 -0
- package/dist/i18n/nb.umd.cjs +27 -0
- package/dist/i18n/nl.d.ts +1 -0
- package/dist/i18n/nl.js +22 -0
- package/dist/i18n/nl.umd.cjs +27 -0
- package/dist/i18n/pl.d.ts +1 -0
- package/dist/i18n/pl.js +22 -0
- package/dist/i18n/pl.umd.cjs +27 -0
- package/dist/i18n/pt-br.js +22 -0
- package/dist/i18n/pt-br.umd.cjs +27 -0
- package/dist/i18n/pt-pt.js +22 -0
- package/dist/i18n/pt-pt.umd.cjs +27 -0
- package/dist/i18n/pt.d.ts +1 -0
- package/dist/i18n/ro.d.ts +1 -0
- package/dist/i18n/ro.js +22 -0
- package/dist/i18n/ro.umd.cjs +27 -0
- package/dist/i18n/ru.d.ts +1 -0
- package/dist/i18n/ru.js +22 -0
- package/dist/i18n/ru.umd.cjs +27 -0
- package/dist/i18n/sk.d.ts +1 -0
- package/dist/i18n/sk.js +22 -0
- package/dist/i18n/sk.umd.cjs +27 -0
- package/dist/i18n/sl.d.ts +1 -0
- package/dist/i18n/sl.js +22 -0
- package/dist/i18n/sl.umd.cjs +27 -0
- package/dist/i18n/sq.d.ts +1 -0
- package/dist/i18n/sq.js +22 -0
- package/dist/i18n/sq.umd.cjs +27 -0
- package/dist/i18n/sr.d.ts +1 -0
- package/dist/i18n/sr.js +22 -0
- package/dist/i18n/sr.umd.cjs +27 -0
- package/dist/i18n/sv.d.ts +1 -0
- package/dist/i18n/sv.js +22 -0
- package/dist/i18n/sv.umd.cjs +27 -0
- package/dist/i18n/sw.d.ts +1 -0
- package/dist/i18n/sw.js +22 -0
- package/dist/i18n/sw.umd.cjs +27 -0
- package/dist/i18n/ta.d.ts +1 -0
- package/dist/i18n/ta.js +22 -0
- package/dist/i18n/ta.umd.cjs +27 -0
- package/dist/i18n/te.d.ts +1 -0
- package/dist/i18n/te.js +22 -0
- package/dist/i18n/te.umd.cjs +27 -0
- package/dist/i18n/th.d.ts +1 -0
- package/dist/i18n/th.js +22 -0
- package/dist/i18n/th.umd.cjs +27 -0
- package/dist/i18n/tk.d.ts +1 -0
- package/dist/i18n/tk.js +22 -0
- package/dist/i18n/tk.umd.cjs +27 -0
- package/dist/i18n/tr.d.ts +1 -0
- package/dist/i18n/tr.js +22 -0
- package/dist/i18n/tr.umd.cjs +27 -0
- package/dist/i18n/tw.d.ts +1 -0
- package/dist/i18n/uk.d.ts +1 -0
- package/dist/i18n/uk.js +22 -0
- package/dist/i18n/uk.umd.cjs +27 -0
- package/dist/i18n/ur.d.ts +1 -0
- package/dist/i18n/ur.js +22 -0
- package/dist/i18n/ur.umd.cjs +27 -0
- package/dist/i18n/uz.d.ts +1 -0
- package/dist/i18n/uz.js +22 -0
- package/dist/i18n/uz.umd.cjs +27 -0
- package/dist/i18n/vi.d.ts +1 -0
- package/dist/i18n/vi.js +22 -0
- package/dist/i18n/vi.umd.cjs +27 -0
- package/dist/i18n/yo.d.ts +1 -0
- package/dist/i18n/yo.js +22 -0
- package/dist/i18n/yo.umd.cjs +27 -0
- package/dist/i18n/zh-cn.js +22 -0
- package/dist/i18n/zh-cn.umd.cjs +27 -0
- package/dist/i18n/zh-tw.js +22 -0
- package/dist/i18n/zh-tw.umd.cjs +27 -0
- package/dist/lib/index.d.ts +143 -0
- package/dist/lib/index.js +1344 -0
- package/dist/lib/index.min.js +1 -0
- package/dist/lib/index.umd.cjs +1348 -0
- package/dist/lib/index.umd.min.cjs +1 -0
- package/dist/main/altcha.i18n.js +8389 -0
- package/dist/main/altcha.i18n.min.js +1 -0
- package/dist/main/altcha.i18n.umd.cjs +8392 -0
- package/dist/main/altcha.i18n.umd.min.cjs +1 -0
- package/dist/main/altcha.js +7069 -0
- package/dist/main/altcha.min.js +1 -0
- package/dist/main/altcha.umd.cjs +7072 -0
- package/dist/main/altcha.umd.min.cjs +1 -0
- package/dist/plugins/obfuscation.plugin.d.ts +1 -0
- package/dist/plugins/obfuscation.plugin.js +320 -0
- package/dist/plugins/obfuscation.plugin.min.js +1 -0
- package/dist/plugins/obfuscation.plugin.umd.cjs +325 -0
- package/dist/plugins/obfuscation.plugin.umd.min.cjs +1 -0
- package/dist/themes/aqua.css +19 -0
- package/dist/themes/aqua.min.css +1 -0
- package/dist/themes/business.css +15 -0
- package/dist/themes/business.min.css +1 -0
- package/dist/themes/caramel.css +19 -0
- package/dist/themes/caramel.min.css +1 -0
- package/dist/themes/cupcake.css +16 -0
- package/dist/themes/cupcake.min.css +1 -0
- package/dist/themes/cyberpunk.css +24 -0
- package/dist/themes/cyberpunk.min.css +1 -0
- package/dist/themes/lime.css +13 -0
- package/dist/themes/lime.min.css +1 -0
- package/dist/themes/wireframe.css +17 -0
- package/dist/themes/wireframe.min.css +1 -0
- package/dist/types/generic.d.ts +25 -0
- package/dist/types/generic.js +1 -0
- package/dist/types/global.d.ts +5 -0
- package/dist/types/global.js +1 -0
- package/dist/types/index.d.ts +352 -0
- package/dist/types/index.js +23 -0
- package/dist/types/jsx.d.ts +13 -0
- package/dist/types/jsx.js +1 -0
- package/dist/types/react.d.ts +35 -0
- package/dist/types/react.js +1 -0
- package/dist/types/svelte.d.ts +26 -0
- package/dist/types/svelte.js +1 -0
- package/dist/workers/argon2id.js +786 -0
- package/dist/workers/pbkdf2.js +166 -0
- package/dist/workers/scrypt.js +739 -0
- package/dist/workers/sha.js +160 -0
- package/package.json +115 -81
- package/dist/altcha.d.ts +0 -183
- package/dist/altcha.i18n.d.ts +0 -183
- package/dist/altcha.i18n.js +0 -4182
- package/dist/altcha.i18n.umd.js +0 -4
- package/dist/altcha.js +0 -3105
- package/dist/altcha.umd.cjs +0 -4
- package/dist_external/altcha.css +0 -1
- package/dist_external/altcha.d.ts +0 -183
- package/dist_external/altcha.js +0 -3075
- package/dist_external/altcha.umd.cjs +0 -3
- package/dist_external/worker.js +0 -1
- package/dist_i18n/af.d.ts +0 -1
- package/dist_i18n/af.js +0 -94
- package/dist_i18n/af.umd.cjs +0 -1
- package/dist_i18n/africa.d.ts +0 -1
- package/dist_i18n/africa.umd.cjs +0 -1
- package/dist_i18n/all.d.ts +0 -1
- package/dist_i18n/all.umd.cjs +0 -1
- package/dist_i18n/am.d.ts +0 -1
- package/dist_i18n/am.js +0 -94
- package/dist_i18n/am.umd.cjs +0 -1
- package/dist_i18n/americas.d.ts +0 -1
- package/dist_i18n/americas.umd.cjs +0 -1
- package/dist_i18n/ar.d.ts +0 -1
- package/dist_i18n/ar.js +0 -94
- package/dist_i18n/ar.umd.cjs +0 -1
- package/dist_i18n/asia.d.ts +0 -1
- package/dist_i18n/asia.umd.cjs +0 -1
- package/dist_i18n/az.d.ts +0 -1
- package/dist_i18n/az.js +0 -94
- package/dist_i18n/az.umd.cjs +0 -1
- package/dist_i18n/be.d.ts +0 -1
- package/dist_i18n/be.js +0 -94
- package/dist_i18n/be.umd.cjs +0 -1
- package/dist_i18n/bg.d.ts +0 -1
- package/dist_i18n/bg.js +0 -94
- package/dist_i18n/bg.umd.cjs +0 -1
- package/dist_i18n/bn.d.ts +0 -1
- package/dist_i18n/bn.js +0 -94
- package/dist_i18n/bn.umd.cjs +0 -1
- package/dist_i18n/bs.d.ts +0 -1
- package/dist_i18n/bs.js +0 -94
- package/dist_i18n/bs.umd.cjs +0 -1
- package/dist_i18n/ca.d.ts +0 -1
- package/dist_i18n/ca.js +0 -94
- package/dist_i18n/ca.umd.cjs +0 -1
- package/dist_i18n/cs.d.ts +0 -1
- package/dist_i18n/cs.js +0 -94
- package/dist_i18n/cs.umd.cjs +0 -1
- package/dist_i18n/da.d.ts +0 -1
- package/dist_i18n/da.js +0 -94
- package/dist_i18n/da.umd.cjs +0 -1
- package/dist_i18n/de.d.ts +0 -1
- package/dist_i18n/de.js +0 -94
- package/dist_i18n/de.umd.cjs +0 -1
- package/dist_i18n/el.d.ts +0 -1
- package/dist_i18n/el.js +0 -94
- package/dist_i18n/el.umd.cjs +0 -1
- package/dist_i18n/en.d.ts +0 -1
- package/dist_i18n/en.js +0 -94
- package/dist_i18n/en.umd.cjs +0 -1
- package/dist_i18n/es-419.d.ts +0 -1
- package/dist_i18n/es-419.js +0 -94
- package/dist_i18n/es-419.umd.cjs +0 -1
- package/dist_i18n/es-es.d.ts +0 -1
- package/dist_i18n/es-es.js +0 -94
- package/dist_i18n/es-es.umd.cjs +0 -1
- package/dist_i18n/et.d.ts +0 -1
- package/dist_i18n/et.js +0 -94
- package/dist_i18n/et.umd.cjs +0 -1
- package/dist_i18n/eu.d.ts +0 -1
- package/dist_i18n/eu.js +0 -94
- package/dist_i18n/eu.umd.cjs +0 -1
- package/dist_i18n/europe.d.ts +0 -1
- package/dist_i18n/europe.umd.cjs +0 -1
- package/dist_i18n/fa.d.ts +0 -1
- package/dist_i18n/fa.js +0 -94
- package/dist_i18n/fa.umd.cjs +0 -1
- package/dist_i18n/fi.d.ts +0 -1
- package/dist_i18n/fi.js +0 -94
- package/dist_i18n/fi.umd.cjs +0 -1
- package/dist_i18n/fr-ca.d.ts +0 -1
- package/dist_i18n/fr-ca.js +0 -94
- package/dist_i18n/fr-ca.umd.cjs +0 -1
- package/dist_i18n/fr-fr.d.ts +0 -1
- package/dist_i18n/fr-fr.js +0 -94
- package/dist_i18n/fr-fr.umd.cjs +0 -1
- package/dist_i18n/ga.d.ts +0 -1
- package/dist_i18n/ga.js +0 -94
- package/dist_i18n/ga.umd.cjs +0 -1
- package/dist_i18n/he.d.ts +0 -1
- package/dist_i18n/he.js +0 -94
- package/dist_i18n/he.umd.cjs +0 -1
- package/dist_i18n/hi.d.ts +0 -1
- package/dist_i18n/hi.js +0 -94
- package/dist_i18n/hi.umd.cjs +0 -1
- package/dist_i18n/hr.d.ts +0 -1
- package/dist_i18n/hr.js +0 -94
- package/dist_i18n/hr.umd.cjs +0 -1
- package/dist_i18n/hu.d.ts +0 -1
- package/dist_i18n/hu.js +0 -94
- package/dist_i18n/hu.umd.cjs +0 -1
- package/dist_i18n/hy.d.ts +0 -1
- package/dist_i18n/hy.js +0 -94
- package/dist_i18n/hy.umd.cjs +0 -1
- package/dist_i18n/id.d.ts +0 -1
- package/dist_i18n/id.js +0 -94
- package/dist_i18n/id.umd.cjs +0 -1
- package/dist_i18n/is.d.ts +0 -1
- package/dist_i18n/is.js +0 -94
- package/dist_i18n/is.umd.cjs +0 -1
- package/dist_i18n/it.d.ts +0 -1
- package/dist_i18n/it.js +0 -94
- package/dist_i18n/it.umd.cjs +0 -1
- package/dist_i18n/ja.d.ts +0 -1
- package/dist_i18n/ja.js +0 -94
- package/dist_i18n/ja.umd.cjs +0 -1
- package/dist_i18n/ka.d.ts +0 -1
- package/dist_i18n/ka.js +0 -94
- package/dist_i18n/ka.umd.cjs +0 -1
- package/dist_i18n/kk.d.ts +0 -1
- package/dist_i18n/kk.js +0 -94
- package/dist_i18n/kk.umd.cjs +0 -1
- package/dist_i18n/ko.d.ts +0 -1
- package/dist_i18n/ko.js +0 -94
- package/dist_i18n/ko.umd.cjs +0 -1
- package/dist_i18n/lb.d.ts +0 -1
- package/dist_i18n/lb.js +0 -94
- package/dist_i18n/lb.umd.cjs +0 -1
- package/dist_i18n/lt.d.ts +0 -1
- package/dist_i18n/lt.js +0 -94
- package/dist_i18n/lt.umd.cjs +0 -1
- package/dist_i18n/lv.d.ts +0 -1
- package/dist_i18n/lv.js +0 -94
- package/dist_i18n/lv.umd.cjs +0 -1
- package/dist_i18n/me.d.ts +0 -1
- package/dist_i18n/me.js +0 -94
- package/dist_i18n/me.umd.cjs +0 -1
- package/dist_i18n/mk.d.ts +0 -1
- package/dist_i18n/mk.js +0 -94
- package/dist_i18n/mk.umd.cjs +0 -1
- package/dist_i18n/mr.d.ts +0 -1
- package/dist_i18n/mr.js +0 -94
- package/dist_i18n/mr.umd.cjs +0 -1
- package/dist_i18n/mt.d.ts +0 -1
- package/dist_i18n/mt.js +0 -94
- package/dist_i18n/mt.umd.cjs +0 -1
- package/dist_i18n/nb.d.ts +0 -1
- package/dist_i18n/nb.js +0 -95
- package/dist_i18n/nb.umd.cjs +0 -1
- package/dist_i18n/nl.d.ts +0 -1
- package/dist_i18n/nl.js +0 -94
- package/dist_i18n/nl.umd.cjs +0 -1
- package/dist_i18n/pl.d.ts +0 -1
- package/dist_i18n/pl.js +0 -94
- package/dist_i18n/pl.umd.cjs +0 -1
- package/dist_i18n/pt-br.d.ts +0 -1
- package/dist_i18n/pt-br.js +0 -94
- package/dist_i18n/pt-br.umd.cjs +0 -1
- package/dist_i18n/pt-pt.d.ts +0 -1
- package/dist_i18n/pt-pt.js +0 -94
- package/dist_i18n/pt-pt.umd.cjs +0 -1
- package/dist_i18n/ro.d.ts +0 -1
- package/dist_i18n/ro.js +0 -94
- package/dist_i18n/ro.umd.cjs +0 -1
- package/dist_i18n/ru.d.ts +0 -1
- package/dist_i18n/ru.js +0 -94
- package/dist_i18n/ru.umd.cjs +0 -1
- package/dist_i18n/sk.d.ts +0 -1
- package/dist_i18n/sk.js +0 -94
- package/dist_i18n/sk.umd.cjs +0 -1
- package/dist_i18n/sl.d.ts +0 -1
- package/dist_i18n/sl.js +0 -94
- package/dist_i18n/sl.umd.cjs +0 -1
- package/dist_i18n/sq.d.ts +0 -1
- package/dist_i18n/sq.js +0 -94
- package/dist_i18n/sq.umd.cjs +0 -1
- package/dist_i18n/sr.d.ts +0 -1
- package/dist_i18n/sr.js +0 -94
- package/dist_i18n/sr.umd.cjs +0 -1
- package/dist_i18n/sv.d.ts +0 -1
- package/dist_i18n/sv.js +0 -94
- package/dist_i18n/sv.umd.cjs +0 -1
- package/dist_i18n/sw.d.ts +0 -1
- package/dist_i18n/sw.js +0 -94
- package/dist_i18n/sw.umd.cjs +0 -1
- package/dist_i18n/ta.d.ts +0 -1
- package/dist_i18n/ta.js +0 -94
- package/dist_i18n/ta.umd.cjs +0 -1
- package/dist_i18n/te.d.ts +0 -1
- package/dist_i18n/te.js +0 -94
- package/dist_i18n/te.umd.cjs +0 -1
- package/dist_i18n/th.d.ts +0 -1
- package/dist_i18n/th.js +0 -94
- package/dist_i18n/th.umd.cjs +0 -1
- package/dist_i18n/tk.d.ts +0 -1
- package/dist_i18n/tk.js +0 -94
- package/dist_i18n/tk.umd.cjs +0 -1
- package/dist_i18n/tr.d.ts +0 -1
- package/dist_i18n/tr.js +0 -94
- package/dist_i18n/tr.umd.cjs +0 -1
- package/dist_i18n/uk.d.ts +0 -1
- package/dist_i18n/uk.js +0 -94
- package/dist_i18n/uk.umd.cjs +0 -1
- package/dist_i18n/ur.d.ts +0 -1
- package/dist_i18n/ur.js +0 -94
- package/dist_i18n/ur.umd.cjs +0 -1
- package/dist_i18n/uz.d.ts +0 -1
- package/dist_i18n/uz.js +0 -94
- package/dist_i18n/uz.umd.cjs +0 -1
- package/dist_i18n/vi.d.ts +0 -1
- package/dist_i18n/vi.js +0 -94
- package/dist_i18n/vi.umd.cjs +0 -1
- package/dist_i18n/yo.d.ts +0 -1
- package/dist_i18n/yo.js +0 -94
- package/dist_i18n/yo.umd.cjs +0 -1
- package/dist_i18n/zh-cn.d.ts +0 -1
- package/dist_i18n/zh-cn.js +0 -94
- package/dist_i18n/zh-cn.umd.cjs +0 -1
- package/dist_i18n/zh-tw.d.ts +0 -1
- package/dist_i18n/zh-tw.js +0 -94
- package/dist_i18n/zh-tw.umd.cjs +0 -1
package/LICENSE.txt
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
MIT License
|
|
2
2
|
|
|
3
|
-
Copyright (c)
|
|
3
|
+
Copyright (c) 2026 Daniel Regeci, BAU Software s.r.o.
|
|
4
4
|
|
|
5
5
|
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
6
|
of this software and associated documentation files (the "Software"), to deal
|
package/README.md
CHANGED
|
@@ -9,43 +9,32 @@ ALTCHA is fully compliant with:
|
|
|
9
9
|
|
|
10
10
|
For more details, visit [altcha.org](https://altcha.org).
|
|
11
11
|
|
|
12
|
-
|
|
13
|
-
> **Breaking change (v2.3.0)**
|
|
14
|
-
>
|
|
15
|
-
> As of version **2.3.0**, the obfuscation and other plugins have been removed from the main package and moved to a separate package: `@altcha/plugins`.
|
|
16
|
-
>
|
|
17
|
-
> If you do not use any plugins, no changes are required.
|
|
18
|
-
>
|
|
19
|
-
> See the [migration guide for v2.3.0](https://github.com/altcha-org/altcha/blob/main/MIGRATION-v2.3.0.md).
|
|
12
|
+
## Playground
|
|
20
13
|
|
|
14
|
+
Want to see it in action? Visit the official ALTCHA Playground to experiment with widget configurations, fine-tune the Proof-of-Work (PoW) settings, and see how the security mechanisms hold up in real-time.
|
|
21
15
|
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
- **Frictionless Experience**: Uses proof-of-work (PoW) instead of visual puzzles for a seamless user experience.
|
|
25
|
-
- **Code Challenge (New in v2)**: Supports accessible code challenges ("enter code from image") with an audio option.
|
|
26
|
-
- **Cookie-Free Design**: GDPR-compliant by default—no cookies or tracking.
|
|
27
|
-
- **Fully Accessible**: Meets WCAG 2.2 AA-level standards and complies with the European Accessibility Act (EAA).
|
|
28
|
-
- **Lightweight**: Minimal bundle size for fast page loads and optimal performance.
|
|
29
|
-
- **Self-Hosted**: No dependency on third-party services.
|
|
16
|
+
[Open ALTCHA Playground](https://playground.altcha.org)
|
|
30
17
|
|
|
31
|
-
##
|
|
32
|
-
|
|
33
|
-
Version 2 introduces enhanced accessibility, expanded language support, and integration with **ALTCHA Sentinel**—a self-hosted anti-spam solution for websites, apps, and services.
|
|
18
|
+
## Features
|
|
34
19
|
|
|
35
|
-
|
|
20
|
+
- **Frictionless Experience**: Eliminates frustrating visual puzzles by using background **Proof-of-Work (PoW)** for a seamless user journey.
|
|
21
|
+
- **Hardware-Resistant Security**: Leverages **Argon2 and Scrypt** memory-bound algorithms to neutralize hardware acceleration (ASICs/GPUs) and sophisticated bot farms.
|
|
22
|
+
- **Accessible Code Challenges**: Provides "Enter code from image" fallbacks with built-in **audio support** for visually impaired users.
|
|
23
|
+
- **Privacy by Design**: Fully **GDPR compliant** and cookie-free—no tracking, no fingerprinting, and no data collection.
|
|
24
|
+
- **Universal Accessibility**: Engineered to exceed **WCAG 2.2 AA** standards, ensuring compliance with the **European Accessibility Act (EAA)**.
|
|
25
|
+
- **Lightweight**: Minimal footprint and zero dependencies, optimized for rapid page loads and high-performance environments.
|
|
26
|
+
- **100% Self-Hosted**: Maintain full sovereignty over your infrastructure with no reliance on third-party API availability.
|
|
36
27
|
|
|
37
|
-
|
|
38
|
-
- **Improved RTL (right-to-left) language support**
|
|
39
|
-
- **Enhanced WCAG accessibility**
|
|
40
|
-
- **Support for accessible code challenges** (image + audio options)
|
|
41
|
-
- **Overlay UI**
|
|
28
|
+
## What’s New in v3
|
|
42
29
|
|
|
43
|
-
|
|
30
|
+
- **Next-Gen PoW**: Significant performance gains and reduced CPU overhead through an optimized verification mechanism.
|
|
31
|
+
- **Advanced Bot Defense**: Native support for **Argon2 and Scrypt**, raising the cost of attack for automated scripts and specialized hardware.
|
|
32
|
+
- **Modern UI**: Refined styling options, including a suite of new built-in themes and improved CSS custom property support.
|
|
33
|
+
- **Developer Experience**: Improved TypeScript support and streamlined integration.
|
|
44
34
|
|
|
45
|
-
|
|
35
|
+
### Migrating from v2
|
|
46
36
|
|
|
47
|
-
|
|
48
|
-
- [ALTCHA Sentinel](https://altcha.org/docs/v2/sentinel): Sentinel is a new self-hosted solution that replaces the previous SaaS services and the SpamFilter. We recommend migrating to Sentinel for better compliance, enhanced security, unlimited verifications, and an adaptive Captcha with code-challenge support.
|
|
37
|
+
See [MIGRATION-v2.md](/MIGRATION-v2.md).
|
|
49
38
|
|
|
50
39
|
## Examples
|
|
51
40
|
|
|
@@ -74,7 +63,7 @@ Explore starter templates for popular frameworks:
|
|
|
74
63
|
|
|
75
64
|
## Usage
|
|
76
65
|
|
|
77
|
-
The ALTCHA widget is distributed as a **Web Component
|
|
66
|
+
The ALTCHA widget is distributed as a **Web Component**.
|
|
78
67
|
|
|
79
68
|
### 1. Install ALTCHA
|
|
80
69
|
|
|
@@ -94,22 +83,11 @@ Or load via `<script>` tag:
|
|
|
94
83
|
<script async defer src="/altcha.js" type="module"></script>
|
|
95
84
|
```
|
|
96
85
|
|
|
97
|
-
**CDN**:
|
|
98
|
-
|
|
99
|
-
```html
|
|
100
|
-
<script
|
|
101
|
-
async
|
|
102
|
-
defer
|
|
103
|
-
src="https://cdn.jsdelivr.net/gh/altcha-org/altcha@main/dist/altcha.min.js"
|
|
104
|
-
type="module"
|
|
105
|
-
></script>
|
|
106
|
-
```
|
|
107
|
-
|
|
108
86
|
### 2. Add `<altcha-widget>` to Your Forms
|
|
109
87
|
|
|
110
88
|
```html
|
|
111
89
|
<form>
|
|
112
|
-
|
|
90
|
+
<altcha-widget challenge="https://..."></altcha-widget>
|
|
113
91
|
</form>
|
|
114
92
|
```
|
|
115
93
|
|
|
@@ -141,61 +119,107 @@ ALTCHA is optimized for performance:
|
|
|
141
119
|
|
|
142
120
|
| Distribution | Size (GZIPped) |
|
|
143
121
|
| ---------------------------- | -------------- |
|
|
144
|
-
| ALTCHA |
|
|
145
|
-
| ALTCHA with all translations |
|
|
122
|
+
| ALTCHA | 31 kB |
|
|
123
|
+
| ALTCHA with all translations | 49 kB |
|
|
146
124
|
| Cloudflare Turnstile | 85+ kB |
|
|
147
125
|
| hCaptcha | 250+ kB |
|
|
148
126
|
| reCAPTCHA | 300+ kB |
|
|
149
127
|
|
|
150
|
-
When GZIPped, it totals about
|
|
128
|
+
When GZIPped, it totals about 31 kB, making ALTCHA’s widget about 90% smaller than reCAPTCHA.
|
|
151
129
|
|
|
152
130
|
## Content Security Policy (CSP)
|
|
153
131
|
|
|
154
|
-
The default bundle includes styles and workers in a single file. For strict CSP compliance, use scripts from `/
|
|
132
|
+
The default bundle includes styles and workers in a single file. For strict CSP compliance, use scripts from `/dist/external`. Learn more in the [documentation](https://altcha.org/docs/v2/widget-integration).
|
|
155
133
|
|
|
156
134
|
## Configuration
|
|
157
135
|
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
-
|
|
197
|
-
|
|
198
|
-
|
|
136
|
+
### Programmatic Configuration
|
|
137
|
+
|
|
138
|
+
The widget provides a global `$altcha` object to manage defaults, register new algorithms, or add custom translations.
|
|
139
|
+
|
|
140
|
+
To update an existing widget instance, use the `.configure()` [method](). This is the preferred way to handle complex objects or functions that cannot be passed via HTML attributes.
|
|
141
|
+
|
|
142
|
+
```ts
|
|
143
|
+
// Set defaults for all future widget instances:
|
|
144
|
+
$altcha.defaults.set({
|
|
145
|
+
challenge: 'https://api.example.com/challenge',
|
|
146
|
+
debug: true
|
|
147
|
+
});
|
|
148
|
+
|
|
149
|
+
// Update a specific instance dynamically:
|
|
150
|
+
const widget = document.querySelector('altcha-widget');
|
|
151
|
+
widget.configure({
|
|
152
|
+
workers: 2,
|
|
153
|
+
language: 'fr'
|
|
154
|
+
});
|
|
155
|
+
```
|
|
156
|
+
|
|
157
|
+
### Attribute Configuration
|
|
158
|
+
|
|
159
|
+
For simple implementations, the widget supports a subset of configuration options directly as HTML attributes. For more advanced properties, use the programmatic approach above.
|
|
160
|
+
|
|
161
|
+
**Supported Attributes:**
|
|
162
|
+
|
|
163
|
+
```html
|
|
164
|
+
<altcha-widget
|
|
165
|
+
auto="off"
|
|
166
|
+
challenge="https://api.example.com/challenge"
|
|
167
|
+
configuration='{"delay": 500}'
|
|
168
|
+
display="standard"
|
|
169
|
+
language="en"
|
|
170
|
+
name="altcha"
|
|
171
|
+
theme="default"
|
|
172
|
+
type="checkbox"
|
|
173
|
+
workers="4"
|
|
174
|
+
></altcha-widget>
|
|
175
|
+
```
|
|
176
|
+
|
|
177
|
+
> [!TIP]
|
|
178
|
+
> The `configuration` attribute accepts a JSON-encoded string, allowing you to pass complex settings directly in your HTML markup.
|
|
179
|
+
|
|
180
|
+
### Core Settings
|
|
181
|
+
|
|
182
|
+
- **`name`**: The `name` attribute of the hidden input field containing the payload. (Default: `"altcha"`)
|
|
183
|
+
- **`challenge`**: The challenge data or the URL to fetch a new challenge from.
|
|
184
|
+
- **`type`**: Visual style of the interaction element (`'native'`, `'checkbox'`, or `'switch'`).
|
|
185
|
+
- **`language`**: The ISO alpha-2 language code for localization (requires corresponding i18n file).
|
|
186
|
+
- **`workers`**: The number of Web Workers to spawn for proof-of-work calculations.
|
|
187
|
+
|
|
188
|
+
### Automation & Timing
|
|
189
|
+
|
|
190
|
+
- **`auto`**: Determines when verification triggers automatically (`'off'`, `'onfocus'`, `'onload'`, or `'onsubmit'`).
|
|
191
|
+
- **`minDuration`**: The minimum verification time in milliseconds; adds an artificial delay if the PoW is faster. (Default: `500`)
|
|
192
|
+
- **`retryOnOutOfMemoryError`**: Automatically attempts to restart verification with fewer workers if the browser runs out of memory (Argon2 and Scrypt only).
|
|
193
|
+
|
|
194
|
+
### UI & Display
|
|
195
|
+
|
|
196
|
+
- **`display`**: The visual layout mode (`'standard'`, `'bar'`, `'floating'`, `'overlay'`, or `'invisible'`).
|
|
197
|
+
- **`barPlacement`**: Vertical position of the widget when `display` is set to `bar` (`'bottom'` or `'top'`).
|
|
198
|
+
- **`hideLogo`**: Hides the ALTCHA logo icon.
|
|
199
|
+
- **`hideFooter`**: Hides the "ALTCHA" attribution link.
|
|
200
|
+
- **`validationMessage`**: Custom validation message for the HTML5 `setCustomValidity` API.
|
|
201
|
+
|
|
202
|
+
### Floating Widget Settings
|
|
203
|
+
|
|
204
|
+
- **`floatingAnchor`**: The element or CSS selector the floating UI attaches to. Defaults to the first submit button.
|
|
205
|
+
- **`floatingPlacement`**: Preferred position relative to the anchor (`'auto'`, `'bottom'`, or `'top'`).
|
|
206
|
+
- **`floatingOffset`**: Vertical offset in pixels between the UI and its anchor. (Default: `12`)
|
|
207
|
+
- **`floatingPersist`**: Whether the floating widget remains visible after successful verification.
|
|
208
|
+
|
|
209
|
+
### Modal & Challenge Settings
|
|
210
|
+
|
|
211
|
+
- **`codeChallengeDisplay`**: UI layout for the code-challenge modal (`'standard'`, `'overlay'`, or `'bottomsheet'`).
|
|
212
|
+
- **`overlayContent`**: CSS selector for an element to be mirrored inside the overlay modal.
|
|
213
|
+
- **`audioChallengeLanguage`**: Forces a specific language for audio-based challenges.
|
|
214
|
+
- **`disableAutoFocus`**: Prevents the code-challenge modal from stealing focus when opened.
|
|
215
|
+
|
|
216
|
+
### Advanced & Debugging
|
|
217
|
+
|
|
218
|
+
- **`debug`**: Enables verbose logging in the browser console.
|
|
219
|
+
- **`test`**: Mocks a successful verification for testing environments.
|
|
220
|
+
- **`mockError`**: Forces the widget into a failed state for UI testing.
|
|
221
|
+
- **`fetch`**: A custom `fetch` implementation for network requests.
|
|
222
|
+
- **`verifyFunction`**: A custom verification handler that overrides default network verification.
|
|
199
223
|
|
|
200
224
|
## Internationalization (i18n)
|
|
201
225
|
|
|
@@ -237,14 +261,14 @@ To override the language manually, use the `language` attribute:
|
|
|
237
261
|
|
|
238
262
|
### Customizing Translations
|
|
239
263
|
|
|
240
|
-
You can override default translations by updating the global `
|
|
264
|
+
You can override default translations by updating the global `$altcha` registry (`globalThis.$altcha.i18n`):
|
|
241
265
|
|
|
242
266
|
```js
|
|
243
267
|
import 'altcha/i18n/de';
|
|
244
268
|
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
269
|
+
$altcha.i18n.set('de', {
|
|
270
|
+
...$altcha.i18n.get('de'),
|
|
271
|
+
label: 'Ich bin ein Mensch' // Custom label
|
|
248
272
|
});
|
|
249
273
|
```
|
|
250
274
|
|
|
@@ -252,106 +276,31 @@ globalThis.altchaI18n.set('de', {
|
|
|
252
276
|
|
|
253
277
|
For additional verification, ALTCHA supports **image/audio code challenges** (e.g., "Enter the code from the image"). This feature requires [ALTCHA Sentinel](https://altcha.org/docs/v2/sentinel) or a custom server implementation.
|
|
254
278
|
|
|
255
|
-
##
|
|
256
|
-
|
|
257
|
-
Extend functionality with plugins:
|
|
258
|
-
|
|
259
|
-
```js
|
|
260
|
-
import 'altcha/obfuscation'; // Data obfuscation
|
|
261
|
-
import 'altcha/upload'; // File uploads
|
|
262
|
-
import 'altcha'; // Main package
|
|
263
|
-
```
|
|
279
|
+
## Data Obfuscation
|
|
264
280
|
|
|
265
|
-
|
|
281
|
+
[Data obfuscation]() is supported via an official plugin, which must be imported alongside the widget. This is ideal for protecting sensitive information, such as email addresses, from scrapers until the challenge is solved.
|
|
266
282
|
|
|
267
|
-
|
|
268
|
-
<altcha-widget plugins="upload,obfuscation"></altcha-widget>
|
|
269
|
-
```
|
|
283
|
+
### Programmatic Usage
|
|
270
284
|
|
|
271
|
-
|
|
285
|
+
The plugin exports `obfuscate` and `deobfuscate` functions for manual data handling:
|
|
272
286
|
|
|
273
|
-
|
|
274
|
-
|
|
287
|
+
```ts
|
|
288
|
+
import { obfuscate } from 'altcha/plugins/obfuscation';
|
|
275
289
|
|
|
276
|
-
|
|
290
|
+
const obfuscatedData = await obfuscate('mailto:hello@example.com');
|
|
291
|
+
```
|
|
277
292
|
|
|
278
|
-
|
|
293
|
+
### Widget Integration
|
|
279
294
|
|
|
280
|
-
|
|
281
|
-
document.querySelector('#altcha').configure({
|
|
282
|
-
challenge: {
|
|
283
|
-
algorithm: 'SHA-256',
|
|
284
|
-
challenge: '...',
|
|
285
|
-
salt: '...',
|
|
286
|
-
signature: '...',
|
|
287
|
-
},
|
|
288
|
-
strings: {
|
|
289
|
-
label: 'Verify',
|
|
290
|
-
},
|
|
291
|
-
});
|
|
292
|
-
```
|
|
295
|
+
To use the plugin with the widget, ensure `altcha/plugins/obfuscation` is imported **after** the main library. Use the `data-obfuscated` attribute to provide the Base64-encoded payload:
|
|
293
296
|
|
|
294
|
-
|
|
297
|
+
```html
|
|
298
|
+
<script>
|
|
299
|
+
import 'altcha';
|
|
300
|
+
import 'altcha/plugins/obfuscation';
|
|
301
|
+
</script>
|
|
295
302
|
|
|
296
|
-
|
|
297
|
-
export interface Configure {
|
|
298
|
-
auto?: 'off' | 'onfocus' | 'onload' | 'onsubmit';
|
|
299
|
-
challenge?: {
|
|
300
|
-
codeChallenge?: {
|
|
301
|
-
audio?: string;
|
|
302
|
-
image: string;
|
|
303
|
-
length?: number;
|
|
304
|
-
};
|
|
305
|
-
algorithm: string;
|
|
306
|
-
challenge: string;
|
|
307
|
-
maxnumber?: number;
|
|
308
|
-
salt: string;
|
|
309
|
-
signature: string;
|
|
310
|
-
};
|
|
311
|
-
challengeurl?: string;
|
|
312
|
-
credentials?: 'omit' | 'same-origin' | 'include' | boolean;
|
|
313
|
-
customfetch?:
|
|
314
|
-
| string
|
|
315
|
-
| ((url: string, init?: RequestInit) => Promise<Response>);
|
|
316
|
-
debug?: boolean;
|
|
317
|
-
delay?: number;
|
|
318
|
-
disableautofocus?: boolean;
|
|
319
|
-
disablerefetchonexpire?: boolean;
|
|
320
|
-
expire?: number;
|
|
321
|
-
floating?: 'auto' | 'top' | 'bottom';
|
|
322
|
-
floatinganchor?: string;
|
|
323
|
-
floatingoffset?: number;
|
|
324
|
-
floatingpersist?: boolean | 'focus';
|
|
325
|
-
hidefooter?: boolean;
|
|
326
|
-
hidelogo?: boolean;
|
|
327
|
-
maxnumber?: number;
|
|
328
|
-
mockerror?: boolean;
|
|
329
|
-
name?: string;
|
|
330
|
-
obfuscated?: string;
|
|
331
|
-
overlay?: boolean;
|
|
332
|
-
refetchonexpire?: boolean; // deprecated, use disablerefetchonexpire
|
|
333
|
-
spamfilter?: boolean | 'ipAddress' | SpamFilter; // deprecated
|
|
334
|
-
strings?: {
|
|
335
|
-
ariaLinkLabel: strin;
|
|
336
|
-
enterCode: string;
|
|
337
|
-
enterCodeAria: string;
|
|
338
|
-
error: string;
|
|
339
|
-
expired: string;
|
|
340
|
-
footer: string;
|
|
341
|
-
getAudioChallenge: string;
|
|
342
|
-
label: string;
|
|
343
|
-
loading: string;
|
|
344
|
-
reload: strin;
|
|
345
|
-
verificationRequired: string;
|
|
346
|
-
verified: string;
|
|
347
|
-
verifying: string;
|
|
348
|
-
waitAlert: string;
|
|
349
|
-
};
|
|
350
|
-
test?: boolean | number | 'delay';
|
|
351
|
-
verifyurl?: string;
|
|
352
|
-
workers?: number;
|
|
353
|
-
workerurl?: string;
|
|
354
|
-
}
|
|
303
|
+
<altcha-widget data-obfuscated="${obfuscatedData}" display="floating"></altcha-widget>
|
|
355
304
|
```
|
|
356
305
|
|
|
357
306
|
## Methods
|
|
@@ -359,40 +308,40 @@ export interface Configure {
|
|
|
359
308
|
- `configure(options)` - Configures the widget with the given options. See Configuration options above.
|
|
360
309
|
- `getConfiguration()` - Returns the current configuration.
|
|
361
310
|
- `getState()` - Returns the current `state` of the widget.
|
|
362
|
-
- `show()` - Displays the widget (used in
|
|
363
|
-
- `hide()` - Hides the widget (used in
|
|
311
|
+
- `show()` - Displays the widget (used in some display modes).
|
|
312
|
+
- `hide()` - Hides the widget (used in some display modes).
|
|
364
313
|
- `reset(state?, err?)` - Resets the internal `state`, optionally with an error.
|
|
365
314
|
- `setState(state, err?)` - Manually sets the specified `state`, optionally with an error.
|
|
366
|
-
- `
|
|
367
|
-
- `verify()` - Initiates the verification process.
|
|
368
|
-
|
|
315
|
+
- `updateUI()` - Force UI update or reposition, for example for the floating display mode.
|
|
316
|
+
- `verify()` - Initiates the verification process.
|
|
369
317
|
|
|
370
318
|
## Events
|
|
371
319
|
|
|
372
|
-
- **
|
|
320
|
+
- **codechallenge** - Triggers when code-challenge verification is requested.
|
|
321
|
+
- **expired** - Triggers when the challenge expires.
|
|
373
322
|
- **load** - Triggers when the widget loads. The exported methods become available after this event.
|
|
374
|
-
- **
|
|
375
|
-
- **serververification** -
|
|
323
|
+
- **outofmemory** - Triggers when an Out-Of-Memory error is received (Argon2 and Scrypt only).
|
|
324
|
+
- **serververification** -Triggers upon a server verification.
|
|
376
325
|
- **statechange** - Triggers whenever an internal `state` changes.
|
|
377
326
|
- **verified** - Triggers when the challenge is verified.
|
|
378
327
|
|
|
379
328
|
```ts
|
|
380
329
|
enum State {
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
330
|
+
CODE = 'code',
|
|
331
|
+
ERROR = 'error',
|
|
332
|
+
VERIFIED = 'verified',
|
|
333
|
+
VERIFYING = 'verifying',
|
|
334
|
+
UNVERIFIED = 'unverified',
|
|
335
|
+
EXPIRED = 'expired'
|
|
387
336
|
}
|
|
388
337
|
```
|
|
389
338
|
|
|
390
339
|
Using events:
|
|
391
340
|
|
|
392
341
|
```js
|
|
393
|
-
document.querySelector('
|
|
394
|
-
|
|
395
|
-
|
|
342
|
+
document.querySelector('altcha-widget').addEventListener('statechange', (ev) => {
|
|
343
|
+
// See enum State above
|
|
344
|
+
console.log('state:', ev.detail.state);
|
|
396
345
|
});
|
|
397
346
|
```
|
|
398
347
|
|
|
@@ -403,10 +352,6 @@ document.querySelector('#altcha').addEventListener('statechange', (ev) => {
|
|
|
403
352
|
|
|
404
353
|
See [Contributing Guide](https://github.com/altcha-org/altcha/blob/main/CONTRIBUTING.md) and please follow our [Code of Conduct](https://github.com/altcha-org/altcha/blob/main/CODE_OF_CONDUCT.md).
|
|
405
354
|
|
|
406
|
-
## Sponsorship
|
|
407
|
-
|
|
408
|
-
This project is sponsored by [BAUSW.com - Digital Construction Site Diary](https://bausw.com/digital-construction-diary/), promoting transparency and trust in construction projects with real-time documentation.
|
|
409
|
-
|
|
410
355
|
## License
|
|
411
356
|
|
|
412
|
-
|
|
357
|
+
MIT
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
:root{--altcha-border-color:var(--altcha-color-neutral);--altcha-border-width:1px;--altcha-border-radius:6px;--altcha-color-base:light-dark(oklch(100% 0.00011 271.152),oklch(20.904% 0.00002 271.152));--altcha-color-base-content:light-dark(oklch(20.904% 0.00002 271.152),oklch(100% 0.00011 271.152));--altcha-color-error:oklch(51.284% 0.20527 28.678);--altcha-color-error-content:oklch(100% 0.00011 271.152);--altcha-color-neutral:light-dark(oklch(83.591% 0.0001 271.152),oklch(46.04% 0.00005 271.152));--altcha-color-neutral-content:light-dark(oklch(46.76% 0.00005 271.152),oklch(100% 0.00011 271.152));--altcha-color-primary:oklch(40.279% 0.2449 268.131);--altcha-color-primary-content:oklch(100% 0.00011 271.152);--altcha-color-success:oklch(55.748% 0.18968 142.511);--altcha-color-success-content:oklch(100% 0.00011 271.152);--altcha-checkbox-border-color:var(--altcha-color-neutral);--altcha-checkbox-border-radius:5px;--altcha-checkbox-border-width:var(--altcha-border-width);--altcha-checkbox-outline:2px solid var(--altcha-checkbox-outline-color);--altcha-checkbox-outline-color:light-dark(color-mix(in srgb,var(--altcha-color-primary) 20%,transparent),color-mix(in srgb,var(--altcha-color-primary) 60%,transparent));--altcha-checkbox-outline-offset:2px;--altcha-checkbox-size:22px;--altcha-checkbox-transition-duration:var(--altcha-transition-duration);--altcha-input-background-color:var(--altcha-color-base);--altcha-input-border-radius:3px;--altcha-input-border-width:1px;--altcha-input-color:var(--altcha-color-base-content);--altcha-max-width:320px;--altcha-padding:0.75rem;--altcha-popover-arrow-size:6px;--altcha-popover-color:var(--altcha-border-color);--altcha-shadow:drop-shadow(3px 3px 6px oklch(0% 0 0/0.2));--altcha-spinner-color:var(--altcha-color-base-content);--altcha-switch-background-color:var(--altcha-color-neutral);--altcha-switch-border-radius:calc(infinity*1px);--altcha-switch-height:var(--altcha-checkbox-size);--altcha-switch-padding:0.25rem;--altcha-switch-width:calc(var(--altcha-checkbox-size)*1.75);--altcha-switch-toggle-border-radius:100%;--altcha-switch-toggle-color:var(--altcha-color-neutral-content);--altcha-switch-toggle-size:calc(var(--altcha-switch-height) - var(--altcha-switch-padding)*2);--altcha-transition-duration:0.6s;--altcha-z-index:99999999;--altcha-z-index-popover:999999999}.altcha{all:revert-layer;display:none;font-family:inherit;font-size:inherit;position:relative}.altcha[data-visible]{display:block}.altcha *,.altcha-popover,.altcha-popover *{all:revert-layer;box-sizing:border-box;font-family:inherit;font-size:inherit;line-height:1.25}.altcha a,.altcha-popover a{color:currentColor;text-decoration:none}.altcha a:hover,.altcha-popover a:hover{color:currentColor}.altcha-main{align-items:start;background-color:var(--altcha-color-base);border:var(--altcha-border-width,1px) solid var(--altcha-border-color);border-radius:var(--altcha-border-radius,0);color:var(--altcha-color-base-content);display:flex;flex-direction:column;gap:.5rem;justify-content:space-between;max-width:var(--altcha-max-width,100%);padding:var(--altcha-padding)}.altcha-main>*{display:flex;width:100%}.altcha-main>:first-child{flex-grow:1}.altcha-checkbox-wrap{align-items:center;display:flex;flex-direction:row;flex-grow:1;gap:.5rem}.altcha-checkbox-wrap>*{display:flex}.altcha-logo{opacity:.7}.altcha-footer{align-items:center;display:flex;flex-grow:1;font-size:.7rem;gap:.5rem;justify-content:flex-end;opacity:.7}.altcha-error{font-size:.85rem}.altcha-button{align-items:center;background:var(--altcha-color-primary);border:var(--altcha-input-border-width) solid var(--altcha-color-primary);border-radius:var(--altcha-input-border-radius);color:var(--altcha-color-primary-content);cursor:pointer;display:flex;font-size:.9rem;gap:.5rem;padding:.35rem}.altcha-button:focus{border-color:var(--altcha-color-primary);outline:var(--altcha-checkbox-outline);outline-offset:var(--altcha-checkbox-outline-offset)}.altcha-button>.altcha-spinner,.altcha-button>svg{height:20px;width:20px}.altcha-button-secondary{background:transparent;border-color:var(--altcha-color-neutral);color:var(--altcha-color-neutral-content)}.altcha-input{background:var(--altcha-input-background-color);border:var(--altcha-input-border-width) solid var(--altcha-color-neutral);border-radius:var(--altcha-input-border-radius);color:var(--altcha-input-color);flex-grow:1;font-size:1rem;min-width:0;padding:.25rem;width:auto}.altcha-input:focus{border-color:var(--altcha-color-primary);outline:var(--altcha-checkbox-outline);outline-offset:var(--altcha-checkbox-outline-offset)}.altcha-spinner{animation:altcha-rotate .6s linear infinite;border:var(--altcha-checkbox-border-width) solid var(--altcha-spinner-color);border-bottom-color:transparent;border-radius:100%;border-right-color:transparent;opacity:.5}.altcha-popover{background-color:var(--altcha-color-base);border:var(--altcha-border-width) solid var(--altcha-border-color);border-radius:var(--altcha-border-radius);color:var(--altcha-color-base-content);filter:var(--altcha-shadow);left:calc(var(--altcha-padding)/2);max-width:calc(var(--altcha-max-width) - var(--altcha-padding));position:absolute;top:calc(var(--altcha-padding) + var(--altcha-checkbox-size) + var(--altcha-popover-arrow-size));z-index:var(--altcha-z-index-popover)}.altcha-popover-arrow{border-bottom-color:transparent;border:var(--altcha-popover-arrow-size) solid transparent;border-bottom:var(--altcha-popover-arrow-size) solid var(--altcha-popover-color);content:"";height:0;left:calc(var(--altcha-checkbox-size)/2);position:absolute;top:calc(var(--altcha-popover-arrow-size)*-2);width:0}.altcha-popover-content{max-height:100dvh;overflow:auto;padding:var(--altcha-padding)}.altcha-popover[data-top=true][data-display=standard]{bottom:calc(100% - var(--altcha-padding) + var(--altcha-popover-arrow-size));top:auto}.altcha-popover[data-top=true][data-display=standard] .altcha-popover-arrow{border-bottom-color:transparent;border-top-color:var(--altcha-popover-color);bottom:calc(var(--altcha-popover-arrow-size)*-2);top:auto}.altcha-popover[data-variant=error]{--altcha-popover-color:var(--altcha-color-error);background-color:var(--altcha-color-error);border-color:var(--altcha-color-error);color:var(--altcha-color-error-content)}.altcha-popover[data-variant=error] .altcha-popover-content{padding:calc(var(--altcha-padding)/1.5) var(--altcha-padding)}.altcha-popover[data-display=overlay]{animation:altcha-overlay-slidein .5s forwards;top:45%;transform:translate(-50%,-50%)}.altcha-popover[data-display=bottomsheet],.altcha-popover[data-display=overlay]{left:50%;position:fixed;width:var(--altcha-max-width);z-index:var(--altcha-z-index)}.altcha-popover[data-display=bottomsheet]{animation:altcha-bottomsheet-slideup .5s forwards;border-bottom:0;border-bottom-left-radius:0;border-bottom-right-radius:0;bottom:-100%;top:auto;transform:translate(-50%)}.altcha-popover[data-display=bottomsheet] .altcha-popover-content{padding-bottom:calc(var(--altcha-padding)*2)}.altcha-popover-backdrop{background:var(--altcha-color-base-content);bottom:0;left:0;opacity:.1;position:fixed;right:0;top:0;transition:opacity .5s;z-index:var(--altcha-z-index)}.altcha-popover-close{color:var(--altcha-color-base-content);cursor:pointer;display:inline-block;font-size:1rem;height:1.25rem;line-height:.95;position:absolute;right:0;text-align:center;text-shadow:0 0 1px var(--altcha-color-base);top:-1.5rem;width:1.25rem;z-index:var(--altcha-z-index)}.altcha-popover[data-display=bottomsheet] .altcha-footer,.altcha-popover[data-display=overlay] .altcha-footer{align-items:center;gap:.5rem;justify-content:center;padding-top:1rem}.altcha-popover[data-display=bottomsheet] .altcha-footer svg,.altcha-popover[data-display=overlay] .altcha-footer svg{height:18px;vertical-align:middle;width:18px}.altcha-code-challenge>form{display:flex;flex-direction:column;gap:.5rem}.altcha-code-challenge-title{font-weight:600}.altcha-code-challenge-text{font-size:.85rem}.altcha-code-challenge-image{background:#fff;border:var(--altcha-input-border-width) solid var(--altcha-color-neutral);border-radius:var(--altcha-input-border-radius);height:50px;object-fit:contain}.altcha-code-challenge-row{display:flex;gap:.5rem}.altcha-code-challenge-buttons{align-items:center;display:flex;flex-direction:column;gap:.5rem;justify-content:space-between;margin-top:var(--altcha-padding)}.altcha-code-challenge-buttons button{justify-content:center;width:100%}.altcha-checkbox{cursor:pointer;position:relative}.altcha-checkbox,.altcha-checkbox input{height:var(--altcha-checkbox-size);width:var(--altcha-checkbox-size)}.altcha-checkbox input{appearance:none;background:var(--altcha-input-background-color);border:var(--altcha-checkbox-border-width,2px) solid var(--altcha-checkbox-border-color);border-radius:var(--altcha-checkbox-border-radius);left:0;margin:0;outline:none;padding:0;position:absolute;top:0}.altcha-checkbox input:before{background:var(--altcha-color-neutral);border-radius:var(--altcha-checkbox-border-radius);content:"";display:block;height:100%;transform:scale(0);width:100%}.altcha-checkbox input:focus{outline:var(--altcha-checkbox-outline);outline-offset:var(--altcha-checkbox-outline-offset)}.altcha-checkbox input:checked{background-color:var(--altcha-color-success);border-color:var(--altcha-color-success)}.altcha-checkbox input:checked:before{background-color:var(--altcha-color-success);opacity:0;transform:scale(2.2);transition:all var(--altcha-checkbox-transition-duration) ease;transition-delay:.1s}.altcha-checkbox svg{--altcha-radio-svg-size:calc(var(--altcha-checkbox-size)*0.5);--altcha-radio-svg-offset:calc(var(--altcha-checkbox-size)*0.25);fill:none;height:var(--altcha-radio-svg-size);left:var(--altcha-radio-svg-offset);opacity:0;position:absolute;stroke:currentColor;stroke-dasharray:16px;stroke-dashoffset:16px;stroke-linecap:round;stroke-linejoin:round;stroke-width:2;top:var(--altcha-radio-svg-offset);transform:translateZ(0);width:var(--altcha-radio-svg-size)}.altcha-checkbox input:checked+svg{color:var(--altcha-color-success-content);opacity:1;stroke-dashoffset:0;transition:all var(--altcha-checkbox-transition-duration) ease;transition-delay:.1s}.altcha-checkbox-spinner{display:none;height:var(--altcha-checkbox-size);left:0;position:absolute;top:0;width:var(--altcha-checkbox-size)}.altcha-checkbox[data-loading=true] input{appearance:none;opacity:0;pointer-events:none}.altcha-checkbox[data-loading=true] .altcha-checkbox-spinner{display:block}.altcha-checkbox-native{position:relative}.altcha-checkbox-native,.altcha-checkbox-native input{height:var(--altcha-checkbox-size);width:var(--altcha-checkbox-size)}.altcha-checkbox-native input{margin:0}.altcha-checkbox-native input:focus{outline:var(--altcha-checkbox-outline);outline-offset:var(--altcha-checkbox-outline-offset)}.altcha-checkbox-native-spinner{display:none;height:var(--altcha-checkbox-size);left:0;position:absolute;top:0;width:var(--altcha-checkbox-size)}.altcha-checkbox-native[data-loading=true] input{appearance:none;opacity:0;pointer-events:none}.altcha-checkbox-native[data-loading=true] .altcha-checkbox-native-spinner{display:block}.altcha-switch{align-items:center;background-color:var(--altcha-switch-background-color);border-radius:var(--altcha-switch-border-radius);cursor:pointer;display:flex;height:var(--altcha-switch-height);padding:var(--altcha-switch-padding);position:relative;width:var(--altcha-switch-width)}.altcha-switch:focus-within{outline:var(--altcha-checkbox-outline);outline-offset:var(--altcha-checkbox-outline-offset)}.altcha-switch input{appearance:none;height:100%;left:0;opacity:0;position:absolute;top:0;width:100%}.altcha-switch-toggle{align-items:center;background-color:var(--altcha-switch-toggle-color);border-radius:var(--altcha-switch-toggle-border-radius);display:flex;justify-content:center;left:var(--altcha-switch-padding);position:absolute;transition:width .15s ease-out,left .15s ease-out}.altcha-switch-spinner,.altcha-switch-toggle{height:var(--altcha-switch-toggle-size);width:var(--altcha-switch-toggle-size)}.altcha-switch-spinner{display:none}.altcha-switch[data-loading=true]{pointer-events:none}.altcha-switch[data-loading=true] .altcha-switch-spinner{display:block}.altcha-switch[data-loading=true] .altcha-switch-toggle{background-color:transparent;left:calc(50% - var(--altcha-switch-toggle-size)/2)}[data-state=verified] .altcha-switch{--altcha-switch-background-color:var(--altcha-color-success)}[data-state=verified] .altcha-switch-toggle{background-color:var(--altcha-color-success-content)}[data-state=verified] .altcha-switch-toggle,[dir=rtl] .altcha-switch-toggle{left:calc(100% - var(--altcha-switch-height) + var(--altcha-switch-padding))}[dir=rtl][data-state=verified] .altcha-switch-toggle{left:var(--altcha-switch-padding)}.altcha-floating-arrow{border:6px solid transparent;border-bottom:6px solid var(--altcha-border-color);content:"";height:0;left:12px;position:absolute;top:-12px;width:0}.altcha-overlay-backdrop{bottom:0;left:0;position:fixed;right:0;top:0;transition:opacity var(--altcha-transition-duration);z-index:var(--altcha-z-index)}.altcha-overlay-close{color:currentColor;cursor:pointer;display:inline-block;font-size:1rem;height:1rem;line-height:.85;position:absolute;right:0;text-align:center;text-shadow:0 0 1px var(--altcha-color-base);top:-1.5rem;width:1rem;z-index:var(--altcha-z-index)}.altcha[data-display=overlay]{animation:altcha-overlay-slidein var(--altcha-transition-duration) forwards;filter:var(--altcha-shadow);left:50%;opacity:0;position:fixed;top:45%;transform:translate(-50%,-50%);z-index:var(--altcha-z-index)}.altcha[data-display=overlay] .altcha-main{width:var(--altcha-max-width)}.altcha[data-display=floating]{display:none;filter:var(--altcha-shadow);left:var(--altcha-floating-left,-100%);position:fixed;top:var(--altcha-floating-top,-100%);z-index:var(--altcha-z-index)}.altcha[data-display=floating] .altcha-main{width:var(--altcha-max-width)}.altcha[data-display=floating][data-placement=top] .altcha-floating-arrow{border-bottom-color:transparent;border-top-color:var(--altcha-border-color);bottom:-12px;top:auto}.altcha[data-display=floating][data-visible]{display:flex}.altcha[data-display=bar]{bottom:-100%;filter:var(--altcha-shadow);left:0;position:fixed;right:0;transition:bottom var(--altcha-transition-duration),top var(--altcha-transition-duration);z-index:var(--altcha-z-index)}.altcha[data-display=bar] .altcha-main{align-items:center;border-radius:0;border-width:var(--altcha-border-width) 0 0 0;flex-direction:row;max-width:100%!important}.altcha[data-display=bar] .altcha-main>*{width:auto}.altcha[data-display=bar][data-placement=top]{bottom:auto;top:-100%}.altcha[data-display=bar][data-placement=top] .altcha-main{border-width:0 0 var(--altcha-border-width) 0}.altcha[data-display=bar][data-placement=bottom]:not([data-state=unverified]){bottom:0}.altcha[data-display=bar][data-placement=top]:not([data-state=unverified]){top:0}.altcha[data-display=invisible]{display:none}@keyframes altcha-rotate{0%{transform:rotate(0deg)}to{transform:rotate(1turn)}}@keyframes altcha-bottomsheet-slideup{to{bottom:0}}@keyframes altcha-overlay-slidein{to{opacity:1;top:50%}}
|