@diplodoc/tabs-extension 3.10.8-transform5.0 → 3.10.8-transform5.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/README.md +7 -9
- package/build/plugin/index-node.d.ts +2 -5
- package/build/plugin/index-node.js +14 -11
- package/build/plugin/index-node.js.map +2 -2
- package/build/plugin/index.d.ts +2 -0
- package/build/plugin/index.js +14 -11
- package/build/plugin/index.js.map +2 -2
- package/build/plugin/markdown-it.d.ts +28 -5
- package/build/plugin/transform.d.ts +4 -3
- package/build/runtime/index.d.ts +1 -1
- package/build/runtime/index.js +1 -1
- package/package.json +5 -4
package/build/plugin/index.d.ts
CHANGED
|
@@ -1,2 +1,4 @@
|
|
|
1
1
|
/** Tabs extension: MarkdownIt plugin that transforms `{% list tabs %}` into tab HTML. */
|
|
2
2
|
export { transform } from './transform';
|
|
3
|
+
export type { PluginOptions, TabsPlugin, TransformOptions } from './transform';
|
|
4
|
+
export type { MarkdownIt, StateCore, Token } from './markdown-it';
|
package/build/plugin/index.js
CHANGED
|
@@ -1304,6 +1304,19 @@ var defaultFeatures = {
|
|
|
1304
1304
|
}
|
|
1305
1305
|
};
|
|
1306
1306
|
var runsCounter = 0;
|
|
1307
|
+
function appendRuntimeMeta(env, runtimeJsPath, runtimeCssPath) {
|
|
1308
|
+
const meta = env.meta || (env.meta = {});
|
|
1309
|
+
if (typeof meta !== "object" || meta === null) {
|
|
1310
|
+
throw new TypeError("Expected env.meta to be an object.");
|
|
1311
|
+
}
|
|
1312
|
+
if (!("script" in meta) || !meta.script) Object.assign(meta, { script: [] });
|
|
1313
|
+
if (!("style" in meta) || !meta.style) Object.assign(meta, { style: [] });
|
|
1314
|
+
if (!("script" in meta) || !Array.isArray(meta.script) || !("style" in meta) || !Array.isArray(meta.style)) {
|
|
1315
|
+
throw new TypeError("Expected runtime script and style arrays.");
|
|
1316
|
+
}
|
|
1317
|
+
meta.script.push(runtimeJsPath);
|
|
1318
|
+
meta.style.push(runtimeCssPath);
|
|
1319
|
+
}
|
|
1307
1320
|
function transform(options = {}) {
|
|
1308
1321
|
const {
|
|
1309
1322
|
runtimeJsPath = "_assets/tabs-extension.js",
|
|
@@ -1354,17 +1367,7 @@ function transform(options = {}) {
|
|
|
1354
1367
|
}
|
|
1355
1368
|
}
|
|
1356
1369
|
if (tabsAreInserted) {
|
|
1357
|
-
|
|
1358
|
-
if (typeof meta !== "object" || meta === null) {
|
|
1359
|
-
throw new TypeError("Expected env.meta to be an object.");
|
|
1360
|
-
}
|
|
1361
|
-
if (!("script" in meta) || !meta.script) Object.assign(meta, { script: [] });
|
|
1362
|
-
if (!("style" in meta) || !meta.style) Object.assign(meta, { style: [] });
|
|
1363
|
-
if (!("script" in meta) || !Array.isArray(meta.script) || !("style" in meta) || !Array.isArray(meta.style)) {
|
|
1364
|
-
throw new TypeError("Expected runtime script and style arrays.");
|
|
1365
|
-
}
|
|
1366
|
-
meta.script.push(runtimeJsPath);
|
|
1367
|
-
meta.style.push(runtimeCssPath);
|
|
1370
|
+
appendRuntimeMeta(env, runtimeJsPath, runtimeCssPath);
|
|
1368
1371
|
if (bundle && onBundle) {
|
|
1369
1372
|
onBundle({ runtimeJsPath, runtimeCssPath, output }, env.bundled);
|
|
1370
1373
|
}
|