@fileverse-dev/ddoc 3.5.3-font-1 → 3.5.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.
@@ -1,10 +1,10 @@
1
1
  import { default as React } from 'react';
2
2
  import { Editor } from '@tiptap/react';
3
- import { FontDescriptor, IpfsImageFetchPayload, IpfsImageUploadResponse } from '../types';
3
+ import { IpfsImageFetchPayload, IpfsImageUploadResponse } from '../types';
4
4
  import { Tab } from './tabs/utils/tab-utils';
5
5
 
6
6
  import * as Y from 'yjs';
7
- declare const MemoizedTiptapToolBar: React.MemoExoticComponent<({ editor, onError, isPresentationMode, setIsPresentationMode, enableCollaboration, zoomLevel, setZoomLevel, isNavbarVisible, setIsNavbarVisible, ipfsImageUploadFn, onMarkdownExport, onMarkdownImport, onPdfExport, onHtmlExport, onTxtExport, onOdtExport, onDocxImport, isLoading, ipfsImageFetchFn, fetchV1ImageFn, isConnected, tabs, ydoc, onRegisterExportTrigger, toggleFocusMode, fonts: consumerFonts, }: {
7
+ declare const MemoizedTiptapToolBar: React.MemoExoticComponent<({ editor, onError, isPresentationMode, setIsPresentationMode, enableCollaboration, zoomLevel, setZoomLevel, isNavbarVisible, setIsNavbarVisible, ipfsImageUploadFn, onMarkdownExport, onMarkdownImport, onPdfExport, onHtmlExport, onTxtExport, onOdtExport, onDocxImport, isLoading, ipfsImageFetchFn, fetchV1ImageFn, isConnected, tabs, ydoc, onRegisterExportTrigger, toggleFocusMode, }: {
8
8
  editor: Editor | null;
9
9
  onError?: (errorString: string) => void;
10
10
  isPresentationMode?: boolean;
@@ -33,6 +33,5 @@ declare const MemoizedTiptapToolBar: React.MemoExoticComponent<({ editor, onErro
33
33
  ydoc: Y.Doc;
34
34
  toggleFocusMode?: () => void;
35
35
  onRegisterExportTrigger?: ((trigger: ((format?: string, name?: string) => void) | null) => void) | undefined;
36
- fonts?: FontDescriptor[];
37
36
  }) => import("react/jsx-runtime").JSX.Element>;
38
37
  export default MemoizedTiptapToolBar;
@@ -1,7 +1,7 @@
1
1
  import { default as React, Dispatch, SetStateAction } from 'react';
2
- import { FontDescriptor, IpfsImageFetchPayload, IpfsImageUploadResponse } from '../types';
3
2
  import { IEditorTool } from '../hooks/use-visibility';
4
3
  import { Editor } from '@tiptap/react';
4
+ import { IpfsImageFetchPayload, IpfsImageUploadResponse } from '../types';
5
5
 
6
6
  export interface IEditorToolElement {
7
7
  icon: any;
@@ -14,14 +14,11 @@ export interface IEditorToolElement {
14
14
  notVisible?: number;
15
15
  disabled?: boolean;
16
16
  }
17
- type PickerEntry = {
17
+ export declare const fonts: {
18
18
  title: string;
19
19
  value: string;
20
20
  command: (editor: Editor) => void;
21
- preview?: React.ReactNode;
22
- };
23
- export declare const baselineFonts: PickerEntry[];
24
- export declare function buildPickerEntries(consumerFonts: FontDescriptor[]): PickerEntry[];
21
+ }[];
25
22
  export declare const FONT_SIZES: readonly [8, 9, 10, 11, 12, 14, 16, 18, 24, 30, 32, 36, 48, 60, 72, 96];
26
23
  export declare const getFontSizeOptions: (editor?: Editor) => {
27
24
  title: string;
@@ -99,11 +96,10 @@ export declare const TextHighlighter: ({ editor, setVisibility, elementRef, }: {
99
96
  elementRef: React.RefObject<HTMLDivElement>;
100
97
  setVisibility: Dispatch<SetStateAction<IEditorTool>>;
101
98
  }) => import("react/jsx-runtime").JSX.Element;
102
- export declare const EditorFontFamily: ({ elementRef, editor, setToolVisibility, fonts: consumerFonts, }: {
99
+ export declare const EditorFontFamily: ({ elementRef, editor, setToolVisibility, }: {
103
100
  elementRef: React.RefObject<HTMLDivElement>;
104
101
  editor: Editor;
105
102
  setToolVisibility: Dispatch<SetStateAction<IEditorTool>>;
106
- fonts?: FontDescriptor[];
107
103
  }) => import("react/jsx-runtime").JSX.Element;
108
104
  export declare const EditorAlignment: ({ elementRef, editor, setToolVisibility, }: {
109
105
  elementRef: React.RefObject<HTMLDivElement>;
@@ -186,4 +182,3 @@ export declare const checkActiveListsAndDBlocks: (editor: Editor) => {
186
182
  state: import('prosemirror-state').EditorState;
187
183
  hasMultipleLists: boolean;
188
184
  };
189
- export {};
@@ -105,13 +105,6 @@ export interface DocumentStyling {
105
105
  orientation?: 'portrait' | 'landscape';
106
106
  }
107
107
  export interface DdocProps extends CommentAccountProps {
108
- /**
109
- * Optional catalog of fonts available to the editor in addition to the
110
- * package baseline (system fonts only). Each entry is loaded lazily via the
111
- * CSS Font Loading API when first selected in the picker or when a document
112
- * references its family.
113
- */
114
- fonts?: FontDescriptor[];
115
108
  tabConfig?: {
116
109
  onCopyTabLink?: (tabId: string) => void;
117
110
  defaultTabId?: string;
@@ -254,21 +247,3 @@ export interface IpfsImageFetchPayload {
254
247
  mimeType: string;
255
248
  authTag: string;
256
249
  }
257
- export type FontDescriptor = {
258
- /** Display name in the picker, e.g. "Poppins" */
259
- name: string;
260
- /** CSS font-family stack stored in textStyle marks, e.g. "Poppins, sans-serif" */
261
- family: string;
262
- /**
263
- * woff2 source(s).
264
- * - string: single file covering all weights (variable font).
265
- * - Record<number, string>: per-weight map, e.g. { 400: '/p-400.woff2', 700: '/p-700.woff2' }.
266
- * - omitted: pure system font, no loading.
267
- */
268
- url?: string | Record<number, string>;
269
- /**
270
- * SVG preview rendered in the picker. Any React node that renders an <svg>.
271
- * Falls back to the font name in the default font when absent.
272
- */
273
- preview?: React.ReactNode;
274
- };
@@ -2,7 +2,7 @@ import { DdocProps } from './types';
2
2
  import { Editor } from '@tiptap/react';
3
3
  import { DBlockRuntimeState } from './extensions/d-block/dblock-runtime';
4
4
 
5
- export declare const useDdocEditor: ({ isPreviewMode, viewerMode, initialContent, versionHistoryState, collaboration, onChange, onCollaboratorChange, onCommentInteraction, onError, setCharacterCount, setWordCount, setPageCount, ipfsImageUploadFn, ddocId, enableIndexeddbSync, unFocused, isFocusMode, theme, zoomLevel, onInvalidContentError, ignoreCorruptedData, isPresentationMode, metadataProxyUrl, extensions: externalExtensions, onCopyHeadingLink, ipfsImageFetchFn, fetchV1ImageFn, isConnected, activeModel, maxTokens, isAIAgentEnabled, onIndexedDbError, disableInlineComment, initialCommentAnchors, isPreviewEditor, fonts, ...rest }: Partial<DdocProps> & {
5
+ export declare const useDdocEditor: ({ isPreviewMode, viewerMode, initialContent, versionHistoryState, collaboration, onChange, onCollaboratorChange, onCommentInteraction, onError, setCharacterCount, setWordCount, setPageCount, ipfsImageUploadFn, ddocId, enableIndexeddbSync, unFocused, isFocusMode, theme, zoomLevel, onInvalidContentError, ignoreCorruptedData, isPresentationMode, metadataProxyUrl, extensions: externalExtensions, onCopyHeadingLink, ipfsImageFetchFn, fetchV1ImageFn, isConnected, activeModel, maxTokens, isAIAgentEnabled, onIndexedDbError, disableInlineComment, initialCommentAnchors, isPreviewEditor, ...rest }: Partial<DdocProps> & {
6
6
  isFocusMode?: boolean;
7
7
  isPreviewEditor?: boolean;
8
8
  }) => {