mp-darkmode 1.1.7 → 1.1.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/dist/darkmode.js CHANGED
@@ -2509,6 +2509,7 @@ function init() {
2509
2509
  _modules_config__WEBPACK_IMPORTED_MODULE_1__["default"].set('string', opt, 'defaultLightBgColor');
2510
2510
  _modules_config__WEBPACK_IMPORTED_MODULE_1__["default"].set('string', opt, 'defaultDarkTextColor');
2511
2511
  _modules_config__WEBPACK_IMPORTED_MODULE_1__["default"].set('string', opt, 'defaultDarkBgColor');
2512
+ _modules_global__WEBPACK_IMPORTED_MODULE_2__["sdk"].init();
2512
2513
 
2513
2514
  if (!_modules_config__WEBPACK_IMPORTED_MODULE_1__["default"].mode && mql === null && window.matchMedia) {
2514
2515
  // 匹配媒体查询
@@ -3611,19 +3612,19 @@ var SDK = /*#__PURE__*/function () {
3611
3612
 
3612
3613
  _defineProperty(this, "_idx", 0);
3613
3614
 
3614
- _defineProperty(this, "_defaultDarkTextColorRgb", ColorParser(_config__WEBPACK_IMPORTED_MODULE_3__["default"].defaultDarkTextColor).rgb().array());
3615
+ _defineProperty(this, "_defaultDarkTextColorRgb", null);
3615
3616
 
3616
- _defineProperty(this, "_defaultDarkBgColorRgb", ColorParser(_config__WEBPACK_IMPORTED_MODULE_3__["default"].defaultDarkBgColor).rgb().array());
3617
+ _defineProperty(this, "_defaultDarkBgColorRgb", null);
3617
3618
 
3618
- _defineProperty(this, "_defaultDarkBgColorHSL", ColorParser(_config__WEBPACK_IMPORTED_MODULE_3__["default"].defaultDarkBgColor).hsl().array());
3619
+ _defineProperty(this, "_defaultDarkBgColorHSL", null);
3619
3620
 
3620
- _defineProperty(this, "_defaultDarkTextColorBrightness", getColorPerceivedBrightness(this._defaultDarkTextColorRgb));
3621
+ _defineProperty(this, "_defaultDarkTextColorBrightness", null);
3621
3622
 
3622
- _defineProperty(this, "_defaultDarkBgColorBrightness", getColorPerceivedBrightness(this._defaultDarkBgColorRgb));
3623
+ _defineProperty(this, "_defaultDarkBgColorBrightness", null);
3623
3624
 
3624
- _defineProperty(this, "_defaultDarkBgColorHslBrightness", this._defaultDarkBgColorHSL[2]);
3625
+ _defineProperty(this, "_defaultDarkBgColorHslBrightness", null);
3625
3626
 
3626
- _defineProperty(this, "_maxLimitOffsetBrightness", this._defaultDarkTextColorBrightness - this._defaultDarkBgColorBrightness);
3627
+ _defineProperty(this, "_maxLimitOffsetBrightness", null);
3627
3628
 
3628
3629
  _defineProperty(this, "isDarkmode", false);
3629
3630
  }
@@ -3780,6 +3781,17 @@ var SDK = /*#__PURE__*/function () {
3780
3781
  typeof _config__WEBPACK_IMPORTED_MODULE_3__["default"].error === 'function' && _config__WEBPACK_IMPORTED_MODULE_3__["default"].error(e);
3781
3782
  }
3782
3783
  }
3784
+ }, {
3785
+ key: "init",
3786
+ value: function init() {
3787
+ this._defaultDarkTextColorRgb = ColorParser(_config__WEBPACK_IMPORTED_MODULE_3__["default"].defaultDarkTextColor).rgb().array();
3788
+ this._defaultDarkBgColorRgb = ColorParser(_config__WEBPACK_IMPORTED_MODULE_3__["default"].defaultDarkBgColor).rgb().array();
3789
+ this._defaultDarkBgColorHSL = ColorParser(_config__WEBPACK_IMPORTED_MODULE_3__["default"].defaultDarkBgColor).hsl().array();
3790
+ this._defaultDarkTextColorBrightness = getColorPerceivedBrightness(this._defaultDarkTextColorRgb);
3791
+ this._defaultDarkBgColorBrightness = getColorPerceivedBrightness(this._defaultDarkBgColorRgb);
3792
+ this._defaultDarkBgColorHslBrightness = this._defaultDarkBgColorHSL[2];
3793
+ this._maxLimitOffsetBrightness = this._defaultDarkTextColorBrightness - this._defaultDarkBgColorBrightness;
3794
+ }
3783
3795
  }, {
3784
3796
  key: "convert",
3785
3797
  value: function convert(el, cssKVList, isUpdate) {