@wordpress/fields 0.31.1-next.v.202602091733.0 → 0.32.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 +2 -0
- package/README.md +1 -1
- package/build/actions/duplicate-post.cjs.map +1 -1
- package/build/actions/reorder-page.cjs.map +1 -1
- package/build/components/create-template-part-modal/index.cjs +2 -5
- package/build/components/create-template-part-modal/index.cjs.map +3 -3
- package/build/components/media-edit/index.cjs +372 -157
- package/build/components/media-edit/index.cjs.map +3 -3
- package/build/components/media-edit/use-moving-animation.cjs +75 -0
- package/build/components/media-edit/use-moving-animation.cjs.map +7 -0
- package/build/fields/featured-image/index.cjs +2 -1
- package/build/fields/featured-image/index.cjs.map +2 -2
- package/build/fields/template/hooks.cjs +96 -0
- package/build/fields/template/hooks.cjs.map +7 -0
- package/build/fields/template/index.cjs +2 -0
- package/build/fields/template/index.cjs.map +2 -2
- package/build/fields/template/template-edit.cjs +33 -114
- package/build/fields/template/template-edit.cjs.map +3 -3
- package/build/fields/template/template-view.cjs +68 -0
- package/build/fields/template/template-view.cjs.map +7 -0
- package/build/fields/template/utils.cjs +91 -0
- package/build/fields/template/utils.cjs.map +7 -0
- package/build-module/actions/duplicate-post.mjs.map +1 -1
- package/build-module/actions/reorder-page.mjs.map +1 -1
- package/build-module/components/create-template-part-modal/index.mjs +3 -6
- package/build-module/components/create-template-part-modal/index.mjs.map +2 -2
- package/build-module/components/media-edit/index.mjs +379 -159
- package/build-module/components/media-edit/index.mjs.map +2 -2
- package/build-module/components/media-edit/use-moving-animation.mjs +54 -0
- package/build-module/components/media-edit/use-moving-animation.mjs.map +7 -0
- package/build-module/fields/featured-image/index.mjs +2 -1
- package/build-module/fields/featured-image/index.mjs.map +2 -2
- package/build-module/fields/template/hooks.mjs +71 -0
- package/build-module/fields/template/hooks.mjs.map +7 -0
- package/build-module/fields/template/index.mjs +2 -0
- package/build-module/fields/template/index.mjs.map +2 -2
- package/build-module/fields/template/template-edit.mjs +36 -123
- package/build-module/fields/template/template-edit.mjs.map +2 -2
- package/build-module/fields/template/template-view.mjs +43 -0
- package/build-module/fields/template/template-view.mjs.map +7 -0
- package/build-module/fields/template/utils.mjs +65 -0
- package/build-module/fields/template/utils.mjs.map +7 -0
- package/build-style/style-rtl.css +69 -61
- package/build-style/style.css +69 -61
- package/build-types/actions/duplicate-post.d.ts +1 -1
- package/build-types/actions/duplicate-post.d.ts.map +1 -1
- package/build-types/actions/reorder-page.d.ts +1 -1
- package/build-types/actions/reorder-page.d.ts.map +1 -1
- package/build-types/components/create-template-part-modal/index.d.ts.map +1 -1
- package/build-types/components/media-edit/index.d.ts +1 -1
- package/build-types/components/media-edit/index.d.ts.map +1 -1
- package/build-types/components/media-edit/use-moving-animation.d.ts +13 -0
- package/build-types/components/media-edit/use-moving-animation.d.ts.map +1 -0
- package/build-types/fields/template/hooks.d.ts +10 -0
- package/build-types/fields/template/hooks.d.ts.map +1 -0
- package/build-types/fields/template/index.d.ts.map +1 -1
- package/build-types/fields/template/template-edit.d.ts.map +1 -1
- package/build-types/fields/template/template-view.d.ts +4 -0
- package/build-types/fields/template/template-view.d.ts.map +1 -0
- package/build-types/fields/template/utils.d.ts +28 -0
- package/build-types/fields/template/utils.d.ts.map +1 -0
- package/package.json +27 -26
- package/src/actions/duplicate-post.tsx +1 -1
- package/src/actions/reorder-page.tsx +1 -1
- package/src/components/create-template-part-modal/index.tsx +5 -14
- package/src/components/media-edit/index.tsx +420 -163
- package/src/components/media-edit/style.scss +83 -30
- package/src/components/media-edit/use-moving-animation.ts +77 -0
- package/src/fields/featured-image/index.tsx +1 -1
- package/src/fields/template/hooks.ts +121 -0
- package/src/fields/template/index.ts +2 -0
- package/src/fields/template/template-edit.tsx +38 -149
- package/src/fields/template/template-view.tsx +52 -0
- package/src/fields/template/utils.ts +119 -0
- package/src/style.scss +0 -1
- package/src/fields/template/style.scss +0 -34
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../src/fields/template/template-edit.tsx"],
|
|
4
|
-
"sourcesContent": ["/**\n * WordPress dependencies\n */\nimport { useCallback, useMemo
|
|
5
|
-
"mappings": ";AAGA,SAAS,aAAa,
|
|
4
|
+
"sourcesContent": ["/**\n * WordPress dependencies\n */\nimport { useCallback, useMemo } from '@wordpress/element';\nimport type { WpTemplate } from '@wordpress/core-data';\nimport { store as coreStore } from '@wordpress/core-data';\nimport type { DataFormControlProps } from '@wordpress/dataviews';\nimport { SelectControl } from '@wordpress/components';\nimport { useSelect } from '@wordpress/data';\nimport { __ } from '@wordpress/i18n';\n\n/**\n * Internal dependencies\n */\nimport { getItemTitle } from '../../actions/utils';\nimport type { BasePost } from '../../types';\nimport { useDefaultTemplateLabel } from './hooks';\nimport { unlock } from '../../lock-unlock';\n\nconst EMPTY_ARRAY: [] = [];\n\nexport const TemplateEdit = ( {\n\tdata,\n\tfield,\n\tonChange,\n}: DataFormControlProps< BasePost > ) => {\n\tconst { id } = field;\n\tconst postType = data.type;\n\tconst postId =\n\t\ttypeof data.id === 'number' ? data.id : parseInt( data.id, 10 );\n\tconst slug = data.slug;\n\n\tconst { templates, canSwitchTemplate } = useSelect(\n\t\t( select ) => {\n\t\t\tconst allTemplates =\n\t\t\t\tselect( coreStore ).getEntityRecords< WpTemplate >(\n\t\t\t\t\t'postType',\n\t\t\t\t\t'wp_template',\n\t\t\t\t\t{\n\t\t\t\t\t\tper_page: -1,\n\t\t\t\t\t\tpost_type: postType,\n\t\t\t\t\t}\n\t\t\t\t) ?? EMPTY_ARRAY;\n\n\t\t\tconst { getHomePage, getPostsPageId } = unlock(\n\t\t\t\tselect( coreStore )\n\t\t\t);\n\t\t\tconst singlePostId = String( postId );\n\t\t\tconst isPostsPage =\n\t\t\t\tsinglePostId !== undefined && getPostsPageId() === singlePostId;\n\t\t\tconst isFrontPage =\n\t\t\t\tsinglePostId !== undefined &&\n\t\t\t\tpostType === 'page' &&\n\t\t\t\tgetHomePage()?.postId === singlePostId;\n\n\t\t\treturn {\n\t\t\t\ttemplates: allTemplates,\n\t\t\t\tcanSwitchTemplate: ! isPostsPage && ! isFrontPage,\n\t\t\t};\n\t\t},\n\t\t[ postId, postType ]\n\t);\n\n\tconst defaultTemplateLabel = useDefaultTemplateLabel(\n\t\tpostType,\n\t\tpostId,\n\t\tslug\n\t);\n\n\tconst value = field.getValue( { item: data } );\n\n\tconst onChangeControl = useCallback(\n\t\t( newValue: string ) =>\n\t\t\tonChange( {\n\t\t\t\t[ id ]: newValue,\n\t\t\t} ),\n\t\t[ id, onChange ]\n\t);\n\n\tconst options = useMemo( () => {\n\t\tconst templateOptions = templates.map( ( template ) => ( {\n\t\t\tlabel: getItemTitle( template ),\n\t\t\tvalue: template.slug,\n\t\t} ) );\n\t\treturn [\n\t\t\t{ label: defaultTemplateLabel, value: '' },\n\t\t\t...templateOptions,\n\t\t];\n\t}, [ templates, defaultTemplateLabel ] );\n\n\treturn (\n\t\t<SelectControl\n\t\t\t__next40pxDefaultSize\n\t\t\tlabel={ __( 'Template' ) }\n\t\t\thideLabelFromVision\n\t\t\tvalue={ value }\n\t\t\toptions={ options }\n\t\t\tonChange={ onChangeControl }\n\t\t\tdisabled={ ! canSwitchTemplate }\n\t\t/>\n\t);\n};\n"],
|
|
5
|
+
"mappings": ";AAGA,SAAS,aAAa,eAAe;AAErC,SAAS,SAAS,iBAAiB;AAEnC,SAAS,qBAAqB;AAC9B,SAAS,iBAAiB;AAC1B,SAAS,UAAU;AAKnB,SAAS,oBAAoB;AAE7B,SAAS,+BAA+B;AACxC,SAAS,cAAc;AA0ErB;AAxEF,IAAM,cAAkB,CAAC;AAElB,IAAM,eAAe,CAAE;AAAA,EAC7B;AAAA,EACA;AAAA,EACA;AACD,MAAyC;AACxC,QAAM,EAAE,GAAG,IAAI;AACf,QAAM,WAAW,KAAK;AACtB,QAAM,SACL,OAAO,KAAK,OAAO,WAAW,KAAK,KAAK,SAAU,KAAK,IAAI,EAAG;AAC/D,QAAM,OAAO,KAAK;AAElB,QAAM,EAAE,WAAW,kBAAkB,IAAI;AAAA,IACxC,CAAE,WAAY;AACb,YAAM,eACL,OAAQ,SAAU,EAAE;AAAA,QACnB;AAAA,QACA;AAAA,QACA;AAAA,UACC,UAAU;AAAA,UACV,WAAW;AAAA,QACZ;AAAA,MACD,KAAK;AAEN,YAAM,EAAE,aAAa,eAAe,IAAI;AAAA,QACvC,OAAQ,SAAU;AAAA,MACnB;AACA,YAAM,eAAe,OAAQ,MAAO;AACpC,YAAM,cACL,iBAAiB,UAAa,eAAe,MAAM;AACpD,YAAM,cACL,iBAAiB,UACjB,aAAa,UACb,YAAY,GAAG,WAAW;AAE3B,aAAO;AAAA,QACN,WAAW;AAAA,QACX,mBAAmB,CAAE,eAAe,CAAE;AAAA,MACvC;AAAA,IACD;AAAA,IACA,CAAE,QAAQ,QAAS;AAAA,EACpB;AAEA,QAAM,uBAAuB;AAAA,IAC5B;AAAA,IACA;AAAA,IACA;AAAA,EACD;AAEA,QAAM,QAAQ,MAAM,SAAU,EAAE,MAAM,KAAK,CAAE;AAE7C,QAAM,kBAAkB;AAAA,IACvB,CAAE,aACD,SAAU;AAAA,MACT,CAAE,EAAG,GAAG;AAAA,IACT,CAAE;AAAA,IACH,CAAE,IAAI,QAAS;AAAA,EAChB;AAEA,QAAM,UAAU,QAAS,MAAM;AAC9B,UAAM,kBAAkB,UAAU,IAAK,CAAE,cAAgB;AAAA,MACxD,OAAO,aAAc,QAAS;AAAA,MAC9B,OAAO,SAAS;AAAA,IACjB,EAAI;AACJ,WAAO;AAAA,MACN,EAAE,OAAO,sBAAsB,OAAO,GAAG;AAAA,MACzC,GAAG;AAAA,IACJ;AAAA,EACD,GAAG,CAAE,WAAW,oBAAqB,CAAE;AAEvC,SACC;AAAA,IAAC;AAAA;AAAA,MACA,uBAAqB;AAAA,MACrB,OAAQ,GAAI,UAAW;AAAA,MACvB,qBAAmB;AAAA,MACnB;AAAA,MACA;AAAA,MACA,UAAW;AAAA,MACX,UAAW,CAAE;AAAA;AAAA,EACd;AAEF;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
// packages/fields/src/fields/template/template-view.tsx
|
|
2
|
+
import { useSelect } from "@wordpress/data";
|
|
3
|
+
import { store as coreStore } from "@wordpress/core-data";
|
|
4
|
+
import { getItemTitle } from "../../actions/utils.mjs";
|
|
5
|
+
import { useDefaultTemplateLabel } from "./hooks.mjs";
|
|
6
|
+
import { Fragment, jsx } from "react/jsx-runtime";
|
|
7
|
+
var TemplateView = ({
|
|
8
|
+
item,
|
|
9
|
+
field
|
|
10
|
+
}) => {
|
|
11
|
+
const postType = item.type;
|
|
12
|
+
const slug = item.slug;
|
|
13
|
+
const postId = item.id;
|
|
14
|
+
const templateSlug = field.getValue({ item });
|
|
15
|
+
const defaultTemplateLabel = useDefaultTemplateLabel(
|
|
16
|
+
postType,
|
|
17
|
+
postId,
|
|
18
|
+
slug
|
|
19
|
+
);
|
|
20
|
+
const templateLabel = useSelect(
|
|
21
|
+
(select) => {
|
|
22
|
+
if (!templateSlug) {
|
|
23
|
+
return;
|
|
24
|
+
}
|
|
25
|
+
const allTemplates = select(
|
|
26
|
+
coreStore
|
|
27
|
+
).getEntityRecords("postType", "wp_template", {
|
|
28
|
+
per_page: -1,
|
|
29
|
+
post_type: postType
|
|
30
|
+
});
|
|
31
|
+
const match = allTemplates?.find(
|
|
32
|
+
(t) => t.slug === templateSlug
|
|
33
|
+
);
|
|
34
|
+
return match ? getItemTitle(match) : void 0;
|
|
35
|
+
},
|
|
36
|
+
[postType, templateSlug]
|
|
37
|
+
);
|
|
38
|
+
return /* @__PURE__ */ jsx(Fragment, { children: templateLabel ?? defaultTemplateLabel });
|
|
39
|
+
};
|
|
40
|
+
export {
|
|
41
|
+
TemplateView
|
|
42
|
+
};
|
|
43
|
+
//# sourceMappingURL=template-view.mjs.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../src/fields/template/template-view.tsx"],
|
|
4
|
+
"sourcesContent": ["/**\n * WordPress dependencies\n */\nimport { useSelect } from '@wordpress/data';\nimport type { WpTemplate } from '@wordpress/core-data';\nimport { store as coreStore } from '@wordpress/core-data';\nimport type { DataViewRenderFieldProps } from '@wordpress/dataviews';\n\n/**\n * Internal dependencies\n */\nimport { getItemTitle } from '../../actions/utils';\nimport type { BasePost } from '../../types';\nimport { useDefaultTemplateLabel } from './hooks';\n\nexport const TemplateView = ( {\n\titem,\n\tfield,\n}: DataViewRenderFieldProps< BasePost > ) => {\n\tconst postType = item.type;\n\tconst slug = item.slug;\n\tconst postId = item.id;\n\tconst templateSlug = field.getValue( { item } );\n\n\tconst defaultTemplateLabel = useDefaultTemplateLabel(\n\t\tpostType,\n\t\tpostId,\n\t\tslug\n\t);\n\n\tconst templateLabel = useSelect(\n\t\t( select ) => {\n\t\t\tif ( ! templateSlug ) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tconst allTemplates = select(\n\t\t\t\tcoreStore\n\t\t\t).getEntityRecords< WpTemplate >( 'postType', 'wp_template', {\n\t\t\t\tper_page: -1,\n\t\t\t\tpost_type: postType,\n\t\t\t} );\n\t\t\tconst match = allTemplates?.find(\n\t\t\t\t( t ) => t.slug === templateSlug\n\t\t\t);\n\t\t\treturn match ? getItemTitle( match ) : undefined;\n\t\t},\n\t\t[ postType, templateSlug ]\n\t);\n\n\treturn <>{ templateLabel ?? defaultTemplateLabel }</>;\n};\n"],
|
|
5
|
+
"mappings": ";AAGA,SAAS,iBAAiB;AAE1B,SAAS,SAAS,iBAAiB;AAMnC,SAAS,oBAAoB;AAE7B,SAAS,+BAA+B;AAqChC;AAnCD,IAAM,eAAe,CAAE;AAAA,EAC7B;AAAA,EACA;AACD,MAA6C;AAC5C,QAAM,WAAW,KAAK;AACtB,QAAM,OAAO,KAAK;AAClB,QAAM,SAAS,KAAK;AACpB,QAAM,eAAe,MAAM,SAAU,EAAE,KAAK,CAAE;AAE9C,QAAM,uBAAuB;AAAA,IAC5B;AAAA,IACA;AAAA,IACA;AAAA,EACD;AAEA,QAAM,gBAAgB;AAAA,IACrB,CAAE,WAAY;AACb,UAAK,CAAE,cAAe;AACrB;AAAA,MACD;AAEA,YAAM,eAAe;AAAA,QACpB;AAAA,MACD,EAAE,iBAAgC,YAAY,eAAe;AAAA,QAC5D,UAAU;AAAA,QACV,WAAW;AAAA,MACZ,CAAE;AACF,YAAM,QAAQ,cAAc;AAAA,QAC3B,CAAE,MAAO,EAAE,SAAS;AAAA,MACrB;AACA,aAAO,QAAQ,aAAc,KAAM,IAAI;AAAA,IACxC;AAAA,IACA,CAAE,UAAU,YAAa;AAAA,EAC1B;AAEA,SAAO,gCAAI,2BAAiB,sBAAsB;AACnD;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
// packages/fields/src/fields/template/utils.ts
|
|
2
|
+
import { store as coreStore } from "@wordpress/core-data";
|
|
3
|
+
import { __ } from "@wordpress/i18n";
|
|
4
|
+
import { getItemTitle } from "../../actions/utils.mjs";
|
|
5
|
+
import { unlock } from "../../lock-unlock.mjs";
|
|
6
|
+
function getTemplateSlugToCheck(postType, slug) {
|
|
7
|
+
if (slug) {
|
|
8
|
+
return postType === "page" ? `${postType}-${slug}` : `single-${postType}-${slug}`;
|
|
9
|
+
}
|
|
10
|
+
return postType === "page" ? "page" : `single-${postType}`;
|
|
11
|
+
}
|
|
12
|
+
function getDefaultTemplateLabel(select, postType, postId, slug) {
|
|
13
|
+
if (!postType || !postId) {
|
|
14
|
+
return __("Default template");
|
|
15
|
+
}
|
|
16
|
+
const homePage = unlock(select(coreStore)).getHomePage();
|
|
17
|
+
if (postType === "page" && homePage?.postType === "page" && homePage?.postId === String(postId)) {
|
|
18
|
+
const templates = select(coreStore).getEntityRecords(
|
|
19
|
+
"postType",
|
|
20
|
+
"wp_template",
|
|
21
|
+
{ per_page: -1 }
|
|
22
|
+
);
|
|
23
|
+
const frontPage = templates?.find(
|
|
24
|
+
(t) => t.slug === "front-page"
|
|
25
|
+
);
|
|
26
|
+
if (frontPage) {
|
|
27
|
+
return getItemTitle(frontPage);
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
const postsPageId = unlock(select(coreStore)).getPostsPageId();
|
|
31
|
+
if (postType === "page" && postsPageId === String(postId)) {
|
|
32
|
+
const templateId2 = select(coreStore).getDefaultTemplateId({
|
|
33
|
+
slug: "home"
|
|
34
|
+
});
|
|
35
|
+
if (templateId2) {
|
|
36
|
+
const template2 = select(coreStore).getEntityRecord(
|
|
37
|
+
"postType",
|
|
38
|
+
"wp_template",
|
|
39
|
+
templateId2
|
|
40
|
+
);
|
|
41
|
+
if (template2) {
|
|
42
|
+
return getItemTitle(template2);
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
return __("Default template");
|
|
46
|
+
}
|
|
47
|
+
const slugToCheck = getTemplateSlugToCheck(postType, slug);
|
|
48
|
+
const templateId = select(coreStore).getDefaultTemplateId({
|
|
49
|
+
slug: slugToCheck
|
|
50
|
+
});
|
|
51
|
+
if (!templateId) {
|
|
52
|
+
return __("Default template");
|
|
53
|
+
}
|
|
54
|
+
const template = select(coreStore).getEntityRecord(
|
|
55
|
+
"postType",
|
|
56
|
+
"wp_template",
|
|
57
|
+
templateId
|
|
58
|
+
);
|
|
59
|
+
return template ? getItemTitle(template) : __("Default template");
|
|
60
|
+
}
|
|
61
|
+
export {
|
|
62
|
+
getDefaultTemplateLabel,
|
|
63
|
+
getTemplateSlugToCheck
|
|
64
|
+
};
|
|
65
|
+
//# sourceMappingURL=utils.mjs.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../src/fields/template/utils.ts"],
|
|
4
|
+
"sourcesContent": ["/**\n * WordPress dependencies\n */\nimport { store as coreStore } from '@wordpress/core-data';\nimport type { WpTemplate } from '@wordpress/core-data';\nimport { __ } from '@wordpress/i18n';\n\n/**\n * Internal dependencies\n */\nimport { getItemTitle } from '../../actions/utils';\nimport { unlock } from '../../lock-unlock';\n\n/**\n * Compute the template slug to look up in the template hierarchy.\n *\n * In `draft` status we might not have a slug available, so we use the\n * `single` post type template slug (e.g. page, single-post,\n * single-product, etc.). Pages do not need the `single` prefix to be\n * prioritised through template hierarchy.\n *\n * @param postType The post type.\n * @param slug The post slug.\n */\nexport function getTemplateSlugToCheck(\n\tpostType: string,\n\tslug: string | undefined\n): string {\n\tif ( slug ) {\n\t\treturn postType === 'page'\n\t\t\t? `${ postType }-${ slug }`\n\t\t\t: `single-${ postType }-${ slug }`;\n\t}\n\treturn postType === 'page' ? 'page' : `single-${ postType }`;\n}\n\n/**\n * Resolve the human-readable label for the default template that would\n * apply to a post, given its type, ID and slug. Meant to be called inside a\n * `useSelect` callback (receives `select` as its first argument).\n *\n * @param select The `select` function from a `useSelect` callback.\n * @param postType The post type.\n * @param postId The post ID.\n * @param slug The post slug.\n */\nexport function getDefaultTemplateLabel(\n\tselect: ( store: typeof coreStore ) => any,\n\tpostType: string | undefined,\n\tpostId: string | number | undefined,\n\tslug: string | undefined\n): string {\n\tif ( ! postType || ! postId ) {\n\t\treturn __( 'Default template' );\n\t}\n\n\t// For the front page, we always use the front page template if existing.\n\tconst homePage = unlock( select( coreStore ) ).getHomePage();\n\tif (\n\t\tpostType === 'page' &&\n\t\thomePage?.postType === 'page' &&\n\t\thomePage?.postId === String( postId )\n\t) {\n\t\t// The /lookup endpoint cannot currently handle a lookup\n\t\t// when a page is set as the front page, so specifically in\n\t\t// that case, we want to check if there is a front page\n\t\t// template, and instead of falling back to the home\n\t\t// template, we want to fall back to the page template.\n\t\tconst templates = select( coreStore ).getEntityRecords(\n\t\t\t'postType',\n\t\t\t'wp_template',\n\t\t\t{ per_page: -1 }\n\t\t);\n\t\tconst frontPage = templates?.find(\n\t\t\t( t: WpTemplate ) => t.slug === 'front-page'\n\t\t);\n\t\tif ( frontPage ) {\n\t\t\treturn getItemTitle( frontPage );\n\t\t}\n\t\t// If no front page template is found, continue with the\n\t\t// logic below (fetching the page template).\n\t}\n\n\tconst postsPageId = unlock( select( coreStore ) ).getPostsPageId();\n\t// Check if the current page is the posts page.\n\tif ( postType === 'page' && postsPageId === String( postId ) ) {\n\t\tconst templateId = select( coreStore ).getDefaultTemplateId( {\n\t\t\tslug: 'home',\n\t\t} );\n\t\tif ( templateId ) {\n\t\t\tconst template = select( coreStore ).getEntityRecord(\n\t\t\t\t'postType',\n\t\t\t\t'wp_template',\n\t\t\t\ttemplateId\n\t\t\t);\n\t\t\tif ( template ) {\n\t\t\t\treturn getItemTitle( template );\n\t\t\t}\n\t\t}\n\t\treturn __( 'Default template' );\n\t}\n\n\tconst slugToCheck = getTemplateSlugToCheck( postType, slug );\n\tconst templateId = select( coreStore ).getDefaultTemplateId( {\n\t\tslug: slugToCheck,\n\t} );\n\n\tif ( ! templateId ) {\n\t\treturn __( 'Default template' );\n\t}\n\n\tconst template = select( coreStore ).getEntityRecord(\n\t\t'postType',\n\t\t'wp_template',\n\t\ttemplateId\n\t);\n\n\treturn template ? getItemTitle( template ) : __( 'Default template' );\n}\n"],
|
|
5
|
+
"mappings": ";AAGA,SAAS,SAAS,iBAAiB;AAEnC,SAAS,UAAU;AAKnB,SAAS,oBAAoB;AAC7B,SAAS,cAAc;AAahB,SAAS,uBACf,UACA,MACS;AACT,MAAK,MAAO;AACX,WAAO,aAAa,SACjB,GAAI,QAAS,IAAK,IAAK,KACvB,UAAW,QAAS,IAAK,IAAK;AAAA,EAClC;AACA,SAAO,aAAa,SAAS,SAAS,UAAW,QAAS;AAC3D;AAYO,SAAS,wBACf,QACA,UACA,QACA,MACS;AACT,MAAK,CAAE,YAAY,CAAE,QAAS;AAC7B,WAAO,GAAI,kBAAmB;AAAA,EAC/B;AAGA,QAAM,WAAW,OAAQ,OAAQ,SAAU,CAAE,EAAE,YAAY;AAC3D,MACC,aAAa,UACb,UAAU,aAAa,UACvB,UAAU,WAAW,OAAQ,MAAO,GACnC;AAMD,UAAM,YAAY,OAAQ,SAAU,EAAE;AAAA,MACrC;AAAA,MACA;AAAA,MACA,EAAE,UAAU,GAAG;AAAA,IAChB;AACA,UAAM,YAAY,WAAW;AAAA,MAC5B,CAAE,MAAmB,EAAE,SAAS;AAAA,IACjC;AACA,QAAK,WAAY;AAChB,aAAO,aAAc,SAAU;AAAA,IAChC;AAAA,EAGD;AAEA,QAAM,cAAc,OAAQ,OAAQ,SAAU,CAAE,EAAE,eAAe;AAEjE,MAAK,aAAa,UAAU,gBAAgB,OAAQ,MAAO,GAAI;AAC9D,UAAMA,cAAa,OAAQ,SAAU,EAAE,qBAAsB;AAAA,MAC5D,MAAM;AAAA,IACP,CAAE;AACF,QAAKA,aAAa;AACjB,YAAMC,YAAW,OAAQ,SAAU,EAAE;AAAA,QACpC;AAAA,QACA;AAAA,QACAD;AAAA,MACD;AACA,UAAKC,WAAW;AACf,eAAO,aAAcA,SAAS;AAAA,MAC/B;AAAA,IACD;AACA,WAAO,GAAI,kBAAmB;AAAA,EAC/B;AAEA,QAAM,cAAc,uBAAwB,UAAU,IAAK;AAC3D,QAAM,aAAa,OAAQ,SAAU,EAAE,qBAAsB;AAAA,IAC5D,MAAM;AAAA,EACP,CAAE;AAEF,MAAK,CAAE,YAAa;AACnB,WAAO,GAAI,kBAAmB;AAAA,EAC/B;AAEA,QAAM,WAAW,OAAQ,SAAU,EAAE;AAAA,IACpC;AAAA,IACA;AAAA,IACA;AAAA,EACD;AAEA,SAAO,WAAW,aAAc,QAAS,IAAI,GAAI,kBAAmB;AACrE;",
|
|
6
|
+
"names": ["templateId", "template"]
|
|
7
|
+
}
|
|
@@ -186,14 +186,31 @@ fieldset.fields__media-edit {
|
|
|
186
186
|
padding: 0;
|
|
187
187
|
margin: 0;
|
|
188
188
|
width: 100%;
|
|
189
|
+
}
|
|
190
|
+
fieldset.fields__media-edit .components-base-control__label {
|
|
191
|
+
color: #1e1e1e;
|
|
192
|
+
}
|
|
193
|
+
fieldset.fields__media-edit {
|
|
189
194
|
/* stylelint-disable-next-line property-no-unknown -- '@container' not globally permitted */
|
|
190
195
|
container-type: inline-size;
|
|
191
196
|
}
|
|
192
|
-
fieldset.fields__media-edit .fields__media-edit-compact {
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
+
fieldset.fields__media-edit .fields__media-edit-compact-group {
|
|
198
|
+
border: 1px dashed #949494;
|
|
199
|
+
border-radius: 4px;
|
|
200
|
+
overflow: hidden;
|
|
201
|
+
}
|
|
202
|
+
fieldset.fields__media-edit .fields__media-edit-compact-group.is-single {
|
|
203
|
+
border-radius: 2px;
|
|
204
|
+
}
|
|
205
|
+
fieldset.fields__media-edit .fields__media-edit-compact-group .fields__media-edit-picker-button {
|
|
206
|
+
border: 0;
|
|
207
|
+
border-radius: 0;
|
|
208
|
+
}
|
|
209
|
+
fieldset.fields__media-edit .fields__media-edit-compact-group .fields__media-edit-picker-button:focus-visible {
|
|
210
|
+
box-shadow: inset 0 0 0 var(--wp-admin-border-width-focus) var(--wp-admin-theme-color);
|
|
211
|
+
}
|
|
212
|
+
fieldset.fields__media-edit .fields__media-edit-compact-group .fields__media-edit-compact:not(:last-child) {
|
|
213
|
+
border-bottom: 1px solid #f0f0f0;
|
|
197
214
|
}
|
|
198
215
|
fieldset.fields__media-edit .fields__media-edit-compact .components-drop-zone .components-drop-zone__content-inner {
|
|
199
216
|
display: flex;
|
|
@@ -203,6 +220,27 @@ fieldset.fields__media-edit .fields__media-edit-compact .components-drop-zone .c
|
|
|
203
220
|
fieldset.fields__media-edit .fields__media-edit-compact .components-drop-zone .components-drop-zone__content-inner .components-drop-zone__content-icon {
|
|
204
221
|
margin: 0;
|
|
205
222
|
}
|
|
223
|
+
fieldset.fields__media-edit .fields__media-edit-compact {
|
|
224
|
+
position: relative;
|
|
225
|
+
min-width: 0;
|
|
226
|
+
}
|
|
227
|
+
fieldset.fields__media-edit .fields__media-edit-compact:hover .fields__media-edit-compact-movers, fieldset.fields__media-edit .fields__media-edit-compact:focus-within .fields__media-edit-compact-movers {
|
|
228
|
+
opacity: 1;
|
|
229
|
+
}
|
|
230
|
+
fieldset.fields__media-edit .fields__media-edit-compact .fields__media-edit-compact-movers {
|
|
231
|
+
position: absolute;
|
|
232
|
+
left: 8px;
|
|
233
|
+
top: 50%;
|
|
234
|
+
transform: translateY(-50%);
|
|
235
|
+
opacity: 0;
|
|
236
|
+
pointer-events: none;
|
|
237
|
+
z-index: 1;
|
|
238
|
+
border-radius: 2px;
|
|
239
|
+
background: #fff;
|
|
240
|
+
}
|
|
241
|
+
fieldset.fields__media-edit .fields__media-edit-compact .fields__media-edit-compact-movers * {
|
|
242
|
+
pointer-events: auto;
|
|
243
|
+
}
|
|
206
244
|
fieldset.fields__media-edit .fields__media-edit-picker-button:has(.fields__media-edit-placeholder):not(.fields__media-edit-expanded *) .components-drop-zone .components-drop-zone__content-inner {
|
|
207
245
|
display: flex;
|
|
208
246
|
align-items: center;
|
|
@@ -215,15 +253,25 @@ fieldset.fields__media-edit .fields__media-edit-picker-button {
|
|
|
215
253
|
position: relative;
|
|
216
254
|
display: flex;
|
|
217
255
|
align-items: center;
|
|
218
|
-
gap:
|
|
256
|
+
gap: 8px;
|
|
219
257
|
border: 1px dashed #949494;
|
|
220
|
-
border-radius:
|
|
221
|
-
padding:
|
|
258
|
+
border-radius: 2px;
|
|
259
|
+
padding: 4px 8px;
|
|
260
|
+
min-height: 40px;
|
|
222
261
|
cursor: pointer;
|
|
223
262
|
min-width: 0;
|
|
224
263
|
}
|
|
264
|
+
fieldset.fields__media-edit .fields__media-edit-picker-button:not(.has-attachment) {
|
|
265
|
+
border-color: var(--wp-admin-theme-color);
|
|
266
|
+
color: var(--wp-admin-theme-color);
|
|
267
|
+
}
|
|
268
|
+
fieldset.fields__media-edit .fields__media-edit-picker-button:not(.has-attachment):hover {
|
|
269
|
+
background-color: color-mix(in srgb, var(--wp-admin-theme-color, #3858e9) 4%, transparent);
|
|
270
|
+
color: var(--wp-admin-theme-color-darker-20);
|
|
271
|
+
border-color: var(--wp-admin-theme-color-darker-20);
|
|
272
|
+
}
|
|
225
273
|
fieldset.fields__media-edit .fields__media-edit-picker-button:hover {
|
|
226
|
-
|
|
274
|
+
color: var(--wp-admin-theme-color);
|
|
227
275
|
}
|
|
228
276
|
fieldset.fields__media-edit .fields__media-edit-picker-button:focus-visible {
|
|
229
277
|
box-shadow: 0 0 0 var(--wp-admin-border-width-focus) var(--wp-admin-theme-color);
|
|
@@ -291,37 +339,20 @@ fieldset.fields__media-edit .fields__media-edit-expanded .fields__media-edit-exp
|
|
|
291
339
|
opacity: 0;
|
|
292
340
|
pointer-events: none;
|
|
293
341
|
}
|
|
294
|
-
@media not (prefers-reduced-motion) {
|
|
295
|
-
fieldset.fields__media-edit .fields__media-edit-expanded .fields__media-edit-expanded-overlay {
|
|
296
|
-
transition: opacity 50ms ease-out;
|
|
297
|
-
}
|
|
298
|
-
}
|
|
299
342
|
fieldset.fields__media-edit .fields__media-edit-expanded .fields__media-edit-expanded-overlay * {
|
|
300
343
|
pointer-events: auto;
|
|
301
344
|
}
|
|
302
|
-
fieldset.fields__media-edit .fields__media-edit-expanded .fields__media-edit-expanded-
|
|
303
|
-
position: absolute;
|
|
304
|
-
top: 8px;
|
|
305
|
-
left: 8px;
|
|
306
|
-
border-radius: 1px;
|
|
307
|
-
backdrop-filter: blur(16px) saturate(180%);
|
|
308
|
-
background: rgba(255, 255, 255, 0.75);
|
|
309
|
-
}
|
|
310
|
-
fieldset.fields__media-edit .fields__media-edit-expanded .fields__media-edit-expanded-title {
|
|
345
|
+
fieldset.fields__media-edit .fields__media-edit-expanded .fields__media-edit-expanded-actions {
|
|
311
346
|
position: absolute;
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
padding: 4px;
|
|
317
|
-
text-align: center;
|
|
318
|
-
border-radius: 1px;
|
|
319
|
-
backdrop-filter: blur(16px) saturate(180%);
|
|
320
|
-
background: rgba(255, 255, 255, 0.75);
|
|
347
|
+
top: 4px;
|
|
348
|
+
left: 4px;
|
|
349
|
+
border-radius: 2px;
|
|
350
|
+
background: #fff;
|
|
321
351
|
}
|
|
322
352
|
fieldset.fields__media-edit .fields__media-edit-expanded .fields__media-edit-expanded-item {
|
|
323
353
|
position: relative;
|
|
324
354
|
min-width: 0;
|
|
355
|
+
border-radius: 4px;
|
|
325
356
|
}
|
|
326
357
|
fieldset.fields__media-edit .fields__media-edit-expanded .fields__media-edit-expanded-item:hover .fields__media-edit-expanded-overlay, fieldset.fields__media-edit .fields__media-edit-expanded .fields__media-edit-expanded-item:focus-within .fields__media-edit-expanded-overlay {
|
|
327
358
|
opacity: 1;
|
|
@@ -348,6 +379,12 @@ fieldset.fields__media-edit .fields__media-edit-expanded.is-single {
|
|
|
348
379
|
fieldset.fields__media-edit .fields__media-edit-expanded.is-single .fields__media-edit-expanded-preview {
|
|
349
380
|
aspect-ratio: 2/1;
|
|
350
381
|
}
|
|
382
|
+
fieldset.fields__media-edit .fields__media-edit-expanded .fields__media-edit-picker-button {
|
|
383
|
+
border-radius: 4px;
|
|
384
|
+
}
|
|
385
|
+
fieldset.fields__media-edit .fields__media-edit-expanded.is-empty .fields__media-edit-picker-button {
|
|
386
|
+
border-radius: 2px;
|
|
387
|
+
}
|
|
351
388
|
fieldset.fields__media-edit .fields__media-edit-expanded.is-multiple:not(.is-empty) {
|
|
352
389
|
grid-template-columns: repeat(3, 1fr);
|
|
353
390
|
/* stylelint-disable-next-line property-no-unknown -- '@container' not globally permitted */
|
|
@@ -422,35 +459,6 @@ fieldset.fields__media-edit .fields__media-edit-expanded:not(.is-empty) .fields_
|
|
|
422
459
|
margin: 0;
|
|
423
460
|
}
|
|
424
461
|
|
|
425
|
-
.fields-controls__template {
|
|
426
|
-
border: 0;
|
|
427
|
-
padding: 0;
|
|
428
|
-
margin: 0;
|
|
429
|
-
}
|
|
430
|
-
|
|
431
|
-
.fields-controls__template-modal {
|
|
432
|
-
z-index: 1000001;
|
|
433
|
-
}
|
|
434
|
-
|
|
435
|
-
.fields-controls__template-content .block-editor-block-patterns-list {
|
|
436
|
-
column-count: 2;
|
|
437
|
-
column-gap: 24px;
|
|
438
|
-
padding-top: 2px;
|
|
439
|
-
}
|
|
440
|
-
@media (min-width: 782px) {
|
|
441
|
-
.fields-controls__template-content .block-editor-block-patterns-list {
|
|
442
|
-
column-count: 3;
|
|
443
|
-
}
|
|
444
|
-
}
|
|
445
|
-
@media (min-width: 1280px) {
|
|
446
|
-
.fields-controls__template-content .block-editor-block-patterns-list {
|
|
447
|
-
column-count: 4;
|
|
448
|
-
}
|
|
449
|
-
}
|
|
450
|
-
.fields-controls__template-content .block-editor-block-patterns-list .block-editor-block-patterns-list__list-item {
|
|
451
|
-
break-inside: avoid-column;
|
|
452
|
-
}
|
|
453
|
-
|
|
454
462
|
.fields-field__title > span:first-child {
|
|
455
463
|
text-overflow: ellipsis;
|
|
456
464
|
overflow: hidden;
|
package/build-style/style.css
CHANGED
|
@@ -186,14 +186,31 @@ fieldset.fields__media-edit {
|
|
|
186
186
|
padding: 0;
|
|
187
187
|
margin: 0;
|
|
188
188
|
width: 100%;
|
|
189
|
+
}
|
|
190
|
+
fieldset.fields__media-edit .components-base-control__label {
|
|
191
|
+
color: #1e1e1e;
|
|
192
|
+
}
|
|
193
|
+
fieldset.fields__media-edit {
|
|
189
194
|
/* stylelint-disable-next-line property-no-unknown -- '@container' not globally permitted */
|
|
190
195
|
container-type: inline-size;
|
|
191
196
|
}
|
|
192
|
-
fieldset.fields__media-edit .fields__media-edit-compact {
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
+
fieldset.fields__media-edit .fields__media-edit-compact-group {
|
|
198
|
+
border: 1px dashed #949494;
|
|
199
|
+
border-radius: 4px;
|
|
200
|
+
overflow: hidden;
|
|
201
|
+
}
|
|
202
|
+
fieldset.fields__media-edit .fields__media-edit-compact-group.is-single {
|
|
203
|
+
border-radius: 2px;
|
|
204
|
+
}
|
|
205
|
+
fieldset.fields__media-edit .fields__media-edit-compact-group .fields__media-edit-picker-button {
|
|
206
|
+
border: 0;
|
|
207
|
+
border-radius: 0;
|
|
208
|
+
}
|
|
209
|
+
fieldset.fields__media-edit .fields__media-edit-compact-group .fields__media-edit-picker-button:focus-visible {
|
|
210
|
+
box-shadow: inset 0 0 0 var(--wp-admin-border-width-focus) var(--wp-admin-theme-color);
|
|
211
|
+
}
|
|
212
|
+
fieldset.fields__media-edit .fields__media-edit-compact-group .fields__media-edit-compact:not(:last-child) {
|
|
213
|
+
border-bottom: 1px solid #f0f0f0;
|
|
197
214
|
}
|
|
198
215
|
fieldset.fields__media-edit .fields__media-edit-compact .components-drop-zone .components-drop-zone__content-inner {
|
|
199
216
|
display: flex;
|
|
@@ -203,6 +220,27 @@ fieldset.fields__media-edit .fields__media-edit-compact .components-drop-zone .c
|
|
|
203
220
|
fieldset.fields__media-edit .fields__media-edit-compact .components-drop-zone .components-drop-zone__content-inner .components-drop-zone__content-icon {
|
|
204
221
|
margin: 0;
|
|
205
222
|
}
|
|
223
|
+
fieldset.fields__media-edit .fields__media-edit-compact {
|
|
224
|
+
position: relative;
|
|
225
|
+
min-width: 0;
|
|
226
|
+
}
|
|
227
|
+
fieldset.fields__media-edit .fields__media-edit-compact:hover .fields__media-edit-compact-movers, fieldset.fields__media-edit .fields__media-edit-compact:focus-within .fields__media-edit-compact-movers {
|
|
228
|
+
opacity: 1;
|
|
229
|
+
}
|
|
230
|
+
fieldset.fields__media-edit .fields__media-edit-compact .fields__media-edit-compact-movers {
|
|
231
|
+
position: absolute;
|
|
232
|
+
right: 8px;
|
|
233
|
+
top: 50%;
|
|
234
|
+
transform: translateY(-50%);
|
|
235
|
+
opacity: 0;
|
|
236
|
+
pointer-events: none;
|
|
237
|
+
z-index: 1;
|
|
238
|
+
border-radius: 2px;
|
|
239
|
+
background: #fff;
|
|
240
|
+
}
|
|
241
|
+
fieldset.fields__media-edit .fields__media-edit-compact .fields__media-edit-compact-movers * {
|
|
242
|
+
pointer-events: auto;
|
|
243
|
+
}
|
|
206
244
|
fieldset.fields__media-edit .fields__media-edit-picker-button:has(.fields__media-edit-placeholder):not(.fields__media-edit-expanded *) .components-drop-zone .components-drop-zone__content-inner {
|
|
207
245
|
display: flex;
|
|
208
246
|
align-items: center;
|
|
@@ -215,15 +253,25 @@ fieldset.fields__media-edit .fields__media-edit-picker-button {
|
|
|
215
253
|
position: relative;
|
|
216
254
|
display: flex;
|
|
217
255
|
align-items: center;
|
|
218
|
-
gap:
|
|
256
|
+
gap: 8px;
|
|
219
257
|
border: 1px dashed #949494;
|
|
220
|
-
border-radius:
|
|
221
|
-
padding:
|
|
258
|
+
border-radius: 2px;
|
|
259
|
+
padding: 4px 8px;
|
|
260
|
+
min-height: 40px;
|
|
222
261
|
cursor: pointer;
|
|
223
262
|
min-width: 0;
|
|
224
263
|
}
|
|
264
|
+
fieldset.fields__media-edit .fields__media-edit-picker-button:not(.has-attachment) {
|
|
265
|
+
border-color: var(--wp-admin-theme-color);
|
|
266
|
+
color: var(--wp-admin-theme-color);
|
|
267
|
+
}
|
|
268
|
+
fieldset.fields__media-edit .fields__media-edit-picker-button:not(.has-attachment):hover {
|
|
269
|
+
background-color: color-mix(in srgb, var(--wp-admin-theme-color, #3858e9) 4%, transparent);
|
|
270
|
+
color: var(--wp-admin-theme-color-darker-20);
|
|
271
|
+
border-color: var(--wp-admin-theme-color-darker-20);
|
|
272
|
+
}
|
|
225
273
|
fieldset.fields__media-edit .fields__media-edit-picker-button:hover {
|
|
226
|
-
|
|
274
|
+
color: var(--wp-admin-theme-color);
|
|
227
275
|
}
|
|
228
276
|
fieldset.fields__media-edit .fields__media-edit-picker-button:focus-visible {
|
|
229
277
|
box-shadow: 0 0 0 var(--wp-admin-border-width-focus) var(--wp-admin-theme-color);
|
|
@@ -291,37 +339,20 @@ fieldset.fields__media-edit .fields__media-edit-expanded .fields__media-edit-exp
|
|
|
291
339
|
opacity: 0;
|
|
292
340
|
pointer-events: none;
|
|
293
341
|
}
|
|
294
|
-
@media not (prefers-reduced-motion) {
|
|
295
|
-
fieldset.fields__media-edit .fields__media-edit-expanded .fields__media-edit-expanded-overlay {
|
|
296
|
-
transition: opacity 50ms ease-out;
|
|
297
|
-
}
|
|
298
|
-
}
|
|
299
342
|
fieldset.fields__media-edit .fields__media-edit-expanded .fields__media-edit-expanded-overlay * {
|
|
300
343
|
pointer-events: auto;
|
|
301
344
|
}
|
|
302
|
-
fieldset.fields__media-edit .fields__media-edit-expanded .fields__media-edit-expanded-
|
|
303
|
-
position: absolute;
|
|
304
|
-
top: 8px;
|
|
305
|
-
right: 8px;
|
|
306
|
-
border-radius: 1px;
|
|
307
|
-
backdrop-filter: blur(16px) saturate(180%);
|
|
308
|
-
background: rgba(255, 255, 255, 0.75);
|
|
309
|
-
}
|
|
310
|
-
fieldset.fields__media-edit .fields__media-edit-expanded .fields__media-edit-expanded-title {
|
|
345
|
+
fieldset.fields__media-edit .fields__media-edit-expanded .fields__media-edit-expanded-actions {
|
|
311
346
|
position: absolute;
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
padding: 4px;
|
|
317
|
-
text-align: center;
|
|
318
|
-
border-radius: 1px;
|
|
319
|
-
backdrop-filter: blur(16px) saturate(180%);
|
|
320
|
-
background: rgba(255, 255, 255, 0.75);
|
|
347
|
+
top: 4px;
|
|
348
|
+
right: 4px;
|
|
349
|
+
border-radius: 2px;
|
|
350
|
+
background: #fff;
|
|
321
351
|
}
|
|
322
352
|
fieldset.fields__media-edit .fields__media-edit-expanded .fields__media-edit-expanded-item {
|
|
323
353
|
position: relative;
|
|
324
354
|
min-width: 0;
|
|
355
|
+
border-radius: 4px;
|
|
325
356
|
}
|
|
326
357
|
fieldset.fields__media-edit .fields__media-edit-expanded .fields__media-edit-expanded-item:hover .fields__media-edit-expanded-overlay, fieldset.fields__media-edit .fields__media-edit-expanded .fields__media-edit-expanded-item:focus-within .fields__media-edit-expanded-overlay {
|
|
327
358
|
opacity: 1;
|
|
@@ -348,6 +379,12 @@ fieldset.fields__media-edit .fields__media-edit-expanded.is-single {
|
|
|
348
379
|
fieldset.fields__media-edit .fields__media-edit-expanded.is-single .fields__media-edit-expanded-preview {
|
|
349
380
|
aspect-ratio: 2/1;
|
|
350
381
|
}
|
|
382
|
+
fieldset.fields__media-edit .fields__media-edit-expanded .fields__media-edit-picker-button {
|
|
383
|
+
border-radius: 4px;
|
|
384
|
+
}
|
|
385
|
+
fieldset.fields__media-edit .fields__media-edit-expanded.is-empty .fields__media-edit-picker-button {
|
|
386
|
+
border-radius: 2px;
|
|
387
|
+
}
|
|
351
388
|
fieldset.fields__media-edit .fields__media-edit-expanded.is-multiple:not(.is-empty) {
|
|
352
389
|
grid-template-columns: repeat(3, 1fr);
|
|
353
390
|
/* stylelint-disable-next-line property-no-unknown -- '@container' not globally permitted */
|
|
@@ -422,35 +459,6 @@ fieldset.fields__media-edit .fields__media-edit-expanded:not(.is-empty) .fields_
|
|
|
422
459
|
margin: 0;
|
|
423
460
|
}
|
|
424
461
|
|
|
425
|
-
.fields-controls__template {
|
|
426
|
-
border: 0;
|
|
427
|
-
padding: 0;
|
|
428
|
-
margin: 0;
|
|
429
|
-
}
|
|
430
|
-
|
|
431
|
-
.fields-controls__template-modal {
|
|
432
|
-
z-index: 1000001;
|
|
433
|
-
}
|
|
434
|
-
|
|
435
|
-
.fields-controls__template-content .block-editor-block-patterns-list {
|
|
436
|
-
column-count: 2;
|
|
437
|
-
column-gap: 24px;
|
|
438
|
-
padding-top: 2px;
|
|
439
|
-
}
|
|
440
|
-
@media (min-width: 782px) {
|
|
441
|
-
.fields-controls__template-content .block-editor-block-patterns-list {
|
|
442
|
-
column-count: 3;
|
|
443
|
-
}
|
|
444
|
-
}
|
|
445
|
-
@media (min-width: 1280px) {
|
|
446
|
-
.fields-controls__template-content .block-editor-block-patterns-list {
|
|
447
|
-
column-count: 4;
|
|
448
|
-
}
|
|
449
|
-
}
|
|
450
|
-
.fields-controls__template-content .block-editor-block-patterns-list .block-editor-block-patterns-list__list-item {
|
|
451
|
-
break-inside: avoid-column;
|
|
452
|
-
}
|
|
453
|
-
|
|
454
462
|
.fields-field__title > span:first-child {
|
|
455
463
|
text-overflow: ellipsis;
|
|
456
464
|
overflow: hidden;
|
|
@@ -12,7 +12,7 @@ interface Action<Item> {
|
|
|
12
12
|
label: string;
|
|
13
13
|
isEligible?: (item: Item) => boolean;
|
|
14
14
|
modalFocusOnMount?: string;
|
|
15
|
-
RenderModal: (props: RenderModalProps<Item>) => JSX.Element;
|
|
15
|
+
RenderModal: (props: RenderModalProps<Item>) => React.JSX.Element;
|
|
16
16
|
}
|
|
17
17
|
declare const duplicatePost: Action<BasePost>;
|
|
18
18
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"duplicate-post.d.ts","sourceRoot":"","sources":["../../src/actions/duplicate-post.tsx"],"names":[],"mappings":"AAeA;;GAEG;AACH,OAAO,KAAK,EAAE,QAAQ,EAAiB,MAAM,UAAU,CAAC;AAGxD,UAAU,gBAAgB,CAAE,IAAI;IAC/B,KAAK,EAAE,IAAI,EAAE,CAAC;IACd,UAAU,CAAC,EAAE,MAAM,IAAI,CAAC;IACxB,iBAAiB,CAAC,EAAE,CAAE,KAAK,EAAE,IAAI,EAAE,KAAM,IAAI,CAAC;CAC9C;AAED,UAAU,MAAM,CAAE,IAAI;IACrB,EAAE,EAAE,MAAM,CAAC;IACX,KAAK,EAAE,MAAM,CAAC;IACd,UAAU,CAAC,EAAE,CAAE,IAAI,EAAE,IAAI,KAAM,OAAO,CAAC;IACvC,iBAAiB,CAAC,EAAE,MAAM,CAAC;IAC3B,WAAW,EAAE,CAAE,KAAK,EAAE,gBAAgB,CAAE,IAAI,CAAE,KAAM,GAAG,CAAC,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"duplicate-post.d.ts","sourceRoot":"","sources":["../../src/actions/duplicate-post.tsx"],"names":[],"mappings":"AAeA;;GAEG;AACH,OAAO,KAAK,EAAE,QAAQ,EAAiB,MAAM,UAAU,CAAC;AAGxD,UAAU,gBAAgB,CAAE,IAAI;IAC/B,KAAK,EAAE,IAAI,EAAE,CAAC;IACd,UAAU,CAAC,EAAE,MAAM,IAAI,CAAC;IACxB,iBAAiB,CAAC,EAAE,CAAE,KAAK,EAAE,IAAI,EAAE,KAAM,IAAI,CAAC;CAC9C;AAED,UAAU,MAAM,CAAE,IAAI;IACrB,EAAE,EAAE,MAAM,CAAC;IACX,KAAK,EAAE,MAAM,CAAC;IACd,UAAU,CAAC,EAAE,CAAE,IAAI,EAAE,IAAI,KAAM,OAAO,CAAC;IACvC,iBAAiB,CAAC,EAAE,MAAM,CAAC;IAC3B,WAAW,EAAE,CAAE,KAAK,EAAE,gBAAgB,CAAE,IAAI,CAAE,KAAM,KAAK,CAAC,GAAG,CAAC,OAAO,CAAC;CACtE;AAED,QAAA,MAAM,aAAa,EAAE,MAAM,CAAE,QAAQ,CAyJpC,CAAC;AAEF;;GAEG;AACH,eAAe,aAAa,CAAC"}
|
|
@@ -12,7 +12,7 @@ interface Action<Item> {
|
|
|
12
12
|
label: string;
|
|
13
13
|
isEligible?: (item: Item) => boolean;
|
|
14
14
|
modalFocusOnMount?: string;
|
|
15
|
-
RenderModal: (props: RenderModalProps<Item>) => JSX.Element;
|
|
15
|
+
RenderModal: (props: RenderModalProps<Item>) => React.JSX.Element;
|
|
16
16
|
}
|
|
17
17
|
declare const reorderPage: Action<BasePost>;
|
|
18
18
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"reorder-page.d.ts","sourceRoot":"","sources":["../../src/actions/reorder-page.tsx"],"names":[],"mappings":"AAeA;;GAEG;AACH,OAAO,KAAK,EAAiB,QAAQ,EAAE,MAAM,UAAU,CAAC;AAExD,UAAU,gBAAgB,CAAE,IAAI;IAC/B,KAAK,EAAE,IAAI,EAAE,CAAC;IACd,UAAU,CAAC,EAAE,MAAM,IAAI,CAAC;IACxB,iBAAiB,CAAC,EAAE,CAAE,KAAK,EAAE,IAAI,EAAE,KAAM,IAAI,CAAC;CAC9C;AAED,UAAU,MAAM,CAAE,IAAI;IACrB,EAAE,EAAE,MAAM,CAAC;IACX,KAAK,EAAE,MAAM,CAAC;IACd,UAAU,CAAC,EAAE,CAAE,IAAI,EAAE,IAAI,KAAM,OAAO,CAAC;IACvC,iBAAiB,CAAC,EAAE,MAAM,CAAC;IAC3B,WAAW,EAAE,CAAE,KAAK,EAAE,gBAAgB,CAAE,IAAI,CAAE,KAAM,GAAG,CAAC,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"reorder-page.d.ts","sourceRoot":"","sources":["../../src/actions/reorder-page.tsx"],"names":[],"mappings":"AAeA;;GAEG;AACH,OAAO,KAAK,EAAiB,QAAQ,EAAE,MAAM,UAAU,CAAC;AAExD,UAAU,gBAAgB,CAAE,IAAI;IAC/B,KAAK,EAAE,IAAI,EAAE,CAAC;IACd,UAAU,CAAC,EAAE,MAAM,IAAI,CAAC;IACxB,iBAAiB,CAAC,EAAE,CAAE,KAAK,EAAE,IAAI,EAAE,KAAM,IAAI,CAAC;CAC9C;AAED,UAAU,MAAM,CAAE,IAAI;IACrB,EAAE,EAAE,MAAM,CAAC;IACX,KAAK,EAAE,MAAM,CAAC;IACd,UAAU,CAAC,EAAE,CAAE,IAAI,EAAE,IAAI,KAAM,OAAO,CAAC;IACvC,iBAAiB,CAAC,EAAE,MAAM,CAAC;IAC3B,WAAW,EAAE,CAAE,KAAK,EAAE,gBAAgB,CAAE,IAAI,CAAE,KAAM,KAAK,CAAC,GAAG,CAAC,OAAO,CAAC;CACtE;AAyGD,QAAA,MAAM,WAAW,EAAE,MAAM,CAAE,QAAQ,CAQlC,CAAC;AAEF;;GAEG;AACH,eAAe,WAAW,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/create-template-part-modal/index.tsx"],"names":[],"mappings":"AA8CA,KAAK,oCAAoC,GAAG;IAC3C,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,MAAM,EAAE,GAAG,EAAE,CAAC;IACd,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,UAAU,EAAE,MAAM,IAAI,CAAC;IACvB,QAAQ,EAAE,CAAE,YAAY,EAAE,GAAG,KAAM,IAAI,CAAC;IACxC,OAAO,CAAC,EAAE,MAAM,IAAI,CAAC;IACrB,YAAY,CAAC,EAAE,MAAM,CAAC;CACtB,CAAC;AAEF;;;;;GAKG;AACH,MAAM,CAAC,OAAO,UAAU,uBAAuB,CAAE,EAChD,UAAU,EACV,GAAG,SAAS,EACZ,EAAE;IACF,UAAU,CAAC,EAAE,MAAM,CAAC;CACpB,GAAG,oCAAoC,+BAkBvC;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/create-template-part-modal/index.tsx"],"names":[],"mappings":"AA8CA,KAAK,oCAAoC,GAAG;IAC3C,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,MAAM,EAAE,GAAG,EAAE,CAAC;IACd,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,UAAU,EAAE,MAAM,IAAI,CAAC;IACvB,QAAQ,EAAE,CAAE,YAAY,EAAE,GAAG,KAAM,IAAI,CAAC;IACxC,OAAO,CAAC,EAAE,MAAM,IAAI,CAAC;IACrB,YAAY,CAAC,EAAE,MAAM,CAAC;CACtB,CAAC;AAEF;;;;;GAKG;AACH,MAAM,CAAC,OAAO,UAAU,uBAAuB,CAAE,EAChD,UAAU,EACV,GAAG,SAAS,EACZ,EAAE;IACF,UAAU,CAAC,EAAE,MAAM,CAAC;CACpB,GAAG,oCAAoC,+BAkBvC;AAsBD;;;;;;;;;;;;GAYG;AACH,wBAAgB,+BAA+B,CAAE,EAChD,WAA6B,EAC7B,MAAW,EACX,YAA0B,EAC1B,UAAU,EACV,QAAQ,EACR,OAAO,EACP,YAAiB,GACjB,EAAE,oCAAoC,+BAiKtC"}
|
|
@@ -18,7 +18,7 @@ import type { MediaEditProps } from '../../types';
|
|
|
18
18
|
* @param {boolean} [props.hideLabelFromVision] - Whether the label should be hidden from vision.
|
|
19
19
|
* @param {boolean} [props.isExpanded] - Whether to render in an expanded form. Default `false`.
|
|
20
20
|
*
|
|
21
|
-
* @return {JSX.Element} The media edit control component.
|
|
21
|
+
* @return {React.JSX.Element} The media edit control component.
|
|
22
22
|
*
|
|
23
23
|
* @example
|
|
24
24
|
* ```tsx
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/media-edit/index.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/media-edit/index.tsx"],"names":[],"mappings":"AAuDA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,aAAa,CAAC;AAoflD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAsCG;AACH,MAAM,CAAC,OAAO,UAAU,SAAS,CAAE,IAAI,EAAI,EAC1C,IAAI,EACJ,KAAK,EACL,QAAQ,EACR,mBAAmB,EACnB,YAA0B,EAC1B,QAAQ,EACR,UAAU,EACV,QAAQ,GACR,EAAE,cAAc,CAAE,IAAI,CAAE,+BA2XxB"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Hook used to compute the styles required to move a div into a new position.
|
|
3
|
+
*
|
|
4
|
+
* The way this animation works is the following:
|
|
5
|
+
* - It first renders the element as if there was no animation.
|
|
6
|
+
* - It takes a snapshot of the position of the element to use it
|
|
7
|
+
* as a destination point for the animation.
|
|
8
|
+
* - It restores the element to the previous position using a CSS transform
|
|
9
|
+
*
|
|
10
|
+
* @param triggerAnimationOnChange Variable used to trigger the animation if it changes.
|
|
11
|
+
*/
|
|
12
|
+
export default function useMovingAnimation(triggerAnimationOnChange: unknown): import("react").RefObject<HTMLDivElement>;
|
|
13
|
+
//# sourceMappingURL=use-moving-animation.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"use-moving-animation.d.ts","sourceRoot":"","sources":["../../../src/components/media-edit/use-moving-animation.ts"],"names":[],"mappings":"AAiBA;;;;;;;;;;GAUG;AACH,MAAM,CAAC,OAAO,UAAU,kBAAkB,CACzC,wBAAwB,EAAE,OAAO,6CA+CjC"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Hook that resolves the human-readable label for the default template
|
|
3
|
+
* that would apply to a post, given its type, ID and slug.
|
|
4
|
+
*
|
|
5
|
+
* @param postType The post type.
|
|
6
|
+
* @param postId The post ID.
|
|
7
|
+
* @param slug The post slug.
|
|
8
|
+
*/
|
|
9
|
+
export declare function useDefaultTemplateLabel(postType: string | undefined, postId: string | number | undefined, slug: string | undefined): string;
|
|
10
|
+
//# sourceMappingURL=hooks.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"hooks.d.ts","sourceRoot":"","sources":["../../../src/fields/template/hooks.ts"],"names":[],"mappings":"AAsCA;;;;;;;GAOG;AACH,wBAAgB,uBAAuB,CACtC,QAAQ,EAAE,MAAM,GAAG,SAAS,EAC5B,MAAM,EAAE,MAAM,GAAG,MAAM,GAAG,SAAS,EACnC,IAAI,EAAE,MAAM,GAAG,SAAS,GACtB,MAAM,CAsER"}
|