@phtngyn/cms 0.1.0-beta.4 → 0.2.0-beta.1

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 (93) hide show
  1. package/README.md +85 -5
  2. package/package.json +12 -1
  3. package/src/ApplicationTypes.d.ts +82 -0
  4. package/src/ApplicationTypes.js +1 -0
  5. package/src/{Configuration-CDMYfTre.js → Configuration-CjVUBBwa.js} +3 -3
  6. package/src/{Configuration-CDMYfTre.js.map → Configuration-CjVUBBwa.js.map} +1 -1
  7. package/src/Configuration.d.ts +9 -4
  8. package/src/Configuration.js.map +1 -1
  9. package/src/Content.d.ts +67 -0
  10. package/src/Content.js +291 -0
  11. package/src/Content.js.map +1 -0
  12. package/src/ContentTransfer-CRQet3QJ.d.ts +48 -0
  13. package/src/{ContentTransfer-C3Av9sWz.js → ContentTransfer-CTzGGKFV.js} +8 -4
  14. package/src/ContentTransfer-CTzGGKFV.js.map +1 -0
  15. package/src/{DocumentEngine-J7g-emdf.js → DocumentEngine-BbhfnTAc.js} +4 -4
  16. package/src/{DocumentEngine-J7g-emdf.js.map → DocumentEngine-BbhfnTAc.js.map} +1 -1
  17. package/src/DocumentModel.d.ts +8 -1
  18. package/src/DocumentModel.js +29 -2
  19. package/src/DocumentModel.js.map +1 -1
  20. package/src/{Forms-Dj6NuW66.js → Forms-02-p8qEw.js} +2 -2
  21. package/src/{Forms-Dj6NuW66.js.map → Forms-02-p8qEw.js.map} +1 -1
  22. package/src/{Forms-BsJMev5_.d.ts → Forms-BorTcIlp.d.ts} +2 -5
  23. package/src/Forms.d.ts +25 -14
  24. package/src/Forms.js.map +1 -1
  25. package/src/I18n-BXlVunfa.d.ts +27 -0
  26. package/src/I18n.d.ts +2 -20
  27. package/src/Module.js +14 -5
  28. package/src/Module.js.map +1 -1
  29. package/src/{S3MediaObjects-CpPSzJto.js → S3MediaObjects-DC0c8sYC.js} +54 -35
  30. package/src/{S3MediaObjects-CpPSzJto.js.map → S3MediaObjects-DC0c8sYC.js.map} +1 -1
  31. package/src/cli/content.js +63 -221
  32. package/src/cli/content.js.map +1 -1
  33. package/src/cli.js +93 -4
  34. package/src/cli.js.map +1 -1
  35. package/src/{connection-CBAy2qGy.js → connection-BPf4BQUZ.js} +2 -2
  36. package/src/{connection-CBAy2qGy.js.map → connection-BPf4BQUZ.js.map} +1 -1
  37. package/src/dev-lifecycle-vQLxwCFq.js +428 -0
  38. package/src/dev-lifecycle-vQLxwCFq.js.map +1 -0
  39. package/src/{installation-CNfIriVm.js → installation-DsGst1BH.js} +578 -457
  40. package/src/installation-DsGst1BH.js.map +1 -0
  41. package/src/internal/application-types.js +43 -0
  42. package/src/internal/application-types.js.map +1 -0
  43. package/src/internal/authoring-catalog.js +9 -4
  44. package/src/internal/authoring-catalog.js.map +1 -1
  45. package/src/internal/authoring-metadata.js +1 -1
  46. package/src/internal/configuration.js +10 -6
  47. package/src/internal/configuration.js.map +1 -1
  48. package/src/internal/dev-lifecycle.js +3 -0
  49. package/src/internal/document-model.js +2 -2
  50. package/src/internal/document-model.js.map +1 -1
  51. package/src/internal/i18n.js +21 -0
  52. package/src/internal/i18n.js.map +1 -1
  53. package/src/{location-BTqdfIzX.js → location-BgYhXEZp.js} +2 -2
  54. package/src/{location-BTqdfIzX.js.map → location-BgYhXEZp.js.map} +1 -1
  55. package/src/{models-Bah5B3bT.js → models-DgkGTFus.js} +6 -1
  56. package/src/models-DgkGTFus.js.map +1 -0
  57. package/src/{models-B4IoTmp7.js → models-k2nXyD6q.js} +2 -2
  58. package/src/{models-B4IoTmp7.js.map → models-k2nXyD6q.js.map} +1 -1
  59. package/src/runtime/delivery/context.js +1 -1
  60. package/src/runtime/delivery/plugin.js +27 -5
  61. package/src/runtime/delivery/plugin.js.map +1 -1
  62. package/src/runtime/delivery/preview.d.ts +1 -1
  63. package/src/runtime/delivery/types.d.ts +2 -85
  64. package/src/runtime/delivery/useCmsDocumentSeo.d.ts +8 -1
  65. package/src/runtime/delivery/useCmsDocumentSeo.js +19 -7
  66. package/src/runtime/delivery/useCmsDocumentSeo.js.map +1 -1
  67. package/src/runtime/delivery/useDocument.d.ts +2 -2
  68. package/src/runtime/delivery/useDocument.js.map +1 -1
  69. package/src/runtime/delivery/useDocumentQuery.d.ts +3 -3
  70. package/src/runtime/delivery/useDocumentQuery.js.map +1 -1
  71. package/src/runtime/forms/document.js +1 -1
  72. package/src/runtime/forms/useCmsForm.js +81 -41
  73. package/src/runtime/forms/useCmsForm.js.map +1 -1
  74. package/src/runtime/i18n/useCmsI18n.d.ts +9 -7
  75. package/src/runtime/i18n/useCmsI18n.js +5 -4
  76. package/src/runtime/i18n/useCmsI18n.js.map +1 -1
  77. package/src/runtime/installation.js +2 -2
  78. package/src/runtime/plugin.js +1 -1
  79. package/src/runtime/preview/connection.js +1 -1
  80. package/src/runtime/preview/controller.js +2 -2
  81. package/src/runtime/preview/plugin.client.js +3 -3
  82. package/src/runtime/preview/store.js +1 -1
  83. package/src/runtime/sitemap.js +1 -1
  84. package/src/scalars-CA6kyipS.d.ts +7 -0
  85. package/src/{store-b2CSXgMt.js → store-BYgSt7E3.js} +3 -3
  86. package/src/{store-b2CSXgMt.js.map → store-BYgSt7E3.js.map} +1 -1
  87. package/src/types-DutFRtaG.d.ts +90 -0
  88. package/studio/{CreateDocumentDialog-GGey1uBc.js → CreateDocumentDialog-BdiM77bb.js} +1 -1
  89. package/studio/{documentPlanning-DRErYmBU.js → documentPlanning-B7fyUj9r.js} +7072 -7065
  90. package/studio/host.js +2 -2
  91. package/src/ContentTransfer-C3Av9sWz.js.map +0 -1
  92. package/src/installation-CNfIriVm.js.map +0 -1
  93. package/src/models-Bah5B3bT.js.map +0 -1
