@kedataindo/docflow-plugins 0.0.100 → 0.0.102

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.
@@ -129,4 +129,5 @@ declare const DEFAULT_CSL_STYLE = "chicago-notes-bibliography";
129
129
  /** The single bundled locale. Multi-locale rendering is deferred (phase 6 §7). */
130
130
  declare const CSL_LOCALE_EN_US: string;
131
131
 
132
- export { CSL_LOCALE_EN_US, CSL_STYLES, type CitationAttrs, type CitationCluster, type CitationMode, CiteEngine, type CiteEngineOptions, type CslStyleInfo, DEFAULT_CSL_STYLE, buildCitationNodes, nextCitationId, sanitizeCiteprocHtml };
132
+ export { CSL_LOCALE_EN_US, CSL_STYLES, CiteEngine, DEFAULT_CSL_STYLE, buildCitationNodes, nextCitationId, sanitizeCiteprocHtml };
133
+ export type { CitationAttrs, CitationCluster, CitationMode, CiteEngineOptions, CslStyleInfo };
@@ -129,4 +129,5 @@ declare const DEFAULT_CSL_STYLE = "chicago-notes-bibliography";
129
129
  /** The single bundled locale. Multi-locale rendering is deferred (phase 6 §7). */
130
130
  declare const CSL_LOCALE_EN_US: string;
131
131
 
132
- export { CSL_LOCALE_EN_US, CSL_STYLES, type CitationAttrs, type CitationCluster, type CitationMode, CiteEngine, type CiteEngineOptions, type CslStyleInfo, DEFAULT_CSL_STYLE, buildCitationNodes, nextCitationId, sanitizeCiteprocHtml };
132
+ export { CSL_LOCALE_EN_US, CSL_STYLES, CiteEngine, DEFAULT_CSL_STYLE, buildCitationNodes, nextCitationId, sanitizeCiteprocHtml };
133
+ export type { CitationAttrs, CitationCluster, CitationMode, CiteEngineOptions, CslStyleInfo };
package/dist/index.cjs CHANGED
@@ -3857,6 +3857,13 @@ function findSplitRow(measurements, pageContentPx) {
3857
3857
  }
3858
3858
  return best;
3859
3859
  }
