@01.software/sdk 0.2.9-dev.260310.cf511cb → 0.2.9-dev.260311.926a6d4

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 (58) hide show
  1. package/README.md +21 -8
  2. package/dist/auth.cjs +3 -1
  3. package/dist/auth.cjs.map +1 -1
  4. package/dist/auth.d.cts +36 -3
  5. package/dist/auth.d.ts +36 -3
  6. package/dist/auth.js +3 -1
  7. package/dist/auth.js.map +1 -1
  8. package/dist/components/code-block.cjs +182 -0
  9. package/dist/components/code-block.cjs.map +1 -0
  10. package/dist/components/code-block.d.cts +62 -0
  11. package/dist/components/code-block.d.ts +62 -0
  12. package/dist/components/code-block.js +152 -0
  13. package/dist/components/code-block.js.map +1 -0
  14. package/dist/{flow.cjs → components/flow.cjs} +111 -87
  15. package/dist/components/flow.cjs.map +1 -0
  16. package/dist/{flow.d.cts → components/flow.d.cts} +27 -11
  17. package/dist/{flow.d.ts → components/flow.d.ts} +27 -11
  18. package/dist/{flow.js → components/flow.js} +113 -88
  19. package/dist/components/flow.js.map +1 -0
  20. package/dist/{components.cjs → components/form.cjs} +25 -518
  21. package/dist/components/form.cjs.map +1 -0
  22. package/dist/components/form.d.cts +37 -0
  23. package/dist/components/form.d.ts +37 -0
  24. package/dist/{components.js → components/form.js} +17 -513
  25. package/dist/components/form.js.map +1 -0
  26. package/dist/components/image.cjs +208 -0
  27. package/dist/components/image.cjs.map +1 -0
  28. package/dist/components/image.d.cts +44 -0
  29. package/dist/components/image.d.ts +44 -0
  30. package/dist/components/image.js +180 -0
  31. package/dist/components/image.js.map +1 -0
  32. package/dist/components/rich-text.cjs +258 -0
  33. package/dist/components/rich-text.cjs.map +1 -0
  34. package/dist/components/rich-text.d.cts +110 -0
  35. package/dist/components/rich-text.d.ts +110 -0
  36. package/dist/components/rich-text.js +235 -0
  37. package/dist/components/rich-text.js.map +1 -0
  38. package/dist/index.cjs +214 -231
  39. package/dist/index.cjs.map +1 -1
  40. package/dist/index.d.cts +321 -155
  41. package/dist/index.d.ts +321 -155
  42. package/dist/index.js +217 -231
  43. package/dist/index.js.map +1 -1
  44. package/dist/{payload-types-Cq93wqIe.d.cts → payload-types-BjvBwB8Z.d.cts} +1601 -1373
  45. package/dist/{payload-types-Cq93wqIe.d.ts → payload-types-BjvBwB8Z.d.ts} +1601 -1373
  46. package/dist/{webhook-NRdVwXN7.d.cts → webhook-CszIpUKn.d.cts} +2 -2
  47. package/dist/{webhook-C_7s0K66.d.ts → webhook-_LdLdjGa.d.ts} +2 -2
  48. package/dist/webhook.d.cts +2 -2
  49. package/dist/webhook.d.ts +2 -2
  50. package/package.json +47 -12
  51. package/dist/auth-CVVo5UT5.d.ts +0 -298
  52. package/dist/auth-CqgrT1qd.d.cts +0 -298
  53. package/dist/components.cjs.map +0 -1
  54. package/dist/components.d.cts +0 -240
  55. package/dist/components.d.ts +0 -240
  56. package/dist/components.js.map +0 -1
  57. package/dist/flow.cjs.map +0 -1
  58. package/dist/flow.js.map +0 -1
