@phtngyn/cms 0.1.0-beta.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (120) hide show
  1. package/LICENSE +13 -0
  2. package/README.md +90 -0
  3. package/dist/studio/assets/ActivityEntryRow-D--fRvWI.js +1 -0
  4. package/dist/studio/assets/ActivityView-D-XBBUHb.js +1 -0
  5. package/dist/studio/assets/CreateDocumentDialog-CH8UH1QM.js +1 -0
  6. package/dist/studio/assets/DocumentsView-CxRpmAxt.js +34 -0
  7. package/dist/studio/assets/DropdownMenu-BSb1l7fr.js +1 -0
  8. package/dist/studio/assets/Input-DVao38h7.js +3 -0
  9. package/dist/studio/assets/MediaView-BHrPIjxB.js +1 -0
  10. package/dist/studio/assets/Modal-VNrXGa5C.js +1 -0
  11. package/dist/studio/assets/OverviewView-DfP6-mLZ.js +1 -0
  12. package/dist/studio/assets/Select-BJZIs9sY.js +1 -0
  13. package/dist/studio/assets/SettingsView-CerHe-ua.js +1 -0
  14. package/dist/studio/assets/Skeleton-CWJNi3nS.js +1 -0
  15. package/dist/studio/assets/StudioPageHeader-DP9HDAF2.js +1 -0
  16. package/dist/studio/assets/UsersView-cP3REkH2.js +1 -0
  17. package/dist/studio/assets/collaboration-BLnCzfvV.js +4 -0
  18. package/dist/studio/assets/context-dY4fNbn3.js +1 -0
  19. package/dist/studio/assets/editor-CE07wW83.js +137 -0
  20. package/dist/studio/assets/gateway-BAyQgCse.js +10 -0
  21. package/dist/studio/assets/index-CjoaPLhZ.js +28 -0
  22. package/dist/studio/assets/index-s2rPqCmP.css +2 -0
  23. package/dist/studio/assets/render-BkxbK2St.js +83 -0
  24. package/dist/studio/assets/rolldown-runtime-DK3Fl9T5.js +1 -0
  25. package/dist/studio/assets/useMediaLibrary-D7qR7aBf.js +1 -0
  26. package/dist/studio/index.html +76 -0
  27. package/package.json +75 -0
  28. package/src/Authoring.d.ts +46 -0
  29. package/src/Authoring.js +1 -0
  30. package/src/AuthoringSchema-BQ5kbhVB.js +926 -0
  31. package/src/AuthoringSchema-BQ5kbhVB.js.map +1 -0
  32. package/src/Configuration-BGYFD2N1.js +150 -0
  33. package/src/Configuration-BGYFD2N1.js.map +1 -0
  34. package/src/Configuration.d.ts +44 -0
  35. package/src/Configuration.js +9 -0
  36. package/src/Configuration.js.map +1 -0
  37. package/src/DocumentEngine-Da0kWotL.js +851 -0
  38. package/src/DocumentEngine-Da0kWotL.js.map +1 -0
  39. package/src/DocumentModel.d.ts +30 -0
  40. package/src/DocumentModel.js +15 -0
  41. package/src/DocumentModel.js.map +1 -0
  42. package/src/HttpPaths-86qLGB90.js +15 -0
  43. package/src/HttpPaths-86qLGB90.js.map +1 -0
  44. package/src/Module.d.ts +12 -0
  45. package/src/Module.js +167 -0
  46. package/src/Module.js.map +1 -0
  47. package/src/StudioHttp-BTLLooh0.js +916 -0
  48. package/src/StudioHttp-BTLLooh0.js.map +1 -0
  49. package/src/connection-ZGtL54qY.js +94 -0
  50. package/src/connection-ZGtL54qY.js.map +1 -0
  51. package/src/installation-BNKaVjni.js +9128 -0
  52. package/src/installation-BNKaVjni.js.map +1 -0
  53. package/src/internal/authoring-compiler.js +120 -0
  54. package/src/internal/authoring-compiler.js.map +1 -0
  55. package/src/internal/authoring-metadata.js +163 -0
  56. package/src/internal/authoring-metadata.js.map +1 -0
  57. package/src/internal/cms-config.js +46 -0
  58. package/src/internal/cms-config.js.map +1 -0
  59. package/src/internal/component-metadata.js +37 -0
  60. package/src/internal/component-metadata.js.map +1 -0
  61. package/src/internal/configuration.js +93 -0
  62. package/src/internal/configuration.js.map +1 -0
  63. package/src/internal/document-model.js +236 -0
  64. package/src/internal/document-model.js.map +1 -0
  65. package/src/internal/field-metadata.js +6 -0
  66. package/src/internal/field-metadata.js.map +1 -0
  67. package/src/metadata-Czvi3E4K.js +190 -0
  68. package/src/metadata-Czvi3E4K.js.map +1 -0
  69. package/src/models-Citx8jBi.js +306 -0
  70. package/src/models-Citx8jBi.js.map +1 -0
  71. package/src/models-DS5ClMsH.js +153 -0
  72. package/src/models-DS5ClMsH.js.map +1 -0
  73. package/src/runtime/api.js +9 -0
  74. package/src/runtime/api.js.map +1 -0
  75. package/src/runtime/collaboration.js +40 -0
  76. package/src/runtime/collaboration.js.map +1 -0
  77. package/src/runtime/delivery/DocumentField.js +23 -0
  78. package/src/runtime/delivery/DocumentField.js.map +1 -0
  79. package/src/runtime/delivery/DocumentRenderer.js +51 -0
  80. package/src/runtime/delivery/DocumentRenderer.js.map +1 -0
  81. package/src/runtime/delivery/DocumentScope.js +41 -0
  82. package/src/runtime/delivery/DocumentScope.js.map +1 -0
  83. package/src/runtime/delivery/document-page.js +23 -0
  84. package/src/runtime/delivery/document-page.js.map +1 -0
  85. package/src/runtime/delivery/document.js +25 -0
  86. package/src/runtime/delivery/document.js.map +1 -0
  87. package/src/runtime/delivery/preview.d.ts +11 -0
  88. package/src/runtime/delivery/preview.js +6 -0
  89. package/src/runtime/delivery/preview.js.map +1 -0
  90. package/src/runtime/delivery/types.d.ts +80 -0
  91. package/src/runtime/delivery/types.js +1 -0
  92. package/src/runtime/delivery/useDocument.d.ts +6 -0
  93. package/src/runtime/delivery/useDocument.js +20 -0
  94. package/src/runtime/delivery/useDocument.js.map +1 -0
  95. package/src/runtime/delivery/useDocumentQuery.d.ts +7 -0
  96. package/src/runtime/delivery/useDocumentQuery.js +26 -0
  97. package/src/runtime/delivery/useDocumentQuery.js.map +1 -0
  98. package/src/runtime/installation.js +3 -0
  99. package/src/runtime/plugin.js +32 -0
  100. package/src/runtime/plugin.js.map +1 -0
  101. package/src/runtime/preview/CmsStudioPreviewMarker.js +15 -0
  102. package/src/runtime/preview/CmsStudioPreviewMarker.js.map +1 -0
  103. package/src/runtime/preview/comark-document.js +38 -0
  104. package/src/runtime/preview/comark-document.js.map +1 -0
  105. package/src/runtime/preview/connection.js +3 -0
  106. package/src/runtime/preview/controller.js +247 -0
  107. package/src/runtime/preview/controller.js.map +1 -0
  108. package/src/runtime/preview/plugin.client.js +70 -0
  109. package/src/runtime/preview/plugin.client.js.map +1 -0
  110. package/src/runtime/preview/preview.css +9 -0
  111. package/src/runtime/preview/protocol.d.ts +10 -0
  112. package/src/runtime/preview/protocol.js +11 -0
  113. package/src/runtime/preview/protocol.js.map +1 -0
  114. package/src/runtime/preview/store.js +4 -0
  115. package/src/runtime/preview/targets.js +102 -0
  116. package/src/runtime/preview/targets.js.map +1 -0
  117. package/src/runtime/studio-app.js +13 -0
  118. package/src/runtime/studio-app.js.map +1 -0
  119. package/src/store-Nl4uxEXx.js +221 -0
  120. package/src/store-Nl4uxEXx.js.map +1 -0
