@amplifyup/sdk 0.1.22 → 0.1.24

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/dist/react.d.mts CHANGED
@@ -1,7 +1,7 @@
1
1
  import * as react_jsx_runtime from 'react/jsx-runtime';
2
2
  import { ReactNode } from 'react';
3
- import { P as PageConfig, A as AmplifyUpConfig } from './types-Cy5aWQ5c.mjs';
4
- export { Z as ZoneConfig } from './types-Cy5aWQ5c.mjs';
3
+ import { P as PageConfig, b as AmplifyUpConfig, C as ContentSource, A as AmplifyContentMeta } from './types-BxpG9Gsy.mjs';
4
+ export { Z as ZoneConfig } from './types-BxpG9Gsy.mjs';
5
5
  export { AmplifyRenderer } from './AmplifyRenderer.mjs';
6
6
  export { i as isComposerPreview, a as isPreviewRequest } from './preview-BMrIgUvp.mjs';
7
7
  export { fetchPageConfigServer } from './server.mjs';
@@ -88,6 +88,8 @@ declare function Slot({ name, className, }: {
88
88
  * where field values should appear in their component, with full control
89
89
  * over styling and formatting.
90
90
  *
91
+ * For markdown / rich text fields, use {@link RichText} instead.
92
+ *
91
93
  * @example
92
94
  * ```tsx
93
95
  * function Hero({ title, description }) {
@@ -110,11 +112,30 @@ declare function Field({ name, fallback, className, render, }: {
110
112
  className?: string;
111
113
  render?: (value: any) => ReactNode;
112
114
  }): react_jsx_runtime.JSX.Element | null;
115
+ /**
116
+ * RichText - Renders a markdown (or HTML string) field as formatted HTML.
117
+ *
118
+ * Use for config/data fields of kind `richtext`. Values are stored as Markdown
119
+ * across Composer for portability across CMS platforms.
120
+ *
121
+ * @example
122
+ * ```tsx
123
+ * <RichText name="body" className="prose" />
124
+ * ```
125
+ */
126
+ declare function RichText({ name, fallback, className, as: Tag, }: {
127
+ name: string;
128
+ fallback?: ReactNode;
129
+ className?: string;
130
+ as?: keyof JSX.IntrinsicElements;
131
+ }): react_jsx_runtime.JSX.Element | null;
113
132
 
114
133
  interface AmplifyUpContextType {
115
134
  pageConfig: PageConfig | null;
116
135
  loading: boolean;
117
136
  error: string | null;
137
+ source: ContentSource | null;
138
+ meta: AmplifyContentMeta | null;
118
139
  }
119
140
  interface AmplifyUpProviderProps {
120
141
  children: ReactNode;
@@ -123,4 +144,4 @@ interface AmplifyUpProviderProps {
123
144
  declare function AmplifyUpProvider({ children, config }: AmplifyUpProviderProps): react_jsx_runtime.JSX.Element;
124
145
  declare function useAmplifyUp(): AmplifyUpContextType;
125
146
 
126
- export { AmplifyPageContent, type AmplifyPageContentProps, AmplifyUpProvider, ComponentContextProvider, Field, PageConfig, Slot, useAmplifyUp };
147
+ export { AmplifyContentMeta, AmplifyPageContent, AmplifyUpProvider, ComponentContextProvider, ContentSource, Field, PageConfig, RichText, Slot, useAmplifyUp };
package/dist/react.d.ts CHANGED
@@ -1,7 +1,7 @@
1
1
  import * as react_jsx_runtime from 'react/jsx-runtime';
2
2
  import { ReactNode } from 'react';
3
- import { P as PageConfig, A as AmplifyUpConfig } from './types-Cy5aWQ5c.js';
4
- export { Z as ZoneConfig } from './types-Cy5aWQ5c.js';
3
+ import { P as PageConfig, b as AmplifyUpConfig, C as ContentSource, A as AmplifyContentMeta } from './types-BxpG9Gsy.js';
4
+ export { Z as ZoneConfig } from './types-BxpG9Gsy.js';
5
5
  export { AmplifyRenderer } from './AmplifyRenderer.js';
6
6
  export { i as isComposerPreview, a as isPreviewRequest } from './preview-BMrIgUvp.js';
7
7
  export { fetchPageConfigServer } from './server.js';
@@ -88,6 +88,8 @@ declare function Slot({ name, className, }: {
88
88
  * where field values should appear in their component, with full control
89
89
  * over styling and formatting.
90
90
  *
91
+ * For markdown / rich text fields, use {@link RichText} instead.
92
+ *
91
93
  * @example
92
94
  * ```tsx
93
95
  * function Hero({ title, description }) {
@@ -110,11 +112,30 @@ declare function Field({ name, fallback, className, render, }: {
110
112
  className?: string;
111
113
  render?: (value: any) => ReactNode;
112
114
  }): react_jsx_runtime.JSX.Element | null;
115
+ /**
116
+ * RichText - Renders a markdown (or HTML string) field as formatted HTML.
117
+ *
118
+ * Use for config/data fields of kind `richtext`. Values are stored as Markdown
119
+ * across Composer for portability across CMS platforms.
120
+ *
121
+ * @example
122
+ * ```tsx
123
+ * <RichText name="body" className="prose" />
124
+ * ```
125
+ */
126
+ declare function RichText({ name, fallback, className, as: Tag, }: {
127
+ name: string;
128
+ fallback?: ReactNode;
129
+ className?: string;
130
+ as?: keyof JSX.IntrinsicElements;
131
+ }): react_jsx_runtime.JSX.Element | null;
113
132
 
114
133
  interface AmplifyUpContextType {
115
134
  pageConfig: PageConfig | null;
116
135
  loading: boolean;
117
136
  error: string | null;
137
+ source: ContentSource | null;
138
+ meta: AmplifyContentMeta | null;
118
139
  }
119
140
  interface AmplifyUpProviderProps {
120
141
  children: ReactNode;
@@ -123,4 +144,4 @@ interface AmplifyUpProviderProps {
123
144
  declare function AmplifyUpProvider({ children, config }: AmplifyUpProviderProps): react_jsx_runtime.JSX.Element;
124
145
  declare function useAmplifyUp(): AmplifyUpContextType;
125
146
 
126
- export { AmplifyPageContent, type AmplifyPageContentProps, AmplifyUpProvider, ComponentContextProvider, Field, PageConfig, Slot, useAmplifyUp };
147
+ export { AmplifyContentMeta, AmplifyPageContent, AmplifyUpProvider, ComponentContextProvider, ContentSource, Field, PageConfig, RichText, Slot, useAmplifyUp };