UNPKG

3.01 kBSource Map (JSON)View Raw
1{"version":3,"sources":["@wordpress/block-library/src/embed/index.js"],"names":["common","commonEmbeds","others","otherEmbeds","embedContentIcon","getEmbedBlockSettings","__","_x","createBlock","name","settings","title","description","icon","responsive","transforms","from","type","isMatch","node","nodeName","test","textContent","transform","url","trim","map","embedDefinition"],"mappings":";;AAAA;;;AAGA,SAASA,MAAM,IAAIC,YAAnB,EAAiCC,MAAM,IAAIC,WAA3C,QAA8D,eAA9D;AACA,SAASC,gBAAT,QAAiC,SAAjC;AACA,SAASC,qBAAT,QAAsC,YAAtC;AAEA;;;;AAGA,SAASC,EAAT,EAAaC,EAAb,QAAuB,iBAAvB;AACA,SAASC,WAAT,QAA4B,mBAA5B;AAEA,OAAO,IAAMC,IAAI,GAAG,YAAb;AAEP,OAAO,IAAMC,QAAQ,GAAGL,qBAAqB,CAAE;AAC9CM,EAAAA,KAAK,EAAEJ,EAAE,CAAE,OAAF,EAAW,aAAX,CADqC;AAE9CK,EAAAA,WAAW,EAAEN,EAAE,CAAE,+EAAF,CAF+B;AAG9CO,EAAAA,IAAI,EAAET,gBAHwC;AAI9C;AACAU,EAAAA,UAAU,EAAE,KALkC;AAM9CC,EAAAA,UAAU,EAAE;AACXC,IAAAA,IAAI,EAAE,CACL;AACCC,MAAAA,IAAI,EAAE,KADP;AAECC,MAAAA,OAAO,EAAE,iBAAEC,IAAF;AAAA,eAAYA,IAAI,CAACC,QAAL,KAAkB,GAAlB,IAAyB,4BAA4BC,IAA5B,CAAkCF,IAAI,CAACG,WAAvC,CAArC;AAAA,OAFV;AAGCC,MAAAA,SAAS,EAAE,mBAAEJ,IAAF,EAAY;AACtB,eAAOX,WAAW,CAAE,YAAF,EAAgB;AACjCgB,UAAAA,GAAG,EAAEL,IAAI,CAACG,WAAL,CAAiBG,IAAjB;AAD4B,SAAhB,CAAlB;AAGA;AAPF,KADK;AADK;AANkC,CAAF,CAAtC;AAqBP,OAAO,IAAMzB,MAAM,GAAGC,YAAY,CAACyB,GAAb,CACrB,UAAEC,eAAF,EAAuB;AACtB,2BACIA,eADJ;AAECjB,IAAAA,QAAQ,EAAEL,qBAAqB,CAAEsB,eAAe,CAACjB,QAAlB;AAFhC;AAIA,CANoB,CAAf;AASP,OAAO,IAAMR,MAAM,GAAGC,WAAW,CAACuB,GAAZ,CACrB,UAAEC,eAAF,EAAuB;AACtB,2BACIA,eADJ;AAECjB,IAAAA,QAAQ,EAAEL,qBAAqB,CAAEsB,eAAe,CAACjB,QAAlB;AAFhC;AAIA,CANoB,CAAf","sourcesContent":["/**\n * Internal dependencies\n */\nimport { common as commonEmbeds, others as otherEmbeds } from './core-embeds';\nimport { embedContentIcon } from './icons';\nimport { getEmbedBlockSettings } from './settings';\n\n/**\n * WordPress dependencies\n */\nimport { __, _x } from '@wordpress/i18n';\nimport { createBlock } from '@wordpress/blocks';\n\nexport const name = 'core/embed';\n\nexport const settings = getEmbedBlockSettings( {\n\ttitle: _x( 'Embed', 'block title' ),\n\tdescription: __( 'Embed videos, images, tweets, audio, and other content from external sources.' ),\n\ticon: embedContentIcon,\n\t// Unknown embeds should not be responsive by default.\n\tresponsive: false,\n\ttransforms: {\n\t\tfrom: [\n\t\t\t{\n\t\t\t\ttype: 'raw',\n\t\t\t\tisMatch: ( node ) => node.nodeName === 'P' && /^\\s*(https?:\\/\\/\\S+)\\s*$/i.test( node.textContent ),\n\t\t\t\ttransform: ( node ) => {\n\t\t\t\t\treturn createBlock( 'core/embed', {\n\t\t\t\t\t\turl: node.textContent.trim(),\n\t\t\t\t\t} );\n\t\t\t\t},\n\t\t\t},\n\t\t],\n\t},\n} );\n\nexport const common = commonEmbeds.map(\n\t( embedDefinition ) => {\n\t\treturn {\n\t\t\t...embedDefinition,\n\t\t\tsettings: getEmbedBlockSettings( embedDefinition.settings ),\n\t\t};\n\t}\n);\n\nexport const others = otherEmbeds.map(\n\t( embedDefinition ) => {\n\t\treturn {\n\t\t\t...embedDefinition,\n\t\t\tsettings: getEmbedBlockSettings( embedDefinition.settings ),\n\t\t};\n\t}\n);\n"]}
\No newline at end of file