@portabletext/plugin-paste-link 4.0.43 → 4.0.44

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/index.d.ts CHANGED
@@ -1,59 +1,50 @@
1
- import {BehaviorGuard} from '@portabletext/editor/behaviors'
2
- import type {EditorContext} from '@portabletext/editor'
3
- import {NativeBehaviorEvent} from '@portabletext/editor/behaviors'
4
-
1
+ import { EditorContext } from "@portabletext/editor";
2
+ import { BehaviorGuard, NativeBehaviorEvent } from "@portabletext/editor/behaviors";
5
3
  /**
6
- * Function that converts a pasted URL into a link annotation.
7
- * Return `undefined` to skip handling.
4
+ * Guard function that controls when the paste link behavior runs.
5
+ * Return `false` to skip the behavior and fall through to default paste handling.
8
6
  * @public
9
7
  */
10
- export declare type LinkMatcher = (params: {
11
- context: LinkMatcherContext
12
- value: LinkMatcherValue
13
- }) => LinkMatcherResult | undefined
14
-
8
+ type PasteLinkGuard = BehaviorGuard<Extract<NativeBehaviorEvent, {
9
+ type: 'clipboard.paste';
10
+ }>, true>;
15
11
  /**
16
12
  * Context provided to link matchers.
17
13
  * @public
18
14
  */
19
- export declare type LinkMatcherContext = Pick<
20
- EditorContext,
21
- 'schema' | 'keyGenerator'
22
- >
23
-
15
+ type LinkMatcherContext = Pick<EditorContext, 'schema' | 'keyGenerator'>;
16
+ /**
17
+ * Value provided to link matchers.
18
+ * @public
19
+ */
20
+ type LinkMatcherValue = {
21
+ href: string;
22
+ };
24
23
  /**
25
24
  * Object returned by link matchers.
26
25
  * @public
27
26
  */
28
- export declare type LinkMatcherResult = {
29
- _type: string
30
- _key?: string
31
- [other: string]: unknown
32
- }
33
-
27
+ type LinkMatcherResult = {
28
+ _type: string;
29
+ _key?: string;
30
+ [other: string]: unknown;
31
+ };
34
32
  /**
35
- * Value provided to link matchers.
33
+ * Function that converts a pasted URL into a link annotation.
34
+ * Return `undefined` to skip handling.
36
35
  * @public
37
36
  */
38
- export declare type LinkMatcherValue = {
39
- href: string
40
- }
41
-
37
+ type LinkMatcher = (params: {
38
+ context: LinkMatcherContext;
39
+ value: LinkMatcherValue;
40
+ }) => LinkMatcherResult | undefined;
42
41
  /**
43
- * Guard function that controls when the paste link behavior runs.
44
- * Return `false` to skip the behavior and fall through to default paste handling.
45
42
  * @public
46
43
  */
47
- export declare type PasteLinkGuard = BehaviorGuard<
48
- Extract<
49
- NativeBehaviorEvent,
50
- {
51
- type: 'clipboard.paste'
52
- }
53
- >,
54
- true
55
- >
56
-
44
+ type PasteLinkPluginProps = {
45
+ guard?: PasteLinkGuard;
46
+ link?: LinkMatcher;
47
+ };
57
48
  /**
58
49
  * Plugin that handles pasting URLs in the editor.
59
50
  *
@@ -62,17 +53,6 @@ export declare type PasteLinkGuard = BehaviorGuard<
62
53
  *
63
54
  * @public
64
55
  */
65
- export declare function PasteLinkPlugin({
66
- guard,
67
- link,
68
- }: PasteLinkPluginProps): null
69
-
70
- /**
71
- * @public
72
- */
73
- export declare type PasteLinkPluginProps = {
74
- guard?: PasteLinkGuard
75
- link?: LinkMatcher
76
- }
77
-
78
- export {}
56
+ declare function PasteLinkPlugin({ guard, link }: PasteLinkPluginProps): null;
57
+ export { type LinkMatcher, type LinkMatcherContext, type LinkMatcherResult, type LinkMatcherValue, type PasteLinkGuard, PasteLinkPlugin, type PasteLinkPluginProps };
58
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","names":[],"sources":["../src/plugin.paste-link.tsx"],"mappings":";;;;;;;KAkBY,iBAAiB,cAC3B,QAAQ;EAAsB;;;;;;KAQpB,qBAAqB,KAAK;;;;;KAM1B;EAAoB;;;;;;KAMpB;EACV;EACA;GACC;;;;;;;KAQS,eAAe;EACzB,SAAS;EACT,OAAO;MACH;;;;KAKM;EACV,QAAQ;EACR,OAAO;;;;;;;;;;iBA6BO,kBACd,OACA,QACC"}
package/dist/index.js CHANGED
@@ -5,156 +5,120 @@ import * as selectors from "@portabletext/editor/selectors";
5
5
  import { getPathSubSchema } from "@portabletext/editor/traversal";
