prosemirror-link-plugin 1.3.0 → 1.3.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/dist/decorationsUpdateInRange.d.ts +9 -8
- package/dist/decorationsUpdateInRange.d.ts.map +1 -0
- package/dist/defaultAliasDecoration.d.ts +5 -4
- package/dist/defaultAliasDecoration.d.ts.map +1 -0
- package/dist/index.d.ts +5 -4
- package/dist/index.d.ts.map +1 -0
- package/dist/index.es.js +1 -1
- package/dist/index.js +1 -1
- package/dist/plugin.d.ts +7 -6
- package/dist/plugin.d.ts.map +1 -0
- package/dist/prosemirror-utils.d.ts +9 -8
- package/dist/prosemirror-utils.d.ts.map +1 -0
- package/dist/types.d.ts +21 -20
- package/dist/types.d.ts.map +1 -0
- package/dist/utils.d.ts +9 -8
- package/dist/utils.d.ts.map +1 -0
- package/package.json +29 -42
|
@@ -1,8 +1,9 @@
|
|
|
1
|
-
import { Decoration } from "prosemirror-view";
|
|
2
|
-
import { Node } from "prosemirror-model";
|
|
3
|
-
import { LinksKeyState, SpecObject } from "./types";
|
|
4
|
-
declare const decorationsUpdateInRange: <T extends SpecObject>(from: number, to: number, doc: Node, pluginState: LinksKeyState<T>, createAliasDecoration: (decorationStart: number, decorationEnd: number, alias: string, matchPos: number, linkPluginState: LinksKeyState<T>, docNode: Node) => Decoration) => {
|
|
5
|
-
decorationsToAdd: Decoration[];
|
|
6
|
-
decorationsToRemove: Decoration[];
|
|
7
|
-
};
|
|
8
|
-
export default decorationsUpdateInRange;
|
|
1
|
+
import { Decoration } from "prosemirror-view";
|
|
2
|
+
import { Node } from "prosemirror-model";
|
|
3
|
+
import { LinksKeyState, SpecObject } from "./types";
|
|
4
|
+
declare const decorationsUpdateInRange: <T extends SpecObject>(from: number, to: number, doc: Node, pluginState: LinksKeyState<T>, createAliasDecoration: (decorationStart: number, decorationEnd: number, alias: string, matchPos: number, linkPluginState: LinksKeyState<T>, docNode: Node) => Decoration) => {
|
|
5
|
+
decorationsToAdd: Decoration[];
|
|
6
|
+
decorationsToRemove: Decoration[];
|
|
7
|
+
};
|
|
8
|
+
export default decorationsUpdateInRange;
|
|
9
|
+
//# sourceMappingURL=decorationsUpdateInRange.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"decorationsUpdateInRange.d.ts","sourceRoot":"","sources":["../src/decorationsUpdateInRange.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAC9C,OAAO,EAAE,IAAI,EAAE,MAAM,mBAAmB,CAAC;AAGzC,OAAO,EAAE,aAAa,EAAE,UAAU,EAAE,MAAM,SAAS,CAAC;AAGpD,QAAA,MAAM,wBAAwB,GAAI,CAAC,SAAS,UAAU,EACpD,MAAM,MAAM,EACZ,IAAI,MAAM,EACV,KAAK,IAAI,EACT,aAAa,aAAa,CAAC,CAAC,CAAC,EAC7B,uBAAuB,CACrB,eAAe,EAAE,MAAM,EACvB,aAAa,EAAE,MAAM,EACrB,KAAK,EAAE,MAAM,EACb,QAAQ,EAAE,MAAM,EAChB,eAAe,EAAE,aAAa,CAAC,CAAC,CAAC,EACjC,OAAO,EAAE,IAAI,KACV,UAAU,KACd;IACD,gBAAgB,EAAE,UAAU,EAAE,CAAC;IAC/B,mBAAmB,EAAE,UAAU,EAAE,CAAC;CA8EnC,CAAC;AAEF,eAAe,wBAAwB,CAAC"}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import { Decoration } from "prosemirror-view";
|
|
2
|
-
import { LinksKeyState } from "./types";
|
|
3
|
-
declare const defaultAliasDecoration: <Spec extends Record<string, any>>(start: number, end: number, alias: string, matchPos: number, pluginState: LinksKeyState<Spec>) => Decoration;
|
|
4
|
-
export default defaultAliasDecoration;
|
|
1
|
+
import { Decoration } from "prosemirror-view";
|
|
2
|
+
import { LinksKeyState } from "./types";
|
|
3
|
+
declare const defaultAliasDecoration: <Spec extends Record<string, any>>(start: number, end: number, alias: string, matchPos: number, pluginState: LinksKeyState<Spec>) => Decoration;
|
|
4
|
+
export default defaultAliasDecoration;
|
|
5
|
+
//# sourceMappingURL=defaultAliasDecoration.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"defaultAliasDecoration.d.ts","sourceRoot":"","sources":["../src/defaultAliasDecoration.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAE9C,OAAO,EAAE,aAAa,EAAE,MAAM,SAAS,CAAC;AAExC,QAAA,MAAM,sBAAsB,GAAI,IAAI,SAAS,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,EAC9D,OAAO,MAAM,EACb,KAAK,MAAM,EACX,OAAO,MAAM,EACb,UAAU,MAAM,EAChB,aAAa,aAAa,CAAC,IAAI,CAAC,eAWjC,CAAC;AAEF,eAAe,sBAAsB,CAAC"}
|
package/dist/index.d.ts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
export {
|
|
1
|
+
export { autoLinkingPlugin, linksKey } from "./plugin";
|
|
2
|
+
export { LinksMetaType } from "./types";
|
|
3
|
+
export type { SpecWithAlias, LinksKeyState, LinksMeta, LinksUpdateMeta, } from "./types";
|
|
4
|
+
export { default as defaultAliasDecoration } from "./defaultAliasDecoration";
|
|
5
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,QAAQ,EAAE,MAAM,UAAU,CAAC;AACvD,OAAO,EAAE,aAAa,EAAE,MAAM,SAAS,CAAC;AACxC,YAAY,EACV,aAAa,EACb,aAAa,EACb,SAAS,EACT,eAAe,GAChB,MAAM,SAAS,CAAC;AACjB,OAAO,EAAE,OAAO,IAAI,sBAAsB,EAAE,MAAM,0BAA0B,CAAC"}
|
package/dist/index.es.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{PluginKey as
|
|
1
|
+
import{PluginKey as e,Plugin as o}from"prosemirror-state";import{DecorationSet as t,Decoration as r}from"prosemirror-view";var n;!function(e){e.linkUpdate="linkUpdate"}(n||(n={}));const a=e=>{const o=e.length?e.map(e=>`\\b${e.trim()}\\b`).sort((e,o)=>o.length-e.length).join("|"):"a^";return new RegExp(o,"g")},s=(e,o,t)=>{if(!e)throw new Error('Invalid "node" parameter');if(!o)throw new Error('Invalid "predicate" parameter');return((e,o=!0)=>{if(!e)throw new Error('Invalid "node" parameter');const t=[];return e.descendants((e,r)=>{if(t.push({node:e,pos:r}),!o)return!1}),t})(e,t).filter(e=>o(e.node))},i=(e,o=!0)=>s(e,e=>e.isText,o),d=(e,o,t,r,n)=>{let a=e;const s=[];let d=[];const c=[];let p=[];do{const e=t.resolve(a),o=e.parent,s=a-e.parentOffset,c=s+o.nodeSize,l=r.decorations.find(s,c).filter(e=>e.from>=s&&e.to<=c);p=[...p,...l];i(o).map(e=>Array.from(e.node?.text?.matchAll(r.regex)||[]).map(o=>{if(!o)throw new Error("wrong match");const a=o.index||0,i=o[0],c=e.pos+a+s,p=e.pos+a+i.length+s,l=e.pos+a,m=n(c,p,i,l,r,t);d=[...d,m]})),a+=o.nodeSize}while(a<o);return p.map(e=>{const o=d.find(o=>o.from===e.from&&o.to===e.to&&((e,o)=>{const t=Object.keys(e),r=Object.keys(o);return t.length===r.length&&t.reduce((t,r)=>t&&o[r]===e[r],!0)})(o.spec,e.spec));return o?s.push(o):c.push(e),null}),d=d.filter(e=>!s.includes(e)),{decorationsToAdd:d,decorationsToRemove:c}},c=new e("links"),p=(e,r,s,i,p=a)=>{const l=e=>e.map(e=>e.spec);return new o({key:c,state:{init(o,n){const a=p(e.map(e=>e.alias)),s={decorations:t.empty,regex:a,aliasToSpec:e.reduce((e,o)=>({...e,[o.alias]:o}),{})},i=d(0,n.doc.nodeSize,n.doc,s,r),c=s.decorations.add(n.doc,i.decorationsToAdd);return{...s,decorations:c}},apply(e,o){const t=e.getMeta(c);let{regex:a,aliasToSpec:m}=o;if(t?.type===n.linkUpdate){m=t.specs.reduce((e,o)=>({...e,[o.alias]:o}),{}),a=p(t.specs.map(e=>e.alias));const{decorationsToAdd:n,decorationsToRemove:c}=d(0,e.doc.nodeSize,e.doc,{...o,regex:a,aliasToSpec:m},r);c.length&&i&&i(l(c)),n.length&&s&&s(l(n));return{decorations:o.decorations.remove(c).add(e.doc,n),regex:a,aliasToSpec:m}}if(!e.mapping.maps.length)return o;const g=[],h=o.decorations.map(e.mapping,e.doc,{onRemove:e=>{g.push(e)}}),{start:u,end:f}=(e=>{let o=e.doc.nodeSize,t=0;for(let r=0;r<e.mapping.maps.length;r+=1){const n=e.mapping.maps[r].ranges[0],a=n+e.mapping.maps[r].ranges[2];o=Math.min(o,n,a),t=Math.max(t,n,a)}return{start:o,end:t}})(e),{decorationsToRemove:w,decorationsToAdd:T}=d(u,f,e.doc,{...o,decorations:h},r),v=[...g,...l(w)];v.length&&i&&i(v),T.length&&s&&s(l(T));return{decorations:h.remove(w).add(e.doc,T),regex:a,aliasToSpec:m}}},props:{decorations:e=>t.create(e.doc,c.getState(e)?.decorations.find()||[])}})},l=(e,o,t,n,a)=>{const s=a.aliasToSpec[t];return r.inline(e,o,{class:"autoLink"},s)};export{n as LinksMetaType,p as autoLinkingPlugin,l as defaultAliasDecoration,c as linksKey};
|
package/dist/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";var e=require("prosemirror-state"),
|
|
1
|
+
"use strict";var e=require("prosemirror-state"),o=require("prosemirror-view");exports.LinksMetaType=void 0,(exports.LinksMetaType||(exports.LinksMetaType={})).linkUpdate="linkUpdate";const t=e=>{const o=e.length?e.map(e=>`\\b${e.trim()}\\b`).sort((e,o)=>o.length-e.length).join("|"):"a^";return new RegExp(o,"g")},r=(e,o,t)=>{if(!e)throw new Error('Invalid "node" parameter');if(!o)throw new Error('Invalid "predicate" parameter');return((e,o=!0)=>{if(!e)throw new Error('Invalid "node" parameter');const t=[];return e.descendants((e,r)=>{if(t.push({node:e,pos:r}),!o)return!1}),t})(e,t).filter(e=>o(e.node))},n=(e,o=!0)=>r(e,e=>e.isText,o),a=(e,o,t,r,a)=>{let s=e;const i=[];let d=[];const c=[];let p=[];do{const e=t.resolve(s),o=e.parent,i=s-e.parentOffset,c=i+o.nodeSize,l=r.decorations.find(i,c).filter(e=>e.from>=i&&e.to<=c);p=[...p,...l];n(o).map(e=>Array.from(e.node?.text?.matchAll(r.regex)||[]).map(o=>{if(!o)throw new Error("wrong match");const n=o.index||0,s=o[0],c=e.pos+n+i,p=e.pos+n+s.length+i,l=e.pos+n,m=a(c,p,s,l,r,t);d=[...d,m]})),s+=o.nodeSize}while(s<o);return p.map(e=>{const o=d.find(o=>o.from===e.from&&o.to===e.to&&((e,o)=>{const t=Object.keys(e),r=Object.keys(o);return t.length===r.length&&t.reduce((t,r)=>t&&o[r]===e[r],!0)})(o.spec,e.spec));return o?i.push(o):c.push(e),null}),d=d.filter(e=>!i.includes(e)),{decorationsToAdd:d,decorationsToRemove:c}},s=new e.PluginKey("links");exports.autoLinkingPlugin=(r,n,i,d,c=t)=>{const p=e=>e.map(e=>e.spec);return new e.Plugin({key:s,state:{init(e,t){const s=c(r.map(e=>e.alias)),i={decorations:o.DecorationSet.empty,regex:s,aliasToSpec:r.reduce((e,o)=>({...e,[o.alias]:o}),{})},d=a(0,t.doc.nodeSize,t.doc,i,n),p=i.decorations.add(t.doc,d.decorationsToAdd);return{...i,decorations:p}},apply(e,o){const t=e.getMeta(s);let{regex:r,aliasToSpec:l}=o;if(t?.type===exports.LinksMetaType.linkUpdate){l=t.specs.reduce((e,o)=>({...e,[o.alias]:o}),{}),r=c(t.specs.map(e=>e.alias));const{decorationsToAdd:s,decorationsToRemove:m}=a(0,e.doc.nodeSize,e.doc,{...o,regex:r,aliasToSpec:l},n);m.length&&d&&d(p(m)),s.length&&i&&i(p(s));return{decorations:o.decorations.remove(m).add(e.doc,s),regex:r,aliasToSpec:l}}if(!e.mapping.maps.length)return o;const m=[],g=o.decorations.map(e.mapping,e.doc,{onRemove:e=>{m.push(e)}}),{start:u,end:h}=(e=>{let o=e.doc.nodeSize,t=0;for(let r=0;r<e.mapping.maps.length;r+=1){const n=e.mapping.maps[r].ranges[0],a=n+e.mapping.maps[r].ranges[2];o=Math.min(o,n,a),t=Math.max(t,n,a)}return{start:o,end:t}})(e),{decorationsToRemove:f,decorationsToAdd:x}=a(u,h,e.doc,{...o,decorations:g},n),T=[...m,...p(f)];T.length&&d&&d(T),x.length&&i&&i(p(x));return{decorations:g.remove(f).add(e.doc,x),regex:r,aliasToSpec:l}}},props:{decorations:e=>o.DecorationSet.create(e.doc,s.getState(e)?.decorations.find()||[])}})},exports.defaultAliasDecoration=(e,t,r,n,a)=>{const s=a.aliasToSpec[r];return o.Decoration.inline(e,t,{class:"autoLink"},s)},exports.linksKey=s;
|
package/dist/plugin.d.ts
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
|
-
import { Plugin, PluginKey } from "prosemirror-state";
|
|
2
|
-
import { Decoration } from "prosemirror-view";
|
|
3
|
-
import { Node } from "prosemirror-model";
|
|
4
|
-
import { LinksKeyState, SpecObject, SpecWithAlias } from "./types";
|
|
5
|
-
export declare const linksKey: PluginKey<LinksKeyState<any>>;
|
|
6
|
-
export declare const autoLinkingPlugin: <T extends SpecObject>(aliasesWithSpec: SpecWithAlias<T
|
|
1
|
+
import { Plugin, PluginKey } from "prosemirror-state";
|
|
2
|
+
import { Decoration } from "prosemirror-view";
|
|
3
|
+
import { Node } from "prosemirror-model";
|
|
4
|
+
import { LinksKeyState, SpecObject, SpecWithAlias } from "./types";
|
|
5
|
+
export declare const linksKey: PluginKey<LinksKeyState<any>>;
|
|
6
|
+
export declare const autoLinkingPlugin: <T extends SpecObject>(aliasesWithSpec: Array<SpecWithAlias<T>>, createAliasDecoration: (start: number, end: number, alias: string, matchPos: number, pluginState: LinksKeyState<T>, doc: Node) => Decoration, onLinkAdd?: (addedLinks: Array<SpecWithAlias<T>>) => void, onLinkRemove?: (removedLinks: Array<SpecWithAlias<T>>) => void, regexGenerator?: (aliases: string[]) => RegExp) => Plugin<LinksKeyState<T>>;
|
|
7
|
+
//# sourceMappingURL=plugin.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"plugin.d.ts","sourceRoot":"","sources":["../src/plugin.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,SAAS,EAAe,MAAM,mBAAmB,CAAC;AACnE,OAAO,EAAE,UAAU,EAAiB,MAAM,kBAAkB,CAAC;AAE7D,OAAO,EAAE,IAAI,EAAE,MAAM,mBAAmB,CAAC;AACzC,OAAO,EACL,aAAa,EAGb,UAAU,EACV,aAAa,EACd,MAAM,SAAS,CAAC;AAIjB,eAAO,MAAM,QAAQ,+BAA6C,CAAC;AAEnE,eAAO,MAAM,iBAAiB,GAAI,CAAC,SAAS,UAAU,EACpD,iBAAiB,KAAK,CAAC,aAAa,CAAC,CAAC,CAAC,CAAC,EACxC,uBAAuB,CACrB,KAAK,EAAE,MAAM,EACb,GAAG,EAAE,MAAM,EACX,KAAK,EAAE,MAAM,EACb,QAAQ,EAAE,MAAM,EAChB,WAAW,EAAE,aAAa,CAAC,CAAC,CAAC,EAC7B,GAAG,EAAE,IAAI,KACN,UAAU,EACf,YAAY,CAAC,UAAU,EAAE,KAAK,CAAC,aAAa,CAAC,CAAC,CAAC,CAAC,KAAK,IAAI,EACzD,eAAe,CAAC,YAAY,EAAE,KAAK,CAAC,aAAa,CAAC,CAAC,CAAC,CAAC,KAAK,IAAI,EAC9D,iBAAgB,CAAC,OAAO,EAAE,MAAM,EAAE,KAAK,MAAsB,6BA2H9D,CAAC"}
|
|
@@ -1,8 +1,9 @@
|
|
|
1
|
-
import { Node } from "prosemirror-model";
|
|
2
|
-
export interface NodeWithPos {
|
|
3
|
-
node: Node;
|
|
4
|
-
pos: number;
|
|
5
|
-
}
|
|
6
|
-
export declare const flatten: (node: Node, descend?: boolean) => NodeWithPos[];
|
|
7
|
-
export declare const findChildren: (node: Node, predicate: (child: Node) => boolean, descend: boolean) => NodeWithPos[];
|
|
8
|
-
export declare const findTextNodes: (node: Node, descend?: boolean) => NodeWithPos[];
|
|
1
|
+
import { Node } from "prosemirror-model";
|
|
2
|
+
export interface NodeWithPos {
|
|
3
|
+
node: Node;
|
|
4
|
+
pos: number;
|
|
5
|
+
}
|
|
6
|
+
export declare const flatten: (node: Node, descend?: boolean) => NodeWithPos[];
|
|
7
|
+
export declare const findChildren: (node: Node, predicate: (child: Node) => boolean, descend: boolean) => NodeWithPos[];
|
|
8
|
+
export declare const findTextNodes: (node: Node, descend?: boolean) => NodeWithPos[];
|
|
9
|
+
//# sourceMappingURL=prosemirror-utils.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"prosemirror-utils.d.ts","sourceRoot":"","sources":["../src/prosemirror-utils.ts"],"names":[],"mappings":"AAQA,OAAO,EAAE,IAAI,EAAE,MAAM,mBAAmB,CAAC;AAEzC,MAAM,WAAW,WAAW;IAC1B,IAAI,EAAE,IAAI,CAAC;IACX,GAAG,EAAE,MAAM,CAAC;CACb;AACD,eAAO,MAAM,OAAO,GAAI,MAAM,IAAI,EAAE,iBAAc,kBAajD,CAAC;AAQF,eAAO,MAAM,YAAY,GACvB,MAAM,IAAI,EACV,WAAW,CAAC,KAAK,EAAE,IAAI,KAAK,OAAO,EACnC,SAAS,OAAO,kBAQjB,CAAC;AAQF,eAAO,MAAM,aAAa,GAAI,MAAM,IAAI,EAAE,iBAAc,kBAEvD,CAAC"}
|
package/dist/types.d.ts
CHANGED
|
@@ -1,20 +1,21 @@
|
|
|
1
|
-
import { DecorationSet } from "prosemirror-view";
|
|
2
|
-
export type SpecObject = Record<string, any>;
|
|
3
|
-
export type SpecWithAlias<Spec extends SpecObject> = Spec & {
|
|
4
|
-
alias: string;
|
|
5
|
-
};
|
|
6
|
-
export interface LinksKeyState<Spec extends SpecObject = {
|
|
7
|
-
alias: string;
|
|
8
|
-
}> {
|
|
9
|
-
decorations: DecorationSet;
|
|
10
|
-
regex: RegExp;
|
|
11
|
-
aliasToSpec: Record<string, SpecWithAlias<Spec>>;
|
|
12
|
-
}
|
|
13
|
-
export declare enum LinksMetaType {
|
|
14
|
-
linkUpdate = "linkUpdate"
|
|
15
|
-
}
|
|
16
|
-
export interface LinksUpdateMeta<Spec extends SpecObject> {
|
|
17
|
-
type: LinksMetaType.linkUpdate;
|
|
18
|
-
specs: Array<SpecWithAlias<Spec>>;
|
|
19
|
-
}
|
|
20
|
-
export type LinksMeta<Spec extends SpecObject> = LinksUpdateMeta<Spec>;
|
|
1
|
+
import { DecorationSet } from "prosemirror-view";
|
|
2
|
+
export type SpecObject = Record<string, any>;
|
|
3
|
+
export type SpecWithAlias<Spec extends SpecObject> = Spec & {
|
|
4
|
+
alias: string;
|
|
5
|
+
};
|
|
6
|
+
export interface LinksKeyState<Spec extends SpecObject = {
|
|
7
|
+
alias: string;
|
|
8
|
+
}> {
|
|
9
|
+
decorations: DecorationSet;
|
|
10
|
+
regex: RegExp;
|
|
11
|
+
aliasToSpec: Record<string, SpecWithAlias<Spec>>;
|
|
12
|
+
}
|
|
13
|
+
export declare enum LinksMetaType {
|
|
14
|
+
linkUpdate = "linkUpdate"
|
|
15
|
+
}
|
|
16
|
+
export interface LinksUpdateMeta<Spec extends SpecObject> {
|
|
17
|
+
type: LinksMetaType.linkUpdate;
|
|
18
|
+
specs: Array<SpecWithAlias<Spec>>;
|
|
19
|
+
}
|
|
20
|
+
export type LinksMeta<Spec extends SpecObject> = LinksUpdateMeta<Spec>;
|
|
21
|
+
//# sourceMappingURL=types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;AAEjD,MAAM,MAAM,UAAU,GAAG,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;AAC7C,MAAM,MAAM,aAAa,CAAC,IAAI,SAAS,UAAU,IAAI,IAAI,GAAG;IAAE,KAAK,EAAE,MAAM,CAAA;CAAE,CAAC;AAC9E,MAAM,WAAW,aAAa,CAAC,IAAI,SAAS,UAAU,GAAG;IAAE,KAAK,EAAE,MAAM,CAAA;CAAE;IAExE,WAAW,EAAE,aAAa,CAAC;IAC3B,KAAK,EAAE,MAAM,CAAC;IACd,WAAW,EAAE,MAAM,CAAC,MAAM,EAAE,aAAa,CAAC,IAAI,CAAC,CAAC,CAAC;CAClD;AAED,oBAAY,aAAa;IACvB,UAAU,eAAe;CAC1B;AAED,MAAM,WAAW,eAAe,CAAC,IAAI,SAAS,UAAU;IACtD,IAAI,EAAE,aAAa,CAAC,UAAU,CAAC;IAC/B,KAAK,EAAE,KAAK,CAAC,aAAa,CAAC,IAAI,CAAC,CAAC,CAAC;CACnC;AAED,MAAM,MAAM,SAAS,CAAC,IAAI,SAAS,UAAU,IAAI,eAAe,CAAC,IAAI,CAAC,CAAC"}
|
package/dist/utils.d.ts
CHANGED
|
@@ -1,8 +1,9 @@
|
|
|
1
|
-
import { Transaction } from "prosemirror-state";
|
|
2
|
-
import { SpecObject } from "./types";
|
|
3
|
-
export declare const generateRegex: (aliases: string[]) => RegExp;
|
|
4
|
-
export declare const getTransactionRange: (tr: Transaction) => {
|
|
5
|
-
start: number;
|
|
6
|
-
end: number;
|
|
7
|
-
};
|
|
8
|
-
export declare const specEquals: (specA: SpecObject, specB: SpecObject) => boolean;
|
|
1
|
+
import { Transaction } from "prosemirror-state";
|
|
2
|
+
import { SpecObject } from "./types";
|
|
3
|
+
export declare const generateRegex: (aliases: string[]) => RegExp;
|
|
4
|
+
export declare const getTransactionRange: (tr: Transaction) => {
|
|
5
|
+
start: number;
|
|
6
|
+
end: number;
|
|
7
|
+
};
|
|
8
|
+
export declare const specEquals: (specA: SpecObject, specB: SpecObject) => boolean;
|
|
9
|
+
//# sourceMappingURL=utils.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../src/utils.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAChD,OAAO,EAAE,UAAU,EAAE,MAAM,SAAS,CAAC;AAErC,eAAO,MAAM,aAAa,GAAI,SAAS,MAAM,EAAE,KAAG,MASjD,CAAC;AAEF,eAAO,MAAM,mBAAmB,GAAI,IAAI,WAAW;;;CAclD,CAAC;AAEF,eAAO,MAAM,UAAU,GAAI,OAAO,UAAU,EAAE,OAAO,UAAU,YAO9D,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,27 +1,14 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "prosemirror-link-plugin",
|
|
3
|
-
"version": "1.3.
|
|
3
|
+
"version": "1.3.1",
|
|
4
4
|
"description": "ProseMirror plugin for automatic links",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"module": "dist/index.es.js",
|
|
7
7
|
"types": "dist/index.d.ts",
|
|
8
|
-
"scripts": {
|
|
9
|
-
"prebuild": "rimraf dist",
|
|
10
|
-
"build": "rollup -c --bundleConfigAsCjs",
|
|
11
|
-
"dev": "rollup -c -w --bundleConfigAsCjs",
|
|
12
|
-
"format": "eslint src --ext .ts --fix",
|
|
13
|
-
"prepublishOnly": "npm run build && npm test && npm run lint",
|
|
14
|
-
"version": "npm run format && git add -A src",
|
|
15
|
-
"postversion": "git push && git push --tags",
|
|
16
|
-
"lint": "tsc --project tsconfig.json --noEmit && eslint src --ext .ts",
|
|
17
|
-
"test": "jest",
|
|
18
|
-
"upgrade-interactive": "npm-check --update",
|
|
19
|
-
"install-peers": "npm-install-peers",
|
|
20
|
-
"publish:np": "np"
|
|
21
|
-
},
|
|
22
8
|
"repository": {
|
|
23
9
|
"type": "git",
|
|
24
|
-
"url": "git+https://
|
|
10
|
+
"url": "git+https://github.com/emergence-engineering/emergence-tools.git",
|
|
11
|
+
"directory": "packages/prosemirror-link-plugin"
|
|
25
12
|
},
|
|
26
13
|
"files": [
|
|
27
14
|
"dist/**/*"
|
|
@@ -34,49 +21,49 @@
|
|
|
34
21
|
],
|
|
35
22
|
"license": "ISC",
|
|
36
23
|
"bugs": {
|
|
37
|
-
"url": "https://
|
|
24
|
+
"url": "https://github.com/emergence-engineering/emergence-tools/issues"
|
|
25
|
+
},
|
|
26
|
+
"homepage": "https://github.com/emergence-engineering/emergence-tools/tree/main/packages/prosemirror-link-plugin#readme",
|
|
27
|
+
"publishConfig": {
|
|
28
|
+
"access": "public"
|
|
29
|
+
},
|
|
30
|
+
"dependencies": {
|
|
31
|
+
"orderedmap": "^2.1.0"
|
|
38
32
|
},
|
|
39
|
-
"homepage": "https://gitlab.com/emergence-engineering/prosemirror-link-plugin#readme",
|
|
40
33
|
"peerDependencies": {
|
|
41
34
|
"prosemirror-commands": "^1.1.4",
|
|
42
35
|
"prosemirror-model": "^1.11.0",
|
|
43
36
|
"prosemirror-state": "^1.3.3",
|
|
37
|
+
"prosemirror-tables": "^1.3.0",
|
|
38
|
+
"prosemirror-transform": "^1.7.0",
|
|
44
39
|
"prosemirror-view": "^1.15.5"
|
|
45
40
|
},
|
|
46
41
|
"devDependencies": {
|
|
47
42
|
"@types/jest": "^29.2.4",
|
|
48
|
-
"@typescript-eslint/eslint-plugin": "^5.46.1",
|
|
49
|
-
"@typescript-eslint/parser": "^5.46.1",
|
|
50
|
-
"eslint": "^8.29.0",
|
|
51
|
-
"eslint-config-airbnb": "^19.0.4",
|
|
52
|
-
"eslint-config-prettier": "^8.5.0",
|
|
53
|
-
"eslint-plugin-import": "^2.26.0",
|
|
54
|
-
"eslint-plugin-jest": "^27.1.6",
|
|
55
|
-
"eslint-plugin-jsx-a11y": "^6.6.1",
|
|
56
|
-
"eslint-plugin-prettier": "^4.2.1",
|
|
57
|
-
"eslint-plugin-react": "^7.31.11",
|
|
58
43
|
"jest": "^29.3.1",
|
|
59
|
-
"
|
|
60
|
-
"
|
|
61
|
-
"prettier": "^2.8.1",
|
|
44
|
+
"prosemirror-commands": "^1.1.4",
|
|
45
|
+
"prosemirror-model": "^1.11.0",
|
|
62
46
|
"prosemirror-schema-basic": "^1.2.0",
|
|
63
47
|
"prosemirror-schema-list": "^1.2.2",
|
|
48
|
+
"prosemirror-state": "^1.3.3",
|
|
49
|
+
"prosemirror-tables": "^1.3.0",
|
|
64
50
|
"prosemirror-test-builder": "^1.1.0",
|
|
51
|
+
"prosemirror-transform": "^1.7.0",
|
|
52
|
+
"prosemirror-view": "^1.15.5",
|
|
53
|
+
"rimraf": "^5.0.0",
|
|
65
54
|
"rollup": "^3.7.4",
|
|
66
55
|
"rollup-plugin-minification": "^0.2.0",
|
|
67
56
|
"rollup-plugin-typescript2": "^0.34.1",
|
|
68
57
|
"ts-jest": "^29.0.3",
|
|
69
58
|
"tslib": "^2.4.1",
|
|
70
|
-
"typescript": "^
|
|
59
|
+
"typescript": "^5.2.2"
|
|
71
60
|
},
|
|
72
|
-
"
|
|
73
|
-
"
|
|
74
|
-
"
|
|
75
|
-
"
|
|
76
|
-
"
|
|
77
|
-
"
|
|
78
|
-
"
|
|
79
|
-
"prosemirror-transform": "^1.7.0",
|
|
80
|
-
"prosemirror-view": "^1.15.5"
|
|
61
|
+
"scripts": {
|
|
62
|
+
"prebuild": "rimraf dist",
|
|
63
|
+
"build": "rollup -c --bundleConfigAsCjs",
|
|
64
|
+
"dev": "rollup -c -w --bundleConfigAsCjs",
|
|
65
|
+
"format": "echo 'no formatter configured'",
|
|
66
|
+
"lint": "tsc --noEmit",
|
|
67
|
+
"test": "jest"
|
|
81
68
|
}
|
|
82
|
-
}
|
|
69
|
+
}
|