3860
+ function resolveHeadBudget(measurements, availablePx, pageContentPx) {
3861
+ if (measurements.length === 0) return availablePx;
3862
+ const totalPx = measurements[measurements.length - 1].cumulativePx;
3863
+ if (totalPx <= availablePx) return availablePx;
3864
+ if (measurements[0].heightPx <= availablePx) return availablePx;
3865
+ return pageContentPx;
3866
+ }
3860
3867
  function rowBoundaryOffset(tableNode, splitRow) {
3861
3868
  if (splitRow < 0 || tableNode.childCount === 0) return 0;
3862
3869
  let boundary = 0;
@@ -3943,12 +3950,13 @@ function runSplitPass(view, editor) {
3943
3950
  for (let i = 0; i < tables.length; i++) {
3944
3951
  const { pos, node, measurements } = tables[i];
3945
3952
  const availablePx = i === 0 ? availablePxAt(v, pos, pageContentPx) ?? pageContentPx : cursorAvailablePx ?? pageContentPx;
3946
- const chain = buildSplitChain(node, measurements, availablePx, pageContentPx, schema, tableType, 0);
3953
+ const headBudgetPx = resolveHeadBudget(measurements, availablePx, pageContentPx);
3954
+ const chain = buildSplitChain(node, measurements, headBudgetPx, pageContentPx, schema, tableType, 0);
3947
3955
  if (chain.length > 1) pending.push({ pos, node, chain });
3948
- const lastChunkPx = lastChunkHeightPx(measurements, availablePx, pageContentPx);
3956
+ const lastChunkPx = lastChunkHeightPx(measurements, headBudgetPx, pageContentPx);
3949
3957
  if (lastChunkPx === null) {
3950
3958
  const totalPx = measurements[measurements.length - 1]?.cumulativePx ?? 0;
3951
- cursorAvailablePx = Math.max(0, availablePx - totalPx);
3959
+ cursorAvailablePx = Math.max(0, headBudgetPx - totalPx);
3952
3960
  } else {
3953
3961
  cursorAvailablePx = Math.max(0, pageContentPx - lastChunkPx);
3954
3962
  }
package/dist/index.d.cts CHANGED
@@ -390,4 +390,5 @@ declare const slashMenuPlugin: _kedata_indonesia_docflow_core.DocsEditorPlugin;
390
390
 
391
391
  declare const defaultPlugins: _kedata_indonesia_docflow_core.DocsEditorPlugin[];
392
392
 
393
- export { AIExtension, type AIPreviewState, BibliographyNode, CitationEngineExtension, CitationNode, CiteEngine, type CommentMarkAttrs, CommentMark as CommentMarkExtension, DateChipNode, DropdownChipNode, FileChipNode, FootnoteNode, LocationChipNode, PageBreak, PeopleChipNode, type PlaceholderPluginOptions, SUGGESTION_DELETE, SUGGESTION_FORMAT, SUGGESTION_INSERT, SlashMenuExtension, type SuggestionAuthor, SuggestionDeleteMark, SuggestionFormatMark, SuggestionInsertMark, type SuggestionSummary, TocEntryNode, TocNode, TocPageNumNode, acceptAllSuggestions, acceptSuggestion, aiPlugin, aiPluginKey, alignmentPlugin, blockquotePlugin, citationPlugin, codeBlockPlugin, collectHeadings, commentPlugin, createPlaceholderPlugin, defaultPlugins, fontFamilyPlugin, fontSizePlugin, footnotePlugin, formattingPlugin, getAIPreview, getCitationEngine, getSuggestions, headingsPlugin, highlightPlugin, imagePlugin, insertMarkdownBlock, linkPlugin, listsPlugin, markdownToFragment, onSlashStateChange, pageBreakPlugin, placeholderPlugin, regenerateToc, registerSlashCommands, rejectAllSuggestions, rejectSuggestion, scrollEditorToPos, setDocumentMode, setSuggestionAuthor, slashMenuPlugin, slashState, smartElementsPlugin, suggestChangesPlugin, tablePageSplitPlugin, tablePlugin, textColorPlugin, tocPlugin };
393
+ export { AIExtension, BibliographyNode, CitationEngineExtension, CitationNode, CiteEngine, CommentMark as CommentMarkExtension, DateChipNode, DropdownChipNode, FileChipNode, FootnoteNode, LocationChipNode, PageBreak, PeopleChipNode, SUGGESTION_DELETE, SUGGESTION_FORMAT, SUGGESTION_INSERT, SlashMenuExtension, SuggestionDeleteMark, SuggestionFormatMark, SuggestionInsertMark, TocEntryNode, TocNode, TocPageNumNode, acceptAllSuggestions, acceptSuggestion, aiPlugin, aiPluginKey, alignmentPlugin, blockquotePlugin, citationPlugin, codeBlockPlugin, collectHeadings, commentPlugin, createPlaceholderPlugin, defaultPlugins, fontFamilyPlugin, fontSizePlugin, footnotePlugin, formattingPlugin, getAIPreview, getCitationEngine, getSuggestions, headingsPlugin, highlightPlugin, imagePlugin, insertMarkdownBlock, linkPlugin, listsPlugin, markdownToFragment, onSlashStateChange, pageBreakPlugin, placeholderPlugin, regenerateToc, registerSlashCommands, rejectAllSuggestions, rejectSuggestion, scrollEditorToPos, setDocumentMode, setSuggestionAuthor, slashMenuPlugin, slashState, smartElementsPlugin, suggestChangesPlugin, tablePageSplitPlugin, tablePlugin, textColorPlugin, tocPlugin };
394
+ export type { AIPreviewState, CommentMarkAttrs, PlaceholderPluginOptions, SuggestionAuthor, SuggestionSummary };
package/dist/index.d.ts CHANGED
@@ -390,4 +390,5 @@ declare const slashMenuPlugin: _kedata_indonesia_docflow_core.DocsEditorPlugin;
390
390
 
391
391
  declare const defaultPlugins: _kedata_indonesia_docflow_core.DocsEditorPlugin[];
392
392
 
393
- export { AIExtension, type AIPreviewState, BibliographyNode, CitationEngineExtension, CitationNode, CiteEngine, type CommentMarkAttrs, CommentMark as CommentMarkExtension, DateChipNode, DropdownChipNode, FileChipNode, FootnoteNode, LocationChipNode, PageBreak, PeopleChipNode, type PlaceholderPluginOptions, SUGGESTION_DELETE, SUGGESTION_FORMAT, SUGGESTION_INSERT, SlashMenuExtension, type SuggestionAuthor, SuggestionDeleteMark, SuggestionFormatMark, SuggestionInsertMark, type SuggestionSummary, TocEntryNode, TocNode, TocPageNumNode, acceptAllSuggestions, acceptSuggestion, aiPlugin, aiPluginKey, alignmentPlugin, blockquotePlugin, citationPlugin, codeBlockPlugin, collectHeadings, commentPlugin, createPlaceholderPlugin, defaultPlugins, fontFamilyPlugin, fontSizePlugin, footnotePlugin, formattingPlugin, getAIPreview, getCitationEngine, getSuggestions, headingsPlugin, highlightPlugin, imagePlugin, insertMarkdownBlock, linkPlugin, listsPlugin, markdownToFragment, onSlashStateChange, pageBreakPlugin, placeholderPlugin, regenerateToc, registerSlashCommands, rejectAllSuggestions, rejectSuggestion, scrollEditorToPos, setDocumentMode, setSuggestionAuthor, slashMenuPlugin, slashState, smartElementsPlugin, suggestChangesPlugin, tablePageSplitPlugin, tablePlugin, textColorPlugin, tocPlugin };
393
+ export { AIExtension, BibliographyNode, CitationEngineExtension, CitationNode, CiteEngine, CommentMark as CommentMarkExtension, DateChipNode, DropdownChipNode, FileChipNode, FootnoteNode, LocationChipNode, PageBreak, PeopleChipNode, SUGGESTION_DELETE, SUGGESTION_FORMAT, SUGGESTION_INSERT, SlashMenuExtension, SuggestionDeleteMark, SuggestionFormatMark, SuggestionInsertMark, TocEntryNode, TocNode, TocPageNumNode, acceptAllSuggestions, acceptSuggestion, aiPlugin, aiPluginKey, alignmentPlugin, blockquotePlugin, citationPlugin, codeBlockPlugin, collectHeadings, commentPlugin, createPlaceholderPlugin, defaultPlugins, fontFamilyPlugin, fontSizePlugin, footnotePlugin, formattingPlugin, getAIPreview, getCitationEngine, getSuggestions, headingsPlugin, highlightPlugin, imagePlugin, insertMarkdownBlock, linkPlugin, listsPlugin, markdownToFragment, onSlashStateChange, pageBreakPlugin, placeholderPlugin, regenerateToc, registerSlashCommands, rejectAllSuggestions, rejectSuggestion, scrollEditorToPos, setDocumentMode, setSuggestionAuthor, slashMenuPlugin, slashState, smartElementsPlugin, suggestChangesPlugin, tablePageSplitPlugin, tablePlugin, textColorPlugin, tocPlugin };
394
+ export type { AIPreviewState, CommentMarkAttrs, PlaceholderPluginOptions, SuggestionAuthor, SuggestionSummary };
package/dist/index.js CHANGED
@@ -3747,6 +3747,13 @@ function findSplitRow(measurements, pageContentPx) {
3747
3747
  }
3748
3748
  return best;
3749
3749
  }
3750
+ function resolveHeadBudget(measurements, availablePx, pageContentPx) {
3751
+ if (measurements.length === 0) return availablePx;
3752
+ const totalPx = measurements[measurements.length - 1].cumulativePx;
3753
+ if (totalPx <= availablePx) return availablePx;
3754
+ if (measurements[0].heightPx <= availablePx) return availablePx;
3755
+ return pageContentPx;
3756
+ }
3750
3757
  function rowBoundaryOffset(tableNode, splitRow) {
3751
3758
  if (splitRow < 0 || tableNode.childCount === 0) return 0;
3752
3759
  let boundary = 0;
@@ -3833,12 +3840,13 @@ function runSplitPass(view, editor) {
3833
3840
  for (let i = 0; i < tables.length; i++) {
3834
3841
  const { pos, node, measurements } = tables[i];
3835
3842
  const availablePx = i === 0 ? availablePxAt(v, pos, pageContentPx) ?? pageContentPx : cursorAvailablePx ?? pageContentPx;
3836
- const chain = buildSplitChain(node, measurements, availablePx, pageContentPx, schema, tableType, 0);
3843
+ const headBudgetPx = resolveHeadBudget(measurements, availablePx, pageContentPx);
3844
+ const chain = buildSplitChain(node, measurements, headBudgetPx, pageContentPx, schema, tableType, 0);
3837
3845
  if (chain.length > 1) pending.push({ pos, node, chain });
3838
- const lastChunkPx = lastChunkHeightPx(measurements, availablePx, pageContentPx);
3846
+ const lastChunkPx = lastChunkHeightPx(measurements, headBudgetPx, pageContentPx);
3839
3847
  if (lastChunkPx === null) {
3840
3848
  const totalPx = measurements[measurements.length - 1]?.cumulativePx ?? 0;
3841
- cursorAvailablePx = Math.max(0, availablePx - totalPx);
3849
+ cursorAvailablePx = Math.max(0, headBudgetPx - totalPx);
3842
3850
  } else {
3843
3851
  cursorAvailablePx = Math.max(0, pageContentPx - lastChunkPx);
3844
3852
  }
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@kedataindo/docflow-plugins",
3
3
  "license": "Apache-2.0",
4
- "version": "0.0.100",
4
+ "version": "0.0.102",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",
7
7
  "module": "./dist/index.js",
@@ -32,7 +32,7 @@
32
32
  "@tiptap/pm": "^2.27.3",
33
33
  "citeproc": "^2.4.63",
34
34
  "tiptap-markdown": "0.8.10",
35
- "@kedataindo/docflow-core": "0.0.94"
35
+ "@kedataindo/docflow-core": "0.0.95"
36
36
  },
37
37
  "peerDependencies": {
38
38
  "@tiptap/core": "^2.11.0",
@@ -98,7 +98,7 @@
98
98
  "devDependencies": {
99
99
  "@vitest/coverage-v8": "^2.1.9",
100
100
  "happy-dom": "^21.0.1",
101
- "tsup": "^8.3.0",
101
+ "tsup": "^9.0.0",
102
102
  "typescript": "^5.6.3",
103
103
  "vitest": "^2.1.3",
104
104
  "yjs": "^13.6.33"