comark-ui 0.0.0 → 0.7.1

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 (76) hide show
  1. package/LICENSE +69 -0
  2. package/README.md +69 -1
  3. package/dist/client.d.mts +12 -0
  4. package/dist/client.mjs +26 -0
  5. package/dist/editor-BAdok66p.mjs +835 -0
  6. package/dist/editor-CNivEuMH.d.mts +131 -0
  7. package/dist/editor-vue.d.mts +57 -0
  8. package/dist/editor-vue.mjs +85 -0
  9. package/dist/editor.d.mts +2 -0
  10. package/dist/editor.mjs +1 -0
  11. package/dist/html.d.mts +7 -0
  12. package/dist/html.mjs +90 -0
  13. package/dist/index-B0YvApci.d.mts +173 -0
  14. package/dist/index.d.mts +3 -0
  15. package/dist/index.mjs +3 -0
  16. package/dist/nuxt-ui.d.mts +17 -0
  17. package/dist/nuxt-ui.mjs +488 -0
  18. package/dist/react.d.mts +8 -0
  19. package/dist/react.mjs +83 -0
  20. package/dist/skills/comark-ui/SKILL.md +138 -0
  21. package/dist/skills/comark-ui/agents/openai.yaml +3 -0
  22. package/dist/skills/comark-ui/references/annotate.md +65 -0
  23. package/dist/skills/comark-ui/references/badge.md +52 -0
  24. package/dist/skills/comark-ui/references/cards.md +57 -0
  25. package/dist/skills/comark-ui/references/carousel.md +31 -0
  26. package/dist/skills/comark-ui/references/cast.md +48 -0
  27. package/dist/skills/comark-ui/references/charts.md +80 -0
  28. package/dist/skills/comark-ui/references/chat.md +25 -0
  29. package/dist/skills/comark-ui/references/chips.md +33 -0
  30. package/dist/skills/comark-ui/references/cjk.md +23 -0
  31. package/dist/skills/comark-ui/references/code-notes.md +34 -0
  32. package/dist/skills/comark-ui/references/code.md +84 -0
  33. package/dist/skills/comark-ui/references/colors.md +33 -0
  34. package/dist/skills/comark-ui/references/critic.md +30 -0
  35. package/dist/skills/comark-ui/references/deflist.md +38 -0
  36. package/dist/skills/comark-ui/references/details.md +49 -0
  37. package/dist/skills/comark-ui/references/diagrams.md +45 -0
  38. package/dist/skills/comark-ui/references/diff.md +43 -0
  39. package/dist/skills/comark-ui/references/embed.md +40 -0
  40. package/dist/skills/comark-ui/references/fields.md +48 -0
  41. package/dist/skills/comark-ui/references/figure.md +25 -0
  42. package/dist/skills/comark-ui/references/file-tree.md +42 -0
  43. package/dist/skills/comark-ui/references/footnotes.md +26 -0
  44. package/dist/skills/comark-ui/references/github.md +44 -0
  45. package/dist/skills/comark-ui/references/icon.md +28 -0
  46. package/dist/skills/comark-ui/references/include.md +44 -0
  47. package/dist/skills/comark-ui/references/keys.md +28 -0
  48. package/dist/skills/comark-ui/references/links.md +43 -0
  49. package/dist/skills/comark-ui/references/lint.md +96 -0
  50. package/dist/skills/comark-ui/references/magic-move.md +34 -0
  51. package/dist/skills/comark-ui/references/mark.md +22 -0
  52. package/dist/skills/comark-ui/references/math.md +25 -0
  53. package/dist/skills/comark-ui/references/media.md +29 -0
  54. package/dist/skills/comark-ui/references/metrics.md +34 -0
  55. package/dist/skills/comark-ui/references/outline.md +36 -0
  56. package/dist/skills/comark-ui/references/properties.md +32 -0
  57. package/dist/skills/comark-ui/references/qr.md +20 -0
  58. package/dist/skills/comark-ui/references/quiz.md +45 -0
  59. package/dist/skills/comark-ui/references/reading-time.md +32 -0
  60. package/dist/skills/comark-ui/references/sources.md +24 -0
  61. package/dist/skills/comark-ui/references/steps.md +34 -0
  62. package/dist/skills/comark-ui/references/table.md +48 -0
  63. package/dist/skills/comark-ui/references/tabs.md +46 -0
  64. package/dist/skills/comark-ui/references/tests.md +59 -0
  65. package/dist/skills/comark-ui/references/ui.md +54 -0
  66. package/dist/skills/comark-ui/references/xref.md +48 -0
  67. package/dist/skills/comark-ui/references/zoom.md +35 -0
  68. package/dist/src-DROB05U6.mjs +119 -0
  69. package/dist/svelte/Typeset.svelte +7 -0
  70. package/dist/svelte/index.d.ts +9 -0
  71. package/dist/svelte/index.js +84 -0
  72. package/dist/typeset-css-DPB0S1bV.mjs +202 -0
  73. package/dist/typeset-css-DdOGL7WF.d.mts +10 -0
  74. package/dist/vue.d.mts +7 -0
  75. package/dist/vue.mjs +86 -0
  76. package/package.json +170 -4
