@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/README.md
CHANGED
|
@@ -264,12 +264,10 @@ Please read [CONTRIBUTING.md](CONTRIBUTING.md) for details on our code of conduc
|
|
|
264
264
|
|
|
265
265
|
## MarkdownIt compatibility
|
|
266
266
|
|
|
267
|
-
The plugin supports MarkdownIt 13 and 15. Its
|
|
268
|
-
|
|
269
|
-
Tokens are created by the active parser
|
|
270
|
-
loaded at runtime.
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
For MarkdownIt 15, native CommonJS declarations use an explicit import-mode type
|
|
275
|
-
query to avoid the upstream 15.0.3 CommonJS declaration shim issue.
|
|
267
|
+
The plugin supports MarkdownIt 13, 14 and 15. Its plugin callback describes the
|
|
268
|
+
core rule and token capabilities it uses, so different supported parser versions
|
|
269
|
+
can coexist in a TypeScript application. Tokens are created by the active parser
|
|
270
|
+
state; no private MarkdownIt module is loaded at runtime.
|
|
271
|
+
|
|
272
|
+
The installed-package compatibility tests use TypeScript 6.0.3 with NodeNext
|
|
273
|
+
module resolution and `skipLibCheck: false`, including CommonJS and ESM hosts.
|
|
@@ -1,6 +1,3 @@
|
|
|
1
|
-
import { type PluginOptions } from './transform';
|
|
1
|
+
import { type PluginOptions, type TabsPlugin } from './transform';
|
|
2
2
|
export * from './index';
|
|
3
|
-
export declare function transform(options?: Partial<PluginOptions>):
|
|
4
|
-
output?: string;
|
|
5
|
-
generateID?: import("@diplodoc/utils").IDGenerator;
|
|
6
|
-
}) => void;
|
|
3
|
+
export declare function transform(options?: Partial<PluginOptions>): TabsPlugin;
|
|
@@ -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 && onBundle2) {
|
|
1369
1372
|
onBundle2({ runtimeJsPath, runtimeCssPath, output }, env.bundled);
|
|
1370
1373
|
}
|