@burdenoff/microfe-support 2026.819.4 → 2026.819.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.
- package/dist/node_modules/@tiptap/react/dist/index.js +25 -25
- package/dist/node_modules/@tiptap/react/dist/index.js.map +1 -1
- package/package.json +1 -1
- package/dist/_virtual/_rolldown/runtime.js +0 -7
- package/dist/node_modules/use-sync-external-store/cjs/use-sync-external-store-shim/with-selector.development.js +0 -56
- package/dist/node_modules/use-sync-external-store/cjs/use-sync-external-store-shim/with-selector.development.js.map +0 -1
- package/dist/node_modules/use-sync-external-store/cjs/use-sync-external-store-shim/with-selector.production.js +0 -54
- package/dist/node_modules/use-sync-external-store/cjs/use-sync-external-store-shim/with-selector.production.js.map +0 -1
- package/dist/node_modules/use-sync-external-store/cjs/use-sync-external-store-shim.development.js +0 -54
- package/dist/node_modules/use-sync-external-store/cjs/use-sync-external-store-shim.development.js.map +0 -1
- package/dist/node_modules/use-sync-external-store/cjs/use-sync-external-store-shim.production.js +0 -46
- package/dist/node_modules/use-sync-external-store/cjs/use-sync-external-store-shim.production.js.map +0 -1
- package/dist/node_modules/use-sync-external-store/shim/index.js +0 -12
- package/dist/node_modules/use-sync-external-store/shim/index.js.map +0 -1
- package/dist/node_modules/use-sync-external-store/shim/with-selector.js +0 -12
- package/dist/node_modules/use-sync-external-store/shim/with-selector.js.map +0 -1
|
@@ -1,18 +1,18 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import
|
|
7
|
-
import {
|
|
8
|
-
import
|
|
2
|
+
import { CommandManager as e, DECORATION_MANAGER_PLUGIN_KEY as t, DecorationManager as n, Editor as r, Extendable as i, Extension as ee, InputRule as te, MappablePosition as ne, Mark as re, Node as ie, NodePos as ae, PasteRule as oe, callOrReturn as se, canInsertNode as ce, combineTransactionSteps as le, commands as ue, createAtomBlockMarkdownSpec as de, createBlockMarkdownSpec as fe, createChainableState as pe, createDocument as me, createInlineMarkdownSpec as he, createMappablePosition as ge, createNodeFromContent as _e, createStyleTag as ve, defaultBlockAt as ye, deleteProps as be, elementFromString as xe, extensions as Se, findChildrenInRange as Ce, findDuplicates as we, findParentNode as a, findParentNodeClosestToPos as o, flattenExtensions as s, fromString as c, getAttributes as l, getAttributesFromExtensions as u, getChangedRanges as d, getExtensionField as f, getHTMLFromFragment as p, getMarkAttributes as m, getMarkRange as h, getMarkType as g, getMarksBetween as _, getNodeAtPosition as v, getNodeAttributes as y, getNodeType as b, getPreviousBlockSibling as x, getRenderedAttributes as S, getSchemaByResolvedExtensions as C, getSchemaTypeByName as w, getSchemaTypeNameByName as T, getSplittedAttributes as E, getText as D, getTextBetween as O, getTextContentFromNodes as k, getTextSerializersFromSchema as Te, getUpdatedPosition as Ee, injectExtensionAttributesToParseRule as De, inputRulesPlugin as Oe, isActive as ke, isAndroid as Ae, isAtEndOfNode as je, isAtStartOfNode as Me, isEmptyObject as Ne, isExtensionRulesEnabled as Pe, isFunction as Fe, isList as Ie, isMacOS as Le, isMarkActive as Re, isNodeActive as ze, isNodeEmpty as Be, isNodeSelection as Ve, isNumber as He, isPlainObject as Ue, isRegExp as We, isSafari as Ge, isTextSelection as A, isiOS as Ke, markInputRule as qe, markPasteRule as Je, markdown as Ye, mergeAttributes as Xe, mergeDeep as Ze, minMax as Qe, nodeInputRule as $e, objectIncludes as et, parseAttributes as tt, parseIndentedBlocks as nt, pasteRulesPlugin as rt, removeDuplicates as it, renderNestedMarkdownContent as at, resolveExtensions as ot, resolveFocusPosition as st, selectionToInsertionEnd as ct, serializeAttributes as lt, sortExtensions as ut, splitExtensions as dt, textblockTypeInputRule as ft, updateMarkViewAttributes as pt, wrappingInputRule as mt } from "../../core/dist/index.js";
|
|
3
|
+
import { deepEqual as ht } from "../../../fast-equals/dist/es/index.js";
|
|
4
|
+
import j, { createContext as M, forwardRef as gt, useContext as N, useDebugValue as P, useEffect as F, useLayoutEffect as _t, useMemo as I, useRef as vt, useState as L } from "react";
|
|
5
|
+
import { Fragment as R, jsx as z, jsxs as yt } from "react/jsx-runtime";
|
|
6
|
+
import bt from "react-dom";
|
|
7
|
+
import { useSyncExternalStore as B } from "use-sync-external-store/shim/index.js";
|
|
8
|
+
import { useSyncExternalStoreWithSelector as xt } from "use-sync-external-store/shim/with-selector.js";
|
|
9
9
|
//#region node_modules/@tiptap/react/dist/index.js
|
|
10
|
-
var
|
|
10
|
+
var St = (...e) => (t) => {
|
|
11
11
|
e.forEach((e) => {
|
|
12
12
|
typeof e == "function" ? e(t) : e && (e.current = t);
|
|
13
13
|
});
|
|
14
|
-
},
|
|
15
|
-
let t =
|
|
14
|
+
}, Ct = ({ contentComponent: e }) => {
|
|
15
|
+
let t = B(e.subscribe, e.getSnapshot, e.getServerSnapshot);
|
|
16
16
|
return /* @__PURE__ */ z(R, { children: Object.values(t) });
|
|
17
17
|
};
|
|
18
18
|
function V() {
|
|
@@ -36,7 +36,7 @@ function V() {
|
|
|
36
36
|
setRenderer(e, n) {
|
|
37
37
|
t = {
|
|
38
38
|
...t,
|
|
39
|
-
[e]:
|
|
39
|
+
[e]: bt.createPortal(n.reactElement, n.element, e)
|
|
40
40
|
}, r();
|
|
41
41
|
},
|
|
42
42
|
removeRenderer(e) {
|
|
@@ -76,19 +76,19 @@ var H = class extends j.Component {
|
|
|
76
76
|
}
|
|
77
77
|
render() {
|
|
78
78
|
let { editor: e, innerRef: t, ...n } = this.props;
|
|
79
|
-
return /* @__PURE__ */
|
|
80
|
-
ref:
|
|
79
|
+
return /* @__PURE__ */ yt(R, { children: [/* @__PURE__ */ z("div", {
|
|
80
|
+
ref: St(t, this.editorContentRef),
|
|
81
81
|
...n
|
|
82
|
-
}), e?.contentComponent && /* @__PURE__ */ z(
|
|
82
|
+
}), e?.contentComponent && /* @__PURE__ */ z(Ct, { contentComponent: e.contentComponent })] });
|
|
83
83
|
}
|
|
84
|
-
},
|
|
84
|
+
}, wt = gt((e, t) => {
|
|
85
85
|
let n = j.useMemo(() => Math.floor(Math.random() * 4294967295).toString(), [e.editor]);
|
|
86
86
|
return j.createElement(H, {
|
|
87
87
|
key: n,
|
|
88
88
|
innerRef: t,
|
|
89
89
|
...e
|
|
90
90
|
});
|
|
91
|
-
}), U = j.memo(
|
|
91
|
+
}), U = j.memo(wt), Tt = typeof window < "u" ? _t : F, Et = class {
|
|
92
92
|
constructor(e) {
|
|
93
93
|
this.transactionNumber = 0, this.lastTransactionNumber = 0, this.subscribers = /* @__PURE__ */ new Set(), this.editor = e, this.lastSnapshot = {
|
|
94
94
|
editor: e,
|
|
@@ -124,10 +124,10 @@ var H = class extends j.Component {
|
|
|
124
124
|
}
|
|
125
125
|
};
|
|
126
126
|
function W(e) {
|
|
127
|
-
let [t] = L(() => new
|
|
128
|
-
return
|
|
127
|
+
let [t] = L(() => new Et(e.editor)), n = xt(t.subscribe, t.getSnapshot, t.getServerSnapshot, e.selector, e.equalityFn ?? ht);
|
|
128
|
+
return Tt(() => t.watch(e.editor), [e.editor, t]), P(n), n;
|
|
129
129
|
}
|
|
130
|
-
var G = process.env.NODE_ENV !== "production", K = typeof window > "u",
|
|
130
|
+
var G = process.env.NODE_ENV !== "production", K = typeof window > "u", Dt = K || !!(typeof window < "u" && window.next), Ot = class e {
|
|
131
131
|
constructor(e) {
|
|
132
132
|
this.editor = null, this.subscriptions = /* @__PURE__ */ new Set(), this.isComponentMounted = !1, this.previousDeps = null, this.instanceId = "", this.options = e, this.subscriptions = /* @__PURE__ */ new Set(), this.setEditor(this.getInitialEditor()), this.scheduleDestroy(), this.getEditor = this.getEditor.bind(this), this.getServerSnapshot = this.getServerSnapshot.bind(this), this.subscribe = this.subscribe.bind(this), this.refreshEditorInstance = this.refreshEditorInstance.bind(this), this.scheduleDestroy = this.scheduleDestroy.bind(this), this.onRender = this.onRender.bind(this), this.createEditor = this.createEditor.bind(this);
|
|
133
133
|
}
|
|
@@ -136,7 +136,7 @@ var G = process.env.NODE_ENV !== "production", K = typeof window > "u", kt = K |
|
|
|
136
136
|
}
|
|
137
137
|
getInitialEditor() {
|
|
138
138
|
let e = this.options.current.immediatelyRender, t = e ?? !0;
|
|
139
|
-
return K ? (t && G && console.warn("SSR detected. `immediatelyRender` has been set to false to avoid hydration mismatches"), t = !1) :
|
|
139
|
+
return K ? (t && G && console.warn("SSR detected. `immediatelyRender` has been set to false to avoid hydration mismatches"), t = !1) : Dt && e === void 0 && (t = !1, G && console.warn("Next.js detected. `immediatelyRender` defaults to false to avoid hydration mismatches. Pass `immediatelyRender: true` explicitly if you are rendering the editor only on the client.")), t ? this.createEditor() : null;
|
|
140
140
|
}
|
|
141
141
|
createEditor() {
|
|
142
142
|
let e = {
|
|
@@ -198,7 +198,7 @@ var G = process.env.NODE_ENV !== "production", K = typeof window > "u", kt = K |
|
|
|
198
198
|
return (t = this.options.current).onUnmount?.call(t, ...e);
|
|
199
199
|
}
|
|
200
200
|
};
|
|
201
|
-
return new
|
|
201
|
+
return new r(e);
|
|
202
202
|
}
|
|
203
203
|
getEditor() {
|
|
204
204
|
return this.editor;
|
|
@@ -255,10 +255,10 @@ var G = process.env.NODE_ENV !== "production", K = typeof window > "u", kt = K |
|
|
|
255
255
|
}, 1);
|
|
256
256
|
}
|
|
257
257
|
};
|
|
258
|
-
function
|
|
259
|
-
let n =
|
|
258
|
+
function kt(e = {}, t = []) {
|
|
259
|
+
let n = vt(e);
|
|
260
260
|
n.current = e;
|
|
261
|
-
let [r] = L(() => new
|
|
261
|
+
let [r] = L(() => new Ot(n)), i = B(r.subscribe, r.getEditor, r.getServerSnapshot);
|
|
262
262
|
return P(i), F(r.onRender(t)), W({
|
|
263
263
|
editor: i,
|
|
264
264
|
selector: ({ transactionNumber: t }) => e.shouldRerenderOnTransaction === !1 || e.shouldRerenderOnTransaction === void 0 ? null : e.immediatelyRender && t === 0 ? 0 : t + 1
|
|
@@ -311,6 +311,6 @@ function $({ ...e }) {
|
|
|
311
311
|
}
|
|
312
312
|
$.displayName = "Tiptap.Content", Object.assign(Q, { Content: $ });
|
|
313
313
|
//#endregion
|
|
314
|
-
export {
|
|
314
|
+
export { e as CommandManager, t as DECORATION_MANAGER_PLUGIN_KEY, n as DecorationManager, r as Editor, U as EditorContent, q as EditorContext, i as Extendable, ee as Extension, te as InputRule, ne as MappablePosition, re as Mark, ie as Node, ae as NodePos, oe as PasteRule, H as PureEditorContent, J as ReactNodeViewContext, $ as TiptapContent, X as TiptapContext, Q as TiptapWrapper, se as callOrReturn, ce as canInsertNode, le as combineTransactionSteps, ue as commands, de as createAtomBlockMarkdownSpec, fe as createBlockMarkdownSpec, pe as createChainableState, V as createContentComponent, me as createDocument, he as createInlineMarkdownSpec, ge as createMappablePosition, _e as createNodeFromContent, ve as createStyleTag, ye as defaultBlockAt, be as deleteProps, xe as elementFromString, Se as extensions, Ce as findChildrenInRange, we as findDuplicates, a as findParentNode, o as findParentNodeClosestToPos, s as flattenExtensions, c as fromString, l as getAttributes, u as getAttributesFromExtensions, d as getChangedRanges, f as getExtensionField, p as getHTMLFromFragment, m as getMarkAttributes, h as getMarkRange, g as getMarkType, _ as getMarksBetween, v as getNodeAtPosition, y as getNodeAttributes, b as getNodeType, x as getPreviousBlockSibling, S as getRenderedAttributes, C as getSchemaByResolvedExtensions, w as getSchemaTypeByName, T as getSchemaTypeNameByName, E as getSplittedAttributes, D as getText, O as getTextBetween, k as getTextContentFromNodes, Te as getTextSerializersFromSchema, Ee as getUpdatedPosition, De as injectExtensionAttributesToParseRule, Oe as inputRulesPlugin, ke as isActive, Ae as isAndroid, je as isAtEndOfNode, Me as isAtStartOfNode, Ne as isEmptyObject, Pe as isExtensionRulesEnabled, Fe as isFunction, Ie as isList, Le as isMacOS, Re as isMarkActive, ze as isNodeActive, Be as isNodeEmpty, Ve as isNodeSelection, He as isNumber, Ue as isPlainObject, We as isRegExp, Ge as isSafari, A as isTextSelection, Ke as isiOS, qe as markInputRule, Je as markPasteRule, Ye as markdown, Xe as mergeAttributes, Ze as mergeDeep, Qe as minMax, $e as nodeInputRule, et as objectIncludes, tt as parseAttributes, nt as parseIndentedBlocks, rt as pasteRulesPlugin, it as removeDuplicates, at as renderNestedMarkdownContent, ot as resolveExtensions, st as resolveFocusPosition, ct as selectionToInsertionEnd, lt as serializeAttributes, ut as sortExtensions, dt as splitExtensions, ft as textblockTypeInputRule, pt as updateMarkViewAttributes, kt as useEditor, W as useEditorState, Y as useReactNodeView, Z as useTiptap, mt as wrappingInputRule };
|
|
315
315
|
|
|
316
316
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":["useSyncExternalStore","useSyncExternalStoreWithSelector","useState2","useSyncExternalStore2","createContext2","useContext2","React3","React4","createContext3","useContext3","useMemo2"],"sources":["../../../../../node_modules/@tiptap/react/dist/index.js"],"sourcesContent":["\"use client\";\n\n// src/Context.tsx\nimport { createContext, useContext, useMemo } from \"react\";\n\n// src/EditorContent.tsx\nimport React, { forwardRef } from \"react\";\nimport ReactDOM from \"react-dom\";\nimport { useSyncExternalStore } from \"use-sync-external-store/shim/index.js\";\nimport { Fragment, jsx, jsxs } from \"react/jsx-runtime\";\nvar mergeRefs = (...refs) => {\n return (node) => {\n refs.forEach((ref) => {\n if (typeof ref === \"function\") {\n ref(node);\n } else if (ref) {\n ;\n ref.current = node;\n }\n });\n };\n};\nvar Portals = ({ contentComponent }) => {\n const renderers = useSyncExternalStore(\n contentComponent.subscribe,\n contentComponent.getSnapshot,\n contentComponent.getServerSnapshot\n );\n return /* @__PURE__ */ jsx(Fragment, { children: Object.values(renderers) });\n};\nfunction createContentComponent() {\n const subscribers = /* @__PURE__ */ new Set();\n let renderers = {};\n let isNotificationQueued = false;\n const notifySubscribers = () => {\n if (isNotificationQueued || !subscribers.size) {\n return;\n }\n isNotificationQueued = true;\n queueMicrotask(() => {\n isNotificationQueued = false;\n subscribers.forEach((subscriber) => subscriber());\n });\n };\n return {\n /**\n * Subscribe to the editor instance's changes.\n */\n subscribe(callback) {\n subscribers.add(callback);\n return () => {\n subscribers.delete(callback);\n };\n },\n getSnapshot() {\n return renderers;\n },\n getServerSnapshot() {\n return renderers;\n },\n /**\n * Adds a new NodeView Renderer to the editor.\n */\n setRenderer(id, renderer) {\n renderers = {\n ...renderers,\n [id]: ReactDOM.createPortal(renderer.reactElement, renderer.element, id)\n };\n notifySubscribers();\n },\n /**\n * Removes a NodeView Renderer from the editor.\n */\n removeRenderer(id) {\n const nextRenderers = { ...renderers };\n delete nextRenderers[id];\n renderers = nextRenderers;\n notifySubscribers();\n }\n };\n}\nvar PureEditorContent = class extends React.Component {\n constructor(props) {\n super(props);\n this.editorContentRef = React.createRef();\n }\n componentDidMount() {\n this.init();\n }\n componentDidUpdate() {\n this.init();\n }\n init() {\n var _a;\n const editor = this.props.editor;\n if (editor && !editor.isDestroyed && ((_a = editor.view.dom) == null ? void 0 : _a.parentNode)) {\n if (editor.contentComponent) {\n return;\n }\n const element = this.editorContentRef.current;\n element.append(...editor.view.dom.parentNode.childNodes);\n editor.setOptions({\n element\n });\n editor.contentComponent = createContentComponent();\n editor.createNodeViews();\n editor.isEditorContentInitialized = true;\n this.forceUpdate();\n }\n }\n componentWillUnmount() {\n var _a;\n const editor = this.props.editor;\n if (!editor) {\n return;\n }\n editor.isEditorContentInitialized = false;\n if (!editor.isDestroyed) {\n editor.view.setProps({\n nodeViews: {}\n });\n }\n editor.contentComponent = null;\n try {\n if (!((_a = editor.view.dom) == null ? void 0 : _a.parentNode)) {\n return;\n }\n const newElement = document.createElement(\"div\");\n newElement.append(...editor.view.dom.parentNode.childNodes);\n editor.setOptions({\n element: newElement\n });\n } catch {\n }\n }\n render() {\n const { editor, innerRef, ...rest } = this.props;\n return /* @__PURE__ */ jsxs(Fragment, { children: [\n /* @__PURE__ */ jsx(\"div\", { ref: mergeRefs(innerRef, this.editorContentRef), ...rest }),\n (editor == null ? void 0 : editor.contentComponent) && /* @__PURE__ */ jsx(Portals, { contentComponent: editor.contentComponent })\n ] });\n }\n};\nvar EditorContentWithKey = forwardRef(\n (props, ref) => {\n const key = React.useMemo(() => {\n return Math.floor(Math.random() * 4294967295).toString();\n }, [props.editor]);\n return React.createElement(PureEditorContent, {\n key,\n innerRef: ref,\n ...props\n });\n }\n);\nvar EditorContent = React.memo(EditorContentWithKey);\n\n// src/useEditor.ts\nimport { Editor } from \"@tiptap/core\";\nimport { useDebugValue as useDebugValue2, useEffect as useEffect2, useRef, useState as useState2 } from \"react\";\nimport { useSyncExternalStore as useSyncExternalStore2 } from \"use-sync-external-store/shim/index.js\";\n\n// src/useEditorState.ts\nimport { deepEqual } from \"fast-equals\";\nimport { useDebugValue, useEffect, useLayoutEffect, useState } from \"react\";\nimport { useSyncExternalStoreWithSelector } from \"use-sync-external-store/shim/with-selector.js\";\nvar useIsomorphicLayoutEffect = typeof window !== \"undefined\" ? useLayoutEffect : useEffect;\nvar EditorStateManager = class {\n constructor(initialEditor) {\n this.transactionNumber = 0;\n this.lastTransactionNumber = 0;\n this.subscribers = /* @__PURE__ */ new Set();\n this.editor = initialEditor;\n this.lastSnapshot = { editor: initialEditor, transactionNumber: 0 };\n this.getSnapshot = this.getSnapshot.bind(this);\n this.getServerSnapshot = this.getServerSnapshot.bind(this);\n this.watch = this.watch.bind(this);\n this.subscribe = this.subscribe.bind(this);\n }\n /**\n * Get the current editor instance.\n */\n getSnapshot() {\n if (this.transactionNumber === this.lastTransactionNumber) {\n return this.lastSnapshot;\n }\n this.lastTransactionNumber = this.transactionNumber;\n this.lastSnapshot = { editor: this.editor, transactionNumber: this.transactionNumber };\n return this.lastSnapshot;\n }\n /**\n * Always disable the editor on the server-side.\n */\n getServerSnapshot() {\n return { editor: null, transactionNumber: 0 };\n }\n /**\n * Subscribe to the editor instance's changes.\n */\n subscribe(callback) {\n this.subscribers.add(callback);\n return () => {\n this.subscribers.delete(callback);\n };\n }\n /**\n * Watch the editor instance for changes.\n */\n watch(nextEditor) {\n this.editor = nextEditor;\n if (this.editor) {\n let lastTransaction;\n const fn = (props) => {\n if ((props == null ? void 0 : props.transaction) !== void 0 && props.transaction === lastTransaction) {\n return;\n }\n lastTransaction = props == null ? void 0 : props.transaction;\n this.transactionNumber += 1;\n this.subscribers.forEach((callback) => callback());\n };\n const currentEditor = this.editor;\n currentEditor.on(\"transaction\", fn);\n currentEditor.on(\"update\", fn);\n return () => {\n currentEditor.off(\"transaction\", fn);\n currentEditor.off(\"update\", fn);\n };\n }\n return void 0;\n }\n};\nfunction useEditorState(options) {\n var _a;\n const [editorStateManager] = useState(() => new EditorStateManager(options.editor));\n const selectedState = useSyncExternalStoreWithSelector(\n editorStateManager.subscribe,\n editorStateManager.getSnapshot,\n editorStateManager.getServerSnapshot,\n options.selector,\n (_a = options.equalityFn) != null ? _a : deepEqual\n );\n useIsomorphicLayoutEffect(() => {\n return editorStateManager.watch(options.editor);\n }, [options.editor, editorStateManager]);\n useDebugValue(selectedState);\n return selectedState;\n}\n\n// src/useEditor.ts\nvar isDev = process.env.NODE_ENV !== \"production\";\nvar isSSR = typeof window === \"undefined\";\nvar isNext = isSSR || Boolean(typeof window !== \"undefined\" && window.next);\nvar EditorInstanceManager = class _EditorInstanceManager {\n constructor(options) {\n /**\n * The current editor instance.\n */\n this.editor = null;\n /**\n * The subscriptions to notify when the editor instance\n * has been created or destroyed.\n */\n this.subscriptions = /* @__PURE__ */ new Set();\n /**\n * Whether the editor has been mounted.\n */\n this.isComponentMounted = false;\n /**\n * The most recent dependencies array.\n */\n this.previousDeps = null;\n /**\n * The unique instance ID. This is used to identify the editor instance. And will be re-generated for each new instance.\n */\n this.instanceId = \"\";\n this.options = options;\n this.subscriptions = /* @__PURE__ */ new Set();\n this.setEditor(this.getInitialEditor());\n this.scheduleDestroy();\n this.getEditor = this.getEditor.bind(this);\n this.getServerSnapshot = this.getServerSnapshot.bind(this);\n this.subscribe = this.subscribe.bind(this);\n this.refreshEditorInstance = this.refreshEditorInstance.bind(this);\n this.scheduleDestroy = this.scheduleDestroy.bind(this);\n this.onRender = this.onRender.bind(this);\n this.createEditor = this.createEditor.bind(this);\n }\n setEditor(editor) {\n this.editor = editor;\n this.instanceId = Math.random().toString(36).slice(2, 9);\n this.subscriptions.forEach((cb) => cb());\n }\n getInitialEditor() {\n const explicit = this.options.current.immediatelyRender;\n let immediatelyRender = explicit != null ? explicit : true;\n if (isSSR) {\n if (immediatelyRender && isDev) {\n console.warn(\n \"SSR detected. `immediatelyRender` has been set to false to avoid hydration mismatches\"\n );\n }\n immediatelyRender = false;\n } else if (isNext && explicit === void 0) {\n immediatelyRender = false;\n if (isDev) {\n console.warn(\n \"Next.js detected. `immediatelyRender` defaults to false to avoid hydration mismatches. Pass `immediatelyRender: true` explicitly if you are rendering the editor only on the client.\"\n );\n }\n }\n return immediatelyRender ? this.createEditor() : null;\n }\n /**\n * Create a new editor instance. And attach event listeners.\n */\n createEditor() {\n const optionsToApply = {\n ...this.options.current,\n // Always call the most recent version of the callback function by default\n onBeforeCreate: (...args) => {\n var _a, _b;\n return (_b = (_a = this.options.current).onBeforeCreate) == null ? void 0 : _b.call(_a, ...args);\n },\n onBlur: (...args) => {\n var _a, _b;\n return (_b = (_a = this.options.current).onBlur) == null ? void 0 : _b.call(_a, ...args);\n },\n onCreate: (...args) => {\n var _a, _b;\n return (_b = (_a = this.options.current).onCreate) == null ? void 0 : _b.call(_a, ...args);\n },\n onDestroy: (...args) => {\n var _a, _b;\n return (_b = (_a = this.options.current).onDestroy) == null ? void 0 : _b.call(_a, ...args);\n },\n onFocus: (...args) => {\n var _a, _b;\n return (_b = (_a = this.options.current).onFocus) == null ? void 0 : _b.call(_a, ...args);\n },\n onSelectionUpdate: (...args) => {\n var _a, _b;\n return (_b = (_a = this.options.current).onSelectionUpdate) == null ? void 0 : _b.call(_a, ...args);\n },\n onTransaction: (...args) => {\n var _a, _b;\n return (_b = (_a = this.options.current).onTransaction) == null ? void 0 : _b.call(_a, ...args);\n },\n onUpdate: (...args) => {\n var _a, _b;\n return (_b = (_a = this.options.current).onUpdate) == null ? void 0 : _b.call(_a, ...args);\n },\n onContentError: (...args) => {\n var _a, _b;\n return (_b = (_a = this.options.current).onContentError) == null ? void 0 : _b.call(_a, ...args);\n },\n onDrop: (...args) => {\n var _a, _b;\n return (_b = (_a = this.options.current).onDrop) == null ? void 0 : _b.call(_a, ...args);\n },\n onPaste: (...args) => {\n var _a, _b;\n return (_b = (_a = this.options.current).onPaste) == null ? void 0 : _b.call(_a, ...args);\n },\n onDelete: (...args) => {\n var _a, _b;\n return (_b = (_a = this.options.current).onDelete) == null ? void 0 : _b.call(_a, ...args);\n },\n onMount: (...args) => {\n var _a, _b;\n return (_b = (_a = this.options.current).onMount) == null ? void 0 : _b.call(_a, ...args);\n },\n onUnmount: (...args) => {\n var _a, _b;\n return (_b = (_a = this.options.current).onUnmount) == null ? void 0 : _b.call(_a, ...args);\n }\n };\n const editor = new Editor(optionsToApply);\n return editor;\n }\n /**\n * Get the current editor instance.\n */\n getEditor() {\n return this.editor;\n }\n /**\n * Always disable the editor on the server-side.\n */\n getServerSnapshot() {\n return null;\n }\n /**\n * Subscribe to the editor instance's changes.\n */\n subscribe(onStoreChange) {\n this.subscriptions.add(onStoreChange);\n return () => {\n this.subscriptions.delete(onStoreChange);\n };\n }\n static compareOptions(a, b) {\n return Object.keys(a).every((key) => {\n if ([\n \"onCreate\",\n \"onBeforeCreate\",\n \"onDestroy\",\n \"onUpdate\",\n \"onTransaction\",\n \"onFocus\",\n \"onBlur\",\n \"onSelectionUpdate\",\n \"onContentError\",\n \"onDrop\",\n \"onPaste\"\n ].includes(key)) {\n return true;\n }\n if (key === \"extensions\" && a.extensions && b.extensions) {\n if (a.extensions.length !== b.extensions.length) {\n return false;\n }\n return a.extensions.every((extension, index) => {\n var _a;\n if (extension !== ((_a = b.extensions) == null ? void 0 : _a[index])) {\n return false;\n }\n return true;\n });\n }\n if (a[key] !== b[key]) {\n return false;\n }\n return true;\n });\n }\n /**\n * On each render, we will create, update, or destroy the editor instance.\n * @param deps The dependencies to watch for changes\n * @returns A cleanup function\n */\n onRender(deps) {\n return () => {\n this.isComponentMounted = true;\n clearTimeout(this.scheduledDestructionTimeout);\n if (this.editor && !this.editor.isDestroyed && deps.length === 0) {\n if (!_EditorInstanceManager.compareOptions(this.options.current, this.editor.options)) {\n this.editor.setOptions({\n ...this.options.current,\n editable: this.editor.isEditable\n });\n }\n } else {\n this.refreshEditorInstance(deps);\n }\n return () => {\n this.isComponentMounted = false;\n this.scheduleDestroy();\n };\n };\n }\n /**\n * Recreate the editor instance if the dependencies have changed.\n */\n refreshEditorInstance(deps) {\n if (this.editor && !this.editor.isDestroyed) {\n if (this.previousDeps === null) {\n this.previousDeps = deps;\n return;\n }\n const depsAreEqual = this.previousDeps.length === deps.length && this.previousDeps.every((dep, index) => dep === deps[index]);\n if (depsAreEqual) {\n return;\n }\n }\n if (this.editor && !this.editor.isDestroyed) {\n this.editor.destroy();\n }\n this.setEditor(this.createEditor());\n this.previousDeps = deps;\n }\n /**\n * Schedule the destruction of the editor instance.\n * This will only destroy the editor if it was not mounted on the next tick.\n * This is to avoid destroying the editor instance when it's actually still mounted.\n */\n scheduleDestroy() {\n const currentInstanceId = this.instanceId;\n const currentEditor = this.editor;\n this.scheduledDestructionTimeout = setTimeout(() => {\n if (this.isComponentMounted && this.instanceId === currentInstanceId) {\n if (currentEditor) {\n currentEditor.setOptions(this.options.current);\n }\n return;\n }\n if (currentEditor && !currentEditor.isDestroyed) {\n currentEditor.destroy();\n if (this.instanceId === currentInstanceId) {\n this.setEditor(null);\n }\n }\n }, 1);\n }\n};\nfunction useEditor(options = {}, deps = []) {\n const mostRecentOptions = useRef(options);\n mostRecentOptions.current = options;\n const [instanceManager] = useState2(() => new EditorInstanceManager(mostRecentOptions));\n const editor = useSyncExternalStore2(\n instanceManager.subscribe,\n instanceManager.getEditor,\n instanceManager.getServerSnapshot\n );\n useDebugValue2(editor);\n useEffect2(instanceManager.onRender(deps));\n useEditorState({\n editor,\n selector: ({ transactionNumber }) => {\n if (options.shouldRerenderOnTransaction === false || options.shouldRerenderOnTransaction === void 0) {\n return null;\n }\n if (options.immediatelyRender && transactionNumber === 0) {\n return 0;\n }\n return transactionNumber + 1;\n }\n });\n return editor;\n}\n\n// src/Context.tsx\nimport { jsx as jsx2, jsxs as jsxs2 } from \"react/jsx-runtime\";\nvar EditorContext = createContext({\n editor: null\n});\nvar EditorConsumer = EditorContext.Consumer;\nvar useCurrentEditor = () => useContext(EditorContext);\nfunction EditorProvider({\n children,\n slotAfter,\n slotBefore,\n editorContainerProps = {},\n ...editorOptions\n}) {\n const editor = useEditor(editorOptions);\n const contextValue = useMemo(() => ({ editor }), [editor]);\n if (!editor) {\n return null;\n }\n return /* @__PURE__ */ jsxs2(EditorContext.Provider, { value: contextValue, children: [\n slotBefore,\n /* @__PURE__ */ jsx2(EditorConsumer, { children: ({ editor: currentEditor }) => /* @__PURE__ */ jsx2(EditorContent, { editor: currentEditor, ...editorContainerProps }) }),\n children,\n slotAfter\n ] });\n}\n\n// src/useReactNodeView.ts\nimport { createContext as createContext2, createElement, useContext as useContext2 } from \"react\";\nvar ReactNodeViewContext = createContext2({\n onDragStart: () => {\n },\n nodeViewContentChildren: void 0,\n nodeViewContentRef: () => {\n }\n});\nvar ReactNodeViewContentProvider = ({\n children,\n content\n}) => {\n return createElement(\n ReactNodeViewContext.Provider,\n { value: { nodeViewContentChildren: content } },\n children\n );\n};\nvar useReactNodeView = () => useContext2(ReactNodeViewContext);\n\n// src/NodeViewContent.tsx\nimport { jsx as jsx3 } from \"react/jsx-runtime\";\nfunction NodeViewContent({\n as: Tag = \"div\",\n ...props\n}) {\n const { nodeViewContentRef, nodeViewContentChildren } = useReactNodeView();\n return (\n // @ts-ignore\n /* @__PURE__ */ jsx3(\n Tag,\n {\n ...props,\n ref: nodeViewContentRef,\n \"data-node-view-content\": \"\",\n style: {\n whiteSpace: \"pre-wrap\",\n ...props.style\n },\n children: nodeViewContentChildren\n }\n )\n );\n}\n\n// src/NodeViewWrapper.tsx\nimport React3 from \"react\";\nimport { jsx as jsx4 } from \"react/jsx-runtime\";\nvar NodeViewWrapper = React3.forwardRef((props, ref) => {\n const { onDragStart } = useReactNodeView();\n const Tag = props.as || \"div\";\n return (\n // @ts-ignore\n /* @__PURE__ */ jsx4(\n Tag,\n {\n ...props,\n ref,\n \"data-node-view-wrapper\": \"\",\n onDragStart,\n style: {\n whiteSpace: \"normal\",\n ...props.style\n }\n }\n )\n );\n});\n\n// src/ReactMarkViewRenderer.tsx\nimport { MarkView } from \"@tiptap/core\";\nimport React4 from \"react\";\n\n// src/ReactRenderer.tsx\nimport { version as reactVersion } from \"react\";\nimport { flushSync } from \"react-dom\";\nimport { jsx as jsx5 } from \"react/jsx-runtime\";\nfunction isClassComponent(Component) {\n return !!(typeof Component === \"function\" && Component.prototype && Component.prototype.isReactComponent);\n}\nfunction isForwardRefComponent(Component) {\n return !!(typeof Component === \"object\" && Component.$$typeof && (Component.$$typeof.toString() === \"Symbol(react.forward_ref)\" || Component.$$typeof.description === \"react.forward_ref\"));\n}\nfunction isMemoComponent(Component) {\n return !!(typeof Component === \"object\" && Component.$$typeof && (Component.$$typeof.toString() === \"Symbol(react.memo)\" || Component.$$typeof.description === \"react.memo\"));\n}\nfunction canReceiveRef(Component) {\n if (isClassComponent(Component)) {\n return true;\n }\n if (isForwardRefComponent(Component)) {\n return true;\n }\n if (isMemoComponent(Component)) {\n const wrappedComponent = Component.type;\n if (wrappedComponent) {\n return isClassComponent(wrappedComponent) || isForwardRefComponent(wrappedComponent);\n }\n }\n return false;\n}\nfunction isReact19Plus() {\n try {\n if (reactVersion) {\n const majorVersion = parseInt(reactVersion.split(\".\")[0], 10);\n return majorVersion >= 19;\n }\n } catch {\n }\n return false;\n}\nvar ReactRenderer = class {\n /**\n * Immediately creates element and renders the provided React component.\n */\n constructor(component, { editor, props = {}, as = \"div\", className = \"\" }) {\n this.ref = null;\n /**\n * Flag to track if the renderer has been destroyed, preventing queued or asynchronous renders from executing after teardown.\n */\n this.destroyed = false;\n this.id = Math.floor(Math.random() * 4294967295).toString();\n this.component = component;\n this.editor = editor;\n this.props = props;\n this.element = document.createElement(as);\n this.element.classList.add(\"react-renderer\");\n if (className) {\n this.element.classList.add(...className.split(\" \"));\n }\n if (this.editor.isEditorContentInitialized) {\n flushSync(() => {\n this.render();\n });\n } else {\n queueMicrotask(() => {\n if (this.destroyed) {\n return;\n }\n this.render();\n });\n }\n }\n /**\n * Render the React component.\n */\n render() {\n var _a;\n if (this.destroyed) {\n return;\n }\n const Component = this.component;\n const props = this.props;\n const editor = this.editor;\n const isReact19 = isReact19Plus();\n const componentCanReceiveRef = canReceiveRef(Component);\n const elementProps = { ...props };\n if (elementProps.ref && !(isReact19 || componentCanReceiveRef)) {\n delete elementProps.ref;\n }\n if (!elementProps.ref && (isReact19 || componentCanReceiveRef)) {\n elementProps.ref = (ref) => {\n this.ref = ref;\n };\n }\n this.reactElement = /* @__PURE__ */ jsx5(Component, { ...elementProps });\n (_a = editor == null ? void 0 : editor.contentComponent) == null ? void 0 : _a.setRenderer(this.id, this);\n }\n /**\n * Re-renders the React component with new props.\n * Skips the render if none of the supplied props actually changed,\n * to avoid unnecessary portal re-creation.\n */\n updateProps(props = {}) {\n if (this.destroyed) {\n return;\n }\n let changed = false;\n const keys = Object.keys(props);\n for (let i = 0; i < keys.length; i += 1) {\n const key = keys[i];\n if (props[key] !== this.props[key]) {\n changed = true;\n break;\n }\n }\n if (!changed) {\n return;\n }\n this.props = {\n ...this.props,\n ...props\n };\n this.render();\n }\n /**\n * Destroy the React component.\n */\n destroy() {\n var _a;\n this.destroyed = true;\n const editor = this.editor;\n (_a = editor == null ? void 0 : editor.contentComponent) == null ? void 0 : _a.removeRenderer(this.id);\n try {\n if (this.element && this.element.parentNode) {\n this.element.parentNode.removeChild(this.element);\n }\n } catch {\n }\n }\n /**\n * Update the attributes of the element that holds the React component.\n */\n updateAttributes(attributes) {\n Object.keys(attributes).forEach((key) => {\n this.element.setAttribute(key, attributes[key]);\n });\n }\n};\n\n// src/ReactMarkViewRenderer.tsx\nimport { jsx as jsx6 } from \"react/jsx-runtime\";\nvar ReactMarkViewContext = React4.createContext({\n markViewContentRef: () => {\n }\n});\nvar MarkViewContent = (props) => {\n const { as: Tag = \"span\", ...rest } = props;\n const { markViewContentRef } = React4.useContext(ReactMarkViewContext);\n return (\n // @ts-ignore\n /* @__PURE__ */ jsx6(Tag, { ...rest, ref: markViewContentRef, \"data-mark-view-content\": \"\" })\n );\n};\nvar ReactMarkView = class extends MarkView {\n constructor(component, props, options) {\n super(component, props, options);\n const { as = \"span\", attrs, className = \"\" } = options || {};\n const componentProps = {\n ...props,\n updateAttributes: this.updateAttributes.bind(this)\n };\n this.contentDOMElement = document.createElement(\"span\");\n const markViewContentRef = (el) => {\n if (el && !el.contains(this.contentDOMElement)) {\n el.appendChild(this.contentDOMElement);\n }\n };\n const context = {\n markViewContentRef\n };\n const ReactMarkViewProvider = React4.memo(\n (componentProps2) => {\n return /* @__PURE__ */ jsx6(ReactMarkViewContext.Provider, { value: context, children: React4.createElement(component, componentProps2) });\n }\n );\n ReactMarkViewProvider.displayName = \"ReactMarkView\";\n this.renderer = new ReactRenderer(ReactMarkViewProvider, {\n editor: props.editor,\n props: componentProps,\n as,\n className: `mark-${props.mark.type.name} ${className}`.trim()\n });\n if (attrs) {\n this.renderer.updateAttributes(attrs);\n }\n }\n get dom() {\n return this.renderer.element;\n }\n get contentDOM() {\n return this.contentDOMElement;\n }\n};\nfunction ReactMarkViewRenderer(component, options = {}) {\n return (props) => new ReactMarkView(component, props, options);\n}\n\n// src/ReactNodeViewRenderer.tsx\nimport { getRenderedAttributes, isNodeViewSelected, NodeView } from \"@tiptap/core\";\nimport { createElement as createElement2, createRef, memo } from \"react\";\n\n// src/captureDOMSelection.ts\nfunction captureDOMSelection(element) {\n var _a, _b;\n const root = element.getRootNode();\n const selection = typeof root.getSelection === \"function\" ? root.getSelection() : (_b = (_a = element.ownerDocument) == null ? void 0 : _a.defaultView) == null ? void 0 : _b.getSelection();\n if (!selection || selection.rangeCount === 0) {\n return null;\n }\n const { anchorNode, anchorOffset, focusNode, focusOffset } = selection;\n if (!anchorNode || !focusNode) {\n return null;\n }\n if (!element.contains(anchorNode) || !element.contains(focusNode)) {\n return null;\n }\n return () => {\n try {\n selection.setBaseAndExtent(anchorNode, anchorOffset, focusNode, focusOffset);\n } catch {\n }\n };\n}\n\n// src/ReactNodeViewRenderer.tsx\nimport { jsx as jsx7 } from \"react/jsx-runtime\";\nvar ReactNodeView = class extends NodeView {\n constructor(component, props, options) {\n super(component, props, options);\n /**\n * The requestAnimationFrame ID used for selection updates.\n */\n this.selectionRafId = null;\n /**\n * Fires on editor updates when trackNodeViewPosition is enabled.\n * Detects position shifts where update() is NOT called (e.g. typing above).\n */\n this.handlePositionUpdate = () => {\n const newPos = this.getPos();\n if (typeof newPos !== \"number\" || newPos === this.currentPos) {\n return;\n }\n this.currentPos = newPos;\n this.renderer.updateProps({ getPos: () => this.getPos() });\n if (typeof this.options.attrs === \"function\") {\n this.updateElementAttributes();\n }\n };\n this.cachedExtensionWithSyncedStorage = null;\n if (!this.node.isLeaf) {\n if (this.options.contentDOMElementTag) {\n this.contentDOMElement = document.createElement(this.options.contentDOMElementTag);\n } else {\n this.contentDOMElement = document.createElement(this.node.isInline ? \"span\" : \"div\");\n }\n this.contentDOMElement.dataset.nodeViewContentReact = \"\";\n this.contentDOMElement.dataset.nodeViewWrapper = \"\";\n this.contentDOMElement.style.whiteSpace = \"inherit\";\n const contentTarget = this.dom.querySelector(\"[data-node-view-content]\");\n if (contentTarget) {\n contentTarget.appendChild(this.contentDOMElement);\n } else {\n this.dom.appendChild(this.contentDOMElement);\n }\n }\n if (this.options.trackNodeViewPosition) {\n this.editor.on(\"update\", this.handlePositionUpdate);\n }\n }\n /**\n * Returns a proxy of the extension that redirects storage access to the editor's mutable storage.\n * This preserves the original prototype chain (instanceof checks, methods like configure/extend work).\n * Cached to avoid proxy creation on every update.\n */\n get extensionWithSyncedStorage() {\n if (!this.cachedExtensionWithSyncedStorage) {\n const editor = this.editor;\n const extension = this.extension;\n this.cachedExtensionWithSyncedStorage = new Proxy(extension, {\n get(target, prop, receiver) {\n var _a;\n if (prop === \"storage\") {\n return (_a = editor.storage[extension.name]) != null ? _a : {};\n }\n return Reflect.get(target, prop, receiver);\n }\n });\n }\n return this.cachedExtensionWithSyncedStorage;\n }\n /**\n * Setup the React component.\n * Called on initialization.\n */\n mount() {\n const props = {\n editor: this.editor,\n node: this.node,\n decorations: this.decorations,\n innerDecorations: this.innerDecorations,\n view: this.view,\n selected: false,\n extension: this.extensionWithSyncedStorage,\n HTMLAttributes: this.HTMLAttributes,\n getPos: () => this.getPos(),\n updateAttributes: (attributes = {}) => this.updateAttributes(attributes),\n deleteNode: () => this.deleteNode(),\n ref: createRef()\n };\n const mountProps = props;\n if (!this.component.displayName) {\n const capitalizeFirstChar = (string) => {\n return string.charAt(0).toUpperCase() + string.substring(1);\n };\n this.component.displayName = capitalizeFirstChar(this.extension.name);\n }\n const onDragStart = this.onDragStart.bind(this);\n const nodeViewContentRef = (element) => {\n if (element && this.contentDOMElement && element.firstChild !== this.contentDOMElement) {\n if (element.hasAttribute(\"data-node-view-wrapper\")) {\n element.removeAttribute(\"data-node-view-wrapper\");\n }\n const restoreSelection = captureDOMSelection(this.contentDOMElement);\n element.appendChild(this.contentDOMElement);\n restoreSelection == null ? void 0 : restoreSelection();\n }\n };\n const context = { onDragStart, nodeViewContentRef };\n const Component = this.component;\n const ReactNodeViewProvider = memo(\n (componentProps) => {\n return /* @__PURE__ */ jsx7(ReactNodeViewContext.Provider, { value: context, children: createElement2(Component, componentProps) });\n }\n );\n ReactNodeViewProvider.displayName = \"ReactNodeView\";\n let as = this.node.isInline ? \"span\" : \"div\";\n if (this.options.as) {\n as = this.options.as;\n }\n const { className = \"\" } = this.options;\n this.handleSelectionUpdate = this.handleSelectionUpdate.bind(this);\n this.renderer = new ReactRenderer(ReactNodeViewProvider, {\n editor: this.editor,\n props: mountProps,\n as,\n className: `node-${this.node.type.name} ${className}`.trim()\n });\n this.editor.on(\"selectionUpdate\", this.handleSelectionUpdate);\n this.updateElementAttributes();\n this.currentPos = this.getPos();\n }\n /**\n * Return the DOM element.\n * This is the element that will be used to display the node view.\n */\n get dom() {\n var _a;\n if (this.renderer.element.firstElementChild && !((_a = this.renderer.element.firstElementChild) == null ? void 0 : _a.hasAttribute(\"data-node-view-wrapper\"))) {\n throw Error(\"Please use the NodeViewWrapper component for your node view.\");\n }\n return this.renderer.element;\n }\n /**\n * Return the content DOM element.\n * This is the element that will be used to display the rich-text content of the node.\n */\n get contentDOM() {\n if (this.node.isLeaf) {\n return null;\n }\n return this.contentDOMElement;\n }\n /**\n * On editor selection update, check if the node is selected.\n * If it is, call `selectNode`, otherwise call `deselectNode`.\n */\n handleSelectionUpdate() {\n if (this.selectionRafId) {\n cancelAnimationFrame(this.selectionRafId);\n this.selectionRafId = null;\n }\n this.selectionRafId = requestAnimationFrame(() => {\n var _a;\n this.selectionRafId = null;\n const pos = (_a = this.getPos()) != null ? _a : this.currentPos;\n if (typeof pos !== \"number\") {\n return;\n }\n const isSelected = isNodeViewSelected({\n selection: this.editor.state.selection,\n pos,\n nodeSize: this.node.nodeSize,\n selectedOnTextSelection: this.options.selectedOnTextSelection\n });\n if (isSelected) {\n if (this.renderer.props.selected) {\n return;\n }\n this.selectNode();\n } else {\n if (!this.renderer.props.selected) {\n return;\n }\n this.deselectNode();\n }\n });\n }\n /**\n * On update, update the React component.\n * To prevent unnecessary updates, the `update` option can be used.\n */\n update(node, decorations, innerDecorations) {\n const rerenderComponent = (props) => {\n this.renderer.updateProps(props);\n if (typeof this.options.attrs === \"function\") {\n this.updateElementAttributes();\n }\n };\n if (node.type !== this.node.type) {\n return false;\n }\n if (typeof this.options.update === \"function\") {\n const oldNode = this.node;\n const oldDecorations = this.decorations;\n const oldInnerDecorations = this.innerDecorations;\n this.node = node;\n this.decorations = decorations;\n this.innerDecorations = innerDecorations;\n this.currentPos = this.getPos();\n return this.options.update({\n oldNode,\n oldDecorations,\n newNode: node,\n newDecorations: decorations,\n oldInnerDecorations,\n innerDecorations,\n updateProps: () => rerenderComponent({\n node,\n decorations,\n innerDecorations,\n extension: this.extensionWithSyncedStorage\n })\n });\n }\n const nodeChanged = node !== this.node;\n if (!nodeChanged) {\n this.node = node;\n this.decorations = decorations;\n this.innerDecorations = innerDecorations;\n return true;\n }\n const newPos = this.getPos();\n this.node = node;\n this.decorations = decorations;\n this.innerDecorations = innerDecorations;\n this.currentPos = newPos;\n const extraProps = {\n node,\n decorations,\n innerDecorations,\n extension: this.extensionWithSyncedStorage\n };\n if (this.options.trackNodeViewPosition) {\n extraProps.getPos = () => this.getPos();\n }\n rerenderComponent(extraProps);\n return true;\n }\n /**\n * Select the node.\n * Add the `selected` prop and the `ProseMirror-selectednode` class.\n */\n selectNode() {\n this.renderer.updateProps({\n selected: true\n });\n this.renderer.element.classList.add(\"ProseMirror-selectednode\");\n }\n /**\n * Deselect the node.\n * Remove the `selected` prop and the `ProseMirror-selectednode` class.\n */\n deselectNode() {\n this.renderer.updateProps({\n selected: false\n });\n this.renderer.element.classList.remove(\"ProseMirror-selectednode\");\n }\n /**\n * Destroy the React component instance.\n */\n destroy() {\n this.renderer.destroy();\n this.editor.off(\"selectionUpdate\", this.handleSelectionUpdate);\n if (this.options.trackNodeViewPosition) {\n this.editor.off(\"update\", this.handlePositionUpdate);\n }\n this.contentDOMElement = null;\n if (this.selectionRafId) {\n cancelAnimationFrame(this.selectionRafId);\n this.selectionRafId = null;\n }\n }\n /**\n * Update the attributes of the top-level element that holds the React component.\n * Applying the attributes defined in the `attrs` option.\n */\n updateElementAttributes() {\n if (this.options.attrs) {\n let attrsObj = {};\n if (typeof this.options.attrs === \"function\") {\n const extensionAttributes = this.editor.extensionManager.attributes;\n const HTMLAttributes = getRenderedAttributes(this.node, extensionAttributes);\n attrsObj = this.options.attrs({ node: this.node, HTMLAttributes });\n } else {\n attrsObj = this.options.attrs;\n }\n this.renderer.updateAttributes(attrsObj);\n }\n }\n};\nfunction ReactNodeViewRenderer(component, options) {\n return (props) => {\n if (!props.editor.contentComponent) {\n return {};\n }\n return new ReactNodeView(component, props, options);\n };\n}\n\n// src/ReactWidgetRenderer.tsx\nimport { createWidgetDecoration } from \"@tiptap/core\";\nvar WIDGET_CACHE = /* @__PURE__ */ Symbol(\"tiptapReactWidgetCache\");\nfunction ReactWidgetRenderer(component, options) {\n const { editor, props = {}, as = \"span\", className } = options;\n return createWidgetDecoration({\n // Forwards editor, pos, key and the ProseMirror widget options unchanged.\n ...options,\n props,\n cacheKey: WIDGET_CACHE,\n context: (getPos) => ({ editor, getPos }),\n create: (renderProps) => new ReactRenderer(component, {\n editor,\n as,\n className,\n props: renderProps\n }),\n materialize: (renderer) => {\n renderer.render();\n return renderer.element;\n }\n });\n}\n\n// src/Tiptap.tsx\nimport { createContext as createContext3, useContext as useContext3, useMemo as useMemo2 } from \"react\";\nimport { jsx as jsx8 } from \"react/jsx-runtime\";\nvar TiptapContext = createContext3({\n get editor() {\n throw new Error(\"useTiptap must be used within a <Tiptap> provider\");\n }\n});\nTiptapContext.displayName = \"TiptapContext\";\nvar useTiptap = () => useContext3(TiptapContext);\nfunction useTiptapState(selector, equalityFn) {\n const { editor } = useTiptap();\n return useEditorState({\n editor,\n selector,\n equalityFn\n });\n}\nfunction TiptapWrapper({ children, ...props }) {\n const resolvedEditor = \"editor\" in props ? props.editor : props.instance;\n if (!resolvedEditor) {\n throw new Error(\"Tiptap: An editor instance is required. Pass a non-null `editor` prop.\");\n }\n const tiptapContextValue = useMemo2(\n () => ({ editor: resolvedEditor }),\n [resolvedEditor]\n );\n const legacyContextValue = useMemo2(() => ({ editor: resolvedEditor }), [resolvedEditor]);\n return /* @__PURE__ */ jsx8(EditorContext.Provider, { value: legacyContextValue, children: /* @__PURE__ */ jsx8(TiptapContext.Provider, { value: tiptapContextValue, children }) });\n}\nTiptapWrapper.displayName = \"Tiptap\";\nfunction TiptapContent({ ...rest }) {\n const { editor } = useTiptap();\n return /* @__PURE__ */ jsx8(EditorContent, { editor, ...rest });\n}\nTiptapContent.displayName = \"Tiptap.Content\";\nvar Tiptap = Object.assign(TiptapWrapper, {\n /**\n * The Tiptap Content component that renders the EditorContent with the editor instance from the context.\n * @see TiptapContent\n */\n Content: TiptapContent\n});\n\n// src/index.ts\nexport * from \"@tiptap/core\";\nexport {\n EditorConsumer,\n EditorContent,\n EditorContext,\n EditorProvider,\n MarkViewContent,\n NodeViewContent,\n NodeViewWrapper,\n PureEditorContent,\n ReactMarkView,\n ReactMarkViewContext,\n ReactMarkViewRenderer,\n ReactNodeView,\n ReactNodeViewContentProvider,\n ReactNodeViewContext,\n ReactNodeViewRenderer,\n ReactRenderer,\n ReactWidgetRenderer,\n Tiptap,\n TiptapContent,\n TiptapContext,\n TiptapWrapper,\n createContentComponent,\n useCurrentEditor,\n useEditor,\n useEditorState,\n useReactNodeView,\n useTiptap,\n useTiptapState\n};\n//# sourceMappingURL=index.js.map"],"x_google_ignoreList":[0],"mappings":";;;;;;;;;wBAUI,MAAa,GAAG,OACV,MAAS;CACf,EAAK,SAAS,MAAQ;EACpB,AAAI,OAAO,KAAQ,aACjB,EAAI,CAAI,IACC,MAET,EAAI,UAAU;CAElB,CAAC;AACH,GAEE,MAAW,EAAE,0BAAuB;CACtC,IAAM,KAAA,GAAYA,EAAAA,qBAAAA,CAChB,EAAiB,WACjB,EAAiB,aACjB,EAAiB,iBACnB;CACA,OAAuB,kBAAI,GAAU,EAAE,UAAU,OAAO,OAAO,CAAS,EAAE,CAAC;AAC7E;AACA,SAAS,IAAyB;CAChC,IAAM,oBAA8B,IAAI,IAAI,GACxC,IAAY,CAAC,GACb,IAAuB,IACrB,UAA0B;EAC1B,KAAwB,CAAC,EAAY,SAGzC,IAAuB,IACvB,qBAAqB;GAEnB,AADA,IAAuB,IACvB,EAAY,SAAS,MAAe,EAAW,CAAC;EAClD,CAAC;CACH;CACA,OAAO;EAIL,UAA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,CAAC,GA2J0BC,EAAO,cAAc,EAC9C,0BAA0B,CAC1B,EACF,CAAC;AA6ZD,IAAI,IAAgBC,EAAe,EACjC,IAAI,SAAS;CACX,MAAU,MAAM,mDAAmD;AACrE,EACF,CAAC;AACD,EAAc,cAAc;AAC5B,IAAI,UAAkBC,EAAY,CAAa;AAS/C,SAAS,EAAc,EAAE,aAAU,GAAG,KAAS;CAC7C,IAAM,IAAiB,YAAY,IAAQ,EAAM,SAAS,EAAM;CAChE,IAAI,CAAC,GACH,MAAU,MAAM,wEAAwE;CAE1F,IAAM,IAAqBC,SAClB,EAAE,QAAQ,EAAe,IAChC,CAAC,CAAc,CACjB,GACM,IAAqBA,SAAgB,EAAE,QAAQ,EAAe,IAAI,CAAC,CAAc,CAAC;CACxF,OAAuB,kBAAK,EAAc,UAAU;EAAE,OAAO;EAAoB,UAA0B,kBAAK,EAAc,UAAU;GAAE,OAAO;GAAoB;EAAS,CAAC;CAAE,CAAC;AACpL;AACA,EAAc,cAAc;AAC5B,SAAS,EAAc,EAAE,GAAG,KAAQ;CAClC,IAAM,EAAE,cAAW,EAAU;CAC7B,OAAuB,kBAAK,GAAe;EAAE;EAAQ,GAAG;CAAK,CAAC;AAChE;AACA,EAAc,cAAc,kBACf,OAAO,OAAO,GAAe,EAKxC,SAAS,EACX,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.js","names":["useState2","useSyncExternalStore2","createContext2","useContext2","React3","React4","createContext3","useContext3","useMemo2"],"sources":["../../../../../node_modules/@tiptap/react/dist/index.js"],"sourcesContent":["\"use client\";\n\n// src/Context.tsx\nimport { createContext, useContext, useMemo } from \"react\";\n\n// src/EditorContent.tsx\nimport React, { forwardRef } from \"react\";\nimport ReactDOM from \"react-dom\";\nimport { useSyncExternalStore } from \"use-sync-external-store/shim/index.js\";\nimport { Fragment, jsx, jsxs } from \"react/jsx-runtime\";\nvar mergeRefs = (...refs) => {\n return (node) => {\n refs.forEach((ref) => {\n if (typeof ref === \"function\") {\n ref(node);\n } else if (ref) {\n ;\n ref.current = node;\n }\n });\n };\n};\nvar Portals = ({ contentComponent }) => {\n const renderers = useSyncExternalStore(\n contentComponent.subscribe,\n contentComponent.getSnapshot,\n contentComponent.getServerSnapshot\n );\n return /* @__PURE__ */ jsx(Fragment, { children: Object.values(renderers) });\n};\nfunction createContentComponent() {\n const subscribers = /* @__PURE__ */ new Set();\n let renderers = {};\n let isNotificationQueued = false;\n const notifySubscribers = () => {\n if (isNotificationQueued || !subscribers.size) {\n return;\n }\n isNotificationQueued = true;\n queueMicrotask(() => {\n isNotificationQueued = false;\n subscribers.forEach((subscriber) => subscriber());\n });\n };\n return {\n /**\n * Subscribe to the editor instance's changes.\n */\n subscribe(callback) {\n subscribers.add(callback);\n return () => {\n subscribers.delete(callback);\n };\n },\n getSnapshot() {\n return renderers;\n },\n getServerSnapshot() {\n return renderers;\n },\n /**\n * Adds a new NodeView Renderer to the editor.\n */\n setRenderer(id, renderer) {\n renderers = {\n ...renderers,\n [id]: ReactDOM.createPortal(renderer.reactElement, renderer.element, id)\n };\n notifySubscribers();\n },\n /**\n * Removes a NodeView Renderer from the editor.\n */\n removeRenderer(id) {\n const nextRenderers = { ...renderers };\n delete nextRenderers[id];\n renderers = nextRenderers;\n notifySubscribers();\n }\n };\n}\nvar PureEditorContent = class extends React.Component {\n constructor(props) {\n super(props);\n this.editorContentRef = React.createRef();\n }\n componentDidMount() {\n this.init();\n }\n componentDidUpdate() {\n this.init();\n }\n init() {\n var _a;\n const editor = this.props.editor;\n if (editor && !editor.isDestroyed && ((_a = editor.view.dom) == null ? void 0 : _a.parentNode)) {\n if (editor.contentComponent) {\n return;\n }\n const element = this.editorContentRef.current;\n element.append(...editor.view.dom.parentNode.childNodes);\n editor.setOptions({\n element\n });\n editor.contentComponent = createContentComponent();\n editor.createNodeViews();\n editor.isEditorContentInitialized = true;\n this.forceUpdate();\n }\n }\n componentWillUnmount() {\n var _a;\n const editor = this.props.editor;\n if (!editor) {\n return;\n }\n editor.isEditorContentInitialized = false;\n if (!editor.isDestroyed) {\n editor.view.setProps({\n nodeViews: {}\n });\n }\n editor.contentComponent = null;\n try {\n if (!((_a = editor.view.dom) == null ? void 0 : _a.parentNode)) {\n return;\n }\n const newElement = document.createElement(\"div\");\n newElement.append(...editor.view.dom.parentNode.childNodes);\n editor.setOptions({\n element: newElement\n });\n } catch {\n }\n }\n render() {\n const { editor, innerRef, ...rest } = this.props;\n return /* @__PURE__ */ jsxs(Fragment, { children: [\n /* @__PURE__ */ jsx(\"div\", { ref: mergeRefs(innerRef, this.editorContentRef), ...rest }),\n (editor == null ? void 0 : editor.contentComponent) && /* @__PURE__ */ jsx(Portals, { contentComponent: editor.contentComponent })\n ] });\n }\n};\nvar EditorContentWithKey = forwardRef(\n (props, ref) => {\n const key = React.useMemo(() => {\n return Math.floor(Math.random() * 4294967295).toString();\n }, [props.editor]);\n return React.createElement(PureEditorContent, {\n key,\n innerRef: ref,\n ...props\n });\n }\n);\nvar EditorContent = React.memo(EditorContentWithKey);\n\n// src/useEditor.ts\nimport { Editor } from \"@tiptap/core\";\nimport { useDebugValue as useDebugValue2, useEffect as useEffect2, useRef, useState as useState2 } from \"react\";\nimport { useSyncExternalStore as useSyncExternalStore2 } from \"use-sync-external-store/shim/index.js\";\n\n// src/useEditorState.ts\nimport { deepEqual } from \"fast-equals\";\nimport { useDebugValue, useEffect, useLayoutEffect, useState } from \"react\";\nimport { useSyncExternalStoreWithSelector } from \"use-sync-external-store/shim/with-selector.js\";\nvar useIsomorphicLayoutEffect = typeof window !== \"undefined\" ? useLayoutEffect : useEffect;\nvar EditorStateManager = class {\n constructor(initialEditor) {\n this.transactionNumber = 0;\n this.lastTransactionNumber = 0;\n this.subscribers = /* @__PURE__ */ new Set();\n this.editor = initialEditor;\n this.lastSnapshot = { editor: initialEditor, transactionNumber: 0 };\n this.getSnapshot = this.getSnapshot.bind(this);\n this.getServerSnapshot = this.getServerSnapshot.bind(this);\n this.watch = this.watch.bind(this);\n this.subscribe = this.subscribe.bind(this);\n }\n /**\n * Get the current editor instance.\n */\n getSnapshot() {\n if (this.transactionNumber === this.lastTransactionNumber) {\n return this.lastSnapshot;\n }\n this.lastTransactionNumber = this.transactionNumber;\n this.lastSnapshot = { editor: this.editor, transactionNumber: this.transactionNumber };\n return this.lastSnapshot;\n }\n /**\n * Always disable the editor on the server-side.\n */\n getServerSnapshot() {\n return { editor: null, transactionNumber: 0 };\n }\n /**\n * Subscribe to the editor instance's changes.\n */\n subscribe(callback) {\n this.subscribers.add(callback);\n return () => {\n this.subscribers.delete(callback);\n };\n }\n /**\n * Watch the editor instance for changes.\n */\n watch(nextEditor) {\n this.editor = nextEditor;\n if (this.editor) {\n let lastTransaction;\n const fn = (props) => {\n if ((props == null ? void 0 : props.transaction) !== void 0 && props.transaction === lastTransaction) {\n return;\n }\n lastTransaction = props == null ? void 0 : props.transaction;\n this.transactionNumber += 1;\n this.subscribers.forEach((callback) => callback());\n };\n const currentEditor = this.editor;\n currentEditor.on(\"transaction\", fn);\n currentEditor.on(\"update\", fn);\n return () => {\n currentEditor.off(\"transaction\", fn);\n currentEditor.off(\"update\", fn);\n };\n }\n return void 0;\n }\n};\nfunction useEditorState(options) {\n var _a;\n const [editorStateManager] = useState(() => new EditorStateManager(options.editor));\n const selectedState = useSyncExternalStoreWithSelector(\n editorStateManager.subscribe,\n editorStateManager.getSnapshot,\n editorStateManager.getServerSnapshot,\n options.selector,\n (_a = options.equalityFn) != null ? _a : deepEqual\n );\n useIsomorphicLayoutEffect(() => {\n return editorStateManager.watch(options.editor);\n }, [options.editor, editorStateManager]);\n useDebugValue(selectedState);\n return selectedState;\n}\n\n// src/useEditor.ts\nvar isDev = process.env.NODE_ENV !== \"production\";\nvar isSSR = typeof window === \"undefined\";\nvar isNext = isSSR || Boolean(typeof window !== \"undefined\" && window.next);\nvar EditorInstanceManager = class _EditorInstanceManager {\n constructor(options) {\n /**\n * The current editor instance.\n */\n this.editor = null;\n /**\n * The subscriptions to notify when the editor instance\n * has been created or destroyed.\n */\n this.subscriptions = /* @__PURE__ */ new Set();\n /**\n * Whether the editor has been mounted.\n */\n this.isComponentMounted = false;\n /**\n * The most recent dependencies array.\n */\n this.previousDeps = null;\n /**\n * The unique instance ID. This is used to identify the editor instance. And will be re-generated for each new instance.\n */\n this.instanceId = \"\";\n this.options = options;\n this.subscriptions = /* @__PURE__ */ new Set();\n this.setEditor(this.getInitialEditor());\n this.scheduleDestroy();\n this.getEditor = this.getEditor.bind(this);\n this.getServerSnapshot = this.getServerSnapshot.bind(this);\n this.subscribe = this.subscribe.bind(this);\n this.refreshEditorInstance = this.refreshEditorInstance.bind(this);\n this.scheduleDestroy = this.scheduleDestroy.bind(this);\n this.onRender = this.onRender.bind(this);\n this.createEditor = this.createEditor.bind(this);\n }\n setEditor(editor) {\n this.editor = editor;\n this.instanceId = Math.random().toString(36).slice(2, 9);\n this.subscriptions.forEach((cb) => cb());\n }\n getInitialEditor() {\n const explicit = this.options.current.immediatelyRender;\n let immediatelyRender = explicit != null ? explicit : true;\n if (isSSR) {\n if (immediatelyRender && isDev) {\n console.warn(\n \"SSR detected. `immediatelyRender` has been set to false to avoid hydration mismatches\"\n );\n }\n immediatelyRender = false;\n } else if (isNext && explicit === void 0) {\n immediatelyRender = false;\n if (isDev) {\n console.warn(\n \"Next.js detected. `immediatelyRender` defaults to false to avoid hydration mismatches. Pass `immediatelyRender: true` explicitly if you are rendering the editor only on the client.\"\n );\n }\n }\n return immediatelyRender ? this.createEditor() : null;\n }\n /**\n * Create a new editor instance. And attach event listeners.\n */\n createEditor() {\n const optionsToApply = {\n ...this.options.current,\n // Always call the most recent version of the callback function by default\n onBeforeCreate: (...args) => {\n var _a, _b;\n return (_b = (_a = this.options.current).onBeforeCreate) == null ? void 0 : _b.call(_a, ...args);\n },\n onBlur: (...args) => {\n var _a, _b;\n return (_b = (_a = this.options.current).onBlur) == null ? void 0 : _b.call(_a, ...args);\n },\n onCreate: (...args) => {\n var _a, _b;\n return (_b = (_a = this.options.current).onCreate) == null ? void 0 : _b.call(_a, ...args);\n },\n onDestroy: (...args) => {\n var _a, _b;\n return (_b = (_a = this.options.current).onDestroy) == null ? void 0 : _b.call(_a, ...args);\n },\n onFocus: (...args) => {\n var _a, _b;\n return (_b = (_a = this.options.current).onFocus) == null ? void 0 : _b.call(_a, ...args);\n },\n onSelectionUpdate: (...args) => {\n var _a, _b;\n return (_b = (_a = this.options.current).onSelectionUpdate) == null ? void 0 : _b.call(_a, ...args);\n },\n onTransaction: (...args) => {\n var _a, _b;\n return (_b = (_a = this.options.current).onTransaction) == null ? void 0 : _b.call(_a, ...args);\n },\n onUpdate: (...args) => {\n var _a, _b;\n return (_b = (_a = this.options.current).onUpdate) == null ? void 0 : _b.call(_a, ...args);\n },\n onContentError: (...args) => {\n var _a, _b;\n return (_b = (_a = this.options.current).onContentError) == null ? void 0 : _b.call(_a, ...args);\n },\n onDrop: (...args) => {\n var _a, _b;\n return (_b = (_a = this.options.current).onDrop) == null ? void 0 : _b.call(_a, ...args);\n },\n onPaste: (...args) => {\n var _a, _b;\n return (_b = (_a = this.options.current).onPaste) == null ? void 0 : _b.call(_a, ...args);\n },\n onDelete: (...args) => {\n var _a, _b;\n return (_b = (_a = this.options.current).onDelete) == null ? void 0 : _b.call(_a, ...args);\n },\n onMount: (...args) => {\n var _a, _b;\n return (_b = (_a = this.options.current).onMount) == null ? void 0 : _b.call(_a, ...args);\n },\n onUnmount: (...args) => {\n var _a, _b;\n return (_b = (_a = this.options.current).onUnmount) == null ? void 0 : _b.call(_a, ...args);\n }\n };\n const editor = new Editor(optionsToApply);\n return editor;\n }\n /**\n * Get the current editor instance.\n */\n getEditor() {\n return this.editor;\n }\n /**\n * Always disable the editor on the server-side.\n */\n getServerSnapshot() {\n return null;\n }\n /**\n * Subscribe to the editor instance's changes.\n */\n subscribe(onStoreChange) {\n this.subscriptions.add(onStoreChange);\n return () => {\n this.subscriptions.delete(onStoreChange);\n };\n }\n static compareOptions(a, b) {\n return Object.keys(a).every((key) => {\n if ([\n \"onCreate\",\n \"onBeforeCreate\",\n \"onDestroy\",\n \"onUpdate\",\n \"onTransaction\",\n \"onFocus\",\n \"onBlur\",\n \"onSelectionUpdate\",\n \"onContentError\",\n \"onDrop\",\n \"onPaste\"\n ].includes(key)) {\n return true;\n }\n if (key === \"extensions\" && a.extensions && b.extensions) {\n if (a.extensions.length !== b.extensions.length) {\n return false;\n }\n return a.extensions.every((extension, index) => {\n var _a;\n if (extension !== ((_a = b.extensions) == null ? void 0 : _a[index])) {\n return false;\n }\n return true;\n });\n }\n if (a[key] !== b[key]) {\n return false;\n }\n return true;\n });\n }\n /**\n * On each render, we will create, update, or destroy the editor instance.\n * @param deps The dependencies to watch for changes\n * @returns A cleanup function\n */\n onRender(deps) {\n return () => {\n this.isComponentMounted = true;\n clearTimeout(this.scheduledDestructionTimeout);\n if (this.editor && !this.editor.isDestroyed && deps.length === 0) {\n if (!_EditorInstanceManager.compareOptions(this.options.current, this.editor.options)) {\n this.editor.setOptions({\n ...this.options.current,\n editable: this.editor.isEditable\n });\n }\n } else {\n this.refreshEditorInstance(deps);\n }\n return () => {\n this.isComponentMounted = false;\n this.scheduleDestroy();\n };\n };\n }\n /**\n * Recreate the editor instance if the dependencies have changed.\n */\n refreshEditorInstance(deps) {\n if (this.editor && !this.editor.isDestroyed) {\n if (this.previousDeps === null) {\n this.previousDeps = deps;\n return;\n }\n const depsAreEqual = this.previousDeps.length === deps.length && this.previousDeps.every((dep, index) => dep === deps[index]);\n if (depsAreEqual) {\n return;\n }\n }\n if (this.editor && !this.editor.isDestroyed) {\n this.editor.destroy();\n }\n this.setEditor(this.createEditor());\n this.previousDeps = deps;\n }\n /**\n * Schedule the destruction of the editor instance.\n * This will only destroy the editor if it was not mounted on the next tick.\n * This is to avoid destroying the editor instance when it's actually still mounted.\n */\n scheduleDestroy() {\n const currentInstanceId = this.instanceId;\n const currentEditor = this.editor;\n this.scheduledDestructionTimeout = setTimeout(() => {\n if (this.isComponentMounted && this.instanceId === currentInstanceId) {\n if (currentEditor) {\n currentEditor.setOptions(this.options.current);\n }\n return;\n }\n if (currentEditor && !currentEditor.isDestroyed) {\n currentEditor.destroy();\n if (this.instanceId === currentInstanceId) {\n this.setEditor(null);\n }\n }\n }, 1);\n }\n};\nfunction useEditor(options = {}, deps = []) {\n const mostRecentOptions = useRef(options);\n mostRecentOptions.current = options;\n const [instanceManager] = useState2(() => new EditorInstanceManager(mostRecentOptions));\n const editor = useSyncExternalStore2(\n instanceManager.subscribe,\n instanceManager.getEditor,\n instanceManager.getServerSnapshot\n );\n useDebugValue2(editor);\n useEffect2(instanceManager.onRender(deps));\n useEditorState({\n editor,\n selector: ({ transactionNumber }) => {\n if (options.shouldRerenderOnTransaction === false || options.shouldRerenderOnTransaction === void 0) {\n return null;\n }\n if (options.immediatelyRender && transactionNumber === 0) {\n return 0;\n }\n return transactionNumber + 1;\n }\n });\n return editor;\n}\n\n// src/Context.tsx\nimport { jsx as jsx2, jsxs as jsxs2 } from \"react/jsx-runtime\";\nvar EditorContext = createContext({\n editor: null\n});\nvar EditorConsumer = EditorContext.Consumer;\nvar useCurrentEditor = () => useContext(EditorContext);\nfunction EditorProvider({\n children,\n slotAfter,\n slotBefore,\n editorContainerProps = {},\n ...editorOptions\n}) {\n const editor = useEditor(editorOptions);\n const contextValue = useMemo(() => ({ editor }), [editor]);\n if (!editor) {\n return null;\n }\n return /* @__PURE__ */ jsxs2(EditorContext.Provider, { value: contextValue, children: [\n slotBefore,\n /* @__PURE__ */ jsx2(EditorConsumer, { children: ({ editor: currentEditor }) => /* @__PURE__ */ jsx2(EditorContent, { editor: currentEditor, ...editorContainerProps }) }),\n children,\n slotAfter\n ] });\n}\n\n// src/useReactNodeView.ts\nimport { createContext as createContext2, createElement, useContext as useContext2 } from \"react\";\nvar ReactNodeViewContext = createContext2({\n onDragStart: () => {\n },\n nodeViewContentChildren: void 0,\n nodeViewContentRef: () => {\n }\n});\nvar ReactNodeViewContentProvider = ({\n children,\n content\n}) => {\n return createElement(\n ReactNodeViewContext.Provider,\n { value: { nodeViewContentChildren: content } },\n children\n );\n};\nvar useReactNodeView = () => useContext2(ReactNodeViewContext);\n\n// src/NodeViewContent.tsx\nimport { jsx as jsx3 } from \"react/jsx-runtime\";\nfunction NodeViewContent({\n as: Tag = \"div\",\n ...props\n}) {\n const { nodeViewContentRef, nodeViewContentChildren } = useReactNodeView();\n return (\n // @ts-ignore\n /* @__PURE__ */ jsx3(\n Tag,\n {\n ...props,\n ref: nodeViewContentRef,\n \"data-node-view-content\": \"\",\n style: {\n whiteSpace: \"pre-wrap\",\n ...props.style\n },\n children: nodeViewContentChildren\n }\n )\n );\n}\n\n// src/NodeViewWrapper.tsx\nimport React3 from \"react\";\nimport { jsx as jsx4 } from \"react/jsx-runtime\";\nvar NodeViewWrapper = React3.forwardRef((props, ref) => {\n const { onDragStart } = useReactNodeView();\n const Tag = props.as || \"div\";\n return (\n // @ts-ignore\n /* @__PURE__ */ jsx4(\n Tag,\n {\n ...props,\n ref,\n \"data-node-view-wrapper\": \"\",\n onDragStart,\n style: {\n whiteSpace: \"normal\",\n ...props.style\n }\n }\n )\n );\n});\n\n// src/ReactMarkViewRenderer.tsx\nimport { MarkView } from \"@tiptap/core\";\nimport React4 from \"react\";\n\n// src/ReactRenderer.tsx\nimport { version as reactVersion } from \"react\";\nimport { flushSync } from \"react-dom\";\nimport { jsx as jsx5 } from \"react/jsx-runtime\";\nfunction isClassComponent(Component) {\n return !!(typeof Component === \"function\" && Component.prototype && Component.prototype.isReactComponent);\n}\nfunction isForwardRefComponent(Component) {\n return !!(typeof Component === \"object\" && Component.$$typeof && (Component.$$typeof.toString() === \"Symbol(react.forward_ref)\" || Component.$$typeof.description === \"react.forward_ref\"));\n}\nfunction isMemoComponent(Component) {\n return !!(typeof Component === \"object\" && Component.$$typeof && (Component.$$typeof.toString() === \"Symbol(react.memo)\" || Component.$$typeof.description === \"react.memo\"));\n}\nfunction canReceiveRef(Component) {\n if (isClassComponent(Component)) {\n return true;\n }\n if (isForwardRefComponent(Component)) {\n return true;\n }\n if (isMemoComponent(Component)) {\n const wrappedComponent = Component.type;\n if (wrappedComponent) {\n return isClassComponent(wrappedComponent) || isForwardRefComponent(wrappedComponent);\n }\n }\n return false;\n}\nfunction isReact19Plus() {\n try {\n if (reactVersion) {\n const majorVersion = parseInt(reactVersion.split(\".\")[0], 10);\n return majorVersion >= 19;\n }\n } catch {\n }\n return false;\n}\nvar ReactRenderer = class {\n /**\n * Immediately creates element and renders the provided React component.\n */\n constructor(component, { editor, props = {}, as = \"div\", className = \"\" }) {\n this.ref = null;\n /**\n * Flag to track if the renderer has been destroyed, preventing queued or asynchronous renders from executing after teardown.\n */\n this.destroyed = false;\n this.id = Math.floor(Math.random() * 4294967295).toString();\n this.component = component;\n this.editor = editor;\n this.props = props;\n this.element = document.createElement(as);\n this.element.classList.add(\"react-renderer\");\n if (className) {\n this.element.classList.add(...className.split(\" \"));\n }\n if (this.editor.isEditorContentInitialized) {\n flushSync(() => {\n this.render();\n });\n } else {\n queueMicrotask(() => {\n if (this.destroyed) {\n return;\n }\n this.render();\n });\n }\n }\n /**\n * Render the React component.\n */\n render() {\n var _a;\n if (this.destroyed) {\n return;\n }\n const Component = this.component;\n const props = this.props;\n const editor = this.editor;\n const isReact19 = isReact19Plus();\n const componentCanReceiveRef = canReceiveRef(Component);\n const elementProps = { ...props };\n if (elementProps.ref && !(isReact19 || componentCanReceiveRef)) {\n delete elementProps.ref;\n }\n if (!elementProps.ref && (isReact19 || componentCanReceiveRef)) {\n elementProps.ref = (ref) => {\n this.ref = ref;\n };\n }\n this.reactElement = /* @__PURE__ */ jsx5(Component, { ...elementProps });\n (_a = editor == null ? void 0 : editor.contentComponent) == null ? void 0 : _a.setRenderer(this.id, this);\n }\n /**\n * Re-renders the React component with new props.\n * Skips the render if none of the supplied props actually changed,\n * to avoid unnecessary portal re-creation.\n */\n updateProps(props = {}) {\n if (this.destroyed) {\n return;\n }\n let changed = false;\n const keys = Object.keys(props);\n for (let i = 0; i < keys.length; i += 1) {\n const key = keys[i];\n if (props[key] !== this.props[key]) {\n changed = true;\n break;\n }\n }\n if (!changed) {\n return;\n }\n this.props = {\n ...this.props,\n ...props\n };\n this.render();\n }\n /**\n * Destroy the React component.\n */\n destroy() {\n var _a;\n this.destroyed = true;\n const editor = this.editor;\n (_a = editor == null ? void 0 : editor.contentComponent) == null ? void 0 : _a.removeRenderer(this.id);\n try {\n if (this.element && this.element.parentNode) {\n this.element.parentNode.removeChild(this.element);\n }\n } catch {\n }\n }\n /**\n * Update the attributes of the element that holds the React component.\n */\n updateAttributes(attributes) {\n Object.keys(attributes).forEach((key) => {\n this.element.setAttribute(key, attributes[key]);\n });\n }\n};\n\n// src/ReactMarkViewRenderer.tsx\nimport { jsx as jsx6 } from \"react/jsx-runtime\";\nvar ReactMarkViewContext = React4.createContext({\n markViewContentRef: () => {\n }\n});\nvar MarkViewContent = (props) => {\n const { as: Tag = \"span\", ...rest } = props;\n const { markViewContentRef } = React4.useContext(ReactMarkViewContext);\n return (\n // @ts-ignore\n /* @__PURE__ */ jsx6(Tag, { ...rest, ref: markViewContentRef, \"data-mark-view-content\": \"\" })\n );\n};\nvar ReactMarkView = class extends MarkView {\n constructor(component, props, options) {\n super(component, props, options);\n const { as = \"span\", attrs, className = \"\" } = options || {};\n const componentProps = {\n ...props,\n updateAttributes: this.updateAttributes.bind(this)\n };\n this.contentDOMElement = document.createElement(\"span\");\n const markViewContentRef = (el) => {\n if (el && !el.contains(this.contentDOMElement)) {\n el.appendChild(this.contentDOMElement);\n }\n };\n const context = {\n markViewContentRef\n };\n const ReactMarkViewProvider = React4.memo(\n (componentProps2) => {\n return /* @__PURE__ */ jsx6(ReactMarkViewContext.Provider, { value: context, children: React4.createElement(component, componentProps2) });\n }\n );\n ReactMarkViewProvider.displayName = \"ReactMarkView\";\n this.renderer = new ReactRenderer(ReactMarkViewProvider, {\n editor: props.editor,\n props: componentProps,\n as,\n className: `mark-${props.mark.type.name} ${className}`.trim()\n });\n if (attrs) {\n this.renderer.updateAttributes(attrs);\n }\n }\n get dom() {\n return this.renderer.element;\n }\n get contentDOM() {\n return this.contentDOMElement;\n }\n};\nfunction ReactMarkViewRenderer(component, options = {}) {\n return (props) => new ReactMarkView(component, props, options);\n}\n\n// src/ReactNodeViewRenderer.tsx\nimport { getRenderedAttributes, isNodeViewSelected, NodeView } from \"@tiptap/core\";\nimport { createElement as createElement2, createRef, memo } from \"react\";\n\n// src/captureDOMSelection.ts\nfunction captureDOMSelection(element) {\n var _a, _b;\n const root = element.getRootNode();\n const selection = typeof root.getSelection === \"function\" ? root.getSelection() : (_b = (_a = element.ownerDocument) == null ? void 0 : _a.defaultView) == null ? void 0 : _b.getSelection();\n if (!selection || selection.rangeCount === 0) {\n return null;\n }\n const { anchorNode, anchorOffset, focusNode, focusOffset } = selection;\n if (!anchorNode || !focusNode) {\n return null;\n }\n if (!element.contains(anchorNode) || !element.contains(focusNode)) {\n return null;\n }\n return () => {\n try {\n selection.setBaseAndExtent(anchorNode, anchorOffset, focusNode, focusOffset);\n } catch {\n }\n };\n}\n\n// src/ReactNodeViewRenderer.tsx\nimport { jsx as jsx7 } from \"react/jsx-runtime\";\nvar ReactNodeView = class extends NodeView {\n constructor(component, props, options) {\n super(component, props, options);\n /**\n * The requestAnimationFrame ID used for selection updates.\n */\n this.selectionRafId = null;\n /**\n * Fires on editor updates when trackNodeViewPosition is enabled.\n * Detects position shifts where update() is NOT called (e.g. typing above).\n */\n this.handlePositionUpdate = () => {\n const newPos = this.getPos();\n if (typeof newPos !== \"number\" || newPos === this.currentPos) {\n return;\n }\n this.currentPos = newPos;\n this.renderer.updateProps({ getPos: () => this.getPos() });\n if (typeof this.options.attrs === \"function\") {\n this.updateElementAttributes();\n }\n };\n this.cachedExtensionWithSyncedStorage = null;\n if (!this.node.isLeaf) {\n if (this.options.contentDOMElementTag) {\n this.contentDOMElement = document.createElement(this.options.contentDOMElementTag);\n } else {\n this.contentDOMElement = document.createElement(this.node.isInline ? \"span\" : \"div\");\n }\n this.contentDOMElement.dataset.nodeViewContentReact = \"\";\n this.contentDOMElement.dataset.nodeViewWrapper = \"\";\n this.contentDOMElement.style.whiteSpace = \"inherit\";\n const contentTarget = this.dom.querySelector(\"[data-node-view-content]\");\n if (contentTarget) {\n contentTarget.appendChild(this.contentDOMElement);\n } else {\n this.dom.appendChild(this.contentDOMElement);\n }\n }\n if (this.options.trackNodeViewPosition) {\n this.editor.on(\"update\", this.handlePositionUpdate);\n }\n }\n /**\n * Returns a proxy of the extension that redirects storage access to the editor's mutable storage.\n * This preserves the original prototype chain (instanceof checks, methods like configure/extend work).\n * Cached to avoid proxy creation on every update.\n */\n get extensionWithSyncedStorage() {\n if (!this.cachedExtensionWithSyncedStorage) {\n const editor = this.editor;\n const extension = this.extension;\n this.cachedExtensionWithSyncedStorage = new Proxy(extension, {\n get(target, prop, receiver) {\n var _a;\n if (prop === \"storage\") {\n return (_a = editor.storage[extension.name]) != null ? _a : {};\n }\n return Reflect.get(target, prop, receiver);\n }\n });\n }\n return this.cachedExtensionWithSyncedStorage;\n }\n /**\n * Setup the React component.\n * Called on initialization.\n */\n mount() {\n const props = {\n editor: this.editor,\n node: this.node,\n decorations: this.decorations,\n innerDecorations: this.innerDecorations,\n view: this.view,\n selected: false,\n extension: this.extensionWithSyncedStorage,\n HTMLAttributes: this.HTMLAttributes,\n getPos: () => this.getPos(),\n updateAttributes: (attributes = {}) => this.updateAttributes(attributes),\n deleteNode: () => this.deleteNode(),\n ref: createRef()\n };\n const mountProps = props;\n if (!this.component.displayName) {\n const capitalizeFirstChar = (string) => {\n return string.charAt(0).toUpperCase() + string.substring(1);\n };\n this.component.displayName = capitalizeFirstChar(this.extension.name);\n }\n const onDragStart = this.onDragStart.bind(this);\n const nodeViewContentRef = (element) => {\n if (element && this.contentDOMElement && element.firstChild !== this.contentDOMElement) {\n if (element.hasAttribute(\"data-node-view-wrapper\")) {\n element.removeAttribute(\"data-node-view-wrapper\");\n }\n const restoreSelection = captureDOMSelection(this.contentDOMElement);\n element.appendChild(this.contentDOMElement);\n restoreSelection == null ? void 0 : restoreSelection();\n }\n };\n const context = { onDragStart, nodeViewContentRef };\n const Component = this.component;\n const ReactNodeViewProvider = memo(\n (componentProps) => {\n return /* @__PURE__ */ jsx7(ReactNodeViewContext.Provider, { value: context, children: createElement2(Component, componentProps) });\n }\n );\n ReactNodeViewProvider.displayName = \"ReactNodeView\";\n let as = this.node.isInline ? \"span\" : \"div\";\n if (this.options.as) {\n as = this.options.as;\n }\n const { className = \"\" } = this.options;\n this.handleSelectionUpdate = this.handleSelectionUpdate.bind(this);\n this.renderer = new ReactRenderer(ReactNodeViewProvider, {\n editor: this.editor,\n props: mountProps,\n as,\n className: `node-${this.node.type.name} ${className}`.trim()\n });\n this.editor.on(\"selectionUpdate\", this.handleSelectionUpdate);\n this.updateElementAttributes();\n this.currentPos = this.getPos();\n }\n /**\n * Return the DOM element.\n * This is the element that will be used to display the node view.\n */\n get dom() {\n var _a;\n if (this.renderer.element.firstElementChild && !((_a = this.renderer.element.firstElementChild) == null ? void 0 : _a.hasAttribute(\"data-node-view-wrapper\"))) {\n throw Error(\"Please use the NodeViewWrapper component for your node view.\");\n }\n return this.renderer.element;\n }\n /**\n * Return the content DOM element.\n * This is the element that will be used to display the rich-text content of the node.\n */\n get contentDOM() {\n if (this.node.isLeaf) {\n return null;\n }\n return this.contentDOMElement;\n }\n /**\n * On editor selection update, check if the node is selected.\n * If it is, call `selectNode`, otherwise call `deselectNode`.\n */\n handleSelectionUpdate() {\n if (this.selectionRafId) {\n cancelAnimationFrame(this.selectionRafId);\n this.selectionRafId = null;\n }\n this.selectionRafId = requestAnimationFrame(() => {\n var _a;\n this.selectionRafId = null;\n const pos = (_a = this.getPos()) != null ? _a : this.currentPos;\n if (typeof pos !== \"number\") {\n return;\n }\n const isSelected = isNodeViewSelected({\n selection: this.editor.state.selection,\n pos,\n nodeSize: this.node.nodeSize,\n selectedOnTextSelection: this.options.selectedOnTextSelection\n });\n if (isSelected) {\n if (this.renderer.props.selected) {\n return;\n }\n this.selectNode();\n } else {\n if (!this.renderer.props.selected) {\n return;\n }\n this.deselectNode();\n }\n });\n }\n /**\n * On update, update the React component.\n * To prevent unnecessary updates, the `update` option can be used.\n */\n update(node, decorations, innerDecorations) {\n const rerenderComponent = (props) => {\n this.renderer.updateProps(props);\n if (typeof this.options.attrs === \"function\") {\n this.updateElementAttributes();\n }\n };\n if (node.type !== this.node.type) {\n return false;\n }\n if (typeof this.options.update === \"function\") {\n const oldNode = this.node;\n const oldDecorations = this.decorations;\n const oldInnerDecorations = this.innerDecorations;\n this.node = node;\n this.decorations = decorations;\n this.innerDecorations = innerDecorations;\n this.currentPos = this.getPos();\n return this.options.update({\n oldNode,\n oldDecorations,\n newNode: node,\n newDecorations: decorations,\n oldInnerDecorations,\n innerDecorations,\n updateProps: () => rerenderComponent({\n node,\n decorations,\n innerDecorations,\n extension: this.extensionWithSyncedStorage\n })\n });\n }\n const nodeChanged = node !== this.node;\n if (!nodeChanged) {\n this.node = node;\n this.decorations = decorations;\n this.innerDecorations = innerDecorations;\n return true;\n }\n const newPos = this.getPos();\n this.node = node;\n this.decorations = decorations;\n this.innerDecorations = innerDecorations;\n this.currentPos = newPos;\n const extraProps = {\n node,\n decorations,\n innerDecorations,\n extension: this.extensionWithSyncedStorage\n };\n if (this.options.trackNodeViewPosition) {\n extraProps.getPos = () => this.getPos();\n }\n rerenderComponent(extraProps);\n return true;\n }\n /**\n * Select the node.\n * Add the `selected` prop and the `ProseMirror-selectednode` class.\n */\n selectNode() {\n this.renderer.updateProps({\n selected: true\n });\n this.renderer.element.classList.add(\"ProseMirror-selectednode\");\n }\n /**\n * Deselect the node.\n * Remove the `selected` prop and the `ProseMirror-selectednode` class.\n */\n deselectNode() {\n this.renderer.updateProps({\n selected: false\n });\n this.renderer.element.classList.remove(\"ProseMirror-selectednode\");\n }\n /**\n * Destroy the React component instance.\n */\n destroy() {\n this.renderer.destroy();\n this.editor.off(\"selectionUpdate\", this.handleSelectionUpdate);\n if (this.options.trackNodeViewPosition) {\n this.editor.off(\"update\", this.handlePositionUpdate);\n }\n this.contentDOMElement = null;\n if (this.selectionRafId) {\n cancelAnimationFrame(this.selectionRafId);\n this.selectionRafId = null;\n }\n }\n /**\n * Update the attributes of the top-level element that holds the React component.\n * Applying the attributes defined in the `attrs` option.\n */\n updateElementAttributes() {\n if (this.options.attrs) {\n let attrsObj = {};\n if (typeof this.options.attrs === \"function\") {\n const extensionAttributes = this.editor.extensionManager.attributes;\n const HTMLAttributes = getRenderedAttributes(this.node, extensionAttributes);\n attrsObj = this.options.attrs({ node: this.node, HTMLAttributes });\n } else {\n attrsObj = this.options.attrs;\n }\n this.renderer.updateAttributes(attrsObj);\n }\n }\n};\nfunction ReactNodeViewRenderer(component, options) {\n return (props) => {\n if (!props.editor.contentComponent) {\n return {};\n }\n return new ReactNodeView(component, props, options);\n };\n}\n\n// src/ReactWidgetRenderer.tsx\nimport { createWidgetDecoration } from \"@tiptap/core\";\nvar WIDGET_CACHE = /* @__PURE__ */ Symbol(\"tiptapReactWidgetCache\");\nfunction ReactWidgetRenderer(component, options) {\n const { editor, props = {}, as = \"span\", className } = options;\n return createWidgetDecoration({\n // Forwards editor, pos, key and the ProseMirror widget options unchanged.\n ...options,\n props,\n cacheKey: WIDGET_CACHE,\n context: (getPos) => ({ editor, getPos }),\n create: (renderProps) => new ReactRenderer(component, {\n editor,\n as,\n className,\n props: renderProps\n }),\n materialize: (renderer) => {\n renderer.render();\n return renderer.element;\n }\n });\n}\n\n// src/Tiptap.tsx\nimport { createContext as createContext3, useContext as useContext3, useMemo as useMemo2 } from \"react\";\nimport { jsx as jsx8 } from \"react/jsx-runtime\";\nvar TiptapContext = createContext3({\n get editor() {\n throw new Error(\"useTiptap must be used within a <Tiptap> provider\");\n }\n});\nTiptapContext.displayName = \"TiptapContext\";\nvar useTiptap = () => useContext3(TiptapContext);\nfunction useTiptapState(selector, equalityFn) {\n const { editor } = useTiptap();\n return useEditorState({\n editor,\n selector,\n equalityFn\n });\n}\nfunction TiptapWrapper({ children, ...props }) {\n const resolvedEditor = \"editor\" in props ? props.editor : props.instance;\n if (!resolvedEditor) {\n throw new Error(\"Tiptap: An editor instance is required. Pass a non-null `editor` prop.\");\n }\n const tiptapContextValue = useMemo2(\n () => ({ editor: resolvedEditor }),\n [resolvedEditor]\n );\n const legacyContextValue = useMemo2(() => ({ editor: resolvedEditor }), [resolvedEditor]);\n return /* @__PURE__ */ jsx8(EditorContext.Provider, { value: legacyContextValue, children: /* @__PURE__ */ jsx8(TiptapContext.Provider, { value: tiptapContextValue, children }) });\n}\nTiptapWrapper.displayName = \"Tiptap\";\nfunction TiptapContent({ ...rest }) {\n const { editor } = useTiptap();\n return /* @__PURE__ */ jsx8(EditorContent, { editor, ...rest });\n}\nTiptapContent.displayName = \"Tiptap.Content\";\nvar Tiptap = Object.assign(TiptapWrapper, {\n /**\n * The Tiptap Content component that renders the EditorContent with the editor instance from the context.\n * @see TiptapContent\n */\n Content: TiptapContent\n});\n\n// src/index.ts\nexport * from \"@tiptap/core\";\nexport {\n EditorConsumer,\n EditorContent,\n EditorContext,\n EditorProvider,\n MarkViewContent,\n NodeViewContent,\n NodeViewWrapper,\n PureEditorContent,\n ReactMarkView,\n ReactMarkViewContext,\n ReactMarkViewRenderer,\n ReactNodeView,\n ReactNodeViewContentProvider,\n ReactNodeViewContext,\n ReactNodeViewRenderer,\n ReactRenderer,\n ReactWidgetRenderer,\n Tiptap,\n TiptapContent,\n TiptapContext,\n TiptapWrapper,\n createContentComponent,\n useCurrentEditor,\n useEditor,\n useEditorState,\n useReactNodeView,\n useTiptap,\n useTiptapState\n};\n//# sourceMappingURL=index.js.map"],"x_google_ignoreList":[0],"mappings":";;;;;;;;;AAUA,IAAI,MAAa,GAAG,OACV,MAAS;CACf,EAAK,SAAS,MAAQ;EACpB,AAAI,OAAO,KAAQ,aACjB,EAAI,CAAI,IACC,MAET,EAAI,UAAU;CAElB,CAAC;AACH,G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|
-
//#region \0rolldown/runtime.js
|
|
2
|
-
var e = (e, t) => () => (t || (e((t = { exports: {} }).exports, t), e = null), t.exports), t = /* @__PURE__ */ ((e) => typeof require < "u" ? require : typeof Proxy < "u" ? new Proxy(e, { get: (e, t) => (typeof require < "u" ? require : e)[t] }) : e)(function(e) {
|
|
3
|
-
if (typeof require < "u") return require.apply(this, arguments);
|
|
4
|
-
throw Error("Calling `require` for \"" + e + "\" in an environment that doesn't expose the `require` function. See https://rolldown.rs/in-depth/bundling-cjs#require-external-modules for more details.");
|
|
5
|
-
});
|
|
6
|
-
//#endregion
|
|
7
|
-
export { e as __commonJSMin, t as __require };
|
|
@@ -1,56 +0,0 @@
|
|
|
1
|
-
import { __commonJSMin as e, __require as t } from "../../../../_virtual/_rolldown/runtime.js";
|
|
2
|
-
import { require_shim as n } from "../../shim/index.js";
|
|
3
|
-
//#region node_modules/use-sync-external-store/cjs/use-sync-external-store-shim/with-selector.development.js
|
|
4
|
-
var r = /* @__PURE__ */ e(((e) => {
|
|
5
|
-
process.env.NODE_ENV !== "production" && (function() {
|
|
6
|
-
function r(e, t) {
|
|
7
|
-
return e === t && (e !== 0 || 1 / e == 1 / t) || e !== e && t !== t;
|
|
8
|
-
}
|
|
9
|
-
typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ < "u" && typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart == "function" && __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(Error());
|
|
10
|
-
var i = t("react"), a = n(), o = typeof Object.is == "function" ? Object.is : r, s = a.useSyncExternalStore, c = i.useRef, l = i.useEffect, u = i.useMemo, d = i.useDebugValue;
|
|
11
|
-
e.useSyncExternalStoreWithSelector = function(e, t, n, r, i) {
|
|
12
|
-
var a = c(null);
|
|
13
|
-
if (a.current === null) {
|
|
14
|
-
var f = {
|
|
15
|
-
hasValue: !1,
|
|
16
|
-
value: null
|
|
17
|
-
};
|
|
18
|
-
a.current = f;
|
|
19
|
-
} else f = a.current;
|
|
20
|
-
a = u(function() {
|
|
21
|
-
function e(e) {
|
|
22
|
-
if (!a) {
|
|
23
|
-
if (a = !0, s = e, e = r(e), i !== void 0 && f.hasValue) {
|
|
24
|
-
var t = f.value;
|
|
25
|
-
if (i(t, e)) return c = t;
|
|
26
|
-
}
|
|
27
|
-
return c = e;
|
|
28
|
-
}
|
|
29
|
-
if (t = c, o(s, e)) return t;
|
|
30
|
-
var n = r(e);
|
|
31
|
-
return i !== void 0 && i(t, n) ? (s = e, t) : (s = e, c = n);
|
|
32
|
-
}
|
|
33
|
-
var a = !1, s, c, l = n === void 0 ? null : n;
|
|
34
|
-
return [function() {
|
|
35
|
-
return e(t());
|
|
36
|
-
}, l === null ? void 0 : function() {
|
|
37
|
-
return e(l());
|
|
38
|
-
}];
|
|
39
|
-
}, [
|
|
40
|
-
t,
|
|
41
|
-
n,
|
|
42
|
-
r,
|
|
43
|
-
i
|
|
44
|
-
]);
|
|
45
|
-
var p = s(e, a[0], a[1]);
|
|
46
|
-
return l(function() {
|
|
47
|
-
f.hasValue = !0, f.value = p;
|
|
48
|
-
}, [p]), d(p), p;
|
|
49
|
-
}, typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ < "u" && typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop == "function" && __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(Error());
|
|
50
|
-
})();
|
|
51
|
-
}));
|
|
52
|
-
//#endregion
|
|
53
|
-
export default r();
|
|
54
|
-
export { r as require_with_selector_development };
|
|
55
|
-
|
|
56
|
-
//# sourceMappingURL=with-selector.development.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"with-selector.development.js","names":[],"sources":["../../../../../node_modules/use-sync-external-store/cjs/use-sync-external-store-shim/with-selector.development.js"],"sourcesContent":["/**\n * @license React\n * use-sync-external-store-shim/with-selector.development.js\n *\n * Copyright (c) Meta Platforms, Inc. and affiliates.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\n\"use strict\";\n\"production\" !== process.env.NODE_ENV &&\n (function () {\n function is(x, y) {\n return (x === y && (0 !== x || 1 / x === 1 / y)) || (x !== x && y !== y);\n }\n \"undefined\" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ &&\n \"function\" ===\n typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart &&\n __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(Error());\n var React = require(\"react\"),\n shim = require(\"use-sync-external-store/shim\"),\n objectIs = \"function\" === typeof Object.is ? Object.is : is,\n useSyncExternalStore = shim.useSyncExternalStore,\n useRef = React.useRef,\n useEffect = React.useEffect,\n useMemo = React.useMemo,\n useDebugValue = React.useDebugValue;\n exports.useSyncExternalStoreWithSelector = function (\n subscribe,\n getSnapshot,\n getServerSnapshot,\n selector,\n isEqual\n ) {\n var instRef = useRef(null);\n if (null === instRef.current) {\n var inst = { hasValue: !1, value: null };\n instRef.current = inst;\n } else inst = instRef.current;\n instRef = useMemo(\n function () {\n function memoizedSelector(nextSnapshot) {\n if (!hasMemo) {\n hasMemo = !0;\n memoizedSnapshot = nextSnapshot;\n nextSnapshot = selector(nextSnapshot);\n if (void 0 !== isEqual && inst.hasValue) {\n var currentSelection = inst.value;\n if (isEqual(currentSelection, nextSnapshot))\n return (memoizedSelection = currentSelection);\n }\n return (memoizedSelection = nextSnapshot);\n }\n currentSelection = memoizedSelection;\n if (objectIs(memoizedSnapshot, nextSnapshot))\n return currentSelection;\n var nextSelection = selector(nextSnapshot);\n if (void 0 !== isEqual && isEqual(currentSelection, nextSelection))\n return (memoizedSnapshot = nextSnapshot), currentSelection;\n memoizedSnapshot = nextSnapshot;\n return (memoizedSelection = nextSelection);\n }\n var hasMemo = !1,\n memoizedSnapshot,\n memoizedSelection,\n maybeGetServerSnapshot =\n void 0 === getServerSnapshot ? null : getServerSnapshot;\n return [\n function () {\n return memoizedSelector(getSnapshot());\n },\n null === maybeGetServerSnapshot\n ? void 0\n : function () {\n return memoizedSelector(maybeGetServerSnapshot());\n }\n ];\n },\n [getSnapshot, getServerSnapshot, selector, isEqual]\n );\n var value = useSyncExternalStore(subscribe, instRef[0], instRef[1]);\n useEffect(\n function () {\n inst.hasValue = !0;\n inst.value = value;\n },\n [value]\n );\n useDebugValue(value);\n return value;\n };\n \"undefined\" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ &&\n \"function\" ===\n typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop &&\n __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(Error());\n })();\n"],"x_google_ignoreList":[0],"mappings":";;;;CAWA,AAAA,QAAA,IAAA,aAAA,iBACG,WAAY;EACX,SAAS,EAAG,GAAG,GAAG;GAChB,OAAQ,MAAM,MAAY,MAAN,KAAW,IAAI,KAAM,IAAI,MAAQ,MAAM,KAAK,MAAM;EACxE;EACA,AAAgB,OAAO,iCAAvB,OAEI,OAAO,+BAA+B,+BADxC,cAEA,+BAA+B,4BAA4B,MAAM,CAAC;EACpE,IAAI,IAAA,EAAgB,OAAO,GACzB,IAAA,EAAA,GACA,IAA0B,OAAO,OAAO,MAA7B,aAAkC,OAAO,KAAK,GACzD,IAAuB,EAAK,sBAC5B,IAAS,EAAM,QACf,IAAY,EAAM,WAClB,IAAU,EAAM,SAChB,IAAgB,EAAM;EAiExB,AAhEA,EAAQ,mCAAmC,SACzC,GACA,GACA,GACA,GACA,GACA;GACA,IAAI,IAAU,EAAO,IAAI;GACzB,IAAa,EAAQ,YAAjB,MAA0B;IAC5B,IAAI,IAAO;KAAE,UAAU,CAAC;KAAG,OAAO;IAAK;IACvC,EAAQ,UAAU;GACpB,OAAO,IAAO,EAAQ;GACtB,IAAU,EACR,WAAY;IACV,SAAS,EAAiB,GAAc;KACtC,IAAI,CAAC,GAAS;MAIZ,IAHA,IAAU,CAAC,GACX,IAAmB,GACnB,IAAe,EAAS,CAAY,GACrB,MAAX,KAAK,KAAiB,EAAK,UAAU;OACvC,IAAI,IAAmB,EAAK;OAC5B,IAAI,EAAQ,GAAkB,CAAY,GACxC,OAAQ,IAAoB;MAChC;MACA,OAAQ,IAAoB;KAC9B;KAEA,IADA,IAAmB,GACf,EAAS,GAAkB,CAAY,GACzC,OAAO;KACT,IAAI,IAAgB,EAAS,CAAY;KAIzC,OAHe,MAAX,KAAK,KAAiB,EAAQ,GAAkB,CAAa,KACvD,IAAmB,GAAe,MAC5C,IAAmB,GACX,IAAoB;IAC9B;IACA,IAAI,IAAU,CAAC,GACb,GACA,GACA,IACa,MAAX,KAAK,IAA0B,OAAO;IAC1C,OAAO,CACL,WAAY;KACV,OAAO,EAAiB,EAAY,CAAC;IACvC,GACS,MAAT,OACI,KAAK,IACL,WAAY;KACV,OAAO,EAAiB,EAAuB,CAAC;IAClD,CACN;GACF,GACA;IAAC;IAAa;IAAmB;IAAU;GAAO,CACpD;GACA,IAAI,IAAQ,EAAqB,GAAW,EAAQ,IAAI,EAAQ,EAAE;GASlE,OARA,EACE,WAAY;IAEV,AADA,EAAK,WAAW,CAAC,GACjB,EAAK,QAAQ;GACf,GACA,CAAC,CAAK,CACR,GACA,EAAc,CAAK,GACZ;EACT,GACgB,OAAO,iCAAvB,OAEI,OAAO,+BAA+B,8BADxC,cAEA,+BAA+B,2BAA2B,MAAM,CAAC;CACrE,EAAA,CAAG"}
|
|
@@ -1,54 +0,0 @@
|
|
|
1
|
-
import { __commonJSMin as e, __require as t } from "../../../../_virtual/_rolldown/runtime.js";
|
|
2
|
-
import { require_shim as n } from "../../shim/index.js";
|
|
3
|
-
//#region node_modules/use-sync-external-store/cjs/use-sync-external-store-shim/with-selector.production.js
|
|
4
|
-
var r = /* @__PURE__ */ e(((e) => {
|
|
5
|
-
var r = t("react"), i = n();
|
|
6
|
-
function a(e, t) {
|
|
7
|
-
return e === t && (e !== 0 || 1 / e == 1 / t) || e !== e && t !== t;
|
|
8
|
-
}
|
|
9
|
-
var o = typeof Object.is == "function" ? Object.is : a, s = i.useSyncExternalStore, c = r.useRef, l = r.useEffect, u = r.useMemo, d = r.useDebugValue;
|
|
10
|
-
e.useSyncExternalStoreWithSelector = function(e, t, n, r, i) {
|
|
11
|
-
var a = c(null);
|
|
12
|
-
if (a.current === null) {
|
|
13
|
-
var f = {
|
|
14
|
-
hasValue: !1,
|
|
15
|
-
value: null
|
|
16
|
-
};
|
|
17
|
-
a.current = f;
|
|
18
|
-
} else f = a.current;
|
|
19
|
-
a = u(function() {
|
|
20
|
-
function e(e) {
|
|
21
|
-
if (!a) {
|
|
22
|
-
if (a = !0, s = e, e = r(e), i !== void 0 && f.hasValue) {
|
|
23
|
-
var t = f.value;
|
|
24
|
-
if (i(t, e)) return c = t;
|
|
25
|
-
}
|
|
26
|
-
return c = e;
|
|
27
|
-
}
|
|
28
|
-
if (t = c, o(s, e)) return t;
|
|
29
|
-
var n = r(e);
|
|
30
|
-
return i !== void 0 && i(t, n) ? (s = e, t) : (s = e, c = n);
|
|
31
|
-
}
|
|
32
|
-
var a = !1, s, c, l = n === void 0 ? null : n;
|
|
33
|
-
return [function() {
|
|
34
|
-
return e(t());
|
|
35
|
-
}, l === null ? void 0 : function() {
|
|
36
|
-
return e(l());
|
|
37
|
-
}];
|
|
38
|
-
}, [
|
|
39
|
-
t,
|
|
40
|
-
n,
|
|
41
|
-
r,
|
|
42
|
-
i
|
|
43
|
-
]);
|
|
44
|
-
var p = s(e, a[0], a[1]);
|
|
45
|
-
return l(function() {
|
|
46
|
-
f.hasValue = !0, f.value = p;
|
|
47
|
-
}, [p]), d(p), p;
|
|
48
|
-
};
|
|
49
|
-
}));
|
|
50
|
-
//#endregion
|
|
51
|
-
export default r();
|
|
52
|
-
export { r as require_with_selector_production };
|
|
53
|
-
|
|
54
|
-
//# sourceMappingURL=with-selector.production.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"with-selector.production.js","names":[],"sources":["../../../../../node_modules/use-sync-external-store/cjs/use-sync-external-store-shim/with-selector.production.js"],"sourcesContent":["/**\n * @license React\n * use-sync-external-store-shim/with-selector.production.js\n *\n * Copyright (c) Meta Platforms, Inc. and affiliates.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\n\"use strict\";\nvar React = require(\"react\"),\n shim = require(\"use-sync-external-store/shim\");\nfunction is(x, y) {\n return (x === y && (0 !== x || 1 / x === 1 / y)) || (x !== x && y !== y);\n}\nvar objectIs = \"function\" === typeof Object.is ? Object.is : is,\n useSyncExternalStore = shim.useSyncExternalStore,\n useRef = React.useRef,\n useEffect = React.useEffect,\n useMemo = React.useMemo,\n useDebugValue = React.useDebugValue;\nexports.useSyncExternalStoreWithSelector = function (\n subscribe,\n getSnapshot,\n getServerSnapshot,\n selector,\n isEqual\n) {\n var instRef = useRef(null);\n if (null === instRef.current) {\n var inst = { hasValue: !1, value: null };\n instRef.current = inst;\n } else inst = instRef.current;\n instRef = useMemo(\n function () {\n function memoizedSelector(nextSnapshot) {\n if (!hasMemo) {\n hasMemo = !0;\n memoizedSnapshot = nextSnapshot;\n nextSnapshot = selector(nextSnapshot);\n if (void 0 !== isEqual && inst.hasValue) {\n var currentSelection = inst.value;\n if (isEqual(currentSelection, nextSnapshot))\n return (memoizedSelection = currentSelection);\n }\n return (memoizedSelection = nextSnapshot);\n }\n currentSelection = memoizedSelection;\n if (objectIs(memoizedSnapshot, nextSnapshot)) return currentSelection;\n var nextSelection = selector(nextSnapshot);\n if (void 0 !== isEqual && isEqual(currentSelection, nextSelection))\n return (memoizedSnapshot = nextSnapshot), currentSelection;\n memoizedSnapshot = nextSnapshot;\n return (memoizedSelection = nextSelection);\n }\n var hasMemo = !1,\n memoizedSnapshot,\n memoizedSelection,\n maybeGetServerSnapshot =\n void 0 === getServerSnapshot ? null : getServerSnapshot;\n return [\n function () {\n return memoizedSelector(getSnapshot());\n },\n null === maybeGetServerSnapshot\n ? void 0\n : function () {\n return memoizedSelector(maybeGetServerSnapshot());\n }\n ];\n },\n [getSnapshot, getServerSnapshot, selector, isEqual]\n );\n var value = useSyncExternalStore(subscribe, instRef[0], instRef[1]);\n useEffect(\n function () {\n inst.hasValue = !0;\n inst.value = value;\n },\n [value]\n );\n useDebugValue(value);\n return value;\n};\n"],"x_google_ignoreList":[0],"mappings":";;;;CAWA,IAAI,IAAA,EAAgB,OAAO,GACzB,IAAA,EAAA;CACF,SAAS,EAAG,GAAG,GAAG;EAChB,OAAQ,MAAM,MAAY,MAAN,KAAW,IAAI,KAAM,IAAI,MAAQ,MAAM,KAAK,MAAM;CACxE;CACA,IAAI,IAA0B,OAAO,OAAO,MAA7B,aAAkC,OAAO,KAAK,GAC3D,IAAuB,EAAK,sBAC5B,IAAS,EAAM,QACf,IAAY,EAAM,WAClB,IAAU,EAAM,SAChB,IAAgB,EAAM;CACxB,EAAQ,mCAAmC,SACzC,GACA,GACA,GACA,GACA,GACA;EACA,IAAI,IAAU,EAAO,IAAI;EACzB,IAAa,EAAQ,YAAjB,MAA0B;GAC5B,IAAI,IAAO;IAAE,UAAU,CAAC;IAAG,OAAO;GAAK;GACvC,EAAQ,UAAU;EACpB,OAAO,IAAO,EAAQ;EACtB,IAAU,EACR,WAAY;GACV,SAAS,EAAiB,GAAc;IACtC,IAAI,CAAC,GAAS;KAIZ,IAHA,IAAU,CAAC,GACX,IAAmB,GACnB,IAAe,EAAS,CAAY,GACrB,MAAX,KAAK,KAAiB,EAAK,UAAU;MACvC,IAAI,IAAmB,EAAK;MAC5B,IAAI,EAAQ,GAAkB,CAAY,GACxC,OAAQ,IAAoB;KAChC;KACA,OAAQ,IAAoB;IAC9B;IAEA,IADA,IAAmB,GACf,EAAS,GAAkB,CAAY,GAAG,OAAO;IACrD,IAAI,IAAgB,EAAS,CAAY;IAIzC,OAHe,MAAX,KAAK,KAAiB,EAAQ,GAAkB,CAAa,KACvD,IAAmB,GAAe,MAC5C,IAAmB,GACX,IAAoB;GAC9B;GACA,IAAI,IAAU,CAAC,GACb,GACA,GACA,IACa,MAAX,KAAK,IAA0B,OAAO;GAC1C,OAAO,CACL,WAAY;IACV,OAAO,EAAiB,EAAY,CAAC;GACvC,GACS,MAAT,OACI,KAAK,IACL,WAAY;IACV,OAAO,EAAiB,EAAuB,CAAC;GAClD,CACN;EACF,GACA;GAAC;GAAa;GAAmB;GAAU;EAAO,CACpD;EACA,IAAI,IAAQ,EAAqB,GAAW,EAAQ,IAAI,EAAQ,EAAE;EASlE,OARA,EACE,WAAY;GAEV,AADA,EAAK,WAAW,CAAC,GACjB,EAAK,QAAQ;EACf,GACA,CAAC,CAAK,CACR,GACA,EAAc,CAAK,GACZ;CACT"}
|
package/dist/node_modules/use-sync-external-store/cjs/use-sync-external-store-shim.development.js
DELETED
|
@@ -1,54 +0,0 @@
|
|
|
1
|
-
import { __commonJSMin as e, __require as t } from "../../../_virtual/_rolldown/runtime.js";
|
|
2
|
-
//#region node_modules/use-sync-external-store/cjs/use-sync-external-store-shim.development.js
|
|
3
|
-
var n = /* @__PURE__ */ e(((e) => {
|
|
4
|
-
process.env.NODE_ENV !== "production" && (function() {
|
|
5
|
-
function n(e, t) {
|
|
6
|
-
return e === t && (e !== 0 || 1 / e == 1 / t) || e !== e && t !== t;
|
|
7
|
-
}
|
|
8
|
-
function r(e, t) {
|
|
9
|
-
f || o.startTransition === void 0 || (f = !0, console.error("You are using an outdated, pre-release alpha of React 18 that does not support useSyncExternalStore. The use-sync-external-store shim will not work correctly. Upgrade to a newer pre-release."));
|
|
10
|
-
var n = t();
|
|
11
|
-
if (!p) {
|
|
12
|
-
var r = t();
|
|
13
|
-
s(n, r) || (console.error("The result of getSnapshot should be cached to avoid an infinite loop"), p = !0);
|
|
14
|
-
}
|
|
15
|
-
r = c({ inst: {
|
|
16
|
-
value: n,
|
|
17
|
-
getSnapshot: t
|
|
18
|
-
} });
|
|
19
|
-
var a = r[0].inst, m = r[1];
|
|
20
|
-
return u(function() {
|
|
21
|
-
a.value = n, a.getSnapshot = t, i(a) && m({ inst: a });
|
|
22
|
-
}, [
|
|
23
|
-
e,
|
|
24
|
-
n,
|
|
25
|
-
t
|
|
26
|
-
]), l(function() {
|
|
27
|
-
return i(a) && m({ inst: a }), e(function() {
|
|
28
|
-
i(a) && m({ inst: a });
|
|
29
|
-
});
|
|
30
|
-
}, [e]), d(n), n;
|
|
31
|
-
}
|
|
32
|
-
function i(e) {
|
|
33
|
-
var t = e.getSnapshot;
|
|
34
|
-
e = e.value;
|
|
35
|
-
try {
|
|
36
|
-
var n = t();
|
|
37
|
-
return !s(e, n);
|
|
38
|
-
} catch {
|
|
39
|
-
return !0;
|
|
40
|
-
}
|
|
41
|
-
}
|
|
42
|
-
function a(e, t) {
|
|
43
|
-
return t();
|
|
44
|
-
}
|
|
45
|
-
typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ < "u" && typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart == "function" && __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(Error());
|
|
46
|
-
var o = t("react"), s = typeof Object.is == "function" ? Object.is : n, c = o.useState, l = o.useEffect, u = o.useLayoutEffect, d = o.useDebugValue, f = !1, p = !1, m = typeof window > "u" || window.document === void 0 || window.document.createElement === void 0 ? a : r;
|
|
47
|
-
e.useSyncExternalStore = o.useSyncExternalStore === void 0 ? m : o.useSyncExternalStore, typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ < "u" && typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop == "function" && __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(Error());
|
|
48
|
-
})();
|
|
49
|
-
}));
|
|
50
|
-
//#endregion
|
|
51
|
-
export default n();
|
|
52
|
-
export { n as require_use_sync_external_store_shim_development };
|
|
53
|
-
|
|
54
|
-
//# sourceMappingURL=use-sync-external-store-shim.development.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"use-sync-external-store-shim.development.js","names":[],"sources":["../../../../node_modules/use-sync-external-store/cjs/use-sync-external-store-shim.development.js"],"sourcesContent":["/**\n * @license React\n * use-sync-external-store-shim.development.js\n *\n * Copyright (c) Meta Platforms, Inc. and affiliates.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\n\"use strict\";\n\"production\" !== process.env.NODE_ENV &&\n (function () {\n function is(x, y) {\n return (x === y && (0 !== x || 1 / x === 1 / y)) || (x !== x && y !== y);\n }\n function useSyncExternalStore$2(subscribe, getSnapshot) {\n didWarnOld18Alpha ||\n void 0 === React.startTransition ||\n ((didWarnOld18Alpha = !0),\n console.error(\n \"You are using an outdated, pre-release alpha of React 18 that does not support useSyncExternalStore. The use-sync-external-store shim will not work correctly. Upgrade to a newer pre-release.\"\n ));\n var value = getSnapshot();\n if (!didWarnUncachedGetSnapshot) {\n var cachedValue = getSnapshot();\n objectIs(value, cachedValue) ||\n (console.error(\n \"The result of getSnapshot should be cached to avoid an infinite loop\"\n ),\n (didWarnUncachedGetSnapshot = !0));\n }\n cachedValue = useState({\n inst: { value: value, getSnapshot: getSnapshot }\n });\n var inst = cachedValue[0].inst,\n forceUpdate = cachedValue[1];\n useLayoutEffect(\n function () {\n inst.value = value;\n inst.getSnapshot = getSnapshot;\n checkIfSnapshotChanged(inst) && forceUpdate({ inst: inst });\n },\n [subscribe, value, getSnapshot]\n );\n useEffect(\n function () {\n checkIfSnapshotChanged(inst) && forceUpdate({ inst: inst });\n return subscribe(function () {\n checkIfSnapshotChanged(inst) && forceUpdate({ inst: inst });\n });\n },\n [subscribe]\n );\n useDebugValue(value);\n return value;\n }\n function checkIfSnapshotChanged(inst) {\n var latestGetSnapshot = inst.getSnapshot;\n inst = inst.value;\n try {\n var nextValue = latestGetSnapshot();\n return !objectIs(inst, nextValue);\n } catch (error) {\n return !0;\n }\n }\n function useSyncExternalStore$1(subscribe, getSnapshot) {\n return getSnapshot();\n }\n \"undefined\" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ &&\n \"function\" ===\n typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart &&\n __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(Error());\n var React = require(\"react\"),\n objectIs = \"function\" === typeof Object.is ? Object.is : is,\n useState = React.useState,\n useEffect = React.useEffect,\n useLayoutEffect = React.useLayoutEffect,\n useDebugValue = React.useDebugValue,\n didWarnOld18Alpha = !1,\n didWarnUncachedGetSnapshot = !1,\n shim =\n \"undefined\" === typeof window ||\n \"undefined\" === typeof window.document ||\n \"undefined\" === typeof window.document.createElement\n ? useSyncExternalStore$1\n : useSyncExternalStore$2;\n exports.useSyncExternalStore =\n void 0 !== React.useSyncExternalStore ? React.useSyncExternalStore : shim;\n \"undefined\" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ &&\n \"function\" ===\n typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop &&\n __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(Error());\n })();\n"],"x_google_ignoreList":[0],"mappings":";;;CAWA,AAAA,QAAA,IAAA,aAAA,iBACG,WAAY;EACX,SAAS,EAAG,GAAG,GAAG;GAChB,OAAQ,MAAM,MAAY,MAAN,KAAW,IAAI,KAAM,IAAI,MAAQ,MAAM,KAAK,MAAM;EACxE;EACA,SAAS,EAAuB,GAAW,GAAa;GACtD,KACa,EAAM,oBAAjB,KAAK,MACH,IAAoB,CAAC,GACvB,QAAQ,MACN,gMACF;GACF,IAAI,IAAQ,EAAY;GACxB,IAAI,CAAC,GAA4B;IAC/B,IAAI,IAAc,EAAY;IAC9B,EAAS,GAAO,CAAW,MACxB,QAAQ,MACP,sEACF,GACC,IAA6B,CAAC;GACnC;GACA,IAAc,EAAS,EACrB,MAAM;IAAS;IAAoB;GAAY,EACjD,CAAC;GACD,IAAI,IAAO,EAAY,EAAE,CAAC,MACxB,IAAc,EAAY;GAmB5B,OAlBA,EACE,WAAY;IAGV,AAFA,EAAK,QAAQ,GACb,EAAK,cAAc,GACnB,EAAuB,CAAI,KAAK,EAAY,EAAQ,QAAK,CAAC;GAC5D,GACA;IAAC;IAAW;IAAO;GAAW,CAChC,GACA,EACE,WAAY;IAEV,OADA,EAAuB,CAAI,KAAK,EAAY,EAAQ,QAAK,CAAC,GACnD,EAAU,WAAY;KAC3B,EAAuB,CAAI,KAAK,EAAY,EAAQ,QAAK,CAAC;IAC5D,CAAC;GACH,GACA,CAAC,CAAS,CACZ,GACA,EAAc,CAAK,GACZ;EACT;EACA,SAAS,EAAuB,GAAM;GACpC,IAAI,IAAoB,EAAK;GAC7B,IAAO,EAAK;GACZ,IAAI;IACF,IAAI,IAAY,EAAkB;IAClC,OAAO,CAAC,EAAS,GAAM,CAAS;GAClC,QAAgB;IACd,OAAO,CAAC;GACV;EACF;EACA,SAAS,EAAuB,GAAW,GAAa;GACtD,OAAO,EAAY;EACrB;EACA,AAAgB,OAAO,iCAAvB,OAEI,OAAO,+BAA+B,+BADxC,cAEA,+BAA+B,4BAA4B,MAAM,CAAC;EACpE,IAAI,IAAA,EAAgB,OAAO,GACzB,IAA0B,OAAO,OAAO,MAA7B,aAAkC,OAAO,KAAK,GACzD,IAAW,EAAM,UACjB,IAAY,EAAM,WAClB,IAAkB,EAAM,iBACxB,IAAgB,EAAM,eACtB,IAAoB,CAAC,GACrB,IAA6B,CAAC,GAC9B,IACkB,OAAO,SAAvB,OACuB,OAAO,aAA9B,UACuB,OAAO,SAAS,kBAAvC,SACI,IACA;EAGR,AAFA,EAAQ,uBACK,EAAM,yBAAjB,KAAK,IAAgE,IAA7B,EAAM,sBAChC,OAAO,iCAAvB,OAEI,OAAO,+BAA+B,8BADxC,cAEA,+BAA+B,2BAA2B,MAAM,CAAC;CACrE,EAAA,CAAG"}
|
package/dist/node_modules/use-sync-external-store/cjs/use-sync-external-store-shim.production.js
DELETED
|
@@ -1,46 +0,0 @@
|
|
|
1
|
-
import { __commonJSMin as e, __require as t } from "../../../_virtual/_rolldown/runtime.js";
|
|
2
|
-
//#region node_modules/use-sync-external-store/cjs/use-sync-external-store-shim.production.js
|
|
3
|
-
var n = /* @__PURE__ */ e(((e) => {
|
|
4
|
-
var n = t("react");
|
|
5
|
-
function r(e, t) {
|
|
6
|
-
return e === t && (e !== 0 || 1 / e == 1 / t) || e !== e && t !== t;
|
|
7
|
-
}
|
|
8
|
-
var i = typeof Object.is == "function" ? Object.is : r, a = n.useState, o = n.useEffect, s = n.useLayoutEffect, c = n.useDebugValue;
|
|
9
|
-
function l(e, t) {
|
|
10
|
-
var n = t(), r = a({ inst: {
|
|
11
|
-
value: n,
|
|
12
|
-
getSnapshot: t
|
|
13
|
-
} }), i = r[0].inst, l = r[1];
|
|
14
|
-
return s(function() {
|
|
15
|
-
i.value = n, i.getSnapshot = t, u(i) && l({ inst: i });
|
|
16
|
-
}, [
|
|
17
|
-
e,
|
|
18
|
-
n,
|
|
19
|
-
t
|
|
20
|
-
]), o(function() {
|
|
21
|
-
return u(i) && l({ inst: i }), e(function() {
|
|
22
|
-
u(i) && l({ inst: i });
|
|
23
|
-
});
|
|
24
|
-
}, [e]), c(n), n;
|
|
25
|
-
}
|
|
26
|
-
function u(e) {
|
|
27
|
-
var t = e.getSnapshot;
|
|
28
|
-
e = e.value;
|
|
29
|
-
try {
|
|
30
|
-
var n = t();
|
|
31
|
-
return !i(e, n);
|
|
32
|
-
} catch {
|
|
33
|
-
return !0;
|
|
34
|
-
}
|
|
35
|
-
}
|
|
36
|
-
function d(e, t) {
|
|
37
|
-
return t();
|
|
38
|
-
}
|
|
39
|
-
var f = typeof window > "u" || window.document === void 0 || window.document.createElement === void 0 ? d : l;
|
|
40
|
-
e.useSyncExternalStore = n.useSyncExternalStore === void 0 ? f : n.useSyncExternalStore;
|
|
41
|
-
}));
|
|
42
|
-
//#endregion
|
|
43
|
-
export default n();
|
|
44
|
-
export { n as require_use_sync_external_store_shim_production };
|
|
45
|
-
|
|
46
|
-
//# sourceMappingURL=use-sync-external-store-shim.production.js.map
|
package/dist/node_modules/use-sync-external-store/cjs/use-sync-external-store-shim.production.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"use-sync-external-store-shim.production.js","names":[],"sources":["../../../../node_modules/use-sync-external-store/cjs/use-sync-external-store-shim.production.js"],"sourcesContent":["/**\n * @license React\n * use-sync-external-store-shim.production.js\n *\n * Copyright (c) Meta Platforms, Inc. and affiliates.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\n\"use strict\";\nvar React = require(\"react\");\nfunction is(x, y) {\n return (x === y && (0 !== x || 1 / x === 1 / y)) || (x !== x && y !== y);\n}\nvar objectIs = \"function\" === typeof Object.is ? Object.is : is,\n useState = React.useState,\n useEffect = React.useEffect,\n useLayoutEffect = React.useLayoutEffect,\n useDebugValue = React.useDebugValue;\nfunction useSyncExternalStore$2(subscribe, getSnapshot) {\n var value = getSnapshot(),\n _useState = useState({ inst: { value: value, getSnapshot: getSnapshot } }),\n inst = _useState[0].inst,\n forceUpdate = _useState[1];\n useLayoutEffect(\n function () {\n inst.value = value;\n inst.getSnapshot = getSnapshot;\n checkIfSnapshotChanged(inst) && forceUpdate({ inst: inst });\n },\n [subscribe, value, getSnapshot]\n );\n useEffect(\n function () {\n checkIfSnapshotChanged(inst) && forceUpdate({ inst: inst });\n return subscribe(function () {\n checkIfSnapshotChanged(inst) && forceUpdate({ inst: inst });\n });\n },\n [subscribe]\n );\n useDebugValue(value);\n return value;\n}\nfunction checkIfSnapshotChanged(inst) {\n var latestGetSnapshot = inst.getSnapshot;\n inst = inst.value;\n try {\n var nextValue = latestGetSnapshot();\n return !objectIs(inst, nextValue);\n } catch (error) {\n return !0;\n }\n}\nfunction useSyncExternalStore$1(subscribe, getSnapshot) {\n return getSnapshot();\n}\nvar shim =\n \"undefined\" === typeof window ||\n \"undefined\" === typeof window.document ||\n \"undefined\" === typeof window.document.createElement\n ? useSyncExternalStore$1\n : useSyncExternalStore$2;\nexports.useSyncExternalStore =\n void 0 !== React.useSyncExternalStore ? React.useSyncExternalStore : shim;\n"],"x_google_ignoreList":[0],"mappings":";;;CAWA,IAAI,IAAA,EAAgB,OAAO;CAC3B,SAAS,EAAG,GAAG,GAAG;EAChB,OAAQ,MAAM,MAAY,MAAN,KAAW,IAAI,KAAM,IAAI,MAAQ,MAAM,KAAK,MAAM;CACxE;CACA,IAAI,IAA0B,OAAO,OAAO,MAA7B,aAAkC,OAAO,KAAK,GAC3D,IAAW,EAAM,UACjB,IAAY,EAAM,WAClB,IAAkB,EAAM,iBACxB,IAAgB,EAAM;CACxB,SAAS,EAAuB,GAAW,GAAa;EACtD,IAAI,IAAQ,EAAY,GACtB,IAAY,EAAS,EAAE,MAAM;GAAS;GAAoB;EAAY,EAAE,CAAC,GACzE,IAAO,EAAU,EAAE,CAAC,MACpB,IAAc,EAAU;EAmB1B,OAlBA,EACE,WAAY;GAGV,AAFA,EAAK,QAAQ,GACb,EAAK,cAAc,GACnB,EAAuB,CAAI,KAAK,EAAY,EAAQ,QAAK,CAAC;EAC5D,GACA;GAAC;GAAW;GAAO;EAAW,CAChC,GACA,EACE,WAAY;GAEV,OADA,EAAuB,CAAI,KAAK,EAAY,EAAQ,QAAK,CAAC,GACnD,EAAU,WAAY;IAC3B,EAAuB,CAAI,KAAK,EAAY,EAAQ,QAAK,CAAC;GAC5D,CAAC;EACH,GACA,CAAC,CAAS,CACZ,GACA,EAAc,CAAK,GACZ;CACT;CACA,SAAS,EAAuB,GAAM;EACpC,IAAI,IAAoB,EAAK;EAC7B,IAAO,EAAK;EACZ,IAAI;GACF,IAAI,IAAY,EAAkB;GAClC,OAAO,CAAC,EAAS,GAAM,CAAS;EAClC,QAAgB;GACd,OAAO,CAAC;EACV;CACF;CACA,SAAS,EAAuB,GAAW,GAAa;EACtD,OAAO,EAAY;CACrB;CACA,IAAI,IACc,OAAO,SAAvB,OACuB,OAAO,aAA9B,UACuB,OAAO,SAAS,kBAAvC,SACI,IACA;CACN,EAAQ,uBACK,EAAM,yBAAjB,KAAK,IAAgE,IAA7B,EAAM"}
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import { __commonJSMin as e } from "../../../_virtual/_rolldown/runtime.js";
|
|
2
|
-
import { require_use_sync_external_store_shim_production as t } from "../cjs/use-sync-external-store-shim.production.js";
|
|
3
|
-
import { require_use_sync_external_store_shim_development as n } from "../cjs/use-sync-external-store-shim.development.js";
|
|
4
|
-
//#region node_modules/use-sync-external-store/shim/index.js
|
|
5
|
-
var r = /* @__PURE__ */ e(((e, r) => {
|
|
6
|
-
r.exports = process.env.NODE_ENV === "production" ? t() : n();
|
|
7
|
-
}));
|
|
8
|
-
//#endregion
|
|
9
|
-
export default r();
|
|
10
|
-
export { r as require_shim };
|
|
11
|
-
|
|
12
|
-
//# sourceMappingURL=index.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":[],"sources":["../../../../node_modules/use-sync-external-store/shim/index.js"],"sourcesContent":["'use strict';\n\nif (process.env.NODE_ENV === 'production') {\n module.exports = require('../cjs/use-sync-external-store-shim.production.js');\n} else {\n module.exports = require('../cjs/use-sync-external-store-shim.development.js');\n}\n"],"x_google_ignoreList":[0],"mappings":";;;;;CAEA,AAGE,EAAO,UAHT,QAAA,IAAA,aAA6B,eACpB,EAAA,IAEA,EAAA"}
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import { __commonJSMin as e } from "../../../_virtual/_rolldown/runtime.js";
|
|
2
|
-
import { require_with_selector_production as t } from "../cjs/use-sync-external-store-shim/with-selector.production.js";
|
|
3
|
-
import { require_with_selector_development as n } from "../cjs/use-sync-external-store-shim/with-selector.development.js";
|
|
4
|
-
//#region node_modules/use-sync-external-store/shim/with-selector.js
|
|
5
|
-
var r = /* @__PURE__ */ e(((e, r) => {
|
|
6
|
-
r.exports = process.env.NODE_ENV === "production" ? t() : n();
|
|
7
|
-
}));
|
|
8
|
-
//#endregion
|
|
9
|
-
export default r();
|
|
10
|
-
export { r as require_with_selector };
|
|
11
|
-
|
|
12
|
-
//# sourceMappingURL=with-selector.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"with-selector.js","names":[],"sources":["../../../../node_modules/use-sync-external-store/shim/with-selector.js"],"sourcesContent":["'use strict';\n\nif (process.env.NODE_ENV === 'production') {\n module.exports = require('../cjs/use-sync-external-store-shim/with-selector.production.js');\n} else {\n module.exports = require('../cjs/use-sync-external-store-shim/with-selector.development.js');\n}\n"],"x_google_ignoreList":[0],"mappings":";;;;;CAEA,AAGE,EAAO,UAHT,QAAA,IAAA,aAA6B,eACpB,EAAA,IAEA,EAAA"}
|