@lupinum/ginko-editor 0.1.0 → 0.18.0
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/CHANGELOG.md +7 -73
- package/LICENSE +1 -1
- package/README.md +15 -340
- package/dist/assets.d.ts +70 -0
- package/dist/assets.js +31 -0
- package/dist/core/component-props.d.ts +87 -0
- package/dist/core/component-props.js +134 -0
- package/dist/core/convert.d.ts +24 -0
- package/dist/core/convert.js +278 -0
- package/dist/core/editor.d.ts +60 -0
- package/dist/core/editor.js +85 -0
- package/dist/core/extensions.d.ts +38 -0
- package/dist/core/extensions.js +444 -0
- package/dist/core/file-images.d.ts +9 -0
- package/dist/core/file-images.js +54 -0
- package/dist/core/image-frame.d.ts +23 -0
- package/dist/core/image-frame.js +24 -0
- package/dist/core/index.d.ts +17 -0
- package/dist/core/index.js +17 -0
- package/dist/core/link-card.d.ts +20 -0
- package/dist/core/link-card.js +70 -0
- package/dist/core/link.d.ts +3 -0
- package/dist/core/link.js +8 -0
- package/dist/core/move.d.ts +11 -0
- package/dist/core/move.js +37 -0
- package/dist/core/paste-html.d.ts +6 -0
- package/dist/core/paste-html.js +384 -0
- package/dist/core/paste.d.ts +21 -0
- package/dist/core/paste.js +108 -0
- package/dist/core/problems.d.ts +31 -0
- package/dist/core/problems.js +54 -0
- package/dist/core/search.d.ts +47 -0
- package/dist/core/search.js +148 -0
- package/dist/core/slash.d.ts +93 -0
- package/dist/core/slash.js +215 -0
- package/dist/core/table.d.ts +34 -0
- package/dist/core/table.js +141 -0
- package/dist/core/uploads.d.ts +23 -0
- package/dist/core/uploads.js +71 -0
- package/dist/core/use-editor.d.ts +19 -0
- package/dist/core/use-editor.js +53 -0
- package/dist/index.d.ts +6 -15
- package/dist/index.js +6 -5668
- package/dist/issues.d.ts +49 -0
- package/dist/issues.js +9 -0
- package/dist/today.d.ts +6 -0
- package/dist/today.js +19 -0
- package/dist/useUpload.d.ts +48 -0
- package/dist/useUpload.js +59 -0
- package/dist/values.d.ts +14 -0
- package/dist/values.js +36 -0
- package/package.json +35 -95
- package/dist/GinkoEditor.vue.d.ts +0 -96
- package/dist/GinkoImagePicker.vue.d.ts +0 -36
- package/dist/agent/AGENTS.md +0 -13
- package/dist/agent/pages/docs/getting-started/collaboration.md +0 -435
- package/dist/agent/pages/docs/getting-started/component-coverage.md +0 -107
- package/dist/agent/pages/docs/getting-started/customize.md +0 -384
- package/dist/agent/pages/docs/getting-started/images.md +0 -188
- package/dist/agent/pages/docs/getting-started/in-place-editing.md +0 -110
- package/dist/agent/pages/docs/getting-started/layout-blocks.md +0 -148
- package/dist/agent/pages/docs/getting-started/runtime.md +0 -111
- package/dist/agent/pages/docs/getting-started.md +0 -128
- package/dist/authoring-D7MJezVG.js +0 -1780
- package/dist/authoring-D7MJezVG.js.map +0 -1
- package/dist/authoring.d.ts +0 -122
- package/dist/authoring.js +0 -2
- package/dist/collaboration.d.ts +0 -14
- package/dist/collaboration.js +0 -907
- package/dist/collaboration.js.map +0 -1
- package/dist/composables/useAssetRequests.d.ts +0 -44
- package/dist/composables/useCollaborationBinding.d.ts +0 -59
- package/dist/composables/useDevice.d.ts +0 -10
- package/dist/composables/useInsertMenu.d.ts +0 -67
- package/dist/composables/useMarkdownSync.d.ts +0 -96
- package/dist/composables/useStableAuthoringKit.d.ts +0 -16
- package/dist/documentConfig-Z6LdrWZj.js +0 -2360
- package/dist/documentConfig-Z6LdrWZj.js.map +0 -1
- package/dist/editorProps.d.ts +0 -124
- package/dist/index.js.map +0 -1
- package/dist/layout-kit.d.ts +0 -922
- package/dist/lib/collaboration/presence-record.d.ts +0 -18
- package/dist/lib/collaboration/presence.d.ts +0 -103
- package/dist/lib/collaboration/protocol.d.ts +0 -133
- package/dist/lib/collaboration/recovery.d.ts +0 -45
- package/dist/lib/collaboration/session.d.ts +0 -163
- package/dist/lib/collaboration/validation.d.ts +0 -42
- package/dist/lib/component-converters.d.ts +0 -119
- package/dist/lib/config/documentConfig.d.ts +0 -19
- package/dist/lib/config/editorConfig.d.ts +0 -38
- package/dist/lib/container-items.d.ts +0 -55
- package/dist/lib/conversionInvariants.d.ts +0 -3
- package/dist/lib/conversionLogger.d.ts +0 -10
- package/dist/lib/conversionPipeline.d.ts +0 -17
- package/dist/lib/conversionState.d.ts +0 -10
- package/dist/lib/conversionTypes.d.ts +0 -50
- package/dist/lib/editor-operations.d.ts +0 -39
- package/dist/lib/environment.d.ts +0 -6
- package/dist/lib/extensions/code-block.d.ts +0 -18
- package/dist/lib/extensions/component-boundary.d.ts +0 -9
- package/dist/lib/extensions/container-items.d.ts +0 -29
- package/dist/lib/extensions/element.d.ts +0 -19
- package/dist/lib/extensions/file.d.ts +0 -24
- package/dist/lib/extensions/heading.d.ts +0 -5
- package/dist/lib/extensions/image-upload.d.ts +0 -39
- package/dist/lib/extensions/image.d.ts +0 -39
- package/dist/lib/extensions/index.d.ts +0 -10
- package/dist/lib/extensions/inline-element.d.ts +0 -13
- package/dist/lib/extensions/markdown-clipboard.d.ts +0 -21
- package/dist/lib/extensions/profile.d.ts +0 -11
- package/dist/lib/extensions/slot.d.ts +0 -16
- package/dist/lib/extensions/span-style.d.ts +0 -15
- package/dist/lib/extensions/video.d.ts +0 -15
- package/dist/lib/image-properties.d.ts +0 -20
- package/dist/lib/input-rules.d.ts +0 -7
- package/dist/lib/markdown.d.ts +0 -11
- package/dist/lib/marks.d.ts +0 -7
- package/dist/lib/mdcToTiptap.d.ts +0 -20
- package/dist/lib/mdcTypes.d.ts +0 -20
- package/dist/lib/nodes.d.ts +0 -57
- package/dist/lib/nodeviews/block-actions.d.ts +0 -7
- package/dist/lib/nodeviews/code.d.ts +0 -4
- package/dist/lib/nodeviews/columns.d.ts +0 -17
- package/dist/lib/nodeviews/component.d.ts +0 -6
- package/dist/lib/nodeviews/icons.d.ts +0 -26
- package/dist/lib/nodeviews/image.d.ts +0 -9
- package/dist/lib/nodeviews/items.d.ts +0 -15
- package/dist/lib/nodeviews/lifecycle.d.ts +0 -45
- package/dist/lib/nodeviews/popover.d.ts +0 -15
- package/dist/lib/nodeviews/settings.d.ts +0 -11
- package/dist/lib/nodeviews/table-operations.d.ts +0 -50
- package/dist/lib/nodeviews/table.d.ts +0 -4
- package/dist/lib/profiles.d.ts +0 -62
- package/dist/lib/property-input.d.ts +0 -10
- package/dist/lib/property-step.d.ts +0 -77
- package/dist/lib/props.d.ts +0 -13
- package/dist/lib/stripStyleNodes.d.ts +0 -2
- package/dist/lib/tiptapToMdc.d.ts +0 -18
- package/dist/presence-record-CLdPZWKC.js +0 -291
- package/dist/presence-record-CLdPZWKC.js.map +0 -1
- package/dist/runtime.d.ts +0 -13
- package/dist/runtime.js +0 -3
- package/dist/style.css +0 -2
- package/dist/types.d.ts +0 -126
- package/dist/ui/GinkoActionButton.vue.d.ts +0 -8
- package/dist/ui/GinkoInsertMenu.vue.d.ts +0 -49
- package/dist/ui/GinkoKeyboardDock.vue.d.ts +0 -15
- package/dist/ui/GinkoNodePopover.vue.d.ts +0 -21
- package/dist/ui/GinkoRecipeIcon.vue.d.ts +0 -6
- package/dist/ui/GinkoSelectionToolbar.vue.d.ts +0 -10
- package/dist/ui/GinkoToolbar.vue.d.ts +0 -26
- package/dist/ui/GinkoToolbarIcon.vue.d.ts +0 -6
- package/dist/ui/block-shortcuts.d.ts +0 -6
- package/dist/ui/commands.d.ts +0 -78
- package/dist/ui/context.d.ts +0 -23
- package/dist/ui/editor-keyboard.d.ts +0 -15
- package/dist/ui/messages.d.ts +0 -214
- package/dist/ui/messages.de.d.ts +0 -6
- package/dist/ui/recipe-command.d.ts +0 -14
- package/dist/ui/recipe-search.d.ts +0 -47
- package/dist/ui/slash-command.d.ts +0 -17
- package/dist/ui/writingRecipes.d.ts +0 -13
- package/skills/ginko-editor/SKILL.md +0 -40
- package/skills/ginko-editor/agents/openai.yaml +0 -4
- package/skills/ginko-editor/references/in-place-editing.md +0 -50
- package/skills/ginko-editor/references/quickstart.md +0 -55
package/dist/lib/nodes.d.ts
DELETED
|
@@ -1,57 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Node converters for MDC to TipTap transformation
|
|
3
|
-
*
|
|
4
|
-
* Handles document structure: headings, paragraphs, lists, tables, etc.
|
|
5
|
-
*/
|
|
6
|
-
import type { JSONContent } from '@tiptap/core';
|
|
7
|
-
import type { JsonRecord } from '../types.js';
|
|
8
|
-
import type { MDCElement, MDCNode } from './mdcTypes.js';
|
|
9
|
-
/**
|
|
10
|
-
* Creates a heading node converter for a specific level
|
|
11
|
-
*/
|
|
12
|
-
export declare function createHeadingNode(node: MDCNode, createTipTapNodeFn: (node: MDCElement, type: string, extra?: {
|
|
13
|
-
attrs?: JsonRecord;
|
|
14
|
-
children?: MDCNode[];
|
|
15
|
-
}) => JSONContent): JSONContent;
|
|
16
|
-
/**
|
|
17
|
-
* Creates a paragraph node
|
|
18
|
-
*/
|
|
19
|
-
export declare function createParagraphNode(node: MDCElement, convertNode: (node: MDCNode, parent?: MDCNode) => JSONContent | JSONContent[], options?: {
|
|
20
|
-
allowImageLift?: boolean;
|
|
21
|
-
}): JSONContent | JSONContent[];
|
|
22
|
-
/**
|
|
23
|
-
* Creates a list item node
|
|
24
|
-
*/
|
|
25
|
-
export declare function createListItemNode(node: MDCElement, createTipTapNodeFn: (node: MDCElement, type: string, extra?: {
|
|
26
|
-
attrs?: JsonRecord;
|
|
27
|
-
children?: MDCNode[];
|
|
28
|
-
}) => JSONContent): JSONContent;
|
|
29
|
-
/**
|
|
30
|
-
* Creates a table cell node (th or td)
|
|
31
|
-
*/
|
|
32
|
-
export declare function createTableCellNode(node: MDCElement, type: 'tableCell' | 'tableHeader', createTipTapNodeFn: (node: MDCElement, type: string, extra?: {
|
|
33
|
-
attrs?: JsonRecord;
|
|
34
|
-
children?: MDCNode[];
|
|
35
|
-
}) => JSONContent): JSONContent;
|
|
36
|
-
/**
|
|
37
|
-
* Creates a code block (pre) node
|
|
38
|
-
*/
|
|
39
|
-
export declare function createPreNode(node: MDCElement, getNodeTextFn: (node: MDCElement) => string, createTipTapNodeFn: (node: MDCElement, type: string, extra?: {
|
|
40
|
-
attrs?: JsonRecord;
|
|
41
|
-
children?: MDCNode[];
|
|
42
|
-
}) => JSONContent): JSONContent;
|
|
43
|
-
/**
|
|
44
|
-
* Creates a span-style node (for styled spans)
|
|
45
|
-
*/
|
|
46
|
-
export declare function createSpanStyleNode(node: MDCElement, isValidAttrFn: (value?: string | null) => boolean, createTipTapNodeFn: (node: MDCElement, type: string, extra?: {
|
|
47
|
-
attrs?: JsonRecord;
|
|
48
|
-
children?: MDCNode[];
|
|
49
|
-
}) => JSONContent): JSONContent;
|
|
50
|
-
/**
|
|
51
|
-
* Creates a template/slot node
|
|
52
|
-
*/
|
|
53
|
-
export declare function createTemplateNode(node: MDCElement, createTipTapNodeFn: (node: MDCElement, type: string, extra?: {
|
|
54
|
-
attrs?: JsonRecord;
|
|
55
|
-
children?: MDCNode[];
|
|
56
|
-
}) => JSONContent): JSONContent;
|
|
57
|
-
export declare function normalizeBlockChildren(children: MDCNode[]): MDCNode[];
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import type { Editor } from '@tiptap/core';
|
|
2
|
-
import type { Node } from '@tiptap/pm/model';
|
|
3
|
-
import { type BlockAction, type EditorOperationContext } from '../editor-operations.js';
|
|
4
|
-
export type { BlockAction } from '../editor-operations.js';
|
|
5
|
-
/** Existing node-view callers share the same checked operations as toolbar and keyboard controls. */
|
|
6
|
-
export declare function canActOnBlock(editor: Editor, pos: number, action: BlockAction, context?: EditorOperationContext): boolean;
|
|
7
|
-
export declare function actOnBlock(editor: Editor, node: Node, pos: number, action: BlockAction, context?: EditorOperationContext): Promise<boolean>;
|
|
@@ -1,4 +0,0 @@
|
|
|
1
|
-
import type { EditorOverlayController } from '../../ui/context.js';
|
|
2
|
-
import type { NodeViewRendererProps } from '@tiptap/core';
|
|
3
|
-
import type { NodeView } from '@tiptap/pm/view';
|
|
4
|
-
export declare function codeView({ node: initial, editor, getPos }: NodeViewRendererProps, overlay?: EditorOverlayController): NodeView;
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
import type { Node as ProseMirrorNode } from '@tiptap/pm/model';
|
|
2
|
-
import type { AuthoringKit } from '../../authoring.js';
|
|
3
|
-
/** Return direct columns, including the parser's explicit default-slot form. */
|
|
4
|
-
export declare function columnChildren(node: ProseMirrorNode, childTag: string): {
|
|
5
|
-
node: ProseMirrorNode;
|
|
6
|
-
offset: number;
|
|
7
|
-
}[];
|
|
8
|
-
/** Paired column membership is shared by pointer controls and block shortcuts. */
|
|
9
|
-
export declare function parentColumnConfig(doc: ProseMirrorNode, pos: number, kit: AuthoringKit | undefined): {
|
|
10
|
-
childTag: string;
|
|
11
|
-
sizeProp: string;
|
|
12
|
-
presets: readonly {
|
|
13
|
-
label: string;
|
|
14
|
-
values: readonly [string, string];
|
|
15
|
-
ratio: number;
|
|
16
|
-
}[];
|
|
17
|
-
} | undefined;
|
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
import type { EditorOverlayController } from '../../ui/context.js';
|
|
2
|
-
import type { NodeViewRendererProps } from '@tiptap/core';
|
|
3
|
-
import type { NodeView } from '@tiptap/pm/view';
|
|
4
|
-
import type { TiptapToMDCOptions } from '../tiptapToMdc.js';
|
|
5
|
-
import type { AuthoringKit } from '../../authoring.js';
|
|
6
|
-
export declare function componentView({ node: initial, editor, getPos }: NodeViewRendererProps, getKit: () => AuthoringKit | undefined, getOutputOptions: () => TiptapToMDCOptions, overlay?: EditorOverlayController): NodeView;
|
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
/** Small stroke icons share one geometry and inherit the host's text color. */
|
|
2
|
-
declare const paths: {
|
|
3
|
-
readonly close: "m6 6 12 12M6 18 18 6";
|
|
4
|
-
readonly imageUpload: "M14 4H4v16h16V10M4 16l5-5 5 5 2-2 4 4M16 5h6M19 2v6M8 7h.01";
|
|
5
|
-
readonly settings: string;
|
|
6
|
-
readonly rows: "M3 4h18v16H3zM3 9h18M3 15h18";
|
|
7
|
-
readonly columns: "M3 4h18v16H3zM9 4v16M15 4v16";
|
|
8
|
-
readonly plus: "M12 5v14M5 12h14";
|
|
9
|
-
readonly trash: "M3 6h18M9 6V3h6v3M5 6l1 15h12l1-15M10 10v7M14 10v7";
|
|
10
|
-
readonly copy: "M8 8h13v13H8zM16 8V3H3v13h5";
|
|
11
|
-
readonly up: "m5 12 7-7 7 7M12 5v15";
|
|
12
|
-
readonly down: "m5 12 7 7 7-7M12 19V4";
|
|
13
|
-
readonly alignLeft: "M4 5h16M4 10h10M4 15h16M4 20h10";
|
|
14
|
-
readonly alignCenter: "M4 5h16M7 10h10M4 15h16M7 20h10";
|
|
15
|
-
readonly alignRight: "M4 5h16M10 10h10M4 15h16M10 20h10";
|
|
16
|
-
readonly more: "M5 12h.01M12 12h.01M19 12h.01";
|
|
17
|
-
readonly chevron: "m6 9 6 6 6-6";
|
|
18
|
-
readonly info: "M12 8h.01M12 11v6M22 12a10 10 0 1 1-20 0 10 10 0 0 1 20 0";
|
|
19
|
-
readonly warning: "m12 3 10 18H2L12 3ZM12 9v5M12 17h.01";
|
|
20
|
-
readonly check: "m6 12 4 4 8-8M22 12a10 10 0 1 1-20 0 10 10 0 0 1 20 0";
|
|
21
|
-
readonly idea: "M9 18h6M9 22h6M8 14a6 6 0 1 1 8 0l-1 3H9l-1-3";
|
|
22
|
-
};
|
|
23
|
-
export type IconName = keyof typeof paths;
|
|
24
|
-
export declare function icon(name: IconName): SVGSVGElement;
|
|
25
|
-
export declare function iconButton(name: IconName, label: string): HTMLButtonElement;
|
|
26
|
-
export {};
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import type { NodeViewRendererProps } from '@tiptap/core';
|
|
2
|
-
import type { NodeView } from '@tiptap/pm/view';
|
|
3
|
-
import type { JsonRecord } from '../../types.js';
|
|
4
|
-
import type { EditorOverlayController } from '../../ui/context.js';
|
|
5
|
-
export type ImageActions = (props: JsonRecord) => {
|
|
6
|
-
replace?: () => void;
|
|
7
|
-
metadata?: () => void;
|
|
8
|
-
};
|
|
9
|
-
export declare function imageView({ node: initial, editor, getPos }: NodeViewRendererProps, getActions?: ImageActions, overlay?: EditorOverlayController): NodeView;
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
import type { Editor } from '@tiptap/core';
|
|
2
|
-
import type { Node as ProseMirrorNode } from '@tiptap/pm/model';
|
|
3
|
-
import type { AuthoringKit } from '../../authoring.js';
|
|
4
|
-
import type { EditorText } from '../../ui/messages.js';
|
|
5
|
-
/**
|
|
6
|
-
* Canvas controls of a container with repeated items: a tab strip for the
|
|
7
|
-
* `tabs` presentation and an add control for every presentation.
|
|
8
|
-
*/
|
|
9
|
-
export declare function containerControls(editor: Editor, getNode: () => ProseMirrorNode, getPos: () => number | undefined, getKit: () => AuthoringKit | undefined, text: EditorText, contentDOM: HTMLElement): {
|
|
10
|
-
strip: HTMLDivElement;
|
|
11
|
-
footer: HTMLDivElement;
|
|
12
|
-
render: () => void;
|
|
13
|
-
contains: (target: globalThis.Node) => boolean;
|
|
14
|
-
presentation: () => import("../../index.js").ComponentItemsPresentation | undefined;
|
|
15
|
-
};
|
|
@@ -1,45 +0,0 @@
|
|
|
1
|
-
import type { Editor } from '@tiptap/core';
|
|
2
|
-
import type { EditorOverlayController } from '../../ui/context.js';
|
|
3
|
-
/** Transaction metadata that asks node views to read external options again. */
|
|
4
|
-
export declare const nodeViewRefreshMeta = "ginkoRefreshNodeViews";
|
|
5
|
-
/** Re-render node views after host options change without a document change. */
|
|
6
|
-
export declare function refreshNodeViews(editor: Editor | undefined): void;
|
|
7
|
-
export interface NodeViewRefreshOptions {
|
|
8
|
-
editor: Editor;
|
|
9
|
-
overlay?: EditorOverlayController;
|
|
10
|
-
/** Update state that depends on the node, editability, selection, or host options. */
|
|
11
|
-
render: () => void;
|
|
12
|
-
/** Update localized labels. Runs first, and again only when the messages change. */
|
|
13
|
-
relabel?: () => void;
|
|
14
|
-
/** Also render when the document changes elsewhere. */
|
|
15
|
-
onDocumentChange?: boolean;
|
|
16
|
-
/** Also render when the selection changes. */
|
|
17
|
-
onSelectionChange?: boolean;
|
|
18
|
-
}
|
|
19
|
-
/**
|
|
20
|
-
* Render a node view at most once per editor state. ProseMirror calls a node
|
|
21
|
-
* view's `update` before TipTap emits `transaction` and `update`, so one change
|
|
22
|
-
* renders once instead of three times.
|
|
23
|
-
*/
|
|
24
|
-
export declare function observeNodeViewRefresh(options: NodeViewRefreshOptions): {
|
|
25
|
-
/** Render now if anything relevant changed. Pass true after the node changed. */
|
|
26
|
-
refresh: (force?: boolean) => void;
|
|
27
|
-
destroy(): void;
|
|
28
|
-
};
|
|
29
|
-
/**
|
|
30
|
-
* Native inputs inside node views keep the editor history. Mod-Z and
|
|
31
|
-
* Mod-Shift-Z undo or redo the document instead of the input's own history.
|
|
32
|
-
*/
|
|
33
|
-
export declare function handleHistoryKeydown(editor: Editor, event: KeyboardEvent, beforeHistory?: () => void, stopPropagation?: boolean): boolean;
|
|
34
|
-
/**
|
|
35
|
-
* Guard asynchronous node view work. A request stays current until a newer
|
|
36
|
-
* request starts or the guard is disposed.
|
|
37
|
-
*/
|
|
38
|
-
export declare function createStalenessGuard(): {
|
|
39
|
-
/** Start a request. The returned check is false after a newer request or disposal. */
|
|
40
|
-
start(): () => boolean;
|
|
41
|
-
/** Invalidate the running request without starting another. */
|
|
42
|
-
cancel(): void;
|
|
43
|
-
dispose(): void;
|
|
44
|
-
isDisposed: () => boolean;
|
|
45
|
-
};
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
import type { EditorOverlayController } from '../../ui/context.js';
|
|
2
|
-
import { type IconName } from './icons.js';
|
|
3
|
-
/** Reka owns placement and dismissal; callers retain their native form controls. */
|
|
4
|
-
export declare function inlinePopover(label: string, symbol: IconName, controller?: EditorOverlayController): {
|
|
5
|
-
dom: HTMLDivElement;
|
|
6
|
-
toggle: HTMLButtonElement;
|
|
7
|
-
panel: HTMLDivElement;
|
|
8
|
-
close: (focus?: boolean) => void;
|
|
9
|
-
position: () => void;
|
|
10
|
-
setLabel: (text: string) => void;
|
|
11
|
-
isOpen: () => boolean;
|
|
12
|
-
contains: (target: globalThis.Node) => boolean;
|
|
13
|
-
onOpenChange(listener: (open: boolean) => void): () => boolean;
|
|
14
|
-
destroy(): void;
|
|
15
|
-
};
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import type { Editor } from '@tiptap/core';
|
|
2
|
-
import type { Node } from '@tiptap/pm/model';
|
|
3
|
-
import type { AuthoringKit } from '../../authoring.js';
|
|
4
|
-
import type { TiptapToMDCOptions } from '../tiptapToMdc.js';
|
|
5
|
-
import type { EditorOverlayController } from '../../ui/context.js';
|
|
6
|
-
export declare function blockSettings(editor: Editor, getNode: () => Node, getPos: () => number | undefined, getKit: () => AuthoringKit | undefined, getOutputOptions: () => TiptapToMDCOptions, isPairedColumn: () => boolean, overlay?: EditorOverlayController): {
|
|
7
|
-
dom: HTMLDivElement;
|
|
8
|
-
render: () => void;
|
|
9
|
-
contains: (target: globalThis.Node) => boolean;
|
|
10
|
-
destroy(): void;
|
|
11
|
-
};
|
|
@@ -1,50 +0,0 @@
|
|
|
1
|
-
import type { Editor } from '@tiptap/core';
|
|
2
|
-
import { type Node } from '@tiptap/pm/model';
|
|
3
|
-
import type { EditorState } from '@tiptap/pm/state';
|
|
4
|
-
import { type Rect } from '@tiptap/pm/tables';
|
|
5
|
-
export type TableAxis = 'row' | 'column';
|
|
6
|
-
export type TableOperation = {
|
|
7
|
-
type: 'add';
|
|
8
|
-
axis: TableAxis;
|
|
9
|
-
index: number;
|
|
10
|
-
} | {
|
|
11
|
-
type: 'delete';
|
|
12
|
-
axis: TableAxis;
|
|
13
|
-
from: number;
|
|
14
|
-
to: number;
|
|
15
|
-
} | {
|
|
16
|
-
type: 'duplicate';
|
|
17
|
-
axis: TableAxis;
|
|
18
|
-
from: number;
|
|
19
|
-
to: number;
|
|
20
|
-
} | {
|
|
21
|
-
type: 'move';
|
|
22
|
-
axis: TableAxis;
|
|
23
|
-
from: number;
|
|
24
|
-
to: number;
|
|
25
|
-
direction: -1 | 1;
|
|
26
|
-
} | {
|
|
27
|
-
type: 'header';
|
|
28
|
-
row: number;
|
|
29
|
-
} | {
|
|
30
|
-
type: 'align';
|
|
31
|
-
from: number;
|
|
32
|
-
to: number;
|
|
33
|
-
value: 'left' | 'center' | 'right';
|
|
34
|
-
};
|
|
35
|
-
/** These controls operate on the same rectangular, first-row-header table that Markdown can store. */
|
|
36
|
-
export declare function portableTable(table: Node): {
|
|
37
|
-
rows: Node[];
|
|
38
|
-
width: number;
|
|
39
|
-
height: number;
|
|
40
|
-
} | undefined;
|
|
41
|
-
export declare function selectedTableRect(state: EditorState, tablePos: number): Rect | undefined;
|
|
42
|
-
export declare function canChangeTable(table: Node, operation: TableOperation): boolean;
|
|
43
|
-
export declare function canApplyTableOperation(editor: Editor, table: Node, operation: TableOperation): boolean;
|
|
44
|
-
/** A structural operation preserves existing node content, marks and cell attributes. */
|
|
45
|
-
export declare function changeTable(table: Node, operation: TableOperation): {
|
|
46
|
-
table: Node;
|
|
47
|
-
selection: Rect;
|
|
48
|
-
} | undefined;
|
|
49
|
-
export declare function selectTableRect(editor: Editor, tablePos: number, rect: Rect): boolean;
|
|
50
|
-
export declare function applyTableOperation(editor: Editor, tablePos: number, operation: TableOperation): boolean;
|
|
@@ -1,4 +0,0 @@
|
|
|
1
|
-
import type { NodeViewRendererProps } from '@tiptap/core';
|
|
2
|
-
import type { NodeView } from '@tiptap/pm/view';
|
|
3
|
-
import type { EditorOverlayController } from '../../ui/context.js';
|
|
4
|
-
export declare function tableView({ node: initial, editor, getPos }: NodeViewRendererProps, controller?: EditorOverlayController): NodeView;
|
package/dist/lib/profiles.d.ts
DELETED
|
@@ -1,62 +0,0 @@
|
|
|
1
|
-
import type { JSONContent } from '@tiptap/core';
|
|
2
|
-
import { Fragment, Slice, type Node as ProseMirrorNode, type Schema } from '@tiptap/pm/model';
|
|
3
|
-
/**
|
|
4
|
-
* A content profile limits what a writer can create. `full` keeps every
|
|
5
|
-
* supported block and component. The other profiles are closed sets:
|
|
6
|
-
*
|
|
7
|
-
* - `plain`: paragraphs and line breaks, no formatting.
|
|
8
|
-
* - `inline`: `plain` plus bold, italic, and links.
|
|
9
|
-
* - `article`: `inline` plus headings 2–4, lists, quotes, dividers, and images.
|
|
10
|
-
*/
|
|
11
|
-
export type EditorProfileName = 'plain' | 'inline' | 'article' | 'full';
|
|
12
|
-
export interface EditorProfile {
|
|
13
|
-
readonly name: EditorProfileName;
|
|
14
|
-
/** Allowed node type names. `undefined` allows every node. */
|
|
15
|
-
readonly nodes?: ReadonlySet<string>;
|
|
16
|
-
/** Allowed mark type names. `undefined` allows every mark. */
|
|
17
|
-
readonly marks?: ReadonlySet<string>;
|
|
18
|
-
/** Allowed heading levels. Empty when headings are not allowed. */
|
|
19
|
-
readonly headingLevels: readonly number[];
|
|
20
|
-
}
|
|
21
|
-
/**
|
|
22
|
-
* Set this transaction meta when trusted content is loaded, for example a
|
|
23
|
-
* document from the host or steps from a collaboration server. The profile
|
|
24
|
-
* guard does not check such a transaction.
|
|
25
|
-
*/
|
|
26
|
-
export declare const profileExemptMeta = "ginkoProfileExempt";
|
|
27
|
-
export declare const editorProfiles: Readonly<Record<EditorProfileName, EditorProfile>>;
|
|
28
|
-
export declare function resolveEditorProfile(profile: EditorProfileName | EditorProfile | undefined): EditorProfile;
|
|
29
|
-
export declare function isRestrictedProfile(profile: EditorProfile): boolean;
|
|
30
|
-
export declare function profileAllowsNode(profile: EditorProfile, name: string, attrs?: Record<string, unknown>): boolean;
|
|
31
|
-
export declare function profileAllowsMark(profile: EditorProfile, name: string): boolean;
|
|
32
|
-
/** Whether the profile allows any block other than paragraphs. */
|
|
33
|
-
export declare function profileAllowsBlocks(profile: EditorProfile): boolean;
|
|
34
|
-
/**
|
|
35
|
-
* TipTap extension names whose input and paste rules stay active. `true`
|
|
36
|
-
* keeps every rule. Rules of other extensions would create content that the
|
|
37
|
-
* profile rejects, so they are not registered.
|
|
38
|
-
*/
|
|
39
|
-
export declare function profileRuleExtensions(profile: EditorProfile): true | string[];
|
|
40
|
-
export interface EditorProfileViolation {
|
|
41
|
-
kind: 'node' | 'mark';
|
|
42
|
-
type: string;
|
|
43
|
-
/** The heading level for a heading outside the allowed levels. */
|
|
44
|
-
level?: number;
|
|
45
|
-
}
|
|
46
|
-
/**
|
|
47
|
-
* List every node and mark in a document that the profile does not allow.
|
|
48
|
-
* Accepts a ProseMirror node or TipTap JSON, so servers can check stored
|
|
49
|
-
* documents without an editor.
|
|
50
|
-
*/
|
|
51
|
-
export declare function findProfileViolations(doc: ProseMirrorNode | JSONContent, profile: EditorProfileName | EditorProfile): EditorProfileViolation[];
|
|
52
|
-
/** The number of violations. A transaction may never raise it. */
|
|
53
|
-
export declare function countProfileViolations(doc: ProseMirrorNode, profile: EditorProfile): number;
|
|
54
|
-
/**
|
|
55
|
-
* Reduce pasted or inserted content to what the profile allows. Text is never
|
|
56
|
-
* dropped: disallowed blocks become paragraphs, containers such as lists and
|
|
57
|
-
* tables are unwrapped, and disallowed marks are removed. Media and other
|
|
58
|
-
* atoms that the profile does not allow are removed.
|
|
59
|
-
*/
|
|
60
|
-
export declare function sanitizeFragment(fragment: Fragment, schema: Schema, profile: EditorProfile): Fragment;
|
|
61
|
-
/** Sanitize a clipboard slice and keep it as open as its new structure allows. */
|
|
62
|
-
export declare function sanitizeSlice(slice: Slice, schema: Schema, profile: EditorProfile): Slice;
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import type { Editor } from '@tiptap/core';
|
|
2
|
-
import type { JsonValue } from '../types.js';
|
|
3
|
-
/** Property controls live outside ProseMirror's editable DOM. Reuse its input
|
|
4
|
-
* grouping metadata with negative IDs, separate from native composition IDs.
|
|
5
|
-
* Empty position maps must stay empty so remote edits do not lose their target.
|
|
6
|
-
*/
|
|
7
|
-
export declare function createPropertyInput(editor: Editor, target?: 'props' | 'attrs'): {
|
|
8
|
-
reset(): void;
|
|
9
|
-
transaction(pos: number, key: string, value: JsonValue | undefined): import("@tiptap/pm/state").Transaction;
|
|
10
|
-
};
|
|
@@ -1,77 +0,0 @@
|
|
|
1
|
-
import { type Node, type Schema } from '@tiptap/pm/model';
|
|
2
|
-
import { Step, StepMap, StepResult, type Mappable } from '@tiptap/pm/transform';
|
|
3
|
-
import type { JsonValue } from '../types.js';
|
|
4
|
-
/** Change one property while keeping other properties from the current document.
|
|
5
|
-
* Whole props-object replacement loses independent edits when steps are rebased.
|
|
6
|
-
*/
|
|
7
|
-
export declare class SetNodePropertyStep extends Step {
|
|
8
|
-
readonly pos: number;
|
|
9
|
-
readonly key: string;
|
|
10
|
-
readonly value: JsonValue | undefined;
|
|
11
|
-
constructor(pos: number, key: string, value: JsonValue | undefined);
|
|
12
|
-
apply(doc: Node): StepResult;
|
|
13
|
-
getMap(): StepMap;
|
|
14
|
-
invert(doc: Node): SetNodePropertyStep;
|
|
15
|
-
map(mapping: Mappable): SetNodePropertyStep | null;
|
|
16
|
-
merge(other: Step): SetNodePropertyStep | null;
|
|
17
|
-
toJSON(): {
|
|
18
|
-
remove: boolean;
|
|
19
|
-
stepType: string;
|
|
20
|
-
pos: number;
|
|
21
|
-
key: string;
|
|
22
|
-
} | {
|
|
23
|
-
value: JsonValue;
|
|
24
|
-
stepType: string;
|
|
25
|
-
pos: number;
|
|
26
|
-
key: string;
|
|
27
|
-
};
|
|
28
|
-
static fromJSON(_schema: Schema, json: unknown): SetNodePropertyStep;
|
|
29
|
-
}
|
|
30
|
-
/** Tag and parser source metadata are one change, including when rebased. */
|
|
31
|
-
export declare class SetComponentVariantStep extends Step {
|
|
32
|
-
readonly pos: number;
|
|
33
|
-
readonly tag: string;
|
|
34
|
-
readonly syntax: JsonValue | undefined;
|
|
35
|
-
constructor(pos: number, tag: string, syntax: JsonValue | undefined);
|
|
36
|
-
apply(doc: Node): StepResult;
|
|
37
|
-
getMap(): StepMap;
|
|
38
|
-
invert(doc: Node): SetComponentVariantStep;
|
|
39
|
-
map(mapping: Mappable): SetComponentVariantStep | null;
|
|
40
|
-
/** A later variant choice for the same component replaces the earlier one. */
|
|
41
|
-
merge(other: Step): SetComponentVariantStep | null;
|
|
42
|
-
toJSON(): {
|
|
43
|
-
removeSyntax: boolean;
|
|
44
|
-
stepType: string;
|
|
45
|
-
pos: number;
|
|
46
|
-
tag: string;
|
|
47
|
-
} | {
|
|
48
|
-
syntax: JsonValue;
|
|
49
|
-
stepType: string;
|
|
50
|
-
pos: number;
|
|
51
|
-
tag: string;
|
|
52
|
-
};
|
|
53
|
-
static fromJSON(_schema: Schema, json: unknown): SetComponentVariantStep;
|
|
54
|
-
}
|
|
55
|
-
/** Native AttrStep drops edits after insertion immediately before the node.
|
|
56
|
-
* This field step uses the same surviving-position rule as property changes.
|
|
57
|
-
*/
|
|
58
|
-
export declare class SetNodeAttributeStep extends Step {
|
|
59
|
-
readonly pos: number;
|
|
60
|
-
readonly key: string;
|
|
61
|
-
readonly value: JsonValue;
|
|
62
|
-
constructor(pos: number, key: string, value: JsonValue);
|
|
63
|
-
apply(doc: Node): StepResult;
|
|
64
|
-
getMap(): StepMap;
|
|
65
|
-
invert(doc: Node): SetNodeAttributeStep;
|
|
66
|
-
map(mapping: Mappable): SetNodeAttributeStep | null;
|
|
67
|
-
merge(other: Step): SetNodeAttributeStep | null;
|
|
68
|
-
toJSON(): {
|
|
69
|
-
stepType: string;
|
|
70
|
-
pos: number;
|
|
71
|
-
key: string;
|
|
72
|
-
value: JsonValue;
|
|
73
|
-
};
|
|
74
|
-
static fromJSON(_schema: Schema, json: unknown): SetNodeAttributeStep;
|
|
75
|
-
}
|
|
76
|
-
/** Both browser and backend schema creation install the same wire step. */
|
|
77
|
-
export declare function registerPropertyStep(): void;
|
package/dist/lib/props.d.ts
DELETED
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import type { JsonRecord, JsonValue } from '../types.js';
|
|
2
|
-
export declare function isValidAttr(value?: null | string): boolean;
|
|
3
|
-
export declare function sanitizeAssetUrl(url: string): null | string;
|
|
4
|
-
export declare function sanitizeImageUrl(url: string): null | string;
|
|
5
|
-
export declare function sanitizeResolvedAssetUrl(url: string): null | string;
|
|
6
|
-
/** Browser-only display URLs returned by an explicit host asset provider. */
|
|
7
|
-
export declare function sanitizeResolvedImageUrl(url: string): null | string;
|
|
8
|
-
/** Preserve canonical media metadata across native rich-text clipboard HTML. */
|
|
9
|
-
export declare function readStoredMediaProps(element: {
|
|
10
|
-
getAttribute: (name: string) => string | null;
|
|
11
|
-
}): JsonRecord | undefined;
|
|
12
|
-
export declare function cleanSpanProps(attrs?: Record<string, unknown> | null): Record<string, string>;
|
|
13
|
-
export declare function normalizeProps(nodeProps: Record<string, unknown>, extraProps: object): Array<[string, JsonValue]>;
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
import type { JSONContent } from '@tiptap/core';
|
|
2
|
-
import type { JsonValue } from '../types.js';
|
|
3
|
-
import type { MDCElement, MDCNode, MDCRoot } from './mdcTypes.js';
|
|
4
|
-
export interface TiptapToMDCOptions {
|
|
5
|
-
fileOutput?: 'markdown' | 'mdc';
|
|
6
|
-
imageOutput?: 'markdown' | 'mdc';
|
|
7
|
-
videoOutput?: 'html' | 'mdc';
|
|
8
|
-
}
|
|
9
|
-
interface TiptapToMDCContext {
|
|
10
|
-
options: TiptapToMDCOptions;
|
|
11
|
-
}
|
|
12
|
-
export declare function tiptapNodeToMDC(node: JSONContent, context: TiptapToMDCContext): MDCNode | MDCNode[] | MDCRoot;
|
|
13
|
-
/**
|
|
14
|
-
* Convert TipTap JSON to MDC AST (without frontmatter)
|
|
15
|
-
*/
|
|
16
|
-
export declare function tiptapToMDC(node: JSONContent, options?: TiptapToMDCOptions): Promise<MDCRoot>;
|
|
17
|
-
export declare function createParagraphElement(node: JSONContent, context: TiptapToMDCContext, propsArray: Array<[string, JsonValue]>, rest?: object): MDCElement;
|
|
18
|
-
export {};
|