@kedataindo/docflow-plugins 0.0.104 → 0.0.106

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.
Files changed (3) hide show
  1. package/dist/index.cjs +30 -29
  2. package/dist/index.js +18 -17
  3. package/package.json +32 -22
package/dist/index.cjs CHANGED
@@ -111,10 +111,10 @@ module.exports = __toCommonJS(index_exports);
111
111
 
112
112
  // src/formatting.ts
113
113
  var import_docflow_core = require("@kedataindo/docflow-core");
114
- var import_extension_underline = __toESM(require("@tiptap/extension-underline"), 1);
114
+ var import_extension_underline = require("@tiptap/extension-underline");
115
115
  var formattingPlugin = (0, import_docflow_core.definePlugin)({
116
116
  id: "formatting",
117
- tiptapExtensions: [import_extension_underline.default],
117
+ tiptapExtensions: [import_extension_underline.Underline],
118
118
  toolbar: [
119
119
  { id: "bold", label: "Bold", action: "toggleBold", iconComponent: "Bold" },
120
120
  { id: "italic", label: "Italic", action: "toggleItalic", iconComponent: "Italic" },
@@ -158,11 +158,10 @@ var headingsPlugin = (0, import_docflow_core2.definePlugin)({
158
158
 
159
159
  // src/lists.ts
160
160
  var import_docflow_core3 = require("@kedataindo/docflow-core");
161
- var import_extension_task_list = __toESM(require("@tiptap/extension-task-list"), 1);
162
- var import_extension_task_item = __toESM(require("@tiptap/extension-task-item"), 1);
161
+ var import_extension_list = require("@tiptap/extension-list");
163
162
  var listsPlugin = (0, import_docflow_core3.definePlugin)({
164
163
  id: "lists",
165
- tiptapExtensions: [import_extension_task_list.default, import_extension_task_item.default.configure({ nested: true })],
164
+ tiptapExtensions: [import_extension_list.TaskList, import_extension_list.TaskItem.configure({ nested: true })],
166
165
  toolbar: [
167
166
  { id: "bullet-list", label: "Bullet List", action: "toggleBulletList", iconComponent: "List" },
168
167
  { id: "ordered-list", label: "Ordered List", action: "toggleOrderedList", iconComponent: "ListOrdered" },
@@ -177,14 +176,14 @@ var listsPlugin = (0, import_docflow_core3.definePlugin)({
177
176
 
178
177
  // src/alignment.ts
179
178
  var import_docflow_core4 = require("@kedataindo/docflow-core");
180
- var import_extension_text_align = __toESM(require("@tiptap/extension-text-align"), 1);
179
+ var import_extension_text_align = require("@tiptap/extension-text-align");
181
180
  function setAlign(alignment) {
182
181
  return (editor) => editor.commands.setTextAlign(alignment);
183
182
  }
184
183
  var alignmentPlugin = (0, import_docflow_core4.definePlugin)({
185
184
  id: "alignment",
186
185
  tiptapExtensions: [
187
- import_extension_text_align.default.configure({ types: ["heading", "paragraph"] })
186
+ import_extension_text_align.TextAlign.configure({ types: ["heading", "paragraph"] })
188
187
  ],
189
188
  toolbar: [
190
189
  { id: "align-left", label: "Align Left", action: "alignLeft", iconComponent: "AlignLeft" },
@@ -202,10 +201,10 @@ var alignmentPlugin = (0, import_docflow_core4.definePlugin)({
202
201
 
203
202
  // src/link.ts
204
203
  var import_docflow_core5 = require("@kedataindo/docflow-core");
205
- var import_extension_link = __toESM(require("@tiptap/extension-link"), 1);
204
+ var import_extension_link = require("@tiptap/extension-link");
206
205
  var linkPlugin = (0, import_docflow_core5.definePlugin)({
207
206
  id: "link",
208
- tiptapExtensions: [import_extension_link.default.configure({ openOnClick: true })],
207
+ tiptapExtensions: [import_extension_link.Link.configure({ openOnClick: true })],
209
208
  toolbar: [
210
209
  { id: "set-link", label: "Link", action: "setLink", iconComponent: "Link" }
211
210
  ],
@@ -227,7 +226,7 @@ var linkPlugin = (0, import_docflow_core5.definePlugin)({
227
226
 
228
227
  // src/image.ts
229
228
  var import_docflow_core6 = require("@kedataindo/docflow-core");
230
- var import_extension_image = __toESM(require("@tiptap/extension-image"), 1);
229
+ var import_extension_image = require("@tiptap/extension-image");
231
230
  function pickImageFile() {
232
231
  if (typeof document === "undefined") return Promise.resolve(null);
233
232
  return new Promise((resolve) => {
@@ -250,7 +249,7 @@ function pickImageFile() {
250
249
  }
251
250
  var imagePlugin = (0, import_docflow_core6.definePlugin)({
252
251
  id: "image",
253
- tiptapExtensions: [import_extension_image.default],
252
+ tiptapExtensions: [import_extension_image.Image],
254
253
  toolbar: [{ id: "insert-image", label: "Image", action: "insertImage", iconComponent: "Image" }],
255
254
  slashCommands: [{ name: "Image", command: "insertImage" }],
256
255
  commands: {
@@ -288,12 +287,9 @@ var imagePlugin = (0, import_docflow_core6.definePlugin)({
288
287
  // src/table.ts
289
288
  var import_docflow_core7 = require("@kedataindo/docflow-core");
290
289
  var import_core = require("@tiptap/core");
291
- var import_extension_table = __toESM(require("@tiptap/extension-table"), 1);
292
- var import_extension_table_row = __toESM(require("@tiptap/extension-table-row"), 1);
293
- var import_extension_table_cell = __toESM(require("@tiptap/extension-table-cell"), 1);
294
- var import_extension_table_header = __toESM(require("@tiptap/extension-table-header"), 1);
290
+ var import_extension_table = require("@tiptap/extension-table");
295
291
  var import_state = require("@tiptap/pm/state");
296
- var CustomTable = import_extension_table.default.extend({
292
+ var CustomTable = import_extension_table.Table.extend({
297
293
  addAttributes() {
298
294
  return {
299
295
  ...this.parent?.(),
@@ -389,7 +385,7 @@ var CustomTable = import_extension_table.default.extend({
389
385
  ];
390
386
  }
391
387
  });
392
- var CustomTableCell = import_extension_table_cell.default.extend({
388
+ var CustomTableCell = import_extension_table.TableCell.extend({
393
389
  addAttributes() {
394
390
  return {
395
391
  ...this.parent?.(),
@@ -423,7 +419,7 @@ var CustomTableCell = import_extension_table_cell.default.extend({
423
419
  };
424
420
  }
425
421
  });
426
- var CustomTableHeader = import_extension_table_header.default.extend({
422
+ var CustomTableHeader = import_extension_table.TableHeader.extend({
427
423
  addAttributes() {
428
424
  return {
429
425
  ...this.parent?.(),
@@ -460,8 +456,14 @@ var CustomTableHeader = import_extension_table_header.default.extend({
460
456
  var tablePlugin = (0, import_docflow_core7.definePlugin)({
461
457
  id: "table",
462
458
  tiptapExtensions: [
463
- CustomTable.configure({ resizable: false }),
464
- import_extension_table_row.default,
459
+ // v3 ships a `TableView` node view by default (`View: TableView`), which rebuilds
460
+ // the <table> element itself and drops whatever our `renderHTML` put on it —
461
+ // `data-tps-splittable`/`data-colwidth` disappear and the inline `!important`
462
+ // width is rewritten. Column resizing in docflow is handled by
463
+ // `ManualColumnResize`, so the node view buys nothing here; `View: null` makes
464
+ // v3 fall back to our `renderHTML` and keeps the rendered DOM identical to v2.
465
+ CustomTable.configure({ resizable: false, View: null }),
466
+ import_extension_table.TableRow,
465
467
  CustomTableCell,
466
468
  CustomTableHeader
467
469
  ],
@@ -489,12 +491,12 @@ var codeBlockPlugin = (0, import_docflow_core9.definePlugin)({
489
491
 
490
492
  // src/placeholder.ts
491
493
  var import_docflow_core10 = require("@kedataindo/docflow-core");
492
- var import_extension_placeholder = __toESM(require("@tiptap/extension-placeholder"), 1);
494
+ var import_extensions = require("@tiptap/extensions");
493
495
  function createPlaceholderPlugin(options = {}) {
494
496
  return (0, import_docflow_core10.definePlugin)({
495
497
  id: "placeholder",
496
498
  tiptapExtensions: [
497
- import_extension_placeholder.default.configure({
499
+ import_extensions.Placeholder.configure({
498
500
  placeholder: options.placeholder ?? "Start writing\u2026"
499
501
  })
500
502
  ]
@@ -975,10 +977,10 @@ var fontFamilyPlugin = (0, import_docflow_core15.definePlugin)({
975
977
 
976
978
  // src/textColor.ts
977
979
  var import_docflow_core16 = require("@kedataindo/docflow-core");
978
- var import_extension_color = __toESM(require("@tiptap/extension-color"), 1);
980
+ var import_extension_color = require("@tiptap/extension-color");
979
981
  var textColorPlugin = (0, import_docflow_core16.definePlugin)({
980
982
  id: "text-color",
981
- tiptapExtensions: [import_extension_color.default],
983
+ tiptapExtensions: [import_extension_color.Color],
982
984
  toolbar: [
983
985
  { id: "text-color", label: "Text Color", action: "setTextColor", iconComponent: "Palette" }
984
986
  ],
@@ -996,9 +998,9 @@ var textColorPlugin = (0, import_docflow_core16.definePlugin)({
996
998
 
997
999
  // src/highlight.ts
998
1000
  var import_docflow_core17 = require("@kedataindo/docflow-core");
999
- var import_extension_highlight = __toESM(require("@tiptap/extension-highlight"), 1);
1001
+ var import_extension_highlight = require("@tiptap/extension-highlight");
1000
1002
  var import_core5 = require("@tiptap/core");
1001
- var GoogleDocsHighlight = import_extension_highlight.default.extend({
1003
+ var GoogleDocsHighlight = import_extension_highlight.Highlight.extend({
1002
1004
  parseHTML() {
1003
1005
  return [
1004
1006
  // Standard <mark> tag (default TipTap behavior)
@@ -2275,7 +2277,6 @@ var CitationEngineExtension = import_core7.Extension.create({
2275
2277
  tr.setNodeMarkup(pos, void 0, { ...attrs, citationId: nextCitationId() });
2276
2278
  }
2277
2279
  editor.view.dispatch(tr);
2278
- return;
2279
2280
  }
2280
2281
  }
2281
2282
  const ordered = [];
@@ -3419,7 +3420,7 @@ var DateChipNode = import_core12.Node.create({
3419
3420
  addNodeView() {
3420
3421
  return (props) => {
3421
3422
  let currentNode = props.node;
3422
- const getPos = props.getPos;
3423
+ const getPos = () => typeof props.getPos === "function" ? props.getPos() : void 0;
3423
3424
  const view = props.view;
3424
3425
  const dom = document.createElement("span");
3425
3426
  dom.className = "docs-chip docs-chip--date";
@@ -3627,7 +3628,7 @@ var DropdownChipNode = import_core12.Node.create({
3627
3628
  addNodeView() {
3628
3629
  return (props) => {
3629
3630
  let currentNode = props.node;
3630
- const getPos = props.getPos;
3631
+ const getPos = () => typeof props.getPos === "function" ? props.getPos() : void 0;
3631
3632
  const view = props.view;
3632
3633
  const dom = document.createElement("span");
3633
3634
  dom.className = "docs-chip docs-chip--dropdown";
package/dist/index.js CHANGED
@@ -1,6 +1,6 @@
1
1
  // src/formatting.ts
2
2
  import { definePlugin } from "@kedataindo/docflow-core";
3
- import Underline from "@tiptap/extension-underline";
3
+ import { Underline } from "@tiptap/extension-underline";
4
4
  var formattingPlugin = definePlugin({
5
5
  id: "formatting",
6
6
  tiptapExtensions: [Underline],
@@ -47,8 +47,7 @@ var headingsPlugin = definePlugin2({
47
47
 
48
48
  // src/lists.ts
49
49
  import { definePlugin as definePlugin3 } from "@kedataindo/docflow-core";
50
- import TaskList from "@tiptap/extension-task-list";
51
- import TaskItem from "@tiptap/extension-task-item";
50
+ import { TaskItem, TaskList } from "@tiptap/extension-list";
52
51
  var listsPlugin = definePlugin3({
53
52
  id: "lists",
54
53
  tiptapExtensions: [TaskList, TaskItem.configure({ nested: true })],
@@ -66,7 +65,7 @@ var listsPlugin = definePlugin3({
66
65
 
67
66
  // src/alignment.ts
68
67
  import { definePlugin as definePlugin4 } from "@kedataindo/docflow-core";
69
- import TextAlign from "@tiptap/extension-text-align";
68
+ import { TextAlign } from "@tiptap/extension-text-align";
70
69
  function setAlign(alignment) {
71
70
  return (editor) => editor.commands.setTextAlign(alignment);
72
71
  }
@@ -91,7 +90,7 @@ var alignmentPlugin = definePlugin4({
91
90
 
92
91
  // src/link.ts
93
92
  import { definePlugin as definePlugin5 } from "@kedataindo/docflow-core";
94
- import Link from "@tiptap/extension-link";
93
+ import { Link } from "@tiptap/extension-link";
95
94
  var linkPlugin = definePlugin5({
96
95
  id: "link",
97
96
  tiptapExtensions: [Link.configure({ openOnClick: true })],
@@ -116,7 +115,7 @@ var linkPlugin = definePlugin5({
116
115
 
117
116
  // src/image.ts
118
117
  import { definePlugin as definePlugin6 } from "@kedataindo/docflow-core";
119
- import Image from "@tiptap/extension-image";
118
+ import { Image } from "@tiptap/extension-image";
120
119
  function pickImageFile() {
121
120
  if (typeof document === "undefined") return Promise.resolve(null);
122
121
  return new Promise((resolve) => {
@@ -177,10 +176,7 @@ var imagePlugin = definePlugin6({
177
176
  // src/table.ts
178
177
  import { definePlugin as definePlugin7 } from "@kedataindo/docflow-core";
179
178
  import { mergeAttributes } from "@tiptap/core";
180
- import Table from "@tiptap/extension-table";
181
- import TableRow from "@tiptap/extension-table-row";
182
- import TableCell from "@tiptap/extension-table-cell";
183
- import TableHeader from "@tiptap/extension-table-header";
179
+ import { Table, TableCell, TableHeader, TableRow } from "@tiptap/extension-table";
184
180
  import { Plugin, TextSelection } from "@tiptap/pm/state";
185
181
  var CustomTable = Table.extend({
186
182
  addAttributes() {
@@ -349,7 +345,13 @@ var CustomTableHeader = TableHeader.extend({
349
345
  var tablePlugin = definePlugin7({
350
346
  id: "table",
351
347
  tiptapExtensions: [
352
- CustomTable.configure({ resizable: false }),
348
+ // v3 ships a `TableView` node view by default (`View: TableView`), which rebuilds
349
+ // the <table> element itself and drops whatever our `renderHTML` put on it —
350
+ // `data-tps-splittable`/`data-colwidth` disappear and the inline `!important`
351
+ // width is rewritten. Column resizing in docflow is handled by
352
+ // `ManualColumnResize`, so the node view buys nothing here; `View: null` makes
353
+ // v3 fall back to our `renderHTML` and keeps the rendered DOM identical to v2.
354
+ CustomTable.configure({ resizable: false, View: null }),
353
355
  TableRow,
354
356
  CustomTableCell,
355
357
  CustomTableHeader
@@ -378,7 +380,7 @@ var codeBlockPlugin = definePlugin9({
378
380
 
379
381
  // src/placeholder.ts
380
382
  import { definePlugin as definePlugin10 } from "@kedataindo/docflow-core";
381
- import Placeholder from "@tiptap/extension-placeholder";
383
+ import { Placeholder } from "@tiptap/extensions";
382
384
  function createPlaceholderPlugin(options = {}) {
383
385
  return definePlugin10({
384
386
  id: "placeholder",
@@ -864,7 +866,7 @@ var fontFamilyPlugin = definePlugin15({
864
866
 
865
867
  // src/textColor.ts
866
868
  import { definePlugin as definePlugin16 } from "@kedataindo/docflow-core";
867
- import Color from "@tiptap/extension-color";
869
+ import { Color } from "@tiptap/extension-color";
868
870
  var textColorPlugin = definePlugin16({
869
871
  id: "text-color",
870
872
  tiptapExtensions: [Color],
@@ -885,7 +887,7 @@ var textColorPlugin = definePlugin16({
885
887
 
886
888
  // src/highlight.ts
887
889
  import { definePlugin as definePlugin17 } from "@kedataindo/docflow-core";
888
- import Highlight from "@tiptap/extension-highlight";
890
+ import { Highlight } from "@tiptap/extension-highlight";
889
891
  import { mergeAttributes as mergeAttributes5 } from "@tiptap/core";
890
892
  var GoogleDocsHighlight = Highlight.extend({
891
893
  parseHTML() {
@@ -2164,7 +2166,6 @@ var CitationEngineExtension = Extension2.create({
2164
2166
  tr.setNodeMarkup(pos, void 0, { ...attrs, citationId: nextCitationId() });
2165
2167
  }
2166
2168
  editor.view.dispatch(tr);
2167
- return;
2168
2169
  }
2169
2170
  }
2170
2171
  const ordered = [];
@@ -3308,7 +3309,7 @@ var DateChipNode = Node7.create({
3308
3309
  addNodeView() {
3309
3310
  return (props) => {
3310
3311
  let currentNode = props.node;
3311
- const getPos = props.getPos;
3312
+ const getPos = () => typeof props.getPos === "function" ? props.getPos() : void 0;
3312
3313
  const view = props.view;
3313
3314
  const dom = document.createElement("span");
3314
3315
  dom.className = "docs-chip docs-chip--date";
@@ -3516,7 +3517,7 @@ var DropdownChipNode = Node7.create({
3516
3517
  addNodeView() {
3517
3518
  return (props) => {
3518
3519
  let currentNode = props.node;
3519
- const getPos = props.getPos;
3520
+ const getPos = () => typeof props.getPos === "function" ? props.getPos() : void 0;
3520
3521
  const view = props.view;
3521
3522
  const dom = document.createElement("span");
3522
3523
  dom.className = "docs-chip docs-chip--dropdown";
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.104",
4
+ "version": "0.0.106",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",
7
7
  "module": "./dist/index.js",
@@ -27,29 +27,31 @@
27
27
  ],
28
28
  "sideEffects": false,
29
29
  "dependencies": {
30
- "@tiptap/extension-color": "^2.27.3",
31
- "@tiptap/extension-highlight": "^2.27.3",
32
- "@tiptap/pm": "^2.27.3",
30
+ "@tiptap/extension-color": "^3.32.0",
31
+ "@tiptap/extension-highlight": "^3.32.0",
32
+ "@tiptap/extension-list": "^3.32.0",
33
+ "@tiptap/extensions": "^3.32.0",
34
+ "@tiptap/pm": "^3.32.0",
33
35
  "citeproc": "^2.4.63",
34
- "tiptap-markdown": "0.8.10",
35
- "@kedataindo/docflow-core": "0.0.97"
36
+ "tiptap-markdown": "0.9.0",
37
+ "@kedataindo/docflow-core": "0.0.99"
36
38
  },
37
39
  "peerDependencies": {
38
- "@tiptap/core": "^2.11.0",
39
- "@tiptap/extension-color": "^2.11.0",
40
- "@tiptap/extension-highlight": "^2.11.0",
41
- "@tiptap/extension-image": "^2.11.0",
42
- "@tiptap/extension-link": "^2.11.0",
43
- "@tiptap/extension-placeholder": "^2.11.0",
44
- "@tiptap/extension-strike": "^2.11.0",
45
- "@tiptap/extension-table": "^2.11.0",
46
- "@tiptap/extension-table-cell": "^2.11.0",
47
- "@tiptap/extension-table-header": "^2.11.0",
48
- "@tiptap/extension-table-row": "^2.11.0",
49
- "@tiptap/extension-task-item": "^2.11.0",
50
- "@tiptap/extension-task-list": "^2.11.0",
51
- "@tiptap/extension-text-align": "^2.11.0",
52
- "@tiptap/extension-underline": "^2.11.0"
40
+ "@tiptap/core": "^3.32.0",
41
+ "@tiptap/extension-color": "^3.32.0",
42
+ "@tiptap/extension-highlight": "^3.32.0",
43
+ "@tiptap/extension-image": "^3.32.0",
44
+ "@tiptap/extension-link": "^3.32.0",
45
+ "@tiptap/extension-placeholder": "^3.32.0",
46
+ "@tiptap/extension-strike": "^3.32.0",
47
+ "@tiptap/extension-table": "^3.32.0",
48
+ "@tiptap/extension-table-cell": "^3.32.0",
49
+ "@tiptap/extension-table-header": "^3.32.0",
50
+ "@tiptap/extension-table-row": "^3.32.0",
51
+ "@tiptap/extension-task-item": "^3.32.0",
52
+ "@tiptap/extension-task-list": "^3.32.0",
53
+ "@tiptap/extension-text-align": "^3.32.0",
54
+ "@tiptap/extension-underline": "^3.32.0"
53
55
  },
54
56
  "peerDependenciesMeta": {
55
57
  "@tiptap/extension-image": {
@@ -97,7 +99,7 @@
97
99
  },
98
100
  "devDependencies": {
99
101
  "@vitest/coverage-v8": "^2.1.9",
100
- "happy-dom": "^21.0.1",
102
+ "happy-dom": "^21.0.3",
101
103
  "tsup": "^9.0.0",
102
104
  "typescript": "^5.6.3",
103
105
  "vitest": "^2.1.3",
@@ -106,6 +108,14 @@
106
108
  "engines": {
107
109
  "node": ">=20"
108
110
  },
111
+ "repository": {
112
+ "type": "git",
113
+ "url": "git+https://github.com/Kedata-Indonesia/docflow.git"
114
+ },
115
+ "homepage": "https://github.com/Kedata-Indonesia/docflow#readme",
116
+ "bugs": {
117
+ "url": "https://github.com/Kedata-Indonesia/docflow/issues"
118
+ },
109
119
  "scripts": {
110
120
  "build": "tsup src/index.ts src/citations.ts --format esm,cjs --dts --no-splitting",
111
121
  "typecheck": "tsc --noEmit",