@memorysmithapp/markdown-renderer 0.3.1 → 0.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.
Files changed (56) hide show
  1. package/README.md +32 -4
  2. package/dist/Markdown.d.ts +6 -2
  3. package/dist/Markdown.js +126 -17
  4. package/dist/NoteActions.d.ts +9 -0
  5. package/dist/NoteActions.js +68 -0
  6. package/dist/NoteBody.d.ts +23 -2
  7. package/dist/NoteBody.js +73 -7
  8. package/dist/edit/AttachDialog.d.ts +21 -0
  9. package/dist/edit/AttachDialog.js +126 -0
  10. package/dist/edit/ContextMenu.d.ts +29 -0
  11. package/dist/edit/ContextMenu.js +95 -0
  12. package/dist/edit/LanguageControl.d.ts +19 -0
  13. package/dist/edit/LanguageControl.js +124 -0
  14. package/dist/edit/NoteEditor.d.ts +43 -0
  15. package/dist/edit/NoteEditor.js +461 -0
  16. package/dist/edit/analyze.d.ts +150 -0
  17. package/dist/edit/analyze.js +268 -0
  18. package/dist/edit/blocks.d.ts +96 -0
  19. package/dist/edit/blocks.js +480 -0
  20. package/dist/edit/commands.d.ts +78 -0
  21. package/dist/edit/commands.js +257 -0
  22. package/dist/edit/frontmatter.d.ts +45 -0
  23. package/dist/edit/frontmatter.js +142 -0
  24. package/dist/edit/index.d.ts +4 -0
  25. package/dist/edit/index.js +6 -0
  26. package/dist/edit/live.d.ts +28 -0
  27. package/dist/edit/live.js +675 -0
  28. package/dist/edit/saves.d.ts +18 -0
  29. package/dist/edit/saves.js +52 -0
  30. package/dist/edit/table.d.ts +58 -0
  31. package/dist/edit/table.js +185 -0
  32. package/dist/file-types.d.ts +30 -0
  33. package/dist/file-types.js +70 -0
  34. package/dist/highlight.d.ts +21 -7
  35. package/dist/highlight.js +56 -7
  36. package/dist/host.d.ts +60 -3
  37. package/dist/host.js +8 -0
  38. package/dist/index.d.ts +4 -4
  39. package/dist/mode-icons.d.ts +6 -0
  40. package/dist/mode-icons.js +11 -0
  41. package/dist/prism-grammars.d.ts +18 -0
  42. package/dist/prism-grammars.js +305 -0
  43. package/dist/remark-callouts.d.ts +6 -0
  44. package/dist/remark-callouts.js +2 -2
  45. package/dist/remark-ring.d.ts +5 -0
  46. package/dist/remark-ring.js +25 -15
  47. package/dist/slots.js +17 -1
  48. package/dist/strings.d.ts +127 -1
  49. package/dist/strings.js +126 -1
  50. package/dist/task-saves.d.ts +35 -0
  51. package/dist/task-saves.js +86 -0
  52. package/dist/theme.d.ts +49 -0
  53. package/dist/theme.js +3 -2
  54. package/package.json +14 -2
  55. package/structure.css +331 -0
  56. package/theme-default.css +1084 -0
