@fileverse-dev/ddoc 3.1.2 → 3.1.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/dist/index.es.js +22 -22
- package/dist/package/components/presentation-mode/presentation-mode.d.ts +2 -2
- package/dist/package/components/presentation-mode/preview-panel.d.ts +2 -2
- package/dist/package/context/editor-context.d.ts +3 -3
- package/dist/package/hooks/use-tab-editor.d.ts +2 -2
- package/dist/package/types.d.ts +4 -1
- package/dist/package/utils/colors.d.ts +3 -1
- package/dist/package/utils/document-styling.d.ts +3 -3
- package/dist/style.css +1 -1
- package/package.json +4 -4
package/dist/index.es.js
CHANGED
|
@@ -47390,7 +47390,7 @@ const mp = (e) => {
|
|
|
47390
47390
|
},
|
|
47391
47391
|
className: it(
|
|
47392
47392
|
"flex w-full items-center space-x-2 rounded px-2 py-1 text-left text-sm color-text-default transition",
|
|
47393
|
-
t.isActive("textStyle", { fontFamily: r.value }) ? "color-bg-brand xl:hover:brightness-90
|
|
47393
|
+
t.isActive("textStyle", { fontFamily: r.value }) ? "color-bg-brand xl:hover:brightness-90 color-text-on-brand" : "hover:color-bg-default-hover"
|
|
47394
47394
|
),
|
|
47395
47395
|
children: /* @__PURE__ */ F.jsx("p", { className: "font-medium", children: r.title })
|
|
47396
47396
|
},
|
|
@@ -47416,7 +47416,7 @@ const mp = (e) => {
|
|
|
47416
47416
|
},
|
|
47417
47417
|
className: it(
|
|
47418
47418
|
"rounded w-8 h-8 p-1 flex justify-center items-center cursor-pointer transition",
|
|
47419
|
-
t.isActive({ textAlign: "left" }) ? "color-bg-brand xl:hover:brightness-90
|
|
47419
|
+
t.isActive({ textAlign: "left" }) ? "color-bg-brand xl:hover:brightness-90 color-text-on-brand" : "hover:color-bg-default-hover"
|
|
47420
47420
|
),
|
|
47421
47421
|
children: /* @__PURE__ */ F.jsx(Ue, { name: "AlignLeft" })
|
|
47422
47422
|
}
|
|
@@ -47430,7 +47430,7 @@ const mp = (e) => {
|
|
|
47430
47430
|
},
|
|
47431
47431
|
className: it(
|
|
47432
47432
|
"rounded w-8 h-8 p-1 flex justify-center items-center cursor-pointer transition",
|
|
47433
|
-
t.isActive({ textAlign: "center" }) ? "color-bg-brand xl:hover:brightness-90
|
|
47433
|
+
t.isActive({ textAlign: "center" }) ? "color-bg-brand xl:hover:brightness-90 color-text-on-brand" : "hover:color-bg-default-hover"
|
|
47434
47434
|
),
|
|
47435
47435
|
children: /* @__PURE__ */ F.jsx(Ue, { name: "AlignCenter" })
|
|
47436
47436
|
}
|
|
@@ -47444,7 +47444,7 @@ const mp = (e) => {
|
|
|
47444
47444
|
},
|
|
47445
47445
|
className: it(
|
|
47446
47446
|
"rounded w-8 h-8 p-1 flex justify-center items-center cursor-pointer transition",
|
|
47447
|
-
t.isActive({ textAlign: "right" }) ? "color-bg-brand xl:hover:brightness-90
|
|
47447
|
+
t.isActive({ textAlign: "right" }) ? "color-bg-brand xl:hover:brightness-90 color-text-on-brand" : "hover:color-bg-default-hover"
|
|
47448
47448
|
),
|
|
47449
47449
|
children: /* @__PURE__ */ F.jsx(Ue, { name: "AlignRight" })
|
|
47450
47450
|
}
|
|
@@ -47458,7 +47458,7 @@ const mp = (e) => {
|
|
|
47458
47458
|
},
|
|
47459
47459
|
className: it(
|
|
47460
47460
|
"rounded w-8 h-8 p-1 flex justify-center items-center cursor-pointer transition",
|
|
47461
|
-
t.isActive({ textAlign: "justify" }) ? "color-bg-brand xl:hover:brightness-90
|
|
47461
|
+
t.isActive({ textAlign: "justify" }) ? "color-bg-brand xl:hover:brightness-90 color-text-on-brand" : "hover:color-bg-default-hover"
|
|
47462
47462
|
),
|
|
47463
47463
|
children: /* @__PURE__ */ F.jsx(Ue, { name: "AlignJustify" })
|
|
47464
47464
|
}
|
|
@@ -47556,7 +47556,7 @@ const mp = (e) => {
|
|
|
47556
47556
|
},
|
|
47557
47557
|
className: it(
|
|
47558
47558
|
"flex items-center justify-between w-full px-2 py-1 text-body-sm",
|
|
47559
|
-
r.isActive() && "color-bg-brand hover:!bg-[#B6A02E]
|
|
47559
|
+
r.isActive() && "color-bg-brand hover:!bg-[#B6A02E] color-text-on-brand"
|
|
47560
47560
|
),
|
|
47561
47561
|
children: [
|
|
47562
47562
|
/* @__PURE__ */ F.jsxs("div", { className: "flex items-center gap-2", children: [
|
|
@@ -47582,7 +47582,7 @@ const mp = (e) => {
|
|
|
47582
47582
|
children: [
|
|
47583
47583
|
/* @__PURE__ */ F.jsx("div", { className: "grid grid-cols-[repeat(15,_minmax(0,_1fr))] gap-0.5", children: rP.map((o) => {
|
|
47584
47584
|
const s = FH(
|
|
47585
|
-
r
|
|
47585
|
+
o[r] || o.light
|
|
47586
47586
|
) === "#000000" ? "text-black" : "text-white", a = `var(--color-editor-${o.name})`;
|
|
47587
47587
|
return /* @__PURE__ */ F.jsx(
|
|
47588
47588
|
"div",
|
|
@@ -47688,7 +47688,7 @@ const mp = (e) => {
|
|
|
47688
47688
|
className: it(
|
|
47689
47689
|
"flex w-full items-center space-x-2 rounded-md px-2 py-1 text-left text-sm color-text-default transition",
|
|
47690
47690
|
{
|
|
47691
|
-
"color-bg-brand xl:hover:brightness-90
|
|
47691
|
+
"color-bg-brand xl:hover:brightness-90 color-text-on-brand": o.isActive(),
|
|
47692
47692
|
"hover:color-bg-default-hover": !o.isActive()
|
|
47693
47693
|
}
|
|
47694
47694
|
),
|
|
@@ -47733,7 +47733,7 @@ const mp = (e) => {
|
|
|
47733
47733
|
className: it(
|
|
47734
47734
|
"flex w-full items-center justify-center rounded px-2 py-1 text-center text-sm color-text-default transition",
|
|
47735
47735
|
{
|
|
47736
|
-
"color-bg-brand xl:hover:brightness-90
|
|
47736
|
+
"color-bg-brand xl:hover:brightness-90 color-text-on-brand": r === s.value,
|
|
47737
47737
|
"hover:color-bg-default-hover": r !== s.value
|
|
47738
47738
|
}
|
|
47739
47739
|
),
|
|
@@ -48013,7 +48013,7 @@ const mp = (e) => {
|
|
|
48013
48013
|
className: it(
|
|
48014
48014
|
"flex w-fit items-center font-medium space-x-2 rounded p-2 text-center text-sm color-text-default transition",
|
|
48015
48015
|
{
|
|
48016
|
-
"color-bg-brand xl:hover:brightness-90
|
|
48016
|
+
"color-bg-brand xl:hover:brightness-90 color-text-on-brand": u.isActive(),
|
|
48017
48017
|
"hover:color-bg-default-hover": !u.isActive()
|
|
48018
48018
|
}
|
|
48019
48019
|
),
|
|
@@ -48029,7 +48029,7 @@ const mp = (e) => {
|
|
|
48029
48029
|
className: it(
|
|
48030
48030
|
"flex items-center space-x-2 rounded px-4 py-1 color-text-default transition h-9",
|
|
48031
48031
|
{
|
|
48032
|
-
"color-bg-brand xl:hover:brightness-90
|
|
48032
|
+
"color-bg-brand xl:hover:brightness-90 color-text-on-brand": u.isActive(),
|
|
48033
48033
|
"hover:color-bg-default-hover": !u.isActive()
|
|
48034
48034
|
}
|
|
48035
48035
|
),
|
|
@@ -48044,7 +48044,7 @@ const mp = (e) => {
|
|
|
48044
48044
|
className: it(
|
|
48045
48045
|
"flex items-center space-x-2 rounded px-4 py-1 color-text-default transition h-9",
|
|
48046
48046
|
{
|
|
48047
|
-
"color-bg-brand xl:hover:brightness-90
|
|
48047
|
+
"color-bg-brand xl:hover:brightness-90 color-text-on-brand": u.isActive(),
|
|
48048
48048
|
"hover:color-bg-default-hover": !u.isActive()
|
|
48049
48049
|
}
|
|
48050
48050
|
),
|
|
@@ -48061,7 +48061,7 @@ const mp = (e) => {
|
|
|
48061
48061
|
className: it(
|
|
48062
48062
|
"flex items-center space-x-2 rounded px-4 py-1 color-text-default transition h-9",
|
|
48063
48063
|
{
|
|
48064
|
-
"color-bg-brand xl:hover:brightness-90
|
|
48064
|
+
"color-bg-brand xl:hover:brightness-90 color-text-on-brand": u.isActive(),
|
|
48065
48065
|
"hover:color-bg-default-hover": !u.isActive()
|
|
48066
48066
|
}
|
|
48067
48067
|
),
|
|
@@ -48076,7 +48076,7 @@ const mp = (e) => {
|
|
|
48076
48076
|
className: it(
|
|
48077
48077
|
"flex items-center space-x-2 rounded px-4 py-1 color-text-default transition h-9",
|
|
48078
48078
|
{
|
|
48079
|
-
"color-bg-brand xl:hover:brightness-90
|
|
48079
|
+
"color-bg-brand xl:hover:brightness-90 color-text-on-brand": u.isActive(),
|
|
48080
48080
|
"hover:color-bg-default-hover": !u.isActive()
|
|
48081
48081
|
}
|
|
48082
48082
|
),
|
|
@@ -48092,7 +48092,7 @@ const mp = (e) => {
|
|
|
48092
48092
|
className: it(
|
|
48093
48093
|
"flex items-center space-x-2 rounded px-4 py-1 color-text-default transition h-9",
|
|
48094
48094
|
{
|
|
48095
|
-
"color-bg-brand xl:hover:brightness-90
|
|
48095
|
+
"color-bg-brand xl:hover:brightness-90 color-text-on-brand": u.isActive(),
|
|
48096
48096
|
"hover:color-bg-default-hover": !u.isActive()
|
|
48097
48097
|
}
|
|
48098
48098
|
),
|
|
@@ -48519,7 +48519,7 @@ const mp = (e) => {
|
|
|
48519
48519
|
className: it(
|
|
48520
48520
|
"flex items-center justify-between rounded-sm px-2 py-1 text-body-sm hover:color-bg-default-hover transition-all",
|
|
48521
48521
|
{
|
|
48522
|
-
"color-bg-brand hover:color-bg-brand-hover
|
|
48522
|
+
"color-bg-brand hover:color-bg-brand-hover color-text-on-brand": o.isActive()
|
|
48523
48523
|
}
|
|
48524
48524
|
),
|
|
48525
48525
|
children: [
|
|
@@ -53462,7 +53462,7 @@ ${T.getHTML()}`
|
|
|
53462
53462
|
isActive: e,
|
|
53463
53463
|
className: Qe(
|
|
53464
53464
|
"color-text-default",
|
|
53465
|
-
e && "
|
|
53465
|
+
e && "color-text-on-brand"
|
|
53466
53466
|
),
|
|
53467
53467
|
onClick: () => {
|
|
53468
53468
|
t((B) => !B), o(!1);
|
|
@@ -59631,7 +59631,7 @@ const wve = zxe.extend({
|
|
|
59631
59631
|
},
|
|
59632
59632
|
autoFocus: !0,
|
|
59633
59633
|
className: it(
|
|
59634
|
-
"bg-transparent color-text-secondary
|
|
59634
|
+
"bg-transparent color-text-secondary resize-none !mt-2",
|
|
59635
59635
|
"placeholder-disabled",
|
|
59636
59636
|
{
|
|
59637
59637
|
"text-left": n.attrs.dataAlign === "start",
|
|
@@ -169132,7 +169132,7 @@ const FLe = 200, wLe = new At("emoji"), DLe = St.create({
|
|
|
169132
169132
|
return /* @__PURE__ */ F.jsx(YZ.Provider, { value: o, children: e });
|
|
169133
169133
|
}, vd = (e, t = "light") => {
|
|
169134
169134
|
if (e)
|
|
169135
|
-
return typeof e == "string" ? e : t
|
|
169135
|
+
return typeof e == "string" ? e : e[t] || e.light || e.dark;
|
|
169136
169136
|
}, oC = (e, t = "light") => {
|
|
169137
169137
|
const n = vd(e, t);
|
|
169138
169138
|
if (n)
|
|
@@ -181870,7 +181870,7 @@ const eqe = async (e, t, n) => {
|
|
|
181870
181870
|
{
|
|
181871
181871
|
className: Qe(
|
|
181872
181872
|
"text-body-sm h-full w-[20px] pr-1 text-center",
|
|
181873
|
-
t === h ? "color-text-
|
|
181873
|
+
t === h ? "color-text-on-brand" : "color-text-default"
|
|
181874
181874
|
),
|
|
181875
181875
|
children: h + 1
|
|
181876
181876
|
}
|
|
@@ -183962,7 +183962,7 @@ const Rqe = "space-xsm gap-xsm hover:color-bg-default-hover cursor-pointer h-[30
|
|
|
183962
183962
|
onSelect: () => v == null ? void 0 : v(),
|
|
183963
183963
|
visible: !!v,
|
|
183964
183964
|
textClassName: "color-text-danger",
|
|
183965
|
-
iconStroke: "
|
|
183965
|
+
iconStroke: "hsl(var(--color-icon-danger))"
|
|
183966
183966
|
}
|
|
183967
183967
|
]
|
|
183968
183968
|
], le = a || C;
|
|
@@ -184621,7 +184621,7 @@ const Rqe = "space-xsm gap-xsm hover:color-bg-default-hover cursor-pointer h-[30
|
|
|
184621
184621
|
label: "Delete",
|
|
184622
184622
|
icon: "Trash2",
|
|
184623
184623
|
textClassName: "color-text-danger",
|
|
184624
|
-
iconStroke: "
|
|
184624
|
+
iconStroke: "hsl(var(--color-icon-danger))",
|
|
184625
184625
|
onSelect: () => {
|
|
184626
184626
|
!j || !c || !E || v(j);
|
|
184627
184627
|
},
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Editor } from '@tiptap/react';
|
|
2
|
-
import { IpfsImageFetchPayload, DdocProps } from '../../types';
|
|
2
|
+
import { IpfsImageFetchPayload, DdocProps, ThemeKey } from '../../types';
|
|
3
3
|
|
|
4
4
|
interface PresentationModeProps {
|
|
5
5
|
editor: Editor;
|
|
@@ -22,7 +22,7 @@ interface PresentationModeProps {
|
|
|
22
22
|
}>;
|
|
23
23
|
documentStyling?: DdocProps['documentStyling'];
|
|
24
24
|
fetchV1ImageFn?: (url: string) => Promise<ArrayBuffer | undefined>;
|
|
25
|
-
theme?:
|
|
25
|
+
theme?: ThemeKey;
|
|
26
26
|
}
|
|
27
27
|
export declare const PresentationMode: ({ editor, onClose, isFullscreen, setIsFullscreen, onError, setCommentDrawerOpen, sharedSlidesLink, isPreviewMode, documentName, onSlidesShare, slides, setSlides, renderThemeToggle, isContentLoading, ipfsImageFetchFn, documentStyling, fetchV1ImageFn, theme, }: PresentationModeProps) => import("react/jsx-runtime").JSX.Element | null;
|
|
28
28
|
export {};
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import { DdocProps } from '../../types';
|
|
1
|
+
import { DdocProps, ThemeKey } from '../../types';
|
|
2
2
|
|
|
3
3
|
interface PreviewPanelProps {
|
|
4
4
|
slides: string[];
|
|
5
5
|
currentSlide: number;
|
|
6
6
|
setCurrentSlide: (index: number) => void;
|
|
7
7
|
documentStyling?: DdocProps['documentStyling'];
|
|
8
|
-
theme?:
|
|
8
|
+
theme?: ThemeKey;
|
|
9
9
|
}
|
|
10
10
|
export declare const PreviewPanel: ({ slides, currentSlide, setCurrentSlide, documentStyling, theme, }: PreviewPanelProps) => import("react/jsx-runtime").JSX.Element;
|
|
11
11
|
export {};
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { default as React, ReactNode } from 'react';
|
|
2
|
-
import { DocumentStyling } from '../types';
|
|
2
|
+
import { DocumentStyling, ThemeKey } from '../types';
|
|
3
3
|
|
|
4
4
|
interface EditorContextType {
|
|
5
5
|
documentStyling?: DocumentStyling;
|
|
6
|
-
theme:
|
|
6
|
+
theme: ThemeKey;
|
|
7
7
|
isFocusMode: boolean;
|
|
8
8
|
}
|
|
9
9
|
export declare const EditorContext: React.Context<EditorContextType | null>;
|
|
@@ -11,7 +11,7 @@ export declare const useEditorContext: () => EditorContextType;
|
|
|
11
11
|
export declare const EditorProvider: React.FC<{
|
|
12
12
|
children: ReactNode;
|
|
13
13
|
documentStyling?: DocumentStyling;
|
|
14
|
-
theme?:
|
|
14
|
+
theme?: ThemeKey;
|
|
15
15
|
isFocusMode?: boolean;
|
|
16
16
|
}>;
|
|
17
17
|
export {};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Dispatch, MutableRefObject, SetStateAction } from 'react';
|
|
2
|
-
import { DdocProps } from '../types';
|
|
2
|
+
import { DdocProps, ThemeKey } from '../types';
|
|
3
3
|
import { AnyExtension, Editor } from '@tiptap/react';
|
|
4
4
|
import { ToCItemType } from '../components/toc/types';
|
|
5
5
|
import { CollabConnectionConfig, CollaborationProps } from '../sync-local/types';
|
|
@@ -45,7 +45,7 @@ interface UseTabEditorArgs {
|
|
|
45
45
|
externalExtensions?: Record<string, AnyExtension>;
|
|
46
46
|
isContentLoading?: boolean;
|
|
47
47
|
activeTabId: string;
|
|
48
|
-
theme?:
|
|
48
|
+
theme?: ThemeKey;
|
|
49
49
|
editorRef?: MutableRefObject<Editor | null>;
|
|
50
50
|
}
|
|
51
51
|
export declare const useTabEditor: ({ ydoc, isVersionMode, hasTabState, versionId, isPreviewMode, initialContent, collaboration, isReady, isSyncing, awareness, disableInlineComment, onCommentInteraction, onError, ipfsImageUploadFn, metadataProxyUrl, onCopyHeadingLink, ipfsImageFetchFn, fetchV1ImageFn, isConnected, activeModel, maxTokens, isAIAgentEnabled, setCharacterCount, setWordCount, setPageCount, setIsContentLoading, setIsCollabContentLoading, unFocused, zoomLevel, isPresentationMode, onInvalidContentError, ignoreCorruptedData, onCollaboratorChange, onConnect, hasCollabContentInitialised, initialiseYjsIndexedDbProvider, externalExtensions, isContentLoading, activeTabId, theme, editorRef, }: UseTabEditorArgs) => {
|
package/dist/package/types.d.ts
CHANGED
|
@@ -40,9 +40,12 @@ export interface CustomModel {
|
|
|
40
40
|
apiKey: string;
|
|
41
41
|
systemPrompt: string;
|
|
42
42
|
}
|
|
43
|
+
export type ThemeKey = 'light' | 'dark' | 'theme-sepia' | 'theme-pink';
|
|
43
44
|
export interface ThemeVariantValue {
|
|
44
45
|
light: string;
|
|
45
46
|
dark: string;
|
|
47
|
+
sepia?: string;
|
|
48
|
+
[key: string]: string | undefined;
|
|
46
49
|
}
|
|
47
50
|
export type DocumentStylingValue = string | ThemeVariantValue;
|
|
48
51
|
/**
|
|
@@ -119,7 +122,7 @@ export interface DdocProps extends CommentAccountProps {
|
|
|
119
122
|
setIsCommentSectionOpen?: React.Dispatch<SetStateAction<boolean>>;
|
|
120
123
|
inlineCommentData?: InlineCommentData;
|
|
121
124
|
setInlineCommentData?: React.Dispatch<React.SetStateAction<InlineCommentData>>;
|
|
122
|
-
theme?:
|
|
125
|
+
theme?: ThemeKey;
|
|
123
126
|
zoomLevel: string;
|
|
124
127
|
setZoomLevel: React.Dispatch<SetStateAction<string>>;
|
|
125
128
|
isNavbarVisible: boolean;
|
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
import { ThemeKey } from '../types';
|
|
2
|
+
|
|
1
3
|
export declare const colors: {
|
|
2
4
|
color: string;
|
|
3
5
|
code: string;
|
|
@@ -7,4 +9,4 @@ export declare const textColors: {
|
|
|
7
9
|
light: string;
|
|
8
10
|
dark: string;
|
|
9
11
|
}[];
|
|
10
|
-
export declare const getResponsiveColor: (color?: string, theme?:
|
|
12
|
+
export declare const getResponsiveColor: (color?: string, theme?: ThemeKey) => string | undefined;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { DocumentStylingValue, ThemeVariantValue } from '../types';
|
|
1
|
+
import { DocumentStylingValue, ThemeKey, ThemeVariantValue } from '../types';
|
|
2
2
|
|
|
3
3
|
export declare const isThemeVariantValue: (value: DocumentStylingValue | undefined) => value is ThemeVariantValue;
|
|
4
|
-
export declare const getThemeStyle: (value?: DocumentStylingValue, theme?:
|
|
5
|
-
export declare const getResponsiveThemeTextColor: (value?: DocumentStylingValue, theme?:
|
|
4
|
+
export declare const getThemeStyle: (value?: DocumentStylingValue, theme?: ThemeKey) => string | undefined;
|
|
5
|
+
export declare const getResponsiveThemeTextColor: (value?: DocumentStylingValue, theme?: ThemeKey) => string | undefined;
|