reactjs-tiptap-editor 0.3.12 → 0.3.13
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/lib/{ActionMenuButton-BQ2ojtpo.js → ActionMenuButton-BfH5nAGi.js} +1 -1
- package/lib/{ActionMenuButton-OfnmanTP.cjs → ActionMenuButton-Cbbnqd-L.cjs} +1 -1
- package/lib/Attachment.cjs +2 -2
- package/lib/Attachment.js +5 -5
- package/lib/Blockquote.cjs +1 -1
- package/lib/Blockquote.js +2 -2
- package/lib/Bold.cjs +1 -1
- package/lib/Bold.js +2 -2
- package/lib/BulletList.cjs +1 -1
- package/lib/BulletList.js +2 -2
- package/lib/Clear.cjs +1 -1
- package/lib/Clear.js +2 -2
- package/lib/Code.cjs +1 -1
- package/lib/Code.js +2 -2
- package/lib/CodeBlock.cjs +1 -1
- package/lib/CodeBlock.js +3 -3
- package/lib/CodeView.cjs +1 -1
- package/lib/CodeView.js +2 -2
- package/lib/Color.cjs +1 -1
- package/lib/Color.js +3 -3
- package/lib/Document.js +1 -1
- package/lib/{Drawer-9QMJnenp.js → Drawer-DUXFBfgE.js} +3 -3
- package/lib/{Drawer-BN8H4Zb2.cjs → Drawer-jPHImfyr.cjs} +1 -1
- package/lib/Drawer.cjs +1 -1
- package/lib/Drawer.js +4 -4
- package/lib/Emoji.cjs +1 -1
- package/lib/Emoji.js +4 -4
- package/lib/{Excalidraw-B95hkXm5.js → Excalidraw-BBOIIhij.js} +3 -3
- package/lib/{Excalidraw-iG1WleD5.cjs → Excalidraw-CwZ3g3p-.cjs} +1 -1
- package/lib/Excalidraw.cjs +1 -1
- package/lib/Excalidraw.js +3 -3
- package/lib/ExportPdf.cjs +1 -1
- package/lib/ExportPdf.js +2 -2
- package/lib/ExportWord.cjs +1 -1
- package/lib/ExportWord.js +2 -2
- package/lib/FontFamily.cjs +1 -1
- package/lib/FontFamily.js +4 -4
- package/lib/FontSize.cjs +1 -1
- package/lib/FontSize.js +3 -3
- package/lib/FormatPainter.cjs +1 -1
- package/lib/FormatPainter.js +2 -2
- package/lib/Heading.cjs +1 -1
- package/lib/Heading.js +3 -3
- package/lib/Highlight.cjs +1 -1
- package/lib/Highlight.js +2 -2
- package/lib/History.cjs +1 -1
- package/lib/History.js +2 -2
- package/lib/HorizontalRule.cjs +1 -1
- package/lib/HorizontalRule.js +2 -2
- package/lib/Iframe.cjs +1 -1
- package/lib/Iframe.js +3 -3
- package/lib/Image.cjs +1 -1
- package/lib/Image.js +3 -3
- package/lib/ImageGif.cjs +1 -1
- package/lib/ImageGif.js +3 -3
- package/lib/ImportWord.cjs +1 -1
- package/lib/ImportWord.js +2 -2
- package/lib/Indent.cjs +1 -1
- package/lib/Indent.js +2 -2
- package/lib/Italic.cjs +1 -1
- package/lib/Italic.js +2 -2
- package/lib/Katex.cjs +1 -1
- package/lib/Katex.js +4 -4
- package/lib/LineHeight.cjs +1 -1
- package/lib/LineHeight.js +2 -2
- package/lib/Link.cjs +1 -5
- package/lib/Link.d.cts +3 -1
- package/lib/Link.d.ts +3 -1
- package/lib/Link.js +4 -1048
- package/lib/ListItem.js +1 -1
- package/lib/Mention.js +3 -3
- package/lib/Mermaid.cjs +2 -2
- package/lib/Mermaid.js +4 -4
- package/lib/MoreMark.cjs +1 -1
- package/lib/MoreMark.js +3 -3
- package/lib/MultiColumn.cjs +1 -1
- package/lib/MultiColumn.js +2 -2
- package/lib/OrderedList.cjs +1 -1
- package/lib/OrderedList.js +2 -2
- package/lib/RichTextEditor-C3sK_Ys3.cjs +141 -0
- package/lib/{RichTextEditor-CFwUKN9i.js → RichTextEditor-OW4s40FH.js} +4817 -3766
- package/lib/SearchAndReplace.cjs +1 -1
- package/lib/SearchAndReplace.js +2 -2
- package/lib/Selection.js +1 -1
- package/lib/SlashCommand.cjs +1 -1
- package/lib/SlashCommand.js +18 -18
- package/lib/Strike.cjs +1 -1
- package/lib/Strike.js +2 -2
- package/lib/SubAndSuperScript.cjs +1 -1
- package/lib/SubAndSuperScript.js +3 -3
- package/lib/Table.cjs +2 -2
- package/lib/Table.js +16 -16
- package/lib/TableOfContent.cjs +1 -1
- package/lib/TableOfContent.js +5 -5
- package/lib/TaskList.cjs +1 -1
- package/lib/TaskList.js +2 -2
- package/lib/TextAlign.cjs +1 -1
- package/lib/TextAlign.js +2 -2
- package/lib/TextBubble.cjs +1 -1
- package/lib/TextBubble.js +2 -2
- package/lib/TextDirection.cjs +1 -1
- package/lib/TextDirection.js +2 -2
- package/lib/TextUnderline.cjs +1 -1
- package/lib/TextUnderline.js +2 -2
- package/lib/TrailingNode.js +1 -1
- package/lib/{Twitter-ChRmdJB0.js → Twitter-2LOf4hFb.js} +44 -44
- package/lib/{Twitter-DbokWMq-.cjs → Twitter-Cg58uzB-.cjs} +3 -3
- package/lib/Twitter.cjs +1 -1
- package/lib/Twitter.js +3 -3
- package/lib/Video.cjs +1 -1
- package/lib/Video.js +2 -2
- package/lib/bubble-extra.cjs +2 -2
- package/lib/bubble-extra.js +6 -6
- package/lib/{dom-dataset-2RXYq9wp.js → dom-dataset-CHDbKz5J.js} +1 -1
- package/lib/{index-CXIIg9Sq.js → index-BWx1Mchx.js} +21 -21
- package/lib/{index-BGwJ0NfQ.js → index-DEFQHExY.js} +1 -1
- package/lib/{index-BkoojfPK.js → index-DIPntess.js} +1 -1
- package/lib/{index-fKx6CYUM.js → index-oQutU45z.js} +1 -1
- package/lib/index.cjs +1 -1
- package/lib/index.d.cts +2 -0
- package/lib/index.d.ts +2 -0
- package/lib/index.js +43 -43
- package/lib/{textarea-D5VHsW3K.js → textarea-DM-_io94.js} +1 -1
- package/lib/{textarea-BfhvC1nW.cjs → textarea-DNz8Tnud.cjs} +1 -1
- package/package.json +1 -1
- package/lib/RichTextEditor-COwI-b24.cjs +0 -137
package/lib/Table.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { a as de,
|
|
1
|
+
import { a as de, u as N, s as Pe, T as E, z as Oe, F as T, S as H, P as ke, D as oe, b as ne, g as Ie, B as Fe, N as U, v as je, x as Ve, m as J, C as Ke, E as Xe } from "./index-BWx1Mchx.js";
|
|
2
2
|
import { jsxs as Q, jsx as k } from "react/jsx-runtime";
|
|
3
|
-
import { P as Ge, m as qe, n as
|
|
3
|
+
import { P as Ge, m as qe, n as Ue, A as Je } from "./RichTextEditor-OW4s40FH.js";
|
|
4
4
|
import { useState as ee } from "react";
|
|
5
5
|
import { T as O, o as I, p as F } from "./index-D-DR0FPY.js";
|
|
6
6
|
var le, re;
|
|
@@ -1731,7 +1731,7 @@ class qt {
|
|
|
1731
1731
|
return e.type === "attributes" && (e.target === this.table || this.colgroup.contains(e.target));
|
|
1732
1732
|
}
|
|
1733
1733
|
}
|
|
1734
|
-
function
|
|
1734
|
+
function Ut(t, e, o, n) {
|
|
1735
1735
|
let l = 0, r = !0;
|
|
1736
1736
|
const s = [], i = t.firstChild;
|
|
1737
1737
|
if (!i)
|
|
@@ -1754,7 +1754,7 @@ function Jt(t, e, o, n) {
|
|
|
1754
1754
|
function Re(t, e) {
|
|
1755
1755
|
return t.createAndFill();
|
|
1756
1756
|
}
|
|
1757
|
-
function
|
|
1757
|
+
function Jt(t) {
|
|
1758
1758
|
if (t.cached.tableNodeTypes)
|
|
1759
1759
|
return t.cached.tableNodeTypes;
|
|
1760
1760
|
const e = {};
|
|
@@ -1764,7 +1764,7 @@ function Ut(t) {
|
|
|
1764
1764
|
}), t.cached.tableNodeTypes = e, e;
|
|
1765
1765
|
}
|
|
1766
1766
|
function Zt(t, e, o, n, l) {
|
|
1767
|
-
const r =
|
|
1767
|
+
const r = Jt(t), s = [], i = [];
|
|
1768
1768
|
for (let a = 0; a < o; a += 1) {
|
|
1769
1769
|
const u = Re(r.cell);
|
|
1770
1770
|
if (u && i.push(u), n) {
|
|
@@ -1791,7 +1791,7 @@ const X = ({ editor: t }) => {
|
|
|
1791
1791
|
return !1;
|
|
1792
1792
|
["tableCell", "tableHeader"].includes(r.type.name) && (o += 1);
|
|
1793
1793
|
}), o === e.ranges.length ? (t.commands.deleteTable(), !0) : !1;
|
|
1794
|
-
}, Qt =
|
|
1794
|
+
}, Qt = U.create({
|
|
1795
1795
|
name: "table",
|
|
1796
1796
|
// @ts-ignore
|
|
1797
1797
|
addOptions() {
|
|
@@ -1814,10 +1814,10 @@ const X = ({ editor: t }) => {
|
|
|
1814
1814
|
return [{ tag: "table" }];
|
|
1815
1815
|
},
|
|
1816
1816
|
renderHTML({ node: t, HTMLAttributes: e }) {
|
|
1817
|
-
const { colgroup: o, tableWidth: n, tableMinWidth: l } =
|
|
1817
|
+
const { colgroup: o, tableWidth: n, tableMinWidth: l } = Ut(t, this.options.cellMinWidth);
|
|
1818
1818
|
return [
|
|
1819
1819
|
"table",
|
|
1820
|
-
|
|
1820
|
+
J(this.options.HTMLAttributes, e, {
|
|
1821
1821
|
style: n ? `width: ${n}` : `min-width: ${l}`
|
|
1822
1822
|
}),
|
|
1823
1823
|
o,
|
|
@@ -1896,7 +1896,7 @@ const X = ({ editor: t }) => {
|
|
|
1896
1896
|
tableRole: je(Ve(t, "tableRole", e))
|
|
1897
1897
|
};
|
|
1898
1898
|
}
|
|
1899
|
-
}), eo =
|
|
1899
|
+
}), eo = U.create({
|
|
1900
1900
|
name: "tableHeader",
|
|
1901
1901
|
addOptions() {
|
|
1902
1902
|
return {
|
|
@@ -1929,7 +1929,7 @@ const X = ({ editor: t }) => {
|
|
|
1929
1929
|
];
|
|
1930
1930
|
},
|
|
1931
1931
|
renderHTML({ HTMLAttributes: t }) {
|
|
1932
|
-
return ["th",
|
|
1932
|
+
return ["th", J(this.options.HTMLAttributes, t), 0];
|
|
1933
1933
|
}
|
|
1934
1934
|
}), to = /(android|bb\d+|meego).+mobile|armv7l|avantgo|bada\/|blackberry|blazer|compal|elaine|fennec|hiptop|iemobile|ip(hone|od)|iris|kindle|lge |maemo|midp|mmp|mobile.+firefox|netfront|opera m(ob|in)i|palm( os)?|phone|p(ixi|re)\/|plucker|pocket|psp|series[46]0|samsungbrowser.*mobile|symbian|treo|up\.(browser|link)|vodafone|wap|windows (ce|phone)|xda|xiino/i, oo = /CrOS/, no = /android|ipad|playbook|silk/i;
|
|
1935
1935
|
function Me(t = {}) {
|
|
@@ -1973,7 +1973,7 @@ function lo(t) {
|
|
|
1973
1973
|
return /* @__PURE__ */ Q(Ge, { modal: !0, children: [
|
|
1974
1974
|
/* @__PURE__ */ k(qe, { asChild: !0, children: t == null ? void 0 : t.children }),
|
|
1975
1975
|
/* @__PURE__ */ k(
|
|
1976
|
-
|
|
1976
|
+
Ue,
|
|
1977
1977
|
{
|
|
1978
1978
|
align: "start",
|
|
1979
1979
|
className: "richtext-w-full !richtext-p-2",
|
|
@@ -2015,7 +2015,7 @@ function ro(t) {
|
|
|
2015
2015
|
t.disabled || t.editor.chain().focus().insertTable({ ...o, withHeaderRow: !1 }).run();
|
|
2016
2016
|
}
|
|
2017
2017
|
return /* @__PURE__ */ k(lo, { createTable: e, children: /* @__PURE__ */ k(
|
|
2018
|
-
|
|
2018
|
+
Je,
|
|
2019
2019
|
{
|
|
2020
2020
|
icon: t == null ? void 0 : t.icon,
|
|
2021
2021
|
tooltip: t == null ? void 0 : t.tooltip,
|
|
@@ -2079,7 +2079,7 @@ const co = Xe.create({
|
|
|
2079
2079
|
unsetTableCellBackground: () => Ne("", this.options)
|
|
2080
2080
|
};
|
|
2081
2081
|
}
|
|
2082
|
-
}), ao =
|
|
2082
|
+
}), ao = U.create({
|
|
2083
2083
|
name: "tableRow",
|
|
2084
2084
|
addOptions() {
|
|
2085
2085
|
return {
|
|
@@ -2094,7 +2094,7 @@ const co = Xe.create({
|
|
|
2094
2094
|
];
|
|
2095
2095
|
},
|
|
2096
2096
|
renderHTML({ HTMLAttributes: t }) {
|
|
2097
|
-
return ["tr",
|
|
2097
|
+
return ["tr", J(this.options.HTMLAttributes, t), 0];
|
|
2098
2098
|
}
|
|
2099
2099
|
}), uo = ao.extend({
|
|
2100
2100
|
addOptions() {
|
|
@@ -2107,7 +2107,7 @@ const co = Xe.create({
|
|
|
2107
2107
|
}
|
|
2108
2108
|
};
|
|
2109
2109
|
}
|
|
2110
|
-
}), fo =
|
|
2110
|
+
}), fo = U.create({
|
|
2111
2111
|
name: "tableCell",
|
|
2112
2112
|
addOptions() {
|
|
2113
2113
|
return {
|
|
@@ -2140,7 +2140,7 @@ const co = Xe.create({
|
|
|
2140
2140
|
];
|
|
2141
2141
|
},
|
|
2142
2142
|
renderHTML({ HTMLAttributes: t }) {
|
|
2143
|
-
return ["td",
|
|
2143
|
+
return ["td", J(this.options.HTMLAttributes, t), 0];
|
|
2144
2144
|
}
|
|
2145
2145
|
}), ho = fo.extend({
|
|
2146
2146
|
addOptions() {
|
package/lib/TableOfContent.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const h=require("./index-CSvnpArE.cjs"),p=require("./dom-dataset-Cuy-pIfj.cjs"),l=require("react/jsx-runtime"),c=require("react"),C=require("./index-Dz3YxLE7.cjs"),b=require("./RichTextEditor-
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const h=require("./index-CSvnpArE.cjs"),p=require("./dom-dataset-Cuy-pIfj.cjs"),l=require("react/jsx-runtime"),c=require("react"),C=require("./index-Dz3YxLE7.cjs"),b=require("./RichTextEditor-C3sK_Ys3.cjs"),g="_toc_aag8a_1",x="_visible_aag8a_7",T="_list_aag8a_11",O="_item_aag8a_16",f={toc:g,visible:x,list:T,item:O};function _(e){const o=[],a=[o];return e.forEach(n=>{let t=-1,s=a[n.level+t];for(;!s;)t-=1,s=a[n.level+t];s.push({...n,children:a[n.level]=[]})}),o}function y({editor:e}){const o=b.useEditableEditor(),[a,n]=c.useState([]),{t}=C.useLocale(),s=c.useCallback(()=>{const i=[],r=e.state.tr;e.state.doc.descendants((u,v)=>{if(u.type.name==="heading"){const d=`heading-${i.length+1}`;u.attrs.id!==d&&r.setNodeMarkup(v,void 0,{...u.attrs,id:d}),i.push({level:u.attrs.level,text:u.textContent,id:d})}}),r.setMeta("addToHistory",!1),r.setMeta("preventUpdate",!0),e.view.dispatch(r),n(i),e.eventEmitter&&e.eventEmitter.emit("TableOfContents",_(i))},[e]);return c.useEffect(()=>{if(e){if(!e.options.editable){s();return}return e.on("update",s),()=>{e.off("update",s)}}},[e,s]),c.useEffect(()=>{s()},[]),l.jsx(p.NodeViewWrapper,{className:p.clsx("tableOfContent",f.toc,o&&f.visible),children:o?l.jsxs("div",{style:{position:"relative"},children:[l.jsx("p",{className:"text-[20px] richtext-mb-[8px] richtext-font-semibold",children:t("editor.table_of_content")}),l.jsx("ul",{className:f.list,children:a.map((i,r)=>l.jsx("li",{className:f.item,style:{paddingLeft:`${i.level-1}rem`},children:l.jsx("a",{href:`#${i.id}`,children:i.text})},`table-of-content-${r}`))})]}):null})}function N(e,...o){const[a,n]=c.useState(!1);return c.useEffect(()=>{const t=()=>{n(e.isActive.apply(e,o))};return e.on("selectionUpdate",t),e.on("transaction",t),()=>{e.off("selectionUpdate",t),e.off("transaction",t)}},[e,o,n]),a}function A({editor:e,icon:o,tooltip:a}){const n=N(e,m.name),t=c.useCallback(()=>{if(n){e.chain().focus().removeTableOfContents().run();return}e.chain().focus().setTableOfContents().run()},[e,n]);return l.jsx(b.ActionButton,{action:t,isActive:()=>n||!1,icon:o,tooltip:a})}function j(e){return e&&e.type.name==="title"}function E(e,o){const n=[e.getJSON()],t=[];for(;n.length>0;){const s=n.shift();s.type===o&&t.push(s),s.content&&s.content.length>0&&n.push(...s.content)}return t}const m=h.Node.create({name:"tableOfContents",group:"block",atom:!0,addOptions(){var e;return{...(e=this.parent)==null?void 0:e.call(this),onHasOneBeforeInsert:()=>{},resizable:!0,lastColumnResizable:!0,allowTableNodeSelection:!1,button:({editor:o,t:a})=>({component:A,componentProps:{disabled:!1,icon:"BookMarked",tooltip:a("editor.table_of_content"),editor:o}})}},parseHTML(){return[{tag:"toc"}]},renderHTML({HTMLAttributes:e}){return["toc",h.mergeAttributes(e)]},addNodeView(){return p.ReactNodeViewRenderer(y)},addCommands(){return{setTableOfContents:()=>({commands:e,editor:o,view:a})=>{if(E(o,this.name).length>0){this.options.onHasOneBeforeInsert();return}const t=a.props.state.doc.content.firstChild;if(j(t)){const s=(t.firstChild&&t.firstChild.nodeSize||0)+1;return e.insertContentAt(s,{type:this.name})}return e.insertContent({type:this.name})},removeTableOfContents:()=>({state:e,dispatch:o})=>{const{tr:a}=e,n=e.schema.nodes.tableOfContents;return e.doc.descendants((t,s)=>{if(t.type===n){const i=s,r=s+t.nodeSize;a.delete(i,r)}}),a.docChanged?(o(a),!0):!1}}},addGlobalAttributes(){return[{types:["heading"],attributes:{id:{default:null}}}]}});exports.TableOfContents=m;
|
package/lib/TableOfContent.js
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { N as b, m as v } from "./index-
|
|
2
|
-
import { N as C, c as g, R as N } from "./dom-dataset-
|
|
1
|
+
import { N as b, m as v } from "./index-BWx1Mchx.js";
|
|
2
|
+
import { N as C, c as g, R as N } from "./dom-dataset-CHDbKz5J.js";
|
|
3
3
|
import { jsx as l, jsxs as T } from "react/jsx-runtime";
|
|
4
4
|
import { useState as p, useCallback as m, useEffect as d } from "react";
|
|
5
|
-
import { u as
|
|
6
|
-
import {
|
|
5
|
+
import { u as O } from "./index-D-DR0FPY.js";
|
|
6
|
+
import { Z as _, A as y } from "./RichTextEditor-OW4s40FH.js";
|
|
7
7
|
const x = "_toc_aag8a_1", A = "_visible_aag8a_7", w = "_list_aag8a_11", E = "_item_aag8a_16", f = {
|
|
8
8
|
toc: x,
|
|
9
9
|
visible: A,
|
|
@@ -20,7 +20,7 @@ function k(t) {
|
|
|
20
20
|
}), o;
|
|
21
21
|
}
|
|
22
22
|
function M({ editor: t }) {
|
|
23
|
-
const o =
|
|
23
|
+
const o = _(), [a, n] = p([]), { t: e } = O(), s = m(() => {
|
|
24
24
|
const i = [], r = t.state.tr;
|
|
25
25
|
t.state.doc.descendants((c, h) => {
|
|
26
26
|
if (c.type.name === "heading") {
|
package/lib/TaskList.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const a=require("./index-CSvnpArE.cjs"),k=require("./RichTextEditor-
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const a=require("./index-CSvnpArE.cjs"),k=require("./RichTextEditor-C3sK_Ys3.cjs"),b=/^\s*(\[([( |x])?\])\s$/,f=a.Node.create({name:"taskItem",addOptions(){return{nested:!1,HTMLAttributes:{},taskListTypeName:"taskList"}},content(){return this.options.nested?"paragraph block*":"paragraph+"},defining:!0,addAttributes(){return{checked:{default:!1,keepOnSplit:!1,parseHTML:t=>{const n=t.getAttribute("data-checked");return n===""||n==="true"},renderHTML:t=>({"data-checked":t.checked})}}},parseHTML(){return[{tag:`li[data-type="${this.name}"]`,priority:51}]},renderHTML({node:t,HTMLAttributes:n}){return["li",a.mergeAttributes(this.options.HTMLAttributes,n,{"data-type":this.name}),["label",["input",{type:"checkbox",checked:t.attrs.checked?"checked":null}],["span"]],["div",0]]},addKeyboardShortcuts(){const t={Enter:()=>this.editor.commands.splitListItem(this.name),"Shift-Tab":()=>this.editor.commands.liftListItem(this.name)};return this.options.nested?{...t,Tab:()=>this.editor.commands.sinkListItem(this.name)}:t},addNodeView(){return({node:t,HTMLAttributes:n,getPos:c,editor:o})=>{const i=document.createElement("li"),d=document.createElement("label"),m=document.createElement("span"),s=document.createElement("input"),p=document.createElement("div");return d.contentEditable="false",s.type="checkbox",s.addEventListener("mousedown",e=>e.preventDefault()),s.addEventListener("change",e=>{if(!o.isEditable&&!this.options.onReadOnlyChecked){s.checked=!s.checked;return}const{checked:r}=e.target;o.isEditable&&typeof c=="function"&&o.chain().focus(void 0,{scrollIntoView:!1}).command(({tr:l})=>{const u=c();if(typeof u!="number")return!1;const h=l.doc.nodeAt(u);return l.setNodeMarkup(u,void 0,{...h==null?void 0:h.attrs,checked:r}),!0}).run(),!o.isEditable&&this.options.onReadOnlyChecked&&(this.options.onReadOnlyChecked(t,r)||(s.checked=!s.checked))}),Object.entries(this.options.HTMLAttributes).forEach(([e,r])=>{i.setAttribute(e,r)}),i.dataset.checked=t.attrs.checked,s.checked=t.attrs.checked,d.append(s,m),i.append(d,p),Object.entries(n).forEach(([e,r])=>{i.setAttribute(e,r)}),{dom:i,contentDOM:p,update:e=>e.type!==this.type?!1:(i.dataset.checked=e.attrs.checked,s.checked=e.attrs.checked,!0)}}},addInputRules(){return[a.wrappingInputRule({find:b,type:this.type,getAttributes:t=>({checked:t[t.length-1]==="x"})})]}}),L=a.Node.create({name:"taskList",addOptions(){return{itemTypeName:"taskItem",HTMLAttributes:{}}},group:"block list",content(){return`${this.options.itemTypeName}+`},parseHTML(){return[{tag:`ul[data-type="${this.name}"]`,priority:51}]},renderHTML({HTMLAttributes:t}){return["ul",a.mergeAttributes(this.options.HTMLAttributes,t,{"data-type":this.name}),0]},addCommands(){return{toggleTaskList:()=>({commands:t})=>t.toggleList(this.name,this.options.itemTypeName)}},addKeyboardShortcuts(){return{"Mod-Shift-9":()=>this.editor.commands.toggleTaskList()}}}),T=L.extend({addOptions(){var t;return{...(t=this.parent)==null?void 0:t.call(this),HTMLAttributes:{class:"task-list"},taskItem:{HTMLAttributes:{class:"task-list-item"}},button:({editor:n,t:c})=>({component:k.ActionButton,componentProps:{action:()=>n.commands.toggleTaskList(),isActive:()=>n.isActive("taskList")||!1,disabled:!1,icon:"ListTodo",shortcutKeys:["shift","mod","9"],tooltip:c("editor.tasklist.tooltip")}})}},addExtensions(){return[f.configure(this.options.taskItem)]}});exports.TaskList=T;
|
package/lib/TaskList.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { N as m, w as b, m as l } from "./index-
|
|
2
|
-
import { A as f } from "./RichTextEditor-
|
|
1
|
+
import { N as m, w as b, m as l } from "./index-BWx1Mchx.js";
|
|
2
|
+
import { A as f } from "./RichTextEditor-OW4s40FH.js";
|
|
3
3
|
const L = /^\s*(\[([( |x])?\])\s$/, T = m.create({
|
|
4
4
|
name: "taskItem",
|
|
5
5
|
addOptions() {
|
package/lib/TextAlign.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const y=require("./index-CSvnpArE.cjs"),n=require("react/jsx-runtime"),T=require("react"),s=require("./RichTextEditor-
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const y=require("./index-CSvnpArE.cjs"),n=require("react/jsx-runtime"),T=require("react"),s=require("./RichTextEditor-C3sK_Ys3.cjs"),j=y.Extension.create({name:"textAlign",addOptions(){return{types:[],alignments:["left","center","right","justify"],defaultAlignment:null}},addGlobalAttributes(){return[{types:this.options.types,attributes:{textAlign:{default:this.options.defaultAlignment,parseHTML:t=>{const e=t.style.textAlign;return this.options.alignments.includes(e)?e:this.options.defaultAlignment},renderHTML:t=>t.textAlign?{style:`text-align: ${t.textAlign}`}:{}}}}]},addCommands(){return{setTextAlign:t=>({commands:e})=>this.options.alignments.includes(t)?this.options.types.map(l=>e.updateAttributes(l,{textAlign:t})).every(l=>l):!1,unsetTextAlign:()=>({commands:t})=>this.options.types.map(e=>t.resetAttributes(e,"textAlign")).every(e=>e),toggleTextAlign:t=>({editor:e,commands:l})=>this.options.alignments.includes(t)?e.isActive({textAlign:t})?l.unsetTextAlign():l.setTextAlign(t):!1}},addKeyboardShortcuts(){return{"Mod-Shift-l":()=>this.editor.commands.setTextAlign("left"),"Mod-Shift-e":()=>this.editor.commands.setTextAlign("center"),"Mod-Shift-r":()=>this.editor.commands.setTextAlign("right"),"Mod-Shift-j":()=>this.editor.commands.setTextAlign("justify")}}});function b(t){var l;const e=T.useMemo(()=>{var o;const i=(o=t==null?void 0:t.items)==null?void 0:o.find(a=>a.isActive());return i&&!i.default?{...i,icon:i.icon?i.icon:t.icon}:{title:t==null?void 0:t.tooltip,icon:t.icon,isActive:()=>!1}},[t]);return n.jsxs(s.Popover,{modal:!0,children:[n.jsx(s.PopoverTrigger,{asChild:!0,disabled:t==null?void 0:t.disabled,children:n.jsx(s.ActionButton,{customClass:"!richtext-w-12 richtext-h-12",disabled:t==null?void 0:t.disabled,icon:t==null?void 0:t.icon,tooltip:t==null?void 0:t.tooltip,children:n.jsx(s.IconComponent,{className:"richtext-ml-1 richtext-size-3 richtext-text-zinc-500",name:"MenuDown"})})}),n.jsx(s.PopoverContent,{align:"start",className:"richtext-flex richtext-w-full richtext-min-w-4 richtext-flex-row richtext-gap-1 !richtext-p-[4px]",side:"bottom",children:(l=t==null?void 0:t.items)==null?void 0:l.map((i,d)=>{var o,a;return n.jsxs(s.Tooltip,{children:[n.jsx(s.TooltipTrigger,{asChild:!0,children:n.jsx(s.Toggle,{className:"richtext-size-7 richtext-p-1","data-state":e.title===i.title?"on":"off",onClick:i==null?void 0:i.action,pressed:e.title===i.title,size:"sm",children:(i==null?void 0:i.icon)&&n.jsx(s.IconComponent,{name:i.icon})})}),n.jsxs(s.TooltipContent,{className:"richtext-flex richtext-flex-col richtext-items-center",children:[n.jsx("span",{children:i.title}),!!((o=i.shortcutKeys)!=null&&o.length)&&n.jsx("span",{children:(a=i.shortcutKeys)==null?void 0:a.map(r=>s.getShortcutKey(r)).join(" ")})]})]},`text-align-${d}`)})})]})}const v=j.extend({addOptions(){var t;return{...(t=this.parent)==null?void 0:t.call(this),types:["heading","paragraph","list_item","title"],button({editor:e,extension:l,t:i}){var x;const d=((x=l.options)==null?void 0:x.alignments)||[],o={left:["mod","Shift","L"],center:["mod","Shift","E"],right:["mod","Shift","R"],justify:["mod","Shift","J"]},a={left:"AlignLeft",center:"AlignCenter",right:"AlignRight",justify:"AlignJustify"},r=d.map(c=>{var g,h,f;return{title:i(`editor.textalign.${c}.tooltip`),icon:a[c],shortcutKeys:o[c],isActive:()=>e.isActive({textAlign:c})||!1,action:()=>{var u,A;return(A=(u=e.commands)==null?void 0:u.setTextAlign)==null?void 0:A.call(u,c)},disabled:!((f=(h=(g=e==null?void 0:e.can)==null?void 0:g.call(e))==null?void 0:h.setTextAlign)!=null&&f.call(h,c))}}),m=r.filter(c=>c.disabled).length===r.length;return{component:b,componentProps:{icon:"AlignJustify",tooltip:i("editor.textalign.tooltip"),disabled:m,items:r}}}}}});exports.TextAlign=v;
|
package/lib/TextAlign.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { E as y } from "./index-
|
|
1
|
+
import { E as y } from "./index-BWx1Mchx.js";
|
|
2
2
|
import { jsxs as g, jsx as l } from "react/jsx-runtime";
|
|
3
3
|
import { useMemo as b } from "react";
|
|
4
|
-
import { P as v, m as M, A as S, k as A, n as C, T as j, a as K, r as w, b as P, s as z } from "./RichTextEditor-
|
|
4
|
+
import { P as v, m as M, A as S, k as A, n as C, T as j, a as K, r as w, b as P, s as z } from "./RichTextEditor-OW4s40FH.js";
|
|
5
5
|
const L = y.create({
|
|
6
6
|
name: "textAlign",
|
|
7
7
|
addOptions() {
|
package/lib/TextBubble.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const h=require("./index-CSvnpArE.cjs"),t=require("react/jsx-runtime"),l=require("react"),x=require("lucide-react"),
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const h=require("./index-CSvnpArE.cjs"),t=require("react/jsx-runtime"),l=require("react"),x=require("lucide-react"),n=require("./RichTextEditor-C3sK_Ys3.cjs"),g=require("./index-Dz3YxLE7.cjs");function b(e){const{t:i}=g.useLocale(),c=l.useMemo(()=>[{name:"paragraph",label:i("editor.paragraph.tooltip"),iconName:"Heading1",isActive:()=>e.editor.isActive("paragraph")&&!e.editor.isActive("orderedList")&&!e.editor.isActive("bulletList")&&!e.editor.isActive("taskList"),action:()=>e.editor.chain().focus().clearNodes().run()},{name:"heading1",label:i("editor.heading.h1.tooltip"),isActive:()=>e.editor.isActive("heading",{level:1}),iconName:"Heading1",action:()=>e.editor.chain().focus().clearNodes().toggleHeading({level:1}).run()},{name:"heading2",label:i("editor.heading.h2.tooltip"),isActive:()=>e.editor.isActive("heading",{level:2}),iconName:"Heading2",action:()=>e.editor.chain().focus().clearNodes().toggleHeading({level:2}).run()},{name:"heading3",label:i("editor.heading.h3.tooltip"),isActive:()=>e.editor.isActive("heading",{level:3}),iconName:"Heading3",action:()=>e.editor.chain().focus().clearNodes().toggleHeading({level:3}).run()},{name:"bulletList",label:i("editor.bulletlist.tooltip"),isActive:()=>e.editor.isActive("bulletList"),iconName:"List",action:()=>e.editor.chain().focus().clearNodes().toggleBulletList().run()},{name:"numberedList",label:i("editor.orderedlist.tooltip"),isActive:()=>e.editor.isActive("orderedList"),iconName:"ListOrdered",action:()=>e.editor.chain().focus().clearNodes().toggleOrderedList().run()},{name:"taskList",label:i("editor.tasklist.tooltip"),isActive:()=>e.editor.isActive("taskList"),iconName:"ListTodo",action:()=>e.editor.chain().focus().clearNodes().toggleTaskList().run()},{name:"blockquote",label:i("editor.blockquote.tooltip"),isActive:()=>e.editor.isActive("blockquote"),iconName:"TextQuote",action:()=>e.editor.chain().focus().clearNodes().toggleBlockquote().run()}],[e.editor,i]),a=l.useMemo(()=>c.findLast(o=>o.isActive())??{label:"Empty"},[c]);return t.jsxs(n.DropdownMenu,{children:[t.jsx(n.DropdownMenuTrigger,{asChild:!0,children:t.jsxs(n.Button,{className:"richtext-flex richtext-h-[32px] richtext-gap-1 richtext-px-1.5",variant:"ghost",children:[t.jsxs("span",{className:"richtext-whitespace-nowrap richtext-text-sm richtext-font-normal",children:[" ",a==null?void 0:a.label]}),t.jsx(x.ChevronDown,{className:"richtext-size-4"})]})}),t.jsx(n.DropdownMenuContent,{align:"start",className:"richtext-w-full richtext-p-1",hideWhenDetached:!0,sideOffset:5,children:c.map((o,d)=>{var r;const u=n.icons[o.iconName];return t.jsx(n.DropdownMenuCheckboxItem,{checked:((r=o.isActive)==null?void 0:r.call(o))||!1,className:"richtext-cursor-pointer",onClick:()=>o.action(),children:t.jsxs("div",{className:"richtext-flex richtext-items-center richtext-gap-2 richtext-px-2",children:[t.jsx(u,{className:"richtext-h3 richtext-w-3"}),t.jsxs("span",{children:[" ",o.label]})]})},`text-bubble-${d}`)})})]})}const s=h.Extension.create({name:"text-bubble",addOptions(){var e;return{...(e=this.parent)==null?void 0:e.call(this),toolbar:!1,button:()=>({component:b,componentProps:{}})}}});exports.TextBubble=s;exports.default=s;
|
package/lib/TextBubble.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { E as h } from "./index-
|
|
1
|
+
import { E as h } from "./index-BWx1Mchx.js";
|
|
2
2
|
import { jsxs as o, jsx as a } from "react/jsx-runtime";
|
|
3
3
|
import { useMemo as l } from "react";
|
|
4
4
|
import { ChevronDown as u } from "lucide-react";
|
|
5
|
-
import { D as m, e as g, B as x, f as b, i as v, h as f } from "./RichTextEditor-
|
|
5
|
+
import { D as m, e as g, B as x, f as b, i as v, h as f } from "./RichTextEditor-OW4s40FH.js";
|
|
6
6
|
import { u as N } from "./index-D-DR0FPY.js";
|
|
7
7
|
function A(e) {
|
|
8
8
|
const { t } = N(), c = l(() => [
|
package/lib/TextDirection.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const b=require("./index-CSvnpArE.cjs"),i=require("react/jsx-runtime"),g=require("react"),n=require("./RichTextEditor-C3sK_Ys3.cjs");function m(t){var s;const c=g.useMemo(()=>{var r;const e=(r=t==null?void 0:t.items)==null?void 0:r.find(o=>o.isActive());return e&&!e.default?{...e,icon:e.icon?e.icon:t.icon}:{title:t==null?void 0:t.tooltip,icon:t.icon,isActive:()=>!1}},[t]);return i.jsxs(n.Popover,{modal:!0,children:[i.jsx(n.PopoverTrigger,{asChild:!0,disabled:t==null?void 0:t.disabled,children:i.jsx(n.ActionButton,{customClass:"!richtext-w-12 richtext-h-12",disabled:t==null?void 0:t.disabled,icon:t==null?void 0:t.icon,tooltip:t==null?void 0:t.tooltip,children:i.jsx(n.IconComponent,{className:"richtext-ml-1 richtext-size-3 richtext-text-zinc-500",name:"MenuDown"})})}),i.jsx(n.PopoverContent,{align:"start",className:"richtext-flex richtext-w-full richtext-min-w-4 richtext-flex-row richtext-gap-1 !richtext-p-[4px]",side:"bottom",children:(s=t==null?void 0:t.items)==null?void 0:s.map((e,a)=>{var r,o;return i.jsxs(n.Tooltip,{children:[i.jsx(n.TooltipTrigger,{asChild:!0,children:i.jsx(n.Toggle,{className:"richtext-size-7 richtext-p-1","data-state":c.title===e.title?"on":"off",onClick:e==null?void 0:e.action,pressed:c.title===e.title,size:"sm",children:(e==null?void 0:e.icon)&&i.jsx(n.IconComponent,{name:e.icon})})}),i.jsxs(n.TooltipContent,{className:"richtext-flex richtext-flex-col richtext-items-center",children:[i.jsx("span",{children:e.title}),!!((r=e.shortcutKeys)!=null&&r.length)&&i.jsx("span",{children:(o=e.shortcutKeys)==null?void 0:o.map(x=>n.getShortcutKey(x)).join(" ")})]})]},`text-align-${a}`)})})]})}const j=b.Extension.create({name:"text-direction",addOptions(){var t;return{...(t=this.parent)==null?void 0:t.call(this),types:["heading","paragraph"],directions:["auto","ltr","rtl"],defaultDirection:"auto",button({editor:c,extension:s,t:e}){var h;const a=((h=s.options)==null?void 0:h.directions)||[],r={auto:"TextDirection",ltr:"LeftToRight",rtl:"RightToLeft"},o=a.map(l=>({title:e(`editor.textDirection.${l}.tooltip`),icon:r[l],isActive:()=>!1,action:()=>{var d,f,u,T;if(l==="auto"){(f=(d=c.commands)==null?void 0:d.unsetTextDirection)==null||f.call(d);return}(T=(u=c.commands)==null?void 0:u.setTextDirection)==null||T.call(u,l)},disabled:!1})),x=o.filter(l=>l.disabled).length===o.length;return{component:m,componentProps:{icon:"TextDirection",tooltip:e("editor.textDirection.tooltip"),disabled:x,items:o}}}}},addGlobalAttributes(){return[{types:this.options.types,attributes:{dir:{default:this.options.defaultDirection,parseHTML:t=>t.attributes.dir&&this.options.directions.includes(t.attributes.dir)?t.attributes.dir.value:this.options.defaultDirection,renderHTML:t=>({dir:t.dir})}}}]},addCommands(){return{setTextDirection:t=>({commands:c})=>this.options.directions.includes(t)?this.options.types.every(s=>c.updateAttributes(s,{dir:t})):!1,unsetTextDirection:()=>({commands:t})=>this.options.types.every(c=>t.resetAttributes(c,"dir"))}}});exports.TextDirection=j;
|
package/lib/TextDirection.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { E as b } from "./index-
|
|
1
|
+
import { E as b } from "./index-BWx1Mchx.js";
|
|
2
2
|
import { jsxs as h, jsx as n } from "react/jsx-runtime";
|
|
3
3
|
import { useMemo as g } from "react";
|
|
4
|
-
import { P as D, m as v, A as y, k as T, n as A, T as C, a as w, r as M, b as P, s as z } from "./RichTextEditor-
|
|
4
|
+
import { P as D, m as v, A as y, k as T, n as A, T as C, a as w, r as M, b as P, s as z } from "./RichTextEditor-OW4s40FH.js";
|
|
5
5
|
function L(t) {
|
|
6
6
|
var c;
|
|
7
7
|
const i = g(() => {
|
package/lib/TextUnderline.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const n=require("./index-CSvnpArE.cjs"),i=require("./RichTextEditor-
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const n=require("./index-CSvnpArE.cjs"),i=require("./RichTextEditor-C3sK_Ys3.cjs"),o=n.Mark.create({name:"underline",addOptions(){return{HTMLAttributes:{}}},parseHTML(){return[{tag:"u"},{style:"text-decoration",consuming:!1,getAttrs:e=>e.includes("underline")?{}:!1}]},renderHTML({HTMLAttributes:e}){return["u",n.mergeAttributes(this.options.HTMLAttributes,e),0]},addCommands(){return{setUnderline:()=>({commands:e})=>e.setMark(this.name),toggleUnderline:()=>({commands:e})=>e.toggleMark(this.name),unsetUnderline:()=>({commands:e})=>e.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-u":()=>this.editor.commands.toggleUnderline(),"Mod-U":()=>this.editor.commands.toggleUnderline()}}}),s=o.extend({addOptions(){var e;return{...(e=this.parent)==null?void 0:e.call(this),button({editor:t,t:r}){return{component:i.ActionButton,componentProps:{action:()=>t.commands.toggleUnderline(),isActive:()=>t.isActive("underline")||!1,disabled:!1,icon:"Underline",shortcutKeys:["mod","U"],tooltip:r("editor.underline.tooltip")}}}}}});exports.TextUnderline=s;
|
package/lib/TextUnderline.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { M as r, m as o } from "./index-
|
|
2
|
-
import { A as i } from "./RichTextEditor-
|
|
1
|
+
import { M as r, m as o } from "./index-BWx1Mchx.js";
|
|
2
|
+
import { A as i } from "./RichTextEditor-OW4s40FH.js";
|
|
3
3
|
const s = r.create({
|
|
4
4
|
name: "underline",
|
|
5
5
|
addOptions() {
|
package/lib/TrailingNode.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { N as $t, m as Vt,
|
|
2
|
-
import { c as H, N as jt, R as Bt } from "./dom-dataset-
|
|
1
|
+
import { N as $t, m as Vt, G as Mt } from "./index-BWx1Mchx.js";
|
|
2
|
+
import { c as H, N as jt, R as Bt } from "./dom-dataset-CHDbKz5J.js";
|
|
3
3
|
import { jsx as r, jsxs as g, Fragment as Wt } from "react/jsx-runtime";
|
|
4
4
|
import de, { useState as ce, Fragment as Ft, useEffect as Pe, useMemo as gt, createContext as Pt, useLayoutEffect as Ut, useContext as Ht, useRef as X, useCallback as Te, useDebugValue as zt } from "react";
|
|
5
|
-
import { L as Gt, o as Kt, B as Xt, P as Qt, m as Jt, A as Yt, k as Zt, n as en } from "./RichTextEditor-
|
|
5
|
+
import { L as Gt, o as Kt, B as Xt, P as Qt, m as Jt, A as Yt, k as Zt, n as en } from "./RichTextEditor-OW4s40FH.js";
|
|
6
6
|
import { u as tn } from "./index-D-DR0FPY.js";
|
|
7
7
|
const nn = "_verified_lvyh0_1", Ue = {
|
|
8
8
|
verified: nn
|
|
@@ -135,10 +135,10 @@ const nn = "_verified_lvyh0_1", Ue = {
|
|
|
135
135
|
separator: Tn,
|
|
136
136
|
brand: xn,
|
|
137
137
|
twitterIcon: bn
|
|
138
|
-
}, En = "_verifiedOld_lcna5_1", Nn = "_verifiedBlue_lcna5_4",
|
|
138
|
+
}, En = "_verifiedOld_lcna5_1", Nn = "_verifiedBlue_lcna5_4", Rn = "_verifiedGovernment_lcna5_7", xe = {
|
|
139
139
|
verifiedOld: En,
|
|
140
140
|
verifiedBlue: Nn,
|
|
141
|
-
verifiedGovernment:
|
|
141
|
+
verifiedGovernment: Rn
|
|
142
142
|
}, yt = ({ user: e, className: t }) => {
|
|
143
143
|
const n = e.verified || e.is_blue_verified || e.verified_type;
|
|
144
144
|
let o = /* @__PURE__ */ r(rn, {}), i = xe.verifiedBlue;
|
|
@@ -155,7 +155,7 @@ const nn = "_verified_lvyh0_1", Ue = {
|
|
|
155
155
|
className: H(t, i),
|
|
156
156
|
children: o
|
|
157
157
|
}) : null;
|
|
158
|
-
},
|
|
158
|
+
}, On = ({ tweet: e, components: t }) => {
|
|
159
159
|
var n;
|
|
160
160
|
const o = (n = t == null ? void 0 : t.AvatarImg) != null ? n : wt, { user: i } = e;
|
|
161
161
|
return /* @__PURE__ */ g("div", {
|
|
@@ -603,14 +603,14 @@ const Gn = (e) => ({
|
|
|
603
603
|
})
|
|
604
604
|
})
|
|
605
605
|
]
|
|
606
|
-
}), Tr = "_actions_n2anf_1", xr = "_like_n2anf_13", br = "_reply_n2anf_14", Er = "_copy_n2anf_15", Nr = "_likeIconWrapper_n2anf_27",
|
|
606
|
+
}), Tr = "_actions_n2anf_1", xr = "_like_n2anf_13", br = "_reply_n2anf_14", Er = "_copy_n2anf_15", Nr = "_likeIconWrapper_n2anf_27", Rr = "_likeCount_n2anf_30", Or = "_replyIconWrapper_n2anf_35", Lr = "_copyIconWrapper_n2anf_36", Ir = "_likeIcon_n2anf_27", kr = "_replyIcon_n2anf_35", Cr = "_copyIcon_n2anf_36", Dr = "_replyText_n2anf_56", qr = "_copyText_n2anf_57", I = {
|
|
607
607
|
actions: Tr,
|
|
608
608
|
like: xr,
|
|
609
609
|
reply: br,
|
|
610
610
|
copy: Er,
|
|
611
611
|
likeIconWrapper: Nr,
|
|
612
|
-
likeCount:
|
|
613
|
-
replyIconWrapper:
|
|
612
|
+
likeCount: Rr,
|
|
613
|
+
replyIconWrapper: Or,
|
|
614
614
|
copyIconWrapper: Lr,
|
|
615
615
|
likeIcon: Ir,
|
|
616
616
|
replyIcon: kr,
|
|
@@ -843,7 +843,7 @@ const Gn = (e) => ({
|
|
|
843
843
|
]);
|
|
844
844
|
return /* @__PURE__ */ g(He, {
|
|
845
845
|
children: [
|
|
846
|
-
/* @__PURE__ */ r(
|
|
846
|
+
/* @__PURE__ */ r(On, {
|
|
847
847
|
tweet: o,
|
|
848
848
|
components: t
|
|
849
849
|
}),
|
|
@@ -978,7 +978,7 @@ function uo() {
|
|
|
978
978
|
var S = typeof window > "u" || typeof window.document > "u" || typeof window.document.createElement > "u" ? _ : u;
|
|
979
979
|
return Ne.useSyncExternalStore = e.useSyncExternalStore !== void 0 ? e.useSyncExternalStore : S, Ne;
|
|
980
980
|
}
|
|
981
|
-
var
|
|
981
|
+
var Re = {};
|
|
982
982
|
/**
|
|
983
983
|
* @license React
|
|
984
984
|
* use-sync-external-store-shim.development.js
|
|
@@ -1038,8 +1038,8 @@ function fo() {
|
|
|
1038
1038
|
}
|
|
1039
1039
|
typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ < "u" && typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart == "function" && __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(Error());
|
|
1040
1040
|
var i = de, a = typeof Object.is == "function" ? Object.is : e, s = i.useState, u = i.useEffect, p = i.useLayoutEffect, _ = i.useDebugValue, S = !1, d = !1, h = typeof window > "u" || typeof window.document > "u" || typeof window.document.createElement > "u" ? o : t;
|
|
1041
|
-
|
|
1042
|
-
}()),
|
|
1041
|
+
Re.useSyncExternalStore = i.useSyncExternalStore !== void 0 ? i.useSyncExternalStore : h, typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ < "u" && typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop == "function" && __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(Error());
|
|
1042
|
+
}()), Re;
|
|
1043
1043
|
}
|
|
1044
1044
|
var dt;
|
|
1045
1045
|
function _o() {
|
|
@@ -1075,22 +1075,22 @@ const W = /* @__PURE__ */ new WeakMap(), U = () => {
|
|
|
1075
1075
|
), $e = Object, m = (e) => e === L, M = (e) => typeof e == "function", z = (e, t) => ({
|
|
1076
1076
|
...e,
|
|
1077
1077
|
...t
|
|
1078
|
-
}),
|
|
1078
|
+
}), Rt = (e) => M(e.then), Oe = {}, ve = {}, ze = "undefined", ue = typeof window != ze, Ve = typeof document != ze, mo = ue && "Deno" in window, po = () => ue && typeof window.requestAnimationFrame != ze, Ot = (e, t) => {
|
|
1079
1079
|
const n = W.get(e);
|
|
1080
1080
|
return [
|
|
1081
1081
|
// Getter
|
|
1082
|
-
() => !m(t) && e.get(t) ||
|
|
1082
|
+
() => !m(t) && e.get(t) || Oe,
|
|
1083
1083
|
// Setter
|
|
1084
1084
|
(o) => {
|
|
1085
1085
|
if (!m(t)) {
|
|
1086
1086
|
const i = e.get(t);
|
|
1087
|
-
t in ve || (ve[t] = i), n[5](t, z(i, o), i ||
|
|
1087
|
+
t in ve || (ve[t] = i), n[5](t, z(i, o), i || Oe);
|
|
1088
1088
|
}
|
|
1089
1089
|
},
|
|
1090
1090
|
// Subscriber
|
|
1091
1091
|
n[6],
|
|
1092
1092
|
// Get server cache snapshot
|
|
1093
|
-
() => !m(t) && t in ve ? ve[t] : !m(t) && e.get(t) ||
|
|
1093
|
+
() => !m(t) && t in ve ? ve[t] : !m(t) && e.get(t) || Oe
|
|
1094
1094
|
];
|
|
1095
1095
|
};
|
|
1096
1096
|
let Me = !0;
|
|
@@ -1182,7 +1182,7 @@ async function Lt(...e) {
|
|
|
1182
1182
|
async function d(h) {
|
|
1183
1183
|
const [l] = Ge(h);
|
|
1184
1184
|
if (!l) return;
|
|
1185
|
-
const [v, f] =
|
|
1185
|
+
const [v, f] = Ot(t, l), [k, c, F, ie] = W.get(t), P = () => {
|
|
1186
1186
|
const A = k[l];
|
|
1187
1187
|
return (M(a.revalidate) ? a.revalidate(v().data, h) : a.revalidate !== !1) && (delete F[l], delete ie[l], A && A[0]) ? A[0](Nt).then(() => v().data) : v().data;
|
|
1188
1188
|
};
|
|
@@ -1204,7 +1204,7 @@ async function Lt(...e) {
|
|
|
1204
1204
|
} catch (A) {
|
|
1205
1205
|
C = A;
|
|
1206
1206
|
}
|
|
1207
|
-
if (N &&
|
|
1207
|
+
if (N && Rt(N))
|
|
1208
1208
|
if (N = await N.catch((A) => {
|
|
1209
1209
|
C = A;
|
|
1210
1210
|
}), J !== c[l][0]) {
|
|
@@ -1282,16 +1282,16 @@ const mt = (e, t) => {
|
|
|
1282
1282
|
e,
|
|
1283
1283
|
W.get(e)[4]
|
|
1284
1284
|
];
|
|
1285
|
-
},
|
|
1285
|
+
}, Ro = (e, t, n, o, i) => {
|
|
1286
1286
|
const a = n.errorRetryCount, s = i.retryCount, u = ~~((Math.random() + 0.5) * (1 << (s < 8 ? s : 8))) * n.errorRetryInterval;
|
|
1287
1287
|
!m(a) && s > a || setTimeout(o, u, i);
|
|
1288
|
-
},
|
|
1288
|
+
}, Oo = Ae, [It, Lo] = No(/* @__PURE__ */ new Map()), Io = z(
|
|
1289
1289
|
{
|
|
1290
1290
|
// events
|
|
1291
1291
|
onLoadingSlow: U,
|
|
1292
1292
|
onSuccess: U,
|
|
1293
1293
|
onError: U,
|
|
1294
|
-
onErrorRetry:
|
|
1294
|
+
onErrorRetry: Ro,
|
|
1295
1295
|
onDiscarded: U,
|
|
1296
1296
|
// switches
|
|
1297
1297
|
revalidateOnFocus: !0,
|
|
@@ -1304,7 +1304,7 @@ const mt = (e, t) => {
|
|
|
1304
1304
|
dedupingInterval: 2 * 1e3,
|
|
1305
1305
|
loadingTimeout: ht ? 5e3 : 3e3,
|
|
1306
1306
|
// providers
|
|
1307
|
-
compare:
|
|
1307
|
+
compare: Oo,
|
|
1308
1308
|
isPaused: () => !1,
|
|
1309
1309
|
cache: It,
|
|
1310
1310
|
mutate: Lo,
|
|
@@ -1372,9 +1372,9 @@ const Ce = de.use || // This extra generic is to avoid TypeScript mixing up the
|
|
|
1372
1372
|
}), De = {
|
|
1373
1373
|
dedupe: !0
|
|
1374
1374
|
}, Fo = (e, t, n) => {
|
|
1375
|
-
const { cache: o, compare: i, suspense: a, fallbackData: s, revalidateOnMount: u, revalidateIfStale: p, refreshInterval: _, refreshWhenHidden: S, refreshWhenOffline: d, keepPreviousData: h } = n, [l, v, f, k] = W.get(o), [c, F] = Ge(e), ie = X(!1), P = X(!1), N = X(c), C = X(t), J = X(n), x = () => J.current, Y = () => x().isVisible() && x().isOnline(), [$, Z, G, A] =
|
|
1376
|
-
for (const
|
|
1377
|
-
const T =
|
|
1375
|
+
const { cache: o, compare: i, suspense: a, fallbackData: s, revalidateOnMount: u, revalidateIfStale: p, refreshInterval: _, refreshWhenHidden: S, refreshWhenOffline: d, keepPreviousData: h } = n, [l, v, f, k] = W.get(o), [c, F] = Ge(e), ie = X(!1), P = X(!1), N = X(c), C = X(t), J = X(n), x = () => J.current, Y = () => x().isVisible() && x().isOnline(), [$, Z, G, A] = Ot(o, c), ee = X({}).current, fe = m(s) ? m(n.fallback) ? L : n.fallback[c] : s, Ke = (w, y) => {
|
|
1376
|
+
for (const R in ee) {
|
|
1377
|
+
const T = R;
|
|
1378
1378
|
if (T === "data") {
|
|
1379
1379
|
if (!i(w[T], y[T]) && (!m(w[T]) || !i(he, y[T])))
|
|
1380
1380
|
return !1;
|
|
@@ -1383,19 +1383,19 @@ const Ce = de.use || // This extra generic is to avoid TypeScript mixing up the
|
|
|
1383
1383
|
}
|
|
1384
1384
|
return !0;
|
|
1385
1385
|
}, Xe = gt(() => {
|
|
1386
|
-
const w = !c || !t ? !1 : m(u) ? x().isPaused() || a ? !1 : p !== !1 : u, y = (
|
|
1387
|
-
const j = z(
|
|
1386
|
+
const w = !c || !t ? !1 : m(u) ? x().isPaused() || a ? !1 : p !== !1 : u, y = (O) => {
|
|
1387
|
+
const j = z(O);
|
|
1388
1388
|
return delete j._k, w ? {
|
|
1389
1389
|
isValidating: !0,
|
|
1390
1390
|
isLoading: !0,
|
|
1391
1391
|
...j
|
|
1392
1392
|
} : j;
|
|
1393
|
-
},
|
|
1393
|
+
}, R = $(), T = A(), V = y(R), re = R === T ? V : y(T);
|
|
1394
1394
|
let b = V;
|
|
1395
1395
|
return [
|
|
1396
1396
|
() => {
|
|
1397
|
-
const
|
|
1398
|
-
return Ke(
|
|
1397
|
+
const O = y($());
|
|
1398
|
+
return Ke(O, b) ? (b.data = O.data, b.isLoading = O.isLoading, b.isValidating = O.isValidating, b.error = O.error, b) : (b = O, O);
|
|
1399
1399
|
},
|
|
1400
1400
|
() => re
|
|
1401
1401
|
];
|
|
@@ -1403,21 +1403,21 @@ const Ce = de.use || // This extra generic is to avoid TypeScript mixing up the
|
|
|
1403
1403
|
o,
|
|
1404
1404
|
c
|
|
1405
1405
|
]), te = ho.useSyncExternalStore(Te(
|
|
1406
|
-
(w) => G(c, (y,
|
|
1407
|
-
Ke(
|
|
1406
|
+
(w) => G(c, (y, R) => {
|
|
1407
|
+
Ke(R, y) || w();
|
|
1408
1408
|
}),
|
|
1409
1409
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
1410
1410
|
[
|
|
1411
1411
|
o,
|
|
1412
1412
|
c
|
|
1413
1413
|
]
|
|
1414
|
-
), Xe[0], Xe[1]), Qe = !ie.current, Ct = l[c] && l[c].length > 0, ne = te.data, K = m(ne) ? fe &&
|
|
1414
|
+
), Xe[0], Xe[1]), Qe = !ie.current, Ct = l[c] && l[c].length > 0, ne = te.data, K = m(ne) ? fe && Rt(fe) ? Ce(fe) : fe : ne, _e = te.error, we = X(K), he = h ? m(ne) ? m(we.current) ? K : we.current : ne : K, Je = Ct && !m(_e) ? !1 : Qe && !m(u) ? u : x().isPaused() ? !1 : a ? m(K) ? !1 : p : m(K) || p, Ye = !!(c && t && Qe && Je), Dt = m(te.isValidating) ? Ye : te.isValidating, qt = m(te.isLoading) ? Ye : te.isLoading, ae = Te(
|
|
1415
1415
|
async (w) => {
|
|
1416
1416
|
const y = C.current;
|
|
1417
1417
|
if (!c || !y || P.current || x().isPaused())
|
|
1418
1418
|
return !1;
|
|
1419
|
-
let
|
|
1420
|
-
const re = w || {}, b = !f[c] || !re.dedupe,
|
|
1419
|
+
let R, T, V = !0;
|
|
1420
|
+
const re = w || {}, b = !f[c] || !re.dedupe, O = () => _t ? !P.current && c === N.current && ie.current : c === N.current, j = {
|
|
1421
1421
|
isValidating: !1,
|
|
1422
1422
|
isLoading: !1
|
|
1423
1423
|
}, et = () => {
|
|
@@ -1431,25 +1431,25 @@ const Ce = de.use || // This extra generic is to avoid TypeScript mixing up the
|
|
|
1431
1431
|
m($().data) && (nt.isLoading = !0);
|
|
1432
1432
|
try {
|
|
1433
1433
|
if (b && (Z(nt), n.loadingTimeout && m($().data) && setTimeout(() => {
|
|
1434
|
-
V &&
|
|
1434
|
+
V && O() && x().onLoadingSlow(c, n);
|
|
1435
1435
|
}, n.loadingTimeout), f[c] = [
|
|
1436
1436
|
y(F),
|
|
1437
1437
|
Fe()
|
|
1438
|
-
]), [
|
|
1439
|
-
return b &&
|
|
1438
|
+
]), [R, T] = f[c], R = await R, b && setTimeout(tt, n.dedupingInterval), !f[c] || f[c][1] !== T)
|
|
1439
|
+
return b && O() && x().onDiscarded(c), !1;
|
|
1440
1440
|
j.error = L;
|
|
1441
1441
|
const q = v[c];
|
|
1442
1442
|
if (!m(q) && // case 1
|
|
1443
1443
|
(T <= q[0] || // case 2
|
|
1444
1444
|
T <= q[1] || // case 3
|
|
1445
1445
|
q[1] === 0))
|
|
1446
|
-
return et(), b &&
|
|
1446
|
+
return et(), b && O() && x().onDiscarded(c), !1;
|
|
1447
1447
|
const B = $().data;
|
|
1448
|
-
j.data = i(B,
|
|
1448
|
+
j.data = i(B, R) ? B : R, b && O() && x().onSuccess(R, c, n);
|
|
1449
1449
|
} catch (q) {
|
|
1450
1450
|
tt();
|
|
1451
1451
|
const B = x(), { shouldRetryOnError: ye } = B;
|
|
1452
|
-
B.isPaused() || (j.error = q, b &&
|
|
1452
|
+
B.isPaused() || (j.error = q, b && O() && (B.onError(q, c, B), (ye === !0 || M(ye) && ye(q)) && (!x().revalidateOnFocus || !x().revalidateOnReconnect || Y()) && B.onErrorRetry(q, c, B, (At) => {
|
|
1453
1453
|
const Se = l[c];
|
|
1454
1454
|
Se && Se[0] && Se[0](ut, At);
|
|
1455
1455
|
}, {
|
|
@@ -1510,9 +1510,9 @@ const Ce = de.use || // This extra generic is to avoid TypeScript mixing up the
|
|
|
1510
1510
|
let w;
|
|
1511
1511
|
function y() {
|
|
1512
1512
|
const T = M(_) ? _($().data) : _;
|
|
1513
|
-
T && w !== -1 && (w = setTimeout(
|
|
1513
|
+
T && w !== -1 && (w = setTimeout(R, T));
|
|
1514
1514
|
}
|
|
1515
|
-
function
|
|
1515
|
+
function R() {
|
|
1516
1516
|
!$().error && (S || x().isVisible()) && (d || x().isOnline()) ? ae(De).then(y) : y();
|
|
1517
1517
|
}
|
|
1518
1518
|
return y(), () => {
|