@docs.plus/extension-hyperlink 1.3.7 → 1.3.11
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 +42 -28
- package/dist/dialogBoxs/editeHyperlink.d.ts +13 -0
- package/dist/dialogBoxs/icons.d.ts +9 -0
- package/dist/dialogBoxs/previewHyperlink.d.ts +14 -0
- package/dist/dialogBoxs/setHyperlink.d.ts +9 -0
- package/dist/helpers/clickHandler.d.ts +1 -4
- package/dist/hyperlink.d.ts +4 -4
- package/dist/index.cjs +229 -13
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.ts +8 -4
- package/dist/index.js +229 -12
- package/dist/index.js.map +1 -1
- package/dist/index.umd.js +229 -13
- package/dist/index.umd.js.map +1 -1
- package/package.json +1 -1
- package/src/dialogBoxs/editeHyperlink.ts +101 -0
- package/src/dialogBoxs/icons.ts +46 -0
- package/src/dialogBoxs/previewHyperlink.ts +89 -0
- package/src/dialogBoxs/setHyperlink.ts +96 -0
- package/src/helpers/clickHandler.ts +7 -10
- package/src/hyperlink.ts +8 -8
- package/src/index.ts +14 -4
package/src/hyperlink.ts
CHANGED
|
@@ -33,13 +33,13 @@ export interface HyperlinkOptions {
|
|
|
33
33
|
*/
|
|
34
34
|
HTMLAttributes: Record<string, any>;
|
|
35
35
|
/**
|
|
36
|
-
* A list of
|
|
36
|
+
* A list of dialogBoxs to be rendered.
|
|
37
37
|
* @default null
|
|
38
38
|
* @example
|
|
39
39
|
*/
|
|
40
|
-
|
|
41
|
-
previewHyperlink?: ((options: any) => HTMLElement) | null;
|
|
42
|
-
setHyperlink?: ((options: any) => void) | null;
|
|
40
|
+
dialogBoxs: {
|
|
41
|
+
previewHyperlink?: ((options: any) => void | HTMLElement) | null;
|
|
42
|
+
setHyperlink?: ((options: any) => void | HTMLElement) | null;
|
|
43
43
|
};
|
|
44
44
|
/**
|
|
45
45
|
* A validation function that modifies link verification for the auto linker.
|
|
@@ -116,7 +116,7 @@ export const Hyperlink = Mark.create<HyperlinkOptions>({
|
|
|
116
116
|
rel: "noopener noreferrer nofollow",
|
|
117
117
|
class: null,
|
|
118
118
|
},
|
|
119
|
-
|
|
119
|
+
dialogBoxs: {
|
|
120
120
|
previewHyperlink: null,
|
|
121
121
|
setHyperlink: null,
|
|
122
122
|
},
|
|
@@ -151,13 +151,13 @@ export const Hyperlink = Mark.create<HyperlinkOptions>({
|
|
|
151
151
|
setHyperlink:
|
|
152
152
|
(attributes) =>
|
|
153
153
|
({ editor, chain }) => {
|
|
154
|
-
if (!this.options.
|
|
154
|
+
if (!this.options.dialogBoxs.setHyperlink) {
|
|
155
155
|
return chain()
|
|
156
156
|
.setMark(this.name, attributes)
|
|
157
157
|
.setMeta("preventAutohyperlink", true)
|
|
158
158
|
.run();
|
|
159
159
|
} else {
|
|
160
|
-
this.options.
|
|
160
|
+
this.options.dialogBoxs.setHyperlink({
|
|
161
161
|
editor,
|
|
162
162
|
validate: this.options.validate,
|
|
163
163
|
extentionName: this.name,
|
|
@@ -253,7 +253,7 @@ export const Hyperlink = Mark.create<HyperlinkOptions>({
|
|
|
253
253
|
editor: this.editor,
|
|
254
254
|
validate: this.options.validate,
|
|
255
255
|
view: this.editor.view,
|
|
256
|
-
|
|
256
|
+
dialogBox: this.options.dialogBoxs.previewHyperlink,
|
|
257
257
|
})
|
|
258
258
|
);
|
|
259
259
|
}
|
package/src/index.ts
CHANGED
|
@@ -1,7 +1,17 @@
|
|
|
1
|
-
|
|
1
|
+
export * from "./hyperlink";
|
|
2
|
+
|
|
3
|
+
export * from "./helpers/tippyHelper";
|
|
4
|
+
|
|
5
|
+
export * from "./dialogBoxs/previewHyperlink";
|
|
6
|
+
|
|
7
|
+
export * from "./dialogBoxs/setHyperlink";
|
|
8
|
+
|
|
9
|
+
import { previewHyperlink } from "./dialogBoxs/previewHyperlink";
|
|
10
|
+
|
|
11
|
+
import { setHyperlink } from "./dialogBoxs/setHyperlink";
|
|
12
|
+
|
|
2
13
|
import Tooltip from "./helpers/tippyHelper";
|
|
3
14
|
|
|
4
|
-
|
|
5
|
-
export * from "./hyperlink";
|
|
15
|
+
import { Hyperlink } from "./hyperlink";
|
|
6
16
|
|
|
7
|
-
export
|
|
17
|
+
export { Hyperlink, Tooltip, previewHyperlink, setHyperlink };
|