comark-ui 0.9.1 → 0.10.0

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.
@@ -168,6 +168,7 @@ const BLOCKS = [
168
168
  ["metrics", words("progress stats")],
169
169
  ["table", words("table")],
170
170
  ["tabs", words("code-group tabs-item")],
171
+ ["time", words("time")],
171
172
  ["xref", words("ref")]
172
173
  ];
173
174
  const on = (value, fallback = true) => value === void 0 ? fallback : value !== false;
@@ -256,6 +257,7 @@ function preset(renderer, options = {}) {
256
257
  add(renderer.outline, options.outline);
257
258
  parse(xref, options.xref);
258
259
  add(renderer.tests, options.tests, optionsOf(options.tests) ?? noFiles);
260
+ add(renderer.time, options.time);
259
261
  add(renderer.zoom, options.zoom);
260
262
  if (options.shiki) plugins.push(shiki_default(options.shiki));
261
263
  add(renderer.code, options.code, {
@@ -0,0 +1,15 @@
1
+ //#region ../../shared/styles.ts
2
+ /**
3
+ * Adds a package's styles to the page once, unless the page already carries them as a `style` or a `link` with
4
+ * `data-comark-<name>`, which is how the HTML renderer inlines them and how an app that imports `style.css` marks them.
5
+ */
6
+ function addStyles(name, css) {
7
+ const attribute = `data-comark-${name}`;
8
+ if (document.querySelector(`style[${attribute}],link[${attribute}]`)) return;
9
+ const style = document.createElement("style");
10
+ style.setAttribute(attribute, "");
11
+ style.textContent = css;
12
+ document.head.append(style);
13
+ }
14
+ //#endregion
15
+ export { addStyles as t };
@@ -31,6 +31,7 @@ import * as steps from "comark-steps/svelte";
31
31
  import * as table from "comark-table/svelte";
32
32
  import * as tabs from "comark-tabs/svelte";
33
33
  import * as tests from "comark-tests/svelte";
34
+ import * as time from "comark-time/svelte";
34
35
  import * as zoom from "comark-zoom/svelte";
35
36
  import Mermaid from "./Mermaid.svelte";
36
37
  import typeset from "./Typeset.svelte";
@@ -73,6 +74,7 @@ export default (options) =>
73
74
  table,
74
75
  tabs,
75
76
  tests,
77
+ time,
76
78
  typeset,
77
79
  zoom,
78
80
  },