@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/README.md +65 -38
- package/dist/AmplifyRenderer.d.mts +1 -1
- package/dist/AmplifyRenderer.d.ts +1 -1
- package/dist/AmplifyRenderer.js +172 -18
- package/dist/AmplifyRenderer.js.map +1 -1
- package/dist/AmplifyRenderer.mjs +173 -19
- package/dist/AmplifyRenderer.mjs.map +1 -1
- package/dist/index.d.mts +117 -6
- package/dist/index.d.ts +117 -6
- package/dist/index.js +285 -14
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +280 -15
- package/dist/index.mjs.map +1 -1
- package/dist/react.d.mts +24 -3
- package/dist/react.d.ts +24 -3
- package/dist/react.js +476 -47
- package/dist/react.js.map +1 -1
- package/dist/react.mjs +477 -49
- package/dist/react.mjs.map +1 -1
- package/dist/server.d.mts +26 -8
- package/dist/server.d.ts +26 -8
- package/dist/server.js +277 -20
- package/dist/server.js.map +1 -1
- package/dist/server.mjs +277 -21
- package/dist/server.mjs.map +1 -1
- package/dist/{types-Cy5aWQ5c.d.mts → types-BxpG9Gsy.d.mts} +37 -2
- package/dist/{types-Cy5aWQ5c.d.ts → types-BxpG9Gsy.d.ts} +37 -2
- package/package.json +6 -3
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,
|
|
4
|
-
export { Z as ZoneConfig } from './types-
|
|
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 {
|
|
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,
|
|
4
|
-
export { Z as ZoneConfig } from './types-
|
|
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 {
|
|
147
|
+
export { AmplifyContentMeta, AmplifyPageContent, AmplifyUpProvider, ComponentContextProvider, ContentSource, Field, PageConfig, RichText, Slot, useAmplifyUp };
|