@phtngyn/cms 0.1.0-beta.0 → 0.1.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.
- package/README.md +72 -1
- package/package.json +5 -5
- package/src/Authoring.d.ts +13 -1
- package/src/{AuthoringSchema-BQ5kbhVB.js → Configuration-DyKo0sLS.js} +595 -367
- package/src/Configuration-DyKo0sLS.js.map +1 -0
- package/src/{DocumentEngine-Da0kWotL.js → DocumentEngine-DYObwMDY.js} +44 -66
- package/src/DocumentEngine-DYObwMDY.js.map +1 -0
- package/src/DocumentModel.d.ts +4 -0
- package/src/DocumentModel.js.map +1 -1
- package/src/{HttpPaths-86qLGB90.js → HttpPaths-BbS21Jy8.js} +4 -2
- package/src/{HttpPaths-86qLGB90.js.map → HttpPaths-BbS21Jy8.js.map} +1 -1
- package/src/Module.js +27 -76
- package/src/Module.js.map +1 -1
- package/src/{StudioHttp-BTLLooh0.js → StudioHttp-jR2-bc01.js} +44 -242
- package/src/StudioHttp-jR2-bc01.js.map +1 -0
- package/src/{connection-ZGtL54qY.js → connection-CBTY-TzB.js} +3 -3
- package/src/{connection-ZGtL54qY.js.map → connection-CBTY-TzB.js.map} +1 -1
- package/src/{installation-BNKaVjni.js → installation-DeuBiFRE.js} +488 -236
- package/src/installation-DeuBiFRE.js.map +1 -0
- package/src/internal/authoring-catalog.js +147 -0
- package/src/internal/authoring-catalog.js.map +1 -0
- package/src/internal/authoring-compiler.js +2 -1
- package/src/internal/authoring-compiler.js.map +1 -1
- package/src/internal/authoring-metadata.js +67 -48
- package/src/internal/authoring-metadata.js.map +1 -1
- package/src/internal/configuration.js +5 -6
- package/src/internal/configuration.js.map +1 -1
- package/src/internal/document-model.js +3 -2
- package/src/internal/document-model.js.map +1 -1
- package/src/internal/studio-app.js +66 -0
- package/src/internal/studio-app.js.map +1 -0
- package/src/location-DtYv2aes.js +36 -0
- package/src/location-DtYv2aes.js.map +1 -0
- package/src/{metadata-Czvi3E4K.js → metadata-DE1Mc2td.js} +2 -2
- package/src/{metadata-Czvi3E4K.js.map → metadata-DE1Mc2td.js.map} +1 -1
- package/src/{models-Citx8jBi.js → models-BkMgeaOL.js} +252 -3
- package/src/models-BkMgeaOL.js.map +1 -0
- package/src/{models-DS5ClMsH.js → models-C3witQBK.js} +8 -31
- package/src/models-C3witQBK.js.map +1 -0
- package/src/runtime/blocks.js +17 -0
- package/src/runtime/blocks.js.map +1 -0
- package/src/runtime/collaboration.js +9 -4
- package/src/runtime/collaboration.js.map +1 -1
- package/src/runtime/delivery/DocumentRenderer.js +6 -3
- package/src/runtime/delivery/DocumentRenderer.js.map +1 -1
- package/src/runtime/delivery/blocks.js +6 -0
- package/src/runtime/delivery/blocks.js.map +1 -0
- package/src/runtime/delivery/context.js +12 -0
- package/src/runtime/delivery/context.js.map +1 -0
- package/src/runtime/delivery/document-page.js +5 -3
- package/src/runtime/delivery/document-page.js.map +1 -1
- package/src/runtime/delivery/document.js +18 -2
- package/src/runtime/delivery/document.js.map +1 -1
- package/src/runtime/delivery/error.js +11 -0
- package/src/runtime/delivery/error.js.map +1 -0
- package/src/runtime/delivery/plugin.js +21 -0
- package/src/runtime/delivery/plugin.js.map +1 -0
- package/src/runtime/delivery/useDocument.js +6 -3
- package/src/runtime/delivery/useDocument.js.map +1 -1
- package/src/runtime/delivery/useDocumentQuery.js +6 -3
- package/src/runtime/delivery/useDocumentQuery.js.map +1 -1
- package/src/runtime/installation.js +1 -1
- package/src/runtime/plugin.js +3 -3
- package/src/runtime/plugin.js.map +1 -1
- package/src/runtime/preview/connection.js +1 -1
- package/src/runtime/preview/controller.js +29 -10
- package/src/runtime/preview/controller.js.map +1 -1
- package/src/runtime/preview/overlay.js +65 -0
- package/src/runtime/preview/overlay.js.map +1 -0
- package/src/runtime/preview/plugin.client.js +21 -34
- package/src/runtime/preview/plugin.client.js.map +1 -1
- package/src/runtime/preview/preview.css +72 -4
- package/src/runtime/preview/store.js +1 -1
- package/src/runtime/studio-app.js +5 -1
- package/src/runtime/studio-app.js.map +1 -1
- package/src/runtime/studio-entry.js +36 -0
- package/src/runtime/studio-entry.js.map +1 -0
- package/src/runtime/studio-navigation.js +11 -0
- package/src/runtime/studio-navigation.js.map +1 -0
- package/src/{store-Nl4uxEXx.js → store-CfFFx9Ua.js} +3 -3
- package/src/{store-Nl4uxEXx.js.map → store-CfFFx9Ua.js.map} +1 -1
- package/studio/CreateDocumentDialog--L9lTfx6.js +256 -0
- package/studio/collaboration-DUuu678R.js +4565 -0
- package/studio/documentPlanning-BXX04Woe.js +28989 -0
- package/studio/dom-to-image-more.min-D6jGGdrW.js +877 -0
- package/studio/editor-PexnXkJY.js +30817 -0
- package/studio/host.css +3 -0
- package/studio/host.js +44179 -0
- package/studio/rolldown-runtime-B0aSnxlc.js +20 -0
- package/dist/studio/assets/ActivityEntryRow-D--fRvWI.js +0 -1
- package/dist/studio/assets/ActivityView-D-XBBUHb.js +0 -1
- package/dist/studio/assets/CreateDocumentDialog-CH8UH1QM.js +0 -1
- package/dist/studio/assets/DocumentsView-CxRpmAxt.js +0 -34
- package/dist/studio/assets/DropdownMenu-BSb1l7fr.js +0 -1
- package/dist/studio/assets/Input-DVao38h7.js +0 -3
- package/dist/studio/assets/MediaView-BHrPIjxB.js +0 -1
- package/dist/studio/assets/Modal-VNrXGa5C.js +0 -1
- package/dist/studio/assets/OverviewView-DfP6-mLZ.js +0 -1
- package/dist/studio/assets/Select-BJZIs9sY.js +0 -1
- package/dist/studio/assets/SettingsView-CerHe-ua.js +0 -1
- package/dist/studio/assets/Skeleton-CWJNi3nS.js +0 -1
- package/dist/studio/assets/StudioPageHeader-DP9HDAF2.js +0 -1
- package/dist/studio/assets/UsersView-cP3REkH2.js +0 -1
- package/dist/studio/assets/collaboration-BLnCzfvV.js +0 -4
- package/dist/studio/assets/context-dY4fNbn3.js +0 -1
- package/dist/studio/assets/editor-CE07wW83.js +0 -137
- package/dist/studio/assets/gateway-BAyQgCse.js +0 -10
- package/dist/studio/assets/index-CjoaPLhZ.js +0 -28
- package/dist/studio/assets/index-s2rPqCmP.css +0 -2
- package/dist/studio/assets/render-BkxbK2St.js +0 -83
- package/dist/studio/assets/rolldown-runtime-DK3Fl9T5.js +0 -1
- package/dist/studio/assets/useMediaLibrary-D7qR7aBf.js +0 -1
- package/dist/studio/index.html +0 -76
- package/src/AuthoringSchema-BQ5kbhVB.js.map +0 -1
- package/src/Configuration-BGYFD2N1.js +0 -150
- package/src/Configuration-BGYFD2N1.js.map +0 -1
- package/src/DocumentEngine-Da0kWotL.js.map +0 -1
- package/src/StudioHttp-BTLLooh0.js.map +0 -1
- package/src/installation-BNKaVjni.js.map +0 -1
- package/src/internal/component-metadata.js +0 -37
- package/src/internal/component-metadata.js.map +0 -1
- package/src/models-Citx8jBi.js.map +0 -1
- package/src/models-DS5ClMsH.js.map +0 -1
|
@@ -1,37 +0,0 @@
|
|
|
1
|
-
import { t as ComponentDefinition } from "../Configuration-BGYFD2N1.js";
|
|
2
|
-
|
|
3
|
-
//#region src/internal/component-metadata.ts
|
|
4
|
-
function cmsComponentDefinitions(metadata) {
|
|
5
|
-
const definitions = Object.values(metadata).filter((component) => component.global !== false).map((component) => ComponentDefinition.make({
|
|
6
|
-
name: component.kebabName,
|
|
7
|
-
props: component.meta.props.filter((prop) => !prop.global).map((prop) => ({
|
|
8
|
-
name: prop.name,
|
|
9
|
-
required: prop.required,
|
|
10
|
-
type: componentPropType(component.pascalName, prop.name, prop.type)
|
|
11
|
-
})),
|
|
12
|
-
slots: component.meta.slots.map((slot) => ({ name: slot.name }))
|
|
13
|
-
})).sort((left, right) => left.name.localeCompare(right.name));
|
|
14
|
-
const names = /* @__PURE__ */ new Set();
|
|
15
|
-
for (const definition of definitions) {
|
|
16
|
-
if (names.has(definition.name)) throw new Error(`Global document component "${definition.name}" is defined more than once.`);
|
|
17
|
-
names.add(definition.name);
|
|
18
|
-
}
|
|
19
|
-
return definitions;
|
|
20
|
-
}
|
|
21
|
-
function componentPropType(componentName, propName, declaredType) {
|
|
22
|
-
const classified = declaredType.split("|").map((member) => member.trim()).filter((member) => member !== "null" && member !== "undefined").map(classifyPropType);
|
|
23
|
-
const types = new Set(classified);
|
|
24
|
-
if (!classified.includes(void 0) && types.size === 1) return [...types][0];
|
|
25
|
-
throw new Error(`Global document component "${componentName}" prop "${propName}" has unsupported type "${declaredType}". Use one JSON-compatible string, number, boolean, array, or object type.`);
|
|
26
|
-
}
|
|
27
|
-
function classifyPropType(type) {
|
|
28
|
-
if (type === "string" || /^(['"]).*\1$/u.test(type)) return "string";
|
|
29
|
-
if (type === "number" || /^-?\d+(?:\.\d+)?$/u.test(type)) return "number";
|
|
30
|
-
if (type === "boolean" || type === "true" || type === "false") return "boolean";
|
|
31
|
-
if (/^(?:readonly\s+)?(?:Array|ReadonlyArray)</u.test(type) || type.endsWith("[]") || type.startsWith("[")) return "array";
|
|
32
|
-
if (type === "object" || type.startsWith("{") || /^(?:Readonly|Record)</u.test(type)) return "object";
|
|
33
|
-
}
|
|
34
|
-
|
|
35
|
-
//#endregion
|
|
36
|
-
export { cmsComponentDefinitions };
|
|
37
|
-
//# sourceMappingURL=component-metadata.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"component-metadata.js","names":["ComponentDefinitionSchema"],"sources":["../../../../src/internal/component-metadata.ts"],"sourcesContent":["import type { ComponentDefinition, ComponentPropDefinition } from '@internal/protocol/Configuration'\nimport { ComponentDefinition as ComponentDefinitionSchema } from '@internal/protocol/Configuration'\n\ninterface NuxtComponentMetadata {\n readonly global?: boolean | 'sync'\n readonly kebabName: string\n readonly meta: {\n readonly props: ReadonlyArray<{\n readonly global: boolean\n readonly name: string\n readonly required: boolean\n readonly type: string\n }>\n readonly slots: ReadonlyArray<{ readonly name: string }>\n }\n readonly pascalName: string\n}\n\nexport function cmsComponentDefinitions(\n metadata: Readonly<Record<string, NuxtComponentMetadata>>,\n): ReadonlyArray<ComponentDefinition> {\n const definitions = Object.values(metadata)\n // nuxt-component-meta is configured with globalsOnly; undefined means a\n // globally available component whose registration mode was not annotated.\n .filter((component) => component.global !== false)\n .map((component) =>\n ComponentDefinitionSchema.make({\n name: component.kebabName,\n props: component.meta.props\n .filter((prop) => !prop.global)\n .map((prop) => ({\n name: prop.name,\n required: prop.required,\n type: componentPropType(component.pascalName, prop.name, prop.type),\n })),\n slots: component.meta.slots.map((slot) => ({ name: slot.name })),\n }),\n )\n .sort((left, right) => left.name.localeCompare(right.name))\n\n const names = new Set<string>()\n for (const definition of definitions) {\n if (names.has(definition.name))\n throw new Error(`Global document component \"${definition.name}\" is defined more than once.`)\n names.add(definition.name)\n }\n return definitions\n}\n\nfunction componentPropType(\n componentName: string,\n propName: string,\n declaredType: string,\n): ComponentPropDefinition['type'] {\n const members = declaredType\n .split('|')\n .map((member) => member.trim())\n .filter((member) => member !== 'null' && member !== 'undefined')\n const classified = members.map(classifyPropType)\n const types = new Set(classified)\n if (!classified.includes(undefined) && types.size === 1) return [...types][0]!\n throw new Error(\n `Global document component \"${componentName}\" prop \"${propName}\" has unsupported type \"${declaredType}\". ` +\n 'Use one JSON-compatible string, number, boolean, array, or object type.',\n )\n}\n\nfunction classifyPropType(type: string): ComponentPropDefinition['type'] | undefined {\n if (type === 'string' || /^(['\"]).*\\1$/u.test(type)) return 'string'\n if (type === 'number' || /^-?\\d+(?:\\.\\d+)?$/u.test(type)) return 'number'\n if (type === 'boolean' || type === 'true' || type === 'false') return 'boolean'\n if (/^(?:readonly\\s+)?(?:Array|ReadonlyArray)</u.test(type) || type.endsWith('[]') || type.startsWith('['))\n return 'array'\n if (type === 'object' || type.startsWith('{') || /^(?:Readonly|Record)</u.test(type)) return 'object'\n return undefined\n}\n"],"mappings":";;;AAkBA,SAAgB,wBACd,UACoC;CACpC,MAAM,cAAc,OAAO,OAAO,QAAQ,CAAC,CAGxC,QAAQ,cAAc,UAAU,WAAW,KAAK,CAAC,CACjD,KAAK,cACJA,oBAA0B,KAAK;EAC7B,MAAM,UAAU;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G,OAAO;CACT,IAAI,SAAS,YAAY,KAAK,WAAW,GAAG,KAAK,yBAAyB,KAAK,IAAI,GAAG,OAAO;AAE/F"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"models-Citx8jBi.js","names":[],"sources":["../../../../protocol/src/internal/scalars.ts","../../../../protocol/src/internal/documents/scalars.ts","../../../../protocol/src/internal/configuration/scalars.ts","../../../../protocol/src/internal/documents/models.ts"],"sourcesContent":["import { Schema } from 'effect'\n\nexport const nonNegativeInt = Schema.Int.check(Schema.isGreaterThanOrEqualTo(0))\n\nexport const publicPathPattern = /^\\/(?!(?:[^/]+\\/)*\\.\\.?(?:\\/|$))(?:[^/?#\\\\]+(?:\\/[^/?#\\\\]+)*)?$/u\n","import { Schema } from 'effect'\nimport { nonNegativeInt, publicPathPattern } from '../scalars'\n\nconst relativeDocumentPathPattern = /^(?!(?:[^/]+\\/)*\\.\\.?(?:\\/|$))[^/?#\\\\]+(?:\\/[^/?#\\\\]+)*$/u\nconst slugPattern = /^[\\p{Letter}\\p{Number}][\\p{Letter}\\p{Number}_-]*$/u\nconst sourcePathPattern = /^(?!\\.)[^/?#\\\\]+(?:\\/(?!\\.)[^/?#\\\\]+)*\\.(?:md|mdc)$/u\n\nexport const DocumentGeneration = Schema.String.check(Schema.isPattern(/^(?:0|[1-9]\\d*)$/u)).pipe(\n Schema.brand('DocumentGeneration'),\n)\nexport type DocumentGeneration = typeof DocumentGeneration.Type\n\nexport const DocumentVersion = Schema.NonEmptyString.pipe(Schema.brand('DocumentVersion'))\nexport type DocumentVersion = typeof DocumentVersion.Type\n\nexport const DocumentHistoryCursor = Schema.NonEmptyString.pipe(Schema.brand('DocumentHistoryCursor'))\nexport type DocumentHistoryCursor = typeof DocumentHistoryCursor.Type\n\nexport const DocumentId = Schema.String.check(Schema.isUUID()).pipe(Schema.brand('DocumentId'))\nexport type DocumentId = typeof DocumentId.Type\n\nexport const EditorNodeId = Schema.String.check(Schema.isUUID()).pipe(Schema.brand('EditorNodeId'))\nexport type EditorNodeId = typeof EditorNodeId.Type\n\nexport const PublicPath = Schema.String.check(Schema.isPattern(publicPathPattern)).pipe(Schema.brand('PublicPath'))\nexport type PublicPath = typeof PublicPath.Type\n\nexport const RelativeDocumentPath = Schema.String.check(Schema.isPattern(relativeDocumentPathPattern)).pipe(\n Schema.brand('RelativeDocumentPath'),\n)\nexport type RelativeDocumentPath = typeof RelativeDocumentPath.Type\n\nexport const RevisionId = Schema.String.check(Schema.isUUID()).pipe(Schema.brand('RevisionId'))\nexport type RevisionId = typeof RevisionId.Type\n\nexport const RevisionNumber = nonNegativeInt.pipe(Schema.brand('RevisionNumber'))\nexport type RevisionNumber = typeof RevisionNumber.Type\n\nexport const Slug = Schema.String.check(Schema.isPattern(slugPattern)).pipe(Schema.brand('Slug'))\nexport type Slug = typeof Slug.Type\n\nexport const SourcePath = Schema.String.check(Schema.isPattern(sourcePathPattern)).pipe(Schema.brand('SourcePath'))\nexport type SourcePath = typeof SourcePath.Type\n","import { Schema } from 'effect'\nimport { publicPathPattern } from '../scalars'\n\nconst collectionNamePattern = /^[a-z][a-z0-9]*(?:[-_][a-z0-9]+)*$/u\nconst localePattern = /^[A-Za-z]{2,3}(?:-[A-Za-z0-9]{2,8})*$/u\nconst sourceDirectoryPattern = /^(?:\\.|(?!\\.)[^/?#\\\\]+(?:\\/(?!\\.)[^/?#\\\\]+)*)$/u\n\nexport const AddressPattern = Schema.String.check(Schema.isPattern(publicPathPattern)).pipe(\n Schema.brand('AddressPattern'),\n)\nexport type AddressPattern = typeof AddressPattern.Type\n\nexport const CollectionName = Schema.String.check(Schema.isPattern(collectionNamePattern)).pipe(\n Schema.brand('CollectionName'),\n)\nexport type CollectionName = typeof CollectionName.Type\n\nexport const Locale = Schema.String.check(Schema.isPattern(localePattern)).pipe(Schema.brand('Locale'))\nexport type Locale = typeof Locale.Type\n\nexport const SourceDirectory = Schema.String.check(Schema.isPattern(sourceDirectoryPattern)).pipe(\n Schema.brand('SourceDirectory'),\n)\nexport type SourceDirectory = typeof SourceDirectory.Type\n","import { Schema } from 'effect'\nimport { CollectionName, Locale } from '../configuration/scalars'\nimport { nonNegativeInt } from '../scalars'\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 'schema.option',\n 'schema.constraint',\n 'schema.required',\n 'schema.type',\n 'schema.unknown',\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' })\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})\nexport interface DocumentSourcePoint extends Schema.Schema.Type<typeof DocumentSourcePoint> {}\n\nexport const DocumentSourceRange = Schema.Struct({\n start: DocumentSourcePoint,\n end: DocumentSourcePoint,\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})\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' })\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})\nexport interface CmsDocumentHeading extends Schema.Schema.Type<typeof CmsDocumentHeading> {}\n\n/** Stable, JSON-safe analysis derived from the same document used for delivery. */\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})\nexport interface CmsDocumentAnalysis extends Schema.Schema.Type<typeof CmsDocumentAnalysis> {}\n\nexport const CompiledDocumentSource = Schema.Struct({\n path: SourcePath,\n mappings: Schema.Array(DocumentSourceMapping),\n})\nexport interface CompiledDocumentSource extends Schema.Schema.Type<typeof CompiledDocumentSource> {}\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 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' })\nexport interface CompiledDocument extends Schema.Schema.Type<typeof CompiledDocument> {}\n\nexport const DocumentSource = Schema.Struct({\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' })\nexport interface DocumentSource extends Schema.Schema.Type<typeof DocumentSource> {}\n\nexport const DocumentImportSource = Schema.Struct({\n sourcePath: SourcePath,\n markdown: Schema.String,\n published: Schema.Boolean,\n}).annotate({ identifier: 'DocumentImportSource' })\nexport interface DocumentImportSource extends Schema.Schema.Type<typeof DocumentImportSource> {}\n\nexport const DocumentImportMode = Schema.Literals(['preserve', 'overwrite'])\nexport type DocumentImportMode = typeof DocumentImportMode.Type\n\nexport const DocumentImportInput = Schema.Struct({\n sources: Schema.Array(DocumentImportSource),\n mode: DocumentImportMode,\n reason: Schema.optionalKey(Schema.NonEmptyString.check(Schema.isMaxLength(1_000))),\n}).annotate({ identifier: 'DocumentImportInput' })\nexport interface DocumentImportInput extends Schema.Schema.Type<typeof DocumentImportInput> {}\n\nexport const DocumentImportReport = Schema.Struct({\n created: nonNegativeInt,\n preserved: nonNegativeInt,\n published: nonNegativeInt,\n unchanged: nonNegativeInt,\n updated: nonNegativeInt,\n}).annotate({ identifier: 'DocumentImportReport' })\nexport interface DocumentImportReport extends Schema.Schema.Type<typeof DocumentImportReport> {}\n\nexport const DocumentSummary = Schema.Struct({\n sourcePath: SourcePath,\n version: DocumentVersion,\n document: CompiledDocument,\n}).annotate({ identifier: 'DocumentSummary' })\nexport interface DocumentSummary extends Schema.Schema.Type<typeof DocumentSummary> {}\n\nexport const DeletedDocument = Schema.Struct({\n documentId: DocumentId,\n deletedAt: Schema.DateTimeUtcFromString,\n sourcePath: SourcePath,\n version: DocumentVersion,\n}).annotate({ identifier: 'DeletedDocument' })\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' })\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'))\nexport type PublishedDocumentLookup = typeof PublishedDocumentLookup.Type\n\nexport const DocumentQueryScalar = Schema.Union([Schema.String, Schema.Finite, Schema.Boolean, Schema.Null])\nexport type DocumentQueryScalar = typeof DocumentQueryScalar.Type\n\nconst validDocumentQueryField = Schema.makeFilter<string>(\n (field) => {\n const segments = field.split('.')\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)\nexport type DocumentQueryField = typeof DocumentQueryField.Type\n\nexport const DocumentQueryValue = Schema.Union([\n DocumentQueryScalar,\n Schema.Array(DocumentQueryScalar).check(Schema.isMaxLength(20)),\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})\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' })\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' })\nexport interface PublishedDocumentQuery extends Schema.Schema.Type<typeof PublishedDocumentQuery> {}\n\nexport const PublishedDocumentSurroundQuery = Schema.Struct({\n ...PublishedDocumentSelection.fields,\n}).annotate({ identifier: 'PublishedDocumentSurroundQuery' })\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' })\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' })\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' })\nexport interface DocumentSurround extends Schema.Schema.Type<typeof DocumentSurround> {}\n\nexport const HomeDocumentLocation = Schema.Struct({\n kind: Schema.tag('home'),\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})\nexport interface NestedDocumentLocation extends Schema.Schema.Type<typeof NestedDocumentLocation> {}\n\nexport const DocumentLocation = Schema.Union([HomeDocumentLocation, NestedDocumentLocation]).pipe(\n Schema.toTaggedUnion('kind'),\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' })\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' })\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' })\nexport interface MoveDocumentInput extends Schema.Schema.Type<typeof MoveDocumentInput> {}\n\nexport const RemoveDocumentInput = Schema.Struct({\n documentId: DocumentId,\n expectedVersion: DocumentVersion,\n ...documentMutationMetadata,\n}).annotate({ identifier: 'RemoveDocumentInput' })\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' })\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' })\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' })\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)\nexport type DocumentRevisionAction = typeof DocumentRevisionAction.Type\n\nexport const DocumentMutationAction = Schema.Literals([...DOCUMENT_REVISION_ACTIONS, 'document.publish'])\nexport type DocumentMutationAction = typeof DocumentMutationAction.Type\n\nexport const DocumentMutationResult = Schema.Struct({\n action: DocumentMutationAction,\n documentId: DocumentId,\n generation: DocumentGeneration,\n revisionId: RevisionId,\n sourcePath: SourcePath,\n version: DocumentVersion,\n entry: Schema.optionalKey(DocumentSummary),\n}).annotate({ identifier: 'DocumentMutationResult' })\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' })\nexport interface DocumentValidationResult extends Schema.Schema.Type<typeof DocumentValidationResult> {}\n"],"mappings":";;;AAEA,MAAa,iBAAiB,OAAO,IAAI,MAAM,OAAO,uBAAuB,CAAC,CAAC;AAE/E,MAAa,oBAAoB;;;;ACDjC,MAAM,8BAA8B;AACpC,MAAM,cAAc;AACpB,MAAM,oBAAoB;AAE1B,MAAa,qBAAqB,OAAO,OAAO,MAAM,OAAO,UAAU,mBAAmB,CAAC,CAAC,CAAC,KAC3F,OAAO,MAAM,oBAAoB,CACnC;AAGA,MAAa,kBAAkB,OAAO,eAAe,KAAK,OAAO,MAAM,iBAAiB,CAAC;AAGzF,MAAa,wBAAwB,OAAO,eAAe,KAAK,OAAO,MAAM,uBAAuB,CAAC;AAGrG,MAAa,aAAa,OAAO,OAAO,MAAM,OAAO,OAAO,CAAC,CAAC,CAAC,KAAK,OAAO,MAAM,YAAY,CAAC;AAG9F,MAAa,eAAe,OAAO,OAAO,MAAM,OAAO,OAAO,CAAC,CAAC,CAAC,KAAK,OAAO,MAAM,cAAc,CAAC;AAGlG,MAAa,aAAa,OAAO,OAAO,MAAM,OAAO,UAAU,iBAAiB,CAAC,CAAC,CAAC,KAAK,OAAO,MAAM,YAAY,CAAC;AAGlH,MAAa,uBAAuB,OAAO,OAAO,MAAM,OAAO,UAAU,2BAA2B,CAAC,CAAC,CAAC,KACrG,OAAO,MAAM,sBAAsB,CACrC;AAGA,MAAa,aAAa,OAAO,OAAO,MAAM,OAAO,OAAO,CAAC,CAAC,CAAC,KAAK,OAAO,MAAM,YAAY,CAAC;A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a,uBAAuB,OAAO,OAAO;CAChD,YAAY;CACZ,YAAY;CACZ,iBAAiB;CACjB,GAAG;AACL,CAAC,CAAC,CAAC,SAAS,EAAE,YAAY,uBAAuB,CAAC;AAGlD,MAAa,wBAAwB,OAAO,OAAO;CACjD,YAAY;CACZ,iBAAiB;CACjB,GAAG;AACL,CAAC,CAAC,CAAC,SAAS,EAAE,YAAY,wBAAwB,CAAC;AAGnD,MAAa,4BAA4B;CACvC;CACA;CACA;CACA;CACA;CACA;AACF;AAEA,MAAa,yBAAyB,OAAO,SAAS,yBAAyB;AAG/E,MAAa,yBAAyB,OAAO,SAAS,CAAC,GAAG,2BAA2B,kBAAkB,CAAC;AAGxG,MAAa,yBAAyB,OAAO,OAAO;CAClD,QAAQ;CACR,YAAY;CACZ,YAAY;CACZ,YAAY;CACZ,YAAY;CACZ,SAAS;CACT,OAAO,OAAO,YAAY,eAAe;AAC3C,CAAC,CAAC,CAAC,SAAS,EAAE,YAAY,yBAAyB,CAAC;AAGpD,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 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"models-DS5ClMsH.js","names":[],"sources":["../../../../protocol/src/Identity.ts","../../../../protocol/src/internal/preview/models.ts"],"sourcesContent":["/** Cross-domain request correlation; decode unknown strings before crossing a seam. */\nimport { Schema } from 'effect'\n\nexport const RequestId = Schema.String.check(Schema.isUUID()).pipe(Schema.brand('RequestId'))\nexport type RequestId = typeof RequestId.Type\n","import { CompiledDocument, PublishedDocumentLookup } from '../../Documents'\nimport { RequestId } from '../../Identity'\nimport { CollectionName } from '../configuration/scalars'\nimport { DocumentGeneration, 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'))\nexport type PreviewSessionId = typeof PreviewSessionId.Type\n\nexport const PreviewIntentId = Schema.String.check(Schema.isUUID()).pipe(Schema.brand('PreviewIntentId'))\nexport type PreviewIntentId = typeof PreviewIntentId.Type\n\nconst exactOrigin = Schema.makeFilter<string>(\n (value) => {\n try {\n const url = new URL(value)\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'))\nexport type PreviewOrigin = typeof PreviewOrigin.Type\n\nexport const PreviewSessionRequest = Schema.Struct({\n previewOrigin: PreviewOrigin,\n}).annotate({ identifier: 'PreviewSessionRequest' })\nexport interface PreviewSessionRequest extends Schema.Schema.Type<typeof PreviewSessionRequest> {}\n\nexport const PreviewSession = Schema.Struct({\n editorOrigin: PreviewOrigin,\n expiresAt: Schema.DateTimeUtcFromString,\n previewOrigin: PreviewOrigin,\n sessionId: PreviewSessionId,\n token: Schema.NonEmptyString,\n}).annotate({ identifier: 'PreviewSession' })\nexport interface PreviewSession extends Schema.Schema.Type<typeof PreviewSession> {}\n\nexport const PreviewSessionAccess = Schema.Struct({ token: PreviewSession.fields.token }).annotate({\n identifier: 'PreviewSessionAccess',\n})\nexport interface PreviewSessionAccess extends Schema.Schema.Type<typeof PreviewSessionAccess> {}\n\nexport const PreviewDraftRequest = Schema.Struct({\n lookup: PublishedDocumentLookup,\n token: PreviewSession.fields.token,\n}).annotate({ identifier: 'PreviewDraftRequest' })\nexport interface PreviewDraftRequest extends Schema.Schema.Type<typeof PreviewDraftRequest> {}\n\nexport const PreviewInvalidation = Schema.Struct({\n generation: DocumentGeneration,\n type: Schema.tag('document-invalidated'),\n}).annotate({ identifier: 'PreviewInvalidation' })\nexport interface PreviewInvalidation extends Schema.Schema.Type<typeof PreviewInvalidation> {}\n\nexport class PreviewSessionInvalid extends Schema.TaggedError<PreviewSessionInvalid>()('Preview.SessionInvalid', {\n reason: Schema.Literals(['expired', 'invalid', 'origin']),\n}) {}\n\nexport class PreviewDraftNotFound extends Schema.TaggedError<PreviewDraftNotFound>()('Preview.DraftNotFound', {\n lookup: PublishedDocumentLookup,\n}) {}\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})\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})\nexport interface RenderedCompiledDocument extends Schema.Schema.Type<typeof RenderedCompiledDocument> {}\n\nexport const RenderedDocumentManifest = Schema.Struct({\n documents: Schema.Array(RenderedCompiledDocument),\n route: PublicPath,\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 PreviewManifestMessage,\n PreviewActivateMessage,\n PreviewAppliedMessage,\n PreviewRenderedMessage,\n]).pipe(Schema.toTaggedUnion('type'))\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":";;;;;AAGA,MAAa,YAAY,OAAO,OAAO,MAAM,OAAO,OAAO,CAAC,CAAC,CAAC,KAAK,OAAO,MAAM,WAAW,CAAC;;;;ACG5F,MAAa,2BAA2B;AAExC,MAAa,mBAAmB,OAAO,OAAO,MAAM,OAAO,OAAO,CAAC,CAAC,CAAC,KAAK,OAAO,MAAM,kBAAkB,CAAC;AAG1G,MAAa,kBAAkB,OAAO,OAAO,MAAM,OAAO,OAAO,CAAC,CAAC,CAAC,KAAK,OAAO,MAAM,iBAAiB,CAAC;AAGxG,MAAM,cAAc,OAAO,YACxB,UAAU;CACT,IAAI;EACF,MAAM,MAAM,IAAI,IAAI,KAAK;EACzB,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;AAGxG,MAAa,wBAAwB,OAAO,OAAO,EACjD,eAAe,cACjB,CAAC,CAAC,CAAC,SAAS,EAAE,YAAY,wBAAwB,CAAC;AAGnD,MAAa,iBAAiB,OAAO,OAAO;CAC1C,cAAc;CACd,WAAW,OAAO;CAClB,eAAe;CACf,WAAW;CACX,OAAO,OAAO;AAChB,CAAC,CAAC,CAAC,SAAS,EAAE,YAAY,iBAAiB,CAAC;AAG5C,MAAa,uBAAuB,OAAO,OAAO,EAAE,OAAO,eAAe,OAAO,MAAM,CAAC,CAAC,CAAC,SAAS,EACjG,YAAY,uBACd,CAAC;AAGD,MAAa,sBAAsB,OAAO,OAAO;CAC/C,QAAQ;CACR,OAAO,eAAe,OAAO;AAC/B,CAAC,CAAC,CAAC,SAAS,EAAE,YAAY,sBAAs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