@pixerate/editor 0.24.0 → 0.26.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/README.md +101 -1
- package/THIRD_PARTY_NOTICES.md +40 -0
- package/dist/agent/index.cjs +175 -11
- package/dist/agent/index.cjs.map +1 -1
- package/dist/agent/index.d.cts +18 -4
- package/dist/agent/index.d.ts +18 -4
- package/dist/agent/index.js +168 -4
- package/dist/agent/index.js.map +1 -1
- package/dist/{arrangeShortcuts-B8O3f8-P.d.cts → arrange-BICutYPk.d.cts} +243 -29
- package/dist/{arrangeShortcuts-sLlD2rSX.d.ts → arrange-BICutYPk.d.ts} +243 -29
- package/dist/builtins-CdPcLwwF.d.cts +176 -0
- package/dist/builtins-Chj6zv_O.d.ts +176 -0
- package/dist/canvas/index.cjs +8588 -1857
- package/dist/canvas/index.cjs.map +1 -1
- package/dist/canvas/index.d.cts +1847 -9
- package/dist/canvas/index.d.ts +1847 -9
- package/dist/canvas/index.js +8577 -1846
- package/dist/canvas/index.js.map +1 -1
- package/dist/chunk-3CC7OPUQ.cjs +831 -0
- package/dist/chunk-3CC7OPUQ.cjs.map +1 -0
- package/dist/chunk-4BVP64JJ.cjs +1406 -0
- package/dist/chunk-4BVP64JJ.cjs.map +1 -0
- package/dist/chunk-BVP3TSLH.cjs +69 -0
- package/dist/chunk-BVP3TSLH.cjs.map +1 -0
- package/dist/{chunk-OLZJXL4R.cjs → chunk-CS6NZWWA.cjs} +59 -25
- package/dist/chunk-CS6NZWWA.cjs.map +1 -0
- package/dist/{chunk-MCSJFWAO.cjs → chunk-EWCOFSCQ.cjs} +685 -100
- package/dist/chunk-EWCOFSCQ.cjs.map +1 -0
- package/dist/chunk-HDYMLS3X.cjs +409 -0
- package/dist/chunk-HDYMLS3X.cjs.map +1 -0
- package/dist/chunk-HRMEDT2L.js +1406 -0
- package/dist/chunk-HRMEDT2L.js.map +1 -0
- package/dist/{chunk-D27YFC46.cjs → chunk-IFHKKVXH.cjs} +382 -63
- package/dist/chunk-IFHKKVXH.cjs.map +1 -0
- package/dist/{chunk-PGNZKFQS.js → chunk-JOIREKL7.js} +137 -58
- package/dist/chunk-JOIREKL7.js.map +1 -0
- package/dist/chunk-KRGXUQ2Y.js +1696 -0
- package/dist/chunk-KRGXUQ2Y.js.map +1 -0
- package/dist/{chunk-3LV6RRPH.js → chunk-MHEPLBFB.js} +2 -2
- package/dist/chunk-MR2764X2.js +831 -0
- package/dist/chunk-MR2764X2.js.map +1 -0
- package/dist/{chunk-XNORY7M6.cjs → chunk-NFVBT3UZ.cjs} +166 -87
- package/dist/chunk-NFVBT3UZ.cjs.map +1 -0
- package/dist/chunk-NQF32I6Z.cjs +6478 -0
- package/dist/chunk-NQF32I6Z.cjs.map +1 -0
- package/dist/chunk-O5RYH2PG.js +69 -0
- package/dist/chunk-O5RYH2PG.js.map +1 -0
- package/dist/{chunk-ITBSKI26.js → chunk-Q2OHWD2A.js} +1064 -360
- package/dist/chunk-Q2OHWD2A.js.map +1 -0
- package/dist/{chunk-FODNLX5N.js → chunk-QJSOZFCZ.js} +38 -4
- package/dist/chunk-QJSOZFCZ.js.map +1 -0
- package/dist/{chunk-SML64VJG.cjs → chunk-RRREAOVM.cjs} +4 -4
- package/dist/{chunk-SML64VJG.cjs.map → chunk-RRREAOVM.cjs.map} +1 -1
- package/dist/{chunk-5S3Z4PPF.js → chunk-SWE3NPOU.js} +347 -28
- package/dist/chunk-SWE3NPOU.js.map +1 -0
- package/dist/chunk-TXXNBDQX.cjs +1696 -0
- package/dist/chunk-TXXNBDQX.cjs.map +1 -0
- package/dist/chunk-UBCFIABU.js +409 -0
- package/dist/chunk-UBCFIABU.js.map +1 -0
- package/dist/chunk-X7HXL2SB.js +6478 -0
- package/dist/chunk-X7HXL2SB.js.map +1 -0
- package/dist/{chunk-SBCZ6RN5.cjs → chunk-YOMYSFJU.cjs} +1163 -459
- package/dist/chunk-YOMYSFJU.cjs.map +1 -0
- package/dist/{chunk-3CN2WD3X.js → chunk-ZRNHGAQT.js} +661 -76
- package/dist/chunk-ZRNHGAQT.js.map +1 -0
- package/dist/commands/index.cjs +425 -4
- package/dist/commands/index.cjs.map +1 -1
- package/dist/commands/index.d.cts +39 -77
- package/dist/commands/index.d.ts +39 -77
- package/dist/commands/index.js +424 -3
- package/dist/commands/index.js.map +1 -1
- package/dist/compare/index.cjs +3 -3
- package/dist/compare/index.d.cts +1 -1
- package/dist/compare/index.d.ts +1 -1
- package/dist/compare/index.js +2 -2
- package/dist/controller-CxXGOEmy.d.cts +2038 -0
- package/dist/controller-CxXGOEmy.d.ts +2038 -0
- package/dist/{documents-BQjzJNe2.d.ts → documents-CHT1U5Vs.d.ts} +10 -0
- package/dist/{documents-KRTPhvst.d.cts → documents-Gp7wb0Me.d.cts} +10 -0
- package/dist/export/index.cjs +36 -0
- package/dist/export/index.cjs.map +1 -0
- package/dist/export/index.d.cts +243 -0
- package/dist/export/index.d.ts +243 -0
- package/dist/export/index.js +36 -0
- package/dist/export/index.js.map +1 -0
- package/dist/extensions/index.cjs +101 -6
- package/dist/extensions/index.cjs.map +1 -1
- package/dist/extensions/index.d.cts +18 -5
- package/dist/extensions/index.d.ts +18 -5
- package/dist/extensions/index.js +101 -6
- package/dist/generation/index.cjs +1013 -69
- package/dist/generation/index.cjs.map +1 -1
- package/dist/generation/index.d.cts +474 -13
- package/dist/generation/index.d.ts +474 -13
- package/dist/generation/index.js +976 -32
- package/dist/generation/index.js.map +1 -1
- package/dist/image-editor/index.cjs +3385 -1275
- package/dist/image-editor/index.cjs.map +1 -1
- package/dist/image-editor/index.d.cts +693 -128
- package/dist/image-editor/index.d.ts +693 -128
- package/dist/image-editor/index.js +3325 -1215
- package/dist/image-editor/index.js.map +1 -1
- package/dist/{index-fJrlkJCd.d.ts → index-B273Zllk.d.ts} +500 -7
- package/dist/{index-BhJBSm2d.d.cts → index-jcJwmBYt.d.cts} +500 -7
- package/dist/index.cjs +1603 -45
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +154 -27
- package/dist/index.d.ts +154 -27
- package/dist/index.js +1584 -26
- package/dist/index.js.map +1 -1
- package/dist/mention-text-CDnCFd3c.d.cts +53 -0
- package/dist/mention-text-CDnCFd3c.d.ts +53 -0
- package/dist/model-C1zApQM8.d.cts +219 -0
- package/dist/model-C1zApQM8.d.ts +219 -0
- package/dist/persistence/index.d.cts +3 -120
- package/dist/persistence/index.d.ts +3 -120
- package/dist/registry-CED5C0lA.d.cts +204 -0
- package/dist/registry-CED5C0lA.d.ts +204 -0
- package/dist/{registry-GJI4gToU.d.cts → registry-CEgwXED1.d.cts} +12 -1
- package/dist/{registry-GJI4gToU.d.ts → registry-CEgwXED1.d.ts} +12 -1
- package/dist/{registry-D32LpIc4.d.cts → registry-D0GADKc7.d.cts} +1 -1
- package/dist/{registry-evKTP4ls.d.ts → registry-DhVUZioj.d.ts} +1 -1
- package/dist/serializers/index.cjs +12 -4
- package/dist/serializers/index.cjs.map +1 -1
- package/dist/serializers/index.d.cts +41 -13
- package/dist/serializers/index.d.ts +41 -13
- package/dist/serializers/index.js +12 -4
- package/dist/spreadsheet/index.cjs +157 -3
- package/dist/spreadsheet/index.cjs.map +1 -1
- package/dist/spreadsheet/index.d.cts +534 -11
- package/dist/spreadsheet/index.d.ts +534 -11
- package/dist/spreadsheet/index.js +157 -3
- package/dist/storage-BpFfspHm.d.cts +120 -0
- package/dist/storage-BpFfspHm.d.ts +120 -0
- package/dist/tokens/index.cjs +115 -0
- package/dist/tokens/index.cjs.map +1 -0
- package/dist/tokens/index.d.cts +212 -0
- package/dist/tokens/index.d.ts +212 -0
- package/dist/tokens/index.js +115 -0
- package/dist/tokens/index.js.map +1 -0
- package/dist/{track-changes-BK5sVf4_.d.cts → track-changes-D_VAPELi.d.cts} +95 -11
- package/dist/{track-changes-CDjCrwKe.d.ts → track-changes-Db_fGEvx.d.ts} +95 -11
- package/package.json +15 -1
- package/dist/chunk-3CN2WD3X.js.map +0 -1
- package/dist/chunk-5S3Z4PPF.js.map +0 -1
- package/dist/chunk-D27YFC46.cjs.map +0 -1
- package/dist/chunk-FODNLX5N.js.map +0 -1
- package/dist/chunk-ITBSKI26.js.map +0 -1
- package/dist/chunk-MA2F5KHF.cjs +0 -3223
- package/dist/chunk-MA2F5KHF.cjs.map +0 -1
- package/dist/chunk-MCSJFWAO.cjs.map +0 -1
- package/dist/chunk-OLZJXL4R.cjs.map +0 -1
- package/dist/chunk-PGNZKFQS.js.map +0 -1
- package/dist/chunk-SBCZ6RN5.cjs.map +0 -1
- package/dist/chunk-U5KWZU4X.js +0 -3223
- package/dist/chunk-U5KWZU4X.js.map +0 -1
- package/dist/chunk-XNORY7M6.cjs.map +0 -1
- package/dist/controller-BhLLAoi8.d.cts +0 -1000
- package/dist/controller-BhLLAoi8.d.ts +0 -1000
- package/dist/types-DX4Mh4SL.d.cts +0 -217
- package/dist/types-DX4Mh4SL.d.ts +0 -217
- /package/dist/{chunk-3LV6RRPH.js.map → chunk-MHEPLBFB.js.map} +0 -0
package/dist/index.d.ts
CHANGED
|
@@ -2,27 +2,42 @@ import { b as Token } from './tokens-D7yXvUU6.js';
|
|
|
2
2
|
export { C as ColorGradient, c as ComparisonOperator, d as ConditionComparison, e as ConditionalKind, I as INSTRUCTION_REGEX, a as PromptDiagnostic, f as PromptDiagnosticCode, g as PromptValue, P as PromptValues, h as TEMPLATE_REGEX, T as Template, i as TemplateVersion, j as TokenType, V as VARIABLE_REGEX, k as instructionRegex, t as templateRegex, v as variableRegex } from './tokens-D7yXvUU6.js';
|
|
3
3
|
export { ConditionExpression, ConditionalTagLike, ConditionalTagMatch, DataSourceInput, DataSourceWarning, DataSourceWarningCode, EvaluatedToken, ExtractVariablesOptions, FIELD_ALIASES, FieldMapping, FieldMatch, FieldMatchKind, MAX_DATA_SOURCE_FIELDS, MAX_DATA_SOURCE_RECORDS, MAX_MERGE_LENGTH, MAX_MERGE_OUTPUTS, MatchFieldsOptions, MergeDataSource, MergeDiagnostic, MergeDiagnosticCode, MergeOutput, MergeRecord, MergeRecordsOptions, MergeRecordsResult, MergeSkip, ParseDataSourceOptions, ParsedComparison, ParsedVariableBody, RecordToValuesOptions, ResolvePromptOptions, ResolvePromptResult, TEMPLATE_DEPTH_ERROR, TEMPLATE_LOOP_ERROR, TokenizeResult, VariableDescriptor, VariableFormField, compactVariableValues, compareConditionValues, conditionSubject, describeConditionalTag, detectDelimiter, escapeVariableText, evaluateCondition, evaluateConditionExpression, evaluatePromptTokens, extractVariables, formatComparisonOperand, formatConditionalTag, getLatestVersion, getPromptDiagnostics, getSuppliedValue, getTemplateBody, getVariableFormFields, isPromptValueSet, matchConditionalTags, matchFields, mergeRecords, normalizeFieldKey, normalizeFieldNames, parseComparison, parseConditionExpression, parseDataSource, parseVariableBody, recordToValues, resolvePrompt, serializeMergeOutputs, tokenizePrompt, tokenizePromptWithDiagnostics, unescapeVariableText } from './grammar/index.js';
|
|
4
4
|
export { R as ResolveTemplatesOptions, S as SourceMapSegment, e as extractInstructionNames, a as extractTemplateNames, b as extractVariableNames, m as mapRawOffsetToResolved, c as mapResolvedOffsetToRaw, r as resolveTemplates, d as resolveTemplatesWithMapping, f as resolveVariables } from './sourcemap-DA1Evhrv.js';
|
|
5
|
-
import { D as DocumentImport, a as DocumentImportAdapter } from './index-
|
|
6
|
-
export { A as AddCommentOptions,
|
|
7
|
-
export { B as BLOCK_CHANGE_ATTRIBUTE, D as DELETION_MARK_NAME, F as FORMAT_CHANGE_MARK_NAME, I as INSERTION_MARK_NAME, M as
|
|
5
|
+
import { D as DocumentImport, a as DocumentImportAdapter, P as PdfStructureReport, b as PdfLayoutOptions, c as PdfRuleLine, d as PdfTextRun } from './index-B273Zllk.js';
|
|
6
|
+
export { A as AddCommentOptions, e as Autocorrect, f as AutocorrectContext, g as AutocorrectCorrection, h as AutocorrectOptions, i as AutocorrectRule, j as AutocorrectStorage, B as BUILT_IN_IMPORT_ADAPTERS, k as Bookmark, l as BookmarkInfo, m as BookmarkOptions, C as CHARACTER_STYLE_MARK_NAME, n as COMMENT_MARK_NAME, o as CharacterStyle, p as ColorHighlighter, q as CommentRange, r as Comments, s as CommentsOptions, t as CommentsStorage, u as CompileFindPatternResult, v as CompiledFindPattern, w as CreateImportAdapterRegistryOptions, x as CreateStyleFromSelectionOptions, y as CrossReference, z as CrossReferenceOptions, E as CrossReferenceTarget, F as CrossReferenceTargetType, G as DEFAULT_AUTOCORRECT_EXCEPTIONS, H as DEFAULT_TABLE_OPTIONS, I as DEFAULT_TABLE_TOOLBAR, J as DocumentCompare, K as DocumentCompareOptions, L as DocumentCompareStorage, M as DocumentSearchOptions, N as DocumentSearchResult, O as DocumentStructureCommandArgs, Q as DocumentStructureCommandItem, R as EMPTY_FIND_REPLACE_SNAPSHOT, S as EMPTY_TABLE_STATE, T as EditorCompareOptions, U as FIND_OPTION_TOGGLES, V as FIND_PARAGRAPH_MARK, W as FileImport, X as FileImportOptions, Y as FindAllOptions, Z as FindAllResult, _ as FindMatch, $ as FindOptionToggle, a0 as FindOptions, a1 as FindPatternError, a2 as FindPatternErrorCode, a3 as FindReplace, a4 as FindReplaceCommandOptions, a5 as FindReplaceMode, a6 as FindReplaceOptions, a7 as FindReplaceSnapshot, a8 as FindReplaceStorage, a9 as FindReplaceStore, aa as FocusHeadingOptions, ab as FontSize, ac as Footnote, ad as FootnoteInfo, ae as FootnoteReference, af as Footnotes, ag as FootnotesOptions, ah as GradientText, ai as GradientTextOptions, aj as Image, ak as ImageOptions, al as ImportStructureItem, am as ImportStructureReport, an as InsertFootnoteOptions, ao as InsertTableOfContentsOptions, ap as LoadingNode, aq as MAX_FIND_PATTERN_LENGTH, ar as MAX_TABLE_COLUMNS, as as MAX_TABLE_ROWS, at as Markdown, au as OpenFindReplaceParams, av as Outline, aw as OutlineHeading, ax as OutlineOptions, ay as OutlineSnapshot, az as OutlineStorage, aA as OutlineStore, aB as OutlineTreeItem, aC as ParagraphStyles, aD as ParagraphStylesOptions, aE as ParagraphStylesSnapshot, aF as ParagraphStylesStorage, aG as ParagraphStylesStore, aH as PatternMatch, aI as PdfLayoutBlock, aJ as PdfLayoutPage, aK as PdfLayoutResult, aL as PdfTableCell, aM as ReplacePiece, aN as RichClipboard, aO as RichClipboardOptions, aP as RichClipboardStorage, aQ as RichTextPresetCommandPackages, aR as RichTextPresetOptions, aS as RichTextTableOptions, aT as RunTableActionOptions, aU as SMILIE_REPLACEMENTS, aV as STYLE_ID_ATTRIBUTE, aW as SearchBudget, aX as SearchBudgetOptions, aY as SetBookmarkOptions, aZ as SetSearchParams, a_ as SlashCommandMatchData, a$ as SlashCommands, b0 as SlashCommandsOptions, b1 as SmilieReplacer, b2 as TABLE_ACTIONS, b3 as Table, b4 as TableAction, b5 as TableActionInfo, b6 as TableActionParams, b7 as TableActionStatus, b8 as TableCell, b9 as TableCellAlignment, ba as TableCommandOptions, bb as TableHeader, bc as TableOfContents, bd as TableOfContentsEntry, be as TableOfContentsOptions, bf as TableRow, bg as TableState, bh as TableStore, bi as TableToolbarItem, bj as TemplateSuggestions, bk as TemplateSuggestionsOptions, bl as analyzePdfLayout, bm as applyDocumentComparison, bn as applyReplacements, bo as autocorrectPluginKey, bp as buildOutlineTree, bq as capitalizeSentenceRules, br as captureSelectionFormat, bs as commentsPluginKey, bt as compareInEditor, bu as compileFindPattern, bv as computeOutline, bw as createFindReplaceCommands, bx as createImportAdapterRegistry, by as createOutlineStore, bz as createParagraphStylesStore, bA as createRichTextPreset, bB as createSearchBudget, bC as createTableCommands, bD as createTableExtensions, bE as createTableStore, bF as crossReferencePluginKey, bG as defaultAutocorrectRules, bH as defaultImportRegistry, bI as documentStructureCommandItems, bJ as expandReplacement, bK as fileImportPluginKey, bL as findAllMatches, bM as findAutocorrection, bN as findCommentRanges, bO as findHexColors, bP as findImportAdapter, bQ as findReplacePluginKey, bR as foldCodePoint, bS as footnotesMarkdownIt, bT as footnotesPluginKey, bU as formatFindStatus, bV as fractionRules, bW as getActiveHeading, bX as getBookmarks, bY as getCommentAnchors, bZ as getCommentAuthor, b_ as getCommentIdsAt, b$ as getCommentStore, c0 as getCrossReferenceTargets, c1 as getDocumentStructureCommandItems, c2 as getFindReplaceState, c3 as getFindReplaceStore, c4 as getFootnotes, c5 as getImportAccept, c6 as getOutline, c7 as getParagraphStyleAt, c8 as getStyleRegistry, c9 as getTableActionState, ca as getTableOfContentsEntries, cb as getTableState, cc as handleImageInsertion, cd as htmlImportAdapter, ce as imagePastePluginKey, cf as importFile, cg as insertImageNode, ch as isGfmTable, ci as isInsidePromptToken, cj as isParagraphStyleAvailable, ck as isSelectionInTable, cl as isTableEnabled, cm as markdownImportAdapter, cn as navigateToHeading, co as normalizeTableCellAlignment, cp as normalizeTableCellColor, cq as outlinePluginKey, cr as paragraphStylesPluginKey, cs as parseReplacement, ct as pdfLayoutBlocksToHtml, cu as plainTextImportAdapter, cv as registerImportAdapter, cw as removeImageNode, cx as richClipboardPluginKey, cy as rtfImportAdapter, cz as runTableAction, cA as searchDocument, cB as shouldShowTableBubbleMenu, cC as smartQuoteRules, cD as smilieAutocorrectRules, cE as symbolRules, cF as syncFootnotes, cG as tableOfContentsMarkdownIt, cH as tableOfContentsPluginKey, cI as twoInitialCapitalsRules, cJ as unregisterImportAdapter, cK as updateImageSrc, cL as validateFindPattern, cM as writeRichClipboard } from './index-B273Zllk.js';
|
|
7
|
+
export { B as BLOCK_CHANGE_ATTRIBUTE, D as DELETION_MARK_NAME, F as FORMAT_CHANGE_MARK_NAME, I as INSERTION_MARK_NAME, M as MOVE_FROM_CLASS, a as MOVE_ID_ATTRIBUTE, b as MOVE_TO_CLASS, c as Mention, d as MentionEntity, e as MentionNodeInfo, f as MentionOptions, T as TRACK_CHANGES_SKIP_META, g as TrackChanges, h as TrackChangesOptions, i as TrackChangesSnapshot, j as TrackChangesStorage, k as TrackChangesStore, l as TrackedBlockChangeAttributes, m as TrackedBlockOperation, n as TrackedBlockSnapshot, o as TrackedChange, p as TrackedChangeAttributes, q as TrackedChangeType, r as TrackedChangesView, s as TrackedDeletion, t as TrackedFormatChange, u as TrackedFormatChangeAttributes, v as TrackedFormatSummary, w as TrackedInsertion, x as TrackedMark, y as createMentionExtension, z as describeBlockChange, A as describeFormatChange, C as getMentionNodes, E as getTrackChangesStore, G as getTrackedChangeAt, H as getTrackedChanges, J as isMoveSized, K as isTrackChangesEnabled, L as resolveTrackedChanges, N as setMentionRoleAt, O as trackChangesPluginKey, P as trackedChangeLabel } from './track-changes-Db_fGEvx.js';
|
|
8
8
|
export { C as CommentAnchor, a as CommentReply, b as CommentStore, c as CommentStoreListener, d as CommentStoreOptions, e as CommentStoreSnapshot, f as CommentThread, g as CreateThreadInput, R as ReviewAuthor, S as SerializedComments, h as createCommentStore, i as createReviewId, j as formatReviewTime } from './comment-store-BEMgVlAA.js';
|
|
9
|
-
export {
|
|
9
|
+
export { C as CharacterFormat, D as DEFAULT_STYLES, N as NORMAL_STYLE_ID, P as ParagraphFormat, R as ResolvedStyle, S as StyleBlock, a as StyleCSSOptions, b as StyleDefaults, c as StyleDefinition, d as StyleKind, e as StyleRegistry, f as StyleRegistryJSON, g as StyleRegistryOptions, h as StyleRegistrySnapshot, i as createStyleRegistry, j as isValidStyleId, s as safeCSSValue } from './registry-CED5C0lA.js';
|
|
10
|
+
export { ClipboardDataLike, ExtractMentionsOptions, ExtractedMention, MARKDOWN_MENTION_SPLIT_REGEX, MarkdownToHtmlOptions, MentionDetail, MentionSegment, PIXERATE_DOCUMENT_MIME, PlainTextOptions, PreprocessMarkdownMentionsOptions, RichClipboardPayload, SanitizeHtmlOptions, escapeHtml, extractMentions, extractMentionsFromDoc, getClipboardData, getEditorMarkdown, getEditorText, getSchemaSignature, htmlToPlainText, markdownToTipTapHtml, parseMentionSegments, parseRichClipboardPayload, plainTextToParagraphHtml, plainTextToSlice, plainTextToTipTapHtml, preprocessMarkdownFileLinks, preprocessMarkdownMentions, readRichClipboard, rtfToPlainText, sanitizeHtml, sanitizeImportedHtml, serializeRichClipboardPayload, stripMarkdownCode } from './serializers/index.js';
|
|
10
11
|
import { Editor, EditorOptions, Content, Extensions } from '@tiptap/core';
|
|
11
12
|
export { Content, Editor, EditorOptions, Extensions } from '@tiptap/core';
|
|
12
|
-
export { A as ASTNode, B as BinaryOpNode, C as CellCoordinate, a as CellData, b as CellDep, c as CellFormat, d as CellPosition, e as CellRange, f as CellRefNode, g as CellValueReader, h as ColumnBinding, i as ColumnType, j as
|
|
13
|
-
export { CellInputFormatKind, CsvParseOptions, CsvSerializeOptions, FillDirection, FormattedNumberValue, FormulaActiveCall, FormulaArgument, FormulaArgumentSpec, FormulaArgumentType, FormulaCaretContext, FormulaCriteriaPredicate, FormulaFunctionCategory, FormulaFunctionContext, FormulaFunctionDefinition, FormulaFunctionSuggestion, FormulaHints, FormulaSignaturePart, ImportFileIntoSpreadsheetOptions, MAX_NUMBER_FORMAT_CODE_CHARS, NUMBER_FORMAT_PRESETS, NumberFormat, NumberFormatColor, NumberFormatKind, NumberFormatPreset, ParsedCellInput, SPREADSHEET_IMPORT_ADAPTERS, SPREADSHEET_TABLE_ACTIONS, SpreadsheetImport, SpreadsheetImportAdapter, SpreadsheetMenuItem, SpreadsheetTableActionName, SpreadsheetTableActions, aggregateValues, applyFormulaSuggestion, bindSpreadsheetTableActions, builtinNumberFormat, builtinNumberFormatId, cellFormatForNumberFormat, checkFormulaArgumentCount, clampMenuPosition, clearNumberFormatCache, compareCellValues, computeFillTarget, csvImportAdapter, dateValueToSerial, escapeCsvField, fillSeries, formatCellDisplay, formatCellForDisplay, formatGeneralFit, formatNumberFormatValue, formatTextFunction, formatValueWithCode, getFillDirection, getFormulaArgumentSpecIndex, getFormulaCaretContext, getFormulaFunction, getFormulaHints, getFormulaSignature, getFormulaSignatureParts, getSpreadsheetMenuItems, importFileIntoSpreadsheet, isBlankValue, isGeneralNumberFormat, isSingleCellRange, listFormulaFunctions, matchesFilterRule, normalizeRange, numberFormatColorToCss, numberFormatForCellFormat, parseCellInput, parseCriteria, parseCsv, parseNumberText, parseTsv, rangeContains, rangeContainsRange, rangesIntersect, registerFormulaFunction, registerSpreadsheetImportAdapters, roundFloat, runSpreadsheetMenuItem, searchFormulaFunctions, serialFromYmd, serializeCsv, serializeTsv, toNumber, tsvImportAdapter, unregisterFormulaFunction, wildcardToRegExp } from './spreadsheet/index.js';
|
|
13
|
+
export { A as ASTNode, B as BinaryOpNode, C as CellCoordinate, a as CellData, b as CellDep, c as CellFormat, d as CellPosition, e as CellRange, f as CellRefNode, g as CellValueReader, h as ColumnBinding, i as ColumnType, j as ConditionalCellFormat, k as ConditionalFormatCondition, l as ConditionalFormatIconSet, m as ConditionalFormatOperator, n as ConditionalFormatOverlay, o as ConditionalFormatRule, p as ConditionalFormatSheet, q as ConditionalFormatStyle, r as ConditionalFormatTimePeriod, s as ConditionalFormatType, t as ConditionalFormatValue, u as CsvExportOptions, v as CsvImportOptions, D as DEFAULT_COLUMN_WIDTH, w as DEFAULT_ROW_HEIGHT, x as DataSourceBinder, y as DataValidationErrorStyle, z as DataValidationOperator, E as DataValidationResult, F as DataValidationRule, G as DataValidationSheet, H as DataValidationType, I as DependencyGraph, J as DependencyIndexStats, K as EvaluationContext, L as FORMULA_ERRORS, M as FilterOperator, N as FilterRule, O as FormulaDiagnostic, P as FormulaErrorCode, Q as FormulaEvaluationResult, R as FormulaEvaluator, T as FormulaNameDefinition, U as FormulaParser, V as FormulaRange, W as FormulaReferenceFilter, X as FormulaReferenceInfo, Y as FormulaToken, Z as FormulaTokenType, _ as FunctionCallNode, $ as GroupAggregate, a0 as GroupSummary, a1 as IntervalIndex, a2 as InvokeNode, a3 as LiteralNode, a4 as MAX_FORMULA_ARRAY_SIZE, a5 as MissingNode, a6 as NameDep, a7 as NameNode, a8 as NewConditionalFormatRule, a9 as NewDataValidationRule, aa as NewFilterRule, ab as ParsedSpreadsheetClipboard, ac as PropertyRefNode, ad as RangeNode, ae as RangeResolveOptions, af as ReferenceDep, ag as RowType, ah as SPREADSHEET_CLIPBOARD_MIME, ai as SheetQualifier, aj as SortDirection, ak as SortKey, al as SpillRefNode, am as SpreadsheetCellSpan, an as SpreadsheetClipboardCell, ao as SpreadsheetClipboardData, ap as SpreadsheetClipboardPayload, aq as SpreadsheetClipboardSource, ar as SpreadsheetColumn, as as SpreadsheetCommitResult, S as SpreadsheetController, at as SpreadsheetControllerOptions, au as SpreadsheetDataSource, av as SpreadsheetDataSourceField, aw as SpreadsheetDefinedName, ax as SpreadsheetDocument, ay as SpreadsheetFilterState, az as SpreadsheetGrouping, aA as SpreadsheetNameInfo, aB as SpreadsheetNameScope, aC as SpreadsheetRecalculationStats, aD as SpreadsheetRow, aE as SpreadsheetRowGroup, aF as SpreadsheetRowSection, aG as SpreadsheetSheetInfo, aH as SpreadsheetSpill, aI as SpreadsheetTableSettings, aJ as SpreadsheetValidationAction, aK as SpreadsheetValidationPrompt, aL as SpreadsheetViewColumn, aM as SpreadsheetViewModel, aN as SpreadsheetViewRow, aO as SpreadsheetWorkbook, aP as StructuralChange, aQ as UnaryOpNode, aR as WHOLE_COLUMN_END_ROW, aS as buildSpreadsheetView, aT as colNameToIndex, aU as columnDependencyKey, aV as compareNumbers, aW as compareValues, aX as computeRowGroups, aY as createSpreadsheetClipboardData, aZ as deleteSheetInFormula, a_ as describeFormulaError, a$ as extractCellDependencies, b0 as extractNameDependencies, b1 as extractReferenceDependencies, b2 as formatSheetPrefix, b3 as formulaIdentifiers, b4 as getRowSection, b5 as getTableSections, b6 as indexToColName, b7 as isFormulaError, b8 as mapFormulaReferences, b9 as numberToText, ba as offsetFormulaReferences, bb as parseCellReference, bc as parseFormula, bd as parseHtmlTable, be as parseRange, bf as quoteSheetName, bg as rangeDependencyKey, bh as readSpreadsheetClipboard, bi as rebaseClipboardRows, bj as remapFormulaReferences, bk as renameNameInFormula, bl as renameSheetInFormula, bm as rowPassesFilters, bn as serializeHtmlTable, bo as sheetNameNeedsQuotes, bp as shiftFormulaReferences, bq as sortCompareValues, br as tokenizeFormula } from './controller-CxXGOEmy.js';
|
|
14
|
+
export { CONDITIONAL_FORMAT_ICON_SETS, CONDITIONAL_FORMAT_PRESETS, CONDITIONAL_FORMAT_STYLE_PRESETS, CONDITIONAL_FORMAT_TIME_PERIODS, CellInputFormatKind, ConditionalFormatCss, ConditionalFormatEngine, ConditionalFormatIconGlyph, ConditionalFormatPresetField, ConditionalFormatPresetInfo, ConditionalFormatPresetInput, ConditionalFormatPresetKind, CsvParseOptions, CsvSerializeOptions, DATA_VALIDATION_ERROR_STYLE_OPTIONS, DATA_VALIDATION_OPERATOR_OPTIONS, DATA_VALIDATION_TYPE_OPTIONS, DEFAULT_CONDITIONAL_FORMAT_STYLE, DEFAULT_DATA_VALIDATION_MESSAGE, DEFAULT_DATA_VALIDATION_TITLE, EMPTY_CONDITIONAL_FORMAT_OVERLAY, FillDirection, FormattedNumberValue, FormulaActiveCall, FormulaArgument, FormulaArgumentSpec, FormulaArgumentType, FormulaCaretContext, FormulaCriteriaPredicate, FormulaEnvironment, FormulaFunctionCategory, FormulaFunctionContext, FormulaFunctionDefinition, FormulaFunctionSuggestion, FormulaHints, FormulaLambda, FormulaNameSuggestionSource, FormulaSignaturePart, ImportFileIntoSpreadsheetOptions, MAX_DEFINED_NAME_LENGTH, MAX_LAMBDA_DEPTH, MAX_NUMBER_FORMAT_CODE_CHARS, MAX_SHEET_NAME_LENGTH, NUMBER_FORMAT_PRESETS, NumberFormat, NumberFormatColor, NumberFormatKind, NumberFormatPreset, ParsedCellInput, SPREADSHEET_COLUMN_HEADER_HEIGHT, SPREADSHEET_DEFAULT_VIEWPORT, SPREADSHEET_GROUP_ROW_HEIGHT, SPREADSHEET_IMPORT_ADAPTERS, SPREADSHEET_ROW_HEADER_WIDTH, SPREADSHEET_TABLE_ACTIONS, SPREADSHEET_VIRTUAL_COLUMN_THRESHOLD, SPREADSHEET_VIRTUAL_ROW_THRESHOLD, SpreadsheetImport, SpreadsheetImportAdapter, SpreadsheetMenuItem, SpreadsheetNameRow, SpreadsheetPanelId, SpreadsheetTableActionName, SpreadsheetTableActions, SpreadsheetViewMetrics, SpreadsheetViewWindow, SpreadsheetViewWindowOptions, SpreadsheetViewport, adjustRangeForStructuralChange, adjustRangesForStructuralChange, aggregateValues, applyFormulaSuggestion, bindSpreadsheetTableActions, blendConditionalFormatColors, builtinNumberFormat, builtinNumberFormatId, cellFormatForNumberFormat, checkFormulaArgumentCount, clampMenuPosition, clearNumberFormatCache, compareCellValues, computeFillTarget, conditionalFormatContrastColor, conditionalFormatIconCount, conditionalFormatNumber, conditionalFormatStyleString, copySheetName, createConditionalFormatRule, csvImportAdapter, dateValueToSerial, defaultIconThresholds, describeConditionalFormat, describeDataValidation, escapeCsvField, evaluateConditionalFormats, fillSeries, findDataValidation, findInvalidCells, forEachRangeCell, formatCellDisplay, formatCellForDisplay, formatGeneralFit, formatNumberFormatValue, formatRuleRanges, formatTextFunction, formatValueWithCode, fullSpreadsheetViewWindow, getConditionalFormatCss, getConditionalFormatIcon, getDataBarCss, getFillDirection, getFormulaArgumentSpecIndex, getFormulaCaretContext, getFormulaFunction, getFormulaHints, getFormulaSignature, getFormulaSignatureParts, getNameManagerRows, getSheetTabMenuItems, getSpreadsheetMenuItems, getSpreadsheetScrollToCell, getSpreadsheetViewWindow, getValidationListValues, importFileIntoSpreadsheet, isBlankValue, isFormulaLambda, isGeneralNumberFormat, isLambdaDefinition, isSingleCellRange, listFormulaFunctions, matchesFilterRule, matchesTimePeriod, measureSpreadsheetView, nextSheetName, normalizeRange, numberFormatColorToCss, numberFormatForCellFormat, parseCellInput, parseCriteria, parseCsv, parseNumberText, parseRuleRanges, parseTsv, rangeContains, rangeContainsRange, rangesContain, rangesIntersect, registerFormulaFunction, registerSpreadsheetImportAdapters, roundFloat, ruleAnchor, ruleFormulaAt, runSpreadsheetMenuItem, sameSpreadsheetViewWindow, searchFormulaFunctions, serialFromYmd, serializeCsv, serializeTsv, sheetDropIndex, shiftRuleFormula, shouldVirtualizeSpreadsheet, subtractRange, subtractRangeFromRanges, toNumber, tsvImportAdapter, unregisterFormulaFunction, validateCellInput, validateDefinedName, validateSheetName, wildcardToRegExp } from './spreadsheet/index.js';
|
|
14
15
|
export { BindDirtyToHistoryOptions, DirtyHistorySource, DirtyTracker, DirtyTrackerOptions, HistoryDirtyBinding, HistoryManager, bindDirtyToHistory, createDirtyTracker, createHistoryManager, defaultIsEqual, withoutDirty } from './history/index.js';
|
|
15
16
|
export { C as Command, a as HistoryEntry, b as HistoryManagerOptions, c as HistoryMark, H as HistoryState, M as MergedExecutionOptions, S as SnapshotCommandOptions } from './types-GT5a5YAX.js';
|
|
16
|
-
import { I as ImportAdapterRegistry, a as ImportOutcome, F as FileLike } from './registry-
|
|
17
|
-
export {
|
|
17
|
+
import { I as ImportAdapterRegistry, a as ImportOutcome, F as FileLike, b as ImportAdapter } from './registry-CEgwXED1.js';
|
|
18
|
+
export { c as FindImportAdapterQuery, d as ImportContext, e as ImportError, f as ImportErrorCode, g as ImportFileOptions, h as ImportInput, i as ImportTarget, R as RegisterImportAdapterOptions, j as createImportContext } from './registry-CEgwXED1.js';
|
|
18
19
|
import { Schema, Slice } from '@tiptap/pm/model';
|
|
19
20
|
import { EditorView } from '@tiptap/pm/view';
|
|
20
21
|
export { DiffChange, DiffOpType, DiffRun, DiffSequencesOptions, diffChanges, diffSequences } from './compare/index.js';
|
|
21
|
-
export { C as CompareDocumentsOptions, a as CompareDocumentsResult, b as CompareSource, c as CompareSummary, d as compareDocuments, e as compareHtml } from './documents-
|
|
22
|
+
export { C as CompareDocumentsOptions, a as CompareDocumentsResult, b as CompareSource, c as CompareSummary, d as compareDocuments, e as compareHtml } from './documents-CHT1U5Vs.js';
|
|
23
|
+
export { DOCX_ANONYMOUS_AUTHOR, DOCX_EXPORT_MIME_TYPE, DocxCommentSource, DocxExportController, DocxExportControllerOptions, DocxExportEditorLike, DocxExportIssue, DocxExportIssueKind, DocxExportOptions, DocxExportReport, DocxExportResult, DocxExportState, DocxJSONMark, DocxJSONNode, DocxPackagePart, XmlAttrs, XmlWriter, ZipWriteEntry, ZipWriteOptions, createDocxExportController, createDocxParts, deflateRaw, docxFileName, downloadBlob, escapeXmlAttr, escapeXmlText, exportDocx, exportDocxBlob, stripInvalidXmlChars, writeZip } from './export/index.js';
|
|
24
|
+
export { M as MENTION_REGEX, a as MentionRoleSyntax, T as TextMention, f as findTextMentions, b as formatMentionText, s as setMentionRoleInText } from './mention-text-CDnCFd3c.js';
|
|
22
25
|
export { MarkdownOptions } from 'tiptap-markdown';
|
|
23
26
|
import '@tiptap/pm/state';
|
|
27
|
+
import '@tiptap/extension-table-cell';
|
|
28
|
+
import '@tiptap/extension-table-header';
|
|
29
|
+
import '@tiptap/extension-table-row';
|
|
30
|
+
import '@tiptap/extension-table';
|
|
31
|
+
import '@tiptap/extension-underline';
|
|
32
|
+
import '@tiptap/extension-text-style';
|
|
33
|
+
import '@tiptap/extension-text-align';
|
|
34
|
+
import '@tiptap/extension-task-list';
|
|
35
|
+
import '@tiptap/extension-link';
|
|
24
36
|
import '@tiptap/extension-image';
|
|
25
|
-
import '
|
|
37
|
+
import '@tiptap/extension-highlight';
|
|
38
|
+
import '@tiptap/extension-color';
|
|
39
|
+
import '@tiptap/starter-kit';
|
|
40
|
+
import './registry-DhVUZioj.js';
|
|
26
41
|
import './schema-DYDGdYL9.js';
|
|
27
42
|
import '@tiptap/extension-mention';
|
|
28
43
|
import '@tiptap/suggestion';
|
|
@@ -138,9 +153,25 @@ interface InsertImportedDocumentOptions {
|
|
|
138
153
|
* the position right after the inserted content.
|
|
139
154
|
*/
|
|
140
155
|
declare function insertImportedDocument(target: ImportEditorTarget, content: DocumentImport, options?: InsertImportedDocumentOptions): number;
|
|
156
|
+
/**
|
|
157
|
+
* Loads the review data of an import (DOCX comments and styles) into an
|
|
158
|
+
* editor: threads are added to the `Comments` extension's store (existing
|
|
159
|
+
* threads are kept) and styles the `ParagraphStyles` registry does not have
|
|
160
|
+
* yet are added. Call it after inserting `content.html`;
|
|
161
|
+
* `importFilesIntoEditor` does so for editors. Returns how many threads and
|
|
162
|
+
* styles were added.
|
|
163
|
+
*/
|
|
164
|
+
declare function applyImportedReviewData(editor: {
|
|
165
|
+
storage?: unknown;
|
|
166
|
+
} | null | undefined, content: DocumentImport): {
|
|
167
|
+
comments: number;
|
|
168
|
+
styles: number;
|
|
169
|
+
};
|
|
141
170
|
interface ImportFilesIntoEditorOptions extends InsertImportedDocumentOptions {
|
|
142
171
|
/** Registry to match files against (default: the shared default registry). */
|
|
143
172
|
registry?: ImportAdapterRegistry;
|
|
173
|
+
/** Per-adapter options keyed by adapter id, e.g. `{ pdf: { structure: false } }` (see `ImportFileOptions`). */
|
|
174
|
+
adapterOptions?: Record<string, unknown>;
|
|
144
175
|
/** Called after each file is inserted. */
|
|
145
176
|
onImport?: (outcome: ImportOutcome<DocumentImport>, file: FileLike) => void;
|
|
146
177
|
/** Called for each file that cannot be imported; other files continue. */
|
|
@@ -198,6 +229,26 @@ declare class FileImportController {
|
|
|
198
229
|
openFilePicker: () => Promise<ImportOutcome<DocumentImport>[]>;
|
|
199
230
|
}
|
|
200
231
|
declare function createFileImportController(getTarget: () => ImportEditorTarget | null | undefined, options?: FileImportControllerOptions): FileImportController;
|
|
232
|
+
/** Totals of the structure reports (`DocumentImport.structure`) of several imports. */
|
|
233
|
+
interface ImportStructureSummary {
|
|
234
|
+
/** Imports that carried a report. */
|
|
235
|
+
files: number;
|
|
236
|
+
/** `"mixed"` when some files were imported with structure detection and some without. */
|
|
237
|
+
mode: "structured" | "plain" | "mixed";
|
|
238
|
+
headings: number;
|
|
239
|
+
lists: number;
|
|
240
|
+
tables: number;
|
|
241
|
+
paragraphs: number;
|
|
242
|
+
multiColumnPages: number;
|
|
243
|
+
/** Mean of the reports' confidences (0–1). */
|
|
244
|
+
confidence: number;
|
|
245
|
+
}
|
|
246
|
+
/**
|
|
247
|
+
* Sums the structure reports of import outcomes, e.g. `lastOutcomes` from a
|
|
248
|
+
* file-import controller. Returns `null` when no outcome has a report (only
|
|
249
|
+
* structure-aware adapters such as PDF produce one).
|
|
250
|
+
*/
|
|
251
|
+
declare function summarizeImportStructure(outcomes: readonly ImportOutcome<DocumentImport>[]): ImportStructureSummary | null;
|
|
201
252
|
|
|
202
253
|
/**
|
|
203
254
|
* Minimal, dependency-free ZIP reader used by the DOCX and zipped-export
|
|
@@ -322,8 +373,19 @@ declare function readZip(data: ArrayBuffer | ArrayBufferView, options?: ZipReadO
|
|
|
322
373
|
* data URLs. The result goes through `sanitizeImportedHtml`.
|
|
323
374
|
*
|
|
324
375
|
* Tracked changes are imported as if accepted (`w:ins` kept, `w:del` dropped)
|
|
325
|
-
* unless `trackedChanges: "original"` is passed
|
|
326
|
-
*
|
|
376
|
+
* unless `trackedChanges: "original"` is passed; `trackedChanges: "marks"`
|
|
377
|
+
* keeps them as track-changes marks (`<ins>` / `<del>` with authors, dates and
|
|
378
|
+
* move ids, formatting changes from `w:rPrChange`, block changes from
|
|
379
|
+
* `w:pPrChange`).
|
|
380
|
+
*
|
|
381
|
+
* Comments (`comments.xml`, with replies and resolved state from
|
|
382
|
+
* `commentsExtended.xml` and author ids from `people.xml`) are returned as
|
|
383
|
+
* `comments`, and their ranges are marked with `data-comment-id`. The
|
|
384
|
+
* paragraph and character styles of `styles.xml` are returned as a style
|
|
385
|
+
* registry (`styles`), and body paragraphs with a custom style get
|
|
386
|
+
* `data-style`. Paragraphs in the `Block Text` style become block quotes, and
|
|
387
|
+
* paragraphs in the `Code` style code blocks. Text boxes, charts, shapes,
|
|
388
|
+
* equations and page layout are not imported.
|
|
327
389
|
*/
|
|
328
390
|
declare const DOCX_MIME_TYPES: readonly ["application/vnd.openxmlformats-officedocument.wordprocessingml.document", "application/vnd.openxmlformats-officedocument.wordprocessingml.template", "application/vnd.ms-word.document.macroenabled.12"];
|
|
329
391
|
interface DocxImportOptions {
|
|
@@ -338,9 +400,14 @@ interface DocxImportOptions {
|
|
|
338
400
|
};
|
|
339
401
|
/**
|
|
340
402
|
* Tracked changes: `"accepted"` (default) imports insertions and drops
|
|
341
|
-
* deletions; `"original"` does the opposite (as if all were rejected)
|
|
403
|
+
* deletions; `"original"` does the opposite (as if all were rejected);
|
|
404
|
+
* `"marks"` keeps both as track-changes marks (for editors with `TrackChanges`).
|
|
342
405
|
*/
|
|
343
|
-
trackedChanges?: "accepted" | "original";
|
|
406
|
+
trackedChanges?: "accepted" | "original" | "marks";
|
|
407
|
+
/** Import comments and mark their ranges (default `true`). */
|
|
408
|
+
comments?: boolean;
|
|
409
|
+
/** Return the file's styles as `styles` and add `data-style` to styled paragraphs (default `true`). */
|
|
410
|
+
paragraphStyles?: boolean;
|
|
344
411
|
/** Embed images from `word/media` as data URLs (default `true`). */
|
|
345
412
|
images?: boolean;
|
|
346
413
|
/** Images larger than this many bytes are skipped (default 10 MiB). */
|
|
@@ -350,9 +417,9 @@ interface DocxImportOptions {
|
|
|
350
417
|
}
|
|
351
418
|
declare const DEFAULT_DOCX_MAX_IMAGE_SIZE: number;
|
|
352
419
|
/**
|
|
353
|
-
* Converts a DOCX file to sanitized TipTap HTML and plain text
|
|
354
|
-
* {@link ImportError} (`invalid_file` /
|
|
355
|
-
* `ZipError` for damaged or oversized containers.
|
|
420
|
+
* Converts a DOCX file to sanitized TipTap HTML and plain text, plus its
|
|
421
|
+
* comments and styles. Throws {@link ImportError} (`invalid_file` /
|
|
422
|
+
* `unsupported_environment`) or `ZipError` for damaged or oversized containers.
|
|
356
423
|
*/
|
|
357
424
|
declare function docxToDocumentImport(data: ArrayBuffer | ArrayBufferView, options?: DocxImportOptions): Promise<DocumentImport>;
|
|
358
425
|
/** Creates a DOCX `document` adapter with custom options. */
|
|
@@ -361,19 +428,22 @@ declare function createDocxImportAdapter(options?: DocxImportOptions): DocumentI
|
|
|
361
428
|
declare const docxImportAdapter: DocumentImportAdapter;
|
|
362
429
|
|
|
363
430
|
/**
|
|
364
|
-
* PDF
|
|
365
|
-
*
|
|
366
|
-
*
|
|
431
|
+
* PDF import through an injected pdf.js-compatible library. The editor ships
|
|
432
|
+
* no PDF parser; consumers that already bundle `pdfjs-dist` register the
|
|
433
|
+
* adapter themselves:
|
|
367
434
|
*
|
|
368
435
|
* ```ts
|
|
369
436
|
* import * as pdfjs from "pdfjs-dist";
|
|
370
437
|
* registerImportAdapter(createPdfImportAdapter(pdfjs));
|
|
371
438
|
* ```
|
|
372
439
|
*
|
|
373
|
-
*
|
|
374
|
-
*
|
|
375
|
-
*
|
|
376
|
-
*
|
|
440
|
+
* By default the text runs (with positions and fonts) and the page's ruling
|
|
441
|
+
* lines go through `analyzePdfLayout`, which recovers reading order across
|
|
442
|
+
* columns, headings, lists and tables, and drops running headers, footers and
|
|
443
|
+
* page numbers. `structure: false` (at creation, or per import through
|
|
444
|
+
* `adapterOptions: { pdf: { structure: false } }`) falls back to plain
|
|
445
|
+
* paragraphs: items grouped into lines by baseline and lines into paragraphs
|
|
446
|
+
* by vertical gaps. Images, links and character styling are not imported.
|
|
377
447
|
*/
|
|
378
448
|
/** A text item from `page.getTextContent()` (marked-content items have no `str`). */
|
|
379
449
|
interface PdfJsTextItem {
|
|
@@ -384,14 +454,32 @@ interface PdfJsTextItem {
|
|
|
384
454
|
height?: number;
|
|
385
455
|
/** pdf.js sets this when a line break follows the item. */
|
|
386
456
|
hasEOL?: boolean;
|
|
457
|
+
/** Font resource id, e.g. `g_d0_f1` (see `PdfJsTextContent.styles` and `page.commonObjs`). */
|
|
458
|
+
fontName?: string;
|
|
387
459
|
}
|
|
388
460
|
interface PdfJsTextContent {
|
|
389
461
|
items: ReadonlyArray<PdfJsTextItem | {
|
|
390
462
|
type: string;
|
|
391
463
|
}>;
|
|
464
|
+
/** Per `fontName`: pdf.js reports the family (sometimes the real font name). */
|
|
465
|
+
styles?: Record<string, {
|
|
466
|
+
fontFamily?: string;
|
|
467
|
+
} | undefined>;
|
|
468
|
+
}
|
|
469
|
+
/** pdf.js operator list (`page.getOperatorList()`). */
|
|
470
|
+
interface PdfJsOperatorList {
|
|
471
|
+
fnArray: ArrayLike<number>;
|
|
472
|
+
argsArray: ArrayLike<unknown>;
|
|
392
473
|
}
|
|
393
474
|
interface PdfJsPage {
|
|
394
475
|
getTextContent(): Promise<PdfJsTextContent>;
|
|
476
|
+
/** Used to read ruling lines (table borders); optional. */
|
|
477
|
+
getOperatorList?(): Promise<PdfJsOperatorList>;
|
|
478
|
+
/** Loaded fonts: `get(fontName)` returns `{ name, bold, black, italic }` once the operator list was read. */
|
|
479
|
+
commonObjs?: {
|
|
480
|
+
has?(id: string): boolean;
|
|
481
|
+
get(id: string): unknown;
|
|
482
|
+
};
|
|
395
483
|
cleanup?(): unknown;
|
|
396
484
|
}
|
|
397
485
|
interface PdfJsDocument {
|
|
@@ -407,6 +495,8 @@ interface PdfJsLike {
|
|
|
407
495
|
}): {
|
|
408
496
|
promise: Promise<PdfJsDocument>;
|
|
409
497
|
};
|
|
498
|
+
/** pdf.js operator codes (`pdfjs.OPS`); the classic values are assumed when missing. */
|
|
499
|
+
OPS?: Record<string, number>;
|
|
410
500
|
}
|
|
411
501
|
interface PdfTextOptions {
|
|
412
502
|
/**
|
|
@@ -415,7 +505,19 @@ interface PdfTextOptions {
|
|
|
415
505
|
*/
|
|
416
506
|
paragraphGap?: number;
|
|
417
507
|
}
|
|
418
|
-
|
|
508
|
+
/** Options that may also be passed per import as `adapterOptions[adapterId]`. */
|
|
509
|
+
interface PdfImportCallOptions extends PdfTextOptions {
|
|
510
|
+
/**
|
|
511
|
+
* Detect headings, lists, tables, columns and running headers (default
|
|
512
|
+
* `true`). `false` imports plain paragraphs, as before structure detection.
|
|
513
|
+
*/
|
|
514
|
+
structure?: boolean;
|
|
515
|
+
/** Fine-tuning for `analyzePdfLayout`. */
|
|
516
|
+
layout?: PdfLayoutOptions;
|
|
517
|
+
/** Read the operator list for table rules and font weights (default `true`). */
|
|
518
|
+
rulingLines?: boolean;
|
|
519
|
+
}
|
|
520
|
+
interface PdfImportOptions extends PdfImportCallOptions {
|
|
419
521
|
/** Adapter id (default `"pdf"`). */
|
|
420
522
|
id?: string;
|
|
421
523
|
/** Import at most this many pages (default: all). */
|
|
@@ -423,6 +525,10 @@ interface PdfImportOptions extends PdfTextOptions {
|
|
|
423
525
|
/** Extra `getDocument` parameters, e.g. `{ disableFontFace: true }`. */
|
|
424
526
|
documentParams?: Record<string, unknown>;
|
|
425
527
|
}
|
|
528
|
+
/** What the PDF adapter returns: a `DocumentImport` with its structure report. */
|
|
529
|
+
interface PdfDocumentImport extends DocumentImport {
|
|
530
|
+
structure: PdfStructureReport;
|
|
531
|
+
}
|
|
426
532
|
/**
|
|
427
533
|
* Groups one page's pdf.js text items into paragraphs. Exposed for custom
|
|
428
534
|
* adapters and tests.
|
|
@@ -430,8 +536,29 @@ interface PdfImportOptions extends PdfTextOptions {
|
|
|
430
536
|
declare function pdfTextItemsToParagraphs(items: ReadonlyArray<PdfJsTextItem | {
|
|
431
537
|
type: string;
|
|
432
538
|
}>, options?: PdfTextOptions): string[];
|
|
539
|
+
/** Font details pdf.js exposes for a text item's `fontName`. */
|
|
540
|
+
interface PdfFontInfo {
|
|
541
|
+
name?: string;
|
|
542
|
+
bold?: boolean;
|
|
543
|
+
italic?: boolean;
|
|
544
|
+
}
|
|
545
|
+
/**
|
|
546
|
+
* Converts pdf.js text items to layout runs. `font` resolves a `fontName` to
|
|
547
|
+
* its real name and weight (the adapter reads `page.commonObjs` and
|
|
548
|
+
* `textContent.styles`).
|
|
549
|
+
*/
|
|
550
|
+
declare function pdfTextItemsToRuns(items: ReadonlyArray<PdfJsTextItem | {
|
|
551
|
+
type: string;
|
|
552
|
+
}>, font?: (fontName: string) => PdfFontInfo | undefined): PdfTextRun[];
|
|
553
|
+
/**
|
|
554
|
+
* Reads straight, axis-aligned strokes and thin filled bars (table rules)
|
|
555
|
+
* from a pdf.js operator list, in PDF user space. Understands the classic
|
|
556
|
+
* `constructPath` arguments (`[ops, args, minMax]`) and the pdf.js 5 form
|
|
557
|
+
* (`[paintOp, [pathData], minMax]`); clipping paths and curves are ignored.
|
|
558
|
+
*/
|
|
559
|
+
declare function pdfOperatorListToRules(list: PdfJsOperatorList, opsTable?: Record<string, number>): PdfRuleLine[];
|
|
433
560
|
/** Creates a PDF `document` adapter backed by an injected pdf.js-compatible library. */
|
|
434
|
-
declare function createPdfImportAdapter(pdfjs: PdfJsLike, options?: PdfImportOptions):
|
|
561
|
+
declare function createPdfImportAdapter(pdfjs: PdfJsLike, options?: PdfImportOptions): ImportAdapter<PdfDocumentImport>;
|
|
435
562
|
|
|
436
563
|
/**
|
|
437
564
|
* Zipped document exports (Notion, Confluence, Obsidian, static-site dumps):
|
|
@@ -485,4 +612,4 @@ declare function createZipImportAdapter(options?: ZipImportOptions): DocumentImp
|
|
|
485
612
|
/** Zipped-export adapter with default options. Opt in with `registerImportAdapter(zipImportAdapter)`. */
|
|
486
613
|
declare const zipImportAdapter: DocumentImportAdapter;
|
|
487
614
|
|
|
488
|
-
export { type BaseSlotProps, type ButtonSlotProps, DEFAULT_DOCX_MAX_IMAGE_SIZE, DEFAULT_ZIP_MAX_ENTRIES, DEFAULT_ZIP_MAX_TOTAL_SIZE, DOCX_MIME_TYPES, DocumentImport, DocumentImportAdapter, type DocxImportOptions, EditorController, type EditorControllerOptions, type EditorSlotsMap, FileImportController, type FileImportControllerOptions, type FileImportState, FileLike, ImportAdapterRegistry, type ImportEditorTarget, type ImportFilesIntoEditorOptions, ImportOutcome, type InsertImportedDocumentOptions, type NodeHeaderSlotProps, type PdfImportOptions, type PdfJsDocument, type PdfJsLike, type PdfJsPage, type PdfJsTextContent, type PdfJsTextItem, type PdfTextOptions, Token, type TooltipSlotProps, ZipArchive, type ZipDocumentImport, type ZipEntry, ZipError, type ZipErrorCode, type ZipImportOptions, type ZipReadOptions, createDocxImportAdapter, createEditor, createFileImportController, createPdfImportAdapter, createZipImportAdapter, docxImportAdapter, docxToDocumentImport, htmlToSlice, importFilesIntoEditor, insertImportedDocument, isUnsafeZipPath, pdfTextItemsToParagraphs, pickImportFiles, readZip, sortZipEntryNames, zipCrc32, zipEntryTitle, zipImportAdapter };
|
|
615
|
+
export { type BaseSlotProps, type ButtonSlotProps, DEFAULT_DOCX_MAX_IMAGE_SIZE, DEFAULT_ZIP_MAX_ENTRIES, DEFAULT_ZIP_MAX_TOTAL_SIZE, DOCX_MIME_TYPES, DocumentImport, DocumentImportAdapter, type DocxImportOptions, EditorController, type EditorControllerOptions, type EditorSlotsMap, FileImportController, type FileImportControllerOptions, type FileImportState, FileLike, ImportAdapter, ImportAdapterRegistry, type ImportEditorTarget, type ImportFilesIntoEditorOptions, ImportOutcome, type ImportStructureSummary, type InsertImportedDocumentOptions, type NodeHeaderSlotProps, type PdfDocumentImport, type PdfFontInfo, type PdfImportCallOptions, type PdfImportOptions, type PdfJsDocument, type PdfJsLike, type PdfJsOperatorList, type PdfJsPage, type PdfJsTextContent, type PdfJsTextItem, PdfLayoutOptions, PdfRuleLine, PdfStructureReport, type PdfTextOptions, PdfTextRun, Token, type TooltipSlotProps, ZipArchive, type ZipDocumentImport, type ZipEntry, ZipError, type ZipErrorCode, type ZipImportOptions, type ZipReadOptions, applyImportedReviewData, createDocxImportAdapter, createEditor, createFileImportController, createPdfImportAdapter, createZipImportAdapter, docxImportAdapter, docxToDocumentImport, htmlToSlice, importFilesIntoEditor, insertImportedDocument, isUnsafeZipPath, pdfOperatorListToRules, pdfTextItemsToParagraphs, pdfTextItemsToRuns, pickImportFiles, readZip, sortZipEntryNames, summarizeImportStructure, zipCrc32, zipEntryTitle, zipImportAdapter };
|