@wordpress/editor 14.33.3 → 14.33.5
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/build/bindings/post-data.js +47 -63
- package/build/bindings/post-data.js.map +3 -3
- package/build/bindings/post-meta.js +45 -39
- package/build/bindings/post-meta.js.map +2 -2
- package/build/components/collab-sidebar/add-comment.js +9 -5
- package/build/components/collab-sidebar/add-comment.js.map +2 -2
- package/build/components/collab-sidebar/comment-author-info.js +27 -15
- package/build/components/collab-sidebar/comment-author-info.js.map +2 -2
- package/build/components/collab-sidebar/comment-indicator-toolbar.js +9 -23
- package/build/components/collab-sidebar/comment-indicator-toolbar.js.map +3 -3
- package/build/components/collab-sidebar/comment-menu-item.js +36 -6
- package/build/components/collab-sidebar/comment-menu-item.js.map +3 -3
- package/build/components/collab-sidebar/comments.js +317 -301
- package/build/components/collab-sidebar/comments.js.map +3 -3
- package/build/components/collab-sidebar/hooks.js +5 -3
- package/build/components/collab-sidebar/hooks.js.map +2 -2
- package/build/components/collab-sidebar/index.js +35 -11
- package/build/components/collab-sidebar/index.js.map +3 -3
- package/build/components/collab-sidebar/utils.js +6 -3
- package/build/components/collab-sidebar/utils.js.map +2 -2
- package/build/components/editor/index.js +2 -2
- package/build/components/editor/index.js.map +3 -3
- package/build/components/more-menu/index.js +1 -1
- package/build/components/more-menu/index.js.map +2 -2
- package/build/components/visual-editor/index.js +20 -9
- package/build/components/visual-editor/index.js.map +2 -2
- package/build/store/private-actions.js +8 -0
- package/build/store/private-actions.js.map +2 -2
- package/build/store/private-selectors.js +5 -0
- package/build/store/private-selectors.js.map +2 -2
- package/build/store/reducer.js +10 -0
- package/build/store/reducer.js.map +2 -2
- package/build-module/bindings/post-data.js +47 -63
- package/build-module/bindings/post-data.js.map +2 -2
- package/build-module/bindings/post-meta.js +45 -39
- package/build-module/bindings/post-meta.js.map +2 -2
- package/build-module/components/collab-sidebar/add-comment.js +10 -6
- package/build-module/components/collab-sidebar/add-comment.js.map +2 -2
- package/build-module/components/collab-sidebar/comment-author-info.js +27 -15
- package/build-module/components/collab-sidebar/comment-author-info.js.map +2 -2
- package/build-module/components/collab-sidebar/comment-indicator-toolbar.js +15 -25
- package/build-module/components/collab-sidebar/comment-indicator-toolbar.js.map +2 -2
- package/build-module/components/collab-sidebar/comment-menu-item.js +40 -7
- package/build-module/components/collab-sidebar/comment-menu-item.js.map +2 -2
- package/build-module/components/collab-sidebar/comments.js +319 -302
- package/build-module/components/collab-sidebar/comments.js.map +2 -2
- package/build-module/components/collab-sidebar/hooks.js +5 -3
- package/build-module/components/collab-sidebar/hooks.js.map +2 -2
- package/build-module/components/collab-sidebar/index.js +35 -11
- package/build-module/components/collab-sidebar/index.js.map +2 -2
- package/build-module/components/collab-sidebar/utils.js +6 -3
- package/build-module/components/collab-sidebar/utils.js.map +2 -2
- package/build-module/components/editor/index.js +2 -2
- package/build-module/components/editor/index.js.map +2 -2
- package/build-module/components/more-menu/index.js +1 -1
- package/build-module/components/more-menu/index.js.map +2 -2
- package/build-module/components/visual-editor/index.js +20 -9
- package/build-module/components/visual-editor/index.js.map +2 -2
- package/build-module/store/private-actions.js +7 -0
- package/build-module/store/private-actions.js.map +2 -2
- package/build-module/store/private-selectors.js +4 -0
- package/build-module/store/private-selectors.js.map +2 -2
- package/build-module/store/reducer.js +9 -0
- package/build-module/store/reducer.js.map +2 -2
- package/build-style/style-rtl.css +6 -43
- package/build-style/style.css +6 -43
- package/build-types/bindings/post-data.d.ts +18 -8
- package/build-types/bindings/post-meta.d.ts +1 -7
- package/build-types/components/collab-sidebar/add-comment.d.ts.map +1 -1
- package/build-types/components/collab-sidebar/comment-author-info.d.ts +5 -16
- package/build-types/components/collab-sidebar/comment-author-info.d.ts.map +1 -1
- package/build-types/components/collab-sidebar/comment-indicator-toolbar.d.ts.map +1 -1
- package/build-types/components/collab-sidebar/comment-menu-item.d.ts +3 -2
- package/build-types/components/collab-sidebar/comment-menu-item.d.ts.map +1 -1
- package/build-types/components/collab-sidebar/comments.d.ts +1 -1
- package/build-types/components/collab-sidebar/comments.d.ts.map +1 -1
- package/build-types/components/collab-sidebar/hooks.d.ts.map +1 -1
- package/build-types/components/collab-sidebar/index.d.ts.map +1 -1
- package/build-types/components/collab-sidebar/utils.d.ts +2 -2
- package/build-types/components/collab-sidebar/utils.d.ts.map +1 -1
- package/build-types/components/visual-editor/index.d.ts.map +1 -1
- package/build-types/store/private-actions.d.ts +7 -0
- package/build-types/store/private-actions.d.ts.map +1 -1
- package/build-types/store/private-selectors.d.ts +7 -0
- package/build-types/store/private-selectors.d.ts.map +1 -1
- package/build-types/store/reducer.d.ts +10 -0
- package/build-types/store/reducer.d.ts.map +1 -1
- package/package.json +8 -8
- package/src/bindings/post-data.js +63 -111
- package/src/bindings/post-meta.js +55 -46
- package/src/bindings/test/post-meta.js +211 -0
- package/src/components/collab-sidebar/add-comment.js +11 -6
- package/src/components/collab-sidebar/comment-author-info.js +33 -26
- package/src/components/collab-sidebar/comment-indicator-toolbar.js +19 -29
- package/src/components/collab-sidebar/comment-menu-item.js +51 -11
- package/src/components/collab-sidebar/comments.js +47 -27
- package/src/components/collab-sidebar/hooks.js +6 -4
- package/src/components/collab-sidebar/index.js +63 -27
- package/src/components/collab-sidebar/style.scss +6 -46
- package/src/components/collab-sidebar/utils.js +15 -5
- package/src/components/editor/index.js +1 -1
- package/src/components/more-menu/index.js +1 -1
- package/src/components/visual-editor/index.js +27 -6
- package/src/store/private-actions.js +13 -0
- package/src/store/private-selectors.js +10 -0
- package/src/store/reducer.js +16 -0
- package/tsconfig.tsbuildinfo +1 -1
|
@@ -28,59 +28,56 @@ const NAVIGATION_BLOCK_TYPES = [
|
|
|
28
28
|
"core/navigation-link",
|
|
29
29
|
"core/navigation-submenu"
|
|
30
30
|
];
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
31
|
+
const postDataFields = [
|
|
32
|
+
{
|
|
33
|
+
label: (0, import_i18n.__)("Post Date"),
|
|
34
|
+
args: { field: "date" },
|
|
35
|
+
type: "string"
|
|
36
|
+
},
|
|
37
|
+
{
|
|
38
|
+
label: (0, import_i18n.__)("Post Modified Date"),
|
|
39
|
+
args: { field: "modified" },
|
|
40
|
+
type: "string"
|
|
41
|
+
},
|
|
42
|
+
{
|
|
43
|
+
label: (0, import_i18n.__)("Post Link"),
|
|
44
|
+
args: { field: "link" },
|
|
45
|
+
type: "string"
|
|
45
46
|
}
|
|
46
|
-
|
|
47
|
-
|
|
47
|
+
];
|
|
48
|
+
var post_data_default = {
|
|
49
|
+
name: "core/post-data",
|
|
50
|
+
getValues({ select, context, bindings, clientId }) {
|
|
51
|
+
const allowedFields = postDataFields.map(
|
|
52
|
+
(field) => field.args.field
|
|
53
|
+
);
|
|
54
|
+
const { getBlockAttributes, getBlockName } = select(import_block_editor.store);
|
|
55
|
+
const blockName = getBlockName?.(clientId);
|
|
56
|
+
const isNavigationBlock = NAVIGATION_BLOCK_TYPES.includes(blockName);
|
|
57
|
+
let postId, postType;
|
|
58
|
+
if (isNavigationBlock) {
|
|
59
|
+
const blockAttributes = getBlockAttributes?.(clientId);
|
|
60
|
+
postId = blockAttributes?.id;
|
|
61
|
+
postType = blockAttributes?.type;
|
|
62
|
+
} else {
|
|
63
|
+
postId = context?.postId;
|
|
64
|
+
postType = context?.postType;
|
|
65
|
+
}
|
|
66
|
+
const { getEditedEntityRecord } = select(import_core_data.store);
|
|
67
|
+
const entityDataValues = getEditedEntityRecord(
|
|
48
68
|
"postType",
|
|
49
69
|
postType,
|
|
50
70
|
postId
|
|
51
71
|
);
|
|
52
|
-
dataFields = {
|
|
53
|
-
date: {
|
|
54
|
-
label: (0, import_i18n.__)("Post Date"),
|
|
55
|
-
value: entityDataValues?.date,
|
|
56
|
-
type: "string"
|
|
57
|
-
},
|
|
58
|
-
modified: {
|
|
59
|
-
label: (0, import_i18n.__)("Post Modified Date"),
|
|
60
|
-
value: entityDataValues?.modified,
|
|
61
|
-
type: "string"
|
|
62
|
-
},
|
|
63
|
-
link: {
|
|
64
|
-
label: (0, import_i18n.__)("Post Link"),
|
|
65
|
-
value: entityDataValues?.link,
|
|
66
|
-
type: "string"
|
|
67
|
-
}
|
|
68
|
-
};
|
|
69
|
-
}
|
|
70
|
-
if (!Object.keys(dataFields || {}).length) {
|
|
71
|
-
return null;
|
|
72
|
-
}
|
|
73
|
-
return dataFields;
|
|
74
|
-
}
|
|
75
|
-
var post_data_default = {
|
|
76
|
-
name: "core/post-data",
|
|
77
|
-
getValues({ select, context, bindings, clientId }) {
|
|
78
|
-
const dataFields = getPostDataFields(select, context, clientId);
|
|
79
72
|
const newValues = {};
|
|
80
|
-
for (const [attributeName,
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
73
|
+
for (const [attributeName, binding] of Object.entries(bindings)) {
|
|
74
|
+
if (!allowedFields.includes(binding.args.field)) {
|
|
75
|
+
newValues[attributeName] = {};
|
|
76
|
+
continue;
|
|
77
|
+
}
|
|
78
|
+
newValues[attributeName] = entityDataValues?.[binding.args.field] ?? postDataFields.find(
|
|
79
|
+
(field) => field.args.field === binding.args.field
|
|
80
|
+
).label;
|
|
84
81
|
}
|
|
85
82
|
return newValues;
|
|
86
83
|
},
|
|
@@ -101,7 +98,7 @@ var post_data_default = {
|
|
|
101
98
|
newData
|
|
102
99
|
);
|
|
103
100
|
},
|
|
104
|
-
canUserEditValue({ select, context
|
|
101
|
+
canUserEditValue({ select, context }) {
|
|
105
102
|
const { getBlockName, getSelectedBlockClientId } = select(import_block_editor.store);
|
|
106
103
|
const clientId = getSelectedBlockClientId();
|
|
107
104
|
const blockName = getBlockName?.(clientId);
|
|
@@ -114,10 +111,6 @@ var post_data_default = {
|
|
|
114
111
|
if (!context?.postType) {
|
|
115
112
|
return false;
|
|
116
113
|
}
|
|
117
|
-
const fieldValue = getPostDataFields(select, context, void 0)?.[args.field]?.value;
|
|
118
|
-
if (fieldValue === void 0) {
|
|
119
|
-
return false;
|
|
120
|
-
}
|
|
121
114
|
const canUserEdit = select(import_core_data.store).canUser("update", {
|
|
122
115
|
kind: "postType",
|
|
123
116
|
name: context?.postType,
|
|
@@ -128,7 +121,7 @@ var post_data_default = {
|
|
|
128
121
|
}
|
|
129
122
|
return true;
|
|
130
123
|
},
|
|
131
|
-
getFieldsList({ select
|
|
124
|
+
getFieldsList({ select }) {
|
|
132
125
|
const selectedBlock = select(import_block_editor.store).getSelectedBlock();
|
|
133
126
|
if (selectedBlock?.name !== "core/post-date") {
|
|
134
127
|
return [];
|
|
@@ -136,16 +129,7 @@ var post_data_default = {
|
|
|
136
129
|
if (NAVIGATION_BLOCK_TYPES.includes(selectedBlock?.name)) {
|
|
137
130
|
return [];
|
|
138
131
|
}
|
|
139
|
-
|
|
140
|
-
const postDataFields = getPostDataFields(select, context, clientId);
|
|
141
|
-
if (!postDataFields) {
|
|
142
|
-
return [];
|
|
143
|
-
}
|
|
144
|
-
return Object.entries(postDataFields).map(([key, field]) => ({
|
|
145
|
-
label: field.label,
|
|
146
|
-
type: field.type,
|
|
147
|
-
args: { field: key }
|
|
148
|
-
}));
|
|
132
|
+
return postDataFields;
|
|
149
133
|
}
|
|
150
134
|
};
|
|
151
135
|
//# sourceMappingURL=post-data.js.map
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../src/bindings/post-data.js"],
|
|
4
|
-
"sourcesContent": ["/**\n * WordPress dependencies\n */\nimport { __ } from '@wordpress/i18n';\nimport { store as coreDataStore } from '@wordpress/core-data';\nimport { store as blockEditorStore } from '@wordpress/block-editor';\n\n// Navigation block types that use special handling for backwards compatibility\nconst NAVIGATION_BLOCK_TYPES = [\n\t'core/navigation-link',\n\t'core/navigation-submenu',\n];\n\
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAGA,kBAAmB;AACnB,uBAAuC;AACvC,0BAA0C;AAG1C,MAAM,yBAAyB;AAAA,EAC9B;AAAA,EACA;AACD;
|
|
6
|
-
"names": ["
|
|
4
|
+
"sourcesContent": ["/**\n * WordPress dependencies\n */\nimport { __ } from '@wordpress/i18n';\nimport { store as coreDataStore } from '@wordpress/core-data';\nimport { store as blockEditorStore } from '@wordpress/block-editor';\n\n// Navigation block types that use special handling for backwards compatibility\nconst NAVIGATION_BLOCK_TYPES = [\n\t'core/navigation-link',\n\t'core/navigation-submenu',\n];\n\nconst postDataFields = [\n\t{\n\t\tlabel: __( 'Post Date' ),\n\t\targs: { field: 'date' },\n\t\ttype: 'string',\n\t},\n\t{\n\t\tlabel: __( 'Post Modified Date' ),\n\t\targs: { field: 'modified' },\n\t\ttype: 'string',\n\t},\n\t{\n\t\tlabel: __( 'Post Link' ),\n\t\targs: { field: 'link' },\n\t\ttype: 'string',\n\t},\n];\n\n/**\n * @type {WPBlockBindingsSource}\n */\nexport default {\n\tname: 'core/post-data',\n\tgetValues( { select, context, bindings, clientId } ) {\n\t\tconst allowedFields = postDataFields.map(\n\t\t\t( field ) => field.args.field\n\t\t);\n\n\t\t/*\n\t\t * BACKWARDS COMPATIBILITY: Hardcoded exception for navigation blocks.\n\t\t * Required for WordPress 6.9+ navigation blocks. DO NOT REMOVE.\n\t\t */\n\t\tconst { getBlockAttributes, getBlockName } = select( blockEditorStore );\n\t\tconst blockName = getBlockName?.( clientId );\n\t\tconst isNavigationBlock = NAVIGATION_BLOCK_TYPES.includes( blockName );\n\n\t\tlet postId, postType;\n\n\t\tif ( isNavigationBlock ) {\n\t\t\t// Navigation blocks: read from block attributes\n\t\t\tconst blockAttributes = getBlockAttributes?.( clientId );\n\t\t\tpostId = blockAttributes?.id;\n\t\t\tpostType = blockAttributes?.type;\n\t\t} else {\n\t\t\t// All other blocks: use context\n\t\t\tpostId = context?.postId;\n\t\t\tpostType = context?.postType;\n\t\t}\n\n\t\tconst { getEditedEntityRecord } = select( coreDataStore );\n\t\tconst entityDataValues = getEditedEntityRecord(\n\t\t\t'postType',\n\t\t\tpostType,\n\t\t\tpostId\n\t\t);\n\n\t\tconst newValues = {};\n\t\tfor ( const [ attributeName, binding ] of Object.entries( bindings ) ) {\n\t\t\tif ( ! allowedFields.includes( binding.args.field ) ) {\n\t\t\t\tnewValues[ attributeName ] = {};\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\tnewValues[ attributeName ] =\n\t\t\t\tentityDataValues?.[ binding.args.field ] ??\n\t\t\t\tpostDataFields.find(\n\t\t\t\t\t( field ) => field.args.field === binding.args.field\n\t\t\t\t).label;\n\t\t}\n\t\treturn newValues;\n\t},\n\tsetValues( { dispatch, context, bindings, clientId, select } ) {\n\t\tconst { getBlockName } = select( blockEditorStore );\n\n\t\tconst blockName = getBlockName?.( clientId );\n\n\t\t// Navigaton block types are read-only.\n\t\t// See https://github.com/WordPress/gutenberg/pull/72165.\n\t\tif ( NAVIGATION_BLOCK_TYPES.includes( blockName ) ) {\n\t\t\treturn false;\n\t\t}\n\t\tconst newData = {};\n\t\tObject.values( bindings ).forEach( ( { args, newValue } ) => {\n\t\t\tnewData[ args.field ] = newValue;\n\t\t} );\n\n\t\tdispatch( coreDataStore ).editEntityRecord(\n\t\t\t'postType',\n\t\t\tcontext?.postType,\n\t\t\tcontext?.postId,\n\t\t\tnewData\n\t\t);\n\t},\n\tcanUserEditValue( { select, context } ) {\n\t\tconst { getBlockName, getSelectedBlockClientId } =\n\t\t\tselect( blockEditorStore );\n\t\tconst clientId = getSelectedBlockClientId();\n\t\tconst blockName = getBlockName?.( clientId );\n\n\t\t// Navigaton block types are read-only.\n\t\t// See https://github.com/WordPress/gutenberg/pull/72165.\n\t\tif ( NAVIGATION_BLOCK_TYPES.includes( blockName ) ) {\n\t\t\treturn false;\n\t\t}\n\n\t\t// Lock editing in query loop.\n\t\tif ( context?.query || context?.queryId ) {\n\t\t\treturn false;\n\t\t}\n\n\t\t// Lock editing when `postType` is not defined.\n\t\tif ( ! context?.postType ) {\n\t\t\treturn false;\n\t\t}\n\n\t\t// Check that the user has the capability to edit post data.\n\t\tconst canUserEdit = select( coreDataStore ).canUser( 'update', {\n\t\t\tkind: 'postType',\n\t\t\tname: context?.postType,\n\t\t\tid: context?.postId,\n\t\t} );\n\t\tif ( ! canUserEdit ) {\n\t\t\treturn false;\n\t\t}\n\n\t\treturn true;\n\t},\n\tgetFieldsList( { select } ) {\n\t\tconst selectedBlock = select( blockEditorStore ).getSelectedBlock();\n\t\tif ( selectedBlock?.name !== 'core/post-date' ) {\n\t\t\treturn [];\n\t\t}\n\t\t// Exit early for navigation blocks (read-only)\n\t\tif ( NAVIGATION_BLOCK_TYPES.includes( selectedBlock?.name ) ) {\n\t\t\treturn [];\n\t\t}\n\n\t\treturn postDataFields;\n\t},\n};\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAGA,kBAAmB;AACnB,uBAAuC;AACvC,0BAA0C;AAG1C,MAAM,yBAAyB;AAAA,EAC9B;AAAA,EACA;AACD;AAEA,MAAM,iBAAiB;AAAA,EACtB;AAAA,IACC,WAAO,gBAAI,WAAY;AAAA,IACvB,MAAM,EAAE,OAAO,OAAO;AAAA,IACtB,MAAM;AAAA,EACP;AAAA,EACA;AAAA,IACC,WAAO,gBAAI,oBAAqB;AAAA,IAChC,MAAM,EAAE,OAAO,WAAW;AAAA,IAC1B,MAAM;AAAA,EACP;AAAA,EACA;AAAA,IACC,WAAO,gBAAI,WAAY;AAAA,IACvB,MAAM,EAAE,OAAO,OAAO;AAAA,IACtB,MAAM;AAAA,EACP;AACD;AAKA,IAAO,oBAAQ;AAAA,EACd,MAAM;AAAA,EACN,UAAW,EAAE,QAAQ,SAAS,UAAU,SAAS,GAAI;AACpD,UAAM,gBAAgB,eAAe;AAAA,MACpC,CAAE,UAAW,MAAM,K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,MACT,SAAS;AAAA,MACT;AAAA,IACD;AAAA,EACD;AAAA,EACA,iBAAkB,EAAE,QAAQ,QAAQ,GAAI;AACvC,UAAM,EAAE,cAAc,yBAAyB,IAC9C,OAAQ,oBAAAD,KAAiB;AAC1B,UAAM,WAAW,yBAAyB;AAC1C,UAAM,YAAY,eAAgB,QAAS;AAI3C,QAAK,uBAAuB,SAAU,SAAU,GAAI;AACnD,aAAO;AAAA,IACR;AAGA,QAAK,SAAS,SAAS,SAAS,SAAU;AACzC,aAAO;AAAA,IACR;AAGA,QAAK,CAAE,SAAS,UAAW;AAC1B,aAAO;AAAA,IACR;AAGA,UAAM,cAAc,OAAQ,iBAAAC,KAAc,EAAE,QAAS,UAAU;AAAA,MAC9D,MAAM;AAAA,MACN,MAAM,SAAS;AAAA,MACf,IAAI,SAAS;AAAA,IACd,CAAE;AACF,QAAK,CAAE,aAAc;AACpB,aAAO;AAAA,IACR;AAEA,WAAO;AAAA,EACR;AAAA,EACA,cAAe,EAAE,OAAO,GAAI;AAC3B,UAAM,gBAAgB,OAAQ,oBAAAD,KAAiB,EAAE,iBAAiB;AAClE,QAAK,eAAe,SAAS,kBAAmB;AAC/C,aAAO,CAAC;AAAA,IACT;AAEA,QAAK,uBAAuB,SAAU,eAAe,IAAK,GAAI;AAC7D,aAAO,CAAC;AAAA,IACT;AAEA,WAAO;AAAA,EACR;AACD;",
|
|
6
|
+
"names": ["blockEditorStore", "coreDataStore"]
|
|
7
7
|
}
|
|
@@ -25,45 +25,51 @@ var import_core_data = require("@wordpress/core-data");
|
|
|
25
25
|
var import_store = require("../store");
|
|
26
26
|
var import_lock_unlock = require("../lock-unlock");
|
|
27
27
|
function getPostMetaFields(select, context) {
|
|
28
|
-
const { getEditedEntityRecord } = select(import_core_data.store);
|
|
29
28
|
const { getRegisteredPostMeta } = (0, import_lock_unlock.unlock)(select(import_core_data.store));
|
|
30
|
-
let entityMetaValues;
|
|
31
|
-
if (context?.postType && context?.postId) {
|
|
32
|
-
entityMetaValues = getEditedEntityRecord(
|
|
33
|
-
"postType",
|
|
34
|
-
context?.postType,
|
|
35
|
-
context?.postId
|
|
36
|
-
).meta;
|
|
37
|
-
}
|
|
38
29
|
const registeredFields = getRegisteredPostMeta(context?.postType);
|
|
39
|
-
const metaFields =
|
|
40
|
-
Object.entries(registeredFields
|
|
41
|
-
if (key
|
|
42
|
-
|
|
43
|
-
label: props.title || key,
|
|
44
|
-
value: (
|
|
45
|
-
// When using the entity value, an empty string IS a valid value.
|
|
46
|
-
entityMetaValues?.[key] ?? // When using the default, an empty string IS NOT a valid value.
|
|
47
|
-
(props.default || void 0)
|
|
48
|
-
),
|
|
49
|
-
type: props.type
|
|
50
|
-
};
|
|
30
|
+
const metaFields = [];
|
|
31
|
+
Object.entries(registeredFields).forEach(([key, props]) => {
|
|
32
|
+
if (key === "footnotes" || key.charAt(0) === "_") {
|
|
33
|
+
return;
|
|
51
34
|
}
|
|
35
|
+
metaFields.push({
|
|
36
|
+
label: props.title || key,
|
|
37
|
+
args: { key },
|
|
38
|
+
default: props.default,
|
|
39
|
+
type: props.type
|
|
40
|
+
});
|
|
52
41
|
});
|
|
53
|
-
if (!Object.keys(metaFields || {}).length) {
|
|
54
|
-
return null;
|
|
55
|
-
}
|
|
56
42
|
return metaFields;
|
|
57
43
|
}
|
|
44
|
+
function getValue({ select, context, args }) {
|
|
45
|
+
const metaFields = getPostMetaFields(select, context);
|
|
46
|
+
const metaField = metaFields.find(
|
|
47
|
+
(field) => field.args.key === args.key
|
|
48
|
+
);
|
|
49
|
+
if (!metaField) {
|
|
50
|
+
return args.key;
|
|
51
|
+
}
|
|
52
|
+
if (!context?.postId) {
|
|
53
|
+
return metaField.default || metaField.label || args.key;
|
|
54
|
+
}
|
|
55
|
+
const { getEditedEntityRecord } = select(import_core_data.store);
|
|
56
|
+
const entityMetaValues = getEditedEntityRecord(
|
|
57
|
+
"postType",
|
|
58
|
+
context?.postType,
|
|
59
|
+
context?.postId
|
|
60
|
+
).meta;
|
|
61
|
+
return entityMetaValues?.[args.key] ?? metaField?.label ?? args.key;
|
|
62
|
+
}
|
|
58
63
|
var post_meta_default = {
|
|
59
64
|
name: "core/post-meta",
|
|
60
65
|
getValues({ select, context, bindings }) {
|
|
61
|
-
const metaFields = getPostMetaFields(select, context);
|
|
62
66
|
const newValues = {};
|
|
63
|
-
for (const [attributeName,
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
+
for (const [attributeName, binding] of Object.entries(bindings)) {
|
|
68
|
+
newValues[attributeName] = getValue({
|
|
69
|
+
select,
|
|
70
|
+
context,
|
|
71
|
+
args: binding.args
|
|
72
|
+
});
|
|
67
73
|
}
|
|
68
74
|
return newValues;
|
|
69
75
|
},
|
|
@@ -88,8 +94,11 @@ var post_meta_default = {
|
|
|
88
94
|
if (!context?.postType) {
|
|
89
95
|
return false;
|
|
90
96
|
}
|
|
91
|
-
const
|
|
92
|
-
|
|
97
|
+
const metaFields = getPostMetaFields(select, context);
|
|
98
|
+
const hasMatchingMetaField = metaFields.some(
|
|
99
|
+
(field) => field.args.key === args.key
|
|
100
|
+
);
|
|
101
|
+
if (!hasMatchingMetaField) {
|
|
93
102
|
return false;
|
|
94
103
|
}
|
|
95
104
|
const areCustomFieldsEnabled = select(import_store.store).getEditorSettings().enableCustomFields;
|
|
@@ -108,14 +117,11 @@ var post_meta_default = {
|
|
|
108
117
|
},
|
|
109
118
|
getFieldsList({ select, context }) {
|
|
110
119
|
const metaFields = getPostMetaFields(select, context);
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
type: field.type,
|
|
117
|
-
args: { key }
|
|
118
|
-
}));
|
|
120
|
+
return metaFields.map(
|
|
121
|
+
({ default: defaultProp, ...otherProps }) => ({
|
|
122
|
+
...otherProps
|
|
123
|
+
})
|
|
124
|
+
);
|
|
119
125
|
}
|
|
120
126
|
};
|
|
121
127
|
//# sourceMappingURL=post-meta.js.map
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../src/bindings/post-meta.js"],
|
|
4
|
-
"sourcesContent": ["/**\n * WordPress dependencies\n */\nimport { store as coreDataStore } from '@wordpress/core-data';\n\n/**\n * Internal dependencies\n */\nimport { store as editorStore } from '../store';\nimport { unlock } from '../lock-unlock';\n\n/**\n * Gets a list of post meta fields with their values and labels\n * to be consumed in the needed callbacks.\n * If the value is not available based on context, like in templates,\n * it falls back to the default value, label, or key.\n *\n * @param {Object} select The select function from the data store.\n * @param {Object} context The context provided.\n * @return {Object} List of post meta fields with their value and label.\n *\n * @example\n * ```js\n * {\n * field_1_key: {\n * label: 'Field 1 Label',\n * value: 'Field 1 Value',\n * },\n * field_2_key: {\n * label: 'Field 2 Label',\n * value: 'Field 2 Value',\n * },\n * ...\n * }\n * ```\n */\nfunction getPostMetaFields( select, context ) {\n\tconst {
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAGA,uBAAuC;AAKvC,mBAAqC;AACrC,yBAAuB;AA2BvB,SAAS,kBAAmB,QAAQ,SAAU;AAC7C,QAAM,EAAE,sBAAsB,
|
|
4
|
+
"sourcesContent": ["/**\n * WordPress dependencies\n */\nimport { store as coreDataStore } from '@wordpress/core-data';\n\n/**\n * Internal dependencies\n */\nimport { store as editorStore } from '../store';\nimport { unlock } from '../lock-unlock';\n\n/**\n * Gets a list of post meta fields with their values and labels\n * to be consumed in the needed callbacks.\n * If the value is not available based on context, like in templates,\n * it falls back to the default value, label, or key.\n *\n * @param {Object} select The select function from the data store.\n * @param {Object} context The context provided.\n * @return {Object} List of post meta fields with their value and label.\n *\n * @example\n * ```js\n * {\n * field_1_key: {\n * label: 'Field 1 Label',\n * value: 'Field 1 Value',\n * },\n * field_2_key: {\n * label: 'Field 2 Label',\n * value: 'Field 2 Value',\n * },\n * ...\n * }\n * ```\n */\nfunction getPostMetaFields( select, context ) {\n\tconst { getRegisteredPostMeta } = unlock( select( coreDataStore ) );\n\n\tconst registeredFields = getRegisteredPostMeta( context?.postType );\n\tconst metaFields = [];\n\tObject.entries( registeredFields ).forEach( ( [ key, props ] ) => {\n\t\t// Don't include footnotes or private fields.\n\t\tif ( key === 'footnotes' || key.charAt( 0 ) === '_' ) {\n\t\t\treturn;\n\t\t}\n\n\t\tmetaFields.push( {\n\t\t\tlabel: props.title || key,\n\t\t\targs: { key },\n\t\t\tdefault: props.default,\n\t\t\ttype: props.type,\n\t\t} );\n\t} );\n\n\treturn metaFields;\n}\n\nfunction getValue( { select, context, args } ) {\n\tconst metaFields = getPostMetaFields( select, context );\n\tconst metaField = metaFields.find(\n\t\t( field ) => field.args.key === args.key\n\t);\n\n\t// If the meta field was not found, it's either protected, inaccessible, or simply doesn't exist.\n\tif ( ! metaField ) {\n\t\treturn args.key;\n\t}\n\n\t// Without a postId, we cannot look up a meta value.\n\tif ( ! context?.postId ) {\n\t\t// Return the default value for the meta field if available.\n\t\treturn metaField.default || metaField.label || args.key;\n\t}\n\n\tconst { getEditedEntityRecord } = select( coreDataStore );\n\tconst entityMetaValues = getEditedEntityRecord(\n\t\t'postType',\n\t\tcontext?.postType,\n\t\tcontext?.postId\n\t).meta;\n\n\treturn entityMetaValues?.[ args.key ] ?? metaField?.label ?? args.key;\n}\n\n/**\n * @type {WPBlockBindingsSource}\n */\nexport default {\n\tname: 'core/post-meta',\n\tgetValues( { select, context, bindings } ) {\n\t\tconst newValues = {};\n\t\tfor ( const [ attributeName, binding ] of Object.entries( bindings ) ) {\n\t\t\tnewValues[ attributeName ] = getValue( {\n\t\t\t\tselect,\n\t\t\t\tcontext,\n\t\t\t\targs: binding.args,\n\t\t\t} );\n\t\t}\n\t\treturn newValues;\n\t},\n\tsetValues( { dispatch, context, bindings } ) {\n\t\tconst newMeta = {};\n\t\tObject.values( bindings ).forEach( ( { args, newValue } ) => {\n\t\t\tnewMeta[ args.key ] = newValue;\n\t\t} );\n\n\t\tdispatch( coreDataStore ).editEntityRecord(\n\t\t\t'postType',\n\t\t\tcontext?.postType,\n\t\t\tcontext?.postId,\n\t\t\t{\n\t\t\t\tmeta: newMeta,\n\t\t\t}\n\t\t);\n\t},\n\tcanUserEditValue( { select, context, args } ) {\n\t\t// Lock editing in query loop.\n\t\tif ( context?.query || context?.queryId ) {\n\t\t\treturn false;\n\t\t}\n\n\t\t// Lock editing when `postType` is not defined.\n\t\tif ( ! context?.postType ) {\n\t\t\treturn false;\n\t\t}\n\n\t\tconst metaFields = getPostMetaFields( select, context );\n\t\tconst hasMatchingMetaField = metaFields.some(\n\t\t\t( field ) => field.args.key === args.key\n\t\t);\n\t\tif ( ! hasMatchingMetaField ) {\n\t\t\treturn false;\n\t\t}\n\n\t\t// Check that custom fields metabox is not enabled.\n\t\tconst areCustomFieldsEnabled =\n\t\t\tselect( editorStore ).getEditorSettings().enableCustomFields;\n\t\tif ( areCustomFieldsEnabled ) {\n\t\t\treturn false;\n\t\t}\n\n\t\t// Check that the user has the capability to edit post meta.\n\t\tconst canUserEdit = select( coreDataStore ).canUser( 'update', {\n\t\t\tkind: 'postType',\n\t\t\tname: context?.postType,\n\t\t\tid: context?.postId,\n\t\t} );\n\t\tif ( ! canUserEdit ) {\n\t\t\treturn false;\n\t\t}\n\n\t\treturn true;\n\t},\n\tgetFieldsList( { select, context } ) {\n\t\tconst metaFields = getPostMetaFields( select, context );\n\t\t// Remove 'default' property from meta fields.\n\t\treturn metaFields.map(\n\t\t\t( { default: defaultProp, ...otherProps } ) => ( {\n\t\t\t\t...otherProps,\n\t\t\t} )\n\t\t);\n\t},\n};\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAGA,uBAAuC;AAKvC,mBAAqC;AACrC,yBAAuB;AA2BvB,SAAS,kBAAmB,QAAQ,SAAU;AAC7C,QAAM,EAAE,sBAAsB,QAAI,2BAAQ,OAAQ,iBAAAA,KAAc,CAAE;AAElE,Q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 function AddComment({
|
|
|
61
61
|
};
|
|
62
62
|
}, []);
|
|
63
63
|
const blockElement = useBlockElement(clientId);
|
|
64
|
+
const { toggleBlockSpotlight } = (0, import_lock_unlock.unlock)((0, import_data.useDispatch)(import_block_editor.store));
|
|
65
|
+
const unselectThread = () => {
|
|
66
|
+
setShowCommentBoard(false);
|
|
67
|
+
blockElement?.focus();
|
|
68
|
+
toggleBlockSpotlight(clientId, false);
|
|
69
|
+
};
|
|
64
70
|
if (!showCommentBoard || !clientId || void 0 !== blockCommentId) {
|
|
65
71
|
return null;
|
|
66
72
|
}
|
|
@@ -76,7 +82,7 @@ function AddComment({
|
|
|
76
82
|
spacing: "3",
|
|
77
83
|
tabIndex: 0,
|
|
78
84
|
"aria-label": (0, import_i18n.__)("New note"),
|
|
79
|
-
role: "
|
|
85
|
+
role: "treeitem",
|
|
80
86
|
ref: isFloating ? refs.setFloating : void 0,
|
|
81
87
|
style: isFloating ? (
|
|
82
88
|
// Delay showing the floating note box until a Y position is known to prevent blink.
|
|
@@ -86,6 +92,7 @@ function AddComment({
|
|
|
86
92
|
if (event.currentTarget.contains(event.relatedTarget)) {
|
|
87
93
|
return;
|
|
88
94
|
}
|
|
95
|
+
toggleBlockSpotlight(clientId, false);
|
|
89
96
|
setShowCommentBoard(false);
|
|
90
97
|
},
|
|
91
98
|
children: [
|
|
@@ -98,10 +105,7 @@ function AddComment({
|
|
|
98
105
|
(0, import_utils.focusCommentThread)(id, commentSidebarRef.current);
|
|
99
106
|
setShowCommentBoard(false);
|
|
100
107
|
},
|
|
101
|
-
onCancel:
|
|
102
|
-
setShowCommentBoard(false);
|
|
103
|
-
blockElement?.focus();
|
|
104
|
-
},
|
|
108
|
+
onCancel: unselectThread,
|
|
105
109
|
reflowComments,
|
|
106
110
|
submitButtonText: (0, import_i18n.__)("Add note"),
|
|
107
111
|
labelText: (0, import_i18n.__)("New note")
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../src/components/collab-sidebar/add-comment.js"],
|
|
4
|
-
"sourcesContent": ["/**\n * External dependencies\n */\nimport clsx from 'clsx';\n/**\n * WordPress dependencies\n */\nimport { __ } from '@wordpress/i18n';\nimport { useSelect } from '@wordpress/data';\nimport {\n\t__experimentalHStack as HStack,\n\t__experimentalVStack as VStack,\n} from '@wordpress/components';\nimport {\n\tstore as blockEditorStore,\n\tprivateApis as blockEditorPrivateApis,\n} from '@wordpress/block-editor';\n\n/**\n * Internal dependencies\n */\nimport { unlock } from '../../lock-unlock';\nimport CommentAuthorInfo from './comment-author-info';\nimport CommentForm from './comment-form';\nimport { focusCommentThread, noop } from './utils';\n\nconst { useBlockElement } = unlock( blockEditorPrivateApis );\n\nexport function AddComment( {\n\tonSubmit,\n\tshowCommentBoard,\n\tsetShowCommentBoard,\n\tcommentSidebarRef,\n\treflowComments = noop,\n\tisFloating = false,\n\ty,\n\trefs,\n} ) {\n\tconst { clientId, blockCommentId } = useSelect( ( select ) => {\n\t\tconst { getSelectedBlock } = select( blockEditorStore );\n\t\tconst selectedBlock = getSelectedBlock();\n\t\treturn {\n\t\t\tclientId: selectedBlock?.clientId,\n\t\t\tblockCommentId: selectedBlock?.attributes?.metadata?.noteId,\n\t\t};\n\t}, [] );\n\tconst blockElement = useBlockElement( clientId );\n\n\tif ( ! showCommentBoard || ! clientId || undefined !== blockCommentId ) {\n\t\treturn null;\n\t}\n\n\treturn (\n\t\t<VStack\n\t\t\tclassName={ clsx(\n\t\t\t\t'editor-collab-sidebar-panel__thread is-selected',\n\t\t\t\t{\n\t\t\t\t\t'is-floating': isFloating,\n\t\t\t\t}\n\t\t\t) }\n\t\t\tspacing=\"3\"\n\t\t\ttabIndex={ 0 }\n\t\t\taria-label={ __( 'New note' ) }\n\t\t\trole=\"
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;
|
|
4
|
+
"sourcesContent": ["/**\n * External dependencies\n */\nimport clsx from 'clsx';\n/**\n * WordPress dependencies\n */\nimport { __ } from '@wordpress/i18n';\nimport { useSelect, useDispatch } from '@wordpress/data';\nimport {\n\t__experimentalHStack as HStack,\n\t__experimentalVStack as VStack,\n} from '@wordpress/components';\nimport {\n\tstore as blockEditorStore,\n\tprivateApis as blockEditorPrivateApis,\n} from '@wordpress/block-editor';\n\n/**\n * Internal dependencies\n */\nimport { unlock } from '../../lock-unlock';\nimport CommentAuthorInfo from './comment-author-info';\nimport CommentForm from './comment-form';\nimport { focusCommentThread, noop } from './utils';\n\nconst { useBlockElement } = unlock( blockEditorPrivateApis );\n\nexport function AddComment( {\n\tonSubmit,\n\tshowCommentBoard,\n\tsetShowCommentBoard,\n\tcommentSidebarRef,\n\treflowComments = noop,\n\tisFloating = false,\n\ty,\n\trefs,\n} ) {\n\tconst { clientId, blockCommentId } = useSelect( ( select ) => {\n\t\tconst { getSelectedBlock } = select( blockEditorStore );\n\t\tconst selectedBlock = getSelectedBlock();\n\t\treturn {\n\t\t\tclientId: selectedBlock?.clientId,\n\t\t\tblockCommentId: selectedBlock?.attributes?.metadata?.noteId,\n\t\t};\n\t}, [] );\n\tconst blockElement = useBlockElement( clientId );\n\tconst { toggleBlockSpotlight } = unlock( useDispatch( blockEditorStore ) );\n\n\tconst unselectThread = () => {\n\t\tsetShowCommentBoard( false );\n\t\tblockElement?.focus();\n\t\ttoggleBlockSpotlight( clientId, false );\n\t};\n\n\tif ( ! showCommentBoard || ! clientId || undefined !== blockCommentId ) {\n\t\treturn null;\n\t}\n\n\treturn (\n\t\t<VStack\n\t\t\tclassName={ clsx(\n\t\t\t\t'editor-collab-sidebar-panel__thread is-selected',\n\t\t\t\t{\n\t\t\t\t\t'is-floating': isFloating,\n\t\t\t\t}\n\t\t\t) }\n\t\t\tspacing=\"3\"\n\t\t\ttabIndex={ 0 }\n\t\t\taria-label={ __( 'New note' ) }\n\t\t\trole=\"treeitem\"\n\t\t\tref={ isFloating ? refs.setFloating : undefined }\n\t\t\tstyle={\n\t\t\t\tisFloating\n\t\t\t\t\t? // Delay showing the floating note box until a Y position is known to prevent blink.\n\t\t\t\t\t { top: y, opacity: ! y ? 0 : undefined }\n\t\t\t\t\t: undefined\n\t\t\t}\n\t\t\tonBlur={ ( event ) => {\n\t\t\t\tif ( event.currentTarget.contains( event.relatedTarget ) ) {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\ttoggleBlockSpotlight( clientId, false );\n\t\t\t\tsetShowCommentBoard( false );\n\t\t\t} }\n\t\t>\n\t\t\t<HStack alignment=\"left\" spacing=\"3\">\n\t\t\t\t<CommentAuthorInfo />\n\t\t\t</HStack>\n\t\t\t<CommentForm\n\t\t\t\tonSubmit={ async ( inputComment ) => {\n\t\t\t\t\tconst { id } = await onSubmit( { content: inputComment } );\n\t\t\t\t\tfocusCommentThread( id, commentSidebarRef.current );\n\t\t\t\t\tsetShowCommentBoard( false );\n\t\t\t\t} }\n\t\t\t\tonCancel={ unselectThread }\n\t\t\t\treflowComments={ reflowComments }\n\t\t\t\tsubmitButtonText={ __( 'Add note' ) }\n\t\t\t\tlabelText={ __( 'New note' ) }\n\t\t\t/>\n\t\t</VStack>\n\t);\n}\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AA4DE;AAzDF,kBAAiB;AAIjB,kBAAmB;AACnB,kBAAuC;AACvC,wBAGO;AACP,0BAGO;AAKP,yBAAuB;AACvB,iCAA8B;AAC9B,0BAAwB;AACxB,mBAAyC;AAEzC,MAAM,EAAE,gBAAgB,QAAI,2BAAQ,oBAAAA,WAAuB;AAEpD,SAAS,WAAY;AAAA,EAC3B;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA,iBAAiB;AAAA,EACjB,aAAa;AAAA,EACb;AAAA,EACA;AACD,GAAI;AACH,QAAM,EAAE,UAAU,eAAe,QAAI,uBAAW,CAAE,WAAY;AAC7D,U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D,mDAAoB,IAAI,kBAAkB,OAAQ;AAClD,kCAAqB,KAAM;AAAA,YAC5B;AAAA,YACA,UAAW;AAAA,YACX;AAAA,YACA,sBAAmB,gBAAI,UAAW;AAAA,YAClC,eAAY,gBAAI,UAAW;AAAA;AAAA,QAC5B;AAAA;AAAA;AAAA,EACD;AAEF;",
|
|
6
6
|
"names": ["blockEditorPrivateApis", "blockEditorStore", "VStack", "clsx", "HStack", "CommentAuthorInfo", "CommentForm"]
|
|
7
7
|
}
|
|
@@ -30,26 +30,38 @@ var import_data = require("@wordpress/data");
|
|
|
30
30
|
var import_block_editor = require("@wordpress/block-editor");
|
|
31
31
|
var import_utils = require("./utils");
|
|
32
32
|
function CommentAuthorInfo({ avatar, name, date, userId }) {
|
|
33
|
+
const hasAvatar = !!avatar;
|
|
33
34
|
const dateSettings = (0, import_date.getSettings)();
|
|
34
35
|
const {
|
|
35
36
|
currentUserAvatar,
|
|
36
37
|
currentUserName,
|
|
37
38
|
currentUserId,
|
|
38
39
|
dateFormat = dateSettings.formats.date
|
|
39
|
-
} = (0, import_data.useSelect)(
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
40
|
+
} = (0, import_data.useSelect)(
|
|
41
|
+
(select) => {
|
|
42
|
+
const { canUser, getCurrentUser, getEntityRecord } = select(import_core_data.store);
|
|
43
|
+
const siteSettings = canUser("read", {
|
|
44
|
+
kind: "root",
|
|
45
|
+
name: "site"
|
|
46
|
+
}) ? getEntityRecord("root", "site") : void 0;
|
|
47
|
+
if (hasAvatar) {
|
|
48
|
+
return {
|
|
49
|
+
dateFormat: siteSettings?.date_format
|
|
50
|
+
};
|
|
51
|
+
}
|
|
52
|
+
const { getSettings } = select(import_block_editor.store);
|
|
53
|
+
const { __experimentalDiscussionSettings } = getSettings();
|
|
54
|
+
const defaultAvatar = __experimentalDiscussionSettings?.avatarURL;
|
|
55
|
+
const userData = getCurrentUser();
|
|
56
|
+
return {
|
|
57
|
+
currentUserAvatar: userData?.avatar_urls?.[48] ?? defaultAvatar,
|
|
58
|
+
currentUserName: userData?.name,
|
|
59
|
+
currentUserId: userData?.id,
|
|
60
|
+
dateFormat: siteSettings?.date_format
|
|
61
|
+
};
|
|
62
|
+
},
|
|
63
|
+
[hasAvatar]
|
|
64
|
+
);
|
|
53
65
|
const commentDate = (0, import_date.getDate)(date);
|
|
54
66
|
const commentDateTime = (0, import_date.dateI18n)("c", commentDate);
|
|
55
67
|
const shouldShowHumanTimeDiff = Math.floor((/* @__PURE__ */ new Date() - commentDate) / (1e3 * 60 * 60 * 24)) < 30;
|
|
@@ -77,7 +89,7 @@ function CommentAuthorInfo({ avatar, name, date, userId }) {
|
|
|
77
89
|
),
|
|
78
90
|
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_components.__experimentalVStack, { spacing: "0", children: [
|
|
79
91
|
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", { className: "editor-collab-sidebar-panel__user-name", children: name ?? currentUserName }),
|
|
80
|
-
date && /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_components.Tooltip, {
|
|
92
|
+
date && /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_components.Tooltip, { text: tooltipText, children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
81
93
|
"time",
|
|
82
94
|
{
|
|
83
95
|
dateTime: commentDateTime,
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../src/components/collab-sidebar/comment-author-info.js"],
|
|
4
|
-
"sourcesContent": ["/**\n * WordPress dependencies\n */\nimport { Tooltip, __experimentalVStack as VStack } from '@wordpress/components';\nimport { __, _x } from '@wordpress/i18n';\nimport {\n\tdateI18n,\n\tgetSettings as getDateSettings,\n\thumanTimeDiff,\n\tgetDate,\n} from '@wordpress/date';\nimport { store as coreStore } from '@wordpress/core-data';\nimport { useSelect } from '@wordpress/data';\nimport { store as blockEditorStore } from '@wordpress/block-editor';\n\n/**\n * Internal dependencies\n */\nimport { getAvatarBorderColor } from './utils';\n\
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;
|
|
4
|
+
"sourcesContent": ["/**\n * WordPress dependencies\n */\nimport { Tooltip, __experimentalVStack as VStack } from '@wordpress/components';\nimport { __, _x } from '@wordpress/i18n';\nimport {\n\tdateI18n,\n\tgetSettings as getDateSettings,\n\thumanTimeDiff,\n\tgetDate,\n} from '@wordpress/date';\nimport { store as coreStore } from '@wordpress/core-data';\nimport { useSelect } from '@wordpress/data';\nimport { store as blockEditorStore } from '@wordpress/block-editor';\n\n/**\n * Internal dependencies\n */\nimport { getAvatarBorderColor } from './utils';\n\nfunction CommentAuthorInfo( { avatar, name, date, userId } ) {\n\tconst hasAvatar = !! avatar;\n\tconst dateSettings = getDateSettings();\n\tconst {\n\t\tcurrentUserAvatar,\n\t\tcurrentUserName,\n\t\tcurrentUserId,\n\t\tdateFormat = dateSettings.formats.date,\n\t} = useSelect(\n\t\t( select ) => {\n\t\t\tconst { canUser, getCurrentUser, getEntityRecord } =\n\t\t\t\tselect( coreStore );\n\t\t\tconst siteSettings = canUser( 'read', {\n\t\t\t\tkind: 'root',\n\t\t\t\tname: 'site',\n\t\t\t} )\n\t\t\t\t? getEntityRecord( 'root', 'site' )\n\t\t\t\t: undefined;\n\n\t\t\tif ( hasAvatar ) {\n\t\t\t\treturn {\n\t\t\t\t\tdateFormat: siteSettings?.date_format,\n\t\t\t\t};\n\t\t\t}\n\n\t\t\tconst { getSettings } = select( blockEditorStore );\n\t\t\tconst { __experimentalDiscussionSettings } = getSettings();\n\t\t\tconst defaultAvatar = __experimentalDiscussionSettings?.avatarURL;\n\t\t\tconst userData = getCurrentUser();\n\t\t\treturn {\n\t\t\t\tcurrentUserAvatar:\n\t\t\t\t\tuserData?.avatar_urls?.[ 48 ] ?? defaultAvatar,\n\t\t\t\tcurrentUserName: userData?.name,\n\t\t\t\tcurrentUserId: userData?.id,\n\t\t\t\tdateFormat: siteSettings?.date_format,\n\t\t\t};\n\t\t},\n\t\t[ hasAvatar ]\n\t);\n\n\tconst commentDate = getDate( date );\n\tconst commentDateTime = dateI18n( 'c', commentDate );\n\tconst shouldShowHumanTimeDiff =\n\t\tMath.floor( ( new Date() - commentDate ) / ( 1000 * 60 * 60 * 24 ) ) <\n\t\t30;\n\n\tconst commentDateText = shouldShowHumanTimeDiff\n\t\t? humanTimeDiff( commentDate )\n\t\t: dateI18n( dateFormat, commentDate );\n\n\tconst tooltipText = dateI18n(\n\t\t// translators: Use a non-breaking space between 'g:i' and 'a' if appropriate.\n\t\t_x( 'F j, Y g:i\\xa0a', 'Note date full date format' ),\n\t\tdate\n\t);\n\n\treturn (\n\t\t<>\n\t\t\t<img\n\t\t\t\tsrc={ avatar || currentUserAvatar }\n\t\t\t\tclassName=\"editor-collab-sidebar-panel__user-avatar\"\n\t\t\t\t// translators: alt text for user avatar image\n\t\t\t\talt={ __( 'User avatar' ) }\n\t\t\t\twidth={ 32 }\n\t\t\t\theight={ 32 }\n\t\t\t\tstyle={ {\n\t\t\t\t\tborderColor: getAvatarBorderColor(\n\t\t\t\t\t\tuserId ?? currentUserId\n\t\t\t\t\t),\n\t\t\t\t} }\n\t\t\t/>\n\t\t\t<VStack spacing=\"0\">\n\t\t\t\t<span className=\"editor-collab-sidebar-panel__user-name\">\n\t\t\t\t\t{ name ?? currentUserName }\n\t\t\t\t</span>\n\t\t\t\t{ date && (\n\t\t\t\t\t<Tooltip text={ tooltipText }>\n\t\t\t\t\t\t<time\n\t\t\t\t\t\t\tdateTime={ commentDateTime }\n\t\t\t\t\t\t\tclassName=\"editor-collab-sidebar-panel__user-time\"\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t{ commentDateText }\n\t\t\t\t\t\t</time>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BAAkB,MAAO,KAAK,KAAK,GAAK,IACnE;AAED,QAAM,kBAAkB,8BACrB,2BAAe,WAAY,QAC3B,sBAAU,YAAY,WAAY;AAErC,QAAM,kBAAc;AAAA;AAAA,QAEnB,gBAAI,mBAAmB,4BAA6B;AAAA,IACpD;AAAA,EACD;AAEA,SACC,4EACC;AAAA;AAAA,MAAC;AAAA;AAAA,QACA,KAAM,UAAU;AAAA,QAChB,WAAU;AAAA,QAEV,SAAM,gBAAI,aAAc;AAAA,QACxB,OAAQ;AAAA,QACR,QAAS;AAAA,QACT,OAAQ;AAAA,UACP,iBAAa;AAAA,YACZ,UAAU;AAAA,UACX;AAAA,QACD;AAAA;AAAA,IACD;AAAA,IACA,6CAAC,kBAAAC,sBAAA,EAAO,SAAQ,KACf;AAAA,kDAAC,UAAK,WAAU,0CACb,kBAAQ,iBACX;AAAA,MACE,QACD,4CAAC,6BAAQ,MAAO,aACf;AAAA,QAAC;AAAA;AAAA,UACA,UAAW;AAAA,UACX,WAAU;AAAA,UAER;AAAA;AAAA,MACH,GACD;AAAA,OAEF;AAAA,KACD;AAEF;AAEA,IAAO,8BAAQ;",
|
|
6
6
|
"names": ["getDateSettings", "coreStore", "blockEditorStore", "VStack"]
|
|
7
7
|
}
|
|
@@ -55,23 +55,18 @@ const CommentAvatarIndicator = ({ onClick, thread }) => {
|
|
|
55
55
|
return null;
|
|
56
56
|
}
|
|
57
57
|
const maxAvatars = 3;
|
|
58
|
-
const
|
|
59
|
-
const
|
|
58
|
+
const isOverflow = threadParticipants.length > maxAvatars;
|
|
59
|
+
const visibleParticipants = isOverflow ? threadParticipants.slice(0, maxAvatars - 1) : threadParticipants;
|
|
60
|
+
const overflowCount = Math.max(
|
|
61
|
+
0,
|
|
62
|
+
threadParticipants.length - visibleParticipants.length
|
|
63
|
+
);
|
|
60
64
|
const threadHasMoreParticipants = threadParticipants.length > 100;
|
|
61
65
|
const overflowText = threadHasMoreParticipants && overflowCount > 0 ? (0, import_i18n.__)("100+") : (0, import_i18n.sprintf)(
|
|
62
66
|
// translators: %s: Number of participants.
|
|
63
67
|
(0, import_i18n.__)("+%s"),
|
|
64
68
|
overflowCount
|
|
65
69
|
);
|
|
66
|
-
const overflowTitle = threadHasMoreParticipants && overflowCount > 0 ? (0, import_i18n.__)("100+ participants") : (0, import_i18n.sprintf)(
|
|
67
|
-
// translators: %s: Number of participants.
|
|
68
|
-
(0, import_i18n._n)(
|
|
69
|
-
"+%s more participant",
|
|
70
|
-
"+%s more participants",
|
|
71
|
-
overflowCount
|
|
72
|
-
),
|
|
73
|
-
overflowCount
|
|
74
|
-
);
|
|
75
70
|
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(CommentIconToolbarSlotFill.Fill, { children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
76
71
|
import_components.ToolbarButton,
|
|
77
72
|
{
|
|
@@ -79,15 +74,14 @@ const CommentAvatarIndicator = ({ onClick, thread }) => {
|
|
|
79
74
|
label: (0, import_i18n.__)("View notes"),
|
|
80
75
|
onClick,
|
|
81
76
|
showTooltip: true,
|
|
82
|
-
children: /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(
|
|
83
|
-
visibleParticipants.map((participant
|
|
77
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_components.__experimentalHStack, { spacing: "1", children: [
|
|
78
|
+
visibleParticipants.map((participant) => /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
84
79
|
"img",
|
|
85
80
|
{
|
|
86
81
|
src: participant.avatar,
|
|
87
82
|
alt: participant.name,
|
|
88
83
|
className: "comment-avatar",
|
|
89
84
|
style: {
|
|
90
|
-
zIndex: maxAvatars - index,
|
|
91
85
|
borderColor: (0, import_utils.getAvatarBorderColor)(
|
|
92
86
|
participant.id
|
|
93
87
|
)
|
|
@@ -95,15 +89,7 @@ const CommentAvatarIndicator = ({ onClick, thread }) => {
|
|
|
95
89
|
},
|
|
96
90
|
participant.id
|
|
97
91
|
)),
|
|
98
|
-
overflowCount > 0 && /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
99
|
-
"div",
|
|
100
|
-
{
|
|
101
|
-
className: "comment-avatar-overflow",
|
|
102
|
-
style: { zIndex: 0 },
|
|
103
|
-
title: overflowTitle,
|
|
104
|
-
children: overflowText
|
|
105
|
-
}
|
|
106
|
-
)
|
|
92
|
+
overflowCount > 0 && /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_components.__experimentalText, { weight: 500, children: overflowText })
|
|
107
93
|
] })
|
|
108
94
|
}
|
|
109
95
|
) });
|