@tetherto/dev-websites-core 0.3.5 → 0.3.7

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 (65) hide show
  1. package/dist/cache/handler.d.mts.map +1 -1
  2. package/dist/cms/index.d.mts +2 -2
  3. package/dist/cms/index.mjs +2 -2
  4. package/dist/cms.mjs +545 -10
  5. package/dist/cms.mjs.map +1 -1
  6. package/dist/i18n/index.mjs +1 -2
  7. package/dist/index.d.mts +118 -3
  8. package/dist/index.d.mts.map +1 -1
  9. package/dist/index.mjs +2 -2
  10. package/dist/index5.d.mts +2 -2
  11. package/dist/ui/carousel/index.mjs +1 -2
  12. package/dist/ui/components/Accordion/index.mjs +1 -2
  13. package/dist/ui/components/Avatar/index.mjs +1 -2
  14. package/dist/ui/components/Badge/index.mjs +1 -2
  15. package/dist/ui/components/BadgeVersion/index.mjs +1 -2
  16. package/dist/ui/components/Button/index.mjs +1 -2
  17. package/dist/ui/components/Card/index.mjs +1 -2
  18. package/dist/ui/components/Carousel/index.mjs +1 -2
  19. package/dist/ui/components/Checkbox/index.mjs +1 -2
  20. package/dist/ui/components/CodeBlock/index.mjs +1 -2
  21. package/dist/ui/components/CodeBlockTabs/index.mjs +1 -2
  22. package/dist/ui/components/CollapsibleSection/index.mjs +1 -2
  23. package/dist/ui/components/CopyButton/index.mjs +1 -2
  24. package/dist/ui/components/CustomHtml/CustomHtml.d.mts +8 -0
  25. package/dist/ui/components/CustomHtml/CustomHtml.d.mts.map +1 -0
  26. package/dist/ui/components/CustomHtml/CustomHtml.mjs +31 -0
  27. package/dist/ui/components/CustomHtml/CustomHtml.mjs.map +1 -0
  28. package/dist/ui/components/CustomHtml/converters.d.mts +14 -0
  29. package/dist/ui/components/CustomHtml/converters.d.mts.map +1 -0
  30. package/dist/ui/components/CustomHtml/converters.mjs +9 -0
  31. package/dist/ui/components/CustomHtml/converters.mjs.map +1 -0
  32. package/dist/ui/components/CustomHtml/index.d.mts +3 -0
  33. package/dist/ui/components/CustomHtml/index.mjs +3 -0
  34. package/dist/ui/components/Dialog/index.mjs +1 -2
  35. package/dist/ui/components/EmptyState/index.mjs +1 -2
  36. package/dist/ui/components/FieldError/index.mjs +1 -2
  37. package/dist/ui/components/FormattedDate/index.mjs +1 -2
  38. package/dist/ui/components/GoogleOAuthButton/index.mjs +1 -2
  39. package/dist/ui/components/IconButton/index.mjs +1 -2
  40. package/dist/ui/components/Input/index.mjs +1 -2
  41. package/dist/ui/components/Label/index.mjs +1 -2
  42. package/dist/ui/components/LazyVideo/index.mjs +1 -2
  43. package/dist/ui/components/Pagination/index.mjs +1 -2
  44. package/dist/ui/components/PaginationItem/index.mjs +1 -2
  45. package/dist/ui/components/PasswordInput/index.mjs +1 -2
  46. package/dist/ui/components/ProgressStepper/index.mjs +1 -2
  47. package/dist/ui/components/Prose/index.mjs +1 -2
  48. package/dist/ui/components/Radio/index.mjs +1 -2
  49. package/dist/ui/components/Reveal/index.mjs +1 -2
  50. package/dist/ui/components/SearchInput/index.mjs +1 -2
  51. package/dist/ui/components/Select/index.mjs +1 -2
  52. package/dist/ui/components/Sheet/index.mjs +1 -2
  53. package/dist/ui/components/StaggerReveal/index.mjs +1 -2
  54. package/dist/ui/components/Stepper/index.mjs +1 -2
  55. package/dist/ui/components/Switch/index.mjs +1 -2
  56. package/dist/ui/components/TextButton/index.mjs +1 -2
  57. package/dist/ui/components/Textarea/index.mjs +1 -2
  58. package/dist/ui/components/Toast/index.mjs +1 -2
  59. package/dist/ui/components/Tooltip/index.mjs +1 -2
  60. package/dist/ui/components/VisuallyHidden/index.mjs +1 -2
  61. package/dist/ui/hooks/index.mjs +1 -2
  62. package/dist/ui/index.d.mts +4 -1
  63. package/dist/ui/index.mjs +1 -0
  64. package/dist/ui/utils/index.mjs +1 -2
  65. package/package.json +18 -10
package/dist/index.d.mts CHANGED
@@ -1,5 +1,111 @@
1
1
  import { Access, Block, CollectionAfterReadHook, CollectionBeforeChangeHook, CollectionConfig, Config, Field, FieldAccess, FieldHook, GlobalConfig, GroupField, PayloadRequest, Plugin, SanitizedConfig } from "payload";
2
2
  import { lexicalEditor } from "@payloadcms/richtext-lexical";