package/LICENSE ADDED
@@ -0,0 +1,69 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 onmax
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
22
+
23
+ ---
24
+
25
+ The icons are Lucide's (https://lucide.dev), under its license:
26
+
27
+ ISC License
28
+
29
+ Copyright (c) 2026 Lucide Icons and Contributors
30
+
31
+ Permission to use, copy, modify, and/or distribute this software for any
32
+ purpose with or without fee is hereby granted, provided that the above
33
+ copyright notice and this permission notice appear in all copies.
34
+
35
+ THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
36
+ WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
37
+ MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
38
+ ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
39
+ WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
40
+ ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
41
+ OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
42
+
43
+ ---
44
+
45
+ The following Lucide icons are derived from the Feather project:
46
+
47
+ airplay, alert-circle, alert-octagon, alert-triangle, aperture, arrow-down-circle, arrow-down-left, arrow-down-right, arrow-down, arrow-left-circle, arrow-left, arrow-right-circle, arrow-right, arrow-up-circle, arrow-up-left, arrow-up-right, arrow-up, at-sign, calendar, cast, check, chevron-down, chevron-left, chevron-right, chevron-up, chevrons-down, chevrons-left, chevrons-right, chevrons-up, circle, clipboard, clock, code, columns, command, compass, corner-down-left, corner-down-right, corner-left-down, corner-left-up, corner-right-down, corner-right-up, corner-up-left, corner-up-right, crosshair, database, divide-circle, divide-square, dollar-sign, download, external-link, feather, frown, hash, headphones, help-circle, info, italic, key, layout, life-buoy, link-2, link, loader, lock, log-in, log-out, maximize, meh, minimize, minimize-2, minus-circle, minus-square, minus, monitor, moon, more-horizontal, more-vertical, move, music, navigation-2, navigation, octagon, pause-circle, percent, plus-circle, plus-square, plus, power, radio, rss, search, server, share, shopping-bag, sidebar, smartphone, smile, square, table-2, tablet, target, terminal, trash-2, trash, triangle, tv, type, upload, x-circle, x-octagon, x-square, x, zoom-in, zoom-out
48
+
49
+ The MIT License (MIT) (for the icons listed above)
50
+
51
+ Copyright (c) 2013-present Cole Bemis
52
+
53
+ Permission is hereby granted, free of charge, to any person obtaining a copy
54
+ of this software and associated documentation files (the "Software"), to deal
55
+ in the Software without restriction, including without limitation the rights
56
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
57
+ copies of the Software, and to permit persons to whom the Software is
58
+ furnished to do so, subject to the following conditions:
59
+
60
+ The above copyright notice and this permission notice shall be included in all
61
+ copies or substantial portions of the Software.
62
+
63
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
64
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
65
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
66
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
67
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
68
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
69
+ SOFTWARE.
package/README.md CHANGED
@@ -1,3 +1,71 @@
1
1
  # comark-ui
2
2
 
