@wordpress/block-directory 5.0.0 → 5.0.2

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.
@@ -12,7 +12,7 @@ var _privateApis = require("@wordpress/private-apis");
12
12
  const {
13
13
  lock,
14
14
  unlock
15
- } = (0, _privateApis.__dangerousOptInToUnstableAPIsOnlyForCoreModules)('I know using unstable features means my theme or plugin will inevitably break in the next version of WordPress.', '@wordpress/block-directory');
15
+ } = (0, _privateApis.__dangerousOptInToUnstableAPIsOnlyForCoreModules)('I acknowledge private features are not for use in themes or plugins and doing so will break in the next version of WordPress.', '@wordpress/block-directory');
16
16
  exports.unlock = unlock;
17
17
  exports.lock = lock;
18
18
  //# sourceMappingURL=lock-unlock.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["_privateApis","require","lock","unlock","__dangerousOptInToUnstableAPIsOnlyForCoreModules","exports"],"sources":["@wordpress/block-directory/src/lock-unlock.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { __dangerousOptInToUnstableAPIsOnlyForCoreModules } from '@wordpress/private-apis';\n\nexport const { lock, unlock } =\n\t__dangerousOptInToUnstableAPIsOnlyForCoreModules(\n\t\t'I know using unstable features means my theme or plugin will inevitably break in the next version of WordPress.',\n\t\t'@wordpress/block-directory'\n\t);\n"],"mappings":";;;;;;AAGA,IAAAA,YAAA,GAAAC,OAAA;AAHA;AACA;AACA;;AAGO,MAAM;EAAEC,IAAI;EAAEC;AAAO,CAAC,GAC5B,IAAAC,6DAAgD,EAC/C,iHAAiH,EACjH,4BACD,CAAC;AAACC,OAAA,CAAAF,MAAA,GAAAA,MAAA;AAAAE,OAAA,CAAAH,IAAA,GAAAA,IAAA","ignoreList":[]}
1
+ {"version":3,"names":["_privateApis","require","lock","unlock","__dangerousOptInToUnstableAPIsOnlyForCoreModules","exports"],"sources":["@wordpress/block-directory/src/lock-unlock.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { __dangerousOptInToUnstableAPIsOnlyForCoreModules } from '@wordpress/private-apis';\n\nexport const { lock, unlock } =\n\t__dangerousOptInToUnstableAPIsOnlyForCoreModules(\n\t\t'I acknowledge private features are not for use in themes or plugins and doing so will break in the next version of WordPress.',\n\t\t'@wordpress/block-directory'\n\t);\n"],"mappings":";;;;;;AAGA,IAAAA,YAAA,GAAAC,OAAA;AAHA;AACA;AACA;;AAGO,MAAM;EAAEC,IAAI;EAAEC;AAAO,CAAC,GAC5B,IAAAC,6DAAgD,EAC/C,+HAA+H,EAC/H,4BACD,CAAC;AAACC,OAAA,CAAAF,MAAA,GAAAA,MAAA;AAAAE,OAAA,CAAAH,IAAA,GAAAA,IAAA","ignoreList":[]}
@@ -41,6 +41,7 @@ function InstallButton({
41
41
  }
42
42
  }
43
43
  }),
44
+ __experimentalIsFocusable: true,
44
45
  disabled: isInstallingBlock,
45
46
  isBusy: isInstallingBlock,
46
47
  variant: "primary",