@@ -0,0 +1,6 @@
1
+ export declare const ICON_EDIT: import("react").JSX.Element;
2
+ export declare const ICON_VIEW: import("react").JSX.Element;
3
+ export declare const ICON_MARKDOWN: import("react").JSX.Element;
4
+ export declare const ICON_COPY: import("react").JSX.Element;
5
+ export declare const ICON_CHECK: import("react").JSX.Element;
6
+ export declare const ICON_CLOSE: import("react").JSX.Element;
@@ -0,0 +1,11 @@
1
+ import { jsx as _jsx } from "react/jsx-runtime";
2
+ // The icons of the switch between reading and editing (#51): Lucide's pencil and eye (ISC), drawn
3
+ // in the current colour at the size of the text. Apart from the editor, which loads on demand.
4
+ const svg = (...paths) => (_jsx("svg", { className: "mode-switch-glyph", viewBox: "0 0 24 24", width: "1em", height: "1em", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round", "aria-hidden": "true", children: paths.map((d) => (_jsx("path", { d: d }, d))) }));
5
+ export const ICON_EDIT = svg('M21.17 6.81a1 1 0 0 0-3.99-3.99L3.84 16.17a2 2 0 0 0-.5.83l-1.32 4.35a.5.5 0 0 0 .62.62l4.35-1.32a2 2 0 0 0 .83-.5z', 'm15 5 4 4');
6
+ export const ICON_VIEW = svg('M2.06 12.35a1 1 0 0 1 0-.7 10.75 10.75 0 0 1 19.88 0 1 1 0 0 1 0 .7 10.75 10.75 0 0 1-19.88 0', 'M12 9a3 3 0 1 0 0 6 3 3 0 0 0 0-6z');
7
+ // The buttons beside the switch (#76): Lucide's file-code, copy, check and x (ISC).
8
+ export const ICON_MARKDOWN = svg('M10 12.5 8 15l2 2.5', 'm14 12.5 2 2.5-2 2.5', 'M14 2v4a2 2 0 0 0 2 2h4', 'M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7z');
9
+ export const ICON_COPY = svg('M10 8h10a2 2 0 0 1 2 2v10a2 2 0 0 1-2 2H10a2 2 0 0 1-2-2V10a2 2 0 0 1 2-2z', 'M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2');
10
+ export const ICON_CHECK = svg('M20 6 9 17l-5-5');
11
+ export const ICON_CLOSE = svg('M18 6 6 18', 'm6 6 12 12');
@@ -0,0 +1,18 @@
1
+ /**
2
+ * Every grammar `refractor` 5.0.0 carries — Prism's grammars, as a hast tree — written by
3
+ * `scripts/prism-grammars.mjs` (#84): its identifier, its aliases, the name a person reads, and the
4
+ * import that loads it, so a bundler splits each into a chunk a page downloads only when a note
5
+ * names it. Do not edit by hand: run the script.
6
+ */
7
+ import type { Syntax } from 'refractor/core';
8
+ export interface Grammar {
9
+ readonly id: string;
10
+ readonly title: string;
11
+ readonly aliases: readonly string[];
12
+ /** A part of other grammars, or a diagram's: loaded when named, never offered. */
13
+ readonly part?: true;
14
+ readonly load: () => Promise<{
15
+ default: Syntax;
16
+ }>;
17
+ }
18
+ export declare const GRAMMARS: readonly Grammar[];
@@ -0,0 +1,305 @@
1
+ /**
2
+ * Every grammar `refractor` 5.0.0 carries — Prism's grammars, as a hast tree — written by
3
+ * `scripts/prism-grammars.mjs` (#84): its identifier, its aliases, the name a person reads, and the
4
+ * import that loads it, so a bundler splits each into a chunk a page downloads only when a note
5
+ * names it. Do not edit by hand: run the script.
6
+ */
7
+ export const GRAMMARS = [
8
+ { id: "abap", title: "ABAP", aliases: [], load: () => import('refractor/abap') },
9
+ { id: "abnf", title: "ABNF", aliases: [], load: () => import('refractor/abnf') },
10
+ { id: "actionscript", title: "ActionScript", aliases: [], load: () => import('refractor/actionscript') },
11
+ { id: "ada", title: "Ada", aliases: [], load: () => import('refractor/ada') },
12
+ { id: "agda", title: "Agda", aliases: [], load: () => import('refractor/agda') },
13
+ { id: "al", title: "AL", aliases: [], load: () => import('refractor/al') },
14
+ { id: "antlr4", title: "ANTLR4", aliases: ["g4"], load: () => import('refractor/antlr4') },
15
+ { id: "apacheconf", title: "Apache Configuration", aliases: [], load: () => import('refractor/apacheconf') },
16
+ { id: "apex", title: "Apex", aliases: [], load: () => import('refractor/apex') },
17
+ { id: "apl", title: "APL", aliases: [], load: () => import('refractor/apl') },
18
+ { id: "applescript", title: "AppleScript", aliases: [], load: () => import('refractor/applescript') },
19
+ { id: "aql", title: "AQL", aliases: [], load: () => import('refractor/aql') },
20
+ { id: "arduino", title: "Arduino", aliases: ["ino"], load: () => import('refractor/arduino') },
21
+ { id: "arff", title: "ARFF", aliases: [], load: () => import('refractor/arff') },
22
+ { id: "armasm", title: "ARM Assembly", aliases: ["arm-asm"], load: () => import('refractor/armasm') },
23
+ { id: "arturo", title: "Arturo", aliases: ["art"], load: () => import('refractor/arturo') },
24
+ { id: "asciidoc", title: "AsciiDoc", aliases: ["adoc"], load: () => import('refractor/asciidoc') },
25
+ { id: "asm6502", title: "6502 Assembly", aliases: [], load: () => import('refractor/asm6502') },
26
+ { id: "asmatmel", title: "Atmel AVR Assembly", aliases: [], load: () => import('refractor/asmatmel') },
27
+ { id: "aspnet", title: "ASP.NET (C#)", aliases: [], load: () => import('refractor/aspnet') },
28
+ { id: "autohotkey", title: "AutoHotkey", aliases: [], load: () => import('refractor/autohotkey') },
29
+ { id: "autoit", title: "AutoIt", aliases: [], load: () => import('refractor/autoit') },
30
+ { id: "avisynth", title: "AviSynth", aliases: ["avs"], load: () => import('refractor/avisynth') },
31
+ { id: "avro-idl", title: "Avro IDL", aliases: ["avdl"], load: () => import('refractor/avro-idl') },
32
+ { id: "awk", title: "AWK", aliases: ["gawk"], load: () => import('refractor/awk') },
33
+ { id: "bash", title: "Bash", aliases: ["sh", "shell"], load: () => import('refractor/bash') },
34
+ { id: "basic", title: "BASIC", aliases: [], load: () => import('refractor/basic') },
35
+ { id: "batch", title: "Batch", aliases: [], load: () => import('refractor/batch') },
36
+ { id: "bbcode", title: "BBcode", aliases: ["shortcode"], load: () => import('refractor/bbcode') },
37
+ { id: "bbj", title: "BBj", aliases: [], load: () => import('refractor/bbj') },
38
+ { id: "bicep", title: "Bicep", aliases: [], load: () => import('refractor/bicep') },
39
+ { id: "birb", title: "Birb", aliases: [], load: () => import('refractor/birb') },
40
+ { id: "bison", title: "Bison", aliases: [], load: () => import('refractor/bison') },
41
+ { id: "bnf", title: "BNF", aliases: ["rbnf"], load: () => import('refractor/bnf') },
42
+ { id: "bqn", title: "BQN", aliases: [], load: () => import('refractor/bqn') },
43
+ { id: "brainfuck", title: "Brainfuck", aliases: [], load: () => import('refractor/brainfuck') },
44
+ { id: "brightscript", title: "BrightScript", aliases: [], load: () => import('refractor/brightscript') },
45
+ { id: "bro", title: "Bro", aliases: [], load: () => import('refractor/bro') },
46
+ { id: "bsl", title: "BSL (1C:Enterprise)", aliases: ["oscript"], load: () => import('refractor/bsl') },
47
+ { id: "c", title: "C", aliases: [], load: () => import('refractor/c') },
48
+ { id: "cfscript", title: "CFScript", aliases: ["cfc"], load: () => import('refractor/cfscript') },
49
+ { id: "chaiscript", title: "ChaiScript", aliases: [], load: () => import('refractor/chaiscript') },
50
+ { id: "cil", title: "CIL", aliases: [], load: () => import('refractor/cil') },
51
+ { id: "cilkc", title: "Cilk/C", aliases: ["cilk-c"], load: () => import('refractor/cilkc') },
52
+ { id: "cilkcpp", title: "Cilk/C++", aliases: ["cilk", "cilk-cpp"], load: () => import('refractor/cilkcpp') },
53
+ { id: "clike", title: "clike", aliases: [], part: true, load: () => import('refractor/clike') },
54
+ { id: "clojure", title: "Clojure", aliases: [], load: () => import('refractor/clojure') },
55
+ { id: "cmake", title: "CMake", aliases: [], load: () => import('refractor/cmake') },
56
+ { id: "cobol", title: "COBOL", aliases: [], load: () => import('refractor/cobol') },
57
+ { id: "coffeescript", title: "CoffeeScript", aliases: ["coffee"], load: () => import('refractor/coffeescript') },
58
+ { id: "concurnas", title: "Concurnas", aliases: ["conc"], load: () => import('refractor/concurnas') },
59
+ { id: "cooklang", title: "Cooklang", aliases: [], load: () => import('refractor/cooklang') },
60
+ { id: "coq", title: "Coq", aliases: [], load: () => import('refractor/coq') },
61
+ { id: "cpp", title: "C++", aliases: [], load: () => import('refractor/cpp') },
62
+ { id: "crystal", title: "Crystal", aliases: [], load: () => import('refractor/crystal') },
63
+ { id: "csharp", title: "C#", aliases: ["cs", "dotnet"], load: () => import('refractor/csharp') },
64
+ { id: "cshtml", title: "Razor C#", aliases: ["razor"], load: () => import('refractor/cshtml') },
65
+ { id: "csp", title: "Content-Security-Policy", aliases: [], load: () => import('refractor/csp') },
66
+ { id: "css", title: "CSS", aliases: [], load: () => import('refractor/css') },
67
+ { id: "css-extras", title: "css-extras", aliases: [], part: true, load: () => import('refractor/css-extras') },
68
+ { id: "csv", title: "CSV", aliases: [], load: () => import('refractor/csv') },
69
+ { id: "cue", title: "CUE", aliases: [], load: () => import('refractor/cue') },
70
+ { id: "cypher", title: "Cypher", aliases: [], load: () => import('refractor/cypher') },
71
+ { id: "d", title: "D", aliases: [], load: () => import('refractor/d') },
72
+ { id: "dart", title: "Dart", aliases: [], load: () => import('refractor/dart') },
73
+ { id: "dataweave", title: "DataWeave", aliases: [], load: () => import('refractor/dataweave') },
74
+ { id: "dax", title: "DAX", aliases: [], load: () => import('refractor/dax') },
75
+ { id: "dhall", title: "Dhall", aliases: [], load: () => import('refractor/dhall') },
76
+ { id: "diff", title: "Diff", aliases: [], load: () => import('refractor/diff') },
77
+ { id: "django", title: "Django/Jinja2", aliases: ["jinja2"], load: () => import('refractor/django') },
78
+ { id: "dns-zone-file", title: "DNS zone file", aliases: ["dns-zone"], load: () => import('refractor/dns-zone-file') },
79
+ { id: "docker", title: "Docker", aliases: ["dockerfile"], load: () => import('refractor/docker') },
80
+ { id: "dot", title: "DOT (Graphviz)", aliases: ["gv"], load: () => import('refractor/dot') },
81
+ { id: "ebnf", title: "EBNF", aliases: [], load: () => import('refractor/ebnf') },
82
+ { id: "editorconfig", title: "EditorConfig", aliases: [], load: () => import('refractor/editorconfig') },
83
+ { id: "eiffel", title: "Eiffel", aliases: [], load: () => import('refractor/eiffel') },
84
+ { id: "ejs", title: "EJS", aliases: ["eta"], load: () => import('refractor/ejs') },
85
+ { id: "elixir", title: "Elixir", aliases: [], load: () => import('refractor/elixir') },
86
+ { id: "elm", title: "Elm", aliases: [], load: () => import('refractor/elm') },
87
+ { id: "erb", title: "ERB", aliases: [], load: () => import('refractor/erb') },
88
+ { id: "erlang", title: "Erlang", aliases: [], load: () => import('refractor/erlang') },
89
+ { id: "etlua", title: "Embedded Lua templating", aliases: [], load: () => import('refractor/etlua') },
90
+ { id: "excel-formula", title: "Excel Formula", aliases: ["xls", "xlsx"], load: () => import('refractor/excel-formula') },
91
+ { id: "factor", title: "Factor", aliases: [], load: () => import('refractor/factor') },
92
+ { id: "false", title: "False", aliases: [], load: () => import('refractor/false') },
93
+ { id: "firestore-security-rules", title: "Firestore security rules", aliases: [], load: () => import('refractor/firestore-security-rules') },
94
+ { id: "flow", title: "Flow", aliases: [], load: () => import('refractor/flow') },
95
+ { id: "fortran", title: "Fortran", aliases: [], load: () => import('refractor/fortran') },
96
+ { id: "fsharp", title: "F#", aliases: [], load: () => import('refractor/fsharp') },
97
+ { id: "ftl", title: "FreeMarker Template Language", aliases: [], load: () => import('refractor/ftl') },
98
+ { id: "gap", title: "GAP (CAS)", aliases: [], load: () => import('refractor/gap') },
99
+ { id: "gcode", title: "G-code", aliases: [], load: () => import('refractor/gcode') },
100
+ { id: "gdscript", title: "GDScript", aliases: [], load: () => import('refractor/gdscript') },
101
+ { id: "gedcom", title: "GEDCOM", aliases: [], load: () => import('refractor/gedcom') },
102
+ { id: "gettext", title: "gettext", aliases: ["po"], load: () => import('refractor/gettext') },
103
+ { id: "gherkin", title: "Gherkin", aliases: [], load: () => import('refractor/gherkin') },
104
+ { id: "git", title: "Git", aliases: [], load: () => import('refractor/git') },
105
+ { id: "glsl", title: "GLSL", aliases: [], load: () => import('refractor/glsl') },
106
+ { id: "gml", title: "GameMaker Language", aliases: ["gamemakerlanguage"], load: () => import('refractor/gml') },
107
+ { id: "gn", title: "GN", aliases: ["gni"], load: () => import('refractor/gn') },
108
+ { id: "go", title: "Go", aliases: [], load: () => import('refractor/go') },
109
+ { id: "go-module", title: "Go module", aliases: ["go-mod"], load: () => import('refractor/go-module') },
110
+ { id: "gradle", title: "Gradle", aliases: [], load: () => import('refractor/gradle') },
111
+ { id: "graphql", title: "GraphQL", aliases: [], load: () => import('refractor/graphql') },
112
+ { id: "groovy", title: "Groovy", aliases: [], load: () => import('refractor/groovy') },
113
+ { id: "haml", title: "Haml", aliases: [], load: () => import('refractor/haml') },
114
+ { id: "handlebars", title: "Handlebars", aliases: ["hbs", "mustache"], load: () => import('refractor/handlebars') },
115
+ { id: "haskell", title: "Haskell", aliases: ["hs"], load: () => import('refractor/haskell') },
116
+ { id: "haxe", title: "Haxe", aliases: [], load: () => import('refractor/haxe') },
117
+ { id: "hcl", title: "HCL", aliases: [], load: () => import('refractor/hcl') },
118
+ { id: "hlsl", title: "HLSL", aliases: [], load: () => import('refractor/hlsl') },
119
+ { id: "hoon", title: "Hoon", aliases: [], load: () => import('refractor/hoon') },
120
+ { id: "hpkp", title: "HTTP Public-Key-Pins", aliases: [], load: () => import('refractor/hpkp') },
121
+ { id: "hsts", title: "HTTP Strict-Transport-Security", aliases: [], load: () => import('refractor/hsts') },
122
+ { id: "http", title: "HTTP", aliases: [], load: () => import('refractor/http') },
123
+ { id: "ichigojam", title: "IchigoJam", aliases: [], load: () => import('refractor/ichigojam') },
124
+ { id: "icon", title: "Icon", aliases: [], load: () => import('refractor/icon') },
125
+ { id: "icu-message-format", title: "ICU Message Format", aliases: [], load: () => import('refractor/icu-message-format') },
126
+ { id: "idris", title: "Idris", aliases: ["idr"], load: () => import('refractor/idris') },
127
+ { id: "iecst", title: "Structured Text (IEC 61131-3)", aliases: [], load: () => import('refractor/iecst') },
128
+ { id: "ignore", title: ".ignore", aliases: ["gitignore", "hgignore", "npmignore"], load: () => import('refractor/ignore') },
129
+ { id: "inform7", title: "Inform 7", aliases: [], load: () => import('refractor/inform7') },
130
+ { id: "ini", title: "INI", aliases: [], load: () => import('refractor/ini') },
131
+ { id: "io", title: "Io", aliases: [], load: () => import('refractor/io') },
132
+ { id: "j", title: "J", aliases: [], load: () => import('refractor/j') },
133
+ { id: "java", title: "Java", aliases: [], load: () => import('refractor/java') },
134
+ { id: "javadoc", title: "JavaDoc", aliases: [], load: () => import('refractor/javadoc') },
135
+ { id: "javadoclike", title: "javadoclike", aliases: [], part: true, load: () => import('refractor/javadoclike') },
136
+ { id: "javascript", title: "JavaScript", aliases: ["js"], load: () => import('refractor/javascript') },
137
+ { id: "javastacktrace", title: "Java stack trace", aliases: [], load: () => import('refractor/javastacktrace') },
138
+ { id: "jexl", title: "Jexl", aliases: [], load: () => import('refractor/jexl') },
139
+ { id: "jolie", title: "Jolie", aliases: [], load: () => import('refractor/jolie') },
140
+ { id: "jq", title: "JQ", aliases: [], load: () => import('refractor/jq') },
141
+ { id: "js-extras", title: "js-extras", aliases: [], part: true, load: () => import('refractor/js-extras') },
142
+ { id: "js-templates", title: "js-templates", aliases: [], part: true, load: () => import('refractor/js-templates') },
143
+ { id: "jsdoc", title: "JSDoc", aliases: [], load: () => import('refractor/jsdoc') },
144
+ { id: "json", title: "JSON", aliases: ["webmanifest"], load: () => import('refractor/json') },
145
+ { id: "json5", title: "JSON5", aliases: [], load: () => import('refractor/json5') },
146
+ { id: "jsonp", title: "JSONP", aliases: [], load: () => import('refractor/jsonp') },
147
+ { id: "jsstacktrace", title: "JS stack trace", aliases: [], load: () => import('refractor/jsstacktrace') },
148
+ { id: "jsx", title: "JSX", aliases: [], load: () => import('refractor/jsx') },
149
+ { id: "julia", title: "Julia", aliases: [], load: () => import('refractor/julia') },
150
+ { id: "keepalived", title: "Keepalived Configure", aliases: [], load: () => import('refractor/keepalived') },
151
+ { id: "keyman", title: "Keyman", aliases: [], load: () => import('refractor/keyman') },
152
+ { id: "kotlin", title: "Kotlin", aliases: ["kt", "kts"], load: () => import('refractor/kotlin') },
153
+ { id: "kumir", title: "KuMir", aliases: ["kum"], load: () => import('refractor/kumir') },
154
+ { id: "kusto", title: "Kusto", aliases: [], load: () => import('refractor/kusto') },
155
+ { id: "latex", title: "LaTeX", aliases: ["context", "tex"], load: () => import('refractor/latex') },
156
+ { id: "latte", title: "Latte", aliases: [], load: () => import('refractor/latte') },
157
+ { id: "less", title: "Less", aliases: [], load: () => import('refractor/less') },
158
+ { id: "lilypond", title: "LilyPond", aliases: ["ly"], load: () => import('refractor/lilypond') },
159
+ { id: "linker-script", title: "Linker script", aliases: ["ld"], load: () => import('refractor/linker-script') },
160
+ { id: "liquid", title: "Liquid", aliases: [], load: () => import('refractor/liquid') },
161
+ { id: "lisp", title: "Lisp", aliases: ["elisp", "emacs", "emacs-lisp"], load: () => import('refractor/lisp') },
162
+ { id: "livescript", title: "LiveScript", aliases: [], load: () => import('refractor/livescript') },
163
+ { id: "llvm", title: "LLVM IR", aliases: [], load: () => import('refractor/llvm') },
164
+ { id: "log", title: "Log file", aliases: [], load: () => import('refractor/log') },
165
+ { id: "lolcode", title: "LOLCODE", aliases: [], load: () => import('refractor/lolcode') },
166
+ { id: "lua", title: "Lua", aliases: [], load: () => import('refractor/lua') },
167
+ { id: "magma", title: "Magma (CAS)", aliases: [], load: () => import('refractor/magma') },
168
+ { id: "makefile", title: "Makefile", aliases: [], load: () => import('refractor/makefile') },
169
+ { id: "markdown", title: "Markdown", aliases: ["md"], load: () => import('refractor/markdown') },
170
+ { id: "markup", title: "Markup (HTML, XML, SVG)", aliases: ["atom", "html", "mathml", "rss", "ssml", "svg", "xml"], load: () => import('refractor/markup') },
171
+ { id: "markup-templating", title: "markup-templating", aliases: [], part: true, load: () => import('refractor/markup-templating') },
172
+ { id: "mata", title: "Mata", aliases: [], load: () => import('refractor/mata') },
173
+ { id: "matlab", title: "MATLAB", aliases: [], load: () => import('refractor/matlab') },
174
+ { id: "maxscript", title: "MAXScript", aliases: [], load: () => import('refractor/maxscript') },
175
+ { id: "mel", title: "MEL", aliases: [], load: () => import('refractor/mel') },
176
+ { id: "mermaid", title: "mermaid", aliases: [], part: true, load: () => import('refractor/mermaid') },
177
+ { id: "metafont", title: "METAFONT", aliases: [], load: () => import('refractor/metafont') },
178
+ { id: "mizar", title: "Mizar", aliases: [], load: () => import('refractor/mizar') },
179
+ { id: "mongodb", title: "MongoDB", aliases: [], load: () => import('refractor/mongodb') },
180
+ { id: "monkey", title: "Monkey", aliases: [], load: () => import('refractor/monkey') },
181
+ { id: "moonscript", title: "MoonScript", aliases: ["moon"], load: () => import('refractor/moonscript') },
182
+ { id: "n1ql", title: "N1QL", aliases: [], load: () => import('refractor/n1ql') },
183
+ { id: "n4js", title: "N4JS", aliases: ["n4jsd"], load: () => import('refractor/n4js') },
184
+ { id: "nand2tetris-hdl", title: "Nand To Tetris HDL", aliases: [], load: () => import('refractor/nand2tetris-hdl') },
185
+ { id: "naniscript", title: "Naninovel Script", aliases: ["nani"], load: () => import('refractor/naniscript') },
186
+ { id: "nasm", title: "NASM", aliases: [], load: () => import('refractor/nasm') },
187
+ { id: "neon", title: "NEON", aliases: [], load: () => import('refractor/neon') },
188
+ { id: "nevod", title: "Nevod", aliases: [], load: () => import('refractor/nevod') },
189
+ { id: "nginx", title: "nginx", aliases: [], load: () => import('refractor/nginx') },
190
+ { id: "nim", title: "Nim", aliases: [], load: () => import('refractor/nim') },
191
+ { id: "nix", title: "Nix", aliases: [], load: () => import('refractor/nix') },
192
+ { id: "nsis", title: "NSIS", aliases: [], load: () => import('refractor/nsis') },
193
+ { id: "objectivec", title: "Objective-C", aliases: ["objc"], load: () => import('refractor/objectivec') },
194
+ { id: "ocaml", title: "OCaml", aliases: [], load: () => import('refractor/ocaml') },
195
+ { id: "odin", title: "Odin", aliases: [], load: () => import('refractor/odin') },
196
+ { id: "opencl", title: "OpenCL", aliases: [], load: () => import('refractor/opencl') },
197
+ { id: "openqasm", title: "OpenQasm", aliases: ["qasm"], load: () => import('refractor/openqasm') },
198
+ { id: "oz", title: "Oz", aliases: [], load: () => import('refractor/oz') },
199
+ { id: "parigp", title: "PARI/GP", aliases: [], load: () => import('refractor/parigp') },
200
+ { id: "parser", title: "Parser", aliases: [], load: () => import('refractor/parser') },
201
+ { id: "pascal", title: "Pascal", aliases: ["objectpascal"], load: () => import('refractor/pascal') },
202
+ { id: "pascaligo", title: "Pascaligo", aliases: [], load: () => import('refractor/pascaligo') },
203
+ { id: "pcaxis", title: "PC-Axis", aliases: ["px"], load: () => import('refractor/pcaxis') },
204
+ { id: "peoplecode", title: "PeopleCode", aliases: ["pcode"], load: () => import('refractor/peoplecode') },
205
+ { id: "perl", title: "Perl", aliases: [], load: () => import('refractor/perl') },
206
+ { id: "php", title: "PHP", aliases: [], load: () => import('refractor/php') },
207
+ { id: "php-extras", title: "php-extras", aliases: [], part: true, load: () => import('refractor/php-extras') },
208
+ { id: "phpdoc", title: "PHPDoc", aliases: [], load: () => import('refractor/phpdoc') },
209
+ { id: "plant-uml", title: "PlantUML", aliases: ["plantuml"], load: () => import('refractor/plant-uml') },
210
+ { id: "plsql", title: "PL/SQL", aliases: [], load: () => import('refractor/plsql') },
211
+ { id: "powerquery", title: "PowerQuery", aliases: ["mscript", "pq"], load: () => import('refractor/powerquery') },
212
+ { id: "powershell", title: "PowerShell", aliases: [], load: () => import('refractor/powershell') },
213
+ { id: "processing", title: "Processing", aliases: [], load: () => import('refractor/processing') },
214
+ { id: "prolog", title: "Prolog", aliases: [], load: () => import('refractor/prolog') },
215
+ { id: "promql", title: "PromQL", aliases: [], load: () => import('refractor/promql') },
216
+ { id: "properties", title: ".properties", aliases: [], load: () => import('refractor/properties') },
217
+ { id: "protobuf", title: "Protocol Buffers", aliases: [], load: () => import('refractor/protobuf') },
218
+ { id: "psl", title: "PATROL Scripting Language", aliases: [], load: () => import('refractor/psl') },
219
+ { id: "pug", title: "Pug", aliases: [], load: () => import('refractor/pug') },
220
+ { id: "puppet", title: "Puppet", aliases: [], load: () => import('refractor/puppet') },
221
+ { id: "pure", title: "Pure", aliases: [], load: () => import('refractor/pure') },
222
+ { id: "purebasic", title: "PureBasic", aliases: ["pbfasm"], load: () => import('refractor/purebasic') },
223
+ { id: "purescript", title: "PureScript", aliases: ["purs"], load: () => import('refractor/purescript') },
224
+ { id: "python", title: "Python", aliases: ["py"], load: () => import('refractor/python') },
225
+ { id: "q", title: "Q (kdb+ database)", aliases: [], load: () => import('refractor/q') },
226
+ { id: "qml", title: "QML", aliases: [], load: () => import('refractor/qml') },
227
+ { id: "qore", title: "Qore", aliases: [], load: () => import('refractor/qore') },
228
+ { id: "qsharp", title: "Q#", aliases: ["qs"], load: () => import('refractor/qsharp') },
229
+ { id: "r", title: "R", aliases: [], load: () => import('refractor/r') },
230
+ { id: "racket", title: "Racket", aliases: ["rkt"], load: () => import('refractor/racket') },
231
+ { id: "reason", title: "Reason", aliases: [], load: () => import('refractor/reason') },
232
+ { id: "regex", title: "Regex", aliases: [], load: () => import('refractor/regex') },
233
+ { id: "rego", title: "Rego", aliases: [], load: () => import('refractor/rego') },
234
+ { id: "renpy", title: "Ren'py", aliases: ["rpy"], load: () => import('refractor/renpy') },
235
+ { id: "rescript", title: "ReScript", aliases: ["res"], load: () => import('refractor/rescript') },
236
+ { id: "rest", title: "reST (reStructuredText)", aliases: [], load: () => import('refractor/rest') },
237
+ { id: "rip", title: "Rip", aliases: [], load: () => import('refractor/rip') },
238
+ { id: "roboconf", title: "Roboconf", aliases: [], load: () => import('refractor/roboconf') },
239
+ { id: "robotframework", title: "Robot Framework", aliases: ["robot"], load: () => import('refractor/robotframework') },
240
+ { id: "ruby", title: "Ruby", aliases: ["rb"], load: () => import('refractor/ruby') },
241
+ { id: "rust", title: "Rust", aliases: [], load: () => import('refractor/rust') },
242
+ { id: "sas", title: "SAS", aliases: [], load: () => import('refractor/sas') },
243
+ { id: "sass", title: "Sass (Sass)", aliases: [], load: () => import('refractor/sass') },
244
+ { id: "scala", title: "Scala", aliases: [], load: () => import('refractor/scala') },
245
+ { id: "scheme", title: "Scheme", aliases: [], load: () => import('refractor/scheme') },
246
+ { id: "scss", title: "Sass (SCSS)", aliases: [], load: () => import('refractor/scss') },
247
+ { id: "shell-session", title: "Shell session", aliases: ["sh-session", "shellsession"], load: () => import('refractor/shell-session') },
248
+ { id: "smali", title: "Smali", aliases: [], load: () => import('refractor/smali') },
249
+ { id: "smalltalk", title: "Smalltalk", aliases: [], load: () => import('refractor/smalltalk') },
250
+ { id: "smarty", title: "Smarty", aliases: [], load: () => import('refractor/smarty') },
251
+ { id: "sml", title: "SML", aliases: ["smlnj"], load: () => import('refractor/sml') },
252
+ { id: "solidity", title: "Solidity (Ethereum)", aliases: ["sol"], load: () => import('refractor/solidity') },
253
+ { id: "solution-file", title: "Solution file", aliases: ["sln"], load: () => import('refractor/solution-file') },
254
+ { id: "soy", title: "Soy (Closure Template)", aliases: [], load: () => import('refractor/soy') },
255
+ { id: "sparql", title: "SPARQL", aliases: ["rq"], load: () => import('refractor/sparql') },
256
+ { id: "splunk-spl", title: "Splunk SPL", aliases: [], load: () => import('refractor/splunk-spl') },
257
+ { id: "sqf", title: "SQF (Arma 3)", aliases: [], load: () => import('refractor/sqf') },
258
+ { id: "sql", title: "SQL", aliases: [], load: () => import('refractor/sql') },
259
+ { id: "squirrel", title: "Squirrel", aliases: [], load: () => import('refractor/squirrel') },
260
+ { id: "stan", title: "Stan", aliases: [], load: () => import('refractor/stan') },
261
+ { id: "stata", title: "Stata Ado", aliases: [], load: () => import('refractor/stata') },
262
+ { id: "stylus", title: "Stylus", aliases: [], load: () => import('refractor/stylus') },
263
+ { id: "supercollider", title: "SuperCollider", aliases: ["sclang"], load: () => import('refractor/supercollider') },
264
+ { id: "swift", title: "Swift", aliases: [], load: () => import('refractor/swift') },
265
+ { id: "systemd", title: "Systemd configuration file", aliases: [], load: () => import('refractor/systemd') },
266
+ { id: "t4-cs", title: "T4 Text Templates (C#)", aliases: ["t4"], load: () => import('refractor/t4-cs') },
267
+ { id: "t4-templating", title: "t4-templating", aliases: [], part: true, load: () => import('refractor/t4-templating') },
268
+ { id: "t4-vb", title: "T4 Text Templates (VB)", aliases: [], load: () => import('refractor/t4-vb') },
269
+ { id: "tap", title: "TAP", aliases: [], load: () => import('refractor/tap') },
270
+ { id: "tcl", title: "Tcl", aliases: [], load: () => import('refractor/tcl') },
271
+ { id: "textile", title: "Textile", aliases: [], load: () => import('refractor/textile') },
272
+ { id: "toml", title: "TOML", aliases: [], load: () => import('refractor/toml') },
273
+ { id: "tremor", title: "Tremor", aliases: ["trickle", "troy"], load: () => import('refractor/tremor') },
274
+ { id: "tsx", title: "TSX", aliases: [], load: () => import('refractor/tsx') },
275
+ { id: "tt2", title: "Template Toolkit 2", aliases: [], load: () => import('refractor/tt2') },
276
+ { id: "turtle", title: "Turtle", aliases: ["trig"], load: () => import('refractor/turtle') },
277
+ { id: "twig", title: "Twig", aliases: [], load: () => import('refractor/twig') },
278
+ { id: "typescript", title: "TypeScript", aliases: ["ts"], load: () => import('refractor/typescript') },
279
+ { id: "typoscript", title: "TypoScript", aliases: ["tsconfig"], load: () => import('refractor/typoscript') },
280
+ { id: "unrealscript", title: "UnrealScript", aliases: ["uc", "uscript"], load: () => import('refractor/unrealscript') },
281
+ { id: "uorazor", title: "UO Razor Script", aliases: [], load: () => import('refractor/uorazor') },
282
+ { id: "uri", title: "URI", aliases: ["url"], load: () => import('refractor/uri') },
283
+ { id: "v", title: "V", aliases: [], load: () => import('refractor/v') },
284
+ { id: "vala", title: "Vala", aliases: [], load: () => import('refractor/vala') },
285
+ { id: "vbnet", title: "VB.Net", aliases: [], load: () => import('refractor/vbnet') },
286
+ { id: "velocity", title: "Velocity", aliases: [], load: () => import('refractor/velocity') },
287
+ { id: "verilog", title: "Verilog", aliases: [], load: () => import('refractor/verilog') },
288
+ { id: "vhdl", title: "VHDL", aliases: [], load: () => import('refractor/vhdl') },
289
+ { id: "vim", title: "Vim", aliases: [], load: () => import('refractor/vim') },
290
+ { id: "visual-basic", title: "Visual Basic", aliases: ["vb", "vba"], load: () => import('refractor/visual-basic') },
291
+ { id: "warpscript", title: "WarpScript", aliases: [], load: () => import('refractor/warpscript') },
292
+ { id: "wasm", title: "WebAssembly", aliases: [], load: () => import('refractor/wasm') },
293
+ { id: "web-idl", title: "Web IDL", aliases: ["webidl"], load: () => import('refractor/web-idl') },
294
+ { id: "wgsl", title: "WGSL", aliases: [], load: () => import('refractor/wgsl') },
295
+ { id: "wiki", title: "Wiki markup", aliases: [], load: () => import('refractor/wiki') },
296
+ { id: "wolfram", title: "Wolfram language", aliases: ["mathematica", "nb", "wl"], load: () => import('refractor/wolfram') },
297
+ { id: "wren", title: "Wren", aliases: [], load: () => import('refractor/wren') },
298
+ { id: "xeora", title: "Xeora", aliases: ["xeoracube"], load: () => import('refractor/xeora') },
299
+ { id: "xml-doc", title: "XML doc (.net)", aliases: [], load: () => import('refractor/xml-doc') },
300
+ { id: "xojo", title: "Xojo (REALbasic)", aliases: [], load: () => import('refractor/xojo') },
301
+ { id: "xquery", title: "XQuery", aliases: [], load: () => import('refractor/xquery') },
302
+ { id: "yaml", title: "YAML", aliases: ["yml"], load: () => import('refractor/yaml') },
303
+ { id: "yang", title: "YANG", aliases: [], load: () => import('refractor/yang') },
304
+ { id: "zig", title: "Zig", aliases: [], load: () => import('refractor/zig') },
305
+ ];
@@ -27,6 +27,12 @@ interface MdastNode {
27
27
  hProperties?: Record<string, unknown>;
28
28
  };
29
29
  }
30
+ /**
31
+ * `[!type]`, an optional fold marker, and whatever titles it. The type is a word
32
+ * in any script (§7.1): it opens with a letter and goes on in letters, marks,
33
+ * digits, `_` and `-`, so `[!atenção]` is a type as much as `[!warning]` is.
34
+ */
35
+ export declare const CALLOUT_MARKER: RegExp;
30
36
  export interface CalloutOptions {
31
37
  /**
32
38
  * The title of a callout written without one, in the language of whoever
@@ -23,7 +23,7 @@
23
23
  * in any script (§7.1): it opens with a letter and goes on in letters, marks,
24
24
  * digits, `_` and `-`, so `[!atenção]` is a type as much as `[!warning]` is.
25
25
  */
26
- const MARKER = /^\[!(\p{L}[\p{L}\p{M}\p{N}_-]*)\]([+-]?)[ \t]*(.*)$/u;
26
+ export const CALLOUT_MARKER = /^\[!(\p{L}[\p{L}\p{M}\p{N}_-]*)\]([+-]?)[ \t]*(.*)$/u;
27
27
  export function remarkCallouts(options = {}) {
28
28
  return (tree) => descend(tree, options);
29
29
  }
@@ -42,7 +42,7 @@ function rewrite(quote, options) {
42
42
  if (lead?.type !== 'text' || typeof lead.value !== 'string')
43
43
  return;
44
44
  const broke = lead.value.indexOf('\n');
45
- const marker = MARKER.exec(broke === -1 ? lead.value : lead.value.slice(0, broke));
45
+ const marker = CALLOUT_MARKER.exec(broke === -1 ? lead.value : lead.value.slice(0, broke));
46
46
  if (!marker)
47
47
  return;
48
48
  const kind = (marker[1] ?? '').normalize('NFC').toLowerCase();
@@ -67,4 +67,9 @@ export declare function remarkBlockIds(): (tree: MdastNode) => void;
67
67
  export declare function remarkMathDollarRule(): (tree: MdastNode, file: {
68
68
  value?: unknown;
69
69
  }) => void;
70
+ /**
71
+ * Whether the inline formula the source holds between these offsets, delimiters included, breaks
72
+ * the dollar rule of §7.8 and is text: the reading surface and the editor decide it alike.
73
+ */
74
+ export declare function breaksDollarRule(source: string, start: number, end: number): boolean;
70
75
  export {};
@@ -125,26 +125,36 @@ export function remarkMathDollarRule() {
125
125
  const { start, end } = child.position ?? {};
126
126
  if (start?.offset === undefined || end?.offset === undefined)
127
127
  return child;
128
- const raw = source.slice(start.offset, end.offset);
129
- const inner = raw.replace(/^\$+/, '').replace(/\$+$/, '');
130
- if (inner.length === 0)
131
- return { type: 'text', value: raw };
132
- // The outside edges: what sits just inside each delimiter.
133
- if (/^\s/.test(inner) || /\s$/.test(inner))
134
- return { type: 'text', value: raw };
135
- // The inside edges: what sits just OUTSIDE each delimiter, which is
136
- // the half `R$100 e o frete R$200` is decided by.
137
- const before = start.offset > 0 ? (source[start.offset - 1] ?? '') : '';
138
- const after = source[end.offset] ?? '';
139
- if (before !== '' && /[0-9A-Za-z]/.test(before))
140
- return { type: 'text', value: raw };
141
- if (after !== '' && /[0-9]/.test(after))
142
- return { type: 'text', value: raw };
128
+ if (breaksDollarRule(source, start.offset, end.offset)) {
129
+ return { type: 'text', value: source.slice(start.offset, end.offset) };
130
+ }
143
131
  return child;
144
132
  });
145
133
  });
146
134
  };