3
- Placeholder. The real package publishes from https://github.com/onmax/comark-ui.
3
+ [![npm version](https://comark-ui.onmax.me/badge.svg?source=npm-version&package=comark-ui&icon=npm)](https://npmx.dev/package/comark-ui)
4
+ [![npm downloads](https://comark-ui.onmax.me/badge.svg?source=npm-downloads&package=comark-ui&period=month&icon=npm)](https://npmx.dev/package/comark-ui)
5
+ [![license](https://comark-ui.onmax.me/badge.svg?label=license&value=MIT)](https://npmx.dev/package/comark-ui)
6
+ [![docs](https://comark-ui.onmax.me/badge.svg?label=docs&value=comark-ui.onmax.me)](https://comark-ui.onmax.me/getting-started/)
7
+
8
+ Every [Comark](https://comark.dev) block from [comark-ui](https://comark-ui.onmax.me) in one install, registered in the order they need, with one icon resolver shared by `:icon`, cards, details, file trees, tabs, and code actions. It ships in lockstep with the plugins, so updating it brings their latest defaults.
9
+
10
+ ```sh
11
+ pnpm add comark @comark/html comark-ui
12
+ ```
13
+
14
+ ```ts
15
+ import { createHtmlRenderer } from "@comark/html";
16
+ import comarkUi from "comark-ui/html";
17
+
18
+ const render = createHtmlRenderer(comarkUi());
19
+ ```
20
+
21
+ `comarkUi()` returns `{ plugins, components }`. Every plugin is on but `include`. Pass `false` to turn one off, which drops its components too, or an object to pass it options:
22
+
23
+ ```ts
24
+ comarkUi({
25
+ zoom: false,
26
+ code: { actions: [{ id: "run", label: "Run" }] },
27
+ github: { references: { repo: "owner/name" } },
28
+ include: { root: "content" },
29
+ });
30
+ ```
31
+
32
+ `include` is off because it reads files from disk; turn it on to paste files into a document. `cast`, `table`, and `tests` are on but read no files until you pass `{ root }` or `{ read }`. When you parse in a browser, pass `chips: { download: false }`, since a browser may not download another site's images. comark-critic has no component for its styles, so put the exported `criticCss` in the page. The text around the blocks (headings, paragraphs, lists, tables, code, and quotes) is styled too, from shadcn/typeset on the same tokens and scoped to the document; pass `typeset: false` when your site already styles Markdown. See [Typeset](https://comark-ui.onmax.me/guide/typeset/).
33
+
34
+ ## Renderers
35
+
36
+ | Renderer | Import |
37
+ | --- | --- |
38
+ | `@comark/html` | `comark-ui/html` |
39
+ | `@comark/vue` | `comark-ui/vue` |
40
+ | `@comark/react` | `comark-ui/react` |
41
+ | `@comark/svelte` | `comark-ui/svelte` |
42
+
43
+ Vue, React, and Svelte leave out annotate and diff, which render only to HTML.
44
+
45
+ ## Editor
46
+
47
+ [Editor docs](https://comark-ui.onmax.me/guide/editor/) cover setup, Vue bindings, file uploads, and collaborative rooms.
48
+
49
+ `comark-ui/editor` is a [Tiptap](https://tiptap.dev) editor for Comark Markdown, with no DOM and no framework, so a server can convert documents with it too. Install `@tiptap/core`, `@tiptap/pm`, `@tiptap/starter-kit`, `@tiptap/extension-list`, `@tiptap/extension-image`, and `@tiptap/extension-table`.
50
+
51
+ | Export | What it does |
52
+ | --- | --- |
53
+ | `ComarkKit` | The schema: StarterKit, task lists, inline images (drawn as players for video and audio), tables, and Comark's components, slots, and comments, each keeping the attributes it has no field for. |
54
+ | `fromMarkdown`, `toMarkdown` | Convert between Markdown and the editor's JSON with Comark's own parser and writer. Front matter stays beside the document. |
55
+ | `checkMarkdown(markdown, { plugins })` | Whether the editor can save the document without changing what readers see, judged with the plugins the page renders with. A document it can't keep opens read-only. |
56
+ | `Upload` | Uploads pasted and dropped files. Each shows a placeholder with its progress until `upload(file, progress)` returns its URL. The placeholder is a decoration, so a collaborative document never holds a file that hasn't arrived. |
57
+ | `createEditorCodec({ plugins })` | `{ extensions, fromMarkdown, toMarkdown, verify }` for a collaborative room, such as ViteHub Realtime's `editor` option. |
58
+
59
+ `comark-ui/editor/vue` binds the editor to a Markdown string with `useComarkEditor(markdown)` or `<ComarkEditor v-model="markdown" />`. Run `pnpm playground` in this package to try it.
60
+
61
+ ## Agents
62
+
63
+ The package ships the [comark-ui agent skill](https://github.com/onmax/comark-ui/tree/main/skills/comark-ui): a `SKILL.md` that says how to install the plugins, which block shows what, and how to check the result, and a reference for each package. Install it with `npx skills add onmax/comark-ui`, or bundle it in your own app from `comark-ui/skills/comark-ui/`, which always matches the plugins it installed.
64
+
65
+ ## Linting
66
+
67
+ [comark-linter](https://comark-ui.onmax.me/lint/) finds `comark-ui` when it's installed and checks documents with its plugins and components.
68
+
69
+ ## License
70
+
71
+ MIT
@@ -0,0 +1,12 @@
1
+ import { t as typesetCss } from "./typeset-css-DdOGL7WF.mjs";
2
+ //#region src/client.d.ts
3
+ /**
4
+ * comark-pele's diagrams on the shared `--comark-*` tokens, on a card like comark-diagrams'. Pele paints with its
5
+ * `--pele-*` variables, so setting them on the wrapper themes every diagram, light and dark, without drawing it
6
+ * again. The rules sit in the `comark` layer, so host `--pele-*` values are preserved and win over these fallbacks.
7
+ */
8
+ export declare const mermaidCss: string;
9
+ /** Adds the Mermaid styles to the page once. The Vue, React, and Svelte diagrams call it when Pele draws them. */
10
+ export declare function addMermaidStyles(): void;
11
+ //#endregion
12
+ export { typesetCss };
@@ -0,0 +1,26 @@
1
+ import { t as typesetCss } from "./typeset-css-DPB0S1bV.mjs";
2
+ import { theme } from "comark-zoom/theme";
3
+ //#region src/client.ts
4
+ /**
5
+ * comark-pele's diagrams on the shared `--comark-*` tokens, on a card like comark-diagrams'. Pele paints with its
6
+ * `--pele-*` variables, so setting them on the wrapper themes every diagram, light and dark, without drawing it
7
+ * again. The rules sit in the `comark` layer, so host `--pele-*` values are preserved and win over these fallbacks.
8
+ */
9
+ const mermaidCss = `@layer comark{${[
10
+ theme(".pele-diagram"),
11
+ theme(":root"),
12
+ `:where(:root){--pele-bg:var(--_comark-background);--pele-fg:var(--_comark-foreground);--pele-muted:var(--_comark-muted);--pele-line:var(--_comark-muted);--pele-surface:var(--_comark-accent);--pele-surface-alt:color-mix(in srgb,var(--_comark-accent),var(--_comark-foreground) 6%);--pele-border:var(--_comark-border);--pele-accent:var(--ui-primary,var(--primary,var(--_comark-foreground)));--pele-critical:var(--ui-error,var(--destructive,#dc2626));--pele-error:var(--ui-error,var(--destructive,#dc2626));--pele-font:var(--_comark-font);--pele-radius:calc(var(--_comark-radius) - 4px);--pele-series-1:var(--comark-chart-1,var(--ui-chart-1,var(--chart-1,#3b82f6)));--pele-series-2:var(--comark-chart-2,var(--ui-chart-2,var(--chart-2,#f97316)));--pele-series-3:var(--comark-chart-3,var(--ui-chart-3,var(--chart-3,#10b981)));--pele-series-4:var(--comark-chart-4,var(--ui-chart-4,var(--chart-4,#a855f7)));--pele-series-5:var(--comark-chart-5,var(--ui-chart-5,var(--chart-5,#f43f5e)));--pele-series-6:var(--comark-chart-6,var(--ui-chart-6,var(--chart-6,#eab308)));--pele-series-7:var(--comark-chart-7,var(--ui-chart-7,var(--chart-7,#06b6d4)));--pele-series-8:var(--comark-chart-8,var(--ui-chart-8,var(--chart-8,#ec4899)))}`,
13
+ ".pele-diagram{margin:1.5rem 0;padding:1rem;overflow-x:auto;border:1px solid var(--_comark-border);border-radius:var(--_comark-radius);background:var(--_comark-background);color:var(--_comark-foreground);text-align:center}",
14
+ ".pele-source{margin:0;color:var(--_comark-muted);text-align:left}",
15
+ "@media print{.pele-diagram{break-inside:avoid}}"
16
+ ].join("")}}`;
17
+ /** Adds the Mermaid styles to the page once. The Vue, React, and Svelte diagrams call it when Pele draws them. */
18
+ function addMermaidStyles() {
19
+ if (document.querySelector("style[data-comark-mermaid]")) return;
20
+ const style = document.createElement("style");
21
+ style.dataset.comarkMermaid = "";
22
+ style.textContent = mermaidCss;
23
+ document.head.append(style);
24
+ }
25
+ //#endregion
26
+ export { addMermaidStyles, mermaidCss, typesetCss };