@etrepum/lexical-builder-table 0.0.36-nightly.20250714.0 → 0.0.36

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/index.d.ts CHANGED
@@ -10,5 +10,5 @@ export interface TableOutput {
10
10
  hasCellBackgroundColor: ReadableStore<boolean>;
11
11
  hasTabHandler: ReadableStore<boolean>;
12
12
  }
13
- export declare const TablePlan: import('@etrepum/lexical-builder').LexicalPlan<TableConfig, "@lexical/table", TableOutput, TableOutput>;
13
+ export declare const TableExtension: import('@etrepum/lexical-builder').LexicalExtension<TableConfig, "@lexical/table", TableOutput, TableOutput>;
14
14
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAkCH,OAAO,EAGL,KAAK,aAAa,EAInB,MAAM,0BAA0B,CAAC;AAGlC,eAAO,MAAM,eAAe,EAAE,MAAwC,CAAC;AAEvE,MAAM,WAAW,WAAW;IAC1B,YAAY,EAAE,OAAO,CAAC;IACtB,sBAAsB,EAAE,OAAO,CAAC;IAChC,aAAa,EAAE,OAAO,CAAC;CACxB;AAED,MAAM,WAAW,WAAW;IAC1B,YAAY,EAAE,aAAa,CAAC,OAAO,CAAC,CAAC;IACrC,sBAAsB,EAAE,aAAa,CAAC,OAAO,CAAC,CAAC;IAC/C,aAAa,EAAE,aAAa,CAAC,OAAO,CAAC,CAAC;CACvC;AAED,eAAO,MAAM,SAAS,yGA4LpB,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAkCH,OAAO,EAGL,KAAK,aAAa,EAInB,MAAM,0BAA0B,CAAC;AAGlC,eAAO,MAAM,eAAe,EAAE,MAAwC,CAAC;AAEvE,MAAM,WAAW,WAAW;IAC1B,YAAY,EAAE,OAAO,CAAC;IACtB,sBAAsB,EAAE,OAAO,CAAC;IAChC,aAAa,EAAE,OAAO,CAAC;CACxB;AAED,MAAM,WAAW,WAAW;IAC1B,YAAY,EAAE,aAAa,CAAC,OAAO,CAAC,CAAC;IACrC,sBAAsB,EAAE,aAAa,CAAC,OAAO,CAAC,CAAC;IAC/C,aAAa,EAAE,aAAa,CAAC,OAAO,CAAC,CAAC;CACvC;AAED,eAAO,MAAM,cAAc,8GA4LzB,CAAC"}
package/dist/index.js CHANGED
@@ -1,14 +1,14 @@
1
- import { TableNode as N, TableRowNode as k, TableCellNode as T, INSERT_TABLE_COMMAND as x, $createTableNodeWithDimensions as B, $computeTableMapSkipCellCheck as _, $createTableCellNode as M, $isTableNode as A, $getNodeTriplet as I, $computeTableMap as D, $isTableRowNode as $, $isTableCellNode as H, applyTableHandlers as K } from "@lexical/table";
2
- import { mergeRegister as E, $insertNodeToNearestRoot as L, $insertFirst as O } from "@lexical/utils";
3
- import { $isTextNode as v, COMMAND_PRIORITY_EDITOR as P, $createParagraphNode as F, $getNodeByKey as j } from "lexical";
4
- import { definePlan as z, safeCast as V, Store as h, provideOutput as G, registerStoreToggle as m } from "@etrepum/lexical-builder";
1
+ import { TableNode as N, TableRowNode as k, TableCellNode as T, INSERT_TABLE_COMMAND as y, $createTableNodeWithDimensions as B, $computeTableMapSkipCellCheck as _, $createTableCellNode as M, $isTableNode as A, $getNodeTriplet as I, $computeTableMap as D, $isTableRowNode as E, $isTableCellNode as H, applyTableHandlers as K } from "@lexical/table";
2
+ import { mergeRegister as $, $insertNodeToNearestRoot as L, $insertFirst as O } from "@lexical/utils";
3
+ import { $isTextNode as v, COMMAND_PRIORITY_EDITOR as F, $createParagraphNode as P, $getNodeByKey as j } from "lexical";
4
+ import { defineExtension as z, safeCast as V, Store as h, provideOutput as G, registerStoreToggle as m } from "@etrepum/lexical-builder";
5
5
  function w(a, c, ...C) {
6
6
  if (!a)
7
7
  throw new Error(
8
8
  C.reduce((f, p) => f.replace("%s", String(p)), c || "")
9
9
  );
10
10
  }
