@fileverse-dev/ddoc 1.0.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (82) hide show
  1. package/README.md +30 -0
  2. package/dist/App.d.ts +2 -0
  3. package/dist/index.d.ts +1 -0
  4. package/dist/index.es.js +26234 -0
  5. package/dist/index.umd.js +356 -0
  6. package/dist/main.d.ts +1 -0
  7. package/dist/packages/ddoc/color-selector.d.ts +14 -0
  8. package/dist/packages/ddoc/common/button.d.ts +20 -0
  9. package/dist/packages/ddoc/common/cutsom-tooltip.d.ts +8 -0
  10. package/dist/packages/ddoc/common/dropdown.d.ts +12 -0
  11. package/dist/packages/ddoc/common/icon.d.ts +8 -0
  12. package/dist/packages/ddoc/common/spinner.d.ts +6 -0
  13. package/dist/packages/ddoc/common/surface.d.ts +7 -0
  14. package/dist/packages/ddoc/common/toolbar.d.ts +28 -0
  15. package/dist/packages/ddoc/common/types.d.ts +19 -0
  16. package/dist/packages/ddoc/ddoc-editor.d.ts +4 -0
  17. package/dist/packages/ddoc/editor-bubble-menu.d.ts +12 -0
  18. package/dist/packages/ddoc/editor-toolbar.d.ts +6 -0
  19. package/dist/packages/ddoc/editor-utils.d.ts +56 -0
  20. package/dist/packages/ddoc/extensions/action-button/action-button-node-view.d.ts +3 -0
  21. package/dist/packages/ddoc/extensions/action-button/action-button.d.ts +16 -0
  22. package/dist/packages/ddoc/extensions/action-button/index.d.ts +1 -0
  23. package/dist/packages/ddoc/extensions/action-button/modal.d.ts +8 -0
  24. package/dist/packages/ddoc/extensions/custom-keymap.d.ts +14 -0
  25. package/dist/packages/ddoc/extensions/d-block/dblock-node-view.d.ts +4 -0
  26. package/dist/packages/ddoc/extensions/d-block/dblock.d.ts +19 -0
  27. package/dist/packages/ddoc/extensions/d-block/index.d.ts +1 -0
  28. package/dist/packages/ddoc/extensions/default-extension.d.ts +5 -0
  29. package/dist/packages/ddoc/extensions/doc.d.ts +3 -0
  30. package/dist/packages/ddoc/extensions/document/document.d.ts +2 -0
  31. package/dist/packages/ddoc/extensions/document/index.d.ts +1 -0
  32. package/dist/packages/ddoc/extensions/horizontal-rule.d.ts +2 -0
  33. package/dist/packages/ddoc/extensions/iframe/iframe.d.ts +27 -0
  34. package/dist/packages/ddoc/extensions/iframe/index.d.ts +1 -0
  35. package/dist/packages/ddoc/extensions/multi-column/column-selection.d.ts +17 -0
  36. package/dist/packages/ddoc/extensions/multi-column/column.d.ts +4 -0
  37. package/dist/packages/ddoc/extensions/multi-column/columns.d.ts +18 -0
  38. package/dist/packages/ddoc/extensions/multi-column/index.d.ts +11 -0
  39. package/dist/packages/ddoc/extensions/multi-column/menus/columns-menu.d.ts +4 -0
  40. package/dist/packages/ddoc/extensions/multi-column/menus/index.d.ts +1 -0
  41. package/dist/packages/ddoc/extensions/multi-column/utils.d.ts +22 -0
  42. package/dist/packages/ddoc/extensions/resizable-media/index.d.ts +1 -0
  43. package/dist/packages/ddoc/extensions/resizable-media/media-paste-drop-plugin/index.d.ts +1 -0
  44. package/dist/packages/ddoc/extensions/resizable-media/media-paste-drop-plugin/media-paste-drop-plugin.d.ts +12 -0
  45. package/dist/packages/ddoc/extensions/resizable-media/resizable-media-node-view.d.ts +3 -0
  46. package/dist/packages/ddoc/extensions/resizable-media/resizable-media.d.ts +27 -0
  47. package/dist/packages/ddoc/extensions/supercharged-table/extension-table/index.d.ts +5 -0
  48. package/dist/packages/ddoc/extensions/supercharged-table/extension-table/table-view.d.ts +18 -0
  49. package/dist/packages/ddoc/extensions/supercharged-table/extension-table/table.d.ts +56 -0
  50. package/dist/packages/ddoc/extensions/supercharged-table/extension-table/utilities/create-cell.d.ts +3 -0
  51. package/dist/packages/ddoc/extensions/supercharged-table/extension-table/utilities/create-table.d.ts +3 -0
  52. package/dist/packages/ddoc/extensions/supercharged-table/extension-table/utilities/delete-table-when-all-cells-selected.d.ts +3 -0
  53. package/dist/packages/ddoc/extensions/supercharged-table/extension-table/utilities/get-table-node-types.d.ts +5 -0
  54. package/dist/packages/ddoc/extensions/supercharged-table/extension-table/utilities/is-cell-selection.d.ts +3 -0
  55. package/dist/packages/ddoc/extensions/supercharged-table/extension-table-cell/index.d.ts +4 -0
  56. package/dist/packages/ddoc/extensions/supercharged-table/extension-table-cell/table-cell-node-view.d.ts +4 -0
  57. package/dist/packages/ddoc/extensions/supercharged-table/extension-table-cell/table-cell.d.ts +6 -0
  58. package/dist/packages/ddoc/extensions/supercharged-table/extension-table-header/index.d.ts +4 -0
  59. package/dist/packages/ddoc/extensions/supercharged-table/extension-table-header/table-header.d.ts +6 -0
  60. package/dist/packages/ddoc/extensions/supercharged-table/extension-table-row/index.d.ts +4 -0
  61. package/dist/packages/ddoc/extensions/supercharged-table/extension-table-row/table-row-node-view.d.ts +17 -0
  62. package/dist/packages/ddoc/extensions/supercharged-table/extension-table-row/table-row.d.ts +7 -0
  63. package/dist/packages/ddoc/extensions/supercharged-table/index.d.ts +5 -0
  64. package/dist/packages/ddoc/extensions/supercharged-table/supercharged-table-kit.d.ts +3 -0
  65. package/dist/packages/ddoc/extensions/trailing-node/index.d.ts +1 -0
  66. package/dist/packages/ddoc/extensions/trailing-node/trailing-node.d.ts +12 -0
  67. package/dist/packages/ddoc/extensions/twitter-embed/embedded-tweet.d.ts +18 -0
  68. package/dist/packages/ddoc/extensions/twitter-embed/index.d.ts +1 -0
  69. package/dist/packages/ddoc/extensions/twitter-embed/tweet-component-node-view.d.ts +3 -0
  70. package/dist/packages/ddoc/hooks/use-content-item-actions.d.ts +10 -0
  71. package/dist/packages/ddoc/hooks/use-editing-context.d.ts +10 -0
  72. package/dist/packages/ddoc/hooks/use-visibility.d.ts +21 -0
  73. package/dist/packages/ddoc/navbar/navbar.d.ts +6 -0
  74. package/dist/packages/ddoc/node-selector.d.ts +10 -0
  75. package/dist/packages/ddoc/props.d.ts +27 -0
  76. package/dist/packages/ddoc/slash-comand.d.ts +5 -0
  77. package/dist/packages/ddoc/utils/debounce.d.ts +1 -0
  78. package/dist/packages/ddoc/utils/get-render-container.d.ts +4 -0
  79. package/dist/packages/ddoc/utils/upload-images.d.ts +8 -0
  80. package/dist/style.css +1 -0
  81. package/dist/vite.svg +1 -0
  82. package/package.json +81 -0
