@dotcms/vue 1.5.5
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 +571 -0
- package/index.d.ts +12 -0
- package/index.js +842 -0
- package/lib/__test__/mocks.d.ts +6 -0
- package/lib/components/Column/Column.vue.d.ts +12 -0
- package/lib/components/Container/Container.vue.d.ts +11 -0
- package/lib/components/Container/ContainerNotFound.vue.d.ts +6 -0
- package/lib/components/Container/EmptyContainer.vue.d.ts +2 -0
- package/lib/components/Contentlet/Contentlet.vue.d.ts +14 -0
- package/lib/components/Contentlet/constants.d.ts +2 -0
- package/lib/components/DotCMSBlockEditorRenderer/DotCMSBlockEditorRenderer.vue.d.ts +5 -0
- package/lib/components/DotCMSBlockEditorRenderer/components/BlockEditorBlock.vue.d.ts +13 -0
- package/lib/components/DotCMSBlockEditorRenderer/components/blocks/BulletList.vue.d.ts +17 -0
- package/lib/components/DotCMSBlockEditorRenderer/components/blocks/CodeBlock.vue.d.ts +22 -0
- package/lib/components/DotCMSBlockEditorRenderer/components/blocks/DotContent.vue.d.ts +10 -0
- package/lib/components/DotCMSBlockEditorRenderer/components/blocks/DotImage.vue.d.ts +7 -0
- package/lib/components/DotCMSBlockEditorRenderer/components/blocks/DotVideo.vue.d.ts +7 -0
- package/lib/components/DotCMSBlockEditorRenderer/components/blocks/GridBlock.vue.d.ts +10 -0
- package/lib/components/DotCMSBlockEditorRenderer/components/blocks/Heading.vue.d.ts +22 -0
- package/lib/components/DotCMSBlockEditorRenderer/components/blocks/ListItem.vue.d.ts +17 -0
- package/lib/components/DotCMSBlockEditorRenderer/components/blocks/NoComponentProvided.vue.d.ts +6 -0
- package/lib/components/DotCMSBlockEditorRenderer/components/blocks/OrderedList.vue.d.ts +17 -0
- package/lib/components/DotCMSBlockEditorRenderer/components/blocks/Paragraph.vue.d.ts +22 -0
- package/lib/components/DotCMSBlockEditorRenderer/components/blocks/Quote.vue.d.ts +17 -0
- package/lib/components/DotCMSBlockEditorRenderer/components/blocks/TableRenderer.vue.d.ts +15 -0
- package/lib/components/DotCMSBlockEditorRenderer/components/blocks/TextBlock.vue.d.ts +13 -0
- package/lib/components/DotCMSBlockEditorRenderer/components/blocks/UnknownBlock.vue.d.ts +10 -0
- package/lib/components/DotCMSBlockEditorRenderer/types.d.ts +44 -0
- package/lib/components/DotCMSEditableText/DotCMSEditableText.vue.d.ts +15 -0
- package/lib/components/DotCMSEditableText/utils.d.ts +22 -0
- package/lib/components/DotCMSLayoutBody/DotCMSLayoutBody.vue.d.ts +5 -0
- package/lib/components/DotCMSLayoutBody/components/ErrorMessage.vue.d.ts +2 -0
- package/lib/components/DotCMSLayoutBody/types.d.ts +17 -0
- package/lib/components/DotCMSShow/DotCMSShow.vue.d.ts +35 -0
- package/lib/components/FallbackComponent/FallbackComponent.vue.d.ts +13 -0
- package/lib/components/Row/Row.vue.d.ts +13 -0
- package/lib/composables/useCheckVisibleContent.d.ts +16 -0
- package/lib/composables/useDotCMSShowWhen.d.ts +18 -0
- package/lib/composables/useEditableDotCMSPage.d.ts +34 -0
- package/lib/composables/useIsAnalyticsActive.d.ts +14 -0
- package/lib/composables/useIsDevMode.d.ts +23 -0
- package/lib/contexts/dotcms-page.context.d.ts +61 -0
- package/lib/utils/toPlain.d.ts +12 -0
- package/package.json +47 -0
- package/test-setup.d.ts +0 -0
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
import { Component, ComputedRef, InjectionKey } from 'vue';
|
|
2
|
+
import { DotCMSPageAsset, DotCMSPageRendererMode } from '@dotcms/types';
|
|
3
|
+
/**
|
|
4
|
+
* The value carried by the dotCMS page context.
|
|
5
|
+
*
|
|
6
|
+
* This is the Vue analog of the React SDK's `DotCMSPageContext`. It is provided
|
|
7
|
+
* once by {@link DotCMSLayoutBody} and consumed by the internal layout tree
|
|
8
|
+
* (Container, Contentlet) as well as the dev-mode composable.
|
|
9
|
+
*
|
|
10
|
+
* @internal
|
|
11
|
+
*/
|
|
12
|
+
export interface DotCMSPageContextValue {
|
|
13
|
+
/** The dotCMS page asset containing the layout and containers. */
|
|
14
|
+
pageAsset: DotCMSPageAsset;
|
|
15
|
+
/** The renderer mode: `production` or `development`. */
|
|
16
|
+
mode: DotCMSPageRendererMode;
|
|
17
|
+
/**
|
|
18
|
+
* Map of content-type variable name to the Vue component that renders it.
|
|
19
|
+
* The special `CustomNoComponent` key is used as the fallback for unmatched
|
|
20
|
+
* content types.
|
|
21
|
+
*/
|
|
22
|
+
userComponents: Record<string, Component>;
|
|
23
|
+
/**
|
|
24
|
+
* Whether editor metadata (`data-dot-*`, placeholders, fallbacks) should be
|
|
25
|
+
* emitted. Resolved once at the layout root and shared with the whole tree
|
|
26
|
+
* so it isn't recomputed per contentlet.
|
|
27
|
+
*/
|
|
28
|
+
isDevMode: boolean;
|
|
29
|
+
/**
|
|
30
|
+
* Whether dotCMS Analytics is active. Resolved once at the layout root (a
|
|
31
|
+
* single `dotcms:analytics:ready` listener) and shared with the tree.
|
|
32
|
+
*/
|
|
33
|
+
isAnalyticsActive: boolean;
|
|
34
|
+
}
|
|
35
|
+
/**
|
|
36
|
+
* Injection key for the dotCMS page context.
|
|
37
|
+
*
|
|
38
|
+
* The value is a `ComputedRef` so that live UVE updates to the page (a new page
|
|
39
|
+
* asset arriving via `uve-set-page-data`) propagate to every consumer that reads
|
|
40
|
+
* `ctx.value` — the whole layout tree re-renders reactively.
|
|
41
|
+
*
|
|
42
|
+
* @internal
|
|
43
|
+
*/
|
|
44
|
+
export declare const DOTCMS_PAGE_CONTEXT: InjectionKey<ComputedRef<DotCMSPageContextValue>>;
|
|
45
|
+
/**
|
|
46
|
+
* Provides the dotCMS page context to descendant components.
|
|
47
|
+
*
|
|
48
|
+
* @internal
|
|
49
|
+
* @param value a computed producing the current context value
|
|
50
|
+
*/
|
|
51
|
+
export declare function provideDotCMSPageContext(value: ComputedRef<DotCMSPageContextValue>): void;
|
|
52
|
+
/**
|
|
53
|
+
* Injects the dotCMS page context as a reactive `ComputedRef`.
|
|
54
|
+
*
|
|
55
|
+
* Falls back to an empty context when used outside of a {@link DotCMSLayoutBody},
|
|
56
|
+
* mirroring the default value the React context is created with.
|
|
57
|
+
*
|
|
58
|
+
* @internal
|
|
59
|
+
* @returns the current page context value as a computed ref
|
|
60
|
+
*/
|
|
61
|
+
export declare function useDotCMSPageContext(): ComputedRef<DotCMSPageContextValue>;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Recursively unwrap Vue reactivity (refs / reactive proxies) into a plain,
|
|
3
|
+
* structured-clone-safe object.
|
|
4
|
+
*
|
|
5
|
+
* The UVE bridge sends data to the editor via `postMessage`, which uses the
|
|
6
|
+
* structured clone algorithm — and that throws a `DataCloneError` on Vue
|
|
7
|
+
* reactive Proxies. Values passed to UVE actions (`initUVE`, `editContentlet`,
|
|
8
|
+
* `enableBlockEditorInline`, …) commonly come through reactive props or
|
|
9
|
+
* `reactive()`, so unwrap them first. Plain values pass through untouched;
|
|
10
|
+
* cycles are guarded and non-plain objects (e.g. `Date`) are preserved as-is.
|
|
11
|
+
*/
|
|
12
|
+
export declare function toPlain<T>(value: T): T;
|
package/package.json
ADDED
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@dotcms/vue",
|
|
3
|
+
"version": "1.5.5",
|
|
4
|
+
"peerDependencies": {
|
|
5
|
+
"vue": ">=3.4"
|
|
6
|
+
},
|
|
7
|
+
"dependencies": {
|
|
8
|
+
"@dotcms/uve": "latest",
|
|
9
|
+
"@dotcms/client": "latest",
|
|
10
|
+
"@tinymce/tinymce-vue": "^6.1.0"
|
|
11
|
+
},
|
|
12
|
+
"devDependencies": {
|
|
13
|
+
"@dotcms/types": "latest"
|
|
14
|
+
},
|
|
15
|
+
"description": "Official Vue components library to render a dotCMS page.",
|
|
16
|
+
"repository": {
|
|
17
|
+
"type": "git",
|
|
18
|
+
"url": "git+https://github.com/dotCMS/core.git#main"
|
|
19
|
+
},
|
|
20
|
+
"keywords": [
|
|
21
|
+
"dotCMS",
|
|
22
|
+
"CMS",
|
|
23
|
+
"Content Management",
|
|
24
|
+
"API Client",
|
|
25
|
+
"REST API",
|
|
26
|
+
"Vue",
|
|
27
|
+
"Vue 3",
|
|
28
|
+
"Components"
|
|
29
|
+
],
|
|
30
|
+
"type": "module",
|
|
31
|
+
"main": "./index.js",
|
|
32
|
+
"module": "./index.js",
|
|
33
|
+
"types": "./index.d.ts",
|
|
34
|
+
"exports": {
|
|
35
|
+
"./package.json": "./package.json",
|
|
36
|
+
".": {
|
|
37
|
+
"types": "./index.d.ts",
|
|
38
|
+
"import": "./index.js"
|
|
39
|
+
}
|
|
40
|
+
},
|
|
41
|
+
"author": "dotcms <dev@dotcms.com>",
|
|
42
|
+
"license": "MIT",
|
|
43
|
+
"bugs": {
|
|
44
|
+
"url": "https://github.com/dotCMS/core/issues"
|
|
45
|
+
},
|
|
46
|
+
"homepage": "https://github.com/dotCMS/core/tree/main/core-web/libs/sdk/vue/README.md"
|
|
47
|
+
}
|
package/test-setup.d.ts
ADDED
|
File without changes
|