@tiptap/extension-gapcursor 3.0.0-next.3 → 3.0.0-next.4

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/LICENSE.md ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2024, Tiptap GmbH
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md CHANGED
@@ -1,14 +1,18 @@
1
1
  # @tiptap/extension-gapcursor
2
+
2
3
  [![Version](https://img.shields.io/npm/v/@tiptap/extension-gapcursor.svg?label=version)](https://www.npmjs.com/package/@tiptap/extension-gapcursor)
3
4
  [![Downloads](https://img.shields.io/npm/dm/@tiptap/extension-gapcursor.svg)](https://npmcharts.com/compare/tiptap?minimal=true)
4
5
  [![License](https://img.shields.io/npm/l/@tiptap/extension-gapcursor.svg)](https://www.npmjs.com/package/@tiptap/extension-gapcursor)
5
6
  [![Sponsor](https://img.shields.io/static/v1?label=Sponsor&message=%E2%9D%A4&logo=GitHub)](https://github.com/sponsors/ueberdosis)
6
7
 
7
8
  ## Introduction
8
- Tiptap is a headless wrapper around [ProseMirror](https://ProseMirror.net) – a toolkit for building rich text WYSIWYG editors, which is already in use at many well-known companies such as *New York Times*, *The Guardian* or *Atlassian*.
9
+
10
+ Tiptap is a headless wrapper around [ProseMirror](https://ProseMirror.net) – a toolkit for building rich text WYSIWYG editors, which is already in use at many well-known companies such as _New York Times_, _The Guardian_ or _Atlassian_.
9
11
 
10
12
  ## Official Documentation
13
+
11
14
  Documentation can be found on the [Tiptap website](https://tiptap.dev).
12
15
 
13
16
  ## License
17
+
14
18
  Tiptap is open sourced software licensed under the [MIT license](https://github.com/ueberdosis/tiptap/blob/main/LICENSE.md).
package/dist/index.cjs CHANGED
@@ -18,38 +18,15 @@ var __copyProps = (to, from, except, desc) => {
18
18
  var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
19
19
 
20
20
  // src/index.ts
21
- var src_exports = {};
22
- __export(src_exports, {
23
- Gapcursor: () => Gapcursor,
24
- default: () => src_default
21
+ var index_exports = {};
22
+ __export(index_exports, {
23
+ Gapcursor: () => import_extensions2.Gapcursor,
24
+ default: () => index_default
25
25
  });
26
- module.exports = __toCommonJS(src_exports);
27
-
28
- // src/gapcursor.ts
29
- var import_core = require("@tiptap/core");
30
- var import_gapcursor = require("@tiptap/pm/gapcursor");
31
- var Gapcursor = import_core.Extension.create({
32
- name: "gapCursor",
33
- addProseMirrorPlugins() {
34
- return [
35
- (0, import_gapcursor.gapCursor)()
36
- ];
37
- },
38
- extendNodeSchema(extension) {
39
- var _a;
40
- const context = {
41
- name: extension.name,
42
- options: extension.options,
43
- storage: extension.storage
44
- };
45
- return {
46
- allowGapCursor: (_a = (0, import_core.callOrReturn)((0, import_core.getExtensionField)(extension, "allowGapCursor", context))) != null ? _a : null
47
- };
48
- }
49
- });
50
-
51
- // src/index.ts
52
- var src_default = Gapcursor;
26
+ module.exports = __toCommonJS(index_exports);
27
+ var import_extensions = require("@tiptap/extensions");
28
+ var import_extensions2 = require("@tiptap/extensions");
29
+ var index_default = import_extensions.Gapcursor;
53
30
  // Annotate the CommonJS export names for ESM import in node:
54
31
  0 && (module.exports = {
55
32
  Gapcursor
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/index.ts","../src/gapcursor.ts"],"sourcesContent":["import { Gapcursor } from './gapcursor.js'\n\nexport * from './gapcursor.js'\n\nexport default Gapcursor\n","import {\n callOrReturn,\n Extension,\n getExtensionField,\n ParentConfig,\n} from '@tiptap/core'\nimport { gapCursor } from '@tiptap/pm/gapcursor'\n\ndeclare module '@tiptap/core' {\n interface NodeConfig<Options, Storage> {\n /**\n * A function to determine whether the gap cursor is allowed at the current position. Must return `true` or `false`.\n * @default null\n */\n allowGapCursor?:\n | boolean\n | null\n | ((this: {\n name: string,\n options: Options,\n storage: Storage,\n parent: ParentConfig<NodeConfig<Options>>['allowGapCursor'],\n }) => boolean | null),\n }\n}\n\n/**\n * This extension allows you to add a gap cursor to your editor.\n * A gap cursor is a cursor that appears when you click on a place\n * where no content is present, for example inbetween nodes.\n * @see https://tiptap.dev/api/extensions/gapcursor\n */\nexport const Gapcursor = Extension.create({\n name: 'gapCursor',\n\n addProseMirrorPlugins() {\n return [\n gapCursor(),\n ]\n },\n\n extendNodeSchema(extension) {\n const context = {\n name: extension.name,\n options: extension.options,\n storage: extension.storage,\n }\n\n return {\n allowGapCursor: callOrReturn(getExtensionField(extension, 'allowGapCursor', context)) ?? null,\n }\n },\n})\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;;ACAA,kBAKO;AACP,uBAA0B;AA0BnB,IAAM,YAAY,sBAAU,OAAO;AAAA,EACxC,MAAM;AAAA,EAEN,wBAAwB;AACtB,WAAO;AAAA,UACL,4BAAU;AAAA,IACZ;AAAA,EACF;AAAA,EAEA,iBAAiB,WAAW;AAzC9B;AA0CI,UAAM,UAAU;AAAA,MACd,MAAM,UAAU;AAAA,MAChB,SAAS,UAAU;AAAA,MACnB,SAAS,UAAU;AAAA,IACrB;AAEA,WAAO;AAAA,MACL,iBAAgB,uCAAa,+BAAkB,WAAW,kBAAkB,OAAO,CAAC,MAApE,YAAyE;AAAA,IAC3F;AAAA,EACF;AACF,CAAC;;;ADhDD,IAAO,cAAQ;","names":[]}
1
+ {"version":3,"sources":["../src/index.ts"],"sourcesContent":["import { Gapcursor } from '@tiptap/extensions'\n\nexport { Gapcursor } from '@tiptap/extensions'\n\nexport default Gapcursor\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,wBAA0B;AAE1B,IAAAA,qBAA0B;AAE1B,IAAO,gBAAQ;","names":["import_extensions"]}
package/dist/index.d.cts CHANGED
@@ -1,25 +1,2 @@
1
- import { ParentConfig, Extension } from '@tiptap/core';
2
-
3
- declare module '@tiptap/core' {
4
- interface NodeConfig<Options, Storage> {
5
- /**
6
- * A function to determine whether the gap cursor is allowed at the current position. Must return `true` or `false`.
7
- * @default null
8
- */
9
- allowGapCursor?: boolean | null | ((this: {
10
- name: string;
11
- options: Options;
12
- storage: Storage;
13
- parent: ParentConfig<NodeConfig<Options>>['allowGapCursor'];
14
- }) => boolean | null);
15
- }
16
- }
17
- /**
18
- * This extension allows you to add a gap cursor to your editor.
19
- * A gap cursor is a cursor that appears when you click on a place
20
- * where no content is present, for example inbetween nodes.
21
- * @see https://tiptap.dev/api/extensions/gapcursor
22
- */
23
- declare const Gapcursor: Extension<any, any>;
24
-
25
- export { Gapcursor, Gapcursor as default };
1
+ import { Gapcursor } from '@tiptap/extensions';
2
+ export { Gapcursor, Gapcursor as default } from '@tiptap/extensions';
package/dist/index.d.ts CHANGED
@@ -1,25 +1,2 @@
1
- import { ParentConfig, Extension } from '@tiptap/core';
2
-
3
- declare module '@tiptap/core' {
4
- interface NodeConfig<Options, Storage> {
5
- /**
6
- * A function to determine whether the gap cursor is allowed at the current position. Must return `true` or `false`.
7
- * @default null
8
- */
9
- allowGapCursor?: boolean | null | ((this: {
10
- name: string;
11
- options: Options;
12
- storage: Storage;
13
- parent: ParentConfig<NodeConfig<Options>>['allowGapCursor'];
14
- }) => boolean | null);
15
- }
16
- }
17
- /**
18
- * This extension allows you to add a gap cursor to your editor.
19
- * A gap cursor is a cursor that appears when you click on a place
20
- * where no content is present, for example inbetween nodes.
21
- * @see https://tiptap.dev/api/extensions/gapcursor
22
- */
23
- declare const Gapcursor: Extension<any, any>;
24
-
25
- export { Gapcursor, Gapcursor as default };
1
+ import { Gapcursor } from '@tiptap/extensions';
2
+ export { Gapcursor, Gapcursor as default } from '@tiptap/extensions';
package/dist/index.js CHANGED
@@ -1,34 +1,9 @@
1
- // src/gapcursor.ts
2
- import {
3
- callOrReturn,
4
- Extension,
5
- getExtensionField
6
- } from "@tiptap/core";
7
- import { gapCursor } from "@tiptap/pm/gapcursor";
8
- var Gapcursor = Extension.create({
9
- name: "gapCursor",
10
- addProseMirrorPlugins() {
11
- return [
12
- gapCursor()
13
- ];
14
- },
15
- extendNodeSchema(extension) {
16
- var _a;
17
- const context = {
18
- name: extension.name,
19
- options: extension.options,
20
- storage: extension.storage
21
- };
22
- return {
23
- allowGapCursor: (_a = callOrReturn(getExtensionField(extension, "allowGapCursor", context))) != null ? _a : null
24
- };
25
- }
26
- });
27
-
28
1
  // src/index.ts
29
- var src_default = Gapcursor;
2
+ import { Gapcursor } from "@tiptap/extensions";
3
+ import { Gapcursor as Gapcursor2 } from "@tiptap/extensions";
4
+ var index_default = Gapcursor;
30
5
  export {
31
- Gapcursor,
32
- src_default as default
6
+ Gapcursor2 as Gapcursor,
7
+ index_default as default
33
8
  };
34
9
  //# sourceMappingURL=index.js.map
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/gapcursor.ts","../src/index.ts"],"sourcesContent":["import {\n callOrReturn,\n Extension,\n getExtensionField,\n ParentConfig,\n} from '@tiptap/core'\nimport { gapCursor } from '@tiptap/pm/gapcursor'\n\ndeclare module '@tiptap/core' {\n interface NodeConfig<Options, Storage> {\n /**\n * A function to determine whether the gap cursor is allowed at the current position. Must return `true` or `false`.\n * @default null\n */\n allowGapCursor?:\n | boolean\n | null\n | ((this: {\n name: string,\n options: Options,\n storage: Storage,\n parent: ParentConfig<NodeConfig<Options>>['allowGapCursor'],\n }) => boolean | null),\n }\n}\n\n/**\n * This extension allows you to add a gap cursor to your editor.\n * A gap cursor is a cursor that appears when you click on a place\n * where no content is present, for example inbetween nodes.\n * @see https://tiptap.dev/api/extensions/gapcursor\n */\nexport const Gapcursor = Extension.create({\n name: 'gapCursor',\n\n addProseMirrorPlugins() {\n return [\n gapCursor(),\n ]\n },\n\n extendNodeSchema(extension) {\n const context = {\n name: extension.name,\n options: extension.options,\n storage: extension.storage,\n }\n\n return {\n allowGapCursor: callOrReturn(getExtensionField(extension, 'allowGapCursor', context)) ?? null,\n }\n },\n})\n","import { Gapcursor } from './gapcursor.js'\n\nexport * from './gapcursor.js'\n\nexport default Gapcursor\n"],"mappings":";AAAA;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,OAEK;AACP,SAAS,iBAAiB;AA0BnB,IAAM,YAAY,UAAU,OAAO;AAAA,EACxC,MAAM;AAAA,EAEN,wBAAwB;AACtB,WAAO;AAAA,MACL,UAAU;AAAA,IACZ;AAAA,EACF;AAAA,EAEA,iBAAiB,WAAW;AAzC9B;AA0CI,UAAM,UAAU;AAAA,MACd,MAAM,UAAU;AAAA,MAChB,SAAS,UAAU;AAAA,MACnB,SAAS,UAAU;AAAA,IACrB;AAEA,WAAO;AAAA,MACL,iBAAgB,kBAAa,kBAAkB,WAAW,kBAAkB,OAAO,CAAC,MAApE,YAAyE;AAAA,IAC3F;AAAA,EACF;AACF,CAAC;;;AChDD,IAAO,cAAQ;","names":[]}
1
+ {"version":3,"sources":["../src/index.ts"],"sourcesContent":["import { Gapcursor } from '@tiptap/extensions'\n\nexport { Gapcursor } from '@tiptap/extensions'\n\nexport default Gapcursor\n"],"mappings":";AAAA,SAAS,iBAAiB;AAE1B,SAAS,aAAAA,kBAAiB;AAE1B,IAAO,gBAAQ;","names":["Gapcursor"]}
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@tiptap/extension-gapcursor",
3
3
  "description": "gapcursor extension for tiptap",
4
- "version": "3.0.0-next.3",
4
+ "version": "3.0.0-next.4",
5
5
  "homepage": "https://tiptap.dev",
6
6
  "keywords": [
7
7
  "tiptap",
@@ -15,7 +15,10 @@
15
15
  "type": "module",
16
16
  "exports": {
17
17
  ".": {
18
- "types": "./dist/index.d.ts",
18
+ "types": {
19
+ "import": "./dist/index.d.ts",
20
+ "require": "./dist/index.d.cts"
21
+ },
19
22
  "import": "./dist/index.js",
20
23
  "require": "./dist/index.cjs"
21
24
  }
@@ -28,12 +31,10 @@
28
31
  "dist"
29
32
  ],
30
33
  "devDependencies": {
31
- "@tiptap/core": "^3.0.0-next.3",
32
- "@tiptap/pm": "^3.0.0-next.3"
34
+ "@tiptap/extensions": "^3.0.0-next.4"
33
35
  },
34
36
  "peerDependencies": {
35
- "@tiptap/core": "^3.0.0-next.1",
36
- "@tiptap/pm": "^3.0.0-next.1"
37
+ "@tiptap/extensions": "^3.0.0-next.3"
37
38
  },
38
39
  "repository": {
39
40
  "type": "git",
@@ -41,6 +42,7 @@
41
42
  "directory": "packages/extension-gapcursor"
42
43
  },
43
44
  "scripts": {
44
- "build": "tsup"
45
+ "build": "tsup",
46
+ "lint": "prettier ./src/ --check && eslint --cache --quiet --no-error-on-unmatched-pattern ./src/"
45
47
  }
46
- }
48
+ }
package/src/index.ts CHANGED
@@ -1,5 +1,5 @@
1
- import { Gapcursor } from './gapcursor.js'
1
+ import { Gapcursor } from '@tiptap/extensions'
2
2
 
3
- export * from './gapcursor.js'
3
+ export { Gapcursor } from '@tiptap/extensions'
4
4
 
5
5
  export default Gapcursor
package/src/gapcursor.ts DELETED
@@ -1,53 +0,0 @@
1
- import {
2
- callOrReturn,
3
- Extension,
4
- getExtensionField,
5
- ParentConfig,
6
- } from '@tiptap/core'
7
- import { gapCursor } from '@tiptap/pm/gapcursor'
8
-
9
- declare module '@tiptap/core' {
10
- interface NodeConfig<Options, Storage> {
11
- /**
12
- * A function to determine whether the gap cursor is allowed at the current position. Must return `true` or `false`.
13
- * @default null
14
- */
15
- allowGapCursor?:
16
- | boolean
17
- | null
18
- | ((this: {
19
- name: string,
20
- options: Options,
21
- storage: Storage,
22
- parent: ParentConfig<NodeConfig<Options>>['allowGapCursor'],
23
- }) => boolean | null),
24
- }
25
- }
26
-
27
- /**
28
- * This extension allows you to add a gap cursor to your editor.
29
- * A gap cursor is a cursor that appears when you click on a place
30
- * where no content is present, for example inbetween nodes.
31
- * @see https://tiptap.dev/api/extensions/gapcursor
32
- */
33
- export const Gapcursor = Extension.create({
34
- name: 'gapCursor',
35
-
36
- addProseMirrorPlugins() {
37
- return [
38
- gapCursor(),
39
- ]
40
- },
41
-
42
- extendNodeSchema(extension) {
43
- const context = {
44
- name: extension.name,
45
- options: extension.options,
46
- storage: extension.storage,
47
- }
48
-
49
- return {
50
- allowGapCursor: callOrReturn(getExtensionField(extension, 'allowGapCursor', context)) ?? null,
51
- }
52
- },
53
- })