@milkdown/plugin-tooltip 7.1.1 → 7.1.2-next.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/lib/index.es.js CHANGED
@@ -1,6 +1,6 @@
1
- var R = Object.defineProperty;
2
- var S = (o, t, e) => t in o ? R(o, t, { enumerable: !0, configurable: !0, writable: !0, value: e }) : o[t] = e;
3
- var c = (o, t, e) => (S(o, typeof t != "symbol" ? t + "" : t, e), e), x = (o, t, e) => {
1
+ var S = Object.defineProperty;
2
+ var b = (o, t, e) => t in o ? S(o, t, { enumerable: !0, configurable: !0, writable: !0, value: e }) : o[t] = e;
3
+ var c = (o, t, e) => (b(o, typeof t != "symbol" ? t + "" : t, e), e), x = (o, t, e) => {
4
4
  if (!t.has(o))
5
5
  throw TypeError("Cannot " + e);
6
6
  };
@@ -8,41 +8,41 @@ var n = (o, t, e) => (x(o, t, "read from private field"), e ? e.call(o) : t.get(
8
8
  if (t.has(o))
9
9
  throw TypeError("Cannot add the same private member more than once");
10
10
  t instanceof WeakSet ? t.add(o) : t.set(o, e);
11
- }, p = (o, t, e, s) => (x(o, t, "write to private field"), s ? s.call(o, e) : t.set(o, e), e);
12
- var $ = (o, t, e) => (x(o, t, "access private method"), e);
13
- import { posToDOMRect as _ } from "@milkdown/prose";
14
- import { TextSelection as w, Plugin as C, PluginKey as E } from "@milkdown/prose/state";
11
+ }, h = (o, t, e, s) => (x(o, t, "write to private field"), s ? s.call(o, e) : t.set(o, e), e);
12
+ var O = (o, t, e) => (x(o, t, "access private method"), e);
13
+ import { posToDOMRect as C } from "@milkdown/prose";
14
+ import { TextSelection as R, Plugin as _, PluginKey as E } from "@milkdown/prose/state";
15
15
  import F from "lodash.debounce";
16
16
  import I from "tippy.js";
17
17
  import { $ctx as M, $prose as q } from "@milkdown/utils";
18
- var i, m, u, a, y, f, b;
19
- class j {
18
+ var i, a, m, u, y, g, w;
19
+ class U {
20
20
  constructor(t) {
21
- r(this, f);
21
+ r(this, g);
22
22
  r(this, i, void 0);
23
+ r(this, a, void 0);
23
24
  r(this, m, void 0);
24
25
  r(this, u, void 0);
25
- r(this, a, void 0);
26
26
  c(this, "element");
27
27
  r(this, y, (t, e) => {
28
- const { state: s, composing: l } = t, { selection: h, doc: g } = s, { ranges: d } = h, T = Math.min(...d.map((k) => k.$from.pos)), P = Math.max(...d.map((k) => k.$to.pos)), O = e && e.doc.eq(g) && e.selection.eq(h);
29
- if (n(this, i) ?? p(this, i, I(t.dom, {
28
+ const { state: s, composing: l } = t, { selection: p, doc: f } = s, { ranges: d } = p, k = Math.min(...d.map(($) => $.$from.pos)), P = Math.max(...d.map(($) => $.$to.pos)), T = e && e.doc.eq(f) && e.selection.eq(p);
29
+ if (n(this, i) ?? h(this, i, I(t.dom, {
30
30
  trigger: "manual",
31
31
  interactive: !0,
32
- ...n(this, m),
32
+ ...n(this, a),
33
33
  content: this.element
34
- })), !(l || O)) {
35
- if (!n(this, a).call(this, t, e)) {
34
+ })), !(l || T)) {
35
+ if (!n(this, u).call(this, t, e)) {
36
36
  this.hide();
37
37
  return;
38
38
  }
39
39
  n(this, i).setProps({
40
- getReferenceClientRect: () => _(t, T, P)
40
+ getReferenceClientRect: () => C(t, k, P)
41
41
  }), this.show();
42
42
  }
43
43
  });
44
44
  c(this, "update", (t, e) => {
45
- F(n(this, y), n(this, u))(t, e);
45
+ F(n(this, y), n(this, m))(t, e);
46
46
  });
47
47
  c(this, "destroy", () => {
48
48
  var t;
@@ -57,25 +57,31 @@ class j {
57
57
  (t = n(this, i)) == null || t.hide();
58
58
  });
59
59
  c(this, "getInstance", () => n(this, i));
60
- this.element = t.content, p(this, m, t.tippyOptions ?? {}), p(this, u, t.debounce ?? 200), p(this, a, t.shouldShow ?? $(this, f, b));
60
+ this.element = t.content, h(this, a, t.tippyOptions ?? {}), h(this, m, t.debounce ?? 200), h(this, u, t.shouldShow ?? O(this, g, w));
61
61
  }
62
62
  }
63
- i = new WeakMap(), m = new WeakMap(), u = new WeakMap(), a = new WeakMap(), y = new WeakMap(), f = new WeakSet(), b = function(t) {
64
- const { doc: e, selection: s } = t.state, { empty: l, from: h, to: g } = s, d = !e.textBetween(h, g).length && t.state.selection instanceof w, T = this.element.contains(document.activeElement), P = !t.hasFocus() && !T, O = !t.editable;
65
- return !(P || l || d || O);
63
+ i = new WeakMap(), a = new WeakMap(), m = new WeakMap(), u = new WeakMap(), y = new WeakMap(), g = new WeakSet(), w = function(t) {
64
+ const { doc: e, selection: s } = t.state, { empty: l, from: p, to: f } = s, d = !e.textBetween(p, f).length && t.state.selection instanceof R, k = this.element.contains(document.activeElement), P = !t.hasFocus() && !k, T = !t.editable;
65
+ return !(P || l || d || T);
66
66
  };
67
- const z = (o) => {
67
+ const j = (o) => {
68
68
  const t = M({}, `${o}_TOOLTIP_SPEC`), e = q((l) => {
69
- const h = l.get(t.key);
70
- return new C({
69
+ const p = l.get(t.key);
70
+ return new _({
71
71
  key: new E(`${o}_TOOLTIP`),
72
- ...h
72
+ ...p
73
73
  });
74
74
  }), s = [t, e];
75
- return s.key = t.key, s.pluginKey = e.key, s;
75
+ return s.key = t.key, s.pluginKey = e.key, t.meta = {
76
+ package: "@milkdown/plugin-tooltip",
77
+ displayName: `Ctx<tooltipSpec>|${o}`
78
+ }, e.meta = {
79
+ package: "@milkdown/plugin-tooltip",
80
+ displayName: `Prose<tooltip>|${o}`
81
+ }, s;
76
82
  };
77
83
  export {
78
- j as TooltipProvider,
79
- z as tooltipFactory
84
+ U as TooltipProvider,
85
+ j as tooltipFactory
80
86
  };
81
87
  //# sourceMappingURL=index.es.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.es.js","sources":["../src/tooltip-provider.ts","../src/tooltip-plugin.ts"],"sourcesContent":["/* Copyright 2021, Milkdown by Mirone. */\nimport { posToDOMRect } from '@milkdown/prose'\nimport type { EditorState } from '@milkdown/prose/state'\nimport { TextSelection } from '@milkdown/prose/state'\nimport type { EditorView } from '@milkdown/prose/view'\nimport debounce from 'lodash.debounce'\nimport type { Instance, Props } from 'tippy.js'\nimport tippy from 'tippy.js'\n\n/// Options for tooltip provider.\nexport type TooltipProviderOptions = {\n /// The tooltip content.\n content: HTMLElement\n /// The options for creating [tippy.js](https://atomiks.github.io/tippyjs/) instance.\n tippyOptions?: Partial<Props>\n /// The debounce time for updating tooltip, 200ms by default.\n debounce?: number\n /// The function to determine whether the tooltip should be shown.\n shouldShow?: (view: EditorView, prevState?: EditorState) => boolean\n}\n\n/// A provider for creating tooltip.\nexport class TooltipProvider {\n /// @internal\n #tippy: Instance | undefined\n\n /// @internal\n #tippyOptions: Partial<Props>\n\n /// @internal\n #debounce: number\n\n /// @internal\n #shouldShow: (view: EditorView, prevState?: EditorState) => boolean\n\n /// The root element of the tooltip.\n element: HTMLElement\n\n constructor(options: TooltipProviderOptions) {\n this.element = options.content\n this.#tippyOptions = options.tippyOptions ?? {}\n this.#debounce = options.debounce ?? 200\n this.#shouldShow = options.shouldShow ?? this.#_shouldShow\n }\n\n /// @internal\n #onUpdate = (view: EditorView, prevState?: EditorState): void => {\n const { state, composing } = view\n const { selection, doc } = state\n const { ranges } = selection\n const from = Math.min(...ranges.map(range => range.$from.pos))\n const to = Math.max(...ranges.map(range => range.$to.pos))\n const isSame = prevState && prevState.doc.eq(doc) && prevState.selection.eq(selection)\n\n this.#tippy ??= tippy(view.dom, {\n trigger: 'manual',\n interactive: true,\n ...this.#tippyOptions,\n content: this.element,\n })\n\n if (composing || isSame)\n return\n\n if (!this.#shouldShow(view, prevState)) {\n this.hide()\n return\n }\n\n this.#tippy.setProps({\n getReferenceClientRect: () => posToDOMRect(view, from, to),\n })\n\n this.show()\n }\n\n /// Update provider state by editor view.\n update = (view: EditorView, prevState?: EditorState): void => {\n const updater = debounce(this.#onUpdate, this.#debounce)\n\n updater(view, prevState)\n }\n\n /// @internal\n #_shouldShow(view: EditorView): boolean {\n const { doc, selection } = view.state\n const { empty, from, to } = selection\n\n const isEmptyTextBlock = !doc.textBetween(from, to).length && view.state.selection instanceof TextSelection\n\n const isTooltipChildren = this.element.contains(document.activeElement)\n\n const notHasFocus = !view.hasFocus() && !isTooltipChildren\n\n const isReadonly = !view.editable\n\n if (\n notHasFocus\n || empty\n || isEmptyTextBlock\n || isReadonly\n )\n return false\n\n return true\n }\n\n /// Destroy the tooltip.\n destroy = () => {\n this.#tippy?.destroy()\n }\n\n /// Show the tooltip.\n show = () => {\n this.#tippy?.show()\n }\n\n /// Hide the tooltip.\n hide = () => {\n this.#tippy?.hide()\n }\n\n /// Get the [tippy.js](https://atomiks.github.io/tippyjs/) instance.\n getInstance = () => {\n return this.#tippy\n }\n}\n","/* Copyright 2021, Milkdown by Mirone. */\nimport type { SliceType } from '@milkdown/ctx'\nimport type { PluginSpec } from '@milkdown/prose/state'\nimport { Plugin, PluginKey } from '@milkdown/prose/state'\nimport type { $Ctx, $Prose } from '@milkdown/utils'\nimport { $ctx, $prose } from '@milkdown/utils'\n\n/// @internal\nexport type TooltipSpecId<Id extends string> = `${Id}_TOOLTIP_SPEC`\n\n/// @internal\nexport type TooltipPlugin<Id extends string, State = any> = [$Ctx<PluginSpec<State>, TooltipSpecId<Id>>, $Prose] & {\n key: SliceType<PluginSpec<State>, TooltipSpecId<Id>>\n pluginKey: $Prose['key']\n}\n\n/// Create a tooltip plugin with a unique id.\nexport const tooltipFactory = <Id extends string, State = any>(id: Id) => {\n const tooltipSpec = $ctx<PluginSpec<State>, TooltipSpecId<Id>>({}, `${id}_TOOLTIP_SPEC`)\n const tooltipPlugin = $prose((ctx) => {\n const spec = ctx.get(tooltipSpec.key)\n return new Plugin({\n key: new PluginKey(`${id}_TOOLTIP`),\n ...spec,\n })\n })\n const result = [tooltipSpec, tooltipPlugin] as TooltipPlugin<Id>\n result.key = tooltipSpec.key\n result.pluginKey = tooltipPlugin.key\n\n return result\n}\n"],"names":["TooltipProvider","options","__privateAdd","__shouldShow","_tippy","_tippyOptions","_debounce","_shouldShow","__publicField","_onUpdate","view","prevState","state","composing","selection","doc","ranges","from","range","to","isSame","__privateGet","__privateSet","tippy","posToDOMRect","debounce","_a","__privateMethod","_shouldShow_fn","empty","isEmptyTextBlock","TextSelection","isTooltipChildren","notHasFocus","isReadonly","tooltipFactory","id","tooltipSpec","$ctx","tooltipPlugin","$prose","ctx","spec","Plugin","PluginKey","result"],"mappings":";;;;;;;;;;;;;;;;;;AAsBO,MAAMA,EAAgB;AAAA,EAgB3B,YAAYC,GAAiC;AA8C7C,IAAAC,EAAA,MAAAC;AA5DA,IAAAD,EAAA,MAAAE,GAAA;AAGA,IAAAF,EAAA,MAAAG,GAAA;AAGA,IAAAH,EAAA,MAAAI,GAAA;AAGA,IAAAJ,EAAA,MAAAK,GAAA;AAGA,IAAAC,EAAA;AAUA,IAAAN,EAAA,MAAAO,GAAY,CAACC,GAAkBC,MAAkC;AACzD,YAAA,EAAE,OAAAC,GAAO,WAAAC,EAAc,IAAAH,GACvB,EAAE,WAAAI,GAAW,KAAAC,EAAQ,IAAAH,GACrB,EAAE,QAAAI,EAAW,IAAAF,GACbG,IAAO,KAAK,IAAI,GAAGD,EAAO,IAAI,CAASE,MAAAA,EAAM,MAAM,GAAG,CAAC,GACvDC,IAAK,KAAK,IAAI,GAAGH,EAAO,IAAI,CAASE,MAAAA,EAAM,IAAI,GAAG,CAAC,GACnDE,IAAST,KAAaA,EAAU,IAAI,GAAGI,CAAG,KAAKJ,EAAU,UAAU,GAAGG,CAAS;AASrF,UAPKO,EAAA,MAAAjB,MAAAkB,EAAA,MAAAlB,GAAWmB,EAAMb,EAAK,KAAK;AAAA,QAC9B,SAAS;AAAA,QACT,aAAa;AAAA,QACb,GAAGW,EAAA,MAAKhB;AAAA,QACR,SAAS,KAAK;AAAA,MAAA,CACf,IAEG,EAAAQ,KAAaO,IAGjB;AAAA,YAAI,CAACC,EAAA,MAAKd,GAAL,WAAiBG,GAAMC,IAAY;AACtC,eAAK,KAAK;AACV;AAAA,QACF;AAEA,QAAAU,EAAA,MAAKjB,GAAO,SAA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,CAACxB,EAAK;AAGvB,SAAA,EAAAuB,KACGJ,KACAC,KACAI;AAKP;ACxFW,MAAAC,IAAiB,CAAiCC,MAAW;AACxE,QAAMC,IAAcC,EAA2C,CAAC,GAAG,GAAGF,gBAAiB,GACjFG,IAAgBC,EAAO,CAACC,MAAQ;AACpC,UAAMC,IAAOD,EAAI,IAAIJ,EAAY,GAAG;AACpC,WAAO,IAAIM,EAAO;AAAA,MAChB,KAAK,IAAIC,EAAU,GAAGR,WAAY;AAAA,MAClC,GAAGM;AAAA,IAAA,CACJ;AAAA,EAAA,CACF,GACKG,IAAS,CAACR,GAAaE,CAAa;AAC1C,SAAAM,EAAO,MAAMR,EAAY,KACzBQ,EAAO,YAAYN,EAAc,KAE1BM;AACT;"}
1
+ {"version":3,"file":"index.es.js","sources":["../src/tooltip-provider.ts","../src/tooltip-plugin.ts"],"sourcesContent":["/* Copyright 2021, Milkdown by Mirone. */\nimport { posToDOMRect } from '@milkdown/prose'\nimport type { EditorState } from '@milkdown/prose/state'\nimport { TextSelection } from '@milkdown/prose/state'\nimport type { EditorView } from '@milkdown/prose/view'\nimport debounce from 'lodash.debounce'\nimport type { Instance, Props } from 'tippy.js'\nimport tippy from 'tippy.js'\n\n/// Options for tooltip provider.\nexport type TooltipProviderOptions = {\n /// The tooltip content.\n content: HTMLElement\n /// The options for creating [tippy.js](https://atomiks.github.io/tippyjs/) instance.\n tippyOptions?: Partial<Props>\n /// The debounce time for updating tooltip, 200ms by default.\n debounce?: number\n /// The function to determine whether the tooltip should be shown.\n shouldShow?: (view: EditorView, prevState?: EditorState) => boolean\n}\n\n/// A provider for creating tooltip.\nexport class TooltipProvider {\n /// @internal\n #tippy: Instance | undefined\n\n /// @internal\n #tippyOptions: Partial<Props>\n\n /// @internal\n #debounce: number\n\n /// @internal\n #shouldShow: (view: EditorView, prevState?: EditorState) => boolean\n\n /// The root element of the tooltip.\n element: HTMLElement\n\n constructor(options: TooltipProviderOptions) {\n this.element = options.content\n this.#tippyOptions = options.tippyOptions ?? {}\n this.#debounce = options.debounce ?? 200\n this.#shouldShow = options.shouldShow ?? this.#_shouldShow\n }\n\n /// @internal\n #onUpdate = (view: EditorView, prevState?: EditorState): void => {\n const { state, composing } = view\n const { selection, doc } = state\n const { ranges } = selection\n const from = Math.min(...ranges.map(range => range.$from.pos))\n const to = Math.max(...ranges.map(range => range.$to.pos))\n const isSame = prevState && prevState.doc.eq(doc) && prevState.selection.eq(selection)\n\n this.#tippy ??= tippy(view.dom, {\n trigger: 'manual',\n interactive: true,\n ...this.#tippyOptions,\n content: this.element,\n })\n\n if (composing || isSame)\n return\n\n if (!this.#shouldShow(view, prevState)) {\n this.hide()\n return\n }\n\n this.#tippy.setProps({\n getReferenceClientRect: () => posToDOMRect(view, from, to),\n })\n\n this.show()\n }\n\n /// Update provider state by editor view.\n update = (view: EditorView, prevState?: EditorState): void => {\n const updater = debounce(this.#onUpdate, this.#debounce)\n\n updater(view, prevState)\n }\n\n /// @internal\n #_shouldShow(view: EditorView): boolean {\n const { doc, selection } = view.state\n const { empty, from, to } = selection\n\n const isEmptyTextBlock = !doc.textBetween(from, to).length && view.state.selection instanceof TextSelection\n\n const isTooltipChildren = this.element.contains(document.activeElement)\n\n const notHasFocus = !view.hasFocus() && !isTooltipChildren\n\n const isReadonly = !view.editable\n\n if (\n notHasFocus\n || empty\n || isEmptyTextBlock\n || isReadonly\n )\n return false\n\n return true\n }\n\n /// Destroy the tooltip.\n destroy = () => {\n this.#tippy?.destroy()\n }\n\n /// Show the tooltip.\n show = () => {\n this.#tippy?.show()\n }\n\n /// Hide the tooltip.\n hide = () => {\n this.#tippy?.hide()\n }\n\n /// Get the [tippy.js](https://atomiks.github.io/tippyjs/) instance.\n getInstance = () => {\n return this.#tippy\n }\n}\n","/* Copyright 2021, Milkdown by Mirone. */\nimport type { SliceType } from '@milkdown/ctx'\nimport type { PluginSpec } from '@milkdown/prose/state'\nimport { Plugin, PluginKey } from '@milkdown/prose/state'\nimport type { $Ctx, $Prose } from '@milkdown/utils'\nimport { $ctx, $prose } from '@milkdown/utils'\n\n/// @internal\nexport type TooltipSpecId<Id extends string> = `${Id}_TOOLTIP_SPEC`\n\n/// @internal\nexport type TooltipPlugin<Id extends string, State = any> = [$Ctx<PluginSpec<State>, TooltipSpecId<Id>>, $Prose] & {\n key: SliceType<PluginSpec<State>, TooltipSpecId<Id>>\n pluginKey: $Prose['key']\n}\n\n/// Create a tooltip plugin with a unique id.\nexport const tooltipFactory = <Id extends string, State = any>(id: Id) => {\n const tooltipSpec = $ctx<PluginSpec<State>, TooltipSpecId<Id>>({}, `${id}_TOOLTIP_SPEC`)\n const tooltipPlugin = $prose((ctx) => {\n const spec = ctx.get(tooltipSpec.key)\n return new Plugin({\n key: new PluginKey(`${id}_TOOLTIP`),\n ...spec,\n })\n })\n const result = [tooltipSpec, tooltipPlugin] as TooltipPlugin<Id>\n result.key = tooltipSpec.key\n result.pluginKey = tooltipPlugin.key\n tooltipSpec.meta = {\n package: '@milkdown/plugin-tooltip',\n displayName: `Ctx<tooltipSpec>|${id}`,\n }\n tooltipPlugin.meta = {\n package: '@milkdown/plugin-tooltip',\n displayName: `Prose<tooltip>|${id}`,\n }\n\n return result\n}\n"],"names":["TooltipProvider","options","__privateAdd","__shouldShow","_tippy","_tippyOptions","_debounce","_shouldShow","__publicField","_onUpdate","view","prevState","state","composing","selection","doc","ranges","from","range","to","isSame","__privateGet","__privateSet","tippy","posToDOMRect","debounce","_a","__privateMethod","_shouldShow_fn","empty","isEmptyTextBlock","TextSelection","isTooltipChildren","notHasFocus","isReadonly","tooltipFactory","id","tooltipSpec","$ctx","tooltipPlugin","$prose","ctx","spec","Plugin","PluginKey","result"],"mappings":";;;;;;;;;;;;;;;;;;AAsBO,MAAMA,EAAgB;AAAA,EAgB3B,YAAYC,GAAiC;AA8C7C,IAAAC,EAAA,MAAAC;AA5DA,IAAAD,EAAA,MAAAE,GAAA;AAGA,IAAAF,EAAA,MAAAG,GAAA;AAGA,IAAAH,EAAA,M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C,SAAAM,EAAO,MAAMR,EAAY,KACzBQ,EAAO,YAAYN,EAAc,KACjCF,EAAY,OAAO;AAAA,IACjB,SAAS;AAAA,IACT,aAAa,oBAAoBD;AAAA,EAAA,GAEnCG,EAAc,OAAO;AAAA,IACnB,SAAS;AAAA,IACT,aAAa,kBAAkBH;AAAA,EAAA,GAG1BS;AACT;"}
@@ -1 +1 @@
1
- {"version":3,"file":"tooltip-plugin.d.ts","sourceRoot":"","sources":["../src/tooltip-plugin.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,eAAe,CAAA;AAC9C,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,uBAAuB,CAAA;AAEvD,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,EAAE,MAAM,iBAAiB,CAAA;AAInD,MAAM,MAAM,aAAa,CAAC,EAAE,SAAS,MAAM,IAAI,GAAG,EAAE,eAAe,CAAA;AAGnE,MAAM,MAAM,aAAa,CAAC,EAAE,SAAS,MAAM,EAAE,KAAK,GAAG,GAAG,IAAI,CAAC,IAAI,CAAC,UAAU,CAAC,KAAK,CAAC,EAAE,aAAa,CAAC,EAAE,CAAC,CAAC,EAAE,MAAM,CAAC,GAAG;IACjH,GAAG,EAAE,SAAS,CAAC,UAAU,CAAC,KAAK,CAAC,EAAE,aAAa,CAAC,EAAE,CAAC,CAAC,CAAA;IACpD,SAAS,EAAE,MAAM,CAAC,KAAK,CAAC,CAAA;CACzB,CAAA;AAGD,eAAO,MAAM,cAAc,oEAc1B,CAAA"}
1
+ {"version":3,"file":"tooltip-plugin.d.ts","sourceRoot":"","sources":["../src/tooltip-plugin.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,eAAe,CAAA;AAC9C,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,uBAAuB,CAAA;AAEvD,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,EAAE,MAAM,iBAAiB,CAAA;AAInD,MAAM,MAAM,aAAa,CAAC,EAAE,SAAS,MAAM,IAAI,GAAG,EAAE,eAAe,CAAA;AAGnE,MAAM,MAAM,aAAa,CAAC,EAAE,SAAS,MAAM,EAAE,KAAK,GAAG,GAAG,IAAI,CAAC,IAAI,CAAC,UAAU,CAAC,KAAK,CAAC,EAAE,aAAa,CAAC,EAAE,CAAC,CAAC,EAAE,MAAM,CAAC,GAAG;IACjH,GAAG,EAAE,SAAS,CAAC,UAAU,CAAC,KAAK,CAAC,EAAE,aAAa,CAAC,EAAE,CAAC,CAAC,CAAA;IACpD,SAAS,EAAE,MAAM,CAAC,KAAK,CAAC,CAAA;CACzB,CAAA;AAGD,eAAO,MAAM,cAAc,oEAsB1B,CAAA"}
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@milkdown/plugin-tooltip",
3
3
  "type": "module",
4
- "version": "7.1.1",
4
+ "version": "7.1.2-next.1",
5
5
  "license": "MIT",
6
6
  "repository": {
7
7
  "type": "git",
@@ -20,22 +20,22 @@
20
20
  "src"
21
21
  ],
22
22
  "peerDependencies": {
23
- "@milkdown/core": "^7.0.0-next.0",
24
- "@milkdown/ctx": "^7.0.0-next.0",
25
- "@milkdown/prose": "^7.0.0-next.0"
23
+ "@milkdown/core": "^7.1.2-next.0",
24
+ "@milkdown/ctx": "^7.1.2-next.0",
25
+ "@milkdown/prose": "^7.1.2-next.0"
26
26
  },
27
27
  "dependencies": {
28
28
  "@types/lodash.debounce": "^4.0.7",
29
29
  "lodash.debounce": "^4.0.8",
30
30
  "tippy.js": "^6.3.7",
31
31
  "tslib": "^2.5.0",
32
- "@milkdown/exception": "7.1.1",
33
- "@milkdown/utils": "7.1.1"
32
+ "@milkdown/exception": "7.1.2-next.1",
33
+ "@milkdown/utils": "7.1.2-next.1"
34
34
  },
35
35
  "devDependencies": {
36
- "@milkdown/core": "7.1.1",
37
- "@milkdown/ctx": "7.1.1",
38
- "@milkdown/prose": "7.1.1"
36
+ "@milkdown/core": "7.1.2-next.1",
37
+ "@milkdown/ctx": "7.1.2-next.1",
38
+ "@milkdown/prose": "7.1.2-next.1"
39
39
  },
40
40
  "nx": {
41
41
  "targets": {
@@ -27,6 +27,14 @@ export const tooltipFactory = <Id extends string, State = any>(id: Id) => {
27
27
  const result = [tooltipSpec, tooltipPlugin] as TooltipPlugin<Id>
28
28
  result.key = tooltipSpec.key
29
29
  result.pluginKey = tooltipPlugin.key
30
+ tooltipSpec.meta = {
31
+ package: '@milkdown/plugin-tooltip',
32
+ displayName: `Ctx<tooltipSpec>|${id}`,
33
+ }
34
+ tooltipPlugin.meta = {
35
+ package: '@milkdown/plugin-tooltip',
36
+ displayName: `Prose<tooltip>|${id}`,
37
+ }
30
38
 
31
39
  return result
32
40
  }