@volter/world-ui 1.0.11 → 1.0.12

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.
@@ -13,3 +13,4 @@ export { FORMAT_SCRIPT, Payment, PAYMENT_CSS, type PaymentField, type PaymentPro
13
13
  export { Portal, PORTAL_CSS, type PortalAction, type PortalForm, type PortalItem, type PortalProps, type PortalSection } from '../client/portal.js';
14
14
  export { cookieOf, SignIn, SignInCode, SIGN_IN_CSS, type SignInCodeProps, type SignInProps } from '../client/sign-in.js';
15
15
  export { formOf, redirect, signedIn, startSession, toSignIn } from './session.js';
16
+ export { markdownHtml } from './markdown.js';
package/dist/src/index.js CHANGED
@@ -14,3 +14,4 @@ export { FORMAT_SCRIPT, Payment, PAYMENT_CSS } from "../client/payment.js";
14
14
  export { Portal, PORTAL_CSS } from "../client/portal.js";
15
15
  export { cookieOf, SignIn, SignInCode, SIGN_IN_CSS } from "../client/sign-in.js";
16
16
  export { formOf, redirect, signedIn, startSession, toSignIn } from "./session.js";
17
+ export { markdownHtml } from "./markdown.js";
@@ -0,0 +1,2 @@
1
+ /** A Markdown document as HTML, GitHub-flavored. */
2
+ export declare function markdownHtml(source: string): string;
@@ -0,0 +1,10 @@
1
+ // Markdown as the vendors render it (a README and a comment on GitHub, an issue's description on Linear or Jira):
2
+ // CommonMark with GitHub's extensions (tables, task lists, strikethrough, autolinks, footnotes), by micromark, which
3
+ // follows both specifications. Where this stops: raw HTML in the source is shown as text, never run, where GitHub keeps
4
+ // a sanitized subset of it; a twin's page renders a World's data, not markup anyone vouched for.
5
+ import { micromark } from 'micromark';
6
+ import { gfm, gfmHtml } from 'micromark-extension-gfm';
7
+ /** A Markdown document as HTML, GitHub-flavored. */
8
+ export function markdownHtml(source) {
9
+ return micromark(source, { extensions: [gfm()], htmlExtensions: [gfmHtml()] });
10
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@volter/world-ui",
3
- "version": "1.0.11",
3
+ "version": "1.0.12",
4
4
  "description": "Shared pieces and serving for derived packs' screens (hosted flows and workspaces), through each pack's own API; see docs/contributing/architecture.md, Screens.",
5
5
  "license": "Apache-2.0",
6
6
  "author": "Volter (https://github.com/volter-ai)",
@@ -28,7 +28,7 @@
28
28
  "dist"
29
29
  ],
30
30
  "peerDependencies": {
31
- "@volter/world-core": "3.0.11",
31
+ "@volter/world-core": "3.0.12",
32
32
  "react": "^19.2.7",
33
33
  "react-dom": "^19.2.7"
34
34
  },
@@ -40,5 +40,9 @@
40
40
  "homepage": "https://world.volter.ai/docs/README",
41
41
  "engines": {
42
42
  "node": ">=22.3"
43
+ },
44
+ "dependencies": {
45
+ "micromark": "4.0.3",
46
+ "micromark-extension-gfm": "3.0.0"
43
47
  }
44
48
  }
package/src/index.ts CHANGED
@@ -20,3 +20,4 @@ export { FORMAT_SCRIPT, Payment, PAYMENT_CSS, type PaymentField, type PaymentPro
20
20
  export { Portal, PORTAL_CSS, type PortalAction, type PortalForm, type PortalItem, type PortalProps, type PortalSection } from '../client/portal.tsx';
21
21
  export { cookieOf, SignIn, SignInCode, SIGN_IN_CSS, type SignInCodeProps, type SignInProps } from '../client/sign-in.tsx';
22
22
  export { formOf, redirect, signedIn, startSession, toSignIn } from './session.ts';
23
+ export { markdownHtml } from './markdown.ts';
@@ -0,0 +1,11 @@
1
+ // Markdown as the vendors render it (a README and a comment on GitHub, an issue's description on Linear or Jira):
2
+ // CommonMark with GitHub's extensions (tables, task lists, strikethrough, autolinks, footnotes), by micromark, which
3
+ // follows both specifications. Where this stops: raw HTML in the source is shown as text, never run, where GitHub keeps
4
+ // a sanitized subset of it; a twin's page renders a World's data, not markup anyone vouched for.
5
+ import { micromark } from 'micromark';
6
+ import { gfm, gfmHtml } from 'micromark-extension-gfm';
7
+
8
+ /** A Markdown document as HTML, GitHub-flavored. */
9
+ export function markdownHtml(source: string): string {
10
+ return micromark(source, { extensions: [gfm()], htmlExtensions: [gfmHtml()] });
11
+ }