@mhamz.01/easyflow-texteditor 0.1.33 → 0.1.37

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/dist/index.d.mts CHANGED
@@ -25,13 +25,27 @@ interface EditorChangePayload {
25
25
  source: EditorChangeSource;
26
26
  }
27
27
 
28
+ type TabContent$1 = any | null;
29
+ interface EditorSubTab {
30
+ id: string;
31
+ title: string;
32
+ content: TabContent$1;
33
+ }
34
+ interface EditorTab {
35
+ id: string;
36
+ title: string;
37
+ content: TabContent$1;
38
+ subtabs: EditorSubTab[];
39
+ }
40
+
28
41
  interface EditorProps {
29
42
  onChange?: (payload: EditorChangePayload) => void;
43
+ initialTabs?: EditorTab[];
30
44
  onTabsChange?: (tabs: any[]) => void;
31
45
  className?: string;
32
46
  style?: React.CSSProperties;
33
47
  }
34
- declare function Editor({ onChange, className, style, onTabsChange }: EditorProps): react_jsx_runtime.JSX.Element;
48
+ declare function Editor({ onChange, className, style, onTabsChange, initialTabs }: EditorProps): react_jsx_runtime.JSX.Element;
35
49
 
36
50
  type UserRef<T> = ((instance: T | null) => void) | React.RefObject<T | null> | null | undefined;
37
51
  declare const useComposedRef: <T extends HTMLElement>(libRef: React.RefObject<T | null>, userRef: UserRef<T>) => (instance: T | null) => void;
@@ -252,19 +266,6 @@ declare function useEditorBridge(): EditorBridgeValue;
252
266
 
253
267
  declare const GRADIENT_ROWS_70: string[];
254
268
 
255
- type TabContent$1 = any | null;
256
- interface EditorSubTab {
257
- id: string;
258
- title: string;
259
- content: TabContent$1;
260
- }
261
- interface EditorTab {
262
- id: string;
263
- title: string;
264
- content: TabContent$1;
265
- subtabs: EditorSubTab[];
266
- }
267
-
268
269
  type TabContent = any;
269
270
  declare function loadTabs(): EditorTab[];
270
271
  declare function saveTabs(tabs: EditorTab[]): void;
package/dist/index.d.ts CHANGED
@@ -25,13 +25,27 @@ interface EditorChangePayload {
25
25
  source: EditorChangeSource;
26
26
  }
27
27
 
28
+ type TabContent$1 = any | null;
29
+ interface EditorSubTab {
30
+ id: string;
31
+ title: string;
32
+ content: TabContent$1;
33
+ }
34
+ interface EditorTab {
35
+ id: string;
36
+ title: string;
37
+ content: TabContent$1;
38
+ subtabs: EditorSubTab[];
39
+ }
40
+
28
41
  interface EditorProps {
29
42
  onChange?: (payload: EditorChangePayload) => void;
43
+ initialTabs?: EditorTab[];
30
44
  onTabsChange?: (tabs: any[]) => void;
31
45
  className?: string;
32
46
  style?: React.CSSProperties;
33
47
  }
34
- declare function Editor({ onChange, className, style, onTabsChange }: EditorProps): react_jsx_runtime.JSX.Element;
48
+ declare function Editor({ onChange, className, style, onTabsChange, initialTabs }: EditorProps): react_jsx_runtime.JSX.Element;
35
49
 
36
50
  type UserRef<T> = ((instance: T | null) => void) | React.RefObject<T | null> | null | undefined;
37
51
  declare const useComposedRef: <T extends HTMLElement>(libRef: React.RefObject<T | null>, userRef: UserRef<T>) => (instance: T | null) => void;
@@ -252,19 +266,6 @@ declare function useEditorBridge(): EditorBridgeValue;
252
266
 
253
267
  declare const GRADIENT_ROWS_70: string[];
254
268
 
255
- type TabContent$1 = any | null;
256
- interface EditorSubTab {
257
- id: string;
258
- title: string;
259
- content: TabContent$1;
260
- }
261
- interface EditorTab {
262
- id: string;
263
- title: string;
264
- content: TabContent$1;
265
- subtabs: EditorSubTab[];
266
- }
267
-
268
269
  type TabContent = any;
269
270
  declare function loadTabs(): EditorTab[];
270
271
  declare function saveTabs(tabs: EditorTab[]): void;
package/dist/index.js CHANGED
@@ -597,14 +597,14 @@ var sidebarMenuButtonVariants = (0, import_class_variance_authority2.cva)(
597
597
  // src/components/editor-shell/EditorShell.tsx
598
598
  var import_jsx_runtime7 = require("react/jsx-runtime");
599
599
  function EditorShell({ children }) {
600
- return /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(
600
+ return /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("div", { className: "easyflow-editor", children: /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(
601
601
  "div",
602
602
  {
603
- className: "\r\n relative\r\n w-full\r\n h-full\r\n overflow-hidden\r\n border\r\n rounded-md\r\n bg-background\r\n ",
603
+ className: "\r\n \r\n relative\r\n w-full\r\n h-full\r\n overflow-hidden\r\n border\r\n rounded-md\r\n bg-background\r\n ",
604
604
  "data-easyflow-editor": true,
605
605
  children: /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(SidebarProvider, { children })
606
606
  }
607
- );
607
+ ) });
608
608
  }
609
609
 
610
610
  // src/components/editorLayout/editorLayout.tsx
@@ -7752,8 +7752,8 @@ function SimpleEditor() {
7752
7752
 
7753
7753
  // src/components/editor/editor.tsx
7754
7754
  var import_jsx_runtime77 = require("react/jsx-runtime");
7755
- function Editor({ onChange, className, style, onTabsChange }) {
7756
- return /* @__PURE__ */ (0, import_jsx_runtime77.jsx)("div", { className, style, children: /* @__PURE__ */ (0, import_jsx_runtime77.jsx)(EditorShell, { children: /* @__PURE__ */ (0, import_jsx_runtime77.jsx)(EditorLayout, { onChange, onTabsChange, children: /* @__PURE__ */ (0, import_jsx_runtime77.jsx)(SimpleEditor, {}) }) }) });
7755
+ function Editor({ onChange, className, style, onTabsChange, initialTabs }) {
7756
+ return /* @__PURE__ */ (0, import_jsx_runtime77.jsx)("div", { className, style, children: /* @__PURE__ */ (0, import_jsx_runtime77.jsx)(EditorShell, { children: /* @__PURE__ */ (0, import_jsx_runtime77.jsx)(EditorLayout, { onChange, initialTabs, onTabsChange, children: /* @__PURE__ */ (0, import_jsx_runtime77.jsx)(SimpleEditor, {}) }) }) });
7757
7757
  }
7758
7758
 
7759
7759
  // src/hooks/use-scrolling.ts