@@ -1 +1 @@
1
- {"version":3,"names":["_i18n","require","_components","_blocks","_data","_blockEditor","_store","_jsxRuntime","InstallButton","attributes","block","clientId","isInstallingBlock","useSelect","select","blockDirectoryStore","isInstalling","id","installBlockType","useDispatch","replaceBlock","blockEditorStore","jsx","Button","onClick","then","success","blockType","getBlockType","name","originalBlock","parse","originalContent","createBlock","innerBlocks","disabled","isBusy","variant","children","sprintf","__","title"],"sources":["@wordpress/block-directory/src/plugins/get-install-missing/install-button.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { __, sprintf } from '@wordpress/i18n';\nimport { Button } from '@wordpress/components';\nimport { createBlock, getBlockType, parse } from '@wordpress/blocks';\nimport { useSelect, useDispatch } from '@wordpress/data';\nimport { store as blockEditorStore } from '@wordpress/block-editor';\n\n/**\n * Internal dependencies\n */\nimport { store as blockDirectoryStore } from '../../store';\n\nexport default function InstallButton( { attributes, block, clientId } ) {\n\tconst isInstallingBlock = useSelect(\n\t\t( select ) => select( blockDirectoryStore ).isInstalling( block.id ),\n\t\t[ block.id ]\n\t);\n\tconst { installBlockType } = useDispatch( blockDirectoryStore );\n\tconst { replaceBlock } = useDispatch( blockEditorStore );\n\n\treturn (\n\t\t<Button\n\t\t\tonClick={ () =>\n\t\t\t\tinstallBlockType( block ).then( ( success ) => {\n\t\t\t\t\tif ( success ) {\n\t\t\t\t\t\tconst blockType = getBlockType( block.name );\n\t\t\t\t\t\tconst [ originalBlock ] = parse(\n\t\t\t\t\t\t\tattributes.originalContent\n\t\t\t\t\t\t);\n\t\t\t\t\t\tif ( originalBlock && blockType ) {\n\t\t\t\t\t\t\treplaceBlock(\n\t\t\t\t\t\t\t\tclientId,\n\t\t\t\t\t\t\t\tcreateBlock(\n\t\t\t\t\t\t\t\t\tblockType.name,\n\t\t\t\t\t\t\t\t\toriginalBlock.attributes,\n\t\t\t\t\t\t\t\t\toriginalBlock.innerBlocks\n\t\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\t);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t} )\n\t\t\t}\n\t\t\tdisabled={ isInstallingBlock }\n\t\t\tisBusy={ isInstallingBlock }\n\t\t\tvariant=\"primary\"\n\t\t>\n\t\t\t{ sprintf(\n\t\t\t\t/* translators: %s: block name */\n\t\t\t\t__( 'Install %s' ),\n\t\t\t\tblock.title\n\t\t\t) }\n\t\t</Button>\n\t);\n}\n"],"mappings":";;;;;;AAGA,IAAAA,KAAA,GAAAC,OAAA;AACA,IAAAC,WAAA,GAAAD,OAAA;AACA,IAAAE,OAAA,GAAAF,OAAA;AACA,IAAAG,KAAA,GAAAH,OAAA;AACA,IAAAI,YAAA,GAAAJ,OAAA;AAKA,IAAAK,MAAA,GAAAL,OAAA;AAA2D,IAAAM,WAAA,GAAAN,OAAA;AAZ3D;AACA;AACA;;AAOA;AACA;AACA;;AAGe,SAASO,aAAaA,CAAE;EAAEC,UAAU;EAAEC,KAAK;EAAEC;AAAS,CAAC,EAAG;EACxE,MAAMC,iBAAiB,GAAG,IAAAC,eAAS,EAChCC,MAAM,IAAMA,MAAM,CAAEC,YAAoB,CAAC,CAACC,YAAY,CAAEN,KAAK,CAACO,EAAG,CAAC,EACpE,CAAEP,KAAK,CAACO,EAAE,CACX,CAAC;EACD,MAAM;IAAEC;EAAiB,CAAC,GAAG,IAAAC,iBAAW,EAAEJ,YAAoB,CAAC;EAC/D,MAAM;IAAEK;EAAa,CAAC,GAAG,IAAAD,iBAAW,EAAEE,kBAAiB,CAAC;EAExD,oBACC,IAAAd,WAAA,CAAAe,GAAA,EAACpB,WAAA,CAAAqB,MAAM;IACNC,OAAO,EAAGA,CAAA,KACTN,gBAAgB,CAAER,KAAM,CAAC,CAACe,IAAI,CAAIC,OAAO,IAAM;MAC9C,IAAKA,OAAO,EAAG;QACd,MAAMC,SAAS,GAAG,IAAAC,oBAAY,EAAElB,KAAK,CAACmB,IAAK,CAAC;QAC5C,MAAM,CAAEC,aAAa,CAAE,GAAG,IAAAC,aAAK,EAC9BtB,UAAU,CAACuB,eACZ,CAAC;QACD,IAAKF,aAAa,IAAIH,SAAS,EAAG;UACjCP,YAAY,CACXT,QAAQ,EACR,IAAAsB,mBAAW,EACVN,SAAS,CAACE,IAAI,EACdC,aAAa,CAACrB,UAAU,EACxBqB,aAAa,CAACI,WACf,CACD,CAAC;QACF;MACD;IACD,CAAE,CACF;IACDC,QAAQ,EAAGvB,iBAAmB;IAC9BwB,MAAM,EAAGxB,iBAAmB;IAC5ByB,OAAO,EAAC,SAAS;IAAAC,QAAA,EAEf,IAAAC,aAAO,GACR;IACA,IAAAC,QAAE,EAAE,YAAa,CAAC,EAClB9B,KAAK,CAAC+B,KACP;EAAC,CACM,CAAC;AAEX","ignoreList":[]}
1
+ {"version":3,"names":["_i18n","require","_components","_blocks","_data","_blockEditor","_store","_jsxRuntime","InstallButton","attributes","block","clientId","isInstallingBlock","useSelect","select","blockDirectoryStore","isInstalling","id","installBlockType","useDispatch","replaceBlock","blockEditorStore","jsx","Button","onClick","then","success","blockType","getBlockType","name","originalBlock","parse","originalContent","createBlock","innerBlocks","__experimentalIsFocusable","disabled","isBusy","variant","children","sprintf","__","title"],"sources":["@wordpress/block-directory/src/plugins/get-install-missing/install-button.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { __, sprintf } from '@wordpress/i18n';\nimport { Button } from '@wordpress/components';\nimport { createBlock, getBlockType, parse } from '@wordpress/blocks';\nimport { useSelect, useDispatch } from '@wordpress/data';\nimport { store as blockEditorStore } from '@wordpress/block-editor';\n\n/**\n * Internal dependencies\n */\nimport { store as blockDirectoryStore } from '../../store';\n\nexport default function InstallButton( { attributes, block, clientId } ) {\n\tconst isInstallingBlock = useSelect(\n\t\t( select ) => select( blockDirectoryStore ).isInstalling( block.id ),\n\t\t[ block.id ]\n\t);\n\tconst { installBlockType } = useDispatch( blockDirectoryStore );\n\tconst { replaceBlock } = useDispatch( blockEditorStore );\n\n\treturn (\n\t\t<Button\n\t\t\tonClick={ () =>\n\t\t\t\tinstallBlockType( block ).then( ( success ) => {\n\t\t\t\t\tif ( success ) {\n\t\t\t\t\t\tconst blockType = getBlockType( block.name );\n\t\t\t\t\t\tconst [ originalBlock ] = parse(\n\t\t\t\t\t\t\tattributes.originalContent\n\t\t\t\t\t\t);\n\t\t\t\t\t\tif ( originalBlock && blockType ) {\n\t\t\t\t\t\t\treplaceBlock(\n\t\t\t\t\t\t\t\tclientId,\n\t\t\t\t\t\t\t\tcreateBlock(\n\t\t\t\t\t\t\t\t\tblockType.name,\n\t\t\t\t\t\t\t\t\toriginalBlock.attributes,\n\t\t\t\t\t\t\t\t\toriginalBlock.innerBlocks\n\t\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\t);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t} )\n\t\t\t}\n\t\t\t__experimentalIsFocusable\n\t\t\tdisabled={ isInstallingBlock }\n\t\t\tisBusy={ isInstallingBlock }\n\t\t\tvariant=\"primary\"\n\t\t>\n\t\t\t{ sprintf(\n\t\t\t\t/* translators: %s: block name */\n\t\t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,CAACI,WACf,CACD,CAAC;QACF;MACD;IACD,CAAE,CACF;IACDC,yBAAyB;IACzBC,QAAQ,EAAGxB,iBAAmB;IAC9ByB,MAAM,EAAGzB,iBAAmB;IAC5B0B,OAAO,EAAC,SAAS;IAAAC,QAAA,EAEf,IAAAC,aAAO,GACR;IACA,IAAAC,QAAE,EAAE,YAAa,CAAC,EAClB/B,KAAK,CAACgC,KACP;EAAC,CACM,CAAC;AAEX","ignoreList":[]}
@@ -5,5 +5,5 @@ import { __dangerousOptInToUnstableAPIsOnlyForCoreModules } from '@wordpress/pri
5
5
  export const {
6
6
  lock,
7
7
  unlock
8
- } = __dangerousOptInToUnstableAPIsOnlyForCoreModules('I know using unstable features means my theme or plugin will inevitably break in the next version of WordPress.', '@wordpress/block-directory');
8
+ } = __dangerousOptInToUnstableAPIsOnlyForCoreModules('I acknowledge private features are not for use in themes or plugins and doing so will break in the next version of WordPress.', '@wordpress/block-directory');
9
9
  //# sourceMappingURL=lock-unlock.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["__dangerousOptInToUnstableAPIsOnlyForCoreModules","lock","unlock"],"sources":["@wordpress/block-directory/src/lock-unlock.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { __dangerousOptInToUnstableAPIsOnlyForCoreModules } from '@wordpress/private-apis';\n\nexport const { lock, unlock } =\n\t__dangerousOptInToUnstableAPIsOnlyForCoreModules(\n\t\t'I know using unstable features means my theme or plugin will inevitably break in the next version of WordPress.',\n\t\t'@wordpress/block-directory'\n\t);\n"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,gDAAgD,QAAQ,yBAAyB;AAE1F,OAAO,MAAM;EAAEC,IAAI;EAAEC;AAAO,CAAC,GAC5BF,gDAAgD,CAC/C,iHAAiH,EACjH,4BACD,CAAC","ignoreList":[]}