@@ -0,0 +1,4 @@
1
+ import { TableHeader } from './table-header';
2
+
3
+ export * from './table-header';
4
+ export default TableHeader;
@@ -0,0 +1,6 @@
1
+ import { Node } from '@tiptap/core';
2
+
3
+ export interface TableHeaderOptions {
4
+ HTMLAttributes: Record<string, any>;
5
+ }
6
+ export declare const TableHeader: Node<TableHeaderOptions, any>;
@@ -0,0 +1,4 @@
1
+ import { TableRow } from './table-row';
2
+
3
+ export * from './table-row';
4
+ export default TableRow;
@@ -0,0 +1,17 @@
1
+ import { Node as ProseMirrorNode } from 'prosemirror-model';
2
+ import { NodeView } from 'prosemirror-view';
3
+
4
+ export declare class TableRowNodeView implements NodeView {
5
+ node: ProseMirrorNode;
6
+ cellMinWidth: number;
7
+ dom: Element;
8
+ table: HTMLTableElement;
9
+ colgroup: Element;
10
+ contentDOM: HTMLElement;
11
+ constructor(node: ProseMirrorNode, cellMinWidth: number);
12
+ update(node: ProseMirrorNode): boolean;
13
+ ignoreMutation(mutation: MutationRecord | {
14
+ type: 'selection';
15
+ target: Element;
16
+ }): boolean;
17
+ }
@@ -0,0 +1,7 @@
1
+ import { Node } from '@tiptap/core';
2
+
3
+ export interface TableRowOptions {
4
+ HTMLAttributes: Record<string, any>;
5
+ }
6
+ export declare const stopPrevent: <T extends Event>(e: T) => T;
7
+ export declare const TableRow: Node<TableRowOptions, any>;
@@ -0,0 +1,5 @@
1
+ export * from './extension-table';
2
+ export * from './extension-table-cell';
3
+ export * from './extension-table-header';
4
+ export * from './extension-table-row';
5
+ export * from './supercharged-table-kit';
@@ -0,0 +1,3 @@
1
+ import { AnyExtension } from '@tiptap/core';
2
+
3
+ export declare const SuperchargedTableExtensions: AnyExtension[];
@@ -0,0 +1 @@
1
+ export * from './trailing-node';
@@ -0,0 +1,12 @@
1
+ import { Extension } from '@tiptap/core';
2
+
3
+ /**
4
+ * Extension based on:
5
+ * - https://github.com/ueberdosis/tiptap/blob/v1/packages/tiptap-extensions/src/extensions/TrailingNode.js
6
+ * - https://github.com/remirror/remirror/blob/e0f1bec4a1e8073ce8f5500d62193e52321155b9/packages/prosemirror-trailing-node/src/trailing-node-plugin.ts
7
+ */
8
+ export interface TrailingNodeOptions {
9
+ node: string;
10
+ notAfter: string[];
11
+ }
12
+ export declare const TrailingNode: Extension<TrailingNodeOptions, any>;
@@ -0,0 +1,18 @@
1
+ import { Node } from '@tiptap/react';
2
+
3
+ export interface EmbeddedTweetOptions {
4
+ HTMLAttributes: Record<string, any>;
5
+ }
6
+ declare module '@tiptap/core' {
7
+ interface Commands<ReturnType> {
8
+ embeddedTweet: {
9
+ /**
10
+ * Add an tweet embed
11
+ */
12
+ setTweetEmbed: (options: {
13
+ tweetId: string;
14
+ }) => ReturnType;
15
+ };
16
+ }
17
+ }
18
+ export declare const EmbeddedTweet: Node<EmbeddedTweetOptions, any>;
@@ -0,0 +1 @@
1
+ export * from './embedded-tweet';
@@ -0,0 +1,3 @@
1
+ import { NodeViewProps } from '@tiptap/core';
2
+
3
+ export declare const TweetComponentNodeView: ({ node, editor }: NodeViewProps) => import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,10 @@
1
+ import { Node } from '@tiptap/pm/model';
2
+ import { Editor } from '@tiptap/react';
3
+
4
+ declare const useContentItemActions: (editor: Editor, currentNode: Node | null, currentNodePos: number) => {
5
+ resetTextFormatting: () => void;
6
+ duplicateNode: () => void;
7
+ copyNodeToClipboard: () => void;
8
+ deleteNode: () => void;
9
+ };
10
+ export default useContentItemActions;
@@ -0,0 +1,10 @@
1
+ import { default as React, ReactNode } from 'react';
2
+
3
+ type EditingContextType = boolean | null;
4
+ export declare const useEditingContext: () => EditingContextType;
5
+ type EditingProviderProps = {
6
+ children: ReactNode;
7
+ isPreviewMode: boolean;
8
+ };
9
+ export declare const EditingProvider: React.FC<EditingProviderProps>;
10
+ export {};
@@ -0,0 +1,21 @@
1
+ /// <reference types="react" />
2
+ export declare enum IEditorTool {
3
+ NONE = 0,
4
+ HEADING = 1,
5
+ TEXT_COLOR = 2,
6
+ HIGHLIGHT = 3,
7
+ LINK = 4,
8
+ FONT_FAMILY = 5,
9
+ ALIGNMENT = 6,
10
+ LIST = 7
11
+ }
12
+ export default function useComponentVisibilty(initialIsVisible: boolean): {
13
+ ref: import('react').RefObject<HTMLDivElement>;
14
+ isComponentVisible: boolean;
15
+ setIsComponentVisible: import('react').Dispatch<import('react').SetStateAction<boolean>>;
16
+ };
17
+ export declare function useEditorToolVisiibility(initialIsVisible: IEditorTool): {
18
+ ref: import('react').RefObject<HTMLDivElement>;
19
+ toolVisibilty: IEditorTool;
20
+ setToolVisibility: import('react').Dispatch<import('react').SetStateAction<IEditorTool>>;
21
+ };
@@ -0,0 +1,6 @@
1
+ import { PluginMetaData } from '../props';
2
+
3
+ export declare const PluginNavbarLeftSection: ({ metaData, setMetaData, }: {
4
+ metaData: PluginMetaData;
5
+ setMetaData: React.Dispatch<React.SetStateAction<PluginMetaData>>;
6
+ }) => import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,10 @@
1
+ import { Editor } from '@tiptap/core';
2
+ import { Dispatch, FC, SetStateAction } from 'react';
3
+
4
+ interface NodeSelectorProps {
5
+ editor: Editor;
6
+ isOpen: boolean;
7
+ setIsOpen: Dispatch<SetStateAction<boolean>>;
8
+ }
9
+ export declare const NodeSelector: FC<NodeSelectorProps>;
10
+ export {};
@@ -0,0 +1,27 @@
1
+ import { JSONContent } from '@tiptap/core';
2
+ import { EditorProps } from '@tiptap/pm/view';
3
+
4
+ export declare const DpageEditorProps: EditorProps;
5
+ export interface DpageProps {
6
+ isPreviewMode: boolean;
7
+ togglePreviewMode: (flag: boolean) => void;
8
+ onPublish: (data: Data) => void;
9
+ data?: Data;
10
+ }
11
+ interface Data {
12
+ metaData: PluginMetaData;
13
+ editorJSONData: JSONContent;
14
+ }
15
+ interface Cover {
16
+ image: string | null;
17
+ emoji: string | null;
18
+ name: string | null;
19
+ }
20
+ interface Plugin {
21
+ title: string | null;
22
+ }
23
+ export interface PluginMetaData {
24
+ cover: Cover;
25
+ plugin: Plugin;
26
+ }
27
+ export {};
@@ -0,0 +1,5 @@
1
+ import { Extension } from '@tiptap/core';
2
+
3
+ export declare const updateScrollView: (container: HTMLElement, item: HTMLElement) => void;
4
+ declare const SlashCommand: Extension<any, any>;
5
+ export default SlashCommand;
@@ -0,0 +1 @@
1
+ export declare function debounce<T extends Function>(func: T, wait: number): T;
@@ -0,0 +1,4 @@
1
+ import { Editor } from '@tiptap/react';
2
+
3
+ export declare const getRenderContainer: (editor: Editor, nodeType: string) => Element | null;
4
+ export default getRenderContainer;
@@ -0,0 +1,8 @@
1
+ import { Plugin } from '@tiptap/pm/state';
2
+ import { DecorationSet, EditorView } from '@tiptap/pm/view';
3
+
4
+ declare const UploadImagesPlugin: () => Plugin<DecorationSet>;
5
+ export default UploadImagesPlugin;
6
+ export declare function startImageUpload(file: File, view: EditorView, pos: number): void;
7
+ export declare const handleImageUpload: (file: File) => Promise<unknown>;
8
+ export declare const uploadFn: (image: File) => Promise<string>;
package/dist/style.css ADDED
@@ -0,0 +1 @@
1
+ .dropdown{z-index:50;width:13rem;--tw-translate-x: -.5rem;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y));border-radius:.25rem;--tw-bg-opacity: 1;background-color:rgb(255 255 255 / var(--tw-bg-opacity))}.dropdown .dropdown-content{display:flex;flex-direction:column;border-radius:.375rem;--tw-bg-opacity: 1;background-color:rgb(255 255 255 / var(--tw-bg-opacity));--tw-shadow: 0 4px 6px -1px rgb(0 0 0 / .1), 0 2px 4px -2px rgb(0 0 0 / .1);--tw-shadow-colored: 0 4px 6px -1px var(--tw-shadow-color), 0 2px 4px -2px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.dropdown .dropdown-content .button{display:flex;width:100%;align-items:center;gap:.5rem;border-radius:.25rem;padding:.25rem .5rem;--tw-text-opacity: 1;color:rgb(0 0 0 / var(--tw-text-opacity))}.dropdown .dropdown-content .button:hover{--tw-bg-opacity: 1;background-color:rgb(243 244 246 / var(--tw-bg-opacity))}.trigger-button{position:absolute;right:0;bottom:0;margin:.25rem;display:flex;cursor:pointer;align-items:center;justify-content:center;border-radius:.25rem;background-color:transparent;padding:0 1px;font-size:1rem;line-height:1.5rem;opacity:0;transition-property:all;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.group:hover .trigger-button{opacity:1}.ProseMirror .is-empty:before{pointer-events:none;float:left;height:0px;width:100%;color:#0006}.ProseMirror.ProseMirror-focused p.is-empty:before{content:"Type / to browse options"}.ProseMirror.ProseMirror-focused h1.is-empty:before{content:"Heading 1"}.ProseMirror.ProseMirror-focused h2.is-empty:before{content:"Heading 2"}.ProseMirror.ProseMirror-focused h3.is-empty:before{content:"Heading 3"}.ProseMirror p.is-empty:before{content:"Type / to browse options"}.ProseMirror blockquote .is-empty:not(.is-editor-empty):first-child:last-child:before{content:"Enter a quote"}.ProseMirror p{margin-top:.75rem;margin-bottom:.75rem;line-height:1.625}.ProseMirror p:first-child{margin-top:0}.ProseMirror p:last-child{margin-bottom:0}.ProseMirror>p{margin-top:1.5rem;margin-bottom:1.5rem}.ProseMirror>p:first-child{margin-top:0}.ProseMirror>p:last-child{margin-bottom:0}.ProseMirror .media-node-view{position:relative;margin-top:.5rem;margin-bottom:.5rem;display:flex;width:100%}.ProseMirror .media-node-view.f-left{float:left}.ProseMirror .media-node-view.f-right{float:right}.ProseMirror .media-node-view.align-left{justify-content:flex-start}.ProseMirror .media-node-view.align-center{justify-content:center}.ProseMirror .media-node-view.align-right{justify-content:flex-end}.ProseMirror .media-node-view .horizontal-resize-handle{position:absolute;top:50%;right:.25rem;z-index:50;height:3rem;width:.5rem;--tw-translate-y: -50%;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y));cursor:col-resize;border-radius:.25rem}@media (min-width: 1024px){.ProseMirror .media-node-view .horizontal-resize-handle{height:6rem}}.ProseMirror .media-node-view .btn{display:inline-flex;align-items:center;border-width:1px;border-color:transparent;--tw-bg-opacity: 1;background-color:rgb(243 244 246 / var(--tw-bg-opacity));padding:.375rem .625rem;font-size:.75rem;line-height:1rem;font-weight:500;--tw-text-opacity: 1;color:rgb(55 65 81 / var(--tw-text-opacity))}.ProseMirror .media-node-view .btn:hover{--tw-bg-opacity: 1;background-color:rgb(229 231 235 / var(--tw-bg-opacity))}.ProseMirror .media-node-view .btn.active{--tw-bg-opacity: 1;background-color:rgb(209 213 219 / var(--tw-bg-opacity))}.ProseMirror .media-node-view .media-control-buttons{position:absolute;top:.5rem;right:.5rem;box-sizing:border-box;overflow:hidden;border-radius:.375rem;border-width:1px;--tw-border-opacity: 1;border-color:rgb(226 232 240 / var(--tw-border-opacity));--tw-bg-opacity: 1;background-color:rgb(255 255 255 / var(--tw-bg-opacity));--tw-shadow: 0 20px 25px -5px rgb(0 0 0 / .1), 0 8px 10px -6px rgb(0 0 0 / .1);--tw-shadow-colored: 0 20px 25px -5px var(--tw-shadow-color), 0 8px 10px -6px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow);transition-property:all;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.2s;transition-timing-function:linear}.ProseMirror table{border-collapse:collapse;border-spacing:0;width:100%;margin:0;box-sizing:border-box;position:relative;overflow-x:auto}.ProseMirror table td,.ProseMirror table th{min-width:10rem;max-width:10rem;border:2px solid #ced4da;padding:3px 5px;vertical-align:top}.ProseMirror table td>*,.ProseMirror table th>*{margin-bottom:0}.ProseMirror table tr div{width:100%}.ProseMirror table th{font-weight:700;text-align:left;background-color:#f1f3f5}.ProseMirror table .selectedCell:after{z-index:2;position:absolute;content:"";left:0;right:0;top:0;bottom:0;background:#c8c8ff66;pointer-events:none}.ProseMirror table .column-resize-handle{position:absolute;right:-2px;top:0;bottom:-2px;width:6px;background-color:#adf;pointer-events:auto}.ProseMirror table p{margin:0}.ProseMirror table p.is-empty:before{content:""!important}.ProseMirror .d-block-button{display:flex;height:-moz-fit-content;height:fit-content;align-items:center;justify-content:center;border-radius:.25rem;background-color:transparent;padding-top:.25rem;padding-bottom:.25rem;font-size:1.125rem;line-height:1.75rem;--tw-text-opacity: 1;color:rgb(0 0 0 / var(--tw-text-opacity));opacity:0;transition-property:all;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.3s;transition-timing-function:cubic-bezier(0,0,.2,1)}.ProseMirror ul,.ProseMirror ol,.ProseMirror li{margin:0;padding:0}.ProseMirror>*:first-child:first-child,.ProseMirror [data-type=column]>*:first-child{margin-top:0}.ProseMirror>*:first-child:last-child,.ProseMirror [data-type=column]>*:last-child{margin-bottom:0}.ProseMirror [data-type=columns]{margin-top:.75rem;margin-bottom:.75rem;display:grid;grid-template-columns:repeat(1,minmax(0,1fr));gap:.5rem}@media (min-width: 768px){.ProseMirror [data-type=columns]{grid-template-columns:repeat(auto-fit,minmax(100px,1fr))}}.ProseMirror [data-type=columns].layout-align-right>*:first-child{grid-column:span 1 / span 1}.ProseMirror [data-type=columns].layout-align-right>*:last-child{grid-column:span 1 / span 1}.ProseMirror [data-type=columns].layout-align-right>*:nth-last-child(2):first-child{grid-column:span 2 / span 2}.ProseMirror [data-type=columns].layout-align-right>*:nth-last-child(3):first-child{grid-column:span 2 / span 2}.ProseMirror [data-type=columns].layout-align-left>*:first-child{grid-column:span 1 / span 1}.ProseMirror [data-type=columns].layout-align-left>*:last-child{grid-column:span 1 / span 1}.ProseMirror [data-type=columns].layout-align-left>*:nth-child(2):last-child{grid-column:span 2 / span 2}.ProseMirror [data-type=columns].layout-align-left>*:nth-child(3):last-child{grid-column:span 2 / span 2}.ProseMirror [data-type=columns] [data-type=column]{min-width:100%;overflow:hidden;border-radius:.25rem;border-width:2px;border-style:dashed;border-color:transparent;padding:.25rem;transition:border .16s cubic-bezier(.45,.05,.55,.95)}.ProseMirror [data-type=columns] [data-type=column]:hover,.ProseMirror [data-type=columns] [data-type=column]:focus{--tw-border-opacity: 1;border-color:rgb(212 212 212 / var(--tw-border-opacity))}.ProseMirror [data-type=columns] [data-type=column]>.node-dBlock{padding-bottom:0!important}.ProseMirror [data-type=horizontalRule]{margin-left:auto;margin-right:auto;height:.25rem;width:50%;cursor:pointer;border-radius:.125rem;padding-top:.5rem;padding-bottom:.75rem;transition-property:all;transition-duration:.1s;transition-timing-function:cubic-bezier(.4,0,.2,1)}.ProseMirror [data-type=horizontalRule].ProseMirror-selectednode{background-color:#bfdbfe80}.ProseMirror [data-type=horizontalRule]:hover:not(.ProseMirror [data-type=horizontalRule].ProseMirror-selectednode){background-color:#bfdbfe80}.ProseMirror [data-type=horizontalRule] hr{border-radius:.25rem;border-width:2px;border-color:#d1d5db33;background-color:#d1d5dbcc}.table-wrapper,.is-table div{padding:0;width:auto;overflow-x:auto}.resize-cursor{cursor:ew-resize;cursor:col-resize}.node-dBlock{flex-grow:1;transition:all .2s;width:100%}.node-dBlock:last-child{padding-bottom:4rem}.node-iframe,.node-embeddedTweet{pointer-events:auto}@media (max-width: 1025px){.node-iframe iframe{width:100%;aspect-ratio:16/9;height:auto}}[data-theme=link-command]{width:1000vw}.ProseMirror>*+*{margin-top:1.5em;margin-bottom:1.5em}.ProseMirror ul,.ProseMirror ol{padding:0 1rem;margin:.5rem;text-wrap:text-wrap;word-break:break-all;width:inherit}.ProseMirror li{padding:0 1rem;margin:.5rem}.ProseMirror h1,.ProseMirror h2,.ProseMirror h3{line-height:1.1;font-weight:700}.ProseMirror h1{font-size:32px}.ProseMirror h2{font-size:24px}.ProseMirror h3{font-size:18px}.ProseMirror code{background-color:#6161611a;color:#616161}.ProseMirror pre{background:#0d0d0d;color:#fff;font-family:JetBrainsMono,monospace;padding:.75rem 1rem;border-radius:.5rem}.ProseMirror pre code{color:inherit;padding:0;background:none;font-size:.8rem}.ProseMirror img{max-width:100%;height:auto}.ProseMirror blockquote{padding-left:1rem;border-left:2px solid rgba(13,13,13,.1)}.ProseMirror img:hover{cursor:pointer;transition-property:box-shadow;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.2s}.ProseMirror img:hover:hover{--tw-shadow: 0 10px 15px -3px rgb(0 0 0 / .1), 0 4px 6px -4px rgb(0 0 0 / .1);--tw-shadow-colored: 0 10px 15px -3px var(--tw-shadow-color), 0 4px 6px -4px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.ProseMirror img.ProseMirror-selectednode{outline:3px solid #5abbf7;filter:brightness(90%)}.tiptap.ProseMirror ol{display:flex;flex-direction:column}ul[data-type=taskList] li>label{margin-right:.2rem;-webkit-user-select:none;-moz-user-select:none;user-select:none}@media screen and (max-width: 768px){ul[data-type=taskList] li>label{margin-right:.5rem}}ul[data-type=taskList] li>label input[type=checkbox]{-webkit-appearance:none;-moz-appearance:none;appearance:none;background-color:#fff;margin:0;cursor:pointer;width:1.2em;height:1.2em;position:relative;top:3px;border:2px solid black;margin-right:.3rem;display:grid;place-content:center}ul[data-type=taskList] li>label input[type=checkbox]:hover{background-color:#f8f9fa}ul[data-type=taskList] li>label input[type=checkbox]:active{background-color:#e9ecef}ul[data-type=taskList] li>label input[type=checkbox]:before{content:"";width:.65em;height:.65em;transform:scale(0);transition:.12s transform ease-in-out;box-shadow:inset 1em 1em;transform-origin:center;clip-path:polygon(14% 44%,0 65%,50% 100%,100% 16%,80% 0%,43% 62%)}ul[data-type=taskList] li>label input[type=checkbox]:checked:before{transform:scale(1)}ul[data-type=taskList] li[data-checked=true]>div>p{color:#a8a29e;text-decoration:line-through;text-decoration-thickness:2px}.tippy-box[data-animation=shift-toward-subtle][data-state=hidden]{opacity:0}.tippy-box[data-animation=shift-toward-subtle][data-state=hidden][data-placement^=top][data-state=hidden]{transform:translateY(-5px)}.tippy-box[data-animation=shift-toward-subtle][data-state=hidden][data-placement^=bottom][data-state=hidden]{transform:translateY(5px)}.tippy-box[data-animation=shift-toward-subtle][data-state=hidden][data-placement^=left][data-state=hidden]{transform:translate(-5px)}.tippy-box[data-animation=shift-toward-subtle][data-state=hidden][data-placement^=right][data-state=hidden]{transform:translate(5px)}
package/dist/vite.svg ADDED
@@ -0,0 +1 @@
1
+ <svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" aria-hidden="true" role="img" class="iconify iconify--logos" width="31.88" height="32" preserveAspectRatio="xMidYMid meet" viewBox="0 0 256 257"><defs><linearGradient id="IconifyId1813088fe1fbc01fb466" x1="-.828%" x2="57.636%" y1="7.652%" y2="78.411%"><stop offset="0%" stop-color="#41D1FF"></stop><stop offset="100%" stop-color="#BD34FE"></stop></linearGradient><linearGradient id="IconifyId1813088fe1fbc01fb467" x1="43.376%" x2="50.316%" y1="2.242%" y2="89.03%"><stop offset="0%" stop-color="#FFEA83"></stop><stop offset="8.333%" stop-color="#FFDD35"></stop><stop offset="100%" stop-color="#FFA800"></stop></linearGradient></defs><path fill="url(#IconifyId1813088fe1fbc01fb466)" d="M255.153 37.938L134.897 252.976c-2.483 4.44-8.862 4.466-11.382.048L.875 37.958c-2.746-4.814 1.371-10.646 6.827-9.67l120.385 21.517a6.537 6.537 0 0 0 2.322-.004l117.867-21.483c5.438-.991 9.574 4.796 6.877 9.62Z"></path><path fill="url(#IconifyId1813088fe1fbc01fb467)" d="M185.432.063L96.44 17.501a3.268 3.268 0 0 0-2.634 3.014l-5.474 92.456a3.268 3.268 0 0 0 3.997 3.378l24.777-5.718c2.318-.535 4.413 1.507 3.936 3.838l-7.361 36.047c-.495 2.426 1.782 4.5 4.151 3.78l15.304-4.649c2.372-.72 4.652 1.36 4.15 3.788l-11.698 56.621c-.732 3.542 3.979 5.473 5.943 2.437l1.313-2.028l72.516-144.72c1.215-2.423-.88-5.186-3.54-4.672l-25.505 4.922c-2.396.462-4.435-1.77-3.759-4.114l16.646-57.705c.677-2.35-1.37-4.583-3.769-4.113Z"></path></svg>
package/package.json ADDED
@@ -0,0 +1,81 @@
1
+ {
2
+ "name": "@fileverse-dev/ddoc",
3
+ "private": false,
4
+ "description": "DDoc",
5
+ "version": "1.0.0",
6
+ "main": "dist/index.umd.js",
7
+ "module": "dist/index.es.js",
8
+ "types": "dist/index.d.ts",
9
+ "exports": {
10
+ ".": {
11
+ "import": "./dist/index.es.js",
12
+ "require": "./dist/index.umd.js",
13
+ "types": "./dist/index.d.ts"
14
+ },
15
+ "./styles": "./dist/style.css"
16
+ },
17
+ "files": [
18
+ "/dist"
19
+ ],
20
+ "publishConfig": {
21
+ "access": "public"
22
+ },
23
+ "scripts": {
24
+ "dev": "vite",
25
+ "build": "tsc && vite build",
26
+ "lint": "eslint . --ext ts,tsx --report-unused-disable-directives --max-warnings 0",
27
+ "preview": "vite preview"
28
+ },
29
+ "dependencies": {
30
+ "@_ueberdosis/prosemirror-tables": "^1.1.3",
31
+ "@radix-ui/react-popover": "^1.0.7",
32
+ "@tippyjs/react": "^4.2.6",
33
+ "@tiptap/core": "^2.4.0",
34
+ "@tiptap/extension-color": "^2.4.0",
35
+ "@tiptap/extension-document": "^2.4.0",
36
+ "@tiptap/extension-dropcursor": "^2.4.0",
37
+ "@tiptap/extension-font-family": "^2.4.0",
38
+ "@tiptap/extension-gapcursor": "^2.4.0",
39
+ "@tiptap/extension-highlight": "^2.4.0",
40
+ "@tiptap/extension-link": "^2.4.0",
41
+ "@tiptap/extension-placeholder": "^2.4.0",
42
+ "@tiptap/extension-task-item": "^2.4.0",
43
+ "@tiptap/extension-task-list": "^2.4.0",
44
+ "@tiptap/extension-text-align": "^2.4.0",
45
+ "@tiptap/extension-text-style": "^2.4.0",
46
+ "@tiptap/extension-underline": "^2.4.0",
47
+ "@tiptap/pm": "^2.4.0",
48
+ "@tiptap/react": "^2.4.0",
49
+ "@tiptap/starter-kit": "^2.4.0",
50
+ "@tiptap/suggestion": "^2.4.0",
51
+ "classnames": "^2.5.1",
52
+ "lucide-react": "^0.379.0",
53
+ "prosemirror-model": "^1.21.0",
54
+ "prosemirror-state": "^1.4.3",
55
+ "react": "^18.2.0",
56
+ "react-dom": "^18.2.0",
57
+ "react-twitter-embed": "^4.0.4",
58
+ "react-uuid": "^2.0.0",
59
+ "tippy.js": "^6.3.7",
60
+ "usehooks-ts": "^3.1.0",
61
+ "vite-plugin-dts": "^3.6.3"
62
+ },
63
+ "devDependencies": {
64
+ "@types/node": "^20.10.0",
65
+ "@types/react": "^18.2.37",
66
+ "@types/react-dom": "^18.2.15",
67
+ "@typescript-eslint/eslint-plugin": "^6.10.0",
68
+ "@typescript-eslint/parser": "^6.10.0",
69
+ "@vitejs/plugin-react": "^4.2.0",
70
+ "autoprefixer": "^10.4.19",
71
+ "daisyui": "^4.11.1",
72
+ "eslint": "^8.53.0",
73
+ "eslint-plugin-react-hooks": "^4.6.0",
74
+ "eslint-plugin-react-refresh": "^0.4.4",
75
+ "postcss": "^8.4.38",
76
+ "sass": "^1.77.2",
77
+ "tailwindcss": "^3.4.3",
78
+ "typescript": "^5.2.2",
79
+ "vite": "^5.0.0"
80
+ }
81
+ }