@@ -0,0 +1 @@
1
+ {"version":3,"file":"models-DgkGTFus.js","names":[],"sources":["../../../../protocol/src/Identity.ts","../../../../protocol/src/internal/configuration/scalars.ts","../../../../protocol/src/Media.ts","../../../../protocol/src/AccessControl.ts","../../../../protocol/src/Seo.ts","../../../../protocol/src/internal/documents/models.ts"],"sourcesContent":["import { Schema } from 'effect'\n\nexport const RequestId = Schema.String.check(Schema.isUUID()).pipe(Schema.brand('RequestId'))\n\nexport type RequestId = typeof RequestId.Type\n","import { Schema } from 'effect'\nimport { publicPathPattern } from '../scalars'\n\nconst collectionNamePattern = /^[a-z][a-z0-9]*(?:[-_][a-z0-9]+)*$/u\n\nconst localePattern = /^[A-Za-z]{2,3}(?:-[A-Za-z0-9]{2,8})*$/u\n\nconst sourceDirectoryPattern = /^(?:\\.|(?!\\.)[^/?#\\\\]+(?:\\/(?!\\.)[^/?#\\\\]+)*)$/u\n\nexport const AddressPattern = Schema.String.check(Schema.isPattern(publicPathPattern)).pipe(\n Schema.brand('AddressPattern'),\n)\n\nexport type AddressPattern = typeof AddressPattern.Type\n\nexport const CollectionName = Schema.String.check(Schema.isPattern(collectionNamePattern)).pipe(\n Schema.brand('CollectionName'),\n)\n\nexport type CollectionName = typeof CollectionName.Type\n\nexport const Locale = Schema.String.check(Schema.isPattern(localePattern)).pipe(Schema.brand('Locale'))\n\nexport type Locale = typeof Locale.Type\n\nexport const SourceDirectory = Schema.String.check(Schema.isPattern(sourceDirectoryPattern)).pipe(\n Schema.brand('SourceDirectory'),\n)\n\nexport type SourceDirectory = typeof SourceDirectory.Type\n","/**\n * Media wire models. Search pages are newest-first with opaque continuation cursors; only ready\n * assets are public results, and names, folders, and object keys are validated path-safe values.\n */\nimport { Schema } from 'effect'\nimport { DocumentId, PublicPath, SourcePath } from './internal/documents/scalars'\nimport { nonNegativeInt } from './internal/scalars'\n\nconst hasUnsafeMediaCharacter = (value: string): boolean => {\n for (const character of value) {\n const codePoint = character.codePointAt(0)\n\n if (character === '\\\\' || (codePoint !== undefined && (codePoint <= 31 || codePoint === 127))) return true\n }\n\n return false\n}\n\nconst isSafeMediaPath = (value: string, allowEmpty: boolean): boolean => {\n if (value.length === 0) return allowEmpty\n\n if (value !== value.trim() || value.startsWith('/') || value.endsWith('/') || hasUnsafeMediaCharacter(value)) {\n return false\n }\n\n return value.split('/').every((segment) => segment.length > 0 && segment !== '.' && segment !== '..')\n}\n\nconst safeMediaFolder = Schema.makeFilter<string>((value) => isSafeMediaPath(value, true), {\n expected: 'a provider-relative media folder without traversal segments',\n})\n\nconst safeMediaObjectKey = Schema.makeFilter<string>((value) => isSafeMediaPath(value, false), {\n expected: 'a non-empty provider-relative media object key without traversal segments',\n})\n\nconst safeMediaName = Schema.makeFilter<string>(\n (value) =>\n value.length > 0 &&\n value.length <= 255 &&\n value === value.trim() &&\n value !== '.' &&\n value !== '..' &&\n !value.includes('/') &&\n !hasUnsafeMediaCharacter(value),\n { expected: 'a safe media file name of at most 255 characters' },\n)\n\nexport const MediaId = Schema.String.check(Schema.isUUID()).pipe(Schema.brand('MediaId'))\n\nexport type MediaId = typeof MediaId.Type\n\nexport const MediaFolder = Schema.String.check(Schema.isMaxLength(512), safeMediaFolder).pipe(\n Schema.brand('MediaFolder'),\n)\n\nexport type MediaFolder = typeof MediaFolder.Type\n\nexport const MediaObjectKey = Schema.String.check(Schema.isMaxLength(1024), safeMediaObjectKey).pipe(\n Schema.brand('MediaObjectKey'),\n)\n\nexport type MediaObjectKey = typeof MediaObjectKey.Type\n\nexport const MediaName = Schema.String.check(safeMediaName).pipe(Schema.brand('MediaName'))\n\nexport type MediaName = typeof MediaName.Type\n\nexport const MediaCursor = Schema.NonEmptyString.pipe(Schema.brand('MediaCursor'))\n\nexport type MediaCursor = typeof MediaCursor.Type\n\nexport const ImageMimeType = Schema.Literals(['image/avif', 'image/gif', 'image/jpeg', 'image/png', 'image/webp'])\n\nexport type ImageMimeType = typeof ImageMimeType.Type\n\nexport const MediaStatus = Schema.Literals(['uploading', 'ready', 'deleting'])\n\nexport type MediaStatus = typeof MediaStatus.Type\n\nexport const MediaByteSize = Schema.Int.check(Schema.isGreaterThan(0))\n\nexport type MediaByteSize = typeof MediaByteSize.Type\n\nexport const MediaAsset = Schema.Struct({\n kind: Schema.tag('image'),\n id: MediaId,\n objectKey: MediaObjectKey,\n url: Schema.NonEmptyString,\n name: MediaName,\n folder: MediaFolder,\n mimeType: ImageMimeType,\n byteSize: MediaByteSize,\n createdAt: Schema.DateTimeUtcFromString,\n updatedAt: Schema.DateTimeUtcFromString,\n status: MediaStatus,\n}).annotate({ identifier: 'MediaAsset' })\n\nexport interface MediaAsset extends Schema.Schema.Type<typeof MediaAsset> {}\n\nexport const MediaUpload = Schema.Struct({\n name: MediaName,\n folder: Schema.optionalKey(MediaFolder),\n declaredMimeType: Schema.optionalKey(Schema.NonEmptyString),\n declaredByteSize: MediaByteSize,\n}).annotate({ identifier: 'MediaUpload' })\n\nexport interface MediaUpload extends Schema.Schema.Type<typeof MediaUpload> {}\n\nexport const MediaQuery = Schema.Struct({\n cursor: Schema.optionalKey(MediaCursor),\n folder: Schema.optionalKey(MediaFolder),\n search: Schema.optionalKey(Schema.NonEmptyString.check(Schema.isMaxLength(200))),\n limit: Schema.optionalKey(Schema.Int.check(Schema.isBetween({ minimum: 1, maximum: 100 }))),\n}).annotate({ identifier: 'MediaQuery' })\n\nexport interface MediaQuery extends Schema.Schema.Type<typeof MediaQuery> {}\n\nconst ReadyMediaAssets = Schema.Array(MediaAsset).check(\n Schema.makeFilter((assets) => assets.every((asset) => asset.status === 'ready'), {\n expected: 'media assets whose lifecycle status is ready',\n }),\n)\n\nexport const MediaPage = Schema.Struct({\n assets: ReadyMediaAssets,\n folders: Schema.Array(MediaFolder),\n nextCursor: Schema.optionalKey(MediaCursor),\n total: nonNegativeInt,\n}).annotate({ identifier: 'MediaPage' })\n\nexport interface MediaPage extends Schema.Schema.Type<typeof MediaPage> {}\n\nexport const MediaReference = Schema.Struct({\n documentId: DocumentId,\n mediaId: Schema.optionalKey(MediaId),\n path: PublicPath,\n sourcePath: SourcePath,\n objectKey: MediaObjectKey,\n nodePath: Schema.Array(nonNegativeInt),\n}).annotate({ identifier: 'MediaReference' })\n\nexport interface MediaReference extends Schema.Schema.Type<typeof MediaReference> {}\n\nconst MediaObjectMismatch = Schema.Struct({\n asset: MediaAsset,\n storedByteSize: MediaByteSize,\n storedMimeType: Schema.optionalKey(ImageMimeType),\n}).annotate({ identifier: 'MediaObjectMismatch' })\n\nexport const MediaIntegrityReport = Schema.Struct({\n missingAssets: Schema.Array(MediaReference),\n missingObjects: Schema.Array(MediaAsset),\n mismatchedObjects: Schema.Array(MediaObjectMismatch),\n orphanedObjectKeys: Schema.Array(MediaObjectKey),\n unusedAssets: Schema.Array(MediaAsset),\n}).annotate({ identifier: 'MediaIntegrityReport' })\n\nexport interface MediaIntegrityReport extends Schema.Schema.Type<typeof MediaIntegrityReport> {}\n\nexport const MediaCleanupReport = Schema.Struct({\n removedObjectKeys: Schema.Array(MediaObjectKey),\n}).annotate({ identifier: 'MediaCleanupReport' })\n\nexport interface MediaCleanupReport extends Schema.Schema.Type<typeof MediaCleanupReport> {}\n\nexport class MediaNotFound extends Schema.TaggedError<MediaNotFound>()('Media.NotFound', {\n mediaId: MediaId,\n}) {}\n\nexport class MediaReferenced extends Schema.TaggedError<MediaReferenced>()('Media.Referenced', {\n mediaId: MediaId,\n references: Schema.Array(MediaReference),\n seoScopes: Schema.optionalKey(Schema.Array(Schema.Literals(['working', 'published']))),\n}) {}\n\nexport class MediaConflict extends Schema.TaggedError<MediaConflict>()('Media.Conflict', {\n mediaId: MediaId,\n}) {}\n\nexport class MediaInvalid extends Schema.TaggedError<MediaInvalid>()('Media.Invalid', {\n message: Schema.NonEmptyString,\n}) {}\n\nexport class MediaTooLarge extends Schema.TaggedError<MediaTooLarge>()('Media.TooLarge', {\n declaredByteSize: MediaByteSize,\n maxUploadBytes: MediaByteSize,\n}) {}\n","import { Schema } from 'effect'\nimport { RequestId } from './Identity'\nimport { CollectionName, Locale } from './internal/configuration/scalars'\nimport { DocumentId } from './internal/documents/scalars'\nimport { MediaFolder, MediaId } from './Media'\n\nexport const ROLES = ['administrator', 'editor', 'viewer'] as const\n\nexport const Role = Schema.Literals(ROLES)\n\nexport type Role = typeof Role.Type\n\nexport const StudioActor = Schema.Struct({\n id: Schema.NonEmptyString,\n email: Schema.NonEmptyString,\n name: Schema.NonEmptyString,\n // Provider roles remain visible, while access control recognizes only Role values.\n roles: Schema.Array(Schema.NonEmptyString),\n}).annotate({ identifier: 'StudioActor' })\n\nexport interface StudioActor extends Schema.Schema.Type<typeof StudioActor> {}\n\nexport const StudioRequestContext = Schema.Struct({\n actor: StudioActor,\n requestId: RequestId,\n}).annotate({ identifier: 'StudioRequestContext' })\n\nexport interface StudioRequestContext extends Schema.Schema.Type<typeof StudioRequestContext> {}\n\nexport const DOCUMENT_ACTIONS = [\n 'document.browse',\n 'document.read',\n 'document.trash',\n 'document.validate',\n 'document.create',\n 'document.update',\n 'document.move',\n 'document.remove',\n 'document.restore',\n 'document.undelete',\n 'document.publish',\n 'document.unpublish',\n 'document.duplicate',\n 'document.history',\n 'document.transfer',\n] as const\n\nconst DocumentAction = Schema.Literals(DOCUMENT_ACTIONS)\n\nconst DocumentCatalogResource = Schema.Struct({\n kind: Schema.tag('catalog'),\n})\n\nconst CollectionResource = Schema.Struct({\n kind: Schema.tag('collection'),\n collection: CollectionName,\n locale: Schema.optionalKey(Locale),\n})\n\nconst DocumentResource = Schema.Struct({\n kind: Schema.tag('document'),\n documentId: DocumentId,\n})\n\nconst DocumentAccessResource = Schema.Union([DocumentCatalogResource, CollectionResource, DocumentResource]).pipe(\n Schema.toTaggedUnion('kind'),\n)\n\nexport const DocumentAccessDecision = Schema.Struct({\n action: DocumentAction,\n resource: DocumentAccessResource,\n}).annotate({ identifier: 'DocumentAccessDecision' })\n\nexport interface DocumentAccessDecision extends Schema.Schema.Type<typeof DocumentAccessDecision> {}\n\nexport const MEDIA_ACTIONS = [\n 'media.read',\n 'media.search',\n 'media.integrity',\n 'media.upload',\n 'media.replace',\n 'media.remove',\n 'media.cleanup',\n] as const\n\nconst MediaAction = Schema.Literals(MEDIA_ACTIONS)\n\nconst MediaCatalogResource = Schema.Struct({\n kind: Schema.tag('media-catalog'),\n})\n\nconst MediaAssetResource = Schema.Struct({\n kind: Schema.tag('media-asset'),\n mediaId: MediaId,\n})\n\nconst MediaFolderResource = Schema.Struct({\n kind: Schema.tag('media-folder'),\n folder: MediaFolder,\n})\n\nconst MediaResource = Schema.Union([MediaCatalogResource, MediaAssetResource, MediaFolderResource]).pipe(\n Schema.toTaggedUnion('kind'),\n)\n\nexport const MediaAccessDecision = Schema.Struct({\n action: MediaAction,\n resource: MediaResource,\n}).annotate({ identifier: 'MediaAccessDecision' })\n\nexport interface MediaAccessDecision extends Schema.Schema.Type<typeof MediaAccessDecision> {}\n\nconst ActivityResource = Schema.Struct({\n kind: Schema.tag('activity'),\n})\n\nconst ActivityAccessDecision = Schema.Struct({\n action: Schema.Literal('activity.read'),\n resource: ActivityResource,\n}).annotate({ identifier: 'ActivityAccessDecision' })\n\nexport const SEO_ACTIONS = ['seo.read', 'seo.save', 'seo.publish'] as const\n\nconst SeoAction = Schema.Literals(SEO_ACTIONS)\n\nconst SeoResource = Schema.Struct({ kind: Schema.tag('seo') })\n\nexport const SeoAccessDecision = Schema.Struct({\n action: SeoAction,\n resource: SeoResource,\n}).annotate({ identifier: 'SeoAccessDecision' })\n\nexport interface SeoAccessDecision extends Schema.Schema.Type<typeof SeoAccessDecision> {}\n\nconst STUDIO_ACTIONS = [...DOCUMENT_ACTIONS, ...MEDIA_ACTIONS, ...SEO_ACTIONS, 'activity.read'] as const\n\nexport const StudioAction = Schema.Literals(STUDIO_ACTIONS)\n\nexport type StudioAction = typeof StudioAction.Type\n\nconst StudioResource = Schema.Union([DocumentAccessResource, MediaResource, ActivityResource, SeoResource])\n\nexport const StudioAccessDecision = Schema.Union([\n DocumentAccessDecision,\n MediaAccessDecision,\n ActivityAccessDecision,\n SeoAccessDecision,\n])\n\nexport type StudioAccessDecision = typeof StudioAccessDecision.Type\n\nexport class AuthenticationRequired extends Schema.TaggedError<AuthenticationRequired>()(\n 'Studio.AuthenticationRequired',\n {},\n) {}\n\nexport class StudioEntryDenied extends Schema.TaggedError<StudioEntryDenied>()('Studio.EntryDenied', {}) {}\n\nexport class AccessDenied extends Schema.TaggedError<AccessDenied>()('Studio.AccessDenied', {\n action: StudioAction,\n actorId: StudioActor.fields.id,\n resource: StudioResource,\n}) {}\n","import { DateTime, Option, Schema } from 'effect'\nimport { StudioActor } from './AccessControl'\nimport { MediaId } from './Media'\nimport { Locale } from './internal/configuration/scalars'\nimport { PublicPath } from './internal/documents/scalars'\n\nconst absoluteUrl = Schema.makeFilter<string>(\n (value) => {\n try {\n const url = new URL(value)\n\n return url.protocol === 'http:' || url.protocol === 'https:'\n } catch {\n return false\n }\n },\n { expected: 'an absolute HTTP or HTTPS URL' },\n)\n\nconst canonicalOrigin = Schema.makeFilter<string>(\n (value) => {\n try {\n const url = new URL(value)\n\n return (\n (url.protocol === 'http:' || url.protocol === 'https:') &&\n url.origin === value &&\n url.pathname === '/' &&\n url.search === '' &&\n url.hash === ''\n )\n } catch {\n return false\n }\n },\n { expected: 'an HTTP or HTTPS origin without a path, query, hash, or trailing slash' },\n)\n\nconst titleTemplate = Schema.makeFilter<string>((value) => value.includes('%s'), {\n expected: 'a title template containing %s',\n})\n\nconst calendarDate = Schema.makeFilter<string>(\n (value) => {\n if (!/^\\d{4}-\\d{2}-\\d{2}$/u.test(value)) return false\n const parsed = DateTime.make(value)\n\n return Option.isSome(parsed) && DateTime.formatIsoDate(parsed.value) === value\n },\n { expected: 'a valid calendar date in YYYY-MM-DD format' },\n)\n\nexport const SeoUrl = Schema.NonEmptyString.check(absoluteUrl).pipe(Schema.brand('SeoUrl'))\n\nexport type SeoUrl = typeof SeoUrl.Type\n\nexport const SeoCanonicalOrigin = Schema.NonEmptyString.check(canonicalOrigin).pipe(Schema.brand('SeoCanonicalOrigin'))\n\nexport type SeoCanonicalOrigin = typeof SeoCanonicalOrigin.Type\n\nexport const SeoImage = Schema.Struct({\n mediaId: MediaId,\n url: SeoUrl,\n alt: Schema.NonEmptyString,\n}).annotate({ identifier: 'SeoImage' })\n\nexport interface SeoImage extends Schema.Schema.Type<typeof SeoImage> {}\n\nexport const StructuredDataType = Schema.Literals(['WebPage', 'Article'])\n\nexport type StructuredDataType = typeof StructuredDataType.Type\n\nconst WebPageStructuredData = Schema.Struct({\n type: Schema.tag('WebPage'),\n})\n\nconst ArticleStructuredData = Schema.Struct({\n type: Schema.tag('Article'),\n headline: Schema.optionalKey(Schema.NonEmptyString),\n datePublished: Schema.optionalKey(Schema.String.check(calendarDate)),\n dateModified: Schema.optionalKey(Schema.String.check(calendarDate)),\n})\n\nexport const DocumentStructuredData = Schema.Union([WebPageStructuredData, ArticleStructuredData]).pipe(\n Schema.toTaggedUnion('type'),\n)\n\nexport type DocumentStructuredData = typeof DocumentStructuredData.Type\n\nexport const IdentityType = Schema.Literals(['Person', 'Organization', 'LocalBusiness'])\n\nexport type IdentityType = typeof IdentityType.Type\n\nconst identityFields = {\n name: Schema.NonEmptyString,\n url: Schema.optionalKey(SeoUrl),\n}\n\nconst PersonIdentity = Schema.Struct({\n type: Schema.tag('Person'),\n ...identityFields,\n image: Schema.optionalKey(SeoImage),\n})\n\nconst OrganizationIdentity = Schema.Struct({\n type: Schema.tag('Organization'),\n ...identityFields,\n logo: Schema.optionalKey(SeoImage),\n})\n\nexport const PostalAddress = Schema.Struct({\n streetAddress: Schema.optionalKey(Schema.NonEmptyString),\n addressLocality: Schema.optionalKey(Schema.NonEmptyString),\n addressRegion: Schema.optionalKey(Schema.NonEmptyString),\n postalCode: Schema.optionalKey(Schema.NonEmptyString),\n addressCountry: Schema.optionalKey(Schema.NonEmptyString),\n}).annotate({ identifier: 'PostalAddress' })\n\nexport interface PostalAddress extends Schema.Schema.Type<typeof PostalAddress> {}\n\nconst LocalBusinessIdentity = Schema.Struct({\n type: Schema.tag('LocalBusiness'),\n ...identityFields,\n logo: Schema.optionalKey(SeoImage),\n image: Schema.optionalKey(SeoImage),\n telephone: Schema.optionalKey(Schema.NonEmptyString),\n address: Schema.optionalKey(PostalAddress),\n})\n\nexport const SiteIdentity = Schema.Union([PersonIdentity, OrganizationIdentity, LocalBusinessIdentity]).pipe(\n Schema.toTaggedUnion('type'),\n)\n\nexport type SiteIdentity = typeof SiteIdentity.Type\n\nexport const DocumentSeo = Schema.Struct({\n title: Schema.optionalKey(Schema.NonEmptyString),\n description: Schema.optionalKey(Schema.NonEmptyString),\n socialTitle: Schema.optionalKey(Schema.NonEmptyString),\n socialDescription: Schema.optionalKey(Schema.NonEmptyString),\n socialImage: Schema.optionalKey(SeoImage),\n index: Schema.optionalKey(Schema.Boolean),\n follow: Schema.optionalKey(Schema.Boolean),\n canonicalUrl: Schema.optionalKey(SeoUrl),\n structuredData: Schema.optionalKey(DocumentStructuredData),\n}).annotate({ identifier: 'DocumentSeo' })\n\nexport interface DocumentSeo extends Schema.Schema.Type<typeof DocumentSeo> {}\n\nexport const GlobalSeoSettings = Schema.Struct({\n siteName: Schema.NonEmptyString,\n defaultDescription: Schema.optionalKey(Schema.NonEmptyString),\n canonicalOrigin: SeoCanonicalOrigin,\n titleTemplate: Schema.optionalKey(Schema.NonEmptyString.check(titleTemplate)),\n socialTitle: Schema.optionalKey(Schema.NonEmptyString),\n socialDescription: Schema.optionalKey(Schema.NonEmptyString),\n socialImage: Schema.optionalKey(SeoImage),\n index: Schema.Boolean,\n follow: Schema.Boolean,\n identity: Schema.optionalKey(SiteIdentity),\n}).annotate({ identifier: 'GlobalSeoSettings' })\n\nexport interface GlobalSeoSettings extends Schema.Schema.Type<typeof GlobalSeoSettings> {}\n\nexport const SeoCapabilities = Schema.Struct({\n structuredDataTypes: Schema.Array(StructuredDataType),\n identityTypes: Schema.Array(IdentityType),\n generatedSocialImageTemplateIds: Schema.Array(Schema.NonEmptyString),\n}).annotate({ identifier: 'SeoCapabilities' })\n\nexport interface SeoCapabilities extends Schema.Schema.Type<typeof SeoCapabilities> {}\n\nexport const SeoConfiguration = Schema.Struct({\n defaults: GlobalSeoSettings,\n capabilities: SeoCapabilities,\n}).annotate({ identifier: 'SeoConfiguration' })\n\nexport interface SeoConfiguration extends Schema.Schema.Type<typeof SeoConfiguration> {}\n\nexport const ResolvedSeo = Schema.Struct({\n title: Schema.NonEmptyString,\n description: Schema.optionalKey(Schema.NonEmptyString),\n socialTitle: Schema.NonEmptyString,\n socialDescription: Schema.optionalKey(Schema.NonEmptyString),\n socialImage: Schema.optionalKey(SeoImage),\n canonicalUrl: SeoUrl,\n index: Schema.Boolean,\n follow: Schema.Boolean,\n structuredData: Schema.optionalKey(DocumentStructuredData),\n identity: Schema.optionalKey(SiteIdentity),\n}).annotate({ identifier: 'ResolvedSeo' })\n\nexport interface ResolvedSeo extends Schema.Schema.Type<typeof ResolvedSeo> {}\n\nexport const SeoVersion = Schema.NonEmptyString.pipe(Schema.brand('SeoVersion'))\n\nexport type SeoVersion = typeof SeoVersion.Type\n\nexport const SeoRevisionId = Schema.String.check(Schema.isUUID()).pipe(Schema.brand('SeoRevisionId'))\n\nexport type SeoRevisionId = typeof SeoRevisionId.Type\n\nexport const SeoRevision = Schema.Struct({\n revisionId: SeoRevisionId,\n version: SeoVersion,\n settings: GlobalSeoSettings,\n editedBy: StudioActor,\n editedAt: Schema.DateTimeUtcFromString,\n}).annotate({ identifier: 'SeoRevision' })\n\nexport interface SeoRevision extends Schema.Schema.Type<typeof SeoRevision> {}\n\nexport const SeoState = Schema.Struct({\n working: SeoRevision,\n published: Schema.optionalKey(SeoRevision),\n capabilities: SeoCapabilities,\n}).annotate({ identifier: 'SeoState' })\n\nexport interface SeoState extends Schema.Schema.Type<typeof SeoState> {}\n\nexport const SeoSnapshot = Schema.Struct({\n revision: SeoRevision,\n capabilities: SeoCapabilities,\n}).annotate({ identifier: 'SeoSnapshot' })\n\nexport interface SeoSnapshot extends Schema.Schema.Type<typeof SeoSnapshot> {}\n\nconst mutationMetadata = {\n reason: Schema.optionalKey(Schema.NonEmptyString.check(Schema.isMaxLength(1_000))),\n confirmedSiteWideChange: Schema.optionalKey(Schema.Boolean),\n}\n\nexport const SaveSeoInput = Schema.Struct({\n expectedVersion: SeoVersion,\n settings: GlobalSeoSettings,\n ...mutationMetadata,\n}).annotate({ identifier: 'SaveSeoInput' })\n\nexport interface SaveSeoInput extends Schema.Schema.Type<typeof SaveSeoInput> {}\n\nexport const PublishSeoInput = Schema.Struct({\n expectedVersion: SeoVersion,\n ...mutationMetadata,\n}).annotate({ identifier: 'PublishSeoInput' })\n\nexport interface PublishSeoInput extends Schema.Schema.Type<typeof PublishSeoInput> {}\n\nexport const SeoMutationResult = Schema.Struct({\n action: Schema.Literals(['seo.save', 'seo.publish']),\n state: SeoState,\n}).annotate({ identifier: 'SeoMutationResult' })\n\nexport interface SeoMutationResult extends Schema.Schema.Type<typeof SeoMutationResult> {}\n\nexport const SitemapAlternative = Schema.Struct({\n locale: Locale,\n loc: PublicPath,\n}).annotate({ identifier: 'SitemapAlternative' })\n\nexport interface SitemapAlternative extends Schema.Schema.Type<typeof SitemapAlternative> {}\n\nexport const SitemapEntry = Schema.Struct({\n loc: PublicPath,\n lastmod: Schema.DateTimeUtcFromString,\n alternatives: Schema.optionalKey(Schema.Array(SitemapAlternative)),\n}).annotate({ identifier: 'SitemapEntry' })\n\nexport interface SitemapEntry extends Schema.Schema.Type<typeof SitemapEntry> {}\n\nexport const SeoConfirmationChange = Schema.Literals(['canonicalOrigin', 'indexability'])\n\nexport type SeoConfirmationChange = typeof SeoConfirmationChange.Type\n\nexport class SeoVersionConflict extends Schema.TaggedError<SeoVersionConflict>()('Seo.VersionConflict', {\n expectedVersion: SeoVersion,\n actualVersion: SeoVersion,\n}) {}\n\nexport class SeoConfirmationRequired extends Schema.TaggedError<SeoConfirmationRequired>()('Seo.ConfirmationRequired', {\n changes: Schema.Array(SeoConfirmationChange),\n}) {}\n\nexport class SeoMediaUnavailable extends Schema.TaggedError<SeoMediaUnavailable>()('Seo.MediaUnavailable', {\n mediaId: MediaId,\n}) {}\n","import { Schema } from 'effect'\nimport { StudioActor } from '../../AccessControl'\nimport { CollectionName, Locale } from '../configuration/scalars'\nimport { nonNegativeInt } from '../scalars'\nimport { DocumentSeo, ResolvedSeo } from '../../Seo'\nimport {\n DocumentGeneration,\n DocumentVersion,\n DocumentId,\n PublicPath,\n RelativeDocumentPath,\n RevisionId,\n Slug,\n SourcePath,\n} from './scalars'\n\nexport const DocumentIssueCode = Schema.Literals([\n 'document.collision',\n 'document.id',\n 'document.invalid',\n 'i18n.missing-translation',\n 'markdown.parse',\n 'reference.document',\n 'reference.component',\n 'seo.invalid',\n 'schema.option',\n 'schema.constraint',\n 'schema.required',\n 'schema.type',\n 'schema.unknown',\n])\n\nexport type DocumentIssueCode = typeof DocumentIssueCode.Type\n\nexport const DocumentIssue = Schema.Struct({\n code: DocumentIssueCode,\n severity: Schema.Literals(['error', 'warning']),\n message: Schema.NonEmptyString,\n sourcePath: Schema.optionalKey(SourcePath),\n collection: Schema.optionalKey(CollectionName),\n field: Schema.optionalKey(Schema.NonEmptyString),\n key: Schema.optionalKey(PublicPath),\n locale: Schema.optionalKey(Locale),\n}).annotate({ identifier: 'DocumentIssue' })\n\nexport interface DocumentIssue extends Schema.Schema.Type<typeof DocumentIssue> {}\n\nexport const DocumentSourcePoint = Schema.Struct({\n offset: nonNegativeInt,\n line: nonNegativeInt,\n column: nonNegativeInt,\n})\n\nexport interface DocumentSourcePoint extends Schema.Schema.Type<typeof DocumentSourcePoint> {}\n\nexport const DocumentSourceRange = Schema.Struct({\n start: DocumentSourcePoint,\n end: DocumentSourcePoint,\n})\n\nexport interface DocumentSourceRange extends Schema.Schema.Type<typeof DocumentSourceRange> {}\n\nexport const DocumentSourceMapping = Schema.Struct({\n nodePath: Schema.Array(nonNegativeInt),\n range: DocumentSourceRange,\n})\n\nexport interface DocumentSourceMapping extends Schema.Schema.Type<typeof DocumentSourceMapping> {}\n\nexport type MarkdownNode =\n | string\n | readonly [null, Schema.JsonObject, string]\n | readonly [string, Schema.JsonObject, ...MarkdownNode[]]\n\nexport const MarkdownNode: Schema.Codec<MarkdownNode> = Schema.suspend(() =>\n Schema.Union([\n Schema.String,\n Schema.Tuple([Schema.Null, Schema.JsonObject, Schema.String]),\n Schema.TupleWithRest(Schema.Tuple([Schema.NonEmptyString, Schema.JsonObject]), [MarkdownNode]),\n ]),\n)\n\nexport const CmsMarkdownDocument = Schema.Struct({\n nodes: Schema.Array(MarkdownNode),\n frontmatter: Schema.JsonObject,\n meta: Schema.JsonObject,\n}).annotate({ identifier: 'CmsMarkdownDocument' })\n\nexport interface CmsMarkdownDocument extends Schema.Schema.Type<typeof CmsMarkdownDocument> {}\n\nexport const CmsDocumentHeading = Schema.Struct({\n depth: Schema.Int.check(Schema.isBetween({ minimum: 1, maximum: 6 })),\n id: Schema.String,\n text: Schema.String,\n})\n\nexport interface CmsDocumentHeading extends Schema.Schema.Type<typeof CmsDocumentHeading> {}\n\nexport const CmsDocumentAnalysis = Schema.Struct({\n components: Schema.Array(Schema.NonEmptyString),\n headings: Schema.Array(CmsDocumentHeading),\n searchText: Schema.String,\n summary: Schema.String,\n})\n\nexport interface CmsDocumentAnalysis extends Schema.Schema.Type<typeof CmsDocumentAnalysis> {}\n\nexport const CompiledDocumentSource = Schema.Struct({\n path: SourcePath,\n mappings: Schema.Array(DocumentSourceMapping),\n publishedAt: Schema.optionalKey(Schema.DateTimeUtcFromString),\n})\n\nexport interface CompiledDocumentSource extends Schema.Schema.Type<typeof CompiledDocumentSource> {}\n\nexport const DocumentAlternative = Schema.Struct({\n locale: Locale,\n path: PublicPath,\n})\n\nexport interface DocumentAlternative extends Schema.Schema.Type<typeof DocumentAlternative> {}\n\nexport const CompiledDocument = Schema.Struct({\n id: DocumentId,\n key: PublicPath,\n path: PublicPath,\n locale: Schema.optionalKey(Locale),\n collection: CollectionName,\n draft: Schema.Boolean,\n title: Schema.NonEmptyString,\n description: Schema.optionalKey(Schema.String),\n seo: Schema.optionalKey(DocumentSeo),\n resolvedSeo: Schema.optionalKey(ResolvedSeo),\n alternatives: Schema.optionalKey(Schema.Array(DocumentAlternative)),\n data: Schema.JsonObject,\n issues: Schema.Array(DocumentIssue),\n analysis: CmsDocumentAnalysis,\n body: CmsMarkdownDocument,\n engineFingerprint: Schema.NonEmptyString,\n source: CompiledDocumentSource,\n}).annotate({ identifier: 'CompiledDocument' })\n\nexport interface CompiledDocument extends Schema.Schema.Type<typeof CompiledDocument> {}\n\nconst documentAttribution = {\n createdBy: Schema.optionalKey(StudioActor),\n editedBy: Schema.optionalKey(StudioActor),\n editedAt: Schema.optionalKey(Schema.DateTimeUtcFromString),\n}\n\nexport const DocumentSource = Schema.Struct({\n ...documentAttribution,\n documentId: DocumentId,\n sourcePath: SourcePath,\n markdown: Schema.String,\n revisionId: RevisionId,\n version: DocumentVersion,\n publishedVersion: Schema.optionalKey(DocumentVersion),\n}).annotate({ identifier: 'DocumentSource' })\n\nexport interface DocumentSource extends Schema.Schema.Type<typeof DocumentSource> {}\n\nexport const DocumentSummary = Schema.Struct({\n ...documentAttribution,\n publishedVersion: Schema.optionalKey(DocumentVersion),\n publishedPath: Schema.optionalKey(PublicPath),\n sourcePath: SourcePath,\n version: DocumentVersion,\n document: CompiledDocument,\n}).annotate({ identifier: 'DocumentSummary' })\n\nexport interface DocumentSummary extends Schema.Schema.Type<typeof DocumentSummary> {}\n\nexport const DeletedDocument = Schema.Struct({\n title: Schema.optionalKey(Schema.String),\n path: Schema.optionalKey(PublicPath),\n trashBatchId: Schema.optionalKey(DocumentVersion),\n documentId: DocumentId,\n deletedAt: Schema.DateTimeUtcFromString,\n sourcePath: SourcePath,\n version: DocumentVersion,\n}).annotate({ identifier: 'DeletedDocument' })\n\nexport interface DeletedDocument extends Schema.Schema.Type<typeof DeletedDocument> {}\n\nexport const DocumentBrowseQuery = Schema.Struct({\n collection: Schema.optionalKey(CollectionName),\n locale: Schema.optionalKey(Locale),\n}).annotate({ identifier: 'DocumentBrowseQuery' })\n\nexport interface DocumentBrowseQuery extends Schema.Schema.Type<typeof DocumentBrowseQuery> {}\n\nexport const PublishedDocumentLookup = Schema.Union([\n Schema.Struct({\n kind: Schema.tag('id'),\n documentId: DocumentId,\n }),\n Schema.Struct({\n kind: Schema.tag('path'),\n path: PublicPath,\n }),\n Schema.Struct({\n kind: Schema.tag('key'),\n key: PublicPath,\n collection: Schema.optionalKey(CollectionName),\n locale: Schema.optionalKey(Locale),\n }),\n]).pipe(Schema.toTaggedUnion('kind'))\n\nexport type PublishedDocumentLookup = typeof PublishedDocumentLookup.Type\n\nexport const DocumentQueryScalar = Schema.Union([Schema.String, Schema.Finite, Schema.Boolean, Schema.Null])\n\nexport type DocumentQueryScalar = typeof DocumentQueryScalar.Type\n\nconst validDocumentQueryField = Schema.makeFilter<string>(\n (field) => {\n const segments = field.split('.')\n\n return field.length <= 200 && segments.length <= 8 && segments.every((segment) => segment.length > 0)\n },\n { expected: 'a non-empty field path of at most 200 characters and eight non-empty segments' },\n)\n\nexport const DocumentQueryField = Schema.NonEmptyString.check(validDocumentQueryField)\n\nexport type DocumentQueryField = typeof DocumentQueryField.Type\n\nexport const DocumentQueryValue = Schema.Union([\n DocumentQueryScalar,\n Schema.Array(DocumentQueryScalar).check(Schema.isMaxLength(20)),\n])\n\nexport type DocumentQueryValue = typeof DocumentQueryValue.Type\n\nexport const DocumentQuerySort = Schema.Struct({\n field: DocumentQueryField,\n direction: Schema.optionalKey(Schema.Literals(['asc', 'desc'])),\n})\n\nexport interface DocumentQuerySort extends Schema.Schema.Type<typeof DocumentQuerySort> {}\n\nconst DocumentQueryWhere = Schema.Record(Schema.String, DocumentQueryValue).check(\n Schema.makeFilter((where) => Object.keys(where).every((field) => Schema.is(DocumentQueryField)(field)), {\n expected: 'document query keys with valid bounded field paths',\n }),\n Schema.makeFilter((where) => Object.keys(where).length <= 12, {\n expected: 'at most 12 document query filters',\n }),\n)\n\nexport const PublishedDocumentSelection = Schema.Struct({\n collection: Schema.optionalKey(CollectionName),\n locale: Schema.optionalKey(Locale),\n where: Schema.optionalKey(DocumentQueryWhere),\n sort: Schema.optionalKey(Schema.Array(DocumentQuerySort).check(Schema.isMaxLength(4))),\n}).annotate({ identifier: 'PublishedDocumentSelection' })\n\nexport interface PublishedDocumentSelection extends Schema.Schema.Type<typeof PublishedDocumentSelection> {}\n\nexport const PublishedDocumentQuery = Schema.Struct({\n ...PublishedDocumentSelection.fields,\n offset: Schema.optionalKey(nonNegativeInt),\n limit: Schema.Int.check(Schema.isBetween({ minimum: 1, maximum: 100 })),\n}).annotate({ identifier: 'PublishedDocumentQuery' })\n\nexport interface PublishedDocumentQuery extends Schema.Schema.Type<typeof PublishedDocumentQuery> {}\n\nexport const PublishedDocumentSurroundQuery = Schema.Struct({\n ...PublishedDocumentSelection.fields,\n}).annotate({ identifier: 'PublishedDocumentSurroundQuery' })\n\nexport interface PublishedDocumentSurroundQuery extends Schema.Schema.Type<typeof PublishedDocumentSurroundQuery> {}\n\nexport const PublishedDocumentPage = Schema.Struct({\n items: Schema.Array(CompiledDocument),\n total: nonNegativeInt,\n}).annotate({ identifier: 'PublishedDocumentPage' })\n\nexport interface PublishedDocumentPage extends Schema.Schema.Type<typeof PublishedDocumentPage> {}\n\nexport const DocumentNavigationQuery = Schema.Struct({\n collection: Schema.optionalKey(CollectionName),\n locale: Schema.optionalKey(Locale),\n}).annotate({ identifier: 'DocumentNavigationQuery' })\n\nexport interface DocumentNavigationQuery extends Schema.Schema.Type<typeof DocumentNavigationQuery> {}\n\nconst documentMutationMetadata = {\n reason: Schema.optionalKey(Schema.NonEmptyString.check(Schema.isMaxLength(1_000))),\n}\n\nexport interface DocumentNavigationItem {\n readonly key: PublicPath\n readonly title: string\n readonly path?: PublicPath\n readonly locale?: Locale\n readonly documentId?: DocumentId\n readonly children: ReadonlyArray<DocumentNavigationItem>\n}\n\ninterface DocumentNavigationItemEncoded {\n readonly key: string\n readonly title: string\n readonly path?: string\n readonly locale?: string\n readonly documentId?: string\n readonly children: ReadonlyArray<DocumentNavigationItemEncoded>\n}\n\nexport const DocumentNavigationItem: Schema.Codec<DocumentNavigationItem, DocumentNavigationItemEncoded> =\n Schema.suspend(() =>\n Schema.Struct({\n key: PublicPath,\n title: Schema.NonEmptyString,\n path: Schema.optionalKey(PublicPath),\n locale: Schema.optionalKey(Locale),\n documentId: Schema.optionalKey(DocumentId),\n children: Schema.Array(DocumentNavigationItem),\n }),\n )\n\nexport const DocumentSurround = Schema.Struct({\n previous: Schema.NullOr(CompiledDocument),\n next: Schema.NullOr(CompiledDocument),\n}).annotate({ identifier: 'DocumentSurround' })\n\nexport interface DocumentSurround extends Schema.Schema.Type<typeof DocumentSurround> {}\n\nexport const HomeDocumentLocation = Schema.Struct({\n kind: Schema.tag('home'),\n})\n\nexport interface HomeDocumentLocation extends Schema.Schema.Type<typeof HomeDocumentLocation> {}\n\nexport const NestedDocumentLocation = Schema.Struct({\n kind: Schema.tag('entry'),\n parent: Schema.optionalKey(RelativeDocumentPath),\n slug: Slug,\n})\n\nexport interface NestedDocumentLocation extends Schema.Schema.Type<typeof NestedDocumentLocation> {}\n\nexport const DocumentLocation = Schema.Union([HomeDocumentLocation, NestedDocumentLocation]).pipe(\n Schema.toTaggedUnion('kind'),\n)\n\nexport type DocumentLocation = typeof DocumentLocation.Type\n\nexport const CreateDocumentInput = Schema.Struct({\n collection: CollectionName,\n locale: Schema.optionalKey(Locale),\n location: DocumentLocation,\n title: Schema.NonEmptyString,\n ...documentMutationMetadata,\n}).annotate({ identifier: 'CreateDocumentInput' })\n\nexport interface CreateDocumentInput extends Schema.Schema.Type<typeof CreateDocumentInput> {}\n\nexport const UpdateDocumentInput = Schema.Struct({\n documentId: DocumentId,\n expectedVersion: DocumentVersion,\n markdown: Schema.String,\n ...documentMutationMetadata,\n}).annotate({ identifier: 'UpdateDocumentInput' })\n\nexport interface UpdateDocumentInput extends Schema.Schema.Type<typeof UpdateDocumentInput> {}\n\nexport const MoveDocumentInput = Schema.Struct({\n documentId: DocumentId,\n expectedVersion: DocumentVersion,\n location: DocumentLocation,\n ...documentMutationMetadata,\n}).annotate({ identifier: 'MoveDocumentInput' })\n\nexport interface MoveDocumentInput extends Schema.Schema.Type<typeof MoveDocumentInput> {}\n\nexport const DuplicateDocumentInput = Schema.Struct({\n ...MoveDocumentInput.fields,\n includeChildren: Schema.Boolean,\n}).annotate({ identifier: 'DuplicateDocumentInput' })\n\nexport interface DuplicateDocumentInput extends Schema.Schema.Type<typeof DuplicateDocumentInput> {}\n\nexport const UnpublishDocumentInput = Schema.Struct({\n documentId: DocumentId,\n expectedVersion: DocumentVersion,\n ...documentMutationMetadata,\n}).annotate({ identifier: 'UnpublishDocumentInput' })\n\nexport interface UnpublishDocumentInput extends Schema.Schema.Type<typeof UnpublishDocumentInput> {}\n\nexport const RemoveDocumentInput = Schema.Struct({\n documentId: DocumentId,\n expectedVersion: DocumentVersion,\n ...documentMutationMetadata,\n}).annotate({ identifier: 'RemoveDocumentInput' })\n\nexport interface RemoveDocumentInput extends Schema.Schema.Type<typeof RemoveDocumentInput> {}\n\nexport const PublishDocumentInput = Schema.Struct({\n documentId: DocumentId,\n expectedVersion: DocumentVersion,\n ...documentMutationMetadata,\n}).annotate({ identifier: 'PublishDocumentInput' })\n\nexport interface PublishDocumentInput extends Schema.Schema.Type<typeof PublishDocumentInput> {}\n\nexport const RestoreDocumentInput = Schema.Struct({\n documentId: DocumentId,\n revisionId: RevisionId,\n expectedVersion: DocumentVersion,\n ...documentMutationMetadata,\n}).annotate({ identifier: 'RestoreDocumentInput' })\n\nexport interface RestoreDocumentInput extends Schema.Schema.Type<typeof RestoreDocumentInput> {}\n\nexport const UndeleteDocumentInput = Schema.Struct({\n documentId: DocumentId,\n expectedVersion: DocumentVersion,\n ...documentMutationMetadata,\n}).annotate({ identifier: 'UndeleteDocumentInput' })\n\nexport interface UndeleteDocumentInput extends Schema.Schema.Type<typeof UndeleteDocumentInput> {}\n\nexport const DOCUMENT_REVISION_ACTIONS = [\n 'document.create',\n 'document.move',\n 'document.remove',\n 'document.restore',\n 'document.undelete',\n 'document.update',\n] as const\n\nexport const DocumentRevisionAction = Schema.Literals(DOCUMENT_REVISION_ACTIONS)\n\nexport type DocumentRevisionAction = typeof DocumentRevisionAction.Type\n\nexport const DocumentMutationAction = Schema.Literals([\n ...DOCUMENT_REVISION_ACTIONS,\n 'document.publish',\n 'document.unpublish',\n])\n\nexport type DocumentMutationAction = typeof DocumentMutationAction.Type\n\nexport const DocumentMutationResult = Schema.Struct({\n action: DocumentMutationAction,\n affectedDocumentIds: Schema.optionalKey(Schema.Array(DocumentId)),\n documentId: DocumentId,\n generation: DocumentGeneration,\n revisionId: RevisionId,\n sourcePath: SourcePath,\n version: DocumentVersion,\n entry: Schema.optionalKey(DocumentSummary),\n}).annotate({ identifier: 'DocumentMutationResult' })\n\nexport interface DocumentMutationResult extends Schema.Schema.Type<typeof DocumentMutationResult> {}\n\nexport const DocumentValidationResult = Schema.Struct({\n valid: Schema.Boolean,\n document: Schema.optionalKey(CompiledDocument),\n issues: Schema.Array(DocumentIssue),\n}).annotate({ identifier: 'DocumentValidationResult' })\n\nexport interface DocumentValidationResult extends Schema.Schema.Type<typeof DocumentValidationResult> {}\n"],"mappings":";;;;AAEA,MAAa,YAAY,OAAO,OAAO,MAAM,OAAO,OAAO,CAAC,CAAC,CAAC,KAAK,OAAO,MAAM,WAAW,CAAC;;;;ACC5F,MAAM,wBAAwB;AAE9B,MAAM,gBAAgB;AAEtB,MAAM,yBAAyB;AAE/B,MAAa,iBAAiB,OAAO,OAAO,MAAM,OAAO,UAAU,iBAAiB,CAAC,CAAC,CAAC,KACrF,OAAO,MAAM,gBAAgB,CAC/B;AAIA,MAAa,iBAAiB,OAAO,OAAO,MAAM,OAAO,UAAU,qBAAqB,CAAC,CAAC,CAAC,KACzF,OAAO,MAAM,gBAAgB,CAC/B;AAIA,MAAa,SAAS,OAAO,OAAO,MAAM,OAAO,UAAU,aAAa,CAAC,CAAC,CAAC,KAAK,OAAO,MAAM,QAAQ,CAAC;AAItG,MAAa,kBAAkB,OAAO,OAAO,MAAM,OAAO,UAAU,sBAAsB,CAAC,CAA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AY,OAAO,MAAM,UAAU,CAAC;CAChE,YAAY;CACZ,YAAY;CACZ,YAAY;CACZ,YAAY;CACZ,SAAS;CACT,OAAO,OAAO,YAAY,eAAe;AAC3C,CAAC,CAAC,CAAC,SAAS,EAAE,YAAY,yBAAyB,CAAC;AAIpD,MAAa,2BAA2B,OAAO,OAAO;CACpD,OAAO,OAAO;CACd,UAAU,OAAO,YAAY,gBAAgB;CAC7C,QAAQ,OAAO,MAAM,aAAa;AACpC,CAAC,CAAC,CAAC,SAAS,EAAE,YAAY,2BAA2B,CAAC"}
@@ -1,5 +1,5 @@
1
1
  import { a as EditorNodeId, l as RevisionNumber, o as PublicPath, r as DocumentId } from "./scalars-B2lgGUnj.js";