6
6
  import { useEffect } from "react";
7
7
  function looksLikeUrl(text) {
8
- try {
9
- const url = new URL(text);
10
- return sensibleProtocols.includes(url.protocol);
11
- } catch {
12
- return !1;
13
- }
8
+ try {
9
+ let url = new URL(text);
10
+ return sensibleProtocols.includes(url.protocol);
11
+ } catch {
12
+ return !1;
13
+ }
14
14
  }
15
- const sensibleProtocols = ["http:", "https:", "mailto:", "tel:"], defaultLinkMatcher = ({
16
- context,
17
- value
18
- }) => {
19
- const schemaType = context.schema.annotations.find((annotation) => annotation.name === "link"), hrefField = schemaType?.fields.find((field) => field.name === "href" && field.type === "string");
20
- if (!(!schemaType || !hrefField))
21
- return {
22
- _type: schemaType.name,
23
- [hrefField.name]: value.href
24
- };
15
+ const sensibleProtocols = [
16
+ "http:",
17
+ "https:",
18
+ "mailto:",
19
+ "tel:"
20
+ ], defaultLinkMatcher = ({ context, value }) => {
21
+ let schemaType = context.schema.annotations.find((annotation) => annotation.name === "link"), hrefField = schemaType?.fields.find((field) => field.name === "href" && field.type === "string");
22
+ if (!(!schemaType || !hrefField)) return {
23
+ _type: schemaType.name,
24
+ [hrefField.name]: value.href
25
+ };
25
26
  };
27
+ /**
28
+ * Plugin that handles pasting URLs in the editor.
29
+ *
30
+ * When text is selected and a URL is pasted, adds a link annotation to the selection.
31
+ * When the caret is collapsed (no selection) and a URL is pasted, inserts the URL as text with a link annotation.
32
+ *
33
+ * @public
34
+ */
26
35
  function PasteLinkPlugin(t0) {
27
- const $ = c(5), {
28
- guard,
29
- link: t1
30
- } = t0, link = t1 === void 0 ? defaultLinkMatcher : t1, editor = useEditor();
31
- let t2, t3;
32
- return $[0] !== editor || $[1] !== guard || $[2] !== link ? (t2 = () => {
33
- const unregisterBehaviors = createPasteLinkBehaviors({
34
- guard,
35
- link
36
- }).map((behavior) => editor.registerBehavior({
37
- behavior
38
- }));
39
- return () => {
40
- for (const unregisterBehavior of unregisterBehaviors)
41
- unregisterBehavior();
42
- };
43
- }, t3 = [editor, guard, link], $[0] = editor, $[1] = guard, $[2] = link, $[3] = t2, $[4] = t3) : (t2 = $[3], t3 = $[4]), useEffect(t2, t3), null;
36
+ let $ = c(5), { guard, link: t1 } = t0, link = t1 === void 0 ? defaultLinkMatcher : t1, editor = useEditor(), t2, t3;
37
+ return $[0] !== editor || $[1] !== guard || $[2] !== link ? (t2 = () => {
38
+ let unregisterBehaviors = createPasteLinkBehaviors({
39
+ guard,
40
+ link
41
+ }).map((behavior) => editor.registerBehavior({ behavior }));
42
+ return () => {
43
+ for (let unregisterBehavior of unregisterBehaviors) unregisterBehavior();
44
+ };
45
+ }, t3 = [
46
+ editor,
47
+ guard,
48
+ link
49
+ ], $[0] = editor, $[1] = guard, $[2] = link, $[3] = t2, $[4] = t3) : (t2 = $[3], t3 = $[4]), useEffect(t2, t3), null;
44
50
  }
45
51
  function createPasteLinkBehaviors(config) {
46
- const pasteLinkOnSelection = defineBehavior({
47
- on: "clipboard.paste",
48
- guard: (guardParams) => {
49
- if (config.guard && config.guard(guardParams) === !1)
50
- return !1;
51
- const {
52
- snapshot,
53
- event
54
- } = guardParams, selectionCollapsed = selectors.isSelectionCollapsed(snapshot), focusBlock = selectors.getFocusBlock(snapshot);
55
- if (selectionCollapsed || !focusBlock)
56
- return !1;
57
- const text = event.originEvent.dataTransfer.getData("text/plain"), href = looksLikeUrl(text) ? text : void 0;
58
- if (!href)
59
- return !1;
60
- const result = config.link({
61
- context: {
62
- schema: getPathSubSchema(snapshot, focusBlock.path),
63
- keyGenerator: snapshot.context.keyGenerator
64
- },
65
- value: {
66
- href
67
- }
68
- });
69
- if (!result)
70
- return !1;
71
- const {
72
- _type,
73
- _key,
74
- ...value
75
- } = result;
76
- return {
77
- annotation: {
78
- name: _type,
79
- _key,
80
- value
81
- }
82
- };
83
- },
84
- actions: [(_, {
85
- annotation
86
- }) => [raise({
87
- type: "annotation.add",
88
- annotation
89
- })]]
90
- }), pasteLinkAtCaret = defineBehavior({
91
- on: "clipboard.paste",
92
- guard: (guardParams) => {
93
- if (config.guard && config.guard(guardParams) === !1)
94
- return !1;
95
- const {
96
- snapshot,
97
- event
98
- } = guardParams, focusTextBlock = selectors.getFocusTextBlock(snapshot), selectionCollapsed = selectors.isSelectionCollapsed(snapshot);
99
- if (!focusTextBlock || !selectionCollapsed)
100
- return !1;
101
- const text = event.originEvent.dataTransfer.getData("text/plain"), href = looksLikeUrl(text) ? text : void 0;
102
- if (!href)
103
- return !1;
104
- const subSchema = getPathSubSchema(snapshot, focusTextBlock.path), result = config.link({
105
- context: {
106
- schema: subSchema,
107
- keyGenerator: snapshot.context.keyGenerator
108
- },
109
- value: {
110
- href
111
- }
112
- });
113
- if (!result)
114
- return !1;
115
- const {
116
- _type,
117
- _key,
118
- ...value
119
- } = result, markState = selectors.getMarkState(snapshot), decoratorNames = subSchema.decorators.map((decorator) => decorator.name), activeDecorators = (markState?.marks ?? []).filter((mark) => decoratorNames.includes(mark)), markDefKey = _key ?? snapshot.context.keyGenerator(), markDef = {
120
- _type,
121
- _key: markDefKey,
122
- ...value
123
- };
124
- return {
125
- focusTextBlock,
126
- markDef,
127
- markDefKey,
128
- href,
129
- activeDecorators
130
- };
131
- },
132
- actions: [({
133
- snapshot
134
- }, {
135
- focusTextBlock,
136
- markDef,
137
- markDefKey,
138
- href,
139
- activeDecorators
140
- }) => [raise({
141
- type: "block.set",
142
- at: focusTextBlock.path,
143
- props: {
144
- markDefs: [...focusTextBlock.node.markDefs ?? [], markDef]
145
- }
146
- }), raise({
147
- type: "insert.child",
148
- child: {
149
- _type: snapshot.context.schema.span.name,
150
- text: href,
151
- marks: [...activeDecorators, markDefKey]
152
- }
153
- })]]
154
- });
155
- return [pasteLinkOnSelection, pasteLinkAtCaret];
52
+ return [defineBehavior({
53
+ on: "clipboard.paste",
54
+ guard: (guardParams) => {
55
+ if (config.guard && config.guard(guardParams) === !1) return !1;
56
+ let { snapshot, event } = guardParams, selectionCollapsed = selectors.isSelectionCollapsed(snapshot), focusBlock = selectors.getFocusBlock(snapshot);
57
+ if (selectionCollapsed || !focusBlock) return !1;
58
+ let text = event.originEvent.dataTransfer.getData("text/plain"), href = looksLikeUrl(text) ? text : void 0;
59
+ if (!href) return !1;
60
+ let result = config.link({
61
+ context: {
62
+ schema: getPathSubSchema(snapshot, focusBlock.path),
63
+ keyGenerator: snapshot.context.keyGenerator
64
+ },
65
+ value: { href }
66
+ });
67
+ if (!result) return !1;
68
+ let { _type, _key, ...value } = result;
69
+ return { annotation: {
70
+ name: _type,
71
+ _key,
72
+ value
73
+ } };
74
+ },
75
+ actions: [(_, { annotation }) => [raise({
76
+ type: "annotation.add",
77
+ annotation
78
+ })]]
79
+ }), defineBehavior({
80
+ on: "clipboard.paste",
81
+ guard: (guardParams) => {
82
+ if (config.guard && config.guard(guardParams) === !1) return !1;
83
+ let { snapshot, event } = guardParams, focusTextBlock = selectors.getFocusTextBlock(snapshot), selectionCollapsed = selectors.isSelectionCollapsed(snapshot);
84
+ if (!focusTextBlock || !selectionCollapsed) return !1;
85
+ let text = event.originEvent.dataTransfer.getData("text/plain"), href = looksLikeUrl(text) ? text : void 0;
86
+ if (!href) return !1;
87
+ let subSchema = getPathSubSchema(snapshot, focusTextBlock.path), result = config.link({
88
+ context: {
89
+ schema: subSchema,
90
+ keyGenerator: snapshot.context.keyGenerator
91
+ },
92
+ value: { href }
93
+ });
94
+ if (!result) return !1;
95
+ let { _type, _key, ...value } = result, markState = selectors.getMarkState(snapshot), decoratorNames = subSchema.decorators.map((decorator) => decorator.name), activeDecorators = (markState?.marks ?? []).filter((mark) => decoratorNames.includes(mark)), markDefKey = _key ?? snapshot.context.keyGenerator();
96
+ return {
97
+ focusTextBlock,
98
+ markDef: {
99
+ _type,
100
+ _key: markDefKey,
101
+ ...value
102
+ },
103
+ markDefKey,
104
+ href,
105
+ activeDecorators
106
+ };
107
+ },
108
+ actions: [({ snapshot }, { focusTextBlock, markDef, markDefKey, href, activeDecorators }) => [raise({
109
+ type: "block.set",
110
+ at: focusTextBlock.path,
111
+ props: { markDefs: [...focusTextBlock.node.markDefs ?? [], markDef] }
112
+ }), raise({
113
+ type: "insert.child",
114
+ child: {
115
+ _type: snapshot.context.schema.span.name,
116
+ text: href,
117
+ marks: [...activeDecorators, markDefKey]
118
+ }
119
+ })]]
120
+ })];
156
121
  }
157
- export {
158
- PasteLinkPlugin
159
- };
160
- //# sourceMappingURL=index.js.map
122
+ export { PasteLinkPlugin };
123
+
124
+ //# sourceMappingURL=index.js.map
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sources":["../src/looks-like-url.ts","../src/plugin.paste-link.tsx"],"sourcesContent":["export function looksLikeUrl(text: string) {\n try {\n const url = new URL(text)\n return sensibleProtocols.includes(url.protocol)\n } catch {\n return false\n }\n}\n\nconst sensibleProtocols = ['http:', 'https:', 'mailto:', 'tel:']\n","import type {EditorContext} from '@portabletext/editor'\nimport {useEditor} from '@portabletext/editor'\nimport {\n defineBehavior,\n raise,\n type BehaviorGuard,\n type NativeBehaviorEvent,\n} from '@portabletext/editor/behaviors'\nimport * as selectors from '@portabletext/editor/selectors'\nimport {getPathSubSchema} from '@portabletext/editor/traversal'\nimport {useEffect} from 'react'\nimport {looksLikeUrl} from './looks-like-url'\n\n/**\n * Guard function that controls when the paste link behavior runs.\n * Return `false` to skip the behavior and fall through to default paste handling.\n * @public\n */\nexport type PasteLinkGuard = BehaviorGuard<\n Extract<NativeBehaviorEvent, {type: 'clipboard.paste'}>,\n true\n>\n\n/**\n * Context provided to link matchers.\n * @public\n */\nexport type LinkMatcherContext = Pick<EditorContext, 'schema' | 'keyGenerator'>\n\n/**\n * Value provided to link matchers.\n * @public\n */\nexport type LinkMatcherValue = {href: string}\n\n/**\n * Object returned by link matchers.\n * @public\n */\nexport type LinkMatcherResult = {\n _type: string\n _key?: string\n [other: string]: unknown\n}\n\n/**\n * Function that converts a pasted URL into a link annotation.\n * Return `undefined` to skip handling.\n * @public\n */\nexport type LinkMatcher = (params: {\n context: LinkMatcherContext\n value: LinkMatcherValue\n}) => LinkMatcherResult | undefined\n\n/**\n * @public\n */\nexport type PasteLinkPluginProps = {\n guard?: PasteLinkGuard\n link?: LinkMatcher\n}\n\nconst defaultLinkMatcher: LinkMatcher = ({context, value}) => {\n const schemaType = context.schema.annotations.find(\n (annotation) => annotation.name === 'link',\n )\n const hrefField = schemaType?.fields.find(\n (field) => field.name === 'href' && field.type === 'string',\n )\n\n if (!schemaType || !hrefField) {\n return undefined\n }\n\n return {\n _type: schemaType.name,\n [hrefField.name]: value.href,\n }\n}\n\n/**\n * Plugin that handles pasting URLs in the editor.\n *\n * When text is selected and a URL is pasted, adds a link annotation to the selection.\n * When the caret is collapsed (no selection) and a URL is pasted, inserts the URL as text with a link annotation.\n *\n * @public\n */\nexport function PasteLinkPlugin({\n guard,\n link = defaultLinkMatcher,\n}: PasteLinkPluginProps) {\n const editor = useEditor()\n\n useEffect(() => {\n const behaviors = createPasteLinkBehaviors({guard, link})\n const unregisterBehaviors = behaviors.map((behavior) =>\n editor.registerBehavior({behavior}),\n )\n\n return () => {\n for (const unregisterBehavior of unregisterBehaviors) {\n unregisterBehavior()\n }\n }\n }, [editor, guard, link])\n\n return null\n}\n\nfunction createPasteLinkBehaviors(\n config: Required<Pick<PasteLinkPluginProps, 'link'>> &\n Pick<PasteLinkPluginProps, 'guard'>,\n) {\n /**\n * When text is selected and a URL is pasted, add a link annotation to the\n * selection. If the selection already has a link annotation, the core\n * `preventOverlappingAnnotations` behavior will remove it first.\n */\n const pasteLinkOnSelection = defineBehavior({\n on: 'clipboard.paste',\n guard: (guardParams) => {\n if (config.guard && config.guard(guardParams) === false) {\n return false\n }\n\n const {snapshot, event} = guardParams\n const selectionCollapsed = selectors.isSelectionCollapsed(snapshot)\n const focusBlock = selectors.getFocusBlock(snapshot)\n\n if (selectionCollapsed || !focusBlock) {\n return false\n }\n\n const text = event.originEvent.dataTransfer.getData('text/plain')\n const href = looksLikeUrl(text) ? text : undefined\n\n if (!href) {\n return false\n }\n\n const result = config.link({\n context: {\n schema: getPathSubSchema(snapshot, focusBlock.path),\n keyGenerator: snapshot.context.keyGenerator,\n },\n value: {href},\n })\n\n if (!result) {\n return false\n }\n\n const {_type, _key, ...value} = result\n\n return {annotation: {name: _type, _key, value}}\n },\n actions: [\n (_, {annotation}) => [\n raise({\n type: 'annotation.add',\n annotation,\n }),\n ],\n ],\n })\n\n /**\n * When the caret is collapsed (no selection) and a URL is pasted, insert the\n * URL as text with a link annotation. Existing decorators (bold, italic,\n * etc.) are preserved.\n */\n const pasteLinkAtCaret = defineBehavior({\n on: 'clipboard.paste',\n guard: (guardParams) => {\n if (config.guard && config.guard(guardParams) === false) {\n return false\n }\n\n const {snapshot, event} = guardParams\n const focusTextBlock = selectors.getFocusTextBlock(snapshot)\n const selectionCollapsed = selectors.isSelectionCollapsed(snapshot)\n\n if (!focusTextBlock || !selectionCollapsed) {\n return false\n }\n\n const text = event.originEvent.dataTransfer.getData('text/plain')\n const href = looksLikeUrl(text) ? text : undefined\n\n if (!href) {\n return false\n }\n\n const subSchema = getPathSubSchema(snapshot, focusTextBlock.path)\n const result = config.link({\n context: {\n schema: subSchema,\n keyGenerator: snapshot.context.keyGenerator,\n },\n value: {href},\n })\n\n if (!result) {\n return false\n }\n\n const {_type, _key, ...value} = result\n\n const markState = selectors.getMarkState(snapshot)\n const decoratorNames = subSchema.decorators.map(\n (decorator) => decorator.name,\n )\n const activeDecorators = (markState?.marks ?? []).filter((mark) =>\n decoratorNames.includes(mark),\n )\n\n const markDefKey = _key ?? snapshot.context.keyGenerator()\n const markDef = {\n _type,\n _key: markDefKey,\n ...value,\n }\n\n return {\n focusTextBlock,\n markDef,\n markDefKey,\n href,\n activeDecorators,\n }\n },\n actions: [\n (\n {snapshot},\n {focusTextBlock, markDef, markDefKey, href, activeDecorators},\n ) => [\n raise({\n type: 'block.set',\n at: focusTextBlock.path,\n props: {\n markDefs: [...(focusTextBlock.node.markDefs ?? []), markDef],\n },\n }),\n raise({\n type: 'insert.child',\n child: {\n _type: snapshot.context.schema.span.name,\n text: href,\n marks: [...activeDecorators, markDefKey],\n },\n }),\n ],\n ],\n })\n\n return [pasteLinkOnSelection, pasteLinkAtCaret]\n}\n"],"names":["looksLikeUrl","text","url","URL","sensibleProtocols","includes","protocol","defaultLinkMatcher","context","value","schemaType","schema","annotations","find","annotation","name","hrefField","fields","field","type","_type","href","PasteLinkPlugin","t0","$","_c","guard","link","t1","undefined","editor","useEditor","t2","t3","unregisterBehaviors","createPasteLinkBehaviors","map","behavior","registerBehavior","unregisterBehavior","useEffect","config","pasteLinkOnSelection","defineBehavior","on","guardParams","snapshot","event","selectionCollapsed","selectors","isSelectionCollapsed","focusBlock","getFocusBlock","originEvent","dataTransfer","getData","result","getPathSubSchema","path","keyGenerator","_key","actions","_","raise","pasteLinkAtCaret","focusTextBlock","getFocusTextBlock","subSchema","markState","getMarkState","decoratorNames","decorators","decorator","activeDecorators","marks","filter","mark","markDefKey","markDef","at","props","markDefs","node","child","span"],"mappings":";;;;;;AAAO,SAASA,aAAaC,MAAc;AACzC,MAAI;AACF,UAAMC,MAAM,IAAIC,IAAIF,IAAI;AACxB,WAAOG,kBAAkBC,SAASH,IAAII,QAAQ;AAAA,EAChD,QAAQ;AACN,WAAO;AAAA,EACT;AACF;AAEA,MAAMF,oBAAoB,CAAC,SAAS,UAAU,WAAW,MAAM,GCsDzDG,qBAAkCA,CAAC;AAAA,EAACC;AAAAA,EAASC;AAAK,MAAM;AAC5D,QAAMC,aAAaF,QAAQG,OAAOC,YAAYC,KAC3CC,CAAAA,eAAeA,WAAWC,SAAS,MACtC,GACMC,YAAYN,YAAYO,OAAOJ,KAClCK,CAAAA,UAAUA,MAAMH,SAAS,UAAUG,MAAMC,SAAS,QACrD;AAEA,MAAI,EAAA,CAACT,cAAc,CAACM;AAIpB,WAAO;AAAA,MACLI,OAAOV,WAAWK;AAAAA,MAClB,CAACC,UAAUD,IAAI,GAAGN,MA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AA;AAAA,IACzC,CACD,CAAC,CACH;AAAA,EAAA,CAEJ;AAED,SAAO,CAACnC,sBAAsBsB,gBAAgB;AAChD;"}
1
+ {"version":3,"file":"index.js","names":["looksLikeUrl","text","url","URL","sensibleProtocols","includes","protocol","EditorContext","useEditor","defineBehavior","raise","BehaviorGuard","NativeBehaviorEvent","selectors","getPathSubSchema","useEffect","looksLikeUrl","PasteLinkGuard","Extract","type","LinkMatcherContext","Pick","LinkMatcherValue","href","LinkMatcherResult","_type","_key","other","LinkMatcher","params","context","value","PasteLinkPluginProps","guard","link","defaultLinkMatcher","schemaType","schema","annotations","find","annotation","name","hrefField","fields","field","undefined","PasteLinkPlugin","t0","$","_c","t1","editor","t2","t3","behaviors","createPasteLinkBehaviors","unregisterBehaviors","map","behavior","registerBehavior","unregisterBehavior","config","Required","pasteLinkOnSelection","on","guardParams","snapshot","event","selectionCollapsed","isSelectionCollapsed","focusBlock","getFocusBlock","text","originEvent","dataTransfer","getData","result","path","keyGenerator","actions","_","pasteLinkAtCaret","focusTextBlock","getFocusTextBlock","subSchema","markState","getMarkState","decoratorNames","decorators","decorator","activeDecorators","marks","filter","mark","includes","markDefKey","markDef","at","props","markDefs","node","child","span"],"sources":["../src/looks-like-url.ts","../src/plugin.paste-link.tsx"],"sourcesContent":["export function looksLikeUrl(text: string) {\n try {\n const url = new URL(text)\n return sensibleProtocols.includes(url.protocol)\n } catch {\n return false\n }\n}\n\nconst sensibleProtocols = ['http:', 'https:', 'mailto:', 'tel:']\n","import type {EditorContext} from '@portabletext/editor'\nimport {useEditor} from '@portabletext/editor'\nimport {\n defineBehavior,\n raise,\n type BehaviorGuard,\n type NativeBehaviorEvent,\n} from '@portabletext/editor/behaviors'\nimport * as selectors from '@portabletext/editor/selectors'\nimport {getPathSubSchema} from '@portabletext/editor/traversal'\nimport {useEffect} from 'react'\nimport {looksLikeUrl} from './looks-like-url'\n\n/**\n * Guard function that controls when the paste link behavior runs.\n * Return `false` to skip the behavior and fall through to default paste handling.\n * @public\n */\nexport type PasteLinkGuard = BehaviorGuard<\n Extract<NativeBehaviorEvent, {type: 'clipboard.paste'}>,\n true\n>\n\n/**\n * Context provided to link matchers.\n * @public\n */\nexport type LinkMatcherContext = Pick<EditorContext, 'schema' | 'keyGenerator'>\n\n/**\n * Value provided to link matchers.\n * @public\n */\nexport type LinkMatcherValue = {href: string}\n\n/**\n * Object returned by link matchers.\n * @public\n */\nexport type LinkMatcherResult = {\n _type: string\n _key?: string\n [other: string]: unknown\n}\n\n/**\n * Function that converts a pasted URL into a link annotation.\n * Return `undefined` to skip handling.\n * @public\n */\nexport type LinkMatcher = (params: {\n context: LinkMatcherContext\n value: LinkMatcherValue\n}) => LinkMatcherResult | undefined\n\n/**\n * @public\n */\nexport type PasteLinkPluginProps = {\n guard?: PasteLinkGuard\n link?: LinkMatcher\n}\n\nconst defaultLinkMatcher: LinkMatcher = ({context, value}) => {\n const schemaType = context.schema.annotations.find(\n (annotation) => annotation.name === 'link',\n )\n const hrefField = schemaType?.fields.find(\n (field) => field.name === 'href' && field.type === 'string',\n )\n\n if (!schemaType || !hrefField) {\n return undefined\n }\n\n return {\n _type: schemaType.name,\n [hrefField.name]: value.href,\n }\n}\n\n/**\n * Plugin that handles pasting URLs in the editor.\n *\n * When text is selected and a URL is pasted, adds a link annotation to the selection.\n * When the caret is collapsed (no selection) and a URL is pasted, inserts the URL as text with a link annotation.\n *\n * @public\n */\nexport function PasteLinkPlugin({\n guard,\n link = defaultLinkMatcher,\n}: PasteLinkPluginProps) {\n const editor = useEditor()\n\n useEffect(() => {\n const behaviors = createPasteLinkBehaviors({guard, link})\n const unregisterBehaviors = behaviors.map((behavior) =>\n editor.registerBehavior({behavior}),\n )\n\n return () => {\n for (const unregisterBehavior of unregisterBehaviors) {\n unregisterBehavior()\n }\n }\n }, [editor, guard, link])\n\n return null\n}\n\nfunction createPasteLinkBehaviors(\n config: Required<Pick<PasteLinkPluginProps, 'link'>> &\n Pick<PasteLinkPluginProps, 'guard'>,\n) {\n /**\n * When text is selected and a URL is pasted, add a link annotation to the\n * selection. If the selection already has a link annotation, the core\n * `preventOverlappingAnnotations` behavior will remove it first.\n */\n const pasteLinkOnSelection = defineBehavior({\n on: 'clipboard.paste',\n guard: (guardParams) => {\n if (config.guard && config.guard(guardParams) === false) {\n return false\n }\n\n const {snapshot, event} = guardParams\n const selectionCollapsed = selectors.isSelectionCollapsed(snapshot)\n const focusBlock = selectors.getFocusBlock(snapshot)\n\n if (selectionCollapsed || !focusBlock) {\n return false\n }\n\n const text = event.originEvent.dataTransfer.getData('text/plain')\n const href = looksLikeUrl(text) ? text : undefined\n\n if (!href) {\n return false\n }\n\n const result = config.link({\n context: {\n schema: getPathSubSchema(snapshot, focusBlock.path),\n keyGenerator: snapshot.context.keyGenerator,\n },\n value: {href},\n })\n\n if (!result) {\n return false\n }\n\n const {_type, _key, ...value} = result\n\n return {annotation: {name: _type, _key, value}}\n },\n actions: [\n (_, {annotation}) => [\n raise({\n type: 'annotation.add',\n annotation,\n }),\n ],\n ],\n })\n\n /**\n * When the caret is collapsed (no selection) and a URL is pasted, insert the\n * URL as text with a link annotation. Existing decorators (bold, italic,\n * etc.) are preserved.\n */\n const pasteLinkAtCaret = defineBehavior({\n on: 'clipboard.paste',\n guard: (guardParams) => {\n if (config.guard && config.guard(guardParams) === false) {\n return false\n }\n\n const {snapshot, event} = guardParams\n const focusTextBlock = selectors.getFocusTextBlock(snapshot)\n const selectionCollapsed = selectors.isSelectionCollapsed(snapshot)\n\n if (!focusTextBlock || !selectionCollapsed) {\n return false\n }\n\n const text = event.originEvent.dataTransfer.getData('text/plain')\n const href = looksLikeUrl(text) ? text : undefined\n\n if (!href) {\n return false\n }\n\n const subSchema = getPathSubSchema(snapshot, focusTextBlock.path)\n const result = config.link({\n context: {\n schema: subSchema,\n keyGenerator: snapshot.context.keyGenerator,\n },\n value: {href},\n })\n\n if (!result) {\n return false\n }\n\n const {_type, _key, ...value} = result\n\n const markState = selectors.getMarkState(snapshot)\n const decoratorNames = subSchema.decorators.map(\n (decorator) => decorator.name,\n )\n const activeDecorators = (markState?.marks ?? []).filter((mark) =>\n decoratorNames.includes(mark),\n )\n\n const markDefKey = _key ?? snapshot.context.keyGenerator()\n const markDef = {\n _type,\n _key: markDefKey,\n ...value,\n }\n\n return {\n focusTextBlock,\n markDef,\n markDefKey,\n href,\n activeDecorators,\n }\n },\n actions: [\n (\n {snapshot},\n {focusTextBlock, markDef, markDefKey, href, activeDecorators},\n ) => [\n raise({\n type: 'block.set',\n at: focusTextBlock.path,\n props: {\n markDefs: [...(focusTextBlock.node.markDefs ?? []), markDef],\n },\n }),\n raise({\n type: 'insert.child',\n child: {\n _type: snapshot.context.schema.span.name,\n text: href,\n marks: [...activeDecorators, markDefKey],\n },\n }),\n ],\n ],\n })\n\n return [pasteLinkOnSelection, pasteLinkAtCaret]\n}\n"],"mappings":";;;;;;AAAA,SAAgBA,aAAaC,MAAc;CACzC,IAAI;EACF,IAAMC,MAAM,IAAIC,IAAIF,IAAI;EACxB,OAAOG,kBAAkBC,SAASH,IAAII,QAAQ;CAChD,QAAQ;EACN,OAAO;CACT;AACF;AAEA,MAAMF,oBAAoB;CAAC;CAAS;CAAU;CAAW;AAAM,GCsDzD+B,sBAAmC,EAACL,SAASC,YAAW;CAC5D,IAAMK,aAAaN,QAAQO,OAAOC,YAAYC,MAC3CC,eAAeA,WAAWC,SAAS,MACtC,GACMC,YAAYN,YAAYO,OAAOJ,MAClCK,UAAUA,MAAMH,SAAS,UAAUG,MAAMzB,SAAS,QACrD;CAEI,OAACiB,cAAc,CAACM,YAIpB,OAAO;EACLjB,OAAOW,WAAWK;GACjBC,UAAUD,OAAOV,MAAMR;CAC1B;AACF;;;;;;;;;AAUA,SAAOuB,gBAAAC,IAAA;CAAA,IAAAC,IAAAC,EAAA,CAAA,GAAyB,EAAAhB,OAAAC,MAAAgB,OAAAH,IAE9Bb,OAAAgB,OAAAL,KAAAA,IAAAV,qBAAAe,IAEAC,SAAe3C,UAAU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;EACAX,SAAS,EAEL,EAACb,YACD,EAACgB,gBAAgBc,SAASD,YAAYxE,MAAMmE,uBACzC,CACHhF,MAAM;GACJS,MAAM;GACN8E,IAAIf,eAAeL;GACnBqB,OAAO,EACLC,UAAU,CAAC,GAAIjB,eAAekB,KAAKD,YAAY,CAAA,GAAKH,OAAO,EAC7D;EACF,CAAC,GACDtF,MAAM;GACJS,MAAM;GACNkF,OAAO;IACL5E,OAAOyC,SAASpC,QAAQO,OAAOiE,KAAK7D;IACpC+B,MAAMjD;IACNoE,OAAO,CAAC,GAAGD,kBAAkBK,UAAU;GACzC;EACF,CAAC,CAAC,CACH;CAEL,CAE8Bd,CAAgB;AAChD"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@portabletext/plugin-paste-link",
3
- "version": "4.0.43",
3
+ "version": "4.0.44",
4
4
  "description": "Allow pasting links in the Portable Text Editor",
5
5
  "keywords": [
6
6
  "behaviors",
@@ -27,6 +27,7 @@
27
27
  "type": "module",
28
28
  "sideEffects": false,
29
29
  "main": "./dist/index.js",
30
+ "module": "./dist/index.js",
30
31
  "types": "./dist/index.d.ts",
31
32
  "exports": {
32
33
  ".": "./dist/index.js",
@@ -36,10 +37,11 @@
36
37
  "access": "public"
37
38
  },
38
39
  "devDependencies": {
39
- "@sanity/pkg-utils": "^10.8.2",
40
+ "@rolldown/plugin-babel": "^0.2.3",
41
+ "@sanity/pkg-utils": "^12.1.0",
40
42
  "@sanity/tsconfig": "^2.1.0",
41
43
  "@types/react": "^19.2.17",
42
- "@vitejs/plugin-react": "^5.2.0",
44
+ "@vitejs/plugin-react": "^6.0.5",
43
45
  "@vitest/browser": "^4.1.10",
44
46
  "@vitest/browser-playwright": "^4.1.10",
45
47
  "babel-plugin-react-compiler": "^1.0.0",
@@ -48,20 +50,20 @@
48
50
  "react": "^19.2.7",
49
51
  "typescript": "6.0.3",
50
52
  "typescript-eslint": "^8.62.0",
51
- "vite": "^7.3.5",
53
+ "vite": "^8.2.0",
52
54
  "vitest": "^4.1.10",
53
- "@portabletext/editor": "^7.10.16",
54
- "racejar": "2.0.10"
55
+ "@portabletext/editor": "^7.10.17",
56
+ "racejar": "2.0.11"
55
57
  },
56
58
  "peerDependencies": {
57
59
  "react": "^19.2",
58
- "@portabletext/editor": "^7.10.16"
60
+ "@portabletext/editor": "^7.10.17"
59
61
  },
60
62
  "engines": {
61
63
  "node": ">=20.19 <22 || >=22.12"
62
64
  },
63
65
  "scripts": {
64
- "build": "pkg-utils build --strict --check --clean",
66
+ "build": "pkg-utils build --strict --check",
65
67
  "check:lint": "biome lint .",
66
68
  "check:react-compiler": "eslint .",
67
69
  "check:types": "tsc",