@dr-ishaan/remake-blocks 1.2.0 → 1.3.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.
@@ -0,0 +1,50 @@
1
+ {
2
+ "$schema": "https://raw.githubusercontent.com/rehypejs/rehype-sanitize/main/schema.json",
3
+ "name": "remake-blocks-sanitize-schema",
4
+ "version": "1.3.0",
5
+ "description": "rehype-sanitize schema for @dr-ishaan/remake-blocks v1.3.0+. Allows all callout HTML elements, attributes, and CSS classes while stripping dangerous content (scripts, event handlers, javascript: URLs).",
6
+ "usage": {
7
+ "js": "import schema from '@dr-ishaan/remake-blocks/sanitize-schema.json';\nimport rehypeSanitize from 'rehype-sanitize';\n\n// Use in your unified pipeline:\nconst processor = unified()\n .use(remarkParse)\n .use(remarkRemakeBlocks)\n .use(remarkRehype, { allowDangerousHtml: true })\n .use(rehypeSanitize, schema)\n .use(rehypeStringify);",
8
+ "astro": "// astro.config.mjs\nimport { defineConfig } from 'astro/config';\nimport remakeBlocks from '@dr-ishaan/remake-blocks/astro';\nimport rehypeSanitize from 'rehype-sanitize';\nimport schema from '@dr-ishaan/remake-blocks/sanitize-schema.json';\n\nexport default defineConfig({\n integrations: [remakeBlocks()],\n markdown: {\n rehypePlugins: [[rehypeSanitize, schema]],\n },\n});"
9
+ },
10
+ "schema": {
11
+ "tagNames": [
12
+ "aside", "details", "summary", "div", "span", "p", "h1", "h2", "h3", "h4", "h5", "h6",
13
+ "ul", "ol", "li", "pre", "code", "blockquote", "hr", "a", "img",
14
+ "strong", "em", "del", "br", "svg", "circle", "line", "path", "polygon", "polyline", "rect", "title"
15
+ ],
16
+ "attributes": {
17
+ "*": ["class", "style", "id", "dir", "role", "aria-labelledby", "aria-hidden", "data-callout-type", "data-depth", "data-accordion", "data-category", "data-severity", "data-only-for-note"],
18
+ "aside": ["class", "style", "id", "dir", "role", "aria-labelledby", "data-callout-type"],
19
+ "details": ["class", "style", "id", "dir", "role", "aria-labelledby", "data-callout-type", "data-depth", "open"],
20
+ "summary": ["class", "style", "id", "dir"],
21
+ "a": ["href", "title", "class"],
22
+ "img": ["src", "alt", "title", "class", "width", "height"],
23
+ "code": ["class"],
24
+ "svg": ["xmlns", "width", "height", "viewBox", "fill", "stroke", "stroke-width", "stroke-linecap", "stroke-linejoin", "class"],
25
+ "circle": ["cx", "cy", "r", "fill", "stroke", "stroke-width"],
26
+ "line": ["x1", "y1", "x2", "y2", "fill", "stroke", "stroke-width", "stroke-linecap"],
27
+ "path": ["d", "fill", "stroke", "stroke-width", "stroke-linecap", "stroke-linejoin"],
28
+ "polygon": ["points", "fill", "stroke", "stroke-width"],
29
+ "polyline": ["points", "fill", "stroke", "stroke-width"],
30
+ "rect": ["x", "y", "width", "height", "rx", "fill", "stroke", "stroke-width"]
31
+ },
32
+ "protocols": {
33
+ "href": ["http", "https", "mailto", "tel", "ftp", "irc", "ircs"],
34
+ "src": ["http", "https", "data"]
35
+ },
36
+ "strip": ["script", "iframe", "object", "embed", "form", "input", "button", "style", "link", "meta", "base"],
37
+ "clobber": [],
38
+ "clobberPrefix": "",
39
+ "allowComments": false,
40
+ "allowDoctype": false
41
+ },
42
+ "notes": [
43
+ "This schema allows all elements and attributes that @dr-ishaan/remake-blocks v1.3.0+ produces.",
44
+ "It strips: <script>, <iframe>, <object>, <embed>, <form>, <input>, <button>, <style>, <link>, <meta>, <base>.",
45
+ "It blocks: javascript: URLs in href/src, all event handler attributes (onclick, onload, etc.).",
46
+ "It allows: class, style (limited to color properties), id (for aria-labelledby), dir, role, aria-* attributes, data-* attributes.",
47
+ "It allows: SVG elements and attributes needed for callout icons.",
48
+ "Use this schema with rehype-sanitize for belt-and-suspenders security on top of the plugin's safe-by-default HTML escaping."
49
+ ]
50
+ }
package/dist/styles.css CHANGED
@@ -619,3 +619,42 @@
619
619
  .disclosure-accordion { border-width: 1px; }
620
620
  .disclosure-tree { border-left-width: 1px; }
621
621
  }
622
+
623
+ /* ========================================================================
624
+ 14. Inline Callouts (v1.3.0+)
625
+ ======================================================================== */
626
+
627
+ /**
628
+ * Inline callouts float beside text on desktop, become full-width on mobile.
629
+ * Apply via the {inline} or {inline-end} per-callout override:
630
+ *
631
+ * > [!NOTE]{inline} — floats left, text wraps right
632
+ * > [!TIP]{inline-end} — floats right, text wraps left
633
+ *
634
+ * Responsive: on screens < 768px, inline callouts become full-width
635
+ * (no float) to avoid cramping on mobile.
636
+ */
637
+
638
+ .callout-inline {
639
+ float: left;
640
+ width: var(--callout-inline-width, 50%);
641
+ margin: 0 1em 1em 0;
642
+ clear: left;
643
+ }
644
+
645
+ .callout-inline-end {
646
+ float: right;
647
+ width: var(--callout-inline-width, 50%);
648
+ margin: 0 0 1em 1em;
649
+ clear: right;
650
+ }
651
+
652
+ @media (max-width: 768px) {
653
+ .callout-inline,
654
+ .callout-inline-end {
655
+ float: none;
656
+ width: 100%;
657
+ margin: 1em 0;
658
+ clear: both;
659
+ }
660
+ }