@wordpress/edit-site 6.16.0 → 6.17.1
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 +2 -0
- package/build/components/global-styles/screen-revisions/index.js +1 -1
- package/build/components/global-styles/screen-revisions/index.js.map +1 -1
- package/build/components/page-patterns/index.js +6 -6
- package/build/components/page-patterns/index.js.map +1 -1
- package/build/components/page-templates/index.js +5 -5
- package/build/components/page-templates/index.js.map +1 -1
- package/build/components/pagination/index.js +1 -1
- package/build/components/pagination/index.js.map +1 -1
- package/build/components/style-book/constants.js +1 -1
- package/build/components/style-book/constants.js.map +1 -1
- package/build-module/components/global-styles/screen-revisions/index.js +1 -1
- package/build-module/components/global-styles/screen-revisions/index.js.map +1 -1
- package/build-module/components/page-patterns/index.js +2 -2
- package/build-module/components/page-patterns/index.js.map +1 -1
- package/build-module/components/page-templates/index.js +2 -2
- package/build-module/components/page-templates/index.js.map +1 -1
- package/build-module/components/pagination/index.js +1 -1
- package/build-module/components/pagination/index.js.map +1 -1
- package/build-module/components/style-book/constants.js +1 -1
- package/build-module/components/style-book/constants.js.map +1 -1
- package/build-style/style-rtl.css +11 -4
- package/build-style/style.css +11 -4
- package/package.json +42 -42
- package/src/components/global-styles/screen-revisions/index.js +1 -1
- package/src/components/page-patterns/index.js +1 -2
- package/src/components/page-patterns/style.scss +8 -0
- package/src/components/page-templates/index.js +1 -2
- package/src/components/page-templates/style.scss +2 -0
- package/src/components/pagination/index.js +1 -1
- package/src/components/style-book/constants.ts +1 -1
- package/tsconfig.tsbuildinfo +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["__","useState","useMemo","useId","useEffect","privateApis","blockEditorPrivateApis","DataViews","filterSortAndPaginate","usePrevious","useEntityRecords","editorPrivateApis","routerPrivateApis","patternTitleField","Page","LAYOUT_GRID","LAYOUT_TABLE","PATTERN_TYPES","TEMPLATE_PART_POST_TYPE","PATTERN_DEFAULT_CATEGORY","usePatternSettings","unlock","usePatterns","useAugmentPatternsWithPermissions","PatternsHeader","useEditPostAction","patternStatusField","previewField","templatePartAuthorField","jsx","_jsx","jsxs","_jsxs","ExperimentalBlockEditorProvider","usePostActions","useLocation","useHistory","EMPTY_ARRAY","defaultLayouts","layout","styles","author","width","badgeFields","DEFAULT_VIEW","type","search","page","perPage","titleField","mediaField","fields","filters","DataviewsPatterns","query","postType","categoryId","categoryIdFromURL","history","view","setView","previousCategoryId","previousPostType","viewSyncStatus","find","field","value","patterns","isResolving","syncStatus","records","per_page","authors","authorsSet","Set","forEach","template","add","author_text","Array","from","map","label","_fields","user","push","elements","prevView","data","paginationInfo","viewWithoutFilters","dataWithPermissions","templatePartActions","context","patternActions","editAction","actions","filter","Boolean","id","settings","children","title","className","hideTitleFromUI","titleId","descriptionId","getItemId","item","_item$name","name","isLoading","isItemClickable","theme","onClickItem","navigate","includes","onChangeView"],"sources":["@wordpress/edit-site/src/components/page-patterns/index.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { __ } from '@wordpress/i18n';\nimport { useState, useMemo, useId, useEffect } from '@wordpress/element';\nimport { privateApis as blockEditorPrivateApis } from '@wordpress/block-editor';\nimport { DataViews, filterSortAndPaginate } from '@wordpress/dataviews';\nimport { usePrevious } from '@wordpress/compose';\nimport { useEntityRecords } from '@wordpress/core-data';\nimport { privateApis as editorPrivateApis } from '@wordpress/editor';\nimport { privateApis as routerPrivateApis } from '@wordpress/router';\nimport { patternTitleField } from '@wordpress/fields';\n\n/**\n * Internal dependencies\n */\nimport Page from '../page';\nimport {\n\tLAYOUT_GRID,\n\tLAYOUT_TABLE,\n\tPATTERN_TYPES,\n\tTEMPLATE_PART_POST_TYPE,\n\tPATTERN_DEFAULT_CATEGORY,\n} from '../../utils/constants';\nimport usePatternSettings from './use-pattern-settings';\nimport { unlock } from '../../lock-unlock';\nimport usePatterns, { useAugmentPatternsWithPermissions } from './use-patterns';\nimport PatternsHeader from './header';\nimport { useEditPostAction } from '../dataviews-actions';\nimport {\n\tpatternStatusField,\n\tpreviewField,\n\ttemplatePartAuthorField,\n} from './fields';\n\nconst { ExperimentalBlockEditorProvider } = unlock( blockEditorPrivateApis );\nconst { usePostActions } = unlock( editorPrivateApis );\nconst { useLocation, useHistory } = unlock( routerPrivateApis );\n\nconst EMPTY_ARRAY = [];\nconst defaultLayouts = {\n\t[ LAYOUT_TABLE ]: {\n\t\tlayout: {\n\t\t\tstyles: {\n\t\t\t\tauthor: {\n\t\t\t\t\twidth: '1%',\n\t\t\t\t},\n\t\t\t},\n\t\t},\n\t},\n\t[ LAYOUT_GRID ]: {\n\t\tlayout: {\n\t\t\tbadgeFields: [ 'sync-status' ],\n\t\t},\n\t},\n};\nconst DEFAULT_VIEW = {\n\ttype: LAYOUT_GRID,\n\tsearch: '',\n\tpage: 1,\n\tperPage: 20,\n\ttitleField: 'title',\n\tmediaField: 'preview',\n\tfields: [ 'sync-status' ],\n\tfilters: [],\n\t...defaultLayouts[ LAYOUT_GRID ],\n};\n\nexport default function DataviewsPatterns() {\n\tconst {\n\t\tquery: { postType = 'wp_block', categoryId: categoryIdFromURL },\n\t} = useLocation();\n\tconst history = useHistory();\n\tconst categoryId = categoryIdFromURL || PATTERN_DEFAULT_CATEGORY;\n\tconst [ view, setView ] = useState( DEFAULT_VIEW );\n\tconst previousCategoryId = usePrevious( categoryId );\n\tconst previousPostType = usePrevious( postType );\n\tconst viewSyncStatus = view.filters?.find(\n\t\t( { field } ) => field === 'sync-status'\n\t)?.value;\n\tconst { patterns, isResolving } = usePatterns( postType, categoryId, {\n\t\tsearch: view.search,\n\t\tsyncStatus: viewSyncStatus,\n\t} );\n\n\tconst { records } = useEntityRecords( 'postType', TEMPLATE_PART_POST_TYPE, {\n\t\tper_page: -1,\n\t} );\n\n\tconst authors = useMemo( () => {\n\t\tif ( ! records ) {\n\t\t\treturn EMPTY_ARRAY;\n\t\t}\n\t\tconst authorsSet = new Set();\n\t\trecords.forEach( ( template ) => {\n\t\t\tauthorsSet.add( template.author_text );\n\t\t} );\n\t\treturn Array.from( authorsSet ).map( ( author ) => ( {\n\t\t\tvalue: author,\n\t\t\tlabel: author,\n\t\t} ) );\n\t}, [ records ] );\n\n\tconst fields = useMemo( () => {\n\t\tconst _fields = [ previewField, patternTitleField ];\n\n\t\tif ( postType === PATTERN_TYPES.user ) {\n\t\t\t_fields.push( patternStatusField );\n\t\t} else if ( postType === TEMPLATE_PART_POST_TYPE ) {\n\t\t\t_fields.push( {\n\t\t\t\t...templatePartAuthorField,\n\t\t\t\telements: authors,\n\t\t\t} );\n\t\t}\n\n\t\treturn _fields;\n\t}, [ postType, authors ] );\n\n\t// Reset the page number when the category changes.\n\tuseEffect( () => {\n\t\tif (\n\t\t\tpreviousCategoryId !== categoryId ||\n\t\t\tpreviousPostType !== postType\n\t\t) {\n\t\t\tsetView( ( prevView ) => ( { ...prevView, page: 1 } ) );\n\t\t}\n\t}, [ categoryId, previousCategoryId, previousPostType, postType ] );\n\tconst { data, paginationInfo } = useMemo( () => {\n\t\t// Search is managed server-side as well as filters for patterns.\n\t\t// However, the author filter in template parts is done client-side.\n\t\tconst viewWithoutFilters = { ...view };\n\t\tdelete viewWithoutFilters.search;\n\t\tif ( postType !== TEMPLATE_PART_POST_TYPE ) {\n\t\t\tviewWithoutFilters.filters = [];\n\t\t}\n\t\treturn filterSortAndPaginate( patterns, viewWithoutFilters, fields );\n\t}, [ patterns, view, fields, postType ] );\n\n\tconst dataWithPermissions = useAugmentPatternsWithPermissions( data );\n\n\tconst templatePartActions = usePostActions( {\n\t\tpostType: TEMPLATE_PART_POST_TYPE,\n\t\tcontext: 'list',\n\t} );\n\tconst patternActions = usePostActions( {\n\t\tpostType: PATTERN_TYPES.user,\n\t\tcontext: 'list',\n\t} );\n\tconst editAction = useEditPostAction();\n\n\tconst actions = useMemo( () => {\n\t\tif ( postType === TEMPLATE_PART_POST_TYPE ) {\n\t\t\treturn [ editAction, ...templatePartActions ].filter( Boolean );\n\t\t}\n\t\treturn [ editAction, ...patternActions ].filter( Boolean );\n\t}, [ editAction, postType, templatePartActions, patternActions ] );\n\tconst id = useId();\n\tconst settings = usePatternSettings();\n\t// Wrap everything in a block editor provider.\n\t// This ensures 'styles' that are needed for the previews are synced\n\t// from the site editor store to the block editor store.\n\treturn (\n\t\t<ExperimentalBlockEditorProvider settings={ settings }>\n\t\t\t<Page\n\t\t\t\ttitle={ __( 'Patterns content' ) }\n\t\t\t\tclassName=\"edit-site-page-patterns-dataviews\"\n\t\t\t\thideTitleFromUI\n\t\t\t>\n\t\t\t\t<PatternsHeader\n\t\t\t\t\tcategoryId={ categoryId }\n\t\t\t\t\ttype={ postType }\n\t\t\t\t\ttitleId={ `${ id }-title` }\n\t\t\t\t\tdescriptionId={ `${ id }-description` }\n\t\t\t\t/>\n\t\t\t\t<DataViews\n\t\t\t\t\tkey={ categoryId + postType }\n\t\t\t\t\tpaginationInfo={ paginationInfo }\n\t\t\t\t\tfields={ fields }\n\t\t\t\t\tactions={ actions }\n\t\t\t\t\tdata={ dataWithPermissions || EMPTY_ARRAY }\n\t\t\t\t\tgetItemId={ ( item ) => item.name ?? item.id }\n\t\t\t\t\tisLoading={ isResolving }\n\t\t\t\t\tisItemClickable={ ( item ) =>\n\t\t\t\t\t\titem.type !== PATTERN_TYPES.theme\n\t\t\t\t\t}\n\t\t\t\t\tonClickItem={ ( item ) => {\n\t\t\t\t\t\thistory.navigate(\n\t\t\t\t\t\t\t`/${ item.type }/${\n\t\t\t\t\t\t\t\t[\n\t\t\t\t\t\t\t\t\tPATTERN_TYPES.user,\n\t\t\t\t\t\t\t\t\tTEMPLATE_PART_POST_TYPE,\n\t\t\t\t\t\t\t\t].includes( item.type )\n\t\t\t\t\t\t\t\t\t? item.id\n\t\t\t\t\t\t\t\t\t: item.name\n\t\t\t\t\t\t\t}?canvas=edit`\n\t\t\t\t\t\t);\n\t\t\t\t\t} }\n\t\t\t\t\tview={ view }\n\t\t\t\t\tonChangeView={ setView }\n\t\t\t\t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,IAAI,cAEd,CAAC;QACF,CAAG;QACHnD,IAAI,EAAGA,IAAM;QACb0D,YAAY,EAAGzD,OAAS;QACxBtB,cAAc,EAAGA;MAAgB,GAxB3BkB,UAAU,GAAGD,QAyBnB,CAAC;IAAA,CACG;EAAC,CACyB,CAAC;AAEpC","ignoreList":[]}
|
|
1
|
+
{"version":3,"names":["__","useState","useMemo","useId","useEffect","privateApis","blockEditorPrivateApis","DataViews","filterSortAndPaginate","usePrevious","useEntityRecords","editorPrivateApis","routerPrivateApis","Page","LAYOUT_GRID","LAYOUT_TABLE","PATTERN_TYPES","TEMPLATE_PART_POST_TYPE","PATTERN_DEFAULT_CATEGORY","usePatternSettings","unlock","usePatterns","useAugmentPatternsWithPermissions","PatternsHeader","useEditPostAction","patternStatusField","previewField","templatePartAuthorField","jsx","_jsx","jsxs","_jsxs","ExperimentalBlockEditorProvider","usePostActions","patternTitleField","useLocation","useHistory","EMPTY_ARRAY","defaultLayouts","layout","styles","author","width","badgeFields","DEFAULT_VIEW","type","search","page","perPage","titleField","mediaField","fields","filters","DataviewsPatterns","query","postType","categoryId","categoryIdFromURL","history","view","setView","previousCategoryId","previousPostType","viewSyncStatus","find","field","value","patterns","isResolving","syncStatus","records","per_page","authors","authorsSet","Set","forEach","template","add","author_text","Array","from","map","label","_fields","user","push","elements","prevView","data","paginationInfo","viewWithoutFilters","dataWithPermissions","templatePartActions","context","patternActions","editAction","actions","filter","Boolean","id","settings","children","title","className","hideTitleFromUI","titleId","descriptionId","getItemId","item","_item$name","name","isLoading","isItemClickable","theme","onClickItem","navigate","includes","onChangeView"],"sources":["@wordpress/edit-site/src/components/page-patterns/index.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { __ } from '@wordpress/i18n';\nimport { useState, useMemo, useId, useEffect } from '@wordpress/element';\nimport { privateApis as blockEditorPrivateApis } from '@wordpress/block-editor';\nimport { DataViews, filterSortAndPaginate } from '@wordpress/dataviews';\nimport { usePrevious } from '@wordpress/compose';\nimport { useEntityRecords } from '@wordpress/core-data';\nimport { privateApis as editorPrivateApis } from '@wordpress/editor';\nimport { privateApis as routerPrivateApis } from '@wordpress/router';\n\n/**\n * Internal dependencies\n */\nimport Page from '../page';\nimport {\n\tLAYOUT_GRID,\n\tLAYOUT_TABLE,\n\tPATTERN_TYPES,\n\tTEMPLATE_PART_POST_TYPE,\n\tPATTERN_DEFAULT_CATEGORY,\n} from '../../utils/constants';\nimport usePatternSettings from './use-pattern-settings';\nimport { unlock } from '../../lock-unlock';\nimport usePatterns, { useAugmentPatternsWithPermissions } from './use-patterns';\nimport PatternsHeader from './header';\nimport { useEditPostAction } from '../dataviews-actions';\nimport {\n\tpatternStatusField,\n\tpreviewField,\n\ttemplatePartAuthorField,\n} from './fields';\n\nconst { ExperimentalBlockEditorProvider } = unlock( blockEditorPrivateApis );\nconst { usePostActions, patternTitleField } = unlock( editorPrivateApis );\nconst { useLocation, useHistory } = unlock( routerPrivateApis );\n\nconst EMPTY_ARRAY = [];\nconst defaultLayouts = {\n\t[ LAYOUT_TABLE ]: {\n\t\tlayout: {\n\t\t\tstyles: {\n\t\t\t\tauthor: {\n\t\t\t\t\twidth: '1%',\n\t\t\t\t},\n\t\t\t},\n\t\t},\n\t},\n\t[ LAYOUT_GRID ]: {\n\t\tlayout: {\n\t\t\tbadgeFields: [ 'sync-status' ],\n\t\t},\n\t},\n};\nconst DEFAULT_VIEW = {\n\ttype: LAYOUT_GRID,\n\tsearch: '',\n\tpage: 1,\n\tperPage: 20,\n\ttitleField: 'title',\n\tmediaField: 'preview',\n\tfields: [ 'sync-status' ],\n\tfilters: [],\n\t...defaultLayouts[ LAYOUT_GRID ],\n};\n\nexport default function DataviewsPatterns() {\n\tconst {\n\t\tquery: { postType = 'wp_block', categoryId: categoryIdFromURL },\n\t} = useLocation();\n\tconst history = useHistory();\n\tconst categoryId = categoryIdFromURL || PATTERN_DEFAULT_CATEGORY;\n\tconst [ view, setView ] = useState( DEFAULT_VIEW );\n\tconst previousCategoryId = usePrevious( categoryId );\n\tconst previousPostType = usePrevious( postType );\n\tconst viewSyncStatus = view.filters?.find(\n\t\t( { field } ) => field === 'sync-status'\n\t)?.value;\n\tconst { patterns, isResolving } = usePatterns( postType, categoryId, {\n\t\tsearch: view.search,\n\t\tsyncStatus: viewSyncStatus,\n\t} );\n\n\tconst { records } = useEntityRecords( 'postType', TEMPLATE_PART_POST_TYPE, {\n\t\tper_page: -1,\n\t} );\n\n\tconst authors = useMemo( () => {\n\t\tif ( ! records ) {\n\t\t\treturn EMPTY_ARRAY;\n\t\t}\n\t\tconst authorsSet = new Set();\n\t\trecords.forEach( ( template ) => {\n\t\t\tauthorsSet.add( template.author_text );\n\t\t} );\n\t\treturn Array.from( authorsSet ).map( ( author ) => ( {\n\t\t\tvalue: author,\n\t\t\tlabel: author,\n\t\t} ) );\n\t}, [ records ] );\n\n\tconst fields = useMemo( () => {\n\t\tconst _fields = [ previewField, patternTitleField ];\n\n\t\tif ( postType === PATTERN_TYPES.user ) {\n\t\t\t_fields.push( patternStatusField );\n\t\t} else if ( postType === TEMPLATE_PART_POST_TYPE ) {\n\t\t\t_fields.push( {\n\t\t\t\t...templatePartAuthorField,\n\t\t\t\telements: authors,\n\t\t\t} );\n\t\t}\n\n\t\treturn _fields;\n\t}, [ postType, authors ] );\n\n\t// Reset the page number when the category changes.\n\tuseEffect( () => {\n\t\tif (\n\t\t\tpreviousCategoryId !== categoryId ||\n\t\t\tpreviousPostType !== postType\n\t\t) {\n\t\t\tsetView( ( prevView ) => ( { ...prevView, page: 1 } ) );\n\t\t}\n\t}, [ categoryId, previousCategoryId, previousPostType, postType ] );\n\tconst { data, paginationInfo } = useMemo( () => {\n\t\t// Search is managed server-side as well as filters for patterns.\n\t\t// However, the author filter in template parts is done client-side.\n\t\tconst viewWithoutFilters = { ...view };\n\t\tdelete viewWithoutFilters.search;\n\t\tif ( postType !== TEMPLATE_PART_POST_TYPE ) {\n\t\t\tviewWithoutFilters.filters = [];\n\t\t}\n\t\treturn filterSortAndPaginate( patterns, viewWithoutFilters, fields );\n\t}, [ patterns, view, fields, postType ] );\n\n\tconst dataWithPermissions = useAugmentPatternsWithPermissions( data );\n\n\tconst templatePartActions = usePostActions( {\n\t\tpostType: TEMPLATE_PART_POST_TYPE,\n\t\tcontext: 'list',\n\t} );\n\tconst patternActions = usePostActions( {\n\t\tpostType: PATTERN_TYPES.user,\n\t\tcontext: 'list',\n\t} );\n\tconst editAction = useEditPostAction();\n\n\tconst actions = useMemo( () => {\n\t\tif ( postType === TEMPLATE_PART_POST_TYPE ) {\n\t\t\treturn [ editAction, ...templatePartActions ].filter( Boolean );\n\t\t}\n\t\treturn [ editAction, ...patternActions ].filter( Boolean );\n\t}, [ editAction, postType, templatePartActions, patternActions ] );\n\tconst id = useId();\n\tconst settings = usePatternSettings();\n\t// Wrap everything in a block editor provider.\n\t// This ensures 'styles' that are needed for the previews are synced\n\t// from the site editor store to the block editor store.\n\treturn (\n\t\t<ExperimentalBlockEditorProvider settings={ settings }>\n\t\t\t<Page\n\t\t\t\ttitle={ __( 'Patterns content' ) }\n\t\t\t\tclassName=\"edit-site-page-patterns-dataviews\"\n\t\t\t\thideTitleFromUI\n\t\t\t>\n\t\t\t\t<PatternsHeader\n\t\t\t\t\tcategoryId={ categoryId }\n\t\t\t\t\ttype={ postType }\n\t\t\t\t\ttitleId={ `${ id }-title` }\n\t\t\t\t\tdescriptionId={ `${ id }-description` }\n\t\t\t\t/>\n\t\t\t\t<DataViews\n\t\t\t\t\tkey={ categoryId + postType }\n\t\t\t\t\tpaginationInfo={ paginationInfo }\n\t\t\t\t\tfields={ fields }\n\t\t\t\t\tactions={ actions }\n\t\t\t\t\tdata={ dataWithPermissions || EMPTY_ARRAY }\n\t\t\t\t\tgetItemId={ ( item ) => item.name ?? item.id }\n\t\t\t\t\tisLoading={ isResolving }\n\t\t\t\t\tisItemClickable={ ( item ) =>\n\t\t\t\t\t\titem.type !== PATTERN_TYPES.theme\n\t\t\t\t\t}\n\t\t\t\t\tonClickItem={ ( item ) => {\n\t\t\t\t\t\thistory.navigate(\n\t\t\t\t\t\t\t`/${ item.type }/${\n\t\t\t\t\t\t\t\t[\n\t\t\t\t\t\t\t\t\tPATTERN_TYPES.user,\n\t\t\t\t\t\t\t\t\tTEMPLATE_PART_POST_TYPE,\n\t\t\t\t\t\t\t\t].includes( item.type )\n\t\t\t\t\t\t\t\t\t? item.id\n\t\t\t\t\t\t\t\t\t: item.name\n\t\t\t\t\t\t\t}?canvas=edit`\n\t\t\t\t\t\t);\n\t\t\t\t\t} }\n\t\t\t\t\tview={ view }\n\t\t\t\t\tonChangeView={ setView }\n\t\t\t\t\tdefaultLayouts={ defaultLayouts }\n\t\t\t\t/>\n\t\t\t</Page>\n\t\t</ExperimentalBlockEditorProvider>\n\t);\n}\n"],"mappings":";AAAA;AACA;AACA;AACA,SAASA,EAAE,QAAQ,iBAAiB;AACpC,SAASC,QAAQ,EAAEC,OAAO,EAAEC,KAAK,EAAEC,SAAS,QAAQ,oBAAoB;AACxE,SAASC,WAAW,IAAIC,sBAAsB,QAAQ,yBAAyB;AAC/E,SAASC,SAAS,EAAEC,qBAAqB,QAAQ,sBAAsB;AACvE,SAASC,WAAW,QAAQ,oBAAoB;AAChD,SAASC,gBAAgB,QAAQ,sBAAsB;AACvD,SAASL,WAAW,IAAIM,iBAAiB,QAAQ,mBAAmB;AACpE,SAASN,WAAW,IAAIO,iBAAiB,QAAQ,mBAAmB;;AAEpE;AACA;AACA;AACA,OAAOC,IAAI,MAAM,SAAS;AAC1B,SACCC,WAAW,EACXC,YAAY,EACZC,aAAa,EACbC,uBAAuB,EACvBC,wBAAwB,QAClB,uBAAuB;AAC9B,OAAOC,kBAAkB,MAAM,wBAAwB;AACvD,SAASC,MAAM,QAAQ,mBAAmB;AAC1C,OAAOC,WAAW,IAAIC,iCAAiC,QAAQ,gBAAgB;AAC/E,OAAOC,cAAc,MAAM,UAAU;AACrC,SAASC,iBAAiB,QAAQ,sBAAsB;AACxD,SACCC,kBA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,CAACT,EAAE;QAAA,CAAE;QAC9CY,SAAS,EAAG3C,WAAa;QACzB4C,eAAe,EAAKJ,IAAI,IACvBA,IAAI,CAAC/D,IAAI,KAAK7B,aAAa,CAACiG,KAC5B;QACDC,WAAW,EAAKN,IAAI,IAAM;UACzBlD,OAAO,CAACyD,QAAQ,CACf,IAAKP,IAAI,CAAC/D,IAAI,IACb,CACC7B,aAAa,CAACoE,IAAI,EAClBnE,uBAAuB,CACvB,CAACmG,QAAQ,CAAER,IAAI,CAAC/D,IAAK,CAAC,GACpB+D,IAAI,CAACT,EAAE,GACPS,IAAI,CAACE,IAAI,cAEd,CAAC;QACF,CAAG;QACHnD,IAAI,EAAGA,IAAM;QACb0D,YAAY,EAAGzD,OAAS;QACxBtB,cAAc,EAAGA;MAAgB,GAxB3BkB,UAAU,GAAGD,QAyBnB,CAAC;IAAA,CACG;EAAC,CACyB,CAAC;AAEpC","ignoreList":[]}
|
|
@@ -8,7 +8,6 @@ import { privateApis as corePrivateApis } from '@wordpress/core-data';
|
|
|
8
8
|
import { DataViews, filterSortAndPaginate } from '@wordpress/dataviews';
|
|
9
9
|
import { privateApis as routerPrivateApis } from '@wordpress/router';
|
|
10
10
|
import { privateApis as editorPrivateApis } from '@wordpress/editor';
|
|
11
|
-
import { templateTitleField } from '@wordpress/fields';
|
|
12
11
|
import { addQueryArgs } from '@wordpress/url';
|
|
13
12
|
|
|
14
13
|
/**
|
|
@@ -23,7 +22,8 @@ import { authorField, descriptionField, previewField } from './fields';
|
|
|
23
22
|
import { useEvent } from '@wordpress/compose';
|
|
24
23
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
25
24
|
const {
|
|
26
|
-
usePostActions
|
|
25
|
+
usePostActions,
|
|
26
|
+
templateTitleField
|
|
27
27
|
} = unlock(editorPrivateApis);
|
|
28
28
|
const {
|
|
29
29
|
useHistory,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["__","useState","useMemo","useCallback","useEffect","privateApis","corePrivateApis","DataViews","filterSortAndPaginate","routerPrivateApis","editorPrivateApis","templateTitleField","addQueryArgs","Page","AddNewTemplate","TEMPLATE_POST_TYPE","OPERATOR_IS_ANY","LAYOUT_GRID","LAYOUT_TABLE","LAYOUT_LIST","unlock","useEditPostAction","authorField","descriptionField","previewField","useEvent","jsx","_jsx","usePostActions","useHistory","useLocation","useEntityRecordsWithPermissions","EMPTY_ARRAY","defaultLayouts","showMedia","layout","styles","author","width","DEFAULT_VIEW","type","search","page","perPage","sort","field","direction","titleField","mediaField","fields","filters","PageTemplates","path","query","activeView","postId","selection","setSelection","defaultView","usedType","operator","value","view","setView","currentView","records","isResolving","isLoadingData","per_page","history","onChangeSelection","items","navigate","length","undefined","authors","authorsSet","Set","forEach","template","add","author_text","Array","from","map","label","elements","data","paginationInfo","postTypeActions","postType","context","editAction","actions","onChangeView","newView","className","title","children","isLoading","isItemClickable","onClickItem","id"],"sources":["@wordpress/edit-site/src/components/page-templates/index.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { __ } from '@wordpress/i18n';\nimport { useState, useMemo, useCallback, useEffect } from '@wordpress/element';\nimport { privateApis as corePrivateApis } from '@wordpress/core-data';\nimport { DataViews, filterSortAndPaginate } from '@wordpress/dataviews';\nimport { privateApis as routerPrivateApis } from '@wordpress/router';\nimport { privateApis as editorPrivateApis } from '@wordpress/editor';\nimport { templateTitleField } from '@wordpress/fields';\nimport { addQueryArgs } from '@wordpress/url';\n\n/**\n * Internal dependencies\n */\nimport Page from '../page';\nimport AddNewTemplate from '../add-new-template';\nimport {\n\tTEMPLATE_POST_TYPE,\n\tOPERATOR_IS_ANY,\n\tLAYOUT_GRID,\n\tLAYOUT_TABLE,\n\tLAYOUT_LIST,\n} from '../../utils/constants';\nimport { unlock } from '../../lock-unlock';\nimport { useEditPostAction } from '../dataviews-actions';\nimport { authorField, descriptionField, previewField } from './fields';\nimport { useEvent } from '@wordpress/compose';\n\nconst { usePostActions } = unlock( editorPrivateApis );\nconst { useHistory, useLocation } = unlock( routerPrivateApis );\nconst { useEntityRecordsWithPermissions } = unlock( corePrivateApis );\n\nconst EMPTY_ARRAY = [];\n\nconst defaultLayouts = {\n\t[ LAYOUT_TABLE ]: {\n\t\tshowMedia: false,\n\t\tlayout: {\n\t\t\tstyles: {\n\t\t\t\tauthor: {\n\t\t\t\t\twidth: '1%',\n\t\t\t\t},\n\t\t\t},\n\t\t},\n\t},\n\t[ LAYOUT_GRID ]: {\n\t\tshowMedia: true,\n\t},\n\t[ LAYOUT_LIST ]: {\n\t\tshowMedia: false,\n\t},\n};\n\nconst DEFAULT_VIEW = {\n\ttype: LAYOUT_GRID,\n\tsearch: '',\n\tpage: 1,\n\tperPage: 20,\n\tsort: {\n\t\tfield: 'title',\n\t\tdirection: 'asc',\n\t},\n\ttitleField: 'title',\n\tdescriptionField: 'description',\n\tmediaField: 'preview',\n\tfields: [ 'author' ],\n\tfilters: [],\n\t...defaultLayouts[ LAYOUT_GRID ],\n};\n\nexport default function PageTemplates() {\n\tconst { path, query } = useLocation();\n\tconst { activeView = 'all', layout, postId } = query;\n\tconst [ selection, setSelection ] = useState( [ postId ] );\n\n\tconst defaultView = useMemo( () => {\n\t\tconst usedType = layout ?? DEFAULT_VIEW.type;\n\t\treturn {\n\t\t\t...DEFAULT_VIEW,\n\t\t\ttype: usedType,\n\t\t\tfilters:\n\t\t\t\tactiveView !== 'all'\n\t\t\t\t\t? [\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tfield: 'author',\n\t\t\t\t\t\t\t\toperator: 'isAny',\n\t\t\t\t\t\t\t\tvalue: [ activeView ],\n\t\t\t\t\t\t\t},\n\t\t\t\t\t ]\n\t\t\t\t\t: [],\n\t\t\t...defaultLayouts[ usedType ],\n\t\t};\n\t}, [ layout, activeView ] );\n\tconst [ view, setView ] = useState( defaultView );\n\n\t// Sync the layout from the URL to the view state.\n\tuseEffect( () => {\n\t\tsetView( ( currentView ) => ( {\n\t\t\t...currentView,\n\t\t\ttype: layout ?? DEFAULT_VIEW.type,\n\t\t} ) );\n\t}, [ setView, layout ] );\n\n\t// Sync the active view from the URL to the view state.\n\tuseEffect( () => {\n\t\tsetView( ( currentView ) => ( {\n\t\t\t...currentView,\n\t\t\tfilters:\n\t\t\t\tactiveView !== 'all'\n\t\t\t\t\t? [\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tfield: 'author',\n\t\t\t\t\t\t\t\toperator: OPERATOR_IS_ANY,\n\t\t\t\t\t\t\t\tvalue: [ activeView ],\n\t\t\t\t\t\t\t},\n\t\t\t\t\t ]\n\t\t\t\t\t: [],\n\t\t} ) );\n\t}, [ setView, activeView ] );\n\n\tconst { records, isResolving: isLoadingData } =\n\t\tuseEntityRecordsWithPermissions( 'postType', TEMPLATE_POST_TYPE, {\n\t\t\tper_page: -1,\n\t\t} );\n\tconst history = useHistory();\n\tconst onChangeSelection = useCallback(\n\t\t( items ) => {\n\t\t\tsetSelection( items );\n\t\t\tif ( view?.type === LAYOUT_LIST ) {\n\t\t\t\thistory.navigate(\n\t\t\t\t\taddQueryArgs( path, {\n\t\t\t\t\t\tpostId: items.length === 1 ? items[ 0 ] : undefined,\n\t\t\t\t\t} )\n\t\t\t\t);\n\t\t\t}\n\t\t},\n\t\t[ history, path, view?.type ]\n\t);\n\n\tconst authors = useMemo( () => {\n\t\tif ( ! records ) {\n\t\t\treturn EMPTY_ARRAY;\n\t\t}\n\t\tconst authorsSet = new Set();\n\t\trecords.forEach( ( template ) => {\n\t\t\tauthorsSet.add( template.author_text );\n\t\t} );\n\t\treturn Array.from( authorsSet ).map( ( author ) => ( {\n\t\t\tvalue: author,\n\t\t\tlabel: author,\n\t\t} ) );\n\t}, [ records ] );\n\n\tconst fields = useMemo(\n\t\t() => [\n\t\t\tpreviewField,\n\t\t\ttemplateTitleField,\n\t\t\tdescriptionField,\n\t\t\t{\n\t\t\t\t...authorField,\n\t\t\t\telements: authors,\n\t\t\t},\n\t\t],\n\t\t[ authors ]\n\t);\n\n\tconst { data, paginationInfo } = useMemo( () => {\n\t\treturn filterSortAndPaginate( records, view, fields );\n\t}, [ records, view, fields ] );\n\n\tconst postTypeActions = usePostActions( {\n\t\tpostType: TEMPLATE_POST_TYPE,\n\t\tcontext: 'list',\n\t} );\n\tconst editAction = useEditPostAction();\n\tconst actions = useMemo(\n\t\t() => [ editAction, ...postTypeActions ],\n\t\t[ postTypeActions, editAction ]\n\t);\n\n\tconst onChangeView = useEvent( ( newView ) => {\n\t\tsetView( newView );\n\t\tif ( newView.type !== layout ) {\n\t\t\thistory.navigate(\n\t\t\t\taddQueryArgs( path, {\n\t\t\t\t\tlayout: newView.type,\n\t\t\t\t} )\n\t\t\t);\n\t\t}\n\t} );\n\n\treturn (\n\t\t<Page\n\t\t\tclassName=\"edit-site-page-templates\"\n\t\t\ttitle={ __( 'Templates' ) }\n\t\t\tactions={ <AddNewTemplate /> }\n\t\t>\n\t\t\t<DataViews\n\t\t\t\tkey={ activeView }\n\t\t\t\tpaginationInfo={ paginationInfo }\n\t\t\t\tfields={ fields }\n\t\t\t\tactions={ actions }\n\t\t\t\tdata={ data }\n\t\t\t\tisLoading={ isLoadingData }\n\t\t\t\tview={ view }\n\t\t\t\tonChangeView={ onChangeView }\n\t\t\t\tonChangeSelection={ onChangeSelection }\n\t\t\t\tisItemClickable={ () => true }\n\t\t\t\tonClickItem={ ( { id } ) => {\n\t\t\t\t\thistory.navigate( `/wp_template/${ id }?canvas=edit` );\n\t\t\t\t} }\n\t\t\t\tselection={ selection }\n\t\t\t\tdefaultLayouts={ defaultLayouts }\n\t\t\t/>\n\t\t</Page>\n\t);\n}\n"],"mappings":";AAAA;AACA;AACA;AACA,SAASA,EAAE,QAAQ,iBAAiB;AACpC,SAASC,QAAQ,EAAEC,OAAO,EAAEC,WAAW,EAAEC,SAAS,QAAQ,oBAAoB;AAC9E,SAASC,WAAW,IAAIC,eAAe,QAAQ,sBAAsB;AACrE,SAASC,SAAS,EAAEC,qBAAqB,QAAQ,sBAAsB;AACvE,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,IAAI;IACJmF,SAAS,EAAC,0BAA0B;IACpCC,KAAK,EAAGjG,EAAE,CAAE,WAAY,CAAG;IAC3B6F,OAAO,eAAGlE,IAAA,CAACb,cAAc,IAAE,CAAG;IAAAoF,QAAA,eAE9BvE,IAAA,CAACpB,SAAS;MAETiF,cAAc,EAAGA,cAAgB;MACjCvC,MAAM,EAAGA,MAAQ;MACjB4C,OAAO,EAAGA,OAAS;MACnBN,IAAI,EAAGA,IAAM;MACbY,SAAS,EAAGhC,aAAe;MAC3BL,IAAI,EAAGA,IAAM;MACbgC,YAAY,EAAGA,YAAc;MAC7BxB,iBAAiB,EAAGA,iBAAmB;MACvC8B,eAAe,EAAGA,CAAA,KAAM,IAAM;MAC9BC,WAAW,EAAGA,CAAE;QAAEC;MAAG,CAAC,KAAM;QAC3BjC,OAAO,CAACG,QAAQ,CAAE,gBAAiB8B,EAAE,cAAgB,CAAC;MACvD,CAAG;MACH9C,SAAS,EAAGA,SAAW;MACvBvB,cAAc,EAAGA;IAAgB,GAd3BqB,UAeN;EAAC,CACG,CAAC;AAET","ignoreList":[]}
|
|
1
|
+
{"version":3,"names":["__","useState","useMemo","useCallback","useEffect","privateApis","corePrivateApis","DataViews","filterSortAndPaginate","routerPrivateApis","editorPrivateApis","addQueryArgs","Page","AddNewTemplate","TEMPLATE_POST_TYPE","OPERATOR_IS_ANY","LAYOUT_GRID","LAYOUT_TABLE","LAYOUT_LIST","unlock","useEditPostAction","authorField","descriptionField","previewField","useEvent","jsx","_jsx","usePostActions","templateTitleField","useHistory","useLocation","useEntityRecordsWithPermissions","EMPTY_ARRAY","defaultLayouts","showMedia","layout","styles","author","width","DEFAULT_VIEW","type","search","page","perPage","sort","field","direction","titleField","mediaField","fields","filters","PageTemplates","path","query","activeView","postId","selection","setSelection","defaultView","usedType","operator","value","view","setView","currentView","records","isResolving","isLoadingData","per_page","history","onChangeSelection","items","navigate","length","undefined","authors","authorsSet","Set","forEach","template","add","author_text","Array","from","map","label","elements","data","paginationInfo","postTypeActions","postType","context","editAction","actions","onChangeView","newView","className","title","children","isLoading","isItemClickable","onClickItem","id"],"sources":["@wordpress/edit-site/src/components/page-templates/index.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { __ } from '@wordpress/i18n';\nimport { useState, useMemo, useCallback, useEffect } from '@wordpress/element';\nimport { privateApis as corePrivateApis } from '@wordpress/core-data';\nimport { DataViews, filterSortAndPaginate } from '@wordpress/dataviews';\nimport { privateApis as routerPrivateApis } from '@wordpress/router';\nimport { privateApis as editorPrivateApis } from '@wordpress/editor';\nimport { addQueryArgs } from '@wordpress/url';\n\n/**\n * Internal dependencies\n */\nimport Page from '../page';\nimport AddNewTemplate from '../add-new-template';\nimport {\n\tTEMPLATE_POST_TYPE,\n\tOPERATOR_IS_ANY,\n\tLAYOUT_GRID,\n\tLAYOUT_TABLE,\n\tLAYOUT_LIST,\n} from '../../utils/constants';\nimport { unlock } from '../../lock-unlock';\nimport { useEditPostAction } from '../dataviews-actions';\nimport { authorField, descriptionField, previewField } from './fields';\nimport { useEvent } from '@wordpress/compose';\n\nconst { usePostActions, templateTitleField } = unlock( editorPrivateApis );\nconst { useHistory, useLocation } = unlock( routerPrivateApis );\nconst { useEntityRecordsWithPermissions } = unlock( corePrivateApis );\n\nconst EMPTY_ARRAY = [];\n\nconst defaultLayouts = {\n\t[ LAYOUT_TABLE ]: {\n\t\tshowMedia: false,\n\t\tlayout: {\n\t\t\tstyles: {\n\t\t\t\tauthor: {\n\t\t\t\t\twidth: '1%',\n\t\t\t\t},\n\t\t\t},\n\t\t},\n\t},\n\t[ LAYOUT_GRID ]: {\n\t\tshowMedia: true,\n\t},\n\t[ LAYOUT_LIST ]: {\n\t\tshowMedia: false,\n\t},\n};\n\nconst DEFAULT_VIEW = {\n\ttype: LAYOUT_GRID,\n\tsearch: '',\n\tpage: 1,\n\tperPage: 20,\n\tsort: {\n\t\tfield: 'title',\n\t\tdirection: 'asc',\n\t},\n\ttitleField: 'title',\n\tdescriptionField: 'description',\n\tmediaField: 'preview',\n\tfields: [ 'author' ],\n\tfilters: [],\n\t...defaultLayouts[ LAYOUT_GRID ],\n};\n\nexport default function PageTemplates() {\n\tconst { path, query } = useLocation();\n\tconst { activeView = 'all', layout, postId } = query;\n\tconst [ selection, setSelection ] = useState( [ postId ] );\n\n\tconst defaultView = useMemo( () => {\n\t\tconst usedType = layout ?? DEFAULT_VIEW.type;\n\t\treturn {\n\t\t\t...DEFAULT_VIEW,\n\t\t\ttype: usedType,\n\t\t\tfilters:\n\t\t\t\tactiveView !== 'all'\n\t\t\t\t\t? [\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tfield: 'author',\n\t\t\t\t\t\t\t\toperator: 'isAny',\n\t\t\t\t\t\t\t\tvalue: [ activeView ],\n\t\t\t\t\t\t\t},\n\t\t\t\t\t ]\n\t\t\t\t\t: [],\n\t\t\t...defaultLayouts[ usedType ],\n\t\t};\n\t}, [ layout, activeView ] );\n\tconst [ view, setView ] = useState( defaultView );\n\n\t// Sync the layout from the URL to the view state.\n\tuseEffect( () => {\n\t\tsetView( ( currentView ) => ( {\n\t\t\t...currentView,\n\t\t\ttype: layout ?? DEFAULT_VIEW.type,\n\t\t} ) );\n\t}, [ setView, layout ] );\n\n\t// Sync the active view from the URL to the view state.\n\tuseEffect( () => {\n\t\tsetView( ( currentView ) => ( {\n\t\t\t...currentView,\n\t\t\tfilters:\n\t\t\t\tactiveView !== 'all'\n\t\t\t\t\t? [\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tfield: 'author',\n\t\t\t\t\t\t\t\toperator: OPERATOR_IS_ANY,\n\t\t\t\t\t\t\t\tvalue: [ activeView ],\n\t\t\t\t\t\t\t},\n\t\t\t\t\t ]\n\t\t\t\t\t: [],\n\t\t} ) );\n\t}, [ setView, activeView ] );\n\n\tconst { records, isResolving: isLoadingData } =\n\t\tuseEntityRecordsWithPermissions( 'postType', TEMPLATE_POST_TYPE, {\n\t\t\tper_page: -1,\n\t\t} );\n\tconst history = useHistory();\n\tconst onChangeSelection = useCallback(\n\t\t( items ) => {\n\t\t\tsetSelection( items );\n\t\t\tif ( view?.type === LAYOUT_LIST ) {\n\t\t\t\thistory.navigate(\n\t\t\t\t\taddQueryArgs( path, {\n\t\t\t\t\t\tpostId: items.length === 1 ? items[ 0 ] : undefined,\n\t\t\t\t\t} )\n\t\t\t\t);\n\t\t\t}\n\t\t},\n\t\t[ history, path, view?.type ]\n\t);\n\n\tconst authors = useMemo( () => {\n\t\tif ( ! records ) {\n\t\t\treturn EMPTY_ARRAY;\n\t\t}\n\t\tconst authorsSet = new Set();\n\t\trecords.forEach( ( template ) => {\n\t\t\tauthorsSet.add( template.author_text );\n\t\t} );\n\t\treturn Array.from( authorsSet ).map( ( author ) => ( {\n\t\t\tvalue: author,\n\t\t\tlabel: author,\n\t\t} ) );\n\t}, [ records ] );\n\n\tconst fields = useMemo(\n\t\t() => [\n\t\t\tpreviewField,\n\t\t\ttemplateTitleField,\n\t\t\tdescriptionField,\n\t\t\t{\n\t\t\t\t...authorField,\n\t\t\t\telements: authors,\n\t\t\t},\n\t\t],\n\t\t[ authors ]\n\t);\n\n\tconst { data, paginationInfo } = useMemo( () => {\n\t\treturn filterSortAndPaginate( records, view, fields );\n\t}, [ records, view, fields ] );\n\n\tconst postTypeActions = usePostActions( {\n\t\tpostType: TEMPLATE_POST_TYPE,\n\t\tcontext: 'list',\n\t} );\n\tconst editAction = useEditPostAction();\n\tconst actions = useMemo(\n\t\t() => [ editAction, ...postTypeActions ],\n\t\t[ postTypeActions, editAction ]\n\t);\n\n\tconst onChangeView = useEvent( ( newView ) => {\n\t\tsetView( newView );\n\t\tif ( newView.type !== layout ) {\n\t\t\thistory.navigate(\n\t\t\t\taddQueryArgs( path, {\n\t\t\t\t\tlayout: newView.type,\n\t\t\t\t} )\n\t\t\t);\n\t\t}\n\t} );\n\n\treturn (\n\t\t<Page\n\t\t\tclassName=\"edit-site-page-templates\"\n\t\t\ttitle={ __( 'Templates' ) }\n\t\t\tactions={ <AddNewTemplate /> }\n\t\t>\n\t\t\t<DataViews\n\t\t\t\tkey={ activeView }\n\t\t\t\tpaginationInfo={ paginationInfo }\n\t\t\t\tfields={ fields }\n\t\t\t\tactions={ actions }\n\t\t\t\tdata={ data }\n\t\t\t\tisLoading={ isLoadingData }\n\t\t\t\tview={ view }\n\t\t\t\tonChangeView={ onChangeView }\n\t\t\t\tonChangeSelection={ onChangeSelection }\n\t\t\t\tisItemClickable={ () => true }\n\t\t\t\tonClickItem={ ( { id } ) => {\n\t\t\t\t\thistory.navigate( `/wp_template/${ id }?canvas=edit` );\n\t\t\t\t} }\n\t\t\t\tselection={ selection }\n\t\t\t\tdefaultLayouts={ defaultLayouts }\n\t\t\t/>\n\t\t</Page>\n\t);\n}\n"],"mappings":";AAAA;AACA;AACA;AACA,SAASA,EAAE,QAAQ,iBAAiB;AACpC,SAASC,QAAQ,EAAEC,OAAO,EAAEC,WAAW,EAAEC,SAAS,QAAQ,oBAAoB;AAC9E,SAASC,WAAW,IAAIC,eAAe,QAAQ,sBAAsB;AACrE,SAASC,SAAS,EAAEC,qBAAqB,QAAQ,sBAAsB;AACvE,SAASH,WAAW,IAAII,iBAAiB,QAAQ,mBAAmB;AACpE,SAASJ,WAAW,IAAIK,iBAAiB,QAAQ,mBAAmB;AACpE,SAASC,YAAY,QAAQ,gBAAgB;;AAE7C;AACA;AACA;AACA,OAAOC,IAAI,MAAM,SAAS;AAC1B,OAAOC,cAAc,MAAM,qBAAqB;AAChD,SACCC,kBAAkB,EAClBC,eAAe,EACfC,WAAW,EACXC,YAAY,EACZC,WAAW,QACL,uBAAuB;AAC9B,SAASC,MAAM,QAAQ,mBAAmB;AAC1C,SAASC,iBAAiB,QAAQ,sBAAsB;AACxD,SAASC,WAAW,EAAEC,gBAAgB,EAAEC,YAAY,QAAQ,UAAU;AACtE,SAASC,QAAQ,QAAQ,oBAAoB;AAAC,SAAAC,GAAA,IAAAC,IAAA;AAE9C,MAAM;EAAEC,c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BAAiB8B,EAAE,cAAgB,CAAC;MACvD,CAAG;MACH9C,SAAS,EAAGA,SAAW;MACvBvB,cAAc,EAAGA;IAAgB,GAd3BqB,UAeN;EAAC,CACG,CAAC;AAET","ignoreList":[]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["clsx","__experimentalHStack","HStack","__experimentalText","Text","Button","__","_x","_n","sprintf","isRTL","previous","chevronLeft","chevronRight","next","jsx","_jsx","jsxs","_jsxs","Pagination","currentPage","numPages","changePage","totalItems","className","disabled","buttonVariant","label","expanded","as","spacing","justify","children","variant","onClick","accessibleWhenDisabled","icon","size"],"sources":["@wordpress/edit-site/src/components/pagination/index.js"],"sourcesContent":["/**\n * External dependencies\n */\nimport clsx from 'clsx';\n\n/**\n * WordPress dependencies\n */\nimport {\n\t__experimentalHStack as HStack,\n\t__experimentalText as Text,\n\tButton,\n} from '@wordpress/components';\nimport { __, _x, _n, sprintf, isRTL } from '@wordpress/i18n';\nimport { previous, chevronLeft, chevronRight, next } from '@wordpress/icons';\n\nexport default function Pagination( {\n\tcurrentPage,\n\tnumPages,\n\tchangePage,\n\ttotalItems,\n\tclassName,\n\tdisabled = false,\n\tbuttonVariant = 'tertiary',\n\tlabel = __( 'Pagination
|
|
1
|
+
{"version":3,"names":["clsx","__experimentalHStack","HStack","__experimentalText","Text","Button","__","_x","_n","sprintf","isRTL","previous","chevronLeft","chevronRight","next","jsx","_jsx","jsxs","_jsxs","Pagination","currentPage","numPages","changePage","totalItems","className","disabled","buttonVariant","label","expanded","as","spacing","justify","children","variant","onClick","accessibleWhenDisabled","icon","size"],"sources":["@wordpress/edit-site/src/components/pagination/index.js"],"sourcesContent":["/**\n * External dependencies\n */\nimport clsx from 'clsx';\n\n/**\n * WordPress dependencies\n */\nimport {\n\t__experimentalHStack as HStack,\n\t__experimentalText as Text,\n\tButton,\n} from '@wordpress/components';\nimport { __, _x, _n, sprintf, isRTL } from '@wordpress/i18n';\nimport { previous, chevronLeft, chevronRight, next } from '@wordpress/icons';\n\nexport default function Pagination( {\n\tcurrentPage,\n\tnumPages,\n\tchangePage,\n\ttotalItems,\n\tclassName,\n\tdisabled = false,\n\tbuttonVariant = 'tertiary',\n\tlabel = __( 'Pagination' ),\n} ) {\n\treturn (\n\t\t<HStack\n\t\t\texpanded={ false }\n\t\t\tas=\"nav\"\n\t\t\taria-label={ label }\n\t\t\tspacing={ 3 }\n\t\t\tjustify=\"flex-start\"\n\t\t\tclassName={ clsx( 'edit-site-pagination', className ) }\n\t\t>\n\t\t\t<Text variant=\"muted\" className=\"edit-site-pagination__total\">\n\t\t\t\t{\n\t\t\t\t\t// translators: %s: Total number of patterns.\n\t\t\t\t\tsprintf(\n\t\t\t\t\t\t// translators: %s: Total number of patterns.\n\t\t\t\t\t\t_n( '%s item', '%s items', totalItems ),\n\t\t\t\t\t\ttotalItems\n\t\t\t\t\t)\n\t\t\t\t}\n\t\t\t</Text>\n\t\t\t<HStack expanded={ false } spacing={ 1 }>\n\t\t\t\t<Button\n\t\t\t\t\tvariant={ buttonVariant }\n\t\t\t\t\tonClick={ () => changePage( 1 ) }\n\t\t\t\t\taccessibleWhenDisabled\n\t\t\t\t\tdisabled={ disabled || currentPage === 1 }\n\t\t\t\t\tlabel={ __( 'First page' ) }\n\t\t\t\t\ticon={ isRTL() ? next : previous }\n\t\t\t\t\tsize=\"compact\"\n\t\t\t\t/>\n\t\t\t\t<Button\n\t\t\t\t\tvariant={ buttonVariant }\n\t\t\t\t\tonClick={ () => changePage( currentPage - 1 ) }\n\t\t\t\t\taccessibleWhenDisabled\n\t\t\t\t\tdisabled={ disabled || currentPage === 1 }\n\t\t\t\t\tlabel={ __( 'Previous page' ) }\n\t\t\t\t\ticon={ isRTL() ? chevronRight : chevronLeft }\n\t\t\t\t\tsize=\"compact\"\n\t\t\t\t/>\n\t\t\t</HStack>\n\t\t\t<Text variant=\"muted\">\n\t\t\t\t{ sprintf(\n\t\t\t\t\t// translators: 1: Current page number. 2: Total number of pages.\n\t\t\t\t\t_x( '%1$s of %2$s', 'paging' ),\n\t\t\t\t\tcurrentPage,\n\t\t\t\t\tnumPages\n\t\t\t\t) }\n\t\t\t</Text>\n\t\t\t<HStack expanded={ false } spacing={ 1 }>\n\t\t\t\t<Button\n\t\t\t\t\tvariant={ buttonVariant }\n\t\t\t\t\tonClick={ () => changePage( currentPage + 1 ) }\n\t\t\t\t\taccessibleWhenDisabled\n\t\t\t\t\tdisabled={ disabled || currentPage === numPages }\n\t\t\t\t\tlabel={ __( 'Next page' ) }\n\t\t\t\t\ticon={ isRTL() ? chevronLeft : chevronRight }\n\t\t\t\t\tsize=\"compact\"\n\t\t\t\t/>\n\t\t\t\t<Button\n\t\t\t\t\tvariant={ buttonVariant }\n\t\t\t\t\tonClick={ () => changePage( numPages ) }\n\t\t\t\t\taccessibleWhenDisabled\n\t\t\t\t\tdisabled={ disabled || currentPage === numPages }\n\t\t\t\t\tlabel={ __( 'Last page' ) }\n\t\t\t\t\ticon={ isRTL() ? previous : next }\n\t\t\t\t\tsize=\"compact\"\n\t\t\t\t/>\n\t\t\t</HStack>\n\t\t</HStack>\n\t);\n}\n"],"mappings":"AAAA;AACA;AACA;AACA,OAAOA,IAAI,MAAM,MAAM;;AAEvB;AACA;AACA;AACA,SACCC,oBAAoB,IAAIC,MAAM,EAC9BC,kBAAkB,IAAIC,IAAI,EAC1BC,MAAM,QACA,uBAAuB;AAC9B,SAASC,EAAE,EAAEC,EAAE,EAAEC,EAAE,EAAEC,OAAO,EAAEC,KAAK,QAAQ,iBAAiB;AAC5D,SAASC,QAAQ,EAAEC,WAAW,EAAEC,YAAY,EAAEC,IAAI,QAAQ,kBAAkB;AAAC,SAAAC,GAAA,IAAAC,IAAA,EAAAC,IAAA,IAAAC,KAAA;AAE7E,eAAe,SAASC,UAAUA,CAAE;EACnCC,WAAW;EACXC,QAAQ;EACRC,UAAU;EACVC,UAAU;EACVC,SAAS;EACTC,QAAQ,GAAG,KAAK;EAChBC,aAAa,GAAG,UAAU;EA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;QAC7CyB,IAAI,EAAC;MAAS,CACd,CAAC;IAAA,CACK,CAAC,eACTrB,IAAA,CAACZ,IAAI;MAAC6B,OAAO,EAAC,OAAO;MAAAD,QAAA,EAClBvB,OAAO;MACR;MACAF,EAAE,CAAE,cAAc,EAAE,QAAS,CAAC,EAC9Ba,WAAW,EACXC,QACD;IAAC,CACI,CAAC,eACPH,KAAA,CAAChB,MAAM;MAAC0B,QAAQ,EAAG,KAAO;MAACE,OAAO,EAAG,CAAG;MAAAE,QAAA,gBACvChB,IAAA,CAACX,MAAM;QACN4B,OAAO,EAAGP,aAAe;QACzBQ,OAAO,EAAGA,CAAA,KAAMZ,UAAU,CAAEF,WAAW,GAAG,CAAE,CAAG;QAC/Ce,sBAAsB;QACtBV,QAAQ,EAAGA,QAAQ,IAAIL,WAAW,KAAKC,QAAU;QACjDM,KAAK,EAAGrB,EAAE,CAAE,WAAY,CAAG;QAC3B8B,IAAI,EAAG1B,KAAK,CAAC,CAAC,GAAGE,WAAW,GAAGC,YAAc;QAC7CwB,IAAI,EAAC;MAAS,CACd,CAAC,eACFrB,IAAA,CAACX,MAAM;QACN4B,OAAO,EAAGP,aAAe;QACzBQ,OAAO,EAAGA,CAAA,KAAMZ,UAAU,CAAED,QAAS,CAAG;QACxCc,sBAAsB;QACtBV,QAAQ,EAAGA,QAAQ,IAAIL,WAAW,KAAKC,QAAU;QACjDM,KAAK,EAAGrB,EAAE,CAAE,WAAY,CAAG;QAC3B8B,IAAI,EAAG1B,KAAK,CAAC,CAAC,GAAGC,QAAQ,GAAGG,IAAM;QAClCuB,IAAI,EAAC;MAAS,CACd,CAAC;IAAA,CACK,CAAC;EAAA,CACF,CAAC;AAEX","ignoreList":[]}
|
|
@@ -107,7 +107,7 @@ export const STYLE_BOOK_ALL_BLOCKS_SUBCATEGORIES = [...STYLE_BOOK_THEME_SUBCATEG
|
|
|
107
107
|
include: []
|
|
108
108
|
}];
|
|
109
109
|
|
|
110
|
-
// Style book preview categories are
|
|
110
|
+
// Style book preview categories are organized slightly differently to the editor ones.
|
|
111
111
|
export const STYLE_BOOK_PREVIEW_CATEGORIES = [{
|
|
112
112
|
slug: 'overview',
|
|
113
113
|
title: __('Overview'),
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["__","STYLE_BOOK_COLOR_GROUPS","slug","title","origin","type","STYLE_BOOK_THEME_SUBCATEGORIES","blocks","exclude","STYLE_BOOK_CATEGORIES","subcategories","include","STYLE_BOOK_ALL_BLOCKS_SUBCATEGORIES","STYLE_BOOK_PREVIEW_CATEGORIES","ROOT_CONTAINER","STYLE_BOOK_IFRAME_STYLES"],"sources":["@wordpress/edit-site/src/components/style-book/constants.ts"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { __ } from '@wordpress/i18n';\n\n/**\n * Internal dependencies\n */\nimport type { StyleBookCategory, StyleBookColorGroup } from './types';\n\nexport const STYLE_BOOK_COLOR_GROUPS: StyleBookColorGroup[] = [\n\t{\n\t\tslug: 'theme-colors',\n\t\ttitle: __( 'Theme Colors' ),\n\t\torigin: 'theme',\n\t\ttype: 'colors',\n\t},\n\t{\n\t\tslug: 'theme-gradients',\n\t\ttitle: __( 'Theme Gradients' ),\n\t\torigin: 'theme',\n\t\ttype: 'gradients',\n\t},\n\t{\n\t\tslug: 'custom-colors',\n\t\ttitle: __( 'Custom Colors' ),\n\t\torigin: 'custom',\n\t\ttype: 'colors',\n\t},\n\t{\n\t\tslug: 'custom-gradients',\n\t\ttitle: __( 'Custom Gradients' ),\n\t\torigin: 'custom', // User.\n\t\ttype: 'gradients',\n\t},\n\t{\n\t\tslug: 'duotones',\n\t\ttitle: __( 'Duotones' ),\n\t\torigin: 'theme',\n\t\ttype: 'duotones',\n\t},\n\t{\n\t\tslug: 'default-colors',\n\t\ttitle: __( 'Default Colors' ),\n\t\torigin: 'default',\n\t\ttype: 'colors',\n\t},\n\t{\n\t\tslug: 'default-gradients',\n\t\ttitle: __( 'Default Gradients' ),\n\t\torigin: 'default',\n\t\ttype: 'gradients',\n\t},\n];\n\nexport const STYLE_BOOK_THEME_SUBCATEGORIES: Omit<\n\tStyleBookCategory,\n\t'subcategories'\n>[] = [\n\t{\n\t\tslug: 'site-identity',\n\t\ttitle: __( 'Site Identity' ),\n\t\tblocks: [ 'core/site-logo', 'core/site-title', 'core/site-tagline' ],\n\t},\n\t{\n\t\tslug: 'design',\n\t\ttitle: __( 'Design' ),\n\t\tblocks: [ 'core/navigation', 'core/avatar', 'core/post-time-to-read' ],\n\t\texclude: [ 'core/home-link', 'core/navigation-link' ],\n\t},\n\t{\n\t\tslug: 'posts',\n\t\ttitle: __( 'Posts' ),\n\t\tblocks: [\n\t\t\t'core/post-title',\n\t\t\t'core/post-excerpt',\n\t\t\t'core/post-author',\n\t\t\t'core/post-author-name',\n\t\t\t'core/post-author-biography',\n\t\t\t'core/post-date',\n\t\t\t'core/post-terms',\n\t\t\t'core/term-description',\n\t\t\t'core/query-title',\n\t\t\t'core/query-no-results',\n\t\t\t'core/query-pagination',\n\t\t\t'core/query-numbers',\n\t\t],\n\t},\n\t{\n\t\tslug: 'comments',\n\t\ttitle: __( 'Comments' ),\n\t\tblocks: [\n\t\t\t'core/comments-title',\n\t\t\t'core/comments-pagination',\n\t\t\t'core/comments-pagination-numbers',\n\t\t\t'core/comments',\n\t\t\t'core/comments-author-name',\n\t\t\t'core/comment-content',\n\t\t\t'core/comment-date',\n\t\t\t'core/comment-edit-link',\n\t\t\t'core/comment-reply-link',\n\t\t\t'core/comment-template',\n\t\t\t'core/post-comments-count',\n\t\t\t'core/post-comments-link',\n\t\t],\n\t},\n];\n\nexport const STYLE_BOOK_CATEGORIES: StyleBookCategory[] = [\n\t{\n\t\tslug: 'overview',\n\t\ttitle: __( 'Overview' ),\n\t\tblocks: [],\n\t},\n\t{\n\t\tslug: 'text',\n\t\ttitle: __( 'Text' ),\n\t\tblocks: [\n\t\t\t'core/post-content',\n\t\t\t'core/home-link',\n\t\t\t'core/navigation-link',\n\t\t],\n\t},\n\t{\n\t\tslug: 'colors',\n\t\ttitle: __( 'Colors' ),\n\t\tblocks: [],\n\t},\n\t{\n\t\tslug: 'theme',\n\t\ttitle: __( 'Theme' ),\n\t\tsubcategories: STYLE_BOOK_THEME_SUBCATEGORIES,\n\t},\n\t{\n\t\tslug: 'media',\n\t\ttitle: __( 'Media' ),\n\t\tblocks: [ 'core/post-featured-image' ],\n\t},\n\t{\n\t\tslug: 'widgets',\n\t\ttitle: __( 'Widgets' ),\n\t\tblocks: [],\n\t},\n\t{\n\t\tslug: 'embed',\n\t\ttitle: __( 'Embeds' ),\n\t\tinclude: [],\n\t},\n];\n\n// Style book preview subcategories for all blocks section.\nexport const STYLE_BOOK_ALL_BLOCKS_SUBCATEGORIES: StyleBookCategory[] = [\n\t...STYLE_BOOK_THEME_SUBCATEGORIES,\n\t{\n\t\tslug: 'media',\n\t\ttitle: __( 'Media' ),\n\t\tblocks: [ 'core/post-featured-image' ],\n\t},\n\t{\n\t\tslug: 'widgets',\n\t\ttitle: __( 'Widgets' ),\n\t\tblocks: [],\n\t},\n\t{\n\t\tslug: 'embed',\n\t\ttitle: __( 'Embeds' ),\n\t\tinclude: [],\n\t},\n];\n\n// Style book preview categories are organised slightly differently to the editor ones.\nexport const STYLE_BOOK_PREVIEW_CATEGORIES: StyleBookCategory[] = [\n\t{\n\t\tslug: 'overview',\n\t\ttitle: __( 'Overview' ),\n\t\tblocks: [],\n\t},\n\t{\n\t\tslug: 'text',\n\t\ttitle: __( 'Text' ),\n\t\tblocks: [\n\t\t\t'core/post-content',\n\t\t\t'core/home-link',\n\t\t\t'core/navigation-link',\n\t\t],\n\t},\n\t{\n\t\tslug: 'colors',\n\t\ttitle: __( 'Colors' ),\n\t\tblocks: [],\n\t},\n\t{\n\t\tslug: 'blocks',\n\t\ttitle: __( 'All Blocks' ),\n\t\tblocks: [],\n\t\tsubcategories: STYLE_BOOK_ALL_BLOCKS_SUBCATEGORIES,\n\t},\n];\n\n// Forming a \"block formatting context\" to prevent margin collapsing.\n// @see https://developer.mozilla.org/en-US/docs/Web/Guide/CSS/Block_formatting_context\nconst ROOT_CONTAINER = `\n\t.is-root-container {\n\t\tdisplay: flow-root;\n\t}\n`;\n// The content area of the Style Book is rendered within an iframe so that global styles\n// are applied to elements within the entire content area. To support elements that are\n// not part of the block previews, such as headings and layout for the block previews,\n// additional CSS rules need to be passed into the iframe. These are hard-coded below.\n// Note that button styles are unset, and then focus rules from the `Button` component are\n// applied to the `button` element, targeted via `.edit-site-style-book__example`.\n// This is to ensure that browser default styles for buttons are not applied to the previews.\nexport const STYLE_BOOK_IFRAME_STYLES = `\n\tbody {\n\t\tposition: relative;\n\t\tpadding: 32px !important;\n\t}\n\n\t${ ROOT_CONTAINER }\n\n\t.edit-site-style-book__examples {\n\t\tmax-width: 1200px;\n\t\tmargin: 0 auto;\n\t}\n\n\t.edit-site-style-book__example {\n\t max-width: 900px;\n\t\tborder-radius: 2px;\n\t\tcursor: pointer;\n\t\tdisplay: flex;\n\t\tflex-direction: column;\n\t\tgap: 40px;\n\t\tpadding: 16px;\n\t\twidth: 100%;\n\t\tbox-sizing: border-box;\n\t\tscroll-margin-top: 32px;\n\t\tscroll-margin-bottom: 32px;\n\t\tmargin: 0 auto 40px auto;\n\t}\n\n\t.edit-site-style-book__example.is-selected {\n\t\tbox-shadow: 0 0 0 1px var(--wp-components-color-accent, var(--wp-admin-theme-color, #007cba));\n\t}\n\n\t.edit-site-style-book__example.is-disabled-example {\n\t\tpointer-events: none;\n\t}\n\n\t.edit-site-style-book__example:focus:not(:disabled) {\n\t\tbox-shadow: 0 0 0 var(--wp-admin-border-width-focus) var(--wp-components-color-accent, var(--wp-admin-theme-color, #007cba));\n\t\toutline: 3px solid transparent;\n\t}\n\n\t.edit-site-style-book__duotone-example > div:first-child {\n\t\tdisplay: flex;\n\t\taspect-ratio: 16 / 9;\n\t\tgrid-row: span 1;\n\t\tgrid-column: span 2;\n\t}\n\t.edit-site-style-book__duotone-example img {\n\t\twidth: 100%;\n\t\theight: 100%;\n\t\tobject-fit: cover;\n\t}\n\t.edit-site-style-book__duotone-example > div:not(:first-child) {\n\t\theight: 20px;\n\t\tborder: 1px solid color-mix( in srgb, currentColor 10%, transparent );\n\t}\n\n\t.edit-site-style-book__color-example {\n\t\tborder: 1px solid color-mix( in srgb, currentColor 10%, transparent );\n\t}\n\n\t.edit-site-style-book__subcategory-title,\n\t.edit-site-style-book__example-title {\n\t\tfont-family: -apple-system, BlinkMacSystemFont, \"Segoe UI\", Roboto, Oxygen-Sans, Ubuntu, Cantarell, \"Helvetica Neue\", sans-serif;\n\t\tfont-size: 13px;\n\t\tfont-weight: normal;\n\t\tline-height: normal;\n\t\tmargin: 0;\n\t\ttext-align: left;\n\t\tpadding-top: 8px;\n\t\tborder-top: 1px solid color-mix( in srgb, currentColor 10%, transparent );\n\t\tcolor: color-mix( in srgb, currentColor 60%, transparent );\n\t}\n\n\t.edit-site-style-book__subcategory-title {\n\t\tfont-size: 16px;\n\t\tmargin-bottom: 40px;\n \tpadding-bottom: 8px;\n\t}\n\n\t.edit-site-style-book__example-preview {\n\t\twidth: 100%;\n\t}\n\n\t.edit-site-style-book__example-preview .block-editor-block-list__insertion-point,\n\t.edit-site-style-book__example-preview .block-list-appender {\n\t\tdisplay: none;\n\t}\n\t:where(.is-root-container > .wp-block:first-child) {\n\t\tmargin-top: 0;\n\t}\n\t:where(.is-root-container > .wp-block:last-child) {\n\t\tmargin-bottom: 0;\n\t}\n`;\n"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,EAAE,QAAQ,iBAAiB;;AAEpC;AACA;AACA;;AAGA,OAAO,MAAMC,uBAA8C,GAAG,CAC7D;EACCC,IAAI,EAAE,cAAc;EACpBC,KAAK,EAAEH,EAAE,CAAE,cAAe,CAAC;EAC3BI,MAAM,EAAE,OAAO;EACfC,IAAI,EAAE;AACP,CAAC,EACD;EACCH,IAAI,EAAE,iBAAiB;EACvBC,KAAK,EAAEH,EAAE,CAAE,iBAAkB,CAAC;EAC9B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;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC","ignoreList":[]}
|
|
1
|
+
{"version":3,"names":["__","STYLE_BOOK_COLOR_GROUPS","slug","title","origin","type","STYLE_BOOK_THEME_SUBCATEGORIES","blocks","exclude","STYLE_BOOK_CATEGORIES","subcategories","include","STYLE_BOOK_ALL_BLOCKS_SUBCATEGORIES","STYLE_BOOK_PREVIEW_CATEGORIES","ROOT_CONTAINER","STYLE_BOOK_IFRAME_STYLES"],"sources":["@wordpress/edit-site/src/components/style-book/constants.ts"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { __ } from '@wordpress/i18n';\n\n/**\n * Internal dependencies\n */\nimport type { StyleBookCategory, StyleBookColorGroup } from './types';\n\nexport const STYLE_BOOK_COLOR_GROUPS: StyleBookColorGroup[] = [\n\t{\n\t\tslug: 'theme-colors',\n\t\ttitle: __( 'Theme Colors' ),\n\t\torigin: 'theme',\n\t\ttype: 'colors',\n\t},\n\t{\n\t\tslug: 'theme-gradients',\n\t\ttitle: __( 'Theme Gradients' ),\n\t\torigin: 'theme',\n\t\ttype: 'gradients',\n\t},\n\t{\n\t\tslug: 'custom-colors',\n\t\ttitle: __( 'Custom Colors' ),\n\t\torigin: 'custom',\n\t\ttype: 'colors',\n\t},\n\t{\n\t\tslug: 'custom-gradients',\n\t\ttitle: __( 'Custom Gradients' ),\n\t\torigin: 'custom', // User.\n\t\ttype: 'gradients',\n\t},\n\t{\n\t\tslug: 'duotones',\n\t\ttitle: __( 'Duotones' ),\n\t\torigin: 'theme',\n\t\ttype: 'duotones',\n\t},\n\t{\n\t\tslug: 'default-colors',\n\t\ttitle: __( 'Default Colors' ),\n\t\torigin: 'default',\n\t\ttype: 'colors',\n\t},\n\t{\n\t\tslug: 'default-gradients',\n\t\ttitle: __( 'Default Gradients' ),\n\t\torigin: 'default',\n\t\ttype: 'gradients',\n\t},\n];\n\nexport const STYLE_BOOK_THEME_SUBCATEGORIES: Omit<\n\tStyleBookCategory,\n\t'subcategories'\n>[] = [\n\t{\n\t\tslug: 'site-identity',\n\t\ttitle: __( 'Site Identity' ),\n\t\tblocks: [ 'core/site-logo', 'core/site-title', 'core/site-tagline' ],\n\t},\n\t{\n\t\tslug: 'design',\n\t\ttitle: __( 'Design' ),\n\t\tblocks: [ 'core/navigation', 'core/avatar', 'core/post-time-to-read' ],\n\t\texclude: [ 'core/home-link', 'core/navigation-link' ],\n\t},\n\t{\n\t\tslug: 'posts',\n\t\ttitle: __( 'Posts' ),\n\t\tblocks: [\n\t\t\t'core/post-title',\n\t\t\t'core/post-excerpt',\n\t\t\t'core/post-author',\n\t\t\t'core/post-author-name',\n\t\t\t'core/post-author-biography',\n\t\t\t'core/post-date',\n\t\t\t'core/post-terms',\n\t\t\t'core/term-description',\n\t\t\t'core/query-title',\n\t\t\t'core/query-no-results',\n\t\t\t'core/query-pagination',\n\t\t\t'core/query-numbers',\n\t\t],\n\t},\n\t{\n\t\tslug: 'comments',\n\t\ttitle: __( 'Comments' ),\n\t\tblocks: [\n\t\t\t'core/comments-title',\n\t\t\t'core/comments-pagination',\n\t\t\t'core/comments-pagination-numbers',\n\t\t\t'core/comments',\n\t\t\t'core/comments-author-name',\n\t\t\t'core/comment-content',\n\t\t\t'core/comment-date',\n\t\t\t'core/comment-edit-link',\n\t\t\t'core/comment-reply-link',\n\t\t\t'core/comment-template',\n\t\t\t'core/post-comments-count',\n\t\t\t'core/post-comments-link',\n\t\t],\n\t},\n];\n\nexport const STYLE_BOOK_CATEGORIES: StyleBookCategory[] = [\n\t{\n\t\tslug: 'overview',\n\t\ttitle: __( 'Overview' ),\n\t\tblocks: [],\n\t},\n\t{\n\t\tslug: 'text',\n\t\ttitle: __( 'Text' ),\n\t\tblocks: [\n\t\t\t'core/post-content',\n\t\t\t'core/home-link',\n\t\t\t'core/navigation-link',\n\t\t],\n\t},\n\t{\n\t\tslug: 'colors',\n\t\ttitle: __( 'Colors' ),\n\t\tblocks: [],\n\t},\n\t{\n\t\tslug: 'theme',\n\t\ttitle: __( 'Theme' ),\n\t\tsubcategories: STYLE_BOOK_THEME_SUBCATEGORIES,\n\t},\n\t{\n\t\tslug: 'media',\n\t\ttitle: __( 'Media' ),\n\t\tblocks: [ 'core/post-featured-image' ],\n\t},\n\t{\n\t\tslug: 'widgets',\n\t\ttitle: __( 'Widgets' ),\n\t\tblocks: [],\n\t},\n\t{\n\t\tslug: 'embed',\n\t\ttitle: __( 'Embeds' ),\n\t\tinclude: [],\n\t},\n];\n\n// Style book preview subcategories for all blocks section.\nexport const STYLE_BOOK_ALL_BLOCKS_SUBCATEGORIES: StyleBookCategory[] = [\n\t...STYLE_BOOK_THEME_SUBCATEGORIES,\n\t{\n\t\tslug: 'media',\n\t\ttitle: __( 'Media' ),\n\t\tblocks: [ 'core/post-featured-image' ],\n\t},\n\t{\n\t\tslug: 'widgets',\n\t\ttitle: __( 'Widgets' ),\n\t\tblocks: [],\n\t},\n\t{\n\t\tslug: 'embed',\n\t\ttitle: __( 'Embeds' ),\n\t\tinclude: [],\n\t},\n];\n\n// Style book preview categories are organized slightly differently to the editor ones.\nexport const STYLE_BOOK_PREVIEW_CATEGORIES: StyleBookCategory[] = [\n\t{\n\t\tslug: 'overview',\n\t\ttitle: __( 'Overview' ),\n\t\tblocks: [],\n\t},\n\t{\n\t\tslug: 'text',\n\t\ttitle: __( 'Text' ),\n\t\tblocks: [\n\t\t\t'core/post-content',\n\t\t\t'core/home-link',\n\t\t\t'core/navigation-link',\n\t\t],\n\t},\n\t{\n\t\tslug: 'colors',\n\t\ttitle: __( 'Colors' ),\n\t\tblocks: [],\n\t},\n\t{\n\t\tslug: 'blocks',\n\t\ttitle: __( 'All Blocks' ),\n\t\tblocks: [],\n\t\tsubcategories: STYLE_BOOK_ALL_BLOCKS_SUBCATEGORIES,\n\t},\n];\n\n// Forming a \"block formatting context\" to prevent margin collapsing.\n// @see https://developer.mozilla.org/en-US/docs/Web/Guide/CSS/Block_formatting_context\nconst ROOT_CONTAINER = `\n\t.is-root-container {\n\t\tdisplay: flow-root;\n\t}\n`;\n// The content area of the Style Book is rendered within an iframe so that global styles\n// are applied to elements within the entire content area. To support elements that are\n// not part of the block previews, such as headings and layout for the block previews,\n// additional CSS rules need to be passed into the iframe. These are hard-coded below.\n// Note that button styles are unset, and then focus rules from the `Button` component are\n// applied to the `button` element, targeted via `.edit-site-style-book__example`.\n// This is to ensure that browser default styles for buttons are not applied to the previews.\nexport const STYLE_BOOK_IFRAME_STYLES = `\n\tbody {\n\t\tposition: relative;\n\t\tpadding: 32px !important;\n\t}\n\n\t${ ROOT_CONTAINER }\n\n\t.edit-site-style-book__examples {\n\t\tmax-width: 1200px;\n\t\tmargin: 0 auto;\n\t}\n\n\t.edit-site-style-book__example {\n\t max-width: 900px;\n\t\tborder-radius: 2px;\n\t\tcursor: pointer;\n\t\tdisplay: flex;\n\t\tflex-direction: column;\n\t\tgap: 40px;\n\t\tpadding: 16px;\n\t\twidth: 100%;\n\t\tbox-sizing: border-box;\n\t\tscroll-margin-top: 32px;\n\t\tscroll-margin-bottom: 32px;\n\t\tmargin: 0 auto 40px auto;\n\t}\n\n\t.edit-site-style-book__example.is-selected {\n\t\tbox-shadow: 0 0 0 1px var(--wp-components-color-accent, var(--wp-admin-theme-color, #007cba));\n\t}\n\n\t.edit-site-style-book__example.is-disabled-example {\n\t\tpointer-events: none;\n\t}\n\n\t.edit-site-style-book__example:focus:not(:disabled) {\n\t\tbox-shadow: 0 0 0 var(--wp-admin-border-width-focus) var(--wp-components-color-accent, var(--wp-admin-theme-color, #007cba));\n\t\toutline: 3px solid transparent;\n\t}\n\n\t.edit-site-style-book__duotone-example > div:first-child {\n\t\tdisplay: flex;\n\t\taspect-ratio: 16 / 9;\n\t\tgrid-row: span 1;\n\t\tgrid-column: span 2;\n\t}\n\t.edit-site-style-book__duotone-example img {\n\t\twidth: 100%;\n\t\theight: 100%;\n\t\tobject-fit: cover;\n\t}\n\t.edit-site-style-book__duotone-example > div:not(:first-child) {\n\t\theight: 20px;\n\t\tborder: 1px solid color-mix( in srgb, currentColor 10%, transparent );\n\t}\n\n\t.edit-site-style-book__color-example {\n\t\tborder: 1px solid color-mix( in srgb, currentColor 10%, transparent );\n\t}\n\n\t.edit-site-style-book__subcategory-title,\n\t.edit-site-style-book__example-title {\n\t\tfont-family: -apple-system, BlinkMacSystemFont, \"Segoe UI\", Roboto, Oxygen-Sans, Ubuntu, Cantarell, \"Helvetica Neue\", sans-serif;\n\t\tfont-size: 13px;\n\t\tfont-weight: normal;\n\t\tline-height: normal;\n\t\tmargin: 0;\n\t\ttext-align: left;\n\t\tpadding-top: 8px;\n\t\tborder-top: 1px solid color-mix( in srgb, currentColor 10%, transparent );\n\t\tcolor: color-mix( in srgb, currentColor 60%, transparent );\n\t}\n\n\t.edit-site-style-book__subcategory-title {\n\t\tfont-size: 16px;\n\t\tmargin-bottom: 40px;\n \tpadding-bottom: 8px;\n\t}\n\n\t.edit-site-style-book__example-preview {\n\t\twidth: 100%;\n\t}\n\n\t.edit-site-style-book__example-preview .block-editor-block-list__insertion-point,\n\t.edit-site-style-book__example-preview .block-list-appender {\n\t\tdisplay: none;\n\t}\n\t:where(.is-root-container > .wp-block:first-child) {\n\t\tmargin-top: 0;\n\t}\n\t:where(.is-root-container > .wp-block:last-child) {\n\t\tmargin-bottom: 0;\n\t}\n`;\n"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,EAAE,QAAQ,iBAAiB;;AAEpC;AACA;AACA;;AAGA,OAAO,MAAMC,uBAA8C,GAAG,CAC7D;EACCC,IAAI,EAAE,cAAc;EACpBC,KA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AAwB,GAAG;AACxC;AACA;AACA;AACA;AACA;AACA,GAAID,cAAc;AAClB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC","ignoreList":[]}
|
|
@@ -2173,10 +2173,15 @@ fieldset.fields-controls__featured-image .fields-controls__featured-image-remove
|
|
|
2173
2173
|
|
|
2174
2174
|
.page-patterns-preview-field {
|
|
2175
2175
|
display: flex;
|
|
2176
|
+
justify-content: center;
|
|
2177
|
+
align-items: center;
|
|
2176
2178
|
flex-direction: column;
|
|
2177
2179
|
height: 100%;
|
|
2178
2180
|
border-radius: 4px;
|
|
2179
2181
|
}
|
|
2182
|
+
.dataviews-view-grid .page-patterns-preview-field .block-editor-block-preview__container {
|
|
2183
|
+
height: 100%;
|
|
2184
|
+
}
|
|
2180
2185
|
.dataviews-view-table .page-patterns-preview-field {
|
|
2181
2186
|
width: 96px;
|
|
2182
2187
|
flex-grow: 0;
|
|
@@ -2256,6 +2261,8 @@ fieldset.fields-controls__featured-image .fields-controls__featured-image-remove
|
|
|
2256
2261
|
}
|
|
2257
2262
|
.page-templates-preview-field {
|
|
2258
2263
|
display: flex;
|
|
2264
|
+
justify-content: center;
|
|
2265
|
+
align-items: center;
|
|
2259
2266
|
flex-direction: column;
|
|
2260
2267
|
height: 100%;
|
|
2261
2268
|
width: 100%;
|
|
@@ -2753,7 +2760,7 @@ html.canvas-mode-edit-transition::view-transition-group(toggle) {
|
|
|
2753
2760
|
contain: content;
|
|
2754
2761
|
}
|
|
2755
2762
|
|
|
2756
|
-
@keyframes
|
|
2763
|
+
@keyframes _z491t_slide-from-right {
|
|
2757
2764
|
from {
|
|
2758
2765
|
transform: translateX(-50px);
|
|
2759
2766
|
opacity: 0;
|
|
@@ -2763,7 +2770,7 @@ html.canvas-mode-edit-transition::view-transition-group(toggle) {
|
|
|
2763
2770
|
opacity: 1;
|
|
2764
2771
|
}
|
|
2765
2772
|
}
|
|
2766
|
-
@keyframes
|
|
2773
|
+
@keyframes _z491t_slide-from-left {
|
|
2767
2774
|
from {
|
|
2768
2775
|
transform: translateX(50px);
|
|
2769
2776
|
opacity: 0;
|
|
@@ -2819,10 +2826,10 @@ html.canvas-mode-edit-transition::view-transition-group(toggle) {
|
|
|
2819
2826
|
}
|
|
2820
2827
|
}
|
|
2821
2828
|
.edit-site-sidebar__screen-wrapper.slide-from-left {
|
|
2822
|
-
animation-name:
|
|
2829
|
+
animation-name: _z491t_slide-from-left;
|
|
2823
2830
|
}
|
|
2824
2831
|
.edit-site-sidebar__screen-wrapper.slide-from-right {
|
|
2825
|
-
animation-name:
|
|
2832
|
+
animation-name: _z491t_slide-from-right;
|
|
2826
2833
|
}
|
|
2827
2834
|
|
|
2828
2835
|
.edit-site-sidebar-button {
|
package/build-style/style.css
CHANGED
|
@@ -2174,10 +2174,15 @@ fieldset.fields-controls__featured-image .fields-controls__featured-image-remove
|
|
|
2174
2174
|
|
|
2175
2175
|
.page-patterns-preview-field {
|
|
2176
2176
|
display: flex;
|
|
2177
|
+
justify-content: center;
|
|
2178
|
+
align-items: center;
|
|
2177
2179
|
flex-direction: column;
|
|
2178
2180
|
height: 100%;
|
|
2179
2181
|
border-radius: 4px;
|
|
2180
2182
|
}
|
|
2183
|
+
.dataviews-view-grid .page-patterns-preview-field .block-editor-block-preview__container {
|
|
2184
|
+
height: 100%;
|
|
2185
|
+
}
|
|
2181
2186
|
.dataviews-view-table .page-patterns-preview-field {
|
|
2182
2187
|
width: 96px;
|
|
2183
2188
|
flex-grow: 0;
|
|
@@ -2257,6 +2262,8 @@ fieldset.fields-controls__featured-image .fields-controls__featured-image-remove
|
|
|
2257
2262
|
}
|
|
2258
2263
|
.page-templates-preview-field {
|
|
2259
2264
|
display: flex;
|
|
2265
|
+
justify-content: center;
|
|
2266
|
+
align-items: center;
|
|
2260
2267
|
flex-direction: column;
|
|
2261
2268
|
height: 100%;
|
|
2262
2269
|
width: 100%;
|
|
@@ -2754,7 +2761,7 @@ html.canvas-mode-edit-transition::view-transition-group(toggle) {
|
|
|
2754
2761
|
contain: content;
|
|
2755
2762
|
}
|
|
2756
2763
|
|
|
2757
|
-
@keyframes
|
|
2764
|
+
@keyframes _z491t_slide-from-right {
|
|
2758
2765
|
from {
|
|
2759
2766
|
transform: translateX(50px);
|
|
2760
2767
|
opacity: 0;
|
|
@@ -2764,7 +2771,7 @@ html.canvas-mode-edit-transition::view-transition-group(toggle) {
|
|
|
2764
2771
|
opacity: 1;
|
|
2765
2772
|
}
|
|
2766
2773
|
}
|
|
2767
|
-
@keyframes
|
|
2774
|
+
@keyframes _z491t_slide-from-left {
|
|
2768
2775
|
from {
|
|
2769
2776
|
transform: translateX(-50px);
|
|
2770
2777
|
opacity: 0;
|
|
@@ -2820,10 +2827,10 @@ html.canvas-mode-edit-transition::view-transition-group(toggle) {
|
|
|
2820
2827
|
}
|
|
2821
2828
|
}
|
|
2822
2829
|
.edit-site-sidebar__screen-wrapper.slide-from-left {
|
|
2823
|
-
animation-name:
|
|
2830
|
+
animation-name: _z491t_slide-from-left;
|
|
2824
2831
|
}
|
|
2825
2832
|
.edit-site-sidebar__screen-wrapper.slide-from-right {
|
|
2826
|
-
animation-name:
|
|
2833
|
+
animation-name: _z491t_slide-from-right;
|
|
2827
2834
|
}
|
|
2828
2835
|
|
|
2829
2836
|
.edit-site-sidebar-button {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@wordpress/edit-site",
|
|
3
|
-
"version": "6.
|
|
3
|
+
"version": "6.17.1",
|
|
4
4
|
"description": "Edit Site Page module for WordPress.",
|
|
5
5
|
"author": "The WordPress Contributors",
|
|
6
6
|
"license": "GPL-2.0-or-later",
|
|
@@ -30,46 +30,46 @@
|
|
|
30
30
|
"dependencies": {
|
|
31
31
|
"@babel/runtime": "7.25.7",
|
|
32
32
|
"@react-spring/web": "^9.4.5",
|
|
33
|
-
"@wordpress/a11y": "^4.
|
|
34
|
-
"@wordpress/api-fetch": "^7.
|
|
35
|
-
"@wordpress/blob": "^4.
|
|
36
|
-
"@wordpress/block-editor": "^14.
|
|
37
|
-
"@wordpress/block-library": "^9.
|
|
38
|
-
"@wordpress/blocks": "^14.
|
|
39
|
-
"@wordpress/commands": "^1.
|
|
40
|
-
"@wordpress/components": "^29.
|
|
41
|
-
"@wordpress/compose": "^7.
|
|
42
|
-
"@wordpress/core-commands": "^1.
|
|
43
|
-
"@wordpress/core-data": "^7.
|
|
44
|
-
"@wordpress/data": "^10.
|
|
45
|
-
"@wordpress/dataviews": "^4.
|
|
46
|
-
"@wordpress/date": "^5.
|
|
47
|
-
"@wordpress/deprecated": "^4.
|
|
48
|
-
"@wordpress/dom": "^4.
|
|
49
|
-
"@wordpress/editor": "^14.
|
|
50
|
-
"@wordpress/element": "^6.
|
|
51
|
-
"@wordpress/escape-html": "^3.
|
|
52
|
-
"@wordpress/fields": "^0.
|
|
53
|
-
"@wordpress/hooks": "^4.
|
|
54
|
-
"@wordpress/html-entities": "^4.
|
|
55
|
-
"@wordpress/i18n": "^5.
|
|
56
|
-
"@wordpress/icons": "^10.
|
|
57
|
-
"@wordpress/keyboard-shortcuts": "^5.
|
|
58
|
-
"@wordpress/keycodes": "^4.
|
|
59
|
-
"@wordpress/media-utils": "^5.
|
|
60
|
-
"@wordpress/notices": "^5.
|
|
61
|
-
"@wordpress/patterns": "^2.
|
|
62
|
-
"@wordpress/plugins": "^7.
|
|
63
|
-
"@wordpress/preferences": "^4.
|
|
64
|
-
"@wordpress/primitives": "^4.
|
|
65
|
-
"@wordpress/private-apis": "^1.
|
|
66
|
-
"@wordpress/reusable-blocks": "^5.
|
|
67
|
-
"@wordpress/router": "^1.
|
|
68
|
-
"@wordpress/style-engine": "^2.
|
|
69
|
-
"@wordpress/url": "^4.
|
|
70
|
-
"@wordpress/viewport": "^6.
|
|
71
|
-
"@wordpress/widgets": "^4.
|
|
72
|
-
"@wordpress/wordcount": "^4.
|
|
33
|
+
"@wordpress/a11y": "^4.17.0",
|
|
34
|
+
"@wordpress/api-fetch": "^7.17.0",
|
|
35
|
+
"@wordpress/blob": "^4.17.0",
|
|
36
|
+
"@wordpress/block-editor": "^14.12.0",
|
|
37
|
+
"@wordpress/block-library": "^9.17.0",
|
|
38
|
+
"@wordpress/blocks": "^14.6.0",
|
|
39
|
+
"@wordpress/commands": "^1.17.0",
|
|
40
|
+
"@wordpress/components": "^29.3.0",
|
|
41
|
+
"@wordpress/compose": "^7.17.0",
|
|
42
|
+
"@wordpress/core-commands": "^1.17.0",
|
|
43
|
+
"@wordpress/core-data": "^7.17.0",
|
|
44
|
+
"@wordpress/data": "^10.17.0",
|
|
45
|
+
"@wordpress/dataviews": "^4.13.0",
|
|
46
|
+
"@wordpress/date": "^5.17.0",
|
|
47
|
+
"@wordpress/deprecated": "^4.17.0",
|
|
48
|
+
"@wordpress/dom": "^4.17.0",
|
|
49
|
+
"@wordpress/editor": "^14.17.1",
|
|
50
|
+
"@wordpress/element": "^6.17.0",
|
|
51
|
+
"@wordpress/escape-html": "^3.17.0",
|
|
52
|
+
"@wordpress/fields": "^0.9.0",
|
|
53
|
+
"@wordpress/hooks": "^4.17.0",
|
|
54
|
+
"@wordpress/html-entities": "^4.17.0",
|
|
55
|
+
"@wordpress/i18n": "^5.17.0",
|
|
56
|
+
"@wordpress/icons": "^10.17.0",
|
|
57
|
+
"@wordpress/keyboard-shortcuts": "^5.17.0",
|
|
58
|
+
"@wordpress/keycodes": "^4.17.0",
|
|
59
|
+
"@wordpress/media-utils": "^5.17.0",
|
|
60
|
+
"@wordpress/notices": "^5.17.0",
|
|
61
|
+
"@wordpress/patterns": "^2.17.0",
|
|
62
|
+
"@wordpress/plugins": "^7.17.0",
|
|
63
|
+
"@wordpress/preferences": "^4.17.0",
|
|
64
|
+
"@wordpress/primitives": "^4.17.0",
|
|
65
|
+
"@wordpress/private-apis": "^1.17.0",
|
|
66
|
+
"@wordpress/reusable-blocks": "^5.17.0",
|
|
67
|
+
"@wordpress/router": "^1.17.0",
|
|
68
|
+
"@wordpress/style-engine": "^2.17.0",
|
|
69
|
+
"@wordpress/url": "^4.17.0",
|
|
70
|
+
"@wordpress/viewport": "^6.17.0",
|
|
71
|
+
"@wordpress/widgets": "^4.17.0",
|
|
72
|
+
"@wordpress/wordcount": "^4.17.0",
|
|
73
73
|
"change-case": "^4.1.2",
|
|
74
74
|
"clsx": "^2.1.1",
|
|
75
75
|
"colord": "^2.9.2",
|
|
@@ -84,5 +84,5 @@
|
|
|
84
84
|
"publishConfig": {
|
|
85
85
|
"access": "public"
|
|
86
86
|
},
|
|
87
|
-
"gitHead": "
|
|
87
|
+
"gitHead": "05adbeff7892ddc5d5a52b816503d722ae7fc3e0"
|
|
88
88
|
}
|
|
@@ -174,7 +174,7 @@ function ScreenRevisions() {
|
|
|
174
174
|
changePage={ setCurrentPage }
|
|
175
175
|
totalItems={ revisionsCount }
|
|
176
176
|
disabled={ isLoading }
|
|
177
|
-
label={ __( 'Global Styles pagination
|
|
177
|
+
label={ __( 'Global Styles pagination' ) }
|
|
178
178
|
/>
|
|
179
179
|
</div>
|
|
180
180
|
) }
|
|
@@ -9,7 +9,6 @@ import { usePrevious } from '@wordpress/compose';
|
|
|
9
9
|
import { useEntityRecords } from '@wordpress/core-data';
|
|
10
10
|
import { privateApis as editorPrivateApis } from '@wordpress/editor';
|
|
11
11
|
import { privateApis as routerPrivateApis } from '@wordpress/router';
|
|
12
|
-
import { patternTitleField } from '@wordpress/fields';
|
|
13
12
|
|
|
14
13
|
/**
|
|
15
14
|
* Internal dependencies
|
|
@@ -34,7 +33,7 @@ import {
|
|
|
34
33
|
} from './fields';
|
|
35
34
|
|
|
36
35
|
const { ExperimentalBlockEditorProvider } = unlock( blockEditorPrivateApis );
|
|
37
|
-
const { usePostActions } = unlock( editorPrivateApis );
|
|
36
|
+
const { usePostActions, patternTitleField } = unlock( editorPrivateApis );
|
|
38
37
|
const { useLocation, useHistory } = unlock( routerPrivateApis );
|
|
39
38
|
|
|
40
39
|
const EMPTY_ARRAY = [];
|
|
@@ -4,10 +4,18 @@
|
|
|
4
4
|
|
|
5
5
|
.page-patterns-preview-field {
|
|
6
6
|
display: flex;
|
|
7
|
+
justify-content: center;
|
|
8
|
+
align-items: center;
|
|
7
9
|
flex-direction: column;
|
|
8
10
|
height: 100%;
|
|
9
11
|
border-radius: $radius-medium;
|
|
10
12
|
|
|
13
|
+
.dataviews-view-grid & {
|
|
14
|
+
.block-editor-block-preview__container {
|
|
15
|
+
height: 100%;
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
|
|
11
19
|
.dataviews-view-table & {
|
|
12
20
|
width: 96px;
|
|
13
21
|
flex-grow: 0;
|
|
@@ -7,7 +7,6 @@ import { privateApis as corePrivateApis } from '@wordpress/core-data';
|
|
|
7
7
|
import { DataViews, filterSortAndPaginate } from '@wordpress/dataviews';
|
|
8
8
|
import { privateApis as routerPrivateApis } from '@wordpress/router';
|
|
9
9
|
import { privateApis as editorPrivateApis } from '@wordpress/editor';
|
|
10
|
-
import { templateTitleField } from '@wordpress/fields';
|
|
11
10
|
import { addQueryArgs } from '@wordpress/url';
|
|
12
11
|
|
|
13
12
|
/**
|
|
@@ -27,7 +26,7 @@ import { useEditPostAction } from '../dataviews-actions';
|
|
|
27
26
|
import { authorField, descriptionField, previewField } from './fields';
|
|
28
27
|
import { useEvent } from '@wordpress/compose';
|
|
29
28
|
|
|
30
|
-
const { usePostActions } = unlock( editorPrivateApis );
|
|
29
|
+
const { usePostActions, templateTitleField } = unlock( editorPrivateApis );
|
|
31
30
|
const { useHistory, useLocation } = unlock( routerPrivateApis );
|
|
32
31
|
const { useEntityRecordsWithPermissions } = unlock( corePrivateApis );
|
|
33
32
|
|
|
@@ -168,7 +168,7 @@ export const STYLE_BOOK_ALL_BLOCKS_SUBCATEGORIES: StyleBookCategory[] = [
|
|
|
168
168
|
},
|
|
169
169
|
];
|
|
170
170
|
|
|
171
|
-
// Style book preview categories are
|
|
171
|
+
// Style book preview categories are organized slightly differently to the editor ones.
|
|
172
172
|
export const STYLE_BOOK_PREVIEW_CATEGORIES: StyleBookCategory[] = [
|
|
173
173
|
{
|
|
174
174
|
slug: 'overview',
|