@lax-wp/editor 0.3.2 → 0.3.4

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.
@@ -73,10 +73,7 @@ export interface EditorConfig {
73
73
  insertTableFromData: ({ tableType, data, columns, options }: InsertTableUsingDataProps) => void;
74
74
  updateTableValues: () => void;
75
75
  }) => void;
76
- /** Sidebar configuration for redline positioning */
77
- sidebarConfig?: {
78
- /** ID of the sidebar element (default: 'editor-sidebar-qwCfsxssdsfsd') */
79
- sidebarId?: string;
80
- };
76
+ /** Parent container id for redline positioning */
77
+ parentContainerId?: string;
81
78
  }
82
79
  export declare const defaultEditorConfig: EditorConfig;
@@ -0,0 +1,10 @@
1
+ /**
2
+ * Detects dark mode from the `dark` class on <html>.
3
+ *
4
+ * This mirrors the lax-wp-design-system pattern: the consumer (lax-web-portal)
5
+ * sets `document.documentElement.classList.add('dark')` via its ThemeContext,
6
+ * and both the design-system and the editor react to it automatically.
7
+ *
8
+ * No prop needs to be passed by the consumer — the DOM class is the contract.
9
+ */
10
+ export declare const useIsDarkMode: () => boolean;
@@ -0,0 +1,25 @@
1
+ interface RedlineItemPosition {
2
+ changeId: string;
3
+ top: number;
4
+ left: number;
5
+ showCompact: boolean;
6
+ }
7
+ export declare const useRedlinePanel: () => {
8
+ panelRef: import("react").RefObject<HTMLDivElement>;
9
+ itemRefs: import("react").MutableRefObject<Map<string, HTMLDivElement>>;
10
+ itemPositions: Map<string, RedlineItemPosition>;
11
+ activeItemId: string | null;
12
+ popupPosition: {
13
+ top: number;
14
+ left: number;
15
+ showBelow: boolean;
16
+ } | null;
17
+ setActiveItemId: import("react").Dispatch<import("react").SetStateAction<string | null>>;
18
+ setPopupPosition: import("react").Dispatch<import("react").SetStateAction<{
19
+ top: number;
20
+ left: number;
21
+ showBelow: boolean;
22
+ } | null>>;
23
+ handleLabelClick: (changeId: string) => void;
24
+ };
25
+ export {};
package/dist/index.d.ts CHANGED
@@ -3,3 +3,6 @@ import "./utils/svgIconRegistry";
3
3
  export type { EditorConfig, AIAutocompletionConfig } from "./config/EditorConfig";
4
4
  export type { EditorProps } from "./components/Editor";
5
5
  export { default as Editor } from "./components/Editor";
6
+ export { EditorProvider } from "./providers/EditorProvider";
7
+ export { useEditorProvider } from "./providers/EditorProviderContext";
8
+ export type { EditorProviderConfig } from "./providers/EditorProviderContext";