@etrepum/lexical-builder-list 0.0.36-nightly.20250714.0 → 0.0.37-nightly.20250715.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.
@@ -0,0 +1,9 @@
1
+ /**
2
+ * Copyright (c) Meta Platforms, Inc. and affiliates.
3
+ *
4
+ * This source code is licensed under the MIT license found in the
5
+ * LICENSE file in the root directory of this source tree.
6
+ *
7
+ */
8
+ export declare const CheckListExtension: import('@etrepum/lexical-builder').LexicalExtension<import('@etrepum/lexical-builder').ExtensionConfigBase, "@etrepum/lexical-builder-list/CheckList", unknown, unknown>;
9
+ //# sourceMappingURL=CheckListExtension.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"CheckListExtension.d.ts","sourceRoot":"","sources":["../src/CheckListExtension.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AA+BH,eAAO,MAAM,kBAAkB,0KAI7B,CAAC"}
@@ -0,0 +1,2 @@
1
+ export declare const ListExtension: import('@etrepum/lexical-builder').LexicalExtension<import('@etrepum/lexical-builder').ExtensionConfigBase, "@etrepum/lexical-builder-list/List", unknown, unknown>;
2
+ //# sourceMappingURL=ListExtension.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ListExtension.d.ts","sourceRoot":"","sources":["../src/ListExtension.ts"],"names":[],"mappings":"AAIA,eAAO,MAAM,aAAa,qKAIxB,CAAC"}
package/dist/index.d.ts CHANGED
@@ -6,6 +6,6 @@
6
6
  *
7
7
  */
8
8
  export declare const PACKAGE_VERSION: string;
9
- export { ListPlan } from './ListPlan';
10
- export { CheckListPlan } from './CheckListPlan';
9
+ export { ListExtension } from './ListExtension';
10
+ export { CheckListExtension } from './CheckListExtension';
11
11
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,eAAO,MAAM,eAAe,EAAE,MAAwC,CAAC;AAEvE,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AACtC,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,eAAO,MAAM,eAAe,EAAE,MAAwC,CAAC;AAEvE,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAChD,OAAO,EAAE,kBAAkB,EAAE,MAAM,sBAAsB,CAAC"}
package/dist/index.js CHANGED
@@ -1,7 +1,7 @@
1
- import { definePlan as E } from "@etrepum/lexical-builder";
1
+ import { defineExtension as _ } from "@etrepum/lexical-builder";
2
2
  import { INSERT_ORDERED_LIST_COMMAND as I, insertList as g, INSERT_UNORDERED_LIST_COMMAND as M, REMOVE_LIST_COMMAND as O, removeList as R, $handleListInsertParagraph as D, ListNode as A, ListItemNode as S, INSERT_CHECK_LIST_COMMAND as v, $isListItemNode as c, $isListNode as h } from "@lexical/list";