3
+ //#region src/cms/shared/roles.d.ts
4
+ declare const ADMIN_ROLE = "admin";
5
+ type RoleOption = {
6
+ label: string;
7
+ value: string;
8
+ };
9
+ type RoleRule = {
10
+ /** Roles that may create, update, and see this in the admin. Admin is always included. */
11
+ roles: readonly string[];
12
+ /** Other callers only receive published documents. */
13
+ drafts?: boolean;
14
+ };
15
+ type RolesOptions = {
16
+ /**
17
+ * Replaces Moderator and Developer. Admin is always kept.
18
+ * Omit to keep the defaults.
19
+ */
20
+ roles?: readonly RoleOption[];
21
+ /** Appended after `roles` or the defaults. A repeated value replaces the label. */
22
+ extraRoles?: readonly RoleOption[];
23
+ /**
24
+ * Replaces the default rule for that collection. Unknown slugs are for site collections;
25
+ * read them back with `collectionRoleRule`.
26
+ * `false` hides it from everyone except Admin and blocks create, update, and delete.
27
+ */
28
+ collections?: Partial<Record<string, RoleRule | false>>;
29
+ /**
30
+ * Replaces the default rule for a stock global, or sets one for a site global.
31
+ * `false` hides it from everyone except Admin and blocks updates.
32
+ */
33
+ globals?: Partial<Record<string, RoleRule | false>>;
34
+ };
35
+ declare const DEFAULT_ROLES: readonly [{
36
+ readonly label: "Admin";
37
+ readonly value: "admin";
38
+ }, {
39
+ readonly label: "Moderator";
40
+ readonly value: "moderator";
41
+ }, {
42
+ readonly label: "Developer";
43
+ readonly value: "developer";
44
+ }];
45
+ declare const DEFAULT_COLLECTION_ROLES: {
46
+ readonly 'api-tokens': false;
47
+ readonly media: {
48
+ readonly roles: readonly ["moderator", "developer"];
49
+ };
50
+ readonly authors: {
51
+ readonly roles: readonly ["moderator"];
52
+ };
53
+ readonly categories: {
54
+ readonly roles: readonly ["moderator"];
55
+ };
56
+ readonly 'blog-posts': {
57
+ readonly roles: readonly ["moderator"];
58
+ readonly drafts: true;
59
+ };
60
+ readonly pages: {
61
+ readonly roles: readonly ["moderator"];
62
+ readonly drafts: true;
63
+ };
64
+ readonly 'legal-pages': {
65
+ readonly roles: readonly ["moderator"];
66
+ readonly drafts: true;
67
+ };
68
+ readonly 'changelog-tags': {
69
+ readonly roles: readonly ["developer"];
70
+ };
71
+ readonly changelog: {
72
+ readonly roles: readonly ["developer"];
73
+ readonly drafts: true;
74
+ };
75
+ readonly 'event-tags': {
76
+ readonly roles: readonly ["moderator"];
77
+ };
78
+ readonly events: {
79
+ readonly roles: readonly ["moderator"];
80
+ readonly drafts: true;
81
+ };
82
+ };
83
+ declare const DEFAULT_GLOBAL_ROLES: {
84
+ readonly 'site-settings': false;
85
+ readonly 'announcement-banner': {
86
+ readonly roles: readonly ["moderator"];
87
+ };
88
+ };
89
+ /**
90
+ * Users created before the roles field existed have none stored.
91
+ * Treat that as admin so turning roles on does not lock the panel.
92
+ */
93
+ declare function effectiveRoles(user: unknown): string[];
94
+ declare function userHasAnyRole(user: unknown, roles: readonly string[]): boolean;
95
+ declare function isCmsAdmin(user: unknown): boolean;
96
+ declare const adminRoleAccess: Access;
97
+ declare function hiddenUnless(roles: readonly string[]): ({ user }: {
98
+ user: unknown;
99
+ }) => boolean;
100
+ declare function writeAccess(roles: readonly string[]): Access;
101
+ declare function publishedOrRoleRead(roles: readonly string[]): Access;
102
+ declare function resolveRoleOptions(options?: RolesOptions): RoleOption[];
103
+ declare function collectionRoleRule(options: true | RolesOptions | undefined, slug: string, fallback?: RoleRule | false): RoleRule | false | undefined;
104
+ declare function globalRoleRule(options: true | RolesOptions | undefined, slug: string, fallback?: RoleRule | false): RoleRule | false | undefined;
105
+ type RoleTarget = CollectionConfig | GlobalConfig;
106
+ /** Limits create, update, and delete from the Roles collection. Admin is always allowed. */
107
+ declare function withRoles<T extends RoleTarget>(config: T): T;
108
+ //#endregion
3
109
  //#region src/cms/shared/access.d.ts
4
110
  type AccessOptions = {
5
111
  /**
@@ -7,6 +113,12 @@ type AccessOptions = {
7
113
  * Defaults to on when the stock `api-tokens` collection is enabled.
8
114
  */
9
115
  apiTokens?: boolean;
116
+ /**
117
+ * Turn on Admin / Moderator / Developer. `true` uses the defaults.
118
+ * `collections` / `globals` are the permissions seeded into Roles on first boot.
119
+ * After that, edit them in the admin. Omit to keep every CMS user as a full admin.
120
+ */
121
+ roles?: true | RolesOptions;
10
122
  };
