@ampless/plugin-youtube 1.0.0-alpha.3 → 1.0.0-alpha.5
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/editor.d.ts +9 -1
- package/dist/editor.js +11 -1
- package/package.json +4 -3
package/dist/editor.d.ts
CHANGED
|
@@ -26,5 +26,13 @@ declare const AmplessYoutubeNode: Node<any, any>;
|
|
|
26
26
|
declare const youtubeEditor: {
|
|
27
27
|
extension: Node<any, any>;
|
|
28
28
|
};
|
|
29
|
+
/**
|
|
30
|
+
* Canonical named export consumed by the codegen'd
|
|
31
|
+
* `_editor-bootstrap.tsx`. Plugins MUST export this symbol from
|
|
32
|
+
* their `./editor` module (= the subpath declared in
|
|
33
|
+
* `package.json#amplessPlugin.editorExports`) for the
|
|
34
|
+
* auto-wiring to find them.
|
|
35
|
+
*/
|
|
36
|
+
declare const editorExtension: Node<any, any>;
|
|
29
37
|
|
|
30
|
-
export { AmplessYoutubeNode, youtubeEditor };
|
|
38
|
+
export { AmplessYoutubeNode, editorExtension, youtubeEditor };
|
package/dist/editor.js
CHANGED
|
@@ -70,7 +70,15 @@ var AmplessYoutubeNode = Node.create({
|
|
|
70
70
|
return [
|
|
71
71
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
72
72
|
{
|
|
73
|
-
|
|
73
|
+
// tiptap's paste rule internally calls `String.prototype.matchAll`
|
|
74
|
+
// which throws when the regex doesn't carry the `g` flag. Clone
|
|
75
|
+
// the source regex (which is anchored `^...$` for use in the
|
|
76
|
+
// renderer / markdown extractor) into a global form here. Anchored
|
|
77
|
+
// global is fine — without the `m` flag, `^...$` only anchor at the
|
|
78
|
+
// start / end of the **entire input**, so this matches at most
|
|
79
|
+
// once for the pasted input as a whole (= exactly the single-URL
|
|
80
|
+
// paste case we care about).
|
|
81
|
+
find: new RegExp(YOUTUBE_URL.source, "g"),
|
|
74
82
|
handler: ({ range, match, commands }) => {
|
|
75
83
|
const videoId = match[1] ?? match[2];
|
|
76
84
|
if (!videoId) return;
|
|
@@ -87,7 +95,9 @@ var AmplessYoutubeNode = Node.create({
|
|
|
87
95
|
var youtubeEditor = {
|
|
88
96
|
extension: AmplessYoutubeNode
|
|
89
97
|
};
|
|
98
|
+
var editorExtension = AmplessYoutubeNode;
|
|
90
99
|
export {
|
|
91
100
|
AmplessYoutubeNode,
|
|
101
|
+
editorExtension,
|
|
92
102
|
youtubeEditor
|
|
93
103
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ampless/plugin-youtube",
|
|
3
|
-
"version": "1.0.0-alpha.
|
|
3
|
+
"version": "1.0.0-alpha.5",
|
|
4
4
|
"description": "YouTube embed plugin for ampless — renders youtube.com / youtu.be URLs inline as iframes in tiptap + markdown posts",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"type": "module",
|
|
@@ -32,7 +32,7 @@
|
|
|
32
32
|
"peerDependencies": {
|
|
33
33
|
"@tiptap/core": "^3",
|
|
34
34
|
"react": "^18 || ^19",
|
|
35
|
-
"ampless": "1.0.0-alpha.
|
|
35
|
+
"ampless": "1.0.0-alpha.44"
|
|
36
36
|
},
|
|
37
37
|
"devDependencies": {
|
|
38
38
|
"@tiptap/core": "^3.23.6",
|
|
@@ -59,7 +59,8 @@
|
|
|
59
59
|
"displayName": {
|
|
60
60
|
"en": "YouTube embeds",
|
|
61
61
|
"ja": "YouTube 埋め込み"
|
|
62
|
-
}
|
|
62
|
+
},
|
|
63
|
+
"editorExports": "./editor"
|
|
63
64
|
},
|
|
64
65
|
"scripts": {
|
|
65
66
|
"build": "tsup",
|