@@ -0,0 +1,51 @@
1
+ import DocumentScope_default from "./DocumentScope.js";
2
+ import { Predicate } from "effect";
3
+ import { defineComponent, h } from "vue";
4
+ import { MarkdownDocument } from "@comark/vue";
5
+
6
+ //#region src/runtime/delivery/DocumentRenderer.ts
7
+ var DocumentRenderer_default = defineComponent({
8
+ name: "DocumentRenderer",
9
+ props: { value: {
10
+ required: true,
11
+ type: Object
12
+ } },
13
+ setup(props) {
14
+ return () => h(DocumentScope_default, {
15
+ as: "article",
16
+ role: "primary",
17
+ value: props.value
18
+ }, { default: ({ value }) => renderDocument(value) });
19
+ }
20
+ });
21
+ function renderDocument(value) {
22
+ return h(MarkdownDocument, {
23
+ documentKey: value.id,
24
+ value: toComarkDocument(value.body)
25
+ });
26
+ }
27
+ function toComarkDocument(document) {
28
+ return {
29
+ frontmatter: { ...document.frontmatter },
30
+ meta: { ...document.meta },
31
+ nodes: document.nodes.map(toComarkNode)
32
+ };
33
+ }
34
+ function toComarkNode(node) {
35
+ if (Predicate.isString(node)) return node;
36
+ if (node[0] === null) return [
37
+ null,
38
+ { ...node[1] },
39
+ node[2]
40
+ ];
41
+ const [tag, attributes, ...children] = node;
42
+ return [
43
+ tag,
44
+ { ...attributes },
45
+ ...children.map(toComarkNode)
46
+ ];
47
+ }
48
+
49
+ //#endregion
50
+ export { DocumentRenderer_default as default, renderDocument };
51
+ //# sourceMappingURL=DocumentRenderer.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"DocumentRenderer.js","names":["DocumentScope"],"sources":["../../../../../src/runtime/delivery/DocumentRenderer.ts"],"sourcesContent":["import type { PropType } from 'vue'\nimport type { MarkdownDocument as ComarkDocument, Node as ComarkNode } from 'comark'\nimport type { DeliveryDocument, DeliveryMarkdownDocument, DeliveryMarkdownNode } from './types'\nimport { MarkdownDocument } from '@comark/vue'\nimport { Predicate } from 'effect'\nimport { defineComponent, h } from 'vue'\nimport DocumentScope from './DocumentScope'\n\nexport default defineComponent({\n name: 'DocumentRenderer',\n props: {\n // SAFETY: DeliveryDocument is an object contract, so Object is its matching Vue runtime constructor.\n value: { required: true, type: Object as PropType<DeliveryDocument> },\n },\n setup(props) {\n return () =>\n h(\n DocumentScope,\n { as: 'article', role: 'primary', value: props.value },\n {\n default: ({ value }: { value: DeliveryDocument }) => renderDocument(value),\n },\n )\n },\n})\n\nexport function renderDocument(value: DeliveryDocument) {\n return h(MarkdownDocument, { documentKey: value.id, value: toComarkDocument(value.body) })\n}\n\nfunction toComarkDocument(document: DeliveryMarkdownDocument): ComarkDocument {\n return {\n frontmatter: { ...document.frontmatter },\n meta: { ...document.meta },\n nodes: document.nodes.map(toComarkNode),\n }\n}\n\nfunction toComarkNode(node: DeliveryMarkdownNode): ComarkNode {\n if (Predicate.isString(node)) return node\n if (node[0] === null) return [null, { ...node[1] }, node[2]]\n const [tag, attributes, ...children] = node\n return [tag, { ...attributes }, ...children.map(toComarkNode)]\n}\n"],"mappings":";;;;;;AAQA,+BAAe,gBAAgB;CAC7B,MAAM;CACN,OAAO,EAEL,OAAO;EAAE,UAAU;EAAM,MAAM;CAAqC,EACtE;CACA,MAAM,OAAO;EACX,aACE,EACEA,uBACA;GAAE,IAAI;GAAW,MAAM;GAAW,OAAO,MAAM;EAAM,GACrD,EACE,UAAU,EAAE,YAAyC,eAAe,KAAK,EAC3E,CACF;CACJ;AACF,CAAC;AAED,SAAgB,eAAe,OAAyB;CACtD,OAAO,EAAE,kBAAkB;EAAE,aAAa,MAAM;EAAI,OAAO,iBAAiB,MAAM,IAAI;CAAE,CAAC;AAC3F;AAEA,SAAS,iBAAiB,UAAoD;CAC5E,OAAO;EACL,aAAa,EAAE,GAAG,SAAS,YAAY;EACvC,MAAM,EAAE,GAAG,SAAS,KAAK;EACzB,OAAO,SAAS,MAAM,IAAI,YAAY;CACxC;AACF;AAEA,SAAS,aAAa,MAAwC;CAC5D,IAAI,UAAU,SAAS,IAAI,GAAG,OAAO;CACrC,IAAI,KAAK,OAAO,MAAM,OAAO;EAAC;EAAM,EAAE,GAAG,KAAK,GAAG;EAAG,KAAK;CAAE;CAC3D,MAAM,CAAC,KAAK,YAAY,GAAG,YAAY;CACvC,OAAO;EAAC;EAAK,EAAE,GAAG,WAAW;EAAG,GAAG,SAAS,IAAI,YAAY;CAAC;AAC/D"}
@@ -0,0 +1,41 @@
1
+ import { documentPreviewStoreKey } from "./preview.js";
2
+ import { computed, defineComponent, h, inject, onBeforeUnmount, onMounted, shallowRef, watch } from "vue";
3
+
4
+ //#region src/runtime/delivery/DocumentScope.ts
5
+ var DocumentScope_default = defineComponent({
6
+ name: "DocumentScope",
7
+ props: {
8
+ as: {
9
+ default: "div",
10
+ type: String
11
+ },
12
+ role: {
13
+ default: "embedded",
14
+ type: String
15
+ },
16
+ value: {
17
+ required: true,
18
+ type: Object
19
+ }
20
+ },
21
+ setup(props, { slots }) {
22
+ const preview = inject(documentPreviewStoreKey, void 0);
23
+ const stopRegistration = shallowRef();
24
+ const value = computed(() => preview?.resolve(props.value) ?? props.value);
25
+ function register() {
26
+ stopRegistration.value?.();
27
+ stopRegistration.value = preview?.register(props.value, props.role);
28
+ }
29
+ onMounted(register);
30
+ watch(() => [props.value, props.role], register);
31
+ onBeforeUnmount(() => stopRegistration.value?.());
32
+ return () => h(props.as, {
33
+ "data-cms-document": value.value.id,
34
+ "data-cms-role": props.role
35
+ }, slots.default?.({ value: value.value }));
36
+ }
37
+ });
38
+
39
+ //#endregion
40
+ export { DocumentScope_default as default };
41
+ //# sourceMappingURL=DocumentScope.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"DocumentScope.js","names":[],"sources":["../../../../../src/runtime/delivery/DocumentScope.ts"],"sourcesContent":["import type { PropType } from 'vue'\nimport type { DeliveryDocument } from './types'\nimport type { DocumentPreviewStore, PreviewDocumentRole } from './preview'\nimport { computed, defineComponent, h, inject, onBeforeUnmount, onMounted, shallowRef, watch } from 'vue'\nimport { documentPreviewStoreKey } from './preview'\n\nexport default defineComponent({\n name: 'DocumentScope',\n props: {\n as: { default: 'div', type: String },\n // SAFETY: PreviewDocumentRole is a string union, so String is its matching Vue runtime constructor.\n role: { default: 'embedded', type: String as PropType<PreviewDocumentRole> },\n // SAFETY: DeliveryDocument is an object contract, so Object is its matching Vue runtime constructor.\n value: { required: true, type: Object as PropType<DeliveryDocument> },\n },\n setup(props, { slots }) {\n const preview = inject<DocumentPreviewStore | undefined>(documentPreviewStoreKey, undefined)\n const stopRegistration = shallowRef<() => void>()\n const value = computed(() => preview?.resolve(props.value) ?? props.value)\n\n function register(): void {\n stopRegistration.value?.()\n stopRegistration.value = preview?.register(props.value, props.role)\n }\n\n onMounted(register)\n watch(() => [props.value, props.role] as const, register)\n onBeforeUnmount(() => stopRegistration.value?.())\n\n return () =>\n h(\n props.as,\n {\n 'data-cms-document': value.value.id,\n 'data-cms-role': props.role,\n },\n slots.default?.({ value: value.value }),\n )\n },\n})\n"],"mappings":";;;;AAMA,4BAAe,gBAAgB;CAC7B,MAAM;CACN,OAAO;EACL,IAAI;GAAE,SAAS;GAAO,MAAM;EAAO;EAEnC,MAAM;GAAE,SAAS;GAAY,MAAM;EAAwC;EAE3E,OAAO;GAAE,UAAU;GAAM,MAAM;EAAqC;CACtE;CACA,MAAM,OAAO,EAAE,SAAS;EACtB,MAAM,UAAU,OAAyC,yBAAyB,MAAS;EAC3F,MAAM,mBAAmB,WAAuB;EAChD,MAAM,QAAQ,eAAe,SAAS,QAAQ,MAAM,KAAK,KAAK,MAAM,KAAK;EAEzE,SAAS,WAAiB;GACxB,iBAAiB,QAAQ;GACzB,iBAAiB,QAAQ,SAAS,SAAS,MAAM,OAAO,MAAM,IAAI;EACpE;EAEA,UAAU,QAAQ;EAClB,YAAY,CAAC,MAAM,OAAO,MAAM,IAAI,GAAY,QAAQ;EACxD,sBAAsB,iBAAiB,QAAQ,CAAC;EAEhD,aACE,EACE,MAAM,IACN;GACE,qBAAqB,MAAM,MAAM;GACjC,iBAAiB,MAAM;EACzB,GACA,MAAM,UAAU,EAAE,OAAO,MAAM,MAAM,CAAC,CACxC;CACJ;AACF,CAAC"}
@@ -0,0 +1,23 @@
1
+ import DocumentRenderer_default from "./DocumentRenderer.js";
2
+ import { h } from "vue";
3
+
4
+ //#region src/runtime/delivery/document-page.ts
5
+ function resolveDocumentPage(request, registerMetadata) {
6
+ registerMetadata({
7
+ description: () => request.page()?.description,
8
+ title: () => request.page()?.title
9
+ });
10
+ return request.ready.then(() => {
11
+ const error = request.error();
12
+ if (error) throw error;
13
+ if (!request.page()) throw request.notFound();
14
+ return () => {
15
+ const page = request.page();
16
+ return page ? h(DocumentRenderer_default, { value: page }) : void 0;
17
+ };
18
+ });
19
+ }
20
+
21
+ //#endregion
22
+ export { resolveDocumentPage };
23
+ //# sourceMappingURL=document-page.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"document-page.js","names":["DocumentRenderer"],"sources":["../../../../../src/runtime/delivery/document-page.ts"],"sourcesContent":["import type { VNode } from 'vue'\nimport type { DeliveryDocument } from './types'\nimport { h } from 'vue'\nimport DocumentRenderer from './DocumentRenderer'\n\nexport interface DocumentPageMetadata {\n readonly description: () => string | undefined\n readonly title: () => string | undefined\n}\n\nexport interface DocumentPageRequest {\n readonly error: () => Error | undefined\n readonly notFound: () => Error\n readonly page: () => DeliveryDocument | null\n readonly ready: Promise<unknown>\n}\n\nexport function resolveDocumentPage(\n request: DocumentPageRequest,\n registerMetadata: (metadata: DocumentPageMetadata) => void,\n): Promise<() => VNode | undefined> {\n registerMetadata({\n description: () => request.page()?.description,\n title: () => request.page()?.title,\n })\n\n return request.ready.then(() => {\n const error = request.error()\n if (error) throw error\n if (!request.page()) throw request.notFound()\n\n return () => {\n const page = request.page()\n return page ? h(DocumentRenderer, { value: page }) : undefined\n }\n })\n}\n"],"mappings":";;;;AAiBA,SAAgB,oBACd,SACA,kBACkC;CAClC,iBAAiB;EACf,mBAAmB,QAAQ,KAAK,CAAC,EAAE;EACnC,aAAa,QAAQ,KAAK,CAAC,EAAE;CAC/B,CAAC;CAED,OAAO,QAAQ,MAAM,WAAW;EAC9B,MAAM,QAAQ,QAAQ,MAAM;EAC5B,IAAI,OAAO,MAAM;EACjB,IAAI,CAAC,QAAQ,KAAK,GAAG,MAAM,QAAQ,SAAS;EAE5C,aAAa;GACX,MAAM,OAAO,QAAQ,KAAK;GAC1B,OAAO,OAAO,EAAEA,0BAAkB,EAAE,OAAO,KAAK,CAAC,IAAI;EACvD;CACF,CAAC;AACH"}
@@ -0,0 +1,25 @@
1
+ import { resolveDocumentPage } from "./document-page.js";
2
+ import { useDocument } from "./useDocument.js";
3
+ import { createError, defineNuxtComponent, useRoute, useSeoMeta } from "nuxt/app";
4
+
5
+ //#region src/runtime/delivery/document.ts
6
+ var document_default = defineNuxtComponent({
7
+ name: "CmsDocumentPage",
8
+ setup() {
9
+ const route = useRoute();
10
+ const request = useDocument(() => route.path);
11
+ return resolveDocumentPage({
12
+ error: () => request.error.value,
13
+ notFound: () => createError({
14
+ statusCode: 404,
15
+ statusMessage: "Document not found"
16
+ }),
17
+ page: () => request.data.value,
18
+ ready: request
19
+ }, useSeoMeta);
20
+ }
21
+ });
22
+
23
+ //#endregion
24
+ export { document_default as default };
25
+ //# sourceMappingURL=document.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"document.js","names":[],"sources":["../../../../../src/runtime/delivery/document.ts"],"sourcesContent":["import { createError, defineNuxtComponent, useRoute, useSeoMeta } from 'nuxt/app'\nimport { resolveDocumentPage } from './document-page'\nimport { useDocument } from './useDocument'\n\nexport default defineNuxtComponent({\n name: 'CmsDocumentPage',\n setup() {\n const route = useRoute()\n const request = useDocument(() => route.path)\n return resolveDocumentPage(\n {\n error: () => request.error.value,\n notFound: () =>\n createError({\n statusCode: 404,\n statusMessage: 'Document not found',\n }),\n page: () => request.data.value,\n ready: request,\n },\n useSeoMeta,\n )\n },\n})\n"],"mappings":";;;;;AAIA,uBAAe,oBAAoB;CACjC,MAAM;CACN,QAAQ;EACN,MAAM,QAAQ,SAAS;EACvB,MAAM,UAAU,kBAAkB,MAAM,IAAI;EAC5C,OAAO,oBACL;GACE,aAAa,QAAQ,MAAM;GAC3B,gBACE,YAAY;IACV,YAAY;IACZ,eAAe;GACjB,CAAC;GACH,YAAY,QAAQ,KAAK;GACzB,OAAO;EACT,GACA,UACF;CACF;AACF,CAAC"}
@@ -0,0 +1,11 @@
1
+ import { DeliveryDocument } from "./types.js";
2
+ import { InjectionKey } from "vue";
3
+ //#region src/runtime/delivery/preview.d.ts
4
+ export type PreviewDocumentRole = 'embedded' | 'primary' | 'related' | 'summary';
5
+ export interface DocumentPreviewStore {
6
+ readonly register: (document: DeliveryDocument, role: PreviewDocumentRole) => () => void;
7
+ readonly resolve: (document: DeliveryDocument) => DeliveryDocument;
8
+ }
9
+ export declare const documentPreviewStoreKey: InjectionKey<DocumentPreviewStore>;
10
+ //#endregion
11
+ //# sourceMappingURL=preview.d.ts.map
@@ -0,0 +1,6 @@
1
+ //#region src/runtime/delivery/preview.ts
2
+ const documentPreviewStoreKey = Symbol("cms-preview-store");
3
+
4
+ //#endregion
5
+ export { documentPreviewStoreKey };
6
+ //# sourceMappingURL=preview.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"preview.js","names":[],"sources":["../../../../../src/runtime/delivery/preview.ts"],"sourcesContent":["import type { InjectionKey } from 'vue'\nimport type { DeliveryDocument } from './types'\n\nexport type PreviewDocumentRole = 'embedded' | 'primary' | 'related' | 'summary'\n\nexport interface DocumentPreviewStore {\n readonly register: (document: DeliveryDocument, role: PreviewDocumentRole) => () => void\n readonly resolve: (document: DeliveryDocument) => DeliveryDocument\n}\n\nexport const documentPreviewStoreKey: InjectionKey<DocumentPreviewStore> = Symbol('cms-preview-store')\n"],"mappings":";AAUA,MAAa,0BAA8D,OAAO,mBAAmB"}
@@ -0,0 +1,80 @@
1
+ //#region src/runtime/delivery/types.d.ts
2
+ export type DeliveryJson = null | boolean | number | string | ReadonlyArray<DeliveryJson> | DeliveryJsonObject;
3
+ export interface DeliveryJsonObject {
4
+ readonly [key: string]: DeliveryJson;
5
+ }
6
+ export type DeliveryMarkdownNode = string | readonly [null, DeliveryJsonObject, string] | readonly [string, DeliveryJsonObject, ...DeliveryMarkdownNode[]];
7
+ export interface DeliveryMarkdownDocument {
8
+ readonly frontmatter: DeliveryJsonObject;
9
+ readonly meta: DeliveryJsonObject;
10
+ readonly nodes: ReadonlyArray<DeliveryMarkdownNode>;
11
+ }
12
+ export interface DeliveryDocument {
13
+ readonly analysis: {
14
+ readonly components: ReadonlyArray<string>;
15
+ readonly headings: ReadonlyArray<{
16
+ readonly depth: number;
17
+ readonly id: string;
18
+ readonly text: string;
19
+ }>;
20
+ readonly searchText: string;
21
+ readonly summary: string;
22
+ };
23
+ readonly body: DeliveryMarkdownDocument;
24
+ readonly collection: string;
25
+ readonly data: DeliveryJsonObject;
26
+ readonly description?: string;
27
+ readonly draft: boolean;
28
+ readonly engineFingerprint: string;
29
+ readonly id: string;
30
+ readonly issues: ReadonlyArray<{
31
+ readonly code: string;
32
+ readonly collection?: string;
33
+ readonly field?: string;
34
+ readonly key?: string;
35
+ readonly locale?: string;
36
+ readonly message: string;
37
+ readonly severity: 'error' | 'warning';
38
+ readonly sourcePath?: string;
39
+ }>;
40
+ readonly key: string;
41
+ readonly locale?: string;
42
+ readonly path: string;
43
+ readonly source: {
44
+ readonly mappings: ReadonlyArray<{
45
+ readonly nodePath: ReadonlyArray<number>;
46
+ readonly range: {
47
+ readonly end: {
48
+ readonly column: number;
49
+ readonly line: number;
50
+ readonly offset: number;
51
+ };
52
+ readonly start: {
53
+ readonly column: number;
54
+ readonly line: number;
55
+ readonly offset: number;
56
+ };
57
+ };
58
+ }>;
59
+ readonly path: string;
60
+ };
61
+ readonly title: string;
62
+ }
63
+ export interface DeliveryDocumentPage {
64
+ readonly items: ReadonlyArray<DeliveryDocument>;
65
+ readonly total: number;
66
+ }
67
+ export interface DeliveryDocumentQuerySort {
68
+ readonly direction?: 'asc' | 'desc';
69
+ readonly field: string;
70
+ }
71
+ export interface DeliveryDocumentQuery {
72
+ readonly collection?: string;
73
+ readonly locale?: string;
74
+ readonly limit: number;
75
+ readonly offset?: number;
76
+ readonly sort?: DeliveryDocumentQuerySort | ReadonlyArray<DeliveryDocumentQuerySort>;
77
+ readonly where?: Readonly<Record<string, boolean | number | string | null | ReadonlyArray<boolean | number | string | null>>>;
78
+ }
79
+ //#endregion
80
+ //# sourceMappingURL=types.d.ts.map
@@ -0,0 +1 @@
1
+ export { };
@@ -0,0 +1,6 @@
1
+ import { DeliveryDocument } from "./types.js";
2
+ import { MaybeRefOrGetter } from "vue";
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>;
5
+ //#endregion
6
+ //# sourceMappingURL=useDocument.d.ts.map
@@ -0,0 +1,20 @@
1
+ import { r as CMS_DELIVERY_READ_PATH } from "../../HttpPaths-86qLGB90.js";
2
+ import { computed, toValue } from "vue";
3
+ import { useFetch } from "nuxt/app";
4
+
5
+ //#region src/runtime/delivery/useDocument.ts
6
+ function useDocument(path) {
7
+ const body = computed(() => ({
8
+ kind: "path",
9
+ path: toValue(path)
10
+ }));
11
+ return useFetch(CMS_DELIVERY_READ_PATH, {
12
+ body,
13
+ default: () => null,
14
+ method: "POST"
15
+ });
16
+ }
17
+
18
+ //#endregion
19
+ export { useDocument };
20
+ //# sourceMappingURL=useDocument.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useDocument.js","names":[],"sources":["../../../../../src/runtime/delivery/useDocument.ts"],"sourcesContent":["import { useFetch } from 'nuxt/app'\nimport type { MaybeRefOrGetter } from 'vue'\nimport { computed, toValue } from 'vue'\nimport { CMS_DELIVERY_READ_PATH } from '@internal/protocol/HttpPaths'\nimport type { DeliveryDocument } from './types'\n\nexport function useDocument(path: MaybeRefOrGetter<string>) {\n const body = computed(() => ({ kind: 'path' as const, path: toValue(path) }))\n return useFetch<DeliveryDocument | null>(CMS_DELIVERY_READ_PATH, {\n body,\n default: () => null,\n method: 'POST',\n })\n}\n"],"mappings":";;;;;AAMA,SAAgB,YAAY,MAAgC;CAC1D,MAAM,OAAO,gBAAgB;EAAE,MAAM;EAAiB,MAAM,QAAQ,IAAI;CAAE,EAAE;CAC5E,OAAO,SAAkC,wBAAwB;EAC/D;EACA,eAAe;EACf,QAAQ;CACV,CAAC;AACH"}
@@ -0,0 +1,7 @@
1
+ import { DeliveryDocumentPage, DeliveryDocumentQuery, DeliveryDocumentQuerySort } from "./types.js";
2
+ import { MaybeRefOrGetter } from "vue";
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>;
5
+ //#endregion
6
+ export type { DeliveryDocumentQuery, DeliveryDocumentQuerySort };
7
+ //# sourceMappingURL=useDocumentQuery.d.ts.map
@@ -0,0 +1,26 @@
1
+ import { n as CMS_DELIVERY_QUERY_PATH } from "../../HttpPaths-86qLGB90.js";
2
+ import { computed, toValue } from "vue";
3
+ import { useFetch } from "nuxt/app";
4
+
5
+ //#region src/runtime/delivery/useDocumentQuery.ts
6
+ function useDocumentQuery(query) {
7
+ const body = computed(() => {
8
+ const value = toValue(query);
9
+ return {
10
+ ...value,
11
+ sort: value.sort === void 0 ? void 0 : Array.isArray(value.sort) ? value.sort : [value.sort]
12
+ };
13
+ });
14
+ return useFetch(CMS_DELIVERY_QUERY_PATH, {
15
+ body,
16
+ default: () => ({
17
+ items: [],
18
+ total: 0
19
+ }),
20
+ method: "POST"
21
+ });
22
+ }
23
+
24
+ //#endregion
25
+ export { useDocumentQuery };
26
+ //# sourceMappingURL=useDocumentQuery.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useDocumentQuery.js","names":[],"sources":["../../../../../src/runtime/delivery/useDocumentQuery.ts"],"sourcesContent":["import { useFetch } from 'nuxt/app'\nimport type { MaybeRefOrGetter } from 'vue'\nimport { computed, toValue } from 'vue'\nimport { CMS_DELIVERY_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 body = computed(() => {\n const value = toValue(query)\n return {\n ...value,\n sort: value.sort === undefined ? undefined : Array.isArray(value.sort) ? value.sort : [value.sort],\n }\n })\n return useFetch<DeliveryDocumentPage>(CMS_DELIVERY_QUERY_PATH, {\n body,\n default: () => ({ items: [], total: 0 }),\n method: 'POST',\n })\n}\n"],"mappings":";;;;;AAQA,SAAgB,iBAAiB,OAAgD;CAC/E,MAAM,OAAO,eAAe;EAC1B,MAAM,QAAQ,QAAQ,KAAK;EAC3B,OAAO;GACL,GAAG;GACH,MAAM,MAAM,SAAS,SAAY,SAAY,MAAM,QAAQ,MAAM,IAAI,IAAI,MAAM,OAAO,CAAC,MAAM,IAAI;EACnG;CACF,CAAC;CACD,OAAO,SAA+B,yBAAyB;EAC7D;EACA,gBAAgB;GAAE,OAAO,CAAC;GAAG,OAAO;EAAE;EACtC,QAAQ;CACV,CAAC;AACH"}
@@ -0,0 +1,3 @@
1
+ import { n as toS3MediaObjectStoreOptions, t as installCms } from "../installation-BNKaVjni.js";
2
+
3
+ export { installCms, toS3MediaObjectStoreOptions };
@@ -0,0 +1,32 @@
1
+ import { resolveCmsInstallation } from "../internal/configuration.js";
2
+ import { t as installCms } from "../installation-BNKaVjni.js";
3
+ import { Effect } from "effect";
4
+ import { defineNitroPlugin, useNitroApp } from "nitropack/runtime";
5
+
6
+ //#region src/runtime/plugin.ts
7
+ function createInstallationPlugin(authored, componentMetadata, initialSources, authoring = []) {
8
+ return defineNitroPlugin((nitro) => {
9
+ if (nitro.cmsInstallation) throw new Error("The CMS installation is already registered with Nitro.");
10
+ const configuration = resolveCmsInstallation(authored, componentMetadata, initialSources, authoring);
11
+ const installation = Effect.runPromise(installCms(configuration));
12
+ nitro.cmsInstallation = installation;
13
+ installation.catch((cause) => {
14
+ nitro.captureError(cause instanceof Error ? cause : new Error(String(cause)), {
15
+ fatal: true,
16
+ tags: ["cms"]
17
+ });
18
+ });
19
+ nitro.hooks.hook("close", () => installation.then((current) => current.close(), () => void 0).finally(() => {
20
+ if (nitro.cmsInstallation === installation) nitro.cmsInstallation = void 0;
21
+ }));
22
+ });
23
+ }
24
+ function useCmsInstallation() {
25
+ const installation = useNitroApp().cmsInstallation;
26
+ if (!installation) throw new Error("The CMS installation has not been registered with Nitro.");
27
+ return installation;
28
+ }
29
+
30
+ //#endregion
31
+ export { createInstallationPlugin, useCmsInstallation };
32
+ //# sourceMappingURL=plugin.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"plugin.js","names":[],"sources":["../../../../src/runtime/plugin.ts"],"sourcesContent":["import type { CmsInstallation } from '@internal/platform-node/Installation'\nimport type { DocumentImportSource } from '@internal/protocol/Documents'\nimport type { ComponentDefinition } from '@internal/protocol/Configuration'\nimport type { CmsConfiguration } from '../Configuration'\nimport type { cmsComponentDefinitions } from '../internal/component-metadata'\nimport { Effect } from 'effect'\nimport { defineNitroPlugin, useNitroApp } from 'nitropack/runtime'\nimport { resolveCmsInstallation } from '../internal/configuration'\nimport { installCms } from './installation'\n\ndeclare module 'nitropack/types' {\n interface NitroApp {\n cmsInstallation?: Promise<CmsInstallation>\n }\n}\n\nexport function createInstallationPlugin(\n authored: CmsConfiguration,\n componentMetadata: Parameters<typeof cmsComponentDefinitions>[0],\n initialSources: ReadonlyArray<DocumentImportSource>,\n authoring: ReadonlyArray<ComponentDefinition> = [],\n) {\n return defineNitroPlugin((nitro) => {\n if (nitro.cmsInstallation) throw new Error('The CMS installation is already registered with Nitro.')\n const configuration = resolveCmsInstallation(authored, componentMetadata, initialSources, authoring)\n const installation = Effect.runPromise(installCms(configuration))\n nitro.cmsInstallation = installation\n\n void installation.catch((cause: unknown) => {\n nitro.captureError(cause instanceof Error ? cause : new Error(String(cause)), {\n fatal: true,\n tags: ['cms'],\n })\n })\n nitro.hooks.hook('close', () =>\n installation\n .then(\n (current) => current.close(),\n () => undefined,\n )\n .finally(() => {\n if (nitro.cmsInstallation === installation) nitro.cmsInstallation = undefined\n }),\n )\n })\n}\n\nexport function useCmsInstallation(): Promise<CmsInstallation> {\n const installation = useNitroApp().cmsInstallation\n if (!installation) throw new Error('The CMS installation has not been registered with Nitro.')\n return installation\n}\n"],"mappings":";;;;;;AAgBA,SAAgB,yBACd,UACA,mBACA,gBACA,YAAgD,CAAC,GACjD;CACA,OAAO,mBAAmB,UAAU;EAClC,IAAI,MAAM,iBAAiB,MAAM,IAAI,MAAM,wDAAwD;EACnG,MAAM,gBAAgB,uBAAuB,UAAU,mBAAmB,gBAAgB,SAAS;EACnG,MAAM,eAAe,OAAO,WAAW,WAAW,aAAa,CAAC;EAChE,MAAM,kBAAkB;EAExB,AAAK,aAAa,OAAO,UAAmB;GAC1C,MAAM,aAAa,iBAAiB,QAAQ,QAAQ,IAAI,MAAM,OAAO,KAAK,CAAC,GAAG;IAC5E,OAAO;IACP,MAAM,CAAC,KAAK;GACd,CAAC;EACH,CAAC;EACD,MAAM,MAAM,KAAK,eACf,aACG,MACE,YAAY,QAAQ,MAAM,SACrB,MACR,CAAC,CACA,cAAc;GACb,IAAI,MAAM,oBAAoB,cAAc,MAAM,kBAAkB;EACtE,CAAC,CACL;CACF,CAAC;AACH;AAEA,SAAgB,qBAA+C;CAC7D,MAAM,eAAe,YAAY,CAAC,CAAC;CACnC,IAAI,CAAC,cAAc,MAAM,IAAI,MAAM,0DAA0D;CAC7F,OAAO;AACT"}
@@ -0,0 +1,15 @@
1
+ import { CMS_PREVIEW_INLINE_HOST_ATTRIBUTE } from "./protocol.js";
2
+ import { defineComponent, h, mergeProps } from "vue";
3
+
4
+ //#region src/runtime/preview/CmsStudioPreviewMarker.ts
5
+ var CmsStudioPreviewMarker_default = defineComponent({
6
+ inheritAttrs: false,
7
+ name: "CmsStudioPreviewMarker",
8
+ setup(_props, { attrs, slots }) {
9
+ return () => h("span", mergeProps(attrs, { style: "data-cms-inline-host" in attrs ? void 0 : { display: "contents" } }), slots.default?.());
10
+ }
11
+ });
12
+
13
+ //#endregion
14
+ export { CmsStudioPreviewMarker_default as default };
15
+ //# sourceMappingURL=CmsStudioPreviewMarker.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"CmsStudioPreviewMarker.js","names":[],"sources":["../../../../../src/runtime/preview/CmsStudioPreviewMarker.ts"],"sourcesContent":["import { defineComponent, h, mergeProps } from 'vue'\nimport { CMS_PREVIEW_INLINE_HOST_ATTRIBUTE } from './protocol'\n\nexport default defineComponent({\n inheritAttrs: false,\n name: 'CmsStudioPreviewMarker',\n setup(_props, { attrs, slots }) {\n return () =>\n h(\n 'span',\n mergeProps(attrs, {\n style: CMS_PREVIEW_INLINE_HOST_ATTRIBUTE in attrs ? undefined : { display: 'contents' },\n }),\n slots.default?.(),\n )\n },\n})\n"],"mappings":";;;;AAGA,qCAAe,gBAAgB;CAC7B,cAAc;CACd,MAAM;CACN,MAAM,QAAQ,EAAE,OAAO,SAAS;EAC9B,aACE,EACE,QACA,WAAW,OAAO,EAChB,iCAA4C,QAAQ,SAAY,EAAE,SAAS,WAAW,EACxF,CAAC,GACD,MAAM,UAAU,CAClB;CACJ;AACF,CAAC"}
@@ -0,0 +1,38 @@
1
+ import { Predicate, Schema } from "effect";
2
+
3
+ //#region src/runtime/preview/comark-document.ts
4
+ const isJsonObject = Schema.is(Schema.JsonObject);
5
+ /** Adapts the immutable wire model to the mutable tree owned by the Nuxt Comark renderer. */
6
+ function toPreviewRenderDocument(document) {
7
+ return {
8
+ frontmatter: mutableJsonObject(document.frontmatter),
9
+ meta: mutableJsonObject(document.meta),
10
+ nodes: document.nodes.map(toRenderNode)
11
+ };
12
+ }
13
+ function toRenderNode(node) {
14
+ if (Predicate.isString(node)) return node;
15
+ if (node[0] === null) return [
16
+ null,
17
+ mutableJsonObject(node[1]),
18
+ node[2]
19
+ ];
20
+ const [tag, attributes, ...children] = node;
21
+ return [
22
+ tag,
23
+ mutableJsonObject(attributes),
24
+ ...children.map(toRenderNode)
25
+ ];
26
+ }
27
+ function mutableJsonObject(value) {
28
+ return Object.fromEntries(Object.entries(value).map(([key, child]) => [key, mutableJson(child)]));
29
+ }
30
+ function mutableJson(value) {
31
+ if (Array.isArray(value)) return value.map(mutableJson);
32
+ if (isJsonObject(value)) return mutableJsonObject(value);
33
+ return value;
34
+ }
35
+
36
+ //#endregion
37
+ export { toPreviewRenderDocument };
38
+ //# sourceMappingURL=comark-document.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"comark-document.js","names":[],"sources":["../../../../../src/runtime/preview/comark-document.ts"],"sourcesContent":["import type { CmsMarkdownDocument, MarkdownNode } from '@internal/protocol/Documents'\nimport type { MarkdownDocument, Node } from 'comark'\nimport { Predicate, Schema } from 'effect'\n\nconst isJsonObject = Schema.is(Schema.JsonObject)\n\n/** Adapts the immutable wire model to the mutable tree owned by the Nuxt Comark renderer. */\nexport function toPreviewRenderDocument(document: CmsMarkdownDocument): MarkdownDocument {\n return {\n frontmatter: mutableJsonObject(document.frontmatter),\n meta: mutableJsonObject(document.meta),\n nodes: document.nodes.map(toRenderNode),\n }\n}\n\nfunction toRenderNode(node: MarkdownNode): Node {\n if (Predicate.isString(node)) return node\n if (node[0] === null) return [null, mutableJsonObject(node[1]), node[2]]\n const [tag, attributes, ...children] = node\n return [tag, mutableJsonObject(attributes), ...children.map(toRenderNode)]\n}\n\nfunction mutableJsonObject(value: Schema.JsonObject): Record<string, Schema.Json> {\n return Object.fromEntries(Object.entries(value).map(([key, child]) => [key, mutableJson(child)]))\n}\n\nfunction mutableJson(value: Schema.Json): Schema.Json {\n if (Array.isArray(value)) return value.map(mutableJson)\n if (isJsonObject(value)) return mutableJsonObject(value)\n return value\n}\n"],"mappings":";;;AAIA,MAAM,eAAe,OAAO,GAAG,OAAO,UAAU;;AAGhD,SAAgB,wBAAwB,UAAiD;CACvF,OAAO;EACL,aAAa,kBAAkB,SAAS,WAAW;EACnD,MAAM,kBAAkB,SAAS,IAAI;EACrC,OAAO,SAAS,MAAM,IAAI,YAAY;CACxC;AACF;AAEA,SAAS,aAAa,MAA0B;CAC9C,IAAI,UAAU,SAAS,IAAI,GAAG,OAAO;CACrC,IAAI,KAAK,OAAO,MAAM,OAAO;EAAC;EAAM,kBAAkB,KAAK,EAAE;EAAG,KAAK;CAAE;CACvE,MAAM,CAAC,KAAK,YAAY,GAAG,YAAY;CACvC,OAAO;EAAC;EAAK,kBAAkB,UAAU;EAAG,GAAG,SAAS,IAAI,YAAY;CAAC;AAC3E;AAEA,SAAS,kBAAkB,OAAuD;CAChF,OAAO,OAAO,YAAY,OAAO,QAAQ,KAAK,CAAC,CAAC,KAAK,CAAC,KAAK,WAAW,CAAC,KAAK,YAAY,KAAK,CAAC,CAAC,CAAC;AAClG;AAEA,SAAS,YAAY,OAAiC;CACpD,IAAI,MAAM,QAAQ,KAAK,GAAG,OAAO,MAAM,IAAI,WAAW;CACtD,IAAI,aAAa,KAAK,GAAG,OAAO,kBAAkB,KAAK;CACvD,OAAO;AACT"}
@@ -0,0 +1,3 @@
1
+ import { t as openSitePreviewConnection } from "../../connection-ZGtL54qY.js";
2
+
3
+ export { openSitePreviewConnection };