@canopycanopycanopy/b-ber-grammar-spread 3.0.0 → 3.0.2
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/index.js +6 -26
- package/package.json +7 -7
package/dist/index.js
CHANGED
|
@@ -1,58 +1,38 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
3
|
var _Object$keys = require("@babel/runtime-corejs3/core-js-stable/object/keys");
|
|
4
|
-
|
|
5
4
|
var _Object$getOwnPropertySymbols = require("@babel/runtime-corejs3/core-js-stable/object/get-own-property-symbols");
|
|
6
|
-
|
|
7
5
|
var _filterInstanceProperty = require("@babel/runtime-corejs3/core-js-stable/instance/filter");
|
|
8
|
-
|
|
9
6
|
var _Object$getOwnPropertyDescriptor = require("@babel/runtime-corejs3/core-js-stable/object/get-own-property-descriptor");
|
|
10
|
-
|
|
11
7
|
var _forEachInstanceProperty = require("@babel/runtime-corejs3/core-js-stable/instance/for-each");
|
|
12
|
-
|
|
13
8
|
var _Object$getOwnPropertyDescriptors = require("@babel/runtime-corejs3/core-js-stable/object/get-own-property-descriptors");
|
|
14
|
-
|
|
15
9
|
var _Object$defineProperties = require("@babel/runtime-corejs3/core-js-stable/object/define-properties");
|
|
16
|
-
|
|
17
10
|
var _Object$defineProperty = require("@babel/runtime-corejs3/core-js-stable/object/define-property");
|
|
18
|
-
|
|
19
11
|
var _interopRequireDefault = require("@babel/runtime-corejs3/helpers/interopRequireDefault");
|
|
20
|
-
|
|
21
12
|
_Object$defineProperty(exports, "__esModule", {
|
|
22
13
|
value: true
|
|
23
14
|
});
|
|
24
|
-
|
|
25
15
|
exports.default = void 0;
|
|
26
|
-
|
|
27
16
|
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime-corejs3/helpers/defineProperty"));
|
|
28
|
-
|
|
29
17
|
var _trim = _interopRequireDefault(require("@babel/runtime-corejs3/core-js-stable/instance/trim"));
|
|
30
|
-
|
|
31
18
|
var _map = _interopRequireDefault(require("@babel/runtime-corejs3/core-js-stable/instance/map"));
|
|
32
|
-
|
|
33
19
|
var _State = _interopRequireDefault(require("@canopycanopycanopy/b-ber-lib/State"));
|
|
34
|
-
|
|
35
20
|
var _bBerGrammarRenderer = _interopRequireDefault(require("@canopycanopycanopy/b-ber-grammar-renderer"));
|
|
36
|
-
|
|
37
21
|
var _bBerGrammarAttributes = require("@canopycanopycanopy/b-ber-grammar-attributes");
|
|
38
|
-
|
|
39
22
|
var _bBerParserGallery = _interopRequireDefault(require("@canopycanopycanopy/b-ber-parser-gallery"));
|
|
40
|
-
|
|
41
23
|
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; }
|
|
42
|
-
|
|
43
24
|
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; }
|
|
44
|
-
|
|
45
25
|
// Define the open and closing markers, used by the `validateOpen` and
|
|
46
26
|
// `validateClose` methods in `createRenderer`
|
|
47
27
|
const MARKER_OPEN_RE = /^(spread)(?::([^\s]+)(\s.*)?)?$/;
|
|
48
|
-
const MARKER_CLOSE_RE = /^(exit)(?::([^\s]+))?/;
|
|
49
|
-
// responsible for the HTML output.
|
|
28
|
+
const MARKER_CLOSE_RE = /^(exit)(?::([^\s]+))?/;
|
|
50
29
|
|
|
30
|
+
// The `render` function that gets passed into our `createRenderer` is
|
|
31
|
+
// responsible for the HTML output.
|
|
51
32
|
const render = ({
|
|
52
33
|
context = {}
|
|
53
34
|
}) => (tokens, index) => {
|
|
54
35
|
var _context;
|
|
55
|
-
|
|
56
36
|
const token = tokens[index];
|
|
57
37
|
const info = (0, _trim.default)(_context = token.info).call(_context).match(MARKER_OPEN_RE);
|
|
58
38
|
if (token.nesting !== 1 || !info) return '';
|
|
@@ -64,7 +44,9 @@ const render = ({
|
|
|
64
44
|
};
|
|
65
45
|
const [, type, id, attrs] = info;
|
|
66
46
|
const attrsObject = (0, _bBerGrammarAttributes.attributesObject)(attrs, type, location);
|
|
67
|
-
const attrsString = (0, _bBerGrammarAttributes.attributesString)(attrsObject);
|
|
47
|
+
const attrsString = (0, _bBerGrammarAttributes.attributesString)(attrsObject);
|
|
48
|
+
|
|
49
|
+
// Spread directive is handled differentenly based on build:
|
|
68
50
|
//
|
|
69
51
|
// reader, web: Drop all assets (images, videos, etc) into a `fullscreen`
|
|
70
52
|
// container so that they can be positioned using custom CSS
|
|
@@ -81,7 +63,6 @@ const render = ({
|
|
|
81
63
|
return `
|
|
82
64
|
<div ${attrsString}>
|
|
83
65
|
<div id="${(0, _bBerGrammarAttributes.htmlId)(id)}" class="spread__content">`;
|
|
84
|
-
|
|
85
66
|
case 'epub':
|
|
86
67
|
case 'mobi':
|
|
87
68
|
case 'pdf':
|
|
@@ -90,7 +71,6 @@ const render = ({
|
|
|
90
71
|
return `<section id="${(0, _bBerGrammarAttributes.htmlId)(id)}" ${attrsString}>`;
|
|
91
72
|
}
|
|
92
73
|
};
|
|
93
|
-
|
|
94
74
|
var _default = {
|
|
95
75
|
plugin: _bBerParserGallery.default,
|
|
96
76
|
name: 'spread',
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@canopycanopycanopy/b-ber-grammar-spread",
|
|
3
|
-
"version": "3.0.
|
|
3
|
+
"version": "3.0.2",
|
|
4
4
|
"description": "",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"scripts": {
|
|
@@ -25,11 +25,11 @@
|
|
|
25
25
|
"rimraf": "^2.7.1"
|
|
26
26
|
},
|
|
27
27
|
"dependencies": {
|
|
28
|
-
"@canopycanopycanopy/b-ber-grammar-attributes": "3.0.
|
|
29
|
-
"@canopycanopycanopy/b-ber-grammar-renderer": "3.0.
|
|
30
|
-
"@canopycanopycanopy/b-ber-lib": "3.0.
|
|
31
|
-
"@canopycanopycanopy/b-ber-logger": "3.0.
|
|
32
|
-
"@canopycanopycanopy/b-ber-parser-gallery": "3.0.
|
|
28
|
+
"@canopycanopycanopy/b-ber-grammar-attributes": "3.0.2",
|
|
29
|
+
"@canopycanopycanopy/b-ber-grammar-renderer": "3.0.2",
|
|
30
|
+
"@canopycanopycanopy/b-ber-lib": "3.0.2",
|
|
31
|
+
"@canopycanopycanopy/b-ber-logger": "3.0.2",
|
|
32
|
+
"@canopycanopycanopy/b-ber-parser-gallery": "3.0.2",
|
|
33
33
|
"lodash": "^4.17.21",
|
|
34
34
|
"tar": "^6.1.11"
|
|
35
35
|
},
|
|
@@ -50,5 +50,5 @@
|
|
|
50
50
|
"url": "https://maxwellsimmer.com"
|
|
51
51
|
}
|
|
52
52
|
],
|
|
53
|
-
"gitHead": "
|
|
53
|
+
"gitHead": "1ec8ab9a4030fb59839d347beb04ab7605e3d5dd"
|
|
54
54
|
}
|