@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
|
@@ -1,38 +0,0 @@
|
|
|
1
|
-
import type { ImageUploadHandler, ImagePicker, EditorImage, LegacyImageUploadResult } from '../../types.js';
|
|
2
|
-
import { type EditorMessages } from '../../ui/messages.js';
|
|
3
|
-
import type { EditorOverlayController } from '../../ui/context.js';
|
|
4
|
-
import type { ImageActions } from '../nodeviews/image.js';
|
|
5
|
-
import type { AssetProvider } from '../../types.js';
|
|
6
|
-
import type { AuthoringKit } from '../../authoring.js';
|
|
7
|
-
import type { TiptapToMDCOptions } from '../tiptapToMdc.js';
|
|
8
|
-
import { type EditorProfile } from '../profiles.js';
|
|
9
|
-
export interface CreateEditorExtensionsOptions {
|
|
10
|
-
overlay?: EditorOverlayController;
|
|
11
|
-
getMessages?: () => EditorMessages | undefined;
|
|
12
|
-
getImagePicker?: () => ImagePicker | undefined;
|
|
13
|
-
getImageDropTarget?: () => HTMLElement | undefined;
|
|
14
|
-
getImageUpload?: () => ImageUploadHandler | undefined;
|
|
15
|
-
/** The largest accepted image upload, in bytes. */
|
|
16
|
-
getImageMaxBytes?: () => number;
|
|
17
|
-
canUploadImage?: () => boolean;
|
|
18
|
-
insertUploadedImage?: (asset: EditorImage | LegacyImageUploadResult, pos: number, replaceSize?: number) => boolean;
|
|
19
|
-
onImageUploadPending?: (count: number) => void;
|
|
20
|
-
imageActions?: ImageActions;
|
|
21
|
-
assetProvider?: AssetProvider;
|
|
22
|
-
/** Initial value of the code block extension storage. */
|
|
23
|
-
codeBlockTheme?: string;
|
|
24
|
-
getAuthoringKit?: () => AuthoringKit | undefined;
|
|
25
|
-
getOutputOptions?: () => TiptapToMDCOptions;
|
|
26
|
-
canPaste?: () => boolean;
|
|
27
|
-
onCopyError?: (message: string | undefined) => void;
|
|
28
|
-
onPasteError?: (message: string | undefined) => void;
|
|
29
|
-
/** Read on each placeholder render, so the text can change without a new editor. */
|
|
30
|
-
getPlaceholder?: () => string | undefined;
|
|
31
|
-
/** Initial value of the heading extension storage. */
|
|
32
|
-
showMarkdownMarkers?: boolean;
|
|
33
|
-
/** The content profile. Fixed for the lifetime of the editor. */
|
|
34
|
-
profile?: EditorProfile;
|
|
35
|
-
}
|
|
36
|
-
export declare function createEditorExtensions(options?: CreateEditorExtensionsOptions): (import("@tiptap/core").Node<import("../extensions/code-block.js").CodeBlockOptions, any> | import("@tiptap/core").Node<import("../extensions/element.js").ElementOptions, any> | import("@tiptap/core").Node<import("../extensions/file.js").FileOptions, any> | import("@tiptap/core").Node<import("../extensions/heading.js").HeadingOptions, any> | import("@tiptap/core").Node<import("../extensions/image.js").ImageOptions, any> | import("@tiptap/core").Node<import("../extensions/inline-element.js").InlineElementOptions, any> | import("@tiptap/core").Node<import("../extensions/slot.js").SlotOptions, any> | import("@tiptap/core").Node<import("../extensions/span-style.js").SpanStyleAttrs, any> | import("@tiptap/core").Node<any, any> | import("@tiptap/core").Extension<import("@tiptap/starter-kit").StarterKitOptions, any> | import("@tiptap/core").Node<import("@tiptap/extension-table").TableOptions, any> | import("@tiptap/core").Node<import("@tiptap/extension-table").TableRowOptions, any> | import("@tiptap/core").Extension<any, any> | import("@tiptap/core").Extension<import("../extensions/image-upload.js").UploadOptions, import("../extensions/image-upload.js").UploadStorage> | import("@tiptap/core").Extension<import("../extensions/container-items.js").ContainerItemsOptions, any> | import("@tiptap/core").Extension<import("../extensions/markdown-clipboard.js").MarkdownClipboardOptions, any> | import("@tiptap/core").Extension<{
|
|
37
|
-
profile: EditorProfile;
|
|
38
|
-
}, any> | import("@tiptap/core").Extension<import("@tiptap/extension-placeholder").PlaceholderOptions, any>)[];
|
|
@@ -1,55 +0,0 @@
|
|
|
1
|
-
import type { Editor } from '@tiptap/core';
|
|
2
|
-
import { type Node as ProseMirrorNode } from '@tiptap/pm/model';
|
|
3
|
-
import type { AuthoringKit, ComponentCanvasItems } from '../authoring.js';
|
|
4
|
-
import { type BlockOperationResult, type EditorOperationContext } from './editor-operations.js';
|
|
5
|
-
/** One repeated item of a container. Positions are absolute in `doc`. */
|
|
6
|
-
export interface ContainerItem {
|
|
7
|
-
index: number;
|
|
8
|
-
/** Position before the first node of the item. */
|
|
9
|
-
from: number;
|
|
10
|
-
/** Position after the last node of the item. */
|
|
11
|
-
to: number;
|
|
12
|
-
/** The first node: the child component, the code block, or the heading. */
|
|
13
|
-
node: ProseMirrorNode;
|
|
14
|
-
/** Every top-level node of the item, with its absolute position. */
|
|
15
|
-
nodes: readonly {
|
|
16
|
-
node: ProseMirrorNode;
|
|
17
|
-
pos: number;
|
|
18
|
-
}[];
|
|
19
|
-
}
|
|
20
|
-
export interface ContainerLayout {
|
|
21
|
-
pos: number;
|
|
22
|
-
node: ProseMirrorNode;
|
|
23
|
-
config: ComponentCanvasItems;
|
|
24
|
-
/** Start and end of the container's editable content. */
|
|
25
|
-
contentFrom: number;
|
|
26
|
-
contentTo: number;
|
|
27
|
-
items: readonly ContainerItem[];
|
|
28
|
-
}
|
|
29
|
-
export declare function itemsConfig(kit: AuthoringKit | undefined, tag: unknown): ComponentCanvasItems | undefined;
|
|
30
|
-
/** Read the items of a container, including the parser's explicit default-slot form. */
|
|
31
|
-
export declare function containerLayout(doc: ProseMirrorNode, pos: number, kit: AuthoringKit | undefined): ContainerLayout | undefined;
|
|
32
|
-
/** The nearest container whose item contains `pos`. */
|
|
33
|
-
export declare function containerAt(doc: ProseMirrorNode, pos: number, kit: AuthoringKit | undefined): {
|
|
34
|
-
layout: ContainerLayout;
|
|
35
|
-
item: ContainerItem;
|
|
36
|
-
} | undefined;
|
|
37
|
-
/** The visible name of an item. Empty when the item has no name. */
|
|
38
|
-
export declare function itemLabel(item: ContainerItem, config: ComponentCanvasItems): string;
|
|
39
|
-
/** True when removing the item would discard text or embedded content. */
|
|
40
|
-
export declare function itemHasContent(item: ContainerItem): boolean;
|
|
41
|
-
export interface AddItemOptions {
|
|
42
|
-
/** Insert after this item. Omit to add the item at the end. */
|
|
43
|
-
after?: number;
|
|
44
|
-
/** Delete this range in the same change, for example typed slash text. */
|
|
45
|
-
replaceRange?: {
|
|
46
|
-
from: number;
|
|
47
|
-
to: number;
|
|
48
|
-
};
|
|
49
|
-
}
|
|
50
|
-
/** Add one item from the container's template as one validated, undoable change. */
|
|
51
|
-
export declare function addContainerItem(editor: Editor, containerPos: number, options?: AddItemOptions, operation?: EditorOperationContext): Promise<BlockOperationResult>;
|
|
52
|
-
/** Remove one item. A container always keeps at least one item. */
|
|
53
|
-
export declare function removeContainerItem(editor: Editor, containerPos: number, index: number, operation?: EditorOperationContext): Promise<BlockOperationResult>;
|
|
54
|
-
/** Change the name of one item as one validated, undoable change. */
|
|
55
|
-
export declare function renameContainerItem(editor: Editor, containerPos: number, index: number, value: string, operation?: EditorOperationContext): Promise<BlockOperationResult>;
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import type { ConversionIssue, ConversionPhase, ConversionTraceEvent } from './conversionTypes.js';
|
|
2
|
-
interface ConversionTraceHandle {
|
|
3
|
-
traceId: string;
|
|
4
|
-
timeline: ConversionTraceEvent[];
|
|
5
|
-
}
|
|
6
|
-
export declare function startTrace(data?: Record<string, unknown>): ConversionTraceHandle;
|
|
7
|
-
export declare function logPhase(trace: ConversionTraceHandle, phase: ConversionPhase, data?: Record<string, unknown>): void;
|
|
8
|
-
export declare function logIssue(trace: ConversionTraceHandle, issue: ConversionIssue): void;
|
|
9
|
-
export declare function finishTrace(trace: ConversionTraceHandle, data?: Record<string, unknown>): ConversionTraceEvent[];
|
|
10
|
-
export {};
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
import type { Editor } from '@tiptap/core';
|
|
2
|
-
import type { Schema } from '@tiptap/pm/model';
|
|
3
|
-
import type { JSONContent } from '@tiptap/core';
|
|
4
|
-
import type { AuthoringKit } from '../authoring.js';
|
|
5
|
-
import type { ConversionIssue, ConversionResult } from './conversionTypes.js';
|
|
6
|
-
import type { TiptapToMDCOptions } from './tiptapToMdc.js';
|
|
7
|
-
export type { ConversionErrorPayload, ConversionHealthState, ConversionIssue, ConversionIssueCode, ConversionPhase, ConversionRecoveredPayload, ConversionResult, ConversionSeverity, ConversionTraceEvent, } from './conversionTypes.js';
|
|
8
|
-
export declare function validateMarkdownForAuthoring(markdown: string, authoringKit: Pick<AuthoringKit, 'policy'>): Promise<ConversionIssue | undefined>;
|
|
9
|
-
export declare function convertMarkdownToTiptapDoc(markdown: string): Promise<ConversionResult<JSONContent>>;
|
|
10
|
-
/**
|
|
11
|
-
* Checks that visual editing can represent a document before TipTap owns it.
|
|
12
|
-
* Raw markdown remains canonical: a document that would lose meaning stays in
|
|
13
|
-
* source mode instead of being silently normalized into a smaller document.
|
|
14
|
-
*/
|
|
15
|
-
export declare function prepareMarkdownForVisualEditing(markdown: string, options?: TiptapToMDCOptions, schema?: Schema, authoringKit?: Pick<AuthoringKit, 'policy'>, context?: 'document' | 'fragment'): Promise<ConversionResult<JSONContent>>;
|
|
16
|
-
export declare function convertTiptapDocToMarkdown(doc: JSONContent, options?: TiptapToMDCOptions): Promise<ConversionResult<string>>;
|
|
17
|
-
export declare function applyTiptapDocToEditor(editor: Editor, doc: JSONContent): ConversionResult<JSONContent>;
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import type { ConversionErrorPayload, ConversionHealthState, ConversionIssue, ConversionIssueCode, ConversionPhase, ConversionRecoveredPayload, ConversionResult } from './conversionTypes.js';
|
|
2
|
-
export declare function selectPrimaryIssue(issues: ConversionIssue[]): ConversionIssue | undefined;
|
|
3
|
-
export declare function getHealthStatusFromIssues(issues: ConversionIssue[]): ConversionHealthState['status'];
|
|
4
|
-
export declare function maybeBuildRecoveryPayload(previousStatus: ConversionHealthState['status'], nextStatus: ConversionHealthState['status'], traceId: string): ConversionRecoveredPayload | null;
|
|
5
|
-
export declare function toConversionErrorPayload(result: ConversionResult<unknown>, options: {
|
|
6
|
-
fallbackCode?: ConversionIssueCode;
|
|
7
|
-
fallbackMessage: string;
|
|
8
|
-
fallbackPhase: ConversionPhase;
|
|
9
|
-
recoverable?: boolean;
|
|
10
|
-
}): ConversionErrorPayload;
|
|
@@ -1,50 +0,0 @@
|
|
|
1
|
-
import type { JSONContent } from '@tiptap/core';
|
|
2
|
-
export type ConversionPhase = 'parse_mdc' | 'mdc_to_tiptap' | 'tiptap_to_mdc' | 'stringify_mdc' | 'set_content' | 'validate';
|
|
3
|
-
export type ConversionSeverity = 'error' | 'warn';
|
|
4
|
-
/** Every issue code that the conversion pipeline and editor validation can report. */
|
|
5
|
-
export type ConversionIssueCode = 'authoring_kit_rejected' | 'block_inside_paragraph' | 'conversion_failed' | 'empty_doc' | 'inline_node_at_root' | 'invalid_doc_root_type' | 'invalid_doc_shape' | 'invalid_node_shape' | 'invalid_text_node' | 'list_item_empty' | 'list_item_first_child_not_paragraph' | 'mdc_to_tiptap_failed' | 'missing_doc_content' | 'missing_node_type' | 'parse_mdc_failed' | 'set_content_failed' | 'source_only_required' | 'stringify_mdc_failed' | 'text_node_has_children' | 'tiptap_to_mdc_failed' | 'unknown_mark_type' | 'unknown_node_type' | 'visual_compatibility_failed' | 'visual_schema_unsupported';
|
|
6
|
-
export interface ConversionIssue {
|
|
7
|
-
code: ConversionIssueCode;
|
|
8
|
-
severity: ConversionSeverity;
|
|
9
|
-
phase: ConversionPhase;
|
|
10
|
-
message: string;
|
|
11
|
-
detail?: unknown;
|
|
12
|
-
context?: Record<string, unknown>;
|
|
13
|
-
}
|
|
14
|
-
export interface ConversionTraceEvent {
|
|
15
|
-
at: string;
|
|
16
|
-
kind: 'finish' | 'issue' | 'phase' | 'start';
|
|
17
|
-
phase?: ConversionPhase;
|
|
18
|
-
data?: Record<string, unknown>;
|
|
19
|
-
issueCode?: ConversionIssueCode;
|
|
20
|
-
message?: string;
|
|
21
|
-
severity?: ConversionSeverity;
|
|
22
|
-
}
|
|
23
|
-
export interface ConversionResult<T> {
|
|
24
|
-
ok: boolean;
|
|
25
|
-
value?: T;
|
|
26
|
-
issues: ConversionIssue[];
|
|
27
|
-
traceId: string;
|
|
28
|
-
timeline: ConversionTraceEvent[];
|
|
29
|
-
fallbackUsed: boolean;
|
|
30
|
-
}
|
|
31
|
-
export interface ConversionHealthState {
|
|
32
|
-
status: 'degraded' | 'failed' | 'ok';
|
|
33
|
-
lastGoodMarkdown: string;
|
|
34
|
-
lastGoodDoc: JSONContent | null;
|
|
35
|
-
lastError?: ConversionIssue;
|
|
36
|
-
}
|
|
37
|
-
export interface ConversionErrorPayload {
|
|
38
|
-
traceId: string;
|
|
39
|
-
phase: ConversionPhase;
|
|
40
|
-
code: ConversionIssueCode;
|
|
41
|
-
message: string;
|
|
42
|
-
recoverable: boolean;
|
|
43
|
-
issues: ConversionIssue[];
|
|
44
|
-
timeline: ConversionTraceEvent[];
|
|
45
|
-
}
|
|
46
|
-
export interface ConversionRecoveredPayload {
|
|
47
|
-
traceId: string;
|
|
48
|
-
fromStatus: ConversionHealthState['status'];
|
|
49
|
-
toStatus: ConversionHealthState['status'];
|
|
50
|
-
}
|
|
@@ -1,39 +0,0 @@
|
|
|
1
|
-
import type { Editor } from '@tiptap/core';
|
|
2
|
-
import { type Node as ProseMirrorNode } from '@tiptap/pm/model';
|
|
3
|
-
import { type Transaction } from '@tiptap/pm/state';
|
|
4
|
-
import type { AuthoringKit } from '../authoring.js';
|
|
5
|
-
import type { TiptapToMDCOptions } from './tiptapToMdc.js';
|
|
6
|
-
/** A position belongs to this exact document, never to a later document at the same offset. */
|
|
7
|
-
export interface BlockReference {
|
|
8
|
-
readonly doc: ProseMirrorNode;
|
|
9
|
-
readonly node: ProseMirrorNode;
|
|
10
|
-
readonly pos: number;
|
|
11
|
-
}
|
|
12
|
-
export interface EditorOperationContext {
|
|
13
|
-
getAuthoringKit?: () => AuthoringKit | undefined;
|
|
14
|
-
getOutputOptions?: () => TiptapToMDCOptions;
|
|
15
|
-
canMutate?: () => boolean;
|
|
16
|
-
}
|
|
17
|
-
export type BlockAction = 'duplicate' | 'delete';
|
|
18
|
-
export type BlockOperationResult = {
|
|
19
|
-
ok: true;
|
|
20
|
-
} | {
|
|
21
|
-
ok: false;
|
|
22
|
-
reason: 'unavailable' | 'stale' | 'invalid-content';
|
|
23
|
-
};
|
|
24
|
-
export declare function captureBlock(editor: Editor, pos: number): BlockReference | undefined;
|
|
25
|
-
/** Resolve a paragraph or whole selected block, skipping schema-only wrappers. */
|
|
26
|
-
export declare function selectedBlock(editor: Editor): BlockReference | undefined;
|
|
27
|
-
export declare function parentBlock(editor: Editor, block: BlockReference): BlockReference | undefined;
|
|
28
|
-
export declare function selectParentBlock(editor: Editor, block?: BlockReference | undefined): boolean;
|
|
29
|
-
/** Synchronous structural availability. Execution additionally validates Content policy. */
|
|
30
|
-
export declare function canPerformBlockAction(editor: Editor, block: BlockReference, action: BlockAction, context?: EditorOperationContext): boolean;
|
|
31
|
-
/** Observe every accepted editor operation, including node-view and recipe edits. */
|
|
32
|
-
export declare function observeEditorOperations(editor: Editor, observer: (count: number) => void): () => void;
|
|
33
|
-
/** Hosts flush accepted edits before saving, even when validation is asynchronous. */
|
|
34
|
-
export declare function waitForEditorOperations(editor: Editor): Promise<void>;
|
|
35
|
-
/** Register before preparation begins, so an immediate save includes the whole edit. */
|
|
36
|
-
export declare function trackEditorOperation<T>(editor: Editor, run: () => Promise<T>): Promise<T>;
|
|
37
|
-
export declare function performBlockAction(editor: Editor, block: BlockReference, action: BlockAction, context?: EditorOperationContext): Promise<BlockOperationResult>;
|
|
38
|
-
/** Commit an already-built structural transaction through the same policy and history boundary. */
|
|
39
|
-
export declare function commitEditorTransaction(editor: Editor, transaction: Transaction, context?: EditorOperationContext): Promise<BlockOperationResult>;
|
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Development checks follow Vue's convention. Consumer bundlers replace
|
|
3
|
-
* `process.env.NODE_ENV`, so production builds remove the guarded code. Without
|
|
4
|
-
* a bundler, the missing `process` global disables the check.
|
|
5
|
-
*/
|
|
6
|
-
export declare function isDevelopment(): boolean;
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
import type { EditorOverlayController } from '../../ui/context.js';
|
|
2
|
-
export interface CodeBlockOptions {
|
|
3
|
-
overlay?: EditorOverlayController;
|
|
4
|
-
theme: string;
|
|
5
|
-
}
|
|
6
|
-
declare module '@tiptap/core' {
|
|
7
|
-
interface Commands<ReturnType> {
|
|
8
|
-
codeBlock: {
|
|
9
|
-
setCodeBlock: (attributes?: {
|
|
10
|
-
language: string;
|
|
11
|
-
}) => ReturnType;
|
|
12
|
-
toggleCodeBlock: (attributes?: {
|
|
13
|
-
language: string;
|
|
14
|
-
}) => ReturnType;
|
|
15
|
-
};
|
|
16
|
-
}
|
|
17
|
-
}
|
|
18
|
-
export declare const CodeBlock: import("@tiptap/core").Node<CodeBlockOptions, any>;
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import { Extension } from '@tiptap/core';
|
|
2
|
-
import { type EditorState } from '@tiptap/pm/state';
|
|
3
|
-
/** True when an empty caret is at the first or last text position of a component. */
|
|
4
|
-
export declare function isAtComponentBoundary(state: EditorState, direction: 'end' | 'start'): boolean;
|
|
5
|
-
/**
|
|
6
|
-
* Backspace at a component start and Delete at its end must not join the
|
|
7
|
-
* component with its neighbor. Joining would merge two component identities.
|
|
8
|
-
*/
|
|
9
|
-
export declare const ComponentBoundary: Extension<any, any>;
|
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
import { Extension } from '@tiptap/core';
|
|
2
|
-
import { PluginKey, type EditorState, type Transaction } from '@tiptap/pm/state';
|
|
3
|
-
import { DecorationSet } from '@tiptap/pm/view';
|
|
4
|
-
import type { AuthoringKit } from '../../authoring.js';
|
|
5
|
-
import { type ContainerLayout } from '../container-items.js';
|
|
6
|
-
/**
|
|
7
|
-
* View state of container items. It belongs to one editor view: the selected
|
|
8
|
-
* tab and collapsed accordion items are never part of the document, history,
|
|
9
|
-
* or collaboration steps.
|
|
10
|
-
*/
|
|
11
|
-
export interface ContainerItemsState {
|
|
12
|
-
/** Container position to the start position of its selected item. */
|
|
13
|
-
active: ReadonlyMap<number, number>;
|
|
14
|
-
/** Start positions of collapsed items. */
|
|
15
|
-
collapsed: ReadonlySet<number>;
|
|
16
|
-
decorations: DecorationSet;
|
|
17
|
-
}
|
|
18
|
-
export declare const containerItemsKey: PluginKey<ContainerItemsState>;
|
|
19
|
-
/** Select one item of a container. The change is view state only. */
|
|
20
|
-
export declare function selectContainerItem(tr: Transaction, container: number, item: number): Transaction;
|
|
21
|
-
/** Collapse or expand one item in this editor view. */
|
|
22
|
-
export declare function toggleContainerItem(tr: Transaction, item: number): Transaction;
|
|
23
|
-
/** The selected item index of a container, in this view. */
|
|
24
|
-
export declare function activeItemIndex(state: EditorState, layout: ContainerLayout): number;
|
|
25
|
-
export declare function isItemCollapsed(state: EditorState, pos: number): boolean;
|
|
26
|
-
export interface ContainerItemsOptions {
|
|
27
|
-
getAuthoringKit?: () => AuthoringKit | undefined;
|
|
28
|
-
}
|
|
29
|
-
export declare const ContainerItems: Extension<ContainerItemsOptions, any>;
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
import { Node } from '@tiptap/core';
|
|
2
|
-
import type { TiptapToMDCOptions } from '../tiptapToMdc.js';
|
|
3
|
-
import type { AuthoringKit } from '../../authoring.js';
|
|
4
|
-
import type { JsonRecord } from '../../types.js';
|
|
5
|
-
import type { EditorOverlayController } from '../../ui/context.js';
|
|
6
|
-
export interface ElementOptions {
|
|
7
|
-
overlay?: EditorOverlayController;
|
|
8
|
-
getOutputOptions?: () => TiptapToMDCOptions;
|
|
9
|
-
getAuthoringKit?: () => AuthoringKit | undefined;
|
|
10
|
-
HTMLAttributes: JsonRecord;
|
|
11
|
-
}
|
|
12
|
-
declare module '@tiptap/core' {
|
|
13
|
-
interface Commands<ReturnType> {
|
|
14
|
-
Element: {
|
|
15
|
-
setElement: (tag: string, slot?: string) => ReturnType;
|
|
16
|
-
};
|
|
17
|
-
}
|
|
18
|
-
}
|
|
19
|
-
export declare const Element: Node<ElementOptions, any>;
|
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
import { Node } from '@tiptap/core';
|
|
2
|
-
import type { JsonRecord } from '../../types.js';
|
|
3
|
-
export interface FileOptions {
|
|
4
|
-
HTMLAttributes: JsonRecord;
|
|
5
|
-
inline: boolean;
|
|
6
|
-
resolveSrc?: (props: JsonRecord) => string | null | undefined;
|
|
7
|
-
}
|
|
8
|
-
export interface SetFileOptions {
|
|
9
|
-
filename?: string;
|
|
10
|
-
id?: string;
|
|
11
|
-
size?: number;
|
|
12
|
-
src?: string;
|
|
13
|
-
title?: string;
|
|
14
|
-
type?: string;
|
|
15
|
-
}
|
|
16
|
-
declare module '@tiptap/core' {
|
|
17
|
-
interface Commands<ReturnType> {
|
|
18
|
-
File: {
|
|
19
|
-
addFile: () => ReturnType;
|
|
20
|
-
setFile: (options: SetFileOptions) => ReturnType;
|
|
21
|
-
};
|
|
22
|
-
}
|
|
23
|
-
}
|
|
24
|
-
export declare const File: Node<FileOptions, any>;
|
|
@@ -1,39 +0,0 @@
|
|
|
1
|
-
import { Extension } from '@tiptap/core';
|
|
2
|
-
import type { EditorImage, ImagePicker, ImageUploadHandler, LegacyImageUploadResult } from '../../types.js';
|
|
3
|
-
import { type EditorMessages } from '../../ui/messages.js';
|
|
4
|
-
import type { EditorOverlayController } from '../../ui/context.js';
|
|
5
|
-
export interface UploadOptions {
|
|
6
|
-
overlay?: EditorOverlayController;
|
|
7
|
-
getMessages?: () => EditorMessages | undefined;
|
|
8
|
-
dropTarget?: () => HTMLElement | undefined;
|
|
9
|
-
upload?: () => ImageUploadHandler | undefined;
|
|
10
|
-
picker?: () => ImagePicker | undefined;
|
|
11
|
-
/** The largest accepted file, in bytes. Defaults to 10 MB. */
|
|
12
|
-
maxBytes?: () => number;
|
|
13
|
-
enabled?: () => boolean;
|
|
14
|
-
insert?: (asset: ImageResult, pos: number, replaceSize?: number) => boolean;
|
|
15
|
-
onPendingChange?: (count: number) => void;
|
|
16
|
-
}
|
|
17
|
-
type ImageResult = EditorImage | LegacyImageUploadResult;
|
|
18
|
-
interface ReplacementRange {
|
|
19
|
-
from: number;
|
|
20
|
-
to: number;
|
|
21
|
-
}
|
|
22
|
-
export declare const defaultImageMaxBytes: number;
|
|
23
|
-
/** A short, readable file size such as "10 MB" or "512 KB". */
|
|
24
|
-
export declare function formatFileSize(bytes: number): string;
|
|
25
|
-
export interface UploadStorage {
|
|
26
|
-
add: (range?: ReplacementRange) => boolean;
|
|
27
|
-
clear: () => void;
|
|
28
|
-
}
|
|
29
|
-
declare module '@tiptap/core' {
|
|
30
|
-
interface Commands<ReturnType> {
|
|
31
|
-
imageUpload: {
|
|
32
|
-
insertImageUpload: (range?: ReplacementRange) => ReturnType;
|
|
33
|
-
clearImageUploads: () => ReturnType;
|
|
34
|
-
};
|
|
35
|
-
}
|
|
36
|
-
}
|
|
37
|
-
/** Uploads are temporary view decorations, never an extra Markdown node type. */
|
|
38
|
-
export declare const ImageUpload: Extension<UploadOptions, UploadStorage>;
|
|
39
|
-
export {};
|
|
@@ -1,39 +0,0 @@
|
|
|
1
|
-
import type { ImageActions } from '../nodeviews/image.js';
|
|
2
|
-
import { Node } from '@tiptap/core';
|
|
3
|
-
import type { JsonRecord } from '../../types.js';
|
|
4
|
-
import type { EditorOverlayController } from '../../ui/context.js';
|
|
5
|
-
export interface ImageOptions {
|
|
6
|
-
overlay?: EditorOverlayController;
|
|
7
|
-
actions?: ImageActions;
|
|
8
|
-
allowBase64: boolean;
|
|
9
|
-
HTMLAttributes: JsonRecord;
|
|
10
|
-
inline: boolean;
|
|
11
|
-
resolveSrc?: (props: JsonRecord) => string | null | undefined;
|
|
12
|
-
}
|
|
13
|
-
export interface SetImageOptions {
|
|
14
|
-
alt?: string;
|
|
15
|
-
class?: string;
|
|
16
|
-
cropHeight?: number | string;
|
|
17
|
-
cropWidth?: number | string;
|
|
18
|
-
cropX?: number | string;
|
|
19
|
-
cropY?: number | string;
|
|
20
|
-
filename?: string;
|
|
21
|
-
fit?: string;
|
|
22
|
-
focalX?: number | string;
|
|
23
|
-
focalY?: number | string;
|
|
24
|
-
format?: string;
|
|
25
|
-
height?: number | string;
|
|
26
|
-
id?: string;
|
|
27
|
-
quality?: number | string;
|
|
28
|
-
src?: string;
|
|
29
|
-
title?: string;
|
|
30
|
-
width?: number | string;
|
|
31
|
-
}
|
|
32
|
-
declare module '@tiptap/core' {
|
|
33
|
-
interface Commands<ReturnType> {
|
|
34
|
-
Image: {
|
|
35
|
-
setImage: (options: SetImageOptions) => ReturnType;
|
|
36
|
-
};
|
|
37
|
-
}
|
|
38
|
-
}
|
|
39
|
-
export declare const Image: Node<ImageOptions, any>;
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
export { CodeBlock } from './code-block.js';
|
|
2
|
-
export { Element } from './element.js';
|
|
3
|
-
export { File } from './file.js';
|
|
4
|
-
export { Heading } from './heading.js';
|
|
5
|
-
export { Image } from './image.js';
|
|
6
|
-
export { InlineElement } from './inline-element.js';
|
|
7
|
-
export { MarkdownClipboard } from './markdown-clipboard.js';
|
|
8
|
-
export { Slot } from './slot.js';
|
|
9
|
-
export { SpanStyle } from './span-style.js';
|
|
10
|
-
export { Video } from './video.js';
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import { Node } from '@tiptap/core';
|
|
2
|
-
import type { JsonRecord } from '../../types.js';
|
|
3
|
-
export interface InlineElementOptions {
|
|
4
|
-
HTMLAttributes: JsonRecord;
|
|
5
|
-
}
|
|
6
|
-
declare module '@tiptap/core' {
|
|
7
|
-
interface Commands<ReturnType> {
|
|
8
|
-
InlineElement: {
|
|
9
|
-
setInlineElement: (tag: string) => ReturnType;
|
|
10
|
-
};
|
|
11
|
-
}
|
|
12
|
-
}
|
|
13
|
-
export declare const InlineElement: Node<InlineElementOptions, any>;
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
import { Extension } from '@tiptap/core';
|
|
2
|
-
import type { AuthoringKit } from '../../authoring.js';
|
|
3
|
-
import type { TiptapToMDCOptions } from '../tiptapToMdc.js';
|
|
4
|
-
import { type EditorText } from '../../ui/messages.js';
|
|
5
|
-
import { type EditorProfile } from '../profiles.js';
|
|
6
|
-
export interface MarkdownClipboardOptions extends TiptapToMDCOptions {
|
|
7
|
-
enabled: boolean;
|
|
8
|
-
/** Localized user-facing text. Defaults to the English messages. */
|
|
9
|
-
text?: EditorText;
|
|
10
|
-
getAuthoringKit?: () => AuthoringKit | undefined;
|
|
11
|
-
getOutputOptions?: () => TiptapToMDCOptions;
|
|
12
|
-
/** Pasted Markdown is reduced to this profile before it is inserted. */
|
|
13
|
-
profile?: EditorProfile;
|
|
14
|
-
canPaste?: () => boolean;
|
|
15
|
-
onPasteError?: (message: string | undefined) => void;
|
|
16
|
-
onCopyError?: (message: string | undefined) => void;
|
|
17
|
-
}
|
|
18
|
-
export declare const MarkdownClipboard: Extension<MarkdownClipboardOptions, any>;
|
|
19
|
-
export declare function extractMarkdownFromClipboard(event: ClipboardEvent): null | string;
|
|
20
|
-
export declare function hasSemanticHtml(html: string): boolean;
|
|
21
|
-
export declare function isProbablyMarkdown(value: string): boolean;
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import { Extension } from '@tiptap/core';
|
|
2
|
-
import { type EditorProfile } from '../profiles.js';
|
|
3
|
-
/**
|
|
4
|
-
* Enforce a content profile. Paste and drop are reduced to the allowed set.
|
|
5
|
-
* As a last line of defense, a writer's transaction can never add a node or
|
|
6
|
-
* mark that the profile does not allow. Toolbar, slash menu, and input rules
|
|
7
|
-
* are limited separately so that this guard normally never has to reject.
|
|
8
|
-
*/
|
|
9
|
-
export declare const ProfileGuard: Extension<{
|
|
10
|
-
profile: EditorProfile;
|
|
11
|
-
}, any>;
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
import { Node } from '@tiptap/core';
|
|
2
|
-
import type { AuthoringKit } from '../../authoring.js';
|
|
3
|
-
import type { JsonRecord } from '../../types.js';
|
|
4
|
-
export interface SlotOptions {
|
|
5
|
-
getAuthoringKit?: () => AuthoringKit | undefined;
|
|
6
|
-
HTMLAttributes: JsonRecord;
|
|
7
|
-
nestable: boolean;
|
|
8
|
-
}
|
|
9
|
-
declare module '@tiptap/core' {
|
|
10
|
-
interface Commands<ReturnType> {
|
|
11
|
-
Slot: {
|
|
12
|
-
handleSlotBackspace: () => ReturnType;
|
|
13
|
-
};
|
|
14
|
-
}
|
|
15
|
-
}
|
|
16
|
-
export declare const Slot: Node<SlotOptions, any>;
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
import { Node } from '@tiptap/core';
|
|
2
|
-
export interface SpanStyleAttrs {
|
|
3
|
-
class?: null | string;
|
|
4
|
-
style?: null | string;
|
|
5
|
-
}
|
|
6
|
-
declare module '@tiptap/core' {
|
|
7
|
-
interface Commands<ReturnType> {
|
|
8
|
-
SpanStyle: {
|
|
9
|
-
setSpanStyle: (attributes?: SpanStyleAttrs) => ReturnType;
|
|
10
|
-
unsetSpanStyle: () => ReturnType;
|
|
11
|
-
updateSpanStyle: (attributes?: SpanStyleAttrs) => ReturnType;
|
|
12
|
-
};
|
|
13
|
-
}
|
|
14
|
-
}
|
|
15
|
-
export declare const SpanStyle: Node<SpanStyleAttrs, any>;
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
import { Node } from '@tiptap/core';
|
|
2
|
-
declare module '@tiptap/core' {
|
|
3
|
-
interface Commands<ReturnType> {
|
|
4
|
-
Video: {
|
|
5
|
-
addVideo: () => ReturnType;
|
|
6
|
-
setVideo: (attrs: {
|
|
7
|
-
height?: number | string;
|
|
8
|
-
src: string;
|
|
9
|
-
title?: string;
|
|
10
|
-
width?: number | string;
|
|
11
|
-
}) => ReturnType;
|
|
12
|
-
};
|
|
13
|
-
}
|
|
14
|
-
}
|
|
15
|
-
export declare const Video: Node<any, any>;
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
/** Stored image fields supported by the editor's Content conversion. */
|
|
2
|
-
export declare const imageProperties: {
|
|
3
|
-
readonly id: "text";
|
|
4
|
-
readonly filename: "text";
|
|
5
|
-
readonly src: "text";
|
|
6
|
-
readonly alt: "text";
|
|
7
|
-
readonly title: "text";
|
|
8
|
-
readonly width: "number";
|
|
9
|
-
readonly height: "number";
|
|
10
|
-
readonly fit: "text";
|
|
11
|
-
readonly quality: "number";
|
|
12
|
-
readonly format: "text";
|
|
13
|
-
readonly focalX: "number";
|
|
14
|
-
readonly focalY: "number";
|
|
15
|
-
readonly cropX: "number";
|
|
16
|
-
readonly cropY: "number";
|
|
17
|
-
readonly cropWidth: "number";
|
|
18
|
-
readonly cropHeight: "number";
|
|
19
|
-
readonly class: "text";
|
|
20
|
-
};
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import type { ExtendedRegExpMatchArray, nodeInputRule } from '@tiptap/core';
|
|
2
|
-
import { InputRule } from '@tiptap/core';
|
|
3
|
-
type Config = Parameters<typeof nodeInputRule>[0] & {
|
|
4
|
-
getText?: (match: ExtendedRegExpMatchArray) => string;
|
|
5
|
-
};
|
|
6
|
-
export declare function textInputRule(config: Config): InputRule;
|
|
7
|
-
export {};
|
package/dist/lib/markdown.d.ts
DELETED
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import { parseMdcDocument } from '@lupinum/ginko-content/cms-contract';
|
|
2
|
-
import type { MDCRoot } from './mdcTypes.js';
|
|
3
|
-
export interface StringifyMdcOptions {
|
|
4
|
-
videoOutput?: 'html' | 'mdc';
|
|
5
|
-
}
|
|
6
|
-
/** Adapt one canonical parse result to the editor's lossless conversion tree. */
|
|
7
|
-
export declare function adaptMdcDocument(tree: Awaited<ReturnType<typeof parseMdcDocument>>): MDCRoot;
|
|
8
|
-
/**
|
|
9
|
-
* Stringify the Studio MDC object tree back to Comark/MDC-compatible markdown.
|
|
10
|
-
*/
|
|
11
|
-
export declare function stringifyMdc(ast: MDCRoot, options?: StringifyMdcOptions): Promise<string>;
|
package/dist/lib/marks.d.ts
DELETED
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import type { JSONContent } from '@tiptap/core';
|
|
2
|
-
import type { MDCNode } from './mdcTypes.js';
|
|
3
|
-
export declare const tagToMark: Record<string, string>;
|
|
4
|
-
export declare function createMark(node: MDCNode, mark: string, accumulatedMarks?: {
|
|
5
|
-
attrs?: object;
|
|
6
|
-
type: string;
|
|
7
|
-
}[], convertNode?: (node: MDCNode, parent?: MDCNode) => JSONContent): JSONContent[];
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* MDC to TipTap converter
|
|
3
|
-
*
|
|
4
|
-
* Main entry point that combines categorized converters:
|
|
5
|
-
* - marks.ts: Text formatting (bold, italic, link, code, strike)
|
|
6
|
-
* - nodes.ts: Document structure (headings, lists, tables, paragraphs)
|
|
7
|
-
* - component-converters.ts: Custom components (file, image, video)
|
|
8
|
-
*/
|
|
9
|
-
import type { JSONContent } from '@tiptap/core';
|
|
10
|
-
import { type PortableComponentPolicy } from '@lupinum/ginko-content/cms-contract';
|
|
11
|
-
import type { MDCNode, MDCRoot } from './mdcTypes.js';
|
|
12
|
-
/**
|
|
13
|
-
* Converts a single Editor node to TipTap format
|
|
14
|
-
* Note: Can return JSONContent[] for text nodes with emojis, which will be flattened by caller
|
|
15
|
-
*/
|
|
16
|
-
export declare function mdcNodeToTiptap(node: MDCNode | MDCRoot, parent?: MDCNode, policy?: PortableComponentPolicy): JSONContent | JSONContent[];
|
|
17
|
-
/**
|
|
18
|
-
* Convert MDC AST to TipTap JSON (without frontmatter)
|
|
19
|
-
*/
|
|
20
|
-
export declare function mdcToTiptap(body: MDCRoot, policy?: PortableComponentPolicy): JSONContent;
|
package/dist/lib/mdcTypes.d.ts
DELETED
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
import type { JsonRecord } from '../types.js';
|
|
2
|
-
export interface MDCText {
|
|
3
|
-
type: 'text';
|
|
4
|
-
value: string;
|
|
5
|
-
}
|
|
6
|
-
export interface MDCComment {
|
|
7
|
-
type: 'comment';
|
|
8
|
-
value?: string;
|
|
9
|
-
}
|
|
10
|
-
export interface MDCElement {
|
|
11
|
-
type: 'element';
|
|
12
|
-
tag: string;
|
|
13
|
-
props?: JsonRecord;
|
|
14
|
-
children?: MDCNode[];
|
|
15
|
-
}
|
|
16
|
-
export interface MDCRoot {
|
|
17
|
-
type: 'root';
|
|
18
|
-
children: MDCNode[];
|
|
19
|
-
}
|
|
20
|
-
export type MDCNode = MDCElement | MDCText | MDCComment;
|