11
- const Q = "0.0.36-nightly.20250714.0", U = z({
11
+ const Q = "0.0.36", U = z({
12
12
  name: "@lexical/table",
13
13
  nodes: [N, k, T],
14
14
  config: V({
@@ -24,37 +24,37 @@ const Q = "0.0.36-nightly.20250714.0", U = z({
24
24
  };
25
25
  },
26
26
  register(a, c, C) {
27
- const f = C.getInitResult(), { hasCellMerge: p, hasCellBackgroundColor: y, hasTabHandler: R } = f;
27
+ const f = C.getInitResult(), { hasCellMerge: p, hasCellBackgroundColor: x, hasTabHandler: R } = f;
28
28
  return G(
29
29
  f,
30
- E(
30
+ $(
31
31
  a.registerCommand(
32
- x,
33
- ({ columns: t, rows: o, includeHeaders: n }) => {
32
+ y,
33
+ ({ columns: t, rows: l, includeHeaders: n }) => {
34
34
  const e = B(
35
- Number(o),
35
+ Number(l),
36
36
  Number(t),
37
37
  n
38
38
  );
39
39
  L(e);
40
- const l = e.getFirstDescendant();
41
- return v(l) && l.select(), !0;
40
+ const o = e.getFirstDescendant();
41
+ return v(o) && o.select(), !0;
42
42
  },
43
- P
43
+ F
44
44
  ),
45
45
  a.registerNodeTransform(N, (t) => {
46
- const [o] = _(t, null, null);
46
+ const [l] = _(t, null, null);
47
47
  let n = 0;
48
- for (const e of o)
48
+ for (const e of l)
49
49
  n = Math.max(n, e.length);
50
- for (const e of o) {
51
- const l = e.length;
52
- if (l === n || l === 0)
50
+ for (const e of l) {
51
+ const o = e.length;
52
+ if (o === n || o === 0)
53
53
  continue;
54
- const r = e[l - 1].cell;
55
- for (let s = l; s < n; ++s) {
54
+ const r = e[o - 1].cell;
55
+ for (let s = o; s < n; ++s) {
56
56
  const d = M(0);
57
- d.append(F()), r.insertAfter(d);
57
+ d.append(P()), r.insertAfter(d);
58
58
  }
59
59
  }
60
60
  }),
@@ -64,33 +64,33 @@ const Q = "0.0.36-nightly.20250714.0", U = z({
64
64
  // function any time the value changes
65
65
  () => !0,
66
66
  () => {
67
- const t = R.get(), o = /* @__PURE__ */ new Map(), n = (e) => {
68
- const l = e.getKey(), i = a.getElementByKey(
69
- l
67
+ const t = R.get(), l = /* @__PURE__ */ new Map(), n = (e) => {
68
+ const o = e.getKey(), i = a.getElementByKey(
69
+ o
70
70
  );
71
- if (i && !o.has(l)) {
71
+ if (i && !l.has(o)) {
72
72
  const r = K(
73
73
  e,
74
74
  i,
75
75
  a,
76
76
  t
77
77
  );
78
- o.set(l, r);
78
+ l.set(o, r);
79
79
  }
80
80
  };
81
- return E(
81
+ return $(
82
82
  a.registerMutationListener(
83
83
  N,
84
84
  (e) => {
85
- for (const [l, i] of e)
85
+ for (const [o, i] of e)
86
86
  if (i === "created")
87
87
  a.getEditorState().read(() => {
88
- const r = j(l);
88
+ const r = j(o);
89
89
  A(r) && n(r);
90
90
  });
91
91
  else if (i === "destroyed") {
92
- const r = o.get(l);
93
- r !== void 0 && (r.removeListeners(), o.delete(l));
92
+ const r = l.get(o);
93
+ r !== void 0 && (r.removeListeners(), l.delete(o));
94
94
  }
95
95
  },
96
96
  { skipInitialization: !1 }
@@ -98,7 +98,7 @@ const Q = "0.0.36-nightly.20250714.0", U = z({
98
98
  // Hook might be called multiple times so cleaning up tables listeners as well,
99
99
  // as it'll be reinitialized during recurring call
100
100
  () => {
101
- for (const [, e] of o)
101
+ for (const [, e] of l)
102
102
  e.removeListeners();
103
103
  }
104
104
  );
@@ -109,16 +109,16 @@ const Q = "0.0.36-nightly.20250714.0", U = z({
109
109
  (t) => t,
110
110
  () => a.registerNodeTransform(T, (t) => {
111
111
  if (t.getColSpan() > 1 || t.getRowSpan() > 1) {
112
- const [, , o] = I(t), [n] = D(o, t, t);
113
- let e = o.getFirstChild();
112
+ const [, , l] = I(t), [n] = D(l, t, t);
113
+ let e = l.getFirstChild();
114
114
  w(
115
- $(e),
115
+ E(e),
116
116
  "Expected TableNode first child to be a RowNode"
117
117
  );
118
- const l = n.length, i = n[0].length, r = [];
119
- for (let s = 0; s < l; s++) {
118
+ const o = n.length, i = n[0].length, r = [];
119
+ for (let s = 0; s < o; s++) {
120
120
  s !== 0 && (e = e.getNextSibling(), w(
121
- $(e),
121
+ E(e),
122
122
  "Expected TableNode first child to be a RowNode"
123
123
  ));
124
124
  let d = null;
@@ -142,7 +142,7 @@ const Q = "0.0.36-nightly.20250714.0", U = z({
142
142
  })
143
143
  ),
144
144
  m(
145
- y,
145
+ x,
146
146
  (t) => t,
147
147
  () => a.registerNodeTransform(T, (t) => {
148
148
  t.getBackgroundColor() !== null && t.setBackgroundColor(null);
@@ -154,5 +154,5 @@ const Q = "0.0.36-nightly.20250714.0", U = z({
154
154
  });
155
155
  export {
156
156
  Q as PACKAGE_VERSION,
157
- U as TablePlan
157
+ U as TableExtension
158
158
  };
package/package.json CHANGED
@@ -6,7 +6,7 @@
6
6
  "lexical",
7
7
  "lexical-builder",
8
8
  "plug-in",
9
- "plan"
9
+ "extension"
10
10
  ],
11
11
  "scripts": {
12
12
  "build": "tsc --noEmit && vite build",
@@ -15,7 +15,7 @@
15
15
  "test:watch": "vitest",
16
16
  "lint": "eslint"
17
17
  },
18
- "version": "0.0.36-nightly.20250714.0",
18
+ "version": "0.0.36",
19
19
  "license": "MIT",
20
20
  "repository": {
21
21
  "type": "git",
@@ -30,9 +30,9 @@
30
30
  "@etrepum/lexical-builder": "*"
31
31
  },
32
32
  "peerDependencies": {
33
- "@lexical/table": ">=0.31.0 || >=0.31.1-nightly.0",
34
- "@lexical/utils": ">=0.31.0 || >=0.31.1-nightly.0",
35
- "lexical": ">=0.31.0 || >=0.31.1-nightly.0"
33
+ "@lexical/table": ">=0.33.1 || >=0.33.2-nightly.0",
34
+ "@lexical/utils": ">=0.33.1 || >=0.33.2-nightly.0",
35
+ "lexical": ">=0.33.1 || >=0.33.2-nightly.0"
36
36
  },
37
37
  "sideEffects": false,
38
38
  "devDependencies": {