2
- import { Ct as CollectionName, Et as RequestId, r as CompiledDocument } from "./models-Bah5B3bT.js";
2
+ import { Ct as CollectionName, Et as RequestId, r as CompiledDocument } from "./models-DgkGTFus.js";
3
3
  import { Schema } from "effect";
4
4
 
5
5
  //#region ../protocol/src/internal/preview/models.ts
@@ -128,4 +128,4 @@ const isDocumentPreviewMessage = Schema.is(DocumentPreviewMessage);
128
128
 
129
129
  //#endregion
130
130
  export { PreviewSessionId as a, PreviewOrigin as i, DocumentPreviewMessage as n, isDocumentPreviewMessage as o, PreviewIntentId as r, DOCUMENT_PREVIEW_CHANNEL as t };
131
- //# sourceMappingURL=models-B4IoTmp7.js.map
131
+ //# sourceMappingURL=models-k2nXyD6q.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"models-B4IoTmp7.js","names":[],"sources":["../../../../protocol/src/internal/preview/models.ts"],"sourcesContent":["import { CompiledDocument } from '../../Documents'\nimport { RequestId } from '../../Identity'\nimport { CollectionName } from '../configuration/scalars'\nimport { DocumentId, EditorNodeId, PublicPath, RevisionNumber } from '../documents/scalars'\nimport { Schema } from 'effect'\n\nexport const DOCUMENT_PREVIEW_CHANNEL = 'cms:document-preview'\n\nexport const PreviewSessionId = Schema.String.check(Schema.isUUID()).pipe(Schema.brand('PreviewSessionId'))\n\nexport type PreviewSessionId = typeof PreviewSessionId.Type\n\nexport const PreviewIntentId = Schema.String.check(Schema.isUUID()).pipe(Schema.brand('PreviewIntentId'))\n\nexport type PreviewIntentId = typeof PreviewIntentId.Type\n\nconst exactOrigin = Schema.makeFilter<string>(\n (value) => {\n try {\n const url = new URL(value)\n\n return (url.protocol === 'http:' || url.protocol === 'https:') && url.origin === value\n } catch {\n return false\n }\n },\n { expected: 'an exact HTTP or HTTPS origin without a path' },\n)\n\nexport const PreviewOrigin = Schema.NonEmptyString.check(exactOrigin).pipe(Schema.brand('PreviewOrigin'))\n\nexport type PreviewOrigin = typeof PreviewOrigin.Type\n\nexport const DocumentPreviewFocusIntent = Schema.Struct({\n id: PreviewIntentId,\n documentId: DocumentId,\n nodeId: Schema.optionalKey(EditorNodeId),\n origin: Schema.Literals(['editor', 'preview']),\n reveal: Schema.Boolean,\n revision: RevisionNumber,\n})\n\nexport interface DocumentPreviewFocusIntent extends Schema.Schema.Type<typeof DocumentPreviewFocusIntent> {}\n\nexport const RenderedCompiledDocument = Schema.Struct({\n collection: CollectionName,\n documentId: DocumentId,\n path: PublicPath,\n role: Schema.Literals(['embedded', 'primary', 'related', 'summary']),\n title: Schema.NonEmptyString,\n})\n\nexport interface RenderedCompiledDocument extends Schema.Schema.Type<typeof RenderedCompiledDocument> {}\n\nexport const RenderedDocumentManifest = Schema.Struct({\n documents: Schema.Array(RenderedCompiledDocument),\n route: PublicPath,\n})\n\nexport interface RenderedDocumentManifest extends Schema.Schema.Type<typeof RenderedDocumentManifest> {}\n\nconst previewEnvelope = {\n channel: Schema.Literal(DOCUMENT_PREVIEW_CHANNEL),\n sessionId: PreviewSessionId,\n}\n\nconst StudioConnectMessage = Schema.Struct({\n ...previewEnvelope,\n type: Schema.tag('studio:connect'),\n})\n\nconst StudioModeMessage = Schema.Struct({\n ...previewEnvelope,\n type: Schema.tag('studio:mode'),\n mode: Schema.Literals(['browse', 'edit']),\n})\n\nconst StudioNavigateMessage = Schema.Struct({\n ...previewEnvelope,\n type: Schema.tag('studio:navigate'),\n path: PublicPath,\n})\n\nconst StudioPatchMessage = Schema.Struct({\n ...previewEnvelope,\n type: Schema.tag('studio:patch'),\n document: CompiledDocument,\n fallbacks: Schema.Record(Schema.String, Schema.String),\n focus: Schema.optionalKey(DocumentPreviewFocusIntent),\n revision: RevisionNumber,\n})\n\nconst StudioFocusMessage = Schema.Struct({\n ...previewEnvelope,\n type: Schema.tag('studio:focus'),\n focus: DocumentPreviewFocusIntent,\n})\n\nconst PreviewReadyMessage = Schema.Struct({\n ...previewEnvelope,\n type: Schema.tag('preview:ready'),\n path: PublicPath,\n})\n\nconst PreviewManifestMessage = Schema.Struct({\n ...previewEnvelope,\n type: Schema.tag('preview:manifest'),\n manifest: RenderedDocumentManifest,\n revision: RevisionNumber,\n})\n\nconst PreviewActivateMessage = Schema.Struct({\n ...previewEnvelope,\n type: Schema.tag('preview:activate'),\n documentId: DocumentId,\n field: Schema.optionalKey(Schema.NonEmptyString),\n nodeId: Schema.optionalKey(EditorNodeId),\n requestId: RequestId,\n revision: RevisionNumber,\n})\n\nconst PreviewAppliedMessage = Schema.Struct({\n ...previewEnvelope,\n type: Schema.tag('preview:applied'),\n intentId: PreviewIntentId,\n nodeId: Schema.optionalKey(EditorNodeId),\n result: Schema.Literals(['exact', 'fallback', 'missing']),\n revision: RevisionNumber,\n})\n\nconst PreviewRenderedMessage = Schema.Struct({\n ...previewEnvelope,\n type: Schema.tag('preview:rendered'),\n revision: RevisionNumber,\n})\n\nexport const DocumentPreviewMessage = Schema.Union([\n StudioConnectMessage,\n StudioModeMessage,\n StudioNavigateMessage,\n StudioPatchMessage,\n StudioFocusMessage,\n PreviewReadyMessage,\n Schema.Struct({ ...previewEnvelope, type: Schema.tag('preview:error'), message: Schema.NullOr(Schema.String) }),\n PreviewManifestMessage,\n PreviewActivateMessage,\n PreviewAppliedMessage,\n PreviewRenderedMessage,\n]).pipe(Schema.toTaggedUnion('type'))\n\nexport type DocumentPreviewMessage = typeof DocumentPreviewMessage.Type\n\nexport const isDocumentPreviewMessage = Schema.is(DocumentPreviewMessage)\n\ntype PreviewPayload<Message extends DocumentPreviewMessage> = Message extends DocumentPreviewMessage\n ? Omit<Message, 'channel' | 'sessionId'>\n : never\n\nexport type StudioPreviewPayload = PreviewPayload<\n Extract<DocumentPreviewMessage, { readonly type: `studio:${string}` }>\n>\n\nexport type PreviewSitePayload = PreviewPayload<Extract<DocumentPreviewMessage, { readonly type: `preview:${string}` }>>\n"],"mappings":";;;;;AAMA,MAAa,2BAA2B;AAExC,MAAa,mBAAmB,OAAO,OAAO,MAAM,OAAO,OAAO,CAAC,CAAC,CAAC,KAAK,OAAO,MAAM,kBAAkB,CAAC;AAI1G,MAAa,kBAAkB,OAAO,OAAO,MAAM,OAAO,OAAO,CAAC,CAAC,CAAC,KAAK,OAAO,MAAM,iBAAiB,CAAC;AAIxG,MAAM,cAAc,OAAO,YACxB,UAAU;CACT,IAAI;EACF,MAAM,MAAM,IAAI,IAAI,KAAK;EAEzB,QAAQ,IAAI,aAAa,WAAW,IAAI,aAAa,aAAa,IAAI,WAAW;CACnF,QAAQ;EACN,OAAO;CACT;AACF,GACA,EAAE,UAAU,+CAA+C,CAC7D;AAEA,MAAa,gBAAgB,OAAO,eAAe,MAAM,WAAW,CAAC,CAAC,KAAK,OAAO,MAAM,eAAe,CAAC;AAIxG,MAAa,6BAA6B,OAAO,OAAO;CACtD,IAAI;CACJ,YAAY;CACZ,QAAQ,OAAO,YAAY,YAAY;CACvC,QAAQ,OAAO,SAAS,CAAC,UAAU,SAAS,CAAC;CAC7C,QAAQ,OAAO;CACf,UAAU;AACZ,CAAC;AAID,MAAa,2BAA2B,OAAO,OAAO;CACpD,YAAY;CACZ,YAAY;CACZ,MAAM;CACN,MAAM,OAAO,SAAS;EAAC;EAAY;EAAW;EAAW;CAAS,CAAC;CACnE,OAAO,OAAO;AAChB,CAAC;AAID,MAAa,2BAA2B,OAAO,OAAO;CACpD,WAAW,OA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;CACvC,QAAQ,OAAO,SAAS;EAAC;EAAS;EAAY;CAAS,CAAC;CACxD,UAAU;AACZ,CAAC;AAED,MAAM,yBAAyB,OAAO,OAAO;CAC3C,GAAG;CACH,MAAM,OAAO,IAAI,kBAAkB;CACnC,UAAU;AACZ,CAAC;AAED,MAAa,yBAAyB,OAAO,MAAM;CACjD;CACA;CACA;CACA;CACA;CACA;CACA,OAAO,OAAO;EAAE,GAAG;EAAiB,MAAM,OAAO,IAAI,eAAe;EAAG,SAAS,OAAO,OAAO,OAAO,MAAM;CAAE,CAAC;CAC9G;CACA;CACA;CACA;AACF,CAAC,CAAC,CAAC,KAAK,OAAO,cAAc,MAAM,CAAC;AAIpC,MAAa,2BAA2B,OAAO,GAAG,sBAAsB"}
1
+ {"version":3,"file":"models-k2nXyD6q.js","names":[],"sources":["../../../../protocol/src/internal/preview/models.ts"],"sourcesContent":["import { CompiledDocument } from '../../Documents'\nimport { RequestId } from '../../Identity'\nimport { CollectionName } from '../configuration/scalars'\nimport { DocumentId, EditorNodeId, PublicPath, RevisionNumber } from '../documents/scalars'\nimport { Schema } from 'effect'\n\nexport const DOCUMENT_PREVIEW_CHANNEL = 'cms:document-preview'\n\nexport const PreviewSessionId = Schema.String.check(Schema.isUUID()).pipe(Schema.brand('PreviewSessionId'))\n\nexport type PreviewSessionId = typeof PreviewSessionId.Type\n\nexport const PreviewIntentId = Schema.String.check(Schema.isUUID()).pipe(Schema.brand('PreviewIntentId'))\n\nexport type PreviewIntentId = typeof PreviewIntentId.Type\n\nconst exactOrigin = Schema.makeFilter<string>(\n (value) => {\n try {\n const url = new URL(value)\n\n return (url.protocol === 'http:' || url.protocol === 'https:') && url.origin === value\n } catch {\n return false\n }\n },\n { expected: 'an exact HTTP or HTTPS origin without a path' },\n)\n\nexport const PreviewOrigin = Schema.NonEmptyString.check(exactOrigin).pipe(Schema.brand('PreviewOrigin'))\n\nexport type PreviewOrigin = typeof PreviewOrigin.Type\n\nexport const DocumentPreviewFocusIntent = Schema.Struct({\n id: PreviewIntentId,\n documentId: DocumentId,\n nodeId: Schema.optionalKey(EditorNodeId),\n origin: Schema.Literals(['editor', 'preview']),\n reveal: Schema.Boolean,\n revision: RevisionNumber,\n})\n\nexport interface DocumentPreviewFocusIntent extends Schema.Schema.Type<typeof DocumentPreviewFocusIntent> {}\n\nexport const RenderedCompiledDocument = Schema.Struct({\n collection: CollectionName,\n documentId: DocumentId,\n path: PublicPath,\n role: Schema.Literals(['embedded', 'primary', 'related', 'summary']),\n title: Schema.NonEmptyString,\n})\n\nexport interface RenderedCompiledDocument extends Schema.Schema.Type<typeof RenderedCompiledDocument> {}\n\nexport const RenderedDocumentManifest = Schema.Struct({\n documents: Schema.Array(RenderedCompiledDocument),\n route: PublicPath,\n})\n\nexport interface RenderedDocumentManifest extends Schema.Schema.Type<typeof RenderedDocumentManifest> {}\n\nconst previewEnvelope = {\n channel: Schema.Literal(DOCUMENT_PREVIEW_CHANNEL),\n sessionId: PreviewSessionId,\n}\n\nconst StudioConnectMessage = Schema.Struct({\n ...previewEnvelope,\n type: Schema.tag('studio:connect'),\n})\n\nconst StudioModeMessage = Schema.Struct({\n ...previewEnvelope,\n type: Schema.tag('studio:mode'),\n mode: Schema.Literals(['browse', 'edit']),\n})\n\nconst StudioNavigateMessage = Schema.Struct({\n ...previewEnvelope,\n type: Schema.tag('studio:navigate'),\n path: PublicPath,\n})\n\nconst StudioPatchMessage = Schema.Struct({\n ...previewEnvelope,\n type: Schema.tag('studio:patch'),\n document: CompiledDocument,\n fallbacks: Schema.Record(Schema.String, Schema.String),\n focus: Schema.optionalKey(DocumentPreviewFocusIntent),\n revision: RevisionNumber,\n})\n\nconst StudioFocusMessage = Schema.Struct({\n ...previewEnvelope,\n type: Schema.tag('studio:focus'),\n focus: DocumentPreviewFocusIntent,\n})\n\nconst PreviewReadyMessage = Schema.Struct({\n ...previewEnvelope,\n type: Schema.tag('preview:ready'),\n path: PublicPath,\n})\n\nconst PreviewManifestMessage = Schema.Struct({\n ...previewEnvelope,\n type: Schema.tag('preview:manifest'),\n manifest: RenderedDocumentManifest,\n revision: RevisionNumber,\n})\n\nconst PreviewActivateMessage = Schema.Struct({\n ...previewEnvelope,\n type: Schema.tag('preview:activate'),\n documentId: DocumentId,\n field: Schema.optionalKey(Schema.NonEmptyString),\n nodeId: Schema.optionalKey(EditorNodeId),\n requestId: RequestId,\n revision: RevisionNumber,\n})\n\nconst PreviewAppliedMessage = Schema.Struct({\n ...previewEnvelope,\n type: Schema.tag('preview:applied'),\n intentId: PreviewIntentId,\n nodeId: Schema.optionalKey(EditorNodeId),\n result: Schema.Literals(['exact', 'fallback', 'missing']),\n revision: RevisionNumber,\n})\n\nconst PreviewRenderedMessage = Schema.Struct({\n ...previewEnvelope,\n type: Schema.tag('preview:rendered'),\n revision: RevisionNumber,\n})\n\nexport const DocumentPreviewMessage = Schema.Union([\n StudioConnectMessage,\n StudioModeMessage,\n StudioNavigateMessage,\n StudioPatchMessage,\n StudioFocusMessage,\n PreviewReadyMessage,\n Schema.Struct({ ...previewEnvelope, type: Schema.tag('preview:error'), message: Schema.NullOr(Schema.String) }),\n PreviewManifestMessage,\n PreviewActivateMessage,\n PreviewAppliedMessage,\n PreviewRenderedMessage,\n]).pipe(Schema.toTaggedUnion('type'))\n\nexport type DocumentPreviewMessage = typeof DocumentPreviewMessage.Type\n\nexport const isDocumentPreviewMessage = Schema.is(DocumentPreviewMessage)\n\ntype PreviewPayload<Message extends DocumentPreviewMessage> = Message extends DocumentPreviewMessage\n ? Omit<Message, 'channel' | 'sessionId'>\n : never\n\nexport type StudioPreviewPayload = PreviewPayload<\n Extract<DocumentPreviewMessage, { readonly type: `studio:${string}` }>\n>\n\nexport type PreviewSitePayload = PreviewPayload<Extract<DocumentPreviewMessage, { readonly type: `preview:${string}` }>>\n"],"mappings":";;;;;AAMA,MAAa,2BAA2B;AAExC,MAAa,mBAAmB,OAAO,OAAO,MAAM,OAAO,OAAO,CAAC,CAAC,CAAC,KAAK,OAAO,MAA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,MAAa,2BAA2B,OAAO,GAAG,sBAAsB"}
@@ -1,4 +1,4 @@
1
- import { n as readPreviewLocation } from "../../location-BTqdfIzX.js";
1
+ import { n as readPreviewLocation } from "../../location-BgYhXEZp.js";
2
2
  import { useRequestURL, useState } from "nuxt/app";
