@tiptap/extension-code-block-lowlight 2.5.9 → 3.0.0-next.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.
@@ -1,14 +1,8 @@
1
1
  import { Node as ProseMirrorNode } from '@tiptap/pm/model';
2
2
  /**
3
- * Returns true if the given prosemirror node is empty.
3
+ * Returns true if the given node is empty.
4
+ * When `checkChildren` is true (default), it will also check if all children are empty.
4
5
  */
5
- export declare function isNodeEmpty(node: ProseMirrorNode, { checkChildren, ignoreWhitespace, }?: {
6
- /**
7
- * When true (default), it will also check if all children are empty.
8
- */
9
- checkChildren?: boolean;
10
- /**
11
- * When true, it will ignore whitespace when checking for emptiness.
12
- */
13
- ignoreWhitespace?: boolean;
6
+ export declare function isNodeEmpty(node: ProseMirrorNode, { checkChildren }?: {
7
+ checkChildren: boolean;
14
8
  }): boolean;
@@ -1 +1 @@
1
- export declare const style = ".ProseMirror {\n position: relative;\n}\n\n.ProseMirror {\n word-wrap: break-word;\n white-space: pre-wrap;\n white-space: break-spaces;\n -webkit-font-variant-ligatures: none;\n font-variant-ligatures: none;\n font-feature-settings: \"liga\" 0; /* the above doesn't seem to work in Edge */\n}\n\n.ProseMirror [contenteditable=\"false\"] {\n white-space: normal;\n}\n\n.ProseMirror [contenteditable=\"false\"] [contenteditable=\"true\"] {\n white-space: pre-wrap;\n}\n\n.ProseMirror pre {\n white-space: pre-wrap;\n}\n\nimg.ProseMirror-separator {\n display: inline !important;\n border: none !important;\n margin: 0 !important;\n width: 1px !important;\n height: 1px !important;\n}\n\n.ProseMirror-gapcursor {\n display: none;\n pointer-events: none;\n position: absolute;\n margin: 0;\n}\n\n.ProseMirror-gapcursor:after {\n content: \"\";\n display: block;\n position: absolute;\n top: -2px;\n width: 20px;\n border-top: 1px solid black;\n animation: ProseMirror-cursor-blink 1.1s steps(2, start) infinite;\n}\n\n@keyframes ProseMirror-cursor-blink {\n to {\n visibility: hidden;\n }\n}\n\n.ProseMirror-hideselection *::selection {\n background: transparent;\n}\n\n.ProseMirror-hideselection *::-moz-selection {\n background: transparent;\n}\n\n.ProseMirror-hideselection * {\n caret-color: transparent;\n}\n\n.ProseMirror-focused .ProseMirror-gapcursor {\n display: block;\n}\n\n.tippy-box[data-animation=fade][data-state=hidden] {\n opacity: 0\n}";
1
+ export declare const style = ".ProseMirror {\n position: relative;\n}\n\n.ProseMirror {\n word-wrap: break-word;\n white-space: pre-wrap;\n white-space: break-spaces;\n -webkit-font-variant-ligatures: none;\n font-variant-ligatures: none;\n font-feature-settings: \"liga\" 0; /* the above doesn't seem to work in Edge */\n}\n\n.ProseMirror [contenteditable=\"false\"] {\n white-space: normal;\n}\n\n.ProseMirror [contenteditable=\"false\"] [contenteditable=\"true\"] {\n white-space: pre-wrap;\n}\n\n.ProseMirror pre {\n white-space: pre-wrap;\n}\n\nimg.ProseMirror-separator {\n display: inline !important;\n border: none !important;\n margin: 0 !important;\n width: 1px !important;\n height: 1px !important;\n}\n\n.ProseMirror-gapcursor {\n display: none;\n pointer-events: none;\n position: absolute;\n margin: 0;\n}\n\n.ProseMirror-gapcursor:after {\n content: \"\";\n display: block;\n position: absolute;\n top: -2px;\n width: 20px;\n border-top: 1px solid black;\n animation: ProseMirror-cursor-blink 1.1s steps(2, start) infinite;\n}\n\n@keyframes ProseMirror-cursor-blink {\n to {\n visibility: hidden;\n }\n}\n\n.ProseMirror-hideselection *::selection {\n background: transparent;\n}\n\n.ProseMirror-hideselection *::-moz-selection {\n background: transparent;\n}\n\n.ProseMirror-hideselection * {\n caret-color: transparent;\n}\n\n.ProseMirror-focused .ProseMirror-gapcursor {\n display: block;\n}";
@@ -15,12 +15,6 @@ export interface CodeBlockOptions {
15
15
  * @default true
16
16
  */
17
17
  exitOnArrowDown: boolean;
18
- /**
19
- * The default language.
20
- * @default null
21
- * @example 'js'
22
- */
23
- defaultLanguage: string | null | undefined;
24
18
  /**
25
19
  * Custom HTML attributes that should be added to the rendered HTML tag.
26
20
  * @default {}
@@ -4,6 +4,12 @@ export interface CodeBlockLowlightOptions extends CodeBlockOptions {
4
4
  * The lowlight instance.
5
5
  */
6
6
  lowlight: any;
7
+ /**
8
+ * The default language.
9
+ * @default null
10
+ * @example 'javascript'
11
+ */
12
+ defaultLanguage: string | null | undefined;
7
13
  }
8
14
  /**
9
15
  * This extension allows you to highlight code blocks with lowlight.
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@tiptap/extension-code-block-lowlight",
3
3
  "description": "code block extension for tiptap",
4
- "version": "2.5.9",
4
+ "version": "3.0.0-next.0",
5
5
  "homepage": "https://tiptap.dev",
6
6
  "keywords": [
7
7
  "tiptap",
@@ -29,17 +29,14 @@
29
29
  "dist"
30
30
  ],
31
31
  "devDependencies": {
32
- "@tiptap/core": "^2.5.9",
33
- "@tiptap/extension-code-block": "^2.5.9",
34
- "@tiptap/pm": "^2.5.9",
35
- "lowlight": "^2 || ^3"
32
+ "@tiptap/core": "^3.0.0-next.0",
33
+ "@tiptap/extension-code-block": "^3.0.0-next.0",
34
+ "@tiptap/pm": "^3.0.0-next.0"
36
35
  },
37
36
  "peerDependencies": {
38
- "@tiptap/core": "^2.5.9",
39
- "@tiptap/extension-code-block": "^2.5.9",
40
- "@tiptap/pm": "^2.5.9",
41
- "lowlight": "^2 || ^3",
42
- "highlight.js": "^11"
37
+ "@tiptap/core": "^3.0.0-next.0",
38
+ "@tiptap/extension-code-block": "^3.0.0-next.0",
39
+ "@tiptap/pm": "^3.0.0-next.0"
43
40
  },
44
41
  "repository": {
45
42
  "type": "git",
@@ -7,6 +7,13 @@ export interface CodeBlockLowlightOptions extends CodeBlockOptions {
7
7
  * The lowlight instance.
8
8
  */
9
9
  lowlight: any,
10
+
11
+ /**
12
+ * The default language.
13
+ * @default null
14
+ * @example 'javascript'
15
+ */
16
+ defaultLanguage: string | null | undefined,
10
17
  }
11
18
 
12
19
  /**
@@ -18,6 +25,7 @@ export const CodeBlockLowlight = CodeBlock.extend<CodeBlockLowlightOptions>({
18
25
  return {
19
26
  ...this.parent?.(),
20
27
  lowlight: {},
28
+ defaultLanguage: null,
21
29
  }
22
30
  },
23
31