@agilehub/agile-editor 1.8.3 → 1.8.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/agile-editor.css +1 -1
- package/dist/agile-editor.js +24008 -15910
- package/dist/{i18n-E7gk29NK.js → i18n-DZxiNlPY.js} +481 -620
- package/dist/types/components/editor/callout-dialog.vue.d.ts +48 -0
- package/dist/types/components/editor/callout-gradient-editor.vue.d.ts +12 -0
- package/dist/types/components/editor/figure-caption-numbering-dialog.vue.d.ts +11 -0
- package/dist/types/components/editor/index.vue.d.ts +2 -2
- package/dist/types/components/editor/table-background-control.vue.d.ts +11 -0
- package/dist/types/components/editor/table-cell-properties.vue.d.ts +8 -0
- package/dist/types/components/editor/table-property-section.vue.d.ts +22 -0
- package/dist/types/components/index.d.ts +2 -0
- package/dist/types/components/index.vue.d.ts +898 -19
- package/dist/types/components/menus/bubble/image/replace.vue.d.ts +3 -0
- package/dist/types/components/menus/bubble/image/size.vue.d.ts +3 -0
- package/dist/types/components/menus/bubble/link/edit.vue.d.ts +3 -0
- package/dist/types/components/menus/toolbar/tools/bubble-note-editor.vue.d.ts +52 -0
- package/dist/types/components/menus/toolbar/tools/bubble-note-image.d.ts +3 -0
- package/dist/types/components/menus/toolbar/tools/bubble-note.vue.d.ts +9 -0
- package/dist/types/components/menus/toolbar/tools/figure-caption-numbering.vue.d.ts +15 -1
- package/dist/types/components/toolbar/classic.vue.d.ts +10 -10
- package/dist/types/components/toolbar/ribbon.vue.d.ts +10 -10
- package/dist/types/composables/i18n.d.ts +897 -18
- package/dist/types/extensions/bubble-note-content.d.ts +48 -0
- package/dist/types/extensions/bubble-note-extensions.d.ts +12 -0
- package/dist/types/extensions/bubble-note-render.d.ts +1 -0
- package/dist/types/extensions/bubble-note.d.ts +5 -0
- package/dist/types/extensions/callout/index.d.ts +3 -3
- package/dist/types/extensions/callout/title-view.vue.d.ts +93 -0
- package/dist/types/extensions/callout/title.d.ts +7 -0
- package/dist/types/extensions/code-block/index.d.ts +8 -0
- package/dist/types/extensions/columns/schema.d.ts +6 -1
- package/dist/types/extensions/courseware/reader-visibility.d.ts +6 -0
- package/dist/types/extensions/file/index.d.ts +4 -0
- package/dist/types/extensions/image/automatic-attributes.d.ts +6 -0
- package/dist/types/extensions/image/paste.d.ts +3 -0
- package/dist/types/extensions/indent.d.ts +1 -0
- package/dist/types/extensions/insert-newline.d.ts +2 -3
- package/dist/types/extensions/math/index.d.ts +2 -1
- package/dist/types/extensions/smart-sheet/model.d.ts +5 -0
- package/dist/types/extensions/table-column-resize.d.ts +15 -0
- package/dist/types/extensions/table.d.ts +29 -0
- package/dist/types/extensions/timeline/content.vue.d.ts +1 -0
- package/dist/types/extensions/timeline/index.d.ts +3 -6
- package/dist/types/extensions/timeline/model.d.ts +18 -15
- package/dist/types/extensions/trailing-node.d.ts +14 -0
- package/dist/types/i18n.d.ts +897 -18
- package/dist/types/options/config/callout-assets.d.ts +3 -0
- package/dist/types/options/config/callout-color-picker.d.ts +13 -0
- package/dist/types/options/config/callout-templates.d.ts +66 -0
- package/dist/types/options/config/index.d.ts +12 -0
- package/dist/types/options/config/table-color-picker.d.ts +6 -0
- package/dist/types/utils/base64url.d.ts +2 -0
- package/dist/types/utils/block-menu.d.ts +1 -0
- package/dist/types/utils/bookmark-attributes.d.ts +2 -0
- package/dist/types/utils/bubble-note-selection.d.ts +7 -0
- package/dist/types/utils/callout.d.ts +204 -0
- package/dist/types/utils/caption-numbering.d.ts +62 -0
- package/dist/types/utils/code-block-indent.d.ts +15 -0
- package/dist/types/utils/column-width.d.ts +9 -0
- package/dist/types/utils/document-attributes.d.ts +3 -0
- package/dist/types/utils/document-import.d.ts +4 -0
- package/dist/types/utils/document-loading.d.ts +14 -0
- package/dist/types/utils/document-save.d.ts +5 -0
- package/dist/types/utils/editor-scroll.d.ts +1 -0
- package/dist/types/utils/editor-view.d.ts +12 -0
- package/dist/types/utils/figure-caption-numbering.d.ts +11 -55
- package/dist/types/utils/figure-caption-visibility.d.ts +8 -0
- package/dist/types/utils/file.d.ts +5 -2
- package/dist/types/utils/font-size.d.ts +2 -0
- package/dist/types/utils/formula-size.d.ts +23 -0
- package/dist/types/utils/iframe.d.ts +5 -0
- package/dist/types/utils/image-display-size.d.ts +13 -0
- package/dist/types/utils/image-file-caption.d.ts +11 -0
- package/dist/types/utils/image-replacement.d.ts +31 -0
- package/dist/types/utils/image-source.d.ts +2 -0
- package/dist/types/utils/inline-style.d.ts +9 -0
- package/dist/types/utils/insert-newline-position.d.ts +23 -0
- package/dist/types/utils/link.d.ts +5 -0
- package/dist/types/utils/pointer-hover-scheduler.d.ts +9 -0
- package/dist/types/utils/selection.d.ts +2 -1
- package/dist/types/utils/source-attributes.d.ts +7 -0
- package/dist/types/utils/style-target.d.ts +4 -0
- package/dist/types/utils/table-appearance.d.ts +33 -0
- package/dist/types/utils/table-attributes.d.ts +14 -0
- package/dist/types/utils/table-border.d.ts +38 -0
- package/dist/types/utils/table-caption-numbering.d.ts +19 -0
- package/dist/types/utils/table-caption-visibility.d.ts +32 -0
- package/dist/types/utils/table-column-resize.d.ts +10 -0
- package/dist/types/utils/table-layout.d.ts +10 -0
- package/dist/types/utils/table-properties.d.ts +39 -0
- package/dist/types/utils/table-reset.d.ts +23 -0
- package/dist/types/utils/table-row-resize.d.ts +8 -0
- package/dist/types/utils/table-selection.d.ts +18 -0
- package/dist/types/utils/thousands-separator.d.ts +1 -0
- package/dist/types/utils/tracking-attributes.d.ts +8 -0
- package/dist/{viewer-DmoW4doo.js → viewer-DWO1FZ3A.js} +2 -2
- package/docs/SECONDARY_DEVELOPMENT.md +799 -795
- package/docs/superpowers/plans/2026-11-27-table-reset-controls.md +185 -0
- package/docs/superpowers/plans/2026-11-28-bubble-note-rich-content.md +101 -0
- package/docs/superpowers/plans/2026-11-28-image-replace.md +190 -0
- package/docs/superpowers/plans/2026-11-28-table-image-resize-preview.md +121 -0
- package/docs/superpowers/plans/2026-11-28-table-property-category-actions.md +192 -0
- package/docs/superpowers/specs/2026-11-27-table-reset-controls-design.md +66 -0
- package/docs/superpowers/specs/2026-11-28-bubble-note-rich-content-design.md +64 -0
- package/docs/superpowers/specs/2026-11-28-image-replace-design.md +40 -0
- package/docs/superpowers/specs/2026-11-28-table-image-resize-preview-design.md +30 -0
- package/docs/superpowers/specs/2026-11-28-table-property-category-actions-design.md +63 -0
- package/package.json +4 -4
- package/dist/types/components/menus/bubble/callout/background.vue.d.ts +0 -7
- package/dist/types/components/menus/bubble/callout/emoji-remove.vue.d.ts +0 -7
- /package/dist/types/components/{menus/bubble/callout/builtin.vue.d.ts → editor/table-cell-context-menu.vue.d.ts} +0 -0
- /package/dist/types/components/{menus/bubble/image/open.vue.d.ts → editor/table-quick-toolbar.vue.d.ts} +0 -0
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
export type ImageReplacementTarget = {
|
|
2
|
+
position: number;
|
|
3
|
+
id: string | null;
|
|
4
|
+
src: string | null;
|
|
5
|
+
type: 'image' | 'inlineImage';
|
|
6
|
+
};
|
|
7
|
+
export type ImageNodeLike = {
|
|
8
|
+
type: {
|
|
9
|
+
name: string;
|
|
10
|
+
};
|
|
11
|
+
attrs: Record<string, any>;
|
|
12
|
+
};
|
|
13
|
+
type DecodableImage = {
|
|
14
|
+
src: string;
|
|
15
|
+
decode: () => Promise<void>;
|
|
16
|
+
};
|
|
17
|
+
type ImageFileValidationDependencies = {
|
|
18
|
+
createImage?: () => DecodableImage;
|
|
19
|
+
createObjectUrl?: (file: Blob) => string;
|
|
20
|
+
revokeObjectUrl?: (url: string) => void;
|
|
21
|
+
};
|
|
22
|
+
export declare const createImageReplacementRequest: <Target>(files: ArrayLike<File> | null | undefined, target: Target | null) => {
|
|
23
|
+
file: File;
|
|
24
|
+
target: Target;
|
|
25
|
+
};
|
|
26
|
+
export declare const createImageReplacementAttrs: (attrs: Record<string, any>, src: string) => Record<string, any>;
|
|
27
|
+
export declare const validateImageFileContent: (file: Blob, { createImage, createObjectUrl, revokeObjectUrl, }?: ImageFileValidationDependencies) => Promise<void>;
|
|
28
|
+
export declare const findImageReplacementTarget: (doc: {
|
|
29
|
+
nodeAt: (position: number) => ImageNodeLike | null;
|
|
30
|
+
}, target: ImageReplacementTarget) => ImageNodeLike | null;
|
|
31
|
+
export {};
|
|
@@ -1 +1,3 @@
|
|
|
1
|
+
export declare const isDataImageSrc: (source: string | null | undefined) => boolean;
|
|
2
|
+
export declare const getBase64ImageByteSize: (source: string) => number | null;
|
|
1
3
|
export declare const resolveImageSource: (source: string | null | undefined, encoding?: string | null, mimeType?: string | null) => string;
|
|
@@ -5,4 +5,13 @@
|
|
|
5
5
|
* 环境使用等价的声明扫描逻辑,便于在 Node 单元测试中验证。
|
|
6
6
|
*/
|
|
7
7
|
export declare const removeInlineStyleProperties: (styleText: string | null | undefined, properties: string[]) => string;
|
|
8
|
+
export declare const getInlineStyleProperty: (styleText: string | null | undefined, property: string) => string;
|
|
9
|
+
export declare const getActiveTextStyleAttributes: (editor: any) => any;
|
|
10
|
+
export declare const createTextStyleMarksFromInlineStyle: (styleText: string | null | undefined) => {
|
|
11
|
+
type: string;
|
|
12
|
+
attrs: {
|
|
13
|
+
fontSize?: string;
|
|
14
|
+
fontFamily?: string;
|
|
15
|
+
};
|
|
16
|
+
}[];
|
|
8
17
|
export declare const setInlineStyleProperty: (styleText: string | null | undefined, property: string, value: string) => string;
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import type { Node as ProseMirrorNode } from '@tiptap/pm/model';
|
|
2
|
+
import type { EditorView } from '@tiptap/pm/view';
|
|
3
|
+
export type InsertNewlineCandidate = {
|
|
4
|
+
depth: number;
|
|
5
|
+
end: number;
|
|
6
|
+
hasNextSibling: boolean;
|
|
7
|
+
insertIndex: number;
|
|
8
|
+
node: ProseMirrorNode;
|
|
9
|
+
pos: number;
|
|
10
|
+
};
|
|
11
|
+
export declare const isInsertNewlineWidget: (node: ProseMirrorNode) => boolean;
|
|
12
|
+
/**
|
|
13
|
+
* Collect insertion candidates around a resolved pointer position.
|
|
14
|
+
* Only the current ancestor and its preceding sibling are inspected at each
|
|
15
|
+
* document level, avoiding a full-document scan on every mouse move.
|
|
16
|
+
*/
|
|
17
|
+
export declare const collectInsertNewlineCandidates: (doc: ProseMirrorNode, pos: number) => InsertNewlineCandidate[];
|
|
18
|
+
type PointerPosition = Pick<MouseEvent, 'clientX' | 'clientY'>;
|
|
19
|
+
export declare const findInsertNewlineTarget: (view: EditorView, event: PointerPosition, editorRect?: DOMRect) => {
|
|
20
|
+
pos: number;
|
|
21
|
+
lineY: number;
|
|
22
|
+
} | null;
|
|
23
|
+
export {};
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import type { Node } from '@tiptap/pm/model';
|
|
2
|
+
import { type Selection } from '@tiptap/pm/state';
|
|
3
|
+
export declare const isLinkableTextSelection: (selection: Selection | null | undefined, doc: Node | null | undefined) => boolean;
|
|
4
|
+
export declare const normalizeEditorLinkUrl: (value: unknown) => string;
|
|
5
|
+
export declare const getReadOnlyLinkHref: (target: unknown, editable: boolean) => string;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
type PointerHoverSchedulerOptions<T> = {
|
|
2
|
+
delay: number;
|
|
3
|
+
onUpdate: (value: T) => void;
|
|
4
|
+
};
|
|
5
|
+
export declare const createPointerHoverScheduler: <T>({ delay, onUpdate, }: PointerHoverSchedulerOptions<T>) => {
|
|
6
|
+
cancel: () => void;
|
|
7
|
+
schedule: (value: T) => void;
|
|
8
|
+
};
|
|
9
|
+
export {};
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
-
|
|
1
|
+
import type { Node } from '@tiptap/pm/model';
|
|
2
|
+
export declare const getSelectionNode: (editor: any) => Node | null;
|
|
2
3
|
export declare const getSelectionText: (editor: any) => any;
|
|
3
4
|
export declare const setSelectionText: (editor: any, prevDocLength: any, from: any, to: any) => boolean;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Remove attributes already represented by the node schema. The remaining
|
|
3
|
+
* object is safe to merge back before rendering as an import-only snapshot.
|
|
4
|
+
*/
|
|
5
|
+
export declare const omitSourceAttributes: (source: unknown, names: string[]) => Record<string, any> | null;
|
|
6
|
+
export declare const omitSourceClassNames: (source: unknown, classNames: string[]) => Record<string, any> | null;
|
|
7
|
+
export declare const removeSourceStyleProperties: (source: unknown, properties: string[]) => Record<string, any> | null;
|
|
@@ -41,6 +41,10 @@ export declare const globalStyleMarkTypes: string[];
|
|
|
41
41
|
export declare const inlineMarkNames: Set<string>;
|
|
42
42
|
export declare const hasStyleSpanMark: (marks: readonly Mark[]) => boolean;
|
|
43
43
|
export declare const stripBubbleNoteDecorationStyles: (styleText: string) => string;
|
|
44
|
+
export declare const createCustomStyleAttrs: (currentAttrs: Record<string, unknown>, style: string | null) => {
|
|
45
|
+
inlineStyle: string;
|
|
46
|
+
style: string;
|
|
47
|
+
};
|
|
44
48
|
export declare const createBubbleNoteEditableStyle: (attrs: {
|
|
45
49
|
lineType?: string;
|
|
46
50
|
lineColor?: string;
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import type { Node as ProseMirrorNode } from '@tiptap/pm/model';
|
|
2
|
+
export type TableDimensionUnit = 'px' | '%';
|
|
3
|
+
export type TableDimension = {
|
|
4
|
+
value: number;
|
|
5
|
+
unit: TableDimensionUnit;
|
|
6
|
+
};
|
|
7
|
+
export type TableGradient = {
|
|
8
|
+
angle: number;
|
|
9
|
+
from: string;
|
|
10
|
+
to: string;
|
|
11
|
+
};
|
|
12
|
+
export type TableBackground = {
|
|
13
|
+
mode: 'none' | 'color' | 'gradient' | 'image';
|
|
14
|
+
color: string;
|
|
15
|
+
gradient: TableGradient;
|
|
16
|
+
imageUrl: string;
|
|
17
|
+
};
|
|
18
|
+
export declare const tablePresetCheckColor: (color: string) => string;
|
|
19
|
+
export declare const getInlineStyleProperty: (styleText: string | null | undefined, property: string) => string;
|
|
20
|
+
export type TableCellTextDirection = 'horizontal' | 'vertical';
|
|
21
|
+
export declare const parseTableCellTextDirection: (styleText: string | null | undefined) => TableCellTextDirection;
|
|
22
|
+
export declare const applyTableCellTextDirection: (styleText: string | null | undefined, direction: TableCellTextDirection) => string;
|
|
23
|
+
export type TableCellAlignmentUpdate = {
|
|
24
|
+
position: number;
|
|
25
|
+
attrs: Record<string, unknown>;
|
|
26
|
+
};
|
|
27
|
+
export declare const getTableCellAlignmentUpdates: (doc: ProseMirrorNode, cellPosition: number, align: string) => TableCellAlignmentUpdate[] | null;
|
|
28
|
+
export declare const cloneTableBackground: (background?: TableBackground) => TableBackground;
|
|
29
|
+
export declare const parseTableDimension: (value: string | null | undefined, fallback: TableDimension) => TableDimension;
|
|
30
|
+
export declare const formatTableDimension: ({ value, unit }: TableDimension) => string;
|
|
31
|
+
export declare const parseTableBackground: (styleText: string | null | undefined) => TableBackground;
|
|
32
|
+
export declare const getTableBackgroundCss: (background: TableBackground) => Record<string, string>;
|
|
33
|
+
export declare const applyTableBackground: (styleText: string | null | undefined, background: TableBackground) => string;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
export declare const sanitizeTableSourceAttributes: (source: unknown) => Record<string, any>;
|
|
2
|
+
export declare const sanitizeTableCellSourceAttributes: (source: unknown) => Record<string, any>;
|
|
3
|
+
export declare const parseTableCellBackground: (element: Pick<HTMLElement, "getAttribute" | "style">) => string;
|
|
4
|
+
export declare const getTableCellWidthAttributes: (colwidth: unknown) => {
|
|
5
|
+
colwidth?: undefined;
|
|
6
|
+
style?: undefined;
|
|
7
|
+
} | {
|
|
8
|
+
colwidth: string;
|
|
9
|
+
style: string;
|
|
10
|
+
};
|
|
11
|
+
export declare const createTableCellBackgroundUpdate: (attrs: Record<string, any>, background: string | null) => {
|
|
12
|
+
background: string;
|
|
13
|
+
inlineStyle: string;
|
|
14
|
+
};
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
export type TableBorderLineStyle = 'none' | 'hidden' | 'dotted' | 'dashed' | 'solid' | 'double' | 'groove' | 'ridge' | 'inset' | 'outset';
|
|
2
|
+
export type TableBorderSide = 'Top' | 'Right' | 'Bottom' | 'Left';
|
|
3
|
+
export type TableBorderValues = {
|
|
4
|
+
width: number;
|
|
5
|
+
lineStyle: TableBorderLineStyle;
|
|
6
|
+
color: string | null;
|
|
7
|
+
};
|
|
8
|
+
export type TableBorderPatch = {
|
|
9
|
+
width?: number;
|
|
10
|
+
lineStyle?: TableBorderLineStyle;
|
|
11
|
+
color?: string | null;
|
|
12
|
+
};
|
|
13
|
+
export declare const parseTableBorderStyle: (value: string) => {
|
|
14
|
+
width: number;
|
|
15
|
+
lineStyle: TableBorderLineStyle;
|
|
16
|
+
};
|
|
17
|
+
export declare const normalizeTableBorderWidth: (width: number | string, lineStyle: TableBorderLineStyle | string) => number;
|
|
18
|
+
export declare const createTableBorderStyle: (width: number | string, lineStyle: TableBorderLineStyle | string) => string;
|
|
19
|
+
export declare const normalizeTableBorderStyle: (value: string) => string;
|
|
20
|
+
/**
|
|
21
|
+
* Resolve the border a cell currently displays without materializing inherited
|
|
22
|
+
* values into the document.
|
|
23
|
+
*/
|
|
24
|
+
export declare const resolveTableBorder: (cellAttrs?: Record<string, any>, tableAttrs?: Record<string, any>) => TableBorderValues;
|
|
25
|
+
export declare const hasTableBorderPatch: (patch: TableBorderPatch) => any;
|
|
26
|
+
export declare const getTableBorderPatch: (current: TableBorderValues, baseline: TableBorderValues) => TableBorderPatch;
|
|
27
|
+
export declare const updateTableCellBorderAttributes: (cellAttrs: Record<string, any>, tableAttrs: Record<string, any>, patch: TableBorderPatch) => {
|
|
28
|
+
[x: string]: any;
|
|
29
|
+
};
|
|
30
|
+
export declare const updateTableCellSideBorderAttributes: (cellAttrs: Record<string, any>, tableAttrs: Record<string, any>, patch: TableBorderPatch, side: TableBorderSide) => {
|
|
31
|
+
[x: string]: any;
|
|
32
|
+
};
|
|
33
|
+
/**
|
|
34
|
+
* Render modeled cell borders as independent CSS longhands. Omitting an
|
|
35
|
+
* inherited color is intentional: the table-level border color must remain
|
|
36
|
+
* inheritable.
|
|
37
|
+
*/
|
|
38
|
+
export declare const getTableCellBorderDeclarations: (attrs: Record<string, any>) => string[];
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import type { Node as ProseMirrorNode } from '@tiptap/pm/model';
|
|
2
|
+
import { type CaptionAnalysis, type CaptionCandidate, type CaptionPreview, type CaptionPreviewItem, type CaptionPreviewStatus, type CaptionRule, type ParsedCaption } from './caption-numbering.ts';
|
|
3
|
+
export type TableCaptionPreviewStatus = CaptionPreviewStatus;
|
|
4
|
+
export type TableCaptionRule = CaptionRule;
|
|
5
|
+
export type ParsedTableCaption = ParsedCaption;
|
|
6
|
+
export type TableCaptionCandidate = CaptionCandidate;
|
|
7
|
+
export type TableCaptionAnalysis = CaptionAnalysis;
|
|
8
|
+
export type TableCaptionPreviewItem = CaptionPreviewItem;
|
|
9
|
+
export type TableCaptionPreview = CaptionPreview;
|
|
10
|
+
export declare const normalizeTableCaptionText: (value: unknown) => string;
|
|
11
|
+
export declare const normalizeTableCaptionRule: (rule: Partial<CaptionRule>) => CaptionRule;
|
|
12
|
+
export declare const isValidTableCaptionRule: (rule: CaptionRule) => boolean;
|
|
13
|
+
export declare const formatTableCaptionLabel: (rule: CaptionRule, sequence: number) => string;
|
|
14
|
+
export declare const parseTableCaption: (value: unknown) => ParsedTableCaption | null;
|
|
15
|
+
export declare const createTableCaptionRuleFromCaption: (value: unknown) => TableCaptionRule | null;
|
|
16
|
+
export declare const collectTableCaptionCandidates: (doc: ProseMirrorNode) => TableCaptionCandidate[];
|
|
17
|
+
export declare const analyzeTableCaptions: (doc: ProseMirrorNode) => TableCaptionAnalysis;
|
|
18
|
+
export declare const createTableCaptionPreview: (candidates: TableCaptionCandidate[], rule: TableCaptionRule) => TableCaptionPreview;
|
|
19
|
+
export declare const applyTableCaptionPreview: (editor: any, items: TableCaptionPreviewItem[]) => boolean;
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
export declare const DEFAULT_CAPTION_STYLE = "font-family: SimHei; font-size: 16px";
|
|
2
|
+
export declare const getDefaultImageCaptionStyle: (options: Record<string, any> | undefined, inline: boolean) => any;
|
|
3
|
+
export declare const createDefaultImageCaption: (text: string) => {
|
|
4
|
+
captionStyle: string;
|
|
5
|
+
content: {
|
|
6
|
+
type: string;
|
|
7
|
+
text: string;
|
|
8
|
+
marks: {
|
|
9
|
+
type: string;
|
|
10
|
+
attrs: {
|
|
11
|
+
fontSize?: string;
|
|
12
|
+
fontFamily?: string;
|
|
13
|
+
};
|
|
14
|
+
}[];
|
|
15
|
+
}[];
|
|
16
|
+
};
|
|
17
|
+
export declare const getTableCaptionVisibilityAttributes: (hidden: unknown) => {
|
|
18
|
+
'data-caption-visible': string;
|
|
19
|
+
} | {
|
|
20
|
+
'data-caption-visible'?: undefined;
|
|
21
|
+
};
|
|
22
|
+
export declare const getDefaultTableCaptionAttributes: () => {
|
|
23
|
+
hidden: boolean;
|
|
24
|
+
inlineStyle: string;
|
|
25
|
+
};
|
|
26
|
+
/**
|
|
27
|
+
* Imported tables usually have no caption node. Treat those as hidden instead
|
|
28
|
+
* of rendering an empty caption row above the table.
|
|
29
|
+
*/
|
|
30
|
+
export declare const getImportedTableCaptionAttributes: (visibilityMarker: string | null | undefined, hasContent: boolean) => {
|
|
31
|
+
hidden: boolean;
|
|
32
|
+
};
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
export declare const matchesPluginKey: (plugin: {
|
|
2
|
+
spec?: {
|
|
3
|
+
key?: unknown;
|
|
4
|
+
};
|
|
5
|
+
}, key: unknown) => boolean;
|
|
6
|
+
/**
|
|
7
|
+
* Resize one table column while keeping the total table width stable.
|
|
8
|
+
* The column on the right of the dragged boundary absorbs the size change.
|
|
9
|
+
*/
|
|
10
|
+
export declare const resizeTableColumnWidths: (currentWidths: number[], columnIndex: number, targetWidth: number, minWidth: number) => number[];
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
export declare const DEFAULT_TABLE_COLUMN_MIN_WIDTH = 100;
|
|
2
|
+
export declare const TABLE_COLUMN_MIN_WIDTH = 25;
|
|
3
|
+
type TableColumnSource = {
|
|
4
|
+
colspan?: number | null;
|
|
5
|
+
colwidth?: readonly (number | null | undefined)[] | null;
|
|
6
|
+
};
|
|
7
|
+
/** Calculate the width needed before a table starts squeezing cells. */
|
|
8
|
+
export declare const getTableMinimumWidth: (cells: readonly TableColumnSource[], defaultColumnWidth?: number, minimumColumnWidth?: number) => number;
|
|
9
|
+
export declare const getRenderedTableMinimumWidth: (cells: readonly TableColumnSource[], editable: boolean) => number;
|
|
10
|
+
export {};
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import type { Node as ProseMirrorNode } from '@tiptap/pm/model';
|
|
2
|
+
import type { TableMap } from '@tiptap/pm/tables';
|
|
3
|
+
import { type TableDimensionUnit } from './table-appearance.ts';
|
|
4
|
+
import { type TableBorderPatch, type TableBorderValues } from './table-border.ts';
|
|
5
|
+
export type TableCellPropertyValues = {
|
|
6
|
+
width: number;
|
|
7
|
+
widthUnit: TableDimensionUnit;
|
|
8
|
+
height: number;
|
|
9
|
+
horizontalAlign: string;
|
|
10
|
+
verticalAlign: string;
|
|
11
|
+
border: TableBorderValues;
|
|
12
|
+
};
|
|
13
|
+
export type TableCellPropertyChanges = {
|
|
14
|
+
width: boolean;
|
|
15
|
+
height: boolean;
|
|
16
|
+
alignment: boolean;
|
|
17
|
+
border: TableBorderPatch;
|
|
18
|
+
};
|
|
19
|
+
export type TableCellPropertyReadOptions = {
|
|
20
|
+
textAlign?: string | null;
|
|
21
|
+
};
|
|
22
|
+
export type TableColumnWidthUpdate = {
|
|
23
|
+
position: number;
|
|
24
|
+
attrs: Record<string, any>;
|
|
25
|
+
};
|
|
26
|
+
export type TableCellSizeValues = {
|
|
27
|
+
width?: number;
|
|
28
|
+
widthUnit?: TableDimensionUnit;
|
|
29
|
+
height?: number;
|
|
30
|
+
};
|
|
31
|
+
export type TableCellSizeUpdate = {
|
|
32
|
+
position: number;
|
|
33
|
+
attrs: Record<string, any>;
|
|
34
|
+
};
|
|
35
|
+
export declare const getTableCellSizeUpdates: (doc: ProseMirrorNode, selectedPositions: number[], tableStart: number, map: TableMap, size: TableCellSizeValues) => TableCellSizeUpdate[];
|
|
36
|
+
export declare const getTableColumnWidthUpdates: (doc: ProseMirrorNode, tableStart: number, map: TableMap, left: number, right: number, width: number | null) => TableColumnWidthUpdate[];
|
|
37
|
+
export declare const resolveTableCellBorderValues: (cellAttrs: Record<string, any>, tableAttrs: Record<string, any>) => TableBorderValues;
|
|
38
|
+
export declare const resolveTableCellPropertyValues: (cellAttrs: Record<string, any>, tableAttrs: Record<string, any>, rowAttrs?: Record<string, any>, options?: TableCellPropertyReadOptions) => TableCellPropertyValues;
|
|
39
|
+
export declare const getTableCellPropertyChanges: (current: TableCellPropertyValues, baseline: TableCellPropertyValues) => TableCellPropertyChanges;
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import type { Node as ProseMirrorNode } from '@tiptap/pm/model';
|
|
2
|
+
import type { EditorState } from '@tiptap/pm/state';
|
|
3
|
+
import { type TableMap } from '@tiptap/pm/tables';
|
|
4
|
+
export type TableResetUpdate = {
|
|
5
|
+
position: number;
|
|
6
|
+
attrs: Record<string, unknown>;
|
|
7
|
+
typeName?: 'tableCell' | 'tableHeader';
|
|
8
|
+
};
|
|
9
|
+
export type TableRowResetContext = {
|
|
10
|
+
tableStart: number;
|
|
11
|
+
map: TableMap;
|
|
12
|
+
rows: number[];
|
|
13
|
+
};
|
|
14
|
+
export declare const getTableRowResetContext: (state: EditorState) => TableRowResetContext | null;
|
|
15
|
+
export declare const getTableCellResetPositions: (state: EditorState) => number[] | null;
|
|
16
|
+
export declare const getTableResetAttributes: (attrs: Record<string, unknown>) => Record<string, unknown>;
|
|
17
|
+
export declare const getTableRowResetUpdates: (doc: ProseMirrorNode, tableStart: number, row: number, map: TableMap) => TableResetUpdate[];
|
|
18
|
+
export declare const getTableRowBorderResetUpdates: (doc: ProseMirrorNode, tableStart: number, row: number, map: TableMap) => TableResetUpdate[];
|
|
19
|
+
export declare const getTableCellSizeResetUpdate: (doc: ProseMirrorNode, cellPosition: number) => TableResetUpdate | null;
|
|
20
|
+
export declare const getTableCellSizeResetUpdates: (doc: ProseMirrorNode, selectedPositions: number[], tableStart?: number, map?: TableMap) => TableResetUpdate[];
|
|
21
|
+
export declare const getTableCellBorderResetUpdate: (doc: ProseMirrorNode, cellPosition: number) => TableResetUpdate | null;
|
|
22
|
+
export declare const getTableCellAlignmentResetUpdates: (doc: ProseMirrorNode, cellPosition: number) => TableResetUpdate[] | null;
|
|
23
|
+
export declare const getTableCellResetUpdates: (doc: ProseMirrorNode, cellPosition: number) => TableResetUpdate[] | null;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
export declare const TABLE_ROW_RESIZE_CURSOR_CLASS = "agile-table-row-resize-cursor";
|
|
2
|
+
type CursorTarget = {
|
|
3
|
+
classList: {
|
|
4
|
+
toggle: (name: string, force?: boolean) => boolean;
|
|
5
|
+
};
|
|
6
|
+
};
|
|
7
|
+
export declare const setTableRowResizeCursor: (target: CursorTarget | null, active: boolean) => void;
|
|
8
|
+
export {};
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import type { Node as ProseMirrorNode } from '@tiptap/pm/model';
|
|
2
|
+
import { type Selection } from '@tiptap/pm/state';
|
|
3
|
+
/**
|
|
4
|
+
* Convert a table's cell offsets into the boundary positions consumed by
|
|
5
|
+
* CellSelection. Select the first and last mapped cells to cover the grid.
|
|
6
|
+
*/
|
|
7
|
+
export declare const getTableContentSelectionPositions: (tableContentStart: number, cellOffsets: readonly number[]) => {
|
|
8
|
+
anchorCell: number;
|
|
9
|
+
headCell: number;
|
|
10
|
+
};
|
|
11
|
+
export type TableSelectionAttributes = {
|
|
12
|
+
table: Record<string, any>;
|
|
13
|
+
row: Record<string, any>;
|
|
14
|
+
cell: Record<string, any>;
|
|
15
|
+
cellType: 'tableCell' | 'tableHeader' | null;
|
|
16
|
+
};
|
|
17
|
+
export declare const getTableSelectionAttributes: (selection: Selection) => TableSelectionAttributes;
|
|
18
|
+
export declare const getTableCellTextSelection: (doc: ProseMirrorNode, position: number) => Selection;
|
|
@@ -13,3 +13,4 @@ export declare const normalizeThousandsGroupSize: (value: unknown) => number;
|
|
|
13
13
|
export declare const normalizeThousandsNumber: (value: unknown) => string;
|
|
14
14
|
/** 按指定分隔符和分组位数格式化数字。 */
|
|
15
15
|
export declare const formatThousandsNumber: (value: unknown, options?: ThousandsFormatOptions) => string;
|
|
16
|
+
export declare const getUniformTextMarks: (doc: any, from: number, to: number, ignoredMarkName?: string) => any;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
export declare const TRACKING_CLASS_NAMES: string[];
|
|
2
|
+
export declare const getTrackingAttributes: (attrs?: Record<string, any>) => {
|
|
3
|
+
'data-track_draft-time'?: any;
|
|
4
|
+
'data-track_draft-user-nickname'?: any;
|
|
5
|
+
'data-track_draft-user-id'?: any;
|
|
6
|
+
'data-track-insert'?: string;
|
|
7
|
+
'data-track-del'?: string;
|
|
8
|
+
};
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* @agilehub/agile-editor 1.8.
|
|
2
|
+
* @agilehub/agile-editor 1.8.5
|
|
3
3
|
* @license Apache-2.0
|
|
4
4
|
* @author undefined undefined
|
|
5
5
|
* @see undefined
|
|
6
6
|
**/
|
|
7
7
|
import "./agile-editor.css";
|
|
8
|
-
import { a as e, n as t } from "./i18n-
|
|
8
|
+
import { a as e, n as t } from "./i18n-DZxiNlPY.js";
|
|
9
9
|
import { createBlock as n, createElementBlock as r, createElementVNode as i, createVNode as a, defineComponent as o, guardReactiveProps as s, markRaw as c, normalizeProps as l, onMounted as u, openBlock as d, ref as f, renderSlot as p, resolveDynamicComponent as m, shallowRef as h, toDisplayString as g, unref as _, withCtx as v } from "vue";
|
|
10
10
|
//#region src/extensions/smart-sheet/viewer.vue?vue&type=script&setup=true&lang.ts
|
|
11
11
|
var y = { class: "agile-smart-sheet-viewer" }, b = {
|