3
- import { mergeRegister as p, $findMatchingParent as P, isHTMLElement as N, calculateZoomLevel as T } from "@lexical/utils";
4
- import { COMMAND_PRIORITY_LOW as o, INSERT_PARAGRAPH_COMMAND as k, KEY_ARROW_DOWN_COMMAND as y, KEY_ARROW_UP_COMMAND as b, KEY_ESCAPE_COMMAND as K, KEY_SPACE_COMMAND as x, $getNearestNodeFromDOMNode as f, KEY_ARROW_LEFT_COMMAND as $, $getSelection as Y, $isRangeSelection as w, $isElementNode as F } from "lexical";
3
+ import { mergeRegister as p, $findMatchingParent as T, isHTMLElement as N, calculateZoomLevel as P } from "@lexical/utils";
4
+ import { COMMAND_PRIORITY_LOW as o, INSERT_PARAGRAPH_COMMAND as k, KEY_ARROW_DOWN_COMMAND as x, KEY_ARROW_UP_COMMAND as y, KEY_ESCAPE_COMMAND as b, KEY_SPACE_COMMAND as K, $getNearestNodeFromDOMNode as f, KEY_ARROW_LEFT_COMMAND as $, $getSelection as Y, $isRangeSelection as w, $isElementNode as F } from "lexical";
5
5
  function W(e) {
6
6
  return p(
7
7
  e.registerCommand(
@@ -26,18 +26,18 @@ function W(e) {
26
26
  )
27
27
  );
28
28
  }
29
- const U = E({
29
+ const U = _({
30
30
  name: "@etrepum/lexical-builder-list/List",
31
31
  nodes: [A, S],
32
32
  register: W
33
- }), j = E({
33
+ }), j = _({
34
34
  name: "@etrepum/lexical-builder-list/CheckList",
35
35
  dependencies: [U],
36
36
  register: B
37
37
  });
38
38
  function B(e) {
39
- function l(t) {
40
- L(t, () => {
39
+ function s(t) {
40
+ E(t, () => {
41
41
  const n = t.target;
42
42
  e.isEditable() && e.update(() => {
43
43
  if (t.target) {
@@ -48,7 +48,7 @@ function B(e) {
48
48
  });
49
49
  }
50
50
  function r(t) {
51
- L(t, () => {
51
+ E(t, () => {
52
52
  t.preventDefault();
53
53
  });
54
54
  }
@@ -59,17 +59,17 @@ function B(e) {
59
59
  o
60
60
  ),
61
61
  e.registerCommand(
62
- y,
63
- (t) => _(t, e, !1),
62
+ x,
63
+ (t) => L(t, e, !1),
64
64
  o
65
65
  ),
66
66
  e.registerCommand(
67
- b,
68
- (t) => _(t, e, !0),
67
+ y,
68
+ (t) => L(t, e, !0),
69
69
  o
70
70
  ),
71
71
  e.registerCommand(
72
- K,
72
+ b,
73
73
  (t) => {
74
74
  if (C() != null) {
75
75
  const i = e.getRootElement();
@@ -80,7 +80,7 @@ function B(e) {
80
80
  o
81
81
  ),
82
82
  e.registerCommand(
83
- x,
83
+ K,
84
84
  (t) => {
85
85
  const n = C();
86
86
  return n != null && e.isEditable() ? (e.update(() => {
@@ -95,16 +95,16 @@ function B(e) {
95
95
  (t) => e.getEditorState().read(() => {
96
96
  const n = Y();
97
97
  if (w(n) && n.isCollapsed()) {
98
- const { anchor: i } = n, s = i.type === "element";
99
- if (s || i.offset === 0) {
100
- const d = i.getNode(), u = P(
98
+ const { anchor: i } = n, l = i.type === "element";
99
+ if (l || i.offset === 0) {
100
+ const d = i.getNode(), a = T(
101
101
  d,
102
- (a) => F(a) && !a.isInline()
102
+ (u) => F(u) && !u.isInline()
103
103
  );
104
- if (c(u)) {
105
- const a = u.getParent();
106
- if (h(a) && a.getListType() === "check" && (s || u.getFirstDescendant() === d)) {
107
- const m = e.getElementByKey(u.__key);
104
+ if (c(a)) {
105
+ const u = a.getParent();
106
+ if (h(u) && u.getListType() === "check" && (l || a.getFirstDescendant() === d)) {
107
+ const m = e.getElementByKey(a.__key);
108
108
  if (m != null && document.activeElement !== m)
109
109
  return m.focus(), t.preventDefault(), !0;
110
110
  }
@@ -116,11 +116,11 @@ function B(e) {
116
116
  o
117
117
  ),
118
118
  e.registerRootListener((t, n) => {
119
- t !== null && (t.addEventListener("click", l), t.addEventListener("pointerdown", r)), n !== null && (n.removeEventListener("click", l), n.removeEventListener("pointerdown", r));
119
+ t !== null && (t.addEventListener("click", s), t.addEventListener("pointerdown", r)), n !== null && (n.removeEventListener("click", s), n.removeEventListener("pointerdown", r));
120
120
  })
121
121
  );
122
122
  }
123
- function L(e, l) {
123
+ function E(e, s) {
124
124
  const r = e.target;
125
125
  if (r === null || !N(r))
126
126
  return;
@@ -130,45 +130,45 @@ function L(e, l) {
130
130
  const n = r.parentNode;
131
131
  if (!n || n.__lexicalListType !== "check")
132
132
  return;
133
- const i = r.getBoundingClientRect(), s = e.pageX / T(r);
134
- (r.dir === "rtl" ? s < i.right && s > i.right - 20 : s > i.left && s < i.left + 20) && l();
133
+ const i = r.getBoundingClientRect(), l = e.pageX / P(r);
134
+ (r.dir === "rtl" ? l < i.right && l > i.right - 20 : l > i.left && l < i.left + 20) && s();
135
135
  }
136
136
  function C() {
137
137
  const e = document.activeElement;
138
138
  return e != null && e.tagName === "LI" && e.parentNode != null && // @ts-expect-error internal field
139
139
  e.parentNode.__lexicalListType === "check" ? e : null;
140
140
  }
141
- function H(e, l) {
142
- let r = l ? e.getPreviousSibling() : e.getNextSibling(), t = e;
141
+ function H(e, s) {
142
+ let r = s ? e.getPreviousSibling() : e.getNextSibling(), t = e;
143
143
  for (; r == null && c(t); )
144
- t = t.getParentOrThrow().getParent(), t != null && (r = l ? t.getPreviousSibling() : t.getNextSibling());
144
+ t = t.getParentOrThrow().getParent(), t != null && (r = s ? t.getPreviousSibling() : t.getNextSibling());
145
145
  for (; c(r); ) {
146
- const n = l ? r.getLastChild() : r.getFirstChild();
146
+ const n = s ? r.getLastChild() : r.getFirstChild();
147
147
  if (!h(n))
148
148
  return r;
149
- r = l ? n.getLastChild() : n.getFirstChild();
149
+ r = s ? n.getLastChild() : n.getFirstChild();
150
150
  }
151
151
  return null;
152
152
  }
153
- function _(e, l, r) {
153
+ function L(e, s, r) {
154
154
  const t = C();
155
- return t != null && l.update(() => {
155
+ return t != null && s.update(() => {
156
156
  const n = f(t);
157
157
  if (!c(n))
158
158
  return;
159
159
  const i = H(n, r);
160
160
  if (i != null) {
161
161
  i.selectStart();
162
- const s = l.getElementByKey(i.__key);
163
- s != null && (e.preventDefault(), setTimeout(() => {
164
- s.focus();
162
+ const l = s.getElementByKey(i.__key);
163
+ l != null && (e.preventDefault(), setTimeout(() => {
164
+ l.focus();
165
165
  }, 0));
166
166
  }
167
167
  }), !1;
168
168
  }
169
- const q = "0.0.36-nightly.20250714.0";
169
+ const q = "0.0.37-nightly.20250715.0";
170
170
  export {
171
- j as CheckListPlan,
172
- U as ListPlan,
171
+ j as CheckListExtension,
172
+ U as ListExtension,
173
173
  q as PACKAGE_VERSION
174
174
  };
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.37-nightly.20250715.0",
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/list": ">=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/list": ">=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": {
@@ -1,9 +0,0 @@
1
- /**
2
- * Copyright (c) Meta Platforms, Inc. and affiliates.
3
- *
4
- * This source code is licensed under the MIT license found in the
5
- * LICENSE file in the root directory of this source tree.
6
- *
7
- */
8
- export declare const CheckListPlan: import('@etrepum/lexical-builder').LexicalPlan<import('@etrepum/lexical-builder').PlanConfigBase, "@etrepum/lexical-builder-list/CheckList", unknown, unknown>;
9
- //# sourceMappingURL=CheckListPlan.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"CheckListPlan.d.ts","sourceRoot":"","sources":["../src/CheckListPlan.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AA+BH,eAAO,MAAM,aAAa,gKAIxB,CAAC"}
@@ -1,2 +0,0 @@
1
- export declare const ListPlan: import('@etrepum/lexical-builder').LexicalPlan<import('@etrepum/lexical-builder').PlanConfigBase, "@etrepum/lexical-builder-list/List", unknown, unknown>;
2
- //# sourceMappingURL=ListPlan.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"ListPlan.d.ts","sourceRoot":"","sources":["../src/ListPlan.ts"],"names":[],"mappings":"AAIA,eAAO,MAAM,QAAQ,2JAInB,CAAC"}