@01.software/sdk 0.22.0 → 0.24.0
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 +101 -71
- package/dist/analytics.cjs.map +1 -1
- package/dist/analytics.js.map +1 -1
- package/dist/const-CMdmNgEs.d.ts +34 -0
- package/dist/const-Cgd4op4V.d.cts +34 -0
- package/dist/index.cjs +50 -8
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +7 -7
- package/dist/index.d.ts +7 -7
- package/dist/index.js +50 -8
- package/dist/index.js.map +1 -1
- package/dist/{payload-types-DeLBmtzd.d.cts → payload-types-D8-G1PiT.d.cts} +129 -8
- package/dist/{payload-types-DeLBmtzd.d.ts → payload-types-D8-G1PiT.d.ts} +129 -8
- package/dist/realtime.cjs.map +1 -1
- package/dist/realtime.d.cts +2 -2
- package/dist/realtime.d.ts +2 -2
- package/dist/realtime.js.map +1 -1
- package/dist/{server-BARh_6zH.d.ts → server-D7FcHj7J.d.ts} +35 -12
- package/dist/{server-BcQr-nGn.d.cts → server-DJcDyOmM.d.cts} +35 -12
- package/dist/server.cjs +9 -1
- package/dist/server.cjs.map +1 -1
- package/dist/server.d.cts +4 -4
- package/dist/server.d.ts +4 -4
- package/dist/server.js +9 -1
- package/dist/server.js.map +1 -1
- package/dist/{types-D7iFEsPc.d.cts → types-BQqfXbB2.d.ts} +18 -2
- package/dist/{types-KkuKwsli.d.ts → types-C_kwEIvY.d.cts} +18 -2
- package/dist/ui/code-block.cjs.map +1 -1
- package/dist/ui/code-block.js.map +1 -1
- package/dist/ui/form.d.cts +1 -1
- package/dist/ui/form.d.ts +1 -1
- package/dist/ui/rich-text.cjs +170 -10
- package/dist/ui/rich-text.cjs.map +1 -1
- package/dist/ui/rich-text.d.cts +22 -3
- package/dist/ui/rich-text.d.ts +22 -3
- package/dist/ui/rich-text.js +165 -5
- package/dist/ui/rich-text.js.map +1 -1
- package/dist/ui/video.d.cts +1 -1
- package/dist/ui/video.d.ts +1 -1
- package/dist/webhook.d.cts +3 -3
- package/dist/webhook.d.ts +3 -3
- package/package.json +5 -4
- package/dist/const-CfcjPbOu.d.ts +0 -24
- package/dist/const-DraU44bA.d.cts +0 -24
package/dist/ui/rich-text.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
|
|
3
3
|
// src/ui/RichText/index.tsx
|
|
4
|
-
import
|
|
4
|
+
import React3 from "react";
|
|
5
5
|
import {
|
|
6
6
|
defaultJSXConverters,
|
|
7
7
|
LinkJSXConverter,
|
|
@@ -148,6 +148,161 @@ function StyledRichTextContent({
|
|
|
148
148
|
);
|
|
149
149
|
}
|
|
150
150
|
|
|
151
|
+
// src/ui/RichText/views.tsx
|
|
152
|
+
import React2 from "react";
|
|
153
|
+
function getBlockFields(props) {
|
|
154
|
+
return props.formData;
|
|
155
|
+
}
|
|
156
|
+
function CodeView(props) {
|
|
157
|
+
const fields = getBlockFields(props);
|
|
158
|
+
const code = fields.code ?? "";
|
|
159
|
+
const language = fields.language ?? "plaintext";
|
|
160
|
+
if (props.isEditor) {
|
|
161
|
+
const { BlockCollapsible } = props.useBlockComponentContext();
|
|
162
|
+
return /* @__PURE__ */ React2.createElement(BlockCollapsible, { className: props.className }, /* @__PURE__ */ React2.createElement("pre", { style: { margin: 0, overflow: "auto", whiteSpace: "pre-wrap" } }, /* @__PURE__ */ React2.createElement("code", { "data-language": language }, code)));
|
|
163
|
+
}
|
|
164
|
+
return /* @__PURE__ */ React2.createElement("pre", { style: { overflow: "auto", whiteSpace: "pre-wrap" } }, /* @__PURE__ */ React2.createElement("code", { "data-language": language }, code));
|
|
165
|
+
}
|
|
166
|
+
function IframeView(props) {
|
|
167
|
+
const fields = getBlockFields(props);
|
|
168
|
+
const url = fields.url ?? "";
|
|
169
|
+
const width = fields.width ?? void 0;
|
|
170
|
+
const height = fields.height ?? void 0;
|
|
171
|
+
if (!url) return null;
|
|
172
|
+
if (props.isEditor) {
|
|
173
|
+
const { BlockCollapsible } = props.useBlockComponentContext();
|
|
174
|
+
return /* @__PURE__ */ React2.createElement(BlockCollapsible, { className: props.className }, /* @__PURE__ */ React2.createElement(
|
|
175
|
+
"iframe",
|
|
176
|
+
{
|
|
177
|
+
src: url,
|
|
178
|
+
title: fields.blockName ?? "Embedded content",
|
|
179
|
+
width,
|
|
180
|
+
height,
|
|
181
|
+
style: {
|
|
182
|
+
aspectRatio: width && height ? `${width} / ${height}` : "16 / 9",
|
|
183
|
+
width: "100%"
|
|
184
|
+
}
|
|
185
|
+
}
|
|
186
|
+
));
|
|
187
|
+
}
|
|
188
|
+
return /* @__PURE__ */ React2.createElement(
|
|
189
|
+
"iframe",
|
|
190
|
+
{
|
|
191
|
+
src: url,
|
|
192
|
+
title: fields.blockName ?? "Embedded content",
|
|
193
|
+
width,
|
|
194
|
+
height,
|
|
195
|
+
style: {
|
|
196
|
+
aspectRatio: width && height ? `${width} / ${height}` : "16 / 9",
|
|
197
|
+
width: "100%"
|
|
198
|
+
}
|
|
199
|
+
}
|
|
200
|
+
);
|
|
201
|
+
}
|
|
202
|
+
var richTextTextState = {
|
|
203
|
+
color: {
|
|
204
|
+
"text-red": {
|
|
205
|
+
css: {
|
|
206
|
+
color: "light-dark(oklch(0.577 0.245 27.325), oklch(0.704 0.191 22.216))"
|
|
207
|
+
},
|
|
208
|
+
label: "Red"
|
|
209
|
+
},
|
|
210
|
+
"text-orange": {
|
|
211
|
+
css: {
|
|
212
|
+
color: "light-dark(oklch(0.646 0.222 41.116), oklch(0.75 0.183 55.934))"
|
|
213
|
+
},
|
|
214
|
+
label: "Orange"
|
|
215
|
+
},
|
|
216
|
+
"text-yellow": {
|
|
217
|
+
css: {
|
|
218
|
+
color: "light-dark(oklch(0.554 0.135 66.442), oklch(0.905 0.182 98.111))"
|
|
219
|
+
},
|
|
220
|
+
label: "Yellow"
|
|
221
|
+
},
|
|
222
|
+
"text-green": {
|
|
223
|
+
css: {
|
|
224
|
+
color: "light-dark(oklch(0.527 0.154 150.069), oklch(0.792 0.209 151.711))"
|
|
225
|
+
},
|
|
226
|
+
label: "Green"
|
|
227
|
+
},
|
|
228
|
+
"text-blue": {
|
|
229
|
+
css: {
|
|
230
|
+
color: "light-dark(oklch(0.546 0.245 262.881), oklch(0.707 0.165 254.624))"
|
|
231
|
+
},
|
|
232
|
+
label: "Blue"
|
|
233
|
+
},
|
|
234
|
+
"text-purple": {
|
|
235
|
+
css: {
|
|
236
|
+
color: "light-dark(oklch(0.558 0.288 302.321), oklch(0.714 0.203 305.504))"
|
|
237
|
+
},
|
|
238
|
+
label: "Purple"
|
|
239
|
+
},
|
|
240
|
+
"text-pink": {
|
|
241
|
+
css: {
|
|
242
|
+
color: "light-dark(oklch(0.592 0.249 0.584), oklch(0.718 0.202 349.761))"
|
|
243
|
+
},
|
|
244
|
+
label: "Pink"
|
|
245
|
+
},
|
|
246
|
+
"bg-red": {
|
|
247
|
+
css: {
|
|
248
|
+
"background-color": "light-dark(oklch(0.704 0.191 22.216), oklch(0.577 0.245 27.325))"
|
|
249
|
+
},
|
|
250
|
+
label: "Red"
|
|
251
|
+
},
|
|
252
|
+
"bg-orange": {
|
|
253
|
+
css: {
|
|
254
|
+
"background-color": "light-dark(oklch(0.75 0.183 55.934), oklch(0.646 0.222 41.116))"
|
|
255
|
+
},
|
|
256
|
+
label: "Orange"
|
|
257
|
+
},
|
|
258
|
+
"bg-yellow": {
|
|
259
|
+
css: {
|
|
260
|
+
"background-color": "light-dark(oklch(0.905 0.182 98.111), oklch(0.554 0.135 66.442))"
|
|
261
|
+
},
|
|
262
|
+
label: "Yellow"
|
|
263
|
+
},
|
|
264
|
+
"bg-green": {
|
|
265
|
+
css: {
|
|
266
|
+
"background-color": "light-dark(oklch(0.792 0.209 151.711), oklch(0.527 0.154 150.069))"
|
|
267
|
+
},
|
|
268
|
+
label: "Green"
|
|
269
|
+
},
|
|
270
|
+
"bg-blue": {
|
|
271
|
+
css: {
|
|
272
|
+
"background-color": "light-dark(oklch(0.707 0.165 254.624), oklch(0.546 0.245 262.881))"
|
|
273
|
+
},
|
|
274
|
+
label: "Blue"
|
|
275
|
+
},
|
|
276
|
+
"bg-purple": {
|
|
277
|
+
css: {
|
|
278
|
+
"background-color": "light-dark(oklch(0.714 0.203 305.504), oklch(0.558 0.288 302.321))"
|
|
279
|
+
},
|
|
280
|
+
label: "Purple"
|
|
281
|
+
},
|
|
282
|
+
"bg-pink": {
|
|
283
|
+
css: {
|
|
284
|
+
"background-color": "light-dark(oklch(0.718 0.202 349.761), oklch(0.592 0.249 0.584))"
|
|
285
|
+
},
|
|
286
|
+
label: "Pink"
|
|
287
|
+
}
|
|
288
|
+
}
|
|
289
|
+
};
|
|
290
|
+
var richTextNodeMap = {
|
|
291
|
+
blocks: {
|
|
292
|
+
Code: {
|
|
293
|
+
Block: CodeView
|
|
294
|
+
},
|
|
295
|
+
Iframe: {
|
|
296
|
+
Block: IframeView
|
|
297
|
+
}
|
|
298
|
+
}
|
|
299
|
+
};
|
|
300
|
+
var richTextViewMap = {
|
|
301
|
+
default: {
|
|
302
|
+
nodes: richTextNodeMap
|
|
303
|
+
}
|
|
304
|
+
};
|
|
305
|
+
|
|
151
306
|
// src/ui/RichText/index.tsx
|
|
152
307
|
function hyphenToCamel(str) {
|
|
153
308
|
return str.replace(/-([a-z])/g, (_, c) => c.toUpperCase());
|
|
@@ -171,7 +326,7 @@ function createTextStateConverter(state) {
|
|
|
171
326
|
}
|
|
172
327
|
}
|
|
173
328
|
if (Object.keys(style).length === 0) return base;
|
|
174
|
-
return /* @__PURE__ */
|
|
329
|
+
return /* @__PURE__ */ React3.createElement("span", { style }, base);
|
|
175
330
|
};
|
|
176
331
|
}
|
|
177
332
|
function RichTextContent({
|
|
@@ -181,6 +336,7 @@ function RichTextContent({
|
|
|
181
336
|
converters,
|
|
182
337
|
blocks,
|
|
183
338
|
disableDefaultConverters,
|
|
339
|
+
nodeMap,
|
|
184
340
|
textState
|
|
185
341
|
}) {
|
|
186
342
|
const baseConverters = {
|
|
@@ -190,17 +346,21 @@ function RichTextContent({
|
|
|
190
346
|
...converters,
|
|
191
347
|
...blocks ? { blocks } : {}
|
|
192
348
|
};
|
|
193
|
-
return /* @__PURE__ */
|
|
349
|
+
return /* @__PURE__ */ React3.createElement(
|
|
194
350
|
RichText,
|
|
195
351
|
{
|
|
196
352
|
data,
|
|
197
353
|
className,
|
|
198
|
-
converters: baseConverters
|
|
354
|
+
converters: baseConverters,
|
|
355
|
+
nodeMap
|
|
199
356
|
}
|
|
200
357
|
);
|
|
201
358
|
}
|
|
202
359
|
export {
|
|
203
360
|
RichTextContent,
|
|
204
|
-
StyledRichTextContent
|
|
361
|
+
StyledRichTextContent,
|
|
362
|
+
richTextNodeMap,
|
|
363
|
+
richTextTextState,
|
|
364
|
+
richTextViewMap
|
|
205
365
|
};
|
|
206
366
|
//# sourceMappingURL=rich-text.js.map
|
package/dist/ui/rich-text.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/ui/RichText/index.tsx","../../src/ui/RichText/styled.tsx"],"sourcesContent":["'use client'\n\nimport React from 'react'\nimport {\n SerializedBlockNode,\n SerializedLinkNode,\n} from '@payloadcms/richtext-lexical'\nimport {\n SerializedEditorState,\n SerializedLexicalNode,\n} from '@payloadcms/richtext-lexical/lexical'\nimport {\n defaultJSXConverters,\n JSXConverter,\n JSXConverters,\n LinkJSXConverter,\n RichText,\n TextJSXConverter,\n} from '@payloadcms/richtext-lexical/react'\n\n/**\n * Accepts both Lexical's strict `SerializedEditorState` and Payload's generated\n * richText type (which includes index signatures like `[k: string]: unknown`).\n */\nexport type RichTextData = SerializedEditorState<SerializedLexicalNode> | {\n root: {\n type: string\n children: { type: string; version: number; [k: string]: unknown }[]\n direction: string | null\n format: string\n indent: number\n version: number\n [k: string]: unknown\n }\n [k: string]: unknown\n}\n\nexport type TextStateConfig = {\n [stateKey: string]: {\n [stateValue: string]: {\n css: Record<string, string>\n label: string\n }\n }\n}\n\nexport interface RichTextContentProps {\n data: RichTextData\n className?: string\n internalDocToHref?: (args: { linkNode: SerializedLinkNode }) => string\n converters?: Partial<JSXConverters>\n blocks?: Record<string, JSXConverter<SerializedBlockNode>>\n disableDefaultConverters?: boolean\n textState?: TextStateConfig\n}\n\nexport { StyledRichTextContent } from './styled'\nexport type {\n RichTextComponents,\n StyledRichTextContentProps,\n HeadingSlotProps,\n ParagraphSlotProps,\n BlockquoteSlotProps,\n ListSlotProps,\n ListItemSlotProps,\n LinkSlotProps,\n HorizontalRuleSlotProps,\n UploadSlotProps,\n TableSlotProps,\n TableRowSlotProps,\n TableCellSlotProps,\n} from './styled'\n\nfunction hyphenToCamel(str: string): string {\n return str.replace(/-([a-z])/g, (_, c) => c.toUpperCase())\n}\n\nfunction createTextStateConverter(\n state: TextStateConfig,\n): JSXConverters['text'] {\n const defaultTextConverter = TextJSXConverter.text\n // eslint-disable-next-line react/display-name\n return ({ node, ...rest }) => {\n const base = (\n defaultTextConverter as (...args: unknown[]) => React.ReactNode\n )({ node, ...rest })\n const nodeState = (node as Record<string, unknown>).$ as\n | Record<string, string>\n | undefined\n if (!nodeState || typeof nodeState !== 'object') return base\n\n const style: Record<string, string> = {}\n for (const stateKey in nodeState) {\n const stateValue = nodeState[stateKey]\n if (!stateValue) continue\n const css = state[stateKey]?.[stateValue]?.css\n if (css) {\n for (const prop in css) {\n const val = css[prop]\n if (val) style[hyphenToCamel(prop)] = val\n }\n }\n }\n\n if (Object.keys(style).length === 0) return base\n return <span style={style}>{base}</span>\n }\n}\n\nexport function RichTextContent({\n data,\n className,\n internalDocToHref,\n converters,\n blocks,\n disableDefaultConverters,\n textState,\n}: RichTextContentProps) {\n const baseConverters: JSXConverters = {\n ...(disableDefaultConverters ? {} : defaultJSXConverters),\n ...LinkJSXConverter({ internalDocToHref }),\n ...(textState ? { text: createTextStateConverter(textState) } : {}),\n ...converters,\n ...(blocks ? { blocks } : {}),\n }\n\n return (\n <RichText\n data={data as SerializedEditorState<SerializedLexicalNode>}\n className={className}\n converters={baseConverters}\n />\n )\n}\n","'use client'\n\n/* eslint-disable @typescript-eslint/no-explicit-any */\nimport React from 'react'\nimport { SerializedLinkNode } from '@payloadcms/richtext-lexical'\nimport { JSXConverters } from '@payloadcms/richtext-lexical/react'\nimport { RichTextContent, RichTextContentProps } from './index'\n\n// --- Slot prop types (each slot gets structured data + raw node) ---\n\nexport interface HeadingSlotProps {\n tag: 'h1' | 'h2' | 'h3' | 'h4' | 'h5' | 'h6'\n children: React.ReactNode\n node: any\n}\n\nexport interface ParagraphSlotProps {\n children: React.ReactNode\n isEmpty: boolean\n node: any\n}\n\nexport interface BlockquoteSlotProps {\n children: React.ReactNode\n node: any\n}\n\nexport interface ListSlotProps {\n tag: 'ul' | 'ol'\n listType: string\n children: React.ReactNode\n node: any\n}\n\nexport interface ListItemSlotProps {\n children: React.ReactNode\n hasSubLists: boolean\n checked?: boolean\n value?: number\n node: any\n}\n\nexport interface LinkSlotProps {\n href: string\n target?: string\n rel?: string\n children: React.ReactNode\n node: any\n}\n\nexport interface HorizontalRuleSlotProps {\n node?: any\n}\n\nexport interface UploadSlotProps {\n src: string\n alt: string\n width?: number\n height?: number\n mimeType: string\n filename: string\n sizes?: Record<string, any>\n node: any\n}\n\nexport interface TableSlotProps {\n children: React.ReactNode\n node: any\n}\n\nexport interface TableRowSlotProps {\n children: React.ReactNode\n node: any\n}\n\nexport interface TableCellSlotProps {\n tag: 'th' | 'td'\n children: React.ReactNode\n colSpan?: number\n rowSpan?: number\n backgroundColor?: string\n node: any\n}\n\n// --- Components map ---\n\nexport interface RichTextComponents {\n Heading?: React.ComponentType<HeadingSlotProps>\n Paragraph?: React.ComponentType<ParagraphSlotProps>\n Blockquote?: React.ComponentType<BlockquoteSlotProps>\n List?: React.ComponentType<ListSlotProps>\n ListItem?: React.ComponentType<ListItemSlotProps>\n Link?: React.ComponentType<LinkSlotProps>\n HorizontalRule?: React.ComponentType<HorizontalRuleSlotProps>\n Upload?: React.ComponentType<UploadSlotProps>\n Table?: React.ComponentType<TableSlotProps>\n TableRow?: React.ComponentType<TableRowSlotProps>\n TableCell?: React.ComponentType<TableCellSlotProps>\n}\n\nexport interface StyledRichTextContentProps extends Omit<\n RichTextContentProps,\n 'converters' | 'disableDefaultConverters'\n> {\n components?: RichTextComponents\n}\n\nfunction createComponentConverters(\n components: RichTextComponents,\n internalDocToHref?: (args: { linkNode: SerializedLinkNode }) => string,\n): Partial<JSXConverters> {\n const converters: Partial<JSXConverters> = {}\n\n if (components.Heading) {\n const Heading = components.Heading\n converters.heading = ({ node, nodesToJSX }) => (\n <Heading tag={node.tag} node={node}>\n {nodesToJSX({ nodes: node.children })}\n </Heading>\n )\n }\n\n if (components.Paragraph) {\n const Paragraph = components.Paragraph\n converters.paragraph = ({ node, nodesToJSX }) => {\n const children = nodesToJSX({ nodes: node.children })\n return (\n <Paragraph isEmpty={!children?.length} node={node}>\n {children?.length ? children : <br />}\n </Paragraph>\n )\n }\n }\n\n if (components.Blockquote) {\n const Blockquote = components.Blockquote\n converters.quote = ({ node, nodesToJSX }) => (\n <Blockquote node={node}>\n {nodesToJSX({ nodes: node.children })}\n </Blockquote>\n )\n }\n\n if (components.List) {\n const List = components.List\n converters.list = ({ node, nodesToJSX }) => (\n <List tag={node.tag} listType={node.listType} node={node}>\n {nodesToJSX({ nodes: node.children })}\n </List>\n )\n }\n\n if (components.ListItem) {\n const ListItem = components.ListItem\n converters.listitem = ({ node, nodesToJSX }) => {\n const hasSubLists = node.children.some(\n (child: { type: string }) => child.type === 'list',\n )\n return (\n <ListItem\n hasSubLists={hasSubLists}\n checked={node.checked}\n value={node.value}\n node={node}\n >\n {nodesToJSX({ nodes: node.children })}\n </ListItem>\n )\n }\n }\n\n if (components.Link) {\n const Link = components.Link\n\n const resolveHref = (node: any): string => {\n if (node.fields.linkType === 'internal') {\n return internalDocToHref ? internalDocToHref({ linkNode: node }) : '#'\n }\n return node.fields.url ?? ''\n }\n\n converters.link = ({ node, nodesToJSX }) => (\n <Link\n href={resolveHref(node)}\n rel={node.fields.newTab ? 'noopener noreferrer' : undefined}\n target={node.fields.newTab ? '_blank' : undefined}\n node={node}\n >\n {nodesToJSX({ nodes: node.children })}\n </Link>\n )\n\n converters.autolink = ({ node, nodesToJSX }) => (\n <Link\n href={node.fields.url ?? ''}\n rel={node.fields.newTab ? 'noopener noreferrer' : undefined}\n target={node.fields.newTab ? '_blank' : undefined}\n node={node}\n >\n {nodesToJSX({ nodes: node.children })}\n </Link>\n )\n }\n\n if (components.HorizontalRule) {\n const HorizontalRule = components.HorizontalRule\n converters.horizontalrule = <HorizontalRule />\n }\n\n if (components.Upload) {\n const Upload = components.Upload\n converters.upload = ({ node }) => {\n const uploadNode = node as any\n if (typeof uploadNode.value !== 'object') return null\n const doc = uploadNode.value\n return (\n <Upload\n src={doc.url}\n alt={uploadNode.fields?.alt || doc?.alt || ''}\n width={doc.width}\n height={doc.height}\n mimeType={doc.mimeType}\n filename={doc.filename}\n sizes={doc.sizes}\n node={node}\n />\n )\n }\n }\n\n if (components.Table) {\n const Table = components.Table\n converters.table = ({ node, nodesToJSX }) => (\n <Table node={node}>{nodesToJSX({ nodes: node.children })}</Table>\n )\n }\n\n if (components.TableRow) {\n const TableRow = components.TableRow\n converters.tablerow = ({ node, nodesToJSX }) => (\n <TableRow node={node}>{nodesToJSX({ nodes: node.children })}</TableRow>\n )\n }\n\n if (components.TableCell) {\n const TableCell = components.TableCell\n converters.tablecell = ({ node, nodesToJSX }) => (\n <TableCell\n tag={node.headerState > 0 ? 'th' : 'td'}\n colSpan={node.colSpan > 1 ? node.colSpan : undefined}\n rowSpan={node.rowSpan > 1 ? node.rowSpan : undefined}\n backgroundColor={node.backgroundColor || undefined}\n node={node}\n >\n {nodesToJSX({ nodes: node.children })}\n </TableCell>\n )\n }\n\n return converters\n}\n\nexport function StyledRichTextContent({\n components = {},\n internalDocToHref,\n blocks,\n textState,\n ...props\n}: StyledRichTextContentProps) {\n const converters = createComponentConverters(components, internalDocToHref)\n\n return (\n <RichTextContent\n {...props}\n internalDocToHref={internalDocToHref}\n converters={converters}\n blocks={blocks}\n textState={textState}\n />\n )\n}\n"],"mappings":";;;AAEA,OAAOA,YAAW;AASlB;AAAA,EACE;AAAA,EAGA;AAAA,EACA;AAAA,EACA;AAAA,OACK;;;ACfP,OAAO,WAAW;AAwGlB,SAAS,0BACP,YACA,mBACwB;AACxB,QAAM,aAAqC,CAAC;AAE5C,MAAI,WAAW,SAAS;AACtB,UAAM,UAAU,WAAW;AAC3B,eAAW,UAAU,CAAC,EAAE,MAAM,WAAW,MACvC,oCAAC,WAAQ,KAAK,KAAK,KAAK,QACrB,WAAW,EAAE,OAAO,KAAK,SAAS,CAAC,CACtC;AAAA,EAEJ;AAEA,MAAI,WAAW,WAAW;AACxB,UAAM,YAAY,WAAW;AAC7B,eAAW,YAAY,CAAC,EAAE,MAAM,WAAW,MAAM;AAC/C,YAAM,WAAW,WAAW,EAAE,OAAO,KAAK,SAAS,CAAC;AACpD,aACE,oCAAC,aAAU,SAAS,CAAC,UAAU,QAAQ,QACpC,UAAU,SAAS,WAAW,oCAAC,UAAG,CACrC;AAAA,IAEJ;AAAA,EACF;AAEA,MAAI,WAAW,YAAY;AACzB,UAAM,aAAa,WAAW;AAC9B,eAAW,QAAQ,CAAC,EAAE,MAAM,WAAW,MACrC,oCAAC,cAAW,QACT,WAAW,EAAE,OAAO,KAAK,SAAS,CAAC,CACtC;AAAA,EAEJ;AAEA,MAAI,WAAW,MAAM;AACnB,UAAM,OAAO,WAAW;AACxB,eAAW,OAAO,CAAC,EAAE,MAAM,WAAW,MACpC,oCAAC,QAAK,KAAK,KAAK,KAAK,UAAU,KAAK,UAAU,QAC3C,WAAW,EAAE,OAAO,KAAK,SAAS,CAAC,CACtC;AAAA,EAEJ;AAEA,MAAI,WAAW,UAAU;AACvB,UAAM,WAAW,WAAW;AAC5B,eAAW,WAAW,CAAC,EAAE,MAAM,WAAW,MAAM;AAC9C,YAAM,cAAc,KAAK,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,EAC7B;AAEA,SACE,gBAAAA,OAAA;AAAA,IAAC;AAAA;AAAA,MACC;AAAA,MACA;AAAA,MACA,YAAY;AAAA;AAAA,EACd;AAEJ;","names":["React","React"]}
|
|
1
|
+
{"version":3,"sources":["../../src/ui/RichText/index.tsx","../../src/ui/RichText/styled.tsx","../../src/ui/RichText/views.tsx"],"sourcesContent":["'use client'\n\nimport React from 'react'\nimport type {\n LexicalEditorNodeMap,\n SerializedBlockNode,\n SerializedLinkNode,\n} from '@payloadcms/richtext-lexical'\nimport type {\n SerializedEditorState,\n SerializedLexicalNode,\n} from '@payloadcms/richtext-lexical/lexical'\nimport {\n defaultJSXConverters,\n LinkJSXConverter,\n RichText,\n TextJSXConverter,\n} from '@payloadcms/richtext-lexical/react'\nimport type {\n JSXConverter,\n JSXConverters,\n} from '@payloadcms/richtext-lexical/react'\n\n/**\n * Accepts both Lexical's strict `SerializedEditorState` and Payload's generated\n * richText type (which includes index signatures like `[k: string]: unknown`).\n */\nexport type RichTextData =\n | SerializedEditorState<SerializedLexicalNode>\n | {\n root: {\n type: string\n children: { type: string; version: number; [k: string]: unknown }[]\n direction: string | null\n format: string\n indent: number\n version: number\n [k: string]: unknown\n }\n [k: string]: unknown\n }\n\nexport type TextStateConfig = {\n [stateKey: string]: {\n [stateValue: string]: {\n css: Record<string, string>\n label: string\n }\n }\n}\n\nexport interface RichTextContentProps {\n data: RichTextData\n className?: string\n internalDocToHref?: (args: { linkNode: SerializedLinkNode }) => string\n converters?: Partial<JSXConverters>\n blocks?: Record<string, JSXConverter<SerializedBlockNode>>\n disableDefaultConverters?: boolean\n nodeMap?: LexicalEditorNodeMap\n textState?: TextStateConfig\n}\n\nexport { StyledRichTextContent } from './styled'\nexport { richTextNodeMap, richTextTextState, richTextViewMap } from './views'\nexport type {\n RichTextComponents,\n StyledRichTextContentProps,\n HeadingSlotProps,\n ParagraphSlotProps,\n BlockquoteSlotProps,\n ListSlotProps,\n ListItemSlotProps,\n LinkSlotProps,\n HorizontalRuleSlotProps,\n UploadSlotProps,\n TableSlotProps,\n TableRowSlotProps,\n TableCellSlotProps,\n} from './styled'\n\nfunction hyphenToCamel(str: string): string {\n return str.replace(/-([a-z])/g, (_, c) => c.toUpperCase())\n}\n\nfunction createTextStateConverter(\n state: TextStateConfig,\n): JSXConverters['text'] {\n const defaultTextConverter = TextJSXConverter.text\n // eslint-disable-next-line react/display-name\n return ({ node, ...rest }) => {\n const base = (\n defaultTextConverter as (...args: unknown[]) => React.ReactNode\n )({ node, ...rest })\n const nodeState = (node as Record<string, unknown>).$ as\n | Record<string, string>\n | undefined\n if (!nodeState || typeof nodeState !== 'object') return base\n\n const style: Record<string, string> = {}\n for (const stateKey in nodeState) {\n const stateValue = nodeState[stateKey]\n if (!stateValue) continue\n const css = state[stateKey]?.[stateValue]?.css\n if (css) {\n for (const prop in css) {\n const val = css[prop]\n if (val) style[hyphenToCamel(prop)] = val\n }\n }\n }\n\n if (Object.keys(style).length === 0) return base\n return <span style={style}>{base}</span>\n }\n}\n\nexport function RichTextContent({\n data,\n className,\n internalDocToHref,\n converters,\n blocks,\n disableDefaultConverters,\n nodeMap,\n textState,\n}: RichTextContentProps) {\n const baseConverters: JSXConverters = {\n ...(disableDefaultConverters ? {} : defaultJSXConverters),\n ...LinkJSXConverter({ internalDocToHref }),\n ...(textState ? { text: createTextStateConverter(textState) } : {}),\n ...converters,\n ...(blocks ? { blocks } : {}),\n }\n\n return (\n <RichText\n data={data as SerializedEditorState<SerializedLexicalNode>}\n className={className}\n converters={baseConverters}\n nodeMap={nodeMap}\n />\n )\n}\n","'use client'\n\n/* eslint-disable @typescript-eslint/no-explicit-any */\nimport React from 'react'\nimport { SerializedLinkNode } from '@payloadcms/richtext-lexical'\nimport { JSXConverters } from '@payloadcms/richtext-lexical/react'\nimport { RichTextContent, RichTextContentProps } from './index'\n\n// --- Slot prop types (each slot gets structured data + raw node) ---\n\nexport interface HeadingSlotProps {\n tag: 'h1' | 'h2' | 'h3' | 'h4' | 'h5' | 'h6'\n children: React.ReactNode\n node: any\n}\n\nexport interface ParagraphSlotProps {\n children: React.ReactNode\n isEmpty: boolean\n node: any\n}\n\nexport interface BlockquoteSlotProps {\n children: React.ReactNode\n node: any\n}\n\nexport interface ListSlotProps {\n tag: 'ul' | 'ol'\n listType: string\n children: React.ReactNode\n node: any\n}\n\nexport interface ListItemSlotProps {\n children: React.ReactNode\n hasSubLists: boolean\n checked?: boolean\n value?: number\n node: any\n}\n\nexport interface LinkSlotProps {\n href: string\n target?: string\n rel?: string\n children: React.ReactNode\n node: any\n}\n\nexport interface HorizontalRuleSlotProps {\n node?: any\n}\n\nexport interface UploadSlotProps {\n src: string\n alt: string\n width?: number\n height?: number\n mimeType: string\n filename: string\n sizes?: Record<string, any>\n node: any\n}\n\nexport interface TableSlotProps {\n children: React.ReactNode\n node: any\n}\n\nexport interface TableRowSlotProps {\n children: React.ReactNode\n node: any\n}\n\nexport interface TableCellSlotProps {\n tag: 'th' | 'td'\n children: React.ReactNode\n colSpan?: number\n rowSpan?: number\n backgroundColor?: string\n node: any\n}\n\n// --- Components map ---\n\nexport interface RichTextComponents {\n Heading?: React.ComponentType<HeadingSlotProps>\n Paragraph?: React.ComponentType<ParagraphSlotProps>\n Blockquote?: React.ComponentType<BlockquoteSlotProps>\n List?: React.ComponentType<ListSlotProps>\n ListItem?: React.ComponentType<ListItemSlotProps>\n Link?: React.ComponentType<LinkSlotProps>\n HorizontalRule?: React.ComponentType<HorizontalRuleSlotProps>\n Upload?: React.ComponentType<UploadSlotProps>\n Table?: React.ComponentType<TableSlotProps>\n TableRow?: React.ComponentType<TableRowSlotProps>\n TableCell?: React.ComponentType<TableCellSlotProps>\n}\n\nexport interface StyledRichTextContentProps extends Omit<\n RichTextContentProps,\n 'converters' | 'disableDefaultConverters'\n> {\n components?: RichTextComponents\n}\n\nfunction createComponentConverters(\n components: RichTextComponents,\n internalDocToHref?: (args: { linkNode: SerializedLinkNode }) => string,\n): Partial<JSXConverters> {\n const converters: Partial<JSXConverters> = {}\n\n if (components.Heading) {\n const Heading = components.Heading\n converters.heading = ({ node, nodesToJSX }) => (\n <Heading tag={node.tag} node={node}>\n {nodesToJSX({ nodes: node.children })}\n </Heading>\n )\n }\n\n if (components.Paragraph) {\n const Paragraph = components.Paragraph\n converters.paragraph = ({ node, nodesToJSX }) => {\n const children = nodesToJSX({ nodes: node.children })\n return (\n <Paragraph isEmpty={!children?.length} node={node}>\n {children?.length ? children : <br />}\n </Paragraph>\n )\n }\n }\n\n if (components.Blockquote) {\n const Blockquote = components.Blockquote\n converters.quote = ({ node, nodesToJSX }) => (\n <Blockquote node={node}>\n {nodesToJSX({ nodes: node.children })}\n </Blockquote>\n )\n }\n\n if (components.List) {\n const List = components.List\n converters.list = ({ node, nodesToJSX }) => (\n <List tag={node.tag} listType={node.listType} node={node}>\n {nodesToJSX({ nodes: node.children })}\n </List>\n )\n }\n\n if (components.ListItem) {\n const ListItem = components.ListItem\n converters.listitem = ({ node, nodesToJSX }) => {\n const hasSubLists = node.children.some(\n (child: { type: string }) => child.type === 'list',\n )\n return (\n <ListItem\n hasSubLists={hasSubLists}\n checked={node.checked}\n value={node.value}\n node={node}\n >\n {nodesToJSX({ nodes: node.children })}\n </ListItem>\n )\n }\n }\n\n if (components.Link) {\n const Link = components.Link\n\n const resolveHref = (node: any): string => {\n if (node.fields.linkType === 'internal') {\n return internalDocToHref ? internalDocToHref({ linkNode: node }) : '#'\n }\n return node.fields.url ?? ''\n }\n\n converters.link = ({ node, nodesToJSX }) => (\n <Link\n href={resolveHref(node)}\n rel={node.fields.newTab ? 'noopener noreferrer' : undefined}\n target={node.fields.newTab ? '_blank' : undefined}\n node={node}\n >\n {nodesToJSX({ nodes: node.children })}\n </Link>\n )\n\n converters.autolink = ({ node, nodesToJSX }) => (\n <Link\n href={node.fields.url ?? ''}\n rel={node.fields.newTab ? 'noopener noreferrer' : undefined}\n target={node.fields.newTab ? '_blank' : undefined}\n node={node}\n >\n {nodesToJSX({ nodes: node.children })}\n </Link>\n )\n }\n\n if (components.HorizontalRule) {\n const HorizontalRule = components.HorizontalRule\n converters.horizontalrule = <HorizontalRule />\n }\n\n if (components.Upload) {\n const Upload = components.Upload\n converters.upload = ({ node }) => {\n const uploadNode = node as any\n if (typeof uploadNode.value !== 'object') return null\n const doc = uploadNode.value\n return (\n <Upload\n src={doc.url}\n alt={uploadNode.fields?.alt || doc?.alt || ''}\n width={doc.width}\n height={doc.height}\n mimeType={doc.mimeType}\n filename={doc.filename}\n sizes={doc.sizes}\n node={node}\n />\n )\n }\n }\n\n if (components.Table) {\n const Table = components.Table\n converters.table = ({ node, nodesToJSX }) => (\n <Table node={node}>{nodesToJSX({ nodes: node.children })}</Table>\n )\n }\n\n if (components.TableRow) {\n const TableRow = components.TableRow\n converters.tablerow = ({ node, nodesToJSX }) => (\n <TableRow node={node}>{nodesToJSX({ nodes: node.children })}</TableRow>\n )\n }\n\n if (components.TableCell) {\n const TableCell = components.TableCell\n converters.tablecell = ({ node, nodesToJSX }) => (\n <TableCell\n tag={node.headerState > 0 ? 'th' : 'td'}\n colSpan={node.colSpan > 1 ? node.colSpan : undefined}\n rowSpan={node.rowSpan > 1 ? node.rowSpan : undefined}\n backgroundColor={node.backgroundColor || undefined}\n node={node}\n >\n {nodesToJSX({ nodes: node.children })}\n </TableCell>\n )\n }\n\n return converters\n}\n\nexport function StyledRichTextContent({\n components = {},\n internalDocToHref,\n blocks,\n textState,\n ...props\n}: StyledRichTextContentProps) {\n const converters = createComponentConverters(components, internalDocToHref)\n\n return (\n <RichTextContent\n {...props}\n internalDocToHref={internalDocToHref}\n converters={converters}\n blocks={blocks}\n textState={textState}\n />\n )\n}\n","'use client'\n\nimport React from 'react'\nimport type {\n LexicalEditorNodeMap,\n LexicalEditorViewMap,\n SerializedBlockNode,\n ViewMapBlockComponentProps,\n} from '@payloadcms/richtext-lexical'\nimport type { TextStateConfig } from './index'\n\ntype CodeBlockFields = {\n blockName?: null | string\n blockType: 'Code'\n code?: string | null\n language?: string | null\n}\n\ntype IframeBlockFields = {\n blockName?: null | string\n blockType: 'Iframe'\n height?: number | null\n url?: string | null\n width?: number | null\n}\n\ntype SupportedRichTextBlockNode =\n | SerializedBlockNode<CodeBlockFields>\n | SerializedBlockNode<IframeBlockFields>\n\ntype RichTextBlockProps<TFields extends CodeBlockFields | IframeBlockFields> =\n ViewMapBlockComponentProps<SerializedBlockNode<TFields>>\n\nfunction getBlockFields<TFields extends CodeBlockFields | IframeBlockFields>(\n props: RichTextBlockProps<TFields>,\n): TFields {\n return props.formData as TFields\n}\n\nfunction CodeView(props: RichTextBlockProps<CodeBlockFields>) {\n const fields = getBlockFields(props)\n const code = fields.code ?? ''\n const language = fields.language ?? 'plaintext'\n\n if (props.isEditor) {\n const { BlockCollapsible } = props.useBlockComponentContext()\n\n return (\n <BlockCollapsible className={props.className}>\n <pre style={{ margin: 0, overflow: 'auto', whiteSpace: 'pre-wrap' }}>\n <code data-language={language}>{code}</code>\n </pre>\n </BlockCollapsible>\n )\n }\n\n return (\n <pre style={{ overflow: 'auto', whiteSpace: 'pre-wrap' }}>\n <code data-language={language}>{code}</code>\n </pre>\n )\n}\n\nfunction IframeView(props: RichTextBlockProps<IframeBlockFields>) {\n const fields = getBlockFields(props)\n const url = fields.url ?? ''\n const width = fields.width ?? undefined\n const height = fields.height ?? undefined\n\n if (!url) return null\n\n if (props.isEditor) {\n const { BlockCollapsible } = props.useBlockComponentContext()\n\n return (\n <BlockCollapsible className={props.className}>\n <iframe\n src={url}\n title={fields.blockName ?? 'Embedded content'}\n width={width}\n height={height}\n style={{\n aspectRatio: width && height ? `${width} / ${height}` : '16 / 9',\n width: '100%',\n }}\n />\n </BlockCollapsible>\n )\n }\n\n return (\n <iframe\n src={url}\n title={fields.blockName ?? 'Embedded content'}\n width={width}\n height={height}\n style={{\n aspectRatio: width && height ? `${width} / ${height}` : '16 / 9',\n width: '100%',\n }}\n />\n )\n}\n\nexport const richTextTextState: TextStateConfig = {\n color: {\n 'text-red': {\n css: {\n color:\n 'light-dark(oklch(0.577 0.245 27.325), oklch(0.704 0.191 22.216))',\n },\n label: 'Red',\n },\n 'text-orange': {\n css: {\n color:\n 'light-dark(oklch(0.646 0.222 41.116), oklch(0.75 0.183 55.934))',\n },\n label: 'Orange',\n },\n 'text-yellow': {\n css: {\n color:\n 'light-dark(oklch(0.554 0.135 66.442), oklch(0.905 0.182 98.111))',\n },\n label: 'Yellow',\n },\n 'text-green': {\n css: {\n color:\n 'light-dark(oklch(0.527 0.154 150.069), oklch(0.792 0.209 151.711))',\n },\n label: 'Green',\n },\n 'text-blue': {\n css: {\n color:\n 'light-dark(oklch(0.546 0.245 262.881), oklch(0.707 0.165 254.624))',\n },\n label: 'Blue',\n },\n 'text-purple': {\n css: {\n color:\n 'light-dark(oklch(0.558 0.288 302.321), oklch(0.714 0.203 305.504))',\n },\n label: 'Purple',\n },\n 'text-pink': {\n css: {\n color:\n 'light-dark(oklch(0.592 0.249 0.584), oklch(0.718 0.202 349.761))',\n },\n label: 'Pink',\n },\n 'bg-red': {\n css: {\n 'background-color':\n 'light-dark(oklch(0.704 0.191 22.216), oklch(0.577 0.245 27.325))',\n },\n label: 'Red',\n },\n 'bg-orange': {\n css: {\n 'background-color':\n 'light-dark(oklch(0.75 0.183 55.934), oklch(0.646 0.222 41.116))',\n },\n label: 'Orange',\n },\n 'bg-yellow': {\n css: {\n 'background-color':\n 'light-dark(oklch(0.905 0.182 98.111), oklch(0.554 0.135 66.442))',\n },\n label: 'Yellow',\n },\n 'bg-green': {\n css: {\n 'background-color':\n 'light-dark(oklch(0.792 0.209 151.711), oklch(0.527 0.154 150.069))',\n },\n label: 'Green',\n },\n 'bg-blue': {\n css: {\n 'background-color':\n 'light-dark(oklch(0.707 0.165 254.624), oklch(0.546 0.245 262.881))',\n },\n label: 'Blue',\n },\n 'bg-purple': {\n css: {\n 'background-color':\n 'light-dark(oklch(0.714 0.203 305.504), oklch(0.558 0.288 302.321))',\n },\n label: 'Purple',\n },\n 'bg-pink': {\n css: {\n 'background-color':\n 'light-dark(oklch(0.718 0.202 349.761), oklch(0.592 0.249 0.584))',\n },\n label: 'Pink',\n },\n },\n}\n\nexport const richTextNodeMap: LexicalEditorNodeMap<SupportedRichTextBlockNode> =\n {\n blocks: {\n Code: {\n Block: CodeView,\n },\n Iframe: {\n Block: IframeView,\n },\n },\n }\n\nexport const richTextViewMap: LexicalEditorViewMap<SupportedRichTextBlockNode> =\n {\n default: {\n nodes: richTextNodeMap,\n },\n }\n"],"mappings":";;;AAEA,OAAOA,YAAW;AAUlB;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OACK;;;ACdP,OAAO,WAAW;AAwGlB,SAAS,0BACP,YACA,mBACwB;AACxB,QAAM,aAAqC,CAAC;AAE5C,MAAI,WAAW,SAAS;AACtB,UAAM,UAAU,WAAW;AAC3B,eAAW,UAAU,CAAC,EAAE,MAAM,WAAW,MACvC,oCAAC,WAAQ,KAAK,KAAK,KAAK,QACrB,WAAW,EAAE,OAAO,KAAK,SAAS,CAAC,CACtC;AAAA,EAEJ;AAEA,MAAI,WAAW,WAAW;AACxB,UAAM,YAAY,WAAW;AAC7B,eAAW,YAAY,CAAC,EAAE,MAAM,WAAW,MAAM;AAC/C,YAAM,WAAW,WAAW,EAAE,OAAO,KAAK,SAAS,CAAC;AACpD,aACE,oCAAC,aAAU,SAAS,CAAC,UAAU,QAAQ,QACpC,UAAU,SAAS,WAAW,oCAAC,UAAG,CACrC;AAAA,IAEJ;AAAA,EACF;AAEA,MAAI,WAAW,YAAY;AACzB,UAAM,aAAa,WAAW;AAC9B,eAAW,QAAQ,CAAC,EAAE,MAAM,WAAW,MACrC,oCAAC,cAAW,QACT,WAAW,EAAE,OAAO,KAAK,SAAS,CAAC,CACtC;AAAA,EAEJ;AAEA,MAAI,WAAW,MAAM;AACnB,UAAM,OAAO,WAAW;AACxB,eAAW,OAAO,CAAC,EAAE,MAAM,WAAW,MACpC,oCAAC,QAAK,KAAK,KAAK,KAAK,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MAAM,QAAQ,IAAI,UAAU,GAAG;AAC3C,UAAI,KAAK;AACP,mBAAW,QAAQ,KAAK;AACtB,gBAAM,MAAM,IAAI,IAAI;AACpB,cAAI,IAAK,OAAM,cAAc,IAAI,CAAC,IAAI;AAAA,QACxC;AAAA,MACF;AAAA,IACF;AAEA,QAAI,OAAO,KAAK,KAAK,EAAE,WAAW,EAAG,QAAO;AAC5C,WAAO,gBAAAC,OAAA,cAAC,UAAK,SAAe,IAAK;AAAA,EACnC;AACF;AAEO,SAAS,gBAAgB;AAAA,EAC9B;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACF,GAAyB;AACvB,QAAM,iBAAgC;AAAA,IACpC,GAAI,2BAA2B,CAAC,IAAI;AAAA,IACpC,GAAG,iBAAiB,EAAE,kBAAkB,CAAC;AAAA,IACzC,GAAI,YAAY,EAAE,MAAM,yBAAyB,SAAS,EAAE,IAAI,CAAC;AAAA,IACjE,GAAG;AAAA,IACH,GAAI,SAAS,EAAE,OAAO,IAAI,CAAC;AAAA,EAC7B;AAEA,SACE,gBAAAA,OAAA;AAAA,IAAC;AAAA;AAAA,MACC;AAAA,MACA;AAAA,MACA,YAAY;AAAA,MACZ;AAAA;AAAA,EACF;AAEJ;","names":["React","React","React"]}
|
package/dist/ui/video.d.cts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import React, { CSSProperties } from 'react';
|
|
2
2
|
import { MuxPlayerProps, MuxPlayerRefAttributes } from '@mux/mux-player-react';
|
|
3
3
|
export { MuxPlayerRefAttributes as VideoPlayerRef } from '@mux/mux-player-react';
|
|
4
|
-
import { V as Video } from '../payload-types-
|
|
4
|
+
import { V as Video } from '../payload-types-D8-G1PiT.cjs';
|
|
5
5
|
export { e as VideoGifOptions, V as VideoThumbnailOptions, a as getVideoGif, c as getVideoMp4Url, d as getVideoStoryboard, b as getVideoStreamUrl, g as getVideoThumbnail } from '../video-DbLL8yuc.cjs';
|
|
6
6
|
|
|
7
7
|
interface VideoPlayerCSSProperties extends CSSProperties {
|
package/dist/ui/video.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import React, { CSSProperties } from 'react';
|
|
2
2
|
import { MuxPlayerProps, MuxPlayerRefAttributes } from '@mux/mux-player-react';
|
|
3
3
|
export { MuxPlayerRefAttributes as VideoPlayerRef } from '@mux/mux-player-react';
|
|
4
|
-
import { V as Video } from '../payload-types-
|
|
4
|
+
import { V as Video } from '../payload-types-D8-G1PiT.js';
|
|
5
5
|
export { e as VideoGifOptions, V as VideoThumbnailOptions, a as getVideoGif, c as getVideoMp4Url, d as getVideoStoryboard, b as getVideoStreamUrl, g as getVideoThumbnail } from '../video-DbLL8yuc.js';
|
|
6
6
|
|
|
7
7
|
interface VideoPlayerCSSProperties extends CSSProperties {
|
package/dist/webhook.d.cts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { C as Collection } from './const-
|
|
2
|
-
import { C as CollectionType } from './types-
|
|
3
|
-
import './payload-types-
|
|
1
|
+
import { C as Collection } from './const-Cgd4op4V.cjs';
|
|
2
|
+
import { C as CollectionType } from './types-C_kwEIvY.cjs';
|
|
3
|
+
import './payload-types-D8-G1PiT.cjs';
|
|
4
4
|
|
|
5
5
|
type WebhookOperation = string;
|
|
6
6
|
interface WebhookEvent<T extends Collection | string = Collection, TData = T extends Collection ? CollectionType<T> : Record<string, unknown>> {
|
package/dist/webhook.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { C as Collection } from './const-
|
|
2
|
-
import { C as CollectionType } from './types-
|
|
3
|
-
import './payload-types-
|
|
1
|
+
import { C as Collection } from './const-CMdmNgEs.js';
|
|
2
|
+
import { C as CollectionType } from './types-BQqfXbB2.js';
|
|
3
|
+
import './payload-types-D8-G1PiT.js';
|
|
4
4
|
|
|
5
5
|
type WebhookOperation = string;
|
|
6
6
|
interface WebhookEvent<T extends Collection | string = Collection, TData = T extends Collection ? CollectionType<T> : Record<string, unknown>> {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@01.software/sdk",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.24.0",
|
|
4
4
|
"description": "01.software SDK",
|
|
5
5
|
"author": "<office@01.works>",
|
|
6
6
|
"keywords": [],
|
|
@@ -150,7 +150,8 @@
|
|
|
150
150
|
"@xyflow/react": "^12.10.1",
|
|
151
151
|
"eslint": "^9.39.1",
|
|
152
152
|
"jsdom": "26.1.0",
|
|
153
|
-
"
|
|
153
|
+
"monaco-editor": "0.55.1",
|
|
154
|
+
"next": "15.4.11",
|
|
154
155
|
"publint": "^0.3.16",
|
|
155
156
|
"react": "^19.2.3",
|
|
156
157
|
"react-dom": "^19.2.3",
|
|
@@ -162,10 +163,10 @@
|
|
|
162
163
|
"@repo/typescript-config": "0.0.0"
|
|
163
164
|
},
|
|
164
165
|
"dependencies": {
|
|
165
|
-
"@payloadcms/richtext-lexical": ">=3.
|
|
166
|
+
"@payloadcms/richtext-lexical": ">=3.84.1",
|
|
166
167
|
"hast-util-to-jsx-runtime": "^2.3.6",
|
|
167
168
|
"jose": "^6.1.3",
|
|
168
|
-
"payload": ">=3.
|
|
169
|
+
"payload": ">=3.84.1",
|
|
169
170
|
"postcss": "^8.4.35",
|
|
170
171
|
"qs-esm": "^7.0.2",
|
|
171
172
|
"quickjs-emscripten": "0.29.2",
|
package/dist/const-CfcjPbOu.d.ts
DELETED
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
import { b as Config } from './payload-types-DeLBmtzd.js';
|
|
2
|
-
|
|
3
|
-
/**
|
|
4
|
-
* Collection type derived from Payload Config.
|
|
5
|
-
* This ensures type safety and automatic synchronization with payload-types.ts
|
|
6
|
-
*/
|
|
7
|
-
type Collection = keyof Config['collections'];
|
|
8
|
-
/**
|
|
9
|
-
* Internal collections that should not be exposed via SDK.
|
|
10
|
-
* Includes Payload system collections and admin-only collections.
|
|
11
|
-
*/
|
|
12
|
-
declare const INTERNAL_COLLECTIONS: readonly ["users", "payload-kv", "payload-locked-documents", "payload-preferences", "payload-migrations", "field-configs", "system-media", "track-assets", "audiences", "email-logs", "api-usage", "tenant-analytics-daily", "analytics-event-schemas", "subscriptions", "billing-history", "order-status-logs", "api-keys", "personal-access-tokens", "tenant-entitlements", "direct-upload-sessions", "webhook-events", "webhook-deliveries", "audit-logs", "plans", "webhooks", "event-registrations"];
|
|
13
|
-
/**
|
|
14
|
-
* Array of all public collection names for runtime use (e.g., Zod enum validation).
|
|
15
|
-
* This is the single source of truth for which collections are publicly accessible via SDK.
|
|
16
|
-
*/
|
|
17
|
-
declare const COLLECTIONS: readonly ["tenants", "tenant-metadata", "tenant-logos", "products", "product-variants", "product-options", "product-option-values", "product-categories", "product-tags", "product-collections", "brands", "brand-logos", "orders", "order-items", "returns", "return-items", "fulfillments", "fulfillment-items", "transactions", "customers", "customer-profiles", "customer-addresses", "customer-groups", "carts", "cart-items", "discounts", "promotions", "shipping-policies", "documents", "document-categories", "document-types", "articles", "article-authors", "article-categories", "article-tags", "playlists", "playlist-categories", "playlist-tags", "tracks", "track-categories", "track-tags", "galleries", "gallery-categories", "gallery-tags", "gallery-items", "links", "link-categories", "link-tags", "canvases", "canvas-node-types", "canvas-edge-types", "canvas-categories", "canvas-tags", "canvas-nodes", "canvas-edges", "videos", "video-categories", "video-tags", "live-streams", "images", "forms", "form-submissions", "posts", "comments", "reactions", "reaction-types", "bookmarks", "post-categories", "reports", "community-bans", "event-calendars", "events", "event-categories", "event-occurrences", "event-tags"];
|
|
18
|
-
/**
|
|
19
|
-
* Public collections available for SDK access.
|
|
20
|
-
* Derived from the COLLECTIONS array (single source of truth).
|
|
21
|
-
*/
|
|
22
|
-
type PublicCollection = (typeof COLLECTIONS)[number];
|
|
23
|
-
|
|
24
|
-
export { type Collection as C, INTERNAL_COLLECTIONS as I, type PublicCollection as P, COLLECTIONS as a };
|
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
import { b as Config } from './payload-types-DeLBmtzd.cjs';
|
|
2
|
-
|
|
3
|
-
/**
|
|
4
|
-
* Collection type derived from Payload Config.
|
|
5
|
-
* This ensures type safety and automatic synchronization with payload-types.ts
|
|
6
|
-
*/
|
|
7
|
-
type Collection = keyof Config['collections'];
|
|
8
|
-
/**
|
|
9
|
-
* Internal collections that should not be exposed via SDK.
|
|
10
|
-
* Includes Payload system collections and admin-only collections.
|
|
11
|
-
*/
|
|
12
|
-
declare const INTERNAL_COLLECTIONS: readonly ["users", "payload-kv", "payload-locked-documents", "payload-preferences", "payload-migrations", "field-configs", "system-media", "track-assets", "audiences", "email-logs", "api-usage", "tenant-analytics-daily", "analytics-event-schemas", "subscriptions", "billing-history", "order-status-logs", "api-keys", "personal-access-tokens", "tenant-entitlements", "direct-upload-sessions", "webhook-events", "webhook-deliveries", "audit-logs", "plans", "webhooks", "event-registrations"];
|
|
13
|
-
/**
|
|
14
|
-
* Array of all public collection names for runtime use (e.g., Zod enum validation).
|
|
15
|
-
* This is the single source of truth for which collections are publicly accessible via SDK.
|
|
16
|
-
*/
|
|
17
|
-
declare const COLLECTIONS: readonly ["tenants", "tenant-metadata", "tenant-logos", "products", "product-variants", "product-options", "product-option-values", "product-categories", "product-tags", "product-collections", "brands", "brand-logos", "orders", "order-items", "returns", "return-items", "fulfillments", "fulfillment-items", "transactions", "customers", "customer-profiles", "customer-addresses", "customer-groups", "carts", "cart-items", "discounts", "promotions", "shipping-policies", "documents", "document-categories", "document-types", "articles", "article-authors", "article-categories", "article-tags", "playlists", "playlist-categories", "playlist-tags", "tracks", "track-categories", "track-tags", "galleries", "gallery-categories", "gallery-tags", "gallery-items", "links", "link-categories", "link-tags", "canvases", "canvas-node-types", "canvas-edge-types", "canvas-categories", "canvas-tags", "canvas-nodes", "canvas-edges", "videos", "video-categories", "video-tags", "live-streams", "images", "forms", "form-submissions", "posts", "comments", "reactions", "reaction-types", "bookmarks", "post-categories", "reports", "community-bans", "event-calendars", "events", "event-categories", "event-occurrences", "event-tags"];
|
|
18
|
-
/**
|
|
19
|
-
* Public collections available for SDK access.
|
|
20
|
-
* Derived from the COLLECTIONS array (single source of truth).
|
|
21
|
-
*/
|
|
22
|
-
type PublicCollection = (typeof COLLECTIONS)[number];
|
|
23
|
-
|
|
24
|
-
export { type Collection as C, INTERNAL_COLLECTIONS as I, type PublicCollection as P, COLLECTIONS as a };
|