@yoopta/carousel 6.0.0-beta.7 → 6.0.0-beta.9
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.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{jsx as e}from"react/jsx-runtime";import{Blocks as t,generateId as r,YooptaPlugin as n}from"@yoopta/editor";var o={ancestors(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},{reverse:r=!1}=t,n=o.levels(e,t);return n=r?n.slice(1):n.slice(0,-1)},common(e,t){for(var r=[],n=0;n<e.length&&n<t.length;n++){var o=e[n];if(o!==t[n])break;r.push(o)}return r},compare(e,t){for(var r=Math.min(e.length,t.length),n=0;n<r;n++){if(e[n]<t[n])return-1;if(e[n]>t[n])return 1}return 0},endsAfter(e,t){var r=e.length-1,n=e.slice(0,r),i=t.slice(0,r),s=e[r],a=t[r];return o.equals(n,i)&&s>a},endsAt(e,t){var r=e.length,n=e.slice(0,r),i=t.slice(0,r);return o.equals(n,i)},endsBefore(e,t){var r=e.length-1,n=e.slice(0,r),i=t.slice(0,r),s=e[r],a=t[r];return o.equals(n,i)&&s<a},equals:(e,t)=>e.length===t.length&&e.every((e,r)=>e===t[r]),hasPrevious:e=>e[e.length-1]>0,isAfter:(e,t)=>1===o.compare(e,t),isAncestor:(e,t)=>e.length<t.length&&0===o.compare(e,t),isBefore:(e,t)=>-1===o.compare(e,t),isChild:(e,t)=>e.length===t.length+1&&0===o.compare(e,t),isCommon:(e,t)=>e.length<=t.length&&0===o.compare(e,t),isDescendant:(e,t)=>e.length>t.length&&0===o.compare(e,t),isParent:(e,t)=>e.length+1===t.length&&0===o.compare(e,t),isPath:e=>Array.isArray(e)&&(0===e.length||"number"==typeof e[0]),isSibling(e,t){if(e.length!==t.length)return!1;var r=e.slice(0,-1),n=t.slice(0,-1);return e[e.length-1]!==t[t.length-1]&&o.equals(r,n)},levels(e){for(var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},{reverse:r=!1}=t,n=[],o=0;o<=e.length;o++)n.push(e.slice(0,o));return r&&n.reverse(),n},next(e){if(0===e.length)throw new Error("Cannot get the next path of a root path [".concat(e,"], because it has no next index."));var t=e[e.length-1];return e.slice(0,-1).concat(t+1)},operationCanTransformPath(e){switch(e.type){case"insert_node":case"remove_node":case"merge_node":case"split_node":case"move_node":return!0;default:return!1}},parent(e){if(0===e.length)throw new Error("Cannot get the parent path of the root path [".concat(e,"]."));return e.slice(0,-1)},previous(e){if(0===e.length)throw new Error("Cannot get the previous path of a root path [".concat(e,"], because it has no previous index."));var t=e[e.length-1];if(t<=0)throw new Error("Cannot get the previous path of a first child path [".concat(e,"] because it would result in a negative index."));return e.slice(0,-1).concat(t-1)},relative(e,t){if(!o.isAncestor(t,e)&&!o.equals(e,t))throw new Error("Cannot get the relative path of [".concat(e,"] inside ancestor [").concat(t,"], because it is not above or equal to the path."));return e.slice(t.length)},transform(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};if(!e)return null;var n=[...e],{affinity:i="forward"}=r;if(0===e.length)return n;switch(t.type){case"insert_node":var{path:s}=t;(o.equals(s,n)||o.endsBefore(s,n)||o.isAncestor(s,n))&&(n[s.length-1]+=1);break;case"remove_node":var{path:a}=t;if(o.equals(a,n)||o.isAncestor(a,n))return null;o.endsBefore(a,n)&&(n[a.length-1]-=1);break;case"merge_node":var{path:l,position:c}=t;o.equals(l,n)||o.endsBefore(l,n)?n[l.length-1]-=1:o.isAncestor(l,n)&&(n[l.length-1]-=1,n[l.length]+=c);break;case"split_node":var{path:f,position:d}=t;if(o.equals(f,n)){if("forward"===i)n[n.length-1]+=1;else if("backward"!==i)return null}else o.endsBefore(f,n)?n[f.length-1]+=1:o.isAncestor(f,n)&&e[f.length]>=d&&(n[f.length-1]+=1,n[f.length]-=d);break;case"move_node":var{path:p,newPath:u}=t;if(o.equals(p,u))return n;if(o.isAncestor(p,n)||o.equals(p,n)){var h=u.slice();return o.endsBefore(p,u)&&p.length<u.length&&(h[p.length-1]-=1),h.concat(n.slice(p.length))}o.isSibling(p,u)&&(o.isAncestor(u,n)||o.equals(u,n))?o.endsBefore(p,n)?n[p.length-1]-=1:n[p.length-1]+=1:o.endsBefore(u,n)||o.equals(u,n)||o.isAncestor(u,n)?(o.endsBefore(p,n)&&(n[p.length-1]-=1),n[u.length-1]+=1):o.endsBefore(p,n)&&(o.equals(u,n)&&(n[u.length-1]+=1),n[p.length-1]-=1)}return n}};function i(e){return i="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},i(e)}function s(e){var t=function(e,t){if("object"!==i(e)||null===e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t||"default");if("object"!==i(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"===i(t)?t:String(t)}function a(e,t,r){return(t=s(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function l(e,t){if(null==e)return{};var r,n,o=function(e,t){if(null==e)return{};var r,n,o={},i=Object.keys(e);for(n=0;n<i.length;n++)r=i[n],t.indexOf(r)>=0||(o[r]=e[r]);return o}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n<i.length;n++)r=i[n],t.indexOf(r)>=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(o[r]=e[r])}return o}var c=["anchor","focus"];function f(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),r.push.apply(r,n)}return r}var d={edges(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},{reverse:r=!1}=t,{anchor:n,focus:o}=e;return d.isBackward(e)===r?[n,o]:[o,n]},end(e){var[,t]=d.edges(e);return t},equals:(e,t)=>A.equals(e.anchor,t.anchor)&&A.equals(e.focus,t.focus),surrounds(e,t){var r=d.intersection(e,t);return!!r&&d.equals(r,t)},includes(e,t){if(d.isRange(t)){if(d.includes(e,t.anchor)||d.includes(e,t.focus))return!0;var[r,n]=d.edges(e),[i,s]=d.edges(t);return A.isBefore(r,i)&&A.isAfter(n,s)}var[a,l]=d.edges(e),c=!1,f=!1;return A.isPoint(t)?(c=A.compare(t,a)>=0,f=A.compare(t,l)<=0):(c=o.compare(t,a.path)>=0,f=o.compare(t,l.path)<=0),c&&f},intersection(e,t){var r=l(e,c),[n,o]=d.edges(e),[i,s]=d.edges(t),p=A.isBefore(n,i)?i:n,u=A.isBefore(o,s)?o:s;return A.isBefore(u,p)?null:function(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?f(Object(r),!0).forEach(function(t){a(e,t,r[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):f(Object(r)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))})}return e}({anchor:p,focus:u},r)},isBackward(e){var{anchor:t,focus:r}=e;return A.isAfter(t,r)},isCollapsed(e){var{anchor:t,focus:r}=e;return A.equals(t,r)},isExpanded:e=>!d.isCollapsed(e),isForward:e=>!d.isBackward(e),isRange:e=>x(e)&&A.isPoint(e.anchor)&&A.isPoint(e.focus),*points(e){yield[e.anchor,"anchor"],yield[e.focus,"focus"]},start(e){var[t]=d.edges(e);return t},transform(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};if(null===e)return null;var n,o,{affinity:i="inward"}=r;if("inward"===i){var s=d.isCollapsed(e);d.isForward(e)?(n="forward",o=s?n:"backward"):(n="backward",o=s?n:"forward")}else"outward"===i?d.isForward(e)?(n="backward",o="forward"):(n="forward",o="backward"):(n=i,o=i);var a=A.transform(e.anchor,t,{affinity:n}),l=A.transform(e.focus,t,{affinity:o});return a&&l?{anchor:a,focus:l}:null}},p=function(e){var{deep:t=!1}=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return!!x(e)&&("function"!=typeof e.apply&&(t?m.isNodeList(e.children):Array.isArray(e.children)))},u={isAncestor(e){var{deep:t=!1}=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return x(e)&&m.isNodeList(e.children,{deep:t})},isElement:p,isElementList(e){var{deep:t=!1}=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return Array.isArray(e)&&e.every(e=>u.isElement(e,{deep:t}))},isElementProps:e=>void 0!==e.children,isElementType:function(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"type";return p(e)&&e[r]===t},matches(e,t){for(var r in t)if("children"!==r&&e[r]!==t[r])return!1;return!0}},h=["children"],v=["text"];function g(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),r.push.apply(r,n)}return r}function y(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?g(Object(r),!0).forEach(function(t){a(e,t,r[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):g(Object(r)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))})}return e}var m={ancestor(e,t){var r=m.get(e,t);if(R.isText(r))throw new Error("Cannot get the ancestor node at path [".concat(t,"] because it refers to a text node instead: ").concat(T.stringify(r)));return r},ancestors(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return function*(){for(var n of o.ancestors(t,r)){var i=[m.ancestor(e,n),n];yield i}}()},child(e,t){if(R.isText(e))throw new Error("Cannot get the child of a text node: ".concat(T.stringify(e)));var r=e.children[t];if(null==r)throw new Error("Cannot get child at index `".concat(t,"` in node: ").concat(T.stringify(e)));return r},children(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return function*(){for(var{reverse:n=!1}=r,o=m.ancestor(e,t),{children:i}=o,s=n?i.length-1:0;n?s>=0:s<i.length;){var a=m.child(o,s),l=t.concat(s);yield[a,l],s=n?s-1:s+1}}()},common(e,t,r){var n=o.common(t,r);return[m.get(e,n),n]},descendant(e,t){var r=m.get(e,t);if(k.isEditor(r))throw new Error("Cannot get the descendant node at path [".concat(t,"] because it refers to the root editor node instead: ").concat(T.stringify(r)));return r},descendants(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return function*(){for(var[r,n]of m.nodes(e,t))0!==n.length&&(yield[r,n])}()},elements(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return function*(){for(var[r,n]of m.nodes(e,t))u.isElement(r)&&(yield[r,n])}()},extractProps:e=>u.isAncestor(e)?l(e,h):l(e,v),first(e,t){for(var r=t.slice(),n=m.get(e,r);n&&!R.isText(n)&&0!==n.children.length;)n=n.children[0],r.push(0);return[n,r]},fragment(e,t){var r={children:e.children},[n,i]=d.edges(t),s=m.nodes(r,{reverse:!0,pass:e=>{var[,r]=e;return!d.includes(t,r)}}),a=function(){if(!d.includes(t,l)){var e=l[l.length-1];W(r,o.parent(l),t=>z(t,e,1))}o.equals(l,i.path)&&J(r,l,e=>{var t=e.text.slice(0,i.offset);return y(y({},e),{},{text:t})}),o.equals(l,n.path)&&J(r,l,e=>{var t=e.text.slice(n.offset);return y(y({},e),{},{text:t})})};for(var[,l]of s)a();return r.children},get(e,t){var r=m.getIf(e,t);if(void 0===r)throw new Error("Cannot find a descendant at path [".concat(t,"] in node: ").concat(T.stringify(e)));return r},getIf(e,t){for(var r=e,n=0;n<t.length;n++){var o=t[n];if(R.isText(r)||!r.children[o])return;r=r.children[o]}return r},has(e,t){for(var r=e,n=0;n<t.length;n++){var o=t[n];if(R.isText(r)||!r.children[o])return!1;r=r.children[o]}return!0},isNode(e){var{deep:t=!1}=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return R.isText(e)||u.isElement(e,{deep:t})||k.isEditor(e,{deep:t})},isNodeList(e){var{deep:t=!1}=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return Array.isArray(e)&&e.every(e=>m.isNode(e,{deep:t}))},last(e,t){for(var r=t.slice(),n=m.get(e,r);n&&!R.isText(n)&&0!==n.children.length;){var o=n.children.length-1;n=n.children[o],r.push(o)}return[n,r]},leaf(e,t){var r=m.get(e,t);if(!R.isText(r))throw new Error("Cannot get the leaf node at path [".concat(t,"] because it refers to a non-leaf node: ").concat(T.stringify(r)));return r},levels(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return function*(){for(var n of o.levels(t,r)){var i=m.get(e,n);yield[i,n]}}()},matches:(e,t)=>u.isElement(e)&&u.isElementProps(t)&&u.matches(e,t)||R.isText(e)&&R.isTextProps(t)&&R.matches(e,t),nodes(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return function*(){for(var{pass:r,reverse:n=!1}=t,{from:i=[],to:s}=t,a=new Set,l=[],c=e;!s||!(n?o.isBefore(l,s):o.isAfter(l,s));)if(a.has(c)||(yield[c,l]),a.has(c)||R.isText(c)||0===c.children.length||null!=r&&!1!==r([c,l])){if(0===l.length)break;if(!n){var f=o.next(l);if(m.has(e,f)){l=f,c=m.get(e,l);continue}}if(n&&0!==l[l.length-1])l=o.previous(l),c=m.get(e,l);else l=o.parent(l),c=m.get(e,l),a.add(c)}else{a.add(c);var d=n?c.children.length-1:0;o.isAncestor(l,i)&&(d=i[l.length]),l=l.concat(d),c=m.get(e,l)}}()},parent(e,t){var r=o.parent(t),n=m.get(e,r);if(R.isText(n))throw new Error("Cannot get the parent of path [".concat(t,"] because it does not exist in the root."));return n},string:e=>R.isText(e)?e.text:e.children.map(m.string).join(""),texts(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return function*(){for(var[r,n]of m.nodes(e,t))R.isText(r)&&(yield[r,n])}()}};function b(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),r.push.apply(r,n)}return r}function O(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?b(Object(r),!0).forEach(function(t){a(e,t,r[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):b(Object(r)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))})}return e}var w,P={isNodeOperation:e=>P.isOperation(e)&&e.type.endsWith("_node"),isOperation(e){if(!x(e))return!1;switch(e.type){case"insert_node":case"remove_node":return o.isPath(e.path)&&m.isNode(e.node);case"insert_text":case"remove_text":return"number"==typeof e.offset&&"string"==typeof e.text&&o.isPath(e.path);case"merge_node":return"number"==typeof e.position&&o.isPath(e.path)&&x(e.properties);case"move_node":return o.isPath(e.path)&&o.isPath(e.newPath);case"set_node":return o.isPath(e.path)&&x(e.properties)&&x(e.newProperties);case"set_selection":return null===e.properties&&d.isRange(e.newProperties)||null===e.newProperties&&d.isRange(e.properties)||x(e.properties)&&x(e.newProperties);case"split_node":return o.isPath(e.path)&&"number"==typeof e.position&&x(e.properties);default:return!1}},isOperationList:e=>Array.isArray(e)&&e.every(e=>P.isOperation(e)),isSelectionOperation:e=>P.isOperation(e)&&e.type.endsWith("_selection"),isTextOperation:e=>P.isOperation(e)&&e.type.endsWith("_text"),inverse(e){switch(e.type){case"insert_node":return O(O({},e),{},{type:"remove_node"});case"insert_text":return O(O({},e),{},{type:"remove_text"});case"merge_node":return O(O({},e),{},{type:"split_node",path:o.previous(e.path)});case"move_node":var{newPath:t,path:r}=e;if(o.equals(t,r))return e;if(o.isSibling(r,t))return O(O({},e),{},{path:t,newPath:r});var n=o.transform(r,e),i=o.transform(o.next(r),e);return O(O({},e),{},{path:n,newPath:i});case"remove_node":return O(O({},e),{},{type:"insert_node"});case"remove_text":return O(O({},e),{},{type:"insert_text"});case"set_node":var{properties:s,newProperties:a}=e;return O(O({},e),{},{properties:a,newProperties:s});case"set_selection":var{properties:l,newProperties:c}=e;return O(O({},e),{},null==l?{properties:c,newProperties:null}:null==c?{properties:null,newProperties:l}:{properties:c,newProperties:l});case"split_node":return O(O({},e),{},{type:"merge_node",path:o.next(e.path)})}}},x=e=>"object"==typeof e&&null!==e,j=(e,t)=>{for(var r in e){var n=e[r],o=t[r];if(Array.isArray(n)&&Array.isArray(o)){if(n.length!==o.length)return!1;for(var i=0;i<n.length;i++)if(n[i]!==o[i])return!1}else if(x(n)&&x(o)){if(!j(n,o))return!1}else if(n!==o)return!1}for(var s in t)if(void 0===e[s]&&void 0!==t[s])return!1;return!0},E=e=>e.selection?e.selection:e.children.length>0?k.end(e,[]):[0];!function(e){e[e.None=0]="None",e[e.Extend=1]="Extend",e[e.ZWJ=2]="ZWJ",e[e.RI=4]="RI",e[e.Prepend=8]="Prepend",e[e.SpacingMark=16]="SpacingMark",e[e.L=32]="L",e[e.V=64]="V",e[e.T=128]="T",e[e.LV=256]="LV",e[e.LVT=512]="LVT",e[e.ExtPict=1024]="ExtPict",e[e.Any=2048]="Any"}(w||(w={})),w.L,w.L,w.V,w.LV,w.LVT,w.LV,w.V,w.V,w.T,w.LVT,w.T,w.T,w.Any,w.Extend,w.ZWJ,w.Any,w.SpacingMark,w.Prepend,w.Any,w.ZWJ,w.ExtPict,w.RI,w.RI;var k={above:(e,t)=>e.above(t),addMark(e,t,r){e.addMark(t,r)},after:(e,t,r)=>e.after(t,r),before:(e,t,r)=>e.before(t,r),deleteBackward(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},{unit:r="character"}=t;e.deleteBackward(r)},deleteForward(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},{unit:r="character"}=t;e.deleteForward(r)},deleteFragment(e,t){e.deleteFragment(t)},edges:(e,t)=>e.edges(t),elementReadOnly(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return e.elementReadOnly(t)},end:(e,t)=>e.end(t),first:(e,t)=>e.first(t),fragment:(e,t)=>e.fragment(t),hasBlocks:(e,t)=>e.hasBlocks(t),hasInlines:(e,t)=>e.hasInlines(t),hasPath:(e,t)=>e.hasPath(t),hasTexts:(e,t)=>e.hasTexts(t),insertBreak(e){e.insertBreak()},insertFragment(e,t,r){e.insertFragment(t,r)},insertNode(e,t){e.insertNode(t)},insertSoftBreak(e){e.insertSoftBreak()},insertText(e,t){e.insertText(t)},isBlock:(e,t)=>e.isBlock(t),isEdge:(e,t,r)=>e.isEdge(t,r),isEditor:e=>function(e){var{deep:t=!1}=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(!x(e))return!1;var r="function"==typeof e.addMark&&"function"==typeof e.apply&&"function"==typeof e.deleteFragment&&"function"==typeof e.insertBreak&&"function"==typeof e.insertSoftBreak&&"function"==typeof e.insertFragment&&"function"==typeof e.insertNode&&"function"==typeof e.insertText&&"function"==typeof e.isElementReadOnly&&"function"==typeof e.isInline&&"function"==typeof e.isSelectable&&"function"==typeof e.isVoid&&"function"==typeof e.normalizeNode&&"function"==typeof e.onChange&&"function"==typeof e.removeMark&&"function"==typeof e.getDirtyPaths&&(null===e.marks||x(e.marks))&&(null===e.selection||d.isRange(e.selection))&&(!t||m.isNodeList(e.children))&&P.isOperationList(e.operations);return r}(e),isElementReadOnly:(e,t)=>e.isElementReadOnly(t),isEmpty:(e,t)=>e.isEmpty(t),isEnd:(e,t,r)=>e.isEnd(t,r),isInline:(e,t)=>e.isInline(t),isNormalizing:e=>e.isNormalizing(),isSelectable:(e,t)=>e.isSelectable(t),isStart:(e,t,r)=>e.isStart(t,r),isVoid:(e,t)=>e.isVoid(t),last:(e,t)=>e.last(t),leaf:(e,t,r)=>e.leaf(t,r),levels:(e,t)=>e.levels(t),marks:e=>e.getMarks(),next:(e,t)=>e.next(t),node:(e,t,r)=>e.node(t,r),nodes:(e,t)=>e.nodes(t),normalize(e,t){e.normalize(t)},parent:(e,t,r)=>e.parent(t,r),path:(e,t,r)=>e.path(t,r),pathRef:(e,t,r)=>e.pathRef(t,r),pathRefs:e=>e.pathRefs(),point:(e,t,r)=>e.point(t,r),pointRef:(e,t,r)=>e.pointRef(t,r),pointRefs:e=>e.pointRefs(),positions:(e,t)=>e.positions(t),previous:(e,t)=>e.previous(t),range:(e,t,r)=>e.range(t,r),rangeRef:(e,t,r)=>e.rangeRef(t,r),rangeRefs:e=>e.rangeRefs(),removeMark(e,t){e.removeMark(t)},setNormalizing(e,t){e.setNormalizing(t)},start:(e,t)=>e.start(t),string:(e,t,r)=>e.string(t,r),unhangRange:(e,t,r)=>e.unhangRange(t,r),void:(e,t)=>e.void(t),withoutNormalizing(e,t){e.withoutNormalizing(t)},shouldMergeNodesRemovePrevNode:(e,t,r)=>e.shouldMergeNodesRemovePrevNode(t,r)};function N(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),r.push.apply(r,n)}return r}function _(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?N(Object(r),!0).forEach(function(t){a(e,t,r[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):N(Object(r)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))})}return e}var A={compare(e,t){var r=o.compare(e.path,t.path);return 0===r?e.offset<t.offset?-1:e.offset>t.offset?1:0:r},isAfter:(e,t)=>1===A.compare(e,t),isBefore:(e,t)=>-1===A.compare(e,t),equals:(e,t)=>e.offset===t.offset&&o.equals(e.path,t.path),isPoint:e=>x(e)&&"number"==typeof e.offset&&o.isPath(e.path),transform(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};if(null===e)return null;var{affinity:n="forward"}=r,{path:i,offset:s}=e;switch(t.type){case"insert_node":case"move_node":i=o.transform(i,t,r);break;case"insert_text":o.equals(t.path,i)&&(t.offset<s||t.offset===s&&"forward"===n)&&(s+=t.text.length);break;case"merge_node":o.equals(t.path,i)&&(s+=t.position),i=o.transform(i,t,r);break;case"remove_text":o.equals(t.path,i)&&t.offset<=s&&(s-=Math.min(s-t.offset,t.text.length));break;case"remove_node":if(o.equals(t.path,i)||o.isAncestor(t.path,i))return null;i=o.transform(i,t,r);break;case"split_node":if(o.equals(t.path,i)){if(t.position===s&&null==n)return null;(t.position<s||t.position===s&&"forward"===n)&&(s-=t.position,i=o.transform(i,t,_(_({},r),{},{affinity:"forward"})))}else i=o.transform(i,t,r);break;default:return e}return{path:i,offset:s}}},S=void 0,T={setScrubber(e){S=e},stringify:e=>JSON.stringify(e,S)},C=["text"],q=["anchor","focus","merge"];function B(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),r.push.apply(r,n)}return r}function D(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?B(Object(r),!0).forEach(function(t){a(e,t,r[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):B(Object(r)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))})}return e}var R={equals(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},{loose:n=!1}=r;function o(e){return l(e,C)}return j(n?o(e):e,n?o(t):t)},isText:e=>x(e)&&"string"==typeof e.text,isTextList:e=>Array.isArray(e)&&e.every(e=>R.isText(e)),isTextProps:e=>void 0!==e.text,matches(e,t){for(var r in t)if("text"!==r&&(!e.hasOwnProperty(r)||e[r]!==t[r]))return!1;return!0},decorations(e,t){var r=[{leaf:D({},e)}];for(var n of t){var{anchor:o,focus:i,merge:s}=n,a=l(n,q),[c,f]=d.edges(n),p=[],u=0,h=c.offset,v=f.offset,g=null!=s?s:Object.assign;for(var{leaf:y}of r){var{length:m}=y.text,b=u;if(u+=m,h<=b&&u<=v)g(y,a),p.push({leaf:y});else if(h!==v&&(h===u||v===b)||h>u||v<b||v===b&&0!==b)p.push({leaf:y});else{var O=y,w=void 0,P=void 0;if(v<u){var x=v-b;P={leaf:D(D({},O),{},{text:O.text.slice(x)})},O=D(D({},O),{},{text:O.text.slice(0,x)})}if(h>b){var j=h-b;w={leaf:D(D({},O),{},{text:O.text.slice(0,j)})},O=D(D({},O),{},{text:O.text.slice(j)})}g(O,a),w&&p.push(w),p.push({leaf:O}),P&&p.push(P)}}r=p}if(r.length>1){var E=0;for(var[k,N]of r.entries()){var _=E,A=_+N.leaf.text.length,S={start:_,end:A};0===k&&(S.isFirst=!0),k===r.length-1&&(S.isLast=!0),N.position=S,E=A}}return r}};function I(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),r.push.apply(r,n)}return r}function L(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?I(Object(r),!0).forEach(function(t){a(e,t,r[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):I(Object(r)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))})}return e}var V=function(e,t){for(var r=arguments.length,n=new Array(r>2?r-2:0),o=2;o<r;o++)n[o-2]=arguments[o];return[...e.slice(0,t),...n,...e.slice(t)]},M=function(e,t,r){for(var n=arguments.length,o=new Array(n>3?n-3:0),i=3;i<n;i++)o[i-3]=arguments[i];return[...e.slice(0,t),...o,...e.slice(t+r)]},z=M,F=(e,t,r)=>{if(0===t.length)throw new Error("Cannot modify the editor");for(var n=m.get(e,t),o=t.slice(),i=r(n);o.length>1;){var s=o.pop(),a=m.get(e,o);i=L(L({},a),{},{children:M(a.children,s,1,i)})}var l=o.pop();e.children=M(e.children,l,1,i)},W=(e,t,r)=>{0===t.length?e.children=r(e.children):F(e,t,e=>{if(R.isText(e))throw new Error("Cannot get the element at path [".concat(t,"] because it refers to a leaf node: ").concat(T.stringify(e)));return L(L({},e),{},{children:r(e.children)})})},J=(e,t,r)=>F(e,t,e=>{if(!R.isText(e))throw new Error("Cannot get the leaf node at path [".concat(t,"] because it refers to a non-leaf node: ").concat(T.stringify(e)));return r(e)});function Z(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),r.push.apply(r,n)}return r}function $(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?Z(Object(r),!0).forEach(function(t){a(e,t,r[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Z(Object(r)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))})}return e}var K={transform(e,t){var r=!1;switch(t.type){case"insert_node":var{path:n,node:i}=t;W(e,o.parent(n),e=>{var t=n[n.length-1];if(t>e.length)throw new Error('Cannot apply an "insert_node" operation at path ['.concat(n,"] because the destination is past the end of the node."));return V(e,t,i)}),r=!0;break;case"insert_text":var{path:s,offset:a,text:l}=t;if(0===l.length)break;J(e,s,e=>{var t=e.text.slice(0,a),r=e.text.slice(a);return $($({},e),{},{text:t+l+r})}),r=!0;break;case"merge_node":var{path:c}=t,f=c[c.length-1],p=o.previous(c),u=p[p.length-1];W(e,o.parent(c),e=>{var t,r=e[f],n=e[u];if(R.isText(r)&&R.isText(n))t=$($({},n),{},{text:n.text+r.text});else{if(R.isText(r)||R.isText(n))throw new Error('Cannot apply a "merge_node" operation at path ['.concat(c,"] to nodes of different interfaces: ").concat(T.stringify(r)," ").concat(T.stringify(n)));t=$($({},n),{},{children:n.children.concat(r.children)})}return M(e,u,2,t)}),r=!0;break;case"move_node":var{path:h,newPath:v}=t,g=h[h.length-1];if(o.isAncestor(h,v))throw new Error("Cannot move a path [".concat(h,"] to new path [").concat(v,"] because the destination is inside itself."));var y=m.get(e,h);W(e,o.parent(h),e=>z(e,g,1));var b=o.transform(h,t),O=b[b.length-1];W(e,o.parent(b),e=>V(e,O,y)),r=!0;break;case"remove_node":var{path:w}=t,P=w[w.length-1];if(W(e,o.parent(w),e=>z(e,P,1)),e.selection){var x=$({},e.selection);for(var[j,E]of d.points(x)){var k=A.transform(j,t);if(null!=x&&null!=k)x[E]=k;else{var N=void 0,_=void 0;for(var[S,C]of m.texts(e)){if(-1!==o.compare(C,w)){_=[S,C];break}N=[S,C]}var q=!1;N&&_&&(q=!o.isSibling(N[1],w)&&(!!o.equals(_[1],w)||o.common(N[1],w).length<o.common(_[1],w).length)),N&&!q?x[E]={path:N[1],offset:N[0].text.length}:_?x[E]={path:_[1],offset:0}:x=null}}x&&d.equals(x,e.selection)||(e.selection=x)}break;case"remove_text":var{path:B,offset:D,text:I}=t;if(0===I.length)break;J(e,B,e=>{var t=e.text.slice(0,D),r=e.text.slice(D+I.length);return $($({},e),{},{text:t+r})}),r=!0;break;case"set_node":var{path:L,properties:Z,newProperties:K}=t;if(0===L.length)throw new Error("Cannot set properties on the root node!");F(e,L,e=>{var t=$({},e);for(var r in K){if("children"===r||"text"===r)throw new Error('Cannot set the "'.concat(r,'" property of nodes!'));var n=K[r];null==n?delete t[r]:t[r]=n}for(var o in Z)K.hasOwnProperty(o)||delete t[o];return t});break;case"set_selection":var{newProperties:U}=t;if(null==U){e.selection=null;break}if(null==e.selection){if(!d.isRange(U))throw new Error('Cannot apply an incomplete "set_selection" operation properties '.concat(T.stringify(U)," when there is no current selection."));e.selection=$({},U);break}var G=$({},e.selection);for(var H in U){var Q=U[H];if(null==Q){if("anchor"===H||"focus"===H)throw new Error('Cannot remove the "'.concat(H,'" selection property'));delete G[H]}else G[H]=Q}e.selection=G;break;case"split_node":var{path:X,position:Y,properties:ee}=t,te=X[X.length-1];if(0===X.length)throw new Error('Cannot apply a "split_node" operation at path ['.concat(X,"] because the root node cannot be split."));W(e,o.parent(X),e=>{var t,r,n=e[te];if(R.isText(n)){var o=n.text.slice(0,Y),i=n.text.slice(Y);t=$($({},n),{},{text:o}),r=$($({},ee),{},{text:i})}else{var s=n.children.slice(0,Y),a=n.children.slice(Y);t=$($({},n),{},{children:s}),r=$($({},ee),{},{children:a})}return M(e,te,1,t,r)}),r=!0}if(r&&e.selection){var re=$({},e.selection);for(var[ne,oe]of d.points(re))re[oe]=A.transform(ne,t);d.equals(re,e.selection)||(e.selection=re)}}},U={insertNodes(e,t,r){e.insertNodes(t,r)},liftNodes(e,t){e.liftNodes(t)},mergeNodes(e,t){e.mergeNodes(t)},moveNodes(e,t){e.moveNodes(t)},removeNodes(e,t){e.removeNodes(t)},setNodes(e,t,r){e.setNodes(t,r)},splitNodes(e,t){e.splitNodes(t)},unsetNodes(e,t,r){e.unsetNodes(t,r)},unwrapNodes(e,t){e.unwrapNodes(t)},wrapNodes(e,t,r){e.wrapNodes(t,r)}},G={collapse(e,t){e.collapse(t)},deselect(e){e.deselect()},move(e,t){e.move(t)},select(e,t){e.select(t)},setPoint(e,t,r){e.setPoint(t,r)},setSelection(e,t){e.setSelection(t)}},H={delete(e,t){e.delete(t)},insertFragment(e,t,r){e.insertFragment(t,r)},insertText(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};k.withoutNormalizing(e,()=>{var{voids:n=!1}=r,{at:i=E(e)}=r;if(o.isPath(i)&&(i=k.range(e,i)),d.isRange(i))if(d.isCollapsed(i))i=i.anchor;else{var s=d.end(i);if(!n&&k.void(e,{at:s}))return;var a=d.start(i),l=k.pointRef(e,a),c=k.pointRef(e,s);Y.delete(e,{at:i,voids:n});var f=l.unref(),p=c.unref();i=f||p,Y.setSelection(e,{anchor:i,focus:i})}if(!(!n&&k.void(e,{at:i})||k.elementReadOnly(e,{at:i}))){var{path:u,offset:h}=i;t.length>0&&e.apply({type:"insert_text",path:u,offset:h,text:t})}})}};function Q(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),r.push.apply(r,n)}return r}function X(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?Q(Object(r),!0).forEach(function(t){a(e,t,r[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Q(Object(r)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))})}return e}var Y=X(X(X(X({},K),U),G),H);const ee={buildCarouselElements(e,t){var r;const n=null!==(r=null==t?void 0:t.items)&&void 0!==r?r:2,o=[];for(let t=0;t<n;t+=1)o.push(e.y("carousel-list-item",{props:{order:t},children:[e.y.text(`Carousel ${t+1}`)]}));return e.y("carousel-container",{children:o})},addCarousel(e,n){var i,s,a,l,c;const f=t.getBlockSlate(e,{id:null==n?void 0:n.blockId});if(!f)return;const d=k.nodes(f,{at:[0],match:e=>u.isElement(e)&&"carousel-container"===e.type}),p=Array.from(d)[0];if(!p)return;const[,h]=p,v=k.nodes(f,{at:h,match:e=>u.isElement(e)&&"carousel-list"===e.type}),g=Array.from(v)[0];if(!g)return;const[,y]=g,m=k.nodes(f,{at:y,match:e=>u.isElement(e)&&"carousel-list-item"===e.type}),b=Array.from(m);let O,w;if((null==n?void 0:n.at)&&o.isPath(n.at)){O=o.next(n.at);const e=b.find(([,e])=>o.equals(e,n.at));w=e?(null===(i=e[0].props)||void 0===i?void 0:i.order)+1:b.length}else if(null==n?void 0:n.afterCarouselId){const e=b.find(([e])=>e.id===n.afterCarouselId);if(e){const[,t]=e;O=o.next(t),w=(null===(s=e[0].props)||void 0===s?void 0:s.order)+1}else O=[...y,b.length],w=b.length}else if(f.selection){const e=f.selection.anchor.path;let t,r;const n=k.above(f,{at:e,match:e=>u.isElement(e)&&"carousel-list-item"===e.type});if(n){const[e,o]=n;t=o,r=null===(a=e.props)||void 0===a?void 0:a.order}else for(const[n,i]of b)if(o.isDescendant(e,i)||o.equals(e,i)){t=i,r=null===(l=n.props)||void 0===l?void 0:l.order;break}void 0!==t&&void 0!==r?(O=o.next(t),w=r+1):(O=[...y,b.length],w=b.length)}else O=[...y,b.length],w=b.length;const P=[];for(const[e,t]of b){const r=null===(c=e.props)||void 0===c?void 0:c.order;r>=w&&P.push([t,r+1])}const x=r(),j=e.y("carousel-list-item",{id:x,props:{order:w},children:[e.y("carousel-list-item-heading",{children:[e.y.text(`Carousel ${w+1}`)]}),e.y("carousel-list-item-content",{children:[e.y.text("")]})]});k.withoutNormalizing(f,()=>{var e;for(const[t,r]of P)Y.setNodes(f,{props:Object.assign(Object.assign({},null!==(e=f.children[t[0]].props)&&void 0!==e?e:{}),{order:r})},{at:t});Y.insertNodes(f,j,{at:O});const t=[...O,0,0];setTimeout(()=>{Y.select(f,{offset:0,path:t})},0)})},deleteCarousel(e,r){const n=t.getBlockSlate(e,{id:null==r?void 0:r.blockId});if(!n)return;const i=k.nodes(n,{at:[0],match:e=>u.isElement(e)&&"carousel-container"===e.type}),s=Array.from(i)[0];if(!s)return;const[,a]=s,l=k.nodes(n,{at:a,match:e=>u.isElement(e)&&"carousel-list"===e.type}),c=Array.from(l)[0];if(!c)return;const[,f]=c,d=k.nodes(n,{at:f,match:e=>u.isElement(e)&&"carousel-list-item"===e.type}),p=Array.from(d);k.withoutNormalizing(n,()=>{var i,s,a;if(1===p.length)return void t.deleteBlock(e,{blockId:r.blockId});const l=p.find(([e])=>e.id===(null==r?void 0:r.carouselId));if(!l)return;const[c,f]=l,d=null===(i=c.props)||void 0===i?void 0:i.order,u=[];for(const[e,t]of p){if(o.equals(t,f))continue;const r=null===(s=e.props)||void 0===s?void 0:s.order;r>d&&u.push([t,r-1])}for(const[e,t]of u)Y.setNodes(n,{props:Object.assign(Object.assign({},null!==(a=n.children[e[0]].props)&&void 0!==a?a:{}),{order:t})},{at:e});Y.removeNodes(n,{at:f})})},moveUp(e,r){var n;const i=t.getBlockSlate(e,{id:null==r?void 0:r.blockId});if(!i)return;const s=k.nodes(i,{at:[0],match:e=>u.isElement(e)&&"carousel-container"===e.type}),a=Array.from(s)[0];if(!a)return;const[,l]=a,c=k.nodes(i,{at:l,match:e=>u.isElement(e)&&"carousel-list"===e.type}),f=Array.from(c)[0];if(!f)return;const[,d]=f,p=k.nodes(i,{at:d,match:e=>u.isElement(e)&&"carousel-list-item"===e.type}),h=Array.from(p),v=h.find(([e])=>e.id===(null==r?void 0:r.carouselId));if(!v)return;const[g,y]=v,m=null===(n=g.props)||void 0===n?void 0:n.order;if(0===m)return;const b=h.find(([e])=>{var t;return(null===(t=e.props)||void 0===t?void 0:t.order)===m-1});if(!b)return;const[,O]=b;k.withoutNormalizing(i,()=>{var e,t;Y.setNodes(i,{props:Object.assign(Object.assign({},null!==(e=i.children[y[0]].props)&&void 0!==e?e:{}),{order:m-1})},{at:y}),Y.setNodes(i,{props:Object.assign(Object.assign({},null!==(t=i.children[O[0]].props)&&void 0!==t?t:{}),{order:m})},{at:O});const r=k.node(i,y)[0],n=k.node(i,O)[0];Y.removeNodes(i,{at:y}),Y.insertNodes(i,r,{at:O}),Y.removeNodes(i,{at:o.next(O)}),Y.insertNodes(i,n,{at:o.next(O)})})},moveDown(e,r){var n;const i=t.getBlockSlate(e,{id:null==r?void 0:r.blockId});if(!i)return;const s=k.nodes(i,{at:[0],match:e=>u.isElement(e)&&"carousel-container"===e.type}),a=Array.from(s)[0];if(!a)return;const[,l]=a,c=k.nodes(i,{at:l,match:e=>u.isElement(e)&&"carousel-list"===e.type}),f=Array.from(c)[0];if(!f)return;const[,d]=f,p=k.nodes(i,{at:d,match:e=>u.isElement(e)&&"carousel-list-item"===e.type}),h=Array.from(p),v=h.find(([e])=>e.id===(null==r?void 0:r.carouselId));if(!v)return;const[g,y]=v,m=null===(n=g.props)||void 0===n?void 0:n.order,b=Math.max(...h.map(([e])=>{var t;return null===(t=e.props)||void 0===t?void 0:t.order}));if(m===b)return;const O=h.find(([e])=>{var t;return(null===(t=e.props)||void 0===t?void 0:t.order)===m+1});if(!O)return;const[,w]=O;k.withoutNormalizing(i,()=>{var e,t;Y.setNodes(i,{props:Object.assign(Object.assign({},null!==(e=i.children[y[0]].props)&&void 0!==e?e:{}),{order:m+1})},{at:y}),Y.setNodes(i,{props:Object.assign(Object.assign({},null!==(t=i.children[w[0]].props)&&void 0!==t?t:{}),{order:m})},{at:w});const r=k.node(i,y)[0],n=k.node(i,w)[0];Y.removeNodes(i,{at:w}),Y.insertNodes(i,n,{at:y}),Y.removeNodes(i,{at:y}),Y.insertNodes(i,r,{at:o.next(y)})})}},te=new n({type:"Carousel",elements:e("carousel-container",Object.assign({render:({attributes:t,children:r})=>e("div",Object.assign({},t,{"data-component-part":"carousel-container"},{children:r}))},{children:e("carousel-list-item",{render:({attributes:t,children:r})=>e("div",Object.assign({},t,{"data-component-part":"carousel-list-item"},{children:r}))})})),options:{display:{title:"Carousel",description:"Create a carousel to display images or content in a slider"},shortcuts:["carousel"]},commands:ee,lifecycle:{beforeCreate:e=>ee.buildCarouselElements(e,{items:5})},events:{onKeyDown:(e,t,r)=>e=>{}}});export{ee as CarouselCommands,te as default};
|
|
1
|
+
import{jsx as e}from"react/jsx-runtime";import{Blocks as t,generateId as r,YooptaPlugin as n,serializeTextNodes as o,serializeTextNodesIntoMarkdown as i}from"@yoopta/editor";var s={ancestors(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},{reverse:r=!1}=t,n=s.levels(e,t);return n=r?n.slice(1):n.slice(0,-1)},common(e,t){for(var r=[],n=0;n<e.length&&n<t.length;n++){var o=e[n];if(o!==t[n])break;r.push(o)}return r},compare(e,t){for(var r=Math.min(e.length,t.length),n=0;n<r;n++){if(e[n]<t[n])return-1;if(e[n]>t[n])return 1}return 0},endsAfter(e,t){var r=e.length-1,n=e.slice(0,r),o=t.slice(0,r),i=e[r],a=t[r];return s.equals(n,o)&&i>a},endsAt(e,t){var r=e.length,n=e.slice(0,r),o=t.slice(0,r);return s.equals(n,o)},endsBefore(e,t){var r=e.length-1,n=e.slice(0,r),o=t.slice(0,r),i=e[r],a=t[r];return s.equals(n,o)&&i<a},equals:(e,t)=>e.length===t.length&&e.every((e,r)=>e===t[r]),hasPrevious:e=>e[e.length-1]>0,isAfter:(e,t)=>1===s.compare(e,t),isAncestor:(e,t)=>e.length<t.length&&0===s.compare(e,t),isBefore:(e,t)=>-1===s.compare(e,t),isChild:(e,t)=>e.length===t.length+1&&0===s.compare(e,t),isCommon:(e,t)=>e.length<=t.length&&0===s.compare(e,t),isDescendant:(e,t)=>e.length>t.length&&0===s.compare(e,t),isParent:(e,t)=>e.length+1===t.length&&0===s.compare(e,t),isPath:e=>Array.isArray(e)&&(0===e.length||"number"==typeof e[0]),isSibling(e,t){if(e.length!==t.length)return!1;var r=e.slice(0,-1),n=t.slice(0,-1);return e[e.length-1]!==t[t.length-1]&&s.equals(r,n)},levels(e){for(var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},{reverse:r=!1}=t,n=[],o=0;o<=e.length;o++)n.push(e.slice(0,o));return r&&n.reverse(),n},next(e){if(0===e.length)throw new Error("Cannot get the next path of a root path [".concat(e,"], because it has no next index."));var t=e[e.length-1];return e.slice(0,-1).concat(t+1)},operationCanTransformPath(e){switch(e.type){case"insert_node":case"remove_node":case"merge_node":case"split_node":case"move_node":return!0;default:return!1}},parent(e){if(0===e.length)throw new Error("Cannot get the parent path of the root path [".concat(e,"]."));return e.slice(0,-1)},previous(e){if(0===e.length)throw new Error("Cannot get the previous path of a root path [".concat(e,"], because it has no previous index."));var t=e[e.length-1];if(t<=0)throw new Error("Cannot get the previous path of a first child path [".concat(e,"] because it would result in a negative index."));return e.slice(0,-1).concat(t-1)},relative(e,t){if(!s.isAncestor(t,e)&&!s.equals(e,t))throw new Error("Cannot get the relative path of [".concat(e,"] inside ancestor [").concat(t,"], because it is not above or equal to the path."));return e.slice(t.length)},transform(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};if(!e)return null;var n=[...e],{affinity:o="forward"}=r;if(0===e.length)return n;switch(t.type){case"insert_node":var{path:i}=t;(s.equals(i,n)||s.endsBefore(i,n)||s.isAncestor(i,n))&&(n[i.length-1]+=1);break;case"remove_node":var{path:a}=t;if(s.equals(a,n)||s.isAncestor(a,n))return null;s.endsBefore(a,n)&&(n[a.length-1]-=1);break;case"merge_node":var{path:l,position:c}=t;s.equals(l,n)||s.endsBefore(l,n)?n[l.length-1]-=1:s.isAncestor(l,n)&&(n[l.length-1]-=1,n[l.length]+=c);break;case"split_node":var{path:f,position:d}=t;if(s.equals(f,n)){if("forward"===o)n[n.length-1]+=1;else if("backward"!==o)return null}else s.endsBefore(f,n)?n[f.length-1]+=1:s.isAncestor(f,n)&&e[f.length]>=d&&(n[f.length-1]+=1,n[f.length]-=d);break;case"move_node":var{path:p,newPath:u}=t;if(s.equals(p,u))return n;if(s.isAncestor(p,n)||s.equals(p,n)){var h=u.slice();return s.endsBefore(p,u)&&p.length<u.length&&(h[p.length-1]-=1),h.concat(n.slice(p.length))}s.isSibling(p,u)&&(s.isAncestor(u,n)||s.equals(u,n))?s.endsBefore(p,n)?n[p.length-1]-=1:n[p.length-1]+=1:s.endsBefore(u,n)||s.equals(u,n)||s.isAncestor(u,n)?(s.endsBefore(p,n)&&(n[p.length-1]-=1),n[u.length-1]+=1):s.endsBefore(p,n)&&(s.equals(u,n)&&(n[u.length-1]+=1),n[p.length-1]-=1)}return n}};function a(e){return a="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},a(e)}function l(e){var t=function(e,t){if("object"!==a(e)||null===e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t||"default");if("object"!==a(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"===a(t)?t:String(t)}function c(e,t,r){return(t=l(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function f(e,t){if(null==e)return{};var r,n,o=function(e,t){if(null==e)return{};var r,n,o={},i=Object.keys(e);for(n=0;n<i.length;n++)r=i[n],t.indexOf(r)>=0||(o[r]=e[r]);return o}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n<i.length;n++)r=i[n],t.indexOf(r)>=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(o[r]=e[r])}return o}var d=["anchor","focus"];function p(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),r.push.apply(r,n)}return r}var u={edges(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},{reverse:r=!1}=t,{anchor:n,focus:o}=e;return u.isBackward(e)===r?[n,o]:[o,n]},end(e){var[,t]=u.edges(e);return t},equals:(e,t)=>T.equals(e.anchor,t.anchor)&&T.equals(e.focus,t.focus),surrounds(e,t){var r=u.intersection(e,t);return!!r&&u.equals(r,t)},includes(e,t){if(u.isRange(t)){if(u.includes(e,t.anchor)||u.includes(e,t.focus))return!0;var[r,n]=u.edges(e),[o,i]=u.edges(t);return T.isBefore(r,o)&&T.isAfter(n,i)}var[a,l]=u.edges(e),c=!1,f=!1;return T.isPoint(t)?(c=T.compare(t,a)>=0,f=T.compare(t,l)<=0):(c=s.compare(t,a.path)>=0,f=s.compare(t,l.path)<=0),c&&f},intersection(e,t){var r=f(e,d),[n,o]=u.edges(e),[i,s]=u.edges(t),a=T.isBefore(n,i)?i:n,l=T.isBefore(o,s)?o:s;return T.isBefore(l,a)?null:function(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?p(Object(r),!0).forEach(function(t){c(e,t,r[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):p(Object(r)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))})}return e}({anchor:a,focus:l},r)},isBackward(e){var{anchor:t,focus:r}=e;return T.isAfter(t,r)},isCollapsed(e){var{anchor:t,focus:r}=e;return T.equals(t,r)},isExpanded:e=>!u.isCollapsed(e),isForward:e=>!u.isBackward(e),isRange:e=>E(e)&&T.isPoint(e.anchor)&&T.isPoint(e.focus),*points(e){yield[e.anchor,"anchor"],yield[e.focus,"focus"]},start(e){var[t]=u.edges(e);return t},transform(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};if(null===e)return null;var n,o,{affinity:i="inward"}=r;if("inward"===i){var s=u.isCollapsed(e);u.isForward(e)?(n="forward",o=s?n:"backward"):(n="backward",o=s?n:"forward")}else"outward"===i?u.isForward(e)?(n="backward",o="forward"):(n="forward",o="backward"):(n=i,o=i);var a=T.transform(e.anchor,t,{affinity:n}),l=T.transform(e.focus,t,{affinity:o});return a&&l?{anchor:a,focus:l}:null}},h=function(e){var{deep:t=!1}=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return!!E(e)&&("function"!=typeof e.apply&&(t?O.isNodeList(e.children):Array.isArray(e.children)))},v={isAncestor(e){var{deep:t=!1}=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return E(e)&&O.isNodeList(e.children,{deep:t})},isElement:h,isElementList(e){var{deep:t=!1}=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return Array.isArray(e)&&e.every(e=>v.isElement(e,{deep:t}))},isElementProps:e=>void 0!==e.children,isElementType:function(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"type";return h(e)&&e[r]===t},matches(e,t){for(var r in t)if("children"!==r&&e[r]!==t[r])return!1;return!0}},g=["children"],y=["text"];function m(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),r.push.apply(r,n)}return r}function b(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?m(Object(r),!0).forEach(function(t){c(e,t,r[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):m(Object(r)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))})}return e}var O={ancestor(e,t){var r=O.get(e,t);if(L.isText(r))throw new Error("Cannot get the ancestor node at path [".concat(t,"] because it refers to a text node instead: ").concat(q.stringify(r)));return r},ancestors(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return function*(){for(var n of s.ancestors(t,r)){var o=[O.ancestor(e,n),n];yield o}}()},child(e,t){if(L.isText(e))throw new Error("Cannot get the child of a text node: ".concat(q.stringify(e)));var r=e.children[t];if(null==r)throw new Error("Cannot get child at index `".concat(t,"` in node: ").concat(q.stringify(e)));return r},children(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return function*(){for(var{reverse:n=!1}=r,o=O.ancestor(e,t),{children:i}=o,s=n?i.length-1:0;n?s>=0:s<i.length;){var a=O.child(o,s),l=t.concat(s);yield[a,l],s=n?s-1:s+1}}()},common(e,t,r){var n=s.common(t,r);return[O.get(e,n),n]},descendant(e,t){var r=O.get(e,t);if(_.isEditor(r))throw new Error("Cannot get the descendant node at path [".concat(t,"] because it refers to the root editor node instead: ").concat(q.stringify(r)));return r},descendants(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return function*(){for(var[r,n]of O.nodes(e,t))0!==n.length&&(yield[r,n])}()},elements(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return function*(){for(var[r,n]of O.nodes(e,t))v.isElement(r)&&(yield[r,n])}()},extractProps:e=>v.isAncestor(e)?f(e,g):f(e,y),first(e,t){for(var r=t.slice(),n=O.get(e,r);n&&!L.isText(n)&&0!==n.children.length;)n=n.children[0],r.push(0);return[n,r]},fragment(e,t){var r={children:e.children},[n,o]=u.edges(t),i=O.nodes(r,{reverse:!0,pass:e=>{var[,r]=e;return!u.includes(t,r)}}),a=function(){if(!u.includes(t,l)){var e=l[l.length-1];J(r,s.parent(l),t=>$(t,e,1))}s.equals(l,o.path)&&Z(r,l,e=>{var t=e.text.slice(0,o.offset);return b(b({},e),{},{text:t})}),s.equals(l,n.path)&&Z(r,l,e=>{var t=e.text.slice(n.offset);return b(b({},e),{},{text:t})})};for(var[,l]of i)a();return r.children},get(e,t){var r=O.getIf(e,t);if(void 0===r)throw new Error("Cannot find a descendant at path [".concat(t,"] in node: ").concat(q.stringify(e)));return r},getIf(e,t){for(var r=e,n=0;n<t.length;n++){var o=t[n];if(L.isText(r)||!r.children[o])return;r=r.children[o]}return r},has(e,t){for(var r=e,n=0;n<t.length;n++){var o=t[n];if(L.isText(r)||!r.children[o])return!1;r=r.children[o]}return!0},isNode(e){var{deep:t=!1}=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return L.isText(e)||v.isElement(e,{deep:t})||_.isEditor(e,{deep:t})},isNodeList(e){var{deep:t=!1}=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return Array.isArray(e)&&e.every(e=>O.isNode(e,{deep:t}))},last(e,t){for(var r=t.slice(),n=O.get(e,r);n&&!L.isText(n)&&0!==n.children.length;){var o=n.children.length-1;n=n.children[o],r.push(o)}return[n,r]},leaf(e,t){var r=O.get(e,t);if(!L.isText(r))throw new Error("Cannot get the leaf node at path [".concat(t,"] because it refers to a non-leaf node: ").concat(q.stringify(r)));return r},levels(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return function*(){for(var n of s.levels(t,r)){var o=O.get(e,n);yield[o,n]}}()},matches:(e,t)=>v.isElement(e)&&v.isElementProps(t)&&v.matches(e,t)||L.isText(e)&&L.isTextProps(t)&&L.matches(e,t),nodes(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return function*(){for(var{pass:r,reverse:n=!1}=t,{from:o=[],to:i}=t,a=new Set,l=[],c=e;!i||!(n?s.isBefore(l,i):s.isAfter(l,i));)if(a.has(c)||(yield[c,l]),a.has(c)||L.isText(c)||0===c.children.length||null!=r&&!1!==r([c,l])){if(0===l.length)break;if(!n){var f=s.next(l);if(O.has(e,f)){l=f,c=O.get(e,l);continue}}if(n&&0!==l[l.length-1])l=s.previous(l),c=O.get(e,l);else l=s.parent(l),c=O.get(e,l),a.add(c)}else{a.add(c);var d=n?c.children.length-1:0;s.isAncestor(l,o)&&(d=o[l.length]),l=l.concat(d),c=O.get(e,l)}}()},parent(e,t){var r=s.parent(t),n=O.get(e,r);if(L.isText(n))throw new Error("Cannot get the parent of path [".concat(t,"] because it does not exist in the root."));return n},string:e=>L.isText(e)?e.text:e.children.map(O.string).join(""),texts(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return function*(){for(var[r,n]of O.nodes(e,t))L.isText(r)&&(yield[r,n])}()}};function w(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),r.push.apply(r,n)}return r}function x(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?w(Object(r),!0).forEach(function(t){c(e,t,r[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):w(Object(r)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))})}return e}var P,j={isNodeOperation:e=>j.isOperation(e)&&e.type.endsWith("_node"),isOperation(e){if(!E(e))return!1;switch(e.type){case"insert_node":case"remove_node":return s.isPath(e.path)&&O.isNode(e.node);case"insert_text":case"remove_text":return"number"==typeof e.offset&&"string"==typeof e.text&&s.isPath(e.path);case"merge_node":return"number"==typeof e.position&&s.isPath(e.path)&&E(e.properties);case"move_node":return s.isPath(e.path)&&s.isPath(e.newPath);case"set_node":return s.isPath(e.path)&&E(e.properties)&&E(e.newProperties);case"set_selection":return null===e.properties&&u.isRange(e.newProperties)||null===e.newProperties&&u.isRange(e.properties)||E(e.properties)&&E(e.newProperties);case"split_node":return s.isPath(e.path)&&"number"==typeof e.position&&E(e.properties);default:return!1}},isOperationList:e=>Array.isArray(e)&&e.every(e=>j.isOperation(e)),isSelectionOperation:e=>j.isOperation(e)&&e.type.endsWith("_selection"),isTextOperation:e=>j.isOperation(e)&&e.type.endsWith("_text"),inverse(e){switch(e.type){case"insert_node":return x(x({},e),{},{type:"remove_node"});case"insert_text":return x(x({},e),{},{type:"remove_text"});case"merge_node":return x(x({},e),{},{type:"split_node",path:s.previous(e.path)});case"move_node":var{newPath:t,path:r}=e;if(s.equals(t,r))return e;if(s.isSibling(r,t))return x(x({},e),{},{path:t,newPath:r});var n=s.transform(r,e),o=s.transform(s.next(r),e);return x(x({},e),{},{path:n,newPath:o});case"remove_node":return x(x({},e),{},{type:"insert_node"});case"remove_text":return x(x({},e),{},{type:"insert_text"});case"set_node":var{properties:i,newProperties:a}=e;return x(x({},e),{},{properties:a,newProperties:i});case"set_selection":var{properties:l,newProperties:c}=e;return x(x({},e),{},null==l?{properties:c,newProperties:null}:null==c?{properties:null,newProperties:l}:{properties:c,newProperties:l});case"split_node":return x(x({},e),{},{type:"merge_node",path:s.next(e.path)})}}},E=e=>"object"==typeof e&&null!==e,k=(e,t)=>{for(var r in e){var n=e[r],o=t[r];if(Array.isArray(n)&&Array.isArray(o)){if(n.length!==o.length)return!1;for(var i=0;i<n.length;i++)if(n[i]!==o[i])return!1}else if(E(n)&&E(o)){if(!k(n,o))return!1}else if(n!==o)return!1}for(var s in t)if(void 0===e[s]&&void 0!==t[s])return!1;return!0},N=e=>e.selection?e.selection:e.children.length>0?_.end(e,[]):[0];!function(e){e[e.None=0]="None",e[e.Extend=1]="Extend",e[e.ZWJ=2]="ZWJ",e[e.RI=4]="RI",e[e.Prepend=8]="Prepend",e[e.SpacingMark=16]="SpacingMark",e[e.L=32]="L",e[e.V=64]="V",e[e.T=128]="T",e[e.LV=256]="LV",e[e.LVT=512]="LVT",e[e.ExtPict=1024]="ExtPict",e[e.Any=2048]="Any"}(P||(P={})),P.L,P.L,P.V,P.LV,P.LVT,P.LV,P.V,P.V,P.T,P.LVT,P.T,P.T,P.Any,P.Extend,P.ZWJ,P.Any,P.SpacingMark,P.Prepend,P.Any,P.ZWJ,P.ExtPict,P.RI,P.RI;var _={above:(e,t)=>e.above(t),addMark(e,t,r){e.addMark(t,r)},after:(e,t,r)=>e.after(t,r),before:(e,t,r)=>e.before(t,r),deleteBackward(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},{unit:r="character"}=t;e.deleteBackward(r)},deleteForward(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},{unit:r="character"}=t;e.deleteForward(r)},deleteFragment(e,t){e.deleteFragment(t)},edges:(e,t)=>e.edges(t),elementReadOnly(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return e.elementReadOnly(t)},end:(e,t)=>e.end(t),first:(e,t)=>e.first(t),fragment:(e,t)=>e.fragment(t),hasBlocks:(e,t)=>e.hasBlocks(t),hasInlines:(e,t)=>e.hasInlines(t),hasPath:(e,t)=>e.hasPath(t),hasTexts:(e,t)=>e.hasTexts(t),insertBreak(e){e.insertBreak()},insertFragment(e,t,r){e.insertFragment(t,r)},insertNode(e,t){e.insertNode(t)},insertSoftBreak(e){e.insertSoftBreak()},insertText(e,t){e.insertText(t)},isBlock:(e,t)=>e.isBlock(t),isEdge:(e,t,r)=>e.isEdge(t,r),isEditor:e=>function(e){var{deep:t=!1}=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(!E(e))return!1;var r="function"==typeof e.addMark&&"function"==typeof e.apply&&"function"==typeof e.deleteFragment&&"function"==typeof e.insertBreak&&"function"==typeof e.insertSoftBreak&&"function"==typeof e.insertFragment&&"function"==typeof e.insertNode&&"function"==typeof e.insertText&&"function"==typeof e.isElementReadOnly&&"function"==typeof e.isInline&&"function"==typeof e.isSelectable&&"function"==typeof e.isVoid&&"function"==typeof e.normalizeNode&&"function"==typeof e.onChange&&"function"==typeof e.removeMark&&"function"==typeof e.getDirtyPaths&&(null===e.marks||E(e.marks))&&(null===e.selection||u.isRange(e.selection))&&(!t||O.isNodeList(e.children))&&j.isOperationList(e.operations);return r}(e),isElementReadOnly:(e,t)=>e.isElementReadOnly(t),isEmpty:(e,t)=>e.isEmpty(t),isEnd:(e,t,r)=>e.isEnd(t,r),isInline:(e,t)=>e.isInline(t),isNormalizing:e=>e.isNormalizing(),isSelectable:(e,t)=>e.isSelectable(t),isStart:(e,t,r)=>e.isStart(t,r),isVoid:(e,t)=>e.isVoid(t),last:(e,t)=>e.last(t),leaf:(e,t,r)=>e.leaf(t,r),levels:(e,t)=>e.levels(t),marks:e=>e.getMarks(),next:(e,t)=>e.next(t),node:(e,t,r)=>e.node(t,r),nodes:(e,t)=>e.nodes(t),normalize(e,t){e.normalize(t)},parent:(e,t,r)=>e.parent(t,r),path:(e,t,r)=>e.path(t,r),pathRef:(e,t,r)=>e.pathRef(t,r),pathRefs:e=>e.pathRefs(),point:(e,t,r)=>e.point(t,r),pointRef:(e,t,r)=>e.pointRef(t,r),pointRefs:e=>e.pointRefs(),positions:(e,t)=>e.positions(t),previous:(e,t)=>e.previous(t),range:(e,t,r)=>e.range(t,r),rangeRef:(e,t,r)=>e.rangeRef(t,r),rangeRefs:e=>e.rangeRefs(),removeMark(e,t){e.removeMark(t)},setNormalizing(e,t){e.setNormalizing(t)},start:(e,t)=>e.start(t),string:(e,t,r)=>e.string(t,r),unhangRange:(e,t,r)=>e.unhangRange(t,r),void:(e,t)=>e.void(t),withoutNormalizing(e,t){e.withoutNormalizing(t)},shouldMergeNodesRemovePrevNode:(e,t,r)=>e.shouldMergeNodesRemovePrevNode(t,r)};function A(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),r.push.apply(r,n)}return r}function S(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?A(Object(r),!0).forEach(function(t){c(e,t,r[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):A(Object(r)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))})}return e}var T={compare(e,t){var r=s.compare(e.path,t.path);return 0===r?e.offset<t.offset?-1:e.offset>t.offset?1:0:r},isAfter:(e,t)=>1===T.compare(e,t),isBefore:(e,t)=>-1===T.compare(e,t),equals:(e,t)=>e.offset===t.offset&&s.equals(e.path,t.path),isPoint:e=>E(e)&&"number"==typeof e.offset&&s.isPath(e.path),transform(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};if(null===e)return null;var{affinity:n="forward"}=r,{path:o,offset:i}=e;switch(t.type){case"insert_node":case"move_node":o=s.transform(o,t,r);break;case"insert_text":s.equals(t.path,o)&&(t.offset<i||t.offset===i&&"forward"===n)&&(i+=t.text.length);break;case"merge_node":s.equals(t.path,o)&&(i+=t.position),o=s.transform(o,t,r);break;case"remove_text":s.equals(t.path,o)&&t.offset<=i&&(i-=Math.min(i-t.offset,t.text.length));break;case"remove_node":if(s.equals(t.path,o)||s.isAncestor(t.path,o))return null;o=s.transform(o,t,r);break;case"split_node":if(s.equals(t.path,o)){if(t.position===i&&null==n)return null;(t.position<i||t.position===i&&"forward"===n)&&(i-=t.position,o=s.transform(o,t,S(S({},r),{},{affinity:"forward"})))}else o=s.transform(o,t,r);break;default:return e}return{path:o,offset:i}}},C=void 0,q={setScrubber(e){C=e},stringify:e=>JSON.stringify(e,C)},D=["text"],B=["anchor","focus","merge"];function R(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),r.push.apply(r,n)}return r}function I(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?R(Object(r),!0).forEach(function(t){c(e,t,r[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):R(Object(r)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))})}return e}var L={equals(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},{loose:n=!1}=r;function o(e){return f(e,D)}return k(n?o(e):e,n?o(t):t)},isText:e=>E(e)&&"string"==typeof e.text,isTextList:e=>Array.isArray(e)&&e.every(e=>L.isText(e)),isTextProps:e=>void 0!==e.text,matches(e,t){for(var r in t)if("text"!==r&&(!e.hasOwnProperty(r)||e[r]!==t[r]))return!1;return!0},decorations(e,t){var r=[{leaf:I({},e)}];for(var n of t){var{anchor:o,focus:i,merge:s}=n,a=f(n,B),[l,c]=u.edges(n),d=[],p=0,h=l.offset,v=c.offset,g=null!=s?s:Object.assign;for(var{leaf:y}of r){var{length:m}=y.text,b=p;if(p+=m,h<=b&&p<=v)g(y,a),d.push({leaf:y});else if(h!==v&&(h===p||v===b)||h>p||v<b||v===b&&0!==b)d.push({leaf:y});else{var O=y,w=void 0,x=void 0;if(v<p){var P=v-b;x={leaf:I(I({},O),{},{text:O.text.slice(P)})},O=I(I({},O),{},{text:O.text.slice(0,P)})}if(h>b){var j=h-b;w={leaf:I(I({},O),{},{text:O.text.slice(0,j)})},O=I(I({},O),{},{text:O.text.slice(j)})}g(O,a),w&&d.push(w),d.push({leaf:O}),x&&d.push(x)}}r=d}if(r.length>1){var E=0;for(var[k,N]of r.entries()){var _=E,A=_+N.leaf.text.length,S={start:_,end:A};0===k&&(S.isFirst=!0),k===r.length-1&&(S.isLast=!0),N.position=S,E=A}}return r}};function z(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),r.push.apply(r,n)}return r}function V(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?z(Object(r),!0).forEach(function(t){c(e,t,r[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):z(Object(r)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))})}return e}var M=function(e,t){for(var r=arguments.length,n=new Array(r>2?r-2:0),o=2;o<r;o++)n[o-2]=arguments[o];return[...e.slice(0,t),...n,...e.slice(t)]},F=function(e,t,r){for(var n=arguments.length,o=new Array(n>3?n-3:0),i=3;i<n;i++)o[i-3]=arguments[i];return[...e.slice(0,t),...o,...e.slice(t+r)]},$=F,W=(e,t,r)=>{if(0===t.length)throw new Error("Cannot modify the editor");for(var n=O.get(e,t),o=t.slice(),i=r(n);o.length>1;){var s=o.pop(),a=O.get(e,o);i=V(V({},a),{},{children:F(a.children,s,1,i)})}var l=o.pop();e.children=F(e.children,l,1,i)},J=(e,t,r)=>{0===t.length?e.children=r(e.children):W(e,t,e=>{if(L.isText(e))throw new Error("Cannot get the element at path [".concat(t,"] because it refers to a leaf node: ").concat(q.stringify(e)));return V(V({},e),{},{children:r(e.children)})})},Z=(e,t,r)=>W(e,t,e=>{if(!L.isText(e))throw new Error("Cannot get the leaf node at path [".concat(t,"] because it refers to a non-leaf node: ").concat(q.stringify(e)));return r(e)});function K(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),r.push.apply(r,n)}return r}function U(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?K(Object(r),!0).forEach(function(t){c(e,t,r[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):K(Object(r)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))})}return e}var G={transform(e,t){var r=!1;switch(t.type){case"insert_node":var{path:n,node:o}=t;J(e,s.parent(n),e=>{var t=n[n.length-1];if(t>e.length)throw new Error('Cannot apply an "insert_node" operation at path ['.concat(n,"] because the destination is past the end of the node."));return M(e,t,o)}),r=!0;break;case"insert_text":var{path:i,offset:a,text:l}=t;if(0===l.length)break;Z(e,i,e=>{var t=e.text.slice(0,a),r=e.text.slice(a);return U(U({},e),{},{text:t+l+r})}),r=!0;break;case"merge_node":var{path:c}=t,f=c[c.length-1],d=s.previous(c),p=d[d.length-1];J(e,s.parent(c),e=>{var t,r=e[f],n=e[p];if(L.isText(r)&&L.isText(n))t=U(U({},n),{},{text:n.text+r.text});else{if(L.isText(r)||L.isText(n))throw new Error('Cannot apply a "merge_node" operation at path ['.concat(c,"] to nodes of different interfaces: ").concat(q.stringify(r)," ").concat(q.stringify(n)));t=U(U({},n),{},{children:n.children.concat(r.children)})}return F(e,p,2,t)}),r=!0;break;case"move_node":var{path:h,newPath:v}=t,g=h[h.length-1];if(s.isAncestor(h,v))throw new Error("Cannot move a path [".concat(h,"] to new path [").concat(v,"] because the destination is inside itself."));var y=O.get(e,h);J(e,s.parent(h),e=>$(e,g,1));var m=s.transform(h,t),b=m[m.length-1];J(e,s.parent(m),e=>M(e,b,y)),r=!0;break;case"remove_node":var{path:w}=t,x=w[w.length-1];if(J(e,s.parent(w),e=>$(e,x,1)),e.selection){var P=U({},e.selection);for(var[j,E]of u.points(P)){var k=T.transform(j,t);if(null!=P&&null!=k)P[E]=k;else{var N=void 0,_=void 0;for(var[A,S]of O.texts(e)){if(-1!==s.compare(S,w)){_=[A,S];break}N=[A,S]}var C=!1;N&&_&&(C=!s.isSibling(N[1],w)&&(!!s.equals(_[1],w)||s.common(N[1],w).length<s.common(_[1],w).length)),N&&!C?P[E]={path:N[1],offset:N[0].text.length}:_?P[E]={path:_[1],offset:0}:P=null}}P&&u.equals(P,e.selection)||(e.selection=P)}break;case"remove_text":var{path:D,offset:B,text:R}=t;if(0===R.length)break;Z(e,D,e=>{var t=e.text.slice(0,B),r=e.text.slice(B+R.length);return U(U({},e),{},{text:t+r})}),r=!0;break;case"set_node":var{path:I,properties:z,newProperties:V}=t;if(0===I.length)throw new Error("Cannot set properties on the root node!");W(e,I,e=>{var t=U({},e);for(var r in V){if("children"===r||"text"===r)throw new Error('Cannot set the "'.concat(r,'" property of nodes!'));var n=V[r];null==n?delete t[r]:t[r]=n}for(var o in z)V.hasOwnProperty(o)||delete t[o];return t});break;case"set_selection":var{newProperties:K}=t;if(null==K){e.selection=null;break}if(null==e.selection){if(!u.isRange(K))throw new Error('Cannot apply an incomplete "set_selection" operation properties '.concat(q.stringify(K)," when there is no current selection."));e.selection=U({},K);break}var G=U({},e.selection);for(var H in K){var Q=K[H];if(null==Q){if("anchor"===H||"focus"===H)throw new Error('Cannot remove the "'.concat(H,'" selection property'));delete G[H]}else G[H]=Q}e.selection=G;break;case"split_node":var{path:X,position:Y,properties:ee}=t,te=X[X.length-1];if(0===X.length)throw new Error('Cannot apply a "split_node" operation at path ['.concat(X,"] because the root node cannot be split."));J(e,s.parent(X),e=>{var t,r,n=e[te];if(L.isText(n)){var o=n.text.slice(0,Y),i=n.text.slice(Y);t=U(U({},n),{},{text:o}),r=U(U({},ee),{},{text:i})}else{var s=n.children.slice(0,Y),a=n.children.slice(Y);t=U(U({},n),{},{children:s}),r=U(U({},ee),{},{children:a})}return F(e,te,1,t,r)}),r=!0}if(r&&e.selection){var re=U({},e.selection);for(var[ne,oe]of u.points(re))re[oe]=T.transform(ne,t);u.equals(re,e.selection)||(e.selection=re)}}},H={insertNodes(e,t,r){e.insertNodes(t,r)},liftNodes(e,t){e.liftNodes(t)},mergeNodes(e,t){e.mergeNodes(t)},moveNodes(e,t){e.moveNodes(t)},removeNodes(e,t){e.removeNodes(t)},setNodes(e,t,r){e.setNodes(t,r)},splitNodes(e,t){e.splitNodes(t)},unsetNodes(e,t,r){e.unsetNodes(t,r)},unwrapNodes(e,t){e.unwrapNodes(t)},wrapNodes(e,t,r){e.wrapNodes(t,r)}},Q={collapse(e,t){e.collapse(t)},deselect(e){e.deselect()},move(e,t){e.move(t)},select(e,t){e.select(t)},setPoint(e,t,r){e.setPoint(t,r)},setSelection(e,t){e.setSelection(t)}},X={delete(e,t){e.delete(t)},insertFragment(e,t,r){e.insertFragment(t,r)},insertText(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};_.withoutNormalizing(e,()=>{var{voids:n=!1}=r,{at:o=N(e)}=r;if(s.isPath(o)&&(o=_.range(e,o)),u.isRange(o))if(u.isCollapsed(o))o=o.anchor;else{var i=u.end(o);if(!n&&_.void(e,{at:i}))return;var a=u.start(o),l=_.pointRef(e,a),c=_.pointRef(e,i);te.delete(e,{at:o,voids:n});var f=l.unref(),d=c.unref();o=f||d,te.setSelection(e,{anchor:o,focus:o})}if(!(!n&&_.void(e,{at:o})||_.elementReadOnly(e,{at:o}))){var{path:p,offset:h}=o;t.length>0&&e.apply({type:"insert_text",path:p,offset:h,text:t})}})}};function Y(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),r.push.apply(r,n)}return r}function ee(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?Y(Object(r),!0).forEach(function(t){c(e,t,r[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Y(Object(r)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))})}return e}var te=ee(ee(ee(ee({},G),H),Q),X);const re={buildCarouselElements(e,t){var r;const n=null!==(r=null==t?void 0:t.items)&&void 0!==r?r:2,o=[];for(let t=0;t<n;t+=1)o.push(e.y("carousel-list-item",{props:{order:t},children:[e.y.text(`Carousel ${t+1}`)]}));return e.y("carousel-container",{children:o})},addCarousel(e,n){var o,i,a,l,c;const f=t.getBlockSlate(e,{id:null==n?void 0:n.blockId});if(!f)return;const d=_.nodes(f,{at:[0],match:e=>v.isElement(e)&&"carousel-container"===e.type}),p=Array.from(d)[0];if(!p)return;const[,u]=p,h=_.nodes(f,{at:u,match:e=>v.isElement(e)&&"carousel-list"===e.type}),g=Array.from(h)[0];if(!g)return;const[,y]=g,m=_.nodes(f,{at:y,match:e=>v.isElement(e)&&"carousel-list-item"===e.type}),b=Array.from(m);let O,w;if((null==n?void 0:n.at)&&s.isPath(n.at)){O=s.next(n.at);const e=b.find(([,e])=>s.equals(e,n.at));w=e?(null===(o=e[0].props)||void 0===o?void 0:o.order)+1:b.length}else if(null==n?void 0:n.afterCarouselId){const e=b.find(([e])=>e.id===n.afterCarouselId);if(e){const[,t]=e;O=s.next(t),w=(null===(i=e[0].props)||void 0===i?void 0:i.order)+1}else O=[...y,b.length],w=b.length}else if(f.selection){const e=f.selection.anchor.path;let t,r;const n=_.above(f,{at:e,match:e=>v.isElement(e)&&"carousel-list-item"===e.type});if(n){const[e,o]=n;t=o,r=null===(a=e.props)||void 0===a?void 0:a.order}else for(const[n,o]of b)if(s.isDescendant(e,o)||s.equals(e,o)){t=o,r=null===(l=n.props)||void 0===l?void 0:l.order;break}void 0!==t&&void 0!==r?(O=s.next(t),w=r+1):(O=[...y,b.length],w=b.length)}else O=[...y,b.length],w=b.length;const x=[];for(const[e,t]of b){const r=null===(c=e.props)||void 0===c?void 0:c.order;r>=w&&x.push([t,r+1])}const P=r(),j=e.y("carousel-list-item",{id:P,props:{order:w},children:[e.y("carousel-list-item-heading",{children:[e.y.text(`Carousel ${w+1}`)]}),e.y("carousel-list-item-content",{children:[e.y.text("")]})]});_.withoutNormalizing(f,()=>{var e;for(const[t,r]of x)te.setNodes(f,{props:Object.assign(Object.assign({},null!==(e=f.children[t[0]].props)&&void 0!==e?e:{}),{order:r})},{at:t});te.insertNodes(f,j,{at:O});const t=[...O,0,0];setTimeout(()=>{te.select(f,{offset:0,path:t})},0)})},deleteCarousel(e,r){const n=t.getBlockSlate(e,{id:null==r?void 0:r.blockId});if(!n)return;const o=_.nodes(n,{at:[0],match:e=>v.isElement(e)&&"carousel-container"===e.type}),i=Array.from(o)[0];if(!i)return;const[,a]=i,l=_.nodes(n,{at:a,match:e=>v.isElement(e)&&"carousel-list"===e.type}),c=Array.from(l)[0];if(!c)return;const[,f]=c,d=_.nodes(n,{at:f,match:e=>v.isElement(e)&&"carousel-list-item"===e.type}),p=Array.from(d);_.withoutNormalizing(n,()=>{var o,i,a;if(1===p.length)return void t.deleteBlock(e,{blockId:r.blockId});const l=p.find(([e])=>e.id===(null==r?void 0:r.carouselId));if(!l)return;const[c,f]=l,d=null===(o=c.props)||void 0===o?void 0:o.order,u=[];for(const[e,t]of p){if(s.equals(t,f))continue;const r=null===(i=e.props)||void 0===i?void 0:i.order;r>d&&u.push([t,r-1])}for(const[e,t]of u)te.setNodes(n,{props:Object.assign(Object.assign({},null!==(a=n.children[e[0]].props)&&void 0!==a?a:{}),{order:t})},{at:e});te.removeNodes(n,{at:f})})},moveUp(e,r){var n;const o=t.getBlockSlate(e,{id:null==r?void 0:r.blockId});if(!o)return;const i=_.nodes(o,{at:[0],match:e=>v.isElement(e)&&"carousel-container"===e.type}),a=Array.from(i)[0];if(!a)return;const[,l]=a,c=_.nodes(o,{at:l,match:e=>v.isElement(e)&&"carousel-list"===e.type}),f=Array.from(c)[0];if(!f)return;const[,d]=f,p=_.nodes(o,{at:d,match:e=>v.isElement(e)&&"carousel-list-item"===e.type}),u=Array.from(p),h=u.find(([e])=>e.id===(null==r?void 0:r.carouselId));if(!h)return;const[g,y]=h,m=null===(n=g.props)||void 0===n?void 0:n.order;if(0===m)return;const b=u.find(([e])=>{var t;return(null===(t=e.props)||void 0===t?void 0:t.order)===m-1});if(!b)return;const[,O]=b;_.withoutNormalizing(o,()=>{var e,t;te.setNodes(o,{props:Object.assign(Object.assign({},null!==(e=o.children[y[0]].props)&&void 0!==e?e:{}),{order:m-1})},{at:y}),te.setNodes(o,{props:Object.assign(Object.assign({},null!==(t=o.children[O[0]].props)&&void 0!==t?t:{}),{order:m})},{at:O});const r=_.node(o,y)[0],n=_.node(o,O)[0];te.removeNodes(o,{at:y}),te.insertNodes(o,r,{at:O}),te.removeNodes(o,{at:s.next(O)}),te.insertNodes(o,n,{at:s.next(O)})})},moveDown(e,r){var n;const o=t.getBlockSlate(e,{id:null==r?void 0:r.blockId});if(!o)return;const i=_.nodes(o,{at:[0],match:e=>v.isElement(e)&&"carousel-container"===e.type}),a=Array.from(i)[0];if(!a)return;const[,l]=a,c=_.nodes(o,{at:l,match:e=>v.isElement(e)&&"carousel-list"===e.type}),f=Array.from(c)[0];if(!f)return;const[,d]=f,p=_.nodes(o,{at:d,match:e=>v.isElement(e)&&"carousel-list-item"===e.type}),u=Array.from(p),h=u.find(([e])=>e.id===(null==r?void 0:r.carouselId));if(!h)return;const[g,y]=h,m=null===(n=g.props)||void 0===n?void 0:n.order,b=Math.max(...u.map(([e])=>{var t;return null===(t=e.props)||void 0===t?void 0:t.order}));if(m===b)return;const O=u.find(([e])=>{var t;return(null===(t=e.props)||void 0===t?void 0:t.order)===m+1});if(!O)return;const[,w]=O;_.withoutNormalizing(o,()=>{var e,t;te.setNodes(o,{props:Object.assign(Object.assign({},null!==(e=o.children[y[0]].props)&&void 0!==e?e:{}),{order:m+1})},{at:y}),te.setNodes(o,{props:Object.assign(Object.assign({},null!==(t=o.children[w[0]].props)&&void 0!==t?t:{}),{order:m})},{at:w});const r=_.node(o,y)[0],n=_.node(o,w)[0];te.removeNodes(o,{at:w}),te.insertNodes(o,n,{at:y}),te.removeNodes(o,{at:y}),te.insertNodes(o,r,{at:s.next(y)})})}},ne=new n({type:"Carousel",elements:e("carousel-container",Object.assign({render:({attributes:t,children:r})=>e("div",Object.assign({},t,{"data-component-part":"carousel-container"},{children:r}))},{children:e("carousel-list-item",{render:({attributes:t,children:r})=>e("div",Object.assign({},t,{"data-component-part":"carousel-list-item"},{children:r}))})})),options:{display:{title:"Carousel",description:"Create a carousel to display images or content in a slider"},shortcuts:["carousel"]},commands:re,lifecycle:{beforeCreate:e=>re.buildCarouselElements(e,{items:5})},parsers:{html:{deserialize:{nodeNames:["DIV"],parse:e=>{const t=e.querySelector(':scope > div[style*="display: flex"]');if(!t)return;const r=t.querySelectorAll(":scope > div");if(0===r.length)return;const n=r[0];if(!("0 0 auto"===n.style.flex||"8px"===n.style.borderRadius))return;const o=[];return r.forEach((e,t)=>{o.push({id:`carousel-item-${t}`,type:"carousel-list-item",children:[{text:e.textContent||""}]})}),0!==o.length?{id:"carousel-container",type:"carousel-container",children:o,props:{nodeType:"block"}}:void 0}},serialize:(e,t,r)=>{const{depth:n=0}=r||{};if("carousel-container"===e.type){return`\n <div data-meta-depth="${n}" style="margin-left: ${20*n}px; overflow-x: auto;">\n <div style="display: flex; padding: 8px 0;">${(e.children||[]).map((e,t)=>{if("carousel-list-item"===e.type){return`<div style="flex: 0 0 auto; width: 200px; padding: 16px; border: 1px solid #e5e7eb; border-radius: 8px; margin-right: 16px;">${o(e.children)}</div>`}return""}).join("")}</div>\n </div>`}return""}},markdown:{serialize:(e,t,r)=>{const{depth:n=0}=r||{},o=" ".repeat(n);if("carousel-container"===e.type){return(e.children||[]).map((e,t)=>{if("carousel-list-item"===e.type){const r=i(e.children);return`${o}${t+1}. ${r}`}return""}).join("\n")}return""}},email:{serialize:(e,t,r)=>{const{depth:n=0}=r||{};if("carousel-container"===e.type){return`\n <table style="width: 100%; margin-left: ${20*n}px;">\n <tbody>\n <tr>${(e.children||[]).map((e,t)=>{if("carousel-list-item"===e.type){return`\n <td style="width: 200px; padding: 16px; border: 1px solid #e5e7eb; border-radius: 8px; vertical-align: top;">\n ${o(e.children)}\n </td>`}return""}).join("")}</tr>\n </tbody>\n </table>`}return""}}},events:{onKeyDown:(e,t,r)=>e=>{}}});export{re as CarouselCommands,ne as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"carousel-plugin.d.ts","sourceRoot":"","sources":["../../src/plugin/carousel-plugin.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,
|
|
1
|
+
{"version":3,"file":"carousel-plugin.d.ts","sourceRoot":"","sources":["../../src/plugin/carousel-plugin.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAsD,MAAM,gBAAgB,CAAC;AAIlG,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,UAAU,CAAC;AAcnD,eAAO,MAAM,cAAc,2DA2IzB,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@yoopta/carousel",
|
|
3
|
-
"version": "6.0.0-beta.
|
|
3
|
+
"version": "6.0.0-beta.9",
|
|
4
4
|
"description": "Carousel plugin for Yoopta Editor",
|
|
5
5
|
"author": "Darginec05 <devopsbanda@gmail.com>",
|
|
6
6
|
"homepage": "https://github.com/Darginec05/Yoopta-Editor#readme",
|
|
@@ -38,5 +38,5 @@
|
|
|
38
38
|
"bugs": {
|
|
39
39
|
"url": "https://github.com/Darginec05/Yoopta-Editor/issues"
|
|
40
40
|
},
|
|
41
|
-
"gitHead": "
|
|
41
|
+
"gitHead": "4a55643c3f8ffc0d0373ff2643cf12099976c28e"
|
|
42
42
|
}
|