@vandenberghinc/volt 1.2.6 → 1.2.8
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/.libris/config.json +82 -0
- package/backend/dist/cjs/backend/src/blacklist.d.ts +12 -0
- package/backend/dist/cjs/backend/src/blacklist.js +78 -0
- package/backend/dist/cjs/backend/src/cli.d.ts +2 -0
- package/backend/dist/cjs/backend/src/cli.js +198 -0
- package/backend/dist/cjs/backend/src/database/collection.d.ts +1765 -0
- package/backend/dist/cjs/backend/src/database/collection.js +3301 -0
- package/backend/dist/cjs/backend/src/database/database.d.ts +92 -0
- package/backend/dist/cjs/backend/src/database/database.js +170 -0
- package/backend/dist/cjs/backend/src/database/document.d.ts +1 -0
- package/backend/dist/cjs/backend/src/database/document.js +15 -0
- package/backend/dist/cjs/backend/src/database/filters/filters.d.ts +6 -0
- package/backend/dist/cjs/backend/src/database/filters/filters.js +15 -0
- package/backend/dist/cjs/backend/src/database/filters/strict_filter.d.ts +223 -0
- package/backend/dist/cjs/backend/src/database/filters/strict_filter.js +15 -0
- package/backend/dist/cjs/backend/src/database/filters/strict_filter_test.d.ts +1 -0
- package/backend/dist/cjs/backend/src/database/filters/strict_filter_test.js +443 -0
- package/backend/dist/cjs/backend/src/database/filters/strict_filter_test_v0.d.ts +1 -0
- package/backend/dist/cjs/backend/src/database/filters/strict_filter_test_v0.js +15 -0
- package/backend/dist/cjs/backend/src/database/filters/strict_filter_v0.d.ts +50 -0
- package/backend/dist/cjs/backend/src/database/filters/strict_filter_v0.js +15 -0
- package/backend/dist/cjs/backend/src/database/filters/strict_filter_v1.d.ts +76 -0
- package/backend/dist/cjs/backend/src/database/filters/strict_filter_v1.js +15 -0
- package/backend/dist/cjs/backend/src/database/filters/strict_filter_v2.d.ts +75 -0
- package/backend/dist/cjs/backend/src/database/filters/strict_filter_v2.js +15 -0
- package/backend/dist/cjs/backend/src/database/filters/strict_filter_v3.d.ts +219 -0
- package/backend/dist/cjs/backend/src/database/filters/strict_filter_v3.js +15 -0
- package/backend/dist/cjs/backend/src/database/filters/strict_update_filter.d.ts +165 -0
- package/backend/dist/cjs/backend/src/database/filters/strict_update_filter.js +15 -0
- package/backend/dist/cjs/backend/src/database/filters/strict_update_filter_test.d.ts +5 -0
- package/backend/dist/cjs/backend/src/database/filters/strict_update_filter_test.js +355 -0
- package/backend/dist/cjs/backend/src/database/flatten.d.ts +78 -0
- package/backend/dist/cjs/backend/src/database/flatten.js +53 -0
- package/backend/dist/cjs/backend/src/database/flatten_test.d.ts +1 -0
- package/backend/dist/cjs/backend/src/database/flatten_test.js +175 -0
- package/backend/dist/cjs/backend/src/database/quota/quoata_v2.d.ts +533 -0
- package/backend/dist/cjs/backend/src/database/quota/quoata_v2.js +1046 -0
- package/backend/dist/cjs/backend/src/database/quota/quota.d.ts +551 -0
- package/backend/dist/cjs/backend/src/database/quota/quota.js +1108 -0
- package/backend/dist/cjs/backend/src/database/quota/quota_v1.d.ts +534 -0
- package/backend/dist/cjs/backend/src/database/quota/quota_v1.js +1087 -0
- package/backend/dist/cjs/backend/src/database/quota/safe_int.d.ts +412 -0
- package/backend/dist/cjs/backend/src/database/quota/safe_int.js +745 -0
- package/backend/dist/cjs/backend/src/endpoint.d.ts +346 -0
- package/backend/dist/cjs/backend/src/endpoint.js +468 -0
- package/backend/dist/cjs/backend/src/errors/index.d.ts +7 -0
- package/backend/dist/cjs/backend/src/errors/index.js +25 -0
- package/backend/dist/cjs/backend/src/errors/internal_external.d.ts +52 -0
- package/backend/dist/cjs/backend/src/errors/internal_external.js +95 -0
- package/backend/dist/cjs/backend/src/errors/invalid_usage_error.d.ts +41 -0
- package/backend/dist/cjs/backend/src/errors/invalid_usage_error.js +47 -0
- package/backend/dist/cjs/backend/src/errors/system_error.d.ts +261 -0
- package/backend/dist/cjs/backend/src/errors/system_error.js +436 -0
- package/backend/dist/cjs/backend/src/events.d.ts +97 -0
- package/backend/dist/cjs/backend/src/events.js +15 -0
- package/backend/dist/cjs/backend/src/frontend.d.ts +13 -0
- package/backend/dist/cjs/backend/src/frontend.js +56 -0
- package/backend/dist/cjs/backend/src/image_endpoint.d.ts +44 -0
- package/backend/dist/cjs/backend/src/image_endpoint.js +185 -0
- package/backend/dist/cjs/backend/src/index.d.ts +23 -0
- package/backend/dist/cjs/backend/src/index.js +70 -0
- package/backend/dist/cjs/backend/src/logger.d.ts +5 -0
- package/backend/dist/cjs/backend/src/logger.js +15 -0
- package/backend/dist/cjs/backend/src/meta.d.ts +112 -0
- package/backend/dist/cjs/backend/src/meta.js +181 -0
- package/backend/dist/cjs/backend/src/payments/paddle.d.ts +329 -0
- package/backend/dist/cjs/backend/src/payments/paddle.js +1996 -0
- package/backend/dist/cjs/backend/src/payments/stripe/checkout.d.ts +113 -0
- package/backend/dist/cjs/backend/src/payments/stripe/checkout.js +295 -0
- package/backend/dist/cjs/backend/src/payments/stripe/customers.d.ts +17 -0
- package/backend/dist/cjs/backend/src/payments/stripe/customers.js +164 -0
- package/backend/dist/cjs/backend/src/payments/stripe/error.d.ts +74 -0
- package/backend/dist/cjs/backend/src/payments/stripe/error.js +64 -0
- package/backend/dist/cjs/backend/src/payments/stripe/events.d.ts +155 -0
- package/backend/dist/cjs/backend/src/payments/stripe/events.js +15 -0
- package/backend/dist/cjs/backend/src/payments/stripe/meters.d.ts +105 -0
- package/backend/dist/cjs/backend/src/payments/stripe/meters.js +230 -0
- package/backend/dist/cjs/backend/src/payments/stripe/payment_methods.d.ts +58 -0
- package/backend/dist/cjs/backend/src/payments/stripe/payment_methods.js +109 -0
- package/backend/dist/cjs/backend/src/payments/stripe/products.d.ts +519 -0
- package/backend/dist/cjs/backend/src/payments/stripe/products.js +650 -0
- package/backend/dist/cjs/backend/src/payments/stripe/stripe.d.ts +215 -0
- package/backend/dist/cjs/backend/src/payments/stripe/stripe.js +468 -0
- package/backend/dist/cjs/backend/src/payments/stripe/subscriptions.d.ts +172 -0
- package/backend/dist/cjs/backend/src/payments/stripe/subscriptions.js +557 -0
- package/backend/dist/cjs/backend/src/payments/stripe/utils.d.ts +63 -0
- package/backend/dist/cjs/backend/src/payments/stripe/utils.js +118 -0
- package/backend/dist/cjs/backend/src/payments/stripe/webhooks.d.ts +105 -0
- package/backend/dist/cjs/backend/src/payments/stripe/webhooks.js +627 -0
- package/backend/dist/cjs/backend/src/plugins/browser.d.ts +1 -0
- package/backend/dist/cjs/backend/src/plugins/browser.js +15 -0
- package/backend/dist/cjs/backend/src/plugins/communication.d.ts +70 -0
- package/backend/dist/cjs/backend/src/plugins/communication.js +196 -0
- package/backend/dist/cjs/backend/src/plugins/mail/mail.d.ts +255 -0
- package/backend/dist/cjs/backend/src/plugins/mail/mail.js +381 -0
- package/backend/dist/cjs/backend/src/plugins/mail/ui.d.ts +297 -0
- package/backend/dist/cjs/backend/src/plugins/mail/ui.js +1370 -0
- package/backend/dist/cjs/backend/src/plugins/pdf.d.ts +1 -0
- package/backend/dist/cjs/backend/src/plugins/pdf.js +1456 -0
- package/backend/dist/cjs/backend/src/plugins/thread_monitor.d.ts +18 -0
- package/backend/dist/cjs/backend/src/plugins/thread_monitor.js +116 -0
- package/backend/dist/cjs/backend/src/rate_limit.d.ts +148 -0
- package/backend/dist/cjs/backend/src/rate_limit.js +543 -0
- package/backend/dist/cjs/backend/src/route.d.ts +39 -0
- package/backend/dist/cjs/backend/src/route.js +172 -0
- package/backend/dist/cjs/backend/src/server.d.ts +502 -0
- package/backend/dist/cjs/backend/src/server.js +1710 -0
- package/backend/dist/cjs/backend/src/server.old.d.ts +594 -0
- package/backend/dist/cjs/backend/src/server.old.js +2058 -0
- package/backend/dist/cjs/backend/src/splash_screen.d.ts +93 -0
- package/backend/dist/cjs/backend/src/splash_screen.js +119 -0
- package/backend/dist/cjs/backend/src/status.d.ts +89 -0
- package/backend/dist/cjs/backend/src/status.js +211 -0
- package/backend/dist/cjs/backend/src/stream.d.ts +494 -0
- package/backend/dist/cjs/backend/src/stream.js +1370 -0
- package/backend/dist/cjs/backend/src/users.d.ts +926 -0
- package/backend/dist/cjs/backend/src/users.js +2223 -0
- package/backend/dist/cjs/backend/src/utils.d.ts +22 -0
- package/backend/dist/cjs/backend/src/utils.js +626 -0
- package/backend/dist/cjs/backend/src/view.d.ts +115 -0
- package/backend/dist/cjs/backend/src/view.js +519 -0
- package/backend/dist/cjs/backend/src/vinc.d.ts +6 -0
- package/backend/dist/cjs/backend/src/vinc.js +40 -0
- package/backend/dist/cjs/backend/src/volt.d.ts +24 -0
- package/backend/dist/cjs/backend/src/volt.js +72 -0
- package/backend/dist/cjs/frontend/src/modules/request.d.ts +70 -0
- package/backend/dist/cjs/frontend/src/modules/request.js +99 -0
- package/backend/dist/cjs/package.json +1 -0
- package/backend/dist/esm/backend/src/blacklist.d.ts +12 -0
- package/backend/dist/esm/backend/src/blacklist.js +52 -0
- package/backend/dist/esm/backend/src/cli.d.ts +2 -0
- package/backend/dist/esm/backend/src/cli.js +211 -0
- package/backend/dist/esm/backend/src/database/collection.d.ts +1765 -0
- package/backend/dist/esm/backend/src/database/collection.js +3779 -0
- package/backend/dist/esm/backend/src/database/database.d.ts +92 -0
- package/backend/dist/esm/backend/src/database/database.js +214 -0
- package/backend/dist/esm/backend/src/database/document.d.ts +1 -0
- package/backend/dist/esm/backend/src/database/document.js +558 -0
- package/backend/dist/esm/backend/src/database/filters/filters.d.ts +6 -0
- package/backend/dist/esm/backend/src/database/filters/filters.js +1 -0
- package/backend/dist/esm/backend/src/database/filters/strict_filter.d.ts +223 -0
- package/backend/dist/esm/backend/src/database/filters/strict_filter.js +3 -0
- package/backend/dist/esm/backend/src/database/filters/strict_filter_test.d.ts +1 -0
- package/backend/dist/esm/backend/src/database/filters/strict_filter_test.js +505 -0
- package/backend/dist/esm/backend/src/database/filters/strict_filter_test_v0.d.ts +1 -0
- package/backend/dist/esm/backend/src/database/filters/strict_filter_test_v0.js +712 -0
- package/backend/dist/esm/backend/src/database/filters/strict_filter_v0.d.ts +50 -0
- package/backend/dist/esm/backend/src/database/filters/strict_filter_v0.js +5 -0
- package/backend/dist/esm/backend/src/database/filters/strict_filter_v1.d.ts +76 -0
- package/backend/dist/esm/backend/src/database/filters/strict_filter_v1.js +44 -0
- package/backend/dist/esm/backend/src/database/filters/strict_filter_v2.d.ts +75 -0
- package/backend/dist/esm/backend/src/database/filters/strict_filter_v2.js +5 -0
- package/backend/dist/esm/backend/src/database/filters/strict_filter_v3.d.ts +219 -0
- package/backend/dist/esm/backend/src/database/filters/strict_filter_v3.js +1 -0
- package/backend/dist/esm/backend/src/database/filters/strict_update_filter.d.ts +165 -0
- package/backend/dist/esm/backend/src/database/filters/strict_update_filter.js +5 -0
- package/backend/dist/esm/backend/src/database/filters/strict_update_filter_test.d.ts +5 -0
- package/backend/dist/esm/backend/src/database/filters/strict_update_filter_test.js +415 -0
- package/backend/dist/esm/backend/src/database/flatten.d.ts +78 -0
- package/backend/dist/esm/backend/src/database/flatten.js +22 -0
- package/backend/dist/esm/backend/src/database/flatten_test.d.ts +1 -0
- package/backend/dist/esm/backend/src/database/flatten_test.js +174 -0
- package/backend/dist/esm/backend/src/database/quota/quoata_v2.d.ts +533 -0
- package/backend/dist/esm/backend/src/database/quota/quoata_v2.js +1155 -0
- package/backend/dist/esm/backend/src/database/quota/quota.d.ts +551 -0
- package/backend/dist/esm/backend/src/database/quota/quota.js +1219 -0
- package/backend/dist/esm/backend/src/database/quota/quota_v1.d.ts +534 -0
- package/backend/dist/esm/backend/src/database/quota/quota_v1.js +1242 -0
- package/backend/dist/esm/backend/src/database/quota/safe_int.d.ts +412 -0
- package/backend/dist/esm/backend/src/database/quota/safe_int.js +810 -0
- package/backend/dist/esm/backend/src/endpoint.d.ts +346 -0
- package/backend/dist/esm/backend/src/endpoint.js +479 -0
- package/backend/dist/esm/backend/src/errors/index.d.ts +7 -0
- package/backend/dist/esm/backend/src/errors/index.js +7 -0
- package/backend/dist/esm/backend/src/errors/internal_external.d.ts +52 -0
- package/backend/dist/esm/backend/src/errors/internal_external.js +86 -0
- package/backend/dist/esm/backend/src/errors/invalid_usage_error.d.ts +41 -0
- package/backend/dist/esm/backend/src/errors/invalid_usage_error.js +33 -0
- package/backend/dist/esm/backend/src/errors/system_error.d.ts +261 -0
- package/backend/dist/esm/backend/src/errors/system_error.js +444 -0
- package/backend/dist/esm/backend/src/events.d.ts +97 -0
- package/backend/dist/esm/backend/src/events.js +5 -0
- package/backend/dist/esm/backend/src/frontend.d.ts +13 -0
- package/backend/dist/esm/backend/src/frontend.js +23 -0
- package/backend/dist/esm/backend/src/image_endpoint.d.ts +44 -0
- package/backend/dist/esm/backend/src/image_endpoint.js +196 -0
- package/backend/dist/esm/backend/src/index.d.ts +23 -0
- package/backend/dist/esm/backend/src/index.js +26 -0
- package/backend/dist/esm/backend/src/logger.d.ts +5 -0
- package/backend/dist/esm/backend/src/logger.js +8 -0
- package/backend/dist/esm/backend/src/meta.d.ts +112 -0
- package/backend/dist/esm/backend/src/meta.js +152 -0
- package/backend/dist/esm/backend/src/payments/paddle.d.ts +329 -0
- package/backend/dist/esm/backend/src/payments/paddle.js +2276 -0
- package/backend/dist/esm/backend/src/payments/stripe/checkout.d.ts +113 -0
- package/backend/dist/esm/backend/src/payments/stripe/checkout.js +356 -0
- package/backend/dist/esm/backend/src/payments/stripe/customers.d.ts +17 -0
- package/backend/dist/esm/backend/src/payments/stripe/customers.js +193 -0
- package/backend/dist/esm/backend/src/payments/stripe/error.d.ts +74 -0
- package/backend/dist/esm/backend/src/payments/stripe/error.js +51 -0
- package/backend/dist/esm/backend/src/payments/stripe/events.d.ts +155 -0
- package/backend/dist/esm/backend/src/payments/stripe/events.js +5 -0
- package/backend/dist/esm/backend/src/payments/stripe/meters.d.ts +105 -0
- package/backend/dist/esm/backend/src/payments/stripe/meters.js +318 -0
- package/backend/dist/esm/backend/src/payments/stripe/payment_methods.d.ts +58 -0
- package/backend/dist/esm/backend/src/payments/stripe/payment_methods.js +135 -0
- package/backend/dist/esm/backend/src/payments/stripe/products.d.ts +519 -0
- package/backend/dist/esm/backend/src/payments/stripe/products.js +896 -0
- package/backend/dist/esm/backend/src/payments/stripe/stripe.d.ts +215 -0
- package/backend/dist/esm/backend/src/payments/stripe/stripe.js +464 -0
- package/backend/dist/esm/backend/src/payments/stripe/subscriptions.d.ts +172 -0
- package/backend/dist/esm/backend/src/payments/stripe/subscriptions.js +754 -0
- package/backend/dist/esm/backend/src/payments/stripe/utils.d.ts +63 -0
- package/backend/dist/esm/backend/src/payments/stripe/utils.js +131 -0
- package/backend/dist/esm/backend/src/payments/stripe/webhooks.d.ts +105 -0
- package/backend/dist/esm/backend/src/payments/stripe/webhooks.js +752 -0
- package/backend/dist/esm/backend/src/plugins/browser.d.ts +1 -0
- package/backend/dist/esm/backend/src/plugins/browser.js +170 -0
- package/backend/dist/esm/backend/src/plugins/communication.d.ts +70 -0
- package/backend/dist/esm/backend/src/plugins/communication.js +169 -0
- package/backend/dist/esm/backend/src/plugins/mail/mail.d.ts +255 -0
- package/backend/dist/esm/backend/src/plugins/mail/mail.js +396 -0
- package/backend/dist/esm/backend/src/plugins/mail/ui.d.ts +297 -0
- package/backend/dist/esm/backend/src/plugins/mail/ui.js +1400 -0
- package/backend/dist/esm/backend/src/plugins/pdf.d.ts +1 -0
- package/backend/dist/esm/backend/src/plugins/pdf.js +1694 -0
- package/backend/dist/esm/backend/src/plugins/thread_monitor.d.ts +18 -0
- package/backend/dist/esm/backend/src/plugins/thread_monitor.js +120 -0
- package/backend/dist/esm/backend/src/rate_limit.d.ts +148 -0
- package/backend/dist/esm/backend/src/rate_limit.js +667 -0
- package/backend/dist/esm/backend/src/route.d.ts +39 -0
- package/backend/dist/esm/backend/src/route.js +222 -0
- package/backend/dist/esm/backend/src/server.d.ts +502 -0
- package/backend/dist/esm/backend/src/server.js +2031 -0
- package/backend/dist/esm/backend/src/server.old.d.ts +594 -0
- package/backend/dist/esm/backend/src/server.old.js +2630 -0
- package/backend/dist/esm/backend/src/splash_screen.d.ts +93 -0
- package/backend/dist/esm/backend/src/splash_screen.js +156 -0
- package/backend/dist/esm/backend/src/status.d.ts +89 -0
- package/backend/dist/esm/backend/src/status.js +213 -0
- package/backend/dist/esm/backend/src/stream.d.ts +494 -0
- package/backend/dist/esm/backend/src/stream.js +1611 -0
- package/backend/dist/esm/backend/src/users.d.ts +926 -0
- package/backend/dist/esm/backend/src/users.js +2423 -0
- package/backend/dist/esm/backend/src/utils.d.ts +22 -0
- package/backend/dist/esm/backend/src/utils.js +463 -0
- package/backend/dist/esm/backend/src/view.d.ts +115 -0
- package/backend/dist/esm/backend/src/view.js +584 -0
- package/backend/dist/esm/backend/src/vinc.d.ts +6 -0
- package/backend/dist/esm/backend/src/vinc.js +6 -0
- package/backend/dist/esm/backend/src/volt.d.ts +24 -0
- package/backend/dist/esm/backend/src/volt.js +27 -0
- package/backend/dist/esm/frontend/src/modules/request.d.ts +70 -0
- package/backend/dist/esm/frontend/src/modules/request.js +117 -0
- package/backend/old/file_watcher.ts +359 -0
- package/backend/old/request.deprc.js +626 -0
- package/backend/old/response.deprc.js +354 -0
- package/frontend/dist/backend/src/database/collection.d.ts +1765 -0
- package/frontend/dist/backend/src/database/collection.js +3779 -0
- package/frontend/dist/backend/src/database/database.d.ts +92 -0
- package/frontend/dist/backend/src/database/database.js +214 -0
- package/frontend/dist/backend/src/database/filters/filters.d.ts +6 -0
- package/frontend/dist/backend/src/database/filters/filters.js +1 -0
- package/frontend/dist/backend/src/database/filters/strict_filter.d.ts +223 -0
- package/frontend/dist/backend/src/database/filters/strict_filter.js +3 -0
- package/frontend/dist/backend/src/database/filters/strict_update_filter.d.ts +165 -0
- package/frontend/dist/backend/src/database/filters/strict_update_filter.js +5 -0
- package/frontend/dist/backend/src/database/flatten.d.ts +78 -0
- package/frontend/dist/backend/src/database/flatten.js +22 -0
- package/frontend/dist/backend/src/endpoint.d.ts +346 -0
- package/frontend/dist/backend/src/endpoint.js +479 -0
- package/frontend/dist/backend/src/errors/index.d.ts +7 -0
- package/frontend/dist/backend/src/errors/index.js +7 -0
- package/frontend/dist/backend/src/errors/internal_external.d.ts +52 -0
- package/frontend/dist/backend/src/errors/internal_external.js +86 -0
- package/frontend/dist/backend/src/errors/invalid_usage_error.d.ts +41 -0
- package/frontend/dist/backend/src/errors/invalid_usage_error.js +33 -0
- package/frontend/dist/backend/src/errors/system_error.d.ts +261 -0
- package/frontend/dist/backend/src/errors/system_error.js +444 -0
- package/frontend/dist/backend/src/events.d.ts +97 -0
- package/frontend/dist/backend/src/events.js +5 -0
- package/frontend/dist/backend/src/frontend.d.ts +13 -0
- package/frontend/dist/backend/src/frontend.js +23 -0
- package/frontend/dist/backend/src/image_endpoint.d.ts +44 -0
- package/frontend/dist/backend/src/image_endpoint.js +196 -0
- package/frontend/dist/backend/src/meta.d.ts +112 -0
- package/frontend/dist/backend/src/meta.js +152 -0
- package/frontend/dist/backend/src/payments/paddle.d.ts +329 -0
- package/frontend/dist/backend/src/payments/paddle.js +2276 -0
- package/frontend/dist/backend/src/payments/stripe/checkout.d.ts +113 -0
- package/frontend/dist/backend/src/payments/stripe/checkout.js +356 -0
- package/frontend/dist/backend/src/payments/stripe/customers.d.ts +17 -0
- package/frontend/dist/backend/src/payments/stripe/customers.js +193 -0
- package/frontend/dist/backend/src/payments/stripe/error.d.ts +74 -0
- package/frontend/dist/backend/src/payments/stripe/error.js +51 -0
- package/frontend/dist/backend/src/payments/stripe/events.d.ts +155 -0
- package/frontend/dist/backend/src/payments/stripe/events.js +5 -0
- package/frontend/dist/backend/src/payments/stripe/meters.d.ts +105 -0
- package/frontend/dist/backend/src/payments/stripe/meters.js +318 -0
- package/frontend/dist/backend/src/payments/stripe/payment_methods.d.ts +58 -0
- package/frontend/dist/backend/src/payments/stripe/payment_methods.js +135 -0
- package/frontend/dist/backend/src/payments/stripe/products.d.ts +519 -0
- package/frontend/dist/backend/src/payments/stripe/products.js +896 -0
- package/frontend/dist/backend/src/payments/stripe/stripe.d.ts +215 -0
- package/frontend/dist/backend/src/payments/stripe/stripe.js +464 -0
- package/frontend/dist/backend/src/payments/stripe/subscriptions.d.ts +172 -0
- package/frontend/dist/backend/src/payments/stripe/subscriptions.js +754 -0
- package/frontend/dist/backend/src/payments/stripe/utils.d.ts +63 -0
- package/frontend/dist/backend/src/payments/stripe/utils.js +131 -0
- package/frontend/dist/backend/src/payments/stripe/webhooks.d.ts +105 -0
- package/frontend/dist/backend/src/payments/stripe/webhooks.js +752 -0
- package/frontend/dist/backend/src/plugins/mail/mail.d.ts +255 -0
- package/frontend/dist/backend/src/plugins/mail/mail.js +396 -0
- package/frontend/dist/backend/src/plugins/mail/ui.d.ts +297 -0
- package/frontend/dist/backend/src/plugins/mail/ui.js +1400 -0
- package/frontend/dist/backend/src/rate_limit.d.ts +148 -0
- package/frontend/dist/backend/src/rate_limit.js +667 -0
- package/frontend/dist/backend/src/route.d.ts +39 -0
- package/frontend/dist/backend/src/route.js +222 -0
- package/frontend/dist/backend/src/server.d.ts +502 -0
- package/frontend/dist/backend/src/server.js +2031 -0
- package/frontend/dist/backend/src/splash_screen.d.ts +93 -0
- package/frontend/dist/backend/src/splash_screen.js +156 -0
- package/frontend/dist/backend/src/status.d.ts +89 -0
- package/frontend/dist/backend/src/status.js +213 -0
- package/frontend/dist/backend/src/stream.d.ts +494 -0
- package/frontend/dist/backend/src/stream.js +1611 -0
- package/frontend/dist/backend/src/users.d.ts +926 -0
- package/frontend/dist/backend/src/users.js +2423 -0
- package/frontend/dist/backend/src/utils.d.ts +22 -0
- package/frontend/dist/backend/src/utils.js +463 -0
- package/frontend/dist/backend/src/view.d.ts +115 -0
- package/frontend/dist/backend/src/view.js +584 -0
- package/frontend/dist/frontend/src/css/adyen.css +92 -0
- package/frontend/dist/frontend/src/css/volt.css +75 -0
- package/frontend/dist/frontend/src/elements/base.d.ts +3743 -0
- package/frontend/dist/frontend/src/elements/base.js +12151 -0
- package/frontend/dist/frontend/src/elements/module.d.ts +95 -0
- package/frontend/dist/frontend/src/elements/module.js +216 -0
- package/frontend/dist/frontend/src/elements/register_element.d.ts +3 -0
- package/frontend/dist/frontend/src/elements/register_element.js +22 -0
- package/frontend/dist/frontend/src/elements/resize_query_manager.d.ts +0 -0
- package/frontend/dist/frontend/src/elements/resize_query_manager.js +150 -0
- package/frontend/dist/frontend/src/elements/types.d.ts +52 -0
- package/frontend/dist/frontend/src/elements/types.js +5 -0
- package/frontend/dist/frontend/src/index.d.ts +21 -0
- package/frontend/dist/frontend/src/index.js +29 -0
- package/frontend/dist/frontend/src/modules/attachment.d.ts +126 -0
- package/frontend/dist/frontend/src/modules/attachment.js +306 -0
- package/frontend/dist/frontend/src/modules/auth.d.ts +44 -0
- package/frontend/dist/frontend/src/modules/auth.js +80 -0
- package/frontend/dist/frontend/src/modules/color.d.ts +160 -0
- package/frontend/dist/frontend/src/modules/color.js +316 -0
- package/frontend/dist/frontend/src/modules/compression.d.ts +39 -0
- package/frontend/dist/frontend/src/modules/compression.js +102 -0
- package/frontend/dist/frontend/src/modules/cookies.d.ts +44 -0
- package/frontend/dist/frontend/src/modules/cookies.js +143 -0
- package/frontend/dist/frontend/src/modules/events.d.ts +31 -0
- package/frontend/dist/frontend/src/modules/events.js +79 -0
- package/frontend/dist/frontend/src/modules/google.d.ts +23 -0
- package/frontend/dist/frontend/src/modules/google.js +52 -0
- package/frontend/dist/frontend/src/modules/meta.d.ts +14 -0
- package/frontend/dist/frontend/src/modules/meta.js +48 -0
- package/frontend/dist/frontend/src/modules/paddle.d.ts +1207 -0
- package/frontend/dist/frontend/src/modules/paddle.js +2594 -0
- package/frontend/dist/frontend/src/modules/request.d.ts +70 -0
- package/frontend/dist/frontend/src/modules/request.js +117 -0
- package/frontend/dist/frontend/src/modules/settings.d.ts +3 -0
- package/frontend/dist/frontend/src/modules/settings.js +5 -0
- package/frontend/dist/frontend/src/modules/statics.d.ts +21 -0
- package/frontend/dist/frontend/src/modules/statics.js +43 -0
- package/frontend/dist/frontend/src/modules/stripe/cart.d.ts +112 -0
- package/frontend/dist/frontend/src/modules/stripe/cart.js +321 -0
- package/frontend/dist/frontend/src/modules/stripe/checkout.d.ts +7 -0
- package/frontend/dist/frontend/src/modules/stripe/checkout.js +37 -0
- package/frontend/dist/frontend/src/modules/stripe/index.m.d.ts +6 -0
- package/frontend/dist/frontend/src/modules/stripe/index.m.js +6 -0
- package/frontend/dist/frontend/src/modules/stripe/payments.d.ts +58 -0
- package/frontend/dist/frontend/src/modules/stripe/payments.js +92 -0
- package/frontend/dist/frontend/src/modules/support.d.ts +30 -0
- package/frontend/dist/frontend/src/modules/support.js +53 -0
- package/frontend/dist/frontend/src/modules/theme.d.ts +133 -0
- package/frontend/dist/frontend/src/modules/theme.js +406 -0
- package/frontend/dist/frontend/src/modules/themes.d.ts +12 -0
- package/frontend/dist/frontend/src/modules/themes.js +22 -0
- package/frontend/dist/frontend/src/modules/user.d.ts +164 -0
- package/frontend/dist/frontend/src/modules/user.js +270 -0
- package/frontend/dist/frontend/src/modules/utils.d.ts +176 -0
- package/frontend/dist/frontend/src/modules/utils.js +569 -0
- package/frontend/dist/frontend/src/types/gradient.d.ts +29 -0
- package/frontend/dist/frontend/src/types/gradient.js +79 -0
- package/frontend/dist/frontend/src/ui/border_button.d.ts +94 -0
- package/frontend/dist/frontend/src/ui/border_button.js +228 -0
- package/frontend/dist/frontend/src/ui/button.d.ts +241 -0
- package/frontend/dist/frontend/src/ui/button.js +682 -0
- package/frontend/dist/frontend/src/ui/canvas.d.ts +138 -0
- package/frontend/dist/frontend/src/ui/canvas.js +444 -0
- package/frontend/dist/frontend/src/ui/checkbox.d.ts +74 -0
- package/frontend/dist/frontend/src/ui/checkbox.js +321 -0
- package/frontend/dist/frontend/src/ui/code.d.ts +235 -0
- package/frontend/dist/frontend/src/ui/code.js +1007 -0
- package/frontend/dist/frontend/src/ui/context_menu.d.ts +36 -0
- package/frontend/dist/frontend/src/ui/context_menu.js +205 -0
- package/frontend/dist/frontend/src/ui/css.d.ts +16 -0
- package/frontend/dist/frontend/src/ui/css.js +48 -0
- package/frontend/dist/frontend/src/ui/divider.d.ts +15 -0
- package/frontend/dist/frontend/src/ui/divider.js +78 -0
- package/frontend/dist/frontend/src/ui/dropdown.d.ts +176 -0
- package/frontend/dist/frontend/src/ui/dropdown.js +481 -0
- package/frontend/dist/frontend/src/ui/for_each.d.ts +37 -0
- package/frontend/dist/frontend/src/ui/for_each.js +92 -0
- package/frontend/dist/frontend/src/ui/form.d.ts +34 -0
- package/frontend/dist/frontend/src/ui/form.js +233 -0
- package/frontend/dist/frontend/src/ui/frame_modes.d.ts +37 -0
- package/frontend/dist/frontend/src/ui/frame_modes.js +108 -0
- package/frontend/dist/frontend/src/ui/google_map.d.ts +24 -0
- package/frontend/dist/frontend/src/ui/google_map.js +106 -0
- package/frontend/dist/frontend/src/ui/gradient.d.ts +25 -0
- package/frontend/dist/frontend/src/ui/gradient.js +131 -0
- package/frontend/dist/frontend/src/ui/image.d.ts +111 -0
- package/frontend/dist/frontend/src/ui/image.js +576 -0
- package/frontend/dist/frontend/src/ui/input.d.ts +392 -0
- package/frontend/dist/frontend/src/ui/input.js +1201 -0
- package/frontend/dist/frontend/src/ui/link.d.ts +25 -0
- package/frontend/dist/frontend/src/ui/link.js +140 -0
- package/frontend/dist/frontend/src/ui/list.d.ts +37 -0
- package/frontend/dist/frontend/src/ui/list.js +170 -0
- package/frontend/dist/frontend/src/ui/loader_button.d.ts +80 -0
- package/frontend/dist/frontend/src/ui/loader_button.js +193 -0
- package/frontend/dist/frontend/src/ui/loaders.d.ts +57 -0
- package/frontend/dist/frontend/src/ui/loaders.js +157 -0
- package/frontend/dist/frontend/src/ui/popup.d.ts +94 -0
- package/frontend/dist/frontend/src/ui/popup.js +510 -0
- package/frontend/dist/frontend/src/ui/pseudo.d.ts +44 -0
- package/frontend/dist/frontend/src/ui/pseudo.js +154 -0
- package/frontend/dist/frontend/src/ui/scroller.d.ts +105 -0
- package/frontend/dist/frontend/src/ui/scroller.js +1253 -0
- package/frontend/dist/frontend/src/ui/slider.d.ts +45 -0
- package/frontend/dist/frontend/src/ui/slider.js +217 -0
- package/frontend/dist/frontend/src/ui/spacer.d.ts +15 -0
- package/frontend/dist/frontend/src/ui/spacer.js +78 -0
- package/frontend/dist/frontend/src/ui/span.d.ts +15 -0
- package/frontend/dist/frontend/src/ui/span.js +73 -0
- package/frontend/dist/frontend/src/ui/stack.d.ts +66 -0
- package/frontend/dist/frontend/src/ui/stack.js +335 -0
- package/frontend/dist/frontend/src/ui/steps.d.ts +131 -0
- package/frontend/dist/frontend/src/ui/steps.js +308 -0
- package/frontend/dist/frontend/src/ui/style.d.ts +17 -0
- package/frontend/dist/frontend/src/ui/style.js +73 -0
- package/frontend/dist/frontend/src/ui/switch.d.ts +69 -0
- package/frontend/dist/frontend/src/ui/switch.js +357 -0
- package/frontend/dist/frontend/src/ui/table.d.ts +100 -0
- package/frontend/dist/frontend/src/ui/table.js +405 -0
- package/frontend/dist/frontend/src/ui/tabs.d.ts +111 -0
- package/frontend/dist/frontend/src/ui/tabs.js +424 -0
- package/frontend/dist/frontend/src/ui/text.d.ts +15 -0
- package/frontend/dist/frontend/src/ui/text.js +83 -0
- package/frontend/dist/frontend/src/ui/title.d.ts +91 -0
- package/frontend/dist/frontend/src/ui/title.js +272 -0
- package/frontend/dist/frontend/src/ui/ui.d.ts +35 -0
- package/frontend/dist/frontend/src/ui/ui.js +38 -0
- package/frontend/dist/frontend/src/ui/view.d.ts +15 -0
- package/frontend/dist/frontend/src/ui/view.js +88 -0
- package/frontend/dist/frontend/src/volt.d.ts +20 -0
- package/frontend/dist/frontend/src/volt.js +27 -0
- package/frontend/examples/theme/theme.ts +58 -0
- package/frontend/tools/bundle_d_ts.js +71 -0
- package/frontend/tools/convert_to_jsdoc_input.txt +9452 -0
- package/frontend/tools/convert_to_jsdoc_output.txt +7626 -0
- package/frontend/tools/convert_to_jsdoc_tmp.js +345 -0
- package/frontend/tools/scan_mixed_imports.js +69 -0
- package/package.json +1 -5
|
@@ -0,0 +1,133 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @author Daan van den Bergh
|
|
3
|
+
* @copyright © 2022 - 2025 Daan van den Bergh. All rights reserved
|
|
4
|
+
*/
|
|
5
|
+
/** Name of a theme attribute key. */
|
|
6
|
+
type ThemeAttributeName = string;
|
|
7
|
+
/** Identifier of a theme variant. */
|
|
8
|
+
type ThemeId = "dark" | "light";
|
|
9
|
+
/** Theme options for dark and light variants. */
|
|
10
|
+
type ThemesOptions<ThemeOptions extends {}> = {
|
|
11
|
+
dark: ThemeOptions;
|
|
12
|
+
light: ThemeOptions;
|
|
13
|
+
};
|
|
14
|
+
/** Callback invoked when a theme is activated. */
|
|
15
|
+
type OnActivateCallback<ThemeOptions extends {}> = (themes_class: Theme<ThemeOptions>, active_id: ThemeId) => void;
|
|
16
|
+
/**
|
|
17
|
+
* A themes class to efficiently style the site using themes.
|
|
18
|
+
*
|
|
19
|
+
* The constructor arguments must be a theme style per theme name. Every theme variable should exist in all themes or it may cause undefined behaviour. The theme name that is passed first will be the active theme by default.
|
|
20
|
+
* ```
|
|
21
|
+
* Theme("main-theme", {
|
|
22
|
+
* light: {
|
|
23
|
+
* text_fg: "#000000",
|
|
24
|
+
* },
|
|
25
|
+
* dark: {
|
|
26
|
+
* text_fg: "#FFFFFF",
|
|
27
|
+
* },
|
|
28
|
+
* })
|
|
29
|
+
* ```
|
|
30
|
+
*
|
|
31
|
+
* When theme attributes are retrieved, by default they will be the active theme's attribute as a css variable. So this can be passed to an element.
|
|
32
|
+
* However, some element functions do not accept css variables, in this case the `value()` function can be used to retrieve the raw value. Do not forget to apply an `on_theme_update()` callback on the elements where you use this.
|
|
33
|
+
* @nav Frontend/Themes
|
|
34
|
+
* @note The `ThemesClass` is also initializable under function `Themes`.
|
|
35
|
+
* @docs
|
|
36
|
+
*/
|
|
37
|
+
export declare class Theme<ThemeOptions extends Record<string, any>> {
|
|
38
|
+
active_id: ThemeId;
|
|
39
|
+
active: ThemeOptions;
|
|
40
|
+
_dark: ThemeOptions;
|
|
41
|
+
_light: ThemeOptions;
|
|
42
|
+
_attrs: string[];
|
|
43
|
+
_css_vars: Record<string, string | String>;
|
|
44
|
+
_id: string;
|
|
45
|
+
_on_activate_callback?: OnActivateCallback<ThemeOptions>;
|
|
46
|
+
_linked_themes?: Theme<any>[];
|
|
47
|
+
/**
|
|
48
|
+
*
|
|
49
|
+
* @param id The name of the theme, this will be used as a prefix for the css variables and for the cached theme id.
|
|
50
|
+
* @param themes The themes to be used, this should be a dictionary with the theme name as key and the theme style as value.
|
|
51
|
+
* @param linked_themes A list of linked themes, when this theme is changed, the linked themes will also be changed.
|
|
52
|
+
*/
|
|
53
|
+
constructor(id: string, themes: ThemesOptions<ThemeOptions>, linked_themes?: Theme<any>[]);
|
|
54
|
+
/**
|
|
55
|
+
* Initialize a specific theme.
|
|
56
|
+
* @note This function should be called after the constructor to ensure the most recent theme is activated, argument "id" can be left undefined.
|
|
57
|
+
*/
|
|
58
|
+
initialize(id?: ThemeId): this;
|
|
59
|
+
/** Get full active theme id. */
|
|
60
|
+
get id(): string;
|
|
61
|
+
/** Get cached active subtheme id from localStorage. */
|
|
62
|
+
get_active_id_cached(): string;
|
|
63
|
+
/**
|
|
64
|
+
* Activate a theme and update CSS variables.
|
|
65
|
+
* @param id The theme id to activate.
|
|
66
|
+
* @param apply_theme_update Whether to call the global theme update hook after activation.
|
|
67
|
+
*/
|
|
68
|
+
activate(id: ThemeId, apply_theme_update?: boolean): this;
|
|
69
|
+
on_activate(): OnActivateCallback<ThemeOptions> | undefined;
|
|
70
|
+
on_activate(callback: OnActivateCallback<ThemeOptions>): this;
|
|
71
|
+
/**
|
|
72
|
+
* Toggle the active theme between "dark" and "light".
|
|
73
|
+
* @param apply_theme_update Whether to call the global theme update hook after toggling.
|
|
74
|
+
*/
|
|
75
|
+
toggle(apply_theme_update?: boolean): this;
|
|
76
|
+
/**
|
|
77
|
+
* Internal: add a theme attribute and expose it as a CSS variable-backed property.
|
|
78
|
+
* @param id The attribute name to add.
|
|
79
|
+
* @param theme Optional theme id used for initialization and gradient detection.
|
|
80
|
+
*/
|
|
81
|
+
_add_attr(id: string, theme?: ThemeId): void;
|
|
82
|
+
/**
|
|
83
|
+
* Assign a new value to a theme attribute and update its CSS variable for the active theme.
|
|
84
|
+
* @param theme The theme id to modify.
|
|
85
|
+
* @param key The attribute name.
|
|
86
|
+
* @param value The new value for the attribute.
|
|
87
|
+
*/
|
|
88
|
+
set(theme: ThemeId, key: string, value: any): this;
|
|
89
|
+
/** Get the raw active theme object. */
|
|
90
|
+
get raw(): ThemeOptions;
|
|
91
|
+
/**
|
|
92
|
+
* Get the raw (non-CSS-variable) value of an attribute from the active theme.
|
|
93
|
+
* @param id The attribute name.
|
|
94
|
+
*/
|
|
95
|
+
value(id: ThemeAttributeName): any;
|
|
96
|
+
/**
|
|
97
|
+
* Create a new attribute for each theme using a callback and expose it as a CSS variable.
|
|
98
|
+
* @param id The new attribute name to create.
|
|
99
|
+
* @param create_theme_value Callback that returns the value for each theme.
|
|
100
|
+
*/
|
|
101
|
+
create<T = string>(id: string, create_theme_value: (theme_id: ThemeId, theme: ThemeOptions) => T): void;
|
|
102
|
+
/**
|
|
103
|
+
* Auto darken lighten a color from the theme
|
|
104
|
+
* Safe to call multiple times, caching is implemented.
|
|
105
|
+
*
|
|
106
|
+
* @warning The input color must be a hex / rgb(a) string.
|
|
107
|
+
* @param theme_attr The name of the original theme color.
|
|
108
|
+
* @param percent Percentage between 0. and 1.0.
|
|
109
|
+
*/
|
|
110
|
+
auto_darken_lighten(theme_attr: ThemeAttributeName, percent?: number, reversed?: boolean): string;
|
|
111
|
+
/**
|
|
112
|
+
* Set the opacity on a theme color, creating a derived CSS variable.
|
|
113
|
+
* Opacity must be a number `0.0` till `1.0`, and may also be an object with opacity per theme `{dark: 0.2, light: 0.35}`.
|
|
114
|
+
* @param theme_attr The source theme color attribute.
|
|
115
|
+
* @param opacity The opacity value or per-theme map.
|
|
116
|
+
*/
|
|
117
|
+
opacity(theme_attr: ThemeAttributeName, opacity?: number): string;
|
|
118
|
+
/**
|
|
119
|
+
* Create a new value by multiplying a numeric attribute.
|
|
120
|
+
* @warning argument `id` should be the name of a numeric theme attribute.
|
|
121
|
+
* @param theme_attr The name of a numeric attribute
|
|
122
|
+
* @param x The number by which to multiply the attribute, `attribute * x`.
|
|
123
|
+
*/
|
|
124
|
+
multiply(theme_attr: ThemeAttributeName, x?: number): string;
|
|
125
|
+
/** Function to disable all transition attributes on all elements. */
|
|
126
|
+
static disable_transitions(): void;
|
|
127
|
+
/** Function to re-enable all transition attributes on all elements. */
|
|
128
|
+
static enable_transitions(delay?: number): void;
|
|
129
|
+
}
|
|
130
|
+
/** Interface merge to expose theme attributes as properties from ThemeOptions on Theme instances. */
|
|
131
|
+
export interface Theme<ThemeOptions extends Record<string, any>> extends ThemeOptions {
|
|
132
|
+
}
|
|
133
|
+
export {};
|
|
@@ -0,0 +1,406 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @author Daan van den Bergh
|
|
3
|
+
* @copyright © 2022 - 2025 Daan van den Bergh. All rights reserved
|
|
4
|
+
*/
|
|
5
|
+
// Imports.
|
|
6
|
+
import { Color } from "./color.js";
|
|
7
|
+
import { Themes as ThemesModule } from "./themes.js";
|
|
8
|
+
/** List of supported theme identifiers. */
|
|
9
|
+
const ThemeIdList = ["dark", "light"];
|
|
10
|
+
/**
|
|
11
|
+
* A themes class to efficiently style the site using themes.
|
|
12
|
+
*
|
|
13
|
+
* The constructor arguments must be a theme style per theme name. Every theme variable should exist in all themes or it may cause undefined behaviour. The theme name that is passed first will be the active theme by default.
|
|
14
|
+
* ```
|
|
15
|
+
* Theme("main-theme", {
|
|
16
|
+
* light: {
|
|
17
|
+
* text_fg: "#000000",
|
|
18
|
+
* },
|
|
19
|
+
* dark: {
|
|
20
|
+
* text_fg: "#FFFFFF",
|
|
21
|
+
* },
|
|
22
|
+
* })
|
|
23
|
+
* ```
|
|
24
|
+
*
|
|
25
|
+
* When theme attributes are retrieved, by default they will be the active theme's attribute as a css variable. So this can be passed to an element.
|
|
26
|
+
* However, some element functions do not accept css variables, in this case the `value()` function can be used to retrieve the raw value. Do not forget to apply an `on_theme_update()` callback on the elements where you use this.
|
|
27
|
+
* @nav Frontend/Themes
|
|
28
|
+
* @note The `ThemesClass` is also initializable under function `Themes`.
|
|
29
|
+
* @docs
|
|
30
|
+
*/
|
|
31
|
+
export class Theme {
|
|
32
|
+
// Attributes.
|
|
33
|
+
active_id;
|
|
34
|
+
active;
|
|
35
|
+
_dark;
|
|
36
|
+
_light;
|
|
37
|
+
_attrs;
|
|
38
|
+
_css_vars;
|
|
39
|
+
_id;
|
|
40
|
+
_on_activate_callback;
|
|
41
|
+
_linked_themes;
|
|
42
|
+
/**
|
|
43
|
+
*
|
|
44
|
+
* @param id The name of the theme, this will be used as a prefix for the css variables and for the cached theme id.
|
|
45
|
+
* @param themes The themes to be used, this should be a dictionary with the theme name as key and the theme style as value.
|
|
46
|
+
* @param linked_themes A list of linked themes, when this theme is changed, the linked themes will also be changed.
|
|
47
|
+
*/
|
|
48
|
+
constructor(id, themes, linked_themes) {
|
|
49
|
+
// Attributes.
|
|
50
|
+
this._attrs = [];
|
|
51
|
+
this._css_vars = {};
|
|
52
|
+
this._id = id;
|
|
53
|
+
this._dark = themes.dark;
|
|
54
|
+
this._light = themes.light;
|
|
55
|
+
this._linked_themes = linked_themes;
|
|
56
|
+
// Assign themes.
|
|
57
|
+
for (const theme of Object.keys(themes)) {
|
|
58
|
+
// Initialize.
|
|
59
|
+
const theme_style = themes[theme];
|
|
60
|
+
this[theme] = theme_style;
|
|
61
|
+
// Activate first theme.
|
|
62
|
+
if (this.active_id === undefined) {
|
|
63
|
+
this.active_id = theme;
|
|
64
|
+
this.active = theme_style;
|
|
65
|
+
for (const id of Object.keys(this.active)) {
|
|
66
|
+
document.documentElement.style.setProperty(`--${this._id}_${id}`, this.active[id] ?? "");
|
|
67
|
+
}
|
|
68
|
+
;
|
|
69
|
+
}
|
|
70
|
+
// Initialize attr funcs.
|
|
71
|
+
for (const id of Object.keys(theme_style)) {
|
|
72
|
+
this._add_attr(id, theme);
|
|
73
|
+
}
|
|
74
|
+
}
|
|
75
|
+
// Ensure type.
|
|
76
|
+
if (this.active_id == null || this.active == null) {
|
|
77
|
+
throw new Error("No themes were specified in parameter \"themes\".");
|
|
78
|
+
}
|
|
79
|
+
}
|
|
80
|
+
/**
|
|
81
|
+
* Initialize a specific theme.
|
|
82
|
+
* @note This function should be called after the constructor to ensure the most recent theme is activated, argument "id" can be left undefined.
|
|
83
|
+
*/
|
|
84
|
+
initialize(id) {
|
|
85
|
+
if (id == null) {
|
|
86
|
+
id = (localStorage.getItem(this._id) ?? undefined);
|
|
87
|
+
}
|
|
88
|
+
if (id != null && ThemeIdList.includes(id)) {
|
|
89
|
+
this.activate(id);
|
|
90
|
+
}
|
|
91
|
+
return this;
|
|
92
|
+
}
|
|
93
|
+
// ---------------------------------------------------------------------
|
|
94
|
+
// Theme selection methods.
|
|
95
|
+
/** Get full active theme id. */
|
|
96
|
+
get id() {
|
|
97
|
+
return `${this._id}.${String(this.active_id)}`;
|
|
98
|
+
}
|
|
99
|
+
/** Get cached active subtheme id from localStorage. */
|
|
100
|
+
get_active_id_cached() {
|
|
101
|
+
return localStorage.getItem(this._id) ?? "";
|
|
102
|
+
}
|
|
103
|
+
/**
|
|
104
|
+
* Activate a theme and update CSS variables.
|
|
105
|
+
* @param id The theme id to activate.
|
|
106
|
+
* @param apply_theme_update Whether to call the global theme update hook after activation.
|
|
107
|
+
*/
|
|
108
|
+
activate(id, apply_theme_update = true) {
|
|
109
|
+
if (ThemeIdList.includes(id) === false || this[id] === undefined) {
|
|
110
|
+
throw Error(`Theme "${id}" does not exist.`);
|
|
111
|
+
}
|
|
112
|
+
try {
|
|
113
|
+
// Disable all transitions.
|
|
114
|
+
Theme.disable_transitions();
|
|
115
|
+
// Activate theme.
|
|
116
|
+
this.active_id = id;
|
|
117
|
+
this.active = this[id];
|
|
118
|
+
for (const id of Object.keys(this.active)) {
|
|
119
|
+
document.documentElement.style.setProperty(`--${this._id}_${id}`, this.active[id] ?? "");
|
|
120
|
+
}
|
|
121
|
+
;
|
|
122
|
+
if (this._on_activate_callback != null) {
|
|
123
|
+
this._on_activate_callback(this, this.active_id);
|
|
124
|
+
}
|
|
125
|
+
if (this._linked_themes?.length) {
|
|
126
|
+
for (const theme of this._linked_themes) {
|
|
127
|
+
theme.activate(id, false);
|
|
128
|
+
}
|
|
129
|
+
;
|
|
130
|
+
}
|
|
131
|
+
if (apply_theme_update) {
|
|
132
|
+
ThemesModule.apply_theme_update();
|
|
133
|
+
}
|
|
134
|
+
localStorage.setItem(this._id, String(this.active_id));
|
|
135
|
+
}
|
|
136
|
+
finally {
|
|
137
|
+
// Re-enable transitions.
|
|
138
|
+
Theme.enable_transitions(500);
|
|
139
|
+
}
|
|
140
|
+
return this;
|
|
141
|
+
}
|
|
142
|
+
/**
|
|
143
|
+
* Get or set the callback invoked after a theme is activated.
|
|
144
|
+
* When called without a callback, returns the currently set callback.
|
|
145
|
+
* @param callback The callback to invoke with the theme instance and active id after activation.
|
|
146
|
+
*/
|
|
147
|
+
on_activate(callback) {
|
|
148
|
+
if (callback == null) {
|
|
149
|
+
return this._on_activate_callback;
|
|
150
|
+
}
|
|
151
|
+
this._on_activate_callback = callback;
|
|
152
|
+
return this;
|
|
153
|
+
}
|
|
154
|
+
/**
|
|
155
|
+
* Toggle the active theme between "dark" and "light".
|
|
156
|
+
* @param apply_theme_update Whether to call the global theme update hook after toggling.
|
|
157
|
+
*/
|
|
158
|
+
toggle(apply_theme_update = true) {
|
|
159
|
+
const other = this.active_id === "dark" ? "light" : "dark";
|
|
160
|
+
this.activate(other, apply_theme_update);
|
|
161
|
+
return this;
|
|
162
|
+
}
|
|
163
|
+
// ---------------------------------------------------------------------
|
|
164
|
+
// Adding values.
|
|
165
|
+
/**
|
|
166
|
+
* Internal: add a theme attribute and expose it as a CSS variable-backed property.
|
|
167
|
+
* @param id The attribute name to add.
|
|
168
|
+
* @param theme Optional theme id used for initialization and gradient detection.
|
|
169
|
+
*/
|
|
170
|
+
_add_attr(id, theme) {
|
|
171
|
+
if (theme == null) {
|
|
172
|
+
this._css_vars[id] = `var(--${this._id}_${id})`;
|
|
173
|
+
}
|
|
174
|
+
else {
|
|
175
|
+
const theme_style = this[theme];
|
|
176
|
+
if (typeof theme_style[id] === "string" &&
|
|
177
|
+
(theme_style[id].indexOf("linear-gradient") !== -1 ||
|
|
178
|
+
theme_style[id].indexOf("radial-gradient") !== -1)) {
|
|
179
|
+
theme_style[id] = new String(theme_style[id]);
|
|
180
|
+
theme_style[id]._is_gradient = true;
|
|
181
|
+
this._css_vars[id] = new String(`var(--${this._id}_${id})`);
|
|
182
|
+
this._css_vars[id]._is_gradient = true;
|
|
183
|
+
}
|
|
184
|
+
else {
|
|
185
|
+
this._css_vars[id] = `var(--${this._id}_${id})`;
|
|
186
|
+
}
|
|
187
|
+
}
|
|
188
|
+
Object.defineProperty(this, id, {
|
|
189
|
+
get: function () {
|
|
190
|
+
return this._css_vars[id];
|
|
191
|
+
},
|
|
192
|
+
set: function (v) {
|
|
193
|
+
// only for support this does not work however.
|
|
194
|
+
// document.documentElement.style.setProperty(`--${this._id}_${id}`, (this.active as any)[id] ?? "");
|
|
195
|
+
// return this;
|
|
196
|
+
},
|
|
197
|
+
enumerable: true,
|
|
198
|
+
configurable: true,
|
|
199
|
+
});
|
|
200
|
+
this._attrs.append(id);
|
|
201
|
+
}
|
|
202
|
+
/**
|
|
203
|
+
* Assign a new value to a theme attribute and update its CSS variable for the active theme.
|
|
204
|
+
* @param theme The theme id to modify.
|
|
205
|
+
* @param key The attribute name.
|
|
206
|
+
* @param value The new value for the attribute.
|
|
207
|
+
*/
|
|
208
|
+
set(theme, key, value) {
|
|
209
|
+
// Update theme.
|
|
210
|
+
const theme_style = this[theme];
|
|
211
|
+
if (typeof value === "string" && (value.indexOf("linear-gradient") !== -1 || value.indexOf("radial-gradient") !== -1)) {
|
|
212
|
+
theme_style[key] = new String(value);
|
|
213
|
+
theme_style[key]._is_gradient = true;
|
|
214
|
+
this._css_vars[key] = new String(`var(--${this._id}_${key})`);
|
|
215
|
+
this._css_vars[key]._is_gradient = true;
|
|
216
|
+
}
|
|
217
|
+
else {
|
|
218
|
+
theme_style[key] = value;
|
|
219
|
+
this._css_vars[key] = `var(--${this._id}_${key})`;
|
|
220
|
+
}
|
|
221
|
+
// Set property.
|
|
222
|
+
if (this.active_id === theme) {
|
|
223
|
+
document.documentElement.style.setProperty(`--${this._id}_${key}`, this.active[key] ?? "");
|
|
224
|
+
}
|
|
225
|
+
// Response.
|
|
226
|
+
return this;
|
|
227
|
+
}
|
|
228
|
+
/** Get the raw active theme object. */
|
|
229
|
+
get raw() {
|
|
230
|
+
return this.active;
|
|
231
|
+
}
|
|
232
|
+
/**
|
|
233
|
+
* Get the raw (non-CSS-variable) value of an attribute from the active theme.
|
|
234
|
+
* @param id The attribute name.
|
|
235
|
+
*/
|
|
236
|
+
value(id) {
|
|
237
|
+
if (this.active === undefined) {
|
|
238
|
+
return;
|
|
239
|
+
}
|
|
240
|
+
return this.active[id];
|
|
241
|
+
}
|
|
242
|
+
// ---------------------------------------------------------------------
|
|
243
|
+
// Color manipulation methods.
|
|
244
|
+
/**
|
|
245
|
+
* Create a new attribute for each theme using a callback and expose it as a CSS variable.
|
|
246
|
+
* @param id The new attribute name to create.
|
|
247
|
+
* @param create_theme_value Callback that returns the value for each theme.
|
|
248
|
+
*/
|
|
249
|
+
create(id, create_theme_value) {
|
|
250
|
+
// Already created.
|
|
251
|
+
if (this._css_vars[id]) {
|
|
252
|
+
throw new Error(`Color "${id}" already exists.`);
|
|
253
|
+
}
|
|
254
|
+
// Iterate.
|
|
255
|
+
let index = 0;
|
|
256
|
+
for (const theme_id of ThemeIdList) {
|
|
257
|
+
const theme = this[theme_id];
|
|
258
|
+
const value = create_theme_value(theme_id, theme);
|
|
259
|
+
theme[id] = value;
|
|
260
|
+
// Add attribute to document on first call.
|
|
261
|
+
if (index === 0) {
|
|
262
|
+
this._add_attr(id);
|
|
263
|
+
}
|
|
264
|
+
// Set property.
|
|
265
|
+
if (this.active_id === theme_id) {
|
|
266
|
+
document.documentElement.style.setProperty(`--${this._id}_${id}`, theme[id]);
|
|
267
|
+
}
|
|
268
|
+
// Incr index
|
|
269
|
+
++index;
|
|
270
|
+
}
|
|
271
|
+
}
|
|
272
|
+
/**
|
|
273
|
+
* Auto darken lighten a color from the theme
|
|
274
|
+
* Safe to call multiple times, caching is implemented.
|
|
275
|
+
*
|
|
276
|
+
* @warning The input color must be a hex / rgb(a) string.
|
|
277
|
+
* @param theme_attr The name of the original theme color.
|
|
278
|
+
* @param percent Percentage between 0. and 1.0.
|
|
279
|
+
*/
|
|
280
|
+
auto_darken_lighten(theme_attr, percent = 0.5, reversed = false) {
|
|
281
|
+
let full_id = `${String(theme_attr)}_adl_${percent}`;
|
|
282
|
+
full_id = full_id.replaceAll(".", "_");
|
|
283
|
+
if (this._css_vars[full_id]) {
|
|
284
|
+
return this._css_vars[full_id];
|
|
285
|
+
}
|
|
286
|
+
const process = reversed === true ? (x => x < 0.5) : (x => x > 0.5);
|
|
287
|
+
this.create(full_id, (theme_id, theme) => {
|
|
288
|
+
if (!theme[theme_attr]) {
|
|
289
|
+
throw new Error(`Theme attribute "${String(theme_attr)}" does not exist.`);
|
|
290
|
+
}
|
|
291
|
+
return new Color(theme[theme_attr]).auto_darken_lighten(percent, process).str();
|
|
292
|
+
});
|
|
293
|
+
return this._css_vars[full_id];
|
|
294
|
+
}
|
|
295
|
+
/**
|
|
296
|
+
* Set the opacity on a theme color, creating a derived CSS variable.
|
|
297
|
+
* Opacity must be a number `0.0` till `1.0`, and may also be an object with opacity per theme `{dark: 0.2, light: 0.35}`.
|
|
298
|
+
* @param theme_attr The source theme color attribute.
|
|
299
|
+
* @param opacity The opacity value or per-theme map.
|
|
300
|
+
*/
|
|
301
|
+
opacity(theme_attr, opacity = 1.0) {
|
|
302
|
+
// Create full id.
|
|
303
|
+
let full_id;
|
|
304
|
+
if (typeof opacity === "number") {
|
|
305
|
+
full_id = `${String(theme_attr)}_opac_${opacity}`;
|
|
306
|
+
}
|
|
307
|
+
else {
|
|
308
|
+
full_id = `${String(theme_attr)}_opac_${Object.values(opacity).join("_")}`;
|
|
309
|
+
}
|
|
310
|
+
full_id = full_id.replaceAll(".", "_");
|
|
311
|
+
// Already created.
|
|
312
|
+
if (this._css_vars[full_id]) {
|
|
313
|
+
return this._css_vars[full_id];
|
|
314
|
+
}
|
|
315
|
+
// Iterate.
|
|
316
|
+
let index = 0;
|
|
317
|
+
for (const theme_id of ThemeIdList) {
|
|
318
|
+
const theme = this[theme_id];
|
|
319
|
+
// Checks.
|
|
320
|
+
if (theme[theme_attr] == null) {
|
|
321
|
+
console.error(new Error(`Theme attribute "${String(theme_attr)}" does not exist.`));
|
|
322
|
+
return "";
|
|
323
|
+
}
|
|
324
|
+
if (theme[theme_attr]._is_gradient) {
|
|
325
|
+
console.error(new Error(`Unable to set the opacity on gradient color "${String(theme_attr)}".`));
|
|
326
|
+
return "";
|
|
327
|
+
}
|
|
328
|
+
// Create new color.
|
|
329
|
+
let theme_opac = opacity;
|
|
330
|
+
if (typeof theme_opac === "object") {
|
|
331
|
+
theme_opac = theme_opac[theme_attr];
|
|
332
|
+
if (theme_opac === undefined) {
|
|
333
|
+
console.error(new Error(`Unable to find the opacity on for theme id "${theme_attr}".`));
|
|
334
|
+
}
|
|
335
|
+
}
|
|
336
|
+
theme[full_id] = new Color(theme[theme_attr]).opacity(theme_opac).rgb();
|
|
337
|
+
// Add css var.
|
|
338
|
+
if (index === 0) {
|
|
339
|
+
this._add_attr(full_id);
|
|
340
|
+
}
|
|
341
|
+
// Set property.
|
|
342
|
+
if (this.active_id === theme_id) {
|
|
343
|
+
document.documentElement.style.setProperty(`--${this._id}_${full_id}`, theme[full_id]);
|
|
344
|
+
}
|
|
345
|
+
// Incr index
|
|
346
|
+
++index;
|
|
347
|
+
}
|
|
348
|
+
return this._css_vars[full_id];
|
|
349
|
+
}
|
|
350
|
+
// ---------------------------------------------------------------------
|
|
351
|
+
// Font size manipulation methods.
|
|
352
|
+
/**
|
|
353
|
+
* Create a new value by multiplying a numeric attribute.
|
|
354
|
+
* @warning argument `id` should be the name of a numeric theme attribute.
|
|
355
|
+
* @param theme_attr The name of a numeric attribute
|
|
356
|
+
* @param x The number by which to multiply the attribute, `attribute * x`.
|
|
357
|
+
*/
|
|
358
|
+
multiply(theme_attr, x = 1.0) {
|
|
359
|
+
let full_id = `${String(theme_attr)}_fsr_${x}`;
|
|
360
|
+
full_id = full_id.replaceAll(".", "_");
|
|
361
|
+
if (this._css_vars[full_id]) {
|
|
362
|
+
return this._css_vars[full_id];
|
|
363
|
+
}
|
|
364
|
+
const process = (x => x < 0.5);
|
|
365
|
+
this.create(full_id, (_, theme) => {
|
|
366
|
+
if (!theme[theme_attr]) {
|
|
367
|
+
throw new Error(`Theme attribute "${String(theme_attr)}" does not exist.`);
|
|
368
|
+
}
|
|
369
|
+
if (typeof theme[theme_attr] !== "number") {
|
|
370
|
+
throw new Error(`Theme attribute "${String(theme_attr)}" is not a number.`);
|
|
371
|
+
}
|
|
372
|
+
return theme[theme_attr] * x;
|
|
373
|
+
});
|
|
374
|
+
return this._css_vars[full_id];
|
|
375
|
+
}
|
|
376
|
+
// ---------------------------------------------------------------------
|
|
377
|
+
// Animation methods.
|
|
378
|
+
/** Function to disable all transition attributes on all elements. */
|
|
379
|
+
static disable_transitions() {
|
|
380
|
+
// const style = document.createElement('style');
|
|
381
|
+
// style.id = '__libris_thme_disable_transitions__';
|
|
382
|
+
// style.innerHTML = `
|
|
383
|
+
// * { transition: none !important; }
|
|
384
|
+
// *::after { transition: none !important; }
|
|
385
|
+
// *::before { transition: none !important; }
|
|
386
|
+
// `.dedent();
|
|
387
|
+
// document.head.appendChild(style);
|
|
388
|
+
document.body.classList.add("volt_notransition");
|
|
389
|
+
// Force a reflow to apply the new styles immediately
|
|
390
|
+
// document.body.getBoundingClientRect();
|
|
391
|
+
void document.body.offsetHeight;
|
|
392
|
+
}
|
|
393
|
+
/** Function to re-enable all transition attributes on all elements. */
|
|
394
|
+
static enable_transitions(delay = 0) {
|
|
395
|
+
if (delay > 0) {
|
|
396
|
+
setTimeout(() => Theme.enable_transitions(0), delay);
|
|
397
|
+
return;
|
|
398
|
+
}
|
|
399
|
+
document.body.classList.remove("volt_notransition");
|
|
400
|
+
// const style = document.getElementById('__libris_thme_disable_transitions__');
|
|
401
|
+
// if (style) {
|
|
402
|
+
// style.remove();
|
|
403
|
+
// }
|
|
404
|
+
document.body.getBoundingClientRect();
|
|
405
|
+
}
|
|
406
|
+
}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @author Daan van den Bergh
|
|
3
|
+
* @copyright © 2022 - 2025 Daan van den Bergh. All rights reserved
|
|
4
|
+
*/
|
|
5
|
+
interface ThemeElement {
|
|
6
|
+
element: any;
|
|
7
|
+
}
|
|
8
|
+
export declare namespace Themes {
|
|
9
|
+
const theme_elements: ThemeElement[];
|
|
10
|
+
function apply_theme_update(): void;
|
|
11
|
+
}
|
|
12
|
+
export { Themes as themes };
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @author Daan van den Bergh
|
|
3
|
+
* @copyright © 2022 - 2025 Daan van den Bergh. All rights reserved
|
|
4
|
+
*/
|
|
5
|
+
// Themes module.
|
|
6
|
+
export var Themes;
|
|
7
|
+
(function (Themes) {
|
|
8
|
+
Themes.theme_elements = [];
|
|
9
|
+
// Call the on-theme-update callbacks on all elements that have it defined.
|
|
10
|
+
function apply_theme_update() {
|
|
11
|
+
for (const theme of Themes.theme_elements) {
|
|
12
|
+
const e = theme.element;
|
|
13
|
+
if (e !== undefined && Array.isArray(e._on_theme_updates)) {
|
|
14
|
+
for (const func of e._on_theme_updates)
|
|
15
|
+
func(e);
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
Themes.apply_theme_update = apply_theme_update;
|
|
20
|
+
})(Themes || (Themes = {}));
|
|
21
|
+
;
|
|
22
|
+
export { Themes as themes }; // also export as lowercase for compatibility.
|