@diplodoc/tabs-extension 3.10.8-transform5.0 → 3.10.8-transform5.1

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.
@@ -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';
@@ -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
- const meta = env.meta || (env.meta = {});
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
  }