1
+ {"version":3,"names":["__dangerousOptInToUnstableAPIsOnlyForCoreModules","lock","unlock"],"sources":["@wordpress/block-directory/src/lock-unlock.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { __dangerousOptInToUnstableAPIsOnlyForCoreModules } from '@wordpress/private-apis';\n\nexport const { lock, unlock } =\n\t__dangerousOptInToUnstableAPIsOnlyForCoreModules(\n\t\t'I acknowledge private features are not for use in themes or plugins and doing so will break in the next version of WordPress.',\n\t\t'@wordpress/block-directory'\n\t);\n"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,gDAAgD,QAAQ,yBAAyB;AAE1F,OAAO,MAAM;EAAEC,IAAI;EAAEC;AAAO,CAAC,GAC5BF,gDAAgD,CAC/C,+HAA+H,EAC/H,4BACD,CAAC","ignoreList":[]}
@@ -34,6 +34,7 @@ export default function InstallButton({
34
34
  }
35
35
  }
36
36
  }),
37
+ __experimentalIsFocusable: true,
37
38
  disabled: isInstallingBlock,
38
39
  isBusy: isInstallingBlock,
39
40
  variant: "primary",
@@ -1 +1 @@
1
- {"version":3,"names":["__","sprintf","Button","createBlock","getBlockType","parse","useSelect","useDispatch","store","blockEditorStore","blockDirectoryStore","jsx","_jsx","InstallButton","attributes","block","clientId","isInstallingBlock","select","isInstalling","id","installBlockType","replaceBlock","onClick","then","success","blockType","name","originalBlock","originalContent","innerBlocks","disabled","isBusy","variant","children","title"],"sources":["@wordpress/block-directory/src/plugins/get-install-missing/install-button.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { __, sprintf } from '@wordpress/i18n';\nimport { Button } from '@wordpress/components';\nimport { createBlock, getBlockType, parse } from '@wordpress/blocks';\nimport { useSelect, useDispatch } from '@wordpress/data';\nimport { store as blockEditorStore } from '@wordpress/block-editor';\n\n/**\n * Internal dependencies\n */\nimport { store as blockDirectoryStore } from '../../store';\n\nexport default function InstallButton( { attributes, block, clientId } ) {\n\tconst isInstallingBlock = useSelect(\n\t\t( select ) => select( blockDirectoryStore ).isInstalling( block.id ),\n\t\t[ block.id ]\n\t);\n\tconst { installBlockType } = useDispatch( blockDirectoryStore );\n\tconst { replaceBlock } = useDispatch( blockEditorStore );\n\n\treturn (\n\t\t<Button\n\t\t\tonClick={ () =>\n\t\t\t\tinstallBlockType( block ).then( ( success ) => {\n\t\t\t\t\tif ( success ) {\n\t\t\t\t\t\tconst blockType = getBlockType( block.name );\n\t\t\t\t\t\tconst [ originalBlock ] = parse(\n\t\t\t\t\t\t\tattributes.originalContent\n\t\t\t\t\t\t);\n\t\t\t\t\t\tif ( originalBlock && blockType ) {\n\t\t\t\t\t\t\treplaceBlock(\n\t\t\t\t\t\t\t\tclientId,\n\t\t\t\t\t\t\t\tcreateBlock(\n\t\t\t\t\t\t\t\t\tblockType.name,\n\t\t\t\t\t\t\t\t\toriginalBlock.attributes,\n\t\t\t\t\t\t\t\t\toriginalBlock.innerBlocks\n\t\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\t);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t} )\n\t\t\t}\n\t\t\tdisabled={ isInstallingBlock }\n\t\t\tisBusy={ isInstallingBlock }\n\t\t\tvariant=\"primary\"\n\t\t>\n\t\t\t{ sprintf(\n\t\t\t\t/* translators: %s: block name */\n\t\t\t\t__( 'Install %s' ),\n\t\t\t\tblock.title\n\t\t\t) }\n\t\t</Button>\n\t);\n}\n"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,EAAE,EAAEC,OAAO,QAAQ,iBAAiB;AAC7C,SAASC,MAAM,QAAQ,uBAAuB;AAC9C,SAASC,WAAW,EAAEC,YAAY,EAAEC,KAAK,QAAQ,mBAAmB;AACpE,SAASC,SAAS,EAAEC,WAAW,QAAQ,iBAAiB;AACxD,SAASC,KAAK,IAAIC,gBAAgB,QAAQ,yBAAyB;;AAEnE;AACA;AACA;AACA,SAASD,KAAK,IAAIE,mBAAmB,QAAQ,aAAa;AAAC,SAAAC,GAAA,IAAAC,IAAA;AAE3D,eAAe,SAASC,aAAaA,CAAE;EAAEC,UAAU;EAAEC,KAAK;EAAEC;AAAS,CAAC,EAAG;EACxE,MAAMC,iBAAiB,GAAGX,SAAS,CAChCY,MAAM,IAAMA,MAAM,CAAER,mBAAoB,CAAC,CAACS,YAAY,CAAEJ,KAAK,CAACK,EAAG,CAAC,EACpE,CAAEL,KAAK,CAACK,EAAE,CACX,CAAC;EACD,MAAM;IAAEC;EAAiB,CAAC,GAAGd,WAAW,CAAEG,mBAAoB,CAAC;EAC/D,MAAM;IAAEY;EAAa,CAAC,GAAGf,WAAW,CAAEE,gBAAiB,CAAC;EAExD,oBACCG,IAAA,CAACV,MAAM;IACNqB,OAAO,EAAGA,CAAA,KACTF,gBAAgB,CAAEN,KAAM,CAAC,CAACS,IAAI,CAAIC,OAAO,IAAM;MAC9C,IAAKA,OAAO,EAAG;QACd,MAAMC,SAAS,GAAGtB,YAAY,CAAEW,KAAK,CAACY,IAAK,CAAC;QAC5C,MAAM,CAAEC,aAAa,CAAE,GAAGvB,KAAK,CAC9BS,UAAU,CAACe,eACZ,CAAC;QACD,IAAKD,aAAa,IAAIF,SAAS,EAAG;UACjCJ,YAAY,CACXN,QAAQ,EACRb,WAAW,CACVuB,SAAS,CAACC,IAAI,EACdC,aAAa,CAACd,UAAU,EACxBc,aAAa,CAACE,WACf,CACD,CAAC;QACF;MACD;IACD,CAAE,CACF;IACDC,QAAQ,EAAGd,iBAAmB;IAC9Be,MAAM,EAAGf,iBAAmB;IAC5BgB,OAAO,EAAC,SAAS;IAAAC,QAAA,EAEfjC,OAAO,EACR;IACAD,EAAE,CAAE,YAAa,CAAC,EAClBe,KAAK,CAACoB,KACP;EAAC,CACM,CAAC;AAEX","ignoreList":[]}
1
+ {"version":3,"names":["__","sprintf","Button","createBlock","getBlockType","parse","useSelect","useDispatch","store","blockEditorStore","blockDirectoryStore","jsx","_jsx","InstallButton","attributes","block","clientId","isInstallingBlock","select","isInstalling","id","installBlockType","replaceBlock","onClick","then","success","blockType","name","originalBlock","originalContent","innerBlocks","__experimentalIsFocusable","disabled","isBusy","variant","children","title"],"sources":["@wordpress/block-directory/src/plugins/get-install-missing/install-button.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { __, sprintf } from '@wordpress/i18n';\nimport { Button } from '@wordpress/components';\nimport { createBlock, getBlockType, parse } from '@wordpress/blocks';\nimport { useSelect, useDispatch } from '@wordpress/data';\nimport { store as blockEditorStore } from '@wordpress/block-editor';\n\n/**\n * Internal dependencies\n */\nimport { store as blockDirectoryStore } from '../../store';\n\nexport default function InstallButton( { attributes, block, clientId } ) {\n\tconst isInstallingBlock = useSelect(\n\t\t( select ) => select( blockDirectoryStore ).isInstalling( block.id ),\n\t\t[ block.id ]\n\t);\n\tconst { installBlockType } = useDispatch( blockDirectoryStore );\n\tconst { replaceBlock } = useDispatch( blockEditorStore );\n\n\treturn (\n\t\t<Button\n\t\t\tonClick={ () =>\n\t\t\t\tinstallBlockType( block ).then( ( success ) => {\n\t\t\t\t\tif ( success ) {\n\t\t\t\t\t\tconst blockType = getBlockType( block.name );\n\t\t\t\t\t\tconst [ originalBlock ] = parse(\n\t\t\t\t\t\t\tattributes.originalContent\n\t\t\t\t\t\t);\n\t\t\t\t\t\tif ( originalBlock && blockType ) {\n\t\t\t\t\t\t\treplaceBlock(\n\t\t\t\t\t\t\t\tclientId,\n\t\t\t\t\t\t\t\tcreateBlock(\n\t\t\t\t\t\t\t\t\tblockType.name,\n\t\t\t\t\t\t\t\t\toriginalBlock.attributes,\n\t\t\t\t\t\t\t\t\toriginalBlock.innerBlocks\n\t\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\t);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t} )\n\t\t\t}\n\t\t\t__experimentalIsFocusable\n\t\t\tdisabled={ isInstallingBlock }\n\t\t\tisBusy={ isInstallingBlock }\n\t\t\tvariant=\"primary\"\n\t\t>\n\t\t\t{ sprintf(\n\t\t\t\t/* translators: %s: block name */\n\t\t\t\t__( 'Install %s' ),\n\t\t\t\tblock.title\n\t\t\t) }\n\t\t</Button>\n\t);\n}\n"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,EAAE,EAAEC,OA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,EAAGhB,iBAAmB;IAC5BiB,OAAO,EAAC,SAAS;IAAAC,QAAA,EAEflC,OAAO,EACR;IACAD,EAAE,CAAE,YAAa,CAAC,EAClBe,KAAK,CAACqB,KACP;EAAC,CACM,CAAC;AAEX","ignoreList":[]}
@@ -169,7 +169,6 @@
169
169
  .block-directory-downloadable-block-list-item.is-busy .block-directory-downloadable-block-list-item__author {
170
170
  border: 0;
171
171
  clip: rect(1px, 1px, 1px, 1px);
172
- -webkit-clip-path: inset(50%);
173
172
  clip-path: inset(50%);
174
173
  height: 1px;
175
174
  margin: -1px;
@@ -169,7 +169,6 @@
169
169
  .block-directory-downloadable-block-list-item.is-busy .block-directory-downloadable-block-list-item__author {
170
170
  border: 0;
171
171
  clip: rect(1px, 1px, 1px, 1px);
172
- -webkit-clip-path: inset(50%);
173
172
  clip-path: inset(50%);
174
173
  height: 1px;
175
174
  margin: -1px;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@wordpress/block-directory",
3
- "version": "5.0.0",
3
+ "version": "5.0.2",
4
4
  "description": "Extend editor with block directory features to search, download and install blocks.",
5
5
  "author": "The WordPress Contributors",
6
6
  "license": "GPL-2.0-or-later",
@@ -27,25 +27,25 @@
27
27
  "react-native": "src/index",
28
28
  "dependencies": {
29
29
  "@babel/runtime": "^7.16.0",
30
- "@wordpress/a11y": "^4.0.0",
31
- "@wordpress/api-fetch": "^7.0.0",
32
- "@wordpress/block-editor": "^13.0.0",
33
- "@wordpress/blocks": "^13.0.0",
34
- "@wordpress/components": "^28.0.0",
35
- "@wordpress/compose": "^7.0.0",
36
- "@wordpress/core-data": "^7.0.0",
37
- "@wordpress/data": "^10.0.0",
38
- "@wordpress/edit-post": "^8.0.0",
39
- "@wordpress/editor": "^14.0.0",
40
- "@wordpress/element": "^6.0.0",
41
- "@wordpress/hooks": "^4.0.0",
42
- "@wordpress/html-entities": "^4.0.0",
43
- "@wordpress/i18n": "^5.0.0",
44
- "@wordpress/icons": "^10.0.0",
45
- "@wordpress/notices": "^5.0.0",
46
- "@wordpress/plugins": "^7.0.0",
47
- "@wordpress/private-apis": "^1.0.0",
48
- "@wordpress/url": "^4.0.0",
30
+ "@wordpress/a11y": "^4.0.1",
31
+ "@wordpress/api-fetch": "^7.0.1",
32
+ "@wordpress/block-editor": "^13.0.2",
33
+ "@wordpress/blocks": "^13.0.2",
34
+ "@wordpress/components": "^28.0.2",
35
+ "@wordpress/compose": "^7.0.1",
36
+ "@wordpress/core-data": "^7.0.2",
37
+ "@wordpress/data": "^10.0.2",
38
+ "@wordpress/edit-post": "^8.0.2",
39
+ "@wordpress/editor": "^14.0.2",
40
+ "@wordpress/element": "^6.0.1",
41
+ "@wordpress/hooks": "^4.0.1",
42
+ "@wordpress/html-entities": "^4.0.1",
43
+ "@wordpress/i18n": "^5.0.1",
44
+ "@wordpress/icons": "^10.0.1",
45
+ "@wordpress/notices": "^5.0.2",
46
+ "@wordpress/plugins": "^7.0.2",
47
+ "@wordpress/private-apis": "^1.0.2",
48
+ "@wordpress/url": "^4.0.1",
49
49
  "change-case": "^4.1.2"
50
50
  },
51
51
  "peerDependencies": {
@@ -55,5 +55,5 @@
55
55
  "publishConfig": {
56
56
  "access": "public"
57
57
  },
58
- "gitHead": "2f30cddff15723ac7017fd009fc5913b7b419400"
58
+ "gitHead": "a68c6b5ef53956cccf4961d53d79b6af7e00ae60"
59
59
  }
@@ -5,6 +5,6 @@ import { __dangerousOptInToUnstableAPIsOnlyForCoreModules } from '@wordpress/pri
5
5
 
6
6
  export const { lock, unlock } =
7
7
  __dangerousOptInToUnstableAPIsOnlyForCoreModules(
8
- 'I know using unstable features means my theme or plugin will inevitably break in the next version of WordPress.',
8
+ 'I acknowledge private features are not for use in themes or plugins and doing so will break in the next version of WordPress.',
9
9
  '@wordpress/block-directory'
10
10
  );
@@ -42,6 +42,7 @@ export default function InstallButton( { attributes, block, clientId } ) {
42
42
  }
43
43
  } )
44
44
  }
45
+ __experimentalIsFocusable
45
46
  disabled={ isInstallingBlock }
46
47
  isBusy={ isInstallingBlock }
47
48
  variant="primary"