@canopycanopycanopy/b-ber-grammar-attributes 1.2.13-react-reader.6 → 1.2.13-react-reader.63
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 +26 -26
- package/package.json +7 -6
package/dist/index.js
CHANGED
|
@@ -46,9 +46,9 @@ var _bBerLogger = _interopRequireDefault(require("@canopycanopycanopy/b-ber-logg
|
|
|
46
46
|
|
|
47
47
|
var _bBerShapesDirectives = require("@canopycanopycanopy/b-ber-shapes-directives");
|
|
48
48
|
|
|
49
|
-
function ownKeys(object, enumerableOnly) { var keys = _Object$keys(object); if (_Object$getOwnPropertySymbols) { var symbols = _Object$getOwnPropertySymbols(object);
|
|
49
|
+
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; }
|
|
50
50
|
|
|
51
|
-
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]
|
|
51
|
+
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var _context3, _context4; var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? _forEachInstanceProperty(_context3 = ownKeys(Object(source), !0)).call(_context3, function (key) { (0, _defineProperty2.default)(target, key, source[key]); }) : _Object$getOwnPropertyDescriptors ? _Object$defineProperties(target, _Object$getOwnPropertyDescriptors(source)) : _forEachInstanceProperty(_context4 = ownKeys(Object(source))).call(_context4, function (key) { _Object$defineProperty(target, key, _Object$getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
52
52
|
|
|
53
53
|
//
|
|
54
54
|
// Querying hierarchies gets confusing, so we're using biological taxonomic
|
|
@@ -133,25 +133,25 @@ const parseAttrs = s => {
|
|
|
133
133
|
if (!open && char === 58
|
|
134
134
|
/* : */
|
|
135
135
|
) {
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
}
|
|
151
|
-
|
|
152
|
-
continue;
|
|
136
|
+
// char is a token, we set `open` so that we don't misinterpret literals inside quotations
|
|
137
|
+
open = true;
|
|
138
|
+
key = str;
|
|
139
|
+
str = '';
|
|
140
|
+
delim = 32;
|
|
141
|
+
/* */
|
|
142
|
+
|
|
143
|
+
if (next === 34
|
|
144
|
+
/* " */
|
|
145
|
+
|| next === 39
|
|
146
|
+
/* ' */
|
|
147
|
+
) {
|
|
148
|
+
i++;
|
|
149
|
+
delim = next;
|
|
153
150
|
}
|
|
154
151
|
|
|
152
|
+
continue;
|
|
153
|
+
}
|
|
154
|
+
|
|
155
155
|
if (char === delim) {
|
|
156
156
|
// token is ending delimiter since we've advanced our pointer
|
|
157
157
|
key = (0, _trim.default)(key).call(key); // trim whitespace, allowing for multiple spaces
|
|
@@ -246,13 +246,13 @@ const _extendWithDefaults = (obj, genus) => {
|
|
|
246
246
|
}; // Create an object from attributes in the given directive
|
|
247
247
|
|
|
248
248
|
|
|
249
|
-
const attributesObject = (attrs,
|
|
249
|
+
const attributesObject = (attrs, origGenus, context = {}) => {
|
|
250
250
|
const {
|
|
251
251
|
fileName,
|
|
252
252
|
lineNumber
|
|
253
253
|
} = context;
|
|
254
254
|
const attrsObject = {};
|
|
255
|
-
let genus =
|
|
255
|
+
let genus = origGenus;
|
|
256
256
|
|
|
257
257
|
if (!genus || typeof genus !== 'string') {
|
|
258
258
|
_bBerLogger.default.error(`No directive provided: ${fileName}:${lineNumber}`);
|
|
@@ -276,22 +276,22 @@ const attributesObject = (attrs, _genus, context = {}) => {
|
|
|
276
276
|
|
|
277
277
|
if (attrs && typeof attrs === 'string') {
|
|
278
278
|
(0, _utils.forOf)(parseAttrs((0, _trim.default)(attrs).call(attrs)), (k, v) => {
|
|
279
|
-
if (_isUnsupportedAttribute(
|
|
279
|
+
if (_isUnsupportedAttribute(origGenus, k)) {
|
|
280
280
|
return _bBerLogger.default.warn(`render omitting unsupported attribute [${k}] at [${fileName}:${lineNumber}]`);
|
|
281
281
|
}
|
|
282
282
|
|
|
283
283
|
attrsObject[k] = v;
|
|
284
284
|
});
|
|
285
|
-
} // Add original `
|
|
285
|
+
} // Add original `origGenus` as a class to the attrs object in case it's
|
|
286
286
|
// different from the current `genus` (which might've changed due to it's
|
|
287
287
|
// specification). do this to keep styling consistent
|
|
288
288
|
|
|
289
289
|
|
|
290
|
-
if (genus !==
|
|
290
|
+
if (genus !== origGenus) {
|
|
291
291
|
if ((0, _lodash.default)(attrsObject, 'classes')) {
|
|
292
|
-
attrsObject.classes += ` ${
|
|
292
|
+
attrsObject.classes += ` ${origGenus}`;
|
|
293
293
|
} else {
|
|
294
|
-
attrsObject.classes =
|
|
294
|
+
attrsObject.classes = origGenus;
|
|
295
295
|
}
|
|
296
296
|
}
|
|
297
297
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@canopycanopycanopy/b-ber-grammar-attributes",
|
|
3
|
-
"version": "1.2.13-react-reader.
|
|
3
|
+
"version": "1.2.13-react-reader.63+9866626a",
|
|
4
4
|
"description": "",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"scripts": {
|
|
@@ -17,9 +17,9 @@
|
|
|
17
17
|
"access": "public"
|
|
18
18
|
},
|
|
19
19
|
"dependencies": {
|
|
20
|
-
"@canopycanopycanopy/b-ber-lib": "1.2.13-react-reader.
|
|
21
|
-
"@canopycanopycanopy/b-ber-logger": "1.2.
|
|
22
|
-
"@canopycanopycanopy/b-ber-shapes-directives": "1.2.
|
|
20
|
+
"@canopycanopycanopy/b-ber-lib": "1.2.13-react-reader.63+9866626a",
|
|
21
|
+
"@canopycanopycanopy/b-ber-logger": "1.2.12",
|
|
22
|
+
"@canopycanopycanopy/b-ber-shapes-directives": "1.2.12",
|
|
23
23
|
"lodash": "^4.17.21",
|
|
24
24
|
"lodash.has": "latest",
|
|
25
25
|
"tar": "^6.1.11"
|
|
@@ -28,8 +28,9 @@
|
|
|
28
28
|
"@babel/cli": "^7.10.5",
|
|
29
29
|
"@babel/core": "^7.10.5",
|
|
30
30
|
"@babel/preset-env": "^7.10.4",
|
|
31
|
+
"browserslist": "^4.17.4",
|
|
31
32
|
"jest": "^26.6.3",
|
|
32
|
-
"rimraf": "^2.
|
|
33
|
+
"rimraf": "^2.7.1"
|
|
33
34
|
},
|
|
34
35
|
"files": [
|
|
35
36
|
"dist"
|
|
@@ -48,5 +49,5 @@
|
|
|
48
49
|
"url": "https://maxwellsimmer.com"
|
|
49
50
|
}
|
|
50
51
|
],
|
|
51
|
-
"gitHead": "
|
|
52
|
+
"gitHead": "9866626aedfa1c5c08c279f147636c1973178b06"
|
|
52
53
|
}
|