@@ -1,240 +0,0 @@
1
- import React, { CSSProperties, JSX } from 'react';
2
- import { SerializedLinkNode, SerializedBlockNode } from '@payloadcms/richtext-lexical';
3
- import { SerializedEditorState, SerializedLexicalNode } from '@payloadcms/richtext-lexical/lexical';
4
- import { JSXConverters, JSXConverter } from '@payloadcms/richtext-lexical/react';
5
- import { F as Form } from './payload-types-Cq93wqIe.cjs';
6
- import { I as ImageData } from './image-TT8lTsk5.cjs';
7
- import { BundledTheme } from 'shiki';
8
- export { BundledTheme } from 'shiki';
9
-
10
- interface HeadingSlotProps {
11
- tag: 'h1' | 'h2' | 'h3' | 'h4' | 'h5' | 'h6';
12
- children: React.ReactNode;
13
- node: any;
14
- }
15
- interface ParagraphSlotProps {
16
- children: React.ReactNode;
17
- isEmpty: boolean;
18
- node: any;
19
- }
20
- interface BlockquoteSlotProps {
21
- children: React.ReactNode;
22
- node: any;
23
- }
24
- interface ListSlotProps {
25
- tag: 'ul' | 'ol';
26
- listType: string;
27
- children: React.ReactNode;
28
- node: any;
29
- }
30
- interface ListItemSlotProps {
31
- children: React.ReactNode;
32
- hasSubLists: boolean;
33
- checked?: boolean;
34
- value?: number;
35
- node: any;
36
- }
37
- interface LinkSlotProps {
38
- href: string;
39
- target?: string;
40
- rel?: string;
41
- children: React.ReactNode;
42
- node: any;
43
- }
44
- interface HorizontalRuleSlotProps {
45
- node?: any;
46
- }
47
- interface UploadSlotProps {
48
- src: string;
49
- alt: string;
50
- width?: number;
51
- height?: number;
52
- mimeType: string;
53
- filename: string;
54
- sizes?: Record<string, any>;
55
- node: any;
56
- }
57
- interface TableSlotProps {
58
- children: React.ReactNode;
59
- node: any;
60
- }
61
- interface TableRowSlotProps {
62
- children: React.ReactNode;
63
- node: any;
64
- }
65
- interface TableCellSlotProps {
66
- tag: 'th' | 'td';
67
- children: React.ReactNode;
68
- colSpan?: number;
69
- rowSpan?: number;
70
- backgroundColor?: string;
71
- node: any;
72
- }
73
- interface RichTextComponents {
74
- Heading?: React.ComponentType<HeadingSlotProps>;
75
- Paragraph?: React.ComponentType<ParagraphSlotProps>;
76
- Blockquote?: React.ComponentType<BlockquoteSlotProps>;
77
- List?: React.ComponentType<ListSlotProps>;
78
- ListItem?: React.ComponentType<ListItemSlotProps>;
79
- Link?: React.ComponentType<LinkSlotProps>;
80
- HorizontalRule?: React.ComponentType<HorizontalRuleSlotProps>;
81
- Upload?: React.ComponentType<UploadSlotProps>;
82
- Table?: React.ComponentType<TableSlotProps>;
83
- TableRow?: React.ComponentType<TableRowSlotProps>;
84
- TableCell?: React.ComponentType<TableCellSlotProps>;
85
- }
86
- interface StyledRichTextContentProps extends Omit<RichTextContentProps, 'converters' | 'disableDefaultConverters'> {
87
- components?: RichTextComponents;
88
- }
89
- declare function StyledRichTextContent({ components, internalDocToHref, blocks, textState, ...props }: StyledRichTextContentProps): React.JSX.Element;
90
-
91
- type RichTextData = SerializedEditorState<SerializedLexicalNode>;
92
- type TextStateConfig = {
93
- [stateKey: string]: {
94
- [stateValue: string]: {
95
- css: Record<string, string>;
96
- label: string;
97
- };
98
- };
99
- };
100
- interface RichTextContentProps {
101
- data: RichTextData;
102
- className?: string;
103
- internalDocToHref?: (args: {
104
- linkNode: SerializedLinkNode;
105
- }) => string;
106
- converters?: Partial<JSXConverters>;
107
- blocks?: Record<string, JSXConverter<SerializedBlockNode>>;
108
- disableDefaultConverters?: boolean;
109
- textState?: TextStateConfig;
110
- }
111
-
112
- declare function RichTextContent({ data, className, internalDocToHref, converters, blocks, disableDefaultConverters, textState, }: RichTextContentProps): React.JSX.Element;
113
-
114
- type FormField = NonNullable<Form['fields']>[number];
115
- type InputField = Exclude<FormField, {
116
- blockType: 'message';
117
- }>;
118
- type FormValues = Record<string, string | number | boolean>;
119
- type SubmissionData = {
120
- field: string;
121
- value: string;
122
- }[];
123
- declare function toSubmissionData(values: FormValues): SubmissionData;
124
- interface FieldRenderContext {
125
- value: string | number | boolean;
126
- onChange: (value: string | number | boolean) => void;
127
- }
128
- interface FormRendererProps {
129
- form: Form;
130
- onSubmit: (data: FormValues) => void | Promise<void>;
131
- className?: string;
132
- fieldClassName?: string;
133
- buttonClassName?: string;
134
- renderField?: (field: FormField, context: FieldRenderContext, defaultRender: React.ReactElement) => React.ReactElement;
135
- renderMessage?: (data: RichTextData) => React.ReactElement;
136
- renderButton?: (props: {
137
- isSubmitting: boolean;
138
- label: string;
139
- }) => React.ReactElement;
140
- }
141
- declare function FormRenderer({ form, onSubmit, className, fieldClassName, buttonClassName, renderField, renderMessage, renderButton, }: FormRendererProps): React.JSX.Element;
142
-
143
- interface ImageProps {
144
- /** Payload image document */
145
- image: ImageData;
146
- /** Display width in CSS pixels (for selecting optimal srcset size) */
147
- width?: number;
148
- /** Device pixel ratio (default: 1) */
149
- dpr?: number;
150
- /** Placeholder strategy (default: 'blur'; defaults to 'none' when imageRendering is 'pixelated' or 'crisp-edges') */
151
- placeholder?: 'blur' | 'color' | 'none';
152
- /** Container className */
153
- className?: string;
154
- /** Container style */
155
- style?: CSSProperties;
156
- /** Inner `<img>` className */
157
- imgClassName?: string;
158
- /** Inner `<img>` style */
159
- imgStyle?: CSSProperties;
160
- /** HTML sizes attribute */
161
- sizes?: string;
162
- /** Loading strategy (default: 'lazy'; automatically 'eager' when priority is true) */
163
- loading?: 'lazy' | 'eager';
164
- /** Callback when image finishes loading */
165
- onLoad?: () => void;
166
- /** Object-fit for the image (default: 'cover') */
167
- objectFit?: 'cover' | 'contain' | 'fill' | 'none' | 'scale-down';
168
- /** When true, loads eagerly with high fetch priority (for LCP images) */
169
- priority?: boolean;
170
- /** When true, fills parent container (width/height: 100%, no aspect ratio) */
171
- fill?: boolean;
172
- /** CSS image-rendering mode (e.g. 'pixelated' for pixel art) */
173
- imageRendering?: 'auto' | 'pixelated' | 'crisp-edges';
174
- }
175
- /**
176
- * Image component with blur-up / color placeholder support.
177
- *
178
- * Uses LQIP (Low Quality Image Placeholder) for a smooth blur-up effect,
179
- * falling back to palette color or no placeholder.
180
- */
181
- declare function Image({ image, width, dpr, placeholder: placeholderProp, className, style, imgClassName, imgStyle, sizes, loading: loadingProp, onLoad, objectFit, priority, fill, imageRendering, }: ImageProps): React.JSX.Element;
182
-
183
- /**
184
- * Highlight code to JSX using shiki.
185
- * Works in both Server and Client components.
186
- *
187
- * @example Server Component
188
- * ```tsx
189
- * const highlighted = await highlight('const x = 1', 'typescript')
190
- * return <div>{highlighted}</div>
191
- * ```
192
- */
193
- declare function highlight(code: string, lang: string, theme?: BundledTheme): Promise<JSX.Element>;
194
-
195
- interface CodeBlockProps {
196
- /** Code string to highlight */
197
- code: string;
198
- /** Language identifier (e.g. 'typescript', 'js', 'python') */
199
- language?: string;
200
- /** Shiki theme name. Default: 'github-dark' */
201
- theme?: BundledTheme;
202
- /** CSS class for the wrapper */
203
- className?: string;
204
- /** Pre-rendered JSX from server component via `highlight()` */
205
- initial?: JSX.Element;
206
- /** Show line numbers. Default: false */
207
- showLineNumbers?: boolean;
208
- /** Show copy button. Default: true */
209
- showCopyButton?: boolean;
210
- }
211
- /**
212
- * Syntax-highlighted code block using shiki.
213
- *
214
- * @example Basic usage
215
- * ```tsx
216
- * <CodeBlock code="const x = 1" language="typescript" />
217
- * ```
218
- *
219
- * @example With server pre-rendering (Next.js)
220
- * ```tsx
221
- * // Server Component
222
- * const initial = await highlight(code, 'typescript')
223
- * return <CodeBlock code={code} language="typescript" initial={initial} />
224
- * ```
225
- *
226
- * @example As RichTextContent block renderer
227
- * ```tsx
228
- * <RichTextContent
229
- * data={data}
230
- * blocks={{
231
- * Code: ({ node }) => (
232
- * <CodeBlock code={node.fields.code} language={node.fields.language} />
233
- * ),
234
- * }}
235
- * />
236
- * ```
237
- */
238
- declare function CodeBlock({ code, language, theme, className, initial, showLineNumbers, showCopyButton, }: CodeBlockProps): JSX.Element;
239
-
240
- export { type BlockquoteSlotProps, CodeBlock, type CodeBlockProps, type FieldRenderContext, type FormField, FormRenderer, type FormRendererProps, type FormValues, type HeadingSlotProps, type HorizontalRuleSlotProps, Image, type ImageProps, type InputField, type LinkSlotProps, type ListItemSlotProps, type ListSlotProps, type ParagraphSlotProps, type RichTextComponents, RichTextContent, type RichTextContentProps, type RichTextData, StyledRichTextContent, type StyledRichTextContentProps, type SubmissionData, type TableCellSlotProps, type TableRowSlotProps, type TableSlotProps, type TextStateConfig, type UploadSlotProps, highlight, toSubmissionData };
@@ -1,240 +0,0 @@
1
- import React, { CSSProperties, JSX } from 'react';
2
- import { SerializedLinkNode, SerializedBlockNode } from '@payloadcms/richtext-lexical';
3
- import { SerializedEditorState, SerializedLexicalNode } from '@payloadcms/richtext-lexical/lexical';
4
- import { JSXConverters, JSXConverter } from '@payloadcms/richtext-lexical/react';
5
- import { F as Form } from './payload-types-Cq93wqIe.js';
6
- import { I as ImageData } from './image-TT8lTsk5.js';
7
- import { BundledTheme } from 'shiki';
8
- export { BundledTheme } from 'shiki';
9
-
10
- interface HeadingSlotProps {
11
- tag: 'h1' | 'h2' | 'h3' | 'h4' | 'h5' | 'h6';
12
- children: React.ReactNode;
13
- node: any;
14
- }
15
- interface ParagraphSlotProps {
16
- children: React.ReactNode;
17
- isEmpty: boolean;
18
- node: any;
19
- }
20
- interface BlockquoteSlotProps {
21
- children: React.ReactNode;
22
- node: any;
23
- }
24
- interface ListSlotProps {
25
- tag: 'ul' | 'ol';
26
- listType: string;
27
- children: React.ReactNode;
28
- node: any;
29
- }
30
- interface ListItemSlotProps {
31
- children: React.ReactNode;
32
- hasSubLists: boolean;
33
- checked?: boolean;
34
- value?: number;
35
- node: any;
36
- }
37
- interface LinkSlotProps {
38
- href: string;
39
- target?: string;
40
- rel?: string;
41
- children: React.ReactNode;
42
- node: any;
43
- }
44
- interface HorizontalRuleSlotProps {
45
- node?: any;
46
- }
47
- interface UploadSlotProps {
48
- src: string;
49
- alt: string;
50
- width?: number;
51
- height?: number;
52
- mimeType: string;
53
- filename: string;
54
- sizes?: Record<string, any>;
55
- node: any;
56
- }
57
- interface TableSlotProps {
58
- children: React.ReactNode;
59
- node: any;
60
- }
61
- interface TableRowSlotProps {
62
- children: React.ReactNode;
63
- node: any;
64
- }
65
- interface TableCellSlotProps {
66
- tag: 'th' | 'td';
67
- children: React.ReactNode;
68
- colSpan?: number;
69
- rowSpan?: number;
70
- backgroundColor?: string;
71
- node: any;
72
- }
73
- interface RichTextComponents {
74
- Heading?: React.ComponentType<HeadingSlotProps>;
75
- Paragraph?: React.ComponentType<ParagraphSlotProps>;
76
- Blockquote?: React.ComponentType<BlockquoteSlotProps>;
77
- List?: React.ComponentType<ListSlotProps>;
78
- ListItem?: React.ComponentType<ListItemSlotProps>;
79
- Link?: React.ComponentType<LinkSlotProps>;
80
- HorizontalRule?: React.ComponentType<HorizontalRuleSlotProps>;
81
- Upload?: React.ComponentType<UploadSlotProps>;
82
- Table?: React.ComponentType<TableSlotProps>;
83
- TableRow?: React.ComponentType<TableRowSlotProps>;
84
- TableCell?: React.ComponentType<TableCellSlotProps>;
85
- }
86
- interface StyledRichTextContentProps extends Omit<RichTextContentProps, 'converters' | 'disableDefaultConverters'> {
87
- components?: RichTextComponents;
88
- }
89
- declare function StyledRichTextContent({ components, internalDocToHref, blocks, textState, ...props }: StyledRichTextContentProps): React.JSX.Element;
90
-
91
- type RichTextData = SerializedEditorState<SerializedLexicalNode>;
92
- type TextStateConfig = {
93
- [stateKey: string]: {
94
- [stateValue: string]: {
95
- css: Record<string, string>;
96
- label: string;
97
- };
98
- };
99
- };
100
- interface RichTextContentProps {
101
- data: RichTextData;
102
- className?: string;
103
- internalDocToHref?: (args: {
104
- linkNode: SerializedLinkNode;
105
- }) => string;
106
- converters?: Partial<JSXConverters>;
107
- blocks?: Record<string, JSXConverter<SerializedBlockNode>>;
108
- disableDefaultConverters?: boolean;
109
- textState?: TextStateConfig;
110
- }
111
-
112
- declare function RichTextContent({ data, className, internalDocToHref, converters, blocks, disableDefaultConverters, textState, }: RichTextContentProps): React.JSX.Element;
113
-
114
- type FormField = NonNullable<Form['fields']>[number];
115
- type InputField = Exclude<FormField, {
116
- blockType: 'message';
117
- }>;
118
- type FormValues = Record<string, string | number | boolean>;
119
- type SubmissionData = {
120
- field: string;
121
- value: string;
122
- }[];
123
- declare function toSubmissionData(values: FormValues): SubmissionData;
124
- interface FieldRenderContext {
125
- value: string | number | boolean;
126
- onChange: (value: string | number | boolean) => void;
127
- }
128
- interface FormRendererProps {
129
- form: Form;
130
- onSubmit: (data: FormValues) => void | Promise<void>;
131
- className?: string;
132
- fieldClassName?: string;
133
- buttonClassName?: string;
134
- renderField?: (field: FormField, context: FieldRenderContext, defaultRender: React.ReactElement) => React.ReactElement;
135
- renderMessage?: (data: RichTextData) => React.ReactElement;
136
- renderButton?: (props: {
137
- isSubmitting: boolean;
138
- label: string;
139
- }) => React.ReactElement;
140
- }
141
- declare function FormRenderer({ form, onSubmit, className, fieldClassName, buttonClassName, renderField, renderMessage, renderButton, }: FormRendererProps): React.JSX.Element;
142
-
143
- interface ImageProps {
144
- /** Payload image document */
145
- image: ImageData;
146
- /** Display width in CSS pixels (for selecting optimal srcset size) */
147
- width?: number;
148
- /** Device pixel ratio (default: 1) */
149
- dpr?: number;
150
- /** Placeholder strategy (default: 'blur'; defaults to 'none' when imageRendering is 'pixelated' or 'crisp-edges') */
151
- placeholder?: 'blur' | 'color' | 'none';
152
- /** Container className */
153
- className?: string;
154
- /** Container style */
155
- style?: CSSProperties;
156
- /** Inner `<img>` className */
157
- imgClassName?: string;
158
- /** Inner `<img>` style */
159
- imgStyle?: CSSProperties;
160
- /** HTML sizes attribute */
161
- sizes?: string;
162
- /** Loading strategy (default: 'lazy'; automatically 'eager' when priority is true) */
163
- loading?: 'lazy' | 'eager';
164
- /** Callback when image finishes loading */
165
- onLoad?: () => void;
166
- /** Object-fit for the image (default: 'cover') */
167
- objectFit?: 'cover' | 'contain' | 'fill' | 'none' | 'scale-down';
168
- /** When true, loads eagerly with high fetch priority (for LCP images) */
169
- priority?: boolean;
170
- /** When true, fills parent container (width/height: 100%, no aspect ratio) */
171
- fill?: boolean;
172
- /** CSS image-rendering mode (e.g. 'pixelated' for pixel art) */
173
- imageRendering?: 'auto' | 'pixelated' | 'crisp-edges';
174
- }
175
- /**
176
- * Image component with blur-up / color placeholder support.
177
- *
178
- * Uses LQIP (Low Quality Image Placeholder) for a smooth blur-up effect,
179
- * falling back to palette color or no placeholder.
180
- */
181
- declare function Image({ image, width, dpr, placeholder: placeholderProp, className, style, imgClassName, imgStyle, sizes, loading: loadingProp, onLoad, objectFit, priority, fill, imageRendering, }: ImageProps): React.JSX.Element;
182
-
183
- /**
184
- * Highlight code to JSX using shiki.
185
- * Works in both Server and Client components.
186
- *
187
- * @example Server Component
188
- * ```tsx
189
- * const highlighted = await highlight('const x = 1', 'typescript')
190
- * return <div>{highlighted}</div>
191
- * ```
192
- */
193
- declare function highlight(code: string, lang: string, theme?: BundledTheme): Promise<JSX.Element>;
194
-
195
- interface CodeBlockProps {
196
- /** Code string to highlight */
197
- code: string;
198
- /** Language identifier (e.g. 'typescript', 'js', 'python') */
199
- language?: string;
200
- /** Shiki theme name. Default: 'github-dark' */
201
- theme?: BundledTheme;
202
- /** CSS class for the wrapper */
203
- className?: string;
204
- /** Pre-rendered JSX from server component via `highlight()` */
205
- initial?: JSX.Element;
206
- /** Show line numbers. Default: false */
207
- showLineNumbers?: boolean;
208
- /** Show copy button. Default: true */
209
- showCopyButton?: boolean;
210
- }
211
- /**
212
- * Syntax-highlighted code block using shiki.
213
- *
214
- * @example Basic usage
215
- * ```tsx
216
- * <CodeBlock code="const x = 1" language="typescript" />
217
- * ```
218
- *
219
- * @example With server pre-rendering (Next.js)
220
- * ```tsx
221
- * // Server Component
222
- * const initial = await highlight(code, 'typescript')
223
- * return <CodeBlock code={code} language="typescript" initial={initial} />
224
- * ```
225
- *
226
- * @example As RichTextContent block renderer
227
- * ```tsx
228
- * <RichTextContent
229
- * data={data}
230
- * blocks={{
231
- * Code: ({ node }) => (
232
- * <CodeBlock code={node.fields.code} language={node.fields.language} />
233
- * ),
234
- * }}
235
- * />
236
- * ```
237
- */
238
- declare function CodeBlock({ code, language, theme, className, initial, showLineNumbers, showCopyButton, }: CodeBlockProps): JSX.Element;
239
-
240
- export { type BlockquoteSlotProps, CodeBlock, type CodeBlockProps, type FieldRenderContext, type FormField, FormRenderer, type FormRendererProps, type FormValues, type HeadingSlotProps, type HorizontalRuleSlotProps, Image, type ImageProps, type InputField, type LinkSlotProps, type ListItemSlotProps, type ListSlotProps, type ParagraphSlotProps, type RichTextComponents, RichTextContent, type RichTextContentProps, type RichTextData, StyledRichTextContent, type StyledRichTextContentProps, type SubmissionData, type TableCellSlotProps, type TableRowSlotProps, type TableSlotProps, type TextStateConfig, type UploadSlotProps, highlight, toSubmissionData };