@yoopta/embed 4.9.9 → 6.0.0-beta.10
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/commands/index.d.ts +23 -10
- package/dist/commands/index.d.ts.map +1 -1
- package/dist/hooks/useEmbedUrl.d.ts +18 -0
- package/dist/hooks/useEmbedUrl.d.ts.map +1 -0
- package/dist/hooks/useIntersectionObserver.d.ts.map +1 -1
- package/dist/index.d.ts +7 -9
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1 -1
- package/dist/plugin/{index.d.ts → embed-plugin.d.ts} +2 -2
- package/dist/plugin/embed-plugin.d.ts.map +1 -0
- package/dist/types.d.ts +53 -15
- package/dist/types.d.ts.map +1 -1
- package/dist/utils/oembed.d.ts +16 -0
- package/dist/utils/oembed.d.ts.map +1 -0
- package/dist/utils/providers.d.ts +41 -19
- package/dist/utils/providers.d.ts.map +1 -1
- package/package.json +7 -11
- package/dist/plugin/index.d.ts.map +0 -1
- package/dist/providers/DailyMotion.d.ts +0 -4
- package/dist/providers/DailyMotion.d.ts.map +0 -1
- package/dist/providers/Figma.d.ts +0 -4
- package/dist/providers/Figma.d.ts.map +0 -1
- package/dist/providers/Instagram.d.ts +0 -15
- package/dist/providers/Instagram.d.ts.map +0 -1
- package/dist/providers/Loom.d.ts +0 -3
- package/dist/providers/Loom.d.ts.map +0 -1
- package/dist/providers/Twitter.d.ts +0 -4
- package/dist/providers/Twitter.d.ts.map +0 -1
- package/dist/providers/Vimeo.d.ts +0 -4
- package/dist/providers/Vimeo.d.ts.map +0 -1
- package/dist/providers/Wistia.d.ts +0 -4
- package/dist/providers/Wistia.d.ts.map +0 -1
- package/dist/providers/Youtube.d.ts +0 -4
- package/dist/providers/Youtube.d.ts.map +0 -1
- package/dist/ui/Embed.d.ts +0 -4
- package/dist/ui/Embed.d.ts.map +0 -1
- package/dist/ui/EmbedBlockOptions.d.ts +0 -10
- package/dist/ui/EmbedBlockOptions.d.ts.map +0 -1
- package/dist/ui/EmbedComponent.d.ts +0 -10
- package/dist/ui/EmbedComponent.d.ts.map +0 -1
- package/dist/ui/EmbedLinkUploader.d.ts +0 -6
- package/dist/ui/EmbedLinkUploader.d.ts.map +0 -1
- package/dist/ui/EmbedUploader.d.ts +0 -10
- package/dist/ui/EmbedUploader.d.ts.map +0 -1
- package/dist/ui/Placeholder.d.ts +0 -7
- package/dist/ui/Placeholder.d.ts.map +0 -1
- package/dist/ui/Resizer.d.ts +0 -5
- package/dist/ui/Resizer.d.ts.map +0 -1
package/dist/commands/index.d.ts
CHANGED
|
@@ -1,23 +1,36 @@
|
|
|
1
|
-
import { YooEditor, YooptaPathIndex } from '@yoopta/editor';
|
|
2
|
-
import { EmbedElement, EmbedElementProps, EmbedSizes } from '../types';
|
|
1
|
+
import type { YooEditor, YooptaPathIndex } from '@yoopta/editor';
|
|
2
|
+
import type { EmbedElement, EmbedElementProps, EmbedProvider, EmbedSizes } from '../types';
|
|
3
3
|
type EmbedElementOptions = {
|
|
4
|
-
props?:
|
|
5
|
-
sizes?: EmbedSizes;
|
|
6
|
-
provider?: {
|
|
7
|
-
url: string;
|
|
8
|
-
};
|
|
9
|
-
};
|
|
4
|
+
props?: Partial<EmbedElementProps>;
|
|
10
5
|
};
|
|
11
6
|
type InsertEmbedOptions = EmbedElementOptions & {
|
|
12
7
|
at?: YooptaPathIndex;
|
|
13
8
|
focus?: boolean;
|
|
14
9
|
};
|
|
15
|
-
|
|
10
|
+
type InsertEmbedFromUrlOptions = {
|
|
11
|
+
url: string;
|
|
12
|
+
at?: YooptaPathIndex;
|
|
13
|
+
focus?: boolean;
|
|
14
|
+
fetchMeta?: boolean;
|
|
15
|
+
maxWidth?: number;
|
|
16
|
+
};
|
|
17
|
+
type UpdateEmbedUrlOptions = {
|
|
18
|
+
blockId: string;
|
|
19
|
+
url: string;
|
|
20
|
+
fetchMeta?: boolean;
|
|
21
|
+
maxWidth?: number;
|
|
22
|
+
};
|
|
23
|
+
export type EmbedCommandsType = {
|
|
16
24
|
buildEmbedElements: (editor: YooEditor, options?: Partial<EmbedElementOptions>) => EmbedElement;
|
|
17
25
|
insertEmbed: (editor: YooEditor, options?: Partial<InsertEmbedOptions>) => void;
|
|
26
|
+
insertEmbedFromUrl: (editor: YooEditor, options: InsertEmbedFromUrlOptions) => Promise<string | null>;
|
|
18
27
|
deleteEmbed: (editor: YooEditor, blockId: string) => void;
|
|
19
28
|
updateEmbed: (editor: YooEditor, blockId: string, props: Partial<EmbedElementProps>) => void;
|
|
29
|
+
updateEmbedUrl: (editor: YooEditor, options: UpdateEmbedUrlOptions) => Promise<void>;
|
|
30
|
+
updateEmbedSizes: (editor: YooEditor, blockId: string, sizes: EmbedSizes) => void;
|
|
31
|
+
isValidEmbedUrl: (editor: YooEditor, url: string) => boolean;
|
|
32
|
+
parseUrl: (editor: YooEditor, url: string) => EmbedProvider | null;
|
|
20
33
|
};
|
|
21
|
-
export declare const EmbedCommands:
|
|
34
|
+
export declare const EmbedCommands: EmbedCommandsType;
|
|
22
35
|
export {};
|
|
23
36
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/commands/index.ts"],"names":[],"mappings":"AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/commands/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,eAAe,EAAE,MAAM,gBAAgB,CAAC;AAGjE,OAAO,KAAK,EACV,YAAY,EACZ,iBAAiB,EACjB,aAAa,EAEb,UAAU,EACX,MAAM,UAAU,CAAC;AAYlB,KAAK,mBAAmB,GAAG;IACzB,KAAK,CAAC,EAAE,OAAO,CAAC,iBAAiB,CAAC,CAAC;CACpC,CAAC;AAEF,KAAK,kBAAkB,GAAG,mBAAmB,GAAG;IAC9C,EAAE,CAAC,EAAE,eAAe,CAAC;IACrB,KAAK,CAAC,EAAE,OAAO,CAAC;CACjB,CAAC;AAEF,KAAK,yBAAyB,GAAG;IAC/B,GAAG,EAAE,MAAM,CAAC;IACZ,EAAE,CAAC,EAAE,eAAe,CAAC;IACrB,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,QAAQ,CAAC,EAAE,MAAM,CAAC;CACnB,CAAC;AAEF,KAAK,qBAAqB,GAAG;IAC3B,OAAO,EAAE,MAAM,CAAC;IAChB,GAAG,EAAE,MAAM,CAAC;IACZ,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,QAAQ,CAAC,EAAE,MAAM,CAAC;CACnB,CAAC;AAMF,MAAM,MAAM,iBAAiB,GAAG;IAC9B,kBAAkB,EAAE,CAAC,MAAM,EAAE,SAAS,EAAE,OAAO,CAAC,EAAE,OAAO,CAAC,mBAAmB,CAAC,KAAK,YAAY,CAAC;IAChG,WAAW,EAAE,CAAC,MAAM,EAAE,SAAS,EAAE,OAAO,CAAC,EAAE,OAAO,CAAC,kBAAkB,CAAC,KAAK,IAAI,CAAC;IAChF,kBAAkB,EAAE,CAAC,MAAM,EAAE,SAAS,EAAE,OAAO,EAAE,yBAAyB,KAAK,OAAO,CAAC,MAAM,GAAG,IAAI,CAAC,CAAC;IACtG,WAAW,EAAE,CAAC,MAAM,EAAE,SAAS,EAAE,OAAO,EAAE,MAAM,KAAK,IAAI,CAAC;IAC1D,WAAW,EAAE,CAAC,MAAM,EAAE,SAAS,EAAE,OAAO,EAAE,MAAM,EAAE,KAAK,EAAE,OAAO,CAAC,iBAAiB,CAAC,KAAK,IAAI,CAAC;IAC7F,cAAc,EAAE,CAAC,MAAM,EAAE,SAAS,EAAE,OAAO,EAAE,qBAAqB,KAAK,OAAO,CAAC,IAAI,CAAC,CAAC;IACrF,gBAAgB,EAAE,CAAC,MAAM,EAAE,SAAS,EAAE,OAAO,EAAE,MAAM,EAAE,KAAK,EAAE,UAAU,KAAK,IAAI,CAAC;IAClF,eAAe,EAAE,CAAC,MAAM,EAAE,SAAS,EAAE,GAAG,EAAE,MAAM,KAAK,OAAO,CAAC;IAC7D,QAAQ,EAAE,CAAC,MAAM,EAAE,SAAS,EAAE,GAAG,EAAE,MAAM,KAAK,aAAa,GAAG,IAAI,CAAC;CACpE,CAAC;AAMF,eAAO,MAAM,aAAa,EAAE,iBAgK3B,CAAC"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import type { EmbedProvider, EmbedProviderMeta, EmbedSizes } from '../types';
|
|
2
|
+
export type UseEmbedUrlState = {
|
|
3
|
+
url: string;
|
|
4
|
+
provider: EmbedProvider | null;
|
|
5
|
+
sizes: EmbedSizes;
|
|
6
|
+
isValid: boolean;
|
|
7
|
+
isLoading: boolean;
|
|
8
|
+
error: string | null;
|
|
9
|
+
};
|
|
10
|
+
export type UseEmbedUrlActions = {
|
|
11
|
+
setUrl: (url: string) => void;
|
|
12
|
+
parseUrl: (url: string) => EmbedProvider | null;
|
|
13
|
+
fetchMeta: () => Promise<EmbedProviderMeta | undefined>;
|
|
14
|
+
reset: () => void;
|
|
15
|
+
};
|
|
16
|
+
export type UseEmbedUrlReturn = UseEmbedUrlState & UseEmbedUrlActions;
|
|
17
|
+
export declare function useEmbedUrl(maxWidth?: number): UseEmbedUrlReturn;
|
|
18
|
+
//# sourceMappingURL=useEmbedUrl.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useEmbedUrl.d.ts","sourceRoot":"","sources":["../../src/hooks/useEmbedUrl.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,aAAa,EAAE,iBAAiB,EAAE,UAAU,EAAE,MAAM,UAAU,CAAC;AAI7E,MAAM,MAAM,gBAAgB,GAAG;IAC7B,GAAG,EAAE,MAAM,CAAC;IACZ,QAAQ,EAAE,aAAa,GAAG,IAAI,CAAC;IAC/B,KAAK,EAAE,UAAU,CAAC;IAClB,OAAO,EAAE,OAAO,CAAC;IACjB,SAAS,EAAE,OAAO,CAAC;IACnB,KAAK,EAAE,MAAM,GAAG,IAAI,CAAC;CACtB,CAAC;AAEF,MAAM,MAAM,kBAAkB,GAAG;IAC/B,MAAM,EAAE,CAAC,GAAG,EAAE,MAAM,KAAK,IAAI,CAAC;IAC9B,QAAQ,EAAE,CAAC,GAAG,EAAE,MAAM,KAAK,aAAa,GAAG,IAAI,CAAC;IAChD,SAAS,EAAE,MAAM,OAAO,CAAC,iBAAiB,GAAG,SAAS,CAAC,CAAC;IACxD,KAAK,EAAE,MAAM,IAAI,CAAC;CACnB,CAAC;AAEF,MAAM,MAAM,iBAAiB,GAAG,gBAAgB,GAAG,kBAAkB,CAAC;AAWtE,wBAAgB,WAAW,CAAC,QAAQ,GAAE,MAAY,GAAG,iBAAiB,CA+ErE"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useIntersectionObserver.d.ts","sourceRoot":"","sources":["../../src/hooks/useIntersectionObserver.ts"],"names":[],"mappings":"AAEA;;;;;GAKG;AACH,wBAAgB,uBAAuB,CACrC,UAAU,KAAA,EACV,EAAE,SAAa,EAAE,IAAW,EAAE,UAAiB,EAAE,iBAAyB,EAAE;;;;;CAAK,GAChF,yBAAyB,
|
|
1
|
+
{"version":3,"file":"useIntersectionObserver.d.ts","sourceRoot":"","sources":["../../src/hooks/useIntersectionObserver.ts"],"names":[],"mappings":"AAEA;;;;;GAKG;AACH,wBAAgB,uBAAuB,CACrC,UAAU,KAAA,EACV,EAAE,SAAa,EAAE,IAAW,EAAE,UAAiB,EAAE,iBAAyB,EAAE;;;;;CAAK,GAChF,yBAAyB,CAyB3B"}
|
package/dist/index.d.ts
CHANGED
|
@@ -1,12 +1,10 @@
|
|
|
1
|
-
import { Embed } from './plugin';
|
|
2
|
-
import { EmbedElement, EmbedElementProps } from './types';
|
|
3
|
-
import './styles.css';
|
|
4
|
-
declare module 'slate' {
|
|
5
|
-
interface CustomTypes {
|
|
6
|
-
Element: EmbedElement;
|
|
7
|
-
}
|
|
8
|
-
}
|
|
1
|
+
import { Embed } from './plugin/embed-plugin';
|
|
9
2
|
export { EmbedCommands } from './commands';
|
|
3
|
+
export type { EmbedCommandsType } from './commands';
|
|
4
|
+
export type { EmbedAspectRatio, EmbedElement, EmbedElementMap, EmbedElementProps, EmbedPluginElements, EmbedPluginOptions, EmbedProvider, EmbedProviderMeta, EmbedProviderRenderProps, EmbedProviderType, EmbedSizes, OEmbedResponse, ProviderConfig, } from './types';
|
|
5
|
+
export { useEmbedUrl } from './hooks/useEmbedUrl';
|
|
6
|
+
export type { UseEmbedUrlReturn, UseEmbedUrlState, UseEmbedUrlActions } from './hooks/useEmbedUrl';
|
|
7
|
+
export { calculateEmbedDimensions, detectProvider, getOEmbedUrl, getProviderAspectRatio, getProviderConfig, getSupportedProviders, isEmbedUrl, parseEmbedUrl, PROVIDER_CONFIGS, } from './utils/providers';
|
|
8
|
+
export { extractProviderMeta, fetchOEmbed, fetchOEmbedViaProxy, } from './utils/oembed';
|
|
10
9
|
export default Embed;
|
|
11
|
-
export { EmbedElement, EmbedElementProps };
|
|
12
10
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,KAAK,EAAE,MAAM,uBAAuB,CAAC;AAG9C,OAAO,EAAE,aAAa,EAAE,MAAM,YAAY,CAAC;AAC3C,YAAY,EAAE,iBAAiB,EAAE,MAAM,YAAY,CAAC;AAGpD,YAAY,EACV,gBAAgB,EAChB,YAAY,EACZ,eAAe,EACf,iBAAiB,EACjB,mBAAmB,EACnB,kBAAkB,EAClB,aAAa,EACb,iBAAiB,EACjB,wBAAwB,EACxB,iBAAiB,EACjB,UAAU,EACV,cAAc,EACd,cAAc,GACf,MAAM,SAAS,CAAC;AAGjB,OAAO,EAAE,WAAW,EAAE,MAAM,qBAAqB,CAAC;AAClD,YAAY,EAAE,iBAAiB,EAAE,gBAAgB,EAAE,kBAAkB,EAAE,MAAM,qBAAqB,CAAC;AAGnG,OAAO,EACL,wBAAwB,EACxB,cAAc,EACd,YAAY,EACZ,sBAAsB,EACtB,iBAAiB,EACjB,qBAAqB,EACrB,UAAU,EACV,aAAa,EACb,gBAAgB,GACjB,MAAM,mBAAmB,CAAC;AAE3B,OAAO,EACL,mBAAmB,EACnB,WAAW,EACX,mBAAmB,GACpB,MAAM,gBAAgB,CAAC;AAGxB,eAAe,KAAK,CAAC"}
|
package/dist/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{generateId as e,buildBlockData as t,Blocks as o,Elements as i,useYooptaEditor as n,UI as r,useBlockData as s,useYooptaPluginOptions as a,useYooptaReadOnly as l,useBlockSelected as d,YooptaPlugin as c}from"@yoopta/editor";import{jsxs as h,jsx as p}from"react/jsx-runtime";import*as u from"react";import{useState as m,useEffect as f,useRef as b,useLayoutEffect as g,forwardRef as y,createElement as w,useMemo as x}from"react";import*as v from"react-dom";import{flushSync as z}from"react-dom";function _(e){return e.includes("youtube.com")||e.includes("youtu.be")?"youtube":e.includes("vimeo.com")?"vimeo":e.includes("dailymotion.com")||e.includes("dai.ly")?"dailymotion":e.includes("loom.com")?"loom":e.includes("wistia.com")||e.includes("wistia.net")?"wistia":e.includes("twitter")||e.includes("https://x.com")?"twitter":e.includes("figma")?"figma":e.includes("instagram.com")?"instagram":null}const C={youtube:e=>{const t=e.match(/^.*(youtu.be\/|v\/|u\/\w\/|embed\/|watch\?v=|&v=)([^#&?]*).*/);return t&&11===t[2].length?t[2]:null},vimeo:e=>new URL(e).pathname.split("/")[1],dailymotion:e=>{const t=e.match(/^.+dailymotion.com\/(embed|hub)\/([^_]+)[^#]*(#embed=([^_&]+))?/);return null!==t?void 0!==t[4]?t[4]:t[2]:null},wistia:e=>{try{const t=e.match(/(?:https?:\/\/)?(?:fast\.)?wistia\.(?:com|net)\/embed\/iframe\/([a-zA-Z0-9]+)/);if(t)return t[1];const o=e.match(/(?:https?:\/\/)?(?:www\.)?wistia\.com\/medias\/([a-zA-Z0-9]+)/);return o?o[1]:null}catch(e){return console.error("Error extracting Wistia ID:",e),null}},loom:e=>{try{const t=e.match(/(?:https?:\/\/)?(?:www\.)?loom\.com\/share\/([a-zA-Z0-9]+)/);return t?t[1]:null}catch(e){return console.error("Error extracting Loom ID:",e),null}},twitter:function(e){const t=e.match(/\/status\/(\d+)/);return t?t[1]:null},figma:function(e){const t=new URL(e).searchParams,o=t.get("node-id");return t.get("node-id")?o:"unknown"},instagram:function(e){const t=e.match(/(?:https?:\/\/)?(?:www\.)?instagram\.com(?:\/p\/|\/reel\/|\/tv\/)([^\/?#&]+).*$/);return t?t[1]:null}},R={buildEmbedElements:(t,o={})=>{var i,n;const r=Object.assign(Object.assign({},o.props),{nodeType:"void"});if(null===(i=r.provider)||void 0===i?void 0:i.url){const e=r.provider.url,t=_(e),o=t?null===(n=C[t])||void 0===n?void 0:n.call(C,e):null,i={type:t,id:o,url:e};t&&o||(i.id=e),r.provider=i}return{id:e(),type:"embed",children:[{text:""}],props:r}},insertEmbed:(e,i={})=>{const{at:n,focus:r,props:s}=i,a=R.buildEmbedElements(e,{props:s}),l=t({value:[a],type:"Embed",meta:{align:"center",depth:0}});o.insertBlock(e,l.type,{focus:r,at:n,blockData:l})},deleteEmbed:(e,t)=>{o.deleteBlock(e,{blockId:t})},updateEmbed:(e,t,o)=>{i.updateElement(e,t,{props:o})}};function S(e,{threshold:t=0,root:o=null,rootMargin:i="0%",freezeOnceVisible:n=!1}={}){const[r,s]=m({}),a=r.isIntersecting&&n,l=([e])=>s(e);return f((()=>{const n=null==e?void 0:e.current;if(!window.IntersectionObserver||a||!n)return;const r=new IntersectionObserver(l,{threshold:t,root:o,rootMargin:i});return r.observe(n),()=>r.disconnect()}),[e,t,o,i,a]),r}"function"==typeof SuppressedError&&SuppressedError;const O={vimeo:function({provider:e,width:t,height:o,attributes:i,children:n}){const r=b(null),[s,a]=m(null),[l,d]=m(!1),{isIntersecting:c}=S(r,{freezeOnceVisible:!0,rootMargin:"50%"});return f((()=>{fetch(`https://vimeo.com/api/v2/embed/${e.id}.json`).then((e=>e.json())).then((e=>a(e[0].thumbnail_medium))).catch((()=>a(null)))}),[e.id]),h("div",Object.assign({},i,{ref:e=>{r.current=e,i.ref(e)},className:"yoo-embed-relative"},{children:[p("img",{src:s||"",alt:"vimeo_embed_preview",width:"100%",height:"100%",className:"yoo-embed-absolute yoo-embed-top-0 yoo-embed-left-0 yoo-embed-w-full yoo-embed-h-full",style:{opacity:c&&l?0:1,zIndex:c&&l?-1:0}}),c&&p("iframe",{title:"Embed Player",src:`https://player.vimeo.com/embed/${e.id}?badge=0&byline=0&portrait=0&title=0`,frameBorder:0,allowFullScreen:!0,onLoad:()=>d(!0),className:"yoo-embed-absolute yoo-embed-top-0 yoo-embed-left-0",width:t,height:o}),n]}))},youtube:function({provider:e,width:t,height:o,attributes:i,children:n}){const r=b(null),[s,a]=m(!1),{isIntersecting:l}=S(r,{freezeOnceVisible:!0,rootMargin:"50%"});return h("div",Object.assign({},i,{ref:e=>{r.current=e,i.ref(e)},className:"yoo-embed-relative"},{children:[p("img",{src:`https://i.ytimg.com/vi/${e.id}/default.jpg`,alt:"youtube_embed_preview",width:"100%",height:"100%",className:"yoo-embed-absolute yoo-embed-top-0 yoo-embed-left-0 yoo-embed-w-full yoo-embed-h-full",style:{opacity:l&&s?0:1,zIndex:l&&s?-1:0}}),l&&p("iframe",{title:"Embed Player",src:`https://www.youtube.com/embed/${e.id}`,frameBorder:0,onLoad:()=>a(!0),allowFullScreen:!0,className:"yoo-embed-absolute yoo-embed-top-0 yoo-embed-left-0",width:t,height:o}),n]}))},dailymotion:function({provider:e,width:t,height:o,attributes:i,children:n}){const r=b(null),[s,a]=m(null),[l,d]=m(!1),{isIntersecting:c}=S(r,{freezeOnceVisible:!0,rootMargin:"50%"});return f((()=>{var t;fetch((t=e.id,`https://api.dailymotion.com/embed/${t}?fields=thumbnail_url`)).then((e=>e.json())).then((e=>a(e.thumbnail_url))).catch((()=>a(null)))}),[e.id]),h("div",Object.assign({},n,{ref:e=>{r.current=e,i.ref(e)},className:"yoo-embed-relative"},{children:[p("img",{src:s||"",alt:"daylimotion_embed_preview",width:"100%",height:"100%",className:"yoo-embed-absolute yoo-embed-top-0 yoo-embed-left-0 yoo-embed-w-full yoo-embed-h-full",style:{opacity:c&&l?0:1,zIndex:c&&l?-1:0}}),c&&p("iframe",{title:"Dailymotion Embed Player",frameBorder:0,onLoad:()=>d(!0),src:`https://www.dailymotion.com/embed/embed/${e.id}`,allowFullScreen:!0,className:"yoo-embed-absolute yoo-embed-top-0 yoo-embed-left-0",width:t,height:o}),n]}))},figma:({provider:e,width:t,height:o,attributes:i,children:n})=>{const r=b(null),{isIntersecting:s}=S(r,{freezeOnceVisible:!0,rootMargin:"50%"});return h("div",Object.assign({className:"yoo-embed-relative"},i,{ref:e=>{r.current=e,i.ref(e)}},{children:[s&&p("iframe",{src:`https://www.figma.com/embed?embed_host=share&url=${encodeURIComponent((null==e?void 0:e.url)||"")}`,frameBorder:0,allowFullScreen:!0,className:"yoo-embed-absolute yoo-embed-top-0 yoo-embed-left-0",width:t,height:o}),n]}))},twitter:function({provider:e,blockId:t,attributes:o,children:r,height:s,width:a}){const l=b(null),d=n(),{isIntersecting:c}=S(l,{freezeOnceVisible:!0,rootMargin:"50%"}),u=`${t}-${e.id}`;return f((()=>{if(!c)return;const o=document.createElement("script");o.src="https://platform.twitter.com/widgets.js",o.async=!0,document.body.appendChild(o);const n=()=>{window.twttr&&window.twttr.widgets.createTweet(e.id,document.getElementById(u),{align:"center",conversation:"none",dnt:!0,theme:"light"}).then((e=>{e&&i.updateElement(d,t,{type:"embed",props:{sizes:{height:e.offsetHeight+16,width:e.offsetWidth}}})}))};return window.twttr?n():o.onload=n,()=>{document.body.removeChild(o)}}),[e.id,c,t,d]),h("div",Object.assign({className:"yoo-embed-w-full"},o,{children:[p("div",{id:u,ref:l}),r]}))},instagram:({provider:e,width:t,height:o,attributes:i,children:n})=>{const r=`https://www.instagram.com/p/${e.id}/embed`,s=b(null),{isIntersecting:a}=S(s,{freezeOnceVisible:!0,rootMargin:"50%"});return p("div",Object.assign({className:"yoo-embed-w-full yoo-embed-h-full"},i,{children:h("div",Object.assign({ref:s},{children:[a&&p("iframe",{src:r,width:"auto"===t?"100%":t,height:"auto"===o?"100%":o,frameBorder:"0",scrolling:"no",allowTransparency:!0,allowFullScreen:!0,className:"yoo-embed-absolute yoo-embed-top-0 yoo-embed-left-0"}),n]}))}))},loom:function({provider:e,attributes:t,children:o,width:i,height:n}){const r=b(null),[s,a]=m(!1),[l,d]=m(0),{isIntersecting:c}=S(r,{freezeOnceVisible:!0,rootMargin:"50%"});return f((()=>{c&&d((e=>e+1))}),[c]),h("div",Object.assign({},t,{ref:e=>{r.current=e,t.ref(e)},className:"yoo-video-relative",style:{width:i,height:n}},{children:[p("div",Object.assign({style:{position:"relative",width:"100%",height:"100%"}},{children:c&&p("iframe",{title:"Loom Video Player",src:`https://www.loom.com/embed/${e.id}?hide_owner=true&hide_share=true&hide_title=true&hideEmbedTopBar=true`,frameBorder:"0",allowFullScreen:!0,onLoad:()=>a(!0),style:{position:"absolute",top:0,left:0,width:"100%",height:"100%",border:"none",borderRadius:"4px"}},l)})),o]}))},wistia:function({provider:e,attributes:t,children:o,width:i,height:n}){const r=b(null),[s,a]=m(!1),{isIntersecting:l}=S(r,{freezeOnceVisible:!0,rootMargin:"50%"});return h("div",Object.assign({},t,{ref:e=>{r.current=e,t.ref(e)},className:"yoo-video-relative",style:{width:i,height:n}},{children:[p("div",Object.assign({style:{position:"relative",width:"100%",height:"100%"}},{children:l&&p("iframe",{src:`https://fast.wistia.net/embed/iframe/${e.id}?videoFoam=false`,title:"Wistia Video Player",frameBorder:"0",allowFullScreen:!0,onLoad:()=>a(!0),style:{position:"absolute",top:0,left:0,width:"100%",height:"100%",border:"none",borderRadius:"4px"}})})),o]}))}},k=({width:e,height:t,provider:o,blockId:i,attributes:n,children:r})=>{if(!o)return null;if(o&&o.id&&o.type&&O[o.type]){const s=O[o.type];return p(s,Object.assign({provider:o,width:e,height:t,blockId:i,attributes:n},{children:r}))}return h("div",Object.assign({className:"yoo-embed-w-full"},n,{children:[p("iframe",{src:o.url,width:"100%",height:"100%",frameBorder:0,allowFullScreen:!0,className:"yoo-embed-absolute yoo-embed-top-0 yoo-embed-left-0"}),r]}))};var E,M=(E=function(e,t){return E=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var o in t)Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o])},E(e,t)},function(e,t){function o(){this.constructor=e}E(e,t),e.prototype=null===t?Object.create(t):(o.prototype=t.prototype,new o)}),N=function(){return N=Object.assign||function(e){for(var t,o=1,i=arguments.length;o<i;o++)for(var n in t=arguments[o])Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n]);return e},N.apply(this,arguments)},j={width:"100%",height:"10px",top:"0px",left:"0px",cursor:"row-resize"},L={width:"10px",height:"100%",top:"0px",left:"0px",cursor:"col-resize"},W={width:"20px",height:"20px",position:"absolute"},H={top:N(N({},j),{top:"-5px"}),right:N(N({},L),{left:void 0,right:"-5px"}),bottom:N(N({},j),{top:void 0,bottom:"-5px"}),left:N(N({},L),{left:"-5px"}),topRight:N(N({},W),{right:"-10px",top:"-10px",cursor:"ne-resize"}),bottomRight:N(N({},W),{right:"-10px",bottom:"-10px",cursor:"se-resize"}),bottomLeft:N(N({},W),{left:"-10px",bottom:"-10px",cursor:"sw-resize"}),topLeft:N(N({},W),{left:"-10px",top:"-10px",cursor:"nw-resize"})},B=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.onMouseDown=function(e){t.props.onResizeStart(e,t.props.direction)},t.onTouchStart=function(e){t.props.onResizeStart(e,t.props.direction)},t}return M(t,e),t.prototype.render=function(){return u.createElement("div",{className:this.props.className||"",style:N(N({position:"absolute",userSelect:"none"},H[this.props.direction]),this.props.replaceStyles||{}),onMouseDown:this.onMouseDown,onTouchStart:this.onTouchStart},this.props.children)},t}(u.PureComponent),P=function(){var e=function(t,o){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var o in t)Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o])},e(t,o)};return function(t,o){function i(){this.constructor=t}e(t,o),t.prototype=null===o?Object.create(o):(i.prototype=o.prototype,new i)}}(),T=function(){return T=Object.assign||function(e){for(var t,o=1,i=arguments.length;o<i;o++)for(var n in t=arguments[o])Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n]);return e},T.apply(this,arguments)},A={width:"auto",height:"auto"},F=function(e,t,o){return Math.max(Math.min(e,o),t)},I=function(e,t){return Math.round(e/t)*t},D=function(e,t){return new RegExp(e,"i").test(t)},$=function(e){return Boolean(e.touches&&e.touches.length)},V=function(e,t,o){void 0===o&&(o=0);var i=t.reduce((function(o,i,n){return Math.abs(i-e)<Math.abs(t[o]-e)?n:o}),0),n=Math.abs(t[i]-e);return 0===o||n<o?t[i]:e},Z=function(e){return"auto"===(e=e.toString())||e.endsWith("px")||e.endsWith("%")||e.endsWith("vh")||e.endsWith("vw")||e.endsWith("vmax")||e.endsWith("vmin")?e:e+"px"},U=function(e,t,o,i){if(e&&"string"==typeof e){if(e.endsWith("px"))return Number(e.replace("px",""));if(e.endsWith("%"))return t*(Number(e.replace("%",""))/100);if(e.endsWith("vw"))return o*(Number(e.replace("vw",""))/100);if(e.endsWith("vh"))return i*(Number(e.replace("vh",""))/100)}return e},X=["as","style","className","grid","snap","bounds","boundsByDirection","size","defaultSize","minWidth","minHeight","maxWidth","maxHeight","lockAspectRatio","lockAspectRatioExtraWidth","lockAspectRatioExtraHeight","enable","handleStyles","handleClasses","handleWrapperStyle","handleWrapperClass","children","onResizeStart","onResize","onResizeStop","handleComponent","scale","resizeRatio","snapGap"],Y="__resizable_base__",G=function(e){function t(t){var o=e.call(this,t)||this;return o.ratio=1,o.resizable=null,o.parentLeft=0,o.parentTop=0,o.resizableLeft=0,o.resizableRight=0,o.resizableTop=0,o.resizableBottom=0,o.targetLeft=0,o.targetTop=0,o.appendBase=function(){if(!o.resizable||!o.window)return null;var e=o.parentNode;if(!e)return null;var t=o.window.document.createElement("div");return t.style.width="100%",t.style.height="100%",t.style.position="absolute",t.style.transform="scale(0, 0)",t.style.left="0",t.style.flex="0 0 100%",t.classList?t.classList.add(Y):t.className+=Y,e.appendChild(t),t},o.removeBase=function(e){var t=o.parentNode;t&&t.removeChild(e)},o.ref=function(e){e&&(o.resizable=e)},o.state={isResizing:!1,width:void 0===(o.propsSize&&o.propsSize.width)?"auto":o.propsSize&&o.propsSize.width,height:void 0===(o.propsSize&&o.propsSize.height)?"auto":o.propsSize&&o.propsSize.height,direction:"right",original:{x:0,y:0,width:0,height:0},backgroundStyle:{height:"100%",width:"100%",backgroundColor:"rgba(0,0,0,0)",cursor:"auto",opacity:0,position:"fixed",zIndex:9999,top:"0",left:"0",bottom:"0",right:"0"},flexBasis:void 0},o.onResizeStart=o.onResizeStart.bind(o),o.onMouseMove=o.onMouseMove.bind(o),o.onMouseUp=o.onMouseUp.bind(o),o}return P(t,e),Object.defineProperty(t.prototype,"parentNode",{get:function(){return this.resizable?this.resizable.parentNode:null},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"window",{get:function(){return this.resizable&&this.resizable.ownerDocument?this.resizable.ownerDocument.defaultView:null},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"propsSize",{get:function(){return this.props.size||this.props.defaultSize||A},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"size",{get:function(){var e=0,t=0;if(this.resizable&&this.window){var o=this.resizable.offsetWidth,i=this.resizable.offsetHeight,n=this.resizable.style.position;"relative"!==n&&(this.resizable.style.position="relative"),e="auto"!==this.resizable.style.width?this.resizable.offsetWidth:o,t="auto"!==this.resizable.style.height?this.resizable.offsetHeight:i,this.resizable.style.position=n}return{width:e,height:t}},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"sizeStyle",{get:function(){var e=this,t=this.props.size,o=function(t){if(void 0===e.state[t]||"auto"===e.state[t])return"auto";if(e.propsSize&&e.propsSize[t]&&e.propsSize[t].toString().endsWith("%")){if(e.state[t].toString().endsWith("%"))return e.state[t].toString();var o=e.getParentSize();return Number(e.state[t].toString().replace("px",""))/o[t]*100+"%"}return Z(e.state[t])};return{width:t&&void 0!==t.width&&!this.state.isResizing?Z(t.width):o("width"),height:t&&void 0!==t.height&&!this.state.isResizing?Z(t.height):o("height")}},enumerable:!1,configurable:!0}),t.prototype.getParentSize=function(){if(!this.parentNode)return this.window?{width:this.window.innerWidth,height:this.window.innerHeight}:{width:0,height:0};var e=this.appendBase();if(!e)return{width:0,height:0};var t=!1,o=this.parentNode.style.flexWrap;"wrap"!==o&&(t=!0,this.parentNode.style.flexWrap="wrap"),e.style.position="relative",e.style.minWidth="100%",e.style.minHeight="100%";var i={width:e.offsetWidth,height:e.offsetHeight};return t&&(this.parentNode.style.flexWrap=o),this.removeBase(e),i},t.prototype.bindEvents=function(){this.window&&(this.window.addEventListener("mouseup",this.onMouseUp),this.window.addEventListener("mousemove",this.onMouseMove),this.window.addEventListener("mouseleave",this.onMouseUp),this.window.addEventListener("touchmove",this.onMouseMove,{capture:!0,passive:!1}),this.window.addEventListener("touchend",this.onMouseUp))},t.prototype.unbindEvents=function(){this.window&&(this.window.removeEventListener("mouseup",this.onMouseUp),this.window.removeEventListener("mousemove",this.onMouseMove),this.window.removeEventListener("mouseleave",this.onMouseUp),this.window.removeEventListener("touchmove",this.onMouseMove,!0),this.window.removeEventListener("touchend",this.onMouseUp))},t.prototype.componentDidMount=function(){if(this.resizable&&this.window){var e=this.window.getComputedStyle(this.resizable);this.setState({width:this.state.width||this.size.width,height:this.state.height||this.size.height,flexBasis:"auto"!==e.flexBasis?e.flexBasis:void 0})}},t.prototype.componentWillUnmount=function(){this.window&&this.unbindEvents()},t.prototype.createSizeForCssProperty=function(e,t){var o=this.propsSize&&this.propsSize[t];return"auto"!==this.state[t]||this.state.original[t]!==e||void 0!==o&&"auto"!==o?e:"auto"},t.prototype.calculateNewMaxFromBoundary=function(e,t){var o,i,n=this.props.boundsByDirection,r=this.state.direction,s=n&&D("left",r),a=n&&D("top",r);if("parent"===this.props.bounds){var l=this.parentNode;l&&(o=s?this.resizableRight-this.parentLeft:l.offsetWidth+(this.parentLeft-this.resizableLeft),i=a?this.resizableBottom-this.parentTop:l.offsetHeight+(this.parentTop-this.resizableTop))}else"window"===this.props.bounds?this.window&&(o=s?this.resizableRight:this.window.innerWidth-this.resizableLeft,i=a?this.resizableBottom:this.window.innerHeight-this.resizableTop):this.props.bounds&&(o=s?this.resizableRight-this.targetLeft:this.props.bounds.offsetWidth+(this.targetLeft-this.resizableLeft),i=a?this.resizableBottom-this.targetTop:this.props.bounds.offsetHeight+(this.targetTop-this.resizableTop));return o&&Number.isFinite(o)&&(e=e&&e<o?e:o),i&&Number.isFinite(i)&&(t=t&&t<i?t:i),{maxWidth:e,maxHeight:t}},t.prototype.calculateNewSizeFromDirection=function(e,t){var o=this.props.scale||1,i=this.props.resizeRatio||1,n=this.state,r=n.direction,s=n.original,a=this.props,l=a.lockAspectRatio,d=a.lockAspectRatioExtraHeight,c=a.lockAspectRatioExtraWidth,h=s.width,p=s.height,u=d||0,m=c||0;return D("right",r)&&(h=s.width+(e-s.x)*i/o,l&&(p=(h-m)/this.ratio+u)),D("left",r)&&(h=s.width-(e-s.x)*i/o,l&&(p=(h-m)/this.ratio+u)),D("bottom",r)&&(p=s.height+(t-s.y)*i/o,l&&(h=(p-u)*this.ratio+m)),D("top",r)&&(p=s.height-(t-s.y)*i/o,l&&(h=(p-u)*this.ratio+m)),{newWidth:h,newHeight:p}},t.prototype.calculateNewSizeFromAspectRatio=function(e,t,o,i){var n=this.props,r=n.lockAspectRatio,s=n.lockAspectRatioExtraHeight,a=n.lockAspectRatioExtraWidth,l=void 0===i.width?10:i.width,d=void 0===o.width||o.width<0?e:o.width,c=void 0===i.height?10:i.height,h=void 0===o.height||o.height<0?t:o.height,p=s||0,u=a||0;if(r){var m=(c-p)*this.ratio+u,f=(h-p)*this.ratio+u,b=(l-u)/this.ratio+p,g=(d-u)/this.ratio+p,y=Math.max(l,m),w=Math.min(d,f),x=Math.max(c,b),v=Math.min(h,g);e=F(e,y,w),t=F(t,x,v)}else e=F(e,l,d),t=F(t,c,h);return{newWidth:e,newHeight:t}},t.prototype.setBoundingClientRect=function(){if("parent"===this.props.bounds){var e=this.parentNode;if(e){var t=e.getBoundingClientRect();this.parentLeft=t.left,this.parentTop=t.top}}if(this.props.bounds&&"string"!=typeof this.props.bounds){var o=this.props.bounds.getBoundingClientRect();this.targetLeft=o.left,this.targetTop=o.top}if(this.resizable){var i=this.resizable.getBoundingClientRect(),n=i.left,r=i.top,s=i.right,a=i.bottom;this.resizableLeft=n,this.resizableRight=s,this.resizableTop=r,this.resizableBottom=a}},t.prototype.onResizeStart=function(e,t){if(this.resizable&&this.window){var o,i=0,n=0;if(e.nativeEvent&&function(e){return Boolean((e.clientX||0===e.clientX)&&(e.clientY||0===e.clientY))}(e.nativeEvent)?(i=e.nativeEvent.clientX,n=e.nativeEvent.clientY):e.nativeEvent&&$(e.nativeEvent)&&(i=e.nativeEvent.touches[0].clientX,n=e.nativeEvent.touches[0].clientY),this.props.onResizeStart)if(this.resizable)if(!1===this.props.onResizeStart(e,t,this.resizable))return;this.props.size&&(void 0!==this.props.size.height&&this.props.size.height!==this.state.height&&this.setState({height:this.props.size.height}),void 0!==this.props.size.width&&this.props.size.width!==this.state.width&&this.setState({width:this.props.size.width})),this.ratio="number"==typeof this.props.lockAspectRatio?this.props.lockAspectRatio:this.size.width/this.size.height;var r=this.window.getComputedStyle(this.resizable);if("auto"!==r.flexBasis){var s=this.parentNode;if(s){var a=this.window.getComputedStyle(s).flexDirection;this.flexDir=a.startsWith("row")?"row":"column",o=r.flexBasis}}this.setBoundingClientRect(),this.bindEvents();var l={original:{x:i,y:n,width:this.size.width,height:this.size.height},isResizing:!0,backgroundStyle:T(T({},this.state.backgroundStyle),{cursor:this.window.getComputedStyle(e.target).cursor||"auto"}),direction:t,flexBasis:o};this.setState(l)}},t.prototype.onMouseMove=function(e){var t=this;if(this.state.isResizing&&this.resizable&&this.window){if(this.window.TouchEvent&&$(e))try{e.preventDefault(),e.stopPropagation()}catch(e){}var o=this.props,i=o.maxWidth,n=o.maxHeight,r=o.minWidth,s=o.minHeight,a=$(e)?e.touches[0].clientX:e.clientX,l=$(e)?e.touches[0].clientY:e.clientY,d=this.state,c=d.direction,h=d.original,p=d.width,u=d.height,m=this.getParentSize(),f=function(e,t,o,i,n,r,s){return i=U(i,e.width,t,o),n=U(n,e.height,t,o),r=U(r,e.width,t,o),s=U(s,e.height,t,o),{maxWidth:void 0===i?void 0:Number(i),maxHeight:void 0===n?void 0:Number(n),minWidth:void 0===r?void 0:Number(r),minHeight:void 0===s?void 0:Number(s)}}(m,this.window.innerWidth,this.window.innerHeight,i,n,r,s);i=f.maxWidth,n=f.maxHeight,r=f.minWidth,s=f.minHeight;var b=this.calculateNewSizeFromDirection(a,l),g=b.newHeight,y=b.newWidth,w=this.calculateNewMaxFromBoundary(i,n);this.props.snap&&this.props.snap.x&&(y=V(y,this.props.snap.x,this.props.snapGap)),this.props.snap&&this.props.snap.y&&(g=V(g,this.props.snap.y,this.props.snapGap));var x=this.calculateNewSizeFromAspectRatio(y,g,{width:w.maxWidth,height:w.maxHeight},{width:r,height:s});if(y=x.newWidth,g=x.newHeight,this.props.grid){var v=I(y,this.props.grid[0]),_=I(g,this.props.grid[1]),C=this.props.snapGap||0;y=0===C||Math.abs(v-y)<=C?v:y,g=0===C||Math.abs(_-g)<=C?_:g}var R={width:y-h.width,height:g-h.height};if(p&&"string"==typeof p)if(p.endsWith("%"))y=y/m.width*100+"%";else if(p.endsWith("vw")){y=y/this.window.innerWidth*100+"vw"}else if(p.endsWith("vh")){y=y/this.window.innerHeight*100+"vh"}if(u&&"string"==typeof u)if(u.endsWith("%"))g=g/m.height*100+"%";else if(u.endsWith("vw")){g=g/this.window.innerWidth*100+"vw"}else if(u.endsWith("vh")){g=g/this.window.innerHeight*100+"vh"}var S={width:this.createSizeForCssProperty(y,"width"),height:this.createSizeForCssProperty(g,"height")};"row"===this.flexDir?S.flexBasis=S.width:"column"===this.flexDir&&(S.flexBasis=S.height),z((function(){t.setState(S)})),this.props.onResize&&this.props.onResize(e,c,this.resizable,R)}},t.prototype.onMouseUp=function(e){var t=this.state,o=t.isResizing,i=t.direction,n=t.original;if(o&&this.resizable){var r={width:this.size.width-n.width,height:this.size.height-n.height};this.props.onResizeStop&&this.props.onResizeStop(e,i,this.resizable,r),this.props.size&&this.setState(this.props.size),this.unbindEvents(),this.setState({isResizing:!1,backgroundStyle:T(T({},this.state.backgroundStyle),{cursor:"auto"})})}},t.prototype.updateSize=function(e){this.setState({width:e.width,height:e.height})},t.prototype.renderResizer=function(){var e=this,t=this.props,o=t.enable,i=t.handleStyles,n=t.handleClasses,r=t.handleWrapperStyle,s=t.handleWrapperClass,a=t.handleComponent;if(!o)return null;var l=Object.keys(o).map((function(t){return!1!==o[t]?u.createElement(B,{key:t,direction:t,onResizeStart:e.onResizeStart,replaceStyles:i&&i[t],className:n&&n[t]},a&&a[t]?a[t]:null):null}));return u.createElement("div",{className:s,style:r},l)},t.prototype.render=function(){var e=this,t=Object.keys(this.props).reduce((function(t,o){return-1!==X.indexOf(o)||(t[o]=e.props[o]),t}),{}),o=T(T(T({position:"relative",userSelect:this.state.isResizing?"none":"auto"},this.props.style),this.sizeStyle),{maxWidth:this.props.maxWidth,maxHeight:this.props.maxHeight,minWidth:this.props.minWidth,minHeight:this.props.minHeight,boxSizing:"border-box",flexShrink:0});this.state.flexBasis&&(o.flexBasis=this.state.flexBasis);var i=this.props.as||"div";return u.createElement(i,T({ref:this.ref,style:o,className:this.props.className},t),this.state.isResizing&&u.createElement("div",{style:this.state.backgroundStyle}),this.props.children,this.renderResizer())},t.defaultProps={as:"div",onResizeStart:function(){},onResize:function(){},onResizeStop:function(){},enable:{top:!0,right:!0,bottom:!0,left:!0,topRight:!0,bottomRight:!0,bottomLeft:!0,topLeft:!0},style:{},grid:[1,1],lockAspectRatio:!1,lockAspectRatioExtraWidth:0,lockAspectRatioExtraHeight:0,scale:1,resizeRatio:1,snapGap:0},t}(u.PureComponent);function q(e){return Q(e)?(e.nodeName||"").toLowerCase():"#document"}function J(e){var t;return(null==e||null==(t=e.ownerDocument)?void 0:t.defaultView)||window}function K(e){var t;return null==(t=(Q(e)?e.ownerDocument:e.document)||window.document)?void 0:t.documentElement}function Q(e){return e instanceof Node||e instanceof J(e).Node}function ee(e){return e instanceof Element||e instanceof J(e).Element}function te(e){return e instanceof HTMLElement||e instanceof J(e).HTMLElement}function oe(e){return"undefined"!=typeof ShadowRoot&&(e instanceof ShadowRoot||e instanceof J(e).ShadowRoot)}function ie(e){const{overflow:t,overflowX:o,overflowY:i,display:n}=le(e);return/auto|scroll|overlay|hidden|clip/.test(t+i+o)&&!["inline","contents"].includes(n)}function ne(e){return["table","td","th"].includes(q(e))}function re(e){const t=se(),o=le(e);return"none"!==o.transform||"none"!==o.perspective||!!o.containerType&&"normal"!==o.containerType||!t&&!!o.backdropFilter&&"none"!==o.backdropFilter||!t&&!!o.filter&&"none"!==o.filter||["transform","perspective","filter"].some((e=>(o.willChange||"").includes(e)))||["paint","layout","strict","content"].some((e=>(o.contain||"").includes(e)))}function se(){return!("undefined"==typeof CSS||!CSS.supports)&&CSS.supports("-webkit-backdrop-filter","none")}function ae(e){return["html","body","#document"].includes(q(e))}function le(e){return J(e).getComputedStyle(e)}function de(e){return ee(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.pageXOffset,scrollTop:e.pageYOffset}}function ce(e){if("html"===q(e))return e;const t=e.assignedSlot||e.parentNode||oe(e)&&e.host||K(e);return oe(t)?t.host:t}function he(e){const t=ce(e);return ae(t)?e.ownerDocument?e.ownerDocument.body:e.body:te(t)&&ie(t)?t:he(t)}function pe(e,t,o){var i;void 0===t&&(t=[]),void 0===o&&(o=!0);const n=he(e),r=n===(null==(i=e.ownerDocument)?void 0:i.body),s=J(n);return r?t.concat(s,s.visualViewport||[],ie(n)?n:[],s.frameElement&&o?pe(s.frameElement):[]):t.concat(n,pe(n,[],o))}const ue=Math.min,me=Math.max,fe=Math.round,be=e=>({x:e,y:e}),ge={left:"right",right:"left",bottom:"top",top:"bottom"},ye={start:"end",end:"start"};function we(e,t,o){return me(e,ue(t,o))}function xe(e,t){return"function"==typeof e?e(t):e}function ve(e){return e.split("-")[0]}function ze(e){return e.split("-")[1]}function _e(e){return"x"===e?"y":"x"}function Ce(e){return"y"===e?"height":"width"}function Re(e){return["top","bottom"].includes(ve(e))?"y":"x"}function Se(e){return _e(Re(e))}function Oe(e){return e.replace(/start|end/g,(e=>ye[e]))}function ke(e){return e.replace(/left|right|bottom|top/g,(e=>ge[e]))}function Ee(e){return"number"!=typeof e?function(e){return{top:0,right:0,bottom:0,left:0,...e}}(e):{top:e,right:e,bottom:e,left:e}}function Me(e){return{...e,top:e.y,left:e.x,right:e.x+e.width,bottom:e.y+e.height}}function Ne(e,t,o){let{reference:i,floating:n}=e;const r=Re(t),s=Se(t),a=Ce(s),l=ve(t),d="y"===r,c=i.x+i.width/2-n.width/2,h=i.y+i.height/2-n.height/2,p=i[a]/2-n[a]/2;let u;switch(l){case"top":u={x:c,y:i.y-n.height};break;case"bottom":u={x:c,y:i.y+i.height};break;case"right":u={x:i.x+i.width,y:h};break;case"left":u={x:i.x-n.width,y:h};break;default:u={x:i.x,y:i.y}}switch(ze(t)){case"start":u[s]-=p*(o&&d?-1:1);break;case"end":u[s]+=p*(o&&d?-1:1)}return u}async function je(e,t){var o;void 0===t&&(t={});const{x:i,y:n,platform:r,rects:s,elements:a,strategy:l}=e,{boundary:d="clippingAncestors",rootBoundary:c="viewport",elementContext:h="floating",altBoundary:p=!1,padding:u=0}=xe(t,e),m=Ee(u),f=a[p?"floating"===h?"reference":"floating":h],b=Me(await r.getClippingRect({element:null==(o=await(null==r.isElement?void 0:r.isElement(f)))||o?f:f.contextElement||await(null==r.getDocumentElement?void 0:r.getDocumentElement(a.floating)),boundary:d,rootBoundary:c,strategy:l})),g="floating"===h?{...s.floating,x:i,y:n}:s.reference,y=await(null==r.getOffsetParent?void 0:r.getOffsetParent(a.floating)),w=await(null==r.isElement?void 0:r.isElement(y))&&await(null==r.getScale?void 0:r.getScale(y))||{x:1,y:1},x=Me(r.convertOffsetParentRelativeRectToViewportRelativeRect?await r.convertOffsetParentRelativeRectToViewportRelativeRect({elements:a,rect:g,offsetParent:y,strategy:l}):g);return{top:(b.top-x.top+m.top)/w.y,bottom:(x.bottom-b.bottom+m.bottom)/w.y,left:(b.left-x.left+m.left)/w.x,right:(x.right-b.right+m.right)/w.x}}function Le(e){const t=ue(...e.map((e=>e.left))),o=ue(...e.map((e=>e.top)));return{x:t,y:o,width:me(...e.map((e=>e.right)))-t,height:me(...e.map((e=>e.bottom)))-o}}const We=function(e){return void 0===e&&(e=0),{name:"offset",options:e,async fn(t){var o,i;const{x:n,y:r,placement:s,middlewareData:a}=t,l=await async function(e,t){const{placement:o,platform:i,elements:n}=e,r=await(null==i.isRTL?void 0:i.isRTL(n.floating)),s=ve(o),a=ze(o),l="y"===Re(o),d=["left","top"].includes(s)?-1:1,c=r&&l?-1:1,h=xe(t,e);let{mainAxis:p,crossAxis:u,alignmentAxis:m}="number"==typeof h?{mainAxis:h,crossAxis:0,alignmentAxis:null}:{mainAxis:0,crossAxis:0,alignmentAxis:null,...h};return a&&"number"==typeof m&&(u="end"===a?-1*m:m),l?{x:u*c,y:p*d}:{x:p*d,y:u*c}}(t,e);return s===(null==(o=a.offset)?void 0:o.placement)&&null!=(i=a.arrow)&&i.alignmentOffset?{}:{x:n+l.x,y:r+l.y,data:{...l,placement:s}}}}};function He(e){const t=le(e);let o=parseFloat(t.width)||0,i=parseFloat(t.height)||0;const n=te(e),r=n?e.offsetWidth:o,s=n?e.offsetHeight:i,a=fe(o)!==r||fe(i)!==s;return a&&(o=r,i=s),{width:o,height:i,$:a}}function Be(e){return ee(e)?e:e.contextElement}function Pe(e){const t=Be(e);if(!te(t))return be(1);const o=t.getBoundingClientRect(),{width:i,height:n,$:r}=He(t);let s=(r?fe(o.width):o.width)/i,a=(r?fe(o.height):o.height)/n;return s&&Number.isFinite(s)||(s=1),a&&Number.isFinite(a)||(a=1),{x:s,y:a}}const Te=be(0);function Ae(e){const t=J(e);return se()&&t.visualViewport?{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}:Te}function Fe(e,t,o,i){void 0===t&&(t=!1),void 0===o&&(o=!1);const n=e.getBoundingClientRect(),r=Be(e);let s=be(1);t&&(i?ee(i)&&(s=Pe(i)):s=Pe(e));const a=function(e,t,o){return void 0===t&&(t=!1),!(!o||t&&o!==J(e))&&t}(r,o,i)?Ae(r):be(0);let l=(n.left+a.x)/s.x,d=(n.top+a.y)/s.y,c=n.width/s.x,h=n.height/s.y;if(r){const e=J(r),t=i&&ee(i)?J(i):i;let o=e,n=o.frameElement;for(;n&&i&&t!==o;){const e=Pe(n),t=n.getBoundingClientRect(),i=le(n),r=t.left+(n.clientLeft+parseFloat(i.paddingLeft))*e.x,s=t.top+(n.clientTop+parseFloat(i.paddingTop))*e.y;l*=e.x,d*=e.y,c*=e.x,h*=e.y,l+=r,d+=s,o=J(n),n=o.frameElement}}return Me({width:c,height:h,x:l,y:d})}const Ie=[":popover-open",":modal"];function De(e){return Ie.some((t=>{try{return e.matches(t)}catch(e){return!1}}))}function $e(e){return Fe(K(e)).left+de(e).scrollLeft}function Ve(e,t,o){let i;if("viewport"===t)i=function(e,t){const o=J(e),i=K(e),n=o.visualViewport;let r=i.clientWidth,s=i.clientHeight,a=0,l=0;if(n){r=n.width,s=n.height;const e=se();(!e||e&&"fixed"===t)&&(a=n.offsetLeft,l=n.offsetTop)}return{width:r,height:s,x:a,y:l}}(e,o);else if("document"===t)i=function(e){const t=K(e),o=de(e),i=e.ownerDocument.body,n=me(t.scrollWidth,t.clientWidth,i.scrollWidth,i.clientWidth),r=me(t.scrollHeight,t.clientHeight,i.scrollHeight,i.clientHeight);let s=-o.scrollLeft+$e(e);const a=-o.scrollTop;return"rtl"===le(i).direction&&(s+=me(t.clientWidth,i.clientWidth)-n),{width:n,height:r,x:s,y:a}}(K(e));else if(ee(t))i=function(e,t){const o=Fe(e,!0,"fixed"===t),i=o.top+e.clientTop,n=o.left+e.clientLeft,r=te(e)?Pe(e):be(1);return{width:e.clientWidth*r.x,height:e.clientHeight*r.y,x:n*r.x,y:i*r.y}}(t,o);else{const o=Ae(e);i={...t,x:t.x-o.x,y:t.y-o.y}}return Me(i)}function Ze(e,t){const o=ce(e);return!(o===t||!ee(o)||ae(o))&&("fixed"===le(o).position||Ze(o,t))}function Ue(e,t,o){const i=te(t),n=K(t),r="fixed"===o,s=Fe(e,!0,r,t);let a={scrollLeft:0,scrollTop:0};const l=be(0);if(i||!i&&!r)if(("body"!==q(t)||ie(n))&&(a=de(t)),i){const e=Fe(t,!0,r,t);l.x=e.x+t.clientLeft,l.y=e.y+t.clientTop}else n&&(l.x=$e(n));return{x:s.left+a.scrollLeft-l.x,y:s.top+a.scrollTop-l.y,width:s.width,height:s.height}}function Xe(e,t){return te(e)&&"fixed"!==le(e).position?t?t(e):e.offsetParent:null}function Ye(e,t){const o=J(e);if(!te(e)||De(e))return o;let i=Xe(e,t);for(;i&&ne(i)&&"static"===le(i).position;)i=Xe(i,t);return i&&("html"===q(i)||"body"===q(i)&&"static"===le(i).position&&!re(i))?o:i||function(e){let t=ce(e);for(;te(t)&&!ae(t);){if(re(t))return t;t=ce(t)}return null}(e)||o}const Ge={convertOffsetParentRelativeRectToViewportRelativeRect:function(e){let{elements:t,rect:o,offsetParent:i,strategy:n}=e;const r="fixed"===n,s=K(i),a=!!t&&De(t.floating);if(i===s||a&&r)return o;let l={scrollLeft:0,scrollTop:0},d=be(1);const c=be(0),h=te(i);if((h||!h&&!r)&&(("body"!==q(i)||ie(s))&&(l=de(i)),te(i))){const e=Fe(i);d=Pe(i),c.x=e.x+i.clientLeft,c.y=e.y+i.clientTop}return{width:o.width*d.x,height:o.height*d.y,x:o.x*d.x-l.scrollLeft*d.x+c.x,y:o.y*d.y-l.scrollTop*d.y+c.y}},getDocumentElement:K,getClippingRect:function(e){let{element:t,boundary:o,rootBoundary:i,strategy:n}=e;const r=[..."clippingAncestors"===o?function(e,t){const o=t.get(e);if(o)return o;let i=pe(e,[],!1).filter((e=>ee(e)&&"body"!==q(e))),n=null;const r="fixed"===le(e).position;let s=r?ce(e):e;for(;ee(s)&&!ae(s);){const t=le(s),o=re(s);o||"fixed"!==t.position||(n=null),(r?!o&&!n:!o&&"static"===t.position&&n&&["absolute","fixed"].includes(n.position)||ie(s)&&!o&&Ze(e,s))?i=i.filter((e=>e!==s)):n=t,s=ce(s)}return t.set(e,i),i}(t,this._c):[].concat(o),i],s=r[0],a=r.reduce(((e,o)=>{const i=Ve(t,o,n);return e.top=me(i.top,e.top),e.right=ue(i.right,e.right),e.bottom=ue(i.bottom,e.bottom),e.left=me(i.left,e.left),e}),Ve(t,s,n));return{width:a.right-a.left,height:a.bottom-a.top,x:a.left,y:a.top}},getOffsetParent:Ye,getElementRects:async function(e){const t=this.getOffsetParent||Ye,o=this.getDimensions;return{reference:Ue(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,...await o(e.floating)}}},getClientRects:function(e){return Array.from(e.getClientRects())},getDimensions:function(e){const{width:t,height:o}=He(e);return{width:t,height:o}},getScale:Pe,isElement:ee,isRTL:function(e){return"rtl"===le(e).direction}},qe=function(e){return void 0===e&&(e={}),{name:"shift",options:e,async fn(t){const{x:o,y:i,placement:n}=t,{mainAxis:r=!0,crossAxis:s=!1,limiter:a={fn:e=>{let{x:t,y:o}=e;return{x:t,y:o}}},...l}=xe(e,t),d={x:o,y:i},c=await je(t,l),h=Re(ve(n)),p=_e(h);let u=d[p],m=d[h];if(r){const e="y"===p?"bottom":"right";u=we(u+c["y"===p?"top":"left"],u,u-c[e])}if(s){const e="y"===h?"bottom":"right";m=we(m+c["y"===h?"top":"left"],m,m-c[e])}const f=a.fn({...t,[p]:u,[h]:m});return{...f,data:{x:f.x-o,y:f.y-i}}}}},Je=function(e){return void 0===e&&(e={}),{name:"flip",options:e,async fn(t){var o,i;const{placement:n,middlewareData:r,rects:s,initialPlacement:a,platform:l,elements:d}=t,{mainAxis:c=!0,crossAxis:h=!0,fallbackPlacements:p,fallbackStrategy:u="bestFit",fallbackAxisSideDirection:m="none",flipAlignment:f=!0,...b}=xe(e,t);if(null!=(o=r.arrow)&&o.alignmentOffset)return{};const g=ve(n),y=ve(a)===a,w=await(null==l.isRTL?void 0:l.isRTL(d.floating)),x=p||(y||!f?[ke(a)]:function(e){const t=ke(e);return[Oe(e),t,Oe(t)]}(a));p||"none"===m||x.push(...function(e,t,o,i){const n=ze(e);let r=function(e,t,o){const i=["left","right"],n=["right","left"],r=["top","bottom"],s=["bottom","top"];switch(e){case"top":case"bottom":return o?t?n:i:t?i:n;case"left":case"right":return t?r:s;default:return[]}}(ve(e),"start"===o,i);return n&&(r=r.map((e=>e+"-"+n)),t&&(r=r.concat(r.map(Oe)))),r}(a,f,m,w));const v=[a,...x],z=await je(t,b),_=[];let C=(null==(i=r.flip)?void 0:i.overflows)||[];if(c&&_.push(z[g]),h){const e=function(e,t,o){void 0===o&&(o=!1);const i=ze(e),n=Se(e),r=Ce(n);let s="x"===n?i===(o?"end":"start")?"right":"left":"start"===i?"bottom":"top";return t.reference[r]>t.floating[r]&&(s=ke(s)),[s,ke(s)]}(n,s,w);_.push(z[e[0]],z[e[1]])}if(C=[...C,{placement:n,overflows:_}],!_.every((e=>e<=0))){var R,S;const e=((null==(R=r.flip)?void 0:R.index)||0)+1,t=v[e];if(t)return{data:{index:e,overflows:C},reset:{placement:t}};let o=null==(S=C.filter((e=>e.overflows[0]<=0)).sort(((e,t)=>e.overflows[1]-t.overflows[1]))[0])?void 0:S.placement;if(!o)switch(u){case"bestFit":{var O;const e=null==(O=C.map((e=>[e.placement,e.overflows.filter((e=>e>0)).reduce(((e,t)=>e+t),0)])).sort(((e,t)=>e[1]-t[1]))[0])?void 0:O[0];e&&(o=e);break}case"initialPlacement":o=a}if(n!==o)return{reset:{placement:o}}}return{}}}},Ke=function(e){return void 0===e&&(e={}),{name:"inline",options:e,async fn(t){const{placement:o,elements:i,rects:n,platform:r,strategy:s}=t,{padding:a=2,x:l,y:d}=xe(e,t),c=Array.from(await(null==r.getClientRects?void 0:r.getClientRects(i.reference))||[]),h=function(e){const t=e.slice().sort(((e,t)=>e.y-t.y)),o=[];let i=null;for(let e=0;e<t.length;e++){const n=t[e];!i||n.y-i.y>i.height/2?o.push([n]):o[o.length-1].push(n),i=n}return o.map((e=>Me(Le(e))))}(c),p=Me(Le(c)),u=Ee(a);const m=await r.getElementRects({reference:{getBoundingClientRect:function(){if(2===h.length&&h[0].left>h[1].right&&null!=l&&null!=d)return h.find((e=>l>e.left-u.left&&l<e.right+u.right&&d>e.top-u.top&&d<e.bottom+u.bottom))||p;if(h.length>=2){if("y"===Re(o)){const e=h[0],t=h[h.length-1],i="top"===ve(o),n=e.top,r=t.bottom,s=i?e.left:t.left,a=i?e.right:t.right;return{top:n,bottom:r,left:s,right:a,width:a-s,height:r-n,x:s,y:n}}const e="left"===ve(o),t=me(...h.map((e=>e.right))),i=ue(...h.map((e=>e.left))),n=h.filter((o=>e?o.left===i:o.right===t)),r=n[0].top,s=n[n.length-1].bottom;return{top:r,bottom:s,left:i,right:t,width:t-i,height:s-r,x:i,y:r}}return p}},floating:i.floating,strategy:s});return n.reference.x!==m.reference.x||n.reference.y!==m.reference.y||n.reference.width!==m.reference.width||n.reference.height!==m.reference.height?{reset:{rects:m}}:{}}}},Qe=(e,t,o)=>{const i=new Map,n={platform:Ge,...o},r={...n.platform,_c:i};return(async(e,t,o)=>{const{placement:i="bottom",strategy:n="absolute",middleware:r=[],platform:s}=o,a=r.filter(Boolean),l=await(null==s.isRTL?void 0:s.isRTL(t));let d=await s.getElementRects({reference:e,floating:t,strategy:n}),{x:c,y:h}=Ne(d,i,l),p=i,u={},m=0;for(let o=0;o<a.length;o++){const{name:r,fn:f}=a[o],{x:b,y:g,data:y,reset:w}=await f({x:c,y:h,initialPlacement:i,placement:p,strategy:n,middlewareData:u,rects:d,platform:s,elements:{reference:e,floating:t}});c=null!=b?b:c,h=null!=g?g:h,u={...u,[r]:{...u[r],...y}},w&&m<=50&&(m++,"object"==typeof w&&(w.placement&&(p=w.placement),w.rects&&(d=!0===w.rects?await s.getElementRects({reference:e,floating:t,strategy:n}):w.rects),({x:c,y:h}=Ne(d,p,l))),o=-1)}return{x:c,y:h,placement:p,strategy:n,middlewareData:u}})(e,t,{...n,platform:r})};var et="undefined"!=typeof document?g:f;function tt(e,t){if(e===t)return!0;if(typeof e!=typeof t)return!1;if("function"==typeof e&&e.toString()===t.toString())return!0;let o,i,n;if(e&&t&&"object"==typeof e){if(Array.isArray(e)){if(o=e.length,o!==t.length)return!1;for(i=o;0!=i--;)if(!tt(e[i],t[i]))return!1;return!0}if(n=Object.keys(e),o=n.length,o!==Object.keys(t).length)return!1;for(i=o;0!=i--;)if(!{}.hasOwnProperty.call(t,n[i]))return!1;for(i=o;0!=i--;){const o=n[i];if(("_owner"!==o||!e.$$typeof)&&!tt(e[o],t[o]))return!1}return!0}return e!=e&&t!=t}function ot(e){if("undefined"==typeof window)return 1;return(e.ownerDocument.defaultView||window).devicePixelRatio||1}function it(e,t){const o=ot(e);return Math.round(t*o)/o}function nt(e){const t=u.useRef(e);return et((()=>{t.current=e})),t}const rt=u["useInsertionEffect".toString()]||(e=>e());var st="undefined"!=typeof document?g:f;let at=!1,lt=0;const dt=()=>"floating-ui-"+lt++;const ct=u["useId".toString()]||function(){const[e,t]=u.useState((()=>at?dt():void 0));return st((()=>{null==e&&t(dt())}),[]),u.useEffect((()=>{at||(at=!0)}),[]),e};const ht=u.createContext(null),pt=u.createContext(null);function ut(e){var t;void 0===e&&(e={});const{open:o=!1,onOpenChange:i,nodeId:n}=e,[r,s]=u.useState(null),a=(null==(t=e.elements)?void 0:t.reference)||r,l=function(e){void 0===e&&(e={});const{placement:t="bottom",strategy:o="absolute",middleware:i=[],platform:n,elements:{reference:r,floating:s}={},transform:a=!0,whileElementsMounted:l,open:d}=e,[c,h]=u.useState({x:0,y:0,strategy:o,placement:t,middlewareData:{},isPositioned:!1}),[p,m]=u.useState(i);tt(p,i)||m(i);const[f,b]=u.useState(null),[g,y]=u.useState(null),w=u.useCallback((e=>{e!==C.current&&(C.current=e,b(e))}),[]),x=u.useCallback((e=>{e!==R.current&&(R.current=e,y(e))}),[]),z=r||f,_=s||g,C=u.useRef(null),R=u.useRef(null),S=u.useRef(c),O=null!=l,k=nt(l),E=nt(n),M=u.useCallback((()=>{if(!C.current||!R.current)return;const e={placement:t,strategy:o,middleware:p};E.current&&(e.platform=E.current),Qe(C.current,R.current,e).then((e=>{const t={...e,isPositioned:!0};N.current&&!tt(S.current,t)&&(S.current=t,v.flushSync((()=>{h(t)})))}))}),[p,t,o,E]);et((()=>{!1===d&&S.current.isPositioned&&(S.current.isPositioned=!1,h((e=>({...e,isPositioned:!1}))))}),[d]);const N=u.useRef(!1);et((()=>(N.current=!0,()=>{N.current=!1})),[]),et((()=>{if(z&&(C.current=z),_&&(R.current=_),z&&_){if(k.current)return k.current(z,_,M);M()}}),[z,_,M,k,O]);const j=u.useMemo((()=>({reference:C,floating:R,setReference:w,setFloating:x})),[w,x]),L=u.useMemo((()=>({reference:z,floating:_})),[z,_]),W=u.useMemo((()=>{const e={position:o,left:0,top:0};if(!L.floating)return e;const t=it(L.floating,c.x),i=it(L.floating,c.y);return a?{...e,transform:"translate("+t+"px, "+i+"px)",...ot(L.floating)>=1.5&&{willChange:"transform"}}:{position:o,left:t,top:i}}),[o,a,L.floating,c.x,c.y]);return u.useMemo((()=>({...c,update:M,refs:j,elements:L,floatingStyles:W})),[c,M,j,L,W])}(e),d=u.useContext(pt),c=null!=((null==(h=u.useContext(ht))?void 0:h.id)||null);var h;const p=function(e){const t=u.useRef((()=>{}));return rt((()=>{t.current=e})),u.useCallback((function(){for(var e=arguments.length,o=new Array(e),i=0;i<e;i++)o[i]=arguments[i];return null==t.current?void 0:t.current(...o)}),[])}(((e,t,o)=>{e&&(f.current.openEvent=t),b.emit("openchange",{open:e,event:t,reason:o,nested:c}),null==i||i(e,t,o)})),m=u.useRef(null),f=u.useRef({}),b=u.useState((()=>function(){const e=new Map;return{emit(t,o){var i;null==(i=e.get(t))||i.forEach((e=>e(o)))},on(t,o){e.set(t,[...e.get(t)||[],o])},off(t,o){var i;e.set(t,(null==(i=e.get(t))?void 0:i.filter((e=>e!==o)))||[])}}}()))[0],g=ct(),y=u.useCallback((e=>{const t=ee(e)?{getBoundingClientRect:()=>e.getBoundingClientRect(),contextElement:e}:e;l.refs.setReference(t)}),[l.refs]),w=u.useCallback((e=>{(ee(e)||null===e)&&(m.current=e,s(e)),(ee(l.refs.reference.current)||null===l.refs.reference.current||null!==e&&!ee(e))&&l.refs.setReference(e)}),[l.refs]),x=u.useMemo((()=>({...l.refs,setReference:w,setPositionReference:y,domReference:m})),[l.refs,w,y]),z=u.useMemo((()=>({...l.elements,domReference:a})),[l.elements,a]),_=u.useMemo((()=>({...l,refs:x,elements:z,dataRef:f,nodeId:n,floatingId:g,events:b,open:o,onOpenChange:p})),[l,n,g,b,o,p,x,z]);return st((()=>{const e=null==d?void 0:d.nodesRef.current.find((e=>e.id===n));e&&(e.context=_)})),u.useMemo((()=>({...l,context:_,refs:x,elements:z})),[l,x,z,_])}function mt(e,t){if(null==e)return{};var o,i,n={},r=Object.keys(e);for(i=0;i<r.length;i++)o=r[i],t.indexOf(o)>=0||(n[o]=e[o]);return n}var ft=["color"],bt=y((function(e,t){var o=e.color,i=void 0===o?"currentColor":o,n=mt(e,ft);return w("svg",Object.assign({width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},n,{ref:t}),w("path",{d:"M9.96424 2.68571C10.0668 2.42931 9.94209 2.13833 9.6857 2.03577C9.4293 1.93322 9.13832 2.05792 9.03576 2.31432L5.03576 12.3143C4.9332 12.5707 5.05791 12.8617 5.3143 12.9642C5.5707 13.0668 5.86168 12.9421 5.96424 12.6857L9.96424 2.68571ZM3.85355 5.14646C4.04882 5.34172 4.04882 5.6583 3.85355 5.85356L2.20711 7.50001L3.85355 9.14646C4.04882 9.34172 4.04882 9.6583 3.85355 9.85356C3.65829 10.0488 3.34171 10.0488 3.14645 9.85356L1.14645 7.85356C0.951184 7.6583 0.951184 7.34172 1.14645 7.14646L3.14645 5.14646C3.34171 4.9512 3.65829 4.9512 3.85355 5.14646ZM11.1464 5.14646C11.3417 4.9512 11.6583 4.9512 11.8536 5.14646L13.8536 7.14646C14.0488 7.34172 14.0488 7.6583 13.8536 7.85356L11.8536 9.85356C11.6583 10.0488 11.3417 10.0488 11.1464 9.85356C10.9512 9.6583 10.9512 9.34172 11.1464 9.14646L12.7929 7.50001L11.1464 5.85356C10.9512 5.6583 10.9512 5.34172 11.1464 5.14646Z",fill:i,fillRule:"evenodd",clipRule:"evenodd"}))})),gt=["color"],yt=y((function(e,t){var o=e.color,i=void 0===o?"currentColor":o,n=mt(e,gt);return w("svg",Object.assign({width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},n,{ref:t}),w("path",{d:"M3 2C2.44772 2 2 2.44772 2 3V12C2 12.5523 2.44772 13 3 13H12C12.5523 13 13 12.5523 13 12V8.5C13 8.22386 12.7761 8 12.5 8C12.2239 8 12 8.22386 12 8.5V12H3V3L6.5 3C6.77614 3 7 2.77614 7 2.5C7 2.22386 6.77614 2 6.5 2H3ZM12.8536 2.14645C12.9015 2.19439 12.9377 2.24964 12.9621 2.30861C12.9861 2.36669 12.9996 2.4303 13 2.497L13 2.5V2.50049V5.5C13 5.77614 12.7761 6 12.5 6C12.2239 6 12 5.77614 12 5.5V3.70711L6.85355 8.85355C6.65829 9.04882 6.34171 9.04882 6.14645 8.85355C5.95118 8.65829 5.95118 8.34171 6.14645 8.14645L11.2929 3H9.5C9.22386 3 9 2.77614 9 2.5C9 2.22386 9.22386 2 9.5 2H12.4999H12.5C12.5678 2 12.6324 2.01349 12.6914 2.03794C12.7504 2.06234 12.8056 2.09851 12.8536 2.14645Z",fill:i,fillRule:"evenodd",clipRule:"evenodd"}))})),wt=["color"],xt=y((function(e,t){var o=e.color,i=void 0===o?"currentColor":o,n=mt(e,wt);return w("svg",Object.assign({width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},n,{ref:t}),w("path",{d:"M2 4.5C2 4.22386 2.22386 4 2.5 4H12.5C12.7761 4 13 4.22386 13 4.5C13 4.77614 12.7761 5 12.5 5H2.5C2.22386 5 2 4.77614 2 4.5ZM4 7.5C4 7.22386 4.22386 7 4.5 7H10.5C10.7761 7 11 7.22386 11 7.5C11 7.77614 10.7761 8 10.5 8H4.5C4.22386 8 4 7.77614 4 7.5ZM3 10.5C3 10.2239 3.22386 10 3.5 10H11.5C11.7761 10 12 10.2239 12 10.5C12 10.7761 11.7761 11 11.5 11H3.5C3.22386 11 3 10.7761 3 10.5Z",fill:i,fillRule:"evenodd",clipRule:"evenodd"}))})),vt=["color"],zt=y((function(e,t){var o=e.color,i=void 0===o?"currentColor":o,n=mt(e,vt);return w("svg",Object.assign({width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},n,{ref:t}),w("path",{d:"M2 4.5C2 4.22386 2.22386 4 2.5 4H12.5C12.7761 4 13 4.22386 13 4.5C13 4.77614 12.7761 5 12.5 5H2.5C2.22386 5 2 4.77614 2 4.5ZM2 7.5C2 7.22386 2.22386 7 2.5 7H7.5C7.77614 7 8 7.22386 8 7.5C8 7.77614 7.77614 8 7.5 8H2.5C2.22386 8 2 7.77614 2 7.5ZM2 10.5C2 10.2239 2.22386 10 2.5 10H10.5C10.7761 10 11 10.2239 11 10.5C11 10.7761 10.7761 11 10.5 11H2.5C2.22386 11 2 10.7761 2 10.5Z",fill:i,fillRule:"evenodd",clipRule:"evenodd"}))})),_t=["color"],Ct=y((function(e,t){var o=e.color,i=void 0===o?"currentColor":o,n=mt(e,_t);return w("svg",Object.assign({width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},n,{ref:t}),w("path",{d:"M2 4.5C2 4.22386 2.22386 4 2.5 4H12.5C12.7761 4 13 4.22386 13 4.5C13 4.77614 12.7761 5 12.5 5H2.5C2.22386 5 2 4.77614 2 4.5ZM7 7.5C7 7.22386 7.22386 7 7.5 7H12.5C12.7761 7 13 7.22386 13 7.5C13 7.77614 12.7761 8 12.5 8H7.5C7.22386 8 7 7.77614 7 7.5ZM4 10.5C4 10.2239 4.22386 10 4.5 10H12.5C12.7761 10 13 10.2239 13 10.5C13 10.7761 12.7761 11 12.5 11H4.5C4.22386 11 4 10.7761 4 10.5Z",fill:i,fillRule:"evenodd",clipRule:"evenodd"}))}));const Rt=({blockId:e,onClose:t})=>{const o=n(),[r,s]=m(""),a=0===r.length;return h("div",Object.assign({className:"yoo-embed-cursor-pointer yoo-embed-user-select-none yoo-embed-transition-bg yoo-embed-duration-20 yoo-embed-ease-in yoo-embed-white-space-nowrap yoo-embed-w-full"},{children:[p("input",{type:"text",placeholder:"Paste embed link",value:r,className:"yoo-embed-items-center yoo-embed-bg-[hsla(45,13%,94%,.6)] yoo-embed-rounded-[4px] yoo-embed-shadow-[inset_0_0_0_1px_hsla(0,0%,6%,.1)] yoo-embed-cursor-text yoo-embed-flex yoo-embed-text-[14px] yoo-embed-h-[32px] yoo-embed-leading-[20px] yoo-embed-px-[6px] yoo-embed-relative yoo-embed-w-full yoo-embed-border-none",onChange:e=>s(e.target.value)}),p("button",Object.assign({type:"button",className:"yoopta-button yoo-embed-user-select-none yoo-embed-transition-bg yoo-embed-duration-20 yoo-embed-ease-in yoo-embed-cursor-pointer yoo-embed-flex yoo-embed-items-center yoo-embed-justify-center yoo-embed-flex-shrink-0 yoo-embed-white-space-nowrap yoo-embed-h-[28px] yoo-embed-rounded-[4px] yoo-embed-shadow-[rgba(15,15,15,0.1)_0px_0px_0px_1px_inset,_rgba(15,15,15,0.1)_0px_1px_2px] yoo-embed-bg-[rgb(35,131,226)] yoo-embed-text-white yoo-embed-fill-white yoo-embed-leading-[1.2] yoo-embed-px-[12px] yoo-embed-text-[14px] yoo-embed-font-medium yoo-embed-w-full yoo-embed-max-w-[300px] yoo-embed-mx-auto yoo-embed-m-[12px_0_6px] disabled:yoo-embed-bg-[rgba(35,131,226,0.5)] disabled:yoo-embed-cursor-not-allowed",disabled:a,onClick:()=>{var n;if(0===r.length)return;const s=_(r),a=s?null===(n=C[s])||void 0===n?void 0:n.call(C,r):null,l={type:s,id:a,url:r};s&&a||(l.id=r),i.updateElement(o,e,{type:"embed",props:{provider:l}}),t()}},{children:"Embed link"}))]}))},{Overlay:St,Portal:Ot}=r,kt=({floatingStyles:e,refs:t,onClose:o,blockId:i})=>p(Ot,Object.assign({id:"yoo-embed-uploader-portal"},{children:p(St,Object.assign({lockScroll:!0,className:"yoo-embed-z-[100]",onClick:o},{children:p("div",Object.assign({ref:t.setFloating,style:e,onClick:e=>e.stopPropagation()},{children:h("div",Object.assign({className:"yoo-embed-flex yoo-embed-flex-col yoo-embed-min-w-[540px] yoo-embed-max-w-[calc(100vw-24px)] yoo-embed-h-full yoo-embed-max-h-[420px] yoo-embed-bg-[#FFFFFF] yoo-embed-shadow-[rgb(15_15_15_/5%)_0px_0px_0px_1px,_rgb(15_15_15_/10%)_0px_3px_6px,_rgb(15_15_15_/20%)_0px_9px_24px]"},{children:[p("div",Object.assign({className:"yoo-embed-w-full yoo-embed-flex yoo-embed-text-[14px] yoo-embed-p-[0_8px] yoo-embed-shadow-[rgb(55_53_47_/9%)_0px_-1px_0px_inset] yoo-embed-relative yoo-embed-z-10 yoo-embed-h-[40px]"},{children:p("button",Object.assign({type:"button",style:{borderBottom:"2px solid #2483e2"},className:"yoopta-button yoo-embed-py-[6px] yoo-embed-whitespace-nowrap yoo-embed-min-w-0 yoo-embed-flex-shrink-0 yoo-embed-text-[rgb(55,53,47)] yoo-embed-relative yoo-embed-cursor-pointer yoo-embed-user-select-none yoo-embed-bg-inherit yoo-embed-transition-[height_20ms_ease-in] yoo-embed-inline-flex yoo-embed-items-center yoo-embed-h-full yoo-embed-text-[14px] yoo-embed-leading-[1.2] yoo-embed-px-[8px]"},{children:"Embed link"}))})),p("div",Object.assign({className:"yoo-embed-pt-[6px] yoo-embed-pb-[6px] yoo-embed-mt-[4px] yoo-embed-flex yoo-embed-justify-center yoo-embed-mr-[12px] yoo-embed-ml-[12px]"},{children:p(Rt,{onClose:o,blockId:i})}))]}))}))}))})),Et=({attributes:e,children:t,blockId:o})=>{const[i,n]=m(!1),{refs:r,floatingStyles:s}=ut({placement:"bottom",open:i,onOpenChange:n,middleware:[Ke(),Je(),qe(),We(10)]});return h("div",Object.assign({className:"yoo-embed-w-full yoo-embed-user-select-none yoo-embed-m-[20px_0_10px] yoo-embed-relative yoo-embed-flex"},e,{contentEditable:!1},{children:[h("button",Object.assign({type:"button",className:"yoopta-button yoo-embed-p-[12px_36px_12px_12px] yoo-embed-flex yoo-embed-items-center yoo-embed-text-left yoo-embed-w-full yoo-embed-overflow-hidden yoo-embed-rounded-[3px] yoo-embed-text-[14px] yoo-embed-text-[rgba(55,53,47,0.65)] yoo-embed-relative yoo-embed-cursor-pointer yoo-embed-border-none yoo-embed-bg-[#efefef] yoo-embed-transition-[background-color_100ms_ease-in] hover:yoo-embed-bg-[#e3e3e3]",onClick:()=>n(!0),ref:r.setReference},{children:[p(bt,{className:"yoo-embed-mr-2 yoo-embed-user-select-none",width:24,height:24}),p("span",Object.assign({className:"yoo-embed-font-medium"},{children:"Click to add embed"}))]})),i&&p(kt,{blockId:o,floatingStyles:s,refs:r,onClose:()=>n(!1)}),t]}))},Mt={left:zt,center:xt,right:Ct},{ExtendedBlockActions:Nt,BlockOptionsMenuGroup:jt,BlockOptionsMenuItem:Lt,BlockOptionsSeparator:Wt}=r,Ht=({editor:e,block:t,props:i})=>{var n;const r=(null===(n=null==t?void 0:t.meta)||void 0===n?void 0:n.align)||"center",s=Mt[r];return h(Nt,Object.assign({onClick:()=>e.setPath({current:t.meta.order})},{children:[p(Wt,{}),h(jt,{children:[p(Lt,{children:h("button",Object.assign({type:"button",className:"yoopta-block-options-button",onClick:()=>{const i=["left","center","right"];if(!t)return;const n=i[(i.indexOf(r)+1)%i.length];o.updateBlock(e,t.id,{meta:Object.assign(Object.assign({},t.meta),{align:n})})}},{children:[p(s,{width:16,height:16,className:"yoo-embed-w-4 yoo-embed-h-4 yoo-embed-mr-2"}),"Alignment"]}))}),p(Lt,{children:h("button",Object.assign({type:"button",className:"yoopta-block-options-button",onClick:()=>{var e;window.open(null===(e=null==i?void 0:i.provider)||void 0===e?void 0:e.url,"_blank")}},{children:[p(yt,{width:16,height:16,className:"yoo-embed-w-4 yoo-embed-h-4 yoo-embed-mr-2"}),"Open"]}))})]})]}))},Bt=({position:e})=>p("div",Object.assign({contentEditable:!1,className:"yoo-embed-absolute yoo-embed-pointer-events-none yoo-embed-flex yoo-embed-items-center yoo-embed-justify-center yoo-embed-z-10 yoo-embed-opacity-1 yoo-embed-h-full yoo-embed-w-[15px] yoo-embed-cursor-col-resize yoo-embed-transition-opacity yoo-embed-duration-150 yoo-embed-ease-in "+("left"===e?"yoo-embed-left-0 yoo-embed-top-0":"yoo-embed-right-0 yoo-embed-top-0")},{children:p("div",{className:"yoo-embed-opacity-100 yoo-embed-transition-opacity yoo-embed-duration-300 yoo-embed-ease-in yoo-embed-rounded-[20px] yoo-embed-bg-[rgba(15,15,15,0.6)] yoo-embed-border yoo-embed-border-[rgba(255,255,255,0.9)] yoo-embed-w-[6px] yoo-embed-h-[48px] yoo-embed-max-h-[50%] yoo-embed-shadow-[0_0_0_.5px_#FFF]"})})),Pt={left:"flex-start",center:"center",right:"flex-end"},Tt=new c({type:"Embed",elements:{embed:{render:e=>{var t,{extendRender:o}=e,r=function(e,t){var o={};for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&t.indexOf(i)<0&&(o[i]=e[i]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var n=0;for(i=Object.getOwnPropertySymbols(e);n<i.length;n++)t.indexOf(i[n])<0&&Object.prototype.propertyIsEnumerable.call(e,i[n])&&(o[i[n]]=e[i[n]])}return o}(e,["extendRender"]);const{element:c,children:u,attributes:b,blockId:g}=r,{sizes:y,provider:w}=c.props||{},v=s(g),z=n(),_=a("Embed"),C=l(),[R,S]=m({width:(null==y?void 0:y.width)||750,height:(null==y?void 0:y.height)||440});f((()=>S({width:(null==y?void 0:y.width)||650,height:(null==y?void 0:y.height)||440})),[c.props]);const O=d({blockId:g}),E=x((()=>{var e,t;return{minWidth:300,size:{width:R.width,height:R.height},maxWidth:(null===(e=null==_?void 0:_.maxSizes)||void 0===e?void 0:e.maxWidth)||800,maxHeight:(null===(t=null==_?void 0:_.maxSizes)||void 0===t?void 0:t.maxHeight)||900,lockAspectRatio:!0,resizeRatio:2,enable:{left:!C,right:!C},handleStyles:{left:{left:0},right:{right:0}},onResize:(e,t,o)=>{S({width:o.offsetWidth,height:o.offsetHeight})},onResizeStop:(e,t,o)=>{i.updateElement(z,g,{type:"embed",props:{sizes:{width:o.offsetWidth,height:o.offsetHeight}}})},handleComponent:{left:p(Bt,{position:"left"}),right:p(Bt,{position:"right"})}}}),[R.width,R.height]);if(!w||!(null==w?void 0:w.id))return p(Et,Object.assign({attributes:b,blockId:g},{children:u}));const M=`yoopta-align-${(null===(t=null==v?void 0:v.meta)||void 0===t?void 0:t.align)||"center"}`;return p("div",Object.assign({contentEditable:!1,draggable:!1,className:`yoo-embed-mt-4 yoo-embed-relative yoo-embed-flex ${M} yoopta-embed`},{children:h(G,Object.assign({},E,{className:"yoo-embed-my-0 yoo-embed-flex"},{children:[O&&p("div",{className:"yoo-embed-absolute yoo-embed-pointer-events-none yoo-embed-inset-0 yoo-embed-bg-[rgba(35,131,226,0.14)] yoo-embed-z-[81] yoo-embed-rounded-[3px] yoo-embed-opacity-100 yoo-embed-transition-opacity yoo-embed-duration-150 yoo-embed-ease-in"}),o?o(r):p(k,Object.assign({width:(null==R?void 0:R.width)||650,height:(null==R?void 0:R.height)||550,provider:w,blockId:g,attributes:b},{children:u})),!C&&p(Ht,{block:v,editor:z,props:c.props})]}))}))},props:{sizes:{width:650,height:500},nodeType:"void"}}},options:{display:{title:"Embed",description:"For embed videos, google maps and more"},shortcuts:["instagram","twitter","youtube","vimeo","dailymotion","figma"]},commands:R,parsers:{html:{deserialize:{nodeNames:["IFRAME"],parse:t=>{if("IFRAME"===t.nodeName){const o=new URL(t.getAttribute("src")||"");return{id:e(),type:"embed",children:[{text:""}],props:{provider:{id:o.href,type:o.hostname,url:o.href},sizes:{width:t.getAttribute("width")?parseInt(t.getAttribute("width")||"650",10):650,height:t.getAttribute("height")?parseInt(t.getAttribute("height")||"400",10):400}}}}}},serialize:(e,t,o)=>{const{align:i="center",depth:n=0}=o||{},r=Pt[i]||"center",s={youtube:e=>`https://www.youtube.com/embed/${e}`,vimeo:e=>`https://player.vimeo.com/embed/${e}`,dailymotion:e=>`https://www.dailymotion.com/embed/embed/${e}`,figma:e=>`https://www.figma.com/embed?embed_host=share&url=${e}`,loom:e=>`https://www.loom.com/embed/${e}?hide_owner=true&hide_share=true&hide_title=true&hideEmbedTopBar=true`,instagram:e=>`https://www.instagram.com/p/${e}/embed`,wistia:e=>`https://fast.wistia.net/embed/iframe/${e}?videoFoam=false`,twitter:e=>`https://platform.twitter.com/widgets/tweet.html?id=${e}`};let a=e.props.provider.url;return s[e.props.provider.type]&&(a=s[e.props.provider.type](e.props.provider.id)),`<div style="margin-left: ${20*n}px; display: flex; width: 100%; justify-content: ${r}">\n <iframe data-meta-align="${i}" data-meta-depth="${n}" src="${a}" width="${e.props.sizes.width}" height="${e.props.sizes.height}"></iframe> </div>`}},markdown:{serialize:(e,t)=>`\n`}}});!function(e,t){void 0===t&&(t={});var o=t.insertAt;if(e&&"undefined"!=typeof document){var i=document.head||document.getElementsByTagName("head")[0],n=document.createElement("style");n.type="text/css","top"===o&&i.firstChild?i.insertBefore(n,i.firstChild):i.appendChild(n),n.styleSheet?n.styleSheet.cssText=e:n.appendChild(document.createTextNode(e))}}(".yoo-embed-pointer-events-none{pointer-events:none}.yoo-embed-absolute{position:absolute}.yoo-embed-relative{position:relative}.yoo-embed-inset-0{inset:0}.yoo-embed-left-0{left:0}.yoo-embed-right-0{right:0}.yoo-embed-top-0{top:0}.yoo-embed-z-10{z-index:10}.yoo-embed-z-\\[100\\]{z-index:100}.yoo-embed-z-\\[81\\]{z-index:81}.yoo-embed-m-\\[12px_0_6px\\]{margin:12px 0 6px}.yoo-embed-m-\\[20px_0_10px\\]{margin:20px 0 10px}.yoo-embed-mx-auto{margin-left:auto;margin-right:auto}.yoo-embed-my-0{margin-bottom:0;margin-top:0}.yoo-embed-ml-\\[12px\\]{margin-left:12px}.yoo-embed-mr-2{margin-right:.5rem}.yoo-embed-mr-\\[12px\\]{margin-right:12px}.yoo-embed-mt-4{margin-top:1rem}.yoo-embed-mt-\\[4px\\]{margin-top:4px}.yoo-embed-flex{display:flex}.yoo-embed-inline-flex{display:inline-flex}.yoo-embed-h-4{height:1rem}.yoo-embed-h-\\[28px\\]{height:28px}.yoo-embed-h-\\[32px\\]{height:32px}.yoo-embed-h-\\[40px\\]{height:40px}.yoo-embed-h-\\[48px\\]{height:48px}.yoo-embed-h-full{height:100%}.yoo-embed-max-h-\\[420px\\]{max-height:420px}.yoo-embed-max-h-\\[50\\%\\]{max-height:50%}.yoo-embed-w-4{width:1rem}.yoo-embed-w-\\[15px\\]{width:15px}.yoo-embed-w-\\[6px\\]{width:6px}.yoo-embed-w-full{width:100%}.yoo-embed-min-w-0{min-width:0}.yoo-embed-min-w-\\[540px\\]{min-width:540px}.yoo-embed-max-w-\\[300px\\]{max-width:300px}.yoo-embed-max-w-\\[calc\\(100vw-24px\\)\\]{max-width:calc(100vw - 24px)}.yoo-embed-flex-shrink-0{flex-shrink:0}.yoo-embed-cursor-col-resize{cursor:col-resize}.yoo-embed-cursor-pointer{cursor:pointer}.yoo-embed-cursor-text{cursor:text}.yoo-embed-flex-col{flex-direction:column}.yoo-embed-items-center{align-items:center}.yoo-embed-justify-center{justify-content:center}.yoo-embed-overflow-hidden{overflow:hidden}.yoo-embed-whitespace-nowrap{white-space:nowrap}.yoo-embed-rounded-\\[20px\\]{border-radius:20px}.yoo-embed-rounded-\\[3px\\]{border-radius:3px}.yoo-embed-rounded-\\[4px\\]{border-radius:4px}.yoo-embed-border{border-width:1px}.yoo-embed-border-none{border-style:none}.yoo-embed-border-\\[rgba\\(255\\,255\\,255\\,0\\.9\\)\\]{border-color:hsla(0,0%,100%,.9)}.yoo-embed-bg-\\[\\#FFFFFF\\]{--tw-bg-opacity:1;background-color:rgb(255 255 255/var(--tw-bg-opacity))}.yoo-embed-bg-\\[\\#efefef\\]{--tw-bg-opacity:1;background-color:rgb(239 239 239/var(--tw-bg-opacity))}.yoo-embed-bg-\\[hsla\\(45\\,13\\%\\,94\\%\\,\\.6\\)\\]{background-color:hsla(45,13%,94%,.6)}.yoo-embed-bg-\\[rgb\\(35\\,131\\,226\\)\\]{--tw-bg-opacity:1;background-color:rgb(35 131 226/var(--tw-bg-opacity))}.yoo-embed-bg-\\[rgba\\(15\\,15\\,15\\,0\\.6\\)\\]{background-color:hsla(0,0%,6%,.6)}.yoo-embed-bg-\\[rgba\\(35\\,131\\,226\\,0\\.14\\)\\]{background-color:rgba(35,131,226,.14)}.yoo-embed-bg-inherit{background-color:inherit}.yoo-embed-fill-white{fill:#fff}.yoo-embed-p-\\[0_8px\\]{padding:0 8px}.yoo-embed-p-\\[12px_36px_12px_12px\\]{padding:12px 36px 12px 12px}.yoo-embed-px-\\[12px\\]{padding-left:12px;padding-right:12px}.yoo-embed-px-\\[6px\\]{padding-left:6px;padding-right:6px}.yoo-embed-px-\\[8px\\]{padding-left:8px;padding-right:8px}.yoo-embed-py-\\[6px\\]{padding-bottom:6px;padding-top:6px}.yoo-embed-pb-\\[6px\\]{padding-bottom:6px}.yoo-embed-pt-\\[6px\\]{padding-top:6px}.yoo-embed-text-left{text-align:left}.yoo-embed-text-\\[14px\\]{font-size:14px}.yoo-embed-font-medium{font-weight:500}.yoo-embed-leading-\\[1\\.2\\]{line-height:1.2}.yoo-embed-leading-\\[20px\\]{line-height:20px}.yoo-embed-text-\\[rgb\\(55\\,53\\,47\\)\\]{--tw-text-opacity:1;color:rgb(55 53 47/var(--tw-text-opacity))}.yoo-embed-text-\\[rgba\\(55\\,53\\,47\\,0\\.65\\)\\]{color:rgba(55,53,47,.65)}.yoo-embed-text-white{--tw-text-opacity:1;color:rgb(255 255 255/var(--tw-text-opacity))}.yoo-embed-opacity-100{opacity:1}.yoo-embed-shadow-\\[0_0_0_\\.5px_\\#FFF\\]{--tw-shadow:0 0 0 .5px #fff;--tw-shadow-colored:0 0 0 .5px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow,0 0 #0000),var(--tw-ring-shadow,0 0 #0000),var(--tw-shadow)}.yoo-embed-shadow-\\[inset_0_0_0_1px_hsla\\(0\\,0\\%\\,6\\%\\,\\.1\\)\\]{--tw-shadow:inset 0 0 0 1px hsla(0,0%,6%,.1);--tw-shadow-colored:inset 0 0 0 1px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow,0 0 #0000),var(--tw-ring-shadow,0 0 #0000),var(--tw-shadow)}.yoo-embed-shadow-\\[rgb\\(15_15_15_\\/5\\%\\)_0px_0px_0px_1px\\,_rgb\\(15_15_15_\\/10\\%\\)_0px_3px_6px\\,_rgb\\(15_15_15_\\/20\\%\\)_0px_9px_24px\\]{--tw-shadow:rgb(15 15 15/5%) 0px 0px 0px 1px,hsla(0,0%,6%,.1) 0px 3px 6px,hsla(0,0%,6%,.2) 0px 9px 24px;--tw-shadow-colored:0px 0px 0px 1px var(--tw-shadow-color),0px 3px 6px var(--tw-shadow-color),0px 9px 24px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow,0 0 #0000),var(--tw-ring-shadow,0 0 #0000),var(--tw-shadow)}.yoo-embed-shadow-\\[rgb\\(55_53_47_\\/9\\%\\)_0px_-1px_0px_inset\\]{--tw-shadow:rgb(55 53 47/9%) 0px -1px 0px inset;--tw-shadow-colored:inset 0px -1px 0px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow,0 0 #0000),var(--tw-ring-shadow,0 0 #0000),var(--tw-shadow)}.yoo-embed-shadow-\\[rgba\\(15\\,15\\,15\\,0\\.1\\)_0px_0px_0px_1px_inset\\,_rgba\\(15\\,15\\,15\\,0\\.1\\)_0px_1px_2px\\]{--tw-shadow:hsla(0,0%,6%,.1) 0px 0px 0px 1px inset,hsla(0,0%,6%,.1) 0px 1px 2px;--tw-shadow-colored:inset 0px 0px 0px 1px var(--tw-shadow-color),0px 1px 2px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow,0 0 #0000),var(--tw-ring-shadow,0 0 #0000),var(--tw-shadow)}.yoo-embed-transition-\\[background-color_100ms_ease-in\\]{transition-duration:.15s;transition-property:background-color .1s ease-in;transition-timing-function:cubic-bezier(.4,0,.2,1)}.yoo-embed-transition-\\[height_20ms_ease-in\\]{transition-duration:.15s;transition-property:height 20ms ease-in;transition-timing-function:cubic-bezier(.4,0,.2,1)}.yoo-embed-transition-opacity{transition-duration:.15s;transition-property:opacity;transition-timing-function:cubic-bezier(.4,0,.2,1)}.yoo-embed-duration-150{transition-duration:.15s}.yoo-embed-duration-300{transition-duration:.3s}.yoo-embed-ease-in{transition-timing-function:cubic-bezier(.4,0,1,1)}.yoopta-embed .yoopta-extended-block-actions{opacity:0;transition:opacity .15s ease-in-out}.yoopta-embed:hover .yoopta-extended-block-actions{opacity:1}.hover\\:yoo-embed-bg-\\[\\#e3e3e3\\]:hover{--tw-bg-opacity:1;background-color:rgb(227 227 227/var(--tw-bg-opacity))}.disabled\\:yoo-embed-cursor-not-allowed:disabled{cursor:not-allowed}.disabled\\:yoo-embed-bg-\\[rgba\\(35\\2c 131\\2c 226\\2c 0\\.5\\)\\]:disabled{background-color:rgba(35,131,226,.5)}");export{R as EmbedCommands,Tt as default};
|
|
1
|
+
import{jsx as e,jsxs as t}from"react/jsx-runtime";import{generateId as o,buildBlockData as i,Blocks as n,Elements as r,YooptaPlugin as d}from"@yoopta/editor";import{useState as a,useCallback as s}from"react";function l(e,t,o,i){return new(o||(o=Promise))(function(n,r){function d(e){try{s(i.next(e))}catch(e){r(e)}}function a(e){try{s(i.throw(e))}catch(e){r(e)}}function s(e){var t;e.done?n(e.value):(t=e.value,t instanceof o?t:new o(function(e){e(t)})).then(d,a)}s((i=i.apply(e,t||[])).next())})}"function"==typeof SuppressedError&&SuppressedError;const u=[{type:"youtube",name:"YouTube",patterns:[/(?:youtube\.com\/(?:watch\?v=|embed\/|v\/)|youtu\.be\/)([a-zA-Z0-9_-]{11})/,/youtube\.com\/shorts\/([a-zA-Z0-9_-]{11})/],extractId:e=>{for(const t of u[0].patterns){const o=e.match(t);if(null==o?void 0:o[1])return o[1]}return null},buildEmbedUrl:e=>`https://www.youtube.com/embed/${e}`,aspectRatio:{width:16,height:9},oEmbedUrl:e=>`https://www.youtube.com/oembed?url=${encodeURIComponent(e)}&format=json`},{type:"vimeo",name:"Vimeo",patterns:[/vimeo\.com\/(\d+)/,/player\.vimeo\.com\/video\/(\d+)/],extractId:e=>{for(const t of u[1].patterns){const o=e.match(t);if(null==o?void 0:o[1])return o[1]}return null},buildEmbedUrl:e=>`https://player.vimeo.com/video/${e}`,aspectRatio:{width:16,height:9},oEmbedUrl:e=>`https://vimeo.com/api/oembed.json?url=${encodeURIComponent(e)}`},{type:"dailymotion",name:"Dailymotion",patterns:[/dailymotion\.com\/video\/([a-zA-Z0-9]+)/,/dailymotion\.com\/embed\/video\/([a-zA-Z0-9]+)/,/dai\.ly\/([a-zA-Z0-9]+)/],extractId:e=>{for(const t of u[2].patterns){const o=e.match(t);if(null==o?void 0:o[1])return o[1]}return null},buildEmbedUrl:e=>`https://www.dailymotion.com/embed/video/${e}`,aspectRatio:{width:16,height:9},oEmbedUrl:e=>`https://www.dailymotion.com/services/oembed?url=${encodeURIComponent(e)}&format=json`},{type:"loom",name:"Loom",patterns:[/loom\.com\/share\/([a-zA-Z0-9]+)/,/loom\.com\/embed\/([a-zA-Z0-9]+)/],extractId:e=>{for(const t of u[3].patterns){const o=e.match(t);if(null==o?void 0:o[1])return o[1]}return null},buildEmbedUrl:e=>`https://www.loom.com/embed/${e}?hide_owner=true&hide_share=true&hide_title=true&hideEmbedTopBar=true`,aspectRatio:{width:16,height:9}},{type:"wistia",name:"Wistia",patterns:[/wistia\.(?:com|net)\/embed\/iframe\/([a-zA-Z0-9]+)/,/wistia\.com\/medias\/([a-zA-Z0-9]+)/],extractId:e=>{for(const t of u[4].patterns){const o=e.match(t);if(null==o?void 0:o[1])return o[1]}return null},buildEmbedUrl:e=>`https://fast.wistia.net/embed/iframe/${e}?videoFoam=false`,aspectRatio:{width:16,height:9}},{type:"twitter",name:"Twitter",patterns:[/(?:twitter\.com|x\.com)\/\w+\/status\/(\d+)/],extractId:e=>{var t;const o=e.match(/\/status\/(\d+)/);return null!==(t=null==o?void 0:o[1])&&void 0!==t?t:null},buildEmbedUrl:e=>`https://platform.twitter.com/embed/Tweet.html?id=${e}&theme=light`,aspectRatio:{width:550,height:600}},{type:"instagram",name:"Instagram",patterns:[/instagram\.com\/(?:p|reel|tv)\/([a-zA-Z0-9_-]+)/],extractId:e=>{var t;const o=e.match(/instagram\.com\/(?:p|reel|tv)\/([a-zA-Z0-9_-]+)/);return null!==(t=null==o?void 0:o[1])&&void 0!==t?t:null},buildEmbedUrl:e=>`https://www.instagram.com/p/${e}/embed`,aspectRatio:{width:1,height:1}},{type:"figma",name:"Figma",patterns:[/figma\.com\/(file|proto|design)\/([a-zA-Z0-9]+)/],extractId:e=>e,buildEmbedUrl:(e,t)=>`https://www.figma.com/embed?embed_host=share&url=${encodeURIComponent(t)}`,aspectRatio:{width:16,height:9}},{type:"codepen",name:"CodePen",patterns:[/codepen\.io\/([a-zA-Z0-9_-]+)\/(?:pen|full|details|debug)\/([a-zA-Z0-9]+)/],extractId:e=>{const t=e.match(/codepen\.io\/([a-zA-Z0-9_-]+)\/(?:pen|full|details|debug)\/([a-zA-Z0-9]+)/);return t?`${t[1]}/${t[2]}`:null},buildEmbedUrl:e=>{const[t,o]=e.split("/");return`https://codepen.io/${t}/embed/${o}?default-tab=result&theme-id=dark`},aspectRatio:{width:16,height:9}},{type:"codesandbox",name:"CodeSandbox",patterns:[/codesandbox\.io\/(?:s|embed)\/([a-zA-Z0-9-]+)/],extractId:e=>{var t;const o=e.match(/codesandbox\.io\/(?:s|embed)\/([a-zA-Z0-9-]+)/);return null!==(t=null==o?void 0:o[1])&&void 0!==t?t:null},buildEmbedUrl:e=>`https://codesandbox.io/embed/${e}?fontsize=14&hidenavigation=1&theme=dark`,aspectRatio:{width:16,height:9}},{type:"spotify",name:"Spotify",patterns:[/open\.spotify\.com\/(track|album|playlist|episode|show)\/([a-zA-Z0-9]+)/],extractId:e=>{const t=e.match(/open\.spotify\.com\/(track|album|playlist|episode|show)\/([a-zA-Z0-9]+)/);return t?`${t[1]}/${t[2]}`:null},buildEmbedUrl:e=>`https://open.spotify.com/embed/${e}`,aspectRatio:{width:300,height:380}},{type:"soundcloud",name:"SoundCloud",patterns:[/soundcloud\.com\/([a-zA-Z0-9_-]+)\/([a-zA-Z0-9_-]+)/],extractId:e=>e,buildEmbedUrl:(e,t)=>`https://w.soundcloud.com/player/?url=${encodeURIComponent(t)}&color=%23ff5500&auto_play=false&hide_related=true&show_comments=false&show_user=true&show_reposts=false&show_teaser=false`,aspectRatio:{width:100,height:166}},{type:"google-maps",name:"Google Maps",patterns:[/google\.com\/maps\/embed/,/google\.com\/maps\/place/,/google\.com\/maps\/@/,/maps\.google\.com/],extractId:e=>e,buildEmbedUrl:(e,t)=>t.includes("/maps/embed")?t:`https://www.google.com/maps/embed?pb=!1m18!1m12!1m3!1d0!2d0!3d0!2m3!1f0!2f0!3f0!3m2!1i1024!2i768!4f13.1!3m3!1m2!1s${encodeURIComponent(t)}!5e0!3m2!1sen!2sus!4v0`,aspectRatio:{width:16,height:9}}];function c(e){return u.find(t=>t.type===e)}function m(e){const t=e.toLowerCase().trim();for(const e of u)for(const o of e.patterns)if(o.test(t))return e.type;return"unknown"}function p(e){return"unknown"!==m(e)}function h(e){if(!e)return null;try{const t=m(e);if("unknown"===t)return{type:"unknown",id:e,url:e,embedUrl:e};const o=c(t);if(!o)return null;const i=o.extractId(e);if(!i)return null;return{type:t,id:i,url:e,embedUrl:o.buildEmbedUrl(i,e)}}catch(e){return null}}function b(e){var t;const o=c(e);return null!==(t=null==o?void 0:o.aspectRatio)&&void 0!==t?t:{width:16,height:9}}function f(e,t=650){const o=b(e);return{width:t,height:Math.round(t*o.height/o.width)}}function v(e){const t=c(m(e));return(null==t?void 0:t.oEmbedUrl)?t.oEmbedUrl(e):null}function g(){return u.map(e=>({type:e.type,name:e.name}))}function y(e){return l(this,void 0,void 0,function*(){const t=v(e);if(!t)return null;try{const e=yield fetch(t);if(!e.ok)return null;return yield e.json()}catch(e){return null}})}function w(e){if(e)return{title:e.title,description:void 0,thumbnailUrl:e.thumbnail_url,authorName:e.author_name,authorUrl:e.author_url}}function E(e,t){return l(this,void 0,void 0,function*(){try{const o=yield fetch(`${t}?url=${encodeURIComponent(e)}`);return o.ok?yield o.json():null}catch(e){return null}})}u.reduce((e,t)=>Object.assign(Object.assign({},e),{[t.type]:t.extractId}),{});const x={buildEmbedElements:(e,t={})=>{var i,n,r,d;const a={provider:null!==(n=null===(i=t.props)||void 0===i?void 0:i.provider)&&void 0!==n?n:null,sizes:null!==(d=null===(r=t.props)||void 0===r?void 0:r.sizes)&&void 0!==d?d:{width:650,height:400},nodeType:"void"};return{id:o(),type:"embed",children:[{text:""}],props:a}},insertEmbed:(e,t={})=>{const{at:o,focus:r,props:d}=t,a=x.buildEmbedElements(e,{props:d}),s=i({value:[a],type:"Embed",meta:{align:"center",depth:0}});n.insertBlock(e,s.type,{focus:r,at:o,blockData:s})},insertEmbedFromUrl:(e,t)=>l(void 0,void 0,void 0,function*(){const{url:o,at:r,focus:d,fetchMeta:a=!1,maxWidth:s=650}=t,l=h(o);if(!l)return console.warn("[Embed] Could not parse URL:",o),null;const u=f(l.type,s);let c;if(a)try{c=w(yield y(o))}catch(e){}const m=Object.assign(Object.assign({},l),{meta:c}),p=x.buildEmbedElements(e,{props:{provider:m,sizes:u}}),b=i({value:[p],type:"Embed",meta:{align:"center",depth:0}});return n.insertBlock(e,b.type,{focus:d,at:r,blockData:b}),b.id}),deleteEmbed:(e,t)=>{n.deleteBlock(e,{blockId:t})},updateEmbed:(e,t,o)=>{r.updateElement(e,{blockId:t,type:"embed",props:o})},updateEmbedUrl:(e,t)=>l(void 0,void 0,void 0,function*(){const{blockId:o,url:i,fetchMeta:n=!1,maxWidth:r=650}=t,d=h(i);if(!d)return void console.warn("[Embed] Could not parse URL:",i);const a=f(d.type,r);let s;if(n)try{s=w(yield y(i))}catch(e){}const l=Object.assign(Object.assign({},d),{meta:s});x.updateEmbed(e,o,{provider:l,sizes:a})}),updateEmbedSizes:(e,t,o)=>{x.updateEmbed(e,t,{sizes:o})},isValidEmbedUrl:(e,t)=>p(t),parseUrl:(e,t)=>h(t)},$={left:"flex-start",center:"center",right:"flex-end"},U=new d({type:"Embed",elements:e("embed",{render:o=>{var i,n;return t("div",Object.assign({contentEditable:!1},o.attributes,{children:[e("iframe",{title:null===(i=o.element.props.provider)||void 0===i?void 0:i.type,src:null===(n=o.element.props.provider)||void 0===n?void 0:n.embedUrl,width:o.element.props.sizes.width,height:o.element.props.sizes.height,allowFullScreen:!0,frameBorder:0}),o.children]}))},props:{provider:null,sizes:{width:650,height:400},nodeType:"void"},nodeType:"void"}),options:{display:{title:"Embed",description:"Embed videos, maps, code, and more"},shortcuts:["embed","youtube","vimeo","twitter","instagram","figma","codepen","spotify"],maxWidth:650},commands:x,parsers:{html:{deserialize:{nodeNames:["IFRAME","DIV"],parse:e=>{var t,i,n,r;if("IFRAME"===e.nodeName){const n=e.getAttribute("src");if(!n)return;const r=h(n);if(!r)return;const d=parseInt(null!==(t=e.getAttribute("width"))&&void 0!==t?t:"650",10),a=parseInt(null!==(i=e.getAttribute("height"))&&void 0!==i?i:"400",10);return{id:o(),type:"embed",children:[{text:""}],props:{provider:r,sizes:{width:d,height:a},nodeType:"void"}}}if("DIV"===e.nodeName&&e.hasAttribute("data-yoopta-embed")){const t=e.querySelector("iframe");if(!t)return;const i=t.getAttribute("src");if(!i)return;const d=h(i);if(!d)return;const a=parseInt(null!==(n=t.getAttribute("width"))&&void 0!==n?n:"650",10),s=parseInt(null!==(r=t.getAttribute("height"))&&void 0!==r?r:"400",10);return{id:o(),type:"embed",children:[{text:""}],props:{provider:d,sizes:{width:a,height:s},nodeType:"void"}}}}},serialize:(e,t,o)=>{var i;const{align:n="center",depth:r=0}=null!=o?o:{},d=null!==(i=$[n])&&void 0!==i?i:"center",{provider:a,sizes:s}=e.props;return a?`<div data-yoopta-embed data-provider="${a.type}" data-meta-align="${n}" data-meta-depth="${r}" style="margin-left: ${20*r}px; display: flex; width: 100%; justify-content: ${d};">\n <iframe src="${a.embedUrl}" width="${s.width}" height="${s.height}" frameborder="0" allowfullscreen></iframe>\n </div>`:`<div data-meta-align="${n}" data-meta-depth="${r}" style="margin-left: ${20*r}px;">\x3c!-- Empty embed --\x3e</div>`}},markdown:{serialize:e=>{var t,o;const{provider:i}=e.props;return i?`[${null!==(o=null===(t=i.meta)||void 0===t?void 0:t.title)&&void 0!==o?o:i.type}](${i.url})\n`:""}},email:{serialize:(e,t,o)=>{var i,n,r,d;const{align:a="center",depth:s=0}=null!=o?o:{},l=null!==(i=$[a])&&void 0!==i?i:"center",{provider:u,sizes:c}=e.props;if(!u)return"";const m=(null===(n=u.meta)||void 0===n?void 0:n.thumbnailUrl)?`<img src="${u.meta.thumbnailUrl}" width="${c.width}" height="${c.height}" alt="${null!==(d=null===(r=u.meta)||void 0===r?void 0:r.title)&&void 0!==d?d:"Embedded content"}" style="border-radius: 8px; max-width: 100%;" />`:`<div style="width: ${c.width}px; height: ${c.height}px; background: #f0f0f0; border-radius: 8px; display: flex; align-items: center; justify-content: center;">\n <span style="color: #666;">Click to view ${u.type} content</span>\n </div>`;return`\n <table style="width: 100%;">\n <tbody>\n <tr>\n <td style="margin-left: ${20*s}px; display: flex; justify-content: ${l}; padding: 1rem 0;">\n <a href="${u.url}" target="_blank" rel="noopener noreferrer" style="text-decoration: none;">\n ${m}\n </a>\n </td>\n </tr>\n </tbody>\n </table>\n `}}}}),z={url:"",provider:null,sizes:{width:650,height:400},isValid:!1,isLoading:!1,error:null};function I(e=650){const[t,o]=a(z),i=s(t=>{const i=t.trim();if(!i)return void o(z);const n=p(i),r=h(i);let d={width:e,height:400};r&&(d=f(r.type,e)),o({url:i,provider:r,sizes:d,isValid:n,isLoading:!1,error:n?null:"Unsupported URL format"})},[e]),n=s(e=>h(e),[]),r=s(()=>l(this,void 0,void 0,function*(){if(t.url&&t.isValid){o(e=>Object.assign(Object.assign({},e),{isLoading:!0,error:null}));try{const e=w(yield y(t.url));return e&&t.provider?o(t=>Object.assign(Object.assign({},t),{provider:t.provider?Object.assign(Object.assign({},t.provider),{meta:e}):null,isLoading:!1})):o(e=>Object.assign(Object.assign({},e),{isLoading:!1})),e}catch(e){return void o(e=>Object.assign(Object.assign({},e),{isLoading:!1,error:"Failed to fetch metadata"}))}}}),[t.url,t.isValid,t.provider]),d=s(()=>{o(z)},[]);return Object.assign(Object.assign({},t),{setUrl:i,parseUrl:n,fetchMeta:r,reset:d})}export{x as EmbedCommands,u as PROVIDER_CONFIGS,f as calculateEmbedDimensions,U as default,m as detectProvider,w as extractProviderMeta,y as fetchOEmbed,E as fetchOEmbedViaProxy,v as getOEmbedUrl,b as getProviderAspectRatio,c as getProviderConfig,g as getSupportedProviders,p as isEmbedUrl,h as parseEmbedUrl,I as useEmbedUrl};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { YooptaPlugin } from '@yoopta/editor';
|
|
2
|
-
import { EmbedElementMap, EmbedPluginOptions } from '../types';
|
|
2
|
+
import type { EmbedElementMap, EmbedPluginOptions } from '../types';
|
|
3
3
|
declare const Embed: YooptaPlugin<EmbedElementMap, EmbedPluginOptions>;
|
|
4
4
|
export { Embed };
|
|
5
|
-
//# sourceMappingURL=
|
|
5
|
+
//# sourceMappingURL=embed-plugin.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"embed-plugin.d.ts","sourceRoot":"","sources":["../../src/plugin/embed-plugin.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAc,MAAM,gBAAgB,CAAC;AAG1D,OAAO,KAAK,EAAE,eAAe,EAAqB,kBAAkB,EAAE,MAAM,UAAU,CAAC;AAevF,QAAA,MAAM,KAAK,mDAyIT,CAAC;AAEH,OAAO,EAAE,KAAK,EAAE,CAAC"}
|
package/dist/types.d.ts
CHANGED
|
@@ -1,34 +1,72 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { RenderElementProps } from 'slate-react';
|
|
3
|
-
export type
|
|
4
|
-
|
|
5
|
-
|
|
1
|
+
import type { SlateElement } from '@yoopta/editor';
|
|
2
|
+
import type { RenderElementProps } from 'slate-react';
|
|
3
|
+
export type EmbedProviderType = 'youtube' | 'vimeo' | 'dailymotion' | 'wistia' | 'loom' | 'twitter' | 'figma' | 'instagram' | 'codepen' | 'codesandbox' | 'spotify' | 'soundcloud' | 'google-maps' | 'unknown';
|
|
4
|
+
export type EmbedProviderMeta = {
|
|
5
|
+
title?: string;
|
|
6
|
+
description?: string;
|
|
7
|
+
thumbnailUrl?: string;
|
|
8
|
+
authorName?: string;
|
|
9
|
+
authorUrl?: string;
|
|
6
10
|
};
|
|
7
|
-
export type EmbedProviderTypes = 'youtube' | 'vimeo' | 'dailymotion' | 'wistia' | 'loom' | 'twitter' | 'figma' | 'instagram' | string | null;
|
|
8
11
|
export type EmbedProvider = {
|
|
9
|
-
type:
|
|
12
|
+
type: EmbedProviderType;
|
|
10
13
|
id: string;
|
|
11
|
-
url
|
|
14
|
+
url: string;
|
|
15
|
+
embedUrl: string;
|
|
16
|
+
meta?: EmbedProviderMeta;
|
|
17
|
+
};
|
|
18
|
+
export type EmbedSizes = {
|
|
19
|
+
width: number;
|
|
20
|
+
height: number;
|
|
21
|
+
};
|
|
22
|
+
export type EmbedAspectRatio = {
|
|
23
|
+
width: number;
|
|
24
|
+
height: number;
|
|
12
25
|
};
|
|
13
26
|
export type EmbedElementProps = {
|
|
14
|
-
|
|
15
|
-
|
|
27
|
+
provider: EmbedProvider | null;
|
|
28
|
+
sizes: EmbedSizes;
|
|
29
|
+
nodeType: 'void';
|
|
16
30
|
};
|
|
17
31
|
export type EmbedPluginElements = 'embed';
|
|
18
32
|
export type EmbedElement = SlateElement<'embed', EmbedElementProps>;
|
|
19
33
|
export type EmbedPluginOptions = {
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
maxHeight?: number | 'auto';
|
|
23
|
-
};
|
|
34
|
+
maxWidth?: number;
|
|
35
|
+
defaultSizes?: EmbedSizes;
|
|
24
36
|
};
|
|
25
|
-
export type
|
|
37
|
+
export type EmbedProviderRenderProps = {
|
|
26
38
|
provider: EmbedProvider;
|
|
27
39
|
blockId: string;
|
|
28
40
|
width: number;
|
|
29
41
|
height: number;
|
|
42
|
+
isLoading?: boolean;
|
|
43
|
+
error?: string | null;
|
|
30
44
|
} & Pick<RenderElementProps, 'attributes' | 'children'>;
|
|
31
45
|
export type EmbedElementMap = {
|
|
32
46
|
embed: EmbedElement;
|
|
33
47
|
};
|
|
48
|
+
export type OEmbedResponse = {
|
|
49
|
+
type: 'video' | 'photo' | 'link' | 'rich';
|
|
50
|
+
version: string;
|
|
51
|
+
title?: string;
|
|
52
|
+
author_name?: string;
|
|
53
|
+
author_url?: string;
|
|
54
|
+
provider_name?: string;
|
|
55
|
+
provider_url?: string;
|
|
56
|
+
thumbnail_url?: string;
|
|
57
|
+
thumbnail_width?: number;
|
|
58
|
+
thumbnail_height?: number;
|
|
59
|
+
html?: string;
|
|
60
|
+
width?: number;
|
|
61
|
+
height?: number;
|
|
62
|
+
};
|
|
63
|
+
export type ProviderConfig = {
|
|
64
|
+
type: EmbedProviderType;
|
|
65
|
+
name: string;
|
|
66
|
+
patterns: RegExp[];
|
|
67
|
+
extractId: (url: string) => string | null;
|
|
68
|
+
buildEmbedUrl: (id: string, url: string) => string;
|
|
69
|
+
aspectRatio: EmbedAspectRatio;
|
|
70
|
+
oEmbedUrl?: (url: string) => string;
|
|
71
|
+
};
|
|
34
72
|
//# sourceMappingURL=types.d.ts.map
|
package/dist/types.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AACnD,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,aAAa,CAAC;AAGtD,MAAM,MAAM,iBAAiB,GACzB,SAAS,GACT,OAAO,GACP,aAAa,GACb,QAAQ,GACR,MAAM,GACN,SAAS,GACT,OAAO,GACP,WAAW,GACX,SAAS,GACT,aAAa,GACb,SAAS,GACT,YAAY,GACZ,aAAa,GACb,SAAS,CAAC;AAGd,MAAM,MAAM,iBAAiB,GAAG;IAC9B,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB,CAAC;AAGF,MAAM,MAAM,aAAa,GAAG;IAC1B,IAAI,EAAE,iBAAiB,CAAC;IACxB,EAAE,EAAE,MAAM,CAAC;IACX,GAAG,EAAE,MAAM,CAAC;IACZ,QAAQ,EAAE,MAAM,CAAC;IACjB,IAAI,CAAC,EAAE,iBAAiB,CAAC;CAC1B,CAAC;AAGF,MAAM,MAAM,UAAU,GAAG;IACvB,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,EAAE,MAAM,CAAC;CAChB,CAAC;AAGF,MAAM,MAAM,gBAAgB,GAAG;IAC7B,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,EAAE,MAAM,CAAC;CAChB,CAAC;AAGF,MAAM,MAAM,iBAAiB,GAAG;IAC9B,QAAQ,EAAE,aAAa,GAAG,IAAI,CAAC;IAC/B,KAAK,EAAE,UAAU,CAAC;IAClB,QAAQ,EAAE,MAAM,CAAC;CAClB,CAAC;AAGF,MAAM,MAAM,mBAAmB,GAAG,OAAO,CAAC;AAC1C,MAAM,MAAM,YAAY,GAAG,YAAY,CAAC,OAAO,EAAE,iBAAiB,CAAC,CAAC;AAGpE,MAAM,MAAM,kBAAkB,GAAG;IAC/B,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,YAAY,CAAC,EAAE,UAAU,CAAC;CAC3B,CAAC;AAGF,MAAM,MAAM,wBAAwB,GAAG;IACrC,QAAQ,EAAE,aAAa,CAAC;IACxB,OAAO,EAAE,MAAM,CAAC;IAChB,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,EAAE,MAAM,CAAC;IACf,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,KAAK,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;CACvB,GAAG,IAAI,CAAC,kBAAkB,EAAE,YAAY,GAAG,UAAU,CAAC,CAAC;AAGxD,MAAM,MAAM,eAAe,GAAG;IAC5B,KAAK,EAAE,YAAY,CAAC;CACrB,CAAC;AAGF,MAAM,MAAM,cAAc,GAAG;IAC3B,IAAI,EAAE,OAAO,GAAG,OAAO,GAAG,MAAM,GAAG,MAAM,CAAC;IAC1C,OAAO,EAAE,MAAM,CAAC;IAChB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB,CAAC;AAGF,MAAM,MAAM,cAAc,GAAG;IAC3B,IAAI,EAAE,iBAAiB,CAAC;IACxB,IAAI,EAAE,MAAM,CAAC;IAEb,QAAQ,EAAE,MAAM,EAAE,CAAC;IAEnB,SAAS,EAAE,CAAC,GAAG,EAAE,MAAM,KAAK,MAAM,GAAG,IAAI,CAAC;IAE1C,aAAa,EAAE,CAAC,EAAE,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,KAAK,MAAM,CAAC;IAEnD,WAAW,EAAE,gBAAgB,CAAC;IAE9B,SAAS,CAAC,EAAE,CAAC,GAAG,EAAE,MAAM,KAAK,MAAM,CAAC;CACrC,CAAC"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import type { EmbedProviderMeta, OEmbedResponse } from '../types';
|
|
2
|
+
/**
|
|
3
|
+
* Fetch oEmbed data for a URL
|
|
4
|
+
* Note: This requires CORS support or a proxy for most providers
|
|
5
|
+
*/
|
|
6
|
+
export declare function fetchOEmbed(url: string): Promise<OEmbedResponse | null>;
|
|
7
|
+
/**
|
|
8
|
+
* Extract provider metadata from oEmbed response
|
|
9
|
+
*/
|
|
10
|
+
export declare function extractProviderMeta(oembedData: OEmbedResponse | null): EmbedProviderMeta | undefined;
|
|
11
|
+
/**
|
|
12
|
+
* Fetch oEmbed data via a proxy (for production use)
|
|
13
|
+
* You can implement your own proxy endpoint
|
|
14
|
+
*/
|
|
15
|
+
export declare function fetchOEmbedViaProxy(url: string, proxyUrl: string): Promise<OEmbedResponse | null>;
|
|
16
|
+
//# sourceMappingURL=oembed.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"oembed.d.ts","sourceRoot":"","sources":["../../src/utils/oembed.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,iBAAiB,EAAE,cAAc,EAAE,MAAM,UAAU,CAAC;AAGlE;;;GAGG;AACH,wBAAsB,WAAW,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC,cAAc,GAAG,IAAI,CAAC,CAoB7E;AAED;;GAEG;AACH,wBAAgB,mBAAmB,CAAC,UAAU,EAAE,cAAc,GAAG,IAAI,GAAG,iBAAiB,GAAG,SAAS,CAUpG;AAED;;;GAGG;AACH,wBAAsB,mBAAmB,CACvC,GAAG,EAAE,MAAM,EACX,QAAQ,EAAE,MAAM,GACf,OAAO,CAAC,cAAc,GAAG,IAAI,CAAC,CAYhC"}
|
|
@@ -1,21 +1,43 @@
|
|
|
1
|
-
import {
|
|
2
|
-
export declare const
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
export declare
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
export declare function
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
1
|
+
import type { EmbedAspectRatio, EmbedProvider, EmbedProviderType, ProviderConfig } from '../types';
|
|
2
|
+
export declare const PROVIDER_CONFIGS: ProviderConfig[];
|
|
3
|
+
/**
|
|
4
|
+
* Get provider config by type
|
|
5
|
+
*/
|
|
6
|
+
export declare function getProviderConfig(type: EmbedProviderType): ProviderConfig | undefined;
|
|
7
|
+
/**
|
|
8
|
+
* Detect provider type from URL
|
|
9
|
+
*/
|
|
10
|
+
export declare function detectProvider(url: string): EmbedProviderType;
|
|
11
|
+
/**
|
|
12
|
+
* Check if URL is a valid embed URL
|
|
13
|
+
*/
|
|
14
|
+
export declare function isEmbedUrl(url: string): boolean;
|
|
15
|
+
/**
|
|
16
|
+
* Parse URL and extract provider info
|
|
17
|
+
*/
|
|
18
|
+
export declare function parseEmbedUrl(url: string): EmbedProvider | null;
|
|
19
|
+
/**
|
|
20
|
+
* Get aspect ratio for provider
|
|
21
|
+
*/
|
|
22
|
+
export declare function getProviderAspectRatio(type: EmbedProviderType): EmbedAspectRatio;
|
|
23
|
+
/**
|
|
24
|
+
* Calculate dimensions based on aspect ratio and max width
|
|
25
|
+
*/
|
|
26
|
+
export declare function calculateEmbedDimensions(type: EmbedProviderType, maxWidth?: number): {
|
|
27
|
+
width: number;
|
|
28
|
+
height: number;
|
|
20
29
|
};
|
|
30
|
+
/**
|
|
31
|
+
* Get oEmbed URL for provider
|
|
32
|
+
*/
|
|
33
|
+
export declare function getOEmbedUrl(url: string): string | null;
|
|
34
|
+
/**
|
|
35
|
+
* Get list of supported providers for display
|
|
36
|
+
*/
|
|
37
|
+
export declare function getSupportedProviders(): {
|
|
38
|
+
type: EmbedProviderType;
|
|
39
|
+
name: string;
|
|
40
|
+
}[];
|
|
41
|
+
export declare const getProvider: typeof detectProvider;
|
|
42
|
+
export declare const ProviderGetters: Record<EmbedProviderType, (url: string) => string | null>;
|
|
21
43
|
//# sourceMappingURL=providers.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"providers.d.ts","sourceRoot":"","sources":["../../src/utils/providers.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"providers.d.ts","sourceRoot":"","sources":["../../src/utils/providers.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,gBAAgB,EAAE,aAAa,EAAE,iBAAiB,EAAE,cAAc,EAAE,MAAM,UAAU,CAAC;AAMnG,eAAO,MAAM,gBAAgB,EAAE,cAAc,EA8N5C,CAAC;AAMF;;GAEG;AACH,wBAAgB,iBAAiB,CAAC,IAAI,EAAE,iBAAiB,GAAG,cAAc,GAAG,SAAS,CAErF;AAED;;GAEG;AACH,wBAAgB,cAAc,CAAC,GAAG,EAAE,MAAM,GAAG,iBAAiB,CAY7D;AAED;;GAEG;AACH,wBAAgB,UAAU,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAE/C;AAED;;GAEG;AACH,wBAAgB,aAAa,CAAC,GAAG,EAAE,MAAM,GAAG,aAAa,GAAG,IAAI,CAgC/D;AAED;;GAEG;AACH,wBAAgB,sBAAsB,CAAC,IAAI,EAAE,iBAAiB,GAAG,gBAAgB,CAGhF;AAED;;GAEG;AACH,wBAAgB,wBAAwB,CACtC,IAAI,EAAE,iBAAiB,EACvB,QAAQ,GAAE,MAAY,GACrB;IAAE,KAAK,EAAE,MAAM,CAAC;IAAC,MAAM,EAAE,MAAM,CAAA;CAAE,CAMnC;AAED;;GAEG;AACH,wBAAgB,YAAY,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,GAAG,IAAI,CAOvD;AAED;;GAEG;AACH,wBAAgB,qBAAqB,IAAI;IAAE,IAAI,EAAE,iBAAiB,CAAC;IAAC,IAAI,EAAE,MAAM,CAAA;CAAE,EAAE,CAKnF;AAMD,eAAO,MAAM,WAAW,uBAAiB,CAAC;AAE1C,eAAO,MAAM,eAAe,EAAE,MAAM,CAAC,iBAAiB,EAAE,CAAC,GAAG,EAAE,MAAM,KAAK,MAAM,GAAG,IAAI,CAOnF,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@yoopta/embed",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "6.0.0-beta.10",
|
|
4
4
|
"description": "Embed plugin for Yoopta Editor",
|
|
5
5
|
"author": "Darginec05 <devopsbanda@gmail.com>",
|
|
6
6
|
"homepage": "https://github.com/Darginec05/Yoopta-Editor#readme",
|
|
@@ -14,12 +14,13 @@
|
|
|
14
14
|
"dist/"
|
|
15
15
|
],
|
|
16
16
|
"peerDependencies": {
|
|
17
|
-
"@yoopta/editor": "
|
|
18
|
-
"react": ">=
|
|
19
|
-
"react-dom": ">=
|
|
17
|
+
"@yoopta/editor": "6.0.0-beta.4",
|
|
18
|
+
"react": ">=18.2.0",
|
|
19
|
+
"react-dom": ">=18.2.0"
|
|
20
20
|
},
|
|
21
21
|
"publishConfig": {
|
|
22
|
-
"registry": "https://registry.npmjs.org"
|
|
22
|
+
"registry": "https://registry.npmjs.org",
|
|
23
|
+
"access": "public"
|
|
23
24
|
},
|
|
24
25
|
"repository": {
|
|
25
26
|
"type": "git",
|
|
@@ -34,10 +35,5 @@
|
|
|
34
35
|
"bugs": {
|
|
35
36
|
"url": "https://github.com/Darginec05/Yoopta-Editor/issues"
|
|
36
37
|
},
|
|
37
|
-
"
|
|
38
|
-
"@floating-ui/react": "^0.26.9",
|
|
39
|
-
"@radix-ui/react-icons": "^1.3.0",
|
|
40
|
-
"re-resizable": "^6.9.11"
|
|
41
|
-
},
|
|
42
|
-
"gitHead": "e8260945d74e2b26e8c66a3ddf4da8ceb45bc74d"
|
|
38
|
+
"gitHead": "cab1b9a3d5f104c46da98df464f1806d968b12fd"
|
|
43
39
|
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/plugin/index.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAc,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAE1D,OAAO,EAAE,eAAe,EAAE,kBAAkB,EAAE,MAAM,UAAU,CAAC;AAS/D,QAAA,MAAM,KAAK,mDAgFT,CAAC;AAEH,OAAO,EAAE,KAAK,EAAE,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"DailyMotion.d.ts","sourceRoot":"","sources":["../../src/providers/DailyMotion.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAE,mBAAmB,EAAE,MAAM,UAAU,CAAC;AAI/C,iBAAS,WAAW,CAAC,EAAE,QAAQ,EAAE,KAAK,EAAE,MAAM,EAAE,UAAU,EAAE,QAAQ,EAAE,EAAE,mBAAmB,2CAkD1F;AAED,OAAO,EAAE,WAAW,EAAE,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"Figma.d.ts","sourceRoot":"","sources":["../../src/providers/Figma.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAE,mBAAmB,EAAE,MAAM,UAAU,CAAC;AAE/C,QAAA,MAAM,KAAK,sDAAuD,mBAAmB,4CA4BpF,CAAC;AAEF,OAAO,EAAE,KAAK,EAAE,CAAC"}
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
type InstagramProps = {
|
|
3
|
-
provider: {
|
|
4
|
-
id: string;
|
|
5
|
-
url: string;
|
|
6
|
-
};
|
|
7
|
-
width: number | 'auto';
|
|
8
|
-
height: number | 'auto';
|
|
9
|
-
blockId: string;
|
|
10
|
-
attributes: any;
|
|
11
|
-
children: React.ReactNode;
|
|
12
|
-
};
|
|
13
|
-
declare const Instagram: React.FC<InstagramProps>;
|
|
14
|
-
export default Instagram;
|
|
15
|
-
//# sourceMappingURL=Instagram.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"Instagram.d.ts","sourceRoot":"","sources":["../../src/providers/Instagram.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAiB,MAAM,OAAO,CAAC;AAGtC,KAAK,cAAc,GAAG;IACpB,QAAQ,EAAE;QACR,EAAE,EAAE,MAAM,CAAC;QACX,GAAG,EAAE,MAAM,CAAC;KACb,CAAC;IACF,KAAK,EAAE,MAAM,GAAG,MAAM,CAAC;IACvB,MAAM,EAAE,MAAM,GAAG,MAAM,CAAC;IACxB,OAAO,EAAE,MAAM,CAAC;IAChB,UAAU,EAAE,GAAG,CAAC;IAChB,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC;CAC3B,CAAC;AAEF,QAAA,MAAM,SAAS,EAAE,KAAK,CAAC,EAAE,CAAC,cAAc,CA4BvC,CAAC;AAEF,eAAe,SAAS,CAAC"}
|
package/dist/providers/Loom.d.ts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"Loom.d.ts","sourceRoot":"","sources":["../../src/providers/Loom.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAE,mBAAmB,EAAE,MAAM,UAAU,CAAC;AAE/C,wBAAgB,IAAI,CAAC,EAAE,QAAQ,EAAE,UAAU,EAAE,QAAQ,EAAE,KAAK,EAAE,MAAM,EAAE,EAAE,mBAAmB,2CAsD1F"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"Twitter.d.ts","sourceRoot":"","sources":["../../src/providers/Twitter.tsx"],"names":[],"mappings":"AAGA,OAAO,EAA0C,mBAAmB,EAAE,MAAM,UAAU,CAAC;AAEvF,iBAAS,OAAO,CAAC,EAAE,QAAQ,EAAE,OAAO,EAAE,UAAU,EAAE,QAAQ,EAAE,MAAM,EAAE,KAAK,EAAE,EAAE,mBAAmB,2CA6D/F;AAED,eAAe,OAAO,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"Vimeo.d.ts","sourceRoot":"","sources":["../../src/providers/Vimeo.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAE,mBAAmB,EAAE,MAAM,UAAU,CAAC;AAI/C,iBAAS,KAAK,CAAC,EAAE,QAAQ,EAAE,KAAK,EAAE,MAAM,EAAE,UAAU,EAAE,QAAQ,EAAE,EAAE,mBAAmB,2CAmDpF;AAED,OAAO,EAAE,KAAK,EAAE,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"Wistia.d.ts","sourceRoot":"","sources":["../../src/providers/Wistia.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAE,mBAAmB,EAAE,MAAM,UAAU,CAAC;AAE/C,iBAAS,MAAM,CAAC,EAAE,QAAQ,EAAE,UAAU,EAAE,QAAQ,EAAE,KAAK,EAAE,MAAM,EAAE,EAAE,mBAAmB,2CA6CrF;AAED,OAAO,EAAE,MAAM,EAAE,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"Youtube.d.ts","sourceRoot":"","sources":["../../src/providers/Youtube.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAE,mBAAmB,EAAE,MAAM,UAAU,CAAC;AAE/C,iBAAS,OAAO,CAAC,EAAE,QAAQ,EAAE,KAAK,EAAE,MAAM,EAAE,UAAU,EAAE,QAAQ,EAAE,EAAE,mBAAmB,2CA2CtF;AAED,OAAO,EAAE,OAAO,EAAE,CAAC"}
|
package/dist/ui/Embed.d.ts
DELETED
package/dist/ui/Embed.d.ts.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"Embed.d.ts","sourceRoot":"","sources":["../../src/ui/Embed.tsx"],"names":[],"mappings":"AACA,OAAO,EAEL,wBAAwB,EAMzB,MAAM,gBAAgB,CAAC;AAQxB,QAAA,MAAM,WAAW,+BAAgC,wBAAwB,4CAkGxE,CAAC;AAEF,OAAO,EAAE,WAAW,EAAE,CAAC"}
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import { YooEditor, YooptaBlockData } from '@yoopta/editor';
|
|
2
|
-
import { EmbedElementProps } from '../types';
|
|
3
|
-
type Props = {
|
|
4
|
-
editor: YooEditor;
|
|
5
|
-
block: YooptaBlockData;
|
|
6
|
-
props?: EmbedElementProps;
|
|
7
|
-
};
|
|
8
|
-
declare const EmbedBlockOptions: ({ editor, block, props: embedProps }: Props) => import("react/jsx-runtime").JSX.Element;
|
|
9
|
-
export { EmbedBlockOptions };
|
|
10
|
-
//# sourceMappingURL=EmbedBlockOptions.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"EmbedBlockOptions.d.ts","sourceRoot":"","sources":["../../src/ui/EmbedBlockOptions.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAc,SAAS,EAAE,eAAe,EAAE,MAAM,gBAAgB,CAAC;AAExE,OAAO,EAAE,iBAAiB,EAAE,MAAM,UAAU,CAAC;AAU7C,KAAK,KAAK,GAAG;IACX,MAAM,EAAE,SAAS,CAAC;IAClB,KAAK,EAAE,eAAe,CAAC;IACvB,KAAK,CAAC,EAAE,iBAAiB,CAAC;CAC3B,CAAC;AAEF,QAAA,MAAM,iBAAiB,yCAA0C,KAAK,4CAmCrE,CAAC;AAEF,OAAO,EAAE,iBAAiB,EAAE,CAAC"}
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import { RenderElementProps } from 'slate-react';
|
|
2
|
-
import { EmbedElementProps } from '../types';
|
|
3
|
-
type EmbedComponentProps = Omit<EmbedElementProps, 'sizes'> & {
|
|
4
|
-
width: number | 'auto';
|
|
5
|
-
height: number | 'auto';
|
|
6
|
-
blockId: string;
|
|
7
|
-
} & Pick<RenderElementProps, 'attributes' | 'children'>;
|
|
8
|
-
declare const EmbedComponent: ({ width, height, provider, blockId, attributes, children }: EmbedComponentProps) => import("react/jsx-runtime").JSX.Element | null;
|
|
9
|
-
export { EmbedComponent, EmbedComponentProps };
|
|
10
|
-
//# sourceMappingURL=EmbedComponent.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"EmbedComponent.d.ts","sourceRoot":"","sources":["../../src/ui/EmbedComponent.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,kBAAkB,EAAE,MAAM,aAAa,CAAC;AASjD,OAAO,EAAE,iBAAiB,EAAE,MAAM,UAAU,CAAC;AAE7C,KAAK,mBAAmB,GAAG,IAAI,CAAC,iBAAiB,EAAE,OAAO,CAAC,GAAG;IAC5D,KAAK,EAAE,MAAM,GAAG,MAAM,CAAC;IACvB,MAAM,EAAE,MAAM,GAAG,MAAM,CAAC;IACxB,OAAO,EAAE,MAAM,CAAC;CACjB,GAAG,IAAI,CAAC,kBAAkB,EAAE,YAAY,GAAG,UAAU,CAAC,CAAC;AAaxD,QAAA,MAAM,cAAc,+DAAgE,mBAAmB,mDA0BtG,CAAC;AAEF,OAAO,EAAE,cAAc,EAAE,mBAAmB,EAAE,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"EmbedLinkUploader.d.ts","sourceRoot":"","sources":["../../src/ui/EmbedLinkUploader.tsx"],"names":[],"mappings":"AAKA,QAAA,MAAM,iBAAiB;;;6CAgDtB,CAAC;AAEF,OAAO,EAAE,iBAAiB,EAAE,CAAC"}
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import { CSSProperties } from 'react';
|
|
2
|
-
type Props = {
|
|
3
|
-
floatingStyles: CSSProperties;
|
|
4
|
-
refs: any;
|
|
5
|
-
blockId: string;
|
|
6
|
-
onClose: () => void;
|
|
7
|
-
};
|
|
8
|
-
declare const EmbedUploader: ({ floatingStyles, refs, onClose, blockId }: Props) => import("react/jsx-runtime").JSX.Element;
|
|
9
|
-
export { EmbedUploader };
|
|
10
|
-
//# sourceMappingURL=EmbedUploader.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"EmbedUploader.d.ts","sourceRoot":"","sources":["../../src/ui/EmbedUploader.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,OAAO,CAAC;AAItC,KAAK,KAAK,GAAG;IACX,cAAc,EAAE,aAAa,CAAC;IAC9B,IAAI,EAAE,GAAG,CAAC;IACV,OAAO,EAAE,MAAM,CAAC;IAChB,OAAO,EAAE,MAAM,IAAI,CAAC;CACrB,CAAC;AAIF,QAAA,MAAM,aAAa,+CAAgD,KAAK,4CA6BvE,CAAC;AAEF,OAAO,EAAE,aAAa,EAAE,CAAC"}
|
package/dist/ui/Placeholder.d.ts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"Placeholder.d.ts","sourceRoot":"","sources":["../../src/ui/Placeholder.tsx"],"names":[],"mappings":"AAKA,QAAA,MAAM,WAAW;;;;6CAoChB,CAAC;AAEF,OAAO,EAAE,WAAW,EAAE,CAAC"}
|
package/dist/ui/Resizer.d.ts
DELETED
package/dist/ui/Resizer.d.ts.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"Resizer.d.ts","sourceRoot":"","sources":["../../src/ui/Resizer.tsx"],"names":[],"mappings":"AAAA,QAAA,MAAM,OAAO;;6CASZ,CAAC;AAEF,OAAO,EAAE,OAAO,EAAE,CAAC"}
|