styled-components 6.1.11 → 6.1.12

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.
@@ -10,7 +10,7 @@
10
10
  'data-styled';
11
11
  var SC_ATTR_ACTIVE = 'active';
12
12
  var SC_ATTR_VERSION = 'data-styled-version';
13
- var SC_VERSION = "6.1.11";
13
+ var SC_VERSION = "6.1.12";
14
14
  var SPLITTER = '/*!sc*/\n';
15
15
  var IS_BROWSER = typeof window !== 'undefined' && 'HTMLElement' in window;
16
16
  var DISABLE_SPEEDY = Boolean(typeof SC_DISABLE_SPEEDY === 'boolean'
@@ -265,7 +265,7 @@
265
265
  return "continue";
266
266
  var names = sheet.names.get(id);
267
267
  var rules = tag.getGroup(group);
268
- if (names === undefined || rules.length === 0)
268
+ if (names === undefined || !names.size || rules.length === 0)
269
269
  return "continue";
270
270
  var selector = "".concat(SC_ATTR, ".g").concat(group, "[id=\"").concat(id, "\"]");
271
271
  var content = '';
@@ -511,6 +511,11 @@
511
511
  StyleSheet.registerId = function (id) {
512
512
  return getGroupForId(id);
513
513
  };
514
+ StyleSheet.prototype.rehydrate = function () {
515
+ if (!this.server && IS_BROWSER) {
516
+ rehydrateSheet(this);
517
+ }
518
+ };
514
519
  StyleSheet.prototype.reconstructWithOptions = function (options, withNames) {
515
520
  if (withNames === void 0) { withNames = true; }
516
521
  return new StyleSheet(__assign(__assign({}, this.options), options), this.gs, (withNames && this.names) || undefined);
@@ -1401,6 +1406,8 @@
1401
1406
  var _this = this;
1402
1407
  this._emitSheetCSS = function () {
1403
1408
  var css = _this.instance.toString();
1409
+ if (!css)
1410
+ return '';
1404
1411
  var nonce = getNonce();
1405
1412
  var attrs = [
1406
1413
  nonce && "nonce=\"".concat(nonce, "\""),
@@ -1421,11 +1428,14 @@
1421
1428
  if (_this.sealed) {
1422
1429
  throw throwStyledComponentsError(2);
1423
1430
  }
1431
+ var css = _this.instance.toString();
1432
+ if (!css)
1433
+ return [];
1424
1434
  var props = (_a = {},
1425
1435
  _a[SC_ATTR] = '',
1426
1436
  _a[SC_ATTR_VERSION] = SC_VERSION,
1427
1437
  _a.dangerouslySetInnerHTML = {
1428
- __html: _this.instance.toString(),
1438
+ __html: css,
1429
1439
  },
1430
1440
  _a);
1431
1441
  var nonce = getNonce();