@01.software/sdk 0.23.0 → 0.25.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 +9 -2
- package/dist/{const-CMdmNgEs.d.ts → const-Bs-QcTj0.d.ts} +2 -2
- package/dist/{const-Cgd4op4V.d.cts → const-C8UhtzLn.d.cts} +2 -2
- package/dist/index.cjs +1 -0
- 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 +1 -0
- package/dist/index.js.map +1 -1
- package/dist/{payload-types-D8-G1PiT.d.cts → payload-types-BaK4zCQ8.d.cts} +63 -8
- package/dist/{payload-types-D8-G1PiT.d.ts → payload-types-BaK4zCQ8.d.ts} +63 -8
- package/dist/realtime.d.cts +2 -2
- package/dist/realtime.d.ts +2 -2
- package/dist/{server-DJcDyOmM.d.cts → server-CkGfBnSx.d.cts} +3 -3
- package/dist/{server-D7FcHj7J.d.ts → server-DQYWLnkt.d.ts} +3 -3
- package/dist/server.d.cts +4 -4
- package/dist/server.d.ts +4 -4
- package/dist/{types-C_kwEIvY.d.cts → types-BH-YBrFs.d.cts} +1 -1
- package/dist/{types-BQqfXbB2.d.ts → types-DjaaBExv.d.ts} +1 -1
- 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
|
@@ -108,6 +108,7 @@ interface Config {
|
|
|
108
108
|
forms: Form;
|
|
109
109
|
'form-submissions': FormSubmission;
|
|
110
110
|
'payload-kv': PayloadKv;
|
|
111
|
+
'payload-folders': FolderInterface;
|
|
111
112
|
'payload-locked-documents': PayloadLockedDocument;
|
|
112
113
|
'payload-preferences': PayloadPreference;
|
|
113
114
|
'payload-migrations': PayloadMigration;
|
|
@@ -156,6 +157,9 @@ interface Config {
|
|
|
156
157
|
posts: {
|
|
157
158
|
comments: 'comments';
|
|
158
159
|
};
|
|
160
|
+
'payload-folders': {
|
|
161
|
+
documentsAndFolders: 'payload-folders' | 'images' | 'system-media';
|
|
162
|
+
};
|
|
159
163
|
};
|
|
160
164
|
collectionsSelect: {
|
|
161
165
|
users: UsersSelect<false> | UsersSelect<true>;
|
|
@@ -257,6 +261,7 @@ interface Config {
|
|
|
257
261
|
forms: FormsSelect<false> | FormsSelect<true>;
|
|
258
262
|
'form-submissions': FormSubmissionsSelect<false> | FormSubmissionsSelect<true>;
|
|
259
263
|
'payload-kv': PayloadKvSelect<false> | PayloadKvSelect<true>;
|
|
264
|
+
'payload-folders': PayloadFoldersSelect<false> | PayloadFoldersSelect<true>;
|
|
260
265
|
'payload-locked-documents': PayloadLockedDocumentsSelect<false> | PayloadLockedDocumentsSelect<true>;
|
|
261
266
|
'payload-preferences': PayloadPreferencesSelect<false> | PayloadPreferencesSelect<true>;
|
|
262
267
|
'payload-migrations': PayloadMigrationsSelect<false> | PayloadMigrationsSelect<true>;
|
|
@@ -529,6 +534,7 @@ interface Image {
|
|
|
529
534
|
uploadStatus?: ('ready' | 'finalizing' | 'failed') | null;
|
|
530
535
|
processingStatus?: ('ready' | 'processing' | 'failed') | null;
|
|
531
536
|
processingError?: string | null;
|
|
537
|
+
folder?: (string | null) | FolderInterface;
|
|
532
538
|
updatedAt: string;
|
|
533
539
|
createdAt: string;
|
|
534
540
|
deletedAt?: string | null;
|
|
@@ -586,19 +592,33 @@ interface Image {
|
|
|
586
592
|
}
|
|
587
593
|
/**
|
|
588
594
|
* This interface was referenced by `Config`'s JSON-Schema
|
|
589
|
-
* via the `definition` "
|
|
595
|
+
* via the `definition` "payload-folders".
|
|
590
596
|
*/
|
|
591
|
-
interface
|
|
597
|
+
interface FolderInterface {
|
|
592
598
|
id: string;
|
|
599
|
+
/**
|
|
600
|
+
* Required only for image folders. Leave empty for system media folders.
|
|
601
|
+
*/
|
|
593
602
|
tenant?: (string | null) | Tenant;
|
|
594
|
-
|
|
595
|
-
|
|
596
|
-
|
|
597
|
-
|
|
598
|
-
|
|
603
|
+
name: string;
|
|
604
|
+
folder?: (string | null) | FolderInterface;
|
|
605
|
+
documentsAndFolders?: {
|
|
606
|
+
docs?: ({
|
|
607
|
+
relationTo?: 'payload-folders';
|
|
608
|
+
value: string | FolderInterface;
|
|
609
|
+
} | {
|
|
610
|
+
relationTo?: 'images';
|
|
611
|
+
value: string | Image;
|
|
612
|
+
} | {
|
|
613
|
+
relationTo?: 'system-media';
|
|
614
|
+
value: string | SystemMedia;
|
|
615
|
+
})[];
|
|
616
|
+
hasNextPage?: boolean;
|
|
617
|
+
totalDocs?: number;
|
|
618
|
+
};
|
|
619
|
+
folderType?: ('images' | 'system-media')[] | null;
|
|
599
620
|
updatedAt: string;
|
|
600
621
|
createdAt: string;
|
|
601
|
-
deletedAt?: string | null;
|
|
602
622
|
}
|
|
603
623
|
/**
|
|
604
624
|
* This interface was referenced by `Config`'s JSON-Schema
|
|
@@ -619,6 +639,7 @@ interface SystemMedia {
|
|
|
619
639
|
*/
|
|
620
640
|
credit?: string | null;
|
|
621
641
|
prefix?: string | null;
|
|
642
|
+
folder?: (string | null) | FolderInterface;
|
|
622
643
|
updatedAt: string;
|
|
623
644
|
createdAt: string;
|
|
624
645
|
deletedAt?: string | null;
|
|
@@ -632,6 +653,22 @@ interface SystemMedia {
|
|
|
632
653
|
focalX?: number | null;
|
|
633
654
|
focalY?: number | null;
|
|
634
655
|
}
|
|
656
|
+
/**
|
|
657
|
+
* This interface was referenced by `Config`'s JSON-Schema
|
|
658
|
+
* via the `definition` "field-configs".
|
|
659
|
+
*/
|
|
660
|
+
interface FieldConfig {
|
|
661
|
+
id: string;
|
|
662
|
+
tenant?: (string | null) | Tenant;
|
|
663
|
+
collectionSlug: 'products' | 'product-variants' | 'product-options' | 'product-option-values' | 'product-collections' | 'product-categories' | 'product-tags' | 'brands' | 'discounts' | 'shipping-policies' | 'orders' | 'carts' | 'transactions' | 'fulfillments' | 'returns' | 'customers' | 'customer-groups' | 'customer-profiles' | 'customer-profile-lists' | 'article-authors' | 'articles' | 'article-categories' | 'article-tags' | 'documents' | 'document-categories' | 'document-types' | 'playlists' | 'playlist-categories' | 'playlist-tags' | 'tracks' | 'track-categories' | 'track-tags' | 'galleries' | 'gallery-categories' | 'gallery-tags' | 'gallery-items' | 'links' | 'link-categories' | 'link-tags' | 'canvases' | 'canvas-categories' | 'canvas-tags' | 'canvas-node-types' | 'canvas-edge-types' | 'videos' | 'video-categories' | 'video-tags' | 'live-streams' | 'forms' | 'posts' | 'comments' | 'reactions' | 'reaction-types' | 'bookmarks' | 'post-categories' | 'event-calendars' | 'events' | 'event-categories' | 'event-tags' | 'event-occurrences' | 'event-registrations';
|
|
664
|
+
isHidden?: boolean | null;
|
|
665
|
+
hiddenFields?: {
|
|
666
|
+
[k: string]: unknown;
|
|
667
|
+
} | unknown[] | string | number | boolean | null;
|
|
668
|
+
updatedAt: string;
|
|
669
|
+
createdAt: string;
|
|
670
|
+
deletedAt?: string | null;
|
|
671
|
+
}
|
|
635
672
|
/**
|
|
636
673
|
* This interface was referenced by `Config`'s JSON-Schema
|
|
637
674
|
* via the `definition` "audiences".
|
|
@@ -5558,6 +5595,9 @@ interface PayloadLockedDocument {
|
|
|
5558
5595
|
} | null) | ({
|
|
5559
5596
|
relationTo: 'form-submissions';
|
|
5560
5597
|
value: string | FormSubmission;
|
|
5598
|
+
} | null) | ({
|
|
5599
|
+
relationTo: 'payload-folders';
|
|
5600
|
+
value: string | FolderInterface;
|
|
5561
5601
|
} | null);
|
|
5562
5602
|
globalSlug?: string | null;
|
|
5563
5603
|
user: {
|
|
@@ -5681,6 +5721,7 @@ interface ImagesSelect<T extends boolean = true> {
|
|
|
5681
5721
|
uploadStatus?: T;
|
|
5682
5722
|
processingStatus?: T;
|
|
5683
5723
|
processingError?: T;
|
|
5724
|
+
folder?: T;
|
|
5684
5725
|
updatedAt?: T;
|
|
5685
5726
|
createdAt?: T;
|
|
5686
5727
|
deletedAt?: T;
|
|
@@ -5745,6 +5786,7 @@ interface SystemMediaSelect<T extends boolean = true> {
|
|
|
5745
5786
|
caption?: T;
|
|
5746
5787
|
credit?: T;
|
|
5747
5788
|
prefix?: T;
|
|
5789
|
+
folder?: T;
|
|
5748
5790
|
updatedAt?: T;
|
|
5749
5791
|
createdAt?: T;
|
|
5750
5792
|
deletedAt?: T;
|
|
@@ -8511,6 +8553,19 @@ interface PayloadKvSelect<T extends boolean = true> {
|
|
|
8511
8553
|
key?: T;
|
|
8512
8554
|
data?: T;
|
|
8513
8555
|
}
|
|
8556
|
+
/**
|
|
8557
|
+
* This interface was referenced by `Config`'s JSON-Schema
|
|
8558
|
+
* via the `definition` "payload-folders_select".
|
|
8559
|
+
*/
|
|
8560
|
+
interface PayloadFoldersSelect<T extends boolean = true> {
|
|
8561
|
+
tenant?: T;
|
|
8562
|
+
name?: T;
|
|
8563
|
+
folder?: T;
|
|
8564
|
+
documentsAndFolders?: T;
|
|
8565
|
+
folderType?: T;
|
|
8566
|
+
updatedAt?: T;
|
|
8567
|
+
createdAt?: T;
|
|
8568
|
+
}
|
|
8514
8569
|
/**
|
|
8515
8570
|
* This interface was referenced by `Config`'s JSON-Schema
|
|
8516
8571
|
* via the `definition` "payload-locked-documents_select".
|
|
@@ -108,6 +108,7 @@ interface Config {
|
|
|
108
108
|
forms: Form;
|
|
109
109
|
'form-submissions': FormSubmission;
|
|
110
110
|
'payload-kv': PayloadKv;
|
|
111
|
+
'payload-folders': FolderInterface;
|
|
111
112
|
'payload-locked-documents': PayloadLockedDocument;
|
|
112
113
|
'payload-preferences': PayloadPreference;
|
|
113
114
|
'payload-migrations': PayloadMigration;
|
|
@@ -156,6 +157,9 @@ interface Config {
|
|
|
156
157
|
posts: {
|
|
157
158
|
comments: 'comments';
|
|
158
159
|
};
|
|
160
|
+
'payload-folders': {
|
|
161
|
+
documentsAndFolders: 'payload-folders' | 'images' | 'system-media';
|
|
162
|
+
};
|
|
159
163
|
};
|
|
160
164
|
collectionsSelect: {
|
|
161
165
|
users: UsersSelect<false> | UsersSelect<true>;
|
|
@@ -257,6 +261,7 @@ interface Config {
|
|
|
257
261
|
forms: FormsSelect<false> | FormsSelect<true>;
|
|
258
262
|
'form-submissions': FormSubmissionsSelect<false> | FormSubmissionsSelect<true>;
|
|
259
263
|
'payload-kv': PayloadKvSelect<false> | PayloadKvSelect<true>;
|
|
264
|
+
'payload-folders': PayloadFoldersSelect<false> | PayloadFoldersSelect<true>;
|
|
260
265
|
'payload-locked-documents': PayloadLockedDocumentsSelect<false> | PayloadLockedDocumentsSelect<true>;
|
|
261
266
|
'payload-preferences': PayloadPreferencesSelect<false> | PayloadPreferencesSelect<true>;
|
|
262
267
|
'payload-migrations': PayloadMigrationsSelect<false> | PayloadMigrationsSelect<true>;
|
|
@@ -529,6 +534,7 @@ interface Image {
|
|
|
529
534
|
uploadStatus?: ('ready' | 'finalizing' | 'failed') | null;
|
|
530
535
|
processingStatus?: ('ready' | 'processing' | 'failed') | null;
|
|
531
536
|
processingError?: string | null;
|
|
537
|
+
folder?: (string | null) | FolderInterface;
|
|
532
538
|
updatedAt: string;
|
|
533
539
|
createdAt: string;
|
|
534
540
|
deletedAt?: string | null;
|
|
@@ -586,19 +592,33 @@ interface Image {
|
|
|
586
592
|
}
|
|
587
593
|
/**
|
|
588
594
|
* This interface was referenced by `Config`'s JSON-Schema
|
|
589
|
-
* via the `definition` "
|
|
595
|
+
* via the `definition` "payload-folders".
|
|
590
596
|
*/
|
|
591
|
-
interface
|
|
597
|
+
interface FolderInterface {
|
|
592
598
|
id: string;
|
|
599
|
+
/**
|
|
600
|
+
* Required only for image folders. Leave empty for system media folders.
|
|
601
|
+
*/
|
|
593
602
|
tenant?: (string | null) | Tenant;
|
|
594
|
-
|
|
595
|
-
|
|
596
|
-
|
|
597
|
-
|
|
598
|
-
|
|
603
|
+
name: string;
|
|
604
|
+
folder?: (string | null) | FolderInterface;
|
|
605
|
+
documentsAndFolders?: {
|
|
606
|
+
docs?: ({
|
|
607
|
+
relationTo?: 'payload-folders';
|
|
608
|
+
value: string | FolderInterface;
|
|
609
|
+
} | {
|
|
610
|
+
relationTo?: 'images';
|
|
611
|
+
value: string | Image;
|
|
612
|
+
} | {
|
|
613
|
+
relationTo?: 'system-media';
|
|
614
|
+
value: string | SystemMedia;
|
|
615
|
+
})[];
|
|
616
|
+
hasNextPage?: boolean;
|
|
617
|
+
totalDocs?: number;
|
|
618
|
+
};
|
|
619
|
+
folderType?: ('images' | 'system-media')[] | null;
|
|
599
620
|
updatedAt: string;
|
|
600
621
|
createdAt: string;
|
|
601
|
-
deletedAt?: string | null;
|
|
602
622
|
}
|
|
603
623
|
/**
|
|
604
624
|
* This interface was referenced by `Config`'s JSON-Schema
|
|
@@ -619,6 +639,7 @@ interface SystemMedia {
|
|
|
619
639
|
*/
|
|
620
640
|
credit?: string | null;
|
|
621
641
|
prefix?: string | null;
|
|
642
|
+
folder?: (string | null) | FolderInterface;
|
|
622
643
|
updatedAt: string;
|
|
623
644
|
createdAt: string;
|
|
624
645
|
deletedAt?: string | null;
|
|
@@ -632,6 +653,22 @@ interface SystemMedia {
|
|
|
632
653
|
focalX?: number | null;
|
|
633
654
|
focalY?: number | null;
|
|
634
655
|
}
|
|
656
|
+
/**
|
|
657
|
+
* This interface was referenced by `Config`'s JSON-Schema
|
|
658
|
+
* via the `definition` "field-configs".
|
|
659
|
+
*/
|
|
660
|
+
interface FieldConfig {
|
|
661
|
+
id: string;
|
|
662
|
+
tenant?: (string | null) | Tenant;
|
|
663
|
+
collectionSlug: 'products' | 'product-variants' | 'product-options' | 'product-option-values' | 'product-collections' | 'product-categories' | 'product-tags' | 'brands' | 'discounts' | 'shipping-policies' | 'orders' | 'carts' | 'transactions' | 'fulfillments' | 'returns' | 'customers' | 'customer-groups' | 'customer-profiles' | 'customer-profile-lists' | 'article-authors' | 'articles' | 'article-categories' | 'article-tags' | 'documents' | 'document-categories' | 'document-types' | 'playlists' | 'playlist-categories' | 'playlist-tags' | 'tracks' | 'track-categories' | 'track-tags' | 'galleries' | 'gallery-categories' | 'gallery-tags' | 'gallery-items' | 'links' | 'link-categories' | 'link-tags' | 'canvases' | 'canvas-categories' | 'canvas-tags' | 'canvas-node-types' | 'canvas-edge-types' | 'videos' | 'video-categories' | 'video-tags' | 'live-streams' | 'forms' | 'posts' | 'comments' | 'reactions' | 'reaction-types' | 'bookmarks' | 'post-categories' | 'event-calendars' | 'events' | 'event-categories' | 'event-tags' | 'event-occurrences' | 'event-registrations';
|
|
664
|
+
isHidden?: boolean | null;
|
|
665
|
+
hiddenFields?: {
|
|
666
|
+
[k: string]: unknown;
|
|
667
|
+
} | unknown[] | string | number | boolean | null;
|
|
668
|
+
updatedAt: string;
|
|
669
|
+
createdAt: string;
|
|
670
|
+
deletedAt?: string | null;
|
|
671
|
+
}
|
|
635
672
|
/**
|
|
636
673
|
* This interface was referenced by `Config`'s JSON-Schema
|
|
637
674
|
* via the `definition` "audiences".
|
|
@@ -5558,6 +5595,9 @@ interface PayloadLockedDocument {
|
|
|
5558
5595
|
} | null) | ({
|
|
5559
5596
|
relationTo: 'form-submissions';
|
|
5560
5597
|
value: string | FormSubmission;
|
|
5598
|
+
} | null) | ({
|
|
5599
|
+
relationTo: 'payload-folders';
|
|
5600
|
+
value: string | FolderInterface;
|
|
5561
5601
|
} | null);
|
|
5562
5602
|
globalSlug?: string | null;
|
|
5563
5603
|
user: {
|
|
@@ -5681,6 +5721,7 @@ interface ImagesSelect<T extends boolean = true> {
|
|
|
5681
5721
|
uploadStatus?: T;
|
|
5682
5722
|
processingStatus?: T;
|
|
5683
5723
|
processingError?: T;
|
|
5724
|
+
folder?: T;
|
|
5684
5725
|
updatedAt?: T;
|
|
5685
5726
|
createdAt?: T;
|
|
5686
5727
|
deletedAt?: T;
|
|
@@ -5745,6 +5786,7 @@ interface SystemMediaSelect<T extends boolean = true> {
|
|
|
5745
5786
|
caption?: T;
|
|
5746
5787
|
credit?: T;
|
|
5747
5788
|
prefix?: T;
|
|
5789
|
+
folder?: T;
|
|
5748
5790
|
updatedAt?: T;
|
|
5749
5791
|
createdAt?: T;
|
|
5750
5792
|
deletedAt?: T;
|
|
@@ -8511,6 +8553,19 @@ interface PayloadKvSelect<T extends boolean = true> {
|
|
|
8511
8553
|
key?: T;
|
|
8512
8554
|
data?: T;
|
|
8513
8555
|
}
|
|
8556
|
+
/**
|
|
8557
|
+
* This interface was referenced by `Config`'s JSON-Schema
|
|
8558
|
+
* via the `definition` "payload-folders_select".
|
|
8559
|
+
*/
|
|
8560
|
+
interface PayloadFoldersSelect<T extends boolean = true> {
|
|
8561
|
+
tenant?: T;
|
|
8562
|
+
name?: T;
|
|
8563
|
+
folder?: T;
|
|
8564
|
+
documentsAndFolders?: T;
|
|
8565
|
+
folderType?: T;
|
|
8566
|
+
updatedAt?: T;
|
|
8567
|
+
createdAt?: T;
|
|
8568
|
+
}
|
|
8514
8569
|
/**
|
|
8515
8570
|
* This interface was referenced by `Config`'s JSON-Schema
|
|
8516
8571
|
* via the `definition` "payload-locked-documents_select".
|
package/dist/realtime.d.cts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { R as RealtimeEvent } from './realtime-D7HtUpqt.cjs';
|
|
2
2
|
export { a as RealtimeConnection, b as RealtimeListener } from './realtime-D7HtUpqt.cjs';
|
|
3
|
-
import { P as PublicCollection } from './const-
|
|
4
|
-
import './payload-types-
|
|
3
|
+
import { P as PublicCollection } from './const-C8UhtzLn.cjs';
|
|
4
|
+
import './payload-types-BaK4zCQ8.cjs';
|
|
5
5
|
|
|
6
6
|
interface UseRealtimeQueryOptions {
|
|
7
7
|
/** Filter events to specific collections. Empty/undefined = all collections. */
|
package/dist/realtime.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { R as RealtimeEvent } from './realtime-D7HtUpqt.js';
|
|
2
2
|
export { a as RealtimeConnection, b as RealtimeListener } from './realtime-D7HtUpqt.js';
|
|
3
|
-
import { P as PublicCollection } from './const-
|
|
4
|
-
import './payload-types-
|
|
3
|
+
import { P as PublicCollection } from './const-Bs-QcTj0.js';
|
|
4
|
+
import './payload-types-BaK4zCQ8.js';
|
|
5
5
|
|
|
6
6
|
interface UseRealtimeQueryOptions {
|
|
7
7
|
/** Filter events to specific collections. Empty/undefined = all collections. */
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import * as _tanstack_react_query from '@tanstack/react-query';
|
|
2
2
|
import { QueryClient, InfiniteData } from '@tanstack/react-query';
|
|
3
|
-
import { O as Order, d as Cart, e as CartItem, f as Product, l as OrderItem, m as Transaction, n as Fulfillment, o as Return } from './payload-types-
|
|
3
|
+
import { O as Order, d as Cart, e as CartItem, f as Product, l as OrderItem, m as Transaction, n as Fulfillment, o as Return } from './payload-types-BaK4zCQ8.cjs';
|
|
4
4
|
import { Sort, Where } from 'payload';
|
|
5
5
|
import { Metadata } from 'next';
|
|
6
|
-
import { C as CollectionType } from './types-
|
|
7
|
-
import { P as PublicCollection, S as ServerCollection } from './const-
|
|
6
|
+
import { C as CollectionType } from './types-BH-YBrFs.cjs';
|
|
7
|
+
import { P as PublicCollection, S as ServerCollection } from './const-C8UhtzLn.cjs';
|
|
8
8
|
|
|
9
9
|
declare function resolveApiUrl(): string;
|
|
10
10
|
interface ClientConfig {
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import * as _tanstack_react_query from '@tanstack/react-query';
|
|
2
2
|
import { QueryClient, InfiniteData } from '@tanstack/react-query';
|
|
3
|
-
import { O as Order, d as Cart, e as CartItem, f as Product, l as OrderItem, m as Transaction, n as Fulfillment, o as Return } from './payload-types-
|
|
3
|
+
import { O as Order, d as Cart, e as CartItem, f as Product, l as OrderItem, m as Transaction, n as Fulfillment, o as Return } from './payload-types-BaK4zCQ8.js';
|
|
4
4
|
import { Sort, Where } from 'payload';
|
|
5
5
|
import { Metadata } from 'next';
|
|
6
|
-
import { C as CollectionType } from './types-
|
|
7
|
-
import { P as PublicCollection, S as ServerCollection } from './const-
|
|
6
|
+
import { C as CollectionType } from './types-DjaaBExv.js';
|
|
7
|
+
import { P as PublicCollection, S as ServerCollection } from './const-Bs-QcTj0.js';
|
|
8
8
|
|
|
9
9
|
declare function resolveApiUrl(): string;
|
|
10
10
|
interface ClientConfig {
|
package/dist/server.d.cts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
export { ab as ClientServerConfig, aL as CollectionClient, n as CommunityClient, aS as ModerationApi, a9 as ServerClient, aM as ServerCollectionClient, aO as ServerCommerceClient, a8 as createServerClient } from './server-
|
|
2
|
-
import './payload-types-
|
|
1
|
+
export { ab as ClientServerConfig, aL as CollectionClient, n as CommunityClient, aS as ModerationApi, a9 as ServerClient, aM as ServerCollectionClient, aO as ServerCommerceClient, a8 as createServerClient } from './server-CkGfBnSx.cjs';
|
|
2
|
+
import './payload-types-BaK4zCQ8.cjs';
|
|
3
3
|
import '@tanstack/react-query';
|
|
4
4
|
import 'payload';
|
|
5
5
|
import 'next';
|
|
6
|
-
import './types-
|
|
7
|
-
import './const-
|
|
6
|
+
import './types-BH-YBrFs.cjs';
|
|
7
|
+
import './const-C8UhtzLn.cjs';
|
package/dist/server.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
export { ab as ClientServerConfig, aL as CollectionClient, n as CommunityClient, aS as ModerationApi, a9 as ServerClient, aM as ServerCollectionClient, aO as ServerCommerceClient, a8 as createServerClient } from './server-
|
|
2
|
-
import './payload-types-
|
|
1
|
+
export { ab as ClientServerConfig, aL as CollectionClient, n as CommunityClient, aS as ModerationApi, a9 as ServerClient, aM as ServerCollectionClient, aO as ServerCommerceClient, a8 as createServerClient } from './server-DQYWLnkt.js';
|
|
2
|
+
import './payload-types-BaK4zCQ8.js';
|
|
3
3
|
import '@tanstack/react-query';
|
|
4
4
|
import 'payload';
|
|
5
5
|
import 'next';
|
|
6
|
-
import './types-
|
|
7
|
-
import './const-
|
|
6
|
+
import './types-DjaaBExv.js';
|
|
7
|
+
import './const-Bs-QcTj0.js';
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { C as CustomerProfile, a as CustomerProfileList, P as Post, b as Comment, R as Reaction, c as Config } from './payload-types-
|
|
1
|
+
import { C as CustomerProfile, a as CustomerProfileList, P as Post, b as Comment, R as Reaction, c as Config } from './payload-types-BaK4zCQ8.cjs';
|
|
2
2
|
|
|
3
3
|
type PublicCustomerProfile = Omit<CustomerProfile, 'tenant' | 'customer' | 'isPublic' | 'anonymizedAt' | 'metadata'>;
|
|
4
4
|
type PublicProfileRelation = string | PublicCustomerProfile;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { C as CustomerProfile, a as CustomerProfileList, P as Post, b as Comment, R as Reaction, c as Config } from './payload-types-
|
|
1
|
+
import { C as CustomerProfile, a as CustomerProfileList, P as Post, b as Comment, R as Reaction, c as Config } from './payload-types-BaK4zCQ8.js';
|
|
2
2
|
|
|
3
3
|
type PublicCustomerProfile = Omit<CustomerProfile, 'tenant' | 'customer' | 'isPublic' | 'anonymizedAt' | 'metadata'>;
|
|
4
4
|
type PublicProfileRelation = string | PublicCustomerProfile;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/ui/CodeBlock/index.tsx","../../src/ui/CodeBlock/highlight.ts"],"sourcesContent":["'use client'\n\nimport React, { useEffect, useRef, useState, type JSX } from 'react'\nimport { highlight, type BundledTheme } from './highlight'\n\nexport type { BundledTheme }\nexport { highlight }\n\nexport interface CodeBlockProps {\n /** Code string to highlight */\n code: string\n /** Language identifier (e.g. 'typescript', 'js', 'python') */\n language?: string\n /** Shiki theme name. Default: 'github-dark' */\n theme?: BundledTheme\n /** CSS class for the wrapper */\n className?: string\n /** Pre-rendered JSX from server component via `highlight()` */\n initial?: JSX.Element\n /** Show line numbers. Default: false */\n showLineNumbers?: boolean\n /** Show copy button. Default: true */\n showCopyButton?: boolean\n}\n\n/**\n * Syntax-highlighted code block using shiki.\n *\n * @example Basic usage\n * ```tsx\n * <CodeBlock code=\"const x = 1\" language=\"typescript\" />\n * ```\n *\n * @example With server pre-rendering (Next.js)\n * ```tsx\n * // Server Component\n * const initial = await highlight(code, 'typescript')\n * return <CodeBlock code={code} language=\"typescript\" initial={initial} />\n * ```\n *\n * @example As RichTextContent block renderer\n * ```tsx\n * <RichTextContent\n * data={data}\n * blocks={{\n * Code: ({ node }) => (\n * <CodeBlock code={node.fields.code} language={node.fields.language} />\n * ),\n * }}\n * />\n * ```\n */\nexport function CodeBlock({\n code,\n language = 'typescript',\n theme = 'github-dark',\n className,\n initial,\n showLineNumbers = false,\n showCopyButton = true,\n}: CodeBlockProps) {\n const [nodes, setNodes] = useState<JSX.Element | undefined>(initial)\n const [copied, setCopied] = useState(false)\n const initialCodeRef = useRef(code)\n const initialNodesRef = useRef(initial)\n\n useEffect(() => {\n // Skip re-highlighting if server pre-rendered and code hasn't changed\n if (initial && code === initialCodeRef.current && initialNodesRef.current === initial) {\n initialNodesRef.current = undefined\n return\n }\n\n let cancelled = false\n void highlight(code, language, theme).then((el) => {\n if (!cancelled) setNodes(el)\n })\n return () => {\n cancelled = true\n }\n }, [code, language, theme, initial])\n\n const handleCopy = () => {\n void navigator.clipboard.writeText(code).then(\n () => {\n setCopied(true)\n setTimeout(() => setCopied(false), 2000)\n },\n () => {},\n )\n }\n\n return (\n <div className={className} style={{ position: 'relative' }}>\n {showCopyButton && (\n <button\n type=\"button\"\n onClick={handleCopy}\n aria-label=\"Copy code\"\n style={{\n position: 'absolute',\n top: 8,\n right: 8,\n zIndex: 1,\n padding: '4px 8px',\n fontSize: 12,\n lineHeight: 1,\n border: '1px solid rgba(255,255,255,0.2)',\n borderRadius: 4,\n background: 'rgba(0,0,0,0.3)',\n color: '#ccc',\n cursor: 'pointer',\n opacity: 0.7,\n transition: 'opacity 0.15s',\n }}\n onMouseEnter={(e) => {\n e.currentTarget.style.opacity = '1'\n }}\n onMouseLeave={(e) => {\n e.currentTarget.style.opacity = '0.7'\n }}\n >\n {copied ? 'Copied!' : 'Copy'}\n </button>\n )}\n {showLineNumbers && nodes ? (\n <div style={{ display: 'flex' }}>\n <div\n aria-hidden\n style={{\n padding: '1em 0.5em 1em 1em',\n textAlign: 'right',\n userSelect: 'none',\n color: 'rgba(255,255,255,0.3)',\n fontFamily: 'monospace',\n fontSize: 13,\n lineHeight: 1.5,\n }}\n >\n {code.split('\\n').map((_, i) => (\n <div key={i}>{i + 1}</div>\n ))}\n </div>\n <div style={{ flex: 1, overflow: 'auto' }}>{nodes}</div>\n </div>\n ) : (\n (nodes ?? (\n <pre\n style={{\n margin: 0,\n padding: '1em',\n overflow: 'auto',\n fontFamily: 'monospace',\n fontSize: 13,\n lineHeight: 1.5,\n }}\n >\n <code>{code}</code>\n </pre>\n ))\n )}\n </div>\n )\n}\n","import type { JSX } from 'react'\nimport { Fragment } from 'react'\nimport { jsx, jsxs } from 'react/jsx-runtime'\nimport { toJsxRuntime } from 'hast-util-to-jsx-runtime'\nimport { codeToHast, type
|
|
1
|
+
{"version":3,"sources":["../../src/ui/CodeBlock/index.tsx","../../src/ui/CodeBlock/highlight.ts"],"sourcesContent":["'use client'\n\nimport React, { useEffect, useRef, useState, type JSX } from 'react'\nimport { highlight, type BundledTheme } from './highlight'\n\nexport type { BundledTheme }\nexport { highlight }\n\nexport interface CodeBlockProps {\n /** Code string to highlight */\n code: string\n /** Language identifier (e.g. 'typescript', 'js', 'python') */\n language?: string\n /** Shiki theme name. Default: 'github-dark' */\n theme?: BundledTheme\n /** CSS class for the wrapper */\n className?: string\n /** Pre-rendered JSX from server component via `highlight()` */\n initial?: JSX.Element\n /** Show line numbers. Default: false */\n showLineNumbers?: boolean\n /** Show copy button. Default: true */\n showCopyButton?: boolean\n}\n\n/**\n * Syntax-highlighted code block using shiki.\n *\n * @example Basic usage\n * ```tsx\n * <CodeBlock code=\"const x = 1\" language=\"typescript\" />\n * ```\n *\n * @example With server pre-rendering (Next.js)\n * ```tsx\n * // Server Component\n * const initial = await highlight(code, 'typescript')\n * return <CodeBlock code={code} language=\"typescript\" initial={initial} />\n * ```\n *\n * @example As RichTextContent block renderer\n * ```tsx\n * <RichTextContent\n * data={data}\n * blocks={{\n * Code: ({ node }) => (\n * <CodeBlock code={node.fields.code} language={node.fields.language} />\n * ),\n * }}\n * />\n * ```\n */\nexport function CodeBlock({\n code,\n language = 'typescript',\n theme = 'github-dark',\n className,\n initial,\n showLineNumbers = false,\n showCopyButton = true,\n}: CodeBlockProps) {\n const [nodes, setNodes] = useState<JSX.Element | undefined>(initial)\n const [copied, setCopied] = useState(false)\n const initialCodeRef = useRef(code)\n const initialNodesRef = useRef(initial)\n\n useEffect(() => {\n // Skip re-highlighting if server pre-rendered and code hasn't changed\n if (initial && code === initialCodeRef.current && initialNodesRef.current === initial) {\n initialNodesRef.current = undefined\n return\n }\n\n let cancelled = false\n void highlight(code, language, theme).then((el) => {\n if (!cancelled) setNodes(el)\n })\n return () => {\n cancelled = true\n }\n }, [code, language, theme, initial])\n\n const handleCopy = () => {\n void navigator.clipboard.writeText(code).then(\n () => {\n setCopied(true)\n setTimeout(() => setCopied(false), 2000)\n },\n () => {},\n )\n }\n\n return (\n <div className={className} style={{ position: 'relative' }}>\n {showCopyButton && (\n <button\n type=\"button\"\n onClick={handleCopy}\n aria-label=\"Copy code\"\n style={{\n position: 'absolute',\n top: 8,\n right: 8,\n zIndex: 1,\n padding: '4px 8px',\n fontSize: 12,\n lineHeight: 1,\n border: '1px solid rgba(255,255,255,0.2)',\n borderRadius: 4,\n background: 'rgba(0,0,0,0.3)',\n color: '#ccc',\n cursor: 'pointer',\n opacity: 0.7,\n transition: 'opacity 0.15s',\n }}\n onMouseEnter={(e) => {\n e.currentTarget.style.opacity = '1'\n }}\n onMouseLeave={(e) => {\n e.currentTarget.style.opacity = '0.7'\n }}\n >\n {copied ? 'Copied!' : 'Copy'}\n </button>\n )}\n {showLineNumbers && nodes ? (\n <div style={{ display: 'flex' }}>\n <div\n aria-hidden\n style={{\n padding: '1em 0.5em 1em 1em',\n textAlign: 'right',\n userSelect: 'none',\n color: 'rgba(255,255,255,0.3)',\n fontFamily: 'monospace',\n fontSize: 13,\n lineHeight: 1.5,\n }}\n >\n {code.split('\\n').map((_, i) => (\n <div key={i}>{i + 1}</div>\n ))}\n </div>\n <div style={{ flex: 1, overflow: 'auto' }}>{nodes}</div>\n </div>\n ) : (\n (nodes ?? (\n <pre\n style={{\n margin: 0,\n padding: '1em',\n overflow: 'auto',\n fontFamily: 'monospace',\n fontSize: 13,\n lineHeight: 1.5,\n }}\n >\n <code>{code}</code>\n </pre>\n ))\n )}\n </div>\n )\n}\n","import type { JSX } from 'react'\nimport { Fragment } from 'react'\nimport { jsx, jsxs } from 'react/jsx-runtime'\nimport { toJsxRuntime } from 'hast-util-to-jsx-runtime'\nimport { codeToHast, type BundledTheme } from 'shiki'\n\nexport type { BundledLanguage, BundledTheme } from 'shiki'\n\ntype CodeToHastOptions = Parameters<typeof codeToHast>[1]\ntype HighlightLanguage = CodeToHastOptions['lang']\n\n/** Normalize language aliases to shiki-compatible language IDs */\nconst LANGUAGE_ALIASES: Record<string, string> = {\n js: 'javascript',\n ts: 'typescript',\n sh: 'bash',\n shell: 'bash',\n yml: 'yaml',\n py: 'python',\n rb: 'ruby',\n plaintext: 'text',\n}\n\nfunction normalizeLanguage(lang: string): string {\n return LANGUAGE_ALIASES[lang] || lang\n}\n\n/**\n * Highlight code to JSX using shiki.\n * Works in both Server and Client components.\n *\n * @example Server Component\n * ```tsx\n * const highlighted = await highlight('const x = 1', 'typescript')\n * return <div>{highlighted}</div>\n * ```\n */\nexport async function highlight(\n code: string,\n lang: string,\n theme: BundledTheme = 'github-dark',\n): Promise<JSX.Element> {\n const normalized = normalizeLanguage(lang)\n try {\n const hast = await codeToHast(code, {\n lang: normalized as HighlightLanguage,\n theme,\n })\n return toJsxRuntime(hast, { Fragment, jsx, jsxs }) as JSX.Element\n } catch {\n // Fallback to plain text if language is not supported\n const hast = await codeToHast(code, { lang: 'text', theme })\n return toJsxRuntime(hast, { Fragment, jsx, jsxs }) as JSX.Element\n }\n}\n"],"mappings":"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","names":["import_react","React"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/ui/CodeBlock/index.tsx","../../src/ui/CodeBlock/highlight.ts"],"sourcesContent":["'use client'\n\nimport React, { useEffect, useRef, useState, type JSX } from 'react'\nimport { highlight, type BundledTheme } from './highlight'\n\nexport type { BundledTheme }\nexport { highlight }\n\nexport interface CodeBlockProps {\n /** Code string to highlight */\n code: string\n /** Language identifier (e.g. 'typescript', 'js', 'python') */\n language?: string\n /** Shiki theme name. Default: 'github-dark' */\n theme?: BundledTheme\n /** CSS class for the wrapper */\n className?: string\n /** Pre-rendered JSX from server component via `highlight()` */\n initial?: JSX.Element\n /** Show line numbers. Default: false */\n showLineNumbers?: boolean\n /** Show copy button. Default: true */\n showCopyButton?: boolean\n}\n\n/**\n * Syntax-highlighted code block using shiki.\n *\n * @example Basic usage\n * ```tsx\n * <CodeBlock code=\"const x = 1\" language=\"typescript\" />\n * ```\n *\n * @example With server pre-rendering (Next.js)\n * ```tsx\n * // Server Component\n * const initial = await highlight(code, 'typescript')\n * return <CodeBlock code={code} language=\"typescript\" initial={initial} />\n * ```\n *\n * @example As RichTextContent block renderer\n * ```tsx\n * <RichTextContent\n * data={data}\n * blocks={{\n * Code: ({ node }) => (\n * <CodeBlock code={node.fields.code} language={node.fields.language} />\n * ),\n * }}\n * />\n * ```\n */\nexport function CodeBlock({\n code,\n language = 'typescript',\n theme = 'github-dark',\n className,\n initial,\n showLineNumbers = false,\n showCopyButton = true,\n}: CodeBlockProps) {\n const [nodes, setNodes] = useState<JSX.Element | undefined>(initial)\n const [copied, setCopied] = useState(false)\n const initialCodeRef = useRef(code)\n const initialNodesRef = useRef(initial)\n\n useEffect(() => {\n // Skip re-highlighting if server pre-rendered and code hasn't changed\n if (initial && code === initialCodeRef.current && initialNodesRef.current === initial) {\n initialNodesRef.current = undefined\n return\n }\n\n let cancelled = false\n void highlight(code, language, theme).then((el) => {\n if (!cancelled) setNodes(el)\n })\n return () => {\n cancelled = true\n }\n }, [code, language, theme, initial])\n\n const handleCopy = () => {\n void navigator.clipboard.writeText(code).then(\n () => {\n setCopied(true)\n setTimeout(() => setCopied(false), 2000)\n },\n () => {},\n )\n }\n\n return (\n <div className={className} style={{ position: 'relative' }}>\n {showCopyButton && (\n <button\n type=\"button\"\n onClick={handleCopy}\n aria-label=\"Copy code\"\n style={{\n position: 'absolute',\n top: 8,\n right: 8,\n zIndex: 1,\n padding: '4px 8px',\n fontSize: 12,\n lineHeight: 1,\n border: '1px solid rgba(255,255,255,0.2)',\n borderRadius: 4,\n background: 'rgba(0,0,0,0.3)',\n color: '#ccc',\n cursor: 'pointer',\n opacity: 0.7,\n transition: 'opacity 0.15s',\n }}\n onMouseEnter={(e) => {\n e.currentTarget.style.opacity = '1'\n }}\n onMouseLeave={(e) => {\n e.currentTarget.style.opacity = '0.7'\n }}\n >\n {copied ? 'Copied!' : 'Copy'}\n </button>\n )}\n {showLineNumbers && nodes ? (\n <div style={{ display: 'flex' }}>\n <div\n aria-hidden\n style={{\n padding: '1em 0.5em 1em 1em',\n textAlign: 'right',\n userSelect: 'none',\n color: 'rgba(255,255,255,0.3)',\n fontFamily: 'monospace',\n fontSize: 13,\n lineHeight: 1.5,\n }}\n >\n {code.split('\\n').map((_, i) => (\n <div key={i}>{i + 1}</div>\n ))}\n </div>\n <div style={{ flex: 1, overflow: 'auto' }}>{nodes}</div>\n </div>\n ) : (\n (nodes ?? (\n <pre\n style={{\n margin: 0,\n padding: '1em',\n overflow: 'auto',\n fontFamily: 'monospace',\n fontSize: 13,\n lineHeight: 1.5,\n }}\n >\n <code>{code}</code>\n </pre>\n ))\n )}\n </div>\n )\n}\n","import type { JSX } from 'react'\nimport { Fragment } from 'react'\nimport { jsx, jsxs } from 'react/jsx-runtime'\nimport { toJsxRuntime } from 'hast-util-to-jsx-runtime'\nimport { codeToHast, type
|
|
1
|
+
{"version":3,"sources":["../../src/ui/CodeBlock/index.tsx","../../src/ui/CodeBlock/highlight.ts"],"sourcesContent":["'use client'\n\nimport React, { useEffect, useRef, useState, type JSX } from 'react'\nimport { highlight, type BundledTheme } from './highlight'\n\nexport type { BundledTheme }\nexport { highlight }\n\nexport interface CodeBlockProps {\n /** Code string to highlight */\n code: string\n /** Language identifier (e.g. 'typescript', 'js', 'python') */\n language?: string\n /** Shiki theme name. Default: 'github-dark' */\n theme?: BundledTheme\n /** CSS class for the wrapper */\n className?: string\n /** Pre-rendered JSX from server component via `highlight()` */\n initial?: JSX.Element\n /** Show line numbers. Default: false */\n showLineNumbers?: boolean\n /** Show copy button. Default: true */\n showCopyButton?: boolean\n}\n\n/**\n * Syntax-highlighted code block using shiki.\n *\n * @example Basic usage\n * ```tsx\n * <CodeBlock code=\"const x = 1\" language=\"typescript\" />\n * ```\n *\n * @example With server pre-rendering (Next.js)\n * ```tsx\n * // Server Component\n * const initial = await highlight(code, 'typescript')\n * return <CodeBlock code={code} language=\"typescript\" initial={initial} />\n * ```\n *\n * @example As RichTextContent block renderer\n * ```tsx\n * <RichTextContent\n * data={data}\n * blocks={{\n * Code: ({ node }) => (\n * <CodeBlock code={node.fields.code} language={node.fields.language} />\n * ),\n * }}\n * />\n * ```\n */\nexport function CodeBlock({\n code,\n language = 'typescript',\n theme = 'github-dark',\n className,\n initial,\n showLineNumbers = false,\n showCopyButton = true,\n}: CodeBlockProps) {\n const [nodes, setNodes] = useState<JSX.Element | undefined>(initial)\n const [copied, setCopied] = useState(false)\n const initialCodeRef = useRef(code)\n const initialNodesRef = useRef(initial)\n\n useEffect(() => {\n // Skip re-highlighting if server pre-rendered and code hasn't changed\n if (initial && code === initialCodeRef.current && initialNodesRef.current === initial) {\n initialNodesRef.current = undefined\n return\n }\n\n let cancelled = false\n void highlight(code, language, theme).then((el) => {\n if (!cancelled) setNodes(el)\n })\n return () => {\n cancelled = true\n }\n }, [code, language, theme, initial])\n\n const handleCopy = () => {\n void navigator.clipboard.writeText(code).then(\n () => {\n setCopied(true)\n setTimeout(() => setCopied(false), 2000)\n },\n () => {},\n )\n }\n\n return (\n <div className={className} style={{ position: 'relative' }}>\n {showCopyButton && (\n <button\n type=\"button\"\n onClick={handleCopy}\n aria-label=\"Copy code\"\n style={{\n position: 'absolute',\n top: 8,\n right: 8,\n zIndex: 1,\n padding: '4px 8px',\n fontSize: 12,\n lineHeight: 1,\n border: '1px solid rgba(255,255,255,0.2)',\n borderRadius: 4,\n background: 'rgba(0,0,0,0.3)',\n color: '#ccc',\n cursor: 'pointer',\n opacity: 0.7,\n transition: 'opacity 0.15s',\n }}\n onMouseEnter={(e) => {\n e.currentTarget.style.opacity = '1'\n }}\n onMouseLeave={(e) => {\n e.currentTarget.style.opacity = '0.7'\n }}\n >\n {copied ? 'Copied!' : 'Copy'}\n </button>\n )}\n {showLineNumbers && nodes ? (\n <div style={{ display: 'flex' }}>\n <div\n aria-hidden\n style={{\n padding: '1em 0.5em 1em 1em',\n textAlign: 'right',\n userSelect: 'none',\n color: 'rgba(255,255,255,0.3)',\n fontFamily: 'monospace',\n fontSize: 13,\n lineHeight: 1.5,\n }}\n >\n {code.split('\\n').map((_, i) => (\n <div key={i}>{i + 1}</div>\n ))}\n </div>\n <div style={{ flex: 1, overflow: 'auto' }}>{nodes}</div>\n </div>\n ) : (\n (nodes ?? (\n <pre\n style={{\n margin: 0,\n padding: '1em',\n overflow: 'auto',\n fontFamily: 'monospace',\n fontSize: 13,\n lineHeight: 1.5,\n }}\n >\n <code>{code}</code>\n </pre>\n ))\n )}\n </div>\n )\n}\n","import type { JSX } from 'react'\nimport { Fragment } from 'react'\nimport { jsx, jsxs } from 'react/jsx-runtime'\nimport { toJsxRuntime } from 'hast-util-to-jsx-runtime'\nimport { codeToHast, type BundledTheme } from 'shiki'\n\nexport type { BundledLanguage, BundledTheme } from 'shiki'\n\ntype CodeToHastOptions = Parameters<typeof codeToHast>[1]\ntype HighlightLanguage = CodeToHastOptions['lang']\n\n/** Normalize language aliases to shiki-compatible language IDs */\nconst LANGUAGE_ALIASES: Record<string, string> = {\n js: 'javascript',\n ts: 'typescript',\n sh: 'bash',\n shell: 'bash',\n yml: 'yaml',\n py: 'python',\n rb: 'ruby',\n plaintext: 'text',\n}\n\nfunction normalizeLanguage(lang: string): string {\n return LANGUAGE_ALIASES[lang] || lang\n}\n\n/**\n * Highlight code to JSX using shiki.\n * Works in both Server and Client components.\n *\n * @example Server Component\n * ```tsx\n * const highlighted = await highlight('const x = 1', 'typescript')\n * return <div>{highlighted}</div>\n * ```\n */\nexport async function highlight(\n code: string,\n lang: string,\n theme: BundledTheme = 'github-dark',\n): Promise<JSX.Element> {\n const normalized = normalizeLanguage(lang)\n try {\n const hast = await codeToHast(code, {\n lang: normalized as HighlightLanguage,\n theme,\n })\n return toJsxRuntime(hast, { Fragment, jsx, jsxs }) as JSX.Element\n } catch {\n // Fallback to plain text if language is not supported\n const hast = await codeToHast(code, { lang: 'text', theme })\n return toJsxRuntime(hast, { Fragment, jsx, jsxs }) as JSX.Element\n }\n}\n"],"mappings":"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","names":[]}
|
package/dist/ui/form.d.cts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import { F as Form } from '../payload-types-
|
|
2
|
+
import { F as Form } from '../payload-types-BaK4zCQ8.cjs';
|
|
3
3
|
import { RichTextData } from './rich-text.cjs';
|
|
4
4
|
import '@payloadcms/richtext-lexical';
|
|
5
5
|
import '@payloadcms/richtext-lexical/lexical';
|
package/dist/ui/form.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import { F as Form } from '../payload-types-
|
|
2
|
+
import { F as Form } from '../payload-types-BaK4zCQ8.js';
|
|
3
3
|
import { RichTextData } from './rich-text.js';
|
|
4
4
|
import '@payloadcms/richtext-lexical';
|
|
5
5
|
import '@payloadcms/richtext-lexical/lexical';
|