@dotcms/react 0.0.1-alpha.2 → 0.0.1-alpha.3

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dotcms/react",
3
- "version": "0.0.1-alpha.2",
3
+ "version": "0.0.1-alpha.3",
4
4
  "peerDependencies": {
5
5
  "react": "^18",
6
6
  "react-dom": "^18",
@@ -1,6 +1,5 @@
1
1
  import { PageProviderContext } from '../PageProvider/PageProvider';
2
- interface ColumnProps {
2
+ export interface ColumnProps {
3
3
  readonly column: PageProviderContext['layout']['body']['rows'][0]['columns'][0];
4
4
  }
5
5
  export declare function Column({ column }: ColumnProps): import("react/jsx-runtime").JSX.Element;
6
- export {};
@@ -69,6 +69,7 @@ export interface PageProviderContext {
69
69
  keyTag: string;
70
70
  };
71
71
  };
72
+ isInsideEditor: boolean;
72
73
  }
73
74
  /**
74
75
  * `PageProvider` is a functional component that provides a context for a DotCMS page.
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  /**
3
2
  * `PageEditorOptions` is an interface that defines the options for the `usePageEditor` hook.
4
3
  * It includes an optional `reloadFunction` that is called when the editor needs to reload the page to get changes,
@@ -41,8 +40,11 @@ interface PageEditorOptions {
41
40
  *
42
41
  * @category Hooks
43
42
  * @param {PageEditorOptions} props - The options for the page editor. Includes a `reloadFunction` and a `pathname`.
44
- * @returns {React.RefObject<HTMLDivElement>[]} - A reference to the rows of the page.
43
+ * @returns {{rowsRef: React.RefObject<HTMLDivElement>[], isInsideEditor: boolean}} - Returns a reference to the rows of the page and a boolean that indicates if the page is inside the editor.
45
44
  * @throws {Error} - Throws an error if the `pathname` is not provided.
46
45
  */
47
- export declare const usePageEditor: (props: PageEditorOptions) => import("react").MutableRefObject<HTMLDivElement[]>;
46
+ export declare const usePageEditor: (props: PageEditorOptions) => {
47
+ rowsRef: React.MutableRefObject<HTMLDivElement[]>;
48
+ isInsideEditor: boolean;
49
+ };
48
50
  export {};
@@ -1,2 +1,7 @@
1
+ /// <reference types="react" />
1
2
  import { PageProviderContext } from '../components/PageProvider/PageProvider';
2
3
  export declare const mockPageContext: PageProviderContext;
4
+ export declare const MockContextRender: ({ children, mockContext }: {
5
+ children: JSX.Element;
6
+ mockContext: Partial<PageProviderContext>;
7
+ }) => import("react/jsx-runtime").JSX.Element;
@@ -48,3 +48,8 @@ export declare const getContainersData: (containers: ContainerData, containerRef
48
48
  identifier: string;
49
49
  maxContentlets: number;
50
50
  };
51
+ export declare const combineClasses: (classes: string[]) => string;
52
+ export declare const getPositionStyleClasses: (width: number, leftOffset: number) => {
53
+ widthClass: string;
54
+ startClass: string;
55
+ };