@dotcms/vue 1.5.5-next.2350
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 +719 -0
- package/index.d.ts +16 -0
- package/index.js +912 -0
- package/lib/__test__/mocks.d.ts +6 -0
- package/lib/client/dotcms-client.plugin.d.ts +79 -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 +25 -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 +20 -0
- package/lib/composables/useEditableDotCMSPage.d.ts +37 -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 +74 -0
- package/lib/utils/imageLoader.d.ts +54 -0
- package/lib/utils/toPlain.d.ts +12 -0
- package/package.json +47 -0
- package/test-setup.d.ts +0 -0
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { DotCMSBasicContentlet, DotCMSColumnContainer, DotCMSPageAsset, DotPageAssetLayoutColumn } from '@dotcms/types';
|
|
2
|
+
export declare const MOCK_COLUMN: DotPageAssetLayoutColumn;
|
|
3
|
+
export declare const MOCK_CONTAINER: DotCMSColumnContainer;
|
|
4
|
+
export declare const MOCK_CONTENTLET: DotCMSBasicContentlet;
|
|
5
|
+
export declare const MOCK_PAGE_ASSET: DotCMSPageAsset;
|
|
6
|
+
export declare const PAGE_ASSET_NO_BODY: DotCMSPageAsset;
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
import { App, InjectionKey } from 'vue';
|
|
2
|
+
import { createDotCMSClient } from '@dotcms/client';
|
|
3
|
+
import { DotCMSClientConfig } from '@dotcms/types';
|
|
4
|
+
/**
|
|
5
|
+
* The dotCMS client instance created by {@link createDotCMSClient}. Use this
|
|
6
|
+
* type to annotate variables that hold the injected client.
|
|
7
|
+
*/
|
|
8
|
+
export type DotCMSClient = ReturnType<typeof createDotCMSClient>;
|
|
9
|
+
/**
|
|
10
|
+
* Injection key for the dotCMS client.
|
|
11
|
+
*
|
|
12
|
+
* Advanced: exported so a consumer can `inject(DOTCMS_CLIENT)` directly (e.g.
|
|
13
|
+
* outside a `setup()` where {@link useDotCMSClient} would throw), but prefer
|
|
14
|
+
* {@link useDotCMSClient}.
|
|
15
|
+
*/
|
|
16
|
+
export declare const DOTCMS_CLIENT: InjectionKey<DotCMSClient>;
|
|
17
|
+
/**
|
|
18
|
+
* A Vue plugin returned by {@link createDotCMSVue}. Install it with `app.use`.
|
|
19
|
+
*/
|
|
20
|
+
export interface DotCMSVuePlugin {
|
|
21
|
+
install(app: App): void;
|
|
22
|
+
/** The client instance the plugin provides. Handy for use outside components. */
|
|
23
|
+
client: DotCMSClient;
|
|
24
|
+
}
|
|
25
|
+
/**
|
|
26
|
+
* Creates the dotCMS Vue plugin.
|
|
27
|
+
*
|
|
28
|
+
* Builds a single dotCMS client from `config` and provides it to the whole app
|
|
29
|
+
* so components can retrieve it with {@link useDotCMSClient} — no module-level
|
|
30
|
+
* singleton to import. This is the Vue analog of Angular's `provideDotCMSClient`.
|
|
31
|
+
*
|
|
32
|
+
* The created client is also exposed on the returned object as `.client`, so
|
|
33
|
+
* non-component code (route loaders, plain modules) can share the same instance.
|
|
34
|
+
*
|
|
35
|
+
* @param config - the same configuration accepted by `createDotCMSClient`
|
|
36
|
+
* @returns a Vue plugin to pass to `app.use()`
|
|
37
|
+
*
|
|
38
|
+
* @example
|
|
39
|
+
* ```ts
|
|
40
|
+
* import { createApp } from 'vue';
|
|
41
|
+
* import { createDotCMSVue } from '@dotcms/vue';
|
|
42
|
+
* import App from './App.vue';
|
|
43
|
+
*
|
|
44
|
+
* const app = createApp(App);
|
|
45
|
+
*
|
|
46
|
+
* app.use(
|
|
47
|
+
* createDotCMSVue({
|
|
48
|
+
* dotcmsUrl: 'https://demo.dotcms.com',
|
|
49
|
+
* authToken: 'your-auth-token',
|
|
50
|
+
* siteId: 'your-site-id',
|
|
51
|
+
* requestOptions: {
|
|
52
|
+
* // UVE needs fresh data so in-context edits are reflected immediately.
|
|
53
|
+
* cache: 'no-cache'
|
|
54
|
+
* }
|
|
55
|
+
* })
|
|
56
|
+
* );
|
|
57
|
+
*
|
|
58
|
+
* app.mount('#app');
|
|
59
|
+
* ```
|
|
60
|
+
*/
|
|
61
|
+
export declare function createDotCMSVue(config: DotCMSClientConfig): DotCMSVuePlugin;
|
|
62
|
+
/**
|
|
63
|
+
* Retrieves the dotCMS client provided by {@link createDotCMSVue}.
|
|
64
|
+
*
|
|
65
|
+
* Must be called from a component `setup` (or another composable). Throws if the
|
|
66
|
+
* plugin was not installed with `app.use(createDotCMSVue(...))`, so a missing
|
|
67
|
+
* provider fails loudly instead of returning `undefined`.
|
|
68
|
+
*
|
|
69
|
+
* @returns the dotCMS client instance
|
|
70
|
+
*
|
|
71
|
+
* @example
|
|
72
|
+
* ```ts
|
|
73
|
+
* import { useDotCMSClient } from '@dotcms/vue';
|
|
74
|
+
*
|
|
75
|
+
* const client = useDotCMSClient();
|
|
76
|
+
* const { pageAsset } = await client.page.get({ path: '/' });
|
|
77
|
+
* ```
|
|
78
|
+
*/
|
|
79
|
+
export declare function useDotCMSClient(): DotCMSClient;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { DotPageAssetLayoutColumn } from '@dotcms/types';
|
|
2
|
+
/**
|
|
3
|
+
* @internal
|
|
4
|
+
* Renders a single column of the 12-column grid. Position is derived from the
|
|
5
|
+
* column's `leftOffset`/`width` — the same values the React SDK turns into
|
|
6
|
+
* `col-start-*`/`col-end-*` classes, applied here as inline grid styles.
|
|
7
|
+
*/
|
|
8
|
+
type __VLS_Props = {
|
|
9
|
+
column: DotPageAssetLayoutColumn;
|
|
10
|
+
};
|
|
11
|
+
declare const _default: import('vue').DefineComponent<__VLS_Props, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, HTMLDivElement>;
|
|
12
|
+
export default _default;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { DotCMSColumnContainer } from '@dotcms/types';
|
|
2
|
+
/**
|
|
3
|
+
* @internal
|
|
4
|
+
* Renders a dotCMS container and the contentlets placed inside it. Container
|
|
5
|
+
* metadata (`data-dot-*`) is editor-only and stripped from live output.
|
|
6
|
+
*/
|
|
7
|
+
type __VLS_Props = {
|
|
8
|
+
container: DotCMSColumnContainer;
|
|
9
|
+
};
|
|
10
|
+
declare const _default: import('vue').DefineComponent<__VLS_Props, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, any>;
|
|
11
|
+
export default _default;
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
/** @internal Dev-only message shown when a container cannot be found on the page. */
|
|
2
|
+
type __VLS_Props = {
|
|
3
|
+
identifier: string;
|
|
4
|
+
};
|
|
5
|
+
declare const _default: import('vue').DefineComponent<__VLS_Props, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, any>;
|
|
6
|
+
export default _default;
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
declare const _default: import('vue').DefineComponent<{}, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, true, {}, any>;
|
|
2
|
+
export default _default;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { DotCMSBasicContentlet } from '@dotcms/types';
|
|
2
|
+
/**
|
|
3
|
+
* @internal
|
|
4
|
+
* Renders a single contentlet: resolves the user component for its content type
|
|
5
|
+
* (falling back to a dev-only placeholder) and emits the editor `data-dot-*`
|
|
6
|
+
* metadata only when in development/edit mode.
|
|
7
|
+
*/
|
|
8
|
+
type __VLS_Props = {
|
|
9
|
+
contentlet: DotCMSBasicContentlet;
|
|
10
|
+
/** JSON-serialized container data the contentlet belongs to. */
|
|
11
|
+
container: string;
|
|
12
|
+
};
|
|
13
|
+
declare const _default: import('vue').DefineComponent<__VLS_Props, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, HTMLDivElement>;
|
|
14
|
+
export default _default;
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { BlockEditorRendererProps } from './types';
|
|
2
|
+
declare const _default: import('vue').DefineComponent<BlockEditorRendererProps, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<BlockEditorRendererProps> & Readonly<{}>, {
|
|
3
|
+
isDevMode: boolean;
|
|
4
|
+
}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, any>;
|
|
5
|
+
export default _default;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { BlockEditorNode } from '@dotcms/types';
|
|
2
|
+
import { CustomRenderer } from '../types';
|
|
3
|
+
/**
|
|
4
|
+
* Recursive dispatcher: renders a list of block-editor nodes, delegating each to
|
|
5
|
+
* a custom renderer (if provided) or the matching built-in block component.
|
|
6
|
+
*/
|
|
7
|
+
type __VLS_Props = {
|
|
8
|
+
content?: BlockEditorNode[];
|
|
9
|
+
customRenderers?: CustomRenderer;
|
|
10
|
+
isDevMode?: boolean;
|
|
11
|
+
};
|
|
12
|
+
declare const _default: import('vue').DefineComponent<__VLS_Props, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, any>;
|
|
13
|
+
export default _default;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
declare function __VLS_template(): {
|
|
2
|
+
attrs: Partial<{}>;
|
|
3
|
+
slots: {
|
|
4
|
+
default?(_: {}): any;
|
|
5
|
+
};
|
|
6
|
+
refs: {};
|
|
7
|
+
rootEl: HTMLUListElement;
|
|
8
|
+
};
|
|
9
|
+
type __VLS_TemplateResult = ReturnType<typeof __VLS_template>;
|
|
10
|
+
declare const __VLS_component: import('vue').DefineComponent<{}, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, true, {}, HTMLUListElement>;
|
|
11
|
+
declare const _default: __VLS_WithTemplateSlots<typeof __VLS_component, __VLS_TemplateResult["slots"]>;
|
|
12
|
+
export default _default;
|
|
13
|
+
type __VLS_WithTemplateSlots<T, S> = T & {
|
|
14
|
+
new (): {
|
|
15
|
+
$slots: S;
|
|
16
|
+
};
|
|
17
|
+
};
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { BlockEditorNode } from '@dotcms/types';
|
|
2
|
+
/** Renders a code block, exposing the language via `data-language`. */
|
|
3
|
+
type __VLS_Props = {
|
|
4
|
+
node: BlockEditorNode;
|
|
5
|
+
};
|
|
6
|
+
declare function __VLS_template(): {
|
|
7
|
+
attrs: Partial<{}>;
|
|
8
|
+
slots: {
|
|
9
|
+
default?(_: {}): any;
|
|
10
|
+
};
|
|
11
|
+
refs: {};
|
|
12
|
+
rootEl: HTMLPreElement;
|
|
13
|
+
};
|
|
14
|
+
type __VLS_TemplateResult = ReturnType<typeof __VLS_template>;
|
|
15
|
+
declare const __VLS_component: import('vue').DefineComponent<__VLS_Props, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, HTMLPreElement>;
|
|
16
|
+
declare const _default: __VLS_WithTemplateSlots<typeof __VLS_component, __VLS_TemplateResult["slots"]>;
|
|
17
|
+
export default _default;
|
|
18
|
+
type __VLS_WithTemplateSlots<T, S> = T & {
|
|
19
|
+
new (): {
|
|
20
|
+
$slots: S;
|
|
21
|
+
};
|
|
22
|
+
};
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { BlockEditorNode } from '@dotcms/types';
|
|
2
|
+
import { CustomRenderer } from '../../types';
|
|
3
|
+
/** Renders an embedded contentlet block via a custom renderer keyed by content type. */
|
|
4
|
+
type __VLS_Props = {
|
|
5
|
+
node: BlockEditorNode;
|
|
6
|
+
customRenderers?: CustomRenderer;
|
|
7
|
+
isDevMode?: boolean;
|
|
8
|
+
};
|
|
9
|
+
declare const _default: import('vue').DefineComponent<__VLS_Props, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, any>;
|
|
10
|
+
export default _default;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { BlockEditorNode } from '@dotcms/types';
|
|
2
|
+
/** Renders a dotCMS image block with optional text-wrap / alignment. */
|
|
3
|
+
type __VLS_Props = {
|
|
4
|
+
node: BlockEditorNode;
|
|
5
|
+
};
|
|
6
|
+
declare const _default: import('vue').DefineComponent<__VLS_Props, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, HTMLElement>;
|
|
7
|
+
export default _default;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { BlockEditorNode } from '@dotcms/types';
|
|
2
|
+
/** Renders a dotCMS video block. */
|
|
3
|
+
type __VLS_Props = {
|
|
4
|
+
node: BlockEditorNode;
|
|
5
|
+
};
|
|
6
|
+
declare const _default: import('vue').DefineComponent<__VLS_Props, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, HTMLVideoElement>;
|
|
7
|
+
export default _default;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { BlockEditorNode } from '@dotcms/types';
|
|
2
|
+
import { CustomRenderer } from '../../types';
|
|
3
|
+
/** Renders a two-column grid block over a 12-column grid. */
|
|
4
|
+
type __VLS_Props = {
|
|
5
|
+
node: BlockEditorNode;
|
|
6
|
+
customRenderers?: CustomRenderer;
|
|
7
|
+
isDevMode?: boolean;
|
|
8
|
+
};
|
|
9
|
+
declare const _default: import('vue').DefineComponent<__VLS_Props, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, HTMLDivElement>;
|
|
10
|
+
export default _default;
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { BlockEditorNode } from '@dotcms/types';
|
|
2
|
+
/** Renders a heading block as h1..h6 based on `node.attrs.level` (default 1). */
|
|
3
|
+
type __VLS_Props = {
|
|
4
|
+
node: BlockEditorNode;
|
|
5
|
+
};
|
|
6
|
+
declare function __VLS_template(): {
|
|
7
|
+
attrs: Partial<{}>;
|
|
8
|
+
slots: {
|
|
9
|
+
default?(_: {}): any;
|
|
10
|
+
};
|
|
11
|
+
refs: {};
|
|
12
|
+
rootEl: any;
|
|
13
|
+
};
|
|
14
|
+
type __VLS_TemplateResult = ReturnType<typeof __VLS_template>;
|
|
15
|
+
declare const __VLS_component: import('vue').DefineComponent<__VLS_Props, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, any>;
|
|
16
|
+
declare const _default: __VLS_WithTemplateSlots<typeof __VLS_component, __VLS_TemplateResult["slots"]>;
|
|
17
|
+
export default _default;
|
|
18
|
+
type __VLS_WithTemplateSlots<T, S> = T & {
|
|
19
|
+
new (): {
|
|
20
|
+
$slots: S;
|
|
21
|
+
};
|
|
22
|
+
};
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
declare function __VLS_template(): {
|
|
2
|
+
attrs: Partial<{}>;
|
|
3
|
+
slots: {
|
|
4
|
+
default?(_: {}): any;
|
|
5
|
+
};
|
|
6
|
+
refs: {};
|
|
7
|
+
rootEl: HTMLLIElement;
|
|
8
|
+
};
|
|
9
|
+
type __VLS_TemplateResult = ReturnType<typeof __VLS_template>;
|
|
10
|
+
declare const __VLS_component: import('vue').DefineComponent<{}, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, true, {}, HTMLLIElement>;
|
|
11
|
+
declare const _default: __VLS_WithTemplateSlots<typeof __VLS_component, __VLS_TemplateResult["slots"]>;
|
|
12
|
+
export default _default;
|
|
13
|
+
type __VLS_WithTemplateSlots<T, S> = T & {
|
|
14
|
+
new (): {
|
|
15
|
+
$slots: S;
|
|
16
|
+
};
|
|
17
|
+
};
|
package/lib/components/DotCMSBlockEditorRenderer/components/blocks/NoComponentProvided.vue.d.ts
ADDED
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
/** Dev-only warning shown when a contentlet block has no matching custom renderer. */
|
|
2
|
+
type __VLS_Props = {
|
|
3
|
+
contentType?: string;
|
|
4
|
+
};
|
|
5
|
+
declare const _default: import('vue').DefineComponent<__VLS_Props, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, HTMLDivElement>;
|
|
6
|
+
export default _default;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
declare function __VLS_template(): {
|
|
2
|
+
attrs: Partial<{}>;
|
|
3
|
+
slots: {
|
|
4
|
+
default?(_: {}): any;
|
|
5
|
+
};
|
|
6
|
+
refs: {};
|
|
7
|
+
rootEl: HTMLOListElement;
|
|
8
|
+
};
|
|
9
|
+
type __VLS_TemplateResult = ReturnType<typeof __VLS_template>;
|
|
10
|
+
declare const __VLS_component: import('vue').DefineComponent<{}, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, true, {}, HTMLOListElement>;
|
|
11
|
+
declare const _default: __VLS_WithTemplateSlots<typeof __VLS_component, __VLS_TemplateResult["slots"]>;
|
|
12
|
+
export default _default;
|
|
13
|
+
type __VLS_WithTemplateSlots<T, S> = T & {
|
|
14
|
+
new (): {
|
|
15
|
+
$slots: S;
|
|
16
|
+
};
|
|
17
|
+
};
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { BlockEditorNode } from '@dotcms/types';
|
|
2
|
+
/** Renders a paragraph block, applying any node attrs as inline styles. */
|
|
3
|
+
type __VLS_Props = {
|
|
4
|
+
node: BlockEditorNode;
|
|
5
|
+
};
|
|
6
|
+
declare function __VLS_template(): {
|
|
7
|
+
attrs: Partial<{}>;
|
|
8
|
+
slots: {
|
|
9
|
+
default?(_: {}): any;
|
|
10
|
+
};
|
|
11
|
+
refs: {};
|
|
12
|
+
rootEl: HTMLParagraphElement;
|
|
13
|
+
};
|
|
14
|
+
type __VLS_TemplateResult = ReturnType<typeof __VLS_template>;
|
|
15
|
+
declare const __VLS_component: import('vue').DefineComponent<__VLS_Props, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, HTMLParagraphElement>;
|
|
16
|
+
declare const _default: __VLS_WithTemplateSlots<typeof __VLS_component, __VLS_TemplateResult["slots"]>;
|
|
17
|
+
export default _default;
|
|
18
|
+
type __VLS_WithTemplateSlots<T, S> = T & {
|
|
19
|
+
new (): {
|
|
20
|
+
$slots: S;
|
|
21
|
+
};
|
|
22
|
+
};
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
declare function __VLS_template(): {
|
|
2
|
+
attrs: Partial<{}>;
|
|
3
|
+
slots: {
|
|
4
|
+
default?(_: {}): any;
|
|
5
|
+
};
|
|
6
|
+
refs: {};
|
|
7
|
+
rootEl: HTMLQuoteElement;
|
|
8
|
+
};
|
|
9
|
+
type __VLS_TemplateResult = ReturnType<typeof __VLS_template>;
|
|
10
|
+
declare const __VLS_component: import('vue').DefineComponent<{}, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, true, {}, HTMLQuoteElement>;
|
|
11
|
+
declare const _default: __VLS_WithTemplateSlots<typeof __VLS_component, __VLS_TemplateResult["slots"]>;
|
|
12
|
+
export default _default;
|
|
13
|
+
type __VLS_WithTemplateSlots<T, S> = T & {
|
|
14
|
+
new (): {
|
|
15
|
+
$slots: S;
|
|
16
|
+
};
|
|
17
|
+
};
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { BlockEditorNode } from '@dotcms/types';
|
|
2
|
+
import { CustomRenderer } from '../../types';
|
|
3
|
+
/**
|
|
4
|
+
* Renders a table block. Cell type — not row position — decides `<th>` vs `<td>`
|
|
5
|
+
* (`node.type === 'tableHeader'`), matching the VTL renderer, so column headers
|
|
6
|
+
* in any row keep their semantic wrapper and `scope`.
|
|
7
|
+
*/
|
|
8
|
+
type __VLS_Props = {
|
|
9
|
+
content: BlockEditorNode[];
|
|
10
|
+
attrs?: BlockEditorNode['attrs'];
|
|
11
|
+
customRenderers?: CustomRenderer;
|
|
12
|
+
isDevMode?: boolean;
|
|
13
|
+
};
|
|
14
|
+
declare const _default: import('vue').DefineComponent<__VLS_Props, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, HTMLTableElement>;
|
|
15
|
+
export default _default;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { BlockEditorMark } from '@dotcms/types';
|
|
2
|
+
/**
|
|
3
|
+
* Renders a text node, applying its marks (bold, italic, link, ...) recursively.
|
|
4
|
+
*
|
|
5
|
+
* Each mark wraps a `TextBlock` of the remaining marks, so nested formatting is
|
|
6
|
+
* preserved. When no marks remain the raw text is emitted.
|
|
7
|
+
*/
|
|
8
|
+
type __VLS_Props = {
|
|
9
|
+
text?: string;
|
|
10
|
+
marks?: BlockEditorMark[];
|
|
11
|
+
};
|
|
12
|
+
declare const _default: import('vue').DefineComponent<__VLS_Props, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, any>;
|
|
13
|
+
export default _default;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { BlockEditorNode } from '@dotcms/types';
|
|
2
|
+
/**
|
|
3
|
+
* Renders an unknown block. Shows a visible warning only inside the UVE; in the
|
|
4
|
+
* live site it renders nothing to avoid leaking editor scaffolding.
|
|
5
|
+
*/
|
|
6
|
+
type __VLS_Props = {
|
|
7
|
+
node: BlockEditorNode;
|
|
8
|
+
};
|
|
9
|
+
declare const _default: import('vue').DefineComponent<__VLS_Props, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, any>;
|
|
10
|
+
export default _default;
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import { BlockEditorNode } from '@dotcms/types';
|
|
2
|
+
import { Component, CSSProperties } from 'vue';
|
|
3
|
+
/**
|
|
4
|
+
* Props that every custom block renderer receives.
|
|
5
|
+
*
|
|
6
|
+
* A custom renderer is a Vue component that gets the full {@link BlockEditorNode}
|
|
7
|
+
* as its `node` prop and the already-rendered children in its default slot.
|
|
8
|
+
*
|
|
9
|
+
* @template TData the type of data stored in `node.attrs.data` (contentlet blocks)
|
|
10
|
+
*/
|
|
11
|
+
export interface CustomRendererProps<TData = unknown> {
|
|
12
|
+
/** The full BlockEditorNode with attrs, marks, content, etc. */
|
|
13
|
+
node: BlockEditorNode & {
|
|
14
|
+
attrs?: {
|
|
15
|
+
data?: TData;
|
|
16
|
+
[key: string]: unknown;
|
|
17
|
+
};
|
|
18
|
+
};
|
|
19
|
+
}
|
|
20
|
+
/**
|
|
21
|
+
* A custom renderer component — a Vue component whose props include the `node`
|
|
22
|
+
* (typed via {@link CustomRendererProps}) plus a default slot with the rendered
|
|
23
|
+
* children.
|
|
24
|
+
*/
|
|
25
|
+
export type CustomRendererComponent = Component<CustomRendererProps>;
|
|
26
|
+
/**
|
|
27
|
+
* Map of block type name to the custom renderer component that should render it.
|
|
28
|
+
*/
|
|
29
|
+
export type CustomRenderer = Record<string, CustomRendererComponent>;
|
|
30
|
+
/**
|
|
31
|
+
* Props for {@link DotCMSBlockEditorRenderer}.
|
|
32
|
+
*/
|
|
33
|
+
export interface BlockEditorRendererProps {
|
|
34
|
+
/** The block editor field value (a root node with `content`). */
|
|
35
|
+
blocks: BlockEditorNode;
|
|
36
|
+
/** Inline styles for the container element. */
|
|
37
|
+
style?: CSSProperties;
|
|
38
|
+
/** CSS class for the container element. */
|
|
39
|
+
className?: string;
|
|
40
|
+
/** Custom renderers keyed by block type (or content type for contentlet blocks). */
|
|
41
|
+
customRenderers?: CustomRenderer;
|
|
42
|
+
/** When true, renders helpful dev-only messages for invalid/unknown blocks. */
|
|
43
|
+
isDevMode?: boolean;
|
|
44
|
+
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { DotCMSBasicContentlet } from '@dotcms/types';
|
|
2
|
+
import { DotCMSEditableTextProps } from './utils';
|
|
3
|
+
declare const _default: <T extends DotCMSBasicContentlet>(__VLS_props: NonNullable<Awaited<typeof __VLS_setup>>["props"], __VLS_ctx?: __VLS_PrettifyLocal<Pick<NonNullable<Awaited<typeof __VLS_setup>>, "attrs" | "emit" | "slots">>, __VLS_expose?: NonNullable<Awaited<typeof __VLS_setup>>["expose"], __VLS_setup?: Promise<{
|
|
4
|
+
props: __VLS_PrettifyLocal<Pick<Partial<{}> & Omit<{} & import('vue').VNodeProps & import('vue').AllowedComponentProps & import('vue').ComponentCustomProps, never>, never> & DotCMSEditableTextProps<T> & Partial<{}>> & import('vue').PublicProps;
|
|
5
|
+
expose(exposed: import('vue').ShallowUnwrapRef<{}>): void;
|
|
6
|
+
attrs: any;
|
|
7
|
+
slots: {};
|
|
8
|
+
emit: {};
|
|
9
|
+
}>) => import('vue').VNode & {
|
|
10
|
+
__ctx?: Awaited<typeof __VLS_setup>;
|
|
11
|
+
};
|
|
12
|
+
export default _default;
|
|
13
|
+
type __VLS_PrettifyLocal<T> = {
|
|
14
|
+
[K in keyof T]: T[K];
|
|
15
|
+
} & {};
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { DotCMSBasicContentlet } from '@dotcms/types';
|
|
2
|
+
export type DOT_EDITABLE_TEXT_FORMAT = 'html' | 'text';
|
|
3
|
+
export type DOT_EDITABLE_TEXT_MODE = 'minimal' | 'full' | 'plain';
|
|
4
|
+
/**
|
|
5
|
+
* Props for {@link DotCMSEditableText}.
|
|
6
|
+
*/
|
|
7
|
+
export interface DotCMSEditableTextProps<T extends DotCMSBasicContentlet = DotCMSBasicContentlet> {
|
|
8
|
+
/** The contentlet whose field is edited. */
|
|
9
|
+
contentlet: T;
|
|
10
|
+
/** The field of the contentlet to edit. */
|
|
11
|
+
fieldName: keyof T;
|
|
12
|
+
/** The editor format — `text` or `html`. Defaults to `text`. */
|
|
13
|
+
format?: DOT_EDITABLE_TEXT_FORMAT;
|
|
14
|
+
/** The editor toolbar preset — `plain`, `minimal` or `full`. Defaults to `plain`. */
|
|
15
|
+
mode?: DOT_EDITABLE_TEXT_MODE;
|
|
16
|
+
}
|
|
17
|
+
type TinyMCEInit = Record<string, unknown>;
|
|
18
|
+
/**
|
|
19
|
+
* TinyMCE init config per editor mode, composed from the shared dotCMS presets.
|
|
20
|
+
*/
|
|
21
|
+
export declare const TINYMCE_CONFIG: Record<DOT_EDITABLE_TEXT_MODE, TinyMCEInit>;
|
|
22
|
+
export {};
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { DotCMSLayoutBodyProps } from './types';
|
|
2
|
+
declare const _default: import('vue').DefineComponent<DotCMSLayoutBodyProps, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<DotCMSLayoutBodyProps> & Readonly<{}>, {
|
|
3
|
+
mode: import('@dotcms/types').DotCMSPageRendererMode;
|
|
4
|
+
}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, any>;
|
|
5
|
+
export default _default;
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
declare const _default: import('vue').DefineComponent<{}, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, true, {}, any>;
|
|
2
|
+
export default _default;
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { DotCMSPageAsset, DotCMSPageRendererMode } from '@dotcms/types';
|
|
2
|
+
import { Component } from 'vue';
|
|
3
|
+
/**
|
|
4
|
+
* Prefix for the per-contentlet named slots of {@link DotCMSLayoutBody}. A slot
|
|
5
|
+
* named `contentlet-<identifier>` overrides the mapped component for the
|
|
6
|
+
* contentlet with that identifier.
|
|
7
|
+
*
|
|
8
|
+
* @example `<template #contentlet-abc123>…</template>` targets identifier `abc123`.
|
|
9
|
+
*/
|
|
10
|
+
export declare const CONTENTLET_SLOT_PREFIX = "contentlet-";
|
|
11
|
+
/**
|
|
12
|
+
* Props for {@link DotCMSLayoutBody}.
|
|
13
|
+
*/
|
|
14
|
+
export interface DotCMSLayoutBodyProps {
|
|
15
|
+
/** The dotCMS page asset containing the layout information. */
|
|
16
|
+
page: DotCMSPageAsset;
|
|
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
|
+
components: Record<string, Component>;
|
|
23
|
+
/** Renderer mode; defaults to `production`. */
|
|
24
|
+
mode?: DotCMSPageRendererMode;
|
|
25
|
+
}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import { UVE_MODE } from '@dotcms/types';
|
|
2
|
+
/**
|
|
3
|
+
* `DotCMSShow` conditionally renders its slot content based on the current
|
|
4
|
+
* Universal Visual Editor (UVE) mode.
|
|
5
|
+
*
|
|
6
|
+
* @example
|
|
7
|
+
* ```vue
|
|
8
|
+
* <DotCMSShow :when="UVE_MODE.EDIT">
|
|
9
|
+
* <button @click="editContentlet(contentlet)">Edit</button>
|
|
10
|
+
* </DotCMSShow>
|
|
11
|
+
* ```
|
|
12
|
+
*/
|
|
13
|
+
type __VLS_Props = {
|
|
14
|
+
/** The UVE mode in which the slot content should be rendered. */
|
|
15
|
+
when?: UVE_MODE;
|
|
16
|
+
};
|
|
17
|
+
declare function __VLS_template(): {
|
|
18
|
+
attrs: Partial<{}>;
|
|
19
|
+
slots: {
|
|
20
|
+
default?(_: {}): any;
|
|
21
|
+
};
|
|
22
|
+
refs: {};
|
|
23
|
+
rootEl: any;
|
|
24
|
+
};
|
|
25
|
+
type __VLS_TemplateResult = ReturnType<typeof __VLS_template>;
|
|
26
|
+
declare const __VLS_component: import('vue').DefineComponent<__VLS_Props, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {
|
|
27
|
+
when: UVE_MODE;
|
|
28
|
+
}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, any>;
|
|
29
|
+
declare const _default: __VLS_WithTemplateSlots<typeof __VLS_component, __VLS_TemplateResult["slots"]>;
|
|
30
|
+
export default _default;
|
|
31
|
+
type __VLS_WithTemplateSlots<T, S> = T & {
|
|
32
|
+
new (): {
|
|
33
|
+
$slots: S;
|
|
34
|
+
};
|
|
35
|
+
};
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { Component } from 'vue';
|
|
2
|
+
import { DotCMSBasicContentlet } from '@dotcms/types';
|
|
3
|
+
/**
|
|
4
|
+
* @internal
|
|
5
|
+
* Fallback rendered when no component is mapped for a contentlet's content type.
|
|
6
|
+
* Only visible in development mode.
|
|
7
|
+
*/
|
|
8
|
+
type __VLS_Props = {
|
|
9
|
+
contentlet: DotCMSBasicContentlet;
|
|
10
|
+
userNoComponent?: Component;
|
|
11
|
+
};
|
|
12
|
+
declare const _default: import('vue').DefineComponent<__VLS_Props, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, any>;
|
|
13
|
+
export default _default;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { DotPageAssetLayoutRow } from '@dotcms/types';
|
|
2
|
+
/**
|
|
3
|
+
* @internal
|
|
4
|
+
* Renders a layout row and its columns. The `id` is the section anchor the
|
|
5
|
+
* editor scrolls to; the inner grid spans 12 columns.
|
|
6
|
+
*/
|
|
7
|
+
type __VLS_Props = {
|
|
8
|
+
row: DotPageAssetLayoutRow;
|
|
9
|
+
/** 1-based section index used as the scroll-to-section anchor id. */
|
|
10
|
+
index: number;
|
|
11
|
+
};
|
|
12
|
+
declare const _default: import('vue').DefineComponent<__VLS_Props, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, HTMLDivElement>;
|
|
13
|
+
export default _default;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { Ref } from 'vue';
|
|
2
|
+
/**
|
|
3
|
+
* @internal
|
|
4
|
+
*
|
|
5
|
+
* Composable that reports whether an element rendered visible content (measured
|
|
6
|
+
* height greater than zero). Used in development mode to give empty contentlets
|
|
7
|
+
* a minimum height so the editor can still target them.
|
|
8
|
+
*
|
|
9
|
+
* Takes a getter for the element (rather than a template ref) so the caller can
|
|
10
|
+
* resolve it from the component instance's root element and avoid attaching a
|
|
11
|
+
* template ref to a wrapper vnode — which Vue may hoist, triggering a warning.
|
|
12
|
+
*
|
|
13
|
+
* @param getElement returns the element to measure (called on mount)
|
|
14
|
+
* @returns a ref that is `true` when the element has a measurable height
|
|
15
|
+
*/
|
|
16
|
+
export declare function useCheckVisibleContent(getElement: () => Element | null | undefined): Ref<boolean>;
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { ComputedRef, MaybeRefOrGetter } from 'vue';
|
|
2
|
+
import { UVE_MODE } from '@dotcms/types';
|
|
3
|
+
/**
|
|
4
|
+
* Composable that reports whether the current UVE mode matches the given mode.
|
|
5
|
+
*
|
|
6
|
+
* Useful for conditionally rendering content based on the editor mode (EDIT,
|
|
7
|
+
* PREVIEW, LIVE). It resolves after mount (returns `false` during SSR), matching
|
|
8
|
+
* the React SDK's `useDotCMSShowWhen` behavior. The `when` argument may be a
|
|
9
|
+
* plain value, a `ref`, or a getter — a reactive value is re-evaluated when it
|
|
10
|
+
* changes.
|
|
11
|
+
*
|
|
12
|
+
* @example
|
|
13
|
+
* ```ts
|
|
14
|
+
* const showInEditMode = useDotCMSShowWhen(UVE_MODE.EDIT);
|
|
15
|
+
* ```
|
|
16
|
+
*
|
|
17
|
+
* @param when the UVE mode to check against
|
|
18
|
+
* @returns a readonly computed that is `true` when the current UVE mode matches
|
|
19
|
+
*/
|
|
20
|
+
export declare function useDotCMSShowWhen(when: MaybeRefOrGetter<UVE_MODE>): Readonly<ComputedRef<boolean>>;
|