@mzebley/mark-down-react 1.0.0 → 1.2.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 (2) hide show
  1. package/README.md +7 -2
  2. package/package.json +2 -2
package/README.md CHANGED
@@ -40,7 +40,7 @@ export function App({ children }: { children: React.ReactNode }) {
40
40
  }
41
41
  ```
42
42
 
43
- `options` maps directly to the [`SnippetClient` configuration](../core/README.md#client-options), so you can provide custom fetchers, renderers, or manifest loaders as needed.
43
+ `options` maps directly to the [`SnippetClient` configuration](../core/README.md#client-options), so you can provide custom fetch functions, base paths, or preloaded manifest arrays as needed.
44
44
 
45
45
  ## Hook
46
46
 
@@ -94,7 +94,12 @@ import { SnippetProvider } from '@mzebley/mark-down-react';
94
94
  <SnippetProvider
95
95
  options={{
96
96
  manifest: () => import('../snippets-index.json'),
97
- fetcher: (input, init) => fetch(input as string, init),
97
+ fetch: (url) => fetch(url).then((response) => {
98
+ if (!response.ok) {
99
+ throw new Error(`Request failed with status ${response.status}`);
100
+ }
101
+ return response;
102
+ }),
98
103
  }}
99
104
  >
100
105
  {children}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mzebley/mark-down-react",
3
- "version": "1.0.0",
3
+ "version": "1.2.1",
4
4
  "description": "mark↓ React Adapter",
5
5
  "type": "module",
6
6
  "main": "dist/index.cjs",
@@ -13,7 +13,7 @@
13
13
  "build": "tsup src/index.ts --dts --format esm,cjs"
14
14
  },
15
15
  "dependencies": {
16
- "@mzebley/mark-down": "file:../core",
16
+ "@mzebley/mark-down": "^1.2.1",
17
17
  "dompurify": "^3.0.5"
18
18
  },
19
19
  "peerDependencies": {