@multiplatform.one/markdown 10.15.0 → 10.16.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.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@multiplatform.one/markdown",
3
- "version": "10.15.0",
3
+ "version": "10.16.1",
4
4
  "description": "Cross-platform markdown renderer with Shiki syntax highlighting for React and React Native",
5
5
  "keywords": [
6
6
  "cross-platform",
@@ -68,11 +68,11 @@
68
68
  "dependencies": {
69
69
  "@mdx-js/mdx": "^3.1.1",
70
70
  "@mdx-js/react": "^3.1.1",
71
- "@multiplatform.one/components": "^10.15.0",
72
- "@multiplatform.one/platform": "^10.15.0",
73
- "@multiplatform.one/router": "^10.15.0",
74
- "@multiplatform.one/table-primitives": "^10.15.0",
75
- "@multiplatform.one/theme": "^10.15.0",
71
+ "@multiplatform.one/components": "^10.16.1",
72
+ "@multiplatform.one/platform": "^10.16.1",
73
+ "@multiplatform.one/router": "^10.16.1",
74
+ "@multiplatform.one/table-primitives": "^10.16.1",
75
+ "@multiplatform.one/theme": "^10.16.1",
76
76
  "@tamagui/linear-gradient": "3.2.3",
77
77
  "@tamagui/react-native-svg": "3.2.3",
78
78
  "@tamagui/web": "3.2.3",
@@ -90,9 +90,9 @@
90
90
  "unist-util-visit": "^5.1.0"
91
91
  },
92
92
  "devDependencies": {
93
- "@multiplatform.one/config": "10.15.0",
94
- "@multiplatform.one/storybook": "10.15.0",
95
- "@multiplatform.one/test-utils": "10.15.0",
93
+ "@multiplatform.one/config": "10.16.1",
94
+ "@multiplatform.one/storybook": "10.16.1",
95
+ "@multiplatform.one/test-utils": "10.16.1",
96
96
  "@tamagui/build": "3.2.3",
97
97
  "@testing-library/jest-dom": "^7.0.1",
98
98
  "@testing-library/react": "^16.3.3",
@@ -14,6 +14,7 @@
14
14
 
15
15
  import type { Meta, StoryObj } from "@storybook/react-native-web-vite";
16
16
  import { useEffect, useRef, useState } from "react";
17
+ import { expect, waitFor, within } from "storybook/test";
17
18
  import { View, XStack, YStack } from "tamagui";
18
19
  import { mountDiagramSvg } from "./mountDiagramSvg";
19
20
  import { renderMermaidDiagram, type MermaidRenderResult } from "./renderMermaidDiagram";
@@ -94,7 +95,27 @@ function EngineSpecimen({
94
95
  );
95
96
  }
96
97
 
98
+ /**
99
+ * Plays until every specimen reports its diagram mounted. mermaid.render
100
+ * mounts a temporary measuring node on body that stretches the page for a
101
+ * frame, and nightly 65568 shot Scheme Switch dark at 907px against its 752px
102
+ * baseline (FZ-12563, the same race FZ-12562 settled for RichEditor).
103
+ */
104
+ const diagramsMounted: Story = {
105
+ parameters: { lostpixel: { waitForPlay: true } },
106
+ play: async ({ canvasElement }) => {
107
+ await waitFor(
108
+ () => {
109
+ const statuses = within(canvasElement).getAllByRole("status");
110
+ for (const status of statuses) expect(status.textContent).toMatch(/^ok: true/);
111
+ },
112
+ { timeout: 20000 },
113
+ );
114
+ },
115
+ };
116
+
97
117
  export const Main: Story = {
118
+ ...diagramsMounted,
98
119
  render: () => (
99
120
  <YStack maxWidth={700} padding="4">
100
121
  <EngineSpecimen label="A flowchart through the engine" code={FLOWCHART} />
@@ -107,6 +128,7 @@ export const Main: Story = {
107
128
  * changes. Both specimens render from the same source; only the theme differs.
108
129
  */
109
130
  export const SchemeSwitch: Story = {
131
+ ...diagramsMounted,
110
132
  render: () => (
111
133
  <XStack gap="4" padding="4" maxWidth={900}>
112
134
  <EngineSpecimen label="scheme: light" code={FLOWCHART} scheme="light" />
@@ -130,6 +152,7 @@ export const InvalidSource: Story = {
130
152
 
131
153
  /** fontFamily is forwarded into mermaid's theme config, and re-inits like scheme. */
132
154
  export const FontFamily: Story = {
155
+ ...diagramsMounted,
133
156
  render: () => (
134
157
  <XStack gap="4" padding="4" maxWidth={900}>
135
158
  <EngineSpecimen label="engine default font" code={FLOWCHART} />