@canopycanopycanopy/b-ber-grammar-iframe 3.0.8-next.61 → 3.0.8-next.97
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.d.ts +19 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +139 -64
- package/package.json +16 -18
- package/dist/helpers.js +0 -125
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
//#region src/index.d.ts
|
|
2
|
+
declare const _default: {
|
|
3
|
+
plugin: (md: any, name: string, options?: any) => void;
|
|
4
|
+
name: string;
|
|
5
|
+
renderer: ({
|
|
6
|
+
instance,
|
|
7
|
+
context
|
|
8
|
+
}: {
|
|
9
|
+
instance: any;
|
|
10
|
+
context: any;
|
|
11
|
+
}) => {
|
|
12
|
+
marker: string;
|
|
13
|
+
minMarkers: number;
|
|
14
|
+
validate: (params: any) => any;
|
|
15
|
+
render: (tokens: any, index: any) => string;
|
|
16
|
+
};
|
|
17
|
+
};
|
|
18
|
+
export = _default;
|
|
19
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","names":[],"sources":["../src/index.ts"],"mappings":""}
|
package/dist/index.js
CHANGED
|
@@ -1,67 +1,142 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
var
|
|
4
|
-
var
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
var
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
1
|
+
//#region \0rolldown/runtime.js
|
|
2
|
+
var __create = Object.create;
|
|
3
|
+
var __defProp = Object.defineProperty;
|
|
4
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
5
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
6
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
7
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
8
|
+
var __copyProps = (to, from, except, desc) => {
|
|
9
|
+
if (from && typeof from === "object" || typeof from === "function") for (var keys = __getOwnPropNames(from), i = 0, n = keys.length, key; i < n; i++) {
|
|
10
|
+
key = keys[i];
|
|
11
|
+
if (!__hasOwnProp.call(to, key) && key !== except) __defProp(to, key, {
|
|
12
|
+
get: ((k) => from[k]).bind(null, key),
|
|
13
|
+
enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
|
|
14
|
+
});
|
|
15
|
+
}
|
|
16
|
+
return to;
|
|
17
|
+
};
|
|
18
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", {
|
|
19
|
+
value: mod,
|
|
20
|
+
enumerable: true
|
|
21
|
+
}) : target, mod));
|
|
22
|
+
//#endregion
|
|
23
|
+
let _canopycanopycanopy_b_ber_lib = require("@canopycanopycanopy/b-ber-lib");
|
|
24
|
+
let _canopycanopycanopy_b_ber_parser_figure = require("@canopycanopycanopy/b-ber-parser-figure");
|
|
25
|
+
_canopycanopycanopy_b_ber_parser_figure = __toESM(_canopycanopycanopy_b_ber_parser_figure);
|
|
26
|
+
let _canopycanopycanopy_b_ber_shapes_directives = require("@canopycanopycanopy/b-ber-shapes-directives");
|
|
27
|
+
let _canopycanopycanopy_b_ber_grammar_attributes = require("@canopycanopycanopy/b-ber-grammar-attributes");
|
|
28
|
+
let _canopycanopycanopy_b_ber_lib_utils = require("@canopycanopycanopy/b-ber-lib/utils");
|
|
29
|
+
//#region src/helpers.ts
|
|
30
|
+
function supported(build) {
|
|
31
|
+
return build === "reader" || build === "web";
|
|
32
|
+
}
|
|
33
|
+
function prepare({ token, marker, context, instance, fileName, lineNumber }) {
|
|
34
|
+
const [, type, id, attrs] = marker;
|
|
35
|
+
const mediaType = (0, _canopycanopycanopy_b_ber_lib_utils.getMediaType)(type);
|
|
36
|
+
const figureId = (0, _canopycanopycanopy_b_ber_grammar_attributes.htmlId)(id);
|
|
37
|
+
const page = `figure-${figureId}.xhtml`;
|
|
38
|
+
const attrsObject = {
|
|
39
|
+
source: "",
|
|
40
|
+
height: 150,
|
|
41
|
+
width: "100%",
|
|
42
|
+
title: "",
|
|
43
|
+
classes: "",
|
|
44
|
+
poster: "",
|
|
45
|
+
...(0, _canopycanopycanopy_b_ber_grammar_attributes.attributesObject)(attrs, type, {
|
|
46
|
+
fileName,
|
|
47
|
+
lineNumber
|
|
48
|
+
})
|
|
49
|
+
};
|
|
50
|
+
(0, _canopycanopycanopy_b_ber_lib_utils.ensureSource)(attrsObject, type, fileName, lineNumber);
|
|
51
|
+
(0, _canopycanopycanopy_b_ber_lib_utils.ensurePoster)(attrsObject, type);
|
|
52
|
+
(0, _canopycanopycanopy_b_ber_lib_utils.ensureSupportedClassNames)(attrsObject, supported);
|
|
53
|
+
return {
|
|
54
|
+
...attrsObject,
|
|
55
|
+
id: figureId,
|
|
56
|
+
attrString: (0, _canopycanopycanopy_b_ber_grammar_attributes.attributesString)(attrsObject, { classes: true }),
|
|
57
|
+
commentStart: _canopycanopycanopy_b_ber_lib.Html.comment(`START: ${mediaType}:${type}#${figureId};`),
|
|
58
|
+
commentEnd: _canopycanopycanopy_b_ber_lib.Html.comment(`END: ${mediaType}:${type}#${figureId};`),
|
|
59
|
+
href: _canopycanopycanopy_b_ber_lib.State.build === "reader" ? "figures-titlepage.xhtml" : page,
|
|
60
|
+
ref: context.fileName,
|
|
61
|
+
caption: token.children ? instance.renderInline(token.children) : "",
|
|
62
|
+
page,
|
|
63
|
+
type,
|
|
64
|
+
mediaType,
|
|
65
|
+
mime: null,
|
|
66
|
+
pageOrder: _canopycanopycanopy_b_ber_lib.State.figures.length,
|
|
67
|
+
source: _canopycanopycanopy_b_ber_lib.Url.ensureDecoded(attrsObject.source),
|
|
68
|
+
poster: attrsObject.poster
|
|
69
|
+
};
|
|
70
|
+
}
|
|
71
|
+
function createIframe({ id, href, poster }) {
|
|
72
|
+
return `
|
|
73
|
+
<div class="figure__small figure__small--landscape">
|
|
74
|
+
<figure id="ref${id}">
|
|
75
|
+
<a href="${href}#${id}">
|
|
76
|
+
${(0, _canopycanopycanopy_b_ber_lib_utils.renderPosterImage)(poster)}
|
|
77
|
+
</a>
|
|
78
|
+
</figure>
|
|
79
|
+
</div>`;
|
|
80
|
+
}
|
|
81
|
+
function createIframeInline(data) {
|
|
82
|
+
const { id, commentStart, commentEnd, mediaType, attrString: containerAttrsString, source, caption, ...rest } = data;
|
|
83
|
+
return `
|
|
84
|
+
${commentStart}
|
|
85
|
+
<section class="${mediaType} figure__large figure__inline">
|
|
86
|
+
<div id="${id}"${containerAttrsString}>
|
|
87
|
+
<iframe src="${source}" ${Object.entries({
|
|
88
|
+
allow: "fullscreen autoplay",
|
|
89
|
+
...rest
|
|
90
|
+
}).reduce((acc, [key, val]) => {
|
|
91
|
+
if (!_canopycanopycanopy_b_ber_shapes_directives.htmlIframeAttributes.has(key) || val === "") return acc;
|
|
92
|
+
return acc.concat(`${key}="${val}"`);
|
|
93
|
+
}, []).join(" ")}>
|
|
94
|
+
</iframe>
|
|
95
|
+
</div>
|
|
96
|
+
${(0, _canopycanopycanopy_b_ber_lib_utils.renderCaption)(caption, mediaType)}
|
|
97
|
+
</section>
|
|
98
|
+
${commentEnd}`;
|
|
99
|
+
}
|
|
100
|
+
//#endregion
|
|
101
|
+
//#region src/index.ts
|
|
102
|
+
const { createUnsupportedInline } = _canopycanopycanopy_b_ber_lib.utils;
|
|
16
103
|
const MARKER_RE = /^(iframe)/;
|
|
17
104
|
const DIRECTIVE_RE = /(iframe(?:-inline)?)(?::([^\s]+)(\s+.*)?)?$/;
|
|
18
|
-
const render = ({
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
105
|
+
const render = ({ instance, context }) => (tokens, index) => {
|
|
106
|
+
const token = tokens[index];
|
|
107
|
+
const marker = token.info.trim().match(DIRECTIVE_RE);
|
|
108
|
+
if (!marker) return "";
|
|
109
|
+
const fileName = `_markdown/${context.fileName}.md`;
|
|
110
|
+
const lineNumber = token.map ? token.map[0] : null;
|
|
111
|
+
const type = marker[1];
|
|
112
|
+
const args = prepare({
|
|
113
|
+
token,
|
|
114
|
+
marker,
|
|
115
|
+
context,
|
|
116
|
+
instance,
|
|
117
|
+
fileName,
|
|
118
|
+
lineNumber
|
|
119
|
+
});
|
|
120
|
+
switch (type) {
|
|
121
|
+
case "iframe":
|
|
122
|
+
_canopycanopycanopy_b_ber_lib.State.add("figures", args);
|
|
123
|
+
return createIframe(args);
|
|
124
|
+
case "iframe-inline": return supported(_canopycanopycanopy_b_ber_lib.State.build) ? createIframeInline(args) : createUnsupportedInline(args);
|
|
125
|
+
default: throw new Error(`Something went wrong parsing [${args.type}] in [${context.fileName}]`);
|
|
126
|
+
}
|
|
127
|
+
};
|
|
128
|
+
var src_default = {
|
|
129
|
+
plugin: _canopycanopycanopy_b_ber_parser_figure.default,
|
|
130
|
+
name: "iframe",
|
|
131
|
+
renderer: ({ instance, context }) => ({
|
|
132
|
+
marker: _canopycanopycanopy_b_ber_shapes_directives.INLINE_DIRECTIVE_MARKER,
|
|
133
|
+
minMarkers: _canopycanopycanopy_b_ber_shapes_directives.INLINE_DIRECTIVE_MARKER_MIN_LENGTH,
|
|
134
|
+
validate: (params) => params.trim().match(MARKER_RE),
|
|
135
|
+
render: render({
|
|
136
|
+
instance,
|
|
137
|
+
context
|
|
138
|
+
})
|
|
139
|
+
})
|
|
51
140
|
};
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
name: 'iframe',
|
|
55
|
-
renderer: ({
|
|
56
|
-
instance,
|
|
57
|
-
context
|
|
58
|
-
}) => ({
|
|
59
|
-
marker: _bBerShapesDirectives.INLINE_DIRECTIVE_MARKER,
|
|
60
|
-
minMarkers: _bBerShapesDirectives.INLINE_DIRECTIVE_MARKER_MIN_LENGTH,
|
|
61
|
-
validate: params => (0, _trim.default)(params).call(params).match(MARKER_RE),
|
|
62
|
-
render: render({
|
|
63
|
-
instance,
|
|
64
|
-
context
|
|
65
|
-
})
|
|
66
|
-
})
|
|
67
|
-
};
|
|
141
|
+
//#endregion
|
|
142
|
+
module.exports = src_default;
|
package/package.json
CHANGED
|
@@ -1,14 +1,11 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@canopycanopycanopy/b-ber-grammar-iframe",
|
|
3
|
-
"version": "3.0.8-next.
|
|
3
|
+
"version": "3.0.8-next.97+2e9748e6",
|
|
4
4
|
"description": "",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"scripts": {
|
|
7
|
-
"
|
|
8
|
-
"
|
|
9
|
-
"prepare": "npm run clean && npm run prepare:dist",
|
|
10
|
-
"build": "npm run prepare",
|
|
11
|
-
"watch": "BABEL_ENV=production babel --config-file ../../babel.config.js -d dist/ src/ --watch src",
|
|
7
|
+
"build": "tsdown",
|
|
8
|
+
"typecheck": "tsc --noEmit",
|
|
12
9
|
"test": "jest"
|
|
13
10
|
},
|
|
14
11
|
"author": "Triple Canopy <b-ber@canopycanopycanopy.com> (https://triplecanopy.github.io/)",
|
|
@@ -17,19 +14,19 @@
|
|
|
17
14
|
"access": "public"
|
|
18
15
|
},
|
|
19
16
|
"devDependencies": {
|
|
20
|
-
"@
|
|
21
|
-
"@
|
|
22
|
-
"
|
|
23
|
-
"
|
|
24
|
-
"
|
|
25
|
-
"
|
|
17
|
+
"@swc/core": "^1.15.40",
|
|
18
|
+
"@swc/jest": "^0.2.39",
|
|
19
|
+
"jest": "^29.7.0",
|
|
20
|
+
"rimraf": "^2.7.1",
|
|
21
|
+
"tsdown": "^0.22.1",
|
|
22
|
+
"typescript": "^6.0.3"
|
|
26
23
|
},
|
|
27
24
|
"dependencies": {
|
|
28
|
-
"@canopycanopycanopy/b-ber-grammar-attributes": "3.0.8-next.
|
|
29
|
-
"@canopycanopycanopy/b-ber-lib": "3.0.8-next.
|
|
30
|
-
"@canopycanopycanopy/b-ber-logger": "3.0.8-next.
|
|
31
|
-
"@canopycanopycanopy/b-ber-parser-figure": "3.0.8-next.
|
|
32
|
-
"@canopycanopycanopy/b-ber-shapes-directives": "3.0.8-next.
|
|
25
|
+
"@canopycanopycanopy/b-ber-grammar-attributes": "3.0.8-next.97+2e9748e6",
|
|
26
|
+
"@canopycanopycanopy/b-ber-lib": "3.0.8-next.97+2e9748e6",
|
|
27
|
+
"@canopycanopycanopy/b-ber-logger": "3.0.8-next.97+2e9748e6",
|
|
28
|
+
"@canopycanopycanopy/b-ber-parser-figure": "3.0.8-next.97+2e9748e6",
|
|
29
|
+
"@canopycanopycanopy/b-ber-shapes-directives": "3.0.8-next.97+2e9748e6",
|
|
33
30
|
"fs-extra": "^8.1.0",
|
|
34
31
|
"lodash": "^4.17.21",
|
|
35
32
|
"lodash.isundefined": "^3.0.1",
|
|
@@ -52,5 +49,6 @@
|
|
|
52
49
|
"url": "https://maxwellsimmer.com"
|
|
53
50
|
}
|
|
54
51
|
],
|
|
55
|
-
"gitHead": "
|
|
52
|
+
"gitHead": "2e9748e6f00446cd35dc8f933e049d8200fc24dd",
|
|
53
|
+
"types": "dist/index.d.ts"
|
|
56
54
|
}
|
package/dist/helpers.js
DELETED
|
@@ -1,125 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
var _Object$keys = require("@babel/runtime-corejs3/core-js-stable/object/keys");
|
|
4
|
-
var _Object$getOwnPropertySymbols = require("@babel/runtime-corejs3/core-js-stable/object/get-own-property-symbols");
|
|
5
|
-
var _filterInstanceProperty = require("@babel/runtime-corejs3/core-js-stable/instance/filter");
|
|
6
|
-
var _Object$getOwnPropertyDescriptor = require("@babel/runtime-corejs3/core-js-stable/object/get-own-property-descriptor");
|
|
7
|
-
var _forEachInstanceProperty = require("@babel/runtime-corejs3/core-js-stable/instance/for-each");
|
|
8
|
-
var _Object$getOwnPropertyDescriptors = require("@babel/runtime-corejs3/core-js-stable/object/get-own-property-descriptors");
|
|
9
|
-
var _Object$defineProperties = require("@babel/runtime-corejs3/core-js-stable/object/define-properties");
|
|
10
|
-
var _Object$defineProperty = require("@babel/runtime-corejs3/core-js-stable/object/define-property");
|
|
11
|
-
var _interopRequireDefault = require("@babel/runtime-corejs3/helpers/interopRequireDefault");
|
|
12
|
-
_Object$defineProperty(exports, "__esModule", {
|
|
13
|
-
value: true
|
|
14
|
-
});
|
|
15
|
-
exports.createIframe = createIframe;
|
|
16
|
-
exports.createIframeInline = createIframeInline;
|
|
17
|
-
exports.prepare = prepare;
|
|
18
|
-
exports.supported = supported;
|
|
19
|
-
var _reduce = _interopRequireDefault(require("@babel/runtime-corejs3/core-js-stable/instance/reduce"));
|
|
20
|
-
var _entries = _interopRequireDefault(require("@babel/runtime-corejs3/core-js-stable/object/entries"));
|
|
21
|
-
var _concat = _interopRequireDefault(require("@babel/runtime-corejs3/core-js-stable/instance/concat"));
|
|
22
|
-
var _objectWithoutProperties2 = _interopRequireDefault(require("@babel/runtime-corejs3/helpers/objectWithoutProperties"));
|
|
23
|
-
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime-corejs3/helpers/defineProperty"));
|
|
24
|
-
var _State = _interopRequireDefault(require("@canopycanopycanopy/b-ber-lib/State"));
|
|
25
|
-
var _bBerLib = require("@canopycanopycanopy/b-ber-lib");
|
|
26
|
-
var _utils = require("@canopycanopycanopy/b-ber-lib/utils");
|
|
27
|
-
var _bBerGrammarAttributes = require("@canopycanopycanopy/b-ber-grammar-attributes");
|
|
28
|
-
var _bBerShapesDirectives = require("@canopycanopycanopy/b-ber-shapes-directives");
|
|
29
|
-
const _excluded = ["id", "commentStart", "commentEnd", "mediaType", "attrString", "source", "caption"];
|
|
30
|
-
function ownKeys(e, r) { var t = _Object$keys(e); if (_Object$getOwnPropertySymbols) { var o = _Object$getOwnPropertySymbols(e); r && (o = _filterInstanceProperty(o).call(o, function (r) { return _Object$getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
31
|
-
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var _context2, _context3; var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? _forEachInstanceProperty(_context2 = ownKeys(Object(t), !0)).call(_context2, function (r) { (0, _defineProperty2.default)(e, r, t[r]); }) : _Object$getOwnPropertyDescriptors ? _Object$defineProperties(e, _Object$getOwnPropertyDescriptors(t)) : _forEachInstanceProperty(_context3 = ownKeys(Object(t))).call(_context3, function (r) { _Object$defineProperty(e, r, _Object$getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
32
|
-
function supported(build) {
|
|
33
|
-
return build === 'reader' || build === 'web';
|
|
34
|
-
}
|
|
35
|
-
function prepare({
|
|
36
|
-
token,
|
|
37
|
-
marker,
|
|
38
|
-
context,
|
|
39
|
-
instance,
|
|
40
|
-
fileName,
|
|
41
|
-
lineNumber
|
|
42
|
-
}) {
|
|
43
|
-
const [, type, id, attrs] = marker;
|
|
44
|
-
const mediaType = (0, _utils.getMediaType)(type);
|
|
45
|
-
const figureId = (0, _bBerGrammarAttributes.htmlId)(id);
|
|
46
|
-
const page = `figure-${figureId}.xhtml`;
|
|
47
|
-
const attrsObject = _objectSpread({
|
|
48
|
-
source: '',
|
|
49
|
-
height: 150,
|
|
50
|
-
width: '100%',
|
|
51
|
-
title: '',
|
|
52
|
-
classes: '',
|
|
53
|
-
poster: ''
|
|
54
|
-
}, (0, _bBerGrammarAttributes.attributesObject)(attrs, type, {
|
|
55
|
-
fileName,
|
|
56
|
-
lineNumber
|
|
57
|
-
}));
|
|
58
|
-
(0, _utils.ensureSource)(attrsObject, type, fileName, lineNumber);
|
|
59
|
-
(0, _utils.ensurePoster)(attrsObject, type);
|
|
60
|
-
(0, _utils.ensureSupportedClassNames)(attrsObject, supported);
|
|
61
|
-
return _objectSpread(_objectSpread({}, attrsObject), {}, {
|
|
62
|
-
id: figureId,
|
|
63
|
-
attrString: (0, _bBerGrammarAttributes.attributesString)(attrsObject, {
|
|
64
|
-
classes: true
|
|
65
|
-
}),
|
|
66
|
-
commentStart: _bBerLib.Html.comment(`START: ${mediaType}:${type}#${figureId};`),
|
|
67
|
-
commentEnd: _bBerLib.Html.comment(`END: ${mediaType}:${type}#${figureId};`),
|
|
68
|
-
href: _State.default.build === 'reader' ? 'figures-titlepage.xhtml' : page,
|
|
69
|
-
ref: context.fileName,
|
|
70
|
-
caption: token.children ? instance.renderInline(token.children) : '',
|
|
71
|
-
page,
|
|
72
|
-
type,
|
|
73
|
-
mediaType,
|
|
74
|
-
mime: null,
|
|
75
|
-
pageOrder: _State.default.figures.length,
|
|
76
|
-
source: _bBerLib.Url.ensureDecoded(attrsObject.source),
|
|
77
|
-
poster: attrsObject.poster
|
|
78
|
-
});
|
|
79
|
-
}
|
|
80
|
-
function createIframe({
|
|
81
|
-
id,
|
|
82
|
-
href,
|
|
83
|
-
poster
|
|
84
|
-
}) {
|
|
85
|
-
return `
|
|
86
|
-
<div class="figure__small figure__small--landscape">
|
|
87
|
-
<figure id="ref${id}">
|
|
88
|
-
<a href="${href}#${id}">
|
|
89
|
-
${(0, _utils.renderPosterImage)(poster)}
|
|
90
|
-
</a>
|
|
91
|
-
</figure>
|
|
92
|
-
</div>`;
|
|
93
|
-
}
|
|
94
|
-
function createIframeInline(data) {
|
|
95
|
-
var _context;
|
|
96
|
-
const {
|
|
97
|
-
id,
|
|
98
|
-
commentStart,
|
|
99
|
-
commentEnd,
|
|
100
|
-
mediaType,
|
|
101
|
-
attrString: containerAttrsString,
|
|
102
|
-
source,
|
|
103
|
-
caption
|
|
104
|
-
} = data,
|
|
105
|
-
rest = (0, _objectWithoutProperties2.default)(data, _excluded);
|
|
106
|
-
const defaults = {
|
|
107
|
-
allow: 'fullscreen autoplay',
|
|
108
|
-
frameborder: '0'
|
|
109
|
-
};
|
|
110
|
-
const iframeAttrs = (0, _reduce.default)(_context = (0, _entries.default)(_objectSpread(_objectSpread({}, defaults), rest))).call(_context, (acc, [key, val]) => {
|
|
111
|
-
if (!_bBerShapesDirectives.htmlIframeAttributes.has(key) || val === '') return acc;
|
|
112
|
-
return (0, _concat.default)(acc).call(acc, `${key}="${val}"`);
|
|
113
|
-
}, []);
|
|
114
|
-
const iframeAttrsString = iframeAttrs.join(' ');
|
|
115
|
-
return `
|
|
116
|
-
${commentStart}
|
|
117
|
-
<section class="${mediaType} figure__large figure__inline">
|
|
118
|
-
<div id="${id}"${containerAttrsString}>
|
|
119
|
-
<iframe src="${source}" ${iframeAttrsString}>
|
|
120
|
-
</iframe>
|
|
121
|
-
</div>
|
|
122
|
-
${(0, _utils.renderCaption)(caption, mediaType)}
|
|
123
|
-
</section>
|
|
124
|
-
${commentEnd}`;
|
|
125
|
-
}
|