147
135
  }
136
+ /**
137
+ * Whether the inline formula the source holds between these offsets, delimiters included, breaks
138
+ * the dollar rule of §7.8 and is text: the reading surface and the editor decide it alike.
139
+ */
140
+ export function breaksDollarRule(source, start, end) {
141
+ const raw = source.slice(start, end);
142
+ const inner = raw.replace(/^\$+/, '').replace(/\$+$/, '');
143
+ if (inner.length === 0)
144
+ return true;
145
+ // The outside edges: what sits just inside each delimiter.
146
+ if (/^\s/.test(inner) || /\s$/.test(inner))
147
+ return true;
148
+ // The inside edges: what sits just OUTSIDE each delimiter, which is
149
+ // the half `R$100 e o frete R$200` is decided by.
150
+ const before = start > 0 ? (source[start - 1] ?? '') : '';
151
+ const after = source[end] ?? '';
152
+ if (before !== '' && /[0-9A-Za-z]/.test(before))
153
+ return true;
154
+ if (after !== '' && /[0-9]/.test(after))
155
+ return true;
156
+ return false;
157
+ }
148
158
  /** Cuts a text node on a pattern, keeping the parts between the matches. */
149
159
  function split(value, pattern, make) {
150
160
  const parts = [];
package/dist/slots.js CHANGED
@@ -8,7 +8,7 @@ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
8
8
  * interpreted when the theme fills it. Nothing a slot is given lets it reach
9
9
  * the source: what it draws is decided before it is called.
10
10
  */
11
- import { Children, createContext, createElement, Fragment, isValidElement, useContext, } from 'react';
11
+ import { Children, createContext, createElement, Fragment, isValidElement, useContext, useState, } from 'react';
12
12
  import { useHost } from './host.js';
13
13
  /** The slot a theme fills, or `undefined`. */
14
14
  export function useSlot(name) {
@@ -55,8 +55,24 @@ function Callout({ kind, fold, children }) {
55
55
  const body = parts.filter((_, index) => index !== at);
56
56
  return drawSlot(slot, { kind, fold, title, icon, children: body });
57
57
  }
58
+ if (fold) {
59
+ const body = parts.filter((_, index) => index !== at);
60
+ return (_jsx(FoldingCallout, { kind: kind, fold: fold, icon: icon, body: body, children: title }));
61
+ }
58
62
  return (_jsx("div", { className: "callout", "data-callout": kind, ...(fold ? { 'data-fold': fold } : {}), children: parts.map((part, index) => (index === at ? _jsx(Fragment, { children: titled }, "title") : part)) }));
59
63
  }
64
+ /**
65
+ * A callout marked `+` or `-`, which the default theme folds (§7, #83): a disclosure whose title
66
+ * is its control, open at first for `+` and closed for `-`, where only the title shows. A callout
67
+ * with no mark keeps MemorySmith's markup, which draws every callout open.
68
+ */
69
+ function FoldingCallout({ kind, fold, icon, body, children }) {
70
+ const { strings } = useHost();
71
+ const [open, setOpen] = useState(fold === '+');
72
+ // A callout with no title is named by its type's word, so the control always says what it opens.
73
+ const words = children ?? strings.callouts[kind.toLowerCase()] ?? kind;
74
+ return (_jsxs("details", { className: "callout", "data-callout": kind, "data-fold": fold, open: open, onToggle: (event) => setOpen(event.currentTarget.open), children: [_jsxs("summary", { className: icon === null ? 'callout-title' : 'callout-title has-icon', children: [icon !== null && (_jsx("span", { className: "callout-icon", "aria-hidden": "true", children: icon })), _jsx(CalloutTitleText, { children: words })] }), body] }));
75
+ }
60
76
  /** A `div` of the tree: a callout or its title, which `remarkCallouts` marks, or any other. */
61
77
  export function MarkdownDiv({ className, children, node: _node, ...rest }) {
62
78
  const classes = className?.split(/\s+/) ?? [];