@yiitap/extension-video 0.8.0 → 0.10.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.
package/dist/index.cjs CHANGED
@@ -1,5 +1,5 @@
1
1
  "use strict";/**
2
- * Copyright 2025 Yiitap
2
+ * Copyright 2026 Yiitap
3
3
  * @license MIT
4
4
  **/Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const n=require("@tiptap/core"),c=/(!\[(.+|:?)]\((\S+)(?:(?:\s+)["'](\S+)["'])?\))$/,a=n.Node.create({name:"video",draggable:!0,addOptions(){return{inline:!1,HTMLAttributes:{}}},inline(){return this.options.inline},group(){return this.options.inline?"inline":"block"},addAttributes(){return{caption:{default:"",rendered:!1},src:{default:null,parseHTML:t=>t.firstElementChild?.src??""}}},parseHTML(){return[{tag:"video"}]},renderHTML({node:t,HTMLAttributes:e}){return["video",{caption:t.attrs.caption},["source",n.mergeAttributes(this.options.HTMLAttributes,e)]]},parseMarkdown:(t,e)=>{if(t.type==="html_block"||t.type==="html_inline"){const r=t.content,i=r.match(/<video\b([^>]*)>/i);if(!i)return{};const u=i[1],s=r.match(/<source\s+src="([^"]+)"/i),o=u.match(/caption="([^"]*)"/i);if(s)return e.createNode("video",{src:s[1],caption:o?o[1]:""})}return{}},renderMarkdown:t=>{const e=t.attrs?.src??"";return`<video caption="${t.attrs?.caption??""}" controls>
5
5
  <source src="${e}">
package/dist/index.js CHANGED
@@ -1,6 +1,6 @@
1
- var Video=function(r,i){"use strict";/**
2
- * Copyright 2025 Yiitap
1
+ var Video=(function(r,i){"use strict";/**
2
+ * Copyright 2026 Yiitap
3
3
  * @license MIT
4
4
  **/const s=/(!\[(.+|:?)]\((\S+)(?:(?:\s+)["'](\S+)["'])?\))$/,o=i.Node.create({name:"video",draggable:!0,addOptions(){return{inline:!1,HTMLAttributes:{}}},inline(){return this.options.inline},group(){return this.options.inline?"inline":"block"},addAttributes(){return{caption:{default:"",rendered:!1},src:{default:null,parseHTML:t=>t.firstElementChild?.src??""}}},parseHTML(){return[{tag:"video"}]},renderHTML({node:t,HTMLAttributes:e}){return["video",{caption:t.attrs.caption},["source",i.mergeAttributes(this.options.HTMLAttributes,e)]]},parseMarkdown:(t,e)=>{if(t.type==="html_block"||t.type==="html_inline"){const n=t.content,c=n.match(/<video\b([^>]*)>/i);if(!c)return{};const d=c[1],a=n.match(/<source\s+src="([^"]+)"/i),u=d.match(/caption="([^"]*)"/i);if(a)return e.createNode("video",{src:a[1],caption:u?u[1]:""})}return{}},renderMarkdown:t=>{const e=t.attrs?.src??"";return`<video caption="${t.attrs?.caption??""}" controls>
5
5
  <source src="${e}">
6
- </video>`},addCommands(){return{setVideo:t=>({commands:e})=>e.insertContent({type:this.name,attrs:t})}},addInputRules(){return[i.nodeInputRule({find:s,type:this.type,getAttributes:t=>{const[e]=t;return{src:e}}})]}});return r.Video=o,r.default=o,r.inputRegex=s,Object.defineProperties(r,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}}),r}({},TiptapCore);
6
+ </video>`},addCommands(){return{setVideo:t=>({commands:e})=>e.insertContent({type:this.name,attrs:t})}},addInputRules(){return[i.nodeInputRule({find:s,type:this.type,getAttributes:t=>{const[e]=t;return{src:e}}})]}});return r.Video=o,r.default=o,r.inputRegex=s,Object.defineProperties(r,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}}),r})({},TiptapCore);
package/dist/index.mjs CHANGED
@@ -1,6 +1,6 @@
1
1
  import { Node as c, nodeInputRule as a, mergeAttributes as d } from "@tiptap/core";
2
2
  /**
3
- * Copyright 2025 Yiitap
3
+ * Copyright 2026 Yiitap
4
4
  * @license MIT
5
5
  **/
6
6
  const u = /(!\[(.+|:?)]\((\S+)(?:(?:\s+)["'](\S+)["'])?\))$/, l = c.create({
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@yiitap/extension-video",
3
3
  "description": "Video extension",
4
- "version": "0.8.0",
4
+ "version": "0.10.0",
5
5
  "private": false,
6
6
  "author": {
7
7
  "name": "Yiitap",
@@ -26,8 +26,8 @@
26
26
  ],
27
27
  "dependencies": {},
28
28
  "peerDependencies": {
29
- "@tiptap/core": "^3.7.2",
30
- "@tiptap/pm": "^3.7.2"
29
+ "@tiptap/core": "^3.16.0",
30
+ "@tiptap/pm": "^3.16.0"
31
31
  },
32
32
  "devDependencies": {},
33
33
  "scripts": {