@canopycanopycanopy/b-ber-grammar-section 1.2.13-react-reader.6 → 1.2.13-react-reader.70

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.
Files changed (2) hide show
  1. package/dist/index.js +14 -10
  2. package/package.json +10 -9
package/dist/index.js CHANGED
@@ -48,19 +48,18 @@ var _bBerGrammarRenderer = _interopRequireDefault(require("@canopycanopycanopy/b
48
48
 
49
49
  var _bBerGrammarAttributes = require("@canopycanopycanopy/b-ber-grammar-attributes");
50
50
 
51
- function ownKeys(object, enumerableOnly) { var keys = _Object$keys(object); if (_Object$getOwnPropertySymbols) { var symbols = _Object$getOwnPropertySymbols(object); if (enumerableOnly) symbols = _filterInstanceProperty(symbols).call(symbols, function (sym) { return _Object$getOwnPropertyDescriptor(object, sym).enumerable; }); keys.push.apply(keys, symbols); } return keys; }
51
+ function ownKeys(object, enumerableOnly) { var keys = _Object$keys(object); if (_Object$getOwnPropertySymbols) { var symbols = _Object$getOwnPropertySymbols(object); enumerableOnly && (symbols = _filterInstanceProperty(symbols).call(symbols, function (sym) { return _Object$getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
52
52
 
53
- function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { var _context2; _forEachInstanceProperty(_context2 = ownKeys(Object(source), true)).call(_context2, function (key) { (0, _defineProperty2.default)(target, key, source[key]); }); } else if (_Object$getOwnPropertyDescriptors) { _Object$defineProperties(target, _Object$getOwnPropertyDescriptors(source)); } else { var _context3; _forEachInstanceProperty(_context3 = ownKeys(Object(source))).call(_context3, function (key) { _Object$defineProperty(target, key, _Object$getOwnPropertyDescriptor(source, key)); }); } } return target; }
53
+ function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var _context2, _context3; var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? _forEachInstanceProperty(_context2 = ownKeys(Object(source), !0)).call(_context2, function (key) { (0, _defineProperty2.default)(target, key, source[key]); }) : _Object$getOwnPropertyDescriptors ? _Object$defineProperties(target, _Object$getOwnPropertyDescriptors(source)) : _forEachInstanceProperty(_context3 = ownKeys(Object(source))).call(_context3, function (key) { _Object$defineProperty(target, key, _Object$getOwnPropertyDescriptor(source, key)); }); } return target; }
54
54
 
55
- // this matches *all* container-type directives, and outputs the appropriate
55
+ // This matches *all* container-type directives, and outputs the appropriate
56
56
  // HTML based on user-defined attributes
57
- const containers = (0, _from.default)(_bBerShapesDirectives.BLOCK_DIRECTIVES).join('|'); // treat `exit` like an opening marker since we're using it as such
57
+ const containers = (0, _from.default)(_bBerShapesDirectives.BLOCK_DIRECTIVES).join('|'); // Treat `exit` like an opening marker
58
58
 
59
59
  const MARKER_OPEN_RE = new RegExp(`^(${containers}|exit)(?::([^\\s]+)(\\s.*)?)?$`);
60
- const MARKER_CLOSE_RE = /(exit)(?::([^\s]+))?/; // since `context` needs to be available in this `render` method, we curry it
61
- // in and pass the resulting function to the `createRenderer` below. we also
62
- // set a default for `context` since we'll need some of its properties during
63
- // testing
60
+ const MARKER_CLOSE_RE = /(exit)(?::([^\s]+))?/; // `context` must be available in this `render` method and is passed
61
+ // into `createRenderer` below. Default for `context` is set for use
62
+ // during tests
64
63
 
65
64
  function isGallery(directive) {
66
65
  return directive && directive.type === 'gallery' && (_State.default.build === 'web' || _State.default.build === 'reader');
@@ -95,14 +94,19 @@ function handleExitDirective(token) {
95
94
 
96
95
  if (isSpread(directive)) {
97
96
  return `</div>
98
- </div>${comment}`;
97
+ </div>
98
+
99
+ ${_State.default.build === 'reader' ? `<!-- Empty node required for spread markers -->
100
+ <div></div>` : ''}
101
+
102
+ ${comment}`;
99
103
  }
100
104
 
101
105
  return `</section>${comment}`;
102
106
  }
103
107
 
104
108
  function openElement(token, fileName, lineNumber) {
105
- // destructure the attributes from matches, omitting `matches[0]` since
109
+ // Destructure the attributes from matches, omitting `matches[0]` since
106
110
  // we're only interested in the captures
107
111
  const [, type, id, attr] = token;
108
112
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@canopycanopycanopy/b-ber-grammar-section",
3
- "version": "1.2.13-react-reader.6+5f5ac8b3",
3
+ "version": "1.2.13-react-reader.70+b3ae07bb",
4
4
  "description": "",
5
5
  "main": "dist/index.js",
6
6
  "scripts": {
@@ -20,16 +20,17 @@
20
20
  "@babel/cli": "^7.10.5",
21
21
  "@babel/core": "^7.10.5",
22
22
  "@babel/preset-env": "^7.10.4",
23
+ "browserslist": "^4.17.4",
23
24
  "jest": "^26.6.3",
24
- "rimraf": "^2.6.3"
25
+ "rimraf": "^2.7.1"
25
26
  },
26
27
  "dependencies": {
27
- "@canopycanopycanopy/b-ber-grammar-attributes": "1.2.13-react-reader.6+5f5ac8b3",
28
- "@canopycanopycanopy/b-ber-grammar-renderer": "1.2.13-react-reader.6+5f5ac8b3",
29
- "@canopycanopycanopy/b-ber-lib": "1.2.13-react-reader.6+5f5ac8b3",
30
- "@canopycanopycanopy/b-ber-logger": "1.2.13-react-reader.6+5f5ac8b3",
31
- "@canopycanopycanopy/b-ber-parser-section": "1.2.13-react-reader.6+5f5ac8b3",
32
- "@canopycanopycanopy/b-ber-shapes-directives": "1.2.13-react-reader.6+5f5ac8b3",
28
+ "@canopycanopycanopy/b-ber-grammar-attributes": "1.2.13-react-reader.70+b3ae07bb",
29
+ "@canopycanopycanopy/b-ber-grammar-renderer": "1.2.13-react-reader.70+b3ae07bb",
30
+ "@canopycanopycanopy/b-ber-lib": "1.2.13-react-reader.70+b3ae07bb",
31
+ "@canopycanopycanopy/b-ber-logger": "1.2.13-react-reader.70+b3ae07bb",
32
+ "@canopycanopycanopy/b-ber-parser-section": "1.2.13-react-reader.70+b3ae07bb",
33
+ "@canopycanopycanopy/b-ber-shapes-directives": "1.2.13-react-reader.70+b3ae07bb",
33
34
  "lodash": "^4.17.21",
34
35
  "lodash.find": "latest",
35
36
  "tar": "^6.1.11"
@@ -51,5 +52,5 @@
51
52
  "url": "https://maxwellsimmer.com"
52
53
  }
53
54
  ],
54
- "gitHead": "5f5ac8b3704149ac656dd852aaac311eea945d65"
55
+ "gitHead": "b3ae07bbd734c38412891b1587c6d05e1057d874"
55
56
  }