@wordpress/block-library 7.12.2-next.d6164808d3.0 → 7.13.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +1 -1
- package/build/list/index.js +4 -0
- package/build/list/index.js.map +1 -1
- package/build/list-item/utils.js +4 -0
- package/build/list-item/utils.js.map +1 -1
- package/build/media-text/index.js +4 -0
- package/build/media-text/index.js.map +1 -1
- package/build/navigation/index.js +1 -0
- package/build/navigation/index.js.map +1 -1
- package/build/paragraph/index.js +2 -0
- package/build/paragraph/index.js.map +1 -1
- package/build/paragraph/transforms.js +2 -0
- package/build/paragraph/transforms.js.map +1 -1
- package/build/social-links/edit.js +43 -10
- package/build/social-links/edit.js.map +1 -1
- package/build/social-links/index.js +9 -0
- package/build/social-links/index.js.map +1 -1
- package/build/table-of-contents/index.js +13 -0
- package/build/table-of-contents/index.js.map +1 -1
- package/build-module/list/index.js +4 -0
- package/build-module/list/index.js.map +1 -1
- package/build-module/list-item/utils.js +4 -0
- package/build-module/list-item/utils.js.map +1 -1
- package/build-module/media-text/index.js +4 -0
- package/build-module/media-text/index.js.map +1 -1
- package/build-module/navigation/index.js +1 -0
- package/build-module/navigation/index.js.map +1 -1
- package/build-module/paragraph/index.js +2 -0
- package/build-module/paragraph/index.js.map +1 -1
- package/build-module/paragraph/transforms.js +2 -0
- package/build-module/paragraph/transforms.js.map +1 -1
- package/build-module/social-links/edit.js +45 -13
- package/build-module/social-links/edit.js.map +1 -1
- package/build-module/social-links/index.js +9 -0
- package/build-module/social-links/index.js.map +1 -1
- package/build-module/table-of-contents/index.js +13 -0
- package/build-module/table-of-contents/index.js.map +1 -1
- package/build-style/media-text/style-rtl.css +1 -0
- package/build-style/media-text/style.css +1 -0
- package/build-style/style-rtl.css +1 -0
- package/build-style/style.css +1 -0
- package/package.json +28 -28
- package/src/list/block.json +4 -0
- package/src/media-text/block.json +4 -0
- package/src/media-text/style.scss +2 -0
- package/src/navigation/block.json +1 -0
- package/src/navigation/test/use-navigation-menu.js +18 -1
- package/src/paragraph/block.json +2 -0
- package/src/social-links/block.json +9 -0
- package/src/social-links/edit.js +47 -20
- package/src/table-of-contents/block.json +13 -0
package/CHANGELOG.md
CHANGED
package/build/list/index.js
CHANGED
package/build/list/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["@wordpress/block-library/src/list/index.js"],"names":["name","metadata","settingsV1","icon","example","attributes","values","transforms","merge","attributesToMerge","edit","save","deprecated","settings","process","env","IS_GUTENBERG_PLUGIN","window","__experimentalEnableListBlockV2","settingsV2"],"mappings":";;;;;;;;;;;;;;;AAGA;;AAKA;;AACA;;AAEA;;AACA;;AACA;;AAbA;AACA;AACA;;AAGA;AACA;AACA
|
|
1
|
+
{"version":3,"sources":["@wordpress/block-library/src/list/index.js"],"names":["name","metadata","settingsV1","icon","example","attributes","values","transforms","merge","attributesToMerge","edit","save","deprecated","settings","process","env","IS_GUTENBERG_PLUGIN","window","__experimentalEnableListBlockV2","settingsV2"],"mappings":";;;;;;;;;;;;;;;AAGA;;AAKA;;AACA;;AAEA;;AACA;;AACA;;AAbA;AACA;AACA;;AAGA;AACA;AACA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAQA,MAAM;AAAEA,EAAAA;AAAF,IAAWC,QAAjB;;AAIA,MAAMC,UAAU,GAAG;AAClBC,EAAAA,IAAI,EAAJA,WADkB;AAElBC,EAAAA,OAAO,EAAE;AACRC,IAAAA,UAAU,EAAE;AACXC,MAAAA,MAAM,EAAE;AADG;AADJ,GAFS;AAOlBC,EAAAA,UAAU,EAAVA,mBAPkB;;AAQlBC,EAAAA,KAAK,CAAEH,UAAF,EAAcI,iBAAd,EAAkC;AACtC,UAAM;AAAEH,MAAAA;AAAF,QAAaG,iBAAnB;;AAEA,QAAK,CAAEH,MAAF,IAAYA,MAAM,KAAK,WAA5B,EAA0C;AACzC,aAAOD,UAAP;AACA;;AAED,WAAO,EACN,GAAGA,UADG;AAENC,MAAAA,MAAM,EAAED,UAAU,CAACC,MAAX,GAAoBA;AAFtB,KAAP;AAIA,GAnBiB;;AAoBlBI,EAAAA,IAAI,EAAJA,aApBkB;AAqBlBC,EAAAA,IAAI,EAAJA,aArBkB;AAsBlBC,EAAAA,UAAU,EAAVA;AAtBkB,CAAnB;AAyBA,IAAIC,QAAQ,GAAGX,UAAf;;;AACA,IAAKY,OAAO,CAACC,GAAR,CAAYC,mBAAjB,EAAuC;AAAA;;AACtC,qBAAAH,QAAQ,GAAG,WAAAI,MAAM,UAAN,kCAAQC,+BAAR,GACRC,UADQ,GAERjB,UAFH;AAGA","sourcesContent":["/**\n * WordPress dependencies\n */\nimport { list as icon } from '@wordpress/icons';\n\n/**\n * Internal dependencies\n */\nimport deprecated from './deprecated';\nimport edit from './edit';\nimport metadata from './block.json';\nimport save from './save';\nimport transforms from './transforms';\nimport settingsV2 from './v2';\n\nconst { name } = metadata;\n\nexport { metadata, name, settingsV2 };\n\nconst settingsV1 = {\n\ticon,\n\texample: {\n\t\tattributes: {\n\t\t\tvalues: '<li>Alice.</li><li>The White Rabbit.</li><li>The Cheshire Cat.</li><li>The Mad Hatter.</li><li>The Queen of Hearts.</li>',\n\t\t},\n\t},\n\ttransforms,\n\tmerge( attributes, attributesToMerge ) {\n\t\tconst { values } = attributesToMerge;\n\n\t\tif ( ! values || values === '<li></li>' ) {\n\t\t\treturn attributes;\n\t\t}\n\n\t\treturn {\n\t\t\t...attributes,\n\t\t\tvalues: attributes.values + values,\n\t\t};\n\t},\n\tedit,\n\tsave,\n\tdeprecated,\n};\n\nlet settings = settingsV1;\nif ( process.env.IS_GUTENBERG_PLUGIN ) {\n\tsettings = window?.__experimentalEnableListBlockV2\n\t\t? settingsV2\n\t\t: settingsV1;\n}\nexport { settings };\n"]}
|
package/build/list-item/utils.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["@wordpress/block-library/src/list-item/utils.js"],"names":["createListItem","listItemAttributes","listAttributes","children","listItemName","length","listName","convertToListItems","blocks","listItems","block","name","push","innerBlocks"],"mappings":";;;;;;;;AAGA;;AAHA;AACA;AACA;;AAGA;AACA;AACA
|
|
1
|
+
{"version":3,"sources":["@wordpress/block-library/src/list-item/utils.js"],"names":["createListItem","listItemAttributes","listAttributes","children","listItemName","length","listName","convertToListItems","blocks","listItems","block","name","push","innerBlocks"],"mappings":";;;;;;;;AAGA;;AAHA;AACA;AACA;;AAGA;AACA;AACA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAIO,SAASA,cAAT,CAAyBC,kBAAzB,EAA6CC,cAA7C,EAA6DC,QAA7D,EAAwE;AAC9E,SAAO,yBACNC,YADM,EAENH,kBAFM,EAGN,EAAEE,QAAF,aAAEA,QAAF,eAAEA,QAAQ,CAAEE,MAAZ,IACG,EADH,GAEG,CAAE,yBAAaC,QAAb,EAAuBJ,cAAvB,EAAuCC,QAAvC,CAAF,CALG,CAAP;AAOA;;AAEM,SAASI,kBAAT,CAA6BC,MAA7B,EAAsC;AAC5C,QAAMC,SAAS,GAAG,EAAlB;;AAEA,OAAM,IAAIC,KAAV,IAAmBF,MAAnB,EAA4B;AAC3B,QAAKE,KAAK,CAACC,IAAN,KAAeP,YAApB,EAAmC;AAClCK,MAAAA,SAAS,CAACG,IAAV,CAAgBF,KAAhB;AACA,KAFD,MAEO,IAAKA,KAAK,CAACC,IAAN,KAAeL,QAApB,EAA+B;AACrCG,MAAAA,SAAS,CAACG,IAAV,CAAgB,GAAGF,KAAK,CAACG,WAAzB;AACA,KAFM,MAEA,IAAOH,KAAK,GAAG,+BAAmBA,KAAnB,EAA0BJ,QAA1B,CAAf,EAAwD;AAC9D,WAAM,MAAM;AAAEO,QAAAA;AAAF,OAAZ,IAA+BH,KAA/B,EAAuC;AACtCD,QAAAA,SAAS,CAACG,IAAV,CAAgB,GAAGC,WAAnB;AACA;AACD;AACD;;AAED,SAAOJ,SAAP;AACA","sourcesContent":["/**\n * WordPress dependencies\n */\nimport { createBlock, switchToBlockType } from '@wordpress/blocks';\n\n/**\n * Internal dependencies\n */\nimport { name as listItemName } from './block.json';\nimport { name as listName } from '../list/block.json';\n\nexport function createListItem( listItemAttributes, listAttributes, children ) {\n\treturn createBlock(\n\t\tlistItemName,\n\t\tlistItemAttributes,\n\t\t! children?.length\n\t\t\t? []\n\t\t\t: [ createBlock( listName, listAttributes, children ) ]\n\t);\n}\n\nexport function convertToListItems( blocks ) {\n\tconst listItems = [];\n\n\tfor ( let block of blocks ) {\n\t\tif ( block.name === listItemName ) {\n\t\t\tlistItems.push( block );\n\t\t} else if ( block.name === listName ) {\n\t\t\tlistItems.push( ...block.innerBlocks );\n\t\t} else if ( ( block = switchToBlockType( block, listName ) ) ) {\n\t\t\tfor ( const { innerBlocks } of block ) {\n\t\t\t\tlistItems.push( ...innerBlocks );\n\t\t\t}\n\t\t}\n\t}\n\n\treturn listItems;\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["@wordpress/block-library/src/media-text/index.js"],"names":["name","metadata","settings","icon","example","viewportWidth","attributes","mediaType","mediaUrl","innerBlocks","content","transforms","edit","save","deprecated"],"mappings":";;;;;;;;;AAGA;;AACA;;AAKA;;AACA;;AAEA;;AACA;;AAbA;AACA;AACA;;AAIA;AACA;AACA
|
|
1
|
+
{"version":3,"sources":["@wordpress/block-library/src/media-text/index.js"],"names":["name","metadata","settings","icon","example","viewportWidth","attributes","mediaType","mediaUrl","innerBlocks","content","transforms","edit","save","deprecated"],"mappings":";;;;;;;;;AAGA;;AACA;;AAKA;;AACA;;AAEA;;AACA;;AAbA;AACA;AACA;;AAIA;AACA;AACA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAOA,MAAM;AAAEA,EAAAA;AAAF,IAAWC,QAAjB;;AAIO,MAAMC,QAAQ,GAAG;AACvBC,EAAAA,IAAI,EAAJA,mBADuB;AAEvBC,EAAAA,OAAO,EAAE;AACRC,IAAAA,aAAa,EAAE,GADP;AACY;AACpBC,IAAAA,UAAU,EAAE;AACXC,MAAAA,SAAS,EAAE,OADA;AAEXC,MAAAA,QAAQ,EACP;AAHU,KAFJ;AAORC,IAAAA,WAAW,EAAE,CACZ;AACCT,MAAAA,IAAI,EAAE,gBADP;AAECM,MAAAA,UAAU,EAAE;AACXI,QAAAA,OAAO,EAAE,cACR,8CADQ;AADE;AAFb,KADY,EASZ;AACCV,MAAAA,IAAI,EAAE,gBADP;AAECM,MAAAA,UAAU,EAAE;AACXI,QAAAA,OAAO,EAAE,cAAI,uBAAJ;AADE;AAFb,KATY;AAPL,GAFc;AA0BvBC,EAAAA,UAAU,EAAVA,mBA1BuB;AA2BvBC,EAAAA,IAAI,EAAJA,aA3BuB;AA4BvBC,EAAAA,IAAI,EAAJA,aA5BuB;AA6BvBC,EAAAA,UAAU,EAAVA;AA7BuB,CAAjB","sourcesContent":["/**\n * WordPress dependencies\n */\nimport { __ } from '@wordpress/i18n';\nimport { mediaAndText as icon } from '@wordpress/icons';\n\n/**\n * Internal dependencies\n */\nimport deprecated from './deprecated';\nimport edit from './edit';\nimport metadata from './block.json';\nimport save from './save';\nimport transforms from './transforms';\n\nconst { name } = metadata;\n\nexport { metadata, name };\n\nexport const settings = {\n\ticon,\n\texample: {\n\t\tviewportWidth: 601, // Columns collapse \"@media (max-width: 600px)\".\n\t\tattributes: {\n\t\t\tmediaType: 'image',\n\t\t\tmediaUrl:\n\t\t\t\t'https://s.w.org/images/core/5.3/Biologia_Centrali-Americana_-_Cantorchilus_semibadius_1902.jpg',\n\t\t},\n\t\tinnerBlocks: [\n\t\t\t{\n\t\t\t\tname: 'core/paragraph',\n\t\t\t\tattributes: {\n\t\t\t\t\tcontent: __(\n\t\t\t\t\t\t'The wren<br>Earns his living<br>Noiselessly.'\n\t\t\t\t\t),\n\t\t\t\t},\n\t\t\t},\n\t\t\t{\n\t\t\t\tname: 'core/paragraph',\n\t\t\t\tattributes: {\n\t\t\t\t\tcontent: __( '— Kobayashi Issa (一茶)' ),\n\t\t\t\t},\n\t\t\t},\n\t\t],\n\t},\n\ttransforms,\n\tedit,\n\tsave,\n\tdeprecated,\n};\n"]}
|
|
@@ -120,6 +120,7 @@ const metadata = {
|
|
|
120
120
|
__experimentalFontWeight: true,
|
|
121
121
|
__experimentalTextTransform: true,
|
|
122
122
|
__experimentalFontFamily: true,
|
|
123
|
+
__experimentalLetterSpacing: true,
|
|
123
124
|
__experimentalTextDecoration: true,
|
|
124
125
|
__experimentalSkipSerialization: ["textDecoration"],
|
|
125
126
|
__experimentalDefaultControls: {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["@wordpress/block-library/src/navigation/index.js"],"names":["name","metadata","settings","icon","example","innerBlocks","attributes","label","url","edit","save","deprecated"],"mappings":";;;;;;;;;AAGA;;AACA;;AAMA;;AACA;;AACA;;AAZA;AACA;AACA;;AAIA;AACA;AACA
|
|
1
|
+
{"version":3,"sources":["@wordpress/block-library/src/navigation/index.js"],"names":["name","metadata","settings","icon","example","innerBlocks","attributes","label","url","edit","save","deprecated"],"mappings":";;;;;;;;;AAGA;;AACA;;AAMA;;AACA;;AACA;;AAZA;AACA;AACA;;AAIA;AACA;AACA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAMA,MAAM;AAAEA,EAAAA;AAAF,IAAWC,QAAjB;;AAIO,MAAMC,QAAQ,GAAG;AACvBC,EAAAA,IAAI,EAAJA,iBADuB;AAEvBC,EAAAA,OAAO,EAAE;AACRC,IAAAA,WAAW,EAAE,CACZ;AACCL,MAAAA,IAAI,EAAE,sBADP;AAECM,MAAAA,UAAU,EAAE;AACX;AACAC,QAAAA,KAAK,EAAE,cAAI,MAAJ,CAFI;AAGXC,QAAAA,GAAG,EAAE;AAHM;AAFb,KADY,EASZ;AACCR,MAAAA,IAAI,EAAE,sBADP;AAECM,MAAAA,UAAU,EAAE;AACX;AACAC,QAAAA,KAAK,EAAE,cAAI,OAAJ,CAFI;AAGXC,QAAAA,GAAG,EAAE;AAHM;AAFb,KATY,EAiBZ;AACCR,MAAAA,IAAI,EAAE,sBADP;AAECM,MAAAA,UAAU,EAAE;AACX;AACAC,QAAAA,KAAK,EAAE,cAAI,SAAJ,CAFI;AAGXC,QAAAA,GAAG,EAAE;AAHM;AAFb,KAjBY;AADL,GAFc;AA8BvBC,EAAAA,IAAI,EAAJA,aA9BuB;AA+BvBC,EAAAA,IAAI,EAAJA,aA/BuB;AAgCvBC,EAAAA,UAAU,EAAVA;AAhCuB,CAAjB","sourcesContent":["/**\n * WordPress dependencies\n */\nimport { __ } from '@wordpress/i18n';\nimport { navigation as icon } from '@wordpress/icons';\n\n/**\n * Internal dependencies\n */\nimport metadata from './block.json';\nimport edit from './edit';\nimport save from './save';\nimport deprecated from './deprecated';\n\nconst { name } = metadata;\n\nexport { metadata, name };\n\nexport const settings = {\n\ticon,\n\texample: {\n\t\tinnerBlocks: [\n\t\t\t{\n\t\t\t\tname: 'core/navigation-link',\n\t\t\t\tattributes: {\n\t\t\t\t\t// translators: 'Home' as in a website's home page.\n\t\t\t\t\tlabel: __( 'Home' ),\n\t\t\t\t\turl: 'https://make.wordpress.org/',\n\t\t\t\t},\n\t\t\t},\n\t\t\t{\n\t\t\t\tname: 'core/navigation-link',\n\t\t\t\tattributes: {\n\t\t\t\t\t// translators: 'About' as in a website's about page.\n\t\t\t\t\tlabel: __( 'About' ),\n\t\t\t\t\turl: 'https://make.wordpress.org/',\n\t\t\t\t},\n\t\t\t},\n\t\t\t{\n\t\t\t\tname: 'core/navigation-link',\n\t\t\t\tattributes: {\n\t\t\t\t\t// translators: 'Contact' as in a website's contact page.\n\t\t\t\t\tlabel: __( 'Contact' ),\n\t\t\t\t\turl: 'https://make.wordpress.org/',\n\t\t\t\t},\n\t\t\t},\n\t\t],\n\t},\n\tedit,\n\tsave,\n\tdeprecated,\n};\n"]}
|
package/build/paragraph/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["@wordpress/block-library/src/paragraph/index.js"],"names":["name","metadata","settings","icon","example","attributes","content","style","typography","fontSize","dropCap","__experimentalLabel","context","transforms","deprecated","merge","attributesToMerge","edit","save"],"mappings":";;;;;;;;;AAGA;;AAKA;;AACA;;AAKA;;AACA;;AAEA;;AACA;;AAlBA;AACA;AACA;;AAGA;AACA;AACA;;AAIA;AACA;AACA
|
|
1
|
+
{"version":3,"sources":["@wordpress/block-library/src/paragraph/index.js"],"names":["name","metadata","settings","icon","example","attributes","content","style","typography","fontSize","dropCap","__experimentalLabel","context","transforms","deprecated","merge","attributesToMerge","edit","save"],"mappings":";;;;;;;;;AAGA;;AAKA;;AACA;;AAKA;;AACA;;AAEA;;AACA;;AAlBA;AACA;AACA;;AAGA;AACA;AACA;;AAIA;AACA;AACA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAOA,MAAM;AAAEA,EAAAA;AAAF,IAAWC,QAAjB;;AAIO,MAAMC,QAAQ,GAAG;AACvBC,EAAAA,IAAI,EAAJA,gBADuB;AAEvBC,EAAAA,OAAO,EAAE;AACRC,IAAAA,UAAU,EAAE;AACXC,MAAAA,OAAO,EAAE,cACR,kOADQ,CADE;AAIXC,MAAAA,KAAK,EAAE;AACNC,QAAAA,UAAU,EAAE;AACXC,UAAAA,QAAQ,EAAE;AADC;AADN,OAJI;AASXC,MAAAA,OAAO,EAAE;AATE;AADJ,GAFc;;AAevBC,EAAAA,mBAAmB,CAAEN,UAAF,QAA4B;AAAA,QAAd;AAAEO,MAAAA;AAAF,KAAc;;AAC9C,QAAKA,OAAO,KAAK,eAAjB,EAAmC;AAClC,YAAM;AAAEN,QAAAA;AAAF,UAAcD,UAApB;AACA,aAAO,qBAASC,OAAT,IAAqB,cAAI,OAAJ,CAArB,GAAqCA,OAA5C;AACA;AACD,GApBsB;;AAqBvBO,EAAAA,UAAU,EAAVA,mBArBuB;AAsBvBC,EAAAA,UAAU,EAAVA,mBAtBuB;;AAuBvBC,EAAAA,KAAK,CAAEV,UAAF,EAAcW,iBAAd,EAAkC;AACtC,WAAO;AACNV,MAAAA,OAAO,EACN,CAAED,UAAU,CAACC,OAAX,IAAsB,EAAxB,KACEU,iBAAiB,CAACV,OAAlB,IAA6B,EAD/B;AAFK,KAAP;AAKA,GA7BsB;;AA8BvBW,EAAAA,IAAI,EAAJA,aA9BuB;AA+BvBC,EAAAA,IAAI,EAAJA;AA/BuB,CAAjB","sourcesContent":["/**\n * External dependencies\n */\nimport { isEmpty } from 'lodash';\n\n/**\n * WordPress dependencies\n */\nimport { __ } from '@wordpress/i18n';\nimport { paragraph as icon } from '@wordpress/icons';\n\n/**\n * Internal dependencies\n */\nimport deprecated from './deprecated';\nimport edit from './edit';\nimport metadata from './block.json';\nimport save from './save';\nimport transforms from './transforms';\n\nconst { name } = metadata;\n\nexport { metadata, name };\n\nexport const settings = {\n\ticon,\n\texample: {\n\t\tattributes: {\n\t\t\tcontent: __(\n\t\t\t\t'In a village of La Mancha, the name of which I have no desire to call to mind, there lived not long since one of those gentlemen that keep a lance in the lance-rack, an old buckler, a lean hack, and a greyhound for coursing.'\n\t\t\t),\n\t\t\tstyle: {\n\t\t\t\ttypography: {\n\t\t\t\t\tfontSize: 28,\n\t\t\t\t},\n\t\t\t},\n\t\t\tdropCap: true,\n\t\t},\n\t},\n\t__experimentalLabel( attributes, { context } ) {\n\t\tif ( context === 'accessibility' ) {\n\t\t\tconst { content } = attributes;\n\t\t\treturn isEmpty( content ) ? __( 'Empty' ) : content;\n\t\t}\n\t},\n\ttransforms,\n\tdeprecated,\n\tmerge( attributes, attributesToMerge ) {\n\t\treturn {\n\t\t\tcontent:\n\t\t\t\t( attributes.content || '' ) +\n\t\t\t\t( attributesToMerge.content || '' ),\n\t\t};\n\t},\n\tedit,\n\tsave,\n};\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["@wordpress/block-library/src/paragraph/transforms.js"],"names":["transforms","from","type","priority","selector","schema","phrasingContentSchema","isPaste","p","children","attributes","transform","node","name","outerHTML","textAlign","style","align"],"mappings":";;;;;;;AAGA;;AAHA;AACA;AACA;;AAGA;AACA;AACA
|
|
1
|
+
{"version":3,"sources":["@wordpress/block-library/src/paragraph/transforms.js"],"names":["transforms","from","type","priority","selector","schema","phrasingContentSchema","isPaste","p","children","attributes","transform","node","name","outerHTML","textAlign","style","align"],"mappings":";;;;;;;AAGA;;AAHA;AACA;AACA;;AAGA;AACA;AACA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAGA,MAAMA,UAAU,GAAG;AAClBC,EAAAA,IAAI,EAAE,CACL;AACCC,IAAAA,IAAI,EAAE,KADP;AAEC;AACAC,IAAAA,QAAQ,EAAE,EAHX;AAICC,IAAAA,QAAQ,EAAE,GAJX;AAKCC,IAAAA,MAAM,EAAE;AAAA,UAAE;AAAEC,QAAAA,qBAAF;AAAyBC,QAAAA;AAAzB,OAAF;AAAA,aAA4C;AACnDC,QAAAA,CAAC,EAAE;AACFC,UAAAA,QAAQ,EAAEH,qBADR;AAEFI,UAAAA,UAAU,EAAEH,OAAO,GAAG,EAAH,GAAQ,CAAE,OAAF,EAAW,IAAX;AAFzB;AADgD,OAA5C;AAAA,KALT;;AAWCI,IAAAA,SAAS,CAAEC,IAAF,EAAS;AACjB,YAAMF,UAAU,GAAG,gCAAoBG,IAApB,EAA0BD,IAAI,CAACE,SAA/B,CAAnB;AACA,YAAM;AAAEC,QAAAA;AAAF,UAAgBH,IAAI,CAACI,KAAL,IAAc,EAApC;;AAEA,UACCD,SAAS,KAAK,MAAd,IACAA,SAAS,KAAK,QADd,IAEAA,SAAS,KAAK,OAHf,EAIE;AACDL,QAAAA,UAAU,CAACO,KAAX,GAAmBF,SAAnB;AACA;;AAED,aAAO,yBAAaF,IAAb,EAAmBH,UAAnB,CAAP;AACA;;AAxBF,GADK;AADY,CAAnB;eA+BeV,U","sourcesContent":["/**\n * WordPress dependencies\n */\nimport { createBlock, getBlockAttributes } from '@wordpress/blocks';\n\n/**\n * Internal dependencies\n */\nimport { name } from './block.json';\n\nconst transforms = {\n\tfrom: [\n\t\t{\n\t\t\ttype: 'raw',\n\t\t\t// Paragraph is a fallback and should be matched last.\n\t\t\tpriority: 20,\n\t\t\tselector: 'p',\n\t\t\tschema: ( { phrasingContentSchema, isPaste } ) => ( {\n\t\t\t\tp: {\n\t\t\t\t\tchildren: phrasingContentSchema,\n\t\t\t\t\tattributes: isPaste ? [] : [ 'style', 'id' ],\n\t\t\t\t},\n\t\t\t} ),\n\t\t\ttransform( node ) {\n\t\t\t\tconst attributes = getBlockAttributes( name, node.outerHTML );\n\t\t\t\tconst { textAlign } = node.style || {};\n\n\t\t\t\tif (\n\t\t\t\t\ttextAlign === 'left' ||\n\t\t\t\t\ttextAlign === 'center' ||\n\t\t\t\t\ttextAlign === 'right'\n\t\t\t\t) {\n\t\t\t\t\tattributes.align = textAlign;\n\t\t\t\t}\n\n\t\t\t\treturn createBlock( name, attributes );\n\t\t\t},\n\t\t},\n\t],\n};\n\nexport default transforms;\n"]}
|
|
@@ -10,6 +10,8 @@ exports.default = void 0;
|
|
|
10
10
|
|
|
11
11
|
var _element = require("@wordpress/element");
|
|
12
12
|
|
|
13
|
+
var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
|
|
14
|
+
|
|
13
15
|
var _classnames = _interopRequireDefault(require("classnames"));
|
|
14
16
|
|
|
15
17
|
var _blocks = require("@wordpress/blocks");
|
|
@@ -53,6 +55,7 @@ function SocialLinksEdit(props) {
|
|
|
53
55
|
var _attributes$className;
|
|
54
56
|
|
|
55
57
|
const {
|
|
58
|
+
clientId,
|
|
56
59
|
name,
|
|
57
60
|
attributes,
|
|
58
61
|
iconBackgroundColor,
|
|
@@ -137,7 +140,13 @@ function SocialLinksEdit(props) {
|
|
|
137
140
|
iconColorValue: colorValue
|
|
138
141
|
});
|
|
139
142
|
},
|
|
140
|
-
label: (0, _i18n.__)('Icon color')
|
|
143
|
+
label: (0, _i18n.__)('Icon color'),
|
|
144
|
+
resetAllFilter: () => {
|
|
145
|
+
setIconColor(undefined);
|
|
146
|
+
setAttributes({
|
|
147
|
+
iconColorValue: undefined
|
|
148
|
+
});
|
|
149
|
+
}
|
|
141
150
|
}];
|
|
142
151
|
|
|
143
152
|
if (!logosOnly) {
|
|
@@ -151,10 +160,17 @@ function SocialLinksEdit(props) {
|
|
|
151
160
|
iconBackgroundColorValue: colorValue
|
|
152
161
|
});
|
|
153
162
|
},
|
|
154
|
-
label: (0, _i18n.__)('Icon background')
|
|
163
|
+
label: (0, _i18n.__)('Icon background'),
|
|
164
|
+
resetAllFilter: () => {
|
|
165
|
+
setIconBackgroundColor(undefined);
|
|
166
|
+
setAttributes({
|
|
167
|
+
iconBackgroundColorValue: undefined
|
|
168
|
+
});
|
|
169
|
+
}
|
|
155
170
|
});
|
|
156
171
|
}
|
|
157
172
|
|
|
173
|
+
const colorGradientSettings = (0, _blockEditor.__experimentalUseMultipleOriginColorsAndGradients)();
|
|
158
174
|
return (0, _element.createElement)(_element.Fragment, null, (0, _element.createElement)(_blockEditor.BlockControls, {
|
|
159
175
|
group: "other"
|
|
160
176
|
}, (0, _element.createElement)(_components.ToolbarDropdownMenu, {
|
|
@@ -194,17 +210,34 @@ function SocialLinksEdit(props) {
|
|
|
194
210
|
onChange: () => setAttributes({
|
|
195
211
|
showLabels: !showLabels
|
|
196
212
|
})
|
|
197
|
-
})), (0, _element.createElement)(_blockEditor.
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
213
|
+
}))), (0, _element.createElement)(_blockEditor.InspectorControls, {
|
|
214
|
+
__experimentalGroup: "color"
|
|
215
|
+
}, colorSettings.map(_ref2 => {
|
|
216
|
+
let {
|
|
217
|
+
onChange,
|
|
218
|
+
label,
|
|
219
|
+
value,
|
|
220
|
+
resetAllFilter
|
|
221
|
+
} = _ref2;
|
|
222
|
+
return (0, _element.createElement)(_blockEditor.__experimentalColorGradientSettingsDropdown, (0, _extends2.default)({
|
|
223
|
+
key: `social-links-color-${label}`,
|
|
224
|
+
__experimentalHasMultipleOrigins: true,
|
|
225
|
+
__experimentalIsRenderedInSidebar: true,
|
|
226
|
+
settings: [{
|
|
227
|
+
colorValue: value,
|
|
228
|
+
label,
|
|
229
|
+
onColorChange: onChange,
|
|
230
|
+
isShownByDefault: true,
|
|
231
|
+
resetAllFilter,
|
|
232
|
+
enableAlpha: true
|
|
233
|
+
}],
|
|
234
|
+
panelId: clientId
|
|
235
|
+
}, colorGradientSettings));
|
|
236
|
+
}), !logosOnly && (0, _element.createElement)(_blockEditor.ContrastChecker, {
|
|
204
237
|
textColor: iconColorValue,
|
|
205
238
|
backgroundColor: iconBackgroundColorValue,
|
|
206
239
|
isLargeText: false
|
|
207
|
-
}))
|
|
240
|
+
})), (0, _element.createElement)("ul", innerBlocksProps));
|
|
208
241
|
}
|
|
209
242
|
|
|
210
243
|
const iconColorAttributes = {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["@wordpress/block-library/src/social-links/edit.js"],"names":["ALLOWED_BLOCKS","sizeOptions","name","value","getDefaultBlockLayout","blockTypeOrName","layoutBlockSupportConfig","default","SocialLinksEdit","props","attributes","iconBackgroundColor","iconColor","isSelected","setAttributes","setIconBackgroundColor","setIconColor","iconBackgroundColorValue","customIconBackgroundColor","iconColorValue","openInNewTab","showLabels","size","layout","usedLayout","logosOnly","className","includes","backgroundBackup","current","undefined","SocialPlaceholder","SelectedSocialPlaceholder","color","blockProps","innerBlocksProps","allowedBlocks","placeholder","templateLock","__experimentalAppenderTagName","__experimentalLayout","POPOVER_PROPS","position","colorSettings","onChange","colorValue","label","push","onClose","map","entry","check","textColor","backgroundColor","iconColorAttributes"],"mappings":";;;;;;;;;;AASA;;AANA;;AAKA;;AAEA;;AASA;;AAOA;;AACA;;AA3BA;AACA;AACA;;AAGA;AACA;AACA;AAsBA,MAAMA,cAAc,GAAG,CAAE,kBAAF,CAAvB;AAEA,MAAMC,WAAW,GAAG,CACnB;AAAEC,EAAAA,IAAI,EAAE,cAAI,OAAJ,CAAR;AAAuBC,EAAAA,KAAK,EAAE;AAA9B,CADmB,EAEnB;AAAED,EAAAA,IAAI,EAAE,cAAI,QAAJ,CAAR;AAAwBC,EAAAA,KAAK,EAAE;AAA/B,CAFmB,EAGnB;AAAED,EAAAA,IAAI,EAAE,cAAI,OAAJ,CAAR;AAAuBC,EAAAA,KAAK,EAAE;AAA9B,CAHmB,EAInB;AAAED,EAAAA,IAAI,EAAE,cAAI,MAAJ,CAAR;AAAsBC,EAAAA,KAAK,EAAE;AAA7B,CAJmB,CAApB;;AAOA,MAAMC,qBAAqB,GAAKC,eAAF,IAAuB;AACpD,QAAMC,wBAAwB,GAAG,6BAChCD,eADgC,EAEhC,sBAFgC,CAAjC;AAIA,SAAOC,wBAAP,aAAOA,wBAAP,uBAAOA,wBAAwB,CAAEC,OAAjC;AACA,CAND;;AAQO,SAASC,eAAT,CAA0BC,KAA1B,EAAkC;AAAA;;AACxC,QAAM;AACLP,IAAAA,IADK;AAELQ,IAAAA,UAFK;AAGLC,IAAAA,mBAHK;AAILC,IAAAA,SAJK;AAKLC,IAAAA,UALK;AAMLC,IAAAA,aANK;AAOLC,IAAAA,sBAPK;AAQLC,IAAAA;AARK,MASF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AQC,4BAAC,yBAAD;AACC,IAAA,KAAK,EAAG,cAAI,aAAJ,CADT;AAEC,IAAA,OAAO,EAAGC,UAFX;AAGC,IAAA,QAAQ,EAAG,MACVP,aAAa,CAAE;AAAEO,MAAAA,UAAU,EAAE,CAAEA;AAAhB,KAAF;AAJf,IARD,CADD,EAiBC,4BAAC,+BAAD;AACC,IAAA,gCAAgC,MADjC;AAEC,IAAA,iCAAiC,MAFlC;AAGC,IAAA,KAAK,EAAG,cAAI,OAAJ,CAHT;AAIC,IAAA,aAAa,EAAGsB,aAJjB;AAKC,IAAA,WAAW;AALZ,KAOG,CAAElB,SAAF,IACD,4BAAC,4BAAD;AAEE2B,IAAAA,SAAS,EAAEjC,cAFb;AAGEkC,IAAAA,eAAe,EAAEpC,wBAHnB;AAKC,IAAA,WAAW,EAAG;AALf,IARF,CAjBD,CAtCD,EAyEC,kCAASkB,gBAAT,CAzED,CADD;AA6EA;;AAED,MAAMmB,mBAAmB,GAAG;AAC3B1C,EAAAA,SAAS,EAAE,YADgB;AAE3BD,EAAAA,mBAAmB,EAAE;AAFM,CAA5B;;eAKe,6BAAY2C,mBAAZ,EAAmC9C,eAAnC,C","sourcesContent":["/**\n * External dependencies\n */\nimport classNames from 'classnames';\n\n/**\n * WordPress dependencies\n */\nimport { getBlockSupport } from '@wordpress/blocks';\nimport { Fragment, useEffect, useRef } from '@wordpress/element';\nimport {\n\tBlockControls,\n\tuseInnerBlocksProps,\n\tuseBlockProps,\n\tInspectorControls,\n\tContrastChecker,\n\tPanelColorSettings,\n\twithColors,\n} from '@wordpress/block-editor';\nimport {\n\tMenuGroup,\n\tMenuItem,\n\tPanelBody,\n\tToggleControl,\n\tToolbarDropdownMenu,\n} from '@wordpress/components';\nimport { __ } from '@wordpress/i18n';\nimport { check } from '@wordpress/icons';\n\nconst ALLOWED_BLOCKS = [ 'core/social-link' ];\n\nconst sizeOptions = [\n\t{ name: __( 'Small' ), value: 'has-small-icon-size' },\n\t{ name: __( 'Normal' ), value: 'has-normal-icon-size' },\n\t{ name: __( 'Large' ), value: 'has-large-icon-size' },\n\t{ name: __( 'Huge' ), value: 'has-huge-icon-size' },\n];\n\nconst getDefaultBlockLayout = ( blockTypeOrName ) => {\n\tconst layoutBlockSupportConfig = getBlockSupport(\n\t\tblockTypeOrName,\n\t\t'__experimentalLayout'\n\t);\n\treturn layoutBlockSupportConfig?.default;\n};\n\nexport function SocialLinksEdit( props ) {\n\tconst {\n\t\tname,\n\t\tattributes,\n\t\ticonBackgroundColor,\n\t\ticonColor,\n\t\tisSelected,\n\t\tsetAttributes,\n\t\tsetIconBackgroundColor,\n\t\tsetIconColor,\n\t} = props;\n\n\tconst {\n\t\ticonBackgroundColorValue,\n\t\tcustomIconBackgroundColor,\n\t\ticonColorValue,\n\t\topenInNewTab,\n\t\tshowLabels,\n\t\tsize,\n\t\tlayout,\n\t} = attributes;\n\tconst usedLayout = layout || getDefaultBlockLayout( name );\n\n\tconst logosOnly = attributes.className?.includes( 'is-style-logos-only' );\n\n\t// Remove icon background color when logos only style is selected or\n\t// restore it when any other style is selected.\n\tconst backgroundBackup = useRef( {} );\n\tuseEffect( () => {\n\t\tif ( logosOnly ) {\n\t\t\tbackgroundBackup.current = {\n\t\t\t\ticonBackgroundColor,\n\t\t\t\ticonBackgroundColorValue,\n\t\t\t\tcustomIconBackgroundColor,\n\t\t\t};\n\t\t\tsetAttributes( {\n\t\t\t\ticonBackgroundColor: undefined,\n\t\t\t\tcustomIconBackgroundColor: undefined,\n\t\t\t\ticonBackgroundColorValue: undefined,\n\t\t\t} );\n\t\t} else {\n\t\t\tsetAttributes( { ...backgroundBackup.current } );\n\t\t}\n\t}, [ logosOnly ] );\n\n\tconst SocialPlaceholder = (\n\t\t<li className=\"wp-block-social-links__social-placeholder\">\n\t\t\t<div className=\"wp-block-social-links__social-placeholder-icons\">\n\t\t\t\t<div className=\"wp-social-link wp-social-link-twitter\"></div>\n\t\t\t\t<div className=\"wp-social-link wp-social-link-facebook\"></div>\n\t\t\t\t<div className=\"wp-social-link wp-social-link-instagram\"></div>\n\t\t\t</div>\n\t\t</li>\n\t);\n\n\tconst SelectedSocialPlaceholder = (\n\t\t<li className=\"wp-block-social-links__social-prompt\">\n\t\t\t{ __( 'Click plus to add' ) }\n\t\t</li>\n\t);\n\n\t// Fallback color values are used maintain selections in case switching\n\t// themes and named colors in palette do not match.\n\tconst className = classNames( size, {\n\t\t'has-visible-labels': showLabels,\n\t\t'has-icon-color': iconColor.color || iconColorValue,\n\t\t'has-icon-background-color':\n\t\t\ticonBackgroundColor.color || iconBackgroundColorValue,\n\t} );\n\n\tconst blockProps = useBlockProps( { className } );\n\tconst innerBlocksProps = useInnerBlocksProps( blockProps, {\n\t\tallowedBlocks: ALLOWED_BLOCKS,\n\t\tplaceholder: isSelected ? SelectedSocialPlaceholder : SocialPlaceholder,\n\t\ttemplateLock: false,\n\t\t__experimentalAppenderTagName: 'li',\n\t\t__experimentalLayout: usedLayout,\n\t} );\n\n\tconst POPOVER_PROPS = {\n\t\tposition: 'bottom right',\n\t};\n\n\tconst colorSettings = [\n\t\t{\n\t\t\t// Use custom attribute as fallback to prevent loss of named color selection when\n\t\t\t// switching themes to a new theme that does not have a matching named color.\n\t\t\tvalue: iconColor.color || iconColorValue,\n\t\t\tonChange: ( colorValue ) => {\n\t\t\t\tsetIconColor( colorValue );\n\t\t\t\tsetAttributes( { iconColorValue: colorValue } );\n\t\t\t},\n\t\t\tlabel: __( 'Icon color' ),\n\t\t},\n\t];\n\n\tif ( ! logosOnly ) {\n\t\tcolorSettings.push( {\n\t\t\t// Use custom attribute as fallback to prevent loss of named color selection when\n\t\t\t// switching themes to a new theme that does not have a matching named color.\n\t\t\tvalue: iconBackgroundColor.color || iconBackgroundColorValue,\n\t\t\tonChange: ( colorValue ) => {\n\t\t\t\tsetIconBackgroundColor( colorValue );\n\t\t\t\tsetAttributes( {\n\t\t\t\t\ticonBackgroundColorValue: colorValue,\n\t\t\t\t} );\n\t\t\t},\n\t\t\tlabel: __( 'Icon background' ),\n\t\t} );\n\t}\n\n\treturn (\n\t\t<Fragment>\n\t\t\t<BlockControls group=\"other\">\n\t\t\t\t<ToolbarDropdownMenu\n\t\t\t\t\tlabel={ __( 'Size' ) }\n\t\t\t\t\ttext={ __( 'Size' ) }\n\t\t\t\t\ticon={ null }\n\t\t\t\t\tpopoverProps={ POPOVER_PROPS }\n\t\t\t\t>\n\t\t\t\t\t{ ( { onClose } ) => (\n\t\t\t\t\t\t<MenuGroup>\n\t\t\t\t\t\t\t{ sizeOptions.map( ( entry ) => {\n\t\t\t\t\t\t\t\treturn (\n\t\t\t\t\t\t\t\t\t<MenuItem\n\t\t\t\t\t\t\t\t\t\ticon={\n\t\t\t\t\t\t\t\t\t\t\t( size === entry.value ||\n\t\t\t\t\t\t\t\t\t\t\t\t( ! size &&\n\t\t\t\t\t\t\t\t\t\t\t\t\tentry.value ===\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t'has-normal-icon-size' ) ) &&\n\t\t\t\t\t\t\t\t\t\t\tcheck\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\tisSelected={ size === entry.value }\n\t\t\t\t\t\t\t\t\t\tkey={ entry.value }\n\t\t\t\t\t\t\t\t\t\tonClick={ () => {\n\t\t\t\t\t\t\t\t\t\t\tsetAttributes( {\n\t\t\t\t\t\t\t\t\t\t\t\tsize: entry.value,\n\t\t\t\t\t\t\t\t\t\t\t} );\n\t\t\t\t\t\t\t\t\t\t} }\n\t\t\t\t\t\t\t\t\t\tonClose={ onClose }\n\t\t\t\t\t\t\t\t\t\trole=\"menuitemradio\"\n\t\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t\t{ entry.name }\n\t\t\t\t\t\t\t\t\t</MenuItem>\n\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t} ) }\n\t\t\t\t\t\t</MenuGroup>\n\t\t\t\t\t) }\n\t\t\t\t</ToolbarDropdownMenu>\n\t\t\t</BlockControls>\n\t\t\t<InspectorControls>\n\t\t\t\t<PanelBody title={ __( 'Link settings' ) }>\n\t\t\t\t\t<ToggleControl\n\t\t\t\t\t\tlabel={ __( 'Open links in new tab' ) }\n\t\t\t\t\t\tchecked={ openInNewTab }\n\t\t\t\t\t\tonChange={ () =>\n\t\t\t\t\t\t\tsetAttributes( { openInNewTab: ! openInNewTab } )\n\t\t\t\t\t\t}\n\t\t\t\t\t/>\n\t\t\t\t\t<ToggleControl\n\t\t\t\t\t\tlabel={ __( 'Show labels' ) }\n\t\t\t\t\t\tchecked={ showLabels }\n\t\t\t\t\t\tonChange={ () =>\n\t\t\t\t\t\t\tsetAttributes( { showLabels: ! showLabels } )\n\t\t\t\t\t\t}\n\t\t\t\t\t/>\n\t\t\t\t</PanelBody>\n\t\t\t\t<PanelColorSettings\n\t\t\t\t\t__experimentalHasMultipleOrigins\n\t\t\t\t\t__experimentalIsRenderedInSidebar\n\t\t\t\t\ttitle={ __( 'Color' ) }\n\t\t\t\t\tcolorSettings={ colorSettings }\n\t\t\t\t\tenableAlpha\n\t\t\t\t>\n\t\t\t\t\t{ ! logosOnly && (\n\t\t\t\t\t\t<ContrastChecker\n\t\t\t\t\t\t\t{ ...{\n\t\t\t\t\t\t\t\ttextColor: iconColorValue,\n\t\t\t\t\t\t\t\tbackgroundColor: iconBackgroundColorValue,\n\t\t\t\t\t\t\t} }\n\t\t\t\t\t\t\tisLargeText={ false }\n\t\t\t\t\t\t/>\n\t\t\t\t\t) }\n\t\t\t\t</PanelColorSettings>\n\t\t\t</InspectorControls>\n\t\t\t<ul { ...innerBlocksProps } />\n\t\t</Fragment>\n\t);\n}\n\nconst iconColorAttributes = {\n\ticonColor: 'icon-color',\n\ticonBackgroundColor: 'icon-background-color',\n};\n\nexport default withColors( iconColorAttributes )( SocialLinksEdit );\n"]}
|
|
1
|
+
{"version":3,"sources":["@wordpress/block-library/src/social-links/edit.js"],"names":["ALLOWED_BLOCKS","sizeOptions","name","value","getDefaultBlockLayout","blockTypeOrName","layoutBlockSupportConfig","default","SocialLinksEdit","props","clientId","attributes","iconBackgroundColor","iconColor","isSelected","setAttributes","setIconBackgroundColor","setIconColor","iconBackgroundColorValue","customIconBackgroundColor","iconColorValue","openInNewTab","showLabels","size","layout","usedLayout","logosOnly","className","includes","backgroundBackup","current","undefined","SocialPlaceholder","SelectedSocialPlaceholder","color","blockProps","innerBlocksProps","allowedBlocks","placeholder","templateLock","__experimentalAppenderTagName","__experimentalLayout","POPOVER_PROPS","position","colorSettings","onChange","colorValue","label","resetAllFilter","push","colorGradientSettings","onClose","map","entry","check","onColorChange","isShownByDefault","enableAlpha","textColor","backgroundColor","iconColorAttributes"],"mappings":";;;;;;;;;;AASA;;;;AANA;;AAKA;;AAEA;;AAUA;;AAOA;;AACA;;AA5BA;AACA;AACA;;AAGA;AACA;AACA;AAuBA,MAAMA,cAAc,GAAG,CAAE,kBAAF,CAAvB;AAEA,MAAMC,WAAW,GAAG,CACnB;AAAEC,EAAAA,IAAI,EAAE,cAAI,OAAJ,CAAR;AAAuBC,EAAAA,KAAK,EAAE;AAA9B,CADmB,EAEnB;AAAED,EAAAA,IAAI,EAAE,cAAI,QAAJ,CAAR;AAAwBC,EAAAA,KAAK,EAAE;AAA/B,CAFmB,EAGnB;AAAED,EAAAA,IAAI,EAAE,cAAI,OAAJ,CAAR;AAAuBC,EAAAA,KAAK,EAAE;AAA9B,CAHmB,EAInB;AAAED,EAAAA,IAAI,EAAE,cAAI,MAAJ,CAAR;AAAsBC,EAAAA,KAAK,EAAE;AAA7B,CAJmB,CAApB;;AAOA,MAAMC,qBAAqB,GAAKC,eAAF,IAAuB;AACpD,QAAMC,wBAAwB,GAAG,6BAChCD,eADgC,EAEhC,sBAFgC,CAAjC;AAIA,SAAOC,wBAAP,aAAOA,wBAAP,uBAAOA,wBAAwB,CAAEC,OAAjC;AACA,CAND;;AAQO,SAASC,eAAT,CAA0BC,KAA1B,EAAkC;AAAA;;AACxC,QAAM;AACLC,IAAAA,QADK;AAELR,IA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CAJZ;AAcC,MAAA,OAAO,EAAG/C;AAdX,OAeMwC,qBAfN,EADD;AAAA,GADC,CADH,EAsBG,CAAExB,SAAF,IACD,4BAAC,4BAAD;AAEEgC,IAAAA,SAAS,EAAEtC,cAFb;AAGEuC,IAAAA,eAAe,EAAEzC,wBAHnB;AAKC,IAAA,WAAW,EAAG;AALf,IAvBF,CAxDD,EAwFC,kCAASkB,gBAAT,CAxFD,CADD;AA4FA;;AAED,MAAMwB,mBAAmB,GAAG;AAC3B/C,EAAAA,SAAS,EAAE,YADgB;AAE3BD,EAAAA,mBAAmB,EAAE;AAFM,CAA5B;;eAKe,6BAAYgD,mBAAZ,EAAmCpD,eAAnC,C","sourcesContent":["/**\n * External dependencies\n */\nimport classNames from 'classnames';\n\n/**\n * WordPress dependencies\n */\nimport { getBlockSupport } from '@wordpress/blocks';\nimport { useEffect, useRef } from '@wordpress/element';\nimport {\n\tBlockControls,\n\tuseInnerBlocksProps,\n\tuseBlockProps,\n\tInspectorControls,\n\tContrastChecker,\n\twithColors,\n\t__experimentalColorGradientSettingsDropdown as ColorGradientSettingsDropdown,\n\t__experimentalUseMultipleOriginColorsAndGradients as useMultipleOriginColorsAndGradients,\n} from '@wordpress/block-editor';\nimport {\n\tMenuGroup,\n\tMenuItem,\n\tPanelBody,\n\tToggleControl,\n\tToolbarDropdownMenu,\n} from '@wordpress/components';\nimport { __ } from '@wordpress/i18n';\nimport { check } from '@wordpress/icons';\n\nconst ALLOWED_BLOCKS = [ 'core/social-link' ];\n\nconst sizeOptions = [\n\t{ name: __( 'Small' ), value: 'has-small-icon-size' },\n\t{ name: __( 'Normal' ), value: 'has-normal-icon-size' },\n\t{ name: __( 'Large' ), value: 'has-large-icon-size' },\n\t{ name: __( 'Huge' ), value: 'has-huge-icon-size' },\n];\n\nconst getDefaultBlockLayout = ( blockTypeOrName ) => {\n\tconst layoutBlockSupportConfig = getBlockSupport(\n\t\tblockTypeOrName,\n\t\t'__experimentalLayout'\n\t);\n\treturn layoutBlockSupportConfig?.default;\n};\n\nexport function SocialLinksEdit( props ) {\n\tconst {\n\t\tclientId,\n\t\tname,\n\t\tattributes,\n\t\ticonBackgroundColor,\n\t\ticonColor,\n\t\tisSelected,\n\t\tsetAttributes,\n\t\tsetIconBackgroundColor,\n\t\tsetIconColor,\n\t} = props;\n\n\tconst {\n\t\ticonBackgroundColorValue,\n\t\tcustomIconBackgroundColor,\n\t\ticonColorValue,\n\t\topenInNewTab,\n\t\tshowLabels,\n\t\tsize,\n\t\tlayout,\n\t} = attributes;\n\tconst usedLayout = layout || getDefaultBlockLayout( name );\n\n\tconst logosOnly = attributes.className?.includes( 'is-style-logos-only' );\n\n\t// Remove icon background color when logos only style is selected or\n\t// restore it when any other style is selected.\n\tconst backgroundBackup = useRef( {} );\n\tuseEffect( () => {\n\t\tif ( logosOnly ) {\n\t\t\tbackgroundBackup.current = {\n\t\t\t\ticonBackgroundColor,\n\t\t\t\ticonBackgroundColorValue,\n\t\t\t\tcustomIconBackgroundColor,\n\t\t\t};\n\t\t\tsetAttributes( {\n\t\t\t\ticonBackgroundColor: undefined,\n\t\t\t\tcustomIconBackgroundColor: undefined,\n\t\t\t\ticonBackgroundColorValue: undefined,\n\t\t\t} );\n\t\t} else {\n\t\t\tsetAttributes( { ...backgroundBackup.current } );\n\t\t}\n\t}, [ logosOnly ] );\n\n\tconst SocialPlaceholder = (\n\t\t<li className=\"wp-block-social-links__social-placeholder\">\n\t\t\t<div className=\"wp-block-social-links__social-placeholder-icons\">\n\t\t\t\t<div className=\"wp-social-link wp-social-link-twitter\"></div>\n\t\t\t\t<div className=\"wp-social-link wp-social-link-facebook\"></div>\n\t\t\t\t<div className=\"wp-social-link wp-social-link-instagram\"></div>\n\t\t\t</div>\n\t\t</li>\n\t);\n\n\tconst SelectedSocialPlaceholder = (\n\t\t<li className=\"wp-block-social-links__social-prompt\">\n\t\t\t{ __( 'Click plus to add' ) }\n\t\t</li>\n\t);\n\n\t// Fallback color values are used maintain selections in case switching\n\t// themes and named colors in palette do not match.\n\tconst className = classNames( size, {\n\t\t'has-visible-labels': showLabels,\n\t\t'has-icon-color': iconColor.color || iconColorValue,\n\t\t'has-icon-background-color':\n\t\t\ticonBackgroundColor.color || iconBackgroundColorValue,\n\t} );\n\n\tconst blockProps = useBlockProps( { className } );\n\tconst innerBlocksProps = useInnerBlocksProps( blockProps, {\n\t\tallowedBlocks: ALLOWED_BLOCKS,\n\t\tplaceholder: isSelected ? SelectedSocialPlaceholder : SocialPlaceholder,\n\t\ttemplateLock: false,\n\t\t__experimentalAppenderTagName: 'li',\n\t\t__experimentalLayout: usedLayout,\n\t} );\n\n\tconst POPOVER_PROPS = {\n\t\tposition: 'bottom right',\n\t};\n\n\tconst colorSettings = [\n\t\t{\n\t\t\t// Use custom attribute as fallback to prevent loss of named color selection when\n\t\t\t// switching themes to a new theme that does not have a matching named color.\n\t\t\tvalue: iconColor.color || iconColorValue,\n\t\t\tonChange: ( colorValue ) => {\n\t\t\t\tsetIconColor( colorValue );\n\t\t\t\tsetAttributes( { iconColorValue: colorValue } );\n\t\t\t},\n\t\t\tlabel: __( 'Icon color' ),\n\t\t\tresetAllFilter: () => {\n\t\t\t\tsetIconColor( undefined );\n\t\t\t\tsetAttributes( { iconColorValue: undefined } );\n\t\t\t},\n\t\t},\n\t];\n\n\tif ( ! logosOnly ) {\n\t\tcolorSettings.push( {\n\t\t\t// Use custom attribute as fallback to prevent loss of named color selection when\n\t\t\t// switching themes to a new theme that does not have a matching named color.\n\t\t\tvalue: iconBackgroundColor.color || iconBackgroundColorValue,\n\t\t\tonChange: ( colorValue ) => {\n\t\t\t\tsetIconBackgroundColor( colorValue );\n\t\t\t\tsetAttributes( {\n\t\t\t\t\ticonBackgroundColorValue: colorValue,\n\t\t\t\t} );\n\t\t\t},\n\t\t\tlabel: __( 'Icon background' ),\n\t\t\tresetAllFilter: () => {\n\t\t\t\tsetIconBackgroundColor( undefined );\n\t\t\t\tsetAttributes( { iconBackgroundColorValue: undefined } );\n\t\t\t},\n\t\t} );\n\t}\n\n\tconst colorGradientSettings = useMultipleOriginColorsAndGradients();\n\n\treturn (\n\t\t<>\n\t\t\t<BlockControls group=\"other\">\n\t\t\t\t<ToolbarDropdownMenu\n\t\t\t\t\tlabel={ __( 'Size' ) }\n\t\t\t\t\ttext={ __( 'Size' ) }\n\t\t\t\t\ticon={ null }\n\t\t\t\t\tpopoverProps={ POPOVER_PROPS }\n\t\t\t\t>\n\t\t\t\t\t{ ( { onClose } ) => (\n\t\t\t\t\t\t<MenuGroup>\n\t\t\t\t\t\t\t{ sizeOptions.map( ( entry ) => {\n\t\t\t\t\t\t\t\treturn (\n\t\t\t\t\t\t\t\t\t<MenuItem\n\t\t\t\t\t\t\t\t\t\ticon={\n\t\t\t\t\t\t\t\t\t\t\t( size === entry.value ||\n\t\t\t\t\t\t\t\t\t\t\t\t( ! size &&\n\t\t\t\t\t\t\t\t\t\t\t\t\tentry.value ===\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t'has-normal-icon-size' ) ) &&\n\t\t\t\t\t\t\t\t\t\t\tcheck\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\tisSelected={ size === entry.value }\n\t\t\t\t\t\t\t\t\t\tkey={ entry.value }\n\t\t\t\t\t\t\t\t\t\tonClick={ () => {\n\t\t\t\t\t\t\t\t\t\t\tsetAttributes( {\n\t\t\t\t\t\t\t\t\t\t\t\tsize: entry.value,\n\t\t\t\t\t\t\t\t\t\t\t} );\n\t\t\t\t\t\t\t\t\t\t} }\n\t\t\t\t\t\t\t\t\t\tonClose={ onClose }\n\t\t\t\t\t\t\t\t\t\trole=\"menuitemradio\"\n\t\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t\t{ entry.name }\n\t\t\t\t\t\t\t\t\t</MenuItem>\n\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t} ) }\n\t\t\t\t\t\t</MenuGroup>\n\t\t\t\t\t) }\n\t\t\t\t</ToolbarDropdownMenu>\n\t\t\t</BlockControls>\n\t\t\t<InspectorControls>\n\t\t\t\t<PanelBody title={ __( 'Link settings' ) }>\n\t\t\t\t\t<ToggleControl\n\t\t\t\t\t\tlabel={ __( 'Open links in new tab' ) }\n\t\t\t\t\t\tchecked={ openInNewTab }\n\t\t\t\t\t\tonChange={ () =>\n\t\t\t\t\t\t\tsetAttributes( { openInNewTab: ! openInNewTab } )\n\t\t\t\t\t\t}\n\t\t\t\t\t/>\n\t\t\t\t\t<ToggleControl\n\t\t\t\t\t\tlabel={ __( 'Show labels' ) }\n\t\t\t\t\t\tchecked={ showLabels }\n\t\t\t\t\t\tonChange={ () =>\n\t\t\t\t\t\t\tsetAttributes( { showLabels: ! showLabels } )\n\t\t\t\t\t\t}\n\t\t\t\t\t/>\n\t\t\t\t</PanelBody>\n\t\t\t</InspectorControls>\n\t\t\t<InspectorControls __experimentalGroup=\"color\">\n\t\t\t\t{ colorSettings.map(\n\t\t\t\t\t( { onChange, label, value, resetAllFilter } ) => (\n\t\t\t\t\t\t<ColorGradientSettingsDropdown\n\t\t\t\t\t\t\tkey={ `social-links-color-${ label }` }\n\t\t\t\t\t\t\t__experimentalHasMultipleOrigins\n\t\t\t\t\t\t\t__experimentalIsRenderedInSidebar\n\t\t\t\t\t\t\tsettings={ [\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\tcolorValue: value,\n\t\t\t\t\t\t\t\t\tlabel,\n\t\t\t\t\t\t\t\t\tonColorChange: onChange,\n\t\t\t\t\t\t\t\t\tisShownByDefault: true,\n\t\t\t\t\t\t\t\t\tresetAllFilter,\n\t\t\t\t\t\t\t\t\tenableAlpha: true,\n\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t] }\n\t\t\t\t\t\t\tpanelId={ clientId }\n\t\t\t\t\t\t\t{ ...colorGradientSettings }\n\t\t\t\t\t\t/>\n\t\t\t\t\t)\n\t\t\t\t) }\n\t\t\t\t{ ! logosOnly && (\n\t\t\t\t\t<ContrastChecker\n\t\t\t\t\t\t{ ...{\n\t\t\t\t\t\t\ttextColor: iconColorValue,\n\t\t\t\t\t\t\tbackgroundColor: iconBackgroundColorValue,\n\t\t\t\t\t\t} }\n\t\t\t\t\t\tisLargeText={ false }\n\t\t\t\t\t/>\n\t\t\t\t) }\n\t\t\t</InspectorControls>\n\t\t\t<ul { ...innerBlocksProps } />\n\t\t</>\n\t);\n}\n\nconst iconColorAttributes = {\n\ticonColor: 'icon-color',\n\ticonBackgroundColor: 'icon-background-color',\n};\n\nexport default withColors( iconColorAttributes )( SocialLinksEdit );\n"]}
|
|
@@ -80,6 +80,15 @@ const metadata = {
|
|
|
80
80
|
type: "flex"
|
|
81
81
|
}
|
|
82
82
|
},
|
|
83
|
+
color: {
|
|
84
|
+
enableContrastChecker: false,
|
|
85
|
+
background: true,
|
|
86
|
+
gradients: true,
|
|
87
|
+
text: false,
|
|
88
|
+
__experimentalDefaultControls: {
|
|
89
|
+
background: false
|
|
90
|
+
}
|
|
91
|
+
},
|
|
83
92
|
spacing: {
|
|
84
93
|
blockGap: ["horizontal", "vertical"],
|
|
85
94
|
margin: ["top", "bottom"],
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["@wordpress/block-library/src/social-links/index.js"],"names":["name","metadata","settings","example","innerBlocks","attributes","service","url","icon","edit","save","deprecated"],"mappings":";;;;;;;;;AAGA;;AAKA;;AACA;;AAEA;;AAXA;AACA;AACA;;AAGA;AACA;AACA
|
|
1
|
+
{"version":3,"sources":["@wordpress/block-library/src/social-links/index.js"],"names":["name","metadata","settings","example","innerBlocks","attributes","service","url","icon","edit","save","deprecated"],"mappings":";;;;;;;;;AAGA;;AAKA;;AACA;;AAEA;;AAXA;AACA;AACA;;AAGA;AACA;AACA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAMA,MAAM;AAAEA,EAAAA;AAAF,IAAWC,QAAjB;;AAIO,MAAMC,QAAQ,GAAG;AACvBC,EAAAA,OAAO,EAAE;AACRC,IAAAA,WAAW,EAAE,CACZ;AACCJ,MAAAA,IAAI,EAAE,kBADP;AAECK,MAAAA,UAAU,EAAE;AACXC,QAAAA,OAAO,EAAE,WADE;AAEXC,QAAAA,GAAG,EAAE;AAFM;AAFb,KADY,EAQZ;AACCP,MAAAA,IAAI,EAAE,kBADP;AAECK,MAAAA,UAAU,EAAE;AACXC,QAAAA,OAAO,EAAE,UADE;AAEXC,QAAAA,GAAG,EAAE;AAFM;AAFb,KARY,EAeZ;AACCP,MAAAA,IAAI,EAAE,kBADP;AAECK,MAAAA,UAAU,EAAE;AACXC,QAAAA,OAAO,EAAE,SADE;AAEXC,QAAAA,GAAG,EAAE;AAFM;AAFb,KAfY;AADL,GADc;AA0BvBC,EAAAA,IAAI,EAAJA,YA1BuB;AA2BvBC,EAAAA,IAAI,EAAJA,aA3BuB;AA4BvBC,EAAAA,IAAI,EAAJA,aA5BuB;AA6BvBC,EAAAA,UAAU,EAAVA;AA7BuB,CAAjB","sourcesContent":["/**\n * WordPress dependencies\n */\nimport { share as icon } from '@wordpress/icons';\n\n/**\n * Internal dependencies\n */\nimport deprecated from './deprecated';\nimport edit from './edit';\nimport metadata from './block.json';\nimport save from './save';\n\nconst { name } = metadata;\n\nexport { metadata, name };\n\nexport const settings = {\n\texample: {\n\t\tinnerBlocks: [\n\t\t\t{\n\t\t\t\tname: 'core/social-link',\n\t\t\t\tattributes: {\n\t\t\t\t\tservice: 'wordpress',\n\t\t\t\t\turl: 'https://wordpress.org',\n\t\t\t\t},\n\t\t\t},\n\t\t\t{\n\t\t\t\tname: 'core/social-link',\n\t\t\t\tattributes: {\n\t\t\t\t\tservice: 'facebook',\n\t\t\t\t\turl: 'https://www.facebook.com/WordPress/',\n\t\t\t\t},\n\t\t\t},\n\t\t\t{\n\t\t\t\tname: 'core/social-link',\n\t\t\t\tattributes: {\n\t\t\t\t\tservice: 'twitter',\n\t\t\t\t\turl: 'https://twitter.com/WordPress',\n\t\t\t\t},\n\t\t\t},\n\t\t],\n\t},\n\ticon,\n\tedit,\n\tsave,\n\tdeprecated,\n};\n"]}
|
|
@@ -49,6 +49,19 @@ const metadata = {
|
|
|
49
49
|
spacing: {
|
|
50
50
|
margin: true,
|
|
51
51
|
padding: true
|
|
52
|
+
},
|
|
53
|
+
typography: {
|
|
54
|
+
fontSize: true,
|
|
55
|
+
lineHeight: true,
|
|
56
|
+
__experimentalFontFamily: true,
|
|
57
|
+
__experimentalFontWeight: true,
|
|
58
|
+
__experimentalFontStyle: true,
|
|
59
|
+
__experimentalTextTransform: true,
|
|
60
|
+
__experimentalTextDecoration: true,
|
|
61
|
+
__experimentalLetterSpacing: true,
|
|
62
|
+
__experimentalDefaultControls: {
|
|
63
|
+
fontSize: true
|
|
64
|
+
}
|
|
52
65
|
}
|
|
53
66
|
},
|
|
54
67
|
example: {}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["@wordpress/block-library/src/table-of-contents/index.js"],"names":["name","metadata","settings","icon","edit","save"],"mappings":";;;;;;;;;AAIA;;AACA;;AACA;;AANA;AACA;AACA
|
|
1
|
+
{"version":3,"sources":["@wordpress/block-library/src/table-of-contents/index.js"],"names":["name","metadata","settings","icon","edit","save"],"mappings":";;;;;;;;;AAIA;;AACA;;AACA;;AANA;AACA;AACA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAMA,MAAM;AAAEA,EAAAA;AAAF,IAAWC,QAAjB;;AAIO,MAAMC,QAAQ,GAAG;AACvBC,EAAAA,IAAI,EAAJA,aADuB;AAEvBC,EAAAA,IAAI,EAAJA,aAFuB;AAGvBC,EAAAA,IAAI,EAAJA;AAHuB,CAAjB","sourcesContent":["/**\n * Internal dependencies\n */\nimport metadata from './block.json';\nimport edit from './edit';\nimport icon from './icon';\nimport save from './save';\n\nconst { name } = metadata;\n\nexport { metadata, name };\n\nexport const settings = {\n\ticon,\n\tedit,\n\tsave,\n};\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["@wordpress/block-library/src/list/index.js"],"names":["list","icon","deprecated","edit","save","transforms","settingsV2","name","metadata","settingsV1","example","attributes","values","merge","attributesToMerge","settings","process","env","IS_GUTENBERG_PLUGIN","window","__experimentalEnableListBlockV2"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,IAAI,IAAIC,IAAjB,QAA6B,kBAA7B;AAEA;AACA;AACA;;AACA,OAAOC,UAAP,MAAuB,cAAvB;AACA,OAAOC,IAAP,MAAiB,QAAjB
|
|
1
|
+
{"version":3,"sources":["@wordpress/block-library/src/list/index.js"],"names":["list","icon","deprecated","edit","save","transforms","settingsV2","name","metadata","settingsV1","example","attributes","values","merge","attributesToMerge","settings","process","env","IS_GUTENBERG_PLUGIN","window","__experimentalEnableListBlockV2"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,IAAI,IAAIC,IAAjB,QAA6B,kBAA7B;AAEA;AACA;AACA;;AACA,OAAOC,UAAP,MAAuB,cAAvB;AACA,OAAOC,IAAP,MAAiB,QAAjB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAEA,OAAOC,IAAP,MAAiB,QAAjB;AACA,OAAOC,UAAP,MAAuB,cAAvB;AACA,OAAOC,UAAP,MAAuB,MAAvB;AAEA,MAAM;AAAEC,EAAAA;AAAF,IAAWC,QAAjB;AAEA,SAASA,QAAT,EAAmBD,IAAnB,EAAyBD,UAAzB;AAEA,MAAMG,UAAU,GAAG;AAClBR,EAAAA,IADkB;AAElBS,EAAAA,OAAO,EAAE;AACRC,IAAAA,UAAU,EAAE;AACXC,MAAAA,MAAM,EAAE;AADG;AADJ,GAFS;AAOlBP,EAAAA,UAPkB;;AAQlBQ,EAAAA,KAAK,CAAEF,UAAF,EAAcG,iBAAd,EAAkC;AACtC,UAAM;AAAEF,MAAAA;AAAF,QAAaE,iBAAnB;;AAEA,QAAK,CAAEF,MAAF,IAAYA,MAAM,KAAK,WAA5B,EAA0C;AACzC,aAAOD,UAAP;AACA;;AAED,WAAO,EACN,GAAGA,UADG;AAENC,MAAAA,MAAM,EAAED,UAAU,CAACC,MAAX,GAAoBA;AAFtB,KAAP;AAIA,GAnBiB;;AAoBlBT,EAAAA,IApBkB;AAqBlBC,EAAAA,IArBkB;AAsBlBF,EAAAA;AAtBkB,CAAnB;AAyBA,IAAIa,QAAQ,GAAGN,UAAf;;AACA,IAAKO,OAAO,CAACC,GAAR,CAAYC,mBAAjB,EAAuC;AAAA;;AACtCH,EAAAA,QAAQ,GAAG,WAAAI,MAAM,UAAN,kCAAQC,+BAAR,GACRd,UADQ,GAERG,UAFH;AAGA;;AACD,SAASM,QAAT","sourcesContent":["/**\n * WordPress dependencies\n */\nimport { list as icon } from '@wordpress/icons';\n\n/**\n * Internal dependencies\n */\nimport deprecated from './deprecated';\nimport edit from './edit';\nimport metadata from './block.json';\nimport save from './save';\nimport transforms from './transforms';\nimport settingsV2 from './v2';\n\nconst { name } = metadata;\n\nexport { metadata, name, settingsV2 };\n\nconst settingsV1 = {\n\ticon,\n\texample: {\n\t\tattributes: {\n\t\t\tvalues: '<li>Alice.</li><li>The White Rabbit.</li><li>The Cheshire Cat.</li><li>The Mad Hatter.</li><li>The Queen of Hearts.</li>',\n\t\t},\n\t},\n\ttransforms,\n\tmerge( attributes, attributesToMerge ) {\n\t\tconst { values } = attributesToMerge;\n\n\t\tif ( ! values || values === '<li></li>' ) {\n\t\t\treturn attributes;\n\t\t}\n\n\t\treturn {\n\t\t\t...attributes,\n\t\t\tvalues: attributes.values + values,\n\t\t};\n\t},\n\tedit,\n\tsave,\n\tdeprecated,\n};\n\nlet settings = settingsV1;\nif ( process.env.IS_GUTENBERG_PLUGIN ) {\n\tsettings = window?.__experimentalEnableListBlockV2\n\t\t? settingsV2\n\t\t: settingsV1;\n}\nexport { settings };\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["@wordpress/block-library/src/list-item/utils.js"],"names":["createBlock","switchToBlockType","createListItem","listItemAttributes","listAttributes","children","listItemName","length","listName","convertToListItems","blocks","listItems","block","name","push","innerBlocks"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,WAAT,EAAsBC,iBAAtB,QAA+C,mBAA/C;AAEA;AACA;AACA
|
|
1
|
+
{"version":3,"sources":["@wordpress/block-library/src/list-item/utils.js"],"names":["createBlock","switchToBlockType","createListItem","listItemAttributes","listAttributes","children","listItemName","length","listName","convertToListItems","blocks","listItems","block","name","push","innerBlocks"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,WAAT,EAAsBC,iBAAtB,QAA+C,mBAA/C;AAEA;AACA;AACA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAIA,OAAO,SAASC,cAAT,CAAyBC,kBAAzB,EAA6CC,cAA7C,EAA6DC,QAA7D,EAAwE;AAC9E,SAAOL,WAAW,CACjBM,YADiB,EAEjBH,kBAFiB,EAGjB,EAAEE,QAAF,aAAEA,QAAF,eAAEA,QAAQ,CAAEE,MAAZ,IACG,EADH,GAEG,CAAEP,WAAW,CAAEQ,QAAF,EAAYJ,cAAZ,EAA4BC,QAA5B,CAAb,CALc,CAAlB;AAOA;AAED,OAAO,SAASI,kBAAT,CAA6BC,MAA7B,EAAsC;AAC5C,QAAMC,SAAS,GAAG,EAAlB;;AAEA,OAAM,IAAIC,KAAV,IAAmBF,MAAnB,EAA4B;AAC3B,QAAKE,KAAK,CAACC,IAAN,KAAeP,YAApB,EAAmC;AAClCK,MAAAA,SAAS,CAACG,IAAV,CAAgBF,KAAhB;AACA,KAFD,MAEO,IAAKA,KAAK,CAACC,IAAN,KAAeL,QAApB,EAA+B;AACrCG,MAAAA,SAAS,CAACG,IAAV,CAAgB,GAAGF,KAAK,CAACG,WAAzB;AACA,KAFM,MAEA,IAAOH,KAAK,GAAGX,iBAAiB,CAAEW,KAAF,EAASJ,QAAT,CAAhC,EAAwD;AAC9D,WAAM,MAAM;AAAEO,QAAAA;AAAF,OAAZ,IAA+BH,KAA/B,EAAuC;AACtCD,QAAAA,SAAS,CAACG,IAAV,CAAgB,GAAGC,WAAnB;AACA;AACD;AACD;;AAED,SAAOJ,SAAP;AACA","sourcesContent":["/**\n * WordPress dependencies\n */\nimport { createBlock, switchToBlockType } from '@wordpress/blocks';\n\n/**\n * Internal dependencies\n */\nimport { name as listItemName } from './block.json';\nimport { name as listName } from '../list/block.json';\n\nexport function createListItem( listItemAttributes, listAttributes, children ) {\n\treturn createBlock(\n\t\tlistItemName,\n\t\tlistItemAttributes,\n\t\t! children?.length\n\t\t\t? []\n\t\t\t: [ createBlock( listName, listAttributes, children ) ]\n\t);\n}\n\nexport function convertToListItems( blocks ) {\n\tconst listItems = [];\n\n\tfor ( let block of blocks ) {\n\t\tif ( block.name === listItemName ) {\n\t\t\tlistItems.push( block );\n\t\t} else if ( block.name === listName ) {\n\t\t\tlistItems.push( ...block.innerBlocks );\n\t\t} else if ( ( block = switchToBlockType( block, listName ) ) ) {\n\t\t\tfor ( const { innerBlocks } of block ) {\n\t\t\t\tlistItems.push( ...innerBlocks );\n\t\t\t}\n\t\t}\n\t}\n\n\treturn listItems;\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["@wordpress/block-library/src/media-text/index.js"],"names":["__","mediaAndText","icon","deprecated","edit","save","transforms","name","metadata","settings","example","viewportWidth","attributes","mediaType","mediaUrl","innerBlocks","content"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,EAAT,QAAmB,iBAAnB;AACA,SAASC,YAAY,IAAIC,IAAzB,QAAqC,kBAArC;AAEA;AACA;AACA;;AACA,OAAOC,UAAP,MAAuB,cAAvB;AACA,OAAOC,IAAP,MAAiB,QAAjB
|
|
1
|
+
{"version":3,"sources":["@wordpress/block-library/src/media-text/index.js"],"names":["__","mediaAndText","icon","deprecated","edit","save","transforms","name","metadata","settings","example","viewportWidth","attributes","mediaType","mediaUrl","innerBlocks","content"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,EAAT,QAAmB,iBAAnB;AACA,SAASC,YAAY,IAAIC,IAAzB,QAAqC,kBAArC;AAEA;AACA;AACA;;AACA,OAAOC,UAAP,MAAuB,cAAvB;AACA,OAAOC,IAAP,MAAiB,QAAjB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAEA,OAAOC,IAAP,MAAiB,QAAjB;AACA,OAAOC,UAAP,MAAuB,cAAvB;AAEA,MAAM;AAAEC,EAAAA;AAAF,IAAWC,QAAjB;AAEA,SAASA,QAAT,EAAmBD,IAAnB;AAEA,OAAO,MAAME,QAAQ,GAAG;AACvBP,EAAAA,IADuB;AAEvBQ,EAAAA,OAAO,EAAE;AACRC,IAAAA,aAAa,EAAE,GADP;AACY;AACpBC,IAAAA,UAAU,EAAE;AACXC,MAAAA,SAAS,EAAE,OADA;AAEXC,MAAAA,QAAQ,EACP;AAHU,KAFJ;AAORC,IAAAA,WAAW,EAAE,CACZ;AACCR,MAAAA,IAAI,EAAE,gBADP;AAECK,MAAAA,UAAU,EAAE;AACXI,QAAAA,OAAO,EAAEhB,EAAE,CACV,8CADU;AADA;AAFb,KADY,EASZ;AACCO,MAAAA,IAAI,EAAE,gBADP;AAECK,MAAAA,UAAU,EAAE;AACXI,QAAAA,OAAO,EAAEhB,EAAE,CAAE,uBAAF;AADA;AAFb,KATY;AAPL,GAFc;AA0BvBM,EAAAA,UA1BuB;AA2BvBF,EAAAA,IA3BuB;AA4BvBC,EAAAA,IA5BuB;AA6BvBF,EAAAA;AA7BuB,CAAjB","sourcesContent":["/**\n * WordPress dependencies\n */\nimport { __ } from '@wordpress/i18n';\nimport { mediaAndText as icon } from '@wordpress/icons';\n\n/**\n * Internal dependencies\n */\nimport deprecated from './deprecated';\nimport edit from './edit';\nimport metadata from './block.json';\nimport save from './save';\nimport transforms from './transforms';\n\nconst { name } = metadata;\n\nexport { metadata, name };\n\nexport const settings = {\n\ticon,\n\texample: {\n\t\tviewportWidth: 601, // Columns collapse \"@media (max-width: 600px)\".\n\t\tattributes: {\n\t\t\tmediaType: 'image',\n\t\t\tmediaUrl:\n\t\t\t\t'https://s.w.org/images/core/5.3/Biologia_Centrali-Americana_-_Cantorchilus_semibadius_1902.jpg',\n\t\t},\n\t\tinnerBlocks: [\n\t\t\t{\n\t\t\t\tname: 'core/paragraph',\n\t\t\t\tattributes: {\n\t\t\t\t\tcontent: __(\n\t\t\t\t\t\t'The wren<br>Earns his living<br>Noiselessly.'\n\t\t\t\t\t),\n\t\t\t\t},\n\t\t\t},\n\t\t\t{\n\t\t\t\tname: 'core/paragraph',\n\t\t\t\tattributes: {\n\t\t\t\t\tcontent: __( '— Kobayashi Issa (一茶)' ),\n\t\t\t\t},\n\t\t\t},\n\t\t],\n\t},\n\ttransforms,\n\tedit,\n\tsave,\n\tdeprecated,\n};\n"]}
|
|
@@ -103,6 +103,7 @@ const metadata = {
|
|
|
103
103
|
__experimentalFontWeight: true,
|
|
104
104
|
__experimentalTextTransform: true,
|
|
105
105
|
__experimentalFontFamily: true,
|
|
106
|
+
__experimentalLetterSpacing: true,
|
|
106
107
|
__experimentalTextDecoration: true,
|
|
107
108
|
__experimentalSkipSerialization: ["textDecoration"],
|
|
108
109
|
__experimentalDefaultControls: {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["@wordpress/block-library/src/navigation/index.js"],"names":["__","navigation","icon","edit","save","deprecated","name","metadata","settings","example","innerBlocks","attributes","label","url"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,EAAT,QAAmB,iBAAnB;AACA,SAASC,UAAU,IAAIC,IAAvB,QAAmC,kBAAnC;AAEA;AACA;AACA
|
|
1
|
+
{"version":3,"sources":["@wordpress/block-library/src/navigation/index.js"],"names":["__","navigation","icon","edit","save","deprecated","name","metadata","settings","example","innerBlocks","attributes","label","url"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,EAAT,QAAmB,iBAAnB;AACA,SAASC,UAAU,IAAIC,IAAvB,QAAmC,kBAAnC;AAEA;AACA;AACA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAEA,OAAOC,IAAP,MAAiB,QAAjB;AACA,OAAOC,IAAP,MAAiB,QAAjB;AACA,OAAOC,UAAP,MAAuB,cAAvB;AAEA,MAAM;AAAEC,EAAAA;AAAF,IAAWC,QAAjB;AAEA,SAASA,QAAT,EAAmBD,IAAnB;AAEA,OAAO,MAAME,QAAQ,GAAG;AACvBN,EAAAA,IADuB;AAEvBO,EAAAA,OAAO,EAAE;AACRC,IAAAA,WAAW,EAAE,CACZ;AACCJ,MAAAA,IAAI,EAAE,sBADP;AAECK,MAAAA,UAAU,EAAE;AACX;AACAC,QAAAA,KAAK,EAAEZ,EAAE,CAAE,MAAF,CAFE;AAGXa,QAAAA,GAAG,EAAE;AAHM;AAFb,KADY,EASZ;AACCP,MAAAA,IAAI,EAAE,sBADP;AAECK,MAAAA,UAAU,EAAE;AACX;AACAC,QAAAA,KAAK,EAAEZ,EAAE,CAAE,OAAF,CAFE;AAGXa,QAAAA,GAAG,EAAE;AAHM;AAFb,KATY,EAiBZ;AACCP,MAAAA,IAAI,EAAE,sBADP;AAECK,MAAAA,UAAU,EAAE;AACX;AACAC,QAAAA,KAAK,EAAEZ,EAAE,CAAE,SAAF,CAFE;AAGXa,QAAAA,GAAG,EAAE;AAHM;AAFb,KAjBY;AADL,GAFc;AA8BvBV,EAAAA,IA9BuB;AA+BvBC,EAAAA,IA/BuB;AAgCvBC,EAAAA;AAhCuB,CAAjB","sourcesContent":["/**\n * WordPress dependencies\n */\nimport { __ } from '@wordpress/i18n';\nimport { navigation as icon } from '@wordpress/icons';\n\n/**\n * Internal dependencies\n */\nimport metadata from './block.json';\nimport edit from './edit';\nimport save from './save';\nimport deprecated from './deprecated';\n\nconst { name } = metadata;\n\nexport { metadata, name };\n\nexport const settings = {\n\ticon,\n\texample: {\n\t\tinnerBlocks: [\n\t\t\t{\n\t\t\t\tname: 'core/navigation-link',\n\t\t\t\tattributes: {\n\t\t\t\t\t// translators: 'Home' as in a website's home page.\n\t\t\t\t\tlabel: __( 'Home' ),\n\t\t\t\t\turl: 'https://make.wordpress.org/',\n\t\t\t\t},\n\t\t\t},\n\t\t\t{\n\t\t\t\tname: 'core/navigation-link',\n\t\t\t\tattributes: {\n\t\t\t\t\t// translators: 'About' as in a website's about page.\n\t\t\t\t\tlabel: __( 'About' ),\n\t\t\t\t\turl: 'https://make.wordpress.org/',\n\t\t\t\t},\n\t\t\t},\n\t\t\t{\n\t\t\t\tname: 'core/navigation-link',\n\t\t\t\tattributes: {\n\t\t\t\t\t// translators: 'Contact' as in a website's contact page.\n\t\t\t\t\tlabel: __( 'Contact' ),\n\t\t\t\t\turl: 'https://make.wordpress.org/',\n\t\t\t\t},\n\t\t\t},\n\t\t],\n\t},\n\tedit,\n\tsave,\n\tdeprecated,\n};\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["@wordpress/block-library/src/paragraph/index.js"],"names":["isEmpty","__","paragraph","icon","deprecated","edit","save","transforms","name","metadata","settings","example","attributes","content","style","typography","fontSize","dropCap","__experimentalLabel","context","merge","attributesToMerge"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,OAAT,QAAwB,QAAxB;AAEA;AACA;AACA;;AACA,SAASC,EAAT,QAAmB,iBAAnB;AACA,SAASC,SAAS,IAAIC,IAAtB,QAAkC,kBAAlC;AAEA;AACA;AACA;;AACA,OAAOC,UAAP,MAAuB,cAAvB;AACA,OAAOC,IAAP,MAAiB,QAAjB
|
|
1
|
+
{"version":3,"sources":["@wordpress/block-library/src/paragraph/index.js"],"names":["isEmpty","__","paragraph","icon","deprecated","edit","save","transforms","name","metadata","settings","example","attributes","content","style","typography","fontSize","dropCap","__experimentalLabel","context","merge","attributesToMerge"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,OAAT,QAAwB,QAAxB;AAEA;AACA;AACA;;AACA,SAASC,EAAT,QAAmB,iBAAnB;AACA,SAASC,SAAS,IAAIC,IAAtB,QAAkC,kBAAlC;AAEA;AACA;AACA;;AACA,OAAOC,UAAP,MAAuB,cAAvB;AACA,OAAOC,IAAP,MAAiB,QAAjB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAEA,OAAOC,IAAP,MAAiB,QAAjB;AACA,OAAOC,UAAP,MAAuB,cAAvB;AAEA,MAAM;AAAEC,EAAAA;AAAF,IAAWC,QAAjB;AAEA,SAASA,QAAT,EAAmBD,IAAnB;AAEA,OAAO,MAAME,QAAQ,GAAG;AACvBP,EAAAA,IADuB;AAEvBQ,EAAAA,OAAO,EAAE;AACRC,IAAAA,UAAU,EAAE;AACXC,MAAAA,OAAO,EAAEZ,EAAE,CACV,kOADU,CADA;AAIXa,MAAAA,KAAK,EAAE;AACNC,QAAAA,UAAU,EAAE;AACXC,UAAAA,QAAQ,EAAE;AADC;AADN,OAJI;AASXC,MAAAA,OAAO,EAAE;AATE;AADJ,GAFc;;AAevBC,EAAAA,mBAAmB,CAAEN,UAAF,QAA4B;AAAA,QAAd;AAAEO,MAAAA;AAAF,KAAc;;AAC9C,QAAKA,OAAO,KAAK,eAAjB,EAAmC;AAClC,YAAM;AAAEN,QAAAA;AAAF,UAAcD,UAApB;AACA,aAAOZ,OAAO,CAAEa,OAAF,CAAP,GAAqBZ,EAAE,CAAE,OAAF,CAAvB,GAAqCY,OAA5C;AACA;AACD,GApBsB;;AAqBvBN,EAAAA,UArBuB;AAsBvBH,EAAAA,UAtBuB;;AAuBvBgB,EAAAA,KAAK,CAAER,UAAF,EAAcS,iBAAd,EAAkC;AACtC,WAAO;AACNR,MAAAA,OAAO,EACN,CAAED,UAAU,CAACC,OAAX,IAAsB,EAAxB,KACEQ,iBAAiB,CAACR,OAAlB,IAA6B,EAD/B;AAFK,KAAP;AAKA,GA7BsB;;AA8BvBR,EAAAA,IA9BuB;AA+BvBC,EAAAA;AA/BuB,CAAjB","sourcesContent":["/**\n * External dependencies\n */\nimport { isEmpty } from 'lodash';\n\n/**\n * WordPress dependencies\n */\nimport { __ } from '@wordpress/i18n';\nimport { paragraph as icon } from '@wordpress/icons';\n\n/**\n * Internal dependencies\n */\nimport deprecated from './deprecated';\nimport edit from './edit';\nimport metadata from './block.json';\nimport save from './save';\nimport transforms from './transforms';\n\nconst { name } = metadata;\n\nexport { metadata, name };\n\nexport const settings = {\n\ticon,\n\texample: {\n\t\tattributes: {\n\t\t\tcontent: __(\n\t\t\t\t'In a village of La Mancha, the name of which I have no desire to call to mind, there lived not long since one of those gentlemen that keep a lance in the lance-rack, an old buckler, a lean hack, and a greyhound for coursing.'\n\t\t\t),\n\t\t\tstyle: {\n\t\t\t\ttypography: {\n\t\t\t\t\tfontSize: 28,\n\t\t\t\t},\n\t\t\t},\n\t\t\tdropCap: true,\n\t\t},\n\t},\n\t__experimentalLabel( attributes, { context } ) {\n\t\tif ( context === 'accessibility' ) {\n\t\t\tconst { content } = attributes;\n\t\t\treturn isEmpty( content ) ? __( 'Empty' ) : content;\n\t\t}\n\t},\n\ttransforms,\n\tdeprecated,\n\tmerge( attributes, attributesToMerge ) {\n\t\treturn {\n\t\t\tcontent:\n\t\t\t\t( attributes.content || '' ) +\n\t\t\t\t( attributesToMerge.content || '' ),\n\t\t};\n\t},\n\tedit,\n\tsave,\n};\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["@wordpress/block-library/src/paragraph/transforms.js"],"names":["createBlock","getBlockAttributes","transforms","from","type","priority","selector","schema","phrasingContentSchema","isPaste","p","children","attributes","transform","node","name","outerHTML","textAlign","style","align"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,WAAT,EAAsBC,kBAAtB,QAAgD,mBAAhD;AAEA;AACA;AACA
|
|
1
|
+
{"version":3,"sources":["@wordpress/block-library/src/paragraph/transforms.js"],"names":["createBlock","getBlockAttributes","transforms","from","type","priority","selector","schema","phrasingContentSchema","isPaste","p","children","attributes","transform","node","name","outerHTML","textAlign","style","align"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,WAAT,EAAsBC,kBAAtB,QAAgD,mBAAhD;AAEA;AACA;AACA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAGA,MAAMC,UAAU,GAAG;AAClBC,EAAAA,IAAI,EAAE,CACL;AACCC,IAAAA,IAAI,EAAE,KADP;AAEC;AACAC,IAAAA,QAAQ,EAAE,EAHX;AAICC,IAAAA,QAAQ,EAAE,GAJX;AAKCC,IAAAA,MAAM,EAAE;AAAA,UAAE;AAAEC,QAAAA,qBAAF;AAAyBC,QAAAA;AAAzB,OAAF;AAAA,aAA4C;AACnDC,QAAAA,CAAC,EAAE;AACFC,UAAAA,QAAQ,EAAEH,qBADR;AAEFI,UAAAA,UAAU,EAAEH,OAAO,GAAG,EAAH,GAAQ,CAAE,OAAF,EAAW,IAAX;AAFzB;AADgD,OAA5C;AAAA,KALT;;AAWCI,IAAAA,SAAS,CAAEC,IAAF,EAAS;AACjB,YAAMF,UAAU,GAAGX,kBAAkB,CAAEc,IAAF,EAAQD,IAAI,CAACE,SAAb,CAArC;AACA,YAAM;AAAEC,QAAAA;AAAF,UAAgBH,IAAI,CAACI,KAAL,IAAc,EAApC;;AAEA,UACCD,SAAS,KAAK,MAAd,IACAA,SAAS,KAAK,QADd,IAEAA,SAAS,KAAK,OAHf,EAIE;AACDL,QAAAA,UAAU,CAACO,KAAX,GAAmBF,SAAnB;AACA;;AAED,aAAOjB,WAAW,CAAEe,IAAF,EAAQH,UAAR,CAAlB;AACA;;AAxBF,GADK;AADY,CAAnB;AA+BA,eAAeV,UAAf","sourcesContent":["/**\n * WordPress dependencies\n */\nimport { createBlock, getBlockAttributes } from '@wordpress/blocks';\n\n/**\n * Internal dependencies\n */\nimport { name } from './block.json';\n\nconst transforms = {\n\tfrom: [\n\t\t{\n\t\t\ttype: 'raw',\n\t\t\t// Paragraph is a fallback and should be matched last.\n\t\t\tpriority: 20,\n\t\t\tselector: 'p',\n\t\t\tschema: ( { phrasingContentSchema, isPaste } ) => ( {\n\t\t\t\tp: {\n\t\t\t\t\tchildren: phrasingContentSchema,\n\t\t\t\t\tattributes: isPaste ? [] : [ 'style', 'id' ],\n\t\t\t\t},\n\t\t\t} ),\n\t\t\ttransform( node ) {\n\t\t\t\tconst attributes = getBlockAttributes( name, node.outerHTML );\n\t\t\t\tconst { textAlign } = node.style || {};\n\n\t\t\t\tif (\n\t\t\t\t\ttextAlign === 'left' ||\n\t\t\t\t\ttextAlign === 'center' ||\n\t\t\t\t\ttextAlign === 'right'\n\t\t\t\t) {\n\t\t\t\t\tattributes.align = textAlign;\n\t\t\t\t}\n\n\t\t\t\treturn createBlock( name, attributes );\n\t\t\t},\n\t\t},\n\t],\n};\n\nexport default transforms;\n"]}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import
|
|
1
|
+
import _extends from "@babel/runtime/helpers/esm/extends";
|
|
2
|
+
import { createElement, Fragment } from "@wordpress/element";
|
|
2
3
|
|
|
3
4
|
/**
|
|
4
5
|
* External dependencies
|
|
@@ -9,8 +10,8 @@ import classNames from 'classnames';
|
|
|
9
10
|
*/
|
|
10
11
|
|
|
11
12
|
import { getBlockSupport } from '@wordpress/blocks';
|
|
12
|
-
import {
|
|
13
|
-
import { BlockControls, useInnerBlocksProps, useBlockProps, InspectorControls, ContrastChecker,
|
|
13
|
+
import { useEffect, useRef } from '@wordpress/element';
|
|
14
|
+
import { BlockControls, useInnerBlocksProps, useBlockProps, InspectorControls, ContrastChecker, withColors, __experimentalColorGradientSettingsDropdown as ColorGradientSettingsDropdown, __experimentalUseMultipleOriginColorsAndGradients as useMultipleOriginColorsAndGradients } from '@wordpress/block-editor';
|
|
14
15
|
import { MenuGroup, MenuItem, PanelBody, ToggleControl, ToolbarDropdownMenu } from '@wordpress/components';
|
|
15
16
|
import { __ } from '@wordpress/i18n';
|
|
16
17
|
import { check } from '@wordpress/icons';
|
|
@@ -38,6 +39,7 @@ export function SocialLinksEdit(props) {
|
|
|
38
39
|
var _attributes$className;
|
|
39
40
|
|
|
40
41
|
const {
|
|
42
|
+
clientId,
|
|
41
43
|
name,
|
|
42
44
|
attributes,
|
|
43
45
|
iconBackgroundColor,
|
|
@@ -122,7 +124,13 @@ export function SocialLinksEdit(props) {
|
|
|
122
124
|
iconColorValue: colorValue
|
|
123
125
|
});
|
|
124
126
|
},
|
|
125
|
-
label: __('Icon color')
|
|
127
|
+
label: __('Icon color'),
|
|
128
|
+
resetAllFilter: () => {
|
|
129
|
+
setIconColor(undefined);
|
|
130
|
+
setAttributes({
|
|
131
|
+
iconColorValue: undefined
|
|
132
|
+
});
|
|
133
|
+
}
|
|
126
134
|
}];
|
|
127
135
|
|
|
128
136
|
if (!logosOnly) {
|
|
@@ -136,10 +144,17 @@ export function SocialLinksEdit(props) {
|
|
|
136
144
|
iconBackgroundColorValue: colorValue
|
|
137
145
|
});
|
|
138
146
|
},
|
|
139
|
-
label: __('Icon background')
|
|
147
|
+
label: __('Icon background'),
|
|
148
|
+
resetAllFilter: () => {
|
|
149
|
+
setIconBackgroundColor(undefined);
|
|
150
|
+
setAttributes({
|
|
151
|
+
iconBackgroundColorValue: undefined
|
|
152
|
+
});
|
|
153
|
+
}
|
|
140
154
|
});
|
|
141
155
|
}
|
|
142
156
|
|
|
157
|
+
const colorGradientSettings = useMultipleOriginColorsAndGradients();
|
|
143
158
|
return createElement(Fragment, null, createElement(BlockControls, {
|
|
144
159
|
group: "other"
|
|
145
160
|
}, createElement(ToolbarDropdownMenu, {
|
|
@@ -179,17 +194,34 @@ export function SocialLinksEdit(props) {
|
|
|
179
194
|
onChange: () => setAttributes({
|
|
180
195
|
showLabels: !showLabels
|
|
181
196
|
})
|
|
182
|
-
})), createElement(
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
197
|
+
}))), createElement(InspectorControls, {
|
|
198
|
+
__experimentalGroup: "color"
|
|
199
|
+
}, colorSettings.map(_ref2 => {
|
|
200
|
+
let {
|
|
201
|
+
onChange,
|
|
202
|
+
label,
|
|
203
|
+
value,
|
|
204
|
+
resetAllFilter
|
|
205
|
+
} = _ref2;
|
|
206
|
+
return createElement(ColorGradientSettingsDropdown, _extends({
|
|
207
|
+
key: `social-links-color-${label}`,
|
|
208
|
+
__experimentalHasMultipleOrigins: true,
|
|
209
|
+
__experimentalIsRenderedInSidebar: true,
|
|
210
|
+
settings: [{
|
|
211
|
+
colorValue: value,
|
|
212
|
+
label,
|
|
213
|
+
onColorChange: onChange,
|
|
214
|
+
isShownByDefault: true,
|
|
215
|
+
resetAllFilter,
|
|
216
|
+
enableAlpha: true
|
|
217
|
+
}],
|
|
218
|
+
panelId: clientId
|
|
219
|
+
}, colorGradientSettings));
|
|
220
|
+
}), !logosOnly && createElement(ContrastChecker, {
|
|
189
221
|
textColor: iconColorValue,
|
|
190
222
|
backgroundColor: iconBackgroundColorValue,
|
|
191
223
|
isLargeText: false
|
|
192
|
-
}))
|
|
224
|
+
})), createElement("ul", innerBlocksProps));
|
|
193
225
|
}
|
|
194
226
|
const iconColorAttributes = {
|
|
195
227
|
iconColor: 'icon-color',
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["@wordpress/block-library/src/social-links/edit.js"],"names":["classNames","getBlockSupport","Fragment","useEffect","useRef","BlockControls","useInnerBlocksProps","useBlockProps","InspectorControls","ContrastChecker","PanelColorSettings","withColors","MenuGroup","MenuItem","PanelBody","ToggleControl","ToolbarDropdownMenu","__","check","ALLOWED_BLOCKS","sizeOptions","name","value","getDefaultBlockLayout","blockTypeOrName","layoutBlockSupportConfig","default","SocialLinksEdit","props","attributes","iconBackgroundColor","iconColor","isSelected","setAttributes","setIconBackgroundColor","setIconColor","iconBackgroundColorValue","customIconBackgroundColor","iconColorValue","openInNewTab","showLabels","size","layout","usedLayout","logosOnly","className","includes","backgroundBackup","current","undefined","SocialPlaceholder","SelectedSocialPlaceholder","color","blockProps","innerBlocksProps","allowedBlocks","placeholder","templateLock","__experimentalAppenderTagName","__experimentalLayout","POPOVER_PROPS","position","colorSettings","onChange","colorValue","label","push","onClose","map","entry","textColor","backgroundColor","iconColorAttributes"],"mappings":";;AAAA;AACA;AACA;AACA,OAAOA,UAAP,MAAuB,YAAvB;AAEA;AACA;AACA;;AACA,SAASC,eAAT,QAAgC,mBAAhC;AACA,SAASC,QAAT,EAAmBC,SAAnB,EAA8BC,MAA9B,QAA4C,oBAA5C;AACA,SACCC,aADD,EAECC,mBAFD,EAGCC,aAHD,EAICC,iBAJD,EAKCC,eALD,EAMCC,kBAND,EAOCC,UAPD,QAQO,yBARP;AASA,SACCC,SADD,EAECC,QAFD,EAGCC,SAHD,EAICC,aAJD,EAKCC,mBALD,QAMO,uBANP;AAOA,SAASC,EAAT,QAAmB,iBAAnB;AACA,SAASC,KAAT,QAAsB,kBAAtB;AAEA,MAAMC,cAAc,GAAG,CAAE,kBAAF,CAAvB;AAEA,MAAMC,WAAW,GAAG,CACnB;AAAEC,EAAAA,IAAI,EAAEJ,EAAE,CAAE,OAAF,CAAV;AAAuBK,EAAAA,KAAK,EAAE;AAA9B,CADmB,EAEnB;AAAED,EAAAA,IAAI,EAAEJ,EAAE,CAAE,QAAF,CAAV;AAAwBK,EAAAA,KAAK,EAAE;AAA/B,CAFmB,EAGnB;AAAED,EAAAA,IAAI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EAyEC,oBAASkB,gBAAT,CAzED,CADD;AA6EA;AAED,MAAMkB,mBAAmB,GAAG;AAC3BzC,EAAAA,SAAS,EAAE,YADgB;AAE3BD,EAAAA,mBAAmB,EAAE;AAFM,CAA5B;AAKA,eAAenB,UAAU,CAAE6D,mBAAF,CAAV,CAAmC7C,eAAnC,CAAf","sourcesContent":["/**\n * External dependencies\n */\nimport classNames from 'classnames';\n\n/**\n * WordPress dependencies\n */\nimport { getBlockSupport } from '@wordpress/blocks';\nimport { Fragment, useEffect, useRef } from '@wordpress/element';\nimport {\n\tBlockControls,\n\tuseInnerBlocksProps,\n\tuseBlockProps,\n\tInspectorControls,\n\tContrastChecker,\n\tPanelColorSettings,\n\twithColors,\n} from '@wordpress/block-editor';\nimport {\n\tMenuGroup,\n\tMenuItem,\n\tPanelBody,\n\tToggleControl,\n\tToolbarDropdownMenu,\n} from '@wordpress/components';\nimport { __ } from '@wordpress/i18n';\nimport { check } from '@wordpress/icons';\n\nconst ALLOWED_BLOCKS = [ 'core/social-link' ];\n\nconst sizeOptions = [\n\t{ name: __( 'Small' ), value: 'has-small-icon-size' },\n\t{ name: __( 'Normal' ), value: 'has-normal-icon-size' },\n\t{ name: __( 'Large' ), value: 'has-large-icon-size' },\n\t{ name: __( 'Huge' ), value: 'has-huge-icon-size' },\n];\n\nconst getDefaultBlockLayout = ( blockTypeOrName ) => {\n\tconst layoutBlockSupportConfig = getBlockSupport(\n\t\tblockTypeOrName,\n\t\t'__experimentalLayout'\n\t);\n\treturn layoutBlockSupportConfig?.default;\n};\n\nexport function SocialLinksEdit( props ) {\n\tconst {\n\t\tname,\n\t\tattributes,\n\t\ticonBackgroundColor,\n\t\ticonColor,\n\t\tisSelected,\n\t\tsetAttributes,\n\t\tsetIconBackgroundColor,\n\t\tsetIconColor,\n\t} = props;\n\n\tconst {\n\t\ticonBackgroundColorValue,\n\t\tcustomIconBackgroundColor,\n\t\ticonColorValue,\n\t\topenInNewTab,\n\t\tshowLabels,\n\t\tsize,\n\t\tlayout,\n\t} = attributes;\n\tconst usedLayout = layout || getDefaultBlockLayout( name );\n\n\tconst logosOnly = attributes.className?.includes( 'is-style-logos-only' );\n\n\t// Remove icon background color when logos only style is selected or\n\t// restore it when any other style is selected.\n\tconst backgroundBackup = useRef( {} );\n\tuseEffect( () => {\n\t\tif ( logosOnly ) {\n\t\t\tbackgroundBackup.current = {\n\t\t\t\ticonBackgroundColor,\n\t\t\t\ticonBackgroundColorValue,\n\t\t\t\tcustomIconBackgroundColor,\n\t\t\t};\n\t\t\tsetAttributes( {\n\t\t\t\ticonBackgroundColor: undefined,\n\t\t\t\tcustomIconBackgroundColor: undefined,\n\t\t\t\ticonBackgroundColorValue: undefined,\n\t\t\t} );\n\t\t} else {\n\t\t\tsetAttributes( { ...backgroundBackup.current } );\n\t\t}\n\t}, [ logosOnly ] );\n\n\tconst SocialPlaceholder = (\n\t\t<li className=\"wp-block-social-links__social-placeholder\">\n\t\t\t<div className=\"wp-block-social-links__social-placeholder-icons\">\n\t\t\t\t<div className=\"wp-social-link wp-social-link-twitter\"></div>\n\t\t\t\t<div className=\"wp-social-link wp-social-link-facebook\"></div>\n\t\t\t\t<div className=\"wp-social-link wp-social-link-instagram\"></div>\n\t\t\t</div>\n\t\t</li>\n\t);\n\n\tconst SelectedSocialPlaceholder = (\n\t\t<li className=\"wp-block-social-links__social-prompt\">\n\t\t\t{ __( 'Click plus to add' ) }\n\t\t</li>\n\t);\n\n\t// Fallback color values are used maintain selections in case switching\n\t// themes and named colors in palette do not match.\n\tconst className = classNames( size, {\n\t\t'has-visible-labels': showLabels,\n\t\t'has-icon-color': iconColor.color || iconColorValue,\n\t\t'has-icon-background-color':\n\t\t\ticonBackgroundColor.color || iconBackgroundColorValue,\n\t} );\n\n\tconst blockProps = useBlockProps( { className } );\n\tconst innerBlocksProps = useInnerBlocksProps( blockProps, {\n\t\tallowedBlocks: ALLOWED_BLOCKS,\n\t\tplaceholder: isSelected ? SelectedSocialPlaceholder : SocialPlaceholder,\n\t\ttemplateLock: false,\n\t\t__experimentalAppenderTagName: 'li',\n\t\t__experimentalLayout: usedLayout,\n\t} );\n\n\tconst POPOVER_PROPS = {\n\t\tposition: 'bottom right',\n\t};\n\n\tconst colorSettings = [\n\t\t{\n\t\t\t// Use custom attribute as fallback to prevent loss of named color selection when\n\t\t\t// switching themes to a new theme that does not have a matching named color.\n\t\t\tvalue: iconColor.color || iconColorValue,\n\t\t\tonChange: ( colorValue ) => {\n\t\t\t\tsetIconColor( colorValue );\n\t\t\t\tsetAttributes( { iconColorValue: colorValue } );\n\t\t\t},\n\t\t\tlabel: __( 'Icon color' ),\n\t\t},\n\t];\n\n\tif ( ! logosOnly ) {\n\t\tcolorSettings.push( {\n\t\t\t// Use custom attribute as fallback to prevent loss of named color selection when\n\t\t\t// switching themes to a new theme that does not have a matching named color.\n\t\t\tvalue: iconBackgroundColor.color || iconBackgroundColorValue,\n\t\t\tonChange: ( colorValue ) => {\n\t\t\t\tsetIconBackgroundColor( colorValue );\n\t\t\t\tsetAttributes( {\n\t\t\t\t\ticonBackgroundColorValue: colorValue,\n\t\t\t\t} );\n\t\t\t},\n\t\t\tlabel: __( 'Icon background' ),\n\t\t} );\n\t}\n\n\treturn (\n\t\t<Fragment>\n\t\t\t<BlockControls group=\"other\">\n\t\t\t\t<ToolbarDropdownMenu\n\t\t\t\t\tlabel={ __( 'Size' ) }\n\t\t\t\t\ttext={ __( 'Size' ) }\n\t\t\t\t\ticon={ null }\n\t\t\t\t\tpopoverProps={ POPOVER_PROPS }\n\t\t\t\t>\n\t\t\t\t\t{ ( { onClose } ) => (\n\t\t\t\t\t\t<MenuGroup>\n\t\t\t\t\t\t\t{ sizeOptions.map( ( entry ) => {\n\t\t\t\t\t\t\t\treturn (\n\t\t\t\t\t\t\t\t\t<MenuItem\n\t\t\t\t\t\t\t\t\t\ticon={\n\t\t\t\t\t\t\t\t\t\t\t( size === entry.value ||\n\t\t\t\t\t\t\t\t\t\t\t\t( ! size &&\n\t\t\t\t\t\t\t\t\t\t\t\t\tentry.value ===\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t'has-normal-icon-size' ) ) &&\n\t\t\t\t\t\t\t\t\t\t\tcheck\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\tisSelected={ size === entry.value }\n\t\t\t\t\t\t\t\t\t\tkey={ entry.value }\n\t\t\t\t\t\t\t\t\t\tonClick={ () => {\n\t\t\t\t\t\t\t\t\t\t\tsetAttributes( {\n\t\t\t\t\t\t\t\t\t\t\t\tsize: entry.value,\n\t\t\t\t\t\t\t\t\t\t\t} );\n\t\t\t\t\t\t\t\t\t\t} }\n\t\t\t\t\t\t\t\t\t\tonClose={ onClose }\n\t\t\t\t\t\t\t\t\t\trole=\"menuitemradio\"\n\t\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t\t{ entry.name }\n\t\t\t\t\t\t\t\t\t</MenuItem>\n\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t} ) }\n\t\t\t\t\t\t</MenuGroup>\n\t\t\t\t\t) }\n\t\t\t\t</ToolbarDropdownMenu>\n\t\t\t</BlockControls>\n\t\t\t<InspectorControls>\n\t\t\t\t<PanelBody title={ __( 'Link settings' ) }>\n\t\t\t\t\t<ToggleControl\n\t\t\t\t\t\tlabel={ __( 'Open links in new tab' ) }\n\t\t\t\t\t\tchecked={ openInNewTab }\n\t\t\t\t\t\tonChange={ () =>\n\t\t\t\t\t\t\tsetAttributes( { openInNewTab: ! openInNewTab } )\n\t\t\t\t\t\t}\n\t\t\t\t\t/>\n\t\t\t\t\t<ToggleControl\n\t\t\t\t\t\tlabel={ __( 'Show labels' ) }\n\t\t\t\t\t\tchecked={ showLabels }\n\t\t\t\t\t\tonChange={ () =>\n\t\t\t\t\t\t\tsetAttributes( { showLabels: ! showLabels } )\n\t\t\t\t\t\t}\n\t\t\t\t\t/>\n\t\t\t\t</PanelBody>\n\t\t\t\t<PanelColorSettings\n\t\t\t\t\t__experimentalHasMultipleOrigins\n\t\t\t\t\t__experimentalIsRenderedInSidebar\n\t\t\t\t\ttitle={ __( 'Color' ) }\n\t\t\t\t\tcolorSettings={ colorSettings }\n\t\t\t\t\tenableAlpha\n\t\t\t\t>\n\t\t\t\t\t{ ! logosOnly && (\n\t\t\t\t\t\t<ContrastChecker\n\t\t\t\t\t\t\t{ ...{\n\t\t\t\t\t\t\t\ttextColor: iconColorValue,\n\t\t\t\t\t\t\t\tbackgroundColor: iconBackgroundColorValue,\n\t\t\t\t\t\t\t} }\n\t\t\t\t\t\t\tisLargeText={ false }\n\t\t\t\t\t\t/>\n\t\t\t\t\t) }\n\t\t\t\t</PanelColorSettings>\n\t\t\t</InspectorControls>\n\t\t\t<ul { ...innerBlocksProps } />\n\t\t</Fragment>\n\t);\n}\n\nconst iconColorAttributes = {\n\ticonColor: 'icon-color',\n\ticonBackgroundColor: 'icon-background-color',\n};\n\nexport default withColors( iconColorAttributes )( SocialLinksEdit );\n"]}
|
|
1
|
+
{"version":3,"sources":["@wordpress/block-library/src/social-links/edit.js"],"names":["classNames","getBlockSupport","useEffect","useRef","BlockControls","useInnerBlocksProps","useBlockProps","InspectorControls","ContrastChecker","withColors","__experimentalColorGradientSettingsDropdown","ColorGradientSettingsDropdown","__experimentalUseMultipleOriginColorsAndGradients","useMultipleOriginColorsAndGradients","MenuGroup","MenuItem","PanelBody","ToggleControl","ToolbarDropdownMenu","__","check","ALLOWED_BLOCKS","sizeOptions","name","value","getDefaultBlockLayout","blockTypeOrName","layoutBlockSupportConfig","default","SocialLinksEdit","props","clientId","attributes","iconBackgroundColor","iconColor","isSelected","setAttributes","setIconBackgroundColor","setIconColor","iconBackgroundColorValue","customIconBackgroundColor","iconColorValue","openInNewTab","showLabels","size","layout","usedLayout","logosOnly","className","includes","backgroundBackup","current","undefined","SocialPlaceholder","SelectedSocialPlaceholder","color","blockProps","innerBlocksProps","allowedBlocks","placeholder","templateLock","__experimentalAppenderTagName","__experimentalLayout","POPOVER_PROPS","position","colorSettings","onChange","colorValue","label","resetAllFilter","push","colorGradientSettings","onClose","map","entry","onColorChange","isShownByDefault","enableAlpha","textColor","backgroundColor","iconColorAttributes"],"mappings":";;;AAAA;AACA;AACA;AACA,OAAOA,UAAP,MAAuB,YAAvB;AAEA;AACA;AACA;;AACA,SAASC,eAAT,QAAgC,mBAAhC;AACA,SAASC,SAAT,EAAoBC,MAApB,QAAkC,oBAAlC;AACA,SACCC,aADD,EAECC,mBAFD,EAGCC,aAHD,EAICC,iBAJD,EAKCC,eALD,EAMCC,UAND,EAOCC,2CAA2C,IAAIC,6BAPhD,EAQCC,iDAAiD,IAAIC,mCARtD,QASO,yBATP;AAUA,SACCC,SADD,EAECC,QAFD,EAGCC,SAHD,EAICC,aAJD,EAKCC,mBALD,QAMO,uBANP;AAOA,SAASC,EAAT,QAAmB,iBAAnB;AACA,SAASC,KAAT,QAAsB,kBAAtB;AAEA,MAAMC,cAAc,GAAG,CAAE,kBAAF,CAAvB;AAEA,MAAMC,WAAW,GAAG,CACnB;AAAEC,EAAAA,IAAI,EAAEJ,EAAE,CAAE,OAAF,CAAV;AAAuBK,EAAAA,KAAK,EAAE;AAA9B,CADmB,EAEnB;AAAED,EAAAA,IAAI,EAAEJ,EAAE,CAAE,QAAF,CAAV;AAAwBK,EAAAA,KAAK,EAAE;AAA/B,CAFmB,EAGnB;AAAED,EAAAA,IAAI,EAAEJ,EAAE,CAAE,OAAF,CAAV;AAAuBK,EAAAA,KAAK,EAAE;AAA9B,CAHmB,EAInB;AAAED,EAAAA,IAAI,EAAEJ,EAAE,CAAE,MAAF,CAAV;AAAsBK,EAAAA,KAAK,EAAE;AAA7B,CAJmB,CAApB;;AAOA,MAAMC,qBAAqB,GAAKC,eAAF,IAAuB;AACpD,QAAMC,wBAAwB,GAAG1B,eAAe,CAC/CyB,eAD+C,EAE/C,sBAF+C,CAAhD;AAIA,SAAOC,wBAAP,aAAOA,wBAAP,uBAAOA,wBAAwB,CAAEC,OAAjC;AACA,CAND;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,EAAG,CACV;AACCD,QAAAA,UAAU,EAAE3C,KADb;AAEC4C,QAAAA,KAFD;AAGCO,QAAAA,aAAa,EAAET,QAHhB;AAICU,QAAAA,gBAAgB,EAAE,IAJnB;AAKCP,QAAAA,cALD;AAMCQ,QAAAA,WAAW,EAAE;AANd,OADU,CAJZ;AAcC,MAAA,OAAO,EAAG9C;AAdX,OAeMwC,qBAfN,EADD;AAAA,GADC,CADH,EAsBG,CAAExB,SAAF,IACD,cAAC,eAAD;AAEE+B,IAAAA,SAAS,EAAErC,cAFb;AAGEsC,IAAAA,eAAe,EAAExC,wBAHnB;AAKC,IAAA,WAAW,EAAG;AALf,IAvBF,CAxDD,EAwFC,oBAASkB,gBAAT,CAxFD,CADD;AA4FA;AAED,MAAMuB,mBAAmB,GAAG;AAC3B9C,EAAAA,SAAS,EAAE,YADgB;AAE3BD,EAAAA,mBAAmB,EAAE;AAFM,CAA5B;AAKA,eAAexB,UAAU,CAAEuE,mBAAF,CAAV,CAAmCnD,eAAnC,CAAf","sourcesContent":["/**\n * External dependencies\n */\nimport classNames from 'classnames';\n\n/**\n * WordPress dependencies\n */\nimport { getBlockSupport } from '@wordpress/blocks';\nimport { useEffect, useRef } from '@wordpress/element';\nimport {\n\tBlockControls,\n\tuseInnerBlocksProps,\n\tuseBlockProps,\n\tInspectorControls,\n\tContrastChecker,\n\twithColors,\n\t__experimentalColorGradientSettingsDropdown as ColorGradientSettingsDropdown,\n\t__experimentalUseMultipleOriginColorsAndGradients as useMultipleOriginColorsAndGradients,\n} from '@wordpress/block-editor';\nimport {\n\tMenuGroup,\n\tMenuItem,\n\tPanelBody,\n\tToggleControl,\n\tToolbarDropdownMenu,\n} from '@wordpress/components';\nimport { __ } from '@wordpress/i18n';\nimport { check } from '@wordpress/icons';\n\nconst ALLOWED_BLOCKS = [ 'core/social-link' ];\n\nconst sizeOptions = [\n\t{ name: __( 'Small' ), value: 'has-small-icon-size' },\n\t{ name: __( 'Normal' ), value: 'has-normal-icon-size' },\n\t{ name: __( 'Large' ), value: 'has-large-icon-size' },\n\t{ name: __( 'Huge' ), value: 'has-huge-icon-size' },\n];\n\nconst getDefaultBlockLayout = ( blockTypeOrName ) => {\n\tconst layoutBlockSupportConfig = getBlockSupport(\n\t\tblockTypeOrName,\n\t\t'__experimentalLayout'\n\t);\n\treturn layoutBlockSupportConfig?.default;\n};\n\nexport function SocialLinksEdit( props ) {\n\tconst {\n\t\tclientId,\n\t\tname,\n\t\tattributes,\n\t\ticonBackgroundColor,\n\t\ticonColor,\n\t\tisSelected,\n\t\tsetAttributes,\n\t\tsetIconBackgroundColor,\n\t\tsetIconColor,\n\t} = props;\n\n\tconst {\n\t\ticonBackgroundColorValue,\n\t\tcustomIconBackgroundColor,\n\t\ticonColorValue,\n\t\topenInNewTab,\n\t\tshowLabels,\n\t\tsize,\n\t\tlayout,\n\t} = attributes;\n\tconst usedLayout = layout || getDefaultBlockLayout( name );\n\n\tconst logosOnly = attributes.className?.includes( 'is-style-logos-only' );\n\n\t// Remove icon background color when logos only style is selected or\n\t// restore it when any other style is selected.\n\tconst backgroundBackup = useRef( {} );\n\tuseEffect( () => {\n\t\tif ( logosOnly ) {\n\t\t\tbackgroundBackup.current = {\n\t\t\t\ticonBackgroundColor,\n\t\t\t\ticonBackgroundColorValue,\n\t\t\t\tcustomIconBackgroundColor,\n\t\t\t};\n\t\t\tsetAttributes( {\n\t\t\t\ticonBackgroundColor: undefined,\n\t\t\t\tcustomIconBackgroundColor: undefined,\n\t\t\t\ticonBackgroundColorValue: undefined,\n\t\t\t} );\n\t\t} else {\n\t\t\tsetAttributes( { ...backgroundBackup.current } );\n\t\t}\n\t}, [ logosOnly ] );\n\n\tconst SocialPlaceholder = (\n\t\t<li className=\"wp-block-social-links__social-placeholder\">\n\t\t\t<div className=\"wp-block-social-links__social-placeholder-icons\">\n\t\t\t\t<div className=\"wp-social-link wp-social-link-twitter\"></div>\n\t\t\t\t<div className=\"wp-social-link wp-social-link-facebook\"></div>\n\t\t\t\t<div className=\"wp-social-link wp-social-link-instagram\"></div>\n\t\t\t</div>\n\t\t</li>\n\t);\n\n\tconst SelectedSocialPlaceholder = (\n\t\t<li className=\"wp-block-social-links__social-prompt\">\n\t\t\t{ __( 'Click plus to add' ) }\n\t\t</li>\n\t);\n\n\t// Fallback color values are used maintain selections in case switching\n\t// themes and named colors in palette do not match.\n\tconst className = classNames( size, {\n\t\t'has-visible-labels': showLabels,\n\t\t'has-icon-color': iconColor.color || iconColorValue,\n\t\t'has-icon-background-color':\n\t\t\ticonBackgroundColor.color || iconBackgroundColorValue,\n\t} );\n\n\tconst blockProps = useBlockProps( { className } );\n\tconst innerBlocksProps = useInnerBlocksProps( blockProps, {\n\t\tallowedBlocks: ALLOWED_BLOCKS,\n\t\tplaceholder: isSelected ? SelectedSocialPlaceholder : SocialPlaceholder,\n\t\ttemplateLock: false,\n\t\t__experimentalAppenderTagName: 'li',\n\t\t__experimentalLayout: usedLayout,\n\t} );\n\n\tconst POPOVER_PROPS = {\n\t\tposition: 'bottom right',\n\t};\n\n\tconst colorSettings = [\n\t\t{\n\t\t\t// Use custom attribute as fallback to prevent loss of named color selection when\n\t\t\t// switching themes to a new theme that does not have a matching named color.\n\t\t\tvalue: iconColor.color || iconColorValue,\n\t\t\tonChange: ( colorValue ) => {\n\t\t\t\tsetIconColor( colorValue );\n\t\t\t\tsetAttributes( { iconColorValue: colorValue } );\n\t\t\t},\n\t\t\tlabel: __( 'Icon color' ),\n\t\t\tresetAllFilter: () => {\n\t\t\t\tsetIconColor( undefined );\n\t\t\t\tsetAttributes( { iconColorValue: undefined } );\n\t\t\t},\n\t\t},\n\t];\n\n\tif ( ! logosOnly ) {\n\t\tcolorSettings.push( {\n\t\t\t// Use custom attribute as fallback to prevent loss of named color selection when\n\t\t\t// switching themes to a new theme that does not have a matching named color.\n\t\t\tvalue: iconBackgroundColor.color || iconBackgroundColorValue,\n\t\t\tonChange: ( colorValue ) => {\n\t\t\t\tsetIconBackgroundColor( colorValue );\n\t\t\t\tsetAttributes( {\n\t\t\t\t\ticonBackgroundColorValue: colorValue,\n\t\t\t\t} );\n\t\t\t},\n\t\t\tlabel: __( 'Icon background' ),\n\t\t\tresetAllFilter: () => {\n\t\t\t\tsetIconBackgroundColor( undefined );\n\t\t\t\tsetAttributes( { iconBackgroundColorValue: undefined } );\n\t\t\t},\n\t\t} );\n\t}\n\n\tconst colorGradientSettings = useMultipleOriginColorsAndGradients();\n\n\treturn (\n\t\t<>\n\t\t\t<BlockControls group=\"other\">\n\t\t\t\t<ToolbarDropdownMenu\n\t\t\t\t\tlabel={ __( 'Size' ) }\n\t\t\t\t\ttext={ __( 'Size' ) }\n\t\t\t\t\ticon={ null }\n\t\t\t\t\tpopoverProps={ POPOVER_PROPS }\n\t\t\t\t>\n\t\t\t\t\t{ ( { onClose } ) => (\n\t\t\t\t\t\t<MenuGroup>\n\t\t\t\t\t\t\t{ sizeOptions.map( ( entry ) => {\n\t\t\t\t\t\t\t\treturn (\n\t\t\t\t\t\t\t\t\t<MenuItem\n\t\t\t\t\t\t\t\t\t\ticon={\n\t\t\t\t\t\t\t\t\t\t\t( size === entry.value ||\n\t\t\t\t\t\t\t\t\t\t\t\t( ! size &&\n\t\t\t\t\t\t\t\t\t\t\t\t\tentry.value ===\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t'has-normal-icon-size' ) ) &&\n\t\t\t\t\t\t\t\t\t\t\tcheck\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\tisSelected={ size === entry.value }\n\t\t\t\t\t\t\t\t\t\tkey={ entry.value }\n\t\t\t\t\t\t\t\t\t\tonClick={ () => {\n\t\t\t\t\t\t\t\t\t\t\tsetAttributes( {\n\t\t\t\t\t\t\t\t\t\t\t\tsize: entry.value,\n\t\t\t\t\t\t\t\t\t\t\t} );\n\t\t\t\t\t\t\t\t\t\t} }\n\t\t\t\t\t\t\t\t\t\tonClose={ onClose }\n\t\t\t\t\t\t\t\t\t\trole=\"menuitemradio\"\n\t\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t\t{ entry.name }\n\t\t\t\t\t\t\t\t\t</MenuItem>\n\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t} ) }\n\t\t\t\t\t\t</MenuGroup>\n\t\t\t\t\t) }\n\t\t\t\t</ToolbarDropdownMenu>\n\t\t\t</BlockControls>\n\t\t\t<InspectorControls>\n\t\t\t\t<PanelBody title={ __( 'Link settings' ) }>\n\t\t\t\t\t<ToggleControl\n\t\t\t\t\t\tlabel={ __( 'Open links in new tab' ) }\n\t\t\t\t\t\tchecked={ openInNewTab }\n\t\t\t\t\t\tonChange={ () =>\n\t\t\t\t\t\t\tsetAttributes( { openInNewTab: ! openInNewTab } )\n\t\t\t\t\t\t}\n\t\t\t\t\t/>\n\t\t\t\t\t<ToggleControl\n\t\t\t\t\t\tlabel={ __( 'Show labels' ) }\n\t\t\t\t\t\tchecked={ showLabels }\n\t\t\t\t\t\tonChange={ () =>\n\t\t\t\t\t\t\tsetAttributes( { showLabels: ! showLabels } )\n\t\t\t\t\t\t}\n\t\t\t\t\t/>\n\t\t\t\t</PanelBody>\n\t\t\t</InspectorControls>\n\t\t\t<InspectorControls __experimentalGroup=\"color\">\n\t\t\t\t{ colorSettings.map(\n\t\t\t\t\t( { onChange, label, value, resetAllFilter } ) => (\n\t\t\t\t\t\t<ColorGradientSettingsDropdown\n\t\t\t\t\t\t\tkey={ `social-links-color-${ label }` }\n\t\t\t\t\t\t\t__experimentalHasMultipleOrigins\n\t\t\t\t\t\t\t__experimentalIsRenderedInSidebar\n\t\t\t\t\t\t\tsettings={ [\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\tcolorValue: value,\n\t\t\t\t\t\t\t\t\tlabel,\n\t\t\t\t\t\t\t\t\tonColorChange: onChange,\n\t\t\t\t\t\t\t\t\tisShownByDefault: true,\n\t\t\t\t\t\t\t\t\tresetAllFilter,\n\t\t\t\t\t\t\t\t\tenableAlpha: true,\n\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t] }\n\t\t\t\t\t\t\tpanelId={ clientId }\n\t\t\t\t\t\t\t{ ...colorGradientSettings }\n\t\t\t\t\t\t/>\n\t\t\t\t\t)\n\t\t\t\t) }\n\t\t\t\t{ ! logosOnly && (\n\t\t\t\t\t<ContrastChecker\n\t\t\t\t\t\t{ ...{\n\t\t\t\t\t\t\ttextColor: iconColorValue,\n\t\t\t\t\t\t\tbackgroundColor: iconBackgroundColorValue,\n\t\t\t\t\t\t} }\n\t\t\t\t\t\tisLargeText={ false }\n\t\t\t\t\t/>\n\t\t\t\t) }\n\t\t\t</InspectorControls>\n\t\t\t<ul { ...innerBlocksProps } />\n\t\t</>\n\t);\n}\n\nconst iconColorAttributes = {\n\ticonColor: 'icon-color',\n\ticonBackgroundColor: 'icon-background-color',\n};\n\nexport default withColors( iconColorAttributes )( SocialLinksEdit );\n"]}
|
|
@@ -66,6 +66,15 @@ const metadata = {
|
|
|
66
66
|
type: "flex"
|
|
67
67
|
}
|
|
68
68
|
},
|
|
69
|
+
color: {
|
|
70
|
+
enableContrastChecker: false,
|
|
71
|
+
background: true,
|
|
72
|
+
gradients: true,
|
|
73
|
+
text: false,
|
|
74
|
+
__experimentalDefaultControls: {
|
|
75
|
+
background: false
|
|
76
|
+
}
|
|
77
|
+
},
|
|
69
78
|
spacing: {
|
|
70
79
|
blockGap: ["horizontal", "vertical"],
|
|
71
80
|
margin: ["top", "bottom"],
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["@wordpress/block-library/src/social-links/index.js"],"names":["share","icon","deprecated","edit","save","name","metadata","settings","example","innerBlocks","attributes","service","url"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,KAAK,IAAIC,IAAlB,QAA8B,kBAA9B;AAEA;AACA;AACA;;AACA,OAAOC,UAAP,MAAuB,cAAvB;AACA,OAAOC,IAAP,MAAiB,QAAjB
|
|
1
|
+
{"version":3,"sources":["@wordpress/block-library/src/social-links/index.js"],"names":["share","icon","deprecated","edit","save","name","metadata","settings","example","innerBlocks","attributes","service","url"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,KAAK,IAAIC,IAAlB,QAA8B,kBAA9B;AAEA;AACA;AACA;;AACA,OAAOC,UAAP,MAAuB,cAAvB;AACA,OAAOC,IAAP,MAAiB,QAAjB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAEA,OAAOC,IAAP,MAAiB,QAAjB;AAEA,MAAM;AAAEC,EAAAA;AAAF,IAAWC,QAAjB;AAEA,SAASA,QAAT,EAAmBD,IAAnB;AAEA,OAAO,MAAME,QAAQ,GAAG;AACvBC,EAAAA,OAAO,EAAE;AACRC,IAAAA,WAAW,EAAE,CACZ;AACCJ,MAAAA,IAAI,EAAE,kBADP;AAECK,MAAAA,UAAU,EAAE;AACXC,QAAAA,OAAO,EAAE,WADE;AAEXC,QAAAA,GAAG,EAAE;AAFM;AAFb,KADY,EAQZ;AACCP,MAAAA,IAAI,EAAE,kBADP;AAECK,MAAAA,UAAU,EAAE;AACXC,QAAAA,OAAO,EAAE,UADE;AAEXC,QAAAA,GAAG,EAAE;AAFM;AAFb,KARY,EAeZ;AACCP,MAAAA,IAAI,EAAE,kBADP;AAECK,MAAAA,UAAU,EAAE;AACXC,QAAAA,OAAO,EAAE,SADE;AAEXC,QAAAA,GAAG,EAAE;AAFM;AAFb,KAfY;AADL,GADc;AA0BvBX,EAAAA,IA1BuB;AA2BvBE,EAAAA,IA3BuB;AA4BvBC,EAAAA,IA5BuB;AA6BvBF,EAAAA;AA7BuB,CAAjB","sourcesContent":["/**\n * WordPress dependencies\n */\nimport { share as icon } from '@wordpress/icons';\n\n/**\n * Internal dependencies\n */\nimport deprecated from './deprecated';\nimport edit from './edit';\nimport metadata from './block.json';\nimport save from './save';\n\nconst { name } = metadata;\n\nexport { metadata, name };\n\nexport const settings = {\n\texample: {\n\t\tinnerBlocks: [\n\t\t\t{\n\t\t\t\tname: 'core/social-link',\n\t\t\t\tattributes: {\n\t\t\t\t\tservice: 'wordpress',\n\t\t\t\t\turl: 'https://wordpress.org',\n\t\t\t\t},\n\t\t\t},\n\t\t\t{\n\t\t\t\tname: 'core/social-link',\n\t\t\t\tattributes: {\n\t\t\t\t\tservice: 'facebook',\n\t\t\t\t\turl: 'https://www.facebook.com/WordPress/',\n\t\t\t\t},\n\t\t\t},\n\t\t\t{\n\t\t\t\tname: 'core/social-link',\n\t\t\t\tattributes: {\n\t\t\t\t\tservice: 'twitter',\n\t\t\t\t\turl: 'https://twitter.com/WordPress',\n\t\t\t\t},\n\t\t\t},\n\t\t],\n\t},\n\ticon,\n\tedit,\n\tsave,\n\tdeprecated,\n};\n"]}
|
|
@@ -34,6 +34,19 @@ const metadata = {
|
|
|
34
34
|
spacing: {
|
|
35
35
|
margin: true,
|
|
36
36
|
padding: true
|
|
37
|
+
},
|
|
38
|
+
typography: {
|
|
39
|
+
fontSize: true,
|
|
40
|
+
lineHeight: true,
|
|
41
|
+
__experimentalFontFamily: true,
|
|
42
|
+
__experimentalFontWeight: true,
|
|
43
|
+
__experimentalFontStyle: true,
|
|
44
|
+
__experimentalTextTransform: true,
|
|
45
|
+
__experimentalTextDecoration: true,
|
|
46
|
+
__experimentalLetterSpacing: true,
|
|
47
|
+
__experimentalDefaultControls: {
|
|
48
|
+
fontSize: true
|
|
49
|
+
}
|
|
37
50
|
}
|
|
38
51
|
},
|
|
39
52
|
example: {}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["@wordpress/block-library/src/table-of-contents/index.js"],"names":["edit","icon","save","name","metadata","settings"],"mappings":"AAAA;AACA;AACA
|
|
1
|
+
{"version":3,"sources":["@wordpress/block-library/src/table-of-contents/index.js"],"names":["edit","icon","save","name","metadata","settings"],"mappings":"AAAA;AACA;AACA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAEA,OAAOA,IAAP,MAAiB,QAAjB;AACA,OAAOC,IAAP,MAAiB,QAAjB;AACA,OAAOC,IAAP,MAAiB,QAAjB;AAEA,MAAM;AAAEC,EAAAA;AAAF,IAAWC,QAAjB;AAEA,SAASA,QAAT,EAAmBD,IAAnB;AAEA,OAAO,MAAME,QAAQ,GAAG;AACvBJ,EAAAA,IADuB;AAEvBD,EAAAA,IAFuB;AAGvBE,EAAAA;AAHuB,CAAjB","sourcesContent":["/**\n * Internal dependencies\n */\nimport metadata from './block.json';\nimport edit from './edit';\nimport icon from './icon';\nimport save from './save';\n\nconst { name } = metadata;\n\nexport { metadata, name };\n\nexport const settings = {\n\ticon,\n\tedit,\n\tsave,\n};\n"]}
|
package/build-style/style.css
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@wordpress/block-library",
|
|
3
|
-
"version": "7.
|
|
3
|
+
"version": "7.13.0",
|
|
4
4
|
"description": "Block library for the WordPress editor.",
|
|
5
5
|
"author": "The WordPress Contributors",
|
|
6
6
|
"license": "GPL-2.0-or-later",
|
|
@@ -34,32 +34,32 @@
|
|
|
34
34
|
],
|
|
35
35
|
"dependencies": {
|
|
36
36
|
"@babel/runtime": "^7.16.0",
|
|
37
|
-
"@wordpress/a11y": "^3.
|
|
38
|
-
"@wordpress/api-fetch": "^6.
|
|
39
|
-
"@wordpress/autop": "^3.
|
|
40
|
-
"@wordpress/blob": "^3.
|
|
41
|
-
"@wordpress/block-editor": "^9.
|
|
42
|
-
"@wordpress/blocks": "^11.
|
|
43
|
-
"@wordpress/components": "^20.0.
|
|
44
|
-
"@wordpress/compose": "^5.
|
|
45
|
-
"@wordpress/core-data": "^4.14.
|
|
46
|
-
"@wordpress/data": "^7.0.
|
|
47
|
-
"@wordpress/date": "^4.
|
|
48
|
-
"@wordpress/deprecated": "^3.
|
|
49
|
-
"@wordpress/dom": "^3.
|
|
50
|
-
"@wordpress/element": "^4.
|
|
51
|
-
"@wordpress/hooks": "^3.
|
|
52
|
-
"@wordpress/html-entities": "^3.
|
|
53
|
-
"@wordpress/i18n": "^4.
|
|
54
|
-
"@wordpress/icons": "^9.
|
|
55
|
-
"@wordpress/keycodes": "^3.
|
|
56
|
-
"@wordpress/notices": "^3.
|
|
57
|
-
"@wordpress/primitives": "^3.
|
|
58
|
-
"@wordpress/reusable-blocks": "^3.
|
|
59
|
-
"@wordpress/rich-text": "^5.
|
|
60
|
-
"@wordpress/server-side-render": "^3.
|
|
61
|
-
"@wordpress/url": "^3.
|
|
62
|
-
"@wordpress/viewport": "^4.
|
|
37
|
+
"@wordpress/a11y": "^3.16.0",
|
|
38
|
+
"@wordpress/api-fetch": "^6.13.0",
|
|
39
|
+
"@wordpress/autop": "^3.16.0",
|
|
40
|
+
"@wordpress/blob": "^3.16.0",
|
|
41
|
+
"@wordpress/block-editor": "^9.8.0",
|
|
42
|
+
"@wordpress/blocks": "^11.15.0",
|
|
43
|
+
"@wordpress/components": "^20.0.0",
|
|
44
|
+
"@wordpress/compose": "^5.14.0",
|
|
45
|
+
"@wordpress/core-data": "^4.14.0",
|
|
46
|
+
"@wordpress/data": "^7.0.0",
|
|
47
|
+
"@wordpress/date": "^4.16.0",
|
|
48
|
+
"@wordpress/deprecated": "^3.16.0",
|
|
49
|
+
"@wordpress/dom": "^3.16.0",
|
|
50
|
+
"@wordpress/element": "^4.14.0",
|
|
51
|
+
"@wordpress/hooks": "^3.16.0",
|
|
52
|
+
"@wordpress/html-entities": "^3.16.0",
|
|
53
|
+
"@wordpress/i18n": "^4.16.0",
|
|
54
|
+
"@wordpress/icons": "^9.7.0",
|
|
55
|
+
"@wordpress/keycodes": "^3.16.0",
|
|
56
|
+
"@wordpress/notices": "^3.16.0",
|
|
57
|
+
"@wordpress/primitives": "^3.14.0",
|
|
58
|
+
"@wordpress/reusable-blocks": "^3.14.0",
|
|
59
|
+
"@wordpress/rich-text": "^5.14.0",
|
|
60
|
+
"@wordpress/server-side-render": "^3.14.0",
|
|
61
|
+
"@wordpress/url": "^3.17.0",
|
|
62
|
+
"@wordpress/viewport": "^4.14.0",
|
|
63
63
|
"change-case": "^4.1.2",
|
|
64
64
|
"classnames": "^2.3.1",
|
|
65
65
|
"colord": "^2.7.0",
|
|
@@ -76,5 +76,5 @@
|
|
|
76
76
|
"publishConfig": {
|
|
77
77
|
"access": "public"
|
|
78
78
|
},
|
|
79
|
-
"gitHead": "
|
|
79
|
+
"gitHead": "171b87c7465b93e685e081c5f57f153507363c95"
|
|
80
80
|
}
|
package/src/list/block.json
CHANGED
|
@@ -94,6 +94,7 @@
|
|
|
94
94
|
"__experimentalFontWeight": true,
|
|
95
95
|
"__experimentalTextTransform": true,
|
|
96
96
|
"__experimentalFontFamily": true,
|
|
97
|
+
"__experimentalLetterSpacing": true,
|
|
97
98
|
"__experimentalTextDecoration": true,
|
|
98
99
|
"__experimentalSkipSerialization": [ "textDecoration" ],
|
|
99
100
|
"__experimentalDefaultControls": {
|
|
@@ -49,6 +49,20 @@ function resolveRecords( registry, menus ) {
|
|
|
49
49
|
} );
|
|
50
50
|
}
|
|
51
51
|
|
|
52
|
+
function resolveReadPermission( registry, allowed ) {
|
|
53
|
+
const dispatch = registry.dispatch( coreStore );
|
|
54
|
+
dispatch.receiveUserPermission( 'create/navigation', allowed );
|
|
55
|
+
dispatch.startResolution( 'canUser', [ 'read', 'navigation' ] );
|
|
56
|
+
dispatch.finishResolution( 'canUser', [ 'read', 'navigation' ] );
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
function resolveReadRecordPermission( registry, ref, allowed ) {
|
|
60
|
+
const dispatch = registry.dispatch( coreStore );
|
|
61
|
+
dispatch.receiveUserPermission( 'create/navigation', allowed );
|
|
62
|
+
dispatch.startResolution( 'canUser', [ 'read', 'navigation', ref ] );
|
|
63
|
+
dispatch.finishResolution( 'canUser', [ 'read', 'navigation', ref ] );
|
|
64
|
+
}
|
|
65
|
+
|
|
52
66
|
function resolveCreatePermission( registry, allowed ) {
|
|
53
67
|
const dispatch = registry.dispatch( coreStore );
|
|
54
68
|
dispatch.receiveUserPermission( 'create/navigation', allowed );
|
|
@@ -105,9 +119,10 @@ describe( 'useNavigationMenus', () => {
|
|
|
105
119
|
} );
|
|
106
120
|
} );
|
|
107
121
|
|
|
108
|
-
it( 'Should return information about all menus when ref is missing', () => {
|
|
122
|
+
it( 'Should return information about all menus when the ref is missing', () => {
|
|
109
123
|
resolveRecords( registry, navigationMenus );
|
|
110
124
|
resolveCreatePermission( registry, true );
|
|
125
|
+
resolveReadPermission( registry, true );
|
|
111
126
|
expect( useNavigationMenu() ).toEqual( {
|
|
112
127
|
navigationMenus,
|
|
113
128
|
navigationMenu: undefined,
|
|
@@ -171,6 +186,7 @@ describe( 'useNavigationMenus', () => {
|
|
|
171
186
|
it( 'Should return correct permissions (create, update)', () => {
|
|
172
187
|
resolveRecords( registry, navigationMenus );
|
|
173
188
|
resolveCreatePermission( registry, true );
|
|
189
|
+
resolveReadRecordPermission( registry, 1, true );
|
|
174
190
|
resolveUpdatePermission( registry, 1, true );
|
|
175
191
|
resolveDeletePermission( registry, 1, false );
|
|
176
192
|
expect( useNavigationMenu( 1 ) ).toEqual( {
|
|
@@ -194,6 +210,7 @@ describe( 'useNavigationMenus', () => {
|
|
|
194
210
|
it( 'Should return correct permissions (delete only)', () => {
|
|
195
211
|
resolveRecords( registry, navigationMenus );
|
|
196
212
|
resolveCreatePermission( registry, false );
|
|
213
|
+
resolveReadRecordPermission( registry, 1, false );
|
|
197
214
|
resolveUpdatePermission( registry, 1, false );
|
|
198
215
|
resolveDeletePermission( registry, 1, true );
|
|
199
216
|
expect( useNavigationMenu( 1 ) ).toEqual( {
|
package/src/paragraph/block.json
CHANGED
|
@@ -56,6 +56,15 @@
|
|
|
56
56
|
"type": "flex"
|
|
57
57
|
}
|
|
58
58
|
},
|
|
59
|
+
"color": {
|
|
60
|
+
"enableContrastChecker": false,
|
|
61
|
+
"background": true,
|
|
62
|
+
"gradients": true,
|
|
63
|
+
"text": false,
|
|
64
|
+
"__experimentalDefaultControls": {
|
|
65
|
+
"background": false
|
|
66
|
+
}
|
|
67
|
+
},
|
|
59
68
|
"spacing": {
|
|
60
69
|
"blockGap": [ "horizontal", "vertical" ],
|
|
61
70
|
"margin": [ "top", "bottom" ],
|
package/src/social-links/edit.js
CHANGED
|
@@ -7,15 +7,16 @@ import classNames from 'classnames';
|
|
|
7
7
|
* WordPress dependencies
|
|
8
8
|
*/
|
|
9
9
|
import { getBlockSupport } from '@wordpress/blocks';
|
|
10
|
-
import {
|
|
10
|
+
import { useEffect, useRef } from '@wordpress/element';
|
|
11
11
|
import {
|
|
12
12
|
BlockControls,
|
|
13
13
|
useInnerBlocksProps,
|
|
14
14
|
useBlockProps,
|
|
15
15
|
InspectorControls,
|
|
16
16
|
ContrastChecker,
|
|
17
|
-
PanelColorSettings,
|
|
18
17
|
withColors,
|
|
18
|
+
__experimentalColorGradientSettingsDropdown as ColorGradientSettingsDropdown,
|
|
19
|
+
__experimentalUseMultipleOriginColorsAndGradients as useMultipleOriginColorsAndGradients,
|
|
19
20
|
} from '@wordpress/block-editor';
|
|
20
21
|
import {
|
|
21
22
|
MenuGroup,
|
|
@@ -46,6 +47,7 @@ const getDefaultBlockLayout = ( blockTypeOrName ) => {
|
|
|
46
47
|
|
|
47
48
|
export function SocialLinksEdit( props ) {
|
|
48
49
|
const {
|
|
50
|
+
clientId,
|
|
49
51
|
name,
|
|
50
52
|
attributes,
|
|
51
53
|
iconBackgroundColor,
|
|
@@ -137,6 +139,10 @@ export function SocialLinksEdit( props ) {
|
|
|
137
139
|
setAttributes( { iconColorValue: colorValue } );
|
|
138
140
|
},
|
|
139
141
|
label: __( 'Icon color' ),
|
|
142
|
+
resetAllFilter: () => {
|
|
143
|
+
setIconColor( undefined );
|
|
144
|
+
setAttributes( { iconColorValue: undefined } );
|
|
145
|
+
},
|
|
140
146
|
},
|
|
141
147
|
];
|
|
142
148
|
|
|
@@ -152,11 +158,17 @@ export function SocialLinksEdit( props ) {
|
|
|
152
158
|
} );
|
|
153
159
|
},
|
|
154
160
|
label: __( 'Icon background' ),
|
|
161
|
+
resetAllFilter: () => {
|
|
162
|
+
setIconBackgroundColor( undefined );
|
|
163
|
+
setAttributes( { iconBackgroundColorValue: undefined } );
|
|
164
|
+
},
|
|
155
165
|
} );
|
|
156
166
|
}
|
|
157
167
|
|
|
168
|
+
const colorGradientSettings = useMultipleOriginColorsAndGradients();
|
|
169
|
+
|
|
158
170
|
return (
|
|
159
|
-
|
|
171
|
+
<>
|
|
160
172
|
<BlockControls group="other">
|
|
161
173
|
<ToolbarDropdownMenu
|
|
162
174
|
label={ __( 'Size' ) }
|
|
@@ -211,26 +223,41 @@ export function SocialLinksEdit( props ) {
|
|
|
211
223
|
}
|
|
212
224
|
/>
|
|
213
225
|
</PanelBody>
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
226
|
+
</InspectorControls>
|
|
227
|
+
<InspectorControls __experimentalGroup="color">
|
|
228
|
+
{ colorSettings.map(
|
|
229
|
+
( { onChange, label, value, resetAllFilter } ) => (
|
|
230
|
+
<ColorGradientSettingsDropdown
|
|
231
|
+
key={ `social-links-color-${ label }` }
|
|
232
|
+
__experimentalHasMultipleOrigins
|
|
233
|
+
__experimentalIsRenderedInSidebar
|
|
234
|
+
settings={ [
|
|
235
|
+
{
|
|
236
|
+
colorValue: value,
|
|
237
|
+
label,
|
|
238
|
+
onColorChange: onChange,
|
|
239
|
+
isShownByDefault: true,
|
|
240
|
+
resetAllFilter,
|
|
241
|
+
enableAlpha: true,
|
|
242
|
+
},
|
|
243
|
+
] }
|
|
244
|
+
panelId={ clientId }
|
|
245
|
+
{ ...colorGradientSettings }
|
|
228
246
|
/>
|
|
229
|
-
)
|
|
230
|
-
|
|
247
|
+
)
|
|
248
|
+
) }
|
|
249
|
+
{ ! logosOnly && (
|
|
250
|
+
<ContrastChecker
|
|
251
|
+
{ ...{
|
|
252
|
+
textColor: iconColorValue,
|
|
253
|
+
backgroundColor: iconBackgroundColorValue,
|
|
254
|
+
} }
|
|
255
|
+
isLargeText={ false }
|
|
256
|
+
/>
|
|
257
|
+
) }
|
|
231
258
|
</InspectorControls>
|
|
232
259
|
<ul { ...innerBlocksProps } />
|
|
233
|
-
|
|
260
|
+
</>
|
|
234
261
|
);
|
|
235
262
|
}
|
|
236
263
|
|
|
@@ -31,6 +31,19 @@
|
|
|
31
31
|
"spacing": {
|
|
32
32
|
"margin": true,
|
|
33
33
|
"padding": true
|
|
34
|
+
},
|
|
35
|
+
"typography": {
|
|
36
|
+
"fontSize": true,
|
|
37
|
+
"lineHeight": true,
|
|
38
|
+
"__experimentalFontFamily": true,
|
|
39
|
+
"__experimentalFontWeight": true,
|
|
40
|
+
"__experimentalFontStyle": true,
|
|
41
|
+
"__experimentalTextTransform": true,
|
|
42
|
+
"__experimentalTextDecoration": true,
|
|
43
|
+
"__experimentalLetterSpacing": true,
|
|
44
|
+
"__experimentalDefaultControls": {
|
|
45
|
+
"fontSize": true
|
|
46
|
+
}
|
|
34
47
|
}
|
|
35
48
|
},
|
|
36
49
|
"example": {}
|