3
3
 
4
4
  //#region src/runtime/delivery/context.ts
@@ -1,17 +1,33 @@
1
- import { n as readPreviewLocation, t as previewRedirect } from "../../location-BTqdfIzX.js";
1
+ import { n as readPreviewLocation, t as previewRedirect } from "../../location-BgYhXEZp.js";
2
2
  import { usePreviewDelivery } from "./context.js";
3
3
  import { installCmsDocumentSeoAdapters } from "./useCmsDocumentSeo.js";
4
4
  import { localeFromPath } from "../i18n/translator.js";
5
5
  import { computed, watch } from "vue";
6
- import { addRouteMiddleware, defineNuxtPlugin, useHead, useRequestURL, useResponseHeader, useRoute, useSeoMeta } from "nuxt/app";
6
+ import { addRouteMiddleware, defineNuxtPlugin, useHead, useRequestURL, useResponseHeader, useRoute, useSeoMeta, useState } from "nuxt/app";
7
7
  import configuration from "#cms/i18n";
8
- import { useRobotsRule, useSchemaOrg } from "#imports";
8
+ import { updateSiteConfig, useRobotsRule, useSchemaOrg } from "#imports";
9
9
 
10
10
  //#region src/runtime/delivery/plugin.ts
11
11
  var plugin_default = defineNuxtPlugin(() => {
12
+ const route = useRoute();
13
+ const documentLocale = useState("cms-document-locale", () => void 0);
12
14
  if (configuration.defaultLocale) {
13
- const route = useRoute();
14
- useHead({ htmlAttrs: { lang: computed(() => localeFromPath(configuration, route.path)) } });
15
+ const ownsRoute = computed(() => route.name === "cms-document-page");
16
+ const locale = computed(() => documentLocale.value ?? localeFromPath(configuration, route.path));
17
+ watch(() => route.fullPath, () => {
18
+ documentLocale.value = void 0;
19
+ }, { flush: "sync" });
20
+ useHead({ htmlAttrs: { lang: computed(() => ownsRoute.value ? locale.value : void 0) } });
21
+ updateSiteConfig({
22
+ _context: "@phtngyn/cms",
23
+ _priority: 0,
24
+ currentLocale: computed(() => ownsRoute.value ? locale.value : void 0),
25
+ defaultLocale: computed(() => ownsRoute.value ? configuration.defaultLocale : void 0),
26
+ locales: computed(() => ownsRoute.value ? Object.entries(configuration.locales).map(([code, value]) => ({
27
+ code,
28
+ name: value.name
29
+ })) : void 0)
30
+ });
15
31
  }
16
32
  installCmsDocumentSeoAdapters({
17
33
  head: (input) => {
@@ -28,6 +44,12 @@ var plugin_default = defineNuxtPlugin(() => {
28
44
  },
29
45
  seoMeta: (input) => {
30
46
  useSeoMeta(input);
47
+ },
48
+ locale: (input) => {
49
+ watch(input, (value) => documentLocale.value = value, {
50
+ immediate: true,
51
+ flush: "sync"
52
+ });
31
53
  }
32
54
  });
33
55
  const url = useRequestURL();
@@ -1 +1 @@
1
- {"version":3,"file":"plugin.js","names":[],"sources":["../../../../../src/runtime/delivery/plugin.ts"],"sourcesContent":["import configuration from '#cms/i18n'\nimport {\n addRouteMiddleware,\n defineNuxtPlugin,\n useHead,\n useRequestURL,\n useResponseHeader,\n useRoute,\n useSeoMeta,\n} from 'nuxt/app'\nimport { useRobotsRule, useSchemaOrg } from '#imports'\nimport { previewRedirect, readPreviewLocation } from '@internal/protocol/Preview'\nimport { computed, watch } from 'vue'\nimport { usePreviewDelivery } from './context'\nimport { installCmsDocumentSeoAdapters } from './useCmsDocumentSeo'\nimport { localeFromPath } from '../i18n/translator'\n\nexport default defineNuxtPlugin(() => {\n if (configuration.defaultLocale) {\n const route = useRoute()\n\n useHead({ htmlAttrs: { lang: computed(() => localeFromPath(configuration, route.path)) } })\n }\n\n installCmsDocumentSeoAdapters({\n head: (input) => {\n useHead(input)\n },\n robots: (input) => {\n const robots = useRobotsRule(input)\n\n if (import.meta.server) {\n watch(\n input,\n (value) => {\n robots.value = value\n },\n { flush: 'sync' },\n )\n }\n },\n schema: (input) => {\n useSchemaOrg(input)\n },\n seoMeta: (input) => {\n useSeoMeta(input)\n },\n })\n\n const url = useRequestURL()\n const parameters = readPreviewLocation(url)\n const preview = usePreviewDelivery()\n\n if (!preview.value || !parameters) return\n\n if (import.meta.server) {\n useResponseHeader('cache-control').value = 'private, no-store'\n useResponseHeader('x-frame-options').value = 'SAMEORIGIN'\n }\n\n addRouteMiddleware(\n 'cms-preview',\n (to) => {\n return previewRedirect(new URL(to.fullPath, url.origin), parameters)\n },\n { global: true },\n )\n})\n"],"mappings":";;;;;;;;;;AAiBA,qBAAe,uBAAuB;CACpC,IAAI,cAAc,eAAe;EAC/B,MAAM,QAAQ,SAAS;EAEvB,QAAQ,EAAE,WAAW,EAAE,MAAM,eAAe,eAAe,eAAe,MAAM,IAAI,CAAC,EAAE,EAAE,CAAC;CAC5F;CAEA,8BAA8B;EAC5B,OAAO,UAAU;GACf,QAAQ,KAAK;EACf;EACA,SAAS,UAAU;GACjB,MAAM,SAAS,cAAc,KAAK;GAElC,IAAI,YAAY,QACd,MACE,QACC,UAAU;IACT,OAAO,QAAQ;GACjB,GACA,EAAE,OAAO,OAAO,CAClB;EAEJ;EACA,SAAS,UAAU;GACjB,aAAa,KAAK;EACpB;EACA,UAAU,UAAU;GAClB,WAAW,KAAK;EAClB;CACF,CAAC;CAED,MAAM,MAAM,cAAc;CAC1B,MAAM,aAAa,oBAAoB,GAAG;CAG1C,IAAI,CAFY,mBAEL,CAAC,CAAC,SAAS,CAAC,YAAY;CAEnC,IAAI,YAAY,QAAQ;EACtB,kBAAkB,eAAe,CAAC,CAAC,QAAQ;EAC3C,kBAAkB,iBAAiB,CAAC,CAAC,QAAQ;CAC/C;CAEA,mBACE,gBACC,OAAO;EACN,OAAO,gBAAgB,IAAI,IAAI,GAAG,UAAU,IAAI,MAAM,GAAG,UAAU;CACrE,GACA,EAAE,QAAQ,KAAK,CACjB;AACF,CAAC"}
1
+ {"version":3,"file":"plugin.js","names":[],"sources":["../../../../../src/runtime/delivery/plugin.ts"],"sourcesContent":["import configuration from '#cms/i18n'\nimport {\n addRouteMiddleware,\n defineNuxtPlugin,\n useHead,\n useRequestURL,\n useResponseHeader,\n useRoute,\n useSeoMeta,\n useState,\n} from 'nuxt/app'\nimport { updateSiteConfig, useRobotsRule, useSchemaOrg } from '#imports'\nimport { previewRedirect, readPreviewLocation } from '@internal/protocol/Preview'\nimport { computed, watch } from 'vue'\nimport { usePreviewDelivery } from './context'\nimport { installCmsDocumentSeoAdapters } from './useCmsDocumentSeo'\nimport { localeFromPath } from '../i18n/translator'\n\nexport default defineNuxtPlugin(() => {\n const route = useRoute()\n const documentLocale = useState<string | undefined>('cms-document-locale', () => undefined)\n\n if (configuration.defaultLocale) {\n const ownsRoute = computed(() => route.name === 'cms-document-page')\n const locale = computed(() => documentLocale.value ?? localeFromPath(configuration, route.path))\n\n watch(\n () => route.fullPath,\n () => {\n documentLocale.value = undefined\n },\n { flush: 'sync' },\n )\n useHead({ htmlAttrs: { lang: computed(() => (ownsRoute.value ? locale.value : undefined)) } })\n updateSiteConfig({\n _context: '@phtngyn/cms',\n _priority: 0,\n currentLocale: computed(() => (ownsRoute.value ? locale.value : undefined)),\n defaultLocale: computed(() => (ownsRoute.value ? configuration.defaultLocale : undefined)),\n locales: computed(() =>\n ownsRoute.value\n ? Object.entries(configuration.locales).map(([code, value]) => ({ code, name: value.name }))\n : undefined,\n ),\n })\n }\n\n installCmsDocumentSeoAdapters({\n head: (input) => {\n useHead(input)\n },\n robots: (input) => {\n const robots = useRobotsRule(input)\n\n if (import.meta.server) {\n watch(\n input,\n (value) => {\n robots.value = value\n },\n { flush: 'sync' },\n )\n }\n },\n schema: (input) => {\n useSchemaOrg(input)\n },\n seoMeta: (input) => {\n useSeoMeta(input)\n },\n locale: (input) => {\n watch(input, (value) => (documentLocale.value = value), { immediate: true, flush: 'sync' })\n },\n })\n\n const url = useRequestURL()\n const parameters = readPreviewLocation(url)\n const preview = usePreviewDelivery()\n\n if (!preview.value || !parameters) return\n\n if (import.meta.server) {\n useResponseHeader('cache-control').value = 'private, no-store'\n useResponseHeader('x-frame-options').value = 'SAMEORIGIN'\n }\n\n addRouteMiddleware(\n 'cms-preview',\n (to) =>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AG1C,IAAI,CAFY,mBAEL,CAAC,CAAC,SAAS,CAAC,YAAY;CAEnC,IAAI,YAAY,QAAQ;EACtB,kBAAkB,eAAe,CAAC,CAAC,QAAQ;EAC3C,kBAAkB,iBAAiB,CAAC,CAAC,QAAQ;CAC/C;CAEA,mBACE,gBACC,OAAO;EACN,OAAO,gBAAgB,IAAI,IAAI,GAAG,UAAU,IAAI,MAAM,GAAG,UAAU;CACrE,GACA,EAAE,QAAQ,KAAK,CACjB;AACF,CAAC"}
@@ -1,4 +1,4 @@
1
- import { DeliveryDocument } from "./types.js";
1
+ import { t as DeliveryDocument } from "../../types-DutFRtaG.js";
2
2
  import { InjectionKey } from "vue";
3
3
  //#region src/runtime/delivery/preview.d.ts
4
4
  export type PreviewDocumentRole = 'embedded' | 'primary' | 'related' | 'summary';
@@ -1,85 +1,2 @@
1
- import { n as ResolvedSeo, t as DocumentSeo } from "../../Seo-402YumpT.js";
2
- import { DateTime } from "effect";
3
- //#region src/runtime/delivery/types.d.ts
4
- export type DeliveryJson = null | boolean | number | string | ReadonlyArray<DeliveryJson> | DeliveryJsonObject;
5
- export interface DeliveryJsonObject {
6
- readonly [key: string]: DeliveryJson;
7
- }
8
- export type DeliveryMarkdownNode = string | readonly [null, DeliveryJsonObject, string] | readonly [string, DeliveryJsonObject, ...DeliveryMarkdownNode[]];
9
- export interface DeliveryMarkdownDocument {
10
- readonly frontmatter: DeliveryJsonObject;
11
- readonly meta: DeliveryJsonObject;
12
- readonly nodes: ReadonlyArray<DeliveryMarkdownNode>;
13
- }
14
- export interface DeliveryDocument {
15
- readonly analysis: {
16
- readonly components: ReadonlyArray<string>;
17
- readonly headings: ReadonlyArray<{
18
- readonly depth: number;
19
- readonly id: string;
20
- readonly text: string;
21
- }>;
22
- readonly searchText: string;
23
- readonly summary: string;
24
- };
25
- readonly body: DeliveryMarkdownDocument;
26
- readonly collection: string;
27
- readonly data: DeliveryJsonObject;
28
- readonly description?: string;
29
- readonly draft: boolean;
30
- readonly engineFingerprint: string;
31
- readonly id: string;
32
- readonly issues: ReadonlyArray<{
33
- readonly code: string;
34
- readonly collection?: string;
35
- readonly field?: string;
36
- readonly key?: string;
37
- readonly locale?: string;
38
- readonly message: string;
39
- readonly severity: 'error' | 'warning';
40
- readonly sourcePath?: string;
41
- }>;
42
- readonly key: string;
43
- readonly locale?: string;
44
- readonly path: string;
45
- readonly resolvedSeo?: ResolvedSeo;
46
- readonly seo?: DocumentSeo;
47
- readonly source: {
48
- readonly mappings: ReadonlyArray<{
49
- readonly nodePath: ReadonlyArray<number>;
50
- readonly range: {
51
- readonly end: {
52
- readonly column: number;
53
- readonly line: number;
54
- readonly offset: number;
55
- };
56
- readonly start: {
57
- readonly column: number;
58
- readonly line: number;
59
- readonly offset: number;
60
- };
61
- };
62
- }>;
63
- readonly path: string;
64
- readonly publishedAt?: DateTime.Utc;
65
- };
66
- readonly title: string;
67
- }
68
- export interface DeliveryDocumentPage {
69
- readonly items: ReadonlyArray<DeliveryDocument>;
70
- readonly total: number;
71
- }
72
- export interface DeliveryDocumentQuerySort {
73
- readonly direction?: 'asc' | 'desc';
74
- readonly field: string;
75
- }
76
- export interface DeliveryDocumentQuery {
77
- readonly collection?: string;
78
- readonly locale?: string;
79
- readonly limit: number;
80
- readonly offset?: number;
81
- readonly sort?: DeliveryDocumentQuerySort | ReadonlyArray<DeliveryDocumentQuerySort>;
82
- readonly where?: Readonly<Record<string, boolean | number | string | null | ReadonlyArray<boolean | number | string | null>>>;
83
- }
84
- //#endregion
85
- //# sourceMappingURL=types.d.ts.map
1
+ import { a as DeliveryJson, c as DeliveryMarkdownNode, i as DeliveryDocumentQuerySort, n as DeliveryDocumentPage, o as DeliveryJsonObject, r as DeliveryDocumentQuery, s as DeliveryMarkdownDocument, t as DeliveryDocument } from "../../types-DutFRtaG.js";
2
+ export { DeliveryDocument, DeliveryDocumentPage, DeliveryDocumentQuery, DeliveryDocumentQuerySort, DeliveryJson, DeliveryJsonObject, DeliveryMarkdownDocument, DeliveryMarkdownNode };
@@ -1,5 +1,5 @@
1
1
  import { i as SiteIdentity } from "../../Seo-402YumpT.js";
2
- import { DeliveryDocument } from "./types.js";
2
+ import { t as DeliveryDocument } from "../../types-DutFRtaG.js";
3
3
  import { ComputedRef, MaybeRefOrGetter } from "vue";
4
4
  //#region src/runtime/delivery/useCmsDocumentSeo.d.ts
5
5
  type ReactiveMetadataValue = () => string | undefined;
@@ -10,6 +10,7 @@ export interface CmsSeoMetadata {
10
10
  readonly ogDescription: ReactiveMetadataValue;
11
11
  readonly ogImage: ReactiveMetadataValue;
12
12
  readonly ogImageAlt: ReactiveMetadataValue;
13
+ readonly ogLocale: ReactiveMetadataValue;
13
14
  readonly robots: ReactiveMetadataValue;
14
15
  }
15
16
  interface CmsIdentitySchemaNode {
@@ -32,6 +33,7 @@ interface CmsPageSchemaNode {
32
33
  readonly headline?: string;
33
34
  readonly datePublished?: string;
34
35
  readonly dateModified?: string;
36
+ readonly inLanguage?: string;
35
37
  }
36
38
  export type CmsSeoSchemaNode = CmsIdentitySchemaNode | CmsPageSchemaNode;
37
39
  export interface CmsDocumentSeoAdapters {
@@ -42,6 +44,10 @@ export interface CmsDocumentSeoAdapters {
42
44
  link: Array<{
43
45
  href: string;
44
46
  rel: 'canonical';
47
+ } | {
48
+ href: string;
49
+ hreflang: string;
50
+ rel: 'alternate';
45
51
  }>;
46
52
  titleTemplate: null;
47
53
  }) => void;
@@ -51,6 +57,7 @@ export interface CmsDocumentSeoAdapters {
51
57
  }>) => void;
52
58
  readonly schema: (input: ComputedRef<ReadonlyArray<CmsSeoSchemaNode>>) => void;
53
59
  readonly seoMeta: (input: CmsSeoMetadata) => void;
60
+ readonly locale: (input: ComputedRef<string | undefined>) => void;
54
61
  }
55
62
  /** Installs Nuxt's composables once before document page setup. */
56
63
  export declare function installCmsDocumentSeoAdapters(adapters: CmsDocumentSeoAdapters): void;
@@ -17,21 +17,32 @@ function useCmsDocumentSeo(document) {
17
17
  ogDescription: () => seo.value?.socialDescription,
18
18
  ogImage: () => seo.value?.socialImage?.url,
19
19
  ogImageAlt: () => seo.value?.socialImage?.alt,
20
+ ogLocale: () => current.value?.locale,
20
21
  robots: () => seo.value ? `${seo.value.index ? "index" : "noindex"}, ${seo.value.follow ? "follow" : "nofollow"}` : void 0
21
22
  });
23
+ adapters.locale(computed(() => current.value?.locale));
22
24
  adapters.head(() => ({
23
25
  ...current.value?.locale ? { htmlAttrs: { lang: current.value.locale } } : void 0,
24
- link: seo.value?.canonicalUrl ? [{
25
- href: seo.value.canonicalUrl,
26
- rel: "canonical"
27
- }] : [],
26
+ link: links(current.value, seo.value?.canonicalUrl),
28
27
  titleTemplate: null
29
28
  }));
30
29
  adapters.robots(computed(() => ({
31
30
  follow: seo.value?.follow ?? true,
32
31
  index: seo.value?.index ?? true
33
32
  })));
34
- adapters.schema(computed(() => seo.value ? schemaNodes(seo.value) : []));
33
+ adapters.schema(computed(() => seo.value ? schemaNodes(seo.value, current.value?.locale) : []));
34
+ }
35
+ function links(document, canonicalUrl) {
36
+ const canonical = canonicalUrl ? [{
37
+ href: canonicalUrl,
38
+ rel: "canonical"
39
+ }] : [];
40
+ if (!canonicalUrl || !document?.alternatives) return canonical;
41
+ return [...canonical, ...document.alternatives.map((alternative) => ({
42
+ href: new URL(alternative.path, canonicalUrl).href,
43
+ hreflang: alternative.locale,
44
+ rel: "alternate"
45
+ }))];
35
46
  }
36
47
  function installedCmsDocumentSeoAdapters() {
37
48
  if (!installedAdapters) throw new Error("The CMS document SEO adapter has not been installed.");
@@ -50,14 +61,15 @@ function resolvedSeo(document) {
50
61
  title: document.title
51
62
  };
52
63
  }
53
- function schemaNodes(seo) {
64
+ function schemaNodes(seo, locale) {
54
65
  const identity = seo.identity ? [identityNode(seo.identity)] : [];
55
66
  if (!seo.structuredData) return identity;
56
67
  const common = {
57
68
  name: seo.title,
58
69
  ...seo.description ? { description: seo.description } : void 0,
59
70
  ...seo.socialImage ? { image: seo.socialImage.url } : void 0,
60
- ...seo.canonicalUrl ? { url: seo.canonicalUrl } : void 0
71
+ ...seo.canonicalUrl ? { url: seo.canonicalUrl } : void 0,
72
+ ...locale ? { inLanguage: locale } : void 0
61
73
  };
62
74
  if (seo.structuredData.type === "Article") return [...identity, {
63
75
  "@type": "Article",
@@ -1 +1 @@
1
- {"version":3,"file":"useCmsDocumentSeo.js","names":[],"sources":["../../../../../src/runtime/delivery/useCmsDocumentSeo.ts"],"sourcesContent":["import type { ResolvedSeo, SiteIdentity } from '@internal/protocol/Seo'\nimport type { ComputedRef, MaybeRefOrGetter } from 'vue'\nimport type { DeliveryDocument } from './types'\nimport { computed, toValue } from 'vue'\n\ntype ReactiveMetadataValue = () => string | undefined\n\nexport interface CmsSeoMetadata {\n readonly title: ReactiveMetadataValue\n readonly description: ReactiveMetadataValue\n readonly ogTitle: ReactiveMetadataValue\n readonly ogDescription: ReactiveMetadataValue\n readonly ogImage: ReactiveMetadataValue\n readonly ogImageAlt: ReactiveMetadataValue\n readonly robots: ReactiveMetadataValue\n}\n\ninterface CmsIdentitySchemaNode {\n readonly '@type': SiteIdentity['type']\n readonly name: string\n readonly url?: string\n readonly image?: string\n readonly logo?: string\n readonly telephone?: string\n readonly address?: NonNullable<Extract<SiteIdentity, { readonly type: 'LocalBusiness' }>['address']>\n}\n\ninterface CmsPageSchemaNode {\n readonly '@type': 'Article' | 'WebPage'\n readonly name: string\n readonly description?: string\n readonly image?: string\n readonly url?: string\n readonly headline?: string\n readonly datePublished?: string\n readonly dateModified?: string\n}\n\nexport type CmsSeoSchemaNode = CmsIdentitySchemaNode | CmsPageSchemaNode\n\ntype EffectiveSeo = Omit<ResolvedSeo, 'canonicalUrl'> & {\n readonly canonicalUrl?: ResolvedSeo['canonicalUrl']\n}\n\nexport interface CmsDocumentSeoAdapters {\n readonly head: (\n input: () => {\n htmlAttrs?: { lang: string }\n link: Array<{ href: string; rel: 'canonical' }>\n titleTemplate: null\n },\n ) => void\n readonly robots: (input: ComputedRef<{ readonly follow: boolean; readonly index: boolean }>) => void\n readonly schema: (input: ComputedRef<ReadonlyArray<CmsSeoSchemaNode>>) => void\n readonly seoMeta: (input: CmsSeoMetadata) => void\n}\n\nlet installedAdapters: CmsDocumentSeoAdapters | undefined\n\n/** Installs Nuxt's composables once before document page setup. */\nexport function installCmsDocumentSeoAdapters(adapters: CmsDocumentSeoAdapters): void {\n installedAdapters = adapters\n}\n\nexport function useCmsDocumentSeo(document: MaybeRefOrGetter<DeliveryDocument | null>): void {\n const adapters = installedCmsDocumentSeoAdapters()\n const current = computed(() => toValue(document))\n const seo = computed(() => resolvedSeo(current.value))\n\n adapters.seoMeta({\n title: () => seo.value?.title,\n description: () => seo.value?.description,\n ogTitle: () => seo.value?.socialTitle,\n ogDescription: () => seo.value?.socialDescription,\n ogImage: () => seo.value?.socialImage?.url,\n ogImageAlt: () => seo.value?.socialImage?.alt,\n robots: () =>\n seo.value ? `${seo.value.index ? 'index' : 'noindex'}, ${seo.value.follow ? 'follow' : 'nofollow'}` : undefined,\n })\n\n adapters.head(() => ({\n ...(current.value?.locale ? { htmlAttrs: { lang: current.value.locale } } : undefined),\n link: seo.value?.canonicalUrl ? [{ href: seo.value.canonicalUrl, rel: 'canonical' }] : [],\n titleTemplate: null,\n }))\n adapters.robots(\n computed(() => ({\n follow: seo.value?.follow ?? true,\n index: seo.value?.index ?? true,\n })),\n )\n adapters.schema(computed(() => (seo.value ? schemaNodes(seo.value) : [])))\n}\n\nfunction installedCmsDocumentSeoAdapters(): CmsDocumentSeoAdapters {\n if (!installedAdapters) throw new Error('The CMS document SEO adapter has not been installed.')\n\n return installedAdapters\n}\n\nfunction resolvedSeo(document: DeliveryDocument | null): EffectiveSeo | undefined {\n if (!document) return undefined\n\n if (document.resolvedSeo) return document.resolvedSeo\n\n return {\n description: document.description,\n follow: true,\n index: true,\n socialDescription: document.description,\n socialTitle: document.title,\n structuredData: { type: 'WebPage' },\n title: document.title,\n }\n}\n\nfunction schemaNodes(seo: EffectiveSeo): ReadonlyArray<CmsSeoSchemaNode> {\n const identity = seo.identity ? [identityNode(seo.identity)] : []\n\n if (!seo.structuredData) return identity\n\n const common = {\n name: seo.title,\n ...(seo.description ? { description: seo.description } : undefined),\n ...(seo.socialImage ? { image: seo.socialImage.url } : undefined),\n ...(seo.canonicalUrl ? { url: seo.canonicalUrl } : undefined),\n }\n\n if (seo.structuredData.type === 'Article') {\n return [\n ...identity,\n {\n '@type': 'Article',\n ...common,\n headline: seo.structuredData.headline ?? seo.title,\n ...(seo.structuredData.datePublished ? { datePublished: seo.structuredData.datePublished } : undefined),\n ...(seo.structuredData.dateModified ? { dateModified: seo.structuredData.dateModified } : undefined),\n },\n ]\n }\n\n return [...identity, { '@type': 'WebPage', ...common }]\n}\n\nfunction identityNode(identity: SiteIdentity): CmsIdentitySchemaNode {\n const common = {\n '@type': identity.type,\n name: identity.name,\n ...(identity.url ? { url: identity.url } : undefined),\n }\n\n switch (identity.type) {\n case 'Person':\n return { ...common, ...(identity.image ? { image: identity.image.url } : undefined) }\n case 'Organization':\n return { ...common, ...(identity.logo ? { logo: identity.logo.url } : undefined) }\n case 'LocalBusiness':\n return {\n ...common,\n ...(identity.address ? { address: identity.address } : undefined),\n ...(identity.image ? { image: identity.image.url } : undefined),\n ...(identity.logo ? { logo: identity.logo.url } : undefined),\n ...(identity.telephone ? { telephone: identity.telephone } : undefined),\n }\n }\n}\n"],"mappings":";;;AAyDA,IAAI;;AAGJ,SAAgB,8BAA8B,UAAwC;CACpF,oBAAoB;AACtB;AAEA,SAAgB,kBAAkB,UAA2D;CAC3F,MAAM,WAAW,gCAAgC;CACjD,MAAM,UAAU,eAAe,QAAQ,QAAQ,CAAC;CAChD,MAAM,MAAM,eAAe,YAAY,QAAQ,KAAK,CAAC;CAErD,SAAS,QAAQ;EACf,aAAa,IAAI,OAAO;EACxB,mBAAmB,IAAI,OAAO;EAC9B,eAAe,IAAI,OAAO;EAC1B,qBAAqB,IAAI,OAAO;EAChC,eAAe,IAAI,OAAO,aAAa;EACvC,kBAAk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D;CAEA,IAAI,IAAI,eAAe,SAAS,WAC9B,OAAO,CACL,GAAG,UACH;EACE,SAAS;EACT,GAAG;EACH,UAAU,IAAI,eAAe,YAAY,IAAI;EAC7C,GAAI,IAAI,eAAe,gBAAgB,EAAE,eAAe,IAAI,eAAe,cAAc,IAAI;EAC7F,GAAI,IAAI,eAAe,eAAe,EAAE,cAAc,IAAI,eAAe,aAAa,IAAI;CAC5F,CACF;CAGF,OAAO,CAAC,GAAG,UAAU;EAAE,SAAS;EAAW,GAAG;CAAO,CAAC;AACxD;AAEA,SAAS,aAAa,UAA+C;CACnE,MAAM,SAAS;EACb,SAAS,SAAS;EAClB,MAAM,SAAS;EACf,GAAI,SAAS,MAAM,EAAE,KAAK,SAAS,IAAI,IAAI;CAC7C;CAEA,QAAQ,SAAS,MAAjB;EACE,KAAK,UACH,OAAO;GAAE,GAAG;GAAQ,GAAI,SAAS,QAAQ,EAAE,OAAO,SAAS,MAAM,IAAI,IAAI;EAAW;EACtF,KAAK,gBACH,OAAO;GAAE,GAAG;GAAQ,GAAI,SAAS,OAAO,EAAE,MAAM,SAAS,KAAK,IAAI,IAAI;EAAW;EACnF,KAAK,iBACH,OAAO;GACL,GAAG;GACH,GAAI,SAAS,UAAU,EAAE,SAAS,SAAS,QAAQ,IAAI;GACvD,GAAI,SAAS,QAAQ,EAAE,OAAO,SAAS,MAAM,IAAI,IAAI;GACrD,GAAI,SAAS,OAAO,EAAE,MAAM,SAAS,KAAK,IAAI,IAAI;GAClD,GAAI,SAAS,YAAY,EAAE,WAAW,SAAS,UAAU,IAAI;EAC/D;CACJ;AACF"}
1
+ {"version":3,"file":"useCmsDocumentSeo.js","names":[],"sources":["../../../../../src/runtime/delivery/useCmsDocumentSeo.ts"],"sourcesContent":["import type { ResolvedSeo, SiteIdentity } from '@internal/protocol/Seo'\nimport type { ComputedRef, MaybeRefOrGetter } from 'vue'\nimport type { DeliveryDocument } from './types'\nimport { computed, toValue } from 'vue'\n\ntype ReactiveMetadataValue = () => string | undefined\n\nexport interface CmsSeoMetadata {\n readonly title: ReactiveMetadataValue\n readonly description: ReactiveMetadataValue\n readonly ogTitle: ReactiveMetadataValue\n readonly ogDescription: ReactiveMetadataValue\n readonly ogImage: ReactiveMetadataValue\n readonly ogImageAlt: ReactiveMetadataValue\n readonly ogLocale: ReactiveMetadataValue\n readonly robots: ReactiveMetadataValue\n}\n\ninterface CmsIdentitySchemaNode {\n readonly '@type': SiteIdentity['type']\n readonly name: string\n readonly url?: string\n readonly image?: string\n readonly logo?: string\n readonly telephone?: string\n readonly address?: NonNullable<Extract<SiteIdentity, { readonly type: 'LocalBusiness' }>['address']>\n}\n\ninterface CmsPageSchemaNode {\n readonly '@type': 'Article' | 'WebPage'\n readonly name: string\n readonly description?: string\n readonly image?: string\n readonly url?: string\n readonly headline?: string\n readonly datePublished?: string\n readonly dateModified?: string\n readonly inLanguage?: string\n}\n\nexport type CmsSeoSchemaNode = CmsIdentitySchemaNode | CmsPageSchemaNode\n\ntype EffectiveSeo = Omit<ResolvedSeo, 'canonicalUrl'> & {\n readonly canonicalUrl?: ResolvedSeo['canonicalUrl']\n}\n\nexport interface CmsDocumentSeoAdapters {\n readonly head: (\n input: () => {\n htmlAttrs?: { lang: string }\n link: Array<{ href: string; rel: 'canonical' } | { href: string; hreflang: string; rel: 'alternate' }>\n titleTemplate: null\n },\n ) => void\n readonly robots: (input: ComputedRef<{ readonly follow: boolean; readonly index: boolean }>) => void\n readonly schema: (input: ComputedRef<ReadonlyArray<CmsSeoSchemaNode>>) => void\n readonly seoMeta: (input: CmsSeoMetadata) => void\n readonly locale: (input: ComputedRef<string | undefined>) => void\n}\n\nlet installedAdapters: CmsDocumentSeoAdapters | undefined\n\n/** Installs Nuxt's composables once before document page setup. */\nexport function installCmsDocumentSeoAdapters(adapters: CmsDocumentSeoAdapters): void {\n installedAdapters = adapters\n}\n\nexport function useCmsDocumentSeo(document: MaybeRefOrGetter<DeliveryDocument | null>): void {\n const adapters = installedCmsDocumentSeoAdapters()\n const current = computed(() => toValue(document))\n const seo = computed(() => resolvedSeo(current.value))\n\n adapters.seoMeta({\n title: () => seo.value?.title,\n description: () => seo.value?.description,\n ogTitle: () => seo.value?.socialTitle,\n ogDescription: () => seo.value?.socialDescription,\n ogImage: () => seo.value?.socialImage?.url,\n ogImageAlt: () => seo.value?.socialImage?.alt,\n ogLocale: () => current.value?.locale,\n robots: () =>\n seo.value ? `${seo.value.index ? 'index' : 'noindex'}, ${seo.value.follow ? 'follow' : 'nofollow'}` : undefined,\n })\n\n adapters.locale(computed(() => current.value?.locale))\n adapters.head(() => ({\n ...(current.value?.locale ? { htmlAttrs: { lang: current.value.locale } } : undefined),\n link: links(current.value, seo.value?.canonicalUrl),\n titleTemplate: null,\n }))\n adapters.robots(\n computed(() => ({\n follow: seo.value?.follow ?? true,\n index: seo.value?.index ?? true,\n })),\n )\n adapters.schema(computed(() => (seo.value ? schemaNodes(seo.value, current.value?.locale) : [])))\n}\n\nfunction links(document: DeliveryDocument | null, canonicalUrl?: string) {\n const canonical = canonicalUrl ? [{ href: canonicalUrl, rel: 'canonical' as const }] : []\n\n if (!canonicalUrl || !document?.alternatives) return canonical\n\n return [\n ...canonical,\n ...document.alternatives.map((alternative) => ({\n href: new URL(alternative.path, canonicalUrl).href,\n hreflang: alternative.locale,\n rel: 'alternate' as const,\n })),\n ]\n}\n\nfunction installedCmsDocumentSeoAdapters(): CmsDocumentSeoAdapters {\n if (!installedAdapters) throw new Error('The CMS document SEO adapter has not been installed.')\n\n return installedAdapters\n}\n\nfunction resolvedSeo(document: DeliveryDocument | null): EffectiveSeo | undefined {\n if (!document) return undefined\n\n if (document.resolvedSeo) return document.resolvedSeo\n\n return {\n description: document.description,\n follow: true,\n index: true,\n socialDescription: document.description,\n socialTitle: document.title,\n structuredData: { type: 'WebPage' },\n title: document.title,\n }\n}\n\nfunction schemaNodes(seo: EffectiveSeo, locale?: string): ReadonlyArray<CmsSeoSchemaNode> {\n const identity = seo.identity ? [identityNode(seo.identity)] : []\n\n if (!seo.structuredData) return identity\n\n const common = {\n name: seo.title,\n ...(seo.description ? { description: seo.description } : undefined),\n ...(seo.socialImage ? { image: seo.socialImage.url } : undefined),\n ...(seo.canonicalUrl ? { url: seo.canonicalUrl } : undefined),\n ...(locale ? { inLanguage: locale } : undefined),\n }\n\n if (seo.structuredData.type === 'Article') {\n return [\n ...identity,\n {\n '@type': 'Article',\n ...common,\n headline: seo.structuredData.headline ?? seo.title,\n ...(seo.structuredData.datePublished ? { datePublished: seo.structuredData.datePublished } : undefined),\n ...(seo.structuredData.dateModified ? { dateModified: seo.structuredData.dateModified } : undefined),\n },\n ]\n }\n\n return [...identity, { '@type': 'WebPage', ...common }]\n}\n\nfunction identityNode(identity: SiteIdentity): CmsIdentitySchemaNode {\n const common = {\n '@type': identity.type,\n name: identity.name,\n ...(identity.url ? { url: identity.url } : undefined),\n }\n\n switch (identity.type) {\n case 'Person':\n return { ...common, ...(identity.image ? { image: identity.image.url } : undefined) }\n case 'Organization':\n return { ...common, ...(identity.logo ? { logo: identity.logo.url } : undefined) }\n case 'LocalBusiness':\n return {\n ...common,\n ...(identity.address ? { address: identity.address } : undefined),\n ...(identity.image ? { image: identity.image.url } : undefined),\n ...(identity.logo ? { logo: identity.logo.url } : undefined),\n ...(identity.telephone ? { telephone: identity.telephone } : undefined),\n }\n }\n}\n"],"mappings":";;;AA4DA,IAAI;;AAGJ,SAAgB,8BAA8B,UAAwC;CACpF,oBAAoB;AACtB;AAEA,SAAgB,kBAAkB,UAA2D;CAC3F,MAAM,WAAW,gCAAgC;CACjD,MAAM,UAAU,eAAe,QAAQ,QAAQ,CAAC;CAChD,MAAM,MAAM,eAAe,YAAY,QAAQ,KAAK,CAAC;CAErD,SAAS,QAAQ;EACf,aAAa,IAAI,OAAO;EACxB,mBAAmB,IAAI,OAAO;EAC9B,eAAe,IAAI,OAAO;EAC1B,qBAAqB,IAAI,OAAO;EAChC,eAAe,IAAI,OAAO,aAAa;EACvC,kBAAkB,IAAI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,SAAS,QAAQ,EAAE,OAAO,SAAS,MAAM,IAAI,IAAI;GACrD,GAAI,SAAS,OAAO,EAAE,MAAM,SAAS,KAAK,IAAI,IAAI;GAClD,GAAI,SAAS,YAAY,EAAE,WAAW,SAAS,UAAU,IAAI;EAC/D;CACJ;AACF"}
@@ -1,6 +1,6 @@
1
- import { DeliveryDocument } from "./types.js";
1
+ import { CmsCollection, CmsCollectionName } from "../../ApplicationTypes.js";
2
2
  import { MaybeRefOrGetter } from "vue";
3
3
  //#region src/runtime/delivery/useDocument.d.ts
4
- export declare function useDocument(path: MaybeRefOrGetter<string>): import("nuxt/app").AsyncData<DeliveryDocument | null, import("nuxt/app").NuxtError<unknown> | undefined>;
4
+ export declare function useDocument<Name extends CmsCollectionName = CmsCollectionName>(path: MaybeRefOrGetter<string>): import("nuxt/app").AsyncData<CmsCollection<Name> | null, import("nuxt/app").NuxtError<unknown> | undefined>;
5
5
  //#endregion
6
6
  //# sourceMappingURL=useDocument.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"useDocument.js","names":[],"sources":["../../../../../src/runtime/delivery/useDocument.ts"],"sourcesContent":["import { useFetch } from 'nuxt/app'\nimport { usePreviewDelivery } from './context'\nimport type { MaybeRefOrGetter } from 'vue'\nimport { computed, toValue } from 'vue'\nimport { CMS_DELIVERY_READ_PATH, CMS_PREVIEW_READ_PATH } from '@internal/protocol/HttpPaths'\nimport type { DeliveryDocument } from './types'\n\nexport function useDocument(path: MaybeRefOrGetter<string>) {\n const preview = usePreviewDelivery()\n const endpoint = computed(() => (preview.value ? CMS_PREVIEW_READ_PATH : CMS_DELIVERY_READ_PATH))\n const body = computed(() => ({ kind: 'path' as const, path: toValue(path) }))\n\n return useFetch<DeliveryDocument | null>(endpoint, {\n body,\n default: () => null,\n method: 'POST',\n })\n}\n"],"mappings":";;;;;;AAOA,SAAgB,YAAY,MAAgC;CAC1D,MAAM,UAAU,mBAAmB;CACnC,MAAM,WAAW,eAAgB,QAAQ,QAAQ,wBAAwB,sBAAuB;CAChG,MAAM,OAAO,gBAAgB;EAAE,MAAM;EAAiB,MAAM,QAAQ,IAAI;CAAE,EAAE;CAE5E,OAAO,SAAkC,UAAU;EACjD;EACA,eAAe;EACf,QAAQ;CACV,CAAC;AACH"}
1
+ {"version":3,"file":"useDocument.js","names":[],"sources":["../../../../../src/runtime/delivery/useDocument.ts"],"sourcesContent":["import { useFetch } from 'nuxt/app'\nimport { usePreviewDelivery } from './context'\nimport type { MaybeRefOrGetter } from 'vue'\nimport { computed, toValue } from 'vue'\nimport { CMS_DELIVERY_READ_PATH, CMS_PREVIEW_READ_PATH } from '@internal/protocol/HttpPaths'\nimport type { CmsCollection, CmsCollectionName } from '../../ApplicationTypes'\n\nexport function useDocument<Name extends CmsCollectionName = CmsCollectionName>(path: MaybeRefOrGetter<string>) {\n const preview = usePreviewDelivery()\n const endpoint = computed(() => (preview.value ? CMS_PREVIEW_READ_PATH : CMS_DELIVERY_READ_PATH))\n const body = computed(() => ({ kind: 'path' as const, path: toValue(path) }))\n\n return useFetch<CmsCollection<Name> | null>(endpoint, {\n body,\n default: () => null,\n method: 'POST',\n })\n}\n"],"mappings":";;;;;;AAOA,SAAgB,YAAgE,MAAgC;CAC9G,MAAM,UAAU,mBAAmB;CACnC,MAAM,WAAW,eAAgB,QAAQ,QAAQ,wBAAwB,sBAAuB;CAChG,MAAM,OAAO,gBAAgB;EAAE,MAAM;EAAiB,MAAM,QAAQ,IAAI;CAAE,EAAE;CAE5E,OAAO,SAAqC,UAAU;EACpD;EACA,eAAe;EACf,QAAQ;CACV,CAAC;AACH"}
@@ -1,7 +1,7 @@
1
- import { DeliveryDocumentPage, DeliveryDocumentQuery, DeliveryDocumentQuerySort } from "./types.js";
1
+ import { CmsCollectionName, CmsDocumentPage, CmsDocumentQuery, CmsDocumentQuerySort } from "../../ApplicationTypes.js";
2
2
  import { MaybeRefOrGetter } from "vue";
3
3
  //#region src/runtime/delivery/useDocumentQuery.d.ts
4
- export declare function useDocumentQuery(query: MaybeRefOrGetter<DeliveryDocumentQuery>): import("nuxt/app").AsyncData<DeliveryDocumentPage, import("nuxt/app").NuxtError<unknown> | undefined>;
4
+ export declare function useDocumentQuery<Name extends CmsCollectionName = CmsCollectionName>(query: MaybeRefOrGetter<CmsDocumentQuery<Name>>): import("nuxt/app").AsyncData<CmsDocumentPage<Name>, import("nuxt/app").NuxtError<unknown> | undefined>;
5
5
  //#endregion
6
- export type { DeliveryDocumentQuery, DeliveryDocumentQuerySort };
6
+ export type { CmsDocumentQuery, CmsDocumentQuerySort };
7
7
  //# sourceMappingURL=useDocumentQuery.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"useDocumentQuery.js","names":[],"sources":["../../../../../src/runtime/delivery/useDocumentQuery.ts"],"sourcesContent":["import { useFetch } from 'nuxt/app'\nimport { usePreviewDelivery } from './context'\nimport type { MaybeRefOrGetter } from 'vue'\nimport { computed, toValue } from 'vue'\nimport { CMS_DELIVERY_QUERY_PATH, CMS_PREVIEW_QUERY_PATH } from '@internal/protocol/HttpPaths'\nimport type { DeliveryDocumentPage, DeliveryDocumentQuery } from './types'\n\nexport type { DeliveryDocumentQuery, DeliveryDocumentQuerySort } from './types'\n\nexport function useDocumentQuery(query: MaybeRefOrGetter<DeliveryDocumentQuery>) {\n const preview = usePreviewDelivery()\n const endpoint = computed(() => (preview.value ? CMS_PREVIEW_QUERY_PATH : CMS_DELIVERY_QUERY_PATH))\n\n const body = computed(() => {\n const value = toValue(query)\n\n return {\n ...value,\n sort: value.sort === undefined ? undefined : Array.isArray(value.sort) ? value.sort : [value.sort],\n }\n })\n\n return useFetch<DeliveryDocumentPage>(endpoint, {\n body,\n default: () => ({ items: [], total: 0 }),\n method: 'POST',\n })\n}\n"],"mappings":";;;;;;AASA,SAAgB,iBAAiB,OAAgD;CAC/E,MAAM,UAAU,mBAAmB;CACnC,MAAM,WAAW,eAAgB,QAAQ,QAAQ,yBAAyB,uBAAwB;CAElG,MAAM,OAAO,eAAe;EAC1B,MAAM,QAAQ,QAAQ,KAAK;EAE3B,OAAO;GACL,GAAG;GACH,MAAM,MAAM,SAAS,SAAY,SAAY,MAAM,QAAQ,MAAM,IAAI,IAAI,MAAM,OAAO,CAAC,MAAM,IAAI;EACnG;CACF,CAAC;CAED,OAAO,SAA+B,UAAU;EAC9C;EACA,gBAAgB;GAAE,OAAO,CAAC;GAAG,OAAO;EAAE;EACtC,QAAQ;CACV,CAAC;AACH"}
1
+ {"version":3,"file":"useDocumentQuery.js","names":[],"sources":["../../../../../src/runtime/delivery/useDocumentQuery.ts"],"sourcesContent":["import { useFetch } from 'nuxt/app'\nimport { usePreviewDelivery } from './context'\nimport type { MaybeRefOrGetter } from 'vue'\nimport { computed, toValue } from 'vue'\nimport { CMS_DELIVERY_QUERY_PATH, CMS_PREVIEW_QUERY_PATH } from '@internal/protocol/HttpPaths'\nimport type { CmsCollectionName, CmsDocumentPage, CmsDocumentQuery } from '../../ApplicationTypes'\n\nexport type { CmsDocumentQuery, CmsDocumentQuerySort } from '../../ApplicationTypes'\n\nexport function useDocumentQuery<Name extends CmsCollectionName = CmsCollectionName>(\n query: MaybeRefOrGetter<CmsDocumentQuery<Name>>,\n) {\n const preview = usePreviewDelivery()\n const endpoint = computed(() => (preview.value ? CMS_PREVIEW_QUERY_PATH : CMS_DELIVERY_QUERY_PATH))\n\n const body = computed(() => {\n const value = toValue(query)\n\n return {\n ...value,\n sort: value.sort === undefined ? undefined : Array.isArray(value.sort) ? value.sort : [value.sort],\n }\n })\n\n return useFetch<CmsDocumentPage<Name>>(endpoint, {\n body,\n default: () => ({ items: [], total: 0 }),\n method: 'POST',\n })\n}\n"],"mappings":";;;;;;AASA,SAAgB,iBACd,OACA;CACA,MAAM,UAAU,mBAAmB;CACnC,MAAM,WAAW,eAAgB,QAAQ,QAAQ,yBAAyB,uBAAwB;CAElG,MAAM,OAAO,eAAe;EAC1B,MAAM,QAAQ,QAAQ,KAAK;EAE3B,OAAO;GACL,GAAG;GACH,MAAM,MAAM,SAAS,SAAY,SAAY,MAAM,QAAQ,MAAM,IAAI,IAAI,MAAM,OAAO,CAAC,MAAM,IAAI;EACnG;CACF,CAAC;CAED,OAAO,SAAgC,UAAU;EAC/C;EACA,gBAAgB;GAAE,OAAO,CAAC;GAAG,OAAO;EAAE;EACtC,QAAQ;CACV,CAAC;AACH"}
@@ -1,5 +1,5 @@
1
1
  import { r as DocumentId } from "../../scalars-B2lgGUnj.js";
2
- import { t as documentForms } from "../../Forms-Dj6NuW66.js";
2
+ import { t as documentForms } from "../../Forms-02-p8qEw.js";
3
3
  import { Predicate, Result, Schema } from "effect";
4
4
 
5
5
  //#region src/runtime/forms/document.ts