11
123
  type AccessHelpers = {
12
124
  adminOnly: ({ req }: {
@@ -107,6 +219,9 @@ declare const imageBlock: Block;
107
219
  //#region src/cms/blocks/video.d.ts
108
220
  declare const videoBlock: Block;
109
221
  //#endregion
222
+ //#region src/cms/blocks/custom-html.d.ts
223
+ declare const customHtmlBlock: Block;
224
+ //#endregion
110
225
  //#region src/cms/blocks/download-cta.d.ts
111
226
  declare const downloadCtaBlock: Block;
112
227
  //#endregion
@@ -140,8 +255,8 @@ declare const showcaseContentBlocks: Block[];
140
255
  /**
141
256
  * Shared Lexical editor for every `richText` field.
142
257
  *
143
- * Adds `CodeBlock`, inline `video` block, media upload captions, and
144
- * `EXPERIMENTAL_TableFeature` on top of Payload defaults.
258
+ * Adds `CodeBlock`, inline `video` and `custom-html` blocks, media upload
259
+ * captions, and `EXPERIMENTAL_TableFeature` on top of Payload defaults.
145
260
  */
146
261
  declare const richTextEditor: () => ReturnType<typeof lexicalEditor>;
147
262
  /** Resolve Lexical editor config for seed scripts / markdown conversion. */
@@ -231,5 +346,5 @@ declare function createSiteSettings(access: AccessHelpers): GlobalConfig;
231
346
  /** Announcement banner global (no site revalidation — add via applyGlobalOverride hooks). */
232
347
  declare function createAnnouncementBanner(access: AccessHelpers): GlobalConfig;
233
348
  //#endregion
234
- export { createAccessHelpers as $, downloadCtaBlock as A, seoFields as B, codeBlockLanguages as C, sectionHeadingBlock as D, leafBlocks as E, richTextBlock as F, STOCK_COLLECTION_SLUGS as G, BuildCmsConfigOptions as H, coerceBlogPostCategoriesOnRead as I, GlobalOverride as J, StockCollectionSlug as K, coerceBlogPostCategoriesOnWrite as L, imageBlock as M, codeTabsBlock as N, accordionBlock as O, codeBlock as P, AccessOptions as Q, setPublishedAt as R, showcaseContentBlocks as S, languageOptions as T, buildCmsConfig as U, draftsWithAutosave as V, Overrides as W, applyGlobalOverride as X, applyCollectionOverride as Y, AccessHelpers as Z, requireEnvAtRuntime as _, createChangelog as a, blogContentBlocks as b, createPages as c, createAuthors as d, createMedia as f, createS3MediaPlugin as g, CreateS3MediaPluginOptions as h, createEventTags as i, videoBlock as j, stepsBlock as k, createBlogPosts as l, createUsers as m, createSiteSettings as n, createChangelogTags as o, createApiTokens as p, CollectionOverride as q, createEvents as r, createLegalPages as s, createAnnouncementBanner as t, createCategories as u, getRichTextEditorConfig as v, defaultCodeLanguage as w, pageContentBlocks as x, richTextEditor as y, slugify as z };
349
+ export { AccessOptions as $, downloadCtaBlock as A, slugify as B, codeBlockLanguages as C, sectionHeadingBlock as D, leafBlocks as E, codeBlock as F, Overrides as G, draftsWithAutosave as H, richTextBlock as I, CollectionOverride as J, STOCK_COLLECTION_SLUGS as K, coerceBlogPostCategoriesOnRead as L, videoBlock as M, imageBlock as N, accordionBlock as O, codeTabsBlock as P, AccessHelpers as Q, coerceBlogPostCategoriesOnWrite as R, showcaseContentBlocks as S, languageOptions as T, BuildCmsConfigOptions as U, seoFields as V, buildCmsConfig as W, applyCollectionOverride as X, GlobalOverride as Y, applyGlobalOverride as Z, requireEnvAtRuntime as _, withRoles as _t, createChangelog as a, RoleOption as at, blogContentBlocks as b, createPages as c, adminRoleAccess as ct, createAuthors as d, globalRoleRule as dt, createAccessHelpers as et, createMedia as f, hiddenUnless as ft, createS3MediaPlugin as g, userHasAnyRole as gt, CreateS3MediaPluginOptions as h, resolveRoleOptions as ht, createEventTags as i, DEFAULT_ROLES as it, customHtmlBlock as j, stepsBlock as k, createBlogPosts as l, collectionRoleRule as lt, createUsers as m, publishedOrRoleRead as mt, createSiteSettings as n, DEFAULT_COLLECTION_ROLES as nt, createChangelogTags as o, RoleRule as ot, createApiTokens as p, isCmsAdmin as pt, StockCollectionSlug as q, createEvents as r, DEFAULT_GLOBAL_ROLES as rt, createLegalPages as s, RolesOptions as st, createAnnouncementBanner as t, ADMIN_ROLE as tt, createCategories as u, effectiveRoles as ut, getRichTextEditorConfig as v, writeAccess as vt, defaultCodeLanguage as w, pageContentBlocks as x, richTextEditor as y, setPublishedAt as z };
235
350
  //# sourceMappingURL=index.d.mts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.mts","names":[],"sources":["../src/cms/shared/access.ts","../src/cms/applyOverride.ts","../src/cms/overrides.ts","../src/cms/buildCmsConfig.ts","../src/cms/shared/drafts-with-autosave.ts","../src/cms/shared/seo-fields.ts","../src/cms/hooks/slugify.ts","../src/cms/hooks/set-published-at.ts","../src/cms/hooks/coerce-blog-post-categories.ts","../src/cms/blocks/rich-text.ts","../src/cms/blocks/code.ts","../src/cms/blocks/code-tabs.ts","../src/cms/blocks/image.ts","../src/cms/blocks/video.ts","../src/cms/blocks/download-cta.ts","../src/cms/blocks/steps.ts","../src/cms/blocks/accordion.ts","../src/cms/blocks/section-heading.ts","../src/cms/blocks/leaf-blocks.ts","../src/cms/blocks/language-options.ts","../src/cms/blocks/index.ts","../src/cms/lexical/editor.ts","../src/cms/requireEnv.ts","../src/cms/createS3MediaPlugin.ts","../src/cms/collections/createUsers.ts","../src/cms/collections/createApiTokens.ts","../src/cms/collections/createMedia.ts","../src/cms/collections/createAuthors.ts","../src/cms/collections/createCategories.ts","../src/cms/collections/createBlogPosts.ts","../src/cms/collections/createPages.ts","../src/cms/collections/createChangelogTags.ts","../src/cms/collections/createChangelog.ts","../src/cms/collections/createEventTags.ts","../src/cms/collections/createEvents.ts","../src/cms/globals/createSiteSettings.ts","../src/cms/globals/createAnnouncementBanner.ts"],"mappings":";;;KAEY;;;;;EAKV;;KAGU;EACV,cAAc;IAAS,KAAK;;EAC5B,kBAAkB;EAClB,YAAY;EACZ,gBAAgB;;;;;;iBAYF,oBAAoB,UAAS,gBAAqB;;;KCxB7D,oBAAoB,mBA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TxC,YAAY,QAAQ,gBAAgB;;;iBCEpC,cAAc,QAAQ,gBAAgB;;;iBCDtC,iBAAiB,QAAQ,gBAAgB;;;;iBCSzC,gBAAgB,QAAQ,gBAAgB;;;iBCqDxC,YAAY,QAAQ,gBAAgB;iBAIpC,iBAAiB,QAAQ,gBAAgB;;;;iBCjEzC,oBAAoB,QAAQ,gBAAgB;;;;;;;;iBCK5C,gBAAgB,QAAQ,gBAAgB;;;;iBCLxC,gBAAgB,QAAQ,gBAAgB;;;;;;;;iBCqFxC,aAAa,QAAQ,gBAAgB;;;iBCxFrC,mBAAmB,QAAQ,gBAAgB;;;;iBCW3C,yBAAyB,QAAQ,gBAAgB"}
1
+ {"version":3,"file":"index.d.mts","names":[],"sources":["../src/cms/shared/roles.ts","../src/cms/shared/access.ts","../src/cms/applyOverride.ts","../src/cms/overrides.ts","../src/cms/buildCmsConfig.ts","../src/cms/shared/drafts-with-autosave.ts","../src/cms/shared/seo-fields.ts","../src/cms/hooks/slugify.ts","../src/cms/hooks/set-published-at.ts","../src/cms/hooks/coerce-blog-post-categories.ts","../src/cms/blocks/rich-text.ts","../src/cms/blocks/code.ts","../src/cms/blocks/code-tabs.ts","../src/cms/blocks/image.ts","../src/cms/blocks/video.ts","../src/cms/blocks/custom-html.ts","../src/cms/blocks/download-cta.ts","../src/cms/blocks/steps.ts","../src/cms/blocks/accordion.ts","../src/cms/blocks/section-heading.ts","../src/cms/blocks/leaf-blocks.ts","../src/cms/blocks/language-options.ts","../src/cms/blocks/index.ts","../src/cms/lexical/editor.ts","../src/cms/requireEnv.ts","../src/cms/createS3MediaPlugin.ts","../src/cms/collections/createUsers.ts","../src/cms/collections/createApiTokens.ts","../src/cms/collections/createMedia.ts","../src/cms/collections/createAuthors.ts","../src/cms/collections/createCategories.ts","../src/cms/collections/createBlogPosts.ts","../src/cms/collections/createPages.ts","../src/cms/collections/createChangelogTags.ts","../src/cms/collections/createChangelog.ts","../src/cms/collections/createEventTags.ts","../src/cms/collections/createEv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AAgB"}
package/dist/index.mjs CHANGED
@@ -1,8 +1,8 @@
1
- import { A as richTextBlock, B as languageOptions, C as blogContentBlocks, D as accordionBlock, E as sectionHeadingBlock, F as downloadCtaBlock, G as createAccessHelpers, H as seoFields, I as codeTabsBlock, L as codeBlock, M as richTextEditor, N as videoBlock, O as leafBlocks, P as imageBlock, R as codeBlockLanguages, S as coerceBlogPostCategoriesOnWrite, T as showcaseContentBlocks, U as slugify, V as createAuthors, W as createApiTokens, _ as createCategories, a as STOCK_COLLECTION_SLUGS, b as setPublishedAt, c as createSiteSettings, d as createPages, f as createMedia, g as createChangelog, h as createChangelogTags, i as buildCmsConfig, j as getRichTextEditorConfig, k as stepsBlock, l as createUsers, m as createEventTags, n as createS3MediaPlugin, o as applyCollectionOverride, p as createEvents, r as requireEnvAtRuntime, s as applyGlobalOverride, t as createAnnouncementBanner, u as createLegalPages, v as createBlogPosts, w as pageContentBlocks, x as coerceBlogPostCategoriesOnRead, y as draftsWithAutosave, z as defaultCodeLanguage } from "./cms.mjs";
1
+ import { $ as globalRoleRule, A as richTextBlock, B as defaultCodeLanguage, C as blogContentBlocks, D as accordionBlock, E as sectionHeadingBlock, F as downloadCtaBlock, G as createApiTokens, H as createAuthors, I as customHtmlBlock, J as DEFAULT_GLOBAL_ROLES, K as ADMIN_ROLE, L as codeTabsBlock, M as richTextEditor, N as videoBlock, O as leafBlocks, P as imageBlock, Q as effectiveRoles, R as codeBlock, S as coerceBlogPostCategoriesOnWrite, T as showcaseContentBlocks, U as seoFields, V as languageOptions, W as slugify, X as adminRoleAccess, Y as DEFAULT_ROLES, Z as collectionRoleRule, _ as createCategories, a as STOCK_COLLECTION_SLUGS, at as withRoles, b as setPublishedAt, c as createSiteSettings, d as createPages, et as hiddenUnless, f as createMedia, g as createChangelog, h as createChangelogTags, i as buildCmsConfig, it as userHasAnyRole, j as getRichTextEditorConfig, k as stepsBlock, l as createUsers, m as createEventTags, n as createS3MediaPlugin, nt as publishedOrRoleRead, o as applyCollectionOverride, ot as writeAccess, p as createEvents, q as DEFAULT_COLLECTION_ROLES, r as requireEnvAtRuntime, rt as resolveRoleOptions, s as applyGlobalOverride, st as createAccessHelpers, t as createAnnouncementBanner, tt as isCmsAdmin, u as createLegalPages, v as createBlogPosts, w as pageContentBlocks, x as coerceBlogPostCategoriesOnRead, y as draftsWithAutosave, z as codeBlockLanguages } from "./cms.mjs";
2
2
  import { t as createLogger } from "./logger.mjs";
3
3
  import { n as readPayloadMediaBuffer, t as readPayloadMediaAsDataUrl } from "./readMediaBuffer.mjs";
4
4
  import { t as getSiteUrl } from "./site-url.mjs";
5
5
  import { n as createMetadataFactory, t as getOgBackgroundDataUrl } from "./seo.mjs";
6
6
  import { n as Languages, t as LanguageLabel } from "./i18n.mjs";
7
7
  import { n as stripShikiPreBackground, t as toPlainValue } from "./utils.mjs";
8
- export { LanguageLabel, Languages, STOCK_COLLECTION_SLUGS, accordionBlock, applyCollectionOverride, applyGlobalOverride, blogContentBlocks, buildCmsConfig, codeBlock, codeBlockLanguages, codeTabsBlock, coerceBlogPostCategoriesOnRead, coerceBlogPostCategoriesOnWrite, createAccessHelpers, createAnnouncementBanner, createApiTokens, createAuthors, createBlogPosts, createCategories, createChangelog, createChangelogTags, createEventTags, createEvents, createLegalPages, createLogger, createMedia, createMetadataFactory, createPages, createS3MediaPlugin, createSiteSettings, createUsers, defaultCodeLanguage, downloadCtaBlock, draftsWithAutosave, getOgBackgroundDataUrl, getRichTextEditorConfig, getSiteUrl, imageBlock, languageOptions, leafBlocks, pageContentBlocks, readPayloadMediaAsDataUrl, readPayloadMediaBuffer, requireEnvAtRuntime, richTextBlock, richTextEditor, sectionHeadingBlock, seoFields, setPublishedAt, showcaseContentBlocks, slugify, stepsBlock, stripShikiPreBackground, toPlainValue, videoBlock };
8
+ export { ADMIN_ROLE, DEFAULT_COLLECTION_ROLES, DEFAULT_GLOBAL_ROLES, DEFAULT_ROLES, LanguageLabel, Languages, STOCK_COLLECTION_SLUGS, accordionBlock, adminRoleAccess, applyCollectionOverride, applyGlobalOverride, blogContentBlocks, buildCmsConfig, codeBlock, codeBlockLanguages, codeTabsBlock, coerceBlogPostCategoriesOnRead, coerceBlogPostCategoriesOnWrite, collectionRoleRule, createAccessHelpers, createAnnouncementBanner, createApiTokens, createAuthors, createBlogPosts, createCategories, createChangelog, createChangelogTags, createEventTags, createEvents, createLegalPages, createLogger, createMedia, createMetadataFactory, createPages, createS3MediaPlugin, createSiteSettings, createUsers, customHtmlBlock, defaultCodeLanguage, downloadCtaBlock, draftsWithAutosave, effectiveRoles, getOgBackgroundDataUrl, getRichTextEditorConfig, getSiteUrl, globalRoleRule, hiddenUnless, imageBlock, isCmsAdmin, languageOptions, leafBlocks, pageContentBlocks, publishedOrRoleRead, readPayloadMediaAsDataUrl, readPayloadMediaBuffer, requireEnvAtRuntime, resolveRoleOptions, richTextBlock, richTextEditor, sectionHeadingBlock, seoFields, setPublishedAt, showcaseContentBlocks, slugify, stepsBlock, stripShikiPreBackground, toPlainValue, userHasAnyRole, videoBlock, withRoles, writeAccess };
package/dist/index5.d.mts CHANGED
@@ -1,6 +1,6 @@
1
- import { $ as createAccessHelpers, A as downloadCtaBlock, B as seoFields, C as codeBlockLanguages, D as sectionHeadingBlock, E as leafBlocks, F as richTextBlock, G as STOCK_COLLECTION_SLUGS, H as BuildCmsConfigOptions, I as coerceBlogPostCategoriesOnRead, J as GlobalOverride, K as StockCollectionSlug, L as coerceBlogPostCategoriesOnWrite, M as imageBlock, N as codeTabsBlock, O as accordionBlock, P as codeBlock, Q as AccessOptions, R as setPublishedAt, S as showcaseContentBlocks, T as languageOptions, U as buildCmsConfig, V as draftsWithAutosave, W as Overrides, X as applyGlobalOverride, Y as applyCollectionOverride, Z as AccessHelpers, _ as requireEnvAtRuntime, a as createChangelog, b as blogContentBlocks, c as createPages, d as createAuthors, f as createMedia, g as createS3MediaPlugin, h as CreateS3MediaPluginOptions, i as createEventTags, j as videoBlock, k as stepsBlock, l as createBlogPosts, m as createUsers, n as createSiteSettings, o as createChangelogTags, p as createApiTokens, q as CollectionOverride, r as createEvents, s as createLegalPages, t as createAnnouncementBanner, u as createCategories, v as getRichTextEditorConfig, w as defaultCodeLanguage, x as pageContentBlocks, y as richTextEditor, z as slugify } from "./index.mjs";
1
+ import { $ as AccessOptions, A as downloadCtaBlock, B as slugify, C as codeBlockLanguages, D as sectionHeadingBlock, E as leafBlocks, F as codeBlock, G as Overrides, H as draftsWithAutosave, I as richTextBlock, J as CollectionOverride, K as STOCK_COLLECTION_SLUGS, L as coerceBlogPostCategoriesOnRead, M as videoBlock, N as imageBlock, O as accordionBlock, P as codeTabsBlock, Q as AccessHelpers, R as coerceBlogPostCategoriesOnWrite, S as showcaseContentBlocks, T as languageOptions, U as BuildCmsConfigOptions, V as seoFields, W as buildCmsConfig, X as applyCollectionOverride, Y as GlobalOverride, Z as applyGlobalOverride, _ as requireEnvAtRuntime, _t as withRoles, a as createChangelog, at as RoleOption, b as blogContentBlocks, c as createPages, ct as adminRoleAccess, d as createAuthors, dt as globalRoleRule, et as createAccessHelpers, f as createMedia, ft as hiddenUnless, g as createS3MediaPlugin, gt as userHasAnyRole, h as CreateS3MediaPluginOptions, ht as resolveRoleOptions, i as createEventTags, it as DEFAULT_ROLES, j as customHtmlBlock, k as stepsBlock, l as createBlogPosts, lt as collectionRoleRule, m as createUsers, mt as publishedOrRoleRead, n as createSiteSettings, nt as DEFAULT_COLLECTION_ROLES, o as createChangelogTags, ot as RoleRule, p as createApiTokens, pt as isCmsAdmin, q as StockCollectionSlug, r as createEvents, rt as DEFAULT_GLOBAL_ROLES, s as createLegalPages, st as RolesOptions, t as createAnnouncementBanner, tt as ADMIN_ROLE, u as createCategories, ut as effectiveRoles, v as getRichTextEditorConfig, vt as writeAccess, w as defaultCodeLanguage, x as pageContentBlocks, y as richTextEditor, z as setPublishedAt } from "./index.mjs";
2
2
  import { n as readPayloadMediaAsDataUrl, r as readPayloadMediaBuffer, t as PayloadMedia } from "./readMediaBuffer.mjs";
3
3
  import { n as Languages, t as LanguageLabel } from "./index2.mjs";
4
4
  import { a as createMetadataFactory, i as OgImage, n as CreateMetadataFactoryOptions, o as GetSiteUrlOptions, r as CreateMetadataInput, s as getSiteUrl, t as getOgBackgroundDataUrl } from "./index3.mjs";
5
5
  import { i as stripShikiPreBackground, n as createLogger, r as toPlainValue, t as Logger } from "./index4.mjs";
6
- export { type AccessHelpers, type AccessOptions, type BuildCmsConfigOptions, type CollectionOverride, type CreateMetadataFactoryOptions, type CreateMetadataInput, type CreateS3MediaPluginOptions, type GetSiteUrlOptions, type GlobalOverride, LanguageLabel, Languages, type Logger, type OgImage, type Overrides, type PayloadMedia, STOCK_COLLECTION_SLUGS, type StockCollectionSlug, accordionBlock, applyCollectionOverride, applyGlobalOverride, blogContentBlocks, buildCmsConfig, codeBlock, codeBlockLanguages, codeTabsBlock, coerceBlogPostCategoriesOnRead, coerceBlogPostCategoriesOnWrite, createAccessHelpers, createAnnouncementBanner, createApiTokens, createAuthors, createBlogPosts, createCategories, createChangelog, createChangelogTags, createEventTags, createEvents, createLegalPages, createLogger, createMedia, createMetadataFactory, createPages, createS3MediaPlugin, createSiteSettings, createUsers, defaultCodeLanguage, downloadCtaBlock, draftsWithAutosave, getOgBackgroundDataUrl, getRichTextEditorConfig, getSiteUrl, imageBlock, languageOptions, leafBlocks, pageContentBlocks, readPayloadMediaAsDataUrl, readPayloadMediaBuffer, requireEnvAtRuntime, richTextBlock, richTextEditor, sectionHeadingBlock, seoFields, setPublishedAt, showcaseContentBlocks, slugify, stepsBlock, stripShikiPreBackground, toPlainValue, videoBlock };
6
+ export { ADMIN_ROLE, type AccessHelpers, type AccessOptions, type BuildCmsConfigOptions, type CollectionOverride, type CreateMetadataFactoryOptions, type CreateMetadataInput, type CreateS3MediaPluginOptions, DEFAULT_COLLECTION_ROLES, DEFAULT_GLOBAL_ROLES, DEFAULT_ROLES, type GetSiteUrlOptions, type GlobalOverride, LanguageLabel, Languages, type Logger, type OgImage, type Overrides, type PayloadMedia, type RoleOption, type RoleRule, type RolesOptions, STOCK_COLLECTION_SLUGS, type StockCollectionSlug, accordionBlock, adminRoleAccess, applyCollectionOverride, applyGlobalOverride, blogContentBlocks, buildCmsConfig, codeBlock, codeBlockLanguages, codeTabsBlock, coerceBlogPostCategoriesOnRead, coerceBlogPostCategoriesOnWrite, collectionRoleRule, createAccessHelpers, createAnnouncementBanner, createApiTokens, createAuthors, createBlogPosts, createCategories, createChangelog, createChangelogTags, createEventTags, createEvents, createLegalPages, createLogger, createMedia, createMetadataFactory, createPages, createS3MediaPlugin, createSiteSettings, createUsers, customHtmlBlock, defaultCodeLanguage, downloadCtaBlock, draftsWithAutosave, effectiveRoles, getOgBackgroundDataUrl, getRichTextEditorConfig, getSiteUrl, globalRoleRule, hiddenUnless, imageBlock, isCmsAdmin, languageOptions, leafBlocks, pageContentBlocks, publishedOrRoleRead, readPayloadMediaAsDataUrl, readPayloadMediaBuffer, requireEnvAtRuntime, resolveRoleOptions, richTextBlock, richTextEditor, sectionHeadingBlock, seoFields, setPublishedAt, showcaseContentBlocks, slugify, stepsBlock, stripShikiPreBackground, toPlainValue, userHasAnyRole, videoBlock, withRoles, writeAccess };
@@ -1,3 +1,2 @@
1
- import { Carousel, CarouselContainer, CarouselControls, CarouselPagination, CarouselSlide, CarouselViewport, useCarousel } from "../components/Carousel/Carousel.mjs";
1
+ export { Carousel, CarouselContainer, CarouselControls, CarouselPagination, CarouselSlide, CarouselViewport, useCarousel } from "../components/Carousel/Carousel.mjs";
2
2
  import "../components/Carousel/index.mjs";
3
- export { Carousel, CarouselContainer, CarouselControls, CarouselPagination, CarouselSlide, CarouselViewport, useCarousel };
@@ -1,2 +1 @@
1
- import { Accordion } from "./Accordion.mjs";
2
- export { Accordion };
1
+ export { Accordion } from "./Accordion.mjs";
@@ -1,2 +1 @@
1
- import { Avatar } from "./Avatar.mjs";
2
- export { Avatar };
1
+ export { Avatar } from "./Avatar.mjs";
@@ -1,2 +1 @@
1
- import { Badge, badgeVariants } from "./Badge.mjs";
2
- export { Badge, badgeVariants };
1
+ export { Badge, badgeVariants } from "./Badge.mjs";
@@ -1,2 +1 @@
1
- import { BADGE_VERSION_RELEASE_TYPE_STYLES, BadgeVersion, coerceBadgeReleaseType } from "./BadgeVersion.mjs";
2
- export { BADGE_VERSION_RELEASE_TYPE_STYLES, BadgeVersion, coerceBadgeReleaseType };
1
+ export { BADGE_VERSION_RELEASE_TYPE_STYLES, BadgeVersion, coerceBadgeReleaseType } from "./BadgeVersion.mjs";
@@ -1,2 +1 @@
1
- import { Button, buttonVariants } from "./Button.mjs";
2
- export { Button, buttonVariants };
1
+ export { Button, buttonVariants } from "./Button.mjs";
@@ -1,2 +1 @@
1
- import { Card, cardVariants } from "./Card.mjs";
2
- export { Card, cardVariants };
1
+ export { Card, cardVariants } from "./Card.mjs";
@@ -1,2 +1 @@
1
- import { Carousel, CarouselContainer, CarouselControls, CarouselPagination, CarouselSlide, CarouselViewport, useCarousel } from "./Carousel.mjs";
2
- export { Carousel, CarouselContainer, CarouselControls, CarouselPagination, CarouselSlide, CarouselViewport, useCarousel };
1
+ export { Carousel, CarouselContainer, CarouselControls, CarouselPagination, CarouselSlide, CarouselViewport, useCarousel } from "./Carousel.mjs";
@@ -1,2 +1 @@
1
- import { Checkbox } from "./Checkbox.mjs";
2
- export { Checkbox };
1
+ export { Checkbox } from "./Checkbox.mjs";
@@ -1,2 +1 @@
1
- import { CodeBlock } from "./CodeBlock.mjs";
2
- export { CodeBlock };
1
+ export { CodeBlock } from "./CodeBlock.mjs";
@@ -1,2 +1 @@
1
- import { CodeBlockTabs } from "./CodeBlockTabs.mjs";
2
- export { CodeBlockTabs };
1
+ export { CodeBlockTabs } from "./CodeBlockTabs.mjs";
@@ -1,2 +1 @@
1
- import { CollapsibleSection } from "./CollapsibleSection.mjs";
2
- export { CollapsibleSection };
1
+ export { CollapsibleSection } from "./CollapsibleSection.mjs";
@@ -1,2 +1 @@
1
- import { CopyButton } from "./CopyButton.mjs";
2
- export { CopyButton };
1
+ export { CopyButton } from "./CopyButton.mjs";
@@ -0,0 +1,8 @@
1
+ //#region src/ui/components/CustomHtml/CustomHtml.d.ts
2
+ type CustomHtmlProps = {
3
+ html: string;
4
+ };
5
+ declare function CustomHtml({ html }: CustomHtmlProps): import("react").JSX.Element;
6
+ //#endregion
7
+ export { CustomHtml, CustomHtmlProps };
8
+ //# sourceMappingURL=CustomHtml.d.mts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"CustomHtml.d.mts","names":[],"sources":["../../../../src/ui/components/CustomHtml/CustomHtml.tsx"],"mappings":";KAIY;EACV;;iBAYO,aAAa,QAAQ,kCAAe,IAAA"}
@@ -0,0 +1,31 @@
1
+ "use client";
2
+ import { jsx } from "react/jsx-runtime";
3
+ import { useEffect, useRef } from "react";
4
+ //#region src/ui/components/CustomHtml/CustomHtml.tsx
5
+ function activateScripts(root) {
6
+ root.querySelectorAll("script").forEach((oldScript) => {
7
+ const script = document.createElement("script");
8
+ [...oldScript.attributes].forEach((attr) => script.setAttribute(attr.name, attr.value));
9
+ script.textContent = oldScript.textContent;
10
+ oldScript.replaceWith(script);
11
+ });
12
+ }
13
+ function CustomHtml({ html }) {
14
+ const ref = useRef(null);
15
+ useEffect(() => {
16
+ const root = ref.current;
17
+ if (!root) return;
18
+ root.innerHTML = html;
19
+ activateScripts(root);
20
+ }, [html]);
21
+ return /* @__PURE__ */ jsx("div", {
22
+ ref,
23
+ className: "min-w-0",
24
+ suppressHydrationWarning: true,
25
+ dangerouslySetInnerHTML: { __html: html }
26
+ });
27
+ }
28
+ //#endregion
29
+ export { CustomHtml };
30
+
31
+ //# sourceMappingURL=CustomHtml.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"CustomHtml.mjs","names":[],"sources":["../../../../src/ui/components/CustomHtml/CustomHtml.tsx"],"sourcesContent":["'use client'\n\nimport { useEffect, useRef } from 'react'\n\nexport type CustomHtmlProps = {\n html: string\n}\n\nfunction activateScripts(root: HTMLElement) {\n root.querySelectorAll('script').forEach((oldScript) => {\n const script = document.createElement('script')\n ;[...oldScript.attributes].forEach((attr) => script.setAttribute(attr.name, attr.value))\n script.textContent = oldScript.textContent\n oldScript.replaceWith(script)\n })\n}\n\nfunction CustomHtml({ html }: CustomHtmlProps) {\n const ref = useRef<HTMLDivElement>(null)\n\n useEffect(() => {\n const root = ref.current\n if (!root) return\n // innerHTML from React does not run <script>. Re-insert the markup, then\n // replace script nodes so campaign snippets actually run.\n root.innerHTML = html\n activateScripts(root)\n }, [html])\n\n return (\n <div\n ref={ref}\n className=\"min-w-0\"\n suppressHydrationWarning\n dangerouslySetInnerHTML={{ __html: html }}\n />\n )\n}\n\nexport { CustomHtml }\n"],"mappings":";;;;AAQA,SAAS,gBAAgB,MAAmB;CAC1C,KAAK,iBAAiB,QAAQ,CAAC,CAAC,SAAS,cAAc;EACrD,MAAM,SAAS,SAAS,cAAc,QAAQ;EAC7C,CAAC,GAAG,UAAU,UAAU,CAAC,CAAC,SAAS,SAAS,OAAO,aAAa,KAAK,MAAM,KAAK,KAAK,CAAC;EACvF,OAAO,cAAc,UAAU;EAC/B,UAAU,YAAY,MAAM;CAC9B,CAAC;AACH;AAEA,SAAS,WAAW,EAAE,QAAyB;CAC7C,MAAM,MAAM,OAAuB,IAAI;CAEvC,gBAAgB;EACd,MAAM,OAAO,IAAI;EACjB,IAAI,CAAC,MAAM;EAGX,KAAK,YAAY;EACjB,gBAAgB,IAAI;CACtB,GAAG,CAAC,IAAI,CAAC;CAET,OACE,oBAAC,OAAD;EACO;EACL,WAAU;EACV,0BAAA;EACA,yBAAyB,EAAE,QAAQ,KAAK;CACzC,CAAA;AAEL"}
@@ -0,0 +1,14 @@
1
+ //#region src/ui/components/CustomHtml/converters.d.ts
2
+ /** Lexical JSX converter for a Custom HTML block inside rich text. */
3
+ declare const customHtmlBlockConverters: {
4
+ 'custom-html': ({ node }: {
5
+ node: {
6
+ fields: {
7
+ html?: string | null;
8
+ };
9
+ };
10
+ }) => import("react").JSX.Element;
11
+ };
12
+ //#endregion
13
+ export { customHtmlBlockConverters };
14
+ //# sourceMappingURL=converters.d.mts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"converters.d.mts","names":[],"sources":["../../../../src/ui/components/CustomHtml/converters.tsx"],"mappings":";;cAGa;EACe,kBAAA;IAAE;MAAQ;QAAU;;;wBAA0B,IAAA"}
@@ -0,0 +1,9 @@
1
+ import { CustomHtml } from "./CustomHtml.mjs";
2
+ import { jsx } from "react/jsx-runtime";
3
+ //#region src/ui/components/CustomHtml/converters.tsx
4
+ /** Lexical JSX converter for a Custom HTML block inside rich text. */
5
+ const customHtmlBlockConverters = { "custom-html": ({ node }) => /* @__PURE__ */ jsx(CustomHtml, { html: node.fields.html ?? "" }) };
6
+ //#endregion
7
+ export { customHtmlBlockConverters };
8
+
9
+ //# sourceMappingURL=converters.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"converters.mjs","names":[],"sources":["../../../../src/ui/components/CustomHtml/converters.tsx"],"sourcesContent":["import { CustomHtml } from './CustomHtml.js'\n\n/** Lexical JSX converter for a Custom HTML block inside rich text. */\nexport const customHtmlBlockConverters = {\n 'custom-html': ({ node }: { node: { fields: { html?: string | null } } }) => (\n <CustomHtml html={node.fields.html ?? ''} />\n ),\n}\n"],"mappings":";;;;AAGA,MAAa,4BAA4B,EACvC,gBAAgB,EAAE,WAChB,oBAAC,YAAD,EAAY,MAAM,KAAK,OAAO,QAAQ,GAAK,CAAA,EAE/C"}
@@ -0,0 +1,3 @@
1
+ import { CustomHtml, CustomHtmlProps } from "./CustomHtml.mjs";
2
+ import { customHtmlBlockConverters } from "./converters.mjs";
3
+ export { CustomHtml, type CustomHtmlProps, customHtmlBlockConverters };
@@ -0,0 +1,3 @@
1
+ import { CustomHtml } from "./CustomHtml.mjs";
2
+ import { customHtmlBlockConverters } from "./converters.mjs";
3
+ export { CustomHtml, customHtmlBlockConverters };
@@ -1,2 +1 @@
1
- import { Dialog, DialogBody, DialogClose, DialogContent, DialogDescription, DialogFooter, DialogHeader, DialogOverlay, DialogPortal, DialogTitle, DialogTrigger, dialogFullscreenOnMobile } from "./Dialog.mjs";
2
- export { Dialog, DialogBody, DialogClose, DialogContent, DialogDescription, DialogFooter, DialogHeader, DialogOverlay, DialogPortal, DialogTitle, DialogTrigger, dialogFullscreenOnMobile };
1
+ export { Dialog, DialogBody, DialogClose, DialogContent, DialogDescription, DialogFooter, DialogHeader, DialogOverlay, DialogPortal, DialogTitle, DialogTrigger, dialogFullscreenOnMobile } from "./Dialog.mjs";
@@ -1,2 +1 @@
1
- import { EmptyState, emptyStateVariants } from "./EmptyState.mjs";
2
- export { EmptyState, emptyStateVariants };
1
+ export { EmptyState, emptyStateVariants } from "./EmptyState.mjs";
@@ -1,2 +1 @@
1
- import { FieldError } from "./FieldError.mjs";
2
- export { FieldError };
1
+ export { FieldError } from "./FieldError.mjs";
@@ -1,2 +1 @@
1
- import { FormattedDate, formatDate } from "./FormattedDate.mjs";
2
- export { FormattedDate, formatDate };
1
+ export { FormattedDate, formatDate } from "./FormattedDate.mjs";
@@ -1,2 +1 @@
1
- import { GoogleOAuthButton } from "./GoogleOAuthButton.mjs";
2
- export { GoogleOAuthButton };
1
+ export { GoogleOAuthButton } from "./GoogleOAuthButton.mjs";
@@ -1,2 +1 @@
1
- import { IconButton } from "./IconButton.mjs";
2
- export { IconButton };
1
+ export { IconButton } from "./IconButton.mjs";
@@ -1,2 +1 @@
1
- import { Input } from "./Input.mjs";
2
- export { Input };
1
+ export { Input } from "./Input.mjs";
@@ -1,2 +1 @@
1
- import { Label } from "./Label.mjs";
2
- export { Label };
1
+ export { Label } from "./Label.mjs";
@@ -1,2 +1 @@
1
- import { LazyVideo } from "./LazyVideo.mjs";
2
- export { LazyVideo };
1
+ export { LazyVideo } from "./LazyVideo.mjs";
@@ -1,2 +1 @@
1
- import { Pagination, buildPageItems } from "./Pagination.mjs";
2
- export { Pagination, buildPageItems };
1
+ export { Pagination, buildPageItems } from "./Pagination.mjs";
@@ -1,2 +1 @@
1
- import { PaginationItem } from "./PaginationItem.mjs";
2
- export { PaginationItem };
1
+ export { PaginationItem } from "./PaginationItem.mjs";
@@ -1,2 +1 @@
1
- import { PasswordInput } from "./PasswordInput.mjs";
2
- export { PasswordInput };
1
+ export { PasswordInput } from "./PasswordInput.mjs";
@@ -1,2 +1 @@
1
- import { ProgressStepper, segmentVariants } from "./ProgressStepper.mjs";
2
- export { ProgressStepper, segmentVariants };
1
+ export { ProgressStepper, segmentVariants } from "./ProgressStepper.mjs";
@@ -1,2 +1 @@
1
- import { Prose } from "./Prose.mjs";
2
- export { Prose };
1
+ export { Prose } from "./Prose.mjs";
@@ -1,2 +1 @@
1
- import { Radio } from "./Radio.mjs";
2
- export { Radio };
1
+ export { Radio } from "./Radio.mjs";
@@ -1,2 +1 @@
1
- import { Reveal } from "./Reveal.mjs";
2
- export { Reveal };
1
+ export { Reveal } from "./Reveal.mjs";
@@ -1,2 +1 @@
1
- import { SearchInput } from "./SearchInput.mjs";
2
- export { SearchInput };
1
+ export { SearchInput } from "./SearchInput.mjs";
@@ -1,2 +1 @@
1
- import { Select } from "./Select.mjs";
2
- export { Select };
1
+ export { Select } from "./Select.mjs";
@@ -1,2 +1 @@
1
- import { Sheet, SheetClose, SheetContent, SheetOverlay, SheetPortal, SheetTrigger } from "./Sheet.mjs";
2
- export { Sheet, SheetClose, SheetContent, SheetOverlay, SheetPortal, SheetTrigger };
1
+ export { Sheet, SheetClose, SheetContent, SheetOverlay, SheetPortal, SheetTrigger } from "./Sheet.mjs";
@@ -1,2 +1 @@
1
- import { StaggerReveal } from "./StaggerReveal.mjs";
2
- export { StaggerReveal };
1
+ export { StaggerReveal } from "./StaggerReveal.mjs";
@@ -1,2 +1 @@
1
- import { Stepper } from "./Stepper.mjs";
2
- export { Stepper };
1
+ export { Stepper } from "./Stepper.mjs";
@@ -1,2 +1 @@
1
- import { Switch } from "./Switch.mjs";
2
- export { Switch };
1
+ export { Switch } from "./Switch.mjs";
@@ -1,2 +1 @@
1
- import { TextButton } from "./TextButton.mjs";
2
- export { TextButton };
1
+ export { TextButton } from "./TextButton.mjs";
@@ -1,2 +1 @@
1
- import { Textarea } from "./Textarea.mjs";
2
- export { Textarea };
1
+ export { Textarea } from "./Textarea.mjs";
@@ -1,2 +1 @@
1
- import { ToastProvider, useToast } from "./Toast.mjs";
2
- export { ToastProvider, useToast };
1
+ export { ToastProvider, useToast } from "./Toast.mjs";
@@ -1,2 +1 @@
1
- import { Tooltip, TooltipContent, TooltipProvider, TooltipTrigger } from "./Tooltip.mjs";
2
- export { Tooltip, TooltipContent, TooltipProvider, TooltipTrigger };
1
+ export { Tooltip, TooltipContent, TooltipProvider, TooltipTrigger } from "./Tooltip.mjs";
@@ -1,2 +1 @@
1
- import { VisuallyHidden } from "./VisuallyHidden.mjs";
2
- export { VisuallyHidden };
1
+ export { VisuallyHidden } from "./VisuallyHidden.mjs";
@@ -1,2 +1 @@
1
- import { useInView } from "./useInView.mjs";
2
- export { useInView };
1
+ export { useInView } from "./useInView.mjs";
@@ -25,6 +25,9 @@ import "./components/CollapsibleSection/index.mjs";
25
25
  import { IconButton, IconButtonProps } from "./components/IconButton/IconButton.mjs";
26
26
  import { CopyButton, CopyButtonProps } from "./components/CopyButton/CopyButton.mjs";
27
27
  import "./components/CopyButton/index.mjs";
28
+ import { CustomHtml, CustomHtmlProps } from "./components/CustomHtml/CustomHtml.mjs";
29
+ import { customHtmlBlockConverters } from "./components/CustomHtml/converters.mjs";
30
+ import "./components/CustomHtml/index.mjs";
28
31
  import { Dialog, DialogBody, DialogClose, DialogContent, DialogContentProps, DialogDescription, DialogDescriptionProps, DialogFooter, DialogHeader, DialogOverlay, DialogOverlayProps, DialogPortal, DialogTitle, DialogTitleProps, DialogTrigger, dialogFullscreenOnMobile } from "./components/Dialog/Dialog.mjs";
29
32
  import "./components/Dialog/index.mjs";
30
33
  import { EmptyState, EmptyStateProps, emptyStateVariants } from "./components/EmptyState/EmptyState.mjs";
@@ -80,4 +83,4 @@ import { UseInViewOptions, useInView } from "./hooks/useInView.mjs";
80
83
  import "./hooks/index.mjs";
81
84
  import { cn } from "./utils/cn.mjs";
82
85
  import "./utils/index.mjs";
83
- export { Accordion, type AccordionItem, type AccordionProps, Avatar, type AvatarProps, BADGE_VERSION_RELEASE_TYPE_STYLES, Badge, type BadgeProps, BadgeVersion, type BadgeVersionProps, Button, type ButtonProps, Card, type CardProps, Checkbox, type CheckboxProps, CodeBlock, type CodeBlockProps, type CodeBlockTab, CodeBlockTabs, type CodeBlockTabsProps, type CodeBlockTabsTheme, type CodeBlockTheme, CollapsibleSection, type CollapsibleSectionProps, CopyButton, type CopyButtonProps, Dialog, DialogBody, DialogClose, DialogContent, type DialogContentProps, DialogDescription, type DialogDescriptionProps, DialogFooter, DialogHeader, DialogOverlay, type DialogOverlayProps, DialogPortal, DialogTitle, type DialogTitleProps, DialogTrigger, EmptyState, type EmptyStateProps, FieldError, type FieldErrorProps, type FormatDateOptions, FormattedDate, type FormattedDateProps, GoogleOAuthButton, IconButton, type IconButtonProps, Input, type InputProps, Label, type LabelProps, LazyVideo, type LazyVideoProps, Pagination, PaginationItem, type PaginationItemProps, type PaginationLabels, type PaginationProps, PasswordInput, type PasswordInputProps, ProgressStepper, type ProgressStepperProps, Prose, type ProseProps, Radio, type RadioProps, type ReleaseType, Reveal, type RevealProps, SearchInput, type SearchInputProps, Select, type SelectOption, type SelectProps, Sheet, SheetClose, SheetContent, type SheetContentProps, SheetOverlay, type SheetOverlayProps, SheetPortal, SheetTrigger, StaggerReveal, type StaggerRevealProps, Stepper, type StepperItem, type StepperProps, Switch, type SwitchProps, TextButton, type TextButtonProps, Textarea, type TextareaProps, ToastProvider, type ToastProviderProps, Tooltip, TooltipContent, type TooltipContentProps, TooltipProvider, TooltipTrigger, type UseInViewOptions, VisuallyHidden, type VisuallyHiddenProps, badgeVariants, buildPageItems, buttonVariants, cardVariants, cn, coerceBadgeReleaseType, dialogFullscreenOnMobile, emptyStateVariants, focusRingClassName, formatDate, segmentVariants, useInView, useToast };
86
+ export { Accordion, type AccordionItem, type AccordionProps, Avatar, type AvatarProps, BADGE_VERSION_RELEASE_TYPE_STYLES, Badge, type BadgeProps, BadgeVersion, type BadgeVersionProps, Button, type ButtonProps, Card, type CardProps, Checkbox, type CheckboxProps, CodeBlock, type CodeBlockProps, type CodeBlockTab, CodeBlockTabs, type CodeBlockTabsProps, type CodeBlockTabsTheme, type CodeBlockTheme, CollapsibleSection, type CollapsibleSectionProps, CopyButton, type CopyButtonProps, CustomHtml, type CustomHtmlProps, Dialog, DialogBody, DialogClose, DialogContent, type DialogContentProps, DialogDescription, type DialogDescriptionProps, DialogFooter, DialogHeader, DialogOverlay, type DialogOverlayProps, DialogPortal, DialogTitle, type DialogTitleProps, DialogTrigger, EmptyState, type EmptyStateProps, FieldError, type FieldErrorProps, type FormatDateOptions, FormattedDate, type FormattedDateProps, GoogleOAuthButton, IconButton, type IconButtonProps, Input, type InputProps, Label, type LabelProps, LazyVideo, type LazyVideoProps, Pagination, PaginationItem, type PaginationItemProps, type PaginationLabels, type PaginationProps, PasswordInput, type PasswordInputProps, ProgressStepper, type ProgressStepperProps, Prose, type ProseProps, Radio, type RadioProps, type ReleaseType, Reveal, type RevealProps, SearchInput, type SearchInputProps, Select, type SelectOption, type SelectProps, Sheet, SheetClose, SheetContent, type SheetContentProps, SheetOverlay, type SheetOverlayProps, SheetPortal, SheetTrigger, StaggerReveal, type StaggerRevealProps, Stepper, type StepperItem, type StepperProps, Switch, type SwitchProps, TextButton, type TextButtonProps, Textarea, type TextareaProps, ToastProvider, type ToastProviderProps, Tooltip, TooltipContent, type TooltipContentProps, TooltipProvider, TooltipTrigger, type UseInViewOptions, VisuallyHidden, type VisuallyHiddenProps, badgeVariants, buildPageItems, buttonVariants, cardVariants, cn, coerceBadgeReleaseType, customHtmlBlockConverters, dialogFullscreenOnMobile, emptyStateVariants, focusRingClassName, formatDate, segmentVariants, useInView, useToast };
package/dist/ui/index.mjs CHANGED
@@ -24,6 +24,7 @@ export * from './components/Select/index.mjs'
24
24
  export * from './components/Toast/index.mjs'
25
25
  export * from './components/CodeBlock/index.mjs'
26
26
  export * from './components/CodeBlockTabs/index.mjs'
27
+ export * from './components/CustomHtml/index.mjs'
27
28
  export * from './components/ProgressStepper/index.mjs'
28
29
  export * from './components/Pagination/index.mjs'
29
30
  export * from './components/PaginationItem/index.mjs'
@@ -1,2 +1 @@
1
- import { cn } from "./cn.mjs";
2
- export { cn };
1
+ export { cn } from "./cn.mjs";