@mhamz.01/easyflow-texteditor 0.1.0 → 0.1.2

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
@@ -3,22 +3,24 @@ import { Editor as Editor$1 } from '@tiptap/react';
3
3
  import * as react from 'react';
4
4
  import react__default, { RefObject } from 'react';
5
5
  import { Editor as Editor$2 } from '@tiptap/core';
6
+ import * as next_dist_compiled__next_font from 'next/dist/compiled/@next/font';
7
+ import { ClassValue } from 'clsx';
6
8
 
7
- interface EditorSubTab {
9
+ interface EditorSubTab$1 {
8
10
  id: string;
9
11
  title: string;
10
12
  content: any | null;
11
13
  }
12
- interface EditorTab {
14
+ interface EditorTab$1 {
13
15
  id: string;
14
16
  title: string;
15
17
  content: any | null;
16
- subtabs: EditorSubTab[];
18
+ subtabs: EditorSubTab$1[];
17
19
  }
18
20
 
19
21
  type EditorChangeSource = "editor" | "tab-switch" | "subtab-switch" | "add-tab" | "add-subtab" | "delete-tab" | "delete-subtab" | "restore" | "storage" | "manual";
20
22
  interface EditorChangePayload {
21
- tabs: EditorTab[];
23
+ tabs: EditorTab$1[];
22
24
  activeTabId: string;
23
25
  activeSubTabId: string | null;
24
26
  source: EditorChangeSource;
@@ -248,4 +250,68 @@ declare function EditorBridgeProvider({ children, value, }: {
248
250
  }): react_jsx_runtime.JSX.Element;
249
251
  declare function useEditorBridge(): EditorBridgeValue;
250
252
 
251
- export { type CursorVisibilityOptions, Editor, EditorBridgeProvider, type EditorBridgeValue, type EditorChangePayload, type EditorChangeSource, type ElementRectOptions, type RectState, type WindowSizeState, useBodyRect, useComposedRef, useCursorVisibility, useEditorBridge, useElementRect, useIsBreakpoint, useIsMobile, useMenuNavigation, useRefRect, useScrolling, useThrottledCallback, useTiptapEditor, useUnmount, useWindowSize };
253
+ declare const GRADIENT_ROWS_70: string[];
254
+
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
+ type TabContent = any;
269
+ declare function loadTabs(): EditorTab[];
270
+ declare function saveTabs(tabs: EditorTab[]): void;
271
+ declare function loadActiveTab(): string;
272
+ declare function saveActiveTab(id: string): void;
273
+
274
+ declare const inter: next_dist_compiled__next_font.NextFont;
275
+ declare const roboto: next_dist_compiled__next_font.NextFont;
276
+ declare const opensans: next_dist_compiled__next_font.NextFont;
277
+ declare const poppins: next_dist_compiled__next_font.NextFont;
278
+ declare const montserrat: next_dist_compiled__next_font.NextFont;
279
+ declare const lato: next_dist_compiled__next_font.NextFont;
280
+ declare const oswald: next_dist_compiled__next_font.NextFont;
281
+ declare const raleway: next_dist_compiled__next_font.NextFont;
282
+ declare const merriweather: next_dist_compiled__next_font.NextFont;
283
+ declare const playfair: next_dist_compiled__next_font.NextFont;
284
+ declare const ubuntu: next_dist_compiled__next_font.NextFont;
285
+ declare const ptsans: next_dist_compiled__next_font.NextFont;
286
+ declare const barlow: next_dist_compiled__next_font.NextFont;
287
+ declare const fira: next_dist_compiled__next_font.NextFont;
288
+ declare const nunito: next_dist_compiled__next_font.NextFont;
289
+ declare const cabin: next_dist_compiled__next_font.NextFont;
290
+ declare const bebas: next_dist_compiled__next_font.NextFont;
291
+ declare const sourceserif: next_dist_compiled__next_font.NextFont;
292
+ declare const librebask: next_dist_compiled__next_font.NextFont;
293
+ declare const rubik: next_dist_compiled__next_font.NextFont;
294
+ declare const inconsolata: next_dist_compiled__next_font.NextFont;
295
+ declare const worksans: next_dist_compiled__next_font.NextFont;
296
+ declare const mulish: next_dist_compiled__next_font.NextFont;
297
+ declare const quicksand: next_dist_compiled__next_font.NextFont;
298
+ declare const kanit: next_dist_compiled__next_font.NextFont;
299
+ declare const teko: next_dist_compiled__next_font.NextFont;
300
+ declare const josefin: next_dist_compiled__next_font.NextFont;
301
+ declare const philosopher: next_dist_compiled__next_font.NextFont;
302
+ declare const dancing: next_dist_compiled__next_font.NextFont;
303
+ declare const notoserif: next_dist_compiled__next_font.NextFont;
304
+ declare const manrope: next_dist_compiled__next_font.NextFont;
305
+ declare const spacegrotesk: next_dist_compiled__next_font.NextFont;
306
+ declare const FONT_OPTIONS: {
307
+ label: string;
308
+ font: next_dist_compiled__next_font.NextFont;
309
+ }[];
310
+
311
+ declare function fileToBase64(file: File): Promise<string>;
312
+ declare function saveImageBase64(key: string, base64: string): void;
313
+ declare function loadImageBase64(key: string): string | null;
314
+
315
+ declare function cn(...inputs: ClassValue[]): string;
316
+
317
+ export { type CursorVisibilityOptions, Editor, EditorBridgeProvider, type EditorBridgeValue, type EditorChangePayload, type EditorChangeSource, type ElementRectOptions, FONT_OPTIONS, GRADIENT_ROWS_70, type RectState, type TabContent, type WindowSizeState, barlow, bebas, cabin, cn, dancing, fileToBase64, fira, inconsolata, inter, josefin, kanit, lato, librebask, loadActiveTab, loadImageBase64, loadTabs, manrope, merriweather, montserrat, mulish, notoserif, nunito, opensans, oswald, philosopher, playfair, poppins, ptsans, quicksand, raleway, roboto, rubik, saveActiveTab, saveImageBase64, saveTabs, sourceserif, spacegrotesk, teko, ubuntu, useBodyRect, useComposedRef, useCursorVisibility, useEditorBridge, useElementRect, useIsBreakpoint, useIsMobile, useMenuNavigation, useRefRect, useScrolling, useThrottledCallback, useTiptapEditor, useUnmount, useWindowSize, worksans };
package/dist/index.d.ts CHANGED
@@ -3,22 +3,24 @@ import { Editor as Editor$1 } from '@tiptap/react';
3
3
  import * as react from 'react';
4
4
  import react__default, { RefObject } from 'react';
5
5
  import { Editor as Editor$2 } from '@tiptap/core';
6
+ import * as next_dist_compiled__next_font from 'next/dist/compiled/@next/font';
7
+ import { ClassValue } from 'clsx';
6
8
 
7
- interface EditorSubTab {
9
+ interface EditorSubTab$1 {
8
10
  id: string;
9
11
  title: string;
10
12
  content: any | null;
11
13
  }
12
- interface EditorTab {
14
+ interface EditorTab$1 {
13
15
  id: string;
14
16
  title: string;
15
17
  content: any | null;
16
- subtabs: EditorSubTab[];
18
+ subtabs: EditorSubTab$1[];
17
19
  }
18
20
 
19
21
  type EditorChangeSource = "editor" | "tab-switch" | "subtab-switch" | "add-tab" | "add-subtab" | "delete-tab" | "delete-subtab" | "restore" | "storage" | "manual";
20
22
  interface EditorChangePayload {
21
- tabs: EditorTab[];
23
+ tabs: EditorTab$1[];
22
24
  activeTabId: string;
23
25
  activeSubTabId: string | null;
24
26
  source: EditorChangeSource;
@@ -248,4 +250,68 @@ declare function EditorBridgeProvider({ children, value, }: {
248
250
  }): react_jsx_runtime.JSX.Element;
249
251
  declare function useEditorBridge(): EditorBridgeValue;
250
252
 
251
- export { type CursorVisibilityOptions, Editor, EditorBridgeProvider, type EditorBridgeValue, type EditorChangePayload, type EditorChangeSource, type ElementRectOptions, type RectState, type WindowSizeState, useBodyRect, useComposedRef, useCursorVisibility, useEditorBridge, useElementRect, useIsBreakpoint, useIsMobile, useMenuNavigation, useRefRect, useScrolling, useThrottledCallback, useTiptapEditor, useUnmount, useWindowSize };
253
+ declare const GRADIENT_ROWS_70: string[];
254
+
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
+ type TabContent = any;
269
+ declare function loadTabs(): EditorTab[];
270
+ declare function saveTabs(tabs: EditorTab[]): void;
271
+ declare function loadActiveTab(): string;
272
+ declare function saveActiveTab(id: string): void;
273
+
274
+ declare const inter: next_dist_compiled__next_font.NextFont;
275
+ declare const roboto: next_dist_compiled__next_font.NextFont;
276
+ declare const opensans: next_dist_compiled__next_font.NextFont;
277
+ declare const poppins: next_dist_compiled__next_font.NextFont;
278
+ declare const montserrat: next_dist_compiled__next_font.NextFont;
279
+ declare const lato: next_dist_compiled__next_font.NextFont;
280
+ declare const oswald: next_dist_compiled__next_font.NextFont;
281
+ declare const raleway: next_dist_compiled__next_font.NextFont;
282
+ declare const merriweather: next_dist_compiled__next_font.NextFont;
283
+ declare const playfair: next_dist_compiled__next_font.NextFont;
284
+ declare const ubuntu: next_dist_compiled__next_font.NextFont;
285
+ declare const ptsans: next_dist_compiled__next_font.NextFont;
286
+ declare const barlow: next_dist_compiled__next_font.NextFont;
287
+ declare const fira: next_dist_compiled__next_font.NextFont;
288
+ declare const nunito: next_dist_compiled__next_font.NextFont;
289
+ declare const cabin: next_dist_compiled__next_font.NextFont;
290
+ declare const bebas: next_dist_compiled__next_font.NextFont;
291
+ declare const sourceserif: next_dist_compiled__next_font.NextFont;
292
+ declare const librebask: next_dist_compiled__next_font.NextFont;
293
+ declare const rubik: next_dist_compiled__next_font.NextFont;
294
+ declare const inconsolata: next_dist_compiled__next_font.NextFont;
295
+ declare const worksans: next_dist_compiled__next_font.NextFont;
296
+ declare const mulish: next_dist_compiled__next_font.NextFont;
297
+ declare const quicksand: next_dist_compiled__next_font.NextFont;
298
+ declare const kanit: next_dist_compiled__next_font.NextFont;
299
+ declare const teko: next_dist_compiled__next_font.NextFont;
300
+ declare const josefin: next_dist_compiled__next_font.NextFont;
301
+ declare const philosopher: next_dist_compiled__next_font.NextFont;
302
+ declare const dancing: next_dist_compiled__next_font.NextFont;
303
+ declare const notoserif: next_dist_compiled__next_font.NextFont;
304
+ declare const manrope: next_dist_compiled__next_font.NextFont;
305
+ declare const spacegrotesk: next_dist_compiled__next_font.NextFont;
306
+ declare const FONT_OPTIONS: {
307
+ label: string;
308
+ font: next_dist_compiled__next_font.NextFont;
309
+ }[];
310
+
311
+ declare function fileToBase64(file: File): Promise<string>;
312
+ declare function saveImageBase64(key: string, base64: string): void;
313
+ declare function loadImageBase64(key: string): string | null;
314
+
315
+ declare function cn(...inputs: ClassValue[]): string;
316
+
317
+ export { type CursorVisibilityOptions, Editor, EditorBridgeProvider, type EditorBridgeValue, type EditorChangePayload, type EditorChangeSource, type ElementRectOptions, FONT_OPTIONS, GRADIENT_ROWS_70, type RectState, type TabContent, type WindowSizeState, barlow, bebas, cabin, cn, dancing, fileToBase64, fira, inconsolata, inter, josefin, kanit, lato, librebask, loadActiveTab, loadImageBase64, loadTabs, manrope, merriweather, montserrat, mulish, notoserif, nunito, opensans, oswald, philosopher, playfair, poppins, ptsans, quicksand, raleway, roboto, rubik, saveActiveTab, saveImageBase64, saveTabs, sourceserif, spacegrotesk, teko, ubuntu, useBodyRect, useComposedRef, useCursorVisibility, useEditorBridge, useElementRect, useIsBreakpoint, useIsMobile, useMenuNavigation, useRefRect, useScrolling, useThrottledCallback, useTiptapEditor, useUnmount, useWindowSize, worksans };
package/dist/index.js CHANGED
@@ -32,6 +32,47 @@ var index_exports = {};
32
32
  __export(index_exports, {
33
33
  Editor: () => Editor,
34
34
  EditorBridgeProvider: () => EditorBridgeProvider,
35
+ FONT_OPTIONS: () => FONT_OPTIONS,
36
+ GRADIENT_ROWS_70: () => GRADIENT_ROWS_70,
37
+ barlow: () => barlow,
38
+ bebas: () => bebas,
39
+ cabin: () => cabin,
40
+ cn: () => cn,
41
+ dancing: () => dancing,
42
+ fileToBase64: () => fileToBase64,
43
+ fira: () => fira,
44
+ inconsolata: () => inconsolata,
45
+ inter: () => inter,
46
+ josefin: () => josefin,
47
+ kanit: () => kanit,
48
+ lato: () => lato,
49
+ librebask: () => librebask,
50
+ loadActiveTab: () => loadActiveTab,
51
+ loadImageBase64: () => loadImageBase64,
52
+ loadTabs: () => loadTabs,
53
+ manrope: () => manrope,
54
+ merriweather: () => merriweather,
55
+ montserrat: () => montserrat,
56
+ mulish: () => mulish,
57
+ notoserif: () => notoserif,
58
+ nunito: () => nunito,
59
+ opensans: () => opensans,
60
+ oswald: () => oswald,
61
+ philosopher: () => philosopher,
62
+ playfair: () => playfair,
63
+ poppins: () => poppins,
64
+ ptsans: () => ptsans,
65
+ quicksand: () => quicksand,
66
+ raleway: () => raleway,
67
+ roboto: () => roboto,
68
+ rubik: () => rubik,
69
+ saveActiveTab: () => saveActiveTab,
70
+ saveImageBase64: () => saveImageBase64,
71
+ saveTabs: () => saveTabs,
72
+ sourceserif: () => sourceserif,
73
+ spacegrotesk: () => spacegrotesk,
74
+ teko: () => teko,
75
+ ubuntu: () => ubuntu,
35
76
  useBodyRect: () => useBodyRect,
36
77
  useComposedRef: () => useComposedRef,
37
78
  useCursorVisibility: () => useCursorVisibility,
@@ -45,7 +86,8 @@ __export(index_exports, {
45
86
  useThrottledCallback: () => useThrottledCallback,
46
87
  useTiptapEditor: () => useTiptapEditor,
47
88
  useUnmount: () => useUnmount,
48
- useWindowSize: () => useWindowSize
89
+ useWindowSize: () => useWindowSize,
90
+ worksans: () => worksans
49
91
  });
50
92
  module.exports = __toCommonJS(index_exports);
51
93
 
@@ -990,6 +1032,7 @@ function useEditorBridge() {
990
1032
 
991
1033
  // src/lib/editorStorage.ts
992
1034
  var STORAGE_KEY = "tiptap-tabs-v1";
1035
+ var ACTIVE_TAB_KEY = "tiptap-active-tab";
993
1036
  function loadTabs() {
994
1037
  if (typeof window === "undefined") return [];
995
1038
  try {
@@ -1006,6 +1049,14 @@ function saveTabs(tabs) {
1006
1049
  if (typeof window === "undefined") return;
1007
1050
  localStorage.setItem(STORAGE_KEY, JSON.stringify(tabs));
1008
1051
  }
1052
+ function loadActiveTab() {
1053
+ if (typeof window === "undefined") return "1";
1054
+ return localStorage.getItem(ACTIVE_TAB_KEY) ?? "1";
1055
+ }
1056
+ function saveActiveTab(id) {
1057
+ if (typeof window === "undefined") return;
1058
+ localStorage.setItem(ACTIVE_TAB_KEY, id);
1059
+ }
1009
1060
 
1010
1061
  // src/components/editorLayout/editorLayout.tsx
1011
1062
  var import_jsx_runtime11 = require("react/jsx-runtime");
@@ -7863,10 +7914,67 @@ function useScrolling(target, options = {}) {
7863
7914
  }, [target, debounce2, fallbackToDocument, isScrolling]);
7864
7915
  return isScrolling;
7865
7916
  }
7917
+
7918
+ // src/lib/local-image.ts
7919
+ function fileToBase64(file) {
7920
+ return new Promise((resolve, reject) => {
7921
+ const reader = new FileReader();
7922
+ reader.readAsDataURL(file);
7923
+ reader.onload = () => resolve(reader.result);
7924
+ reader.onerror = (error) => reject(error);
7925
+ });
7926
+ }
7927
+ function saveImageBase64(key, base64) {
7928
+ localStorage.setItem(key, base64);
7929
+ }
7930
+ function loadImageBase64(key) {
7931
+ return localStorage.getItem(key);
7932
+ }
7866
7933
  // Annotate the CommonJS export names for ESM import in node:
7867
7934
  0 && (module.exports = {
7868
7935
  Editor,
7869
7936
  EditorBridgeProvider,
7937
+ FONT_OPTIONS,
7938
+ GRADIENT_ROWS_70,
7939
+ barlow,
7940
+ bebas,
7941
+ cabin,
7942
+ cn,
7943
+ dancing,
7944
+ fileToBase64,
7945
+ fira,
7946
+ inconsolata,
7947
+ inter,
7948
+ josefin,
7949
+ kanit,
7950
+ lato,
7951
+ librebask,
7952
+ loadActiveTab,
7953
+ loadImageBase64,
7954
+ loadTabs,
7955
+ manrope,
7956
+ merriweather,
7957
+ montserrat,
7958
+ mulish,
7959
+ notoserif,
7960
+ nunito,
7961
+ opensans,
7962
+ oswald,
7963
+ philosopher,
7964
+ playfair,
7965
+ poppins,
7966
+ ptsans,
7967
+ quicksand,
7968
+ raleway,
7969
+ roboto,
7970
+ rubik,
7971
+ saveActiveTab,
7972
+ saveImageBase64,
7973
+ saveTabs,
7974
+ sourceserif,
7975
+ spacegrotesk,
7976
+ teko,
7977
+ ubuntu,
7870
7978
  useBodyRect,
7871
7979
  useComposedRef,
7872
7980
  useCursorVisibility,
@@ -7880,6 +7988,7 @@ function useScrolling(target, options = {}) {
7880
7988
  useThrottledCallback,
7881
7989
  useTiptapEditor,
7882
7990
  useUnmount,
7883
- useWindowSize
7991
+ useWindowSize,
7992
+ worksans
7884
7993
  });
7885
7994
  //# sourceMappingURL=index.js.map