@milkdown/plugin-tooltip 5.5.0 → 6.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +3 -13
- package/lib/{src/button-manager → button-manager}/calc-button-pos.d.ts +1 -1
- package/lib/button-manager/calc-button-pos.d.ts.map +1 -0
- package/lib/{src/button-manager → button-manager}/create-tooltip.d.ts +1 -1
- package/lib/button-manager/create-tooltip.d.ts.map +1 -0
- package/lib/{src/button-manager → button-manager}/filter-button.d.ts +0 -0
- package/lib/button-manager/filter-button.d.ts.map +1 -0
- package/lib/{src/button-manager → button-manager}/index.d.ts +1 -1
- package/lib/button-manager/index.d.ts.map +1 -0
- package/lib/{src/button-manager → button-manager}/no-active.d.ts +0 -0
- package/lib/button-manager/no-active.d.ts.map +1 -0
- package/lib/button-manager/style.d.ts +3 -0
- package/lib/button-manager/style.d.ts.map +1 -0
- package/lib/index.d.ts +21 -1
- package/lib/index.d.ts.map +1 -0
- package/lib/index.es.js +64 -387
- package/lib/index.es.js.map +1 -1
- package/lib/item.d.ts +34 -0
- package/lib/item.d.ts.map +1 -0
- package/lib/{src/selection-marks-tooltip.d.ts → selection-marks-tooltip.d.ts} +3 -2
- package/lib/selection-marks-tooltip.d.ts.map +1 -0
- package/lib/{src/utility → utility}/element.d.ts +0 -0
- package/lib/utility/element.d.ts.map +1 -0
- package/lib/{src/utility → utility}/index.d.ts +0 -1
- package/lib/utility/index.d.ts.map +1 -0
- package/lib/{src/utility → utility}/prosemirror.d.ts +0 -0
- package/lib/utility/prosemirror.d.ts.map +1 -0
- package/lib/{src/utility → utility}/toggle.d.ts +0 -0
- package/lib/utility/toggle.d.ts.map +1 -0
- package/package.json +34 -10
- package/src/button-manager/calc-button-pos.ts +2 -3
- package/src/button-manager/create-tooltip.ts +9 -7
- package/src/button-manager/filter-button.ts +1 -1
- package/src/button-manager/index.ts +8 -3
- package/src/button-manager/no-active.ts +1 -1
- package/src/button-manager/style.ts +11 -10
- package/src/index.ts +6 -20
- package/src/item.ts +34 -75
- package/src/selection-marks-tooltip.ts +8 -9
- package/src/utility/index.ts +0 -1
- package/src/utility/toggle.ts +3 -3
- package/lib/src/button-manager/calc-button-pos.d.ts.map +0 -1
- package/lib/src/button-manager/create-tooltip.d.ts.map +0 -1
- package/lib/src/button-manager/filter-button.d.ts.map +0 -1
- package/lib/src/button-manager/index.d.ts.map +0 -1
- package/lib/src/button-manager/no-active.d.ts.map +0 -1
- package/lib/src/button-manager/style.d.ts +0 -3
- package/lib/src/button-manager/style.d.ts.map +0 -1
- package/lib/src/index.d.ts +0 -21
- package/lib/src/index.d.ts.map +0 -1
- package/lib/src/input-manager/calc-input-pos.d.ts +0 -3
- package/lib/src/input-manager/calc-input-pos.d.ts.map +0 -1
- package/lib/src/input-manager/create-input.d.ts +0 -7
- package/lib/src/input-manager/create-input.d.ts.map +0 -1
- package/lib/src/input-manager/filter-input.d.ts +0 -19
- package/lib/src/input-manager/filter-input.d.ts.map +0 -1
- package/lib/src/input-manager/index.d.ts +0 -10
- package/lib/src/input-manager/index.d.ts.map +0 -1
- package/lib/src/input-manager/style.d.ts +0 -3
- package/lib/src/input-manager/style.d.ts.map +0 -1
- package/lib/src/item.d.ts +0 -53
- package/lib/src/item.d.ts.map +0 -1
- package/lib/src/selection-marks-tooltip.d.ts.map +0 -1
- package/lib/src/utility/element.d.ts.map +0 -1
- package/lib/src/utility/index.d.ts.map +0 -1
- package/lib/src/utility/input.d.ts +0 -9
- package/lib/src/utility/input.d.ts.map +0 -1
- package/lib/src/utility/prosemirror.d.ts.map +0 -1
- package/lib/src/utility/toggle.d.ts.map +0 -1
- package/src/input-manager/calc-input-pos.ts +0 -19
- package/src/input-manager/create-input.ts +0 -39
- package/src/input-manager/filter-input.ts +0 -33
- package/src/input-manager/index.ts +0 -64
- package/src/input-manager/style.ts +0 -66
- package/src/utility/input.ts +0 -137
package/README.md
CHANGED
|
@@ -15,9 +15,9 @@ import { tooltip } from '@milkdown/plugin-tooltip';
|
|
|
15
15
|
Editor.make().use(nord).use(commonmark).use(tooltip).create();
|
|
16
16
|
```
|
|
17
17
|
|
|
18
|
-
#
|
|
18
|
+
# Position
|
|
19
19
|
|
|
20
|
-
Modify the
|
|
20
|
+
Modify the tooltip widget's position, to show on the top or the bottom
|
|
21
21
|
|
|
22
22
|
Example:
|
|
23
23
|
|
|
@@ -26,17 +26,7 @@ import { tooltipPlugin, tooltip } from '@milkdown/plugin-tooltip';
|
|
|
26
26
|
|
|
27
27
|
Editor.make().use(
|
|
28
28
|
tooltip.configure(tooltipPlugin, {
|
|
29
|
-
|
|
30
|
-
placeholder: 'Please input link...',
|
|
31
|
-
buttonText: 'Confirm',
|
|
32
|
-
},
|
|
33
|
-
image: {
|
|
34
|
-
placeholder: 'Please input image link...',
|
|
35
|
-
buttonText: 'OK',
|
|
36
|
-
},
|
|
37
|
-
inlineMath: {
|
|
38
|
-
placeholder: 'Please input inline math...',
|
|
39
|
-
},
|
|
29
|
+
bottom: true,
|
|
40
30
|
}),
|
|
41
31
|
);
|
|
42
32
|
```
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import { EditorView } from '@milkdown/prose';
|
|
2
|
-
export declare const calcButtonPos: (buttons: HTMLElement, view: EditorView) => void;
|
|
2
|
+
export declare const calcButtonPos: (buttons: HTMLElement, view: EditorView, isBottom: boolean) => void;
|
|
3
3
|
//# sourceMappingURL=calc-button-pos.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"calc-button-pos.d.ts","sourceRoot":"","sources":["../../src/button-manager/calc-button-pos.ts"],"names":[],"mappings":"AACA,OAAO,EAAyB,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAEpE,eAAO,MAAM,aAAa,YAAa,WAAW,QAAQ,UAAU,YAAY,OAAO,SAkBtF,CAAC"}
|
|
@@ -5,6 +5,6 @@ declare type Tooltip = {
|
|
|
5
5
|
dom: HTMLDivElement;
|
|
6
6
|
render: (editorView: EditorView) => void;
|
|
7
7
|
};
|
|
8
|
-
export declare const createTooltip: (buttonMap: ButtonMap, utils: Utils) => Tooltip;
|
|
8
|
+
export declare const createTooltip: (buttonMap: ButtonMap, utils: Utils, className: string) => Tooltip;
|
|
9
9
|
export {};
|
|
10
10
|
//# sourceMappingURL=create-tooltip.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"create-tooltip.d.ts","sourceRoot":"","sources":["../../src/button-manager/create-tooltip.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAClD,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,iBAAiB,CAAC;AAE7C,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,SAAS,CAAC;AAGzC,aAAK,OAAO,GAAG;IACX,GAAG,EAAE,cAAc,CAAC;IACpB,MAAM,EAAE,CAAC,UAAU,EAAE,UAAU,KAAK,IAAI,CAAC;CAC5C,CAAC;AAEF,eAAO,MAAM,aAAa,cAAe,SAAS,SAAS,KAAK,aAAa,MAAM,KAAG,OAqBrF,CAAC"}
|
|
File without changes
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"filter-button.d.ts","sourceRoot":"","sources":["../../src/button-manager/filter-button.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAE7C,OAAO,EAAE,SAAS,EAAE,MAAM,SAAS,CAAC;AAGpC,eAAO,MAAM,YAAY,cAAe,SAAS,QAAQ,UAAU,YAqBlE,CAAC"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type { EditorView } from '@milkdown/prose';
|
|
2
2
|
import type { Utils } from '@milkdown/utils';
|
|
3
3
|
import type { ButtonMap } from '../item';
|
|
4
|
-
export declare const createButtonManager: (buttonMap: ButtonMap, utils: Utils) => {
|
|
4
|
+
export declare const createButtonManager: (buttonMap: ButtonMap, utils: Utils, bottom: boolean, containerClassName: string) => {
|
|
5
5
|
destroy: () => void;
|
|
6
6
|
hide: () => void;
|
|
7
7
|
update: (editorView: EditorView) => void;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/button-manager/index.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAClD,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,iBAAiB,CAAC;AAE7C,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,SAAS,CAAC;AAKzC,eAAO,MAAM,mBAAmB,cACjB,SAAS,SACb,KAAK,UACJ,OAAO,sBACK,MAAM;;;yBAyBD,UAAU;;CAUtC,CAAC"}
|
|
File without changes
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"no-active.d.ts","sourceRoot":"","sources":["../../src/button-manager/no-active.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAE7C,OAAO,EAAE,SAAS,EAAE,MAAM,SAAS,CAAC;AAEpC,eAAO,MAAM,QAAQ,cAAe,SAAS,QAAQ,UAAU,YAI9D,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"style.d.ts","sourceRoot":"","sources":["../../src/button-manager/style.ts"],"names":[],"mappings":"AACA,OAAO,EAAS,OAAO,EAA2B,YAAY,EAA0B,MAAM,gBAAgB,CAAC;AAE/G,eAAO,MAAM,WAAW,iBAAkB,YAAY,WAAW,OAAO,WA8CvE,CAAC"}
|
package/lib/index.d.ts
CHANGED
|
@@ -1 +1,21 @@
|
|
|
1
|
-
|
|
1
|
+
import { PluginKey } from '@milkdown/prose';
|
|
2
|
+
import { AtomList } from '@milkdown/utils';
|
|
3
|
+
import { TooltipOptions } from './item';
|
|
4
|
+
export declare const key: PluginKey<any, any>;
|
|
5
|
+
export declare const tooltipPlugin: import("@milkdown/utils/lib/types").WithExtend<string, TooltipOptions, {
|
|
6
|
+
[x: string]: import("prosemirror-model").NodeType<any>;
|
|
7
|
+
} & {
|
|
8
|
+
[x: string]: import("prosemirror-model").MarkType<any>;
|
|
9
|
+
}, {
|
|
10
|
+
schema?: ((ctx: import("@milkdown/core").Ctx) => {
|
|
11
|
+
node?: Record<string, import("@milkdown/core").NodeSchema> | undefined;
|
|
12
|
+
mark?: Record<string, import("@milkdown/core").MarkSchema> | undefined;
|
|
13
|
+
}) | undefined;
|
|
14
|
+
view?: ((ctx: import("@milkdown/core").Ctx) => Partial<{
|
|
15
|
+
[x: string]: import("@milkdown/prose").NodeViewFactory;
|
|
16
|
+
} & {
|
|
17
|
+
[x: string]: import("@milkdown/prose").MarkViewFactory;
|
|
18
|
+
}>) | undefined;
|
|
19
|
+
}>;
|
|
20
|
+
export declare const tooltip: AtomList<import("@milkdown/utils/lib/types").Metadata<import("@milkdown/utils/lib/types").GetPlugin<string, TooltipOptions>> & import("@milkdown/core").MilkdownPlugin>;
|
|
21
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAEA,OAAO,EAAU,SAAS,EAAE,MAAM,iBAAiB,CAAC;AACpD,OAAO,EAAE,QAAQ,EAA0B,MAAM,iBAAiB,CAAC;AAEnE,OAAO,EAAa,cAAc,EAAE,MAAM,QAAQ,CAAC;AAGnD,eAAO,MAAM,GAAG,qBAA2C,CAAC;AAE5D,eAAO,MAAM,aAAa;;;;;;;;;;;;;;EAyCxB,CAAC;AAEH,eAAO,MAAM,OAAO,yKAAqC,CAAC"}
|