Skip to content

Commit 5cdbdfa

Browse files
committed
Update to use canonical structured text type names
- Update datocms-structured-text-utils to ^5.1.6 - Export new canonical types: CdaStructuredTextValue, CdaStructuredTextRecord, TypesafeCdaStructuredTextValue - Move deprecated type aliases to dedicated section at end of file - Maintain backward compatibility with @deprecated JSDoc comments
1 parent 1046955 commit 5cdbdfa

File tree

3 files changed

+27
-11
lines changed

3 files changed

+27
-11
lines changed

package-lock.json

Lines changed: 4 additions & 4 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -136,7 +136,7 @@
136136
"@mux/mux-player-react": "*",
137137
"datocms-listen": "^0.1.9",
138138
"datocms-structured-text-generic-html-renderer": "^5.0.0",
139-
"datocms-structured-text-utils": "^5.0.0",
139+
"datocms-structured-text-utils": "^5.1.6",
140140
"react-intersection-observer": "^9.4.3",
141141
"react-string-replace": "^1.1.0",
142142
"use-deep-compare-effect": "^1.6.1"

src/StructuredText/index.tsx

Lines changed: 22 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,9 @@ import {
1313
type RenderResult,
1414
type RenderRule,
1515
type Document as StructuredTextDocument,
16+
type CdaStructuredTextValue,
17+
type CdaStructuredTextRecord,
18+
type TypesafeCdaStructuredTextValue,
1619
type StructuredText as StructuredTextGraphQlResponse,
1720
type Record as StructuredTextGraphQlResponseRecord,
1821
type TypesafeStructuredText as TypesafeStructuredTextGraphQlResponse,
@@ -26,14 +29,11 @@ import React, { type ReactElement, cloneElement, isValidElement } from 'react';
2629

2730
export { renderNodeRule, renderMarkRule, RenderError };
2831

29-
// deprecated
30-
export { renderNodeRule as renderRule };
31-
3232
export type {
33-
StructuredTextGraphQlResponse,
34-
TypesafeStructuredTextGraphQlResponse,
3533
StructuredTextDocument,
36-
StructuredTextGraphQlResponseRecord,
34+
CdaStructuredTextValue,
35+
TypesafeCdaStructuredTextValue,
36+
CdaStructuredTextRecord,
3737
};
3838

3939
type AdapterReturn = ReactElement | string | null;
@@ -293,3 +293,19 @@ export function StructuredText<
293293

294294
return result || null;
295295
}
296+
297+
// ============================================================================
298+
// DEPRECATED EXPORTS - kept for backward compatibility
299+
// ============================================================================
300+
301+
/**
302+
* @deprecated Use renderNodeRule instead
303+
*/
304+
export { renderNodeRule as renderRule };
305+
306+
/** @deprecated Use CdaStructuredTextValue */
307+
export type { StructuredTextGraphQlResponse };
308+
/** @deprecated Use TypesafeCdaStructuredTextValue */
309+
export type { TypesafeStructuredTextGraphQlResponse };
310+
/** @deprecated Use CdaStructuredTextRecord */
311+
export type { StructuredTextGraphQlResponseRecord };

0 commit comments

Comments
 (0)