@haklex/rich-ext-poll 0.26.4 → 0.26.5

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.
@@ -2,8 +2,9 @@
2
2
  import { n as $isPollNode, o as _defineProperty, r as PollNode } from "./PollNode-CfWB5w1E.js";
3
3
  import { $getNodeByKey, $insertNodes } from "lexical";
4
4
  import { CalendarClock, ChevronDown, ChevronUp, Plus, Vote, X } from "lucide-react";
5
- import { createContext, createElement, useCallback, useContext, useEffect, useRef, useState } from "react";
5
+ import { createElement, useCallback, useEffect, useRef, useState } from "react";
6
6
  import { SegmentedControl, Select, SelectContent, SelectItem, SelectTrigger, SelectValue } from "@haklex/rich-editor-ui";
7
+ import { useLexicalComposerContext } from "@lexical/react/LexicalComposerContext";
7
8
  import { customAlphabet } from "nanoid";
8
9
  import { jsx, jsxs } from "react/jsx-runtime";
9
10
  //#region src/poll-edit.css.ts
@@ -30,25 +31,6 @@ var pollEditClasses = {
30
31
  modeControl: "jr1ls7j"
31
32
  };
32
33
  //#endregion
33
- //#region ../../node_modules/.pnpm/@lexical+react@0.45.0_react-dom@19.2.6_react@19.2.6__react@19.2.6_yjs@13.6.29/node_modules/@lexical/react/dist/LexicalComposerContext.prod.mjs
34
- /**
35
- * Copyright (c) Meta Platforms, Inc. and affiliates.
36
- *
37
- * This source code is licensed under the MIT license found in the
38
- * LICENSE file in the root directory of this source tree.
39
- *
40
- */
41
- var r = createContext(null);
42
- function o() {
43
- const n = useContext(r);
44
- return n ?? function(n, ...e) {
45
- const r = new URL("https://lexical.dev/docs/error"), t = new URLSearchParams();
46
- t.append("code", n);
47
- for (const n of e) t.append("v", n);
48
- throw r.search = t.toString(), Error(`Minified Lexical error #${n}; visit ${r.toString()} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`);
49
- }(8), n;
50
- }
51
- //#endregion
52
34
  //#region src/PollEditDecorator.tsx
53
35
  var makeOptionId = customAlphabet("abcdefghijklmnopqrstuvwxyz0123456789", 6);
54
36
  var pollModeItems = [{
@@ -101,7 +83,7 @@ function ImeSafeInput({ value, onValueChange, onCompositionEnd, ...rest }) {
101
83
  });
102
84
  }
103
85
  function PollEditDecorator({ closeAt, mode, nodeKey, options, pollId, question, showResults }) {
104
- const [editor] = o();
86
+ const [editor] = useLexicalComposerContext();
105
87
  const editable = editor.isEditable();
106
88
  const updatePoll = useCallback((mutate) => {
107
89
  editor.update(() => {
package/dist/edit.mjs CHANGED
@@ -1,3 +1,3 @@
1
1
  import { t as __augmentLoaded_poll } from "./augment-CFugN2li.js";
2
- import { a as pollEditClasses, i as PollEditDecorator, n as $createPollEditNode, r as PollEditNode, t as pollEditNodes } from "./edit-QZdkEyC6.js";
2
+ import { a as pollEditClasses, i as PollEditDecorator, n as $createPollEditNode, r as PollEditNode, t as pollEditNodes } from "./edit-BuAlzELm.js";
3
3
  export { $createPollEditNode, PollEditDecorator, PollEditNode, __augmentLoaded_poll, pollEditClasses, pollEditNodes };
package/dist/index.mjs CHANGED
@@ -1,5 +1,5 @@
1
1
  import { t as __augmentLoaded_poll } from "./augment-CFugN2li.js";
2
- import { a as pollEditClasses, i as PollEditDecorator, n as $createPollEditNode, r as PollEditNode, t as pollEditNodes } from "./edit-QZdkEyC6.js";
2
+ import { a as pollEditClasses, i as PollEditDecorator, n as $createPollEditNode, r as PollEditNode, t as pollEditNodes } from "./edit-BuAlzELm.js";
3
3
  import { a as createPollId, i as createOptionId, n as $isPollNode, r as PollNode, s as POLL_NODE_KEY, t as $createPollNode } from "./PollNode-CfWB5w1E.js";
4
4
  import { n as extractPolls, t as pollNodes } from "./node-LK_fhl3_.js";
5
5
  import { a as usePollDataAdapter, i as useInitialPollState, n as PollRenderer, o as pollClasses, r as PollDataProvider } from "./renderer-Dpuf1V70.js";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@haklex/rich-ext-poll",
3
- "version": "0.26.4",
3
+ "version": "0.26.5",
4
4
  "description": "Reader-facing vote/poll widget extension",
5
5
  "repository": {
6
6
  "type": "git",
@@ -38,7 +38,7 @@
38
38
  ],
39
39
  "dependencies": {
40
40
  "nanoid": "^5.1.11",
41
- "@haklex/rich-style-token": "0.26.4"
41
+ "@haklex/rich-style-token": "0.26.5"
42
42
  },
43
43
  "devDependencies": {
44
44
  "@lexical/react": "^0.45.0",
@@ -52,14 +52,15 @@
52
52
  "typescript": "^5.9.3",
53
53
  "unplugin-dts": "^1.0.1",
54
54
  "vite": "^8.0.14",
55
- "@haklex/rich-editor": "0.26.4"
55
+ "@haklex/rich-editor": "0.26.5"
56
56
  },
57
57
  "peerDependencies": {
58
+ "@lexical/react": "^0.45.0",
58
59
  "lexical": "^0.45.0",
59
60
  "lucide-react": "^1.0.0",
60
61
  "react": ">=19",
61
- "@haklex/rich-editor": "^0.26.4",
62
- "@haklex/rich-editor-ui": "^0.26.4"
62
+ "@haklex/rich-editor": "^0.26.5",
63
+ "@haklex/rich-editor-ui": "^0.26.5"
63
64
  },
64
65
  "publishConfig": {
65
66
  "access": "public"