@readme/markdown 15.2.1 → 15.4.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.
@@ -17,8 +17,15 @@ export declare const CUSTOM_PROP_BOUNDARIES: string[];
17
17
  */
18
18
  export declare const RUNTIME_COMPONENT_TAGS: Set<string>;
19
19
  /**
20
- * Standard HTML tags that should never be treated as custom components.
21
- * Uses the html-tags package, converted to a Set<string> for efficient lookups.
20
+ * Standard HTML tags list.
21
+ * A use case of this is to differentiate custom components tag vs standard HTML tags.
22
+ *
23
+ * Unioned from:
24
+ * - `html-tags`: All modern spec HTML elements
25
+ * - parse5's `TAG_NAMES`: Elements the HTML tree-construction algorithm has to special-case
26
+ * This includes obsolete tags that are still rendered by browsers.
27
+ * - NON_STANDARD_TAGS: We've had to filter because currently parse5's `TAG_NAMES` set over-enumerates
28
+ * tags that are not actually standard HTML tags. It also allows custom tags to be filtered out.
22
29
  */
23
30
  export declare const STANDARD_HTML_TAGS: Set<string>;
24
31
  /**
@@ -1,5 +1,17 @@
1
1
  import postcss from 'postcss';
2
- export declare function tailwindCompiler(classes: string[], { prefix, darkModeDataAttribute }: {
2
+ export declare function tailwindCompiler(classes: string[], { prefix, darkModeDataAttribute, darkModeRootSelector, }: {
3
3
  darkModeDataAttribute?: string | null;
4
+ /**
5
+ * Scopes the `dark:` variant to `darkModeRootSelector[darkModeDataAttribute=dark]`
6
+ * (self or descendant) instead of matching `[darkModeDataAttribute=dark]` on *any*
7
+ * ancestor. Matches `when-color-mode-dark($root)` in `styles/mixins/when-color-mode-dark.scss`
8
+ * — see that mixin's doc comment for the full rationale (two independent
9
+ * `data-color-mode` scopes on one page, e.g. readme's SuperHub admin shell vs. the
10
+ * hub content it's previewing) and why there's no default: this package ships one
11
+ * precompiled stylesheet, so whatever a caller passes is permanent for every
12
+ * installer, and readme (this package's only real consumer today) is expected to
13
+ * pass its hub color-mode root, `.rm-ReadMe`.
14
+ */
15
+ darkModeRootSelector?: string | null;
4
16
  prefix: string;
5
17
  }): Promise<postcss.Result<postcss.Root>>;
package/package.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "name": "@readme/markdown",
3
3
  "description": "ReadMe's React-based Markdown parser",
4
4
  "author": "Rafe Goldberg <rafe@readme.io>",
5
- "version": "15.2.1",
5
+ "version": "15.4.0",
6
6
  "main": "dist/main.node.js",
7
7
  "types": "dist/index.d.ts",
8
8
  "browser": "dist/main.js",
@@ -82,6 +82,7 @@
82
82
  "micromark-util-html-tag-name": "^2.0.1",
83
83
  "micromark-util-subtokenize": "2.0.4",
84
84
  "micromark-util-symbol": "^2.0.1",
85
+ "parse5": "^7.3.0",
85
86
  "path-browserify": "^1.0.1",
86
87
  "postcss": "^8.5.10",
87
88
  "postcss-prefix-selector": "^2.1.0",